commit ebc39cd5dd714bf5a78695b36d095a9e73880c6b Author: UnknownMp Date: Wed Jun 18 10:24:27 2025 +0800 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45fb742 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +data/** + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +__MACOSX/* diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..d281be5 --- /dev/null +++ b/admin.php @@ -0,0 +1,71 @@ +init_cron = false; +$discuz->init(); + +$admincp = new discuz_admincp(); +$admincp->core = & $discuz; +$admincp->init(); + + +$admincp_actions_founder = array('templates', 'db', 'founder', 'postsplit', 'threadsplit', 'cloudaddons', 'optimizer', 'runtests'); +$admincp_actions_normal = array('index', 'setting', 'members', 'admingroup', 'usergroups', 'usertag', + 'forums', 'threadtypes', 'threads', 'moderate', 'attach', 'smilies', 'recyclebin', 'recyclebinpost', 'prune', 'grid', + 'styles', 'addons', 'plugins', 'tasks', 'magics', 'medals', 'announce', 'faq', 'ec', 'remoderate', 'smsgw', + 'tradelog', 'jswizard', 'project', 'counter', 'misc', 'adv', 'logs', 'tools', 'portalperm', 'blogrecyclebin', + 'checktools', 'search', 'article', 'block', 'blockstyle', 'blockxml', 'portalcategory', 'blogcategory', 'albumcategory', 'topic', 'credits', + 'doing', 'group', 'blog', 'feed', 'album', 'pic', 'comment', 'share', 'click', 'specialuser', 'postsplit', 'threadsplit', 'report', + 'district', 'diytemplate', 'verify', 'nav', 'domain', 'postcomment', 'tag', 'connect', 'card', 'portalpermission', 'collection', 'membersplit', 'makehtml'); + +$action = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('action')); +$operation = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('operation')); +$do = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('do')); +$frames = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('frames')); +lang('admincp'); +$lang = & $_G['lang']['admincp']; +$page = max(1, intval(getgpc('page'))); +$isfounder = $admincp->isfounder; + +if(empty($action) || $frames != null) { + $admincp->show_admincp_main(); +} elseif($action == 'logout') { + $admincp->do_admin_logout(); + dheader("Location: ./index.php"); +} elseif(in_array($action, $admincp_actions_normal) || ($admincp->isfounder && in_array($action, $admincp_actions_founder))) { + if($admincp->allow($action, $operation, $do) || $action == 'index') { + require $admincp->admincpfile($action); + } else { + cpheader(); + cpmsg('action_noaccess', '', 'error'); + } +} else { + cpheader(); + if($action == 'cloudaddons') { + cpmsg('cloudaddons_noaccess', '', 'error'); + } else { + cpmsg('action_noaccess', '', 'error'); + } +} +?> \ No newline at end of file diff --git a/api.php b/api.php new file mode 100644 index 0000000..79601de --- /dev/null +++ b/api.php @@ -0,0 +1,32 @@ + 'javascript/javascript', 'ad' => 'javascript/advertisement'); + +$mod = !empty($_GET['mod']) ? $_GET['mod'] : ''; +if(empty($mod) || !in_array($mod, array('js', 'ad'))) { + exit('Access Denied'); +} + +require_once './api/'.$modarray[$mod].'.php'; + +function loadcore() { + global $_G; + require_once './source/class/class_core.php'; + + $discuz = C::app(); + $discuz->init_cron = false; + $discuz->init_session = false; + $discuz->init(); +} + +?> \ No newline at end of file diff --git a/api/addons/channel.htm b/api/addons/channel.htm new file mode 100644 index 0000000..2f3a04a --- /dev/null +++ b/api/addons/channel.htm @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/api/addons/index.htm b/api/addons/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/addons/zendcheck.php b/api/addons/zendcheck.php new file mode 100644 index 0000000..8d15616 --- /dev/null +++ b/api/addons/zendcheck.php @@ -0,0 +1,9 @@ += '5.3') { + include 'zendcheck53.php'; +} else { + include 'zendcheck52.php'; +} + +?> \ No newline at end of file diff --git a/api/addons/zendcheck52.php b/api/addons/zendcheck52.php new file mode 100644 index 0000000..2828349 --- /dev/null +++ b/api/addons/zendcheck52.php @@ -0,0 +1,3 @@ +init(); +if(getgpc('m') !== 'user' || getgpc('a') !== 'rectavatar') { + exit; +} +loaducenter(); +if(!UC_AVTPATH) { + $avtpath = './data/avatar/'; +} else { + $avtpath = str_replace('..', '', UC_AVTPATH); +} +define('UC_UPAVTDIR', realpath(DISCUZ_ROOT.$avtpath).'/'); +if(!empty($_G['uid'])) { + echo uc_rectavatar($_G['uid']); +} else { + echo uc_rectavatar(0); +} \ No newline at end of file diff --git a/api/db/dbbak.php b/api/db/dbbak.php new file mode 100644 index 0000000..43bd2f3 --- /dev/null +++ b/api/db/dbbak.php @@ -0,0 +1,795 @@ + 3600) { + exit('Authorization has expired'); +} +$get['time'] = $timestamp; + +class dbstuffi { + var $querynum = 0; + var $link; + var $histories; + var $time; + var $tablepre; + + function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset = '', $pconnect = 0, $tablepre='', $time = 0) { + $this->time = $time; + $this->tablepre = $tablepre; + + mysqli_report(MYSQLI_REPORT_OFF); + + $this->link = new mysqli(); + if(!$this->link->real_connect($dbhost, $dbuser, $dbpw, $dbname, null, null, MYSQLI_CLIENT_COMPRESS)) { + $this->halt('Can not connect to MySQL server'); + } + + if($dbcharset) { + $this->link->set_charset($dbcharset); + } + + $this->link->query("SET sql_mode=''"); + + $this->link->query("SET character_set_client=binary"); + + } + + function fetch_array($query, $result_type = MYSQLI_ASSOC) { + return $query ? $query->fetch_array($result_type) : null; + } + + function result_first($sql) { + $query = $this->query($sql); + return $this->result($query, 0); + } + + function fetch_first($sql) { + $query = $this->query($sql); + return $this->fetch_array($query); + } + + function fetch_all($sql) { + $arr = array(); + $query = $this->query($sql); + while($data = $this->fetch_array($query)) { + $arr[] = $data; + } + return $arr; + } + + function cache_gc() { + $this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time"); + } + + function query($sql, $type = '', $cachetime = FALSE) { + $resultmode = $type == 'UNBUFFERED' ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT; + if(!($query = $this->link->query($sql, $resultmode)) && $type != 'SILENT') { + $this->halt('MySQL Query Error', $sql); + } + $this->querynum++; + $this->histories[] = $sql; + return $query; + } + + function affected_rows() { + return $this->link->affected_rows; + } + + function error() { + return $this->link->error; + } + + function errno() { + return $this->link->errno; + } + + function result($query, $row) { + if(!$query || $query->num_rows == 0) { + return null; + } + $query->data_seek($row); + $assocs = $query->fetch_row(); + return $assocs[0]; + } + + function num_rows($query) { + $query = $query ? $query->num_rows : 0; + return $query; + } + + function num_fields($query) { + return $query ? $query->field_count : 0; + } + + function free_result($query) { + return $query ? $query->free() : false; + } + + function insert_id() { + return ($id = $this->link->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); + } + + function fetch_row($query) { + $query = $query ? $query->fetch_row() : null; + return $query; + } + + function fetch_fields($query) { + return $query ? $query->fetch_field() : null; + } + + function version() { + return $this->link->server_info; + } + + function escape_string($str) { + return $this->link->escape_string($str); + } + + function close() { + return $this->link->close(); + } + + function halt($message = '', $sql = '') { + api_msg('run_sql_error', $message.'

'.$sql.'
'.$this->link->error()); + } +} + + +$db = new dbstuffi(); +$version = ''; +if($apptype == 'discuz') { + + define('BACKUP_DIR', ROOT_PATH.'forumdata/'); + $tablepre = $tablepre; + if(empty($dbcharset)) { + $dbcharset = in_array(strtolower($charset), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $charset) : ''; + } + $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre); + define('IN_DISCUZ', true); + include ROOT_PATH.'discuz_version.php'; + $version = DISCUZ_VERSION; + +} elseif($apptype == 'uchome' || $apptype == 'supesite') { + + define('BACKUP_DIR', ROOT_PATH.'./data/'); + $tablepre = $_SC['tablepre']; + $dbcharset = $_SC['dbcharset']; + $db->connect($_SC['dbhost'], $_SC['dbuser'], $_SC['dbpw'], $_SC['dbname'], $dbcharset, $_SC['pconnect'], $tablepre); + +} elseif($apptype == 'ucenter') { + + define('BACKUP_DIR', ROOT_PATH.'./data/backup/'); + $tablepre = UC_DBTABLEPRE; + $dbcharset = UC_DBCHARSET; + $db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, $dbcharset, UC_DBCONNECT, $tablepre); + +} elseif($apptype == 'ecmall') { + + define('BACKUP_DIR', ROOT_PATH.'./data/backup/'); + $tablepre = DB_PREFIX; + $dbcharset = strtolower(str_replace('-', '', strstr(LANG, '-'))); + $cfg = parse_url(DB_CONFIG); + if(empty($cfg['pass'])) { + $cfg['pass'] = ''; + } else { + $cfg['pass'] = urldecode($cfg['pass']); + } + $cfg['user'] = urldecode($cfg['user']); + $cfg['path'] = str_replace('/', '', $cfg['path']); + + $db->connect($cfg['host'].':'.$cfg['port'], $cfg['user'], $cfg['pass'], $cfg['path'], $dbcharset, 0, $tablepre); + +} elseif($apptype == 'supev') { + + define('BACKUP_DIR', ROOT_PATH.'data/backup/'); + $tablepre = $tablepre; + if(empty($dbcharset)) { + $dbcharset = in_array(strtolower($_config['output']['charset']), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', CHARSET) : ''; + } + $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre); + +} elseif($apptype == 'ecshop') { + + define('BACKUP_DIR', ROOT_PATH.'data/backup/'); + $tablepre = $prefix; + $dbcharset = 'utf8'; + $db->connect($db_host, $db_user, $db_pass, $db_name, $dbcharset, 0, $tablepre); + +} elseif($apptype == 'discuzx') { + + define('BACKUP_DIR', ROOT_PATH.'data/'); + extract($_config['db']['1']); + if(empty($dbcharset)) { + $dbcharset = in_array(strtolower(CHARSET), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $_config['output']['charset']) : ''; + } + $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre); + define('IN_DISCUZ', true); + include ROOT_PATH.'source/discuz_version.php'; + $version = DISCUZ_VERSION; + +} + +if($get['method'] == 'export') { + + $db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT'); + + $time = date("Y-m-d H:i:s", $timestamp); + + $tables = array(); + $tables = arraykeys2(fetchtablelist($tablepre), 'Name'); + + if($apptype == 'discuz') { + $query = $db->query("SELECT datatables FROM {$tablepre}plugins WHERE datatables<>''"); + while($plugin = $db->fetch_array($query)) { + foreach(explode(',', $plugin['datatables']) as $table) { + if($table = trim($table)) { + $tables[] = $table; + } + } + } + } + if($apptype == 'discuzx') { + $query = $db->query("SELECT datatables FROM {$tablepre}common_plugin WHERE datatables<>''"); + while($plugin = $db->fetch_array($query)) { + foreach(explode(',', $plugin['datatables']) as $table) { + if($table = trim($table)) { + $tables[] = $table; + } + } + } + } + + $memberexist = array_search("{$tablepre}common_member", $tables); + if($memberexist !== FALSE) { + unset($tables[$memberexist]); + array_unshift($tables, "{$tablepre}common_member"); + } + + $get['volume'] = isset($get['volume']) ? intval($get['volume']) : 0; + $get['volume'] = $get['volume'] + 1; + $version = $version ? $version : $apptype; + $idstring = '# Identify: '.base64_encode("$timestamp,$version,$apptype,multivol,{$get['volume']}")."\n"; + + if(!isset($get['sqlpath']) || empty($get['sqlpath'])) { + $get['sqlpath'] = 'backup_'.date('ymd', $timestamp).'_'.random(6); + if(!mkdir(BACKUP_DIR.'./'.$get['sqlpath'], 0777)) { + api_msg('mkdir_error', 'make dir error:'.BACKUP_DIR.'./'.$get['sqlpath']); + } + } else { + $get['sqlpath'] = str_replace(array('/', '\\', '.', "'"), '', $get['sqlpath']); + if(!is_dir(BACKUP_DIR.'./'.$get['sqlpath'])) { + if(!mkdir(BACKUP_DIR.'./'.$get['sqlpath'], 0777)) { + api_msg('mkdir_error', 'make dir error:'.BACKUP_DIR.'./'.$get['sqlpath']); + } + } + } + + if(!isset($get['backupfilename']) || empty($get['backupfilename'])) { + $get['backupfilename'] = date('ymd', $timestamp).'_'.random(6); + } + + $sqldump = ''; + $get['tableid'] = isset($get['tableid']) ? intval($get['tableid']) : 0; + $get['startfrom'] = isset($get['startfrom']) ? intval($get['startfrom']) : 0; + + if(!$get['tableid'] && $get['volume'] == 1) { + foreach($tables as $table) { + $sqldump .= sqldumptablestruct($table); + } + } + $complete = TRUE; + for(; $complete && $get['tableid'] < count($tables) && strlen($sqldump) + 500 < $sizelimit * 1000; $get['tableid']++) { + $sqldump .= sqldumptable($tables[$get['tableid']], strlen($sqldump)); + if($complete) { + $get['startfrom'] = 0; + } + } + + !$complete && $get['tableid']--; + $dumpfile = BACKUP_DIR.$get['sqlpath'].'/'.$get['backupfilename'].'-'.$get['volume'].'.sql'; + if(trim($sqldump)) { + $sqldump = "$idstring". + "# \n". + "# $apptype Multi-Volume Data Dump Vol.{$get['volume']}\n". + "# Time: $time\n". + "# Type: $apptype\n". + "# Table Prefix: $tablepre\n". + "# $dbcharset\n". + "# $apptype Home: https://www.discuz.vip\n". + "# Please visit our website for newest infomation about $apptype\n". + "# --------------------------------------------------------\n\n\n". + $sqldump; + $fp = fopen($dumpfile, 'cb'); + if(!($fp && flock($fp, LOCK_EX) && ftruncate($fp, 0) && fwrite($fp, $sqldump) && fflush($fp) && flock($fp, LOCK_UN) && fclose($fp))) { + flock($fp, LOCK_UN); + fclose($fp); + api_msg('database_export_file_invalid', $dumpfile); + } else { + auto_next($get, $dumpfile); + } + } else { + @touch(BACKUP_DIR.$get['sqlpath'].'/index.htm'); + api_msg('explor_success', 'explor_success'); + } + +} elseif($get['method'] == 'import') { + + if(!isset($get['dumpfile']) || empty($get['dumpfile'])) { + $get['dumpfile'] = get_dumpfile_by_path($get['sqlpath']); + $get['volume'] = 0; + } + + if(!preg_match('/^backup_(\d+)_\w+$/', $get['sqlpath']) || !preg_match('/^\d+_\w+\-(\d+).sql$/', $get['dumpfile'])) { + api_msg('bak_file_lose', $get['dumpfile']); + } + + $get['volume']++; + $next_dumpfile = preg_replace('/^(\d+)\_(\w+)\-(\d+)\.sql$/', '\\1_\\2-'.$get['volume'].'.sql', $get['dumpfile']); + if(!is_file(BACKUP_DIR.$get['sqlpath'].'/'.$get['dumpfile'])) { + if(is_file(BACKUP_DIR.$get['sqlpath'].'/'.$next_dumpfile)) { + api_msg('bak_file_lose', $get['dumpfile']); + } else { + api_msg('import_success', 'import_success'); + } + } + + $sqldump = file_get_contents(BACKUP_DIR.$get['sqlpath'].'/'.$get['dumpfile']); + $sqlquery = splitsql($sqldump); + unset($sqldump); + + foreach($sqlquery as $sql) { + $sql = syntablestruct(trim($sql), true, $dbcharset); + + if($sql != '') { + $db->query($sql, 'SILENT'); + if(($sqlerror = $db->error()) && $db->errno() != 1062) { + $db->halt('MySQL Query Error', $sql); + } + } + } + + $cur_file = $get['dumpfile']; + $get['dumpfile'] = $next_dumpfile; + auto_next($get, BACKUP_DIR.$get['sqlpath'].'/'.$cur_file); + +} elseif($get['method'] == 'ping') { + + if($get['dir'] && is_dir(BACKUP_DIR.$get['dir'])) { + echo "1";exit; + } else { + echo "-1";exit; + } + +} elseif($get['method'] == 'list') { + + $str = "\n"; + $directory = dir(BACKUP_DIR); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$entry; + if(is_dir($filename) && preg_match('/^backup_(\d+)_\w+$/', $entry, $match)) { + $str .= "\t\n"; + $str .= "\t\t$filename\n"; + $str .= "\t\t$match[1]\n"; + $str .= "\t\n"; + } + } + $directory->close(); + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + +} elseif($get['method'] == 'view') { + + $sqlpath = trim($get['sqlpath']); + if(empty($sqlpath) || !is_dir(BACKUP_DIR.$sqlpath)) { + api_msg('dir_no_exists', $sqlpath); + } + + $str = "\n"; + $directory = dir(BACKUP_DIR.$sqlpath); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$sqlpath.'/'.$entry; + if(is_file($filename) && preg_match('/\d+_\w+\-(\d+).sql$/', $filename, $match)) { + $str .= "\t\n"; + $str .= "\t\t$match[0]\n"; + $str .= "\t\t".filesize($filename)."\n"; + $str .= "\t\t$match[1]\n"; + $str .= "\t\t".str_replace(ROOT_PATH, (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].'/', $filename)."\n"; + $str .= "\t\t".filemtime($filename)."\n"; + $str .= "\t\n"; + } + } + $directory->close(); + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + +} elseif($get['method'] == 'delete') { + + $sqlpath = trim($get['sqlpath']); + if(empty($sqlpath) || !is_dir(BACKUP_DIR.$sqlpath) || !preg_match('/^backup_(\d+)_\w+$/', $get['sqlpath'])) { + api_msg('dir_no_exists', $sqlpath); + } + $directory = dir(BACKUP_DIR.$sqlpath); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$sqlpath.'/'.$entry; + if(is_file($filename) && preg_match('/^\d+_\w+\-(\d+).sql$/', $entry) && !@unlink($filename)) { + api_msg('delete_dumpfile_error', $filename); + } + } + $directory->close(); + @rmdir(BACKUP_DIR.$sqlpath); + api_msg('delete_sqlpath_success', 'delete_sqlpath_success'); + +} + +function syntablestruct($sql, $version, $dbcharset) { + + if(strpos(trim(substr($sql, 0, 18)), 'CREATE TABLE') === FALSE) { + return $sql; + } + + $sqlversion = strpos($sql, 'ENGINE=') === FALSE ? FALSE : TRUE; + + if($sqlversion === $version) { + + return $sqlversion && $dbcharset ? preg_replace(array('/ character set \w+/i', '/ collate \w+/i', "/DEFAULT CHARSET=\w+/is"), array('', '', "DEFAULT CHARSET=$dbcharset"), $sql) : $sql; + } + + if($version) { + return preg_replace(array('/TYPE=HEAP/i', '/TYPE=(\w+)/is'), array("ENGINE=MEMORY DEFAULT CHARSET=$dbcharset", "ENGINE=\\1 DEFAULT CHARSET=$dbcharset"), $sql); + + } else { + return preg_replace(array('/character set \w+/i', '/collate \w+/i', '/ENGINE=MEMORY/i', '/\s*DEFAULT CHARSET=\w+/is', '/\s*COLLATE=\w+/is', '/ENGINE=(\w+)(.*)/is'), array('', '', 'ENGINE=HEAP', '', '', 'TYPE=\\1\\2'), $sql); + } +} + +function splitsql($sql) { + $sql = str_replace("\r", "\n", $sql); + $ret = array(); + $num = 0; + $queriesarray = explode(";\n", trim($sql)); + unset($sql); + foreach($queriesarray as $query) { + $ret[$num] = isset($ret[$num]) ? $ret[$num] : ''; + $queries = explode("\n", trim($query)); + foreach($queries as $query) { + $ret[$num] .= isset($query[0]) && $query[0] == "#" ? NULL : $query; + } + $num++; + } + return($ret); +} + +function get_dumpfile_by_path($path) { + if(empty($path) || !is_dir(BACKUP_DIR.$path)) { + api_msg('sqlpath_null_noexists', $path); + } + $directory = dir(BACKUP_DIR.$path); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$path.'/'.$entry; + if(is_file($filename)) { + if(preg_match('/^\d+\_\w+\-\d+\.sql$/', $entry)) { + $file_bakfile = preg_replace('/^(\d+)\_(\w+)\-(\d+)\.sql$/', '\\1_\\2-1.sql', $entry); + if(is_file(BACKUP_DIR.$path.'/'.$file_bakfile)) { + return $file_bakfile; + } else { + api_msg('sqlpath_nomatch_bakfile', $path); + } + } + } + } + $directory->close(); + api_msg('sqlpath_nomatch_bakfile', $path); +} + +function api_msg($code, $msg) { + $msg = htmlspecialchars($msg); + $out = "\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= ""; + send_mime_type_header(); + echo $out; + exit; +} + +function arraykeys2($array, $key2) { + $return = array(); + foreach($array as $val) { + $return[] = $val[$key2]; + } + return $return; +} + +function auto_next($get, $sqlfile) { + $next_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?apptype='.$GLOBALS['apptype'].'&code='.urlencode(encode_arr($get)); + $out = "\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= "\t\t{$get['volume']}\n"; + $out .= "\t\t".filesize($sqlfile)."\n"; + $out .= "\t\t".basename($sqlfile)."\n"; + $out .= "\t\t".str_replace(ROOT_PATH, (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].'/', $sqlfile)."\n"; + $out .= "\t\t".filemtime($sqlfile)."\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= ""; + send_mime_type_header(); + echo $out; + exit; +} + +function encode_arr($get) { + $tmp = ''; + foreach($get as $key => $val) { + $tmp .= '&'.$key.'='.$val; + } + return _authcode($tmp, 'ENCODE', UC_KEY); +} + +function sqldumptablestruct($table) { + global $db; + + $createtable = $db->query("SHOW CREATE TABLE $table", 'SILENT'); + + if(!$db->error()) { + $tabledump = "DROP TABLE IF EXISTS $table;\n"; + } else { + return ''; + } + + $create = $db->fetch_row($createtable); + + if(strpos($table, '.') !== FALSE) { + $tablename = substr($table, strpos($table, '.') + 1); + $create[1] = str_replace("CREATE TABLE $tablename", 'CREATE TABLE '.$table, $create[1]); + } + $tabledump .= $create[1]; + + $tablestatus = $db->fetch_first("SHOW TABLE STATUS LIKE '$table'"); + $tabledump .= ($tablestatus['Auto_increment'] ? " AUTO_INCREMENT={$tablestatus['Auto_increment']}" : '').";\n\n"; + return $tabledump; +} + +function sqldumptable($table, $currsize = 0) { + global $get, $db, $sizelimit, $startrow, $extendins, $sqlcompat, $sqlcharset, $dumpcharset, $usehex, $complete, $excepttables; + + $offset = 300; + $tabledump = ''; + $tablefields = array(); + + $query = $db->query("SHOW FULL COLUMNS FROM $table", 'SILENT'); + if(strexists($table, 'adminsessions')) { + return ; + } elseif(!$query && $db->errno() == 1146) { + return; + } elseif(!$query) { + $usehex = FALSE; + } else { + while($fieldrow = $db->fetch_array($query)) { + $tablefields[] = $fieldrow; + } + } + + $tabledumped = 0; + $numrows = $offset; + $firstfield = $tablefields[0]; + + while($currsize + strlen($tabledump) + 500 < $sizelimit * 1000 && $numrows == $offset) { + if($firstfield['Extra'] == 'auto_increment') { + $selectsql = "SELECT * FROM $table WHERE {$firstfield['Field']} > {$get['startfrom']} LIMIT $offset"; + } else { + $selectsql = "SELECT * FROM $table LIMIT {$get['startfrom']}, $offset"; + } + $tabledumped = 1; + $rows = $db->query($selectsql); + $numfields = $db->num_fields($rows); + + $numrows = $db->num_rows($rows); + while($row = $db->fetch_row($rows)) { + $comma = $t = ''; + for($i = 0; $i < $numfields; $i++) { + $t .= $comma.($usehex && !empty($row[$i]) && (strexists($tablefields[$i]['Type'], 'char') || strexists($tablefields[$i]['Type'], 'text')) ? '0x'.bin2hex($row[$i]) : '\''.$db->escape_string($row[$i]).'\''); + $comma = ','; + } + if(strlen($t) + $currsize + strlen($tabledump) + 500 < $sizelimit * 1000) { + if($firstfield['Extra'] == 'auto_increment') { + $get['startfrom'] = $row[0]; + } else { + $get['startfrom']++; + } + $tabledump .= "INSERT INTO $table VALUES ($t);\n"; + } else { + $complete = FALSE; + break 2; + } + } + } + + $tabledump .= "\n"; + + return $tabledump; +} + +function random($length, $numeric = 0) { + $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35); + $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed)); + if($numeric) { + $hash = ''; + } else { + $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64); + $length--; + } + $max = strlen($seed) - 1; + for($i = 0; $i < $length; $i++) { + $hash .= $seed[mt_rand(0, $max)]; + } + return $hash; +} + +function fetchtablelist($tablepre = '') { + global $db; + $arr = explode('.', $tablepre); + $dbname = isset($arr[1]) && $arr[1] ? $arr[0] : ''; + $tablepre = str_replace('_', '\_', $tablepre); + $sqladd = $dbname ? " FROM $dbname LIKE '$arr[1]%'" : "LIKE '$tablepre%'"; + $tables = $table = array(); + $query = $db->query("SHOW TABLE STATUS $sqladd"); + while($table = $db->fetch_array($query)) { + $table['Name'] = ($dbname ? "$dbname." : '').$table['Name']; + $tables[] = $table; + } + return $tables; +} + +function _authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + $ckey_length = 4; + + $key = md5($key ? $key : UC_KEY); + $keya = md5(substr($key, 0, 16)); + $keyb = md5(substr($key, 16, 16)); + $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; + + $cryptkey = $keya.md5($keya.$keyc); + $key_length = strlen($cryptkey); + + $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; + $string_length = strlen($string); + + $result = ''; + $box = range(0, 255); + + $rndkey = array(); + for($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($cryptkey[$i % $key_length]); + } + + for($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + + for($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); + } + + if($operation == 'DECODE') { + if(((int)substr($result, 0, 10) == 0 || (int)substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26).$keyb), 0, 16)) { + return substr($result, 26); + } else { + return ''; + } + } else { + return $keyc.str_replace('=', '', base64_encode($result)); + } + +} + +function strexists($haystack, $needle) { + return !(strpos($haystack, $needle) === FALSE); +} + +function send_mime_type_header($type = 'application/xml') { + header("Content-Type: ".$type); +} + +function is_https() { + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { + return true; + } + return false; +} + +?> \ No newline at end of file diff --git a/api/db/index.htm b/api/db/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/index.htm b/api/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/api/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/api/javascript/advertisement.php b/api/javascript/advertisement.php new file mode 100644 index 0000000..5fc22dc --- /dev/null +++ b/api/javascript/advertisement.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/api/javascript/index.htm b/api/javascript/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/javascript/javascript.php b/api/javascript/javascript.php new file mode 100644 index 0000000..09854f3 --- /dev/null +++ b/api/javascript/javascript.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/api/mobile/index.php b/api/mobile/index.php new file mode 100644 index 0000000..455ff23 --- /dev/null +++ b/api/mobile/index.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/api/payment/index.htm b/api/payment/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/payment/notify/index.htm b/api/payment/notify/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/payment/notify/notify_alipay.php b/api/payment/notify/notify_alipay.php new file mode 100644 index 0000000..a86d51d --- /dev/null +++ b/api/payment/notify/notify_alipay.php @@ -0,0 +1,48 @@ +init(); + +if(!$_POST['sign'] || !$_POST['sign_type']) { + exit('fail'); +} +$sign = $_POST['sign']; +unset($_POST['sign']); + +$payment = new payment_alipay(); +$isright = $payment->alipay_sign_verify($sign, $_POST); +if(!$isright) { + $_POST['sign'] = $sign; + payment::paymentlog('alipay', 0, 0, 0, 50001, $_POST); + exit('fail'); +} + +if($_POST['trade_status'] == 'TRADE_SUCCESS') { + $out_biz_no = $_POST['out_trade_no']; + $payment_time = strtotime($_POST['gmt_payment']); + + $is_success = payment::finish_order('alipay', $out_biz_no, $_POST['trade_no'], $payment_time); + if($is_success) { + exit('success'); + } +} else { + payment::paymentlog('alipay', 0, 0, 0, 50001, $_POST); +} + +exit('fail'); + +?> \ No newline at end of file diff --git a/api/payment/notify/notify_qpay.php b/api/payment/notify/notify_qpay.php new file mode 100644 index 0000000..b1eb80a --- /dev/null +++ b/api/payment/notify/notify_qpay.php @@ -0,0 +1,37 @@ +init(); + +$payment = new payment_qpay(); + +$data = $payment->qpay_sign_verify(); +if($data && $data['code'] == 200) { + $data = $data['data']; + $out_biz_no = $data['out_trade_no']; + $payment_time = strtotime(preg_replace('/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/', '$1-$2-$3 $4:$5:$6', $data['time_end'])); + $is_success = payment::finish_order('qpay', $out_biz_no, $data['transaction_id'], $payment_time); + if($is_success) { + echo ''; + exit(); + } +} else { + payment::paymentlog('qpay', 0, 0, 0, 50001, $data ? json_encode($data) : ''); +} + +echo ''; +exit(); \ No newline at end of file diff --git a/api/payment/notify/notify_wechat.php b/api/payment/notify/notify_wechat.php new file mode 100644 index 0000000..ee461af --- /dev/null +++ b/api/payment/notify/notify_wechat.php @@ -0,0 +1,55 @@ +init(); + +$payment = new payment_wechat(); +if($_SERVER['HTTP_WECHATPAY_SIGNATURE']) { + $data = $payment->v3_wechat_sign_verify(); + if($data && $data['code'] == 200) { + $data = json_decode($data['data'], true); + if($data['trade_state'] == 'SUCCESS') { + $out_biz_no = $data['out_trade_no']; + $payment_time = strtotime($data['success_time']); + $is_success = payment::finish_order('wechat', $out_biz_no, $data['transaction_id'], $payment_time); + if($is_success) { + exit('{"code":"SUCCESS","message":"ok"}'); + } + } + } else { + payment::paymentlog('wechat', 0, 0, 0, 50001, $data ? json_encode($data) : ''); + } + exit('{"code":"fail","message":"fail"}'); +} else { + $data = $payment->wechat_sign_verify(); + if($data && $data['code'] == 200) { + $data = $data['data']; + $out_biz_no = $data['out_trade_no']; + $payment_time = strtotime(preg_replace('/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/', '$1-$2-$3 $4:$5:$6', $data['time_end'])); + $is_success = payment::finish_order('wechat', $out_biz_no, $data['transaction_id'], $payment_time); + if($is_success) { + echo ''; + exit(); + } + } else { + payment::paymentlog('wechat', 0, 0, 0, 50001, $data ? json_encode($data) : ''); + } + echo ''; + exit(); +} + +?> \ No newline at end of file diff --git a/api/payment/payment_alipay.php b/api/payment/payment_alipay.php new file mode 100644 index 0000000..86db7ee --- /dev/null +++ b/api/payment/payment_alipay.php @@ -0,0 +1,496 @@ +settings = C::t('common_setting')->fetch_setting('ec_alipay', true); + $this->notify_url = $_G['siteurl'] . 'api/payment/notify/notify_alipay.php'; + parent::__construct(); + } + + public function pay($order) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + if(defined('IN_MOBILE')) { + return $this->alipay_trade_wap_pay($order); + } else { + return $this->alipay_trade_page_pay($order); + } + } + + public function status($out_biz_no) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + return $this->alipay_trade_query($out_biz_no); + } + + public function refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + return $this->alipay_refund($refund_no, $trade_no, $refund_amount, $refund_desc); + } + + public function refund_status($refund_no, $trade_no) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + return $this->alipay_refund_status($refund_no, $trade_no); + } + + public function transfer($transfer_no, $amount, $realname, $account, $title = '', $desc = '') { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + return $this->alipay_fund_trans_uni_transfer($transfer_no, $amount, $realname, $account, $title, $desc); + } + + public function transfer_status($transfer_no) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + return $this->alipay_fund_trans_order_query($transfer_no); + } + + public function alipay_sign_verify($sign, $data) { + if(!$data) { + return false; + } + if($this->settings['ec_alipay_sign_mode']) { + $public_key = $this->settings['mode_b_alipay_cert']; + } else { + $public_key = "-----BEGIN PUBLIC KEY-----\n" . wordwrap($this->settings['mode_a_alipay_public_key'], 64, "\n", true) . "\n-----END PUBLIC KEY-----"; + } + + $data = $this->alipay_make_notify_signstr($data); + + $public_keyres = openssl_pkey_get_public($public_key); + $result = (openssl_verify($data, base64_decode($sign), $public_keyres, OPENSSL_ALGO_SHA256) === 1); + openssl_free_key($public_keyres); + return $result; + } + + private function alipay_trade_query($out_biz_no) { + global $_G; + $data = array( + 'method' => 'alipay.trade.query', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'format' => 'JSON', + 'timestamp' => dgmdate(time(), 'Y-m-d H:i:s'), + 'version' => '1.0', + 'biz_content' => json_encode(array('out_trade_no' => $out_biz_no)) + ); + if($this->settings['ec_alipay_sign_mode']) { + $appid = $this->settings['mode_b_appid']; + $private_key = $this->settings['mode_b_app_private_key']; + $data['app_cert_sn'] = $this->alipay_cert_sn($this->settings['mode_b_app_cert']); + $data['alipay_root_cert_sn'] = $this->alipay_root_cert_sn($this->settings['mode_b_alipay_root_cert']); + } else { + $appid = $this->settings['mode_a_appid']; + $private_key = $this->settings['mode_a_app_private_key']; + } + $data['app_id'] = $appid; + + $signstr = $this->alipay_make_signstr($data); + $data['sign'] = $this->alipay_sign($private_key, $signstr); + $api = SDK_ALIPAY_GATEWAYURL . '?' . http_build_query($data); + $res = $this->alipay_request($api); + $res = json_decode($res, true); + $res = $res['alipay_trade_query_response']; + if($res['code'] == 10000) { + if($res['trade_status'] == 'TRADE_SUCCESS') { + return array('code' => 200, 'data' => array('trade_no' => $res['trade_no'], 'payment_time' => strtotime($res['send_pay_date']))); + } else { + return array('code' => 500, 'message' => $res['trade_status']); + } + } else { + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res['sub_msg'] = diconv($res['sub_msg'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['sub_code'], 'message' => $res['sub_msg']); + } + } + + private function alipay_trade_page_pay($order) { + global $_G; + + if(strtoupper($_G['charset'] != 'UTF-8')) { + $order['subject'] = diconv($order['subject'], $_G['charset'], 'UTF-8'); + $order['description'] = diconv($order['description'], $_G['charset'], 'UTF-8'); + } + + $data = array( + 'method' => 'alipay.trade.page.pay', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'format' => 'JSON', + 'timestamp' => dgmdate(time(), 'Y-m-d H:i:s'), + 'version' => '1.0', + 'biz_content' => json_encode(array( + 'out_trade_no' => $order['out_biz_no'], + 'product_code' => 'FAST_INSTANT_TRADE_PAY', + 'total_amount' => $order['amount'] / 100, + 'subject' => $order['subject'], + 'body' => $order['description'], + 'timeout_express' => '1d', + 'qr_pay_mode' => '2', + 'integration_type' => 'PCWEB' + )) + ); + if($this->notify_url) { + $data['notify_url'] = $this->notify_url; + } + if($order['return_url']) { + $data['return_url'] = $order['return_url']; + } + if($this->settings['ec_alipay_sign_mode']) { + $appid = $this->settings['mode_b_appid']; + $private_key = $this->settings['mode_b_app_private_key']; + $data['app_cert_sn'] = $this->alipay_cert_sn($this->settings['mode_b_app_cert']); + $data['alipay_root_cert_sn'] = $this->alipay_root_cert_sn($this->settings['mode_b_alipay_root_cert']); + } else { + $appid = $this->settings['mode_a_appid']; + $private_key = $this->settings['mode_a_app_private_key']; + } + $data['app_id'] = $appid; + + $signstr = $this->alipay_make_signstr($data); + $data['sign'] = $this->alipay_sign($private_key, $signstr); + $api = SDK_ALIPAY_GATEWAYURL . '?' . http_build_query($data); + $res = $this->alipay_request($api); + if(strtoupper($_G['charset'] != 'GBK')) { + $res = diconv($res, 'GB2312', $_G['charset']); + } + if(preg_match('/^https?:\/\/.+$/', $res)) { + return array('code' => 200, 'url' => $res); + } else { + if(preg_match('/([^<]+)<\/div>/i', $res, $matchers)) { + return array('code' => 500, 'message' => $matchers[1]); + } else { + return array('code' => 501, 'message' => $res); + } + } + } + + private function alipay_trade_wap_pay($order) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $order['subject'] = diconv($order['subject'], $_G['charset'], 'UTF-8'); + $order['description'] = diconv($order['description'], $_G['charset'], 'UTF-8'); + } + + $data = array( + 'method' => 'alipay.trade.wap.pay', + 'format' => 'JSON', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'timestamp' => dgmdate(time(), 'Y-m-d H:i:s'), + 'version' => '1.0', + 'biz_content' => json_encode(array( + 'out_trade_no' => $order['out_biz_no'], + 'product_code' => 'FAST_INSTANT_TRADE_PAY', + 'total_amount' => $order['amount'] / 100, + 'subject' => $order['subject'], + 'body' => $order['description'], + 'timeout_express' => '1d', + 'qr_pay_mode' => '2', + 'integration_type' => 'PCWEB' + )) + ); + if($this->notify_url) { + $data['notify_url'] = $this->notify_url; + } + if($order['return_url']) { + $data['return_url'] = $order['return_url']; + } + if($this->settings['ec_alipay_sign_mode']) { + $appid = $this->settings['mode_b_appid']; + $private_key = $this->settings['mode_b_app_private_key']; + $data['app_cert_sn'] = $this->alipay_cert_sn($this->settings['mode_b_app_cert']); + $data['alipay_root_cert_sn'] = $this->alipay_root_cert_sn($this->settings['mode_b_alipay_root_cert']); + } else { + $appid = $this->settings['mode_a_appid']; + $private_key = $this->settings['mode_a_app_private_key']; + } + $data['app_id'] = $appid; + + if($order['referer_url']) { + $data['return_url'] = $order['referer_url']; + $data['quit_url'] = $order['referer_url']; + } else { + $data['quit_url'] = $_G['siteurl']; + } + + $signstr = $this->alipay_make_signstr($data); + $data['sign'] = $this->alipay_sign($private_key, $signstr); + $api = SDK_ALIPAY_GATEWAYURL . '?' . http_build_query($data); + $res = $this->alipay_request($api); + if(!preg_match('/^https?:\/\/.+$/', $res) && strtoupper($_G['charset'] != 'GBK')) { + $res = diconv($res, 'GB2312', $_G['charset']); + } + if(preg_match('/^https?:\/\/.+$/', $res)) { + return array('code' => 200, 'url' => $res); + } else { + if(preg_match('/([^<]+)<\/div>/i', $res, $matchers)) { + return array('code' => 500, 'message' => $matchers[1]); + } else { + return array('code' => 501, 'message' => $res); + } + } + } + + private function alipay_fund_trans_uni_transfer($transfer_no, $amount, $realname, $account, $title = '', $desc = '') { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $title = diconv($title, $_G['charset'], 'UTF-8'); + $desc = diconv($desc, $_G['charset'], 'UTF-8'); + } + if(!$this->settings['ec_alipay_sign_mode']) { + return array('code' => 500, 'message' => 'not support sign mode.'); + } + + $data = array( + 'app_id' => $this->settings['mode_b_appid'], + 'method' => 'alipay.fund.trans.uni.transfer', + 'format' => 'JSON', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'app_cert_sn' => $this->alipay_cert_sn($this->settings['mode_b_app_cert']), + 'alipay_root_cert_sn' => $this->alipay_root_cert_sn($this->settings['mode_b_alipay_root_cert']), + 'timestamp' => dgmdate(time(), 'Y-m-d H:i:s'), + 'version' => '1.0' + ); + $biz_content = array( + 'out_biz_no' => $transfer_no, + 'trans_amount' => sprintf('%.2f', $amount / 100), + 'product_code' => 'TRANS_ACCOUNT_NO_PWD', + 'biz_scene' => 'DIRECT_TRANSFER', + 'payee_info' => array('identity' => $account, 'identity_type' => 'ALIPAY_LOGON_ID', 'name' => $realname) + ); + if($title) { + $biz_content['order_title'] = $title; + } + if($desc) { + $biz_content['remark'] = $desc; + } + $data['biz_content'] = json_encode($biz_content); + + $signstr = $this->alipay_make_signstr($data); + $data['sign'] = $this->alipay_sign($this->settings['mode_b_app_private_key'], $signstr); + $api = SDK_ALIPAY_GATEWAYURL . '?' . http_build_query($data); + $res = $this->alipay_request($api); + $res = json_decode($res, true); + $res = $res['alipay_fund_trans_uni_transfer_response']; + if($res['code'] == 10000) { + if($res['status'] == 'SUCCESS') { + return array('code' => 200, 'data' => array('transfer_time' => strtotime($res['trans_date']))); + } elseif($res['status'] == 'DEALING') { + return array('code' => 201, 'message' => 'DEALING'); + } else { + return array('code' => 500, 'message' => $res['status']); + } + } else { + if($res['sub_msg'] && strtoupper($_G['charset'] != 'UTF-8')) { + $res['sub_msg'] = diconv($res['sub_msg'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['sub_code'], 'message' => $res['sub_msg']); + } + } + + private function alipay_fund_trans_order_query($transfer_no) { + global $_G; + $data = array('method' => 'alipay.fund.trans.order.query', 'format' => 'JSON', 'charset' => 'utf-8', 'sign_type' => 'RSA2', 'timestamp' => dgmdate(time(), 'Y-m-d H:i:s'), 'version' => '1.0',); + if($this->settings['ec_alipay_sign_mode']) { + $appid = $this->settings['mode_b_appid']; + $private_key = $this->settings['mode_b_app_private_key']; + $data['app_cert_sn'] = $this->alipay_cert_sn($this->settings['mode_b_app_cert']); + $data['alipay_root_cert_sn'] = $this->alipay_root_cert_sn($this->settings['mode_b_alipay_root_cert']); + } else { + $appid = $this->settings['mode_a_appid']; + $private_key = $this->settings['mode_a_app_private_key']; + } + $data['app_id'] = $appid; + + $biz_content = array('out_biz_no' => $transfer_no,); + $data['biz_content'] = json_encode($biz_content); + + $signstr = $this->alipay_make_signstr($data); + $data['sign'] = $this->alipay_sign($private_key, $signstr); + $api = SDK_ALIPAY_GATEWAYURL . '?' . http_build_query($data); + $res = $this->alipay_request($api); + $res = json_decode($res, true); + $res = $res['alipay_fund_trans_order_query_response']; + if($res['code'] == 10000) { + if($res['status'] == 'SUCCESS') { + return array('code' => 200, 'data' => array('transfer_time' => strtotime($res['trans_date']))); + } elseif($res['status'] == 'DEALING') { + return array('code' => 201, 'message' => 'DEALING'); + } else { + return array('code' => 500, 'message' => $res['status']); + } + } else { + if($res['sub_msg'] && strtoupper($_G['charset'] != 'UTF-8')) { + $res['sub_msg'] = diconv($res['sub_msg'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['sub_code'], 'message' => $res['sub_msg']); + } + } + + private function alipay_refund($refund_no, $trade_no, $amount, $refund_desc) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $refund_desc = diconv($refund_desc, $_G['charset'], 'UTF-8'); + } + $data = array('method' => 'alipay.trade.refund', 'format' => 'JSON', 'charset' => 'utf-8', 'sign_type' => 'RSA2', 'timestamp' => dgmdate(time(), 'Y-m-d H:i:s'), 'version' => '1.0', 'biz_content' => json_encode(array('trade_no' => $trade_no, 'refund_amount' => $amount / 100, 'out_request_no' => $refund_no, 'refund_reason' => $refund_desc)),); + if($this->settings['ec_alipay_sign_mode']) { + $appid = $this->settings['mode_b_appid']; + $private_key = $this->settings['mode_b_app_private_key']; + $data['app_cert_sn'] = $this->alipay_cert_sn($this->settings['mode_b_app_cert']); + $data['alipay_root_cert_sn'] = $this->alipay_root_cert_sn($this->settings['mode_b_alipay_root_cert']); + } else { + $appid = $this->settings['mode_a_appid']; + $private_key = $this->settings['mode_a_app_private_key']; + } + $data['app_id'] = $appid; + + $signstr = $this->alipay_make_signstr($data); + $data['sign'] = $this->alipay_sign($private_key, $signstr); + $api = SDK_ALIPAY_GATEWAYURL . '?' . http_build_query($data); + $res = $this->alipay_request($api); + $res = json_decode($res, true); + $res = $res['alipay_trade_refund_response']; + if($res['code'] == 10000) { + return array('code' => 200, 'data' => array('refund_time' => time())); + } else { + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res['sub_msg'] = diconv($res['sub_msg'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['sub_code'], 'message' => $res['sub_msg']); + } + } + + private function alipay_refund_status($refund_no, $trade_no) { + global $_G; + $data = array('method' => 'alipay.trade.fastpay.refund.query', 'format' => 'JSON', 'charset' => 'utf-8', 'sign_type' => 'RSA2', 'timestamp' => dgmdate(time(), 'Y-m-d H:i:s'), 'version' => '1.0', 'biz_content' => json_encode(array('trade_no' => $trade_no, 'out_request_no' => $refund_no,)),); + if($this->settings['ec_alipay_sign_mode']) { + $appid = $this->settings['mode_b_appid']; + $private_key = $this->settings['mode_b_app_private_key']; + $data['app_cert_sn'] = $this->alipay_cert_sn($this->settings['mode_b_app_cert']); + $data['alipay_root_cert_sn'] = $this->alipay_root_cert_sn($this->settings['mode_b_alipay_root_cert']); + } else { + $appid = $this->settings['mode_a_appid']; + $private_key = $this->settings['mode_a_app_private_key']; + } + $data['app_id'] = $appid; + + $signstr = $this->alipay_make_signstr($data); + $data['sign'] = $this->alipay_sign($private_key, $signstr); + $api = SDK_ALIPAY_GATEWAYURL . '?' . http_build_query($data); + $res = $this->alipay_request($api); + $res = json_decode($res, true); + $res = $res['alipay_trade_fastpay_refund_query_response']; + if($res['code'] == 10000) { + return array('code' => 200, 'data' => array('refund_time' => time())); + } else { + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res['sub_msg'] = diconv($res['sub_msg'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['sub_code'], 'message' => $res['sub_msg']); + } + } + + private function alipay_make_signstr($data) { + ksort($data); + $signstr = array(); + foreach($data as $key => $value) { + $signstr[] = $key . '=' . $value; + } + $signstr = implode('&', $signstr); + return $signstr; + } + + private function alipay_sign($private_key, $data) { + $private_key = "-----BEGIN RSA PRIVATE KEY-----\n" . wordwrap($private_key, 64, "\n", true) . "\n-----END RSA PRIVATE KEY-----"; + openssl_sign($data, $sign, $private_key, OPENSSL_ALGO_SHA256); + return base64_encode($sign); + } + + private function alipay_make_notify_signstr($data) { + ksort($data); + $signstr = array(); + foreach($data as $key => $value) { + if(in_array($key, array('sign', 'sign_type')) || !$value) { + continue; + } + if(is_array($value)) { + $value = json_encode($value); + } + $signstr[] = $key . '=' . $value; + } + $signstr = implode('&', $signstr); + return $signstr; + } + + private function alipay_array_to_string($data) { + $str = []; + foreach($data as $name => $value) { + $str[] = $name . '=' . $value; + } + return implode(',', $str); + } + + private function alipay_cert_sn($appcert) { + $ssl = openssl_x509_parse($appcert); + $sn = md5($this->alipay_array_to_string(array_reverse($ssl['issuer'])) . $ssl['serialNumber']); + return $sn; + } + + private function alipay_root_cert_sn($alipayrootcert) { + $array = explode("-----END CERTIFICATE-----", $alipayrootcert); + $sn = array(); + for($i = 0; $i < count($array) - 1; $i++) { + $ssl = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----"); + if($ssl['signatureTypeLN'] == "sha256WithRSAEncryption") { + $sn[] = md5($this->alipay_array_to_string(array_reverse($ssl['issuer'])) . $ssl['serialNumber']); + } + } + return implode('_', $sn); + } + + private function alipay_request($api, $post = array()) { + $client = filesock::open(array( + 'url' => $api, + 'method' => 'POST', + 'post' => $post + )); + + $data = $client->request(); + + if($client->curlstatus['http_code'] == 200) { + return $data; + } elseif(preg_match('/^30\d+$/', $client->curlstatus['http_code'])) { + return $client->curlstatus['redirect_url']; + } else { + return; + } + } +} \ No newline at end of file diff --git a/api/payment/payment_base.php b/api/payment/payment_base.php new file mode 100644 index 0000000..51351ca --- /dev/null +++ b/api/payment/payment_base.php @@ -0,0 +1,41 @@ +settings && $this->settings['on']) { + return true; + } else { + return false; + } + } + + public function pay($order) { } + + public function status($out_biz_no) { } + + public function refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc) { } + + public function refund_status($refund_no, $trade_no) { } + + public function transfer($transfer_no, $amount, $realname, $account, $title = '', $desc = '') { } + + public function transfer_status($transfer_no) { } + +} \ No newline at end of file diff --git a/api/payment/payment_qpay.php b/api/payment/payment_qpay.php new file mode 100644 index 0000000..a48127d --- /dev/null +++ b/api/payment/payment_qpay.php @@ -0,0 +1,245 @@ +settings = C::t('common_setting')->fetch_setting('ec_qpay', true); + $this->notify_url = $_G['siteurl'] . 'api/payment/notify/notify_qpay.php'; + parent::__construct(); + } + + public function pay($order) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'This payment method is not open yet.'); + } + return $this->qpay_unifiedorder_pay($order); + } + + public function status($out_biz_no) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'This payment method is not open yet.'); + } + return $this->qpay_order_query($out_biz_no); + } + + public function refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'This payment method is not open yet.'); + } + return $this->qpay_refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc); + } + + public function refund_status($refund_no, $trade_no) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'This payment method is not open yet.'); + } + return $this->qpay_refund_status($refund_no); + } + + public function transfer($transfer_no, $amount, $realname, $account, $title = '', $desc = '') { + return array('code' => 500, 'message' => 'This payment method is not support this feature.'); + } + + public function transfer_status($transfer_no) { + return array('code' => 500, 'message' => 'This payment method is not support this feature.'); + } + + public function pay_jsapi($order) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'This payment method is not open yet.'); + } + return $this->qpay_unifiedorder_pay($order, 'JSAPI'); + } + + public function qpay_sign_verify() { + $xml = file_get_contents('php://input'); + $data = $this->qpay_x2o($xml); + $sign = $this->qpay_sign($this->settings['v1_key'], $data, 1); + if($sign != $data['sign']) { + return array('code' => 50001, 'data' => $data); + } + if($data['return_code'] != 'SUCCESS') { + return array('code' => 50002, 'data' => $data); + } + if($data['result_code'] != 'SUCCESS') { + return array('code' => 50003, 'data' => $data); + } + return array('code' => 200, 'data' => $data); + } + + protected function enable() { + return $this->settings && $this->settings['on']; + } + + private function qpay_unifiedorder_pay($order, $type = 'NATIVE') { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $order['subject'] = diconv($order['subject'], $_G['charset'], 'UTF-8'); + $order['description'] = diconv($order['description'], $_G['charset'], 'UTF-8'); + } + $data = array('appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'nonce_str' => $this->qpay_nonce(), 'body' => $order['subject'], 'attach' => $order['description'], 'out_trade_no' => $order['out_biz_no'], 'fee_type' => 'CNY', 'total_fee' => intval($order['amount']), 'spbill_create_ip' => $_G['clientip'], 'time_expire' => dgmdate(time() + 86400, 'YmdHis'), 'notify_url' => $this->notify_url, 'trade_type' => $type); + $data['sign'] = $this->qpay_sign($this->settings['v1_key'], $data); + $data = $this->qpay_o2x($data); + + $api = SDK_QPAY_PAY_UNIFIEDORDER; + $res = $this->qpay_request_xml($api, $data); + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->qpay_x2o($res); + + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 501, 'message' => $res['err_code_des']); + } else { + return array('code' => 200, 'url' => isset($res['code_url']) ? $res['code_url'] : $res['prepay_id']); + } + } + + private function qpay_order_query($out_biz_no) { + global $_G; + $data = array('appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'out_trade_no' => $out_biz_no, 'nonce_str' => $this->qpay_nonce()); + $data['sign'] = $this->qpay_sign($this->settings['v1_key'], $data); + $data = $this->qpay_o2x($data); + $api = SDK_QPAY_PAY_ORDERQUERY; + $res = $this->qpay_request_xml($api, $data); + + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->qpay_x2o($res); + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['err_code_des']); + } else{ + $pay_time = strtotime(preg_replace('/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/', '$1-$2-$3 $4:$5:$6', $res['time_end'])); + return array('code' => 200, 'data' => array('trade_no' => $res['transaction_id'], 'payment_time' => $pay_time)); + } + } + + private function qpay_refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $refund_desc = diconv($refund_desc, $_G['charset'], 'UTF-8'); + } + $data = array('appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'nonce_str' => $this->qpay_nonce(), 'transaction_id' => $trade_no, 'out_refund_no' => $refund_no, 'refund_fee' => $refund_amount, 'op_user_id' => $this->settings['op_user_id'], 'op_user_passwd' => $this->settings['op_user_passwd']); + $data['sign'] = $this->qpay_sign($this->settings['v1_key'], $data); + $data = $this->qpay_o2x($data); + $api = SDK_QPAY_PAY_REFUND; + $res = $this->qpay_request_xml($api, $data, true); + + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->qpay_x2o($res); + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['err_code_des']); + } else { + return array('code' => 200, 'data' => array('refund_time' => time())); + } + } + + private function qpay_refund_status($refund_no) { + global $_G; + $data = array('appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'nonce_str' => $this->qpay_nonce(), 'out_refund_no' => $refund_no); + $data['sign'] = $this->qpay_sign($this->settings['v1_key'], $data); + $data = $this->qpay_o2x($data); + $api = SDK_QPAY_PAY_REFUNDQUERY; + $res = $this->qpay_request_xml($api, $data); + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->qpay_x2o($res); + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['err_code'] . '-' . $res['err_code_des']); + } else { + return array('code' => 200, 'data' => array('refund_time' => time())); + } + } + + private function qpay_o2x($data) { + $xml = ''; + foreach($data as $key => $value) { + $xml .= "\n<{$key}>{$value}"; + } + $xml .= "\n"; + return $xml; + } + + private function qpay_x2o($xml) { + libxml_disable_entity_loader(true); + $data = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); + return $data; + } + + private function qpay_sign($token, $data, $sign = 0) { + ksort($data); + $signstr = ''; + foreach($data as $key => $value) { + if(!$value || ($sign && $key == 'sign')) continue; + $signstr .= $key . '=' . $value . '&'; + } + $signstr .= 'key=' . $token; + $sign = strtoupper(md5($signstr)); + return $sign; + } + + private function qpay_nonce() { + $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $charactersLength = strlen($characters); + $randomString = ''; + for($i = 0; $i < 32; $i++) { + $randomString .= $characters[rand(0, $charactersLength - 1)]; + } + return $randomString; + } + + private function qpay_request_xml($api, $xml, $cert = false) { + $params = array( + 'url' => $api, + 'method' => 'POST', + 'rawdata' => $xml, + 'encodetype' => 'application/xml', + ); + + if($cert) { + if(!$this->settings['v1_cert_path'] || !file_exists(DISCUZ_ROOT . $this->settings['v1_cert_path']) || !is_file(DISCUZ_ROOT . $this->settings['v1_cert_path'])) { + return '400p12 not found.'; + } + $params['verifypeer'] = $this->settings['v1_cert_path']; + } + + $client = filesock::open($params); + $data = $client -> request(); + if(!$data) { + $data = $client -> filesockbody; + } + return $data; + } + +} \ No newline at end of file diff --git a/api/payment/payment_wechat.php b/api/payment/payment_wechat.php new file mode 100644 index 0000000..206b13a --- /dev/null +++ b/api/payment/payment_wechat.php @@ -0,0 +1,585 @@ +settings = C::t('common_setting')->fetch_setting('ec_wechat', true); + $this->notify_url = $_G['siteurl'] . 'api/payment/notify/notify_wechat.php'; + parent::__construct(); + } + + public function pay($order) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + + $device = $this->wechat_device(); + if($device) { + if($this->settings['ec_wechat_version']) { + return $this->v3_wechat_h5_pay($order); + } else { + return $this->wechat_unifiedorder_pay($order, 'MWEB'); + } + } else { + if($this->settings['ec_wechat_version']) { + return $this->v3_wechat_native_pay($order); + } else { + return $this->wechat_unifiedorder_pay($order, 'NATIVE'); + } + } + } + + public function status($out_biz_no) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + if($this->settings['ec_wechat_version']) { + return $this->v3_wechat_query_order($out_biz_no); + } else { + return $this->wechat_order_query($out_biz_no); + } + } + + public function refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + if($this->settings['ec_wechat_version']) { + return $this->v3_wechat_refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc); + } else { + return $this->wechat_refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc); + } + } + + public function refund_status($refund_no, $trade_no) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + if($this->settings['ec_wechat_version']) { + return $this->v3_wechat_refund_query($refund_no); + } else { + return $this->wechat_refund_status($refund_no); + } + } + + public function transfer($transfer_no, $amount, $realname, $account, $title = '', $desc = '') { + return array('code' => 500, 'message' => 'not support.'); + } + + public function transfer_status($transfer_no) { + return array('code' => 500, 'message' => 'not support.'); + } + + public function pay_jsapi($order, $openid) { + if(!$this->enable()) { + return array('code' => 500, 'message' => 'Did not open payment'); + } + if($this->settings['ec_wechat_version']) { + return $this->v3_wechat_h5_jsapi($order, $openid); + } else { + return $this->wechat_unifiedorder_pay($order, 'JSAPI', $openid); + } + } + + public function wechat_jsapidata($prepay_id) { + if($this->settings['ec_wechat_version']) { + $jsapidata = array( + 'appId' => $this->settings['appid'], + 'timeStamp' => time() . '', + 'nonceStr' => $this->wechat_nonce(), + 'package' => 'prepay_id=' . $prepay_id, + 'signType' => 'RSA' + ); + $jsapidata['paySign'] = $this->v3_wechat_jsapi_authorization($jsapidata); + } else { + $jsapidata = array('appId' => $this->settings['appid'], 'timeStamp' => time() . '', 'nonceStr' => $this->wechat_nonce(), 'package' => 'prepay_id=' . $prepay_id, 'signType' => 'MD5'); + $jsapidata['paySign'] = $this->wechat_sign($this -> settings['v1_key'], $jsapidata); + } + return json_encode($jsapidata); + } + + public function wechat_authorize($redirect_uri, $state, $scope = 'snsapi_base') { + $appid = $this->settings['appid']; + $redirect_uri = urlencode($redirect_uri); + return SDK_WEIXIN_AUTHORIZE . "?appid={$appid}&redirect_uri={$redirect_uri}&response_type=code&scope={$scope}&state={$state}#wechat_redirect"; + } + + public function wechat_access_token_by_code($code) { + $appid = $this->settings['appid']; + $appsecret = $this->settings['appsecret']; + $api = SDK_WEIXIN_SNS_ACCESS_TOKEN . "?appid={$appid}&secret={$appsecret}&code=$code&grant_type=authorization_code"; + return $this->wechat_request($api); + } + + public function wechat_sign_verify() { + $xml = file_get_contents('php://input'); + $data = $this->wechat_x2o($xml); + $sign = $this->wechat_sign($this->settings['v1_key'], $data, 1); + if($sign != $data['sign']) { + return array('code' => 50001, 'data' => $data); + } + if($data['return_code'] != 'SUCCESS') { + return array('code' => 50002, 'data' => $data); + } + if($data['result_code'] != 'SUCCESS') { + return array('code' => 50003, 'data' => $data); + } + return array('code' => 200, 'data' => $data); + } + + public function v3_wechat_sign_verify() { + $nonce = $_SERVER['HTTP_WECHATPAY_NONCE']; + $timestamp = $_SERVER['HTTP_WECHATPAY_TIMESTAMP']; + $serial = $_SERVER['HTTP_WECHATPAY_SERIAL']; + $json = file_get_contents('php://input'); + $signature = $_SERVER['HTTP_WECHATPAY_SIGNATURE']; + + $serial = strtoupper(ltrim($serial, '0')); + $public_key = $this->settings['v3_certificates'][$serial]; + if(!$public_key) { + return array('code' => 50001, 'data' => $json); + } + $signature = base64_decode($signature); + $signstr = $timestamp . "\n" . $nonce . "\n" . $json . "\n"; + if(!openssl_verify($signstr, $signature, $public_key, 'sha256WithRSAEncryption')) { + return array('code' => 50002, 'data' => $json); + } + $resource = json_decode($json, true); + if($resource['event_type'] != 'TRANSACTION.SUCCESS') { + return array('code' => 50003, 'data' => $resource); + } + $resource = $resource['resource']; + $data = $this->v3_wechat_decrypt2string($resource['associated_data'], $resource['nonce'], $resource['ciphertext']); + return array('code' => 200, 'data' => $data); + } + + public function v3_wechat_support() { + if(function_exists('sodium_crypto_aead_aes256gcm_is_available') && sodium_crypto_aead_aes256gcm_is_available()) { + return true; + } + if(PHP_VERSION_ID >= 70100 && in_array('aes-256-gcm', openssl_get_cipher_methods())) { + return true; + } + return false; + } + + public function v3_wechat_certificates() { + global $_G; + $api = SDK_WEIXIN_PAY_V3_CERTIFICATES; + $res = $this->v3_wechat_request_json($api, '', 'GET'); + $res = json_decode($res, true); + $list = array(); + if($res['data']) { + foreach($res['data'] as $item) { + $serial_no = $item['serial_no']; + $item = $item['encrypt_certificate']; + $data = $this->v3_wechat_decrypt2string($item['associated_data'], $item['nonce'], $item['ciphertext']); + $list[$serial_no] = $data; + } + } + return array('code' => 200, 'data' => $list); + } + + protected function enable() { + if($this->settings && $this->settings['on']) { + if($this->settings['ec_wechat_version']) { + return $this->v3_wechat_support(); + } + return true; + } else { + return false; + } + } + + private function wechat_unifiedorder_pay($order, $type = 'NATIVE', $openid = null) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $order['subject'] = diconv($order['subject'], $_G['charset'], 'UTF-8'); + $order['description'] = diconv($order['description'], $_G['charset'], 'UTF-8'); + } + $data = array('appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'nonce_str' => $this->wechat_nonce(), 'sign_type' => 'MD5', 'body' => $order['subject'], 'detail' => $order['description'], 'out_trade_no' => $order['out_biz_no'], 'total_fee' => intval($order['amount']), 'spbill_create_ip' => $_G['clientip'], 'time_expire' => dgmdate(time() + 86400, 'YmdHis'), 'notify_url' => $this->notify_url, 'trade_type' => $type,); + if($openid) { + $data['openid'] = $openid; + } + $data['sign'] = $this->wechat_sign($this->settings['v1_key'], $data); + $data = $this->wechat_o2x($data); + + $api = SDK_WEIXIN_PAY_UNIFIEDORDER; + $res = $this->wechat_request_xml($api, $data); + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->wechat_x2o($res); + + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 501, 'message' => $res['err_code_des']); + } else { + if($res['code_url']) { + $url = $res['code_url']; + } elseif($res['mweb_url']) { + $url = $res['mweb_url']; + } else { + $url = $res['prepay_id']; + } + return array('code' => 200, 'url' => $url); + } + } + + private function wechat_order_query($out_biz_no) { + global $_G; + $data = ['appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'out_trade_no' => $out_biz_no, 'nonce_str' => $this->wechat_nonce(), 'sign_type' => 'MD5']; + $data['sign'] = $this->wechat_sign($this->settings['v1_key'], $data); + $data = $this->wechat_o2x($data); + $api = SDK_WEIXIN_PAY_ORDERQUERY; + $res = $this->wechat_request_xml($api, $data); + + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->wechat_x2o($res); + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['err_code_des']); + } else { + $pay_time = strtotime(preg_replace('/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/', '$1-$2-$3 $4:$5:$6', $res['time_end'])); + return array('code' => 200, 'data' => array('trade_no' => $res['transaction_id'], 'payment_time' => $pay_time)); + } + } + + private function wechat_refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $refund_desc = diconv($refund_desc, $_G['charset'], 'UTF-8'); + } + $data = ['appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'nonce_str' => $this->wechat_nonce(), 'sign_type' => 'MD5', 'transaction_id' => $trade_no, 'out_refund_no' => $refund_no, 'total_fee' => $total_amount, 'refund_fee' => $refund_amount, 'refund_desc' => $refund_desc]; + $data['sign'] = $this->wechat_sign($this->settings['v1_key'], $data); + $data = $this->wechat_o2x($data); + $api = SDK_WEIXIN_PAY_REFUND; + $res = $this->wechat_request_xml($api, $data, true); + + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->wechat_x2o($res); + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['err_code_des']); + } else { + return array('code' => 200, 'data' => array('refund_time' => time())); + } + } + + private function wechat_refund_status($refund_no) { + global $_G; + $data = ['appid' => $this->settings['appid'], 'mch_id' => $this->settings['mch_id'], 'nonce_str' => $this->wechat_nonce(), 'sign_type' => 'MD5', 'out_refund_no' => $refund_no,]; + $data['sign'] = $this->wechat_sign($this->settings['v1_key'], $data); + $data = $this->wechat_o2x($data); + $api = SDK_WEIXIN_PAY_REFUNDQUERY; + $res = $this->wechat_request_xml($api, $data); + if(strtoupper($_G['charset'] != 'UTF-8')) { + $res = diconv($res, 'UTF-8', $_G['charset']); + } + $res = $this->wechat_x2o($res); + if($res['return_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['return_msg']); + } elseif($res['result_code'] != 'SUCCESS') { + return array('code' => 500, 'message' => $res['err_code'] . '-' . $res['err_code_des']); + } else { + return array('code' => 200, 'data' => array('refund_time' => time())); + } + } + + private function v3_wechat_native_pay($order) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $order['subject'] = diconv($order['subject'], $_G['charset'], 'UTF-8'); + $order['description'] = diconv($order['description'], $_G['charset'], 'UTF-8'); + } + $data = array('appid' => $this->settings['appid'], 'mchid' => $this->settings['mch_id'], 'description' => $order['subject'] . ': ' . $order['description'], 'out_trade_no' => $order['out_biz_no'], 'notify_url' => $this->notify_url, 'amount' => array('total' => intval($order['amount']), 'currency' => 'CNY')); + + $api = SDK_WEIXIN_PAY_V3_TRANSACTIONS_NATIVE; + $res = $this->v3_wechat_request_json($api, json_encode($data)); + $res = json_decode($res, true); + if($res['code_url']) { + return array('code' => 200, 'url' => $res['code_url']); + } else { + if(strtoupper($_G['charset'] != 'UTF-8') && $res['message']) { + $res['message'] = diconv($res['message'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['code'], 'message' => $res['message']); + } + } + + private function v3_wechat_h5_pay($order) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $order['subject'] = diconv($order['subject'], $_G['charset'], 'UTF-8'); + $order['description'] = diconv($order['description'], $_G['charset'], 'UTF-8'); + } + $data = array('appid' => $this->settings['appid'], 'mchid' => $this->settings['mch_id'], 'description' => $order['subject'] . ': ' . $order['description'], 'out_trade_no' => $order['out_biz_no'], 'notify_url' => $this->notify_url, 'amount' => array('total' => intval($order['amount']), 'currency' => 'CNY'), 'scene_info' => array('payer_client_ip' => $_G['clientip'], 'h5_info' => array('type' => checkmobile()))); + + $api = SDK_WEIXIN_PAY_V3_TRANSACTIONS_H5; + $res = $this->v3_wechat_request_json($api, json_encode($data)); + $res = json_decode($res, true); + if($res['h5_url']) { + return array('code' => 200, 'url' => $res['h5_url']); + } else { + if(strtoupper($_G['charset'] != 'UTF-8') && $res['message']) { + $res['message'] = diconv($res['message'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['code'], 'message' => $res['message']); + } + } + + private function v3_wechat_h5_jsapi($order, $openid) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $order['subject'] = diconv($order['subject'], $_G['charset'], 'UTF-8'); + $order['description'] = diconv($order['description'], $_G['charset'], 'UTF-8'); + } + $data = array('appid' => $this->settings['appid'], 'mchid' => $this->settings['mch_id'], 'description' => $order['subject'] . ': ' . $order['description'], 'out_trade_no' => $order['out_biz_no'], 'notify_url' => $this->notify_url, 'amount' => array('total' => intval($order['amount']), 'currency' => 'CNY'), 'payer' => array('openid' => $openid)); + + $api = SDK_WEIXIN_PAY_V3_TRANSACTIONS_H5; + $res = $this->v3_wechat_request_json($api, json_encode($data)); + $res = json_decode($res, true); + if($res['prepay_id']) { + return array('code' => 200, 'url' => $res['prepay_id']); + } else { + if(strtoupper($_G['charset'] != 'UTF-8') && $res['message']) { + $res['message'] = diconv($res['message'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['code'], 'message' => $res['message']); + } + } + + private function v3_wechat_query_order($out_biz_no) { + global $_G; + $api = SDK_WEIXIN_PAY_V3_TRANSACTIONS_OUTTRADENO; + $res = $this->v3_wechat_request_json($api . $out_biz_no . '?mchid=' . $this->settings['mch_id'], '', 'GET'); + $res = json_decode($res, true); + if($res['trade_state'] && $res['trade_state'] == 'SUCCESS') { + $pay_time = strtotime($res['success_time']); + return array('code' => 200, 'data' => array('trade_no' => $res['transaction_id'], 'payment_time' => $pay_time)); + } elseif($res['trade_state']) { + return array('code' => $res['trade_state'], 'message' => $res['trade_state_desc']); + } else { + if(strtoupper($_G['charset'] != 'UTF-8') && $res['message']) { + $res['message'] = diconv($res['message'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['code'], 'message' => $res['message']); + } + } + + private function v3_wechat_refund($refund_no, $trade_no, $total_amount, $refund_amount, $refund_desc) { + global $_G; + if(strtoupper($_G['charset'] != 'UTF-8')) { + $refund_desc = diconv($refund_desc, $_G['charset'], 'UTF-8'); + } + $data = array('transaction_id' => $trade_no, 'out_refund_no' => $refund_no, 'reason' => $refund_desc, 'amount' => array('refund' => intval($refund_amount), 'total' => intval($total_amount), 'currency' => 'CNY')); + + $api = SDK_WEIXIN_PAY_V3_REFUND_DOMESTIC_REFUNDS; + $res = $this->v3_wechat_request_json($api, json_encode($data)); + $res = json_decode($res, true); + if($res['status'] == 'SUCCESS') { + return array('code' => 200, 'data' => array('refund_time' => strtotime($res['success_time']))); + } elseif($res['status']) { + return array('code' => 201, 'message' => $res['status']); + } elseif($res['status']) { + return array('code' => 500, 'message' => $res['status']); + } else { + if(strtoupper($_G['charset'] != 'UTF-8') && $res['message']) { + $res['message'] = diconv($res['message'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['code'], 'message' => $res['message']); + } + } + + private function v3_wechat_refund_query($refund_no) { + global $_G; + $api = SDK_WEIXIN_PAY_V3_REFUND_DOMESTIC_REFUNDS_QUERY; + $res = $this->v3_wechat_request_json($api . $refund_no, '', 'GET'); + $res = json_decode($res, true); + if($res['status'] == 'SUCCESS') { + return array('code' => 200, 'data' => array('refund_time' => strtotime($res['success_time']))); + } elseif($res['status']) { + return array('code' => 201, 'message' => $res['status']); + } elseif($res['status']) { + return array('code' => 500, 'message' => $res['status']); + } else { + if(strtoupper($_G['charset'] != 'UTF-8') && $res['message']) { + $res['message'] = diconv($res['message'], 'UTF-8', $_G['charset']); + } + return array('code' => $res['code'], 'message' => $res['message']); + } + } + + private function wechat_o2x($data) { + $xml = ''; + foreach($data as $key => $value) { + $xml .= "\n<{$key}>{$value}"; + } + $xml .= "\n"; + return $xml; + } + + private function wechat_x2o($xml) { + if(function_exists('libxml_disable_entity_loader')) { + libxml_disable_entity_loader(true); + } + $data = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); + return $data; + } + + private function wechat_sign($token, $data, $sign = 0) { + ksort($data); + $signstr = ''; + foreach($data as $key => $value) { + if(!$value || ($sign && $key == 'sign')) { + continue; + } + $signstr .= $key . '=' . $value . '&'; + } + $signstr .= 'key=' . $token; + $sign = strtoupper(md5($signstr)); + return $sign; + } + + private function wechat_nonce() { + $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $charactersLength = strlen($characters); + $randomString = ''; + for($i = 0; $i < 32; $i++) { + $randomString .= $characters[rand(0, $charactersLength - 1)]; + } + return $randomString; + } + + private function v3_wechat_jsapi_authorization($data) { + $message = $data['appId'] . "\n" . $data['timeStamp'] . "\n" . $data['nonceStr'] . "\n" . $data['package']; + openssl_sign($message, $sign, $this->settings['v3_private_key'], 'sha256WithRSAEncryption'); + $sign = base64_encode($sign); + return $sign; + } + + private function v3_wechat_authorization($api, $method, $json) { + $url_values = parse_url($api); + $timestamp = time(); + $nonce = $this->wechat_nonce(); + $message = $method . "\n" . $url_values['path'] . ($url_values['query'] ? ('?' . $url_values['query']) : '') . "\n" . $timestamp . "\n" . $nonce . "\n" . $json . "\n"; + openssl_sign($message, $sign, $this->settings['v3_private_key'], 'sha256WithRSAEncryption'); + $sign = base64_encode($sign); + $token = sprintf('mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"', $this->settings['mch_id'], $nonce, $timestamp, $this->settings['v3_serial_no'], $sign); + return $token; + } + + private function v3_wechat_decrypt2string($associateddata, $noncestr, $ciphertext) { + $ciphertext = base64_decode($ciphertext); + if(strlen($ciphertext) <= 16) { + return false; + } + + if(function_exists('sodium_crypto_aead_aes256gcm_is_available') && sodium_crypto_aead_aes256gcm_is_available()) { + return sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $associateddata, $noncestr, $this->settings['v3_key']); + } + if(PHP_VERSION_ID >= 70100 && in_array('aes-256-gcm', openssl_get_cipher_methods())) { + $ctext = substr($ciphertext, 0, -16); + $authTag = substr($ciphertext, -16); + + return openssl_decrypt($ctext, 'aes-256-gcm', $this->settings['v3_key'], OPENSSL_RAW_DATA, $noncestr, $authTag, $associateddata); + } + + return false; + } + + private function wechat_request($api, $data = array()) { + $client = filesock::open(array( + 'url' => $api, + 'method' => 'POST', + 'post' => $data + )); + return $client->request(); + } + + private function wechat_request_xml($api, $xml, $cert = false) { + $params = array( + 'url' => $api, + 'method' => 'POST', + 'rawdata' => $xml, + 'encodetype' => 'application/xml', + ); + + if($cert) { + if(!$this->settings['v1_cert_path'] || !file_exists(DISCUZ_ROOT . $this->settings['v1_cert_path']) || !is_file(DISCUZ_ROOT . $this->settings['v1_cert_path'])) { + return '400p12 not found.'; + } + $params['verifypeer'] = $this->settings['v1_cert_path']; + } + + $client = filesock::open($params); + $data = $client -> request(); + if(!$data) { + $data = $client -> filesockbody; + } + return $data; + } + + private function v3_wechat_request_json($api, $json = '', $method = 'POST') { + $client = filesock::open(array( + 'url' => $api, + 'method' => $method, + 'rawdata' => $json, + 'encodetype' => 'JSON', + 'header' => array( + 'Accept' => 'application/json', + 'Authorization' => 'WECHATPAY2-SHA256-RSA2048 ' . $this->v3_wechat_authorization($api, $method, $json) + ) + )); + $data = $client->request(); + if(!$data) { + $data = $client->filesockbody; + } + return $data; + } + + private function wechat_device() { + $useragent = $_SERVER['HTTP_USER_AGENT']; + if(strpos($useragent, 'MicroMessenger') !== false) { + return 'wechat'; + } else { + return checkmobile(); + } + } +} \ No newline at end of file diff --git a/api/remote/index.htm b/api/remote/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/remote/index.php b/api/remote/index.php new file mode 100644 index 0000000..4a32a27 --- /dev/null +++ b/api/remote/index.php @@ -0,0 +1,142 @@ +init(); +$_ENV['remote']->loadservice(); + +class discuz_remote { + + var $mod; + var $modobj; + var $core; + + function init() { + + require_once('../../source/class/class_core.php'); + + $cachelist = array(); + $this->core = C::app(); + + $this->core->cachelist = $cachelist; + + + $this->core->init_setting = true; + + $this->core->init_cron = false; + $this->core->init_user = false; + $this->core->init_session = false; + $this->core->init_misc = false; + $this->core->init_mobile = false; + + $this->core->init(); + + define('SERVICE_DIR', getglobal('config/remote/dir') ? getglobal('config/remote/dir') : 'remote'); + $this->core->reject_robot(); + + if (empty($_GET['mod']) || preg_match('/[^0-9a-z]/i', $_GET['mod'])) { + $this->mod = 'index'; + } else { + $this->mod = $_GET['mod']; + } + } + + function loadservice() { + + if(!$this->core->config['remote']['on']) { + $this->error(1, 'remote service is down'); + } + + if(!$this->core->config['remote']['appkey']) { + $this->error(1, 'remote service need a appkey, please edit you config.global.php'); + } + + if ($this->mod != 'index') { + + $sign = $_GET['sign']; + unset($_GET['sign']); + + if (empty($sign) || $sign != $this->sign($_GET)) { + } + } + + if(!$this->check_timestamp()) { + $this->error(5, 'your request is time out'); + } + + $modfile = DISCUZ_ROOT . './api/' . SERVICE_DIR . '/mod/mod_' . $this->mod . '.php'; + if (!is_file($modfile)) { + $this->error(3, 'mod file is missing'); + } + + require $modfile; + $classname = 'mod_'.$this->mod; + if(class_exists($classname)) { + $service = new $classname; + $service->run(); + } + } + + function check_timestamp() + { + if(empty($_GET['timestamp'])) { + return 1; + } + + $ttl = abs(empty($_GET['ttl']) ? 600 : $_GET['ttl']); + $check = abs(TIMESTAMP - $_GET['timestamp']); + return $check > $ttl ? 0 : 1; + } + + function sign($arg) { + $str = ''; + foreach ($arg as $k => $v) { + $str .= $k . '=' . $v . '&'; + } + return md5($str . getglobal('config/remote/appkey')); + } + + function error($code, $msg) { + $code = sprintf("%04d", $code); + echo $code.':'.ucfirst($msg); + exit(); + } + +} + +class remote_service { + + var $version = '1.0.0'; + var $config; + + function __construct() { + $this->config = getglobal('config/remote'); + } + + function run() { + remote_service::success('service is done.'); + } + + function error($code, $msg) { + $code = sprintf("%04d", $code); + echo $code.':'.ucfirst($msg); + exit(); + } + + function success($msg) { + remote_service::error(0, $msg); + } + +} + +?> \ No newline at end of file diff --git a/api/remote/mod/index.htm b/api/remote/mod/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/remote/mod/mod_cron.php b/api/remote/mod/mod_cron.php new file mode 100644 index 0000000..9be03d6 --- /dev/null +++ b/api/remote/mod/mod_cron.php @@ -0,0 +1,36 @@ +config['cron']) { + $this->error(100, 'cron service is off. Please check "config.global.php" on your webserver folder.'); + } + + $discuz = C::app(); + $discuz->initated = false; + $discuz->init_db = false; + $discuz->init_setting = true; + $discuz->init_user = false; + $discuz->init_session = false; + $discuz->init_misc = false; + $discuz->init_mobile = false; + $discuz->init_cron = true; + $discuz->init(); + + $this->success('Cron work is done'); + } + +} \ No newline at end of file diff --git a/api/remote/mod/mod_index.php b/api/remote/mod/mod_index.php new file mode 100644 index 0000000..8f99264 --- /dev/null +++ b/api/remote/mod/mod_index.php @@ -0,0 +1,24 @@ +success('Discuz! Remote Service API '.$this->version); + } +} \ No newline at end of file diff --git a/api/trade/api_alipay.php b/api/trade/api_alipay.php new file mode 100644 index 0000000..4e0ef74 --- /dev/null +++ b/api/trade/api_alipay.php @@ -0,0 +1,296 @@ + $_G['setting']['bbname'].' - '.$_G['member']['username'].' - '.lang('forum/misc', 'credit_payment'), + 'body' => lang('forum/misc', 'credit_forum_payment').' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'].' '.intval($price * $_G['setting']['ec_ratio']).' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit'], + 'service' => 'trade_create_by_buyer', + 'partner' => DISCUZ_PARTNER, + 'notify_url' => $_G['siteurl'].'api/trade/notify_credit.php', + 'return_url' => $_G['siteurl'].'api/trade/notify_credit.php', + 'show_url' => $_G['siteurl'], + '_input_charset' => CHARSET, + 'out_trade_no' => $orderid, + 'price' => $price, + 'quantity' => 1, + 'seller_email' => $_G['setting']['ec_account'], + 'extend_param' => 'isv^dz11' + ); + if(DISCUZ_DIRECTPAY) { + $args['service'] = 'create_direct_pay_by_user'; + $args['payment_type'] = '1'; + } else { + $args['logistics_type'] = 'EXPRESS'; + $args['logistics_fee'] = 0; + $args['logistics_payment'] = 'SELLER_PAY'; + $args['payment_type'] = 1; + } + return trade_returnurl($args); +} + +function invite_payurl($amount, $price, &$orderid) { + global $_G; + + $orderid = dgmdate(TIMESTAMP, 'YmdHis').random(18); + + $args = array( + 'subject' => $_G['setting']['bbname'].' - '.lang('forum/misc', 'invite_payment'), + 'body' => lang('forum/misc', 'invite_forum_payment').' '.intval($amount).' '.lang('forum/misc', 'invite_forum_payment_unit'), + 'service' => 'trade_create_by_buyer', + 'partner' => DISCUZ_PARTNER, + 'notify_url' => $_G['siteurl'].'api/trade/notify_invite.php', + 'return_url' => $_G['siteurl'].'api/trade/notify_invite.php', + 'show_url' => $_G['siteurl'], + '_input_charset' => CHARSET, + 'out_trade_no' => $orderid, + 'price' => $price, + 'quantity' => 1, + 'seller_email' => $_G['setting']['ec_account'], + 'extend_param' => 'isv^dz11' + ); + if(DISCUZ_DIRECTPAY) { + $args['service'] = 'create_direct_pay_by_user'; + $args['payment_type'] = '1'; + } else { + $args['logistics_type'] = 'EXPRESS'; + $args['logistics_fee'] = 0; + $args['logistics_payment'] = 'SELLER_PAY'; + $args['payment_type'] = 1; + } + return trade_returnurl($args); +} + +function trade_payurl($pay, $trade, $tradelog) { + global $_G; + + $args = array( + 'service' => 'trade_create_by_buyer', + 'partner' => DISCUZ_PARTNER, + 'notify_url' => $_G['siteurl'].'api/trade/notify_trade.php', + 'return_url' => $_G['siteurl'].'api/trade/notify_trade.php', + 'show_url' => $tradelog['tid'] ? $_G['siteurl'].'forum.php?mod=viewthread&do=tradeinfo&tid='.$tradelog['tid'].'&pid='.$tradelog['pid'] : $_G['siteurl'], + '_input_charset' => CHARSET, + 'subject' => $trade['subject'], + 'body' => $trade['subject'], + 'out_trade_no' => $tradelog['orderid'], + 'price' => $tradelog['baseprice'], + 'quantity' => $tradelog['number'], + 'logistics_type' => $pay['logistics_type'], + 'logistics_fee' => $tradelog['transportfee'], + 'logistics_payment' => $pay['transport'], + 'payment_type' => $trade['itemtype'], + 'seller_email' => $trade['account'], + 'extend_param' => 'isv^dz11' + ); + + if($pay['logistics_type'] == 'VIRTUAL') { + if(DISCUZ_DIRECTPAY) { + $args['service'] = 'create_direct_pay_by_user'; + $args['payment_type'] = '1'; + unset($args['logistics_type'], $args['logistics_fee'], $args['logistics_payment']); + } else { + $args['logistics_type'] = 'EXPRESS'; + $args['logistics_payment'] = 'SELLER_PAY'; + $args['payment_type'] = '1'; + } + } + return trade_returnurl($args); +} + +function trade_returnurl($args) { + global $_G; + ksort($args); + $urlstr = $sign = ''; + foreach($args as $key => $val) { + $sign .= '&'.$key.'='.$val; + $urlstr .= $key.'='.rawurlencode($val).'&'; + } + $sign = substr($sign, 1); + $sign = md5($sign.DISCUZ_SECURITYCODE); + return 'https://www.alipay.com/cooperate/gateway.do?'.$urlstr.'sign='.$sign.'&sign_type=MD5'; +} + +function trade_notifycheck($type) { + global $_G; + if(!empty($_POST)) { + $notify = $_POST; + $location = FALSE; + } elseif(!empty($_GET)) { + $notify = $_GET; + $location = TRUE; + } else { + exit('Access Denied'); + } + unset($notify['diy']); + if(dfsockopen("https://notify.alipay.com/trade/notify_query.do?partner=".DISCUZ_PARTNER."¬ify_id=".$notify['notify_id'], 60) !== 'true') { + exit('Access Denied'); + } + + if($type == 'trade') { + $urlstr = ''; + foreach($notify as $key => $val) { + $urlstr .= $key.'='.rawurlencode($val).'&'; + } + } else { + if(!DISCUZ_SECURITYCODE) { + exit('Access Denied'); + } + ksort($notify); + $sign = ''; + foreach($notify as $key => $val) { + if($key != 'sign' && $key != 'sign_type') $sign .= "&$key=$val"; + } + if($notify['sign'] != md5(substr($sign,1).DISCUZ_SECURITYCODE)) { + exit('Access Denied'); + } + } + + if(($type == 'credit' || $type == 'invite') && (!DISCUZ_DIRECTPAY && $notify['notify_type'] == 'trade_status_sync' && ($notify['trade_status'] == 'WAIT_SELLER_SEND_GOODS' || $notify['trade_status'] == 'TRADE_FINISHED') || DISCUZ_DIRECTPAY && ($notify['trade_status'] == 'TRADE_FINISHED' || $notify['trade_status'] == 'TRADE_SUCCESS')) + || $type == 'trade' && $notify['notify_type'] == 'trade_status_sync') { + return array( + 'validator' => TRUE, + 'status' => trade_getstatus(!empty($notify['refund_status']) ? $notify['refund_status'] : $notify['trade_status'], 1), + 'order_no' => $notify['out_trade_no'], + 'price' => !DISCUZ_DIRECTPAY && $notify['price'] ? $notify['price'] : $notify['total_fee'], + 'trade_no' => $notify['trade_no'], + 'notify' => 'success', + 'location' => $location + ); + } else { + return array( + 'validator' => FALSE, + 'notify' => 'fail', + 'location' => $location + ); + } +} + +function trade_getorderurl($orderid) { + return 'https://www.alipay.com/trade/query_trade_detail.htm?trade_no='.$orderid; +} + +function trade_typestatus($method, $status = -1) { + switch($method) { + case 'buytrades' : $methodvalue = array(1, 5, 11, 12);break; + case 'selltrades' : $methodvalue = array(2, 4, 10, 13);break; + case 'successtrades' : $methodvalue = array(7);break; + case 'tradingtrades' : $methodvalue = array(1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16);break; + case 'closedtrades' : $methodvalue = array(8, 17);break; + case 'refundsuccess' : $methodvalue = array(17);break; + case 'refundtrades' : $methodvalue = array(14, 15, 16, 17, 18);break; + case 'unstarttrades' : $methodvalue = array(0);break; + case 'eccredittrades' : $methodvalue = array(7, 17);break; + } + return $status != -1 ? in_array($status, $methodvalue) : $methodvalue; +} + +function trade_getstatus($key, $method = 2) { + $language = lang('forum/misc'); + $status[1] = array( + 'WAIT_BUYER_PAY' => 1, + 'WAIT_SELLER_CONFIRM_TRADE' => 2, + 'WAIT_SYS_CONFIRM_PAY' => 3, + 'WAIT_SELLER_SEND_GOODS' => 4, + 'WAIT_BUYER_CONFIRM_GOODS' => 5, + 'WAIT_SYS_PAY_SELLER' => 6, + 'TRADE_FINISHED' => 7, + 'TRADE_CLOSED' => 8, + 'WAIT_SELLER_AGREE' => 10, + 'SELLER_REFUSE_BUYER' => 11, + 'WAIT_BUYER_RETURN_GOODS' => 12, + 'WAIT_SELLER_CONFIRM_GOODS' => 13, + 'WAIT_ALIPAY_REFUND' => 14, + 'ALIPAY_CHECK' => 15, + 'OVERED_REFUND' => 16, + 'REFUND_SUCCESS' => 17, + 'REFUND_CLOSED' => 18 + ); + $status[2] = array( + 0 => $language['trade_unstart'], + 1 => $language['trade_waitbuyerpay'], + 2 => $language['trade_waitsellerconfirm'], + 3 => $language['trade_sysconfirmpay'], + 4 => $language['trade_waitsellersend'], + 5 => $language['trade_waitbuyerconfirm'], + 6 => $language['trade_syspayseller'], + 7 => $language['trade_finished'], + 8 => $language['trade_closed'], + 10 => $language['trade_waitselleragree'], + 11 => $language['trade_sellerrefusebuyer'], + 12 => $language['trade_waitbuyerreturn'], + 13 => $language['trade_waitsellerconfirmgoods'], + 14 => $language['trade_waitalipayrefund'], + 15 => $language['trade_alipaycheck'], + 16 => $language['trade_overedrefund'], + 17 => $language['trade_refundsuccess'], + 18 => $language['trade_refundclosed'] + ); + return $method == -1 ? $status[2] : $status[$method][$key]; +} + +function trade_setprice($data, &$price, &$pay, &$transportfee) { + if($data['transport'] == 1) { + $pay['transport'] = 'SELLER_PAY'; + } elseif($data['transport'] == 2) { + $pay['transport'] = 'BUYER_PAY'; + } elseif($data['transport'] == 3) { + $pay['logistics_type'] = 'VIRTUAL'; + } else { + $pay['transport'] = 'BUYER_PAY_AFTER_RECEIVE'; + } + + if($data['transport'] != 3) { + if($data['fee'] == 1) { + $pay['logistics_type'] = 'POST'; + $pay['logistics_fee'] = $data['trade']['ordinaryfee']; + if($data['transport'] == 2) { + $price = $price + $data['trade']['ordinaryfee']; + $transportfee = $data['trade']['ordinaryfee']; + } + } elseif($data['fee'] == 2) { + $pay['logistics_type'] = 'EMS'; + $pay['logistics_fee'] = $data['trade']['emsfee']; + if($data['transport'] == 2) { + $price = $price + $data['trade']['emsfee']; + $transportfee = $data['trade']['emsfee']; + } + } else { + $pay['logistics_type'] = 'EXPRESS'; + $pay['logistics_fee'] = $data['trade']['expressfee']; + if($data['transport'] == 2) { + $price = $price + $data['trade']['expressfee']; + $transportfee = $data['trade']['expressfee']; + } + } + } +} + +?> \ No newline at end of file diff --git a/api/trade/api_tenpay.php b/api/trade/api_tenpay.php new file mode 100644 index 0000000..137b5a0 --- /dev/null +++ b/api/trade/api_tenpay.php @@ -0,0 +1,582 @@ +RequestHandler(); + } + + function RequestHandler() { + $this->gateUrl = "https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi"; + $this->key = ""; + $this->parameters = array(); + $this->debugInfo = ""; + } + + function init() { + } + + function getGateURL() { + return $this->gateUrl; + } + + function setGateURL($gateUrl) { + $this->gateUrl = $gateUrl; + } + + function getKey() { + return $this->key; + } + + function setKey($key) { + $this->key = $key; + } + + function getParameter($parameter) { + return $this->parameters[$parameter]; + } + + function setParameter($parameter, $parameterValue) { + $this->parameters[$parameter] = $parameterValue; + } + + function getAllParameters() { + $this->createSign(); + + return $this->parameters; + } + + function getRequestURL() { + $this->createSign(); + $reqPar = ""; + ksort($this->parameters); + foreach($this->parameters as $k => $v) { + $reqPar .= $k . "=" . urlencode($v) . "&"; + } + + $reqPar = substr($reqPar, 0, strlen($reqPar)-1); + $requestURL = $this->getGateURL() . "?" . $reqPar; + return $requestURL; + + } + + function getDebugInfo() { + return $this->debugInfo; + } + + function doSend() { + header("Location:" . $this->getRequestURL()); + exit; + } + + function createSign() { + $signPars = ""; + ksort($this->parameters); + foreach($this->parameters as $k => $v) { + if("" !== $v && "sign" !== $k) { + $signPars .= $k . "=" . $v . "&"; + } + } + $signPars .= "key=" . $this->getKey(); + $sign = strtolower(md5($signPars)); + $this->setParameter("sign", $sign); + $this->_setDebugInfo($signPars . " => sign:" . $sign); + + } + + function _setDebugInfo($debugInfo) { + $this->debugInfo = $debugInfo; + } + +} + +class ResponseHandler { + + var $key; + + var $parameters; + + var $debugInfo; + + function __construct() { + $this->ResponseHandler(); + } + + function ResponseHandler() { + $this->key = ""; + $this->parameters = array(); + $this->debugInfo = ""; + + foreach($_GET as $k => $v) { + $this->setParameter($k, $v); + } + foreach($_POST as $k => $v) { + $this->setParameter($k, $v); + } + } + + function getKey() { + return $this->key; + } + + function setKey($key) { + $this->key = $key; + } + + function getParameter($parameter) { + return $this->parameters[$parameter]; + } + + function setParameter($parameter, $parameterValue) { + $this->parameters[$parameter] = $parameterValue; + } + + function getAllParameters() { + return $this->parameters; + } + + function isTenpaySign() { + $signPars = ""; + + ksort($this->parameters); + foreach($this->parameters as $k => $v) { + if("sign" !== $k && "" !== $v) { + $signPars .= $k . "=" . $v . "&"; + } + } + $signPars .= "key=" . $this->getKey(); + $sign = strtolower(md5($signPars)); + $tenpaySign = strtolower($this->getParameter("sign")); + $this->_setDebugInfo($signPars . " => sign:" . $sign . + " tenpaySign:" . $this->getParameter("sign")); + + return $sign == $tenpaySign; + + } + + function getDebugInfo() { + return $this->debugInfo; + } + + function _setDebugInfo($debugInfo) { + $this->debugInfo = $debugInfo; + } +} + + +class MediPayRequestHandler extends RequestHandler { + + function __construct() { + $this->MediPayRequestHandler(); + } + + function MediPayRequestHandler() { + $this->setGateURL("https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi"); + } + + function init() { + $this->setParameter("attach", "1"); + + $this->setParameter("chnid", ""); + + $this->setParameter("cmdno", "12"); + + $this->setParameter("encode_type", "1"); + + $this->setParameter("mch_desc", ""); + + $this->setParameter("mch_name", ""); + + $this->setParameter("mch_price", ""); + + $this->setParameter("mch_returl", ""); + + $this->setParameter("mch_type", ""); + + $this->setParameter("mch_vno", ""); + + $this->setParameter("need_buyerinfo", ""); + + $this->setParameter("seller", ""); + + $this->setParameter("show_url", ""); + + $this->setParameter("transport_desc", ""); + + $this->setParameter("transport_fee", ""); + + $this->setParameter("version", "2"); + + $this->setParameter("sign", ""); + + } + +} + +class MediPayResponseHandler extends ResponseHandler { + + function doShow() { + $strHtml = "\r\n" . + "" . + ""; + + echo $strHtml; + + exit; + } + function isTenpaySign() { + + $signParameterArray = array( + 'attach', + 'buyer_id', + 'cft_tid', + 'chnid', + 'cmdno', + 'mch_vno', + 'retcode', + 'seller', + 'status', + 'total_fee', + 'trade_price', + 'transport_fee', + 'version' + ); + + ksort($signParameterArray); + + foreach($signParameterArray as $k ) { + $v = $this->getParameter($k); + if(isset($v)) { + $signPars .= $k . "=" . urldecode($v) . "&"; + } + } + + $signPars .= "key=" . $this->getKey(); + + $sign = strtolower(md5($signPars)); + + $tenpaySign = strtolower($this->getParameter("sign")); + + $this->_setDebugInfo($signPars . " => sign:" . $sign . + " tenpaySign:" . $this->getParameter("sign")); + + return $sign == $tenpaySign; + + } + +} + +function credit_payurl($price, &$orderid, $bank = 'DEFAULT') { + include_once DISCUZ_ROOT . './source/class/class_chinese.php'; + global $_G; + + $date = dgmdate(TIMESTAMP, 'YmdHis'); + $suffix = dgmdate(TIMESTAMP, 'His').rand(1000, 9999); + $transaction_id = DISCUZ_PARTNER.$date.$suffix; + + $orderid = dgmdate(TIMESTAMP, 'YmdHis').random(14); + + $chinese = new Chinese(strtoupper(CHARSET), 'GBK'); + $subject = $chinese->Convert(lang('forum/misc', 'credit_forum_payment').' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'].' '.intval($price * $_G['setting']['ec_ratio']).' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit']); + + $reqHandler = new RequestHandler(); + $reqHandler->setGateURL("https://gw.tenpay.com/gateway/pay.htm"); + + $reqHandler->init(); + $reqHandler->setKey(DISCUZ_SECURITYCODE); + + $reqHandler->setParameter("partner", DISCUZ_PARTNER); + $reqHandler->setParameter("out_trade_no", $orderid); + $reqHandler->setParameter("total_fee", $price * 100); + $reqHandler->setParameter("return_url", $_G['siteurl'].'api/trade/notify_credit.php'); + $reqHandler->setParameter("notify_url", $_G['siteurl'].'api/trade/notify_credit.php'); + $reqHandler->setParameter("body", $subject); + $reqHandler->setParameter("bank_type", $bank); + + $reqHandler->setParameter("spbill_create_ip", $_G['clientip']); + $reqHandler->setParameter("fee_type", "1"); + $reqHandler->setParameter("subject", $subject); + + $reqHandler->setParameter("sign_type", "MD5"); + $reqHandler->setParameter("service_version", "1.0"); + $reqHandler->setParameter("input_charset", "GBK"); + $reqHandler->setParameter("sign_key_index", "1"); + + $reqHandler->setParameter("attach", "tenpay"); + $reqHandler->setParameter("time_start", $date); + $reqHandler->setParameter("trade_mode","1"); + $reqHandler->setParameter("trans_type","1"); + $reqHandler->setParameter("agentid", DISCUZ_AGENTID); + $reqHandler->setParameter("agent_type","2"); + + $reqUrl = $reqHandler->getRequestURL(); + return $reqUrl; +} + +function trade_payurl($pay, $trade, $tradelog) { + global $_G; + + $key = DISCUZ_TENPAY_OPENTRANS_KEY; + + $chnid = DISCUZ_TENPAY_OPENTRANS_CHNID; + + $seller = $trade['tenpayaccount']; + + $mch_desc = $trade['subject']; + + $mch_name = $trade['subject']; + + $mch_price = $tradelog['baseprice'] * $tradelog['number'] * 100; + + $mch_returl = $_G['siteurl'].'api/trade/notify_trade.php'; + + $mch_vno = $tradelog['orderid']; + + $show_url = $_G['siteurl'].'api/trade/notify_trade.php'; + + $transport_desc = $pay['logistics_type']; + + $transport_fee = $tradelog['transportfee'] * 100; + + if(strtolower(CHARSET) == 'gbk') { + $encode_type = '1'; + } else { + $encode_type = '2'; + } + + $mch_type = '1'; + $need_buyerinfo = '1'; + if($pay['logistics_type'] == 'VIRTUAL') { + $mch_type = '2'; + $need_buyerinfo = '2'; + } + + $reqHandler = new MediPayRequestHandler(); + $reqHandler->init(); + $reqHandler->setKey($key); + + $reqHandler->setParameter("chnid", $chnid); + $reqHandler->setParameter("encode_type", $encode_type); + $reqHandler->setParameter("mch_desc", $mch_desc); + $reqHandler->setParameter("mch_name", $mch_name); + $reqHandler->setParameter("mch_price", $mch_price); + $reqHandler->setParameter("mch_returl", $mch_returl); + $reqHandler->setParameter("mch_type", $mch_type); + $reqHandler->setParameter("mch_vno", $mch_vno); + $reqHandler->setParameter("need_buyerinfo", $need_buyerinfo); + $reqHandler->setParameter("seller", $seller); + $reqHandler->setParameter("show_url", $show_url); + $reqHandler->setParameter("transport_desc", $transport_desc); + $reqHandler->setParameter("transport_fee", $transport_fee); + $reqHandler->setParameter('attach', 'tenpay'); + + $reqUrl = $reqHandler->getRequestURL(); + return $reqUrl; +} + + +function invite_payurl($amount, $price, &$orderid, $bank = 'DEFAULT') { + include_once DISCUZ_ROOT . './source/class/class_chinese.php'; + global $_G; + + $date = dgmdate(TIMESTAMP, 'YmdHis'); + $suffix = dgmdate(TIMESTAMP, 'His').rand(1000, 9999); + $transaction_id = DISCUZ_PARTNER.$date.$suffix; + + $orderid = dgmdate(TIMESTAMP, 'YmdHis').random(14); + + $chinese = new Chinese(strtoupper(CHARSET), 'GBK'); + $subject = $chinese->Convert(lang('forum/misc', 'invite_forum_payment').' '.intval($amount).' '.lang('forum/misc', 'invite_forum_payment_unit')); + + $reqHandler = new RequestHandler(); + $reqHandler->setGateURL("https://gw.tenpay.com/gateway/pay.htm"); + + $reqHandler->init(); + $reqHandler->setKey(DISCUZ_SECURITYCODE); + + $reqHandler->setParameter("partner", DISCUZ_PARTNER); + $reqHandler->setParameter("out_trade_no", $orderid); + $reqHandler->setParameter("total_fee", $price * 100); + $reqHandler->setParameter("return_url", $_G['siteurl'].'api/trade/notify_invite.php'); + $reqHandler->setParameter("notify_url", $_G['siteurl'].'api/trade/notify_invite.php'); + $reqHandler->setParameter("body", $subject); + $reqHandler->setParameter("bank_type", $bank); + + $reqHandler->setParameter("spbill_create_ip", $_G['clientip']); + $reqHandler->setParameter("fee_type", "1"); + $reqHandler->setParameter("subject", $subject); + + $reqHandler->setParameter("sign_type", "MD5"); + $reqHandler->setParameter("service_version", "1.0"); + $reqHandler->setParameter("input_charset", "GBK"); + $reqHandler->setParameter("sign_key_index", "1"); + + $reqHandler->setParameter("attach", "tenpay"); + $reqHandler->setParameter("time_start", $date); + $reqHandler->setParameter("trade_mode","1"); + $reqHandler->setParameter("trans_type","1"); + $reqHandler->setParameter("agentid", DISCUZ_AGENTID); + $reqHandler->setParameter("agent_type","2"); + + $reqUrl = $reqHandler->getRequestURL(); + return $reqUrl; +} +function trade_notifycheck($type) { + global $_G; + + if($type == 'credit' || $type == 'invite') { + if(!DISCUZ_SECURITYCODE) { + exit('Access Denied'); + } + $resHandler = new ResponseHandler(); + $resHandler->setKey(DISCUZ_SECURITYCODE); + + $resHandler->setParameter("bankname", ""); + } else { + if(!DISCUZ_TENPAY_OPENTRANS_KEY) { + exit('Access Denied'); + } + $resHandler = new MediPayResponseHandler(); + $resHandler->setKey(DISCUZ_TENPAY_OPENTRANS_KEY); + } + if($type == 'credit' || $type == 'invite') { + if($resHandler->isTenpaySign() && DISCUZ_PARTNER == $_GET['partner']) { + return array( + 'validator' => isset($_GET['trade_state']) ? !$_GET['trade_state'] : 0, + 'order_no' => $_GET['out_trade_no'], + 'trade_no' => isset($_GET['transaction_id']) ? $_GET['transaction_id'] : '', + 'price' => $_GET['total_fee'] / 100, + 'bargainor_id' => $_GET['partner'], + 'location' => true, + ); + } + } elseif($type == 'trade') { + if($resHandler->isTenpaySign()) { + return array( + 'validator' => $resHandler->getParameter('retcode') == '0', + 'order_no' => $resHandler->getParameter('mch_vno'), + 'trade_no' => $resHandler->getParameter('cft_tid'), + 'price' => $resHandler->getParameter('total_fee') / 100, + 'status' => $resHandler->getParameter('status'), + 'location' => true, + ); + } + } else { + return array( + 'validator' => FALSE, + 'location' => 'forum.php?mod=memcp&action=credits&operation=addfunds&return=fail' + ); + } +} + +function trade_setprice($data, &$price, &$pay, &$transportfee) { + if($data['transport'] == 3) { + $pay['logistics_type'] = 'VIRTUAL'; + } + + if($data['transport'] != 3) { + if($data['fee'] == 1) { + $pay['logistics_type'] = 'POST'; + $pay['logistics_fee'] = $data['trade']['ordinaryfee']; + if($data['transport'] == 2) { + $price = $price + $data['trade']['ordinaryfee']; + $transportfee = $data['trade']['ordinaryfee']; + } + } elseif($data['fee'] == 2) { + $pay['logistics_type'] = 'EMS'; + $pay['logistics_fee'] = $data['trade']['emsfee']; + if($data['transport'] == 2) { + $price = $price + $data['trade']['emsfee']; + $transportfee = $data['trade']['emsfee']; + } + } else { + $pay['logistics_type'] = 'EXPRESS'; + $pay['logistics_fee'] = $data['trade']['expressfee']; + if($data['transport'] == 2) { + $price = $price + $data['trade']['expressfee']; + $transportfee = $data['trade']['expressfee']; + } + } + } +} + +function trade_getorderurl($orderid) { + return "https://www.tenpay.com/med/tradeDetail.shtml?b=1&trans_id=$orderid"; +} + +function trade_typestatus($method, $status = -1) { + switch($method) { + case 'buytrades' : $methodvalue = array(1, 3);break; + case 'selltrades' : $methodvalue = array(2, 4);break; + case 'successtrades' : $methodvalue = array(5);break; + case 'tradingtrades' : $methodvalue = array(1, 2, 3, 4);break; + case 'closedtrades' : $methodvalue = array(6, 10);break; + case 'refundsuccess' : $methodvalue = array(9);break; + case 'refundtrades' : $methodvalue = array(9, 10);break; + case 'unstarttrades' : $methodvalue = array(0);break; + } + return $status != -1 ? in_array($status, $methodvalue) : $methodvalue; +} + +function trade_getstatus($key, $method = 2) { + $language = lang('forum/misc'); + $status[1] = array( + 'WAIT_BUYER_PAY' => 1, + 'WAIT_SELLER_CONFIRM_TRADE' => 2, + 'WAIT_SELLER_SEND_GOODS' => 3, + 'WAIT_BUYER_CONFIRM_GOODS' => 4, + 'TRADE_FINISHED' => 5, + 'TRADE_CLOSED' => 6, + 'REFUND_SUCCESS' => 9, + 'REFUND_CLOSED' => 10, + ); + $status[2] = array( + 0 => $language['trade_unstart'], + 1 => $language['trade_waitbuyerpay'], + 2 => $language['trade_waitsellerconfirm'], + 3 => $language['trade_waitsellersend'], + 4 => $language['trade_waitbuyerconfirm'], + 5 => $language['trade_finished'], + 6 => $language['trade_closed'], + 9 => $language['trade_refundsuccess'], + 10 => $language['trade_refundclosed'] + ); + return $method == -1 ? $status[2] : $status[$method][$key]; +} + +?> \ No newline at end of file diff --git a/api/trade/index.htm b/api/trade/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/api/trade/notify_credit.php b/api/trade/notify_credit.php new file mode 100644 index 0000000..e8307e7 --- /dev/null +++ b/api/trade/notify_credit.php @@ -0,0 +1,73 @@ +init(); + +$apitype = empty($_GET['attach']) || !preg_match('/^[a-z0-9]+$/i', $_GET['attach']) ? 'alipay' : $_GET['attach']; +require_once DISCUZ_ROOT.'./api/trade/api_'.$apitype.'.php'; +$PHP_SELF = $_SERVER['PHP_SELF']; +$_G['siteurl'] = dhtmlspecialchars($_G['scheme'].'://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api\/trade)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/'); +$notifydata = trade_notifycheck('credit'); + +if($notifydata['validator']) { + + $orderid = $notifydata['order_no']; + $postprice = $notifydata['price']; + $order = C::t('forum_order')->fetch($orderid); + $order = array_merge($order, C::t('common_member')->fetch_by_username($order['uid'])); + if($order && floatval($postprice) == floatval($order['price']) && ($apitype == 'tenpay' || strtolower($_G['setting']['ec_account']) == strtolower($_REQUEST['seller_email']))) { + + if($order['status'] == 1) { + C::t('forum_order')->update($orderid, array('status' => '2', 'buyer' => "{$notifydata['trade_no']}\t$apitype", 'confirmdate' => $_G['timestamp'])); + updatemembercount($order['uid'], array($_G['setting']['creditstrans'] => $order['amount']), 1, 'AFD', $order['uid']); + updatecreditbyaction($action, $uid = 0, $extrasql = array(), $needle = '', $coef = 1, $update = 1, $fid = 0); + C::t('forum_order')->delete_by_submitdate($_G['timestamp']-60*86400); + $submitdate = dgmdate($order['submitdate']); + $confirmdate = dgmdate(TIMESTAMP); + + notification_add($order['uid'], 'credit', 'addfunds', array( + 'orderid' => $order['orderid'], + 'price' => $order['price'], + 'value' => $_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'].' '.$order['amount'].' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit'] + ), 1); + } + + } + +} + +if($notifydata['location']) { + $url = rawurlencode('home.php?mod=spacecp&ac=credit'); + if($apitype == 'tenpay') { + echo << + + + + + +EOS; + } else { + dheader('location: '.$_G['siteurl'].'forum.php?mod=misc&action=paysucceed'); + } +} else { + exit($notifydata['notify']); +} + +?> \ No newline at end of file diff --git a/api/trade/notify_invite.php b/api/trade/notify_invite.php new file mode 100644 index 0000000..503ddde --- /dev/null +++ b/api/trade/notify_invite.php @@ -0,0 +1,90 @@ +init(); + +$apitype = empty($_GET['attach']) || !preg_match('/^[a-z0-9]+$/i', $_GET['attach']) ? 'alipay' : $_GET['attach']; +require_once DISCUZ_ROOT.'./api/trade/api_'.$apitype.'.php'; +$PHP_SELF = $_SERVER['PHP_SELF']; +$_G['siteurl'] = dhtmlspecialchars($_G['scheme'].'://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api\/trade)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/'); +$notifydata = trade_notifycheck('invite'); +if($notifydata['validator']) { + $orderid = $notifydata['order_no']; + $postprice = $notifydata['price']; + $order = C::t('forum_order')->fetch($orderid); + if($order && floatval($postprice) == floatval($order['price']) && ($apitype == 'tenpay' || $_G['setting']['ec_account'] == $_REQUEST['seller_email'])) { + + if($order['status'] == 1) { + C::t('forum_order')->update($orderid, array('status' => '2', 'buyer' => "{$notifydata['trade_no']}\t$apitype", 'confirmdate' => $_G['timestamp'])); + $codes = $codetext = array(); + $dateline = TIMESTAMP; + for($i=0; $i<$order['amount']; $i++) { + $code = strtolower(random(6)); + $codetext[] = $code; + $codes[] = "('0', '$code', '$dateline', '".($_G['group']['maxinviteday']?($_G['timestamp']+$_G['group']['maxinviteday']*24*3600):$_G['timestamp']+86400*10)."', '{$order['email']}', '{$_G['clientip']}', '$orderid')"; + $invitedata = array( + 'uid' => 0, + 'code' => $code, + 'dateline' => $dateline, + 'endtime' => $_G['group']['maxinviteday'] ? ($_G['timestamp']+$_G['group']['maxinviteday']*24*3600) : $_G['timestamp']+86400*10, + 'email' => $order['email'], + 'inviteip' => $_G['clientip'], + 'orderid' => $orderid + ); + C::t('common_invite')->insert($invitedata); + } + C::t('forum_order')->delete_by_submitdate($_G['timestamp']-60*86400); + + $submitdate = dgmdate($order['submitdate']); + $confirmdate = dgmdate(TIMESTAMP); + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + $add_member_subject = $_G['setting']['bbname'].' - '.lang('forum/misc', 'invite_payment'); + $add_member_message = lang('email', 'invite_payment_email_message', array( + 'orderid' => $order['orderid'], + 'codetext' => implode('
', $codetext), + 'siteurl' => $_G['siteurl'], + 'bbname' => $_G['setting']['bbname'], + )); + if(!sendmail($order['email'], $add_member_subject, $add_member_message)) { + runlog('sendmail', "{$order['email']} sendmail failed."); + } + } + + } +} +if($notifydata['location']) { + if($apitype == 'tenpay') { + echo << + + + + + +EOS; + } else { + dheader('location: '.$_G['siteurl'].'misc.php?mod=buyinvitecode&action=paysucceed&orderid='.$orderid); + } +} else { + exit($notifydata['notify']); +} + +?> \ No newline at end of file diff --git a/api/trade/notify_trade.php b/api/trade/notify_trade.php new file mode 100644 index 0000000..4faa1e8 --- /dev/null +++ b/api/trade/notify_trade.php @@ -0,0 +1,118 @@ +init(); + +$apitype = empty($_GET['attach']) || !preg_match('/^[a-z0-9]+$/i', $_GET['attach']) ? 'alipay' : $_GET['attach']; +require_once DISCUZ_ROOT.'./api/trade/api_' . $apitype . '.php'; + +$PHP_SELF = $_SERVER['PHP_SELF']; +$_G['siteurl'] = dhtmlspecialchars($_G['scheme'].'://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api\/trade)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/'); + +$notifydata = trade_notifycheck('trade'); + +if($notifydata['validator']) { + + $orderid = $notifydata['order_no']; + + if($orderid) { + + $tradelog = C::t('forum_tradelog')->fetch($orderid); + + if($tradelog && $tradelog['status'] != STATUS_TRADE_SUCCESS && $tradelog['status'] != STATUS_REFUND_CLOSE && ($apitype == 'tenpay' || $tradelog['selleraccount'] == $_REQUEST['seller_email'])) { + $status = $notifydata['status']; + C::t('forum_tradelog')->update($orderid, array( + 'status' => $status, + 'lastupdate' => $_G['timestamp'], + 'tradeno' => $notifydata['trade_no'] + )); + if($status != $tradelog['status']) { + + if($status == STATUS_SELLER_SEND) { + + notification_add($tradelog['sellerid'], 'goods', 'trade_seller_send', array( + 'buyerid' => $tradelog['buyerid'], + 'buyer' => $tradelog['buyer'], + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + + } elseif($status == STATUS_WAIT_BUYER) { + + notification_add($tradelog['buyerid'], 'goods', 'trade_buyer_confirm', array( + 'sellerid' => $tradelog['sellerid'], + 'seller' => $tradelog['seller'], + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + + } elseif($status == STATUS_TRADE_SUCCESS) { + + if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['basecredit']) { + $netcredit = round($tradelog['number'] * $tradelog['basecredit'] * (1 - $_G['setting']['creditstax'])); + updatemembercount($tradelog['sellerid'], array($_G['setting']['creditstransextra'][5] => $netcredit)); + } else { + $netcredit = 0; + } + C::t('forum_trade')->update_trade($tradelog['tid'], $tradelog['pid'], array('lastbuyer' => $tradelog['buyer'], 'lastupdate' => $_G['timestamp'])); + C::t('forum_trade')->update_counter($tradelog['tid'], $tradelog['pid'], $tradelog['number'], $tradelog['price'], $netcredit); + + updatecreditbyaction('tradefinished', $tradelog['sellerid']); + updatecreditbyaction('tradefinished', $tradelog['buyerid']); + + notification_add($tradelog['sellerid'], 'goods', 'trade_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + notification_add($tradelog['buyerid'], 'goods', 'trade_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + + } elseif($status == STATUS_REFUND_CLOSE) { + + C::t('forum_trade')->update_counter($tradelog['tid'], $tradelog['pid'], 0, 0, 0, $tradelog['number']); + notification_add($tradelog['sellerid'], 'goods', 'trade_fefund_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + notification_add($tradelog['buyerid'], 'goods', 'trade_fefund_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + if($_G['setting']['creditstrans'] && $tradelog['buyerid']) { + updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstrans'] => $tradelog['buyercredits'])); + } + if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['basecredit'] && $tradelog['buyerid']) { + $credit = $tradelog['number'] * $tradelog['basecredit']; + updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstransextra'][5] => $credit)); + } + + } + } + } + } + +} + +if($notifydata['location']) { + dheader('location: '.$_G['siteurl'].'forum.php?mod=misc&action=paysucceed&orderid='.$orderid); +} else { + exit($notifydata['notify']); +} + +?> \ No newline at end of file diff --git a/api/uc.php b/api/uc.php new file mode 100644 index 0000000..48dc3eb --- /dev/null +++ b/api/uc.php @@ -0,0 +1,359 @@ +init(); + + require DISCUZ_ROOT.'./config/config_ucenter.php'; + require DISCUZ_ROOT.'./uc_client/release/release.php'; + + $get = $post = array(); + + $code = @$_GET['code']; + parse_str(authcode($code, 'DECODE', UC_KEY), $get); + + if(empty($get) || UC_STANDALONE) { + exit('Invalid Request'); + } + if(time() - $get['time'] > 3600) { + exit('Authorization has expired'); + } + + include_once DISCUZ_ROOT.'./uc_client/lib/xml.class.php'; + $phpinput = file_get_contents('php://input'); + $post = xml_unserialize($phpinput); + + require DISCUZ_ROOT.'./uc_client/extend_client.php'; + + if(in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcredit', 'getcreditsettings', 'updatecreditsettings', 'addfeed'))) { + $uc_note = new uc_note(); + echo call_user_func(array($uc_note, $get['action']), $get, $post); + exit(); + } else { + exit(API_RETURN_FAILED); + } +} else { + exit; +} + +class uc_note { + + var $dbconfig = ''; + var $db = ''; + var $tablepre = ''; + var $appdir = ''; + + function _serialize($arr, $htmlon = 0) { + if(!function_exists('xml_serialize')) { + include_once DISCUZ_ROOT.'./uc_client/lib/xml.class.php'; + } + return xml_serialize($arr, $htmlon); + } + + function __construct() { + } + + function test($get, $post) { + return API_RETURN_SUCCEED; + } + + function deleteuser($get, $post) { + global $_G; + if(!API_DELETEUSER) { + return API_RETURN_FORBIDDEN; + } + + return uc_note_handler::deleteuser($get, $post); + } + + function renameuser($get, $post) { + global $_G; + + if(!API_RENAMEUSER) { + return API_RETURN_FORBIDDEN; + } + return uc_note_handler::renameuser($get, $post); + } + + function gettag($get, $post) { + global $_G; + if(!API_GETTAG) { + return API_RETURN_FORBIDDEN; + } + return $this->_serialize(array($get['id'], array()), 1); + } + + function synlogin($get, $post) { + global $_G; + + if(!API_SYNLOGIN) { + return API_RETURN_FORBIDDEN; + } + + header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); + + $cookietime = 31536000; + $uid = intval($get['uid']); + if(($member = getuserbyuid($uid, 1))) { + dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime); + } + } + + function synlogout($get, $post) { + global $_G; + + if(!API_SYNLOGOUT) { + return API_RETURN_FORBIDDEN; + } + + header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); + + dsetcookie('auth', '', -31536000); + } + + function updatepw($get, $post) { + global $_G; + + if(!API_UPDATEPW) { + return API_RETURN_FORBIDDEN; + } + return uc_note_handler::updatepw($get, $post); + } + + function updatebadwords($get, $post) { + global $_G; + + if(!API_UPDATEBADWORDS) { + return API_RETURN_FORBIDDEN; + } + + $data = array(); + if(is_array($post)) { + foreach($post as $k => $v) { + if(substr($v['findpattern'], 0, 1) != '/' || substr($v['findpattern'], -3) != '/is') { + $v['findpattern'] = '/' . preg_quote($v['findpattern'], '/') . '/is'; + } + $data['findpattern'][$k] = $v['findpattern']; + $data['replace'][$k] = $v['replacement']; + } + } + $cachefile = DISCUZ_ROOT.'./uc_client/data/cache/badwords.php'; + $s = "' ? substr($configfile, 0, -2) : $configfile; + $configfile = str_replace("define('UC_API', '".addslashes(UC_API)."')", "define('UC_API', '".addslashes($UC_API)."')", $configfile); + + if(file_put_contents(DISCUZ_ROOT.'./config/config_ucenter.php', trim($configfile)) === false) { + return API_RETURN_FAILED; + } + } + } + return API_RETURN_SUCCEED; + } + + function updateclient($get, $post) { + global $_G; + + if(!API_UPDATECLIENT) { + return API_RETURN_FORBIDDEN; + } + + $cachefile = DISCUZ_ROOT.'./uc_client/data/cache/settings.php'; + $s = " $amount)); + C::t('common_credit_log')->insert(array('uid' => $uid, 'operation' => 'ECU', 'relatedid' => $uid, 'dateline' => time(), 'extcredits'.$credit => $amount)); + + return API_RETURN_SUCCEED; + } + + function getcredit($get, $post) { + global $_G; + + if(!API_GETCREDIT) { + return API_RETURN_FORBIDDEN; + } + $uid = intval($get['uid']); + $credit = intval($get['credit']); + $_G['uid'] = $_G['member']['uid'] = $uid; + return getuserprofile('extcredits'.$credit); + } + + function getcreditsettings($get, $post) { + global $_G; + + if(!API_GETCREDITSETTINGS) { + return API_RETURN_FORBIDDEN; + } + + $credits = array(); + foreach($_G['setting']['extcredits'] as $id => $extcredits) { + $credits[$id] = array(strip_tags($extcredits['title']), $extcredits['unit']); + } + + return $this->_serialize($credits); + } + + function updatecreditsettings($get, $post) { + global $_G; + + if(!API_UPDATECREDITSETTINGS) { + return API_RETURN_FORBIDDEN; + } + + $outextcredits = array(); + foreach($get['credit'] as $appid => $credititems) { + if($appid == UC_APPID) { + foreach($credititems as $value) { + $outextcredits[$value['appiddesc'].'|'.$value['creditdesc']] = array( + 'appiddesc' => $value['appiddesc'], + 'creditdesc' => $value['creditdesc'], + 'creditsrc' => $value['creditsrc'], + 'title' => $value['title'], + 'unit' => $value['unit'], + 'ratiosrc' => $value['ratiosrc'], + 'ratiodesc' => $value['ratiodesc'], + 'ratio' => $value['ratio'] + ); + } + } + } + $tmp = array(); + foreach($outextcredits as $value) { + $key = $value['appiddesc'].'|'.$value['creditdesc']; + if(!isset($tmp[$key])) { + $tmp[$key] = array('title' => $value['title'], 'unit' => $value['unit']); + } + $tmp[$key]['ratiosrc'][$value['creditsrc']] = $value['ratiosrc']; + $tmp[$key]['ratiodesc'][$value['creditsrc']] = $value['ratiodesc']; + $tmp[$key]['creditsrc'][$value['creditsrc']] = $value['ratio']; + } + $outextcredits = $tmp; + + $cachefile = DISCUZ_ROOT.'./uc_client/data/cache/creditsettings.php'; + $s = " \ No newline at end of file diff --git a/config/config_global.php b/config/config_global.php new file mode 100644 index 0000000..c341b76 --- /dev/null +++ b/config/config_global.php @@ -0,0 +1,136 @@ + \ No newline at end of file diff --git a/config/config_global_default.php b/config/config_global_default.php new file mode 100644 index 0000000..c32100f --- /dev/null +++ b/config/config_global_default.php @@ -0,0 +1,262 @@ + array( +// 'website_url' => 'http://127.0.0.1/AppCenter', +// 'download_url' => 'http://127.0.0.1/AppCenter/index.php', +// 'download_ip' => '', +// 'check_url' => 'http://127.0.0.1/AppCenter/?ac=check&file=', +// 'check_ip' => '' +// ) +//); + +?> \ No newline at end of file diff --git a/config/config_ucenter.php b/config/config_ucenter.php new file mode 100644 index 0000000..6aea453 --- /dev/null +++ b/config/config_ucenter.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/config/config_ucenter_default.php b/config/config_ucenter_default.php new file mode 100644 index 0000000..a9577ea --- /dev/null +++ b/config/config_ucenter_default.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/config/index.htm b/config/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/config/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/connect.php b/connect.php new file mode 100644 index 0000000..d5c7209 --- /dev/null +++ b/connect.php @@ -0,0 +1,43 @@ +var['mod']; +$discuz->init(); + +if(!in_array($mod, array('config', 'login', 'feed', 'check', 'user'))) { + showmessage('undefined_action'); +} + +if(!$_G['setting']['connect']['allow']) { + showmessage('qqconnect:qqconnect_closed'); +} + +define('CURMODULE', $mod); +runhooks(); + +require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Connect.php'; +$connectService = new Cloud_Service_Connect(); +require_once libfile('connect/'.$mod, 'plugin/qqconnect'); +?> \ No newline at end of file diff --git a/crossdomain.xml b/crossdomain.xml new file mode 100644 index 0000000..5005cdf --- /dev/null +++ b/crossdomain.xml @@ -0,0 +1,4 @@ + + + + diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..28f19a2 Binary files /dev/null and b/favicon.ico differ diff --git a/forum.php b/forum.php new file mode 100644 index 0000000..01a0a39 --- /dev/null +++ b/forum.php @@ -0,0 +1,73 @@ + array('announcements', 'onlinelist', 'forumlinks', + 'heats', 'historyposts', 'onlinerecord', 'userstats', 'diytemplatenameforum'), + 'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums', + 'onlinelist', 'forumstick', 'threadtable_info', 'threadtableids', 'stamps', 'diytemplatenameforum'), + 'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups', + 'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps', + 'threadtableids', 'threadtable_info', 'posttable_info', 'diytemplatenameforum'), + 'redirect' => array('threadtableids', 'threadtable_info', 'posttable_info'), + 'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes', + 'domainwhitelist', 'albumcategory'), + 'space' => array('fields_required', 'fields_optional', 'custominfo'), + 'group' => array('grouptype', 'diytemplatenamegroup'), + 'topicadmin' => array('usergroups'), +); + +$mod = !in_array(C::app()->var['mod'], $modarray) ? 'index' : C::app()->var['mod']; + +define('CURMODULE', $mod); +$cachelist = array(); +if(isset($modcachelist[CURMODULE])) { + $cachelist = $modcachelist[CURMODULE]; + + $cachelist[] = 'plugin'; + $cachelist[] = 'pluginlanguage_system'; +} +if(C::app()->var['mod'] == 'group') { + $_G['basescript'] = 'group'; +} + +C::app()->cachelist = $cachelist; +C::app()->init(); + +loadforum(); + +set_rssauth(); + +runhooks(); + +if(!$_G['setting']['forumstatus'] && !in_array($mod, array('ajax', 'misc', 'modcp'))) { + showmessage('forum_status_off'); +} + +$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']); +$_G['setting']['threadhidethreshold'] = 1; +require DISCUZ_ROOT.'./source/module/forum/forum_'.$mod.'.php'; + +?> \ No newline at end of file diff --git a/group.php b/group.php new file mode 100644 index 0000000..1181cc1 --- /dev/null +++ b/group.php @@ -0,0 +1,37 @@ +cachelist = $cachelist; +$discuz->init(); + +$_G['disabledwidthauto'] = 0; + +$modarray = array('index', 'my', 'attentiongroup'); +$mod = !in_array($_G['mod'], $modarray) ? 'index' : $_G['mod']; + +define('CURMODULE', $mod); + +runhooks(); + +if(!$_G['setting']['groupstatus']) { + showmessage('group_module_status_off'); +} + +$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['group']); + +require DISCUZ_ROOT.'./source/module/group/group_'.$mod.'.php'; +?> \ No newline at end of file diff --git a/home.php b/home.php new file mode 100644 index 0000000..8cd1400 --- /dev/null +++ b/home.php @@ -0,0 +1,44 @@ +cachelist = $cachelist; +$discuz->init(); + +$space = array(); + +$mod = getgpc('mod'); +if(!in_array($mod, array('space', 'spacecp', 'misc', 'magic', 'editor', 'invite', 'task', 'medal', 'rss', 'follow'))) { + $mod = 'space'; + $_GET['do'] = $_G['setting']['feedstatus'] ? 'home' : 'profile'; +} + +if($mod == 'space' && ((empty($_GET['do']) || $_GET['do'] == 'index') && ($_G['inajax']))) { + $_GET['do'] = 'profile'; +} +$curmod = !empty($_G['setting']['followstatus']) && (empty($_GET['diy']) && empty($_GET['do']) && $mod == 'space' || $_GET['do'] == 'follow') ? 'follow' : $mod; +define('CURMODULE', $curmod); +runhooks(getgpc('do') == 'profile' && $_G['inajax'] ? 'card' : getgpc('do')); + +require_once libfile('home/'.$mod, 'module'); + + +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..da752e5 --- /dev/null +++ b/index.php @@ -0,0 +1,191 @@ +=')) { + exit('This version of Discuz! is not compatible with >= PHP 9.0, Please install or update to higher version.'); +} + +if(!empty($_SERVER['QUERY_STRING']) && is_numeric($_SERVER['QUERY_STRING'])) { + $_ENV['curapp'] = 'home'; + $_GET = array('mod'=>'space', 'uid'=>$_SERVER['QUERY_STRING']); +} else { + + $url = ''; + $domain = $_ENV = array(); + $jump = false; + @include_once './data/sysdata/cache_domain.php'; + $_ENV['domain'] = $domain; + if(empty($_ENV['domain'])) { + $_ENV['curapp'] = 'forum'; + } else { + $_ENV['defaultapp'] = array('portal.php' => 'portal', 'forum.php' => 'forum', 'group.php' => 'group', 'home.php' => 'home'); + $_ENV['hostarr'] = explode('.', $_SERVER['HTTP_HOST']); + $_ENV['domainroot'] = substr($_SERVER['HTTP_HOST'], strpos($_SERVER['HTTP_HOST'], '.')+1); + if(!empty($_ENV['domain']['app']) && is_array($_ENV['domain']['app']) && in_array($_SERVER['HTTP_HOST'], $_ENV['domain']['app'])) { + $_ENV['curapp'] = array_search($_SERVER['HTTP_HOST'], $_ENV['domain']['app']); + if($_ENV['curapp'] == 'mobile') { + $_ENV['curapp'] = 'forum'; + if(!isset($_GET['mobile'])) { + @$_GET['mobile'] = '2'; + } + } + if($_ENV['curapp'] == 'default' || !isset($_ENV['defaultapp'][$_ENV['curapp'].'.php'])) { + $_ENV['curapp'] = ''; + } + } elseif(!empty($_ENV['domain']['root']) && is_array($_ENV['domain']['root']) && in_array($_ENV['domainroot'], $_ENV['domain']['root'])) { + + $_G['setting']['holddomain'] = $_ENV['domain']['holddomain'] ? $_ENV['domain']['holddomain'] : array('www'); + $list = $_ENV['domain']['list']; + if(isset($list[$_SERVER['HTTP_HOST']])) { + $domain = $list[$_SERVER['HTTP_HOST']]; + switch($domain['idtype']) { + case 'subarea': + $_ENV['curapp'] = 'forum'; + $_GET['gid'] = intval($domain['id']); + break; + case 'forum': + $_ENV['curapp'] = 'forum'; + $_GET['mod'] = 'forumdisplay'; + $_GET['fid'] = intval($domain['id']); + break; + case 'topic': + $_ENV['curapp'] = 'portal'; + $_GET['mod'] = 'topic'; + $_GET['topicid'] = intval($domain['id']); + break; + case 'channel': + $_ENV['curapp'] = 'portal'; + $_GET['mod'] = 'list'; + $_GET['catid'] = intval($domain['id']); + break; + case 'plugin': + $_ENV['curapp'] = 'plugin'; + $_GET['id'] = $domain['id']; + $_GET['fromapp'] = 'index'; + break; + } + } elseif(count($_ENV['hostarr']) > 2 && $_ENV['hostarr'][0] != 'www' && !checkholddomain($_ENV['hostarr'][0])) { + $_ENV['prefixdomain'] = addslashes($_ENV['hostarr'][0]); + $_ENV['domainroot'] = addslashes($_ENV['domainroot']); + require_once './source/class/class_core.php'; + C::app()->init_setting = true; + C::app()->init_user = false; + C::app()->init_session = false; + C::app()->init_cron = false; + C::app()->init_misc = false; + C::app()->init(); + $jump = true; + $domain = C::t('common_domain')->fetch_by_domain_domainroot($_ENV['prefixdomain'], $_ENV['domainroot']); + $apphost = $_ENV['domain']['app'][$domain['idtype']] ? $_ENV['domain']['app'][$domain['idtype']] : $_ENV['domain']['app']['default']; + $apphost = $apphost ? $_G['scheme'].'://'.$apphost.'/' : ''; + switch($domain['idtype']) { + case 'home': + if($_G['setting']['rewritestatus'] && is_array($_G['setting']['rewritestatus']) && in_array('home_space', $_G['setting']['rewritestatus'])) { + $url = rewriteoutput('home_space', 1, $apphost, $domain['id']); + } else { + $url = $apphost.'home.php?mod=space&uid='.$domain['id']; + } + break; + case 'group': + if($_G['setting']['rewritestatus'] && is_array($_G['setting']['rewritestatus']) && in_array('group_group', $_G['setting']['rewritestatus'])) { + $url = rewriteoutput('group_group', 1, $apphost, $domain['id']); + } else { + $url = $apphost.'forum.php?mod=group&fid='.$domain['id'].'&page=1'; + } + break; + } + } + } else { + $jump = true; + } + if(empty($url) && empty($_ENV['curapp'])) { + if(!empty($_ENV['domain']['defaultindex']) && !$jump) { + if(!empty($_ENV['defaultapp'][$_ENV['domain']['defaultindex']])) { + $_ENV['curapp'] = $_ENV['defaultapp'][$_ENV['domain']['defaultindex']]; + } else { + $url = $_ENV['domain']['defaultindex']; + } + } else { + if($jump) { + $url = empty($_ENV['domain']['app']['default']) ? (!empty($_ENV['domain']['defaultindex']) ? $_ENV['domain']['defaultindex'] : 'forum.php') : (is_https() ? 'https' : 'http').'://'.$_ENV['domain']['app']['default']; + } else { + $_ENV['curapp'] = 'forum'; + } + } + } + } +} +if(!empty($url)) { + $delimiter = strrpos($url, '?') ? '&' : '?'; + if(isset($_GET['fromuid']) && $_GET['fromuid']) { + $url .= sprintf('%sfromuid=%d', $delimiter, $_GET['fromuid']); + } elseif(isset($_GET['fromuser']) && $_GET['fromuser']) { + $url .= sprintf('%sfromuser=%s', $delimiter, rawurlencode($_GET['fromuser'])); + } + $parse = parse_url($url); + if(!isset($parse['host']) && file_exists($parse['path']) && preg_match("/^[\w-]+\.php$/i", $parse['path'])) { + if(!empty($parse['query'])) { + parse_str($parse['query'], $_GET); + } + require './'.$parse['path']; + } else { + header("location: $url"); + } +} else { + if(preg_match("/^[\w-]+$/i", $_ENV['curapp'])) { + require './'.$_ENV['curapp'].'.php'; + } else { + header('location: ./'.$_ENV['curapp'].'.php'); + } +} + +function checkholddomain($domain) { + global $_G; + + $domain = strtolower($domain); + if(preg_match("/^[^a-z]/i", $domain)) return true; + $holdmainarr = empty($_G['setting']['holddomain']) ? array('www') : explode('|', $_G['setting']['holddomain']); + $ishold = false; + foreach ($holdmainarr as $value) { + if(strpos($value, '*') === false) { + if(strtolower($value) == $domain) { + $ishold = true; + break; + } + } else { + $value = str_replace('*', '.*?', $value); + if(@preg_match("/$value/i", $domain)) { + $ishold = true; + break; + } + } + } + return $ishold; +} + +function is_https() { + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { + return true; + } + return false; +} + +?> \ No newline at end of file diff --git a/install/data/common_district_1.sql b/install/data/common_district_1.sql new file mode 100644 index 0000000..a2e7d8c --- /dev/null +++ b/install/data/common_district_1.sql @@ -0,0 +1,15000 @@ + +-- +-- 导出表中的数据 `pre_common_district` +-- + +TRUNCATE TABLE `pre_common_district`; +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`, `usetype`) VALUES +(1, '北京市', 1, 35, 0), +(2, '天津市', 1, 35, 0), +(3, '河北省', 1, 35, 0), +(4, '山西省', 1, 35, 0), +(5, '内蒙古自治区', 1, 35, 0), +(6, '辽宁省', 1, 35, 0), +(7, '吉林省', 1, 35, 0), +(8, '黑龙江省', 1, 35, 0), +(9, '上海市', 1, 35, 0), +(10, '江苏省', 1, 35, 0), +(11, '浙江省', 1, 35, 0), +(12, '安徽省', 1, 35, 0), +(13, '福建省', 1, 35, 0), +(14, '江西省', 1, 35, 0), +(15, '山东省', 1, 35, 0), +(16, '河南省', 1, 35, 0), +(17, '湖北省', 1, 35, 0), +(18, '湖南省', 1, 35, 0), +(19, '广东省', 1, 35, 0), +(20, '广西壮族自治区', 1, 35, 0), +(21, '海南省', 1, 35, 0), +(22, '重庆市', 1, 35, 0), +(23, '四川省', 1, 35, 0), +(24, '贵州省', 1, 35, 0), +(25, '云南省', 1, 35, 0), +(26, '西藏自治区', 1, 35, 0), +(27, '陕西省', 1, 35, 0), +(28, '甘肃省', 1, 35, 0), +(29, '青海省', 1, 35, 0), +(30, '宁夏回族自治区', 1, 35, 0), +(31, '新疆维吾尔自治区', 1, 35, 0), +(32, '台湾省', 1, 35, 0), +(33, '香港特别行政区', 1, 35, 0), +(34, '澳门特别行政区', 1, 35, 0), +(35, '中国', 0, 0, 3), +(36, '其他', 0, 0, 3), +(37, '东城区', 2, 1, 0), +(38, '西城区', 2, 1, 0), +(39, '崇文区', 2, 1, 0), +(40, '宣武区', 2, 1, 0), +(41, '朝阳区', 2, 1, 0), +(42, '丰台区', 2, 1, 0), +(43, '石景山区', 2, 1, 0), +(44, '海淀区', 2, 1, 0), +(45, '门头沟区', 2, 1, 0), +(46, '房山区', 2, 1, 0), +(47, '通州区', 2, 1, 0), +(48, '顺义区', 2, 1, 0), +(49, '昌平区', 2, 1, 0), +(50, '大兴区', 2, 1, 0), +(51, '怀柔区', 2, 1, 0), +(52, '平谷区', 2, 1, 0), +(53, '密云县', 2, 1, 0), +(54, '延庆县', 2, 1, 0), +(55, '和平区', 2, 2, 0), +(56, '河东区', 2, 2, 0), +(57, '河西区', 2, 2, 0), +(58, '南开区', 2, 2, 0), +(59, '河北区', 2, 2, 0), +(60, '红桥区', 2, 2, 0), +(61, '塘沽区', 2, 2, 0), +(62, '汉沽区', 2, 2, 0), +(63, '大港区', 2, 2, 0), +(64, '东丽区', 2, 2, 0), +(65, '西青区', 2, 2, 0), +(66, '津南区', 2, 2, 0), +(67, '北辰区', 2, 2, 0), +(68, '武清区', 2, 2, 0), +(69, '宝坻区', 2, 2, 0), +(70, '宁河县', 2, 2, 0), +(71, '静海县', 2, 2, 0), +(72, '蓟县', 2, 2, 0), +(73, '石家庄市', 2, 3, 0), +(74, '唐山市', 2, 3, 0), +(75, '秦皇岛市', 2, 3, 0), +(76, '邯郸市', 2, 3, 0), +(77, '邢台市', 2, 3, 0), +(78, '保定市', 2, 3, 0), +(79, '张家口市', 2, 3, 0), +(80, '承德市', 2, 3, 0); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(81, '衡水市', 2, 3), +(82, '廊坊市', 2, 3), +(83, '沧州市', 2, 3), +(84, '太原市', 2, 4), +(85, '大同市', 2, 4), +(86, '阳泉市', 2, 4), +(87, '长治市', 2, 4), +(88, '晋城市', 2, 4), +(89, '朔州市', 2, 4), +(90, '晋中市', 2, 4), +(91, '运城市', 2, 4), +(92, '忻州市', 2, 4), +(93, '临汾市', 2, 4), +(94, '吕梁市', 2, 4), +(95, '呼和浩特市', 2, 5), +(96, '包头市', 2, 5), +(97, '乌海市', 2, 5), +(98, '赤峰市', 2, 5), +(99, '通辽市', 2, 5), +(100, '鄂尔多斯市', 2, 5), +(101, '呼伦贝尔市', 2, 5), +(102, '巴彦淖尔市', 2, 5), +(103, '乌兰察布市', 2, 5), +(104, '兴安盟', 2, 5), +(105, '锡林郭勒盟', 2, 5), +(106, '阿拉善盟', 2, 5), +(107, '沈阳市', 2, 6), +(108, '大连市', 2, 6), +(109, '鞍山市', 2, 6), +(110, '抚顺市', 2, 6), +(111, '本溪市', 2, 6), +(112, '丹东市', 2, 6), +(113, '锦州市', 2, 6), +(114, '营口市', 2, 6), +(115, '阜新市', 2, 6), +(116, '辽阳市', 2, 6), +(117, '盘锦市', 2, 6), +(118, '铁岭市', 2, 6), +(119, '朝阳市', 2, 6), +(120, '葫芦岛市', 2, 6), +(121, '长春市', 2, 7), +(122, '吉林市', 2, 7), +(123, '四平市', 2, 7), +(124, '辽源市', 2, 7), +(125, '通化市', 2, 7), +(126, '白山市', 2, 7), +(127, '松原市', 2, 7), +(128, '白城市', 2, 7), +(129, '延边朝鲜族自治州', 2, 7), +(130, '哈尔滨市', 2, 8), +(131, '齐齐哈尔市', 2, 8), +(132, '鸡西市', 2, 8), +(133, '鹤岗市', 2, 8), +(134, '双鸭山市', 2, 8), +(135, '大庆市', 2, 8), +(136, '伊春市', 2, 8), +(137, '佳木斯市', 2, 8), +(138, '七台河市', 2, 8), +(139, '牡丹江市', 2, 8), +(140, '黑河市', 2, 8), +(141, '绥化市', 2, 8), +(142, '大兴安岭地区', 2, 8), +(143, '黄浦区', 2, 9), +(144, '卢湾区', 2, 9), +(145, '徐汇区', 2, 9), +(146, '长宁区', 2, 9), +(147, '静安区', 2, 9), +(148, '普陀区', 2, 9), +(149, '闸北区', 2, 9), +(150, '虹口区', 2, 9), +(151, '杨浦区', 2, 9), +(152, '闵行区', 2, 9), +(153, '宝山区', 2, 9), +(154, '嘉定区', 2, 9), +(155, '浦东新区', 2, 9), +(156, '金山区', 2, 9), +(157, '松江区', 2, 9); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(158, '青浦区', 2, 9), +(159, '南汇区', 2, 9), +(160, '奉贤区', 2, 9), +(161, '崇明县', 2, 9), +(162, '南京市', 2, 10), +(163, '无锡市', 2, 10), +(164, '徐州市', 2, 10), +(165, '常州市', 2, 10), +(166, '苏州市', 2, 10), +(167, '南通市', 2, 10), +(168, '连云港市', 2, 10), +(169, '淮安市', 2, 10), +(170, '盐城市', 2, 10), +(171, '扬州市', 2, 10), +(172, '镇江市', 2, 10), +(173, '泰州市', 2, 10), +(174, '宿迁市', 2, 10), +(175, '杭州市', 2, 11), +(176, '宁波市', 2, 11), +(177, '温州市', 2, 11), +(178, '嘉兴市', 2, 11), +(179, '湖州市', 2, 11), +(180, '绍兴市', 2, 11), +(181, '舟山市', 2, 11), +(182, '衢州市', 2, 11), +(183, '金华市', 2, 11), +(184, '台州市', 2, 11), +(185, '丽水市', 2, 11), +(186, '合肥市', 2, 12), +(187, '芜湖市', 2, 12), +(188, '蚌埠市', 2, 12), +(189, '淮南市', 2, 12), +(190, '马鞍山市', 2, 12), +(191, '淮北市', 2, 12), +(192, '铜陵市', 2, 12), +(193, '安庆市', 2, 12), +(194, '黄山市', 2, 12), +(195, '滁州市', 2, 12), +(196, '阜阳市', 2, 12), +(197, '宿州市', 2, 12), +(198, '巢湖市', 2, 12), +(199, '六安市', 2, 12), +(200, '亳州市', 2, 12), +(201, '池州市', 2, 12), +(202, '宣城市', 2, 12), +(203, '福州市', 2, 13), +(204, '厦门市', 2, 13), +(205, '莆田市', 2, 13), +(206, '三明市', 2, 13), +(207, '泉州市', 2, 13), +(208, '漳州市', 2, 13), +(209, '南平市', 2, 13), +(210, '龙岩市', 2, 13), +(211, '宁德市', 2, 13), +(212, '南昌市', 2, 14), +(213, '景德镇市', 2, 14), +(214, '萍乡市', 2, 14), +(215, '九江市', 2, 14), +(216, '新余市', 2, 14), +(217, '鹰潭市', 2, 14), +(218, '赣州市', 2, 14), +(219, '吉安市', 2, 14), +(220, '宜春市', 2, 14), +(221, '抚州市', 2, 14), +(222, '上饶市', 2, 14), +(223, '济南市', 2, 15), +(224, '青岛市', 2, 15), +(225, '淄博市', 2, 15), +(226, '枣庄市', 2, 15), +(227, '东营市', 2, 15), +(228, '烟台市', 2, 15), +(229, '潍坊市', 2, 15), +(230, '济宁市', 2, 15), +(231, '泰安市', 2, 15), +(232, '威海市', 2, 15), +(233, '日照市', 2, 15); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(234, '莱芜市', 2, 15), +(235, '临沂市', 2, 15), +(236, '德州市', 2, 15), +(237, '聊城市', 2, 15), +(238, '滨州市', 2, 15), +(239, '菏泽市', 2, 15), +(240, '郑州市', 2, 16), +(241, '开封市', 2, 16), +(242, '洛阳市', 2, 16), +(243, '平顶山市', 2, 16), +(244, '安阳市', 2, 16), +(245, '鹤壁市', 2, 16), +(246, '新乡市', 2, 16), +(247, '焦作市', 2, 16), +(248, '濮阳市', 2, 16), +(249, '许昌市', 2, 16), +(250, '漯河市', 2, 16), +(251, '三门峡市', 2, 16), +(252, '南阳市', 2, 16), +(253, '商丘市', 2, 16), +(254, '信阳市', 2, 16), +(255, '周口市', 2, 16), +(256, '驻马店市', 2, 16), +(257, '济源市', 2, 16), +(258, '武汉市', 2, 17), +(259, '黄石市', 2, 17), +(260, '十堰市', 2, 17), +(261, '宜昌市', 2, 17), +(262, '襄樊市', 2, 17), +(263, '鄂州市', 2, 17), +(264, '荆门市', 2, 17), +(265, '孝感市', 2, 17), +(266, '荆州市', 2, 17), +(267, '黄冈市', 2, 17), +(268, '咸宁市', 2, 17), +(269, '随州市', 2, 17), +(270, '恩施土家族苗族自治州', 2, 17), +(271, '仙桃市', 2, 17), +(272, '潜江市', 2, 17), +(273, '天门市', 2, 17), +(274, '神农架林区', 2, 17), +(275, '长沙市', 2, 18), +(276, '株洲市', 2, 18), +(277, '湘潭市', 2, 18), +(278, '衡阳市', 2, 18), +(279, '邵阳市', 2, 18), +(280, '岳阳市', 2, 18), +(281, '常德市', 2, 18), +(282, '张家界市', 2, 18), +(283, '益阳市', 2, 18), +(284, '郴州市', 2, 18), +(285, '永州市', 2, 18), +(286, '怀化市', 2, 18), +(287, '娄底市', 2, 18), +(288, '湘西土家族苗族自治州', 2, 18), +(289, '广州市', 2, 19), +(290, '韶关市', 2, 19), +(291, '深圳市', 2, 19), +(292, '珠海市', 2, 19), +(293, '汕头市', 2, 19), +(294, '佛山市', 2, 19), +(295, '江门市', 2, 19), +(296, '湛江市', 2, 19), +(297, '茂名市', 2, 19), +(298, '肇庆市', 2, 19), +(299, '惠州市', 2, 19), +(300, '梅州市', 2, 19), +(301, '汕尾市', 2, 19), +(302, '河源市', 2, 19), +(303, '阳江市', 2, 19), +(304, '清远市', 2, 19), +(305, '东莞市', 2, 19), +(306, '中山市', 2, 19), +(307, '潮州市', 2, 19); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(308, '揭阳市', 2, 19), +(309, '云浮市', 2, 19), +(310, '南宁市', 2, 20), +(311, '柳州市', 2, 20), +(312, '桂林市', 2, 20), +(313, '梧州市', 2, 20), +(314, '北海市', 2, 20), +(315, '防城港市', 2, 20), +(316, '钦州市', 2, 20), +(317, '贵港市', 2, 20), +(318, '玉林市', 2, 20), +(319, '百色市', 2, 20), +(320, '贺州市', 2, 20), +(321, '河池市', 2, 20), +(322, '来宾市', 2, 20), +(323, '崇左市', 2, 20), +(324, '海口市', 2, 21), +(325, '三亚市', 2, 21), +(326, '五指山市', 2, 21), +(327, '琼海市', 2, 21), +(328, '儋州市', 2, 21), +(329, '文昌市', 2, 21), +(330, '万宁市', 2, 21), +(331, '东方市', 2, 21), +(332, '定安县', 2, 21), +(333, '屯昌县', 2, 21), +(334, '澄迈县', 2, 21), +(335, '临高县', 2, 21), +(336, '白沙黎族自治县', 2, 21), +(337, '昌江黎族自治县', 2, 21), +(338, '乐东黎族自治县', 2, 21), +(339, '陵水黎族自治县', 2, 21), +(340, '保亭黎族苗族自治县', 2, 21), +(341, '琼中黎族苗族自治县', 2, 21), +(342, '西沙群岛', 2, 21), +(343, '南沙群岛', 2, 21), +(344, '中沙群岛的岛礁及其海域', 2, 21), +(345, '万州区', 2, 22), +(346, '涪陵区', 2, 22), +(347, '渝中区', 2, 22), +(348, '大渡口区', 2, 22), +(349, '江北区', 2, 22), +(350, '沙坪坝区', 2, 22), +(351, '九龙坡区', 2, 22), +(352, '南岸区', 2, 22), +(353, '北碚区', 2, 22), +(354, '双桥区', 2, 22), +(355, '万盛区', 2, 22), +(356, '渝北区', 2, 22), +(357, '巴南区', 2, 22), +(358, '黔江区', 2, 22), +(359, '长寿区', 2, 22), +(360, '綦江县', 2, 22), +(361, '潼南县', 2, 22), +(362, '铜梁县', 2, 22), +(363, '大足县', 2, 22), +(364, '荣昌县', 2, 22), +(365, '璧山县', 2, 22), +(366, '梁平县', 2, 22), +(367, '城口县', 2, 22), +(368, '丰都县', 2, 22), +(369, '垫江县', 2, 22), +(370, '武隆县', 2, 22), +(371, '忠县', 2, 22), +(372, '开县', 2, 22), +(373, '云阳县', 2, 22), +(374, '奉节县', 2, 22), +(375, '巫山县', 2, 22), +(376, '巫溪县', 2, 22), +(377, '石柱土家族自治县', 2, 22); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(378, '秀山土家族苗族自治县', 2, 22), +(379, '酉阳土家族苗族自治县', 2, 22), +(380, '彭水苗族土家族自治县', 2, 22), +(381, '江津市', 2, 22), +(382, '合川市', 2, 22), +(383, '永川市', 2, 22), +(384, '南川市', 2, 22), +(385, '成都市', 2, 23), +(386, '自贡市', 2, 23), +(387, '攀枝花市', 2, 23), +(388, '泸州市', 2, 23), +(389, '德阳市', 2, 23), +(390, '绵阳市', 2, 23), +(391, '广元市', 2, 23), +(392, '遂宁市', 2, 23), +(393, '内江市', 2, 23), +(394, '乐山市', 2, 23), +(395, '南充市', 2, 23), +(396, '眉山市', 2, 23), +(397, '宜宾市', 2, 23), +(398, '广安市', 2, 23), +(399, '达州市', 2, 23), +(400, '雅安市', 2, 23), +(401, '巴中市', 2, 23), +(402, '资阳市', 2, 23), +(403, '阿坝藏族羌族自治州', 2, 23), +(404, '甘孜藏族自治州', 2, 23), +(405, '凉山彝族自治州', 2, 23), +(406, '贵阳市', 2, 24), +(407, '六盘水市', 2, 24), +(408, '遵义市', 2, 24), +(409, '安顺市', 2, 24), +(410, '铜仁地区', 2, 24), +(411, '黔西南布依族苗族自治州', 2, 24), +(412, '毕节地区', 2, 24), +(413, '黔东南苗族侗族自治州', 2, 24), +(414, '黔南布依族苗族自治州', 2, 24), +(415, '昆明市', 2, 25), +(416, '曲靖市', 2, 25), +(417, '玉溪市', 2, 25), +(418, '保山市', 2, 25), +(419, '昭通市', 2, 25), +(420, '丽江市', 2, 25), +(421, '思茅市', 2, 25), +(422, '临沧市', 2, 25), +(423, '楚雄彝族自治州', 2, 25), +(424, '红河哈尼族彝族自治州', 2, 25), +(425, '文山壮族苗族自治州', 2, 25), +(426, '西双版纳傣族自治州', 2, 25), +(427, '大理白族自治州', 2, 25), +(428, '德宏傣族景颇族自治州', 2, 25), +(429, '怒江傈僳族自治州', 2, 25), +(430, '迪庆藏族自治州', 2, 25), +(431, '拉萨市', 2, 26), +(432, '昌都地区', 2, 26), +(433, '山南地区', 2, 26), +(434, '日喀则地区', 2, 26), +(435, '那曲地区', 2, 26), +(436, '阿里地区', 2, 26), +(437, '林芝地区', 2, 26), +(438, '西安市', 2, 27), +(439, '铜川市', 2, 27), +(440, '宝鸡市', 2, 27); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(441, '咸阳市', 2, 27), +(442, '渭南市', 2, 27), +(443, '延安市', 2, 27), +(444, '汉中市', 2, 27), +(445, '榆林市', 2, 27), +(446, '安康市', 2, 27), +(447, '商洛市', 2, 27), +(448, '兰州市', 2, 28), +(449, '嘉峪关市', 2, 28), +(450, '金昌市', 2, 28), +(451, '白银市', 2, 28), +(452, '天水市', 2, 28), +(453, '武威市', 2, 28), +(454, '张掖市', 2, 28), +(455, '平凉市', 2, 28), +(456, '酒泉市', 2, 28), +(457, '庆阳市', 2, 28), +(458, '定西市', 2, 28), +(459, '陇南市', 2, 28), +(460, '临夏回族自治州', 2, 28), +(461, '甘南藏族自治州', 2, 28), +(462, '西宁市', 2, 29), +(463, '海东地区', 2, 29), +(464, '海北藏族自治州', 2, 29), +(465, '黄南藏族自治州', 2, 29), +(466, '海南藏族自治州', 2, 29), +(467, '果洛藏族自治州', 2, 29), +(468, '玉树藏族自治州', 2, 29), +(469, '海西蒙古族藏族自治州', 2, 29), +(470, '银川市', 2, 30), +(471, '石嘴山市', 2, 30), +(472, '吴忠市', 2, 30), +(473, '固原市', 2, 30), +(474, '中卫市', 2, 30), +(475, '乌鲁木齐市', 2, 31), +(476, '克拉玛依市', 2, 31), +(477, '吐鲁番地区', 2, 31), +(478, '哈密地区', 2, 31), +(479, '昌吉回族自治州', 2, 31), +(480, '博尔塔拉蒙古自治州', 2, 31), +(481, '巴音郭楞蒙古自治州', 2, 31), +(482, '阿克苏地区', 2, 31), +(483, '克孜勒苏柯尔克孜自治州', 2, 31), +(484, '喀什地区', 2, 31), +(485, '和田地区', 2, 31), +(486, '伊犁哈萨克自治州', 2, 31), +(487, '塔城地区', 2, 31), +(488, '阿勒泰地区', 2, 31), +(489, '石河子市', 2, 31), +(490, '阿拉尔市', 2, 31), +(491, '图木舒克市', 2, 31), +(492, '五家渠市', 2, 31), +(493, '台北市', 2, 32), +(494, '高雄市', 2, 32), +(495, '基隆市', 2, 32), +(496, '台中市', 2, 32), +(497, '台南市', 2, 32), +(498, '新竹市', 2, 32), +(499, '嘉义市', 2, 32), +(500, '台北县', 2, 32), +(501, '宜兰县', 2, 32), +(502, '桃园县', 2, 32), +(503, '新竹县', 2, 32), +(504, '苗栗县', 2, 32), +(505, '台中县', 2, 32), +(506, '彰化县', 2, 32); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(507, '南投县', 2, 32), +(508, '云林县', 2, 32), +(509, '嘉义县', 2, 32), +(510, '台南县', 2, 32), +(511, '高雄县', 2, 32), +(512, '屏东县', 2, 32), +(513, '澎湖县', 2, 32), +(514, '台东县', 2, 32), +(515, '花莲县', 2, 32), +(516, '中西区', 2, 33), +(517, '东区', 2, 33), +(518, '九龙城区', 2, 33), +(519, '观塘区', 2, 33), +(520, '南区', 2, 33), +(521, '深水埗区', 2, 33), +(522, '黄大仙区', 2, 33), +(523, '湾仔区', 2, 33), +(524, '油尖旺区', 2, 33), +(525, '离岛区', 2, 33), +(526, '葵青区', 2, 33), +(527, '北区', 2, 33), +(528, '西贡区', 2, 33), +(529, '沙田区', 2, 33), +(530, '屯门区', 2, 33), +(531, '大埔区', 2, 33), +(532, '荃湾区', 2, 33), +(533, '元朗区', 2, 33), +(534, '澳门特别行政区', 2, 34); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`, `usetype`) VALUES +(535, '美国', 0, 0, 3), +(536, '加拿大', 0, 0, 3), +(537, '澳大利亚', 0, 0, 3), +(538, '新西兰', 0, 0, 3), +(539, '英国', 0, 0, 3), +(540, '法国', 0, 0, 3), +(541, '德国', 0, 0, 3), +(542, '捷克', 0, 0, 3), +(543, '荷兰', 0, 0, 3), +(544, '瑞士', 0, 0, 3), +(545, '希腊', 0, 0, 3), +(546, '挪威', 0, 0, 3), +(547, '瑞典', 0, 0, 3), +(548, '丹麦', 0, 0, 3), +(549, '芬兰', 0, 0, 3), +(550, '爱尔兰', 0, 0, 3), +(551, '奥地利', 0, 0, 3), +(552, '意大利', 0, 0, 3), +(553, '乌克兰', 0, 0, 3), +(554, '俄罗斯', 0, 0, 3), +(555, '西班牙', 0, 0, 3), +(556, '韩国', 0, 0, 3), +(557, '新加坡', 0, 0, 3), +(558, '马来西亚', 0, 0, 3), +(559, '印度', 0, 0, 3), +(560, '泰国', 0, 0, 3), +(561, '日本', 0, 0, 3), +(562, '巴西', 0, 0, 3), +(563, '阿根廷', 0, 0, 3), +(564, '南非', 0, 0, 3), +(565, '埃及', 0, 0, 3); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(567, '东华门街道', 3, 37), +(568, '东四街道', 3, 37), +(569, '东直门街道', 3, 37), +(570, '交道口街道', 3, 37), +(571, '北新桥街道', 3, 37), +(572, '和平里街道', 3, 37), +(573, '安定门街道', 3, 37), +(574, '建国门街道', 3, 37), +(575, '景山街道', 3, 37), +(576, '朝阳门街道', 3, 37), +(577, '什刹海街道', 3, 38), +(578, '展览路街道', 3, 38), +(579, '德胜街道', 3, 38), +(580, '新街口街道', 3, 38), +(581, '月坛街道', 3, 38); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(582, '西长安街街道', 3, 38), +(583, '金融街街道', 3, 38), +(584, '东花市街道', 3, 39), +(585, '体育馆路街道', 3, 39), +(586, '前门街道', 3, 39), +(587, '天坛街道', 3, 39), +(588, '崇文门外街道', 3, 39), +(589, '永定门外街道', 3, 39), +(590, '龙潭街道', 3, 39), +(591, '大栅栏街道', 3, 40), +(592, '天桥街道', 3, 40), +(593, '广安门内街道', 3, 40), +(594, '广安门外街道', 3, 40), +(595, '椿树街道', 3, 40), +(596, '牛街街道', 3, 40), +(597, '白纸坊街道', 3, 40), +(598, '陶然亭街道', 3, 40), +(599, '三里屯街道', 3, 41), +(600, '三间房地区(三间房乡)', 3, 41), +(601, '东坝地区(东坝乡)', 3, 41), +(602, '东风地区(东风乡)', 3, 41), +(603, '亚运村街道', 3, 41), +(604, '八里庄街道', 3, 41), +(605, '六里屯街道', 3, 41), +(606, '劲松街道', 3, 41), +(607, '十八里店地区(十八里店乡)', 3, 41), +(608, '南磨房地区(南磨房乡)', 3, 41), +(609, '双井街道', 3, 41), +(610, '呼家楼街道', 3, 41), +(611, '和平街街道', 3, 41), +(612, '团结湖街道', 3, 41), +(613, '垡头街道', 3, 41), +(614, '大屯街道', 3, 41), +(615, '太阳宫地区(太阳宫乡)', 3, 41), +(616, '奥运村地区(奥运村乡)', 3, 41), +(617, '孙河地区(孙河乡)', 3, 41), +(618, '安贞街道', 3, 41), +(619, '将台地区(将台乡)', 3, 41), +(620, '小关街道', 3, 41), +(621, '小红门地区(小红门乡)', 3, 41), +(622, '崔各庄地区(崔各庄乡)', 3, 41), +(623, '左家庄街道', 3, 41), +(624, '常营回族地区(常营回族乡)', 3, 41), +(625, '平房地区(平房乡)', 3, 41), +(626, '建国门外街道', 3, 41), +(627, '望京开发街道', 3, 41), +(628, '望京街道', 3, 41), +(629, '朝阳门外街道', 3, 41), +(630, '来广营地区(来广营乡)', 3, 41), +(631, '潘家园街道', 3, 41), +(632, '王四营地区(王四营乡)', 3, 41), +(633, '管庄地区(管庄乡)', 3, 41), +(634, '豆各庄地区(豆各庄乡)', 3, 41); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(635, '酒仙桥街道', 3, 41), +(636, '金盏地区(金盏乡)', 3, 41), +(637, '首都机场街道', 3, 41), +(638, '香河园街道', 3, 41), +(639, '高碑店地区(高碑店乡)', 3, 41), +(640, '麦子店街道', 3, 41), +(641, '黑庄户地区(黑庄户乡)', 3, 41), +(642, '东铁匠营街道', 3, 42), +(643, '东高地街道', 3, 42), +(644, '丰台街道', 3, 42), +(645, '云岗街道', 3, 42), +(646, '南苑乡', 3, 42), +(647, '南苑街道', 3, 42), +(648, '卢沟桥乡', 3, 42), +(649, '卢沟桥街道', 3, 42), +(650, '右安门街道', 3, 42), +(651, '和义街道', 3, 42), +(652, '大红门街道', 3, 42), +(653, '太平桥街道', 3, 42), +(654, '宛平城地区', 3, 42), +(655, '新村街道', 3, 42), +(656, '方庄地区', 3, 42), +(657, '王佐镇', 3, 42), +(658, '花乡乡', 3, 42), +(659, '西罗园街道', 3, 42), +(660, '长辛店街道', 3, 42), +(661, '长辛店镇', 3, 42), +(662, '马家堡街道', 3, 42), +(663, '五里坨街道', 3, 43), +(664, '八宝山街道', 3, 43), +(665, '八角街道', 3, 43), +(666, '北辛安街道', 3, 43), +(667, '古城街道', 3, 43), +(668, '广宁街道', 3, 43), +(669, '老山街道', 3, 43), +(670, '苹果园街道', 3, 43), +(671, '金顶街街道', 3, 43), +(672, '鲁谷街道', 3, 43), +(673, '万寿路街道', 3, 44), +(674, '万柳地区(海淀乡)', 3, 44), +(675, '上地街道', 3, 44), +(676, '上庄镇', 3, 44), +(677, '东升地区(东升乡)', 3, 44), +(678, '中关村街道', 3, 44), +(679, '八里庄街道', 3, 44), +(680, '北下关街道', 3, 44), +(681, '北太平庄街道', 3, 44), +(682, '四季青镇', 3, 44), +(683, '学院路街道', 3, 44), +(684, '曙光街道', 3, 44), +(685, '永定路街道', 3, 44), +(686, '海淀街道', 3, 44), +(687, '清华园街道', 3, 44), +(688, '清河街道', 3, 44), +(689, '温泉镇', 3, 44), +(690, '燕园街道', 3, 44), +(691, '甘家口街道', 3, 44), +(692, '田村路街道', 3, 44), +(693, '紫竹院街道', 3, 44), +(694, '羊坊店街道', 3, 44), +(695, '花园路街道', 3, 44), +(696, '苏家坨镇', 3, 44); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(697, '西三旗街道', 3, 44), +(698, '西北旺镇', 3, 44), +(699, '青龙桥街道', 3, 44), +(700, '香山街道', 3, 44), +(701, '马连洼街道', 3, 44), +(702, '东辛房街道', 3, 45), +(703, '军庄镇', 3, 45), +(704, '城子街道', 3, 45), +(705, '大台街道', 3, 45), +(706, '大峪街道', 3, 45), +(707, '妙峰山镇', 3, 45), +(708, '斋堂镇', 3, 45), +(709, '永定镇', 3, 45), +(710, '清水镇', 3, 45), +(711, '潭柘寺镇', 3, 45), +(712, '王平地区', 3, 45), +(713, '雁翅镇', 3, 45), +(714, '龙泉镇', 3, 45), +(715, '东风街道', 3, 46), +(716, '佛子庄乡', 3, 46), +(717, '十渡镇', 3, 46), +(718, '南窖乡', 3, 46), +(719, '史家营乡', 3, 46), +(720, '向阳街道', 3, 46), +(721, '周口店地区', 3, 46), +(722, '城关街道', 3, 46), +(723, '大安山乡', 3, 46), +(724, '大石窝镇', 3, 46), +(725, '张坊镇', 3, 46), +(726, '拱辰街道', 3, 46), +(727, '新镇街道', 3, 46), +(728, '星城街道', 3, 46), +(729, '河北镇', 3, 46), +(730, '琉璃河地区', 3, 46), +(731, '石楼镇', 3, 46), +(732, '窦店镇', 3, 46), +(733, '良乡地区', 3, 46), +(734, '蒲洼乡', 3, 46), +(735, '西潞街道', 3, 46), +(736, '迎风街道', 3, 46), +(737, '长沟镇', 3, 46), +(738, '长阳镇', 3, 46), +(739, '阎村镇', 3, 46), +(740, '霞云岭乡', 3, 46), +(741, '青龙湖镇', 3, 46), +(742, '韩村河镇', 3, 46), +(743, '中仓街道', 3, 47), +(744, '于家务回族乡', 3, 47), +(745, '北苑街道', 3, 47), +(746, '台湖镇', 3, 47), +(747, '宋庄镇', 3, 47), +(748, '张家湾镇', 3, 47), +(749, '新华街道', 3, 47), +(750, '梨园地区', 3, 47), +(751, '永乐店镇', 3, 47), +(752, '永顺地区', 3, 47), +(753, '漷县镇', 3, 47), +(754, '潞城镇', 3, 47), +(755, '玉桥街道', 3, 47), +(756, '西集镇', 3, 47), +(757, '马驹桥镇', 3, 47), +(758, '仁和地区', 3, 48), +(759, '光明街道', 3, 48), +(760, '北务镇', 3, 48), +(761, '北小营镇', 3, 48), +(762, '北石槽镇', 3, 48), +(763, '南彩镇', 3, 48), +(764, '南法信地区', 3, 48), +(765, '后沙峪地区', 3, 48), +(766, '大孙各庄镇', 3, 48); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(767, '天竺地区', 3, 48), +(768, '张镇', 3, 48), +(769, '木林镇', 3, 48), +(770, '李桥镇', 3, 48), +(771, '李遂镇', 3, 48), +(772, '杨镇地区', 3, 48), +(773, '牛栏山地区', 3, 48), +(774, '石园街道', 3, 48), +(775, '胜利街道', 3, 48), +(776, '赵全营镇', 3, 48), +(777, '马坡地区', 3, 48), +(778, '高丽营镇', 3, 48), +(779, '龙湾屯镇', 3, 48), +(780, '东小口地区', 3, 49), +(781, '兴寿镇', 3, 49), +(782, '北七家镇', 3, 49), +(783, '十三陵镇', 3, 49), +(784, '南口地区', 3, 49), +(785, '南邵镇', 3, 49), +(786, '回龙观地区', 3, 49), +(787, '城北街道', 3, 49), +(788, '城南街道', 3, 49), +(789, '小汤山镇', 3, 49), +(790, '崔村镇', 3, 49), +(791, '沙河地区', 3, 49), +(792, '流村镇', 3, 49), +(793, '百善镇', 3, 49), +(794, '长陵镇', 3, 49), +(795, '阳坊镇', 3, 49), +(796, '马池口地区', 3, 49), +(797, '亦庄地区(亦庄镇)', 3, 50), +(798, '兴丰街道', 3, 50), +(799, '北臧村镇', 3, 50), +(800, '安定镇', 3, 50), +(801, '庞各庄镇', 3, 50), +(802, '旧宫地区(旧宫镇)', 3, 50), +(803, '林校路街道', 3, 50), +(804, '榆垡镇', 3, 50), +(805, '清源街道', 3, 50), +(806, '瀛海镇', 3, 50), +(807, '礼贤镇', 3, 50), +(808, '西红门地区(西红门镇)', 3, 50), +(809, '采育镇', 3, 50), +(810, '长子营镇', 3, 50), +(811, '青云店镇', 3, 50), +(812, '魏善庄镇', 3, 50), +(813, '黄村地区(黄村镇)', 3, 50), +(814, '九渡河镇', 3, 51), +(815, '北房镇', 3, 51), +(816, '喇叭沟门满族乡', 3, 51), +(817, '宝山镇', 3, 51), +(818, '庙城地区', 3, 51), +(819, '怀北镇', 3, 51), +(820, '怀柔地区', 3, 51), +(821, '杨宋镇', 3, 51), +(822, '桥梓镇', 3, 51), +(823, '汤河口镇', 3, 51), +(824, '泉河街道', 3, 51), +(825, '渤海镇', 3, 51), +(826, '琉璃庙镇', 3, 51), +(827, '长哨营满族乡', 3, 51), +(828, '雁栖地区', 3, 51), +(829, '龙山街道', 3, 51), +(830, '东高村镇', 3, 52), +(831, '兴谷街道', 3, 52), +(832, '刘家店镇', 3, 52), +(833, '南独乐河镇', 3, 52); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(834, '夏各庄镇', 3, 52), +(835, '大兴庄镇', 3, 52), +(836, '大华山镇', 3, 52), +(837, '山东庄镇', 3, 52), +(838, '峪口地区', 3, 52), +(839, '渔阳地区', 3, 52), +(840, '滨河街道', 3, 52), +(841, '熊儿寨乡', 3, 52), +(842, '王辛庄镇', 3, 52), +(843, '金海湖地区', 3, 52), +(844, '镇罗营镇', 3, 52), +(845, '马坊地区', 3, 52), +(846, '马昌营镇', 3, 52), +(847, '黄松峪乡', 3, 52), +(848, '不老屯镇', 3, 53), +(849, '东邵渠镇', 3, 53), +(850, '冯家峪镇', 3, 53), +(851, '北庄镇', 3, 53), +(852, '十里堡镇', 3, 53), +(853, '古北口镇', 3, 53), +(854, '大城子镇', 3, 53), +(855, '太师屯镇', 3, 53), +(856, '密云镇', 3, 53), +(857, '巨各庄镇', 3, 53), +(858, '新城子镇', 3, 53), +(859, '果园街道', 3, 53), +(860, '檀营地区(檀营满族蒙古族乡)', 3, 53), +(861, '河南寨镇', 3, 53), +(862, '溪翁庄镇', 3, 53), +(863, '石城镇', 3, 53), +(864, '穆家峪镇', 3, 53), +(865, '西田各庄镇', 3, 53), +(866, '高岭镇', 3, 53), +(867, '鼓楼街道', 3, 53), +(868, '井庄镇', 3, 54), +(869, '八达岭镇', 3, 54), +(870, '刘斌堡乡', 3, 54), +(871, '千家店镇', 3, 54), +(872, '四海镇', 3, 54), +(873, '大庄科乡', 3, 54), +(874, '大榆树镇', 3, 54), +(875, '康庄镇', 3, 54), +(876, '延庆镇', 3, 54), +(877, '张山营镇', 3, 54), +(878, '旧县镇', 3, 54), +(879, '永宁镇', 3, 54), +(880, '沈家营镇', 3, 54), +(881, '珍珠泉乡', 3, 54), +(882, '香营乡', 3, 54), +(883, '体育馆街道', 3, 55), +(884, '劝业场街道', 3, 55), +(885, '南市街道', 3, 55), +(886, '南营门街道', 3, 55), +(887, '小白楼街道', 3, 55), +(888, '新兴街道', 3, 55), +(889, '上杭路街道', 3, 56), +(890, '东新街道', 3, 56), +(891, '中山门街道', 3, 56), +(892, '二号桥街道', 3, 56), +(893, '向阳楼街道', 3, 56), +(894, '唐家口街道', 3, 56), +(895, '大王庄街道', 3, 56), +(896, '大直沽街道', 3, 56), +(897, '天津铁厂街道', 3, 56), +(898, '富民路街道', 3, 56), +(899, '常州道街道', 3, 56), +(900, '春华街道', 3, 56); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(901, '鲁山道街道', 3, 56), +(902, '下瓦房街道', 3, 57), +(903, '东海街道', 3, 57), +(904, '友谊路街道', 3, 57), +(905, '大营门街道', 3, 57), +(906, '天塔街道', 3, 57), +(907, '尖山街道', 3, 57), +(908, '挂甲寺街道', 3, 57), +(909, '柳林街道', 3, 57), +(910, '桃园街道', 3, 57), +(911, '梅江街道', 3, 57), +(912, '越秀路街道', 3, 57), +(913, '陈塘庄街道', 3, 57), +(914, '马场街道', 3, 57), +(915, '万兴街道', 3, 58), +(916, '体育中心街道', 3, 58), +(917, '八里台街道', 3, 58), +(918, '兴南街道', 3, 58), +(919, '华苑街道', 3, 58), +(920, '向阳路街道', 3, 58), +(921, '嘉陵道街道', 3, 58), +(922, '学府街道', 3, 58), +(923, '广开街道', 3, 58), +(924, '王顶堤街道', 3, 58), +(925, '长虹街道', 3, 58), +(926, '鼓楼街道', 3, 58), +(927, '光复道街道', 3, 59), +(928, '宁园街道', 3, 59), +(929, '建昌道街道', 3, 59), +(930, '新开河街道', 3, 59), +(931, '月牙河街道', 3, 59), +(932, '望海楼街道', 3, 59), +(933, '江都路街道', 3, 59), +(934, '王串场街道', 3, 59), +(935, '铁东路街道', 3, 59), +(936, '鸿顺里街道', 3, 59), +(937, '丁字沽街道', 3, 60), +(938, '三条石街道', 3, 60), +(939, '双环村街道', 3, 60), +(940, '咸阳北路街道', 3, 60), +(941, '大胡同街道', 3, 60), +(942, '芥园道街道', 3, 60), +(943, '西于庄街道', 3, 60), +(944, '西沽街道', 3, 60), +(945, '邵公庄街道', 3, 60), +(946, '铃铛阁街道', 3, 60), +(947, '三槐路街道', 3, 61), +(948, '北塘街道', 3, 61), +(949, '向阳街道', 3, 61), +(950, '大沽街道', 3, 61), +(951, '新城镇', 3, 61), +(952, '新村街道', 3, 61), +(953, '新河街道', 3, 61), +(954, '新港街道', 3, 61), +(955, '杭州道街道', 3, 61), +(956, '渤海石油街道', 3, 61), +(957, '胡家园街道', 3, 61), +(958, '解放路街道', 3, 61), +(959, '大田镇', 3, 62), +(960, '天化街道', 3, 62), +(961, '寨上街道', 3, 62), +(962, '杨家泊镇', 3, 62), +(963, '汉沽街道', 3, 62), +(964, '河西街道', 3, 62); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(965, '盐场街道', 3, 62), +(966, '茶淀镇', 3, 62), +(967, '营城镇', 3, 62), +(968, '中塘镇', 3, 63), +(969, '古林街道', 3, 63), +(970, '太平镇', 3, 63), +(971, '小王庄镇', 3, 63), +(972, '海滨街道', 3, 63), +(973, '港西街道', 3, 63), +(974, '胜利街道', 3, 63), +(975, '迎宾街道', 3, 63), +(976, '万新街道', 3, 64), +(977, '丰年村街道', 3, 64), +(978, '么六桥乡', 3, 64), +(979, '军粮城镇', 3, 64), +(980, '华明镇', 3, 64), +(981, '大毕庄镇', 3, 64), +(982, '张贵庄街道', 3, 64), +(983, '新立街道', 3, 64), +(984, '无瑕街道', 3, 64), +(985, '中北镇', 3, 65), +(986, '南河镇', 3, 65), +(987, '大寺镇', 3, 65), +(988, '张家窝镇', 3, 65), +(989, '李七庄街道', 3, 65), +(990, '杨柳青镇', 3, 65), +(991, '王稳庄镇', 3, 65), +(992, '西营门街道', 3, 65), +(993, '辛口镇', 3, 65), +(994, '八里台镇', 3, 66), +(995, '北闸口镇', 3, 66), +(996, '双桥河镇', 3, 66), +(997, '双港镇', 3, 66), +(998, '咸水沽镇', 3, 66), +(999, '小站镇', 3, 66), +(1000, '葛沽镇', 3, 66), +(1001, '辛庄镇', 3, 66), +(1002, '长青办事处', 3, 66), +(1003, '北仓镇', 3, 67), +(1004, '双口镇', 3, 67), +(1005, '双街镇', 3, 67), +(1006, '大张庄镇', 3, 67), +(1007, '天穆镇', 3, 67), +(1008, '宜兴埠镇', 3, 67), +(1009, '小淀镇', 3, 67), +(1010, '普东街道', 3, 67), +(1011, '果园新村街道', 3, 67), +(1012, '西堤头镇', 3, 67), +(1013, '集贤里街道', 3, 67), +(1014, '青光镇', 3, 67), +(1015, '上马台镇', 3, 68), +(1016, '下伍旗镇', 3, 68), +(1017, '下朱庄街道', 3, 68), +(1018, '东蒲洼街道', 3, 68), +(1019, '东马圈镇', 3, 68), +(1020, '南蔡村镇', 3, 68), +(1021, '城关镇', 3, 68), +(1022, '大孟庄镇', 3, 68), +(1023, '大王古庄镇', 3, 68), +(1024, '大碱厂镇', 3, 68), +(1025, '大良镇', 3, 68), +(1026, '大黄堡乡', 3, 68), +(1027, '崔黄口镇', 3, 68), +(1028, '徐官屯街道', 3, 68), +(1029, '曹子里乡', 3, 68), +(1030, '杨村街道', 3, 68), +(1031, '梅厂镇', 3, 68), +(1032, '汊沽港镇', 3, 68); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1033, '河北屯镇', 3, 68), +(1034, '河西务镇', 3, 68), +(1035, '泗村店镇', 3, 68), +(1036, '王庆坨镇', 3, 68), +(1037, '白古屯乡', 3, 68), +(1038, '石各庄镇', 3, 68), +(1039, '豆张庄乡', 3, 68), +(1040, '运河西街道', 3, 68), +(1041, '陈咀镇', 3, 68), +(1042, '高村乡', 3, 68), +(1043, '黄庄街道', 3, 68), +(1044, '黄花店镇', 3, 68), +(1045, '八门城镇', 3, 69), +(1046, '口东镇', 3, 69), +(1047, '史各庄镇', 3, 69), +(1048, '周良庄镇', 3, 69), +(1049, '城关镇', 3, 69), +(1050, '大口屯镇', 3, 69), +(1051, '大唐庄镇', 3, 69), +(1052, '大白庄镇', 3, 69), +(1053, '大钟庄镇', 3, 69), +(1054, '尔王庄乡', 3, 69), +(1055, '新安镇', 3, 69), +(1056, '新开口镇', 3, 69), +(1057, '方家庄镇', 3, 69), +(1058, '林亭口镇', 3, 69), +(1059, '牛家牌乡', 3, 69), +(1060, '牛道口镇', 3, 69), +(1061, '王卜庄镇', 3, 69), +(1062, '郝各庄镇', 3, 69), +(1063, '霍各庄镇', 3, 69), +(1064, '马家店镇', 3, 69), +(1065, '高家庄镇', 3, 69), +(1066, '黄庄乡', 3, 69), +(1067, '七里海镇', 3, 70), +(1068, '东棘坨镇', 3, 70), +(1069, '丰台镇', 3, 70), +(1070, '俵口乡', 3, 70), +(1071, '北淮淀乡', 3, 70), +(1072, '大北涧沽镇', 3, 70), +(1073, '宁河镇', 3, 70), +(1074, '岳龙镇', 3, 70), +(1075, '廉庄子乡', 3, 70), +(1076, '板桥镇', 3, 70), +(1077, '潘庄镇', 3, 70), +(1078, '芦台镇', 3, 70), +(1079, '苗庄镇', 3, 70), +(1080, '造甲城镇', 3, 70), +(1081, '中旺镇', 3, 71), +(1082, '双塘镇', 3, 71), +(1083, '台头镇', 3, 71), +(1084, '唐官屯镇', 3, 71), +(1085, '团泊镇', 3, 71), +(1086, '大丰堆镇', 3, 71), +(1087, '大邱庄镇', 3, 71), +(1088, '子牙镇', 3, 71), +(1089, '杨成庄乡', 3, 71), +(1090, '梁头镇', 3, 71), +(1091, '沿庄镇', 3, 71), +(1092, '独流镇', 3, 71), +(1093, '王口镇', 3, 71), +(1094, '良王庄乡', 3, 71), +(1095, '蔡公庄镇', 3, 71), +(1096, '西翟庄镇', 3, 71), +(1097, '陈官屯镇', 3, 71), +(1098, '静海镇', 3, 71), +(1099, '上仓镇', 3, 72), +(1100, '下仓镇', 3, 72); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1101, '下窝头镇', 3, 72), +(1102, '下营镇', 3, 72), +(1103, '东二营乡', 3, 72), +(1104, '东施古镇', 3, 72), +(1105, '东赵各庄乡', 3, 72), +(1106, '五百户镇', 3, 72), +(1107, '侯家营镇', 3, 72), +(1108, '出头岭镇', 3, 72), +(1109, '别山镇', 3, 72), +(1110, '城关镇', 3, 72), +(1111, '孙各庄满族乡', 3, 72), +(1112, '官庄镇', 3, 72), +(1113, '尤古庄镇', 3, 72), +(1114, '文昌街道', 3, 72), +(1115, '杨津庄镇', 3, 72), +(1116, '桑梓镇', 3, 72), +(1117, '洇溜镇', 3, 72), +(1118, '白涧镇', 3, 72), +(1119, '礼明庄乡', 3, 72), +(1120, '穿芳峪乡', 3, 72), +(1121, '罗庄子镇', 3, 72), +(1122, '西龙虎峪镇', 3, 72), +(1123, '许家台乡', 3, 72), +(1124, '邦均镇', 3, 72), +(1125, '马伸桥镇', 3, 72), +(1126, '井陉县', 3, 73), +(1127, '井陉矿区', 3, 73), +(1128, '元氏县', 3, 73), +(1129, '平山县', 3, 73), +(1130, '新乐市', 3, 73), +(1131, '新华区', 3, 73), +(1132, '无极县', 3, 73), +(1133, '晋州市', 3, 73), +(1134, '栾城县', 3, 73), +(1135, '桥东区', 3, 73), +(1136, '桥西区', 3, 73), +(1137, '正定县', 3, 73), +(1138, '深泽县', 3, 73), +(1139, '灵寿县', 3, 73), +(1140, '藁城市', 3, 73), +(1141, '行唐县', 3, 73), +(1142, '裕华区', 3, 73), +(1143, '赞皇县', 3, 73), +(1144, '赵县', 3, 73), +(1145, '辛集市', 3, 73), +(1146, '长安区', 3, 73), +(1147, '高邑县', 3, 73), +(1148, '鹿泉市', 3, 73), +(1149, '丰南区', 3, 74), +(1150, '丰润区', 3, 74), +(1151, '乐亭县', 3, 74), +(1152, '古冶区', 3, 74), +(1153, '唐海县', 3, 74), +(1154, '开平区', 3, 74), +(1155, '滦南县', 3, 74), +(1156, '滦县', 3, 74), +(1157, '玉田县', 3, 74), +(1158, '路北区', 3, 74), +(1159, '路南区', 3, 74), +(1160, '迁安市', 3, 74), +(1161, '迁西县', 3, 74), +(1162, '遵化市', 3, 74), +(1163, '北戴河区', 3, 75), +(1164, '卢龙县', 3, 75), +(1165, '山海关区', 3, 75), +(1166, '抚宁县', 3, 75), +(1167, '昌黎县', 3, 75), +(1168, '海港区', 3, 75), +(1169, '青龙满族自治县', 3, 75), +(1170, '丛台区', 3, 76), +(1171, '临漳县', 3, 76); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1172, '复兴区', 3, 76), +(1173, '大名县', 3, 76), +(1174, '峰峰矿区', 3, 76), +(1175, '广平县', 3, 76), +(1176, '成安县', 3, 76), +(1177, '曲周县', 3, 76), +(1178, '武安市', 3, 76), +(1179, '永年县', 3, 76), +(1180, '涉县', 3, 76), +(1181, '磁县', 3, 76), +(1182, '肥乡县', 3, 76), +(1183, '邯山区', 3, 76), +(1184, '邯郸县', 3, 76), +(1185, '邱县', 3, 76), +(1186, '馆陶县', 3, 76), +(1187, '魏县', 3, 76), +(1188, '鸡泽县', 3, 76), +(1189, '临城县', 3, 77), +(1190, '临西县', 3, 77), +(1191, '任县', 3, 77), +(1192, '内丘县', 3, 77), +(1193, '南和县', 3, 77), +(1194, '南宫市', 3, 77), +(1195, '威县', 3, 77), +(1196, '宁晋县', 3, 77), +(1197, '巨鹿县', 3, 77), +(1198, '平乡县', 3, 77), +(1199, '广宗县', 3, 77), +(1200, '新河县', 3, 77), +(1201, '柏乡县', 3, 77), +(1202, '桥东区', 3, 77), +(1203, '桥西区', 3, 77), +(1204, '沙河市', 3, 77), +(1205, '清河县', 3, 77), +(1206, '邢台县', 3, 77), +(1207, '隆尧县', 3, 77), +(1208, '北市区', 3, 78), +(1209, '南市区', 3, 78), +(1210, '博野县', 3, 78), +(1211, '唐县', 3, 78), +(1212, '安国市', 3, 78), +(1213, '安新县', 3, 78), +(1214, '定兴县', 3, 78), +(1215, '定州市', 3, 78), +(1216, '容城县', 3, 78), +(1217, '徐水县', 3, 78), +(1218, '新市区', 3, 78), +(1219, '易县', 3, 78), +(1220, '曲阳县', 3, 78), +(1221, '望都县', 3, 78), +(1222, '涞水县', 3, 78), +(1223, '涞源县', 3, 78), +(1224, '涿州市', 3, 78), +(1225, '清苑县', 3, 78), +(1226, '满城县', 3, 78), +(1227, '蠡县', 3, 78), +(1228, '阜平县', 3, 78), +(1229, '雄县', 3, 78), +(1230, '顺平县', 3, 78), +(1231, '高碑店市', 3, 78), +(1232, '高阳县', 3, 78), +(1233, '万全县', 3, 79), +(1234, '下花园区', 3, 79), +(1235, '宣化区', 3, 79), +(1236, '宣化县', 3, 79), +(1237, '尚义县', 3, 79), +(1238, '崇礼县', 3, 79), +(1239, '康保县', 3, 79), +(1240, '张北县', 3, 79), +(1241, '怀安县', 3, 79), +(1242, '怀来县', 3, 79), +(1243, '桥东区', 3, 79), +(1244, '桥西区', 3, 79), +(1245, '沽源县', 3, 79); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1246, '涿鹿县', 3, 79), +(1247, '蔚县', 3, 79), +(1248, '赤城县', 3, 79), +(1249, '阳原县', 3, 79), +(1250, '丰宁满族自治县', 3, 80), +(1251, '兴隆县', 3, 80), +(1252, '双桥区', 3, 80), +(1253, '双滦区', 3, 80), +(1254, '围场满族蒙古族自治县', 3, 80), +(1255, '宽城满族自治县', 3, 80), +(1256, '平泉县', 3, 80), +(1257, '承德县', 3, 80), +(1258, '滦平县', 3, 80), +(1259, '隆化县', 3, 80), +(1260, '鹰手营子矿区', 3, 80), +(1261, '冀州市', 3, 81), +(1262, '安平县', 3, 81), +(1263, '故城县', 3, 81), +(1264, '景县', 3, 81), +(1265, '枣强县', 3, 81), +(1266, '桃城区', 3, 81), +(1267, '武强县', 3, 81), +(1268, '武邑县', 3, 81), +(1269, '深州市', 3, 81), +(1270, '阜城县', 3, 81), +(1271, '饶阳县', 3, 81), +(1272, '三河市', 3, 82), +(1273, '固安县', 3, 82), +(1274, '大厂回族自治县', 3, 82), +(1275, '大城县', 3, 82), +(1276, '安次区', 3, 82), +(1277, '广阳区', 3, 82), +(1278, '文安县', 3, 82), +(1279, '永清县', 3, 82), +(1280, '霸州市', 3, 82), +(1281, '香河县', 3, 82), +(1282, '东光县', 3, 83), +(1283, '任丘市', 3, 83), +(1284, '南皮县', 3, 83), +(1285, '吴桥县', 3, 83), +(1286, '孟村回族自治县', 3, 83), +(1287, '新华区', 3, 83), +(1288, '沧县', 3, 83), +(1289, '河间市', 3, 83), +(1290, '泊头市', 3, 83), +(1291, '海兴县', 3, 83), +(1292, '献县', 3, 83), +(1293, '盐山县', 3, 83), +(1294, '肃宁县', 3, 83), +(1295, '运河区', 3, 83), +(1296, '青县', 3, 83), +(1297, '黄骅市', 3, 83), +(1298, '万柏林区', 3, 84), +(1299, '古交市', 3, 84), +(1300, '娄烦县', 3, 84), +(1301, '小店区', 3, 84), +(1302, '尖草坪区', 3, 84), +(1303, '晋源区', 3, 84), +(1304, '杏花岭区', 3, 84), +(1305, '清徐县', 3, 84), +(1306, '迎泽区', 3, 84), +(1307, '阳曲县', 3, 84), +(1308, '南郊区', 3, 85), +(1309, '城区', 3, 85), +(1310, '大同县', 3, 85), +(1311, '天镇县', 3, 85), +(1312, '左云县', 3, 85), +(1313, '广灵县', 3, 85), +(1314, '新荣区', 3, 85), +(1315, '浑源县', 3, 85), +(1316, '灵丘县', 3, 85); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1317, '矿区', 3, 85), +(1318, '阳高县', 3, 85), +(1319, '城区', 3, 86), +(1320, '平定县', 3, 86), +(1321, '盂县', 3, 86), +(1322, '矿区', 3, 86), +(1323, '郊区', 3, 86), +(1324, '城区', 3, 87), +(1325, '壶关县', 3, 87), +(1326, '屯留县', 3, 87), +(1327, '平顺县', 3, 87), +(1328, '武乡县', 3, 87), +(1329, '沁县', 3, 87), +(1330, '沁源县', 3, 87), +(1331, '潞城市', 3, 87), +(1332, '襄垣县', 3, 87), +(1333, '郊区', 3, 87), +(1334, '长子县', 3, 87), +(1335, '长治县', 3, 87), +(1336, '黎城县', 3, 87), +(1337, '城区', 3, 88), +(1338, '沁水县', 3, 88), +(1339, '泽州县', 3, 88), +(1340, '阳城县', 3, 88), +(1341, '陵川县', 3, 88), +(1342, '高平市', 3, 88), +(1343, '右玉县', 3, 89), +(1344, '山阴县', 3, 89), +(1345, '平鲁区', 3, 89), +(1346, '应县', 3, 89), +(1347, '怀仁县', 3, 89), +(1348, '朔城区', 3, 89), +(1349, '介休市', 3, 90), +(1350, '和顺县', 3, 90), +(1351, '太谷县', 3, 90), +(1352, '寿阳县', 3, 90), +(1353, '左权县', 3, 90), +(1354, '平遥县', 3, 90), +(1355, '昔阳县', 3, 90), +(1356, '榆次区', 3, 90), +(1357, '榆社县', 3, 90), +(1358, '灵石县', 3, 90), +(1359, '祁县', 3, 90), +(1360, '万荣县', 3, 91), +(1361, '临猗县', 3, 91), +(1362, '垣曲县', 3, 91), +(1363, '夏县', 3, 91), +(1364, '平陆县', 3, 91), +(1365, '新绛县', 3, 91), +(1366, '永济市', 3, 91), +(1367, '河津市', 3, 91), +(1368, '盐湖区', 3, 91), +(1369, '稷山县', 3, 91), +(1370, '绛县', 3, 91), +(1371, '芮城县', 3, 91), +(1372, '闻喜县', 3, 91), +(1373, '五台县', 3, 92), +(1374, '五寨县', 3, 92), +(1375, '代县', 3, 92), +(1376, '保德县', 3, 92), +(1377, '偏关县', 3, 92), +(1378, '原平市', 3, 92), +(1379, '宁武县', 3, 92), +(1380, '定襄县', 3, 92), +(1381, '岢岚县', 3, 92), +(1382, '忻府区', 3, 92), +(1383, '河曲县', 3, 92), +(1384, '神池县', 3, 92), +(1385, '繁峙县', 3, 92), +(1386, '静乐县', 3, 92), +(1387, '乡宁县', 3, 93), +(1388, '侯马市', 3, 93), +(1389, '古县', 3, 93), +(1390, '吉县', 3, 93), +(1391, '大宁县', 3, 93); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1392, '安泽县', 3, 93), +(1393, '尧都区', 3, 93), +(1394, '曲沃县', 3, 93), +(1395, '永和县', 3, 93), +(1396, '汾西县', 3, 93), +(1397, '洪洞县', 3, 93), +(1398, '浮山县', 3, 93), +(1399, '翼城县', 3, 93), +(1400, '蒲县', 3, 93), +(1401, '襄汾县', 3, 93), +(1402, '隰县', 3, 93), +(1403, '霍州市', 3, 93), +(1404, '中阳县', 3, 94), +(1405, '临县', 3, 94), +(1406, '交口县', 3, 94), +(1407, '交城县', 3, 94), +(1408, '兴县', 3, 94), +(1409, '孝义市', 3, 94), +(1410, '岚县', 3, 94), +(1411, '文水县', 3, 94), +(1412, '方山县', 3, 94), +(1413, '柳林县', 3, 94), +(1414, '汾阳市', 3, 94), +(1415, '石楼县', 3, 94), +(1416, '离石区', 3, 94), +(1417, '和林格尔县', 3, 95), +(1418, '回民区', 3, 95), +(1419, '土默特左旗', 3, 95), +(1420, '托克托县', 3, 95), +(1421, '新城区', 3, 95), +(1422, '武川县', 3, 95), +(1423, '清水河县', 3, 95), +(1424, '玉泉区', 3, 95), +(1425, '赛罕区', 3, 95), +(1426, '东河区', 3, 96), +(1427, '九原区', 3, 96), +(1428, '固阳县', 3, 96), +(1429, '土默特右旗', 3, 96), +(1430, '昆都仑区', 3, 96), +(1431, '白云矿区', 3, 96), +(1432, '石拐区', 3, 96), +(1433, '达尔罕茂明安联合旗', 3, 96), +(1434, '青山区', 3, 96), +(1435, '乌达区', 3, 97), +(1436, '海勃湾区', 3, 97), +(1437, '海南区', 3, 97), +(1438, '元宝山区', 3, 98), +(1439, '克什克腾旗', 3, 98), +(1440, '喀喇沁旗', 3, 98), +(1441, '宁城县', 3, 98), +(1442, '巴林右旗', 3, 98), +(1443, '巴林左旗', 3, 98), +(1444, '敖汉旗', 3, 98), +(1445, '松山区', 3, 98), +(1446, '林西县', 3, 98), +(1447, '红山区', 3, 98), +(1448, '翁牛特旗', 3, 98), +(1449, '阿鲁科尔沁旗', 3, 98), +(1450, '奈曼旗', 3, 99), +(1451, '库伦旗', 3, 99), +(1452, '开鲁县', 3, 99), +(1453, '扎鲁特旗', 3, 99), +(1454, '科尔沁区', 3, 99), +(1455, '科尔沁左翼中旗', 3, 99), +(1456, '科尔沁左翼后旗', 3, 99), +(1457, '霍林郭勒市', 3, 99), +(1458, '东胜区', 3, 100), +(1459, '乌审旗', 3, 100), +(1460, '伊金霍洛旗', 3, 100); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1461, '准格尔旗', 3, 100), +(1462, '杭锦旗', 3, 100), +(1463, '达拉特旗', 3, 100), +(1464, '鄂东胜区', 3, 100), +(1465, '鄂托克前旗', 3, 100), +(1466, '鄂托克旗', 3, 100), +(1467, '扎兰屯市', 3, 101), +(1468, '新巴尔虎右旗', 3, 101), +(1469, '新巴尔虎左旗', 3, 101), +(1470, '根河市', 3, 101), +(1471, '海拉尔区', 3, 101), +(1472, '满洲里市', 3, 101), +(1473, '牙克石市', 3, 101), +(1474, '莫力达瓦达斡尔族自治旗', 3, 101), +(1475, '鄂伦春自治旗', 3, 101), +(1476, '鄂温克族自治旗', 3, 101), +(1477, '阿荣旗', 3, 101), +(1478, '陈巴尔虎旗', 3, 101), +(1479, '额尔古纳市', 3, 101), +(1480, '临河区', 3, 102), +(1481, '乌拉特中旗', 3, 102), +(1482, '乌拉特前旗', 3, 102), +(1483, '乌拉特后旗', 3, 102), +(1484, '五原县', 3, 102), +(1485, '杭锦后旗', 3, 102), +(1486, '磴口县', 3, 102), +(1487, '丰镇市', 3, 103), +(1488, '兴和县', 3, 103), +(1489, '凉城县', 3, 103), +(1490, '化德县', 3, 103), +(1491, '卓资县', 3, 103), +(1492, '商都县', 3, 103), +(1493, '四子王旗', 3, 103), +(1494, '察哈尔右翼中旗', 3, 103), +(1495, '察哈尔右翼前旗', 3, 103), +(1496, '察哈尔右翼后旗', 3, 103), +(1497, '集宁区', 3, 103), +(1498, '乌兰浩特市', 3, 104), +(1499, '扎赉特旗', 3, 104), +(1500, '科尔沁右翼中旗', 3, 104), +(1501, '科尔沁右翼前旗', 3, 104), +(1502, '突泉县', 3, 104), +(1503, '阿尔山市', 3, 104), +(1504, '东乌珠穆沁旗', 3, 105), +(1505, '二连浩特市', 3, 105), +(1506, '多伦县', 3, 105), +(1507, '太仆寺旗', 3, 105), +(1508, '正蓝旗', 3, 105), +(1509, '正镶白旗', 3, 105), +(1510, '苏尼特右旗', 3, 105), +(1511, '苏尼特左旗', 3, 105), +(1512, '西乌珠穆沁旗', 3, 105), +(1513, '锡林浩特市', 3, 105), +(1514, '镶黄旗', 3, 105), +(1515, '阿巴嘎旗', 3, 105), +(1516, '阿拉善右旗', 3, 106), +(1517, '阿拉善左旗', 3, 106), +(1518, '额济纳旗', 3, 106), +(1519, '东陵区', 3, 107), +(1520, '于洪区', 3, 107), +(1521, '和平区', 3, 107); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1522, '大东区', 3, 107), +(1523, '康平县', 3, 107), +(1524, '新民市', 3, 107), +(1525, '沈北新区', 3, 107), +(1526, '沈河区', 3, 107), +(1527, '法库县', 3, 107), +(1528, '皇姑区', 3, 107), +(1529, '苏家屯区', 3, 107), +(1530, '辽中县', 3, 107), +(1531, '铁西区', 3, 107), +(1532, '中山区', 3, 108), +(1533, '庄河市', 3, 108), +(1534, '旅顺口区', 3, 108), +(1535, '普兰店市', 3, 108), +(1536, '沙河口区', 3, 108), +(1537, '瓦房店市', 3, 108), +(1538, '甘井子区', 3, 108), +(1539, '西岗区', 3, 108), +(1540, '金州区', 3, 108), +(1541, '长海县', 3, 108), +(1542, '千山区', 3, 109), +(1543, '台安县', 3, 109), +(1544, '岫岩满族自治县', 3, 109), +(1545, '海城市', 3, 109), +(1546, '立山区', 3, 109), +(1547, '铁东区', 3, 109), +(1548, '铁西区', 3, 109), +(1549, '东洲区', 3, 110), +(1550, '抚顺县', 3, 110), +(1551, '新宾满族自治县', 3, 110), +(1552, '新抚区', 3, 110), +(1553, '望花区', 3, 110), +(1554, '清原满族自治县', 3, 110), +(1555, '顺城区', 3, 110), +(1556, '南芬区', 3, 111), +(1557, '平山区', 3, 111), +(1558, '明山区', 3, 111), +(1559, '本溪满族自治县', 3, 111), +(1560, '桓仁满族自治县', 3, 111), +(1561, '溪湖区', 3, 111), +(1562, '东港市', 3, 112), +(1563, '元宝区', 3, 112), +(1564, '凤城市', 3, 112), +(1565, '宽甸满族自治县', 3, 112), +(1566, '振兴区', 3, 112), +(1567, '振安区', 3, 112), +(1568, '义县', 3, 113), +(1569, '凌河区', 3, 113), +(1570, '凌海市', 3, 113), +(1571, '北镇市', 3, 113), +(1572, '古塔区', 3, 113), +(1573, '太和区', 3, 113), +(1574, '黑山县', 3, 113), +(1575, '大石桥市', 3, 114), +(1576, '盖州市', 3, 114), +(1577, '站前区', 3, 114), +(1578, '老边区', 3, 114), +(1579, '西市区', 3, 114), +(1580, '鲅鱼圈区', 3, 114), +(1581, '太平区', 3, 115), +(1582, '彰武县', 3, 115), +(1583, '新邱区', 3, 115), +(1584, '海州区', 3, 115), +(1585, '清河门区', 3, 115), +(1586, '细河区', 3, 115), +(1587, '蒙古族自治县', 3, 115), +(1588, '太子河区', 3, 116); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1589, '宏伟区', 3, 116), +(1590, '弓长岭区', 3, 116), +(1591, '文圣区', 3, 116), +(1592, '灯塔市', 3, 116), +(1593, '白塔区', 3, 116), +(1594, '辽阳县', 3, 116), +(1595, '兴隆台区', 3, 117), +(1596, '双台子区', 3, 117), +(1597, '大洼县', 3, 117), +(1598, '盘山县', 3, 117), +(1599, '开原市', 3, 118), +(1600, '昌图县', 3, 118), +(1601, '清河区', 3, 118), +(1602, '西丰县', 3, 118), +(1603, '调兵山市', 3, 118), +(1604, '铁岭县', 3, 118), +(1605, '银州区', 3, 118), +(1606, '凌源市', 3, 119), +(1607, '北票市', 3, 119), +(1608, '双塔区', 3, 119), +(1609, '喀喇沁左翼蒙古族自治县', 3, 119), +(1610, '建平县', 3, 119), +(1611, '朝阳县', 3, 119), +(1612, '龙城区', 3, 119), +(1613, '兴城市', 3, 120), +(1614, '南票区', 3, 120), +(1615, '建昌县', 3, 120), +(1616, '绥中县', 3, 120), +(1617, '连山区', 3, 120), +(1618, '龙港区', 3, 120), +(1619, '九台市', 3, 121), +(1620, '二道区', 3, 121), +(1621, '农安县', 3, 121), +(1622, '南关区', 3, 121), +(1623, '双阳区', 3, 121), +(1624, '宽城区', 3, 121), +(1625, '德惠市', 3, 121), +(1626, '朝阳区', 3, 121), +(1627, '榆树市', 3, 121), +(1628, '绿园区', 3, 121), +(1629, '丰满区', 3, 122), +(1630, '昌邑区', 3, 122), +(1631, '桦甸市', 3, 122), +(1632, '永吉县', 3, 122), +(1633, '磐石市', 3, 122), +(1634, '舒兰市', 3, 122), +(1635, '船营区', 3, 122), +(1636, '蛟河市', 3, 122), +(1637, '龙潭区', 3, 122), +(1638, '伊通满族自治县', 3, 123), +(1639, '公主岭市', 3, 123), +(1640, '双辽市', 3, 123), +(1641, '梨树县', 3, 123), +(1642, '铁东区', 3, 123), +(1643, '铁西区', 3, 123), +(1644, '东丰县', 3, 124), +(1645, '东辽县', 3, 124), +(1646, '西安区', 3, 124), +(1647, '龙山区', 3, 124), +(1648, '东昌区', 3, 125), +(1649, '二道江区', 3, 125), +(1650, '柳河县', 3, 125), +(1651, '梅河口市', 3, 125), +(1652, '辉南县', 3, 125), +(1653, '通化县', 3, 125), +(1654, '集安市', 3, 125), +(1655, '临江市', 3, 126), +(1656, '八道江区', 3, 126), +(1657, '抚松县', 3, 126); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1658, '江源区', 3, 126), +(1659, '长白朝鲜族自治县', 3, 126), +(1660, '靖宇县', 3, 126), +(1661, '干安县', 3, 127), +(1662, '前郭尔罗斯蒙古族自治县', 3, 127), +(1663, '宁江区', 3, 127), +(1664, '扶余县', 3, 127), +(1665, '长岭县', 3, 127), +(1666, '大安市', 3, 128), +(1667, '洮北区', 3, 128), +(1668, '洮南市', 3, 128), +(1669, '通榆县', 3, 128), +(1670, '镇赉县', 3, 128), +(1671, '和龙市', 3, 129), +(1672, '图们市', 3, 129), +(1673, '安图县', 3, 129), +(1674, '延吉市', 3, 129), +(1675, '敦化市', 3, 129), +(1676, '汪清县', 3, 129), +(1677, '珲春市', 3, 129), +(1678, '龙井市', 3, 129), +(1679, '五常市', 3, 130), +(1680, '依兰县', 3, 130), +(1681, '南岗区', 3, 130), +(1682, '双城市', 3, 130), +(1683, '呼兰区', 3, 130), +(1684, '哈尔滨市道里区', 3, 130), +(1685, '宾县', 3, 130), +(1686, '尚志市', 3, 130), +(1687, '巴彦县', 3, 130), +(1688, '平房区', 3, 130), +(1689, '延寿县', 3, 130), +(1690, '方正县', 3, 130), +(1691, '木兰县', 3, 130), +(1692, '松北区', 3, 130), +(1693, '通河县', 3, 130), +(1694, '道外区', 3, 130), +(1695, '阿城区', 3, 130), +(1696, '香坊区', 3, 130), +(1697, '依安县', 3, 131), +(1698, '克东县', 3, 131), +(1699, '克山县', 3, 131), +(1700, '富拉尔基区', 3, 131), +(1701, '富裕县', 3, 131), +(1702, '建华区', 3, 131), +(1703, '拜泉县', 3, 131), +(1704, '昂昂溪区', 3, 131), +(1705, '梅里斯达斡尔族区', 3, 131), +(1706, '泰来县', 3, 131), +(1707, '甘南县', 3, 131), +(1708, '碾子山区', 3, 131), +(1709, '讷河市', 3, 131), +(1710, '铁锋区', 3, 131), +(1711, '龙江县', 3, 131), +(1712, '龙沙区', 3, 131), +(1713, '城子河区', 3, 132), +(1714, '密山市', 3, 132), +(1715, '恒山区', 3, 132), +(1716, '梨树区', 3, 132), +(1717, '滴道区', 3, 132), +(1718, '虎林市', 3, 132), +(1719, '鸡东县', 3, 132), +(1720, '鸡冠区', 3, 132), +(1721, '麻山区', 3, 132), +(1722, '东山区', 3, 133), +(1723, '兴安区', 3, 133), +(1724, '兴山区', 3, 133), +(1725, '南山区', 3, 133); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1726, '向阳区', 3, 133), +(1727, '工农区', 3, 133), +(1728, '绥滨县', 3, 133), +(1729, '萝北县', 3, 133), +(1730, '友谊县', 3, 134), +(1731, '四方台区', 3, 134), +(1732, '宝山区', 3, 134), +(1733, '宝清县', 3, 134), +(1734, '尖山区', 3, 134), +(1735, '岭东区', 3, 134), +(1736, '集贤县', 3, 134), +(1737, '饶河县', 3, 134), +(1738, '大同区', 3, 135), +(1739, '杜尔伯特蒙古族自治县', 3, 135), +(1740, '林甸县', 3, 135), +(1741, '红岗区', 3, 135), +(1742, '肇州县', 3, 135), +(1743, '肇源县', 3, 135), +(1744, '胡路区', 3, 135), +(1745, '萨尔图区', 3, 135), +(1746, '龙凤区', 3, 135), +(1747, '上甘岭区', 3, 136), +(1748, '乌伊岭区', 3, 136), +(1749, '乌马河区', 3, 136), +(1750, '五营区', 3, 136), +(1751, '伊春区', 3, 136), +(1752, '南岔区', 3, 136), +(1753, '友好区', 3, 136), +(1754, '嘉荫县', 3, 136), +(1755, '带岭区', 3, 136), +(1756, '新青区', 3, 136), +(1757, '汤旺河区', 3, 136), +(1758, '红星区', 3, 136), +(1759, '美溪区', 3, 136), +(1760, '翠峦区', 3, 136), +(1761, '西林区', 3, 136), +(1762, '金山屯区', 3, 136), +(1763, '铁力市', 3, 136), +(1764, '东风区', 3, 137), +(1765, '前进区', 3, 137), +(1766, '同江市', 3, 137), +(1767, '向阳区', 3, 137), +(1768, '富锦市', 3, 137), +(1769, '抚远县', 3, 137), +(1770, '桦南县', 3, 137), +(1771, '桦川县', 3, 137), +(1772, '汤原县', 3, 137), +(1773, '郊区', 3, 137), +(1774, '勃利县', 3, 138), +(1775, '新兴区', 3, 138), +(1776, '桃山区', 3, 138), +(1777, '茄子河区', 3, 138), +(1778, '东宁县', 3, 139), +(1779, '东安区', 3, 139), +(1780, '宁安市', 3, 139), +(1781, '林口县', 3, 139), +(1782, '海林市', 3, 139), +(1783, '爱民区', 3, 139), +(1784, '穆棱市', 3, 139), +(1785, '绥芬河市', 3, 139), +(1786, '西安区', 3, 139), +(1787, '阳明区', 3, 139), +(1788, '五大连池市', 3, 140), +(1789, '北安市', 3, 140), +(1790, '嫩江县', 3, 140), +(1791, '孙吴县', 3, 140), +(1792, '爱辉区', 3, 140), +(1793, '车逊克县', 3, 140), +(1794, '逊克县', 3, 140); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1795, '兰西县', 3, 141), +(1796, '安达市', 3, 141), +(1797, '庆安县', 3, 141), +(1798, '明水县', 3, 141), +(1799, '望奎县', 3, 141), +(1800, '海伦市', 3, 141), +(1801, '绥化市北林区', 3, 141), +(1802, '绥棱县', 3, 141), +(1803, '肇东市', 3, 141), +(1804, '青冈县', 3, 141), +(1805, '呼玛县', 3, 142), +(1806, '塔河县', 3, 142), +(1807, '大兴安岭地区加格达奇区', 3, 142), +(1808, '大兴安岭地区呼中区', 3, 142), +(1809, '大兴安岭地区新林区', 3, 142), +(1810, '大兴安岭地区松岭区', 3, 142), +(1811, '漠河县', 3, 142), +(1812, '半淞园路街道', 3, 143), +(1813, '南京东路街道', 3, 143), +(1814, '外滩街道', 3, 143), +(1815, '小东门街道', 3, 143), +(1816, '老西门街道', 3, 143), +(1817, '豫园街道', 3, 143), +(1818, '五里桥街道', 3, 144), +(1819, '打浦桥街道', 3, 144), +(1820, '淮海中路街道', 3, 144), +(1821, '瑞金二路街道', 3, 144), +(1822, '凌云路街道', 3, 145), +(1823, '华泾镇', 3, 145), +(1824, '天平路街道', 3, 145), +(1825, '康健新村街道', 3, 145), +(1826, '徐家汇街道', 3, 145), +(1827, '斜土路街道', 3, 145), +(1828, '枫林路街道', 3, 145), +(1829, '湖南路街道', 3, 145), +(1830, '漕河泾街道', 3, 145), +(1831, '田林街道', 3, 145), +(1832, '虹梅路街道', 3, 145), +(1833, '长桥街道', 3, 145), +(1834, '龙华街道', 3, 145), +(1835, '仙霞新村街道', 3, 146), +(1836, '北新泾街道', 3, 146), +(1837, '华阳路街道', 3, 146), +(1838, '周家桥街道', 3, 146), +(1839, '天山路街道', 3, 146), +(1840, '新华路街道', 3, 146), +(1841, '新泾镇', 3, 146), +(1842, '江苏路街道', 3, 146), +(1843, '程家桥街道', 3, 146), +(1844, '虹桥街道', 3, 146), +(1845, '南京西路街道', 3, 147), +(1846, '曹家渡街道', 3, 147), +(1847, '江宁路街道', 3, 147), +(1848, '石门二路街道', 3, 147), +(1849, '静安寺街道', 3, 147), +(1850, '宜川路街道', 3, 148), +(1851, '曹杨新村街道', 3, 148), +(1852, '桃浦镇', 3, 148), +(1853, '甘泉路街道', 3, 148); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1854, '真如镇', 3, 148), +(1855, '石泉路街道', 3, 148), +(1856, '长寿路街道', 3, 148), +(1857, '长征镇', 3, 148), +(1858, '长风新村街道', 3, 148), +(1859, '临汾路街道', 3, 149), +(1860, '共和新路街道', 3, 149), +(1861, '北站街道', 3, 149), +(1862, '大宁路街道', 3, 149), +(1863, '天目西路街道', 3, 149), +(1864, '宝山路街道', 3, 149), +(1865, '彭浦新村街道', 3, 149), +(1866, '彭浦镇', 3, 149), +(1867, '芷江西路街道', 3, 149), +(1868, '乍浦路街道', 3, 150), +(1869, '凉城新村街道', 3, 150), +(1870, '嘉兴路街道', 3, 150), +(1871, '四川北路街道', 3, 150), +(1872, '广中路街道', 3, 150), +(1873, '提篮桥街道', 3, 150), +(1874, '新港路街道', 3, 150), +(1875, '曲阳路街道', 3, 150), +(1876, '欧阳路街道', 3, 150), +(1877, '江湾镇街道', 3, 150), +(1878, '五角场街道', 3, 151), +(1879, '五角场镇', 3, 151), +(1880, '四平路街道', 3, 151), +(1881, '大桥街道', 3, 151), +(1882, '定海路街道', 3, 151), +(1883, '平凉路街道', 3, 151), +(1884, '延吉新村街道', 3, 151), +(1885, '控江路街道', 3, 151), +(1886, '新江湾城街道', 3, 151), +(1887, '殷行街道', 3, 151), +(1888, '江浦路街道', 3, 151), +(1889, '长白新村街道', 3, 151), +(1890, '七宝镇', 3, 152), +(1891, '华漕镇', 3, 152), +(1892, '古美街道', 3, 152), +(1893, '吴泾镇', 3, 152), +(1894, '梅陇镇', 3, 152), +(1895, '江川路街道', 3, 152), +(1896, '浦江镇', 3, 152), +(1897, '莘庄镇', 3, 152), +(1898, '虹桥镇', 3, 152), +(1899, '颛桥镇', 3, 152), +(1900, '马桥镇', 3, 152), +(1901, '龙柏街道', 3, 152), +(1902, '友谊路街道', 3, 153), +(1903, '吴淞街道', 3, 153), +(1904, '大场镇', 3, 153), +(1905, '庙行镇', 3, 153), +(1906, '张庙街道', 3, 153), +(1907, '月浦镇', 3, 153), +(1908, '杨行镇', 3, 153), +(1909, '淞南镇', 3, 153), +(1910, '罗店镇', 3, 153), +(1911, '罗泾镇', 3, 153), +(1912, '顾村镇', 3, 153), +(1913, '高境镇', 3, 153), +(1914, '华亭镇', 3, 154), +(1915, '南翔镇', 3, 154); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1916, '嘉定工业区', 3, 154), +(1917, '嘉定镇街道', 3, 154), +(1918, '外冈镇', 3, 154), +(1919, '安亭镇', 3, 154), +(1920, '徐行镇', 3, 154), +(1921, '新成路街道', 3, 154), +(1922, '江桥镇', 3, 154), +(1923, '真新新村街道', 3, 154), +(1924, '菊园新区', 3, 154), +(1925, '马陆镇', 3, 154), +(1926, '黄渡镇', 3, 154), +(1927, '三林镇', 3, 155), +(1928, '上钢新村街道', 3, 155), +(1929, '东明路街道', 3, 155), +(1930, '北蔡镇', 3, 155), +(1931, '南码头路街道', 3, 155), +(1932, '合庆镇', 3, 155), +(1933, '周家渡街道', 3, 155), +(1934, '唐镇', 3, 155), +(1935, '塘桥街道', 3, 155), +(1936, '川沙新镇', 3, 155), +(1937, '张江镇', 3, 155), +(1938, '曹路镇', 3, 155), +(1939, '沪东新村街道', 3, 155), +(1940, '洋泾街道', 3, 155), +(1941, '浦兴路街道', 3, 155), +(1942, '潍坊新村街道', 3, 155), +(1943, '花木街道', 3, 155), +(1944, '金杨新村街道', 3, 155), +(1945, '金桥镇', 3, 155), +(1946, '陆家嘴街道', 3, 155), +(1947, '高东镇', 3, 155), +(1948, '高桥镇', 3, 155), +(1949, '高行镇', 3, 155), +(1950, '亭林镇', 3, 156), +(1951, '吕巷镇', 3, 156), +(1952, '山阳镇', 3, 156), +(1953, '廊下镇', 3, 156), +(1954, '张堰镇', 3, 156), +(1955, '朱泾镇', 3, 156), +(1956, '枫泾镇', 3, 156), +(1957, '漕泾镇', 3, 156), +(1958, '石化街道', 3, 156), +(1959, '金山卫镇', 3, 156), +(1960, '上海松江科技园区', 3, 157), +(1961, '中山街道', 3, 157), +(1962, '九亭镇', 3, 157), +(1963, '五厍农业园区', 3, 157), +(1964, '佘山度假区', 3, 157), +(1965, '佘山镇', 3, 157), +(1966, '叶榭镇', 3, 157), +(1967, '岳阳街道', 3, 157), +(1968, '新桥镇', 3, 157), +(1969, '新浜镇', 3, 157), +(1970, '方松街道', 3, 157), +(1971, '松江工业区', 3, 157), +(1972, '永丰街道', 3, 157), +(1973, '泖港镇', 3, 157), +(1974, '泗泾镇', 3, 157), +(1975, '洞泾镇', 3, 157), +(1976, '石湖荡镇', 3, 157), +(1977, '车墩镇', 3, 157), +(1978, '华新镇', 3, 158), +(1979, '夏阳街道', 3, 158), +(1980, '徐泾镇', 3, 158); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(1981, '朱家角镇', 3, 158), +(1982, '白鹤镇', 3, 158), +(1983, '盈浦街道', 3, 158), +(1984, '练塘镇', 3, 158), +(1985, '赵巷镇', 3, 158), +(1986, '重固镇', 3, 158), +(1987, '金泽镇', 3, 158), +(1988, '香花桥街道', 3, 158), +(1989, '万祥镇', 3, 159), +(1990, '书院镇', 3, 159), +(1991, '六灶镇', 3, 159), +(1992, '周浦镇', 3, 159), +(1993, '大团镇', 3, 159), +(1994, '宣桥镇', 3, 159), +(1995, '康桥镇', 3, 159), +(1996, '惠南镇', 3, 159), +(1997, '新场镇', 3, 159), +(1998, '泥城镇', 3, 159), +(1999, '祝桥镇', 3, 159), +(2000, '老港镇', 3, 159), +(2001, '航头镇', 3, 159), +(2002, '芦潮港镇', 3, 159), +(2003, '南桥镇', 3, 160), +(2004, '四团镇', 3, 160), +(2005, '奉城镇', 3, 160), +(2006, '庄行镇', 3, 160), +(2007, '柘林镇', 3, 160), +(2008, '海湾镇', 3, 160), +(2009, '金汇镇', 3, 160), +(2010, '青村镇', 3, 160), +(2011, '三星镇', 3, 161), +(2012, '中兴镇', 3, 161), +(2013, '向化镇', 3, 161), +(2014, '城桥镇', 3, 161), +(2015, '堡镇', 3, 161), +(2016, '庙镇', 3, 161), +(2017, '建设镇', 3, 161), +(2018, '新村乡', 3, 161), +(2019, '新河镇', 3, 161), +(2020, '横沙乡', 3, 161), +(2021, '港沿镇', 3, 161), +(2022, '港西镇', 3, 161), +(2023, '竖新镇', 3, 161), +(2024, '绿华镇', 3, 161), +(2025, '长兴乡', 3, 161), +(2026, '陈家镇', 3, 161), +(2027, '下关区', 3, 162), +(2028, '六合区', 3, 162), +(2029, '建邺区', 3, 162), +(2030, '栖霞区', 3, 162), +(2031, '江宁区', 3, 162), +(2032, '浦口区', 3, 162), +(2033, '溧水县', 3, 162), +(2034, '玄武区', 3, 162), +(2035, '白下区', 3, 162), +(2036, '秦淮区', 3, 162), +(2037, '雨花台区', 3, 162), +(2038, '高淳县', 3, 162), +(2039, '鼓楼区', 3, 162), +(2040, '北塘区', 3, 163), +(2041, '南长区', 3, 163), +(2042, '宜兴市', 3, 163), +(2043, '崇安区', 3, 163), +(2044, '惠山区', 3, 163), +(2045, '江阴市', 3, 163), +(2046, '滨湖区', 3, 163), +(2047, '锡山区', 3, 163), +(2048, '丰县', 3, 164), +(2049, '九里区', 3, 164), +(2050, '云龙区', 3, 164), +(2051, '新沂市', 3, 164); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2052, '沛县', 3, 164), +(2053, '泉山区', 3, 164), +(2054, '睢宁县', 3, 164), +(2055, '贾汪区', 3, 164), +(2056, '邳州市', 3, 164), +(2057, '铜山县', 3, 164), +(2058, '鼓楼区', 3, 164), +(2059, '天宁区', 3, 165), +(2060, '戚墅堰区', 3, 165), +(2061, '新北区', 3, 165), +(2062, '武进区', 3, 165), +(2063, '溧阳市', 3, 165), +(2064, '金坛市', 3, 165), +(2065, '钟楼区', 3, 165), +(2066, '吴中区', 3, 166), +(2067, '吴江市', 3, 166), +(2068, '太仓市', 3, 166), +(2069, '常熟市', 3, 166), +(2070, '平江区', 3, 166), +(2071, '张家港市', 3, 166), +(2072, '昆山市', 3, 166), +(2073, '沧浪区', 3, 166), +(2074, '相城区', 3, 166), +(2075, '苏州工业园区', 3, 166), +(2076, '虎丘区', 3, 166), +(2077, '金阊区', 3, 166), +(2078, '启东市', 3, 167), +(2079, '如东县', 3, 167), +(2080, '如皋市', 3, 167), +(2081, '崇川区', 3, 167), +(2082, '海安县', 3, 167), +(2083, '海门市', 3, 167), +(2084, '港闸区', 3, 167), +(2085, '通州市', 3, 167), +(2086, '东海县', 3, 168), +(2087, '新浦区', 3, 168), +(2088, '海州区', 3, 168), +(2089, '灌云县', 3, 168), +(2090, '灌南县', 3, 168), +(2091, '赣榆县', 3, 168), +(2092, '连云区', 3, 168), +(2093, '楚州区', 3, 169), +(2094, '洪泽县', 3, 169), +(2095, '涟水县', 3, 169), +(2096, '淮阴区', 3, 169), +(2097, '清河区', 3, 169), +(2098, '清浦区', 3, 169), +(2099, '盱眙县', 3, 169), +(2100, '金湖县', 3, 169), +(2101, '东台市', 3, 170), +(2102, '亭湖区', 3, 170), +(2103, '响水县', 3, 170), +(2104, '大丰市', 3, 170), +(2105, '射阳县', 3, 170), +(2106, '建湖县', 3, 170), +(2107, '滨海县', 3, 170), +(2108, '盐都区', 3, 170), +(2109, '阜宁县', 3, 170), +(2110, '仪征市', 3, 171), +(2111, '宝应县', 3, 171), +(2112, '广陵区', 3, 171), +(2113, '江都市', 3, 171), +(2114, '维扬区', 3, 171), +(2115, '邗江区', 3, 171), +(2116, '高邮市', 3, 171), +(2117, '丹徒区', 3, 172), +(2118, '丹阳市', 3, 172), +(2119, '京口区', 3, 172), +(2120, '句容市', 3, 172), +(2121, '扬中市', 3, 172); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2122, '润州区', 3, 172), +(2123, '兴化市', 3, 173), +(2124, '姜堰市', 3, 173), +(2125, '泰兴市', 3, 173), +(2126, '海陵区', 3, 173), +(2127, '靖江市', 3, 173), +(2128, '高港区', 3, 173), +(2129, '宿城区', 3, 174), +(2130, '宿豫区', 3, 174), +(2131, '沭阳县', 3, 174), +(2132, '泗洪县', 3, 174), +(2133, '泗阳县', 3, 174), +(2134, '上城区', 3, 175), +(2135, '下城区', 3, 175), +(2136, '临安市', 3, 175), +(2137, '余杭区', 3, 175), +(2138, '富阳市', 3, 175), +(2139, '建德市', 3, 175), +(2140, '拱墅区', 3, 175), +(2141, '桐庐县', 3, 175), +(2142, '江干区', 3, 175), +(2143, '淳安县', 3, 175), +(2144, '滨江区', 3, 175), +(2145, '萧山区', 3, 175), +(2146, '西湖区', 3, 175), +(2147, '余姚市', 3, 176), +(2148, '北仑区', 3, 176), +(2149, '奉化市', 3, 176), +(2150, '宁海县', 3, 176), +(2151, '慈溪市', 3, 176), +(2152, '江东区', 3, 176), +(2153, '江北区', 3, 176), +(2154, '海曙区', 3, 176), +(2155, '象山县', 3, 176), +(2156, '鄞州区', 3, 176), +(2157, '镇海区', 3, 176), +(2158, '乐清市', 3, 177), +(2159, '平阳县', 3, 177), +(2160, '文成县', 3, 177), +(2161, '永嘉县', 3, 177), +(2162, '泰顺县', 3, 177), +(2163, '洞头县', 3, 177), +(2164, '瑞安市', 3, 177), +(2165, '瓯海区', 3, 177), +(2166, '苍南县', 3, 177), +(2167, '鹿城区', 3, 177), +(2168, '龙湾区', 3, 177), +(2169, '南湖区', 3, 178), +(2170, '嘉善县', 3, 178), +(2171, '平湖市', 3, 178), +(2172, '桐乡市', 3, 178), +(2173, '海宁市', 3, 178), +(2174, '海盐县', 3, 178), +(2175, '秀洲区', 3, 178), +(2176, '南浔区', 3, 179), +(2177, '吴兴区', 3, 179), +(2178, '安吉县', 3, 179), +(2179, '德清县', 3, 179), +(2180, '长兴县', 3, 179), +(2181, '上虞市', 3, 180), +(2182, '嵊州市', 3, 180), +(2183, '新昌县', 3, 180), +(2184, '绍兴县', 3, 180), +(2185, '诸暨市', 3, 180), +(2186, '越城区', 3, 180), +(2187, '定海区', 3, 181), +(2188, '岱山县', 3, 181), +(2189, '嵊泗县', 3, 181), +(2190, '普陀区', 3, 181), +(2191, '常山县', 3, 182), +(2192, '开化县', 3, 182); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2193, '柯城区', 3, 182), +(2194, '江山市', 3, 182), +(2195, '衢江区', 3, 182), +(2196, '龙游县', 3, 182), +(2197, '东阳市', 3, 183), +(2198, '义乌市', 3, 183), +(2199, '兰溪市', 3, 183), +(2200, '婺城区', 3, 183), +(2201, '武义县', 3, 183), +(2202, '永康市', 3, 183), +(2203, '浦江县', 3, 183), +(2204, '磐安县', 3, 183), +(2205, '金东区', 3, 183), +(2206, '三门县', 3, 184), +(2207, '临海市', 3, 184), +(2208, '仙居县', 3, 184), +(2209, '天台县', 3, 184), +(2210, '椒江区', 3, 184), +(2211, '温岭市', 3, 184), +(2212, '玉环县', 3, 184), +(2213, '路桥区', 3, 184), +(2214, '黄岩区', 3, 184), +(2215, '云和县', 3, 185), +(2216, '庆元县', 3, 185), +(2217, '景宁畲族自治县', 3, 185), +(2218, '松阳县', 3, 185), +(2219, '缙云县', 3, 185), +(2220, '莲都区', 3, 185), +(2221, '遂昌县', 3, 185), +(2222, '青田县', 3, 185), +(2223, '龙泉市', 3, 185), +(2224, '包河区', 3, 186), +(2225, '庐阳区', 3, 186), +(2226, '瑶海区', 3, 186), +(2227, '肥东县', 3, 186), +(2228, '肥西县', 3, 186), +(2229, '蜀山区', 3, 186), +(2230, '长丰县', 3, 186), +(2231, '三山区', 3, 187), +(2232, '南陵县', 3, 187), +(2233, '弋江区', 3, 187), +(2234, '繁昌县', 3, 187), +(2235, '芜湖县', 3, 187), +(2236, '镜湖区', 3, 187), +(2237, '鸠江区', 3, 187), +(2238, '五河县', 3, 188), +(2239, '固镇县', 3, 188), +(2240, '怀远县', 3, 188), +(2241, '淮上区', 3, 188), +(2242, '禹会区', 3, 188), +(2243, '蚌山区', 3, 188), +(2244, '龙子湖区', 3, 188), +(2245, '八公山区', 3, 189), +(2246, '凤台县', 3, 189), +(2247, '大通区', 3, 189), +(2248, '潘集区', 3, 189), +(2249, '田家庵区', 3, 189), +(2250, '谢家集区', 3, 189), +(2251, '当涂县', 3, 190), +(2252, '花山区', 3, 190), +(2253, '金家庄区', 3, 190), +(2254, '雨山区', 3, 190), +(2255, '杜集区', 3, 191), +(2256, '濉溪县', 3, 191), +(2257, '烈山区', 3, 191), +(2258, '相山区', 3, 191), +(2259, '狮子山区', 3, 192), +(2260, '郊区', 3, 192), +(2261, '铜官山区', 3, 192), +(2262, '铜陵县', 3, 192); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2263, '大观区', 3, 193), +(2264, '太湖县', 3, 193), +(2265, '宜秀区', 3, 193), +(2266, '宿松县', 3, 193), +(2267, '岳西县', 3, 193), +(2268, '怀宁县', 3, 193), +(2269, '望江县', 3, 193), +(2270, '枞阳县', 3, 193), +(2271, '桐城市', 3, 193), +(2272, '潜山县', 3, 193), +(2273, '迎江区', 3, 193), +(2274, '休宁县', 3, 194), +(2275, '屯溪区', 3, 194), +(2276, '徽州区', 3, 194), +(2277, '歙县', 3, 194), +(2278, '祁门县', 3, 194), +(2279, '黄山区', 3, 194), +(2280, '黟县', 3, 194), +(2281, '全椒县', 3, 195), +(2282, '凤阳县', 3, 195), +(2283, '南谯区', 3, 195), +(2284, '天长市', 3, 195), +(2285, '定远县', 3, 195), +(2286, '明光市', 3, 195), +(2287, '来安县', 3, 195), +(2288, '琅玡区', 3, 195), +(2289, '临泉县', 3, 196), +(2290, '太和县', 3, 196), +(2291, '界首市', 3, 196), +(2292, '阜南县', 3, 196), +(2293, '颍东区', 3, 196), +(2294, '颍州区', 3, 196), +(2295, '颍泉区', 3, 196), +(2296, '颖上县', 3, 196), +(2297, '埇桥区', 3, 197), +(2298, '泗县辖', 3, 197), +(2299, '灵璧县', 3, 197), +(2300, '砀山县', 3, 197), +(2301, '萧县', 3, 197), +(2302, '含山县', 3, 198), +(2303, '和县', 3, 198), +(2304, '居巢区', 3, 198), +(2305, '庐江县', 3, 198), +(2306, '无为县', 3, 198), +(2307, '寿县', 3, 199), +(2308, '舒城县', 3, 199), +(2309, '裕安区', 3, 199), +(2310, '金安区', 3, 199), +(2311, '金寨县', 3, 199), +(2312, '霍山县', 3, 199), +(2313, '霍邱县', 3, 199), +(2314, '利辛县', 3, 200), +(2315, '涡阳县', 3, 200), +(2316, '蒙城县', 3, 200), +(2317, '谯城区', 3, 200), +(2318, '东至县', 3, 201), +(2319, '石台县', 3, 201), +(2320, '贵池区', 3, 201), +(2321, '青阳县', 3, 201), +(2322, '宁国市', 3, 202), +(2323, '宣州区', 3, 202), +(2324, '广德县', 3, 202), +(2325, '旌德县', 3, 202), +(2326, '泾县', 3, 202), +(2327, '绩溪县', 3, 202), +(2328, '郎溪县', 3, 202), +(2329, '仓山区', 3, 203), +(2330, '台江区', 3, 203), +(2331, '平潭县', 3, 203), +(2332, '晋安区', 3, 203), +(2333, '永泰县', 3, 203), +(2334, '福清市', 3, 203); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2335, '罗源县', 3, 203), +(2336, '连江县', 3, 203), +(2337, '长乐市', 3, 203), +(2338, '闽侯县', 3, 203), +(2339, '闽清县', 3, 203), +(2340, '马尾区', 3, 203), +(2341, '鼓楼区', 3, 203), +(2342, '同安区', 3, 204), +(2343, '思明区', 3, 204), +(2344, '海沧区', 3, 204), +(2345, '湖里区', 3, 204), +(2346, '翔安区', 3, 204), +(2347, '集美区', 3, 204), +(2348, '仙游县', 3, 205), +(2349, '城厢区', 3, 205), +(2350, '涵江区', 3, 205), +(2351, '秀屿区', 3, 205), +(2352, '荔城区', 3, 205), +(2353, '三元区', 3, 206), +(2354, '大田县', 3, 206), +(2355, '宁化县', 3, 206), +(2356, '将乐县', 3, 206), +(2357, '尤溪县', 3, 206), +(2358, '建宁县', 3, 206), +(2359, '明溪县', 3, 206), +(2360, '梅列区', 3, 206), +(2361, '永安市', 3, 206), +(2362, '沙县', 3, 206), +(2363, '泰宁县', 3, 206), +(2364, '清流县', 3, 206), +(2365, '丰泽区', 3, 207), +(2366, '南安市', 3, 207), +(2367, '安溪县', 3, 207), +(2368, '德化县', 3, 207), +(2369, '惠安县', 3, 207), +(2370, '晋江市', 3, 207), +(2371, '永春县', 3, 207), +(2372, '泉港区', 3, 207), +(2373, '洛江区', 3, 207), +(2374, '石狮市', 3, 207), +(2375, '金门县', 3, 207), +(2376, '鲤城区', 3, 207), +(2377, '东山县', 3, 208), +(2378, '云霄县', 3, 208), +(2379, '华安县', 3, 208), +(2380, '南靖县', 3, 208), +(2381, '平和县', 3, 208), +(2382, '漳浦县', 3, 208), +(2383, '芗城区', 3, 208), +(2384, '诏安县', 3, 208), +(2385, '长泰县', 3, 208), +(2386, '龙文区', 3, 208), +(2387, '龙海市', 3, 208), +(2388, '光泽县', 3, 209), +(2389, '延平区', 3, 209), +(2390, '建瓯市', 3, 209), +(2391, '建阳市', 3, 209), +(2392, '政和县', 3, 209), +(2393, '松溪县', 3, 209), +(2394, '武夷山市', 3, 209), +(2395, '浦城县', 3, 209), +(2396, '邵武市', 3, 209), +(2397, '顺昌县', 3, 209), +(2398, '上杭县', 3, 210), +(2399, '新罗区', 3, 210), +(2400, '武平县', 3, 210), +(2401, '永定县', 3, 210), +(2402, '漳平市', 3, 210), +(2403, '连城县', 3, 210), +(2404, '长汀县', 3, 210), +(2405, '古田县', 3, 211); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2406, '周宁县', 3, 211), +(2407, '寿宁县', 3, 211), +(2408, '屏南县', 3, 211), +(2409, '柘荣县', 3, 211), +(2410, '福安市', 3, 211), +(2411, '福鼎市', 3, 211), +(2412, '蕉城区', 3, 211), +(2413, '霞浦县', 3, 211), +(2414, '东湖区', 3, 212), +(2415, '南昌县', 3, 212), +(2416, '安义县', 3, 212), +(2417, '新建县', 3, 212), +(2418, '湾里区', 3, 212), +(2419, '西湖区', 3, 212), +(2420, '进贤县', 3, 212), +(2421, '青云谱区', 3, 212), +(2422, '青山湖区', 3, 212), +(2423, '乐平市', 3, 213), +(2424, '昌江区', 3, 213), +(2425, '浮梁县', 3, 213), +(2426, '珠山区', 3, 213), +(2427, '上栗县', 3, 214), +(2428, '安源区', 3, 214), +(2429, '湘东区', 3, 214), +(2430, '芦溪县', 3, 214), +(2431, '莲花县', 3, 214), +(2432, '九江县', 3, 215), +(2433, '修水县', 3, 215), +(2434, '庐山区', 3, 215), +(2435, '彭泽县', 3, 215), +(2436, '德安县', 3, 215), +(2437, '星子县', 3, 215), +(2438, '武宁县', 3, 215), +(2439, '永修县', 3, 215), +(2440, '浔阳区', 3, 215), +(2441, '湖口县', 3, 215), +(2442, '瑞昌市', 3, 215), +(2443, '都昌县', 3, 215), +(2444, '分宜县', 3, 216), +(2445, '渝水区', 3, 216), +(2446, '余江县', 3, 217), +(2447, '月湖区', 3, 217), +(2448, '贵溪市', 3, 217), +(2449, '上犹县', 3, 218), +(2450, '于都县', 3, 218), +(2451, '会昌县', 3, 218), +(2452, '信丰县', 3, 218), +(2453, '全南县', 3, 218), +(2454, '兴国县', 3, 218), +(2455, '南康市', 3, 218), +(2456, '大余县', 3, 218), +(2457, '宁都县', 3, 218), +(2458, '安远县', 3, 218), +(2459, '定南县', 3, 218), +(2460, '寻乌县', 3, 218), +(2461, '崇义县', 3, 218), +(2462, '瑞金市', 3, 218), +(2463, '石城县', 3, 218), +(2464, '章贡区', 3, 218), +(2465, '赣县', 3, 218), +(2466, '龙南县', 3, 218), +(2467, '万安县', 3, 219), +(2468, '井冈山市', 3, 219), +(2469, '吉安县', 3, 219), +(2470, '吉州区', 3, 219), +(2471, '吉水县', 3, 219), +(2472, '安福县', 3, 219), +(2473, '峡江县', 3, 219), +(2474, '新干县', 3, 219), +(2475, '永丰县', 3, 219), +(2476, '永新县', 3, 219); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2477, '泰和县', 3, 219), +(2478, '遂川县', 3, 219), +(2479, '青原区', 3, 219), +(2480, '万载县', 3, 220), +(2481, '上高县', 3, 220), +(2482, '丰城市', 3, 220), +(2483, '奉新县', 3, 220), +(2484, '宜丰县', 3, 220), +(2485, '樟树市', 3, 220), +(2486, '袁州区', 3, 220), +(2487, '铜鼓县', 3, 220), +(2488, '靖安县', 3, 220), +(2489, '高安市', 3, 220), +(2490, '东乡县', 3, 221), +(2491, '临川区', 3, 221), +(2492, '乐安县', 3, 221), +(2493, '南丰县', 3, 221), +(2494, '南城县', 3, 221), +(2495, '宜黄县', 3, 221), +(2496, '崇仁县', 3, 221), +(2497, '广昌县', 3, 221), +(2498, '资溪县', 3, 221), +(2499, '金溪县', 3, 221), +(2500, '黎川县', 3, 221), +(2501, '万年县', 3, 222), +(2502, '上饶县', 3, 222), +(2503, '余干县', 3, 222), +(2504, '信州区', 3, 222), +(2505, '婺源县', 3, 222), +(2506, '广丰县', 3, 222), +(2507, '弋阳县', 3, 222), +(2508, '德兴市', 3, 222), +(2509, '横峰县', 3, 222), +(2510, '玉山县', 3, 222), +(2511, '鄱阳县', 3, 222), +(2512, '铅山县', 3, 222), +(2513, '历下区', 3, 223), +(2514, '历城区', 3, 223), +(2515, '商河县', 3, 223), +(2516, '天桥区', 3, 223), +(2517, '市中区', 3, 223), +(2518, '平阴县', 3, 223), +(2519, '槐荫区', 3, 223), +(2520, '济阳县', 3, 223), +(2521, '章丘市', 3, 223), +(2522, '长清区', 3, 223), +(2523, '即墨市', 3, 224), +(2524, '四方区', 3, 224), +(2525, '城阳区', 3, 224), +(2526, '崂山区', 3, 224), +(2527, '市北区', 3, 224), +(2528, '市南区', 3, 224), +(2529, '平度市', 3, 224), +(2530, '李沧区', 3, 224), +(2531, '胶南市', 3, 224), +(2532, '胶州市', 3, 224), +(2533, '莱西市', 3, 224), +(2534, '黄岛区', 3, 224), +(2535, '临淄区', 3, 225), +(2536, '博山区', 3, 225), +(2537, '周村区', 3, 225), +(2538, '张店区', 3, 225), +(2539, '桓台县', 3, 225), +(2540, '沂源县', 3, 225), +(2541, '淄川区', 3, 225), +(2542, '高青县', 3, 225), +(2543, '台儿庄区', 3, 226), +(2544, '山亭区', 3, 226), +(2545, '峄城区', 3, 226), +(2546, '市中区', 3, 226), +(2547, '滕州市', 3, 226); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2548, '薛城区', 3, 226), +(2549, '东营区', 3, 227), +(2550, '利津县', 3, 227), +(2551, '垦利县', 3, 227), +(2552, '广饶县', 3, 227), +(2553, '河口区', 3, 227), +(2554, '招远市', 3, 228), +(2555, '栖霞市', 3, 228), +(2556, '海阳市', 3, 228), +(2557, '牟平区', 3, 228), +(2558, '福山区', 3, 228), +(2559, '芝罘区', 3, 228), +(2560, '莱山区', 3, 228), +(2561, '莱州市', 3, 228), +(2562, '莱阳市', 3, 228), +(2563, '蓬莱市', 3, 228), +(2564, '长岛县', 3, 228), +(2565, '龙口市', 3, 228), +(2566, '临朐县', 3, 229), +(2567, '坊子区', 3, 229), +(2568, '奎文区', 3, 229), +(2569, '安丘市', 3, 229), +(2570, '寒亭区', 3, 229), +(2571, '寿光市', 3, 229), +(2572, '昌乐县', 3, 229), +(2573, '昌邑市', 3, 229), +(2574, '潍城区', 3, 229), +(2575, '诸城市', 3, 229), +(2576, '青州市', 3, 229), +(2577, '高密市', 3, 229), +(2578, '任城区', 3, 230), +(2579, '兖州市', 3, 230), +(2580, '嘉祥县', 3, 230), +(2581, '市中区', 3, 230), +(2582, '微山县', 3, 230), +(2583, '曲阜市', 3, 230), +(2584, '梁山县', 3, 230), +(2585, '汶上县', 3, 230), +(2586, '泗水县', 3, 230), +(2587, '邹城市', 3, 230), +(2588, '金乡县', 3, 230), +(2589, '鱼台县', 3, 230), +(2590, '东平县', 3, 231), +(2591, '宁阳县', 3, 231), +(2592, '岱岳区', 3, 231), +(2593, '新泰市', 3, 231), +(2594, '泰山区', 3, 231), +(2595, '肥城市', 3, 231), +(2596, '乳山市', 3, 232), +(2597, '文登市', 3, 232), +(2598, '环翠区', 3, 232), +(2599, '荣成市', 3, 232), +(2600, '东港区', 3, 233), +(2601, '五莲县', 3, 233), +(2602, '岚山区', 3, 233), +(2603, '莒县', 3, 233), +(2604, '莱城区', 3, 234), +(2605, '钢城区', 3, 234), +(2606, '临沭县', 3, 235), +(2607, '兰山区', 3, 235), +(2608, '平邑县', 3, 235), +(2609, '沂南县', 3, 235), +(2610, '沂水县', 3, 235), +(2611, '河东区', 3, 235), +(2612, '罗庄区', 3, 235), +(2613, '苍山县', 3, 235), +(2614, '莒南县', 3, 235), +(2615, '蒙阴县', 3, 235), +(2616, '费县', 3, 235), +(2617, '郯城县', 3, 235), +(2618, '临邑县', 3, 236); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2619, '乐陵市', 3, 236), +(2620, '夏津县', 3, 236), +(2621, '宁津县', 3, 236), +(2622, '平原县', 3, 236), +(2623, '庆云县', 3, 236), +(2624, '德城区', 3, 236), +(2625, '武城县', 3, 236), +(2626, '禹城市', 3, 236), +(2627, '陵县', 3, 236), +(2628, '齐河县', 3, 236), +(2629, '东昌府区', 3, 237), +(2630, '东阿县', 3, 237), +(2631, '临清市', 3, 237), +(2632, '冠县', 3, 237), +(2633, '茌平县', 3, 237), +(2634, '莘县', 3, 237), +(2635, '阳谷县', 3, 237), +(2636, '高唐县', 3, 237), +(2637, '博兴县', 3, 238), +(2638, '惠民县', 3, 238), +(2639, '无棣县', 3, 238), +(2640, '沾化县', 3, 238), +(2641, '滨城区', 3, 238), +(2642, '邹平县', 3, 238), +(2643, '阳信县', 3, 238), +(2644, '东明县', 3, 239), +(2645, '单县', 3, 239), +(2646, '定陶县', 3, 239), +(2647, '巨野县', 3, 239), +(2648, '成武县', 3, 239), +(2649, '曹县', 3, 239), +(2650, '牡丹区', 3, 239), +(2651, '郓城县', 3, 239), +(2652, '鄄城县', 3, 239), +(2653, '上街区', 3, 240), +(2654, '中原区', 3, 240), +(2655, '中牟县', 3, 240), +(2656, '二七区', 3, 240), +(2657, '巩义市', 3, 240), +(2658, '惠济区', 3, 240), +(2659, '新密市', 3, 240), +(2660, '新郑市', 3, 240), +(2661, '登封市', 3, 240), +(2662, '管城回族区', 3, 240), +(2663, '荥阳市', 3, 240), +(2664, '金水区', 3, 240), +(2665, '兰考县', 3, 241), +(2666, '尉氏县', 3, 241), +(2667, '开封县', 3, 241), +(2668, '杞县', 3, 241), +(2669, '禹王台区', 3, 241), +(2670, '通许县', 3, 241), +(2671, '金明区', 3, 241), +(2672, '顺河回族区', 3, 241), +(2673, '鼓楼区', 3, 241), +(2674, '龙亭区', 3, 241), +(2675, '伊川县', 3, 242), +(2676, '偃师市', 3, 242), +(2677, '吉利区', 3, 242), +(2678, '孟津县', 3, 242), +(2679, '宜阳县', 3, 242), +(2680, '嵩县', 3, 242), +(2681, '新安县', 3, 242), +(2682, '栾川县', 3, 242), +(2683, '汝阳县', 3, 242), +(2684, '洛宁县', 3, 242), +(2685, '洛龙区', 3, 242), +(2686, '涧西区', 3, 242), +(2687, '瀍河回族区', 3, 242), +(2688, '老城区', 3, 242), +(2689, '西工区', 3, 242); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2690, '卫东区', 3, 243), +(2691, '叶县', 3, 243), +(2692, '宝丰县', 3, 243), +(2693, '新华区', 3, 243), +(2694, '汝州市', 3, 243), +(2695, '湛河区', 3, 243), +(2696, '石龙区', 3, 243), +(2697, '舞钢市', 3, 243), +(2698, '郏县', 3, 243), +(2699, '鲁山县', 3, 243), +(2700, '内黄县', 3, 244), +(2701, '北关区', 3, 244), +(2702, '安阳县', 3, 244), +(2703, '文峰区', 3, 244), +(2704, '林州市', 3, 244), +(2705, '殷都区', 3, 244), +(2706, '汤阴县', 3, 244), +(2707, '滑县', 3, 244), +(2708, '龙安区', 3, 244), +(2709, '山城区', 3, 245), +(2710, '浚县', 3, 245), +(2711, '淇县', 3, 245), +(2712, '淇滨区', 3, 245), +(2713, '鹤山区', 3, 245), +(2714, '凤泉区', 3, 246), +(2715, '卫滨区', 3, 246), +(2716, '卫辉市', 3, 246), +(2717, '原阳县', 3, 246), +(2718, '封丘县', 3, 246), +(2719, '延津县', 3, 246), +(2720, '新乡县', 3, 246), +(2721, '牧野区', 3, 246), +(2722, '红旗区', 3, 246), +(2723, '获嘉县', 3, 246), +(2724, '辉县市', 3, 246), +(2725, '长垣县', 3, 246), +(2726, '中站区', 3, 247), +(2727, '修武县', 3, 247), +(2728, '博爱县', 3, 247), +(2729, '孟州市', 3, 247), +(2730, '山阳区', 3, 247), +(2731, '武陟县', 3, 247), +(2732, '沁阳市', 3, 247), +(2733, '温县', 3, 247), +(2734, '解放区', 3, 247), +(2735, '马村区', 3, 247), +(2736, '华龙区', 3, 248), +(2737, '南乐县', 3, 248), +(2738, '台前县', 3, 248), +(2739, '清丰县', 3, 248), +(2740, '濮阳县', 3, 248), +(2741, '范县', 3, 248), +(2742, '禹州市', 3, 249), +(2743, '襄城县', 3, 249), +(2744, '许昌县', 3, 249), +(2745, '鄢陵县', 3, 249), +(2746, '长葛市', 3, 249), +(2747, '魏都区', 3, 249), +(2748, '临颍县', 3, 250), +(2749, '召陵区', 3, 250), +(2750, '源汇区', 3, 250), +(2751, '舞阳县', 3, 250), +(2752, '郾城区', 3, 250), +(2753, '义马市', 3, 251), +(2754, '卢氏县', 3, 251), +(2755, '渑池县', 3, 251), +(2756, '湖滨区', 3, 251), +(2757, '灵宝市', 3, 251), +(2758, '陕县', 3, 251), +(2759, '内乡县', 3, 252), +(2760, '南召县', 3, 252), +(2761, '卧龙区', 3, 252); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2762, '唐河县', 3, 252), +(2763, '宛城区', 3, 252), +(2764, '新野县', 3, 252), +(2765, '方城县', 3, 252), +(2766, '桐柏县', 3, 252), +(2767, '淅川县', 3, 252), +(2768, '社旗县', 3, 252), +(2769, '西峡县', 3, 252), +(2770, '邓州市', 3, 252), +(2771, '镇平县', 3, 252), +(2772, '夏邑县', 3, 253), +(2773, '宁陵县', 3, 253), +(2774, '柘城县', 3, 253), +(2775, '民权县', 3, 253), +(2776, '永城市', 3, 253), +(2777, '睢县', 3, 253), +(2778, '睢阳区', 3, 253), +(2779, '粱园区', 3, 253), +(2780, '虞城县', 3, 253), +(2781, '光山县', 3, 254), +(2782, '商城县', 3, 254), +(2783, '固始县', 3, 254), +(2784, '平桥区', 3, 254), +(2785, '息县', 3, 254), +(2786, '新县', 3, 254), +(2787, '浉河区', 3, 254), +(2788, '淮滨县', 3, 254), +(2789, '潢川县', 3, 254), +(2790, '罗山县', 3, 254), +(2791, '商水县', 3, 255), +(2792, '太康县', 3, 255), +(2793, '川汇区', 3, 255), +(2794, '扶沟县', 3, 255), +(2795, '沈丘县', 3, 255), +(2796, '淮阳县', 3, 255), +(2797, '西华县', 3, 255), +(2798, '郸城县', 3, 255), +(2799, '项城市', 3, 255), +(2800, '鹿邑县', 3, 255), +(2801, '上蔡县', 3, 256), +(2802, '平舆县', 3, 256), +(2803, '新蔡县', 3, 256), +(2804, '正阳县', 3, 256), +(2805, '汝南县', 3, 256), +(2806, '泌阳县', 3, 256), +(2807, '确山县', 3, 256), +(2808, '西平县', 3, 256), +(2809, '遂平县', 3, 256), +(2810, '驿城区', 3, 256), +(2811, '济源市', 3, 257), +(2812, '东西湖区', 3, 258), +(2813, '新洲区', 3, 258), +(2814, '武昌区', 3, 258), +(2815, '汉南区', 3, 258), +(2816, '汉阳区', 3, 258), +(2817, '江夏区', 3, 258), +(2818, '江岸区', 3, 258), +(2819, '江汉区', 3, 258), +(2820, '洪山区', 3, 258), +(2821, '硚口区', 3, 258), +(2822, '蔡甸区', 3, 258), +(2823, '青山区', 3, 258), +(2824, '黄陂区', 3, 258), +(2825, '下陆区', 3, 259), +(2826, '大冶市', 3, 259), +(2827, '西塞山区', 3, 259), +(2828, '铁山区', 3, 259), +(2829, '阳新县', 3, 259), +(2830, '黄石港区', 3, 259), +(2831, '丹江口市', 3, 260), +(2832, '张湾区', 3, 260); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2833, '房县', 3, 260), +(2834, '竹山县', 3, 260), +(2835, '竹溪县', 3, 260), +(2836, '茅箭区', 3, 260), +(2837, '郧县', 3, 260), +(2838, '郧西县', 3, 260), +(2839, '五峰土家族自治县', 3, 261), +(2840, '伍家岗区', 3, 261), +(2841, '兴山县', 3, 261), +(2842, '夷陵区', 3, 261), +(2843, '宜都市', 3, 261), +(2844, '当阳市', 3, 261), +(2845, '枝江市', 3, 261), +(2846, '点军区', 3, 261), +(2847, '秭归县', 3, 261), +(2848, '虢亭区', 3, 261), +(2849, '西陵区', 3, 261), +(2850, '远安县', 3, 261), +(2851, '长阳土家族自治县', 3, 261), +(2852, '保康县', 3, 262), +(2853, '南漳县', 3, 262), +(2854, '宜城市', 3, 262), +(2855, '枣阳市', 3, 262), +(2856, '樊城区', 3, 262), +(2857, '老河口市', 3, 262), +(2858, '襄城区', 3, 262), +(2859, '襄阳区', 3, 262), +(2860, '谷城县', 3, 262), +(2861, '华容区', 3, 263), +(2862, '粱子湖', 3, 263), +(2863, '鄂城区', 3, 263), +(2864, '东宝区', 3, 264), +(2865, '京山县', 3, 264), +(2866, '掇刀区', 3, 264), +(2867, '沙洋县', 3, 264), +(2868, '钟祥市', 3, 264), +(2869, '云梦县', 3, 265), +(2870, '大悟县', 3, 265), +(2871, '孝南区', 3, 265), +(2872, '孝昌县', 3, 265), +(2873, '安陆市', 3, 265), +(2874, '应城市', 3, 265), +(2875, '汉川市', 3, 265), +(2876, '公安县', 3, 266), +(2877, '松滋市', 3, 266), +(2878, '江陵县', 3, 266), +(2879, '沙市区', 3, 266), +(2880, '洪湖市', 3, 266), +(2881, '监利县', 3, 266), +(2882, '石首市', 3, 266), +(2883, '荆州区', 3, 266), +(2884, '团风县', 3, 267), +(2885, '武穴市', 3, 267), +(2886, '浠水县', 3, 267), +(2887, '红安县', 3, 267), +(2888, '罗田县', 3, 267), +(2889, '英山县', 3, 267), +(2890, '蕲春县', 3, 267), +(2891, '麻城市', 3, 267), +(2892, '黄州区', 3, 267), +(2893, '黄梅县', 3, 267), +(2894, '咸安区', 3, 268), +(2895, '嘉鱼县', 3, 268), +(2896, '崇阳县', 3, 268), +(2897, '赤壁市', 3, 268), +(2898, '通城县', 3, 268), +(2899, '通山县', 3, 268), +(2900, '广水市', 3, 269), +(2901, '曾都区', 3, 269), +(2902, '利川市', 3, 270); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2903, '咸丰县', 3, 270), +(2904, '宣恩县', 3, 270), +(2905, '巴东县', 3, 270), +(2906, '建始县', 3, 270), +(2907, '恩施市', 3, 270), +(2908, '来凤县', 3, 270), +(2909, '鹤峰县', 3, 270), +(2910, '仙桃市', 3, 271), +(2911, '潜江市', 3, 272), +(2912, '天门市', 3, 273), +(2913, '神农架林区', 3, 274), +(2914, '天心区', 3, 275), +(2915, '宁乡县', 3, 275), +(2916, '岳麓区', 3, 275), +(2917, '开福区', 3, 275), +(2918, '望城县', 3, 275), +(2919, '浏阳市', 3, 275), +(2920, '芙蓉区', 3, 275), +(2921, '长沙县', 3, 275), +(2922, '雨花区', 3, 275), +(2923, '天元区', 3, 276), +(2924, '攸县', 3, 276), +(2925, '株洲县', 3, 276), +(2926, '炎陵县', 3, 276), +(2927, '石峰区', 3, 276), +(2928, '芦淞区', 3, 276), +(2929, '茶陵县', 3, 276), +(2930, '荷塘区', 3, 276), +(2931, '醴陵市', 3, 276), +(2932, '岳塘区', 3, 277), +(2933, '湘乡市', 3, 277), +(2934, '湘潭县', 3, 277), +(2935, '雨湖区', 3, 277), +(2936, '韶山市', 3, 277), +(2937, '南岳区', 3, 278), +(2938, '常宁市', 3, 278), +(2939, '珠晖区', 3, 278), +(2940, '石鼓区', 3, 278), +(2941, '祁东县', 3, 278), +(2942, '耒阳市', 3, 278), +(2943, '蒸湘区', 3, 278), +(2944, '衡东县', 3, 278), +(2945, '衡南县', 3, 278), +(2946, '衡山县', 3, 278), +(2947, '衡阳县', 3, 278), +(2948, '雁峰区', 3, 278), +(2949, '北塔区', 3, 279), +(2950, '双清区', 3, 279), +(2951, '城步苗族自治县', 3, 279), +(2952, '大祥区', 3, 279), +(2953, '新宁县', 3, 279), +(2954, '新邵县', 3, 279), +(2955, '武冈市', 3, 279), +(2956, '洞口县', 3, 279), +(2957, '绥宁县', 3, 279), +(2958, '邵东县', 3, 279), +(2959, '邵阳县', 3, 279), +(2960, '隆回县', 3, 279), +(2961, '临湘市', 3, 280), +(2962, '云溪区', 3, 280), +(2963, '华容县', 3, 280), +(2964, '君山区', 3, 280), +(2965, '岳阳县', 3, 280), +(2966, '岳阳楼区', 3, 280), +(2967, '平江县', 3, 280), +(2968, '汨罗市', 3, 280), +(2969, '湘阴县', 3, 280), +(2970, '临澧县', 3, 281), +(2971, '安乡县', 3, 281), +(2972, '桃源县', 3, 281); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(2973, '武陵区', 3, 281), +(2974, '汉寿县', 3, 281), +(2975, '津市市', 3, 281), +(2976, '澧县', 3, 281), +(2977, '石门县', 3, 281), +(2978, '鼎城区', 3, 281), +(2979, '慈利县', 3, 282), +(2980, '桑植县', 3, 282), +(2981, '武陵源区', 3, 282), +(2982, '永定区', 3, 282), +(2983, '南县', 3, 283), +(2984, '安化县', 3, 283), +(2985, '桃江县', 3, 283), +(2986, '沅江市', 3, 283), +(2987, '资阳区', 3, 283), +(2988, '赫山区', 3, 283), +(2989, '临武县', 3, 284), +(2990, '北湖区', 3, 284), +(2991, '嘉禾县', 3, 284), +(2992, '安仁县', 3, 284), +(2993, '宜章县', 3, 284), +(2994, '桂东县', 3, 284), +(2995, '桂阳县', 3, 284), +(2996, '永兴县', 3, 284), +(2997, '汝城县', 3, 284), +(2998, '苏仙区', 3, 284), +(2999, '资兴市', 3, 284), +(3000, '东安县', 3, 285), +(3001, '冷水滩区', 3, 285), +(3002, '双牌县', 3, 285), +(3003, '宁远县', 3, 285), +(3004, '新田县', 3, 285), +(3005, '江华瑶族自治县', 3, 285), +(3006, '江永县', 3, 285), +(3007, '祁阳县', 3, 285), +(3008, '蓝山县', 3, 285), +(3009, '道县', 3, 285), +(3010, '零陵区', 3, 285), +(3011, '中方县', 3, 286), +(3012, '会同县', 3, 286), +(3013, '新晃侗族自治县', 3, 286), +(3014, '沅陵县', 3, 286), +(3015, '洪江市/洪江区', 3, 286), +(3016, '溆浦县', 3, 286), +(3017, '芷江侗族自治县', 3, 286), +(3018, '辰溪县', 3, 286), +(3019, '通道侗族自治县', 3, 286), +(3020, '靖州苗族侗族自治县', 3, 286), +(3021, '鹤城区', 3, 286), +(3022, '麻阳苗族自治县', 3, 286), +(3023, '冷水江市', 3, 287), +(3024, '双峰县', 3, 287), +(3025, '娄星区', 3, 287), +(3026, '新化县', 3, 287), +(3027, '涟源市', 3, 287), +(3028, '保靖县', 3, 288), +(3029, '凤凰县', 3, 288), +(3030, '古丈县', 3, 288), +(3031, '吉首市', 3, 288), +(3032, '永顺县', 3, 288), +(3033, '泸溪县', 3, 288), +(3034, '花垣县', 3, 288), +(3035, '龙山县', 3, 288), +(3036, '萝岗区', 3, 289), +(3037, '南沙区', 3, 289), +(3038, '从化市', 3, 289), +(3039, '增城市', 3, 289), +(3040, '天河区', 3, 289); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3041, '海珠区', 3, 289), +(3042, '番禺区', 3, 289), +(3043, '白云区', 3, 289), +(3044, '花都区', 3, 289), +(3045, '荔湾区', 3, 289), +(3046, '越秀区', 3, 289), +(3047, '黄埔区', 3, 289), +(3048, '乐昌市', 3, 290), +(3049, '乳源瑶族自治县', 3, 290), +(3050, '仁化县', 3, 290), +(3051, '南雄市', 3, 290), +(3052, '始兴县', 3, 290), +(3053, '新丰县', 3, 290), +(3054, '曲江区', 3, 290), +(3055, '武江区', 3, 290), +(3056, '浈江区', 3, 290), +(3057, '翁源县', 3, 290), +(3058, '南山区', 3, 291), +(3059, '宝安区', 3, 291), +(3060, '盐田区', 3, 291), +(3061, '福田区', 3, 291), +(3062, '罗湖区', 3, 291), +(3063, '龙岗区', 3, 291), +(3064, '斗门区', 3, 292), +(3065, '金湾区', 3, 292), +(3066, '香洲区', 3, 292), +(3067, '南澳县', 3, 293), +(3068, '潮南区', 3, 293), +(3069, '潮阳区', 3, 293), +(3070, '澄海区', 3, 293), +(3071, '濠江区', 3, 293), +(3072, '金平区', 3, 293), +(3073, '龙湖区', 3, 293), +(3074, '三水区', 3, 294), +(3075, '南海区', 3, 294), +(3076, '禅城区', 3, 294), +(3077, '顺德区', 3, 294), +(3078, '高明区', 3, 294), +(3079, '台山市', 3, 295), +(3080, '开平市', 3, 295), +(3081, '恩平市', 3, 295), +(3082, '新会区', 3, 295), +(3083, '江海区', 3, 295), +(3084, '蓬江区', 3, 295), +(3085, '鹤山市', 3, 295), +(3086, '吴川市', 3, 296), +(3087, '坡头区', 3, 296), +(3088, '廉江市', 3, 296), +(3089, '徐闻县', 3, 296), +(3090, '赤坎区', 3, 296), +(3091, '遂溪县', 3, 296), +(3092, '雷州市', 3, 296), +(3093, '霞山区', 3, 296), +(3094, '麻章区', 3, 296), +(3095, '信宜市', 3, 297), +(3096, '化州市', 3, 297), +(3097, '电白县', 3, 297), +(3098, '茂南区', 3, 297), +(3099, '茂港区', 3, 297), +(3100, '高州市', 3, 297), +(3101, '四会市', 3, 298), +(3102, '封开县', 3, 298), +(3103, '广宁县', 3, 298), +(3104, '德庆县', 3, 298), +(3105, '怀集县', 3, 298), +(3106, '端州区', 3, 298), +(3107, '高要市', 3, 298), +(3108, '鼎湖区', 3, 298), +(3109, '博罗县', 3, 299), +(3110, '惠东县', 3, 299); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3111, '惠城区', 3, 299), +(3112, '惠阳区', 3, 299), +(3113, '龙门县', 3, 299), +(3114, '丰顺县', 3, 300), +(3115, '五华县', 3, 300), +(3116, '兴宁市', 3, 300), +(3117, '大埔县', 3, 300), +(3118, '平远县', 3, 300), +(3119, '梅县', 3, 300), +(3120, '梅江区', 3, 300), +(3121, '蕉岭县', 3, 300), +(3122, '城区', 3, 301), +(3123, '海丰县', 3, 301), +(3124, '陆丰市', 3, 301), +(3125, '陆河县', 3, 301), +(3126, '东源县', 3, 302), +(3127, '和平县', 3, 302), +(3128, '源城区', 3, 302), +(3129, '紫金县', 3, 302), +(3130, '连平县', 3, 302), +(3131, '龙川县', 3, 302), +(3132, '江城区', 3, 303), +(3133, '阳东县', 3, 303), +(3134, '阳春市', 3, 303), +(3135, '阳西县', 3, 303), +(3136, '佛冈县', 3, 304), +(3137, '清城区', 3, 304), +(3138, '清新县', 3, 304), +(3139, '英德市', 3, 304), +(3140, '连南瑶族自治县', 3, 304), +(3141, '连山壮族瑶族自治县', 3, 304), +(3142, '连州市', 3, 304), +(3143, '阳山县', 3, 304), +(3144, '东莞市', 3, 305), +(3145, '中山市', 3, 306), +(3146, '湘桥区', 3, 307), +(3147, '潮安县', 3, 307), +(3148, '饶平县', 3, 307), +(3149, '惠来县', 3, 308), +(3150, '揭东县', 3, 308), +(3151, '揭西县', 3, 308), +(3152, '普宁市', 3, 308), +(3153, '榕城区', 3, 308), +(3154, '云城区', 3, 309), +(3155, '云安县', 3, 309), +(3156, '新兴县', 3, 309), +(3157, '罗定市', 3, 309), +(3158, '郁南县', 3, 309), +(3159, '上林县', 3, 310), +(3160, '兴宁区', 3, 310), +(3161, '宾阳县', 3, 310), +(3162, '横县', 3, 310), +(3163, '武鸣县', 3, 310), +(3164, '江南区', 3, 310), +(3165, '良庆区', 3, 310), +(3166, '西乡塘区', 3, 310), +(3167, '邕宁区', 3, 310), +(3168, '隆安县', 3, 310), +(3169, '青秀区', 3, 310), +(3170, '马山县', 3, 310), +(3171, '三江侗族自治县', 3, 311), +(3172, '城中区', 3, 311), +(3173, '柳北区', 3, 311), +(3174, '柳南区', 3, 311), +(3175, '柳城县', 3, 311), +(3176, '柳江县', 3, 311), +(3177, '融安县', 3, 311), +(3178, '融水苗族自治县', 3, 311), +(3179, '鱼峰区', 3, 311); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3180, '鹿寨县', 3, 311), +(3181, '七星区', 3, 312), +(3182, '临桂县', 3, 312), +(3183, '全州县', 3, 312), +(3184, '兴安县', 3, 312), +(3185, '叠彩区', 3, 312), +(3186, '平乐县', 3, 312), +(3187, '恭城瑶族自治县', 3, 312), +(3188, '永福县', 3, 312), +(3189, '灌阳县', 3, 312), +(3190, '灵川县', 3, 312), +(3191, '秀峰区', 3, 312), +(3192, '荔浦县', 3, 312), +(3193, '象山区', 3, 312), +(3194, '资源县', 3, 312), +(3195, '阳朔县', 3, 312), +(3196, '雁山区', 3, 312), +(3197, '龙胜各族自治县', 3, 312), +(3198, '万秀区', 3, 313), +(3199, '岑溪市', 3, 313), +(3200, '苍梧县', 3, 313), +(3201, '蒙山县', 3, 313), +(3202, '藤县', 3, 313), +(3203, '蝶山区', 3, 313), +(3204, '长洲区', 3, 313), +(3205, '合浦县', 3, 314), +(3206, '海城区', 3, 314), +(3207, '铁山港区', 3, 314), +(3208, '银海区', 3, 314), +(3209, '上思县', 3, 315), +(3210, '东兴市', 3, 315), +(3211, '港口区', 3, 315), +(3212, '防城区', 3, 315), +(3213, '浦北县', 3, 316), +(3214, '灵山县', 3, 316), +(3215, '钦北区', 3, 316), +(3216, '钦南区', 3, 316), +(3217, '平南县', 3, 317), +(3218, '桂平市', 3, 317), +(3219, '港北区', 3, 317), +(3220, '港南区', 3, 317), +(3221, '覃塘区', 3, 317), +(3222, '兴业县', 3, 318), +(3223, '北流市', 3, 318), +(3224, '博白县', 3, 318), +(3225, '容县', 3, 318), +(3226, '玉州区', 3, 318), +(3227, '陆川县', 3, 318), +(3228, '乐业县', 3, 319), +(3229, '凌云县', 3, 319), +(3230, '右江区', 3, 319), +(3231, '平果县', 3, 319), +(3232, '德保县', 3, 319), +(3233, '田东县', 3, 319), +(3234, '田林县', 3, 319), +(3235, '田阳县', 3, 319), +(3236, '西林县', 3, 319), +(3237, '那坡县', 3, 319), +(3238, '隆林各族自治县', 3, 319), +(3239, '靖西县', 3, 319), +(3240, '八步区', 3, 320), +(3241, '富川瑶族自治县', 3, 320), +(3242, '昭平县', 3, 320), +(3243, '钟山县', 3, 320), +(3244, '东兰县', 3, 321), +(3245, '凤山县', 3, 321), +(3246, '南丹县', 3, 321), +(3247, '大化瑶族自治县', 3, 321), +(3248, '天峨县', 3, 321); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3249, '宜州市', 3, 321), +(3250, '巴马瑶族自治县', 3, 321), +(3251, '环江毛南族自治县', 3, 321), +(3252, '罗城仫佬族自治县', 3, 321), +(3253, '都安瑶族自治县', 3, 321), +(3254, '金城江区', 3, 321), +(3255, '兴宾区', 3, 322), +(3256, '合山市', 3, 322), +(3257, '忻城县', 3, 322), +(3258, '武宣县', 3, 322), +(3259, '象州县', 3, 322), +(3260, '金秀瑶族自治县', 3, 322), +(3261, '凭祥市', 3, 323), +(3262, '大新县', 3, 323), +(3263, '天等县', 3, 323), +(3264, '宁明县', 3, 323), +(3265, '扶绥县', 3, 323), +(3266, '江州区', 3, 323), +(3267, '龙州县', 3, 323), +(3268, '琼山区', 3, 324), +(3269, '秀英区', 3, 324), +(3270, '美兰区', 3, 324), +(3271, '龙华区', 3, 324), +(3272, '三亚市', 3, 325), +(3273, '五指山市', 3, 326), +(3274, '琼海市', 3, 327), +(3275, '儋州市', 3, 328), +(3276, '文昌市', 3, 329), +(3277, '万宁市', 3, 330), +(3278, '东方市', 3, 331), +(3279, '定安县', 3, 332), +(3280, '屯昌县', 3, 333), +(3281, '澄迈县', 3, 334), +(3282, '临高县', 3, 335), +(3283, '白沙黎族自治县', 3, 336), +(3284, '昌江黎族自治县', 3, 337), +(3285, '乐东黎族自治县', 3, 338), +(3286, '陵水黎族自治县', 3, 339), +(3287, '保亭黎族苗族自治县', 3, 340), +(3288, '琼中黎族苗族自治县', 3, 341), +(3289, '九池乡', 3, 345), +(3290, '五桥街道', 3, 345), +(3291, '余家镇', 3, 345), +(3292, '分水镇', 3, 345), +(3293, '双河口街道', 3, 345), +(3294, '后山镇', 3, 345), +(3295, '周家坝街道', 3, 345), +(3296, '响水镇', 3, 345), +(3297, '地宝乡', 3, 345), +(3298, '大周镇', 3, 345), +(3299, '天城镇', 3, 345), +(3300, '太安镇', 3, 345), +(3301, '太白街道', 3, 345), +(3302, '太龙镇', 3, 345), +(3303, '孙家镇', 3, 345), +(3304, '小周镇', 3, 345), +(3305, '弹子镇', 3, 345), +(3306, '恒合土家族乡', 3, 345), +(3307, '新乡镇', 3, 345), +(3308, '新田镇', 3, 345), +(3309, '普子乡', 3, 345), +(3310, '李河镇', 3, 345), +(3311, '柱山乡', 3, 345), +(3312, '梨树乡', 3, 345); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3313, '武陵镇', 3, 345), +(3314, '沙河街道', 3, 345), +(3315, '溪口乡', 3, 345), +(3316, '瀼渡镇', 3, 345), +(3317, '熊家镇', 3, 345), +(3318, '燕山乡', 3, 345), +(3319, '牌楼街道', 3, 345), +(3320, '甘宁镇', 3, 345), +(3321, '白土镇', 3, 345), +(3322, '白羊镇', 3, 345), +(3323, '百安坝街道', 3, 345), +(3324, '罗田镇', 3, 345), +(3325, '茨竹乡', 3, 345), +(3326, '走马镇', 3, 345), +(3327, '郭村乡', 3, 345), +(3328, '钟鼓楼街道', 3, 345), +(3329, '铁峰乡', 3, 345), +(3330, '长坪乡', 3, 345), +(3331, '长岭镇', 3, 345), +(3332, '长滩镇', 3, 345), +(3333, '陈家坝街道', 3, 345), +(3334, '高峰镇', 3, 345), +(3335, '高梁镇', 3, 345), +(3336, '高笋塘街道', 3, 345), +(3337, '黄柏乡', 3, 345), +(3338, '龙沙镇', 3, 345), +(3339, '龙都街道', 3, 345), +(3340, '龙驹镇', 3, 345), +(3341, '丛林乡', 3, 346), +(3342, '两汇乡', 3, 346), +(3343, '中峰乡', 3, 346), +(3344, '义和镇', 3, 346), +(3345, '仁义乡', 3, 346), +(3346, '南沱镇', 3, 346), +(3347, '卷洞乡', 3, 346), +(3348, '同乐乡', 3, 346), +(3349, '土地坡乡', 3, 346), +(3350, '堡子镇', 3, 346), +(3351, '增福乡', 3, 346), +(3352, '大木乡', 3, 346), +(3353, '天台乡', 3, 346), +(3354, '太和乡', 3, 346), +(3355, '山窝乡', 3, 346), +(3356, '崇义街道', 3, 346), +(3357, '惠民乡', 3, 346), +(3358, '敦仁街道', 3, 346), +(3359, '新妙镇', 3, 346), +(3360, '新村乡', 3, 346), +(3361, '明家乡', 3, 346), +(3362, '李渡镇', 3, 346), +(3363, '梓里乡', 3, 346), +(3364, '武陵山乡', 3, 346), +(3365, '江东街道', 3, 346), +(3366, '江北街道', 3, 346), +(3367, '清溪镇', 3, 346), +(3368, '焦石镇', 3, 346), +(3369, '珍溪镇', 3, 346), +(3370, '白涛镇', 3, 346), +(3371, '百胜镇', 3, 346), +(3372, '石和乡', 3, 346), +(3373, '石沱镇', 3, 346), +(3374, '石龙乡', 3, 346), +(3375, '罗云乡', 3, 346), +(3376, '聚宝乡', 3, 346), +(3377, '致韩镇', 3, 346), +(3378, '荔枝街道', 3, 346), +(3379, '蔺市镇', 3, 346), +(3380, '酒店乡', 3, 346), +(3381, '镇安镇', 3, 346); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3382, '青羊镇', 3, 346), +(3383, '马武镇', 3, 346), +(3384, '龙桥镇', 3, 346), +(3385, '龙潭镇', 3, 346), +(3386, '七星岗街道', 3, 347), +(3387, '上清寺街道', 3, 347), +(3388, '两路口街道', 3, 347), +(3389, '化龙桥街道', 3, 347), +(3390, '南纪门街道', 3, 347), +(3391, '大坪街道', 3, 347), +(3392, '大溪沟街道', 3, 347), +(3393, '望龙门街道', 3, 347), +(3394, '朝天门街道', 3, 347), +(3395, '石油路街道', 3, 347), +(3396, '菜园坝街道', 3, 347), +(3397, '解放碑街道', 3, 347), +(3398, '九宫庙街道', 3, 348), +(3399, '八桥镇', 3, 348), +(3400, '建胜镇', 3, 348), +(3401, '新山村街道', 3, 348), +(3402, '春晖路街道', 3, 348), +(3403, '茄子溪街道', 3, 348), +(3404, '跃进村街道', 3, 348), +(3405, '跳磴镇', 3, 348), +(3406, '五宝镇', 3, 349), +(3407, '五里店街道', 3, 349), +(3408, '华新街街道', 3, 349), +(3409, '复盛镇', 3, 349), +(3410, '大石坝街道', 3, 349), +(3411, '寸滩街道', 3, 349), +(3412, '江北城街道', 3, 349), +(3413, '石马河街道', 3, 349), +(3414, '观音桥街道', 3, 349), +(3415, '郭家沱街道', 3, 349), +(3416, '铁山坪街道', 3, 349), +(3417, '鱼嘴镇', 3, 349), +(3418, '中梁镇', 3, 350), +(3419, '井口街道', 3, 350), +(3420, '井口镇', 3, 350), +(3421, '凤凰镇', 3, 350), +(3422, '回龙坝镇', 3, 350), +(3423, '土主镇', 3, 350), +(3424, '土湾街道', 3, 350), +(3425, '天星桥街道', 3, 350), +(3426, '小龙坎街道', 3, 350), +(3427, '山洞街道', 3, 350), +(3428, '新桥街道', 3, 350), +(3429, '曾家镇', 3, 350), +(3430, '歌乐山街道', 3, 350), +(3431, '歌乐山镇', 3, 350), +(3432, '沙坪坝街道', 3, 350), +(3433, '渝碚路街道', 3, 350), +(3434, '石井坡街道', 3, 350), +(3435, '磁器口街道', 3, 350), +(3436, '童家桥街道', 3, 350), +(3437, '虎溪镇', 3, 350), +(3438, '西永镇', 3, 350), +(3439, '覃家岗镇', 3, 350), +(3440, '詹家溪街道', 3, 350), +(3441, '陈家桥镇', 3, 350), +(3442, '青木关镇', 3, 350), +(3443, '中梁山街道', 3, 351); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3444, '九龙镇', 3, 351), +(3445, '华岩镇', 3, 351), +(3446, '含谷镇', 3, 351), +(3447, '巴福镇', 3, 351), +(3448, '杨家坪街道', 3, 351), +(3449, '渝州路街道', 3, 351), +(3450, '白市驿镇', 3, 351), +(3451, '石坪桥街道', 3, 351), +(3452, '石板镇', 3, 351), +(3453, '石桥铺街道', 3, 351), +(3454, '西彭镇', 3, 351), +(3455, '谢家湾街道', 3, 351), +(3456, '走马镇', 3, 351), +(3457, '金凤镇', 3, 351), +(3458, '铜罐驿镇', 3, 351), +(3459, '陶家镇', 3, 351), +(3460, '黄桷坪街道', 3, 351), +(3461, '南坪街道', 3, 352), +(3462, '南坪镇', 3, 352), +(3463, '南山街道', 3, 352), +(3464, '峡口镇', 3, 352), +(3465, '广阳镇', 3, 352), +(3466, '弹子石街道', 3, 352), +(3467, '海棠溪街道', 3, 352), +(3468, '涂山镇', 3, 352), +(3469, '花园路街道', 3, 352), +(3470, '迎龙镇', 3, 352), +(3471, '铜元局街道', 3, 352), +(3472, '长生桥镇', 3, 352), +(3473, '鸡冠石镇', 3, 352), +(3474, '龙门浩街道', 3, 352), +(3475, '三圣镇', 3, 353), +(3476, '东阳街道', 3, 353), +(3477, '北温泉街道', 3, 353), +(3478, '复兴镇', 3, 353), +(3479, '天府镇', 3, 353), +(3480, '天生街道', 3, 353), +(3481, '施家梁镇', 3, 353), +(3482, '朝阳街道', 3, 353), +(3483, '柳荫镇', 3, 353), +(3484, '歇马镇', 3, 353), +(3485, '水土镇', 3, 353), +(3486, '澄江镇', 3, 353), +(3487, '童家溪镇', 3, 353), +(3488, '蔡家岗镇', 3, 353), +(3489, '金刀峡镇', 3, 353), +(3490, '静观镇', 3, 353), +(3491, '龙凤桥街道', 3, 353), +(3492, '双路镇', 3, 354), +(3493, '通桥镇', 3, 354), +(3494, '龙滩子街道', 3, 354), +(3495, '万东镇', 3, 355), +(3496, '万盛街道', 3, 355), +(3497, '丛林镇', 3, 355), +(3498, '东林街道', 3, 355), +(3499, '关坝镇', 3, 355), +(3500, '南桐镇', 3, 355), +(3501, '石林镇', 3, 355), +(3502, '金桥镇', 3, 355), +(3503, '青年镇', 3, 355), +(3504, '黑山镇', 3, 355), +(3505, '人和街道', 3, 356), +(3506, '兴隆镇', 3, 356), +(3507, '华蓥山镇', 3, 356), +(3508, '双凤桥街道', 3, 356); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3509, '双龙湖街道', 3, 356), +(3510, '古路镇', 3, 356), +(3511, '回兴街道', 3, 356), +(3512, '大塆镇', 3, 356), +(3513, '大盛镇', 3, 356), +(3514, '大竹林街道', 3, 356), +(3515, '天宫殿街道', 3, 356), +(3516, '张关镇', 3, 356), +(3517, '御临镇', 3, 356), +(3518, '悦来镇', 3, 356), +(3519, '明月镇', 3, 356), +(3520, '木耳镇', 3, 356), +(3521, '洛碛镇', 3, 356), +(3522, '玉峰山镇', 3, 356), +(3523, '王家镇', 3, 356), +(3524, '石坪镇', 3, 356), +(3525, '石船镇', 3, 356), +(3526, '礼嘉镇', 3, 356), +(3527, '统景镇', 3, 356), +(3528, '翠云街道', 3, 356), +(3529, '茨竹', 3, 356), +(3530, '高嘴镇', 3, 356), +(3531, '鸳鸯街道', 3, 356), +(3532, '麻柳沱镇', 3, 356), +(3533, '龙兴镇', 3, 356), +(3534, '龙塔街道', 3, 356), +(3535, '龙山街道', 3, 356), +(3536, '龙溪街道', 3, 356), +(3537, '一品镇', 3, 357), +(3538, '东泉镇', 3, 357), +(3539, '丰盛镇', 3, 357), +(3540, '二圣镇', 3, 357), +(3541, '南彭镇', 3, 357), +(3542, '南泉镇', 3, 357), +(3543, '双河口镇', 3, 357), +(3544, '天星寺镇', 3, 357), +(3545, '姜家镇', 3, 357), +(3546, '安澜镇', 3, 357), +(3547, '惠民镇', 3, 357), +(3548, '接龙镇', 3, 357), +(3549, '木洞镇', 3, 357), +(3550, '李家沱街道', 3, 357), +(3551, '界石镇', 3, 357), +(3552, '石滩镇', 3, 357), +(3553, '石龙镇', 3, 357), +(3554, '花溪镇', 3, 357), +(3555, '跳石镇', 3, 357), +(3556, '鱼洞街道', 3, 357), +(3557, '麻柳嘴镇', 3, 357), +(3558, '两河镇', 3, 358), +(3559, '中塘乡', 3, 358), +(3560, '五里乡', 3, 358), +(3561, '冯家镇', 3, 358), +(3562, '城东街道', 3, 358), +(3563, '城南街道', 3, 358), +(3564, '城西街道', 3, 358), +(3565, '太极乡', 3, 358), +(3566, '小南海镇', 3, 358), +(3567, '新华乡', 3, 358), +(3568, '杉岭乡', 3, 358), +(3569, '正阳镇', 3, 358), +(3570, '水市乡', 3, 358), +(3571, '水田乡', 3, 358), +(3572, '沙坝乡', 3, 358), +(3573, '濯水镇', 3, 358), +(3574, '白土乡', 3, 358), +(3575, '白石乡', 3, 358), +(3576, '石会镇', 3, 358); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3577, '石家镇', 3, 358), +(3578, '舟白镇', 3, 358), +(3579, '蓬东乡', 3, 358), +(3580, '邻鄂镇', 3, 358), +(3581, '金洞乡', 3, 358), +(3582, '金溪镇', 3, 358), +(3583, '马喇镇', 3, 358), +(3584, '鹅池镇', 3, 358), +(3585, '黄溪镇', 3, 358), +(3586, '黎水镇', 3, 358), +(3587, '黑溪镇', 3, 358), +(3588, '万顺镇', 3, 359), +(3589, '云台镇', 3, 359), +(3590, '云集镇', 3, 359), +(3591, '但渡镇', 3, 359), +(3592, '八颗镇', 3, 359), +(3593, '凤城街道', 3, 359), +(3594, '双龙镇', 3, 359), +(3595, '新市镇', 3, 359), +(3596, '晏家街道', 3, 359), +(3597, '江南镇', 3, 359), +(3598, '洪湖镇', 3, 359), +(3599, '海棠镇', 3, 359), +(3600, '渡舟镇', 3, 359), +(3601, '石堰镇', 3, 359), +(3602, '葛兰镇', 3, 359), +(3603, '邻封镇', 3, 359), +(3604, '长寿湖镇', 3, 359), +(3605, '龙河镇', 3, 359), +(3606, '丁山镇', 3, 360), +(3607, '三江镇', 3, 360), +(3608, '三角镇', 3, 360), +(3609, '东溪镇', 3, 360), +(3610, '中峰镇', 3, 360), +(3611, '古南镇', 3, 360), +(3612, '安稳镇', 3, 360), +(3613, '打通镇', 3, 360), +(3614, '扶欢镇', 3, 360), +(3615, '新盛镇', 3, 360), +(3616, '横山镇', 3, 360), +(3617, '永城镇', 3, 360), +(3618, '永新镇', 3, 360), +(3619, '石壕镇', 3, 360), +(3620, '石角镇', 3, 360), +(3621, '篆塘镇', 3, 360), +(3622, '赶水镇', 3, 360), +(3623, '郭扶镇', 3, 360), +(3624, '隆盛镇', 3, 360), +(3625, '上和镇', 3, 361), +(3626, '五桂镇', 3, 361), +(3627, '别口乡', 3, 361), +(3628, '卧佛镇', 3, 361), +(3629, '双江镇', 3, 361), +(3630, '古溪镇', 3, 361), +(3631, '塘坝镇', 3, 361), +(3632, '太安镇', 3, 361), +(3633, '宝龙镇', 3, 361), +(3634, '寿桥乡', 3, 361), +(3635, '小渡镇', 3, 361), +(3636, '崇龛镇', 3, 361), +(3637, '新胜镇', 3, 361), +(3638, '柏梓镇', 3, 361), +(3639, '桂林街道', 3, 361), +(3640, '梓潼街道', 3, 361), +(3641, '玉溪镇', 3, 361), +(3642, '田家乡', 3, 361), +(3643, '米心镇', 3, 361), +(3644, '群力镇', 3, 361), +(3645, '花岩镇', 3, 361), +(3646, '龙形镇', 3, 361); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3647, '东城街道', 3, 362), +(3648, '二坪镇', 3, 362), +(3649, '侣俸镇', 3, 362), +(3650, '华兴镇', 3, 362), +(3651, '南城街道', 3, 362), +(3652, '双山乡', 3, 362), +(3653, '围龙镇', 3, 362), +(3654, '土桥镇', 3, 362), +(3655, '大庙镇', 3, 362), +(3656, '太平镇', 3, 362), +(3657, '安居镇', 3, 362), +(3658, '安溪镇', 3, 362), +(3659, '小林乡', 3, 362), +(3660, '少云镇', 3, 362), +(3661, '巴川街道', 3, 362), +(3662, '平滩镇', 3, 362), +(3663, '庆隆乡', 3, 362), +(3664, '旧县镇', 3, 362), +(3665, '水口镇', 3, 362), +(3666, '永嘉镇', 3, 362), +(3667, '白羊镇', 3, 362), +(3668, '石鱼镇', 3, 362), +(3669, '福果镇', 3, 362), +(3670, '维新镇', 3, 362), +(3671, '蒲吕镇', 3, 362), +(3672, '虎峰镇', 3, 362), +(3673, '西河镇', 3, 362), +(3674, '高楼镇', 3, 362), +(3675, '万古镇', 3, 363), +(3676, '三驱镇', 3, 363), +(3677, '中敖镇', 3, 363), +(3678, '古龙乡', 3, 363), +(3679, '回龙镇', 3, 363), +(3680, '国梁镇', 3, 363), +(3681, '季家镇', 3, 363), +(3682, '宝兴镇', 3, 363), +(3683, '宝顶镇', 3, 363), +(3684, '拾万镇', 3, 363), +(3685, '智凤镇', 3, 363), +(3686, '棠香街道', 3, 363), +(3687, '玉龙镇', 3, 363), +(3688, '珠溪镇', 3, 363), +(3689, '石马镇', 3, 363), +(3690, '邮亭镇', 3, 363), +(3691, '金山镇', 3, 363), +(3692, '铁山镇', 3, 363), +(3693, '雍溪镇', 3, 363), +(3694, '高升场镇', 3, 363), +(3695, '高坪乡', 3, 363), +(3696, '龙岗街道', 3, 363), +(3697, '龙水镇', 3, 363), +(3698, '龙石镇', 3, 363), +(3699, '仁义镇', 3, 364), +(3700, '双河镇', 3, 364), +(3701, '古昌镇', 3, 364), +(3702, '吴家镇', 3, 364), +(3703, '安富镇', 3, 364), +(3704, '峰高镇', 3, 364), +(3705, '广顺镇', 3, 364), +(3706, '昌元镇', 3, 364), +(3707, '河包镇', 3, 364), +(3708, '清升镇', 3, 364), +(3709, '清江镇', 3, 364), +(3710, '清流镇', 3, 364), +(3711, '盘龙镇', 3, 364), +(3712, '直升镇', 3, 364), +(3713, '荣隆镇', 3, 364), +(3714, '观胜镇', 3, 364), +(3715, '路孔镇', 3, 364), +(3716, '远觉镇', 3, 364); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3717, '铜鼓镇', 3, 364), +(3718, '龙集镇', 3, 364), +(3719, '丁家镇', 3, 365), +(3720, '七塘镇', 3, 365), +(3721, '三合镇', 3, 365), +(3722, '健龙乡', 3, 365), +(3723, '八塘镇', 3, 365), +(3724, '大兴镇', 3, 365), +(3725, '大路镇', 3, 365), +(3726, '广普镇', 3, 365), +(3727, '正兴镇', 3, 365), +(3728, '河边镇', 3, 365), +(3729, '璧城街道', 3, 365), +(3730, '福禄镇', 3, 365), +(3731, '青杠街道', 3, 365), +(3732, '七星镇', 3, 366), +(3733, '云龙镇', 3, 366), +(3734, '仁贤镇', 3, 366), +(3735, '合兴镇', 3, 366), +(3736, '和林镇', 3, 366), +(3737, '回龙镇', 3, 366), +(3738, '城东乡', 3, 366), +(3739, '城北乡', 3, 366), +(3740, '复平乡', 3, 366), +(3741, '大观镇', 3, 366), +(3742, '安胜乡', 3, 366), +(3743, '屏锦镇', 3, 366), +(3744, '文化镇', 3, 366), +(3745, '新盛镇', 3, 366), +(3746, '明达镇', 3, 366), +(3747, '曲水乡', 3, 366), +(3748, '柏家镇', 3, 366), +(3749, '梁山镇', 3, 366), +(3750, '石安镇', 3, 366), +(3751, '碧山镇', 3, 366), +(3752, '礼让镇', 3, 366), +(3753, '福禄镇', 3, 366), +(3754, '竹山镇', 3, 366), +(3755, '紫照乡', 3, 366), +(3756, '聚奎镇', 3, 366), +(3757, '荫平镇', 3, 366), +(3758, '虎城镇', 3, 366), +(3759, '蟠龙镇', 3, 366), +(3760, '袁驿镇', 3, 366), +(3761, '金带镇', 3, 366), +(3762, '铁门乡', 3, 366), +(3763, '龙胜乡', 3, 366), +(3764, '龙门镇', 3, 366), +(3765, '东安乡', 3, 367), +(3766, '修齐镇', 3, 367), +(3767, '北屏乡', 3, 367), +(3768, '厚坪乡', 3, 367), +(3769, '双河乡', 3, 367), +(3770, '周溪乡', 3, 367), +(3771, '咸宜乡', 3, 367), +(3772, '坪坝镇', 3, 367), +(3773, '岚天乡', 3, 367), +(3774, '左岚乡', 3, 367), +(3775, '巴山镇', 3, 367), +(3776, '庙坝镇', 3, 367), +(3777, '明中乡', 3, 367), +(3778, '明通镇', 3, 367), +(3779, '河鱼乡', 3, 367), +(3780, '治平乡', 3, 367), +(3781, '沿河乡', 3, 367), +(3782, '葛城镇', 3, 367), +(3783, '蓼子乡', 3, 367), +(3784, '高楠乡', 3, 367), +(3785, '高燕乡', 3, 367), +(3786, '高观镇', 3, 367), +(3787, '鸡鸣乡', 3, 367); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3788, '龙田乡', 3, 367), +(3789, '三元镇', 3, 368), +(3790, '三合镇', 3, 368), +(3791, '三坝乡', 3, 368), +(3792, '三建乡', 3, 368), +(3793, '仁沙乡', 3, 368), +(3794, '保合乡', 3, 368), +(3795, '兴义镇', 3, 368), +(3796, '包鸾镇', 3, 368), +(3797, '十直镇', 3, 368), +(3798, '南天湖镇', 3, 368), +(3799, '双路镇', 3, 368), +(3800, '双龙场乡', 3, 368), +(3801, '名山镇', 3, 368), +(3802, '太平坝乡', 3, 368), +(3803, '崇兴乡', 3, 368), +(3804, '暨龙乡', 3, 368), +(3805, '树人镇', 3, 368), +(3806, '栗子乡', 3, 368), +(3807, '武平镇', 3, 368), +(3808, '江池镇', 3, 368), +(3809, '湛普镇', 3, 368), +(3810, '社坛镇', 3, 368), +(3811, '董家镇', 3, 368), +(3812, '虎威镇', 3, 368), +(3813, '许明寺镇', 3, 368), +(3814, '都督乡', 3, 368), +(3815, '镇江镇', 3, 368), +(3816, '青龙乡', 3, 368), +(3817, '高家镇', 3, 368), +(3818, '龙孔乡', 3, 368), +(3819, '龙河镇', 3, 368), +(3820, '三溪乡', 3, 369), +(3821, '五洞镇', 3, 369), +(3822, '包家乡', 3, 369), +(3823, '周嘉镇', 3, 369), +(3824, '坪山镇', 3, 369), +(3825, '大石乡', 3, 369), +(3826, '太平镇', 3, 369), +(3827, '新民镇', 3, 369), +(3828, '普顺镇', 3, 369), +(3829, '曹回乡', 3, 369), +(3830, '杠家乡', 3, 369), +(3831, '桂溪镇', 3, 369), +(3832, '永安镇', 3, 369), +(3833, '永平乡', 3, 369), +(3834, '沙坪镇', 3, 369), +(3835, '沙河乡', 3, 369), +(3836, '澄溪镇', 3, 369), +(3837, '白家乡', 3, 369), +(3838, '砚台镇', 3, 369), +(3839, '裴兴乡', 3, 369), +(3840, '长龙乡', 3, 369), +(3841, '高安镇', 3, 369), +(3842, '高峰镇', 3, 369), +(3843, '鹤游镇', 3, 369), +(3844, '黄沙乡', 3, 369), +(3845, '仙女山镇', 3, 370), +(3846, '凤来乡', 3, 370), +(3847, '双河乡', 3, 370), +(3848, '后坪乡', 3, 370), +(3849, '和顺乡', 3, 370), +(3850, '土地乡', 3, 370), +(3851, '土坎镇', 3, 370), +(3852, '巷口镇', 3, 370), +(3853, '平桥镇', 3, 370), +(3854, '庙垭乡', 3, 370), +(3855, '接龙乡', 3, 370), +(3856, '文复乡', 3, 370), +(3857, '桐梓镇', 3, 370); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3858, '江口镇', 3, 370), +(3859, '沧沟乡', 3, 370), +(3860, '浩口乡', 3, 370), +(3861, '火炉镇', 3, 370), +(3862, '白云乡', 3, 370), +(3863, '白马镇', 3, 370), +(3864, '石桥乡', 3, 370), +(3865, '羊角镇', 3, 370), +(3866, '赵家乡', 3, 370), +(3867, '铁矿乡', 3, 370), +(3868, '长坝镇', 3, 370), +(3869, '鸭江镇', 3, 370), +(3870, '黄莺乡', 3, 370), +(3871, '三汇镇', 3, 371), +(3872, '东溪镇', 3, 371), +(3873, '乌杨镇', 3, 371), +(3874, '任家镇', 3, 371), +(3875, '兴峰乡', 3, 371), +(3876, '双桂镇', 3, 371), +(3877, '善广乡', 3, 371), +(3878, '复兴镇', 3, 371), +(3879, '官坝镇', 3, 371), +(3880, '忠州镇', 3, 371), +(3881, '拔山镇', 3, 371), +(3882, '新生镇', 3, 371), +(3883, '新立镇', 3, 371), +(3884, '永丰镇', 3, 371), +(3885, '汝溪镇', 3, 371), +(3886, '洋渡镇', 3, 371), +(3887, '涂井乡', 3, 371), +(3888, '白石镇', 3, 371), +(3889, '石子乡', 3, 371), +(3890, '石宝镇', 3, 371), +(3891, '石黄镇', 3, 371), +(3892, '磨子土家族乡', 3, 371), +(3893, '花桥镇', 3, 371), +(3894, '野鹤镇', 3, 371), +(3895, '金声乡', 3, 371), +(3896, '金鸡镇', 3, 371), +(3897, '马灌镇', 3, 371), +(3898, '黄金镇', 3, 371), +(3899, '三汇口乡', 3, 372), +(3900, '中和镇', 3, 372), +(3901, '丰乐街道', 3, 372), +(3902, '临江镇', 3, 372), +(3903, '义和镇', 3, 372), +(3904, '九龙山镇', 3, 372), +(3905, '五通乡', 3, 372), +(3906, '关面乡', 3, 372), +(3907, '南门镇', 3, 372), +(3908, '南雅镇', 3, 372), +(3909, '厚坝镇', 3, 372), +(3910, '和谦镇', 3, 372), +(3911, '大德乡', 3, 372), +(3912, '大进镇', 3, 372), +(3913, '天和乡', 3, 372), +(3914, '岳溪镇', 3, 372), +(3915, '巫山乡', 3, 372), +(3916, '敦好镇', 3, 372), +(3917, '汉丰街道', 3, 372), +(3918, '河堰镇', 3, 372), +(3919, '渠口镇', 3, 372), +(3920, '温泉镇', 3, 372), +(3921, '满月乡', 3, 372), +(3922, '白桥乡', 3, 372), +(3923, '白泉乡', 3, 372), +(3924, '白鹤街道', 3, 372), +(3925, '竹溪镇', 3, 372), +(3926, '紫水乡', 3, 372), +(3927, '谭家乡', 3, 372); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3928, '赵家镇', 3, 372), +(3929, '郭家镇', 3, 372), +(3930, '金峰乡', 3, 372), +(3931, '铁桥镇', 3, 372), +(3932, '镇东街道', 3, 372), +(3933, '镇安镇', 3, 372), +(3934, '长沙镇', 3, 372), +(3935, '高桥镇', 3, 372), +(3936, '麻柳乡', 3, 372), +(3937, '上坝乡', 3, 373), +(3938, '云安镇', 3, 373), +(3939, '云硐乡', 3, 373), +(3940, '云阳镇', 3, 373), +(3941, '人和镇', 3, 373), +(3942, '养鹿乡', 3, 373), +(3943, '农坝镇', 3, 373), +(3944, '凤鸣镇', 3, 373), +(3945, '南溪镇', 3, 373), +(3946, '双土镇', 3, 373), +(3947, '双江街道', 3, 373), +(3948, '双龙乡', 3, 373), +(3949, '后叶乡', 3, 373), +(3950, '堰坪乡', 3, 373), +(3951, '外郎乡', 3, 373), +(3952, '大阳乡', 3, 373), +(3953, '宝坪镇', 3, 373), +(3954, '巴阳镇', 3, 373), +(3955, '平安镇', 3, 373), +(3956, '故陵镇', 3, 373), +(3957, '新津乡', 3, 373), +(3958, '普安乡', 3, 373), +(3959, '栖霞乡', 3, 373), +(3960, '桑坪镇', 3, 373), +(3961, '毛坝乡', 3, 373), +(3962, '水口乡', 3, 373), +(3963, '江口镇', 3, 373), +(3964, '沙市镇', 3, 373), +(3965, '泥溪乡', 3, 373), +(3966, '洞鹿乡', 3, 373), +(3967, '清水土家族乡', 3, 373), +(3968, '渠马镇', 3, 373), +(3969, '盘龙镇', 3, 373), +(3970, '石门乡', 3, 373), +(3971, '票草乡', 3, 373), +(3972, '红狮镇', 3, 373), +(3973, '耀灵乡', 3, 373), +(3974, '路阳镇', 3, 373), +(3975, '青龙街道', 3, 373), +(3976, '高阳镇', 3, 373), +(3977, '鱼泉镇', 3, 373), +(3978, '黄石镇', 3, 373), +(3979, '龙洞乡', 3, 373), +(3980, '龙角镇', 3, 373), +(3981, '云雾土家族乡', 3, 374), +(3982, '五马乡', 3, 374), +(3983, '公平镇', 3, 374), +(3984, '兴隆镇', 3, 374), +(3985, '冯坪乡', 3, 374), +(3986, '吐祥镇', 3, 374), +(3987, '大树镇', 3, 374), +(3988, '太和乡', 3, 374), +(3989, '安坪乡', 3, 374), +(3990, '岩湾乡', 3, 374), +(3991, '平安乡', 3, 374), +(3992, '康乐镇', 3, 374), +(3993, '康坪乡', 3, 374), +(3994, '新政乡', 3, 374), +(3995, '新民镇', 3, 374), +(3996, '朱衣镇', 3, 374), +(3997, '永乐镇', 3, 374); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(3998, '永安镇', 3, 374), +(3999, '汾河镇', 3, 374), +(4000, '甲高镇', 3, 374), +(4001, '白帝镇', 3, 374), +(4002, '石岗乡', 3, 374), +(4003, '竹园镇', 3, 374), +(4004, '红土乡', 3, 374), +(4005, '羊市镇', 3, 374), +(4006, '草堂镇', 3, 374), +(4007, '长安土家族乡', 3, 374), +(4008, '青龙镇', 3, 374), +(4009, '鹤峰乡', 3, 374), +(4010, '龙桥土家族乡', 3, 374), +(4011, '三溪乡', 3, 375), +(4012, '两坪乡', 3, 375), +(4013, '双龙镇', 3, 375), +(4014, '培石乡', 3, 375), +(4015, '大昌镇', 3, 375), +(4016, '大溪乡', 3, 375), +(4017, '官渡镇', 3, 375), +(4018, '官阳镇', 3, 375), +(4019, '巫峡镇', 3, 375), +(4020, '平河乡', 3, 375), +(4021, '庙堂乡', 3, 375), +(4022, '庙宇镇', 3, 375), +(4023, '建平乡', 3, 375), +(4024, '当阳乡', 3, 375), +(4025, '抱龙镇', 3, 375), +(4026, '曲尺乡', 3, 375), +(4027, '福田镇', 3, 375), +(4028, '竹贤乡', 3, 375), +(4029, '笃坪乡', 3, 375), +(4030, '红椿土家族乡', 3, 375), +(4031, '邓家土家族乡', 3, 375), +(4032, '金坪乡', 3, 375), +(4033, '铜鼓镇', 3, 375), +(4034, '骡坪镇', 3, 375), +(4035, '龙井乡', 3, 375), +(4036, '龙溪镇', 3, 375), +(4037, '上磺镇', 3, 376), +(4038, '下堡镇', 3, 376), +(4039, '中岗乡', 3, 376), +(4040, '中梁乡', 3, 376), +(4041, '乌龙乡', 3, 376), +(4042, '兰英乡', 3, 376), +(4043, '凤凰镇', 3, 376), +(4044, '双阳乡', 3, 376), +(4045, '古路镇', 3, 376), +(4046, '土城乡', 3, 376), +(4047, '城厢镇', 3, 376), +(4048, '塘坊乡', 3, 376), +(4049, '大河乡', 3, 376), +(4050, '天元乡', 3, 376), +(4051, '天星乡', 3, 376), +(4052, '宁厂镇', 3, 376), +(4053, '尖山镇', 3, 376), +(4054, '峰灵乡', 3, 376), +(4055, '徐家镇', 3, 376), +(4056, '文峰镇', 3, 376), +(4057, '朝阳洞乡', 3, 376), +(4058, '田坝乡', 3, 376), +(4059, '白鹿镇', 3, 376), +(4060, '胜利乡', 3, 376), +(4061, '花台乡', 3, 376), +(4062, '菱角乡', 3, 376), +(4063, '蒲莲乡', 3, 376), +(4064, '通城乡', 3, 376), +(4065, '长桂乡', 3, 376), +(4066, '鱼鳞乡', 3, 376); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4067, '万朝乡', 3, 377), +(4068, '三星乡', 3, 377), +(4069, '三河乡', 3, 377), +(4070, '三益乡', 3, 377), +(4071, '下路镇', 3, 377), +(4072, '中益乡', 3, 377), +(4073, '临溪镇', 3, 377), +(4074, '六塘乡', 3, 377), +(4075, '冷水乡', 3, 377), +(4076, '南宾镇', 3, 377), +(4077, '大歇乡', 3, 377), +(4078, '悦崃镇', 3, 377), +(4079, '新乐乡', 3, 377), +(4080, '枫木乡', 3, 377), +(4081, '桥头乡', 3, 377), +(4082, '沙子镇', 3, 377), +(4083, '河嘴乡', 3, 377), +(4084, '沿溪镇', 3, 377), +(4085, '洗新乡', 3, 377), +(4086, '渔池镇', 3, 377), +(4087, '王场镇', 3, 377), +(4088, '王家乡', 3, 377), +(4089, '石家乡', 3, 377), +(4090, '西沱镇', 3, 377), +(4091, '金竹乡', 3, 377), +(4092, '金铃乡', 3, 377), +(4093, '马武镇', 3, 377), +(4094, '黄水镇', 3, 377), +(4095, '黄鹤乡', 3, 377), +(4096, '黎场乡', 3, 377), +(4097, '龙沙镇', 3, 377), +(4098, '龙潭乡', 3, 377), +(4099, '中和镇', 3, 378), +(4100, '中平乡', 3, 378), +(4101, '保安乡', 3, 378), +(4102, '兰桥镇', 3, 378), +(4103, '塘坳乡', 3, 378), +(4104, '大溪乡', 3, 378), +(4105, '妙泉乡', 3, 378), +(4106, '孝溪乡', 3, 378), +(4107, '宋农乡', 3, 378), +(4108, '官庄镇', 3, 378), +(4109, '官舟乡', 3, 378), +(4110, '岑溪乡', 3, 378), +(4111, '峨溶镇', 3, 378), +(4112, '巴家乡', 3, 378), +(4113, '干川乡', 3, 378), +(4114, '平凯镇', 3, 378), +(4115, '平马乡', 3, 378), +(4116, '梅江镇', 3, 378), +(4117, '洪安镇', 3, 378), +(4118, '海洋乡', 3, 378), +(4119, '涌洞乡', 3, 378), +(4120, '清溪场镇', 3, 378), +(4121, '溪口乡', 3, 378), +(4122, '溶溪镇', 3, 378), +(4123, '石堤镇', 3, 378), +(4124, '石耶镇', 3, 378), +(4125, '膏田乡', 3, 378), +(4126, '里仁乡', 3, 378), +(4127, '钟灵乡', 3, 378), +(4128, '隘口镇', 3, 378), +(4129, '雅江镇', 3, 378), +(4130, '龙池镇', 3, 378), +(4131, '丁市镇', 3, 379), +(4132, '万木乡', 3, 379), +(4133, '两罾乡', 3, 379), +(4134, '五福乡', 3, 379), +(4135, '偏柏乡', 3, 379), +(4136, '兴隆镇', 3, 379), +(4137, '南腰界乡', 3, 379); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4138, '双泉乡', 3, 379), +(4139, '可大乡', 3, 379), +(4140, '后坪坝乡', 3, 379), +(4141, '后溪镇', 3, 379), +(4142, '大溪镇', 3, 379), +(4143, '天馆乡', 3, 379), +(4144, '官清乡', 3, 379), +(4145, '宜居乡', 3, 379), +(4146, '小河镇', 3, 379), +(4147, '庙溪乡', 3, 379), +(4148, '木叶乡', 3, 379), +(4149, '李溪镇', 3, 379), +(4150, '板桥乡', 3, 379), +(4151, '板溪乡', 3, 379), +(4152, '楠木乡', 3, 379), +(4153, '毛坝乡', 3, 379), +(4154, '江丰乡', 3, 379), +(4155, '泔溪镇', 3, 379), +(4156, '浪坪乡', 3, 379), +(4157, '涂市乡', 3, 379), +(4158, '清泉乡', 3, 379), +(4159, '腴地乡', 3, 379), +(4160, '花田乡', 3, 379), +(4161, '苍岭镇', 3, 379), +(4162, '车田乡', 3, 379), +(4163, '酉酬镇', 3, 379), +(4164, '钟多镇', 3, 379), +(4165, '铜鼓乡', 3, 379), +(4166, '麻旺镇', 3, 379), +(4167, '黑水镇', 3, 379), +(4168, '龙潭镇', 3, 379), +(4169, '龚滩镇', 3, 379), +(4170, '万足乡', 3, 380), +(4171, '三义乡', 3, 380), +(4172, '乔梓乡', 3, 380), +(4173, '保家镇', 3, 380), +(4174, '双龙乡', 3, 380), +(4175, '善感乡', 3, 380), +(4176, '大垭乡', 3, 380), +(4177, '太原乡', 3, 380), +(4178, '小厂乡', 3, 380), +(4179, '岩东乡', 3, 380), +(4180, '平安乡', 3, 380), +(4181, '新田乡', 3, 380), +(4182, '普子镇', 3, 380), +(4183, '朗溪乡', 3, 380), +(4184, '桐楼乡', 3, 380), +(4185, '桑柘镇', 3, 380), +(4186, '梅子垭乡', 3, 380), +(4187, '棣棠乡', 3, 380), +(4188, '汉葭镇', 3, 380), +(4189, '润溪乡', 3, 380), +(4190, '石柳乡', 3, 380), +(4191, '石盘乡', 3, 380), +(4192, '联合乡', 3, 380), +(4193, '芦塘乡', 3, 380), +(4194, '诸佛乡', 3, 380), +(4195, '走马乡', 3, 380), +(4196, '迁乔乡', 3, 380), +(4197, '连湖镇', 3, 380), +(4198, '郁山镇', 3, 380), +(4199, '长滩乡', 3, 380), +(4200, '靛水乡', 3, 380), +(4201, '鞍子乡', 3, 380), +(4202, '高谷镇', 3, 380), +(4203, '鹿角镇', 3, 380), +(4204, '鹿鸣乡', 3, 380), +(4205, '黄家镇', 3, 380), +(4206, '龙塘乡', 3, 380), +(4207, '龙射镇', 3, 380), +(4208, '龙溪乡', 3, 380); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4209, '双流县', 3, 385), +(4210, '大邑县', 3, 385), +(4211, '崇州市', 3, 385), +(4212, '彭州市', 3, 385), +(4213, '成华区', 3, 385), +(4214, '新津县', 3, 385), +(4215, '新都区', 3, 385), +(4216, '武侯区', 3, 385), +(4217, '温江区', 3, 385), +(4218, '蒲江县', 3, 385), +(4219, '邛崃市', 3, 385), +(4220, '郫县', 3, 385), +(4221, '都江堰市', 3, 385), +(4222, '金堂县', 3, 385), +(4223, '金牛区', 3, 385), +(4224, '锦江区', 3, 385), +(4225, '青白江区', 3, 385), +(4226, '青羊区', 3, 385), +(4227, '龙泉驿区', 3, 385), +(4228, '大安区', 3, 386), +(4229, '富顺县', 3, 386), +(4230, '沿滩区', 3, 386), +(4231, '自流井区', 3, 386), +(4232, '荣县', 3, 386), +(4233, '贡井区', 3, 386), +(4234, '东区', 3, 387), +(4235, '仁和区', 3, 387), +(4236, '盐边县', 3, 387), +(4237, '米易县', 3, 387), +(4238, '西区', 3, 387), +(4239, '叙永县', 3, 388), +(4240, '古蔺县', 3, 388), +(4241, '合江县', 3, 388), +(4242, '江阳区', 3, 388), +(4243, '泸县', 3, 388), +(4244, '纳溪区', 3, 388), +(4245, '龙马潭区', 3, 388), +(4246, '中江县', 3, 389), +(4247, '什邡市', 3, 389), +(4248, '广汉市', 3, 389), +(4249, '旌阳区', 3, 389), +(4250, '绵竹市', 3, 389), +(4251, '罗江县', 3, 389), +(4252, '三台县', 3, 390), +(4253, '北川羌族自治县', 3, 390), +(4254, '安县', 3, 390), +(4255, '平武县', 3, 390), +(4256, '梓潼县', 3, 390), +(4257, '江油市', 3, 390), +(4258, '涪城区', 3, 390), +(4259, '游仙区', 3, 390), +(4260, '盐亭县', 3, 390), +(4261, '元坝区', 3, 391), +(4262, '利州区', 3, 391), +(4263, '剑阁县', 3, 391), +(4264, '旺苍县', 3, 391), +(4265, '朝天区', 3, 391), +(4266, '苍溪县', 3, 391), +(4267, '青川县', 3, 391), +(4268, '大英县', 3, 392), +(4269, '安居区', 3, 392), +(4270, '射洪县', 3, 392), +(4271, '船山区', 3, 392), +(4272, '蓬溪县', 3, 392), +(4273, '东兴区', 3, 393), +(4274, '威远县', 3, 393), +(4275, '市中区', 3, 393), +(4276, '资中县', 3, 393), +(4277, '隆昌县', 3, 393), +(4278, '五通桥区', 3, 394); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4279, '井研县', 3, 394), +(4280, '夹江县', 3, 394), +(4281, '峨眉山市', 3, 394), +(4282, '峨边彝族自治县', 3, 394), +(4283, '市中区', 3, 394), +(4284, '沐川县', 3, 394), +(4285, '沙湾区', 3, 394), +(4286, '犍为县', 3, 394), +(4287, '金口河区', 3, 394), +(4288, '马边彝族自治县', 3, 394), +(4289, '仪陇县', 3, 395), +(4290, '南充市嘉陵区', 3, 395), +(4291, '南部县', 3, 395), +(4292, '嘉陵区', 3, 395), +(4293, '营山县', 3, 395), +(4294, '蓬安县', 3, 395), +(4295, '西充县', 3, 395), +(4296, '阆中市', 3, 395), +(4297, '顺庆区', 3, 395), +(4298, '高坪区', 3, 395), +(4299, '东坡区', 3, 396), +(4300, '丹棱县', 3, 396), +(4301, '仁寿县', 3, 396), +(4302, '彭山县', 3, 396), +(4303, '洪雅县', 3, 396), +(4304, '青神县', 3, 396), +(4305, '兴文县', 3, 397), +(4306, '南溪县', 3, 397), +(4307, '宜宾县', 3, 397), +(4308, '屏山县', 3, 397), +(4309, '江安县', 3, 397), +(4310, '珙县', 3, 397), +(4311, '筠连县', 3, 397), +(4312, '翠屏区', 3, 397), +(4313, '长宁县', 3, 397), +(4314, '高县', 3, 397), +(4315, '华蓥市', 3, 398), +(4316, '岳池县', 3, 398), +(4317, '广安区', 3, 398), +(4318, '武胜县', 3, 398), +(4319, '邻水县', 3, 398), +(4320, '万源市', 3, 399), +(4321, '大竹县', 3, 399), +(4322, '宣汉县', 3, 399), +(4323, '开江县', 3, 399), +(4324, '渠县', 3, 399), +(4325, '达县', 3, 399), +(4326, '通川区', 3, 399), +(4327, '名山县', 3, 400), +(4328, '天全县', 3, 400), +(4329, '宝兴县', 3, 400), +(4330, '汉源县', 3, 400), +(4331, '石棉县', 3, 400), +(4332, '芦山县', 3, 400), +(4333, '荥经县', 3, 400), +(4334, '雨城区', 3, 400), +(4335, '南江县', 3, 401), +(4336, '巴州区', 3, 401), +(4337, '平昌县', 3, 401), +(4338, '通江县', 3, 401), +(4339, '乐至县', 3, 402), +(4340, '安岳县', 3, 402), +(4341, '简阳市', 3, 402), +(4342, '雁江区', 3, 402), +(4343, '九寨沟县', 3, 403), +(4344, '壤塘县', 3, 403), +(4345, '小金县', 3, 403), +(4346, '松潘县', 3, 403), +(4347, '汶川县', 3, 403), +(4348, '理县', 3, 403); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4349, '红原县', 3, 403), +(4350, '若尔盖县', 3, 403), +(4351, '茂县', 3, 403), +(4352, '金川县', 3, 403), +(4353, '阿坝县', 3, 403), +(4354, '马尔康县', 3, 403), +(4355, '黑水县', 3, 403), +(4356, '丹巴县', 3, 404), +(4357, '乡城县', 3, 404), +(4358, '巴塘县', 3, 404), +(4359, '康定县', 3, 404), +(4360, '得荣县', 3, 404), +(4361, '德格县', 3, 404), +(4362, '新龙县', 3, 404), +(4363, '泸定县', 3, 404), +(4364, '炉霍县', 3, 404), +(4365, '理塘县', 3, 404), +(4366, '甘孜县', 3, 404), +(4367, '白玉县', 3, 404), +(4368, '石渠县', 3, 404), +(4369, '稻城县', 3, 404), +(4370, '色达县', 3, 404), +(4371, '道孚县', 3, 404), +(4372, '雅江县', 3, 404), +(4373, '会东县', 3, 405), +(4374, '会理县', 3, 405), +(4375, '冕宁县', 3, 405), +(4376, '喜德县', 3, 405), +(4377, '宁南县', 3, 405), +(4378, '布拖县', 3, 405), +(4379, '德昌县', 3, 405), +(4380, '昭觉县', 3, 405), +(4381, '普格县', 3, 405), +(4382, '木里藏族自治县', 3, 405), +(4383, '甘洛县', 3, 405), +(4384, '盐源县', 3, 405), +(4385, '美姑县', 3, 405), +(4386, '西昌', 3, 405), +(4387, '越西县', 3, 405), +(4388, '金阳县', 3, 405), +(4389, '雷波县', 3, 405), +(4390, '乌当区', 3, 406), +(4391, '云岩区', 3, 406), +(4392, '修文县', 3, 406), +(4393, '南明区', 3, 406), +(4394, '小河区', 3, 406), +(4395, '开阳县', 3, 406), +(4396, '息烽县', 3, 406), +(4397, '清镇市', 3, 406), +(4398, '白云区', 3, 406), +(4399, '花溪区', 3, 406), +(4400, '六枝特区', 3, 407), +(4401, '水城县', 3, 407), +(4402, '盘县', 3, 407), +(4403, '钟山区', 3, 407), +(4404, '习水县', 3, 408), +(4405, '仁怀市', 3, 408), +(4406, '余庆县', 3, 408), +(4407, '凤冈县', 3, 408), +(4408, '务川仡佬族苗族自治县', 3, 408), +(4409, '桐梓县', 3, 408), +(4410, '正安县', 3, 408), +(4411, '汇川区', 3, 408), +(4412, '湄潭县', 3, 408), +(4413, '红花岗区', 3, 408), +(4414, '绥阳县', 3, 408), +(4415, '赤水市', 3, 408), +(4416, '道真仡佬族苗族自治县', 3, 408), +(4417, '遵义县', 3, 408); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4418, '关岭布依族苗族自治县', 3, 409), +(4419, '平坝县', 3, 409), +(4420, '普定县', 3, 409), +(4421, '紫云苗族布依族自治县', 3, 409), +(4422, '西秀区', 3, 409), +(4423, '镇宁布依族苗族自治县', 3, 409), +(4424, '万山特区', 3, 410), +(4425, '印江土家族苗族自治县', 3, 410), +(4426, '德江县', 3, 410), +(4427, '思南县', 3, 410), +(4428, '松桃苗族自治县', 3, 410), +(4429, '江口县', 3, 410), +(4430, '沿河土家族自治县', 3, 410), +(4431, '玉屏侗族自治县', 3, 410), +(4432, '石阡县', 3, 410), +(4433, '铜仁市', 3, 410), +(4434, '兴义市', 3, 411), +(4435, '兴仁县', 3, 411), +(4436, '册亨县', 3, 411), +(4437, '安龙县', 3, 411), +(4438, '普安县', 3, 411), +(4439, '晴隆县', 3, 411), +(4440, '望谟县', 3, 411), +(4441, '贞丰县', 3, 411), +(4442, '大方县', 3, 412), +(4443, '威宁彝族回族苗族自治县', 3, 412), +(4444, '毕节市', 3, 412), +(4445, '纳雍县', 3, 412), +(4446, '织金县', 3, 412), +(4447, '赫章县', 3, 412), +(4448, '金沙县', 3, 412), +(4449, '黔西县', 3, 412), +(4450, '三穗县', 3, 413), +(4451, '丹寨县', 3, 413), +(4452, '从江县', 3, 413), +(4453, '凯里市', 3, 413), +(4454, '剑河县', 3, 413), +(4455, '台江县', 3, 413), +(4456, '天柱县', 3, 413), +(4457, '岑巩县', 3, 413), +(4458, '施秉县', 3, 413), +(4459, '榕江县', 3, 413), +(4460, '锦屏县', 3, 413), +(4461, '镇远县', 3, 413), +(4462, '雷山县', 3, 413), +(4463, '麻江县', 3, 413), +(4464, '黄平县', 3, 413), +(4465, '黎平县', 3, 413), +(4466, '三都水族自治县', 3, 414), +(4467, '平塘县', 3, 414), +(4468, '惠水县', 3, 414), +(4469, '独山县', 3, 414), +(4470, '瓮安县', 3, 414), +(4471, '福泉市', 3, 414), +(4472, '罗甸县', 3, 414), +(4473, '荔波县', 3, 414), +(4474, '贵定县', 3, 414), +(4475, '都匀市', 3, 414), +(4476, '长顺县', 3, 414), +(4477, '龙里县', 3, 414), +(4478, '东川区', 3, 415), +(4479, '五华区', 3, 415), +(4480, '呈贡县', 3, 415), +(4481, '安宁市', 3, 415), +(4482, '官渡区', 3, 415); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4483, '宜良县', 3, 415), +(4484, '富民县', 3, 415), +(4485, '寻甸回族彝族自治县', 3, 415), +(4486, '嵩明县', 3, 415), +(4487, '晋宁县', 3, 415), +(4488, '盘龙区', 3, 415), +(4489, '石林彝族自治县', 3, 415), +(4490, '禄劝彝族苗族自治县', 3, 415), +(4491, '西山区', 3, 415), +(4492, '会泽县', 3, 416), +(4493, '宣威市', 3, 416), +(4494, '富源县', 3, 416), +(4495, '师宗县', 3, 416), +(4496, '沾益县', 3, 416), +(4497, '罗平县', 3, 416), +(4498, '陆良县', 3, 416), +(4499, '马龙县', 3, 416), +(4500, '麒麟区', 3, 416), +(4501, '元江哈尼族彝族傣族自治县', 3, 417), +(4502, '华宁县', 3, 417), +(4503, '峨山彝族自治县', 3, 417), +(4504, '新平彝族傣族自治县', 3, 417), +(4505, '易门县', 3, 417), +(4506, '江川县', 3, 417), +(4507, '澄江县', 3, 417), +(4508, '红塔区', 3, 417), +(4509, '通海县', 3, 417), +(4510, '施甸县', 3, 418), +(4511, '昌宁县', 3, 418), +(4512, '腾冲县', 3, 418), +(4513, '隆阳区', 3, 418), +(4514, '龙陵县', 3, 418), +(4515, '大关县', 3, 419), +(4516, '威信县', 3, 419), +(4517, '巧家县', 3, 419), +(4518, '彝良县', 3, 419), +(4519, '昭阳区', 3, 419), +(4520, '水富县', 3, 419), +(4521, '永善县', 3, 419), +(4522, '盐津县', 3, 419), +(4523, '绥江县', 3, 419), +(4524, '镇雄县', 3, 419), +(4525, '鲁甸县', 3, 419), +(4526, '华坪县', 3, 420), +(4527, '古城区', 3, 420), +(4528, '宁蒗彝族自治县', 3, 420), +(4529, '永胜县', 3, 420), +(4530, '玉龙纳西族自治县', 3, 420), +(4531, '临翔区', 3, 422), +(4532, '云县', 3, 422), +(4533, '凤庆县', 3, 422), +(4534, '双江拉祜族佤族布朗族傣族自治县', 3, 422), +(4535, '永德县', 3, 422), +(4536, '沧源佤族自治县', 3, 422), +(4537, '耿马傣族佤族自治县', 3, 422), +(4538, '镇康县', 3, 422), +(4539, '元谋县', 3, 423), +(4540, '南华县', 3, 423), +(4541, '双柏县', 3, 423), +(4542, '大姚县', 3, 423), +(4543, '姚安县', 3, 423), +(4544, '楚雄市', 3, 423), +(4545, '武定县', 3, 423), +(4546, '永仁县', 3, 423); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4547, '牟定县', 3, 423), +(4548, '禄丰县', 3, 423), +(4549, '个旧市', 3, 424), +(4550, '元阳县', 3, 424), +(4551, '屏边苗族自治县', 3, 424), +(4552, '建水县', 3, 424), +(4553, '开远市', 3, 424), +(4554, '弥勒县', 3, 424), +(4555, '河口瑶族自治县', 3, 424), +(4556, '泸西县', 3, 424), +(4557, '石屏县', 3, 424), +(4558, '红河县', 3, 424), +(4559, '绿春县', 3, 424), +(4560, '蒙自县', 3, 424), +(4561, '金平苗族瑶族傣族自治县', 3, 424), +(4562, '丘北县', 3, 425), +(4563, '富宁县', 3, 425), +(4564, '广南县', 3, 425), +(4565, '文山县', 3, 425), +(4566, '砚山县', 3, 425), +(4567, '西畴县', 3, 425), +(4568, '马关县', 3, 425), +(4569, '麻栗坡县', 3, 425), +(4570, '勐海县', 3, 426), +(4571, '勐腊县', 3, 426), +(4572, '景洪市', 3, 426), +(4573, '云龙县', 3, 427), +(4574, '剑川县', 3, 427), +(4575, '南涧彝族自治县', 3, 427), +(4576, '大理市', 3, 427), +(4577, '宾川县', 3, 427), +(4578, '巍山彝族回族自治县', 3, 427), +(4579, '弥渡县', 3, 427), +(4580, '永平县', 3, 427), +(4581, '洱源县', 3, 427), +(4582, '漾濞彝族自治县', 3, 427), +(4583, '祥云县', 3, 427), +(4584, '鹤庆县', 3, 427), +(4585, '梁河县', 3, 428), +(4586, '潞西市', 3, 428), +(4587, '瑞丽市', 3, 428), +(4588, '盈江县', 3, 428), +(4589, '陇川县', 3, 428), +(4590, '德钦县', 3, 430), +(4591, '维西傈僳族自治县', 3, 430), +(4592, '香格里拉县', 3, 430), +(4593, '城关区', 3, 431), +(4594, '堆龙德庆县', 3, 431), +(4595, '墨竹工卡县', 3, 431), +(4596, '尼木县', 3, 431), +(4597, '当雄县', 3, 431), +(4598, '曲水县', 3, 431), +(4599, '林周县', 3, 431), +(4600, '达孜县', 3, 431), +(4601, '丁青县', 3, 432), +(4602, '八宿县', 3, 432), +(4603, '察雅县', 3, 432), +(4604, '左贡县', 3, 432), +(4605, '昌都县', 3, 432), +(4606, '江达县', 3, 432), +(4607, '洛隆县', 3, 432), +(4608, '类乌齐县', 3, 432), +(4609, '芒康县', 3, 432), +(4610, '贡觉县', 3, 432), +(4611, '边坝县', 3, 432), +(4612, '乃东县', 3, 433); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4613, '加查县', 3, 433), +(4614, '扎囊县', 3, 433), +(4615, '措美县', 3, 433), +(4616, '曲松县', 3, 433), +(4617, '桑日县', 3, 433), +(4618, '洛扎县', 3, 433), +(4619, '浪卡子县', 3, 433), +(4620, '琼结县', 3, 433), +(4621, '贡嘎县', 3, 433), +(4622, '错那县', 3, 433), +(4623, '隆子县', 3, 433), +(4624, '亚东县', 3, 434), +(4625, '仁布县', 3, 434), +(4626, '仲巴县', 3, 434), +(4627, '南木林县', 3, 434), +(4628, '吉隆县', 3, 434), +(4629, '定日县', 3, 434), +(4630, '定结县', 3, 434), +(4631, '岗巴县', 3, 434), +(4632, '康马县', 3, 434), +(4633, '拉孜县', 3, 434), +(4634, '日喀则市', 3, 434), +(4635, '昂仁县', 3, 434), +(4636, '江孜县', 3, 434), +(4637, '白朗县', 3, 434), +(4638, '聂拉木县', 3, 434), +(4639, '萨嘎县', 3, 434), +(4640, '萨迦县', 3, 434), +(4641, '谢通门县', 3, 434), +(4642, '嘉黎县', 3, 435), +(4643, '安多县', 3, 435), +(4644, '尼玛县', 3, 435), +(4645, '巴青县', 3, 435), +(4646, '比如县', 3, 435), +(4647, '班戈县', 3, 435), +(4648, '申扎县', 3, 435), +(4649, '索县', 3, 435), +(4650, '聂荣县', 3, 435), +(4651, '那曲县', 3, 435), +(4652, '噶尔县', 3, 436), +(4653, '措勤县', 3, 436), +(4654, '改则县', 3, 436), +(4655, '日土县', 3, 436), +(4656, '普兰县', 3, 436), +(4657, '札达县', 3, 436), +(4658, '革吉县', 3, 436), +(4659, '墨脱县', 3, 437), +(4660, '察隅县', 3, 437), +(4661, '工布江达县', 3, 437), +(4662, '朗县', 3, 437), +(4663, '林芝县', 3, 437), +(4664, '波密县', 3, 437), +(4665, '米林县', 3, 437), +(4666, '临潼区', 3, 438), +(4667, '周至县', 3, 438), +(4668, '户县', 3, 438), +(4669, '新城区', 3, 438), +(4670, '未央区', 3, 438), +(4671, '灞桥区', 3, 438), +(4672, '碑林区', 3, 438), +(4673, '莲湖区', 3, 438), +(4674, '蓝田县', 3, 438), +(4675, '长安区', 3, 438), +(4676, '阎良区', 3, 438), +(4677, '雁塔区', 3, 438), +(4678, '高陵县', 3, 438), +(4679, '印台区', 3, 439), +(4680, '宜君县', 3, 439), +(4681, '王益区', 3, 439), +(4682, '耀州区', 3, 439), +(4683, '凤县', 3, 440); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4684, '凤翔县', 3, 440), +(4685, '千阳县', 3, 440), +(4686, '太白县', 3, 440), +(4687, '岐山县', 3, 440), +(4688, '扶风县', 3, 440), +(4689, '渭滨区', 3, 440), +(4690, '眉县', 3, 440), +(4691, '金台区', 3, 440), +(4692, '陇县', 3, 440), +(4693, '陈仓区', 3, 440), +(4694, '麟游县', 3, 440), +(4695, '三原县', 3, 441), +(4696, '干县', 3, 441), +(4697, '兴平市', 3, 441), +(4698, '彬县', 3, 441), +(4699, '旬邑县', 3, 441), +(4700, '杨陵区', 3, 441), +(4701, '武功县', 3, 441), +(4702, '永寿县', 3, 441), +(4703, '泾阳县', 3, 441), +(4704, '淳化县', 3, 441), +(4705, '渭城区', 3, 441), +(4706, '礼泉县', 3, 441), +(4707, '秦都区', 3, 441), +(4708, '长武县', 3, 441), +(4709, '临渭区', 3, 442), +(4710, '华县', 3, 442), +(4711, '华阴市', 3, 442), +(4712, '合阳县', 3, 442), +(4713, '大荔县', 3, 442), +(4714, '富平县', 3, 442), +(4715, '潼关县', 3, 442), +(4716, '澄城县', 3, 442), +(4717, '白水县', 3, 442), +(4718, '蒲城县', 3, 442), +(4719, '韩城市', 3, 442), +(4720, '吴起县', 3, 443), +(4721, '子长县', 3, 443), +(4722, '安塞县', 3, 443), +(4723, '宜川县', 3, 443), +(4724, '宝塔区', 3, 443), +(4725, '富县', 3, 443), +(4726, '延川县', 3, 443), +(4727, '延长县', 3, 443), +(4728, '志丹县', 3, 443), +(4729, '洛川县', 3, 443), +(4730, '甘泉县', 3, 443), +(4731, '黄陵县', 3, 443), +(4732, '黄龙县', 3, 443), +(4733, '佛坪县', 3, 444), +(4734, '勉县', 3, 444), +(4735, '南郑县', 3, 444), +(4736, '城固县', 3, 444), +(4737, '宁强县', 3, 444), +(4738, '汉台区', 3, 444), +(4739, '洋县', 3, 444), +(4740, '留坝县', 3, 444), +(4741, '略阳县', 3, 444), +(4742, '西乡县', 3, 444), +(4743, '镇巴县', 3, 444), +(4744, '佳县', 3, 445), +(4745, '吴堡县', 3, 445), +(4746, '子洲县', 3, 445), +(4747, '定边县', 3, 445), +(4748, '府谷县', 3, 445), +(4749, '榆林市榆阳区', 3, 445), +(4750, '横山县', 3, 445), +(4751, '清涧县', 3, 445), +(4752, '神木县', 3, 445), +(4753, '米脂县', 3, 445), +(4754, '绥德县', 3, 445), +(4755, '靖边县', 3, 445); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4756, '宁陕县', 3, 446), +(4757, '岚皋县', 3, 446), +(4758, '平利县', 3, 446), +(4759, '旬阳县', 3, 446), +(4760, '汉滨区', 3, 446), +(4761, '汉阴县', 3, 446), +(4762, '白河县', 3, 446), +(4763, '石泉县', 3, 446), +(4764, '紫阳县', 3, 446), +(4765, '镇坪县', 3, 446), +(4766, '丹凤县', 3, 447), +(4767, '商南县', 3, 447), +(4768, '商州区', 3, 447), +(4769, '山阳县', 3, 447), +(4770, '柞水县', 3, 447), +(4771, '洛南县', 3, 447), +(4772, '镇安县', 3, 447), +(4773, '七里河区', 3, 448), +(4774, '城关区', 3, 448), +(4775, '安宁区', 3, 448), +(4776, '榆中县', 3, 448), +(4777, '永登县', 3, 448), +(4778, '皋兰县', 3, 448), +(4779, '红古区', 3, 448), +(4780, '西固区', 3, 448), +(4781, '嘉峪关市', 3, 449), +(4782, '永昌县', 3, 450), +(4783, '金川区', 3, 450), +(4784, '会宁县', 3, 451), +(4785, '平川区', 3, 451), +(4786, '景泰县', 3, 451), +(4787, '白银区', 3, 451), +(4788, '靖远县', 3, 451), +(4789, '张家川回族自治县', 3, 452), +(4790, '武山县', 3, 452), +(4791, '清水县', 3, 452), +(4792, '甘谷县', 3, 452), +(4793, '秦安县', 3, 452), +(4794, '秦州区', 3, 452), +(4795, '麦积区', 3, 452), +(4796, '凉州区', 3, 453), +(4797, '古浪县', 3, 453), +(4798, '天祝藏族自治县', 3, 453), +(4799, '民勤县', 3, 453), +(4800, '临泽县', 3, 454), +(4801, '山丹县', 3, 454), +(4802, '民乐县', 3, 454), +(4803, '甘州区', 3, 454), +(4804, '肃南裕固族自治县', 3, 454), +(4805, '高台县', 3, 454), +(4806, '华亭县', 3, 455), +(4807, '崆峒区', 3, 455), +(4808, '崇信县', 3, 455), +(4809, '庄浪县', 3, 455), +(4810, '泾川县', 3, 455), +(4811, '灵台县', 3, 455), +(4812, '静宁县', 3, 455), +(4813, '敦煌市', 3, 456), +(4814, '玉门市', 3, 456), +(4815, '瓜州县(原安西县)', 3, 456), +(4816, '肃北蒙古族自治县', 3, 456), +(4817, '肃州区', 3, 456), +(4818, '金塔县', 3, 456), +(4819, '阿克塞哈萨克族自治县', 3, 456), +(4820, '华池县', 3, 457), +(4821, '合水县', 3, 457), +(4822, '宁县', 3, 457); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4823, '庆城县', 3, 457), +(4824, '正宁县', 3, 457), +(4825, '环县', 3, 457), +(4826, '西峰区', 3, 457), +(4827, '镇原县', 3, 457), +(4828, '临洮县', 3, 458), +(4829, '安定区', 3, 458), +(4830, '岷县', 3, 458), +(4831, '渭源县', 3, 458), +(4832, '漳县', 3, 458), +(4833, '通渭县', 3, 458), +(4834, '陇西县', 3, 458), +(4835, '两当县', 3, 459), +(4836, '宕昌县', 3, 459), +(4837, '康县', 3, 459), +(4838, '徽县', 3, 459), +(4839, '成县', 3, 459), +(4840, '文县', 3, 459), +(4841, '武都区', 3, 459), +(4842, '礼县', 3, 459), +(4843, '西和县', 3, 459), +(4844, '东乡族自治县', 3, 460), +(4845, '临夏县', 3, 460), +(4846, '临夏市', 3, 460), +(4847, '和政县', 3, 460), +(4848, '广河县', 3, 460), +(4849, '康乐县', 3, 460), +(4850, '永靖县', 3, 460), +(4851, '积石山保安族东乡族撒拉族自治县', 3, 460), +(4852, '临潭县', 3, 461), +(4853, '卓尼县', 3, 461), +(4854, '合作市', 3, 461), +(4855, '夏河县', 3, 461), +(4856, '玛曲县', 3, 461), +(4857, '碌曲县', 3, 461), +(4858, '舟曲县', 3, 461), +(4859, '迭部县', 3, 461), +(4860, '城东区', 3, 462), +(4861, '城中区', 3, 462), +(4862, '城北区', 3, 462), +(4863, '城西区', 3, 462), +(4864, '大通回族土族自治县', 3, 462), +(4865, '湟中县', 3, 462), +(4866, '湟源县', 3, 462), +(4867, '乐都县', 3, 463), +(4868, '互助土族自治县', 3, 463), +(4869, '化隆回族自治县', 3, 463), +(4870, '平安县', 3, 463), +(4871, '循化撒拉族自治县', 3, 463), +(4872, '民和回族土族自治县', 3, 463), +(4873, '刚察县', 3, 464), +(4874, '海晏县', 3, 464), +(4875, '祁连县', 3, 464), +(4876, '门源回族自治县', 3, 464), +(4877, '同仁县', 3, 465), +(4878, '尖扎县', 3, 465), +(4879, '河南蒙古族自治县', 3, 465), +(4880, '泽库县', 3, 465), +(4881, '共和县', 3, 466), +(4882, '兴海县', 3, 466), +(4883, '同德县', 3, 466), +(4884, '贵南县', 3, 466), +(4885, '贵德县', 3, 466), +(4886, '久治县', 3, 467), +(4887, '玛多县', 3, 467), +(4888, '玛沁县', 3, 467); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4889, '班玛县', 3, 467), +(4890, '甘德县', 3, 467), +(4891, '达日县', 3, 467), +(4892, '囊谦县', 3, 468), +(4893, '曲麻莱县', 3, 468), +(4894, '杂多县', 3, 468), +(4895, '治多县', 3, 468), +(4896, '玉树县', 3, 468), +(4897, '称多县', 3, 468), +(4898, '乌兰县', 3, 469), +(4899, '冷湖行委', 3, 469), +(4900, '大柴旦行委', 3, 469), +(4901, '天峻县', 3, 469), +(4902, '德令哈市', 3, 469), +(4903, '格尔木市', 3, 469), +(4904, '茫崖行委', 3, 469), +(4905, '都兰县', 3, 469), +(4906, '兴庆区', 3, 470), +(4907, '永宁县', 3, 470), +(4908, '灵武市', 3, 470), +(4909, '西夏区', 3, 470), +(4910, '贺兰县', 3, 470), +(4911, '金凤区', 3, 470), +(4912, '大武口区', 3, 471), +(4913, '平罗县', 3, 471), +(4914, '惠农区', 3, 471), +(4915, '利通区', 3, 472), +(4916, '同心县', 3, 472), +(4917, '盐池县', 3, 472), +(4918, '青铜峡市', 3, 472), +(4919, '原州区', 3, 473), +(4920, '彭阳县', 3, 473), +(4921, '泾源县', 3, 473), +(4922, '西吉县', 3, 473), +(4923, '隆德县', 3, 473), +(4924, '中宁县', 3, 474), +(4925, '沙坡头区', 3, 474), +(4926, '海原县', 3, 474), +(4927, '东山区', 3, 475), +(4928, '乌鲁木齐县', 3, 475), +(4929, '天山区', 3, 475), +(4930, '头屯河区', 3, 475), +(4931, '新市区', 3, 475), +(4932, '水磨沟区', 3, 475), +(4933, '沙依巴克区', 3, 475), +(4934, '达坂城区', 3, 475), +(4935, '乌尔禾区', 3, 476), +(4936, '克拉玛依区', 3, 476), +(4937, '独山子区', 3, 476), +(4938, '白碱滩区', 3, 476), +(4939, '吐鲁番市', 3, 477), +(4940, '托克逊县', 3, 477), +(4941, '鄯善县', 3, 477), +(4942, '伊吾县', 3, 478), +(4943, '哈密市', 3, 478), +(4944, '巴里坤哈萨克自治县', 3, 478), +(4945, '吉木萨尔县', 3, 479), +(4946, '呼图壁县', 3, 479), +(4947, '奇台县', 3, 479), +(4948, '昌吉市', 3, 479), +(4949, '木垒哈萨克自治县', 3, 479), +(4950, '玛纳斯县', 3, 479), +(4951, '米泉市', 3, 479), +(4952, '阜康市', 3, 479), +(4953, '博乐市', 3, 480), +(4954, '温泉县', 3, 480), +(4955, '精河县', 3, 480); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(4956, '博湖县', 3, 481), +(4957, '和硕县', 3, 481), +(4958, '和静县', 3, 481), +(4959, '尉犁县', 3, 481), +(4960, '库尔勒市', 3, 481), +(4961, '焉耆回族自治县', 3, 481), +(4962, '若羌县', 3, 481), +(4963, '轮台县', 3, 481), +(4964, '乌什县', 3, 482), +(4965, '库车县', 3, 482), +(4966, '拜城县', 3, 482), +(4967, '新和县', 3, 482), +(4968, '柯坪县', 3, 482), +(4969, '沙雅县', 3, 482), +(4970, '温宿县', 3, 482), +(4971, '阿克苏市', 3, 482), +(4972, '阿瓦提县', 3, 482), +(4973, '乌恰县', 3, 483), +(4974, '阿克陶县', 3, 483), +(4975, '阿合奇县', 3, 483), +(4976, '阿图什市', 3, 483), +(4977, '伽师县', 3, 484), +(4978, '叶城县', 3, 484), +(4979, '喀什市', 3, 484), +(4980, '塔什库尔干塔吉克自治县', 3, 484), +(4981, '岳普湖县', 3, 484), +(4982, '巴楚县', 3, 484), +(4983, '泽普县', 3, 484), +(4984, '疏勒县', 3, 484), +(4985, '疏附县', 3, 484), +(4986, '英吉沙县', 3, 484), +(4987, '莎车县', 3, 484), +(4988, '麦盖提县', 3, 484), +(4989, '于田县', 3, 485), +(4990, '和田县', 3, 485), +(4991, '和田市', 3, 485), +(4992, '墨玉县', 3, 485), +(4993, '民丰县', 3, 485), +(4994, '洛浦县', 3, 485), +(4995, '皮山县', 3, 485), +(4996, '策勒县', 3, 485), +(4997, '伊宁县', 3, 486), +(4998, '伊宁市', 3, 486), +(4999, '奎屯市', 3, 486), +(5000, '察布查尔锡伯自治县', 3, 486), +(5001, '尼勒克县', 3, 486), +(5002, '巩留县', 3, 486), +(5003, '新源县', 3, 486), +(5004, '昭苏县', 3, 486), +(5005, '特克斯县', 3, 486), +(5006, '霍城县', 3, 486), +(5007, '乌苏市', 3, 487), +(5008, '和布克赛尔蒙古自治县', 3, 487), +(5009, '塔城市', 3, 487), +(5010, '托里县', 3, 487), +(5011, '沙湾县', 3, 487), +(5012, '裕民县', 3, 487), +(5013, '额敏县', 3, 487), +(5014, '吉木乃县', 3, 488), +(5015, '哈巴河县', 3, 488), +(5016, '富蕴县', 3, 488), +(5017, '布尔津县', 3, 488), +(5018, '福海县', 3, 488), +(5019, '阿勒泰市', 3, 488), +(5020, '青河县', 3, 488), +(5021, '石河子市', 3, 489); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5022, '阿拉尔市', 3, 490), +(5023, '图木舒克市', 3, 491), +(5024, '五家渠市', 3, 492), +(5025, '上安镇', 4, 1126), +(5026, '于家乡', 4, 1126), +(5027, '北正乡', 4, 1126), +(5028, '南峪镇', 4, 1126), +(5029, '南王庄乡', 4, 1126), +(5030, '南陉乡', 4, 1126), +(5031, '南障城镇', 4, 1126), +(5032, '吴家窑乡', 4, 1126), +(5033, '天长镇', 4, 1126), +(5034, '威州镇', 4, 1126), +(5035, '孙庄乡', 4, 1126), +(5036, '小作镇', 4, 1126), +(5037, '微水镇', 4, 1126), +(5038, '测鱼镇', 4, 1126), +(5039, '秀林镇', 4, 1126), +(5040, '苍岩山镇', 4, 1126), +(5041, '辛庄乡', 4, 1126), +(5042, '凤山镇', 4, 1127), +(5043, '四微街道', 4, 1127), +(5044, '横涧乡', 4, 1127), +(5045, '矿市街道', 4, 1127), +(5046, '贾庄镇', 4, 1127), +(5047, '东张乡', 4, 1128), +(5048, '前仙乡', 4, 1128), +(5049, '北正乡', 4, 1128), +(5050, '北褚乡', 4, 1128), +(5051, '南佐镇', 4, 1128), +(5052, '南因镇', 4, 1128), +(5053, '姬村镇', 4, 1128), +(5054, '宋曹镇', 4, 1128), +(5055, '槐阳镇', 4, 1128), +(5056, '殷村镇', 4, 1128), +(5057, '苏村乡', 4, 1128), +(5058, '苏阳乡', 4, 1128), +(5059, '赵同乡', 4, 1128), +(5060, '马村乡', 4, 1128), +(5061, '黑水河乡', 4, 1128), +(5062, '上三汲乡', 4, 1129), +(5063, '上观音堂乡', 4, 1129), +(5064, '下口镇', 4, 1129), +(5065, '下槐镇', 4, 1129), +(5066, '东回舍镇', 4, 1129), +(5067, '东王坡乡', 4, 1129), +(5068, '两河乡', 4, 1129), +(5069, '北冶乡', 4, 1129), +(5070, '南甸镇', 4, 1129), +(5071, '古月镇', 4, 1129), +(5072, '合河口乡', 4, 1129), +(5073, '孟家庄镇', 4, 1129), +(5074, '宅北乡', 4, 1129), +(5075, '小觉镇', 4, 1129), +(5076, '岗南镇', 4, 1129), +(5077, '平山镇', 4, 1129), +(5078, '杨家桥乡', 4, 1129), +(5079, '温塘镇', 4, 1129), +(5080, '苏家庄乡', 4, 1129), +(5081, '营里乡', 4, 1129), +(5082, '蛟潭庄镇', 4, 1129), +(5083, '西大吾乡', 4, 1129), +(5084, '西柏坡镇', 4, 1129), +(5085, '东王镇', 4, 1130), +(5086, '化皮镇', 4, 1130), +(5087, '协神乡', 4, 1130); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5088, '南大岳镇', 4, 1130), +(5089, '彭家庄回族乡', 4, 1130), +(5090, '承安镇', 4, 1130), +(5091, '木村乡', 4, 1130), +(5092, '杜固镇', 4, 1130), +(5093, '正莫镇', 4, 1130), +(5094, '邯邰镇', 4, 1130), +(5095, '长寿街道', 4, 1130), +(5096, '马头铺镇', 4, 1130), +(5097, '东焦街道', 4, 1131), +(5098, '五七街道', 4, 1131), +(5099, '北苑街道', 4, 1131), +(5100, '合作路街道', 4, 1131), +(5101, '大郭镇', 4, 1131), +(5102, '天苑街道', 4, 1131), +(5103, '宁安街道', 4, 1131), +(5104, '新华路街道', 4, 1131), +(5105, '杜北乡', 4, 1131), +(5106, '石岗街道', 4, 1131), +(5107, '联盟街道', 4, 1131), +(5108, '西三庄乡', 4, 1131), +(5109, '西苑街道', 4, 1131), +(5110, '赵陵铺镇', 4, 1131), +(5111, '革新街道', 4, 1131), +(5112, '七汲镇', 4, 1132), +(5113, '东侯坊乡', 4, 1132), +(5114, '北苏镇', 4, 1132), +(5115, '南流乡', 4, 1132), +(5116, '大陈镇', 4, 1132), +(5117, '张段固镇', 4, 1132), +(5118, '无极镇', 4, 1132), +(5119, '郝庄乡', 4, 1132), +(5120, '郭庄镇', 4, 1132), +(5121, '里城道乡', 4, 1132), +(5122, '高头回族乡', 4, 1132), +(5123, '东卓宿镇', 4, 1133), +(5124, '东里庄乡', 4, 1133), +(5125, '周家庄乡', 4, 1133), +(5126, '小樵镇', 4, 1133), +(5127, '总十庄镇', 4, 1133), +(5128, '晋州镇', 4, 1133), +(5129, '桃园镇', 4, 1133), +(5130, '槐树镇', 4, 1133), +(5131, '营里镇', 4, 1133), +(5132, '马于镇', 4, 1133), +(5133, '冶河镇', 4, 1134), +(5134, '南高乡', 4, 1134), +(5135, '柳林屯乡', 4, 1134), +(5136, '栾城镇', 4, 1134), +(5137, '楼底镇', 4, 1134), +(5138, '窦妪镇', 4, 1134), +(5139, '西营乡', 4, 1134), +(5140, '郄马镇', 4, 1134), +(5141, '东华街道', 4, 1135), +(5142, '东风街道', 4, 1135), +(5143, '中山东路街道', 4, 1135), +(5144, '休门街道', 4, 1135), +(5145, '建安街道', 4, 1135), +(5146, '彭后街道', 4, 1135), +(5147, '桃园镇', 4, 1135), +(5148, '胜利北街道', 4, 1135), +(5149, '胜利南街道', 4, 1135), +(5150, '阜康街道', 4, 1135); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5151, '东里街道', 4, 1136), +(5152, '中山路街道', 4, 1136), +(5153, '南长街道', 4, 1136), +(5154, '友谊街道', 4, 1136), +(5155, '振头街道', 4, 1136), +(5156, '新石街道', 4, 1136), +(5157, '留营乡', 4, 1136), +(5158, '红旗街道', 4, 1136), +(5159, '维明街道', 4, 1136), +(5160, '苑东街道', 4, 1136), +(5161, '裕西街道', 4, 1136), +(5162, '西里街道', 4, 1136), +(5163, '北早现乡', 4, 1137), +(5164, '南楼乡', 4, 1137), +(5165, '南牛乡', 4, 1137), +(5166, '城区街道', 4, 1137), +(5167, '新城铺镇', 4, 1137), +(5168, '新安镇', 4, 1137), +(5169, '曲阳桥乡', 4, 1137), +(5170, '正定镇', 4, 1137), +(5171, '西平乐乡', 4, 1137), +(5172, '诸福屯镇', 4, 1137), +(5173, '桥头乡', 4, 1138), +(5174, '深泽镇', 4, 1138), +(5175, '留村乡', 4, 1138), +(5176, '白庄乡', 4, 1138), +(5177, '赵八乡', 4, 1138), +(5178, '铁杆镇', 4, 1138), +(5179, '三圣院乡', 4, 1139), +(5180, '北洼乡', 4, 1139), +(5181, '北谭庄乡', 4, 1139), +(5182, '南寨乡', 4, 1139), +(5183, '南燕川乡', 4, 1139), +(5184, '南营乡', 4, 1139), +(5185, '塔上镇', 4, 1139), +(5186, '寨头乡', 4, 1139), +(5187, '岔头镇', 4, 1139), +(5188, '慈峪镇', 4, 1139), +(5189, '灵寿镇', 4, 1139), +(5190, '牛城乡', 4, 1139), +(5191, '狗台乡', 4, 1139), +(5192, '陈庄镇', 4, 1139), +(5193, '青同镇', 4, 1139), +(5194, '九门回族乡', 4, 1140), +(5195, '兴安镇', 4, 1140), +(5196, '前西关镇', 4, 1140), +(5197, '南孟镇', 4, 1140), +(5198, '南营镇', 4, 1140), +(5199, '南董镇', 4, 1140), +(5200, '增村镇', 4, 1140), +(5201, '小常安镇', 4, 1140), +(5202, '岗上镇', 4, 1140), +(5203, '廉州镇', 4, 1140), +(5204, '张家庄镇', 4, 1140), +(5205, '梅花镇', 4, 1140), +(5206, '贾市庄镇', 4, 1140), +(5207, '邱头镇', 4, 1140), +(5208, '上方乡', 4, 1141), +(5209, '上碑镇', 4, 1141), +(5210, '上阎庄乡', 4, 1141), +(5211, '九口子乡', 4, 1141), +(5212, '北河乡', 4, 1141), +(5213, '南桥镇', 4, 1141), +(5214, '口头镇', 4, 1141), +(5215, '只里乡', 4, 1141); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5216, '城寨乡', 4, 1141), +(5217, '安香乡', 4, 1141), +(5218, '市同乡', 4, 1141), +(5219, '独羊岗乡', 4, 1141), +(5220, '玉亭乡', 4, 1141), +(5221, '翟营乡', 4, 1141), +(5222, '龙州镇', 4, 1141), +(5223, '东苑街道', 4, 1142), +(5224, '宋营镇', 4, 1142), +(5225, '建通街道', 4, 1142), +(5226, '方村镇', 4, 1142), +(5227, '槐底街道', 4, 1142), +(5228, '裕东街道', 4, 1142), +(5229, '裕兴街道', 4, 1142), +(5230, '裕华路街道', 4, 1142), +(5231, '裕强街道', 4, 1142), +(5232, '长江街道', 4, 1142), +(5233, '南清河乡', 4, 1143), +(5234, '南邢郭乡', 4, 1143), +(5235, '土门乡', 4, 1143), +(5236, '嶂石岩乡', 4, 1143), +(5237, '张楞乡', 4, 1143), +(5238, '西阳泽乡', 4, 1143), +(5239, '西龙门乡', 4, 1143), +(5240, '许亭乡', 4, 1143), +(5241, '赞皇镇', 4, 1143), +(5242, '院头镇', 4, 1143), +(5243, '黄北坪乡', 4, 1143), +(5244, '前大章乡', 4, 1144), +(5245, '北王里镇', 4, 1144), +(5246, '南柏舍镇', 4, 1144), +(5247, '新寨店镇', 4, 1144), +(5248, '沙河店镇', 4, 1144), +(5249, '王西章乡', 4, 1144), +(5250, '范庄镇', 4, 1144), +(5251, '谢庄乡', 4, 1144), +(5252, '赵州镇', 4, 1144), +(5253, '韩村镇', 4, 1144), +(5254, '高村乡', 4, 1144), +(5255, '中里厢乡', 4, 1145), +(5256, '位伯镇', 4, 1145), +(5257, '前营乡', 4, 1145), +(5258, '南智丘镇', 4, 1145), +(5259, '和睦井乡', 4, 1145), +(5260, '天宫营乡', 4, 1145), +(5261, '小辛庄乡', 4, 1145), +(5262, '张古庄镇', 4, 1145), +(5263, '新垒头镇', 4, 1145), +(5264, '新城镇', 4, 1145), +(5265, '旧城镇', 4, 1145), +(5266, '王口镇', 4, 1145), +(5267, '田家庄乡', 4, 1145), +(5268, '辛集镇', 4, 1145), +(5269, '马庄乡', 4, 1145), +(5270, '南村镇', 4, 1146), +(5271, '广安街道', 4, 1146), +(5272, '建北街道', 4, 1146), +(5273, '河东街道', 4, 1146), +(5274, '育才街道', 4, 1146), +(5275, '西兆通镇', 4, 1146), +(5276, '谈固街道', 4, 1146), +(5277, '跃进街道', 4, 1146), +(5278, '长丰街道', 4, 1146), +(5279, '青园街道', 4, 1146); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5280, '高营镇', 4, 1146), +(5281, '万城乡', 4, 1147), +(5282, '中韩乡', 4, 1147), +(5283, '大营乡', 4, 1147), +(5284, '西富村乡', 4, 1147), +(5285, '高邑镇', 4, 1147), +(5286, '上寨乡', 4, 1148), +(5287, '上庄镇', 4, 1148), +(5288, '大河镇', 4, 1148), +(5289, '宜安镇', 4, 1148), +(5290, '寺家庄镇', 4, 1148), +(5291, '山尹村乡', 4, 1148), +(5292, '李村镇', 4, 1148), +(5293, '白鹿泉乡', 4, 1148), +(5294, '石井乡', 4, 1148), +(5295, '获鹿镇', 4, 1148), +(5296, '铜冶镇', 4, 1148), +(5297, '黄壁庄镇', 4, 1148), +(5298, '东田庄乡', 4, 1149), +(5299, '丰南镇', 4, 1149), +(5300, '南堡开发区', 4, 1149), +(5301, '南孙庄乡', 4, 1149), +(5302, '唐坊镇', 4, 1149), +(5303, '大新庄镇', 4, 1149), +(5304, '大齐各庄乡', 4, 1149), +(5305, '小集镇', 4, 1149), +(5306, '尖字沽乡', 4, 1149), +(5307, '柳树酄镇', 4, 1149), +(5308, '滨海镇', 4, 1149), +(5309, '王兰庄镇', 4, 1149), +(5310, '稻地镇', 4, 1149), +(5311, '胥各庄街道', 4, 1149), +(5312, '西葛镇', 4, 1149), +(5313, '钱营镇', 4, 1149), +(5314, '黄各庄镇', 4, 1149), +(5315, '黑沿子镇', 4, 1149), +(5316, '七树庄镇', 4, 1150), +(5317, '丰润镇', 4, 1150), +(5318, '丰登坞镇', 4, 1150), +(5319, '任各庄镇', 4, 1150), +(5320, '刘家营乡', 4, 1150), +(5321, '太平路街道', 4, 1150), +(5322, '姜家营乡', 4, 1150), +(5323, '小张各庄镇', 4, 1150), +(5324, '岔河镇', 4, 1150), +(5325, '左家坞镇', 4, 1150), +(5326, '常庄乡', 4, 1150), +(5327, '新军屯镇', 4, 1150), +(5328, '李钊庄镇', 4, 1150), +(5329, '杨官林镇', 4, 1150), +(5330, '欢喜庄乡', 4, 1150), +(5331, '沙流河镇', 4, 1150), +(5332, '泉河头镇', 4, 1150), +(5333, '浭阳街道', 4, 1150), +(5334, '火石营镇', 4, 1150), +(5335, '燕山路街道', 4, 1150), +(5336, '王官营镇', 4, 1150), +(5337, '白官屯镇', 4, 1150), +(5338, '石各庄镇', 4, 1150), +(5339, '老庄子镇', 4, 1150), +(5340, '银城铺乡', 4, 1150), +(5341, '韩城镇', 4, 1150), +(5342, '中堡王庄乡', 4, 1151); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5343, '乐亭镇', 4, 1151), +(5344, '乐安街道', 4, 1151), +(5345, '古河乡', 4, 1151), +(5346, '大相各庄乡', 4, 1151), +(5347, '姜各庄镇', 4, 1151), +(5348, '庞各庄乡', 4, 1151), +(5349, '新寨镇', 4, 1151), +(5350, '毛庄乡', 4, 1151), +(5351, '汀流河镇', 4, 1151), +(5352, '汤家河镇', 4, 1151), +(5353, '王滩镇', 4, 1151), +(5354, '胡家坨镇', 4, 1151), +(5355, '闫各庄镇', 4, 1151), +(5356, '马头营镇', 4, 1151), +(5357, '习家套乡', 4, 1152), +(5358, '卑家店乡', 4, 1152), +(5359, '南范各庄街道', 4, 1152), +(5360, '古冶街道', 4, 1152), +(5361, '吕家坨街道', 4, 1152), +(5362, '唐家庄街道', 4, 1152), +(5363, '大庄坨乡', 4, 1152), +(5364, '林西街道', 4, 1152), +(5365, '王辇庄乡', 4, 1152), +(5366, '范各庄乡', 4, 1152), +(5367, '赵各庄街道', 4, 1152), +(5368, '一农场', 4, 1153), +(5369, '七农场', 4, 1153), +(5370, '三农场', 4, 1153), +(5371, '九农场', 4, 1153), +(5372, '二农场', 4, 1153), +(5373, '五农场', 4, 1153), +(5374, '八农场', 4, 1153), +(5375, '六农场', 4, 1153), +(5376, '十一农场', 4, 1153), +(5377, '十农场', 4, 1153), +(5378, '唐海镇', 4, 1153), +(5379, '四农场', 4, 1153), +(5380, '双桥乡', 4, 1154), +(5381, '开平街道', 4, 1154), +(5382, '开平镇', 4, 1154), +(5383, '栗园镇', 4, 1154), +(5384, '洼里乡', 4, 1154), +(5385, '税务庄街道', 4, 1154), +(5386, '荆各庄矿区街道', 4, 1154), +(5387, '越河乡', 4, 1154), +(5388, '郑庄子乡', 4, 1154), +(5389, '陡电街道', 4, 1154), +(5390, '马家沟街道', 4, 1154), +(5391, '东黄坨镇', 4, 1155), +(5392, '倴城镇', 4, 1155), +(5393, '南堡镇', 4, 1155), +(5394, '司各庄镇', 4, 1155), +(5395, '坨里镇', 4, 1155), +(5396, '姚王庄镇', 4, 1155), +(5397, '安各庄镇', 4, 1155), +(5398, '宋道口镇', 4, 1155), +(5399, '扒齿港镇', 4, 1155), +(5400, '方各庄镇', 4, 1155), +(5401, '柏各庄镇', 4, 1155), +(5402, '柳赞镇', 4, 1155), +(5403, '程庄镇', 4, 1155), +(5404, '胡各庄镇', 4, 1155), +(5405, '长凝镇', 4, 1155); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5406, '青坨营镇', 4, 1155), +(5407, '马城镇', 4, 1155), +(5408, '东安各庄镇', 4, 1156), +(5409, '九百户镇', 4, 1156), +(5410, '古马镇', 4, 1156), +(5411, '响堂镇', 4, 1156), +(5412, '小马庄镇', 4, 1156), +(5413, '杨柳庄镇', 4, 1156), +(5414, '榛子镇', 4, 1156), +(5415, '油榨镇', 4, 1156), +(5416, '滦州镇', 4, 1156), +(5417, '王店子镇', 4, 1156), +(5418, '茨榆坨镇', 4, 1156), +(5419, '雷庄镇', 4, 1156), +(5420, '亮甲店镇', 4, 1157), +(5421, '唐自头镇', 4, 1157), +(5422, '大安镇', 4, 1157), +(5423, '孤树镇', 4, 1157), +(5424, '彩亭桥镇', 4, 1157), +(5425, '散水头镇', 4, 1157), +(5426, '杨家套乡', 4, 1157), +(5427, '杨家板桥镇', 4, 1157), +(5428, '林南仓镇', 4, 1157), +(5429, '林头屯乡', 4, 1157), +(5430, '林西镇', 4, 1157), +(5431, '潮洛窝乡', 4, 1157), +(5432, '玉田镇', 4, 1157), +(5433, '石臼窝镇', 4, 1157), +(5434, '窝洛沽镇', 4, 1157), +(5435, '虹桥镇', 4, 1157), +(5436, '郭家屯乡', 4, 1157), +(5437, '郭家桥乡', 4, 1157), +(5438, '陈家铺乡', 4, 1157), +(5439, '鸦鸿桥镇', 4, 1157), +(5440, '东新村街道', 4, 1158), +(5441, '乔屯街道', 4, 1158), +(5442, '光明街道', 4, 1158), +(5443, '大里街道', 4, 1158), +(5444, '文化路街道', 4, 1158), +(5445, '机场路街道', 4, 1158), +(5446, '果园乡', 4, 1158), +(5447, '河北路街道', 4, 1158), +(5448, '缸窑街道', 4, 1158), +(5449, '钓鱼台街道', 4, 1158), +(5450, '高新技术开发区街道', 4, 1158), +(5451, '龙东街道', 4, 1158), +(5452, '友谊里街道', 4, 1159), +(5453, '女织寨乡', 4, 1159), +(5454, '学院南路街道', 4, 1159), +(5455, '小山街道', 4, 1159), +(5456, '广场街道', 4, 1159), +(5457, '文化北后街街道', 4, 1159), +(5458, '永红桥街道', 4, 1159), +(5459, '钱家营矿区街道', 4, 1159), +(5460, '上庄乡', 4, 1160), +(5461, '五重安乡', 4, 1160), +(5462, '兴安街道', 4, 1160), +(5463, '夏官营镇', 4, 1160), +(5464, '大五里乡', 4, 1160), +(5465, '大崔庄镇', 4, 1160), +(5466, '太平庄乡', 4, 1160); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5467, '建昌营镇', 4, 1160), +(5468, '彭店子乡', 4, 1160), +(5469, '扣庄乡', 4, 1160), +(5470, '木厂口镇', 4, 1160), +(5471, '杨子店街道', 4, 1160), +(5472, '永顺街道', 4, 1160), +(5473, '沙河驿镇', 4, 1160), +(5474, '滨河街道', 4, 1160), +(5475, '蔡园镇', 4, 1160), +(5476, '赵店子镇', 4, 1160), +(5477, '野鸡坨镇', 4, 1160), +(5478, '闫家店乡', 4, 1160), +(5479, '马兰庄镇', 4, 1160), +(5480, '三屯营镇', 4, 1161), +(5481, '上营乡', 4, 1161), +(5482, '东荒峪镇', 4, 1161), +(5483, '东莲花院乡', 4, 1161), +(5484, '兴城镇', 4, 1161), +(5485, '太平寨镇', 4, 1161), +(5486, '尹庄乡', 4, 1161), +(5487, '新庄子乡', 4, 1161), +(5488, '新集镇', 4, 1161), +(5489, '旧城乡', 4, 1161), +(5490, '栗乡街道', 4, 1161), +(5491, '汉儿庄乡', 4, 1161), +(5492, '洒河桥镇', 4, 1161), +(5493, '渔户寨乡', 4, 1161), +(5494, '滦阳镇', 4, 1161), +(5495, '白庙子乡', 4, 1161), +(5496, '罗家屯镇', 4, 1161), +(5497, '金厂峪镇', 4, 1161), +(5498, '东新庄镇', 4, 1162), +(5499, '东旧寨镇', 4, 1162), +(5500, '东陵满族乡', 4, 1162), +(5501, '候家寨乡', 4, 1162), +(5502, '党峪镇', 4, 1162), +(5503, '兴旺寨乡', 4, 1162), +(5504, '刘备寨乡', 4, 1162), +(5505, '团瓢庄乡', 4, 1162), +(5506, '地北头镇', 4, 1162), +(5507, '堡子店镇', 4, 1162), +(5508, '娘娘庄乡', 4, 1162), +(5509, '小厂乡', 4, 1162), +(5510, '崔家庄乡', 4, 1162), +(5511, '平安城镇', 4, 1162), +(5512, '建明镇', 4, 1162), +(5513, '新店子镇', 4, 1162), +(5514, '汤泉满族乡', 4, 1162), +(5515, '石门镇', 4, 1162), +(5516, '苏家洼镇', 4, 1162), +(5517, '西三里乡', 4, 1162), +(5518, '西下营满族乡', 4, 1162), +(5519, '西留村乡', 4, 1162), +(5520, '遵化镇', 4, 1162), +(5521, '铁厂镇', 4, 1162), +(5522, '马兰峪镇', 4, 1162), +(5523, '东山街道', 4, 1163), +(5524, '戴河镇', 4, 1163), +(5525, '海滨镇', 4, 1163), +(5526, '西山街道', 4, 1163), +(5527, '下寨乡', 4, 1164), +(5528, '刘家营乡', 4, 1164), +(5529, '刘田各庄镇', 4, 1164); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5530, '卢龙镇', 4, 1164), +(5531, '印庄乡', 4, 1164), +(5532, '双望镇', 4, 1164), +(5533, '木井乡', 4, 1164), +(5534, '潘庄镇', 4, 1164), +(5535, '燕河营镇', 4, 1164), +(5536, '石门镇', 4, 1164), +(5537, '蛤泊乡', 4, 1164), +(5538, '陈官屯乡', 4, 1164), +(5539, '东街街道', 4, 1165), +(5540, '南关街道', 4, 1165), +(5541, '孟姜镇', 4, 1165), +(5542, '渤海乡', 4, 1165), +(5543, '石河镇', 4, 1165), +(5544, '第一关镇', 4, 1165), +(5545, '船厂路街道', 4, 1165), +(5546, '西街街道', 4, 1165), +(5547, '路南街道', 4, 1165), +(5548, '台营镇', 4, 1166), +(5549, '大新寨镇', 4, 1166), +(5550, '抚宁镇', 4, 1166), +(5551, '杜庄乡', 4, 1166), +(5552, '榆关镇', 4, 1166), +(5553, '深河乡', 4, 1166), +(5554, '牛头崖镇', 4, 1166), +(5555, '留守营镇', 4, 1166), +(5556, '石门寨镇', 4, 1166), +(5557, '茶棚乡', 4, 1166), +(5558, '驻操营镇', 4, 1166), +(5559, '两山乡', 4, 1167), +(5560, '刘台庄镇', 4, 1167), +(5561, '十里铺乡', 4, 1167), +(5562, '团林乡', 4, 1167), +(5563, '大蒲河镇', 4, 1167), +(5564, '安山镇', 4, 1167), +(5565, '新集镇', 4, 1167), +(5566, '昌黎镇', 4, 1167), +(5567, '朱各庄镇', 4, 1167), +(5568, '泥井镇', 4, 1167), +(5569, '茹荷镇', 4, 1167), +(5570, '荒佃庄乡', 4, 1167), +(5571, '葛条港乡', 4, 1167), +(5572, '靖安镇', 4, 1167), +(5573, '马坨店乡', 4, 1167), +(5574, '龙家店镇', 4, 1167), +(5575, '东港镇', 4, 1168), +(5576, '东环路街道', 4, 1168), +(5577, '北港镇', 4, 1168), +(5578, '北环路街道', 4, 1168), +(5579, '建设大街街道', 4, 1168), +(5580, '文化路街道', 4, 1168), +(5581, '河东街道', 4, 1168), +(5582, '海港镇', 4, 1168), +(5583, '海滨路街道', 4, 1168), +(5584, '海阳镇', 4, 1168), +(5585, '港城大街街道', 4, 1168), +(5586, '燕山大街街道', 4, 1168), +(5587, '珠江道街道', 4, 1168), +(5588, '白塔岭街道', 4, 1168), +(5589, '西港路街道', 4, 1168), +(5590, '西港镇', 4, 1168), +(5591, '七道河乡', 4, 1169), +(5592, '三拨子乡', 4, 1169); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5593, '三星口乡', 4, 1169), +(5594, '八道河乡', 4, 1169), +(5595, '凉水河乡', 4, 1169), +(5596, '凤凰山乡', 4, 1169), +(5597, '双山子镇', 4, 1169), +(5598, '土门子乡', 4, 1169), +(5599, '大巫岚乡', 4, 1169), +(5600, '大石岭乡', 4, 1169), +(5601, '娄仗子乡', 4, 1169), +(5602, '安子岭乡', 4, 1169), +(5603, '官场乡', 4, 1169), +(5604, '干沟乡', 4, 1169), +(5605, '平方子乡', 4, 1169), +(5606, '木头凳镇', 4, 1169), +(5607, '朱仗子乡', 4, 1169), +(5608, '祖山镇', 4, 1169), +(5609, '肖营子镇', 4, 1169), +(5610, '茨榆山乡', 4, 1169), +(5611, '草碾乡', 4, 1169), +(5612, '隔河头乡', 4, 1169), +(5613, '青龙镇', 4, 1169), +(5614, '马圈子镇', 4, 1169), +(5615, '龙王庙乡', 4, 1169), +(5616, '丛台东街道', 4, 1170), +(5617, '丛台西街道', 4, 1170), +(5618, '中华街道', 4, 1170), +(5619, '人民路街道', 4, 1170), +(5620, '光明桥街道', 4, 1170), +(5621, '和平街道', 4, 1170), +(5622, '四季青街道', 4, 1170), +(5623, '柳林桥街道', 4, 1170), +(5624, '联纺东街道', 4, 1170), +(5625, '联纺西街道', 4, 1170), +(5626, '苏曹乡', 4, 1170), +(5627, '临漳镇', 4, 1171), +(5628, '习文乡', 4, 1171), +(5629, '南东坊镇', 4, 1171), +(5630, '孙陶集镇', 4, 1171), +(5631, '张村集乡', 4, 1171), +(5632, '杜村集乡', 4, 1171), +(5633, '柏鹤集乡', 4, 1171), +(5634, '柳园镇', 4, 1171), +(5635, '狄邱乡', 4, 1171), +(5636, '砖寨营乡', 4, 1171), +(5637, '称勾集镇', 4, 1171), +(5638, '章里集乡', 4, 1171), +(5639, '西羊羔乡', 4, 1171), +(5640, '香菜营乡', 4, 1171), +(5641, '二六七二街道', 4, 1172), +(5642, '化林路街道', 4, 1172), +(5643, '庞村街道', 4, 1172), +(5644, '彭家寨乡', 4, 1172), +(5645, '百家村街道', 4, 1172), +(5646, '石化街道', 4, 1172), +(5647, '胜利桥街道', 4, 1172), +(5648, '铁路大院街道', 4, 1172), +(5649, '万堤镇', 4, 1173), +(5650, '北峰乡', 4, 1173), +(5651, '埝头乡', 4, 1173), +(5652, '大名镇', 4, 1173), +(5653, '大街乡', 4, 1173), +(5654, '孙甘店乡', 4, 1173); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5655, '张集乡', 4, 1173), +(5656, '旧治乡', 4, 1173), +(5657, '束馆镇', 4, 1173), +(5658, '杨桥镇', 4, 1173), +(5659, '沙圪塔乡', 4, 1173), +(5660, '王村乡', 4, 1173), +(5661, '红庙乡', 4, 1173), +(5662, '营镇回族乡', 4, 1173), +(5663, '西付集乡', 4, 1173), +(5664, '西未庄乡', 4, 1173), +(5665, '金滩镇', 4, 1173), +(5666, '铺上乡', 4, 1173), +(5667, '黄金堤乡', 4, 1173), +(5668, '龙王庙镇', 4, 1173), +(5669, '临水镇', 4, 1174), +(5670, '义井镇', 4, 1174), +(5671, '和村镇', 4, 1174), +(5672, '大峪镇', 4, 1174), +(5673, '大社镇', 4, 1174), +(5674, '峰峰镇', 4, 1174), +(5675, '彭城镇', 4, 1174), +(5676, '新坡镇', 4, 1174), +(5677, '界城镇', 4, 1174), +(5678, '东张孟乡', 4, 1175), +(5679, '十里铺乡', 4, 1175), +(5680, '南阳堡乡', 4, 1175), +(5681, '南韩村乡', 4, 1175), +(5682, '双庙乡', 4, 1175), +(5683, '平固店镇', 4, 1175), +(5684, '广平镇', 4, 1175), +(5685, '北乡义乡', 4, 1176), +(5686, '商城镇', 4, 1176), +(5687, '成安镇', 4, 1176), +(5688, '李家疃镇', 4, 1176), +(5689, '柏寺营乡', 4, 1176), +(5690, '漳河店镇', 4, 1176), +(5691, '辛义乡', 4, 1176), +(5692, '道东堡乡', 4, 1176), +(5693, '长巷乡', 4, 1176), +(5694, '依庄乡', 4, 1177), +(5695, '侯村镇', 4, 1177), +(5696, '南里岳乡', 4, 1177), +(5697, '大河道乡', 4, 1177), +(5698, '安寨镇', 4, 1177), +(5699, '曲周镇', 4, 1177), +(5700, '槐桥乡', 4, 1177), +(5701, '河南疃镇', 4, 1177), +(5702, '白寨乡', 4, 1177), +(5703, '第四疃乡', 4, 1177), +(5704, '上团城乡', 4, 1178), +(5705, '伯延镇', 4, 1178), +(5706, '冶陶镇', 4, 1178), +(5707, '北安乐乡', 4, 1178), +(5708, '北安庄乡', 4, 1178), +(5709, '午汲镇', 4, 1178), +(5710, '大同镇', 4, 1178), +(5711, '康二城镇', 4, 1178), +(5712, '徘徊镇', 4, 1178), +(5713, '武安镇', 4, 1178), +(5714, '活水乡', 4, 1178), +(5715, '淑村镇', 4, 1178), +(5716, '石洞乡', 4, 1178), +(5717, '矿山镇', 4, 1178), +(5718, '磁山镇', 4, 1178), +(5719, '管陶乡', 4, 1178), +(5720, '西土山乡', 4, 1178); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5721, '西寺庄乡', 4, 1178), +(5722, '贺进镇', 4, 1178), +(5723, '邑城镇', 4, 1178), +(5724, '阳邑镇', 4, 1178), +(5725, '马家庄乡', 4, 1178), +(5726, '东杨庄乡', 4, 1179), +(5727, '临洺关镇', 4, 1179), +(5728, '刘汉乡', 4, 1179), +(5729, '刘营乡', 4, 1179), +(5730, '南永合会镇', 4, 1179), +(5731, '南沿村镇', 4, 1179), +(5732, '南西苏乡', 4, 1179), +(5733, '大北汪镇', 4, 1179), +(5734, '姚寨乡', 4, 1179), +(5735, '小西堡乡', 4, 1179), +(5736, '小龙马乡', 4, 1179), +(5737, '广府镇', 4, 1179), +(5738, '张西堡镇', 4, 1179), +(5739, '曲陌乡', 4, 1179), +(5740, '正西乡', 4, 1179), +(5741, '界河店乡', 4, 1179), +(5742, '西河庄乡', 4, 1179), +(5743, '西阳城乡', 4, 1179), +(5744, '讲武乡', 4, 1179), +(5745, '辛庄堡乡', 4, 1179), +(5746, '井店镇', 4, 1180), +(5747, '偏城镇', 4, 1180), +(5748, '偏店乡', 4, 1180), +(5749, '关防乡', 4, 1180), +(5750, '合漳乡', 4, 1180), +(5751, '固新镇', 4, 1180), +(5752, '更乐镇', 4, 1180), +(5753, '木井乡', 4, 1180), +(5754, '河南店镇', 4, 1180), +(5755, '涉城镇', 4, 1180), +(5756, '神头乡', 4, 1180), +(5757, '索堡镇', 4, 1180), +(5758, '西戌镇', 4, 1180), +(5759, '西达镇', 4, 1180), +(5760, '辽城乡', 4, 1180), +(5761, '鹿头乡', 4, 1180), +(5762, '龙虎乡', 4, 1180), +(5763, '北贾壁乡', 4, 1181), +(5764, '南城乡', 4, 1181), +(5765, '台城乡', 4, 1181), +(5766, '岳城镇', 4, 1181), +(5767, '时村营乡', 4, 1181), +(5768, '林坦镇', 4, 1181), +(5769, '白土镇', 4, 1181), +(5770, '磁州镇', 4, 1181), +(5771, '花官营乡', 4, 1181), +(5772, '西光禄镇', 4, 1181), +(5773, '西固义乡', 4, 1181), +(5774, '观台镇', 4, 1181), +(5775, '讲武城镇', 4, 1181), +(5776, '路村营乡', 4, 1181), +(5777, '辛庄营乡', 4, 1181), +(5778, '都党乡', 4, 1181), +(5779, '陶泉乡', 4, 1181), +(5780, '高臾镇', 4, 1181), +(5781, '黄沙镇', 4, 1181), +(5782, '东漳堡乡', 4, 1182), +(5783, '元固乡', 4, 1182), +(5784, '大西韩乡', 4, 1182), +(5785, '天台山镇', 4, 1182); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5786, '屯庄营乡', 4, 1182), +(5787, '旧店乡', 4, 1182), +(5788, '毛演堡乡', 4, 1182), +(5789, '肥乡镇', 4, 1182), +(5790, '辛安镇乡', 4, 1182), +(5791, '光明路街道', 4, 1183), +(5792, '农林路街道', 4, 1183), +(5793, '浴新南街道', 4, 1183), +(5794, '渚河路街道', 4, 1183), +(5795, '滏东街道', 4, 1183), +(5796, '火磨街道', 4, 1183), +(5797, '罗城头街道', 4, 1183), +(5798, '贸东街道', 4, 1183), +(5799, '贸西街道', 4, 1183), +(5800, '陵园路街道', 4, 1183), +(5801, '马头镇', 4, 1183), +(5802, '马庄乡', 4, 1183), +(5803, '三陵乡', 4, 1184), +(5804, '代召乡', 4, 1184), +(5805, '兼庄乡', 4, 1184), +(5806, '北张庄镇', 4, 1184), +(5807, '南吕固乡', 4, 1184), +(5808, '南堡乡', 4, 1184), +(5809, '尚璧镇', 4, 1184), +(5810, '康庄乡', 4, 1184), +(5811, '户村镇', 4, 1184), +(5812, '河沙镇镇', 4, 1184), +(5813, '黄粱梦镇', 4, 1184), +(5814, '南辛店乡', 4, 1185), +(5815, '新马头镇', 4, 1185), +(5816, '旦寨乡', 4, 1185), +(5817, '梁二庄乡', 4, 1185), +(5818, '邱城镇', 4, 1185), +(5819, '陈村回族乡', 4, 1185), +(5820, '香城固乡', 4, 1185), +(5821, '南徐村乡', 4, 1186), +(5822, '寿山寺乡', 4, 1186), +(5823, '房寨镇', 4, 1186), +(5824, '柴堡镇', 4, 1186), +(5825, '王桥乡', 4, 1186), +(5826, '路桥乡', 4, 1186), +(5827, '馆陶镇', 4, 1186), +(5828, '魏僧寨镇', 4, 1186), +(5829, '东代固乡', 4, 1187), +(5830, '仕望集乡', 4, 1187), +(5831, '前大磨乡', 4, 1187), +(5832, '北台头乡', 4, 1187), +(5833, '北皋镇', 4, 1187), +(5834, '南双庙乡', 4, 1187), +(5835, '双井镇', 4, 1187), +(5836, '回隆镇', 4, 1187), +(5837, '大辛庄乡', 4, 1187), +(5838, '大马村乡', 4, 1187), +(5839, '张二庄乡', 4, 1187), +(5840, '德政镇', 4, 1187), +(5841, '棘针寨乡', 4, 1187), +(5842, '沙口集乡', 4, 1187), +(5843, '泊口乡', 4, 1187), +(5844, '牙里镇', 4, 1187), +(5845, '车往镇', 4, 1187), +(5846, '边马乡', 4, 1187), +(5847, '野胡拐乡', 4, 1187), +(5848, '院堡乡', 4, 1187), +(5849, '魏城镇', 4, 1187); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5850, '双塔镇', 4, 1188), +(5851, '吴官营乡', 4, 1188), +(5852, '小寨镇', 4, 1188), +(5853, '曹庄乡', 4, 1188), +(5854, '浮图店乡', 4, 1188), +(5855, '风正乡', 4, 1188), +(5856, '鸡泽镇', 4, 1188), +(5857, '东镇镇', 4, 1189), +(5858, '临城镇', 4, 1189), +(5859, '石城乡', 4, 1189), +(5860, '西竖镇', 4, 1189), +(5861, '赵庄乡', 4, 1189), +(5862, '郝庄镇', 4, 1189), +(5863, '鸭鸽营乡', 4, 1189), +(5864, '黑城乡', 4, 1189), +(5865, '下堡寺镇', 4, 1190), +(5866, '东枣园乡', 4, 1190), +(5867, '临西镇', 4, 1190), +(5868, '吕寨乡', 4, 1190), +(5869, '大刘庄乡', 4, 1190), +(5870, '尖冢镇', 4, 1190), +(5871, '摇鞍镇乡', 4, 1190), +(5872, '河西镇', 4, 1190), +(5873, '老官寨乡', 4, 1190), +(5874, '任城镇', 4, 1191), +(5875, '大屯乡', 4, 1191), +(5876, '天口乡', 4, 1191), +(5877, '永福庄乡', 4, 1191), +(5878, '西固城乡', 4, 1191), +(5879, '辛店镇', 4, 1191), +(5880, '邢家湾镇', 4, 1191), +(5881, '骆庄乡', 4, 1191), +(5882, '五郭店乡', 4, 1192), +(5883, '侯家庄乡', 4, 1192), +(5884, '内丘镇', 4, 1192), +(5885, '南赛乡', 4, 1192), +(5886, '大孟村镇', 4, 1192), +(5887, '官庄镇', 4, 1192), +(5888, '柳林镇', 4, 1192), +(5889, '獐貘乡', 4, 1192), +(5890, '金店镇', 4, 1192), +(5891, '三思乡', 4, 1193), +(5892, '东三召乡', 4, 1193), +(5893, '史召乡', 4, 1193), +(5894, '和阳镇', 4, 1193), +(5895, '河郭乡', 4, 1193), +(5896, '贾宋镇', 4, 1193), +(5897, '郝桥镇', 4, 1193), +(5898, '阎里乡', 4, 1193), +(5899, '凤岗街道', 4, 1194), +(5900, '前紫冢镇', 4, 1194), +(5901, '北胡街道', 4, 1194), +(5902, '南便村乡', 4, 1194), +(5903, '南杜街道', 4, 1194), +(5904, '垂杨镇', 4, 1194), +(5905, '大屯乡', 4, 1194), +(5906, '大村乡', 4, 1194), +(5907, '大高村镇', 4, 1194), +(5908, '明化镇', 4, 1194), +(5909, '段芦头镇', 4, 1194), +(5910, '王道寨乡', 4, 1194), +(5911, '苏村镇', 4, 1194), +(5912, '薛吴村乡', 4, 1194), +(5913, '西丁街道', 4, 1194), +(5914, '七级镇', 4, 1195), +(5915, '侯贯镇', 4, 1195); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5916, '固献乡', 4, 1195), +(5917, '常屯乡', 4, 1195), +(5918, '常庄乡', 4, 1195), +(5919, '张营乡', 4, 1195), +(5920, '方家营乡', 4, 1195), +(5921, '枣园乡', 4, 1195), +(5922, '梨元屯镇', 4, 1195), +(5923, '洺州镇', 4, 1195), +(5924, '章台镇', 4, 1195), +(5925, '第什营乡', 4, 1195), +(5926, '贺营乡', 4, 1195), +(5927, '贺钊乡', 4, 1195), +(5928, '赵村乡', 4, 1195), +(5929, '高公庄乡', 4, 1195), +(5930, '东汪镇', 4, 1196), +(5931, '侯口乡', 4, 1196), +(5932, '凤凰镇', 4, 1196), +(5933, '北河庄镇', 4, 1196), +(5934, '北鱼乡', 4, 1196), +(5935, '唐邱乡', 4, 1196), +(5936, '四芝兰镇', 4, 1196), +(5937, '大曹庄乡', 4, 1196), +(5938, '大曹庄农场', 4, 1196), +(5939, '大陆村镇', 4, 1196), +(5940, '徐家河乡', 4, 1196), +(5941, '换马店镇', 4, 1196), +(5942, '河渠镇', 4, 1196), +(5943, '纪昌庄乡', 4, 1196), +(5944, '耿庄桥镇', 4, 1196), +(5945, '苏家庄镇', 4, 1196), +(5946, '贾家口镇', 4, 1196), +(5947, '堤村乡', 4, 1197), +(5948, '官亭镇', 4, 1197), +(5949, '小吕寨镇', 4, 1197), +(5950, '巨鹿镇', 4, 1197), +(5951, '张王疃乡', 4, 1197), +(5952, '王虎寨镇', 4, 1197), +(5953, '苏家营乡', 4, 1197), +(5954, '西郭城镇', 4, 1197), +(5955, '观寨乡', 4, 1197), +(5956, '阎疃镇', 4, 1197), +(5957, '丰州镇', 4, 1198), +(5958, '寻召乡', 4, 1198), +(5959, '平乡镇', 4, 1198), +(5960, '河古庙镇', 4, 1198), +(5961, '油召乡', 4, 1198), +(5962, '田付村乡', 4, 1198), +(5963, '节固乡', 4, 1198), +(5964, '东召乡', 4, 1199), +(5965, '件只乡', 4, 1199), +(5966, '冯家寨乡', 4, 1199), +(5967, '北塘疃乡', 4, 1199), +(5968, '大平台乡', 4, 1199), +(5969, '广宗镇', 4, 1199), +(5970, '核桃园乡', 4, 1199), +(5971, '葫芦乡', 4, 1199), +(5972, '仁让里乡', 4, 1200), +(5973, '寻寨镇', 4, 1200), +(5974, '新河镇', 4, 1200), +(5975, '白神首乡', 4, 1200), +(5976, '荆家庄乡', 4, 1200), +(5977, '西流乡', 4, 1200), +(5978, '内步乡', 4, 1201), +(5979, '固城店镇', 4, 1201), +(5980, '柏乡镇', 4, 1201); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(5981, '王家庄乡', 4, 1201), +(5982, '西汪乡', 4, 1201), +(5983, '龙华乡', 4, 1201), +(5984, '东郭村乡', 4, 1202), +(5985, '北大街街道', 4, 1202), +(5986, '南长街街道', 4, 1202), +(5987, '大梁庄乡', 4, 1202), +(5988, '西大街街道', 4, 1202), +(5989, '西门里街道', 4, 1202), +(5990, '中兴路街道', 4, 1203), +(5991, '南大郭乡', 4, 1203), +(5992, '张宽街道', 4, 1203), +(5993, '李村乡', 4, 1203), +(5994, '章村街道', 4, 1203), +(5995, '达活泉街道', 4, 1203), +(5996, '钢铁路街道', 4, 1203), +(5997, '册井乡', 4, 1204), +(5998, '刘石岗乡', 4, 1204), +(5999, '十里亭镇', 4, 1204), +(6000, '周庄街道', 4, 1204), +(6001, '新城镇', 4, 1204), +(6002, '柴关乡', 4, 1204), +(6003, '桥东街道', 4, 1204), +(6004, '桥西街道', 4, 1204), +(6005, '沙河城镇', 4, 1204), +(6006, '留村乡', 4, 1204), +(6007, '白塔镇', 4, 1204), +(6008, '綦村镇', 4, 1204), +(6009, '蝉房乡', 4, 1204), +(6010, '褡裢街道', 4, 1204), +(6011, '赞善街道', 4, 1204), +(6012, '坝营镇', 4, 1205), +(6013, '油坊镇', 4, 1205), +(6014, '王官庄镇', 4, 1205), +(6015, '葛仙庄镇', 4, 1205), +(6016, '谢炉镇', 4, 1205), +(6017, '连庄镇', 4, 1205), +(6018, '东汪镇', 4, 1206), +(6019, '会宁镇', 4, 1206), +(6020, '冀家村乡', 4, 1206), +(6021, '北小庄乡', 4, 1206), +(6022, '南石门镇', 4, 1206), +(6023, '城计头乡', 4, 1206), +(6024, '太子井乡', 4, 1206), +(6025, '宋家庄乡', 4, 1206), +(6026, '宋家庄镇', 4, 1206), +(6027, '将军墓镇', 4, 1206), +(6028, '晏家屯镇', 4, 1206), +(6029, '浆水镇', 4, 1206), +(6030, '王快镇', 4, 1206), +(6031, '白岸乡', 4, 1206), +(6032, '皇寺镇', 4, 1206), +(6033, '祝村镇', 4, 1206), +(6034, '羊范镇', 4, 1206), +(6035, '西黄村镇', 4, 1206), +(6036, '豫让桥街道', 4, 1206), +(6037, '路罗镇', 4, 1206), +(6038, '龙泉寺乡', 4, 1206), +(6039, '东良乡', 4, 1207), +(6040, '北楼乡', 4, 1207), +(6041, '千户营乡', 4, 1207), +(6042, '双碑乡', 4, 1207), +(6043, '固城镇', 4, 1207); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6044, '大张庄乡', 4, 1207), +(6045, '尹村镇', 4, 1207), +(6046, '山口镇', 4, 1207), +(6047, '牛家桥乡', 4, 1207), +(6048, '莲子镇', 4, 1207), +(6049, '隆尧镇', 4, 1207), +(6050, '魏家庄镇', 4, 1207), +(6051, '东关街道', 4, 1208), +(6052, '东金庄乡', 4, 1208), +(6053, '中华路街道', 4, 1208), +(6054, '五四路街道', 4, 1208), +(6055, '和平里街道', 4, 1208), +(6056, '百楼乡', 4, 1208), +(6057, '西关街道', 4, 1208), +(6058, '韩庄乡', 4, 1208), +(6059, '五尧乡', 4, 1209), +(6060, '南关街道', 4, 1209), +(6061, '南大园乡', 4, 1209), +(6062, '杨庄乡', 4, 1209), +(6063, '永华街道', 4, 1209), +(6064, '焦庄乡', 4, 1209), +(6065, '红星街道', 4, 1209), +(6066, '联盟街道', 4, 1209), +(6067, '裕华街道', 4, 1209), +(6068, '东墟乡', 4, 1210), +(6069, '北杨村乡', 4, 1210), +(6070, '南小王乡', 4, 1210), +(6071, '博野镇', 4, 1210), +(6072, '城东乡', 4, 1210), +(6073, '小店镇', 4, 1210), +(6074, '程委镇', 4, 1210), +(6075, '仁厚镇', 4, 1211), +(6076, '倒马关乡', 4, 1211), +(6077, '军城镇', 4, 1211), +(6078, '北店头乡', 4, 1211), +(6079, '北罗镇', 4, 1211), +(6080, '南店头乡', 4, 1211), +(6081, '大洋乡', 4, 1211), +(6082, '川里镇', 4, 1211), +(6083, '王京镇', 4, 1211), +(6084, '白合镇', 4, 1211), +(6085, '石门乡', 4, 1211), +(6086, '罗庄乡', 4, 1211), +(6087, '羊角乡', 4, 1211), +(6088, '迷城乡', 4, 1211), +(6089, '都亭乡', 4, 1211), +(6090, '长古城乡', 4, 1211), +(6091, '雹水乡', 4, 1211), +(6092, '高昌镇', 4, 1211), +(6093, '黄石口乡', 4, 1211), +(6094, '齐家佐乡', 4, 1211), +(6095, '伍仁桥镇', 4, 1212), +(6096, '北段村乡', 4, 1212), +(6097, '南娄底乡', 4, 1212), +(6098, '大五女镇', 4, 1212), +(6099, '明官店乡', 4, 1212), +(6100, '石佛镇', 4, 1212), +(6101, '祁州药市街道', 4, 1212), +(6102, '祁州镇', 4, 1212), +(6103, '西佛落乡', 4, 1212), +(6104, '西安国城乡', 4, 1212), +(6105, '郑章镇', 4, 1212), +(6106, '三台镇', 4, 1213), +(6107, '刘李庄镇', 4, 1213); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6108, '同口镇', 4, 1213), +(6109, '圈头乡', 4, 1213), +(6110, '大王镇', 4, 1213), +(6111, '安州镇', 4, 1213), +(6112, '安新镇', 4, 1213), +(6113, '寨里乡', 4, 1213), +(6114, '端村镇', 4, 1213), +(6115, '老河头镇', 4, 1213), +(6116, '芦庄乡', 4, 1213), +(6117, '赵北口镇', 4, 1213), +(6118, '东落堡乡', 4, 1214), +(6119, '北南蔡乡', 4, 1214), +(6120, '北河镇', 4, 1214), +(6121, '北田乡', 4, 1214), +(6122, '固城镇', 4, 1214), +(6123, '天宫寺乡', 4, 1214), +(6124, '姚村乡', 4, 1214), +(6125, '定兴镇', 4, 1214), +(6126, '小朱庄乡', 4, 1214), +(6127, '张家庄乡', 4, 1214), +(6128, '李郁庄乡', 4, 1214), +(6129, '杨村乡', 4, 1214), +(6130, '柳卓乡', 4, 1214), +(6131, '肖村乡', 4, 1214), +(6132, '贤寓镇', 4, 1214), +(6133, '高里乡', 4, 1214), +(6134, '东亭镇', 4, 1215), +(6135, '东旺镇', 4, 1215), +(6136, '东留春乡', 4, 1215), +(6137, '北城区街道', 4, 1215), +(6138, '南城区街道', 4, 1215), +(6139, '叮咛店镇', 4, 1215), +(6140, '号头庄回族乡', 4, 1215), +(6141, '周村乡', 4, 1215), +(6142, '大辛庄镇', 4, 1215), +(6143, '大鹿庄乡', 4, 1215), +(6144, '子位镇', 4, 1215), +(6145, '庞村镇', 4, 1215), +(6146, '开元镇', 4, 1215), +(6147, '息冢乡', 4, 1215), +(6148, '明月店镇', 4, 1215), +(6149, '李亲顾镇', 4, 1215), +(6150, '杨家庄乡', 4, 1215), +(6151, '清风店镇', 4, 1215), +(6152, '留早镇', 4, 1215), +(6153, '砖路镇', 4, 1215), +(6154, '西城乡', 4, 1215), +(6155, '西城区街道', 4, 1215), +(6156, '赵村乡', 4, 1215), +(6157, '邢邑镇', 4, 1215), +(6158, '高蓬镇', 4, 1215), +(6159, '八于乡', 4, 1216), +(6160, '南张镇', 4, 1216), +(6161, '大河镇', 4, 1216), +(6162, '容城镇', 4, 1216), +(6163, '小里镇', 4, 1216), +(6164, '平王乡', 4, 1216), +(6165, '晾马台乡', 4, 1216), +(6166, '贾光乡', 4, 1216), +(6167, '东史端乡', 4, 1217), +(6168, '东釜山乡', 4, 1217), +(6169, '义联庄乡', 4, 1217), +(6170, '大因镇', 4, 1217), +(6171, '大王店镇', 4, 1217), +(6172, '安肃镇', 4, 1217); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6173, '崔庄镇', 4, 1217), +(6174, '户木乡', 4, 1217), +(6175, '正村乡', 4, 1217), +(6176, '漕河镇', 4, 1217), +(6177, '瀑河乡', 4, 1217), +(6178, '留村乡', 4, 1217), +(6179, '遂城镇', 4, 1217), +(6180, '高林村镇', 4, 1217), +(6181, '东风街道', 4, 1218), +(6182, '先锋街道', 4, 1218), +(6183, '南奇乡', 4, 1218), +(6184, '大马坊乡', 4, 1218), +(6185, '富昌乡', 4, 1218), +(6186, '建设南路街道', 4, 1218), +(6187, '新市场街道', 4, 1218), +(6188, '江城乡', 4, 1218), +(6189, '韩村乡', 4, 1218), +(6190, '韩村北路街道', 4, 1218), +(6191, '颉庄乡', 4, 1218), +(6192, '七峪乡', 4, 1219), +(6193, '凌云册回族满族乡', 4, 1219), +(6194, '南城司乡', 4, 1219), +(6195, '坡仓乡', 4, 1219), +(6196, '塘湖镇', 4, 1219), +(6197, '大龙华乡', 4, 1219), +(6198, '安格庄乡', 4, 1219), +(6199, '富岗乡', 4, 1219), +(6200, '尉都乡', 4, 1219), +(6201, '易州镇', 4, 1219), +(6202, '桥头乡', 4, 1219), +(6203, '桥家河乡', 4, 1219), +(6204, '梁格庄镇', 4, 1219), +(6205, '流井乡', 4, 1219), +(6206, '牛岗乡', 4, 1219), +(6207, '独乐乡', 4, 1219), +(6208, '狼牙山镇', 4, 1219), +(6209, '甘河净乡', 4, 1219), +(6210, '白马乡', 4, 1219), +(6211, '紫荆关镇', 4, 1219), +(6212, '良岗镇', 4, 1219), +(6213, '蔡家峪乡', 4, 1219), +(6214, '裴山镇', 4, 1219), +(6215, '西山北乡', 4, 1219), +(6216, '西陵镇', 4, 1219), +(6217, '高村乡', 4, 1219), +(6218, '高陌乡', 4, 1219), +(6219, '下河乡', 4, 1220), +(6220, '东旺乡', 4, 1220), +(6221, '产德乡', 4, 1220), +(6222, '党城乡', 4, 1220), +(6223, '北台乡', 4, 1220), +(6224, '孝墓乡', 4, 1220), +(6225, '庄窠乡', 4, 1220), +(6226, '恒州镇', 4, 1220), +(6227, '文德乡', 4, 1220), +(6228, '晓林乡', 4, 1220), +(6229, '灵山镇', 4, 1220), +(6230, '燕赵镇', 4, 1220), +(6231, '羊平镇', 4, 1220), +(6232, '范家庄乡', 4, 1220), +(6233, '路庄子乡', 4, 1220), +(6234, '邸村乡', 4, 1220), +(6235, '郎家庄乡', 4, 1220), +(6236, '齐村乡', 4, 1220), +(6237, '中韩庄乡', 4, 1221); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6238, '固店镇', 4, 1221), +(6239, '寺庄乡', 4, 1221), +(6240, '望都镇', 4, 1221), +(6241, '贾村乡', 4, 1221), +(6242, '赵庄乡', 4, 1221), +(6243, '高岭乡', 4, 1221), +(6244, '黑堡乡', 4, 1221), +(6245, '三坡镇', 4, 1222), +(6246, '东文山乡', 4, 1222), +(6247, '义安镇', 4, 1222), +(6248, '九龙镇', 4, 1222), +(6249, '其中口乡', 4, 1222), +(6250, '娄村满族乡', 4, 1222), +(6251, '宋各庄乡', 4, 1222), +(6252, '明义乡', 4, 1222), +(6253, '永阳镇', 4, 1222), +(6254, '涞水镇', 4, 1222), +(6255, '王村乡', 4, 1222), +(6256, '石亭镇', 4, 1222), +(6257, '胡家庄乡', 4, 1222), +(6258, '赵各庄镇', 4, 1222), +(6259, '龙门乡', 4, 1222), +(6260, '上庄乡', 4, 1223), +(6261, '下北头乡', 4, 1223), +(6262, '东团堡乡', 4, 1223), +(6263, '乌龙沟乡', 4, 1223), +(6264, '北石佛乡', 4, 1223), +(6265, '南屯乡', 4, 1223), +(6266, '塔崖驿乡', 4, 1223), +(6267, '杨家庄镇', 4, 1223), +(6268, '水堡镇', 4, 1223), +(6269, '涞源镇', 4, 1223), +(6270, '烟煤洞乡', 4, 1223), +(6271, '王安镇', 4, 1223), +(6272, '留家庄乡', 4, 1223), +(6273, '走马驿镇', 4, 1223), +(6274, '金家井乡', 4, 1223), +(6275, '银坊镇', 4, 1223), +(6276, '马庄乡', 4, 1223), +(6277, '东仙坡镇', 4, 1224), +(6278, '东城坊镇', 4, 1224), +(6279, '义合庄乡', 4, 1224), +(6280, '刁窝乡', 4, 1224), +(6281, '双塔街道', 4, 1224), +(6282, '孙庄乡', 4, 1224), +(6283, '松林店镇', 4, 1224), +(6284, '林家屯乡', 4, 1224), +(6285, '桃园街道', 4, 1224), +(6286, '清凉寺街道', 4, 1224), +(6287, '百尺竿乡', 4, 1224), +(6288, '码头镇', 4, 1224), +(6289, '豆庄乡', 4, 1224), +(6290, '高官庄镇', 4, 1224), +(6291, '东吕乡', 4, 1225), +(6292, '何桥乡', 4, 1225), +(6293, '冉庄镇', 4, 1225), +(6294, '北店乡', 4, 1225), +(6295, '北王力乡', 4, 1225), +(6296, '大庄镇', 4, 1225), +(6297, '孙村乡', 4, 1225), +(6298, '张登镇', 4, 1225), +(6299, '望亭乡', 4, 1225), +(6300, '李庄乡', 4, 1225), +(6301, '清苑镇', 4, 1225), +(6302, '温仁镇', 4, 1225); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6303, '白团乡', 4, 1225), +(6304, '石桥乡', 4, 1225), +(6305, '臧村镇', 4, 1225), +(6306, '阎庄乡', 4, 1225), +(6307, '阳城镇', 4, 1225), +(6308, '魏村镇', 4, 1225), +(6309, '于家庄乡', 4, 1226), +(6310, '刘家台乡', 4, 1226), +(6311, '南韩村镇', 4, 1226), +(6312, '坨南乡', 4, 1226), +(6313, '大册营镇', 4, 1226), +(6314, '惠阳街道', 4, 1226), +(6315, '方顺桥乡', 4, 1226), +(6316, '满城镇', 4, 1226), +(6317, '白龙乡', 4, 1226), +(6318, '石井乡', 4, 1226), +(6319, '神星镇', 4, 1226), +(6320, '要庄乡', 4, 1226), +(6321, '贤台乡', 4, 1226), +(6322, '万安镇', 4, 1227), +(6323, '北埝头乡', 4, 1227), +(6324, '北郭丹镇', 4, 1227), +(6325, '南庄镇', 4, 1227), +(6326, '大曲堤乡', 4, 1227), +(6327, '大百尺镇', 4, 1227), +(6328, '小陈乡', 4, 1227), +(6329, '林堡乡', 4, 1227), +(6330, '桑园镇', 4, 1227), +(6331, '留史镇', 4, 1227), +(6332, '蠡吾镇', 4, 1227), +(6333, '辛兴镇', 4, 1227), +(6334, '鲍墟乡', 4, 1227), +(6335, '下庄乡', 4, 1228), +(6336, '东下关乡', 4, 1228), +(6337, '北果元乡', 4, 1228), +(6338, '台峪乡', 4, 1228), +(6339, '史家寨乡', 4, 1228), +(6340, '吴王口乡', 4, 1228), +(6341, '城南庄镇', 4, 1228), +(6342, '大台乡', 4, 1228), +(6343, '平阳镇', 4, 1228), +(6344, '王林口乡', 4, 1228), +(6345, '砂窝乡', 4, 1228), +(6346, '阜平镇', 4, 1228), +(6347, '龙泉关镇', 4, 1228), +(6348, '北沙口乡', 4, 1229), +(6349, '双堂乡', 4, 1229), +(6350, '大营镇', 4, 1229), +(6351, '张岗乡', 4, 1229), +(6352, '昝岗镇', 4, 1229), +(6353, '朱各庄乡', 4, 1229), +(6354, '米家务乡', 4, 1229), +(6355, '雄州镇', 4, 1229), +(6356, '龙湾乡', 4, 1229), +(6357, '台鱼乡', 4, 1230), +(6358, '大悲乡', 4, 1230), +(6359, '安阳乡', 4, 1230), +(6360, '河口乡', 4, 1230), +(6361, '白云乡', 4, 1230), +(6362, '神南乡', 4, 1230), +(6363, '腰山镇', 4, 1230), +(6364, '蒲上乡', 4, 1230), +(6365, '蒲阳镇', 4, 1230), +(6366, '高于铺镇', 4, 1230), +(6367, '东盛街道', 4, 1231), +(6368, '东马营乡', 4, 1231); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6369, '兴华路街道', 4, 1231), +(6370, '军城街道', 4, 1231), +(6371, '北城街道', 4, 1231), +(6372, '和平街道', 4, 1231), +(6373, '张六庄乡', 4, 1231), +(6374, '新城镇', 4, 1231), +(6375, '方官镇', 4, 1231), +(6376, '梁家营乡', 4, 1231), +(6377, '泗庄镇', 4, 1231), +(6378, '白沟镇', 4, 1231), +(6379, '肖官营乡', 4, 1231), +(6380, '辛桥乡', 4, 1231), +(6381, '辛立庄镇', 4, 1231), +(6382, '小王果庄', 4, 1232), +(6383, '庞口镇', 4, 1232), +(6384, '庞家佐乡', 4, 1232), +(6385, '晋庄乡', 4, 1232), +(6386, '蒲口乡', 4, 1232), +(6387, '西演镇', 4, 1232), +(6388, '邢家南乡', 4, 1232), +(6389, '高阳镇', 4, 1232), +(6390, '龙化乡', 4, 1232), +(6391, '万全镇', 4, 1233), +(6392, '北新屯乡', 4, 1233), +(6393, '北沙城乡', 4, 1233), +(6394, '孔家庄镇', 4, 1233), +(6395, '安家堡乡', 4, 1233), +(6396, '宣平堡乡', 4, 1233), +(6397, '旧堡乡', 4, 1233), +(6398, '洗马林镇', 4, 1233), +(6399, '膳房堡乡', 4, 1233), +(6400, '郭磊庄镇', 4, 1233), +(6401, '高庙堡乡', 4, 1233), +(6402, '城镇街道', 4, 1234), +(6403, '定方水乡', 4, 1234), +(6404, '段家堡乡', 4, 1234), +(6405, '煤矿街道', 4, 1234), +(6406, '花园乡', 4, 1234), +(6407, '辛庄子乡', 4, 1234), +(6408, '侯家庙乡', 4, 1235), +(6409, '南关街道', 4, 1235), +(6410, '南大街街道', 4, 1235), +(6411, '大北街街道', 4, 1235), +(6412, '天泰寺街道', 4, 1235), +(6413, '工业街街道', 4, 1235), +(6414, '庞家堡镇', 4, 1235), +(6415, '建国街街道', 4, 1235), +(6416, '春光乡', 4, 1235), +(6417, '河子西乡', 4, 1235), +(6418, '皇城街道', 4, 1235), +(6419, '东望山乡', 4, 1236), +(6420, '塔儿村乡', 4, 1236), +(6421, '大仓盖镇', 4, 1236), +(6422, '姚家房镇', 4, 1236), +(6423, '崞村镇', 4, 1236), +(6424, '李家堡乡', 4, 1236), +(6425, '江家屯乡', 4, 1236), +(6426, '沙岭子镇', 4, 1236), +(6427, '洋河南镇', 4, 1236), +(6428, '深井镇', 4, 1236), +(6429, '王家湾乡', 4, 1236), +(6430, '贾家营镇', 4, 1236), +(6431, '赵川镇', 4, 1236); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6432, '顾家营镇', 4, 1236), +(6433, '七甲乡', 4, 1237), +(6434, '三工地镇', 4, 1237), +(6435, '下马圈乡', 4, 1237), +(6436, '八道沟镇', 4, 1237), +(6437, '南壕堑镇', 4, 1237), +(6438, '大苏计乡', 4, 1237), +(6439, '大营盘乡', 4, 1237), +(6440, '大青沟镇', 4, 1237), +(6441, '套里庄乡', 4, 1237), +(6442, '小蒜沟镇', 4, 1237), +(6443, '炕塄乡', 4, 1237), +(6444, '甲石河乡', 4, 1237), +(6445, '石井乡', 4, 1237), +(6446, '红土梁镇', 4, 1237), +(6447, '四台嘴乡', 4, 1238), +(6448, '清三营乡', 4, 1238), +(6449, '狮子沟乡', 4, 1238), +(6450, '白旗乡', 4, 1238), +(6451, '石嘴子乡', 4, 1238), +(6452, '石窑子乡', 4, 1238), +(6453, '红旗营乡', 4, 1238), +(6454, '西湾子镇', 4, 1238), +(6455, '驿马图乡', 4, 1238), +(6456, '高家营镇', 4, 1238), +(6457, '丹清河乡', 4, 1239), +(6458, '二号卜乡', 4, 1239), +(6459, '哈必嘎乡', 4, 1239), +(6460, '土城子镇', 4, 1239), +(6461, '处长地乡', 4, 1239), +(6462, '屯垦镇', 4, 1239), +(6463, '康保镇', 4, 1239), +(6464, '张纪镇', 4, 1239), +(6465, '忠义乡', 4, 1239), +(6466, '李家地镇', 4, 1239), +(6467, '满德堂乡', 4, 1239), +(6468, '照阳河镇', 4, 1239), +(6469, '芦家营乡', 4, 1239), +(6470, '邓油坊镇', 4, 1239), +(6471, '阎油房乡', 4, 1239), +(6472, '三号乡', 4, 1240), +(6473, '两面井乡', 4, 1240), +(6474, '二台镇', 4, 1240), +(6475, '二泉井乡', 4, 1240), +(6476, '公会镇', 4, 1240), +(6477, '单晶河乡', 4, 1240), +(6478, '台路沟乡', 4, 1240), +(6479, '大囫囵镇', 4, 1240), +(6480, '大河乡', 4, 1240), +(6481, '小二台乡', 4, 1240), +(6482, '张北镇', 4, 1240), +(6483, '战海乡', 4, 1240), +(6484, '油篓沟乡', 4, 1240), +(6485, '海流图乡', 4, 1240), +(6486, '白庙滩乡', 4, 1240), +(6487, '郝家营乡', 4, 1240), +(6488, '馒头营乡', 4, 1240), +(6489, '黄石崖乡', 4, 1240), +(6490, '太平庄乡', 4, 1241), +(6491, '头百户镇', 4, 1241), +(6492, '左卫镇', 4, 1241), +(6493, '怀安城镇', 4, 1241), +(6494, '柴沟堡镇', 4, 1241); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6495, '渡口堡乡', 4, 1241), +(6496, '王虎屯乡', 4, 1241), +(6497, '第三堡乡', 4, 1241), +(6498, '第六屯乡', 4, 1241), +(6499, '西沙城乡', 4, 1241), +(6500, '西湾堡乡', 4, 1241), +(6501, '东八里乡', 4, 1242), +(6502, '东花园镇', 4, 1242), +(6503, '北辛堡镇', 4, 1242), +(6504, '土木镇', 4, 1242), +(6505, '大黄庄镇', 4, 1242), +(6506, '存瑞镇', 4, 1242), +(6507, '孙庄子乡', 4, 1242), +(6508, '官厅镇', 4, 1242), +(6509, '小南辛堡镇', 4, 1242), +(6510, '新保安镇', 4, 1242), +(6511, '桑园镇', 4, 1242), +(6512, '沙城镇', 4, 1242), +(6513, '狼山乡', 4, 1242), +(6514, '王家楼回族乡', 4, 1242), +(6515, '瑞云观乡', 4, 1242), +(6516, '西八里镇', 4, 1242), +(6517, '鸡鸣驿乡', 4, 1242), +(6518, '五一路街道', 4, 1243), +(6519, '南站街道', 4, 1243), +(6520, '姚家庄镇', 4, 1243), +(6521, '工业路街道', 4, 1243), +(6522, '红旗楼街道', 4, 1243), +(6523, '老鸦庄镇', 4, 1243), +(6524, '胜利北路街道', 4, 1243), +(6525, '花园街街道', 4, 1243), +(6526, '马路东街道', 4, 1243), +(6527, '东窑子镇', 4, 1244), +(6528, '南营坊街道', 4, 1244), +(6529, '堡子里街道', 4, 1244), +(6530, '大境门街道', 4, 1244), +(6531, '工人新村街道', 4, 1244), +(6532, '新华街街道', 4, 1244), +(6533, '明德北街街道', 4, 1244), +(6534, '明德南街街道', 4, 1244), +(6535, '沈家屯镇', 4, 1244), +(6536, '丰源店乡', 4, 1245), +(6537, '九连城镇', 4, 1245), +(6538, '二道渠乡', 4, 1245), +(6539, '大二号回族乡', 4, 1245), +(6540, '小厂镇', 4, 1245), +(6541, '小河子乡', 4, 1245), +(6542, '平定堡镇', 4, 1245), +(6543, '白土窑乡', 4, 1245), +(6544, '莲花滩乡', 4, 1245), +(6545, '西辛营乡', 4, 1245), +(6546, '长梁乡', 4, 1245), +(6547, '闪电河乡', 4, 1245), +(6548, '高山堡乡', 4, 1245), +(6549, '黄盖淖镇', 4, 1245), +(6550, '东小庄乡', 4, 1246), +(6551, '五堡镇', 4, 1246), +(6552, '保岱镇', 4, 1246), +(6553, '卧佛寺乡', 4, 1246), +(6554, '大堡镇', 4, 1246), +(6555, '大河南乡', 4, 1246); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6556, '张家堡镇', 4, 1246), +(6557, '栾庄乡', 4, 1246), +(6558, '武家沟镇', 4, 1246), +(6559, '河东镇', 4, 1246), +(6560, '涿鹿镇', 4, 1246), +(6561, '温泉屯乡', 4, 1246), +(6562, '矾山镇', 4, 1246), +(6563, '蟒石口乡', 4, 1246), +(6564, '谢家堡乡', 4, 1246), +(6565, '赵家蓬区', 4, 1246), +(6566, '辉耀乡', 4, 1246), +(6567, '黑山寺乡', 4, 1246), +(6568, '下宫村乡', 4, 1247), +(6569, '代王城镇', 4, 1247), +(6570, '北水泉镇', 4, 1247), +(6571, '南岭庄乡', 4, 1247), +(6572, '南杨庄乡', 4, 1247), +(6573, '南留庄镇', 4, 1247), +(6574, '吉家庄镇', 4, 1247), +(6575, '宋庄镇', 4, 1247), +(6576, '常宁乡', 4, 1247), +(6577, '暖泉镇', 4, 1247), +(6578, '杨庄窠乡', 4, 1247), +(6579, '柏树乡', 4, 1247), +(6580, '桃花镇', 4, 1247), +(6581, '涌泉庄乡', 4, 1247), +(6582, '白乐镇', 4, 1247), +(6583, '白草村乡', 4, 1247), +(6584, '草沟堡乡', 4, 1247), +(6585, '蔚州镇', 4, 1247), +(6586, '西合营镇', 4, 1247), +(6587, '阳眷镇', 4, 1247), +(6588, '陈家洼乡', 4, 1247), +(6589, '黄梅乡', 4, 1247), +(6590, '三道川乡', 4, 1248), +(6591, '东万口乡', 4, 1248), +(6592, '东卯镇', 4, 1248), +(6593, '云州乡', 4, 1248), +(6594, '后城镇', 4, 1248), +(6595, '大海陀乡', 4, 1248), +(6596, '样田乡', 4, 1248), +(6597, '炮梁乡', 4, 1248), +(6598, '独石口镇', 4, 1248), +(6599, '田家窑镇', 4, 1248), +(6600, '白草镇', 4, 1248), +(6601, '茨营子乡', 4, 1248), +(6602, '赤城镇', 4, 1248), +(6603, '镇宁堡乡', 4, 1248), +(6604, '雕鹗镇', 4, 1248), +(6605, '马营乡', 4, 1248), +(6606, '龙关镇', 4, 1248), +(6607, '龙门所镇', 4, 1248), +(6608, '三马坊乡', 4, 1249), +(6609, '东井集镇', 4, 1249), +(6610, '东坊城堡乡', 4, 1249), +(6611, '东城镇', 4, 1249), +(6612, '井儿沟乡', 4, 1249), +(6613, '化稍营镇', 4, 1249), +(6614, '大田洼乡', 4, 1249), +(6615, '揣骨疃镇', 4, 1249), +(6616, '浮图讲乡', 4, 1249), +(6617, '西城镇', 4, 1249), +(6618, '要家庄乡', 4, 1249), +(6619, '辛堡乡', 4, 1249); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6620, '马圈堡乡', 4, 1249), +(6621, '高墙乡', 4, 1249), +(6622, '万胜永乡', 4, 1250), +(6623, '五道营乡', 4, 1250), +(6624, '凤山镇', 4, 1250), +(6625, '北头营乡', 4, 1250), +(6626, '南关蒙古族乡', 4, 1250), +(6627, '四岔口乡', 4, 1250), +(6628, '土城镇', 4, 1250), +(6629, '外沟门乡', 4, 1250), +(6630, '大滩镇', 4, 1250), +(6631, '大阁镇', 4, 1250), +(6632, '天桥镇', 4, 1250), +(6633, '小坝子乡', 4, 1250), +(6634, '杨木栅子乡', 4, 1250), +(6635, '汤河乡', 4, 1250), +(6636, '波罗诺镇', 4, 1250), +(6637, '王营乡', 4, 1250), +(6638, '石人沟乡', 4, 1250), +(6639, '窟窿山乡', 4, 1250), +(6640, '胡麻营乡', 4, 1250), +(6641, '苏家店乡', 4, 1250), +(6642, '草原乡', 4, 1250), +(6643, '西官营乡', 4, 1250), +(6644, '选将营乡', 4, 1250), +(6645, '鱼儿山镇', 4, 1250), +(6646, '黄旗镇', 4, 1250), +(6647, '黑山咀镇', 4, 1250), +(6648, '三道河乡', 4, 1251), +(6649, '上石洞乡', 4, 1251), +(6650, '八卦岭满族乡', 4, 1251), +(6651, '六道河镇', 4, 1251), +(6652, '兴隆镇', 4, 1251), +(6653, '北水泉乡', 4, 1251), +(6654, '北营房镇', 4, 1251), +(6655, '半壁山镇', 4, 1251), +(6656, '南天门满族乡', 4, 1251), +(6657, '大杖子乡', 4, 1251), +(6658, '大水泉乡', 4, 1251), +(6659, '孤山子乡', 4, 1251), +(6660, '安子岭乡', 4, 1251), +(6661, '平安堡镇', 4, 1251), +(6662, '挂兰峪镇', 4, 1251), +(6663, '李家营乡', 4, 1251), +(6664, '蓝旗营乡', 4, 1251), +(6665, '蘑菇峪乡', 4, 1251), +(6666, '陡子峪乡', 4, 1251), +(6667, '青松岭镇', 4, 1251), +(6668, '中华路街道', 4, 1252), +(6669, '冯营子镇', 4, 1252), +(6670, '大石庙镇', 4, 1252), +(6671, '头道牌楼街道', 4, 1252), +(6672, '新华路街道', 4, 1252), +(6673, '桥东街道', 4, 1252), +(6674, '水泉沟镇', 4, 1252), +(6675, '潘家沟街道', 4, 1252), +(6676, '牛圈子沟镇', 4, 1252), +(6677, '狮子沟镇', 4, 1252), +(6678, '石洞子沟街道', 4, 1252), +(6679, '西大街街道', 4, 1252), +(6680, '偏桥子镇', 4, 1253); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6681, '双塔山镇', 4, 1253), +(6682, '大庙镇', 4, 1253), +(6683, '滦河镇', 4, 1253), +(6684, '三义永乡', 4, 1254), +(6685, '下伙房乡', 4, 1254), +(6686, '克勒沟镇', 4, 1254), +(6687, '兰旗卡伦乡', 4, 1254), +(6688, '半截塔镇', 4, 1254), +(6689, '南山嘴乡', 4, 1254), +(6690, '哈里哈乡', 4, 1254), +(6691, '四合永镇', 4, 1254), +(6692, '四道沟乡', 4, 1254), +(6693, '围场镇', 4, 1254), +(6694, '城子乡', 4, 1254), +(6695, '大唤起乡', 4, 1254), +(6696, '大头山乡', 4, 1254), +(6697, '姜家店乡', 4, 1254), +(6698, '宝元栈乡', 4, 1254), +(6699, '山湾子乡', 4, 1254), +(6700, '广发永乡', 4, 1254), +(6701, '张家湾乡', 4, 1254), +(6702, '御道口乡', 4, 1254), +(6703, '新地乡', 4, 1254), +(6704, '新拨乡', 4, 1254), +(6705, '朝阳地镇', 4, 1254), +(6706, '朝阳湾镇', 4, 1254), +(6707, '杨家湾乡', 4, 1254), +(6708, '棋盘山镇', 4, 1254), +(6709, '燕格柏乡', 4, 1254), +(6710, '牌楼乡', 4, 1254), +(6711, '石桌子乡', 4, 1254), +(6712, '老窝铺乡', 4, 1254), +(6713, '育太和乡', 4, 1254), +(6714, '腰站乡', 4, 1254), +(6715, '西龙头乡', 4, 1254), +(6716, '道坝子乡', 4, 1254), +(6717, '郭家湾乡', 4, 1254), +(6718, '银窝沟乡', 4, 1254), +(6719, '黄土坎乡', 4, 1254), +(6720, '龙头山乡', 4, 1254), +(6721, '东大地乡', 4, 1255), +(6722, '东黄花川乡', 4, 1255), +(6723, '亮甲台乡', 4, 1255), +(6724, '化皮溜子乡', 4, 1255), +(6725, '塌山乡', 4, 1255), +(6726, '大字沟门乡', 4, 1255), +(6727, '大石柱子乡', 4, 1255), +(6728, '孟子岭乡', 4, 1255), +(6729, '宽城镇', 4, 1255), +(6730, '峪耳崖镇', 4, 1255), +(6731, '板城镇', 4, 1255), +(6732, '汤道河镇', 4, 1255), +(6733, '独石沟乡', 4, 1255), +(6734, '碾子峪乡', 4, 1255), +(6735, '苇子沟乡', 4, 1255), +(6736, '铧尖乡', 4, 1255), +(6737, '饽罗台乡', 4, 1255), +(6738, '龙须门镇', 4, 1255), +(6739, '七家岱满族乡', 4, 1256), +(6740, '七沟镇', 4, 1256), +(6741, '党坝镇', 4, 1256), +(6742, '南五十家子蒙古族满族镇', 4, 1256); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6743, '卧龙镇', 4, 1256), +(6744, '台头山乡', 4, 1256), +(6745, '小寺沟镇', 4, 1256), +(6746, '平房满族蒙古族乡', 4, 1256), +(6747, '平泉镇', 4, 1256), +(6748, '杨树岭镇', 4, 1256), +(6749, '松树台乡', 4, 1256), +(6750, '柳溪满族乡', 4, 1256), +(6751, '榆树林子镇', 4, 1256), +(6752, '王土房乡', 4, 1256), +(6753, '茅兰沟满族蒙古族乡', 4, 1256), +(6754, '蒙和乌苏蒙古族乡', 4, 1256), +(6755, '道虎沟乡', 4, 1256), +(6756, '郭杖子满族乡', 4, 1256), +(6757, '黄土梁子镇', 4, 1256), +(6758, '三家乡', 4, 1257), +(6759, '三沟镇', 4, 1257), +(6760, '上板城镇', 4, 1257), +(6761, '上谷乡', 4, 1257), +(6762, '下板城镇', 4, 1257), +(6763, '东小白旗乡', 4, 1257), +(6764, '两家满族乡', 4, 1257), +(6765, '五道河乡', 4, 1257), +(6766, '仓子乡', 4, 1257), +(6767, '八家乡', 4, 1257), +(6768, '六沟镇', 4, 1257), +(6769, '刘杖子乡', 4, 1257), +(6770, '双峰寺镇', 4, 1257), +(6771, '大营子乡', 4, 1257), +(6772, '头沟镇', 4, 1257), +(6773, '孟家院乡', 4, 1257), +(6774, '岔沟乡', 4, 1257), +(6775, '岗子满族乡', 4, 1257), +(6776, '新杖子乡', 4, 1257), +(6777, '满杖子乡', 4, 1257), +(6778, '甲山镇', 4, 1257), +(6779, '石灰窑乡', 4, 1257), +(6780, '磴上乡', 4, 1257), +(6781, '鞍匠乡', 4, 1257), +(6782, '高寺台镇', 4, 1257), +(6783, '两间房乡', 4, 1258), +(6784, '五道营子满族乡', 4, 1258), +(6785, '付家店满族乡', 4, 1258), +(6786, '付营子乡', 4, 1258), +(6787, '大屯满族乡', 4, 1258), +(6788, '安纯沟门满族乡', 4, 1258), +(6789, '小营满族乡', 4, 1258), +(6790, '巴克什营镇', 4, 1258), +(6791, '平坊满族乡', 4, 1258), +(6792, '张百湾镇', 4, 1258), +(6793, '涝洼乡', 4, 1258), +(6794, '滦平镇', 4, 1258), +(6795, '火斗山乡', 4, 1258), +(6796, '红旗镇', 4, 1258), +(6797, '虎什哈镇', 4, 1258), +(6798, '西地满族乡', 4, 1258), +(6799, '西沟满族乡', 4, 1258), +(6800, '邓厂满族乡', 4, 1258), +(6801, '金沟屯镇', 4, 1258), +(6802, '长山峪镇', 4, 1258); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6803, '陈栅子乡', 4, 1258), +(6804, '马营子满族乡', 4, 1258), +(6805, '七家镇', 4, 1259), +(6806, '中关镇', 4, 1259), +(6807, '偏坡营满族乡', 4, 1259), +(6808, '八达营蒙古族乡', 4, 1259), +(6809, '唐三营镇', 4, 1259), +(6810, '太平庄满族乡', 4, 1259), +(6811, '尹家营满族乡', 4, 1259), +(6812, '山湾乡', 4, 1259), +(6813, '庙子沟蒙古族满族乡', 4, 1259), +(6814, '张三营镇', 4, 1259), +(6815, '旧屯满族乡', 4, 1259), +(6816, '步古沟镇', 4, 1259), +(6817, '汤头沟镇', 4, 1259), +(6818, '湾沟门乡', 4, 1259), +(6819, '白虎沟满族蒙古族乡', 4, 1259), +(6820, '碱房乡', 4, 1259), +(6821, '章吉营乡', 4, 1259), +(6822, '茅荆坝乡', 4, 1259), +(6823, '荒地乡', 4, 1259), +(6824, '蓝旗镇', 4, 1259), +(6825, '西阿超满族蒙古族乡', 4, 1259), +(6826, '郭家屯镇', 4, 1259), +(6827, '隆化镇', 4, 1259), +(6828, '韩家店乡', 4, 1259), +(6829, '韩麻营镇', 4, 1259), +(6830, '北马圈子镇', 4, 1260), +(6831, '寿王坟镇', 4, 1260), +(6832, '汪家庄镇', 4, 1260), +(6833, '鹰手营子镇', 4, 1260), +(6834, '冀州镇', 4, 1261), +(6835, '北漳淮乡', 4, 1261), +(6836, '南午村镇', 4, 1261), +(6837, '周村镇', 4, 1261), +(6838, '官道李镇', 4, 1261), +(6839, '小寨乡', 4, 1261), +(6840, '徐家庄乡', 4, 1261), +(6841, '码头李镇', 4, 1261), +(6842, '西王镇', 4, 1261), +(6843, '门庄乡', 4, 1261), +(6844, '魏屯镇', 4, 1261), +(6845, '东黄城乡', 4, 1262), +(6846, '南王庄镇', 4, 1262), +(6847, '大何庄乡', 4, 1262), +(6848, '大子文乡', 4, 1262), +(6849, '安平镇', 4, 1262), +(6850, '程油子乡', 4, 1262), +(6851, '西两洼乡', 4, 1262), +(6852, '马店镇', 4, 1262), +(6853, '三朗乡', 4, 1263), +(6854, '军屯镇', 4, 1263), +(6855, '夏庄镇', 4, 1263), +(6856, '建国镇', 4, 1263), +(6857, '房庄乡', 4, 1263), +(6858, '故城镇', 4, 1263), +(6859, '武官寨镇', 4, 1263), +(6860, '西半屯镇', 4, 1263), +(6861, '辛庄乡', 4, 1263), +(6862, '郑口镇', 4, 1263), +(6863, '里老乡', 4, 1263); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6864, '青罕镇', 4, 1263), +(6865, '饶阳店镇', 4, 1263), +(6866, '刘集乡', 4, 1264), +(6867, '北留智镇', 4, 1264), +(6868, '后留名府乡', 4, 1264), +(6869, '安陵镇', 4, 1264), +(6870, '广川镇', 4, 1264), +(6871, '景州镇', 4, 1264), +(6872, '杜桥镇', 4, 1264), +(6873, '梁集乡', 4, 1264), +(6874, '洚河流镇', 4, 1264), +(6875, '温城乡', 4, 1264), +(6876, '王瞳镇', 4, 1264), +(6877, '王谦寺镇', 4, 1264), +(6878, '留智庙镇', 4, 1264), +(6879, '连镇乡', 4, 1264), +(6880, '青兰乡', 4, 1264), +(6881, '龙华镇', 4, 1264), +(6882, '唐林乡', 4, 1265), +(6883, '嘉会镇', 4, 1265), +(6884, '大营镇', 4, 1265), +(6885, '张秀屯乡', 4, 1265), +(6886, '恩察镇', 4, 1265), +(6887, '新屯乡', 4, 1265), +(6888, '枣强镇', 4, 1265), +(6889, '王均乡', 4, 1265), +(6890, '王常乡', 4, 1265), +(6891, '肖张镇', 4, 1265), +(6892, '马屯镇', 4, 1265), +(6893, '中华街道', 4, 1266), +(6894, '何家庄乡', 4, 1266), +(6895, '大麻森乡', 4, 1266), +(6896, '彭杜村乡', 4, 1266), +(6897, '河东街道', 4, 1266), +(6898, '河西街道', 4, 1266), +(6899, '赵圈镇', 4, 1266), +(6900, '路北街道', 4, 1266), +(6901, '邓庄乡', 4, 1266), +(6902, '郑家河沿镇', 4, 1266), +(6903, '北代乡', 4, 1267), +(6904, '周家窝乡', 4, 1267), +(6905, '孙庄乡', 4, 1267), +(6906, '武强镇', 4, 1267), +(6907, '街关镇', 4, 1267), +(6908, '豆村乡', 4, 1267), +(6909, '圈头乡', 4, 1268), +(6910, '大紫塔乡', 4, 1268), +(6911, '审坡镇', 4, 1268), +(6912, '武邑镇', 4, 1268), +(6913, '清凉店镇', 4, 1268), +(6914, '肖桥头镇', 4, 1268), +(6915, '赵桥镇', 4, 1268), +(6916, '韩庄镇', 4, 1268), +(6917, '龙店乡', 4, 1268), +(6918, '东安庄乡', 4, 1269), +(6919, '乔屯乡', 4, 1269), +(6920, '兵曹乡', 4, 1269), +(6921, '前磨头镇', 4, 1269), +(6922, '北溪村乡', 4, 1269), +(6923, '唐奉镇', 4, 1269), +(6924, '大冯营乡', 4, 1269), +(6925, '大堤镇', 4, 1269), +(6926, '大屯乡', 4, 1269), +(6927, '太古庄乡', 4, 1269), +(6928, '护驾迟镇', 4, 1269); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6929, '榆科镇', 4, 1269), +(6930, '深州镇', 4, 1269), +(6931, '王家井镇', 4, 1269), +(6932, '穆村乡', 4, 1269), +(6933, '辰时镇', 4, 1269), +(6934, '魏桥镇', 4, 1269), +(6935, '古城镇', 4, 1270), +(6936, '大白乡', 4, 1270), +(6937, '崔家庙镇', 4, 1270), +(6938, '建桥乡', 4, 1270), +(6939, '漫河乡', 4, 1270), +(6940, '王集乡', 4, 1270), +(6941, '码头镇', 4, 1270), +(6942, '蒋坊乡', 4, 1270), +(6943, '阜城镇', 4, 1270), +(6944, '霞口镇', 4, 1270), +(6945, '东里满乡', 4, 1271), +(6946, '五公镇', 4, 1271), +(6947, '大官亭乡', 4, 1271), +(6948, '大尹村镇', 4, 1271), +(6949, '王同岳乡', 4, 1271), +(6950, '留楚乡', 4, 1271), +(6951, '饶阳镇', 4, 1271), +(6952, '新集镇', 4, 1272), +(6953, '李旗庄镇', 4, 1272), +(6954, '杨庄镇', 4, 1272), +(6955, '段甲岭镇', 4, 1272), +(6956, '洵阳镇', 4, 1272), +(6957, '燕郊镇', 4, 1272), +(6958, '皇庄镇', 4, 1272), +(6959, '高楼镇', 4, 1272), +(6960, '黄土庄镇', 4, 1272), +(6961, '齐心庄镇', 4, 1272), +(6962, '东湾乡', 4, 1273), +(6963, '固安镇', 4, 1273), +(6964, '宫村镇', 4, 1273), +(6965, '彭村乡', 4, 1273), +(6966, '柳泉镇', 4, 1273), +(6967, '渠沟乡', 4, 1273), +(6968, '牛驼镇', 4, 1273), +(6969, '礼让店乡', 4, 1273), +(6970, '马庄镇', 4, 1273), +(6971, '夏垫镇', 4, 1274), +(6972, '大厂镇', 4, 1274), +(6973, '祁各庄乡', 4, 1274), +(6974, '邵府乡', 4, 1274), +(6975, '陈府乡', 4, 1274), +(6976, '北位乡', 4, 1275), +(6977, '南赵扶镇', 4, 1275), +(6978, '大尚屯镇', 4, 1275), +(6979, '大广安乡', 4, 1275), +(6980, '平舒镇', 4, 1275), +(6981, '旺村镇', 4, 1275), +(6982, '权村镇', 4, 1275), +(6983, '留各庄镇', 4, 1275), +(6984, '臧屯乡', 4, 1275), +(6985, '里坦镇', 4, 1275), +(6986, '东沽港镇', 4, 1276), +(6987, '仇庄乡', 4, 1276), +(6988, '光明西道街道', 4, 1276), +(6989, '北史家务乡', 4, 1276), +(6990, '杨税务乡', 4, 1276), +(6991, '码头镇', 4, 1276), +(6992, '落垡镇', 4, 1276), +(6993, '葛渔城镇', 4, 1276), +(6994, '调河头乡', 4, 1276); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(6995, '银河南路街道', 4, 1276), +(6996, '万庄镇', 4, 1277), +(6997, '九州镇', 4, 1277), +(6998, '北旺乡', 4, 1277), +(6999, '南尖塔镇', 4, 1277), +(7000, '新开路街道', 4, 1277), +(7001, '爱民东道街道', 4, 1277), +(7002, '解放道街道', 4, 1277), +(7003, '银河北路街道', 4, 1277), +(7004, '兴隆宫镇', 4, 1278), +(7005, '史各庄镇', 4, 1278), +(7006, '大围河回族满族乡', 4, 1278), +(7007, '大柳河镇', 4, 1278), +(7008, '大留镇镇', 4, 1278), +(7009, '孙氏镇', 4, 1278), +(7010, '左各庄镇', 4, 1278), +(7011, '德归镇', 4, 1278), +(7012, '文安镇', 4, 1278), +(7013, '新镇镇', 4, 1278), +(7014, '滩里镇', 4, 1278), +(7015, '苏桥镇', 4, 1278), +(7016, '赵各庄镇', 4, 1278), +(7017, '三圣口乡', 4, 1279), +(7018, '刘街乡', 4, 1279), +(7019, '别古庄镇', 4, 1279), +(7020, '后奕镇', 4, 1279), +(7021, '曹家务乡', 4, 1279), +(7022, '永清镇', 4, 1279), +(7023, '管家务回族乡', 4, 1279), +(7024, '里澜城镇', 4, 1279), +(7025, '韩村镇', 4, 1279), +(7026, '龙虎庄乡', 4, 1279), +(7027, '东杨庄乡', 4, 1280), +(7028, '东段乡', 4, 1280), +(7029, '信安镇', 4, 1280), +(7030, '南孟镇', 4, 1280), +(7031, '堂二里镇', 4, 1280), +(7032, '岔河集乡', 4, 1280), +(7033, '康仙庄乡', 4, 1280), +(7034, '杨芬港乡', 4, 1280), +(7035, '煎茶铺镇', 4, 1280), +(7036, '王庄子乡', 4, 1280), +(7037, '胜芳镇', 4, 1280), +(7038, '霸州镇', 4, 1280), +(7039, '五百户镇', 4, 1281), +(7040, '刘宋镇', 4, 1281), +(7041, '安头屯镇', 4, 1281), +(7042, '安平镇', 4, 1281), +(7043, '淑阳镇', 4, 1281), +(7044, '渠口镇', 4, 1281), +(7045, '蒋辛屯镇', 4, 1281), +(7046, '钱旺乡', 4, 1281), +(7047, '钳屯乡', 4, 1281), +(7048, '东光镇', 4, 1282), +(7049, '于桥乡', 4, 1282), +(7050, '南霞口镇', 4, 1282), +(7051, '大单镇', 4, 1282), +(7052, '找王镇', 4, 1282), +(7053, '灯明寺镇', 4, 1282), +(7054, '秦村镇', 4, 1282), +(7055, '连镇镇', 4, 1282), +(7056, '龙王李乡', 4, 1282), +(7057, '七间房乡', 4, 1283); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7058, '于村乡', 4, 1283), +(7059, '出岸镇', 4, 1283), +(7060, '北汉乡', 4, 1283), +(7061, '北辛庄乡', 4, 1283), +(7062, '吕公堡镇', 4, 1283), +(7063, '新华路街道', 4, 1283), +(7064, '梁召镇', 4, 1283), +(7065, '永丰路街道', 4, 1283), +(7066, '石门桥镇', 4, 1283), +(7067, '苟各庄镇', 4, 1283), +(7068, '莫阝州镇', 4, 1283), +(7069, '西环路街道', 4, 1283), +(7070, '议论堡乡', 4, 1283), +(7071, '辛中驿镇', 4, 1283), +(7072, '长丰镇', 4, 1283), +(7073, '青塔乡', 4, 1283), +(7074, '麻家坞乡', 4, 1283), +(7075, '乌马营镇', 4, 1284), +(7076, '冯家口镇', 4, 1284), +(7077, '刘八里乡', 4, 1284), +(7078, '南皮镇', 4, 1284), +(7079, '大浪淀乡', 4, 1284), +(7080, '寨子镇', 4, 1284), +(7081, '潞灌乡', 4, 1284), +(7082, '王寺镇', 4, 1284), +(7083, '鲍官屯镇', 4, 1284), +(7084, '于集镇', 4, 1285), +(7085, '何庄乡', 4, 1285), +(7086, '安陵镇', 4, 1285), +(7087, '宋门乡', 4, 1285), +(7088, '曹家洼乡', 4, 1285), +(7089, '杨家寺乡', 4, 1285), +(7090, '桑园镇', 4, 1285), +(7091, '梁集镇', 4, 1285), +(7092, '沟店铺乡', 4, 1285), +(7093, '铁城镇', 4, 1285), +(7094, '孟村镇', 4, 1286), +(7095, '宋庄子乡', 4, 1286), +(7096, '新县镇', 4, 1286), +(7097, '牛进庄乡', 4, 1286), +(7098, '辛店镇', 4, 1286), +(7099, '高寨镇', 4, 1286), +(7100, '东环街道', 4, 1287), +(7101, '南大街街道', 4, 1287), +(7102, '小赵庄乡', 4, 1287), +(7103, '建设北街街道', 4, 1287), +(7104, '车站街道', 4, 1287), +(7105, '道东街道', 4, 1287), +(7106, '仵龙堂乡', 4, 1288), +(7107, '兴济镇', 4, 1288), +(7108, '刘家庙乡', 4, 1288), +(7109, '大官厅乡', 4, 1288), +(7110, '大褚村回族乡', 4, 1288), +(7111, '姚官屯乡', 4, 1288), +(7112, '崔尔庄镇', 4, 1288), +(7113, '张官屯乡', 4, 1288), +(7114, '捷地回族乡', 4, 1288), +(7115, '旧州镇', 4, 1288), +(7116, '李天木回族乡', 4, 1288), +(7117, '杜林回族乡', 4, 1288), +(7118, '杜生镇', 4, 1288), +(7119, '汪家铺乡', 4, 1288), +(7120, '纸房头乡', 4, 1288); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7121, '薛官屯乡', 4, 1288), +(7122, '风化店乡', 4, 1288), +(7123, '高川乡', 4, 1288), +(7124, '黄递铺乡', 4, 1288), +(7125, '兴村乡', 4, 1289), +(7126, '北石槽乡', 4, 1289), +(7127, '卧佛堂镇', 4, 1289), +(7128, '尊祖庄乡', 4, 1289), +(7129, '故仙乡', 4, 1289), +(7130, '时村乡', 4, 1289), +(7131, '景和镇', 4, 1289), +(7132, '束城镇', 4, 1289), +(7133, '果子洼回族乡', 4, 1289), +(7134, '沙河桥镇', 4, 1289), +(7135, '沙洼乡', 4, 1289), +(7136, '瀛州镇', 4, 1289), +(7137, '留古寺镇', 4, 1289), +(7138, '米各庄镇', 4, 1289), +(7139, '行别营乡', 4, 1289), +(7140, '西九吉乡', 4, 1289), +(7141, '诗经村乡', 4, 1289), +(7142, '郭家村乡', 4, 1289), +(7143, '黎民居乡', 4, 1289), +(7144, '龙华店乡', 4, 1289), +(7145, '交河镇', 4, 1290), +(7146, '古楼街道', 4, 1290), +(7147, '四营乡', 4, 1290), +(7148, '富镇镇', 4, 1290), +(7149, '寺门村镇', 4, 1290), +(7150, '文庙镇', 4, 1290), +(7151, '河东街道', 4, 1290), +(7152, '泊镇', 4, 1290), +(7153, '洼里王镇', 4, 1290), +(7154, '王武庄乡', 4, 1290), +(7155, '营子乡', 4, 1290), +(7156, '西辛店乡', 4, 1290), +(7157, '解放街道', 4, 1290), +(7158, '郝村镇', 4, 1290), +(7159, '齐桥镇', 4, 1290), +(7160, '小山乡', 4, 1291), +(7161, '张会亭乡', 4, 1291), +(7162, '苏基镇', 4, 1291), +(7163, '赵毛陶乡', 4, 1291), +(7164, '辛集镇', 4, 1291), +(7165, '香坊乡', 4, 1291), +(7166, '高湾镇', 4, 1291), +(7167, '临河乡', 4, 1292), +(7168, '乐寿镇', 4, 1292), +(7169, '十五级乡', 4, 1292), +(7170, '南河头乡', 4, 1292), +(7171, '商林乡', 4, 1292), +(7172, '垒头乡', 4, 1292), +(7173, '小平王乡', 4, 1292), +(7174, '张村乡', 4, 1292), +(7175, '徐留高乡', 4, 1292), +(7176, '本斋回族乡', 4, 1292), +(7177, '段村乡', 4, 1292), +(7178, '河城街镇', 4, 1292), +(7179, '淮镇镇', 4, 1292), +(7180, '西城乡', 4, 1292), +(7181, '郭庄镇', 4, 1292), +(7182, '陈庄乡', 4, 1292), +(7183, '陌南乡', 4, 1292), +(7184, '韩村乡', 4, 1292), +(7185, '千童镇', 4, 1293); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7186, '圣佛镇', 4, 1293), +(7187, '孟店乡', 4, 1293), +(7188, '小庄乡', 4, 1293), +(7189, '小营乡', 4, 1293), +(7190, '常庄乡', 4, 1293), +(7191, '庆云镇', 4, 1293), +(7192, '望树镇', 4, 1293), +(7193, '杨集乡', 4, 1293), +(7194, '盐山镇', 4, 1293), +(7195, '边务乡', 4, 1293), +(7196, '韩集镇', 4, 1293), +(7197, '万里镇', 4, 1294), +(7198, '付家佐乡', 4, 1294), +(7199, '尚村镇', 4, 1294), +(7200, '师素乡', 4, 1294), +(7201, '梁家村镇', 4, 1294), +(7202, '河北留善寺乡', 4, 1294), +(7203, '窝北镇', 4, 1294), +(7204, '肃宁镇', 4, 1294), +(7205, '邵庄乡', 4, 1294), +(7206, '公园街道', 4, 1295), +(7207, '南湖街道', 4, 1295), +(7208, '南环中路街道', 4, 1295), +(7209, '南陈屯乡', 4, 1295), +(7210, '小王庄镇', 4, 1295), +(7211, '市场街道', 4, 1295), +(7212, '水月寺街道', 4, 1295), +(7213, '西环中街街道', 4, 1295), +(7214, '周官屯乡', 4, 1296), +(7215, '新兴镇', 4, 1296), +(7216, '曹寺乡', 4, 1296), +(7217, '木门店镇', 4, 1296), +(7218, '流河镇', 4, 1296), +(7219, '清州镇', 4, 1296), +(7220, '盘古乡', 4, 1296), +(7221, '金牛镇', 4, 1296), +(7222, '陈嘴乡', 4, 1296), +(7223, '马厂镇', 4, 1296), +(7224, '南排河镇', 4, 1297), +(7225, '吕桥镇', 4, 1297), +(7226, '官庄乡', 4, 1297), +(7227, '常郭乡', 4, 1297), +(7228, '新村回族乡', 4, 1297), +(7229, '旧城镇', 4, 1297), +(7230, '滕庄子乡', 4, 1297), +(7231, '羊三木回族乡', 4, 1297), +(7232, '羊二庄回族乡', 4, 1297), +(7233, '骅东街道', 4, 1297), +(7234, '骅中街道', 4, 1297), +(7235, '骅西街道', 4, 1297), +(7236, '黄骅镇', 4, 1297), +(7237, '齐家务乡', 4, 1297), +(7238, '万柏林街道', 4, 1298), +(7239, '下元街道', 4, 1298), +(7240, '东社街道', 4, 1298), +(7241, '兴华街道', 4, 1298), +(7242, '化客头街道', 4, 1298), +(7243, '千峰街道', 4, 1298), +(7244, '南寒街道', 4, 1298), +(7245, '和平街道', 4, 1298), +(7246, '小井峪街道', 4, 1298), +(7247, '杜儿坪街道', 4, 1298), +(7248, '王封乡', 4, 1298); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7249, '白家庄街道', 4, 1298), +(7250, '神堂沟街道', 4, 1298), +(7251, '西铭街道', 4, 1298), +(7252, '长风街道', 4, 1298), +(7253, '东曲街道', 4, 1299), +(7254, '原相乡', 4, 1299), +(7255, '嘉乐泉乡', 4, 1299), +(7256, '屯兰街道', 4, 1299), +(7257, '岔口乡', 4, 1299), +(7258, '常安乡', 4, 1299), +(7259, '桃园街道', 4, 1299), +(7260, '梭峪乡', 4, 1299), +(7261, '河口镇', 4, 1299), +(7262, '西曲街道', 4, 1299), +(7263, '邢家社乡', 4, 1299), +(7264, '镇城底镇', 4, 1299), +(7265, '阁上乡', 4, 1299), +(7266, '马兰镇', 4, 1299), +(7267, '天池店乡', 4, 1300), +(7268, '娄烦镇', 4, 1300), +(7269, '庙湾乡', 4, 1300), +(7270, '杜交曲镇', 4, 1300), +(7271, '盖家庄乡', 4, 1300), +(7272, '米峪镇乡', 4, 1300), +(7273, '静游镇', 4, 1300), +(7274, '马家庄乡', 4, 1300), +(7275, '刘家堡乡', 4, 1301), +(7276, '北格镇', 4, 1301), +(7277, '北营街道', 4, 1301), +(7278, '坞城街道', 4, 1301), +(7279, '小店街道', 4, 1301), +(7280, '平阳街道', 4, 1301), +(7281, '营盘街道', 4, 1301), +(7282, '西温庄乡', 4, 1301), +(7283, '黄陵街道', 4, 1301), +(7284, '上兰街道', 4, 1302), +(7285, '光社街道', 4, 1302), +(7286, '南寨街道', 4, 1302), +(7287, '古城街道', 4, 1302), +(7288, '向阳镇', 4, 1302), +(7289, '尖草坪街道', 4, 1302), +(7290, '新城街道', 4, 1302), +(7291, '柏板乡', 4, 1302), +(7292, '柴村街道', 4, 1302), +(7293, '汇丰街道', 4, 1302), +(7294, '西鄢乡', 4, 1302), +(7295, '迎新街街道', 4, 1302), +(7296, '阳曲镇', 4, 1302), +(7297, '马头水乡', 4, 1302), +(7298, '义井街道', 4, 1303), +(7299, '姚村镇', 4, 1303), +(7300, '晋源街道', 4, 1303), +(7301, '晋祠镇', 4, 1303), +(7302, '罗城街道', 4, 1303), +(7303, '金胜镇', 4, 1303), +(7304, '三桥街道', 4, 1304), +(7305, '中涧河乡', 4, 1304), +(7306, '坝陵桥街道', 4, 1304), +(7307, '大东关街道', 4, 1304), +(7308, '小返乡', 4, 1304), +(7309, '巨轮街道', 4, 1304), +(7310, '敦化坊街道', 4, 1304), +(7311, '杏花岭街道', 4, 1304); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7312, '杨家峪街道', 4, 1304), +(7313, '涧河街道', 4, 1304), +(7314, '职工新村街道', 4, 1304), +(7315, '鼓楼街道', 4, 1304), +(7316, '东于镇', 4, 1305), +(7317, '徐沟镇', 4, 1305), +(7318, '柳杜乡', 4, 1305), +(7319, '清源镇', 4, 1305), +(7320, '王答乡', 4, 1305), +(7321, '盂封镇', 4, 1305), +(7322, '西谷乡', 4, 1305), +(7323, '集义乡', 4, 1305), +(7324, '马峪乡', 4, 1305), +(7325, '庙前街道', 4, 1306), +(7326, '文庙街道', 4, 1306), +(7327, '柳巷街道', 4, 1306), +(7328, '桥东街道', 4, 1306), +(7329, '老军营街道', 4, 1306), +(7330, '迎泽街道', 4, 1306), +(7331, '郝庄镇', 4, 1306), +(7332, '东黄水镇', 4, 1307), +(7333, '候村乡', 4, 1307), +(7334, '凌井店乡', 4, 1307), +(7335, '北小店乡', 4, 1307), +(7336, '大盂镇', 4, 1307), +(7337, '杨兴乡', 4, 1307), +(7338, '泥屯镇', 4, 1307), +(7339, '西凌井乡', 4, 1307), +(7340, '高村乡', 4, 1307), +(7341, '黄寨镇', 4, 1307), +(7342, '云冈镇', 4, 1308), +(7343, '口泉乡', 4, 1308), +(7344, '古店镇', 4, 1308), +(7345, '平旺乡', 4, 1308), +(7346, '新旺乡', 4, 1308), +(7347, '水泊寺乡', 4, 1308), +(7348, '西韩岭乡', 4, 1308), +(7349, '马军营乡', 4, 1308), +(7350, '高山镇', 4, 1308), +(7351, '鸦儿崖乡', 4, 1308), +(7352, '东街街道', 4, 1309), +(7353, '北关街道', 4, 1309), +(7354, '北街街道', 4, 1309), +(7355, '南关街道', 4, 1309), +(7356, '南街街道', 4, 1309), +(7357, '向阳里街道', 4, 1309), +(7358, '大庆路街道', 4, 1309), +(7359, '振华南街街道', 4, 1309), +(7360, '新华街街道', 4, 1309), +(7361, '新建北路街道', 4, 1309), +(7362, '新建南路街道', 4, 1309), +(7363, '老平旺街道', 4, 1309), +(7364, '西花园街道', 4, 1309), +(7365, '西街街道', 4, 1309), +(7366, '倍加皂镇', 4, 1310), +(7367, '党留庄乡', 4, 1310), +(7368, '吉家庄乡', 4, 1310), +(7369, '周士庄镇', 4, 1310), +(7370, '峰峪乡', 4, 1310), +(7371, '杜庄乡', 4, 1310), +(7372, '瓜园乡', 4, 1310), +(7373, '聚乐堡乡', 4, 1310), +(7374, '西坪镇', 4, 1310); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7375, '许堡乡', 4, 1310), +(7376, '三十里铺乡', 4, 1311), +(7377, '南河堡乡', 4, 1311), +(7378, '南高崖乡', 4, 1311), +(7379, '张西河乡', 4, 1311), +(7380, '新平堡镇', 4, 1311), +(7381, '玉泉镇', 4, 1311), +(7382, '米薪湾镇', 4, 1311), +(7383, '谷前堡镇', 4, 1311), +(7384, '贾家屯乡', 4, 1311), +(7385, '赵家沟乡', 4, 1311), +(7386, '逯家湾镇', 4, 1311), +(7387, '三屯乡', 4, 1312), +(7388, '云兴镇', 4, 1312), +(7389, '小京庄乡', 4, 1312), +(7390, '店湾镇', 4, 1312), +(7391, '张家场乡', 4, 1312), +(7392, '水窑乡', 4, 1312), +(7393, '管家堡乡', 4, 1312), +(7394, '马道头乡', 4, 1312), +(7395, '鹊儿山镇', 4, 1312), +(7396, '一斗泉乡', 4, 1313), +(7397, '作疃乡', 4, 1313), +(7398, '加斗乡', 4, 1313), +(7399, '南村镇', 4, 1313), +(7400, '壶泉镇', 4, 1313), +(7401, '宜兴乡', 4, 1313), +(7402, '望狐乡', 4, 1313), +(7403, '梁庄乡', 4, 1313), +(7404, '蕉山乡', 4, 1313), +(7405, '上深涧乡', 4, 1314), +(7406, '堡子湾乡', 4, 1314), +(7407, '新荣镇', 4, 1314), +(7408, '破鲁堡乡', 4, 1314), +(7409, '花园湾屯乡', 4, 1314), +(7410, '西村乡', 4, 1314), +(7411, '郭家窑乡', 4, 1314), +(7412, '下韩村乡', 4, 1315), +(7413, '东坊城乡', 4, 1315), +(7414, '千佛岭乡', 4, 1315), +(7415, '南榆林乡', 4, 1315), +(7416, '吴城乡', 4, 1315), +(7417, '大仁庄乡', 4, 1315), +(7418, '大磁窑镇', 4, 1315), +(7419, '官儿乡', 4, 1315), +(7420, '永安镇', 4, 1315), +(7421, '沙圪坨镇', 4, 1315), +(7422, '王庄堡镇', 4, 1315), +(7423, '蔡村镇', 4, 1315), +(7424, '裴村乡', 4, 1315), +(7425, '西坊城镇', 4, 1315), +(7426, '西留村乡', 4, 1315), +(7427, '青磁窑乡', 4, 1315), +(7428, '驼峰乡', 4, 1315), +(7429, '黄花滩乡', 4, 1315), +(7430, '上寨镇', 4, 1316), +(7431, '下关乡', 4, 1316), +(7432, '东河南镇', 4, 1316), +(7433, '史庄乡', 4, 1316), +(7434, '柳科乡', 4, 1316), +(7435, '武灵镇', 4, 1316), +(7436, '独峪乡', 4, 1316), +(7437, '白崖台乡', 4, 1316), +(7438, '石家乡', 4, 1316); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7439, '红石塄乡', 4, 1316), +(7440, '落水河乡', 4, 1316), +(7441, '赵北乡', 4, 1316), +(7442, '口泉街道', 4, 1317), +(7443, '同家梁街道', 4, 1317), +(7444, '四台沟街道', 4, 1317), +(7445, '四老沟街道', 4, 1317), +(7446, '大斗沟街道', 4, 1317), +(7447, '姜家湾街道', 4, 1317), +(7448, '平泉路街道', 4, 1317), +(7449, '忻州窑街道', 4, 1317), +(7450, '挖金湾街道', 4, 1317), +(7451, '新平旺街道', 4, 1317), +(7452, '新泉路街道', 4, 1317), +(7453, '新胜街道', 4, 1317), +(7454, '晋华宫街道', 4, 1317), +(7455, '杏儿沟街道', 4, 1317), +(7456, '民胜街道', 4, 1317), +(7457, '永定庄街道', 4, 1317), +(7458, '煤峪口街道', 4, 1317), +(7459, '燕子山街道', 4, 1317), +(7460, '王村街道', 4, 1317), +(7461, '白洞街道', 4, 1317), +(7462, '雁崖街道', 4, 1317), +(7463, '青磁窑街道', 4, 1317), +(7464, '马口街道', 4, 1317), +(7465, '马脊梁街道', 4, 1317), +(7466, '下深井乡', 4, 1318), +(7467, '东小村镇', 4, 1318), +(7468, '北徐屯乡', 4, 1318), +(7469, '友宰镇', 4, 1318), +(7470, '古城镇', 4, 1318), +(7471, '大白登镇', 4, 1318), +(7472, '狮子屯镇', 4, 1318), +(7473, '王官屯镇', 4, 1318), +(7474, '罗文皂镇', 4, 1318), +(7475, '长城乡', 4, 1318), +(7476, '马家皂乡', 4, 1318), +(7477, '鳌石乡', 4, 1318), +(7478, '龙泉镇', 4, 1318), +(7479, '上站街道', 4, 1319), +(7480, '下站街道', 4, 1319), +(7481, '义井街道', 4, 1319), +(7482, '北大街街道', 4, 1319), +(7483, '南山路街道', 4, 1319), +(7484, '坡底街道', 4, 1319), +(7485, '东回镇', 4, 1320), +(7486, '冠山镇', 4, 1320), +(7487, '冶西镇', 4, 1320), +(7488, '娘子关镇', 4, 1320), +(7489, '岔口乡', 4, 1320), +(7490, '巨城镇', 4, 1320), +(7491, '张庄镇', 4, 1320), +(7492, '柏井镇', 4, 1320), +(7493, '石门口乡', 4, 1320), +(7494, '锁簧镇', 4, 1320), +(7495, '上社镇', 4, 1321), +(7496, '下社乡', 4, 1321), +(7497, '东粱乡', 4, 1321), +(7498, '仙人乡', 4, 1321), +(7499, '北下庄乡', 4, 1321), +(7500, '南娄镇', 4, 1321); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7501, '孙家庄镇', 4, 1321), +(7502, '梁家寨乡', 4, 1321), +(7503, '牛村镇', 4, 1321), +(7504, '秀水镇', 4, 1321), +(7505, '苌池镇', 4, 1321), +(7506, '西潘乡', 4, 1321), +(7507, '西烟镇', 4, 1321), +(7508, '路家村镇', 4, 1321), +(7509, '平潭街街道', 4, 1322), +(7510, '桥头街道', 4, 1322), +(7511, '沙坪街道', 4, 1322), +(7512, '蔡洼街道', 4, 1322), +(7513, '贵石沟街道', 4, 1322), +(7514, '赛鱼街道', 4, 1322), +(7515, '义井镇', 4, 1323), +(7516, '平坦镇', 4, 1323), +(7517, '旧街乡', 4, 1323), +(7518, '李家庄乡', 4, 1323), +(7519, '杨家庄乡', 4, 1323), +(7520, '河底镇', 4, 1323), +(7521, '荫营镇', 4, 1323), +(7522, '西南舁乡', 4, 1323), +(7523, '东街街道', 4, 1324), +(7524, '五一路街道', 4, 1324), +(7525, '五马街道', 4, 1324), +(7526, '北关街道', 4, 1324), +(7527, '北董街道', 4, 1324), +(7528, '南街街道', 4, 1324), +(7529, '太行东街街道', 4, 1324), +(7530, '太行西街街道', 4, 1324), +(7531, '英雄街道', 4, 1324), +(7532, '西街街道', 4, 1324), +(7533, '东井岭乡', 4, 1325), +(7534, '五龙山乡', 4, 1325), +(7535, '店上镇', 4, 1325), +(7536, '晋庄镇', 4, 1325), +(7537, '树掌镇', 4, 1325), +(7538, '桥上乡', 4, 1325), +(7539, '百尺镇', 4, 1325), +(7540, '石坡乡', 4, 1325), +(7541, '集店乡', 4, 1325), +(7542, '鹅屋乡', 4, 1325), +(7543, '黄山乡', 4, 1325), +(7544, '龙泉镇', 4, 1325), +(7545, '上村镇', 4, 1326), +(7546, '丰宜镇', 4, 1326), +(7547, '余吾镇', 4, 1326), +(7548, '吾元镇', 4, 1326), +(7549, '张店镇', 4, 1326), +(7550, '李高乡', 4, 1326), +(7551, '河神庙乡', 4, 1326), +(7552, '渔泽镇', 4, 1326), +(7553, '西贾乡', 4, 1326), +(7554, '路村乡', 4, 1326), +(7555, '麒绛镇', 4, 1326), +(7556, '东寺头乡', 4, 1327), +(7557, '中五井乡', 4, 1327), +(7558, '北社乡', 4, 1327), +(7559, '北耽车乡', 4, 1327), +(7560, '杏城镇', 4, 1327), +(7561, '石城镇', 4, 1327), +(7562, '苗庄镇', 4, 1327), +(7563, '虹梯关乡', 4, 1327), +(7564, '西沟乡', 4, 1327); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7565, '阳高乡', 4, 1327), +(7566, '青羊镇', 4, 1327), +(7567, '龙溪镇', 4, 1327), +(7568, '上司乡', 4, 1328), +(7569, '丰州镇', 4, 1328), +(7570, '分水岭乡', 4, 1328), +(7571, '墨镫乡', 4, 1328), +(7572, '大有乡', 4, 1328), +(7573, '故县乡', 4, 1328), +(7574, '故城镇', 4, 1328), +(7575, '洪水镇', 4, 1328), +(7576, '涌泉乡', 4, 1328), +(7577, '监漳镇', 4, 1328), +(7578, '石北乡', 4, 1328), +(7579, '蟠龙镇', 4, 1328), +(7580, '贾豁乡', 4, 1328), +(7581, '韩北乡', 4, 1328), +(7582, '册村镇', 4, 1329), +(7583, '南泉乡', 4, 1329), +(7584, '南里乡', 4, 1329), +(7585, '定昌镇', 4, 1329), +(7586, '故县镇', 4, 1329), +(7587, '新店镇', 4, 1329), +(7588, '杨安乡', 4, 1329), +(7589, '松村乡', 4, 1329), +(7590, '次村乡', 4, 1329), +(7591, '段柳乡', 4, 1329), +(7592, '漳源镇', 4, 1329), +(7593, '牛寺乡', 4, 1329), +(7594, '郭村镇', 4, 1329), +(7595, '中峪乡', 4, 1330), +(7596, '交口乡', 4, 1330), +(7597, '官滩乡', 4, 1330), +(7598, '景风乡', 4, 1330), +(7599, '李元镇', 4, 1330), +(7600, '沁河镇', 4, 1330), +(7601, '法中乡', 4, 1330), +(7602, '灵空山镇', 4, 1330), +(7603, '王和镇', 4, 1330), +(7604, '王陶乡', 4, 1330), +(7605, '聪子峪乡', 4, 1330), +(7606, '赤石桥乡', 4, 1330), +(7607, '郭道镇', 4, 1330), +(7608, '韩洪乡', 4, 1330), +(7609, '史迥乡', 4, 1331), +(7610, '合室乡', 4, 1331), +(7611, '店上镇', 4, 1331), +(7612, '微子镇', 4, 1331), +(7613, '成家川街道', 4, 1331), +(7614, '潞华街道', 4, 1331), +(7615, '翟店镇', 4, 1331), +(7616, '辛安泉镇', 4, 1331), +(7617, '黄牛蹄乡', 4, 1331), +(7618, '上马乡', 4, 1332), +(7619, '下良镇', 4, 1332), +(7620, '候堡镇', 4, 1332), +(7621, '北底乡', 4, 1332), +(7622, '古韩镇', 4, 1332), +(7623, '善福乡', 4, 1332), +(7624, '夏店镇', 4, 1332), +(7625, '王村镇', 4, 1332), +(7626, '王桥镇', 4, 1332), +(7627, '虒亭镇', 4, 1332), +(7628, '西营镇', 4, 1332), +(7629, '堠北庄镇', 4, 1333), +(7630, '大辛庄镇', 4, 1333), +(7631, '故县街道', 4, 1333); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7632, '老顶山镇', 4, 1333), +(7633, '西白兔乡', 4, 1333), +(7634, '长北街道', 4, 1333), +(7635, '马厂镇', 4, 1333), +(7636, '黄碾镇', 4, 1333), +(7637, '丹朱镇', 4, 1334), +(7638, '南漳镇', 4, 1334), +(7639, '南陈乡', 4, 1334), +(7640, '大堡头镇', 4, 1334), +(7641, '宋村乡', 4, 1334), +(7642, '岚水乡', 4, 1334), +(7643, '常张乡', 4, 1334), +(7644, '慈林镇', 4, 1334), +(7645, '石哲镇', 4, 1334), +(7646, '碾张乡', 4, 1334), +(7647, '色头镇', 4, 1334), +(7648, '鲍店镇', 4, 1334), +(7649, '东和乡', 4, 1335), +(7650, '八义镇', 4, 1335), +(7651, '北呈乡', 4, 1335), +(7652, '南宋乡', 4, 1335), +(7653, '苏店镇', 4, 1335), +(7654, '萌城镇', 4, 1335), +(7655, '西池乡', 4, 1335), +(7656, '西火镇', 4, 1335), +(7657, '贾掌镇', 4, 1335), +(7658, '郝家庄乡', 4, 1335), +(7659, '韩店镇', 4, 1335), +(7660, '上遥镇', 4, 1336), +(7661, '东阳关镇', 4, 1336), +(7662, '停河铺乡', 4, 1336), +(7663, '洪井乡', 4, 1336), +(7664, '程家山乡', 4, 1336), +(7665, '西井镇', 4, 1336), +(7666, '西仵乡', 4, 1336), +(7667, '黄崖洞镇', 4, 1336), +(7668, '黎侯镇', 4, 1336), +(7669, '东街街道', 4, 1337), +(7670, '北石店镇', 4, 1337), +(7671, '北街街道', 4, 1337), +(7672, '南街街道', 4, 1337), +(7673, '矿区街道', 4, 1337), +(7674, '西上庄街道', 4, 1337), +(7675, '西街街道', 4, 1337), +(7676, '钟家庄街道', 4, 1337), +(7677, '中村镇', 4, 1338), +(7678, '十里乡', 4, 1338), +(7679, '嘉峰镇', 4, 1338), +(7680, '固县乡', 4, 1338), +(7681, '土沃乡', 4, 1338), +(7682, '张村乡', 4, 1338), +(7683, '柿庄镇', 4, 1338), +(7684, '樊村河乡', 4, 1338), +(7685, '端氏镇', 4, 1338), +(7686, '胡底乡', 4, 1338), +(7687, '苏庄乡', 4, 1338), +(7688, '郑庄镇', 4, 1338), +(7689, '郑村镇', 4, 1338), +(7690, '龙港镇', 4, 1338), +(7691, '下村镇', 4, 1339), +(7692, '北义城镇', 4, 1339), +(7693, '南岭乡', 4, 1339), +(7694, '南村镇', 4, 1339), +(7695, '周村镇', 4, 1339), +(7696, '大东沟镇', 4, 1339), +(7697, '大箕镇', 4, 1339); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7698, '大阳镇', 4, 1339), +(7699, '山河镇', 4, 1339), +(7700, '川底乡', 4, 1339), +(7701, '巴公镇', 4, 1339), +(7702, '晋庙铺镇', 4, 1339), +(7703, '李寨乡', 4, 1339), +(7704, '柳树口镇', 4, 1339), +(7705, '犁川镇', 4, 1339), +(7706, '金村镇', 4, 1339), +(7707, '高都镇', 4, 1339), +(7708, '东冶镇', 4, 1340), +(7709, '东城街道', 4, 1340), +(7710, '凤城镇', 4, 1340), +(7711, '北留镇', 4, 1340), +(7712, '固隆乡', 4, 1340), +(7713, '寺头乡', 4, 1340), +(7714, '横河镇', 4, 1340), +(7715, '次营镇', 4, 1340), +(7716, '河北镇', 4, 1340), +(7717, '润城镇', 4, 1340), +(7718, '演礼乡', 4, 1340), +(7719, '町店镇', 4, 1340), +(7720, '白桑乡', 4, 1340), +(7721, '芹池镇', 4, 1340), +(7722, '董封乡', 4, 1340), +(7723, '蟒河镇', 4, 1340), +(7724, '西河乡', 4, 1340), +(7725, '驾岭乡', 4, 1340), +(7726, '六泉乡', 4, 1341), +(7727, '古郊乡', 4, 1341), +(7728, '夺火乡镇', 4, 1341), +(7729, '崇文镇', 4, 1341), +(7730, '平城镇', 4, 1341), +(7731, '杨村镇', 4, 1341), +(7732, '潞城镇', 4, 1341), +(7733, '礼义镇', 4, 1341), +(7734, '秦家庄镇', 4, 1341), +(7735, '西河底镇', 4, 1341), +(7736, '附城镇', 4, 1341), +(7737, '马圪当乡', 4, 1341), +(7738, '三甲镇', 4, 1342), +(7739, '东城街街道', 4, 1342), +(7740, '北城街街道', 4, 1342), +(7741, '北诗镇', 4, 1342), +(7742, '南城街街道', 4, 1342), +(7743, '原村乡', 4, 1342), +(7744, '寺庄镇', 4, 1342), +(7745, '建宁乡', 4, 1342), +(7746, '永录乡', 4, 1342), +(7747, '河西镇', 4, 1342), +(7748, '石末乡', 4, 1342), +(7749, '神农镇', 4, 1342), +(7750, '米山镇', 4, 1342), +(7751, '野川镇', 4, 1342), +(7752, '陈区镇', 4, 1342), +(7753, '马村镇', 4, 1342), +(7754, '丁家窑乡', 4, 1343), +(7755, '元堡子镇', 4, 1343), +(7756, '右卫镇', 4, 1343), +(7757, '威远镇', 4, 1343), +(7758, '新城镇', 4, 1343), +(7759, '李达窑乡', 4, 1343), +(7760, '杨千河乡', 4, 1343), +(7761, '牛心堡乡', 4, 1343), +(7762, '白头里乡', 4, 1343), +(7763, '高家堡乡', 4, 1343); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7764, '下喇叭乡', 4, 1344), +(7765, '北周庄镇', 4, 1344), +(7766, '古城镇', 4, 1344), +(7767, '合盛堡乡', 4, 1344), +(7768, '后所乡', 4, 1344), +(7769, '吴马营乡', 4, 1344), +(7770, '安荣乡', 4, 1344), +(7771, '岱岳乡', 4, 1344), +(7772, '岱岳镇', 4, 1344), +(7773, '张家庄乡', 4, 1344), +(7774, '玉井镇', 4, 1344), +(7775, '薛圐圙乡', 4, 1344), +(7776, '马营乡', 4, 1344), +(7777, '马营庄乡', 4, 1344), +(7778, '下木角乡', 4, 1345), +(7779, '下水头乡', 4, 1345), +(7780, '下面高乡', 4, 1345), +(7781, '井坪镇', 4, 1345), +(7782, '凤凰城镇', 4, 1345), +(7783, '双碾乡', 4, 1345), +(7784, '向阳堡乡', 4, 1345), +(7785, '榆林乡', 4, 1345), +(7786, '白堂乡', 4, 1345), +(7787, '西水界乡', 4, 1345), +(7788, '阻虎乡', 4, 1345), +(7789, '陶村乡', 4, 1345), +(7790, '高石庄乡', 4, 1345), +(7791, '下社镇', 4, 1346), +(7792, '下马峪乡', 4, 1346), +(7793, '义井乡', 4, 1346), +(7794, '南河种镇', 4, 1346), +(7795, '南泉乡', 4, 1346), +(7796, '大临河乡', 4, 1346), +(7797, '大黄巍乡', 4, 1346), +(7798, '杏寨乡', 4, 1346), +(7799, '白马石乡', 4, 1346), +(7800, '臧寨乡', 4, 1346), +(7801, '金城镇', 4, 1346), +(7802, '镇子梁乡', 4, 1346), +(7803, '云中镇', 4, 1347), +(7804, '亲和乡', 4, 1347), +(7805, '何家堡乡', 4, 1347), +(7806, '吴家窑镇', 4, 1347), +(7807, '新家园乡', 4, 1347), +(7808, '毛家皂镇', 4, 1347), +(7809, '河头乡', 4, 1347), +(7810, '海北头乡', 4, 1347), +(7811, '金沙滩镇', 4, 1347), +(7812, '马辛庄乡', 4, 1347), +(7813, '下团堡乡', 4, 1348), +(7814, '利民镇', 4, 1348), +(7815, '北城街道', 4, 1348), +(7816, '北旺庄街道', 4, 1348), +(7817, '南城街道', 4, 1348), +(7818, '南榆林乡', 4, 1348), +(7819, '小平易乡', 4, 1348), +(7820, '张蔡庄乡', 4, 1348), +(7821, '沙塄河乡', 4, 1348), +(7822, '滋润乡', 4, 1348), +(7823, '神头街道', 4, 1348), +(7824, '神头镇', 4, 1348), +(7825, '福善庄乡', 4, 1348), +(7826, '窑子头乡', 4, 1348), +(7827, '贾庄乡', 4, 1348); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7828, '三佳乡', 4, 1349), +(7829, '东南街道', 4, 1349), +(7830, '义安镇', 4, 1349), +(7831, '义棠镇', 4, 1349), +(7832, '北关街道', 4, 1349), +(7833, '北坛街道', 4, 1349), +(7834, '城关乡', 4, 1349), +(7835, '宋古乡', 4, 1349), +(7836, '张兰镇', 4, 1349), +(7837, '洪山镇', 4, 1349), +(7838, '绵山镇', 4, 1349), +(7839, '西关街道', 4, 1349), +(7840, '西南街道', 4, 1349), +(7841, '连福镇', 4, 1349), +(7842, '龙凤镇', 4, 1349), +(7843, '义兴镇', 4, 1350), +(7844, '喂马乡', 4, 1350), +(7845, '平松乡', 4, 1350), +(7846, '李阳镇', 4, 1350), +(7847, '松烟镇', 4, 1350), +(7848, '横岭镇', 4, 1350), +(7849, '牛川乡', 4, 1350), +(7850, '阳光占乡', 4, 1350), +(7851, '青城镇', 4, 1350), +(7852, '马坊乡', 4, 1350), +(7853, '任村乡', 4, 1351), +(7854, '侯城乡', 4, 1351), +(7855, '北汪乡', 4, 1351), +(7856, '小白乡', 4, 1351), +(7857, '明星镇', 4, 1351), +(7858, '水秀乡', 4, 1351), +(7859, '胡村镇', 4, 1351), +(7860, '范村镇', 4, 1351), +(7861, '阳邑乡', 4, 1351), +(7862, '上湖乡', 4, 1352), +(7863, '南燕竹镇', 4, 1352), +(7864, '宗艾镇', 4, 1352), +(7865, '尹灵芝镇', 4, 1352), +(7866, '平头镇', 4, 1352), +(7867, '平舒乡', 4, 1352), +(7868, '景尚乡', 4, 1352), +(7869, '朝阳镇', 4, 1352), +(7870, '松塔镇', 4, 1352), +(7871, '温家庄乡', 4, 1352), +(7872, '羊头崖乡', 4, 1352), +(7873, '西洛镇', 4, 1352), +(7874, '謦愁乡', 4, 1352), +(7875, '马首乡', 4, 1352), +(7876, '寒王乡', 4, 1353), +(7877, '拐儿镇', 4, 1353), +(7878, '桐峪镇', 4, 1353), +(7879, '石匣乡', 4, 1353), +(7880, '粟城乡', 4, 1353), +(7881, '羊角乡', 4, 1353), +(7882, '芹泉镇', 4, 1353), +(7883, '辽阳镇', 4, 1353), +(7884, '麻田镇', 4, 1353), +(7885, '龙泉乡', 4, 1353), +(7886, '东泉镇', 4, 1354), +(7887, '中都乡', 4, 1354), +(7888, '南政乡', 4, 1354), +(7889, '卜宜乡', 4, 1354), +(7890, '古陶镇', 4, 1354), +(7891, '孟山乡', 4, 1354), +(7892, '宁固镇', 4, 1354), +(7893, '岳壁乡', 4, 1354), +(7894, '朱坑乡', 4, 1354); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7895, '杜家庄乡', 4, 1354), +(7896, '段村镇', 4, 1354), +(7897, '洪善镇', 4, 1354), +(7898, '襄垣乡', 4, 1354), +(7899, '香乐乡', 4, 1354), +(7900, '三都乡', 4, 1355), +(7901, '东冶头镇', 4, 1355), +(7902, '乐平镇', 4, 1355), +(7903, '大寨镇', 4, 1355), +(7904, '孔氏乡', 4, 1355), +(7905, '李家庄乡', 4, 1355), +(7906, '沾尚镇', 4, 1355), +(7907, '界都乡', 4, 1355), +(7908, '皋落镇', 4, 1355), +(7909, '西寨乡', 4, 1355), +(7910, '赵壁乡', 4, 1355), +(7911, '闫庄乡', 4, 1355), +(7912, '东赵乡', 4, 1356), +(7913, '东阳镇', 4, 1356), +(7914, '乌金山镇', 4, 1356), +(7915, '什贴镇', 4, 1356), +(7916, '修文镇', 4, 1356), +(7917, '北关街道', 4, 1356), +(7918, '北田镇', 4, 1356), +(7919, '安宁街街道', 4, 1356), +(7920, '庄子乡', 4, 1356), +(7921, '张庆乡', 4, 1356), +(7922, '新华街街道', 4, 1356), +(7923, '新建街街道', 4, 1356), +(7924, '晋华街街道', 4, 1356), +(7925, '经纬街道', 4, 1356), +(7926, '西南街街道', 4, 1356), +(7927, '路西街街道', 4, 1356), +(7928, '郭家堡乡', 4, 1356), +(7929, '锦纶街街道', 4, 1356), +(7930, '长凝镇', 4, 1356), +(7931, '云簇镇', 4, 1357), +(7932, '兰峪乡', 4, 1357), +(7933, '北寨乡', 4, 1357), +(7934, '河峪乡', 4, 1357), +(7935, '社城镇', 4, 1357), +(7936, '箕城镇', 4, 1357), +(7937, '西马乡', 4, 1357), +(7938, '讲堂乡', 4, 1357), +(7939, '郝北镇', 4, 1357), +(7940, '两渡镇', 4, 1358), +(7941, '交口乡', 4, 1358), +(7942, '南关镇', 4, 1358), +(7943, '坛镇乡', 4, 1358), +(7944, '夏门镇', 4, 1358), +(7945, '段纯镇', 4, 1358), +(7946, '王禹乡', 4, 1358), +(7947, '粱家焉乡', 4, 1358), +(7948, '翠峰镇', 4, 1358), +(7949, '英武乡', 4, 1358), +(7950, '静升镇', 4, 1358), +(7951, '马和乡', 4, 1358), +(7952, '东观镇', 4, 1359), +(7953, '古县镇', 4, 1359), +(7954, '城赵镇', 4, 1359), +(7955, '峪口乡', 4, 1359), +(7956, '昭余镇', 4, 1359), +(7957, '来远镇', 4, 1359), +(7958, '西六支乡', 4, 1359), +(7959, '贾令镇', 4, 1359), +(7960, '万泉乡', 4, 1360); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(7961, '光华乡', 4, 1360), +(7962, '南张乡', 4, 1360), +(7963, '汉薛镇', 4, 1360), +(7964, '王显乡', 4, 1360), +(7965, '皇甫乡', 4, 1360), +(7966, '荣河镇', 4, 1360), +(7967, '裴庄乡', 4, 1360), +(7968, '西村乡', 4, 1360), +(7969, '解店镇', 4, 1360), +(7970, '贾村乡', 4, 1360), +(7971, '通化镇', 4, 1360), +(7972, '里望乡', 4, 1360), +(7973, '高村乡', 4, 1360), +(7974, '七级镇', 4, 1361), +(7975, '三管镇', 4, 1361), +(7976, '东张镇', 4, 1361), +(7977, '临晋镇', 4, 1361), +(7978, '北景乡', 4, 1361), +(7979, '北辛乡', 4, 1361), +(7980, '卓里工贸区', 4, 1361), +(7981, '孙吉镇', 4, 1361), +(7982, '嵋阳镇', 4, 1361), +(7983, '庙上乡', 4, 1361), +(7984, '楚侯乡', 4, 1361), +(7985, '牛杜工贸区', 4, 1361), +(7986, '猗氏镇', 4, 1361), +(7987, '耽子镇', 4, 1361), +(7988, '角杯乡', 4, 1361), +(7989, '闫家庄工贸区', 4, 1361), +(7990, '华峰乡', 4, 1362), +(7991, '历山镇', 4, 1362), +(7992, '古城镇', 4, 1362), +(7993, '新城镇', 4, 1362), +(7994, '毛家镇', 4, 1362), +(7995, '王茅镇', 4, 1362), +(7996, '皋落乡', 4, 1362), +(7997, '英言乡', 4, 1362), +(7998, '蒲掌乡', 4, 1362), +(7999, '解峪乡', 4, 1362), +(8000, '长直乡', 4, 1362), +(8001, '南大里乡', 4, 1363), +(8002, '埝掌镇', 4, 1363), +(8003, '尉郭乡', 4, 1363), +(8004, '庙前镇', 4, 1363), +(8005, '水头镇', 4, 1363), +(8006, '泗交镇', 4, 1363), +(8007, '瑶峰镇', 4, 1363), +(8008, '祁家河乡', 4, 1363), +(8009, '禹王乡', 4, 1363), +(8010, '胡张乡', 4, 1363), +(8011, '裴介镇', 4, 1363), +(8012, '三门镇', 4, 1364), +(8013, '圣人涧镇', 4, 1364), +(8014, '坡底乡', 4, 1364), +(8015, '常乐镇', 4, 1364), +(8016, '张店镇', 4, 1364), +(8017, '张村镇', 4, 1364), +(8018, '曹川镇', 4, 1364), +(8019, '杜马乡', 4, 1364), +(8020, '洪池乡', 4, 1364), +(8021, '部官乡', 4, 1364), +(8022, '1个开发区', 4, 1365), +(8023, '万安镇', 4, 1365), +(8024, '三泉镇', 4, 1365), +(8025, '北张镇', 4, 1365), +(8026, '古交镇', 4, 1365), +(8027, '横桥乡', 4, 1365); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8028, '泉掌镇', 4, 1365), +(8029, '泽掌镇', 4, 1365), +(8030, '阳王镇', 4, 1365), +(8031, '龙兴镇', 4, 1365), +(8032, '卿头镇', 4, 1366), +(8033, '城东街道', 4, 1366), +(8034, '城北街道', 4, 1366), +(8035, '城西街道', 4, 1366), +(8036, '开张镇', 4, 1366), +(8037, '张营镇', 4, 1366), +(8038, '枵栳镇', 4, 1366), +(8039, '蒲州镇', 4, 1366), +(8040, '虞乡镇', 4, 1366), +(8041, '韩阳镇', 4, 1366), +(8042, '下化乡', 4, 1367), +(8043, '僧楼镇', 4, 1367), +(8044, '城区街道', 4, 1367), +(8045, '小梁乡', 4, 1367), +(8046, '柴家乡', 4, 1367), +(8047, '樊村镇', 4, 1367), +(8048, '清涧街道', 4, 1367), +(8049, '赵家庄乡', 4, 1367), +(8050, '阳村乡', 4, 1367), +(8051, '三路里镇', 4, 1368), +(8052, '上王乡', 4, 1368), +(8053, '上郭乡', 4, 1368), +(8054, '东城街道', 4, 1368), +(8055, '东郭镇', 4, 1368), +(8056, '中城街道', 4, 1368), +(8057, '冯村乡', 4, 1368), +(8058, '北城街道', 4, 1368), +(8059, '北相镇', 4, 1368), +(8060, '南城街道', 4, 1368), +(8061, '大渠街道', 4, 1368), +(8062, '姚孟街道', 4, 1368), +(8063, '安邑街道', 4, 1368), +(8064, '席张乡', 4, 1368), +(8065, '泓芝驿镇', 4, 1368), +(8066, '王范乡', 4, 1368), +(8067, '禹都经济技术开发区', 4, 1368), +(8068, '西城街道', 4, 1368), +(8069, '解州镇', 4, 1368), +(8070, '金井乡', 4, 1368), +(8071, '陶村镇', 4, 1368), +(8072, '龙居镇', 4, 1368), +(8073, '化峪镇', 4, 1369), +(8074, '太阳乡', 4, 1369), +(8075, '清河镇', 4, 1369), +(8076, '稷峰镇', 4, 1369), +(8077, '翟店镇', 4, 1369), +(8078, '蔡村乡', 4, 1369), +(8079, '西社镇', 4, 1369), +(8080, '么里镇', 4, 1370), +(8081, '冷口乡', 4, 1370), +(8082, '南凡镇', 4, 1370), +(8083, '卫庄镇', 4, 1370), +(8084, '古绛镇', 4, 1370), +(8085, '大交镇', 4, 1370), +(8086, '安峪镇', 4, 1370), +(8087, '横水镇', 4, 1370), +(8088, '郝庄乡', 4, 1370), +(8089, '陈村镇', 4, 1370), +(8090, '东垆乡', 4, 1371), +(8091, '南卫乡', 4, 1371), +(8092, '古魏镇', 4, 1371), +(8093, '大王镇', 4, 1371); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8094, '学张乡', 4, 1371), +(8095, '永乐镇', 4, 1371), +(8096, '西陌镇', 4, 1371), +(8097, '阳城镇', 4, 1371), +(8098, '陌南镇', 4, 1371), +(8099, '风陵渡镇', 4, 1371), +(8100, '东镇镇', 4, 1372), +(8101, '候村乡', 4, 1372), +(8102, '凹底镇', 4, 1372), +(8103, '后宫乡', 4, 1372), +(8104, '桐城镇', 4, 1372), +(8105, '河底镇', 4, 1372), +(8106, '石门乡', 4, 1372), +(8107, '礼元镇', 4, 1372), +(8108, '神柏乡', 4, 1372), +(8109, '薛店镇', 4, 1372), +(8110, '裴社乡', 4, 1372), +(8111, '郭家庄镇', 4, 1372), +(8112, '阳隅乡', 4, 1372), +(8113, '东冶镇', 4, 1373), +(8114, '东雷乡', 4, 1373), +(8115, '五台山风景名胜区', 4, 1373), +(8116, '台城镇', 4, 1373), +(8117, '台怀镇', 4, 1373), +(8118, '建安乡', 4, 1373), +(8119, '沟南乡', 4, 1373), +(8120, '灵境乡', 4, 1373), +(8121, '白家庄镇', 4, 1373), +(8122, '石咀乡', 4, 1373), +(8123, '神西乡', 4, 1373), +(8124, '耿镇镇', 4, 1373), +(8125, '茹村乡', 4, 1373), +(8126, '蒋坊乡', 4, 1373), +(8127, '豆村镇', 4, 1373), +(8128, '金岗库乡', 4, 1373), +(8129, '门限石乡', 4, 1373), +(8130, '阳白乡', 4, 1373), +(8131, '陈家庄乡', 4, 1373), +(8132, '高洪口乡', 4, 1373), +(8133, '三岔镇', 4, 1374), +(8134, '东秀庄乡', 4, 1374), +(8135, '前所乡', 4, 1374), +(8136, '孙家坪乡', 4, 1374), +(8137, '小河头镇', 4, 1374), +(8138, '新寨乡', 4, 1374), +(8139, '李家坪乡', 4, 1374), +(8140, '杏岭子乡', 4, 1374), +(8141, '梁家坪乡', 4, 1374), +(8142, '砚城镇', 4, 1374), +(8143, '胡会乡', 4, 1374), +(8144, '韩家楼乡', 4, 1374), +(8145, '上馆镇', 4, 1375), +(8146, '峨口镇', 4, 1375), +(8147, '峪口乡', 4, 1375), +(8148, '新高乡', 4, 1375), +(8149, '枣林镇', 4, 1375), +(8150, '滩上镇', 4, 1375), +(8151, '磨坊乡', 4, 1375), +(8152, '聂营镇', 4, 1375), +(8153, '胡峪乡', 4, 1375), +(8154, '阳明堡镇', 4, 1375), +(8155, '雁门关乡', 4, 1375), +(8156, '东关镇', 4, 1376), +(8157, '义门镇', 4, 1376), +(8158, '冯家川乡', 4, 1376), +(8159, '南河沟乡', 4, 1376); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8160, '土崖塔乡', 4, 1376), +(8161, '孙家沟乡', 4, 1376), +(8162, '尧圪台乡', 4, 1376), +(8163, '杨家湾镇', 4, 1376), +(8164, '林遮峪乡', 4, 1376), +(8165, '桥头镇', 4, 1376), +(8166, '窖洼乡', 4, 1376), +(8167, '腰庄乡', 4, 1376), +(8168, '韩家川乡', 4, 1376), +(8169, '万家寨镇', 4, 1377), +(8170, '南堡子乡', 4, 1377), +(8171, '天峰坪镇', 4, 1377), +(8172, '尚峪乡', 4, 1377), +(8173, '新关镇', 4, 1377), +(8174, '楼沟乡', 4, 1377), +(8175, '水泉乡', 4, 1377), +(8176, '窑头乡', 4, 1377), +(8177, '老营镇', 4, 1377), +(8178, '陈家营乡', 4, 1377), +(8179, '东社镇', 4, 1378), +(8180, '中阳乡', 4, 1378), +(8181, '北城街道', 4, 1378), +(8182, '南城街道', 4, 1378), +(8183, '南白乡', 4, 1378), +(8184, '大林乡', 4, 1378), +(8185, '大牛店镇', 4, 1378), +(8186, '子干乡', 4, 1378), +(8187, '崞阳镇', 4, 1378), +(8188, '新原乡', 4, 1378), +(8189, '楼板寨乡', 4, 1378), +(8190, '段家堡乡', 4, 1378), +(8191, '沿沟乡', 4, 1378), +(8192, '王家庄乡', 4, 1378), +(8193, '苏龙口镇', 4, 1378), +(8194, '西镇乡', 4, 1378), +(8195, '解村乡', 4, 1378), +(8196, '轩岗镇', 4, 1378), +(8197, '长梁沟镇', 4, 1378), +(8198, '闫庄镇', 4, 1378), +(8199, '东寨镇', 4, 1379), +(8200, '东马坊乡', 4, 1379), +(8201, '余庄乡', 4, 1379), +(8202, '凤凰镇', 4, 1379), +(8203, '化北屯乡', 4, 1379), +(8204, '城区街道', 4, 1379), +(8205, '怀道乡', 4, 1379), +(8206, '新堡乡', 4, 1379), +(8207, '涔山乡', 4, 1379), +(8208, '石家庄镇', 4, 1379), +(8209, '薛家洼乡', 4, 1379), +(8210, '西马坊乡', 4, 1379), +(8211, '迭台寺乡', 4, 1379), +(8212, '阳方口镇', 4, 1379), +(8213, '南王乡', 4, 1380), +(8214, '受录乡', 4, 1380), +(8215, '季庄乡', 4, 1380), +(8216, '宏道镇', 4, 1380), +(8217, '晋昌镇', 4, 1380), +(8218, '杨芳乡', 4, 1380), +(8219, '河边镇', 4, 1380), +(8220, '神山乡', 4, 1380), +(8221, '蒋村乡', 4, 1380), +(8222, '三井镇', 4, 1381), +(8223, '大涧乡', 4, 1381), +(8224, '宋家沟乡', 4, 1381); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8225, '岚漪镇', 4, 1381), +(8226, '李家沟乡', 4, 1381), +(8227, '水峪贯乡', 4, 1381), +(8228, '温泉乡', 4, 1381), +(8229, '王家岔乡', 4, 1381), +(8230, '神堂坪乡', 4, 1381), +(8231, '西豹峪乡', 4, 1381), +(8232, '阳坪乡', 4, 1381), +(8233, '高家会乡', 4, 1381), +(8234, '三交镇', 4, 1382), +(8235, '东楼乡', 4, 1382), +(8236, '兰村乡', 4, 1382), +(8237, '北义井乡', 4, 1382), +(8238, '南城街道', 4, 1382), +(8239, '合索乡', 4, 1382), +(8240, '奇村镇', 4, 1382), +(8241, '庄磨镇', 4, 1382), +(8242, '播明镇', 4, 1382), +(8243, '新建路街道', 4, 1382), +(8244, '曹张乡', 4, 1382), +(8245, '秦城乡', 4, 1382), +(8246, '紫岩乡', 4, 1382), +(8247, '董村镇', 4, 1382), +(8248, '西张乡', 4, 1382), +(8249, '解原乡', 4, 1382), +(8250, '豆罗镇', 4, 1382), +(8251, '长征街街道', 4, 1382), +(8252, '阳坡乡', 4, 1382), +(8253, '高城乡', 4, 1382), +(8254, '刘家塔镇', 4, 1383), +(8255, '前川乡', 4, 1383), +(8256, '单寨乡', 4, 1383), +(8257, '土沟乡', 4, 1383), +(8258, '巡镇', 4, 1383), +(8259, '文笔镇', 4, 1383), +(8260, '旧县乡', 4, 1383), +(8261, '楼子营镇', 4, 1383), +(8262, '沙坪乡', 4, 1383), +(8263, '沙泉乡', 4, 1383), +(8264, '社梁乡', 4, 1383), +(8265, '赵家沟乡', 4, 1383), +(8266, '鹿固乡', 4, 1383), +(8267, '东湖乡', 4, 1384), +(8268, '义井镇', 4, 1384), +(8269, '八角镇', 4, 1384), +(8270, '大严备乡', 4, 1384), +(8271, '太平庄乡', 4, 1384), +(8272, '烈堡乡', 4, 1384), +(8273, '虎北乡', 4, 1384), +(8274, '贺职乡', 4, 1384), +(8275, '长畛乡', 4, 1384), +(8276, '龙泉镇', 4, 1384), +(8277, '下茹越乡', 4, 1385), +(8278, '东山乡', 4, 1385), +(8279, '光裕堡乡', 4, 1385), +(8280, '大营镇', 4, 1385), +(8281, '岩头乡', 4, 1385), +(8282, '杏园乡', 4, 1385), +(8283, '柏家庄乡', 4, 1385), +(8284, '横涧乡', 4, 1385), +(8285, '砂河镇', 4, 1385), +(8286, '神堂堡乡', 4, 1385), +(8287, '繁城镇', 4, 1385), +(8288, '金山铺乡', 4, 1385), +(8289, '集义庄乡', 4, 1385), +(8290, '中庄乡', 4, 1386); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8291, '丰润镇', 4, 1386), +(8292, '双路乡', 4, 1386), +(8293, '堂尔上乡', 4, 1386), +(8294, '娑婆乡', 4, 1386), +(8295, '娘子神乡', 4, 1386), +(8296, '康家会镇', 4, 1386), +(8297, '杜家村镇', 4, 1386), +(8298, '段家寨乡', 4, 1386), +(8299, '王村乡', 4, 1386), +(8300, '神峪沟乡', 4, 1386), +(8301, '赤泥洼乡', 4, 1386), +(8302, '辛村乡', 4, 1386), +(8303, '鹅城镇', 4, 1386), +(8304, '光华镇', 4, 1387), +(8305, '关王庙乡', 4, 1387), +(8306, '双鹤乡', 4, 1387), +(8307, '台头镇', 4, 1387), +(8308, '尉庄乡', 4, 1387), +(8309, '昌宁镇', 4, 1387), +(8310, '枣岭乡', 4, 1387), +(8311, '管头镇', 4, 1387), +(8312, '西交口乡', 4, 1387), +(8313, '西坡镇', 4, 1387), +(8314, '上马街道', 4, 1388), +(8315, '凤城乡', 4, 1388), +(8316, '张村街道', 4, 1388), +(8317, '新田乡', 4, 1388), +(8318, '浍滨街道', 4, 1388), +(8319, '路东街道', 4, 1388), +(8320, '路西街道', 4, 1388), +(8321, '高村乡', 4, 1388), +(8322, '北平镇', 4, 1389), +(8323, '南垣乡', 4, 1389), +(8324, '古阳镇', 4, 1389), +(8325, '岳阳镇', 4, 1389), +(8326, '旧县镇', 4, 1389), +(8327, '永乐乡', 4, 1389), +(8328, '石壁乡', 4, 1389), +(8329, '东城乡', 4, 1390), +(8330, '中垛乡', 4, 1390), +(8331, '吉昌镇', 4, 1390), +(8332, '壶口镇', 4, 1390), +(8333, '屯里镇', 4, 1390), +(8334, '文城乡', 4, 1390), +(8335, '柏山寺乡', 4, 1390), +(8336, '车城乡', 4, 1390), +(8337, '三多乡', 4, 1391), +(8338, '太古乡', 4, 1391), +(8339, '太德乡', 4, 1391), +(8340, '徐家垛乡', 4, 1391), +(8341, '昕水镇', 4, 1391), +(8342, '曲峨镇', 4, 1391), +(8343, '冀氏镇', 4, 1392), +(8344, '和川镇', 4, 1392), +(8345, '唐城镇', 4, 1392), +(8346, '府城镇', 4, 1392), +(8347, '杜村乡', 4, 1392), +(8348, '良马乡', 4, 1392), +(8349, '马必乡', 4, 1392), +(8350, '一平垣乡', 4, 1393), +(8351, '乔李镇', 4, 1393), +(8352, '乡贤街街道', 4, 1393), +(8353, '刘村镇', 4, 1393), +(8354, '南街街道', 4, 1393), +(8355, '县底镇', 4, 1393), +(8356, '吴村镇', 4, 1393); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8357, '土门镇', 4, 1393), +(8358, '大阳镇', 4, 1393), +(8359, '尧庙镇', 4, 1393), +(8360, '屯里镇', 4, 1393), +(8361, '枕头乡', 4, 1393), +(8362, '段店乡', 4, 1393), +(8363, '水塔街街道', 4, 1393), +(8364, '汾河街道', 4, 1393), +(8365, '河底乡', 4, 1393), +(8366, '滨河办事处', 4, 1393), +(8367, '解放路街道', 4, 1393), +(8368, '贺家庄乡', 4, 1393), +(8369, '贾得乡', 4, 1393), +(8370, '车站街街道', 4, 1393), +(8371, '辛寺街街道', 4, 1393), +(8372, '金殿镇', 4, 1393), +(8373, '铁路东街道', 4, 1393), +(8374, '魏村镇', 4, 1393), +(8375, '鼓楼西街街道', 4, 1393), +(8376, '乐昌镇', 4, 1394), +(8377, '北董乡', 4, 1394), +(8378, '史村镇', 4, 1394), +(8379, '曲村镇', 4, 1394), +(8380, '杨谈乡', 4, 1394), +(8381, '里村镇', 4, 1394), +(8382, '高显镇', 4, 1394), +(8383, '交口乡', 4, 1395), +(8384, '南庄乡', 4, 1395), +(8385, '坡头乡', 4, 1395), +(8386, '打石腰乡', 4, 1395), +(8387, '桑壁镇', 4, 1395), +(8388, '芝河镇', 4, 1395), +(8389, '阁底乡', 4, 1395), +(8390, '佃坪乡', 4, 1396), +(8391, '僧念镇', 4, 1396), +(8392, '勍香镇', 4, 1396), +(8393, '和平镇', 4, 1396), +(8394, '团柏乡', 4, 1396), +(8395, '对竹镇', 4, 1396), +(8396, '永安镇', 4, 1396), +(8397, '邢家要乡', 4, 1396), +(8398, '万安镇', 4, 1397), +(8399, '兴唐寺乡', 4, 1397), +(8400, '刘家垣镇', 4, 1397), +(8401, '堤村乡', 4, 1397), +(8402, '大槐树镇', 4, 1397), +(8403, '山头乡', 4, 1397), +(8404, '左木乡', 4, 1397), +(8405, '广胜寺镇', 4, 1397), +(8406, '明姜镇', 4, 1397), +(8407, '曲亭镇', 4, 1397), +(8408, '淹底乡', 4, 1397), +(8409, '甘亭镇', 4, 1397), +(8410, '苏堡镇', 4, 1397), +(8411, '赵城镇', 4, 1397), +(8412, '辛村乡', 4, 1397), +(8413, '龙马乡', 4, 1397), +(8414, '东张镇', 4, 1398), +(8415, '北王乡', 4, 1398), +(8416, '北韩乡', 4, 1398), +(8417, '响水河镇', 4, 1398), +(8418, '天坛镇', 4, 1398), +(8419, '寨圪塔乡', 4, 1398), +(8420, '张庄镇', 4, 1398), +(8421, '槐埝乡', 4, 1398), +(8422, '米家垣乡', 4, 1398); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8423, '中卫乡', 4, 1399), +(8424, '南唐乡', 4, 1399), +(8425, '南梁镇', 4, 1399), +(8426, '唐兴镇', 4, 1399), +(8427, '桥上镇', 4, 1399), +(8428, '浇底乡', 4, 1399), +(8429, '王庄乡', 4, 1399), +(8430, '西闫镇', 4, 1399), +(8431, '里寨镇', 4, 1399), +(8432, '隆化镇', 4, 1399), +(8433, '乔家湾乡', 4, 1400), +(8434, '克城镇', 4, 1400), +(8435, '古县乡', 4, 1400), +(8436, '太林乡', 4, 1400), +(8437, '山中乡', 4, 1400), +(8438, '红道乡', 4, 1400), +(8439, '蒲城镇', 4, 1400), +(8440, '薛关镇', 4, 1400), +(8441, '黑龙关镇', 4, 1400), +(8442, '南贾镇', 4, 1401), +(8443, '南辛店乡', 4, 1401), +(8444, '古城镇', 4, 1401), +(8445, '大邓乡', 4, 1401), +(8446, '新城镇', 4, 1401), +(8447, '景毛乡', 4, 1401), +(8448, '永固乡', 4, 1401), +(8449, '汾城镇', 4, 1401), +(8450, '襄陵镇', 4, 1401), +(8451, '西贾乡', 4, 1401), +(8452, '赵康镇', 4, 1401), +(8453, '邓庄镇', 4, 1401), +(8454, '陶寺乡', 4, 1401), +(8455, '下李乡', 4, 1402), +(8456, '午城镇', 4, 1402), +(8457, '城南乡', 4, 1402), +(8458, '寨子乡', 4, 1402), +(8459, '阳头升乡', 4, 1402), +(8460, '陡坡乡', 4, 1402), +(8461, '黄土镇', 4, 1402), +(8462, '龙泉镇', 4, 1402), +(8463, '三教乡', 4, 1403), +(8464, '北环路街道', 4, 1403), +(8465, '南环路街道', 4, 1403), +(8466, '大张镇', 4, 1403), +(8467, '师庄乡', 4, 1403), +(8468, '开元街道', 4, 1403), +(8469, '李曹镇', 4, 1403), +(8470, '白龙镇', 4, 1403), +(8471, '辛置镇', 4, 1403), +(8472, '退沙街道', 4, 1403), +(8473, '陶唐峪乡', 4, 1403), +(8474, '鼓楼街道', 4, 1403), +(8475, '下枣林乡', 4, 1404), +(8476, '宁兴镇', 4, 1404), +(8477, '暖泉镇', 4, 1404), +(8478, '枝柯镇', 4, 1404), +(8479, '武家庄镇', 4, 1404), +(8480, '车鸣峪乡', 4, 1404), +(8481, '金罗镇', 4, 1404), +(8482, '三交街道', 4, 1405), +(8483, '三交镇', 4, 1405), +(8484, '丛罗峪镇', 4, 1405), +(8485, '临泉镇', 4, 1405), +(8486, '克虎镇', 4, 1405), +(8487, '兔板镇', 4, 1405), +(8488, '刘家会镇', 4, 1405); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8489, '城内街道', 4, 1405), +(8490, '城庄镇', 4, 1405), +(8491, '大禹乡', 4, 1405), +(8492, '安业乡', 4, 1405), +(8493, '安家庄乡', 4, 1405), +(8494, '招贤镇', 4, 1405), +(8495, '曲峪镇', 4, 1405), +(8496, '木瓜坪乡', 4, 1405), +(8497, '林家坪镇', 4, 1405), +(8498, '湍水头镇', 4, 1405), +(8499, '玉坪乡', 4, 1405), +(8500, '白文街道', 4, 1405), +(8501, '白文镇', 4, 1405), +(8502, '石白头乡', 4, 1405), +(8503, '碛口街道', 4, 1405), +(8504, '碛口镇', 4, 1405), +(8505, '第八堡乡', 4, 1405), +(8506, '车赶乡', 4, 1405), +(8507, '雷家碛乡', 4, 1405), +(8508, '青凉寺乡', 4, 1405), +(8509, '双池镇', 4, 1406), +(8510, '回龙乡', 4, 1406), +(8511, '康城镇', 4, 1406), +(8512, '桃红坡镇', 4, 1406), +(8513, '水头镇', 4, 1406), +(8514, '温泉乡', 4, 1406), +(8515, '石口乡', 4, 1406), +(8516, '东坡底乡', 4, 1407), +(8517, '会立乡', 4, 1407), +(8518, '夏家营镇', 4, 1407), +(8519, '天宁镇', 4, 1407), +(8520, '岭底乡', 4, 1407), +(8521, '庞泉沟镇', 4, 1407), +(8522, '水峪贯镇', 4, 1407), +(8523, '洪相乡', 4, 1407), +(8524, '西社镇', 4, 1407), +(8525, '西营镇', 4, 1407), +(8526, '东会乡', 4, 1408), +(8527, '交楼申乡', 4, 1408), +(8528, '固贤乡', 4, 1408), +(8529, '圪达上乡', 4, 1408), +(8530, '奥家湾乡', 4, 1408), +(8531, '孟家坪乡', 4, 1408), +(8532, '康宁镇', 4, 1408), +(8533, '恶虎滩乡', 4, 1408), +(8534, '瓦塘镇', 4, 1408), +(8535, '罗峪口镇', 4, 1408), +(8536, '蔚汾镇', 4, 1408), +(8537, '蔡家会镇', 4, 1408), +(8538, '蔡家崖乡', 4, 1408), +(8539, '贺家会乡', 4, 1408), +(8540, '赵家坪乡', 4, 1408), +(8541, '高家村镇', 4, 1408), +(8542, '魏家滩镇', 4, 1408), +(8543, '下堡镇', 4, 1409), +(8544, '下栅乡', 4, 1409), +(8545, '中阳楼街道', 4, 1409), +(8546, '兑镇镇', 4, 1409), +(8547, '南阳乡', 4, 1409), +(8548, '大孝堡乡', 4, 1409), +(8549, '振兴街道', 4, 1409), +(8550, '新义街道', 4, 1409), +(8551, '杜村乡', 4, 1409), +(8552, '柱濮镇', 4, 1409), +(8553, '梧桐镇', 4, 1409); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8554, '西辛庄镇', 4, 1409), +(8555, '阳泉曲镇', 4, 1409), +(8556, '驿马乡', 4, 1409), +(8557, '高阳镇', 4, 1409), +(8558, '上明乡', 4, 1410), +(8559, '东村镇', 4, 1410), +(8560, '土峪乡', 4, 1410), +(8561, '大蛇头乡', 4, 1410), +(8562, '岚城镇', 4, 1410), +(8563, '普明镇', 4, 1410), +(8564, '梁家庄乡', 4, 1410), +(8565, '河口乡', 4, 1410), +(8566, '王狮乡', 4, 1410), +(8567, '界河口镇', 4, 1410), +(8568, '社科乡', 4, 1410), +(8569, '顺会乡', 4, 1410), +(8570, '下曲镇', 4, 1411), +(8571, '凤城镇', 4, 1411), +(8572, '刘胡兰镇', 4, 1411), +(8573, '北张乡', 4, 1411), +(8574, '南安镇', 4, 1411), +(8575, '南庄镇', 4, 1411), +(8576, '南武乡', 4, 1411), +(8577, '孝义镇', 4, 1411), +(8578, '开栅镇', 4, 1411), +(8579, '西城乡', 4, 1411), +(8580, '西槽头乡', 4, 1411), +(8581, '马西乡', 4, 1411), +(8582, '北武当镇', 4, 1412), +(8583, '圪洞镇', 4, 1412), +(8584, '大武镇', 4, 1412), +(8585, '峪口镇', 4, 1412), +(8586, '积翠乡', 4, 1412), +(8587, '马坊镇', 4, 1412), +(8588, '麻地会乡', 4, 1412), +(8589, '三交镇', 4, 1413), +(8590, '孟门镇', 4, 1413), +(8591, '庄上镇', 4, 1413), +(8592, '成家庄镇', 4, 1413), +(8593, '李家湾乡', 4, 1413), +(8594, '柳林镇', 4, 1413), +(8595, '王家沟乡', 4, 1413), +(8596, '留誉镇', 4, 1413), +(8597, '石西乡', 4, 1413), +(8598, '穆村镇', 4, 1413), +(8599, '薛村镇', 4, 1413), +(8600, '贾家垣乡', 4, 1413), +(8601, '金家庄乡', 4, 1413), +(8602, '陈家湾乡', 4, 1413), +(8603, '高家沟乡', 4, 1413), +(8604, '三泉镇', 4, 1414), +(8605, '冀村镇', 4, 1414), +(8606, '太和桥街道', 4, 1414), +(8607, '峪道河镇', 4, 1414), +(8608, '文峰街道', 4, 1414), +(8609, '杏花村镇', 4, 1414), +(8610, '杨家庄镇', 4, 1414), +(8611, '栗家庄乡', 4, 1414), +(8612, '演武镇', 4, 1414), +(8613, '石庄镇', 4, 1414), +(8614, '肖家庄镇', 4, 1414), +(8615, '西河乡', 4, 1414), +(8616, '贾家庄镇', 4, 1414), +(8617, '阳城乡', 4, 1414), +(8618, '义牒镇', 4, 1415), +(8619, '前山乡', 4, 1415); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8620, '和合乡', 4, 1415), +(8621, '小蒜镇', 4, 1415), +(8622, '曹家垣乡', 4, 1415), +(8623, '灵泉镇', 4, 1415), +(8624, '罗村镇', 4, 1415), +(8625, '裴沟乡', 4, 1415), +(8626, '龙交乡', 4, 1415), +(8627, '交口街道', 4, 1416), +(8628, '信义镇', 4, 1416), +(8629, '凤山街道', 4, 1416), +(8630, '吴城镇', 4, 1416), +(8631, '坪头乡', 4, 1416), +(8632, '城北街道', 4, 1416), +(8633, '枣林乡', 4, 1416), +(8634, '滨河街道', 4, 1416), +(8635, '田家会街道', 4, 1416), +(8636, '红眼川乡', 4, 1416), +(8637, '莲花池街道', 4, 1416), +(8638, '西属巴街道', 4, 1416), +(8639, '三道营乡', 4, 1417), +(8640, '公喇嘛乡', 4, 1417), +(8641, '城关镇', 4, 1417), +(8642, '大红城乡', 4, 1417), +(8643, '巧尔什营乡', 4, 1417), +(8644, '新店子乡', 4, 1417), +(8645, '樊家窑乡', 4, 1417), +(8646, '盛乐镇', 4, 1417), +(8647, '羊群沟乡', 4, 1417), +(8648, '舍必崖乡', 4, 1417), +(8649, '董家营乡', 4, 1417), +(8650, '西沟门乡', 4, 1417), +(8651, '黑老窑乡', 4, 1417), +(8652, '中山西路街道', 4, 1418), +(8653, '光明路街道', 4, 1418), +(8654, '攸攸板镇', 4, 1418), +(8655, '新华西路街道', 4, 1418), +(8656, '海拉尔西路街道', 4, 1418), +(8657, '环河街街道', 4, 1418), +(8658, '通道街街道', 4, 1418), +(8659, '钢铁路街道', 4, 1418), +(8660, '三两乡', 4, 1419), +(8661, '兵州亥乡', 4, 1419), +(8662, '北什轴乡', 4, 1419), +(8663, '只几梁乡', 4, 1419), +(8664, '台阁牧镇', 4, 1419), +(8665, '善岱镇', 4, 1419), +(8666, '塔布赛乡', 4, 1419), +(8667, '大岱乡', 4, 1419), +(8668, '察素齐镇', 4, 1419), +(8669, '把什乡', 4, 1419), +(8670, '毕克齐镇', 4, 1419), +(8671, '沙尔沁乡', 4, 1419), +(8672, '沙尔营乡', 4, 1419), +(8673, '白庙子镇', 4, 1419), +(8674, '铁帽乡', 4, 1419), +(8675, '陶思浩乡', 4, 1419), +(8676, '中滩乡', 4, 1420), +(8677, '乃只盖乡', 4, 1420), +(8678, '五申镇', 4, 1420), +(8679, '伍什家乡', 4, 1420), +(8680, '双河镇', 4, 1420), +(8681, '古城乡', 4, 1420); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8682, '新营子镇', 4, 1420), +(8683, '永圣域乡', 4, 1420), +(8684, '燕山营乡', 4, 1420), +(8685, '东街街道', 4, 1421), +(8686, '东风路街道', 4, 1421), +(8687, '中山东路街道', 4, 1421), +(8688, '保合少乡', 4, 1421), +(8689, '毫沁营镇', 4, 1421), +(8690, '海东路街道', 4, 1421), +(8691, '西街街道', 4, 1421), +(8692, '迎新路街道', 4, 1421), +(8693, '锡林路街道', 4, 1421), +(8694, '上秃亥乡', 4, 1422), +(8695, '东土城乡', 4, 1422), +(8696, '东红胜乡', 4, 1422), +(8697, '中后河乡', 4, 1422), +(8698, '二份子乡', 4, 1422), +(8699, '厂汉木台乡', 4, 1422), +(8700, '可可以力更镇', 4, 1422), +(8701, '哈乐镇', 4, 1422), +(8702, '哈拉合少乡', 4, 1422), +(8703, '哈拉门独乡', 4, 1422), +(8704, '大豆铺乡', 4, 1422), +(8705, '大青山乡', 4, 1422), +(8706, '纳令沟乡', 4, 1422), +(8707, '耗赖山乡', 4, 1422), +(8708, '西乌兰不浪镇', 4, 1422), +(8709, '西红山子乡', 4, 1422), +(8710, '五良太乡', 4, 1423), +(8711, '北堡乡', 4, 1423), +(8712, '单台子乡', 4, 1423), +(8713, '喇嘛湾镇', 4, 1423), +(8714, '城关镇', 4, 1423), +(8715, '小庙子乡', 4, 1423), +(8716, '暖泉乡', 4, 1423), +(8717, '杨家窑乡', 4, 1423), +(8718, '王桂窑乡', 4, 1423), +(8719, '窑沟乡', 4, 1423), +(8720, '韭菜庄乡', 4, 1423), +(8721, '兴隆巷街道', 4, 1424), +(8722, '大南街街道', 4, 1424), +(8723, '小召前街街道', 4, 1424), +(8724, '小黑镇', 4, 1424), +(8725, '桃花乡', 4, 1424), +(8726, '石羊桥东路街道', 4, 1424), +(8727, '西菜园街道', 4, 1424), +(8728, '鄂尔多斯路街道', 4, 1424), +(8729, '长和廊街道', 4, 1424), +(8730, '中专路街道', 4, 1425), +(8731, '乌兰察布路街道', 4, 1425), +(8732, '人民路街道', 4, 1425), +(8733, '大学东路街道', 4, 1425), +(8734, '大学西路街道', 4, 1425), +(8735, '太平庄乡', 4, 1425), +(8736, '巧报镇', 4, 1425), +(8737, '巴彦镇', 4, 1425), +(8738, '榆林镇', 4, 1425), +(8739, '西把栅乡', 4, 1425), +(8740, '金河镇', 4, 1425); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8741, '黄合少镇', 4, 1425), +(8742, '东兴街道', 4, 1426), +(8743, '东站街道', 4, 1426), +(8744, '二里半街道', 4, 1426), +(8745, '南圪洞街道', 4, 1426), +(8746, '南门外街道', 4, 1426), +(8747, '和平街道', 4, 1426), +(8748, '回民街道', 4, 1426), +(8749, '杨圪楞街道', 4, 1426), +(8750, '河东街道', 4, 1426), +(8751, '河东镇', 4, 1426), +(8752, '西脑包街道', 4, 1426), +(8753, '财神庙街道', 4, 1426), +(8754, '铁西街道', 4, 1426), +(8755, '兴胜镇', 4, 1427), +(8756, '古城湾乡', 4, 1427), +(8757, '哈业胡同镇', 4, 1427), +(8758, '哈业脑包乡', 4, 1427), +(8759, '哈林格尔镇', 4, 1427), +(8760, '新城镇', 4, 1427), +(8761, '沙尔沁乡', 4, 1427), +(8762, '沙河镇', 4, 1427), +(8763, '莎木佳镇', 4, 1427), +(8764, '阿嘎如泰苏木', 4, 1427), +(8765, '麻池镇', 4, 1427), +(8766, '下湿壕乡', 4, 1428), +(8767, '九分子乡', 4, 1428), +(8768, '兴顺西乡', 4, 1428), +(8769, '卜塔亥乡', 4, 1428), +(8770, '大庙乡', 4, 1428), +(8771, '忽鸡沟乡', 4, 1428), +(8772, '新建乡', 4, 1428), +(8773, '白灵淖乡', 4, 1428), +(8774, '红泥井乡', 4, 1428), +(8775, '西斗铺镇', 4, 1428), +(8776, '金山镇', 4, 1428), +(8777, '银号乡', 4, 1428), +(8778, '三道河乡', 4, 1429), +(8779, '三间房乡', 4, 1429), +(8780, '九峰山生态管理委员会', 4, 1429), +(8781, '二十四顷地乡', 4, 1429), +(8782, '党三尧乡', 4, 1429), +(8783, '双龙镇', 4, 1429), +(8784, '吴坝乡', 4, 1429), +(8785, '大城西乡', 4, 1429), +(8786, '将军尧乡', 4, 1429), +(8787, '小召子乡', 4, 1429), +(8788, '明沙淖乡', 4, 1429), +(8789, '毛岱乡', 4, 1429), +(8790, '沙海子乡', 4, 1429), +(8791, '沟门镇', 4, 1429), +(8792, '海子乡', 4, 1429), +(8793, '美岱召镇', 4, 1429), +(8794, '苏波盖乡', 4, 1429), +(8795, '萨拉齐镇', 4, 1429), +(8796, '前进道街道', 4, 1430), +(8797, '友谊大街街道', 4, 1430), +(8798, '团结大街街道', 4, 1430), +(8799, '少先路街道', 4, 1430), +(8800, '市府东路街道', 4, 1430); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8801, '张家营子街道', 4, 1430), +(8802, '昆工路街道', 4, 1430), +(8803, '昆河镇', 4, 1430), +(8804, '林荫路街道', 4, 1430), +(8805, '沼潭街道', 4, 1430), +(8806, '白云路街道', 4, 1430), +(8807, '阿尔丁大街街道', 4, 1430), +(8808, '鞍山道街道', 4, 1430), +(8809, '黄河西路街道', 4, 1430), +(8810, '矿山路街道', 4, 1431), +(8811, '通阳道街道', 4, 1431), +(8812, '五当召镇', 4, 1432), +(8813, '五当沟街道', 4, 1432), +(8814, '国庆乡', 4, 1432), +(8815, '大发街道', 4, 1432), +(8816, '大磁街道', 4, 1432), +(8817, '白狐沟街道', 4, 1432), +(8818, '石拐街道', 4, 1432), +(8819, '乌克忽洞乡', 4, 1433), +(8820, '乌兰忽洞乡', 4, 1433), +(8821, '大苏吉乡', 4, 1433), +(8822, '小文公乡', 4, 1433), +(8823, '巴音敖包苏木', 4, 1433), +(8824, '巴音珠日和苏木', 4, 1433), +(8825, '希拉穆仁镇', 4, 1433), +(8826, '新宝力格苏木', 4, 1433), +(8827, '查干哈达苏木', 4, 1433), +(8828, '查干敖包苏木', 4, 1433), +(8829, '查干淖尔苏木', 4, 1433), +(8830, '满都拉镇', 4, 1433), +(8831, '百灵庙镇', 4, 1433), +(8832, '石宝镇', 4, 1433), +(8833, '西河乡', 4, 1433), +(8834, '都荣敖包苏木', 4, 1433), +(8835, '额尔登敖包苏木', 4, 1433), +(8836, '万青路街道', 4, 1434), +(8837, '乌素图街道', 4, 1434), +(8838, '先锋道街道', 4, 1434), +(8839, '富强路街道', 4, 1434), +(8840, '幸福路街道', 4, 1434), +(8841, '科学路街道', 4, 1434), +(8842, '自由路街道', 4, 1434), +(8843, '青山路街道', 4, 1434), +(8844, '青福镇', 4, 1434), +(8845, '三道坎街道', 4, 1435), +(8846, '乌兰淖尔镇', 4, 1435), +(8847, '五虎山街道', 4, 1435), +(8848, '巴音赛街道', 4, 1435), +(8849, '振华街道', 4, 1435), +(8850, '教子沟街道', 4, 1435), +(8851, '梁家沟街道', 4, 1435), +(8852, '苏海图街道', 4, 1435), +(8853, '凤凰岭街道', 4, 1436), +(8854, '千里山镇', 4, 1436), +(8855, '卡布其街道', 4, 1436), +(8856, '新华街道', 4, 1436), +(8857, '新华西街道', 4, 1436); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8858, '海北街道', 4, 1436), +(8859, '滨河街道', 4, 1436), +(8860, '公乌素镇', 4, 1437), +(8861, '巴音陶亥镇', 4, 1437), +(8862, '拉僧仲街道', 4, 1437), +(8863, '拉僧庙镇', 4, 1437), +(8864, '西卓子山街道', 4, 1437), +(8865, '五家镇', 4, 1438), +(8866, '元宝山镇', 4, 1438), +(8867, '古山镇', 4, 1438), +(8868, '小五家回族乡', 4, 1438), +(8869, '山前镇', 4, 1438), +(8870, '平庄城区街道', 4, 1438), +(8871, '平庄镇', 4, 1438), +(8872, '建昌营镇', 4, 1438), +(8873, '美丽河镇', 4, 1438), +(8874, '西露天街道', 4, 1438), +(8875, '风水沟镇', 4, 1438), +(8876, '马林镇', 4, 1438), +(8877, '马蹄营子乡', 4, 1438), +(8878, '万合永镇', 4, 1439), +(8879, '三义乡', 4, 1439), +(8880, '乌兰布统乡', 4, 1439), +(8881, '书声乡', 4, 1439), +(8882, '南店镇', 4, 1439), +(8883, '同兴镇', 4, 1439), +(8884, '土城子镇', 4, 1439), +(8885, '宇宙地镇', 4, 1439), +(8886, '巴彦查干苏木', 4, 1439), +(8887, '巴彦高勒苏木', 4, 1439), +(8888, '广兴源镇', 4, 1439), +(8889, '新井乡', 4, 1439), +(8890, '新庙乡', 4, 1439), +(8891, '新开地乡', 4, 1439), +(8892, '浩来呼热乡', 4, 1439), +(8893, '红山子乡', 4, 1439), +(8894, '经棚镇', 4, 1439), +(8895, '芝瑞镇', 4, 1439), +(8896, '达日罕乌拉苏木', 4, 1439), +(8897, '达来诺日镇', 4, 1439), +(8898, '乃林果树农场', 4, 1440), +(8899, '乃林镇', 4, 1440), +(8900, '十家满族乡', 4, 1440), +(8901, '南台子乡', 4, 1440), +(8902, '四十家子乡', 4, 1440), +(8903, '大牛群乡', 4, 1440), +(8904, '小牛群乡', 4, 1440), +(8905, '旺业甸镇', 4, 1440), +(8906, '昌盛远乡', 4, 1440), +(8907, '楼子店乡', 4, 1440), +(8908, '永丰乡', 4, 1440), +(8909, '牛营子镇', 4, 1440), +(8910, '王爷府镇', 4, 1440), +(8911, '美林乡', 4, 1440), +(8912, '西桥乡', 4, 1440), +(8913, '锦山镇', 4, 1440), +(8914, '马鞍山乡', 4, 1440), +(8915, '马鞍山羊场', 4, 1440), +(8916, '龙山镇', 4, 1440), +(8917, '三座店乡', 4, 1441), +(8918, '五化乡', 4, 1441); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8919, '八里罕镇', 4, 1441), +(8920, '大双庙乡', 4, 1441), +(8921, '大城子镇', 4, 1441), +(8922, '大明镇', 4, 1441), +(8923, '天义镇', 4, 1441), +(8924, '小城子镇', 4, 1441), +(8925, '必斯营子乡', 4, 1441), +(8926, '忙农镇', 4, 1441), +(8927, '汐子镇', 4, 1441), +(8928, '甸子镇', 4, 1441), +(8929, '黑里河镇', 4, 1441), +(8930, '大板镇', 4, 1442), +(8931, '宝日勿苏镇', 4, 1442), +(8932, '岗根苏木', 4, 1442), +(8933, '巴彦塔拉苏木', 4, 1442), +(8934, '巴彦汉镇', 4, 1442), +(8935, '巴彦琥硕镇', 4, 1442), +(8936, '幸福之路苏木', 4, 1442), +(8937, '朝阳乡', 4, 1442), +(8938, '查干沐沦苏木', 4, 1442), +(8939, '查干诺尔苏木', 4, 1442), +(8940, '沙巴尔台苏木', 4, 1442), +(8941, '益和诺尔苏木', 4, 1442), +(8942, '索博日嘎苏木', 4, 1442), +(8943, '羊场乡', 4, 1442), +(8944, '胡日哈苏木', 4, 1442), +(8945, '西拉沐沦苏木', 4, 1442), +(8946, '三山乡', 4, 1443), +(8947, '丰水山镇', 4, 1443), +(8948, '乌兰达坝苏木', 4, 1443), +(8949, '十三敖包乡', 4, 1443), +(8950, '哈拉哈达乡', 4, 1443), +(8951, '哈达英格乡', 4, 1443), +(8952, '杨家营子镇', 4, 1443), +(8953, '林东镇', 4, 1443), +(8954, '查干哈达苏木', 4, 1443), +(8955, '毛宝力格乡', 4, 1443), +(8956, '浩尔吐乡', 4, 1443), +(8957, '白音勿拉苏木', 4, 1443), +(8958, '白音敖包乡', 4, 1443), +(8959, '白音沟乡', 4, 1443), +(8960, '白音诺尔镇', 4, 1443), +(8961, '碧流台镇', 4, 1443), +(8962, '花加拉嘎乡', 4, 1443), +(8963, '野猪沟乡', 4, 1443), +(8964, '隆昌镇', 4, 1443), +(8965, '下洼镇', 4, 1444), +(8966, '丰收乡', 4, 1444), +(8967, '克力代乡', 4, 1444), +(8968, '南塔乡', 4, 1444), +(8969, '双井乡', 4, 1444), +(8970, '古鲁板蒿乡', 4, 1444), +(8971, '哈沙吐乡', 4, 1444), +(8972, '四家子镇', 4, 1444), +(8973, '四德堂乡', 4, 1444), +(8974, '四道湾子镇', 4, 1444), +(8975, '大甸子乡', 4, 1444), +(8976, '宝国吐乡', 4, 1444), +(8977, '康家营子乡', 4, 1444), +(8978, '敖吉乡', 4, 1444); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(8979, '敖润苏莫苏木', 4, 1444), +(8980, '敖音勿苏乡', 4, 1444), +(8981, '新地乡', 4, 1444), +(8982, '新惠镇', 4, 1444), +(8983, '新窝铺乡', 4, 1444), +(8984, '木头营子乡', 4, 1444), +(8985, '林家地乡', 4, 1444), +(8986, '牛古吐乡', 4, 1444), +(8987, '王家营子乡', 4, 1444), +(8988, '玛尼罕乡', 4, 1444), +(8989, '萨力巴乡', 4, 1444), +(8990, '贝子府镇', 4, 1444), +(8991, '金厂沟梁镇', 4, 1444), +(8992, '长胜镇', 4, 1444), +(8993, '高家窝铺乡', 4, 1444), +(8994, '上官地镇', 4, 1445), +(8995, '东山乡', 4, 1445), +(8996, '五三镇', 4, 1445), +(8997, '关家营满族乡', 4, 1445), +(8998, '初头朗镇', 4, 1445), +(8999, '向阳街道', 4, 1445), +(9000, '哈拉道口镇', 4, 1445), +(9001, '城子乡', 4, 1445), +(9002, '大六份乡', 4, 1445), +(9003, '大夫营子乡', 4, 1445), +(9004, '大庙镇', 4, 1445), +(9005, '大碾子乡', 4, 1445), +(9006, '太平地乡', 4, 1445), +(9007, '姜家营子乡', 4, 1445), +(9008, '孤山子乡', 4, 1445), +(9009, '安庆镇', 4, 1445), +(9010, '岗子乡', 4, 1445), +(9011, '当铺地镇', 4, 1445), +(9012, '忙牛营乡', 4, 1445), +(9013, '振兴街道', 4, 1445), +(9014, '木头沟乡', 4, 1445), +(9015, '松州街道', 4, 1445), +(9016, '水地乡', 4, 1445), +(9017, '河南营子乡', 4, 1445), +(9018, '猴头沟乡', 4, 1445), +(9019, '王家店乡', 4, 1445), +(9020, '王府乡', 4, 1445), +(9021, '碾坊乡', 4, 1445), +(9022, '穆家营子镇', 4, 1445), +(9023, '红花沟镇', 4, 1445), +(9024, '老府镇', 4, 1445), +(9025, '铁东街道', 4, 1445), +(9026, '下场乡', 4, 1446), +(9027, '五十家子镇', 4, 1446), +(9028, '兴隆庄乡', 4, 1446), +(9029, '十二吐乡', 4, 1446), +(9030, '双井店乡', 4, 1446), +(9031, '大井镇', 4, 1446), +(9032, '大川乡', 4, 1446), +(9033, '大营子乡', 4, 1446), +(9034, '官地镇', 4, 1446), +(9035, '新城子镇', 4, 1446), +(9036, '新林镇', 4, 1446), +(9037, '板石房子乡', 4, 1446), +(9038, '林西镇', 4, 1446), +(9039, '统部镇', 4, 1446), +(9040, '老房身乡', 4, 1446); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9041, '隆平乡', 4, 1446), +(9042, '三中街街道', 4, 1447), +(9043, '东城街道', 4, 1447), +(9044, '南新街街道', 4, 1447), +(9045, '哈达街道', 4, 1447), +(9046, '城郊乡', 4, 1447), +(9047, '文钟镇', 4, 1447), +(9048, '桥北镇', 4, 1447), +(9049, '永巨街道', 4, 1447), +(9050, '站前街道', 4, 1447), +(9051, '红庙子镇', 4, 1447), +(9052, '西屯街道', 4, 1447), +(9053, '铁南街道', 4, 1447), +(9054, '长青街道', 4, 1447), +(9055, '乌丹镇', 4, 1448), +(9056, '乌敦套海镇', 4, 1448), +(9057, '五分地镇', 4, 1448), +(9058, '亿合公乡', 4, 1448), +(9059, '大兴乡', 4, 1448), +(9060, '头分地镇', 4, 1448), +(9061, '头段地乡', 4, 1448), +(9062, '山嘴子乡', 4, 1448), +(9063, '巴嘎塔拉苏木', 4, 1448), +(9064, '布力彦苏木', 4, 1448), +(9065, '广德公镇', 4, 1448), +(9066, '庄头营子乡', 4, 1448), +(9067, '新苏莫苏木', 4, 1448), +(9068, '朝格温都苏木', 4, 1448), +(9069, '杜家地乡', 4, 1448), +(9070, '杨树沟门乡', 4, 1448), +(9071, '格日僧苏木', 4, 1448), +(9072, '桥头镇', 4, 1448), +(9073, '梧桐花镇', 4, 1448), +(9074, '毛山东乡', 4, 1448), +(9075, '海拉苏镇', 4, 1448), +(9076, '玉田皋乡', 4, 1448), +(9077, '白音套海苏木', 4, 1448), +(9078, '解放营乡', 4, 1448), +(9079, '阿什罕苏木', 4, 1448), +(9080, '高家梁乡', 4, 1448), +(9081, '高日罕苏木', 4, 1448), +(9082, '东沙布台乡委会', 4, 1449), +(9083, '乌兰哈达乡', 4, 1449), +(9084, '先峰乡', 4, 1449), +(9085, '双胜镇', 4, 1449), +(9086, '坤都镇', 4, 1449), +(9087, '天山口镇', 4, 1449), +(9088, '天山镇', 4, 1449), +(9089, '岗台乡', 4, 1449), +(9090, '巴彦包勒格苏木', 4, 1449), +(9091, '巴彦包特乡', 4, 1449), +(9092, '巴彦温都尔苏木', 4, 1449), +(9093, '巴彦花镇', 4, 1449), +(9094, '巴彦诺尔苏木', 4, 1449), +(9095, '巴拉奇如德苏木', 4, 1449), +(9096, '扎嘎斯台镇', 4, 1449), +(9097, '新民乡', 4, 1449), +(9098, '柴达木苏木', 4, 1449), +(9099, '白城子乡', 4, 1449), +(9100, '绍根镇', 4, 1449); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9101, '罕苏木苏木', 4, 1449), +(9102, '荞麦塔拉乡', 4, 1449), +(9103, '赛汉塔拉苏木', 4, 1449), +(9104, '道德镇', 4, 1449), +(9105, '东明镇', 4, 1450), +(9106, '义隆永镇', 4, 1450), +(9107, '八仙筒镇', 4, 1450), +(9108, '固日班花苏木', 4, 1450), +(9109, '国有六号农场', 4, 1450), +(9110, '土城子镇', 4, 1450), +(9111, '大沁他拉镇', 4, 1450), +(9112, '奈林苏木', 4, 1450), +(9113, '巴嘎波日和苏木', 4, 1450), +(9114, '平安镇', 4, 1450), +(9115, '得胜镇', 4, 1450), +(9116, '新镇', 4, 1450), +(9117, '明仁苏木', 4, 1450), +(9118, '沙日浩来镇', 4, 1450), +(9119, '治安镇', 4, 1450), +(9120, '清河苏木', 4, 1450), +(9121, '白音他拉镇', 4, 1450), +(9122, '白音昌乡', 4, 1450), +(9123, '章古台苏木', 4, 1450), +(9124, '苇莲苏乡', 4, 1450), +(9125, '青龙山镇', 4, 1450), +(9126, '黄花塔拉镇', 4, 1450), +(9127, '三家子镇', 4, 1451), +(9128, '先进苏木', 4, 1451), +(9129, '六家子镇', 4, 1451), +(9130, '哈尔稿苏木', 4, 1451), +(9131, '库伦镇', 4, 1451), +(9132, '扣河子镇', 4, 1451), +(9133, '水泉镇', 4, 1451), +(9134, '白音花苏木', 4, 1451), +(9135, '茫汗苏木', 4, 1451), +(9136, '额勒顺镇', 4, 1451), +(9137, '三棵树乡', 4, 1452), +(9138, '东来镇', 4, 1452), +(9139, '东风镇', 4, 1452), +(9140, '义和塔拉苏木', 4, 1452), +(9141, '保安镇', 4, 1452), +(9142, '兴安乡', 4, 1452), +(9143, '北兴镇', 4, 1452), +(9144, '北清河乡', 4, 1452), +(9145, '双河镇', 4, 1452), +(9146, '吉日嘎郎吐镇', 4, 1452), +(9147, '和平镇', 4, 1452), +(9148, '坤都岭镇', 4, 1452), +(9149, '大榆树镇', 4, 1452), +(9150, '小街基镇', 4, 1452), +(9151, '建华镇', 4, 1452), +(9152, '开鲁镇', 4, 1452), +(9153, '新华镇', 4, 1452), +(9154, '清河牧场', 4, 1452), +(9155, '道德镇', 4, 1452), +(9156, '麦新镇', 4, 1452), +(9157, '黑龙坝镇', 4, 1452), +(9158, '乌兰哈达苏木', 4, 1453), +(9159, '乌力吉木仁苏木', 4, 1453), +(9160, '乌额格其苏木', 4, 1453), +(9161, '前德门苏木', 4, 1453); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9162, '嘎亥图镇', 4, 1453), +(9163, '嘎达苏种畜场', 4, 1453), +(9164, '太平山乡', 4, 1453), +(9165, '巨日合镇', 4, 1453), +(9166, '巴彦塔拉苏木', 4, 1453), +(9167, '巴彦芒哈苏木', 4, 1453), +(9168, '巴雅尔吐胡硕镇', 4, 1453), +(9169, '查布嘎图苏木', 4, 1453), +(9170, '格日朝鲁苏木', 4, 1453), +(9171, '毛都苏木', 4, 1453), +(9172, '罕山镇', 4, 1453), +(9173, '联合屯镇', 4, 1453), +(9174, '道老杜苏木', 4, 1453), +(9175, '阿日昆都冷苏木', 4, 1453), +(9176, '香山镇', 4, 1453), +(9177, '鲁北镇', 4, 1453), +(9178, '黄花山镇', 4, 1453), +(9179, '三义堂农场', 4, 1454), +(9180, '东郊街道', 4, 1454), +(9181, '丰田镇', 4, 1454), +(9182, '余粮堡镇', 4, 1454), +(9183, '哲南农场', 4, 1454), +(9184, '大林镇', 4, 1454), +(9185, '大罕镇', 4, 1454), +(9186, '孔家窝堡镇', 4, 1454), +(9187, '庆和镇', 4, 1454), +(9188, '建国镇', 4, 1454), +(9189, '敖力布皋镇', 4, 1454), +(9190, '施介街道', 4, 1454), +(9191, '明仁街道', 4, 1454), +(9192, '木里图镇', 4, 1454), +(9193, '民主镇', 4, 1454), +(9194, '永清街道', 4, 1454), +(9195, '河西镇', 4, 1454), +(9196, '清河镇', 4, 1454), +(9197, '清真街道', 4, 1454), +(9198, '电厂街道', 4, 1454), +(9199, '科尔沁街道', 4, 1454), +(9200, '红星镇', 4, 1454), +(9201, '育新镇', 4, 1454), +(9202, '胡力海镇', 4, 1454), +(9203, '莫力庙苏木', 4, 1454), +(9204, '西六方镇', 4, 1454), +(9205, '西门街道', 4, 1454), +(9206, '角干镇', 4, 1454), +(9207, '辽河镇', 4, 1454), +(9208, '钱家店镇', 4, 1454), +(9209, '铁南街道', 4, 1454), +(9210, '霍林街道', 4, 1454), +(9211, '高林屯种畜场', 4, 1454), +(9212, '七棵树乡', 4, 1455), +(9213, '东苏林场', 4, 1455), +(9214, '乌斯吐苏木', 4, 1455), +(9215, '代力吉镇', 4, 1455), +(9216, '保康镇', 4, 1455), +(9217, '努日木镇', 4, 1455), +(9218, '协代苏木', 4, 1455), +(9219, '哈日干吐苏木', 4, 1455), +(9220, '团结乡', 4, 1455), +(9221, '图布信苏木', 4, 1455), +(9222, '宝龙山镇', 4, 1455); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9223, '巴彦召苏木', 4, 1455), +(9224, '巴彦塔拉镇', 4, 1455), +(9225, '巴彦苏木', 4, 1455), +(9226, '希伯花镇', 4, 1455), +(9227, '敖包苏木', 4, 1455), +(9228, '敖本台苏木', 4, 1455), +(9229, '新河乡', 4, 1455), +(9230, '架玛吐镇', 4, 1455), +(9231, '海力锦苏木', 4, 1455), +(9232, '珠日河镇', 4, 1455), +(9233, '白兴吐苏木', 4, 1455), +(9234, '胜利乡', 4, 1455), +(9235, '腰林毛都镇', 4, 1455), +(9236, '舍伯吐镇', 4, 1455), +(9237, '花吐古拉镇', 4, 1455), +(9238, '花胡硕苏木', 4, 1455), +(9239, '门达镇', 4, 1455), +(9240, '额伦索克苏木', 4, 1455), +(9241, '乌兰敖道苏木', 4, 1456), +(9242, '伊胡塔镇', 4, 1456), +(9243, '公河来苏木', 4, 1456), +(9244, '努古斯台镇', 4, 1456), +(9245, '双胜乡', 4, 1456), +(9246, '吉尔嘎朗镇', 4, 1456), +(9247, '向阳乡', 4, 1456), +(9248, '巴嘎塔拉苏木', 4, 1456), +(9249, '巴彦毛都苏木', 4, 1456), +(9250, '巴雅斯古楞苏木', 4, 1456), +(9251, '常胜镇', 4, 1456), +(9252, '散都镇', 4, 1456), +(9253, '朝鲁吐镇', 4, 1456), +(9254, '查日苏镇', 4, 1456), +(9255, '浩坦苏木', 4, 1456), +(9256, '海斯改苏木', 4, 1456), +(9257, '海鲁吐镇', 4, 1456), +(9258, '甘旗卡镇', 4, 1456), +(9259, '胜利镇', 4, 1456), +(9260, '茂道吐苏木', 4, 1456), +(9261, '金宝屯镇', 4, 1456), +(9262, '阿古拉镇', 4, 1456), +(9263, '阿都沁苏木', 4, 1456), +(9264, '额莫勒苏木', 4, 1456), +(9265, '宝日呼吉尔街道', 4, 1457), +(9266, '沙尔呼热镇', 4, 1457), +(9267, '珠斯花街道', 4, 1457), +(9268, '莫斯台街道', 4, 1457), +(9269, '达莱胡硕苏木', 4, 1457), +(9270, '万利镇', 4, 1458), +(9271, '交通街街道', 4, 1458), +(9272, '公园路街道', 4, 1458), +(9273, '哈巴格希乡', 4, 1458), +(9274, '天骄路街道', 4, 1458), +(9275, '富兴路街道', 4, 1458), +(9276, '布日都镇', 4, 1458), +(9277, '建设街街道', 4, 1458), +(9278, '林荫路街道', 4, 1458), +(9279, '柴登镇', 4, 1458), +(9280, '罕台镇', 4, 1458), +(9281, '铜川镇', 4, 1458); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9282, '乌兰沙巴尔台乡', 4, 1459), +(9283, '乌兰陶勒盖镇', 4, 1459), +(9284, '乌审召镇', 4, 1459), +(9285, '呼吉尔特乡', 4, 1459), +(9286, '嘎鲁图苏木', 4, 1459), +(9287, '图克镇', 4, 1459), +(9288, '沙尔利格镇', 4, 1459), +(9289, '河南乡', 4, 1459), +(9290, '浩勒报吉乡', 4, 1459), +(9291, '纳林河镇', 4, 1459), +(9292, '达布察克镇', 4, 1459), +(9293, '陶利镇', 4, 1459), +(9294, '黄陶勒盖乡', 4, 1459), +(9295, '乌兰木伦镇', 4, 1460), +(9296, '伊金霍洛镇', 4, 1460), +(9297, '红庆河镇', 4, 1460), +(9298, '纳林陶亥镇', 4, 1460), +(9299, '苏布尔嘎镇', 4, 1460), +(9300, '设札萨克镇', 4, 1460), +(9301, '阿勒腾席热镇', 4, 1460), +(9302, '准格尔召镇', 4, 1461), +(9303, '大路镇', 4, 1461), +(9304, '布尔陶亥苏木', 4, 1461), +(9305, '暖水镇', 4, 1461), +(9306, '柴达木镇', 4, 1461), +(9307, '沙圪堵镇', 4, 1461), +(9308, '纳日松镇', 4, 1461), +(9309, '薛家湾镇', 4, 1461), +(9310, '龙口镇', 4, 1461), +(9311, '伊和乌素镇', 4, 1462), +(9312, '吉日嘎朗图镇', 4, 1462), +(9313, '呼和木独镇', 4, 1462), +(9314, '四十里梁镇', 4, 1462), +(9315, '塔然高勒乡', 4, 1462), +(9316, '巴拉贡镇', 4, 1462), +(9317, '巴音乌素镇', 4, 1462), +(9318, '杭锦淖尔乡', 4, 1462), +(9319, '浩绕柴达木苏木', 4, 1462), +(9320, '独贵特拉镇', 4, 1462), +(9321, '锡尼镇', 4, 1462), +(9322, '阿门其日格乡', 4, 1462), +(9323, '中和西镇', 4, 1463), +(9324, '乌兰乡', 4, 1463), +(9325, '吉格斯太镇', 4, 1463), +(9326, '大树湾镇', 4, 1463), +(9327, '展旦召苏木', 4, 1463), +(9328, '德胜泰乡', 4, 1463), +(9329, '敖包梁乡', 4, 1463), +(9330, '昭君坟乡', 4, 1463), +(9331, '树林召乡', 4, 1463), +(9332, '树林召镇', 4, 1463), +(9333, '榆林子乡', 4, 1463), +(9334, '王爱召镇', 4, 1463), +(9335, '白泥井镇', 4, 1463), +(9336, '盐店乡', 4, 1463), +(9337, '耳字壕镇', 4, 1463), +(9338, '蓿亥图乡', 4, 1463), +(9339, '解放滩镇', 4, 1463), +(9340, '青达门乡', 4, 1463); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9341, '马场壕乡', 4, 1463), +(9342, '高头窑镇', 4, 1463), +(9343, '泊尔江海子镇', 4, 1464), +(9344, '三段地镇', 4, 1465), +(9345, '上海庙牧场', 4, 1465), +(9346, '上海庙镇', 4, 1465), +(9347, '二道川乡', 4, 1465), +(9348, '城川镇', 4, 1465), +(9349, '布拉格苏木', 4, 1465), +(9350, '敖勒召其镇', 4, 1465), +(9351, '昂素镇', 4, 1465), +(9352, '毛盖图苏木', 4, 1465), +(9353, '珠和苏木', 4, 1465), +(9354, '乌兰镇', 4, 1466), +(9355, '公其日嘎乡', 4, 1466), +(9356, '包乐浩晓镇', 4, 1466), +(9357, '察汗淖尔镇', 4, 1466), +(9358, '新召苏木', 4, 1466), +(9359, '木凯淖尔乡', 4, 1466), +(9360, '查布苏木', 4, 1466), +(9361, '棋盘井镇', 4, 1466), +(9362, '沙井镇', 4, 1466), +(9363, '碱柜镇', 4, 1466), +(9364, '苏米图苏木', 4, 1466), +(9365, '阿尔巴斯苏木', 4, 1466), +(9366, '兴华街道', 4, 1467), +(9367, '卧牛河镇', 4, 1467), +(9368, '向阳街道', 4, 1467), +(9369, '大河湾镇', 4, 1467), +(9370, '成吉思汗镇', 4, 1467), +(9371, '正阳街道', 4, 1467), +(9372, '河西街道', 4, 1467), +(9373, '洼堤镇', 4, 1467), +(9374, '浩饶山镇', 4, 1467), +(9375, '磨菇气镇', 4, 1467), +(9376, '繁荣街道', 4, 1467), +(9377, '萨马街鄂温克民族乡', 4, 1467), +(9378, '达斡尔民族乡', 4, 1467), +(9379, '鄂伦春民族乡', 4, 1467), +(9380, '铁东街道', 4, 1467), +(9381, '高台子街道', 4, 1467), +(9382, '克尔伦苏木', 4, 1468), +(9383, '呼伦苏木', 4, 1468), +(9384, '宝格德乌拉苏木', 4, 1468), +(9385, '杭乌拉苏木', 4, 1468), +(9386, '贝尔苏木', 4, 1468), +(9387, '赛汉塔拉苏木', 4, 1468), +(9388, '达来东苏木', 4, 1468), +(9389, '达来苏木', 4, 1468), +(9390, '阿拉坦额莫勒镇', 4, 1468), +(9391, '阿敦础鲁苏木', 4, 1468), +(9392, '乌布尔宝力格苏木', 4, 1469), +(9393, '吉布胡郎图苏木', 4, 1469), +(9394, '嵯岗镇', 4, 1469), +(9395, '巴音诺尔苏木', 4, 1469), +(9396, '甘珠尔苏木', 4, 1469), +(9397, '罕达盖苏木', 4, 1469); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9398, '莫达木吉苏木', 4, 1469), +(9399, '阿木古郎镇', 4, 1469), +(9400, '敖鲁古雅鄂温克族乡', 4, 1470), +(9401, '森工路街道', 4, 1470), +(9402, '河东街道', 4, 1470), +(9403, '河西街道', 4, 1470), +(9404, '满归镇', 4, 1470), +(9405, '金河镇', 4, 1470), +(9406, '阿龙山镇', 4, 1470), +(9407, '健康街道', 4, 1471), +(9408, '向华街道', 4, 1471), +(9409, '呼伦街道', 4, 1471), +(9410, '哈克镇', 4, 1471), +(9411, '奋斗街道', 4, 1471), +(9412, '正阳街道', 4, 1471), +(9413, '胜利街道', 4, 1471), +(9414, '靠山街道', 4, 1471), +(9415, '东山街道', 4, 1472), +(9416, '兴华街道', 4, 1472), +(9417, '扎赉诺尔矿区灵泉街道', 4, 1472), +(9418, '扎赉诺尔矿区第一街道', 4, 1472), +(9419, '扎赉诺尔矿区第三街道', 4, 1472), +(9420, '扎赉诺尔矿区第二街道', 4, 1472), +(9421, '扎赉诺尔矿区第五街道', 4, 1472), +(9422, '扎赉诺尔矿区第四街道', 4, 1472), +(9423, '新开河镇', 4, 1472), +(9424, '道北街道', 4, 1472), +(9425, '道南街道', 4, 1472), +(9426, '乌奴耳镇', 4, 1473), +(9427, '乌尔其汉镇', 4, 1473), +(9428, '伊图里河镇', 4, 1473), +(9429, '免渡河镇', 4, 1473), +(9430, '博克图镇', 4, 1473), +(9431, '图里河镇', 4, 1473), +(9432, '塔尔气镇', 4, 1473), +(9433, '巴林镇', 4, 1473), +(9434, '库都尔镇', 4, 1473), +(9435, '建设街道', 4, 1473), +(9436, '新工街道', 4, 1473), +(9437, '暖泉街道', 4, 1473), +(9438, '永兴街道', 4, 1473), +(9439, '煤田镇', 4, 1473), +(9440, '牧原镇', 4, 1473), +(9441, '红旗街道', 4, 1473), +(9442, '绰源镇', 4, 1473), +(9443, '胜利街道', 4, 1473), +(9444, '哈达阳镇', 4, 1474), +(9445, '塔温敖宝镇', 4, 1474), +(9446, '宝山镇', 4, 1474), +(9447, '尼尔基镇', 4, 1474), +(9448, '巴彦鄂温克民族乡', 4, 1474), +(9449, '杜拉尔鄂温克民族乡', 4, 1474), +(9450, '红彦镇', 4, 1474), +(9451, '腾克镇', 4, 1474), +(9452, '西瓦尔图镇', 4, 1474), +(9453, '阿尔拉镇', 4, 1474), +(9454, '乌鲁布铁镇', 4, 1475); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9455, '古里乡', 4, 1475), +(9456, '大杨树镇', 4, 1475), +(9457, '托扎敏镇', 4, 1475), +(9458, '甘河镇', 4, 1475), +(9459, '诺敏镇', 4, 1475), +(9460, '阿里河镇', 4, 1475), +(9461, '伊敏河镇', 4, 1476), +(9462, '伊敏苏木', 4, 1476), +(9463, '大雁矿区', 4, 1476), +(9464, '巴彦塔拉达斡尔族乡', 4, 1476), +(9465, '巴彦嵯岗苏木', 4, 1476), +(9466, '巴彦托海镇', 4, 1476), +(9467, '红花尔基镇', 4, 1476), +(9468, '辉苏木', 4, 1476), +(9469, '锡尼河准苏木', 4, 1476), +(9470, '锡尼河巴润苏木', 4, 1476), +(9471, '亚东镇', 4, 1477), +(9472, '六合镇', 4, 1477), +(9473, '向阳峪镇', 4, 1477), +(9474, '得力其尔鄂温克族乡', 4, 1477), +(9475, '新发朝鲜族乡', 4, 1477), +(9476, '查巴奇鄂温克族乡', 4, 1477), +(9477, '那吉镇', 4, 1477), +(9478, '霍尔奇镇', 4, 1477), +(9479, '音河达斡尔鄂温克族乡', 4, 1477), +(9480, '东乌珠尔苏木', 4, 1478), +(9481, '完工镇', 4, 1478), +(9482, '宝日希勒镇', 4, 1478), +(9483, '巴彦哈达苏木', 4, 1478), +(9484, '巴彦库仁镇', 4, 1478), +(9485, '特泥河苏木', 4, 1478), +(9486, '西乌珠尔苏木', 4, 1478), +(9487, '鄂温克民族苏木', 4, 1478), +(9488, '三河回族乡', 4, 1479), +(9489, '上库力乡', 4, 1479), +(9490, '室韦俄罗斯族民族乡', 4, 1479), +(9491, '新城街道', 4, 1479), +(9492, '莫尔道嘎镇', 4, 1479), +(9493, '黑山头镇', 4, 1479), +(9494, '东环街道', 4, 1480), +(9495, '丹达木头乡', 4, 1480), +(9496, '乌兰图克镇', 4, 1480), +(9497, '乌兰淖尔乡', 4, 1480), +(9498, '份子地镇', 4, 1480), +(9499, '先锋街道', 4, 1480), +(9500, '八一乡', 4, 1480), +(9501, '八岱乡', 4, 1480), +(9502, '北环街道', 4, 1480), +(9503, '友谊乡', 4, 1480), +(9504, '古城乡', 4, 1480), +(9505, '团结街道', 4, 1480), +(9506, '城关乡', 4, 1480), +(9507, '小召镇', 4, 1480), +(9508, '干召庙镇', 4, 1480), +(9509, '建设乡', 4, 1480), +(9510, '新丰乡', 4, 1480), +(9511, '新华街道', 4, 1480), +(9512, '新华镇', 4, 1480); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9513, '曙光乡', 4, 1480), +(9514, '狼山镇', 4, 1480), +(9515, '白脑包乡', 4, 1480), +(9516, '西环街道', 4, 1480), +(9517, '解放街道', 4, 1480), +(9518, '车站街道', 4, 1480), +(9519, '铁南街道', 4, 1480), +(9520, '降胜镇', 4, 1480), +(9521, '马场地镇', 4, 1480), +(9522, '黄羊木头镇', 4, 1480), +(9523, '乌兰苏木', 4, 1481), +(9524, '乌加河镇', 4, 1481), +(9525, '乌梁素太乡', 4, 1481), +(9526, '同和太种畜场', 4, 1481), +(9527, '呼鲁斯太苏木', 4, 1481), +(9528, '宏丰乡', 4, 1481), +(9529, '川井苏木', 4, 1481), +(9530, '巴盟乌北林场', 4, 1481), +(9531, '巴音哈太苏木', 4, 1481), +(9532, '巴音杭盖苏木', 4, 1481), +(9533, '巴音苏木', 4, 1481), +(9534, '德岭山镇', 4, 1481), +(9535, '新忽热苏木', 4, 1481), +(9536, '桑根达来苏木', 4, 1481), +(9537, '海流图镇', 4, 1481), +(9538, '温更镇', 4, 1481), +(9539, '牧羊海牧场', 4, 1481), +(9540, '石兰计乡', 4, 1481), +(9541, '石哈河镇', 4, 1481), +(9542, '先锋乡', 4, 1482), +(9543, '公庙子镇', 4, 1482), +(9544, '北圪堵乡', 4, 1482), +(9545, '呼和布拉格镇', 4, 1482), +(9546, '大佘太镇', 4, 1482), +(9547, '小佘太乡', 4, 1482), +(9548, '巴彦淖尔市国营中滩农场', 4, 1482), +(9549, '巴彦淖尔市国营乌梁素海渔场', 4, 1482), +(9550, '巴彦淖尔市国营新安农场', 4, 1482), +(9551, '巴彦淖尔市国营苏独仑农场', 4, 1482), +(9552, '巴彦淖尔市国营西山咀农场', 4, 1482), +(9553, '巴音花镇', 4, 1482), +(9554, '新安镇', 4, 1482), +(9555, '明安乡', 4, 1482), +(9556, '朝阳镇', 4, 1482), +(9557, '树林子乡', 4, 1482), +(9558, '沙德格苏木', 4, 1482), +(9559, '苏独仑乡', 4, 1482), +(9560, '西小召镇', 4, 1482), +(9561, '西山咀镇', 4, 1482), +(9562, '长胜乡', 4, 1482), +(9563, '额尔登布拉格苏木', 4, 1482), +(9564, '黑柳子镇', 4, 1482), +(9565, '乌力吉苏木', 4, 1483), +(9566, '乌根高勒苏木', 4, 1483), +(9567, '呼和温都尔镇', 4, 1483), +(9568, '宝音图苏木', 4, 1483); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9569, '巴音前达门苏木', 4, 1483), +(9570, '巴音宝力格镇', 4, 1483), +(9571, '巴音戈壁苏木', 4, 1483), +(9572, '巴音温都尔苏木', 4, 1483), +(9573, '赛乌素镇', 4, 1483), +(9574, '那仁宝力格苏木', 4, 1483), +(9575, '什巴乡', 4, 1484), +(9576, '向阳乡', 4, 1484), +(9577, '和胜乡', 4, 1484), +(9578, '国营建丰农场', 4, 1484), +(9579, '城南乡', 4, 1484), +(9580, '塔尔湖镇', 4, 1484), +(9581, '复兴镇', 4, 1484), +(9582, '天吉太镇', 4, 1484), +(9583, '套海镇', 4, 1484), +(9584, '新公中镇', 4, 1484), +(9585, '海子堰乡', 4, 1484), +(9586, '美林乡', 4, 1484), +(9587, '胜丰镇', 4, 1484), +(9588, '银定图乡', 4, 1484), +(9589, '隆兴昌镇', 4, 1484), +(9590, '三道桥镇', 4, 1485), +(9591, '二道桥镇', 4, 1485), +(9592, '南小召乡', 4, 1485), +(9593, '南渠乡', 4, 1485), +(9594, '召庙镇', 4, 1485), +(9595, '四支乡', 4, 1485), +(9596, '团结镇', 4, 1485), +(9597, '太阳庙乡', 4, 1485), +(9598, '头道桥镇', 4, 1485), +(9599, '巴市太阳庙农场', 4, 1485), +(9600, '查干敖包乡', 4, 1485), +(9601, '沙海乡', 4, 1485), +(9602, '红旗乡', 4, 1485), +(9603, '红星乡', 4, 1485), +(9604, '联合乡', 4, 1485), +(9605, '蛮会镇', 4, 1485), +(9606, '陕坝镇', 4, 1485), +(9607, '乌兰布和农场', 4, 1486), +(9608, '公地乡', 4, 1486), +(9609, '协城镇', 4, 1486), +(9610, '哈腾套海农场', 4, 1486), +(9611, '哈腾套海苏木', 4, 1486), +(9612, '巴彦套海农场', 4, 1486), +(9613, '巴彦高勒镇', 4, 1486), +(9614, '沙漠林业实验中心', 4, 1486), +(9615, '沙金套海苏木', 4, 1486), +(9616, '渡口乡', 4, 1486), +(9617, '纳林套海农场', 4, 1486), +(9618, '补隆淖尔镇', 4, 1486), +(9619, '隆盛合镇', 4, 1486), +(9620, '三义泉镇', 4, 1487), +(9621, '元山子乡', 4, 1487), +(9622, '北城区街道', 4, 1487), +(9623, '官屯堡乡', 4, 1487), +(9624, '工业区街道', 4, 1487), +(9625, '巨宝庄镇', 4, 1487), +(9626, '新城区街道', 4, 1487), +(9627, '新城湾镇', 4, 1487), +(9628, '旧城区街道', 4, 1487); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9629, '永善庄乡', 4, 1487), +(9630, '浑源窑乡', 4, 1487), +(9631, '红砂坝镇', 4, 1487), +(9632, '隆盛庄镇', 4, 1487), +(9633, '马家囗囗乡', 4, 1487), +(9634, '黑土台镇', 4, 1487), +(9635, '黑圪塔洼乡', 4, 1487), +(9636, '二台子镇', 4, 1488), +(9637, '五一乡', 4, 1488), +(9638, '五股泉乡', 4, 1488), +(9639, '台基庙乡', 4, 1488), +(9640, '城关镇', 4, 1488), +(9641, '壕欠镇', 4, 1488), +(9642, '大同夭乡', 4, 1488), +(9643, '大库联乡', 4, 1488), +(9644, '店子镇', 4, 1488), +(9645, '张皋镇', 4, 1488), +(9646, '曹四夭乡', 4, 1488), +(9647, '民族团结乡', 4, 1488), +(9648, '赛乌素镇', 4, 1488), +(9649, '鄂尔栋乡', 4, 1488), +(9650, '三苏木乡', 4, 1489), +(9651, '六苏木乡', 4, 1489), +(9652, '十九号乡', 4, 1489), +(9653, '厂汉营乡', 4, 1489), +(9654, '厢黄地乡', 4, 1489), +(9655, '双古城乡', 4, 1489), +(9656, '后营乡', 4, 1489), +(9657, '城关镇', 4, 1489), +(9658, '天成乡', 4, 1489), +(9659, '崞县夭乡', 4, 1489), +(9660, '曹碾满族乡', 4, 1489), +(9661, '永兴镇', 4, 1489), +(9662, '程家营乡', 4, 1489), +(9663, '麦胡图镇', 4, 1489), +(9664, '七号镇', 4, 1490), +(9665, '公腊胡洞乡', 4, 1490), +(9666, '六十顷乡', 4, 1490), +(9667, '六支箭乡', 4, 1490), +(9668, '德包图乡', 4, 1490), +(9669, '德善乡', 4, 1490), +(9670, '朝阳镇', 4, 1490), +(9671, '白土卜子乡', 4, 1490), +(9672, '白音特拉乡', 4, 1490), +(9673, '长顺镇', 4, 1490), +(9674, '八苏木乡', 4, 1491), +(9675, '六苏木乡', 4, 1491), +(9676, '十八台镇', 4, 1491), +(9677, '卓资山镇', 4, 1491), +(9678, '印堂子乡', 4, 1491), +(9679, '后房子乡', 4, 1491), +(9680, '复兴乡', 4, 1491), +(9681, '大榆树乡', 4, 1491), +(9682, '巴音锡勒镇', 4, 1491), +(9683, '旗下营镇', 4, 1491), +(9684, '梅力盖图乡', 4, 1491), +(9685, '梨花镇', 4, 1491), +(9686, '福生庄乡', 4, 1491), +(9687, '红召乡', 4, 1491), +(9688, '三虎地乡', 4, 1492), +(9689, '三面井乡', 4, 1492), +(9690, '十八顷镇', 4, 1492); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9691, '卯都乡', 4, 1492), +(9692, '商都镇', 4, 1492), +(9693, '大南坊子乡', 4, 1492), +(9694, '大库伦乡', 4, 1492), +(9695, '大拉子乡', 4, 1492), +(9696, '大黑沙土镇', 4, 1492), +(9697, '小海子镇', 4, 1492), +(9698, '屯垦队镇', 4, 1492), +(9699, '格化司台乡', 4, 1492), +(9700, '玻璃忽镜乡', 4, 1492), +(9701, '西井子镇', 4, 1492), +(9702, '西坊子乡', 4, 1492), +(9703, '东八号乡', 4, 1493), +(9704, '乌兰哈达苏木', 4, 1493), +(9705, '乌兰花乡', 4, 1493), +(9706, '乌兰花镇', 4, 1493), +(9707, '供济堂乡', 4, 1493), +(9708, '卫井苏木', 4, 1493), +(9709, '吉尔嘎郎图苏木', 4, 1493), +(9710, '吉生太乡', 4, 1493), +(9711, '大井坡乡', 4, 1493), +(9712, '大黑河乡', 4, 1493), +(9713, '巨巾号乡', 4, 1493), +(9714, '库伦图乡', 4, 1493), +(9715, '忽鸡图乡', 4, 1493), +(9716, '查干敖包苏木', 4, 1493), +(9717, '查干补力格苏木', 4, 1493), +(9718, '江岸苏木', 4, 1493), +(9719, '活福滩乡', 4, 1493), +(9720, '白音敖包苏木', 4, 1493), +(9721, '白音朝克图苏木', 4, 1493), +(9722, '白音花苏木', 4, 1493), +(9723, '红格尔苏木', 4, 1493), +(9724, '脑木更苏木', 4, 1493), +(9725, '西河子乡', 4, 1493), +(9726, '三道沟乡', 4, 1494), +(9727, '义发泉乡', 4, 1494), +(9728, '乌兰苏木', 4, 1494), +(9729, '乌素图镇', 4, 1494), +(9730, '五号乡', 4, 1494), +(9731, '元山子乡', 4, 1494), +(9732, '土城子乡', 4, 1494), +(9733, '大滩乡', 4, 1494), +(9734, '头号乡', 4, 1494), +(9735, '宏盘乡', 4, 1494), +(9736, '小米粮局乡', 4, 1494), +(9737, '巴音乡', 4, 1494), +(9738, '广益隆乡', 4, 1494), +(9739, '库联苏木', 4, 1494), +(9740, '得胜乡', 4, 1494), +(9741, '科布尔镇', 4, 1494), +(9742, '金盆乡', 4, 1494), +(9743, '铁沙盖镇', 4, 1494), +(9744, '黄羊城乡', 4, 1494), +(9745, '三岔口乡', 4, 1495), +(9746, '乌拉哈乌拉乡', 4, 1495), +(9747, '呼和乌素乡', 4, 1495), +(9748, '土贵乌拉乡', 4, 1495), +(9749, '土贵乌拉镇', 4, 1495), +(9750, '巴音塔拉镇', 4, 1495); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9751, '平地泉镇', 4, 1495), +(9752, '煤窑乡', 4, 1495), +(9753, '玫瑰营镇', 4, 1495), +(9754, '赛汉塔拉乡', 4, 1495), +(9755, '高宏店乡', 4, 1495), +(9756, '黄茂营乡', 4, 1495), +(9757, '乌兰哈达苏木', 4, 1496), +(9758, '八号地乡', 4, 1496), +(9759, '哈彦忽洞苏木', 4, 1496), +(9760, '土牧尔台镇', 4, 1496), +(9761, '大六号镇', 4, 1496), +(9762, '当郎忽洞苏木', 4, 1496), +(9763, '白音察干镇', 4, 1496), +(9764, '石夭沟乡', 4, 1496), +(9765, '石门口乡', 4, 1496), +(9766, '红格尔图镇', 4, 1496), +(9767, '贲红镇', 4, 1496), +(9768, '锡勒苏木', 4, 1496), +(9769, '阿贵图乡', 4, 1496), +(9770, '韩勿拉苏木', 4, 1496), +(9771, '工业区街道', 4, 1497), +(9772, '新体路街道', 4, 1497), +(9773, '新区街道', 4, 1497), +(9774, '新华街街道', 4, 1497), +(9775, '桥东街道', 4, 1497), +(9776, '桥西街道', 4, 1497), +(9777, '白海子镇', 4, 1497), +(9778, '福利区街道', 4, 1497), +(9779, '虎山街道', 4, 1497), +(9780, '马莲渠乡', 4, 1497), +(9781, '黄家村乡', 4, 1497), +(9782, '乌兰哈达镇', 4, 1498), +(9783, '五一街道', 4, 1498), +(9784, '兴安街道', 4, 1498), +(9785, '和平街道', 4, 1498), +(9786, '居力很镇', 4, 1498), +(9787, '永联街道', 4, 1498), +(9788, '爱国街道', 4, 1498), +(9789, '胜利街道', 4, 1498), +(9790, '都林街道', 4, 1498), +(9791, '铁西街道', 4, 1498), +(9792, '二龙山乡', 4, 1499), +(9793, '五家户乡', 4, 1499), +(9794, '努文木仁乡', 4, 1499), +(9795, '图牧吉镇', 4, 1499), +(9796, '好力保乡', 4, 1499), +(9797, '宝力根花苏木', 4, 1499), +(9798, '小城子乡', 4, 1499), +(9799, '巴岱乡', 4, 1499), +(9800, '巴彦乌兰苏木', 4, 1499), +(9801, '巴彦扎拉嘎乡', 4, 1499), +(9802, '巴彦高勒镇', 4, 1499), +(9803, '巴达尔胡镇', 4, 1499), +(9804, '新林镇', 4, 1499), +(9805, '绰勒镇', 4, 1499), +(9806, '罕达罕乡', 4, 1499), +(9807, '胡尔勒镇', 4, 1499), +(9808, '阿尔本格勒镇', 4, 1499), +(9809, '阿拉达尔吐苏木', 4, 1499); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9810, '音德尔镇', 4, 1499), +(9811, '代钦塔拉苏木', 4, 1500), +(9812, '吐列毛都镇', 4, 1500), +(9813, '哈日诺尔苏木', 4, 1500), +(9814, '坤都冷苏木', 4, 1500), +(9815, '好腰苏木镇', 4, 1500), +(9816, '巴仁哲里木镇', 4, 1500), +(9817, '巴彦呼舒镇', 4, 1500), +(9818, '巴彦淖尔苏木', 4, 1500), +(9819, '巴彦茫哈苏木', 4, 1500), +(9820, '巴扎拉嘎苏木', 4, 1500), +(9821, '新佳木苏木', 4, 1500), +(9822, '杜尔基镇', 4, 1500), +(9823, '西日嘎苏木', 4, 1500), +(9824, '额木庭高勒苏木', 4, 1500), +(9825, '高力板镇', 4, 1500), +(9826, '乌兰毛都苏木', 4, 1501), +(9827, '俄体镇', 4, 1501), +(9828, '勿布林苏木', 4, 1501), +(9829, '卫东镇', 4, 1501), +(9830, '古迹乡', 4, 1501), +(9831, '哈拉黑镇', 4, 1501), +(9832, '大坝沟镇', 4, 1501), +(9833, '大石寨镇', 4, 1501), +(9834, '太本站镇', 4, 1501), +(9835, '好仁苏木', 4, 1501), +(9836, '察尔森镇', 4, 1501), +(9837, '巴拉格歹乡', 4, 1501), +(9838, '归流河镇', 4, 1501), +(9839, '树木沟乡', 4, 1501), +(9840, '桃合木苏木', 4, 1501), +(9841, '满族屯满族乡', 4, 1501), +(9842, '索伦镇', 4, 1501), +(9843, '葛根庙镇', 4, 1501), +(9844, '阿力得尔苏木', 4, 1501), +(9845, '额尔格图镇', 4, 1501), +(9846, '东杜尔基镇', 4, 1502), +(9847, '九龙乡', 4, 1502), +(9848, '六户镇', 4, 1502), +(9849, '国营农场', 4, 1502), +(9850, '太东乡', 4, 1502), +(9851, '太和乡', 4, 1502), +(9852, '太平乡', 4, 1502), +(9853, '学田乡', 4, 1502), +(9854, '宝石镇', 4, 1502), +(9855, '水泉镇', 4, 1502), +(9856, '永安镇', 4, 1502), +(9857, '溪柳乡', 4, 1502), +(9858, '突泉镇', 4, 1502), +(9859, '五岔沟镇', 4, 1503), +(9860, '伊尔施镇', 4, 1503), +(9861, '天池镇', 4, 1503), +(9862, '新城街道', 4, 1503), +(9863, '明水镇', 4, 1503), +(9864, '林海街道', 4, 1503), +(9865, '温泉街道', 4, 1503), +(9866, '白狼镇', 4, 1503), +(9867, '乌里雅斯太镇', 4, 1504), +(9868, '呼热图淖尔苏木', 4, 1504); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9869, '嘎达布其镇和萨麦苏木', 4, 1504), +(9870, '满都胡宝拉格镇', 4, 1504), +(9871, '道特淖尔镇', 4, 1504), +(9872, '额吉淖尔镇', 4, 1504), +(9873, '东城街道', 4, 1505), +(9874, '乌兰街道', 4, 1505), +(9875, '格日勒敖都苏木', 4, 1505), +(9876, '锡林街道', 4, 1505), +(9877, '多伦淖尔镇', 4, 1506), +(9878, '大北沟镇和大河口乡', 4, 1506), +(9879, '蔡木山乡', 4, 1506), +(9880, '千斤沟镇', 4, 1507), +(9881, '宝昌镇', 4, 1507), +(9882, '幸福乡', 4, 1507), +(9883, '红旗镇', 4, 1507), +(9884, '贡宝拉格苏木', 4, 1507), +(9885, '骆驼山镇', 4, 1507), +(9886, '上都镇', 4, 1508), +(9887, '哈毕日嘎镇和宝绍代苏木', 4, 1508), +(9888, '桑根达来镇', 4, 1508), +(9889, '赛音呼都嘎苏木', 4, 1508), +(9890, '那日图苏木', 4, 1508), +(9891, '乌兰查布苏木', 4, 1509), +(9892, '伊和淖尔苏木', 4, 1509), +(9893, '明安图镇', 4, 1509), +(9894, '星耀镇', 4, 1509), +(9895, '乌日根塔拉镇和额仁淖尔苏木', 4, 1510), +(9896, '朱日和镇', 4, 1510), +(9897, '桑宝拉格苏木', 4, 1510), +(9898, '赛汉塔拉镇', 4, 1510), +(9899, '赛罕乌力吉苏木', 4, 1510), +(9900, '巴彦乌拉苏木', 4, 1511), +(9901, '巴彦淖尔镇', 4, 1511), +(9902, '查干敖包镇', 4, 1511), +(9903, '满都拉图镇', 4, 1511), +(9904, '赛罕高毕苏木', 4, 1511), +(9905, '吉仁高勒镇', 4, 1512), +(9906, '巴彦花镇', 4, 1512), +(9907, '巴拉嘎尔高勒镇', 4, 1512), +(9908, '浩勒图高勒镇和巴彦胡舒苏木', 4, 1512), +(9909, '高日罕镇', 4, 1512), +(9910, '南郊街道', 4, 1513), +(9911, '宝力根苏木', 4, 1513), +(9912, '宝力根街道', 4, 1513), +(9913, '巴彦锡勒街道', 4, 1513), +(9914, '希日塔拉街道', 4, 1513), +(9915, '朝克乌拉苏木', 4, 1513), +(9916, '杭盖街道', 4, 1513), +(9917, '楚古兰街道', 4, 1513), +(9918, '阿尔善宝拉格镇', 4, 1513), +(9919, '额尔敦街道', 4, 1513), +(9920, '巴彦塔拉镇和翁贡乌拉苏木', 4, 1514), +(9921, '新宝拉格镇', 4, 1514); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9922, '伊和高勒苏木', 4, 1515), +(9923, '别力古台镇', 4, 1515), +(9924, '吉尔嘎朗图苏木', 4, 1515), +(9925, '查干淖尔镇', 4, 1515), +(9926, '洪格尔高勒镇', 4, 1515), +(9927, '那仁宝拉格苏木', 4, 1515), +(9928, '阿拉腾敖包镇和孟根布拉格苏木', 4, 1516), +(9929, '阿拉腾朝克苏木', 4, 1516), +(9930, '雅布赖镇', 4, 1516), +(9931, '额肯呼都格镇', 4, 1516), +(9932, '乌力吉苏木', 4, 1517), +(9933, '乌素图镇', 4, 1517), +(9934, '吉兰泰镇', 4, 1517), +(9935, '嘉尔格勒赛汉镇', 4, 1517), +(9936, '宗别立镇', 4, 1517), +(9937, '巴彦木仁苏木', 4, 1517), +(9938, '巴彦浩特镇', 4, 1517), +(9939, '巴彦诺日公苏木', 4, 1517), +(9940, '巴润别立镇', 4, 1517), +(9941, '敖伦布拉格镇', 4, 1517), +(9942, '温都尔勒图镇', 4, 1517), +(9943, '腾格里额里斯苏木', 4, 1517), +(9944, '额尔克哈什哈苏木', 4, 1517), +(9945, '东风镇', 4, 1518), +(9946, '苏泊淖尔苏木', 4, 1518), +(9947, '赛汉桃来苏木', 4, 1518), +(9948, '达来呼布镇', 4, 1518), +(9949, '马鬃山苏木', 4, 1518), +(9950, '东湖街道', 4, 1519), +(9951, '东陵街道', 4, 1519), +(9952, '丰乐街道', 4, 1519), +(9953, '五三街道', 4, 1519), +(9954, '前进街道', 4, 1519), +(9955, '南塔街道', 4, 1519), +(9956, '李相镇', 4, 1519), +(9957, '桃仙街道', 4, 1519), +(9958, '泉园街道', 4, 1519), +(9959, '浑河站东街道', 4, 1519), +(9960, '浑河站西街道', 4, 1519), +(9961, '深井子街道', 4, 1519), +(9962, '满堂满族乡', 4, 1519), +(9963, '王滨沟乡', 4, 1519), +(9964, '白塔街道', 4, 1519), +(9965, '祝家屯镇', 4, 1519), +(9966, '英达街道', 4, 1519), +(9967, '辉山街道', 4, 1519), +(9968, '马关桥街道', 4, 1519), +(9969, '高坎镇', 4, 1519), +(9970, '于洪街道', 4, 1520), +(9971, '光辉乡', 4, 1520), +(9972, '北塔街道', 4, 1520), +(9973, '北陵街道', 4, 1520), +(9974, '大兴街道', 4, 1520), +(9975, '大潘街道', 4, 1520), +(9976, '大青中朝友谊街道', 4, 1520), +(9977, '平罗街道', 4, 1520); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(9978, '彰驿站镇', 4, 1520), +(9979, '杨士街道', 4, 1520), +(9980, '沈辽路街道', 4, 1520), +(9981, '沙岭街道', 4, 1520), +(9982, '翟家街道', 4, 1520), +(9983, '迎宾路街道', 4, 1520), +(9984, '造化街道', 4, 1520), +(9985, '陵东街道', 4, 1520), +(9986, '陵西街道', 4, 1520), +(9987, '马三家街道', 4, 1520), +(9988, '高花镇', 4, 1520), +(9989, '中华路街道', 4, 1521), +(9990, '云集街道', 4, 1521), +(9991, '八经街道', 4, 1521), +(9992, '北市街道', 4, 1521), +(9993, '北站街道', 4, 1521), +(9994, '北道口街道', 4, 1521), +(9995, '十四纬路街道', 4, 1521), +(9996, '南湖街道', 4, 1521), +(9997, '南站街道', 4, 1521), +(9998, '吴淞街道', 4, 1521), +(9999, '园路街道', 4, 1521), +(10000, '新兴街道', 4, 1521), +(10001, '新华街道', 4, 1521), +(10002, '民主街道', 4, 1521), +(10003, '砂山街道', 4, 1521), +(10004, '胜利街道', 4, 1521), +(10005, '西塔街道', 4, 1521), +(10006, '遂川街道', 4, 1521), +(10007, '长白街道', 4, 1521), +(10008, '集贤街道', 4, 1521), +(10009, '马路湾街道', 4, 1521), +(10010, '万泉街道', 4, 1522), +(10011, '东塔街道', 4, 1522), +(10012, '东站街道', 4, 1522), +(10013, '二台子街道', 4, 1522), +(10014, '大北街道', 4, 1522), +(10015, '小东街道', 4, 1522), +(10016, '小北街道', 4, 1522), +(10017, '小津桥街道', 4, 1522), +(10018, '文官街道', 4, 1522), +(10019, '新东街道', 4, 1522), +(10020, '洮昌街道', 4, 1522), +(10021, '珠林街道', 4, 1522), +(10022, '管城街道', 4, 1522), +(10023, '辽沈街道', 4, 1522), +(10024, '长安街道', 4, 1522), +(10025, '东关屯镇', 4, 1523), +(10026, '东升满族蒙古族乡', 4, 1523), +(10027, '两家子乡', 4, 1523), +(10028, '二牛所口镇', 4, 1523), +(10029, '北四家子乡', 4, 1523), +(10030, '小城子镇', 4, 1523), +(10031, '山东屯乡', 4, 1523), +(10032, '康平镇', 4, 1523), +(10033, '张强镇', 4, 1523), +(10034, '方家屯镇', 4, 1523), +(10035, '柳树屯蒙古族满族乡', 4, 1523); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10036, '沙金台蒙古族满族乡', 4, 1523), +(10037, '海洲窝堡乡', 4, 1523), +(10038, '西关屯满族蒙古族乡', 4, 1523), +(10039, '郝官屯镇', 4, 1523), +(10040, '三道岗子乡', 4, 1524), +(10041, '东城街道', 4, 1524), +(10042, '东蛇山子乡', 4, 1524), +(10043, '于家窝堡乡', 4, 1524), +(10044, '公主屯镇', 4, 1524), +(10045, '兴隆堡镇', 4, 1524), +(10046, '兴隆镇', 4, 1524), +(10047, '前当堡镇', 4, 1524), +(10048, '卢屯乡', 4, 1524), +(10049, '周坨子乡', 4, 1524), +(10050, '大柳屯镇', 4, 1524), +(10051, '大民屯镇', 4, 1524), +(10052, '大红旗镇', 4, 1524), +(10053, '姚堡乡', 4, 1524), +(10054, '张屯乡', 4, 1524), +(10055, '新农村乡', 4, 1524), +(10056, '新城街道', 4, 1524), +(10057, '新柳街道', 4, 1524), +(10058, '柳河沟镇', 4, 1524), +(10059, '梁山镇', 4, 1524), +(10060, '法哈牛镇', 4, 1524), +(10061, '红旗乡', 4, 1524), +(10062, '罗家房子乡', 4, 1524), +(10063, '胡台镇', 4, 1524), +(10064, '西城街道', 4, 1524), +(10065, '辽滨街道', 4, 1524), +(10066, '金五台子乡', 4, 1524), +(10067, '陶屯乡', 4, 1524), +(10068, '高台子乡', 4, 1524), +(10069, '兴隆台镇', 4, 1525), +(10070, '尹家乡', 4, 1525), +(10071, '新城子乡', 4, 1525), +(10072, '新城子街道', 4, 1525), +(10073, '清水台街道', 4, 1525), +(10074, '清水台镇', 4, 1525), +(10075, '石佛寺朝鲜族锡伯族乡', 4, 1525), +(10076, '蒲河街道', 4, 1525), +(10077, '虎石台街道', 4, 1525), +(10078, '财落街道', 4, 1525), +(10079, '道义街道', 4, 1525), +(10080, '马刚乡', 4, 1525), +(10081, '黄家锡伯族乡', 4, 1525), +(10082, '万莲街道', 4, 1526), +(10083, '五里河街道', 4, 1526), +(10084, '大南街道', 4, 1526), +(10085, '大西街道', 4, 1526), +(10086, '山东庙街道', 4, 1526), +(10087, '新北站街道', 4, 1526), +(10088, '朱剪炉街道', 4, 1526), +(10089, '滨河街道', 4, 1526), +(10090, '皇城街道', 4, 1526), +(10091, '风雨坛街道', 4, 1526), +(10092, '丁家房镇', 4, 1527), +(10093, '三面船镇', 4, 1527); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10094, '五台子乡', 4, 1527), +(10095, '依牛堡子乡', 4, 1527), +(10096, '冯贝堡乡', 4, 1527), +(10097, '包家屯乡', 4, 1527), +(10098, '十间房乡', 4, 1527), +(10099, '卧牛石乡', 4, 1527), +(10100, '双台子乡', 4, 1527), +(10101, '叶茂台镇', 4, 1527), +(10102, '和平乡', 4, 1527), +(10103, '四家子蒙古族乡', 4, 1527), +(10104, '大孤家子镇', 4, 1527), +(10105, '孟家乡', 4, 1527), +(10106, '慈恩寺乡', 4, 1527), +(10107, '柏家沟镇', 4, 1527), +(10108, '法库镇', 4, 1527), +(10109, '登士堡子镇', 4, 1527), +(10110, '秀水河子镇', 4, 1527), +(10111, '三台子街道', 4, 1528), +(10112, '三洞桥街道', 4, 1528), +(10113, '亚明街道', 4, 1528), +(10114, '克俭街道', 4, 1528), +(10115, '华山街道', 4, 1528), +(10116, '向工街道', 4, 1528), +(10117, '塔湾街道', 4, 1528), +(10118, '太平街道', 4, 1528), +(10119, '寿泉街道', 4, 1528), +(10120, '崇山街道', 4, 1528), +(10121, '怒江街道', 4, 1528), +(10122, '新乐街道', 4, 1528), +(10123, '昆山街道', 4, 1528), +(10124, '明廉街道', 4, 1528), +(10125, '泰山街道', 4, 1528), +(10126, '辽河街道', 4, 1528), +(10127, '长江街道', 4, 1528), +(10128, '陵北街道', 4, 1528), +(10129, '黄河街道', 4, 1528), +(10130, '黑龙江街道', 4, 1528), +(10131, '中兴街道', 4, 1529), +(10132, '临湖街道', 4, 1529), +(10133, '佟沟乡', 4, 1529), +(10134, '八一镇', 4, 1529), +(10135, '十里河镇', 4, 1529), +(10136, '城郊街道', 4, 1529), +(10137, '大沟乡', 4, 1529), +(10138, '姚千户屯镇', 4, 1529), +(10139, '林盛堡镇', 4, 1529), +(10140, '民主街道', 4, 1529), +(10141, '永乐乡', 4, 1529), +(10142, '沙河铺镇', 4, 1529), +(10143, '湖西街道', 4, 1529), +(10144, '王纲堡乡', 4, 1529), +(10145, '白清寨乡', 4, 1529), +(10146, '红菱堡镇', 4, 1529), +(10147, '解放街道', 4, 1529), +(10148, '铁友街道', 4, 1529), +(10149, '陈相屯镇', 4, 1529), +(10150, '于家房镇', 4, 1530), +(10151, '六间房乡', 4, 1530), +(10152, '养士堡乡', 4, 1530); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10153, '冷子堡镇', 4, 1530), +(10154, '刘二堡镇', 4, 1530), +(10155, '四方台镇', 4, 1530), +(10156, '城郊乡', 4, 1530), +(10157, '大黑岗子乡', 4, 1530), +(10158, '新民屯镇', 4, 1530), +(10159, '朱家房镇', 4, 1530), +(10160, '杨士岗镇', 4, 1530), +(10161, '满都户镇', 4, 1530), +(10162, '潘家堡乡', 4, 1530), +(10163, '牛心坨乡', 4, 1530), +(10164, '老大房乡', 4, 1530), +(10165, '老观坨乡', 4, 1530), +(10166, '肖寨门镇', 4, 1530), +(10167, '茨榆坨镇', 4, 1530), +(10168, '辽中镇', 4, 1530), +(10169, '长滩镇', 4, 1530), +(10170, '七路街道', 4, 1531), +(10171, '云峰街道', 4, 1531), +(10172, '保工街道', 4, 1531), +(10173, '兴华街道', 4, 1531), +(10174, '兴工街道', 4, 1531), +(10175, '兴顺街道', 4, 1531), +(10176, '兴齐街道', 4, 1531), +(10177, '凌空街道', 4, 1531), +(10178, '十二路街道', 4, 1531), +(10179, '卫工街道', 4, 1531), +(10180, '启工街道', 4, 1531), +(10181, '工人村街道', 4, 1531), +(10182, '笃工街道', 4, 1531), +(10183, '艳粉街道', 4, 1531), +(10184, '贵和街道', 4, 1531), +(10185, '路官街道', 4, 1531), +(10186, '轻工街道', 4, 1531), +(10187, '重工街道', 4, 1531), +(10188, '霁虹街道', 4, 1531), +(10189, '齐贤街道', 4, 1531), +(10190, '人民路街道', 4, 1532), +(10191, '昆明街道', 4, 1532), +(10192, '桂林街道', 4, 1532), +(10193, '桃源街道', 4, 1532), +(10194, '海军广场街道', 4, 1532), +(10195, '葵英街道', 4, 1532), +(10196, '虎滩街道', 4, 1532), +(10197, '青泥洼桥街道', 4, 1532), +(10198, '仙人洞镇', 4, 1533), +(10199, '光明山镇', 4, 1533), +(10200, '兰店乡', 4, 1533), +(10201, '兴达街道', 4, 1533), +(10202, '吴炉镇', 4, 1533), +(10203, '城关街道', 4, 1533), +(10204, '城山镇', 4, 1533), +(10205, '塔岭镇', 4, 1533), +(10206, '大营镇', 4, 1533), +(10207, '大郑镇', 4, 1533), +(10208, '太平岭满族乡', 4, 1533), +(10209, '徐岭镇', 4, 1533), +(10210, '新华街道', 4, 1533), +(10211, '昌盛街道', 4, 1533), +(10212, '明阳镇', 4, 1533); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10213, '栗子房镇', 4, 1533), +(10214, '桂云花满族乡', 4, 1533), +(10215, '步云山乡', 4, 1533), +(10216, '王家镇', 4, 1533), +(10217, '石城乡', 4, 1533), +(10218, '荷花山镇', 4, 1533), +(10219, '蓉花山镇', 4, 1533), +(10220, '长岭镇', 4, 1533), +(10221, '青堆镇', 4, 1533), +(10222, '鞍子山乡', 4, 1533), +(10223, '黑岛镇', 4, 1533), +(10224, '三涧堡镇', 4, 1534), +(10225, '光荣街道', 4, 1534), +(10226, '北海镇', 4, 1534), +(10227, '双岛湾镇', 4, 1534), +(10228, '市场街道', 4, 1534), +(10229, '得胜街道', 4, 1534), +(10230, '水师营街道', 4, 1534), +(10231, '江西街道', 4, 1534), +(10232, '登峰街道', 4, 1534), +(10233, '铁山街道', 4, 1534), +(10234, '长城镇', 4, 1534), +(10235, '龙头镇', 4, 1534), +(10236, '龙王塘街道', 4, 1534), +(10237, '丰荣街道', 4, 1535), +(10238, '元台镇', 4, 1535), +(10239, '南山街道', 4, 1535), +(10240, '双塔镇', 4, 1535), +(10241, '同益乡', 4, 1535), +(10242, '四平镇', 4, 1535), +(10243, '城子坦镇', 4, 1535), +(10244, '墨盘乡', 4, 1535), +(10245, '大刘家镇', 4, 1535), +(10246, '大谭镇', 4, 1535), +(10247, '太平街道', 4, 1535), +(10248, '夹河庙镇', 4, 1535), +(10249, '安波镇', 4, 1535), +(10250, '星台镇', 4, 1535), +(10251, '杨树房镇', 4, 1535), +(10252, '沙包镇', 4, 1535), +(10253, '瓦窝镇', 4, 1535), +(10254, '皮口镇', 4, 1535), +(10255, '莲山镇', 4, 1535), +(10256, '铁西街道', 4, 1535), +(10257, '中山公园街道', 4, 1536), +(10258, '兴工街道', 4, 1536), +(10259, '南沙河口街道', 4, 1536), +(10260, '星海湾街道', 4, 1536), +(10261, '春柳街道', 4, 1536), +(10262, '李家街道', 4, 1536), +(10263, '白山路街道', 4, 1536), +(10264, '马栏街道', 4, 1536), +(10265, '黑石礁街道', 4, 1536), +(10266, '万家岭镇', 4, 1537), +(10267, '三台满族乡', 4, 1537), +(10268, '东岗镇', 4, 1537), +(10269, '交流岛乡', 4, 1537), +(10270, '仙浴湾镇', 4, 1537), +(10271, '共济街道', 4, 1537), +(10272, '土城乡', 4, 1537), +(10273, '复州城镇', 4, 1537); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10274, '复州湾镇', 4, 1537), +(10275, '太阳街道', 4, 1537), +(10276, '岗店街道', 4, 1537), +(10277, '岭东街道', 4, 1537), +(10278, '得利寺镇', 4, 1537), +(10279, '文兰街道', 4, 1537), +(10280, '新华街道', 4, 1537), +(10281, '李官镇', 4, 1537), +(10282, '李店镇', 4, 1537), +(10283, '杨家满族乡', 4, 1537), +(10284, '松树镇', 4, 1537), +(10285, '永宁镇', 4, 1537), +(10286, '泡崖乡', 4, 1537), +(10287, '炮台镇', 4, 1537), +(10288, '祝华街道', 4, 1537), +(10289, '老虎屯镇', 4, 1537), +(10290, '西杨乡', 4, 1537), +(10291, '许屯镇', 4, 1537), +(10292, '谢屯镇', 4, 1537), +(10293, '赵屯乡', 4, 1537), +(10294, '铁东街道', 4, 1537), +(10295, '长兴岛镇', 4, 1537), +(10296, '阎店乡', 4, 1537), +(10297, '驼山乡', 4, 1537), +(10298, '中华路街道', 4, 1538), +(10299, '兴华街道', 4, 1538), +(10300, '凌水街道', 4, 1538), +(10301, '南关岭街道', 4, 1538), +(10302, '周水子街道', 4, 1538), +(10303, '大连湾街道', 4, 1538), +(10304, '机场前街道', 4, 1538), +(10305, '椒金山街道', 4, 1538), +(10306, '泉水街道', 4, 1538), +(10307, '泡崖街道', 4, 1538), +(10308, '甘井子街道', 4, 1538), +(10309, '红旗街道', 4, 1538), +(10310, '营城子镇', 4, 1538), +(10311, '辛寨子街道', 4, 1538), +(10312, '革镇堡镇', 4, 1538), +(10313, '人民广场街道', 4, 1539), +(10314, '八一路街道', 4, 1539), +(10315, '北京街道', 4, 1539), +(10316, '日新街道', 4, 1539), +(10317, '白云街道', 4, 1539), +(10318, '站北街道', 4, 1539), +(10319, '香炉礁街道', 4, 1539), +(10320, '七顶山满族乡', 4, 1540), +(10321, '三十里堡镇', 4, 1540), +(10322, '中长街道', 4, 1540), +(10323, '二十里堡镇', 4, 1540), +(10324, '亮甲店镇', 4, 1540), +(10325, '先进街道', 4, 1540), +(10326, '光明街道', 4, 1540), +(10327, '华家屯镇', 4, 1540), +(10328, '友谊街道', 4, 1540), +(10329, '向应镇', 4, 1540), +(10330, '大孤山街道', 4, 1540), +(10331, '大李家镇', 4, 1540), +(10332, '大魏家镇', 4, 1540); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10333, '得胜镇', 4, 1540), +(10334, '拥政街道', 4, 1540), +(10335, '新港街道', 4, 1540), +(10336, '杏树屯镇', 4, 1540), +(10337, '海青岛街道', 4, 1540), +(10338, '湾里街道', 4, 1540), +(10339, '满家滩街道', 4, 1540), +(10340, '登沙河镇', 4, 1540), +(10341, '石河镇', 4, 1540), +(10342, '站前街道', 4, 1540), +(10343, '董家沟街道', 4, 1540), +(10344, '马桥子街道', 4, 1540), +(10345, '大长山岛镇', 4, 1541), +(10346, '小长山乡', 4, 1541), +(10347, '广鹿乡', 4, 1541), +(10348, '海洋乡', 4, 1541), +(10349, '獐子镇', 4, 1541), +(10350, '东鞍山镇', 4, 1542), +(10351, '千山镇', 4, 1542), +(10352, '唐家房镇', 4, 1542), +(10353, '大孤山街道', 4, 1542), +(10354, '大孤山镇', 4, 1542), +(10355, '宁远镇', 4, 1542), +(10356, '旧堡街道', 4, 1542), +(10357, '汤岗子镇', 4, 1542), +(10358, '达道湾镇', 4, 1542), +(10359, '齐大山镇', 4, 1542), +(10360, '台安镇', 4, 1543), +(10361, '富家镇', 4, 1543), +(10362, '新台镇', 4, 1543), +(10363, '新开河镇', 4, 1543), +(10364, '桑林镇', 4, 1543), +(10365, '桓洞镇', 4, 1543), +(10366, '西佛镇', 4, 1543), +(10367, '达牛镇', 4, 1543), +(10368, '韭菜台镇', 4, 1543), +(10369, '高力房镇', 4, 1543), +(10370, '黄沙坨镇', 4, 1543), +(10371, '三家子镇', 4, 1544), +(10372, '偏岭镇', 4, 1544), +(10373, '前营子镇', 4, 1544), +(10374, '哈达碑镇', 4, 1544), +(10375, '哨子河乡', 4, 1544), +(10376, '大房身乡', 4, 1544), +(10377, '大营子镇', 4, 1544), +(10378, '岫岩镇', 4, 1544), +(10379, '岭沟乡', 4, 1544), +(10380, '新甸镇', 4, 1544), +(10381, '朝阳乡', 4, 1544), +(10382, '杨家堡镇', 4, 1544), +(10383, '汤沟镇', 4, 1544), +(10384, '洋河镇', 4, 1544), +(10385, '牧牛乡', 4, 1544), +(10386, '石庙子镇', 4, 1544), +(10387, '石灰窑镇', 4, 1544), +(10388, '红旗营子乡', 4, 1544), +(10389, '苏子沟镇', 4, 1544), +(10390, '韭菜沟乡', 4, 1544), +(10391, '黄花甸镇', 4, 1544), +(10392, '龙潭镇', 4, 1544), +(10393, '东四街道', 4, 1545); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10394, '中小镇', 4, 1545), +(10395, '八里镇', 4, 1545), +(10396, '兴海街道', 4, 1545), +(10397, '南台镇', 4, 1545), +(10398, '响堂街道', 4, 1545), +(10399, '大屯镇', 4, 1545), +(10400, '孤山镇', 4, 1545), +(10401, '岔沟镇', 4, 1545), +(10402, '感王镇', 4, 1545), +(10403, '接文镇', 4, 1545), +(10404, '望台镇', 4, 1545), +(10405, '析木镇', 4, 1545), +(10406, '毛祁镇', 4, 1545), +(10407, '海州街道', 4, 1545), +(10408, '温香镇', 4, 1545), +(10409, '牌楼镇', 4, 1545), +(10410, '牛庄镇', 4, 1545), +(10411, '王石镇', 4, 1545), +(10412, '甘泉镇', 4, 1545), +(10413, '耿庄镇', 4, 1545), +(10414, '腾鳌镇', 4, 1545), +(10415, '英落镇', 4, 1545), +(10416, '西四镇', 4, 1545), +(10417, '西柳镇', 4, 1545), +(10418, '马风镇', 4, 1545), +(10419, '高坨镇', 4, 1545), +(10420, '友好街道', 4, 1546), +(10421, '双山街道', 4, 1546), +(10422, '曙光街道', 4, 1546), +(10423, '沙河街道', 4, 1546), +(10424, '沙河镇', 4, 1546), +(10425, '深北街道', 4, 1546), +(10426, '深南街道', 4, 1546), +(10427, '灵山街道', 4, 1546), +(10428, '立山街道', 4, 1546), +(10429, '东长甸街道', 4, 1547), +(10430, '和平街道', 4, 1547), +(10431, '园林街道', 4, 1547), +(10432, '对炉街道', 4, 1547), +(10433, '山南街道', 4, 1547), +(10434, '常青街道', 4, 1547), +(10435, '新兴街道', 4, 1547), +(10436, '汪峪街道', 4, 1547), +(10437, '湖南街道', 4, 1547), +(10438, '站前街道', 4, 1547), +(10439, '胜利街道', 4, 1547), +(10440, '解放街道', 4, 1547), +(10441, '钢城街道', 4, 1547), +(10442, '长甸街道', 4, 1547), +(10443, '八家子街道', 4, 1548), +(10444, '共和街道', 4, 1548), +(10445, '兴盛街道', 4, 1548), +(10446, '北陶官街道', 4, 1548), +(10447, '南华街道', 4, 1548), +(10448, '启明街道', 4, 1548), +(10449, '大陆街道', 4, 1548), +(10450, '新陶街道', 4, 1548), +(10451, '永乐街道', 4, 1548), +(10452, '永发街道', 4, 1548), +(10453, '繁荣街道', 4, 1548), +(10454, '万新街道', 4, 1549), +(10455, '东洲街道', 4, 1549); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10456, '刘山街道', 4, 1549), +(10457, '千金乡', 4, 1549), +(10458, '南花园街道', 4, 1549), +(10459, '平山街道', 4, 1549), +(10460, '张甸街道', 4, 1549), +(10461, '搭连街道', 4, 1549), +(10462, '新屯街道', 4, 1549), +(10463, '碾盘乡', 4, 1549), +(10464, '章党街道', 4, 1549), +(10465, '老虎台街道', 4, 1549), +(10466, '龙凤街道', 4, 1549), +(10467, '上马乡', 4, 1550), +(10468, '兰山乡', 4, 1550), +(10469, '后安镇', 4, 1550), +(10470, '哈达镇', 4, 1550), +(10471, '峡河乡', 4, 1550), +(10472, '拉古满族乡', 4, 1550), +(10473, '救兵乡', 4, 1550), +(10474, '汤图满族乡', 4, 1550), +(10475, '海浪乡', 4, 1550), +(10476, '石文镇', 4, 1550), +(10477, '章党镇', 4, 1550), +(10478, '马圈子乡', 4, 1550), +(10479, '上夹河镇', 4, 1551), +(10480, '下夹河乡', 4, 1551), +(10481, '北四平乡', 4, 1551), +(10482, '南杂木镇', 4, 1551), +(10483, '响水河子乡', 4, 1551), +(10484, '大四平镇', 4, 1551), +(10485, '平顶山镇', 4, 1551), +(10486, '新宾镇', 4, 1551), +(10487, '旺清门镇', 4, 1551), +(10488, '木奇镇', 4, 1551), +(10489, '榆树乡', 4, 1551), +(10490, '永陵镇', 4, 1551), +(10491, '红升乡', 4, 1551), +(10492, '红庙子乡', 4, 1551), +(10493, '苇子峪镇', 4, 1551), +(10494, '东公园街道', 4, 1552), +(10495, '新抚街道', 4, 1552), +(10496, '榆林街道', 4, 1552), +(10497, '永安台街道', 4, 1552), +(10498, '福民街道', 4, 1552), +(10499, '站前街道', 4, 1552), +(10500, '五老屯街道', 4, 1553), +(10501, '光明街道', 4, 1553), +(10502, '古城子街道', 4, 1553), +(10503, '和平街道', 4, 1553), +(10504, '塔峪镇', 4, 1553), +(10505, '工农街道', 4, 1553), +(10506, '建设街道', 4, 1553), +(10507, '新民街道', 4, 1553), +(10508, '朴屯街道', 4, 1553), +(10509, '李石街道', 4, 1553), +(10510, '演武街道', 4, 1553), +(10511, '田屯街道', 4, 1553), +(10512, '北三家乡', 4, 1554), +(10513, '南口前镇', 4, 1554), +(10514, '南山城镇', 4, 1554), +(10515, '土口子乡', 4, 1554); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10516, '夏家堡镇', 4, 1554), +(10517, '大孤家镇', 4, 1554), +(10518, '大苏河乡', 4, 1554), +(10519, '敖家堡乡', 4, 1554), +(10520, '枸乃甸乡', 4, 1554), +(10521, '清原镇', 4, 1554), +(10522, '湾甸子镇', 4, 1554), +(10523, '红透山镇', 4, 1554), +(10524, '英额门镇', 4, 1554), +(10525, '草市镇', 4, 1554), +(10526, '会元乡', 4, 1555), +(10527, '前甸镇', 4, 1555), +(10528, '将军堡街道', 4, 1555), +(10529, '抚顺城街道', 4, 1555), +(10530, '新华街道', 4, 1555), +(10531, '河东街道', 4, 1555), +(10532, '河北乡', 4, 1555), +(10533, '葛布街道', 4, 1555), +(10534, '长春街道', 4, 1555), +(10535, '下马塘镇', 4, 1556), +(10536, '南芬街道', 4, 1556), +(10537, '思山岭满族乡', 4, 1556), +(10538, '郭家街道', 4, 1556), +(10539, '铁山街道', 4, 1556), +(10540, '东明街道', 4, 1557), +(10541, '北台街道', 4, 1557), +(10542, '千金街道', 4, 1557), +(10543, '南地街道', 4, 1557), +(10544, '崔东街道', 4, 1557), +(10545, '工人街道', 4, 1557), +(10546, '平山街道', 4, 1557), +(10547, '桥头镇', 4, 1557), +(10548, '站前街道', 4, 1557), +(10549, '东兴街道', 4, 1558), +(10550, '北地街道', 4, 1558), +(10551, '卧龙街道', 4, 1558), +(10552, '新明街道', 4, 1558), +(10553, '明山街道', 4, 1558), +(10554, '牛心台街道', 4, 1558), +(10555, '金山街道', 4, 1558), +(10556, '高台子镇', 4, 1558), +(10557, '高峪街道', 4, 1558), +(10558, '东营坊乡', 4, 1559), +(10559, '南甸子镇', 4, 1559), +(10560, '小市镇', 4, 1559), +(10561, '清河城镇', 4, 1559), +(10562, '田师付镇', 4, 1559), +(10563, '碱厂镇', 4, 1559), +(10564, '草河口镇', 4, 1559), +(10565, '草河城镇', 4, 1559), +(10566, '草河掌镇', 4, 1559), +(10567, '连山关镇', 4, 1559), +(10568, '高官镇', 4, 1559), +(10569, '二棚甸子镇', 4, 1560), +(10570, '五里甸子镇', 4, 1560), +(10571, '八里甸子镇', 4, 1560), +(10572, '北甸子乡', 4, 1560), +(10573, '华来镇', 4, 1560), +(10574, '古城镇', 4, 1560), +(10575, '向阳乡', 4, 1560); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10576, '四平乡', 4, 1560), +(10577, '普乐堡镇', 4, 1560), +(10578, '桓仁镇', 4, 1560), +(10579, '沙尖子镇', 4, 1560), +(10580, '雅河朝鲜族乡', 4, 1560), +(10581, '黑沟乡', 4, 1560), +(10582, '东风街道', 4, 1561), +(10583, '张其寨乡', 4, 1561), +(10584, '彩北街道', 4, 1561), +(10585, '彩屯街道', 4, 1561), +(10586, '歪头山镇', 4, 1561), +(10587, '河东街道', 4, 1561), +(10588, '河西街道', 4, 1561), +(10589, '火连寨镇', 4, 1561), +(10590, '石桥子镇', 4, 1561), +(10591, '竖井街道', 4, 1561), +(10592, '前阳镇', 4, 1562), +(10593, '北井子镇', 4, 1562), +(10594, '十字街镇', 4, 1562), +(10595, '合隆满族乡', 4, 1562), +(10596, '大东街道', 4, 1562), +(10597, '孤山镇', 4, 1562), +(10598, '小甸子镇', 4, 1562), +(10599, '新兴街道', 4, 1562), +(10600, '新农镇', 4, 1562), +(10601, '新城街道', 4, 1562), +(10602, '椅圈镇', 4, 1562), +(10603, '汤池镇', 4, 1562), +(10604, '菩萨庙镇', 4, 1562), +(10605, '长安镇', 4, 1562), +(10606, '长山镇', 4, 1562), +(10607, '马家店镇', 4, 1562), +(10608, '黄土坎镇', 4, 1562), +(10609, '黑沟镇', 4, 1562), +(10610, '龙王庙镇', 4, 1562), +(10611, '七道街道', 4, 1563), +(10612, '九道街道', 4, 1563), +(10613, '八道街道', 4, 1563), +(10614, '六道口街道', 4, 1563), +(10615, '兴东街道', 4, 1563), +(10616, '广济街道', 4, 1563), +(10617, '蛤蟆塘镇', 4, 1563), +(10618, '东汤镇', 4, 1564), +(10619, '凤凰城街道', 4, 1564), +(10620, '凤山街道', 4, 1564), +(10621, '刘家河镇', 4, 1564), +(10622, '四门子镇', 4, 1564), +(10623, '大兴镇', 4, 1564), +(10624, '大堡镇', 4, 1564), +(10625, '宝山镇', 4, 1564), +(10626, '弟兄山镇', 4, 1564), +(10627, '沙里寨镇', 4, 1564), +(10628, '爱阳镇', 4, 1564), +(10629, '白旗镇', 4, 1564), +(10630, '石城镇', 4, 1564), +(10631, '红旗镇', 4, 1564), +(10632, '草河街道', 4, 1564), +(10633, '蓝旗镇', 4, 1564), +(10634, '赛马镇', 4, 1564), +(10635, '边门镇', 4, 1564), +(10636, '通远堡镇', 4, 1564); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10637, '青城子镇', 4, 1564), +(10638, '鸡冠山镇', 4, 1564), +(10639, '下露河朝鲜族乡', 4, 1565), +(10640, '八河川镇', 4, 1565), +(10641, '双山子镇', 4, 1565), +(10642, '古楼子乡', 4, 1565), +(10643, '大川头镇', 4, 1565), +(10644, '大西岔镇', 4, 1565), +(10645, '太平哨镇', 4, 1565), +(10646, '宽甸镇', 4, 1565), +(10647, '振江镇', 4, 1565), +(10648, '杨木川镇', 4, 1565), +(10649, '步达远镇', 4, 1565), +(10650, '毛甸子镇', 4, 1565), +(10651, '永甸镇', 4, 1565), +(10652, '灌水镇', 4, 1565), +(10653, '牛毛坞镇', 4, 1565), +(10654, '石湖沟乡', 4, 1565), +(10655, '硼海镇', 4, 1565), +(10656, '红石镇', 4, 1565), +(10657, '虎山镇', 4, 1565), +(10658, '长甸镇', 4, 1565), +(10659, '青山沟镇', 4, 1565), +(10660, '青椅山镇', 4, 1565), +(10661, '临江街道', 4, 1566), +(10662, '六道沟街道', 4, 1566), +(10663, '头道桥街道', 4, 1566), +(10664, '安民镇', 4, 1566), +(10665, '帽盔山街道', 4, 1566), +(10666, '浪头镇', 4, 1566), +(10667, '站前街道', 4, 1566), +(10668, '纤维街道', 4, 1566), +(10669, '九连城镇', 4, 1567), +(10670, '五龙背镇', 4, 1567), +(10671, '同兴镇', 4, 1567), +(10672, '太平湾街道', 4, 1567), +(10673, '楼房镇', 4, 1567), +(10674, '汤山城镇', 4, 1567), +(10675, '珍珠街道', 4, 1567), +(10676, '金矿街道', 4, 1567), +(10677, '鸭绿江街道', 4, 1567), +(10678, '七里河镇', 4, 1568), +(10679, '义州镇', 4, 1568), +(10680, '九道岭镇', 4, 1568), +(10681, '刘龙台镇', 4, 1568), +(10682, '前杨乡', 4, 1568), +(10683, '地藏寺满族乡', 4, 1568), +(10684, '城关满族乡', 4, 1568), +(10685, '大定堡满族乡', 4, 1568), +(10686, '大榆树堡镇', 4, 1568), +(10687, '头台满族乡', 4, 1568), +(10688, '头道河满族乡', 4, 1568), +(10689, '张家堡乡', 4, 1568), +(10690, '瓦子峪镇', 4, 1568), +(10691, '留龙沟满族乡', 4, 1568), +(10692, '白庙子乡', 4, 1568), +(10693, '稍户营子镇', 4, 1568), +(10694, '聚粮屯满族乡', 4, 1568), +(10695, '高台子镇', 4, 1568); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10696, '凌安街道', 4, 1569), +(10697, '康宁街道', 4, 1569), +(10698, '榴花街道', 4, 1569), +(10699, '正大街道', 4, 1569), +(10700, '百股街道', 4, 1569), +(10701, '石桥街道', 4, 1569), +(10702, '菊园街道', 4, 1569), +(10703, '铁新街道', 4, 1569), +(10704, '锦铁街道', 4, 1569), +(10705, '马家街道', 4, 1569), +(10706, '龙江街道', 4, 1569), +(10707, '三台子镇', 4, 1570), +(10708, '余积镇', 4, 1570), +(10709, '双羊镇', 4, 1570), +(10710, '右卫镇', 4, 1570), +(10711, '大业乡', 4, 1570), +(10712, '大凌河街道', 4, 1570), +(10713, '娘娘宫镇', 4, 1570), +(10714, '安屯乡', 4, 1570), +(10715, '建业乡', 4, 1570), +(10716, '新庄子镇', 4, 1570), +(10717, '松山镇', 4, 1570), +(10718, '板石沟乡', 4, 1570), +(10719, '沈家台镇', 4, 1570), +(10720, '温滴楼满族乡', 4, 1570), +(10721, '班吉塔镇', 4, 1570), +(10722, '白台子乡', 4, 1570), +(10723, '石山镇', 4, 1570), +(10724, '翠岩镇', 4, 1570), +(10725, '西八千乡', 4, 1570), +(10726, '谢屯乡', 4, 1570), +(10727, '金城街道', 4, 1570), +(10728, '闫家镇', 4, 1570), +(10729, '中安镇', 4, 1571), +(10730, '北镇街道', 4, 1571), +(10731, '吴家乡', 4, 1571), +(10732, '大屯乡', 4, 1571), +(10733, '大市镇', 4, 1571), +(10734, '富屯乡', 4, 1571), +(10735, '常兴店镇', 4, 1571), +(10736, '广宁街道', 4, 1571), +(10737, '廖屯镇', 4, 1571), +(10738, '柳家乡', 4, 1571), +(10739, '正安镇', 4, 1571), +(10740, '沟帮子镇', 4, 1571), +(10741, '罗罗堡镇', 4, 1571), +(10742, '观音阁街道', 4, 1571), +(10743, '赵屯镇', 4, 1571), +(10744, '辽城乡', 4, 1571), +(10745, '闾阳镇', 4, 1571), +(10746, '青堆子镇', 4, 1571), +(10747, '高山子镇', 4, 1571), +(10748, '鲍家乡', 4, 1571), +(10749, '保安街道', 4, 1572), +(10750, '北街街道', 4, 1572), +(10751, '南街街道', 4, 1572), +(10752, '士英街道', 4, 1572), +(10753, '天安街道', 4, 1572), +(10754, '敬业街道', 4, 1572), +(10755, '石油街道', 4, 1572), +(10756, '站前街道', 4, 1572); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10757, '饶阳街道', 4, 1572), +(10758, '兴隆街道', 4, 1573), +(10759, '凌南街道', 4, 1573), +(10760, '凌西街道', 4, 1573), +(10761, '大薛街道', 4, 1573), +(10762, '天桥街道', 4, 1573), +(10763, '太和街道', 4, 1573), +(10764, '女儿河乡', 4, 1573), +(10765, '新民乡', 4, 1573), +(10766, '杏山街道', 4, 1573), +(10767, '汤河街道', 4, 1573), +(10768, '王家街道', 4, 1573), +(10769, '营盘乡', 4, 1573), +(10770, '钟屯乡', 4, 1573), +(10771, '八道壕镇', 4, 1574), +(10772, '励家镇', 4, 1574), +(10773, '半拉门镇', 4, 1574), +(10774, '四家子镇', 4, 1574), +(10775, '大兴乡', 4, 1574), +(10776, '大虎山镇', 4, 1574), +(10777, '太和镇', 4, 1574), +(10778, '姜屯镇', 4, 1574), +(10779, '小东镇', 4, 1574), +(10780, '常兴镇', 4, 1574), +(10781, '新兴镇', 4, 1574), +(10782, '新立屯镇', 4, 1574), +(10783, '无梁殿镇', 4, 1574), +(10784, '段家乡', 4, 1574), +(10785, '白厂门镇', 4, 1574), +(10786, '绕阳河镇', 4, 1574), +(10787, '胡家镇', 4, 1574), +(10788, '芳山镇', 4, 1574), +(10789, '英城子乡', 4, 1574), +(10790, '薛屯乡', 4, 1574), +(10791, '镇安满族乡', 4, 1574), +(10792, '黑山镇', 4, 1574), +(10793, '南楼街道', 4, 1575), +(10794, '周家镇', 4, 1575), +(10795, '官屯镇', 4, 1575), +(10796, '建一镇', 4, 1575), +(10797, '旗口镇', 4, 1575), +(10798, '水源镇', 4, 1575), +(10799, '永安镇', 4, 1575), +(10800, '汤池镇', 4, 1575), +(10801, '沟沿镇', 4, 1575), +(10802, '溥洛铺镇', 4, 1575), +(10803, '石佛镇', 4, 1575), +(10804, '石桥街道', 4, 1575), +(10805, '虎庄镇', 4, 1575), +(10806, '金桥街道', 4, 1575), +(10807, '钢都街道', 4, 1575), +(10808, '青花街道', 4, 1575), +(10809, '高坎镇', 4, 1575), +(10810, '黄土岭镇', 4, 1575), +(10811, '万福镇', 4, 1576), +(10812, '东城街道', 4, 1576), +(10813, '九垄地镇', 4, 1576), +(10814, '九寨镇', 4, 1576), +(10815, '二台乡', 4, 1576), +(10816, '什字街镇', 4, 1576), +(10817, '卧龙泉镇', 4, 1576), +(10818, '双台镇', 4, 1576); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10819, '古楼街道', 4, 1576), +(10820, '团山街道', 4, 1576), +(10821, '团甸镇', 4, 1576), +(10822, '太阳升街道', 4, 1576), +(10823, '小石棚乡', 4, 1576), +(10824, '归州镇', 4, 1576), +(10825, '徐屯镇', 4, 1576), +(10826, '暖泉镇', 4, 1576), +(10827, '杨运镇', 4, 1576), +(10828, '果园乡', 4, 1576), +(10829, '梁屯镇', 4, 1576), +(10830, '榜式堡镇', 4, 1576), +(10831, '沙岗镇', 4, 1576), +(10832, '矿洞沟镇', 4, 1576), +(10833, '西城街道', 4, 1576), +(10834, '西海街道', 4, 1576), +(10835, '陈屯镇', 4, 1576), +(10836, '青石岭镇', 4, 1576), +(10837, '高屯镇', 4, 1576), +(10838, '东风街道', 4, 1577), +(10839, '八田地街道', 4, 1577), +(10840, '建丰街道', 4, 1577), +(10841, '建设街道', 4, 1577), +(10842, '新兴街道', 4, 1577), +(10843, '新建街道', 4, 1577), +(10844, '跃进街道', 4, 1577), +(10845, '二道镇', 4, 1578), +(10846, '城东街道', 4, 1578), +(10847, '柳树镇', 4, 1578), +(10848, '老边街道', 4, 1578), +(10849, '路南镇', 4, 1578), +(10850, '边城镇', 4, 1578), +(10851, '五台子街道', 4, 1579), +(10852, '得胜街道', 4, 1579), +(10853, '河北街道', 4, 1579), +(10854, '清华街道', 4, 1579), +(10855, '渔市街道', 4, 1579), +(10856, '胜利街道', 4, 1579), +(10857, '西市场街道', 4, 1579), +(10858, '望海街道', 4, 1580), +(10859, '海东街道', 4, 1580), +(10860, '海星街道', 4, 1580), +(10861, '熊岳镇', 4, 1580), +(10862, '红旗镇', 4, 1580), +(10863, '红海街道', 4, 1580), +(10864, '芦屯镇', 4, 1580), +(10865, '城南街道', 4, 1581), +(10866, '孙家湾街道', 4, 1581), +(10867, '水泉镇', 4, 1581), +(10868, '煤海街道', 4, 1581), +(10869, '红树街道', 4, 1581), +(10870, '高德街道', 4, 1581), +(10871, '东六家子镇', 4, 1582), +(10872, '两家子乡', 4, 1582), +(10873, '丰田乡', 4, 1582), +(10874, '二道河子蒙古族乡', 4, 1582), +(10875, '五峰镇', 4, 1582), +(10876, '兴隆堡乡', 4, 1582), +(10877, '兴隆山乡', 4, 1582), +(10878, '冯家镇', 4, 1582), +(10879, '前福兴地乡', 4, 1582); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10880, '双庙乡', 4, 1582), +(10881, '后新秋镇', 4, 1582), +(10882, '哈尔套镇', 4, 1582), +(10883, '四合城乡', 4, 1582), +(10884, '四堡子乡', 4, 1582), +(10885, '大冷蒙古族乡', 4, 1582), +(10886, '大四家子乡', 4, 1582), +(10887, '大德乡', 4, 1582), +(10888, '平安乡', 4, 1582), +(10889, '彰武镇', 4, 1582), +(10890, '满堂红乡', 4, 1582), +(10891, '章古台镇', 4, 1582), +(10892, '苇子沟蒙古族乡', 4, 1582), +(10893, '西六家子蒙古族满族乡', 4, 1582), +(10894, '阿尔乡镇', 4, 1582), +(10895, '中部街道', 4, 1583), +(10896, '北部街道', 4, 1583), +(10897, '南部街道', 4, 1583), +(10898, '街基街道', 4, 1583), +(10899, '长营子镇', 4, 1583), +(10900, '东梁街道', 4, 1584), +(10901, '五龙街道', 4, 1584), +(10902, '和平街道', 4, 1584), +(10903, '工人村街道', 4, 1584), +(10904, '平安西部街道', 4, 1584), +(10905, '新兴街道', 4, 1584), +(10906, '河北街道', 4, 1584), +(10907, '站前街道', 4, 1584), +(10908, '西山街道', 4, 1584), +(10909, '西街道', 4, 1584), +(10910, '韩家店镇', 4, 1584), +(10911, '乌龙坝镇', 4, 1585), +(10912, '六台街道', 4, 1585), +(10913, '新北街道', 4, 1585), +(10914, '河西镇', 4, 1585), +(10915, '清河街道', 4, 1585), +(10916, '艾友街道', 4, 1585), +(10917, '东苑街道', 4, 1586), +(10918, '中苑街道', 4, 1586), +(10919, '北苑街道', 4, 1586), +(10920, '华东街道', 4, 1586), +(10921, '四合镇', 4, 1586), +(10922, '学苑街道', 4, 1586), +(10923, '西苑街道', 4, 1586), +(10924, '七家子乡', 4, 1587), +(10925, '东梁镇', 4, 1587), +(10926, '于寺镇', 4, 1587), +(10927, '伊玛图镇', 4, 1587), +(10928, '佛寺镇', 4, 1587), +(10929, '八家子乡', 4, 1587), +(10930, '务欢池镇', 4, 1587), +(10931, '化石戈乡', 4, 1587), +(10932, '十家子镇', 4, 1587), +(10933, '卧凤沟乡', 4, 1587), +(10934, '哈达户稍乡', 4, 1587), +(10935, '国华乡', 4, 1587), +(10936, '塔营子乡', 4, 1587), +(10937, '大五家子镇', 4, 1587), +(10938, '大固本镇', 4, 1587); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(10939, '大巴镇', 4, 1587), +(10940, '大板镇', 4, 1587), +(10941, '太平乡', 4, 1587), +(10942, '富荣镇', 4, 1587), +(10943, '平安地镇', 4, 1587), +(10944, '建设镇', 4, 1587), +(10945, '扎兰营子乡', 4, 1587), +(10946, '招束沟乡', 4, 1587), +(10947, '新民镇', 4, 1587), +(10948, '旧庙镇', 4, 1587), +(10949, '沙拉镇', 4, 1587), +(10950, '泡子镇', 4, 1587), +(10951, '王府镇', 4, 1587), +(10952, '福兴地镇', 4, 1587), +(10953, '紫都台乡', 4, 1587), +(10954, '红帽子乡', 4, 1587), +(10955, '老河土乡', 4, 1587), +(10956, '苍土乡', 4, 1587), +(10957, '蜘蛛山乡', 4, 1587), +(10958, '镇', 4, 1587), +(10959, '东京陵乡', 4, 1588), +(10960, '东宁卫乡', 4, 1588), +(10961, '新华街道', 4, 1588), +(10962, '望水台街道', 4, 1588), +(10963, '祁家镇', 4, 1588), +(10964, '光华街道', 4, 1589), +(10965, '工农街道', 4, 1589), +(10966, '新村街道', 4, 1589), +(10967, '曙光镇', 4, 1589), +(10968, '长征街道', 4, 1589), +(10969, '团山子街道', 4, 1590), +(10970, '安平乡', 4, 1590), +(10971, '安平街道', 4, 1590), +(10972, '汤河镇', 4, 1590), +(10973, '苏家街道', 4, 1590), +(10974, '东兴街道', 4, 1591), +(10975, '南门街道', 4, 1591), +(10976, '庆阳街道', 4, 1591), +(10977, '文圣街道', 4, 1591), +(10978, '武圣街道', 4, 1591), +(10979, '襄平街道', 4, 1591), +(10980, '万宝桥街道', 4, 1592), +(10981, '五星镇', 4, 1592), +(10982, '佟二堡镇', 4, 1592), +(10983, '古城街道', 4, 1592), +(10984, '大河南镇', 4, 1592), +(10985, '张台子镇', 4, 1592), +(10986, '柳条寨镇', 4, 1592), +(10987, '柳河子镇', 4, 1592), +(10988, '沈旦堡镇', 4, 1592), +(10989, '烟台街道', 4, 1592), +(10990, '王家镇', 4, 1592), +(10991, '罗大台镇', 4, 1592), +(10992, '西大窑镇', 4, 1592), +(10993, '西马峰镇', 4, 1592), +(10994, '铧子镇', 4, 1592), +(10995, '鸡冠山乡', 4, 1592), +(10996, '卫国路街道', 4, 1593), +(10997, '星火街道', 4, 1593), +(10998, '站前街道', 4, 1593), +(10999, '胜利街道', 4, 1593); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11000, '跃进街道', 4, 1593), +(11001, '铁西街道', 4, 1593), +(11002, '下达河乡', 4, 1594), +(11003, '八会镇', 4, 1594), +(11004, '兰家镇', 4, 1594), +(11005, '刘二堡镇', 4, 1594), +(11006, '吉洞峪满族乡', 4, 1594), +(11007, '唐马寨镇', 4, 1594), +(11008, '寒岭镇', 4, 1594), +(11009, '小北河镇', 4, 1594), +(11010, '小屯镇', 4, 1594), +(11011, '柳壕镇', 4, 1594), +(11012, '沙岭镇', 4, 1594), +(11013, '河栏镇', 4, 1594), +(11014, '甜水满族乡', 4, 1594), +(11015, '穆家镇', 4, 1594), +(11016, '隆昌镇', 4, 1594), +(11017, '首山镇', 4, 1594), +(11018, '黄泥洼镇', 4, 1594), +(11019, '于楼街道', 4, 1595), +(11020, '兴海街道', 4, 1595), +(11021, '兴盛街道', 4, 1595), +(11022, '兴隆街道', 4, 1595), +(11023, '创新街道', 4, 1595), +(11024, '友谊街道', 4, 1595), +(11025, '平安街道', 4, 1595), +(11026, '振兴街道', 4, 1595), +(11027, '新工街道', 4, 1595), +(11028, '新生街道', 4, 1595), +(11029, '曙光街道', 4, 1595), +(11030, '欢喜街道', 4, 1595), +(11031, '沈采街道', 4, 1595), +(11032, '渤海街道', 4, 1595), +(11033, '红村街道', 4, 1595), +(11034, '茨采街道', 4, 1595), +(11035, '锦采街道', 4, 1595), +(11036, '高升街道', 4, 1595), +(11037, '东风街道', 4, 1596), +(11038, '化工街道', 4, 1596), +(11039, '双盛街道', 4, 1596), +(11040, '建设街道', 4, 1596), +(11041, '石油街道', 4, 1596), +(11042, '红旗街道', 4, 1596), +(11043, '胜利街道', 4, 1596), +(11044, '辽河街道', 4, 1596), +(11045, '铁东街道', 4, 1596), +(11046, '东风镇', 4, 1597), +(11047, '二界沟镇', 4, 1597), +(11048, '唐家乡', 4, 1597), +(11049, '大洼镇', 4, 1597), +(11050, '平安乡', 4, 1597), +(11051, '新兴镇', 4, 1597), +(11052, '新开镇', 4, 1597), +(11053, '新立镇', 4, 1597), +(11054, '清水镇', 4, 1597), +(11055, '王家乡', 4, 1597), +(11056, '田家镇', 4, 1597), +(11057, '田庄台镇', 4, 1597), +(11058, '荣兴朝鲜族乡', 4, 1597), +(11059, '西安镇', 4, 1597), +(11060, '赵圈河乡', 4, 1597); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11061, '东郭镇', 4, 1598), +(11062, '古城子镇', 4, 1598), +(11063, '吴家乡', 4, 1598), +(11064, '坝墙子镇', 4, 1598), +(11065, '大荒乡', 4, 1598), +(11066, '太平镇', 4, 1598), +(11067, '沙岭镇', 4, 1598), +(11068, '甜水乡', 4, 1598), +(11069, '石新镇', 4, 1598), +(11070, '羊圈子镇', 4, 1598), +(11071, '胡家镇', 4, 1598), +(11072, '陆家乡', 4, 1598), +(11073, '陈家乡', 4, 1598), +(11074, '高升镇', 4, 1598), +(11075, '上肥地满族乡', 4, 1599), +(11076, '下肥地满族乡', 4, 1599), +(11077, '业民镇', 4, 1599), +(11078, '中固镇', 4, 1599), +(11079, '八宝镇', 4, 1599), +(11080, '八棵树镇', 4, 1599), +(11081, '兴开街道', 4, 1599), +(11082, '城东乡', 4, 1599), +(11083, '威远堡镇', 4, 1599), +(11084, '庆云堡镇', 4, 1599), +(11085, '新城街道', 4, 1599), +(11086, '李家台乡', 4, 1599), +(11087, '松山堡乡', 4, 1599), +(11088, '林丰满族乡', 4, 1599), +(11089, '老城街道', 4, 1599), +(11090, '莲花镇', 4, 1599), +(11091, '金沟子镇', 4, 1599), +(11092, '靠山镇', 4, 1599), +(11093, '马家寨乡', 4, 1599), +(11094, '黄旗寨满族乡', 4, 1599), +(11095, '七家子镇', 4, 1600), +(11096, '三江口镇', 4, 1600), +(11097, '下二台乡', 4, 1600), +(11098, '东嘎镇', 4, 1600), +(11099, '亮中桥镇', 4, 1600), +(11100, '傅家镇', 4, 1600), +(11101, '八面城镇', 4, 1600), +(11102, '前双井镇', 4, 1600), +(11103, '十八家子乡', 4, 1600), +(11104, '双庙子镇', 4, 1600), +(11105, '古榆树镇', 4, 1600), +(11106, '后窑乡', 4, 1600), +(11107, '四合镇', 4, 1600), +(11108, '四面城镇', 4, 1600), +(11109, '大兴乡', 4, 1600), +(11110, '大四家子乡', 4, 1600), +(11111, '大洼镇', 4, 1600), +(11112, '太平乡', 4, 1600), +(11113, '头道镇', 4, 1600), +(11114, '宝力镇', 4, 1600), +(11115, '平安堡乡', 4, 1600), +(11116, '昌图镇', 4, 1600), +(11117, '曲家店乡', 4, 1600), +(11118, '朝阳镇', 4, 1600), +(11119, '毛家店镇', 4, 1600), +(11120, '泉头镇', 4, 1600), +(11121, '老四平镇', 4, 1600), +(11122, '老城镇', 4, 1600); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11123, '通江口乡', 4, 1600), +(11124, '金家镇', 4, 1600), +(11125, '长发乡', 4, 1600), +(11126, '马仲河镇', 4, 1600), +(11127, '雌鹭树镇', 4, 1600), +(11128, '向阳街道', 4, 1601), +(11129, '张相镇', 4, 1601), +(11130, '杨木林子乡', 4, 1601), +(11131, '红旗街道', 4, 1601), +(11132, '聂家满族乡', 4, 1601), +(11133, '凉泉镇', 4, 1602), +(11134, '和隆满族乡', 4, 1602), +(11135, '天德镇', 4, 1602), +(11136, '安民镇', 4, 1602), +(11137, '平岗镇', 4, 1602), +(11138, '德兴满族乡', 4, 1602), +(11139, '成平满族乡', 4, 1602), +(11140, '房木镇', 4, 1602), +(11141, '振兴镇', 4, 1602), +(11142, '明德满族乡', 4, 1602), +(11143, '更刻乡', 4, 1602), +(11144, '柏榆乡', 4, 1602), +(11145, '营厂满族乡', 4, 1602), +(11146, '西丰镇', 4, 1602), +(11147, '郜家店镇', 4, 1602), +(11148, '金星满族乡', 4, 1602), +(11149, '钓鱼乡', 4, 1602), +(11150, '陶然乡', 4, 1602), +(11151, '兀术街街道', 4, 1603), +(11152, '大明镇', 4, 1603), +(11153, '晓南镇', 4, 1603), +(11154, '晓明镇', 4, 1603), +(11155, '调兵山街道', 4, 1603), +(11156, '凡河镇', 4, 1604), +(11157, '双井子乡', 4, 1604), +(11158, '大甸子镇', 4, 1604), +(11159, '平顶堡镇', 4, 1604), +(11160, '新台子镇', 4, 1604), +(11161, '李千户乡', 4, 1604), +(11162, '横道河子满族乡', 4, 1604), +(11163, '熊官屯乡', 4, 1604), +(11164, '白旗寨满族乡', 4, 1604), +(11165, '腰堡镇', 4, 1604), +(11166, '蔡牛乡', 4, 1604), +(11167, '镇西堡镇', 4, 1604), +(11168, '阿吉镇', 4, 1604), +(11169, '鸡冠山乡', 4, 1604), +(11170, '岭东街道', 4, 1605), +(11171, '工人街道', 4, 1605), +(11172, '柴河街道', 4, 1605), +(11173, '红旗街道', 4, 1605), +(11174, '铁西街道', 4, 1605), +(11175, '铜钟街道', 4, 1605), +(11176, '龙山乡', 4, 1605), +(11177, '万元店镇', 4, 1606), +(11178, '三十家子镇', 4, 1606), +(11179, '三家子蒙古族乡', 4, 1606), +(11180, '三道河子乡', 4, 1606), +(11181, '东城街道', 4, 1606), +(11182, '佛爷洞乡', 4, 1606); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11183, '凌北镇', 4, 1606), +(11184, '刀尔登镇', 4, 1606), +(11185, '刘杖子乡', 4, 1606), +(11186, '北炉乡', 4, 1606), +(11187, '北街街道', 4, 1606), +(11188, '南街街道', 4, 1606), +(11189, '四合当镇', 4, 1606), +(11190, '四官营子镇', 4, 1606), +(11191, '城关镇', 4, 1606), +(11192, '宋杖子镇', 4, 1606), +(11193, '小城子镇', 4, 1606), +(11194, '杨杖子镇', 4, 1606), +(11195, '松岭子镇', 4, 1606), +(11196, '沟门子镇', 4, 1606), +(11197, '热水汤街道', 4, 1606), +(11198, '牛营子乡', 4, 1606), +(11199, '瓦房店乡', 4, 1606), +(11200, '红山街道', 4, 1606), +(11201, '三宝乡', 4, 1607), +(11202, '三宝营乡', 4, 1607), +(11203, '三宝街道', 4, 1607), +(11204, '上园镇', 4, 1607), +(11205, '东官营乡', 4, 1607), +(11206, '五间房镇', 4, 1607), +(11207, '冠山街道', 4, 1607), +(11208, '凉水河蒙古族乡', 4, 1607), +(11209, '北四家乡', 4, 1607), +(11210, '北塔子乡', 4, 1607), +(11211, '南八家子乡', 4, 1607), +(11212, '南山街道', 4, 1607), +(11213, '台吉营乡', 4, 1607), +(11214, '台吉街道', 4, 1607), +(11215, '台吉镇', 4, 1607), +(11216, '哈尔脑乡', 4, 1607), +(11217, '城关街道', 4, 1607), +(11218, '大三家子乡', 4, 1607), +(11219, '大板镇', 4, 1607), +(11220, '娄家店乡', 4, 1607), +(11221, '宝国老镇', 4, 1607), +(11222, '小塔子乡', 4, 1607), +(11223, '巴图营乡', 4, 1607), +(11224, '桥北街道', 4, 1607), +(11225, '泉巨永乡', 4, 1607), +(11226, '章吉营乡', 4, 1607), +(11227, '蒙古营乡', 4, 1607), +(11228, '西官营镇', 4, 1607), +(11229, '长皋乡', 4, 1607), +(11230, '马友营蒙古族乡', 4, 1607), +(11231, '黑城子镇', 4, 1607), +(11232, '龙潭乡', 4, 1607), +(11233, '他拉皋镇', 4, 1608), +(11234, '光明街道', 4, 1608), +(11235, '凌凤街道', 4, 1608), +(11236, '凌河街道', 4, 1608), +(11237, '前进街道', 4, 1608), +(11238, '北塔街道', 4, 1608), +(11239, '南塔街道', 4, 1608), +(11240, '孙家湾乡', 4, 1608), +(11241, '桃花吐镇', 4, 1608), +(11242, '燕北街道', 4, 1608); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11243, '站南街道', 4, 1608), +(11244, '红旗街道', 4, 1608), +(11245, '长宝营子乡', 4, 1608), +(11246, '龙山街道', 4, 1608), +(11247, '东哨乡', 4, 1609), +(11248, '中三家镇', 4, 1609), +(11249, '公营子镇', 4, 1609), +(11250, '六官营子镇', 4, 1609), +(11251, '十二德堡乡', 4, 1609), +(11252, '南公营子镇', 4, 1609), +(11253, '南哨镇', 4, 1609), +(11254, '卧虎沟乡', 4, 1609), +(11255, '坤都营子乡', 4, 1609), +(11256, '大城子镇', 4, 1609), +(11257, '山咀子镇', 4, 1609), +(11258, '平房子镇', 4, 1609), +(11259, '水泉乡', 4, 1609), +(11260, '白塔子镇', 4, 1609), +(11261, '羊角沟乡', 4, 1609), +(11262, '老爷庙镇', 4, 1609), +(11263, '草场乡', 4, 1609), +(11264, '万寿', 4, 1610), +(11265, '三家蒙古族', 4, 1610), +(11266, '义成功', 4, 1610), +(11267, '八家', 4, 1610), +(11268, '叶柏寿', 4, 1610), +(11269, '哈拉道', 4, 1610), +(11270, '喀喇沁', 4, 1610), +(11271, '太平庄', 4, 1610), +(11272, '奎德素', 4, 1610), +(11273, '富山', 4, 1610), +(11274, '小塘', 4, 1610), +(11275, '建平', 4, 1610), +(11276, '张家营子', 4, 1610), +(11277, '昌隆永', 4, 1610), +(11278, '朱力科', 4, 1610), +(11279, '杨树岭', 4, 1610), +(11280, '榆树林子', 4, 1610), +(11281, '沙海', 4, 1610), +(11282, '深井', 4, 1610), +(11283, '烧锅营子', 4, 1610), +(11284, '热水', 4, 1610), +(11285, '白山', 4, 1610), +(11286, '罗福沟', 4, 1610), +(11287, '老官地', 4, 1610), +(11288, '青峰', 4, 1610), +(11289, '青松岭', 4, 1610), +(11290, '马场', 4, 1610), +(11291, '黑水', 4, 1610), +(11292, '七道岭乡', 4, 1611), +(11293, '东大屯乡', 4, 1611), +(11294, '东大道乡', 4, 1611), +(11295, '乌兰河硕蒙古族乡', 4, 1611), +(11296, '二十家子镇', 4, 1611), +(11297, '六家子镇', 4, 1611), +(11298, '北四家子乡', 4, 1611), +(11299, '北沟门子乡', 4, 1611), +(11300, '南双庙乡', 4, 1611), +(11301, '古山子乡', 4, 1611), +(11302, '台子乡', 4, 1611), +(11303, '大庙镇', 4, 1611), +(11304, '尚志乡', 4, 1611); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11305, '木头城子镇', 4, 1611), +(11306, '杨树湾乡', 4, 1611), +(11307, '松岭门蒙古族乡', 4, 1611), +(11308, '柳城镇', 4, 1611), +(11309, '根德营子乡', 4, 1611), +(11310, '波罗赤镇', 4, 1611), +(11311, '王营子乡', 4, 1611), +(11312, '瓦房子镇', 4, 1611), +(11313, '羊山镇', 4, 1611), +(11314, '胜利乡', 4, 1611), +(11315, '长在营子乡', 4, 1611), +(11316, '黑牛营子乡', 4, 1611), +(11317, '七道泉子镇', 4, 1612), +(11318, '半拉山街道', 4, 1612), +(11319, '召都巴镇', 4, 1612), +(11320, '向阳街道', 4, 1612), +(11321, '大平房镇', 4, 1612), +(11322, '新华街道', 4, 1612), +(11323, '联合乡', 4, 1612), +(11324, '西大营子镇', 4, 1612), +(11325, '边杖子乡', 4, 1612), +(11326, '马山街道', 4, 1612), +(11327, '龙泉街道', 4, 1612), +(11328, '三道沟满族乡', 4, 1613), +(11329, '东辛庄镇', 4, 1613), +(11330, '元台子满族乡', 4, 1613), +(11331, '刘台子满族乡', 4, 1613), +(11332, '华山街道', 4, 1613), +(11333, '南大山满族乡', 4, 1613), +(11334, '双树乡', 4, 1613), +(11335, '古城街道', 4, 1613), +(11336, '四家屯街道', 4, 1613), +(11337, '围屏满族乡', 4, 1613), +(11338, '城东街道', 4, 1613), +(11339, '大寨满族乡', 4, 1613), +(11340, '宁远街道', 4, 1613), +(11341, '旧门满族乡', 4, 1613), +(11342, '曹庄镇', 4, 1613), +(11343, '望海满族乡', 4, 1613), +(11344, '沙后所镇', 4, 1613), +(11345, '海滨满族乡', 4, 1613), +(11346, '温泉街道', 4, 1613), +(11347, '白塔满族乡', 4, 1613), +(11348, '碱厂满族乡', 4, 1613), +(11349, '红崖子满族乡', 4, 1613), +(11350, '羊安满族乡', 4, 1613), +(11351, '药王满族乡', 4, 1613), +(11352, '菊花岛乡', 4, 1613), +(11353, '郭家镇', 4, 1613), +(11354, '钓鱼台街道', 4, 1613), +(11355, '高家岭满族乡', 4, 1613), +(11356, '三家子街道', 4, 1614), +(11357, '九龙街道', 4, 1614), +(11358, '小凌河街道', 4, 1614), +(11359, '暖池塘镇', 4, 1614), +(11360, '沙锅屯乡', 4, 1614), +(11361, '沙锅屯街道', 4, 1614); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11362, '缸窑岭镇', 4, 1614), +(11363, '苇子沟街道', 4, 1614), +(11364, '赵家屯街道', 4, 1614), +(11365, '邱皮沟街道', 4, 1614), +(11366, '黄土坎乡', 4, 1614), +(11367, '二道湾子蒙古族乡', 4, 1615), +(11368, '八家子镇', 4, 1615), +(11369, '养马甸子乡', 4, 1615), +(11370, '和尚房子乡', 4, 1615), +(11371, '喇嘛洞镇', 4, 1615), +(11372, '大屯镇', 4, 1615), +(11373, '头道营子乡', 4, 1615), +(11374, '娘娘庙乡', 4, 1615), +(11375, '小德营子乡', 4, 1615), +(11376, '巴什罕乡', 4, 1615), +(11377, '建昌镇', 4, 1615), +(11378, '新开岭乡', 4, 1615), +(11379, '杨树湾子乡', 4, 1615), +(11380, '汤神庙镇', 4, 1615), +(11381, '牤牛营子乡', 4, 1615), +(11382, '王宝营子乡', 4, 1615), +(11383, '玲珑塔镇', 4, 1615), +(11384, '石佛乡', 4, 1615), +(11385, '素珠营子乡', 4, 1615), +(11386, '老达杖子乡', 4, 1615), +(11387, '药王庙镇', 4, 1615), +(11388, '西碱厂乡', 4, 1615), +(11389, '要路沟乡', 4, 1615), +(11390, '谷杖子乡', 4, 1615), +(11391, '贺杖子乡', 4, 1615), +(11392, '雷家店乡', 4, 1615), +(11393, '魏家岭乡', 4, 1615), +(11394, '黑山科乡', 4, 1615), +(11395, '万家镇', 4, 1616), +(11396, '前卫镇', 4, 1616), +(11397, '前所镇', 4, 1616), +(11398, '加碑岩乡', 4, 1616), +(11399, '城郊乡', 4, 1616), +(11400, '塔山屯镇', 4, 1616), +(11401, '大王庙镇', 4, 1616), +(11402, '宽帮镇', 4, 1616), +(11403, '小庄子镇', 4, 1616), +(11404, '明水满族乡', 4, 1616), +(11405, '李家堡乡', 4, 1616), +(11406, '永安堡乡', 4, 1616), +(11407, '沙河镇', 4, 1616), +(11408, '王宝镇', 4, 1616), +(11409, '秋子沟乡', 4, 1616), +(11410, '绥中镇', 4, 1616), +(11411, '网户满族乡', 4, 1616), +(11412, '范家满族乡', 4, 1616), +(11413, '荒地镇', 4, 1616), +(11414, '葛家满族乡', 4, 1616), +(11415, '西平坡满族乡', 4, 1616), +(11416, '西庙子镇', 4, 1616), +(11417, '高台镇', 4, 1616), +(11418, '高岭镇', 4, 1616), +(11419, '高甸子满族乡', 4, 1616), +(11420, '一〇八街道', 4, 1617); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11421, '兴工街道', 4, 1617), +(11422, '化工街道', 4, 1617), +(11423, '化机街道', 4, 1617), +(11424, '台集屯镇', 4, 1617), +(11425, '塔山乡', 4, 1617), +(11426, '大兴乡', 4, 1617), +(11427, '孤竹营子乡', 4, 1617), +(11428, '寺儿堡镇', 4, 1617), +(11429, '山神庙子乡', 4, 1617), +(11430, '张相公屯乡', 4, 1617), +(11431, '新台门镇', 4, 1617), +(11432, '杨家杖子街道', 4, 1617), +(11433, '杨郊乡', 4, 1617), +(11434, '水泥街道', 4, 1617), +(11435, '沙河营乡', 4, 1617), +(11436, '渤海街道', 4, 1617), +(11437, '白马石乡', 4, 1617), +(11438, '石油街道', 4, 1617), +(11439, '站前街道', 4, 1617), +(11440, '虹螺岘镇', 4, 1617), +(11441, '连山街道', 4, 1617), +(11442, '金星镇', 4, 1617), +(11443, '钢屯镇', 4, 1617), +(11444, '锦郊街道', 4, 1617), +(11445, '高桥镇', 4, 1617), +(11446, '东街道', 4, 1618), +(11447, '北港街道', 4, 1618), +(11448, '双龙街道', 4, 1618), +(11449, '望海寺街道', 4, 1618), +(11450, '滨海街道', 4, 1618), +(11451, '玉皇街道', 4, 1618), +(11452, '葫芦岛街道', 4, 1618), +(11453, '西街道', 4, 1618), +(11454, '连湾街道', 4, 1618), +(11455, '龙湾街道', 4, 1618), +(11456, '上河湾镇', 4, 1619), +(11457, '九台街道', 4, 1619), +(11458, '九郊街道', 4, 1619), +(11459, '兴隆镇', 4, 1619), +(11460, '其塔木镇', 4, 1619), +(11461, '土们岭镇', 4, 1619), +(11462, '城子街镇', 4, 1619), +(11463, '沐石河镇', 4, 1619), +(11464, '波泥河镇', 4, 1619), +(11465, '纪家镇', 4, 1619), +(11466, '胡家回族乡', 4, 1619), +(11467, '苇子沟镇', 4, 1619), +(11468, '莽卡满族乡', 4, 1619), +(11469, '营城街道', 4, 1619), +(11470, '西营城镇', 4, 1619), +(11471, '东方广场街道', 4, 1620), +(11472, '东湖镇', 4, 1620), +(11473, '东盛街道', 4, 1620), +(11474, '东站街道', 4, 1620), +(11475, '八里堡街道', 4, 1620), +(11476, '劝农山镇', 4, 1620), +(11477, '卡伦湖镇', 4, 1620), +(11478, '吉林街道', 4, 1620), +(11479, '四家乡', 4, 1620), +(11480, '泉眼镇', 4, 1620); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11481, '英俊镇', 4, 1620), +(11482, '荣光街道', 4, 1620), +(11483, '远达街道', 4, 1620), +(11484, '龙嘉镇', 4, 1620), +(11485, '万金塔乡', 4, 1621), +(11486, '万顺乡', 4, 1621), +(11487, '三岗乡', 4, 1621), +(11488, '三盛玉镇', 4, 1621), +(11489, '伏龙泉镇', 4, 1621), +(11490, '农安镇', 4, 1621), +(11491, '前岗乡', 4, 1621), +(11492, '华家镇', 4, 1621), +(11493, '哈拉海镇', 4, 1621), +(11494, '小城子乡', 4, 1621), +(11495, '巴吉垒镇', 4, 1621), +(11496, '开安镇', 4, 1621), +(11497, '新农乡', 4, 1621), +(11498, '杨树林乡', 4, 1621), +(11499, '永安乡', 4, 1621), +(11500, '烧锅镇', 4, 1621), +(11501, '青山口乡', 4, 1621), +(11502, '靠山镇', 4, 1621), +(11503, '高家店镇', 4, 1621), +(11504, '黄鱼圈乡', 4, 1621), +(11505, '龙王乡', 4, 1621), +(11506, '临河街道', 4, 1622), +(11507, '全安街道', 4, 1622), +(11508, '净月街道', 4, 1622), +(11509, '南岭街道', 4, 1622), +(11510, '幸福乡', 4, 1622), +(11511, '新春街道', 4, 1622), +(11512, '新湖镇', 4, 1622), +(11513, '新立城镇', 4, 1622), +(11514, '明珠街道', 4, 1622), +(11515, '曙光街道', 4, 1622), +(11516, '桃源街道', 4, 1622), +(11517, '民康街道', 4, 1622), +(11518, '永兴街道', 4, 1622), +(11519, '永吉街道', 4, 1622), +(11520, '玉潭镇', 4, 1622), +(11521, '自强街道', 4, 1622), +(11522, '长通街道', 4, 1622), +(11523, '鸿城街道', 4, 1622), +(11524, '云山街道', 4, 1623), +(11525, '双营子回族乡', 4, 1623), +(11526, '太平镇', 4, 1623), +(11527, '奢岭街道', 4, 1623), +(11528, '山河街道', 4, 1623), +(11529, '平湖街道', 4, 1623), +(11530, '鹿乡镇', 4, 1623), +(11531, '齐家镇', 4, 1623), +(11532, '万宝镇', 4, 1624), +(11533, '东广街道', 4, 1624), +(11534, '兰家镇', 4, 1624), +(11535, '兴业街道', 4, 1624), +(11536, '兴隆山镇', 4, 1624), +(11537, '凯旋街道', 4, 1624), +(11538, '南广街道', 4, 1624), +(11539, '合隆镇', 4, 1624), +(11540, '团山街道', 4, 1624), +(11541, '奋进乡', 4, 1624), +(11542, '新发街道', 4, 1624); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11543, '柳影街道', 4, 1624), +(11544, '站前街道', 4, 1624), +(11545, '米沙子镇', 4, 1624), +(11546, '群英街道', 4, 1624), +(11547, '五台乡', 4, 1625), +(11548, '同太乡', 4, 1625), +(11549, '夏家店街道', 4, 1625), +(11550, '大房身镇', 4, 1625), +(11551, '大青嘴镇', 4, 1625), +(11552, '天台镇', 4, 1625), +(11553, '岔路口镇', 4, 1625), +(11554, '布海镇', 4, 1625), +(11555, '建设街道', 4, 1625), +(11556, '惠发街道', 4, 1625), +(11557, '朝阳乡', 4, 1625), +(11558, '朱城子镇', 4, 1625), +(11559, '松花江镇', 4, 1625), +(11560, '胜利街道', 4, 1625), +(11561, '菜园子镇', 4, 1625), +(11562, '边岗乡', 4, 1625), +(11563, '达家沟镇', 4, 1625), +(11564, '郭家镇', 4, 1625), +(11565, '乐山镇', 4, 1626), +(11566, '南湖街道', 4, 1626), +(11567, '南站街道', 4, 1626), +(11568, '双德乡', 4, 1626), +(11569, '富锋镇', 4, 1626), +(11570, '桂林街道', 4, 1626), +(11571, '永昌街道', 4, 1626), +(11572, '永春镇', 4, 1626), +(11573, '清和街道', 4, 1626), +(11574, '湖西街道', 4, 1626), +(11575, '红旗街道', 4, 1626), +(11576, '重庆街道', 4, 1626), +(11577, '五棵树镇', 4, 1627), +(11578, '保寿镇', 4, 1627), +(11579, '先锋乡', 4, 1627), +(11580, '八号镇', 4, 1627), +(11581, '刘家镇', 4, 1627), +(11582, '华昌街道', 4, 1627), +(11583, '向阳镇', 4, 1627), +(11584, '土桥镇', 4, 1627), +(11585, '城发乡', 4, 1627), +(11586, '城郊街道', 4, 1627), +(11587, '培英街道', 4, 1627), +(11588, '大坡镇', 4, 1627), +(11589, '大岭镇', 4, 1627), +(11590, '太安乡', 4, 1627), +(11591, '延和朝鲜族乡', 4, 1627), +(11592, '弓棚镇', 4, 1627), +(11593, '恩育乡', 4, 1627), +(11594, '新庄镇', 4, 1627), +(11595, '新立镇', 4, 1627), +(11596, '正阳街道', 4, 1627), +(11597, '泗河镇', 4, 1627), +(11598, '环城乡', 4, 1627), +(11599, '秀水镇', 4, 1627), +(11600, '红星乡', 4, 1627), +(11601, '育民乡', 4, 1627), +(11602, '闵家镇', 4, 1627), +(11603, '青山乡', 4, 1627), +(11604, '黑林镇', 4, 1627), +(11605, '东风街道', 4, 1628); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11606, '合心镇', 4, 1628), +(11607, '城西镇', 4, 1628), +(11608, '春城街道', 4, 1628), +(11609, '普阳街道', 4, 1628), +(11610, '正阳街道', 4, 1628), +(11611, '西新镇', 4, 1628), +(11612, '铁西街道', 4, 1628), +(11613, '锦程街道', 4, 1628), +(11614, '青年路街道', 4, 1628), +(11615, '丰满乡', 4, 1629), +(11616, '丰满街道', 4, 1629), +(11617, '前二道乡', 4, 1629), +(11618, '大长屯街道', 4, 1629), +(11619, '小白山乡', 4, 1629), +(11620, '旺起镇', 4, 1629), +(11621, '朱雀山管委会', 4, 1629), +(11622, '江南乡', 4, 1629), +(11623, '江南街道', 4, 1629), +(11624, '沿丰街道', 4, 1629), +(11625, '泰山街道', 4, 1629), +(11626, '石井街道', 4, 1629), +(11627, '红旗街道', 4, 1629), +(11628, '高新街道', 4, 1629), +(11629, '东局子街道', 4, 1630), +(11630, '两家子满族乡', 4, 1630), +(11631, '九站街道', 4, 1630), +(11632, '兴华街道', 4, 1630), +(11633, '双吉街道', 4, 1630), +(11634, '哈达湾工业开发区', 4, 1630), +(11635, '哈达湾街道', 4, 1630), +(11636, '土城子满族朝鲜族乡', 4, 1630), +(11637, '孤店子镇', 4, 1630), +(11638, '左家镇', 4, 1630), +(11639, '幸福经济管理区', 4, 1630), +(11640, '延安街道', 4, 1630), +(11641, '延江街道', 4, 1630), +(11642, '怡春里街道', 4, 1630), +(11643, '文庙街道', 4, 1630), +(11644, '新地号街道', 4, 1630), +(11645, '新建街道', 4, 1630), +(11646, '桦皮厂镇', 4, 1630), +(11647, '民主街道', 4, 1630), +(11648, '站前街道', 4, 1630), +(11649, '维昌街道', 4, 1630), +(11650, '莲花街道', 4, 1630), +(11651, '通江街道', 4, 1630), +(11652, '二道甸子镇', 4, 1631), +(11653, '八道河子镇', 4, 1631), +(11654, '公吉乡', 4, 1631), +(11655, '北台子乡', 4, 1631), +(11656, '启新街道', 4, 1631), +(11657, '夹皮沟镇', 4, 1631), +(11658, '常山镇', 4, 1631), +(11659, '新华街道', 4, 1631), +(11660, '明桦街道', 4, 1631), +(11661, '桦南乡', 4, 1631), +(11662, '桦树林子乡', 4, 1631), +(11663, '桦郊乡', 4, 1631); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11664, '榆木桥子镇', 4, 1631), +(11665, '横道河子乡', 4, 1631), +(11666, '永吉街道', 4, 1631), +(11667, '白山镇', 4, 1631), +(11668, '红石砬子镇', 4, 1631), +(11669, '老金厂镇', 4, 1631), +(11670, '胜利街道', 4, 1631), +(11671, '苏密沟乡', 4, 1631), +(11672, '金沙乡', 4, 1631), +(11673, '一拉溪镇', 4, 1632), +(11674, '万昌镇', 4, 1632), +(11675, '三家子乡', 4, 1632), +(11676, '北大湖镇', 4, 1632), +(11677, '双河镇', 4, 1632), +(11678, '口前镇', 4, 1632), +(11679, '大岗子乡', 4, 1632), +(11680, '官厅乡', 4, 1632), +(11681, '岔路河镇', 4, 1632), +(11682, '春登乡', 4, 1632), +(11683, '西阳镇', 4, 1632), +(11684, '金家满族乡', 4, 1632), +(11685, '黄榆乡', 4, 1632), +(11686, '东宁街道', 4, 1633), +(11687, '取柴河镇', 4, 1633), +(11688, '吉昌镇', 4, 1633), +(11689, '呼兰镇', 4, 1633), +(11690, '宝山乡', 4, 1633), +(11691, '富太镇', 4, 1633), +(11692, '明城镇', 4, 1633), +(11693, '朝阳山镇', 4, 1633), +(11694, '松山镇', 4, 1633), +(11695, '河南街道', 4, 1633), +(11696, '烟筒山镇', 4, 1633), +(11697, '牛心镇', 4, 1633), +(11698, '石嘴镇', 4, 1633), +(11699, '磐石经济开发区', 4, 1633), +(11700, '福安街道', 4, 1633), +(11701, '红旗岭镇', 4, 1633), +(11702, '驿马镇', 4, 1633), +(11703, '黑石镇', 4, 1633), +(11704, '上营镇', 4, 1634), +(11705, '北城街道', 4, 1634), +(11706, '吉舒街道', 4, 1634), +(11707, '天德乡', 4, 1634), +(11708, '平安镇', 4, 1634), +(11709, '开原镇', 4, 1634), +(11710, '新安乡', 4, 1634), +(11711, '朝阳镇', 4, 1634), +(11712, '水曲柳镇', 4, 1634), +(11713, '法特镇', 4, 1634), +(11714, '溪河镇', 4, 1634), +(11715, '环城街道', 4, 1634), +(11716, '白旗镇', 4, 1634), +(11717, '莲花乡', 4, 1634), +(11718, '金马镇', 4, 1634), +(11719, '临江街道', 4, 1635), +(11720, '北山街道', 4, 1635), +(11721, '北极街道', 4, 1635), +(11722, '南京街道', 4, 1635), +(11723, '吉林市高新技术产业开发区', 4, 1635), +(11724, '向阳街道', 4, 1635); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11725, '大东街道', 4, 1635), +(11726, '大绥河镇', 4, 1635), +(11727, '德胜街道', 4, 1635), +(11728, '搜登站镇', 4, 1635), +(11729, '欢喜乡', 4, 1635), +(11730, '致和街道', 4, 1635), +(11731, '越北镇', 4, 1635), +(11732, '长春路街道', 4, 1635), +(11733, '青岛街道', 4, 1635), +(11734, '高新街道', 4, 1635), +(11735, '黄旗街道', 4, 1635), +(11736, '乌林朝鲜族乡', 4, 1636), +(11737, '前进乡', 4, 1636), +(11738, '天北镇', 4, 1636), +(11739, '天岗镇', 4, 1636), +(11740, '奶子山街道', 4, 1636), +(11741, '庆岭镇', 4, 1636), +(11742, '拉法街道', 4, 1636), +(11743, '新农街道', 4, 1636), +(11744, '新站镇', 4, 1636), +(11745, '松江镇', 4, 1636), +(11746, '民主街道', 4, 1636), +(11747, '河北街道', 4, 1636), +(11748, '河南街道', 4, 1636), +(11749, '漂河镇', 4, 1636), +(11750, '白石山镇', 4, 1636), +(11751, '长安街道', 4, 1636), +(11752, '黄松甸镇', 4, 1636), +(11753, '乌拉街满族镇', 4, 1637), +(11754, '大口钦满族镇', 4, 1637), +(11755, '山前街道', 4, 1637), +(11756, '承德街道', 4, 1637), +(11757, '新吉林街道', 4, 1637), +(11758, '新安街道', 4, 1637), +(11759, '榆树街道', 4, 1637), +(11760, '江北乡', 4, 1637), +(11761, '江密峰镇', 4, 1637), +(11762, '泡子沿街道', 4, 1637), +(11763, '湘潭街道', 4, 1637), +(11764, '缸窑镇', 4, 1637), +(11765, '遵义街道', 4, 1637), +(11766, '金珠乡', 4, 1637), +(11767, '铁东街道', 4, 1637), +(11768, '靠山街道', 4, 1637), +(11769, '龙华街道', 4, 1637), +(11770, '龙潭街道', 4, 1637), +(11771, '三道乡', 4, 1638), +(11772, '二道镇', 4, 1638), +(11773, '伊丹镇', 4, 1638), +(11774, '伊通镇', 4, 1638), +(11775, '大孤山镇', 4, 1638), +(11776, '小孤山镇', 4, 1638), +(11777, '新兴乡', 4, 1638), +(11778, '景台镇', 4, 1638), +(11779, '河源镇', 4, 1638), +(11780, '莫里青乡', 4, 1638), +(11781, '营城子镇', 4, 1638), +(11782, '西苇镇', 4, 1638), +(11783, '靠山镇', 4, 1638), +(11784, '马鞍山镇', 4, 1638), +(11785, '黄岭子镇', 4, 1638); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11786, '东三街道', 4, 1639), +(11787, '二十家子满族镇', 4, 1639), +(11788, '八屋镇', 4, 1639), +(11789, '刘房子镇', 4, 1639), +(11790, '十屋镇', 4, 1639), +(11791, '南崴子镇', 4, 1639), +(11792, '双城堡镇', 4, 1639), +(11793, '双龙镇', 4, 1639), +(11794, '响水镇', 4, 1639), +(11795, '大岭镇', 4, 1639), +(11796, '大榆树镇', 4, 1639), +(11797, '岭东街道', 4, 1639), +(11798, '岭西街道', 4, 1639), +(11799, '怀德镇', 4, 1639), +(11800, '朝阳坡镇', 4, 1639), +(11801, '杨大城子镇', 4, 1639), +(11802, '桑树台镇', 4, 1639), +(11803, '毛城子镇', 4, 1639), +(11804, '永发乡', 4, 1639), +(11805, '河北街道', 4, 1639), +(11806, '河南街道', 4, 1639), +(11807, '环岭街道', 4, 1639), +(11808, '玻璃城子镇', 4, 1639), +(11809, '秦家屯镇', 4, 1639), +(11810, '苇子沟街道', 4, 1639), +(11811, '范家屯镇', 4, 1639), +(11812, '铁北街道', 4, 1639), +(11813, '陶家屯镇', 4, 1639), +(11814, '黑林子镇', 4, 1639), +(11815, '龙山满族乡', 4, 1639), +(11816, '东明镇', 4, 1640), +(11817, '兴隆镇', 4, 1640), +(11818, '卧虎镇', 4, 1640), +(11819, '双山镇', 4, 1640), +(11820, '新立乡', 4, 1640), +(11821, '服先镇', 4, 1640), +(11822, '柳条乡', 4, 1640), +(11823, '永加乡', 4, 1640), +(11824, '王奔镇', 4, 1640), +(11825, '玻璃山镇', 4, 1640), +(11826, '红旗街道', 4, 1640), +(11827, '茂林镇', 4, 1640), +(11828, '辽东街道', 4, 1640), +(11829, '辽北街道', 4, 1640), +(11830, '辽南街道', 4, 1640), +(11831, '辽西街道', 4, 1640), +(11832, '那木斯蒙古族乡', 4, 1640), +(11833, '郑家屯街道', 4, 1640), +(11834, '万发镇', 4, 1641), +(11835, '东河镇', 4, 1641), +(11836, '刘家馆子镇', 4, 1641), +(11837, '十家堡镇', 4, 1641), +(11838, '双河乡', 4, 1641), +(11839, '喇嘛店镇', 4, 1641), +(11840, '四棵树乡', 4, 1641), +(11841, '孟家岭镇', 4, 1641), +(11842, '小城子镇', 4, 1641), +(11843, '小宽镇', 4, 1641), +(11844, '林海镇', 4, 1641), +(11845, '梨树乡', 4, 1641), +(11846, '梨树镇', 4, 1641); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11847, '榆树台镇', 4, 1641), +(11848, '沈洋镇', 4, 1641), +(11849, '泉眼岭乡', 4, 1641), +(11850, '白山乡', 4, 1641), +(11851, '石岭镇', 4, 1641), +(11852, '胜利乡', 4, 1641), +(11853, '董家窝堡乡', 4, 1641), +(11854, '蔡家镇', 4, 1641), +(11855, '郭家店镇', 4, 1641), +(11856, '金山乡', 4, 1641), +(11857, '叶赫镇', 4, 1642), +(11858, '仁兴街道', 4, 1643), +(11859, '北沟街道', 4, 1643), +(11860, '地直街道', 4, 1643), +(11861, '平西乡', 4, 1643), +(11862, '站前街道', 4, 1643), +(11863, '英雄街道', 4, 1643), +(11864, '三合朝鲜族满族乡', 4, 1644), +(11865, '东丰镇', 4, 1644), +(11866, '二龙山乡', 4, 1644), +(11867, '南屯基镇', 4, 1644), +(11868, '大兴镇', 4, 1644), +(11869, '大阳镇', 4, 1644), +(11870, '小四平镇', 4, 1644), +(11871, '拉拉河镇', 4, 1644), +(11872, '杨木林镇', 4, 1644), +(11873, '横道河镇', 4, 1644), +(11874, '沙河镇', 4, 1644), +(11875, '猴石镇', 4, 1644), +(11876, '那丹伯镇', 4, 1644), +(11877, '黄泥河镇', 4, 1644), +(11878, '云顶镇', 4, 1645), +(11879, '安恕镇', 4, 1645), +(11880, '安石镇', 4, 1645), +(11881, '宴平乡', 4, 1645), +(11882, '寿山镇', 4, 1645), +(11883, '平岗镇', 4, 1645), +(11884, '建安镇', 4, 1645), +(11885, '泉太镇', 4, 1645), +(11886, '甲山乡', 4, 1645), +(11887, '白泉镇', 4, 1645), +(11888, '足民乡', 4, 1645), +(11889, '东山街道', 4, 1646), +(11890, '仙城街道', 4, 1646), +(11891, '先锋街道', 4, 1646), +(11892, '太安街道', 4, 1646), +(11893, '安家街道', 4, 1646), +(11894, '富国街道', 4, 1646), +(11895, '灯塔乡', 4, 1646), +(11896, '东吉街道', 4, 1647), +(11897, '北寿街道', 4, 1647), +(11898, '南康街道', 4, 1647), +(11899, '向阳街道', 4, 1647), +(11900, '寿山镇', 4, 1647), +(11901, '工农乡', 4, 1647), +(11902, '新兴街道', 4, 1647), +(11903, '福镇街道', 4, 1647), +(11904, '站前街道', 4, 1647), +(11905, '西宁街道', 4, 1647), +(11906, '东昌街道', 4, 1648), +(11907, '光明街道', 4, 1648), +(11908, '团结街道', 4, 1648); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11909, '新站街道', 4, 1648), +(11910, '江东乡', 4, 1648), +(11911, '环通乡', 4, 1648), +(11912, '老站街道', 4, 1648), +(11913, '金厂镇', 4, 1648), +(11914, '龙泉街道', 4, 1648), +(11915, '东通化街道', 4, 1649), +(11916, '二道江乡', 4, 1649), +(11917, '五道江镇', 4, 1649), +(11918, '桃园街道', 4, 1649), +(11919, '民主街道', 4, 1649), +(11920, '铁厂镇', 4, 1649), +(11921, '鸭园镇', 4, 1649), +(11922, '三源浦朝鲜族镇', 4, 1650), +(11923, '五道沟镇', 4, 1650), +(11924, '亨通镇', 4, 1650), +(11925, '凉水河子镇', 4, 1650), +(11926, '向阳镇', 4, 1650), +(11927, '圣水河子镇', 4, 1650), +(11928, '姜家店朝鲜族乡', 4, 1650), +(11929, '孤山子镇', 4, 1650), +(11930, '安口镇', 4, 1650), +(11931, '时家店乡', 4, 1650), +(11932, '柳南乡', 4, 1650), +(11933, '柳河镇', 4, 1650), +(11934, '红石镇', 4, 1650), +(11935, '罗通山镇', 4, 1650), +(11936, '驼腰岭镇', 4, 1650), +(11937, '一座营镇', 4, 1651), +(11938, '中和镇', 4, 1651), +(11939, '光明街道', 4, 1651), +(11940, '兴华乡', 4, 1651), +(11941, '双兴乡', 4, 1651), +(11942, '吉乐乡', 4, 1651), +(11943, '和平街道', 4, 1651), +(11944, '小杨满族乡', 4, 1651), +(11945, '山城镇', 4, 1651), +(11946, '康大营镇', 4, 1651), +(11947, '新华街道', 4, 1651), +(11948, '新合镇', 4, 1651), +(11949, '曙光镇', 4, 1651), +(11950, '李炉乡', 4, 1651), +(11951, '杏岭乡', 4, 1651), +(11952, '水道镇', 4, 1651), +(11953, '海龙镇', 4, 1651), +(11954, '湾龙乡', 4, 1651), +(11955, '牛心顶镇', 4, 1651), +(11956, '福民街道', 4, 1651), +(11957, '红梅镇', 4, 1651), +(11958, '解放街道', 4, 1651), +(11959, '进化镇', 4, 1651), +(11960, '黑山头镇', 4, 1651), +(11961, '庆阳镇', 4, 1652), +(11962, '抚民镇', 4, 1652), +(11963, '朝阳镇', 4, 1652), +(11964, '杉松岗镇', 4, 1652), +(11965, '样子哨镇', 4, 1652), +(11966, '楼街朝鲜族乡', 4, 1652), +(11967, '石道河镇', 4, 1652), +(11968, '辉南镇', 4, 1652), +(11969, '辉发城镇', 4, 1652); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(11970, '金川镇', 4, 1652), +(11971, '三棵榆树镇', 4, 1653), +(11972, '东来乡', 4, 1653), +(11973, '二密镇', 4, 1653), +(11974, '光华镇', 4, 1653), +(11975, '兴林镇', 4, 1653), +(11976, '四棚乡', 4, 1653), +(11977, '大安镇', 4, 1653), +(11978, '大泉源满族朝鲜族乡', 4, 1653), +(11979, '富江乡', 4, 1653), +(11980, '快大茂镇', 4, 1653), +(11981, '果松镇', 4, 1653), +(11982, '江甸镇', 4, 1653), +(11983, '石湖镇', 4, 1653), +(11984, '英额布镇', 4, 1653), +(11985, '凉水朝鲜族乡', 4, 1654), +(11986, '台上镇', 4, 1654), +(11987, '团结街道', 4, 1654), +(11988, '城东街道', 4, 1654), +(11989, '大路镇', 4, 1654), +(11990, '太王镇', 4, 1654), +(11991, '头道镇', 4, 1654), +(11992, '榆林镇', 4, 1654), +(11993, '清河镇', 4, 1654), +(11994, '花甸镇', 4, 1654), +(11995, '财源镇', 4, 1654), +(11996, '通胜街道', 4, 1654), +(11997, '青石镇', 4, 1654), +(11998, '麻线乡', 4, 1654), +(11999, '黎明街道', 4, 1654), +(12000, '六道沟镇', 4, 1655), +(12001, '兴隆街道', 4, 1655), +(12002, '四道沟镇', 4, 1655), +(12003, '大栗子街道', 4, 1655), +(12004, '大湖街道', 4, 1655), +(12005, '建国街道', 4, 1655), +(12006, '新市街道', 4, 1655), +(12007, '桦树镇', 4, 1655), +(12008, '森工街道', 4, 1655), +(12009, '花山镇', 4, 1655), +(12010, '苇沙河镇', 4, 1655), +(12011, '蚂蚁河乡', 4, 1655), +(12012, '闹枝镇', 4, 1655), +(12013, '七道江镇', 4, 1656), +(12014, '三道沟镇', 4, 1656), +(12015, '东兴街道', 4, 1656), +(12016, '六道江镇', 4, 1656), +(12017, '城南街道', 4, 1656), +(12018, '新建街道', 4, 1656), +(12019, '板石街道', 4, 1656), +(12020, '江北街道', 4, 1656), +(12021, '河口街道', 4, 1656), +(12022, '红土崖镇', 4, 1656), +(12023, '红旗街道', 4, 1656), +(12024, '通沟街道', 4, 1656), +(12025, '万良镇', 4, 1657), +(12026, '东岗镇', 4, 1657), +(12027, '仙人桥镇', 4, 1657), +(12028, '兴参镇', 4, 1657), +(12029, '兴隆乡', 4, 1657), +(12030, '北岗镇', 4, 1657), +(12031, '抚松镇', 4, 1657); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12032, '抽水乡', 4, 1657), +(12033, '新屯子镇', 4, 1657), +(12034, '松江河镇', 4, 1657), +(12035, '沿江乡', 4, 1657), +(12036, '泉阳镇', 4, 1657), +(12037, '漫江镇', 4, 1657), +(12038, '露水河镇', 4, 1657), +(12039, '城墙街道', 4, 1658), +(12040, '大石人镇', 4, 1658), +(12041, '大阳岔镇', 4, 1658), +(12042, '孙家堡子街道', 4, 1658), +(12043, '松树镇', 4, 1658), +(12044, '正岔街道', 4, 1658), +(12045, '江源街道', 4, 1658), +(12046, '湾沟镇', 4, 1658), +(12047, '石人镇', 4, 1658), +(12048, '砟子镇', 4, 1658), +(12049, '八道沟镇', 4, 1659), +(12050, '十二道沟乡', 4, 1659), +(12051, '十四道沟镇', 4, 1659), +(12052, '宝泉山镇', 4, 1659), +(12053, '新房子镇', 4, 1659), +(12054, '金华乡', 4, 1659), +(12055, '长白镇', 4, 1659), +(12056, '马鹿沟镇', 4, 1659), +(12057, '三道湖镇', 4, 1660), +(12058, '景山镇', 4, 1660), +(12059, '濛江乡', 4, 1660), +(12060, '花园口镇', 4, 1660), +(12061, '赤松乡', 4, 1660), +(12062, '那尔轰镇', 4, 1660), +(12063, '靖宇镇', 4, 1660), +(12064, '龙泉镇', 4, 1660), +(12065, '严字乡', 4, 1661), +(12066, '干安镇', 4, 1661), +(12067, '干水工业集中区', 4, 1661), +(12068, '余字乡', 4, 1661), +(12069, '大布苏工业园区', 4, 1661), +(12070, '大布苏镇', 4, 1661), +(12071, '安字镇', 4, 1661), +(12072, '所字镇', 4, 1661), +(12073, '水字镇', 4, 1661), +(12074, '让字镇', 4, 1661), +(12075, '赞字乡', 4, 1661), +(12076, '道字乡', 4, 1661), +(12077, '鳞字农业特色园区', 4, 1661), +(12078, '东三家子乡', 4, 1662), +(12079, '乌兰图嘎镇', 4, 1662), +(12080, '乌兰塔拉乡', 4, 1662), +(12081, '八郎镇', 4, 1662), +(12082, '前郭尔罗斯镇', 4, 1662), +(12083, '吉拉吐乡', 4, 1662), +(12084, '哈拉毛都镇', 4, 1662), +(12085, '国营八郎农场', 4, 1662), +(12086, '大山乡', 4, 1662), +(12087, '套浩太乡', 4, 1662), +(12088, '宝甸乡', 4, 1662), +(12089, '平凤乡', 4, 1662), +(12090, '查干湖旅游经济开发区', 4, 1662), +(12091, '查干花镇', 4, 1662); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12092, '洪泉乡', 4, 1662), +(12093, '浩特芒哈乡', 4, 1662), +(12094, '海渤日戈镇', 4, 1662), +(12095, '王府站镇', 4, 1662), +(12096, '白依拉嘎乡', 4, 1662), +(12097, '红光农场', 4, 1662), +(12098, '红旗农场', 4, 1662), +(12099, '莲花农场', 4, 1662), +(12100, '蒙古艾里乡', 4, 1662), +(12101, '达里巴乡', 4, 1662), +(12102, '长山镇', 4, 1662), +(12103, '长龙乡', 4, 1662), +(12104, '临江街道', 4, 1663), +(12105, '伯都乡', 4, 1663), +(12106, '兴原乡', 4, 1663), +(12107, '前进街道', 4, 1663), +(12108, '和平街道', 4, 1663), +(12109, '善友镇', 4, 1663), +(12110, '团结街道', 4, 1663), +(12111, '大洼镇', 4, 1663), +(12112, '工农街道', 4, 1663), +(12113, '建设街道', 4, 1663), +(12114, '文化街道', 4, 1663), +(12115, '新区街道', 4, 1663), +(12116, '新城乡', 4, 1663), +(12117, '毛都站镇', 4, 1663), +(12118, '民主街道', 4, 1663), +(12119, '沿江街道', 4, 1663), +(12120, '石化街道', 4, 1663), +(12121, '繁荣街道', 4, 1663), +(12122, '铁西街道', 4, 1663), +(12123, '三井子镇', 4, 1664), +(12124, '三岔河镇', 4, 1664), +(12125, '三骏乡', 4, 1664), +(12126, '五家站镇', 4, 1664), +(12127, '伊家店乡', 4, 1664), +(12128, '增盛镇', 4, 1664), +(12129, '大林子镇', 4, 1664), +(12130, '弓棚子镇', 4, 1664), +(12131, '新万发镇', 4, 1664), +(12132, '新源镇', 4, 1664), +(12133, '新站乡', 4, 1664), +(12134, '更新乡', 4, 1664), +(12135, '永平乡', 4, 1664), +(12136, '社里乡', 4, 1664), +(12137, '肖家乡', 4, 1664), +(12138, '蔡家沟镇', 4, 1664), +(12139, '长春岭镇', 4, 1664), +(12140, '陶赖昭镇', 4, 1664), +(12141, '三青山镇', 4, 1665), +(12142, '太平川镇', 4, 1665), +(12143, '长岭镇', 4, 1665), +(12144, '两家子镇', 4, 1666), +(12145, '丰收镇', 4, 1666), +(12146, '临江街道', 4, 1666), +(12147, '乐胜乡', 4, 1666), +(12148, '光明街道', 4, 1666), +(12149, '原古城乡', 4, 1666), +(12150, '原大榆树乡', 4, 1666), +(12151, '原来福乡', 4, 1666), +(12152, '原西大洼乡', 4, 1666); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12153, '叉干镇', 4, 1666), +(12154, '四棵树乡', 4, 1666), +(12155, '大岗子镇', 4, 1666), +(12156, '大赉乡', 4, 1666), +(12157, '太山镇', 4, 1666), +(12158, '安北街道', 4, 1666), +(12159, '安平街道', 4, 1666), +(12160, '安广镇', 4, 1666), +(12161, '慧阳街道', 4, 1666), +(12162, '文化街道', 4, 1666), +(12163, '新平安镇', 4, 1666), +(12164, '新艾里蒙古族乡', 4, 1666), +(12165, '月亮泡镇', 4, 1666), +(12166, '海坨乡', 4, 1666), +(12167, '烧锅镇乡', 4, 1666), +(12168, '红岗子乡', 4, 1666), +(12169, '联合乡', 4, 1666), +(12170, '舍力镇', 4, 1666), +(12171, '锦华街道', 4, 1666), +(12172, '长虹街道', 4, 1666), +(12173, '龙沼镇', 4, 1666), +(12174, '龙泉街道', 4, 1666), +(12175, '三合乡', 4, 1667), +(12176, '东胜乡', 4, 1667), +(12177, '东风乡', 4, 1667), +(12178, '保平街道', 4, 1667), +(12179, '城南街道', 4, 1667), +(12180, '岭下镇', 4, 1667), +(12181, '平台镇', 4, 1667), +(12182, '平安镇', 4, 1667), +(12183, '幸福街道', 4, 1667), +(12184, '德顺蒙古族乡', 4, 1667), +(12185, '新华街道', 4, 1667), +(12186, '新立街道', 4, 1667), +(12187, '林海镇', 4, 1667), +(12188, '洮河镇', 4, 1667), +(12189, '海明街道', 4, 1667), +(12190, '瑞光街道', 4, 1667), +(12191, '金祥乡', 4, 1667), +(12192, '铁东街道', 4, 1667), +(12193, '长庆街道', 4, 1667), +(12194, '青山镇', 4, 1667), +(12195, '万宝乡', 4, 1668), +(12196, '万宝镇', 4, 1668), +(12197, '东升乡', 4, 1668), +(12198, '二龙乡', 4, 1668), +(12199, '光明街道', 4, 1668), +(12200, '兴隆街道', 4, 1668), +(12201, '向阳街道', 4, 1668), +(12202, '呼和车力蒙古族乡', 4, 1668), +(12203, '团结街道', 4, 1668), +(12204, '大通乡', 4, 1668), +(12205, '安定镇', 4, 1668), +(12206, '富文街道', 4, 1668), +(12207, '永康街道', 4, 1668), +(12208, '永茂乡', 4, 1668), +(12209, '洮府街道', 4, 1668), +(12210, '瓦房镇', 4, 1668), +(12211, '福顺乡', 4, 1668), +(12212, '聚宝乡', 4, 1668), +(12213, '胡力吐蒙古族乡', 4, 1668); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12214, '蛟流河乡', 4, 1668), +(12215, '通达街道', 4, 1668), +(12216, '那金镇', 4, 1668), +(12217, '野马乡', 4, 1668), +(12218, '黑水镇', 4, 1668), +(12219, '乌兰花镇', 4, 1669), +(12220, '八面乡', 4, 1669), +(12221, '兴隆山镇', 4, 1669), +(12222, '包拉温都蒙古族乡', 4, 1669), +(12223, '十花道乡', 4, 1669), +(12224, '双岗镇', 4, 1669), +(12225, '向海蒙古族乡', 4, 1669), +(12226, '团结乡', 4, 1669), +(12227, '开通镇', 4, 1669), +(12228, '新兴乡', 4, 1669), +(12229, '新华镇', 4, 1669), +(12230, '新发乡', 4, 1669), +(12231, '瞻榆镇', 4, 1669), +(12232, '苏公坨乡', 4, 1669), +(12233, '边昭镇', 4, 1669), +(12234, '鸿兴镇', 4, 1669), +(12235, '东屏镇', 4, 1670), +(12236, '丹岱乡', 4, 1670), +(12237, '五棵树镇', 4, 1670), +(12238, '保民乡', 4, 1670), +(12239, '到保镇', 4, 1670), +(12240, '哈吐气蒙古族乡', 4, 1670), +(12241, '嘎什根乡', 4, 1670), +(12242, '坦途镇', 4, 1670), +(12243, '大屯镇', 4, 1670), +(12244, '建平乡', 4, 1670), +(12245, '沿江镇', 4, 1670), +(12246, '胜利乡', 4, 1670), +(12247, '英华乡', 4, 1670), +(12248, '莫莫格蒙古族乡', 4, 1670), +(12249, '镇赉镇', 4, 1670), +(12250, '黑鱼泡镇', 4, 1670), +(12251, '东城镇', 4, 1671), +(12252, '光明街道', 4, 1671), +(12253, '八家子林业局', 4, 1671), +(12254, '八家子镇', 4, 1671), +(12255, '南坪镇', 4, 1671), +(12256, '和龙市林业局', 4, 1671), +(12257, '境内还有和龙林业局', 4, 1671), +(12258, '头道镇', 4, 1671), +(12259, '崇善镇', 4, 1671), +(12260, '文化街道', 4, 1671), +(12261, '民惠街道', 4, 1671), +(12262, '福洞镇', 4, 1671), +(12263, '西城镇', 4, 1671), +(12264, '龙城镇', 4, 1671), +(12265, '凉水镇', 4, 1672), +(12266, '向上街道', 4, 1672), +(12267, '新华街道', 4, 1672), +(12268, '月宫街道', 4, 1672), +(12269, '月晴镇', 4, 1672), +(12270, '石砚镇', 4, 1672), +(12271, '长安镇', 4, 1672), +(12272, '万宝镇', 4, 1673), +(12273, '两江镇', 4, 1673), +(12274, '二道白河镇', 4, 1673); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12275, '亮兵镇', 4, 1673), +(12276, '新合乡', 4, 1673), +(12277, '明月镇', 4, 1673), +(12278, '松江镇', 4, 1673), +(12279, '永庆乡', 4, 1673), +(12280, '石门镇', 4, 1673), +(12281, '三道湾镇', 4, 1674), +(12282, '依兰镇', 4, 1674), +(12283, '公园街道', 4, 1674), +(12284, '北山街道', 4, 1674), +(12285, '小营镇', 4, 1674), +(12286, '建工街道', 4, 1674), +(12287, '新兴街道', 4, 1674), +(12288, '朝阳街道', 4, 1674), +(12289, '河南街道', 4, 1674), +(12290, '丹江街道', 4, 1675), +(12291, '大桥乡', 4, 1675), +(12292, '大石头镇', 4, 1675), +(12293, '大蒲柴河镇', 4, 1675), +(12294, '官地镇', 4, 1675), +(12295, '民主街道', 4, 1675), +(12296, '江南镇', 4, 1675), +(12297, '江源镇', 4, 1675), +(12298, '沙河沿镇', 4, 1675), +(12299, '渤海街道', 4, 1675), +(12300, '秋梨沟镇', 4, 1675), +(12301, '红石乡', 4, 1675), +(12302, '翰章乡', 4, 1675), +(12303, '胜利街道', 4, 1675), +(12304, '贤儒镇', 4, 1675), +(12305, '雁鸣湖镇', 4, 1675), +(12306, '青沟子乡', 4, 1675), +(12307, '额穆镇', 4, 1675), +(12308, '黄泥河镇', 4, 1675), +(12309, '黑石乡', 4, 1675), +(12310, '东光镇', 4, 1676), +(12311, '复兴镇', 4, 1676), +(12312, '大兴沟镇', 4, 1676), +(12313, '天桥岭镇', 4, 1676), +(12314, '春阳镇', 4, 1676), +(12315, '汪清镇', 4, 1676), +(12316, '百草沟镇', 4, 1676), +(12317, '罗子沟镇', 4, 1676), +(12318, '鸡冠乡', 4, 1676), +(12319, '三家子满族乡', 4, 1677), +(12320, '哈达门乡', 4, 1677), +(12321, '密江乡', 4, 1677), +(12322, '敬信镇', 4, 1677), +(12323, '新安街道', 4, 1677), +(12324, '春化镇', 4, 1677), +(12325, '杨泡满族乡', 4, 1677), +(12326, '板石镇', 4, 1677), +(12327, '河南街道', 4, 1677), +(12328, '英安镇', 4, 1677), +(12329, '近海街道', 4, 1677), +(12330, '靖和街道', 4, 1677), +(12331, '马川子乡', 4, 1677), +(12332, '三合镇', 4, 1678), +(12333, '东盛涌镇', 4, 1678), +(12334, '安民街道', 4, 1678), +(12335, '开山屯镇', 4, 1678), +(12336, '德新乡', 4, 1678); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12337, '智新镇', 4, 1678), +(12338, '朝阳川镇', 4, 1678), +(12339, '白金乡', 4, 1678), +(12340, '老头沟镇', 4, 1678), +(12341, '龙门街道', 4, 1678), +(12342, '二河乡', 4, 1679), +(12343, '五常镇', 4, 1679), +(12344, '八家子乡', 4, 1679), +(12345, '兴盛乡', 4, 1679), +(12346, '兴隆乡', 4, 1679), +(12347, '冲河镇', 4, 1679), +(12348, '卫国乡', 4, 1679), +(12349, '向阳镇', 4, 1679), +(12350, '安家镇', 4, 1679), +(12351, '小山子镇', 4, 1679), +(12352, '山河镇', 4, 1679), +(12353, '常堡乡', 4, 1679), +(12354, '志广乡', 4, 1679), +(12355, '拉林满族镇', 4, 1679), +(12356, '杜家镇', 4, 1679), +(12357, '民乐朝鲜族乡', 4, 1679), +(12358, '民意乡', 4, 1679), +(12359, '沙河子镇', 4, 1679), +(12360, '牛家满族镇', 4, 1679), +(12361, '红旗满族乡', 4, 1679), +(12362, '背荫河镇', 4, 1679), +(12363, '营城子满族乡', 4, 1679), +(12364, '长山乡', 4, 1679), +(12365, '龙凤山乡', 4, 1679), +(12366, '三道岗镇', 4, 1680), +(12367, '依兰镇', 4, 1680), +(12368, '团山子乡', 4, 1680), +(12369, '宏克利镇', 4, 1680), +(12370, '愚公乡', 4, 1680), +(12371, '江湾镇', 4, 1680), +(12372, '达连河镇', 4, 1680), +(12373, '迎兰朝鲜族乡', 4, 1680), +(12374, '道台桥镇', 4, 1680), +(12375, '七政街道', 4, 1681), +(12376, '保健路街道', 4, 1681), +(12377, '先锋路街道', 4, 1681), +(12378, '和兴路街道', 4, 1681), +(12379, '哈西街道', 4, 1681), +(12380, '大成街道', 4, 1681), +(12381, '奋斗路街道', 4, 1681), +(12382, '文化街道', 4, 1681), +(12383, '新春街道', 4, 1681), +(12384, '曲线街道', 4, 1681), +(12385, '松花江街道', 4, 1681), +(12386, '燎原街道', 4, 1681), +(12387, '王岗镇', 4, 1681), +(12388, '红旗满族乡', 4, 1681), +(12389, '芦家街道', 4, 1681), +(12390, '花园街道', 4, 1681), +(12391, '荣市街道', 4, 1681), +(12392, '跃进乡', 4, 1681), +(12393, '通达街道', 4, 1681), +(12394, '革新街道', 4, 1681), +(12395, '万隆乡', 4, 1682), +(12396, '东官镇', 4, 1682), +(12397, '临江乡', 4, 1682); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12398, '乐群满族乡', 4, 1682), +(12399, '五家镇', 4, 1682), +(12400, '公正满族乡', 4, 1682), +(12401, '兰棱镇', 4, 1682), +(12402, '农丰满族锡伯族镇', 4, 1682), +(12403, '单城镇', 4, 1682), +(12404, '双城市社区管理委员会', 4, 1682), +(12405, '双城镇', 4, 1682), +(12406, '同心满族乡', 4, 1682), +(12407, '周家镇', 4, 1682), +(12408, '团结满族乡', 4, 1682), +(12409, '希勤满族乡', 4, 1682), +(12410, '幸福满族乡', 4, 1682), +(12411, '新兴满族乡', 4, 1682), +(12412, '朝阳乡', 4, 1682), +(12413, '杏山镇', 4, 1682), +(12414, '水泉乡', 4, 1682), +(12415, '永胜乡', 4, 1682), +(12416, '联兴满族乡', 4, 1682), +(12417, '金城乡', 4, 1682), +(12418, '青岭满族乡', 4, 1682), +(12419, '韩甸镇', 4, 1682), +(12420, '二八镇', 4, 1683), +(12421, '兰河街道', 4, 1683), +(12422, '利民街道', 4, 1683), +(12423, '双井镇', 4, 1683), +(12424, '呼兰街道', 4, 1683), +(12425, '大用镇', 4, 1683), +(12426, '孟家乡', 4, 1683), +(12427, '康金镇', 4, 1683), +(12428, '方台镇', 4, 1683), +(12429, '杨林乡', 4, 1683), +(12430, '沈家镇', 4, 1683), +(12431, '白奎镇', 4, 1683), +(12432, '石人镇', 4, 1683), +(12433, '腰堡街道', 4, 1683), +(12434, '莲花镇', 4, 1683), +(12435, '许堡乡', 4, 1683), +(12436, '长岭镇', 4, 1683), +(12437, '兆麟街道', 4, 1684), +(12438, '共乐街道', 4, 1684), +(12439, '城乡路街道', 4, 1684), +(12440, '太平镇', 4, 1684), +(12441, '安和街道', 4, 1684), +(12442, '安静街道', 4, 1684), +(12443, '尚志街道', 4, 1684), +(12444, '工农街道', 4, 1684), +(12445, '工程街道', 4, 1684), +(12446, '康安街道', 4, 1684), +(12447, '建国街道', 4, 1684), +(12448, '抚顺街道', 4, 1684), +(12449, '斯大林街道', 4, 1684), +(12450, '新农镇', 4, 1684), +(12451, '新华街道', 4, 1684), +(12452, '新发镇', 4, 1684), +(12453, '新阳路街道', 4, 1684), +(12454, '榆树镇', 4, 1684), +(12455, '正阳河街道', 4, 1684), +(12456, '经纬街道', 4, 1684), +(12457, '群力乡', 4, 1684); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12458, '通江街道', 4, 1684), +(12459, '三宝乡', 4, 1685), +(12460, '宁远镇', 4, 1685), +(12461, '宾安镇', 4, 1685), +(12462, '宾州镇', 4, 1685), +(12463, '宾西镇', 4, 1685), +(12464, '居仁镇', 4, 1685), +(12465, '常安镇', 4, 1685), +(12466, '平坊镇', 4, 1685), +(12467, '摆渡镇', 4, 1685), +(12468, '新甸镇', 4, 1685), +(12469, '民和乡', 4, 1685), +(12470, '永和乡', 4, 1685), +(12471, '满井镇', 4, 1685), +(12472, '糖坊镇', 4, 1685), +(12473, '经建乡', 4, 1685), +(12474, '胜利镇', 4, 1685), +(12475, '鸟河乡', 4, 1685), +(12476, '一面坡镇', 4, 1686), +(12477, '乌吉密乡', 4, 1686), +(12478, '亚布力镇', 4, 1686), +(12479, '亮河镇', 4, 1686), +(12480, '元宝镇', 4, 1686), +(12481, '尚志镇', 4, 1686), +(12482, '帽儿山镇', 4, 1686), +(12483, '庆阳镇', 4, 1686), +(12484, '河东朝鲜族乡', 4, 1686), +(12485, '珍珠山乡', 4, 1686), +(12486, '石头河子镇', 4, 1686), +(12487, '老街基乡', 4, 1686), +(12488, '苇河镇', 4, 1686), +(12489, '长寿乡', 4, 1686), +(12490, '马延乡', 4, 1686), +(12491, '鱼池朝鲜族乡', 4, 1686), +(12492, '黑龙宫镇', 4, 1686), +(12493, '万发镇', 4, 1687), +(12494, '丰乐乡', 4, 1687), +(12495, '兴隆镇', 4, 1687), +(12496, '华山乡', 4, 1687), +(12497, '天增镇', 4, 1687), +(12498, '富江乡', 4, 1687), +(12499, '山后乡', 4, 1687), +(12500, '巴彦港镇', 4, 1687), +(12501, '巴彦镇', 4, 1687), +(12502, '德祥乡', 4, 1687), +(12503, '松花江乡', 4, 1687), +(12504, '洼兴镇', 4, 1687), +(12505, '红光乡', 4, 1687), +(12506, '西集镇', 4, 1687), +(12507, '镇东乡', 4, 1687), +(12508, '黑山镇', 4, 1687), +(12509, '龙庙镇', 4, 1687), +(12510, '龙泉镇', 4, 1687), +(12511, '保国街道', 4, 1688), +(12512, '兴建街道', 4, 1688), +(12513, '友协街道', 4, 1688), +(12514, '平房镇', 4, 1688), +(12515, '平新镇', 4, 1688), +(12516, '新伟街道', 4, 1688), +(12517, '新疆街道', 4, 1688), +(12518, '联盟街道', 4, 1688), +(12519, '中和镇', 4, 1689), +(12520, '六团镇', 4, 1689); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12521, '加信镇', 4, 1689), +(12522, '安山乡', 4, 1689), +(12523, '寿山乡', 4, 1689), +(12524, '延寿镇', 4, 1689), +(12525, '延河镇', 4, 1689), +(12526, '玉河乡', 4, 1689), +(12527, '青川乡', 4, 1689), +(12528, '伊汉通乡', 4, 1690), +(12529, '会发镇', 4, 1690), +(12530, '大罗密镇', 4, 1690), +(12531, '天门乡', 4, 1690), +(12532, '宝兴乡', 4, 1690), +(12533, '德善乡', 4, 1690), +(12534, '方正镇', 4, 1690), +(12535, '松南乡', 4, 1690), +(12536, '东兴镇', 4, 1691), +(12537, '利东镇', 4, 1691), +(12538, '吉兴乡', 4, 1691), +(12539, '大贵镇', 4, 1691), +(12540, '建国乡', 4, 1691), +(12541, '新民镇', 4, 1691), +(12542, '木兰镇', 4, 1691), +(12543, '柳河镇', 4, 1691), +(12544, '万宝街道', 4, 1692), +(12545, '三电街道', 4, 1692), +(12546, '乐业镇', 4, 1692), +(12547, '太阳岛街道', 4, 1692), +(12548, '对青山镇', 4, 1692), +(12549, '松北街道', 4, 1692), +(12550, '松浦街道', 4, 1692), +(12551, '三站乡', 4, 1693), +(12552, '乌鸦泡镇', 4, 1693), +(12553, '凤山镇', 4, 1693), +(12554, '富林乡', 4, 1693), +(12555, '浓河镇', 4, 1693), +(12556, '清河镇', 4, 1693), +(12557, '祥顺镇', 4, 1693), +(12558, '通河镇', 4, 1693), +(12559, '三棵树大街街道', 4, 1694), +(12560, '东原街道', 4, 1694), +(12561, '东莱街道', 4, 1694), +(12562, '仁里街道', 4, 1694), +(12563, '化工街道', 4, 1694), +(12564, '南直路街道', 4, 1694), +(12565, '南马街道', 4, 1694), +(12566, '团结镇', 4, 1694), +(12567, '大兴街道', 4, 1694), +(12568, '大有坊街道', 4, 1694), +(12569, '太古街道', 4, 1694), +(12570, '太平大街街道', 4, 1694), +(12571, '崇俭街道', 4, 1694), +(12572, '巨源镇', 4, 1694), +(12573, '振江街道', 4, 1694), +(12574, '新一街道', 4, 1694), +(12575, '新乐街道', 4, 1694), +(12576, '民主乡', 4, 1694), +(12577, '民强街道', 4, 1694), +(12578, '水泥路街道', 4, 1694), +(12579, '永源镇', 4, 1694), +(12580, '滨江街道', 4, 1694), +(12581, '火车头街道', 4, 1694), +(12582, '胜利街道', 4, 1694); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12583, '青年农场', 4, 1694), +(12584, '靖宇街道', 4, 1694), +(12585, '黎华街道', 4, 1694), +(12586, '亚沟镇', 4, 1695), +(12587, '交界镇', 4, 1695), +(12588, '双丰镇', 4, 1695), +(12589, '和平街道', 4, 1695), +(12590, '大岭乡', 4, 1695), +(12591, '小岭镇', 4, 1695), +(12592, '巨源镇', 4, 1695), +(12593, '平山镇', 4, 1695), +(12594, '料甸满族乡', 4, 1695), +(12595, '新华镇', 4, 1695), +(12596, '杨树乡', 4, 1695), +(12597, '松峰山镇', 4, 1695), +(12598, '永源镇', 4, 1695), +(12599, '河东街道', 4, 1695), +(12600, '玉泉镇', 4, 1695), +(12601, '红星乡', 4, 1695), +(12602, '胜利街道', 4, 1695), +(12603, '舍利乡', 4, 1695), +(12604, '蜚克图镇', 4, 1695), +(12605, '通城街道', 4, 1695), +(12606, '阿什河街道', 4, 1695), +(12607, '六顺街道', 4, 1696), +(12608, '向阳乡', 4, 1696), +(12609, '安埠街道', 4, 1696), +(12610, '幸福镇', 4, 1696), +(12611, '成高子镇', 4, 1696), +(12612, '新成街道', 4, 1696), +(12613, '新香坊街道', 4, 1696), +(12614, '红旗街道', 4, 1696), +(12615, '通天街道', 4, 1696), +(12616, '铁东街道', 4, 1696), +(12617, '香坊大街街道', 4, 1696), +(12618, '三兴镇', 4, 1697), +(12619, '上游乡', 4, 1697), +(12620, '中心镇', 4, 1697), +(12621, '依安农场', 4, 1697), +(12622, '依安镇', 4, 1697), +(12623, '依龙镇', 4, 1697), +(12624, '先锋乡', 4, 1697), +(12625, '双阳镇', 4, 1697), +(12626, '太东乡', 4, 1697), +(12627, '富饶乡', 4, 1697), +(12628, '新兴乡', 4, 1697), +(12629, '新发乡', 4, 1697), +(12630, '新屯乡', 4, 1697), +(12631, '红星乡', 4, 1697), +(12632, '解放乡', 4, 1697), +(12633, '阳春乡', 4, 1697), +(12634, '干丰镇', 4, 1698), +(12635, '克东镇', 4, 1698), +(12636, '宝泉镇', 4, 1698), +(12637, '昌盛乡', 4, 1698), +(12638, '润津乡', 4, 1698), +(12639, '玉岗镇', 4, 1698), +(12640, '金城乡', 4, 1698), +(12641, '克山农场', 4, 1699), +(12642, '克山镇', 4, 1699), +(12643, '北兴镇', 4, 1699), +(12644, '北联镇', 4, 1699), +(12645, '双河乡', 4, 1699); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12646, '发展乡', 4, 1699), +(12647, '古北乡', 4, 1699), +(12648, '古城镇', 4, 1699), +(12649, '向华乡', 4, 1699), +(12650, '曙光乡', 4, 1699), +(12651, '河北乡', 4, 1699), +(12652, '河南乡', 4, 1699), +(12653, '西城镇', 4, 1699), +(12654, '西建乡', 4, 1699), +(12655, '西河镇', 4, 1699), +(12656, '西联乡', 4, 1699), +(12657, '北兴街道', 4, 1700), +(12658, '幸福街道', 4, 1700), +(12659, '杜尔门沁达斡尔族乡', 4, 1700), +(12660, '沿江街道', 4, 1700), +(12661, '电力街道', 4, 1700), +(12662, '红宝石街道', 4, 1700), +(12663, '红岸街道', 4, 1700), +(12664, '铁北街道', 4, 1700), +(12665, '长青乡', 4, 1700), +(12666, '二道湾镇', 4, 1701), +(12667, '友谊达斡尔族满族柯尔克孜族乡', 4, 1701), +(12668, '塔哈满族达斡尔族乡', 4, 1701), +(12669, '富海镇', 4, 1701), +(12670, '富裕镇', 4, 1701), +(12671, '富路镇', 4, 1701), +(12672, '忠厚乡', 4, 1701), +(12673, '繁荣乡', 4, 1701), +(12674, '绍文乡', 4, 1701), +(12675, '龙安桥镇', 4, 1701), +(12676, '中华街道', 4, 1702), +(12677, '卜奎街道', 4, 1702), +(12678, '建设街道', 4, 1702), +(12679, '文化街道', 4, 1702), +(12680, '西大桥街道', 4, 1702), +(12681, '三道镇', 4, 1703), +(12682, '上升乡', 4, 1703), +(12683, '丰产乡', 4, 1703), +(12684, '兴农镇', 4, 1703), +(12685, '兴华乡', 4, 1703), +(12686, '兴国乡', 4, 1703), +(12687, '国富镇', 4, 1703), +(12688, '大众乡', 4, 1703), +(12689, '富强镇', 4, 1703), +(12690, '拜泉镇', 4, 1703), +(12691, '新生乡', 4, 1703), +(12692, '时中乡', 4, 1703), +(12693, '永勤乡', 4, 1703), +(12694, '爱农乡', 4, 1703), +(12695, '长春镇', 4, 1703), +(12696, '龙泉镇', 4, 1703), +(12697, '三间房镇', 4, 1704), +(12698, '新兴街道', 4, 1704), +(12699, '新建街道', 4, 1704), +(12700, '林机街道', 4, 1704), +(12701, '水师营满族镇', 4, 1704), +(12702, '道北街道', 4, 1704), +(12703, '共和镇', 4, 1705), +(12704, '卧牛吐达斡尔族镇', 4, 1705), +(12705, '哈拉海农场', 4, 1705); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12706, '梅里斯乡', 4, 1705), +(12707, '梅里斯街道', 4, 1705), +(12708, '莽格吐达斡尔族乡', 4, 1705), +(12709, '达呼店镇', 4, 1705), +(12710, '雅尔塞镇', 4, 1705), +(12711, '克利镇', 4, 1706), +(12712, '和平镇', 4, 1706), +(12713, '塔子城镇', 4, 1706), +(12714, '大兴镇', 4, 1706), +(12715, '宁姜蒙古族乡', 4, 1706), +(12716, '平洋镇', 4, 1706), +(12717, '江桥蒙古族镇', 4, 1706), +(12718, '汤池镇', 4, 1706), +(12719, '泰来镇', 4, 1706), +(12720, '胜利蒙古族乡', 4, 1706), +(12721, '东阳镇', 4, 1707), +(12722, '中兴乡', 4, 1707), +(12723, '兴隆乡', 4, 1707), +(12724, '宝山乡', 4, 1707), +(12725, '巨宝镇', 4, 1707), +(12726, '平阳镇', 4, 1707), +(12727, '查哈阳乡', 4, 1707), +(12728, '甘南镇', 4, 1707), +(12729, '长山乡', 4, 1707), +(12730, '音河镇', 4, 1707), +(12731, '东安街道', 4, 1708), +(12732, '富强街道', 4, 1708), +(12733, '繁荣街道', 4, 1708), +(12734, '跃进街道', 4, 1708), +(12735, '九井镇', 4, 1709), +(12736, '二克浅镇', 4, 1709), +(12737, '六合镇', 4, 1709), +(12738, '兴旺鄂温克族乡', 4, 1709), +(12739, '同义镇', 4, 1709), +(12740, '同心乡', 4, 1709), +(12741, '和盛乡', 4, 1709), +(12742, '孔国乡', 4, 1709), +(12743, '学田镇', 4, 1709), +(12744, '拉哈镇、', 4, 1709), +(12745, '老莱镇', 4, 1709), +(12746, '讷南镇', 4, 1709), +(12747, '讷河镇', 4, 1709), +(12748, '通南镇', 4, 1709), +(12749, '长发镇', 4, 1709), +(12750, '龙河镇', 4, 1709), +(12751, '东湖街道', 4, 1710), +(12752, '光荣街道', 4, 1710), +(12753, '北局宅街道', 4, 1710), +(12754, '南浦街道', 4, 1710), +(12755, '扎龙乡', 4, 1710), +(12756, '站前街道', 4, 1710), +(12757, '通东街道', 4, 1710), +(12758, '龙华街道', 4, 1710), +(12759, '七棵树镇', 4, 1711), +(12760, '华民乡', 4, 1711), +(12761, '哈拉海乡', 4, 1711), +(12762, '头站乡', 4, 1711), +(12763, '山泉镇', 4, 1711), +(12764, '广厚乡', 4, 1711), +(12765, '景星镇', 4, 1711), +(12766, '杏山乡', 4, 1711), +(12767, '济沁河乡', 4, 1711); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12768, '白山乡', 4, 1711), +(12769, '鲁河乡', 4, 1711), +(12770, '黑岗乡', 4, 1711), +(12771, '龙兴镇', 4, 1711), +(12772, '龙江镇', 4, 1711), +(12773, '五龙街道', 4, 1712), +(12774, '南航街道', 4, 1712), +(12775, '彩虹街道', 4, 1712), +(12776, '正阳街道', 4, 1712), +(12777, '江安街道', 4, 1712), +(12778, '湖滨街道', 4, 1712), +(12779, '东海街道', 4, 1713), +(12780, '城子河街道', 4, 1713), +(12781, '城西街道', 4, 1713), +(12782, '杏花街道', 4, 1713), +(12783, '正阳街道', 4, 1713), +(12784, '永丰朝鲜族乡', 4, 1713), +(12785, '长青乡', 4, 1713), +(12786, '二人班乡', 4, 1714), +(12787, '兴凯湖朝鲜族乡', 4, 1714), +(12788, '兴凯镇', 4, 1714), +(12789, '和平乡', 4, 1714), +(12790, '太平乡', 4, 1714), +(12791, '密山镇', 4, 1714), +(12792, '富源乡', 4, 1714), +(12793, '当壁镇', 4, 1714), +(12794, '承紫河乡', 4, 1714), +(12795, '杨木乡', 4, 1714), +(12796, '柳毛乡', 4, 1714), +(12797, '白泡子乡', 4, 1714), +(12798, '知一镇', 4, 1714), +(12799, '裴德镇', 4, 1714), +(12800, '连珠山镇', 4, 1714), +(12801, '黑台镇', 4, 1714), +(12802, '二道河子街道', 4, 1715), +(12803, '大恒山街道', 4, 1715), +(12804, '奋斗街道', 4, 1715), +(12805, '小恒山街道', 4, 1715), +(12806, '张新街道', 4, 1715), +(12807, '柳毛乡', 4, 1715), +(12808, '柳毛街道', 4, 1715), +(12809, '桦木林街道', 4, 1715), +(12810, '红旗乡', 4, 1715), +(12811, '平岗街道', 4, 1716), +(12812, '石磷街道', 4, 1716), +(12813, '碱场街道', 4, 1716), +(12814, '穆棱街道', 4, 1716), +(12815, '街里街道', 4, 1716), +(12816, '东兴街道', 4, 1717), +(12817, '兰岭乡', 4, 1717), +(12818, '大通沟街道', 4, 1717), +(12819, '洗煤街道', 4, 1717), +(12820, '滴道河乡', 4, 1717), +(12821, '矿里街道', 4, 1717), +(12822, '东方红镇', 4, 1718), +(12823, '东诚镇', 4, 1718), +(12824, '伟光乡', 4, 1718), +(12825, '宝东镇', 4, 1718), +(12826, '新乐乡', 4, 1718), +(12827, '杨岗镇', 4, 1718), +(12828, '珍宝岛乡', 4, 1718); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12829, '虎头镇', 4, 1718), +(12830, '虎林镇', 4, 1718), +(12831, '迎春镇', 4, 1718), +(12832, '阿北乡', 4, 1718), +(12833, '下亮子乡', 4, 1719), +(12834, '东海镇', 4, 1719), +(12835, '八五一零农场', 4, 1719), +(12836, '兴农镇', 4, 1719), +(12837, '向阳镇', 4, 1719), +(12838, '哈达镇', 4, 1719), +(12839, '平阳镇', 4, 1719), +(12840, '明德朝鲜族乡', 4, 1719), +(12841, '永和镇', 4, 1719), +(12842, '永安镇', 4, 1719), +(12843, '鸡东镇', 4, 1719), +(12844, '鸡林朝鲜族乡', 4, 1719), +(12845, '东风街道', 4, 1720), +(12846, '南山街道', 4, 1720), +(12847, '向阳街道', 4, 1720), +(12848, '立新街道', 4, 1720), +(12849, '红军路街道', 4, 1720), +(12850, '红星乡', 4, 1720), +(12851, '西山街道', 4, 1720), +(12852, '西郊乡', 4, 1720), +(12853, '西鸡西街道', 4, 1720), +(12854, '麻山街道', 4, 1721), +(12855, '三街街道', 4, 1722), +(12856, '东山街道', 4, 1722), +(12857, '东方红乡', 4, 1722), +(12858, '工人村街道', 4, 1722), +(12859, '新一街道', 4, 1722), +(12860, '新华镇', 4, 1722), +(12861, '红旗乡', 4, 1722), +(12862, '蔬园乡', 4, 1722), +(12863, '兴安路街道', 4, 1723), +(12864, '兴建路街道', 4, 1723), +(12865, '兴长路街道', 4, 1723), +(12866, '河东路街道', 4, 1723), +(12867, '竣德路街道', 4, 1723), +(12868, '岭北街道', 4, 1724), +(12869, '岭南街道', 4, 1724), +(12870, '沟北街道', 4, 1724), +(12871, '沟南街道', 4, 1724), +(12872, '六号街道', 4, 1725), +(12873, '大陆街道', 4, 1725), +(12874, '富力街道', 4, 1725), +(12875, '铁东街道', 4, 1725), +(12876, '铁西街道', 4, 1725), +(12877, '鹿林山街道', 4, 1725), +(12878, '光明街道', 4, 1726), +(12879, '北山街道', 4, 1726), +(12880, '南翼街道', 4, 1726), +(12881, '红军街道', 4, 1726), +(12882, '胜利街道', 4, 1726), +(12883, '团结街道', 4, 1727), +(12884, '新南街道', 4, 1727), +(12885, '湖滨街道', 4, 1727), +(12886, '红旗街道', 4, 1727), +(12887, '育才街道', 4, 1727), +(12888, '解放街道', 4, 1727); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12889, '北山乡', 4, 1728), +(12890, '北岗乡', 4, 1728), +(12891, '富强乡', 4, 1728), +(12892, '忠仁镇', 4, 1728), +(12893, '新富乡', 4, 1728), +(12894, '福兴满族乡', 4, 1728), +(12895, '绥东镇', 4, 1728), +(12896, '绥滨镇', 4, 1728), +(12897, '连生乡', 4, 1728), +(12898, '东明朝鲜族乡', 4, 1729), +(12899, '凤翔镇', 4, 1729), +(12900, '名山镇', 4, 1729), +(12901, '团结镇', 4, 1729), +(12902, '太平沟乡', 4, 1729), +(12903, '环山乡', 4, 1729), +(12904, '肇兴镇', 4, 1729), +(12905, '鹤北镇', 4, 1729), +(12906, '东建乡', 4, 1730), +(12907, '兴盛乡', 4, 1730), +(12908, '兴隆镇', 4, 1730), +(12909, '友谊镇', 4, 1730), +(12910, '友邻乡', 4, 1730), +(12911, '庆丰乡', 4, 1730), +(12912, '建设乡', 4, 1730), +(12913, '成富朝鲜族满族乡', 4, 1730), +(12914, '新镇乡', 4, 1730), +(12915, '风岗镇', 4, 1730), +(12916, '龙山镇', 4, 1730), +(12917, '东荣街道', 4, 1731), +(12918, '太保镇', 4, 1731), +(12919, '振兴东路街道', 4, 1731), +(12920, '振兴中路街道', 4, 1731), +(12921, '集贤街道', 4, 1731), +(12922, '七星街道', 4, 1732), +(12923, '七星镇', 4, 1732), +(12924, '上游街道', 4, 1732), +(12925, '东保卫街道', 4, 1732), +(12926, '双阳街道', 4, 1732), +(12927, '双鸭山农场', 4, 1732), +(12928, '新安街道', 4, 1732), +(12929, '红旗街道', 4, 1732), +(12930, '跃进街道', 4, 1732), +(12931, '七星河乡', 4, 1733), +(12932, '七星泡镇', 4, 1733), +(12933, '万金山乡', 4, 1733), +(12934, '五九七农场', 4, 1733), +(12935, '八五三农场', 4, 1733), +(12936, '八五二农场', 4, 1733), +(12937, '夹信子镇', 4, 1733), +(12938, '宝清镇', 4, 1733), +(12939, '小城子镇', 4, 1733), +(12940, '尖山子乡', 4, 1733), +(12941, '朝阳乡', 4, 1733), +(12942, '青原镇', 4, 1733), +(12943, '龙头镇', 4, 1733), +(12944, '中心站街道', 4, 1734), +(12945, '二马路街道', 4, 1734), +(12946, '八马路街道', 4, 1734), +(12947, '安邦乡', 4, 1734), +(12948, '富安街道', 4, 1734), +(12949, '窑地街道', 4, 1734); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(12950, '铁西街道', 4, 1734), +(12951, '长安街道', 4, 1734), +(12952, '东山街道', 4, 1735), +(12953, '中山街道', 4, 1735), +(12954, '中心街道', 4, 1735), +(12955, '北山街道', 4, 1735), +(12956, '南山街道', 4, 1735), +(12957, '西山街道', 4, 1735), +(12958, '长胜乡', 4, 1735), +(12959, '丰乐镇', 4, 1736), +(12960, '兴安乡', 4, 1736), +(12961, '升昌镇', 4, 1736), +(12962, '太平镇', 4, 1736), +(12963, '永安乡', 4, 1736), +(12964, '福利镇', 4, 1736), +(12965, '腰屯乡', 4, 1736), +(12966, '集贤镇', 4, 1736), +(12967, '五林洞林场', 4, 1737), +(12968, '五林洞镇', 4, 1737), +(12969, '八五九农场', 4, 1737), +(12970, '四排赫哲族乡', 4, 1737), +(12971, '大佳河乡', 4, 1737), +(12972, '大通河乡', 4, 1737), +(12973, '奇源林场', 4, 1737), +(12974, '小佳河镇', 4, 1737), +(12975, '山里乡', 4, 1737), +(12976, '红卫农场', 4, 1737), +(12977, '红旗岭农场', 4, 1737), +(12978, '胜利农场', 4, 1737), +(12979, '芦源林场', 4, 1737), +(12980, '西丰镇', 4, 1737), +(12981, '西林子乡', 4, 1737), +(12982, '饶河农场', 4, 1737), +(12983, '饶河镇', 4, 1737), +(12984, '八井子乡', 4, 1738), +(12985, '双榆树乡', 4, 1738), +(12986, '和平牧场', 4, 1738), +(12987, '大同镇', 4, 1738), +(12988, '大同镇街道', 4, 1738), +(12989, '太阳升镇', 4, 1738), +(12990, '庆葡街道', 4, 1738), +(12991, '新华街道', 4, 1738), +(12992, '林源街道', 4, 1738), +(12993, '林源镇', 4, 1738), +(12994, '祝三乡', 4, 1738), +(12995, '立志街道', 4, 1738), +(12996, '老山头乡', 4, 1738), +(12997, '高台子镇', 4, 1738), +(12998, '高平街道', 4, 1738), +(12999, '一心乡', 4, 1739), +(13000, '他拉哈镇', 4, 1739), +(13001, '克尔台乡', 4, 1739), +(13002, '巴彦查干乡', 4, 1739), +(13003, '敖林西伯乡', 4, 1739), +(13004, '江湾乡', 4, 1739), +(13005, '泰康镇', 4, 1739), +(13006, '烟筒屯镇', 4, 1739), +(13007, '白音诺勒乡', 4, 1739), +(13008, '胡吉吐莫镇', 4, 1739), +(13009, '腰新乡', 4, 1739), +(13010, '三合乡', 4, 1740); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13011, '东兴乡', 4, 1740), +(13012, '四合乡', 4, 1740), +(13013, '宏伟乡', 4, 1740), +(13014, '林甸镇', 4, 1740), +(13015, '红旗镇', 4, 1740), +(13016, '花园乡', 4, 1740), +(13017, '黎明乡', 4, 1740), +(13018, '八百垧街道', 4, 1741), +(13019, '创业街道', 4, 1741), +(13020, '杏南街道', 4, 1741), +(13021, '杏树岗镇', 4, 1741), +(13022, '红岗街道', 4, 1741), +(13023, '解放街道', 4, 1741), +(13024, '丰乐镇', 4, 1742), +(13025, '二井镇', 4, 1742), +(13026, '兴城镇', 4, 1742), +(13027, '双发乡', 4, 1742), +(13028, '托古乡', 4, 1742), +(13029, '新福乡', 4, 1742), +(13030, '朝阳乡', 4, 1742), +(13031, '朝阳沟镇', 4, 1742), +(13032, '榆树乡', 4, 1742), +(13033, '永乐镇', 4, 1742), +(13034, '永胜乡', 4, 1742), +(13035, '肇州镇', 4, 1742), +(13036, '三站镇', 4, 1743), +(13037, '义顺蒙古族乡', 4, 1743), +(13038, '二站镇', 4, 1743), +(13039, '古恰乡', 4, 1743), +(13040, '古龙镇', 4, 1743), +(13041, '和平乡', 4, 1743), +(13042, '大兴乡', 4, 1743), +(13043, '头台镇', 4, 1743), +(13044, '新站镇', 4, 1743), +(13045, '民意乡', 4, 1743), +(13046, '浩德蒙古族乡', 4, 1743), +(13047, '福兴乡', 4, 1743), +(13048, '肇源镇', 4, 1743), +(13049, '茂兴镇', 4, 1743), +(13050, '薄荷台乡', 4, 1743), +(13051, '超等蒙古族乡', 4, 1743), +(13052, '乘风街道', 4, 1744), +(13053, '喇嘛甸镇', 4, 1744), +(13054, '奋斗街道', 4, 1744), +(13055, '庆新街道', 4, 1744), +(13056, '西宾街道', 4, 1744), +(13057, '银浪街道', 4, 1744), +(13058, '龙岗街道', 4, 1744), +(13059, '东安街道', 4, 1745), +(13060, '东风街道', 4, 1745), +(13061, '会战街道', 4, 1745), +(13062, '友谊街道', 4, 1745), +(13063, '富强街道', 4, 1745), +(13064, '拥军街道', 4, 1745), +(13065, '火炬街道', 4, 1745), +(13066, '萨尔图街道', 4, 1745), +(13067, '铁人街道', 4, 1745), +(13068, '三永街道', 4, 1746), +(13069, '东光街道', 4, 1746), +(13070, '兴化村街道', 4, 1746), +(13071, '卧里屯街道', 4, 1746), +(13072, '黎明街道', 4, 1746); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13073, '龙凤街道', 4, 1746), +(13074, '龙凤镇', 4, 1746), +(13075, '卫国林场', 4, 1747), +(13076, '山峰林场', 4, 1747), +(13077, '新风林场', 4, 1747), +(13078, '查山林场', 4, 1747), +(13079, '永绪经营所', 4, 1747), +(13080, '溪水经营所', 4, 1747), +(13081, '红山经营所', 4, 1747), +(13082, '红山街道', 4, 1747), +(13083, '美林经营所', 4, 1747), +(13084, '蔚兰经营所', 4, 1747), +(13085, '长青经营所', 4, 1747), +(13086, '阳光林场', 4, 1747), +(13087, '青山经营所', 4, 1747), +(13088, '上游林场', 4, 1748), +(13089, '东克林林场', 4, 1748), +(13090, '乌伊岭街道', 4, 1748), +(13091, '前卫林场', 4, 1748), +(13092, '建新林场', 4, 1748), +(13093, '林海林场', 4, 1748), +(13094, '桔源经营所', 4, 1748), +(13095, '永胜经营所', 4, 1748), +(13096, '福民林场', 4, 1748), +(13097, '移山林场', 4, 1748), +(13098, '美峰林场', 4, 1748), +(13099, '美林林场', 4, 1748), +(13100, '阿廷河林场', 4, 1748), +(13101, '东方红经营所', 4, 1749), +(13102, '乌马河街道', 4, 1749), +(13103, '伊东经营所', 4, 1749), +(13104, '伊敏林场', 4, 1749), +(13105, '伊林经营所', 4, 1749), +(13106, '伊青经营所', 4, 1749), +(13107, '前进经营所', 4, 1749), +(13108, '安全经营所', 4, 1749), +(13109, '河北经营所', 4, 1749), +(13110, '翠岭经营所', 4, 1749), +(13111, '育苗经营所', 4, 1749), +(13112, '西岭林场', 4, 1749), +(13113, '青山林场', 4, 1749), +(13114, '丽丰林场', 4, 1750), +(13115, '丽林经营所', 4, 1750), +(13116, '五星街道', 4, 1750), +(13117, '五营街道', 4, 1750), +(13118, '前丰林场', 4, 1750), +(13119, '平原经营所', 4, 1750), +(13120, '平山经营所', 4, 1750), +(13121, '杨树河林场', 4, 1750), +(13122, '永丰经营所', 4, 1750), +(13123, '翠北林场', 4, 1750), +(13124, '东升街道', 4, 1751), +(13125, '前进街道', 4, 1751), +(13126, '旭日街道', 4, 1751), +(13127, '朝阳街道', 4, 1751), +(13128, '红升街道', 4, 1751), +(13129, '三岔河林场', 4, 1752); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13130, '东升街道', 4, 1752), +(13131, '亮子河林场', 4, 1752), +(13132, '南岔经营所', 4, 1752), +(13133, '四合营林场', 4, 1752), +(13134, '大磊林场', 4, 1752), +(13135, '太平经营所', 4, 1752), +(13136, '奋斗经营所', 4, 1752), +(13137, '威岭经营所', 4, 1752), +(13138, '岩石经营所', 4, 1752), +(13139, '晨明镇', 4, 1752), +(13140, '松青经营所', 4, 1752), +(13141, '柳树经营所', 4, 1752), +(13142, '桦阳经营所', 4, 1752), +(13143, '梧桐街道', 4, 1752), +(13144, '浩良河经营所', 4, 1752), +(13145, '浩良河镇', 4, 1752), +(13146, '石头河林场', 4, 1752), +(13147, '翠岗林场', 4, 1752), +(13148, '联合街道', 4, 1752), +(13149, '西水街道', 4, 1752), +(13150, '迎春乡', 4, 1752), +(13151, '三合经营所', 4, 1753), +(13152, '东卡林场', 4, 1753), +(13153, '中心经营所', 4, 1753), +(13154, '友好街道', 4, 1753), +(13155, '友谊经营所', 4, 1753), +(13156, '双子河街道', 4, 1753), +(13157, '奋斗林场', 4, 1753), +(13158, '岭峰林场', 4, 1753), +(13159, '广川经营所', 4, 1753), +(13160, '朝阳经营所', 4, 1753), +(13161, '松园林场', 4, 1753), +(13162, '永青经营所', 4, 1753), +(13163, '碧云经营所', 4, 1753), +(13164, '绿源林场', 4, 1753), +(13165, '铁林街道', 4, 1753), +(13166, '青杨经营所', 4, 1753), +(13167, '鸡爪河林场', 4, 1753), +(13168, '乌云镇', 4, 1754), +(13169, '乌拉嘎镇', 4, 1754), +(13170, '保兴乡', 4, 1754), +(13171, '向阳乡', 4, 1754), +(13172, '嘉荫农场', 4, 1754), +(13173, '常胜乡', 4, 1754), +(13174, '朝阳镇', 4, 1754), +(13175, '沪嘉乡', 4, 1754), +(13176, '红光乡', 4, 1754), +(13177, '青山乡', 4, 1754), +(13178, '带岭街道', 4, 1755), +(13179, '青川经营所', 4, 1755), +(13180, '乌拉嘎经营所', 4, 1756), +(13181, '兴安街道', 4, 1756), +(13182, '北沟林场', 4, 1756), +(13183, '南沟林场', 4, 1756), +(13184, '新青街道', 4, 1756), +(13185, '松林经营所', 4, 1756), +(13186, '柳树河林场', 4, 1756), +(13187, '桦林林场', 4, 1756); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13188, '水源林场', 4, 1756), +(13189, '汤林林场', 4, 1756), +(13190, '泉林林场', 4, 1756), +(13191, '笑山林场', 4, 1756), +(13192, '红林经营所', 4, 1756), +(13193, '结源林场', 4, 1756), +(13194, '青林林场', 4, 1756), +(13195, '东升林场', 4, 1757), +(13196, '中心苗圃', 4, 1757), +(13197, '二清河林场', 4, 1757), +(13198, '二龙山林场', 4, 1757), +(13199, '克林经营所', 4, 1757), +(13200, '团结经营所', 4, 1757), +(13201, '守虎山林场', 4, 1757), +(13202, '峻岭林场', 4, 1757), +(13203, '日新林场', 4, 1757), +(13204, '河北街道', 4, 1757), +(13205, '河南街道', 4, 1757), +(13206, '泉石林场', 4, 1757), +(13207, '石林林场', 4, 1757), +(13208, '磨石山经营所', 4, 1757), +(13209, '育林经营所', 4, 1757), +(13210, '高峰林场', 4, 1757), +(13211, '三杨林场', 4, 1758), +(13212, '二杨河经营所', 4, 1758), +(13213, '二皮河经营所', 4, 1758), +(13214, '五星河经营所', 4, 1758), +(13215, '共青经营所', 4, 1758), +(13216, '库斯特经营所', 4, 1758), +(13217, '曙光经营所', 4, 1758), +(13218, '汤北林场', 4, 1758), +(13219, '汤南经营所', 4, 1758), +(13220, '汤洪岭林场', 4, 1758), +(13221, '清水河林场', 4, 1758), +(13222, '红星街道', 4, 1758), +(13223, '霍吉河林场', 4, 1758), +(13224, '三股流经营所', 4, 1759), +(13225, '五道库经营所', 4, 1759), +(13226, '兰新经营所', 4, 1759), +(13227, '卧龙河林场', 4, 1759), +(13228, '大西林林场', 4, 1759), +(13229, '对青山经营所', 4, 1759), +(13230, '松岭经营所', 4, 1759), +(13231, '桦皮羌子林场', 4, 1759), +(13232, '碧仓库林场', 4, 1759), +(13233, '缓岭经营所', 4, 1759), +(13234, '美溪街道', 4, 1759), +(13235, '群峦经营所', 4, 1759), +(13236, '金沙河林场', 4, 1759), +(13237, '青山口林场', 4, 1759), +(13238, '顺利河林场', 4, 1759), +(13239, '么河经营所', 4, 1760), +(13240, '冲锋经营所', 4, 1760), +(13241, '向阳街道', 4, 1760), +(13242, '尖山河经营所', 4, 1760); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13243, '开源河林场', 4, 1760), +(13244, '抚育河经营所', 4, 1760), +(13245, '昆仑气林场', 4, 1760), +(13246, '曙光街道', 4, 1760), +(13247, '翠峦河经营所', 4, 1760), +(13248, '解放经营所', 4, 1760), +(13249, '新兴街道', 4, 1761), +(13250, '苔青街道', 4, 1761), +(13251, '西林街道', 4, 1761), +(13252, '奋斗街道', 4, 1762), +(13253, '金山街道', 4, 1762), +(13254, '双丰镇', 4, 1763), +(13255, '工农乡', 4, 1763), +(13256, '年丰朝鲜族乡', 4, 1763), +(13257, '朗乡镇', 4, 1763), +(13258, '桃山镇', 4, 1763), +(13259, '王杨乡', 4, 1763), +(13260, '铁力镇', 4, 1763), +(13261, '佳东街道', 4, 1764), +(13262, '佳南街道', 4, 1764), +(13263, '建国乡', 4, 1764), +(13264, '建国街道', 4, 1764), +(13265, '晓云街道', 4, 1764), +(13266, '松江乡', 4, 1764), +(13267, '造纸街道', 4, 1764), +(13268, '亮子河街道', 4, 1765), +(13269, '南岗街道', 4, 1765), +(13270, '奋斗街道', 4, 1765), +(13271, '永安街道', 4, 1765), +(13272, '田园街道', 4, 1765), +(13273, '站前街道', 4, 1765), +(13274, '三村镇', 4, 1766), +(13275, '临江镇', 4, 1766), +(13276, '乐业镇', 4, 1766), +(13277, '八岔赫哲族乡', 4, 1766), +(13278, '同江镇', 4, 1766), +(13279, '向阳乡', 4, 1766), +(13280, '和兴街道', 4, 1766), +(13281, '安康街道', 4, 1766), +(13282, '幸福街道', 4, 1766), +(13283, '杏林街道', 4, 1766), +(13284, '街津口赫哲族乡', 4, 1766), +(13285, '金川乡', 4, 1766), +(13286, '银川乡', 4, 1766), +(13287, '青河乡', 4, 1766), +(13288, '保卫街道', 4, 1767), +(13289, '建设街道', 4, 1767), +(13290, '桥南街道', 4, 1767), +(13291, '西南岗街道', 4, 1767), +(13292, '西林街道', 4, 1767), +(13293, '长安街道', 4, 1767), +(13294, '上街基镇', 4, 1768), +(13295, '二龙山镇', 4, 1768), +(13296, '兴隆岗镇', 4, 1768), +(13297, '向阳川镇', 4, 1768), +(13298, '大榆树镇', 4, 1768), +(13299, '头林镇', 4, 1768), +(13300, '宏胜镇', 4, 1768), +(13301, '富锦镇', 4, 1768), +(13302, '砚山镇', 4, 1768); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13303, '锦山镇', 4, 1768), +(13304, '长安镇', 4, 1768), +(13305, '二道河农场', 4, 1769), +(13306, '别拉洪乡', 4, 1769), +(13307, '前哨农场', 4, 1769), +(13308, '前锋农场', 4, 1769), +(13309, '寒葱沟镇', 4, 1769), +(13310, '抓吉镇', 4, 1769), +(13311, '抚远镇', 4, 1769), +(13312, '浓桥镇', 4, 1769), +(13313, '浓江乡', 4, 1769), +(13314, '海青乡', 4, 1769), +(13315, '通江乡', 4, 1769), +(13316, '鸭南乡', 4, 1769), +(13317, '土龙山镇', 4, 1770), +(13318, '大八浪乡', 4, 1770), +(13319, '孟家岗镇', 4, 1770), +(13320, '明义乡', 4, 1770), +(13321, '桦南镇', 4, 1770), +(13322, '梨树乡', 4, 1770), +(13323, '石头河子镇', 4, 1770), +(13324, '金沙乡', 4, 1770), +(13325, '闫家镇', 4, 1770), +(13326, '驼腰子镇', 4, 1770), +(13327, '东河乡', 4, 1771), +(13328, '创业乡', 4, 1771), +(13329, '四马架乡', 4, 1771), +(13330, '团结街道', 4, 1771), +(13331, '建民街道', 4, 1771), +(13332, '悦来镇', 4, 1771), +(13333, '新城镇', 4, 1771), +(13334, '星火朝鲜族乡', 4, 1771), +(13335, '梨丰乡', 4, 1771), +(13336, '横头山镇', 4, 1771), +(13337, '苏家店镇', 4, 1771), +(13338, '荣安街道', 4, 1771), +(13339, '长新街道', 4, 1771), +(13340, '吉祥乡', 4, 1772), +(13341, '太平川乡', 4, 1772), +(13342, '振兴乡', 4, 1772), +(13343, '永发乡', 4, 1772), +(13344, '汤原镇', 4, 1772), +(13345, '汤旺朝鲜族乡', 4, 1772), +(13346, '竹帘镇', 4, 1772), +(13347, '胜利乡', 4, 1772), +(13348, '香兰镇', 4, 1772), +(13349, '鹤立镇', 4, 1772), +(13350, '四丰乡', 4, 1773), +(13351, '大来镇', 4, 1773), +(13352, '平安乡', 4, 1773), +(13353, '建国乡', 4, 1773), +(13354, '敖其镇', 4, 1773), +(13355, '望江镇', 4, 1773), +(13356, '松木河乡', 4, 1773), +(13357, '松江乡', 4, 1773), +(13358, '沿江乡', 4, 1773), +(13359, '群胜乡', 4, 1773), +(13360, '莲江口镇', 4, 1773), +(13361, '西格木乡', 4, 1773), +(13362, '长发镇', 4, 1773), +(13363, '长青乡', 4, 1773), +(13364, '高峰乡', 4, 1773), +(13365, '倭肯镇', 4, 1774); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13366, '勃利镇', 4, 1774), +(13367, '双河镇', 4, 1774), +(13368, '吉兴乡', 4, 1774), +(13369, '大四站镇', 4, 1774), +(13370, '小五站镇', 4, 1774), +(13371, '恒太乡', 4, 1774), +(13372, '抢垦乡', 4, 1774), +(13373, '杏树乡', 4, 1774), +(13374, '永顺乡', 4, 1774), +(13375, '罗泉乡', 4, 1774), +(13376, '镇郊乡', 4, 1774), +(13377, '长兴乡', 4, 1774), +(13378, '青山乡', 4, 1774), +(13379, '兴华街道', 4, 1775), +(13380, '北山街道', 4, 1775), +(13381, '新合街道', 4, 1775), +(13382, '新城街道', 4, 1775), +(13383, '新安街道', 4, 1775), +(13384, '新建街道', 4, 1775), +(13385, '新立街道', 4, 1775), +(13386, '河南街道', 4, 1775), +(13387, '红旗镇', 4, 1775), +(13388, '缸窑沟街道', 4, 1775), +(13389, '越秀街道', 4, 1775), +(13390, '万宝河镇', 4, 1776), +(13391, '兴岗街道', 4, 1776), +(13392, '桃东街道', 4, 1776), +(13393, '桃北街道', 4, 1776), +(13394, '桃南街道', 4, 1776), +(13395, '桃山街道', 4, 1776), +(13396, '桃西街道', 4, 1776), +(13397, '东风街道', 4, 1777), +(13398, '中心河乡', 4, 1777), +(13399, '向阳街道', 4, 1777), +(13400, '宏伟镇', 4, 1777), +(13401, '富强街道', 4, 1777), +(13402, '新富街道', 4, 1777), +(13403, '茄子河镇', 4, 1777), +(13404, '铁山乡', 4, 1777), +(13405, '龙湖街道', 4, 1777), +(13406, '三岔口', 4, 1778), +(13407, '东宁镇', 4, 1778), +(13408, '大肚川镇', 4, 1778), +(13409, '绥阳镇', 4, 1778), +(13410, '老黑山镇', 4, 1778), +(13411, '道河镇', 4, 1778), +(13412, '七星街道', 4, 1779), +(13413, '五星街道', 4, 1779), +(13414, '兴隆镇', 4, 1779), +(13415, '新安街道', 4, 1779), +(13416, '长安街道', 4, 1779), +(13417, '三陵乡', 4, 1780), +(13418, '东京城林业局', 4, 1780), +(13419, '东京城镇', 4, 1780), +(13420, '东关社区', 4, 1780), +(13421, '乐园社区', 4, 1780), +(13422, '兰岗镇', 4, 1780), +(13423, '卧龙朝鲜族乡', 4, 1780), +(13424, '宁安镇', 4, 1780), +(13425, '文庙社区', 4, 1780), +(13426, '江南朝鲜族满族乡', 4, 1780); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13427, '沙兰镇', 4, 1780), +(13428, '海浪镇', 4, 1780), +(13429, '渤海镇', 4, 1780), +(13430, '石岩镇', 4, 1780), +(13431, '虹桥社区', 4, 1780), +(13432, '西关社区', 4, 1780), +(13433, '铁工社区', 4, 1780), +(13434, '镜泊乡', 4, 1780), +(13435, '马河乡', 4, 1780), +(13436, '三道通镇', 4, 1781), +(13437, '五林镇', 4, 1781), +(13438, '刁翎镇', 4, 1781), +(13439, '古城镇', 4, 1781), +(13440, '奎山乡', 4, 1781), +(13441, '建堂乡', 4, 1781), +(13442, '朱家镇', 4, 1781), +(13443, '林口镇', 4, 1781), +(13444, '柳树镇', 4, 1781), +(13445, '莲花镇', 4, 1781), +(13446, '青山乡', 4, 1781), +(13447, '龙爪镇', 4, 1781), +(13448, '三道镇', 4, 1782), +(13449, '二道镇', 4, 1782), +(13450, '山市镇', 4, 1782), +(13451, '新安朝鲜族镇', 4, 1782), +(13452, '柴河镇', 4, 1782), +(13453, '横道镇', 4, 1782), +(13454, '海南朝鲜族乡', 4, 1782), +(13455, '海林镇', 4, 1782), +(13456, '长汀镇', 4, 1782), +(13457, '兴平街道', 4, 1783), +(13458, '北安乡', 4, 1783), +(13459, '北山街道', 4, 1783), +(13460, '向阳街道', 4, 1783), +(13461, '大庆街道', 4, 1783), +(13462, '新华街道', 4, 1783), +(13463, '铁北街道', 4, 1783), +(13464, '黄花街道', 4, 1783), +(13465, '下城子镇', 4, 1784), +(13466, '八面通林业局', 4, 1784), +(13467, '八面通镇', 4, 1784), +(13468, '共和乡', 4, 1784), +(13469, '兴源镇', 4, 1784), +(13470, '河西乡', 4, 1784), +(13471, '磨刀石镇', 4, 1784), +(13472, '福录乡', 4, 1784), +(13473, '穆棱林业局', 4, 1784), +(13474, '穆棱镇', 4, 1784), +(13475, '马桥河镇', 4, 1784), +(13476, '绥芬河镇', 4, 1785), +(13477, '阜宁镇', 4, 1785), +(13478, '先锋街道', 4, 1786), +(13479, '江滨街道', 4, 1786), +(13480, '沿江乡', 4, 1786), +(13481, '沿江街道', 4, 1786), +(13482, '温春镇', 4, 1786), +(13483, '火炬街道', 4, 1786), +(13484, '牡丹街道', 4, 1786), +(13485, '立新街道', 4, 1786), +(13486, '前进街道', 4, 1787), +(13487, '新兴街道', 4, 1787), +(13488, '桦林橡胶厂街道', 4, 1787); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13489, '桦林镇', 4, 1787), +(13490, '铁岭镇', 4, 1787), +(13491, '阳明街道', 4, 1787), +(13492, '五大连池镇', 4, 1788), +(13493, '兴安乡', 4, 1788), +(13494, '兴隆乡', 4, 1788), +(13495, '双泉乡', 4, 1788), +(13496, '和平镇', 4, 1788), +(13497, '团结乡', 4, 1788), +(13498, '太平乡', 4, 1788), +(13499, '建设乡', 4, 1788), +(13500, '新发乡', 4, 1788), +(13501, '朝阳乡', 4, 1788), +(13502, '青山街道', 4, 1788), +(13503, '龙镇', 4, 1788), +(13504, '东胜乡', 4, 1789), +(13505, '主星朝鲜族乡', 4, 1789), +(13506, '二井镇', 4, 1789), +(13507, '兆麟街道', 4, 1789), +(13508, '北岗街道', 4, 1789), +(13509, '和平街道', 4, 1789), +(13510, '城郊乡', 4, 1789), +(13511, '庆华街道', 4, 1789), +(13512, '杨家乡', 4, 1789), +(13513, '海星镇', 4, 1789), +(13514, '石泉镇', 4, 1789), +(13515, '赵光镇', 4, 1789), +(13516, '通北镇', 4, 1789), +(13517, '铁南街道', 4, 1789), +(13518, '铁西街道', 4, 1789), +(13519, '临江乡', 4, 1790), +(13520, '伊拉哈镇', 4, 1790), +(13521, '前进镇', 4, 1790), +(13522, '双山镇', 4, 1790), +(13523, '塔溪乡', 4, 1790), +(13524, '多宝山镇', 4, 1790), +(13525, '嫩江镇', 4, 1790), +(13526, '海江镇', 4, 1790), +(13527, '白云乡', 4, 1790), +(13528, '科洛镇', 4, 1790), +(13529, '联兴乡', 4, 1790), +(13530, '长江乡', 4, 1790), +(13531, '长福镇', 4, 1790), +(13532, '霍龙门乡', 4, 1790), +(13533, '卧牛河乡', 4, 1791), +(13534, '城区街道', 4, 1791), +(13535, '奋斗乡', 4, 1791), +(13536, '孙吴镇', 4, 1791), +(13537, '正阳山乡', 4, 1791), +(13538, '沿江满族乡', 4, 1791), +(13539, '清溪乡', 4, 1791), +(13540, '红旗乡', 4, 1791), +(13541, '群山乡', 4, 1791), +(13542, '腰屯乡', 4, 1791), +(13543, '西兴乡', 4, 1791), +(13544, '辰清镇', 4, 1791), +(13545, '上马厂乡', 4, 1792), +(13546, '二站乡', 4, 1792), +(13547, '兴安街道', 4, 1792), +(13548, '四嘉子满族乡', 4, 1792), +(13549, '坤河达斡尔族满族乡', 4, 1792), +(13550, '幸福乡', 4, 1792), +(13551, '张地营子乡', 4, 1792); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13552, '新生鄂伦春族乡', 4, 1792), +(13553, '海兰街道', 4, 1792), +(13554, '爱辉镇', 4, 1792), +(13555, '罕达汽镇', 4, 1792), +(13556, '花园街道', 4, 1792), +(13557, '西兴街道', 4, 1792), +(13558, '西岗子镇', 4, 1792), +(13559, '西峰山乡', 4, 1792), +(13560, '陆乡', 4, 1793), +(13561, '克林乡', 4, 1794), +(13562, '奇克街道', 4, 1794), +(13563, '宝山乡', 4, 1794), +(13564, '干岔子乡', 4, 1794), +(13565, '新兴鄂伦春族乡', 4, 1794), +(13566, '新鄂鄂伦春族乡', 4, 1794), +(13567, '松树沟乡', 4, 1794), +(13568, '边疆镇', 4, 1794), +(13569, '逊河镇', 4, 1794), +(13570, '临江镇', 4, 1795), +(13571, '兰河乡', 4, 1795), +(13572, '兰西镇', 4, 1795), +(13573, '北安乡', 4, 1795), +(13574, '奋斗乡', 4, 1795), +(13575, '平山镇', 4, 1795), +(13576, '康荣乡', 4, 1795), +(13577, '星火乡', 4, 1795), +(13578, '榆林镇', 4, 1795), +(13579, '燎原乡', 4, 1795), +(13580, '红光乡', 4, 1795), +(13581, '红星乡', 4, 1795), +(13582, '远大乡', 4, 1795), +(13583, '长岗乡', 4, 1795), +(13584, '长江乡', 4, 1795), +(13585, '万宝山镇', 4, 1796), +(13586, '中本镇', 4, 1796), +(13587, '任民镇', 4, 1796), +(13588, '先源乡', 4, 1796), +(13589, '升平镇', 4, 1796), +(13590, '卧里屯乡', 4, 1796), +(13591, '吉兴岗镇', 4, 1796), +(13592, '太平庄镇', 4, 1796), +(13593, '安虹街道', 4, 1796), +(13594, '安达镇', 4, 1796), +(13595, '新兴街道', 4, 1796), +(13596, '昌德镇', 4, 1796), +(13597, '火石山乡', 4, 1796), +(13598, '羊草镇', 4, 1796), +(13599, '老虎岗镇', 4, 1796), +(13600, '铁西街道', 4, 1796), +(13601, '青肯泡乡', 4, 1796), +(13602, '丰收乡', 4, 1797), +(13603, '久胜镇', 4, 1797), +(13604, '勤劳镇', 4, 1797), +(13605, '发展乡', 4, 1797), +(13606, '同乐乡', 4, 1797), +(13607, '大罗镇', 4, 1797), +(13608, '巨宝山乡', 4, 1797), +(13609, '平安镇', 4, 1797), +(13610, '庆安镇', 4, 1797), +(13611, '建民乡', 4, 1797), +(13612, '新胜乡', 4, 1797), +(13613, '欢胜乡', 4, 1797), +(13614, '民乐镇', 4, 1797); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13615, '致富乡', 4, 1797), +(13616, '光荣乡', 4, 1798), +(13617, '兴仁镇', 4, 1798), +(13618, '双兴乡', 4, 1798), +(13619, '崇德镇', 4, 1798), +(13620, '明水镇', 4, 1798), +(13621, '树人乡', 4, 1798), +(13622, '永久乡', 4, 1798), +(13623, '永兴镇', 4, 1798), +(13624, '繁荣乡', 4, 1798), +(13625, '育林乡', 4, 1798), +(13626, '通泉乡', 4, 1798), +(13627, '通达镇', 4, 1798), +(13628, '东升乡', 4, 1799), +(13629, '东郊乡', 4, 1799), +(13630, '先锋镇', 4, 1799), +(13631, '卫星镇', 4, 1799), +(13632, '厢白满族乡', 4, 1799), +(13633, '后三乡', 4, 1799), +(13634, '恭六乡', 4, 1799), +(13635, '惠七满族镇', 4, 1799), +(13636, '望奎镇', 4, 1799), +(13637, '海丰镇', 4, 1799), +(13638, '火箭乡', 4, 1799), +(13639, '灯塔乡', 4, 1799), +(13640, '灵山满族乡', 4, 1799), +(13641, '莲花镇', 4, 1799), +(13642, '通江镇', 4, 1799), +(13643, '东方红水库地区', 4, 1800), +(13644, '东林乡', 4, 1800), +(13645, '东风镇', 4, 1800), +(13646, '丰山乡', 4, 1800), +(13647, '乐业乡', 4, 1800), +(13648, '伦河镇', 4, 1800), +(13649, '共合镇', 4, 1800), +(13650, '共荣乡', 4, 1800), +(13651, '前进乡', 4, 1800), +(13652, '双录乡', 4, 1800), +(13653, '向荣乡', 4, 1800), +(13654, '扎音河乡', 4, 1800), +(13655, '林场公司', 4, 1800), +(13656, '永和乡', 4, 1800), +(13657, '永富乡', 4, 1800), +(13658, '海伦农场', 4, 1800), +(13659, '海伦绥化种畜场', 4, 1800), +(13660, '海伦镇', 4, 1800), +(13661, '海兴镇', 4, 1800), +(13662, '海北镇', 4, 1800), +(13663, '海南乡', 4, 1800), +(13664, '爱民乡', 4, 1800), +(13665, '百祥乡', 4, 1800), +(13666, '祥富镇', 4, 1800), +(13667, '福民乡', 4, 1800), +(13668, '红光农场', 4, 1800), +(13669, '联发乡', 4, 1800), +(13670, '长发乡', 4, 1800), +(13671, '三井乡', 4, 1801), +(13672, '三河镇', 4, 1801), +(13673, '东兴办事处', 4, 1801), +(13674, '东富乡', 4, 1801), +(13675, '东津镇', 4, 1801), +(13676, '五营乡', 4, 1801), +(13677, '兴和朝鲜族乡', 4, 1801), +(13678, '兴福乡', 4, 1801); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13679, '北林办事处', 4, 1801), +(13680, '双河镇', 4, 1801), +(13681, '吉泰街道', 4, 1801), +(13682, '四方台镇', 4, 1801), +(13683, '大有街道', 4, 1801), +(13684, '太平川镇', 4, 1801), +(13685, '宝山镇', 4, 1801), +(13686, '张维镇', 4, 1801), +(13687, '新华乡', 4, 1801), +(13688, '永安满族镇', 4, 1801), +(13689, '津河镇', 4, 1801), +(13690, '爱路街道', 4, 1801), +(13691, '秦家镇', 4, 1801), +(13692, '紫来街道', 4, 1801), +(13693, '红旗满族乡', 4, 1801), +(13694, '绥胜满族镇', 4, 1801), +(13695, '西长发镇', 4, 1801), +(13696, '连岗乡', 4, 1801), +(13697, '上集镇', 4, 1802), +(13698, '克音河乡', 4, 1802), +(13699, '双岔河镇', 4, 1802), +(13700, '后头乡', 4, 1802), +(13701, '四海店镇', 4, 1802), +(13702, '泥尔河乡', 4, 1802), +(13703, '绥中乡', 4, 1802), +(13704, '绥棱镇', 4, 1802), +(13705, '长山乡', 4, 1802), +(13706, '阁山乡', 4, 1802), +(13707, '靠山乡', 4, 1802), +(13708, '东升区办事处', 4, 1803), +(13709, '东发办事处', 4, 1803), +(13710, '五站镇', 4, 1803), +(13711, '五里明镇', 4, 1803), +(13712, '向阳乡', 4, 1803), +(13713, '四方山农场', 4, 1803), +(13714, '四站镇', 4, 1803), +(13715, '太平乡', 4, 1803), +(13716, '姜家镇', 4, 1803), +(13717, '安民乡', 4, 1803), +(13718, '宋站镇', 4, 1803), +(13719, '宣化乡', 4, 1803), +(13720, '尚家镇', 4, 1803), +(13721, '德昌乡', 4, 1803), +(13722, '昌五镇', 4, 1803), +(13723, '明久乡', 4, 1803), +(13724, '朝阳区办事处', 4, 1803), +(13725, '正阳区办事处', 4, 1803), +(13726, '洪河乡', 4, 1803), +(13727, '海城乡', 4, 1803), +(13728, '涝洲镇', 4, 1803), +(13729, '肇东镇', 4, 1803), +(13730, '西八里乡', 4, 1803), +(13731, '西园区办事处', 4, 1803), +(13732, '跃进乡', 4, 1803), +(13733, '里木店镇', 4, 1803), +(13734, '黎明镇', 4, 1803), +(13735, '中和镇', 4, 1804), +(13736, '兴华镇', 4, 1804), +(13737, '劳动乡', 4, 1804), +(13738, '建设乡', 4, 1804), +(13739, '德胜乡', 4, 1804), +(13740, '新村乡', 4, 1804); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13741, '昌盛乡', 4, 1804), +(13742, '柞岗乡', 4, 1804), +(13743, '民政乡', 4, 1804), +(13744, '永丰镇', 4, 1804), +(13745, '祯祥镇', 4, 1804), +(13746, '芦河镇', 4, 1804), +(13747, '迎春乡', 4, 1804), +(13748, '连丰乡', 4, 1804), +(13749, '青冈原种场', 4, 1804), +(13750, '青冈种羊场', 4, 1804), +(13751, '青冈种马场', 4, 1804), +(13752, '青冈镇', 4, 1804), +(13753, '三卡乡', 4, 1805), +(13754, '兴华乡', 4, 1805), +(13755, '北疆乡', 4, 1805), +(13756, '呼玛镇', 4, 1805), +(13757, '白银纳鄂伦春族乡', 4, 1805), +(13758, '金山乡', 4, 1805), +(13759, '韩家园林业局', 4, 1805), +(13760, '韩家园镇', 4, 1805), +(13761, '鸥浦乡', 4, 1805), +(13762, '依西肯乡', 4, 1806), +(13763, '十八站林业局', 4, 1806), +(13764, '十八站鄂伦春族乡', 4, 1806), +(13765, '塔河镇', 4, 1806), +(13766, '开库康乡', 4, 1806), +(13767, '瓦拉干镇', 4, 1806), +(13768, '盘古镇', 4, 1806), +(13769, '东山街道', 4, 1807), +(13770, '光明街道', 4, 1807), +(13771, '加北乡', 4, 1807), +(13772, '加格达奇林业局', 4, 1807), +(13773, '卫东街道', 4, 1807), +(13774, '曙光街道', 4, 1807), +(13775, '白桦乡', 4, 1807), +(13776, '红旗街道', 4, 1807), +(13777, '长虹街道', 4, 1807), +(13778, '呼中镇', 4, 1808), +(13779, '呼源镇', 4, 1808), +(13780, '宏伟镇', 4, 1808), +(13781, '碧水镇', 4, 1808), +(13782, '塔尔根镇', 4, 1809), +(13783, '塔源镇', 4, 1809), +(13784, '大乌苏镇', 4, 1809), +(13785, '宏图镇', 4, 1809), +(13786, '新林镇', 4, 1809), +(13787, '碧洲镇', 4, 1809), +(13788, '翠岗镇', 4, 1809), +(13789, '劲松镇', 4, 1810), +(13790, '古源镇', 4, 1810), +(13791, '小扬气镇', 4, 1810), +(13792, '兴安镇', 4, 1811), +(13793, '劲涛镇', 4, 1811), +(13794, '北极乡', 4, 1811), +(13795, '图强镇', 4, 1811), +(13796, '西林吉镇', 4, 1811), +(13797, '宝塔桥街道', 4, 2027), +(13798, '小市街道', 4, 2027), +(13799, '幕府山街道', 4, 2027), +(13800, '建宁路街道', 4, 2027), +(13801, '热河南路街道', 4, 2027); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13802, '阅江楼街道', 4, 2027), +(13803, '东沟镇', 4, 2028), +(13804, '八百桥镇', 4, 2028), +(13805, '冶山镇', 4, 2028), +(13806, '卸甲甸街道', 4, 2028), +(13807, '山潘街道', 4, 2028), +(13808, '新篁镇', 4, 2028), +(13809, '新集镇', 4, 2028), +(13810, '横梁镇', 4, 2028), +(13811, '玉带镇', 4, 2028), +(13812, '瓜埠镇', 4, 2028), +(13813, '程桥镇', 4, 2028), +(13814, '竹镇镇', 4, 2028), +(13815, '葛塘街道', 4, 2028), +(13816, '西厂门街道', 4, 2028), +(13817, '长芦街道', 4, 2028), +(13818, '雄州镇', 4, 2028), +(13819, '马集镇', 4, 2028), +(13820, '马鞍镇', 4, 2028), +(13821, '龙袍镇', 4, 2028), +(13822, '兴隆街道', 4, 2029), +(13823, '南湖街道', 4, 2029), +(13824, '南苑街道', 4, 2029), +(13825, '双闸街道', 4, 2029), +(13826, '江心洲街道', 4, 2029), +(13827, '沙洲街道', 4, 2029), +(13828, '滨湖街道', 4, 2029), +(13829, '仙林街道', 4, 2030), +(13830, '八卦洲街道', 4, 2030), +(13831, '尧化街道', 4, 2030), +(13832, '栖霞街道', 4, 2030), +(13833, '燕子矶街道', 4, 2030), +(13834, '迈皋桥街道', 4, 2030), +(13835, '靖安街道', 4, 2030), +(13836, '马群街道', 4, 2030), +(13837, '龙潭街道', 4, 2030), +(13838, '东山街道', 4, 2031), +(13839, '横溪镇', 4, 2031), +(13840, '江宁街道', 4, 2031), +(13841, '汤山街道', 4, 2031), +(13842, '淳化街道', 4, 2031), +(13843, '湖熟镇', 4, 2031), +(13844, '禄口街道', 4, 2031), +(13845, '秣陵街道', 4, 2031), +(13846, '谷里街道', 4, 2031), +(13847, '乌江镇', 4, 2032), +(13848, '南京高新技术产业开发区', 4, 2032), +(13849, '星甸镇', 4, 2032), +(13850, '桥林镇', 4, 2032), +(13851, '永宁镇', 4, 2032), +(13852, '江浦街道', 4, 2032), +(13853, '汤泉农场', 4, 2032), +(13854, '汤泉镇', 4, 2032), +(13855, '沿江街道', 4, 2032), +(13856, '泰山街道', 4, 2032), +(13857, '盘城镇', 4, 2032), +(13858, '石桥镇', 4, 2032), +(13859, '老山林场', 4, 2032), +(13860, '顶山街道', 4, 2032), +(13861, '东屏镇', 4, 2033), +(13862, '和凤镇', 4, 2033); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13863, '晶桥镇', 4, 2033), +(13864, '柘塘镇', 4, 2033), +(13865, '永阳镇', 4, 2033), +(13866, '洪蓝镇', 4, 2033), +(13867, '溧水县林场', 4, 2033), +(13868, '溧水开发区', 4, 2033), +(13869, '白马镇', 4, 2033), +(13870, '石湫镇', 4, 2033), +(13871, '丹凤街街道', 4, 2034), +(13872, '兰园街道', 4, 2034), +(13873, '卫岗街道', 4, 2034), +(13874, '后宰门街道', 4, 2034), +(13875, '孝陵卫街道', 4, 2034), +(13876, '新街口街道', 4, 2034), +(13877, '梅园新村街道', 4, 2034), +(13878, '玄武湖街道', 4, 2034), +(13879, '玄武门街道', 4, 2034), +(13880, '红山街道', 4, 2034), +(13881, '锁金村街道', 4, 2034), +(13882, '五老村街道', 4, 2035), +(13883, '光华路街道', 4, 2035), +(13884, '大光路街道', 4, 2035), +(13885, '建康路街道', 4, 2035), +(13886, '朝天宫街道', 4, 2035), +(13887, '止马营街道', 4, 2035), +(13888, '洪武路街道', 4, 2035), +(13889, '淮海路街道', 4, 2035), +(13890, '瑞金路街道', 4, 2035), +(13891, '苜蓿园街道', 4, 2035), +(13892, '中华门街道', 4, 2036), +(13893, '双塘街道', 4, 2036), +(13894, '夫子庙街道', 4, 2036), +(13895, '秦虹街道', 4, 2036), +(13896, '红花街道', 4, 2036), +(13897, '宁南街道', 4, 2037), +(13898, '板桥街道', 4, 2037), +(13899, '梅山街道', 4, 2037), +(13900, '西善桥街道', 4, 2037), +(13901, '赛虹桥街道', 4, 2037), +(13902, '铁心桥街道', 4, 2037), +(13903, '雨花新村街道', 4, 2037), +(13904, '东坝镇', 4, 2038), +(13905, '古柏镇', 4, 2038), +(13906, '固城镇', 4, 2038), +(13907, '桠溪镇', 4, 2038), +(13908, '淳溪镇', 4, 2038), +(13909, '漆桥镇', 4, 2038), +(13910, '砖墙镇', 4, 2038), +(13911, '阳江镇', 4, 2038), +(13912, '中央门街道', 4, 2039), +(13913, '华侨路街道', 4, 2039), +(13914, '宁海路街道', 4, 2039), +(13915, '挹江门街道', 4, 2039), +(13916, '江东街道', 4, 2039), +(13917, '湖南路街道', 4, 2039), +(13918, '莫愁湖街道', 4, 2039), +(13919, '北大街街道', 4, 2040), +(13920, '山北街道', 4, 2040); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13921, '惠山街道', 4, 2040), +(13922, '黄巷街道', 4, 2040), +(13923, '南禅寺街道', 4, 2041), +(13924, '扬名街道', 4, 2041), +(13925, '清名桥街道', 4, 2041), +(13926, '迎龙桥街道', 4, 2041), +(13927, '金匮街道', 4, 2041), +(13928, '金星街道', 4, 2041), +(13929, '丁蜀镇', 4, 2042), +(13930, '万石镇', 4, 2042), +(13931, '周铁镇', 4, 2042), +(13932, '和桥镇', 4, 2042), +(13933, '城北街道', 4, 2042), +(13934, '大浦镇', 4, 2042), +(13935, '太华镇', 4, 2042), +(13936, '官林镇', 4, 2042), +(13937, '宜城街道', 4, 2042), +(13938, '张渚镇', 4, 2042), +(13939, '徐舍镇', 4, 2042), +(13940, '新庄镇', 4, 2042), +(13941, '新建镇', 4, 2042), +(13942, '新街镇', 4, 2042), +(13943, '杨巷镇', 4, 2042), +(13944, '湖父镇', 4, 2042), +(13945, '芳庄镇', 4, 2042), +(13946, '芳桥镇', 4, 2042), +(13947, '西渚镇', 4, 2042), +(13948, '高塍镇', 4, 2042), +(13949, '鲸塘镇', 4, 2042), +(13950, '上马墩街道', 4, 2043), +(13951, '崇安寺街道', 4, 2043), +(13952, '广瑞路街道', 4, 2043), +(13953, '广益街道', 4, 2043), +(13954, '江海街道', 4, 2043), +(13955, '通江街道', 4, 2043), +(13956, '前洲镇', 4, 2044), +(13957, '堰桥镇', 4, 2044), +(13958, '洛社镇', 4, 2044), +(13959, '玉祁镇', 4, 2044), +(13960, '钱桥镇', 4, 2044), +(13961, '阳山镇', 4, 2044), +(13962, '云亭镇', 4, 2045), +(13963, '利港镇', 4, 2045), +(13964, '华士镇', 4, 2045), +(13965, '南闸镇', 4, 2045), +(13966, '周庄镇', 4, 2045), +(13967, '夏港镇', 4, 2045), +(13968, '新桥镇', 4, 2045), +(13969, '月城镇', 4, 2045), +(13970, '澄江街道', 4, 2045), +(13971, '璜土镇', 4, 2045), +(13972, '申港镇', 4, 2045), +(13973, '祝塘镇', 4, 2045), +(13974, '长泾镇', 4, 2045), +(13975, '霞客镇', 4, 2045), +(13976, '青阳镇', 4, 2045), +(13977, '顾山镇', 4, 2045), +(13978, '华庄街道', 4, 2046), +(13979, '南站街道', 4, 2046), +(13980, '坊前街道', 4, 2046), +(13981, '太湖街道', 4, 2046), +(13982, '旺庄街道', 4, 2046), +(13983, '梅村镇', 4, 2046); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(13984, '河埒街道', 4, 2046), +(13985, '滨湖街道', 4, 2046), +(13986, '硕放街道', 4, 2046), +(13987, '胡埭镇', 4, 2046), +(13988, '荣巷街道', 4, 2046), +(13989, '蠡园街道', 4, 2046), +(13990, '蠡湖街道', 4, 2046), +(13991, '马山镇', 4, 2046), +(13992, '鸿山镇', 4, 2046), +(13993, '东亭镇', 4, 2047), +(13994, '东北塘镇', 4, 2047), +(13995, '东港镇', 4, 2047), +(13996, '安镇镇', 4, 2047), +(13997, '羊尖镇', 4, 2047), +(13998, '锡北镇', 4, 2047), +(13999, '鸿山镇', 4, 2047), +(14000, '鹅湖镇', 4, 2047), +(14001, '凤城镇', 4, 2048), +(14002, '华山镇', 4, 2048), +(14003, '大沙河林场', 4, 2048), +(14004, '大沙河镇', 4, 2048), +(14005, '孙楼镇', 4, 2048), +(14006, '宋楼镇', 4, 2048), +(14007, '师寨镇', 4, 2048), +(14008, '常店镇', 4, 2048), +(14009, '梁寨镇', 4, 2048), +(14010, '欢口镇', 4, 2048), +(14011, '王沟镇', 4, 2048), +(14012, '范楼镇', 4, 2048), +(14013, '赵庄镇', 4, 2048), +(14014, '顺河镇', 4, 2048), +(14015, '首羡镇', 4, 2048), +(14016, '三河尖街道', 4, 2049), +(14017, '义安街道', 4, 2049), +(14018, '九里街道', 4, 2049), +(14019, '利国街道', 4, 2049), +(14020, '垞城街道', 4, 2049), +(14021, '大黄山街道', 4, 2049), +(14022, '庞庄街道', 4, 2049), +(14023, '张双楼街道', 4, 2049), +(14024, '张集街道', 4, 2049), +(14025, '拾屯街道', 4, 2049), +(14026, '桃园街道', 4, 2049), +(14027, '火花街道', 4, 2049), +(14028, '电厂街道', 4, 2049), +(14029, '苏山街道', 4, 2049), +(14030, '大郭庄街道', 4, 2050), +(14031, '天桥街道', 4, 2050), +(14032, '子房街道', 4, 2050), +(14033, '彭城街道', 4, 2050), +(14034, '潘塘街道', 4, 2050), +(14035, '翠屏山街道', 4, 2050), +(14036, '青年街道', 4, 2050), +(14037, '骆驼山街道', 4, 2050), +(14038, '黄山街道', 4, 2050), +(14039, '北沟镇', 4, 2051), +(14040, '双塘镇', 4, 2051), +(14041, '合沟镇', 4, 2051), +(14042, '唐店镇', 4, 2051), +(14043, '新安镇', 4, 2051), +(14044, '新店镇', 4, 2051), +(14045, '时集镇', 4, 2051); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14046, '棋盘镇', 4, 2051), +(14047, '港头镇', 4, 2051), +(14048, '王庄镇', 4, 2051), +(14049, '瓦窑镇', 4, 2051), +(14050, '窑湾镇', 4, 2051), +(14051, '草桥镇', 4, 2051), +(14052, '邵店镇', 4, 2051), +(14053, '阿湖镇', 4, 2051), +(14054, '高流镇', 4, 2051), +(14055, '五段镇', 4, 2052), +(14056, '大屯镇', 4, 2052), +(14057, '安国镇', 4, 2052), +(14058, '张寨镇', 4, 2052), +(14059, '张庄镇', 4, 2052), +(14060, '敬安镇', 4, 2052), +(14061, '朱寨镇', 4, 2052), +(14062, '杨屯镇', 4, 2052), +(14063, '栖山镇', 4, 2052), +(14064, '沛城镇', 4, 2052), +(14065, '河口镇', 4, 2052), +(14066, '胡寨镇', 4, 2052), +(14067, '魏庙镇', 4, 2052), +(14068, '鹿楼镇', 4, 2052), +(14069, '龙固镇', 4, 2052), +(14070, '七里沟街道', 4, 2053), +(14071, '和平街道', 4, 2053), +(14072, '奎山街道', 4, 2053), +(14073, '段庄街道', 4, 2053), +(14074, '永安街道', 4, 2053), +(14075, '泰山街道', 4, 2053), +(14076, '湖滨街道', 4, 2053), +(14077, '王陵街道', 4, 2053), +(14078, '翟山街道', 4, 2053), +(14079, '金山街道', 4, 2053), +(14080, '凌城镇', 4, 2054), +(14081, '双沟镇', 4, 2054), +(14082, '古邳镇', 4, 2054), +(14083, '姚集镇', 4, 2054), +(14084, '官山镇', 4, 2054), +(14085, '岚山镇', 4, 2054), +(14086, '庆安镇', 4, 2054), +(14087, '李集镇', 4, 2054), +(14088, '桃园镇', 4, 2054), +(14089, '梁集镇', 4, 2054), +(14090, '沙集镇', 4, 2054), +(14091, '王集镇', 4, 2054), +(14092, '睢城镇', 4, 2054), +(14093, '邱集镇', 4, 2054), +(14094, '高作镇', 4, 2054), +(14095, '魏集镇', 4, 2054), +(14096, '塔山镇', 4, 2055), +(14097, '夏桥街道', 4, 2055), +(14098, '大吴镇', 4, 2055), +(14099, '江庄镇', 4, 2055), +(14100, '汴塘镇', 4, 2055), +(14101, '紫庄镇', 4, 2055), +(14102, '老矿街道', 4, 2055), +(14103, '贾汪镇', 4, 2055), +(14104, '青山泉镇', 4, 2055), +(14105, '八义集镇', 4, 2056), +(14106, '八路镇', 4, 2056), +(14107, '占城镇', 4, 2056), +(14108, '四户镇', 4, 2056), +(14109, '土山镇', 4, 2056); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14110, '官湖镇', 4, 2056), +(14111, '宿羊山镇', 4, 2056), +(14112, '岔河镇', 4, 2056), +(14113, '张楼农场', 4, 2056), +(14114, '戴圩镇', 4, 2056), +(14115, '戴庄镇', 4, 2056), +(14116, '新河镇', 4, 2056), +(14117, '港上镇', 4, 2056), +(14118, '炮车镇', 4, 2056), +(14119, '燕子埠镇', 4, 2056), +(14120, '碾庄镇', 4, 2056), +(14121, '议堂镇', 4, 2056), +(14122, '赵墩镇', 4, 2056), +(14123, '车辐山镇', 4, 2056), +(14124, '运河镇', 4, 2056), +(14125, '邢楼镇', 4, 2056), +(14126, '邳城农场', 4, 2056), +(14127, '邳城镇', 4, 2056), +(14128, '邹庄镇', 4, 2056), +(14129, '铁富镇', 4, 2056), +(14130, '陈楼镇', 4, 2056), +(14131, '三堡镇', 4, 2057), +(14132, '伊庄镇', 4, 2057), +(14133, '何桥镇', 4, 2057), +(14134, '刘集镇', 4, 2057), +(14135, '利国镇', 4, 2057), +(14136, '单集镇', 4, 2057), +(14137, '国营沿湖农场', 4, 2057), +(14138, '大彭镇', 4, 2057), +(14139, '大许镇', 4, 2057), +(14140, '张集镇', 4, 2057), +(14141, '徐庄镇', 4, 2057), +(14142, '房村镇', 4, 2057), +(14143, '柳新镇', 4, 2057), +(14144, '柳泉镇', 4, 2057), +(14145, '棠张镇', 4, 2057), +(14146, '汉王镇', 4, 2057), +(14147, '茅村镇', 4, 2057), +(14148, '郑集镇', 4, 2057), +(14149, '铜山镇', 4, 2057), +(14150, '马坡镇', 4, 2057), +(14151, '黄集镇', 4, 2057), +(14152, '东环街道', 4, 2058), +(14153, '丰财街道', 4, 2058), +(14154, '大庙镇', 4, 2058), +(14155, '大黄山镇', 4, 2058), +(14156, '牌楼街道', 4, 2058), +(14157, '环城街道', 4, 2058), +(14158, '琵琶街道', 4, 2058), +(14159, '金山桥街道', 4, 2058), +(14160, '铜沛街道', 4, 2058), +(14161, '黄楼街道', 4, 2058), +(14162, '兰陵街道', 4, 2059), +(14163, '天宁经济开发区', 4, 2059), +(14164, '天宁街道', 4, 2059), +(14165, '红梅街道', 4, 2059), +(14166, '茶山街道', 4, 2059), +(14167, '雕庄街道', 4, 2059), +(14168, '青龙街道', 4, 2059), +(14169, '丁堰街道', 4, 2060), +(14170, '戚墅堰街道', 4, 2060), +(14171, '潞城街道', 4, 2060), +(14172, '三井街道', 4, 2061); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14173, '孟河镇', 4, 2061), +(14174, '新桥镇', 4, 2061), +(14175, '春江镇', 4, 2061), +(14176, '河海街道', 4, 2061), +(14177, '罗溪镇', 4, 2061), +(14178, '薛家镇', 4, 2061), +(14179, '西夏墅镇', 4, 2061), +(14180, '龙虎塘街道', 4, 2061), +(14181, '前黄镇', 4, 2062), +(14182, '南夏墅街道', 4, 2062), +(14183, '嘉泽镇', 4, 2062), +(14184, '奔牛镇', 4, 2062), +(14185, '横山桥镇', 4, 2062), +(14186, '横林镇', 4, 2062), +(14187, '洛阳镇', 4, 2062), +(14188, '湖塘镇', 4, 2062), +(14189, '湟里镇', 4, 2062), +(14190, '牛塘镇', 4, 2062), +(14191, '礼嘉镇', 4, 2062), +(14192, '遥观镇', 4, 2062), +(14193, '邹区镇', 4, 2062), +(14194, '郑陆镇', 4, 2062), +(14195, '雪堰镇', 4, 2062), +(14196, '上兴镇', 4, 2063), +(14197, '上黄镇', 4, 2063), +(14198, '别桥镇', 4, 2063), +(14199, '南渡镇', 4, 2063), +(14200, '埭头镇', 4, 2063), +(14201, '天目湖镇', 4, 2063), +(14202, '戴埠镇', 4, 2063), +(14203, '溧城镇', 4, 2063), +(14204, '社渚镇', 4, 2063), +(14205, '竹箦镇', 4, 2063), +(14206, '儒林镇', 4, 2064), +(14207, '尧塘镇', 4, 2064), +(14208, '指前镇', 4, 2064), +(14209, '朱林镇', 4, 2064), +(14210, '直溪镇', 4, 2064), +(14211, '薛埠镇', 4, 2064), +(14212, '金城镇', 4, 2064), +(14213, '五星街道', 4, 2065), +(14214, '北港街道', 4, 2065), +(14215, '南大街街道', 4, 2065), +(14216, '新闸街道', 4, 2065), +(14217, '永红街道', 4, 2065), +(14218, '荷花池街道', 4, 2065), +(14219, '西林街道', 4, 2065), +(14220, '东山镇', 4, 2066), +(14221, '临湖镇', 4, 2066), +(14222, '光福镇', 4, 2066), +(14223, '城南街道', 4, 2066), +(14224, '木渎镇', 4, 2066), +(14225, '横泾街道', 4, 2066), +(14226, '甪直镇', 4, 2066), +(14227, '胥口镇', 4, 2066), +(14228, '苏苑街道', 4, 2066), +(14229, '藏书镇', 4, 2066), +(14230, '西山镇', 4, 2066), +(14231, '越溪街道', 4, 2066), +(14232, '车坊镇', 4, 2066), +(14233, '郭巷街道', 4, 2066), +(14234, '长桥街道', 4, 2066), +(14235, '香山街道', 4, 2066); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14236, '龙西街道', 4, 2066), +(14237, '七都镇', 4, 2067), +(14238, '同里镇', 4, 2067), +(14239, '平望镇', 4, 2067), +(14240, '松陵镇', 4, 2067), +(14241, '桃源镇', 4, 2067), +(14242, '横扇镇', 4, 2067), +(14243, '汾湖镇', 4, 2067), +(14244, '盛泽镇', 4, 2067), +(14245, '震泽镇', 4, 2067), +(14246, '双凤镇', 4, 2068), +(14247, '城厢镇', 4, 2068), +(14248, '太仓港港口开发区', 4, 2068), +(14249, '太仓经济开发区', 4, 2068), +(14250, '沙溪镇', 4, 2068), +(14251, '浏河镇', 4, 2068), +(14252, '浮桥镇', 4, 2068), +(14253, '璜泾镇', 4, 2068), +(14254, '陆渡镇', 4, 2068), +(14255, '古里镇', 4, 2069), +(14256, '尚湖镇', 4, 2069), +(14257, '支塘镇', 4, 2069), +(14258, '新港镇', 4, 2069), +(14259, '梅李镇', 4, 2069), +(14260, '沙家浜镇', 4, 2069), +(14261, '海虞镇', 4, 2069), +(14262, '董浜镇', 4, 2069), +(14263, '虞山镇', 4, 2069), +(14264, '辛庄镇', 4, 2069), +(14265, '城北街道', 4, 2070), +(14266, '娄门街道', 4, 2070), +(14267, '平江路街道', 4, 2070), +(14268, '桃花坞街道', 4, 2070), +(14269, '苏锦街道', 4, 2070), +(14270, '观前街道', 4, 2070), +(14271, '乐余镇', 4, 2071), +(14272, '凤凰镇', 4, 2071), +(14273, '南丰镇', 4, 2071), +(14274, '塘桥镇', 4, 2071), +(14275, '大新镇', 4, 2071), +(14276, '常阴沙农场', 4, 2071), +(14277, '杨舍镇', 4, 2071), +(14278, '金港镇', 4, 2071), +(14279, '锦丰镇', 4, 2071), +(14280, '千灯镇', 4, 2072), +(14281, '周市镇', 4, 2072), +(14282, '周庄镇', 4, 2072), +(14283, '巴城镇', 4, 2072), +(14284, '张浦镇', 4, 2072), +(14285, '淀山湖镇', 4, 2072), +(14286, '玉山镇', 4, 2072), +(14287, '花桥镇', 4, 2072), +(14288, '锦溪镇', 4, 2072), +(14289, '陆家镇', 4, 2072), +(14290, '南门街道', 4, 2073), +(14291, '友新街道', 4, 2073), +(14292, '双塔街道', 4, 2073), +(14293, '吴门桥街道', 4, 2073), +(14294, '胥江街道', 4, 2073), +(14295, '葑门街道', 4, 2073), +(14296, '元和街道', 4, 2074), +(14297, '北桥街道', 4, 2074), +(14298, '太平街道', 4, 2074); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14299, '望亭镇', 4, 2074), +(14300, '渭塘镇', 4, 2074), +(14301, '阳澄湖镇', 4, 2074), +(14302, '黄埭镇', 4, 2074), +(14303, '黄桥街道', 4, 2074), +(14304, '唯亭镇', 4, 2075), +(14305, '娄葑镇', 4, 2075), +(14306, '胜浦镇', 4, 2075), +(14307, '东渚镇', 4, 2076), +(14308, '枫桥街道', 4, 2076), +(14309, '横塘街道', 4, 2076), +(14310, '浒墅关镇', 4, 2076), +(14311, '狮山街道', 4, 2076), +(14312, '通安镇', 4, 2076), +(14313, '彩香街道', 4, 2077), +(14314, '留园街道', 4, 2077), +(14315, '白洋湾街道', 4, 2077), +(14316, '石路街道', 4, 2077), +(14317, '虎丘街道', 4, 2077), +(14318, '东元镇', 4, 2078), +(14319, '东海镇', 4, 2078), +(14320, '久隆镇', 4, 2078), +(14321, '兆民镇', 4, 2078), +(14322, '北新镇', 4, 2078), +(14323, '南阳镇', 4, 2078), +(14324, '合作镇', 4, 2078), +(14325, '向阳镇', 4, 2078), +(14326, '吕四港镇', 4, 2078), +(14327, '启隆乡', 4, 2078), +(14328, '和合镇', 4, 2078), +(14329, '大兴镇', 4, 2078), +(14330, '天汾镇', 4, 2078), +(14331, '寅阳镇', 4, 2078), +(14332, '少直镇', 4, 2078), +(14333, '志良镇', 4, 2078), +(14334, '惠丰镇', 4, 2078), +(14335, '惠萍镇', 4, 2078), +(14336, '新安镇', 4, 2078), +(14337, '民主镇', 4, 2078), +(14338, '汇龙镇', 4, 2078), +(14339, '海复镇', 4, 2078), +(14340, '王鲍镇', 4, 2078), +(14341, '近海镇', 4, 2078), +(14342, '丰利镇', 4, 2079), +(14343, '兵房镇', 4, 2079), +(14344, '双甸镇', 4, 2079), +(14345, '大豫镇', 4, 2079), +(14346, '岔河镇', 4, 2079), +(14347, '掘港镇', 4, 2079), +(14348, '新店镇', 4, 2079), +(14349, '曹埠镇', 4, 2079), +(14350, '栟茶镇', 4, 2079), +(14351, '河口镇', 4, 2079), +(14352, '洋口镇', 4, 2079), +(14353, '苴镇', 4, 2079), +(14354, '袁庄镇', 4, 2079), +(14355, '长沙镇', 4, 2079), +(14356, '马塘镇', 4, 2079), +(14357, '丁埝镇', 4, 2080), +(14358, '下原镇', 4, 2080), +(14359, '东陈镇', 4, 2080), +(14360, '九华镇', 4, 2080), +(14361, '吴窑镇', 4, 2080), +(14362, '如城镇', 4, 2080), +(14363, '常青镇', 4, 2080); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14364, '搬经镇', 4, 2080), +(14365, '林梓镇', 4, 2080), +(14366, '柴湾镇', 4, 2080), +(14367, '桃园镇', 4, 2080), +(14368, '江安镇', 4, 2080), +(14369, '白蒲镇', 4, 2080), +(14370, '石庄镇', 4, 2080), +(14371, '磨头镇', 4, 2080), +(14372, '袁桥镇', 4, 2080), +(14373, '郭园镇', 4, 2080), +(14374, '长江镇', 4, 2080), +(14375, '雪岸镇', 4, 2080), +(14376, '高明镇', 4, 2080), +(14377, '中兴街道', 4, 2081), +(14378, '任港街道', 4, 2081), +(14379, '和平桥街道', 4, 2081), +(14380, '城东街道', 4, 2081), +(14381, '学田街道', 4, 2081), +(14382, '小海镇', 4, 2081), +(14383, '文峰街道', 4, 2081), +(14384, '新城桥街道', 4, 2081), +(14385, '新开镇', 4, 2081), +(14386, '狼山镇', 4, 2081), +(14387, '竹行镇', 4, 2081), +(14388, '虹桥街道', 4, 2081), +(14389, '观音山镇', 4, 2081), +(14390, '钟秀街道', 4, 2081), +(14391, '南莫镇', 4, 2082), +(14392, '城东镇', 4, 2082), +(14393, '墩头镇', 4, 2082), +(14394, '大公镇', 4, 2082), +(14395, '孙庄镇', 4, 2082), +(14396, '曲塘镇', 4, 2082), +(14397, '李堡镇', 4, 2082), +(14398, '海安镇', 4, 2082), +(14399, '白甸镇', 4, 2082), +(14400, '老坝港镇', 4, 2082), +(14401, '胡集镇', 4, 2082), +(14402, '西场镇', 4, 2082), +(14403, '角斜镇', 4, 2082), +(14404, '雅周镇', 4, 2082), +(14405, '万年镇', 4, 2083), +(14406, '三厂镇', 4, 2083), +(14407, '三和镇', 4, 2083), +(14408, '三星镇', 4, 2083), +(14409, '三阳镇', 4, 2083), +(14410, '东灶港镇', 4, 2083), +(14411, '临江镇', 4, 2083), +(14412, '余东镇', 4, 2083), +(14413, '刘浩镇', 4, 2083), +(14414, '包场镇', 4, 2083), +(14415, '四甲镇', 4, 2083), +(14416, '天补镇', 4, 2083), +(14417, '常乐镇', 4, 2083), +(14418, '德胜镇', 4, 2083), +(14419, '悦来镇', 4, 2083), +(14420, '树勋镇', 4, 2083), +(14421, '正余镇', 4, 2083), +(14422, '海永乡', 4, 2083), +(14423, '海门镇', 4, 2083), +(14424, '王浩镇', 4, 2083), +(14425, '货隆镇', 4, 2083), +(14426, '麒麟镇', 4, 2083), +(14427, '唐闸镇街道', 4, 2084); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14428, '天生港镇街道', 4, 2084), +(14429, '幸福乡', 4, 2084), +(14430, '永兴街道', 4, 2084), +(14431, '秦灶街道', 4, 2084), +(14432, '陈桥乡', 4, 2084), +(14433, '三余镇', 4, 2085), +(14434, '东社镇', 4, 2085), +(14435, '二甲镇', 4, 2085), +(14436, '五接镇', 4, 2085), +(14437, '五甲镇', 4, 2085), +(14438, '先锋镇', 4, 2085), +(14439, '兴东镇', 4, 2085), +(14440, '兴仁镇', 4, 2085), +(14441, '刘桥镇', 4, 2085), +(14442, '十总镇', 4, 2085), +(14443, '四安镇', 4, 2085), +(14444, '姜灶镇', 4, 2085), +(14445, '川港镇', 4, 2085), +(14446, '平东镇', 4, 2085), +(14447, '平潮镇', 4, 2085), +(14448, '张芝山镇', 4, 2085), +(14449, '石港镇', 4, 2085), +(14450, '西亭镇', 4, 2085), +(14451, '金沙镇', 4, 2085), +(14452, '骑岸镇', 4, 2085), +(14453, '南辰乡', 4, 2086), +(14454, '双店镇', 4, 2086), +(14455, '安峰镇', 4, 2086), +(14456, '山左口乡', 4, 2086), +(14457, '岗埠农场', 4, 2086), +(14458, '平明镇', 4, 2086), +(14459, '张湾乡', 4, 2086), +(14460, '房山镇', 4, 2086), +(14461, '曲阳乡', 4, 2086), +(14462, '李埝乡', 4, 2086), +(14463, '桃林镇', 4, 2086), +(14464, '横沟乡', 4, 2086), +(14465, '洪庄镇', 4, 2086), +(14466, '浦南镇', 4, 2086), +(14467, '温泉镇', 4, 2086), +(14468, '牛山镇', 4, 2086), +(14469, '白塔埠镇', 4, 2086), +(14470, '石梁河镇', 4, 2086), +(14471, '石榴镇', 4, 2086), +(14472, '石湖乡', 4, 2086), +(14473, '青湖镇', 4, 2086), +(14474, '驼峰乡', 4, 2086), +(14475, '黄川镇', 4, 2086), +(14476, '云台乡', 4, 2087), +(14477, '云台农场', 4, 2087), +(14478, '南云台林场', 4, 2087), +(14479, '南城镇', 4, 2087), +(14480, '宁海乡', 4, 2087), +(14481, '新东街道', 4, 2087), +(14482, '新南街道', 4, 2087), +(14483, '新海街道', 4, 2087), +(14484, '浦东街道', 4, 2087), +(14485, '浦西街道', 4, 2087), +(14486, '花果山乡', 4, 2087), +(14487, '路南街道', 4, 2087), +(14488, '幸福路街道', 4, 2088), +(14489, '新坝镇', 4, 2088), +(14490, '朐阳街道', 4, 2088); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14491, '洪门街道', 4, 2088), +(14492, '海州街道', 4, 2088), +(14493, '锦屏镇', 4, 2088), +(14494, '下车乡', 4, 2089), +(14495, '东王集乡', 4, 2089), +(14496, '东辛农场', 4, 2089), +(14497, '五图河农场', 4, 2089), +(14498, '伊山镇', 4, 2089), +(14499, '伊芦乡', 4, 2089), +(14500, '侍庄乡', 4, 2089), +(14501, '南岗乡', 4, 2089), +(14502, '同兴镇', 4, 2089), +(14503, '四队镇', 4, 2089), +(14504, '图河乡', 4, 2089), +(14505, '圩丰镇', 4, 2089), +(14506, '小伊乡', 4, 2089), +(14507, '杨集镇', 4, 2089), +(14508, '板浦镇', 4, 2089), +(14509, '沂北乡', 4, 2089), +(14510, '灌西盐场', 4, 2089), +(14511, '燕尾港镇', 4, 2089), +(14512, '白蚬乡', 4, 2089), +(14513, '穆圩乡', 4, 2089), +(14514, '陡沟乡', 4, 2089), +(14515, '鲁河乡', 4, 2089), +(14516, '龙苴镇', 4, 2089), +(14517, '三口镇', 4, 2090), +(14518, '五队乡', 4, 2090), +(14519, '北陈集镇', 4, 2090), +(14520, '堆沟港镇', 4, 2090), +(14521, '孟兴庄镇', 4, 2090), +(14522, '张店镇', 4, 2090), +(14523, '新安镇', 4, 2090), +(14524, '新集乡', 4, 2090), +(14525, '李集乡', 4, 2090), +(14526, '汤沟镇', 4, 2090), +(14527, '田楼乡', 4, 2090), +(14528, '百禄镇', 4, 2090), +(14529, '花园乡', 4, 2090), +(14530, '长茂镇', 4, 2090), +(14531, '厉庄镇', 4, 2091), +(14532, '城头镇', 4, 2091), +(14533, '城西镇', 4, 2091), +(14534, '塔山镇', 4, 2091), +(14535, '墩尚镇', 4, 2091), +(14536, '宋庄镇', 4, 2091), +(14537, '柘汪镇', 4, 2091), +(14538, '欢墩镇', 4, 2091), +(14539, '沙河子园艺场', 4, 2091), +(14540, '沙河镇', 4, 2091), +(14541, '海头镇', 4, 2091), +(14542, '班庄镇', 4, 2091), +(14543, '石桥镇', 4, 2091), +(14544, '罗阳镇', 4, 2091), +(14545, '赣榆海洋经济开发区', 4, 2091), +(14546, '赣马镇', 4, 2091), +(14547, '金山镇', 4, 2091), +(14548, '门河镇', 4, 2091), +(14549, '青口盐场', 4, 2091), +(14550, '青口镇', 4, 2091), +(14551, '黑林镇', 4, 2091), +(14552, '中云街道', 4, 2092), +(14553, '云山街道', 4, 2092); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14554, '前三岛乡', 4, 2092), +(14555, '墟沟街道', 4, 2092), +(14556, '宿城乡', 4, 2092), +(14557, '朝阳镇', 4, 2092), +(14558, '板桥街道', 4, 2092), +(14559, '猴嘴街道', 4, 2092), +(14560, '连云街道', 4, 2092), +(14561, '连岛街道', 4, 2092), +(14562, '高公岛乡', 4, 2092), +(14563, '三堡乡', 4, 2093), +(14564, '上河镇', 4, 2093), +(14565, '仇桥镇', 4, 2093), +(14566, '南闸镇', 4, 2093), +(14567, '南马厂乡', 4, 2093), +(14568, '博里镇', 4, 2093), +(14569, '城东乡', 4, 2093), +(14570, '复兴镇', 4, 2093), +(14571, '季桥镇', 4, 2093), +(14572, '宋集乡', 4, 2093), +(14573, '席桥镇', 4, 2093), +(14574, '平桥镇', 4, 2093), +(14575, '建淮乡', 4, 2093), +(14576, '施河镇', 4, 2093), +(14577, '朱桥镇', 4, 2093), +(14578, '林集镇', 4, 2093), +(14579, '泾口镇', 4, 2093), +(14580, '流均镇', 4, 2093), +(14581, '淮城镇', 4, 2093), +(14582, '溪河镇', 4, 2093), +(14583, '白马湖农场', 4, 2093), +(14584, '苏嘴镇', 4, 2093), +(14585, '范集镇', 4, 2093), +(14586, '茭陵乡', 4, 2093), +(14587, '车桥镇', 4, 2093), +(14588, '钦工镇', 4, 2093), +(14589, '顺河镇', 4, 2093), +(14590, '马甸镇', 4, 2093), +(14591, '万集镇', 4, 2094), +(14592, '三河镇', 4, 2094), +(14593, '东双沟镇', 4, 2094), +(14594, '仁和镇', 4, 2094), +(14595, '共和镇', 4, 2094), +(14596, '岔河镇', 4, 2094), +(14597, '朱坝镇', 4, 2094), +(14598, '老子山镇', 4, 2094), +(14599, '蒋坝镇', 4, 2094), +(14600, '西顺河镇', 4, 2094), +(14601, '高良涧镇', 4, 2094), +(14602, '黄集镇', 4, 2094), +(14603, '东胡集镇', 4, 2095), +(14604, '义兴镇', 4, 2095), +(14605, '五港镇', 4, 2095), +(14606, '余圩办事处', 4, 2095), +(14607, '保滩镇', 4, 2095), +(14608, '前进镇', 4, 2095), +(14609, '北集办事处', 4, 2095), +(14610, '南禄办事处', 4, 2095), +(14611, '南集镇', 4, 2095), +(14612, '唐集镇', 4, 2095), +(14613, '大东镇', 4, 2095), +(14614, '小李集办事处', 4, 2095), +(14615, '岔庙镇', 4, 2095), +(14616, '工业新区', 4, 2095); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14617, '徐集乡', 4, 2095), +(14618, '成集镇', 4, 2095), +(14619, '方渡办事处', 4, 2095), +(14620, '时码办事处', 4, 2095), +(14621, '朱码镇', 4, 2095), +(14622, '杨口办事处', 4, 2095), +(14623, '梁岔镇', 4, 2095), +(14624, '河网办事处', 4, 2095), +(14625, '浅集办事处', 4, 2095), +(14626, '涟城镇', 4, 2095), +(14627, '灰墩办事处', 4, 2095), +(14628, '石湖镇', 4, 2095), +(14629, '红窑镇', 4, 2095), +(14630, '经济开发新区', 4, 2095), +(14631, '蒋庵办事处', 4, 2095), +(14632, '陈师镇', 4, 2095), +(14633, '高沟镇', 4, 2095), +(14634, '黄营乡', 4, 2095), +(14635, '丁集镇', 4, 2096), +(14636, '三树镇', 4, 2096), +(14637, '五里镇', 4, 2096), +(14638, '凌桥乡', 4, 2096), +(14639, '刘老庄乡', 4, 2096), +(14640, '南陈集镇', 4, 2096), +(14641, '古寨乡', 4, 2096), +(14642, '吴城镇', 4, 2096), +(14643, '吴集镇', 4, 2096), +(14644, '徐溜镇', 4, 2096), +(14645, '新渡乡', 4, 2096), +(14646, '棉花庄镇', 4, 2096), +(14647, '淮阴工业园', 4, 2096), +(14648, '渔沟镇', 4, 2096), +(14649, '王兴镇', 4, 2096), +(14650, '王营镇', 4, 2096), +(14651, '码头镇', 4, 2096), +(14652, '老张集乡', 4, 2096), +(14653, '袁集乡', 4, 2096), +(14654, '西宋集镇', 4, 2096), +(14655, '赵集镇', 4, 2096), +(14656, '韩桥乡', 4, 2096), +(14657, '东湖街道', 4, 2097), +(14658, '京沪路办事处', 4, 2097), +(14659, '北京路街道', 4, 2097), +(14660, '广州街道', 4, 2097), +(14661, '徐扬乡', 4, 2097), +(14662, '新港街道', 4, 2097), +(14663, '水渡口街道', 4, 2097), +(14664, '淮海街道', 4, 2097), +(14665, '西安路街道', 4, 2097), +(14666, '钵池乡', 4, 2097), +(14667, '长东街道', 4, 2097), +(14668, '长西街道', 4, 2097), +(14669, '和平镇', 4, 2098), +(14670, '城南乡', 4, 2098), +(14671, '武墩镇', 4, 2098), +(14672, '浦楼街道', 4, 2098), +(14673, '清安街道', 4, 2098), +(14674, '清江街道', 4, 2098), +(14675, '盐河镇', 4, 2098), +(14676, '闸口街道', 4, 2098), +(14677, '黄码乡', 4, 2098); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14678, '三河农场', 4, 2099), +(14679, '仇集镇', 4, 2099), +(14680, '兴隆乡', 4, 2099), +(14681, '古桑乡', 4, 2099), +(14682, '官滩镇', 4, 2099), +(14683, '旧铺镇', 4, 2099), +(14684, '明祖陵镇', 4, 2099), +(14685, '桂五镇', 4, 2099), +(14686, '河桥镇', 4, 2099), +(14687, '淮河镇', 4, 2099), +(14688, '王店乡', 4, 2099), +(14689, '盱城镇', 4, 2099), +(14690, '穆店乡', 4, 2099), +(14691, '管镇镇', 4, 2099), +(14692, '维桥乡', 4, 2099), +(14693, '观音寺镇', 4, 2099), +(14694, '铁佛镇', 4, 2099), +(14695, '马坝镇', 4, 2099), +(14696, '鲍集镇', 4, 2099), +(14697, '黄花塘镇', 4, 2099), +(14698, '前锋镇', 4, 2100), +(14699, '吕良镇', 4, 2100), +(14700, '塔集镇', 4, 2100), +(14701, '复兴圩农场', 4, 2100), +(14702, '宝应湖农场', 4, 2100), +(14703, '戴楼镇', 4, 2100), +(14704, '涂沟镇', 4, 2100), +(14705, '金北镇', 4, 2100), +(14706, '金南镇', 4, 2100), +(14707, '银集镇', 4, 2100), +(14708, '闵桥镇', 4, 2100), +(14709, '陈桥镇', 4, 2100), +(14710, '黎城镇', 4, 2100), +(14711, '三仓镇', 4, 2101), +(14712, '东台镇', 4, 2101), +(14713, '五烈镇', 4, 2101), +(14714, '南沈灶镇', 4, 2101), +(14715, '台南镇', 4, 2101), +(14716, '后港镇', 4, 2101), +(14717, '唐洋镇', 4, 2101), +(14718, '四灶镇', 4, 2101), +(14719, '头灶镇', 4, 2101), +(14720, '安丰镇', 4, 2101), +(14721, '富东镇', 4, 2101), +(14722, '富安镇', 4, 2101), +(14723, '广山镇', 4, 2101), +(14724, '廉贻镇', 4, 2101), +(14725, '弶港镇', 4, 2101), +(14726, '新曹镇', 4, 2101), +(14727, '新街镇', 4, 2101), +(14728, '时埝镇', 4, 2101), +(14729, '曹丿镇', 4, 2101), +(14730, '梁垛镇', 4, 2101), +(14731, '海丰镇', 4, 2101), +(14732, '溱东镇', 4, 2101), +(14733, '许河镇', 4, 2101), +(14734, '五星街道', 4, 2102), +(14735, '伍佑镇', 4, 2102), +(14736, '便仓镇', 4, 2102), +(14737, '先锋街道', 4, 2102), +(14738, '南洋镇', 4, 2102), +(14739, '大洋街道', 4, 2102), +(14740, '张庄镇', 4, 2102), +(14741, '文峰街道', 4, 2102), +(14742, '新兴镇', 4, 2102); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14743, '新洋街道', 4, 2102), +(14744, '步凤镇', 4, 2102), +(14745, '毓龙街道', 4, 2102), +(14746, '永丰镇', 4, 2102), +(14747, '青墩镇', 4, 2102), +(14748, '黄海街道', 4, 2102), +(14749, '七套乡', 4, 2103), +(14750, '六套乡', 4, 2103), +(14751, '南河镇', 4, 2103), +(14752, '县开发区', 4, 2103), +(14753, '双港镇', 4, 2103), +(14754, '响水镇', 4, 2103), +(14755, '大有镇', 4, 2103), +(14756, '小尖镇', 4, 2103), +(14757, '张集乡', 4, 2103), +(14758, '省属灌东盐场', 4, 2103), +(14759, '省属黄海农场', 4, 2103), +(14760, '老舍乡', 4, 2103), +(14761, '运河镇', 4, 2103), +(14762, '陈家港镇', 4, 2103); \ No newline at end of file diff --git a/install/data/common_district_2.sql b/install/data/common_district_2.sql new file mode 100644 index 0000000..7dfaeb4 --- /dev/null +++ b/install/data/common_district_2.sql @@ -0,0 +1,15000 @@ +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14763, '黄圩镇', 4, 2103), +(14764, '万盈镇', 4, 2104), +(14765, '三龙镇', 4, 2104), +(14766, '刘庄镇', 4, 2104), +(14767, '南阳镇', 4, 2104), +(14768, '大中镇', 4, 2104), +(14769, '大桥镇', 4, 2104), +(14770, '小海镇', 4, 2104), +(14771, '新丰镇', 4, 2104), +(14772, '方强镇', 4, 2104), +(14773, '白驹镇', 4, 2104), +(14774, '草堰镇', 4, 2104), +(14775, '草庙镇', 4, 2104), +(14776, '裕华镇', 4, 2104), +(14777, '西团镇', 4, 2104), +(14778, '临海镇', 4, 2105), +(14779, '兴桥镇', 4, 2105), +(14780, '千秋镇', 4, 2105), +(14781, '合德镇', 4, 2105), +(14782, '四明镇', 4, 2105), +(14783, '国营临海农场', 4, 2105), +(14784, '国营射阳盐场', 4, 2105), +(14785, '国营新洋农场', 4, 2105), +(14786, '国营淮海农场', 4, 2105), +(14787, '射阳县农业经济开发区', 4, 2105), +(14788, '新坍镇', 4, 2105), +(14789, '江苏省射阳经济开发区', 4, 2105), +(14790, '洋马镇', 4, 2105), +(14791, '海河镇', 4, 2105), +(14792, '海通镇', 4, 2105), +(14793, '特庸镇', 4, 2105), +(14794, '盐东镇', 4, 2105), +(14795, '盘湾镇', 4, 2105), +(14796, '耦耕镇', 4, 2105), +(14797, '通洋镇', 4, 2105), +(14798, '长荡镇', 4, 2105), +(14799, '阜余镇', 4, 2105), +(14800, '陈洋镇', 4, 2105), +(14801, '黄尖镇', 4, 2105), +(14802, '黄沙港镇', 4, 2105), +(14803, '上冈镇', 4, 2106), +(14804, '冈东镇', 4, 2106); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14805, '冈西镇', 4, 2106), +(14806, '宝塔镇', 4, 2106), +(14807, '庆丰镇', 4, 2106), +(14808, '建湖县经济开发区管理委员会', 4, 2106), +(14809, '建阳镇', 4, 2106), +(14810, '恒济镇', 4, 2106), +(14811, '沿河镇', 4, 2106), +(14812, '芦沟镇', 4, 2106), +(14813, '草堰口镇', 4, 2106), +(14814, '蒋营镇', 4, 2106), +(14815, '近湖镇', 4, 2106), +(14816, '钟庄镇', 4, 2106), +(14817, '颜单镇', 4, 2106), +(14818, '高作镇', 4, 2106), +(14819, '东坎镇', 4, 2107), +(14820, '五汛镇', 4, 2107), +(14821, '八巨镇', 4, 2107), +(14822, '八滩镇', 4, 2107), +(14823, '大套乡', 4, 2107), +(14824, '天场乡', 4, 2107), +(14825, '振东乡', 4, 2107), +(14826, '新滩盐场', 4, 2107), +(14827, '樊集乡', 4, 2107), +(14828, '正红镇', 4, 2107), +(14829, '滨海港镇', 4, 2107), +(14830, '滨淮农场', 4, 2107), +(14831, '滨淮镇', 4, 2107), +(14832, '界牌镇', 4, 2107), +(14833, '蔡桥镇', 4, 2107), +(14834, '通榆镇', 4, 2107), +(14835, '陈涛乡', 4, 2107), +(14836, '义丰镇', 4, 2108), +(14837, '北蒋镇', 4, 2108), +(14838, '北龙港镇', 4, 2108), +(14839, '大冈镇', 4, 2108), +(14840, '大纵湖镇', 4, 2108), +(14841, '学富镇', 4, 2108), +(14842, '尚庄镇', 4, 2108), +(14843, '张庄街道', 4, 2108), +(14844, '新区管委会', 4, 2108), +(14845, '楼王镇', 4, 2108), +(14846, '潘黄镇', 4, 2108), +(14847, '秦南镇', 4, 2108), +(14848, '葛武镇', 4, 2108), +(14849, '郭猛镇', 4, 2108), +(14850, '龙冈镇', 4, 2108), +(14851, '三灶镇', 4, 2109), +(14852, '东沟镇', 4, 2109), +(14853, '公兴镇', 4, 2109), +(14854, '古河镇', 4, 2109), +(14855, '合利镇', 4, 2109), +(14856, '吴滩镇', 4, 2109), +(14857, '开发区', 4, 2109), +(14858, '新沟镇', 4, 2109), +(14859, '施庄镇', 4, 2109), +(14860, '杨集镇', 4, 2109), +(14861, '板湖镇', 4, 2109), +(14862, '沟墩镇', 4, 2109), +(14863, '益林镇', 4, 2109), +(14864, '硕集镇', 4, 2109), +(14865, '罗桥镇', 4, 2109), +(14866, '羊寨镇', 4, 2109), +(14867, '芦蒲镇', 4, 2109), +(14868, '郭墅镇', 4, 2109); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14869, '阜城镇', 4, 2109), +(14870, '陈良镇', 4, 2109), +(14871, '陈集镇', 4, 2109), +(14872, '刘集镇', 4, 2110), +(14873, '大仪镇', 4, 2110), +(14874, '新城镇', 4, 2110), +(14875, '新集镇', 4, 2110), +(14876, '月塘乡', 4, 2110), +(14877, '朴席镇', 4, 2110), +(14878, '真州镇', 4, 2110), +(14879, '谢集乡', 4, 2110), +(14880, '陈集镇', 4, 2110), +(14881, '青山镇', 4, 2110), +(14882, '马集镇', 4, 2110), +(14883, '夏集镇', 4, 2111), +(14884, '安宜镇', 4, 2111), +(14885, '射阳湖镇', 4, 2111), +(14886, '小官庄镇', 4, 2111), +(14887, '山阳镇', 4, 2111), +(14888, '广洋湖镇', 4, 2111), +(14889, '曹甸镇', 4, 2111), +(14890, '望直港镇', 4, 2111), +(14891, '柳堡镇', 4, 2111), +(14892, '泾河镇', 4, 2111), +(14893, '范水镇', 4, 2111), +(14894, '西安丰镇', 4, 2111), +(14895, '鲁垛镇', 4, 2111), +(14896, '黄塍镇', 4, 2111), +(14897, '东关街道', 4, 2112), +(14898, '文峰街道', 4, 2112), +(14899, '曲江街道', 4, 2112), +(14900, '汤汪乡', 4, 2112), +(14901, '汶河街道', 4, 2112), +(14902, '湾头镇', 4, 2112), +(14903, '丁伙镇', 4, 2113), +(14904, '丁沟镇', 4, 2113), +(14905, '仙女镇', 4, 2113), +(14906, '吴桥镇', 4, 2113), +(14907, '大桥镇', 4, 2113), +(14908, '宜陵镇', 4, 2113), +(14909, '小纪镇', 4, 2113), +(14910, '樊川镇', 4, 2113), +(14911, '武坚镇', 4, 2113), +(14912, '浦头镇', 4, 2113), +(14913, '真武镇', 4, 2113), +(14914, '邵伯镇', 4, 2113), +(14915, '郭村镇', 4, 2113), +(14916, '八里镇', 4, 2114), +(14917, '双桥乡', 4, 2114), +(14918, '双桥街道', 4, 2114), +(14919, '城北乡', 4, 2114), +(14920, '平山乡', 4, 2114), +(14921, '扬子津街道', 4, 2114), +(14922, '文汇街街道', 4, 2114), +(14923, '施桥镇', 4, 2114), +(14924, '梅岭街道', 4, 2114), +(14925, '西湖镇', 4, 2114), +(14926, '公道镇', 4, 2115), +(14927, '头桥镇', 4, 2115), +(14928, '方巷镇', 4, 2115), +(14929, '李典镇', 4, 2115), +(14930, '杨庙镇', 4, 2115), +(14931, '杭集镇', 4, 2115), +(14932, '槐泗镇', 4, 2115); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14933, '汊河街道', 4, 2115), +(14934, '沙头镇', 4, 2115), +(14935, '泰安镇', 4, 2115), +(14936, '瓜洲镇', 4, 2115), +(14937, '甘泉镇', 4, 2115), +(14938, '蒋王街道', 4, 2115), +(14939, '邗上街道', 4, 2115), +(14940, '三垛镇', 4, 2116), +(14941, '临泽镇', 4, 2116), +(14942, '八桥镇', 4, 2116), +(14943, '卸甲镇', 4, 2116), +(14944, '司徒镇', 4, 2116), +(14945, '周山镇', 4, 2116), +(14946, '周巷镇', 4, 2116), +(14947, '天山镇', 4, 2116), +(14948, '横泾镇', 4, 2116), +(14949, '汉留镇', 4, 2116), +(14950, '汤庄镇', 4, 2116), +(14951, '甘垛镇', 4, 2116), +(14952, '界首镇', 4, 2116), +(14953, '菱塘回族乡', 4, 2116), +(14954, '车逻镇', 4, 2116), +(14955, '送桥镇', 4, 2116), +(14956, '郭集镇', 4, 2116), +(14957, '马棚镇', 4, 2116), +(14958, '高邮镇', 4, 2116), +(14959, '龙虬镇', 4, 2116), +(14960, '上党镇', 4, 2117), +(14961, '世业镇', 4, 2117), +(14962, '宝堰镇', 4, 2117), +(14963, '谷阳镇', 4, 2117), +(14964, '辛丰镇', 4, 2117), +(14965, '高桥镇', 4, 2117), +(14966, '高资镇', 4, 2117), +(14967, '云阳镇', 4, 2118), +(14968, '司徒镇', 4, 2118), +(14969, '后巷镇', 4, 2118), +(14970, '吕城镇', 4, 2118), +(14971, '埤城镇', 4, 2118), +(14972, '导墅镇', 4, 2118), +(14973, '延陵镇', 4, 2118), +(14974, '新桥镇', 4, 2118), +(14975, '珥陵镇', 4, 2118), +(14976, '界牌镇', 4, 2118), +(14977, '皇塘镇', 4, 2118), +(14978, '访仙镇', 4, 2118), +(14979, '陵口镇', 4, 2118), +(14980, '丁卯街道', 4, 2119), +(14981, '丁岗镇', 4, 2119), +(14982, '健康路街道', 4, 2119), +(14983, '四牌楼街道', 4, 2119), +(14984, '大市口街道', 4, 2119), +(14985, '大港街道', 4, 2119), +(14986, '大港镇', 4, 2119), +(14987, '大路镇', 4, 2119), +(14988, '姚桥镇', 4, 2119), +(14989, '正东路街道', 4, 2119), +(14990, '谏壁镇', 4, 2119), +(14991, '象山镇', 4, 2119), +(14992, '下蜀镇', 4, 2120), +(14993, '华阳镇', 4, 2120), +(14994, '后白镇', 4, 2120), +(14995, '天王镇', 4, 2120), +(14996, '宝华镇', 4, 2120); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(14997, '白兔镇', 4, 2120), +(14998, '茅山镇', 4, 2120), +(14999, '边城镇', 4, 2120), +(15000, '郭庄镇', 4, 2120), +(15001, '黄梅镇', 4, 2120), +(15002, '三茅镇', 4, 2121), +(15003, '八桥镇', 4, 2121), +(15004, '新坝镇', 4, 2121), +(15005, '油坊镇', 4, 2121), +(15006, '西来桥镇', 4, 2121), +(15007, '七里甸街道', 4, 2122), +(15008, '和平路街道', 4, 2122), +(15009, '宝塔路街道', 4, 2122), +(15010, '蒋乔镇', 4, 2122), +(15011, '金山街道', 4, 2122), +(15012, '下圩镇', 4, 2123), +(15013, '中堡镇', 4, 2123), +(15014, '临城镇', 4, 2123), +(15015, '合陈镇', 4, 2123), +(15016, '周奋乡', 4, 2123), +(15017, '周庄镇', 4, 2123), +(15018, '垛田镇', 4, 2123), +(15019, '城东镇', 4, 2123), +(15020, '大垛镇', 4, 2123), +(15021, '大营镇', 4, 2123), +(15022, '大邹镇', 4, 2123), +(15023, '安丰镇', 4, 2123), +(15024, '张郭镇', 4, 2123), +(15025, '戴南镇', 4, 2123), +(15026, '戴窑镇', 4, 2123), +(15027, '新垛镇', 4, 2123), +(15028, '昌荣镇', 4, 2123), +(15029, '昭阳镇', 4, 2123), +(15030, '李中镇', 4, 2123), +(15031, '林湖乡', 4, 2123), +(15032, '永丰镇', 4, 2123), +(15033, '沈伦镇', 4, 2123), +(15034, '沙沟镇', 4, 2123), +(15035, '海南镇', 4, 2123), +(15036, '竹泓镇', 4, 2123), +(15037, '缸顾乡', 4, 2123), +(15038, '老圩乡', 4, 2123), +(15039, '茅山镇', 4, 2123), +(15040, '荻垛镇', 4, 2123), +(15041, '西郊镇', 4, 2123), +(15042, '西鲍乡', 4, 2123), +(15043, '钓鱼镇', 4, 2123), +(15044, '陈堡镇', 4, 2123), +(15045, '陶庄镇', 4, 2123), +(15046, '俞垛镇', 4, 2124), +(15047, '兴泰镇', 4, 2124), +(15048, '华港镇', 4, 2124), +(15049, '城东街道', 4, 2124), +(15050, '城中街道', 4, 2124), +(15051, '城南街道', 4, 2124), +(15052, '大伦镇', 4, 2124), +(15053, '大泗镇', 4, 2124), +(15054, '姜堰镇', 4, 2124), +(15055, '娄庄镇', 4, 2124), +(15056, '张甸镇', 4, 2124), +(15057, '桥头镇', 4, 2124), +(15058, '梁徐镇', 4, 2124), +(15059, '沈高镇', 4, 2124), +(15060, '淤溪镇', 4, 2124), +(15061, '溱潼镇', 4, 2124); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15062, '白米镇', 4, 2124), +(15063, '罡杨镇', 4, 2124), +(15064, '苏陈镇', 4, 2124), +(15065, '蒋垛镇', 4, 2124), +(15066, '顾高镇', 4, 2124), +(15067, '七圩镇', 4, 2125), +(15068, '元竹镇', 4, 2125), +(15069, '分界镇', 4, 2125), +(15070, '刘陈镇', 4, 2125), +(15071, '南沙镇', 4, 2125), +(15072, '古溪镇', 4, 2125), +(15073, '大生镇', 4, 2125), +(15074, '姚王镇', 4, 2125), +(15075, '宣堡镇', 4, 2125), +(15076, '广陵镇', 4, 2125), +(15077, '张桥镇', 4, 2125), +(15078, '新街镇', 4, 2125), +(15079, '曲霞镇', 4, 2125), +(15080, '根思乡', 4, 2125), +(15081, '横垛镇', 4, 2125), +(15082, '河失镇', 4, 2125), +(15083, '泰兴镇', 4, 2125), +(15084, '溪桥镇', 4, 2125), +(15085, '珊瑚镇', 4, 2125), +(15086, '胡庄镇', 4, 2125), +(15087, '蒋华镇', 4, 2125), +(15088, '过船镇', 4, 2125), +(15089, '马甸镇', 4, 2125), +(15090, '黄桥镇', 4, 2125), +(15091, '九龙镇', 4, 2126), +(15092, '京泰路街道', 4, 2126), +(15093, '凤凰路街道', 4, 2126), +(15094, '城东街道', 4, 2126), +(15095, '城中街道', 4, 2126), +(15096, '城北街道', 4, 2126), +(15097, '城南街道', 4, 2126), +(15098, '城西街道', 4, 2126), +(15099, '寺巷镇', 4, 2126), +(15100, '泰山街道', 4, 2126), +(15101, '东兴镇', 4, 2127), +(15102, '季市镇', 4, 2127), +(15103, '孤山镇', 4, 2127), +(15104, '斜桥镇', 4, 2127), +(15105, '新桥镇', 4, 2127), +(15106, '生祠镇', 4, 2127), +(15107, '红光镇', 4, 2127), +(15108, '西来镇', 4, 2127), +(15109, '靖城镇', 4, 2127), +(15110, '马桥镇', 4, 2127), +(15111, '刁铺街道', 4, 2128), +(15112, '口岸街道', 4, 2128), +(15113, '永安洲镇', 4, 2128), +(15114, '白马镇', 4, 2128), +(15115, '许庄街道', 4, 2128), +(15116, '野徐镇', 4, 2128), +(15117, '三棵树乡', 4, 2129), +(15118, '中杨镇', 4, 2129), +(15119, '仓集镇', 4, 2129), +(15120, '南蔡乡', 4, 2129), +(15121, '双庄镇', 4, 2129), +(15122, '古城街道', 4, 2129), +(15123, '古楚街道', 4, 2129), +(15124, '埠子镇', 4, 2129), +(15125, '屠园乡', 4, 2129); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15126, '幸福街道', 4, 2129), +(15127, '河滨街道', 4, 2129), +(15128, '洋北镇', 4, 2129), +(15129, '洋河镇', 4, 2129), +(15130, '罗圩乡', 4, 2129), +(15131, '耿车镇', 4, 2129), +(15132, '郑楼镇', 4, 2129), +(15133, '陈集镇', 4, 2129), +(15134, '项里街道', 4, 2129), +(15135, '黄河街道', 4, 2129), +(15136, '龙河镇', 4, 2129), +(15137, '丁嘴镇', 4, 2130), +(15138, '井头乡', 4, 2130), +(15139, '仰化镇', 4, 2130), +(15140, '侍岭镇', 4, 2130), +(15141, '保安乡', 4, 2130), +(15142, '关庙镇', 4, 2130), +(15143, '大兴镇', 4, 2130), +(15144, '新庄镇', 4, 2130), +(15145, '晓店镇', 4, 2130), +(15146, '曹集乡', 4, 2130), +(15147, '来龙镇', 4, 2130), +(15148, '王官集镇', 4, 2130), +(15149, '皂河镇', 4, 2130), +(15150, '蔡集镇', 4, 2130), +(15151, '陆集镇', 4, 2130), +(15152, '顺河镇', 4, 2130), +(15153, '黄墩镇', 4, 2130), +(15154, '万匹乡', 4, 2131), +(15155, '东小店乡', 4, 2131), +(15156, '刘集镇', 4, 2131), +(15157, '北丁集乡', 4, 2131), +(15158, '华冲镇', 4, 2131), +(15159, '吴集镇', 4, 2131), +(15160, '周集乡', 4, 2131), +(15161, '塘沟镇', 4, 2131), +(15162, '官墩乡', 4, 2131), +(15163, '庙头镇', 4, 2131), +(15164, '张圩乡', 4, 2131), +(15165, '悦来镇', 4, 2131), +(15166, '扎下镇', 4, 2131), +(15167, '新河镇', 4, 2131), +(15168, '李恒镇', 4, 2131), +(15169, '桑墟镇', 4, 2131), +(15170, '汤涧镇', 4, 2131), +(15171, '沂涛镇', 4, 2131), +(15172, '沭城镇', 4, 2131), +(15173, '湖东镇', 4, 2131), +(15174, '潼阳镇', 4, 2131), +(15175, '耿圩镇', 4, 2131), +(15176, '胡集镇', 4, 2131), +(15177, '茆圩乡', 4, 2131), +(15178, '西圩乡', 4, 2131), +(15179, '贤官镇', 4, 2131), +(15180, '钱集镇', 4, 2131), +(15181, '陇集镇', 4, 2131), +(15182, '青伊湖农场', 4, 2131), +(15183, '青伊湖镇', 4, 2131), +(15184, '韩山镇', 4, 2131), +(15185, '颜集镇', 4, 2131), +(15186, '马厂镇', 4, 2131), +(15187, '高墟镇', 4, 2131), +(15188, '龙庙镇', 4, 2131), +(15189, '上塘镇', 4, 2132), +(15190, '临淮镇', 4, 2132); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15191, '半城镇', 4, 2132), +(15192, '双沟镇', 4, 2132), +(15193, '四河乡', 4, 2132), +(15194, '城头乡', 4, 2132), +(15195, '天岗湖乡', 4, 2132), +(15196, '太平镇', 4, 2132), +(15197, '孙园镇', 4, 2132), +(15198, '峰山乡', 4, 2132), +(15199, '归仁镇', 4, 2132), +(15200, '曹庙乡', 4, 2132), +(15201, '朱湖镇', 4, 2132), +(15202, '梅花镇', 4, 2132), +(15203, '江苏省洪泽湖农场', 4, 2132), +(15204, '瑶沟乡', 4, 2132), +(15205, '界集镇', 4, 2132), +(15206, '石集乡', 4, 2132), +(15207, '车门乡', 4, 2132), +(15208, '金锁镇', 4, 2132), +(15209, '陈圩乡', 4, 2132), +(15210, '青阳镇', 4, 2132), +(15211, '魏营镇', 4, 2132), +(15212, '龙集镇', 4, 2132), +(15213, '三庄乡', 4, 2133), +(15214, '临河镇', 4, 2133), +(15215, '众兴镇', 4, 2133), +(15216, '八集乡', 4, 2133), +(15217, '南刘集乡', 4, 2133), +(15218, '卢集镇', 4, 2133), +(15219, '庄圩乡', 4, 2133), +(15220, '张家圩镇', 4, 2133), +(15221, '新袁镇', 4, 2133), +(15222, '李口镇', 4, 2133), +(15223, '棉花原种场', 4, 2133), +(15224, '泗阳农场', 4, 2133), +(15225, '爱园镇', 4, 2133), +(15226, '王集镇', 4, 2133), +(15227, '穿城镇', 4, 2133), +(15228, '裴圩镇', 4, 2133), +(15229, '里仁乡', 4, 2133), +(15230, '高渡镇', 4, 2133), +(15231, '南星街道', 4, 2134), +(15232, '小营街道', 4, 2134), +(15233, '望江街道', 4, 2134), +(15234, '清波街道', 4, 2134), +(15235, '湖滨街道', 4, 2134), +(15236, '紫阳街道', 4, 2134), +(15237, '东新街道', 4, 2135), +(15238, '天水街道', 4, 2135), +(15239, '文晖街道', 4, 2135), +(15240, '朝晖街道', 4, 2135), +(15241, '武林街道', 4, 2135), +(15242, '潮鸣街道', 4, 2135), +(15243, '石桥街道', 4, 2135), +(15244, '长庆街道', 4, 2135), +(15245, '三口镇', 4, 2136), +(15246, '上甘街道', 4, 2136), +(15247, '乐平乡', 4, 2136), +(15248, '千洪乡', 4, 2136), +(15249, '大峡谷镇', 4, 2136), +(15250, '太湖源镇', 4, 2136), +(15251, '太阳镇', 4, 2136), +(15252, '岛石镇', 4, 2136), +(15253, '新桥乡', 4, 2136); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15254, '于潜镇', 4, 2136), +(15255, '昌化镇', 4, 2136), +(15256, '板桥乡', 4, 2136), +(15257, '横畈镇', 4, 2136), +(15258, '横路乡', 4, 2136), +(15259, '河桥镇', 4, 2136), +(15260, '清凉峰镇', 4, 2136), +(15261, '湍口镇', 4, 2136), +(15262, '潜川镇', 4, 2136), +(15263, '玲珑街道', 4, 2136), +(15264, '藻溪镇', 4, 2136), +(15265, '西天目乡', 4, 2136), +(15266, '锦城街道', 4, 2136), +(15267, '青山湖街道', 4, 2136), +(15268, '马啸乡', 4, 2136), +(15269, '高虹镇', 4, 2136), +(15270, '龙岗镇', 4, 2136), +(15271, '东湖街道', 4, 2137), +(15272, '中泰乡', 4, 2137), +(15273, '临平街道', 4, 2137), +(15274, '乔司镇', 4, 2137), +(15275, '仁和镇', 4, 2137), +(15276, '仓前镇', 4, 2137), +(15277, '余杭镇', 4, 2137), +(15278, '南苑街道', 4, 2137), +(15279, '塘栖镇', 4, 2137), +(15280, '崇贤镇', 4, 2137), +(15281, '径山镇', 4, 2137), +(15282, '星桥街道', 4, 2137), +(15283, '瓶窑镇', 4, 2137), +(15284, '百丈镇', 4, 2137), +(15285, '良渚镇', 4, 2137), +(15286, '运河镇', 4, 2137), +(15287, '闲林镇', 4, 2137), +(15288, '鸬鸟镇', 4, 2137), +(15289, '黄湖镇', 4, 2137), +(15290, '万市镇', 4, 2138), +(15291, '上官乡', 4, 2138), +(15292, '东洲街道', 4, 2138), +(15293, '受降镇', 4, 2138), +(15294, '场口镇', 4, 2138), +(15295, '大源镇', 4, 2138), +(15296, '富春街道', 4, 2138), +(15297, '常安镇', 4, 2138), +(15298, '常绿镇', 4, 2138), +(15299, '新桐乡', 4, 2138), +(15300, '新登镇', 4, 2138), +(15301, '春建乡', 4, 2138), +(15302, '春江街道', 4, 2138), +(15303, '永昌镇', 4, 2138), +(15304, '洞桥镇', 4, 2138), +(15305, '渌渚镇', 4, 2138), +(15306, '渔山乡', 4, 2138), +(15307, '湖源乡', 4, 2138), +(15308, '灵桥镇', 4, 2138), +(15309, '环山乡', 4, 2138), +(15310, '胥口镇', 4, 2138), +(15311, '里山镇', 4, 2138), +(15312, '高桥镇', 4, 2138), +(15313, '鹿山街道', 4, 2138), +(15314, '龙门镇', 4, 2138), +(15315, '三都镇', 4, 2139), +(15316, '下涯镇', 4, 2139), +(15317, '干潭镇', 4, 2139); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15318, '大同镇', 4, 2139), +(15319, '大慈岩镇', 4, 2139), +(15320, '大洋镇', 4, 2139), +(15321, '寿昌镇', 4, 2139), +(15322, '新安江街道', 4, 2139), +(15323, '更楼街道', 4, 2139), +(15324, '李家镇', 4, 2139), +(15325, '杨村桥镇', 4, 2139), +(15326, '梅城镇', 4, 2139), +(15327, '洋溪街道', 4, 2139), +(15328, '航头镇', 4, 2139), +(15329, '莲花镇', 4, 2139), +(15330, '钦堂乡', 4, 2139), +(15331, '上塘镇', 4, 2140), +(15332, '半山镇', 4, 2140), +(15333, '和睦街道', 4, 2140), +(15334, '大关街道', 4, 2140), +(15335, '小河街道', 4, 2140), +(15336, '康桥镇', 4, 2140), +(15337, '拱宸桥街道', 4, 2140), +(15338, '湖墅街道', 4, 2140), +(15339, '祥符镇', 4, 2140), +(15340, '米市巷街道', 4, 2140), +(15341, '凤川镇', 4, 2141), +(15342, '分水镇', 4, 2141), +(15343, '合村乡', 4, 2141), +(15344, '富春江镇', 4, 2141), +(15345, '新合乡', 4, 2141), +(15346, '旧县街道', 4, 2141), +(15347, '桐君街道', 4, 2141), +(15348, '横村镇', 4, 2141), +(15349, '江南镇', 4, 2141), +(15350, '瑶琳镇', 4, 2141), +(15351, '百江镇', 4, 2141), +(15352, '莪山畲族乡', 4, 2141), +(15353, '钟山乡', 4, 2141), +(15354, '丁桥镇', 4, 2142), +(15355, '下沙街道', 4, 2142), +(15356, '九堡镇', 4, 2142), +(15357, '凯旋街道', 4, 2142), +(15358, '四季青街道', 4, 2142), +(15359, '彭埠镇', 4, 2142), +(15360, '白杨街道', 4, 2142), +(15361, '笕桥镇', 4, 2142), +(15362, '采荷街道', 4, 2142), +(15363, '闸弄口街道', 4, 2142), +(15364, '中洲镇', 4, 2143), +(15365, '临岐镇', 4, 2143), +(15366, '千岛湖镇', 4, 2143), +(15367, '大墅镇', 4, 2143), +(15368, '姜家镇', 4, 2143), +(15369, '威坪镇', 4, 2143), +(15370, '安阳乡', 4, 2143), +(15371, '宋村乡', 4, 2143), +(15372, '富文乡', 4, 2143), +(15373, '屏门乡', 4, 2143), +(15374, '左口乡', 4, 2143), +(15375, '文昌镇', 4, 2143), +(15376, '枫树岭镇', 4, 2143), +(15377, '梓桐镇', 4, 2143), +(15378, '汾口镇', 4, 2143), +(15379, '浪川乡', 4, 2143), +(15380, '王阜乡', 4, 2143); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15381, '瑶山乡', 4, 2143), +(15382, '界首乡', 4, 2143), +(15383, '石林镇', 4, 2143), +(15384, '里商乡', 4, 2143), +(15385, '金峰乡', 4, 2143), +(15386, '鸠坑乡', 4, 2143), +(15387, '浦沿街道', 4, 2144), +(15388, '西兴街道', 4, 2144), +(15389, '长河街道', 4, 2144), +(15390, '临浦镇', 4, 2145), +(15391, '义桥镇', 4, 2145), +(15392, '义蓬镇', 4, 2145), +(15393, '党山镇', 4, 2145), +(15394, '党湾镇', 4, 2145), +(15395, '北干街道', 4, 2145), +(15396, '南阳镇', 4, 2145), +(15397, '坎山镇', 4, 2145), +(15398, '城厢街道', 4, 2145), +(15399, '宁围镇', 4, 2145), +(15400, '戴村镇', 4, 2145), +(15401, '所前镇', 4, 2145), +(15402, '新塘街道', 4, 2145), +(15403, '新湾镇', 4, 2145), +(15404, '新街镇', 4, 2145), +(15405, '楼塔镇', 4, 2145), +(15406, '河上镇', 4, 2145), +(15407, '河庄镇', 4, 2145), +(15408, '浦阳镇', 4, 2145), +(15409, '瓜沥镇', 4, 2145), +(15410, '益农镇', 4, 2145), +(15411, '蜀山街道', 4, 2145), +(15412, '衙前镇', 4, 2145), +(15413, '进化镇', 4, 2145), +(15414, '闻堰镇', 4, 2145), +(15415, '靖江镇', 4, 2145), +(15416, '三墩镇', 4, 2146), +(15417, '北山街道', 4, 2146), +(15418, '古荡街道', 4, 2146), +(15419, '周浦乡', 4, 2146), +(15420, '文新街道', 4, 2146), +(15421, '灵隐街道', 4, 2146), +(15422, '留下镇', 4, 2146), +(15423, '翠苑街道', 4, 2146), +(15424, '蒋村乡', 4, 2146), +(15425, '袁浦镇', 4, 2146), +(15426, '西湖街道', 4, 2146), +(15427, '西溪街道', 4, 2146), +(15428, '转塘镇', 4, 2146), +(15429, '龙坞镇', 4, 2146), +(15430, '丈亭镇', 4, 2147), +(15431, '三七市镇', 4, 2147), +(15432, '临山镇', 4, 2147), +(15433, '低塘街道', 4, 2147), +(15434, '兰江街道', 4, 2147), +(15435, '凤山街道', 4, 2147), +(15436, '四明山镇', 4, 2147), +(15437, '大岚镇', 4, 2147), +(15438, '大隐镇', 4, 2147), +(15439, '小曹娥镇', 4, 2147), +(15440, '梁弄镇', 4, 2147), +(15441, '梨洲街道', 4, 2147), +(15442, '河姆渡镇', 4, 2147), +(15443, '泗门镇', 4, 2147), +(15444, '牟山镇', 4, 2147); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15445, '郎霞街道', 4, 2147), +(15446, '阳明街道', 4, 2147), +(15447, '陆埠镇', 4, 2147), +(15448, '马渚镇', 4, 2147), +(15449, '鹿亭乡', 4, 2147), +(15450, '黄家埠镇', 4, 2147), +(15451, '大碶街道', 4, 2148), +(15452, '小港街道', 4, 2148), +(15453, '新碶街道', 4, 2148), +(15454, '春晓镇', 4, 2148), +(15455, '柴桥街道', 4, 2148), +(15456, '梅山乡', 4, 2148), +(15457, '白峰镇', 4, 2148), +(15458, '霞浦街道', 4, 2148), +(15459, '大堰镇', 4, 2149), +(15460, '尚田镇', 4, 2149), +(15461, '岳林街道', 4, 2149), +(15462, '松岙镇', 4, 2149), +(15463, '江口街道', 4, 2149), +(15464, '溪口镇', 4, 2149), +(15465, '莼湖镇', 4, 2149), +(15466, '萧王庙街道', 4, 2149), +(15467, '裘村镇', 4, 2149), +(15468, '西坞街道', 4, 2149), +(15469, '锦屏街道', 4, 2149), +(15470, '一市镇', 4, 2150), +(15471, '前童镇', 4, 2150), +(15472, '力洋镇', 4, 2150), +(15473, '大佳何镇', 4, 2150), +(15474, '岔路镇', 4, 2150), +(15475, '强蛟镇', 4, 2150), +(15476, '桃源街道', 4, 2150), +(15477, '桑洲镇', 4, 2150), +(15478, '桥头胡街道', 4, 2150), +(15479, '梅林街道', 4, 2150), +(15480, '深圳镇', 4, 2150), +(15481, '胡陈乡', 4, 2150), +(15482, '茶院乡', 4, 2150), +(15483, '西店镇', 4, 2150), +(15484, '越溪乡', 4, 2150), +(15485, '跃龙街道', 4, 2150), +(15486, '长街镇', 4, 2150), +(15487, '黄坛镇', 4, 2150), +(15488, '三北镇', 4, 2151), +(15489, '匡堰镇', 4, 2151), +(15490, '周巷镇', 4, 2151), +(15491, '坎墩街道', 4, 2151), +(15492, '天元镇', 4, 2151), +(15493, '宗汉街道', 4, 2151), +(15494, '崇寿镇', 4, 2151), +(15495, '庵东镇', 4, 2151), +(15496, '掌起镇', 4, 2151), +(15497, '新浦镇', 4, 2151), +(15498, '桥头镇', 4, 2151), +(15499, '横河镇', 4, 2151), +(15500, '浒山街道', 4, 2151), +(15501, '胜山镇', 4, 2151), +(15502, '范市镇', 4, 2151), +(15503, '观海卫镇', 4, 2151), +(15504, '逍林镇', 4, 2151), +(15505, '长河镇', 4, 2151), +(15506, '附海镇', 4, 2151), +(15507, '龙山镇', 4, 2151); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15508, '东柳街道', 4, 2152), +(15509, '东胜街道', 4, 2152), +(15510, '东郊街道', 4, 2152), +(15511, '明楼街道', 4, 2152), +(15512, '白鹤街道', 4, 2152), +(15513, '百丈街道', 4, 2152), +(15514, '福明街道', 4, 2152), +(15515, '中马街道', 4, 2153), +(15516, '孔浦街道', 4, 2153), +(15517, '庄桥街道', 4, 2153), +(15518, '慈城镇', 4, 2153), +(15519, '文教街道', 4, 2153), +(15520, '洪塘街道', 4, 2153), +(15521, '甬江街道', 4, 2153), +(15522, '白沙街道', 4, 2153), +(15523, '南门街道', 4, 2154), +(15524, '月湖街道', 4, 2154), +(15525, '望春街道', 4, 2154), +(15526, '段塘街道', 4, 2154), +(15527, '江厦街道', 4, 2154), +(15528, '白云街道', 4, 2154), +(15529, '西门街道', 4, 2154), +(15530, '鼓楼街道', 4, 2154), +(15531, '东陈乡', 4, 2155), +(15532, '丹东街道', 4, 2155), +(15533, '丹西街道', 4, 2155), +(15534, '墙头镇', 4, 2155), +(15535, '大徐镇', 4, 2155), +(15536, '定塘镇', 4, 2155), +(15537, '新桥镇', 4, 2155), +(15538, '晓塘乡', 4, 2155), +(15539, '泗洲头镇', 4, 2155), +(15540, '涂茨镇', 4, 2155), +(15541, '爵溪街道', 4, 2155), +(15542, '石浦镇', 4, 2155), +(15543, '茅洋乡', 4, 2155), +(15544, '西周镇', 4, 2155), +(15545, '贤庠镇', 4, 2155), +(15546, '高塘岛乡', 4, 2155), +(15547, '鹤浦镇', 4, 2155), +(15548, '黄避岙乡', 4, 2155), +(15549, '下应街道', 4, 2156), +(15550, '东吴镇', 4, 2156), +(15551, '云龙镇', 4, 2156), +(15552, '五乡镇', 4, 2156), +(15553, '古林镇', 4, 2156), +(15554, '咸祥镇', 4, 2156), +(15555, '塘溪镇', 4, 2156), +(15556, '姜山镇', 4, 2156), +(15557, '横溪镇', 4, 2156), +(15558, '横街镇', 4, 2156), +(15559, '洞桥镇', 4, 2156), +(15560, '瞻岐镇', 4, 2156), +(15561, '石碶街道', 4, 2156), +(15562, '章水镇', 4, 2156), +(15563, '邱隘镇', 4, 2156), +(15564, '鄞江镇', 4, 2156), +(15565, '钟公庙街道', 4, 2156), +(15566, '集士港镇', 4, 2156), +(15567, '高桥镇', 4, 2156), +(15568, '龙观乡', 4, 2156), +(15569, '九龙湖镇', 4, 2157); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15570, '庄市街道', 4, 2157), +(15571, '招宝山街道', 4, 2157), +(15572, '澥浦镇', 4, 2157), +(15573, '蛟川街道', 4, 2157), +(15574, '骆驼街道', 4, 2157), +(15575, '七里港镇', 4, 2158), +(15576, '乐成镇', 4, 2158), +(15577, '仙溪镇', 4, 2158), +(15578, '北白象镇', 4, 2158), +(15579, '南塘镇', 4, 2158), +(15580, '南岳镇', 4, 2158), +(15581, '双峰乡', 4, 2158), +(15582, '四都乡', 4, 2158), +(15583, '城北乡', 4, 2158), +(15584, '大荆镇', 4, 2158), +(15585, '天成乡', 4, 2158), +(15586, '岭底乡', 4, 2158), +(15587, '智仁乡', 4, 2158), +(15588, '柳市镇', 4, 2158), +(15589, '淡溪镇', 4, 2158), +(15590, '清江镇', 4, 2158), +(15591, '湖雾镇', 4, 2158), +(15592, '白石镇', 4, 2158), +(15593, '石帆镇', 4, 2158), +(15594, '磐石镇', 4, 2158), +(15595, '福溪乡', 4, 2158), +(15596, '翁垟镇', 4, 2158), +(15597, '芙蓉镇', 4, 2158), +(15598, '蒲岐镇', 4, 2158), +(15599, '虹桥镇', 4, 2158), +(15600, '象阳镇', 4, 2158), +(15601, '镇安乡', 4, 2158), +(15602, '雁湖乡', 4, 2158), +(15603, '雁荡镇', 4, 2158), +(15604, '黄华镇', 4, 2158), +(15605, '龙西乡', 4, 2158), +(15606, '凤卧镇', 4, 2159), +(15607, '凤巢乡', 4, 2159), +(15608, '南湖乡', 4, 2159), +(15609, '南雁镇', 4, 2159), +(15610, '南麂镇', 4, 2159), +(15611, '吴垟乡', 4, 2159), +(15612, '宋埠镇', 4, 2159), +(15613, '宋桥镇', 4, 2159), +(15614, '山门镇', 4, 2159), +(15615, '怀溪乡', 4, 2159), +(15616, '昆阳镇', 4, 2159), +(15617, '晓坑乡', 4, 2159), +(15618, '朝阳乡', 4, 2159), +(15619, '桃源乡', 4, 2159), +(15620, '梅源乡', 4, 2159), +(15621, '梅溪乡', 4, 2159), +(15622, '榆垟镇', 4, 2159), +(15623, '水头镇', 4, 2159), +(15624, '维新乡', 4, 2159), +(15625, '腾蛟镇', 4, 2159), +(15626, '萧江镇', 4, 2159), +(15627, '西湾乡', 4, 2159), +(15628, '郑楼镇', 4, 2159), +(15629, '钱仓镇', 4, 2159), +(15630, '闹村乡', 4, 2159), +(15631, '青街畲族乡', 4, 2159), +(15632, '顺溪镇', 4, 2159), +(15633, '鳌江镇', 4, 2159), +(15634, '鹤溪镇', 4, 2159); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15635, '麻步镇', 4, 2159), +(15636, '龙尾乡', 4, 2159), +(15637, '上林乡', 4, 2160), +(15638, '下垟乡', 4, 2160), +(15639, '东溪乡', 4, 2160), +(15640, '二源乡', 4, 2160), +(15641, '云湖乡', 4, 2160), +(15642, '仰山乡', 4, 2160), +(15643, '公阳乡', 4, 2160), +(15644, '十源乡', 4, 2160), +(15645, '南田镇', 4, 2160), +(15646, '双桂乡', 4, 2160), +(15647, '周壤乡', 4, 2160), +(15648, '周山畲族乡', 4, 2160), +(15649, '大峃镇', 4, 2160), +(15650, '富岙乡', 4, 2160), +(15651, '岭后乡', 4, 2160), +(15652, '峃口乡', 4, 2160), +(15653, '巨屿镇', 4, 2160), +(15654, '平和乡', 4, 2160), +(15655, '朱雅乡', 4, 2160), +(15656, '桂山乡', 4, 2160), +(15657, '樟台乡', 4, 2160), +(15658, '玉壶镇', 4, 2160), +(15659, '珊溪镇', 4, 2160), +(15660, '百丈漈镇', 4, 2160), +(15661, '石垟乡', 4, 2160), +(15662, '西坑畲族镇', 4, 2160), +(15663, '里阳乡', 4, 2160), +(15664, '金垟乡', 4, 2160), +(15665, '金星乡', 4, 2160), +(15666, '金炉乡', 4, 2160), +(15667, '黄坦镇', 4, 2160), +(15668, '黄寮乡', 4, 2160), +(15669, '龙川乡', 4, 2160), +(15670, '上塘镇', 4, 2161), +(15671, '下寮乡', 4, 2161), +(15672, '东皋乡', 4, 2161), +(15673, '乌牛镇', 4, 2161), +(15674, '五(氵束鸟)乡', 4, 2161), +(15675, '大岙乡', 4, 2161), +(15676, '大箬岩镇', 4, 2161), +(15677, '山坑乡', 4, 2161), +(15678, '岩坦镇', 4, 2161), +(15679, '岩头镇', 4, 2161), +(15680, '岭头乡', 4, 2161), +(15681, '巽宅镇', 4, 2161), +(15682, '应坑乡', 4, 2161), +(15683, '张溪乡', 4, 2161), +(15684, '徐岙乡', 4, 2161), +(15685, '昆阳乡', 4, 2161), +(15686, '枫林镇', 4, 2161), +(15687, '桥下镇', 4, 2161), +(15688, '桥头镇', 4, 2161), +(15689, '沙头镇', 4, 2161), +(15690, '渠口乡', 4, 2161), +(15691, '溪下乡', 4, 2161), +(15692, '溪口乡', 4, 2161), +(15693, '潘坑乡', 4, 2161), +(15694, '瓯北镇', 4, 2161), +(15695, '界坑乡', 4, 2161), +(15696, '石染乡', 4, 2161), +(15697, '碧莲镇', 4, 2161), +(15698, '花坦乡', 4, 2161), +(15699, '茗岙乡', 4, 2161); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15700, '表山乡', 4, 2161), +(15701, '西岙乡', 4, 2161), +(15702, '西源乡', 4, 2161), +(15703, '西溪乡', 4, 2161), +(15704, '陡门乡', 4, 2161), +(15705, '鲤溪乡', 4, 2161), +(15706, '鹤盛乡', 4, 2161), +(15707, '黄南乡', 4, 2161), +(15708, '万排乡', 4, 2162), +(15709, '三魁镇', 4, 2162), +(15710, '下洪乡', 4, 2162), +(15711, '东溪乡', 4, 2162), +(15712, '九峰乡', 4, 2162), +(15713, '仕阳镇', 4, 2162), +(15714, '仙稔乡', 4, 2162), +(15715, '凤垟乡', 4, 2162), +(15716, '包垟乡', 4, 2162), +(15717, '南院乡', 4, 2162), +(15718, '司前畲族镇', 4, 2162), +(15719, '垟溪乡', 4, 2162), +(15720, '大安乡', 4, 2162), +(15721, '岭北乡', 4, 2162), +(15722, '峰文乡', 4, 2162), +(15723, '峰门乡', 4, 2162), +(15724, '彭溪镇', 4, 2162), +(15725, '新浦乡', 4, 2162), +(15726, '月湖乡', 4, 2162), +(15727, '松垟乡', 4, 2162), +(15728, '柳峰乡', 4, 2162), +(15729, '横坑乡', 4, 2162), +(15730, '泗溪镇', 4, 2162), +(15731, '洲岭乡', 4, 2162), +(15732, '百丈镇', 4, 2162), +(15733, '碑排乡', 4, 2162), +(15734, '竹里畲族乡', 4, 2162), +(15735, '筱村镇', 4, 2162), +(15736, '罗阳镇', 4, 2162), +(15737, '翁山乡', 4, 2162), +(15738, '联云乡', 4, 2162), +(15739, '西旸镇', 4, 2162), +(15740, '雅阳镇', 4, 2162), +(15741, '雪溪乡', 4, 2162), +(15742, '黄桥乡', 4, 2162), +(15743, '龟湖镇', 4, 2162), +(15744, '东屏镇', 4, 2163), +(15745, '元觉乡', 4, 2163), +(15746, '北岙镇', 4, 2163), +(15747, '大门镇', 4, 2163), +(15748, '霓屿乡', 4, 2163), +(15749, '鹿西乡', 4, 2163), +(15750, '上望街道', 4, 2164), +(15751, '东山街道', 4, 2164), +(15752, '东岩乡', 4, 2164), +(15753, '仙降镇', 4, 2164), +(15754, '北麂乡', 4, 2164), +(15755, '北龙乡', 4, 2164), +(15756, '塘下镇', 4, 2164), +(15757, '大南乡', 4, 2164), +(15758, '宁益乡', 4, 2164), +(15759, '安阳街道', 4, 2164), +(15760, '平阳坑镇', 4, 2164), +(15761, '曹村镇', 4, 2164), +(15762, '林溪乡', 4, 2164), +(15763, '枫岭乡', 4, 2164), +(15764, '桂峰乡', 4, 2164); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15765, '桐浦乡', 4, 2164), +(15766, '梅屿乡', 4, 2164), +(15767, '永安乡', 4, 2164), +(15768, '汀田镇', 4, 2164), +(15769, '湖岭镇', 4, 2164), +(15770, '潘岱街道', 4, 2164), +(15771, '潮基乡', 4, 2164), +(15772, '玉海街道', 4, 2164), +(15773, '碧山镇', 4, 2164), +(15774, '芳庄乡', 4, 2164), +(15775, '荆谷乡', 4, 2164), +(15776, '莘塍镇', 4, 2164), +(15777, '营前乡', 4, 2164), +(15778, '金川乡', 4, 2164), +(15779, '锦湖街道', 4, 2164), +(15780, '陶山镇', 4, 2164), +(15781, '顺泰乡', 4, 2164), +(15782, '飞云镇', 4, 2164), +(15783, '马屿镇', 4, 2164), +(15784, '高楼乡', 4, 2164), +(15785, '鹿木乡', 4, 2164), +(15786, '龙湖镇', 4, 2164), +(15787, '三垟街道', 4, 2165), +(15788, '丽岙镇', 4, 2165), +(15789, '仙岩镇', 4, 2165), +(15790, '南白象街道', 4, 2165), +(15791, '娄桥街道', 4, 2165), +(15792, '新桥街道', 4, 2165), +(15793, '景山街道', 4, 2165), +(15794, '梧田街道', 4, 2165), +(15795, '泽雅镇', 4, 2165), +(15796, '潘桥镇', 4, 2165), +(15797, '瞿溪镇', 4, 2165), +(15798, '茶山街道', 4, 2165), +(15799, '郭溪镇', 4, 2165), +(15800, '中墩乡', 4, 2166), +(15801, '云岩乡', 4, 2166), +(15802, '五凤乡', 4, 2166), +(15803, '仙居乡', 4, 2166), +(15804, '凤池乡', 4, 2166), +(15805, '凤阳畲族乡', 4, 2166), +(15806, '南宋镇', 4, 2166), +(15807, '大渔镇', 4, 2166), +(15808, '宜山镇', 4, 2166), +(15809, '岱岭畲族乡', 4, 2166), +(15810, '括山乡', 4, 2166), +(15811, '新安乡', 4, 2166), +(15812, '昌禅乡', 4, 2166), +(15813, '望里镇', 4, 2166), +(15814, '桥墩镇', 4, 2166), +(15815, '沿浦镇', 4, 2166), +(15816, '浦亭乡', 4, 2166), +(15817, '渔寮乡', 4, 2166), +(15818, '灵溪镇', 4, 2166), +(15819, '炎亭镇', 4, 2166), +(15820, '石坪乡', 4, 2166), +(15821, '矾山镇', 4, 2166), +(15822, '腾垟乡', 4, 2166), +(15823, '舥艚镇', 4, 2166), +(15824, '芦浦镇', 4, 2166), +(15825, '莒溪镇', 4, 2166), +(15826, '蒲城乡', 4, 2166), +(15827, '藻溪镇', 4, 2166), +(15828, '观美镇', 4, 2166); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15829, '赤溪镇', 4, 2166), +(15830, '金乡镇', 4, 2166), +(15831, '钱库镇', 4, 2166), +(15832, '霞关镇', 4, 2166), +(15833, '马站镇', 4, 2166), +(15834, '龙沙乡', 4, 2166), +(15835, '龙港镇', 4, 2166), +(15836, '七都镇', 4, 2167), +(15837, '上戍乡', 4, 2167), +(15838, '临江镇', 4, 2167), +(15839, '五马街道', 4, 2167), +(15840, '仰义乡', 4, 2167), +(15841, '南浦街道', 4, 2167), +(15842, '南郊乡', 4, 2167), +(15843, '南门街道', 4, 2167), +(15844, '双屿镇', 4, 2167), +(15845, '双潮乡', 4, 2167), +(15846, '岙底乡', 4, 2167), +(15847, '广化街道', 4, 2167), +(15848, '水心街道', 4, 2167), +(15849, '江滨街道', 4, 2167), +(15850, '洪殿街道', 4, 2167), +(15851, '绣山街道', 4, 2167), +(15852, '莲池街道', 4, 2167), +(15853, '蒲鞋市街道', 4, 2167), +(15854, '藤桥镇', 4, 2167), +(15855, '黄龙街道', 4, 2167), +(15856, '黎明街道', 4, 2167), +(15857, '天河镇', 4, 2168), +(15858, '永中街道', 4, 2168), +(15859, '永兴街道', 4, 2168), +(15860, '沙城镇', 4, 2168), +(15861, '海城街道', 4, 2168), +(15862, '海滨街道', 4, 2168), +(15863, '灵昆镇', 4, 2168), +(15864, '状元镇', 4, 2168), +(15865, '瑶溪镇', 4, 2168), +(15866, '蒲州街道', 4, 2168), +(15867, '七星镇', 4, 2169), +(15868, '东栅街道', 4, 2169), +(15869, '余新镇', 4, 2169), +(15870, '凤桥镇', 4, 2169), +(15871, '南湖街道', 4, 2169), +(15872, '城南街道', 4, 2169), +(15873, '大桥镇', 4, 2169), +(15874, '建设街道', 4, 2169), +(15875, '新丰镇', 4, 2169), +(15876, '新兴街道', 4, 2169), +(15877, '新嘉街道', 4, 2169), +(15878, '解放街道', 4, 2169), +(15879, '丁栅镇', 4, 2170), +(15880, '大云镇', 4, 2170), +(15881, '天凝镇', 4, 2170), +(15882, '姚庄镇', 4, 2170), +(15883, '干窑镇', 4, 2170), +(15884, '惠民镇', 4, 2170), +(15885, '杨庙镇', 4, 2170), +(15886, '洪溪镇', 4, 2170), +(15887, '西塘镇', 4, 2170), +(15888, '陶庄镇', 4, 2170), +(15889, '魏塘镇', 4, 2170), +(15890, '乍浦镇', 4, 2171), +(15891, '全塘镇', 4, 2171); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15892, '广陈镇', 4, 2171), +(15893, '当湖街道', 4, 2171), +(15894, '新仓镇', 4, 2171), +(15895, '新埭镇', 4, 2171), +(15896, '曹桥街道', 4, 2171), +(15897, '林埭镇', 4, 2171), +(15898, '钟埭街道', 4, 2171), +(15899, '黄姑镇', 4, 2171), +(15900, '乌镇镇', 4, 2172), +(15901, '凤鸣街道', 4, 2172), +(15902, '同福乡', 4, 2172), +(15903, '大麻镇', 4, 2172), +(15904, '屠甸镇', 4, 2172), +(15905, '崇福镇', 4, 2172), +(15906, '梧桐街道', 4, 2172), +(15907, '河山镇', 4, 2172), +(15908, '洲泉镇', 4, 2172), +(15909, '濮院镇', 4, 2172), +(15910, '石门镇', 4, 2172), +(15911, '高桥镇', 4, 2172), +(15912, '龙翔街道', 4, 2172), +(15913, '丁桥镇', 4, 2173), +(15914, '周王庙镇', 4, 2173), +(15915, '斜桥镇', 4, 2173), +(15916, '海昌街道', 4, 2173), +(15917, '海洲街道', 4, 2173), +(15918, '盐官镇', 4, 2173), +(15919, '硖石街道', 4, 2173), +(15920, '袁花镇', 4, 2173), +(15921, '许村镇', 4, 2173), +(15922, '长安镇', 4, 2173), +(15923, '马桥街道', 4, 2173), +(15924, '黄湾镇', 4, 2173), +(15925, '于城镇', 4, 2174), +(15926, '武原镇', 4, 2174), +(15927, '沈荡镇', 4, 2174), +(15928, '澉浦镇', 4, 2174), +(15929, '百步镇', 4, 2174), +(15930, '秦山镇', 4, 2174), +(15931, '西塘桥镇', 4, 2174), +(15932, '通元镇', 4, 2174), +(15933, '嘉北街道', 4, 2175), +(15934, '塘汇街道', 4, 2175), +(15935, '新城街道', 4, 2175), +(15936, '新塍镇', 4, 2175), +(15937, '油车港镇', 4, 2175), +(15938, '洪合镇', 4, 2175), +(15939, '王店镇', 4, 2175), +(15940, '王江泾镇', 4, 2175), +(15941, '千金镇', 4, 2176), +(15942, '南浔镇', 4, 2176), +(15943, '双林镇', 4, 2176), +(15944, '和孚镇', 4, 2176), +(15945, '善琏镇', 4, 2176), +(15946, '旧馆镇', 4, 2176), +(15947, '石淙镇', 4, 2176), +(15948, '练市镇', 4, 2176), +(15949, '菱湖镇', 4, 2176), +(15950, '东林镇', 4, 2177), +(15951, '八里店镇', 4, 2177), +(15952, '凤凰街道', 4, 2177), +(15953, '埭溪镇', 4, 2177), +(15954, '妙西镇', 4, 2177), +(15955, '康山街道', 4, 2177); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(15956, '月河街道', 4, 2177), +(15957, '朝阳街道', 4, 2177), +(15958, '杨家埠镇', 4, 2177), +(15959, '爱山街道', 4, 2177), +(15960, '环渚乡', 4, 2177), +(15961, '白雀乡', 4, 2177), +(15962, '织里镇', 4, 2177), +(15963, '道场乡', 4, 2177), +(15964, '飞英街道', 4, 2177), +(15965, '龙泉街道', 4, 2177), +(15966, '上墅乡', 4, 2178), +(15967, '天荒坪镇', 4, 2178), +(15968, '孝丰镇', 4, 2178), +(15969, '山川乡', 4, 2178), +(15970, '报福镇', 4, 2178), +(15971, '昆铜乡', 4, 2178), +(15972, '杭垓镇', 4, 2178), +(15973, '梅溪镇', 4, 2178), +(15974, '溪龙乡', 4, 2178), +(15975, '皈山乡', 4, 2178), +(15976, '章村镇', 4, 2178), +(15977, '良朋镇', 4, 2178), +(15978, '递铺镇', 4, 2178), +(15979, '鄣吴镇', 4, 2178), +(15980, '高禹镇', 4, 2178), +(15981, '三合乡', 4, 2179), +(15982, '干元镇', 4, 2179), +(15983, '新安镇', 4, 2179), +(15984, '新市镇', 4, 2179), +(15985, '武康镇', 4, 2179), +(15986, '洛舍镇', 4, 2179), +(15987, '禹越镇', 4, 2179), +(15988, '筏头乡', 4, 2179), +(15989, '莫干山镇', 4, 2179), +(15990, '钟管镇', 4, 2179), +(15991, '雷甸镇', 4, 2179), +(15992, '二界岭乡', 4, 2180), +(15993, '吕山乡', 4, 2180), +(15994, '吴山乡', 4, 2180), +(15995, '和平镇', 4, 2180), +(15996, '夹浦镇', 4, 2180), +(15997, '小浦镇', 4, 2180), +(15998, '李家巷镇', 4, 2180), +(15999, '林城镇', 4, 2180), +(16000, '槐坎乡', 4, 2180), +(16001, '水口乡', 4, 2180), +(16002, '泗安镇', 4, 2180), +(16003, '洪桥镇', 4, 2180), +(16004, '煤山镇', 4, 2180), +(16005, '白岘乡', 4, 2180), +(16006, '虹星桥镇', 4, 2180), +(16007, '雉城镇', 4, 2180), +(16008, '丁宅乡', 4, 2181), +(16009, '上浦镇', 4, 2181), +(16010, '下管镇', 4, 2181), +(16011, '东关街道', 4, 2181), +(16012, '丰惠镇', 4, 2181), +(16013, '小越镇', 4, 2181), +(16014, '岭南乡', 4, 2181), +(16015, '崧厦镇', 4, 2181), +(16016, '曹娥街道', 4, 2181), +(16017, '梁湖镇', 4, 2181), +(16018, '永和镇', 4, 2181), +(16019, '汤浦镇', 4, 2181), +(16020, '沥海镇', 4, 2181); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16021, '百官街道', 4, 2181), +(16022, '盖北镇', 4, 2181), +(16023, '章镇镇', 4, 2181), +(16024, '谢塘镇', 4, 2181), +(16025, '道墟镇', 4, 2181), +(16026, '长塘镇', 4, 2181), +(16027, '陈溪乡', 4, 2181), +(16028, '驿亭镇', 4, 2181), +(16029, '三江街道', 4, 2182), +(16030, '三界镇', 4, 2182), +(16031, '下王镇', 4, 2182), +(16032, '仙岩镇', 4, 2182), +(16033, '剡湖街道', 4, 2182), +(16034, '北漳镇', 4, 2182), +(16035, '崇仁镇', 4, 2182), +(16036, '浦口街道', 4, 2182), +(16037, '王院镇', 4, 2182), +(16038, '甘霖镇', 4, 2182), +(16039, '石璜镇', 4, 2182), +(16040, '竹溪镇', 4, 2182), +(16041, '谷来镇', 4, 2182), +(16042, '贵门镇', 4, 2182), +(16043, '通源镇', 4, 2182), +(16044, '里南镇', 4, 2182), +(16045, '金庭镇', 4, 2182), +(16046, '长乐镇', 4, 2182), +(16047, '雅璜镇', 4, 2182), +(16048, '鹿山街道', 4, 2182), +(16049, '黄泽镇', 4, 2182), +(16050, '七星街道', 4, 2183), +(16051, '东茗乡', 4, 2183), +(16052, '儒岙镇', 4, 2183), +(16053, '南明街道', 4, 2183), +(16054, '双彩乡', 4, 2183), +(16055, '回山镇', 4, 2183), +(16056, '城南乡', 4, 2183), +(16057, '大市聚镇', 4, 2183), +(16058, '小将镇', 4, 2183), +(16059, '巧英乡', 4, 2183), +(16060, '新林乡', 4, 2183), +(16061, '梅渚镇', 4, 2183), +(16062, '沙溪镇', 4, 2183), +(16063, '澄潭镇', 4, 2183), +(16064, '羽林街道', 4, 2183), +(16065, '镜岭镇', 4, 2183), +(16066, '兰亭镇', 4, 2184), +(16067, '华舍街道', 4, 2184), +(16068, '夏履镇', 4, 2184), +(16069, '孙端镇', 4, 2184), +(16070, '安昌镇', 4, 2184), +(16071, '富盛镇', 4, 2184), +(16072, '平水镇', 4, 2184), +(16073, '杨汛桥镇', 4, 2184), +(16074, '柯岩街道', 4, 2184), +(16075, '柯桥街道', 4, 2184), +(16076, '湖塘街道', 4, 2184), +(16077, '漓渚镇', 4, 2184), +(16078, '王坛镇', 4, 2184), +(16079, '福全镇', 4, 2184), +(16080, '稽东镇', 4, 2184), +(16081, '钱清镇', 4, 2184), +(16082, '陶堰镇', 4, 2184), +(16083, '马鞍镇', 4, 2184), +(16084, '齐贤镇', 4, 2184); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16085, '东和乡', 4, 2185), +(16086, '东白湖镇', 4, 2185), +(16087, '五泄镇', 4, 2185), +(16088, '同山镇', 4, 2185), +(16089, '大唐镇', 4, 2185), +(16090, '安华镇', 4, 2185), +(16091, '山下湖镇', 4, 2185), +(16092, '岭北镇', 4, 2185), +(16093, '应店街镇', 4, 2185), +(16094, '店口镇', 4, 2185), +(16095, '暨阳街道', 4, 2185), +(16096, '枫桥镇', 4, 2185), +(16097, '次坞镇', 4, 2185), +(16098, '江藻镇', 4, 2185), +(16099, '浣东街道', 4, 2185), +(16100, '浬浦镇', 4, 2185), +(16101, '牌头镇', 4, 2185), +(16102, '王家井镇', 4, 2185), +(16103, '璜山镇', 4, 2185), +(16104, '直埠镇', 4, 2185), +(16105, '草塔镇', 4, 2185), +(16106, '街亭镇', 4, 2185), +(16107, '赵家镇', 4, 2185), +(16108, '阮市镇', 4, 2185), +(16109, '陈宅镇', 4, 2185), +(16110, '陶朱街道', 4, 2185), +(16111, '马剑镇', 4, 2185), +(16112, '东浦镇', 4, 2186), +(16113, '东湖镇', 4, 2186), +(16114, '北海街道', 4, 2186), +(16115, '城南街道', 4, 2186), +(16116, '塔山街道', 4, 2186), +(16117, '府山街道', 4, 2186), +(16118, '斗门镇', 4, 2186), +(16119, '灵芝镇', 4, 2186), +(16120, '皋埠镇', 4, 2186), +(16121, '稽山街道', 4, 2186), +(16122, '蕺山街道', 4, 2186), +(16123, '鉴湖镇', 4, 2186), +(16124, '马山镇', 4, 2186), +(16125, '临城街道', 4, 2187), +(16126, '册子乡', 4, 2187), +(16127, '北蝉乡', 4, 2187), +(16128, '双桥镇', 4, 2187), +(16129, '城东街道', 4, 2187), +(16130, '小沙镇', 4, 2187), +(16131, '岑港镇', 4, 2187), +(16132, '干缆镇', 4, 2187), +(16133, '昌国街道', 4, 2187), +(16134, '环南街道', 4, 2187), +(16135, '白泉镇', 4, 2187), +(16136, '盐仓街道', 4, 2187), +(16137, '解放街道', 4, 2187), +(16138, '金塘镇', 4, 2187), +(16139, '长白乡', 4, 2187), +(16140, '马岙镇', 4, 2187), +(16141, '东沙镇', 4, 2188), +(16142, '岱东镇', 4, 2188), +(16143, '岱西镇', 4, 2188), +(16144, '秀山乡', 4, 2188), +(16145, '衢山镇', 4, 2188), +(16146, '长涂镇', 4, 2188), +(16147, '高亭镇', 4, 2188), +(16148, '五龙乡', 4, 2189); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16149, '嵊山镇', 4, 2189), +(16150, '枸杞乡', 4, 2189), +(16151, '洋山镇', 4, 2189), +(16152, '花鸟乡', 4, 2189), +(16153, '菜园镇', 4, 2189), +(16154, '黄龙乡', 4, 2189), +(16155, '东极镇', 4, 2190), +(16156, '东港街道', 4, 2190), +(16157, '佛渡乡', 4, 2190), +(16158, '六横镇', 4, 2190), +(16159, '勾山街道', 4, 2190), +(16160, '展茅镇', 4, 2190), +(16161, '普陀山镇', 4, 2190), +(16162, '朱家尖镇', 4, 2190), +(16163, '桃花镇', 4, 2190), +(16164, '沈家门街道', 4, 2190), +(16165, '登步乡', 4, 2190), +(16166, '白沙乡', 4, 2190), +(16167, '虾峙镇', 4, 2190), +(16168, '蚂蚁岛乡', 4, 2190), +(16169, '东案乡', 4, 2191), +(16170, '何家乡', 4, 2191), +(16171, '同弓乡', 4, 2191), +(16172, '大桥头乡', 4, 2191), +(16173, '天马镇', 4, 2191), +(16174, '宋畈乡', 4, 2191), +(16175, '招贤镇', 4, 2191), +(16176, '新昌乡', 4, 2191), +(16177, '新桥乡', 4, 2191), +(16178, '球川镇', 4, 2191), +(16179, '白石镇', 4, 2191), +(16180, '芳村镇', 4, 2191), +(16181, '辉埠镇', 4, 2191), +(16182, '青石镇', 4, 2191), +(16183, '中村乡', 4, 2192), +(16184, '何田乡', 4, 2192), +(16185, '华埠镇', 4, 2192), +(16186, '城关镇', 4, 2192), +(16187, '塘坞乡', 4, 2192), +(16188, '大溪边乡', 4, 2192), +(16189, '张湾乡', 4, 2192), +(16190, '村头镇', 4, 2192), +(16191, '杨林镇', 4, 2192), +(16192, '林山乡', 4, 2192), +(16193, '桐村镇', 4, 2192), +(16194, '池淮镇', 4, 2192), +(16195, '苏庄镇', 4, 2192), +(16196, '金村乡', 4, 2192), +(16197, '长虹乡', 4, 2192), +(16198, '音坑乡', 4, 2192), +(16199, '马金镇', 4, 2192), +(16200, '齐溪镇', 4, 2192), +(16201, '七里乡', 4, 2193), +(16202, '万田乡', 4, 2193), +(16203, '九华乡', 4, 2193), +(16204, '信安街道', 4, 2193), +(16205, '华墅乡', 4, 2193), +(16206, '双港街道', 4, 2193), +(16207, '姜家山乡', 4, 2193), +(16208, '府山街道', 4, 2193), +(16209, '新新街道', 4, 2193), +(16210, '沟溪乡', 4, 2193), +(16211, '白云街道', 4, 2193), +(16212, '石室乡', 4, 2193); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16213, '石梁镇', 4, 2193), +(16214, '航埠镇', 4, 2193), +(16215, '花园街道', 4, 2193), +(16216, '荷花街道', 4, 2193), +(16217, '黄家乡', 4, 2193), +(16218, '上余镇', 4, 2194), +(16219, '保安乡', 4, 2194), +(16220, '凤林镇', 4, 2194), +(16221, '双塔街道', 4, 2194), +(16222, '双溪口乡', 4, 2194), +(16223, '四都镇', 4, 2194), +(16224, '坛石镇', 4, 2194), +(16225, '塘源口乡', 4, 2194), +(16226, '大桥镇', 4, 2194), +(16227, '大陈乡', 4, 2194), +(16228, '峡口镇', 4, 2194), +(16229, '廿八都镇', 4, 2194), +(16230, '张村乡', 4, 2194), +(16231, '新塘边镇', 4, 2194), +(16232, '淤头镇', 4, 2194), +(16233, '清湖镇', 4, 2194), +(16234, '石门镇', 4, 2194), +(16235, '碗窑乡', 4, 2194), +(16236, '虎山街道', 4, 2194), +(16237, '贺村镇', 4, 2194), +(16238, '长台镇', 4, 2194), +(16239, '上方镇', 4, 2195), +(16240, '举村乡', 4, 2195), +(16241, '云溪乡', 4, 2195), +(16242, '全旺镇', 4, 2195), +(16243, '双桥乡', 4, 2195), +(16244, '后溪镇', 4, 2195), +(16245, '周家乡', 4, 2195), +(16246, '大洲镇', 4, 2195), +(16247, '太真乡', 4, 2195), +(16248, '岭洋乡', 4, 2195), +(16249, '峡川镇', 4, 2195), +(16250, '廿里镇', 4, 2195), +(16251, '杜泽镇', 4, 2195), +(16252, '樟潭街道', 4, 2195), +(16253, '横路乡', 4, 2195), +(16254, '浮石街道', 4, 2195), +(16255, '湖南镇', 4, 2195), +(16256, '灰坪乡', 4, 2195), +(16257, '莲花镇', 4, 2195), +(16258, '高家镇', 4, 2195), +(16259, '黄坛口乡', 4, 2195), +(16260, '东华街道', 4, 2196), +(16261, '塔石镇', 4, 2196), +(16262, '大街乡', 4, 2196), +(16263, '小南海镇', 4, 2196), +(16264, '庙下乡', 4, 2196), +(16265, '模环乡', 4, 2196), +(16266, '横山镇', 4, 2196), +(16267, '沐尘畲族乡', 4, 2196), +(16268, '湖镇镇', 4, 2196), +(16269, '溪口镇', 4, 2196), +(16270, '石佛乡', 4, 2196), +(16271, '社阳乡', 4, 2196), +(16272, '罗家乡', 4, 2196), +(16273, '詹家镇', 4, 2196), +(16274, '龙洲街道', 4, 2196), +(16275, '三单乡', 4, 2197), +(16276, '东阳江镇', 4, 2197); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16277, '佐村镇', 4, 2197), +(16278, '六石街道', 4, 2197), +(16279, '千祥镇', 4, 2197), +(16280, '南市街道', 4, 2197), +(16281, '南马镇', 4, 2197), +(16282, '吴宁街道', 4, 2197), +(16283, '城东街道', 4, 2197), +(16284, '巍山镇', 4, 2197), +(16285, '横店镇', 4, 2197), +(16286, '歌山镇', 4, 2197), +(16287, '江北街道', 4, 2197), +(16288, '湖溪镇', 4, 2197), +(16289, '画水镇', 4, 2197), +(16290, '白云街道', 4, 2197), +(16291, '虎鹿镇', 4, 2197), +(16292, '马宅镇', 4, 2197), +(16293, '上溪镇', 4, 2198), +(16294, '义亭镇', 4, 2198), +(16295, '佛堂镇', 4, 2198), +(16296, '北苑街道', 4, 2198), +(16297, '后宅街道', 4, 2198), +(16298, '城西街道', 4, 2198), +(16299, '大陈镇', 4, 2198), +(16300, '廿三里街道', 4, 2198), +(16301, '江东街道', 4, 2198), +(16302, '稠城街道', 4, 2198), +(16303, '稠江街道', 4, 2198), +(16304, '苏溪镇', 4, 2198), +(16305, '赤岸镇', 4, 2198), +(16306, '上华街道', 4, 2199), +(16307, '云山街道', 4, 2199), +(16308, '兰江街道', 4, 2199), +(16309, '女埠街道', 4, 2199), +(16310, '柏社乡', 4, 2199), +(16311, '梅江镇', 4, 2199), +(16312, '水亭畲族乡', 4, 2199), +(16313, '永昌街道', 4, 2199), +(16314, '游埠镇', 4, 2199), +(16315, '灵洞乡', 4, 2199), +(16316, '诸葛镇', 4, 2199), +(16317, '赤溪街道', 4, 2199), +(16318, '香溪镇', 4, 2199), +(16319, '马涧镇', 4, 2199), +(16320, '黄店镇', 4, 2199), +(16321, '三江口街道', 4, 2200), +(16322, '干西乡', 4, 2200), +(16323, '城东街道', 4, 2200), +(16324, '城中街道', 4, 2200), +(16325, '城北街道', 4, 2200), +(16326, '城西街道', 4, 2200), +(16327, '塔石乡', 4, 2200), +(16328, '安地镇', 4, 2200), +(16329, '岭上乡', 4, 2200), +(16330, '新狮街道', 4, 2200), +(16331, '江南街道', 4, 2200), +(16332, '汤溪镇', 4, 2200), +(16333, '沙畈乡', 4, 2200), +(16334, '洋埠镇', 4, 2200), +(16335, '琅玡镇', 4, 2200), +(16336, '白龙桥镇', 4, 2200), +(16337, '秋滨街道', 4, 2200), +(16338, '竹马乡', 4, 2200), +(16339, '箬阳乡', 4, 2200); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16340, '罗埠镇', 4, 2200), +(16341, '罗店镇', 4, 2200), +(16342, '苏孟乡', 4, 2200), +(16343, '莘畈乡', 4, 2200), +(16344, '蒋堂镇', 4, 2200), +(16345, '西关街道', 4, 2200), +(16346, '长山乡', 4, 2200), +(16347, '雅畈镇', 4, 2200), +(16348, '三港乡', 4, 2201), +(16349, '俞源乡', 4, 2201), +(16350, '坦洪乡', 4, 2201), +(16351, '壶山街道', 4, 2201), +(16352, '大溪口乡', 4, 2201), +(16353, '大田乡', 4, 2201), +(16354, '履坦镇', 4, 2201), +(16355, '新宅镇', 4, 2201), +(16356, '柳城畲族镇', 4, 2201), +(16357, '桃溪镇', 4, 2201), +(16358, '桐琴镇', 4, 2201), +(16359, '泉溪镇', 4, 2201), +(16360, '熟溪街道', 4, 2201), +(16361, '王宅镇', 4, 2201), +(16362, '白姆乡', 4, 2201), +(16363, '白洋街道', 4, 2201), +(16364, '茭道镇', 4, 2201), +(16365, '西联乡', 4, 2201), +(16366, '东城街道', 4, 2202), +(16367, '前仓镇', 4, 2202), +(16368, '古山镇', 4, 2202), +(16369, '唐先镇', 4, 2202), +(16370, '方岩镇', 4, 2202), +(16371, '江南街道', 4, 2202), +(16372, '石柱镇', 4, 2202), +(16373, '舟山镇', 4, 2202), +(16374, '芝英街道', 4, 2202), +(16375, '花街镇', 4, 2202), +(16376, '西城街道', 4, 2202), +(16377, '西溪镇', 4, 2202), +(16378, '象珠镇', 4, 2202), +(16379, '龙山镇', 4, 2202), +(16380, '中余乡', 4, 2203), +(16381, '仙华街道', 4, 2203), +(16382, '前吴乡', 4, 2203), +(16383, '大畈乡', 4, 2203), +(16384, '岩头镇', 4, 2203), +(16385, '杭坪镇', 4, 2203), +(16386, '檀溪镇', 4, 2203), +(16387, '浦南街道', 4, 2203), +(16388, '浦阳街道', 4, 2203), +(16389, '白马镇', 4, 2203), +(16390, '花桥乡', 4, 2203), +(16391, '虞宅乡', 4, 2203), +(16392, '郑宅镇', 4, 2203), +(16393, '郑家坞镇', 4, 2203), +(16394, '黄宅镇', 4, 2203), +(16395, '万苍乡', 4, 2204), +(16396, '九和乡', 4, 2204), +(16397, '仁川镇', 4, 2204), +(16398, '冷水镇', 4, 2204), +(16399, '双峰乡', 4, 2204), +(16400, '双溪乡', 4, 2204), +(16401, '墨林乡', 4, 2204), +(16402, '大盘镇', 4, 2204), +(16403, '安文镇', 4, 2204); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16404, '尖山镇', 4, 2204), +(16405, '尚湖镇', 4, 2204), +(16406, '新渥镇', 4, 2204), +(16407, '方前镇', 4, 2204), +(16408, '深泽乡', 4, 2204), +(16409, '玉山镇', 4, 2204), +(16410, '盘峰乡', 4, 2204), +(16411, '窈川乡', 4, 2204), +(16412, '维新乡', 4, 2204), +(16413, '胡宅乡', 4, 2204), +(16414, '高二乡', 4, 2204), +(16415, '东孝街道', 4, 2205), +(16416, '傅村镇', 4, 2205), +(16417, '塘雅镇', 4, 2205), +(16418, '多湖街道', 4, 2205), +(16419, '孝顺镇', 4, 2205), +(16420, '岭下镇', 4, 2205), +(16421, '曹宅镇', 4, 2205), +(16422, '江东镇', 4, 2205), +(16423, '源东乡', 4, 2205), +(16424, '澧浦镇', 4, 2205), +(16425, '赤松镇', 4, 2205), +(16426, '亭旁镇', 4, 2206), +(16427, '健跳镇', 4, 2206), +(16428, '六敖镇', 4, 2206), +(16429, '小雄镇', 4, 2206), +(16430, '横渡镇', 4, 2206), +(16431, '沙柳镇', 4, 2206), +(16432, '沿赤乡', 4, 2206), +(16433, '泗淋乡', 4, 2206), +(16434, '浬浦镇', 4, 2206), +(16435, '海游镇', 4, 2206), +(16436, '珠岙镇', 4, 2206), +(16437, '花桥镇', 4, 2206), +(16438, '蛇蟠乡', 4, 2206), +(16439, '高枧乡', 4, 2206), +(16440, '上盘镇', 4, 2207), +(16441, '东塍镇', 4, 2207), +(16442, '古城街道', 4, 2207), +(16443, '大洋街道', 4, 2207), +(16444, '大田街道', 4, 2207), +(16445, '小芝镇', 4, 2207), +(16446, '尤溪镇', 4, 2207), +(16447, '括苍镇', 4, 2207), +(16448, '杜桥镇', 4, 2207), +(16449, '桃渚镇', 4, 2207), +(16450, '永丰镇', 4, 2207), +(16451, '汇溪镇', 4, 2207), +(16452, '汛桥镇', 4, 2207), +(16453, '江南街道', 4, 2207), +(16454, '河头镇', 4, 2207), +(16455, '沿江镇', 4, 2207), +(16456, '涌泉镇', 4, 2207), +(16457, '白水洋镇', 4, 2207), +(16458, '邵家渡街道', 4, 2207), +(16459, '皤滩乡', 4, 2208), +(16460, '上张乡', 4, 2208), +(16461, '下各镇', 4, 2208), +(16462, '南峰街道', 4, 2208), +(16463, '双庙乡', 4, 2208), +(16464, '埠头镇', 4, 2208), +(16465, '大战乡', 4, 2208), +(16466, '安岭乡', 4, 2208), +(16467, '安洲街道', 4, 2208), +(16468, '官路镇', 4, 2208); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16469, '广度乡', 4, 2208), +(16470, '朱溪镇', 4, 2208), +(16471, '横溪镇', 4, 2208), +(16472, '步路乡', 4, 2208), +(16473, '淡竹乡', 4, 2208), +(16474, '湫山乡', 4, 2208), +(16475, '溪港乡', 4, 2208), +(16476, '田市镇', 4, 2208), +(16477, '白塔镇', 4, 2208), +(16478, '福应街道', 4, 2208), +(16479, '三合镇', 4, 2209), +(16480, '三州乡', 4, 2209), +(16481, '南屏乡', 4, 2209), +(16482, '坦头镇', 4, 2209), +(16483, '始丰街道', 4, 2209), +(16484, '平桥镇', 4, 2209), +(16485, '泳溪乡', 4, 2209), +(16486, '洪畴镇', 4, 2209), +(16487, '白鹤镇', 4, 2209), +(16488, '石梁镇', 4, 2209), +(16489, '福溪街道', 4, 2209), +(16490, '街头镇', 4, 2209), +(16491, '赤城街道', 4, 2209), +(16492, '雷峰乡', 4, 2209), +(16493, '龙溪乡', 4, 2209), +(16494, '三甲街道', 4, 2210), +(16495, '下陈街道', 4, 2210), +(16496, '前所街道', 4, 2210), +(16497, '大陈镇', 4, 2210), +(16498, '洪家街道', 4, 2210), +(16499, '海门街道', 4, 2210), +(16500, '白云街道', 4, 2210), +(16501, '章安街道', 4, 2210), +(16502, '葭沚街道', 4, 2210), +(16503, '坞根镇', 4, 2211), +(16504, '城东街道', 4, 2211), +(16505, '城北街道', 4, 2211), +(16506, '城南镇', 4, 2211), +(16507, '城西街道', 4, 2211), +(16508, '大溪镇', 4, 2211), +(16509, '太平街道', 4, 2211), +(16510, '新河镇', 4, 2211), +(16511, '松门镇', 4, 2211), +(16512, '横峰街道', 4, 2211), +(16513, '泽国镇', 4, 2211), +(16514, '温峤镇', 4, 2211), +(16515, '滨海镇', 4, 2211), +(16516, '石塘镇', 4, 2211), +(16517, '石桥头镇', 4, 2211), +(16518, '箬横镇', 4, 2211), +(16519, '干江镇', 4, 2212), +(16520, '楚门镇', 4, 2212), +(16521, '沙门镇', 4, 2212), +(16522, '海山乡', 4, 2212), +(16523, '清港镇', 4, 2212), +(16524, '珠港镇', 4, 2212), +(16525, '芦浦镇', 4, 2212), +(16526, '鸡山乡', 4, 2212), +(16527, '龙溪乡', 4, 2212), +(16528, '峰江街道', 4, 2213), +(16529, '新桥镇', 4, 2213), +(16530, '桐屿街道', 4, 2213), +(16531, '横街镇', 4, 2213), +(16532, '蓬街镇', 4, 2213); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16533, '螺洋街道', 4, 2213), +(16534, '路北街道', 4, 2213), +(16535, '路南街道', 4, 2213), +(16536, '路桥街道', 4, 2213), +(16537, '金清镇', 4, 2213), +(16538, '上垟乡', 4, 2214), +(16539, '上郑乡', 4, 2214), +(16540, '东城街道', 4, 2214), +(16541, '北城街道', 4, 2214), +(16542, '北洋镇', 4, 2214), +(16543, '南城街道', 4, 2214), +(16544, '头陀镇', 4, 2214), +(16545, '宁溪镇', 4, 2214), +(16546, '富山乡', 4, 2214), +(16547, '屿头乡', 4, 2214), +(16548, '平田乡', 4, 2214), +(16549, '新前街道', 4, 2214), +(16550, '江口街道', 4, 2214), +(16551, '沙埠镇', 4, 2214), +(16552, '澄江街道', 4, 2214), +(16553, '茅畲乡', 4, 2214), +(16554, '西城街道', 4, 2214), +(16555, '院桥镇', 4, 2214), +(16556, '高桥街道', 4, 2214), +(16557, '云丰乡', 4, 2215), +(16558, '云和镇', 4, 2215), +(16559, '云坛乡', 4, 2215), +(16560, '大塆乡', 4, 2215), +(16561, '大源乡', 4, 2215), +(16562, '安溪畲族乡', 4, 2215), +(16563, '崇头镇', 4, 2215), +(16564, '朱村乡', 4, 2215), +(16565, '沙铺乡', 4, 2215), +(16566, '石塘镇', 4, 2215), +(16567, '紧水滩镇', 4, 2215), +(16568, '赤石乡', 4, 2215), +(16569, '雾溪畲族乡', 4, 2215), +(16570, '黄源乡', 4, 2215), +(16571, '举水乡', 4, 2216), +(16572, '五大堡乡', 4, 2216), +(16573, '合湖乡', 4, 2216), +(16574, '四山乡', 4, 2216), +(16575, '安南乡', 4, 2216), +(16576, '官塘乡', 4, 2216), +(16577, '屏都镇', 4, 2216), +(16578, '岭头乡', 4, 2216), +(16579, '左溪镇', 4, 2216), +(16580, '张村乡', 4, 2216), +(16581, '松源镇', 4, 2216), +(16582, '江根乡', 4, 2216), +(16583, '淤上乡', 4, 2216), +(16584, '百山祖乡', 4, 2216), +(16585, '竹口镇', 4, 2216), +(16586, '荷地镇', 4, 2216), +(16587, '贤良镇', 4, 2216), +(16588, '隆宫乡', 4, 2216), +(16589, '黄田镇', 4, 2216), +(16590, '龙溪乡', 4, 2216), +(16591, '东坑镇', 4, 2217), +(16592, '外舍乡', 4, 2217), +(16593, '大地乡', 4, 2217), +(16594, '大均乡', 4, 2217), +(16595, '大漈乡', 4, 2217), +(16596, '大顺乡', 4, 2217); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16597, '家地乡', 4, 2217), +(16598, '景南乡', 4, 2217), +(16599, '标溪乡', 4, 2217), +(16600, '梅岐乡', 4, 2217), +(16601, '梧桐乡', 4, 2217), +(16602, '毛垟乡', 4, 2217), +(16603, '沙湾镇', 4, 2217), +(16604, '渤海镇', 4, 2217), +(16605, '澄照乡', 4, 2217), +(16606, '秋炉乡', 4, 2217), +(16607, '英川镇', 4, 2217), +(16608, '葛山乡', 4, 2217), +(16609, '郑坑乡', 4, 2217), +(16610, '金钟乡', 4, 2217), +(16611, '陈村乡', 4, 2217), +(16612, '雁溪乡', 4, 2217), +(16613, '鸬鹚乡', 4, 2217), +(16614, '鹤溪镇', 4, 2217), +(16615, '三都乡', 4, 2218), +(16616, '古市镇', 4, 2218), +(16617, '叶村乡', 4, 2218), +(16618, '四都乡', 4, 2218), +(16619, '大东坝镇', 4, 2218), +(16620, '安民乡', 4, 2218), +(16621, '斋坛乡', 4, 2218), +(16622, '新兴乡', 4, 2218), +(16623, '新处乡', 4, 2218), +(16624, '望松乡', 4, 2218), +(16625, '板桥畲族乡', 4, 2218), +(16626, '枫坪乡', 4, 2218), +(16627, '樟溪乡', 4, 2218), +(16628, '玉岩镇', 4, 2218), +(16629, '竹源乡', 4, 2218), +(16630, '裕溪乡', 4, 2218), +(16631, '西屏镇', 4, 2218), +(16632, '谢村乡', 4, 2218), +(16633, '象溪镇', 4, 2218), +(16634, '赤寿乡', 4, 2218), +(16635, '七里乡', 4, 2219), +(16636, '三溪乡', 4, 2219), +(16637, '东方镇', 4, 2219), +(16638, '东渡镇', 4, 2219), +(16639, '五云镇', 4, 2219), +(16640, '前路乡', 4, 2219), +(16641, '南溪乡', 4, 2219), +(16642, '双川乡', 4, 2219), +(16643, '双溪口乡', 4, 2219), +(16644, '城北乡', 4, 2219), +(16645, '壶镇镇', 4, 2219), +(16646, '大洋镇', 4, 2219), +(16647, '大源镇', 4, 2219), +(16648, '新川乡', 4, 2219), +(16649, '新建镇', 4, 2219), +(16650, '新碧镇', 4, 2219), +(16651, '方溪乡', 4, 2219), +(16652, '木栗乡', 4, 2219), +(16653, '溶江乡', 4, 2219), +(16654, '白竹乡', 4, 2219), +(16655, '石笕乡', 4, 2219), +(16656, '胡源乡', 4, 2219), +(16657, '舒洪镇', 4, 2219), +(16658, '雁岭乡', 4, 2219), +(16659, '万象街道', 4, 2220), +(16660, '丽新畲族乡', 4, 2220), +(16661, '仙渡乡', 4, 2220); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16662, '双溪镇', 4, 2220), +(16663, '双黄乡', 4, 2220), +(16664, '大港头镇', 4, 2220), +(16665, '太平乡', 4, 2220), +(16666, '富岭街道', 4, 2220), +(16667, '岩泉街道', 4, 2220), +(16668, '峰源乡', 4, 2220), +(16669, '水阁街道', 4, 2220), +(16670, '白云街道', 4, 2220), +(16671, '碧湖镇', 4, 2220), +(16672, '紫金街道', 4, 2220), +(16673, '老竹畲族镇', 4, 2220), +(16674, '联城镇', 4, 2220), +(16675, '高溪乡', 4, 2220), +(16676, '黄村乡', 4, 2220), +(16677, '三仁畲族乡', 4, 2221), +(16678, '云峰镇', 4, 2221), +(16679, '北界镇', 4, 2221), +(16680, '垵口乡', 4, 2221), +(16681, '大柘镇', 4, 2221), +(16682, '妙高镇', 4, 2221), +(16683, '应村乡', 4, 2221), +(16684, '新路湾镇', 4, 2221), +(16685, '柘岱口乡', 4, 2221), +(16686, '湖山乡', 4, 2221), +(16687, '濂竹乡', 4, 2221), +(16688, '焦滩乡', 4, 2221), +(16689, '王村口镇', 4, 2221), +(16690, '石练镇', 4, 2221), +(16691, '蔡源乡', 4, 2221), +(16692, '西畈乡', 4, 2221), +(16693, '金竹镇', 4, 2221), +(16694, '高坪乡', 4, 2221), +(16695, '黄沙腰镇', 4, 2221), +(16696, '龙洋乡', 4, 2221), +(16697, '万山乡', 4, 2222), +(16698, '万阜乡', 4, 2222), +(16699, '东源镇', 4, 2222), +(16700, '仁宫乡', 4, 2222), +(16701, '仁庄镇', 4, 2222), +(16702, '北山镇', 4, 2222), +(16703, '吴坑乡', 4, 2222), +(16704, '季宅乡', 4, 2222), +(16705, '小舟山乡', 4, 2222), +(16706, '山口镇', 4, 2222), +(16707, '岭根乡', 4, 2222), +(16708, '巨浦乡', 4, 2222), +(16709, '方山乡', 4, 2222), +(16710, '汤垟乡', 4, 2222), +(16711, '海口镇', 4, 2222), +(16712, '海溪乡', 4, 2222), +(16713, '温溪镇', 4, 2222), +(16714, '石溪乡', 4, 2222), +(16715, '祯埠乡', 4, 2222), +(16716, '祯旺乡', 4, 2222), +(16717, '章旦乡', 4, 2222), +(16718, '章村乡', 4, 2222), +(16719, '腊口镇', 4, 2222), +(16720, '舒桥乡', 4, 2222), +(16721, '船寮镇', 4, 2222), +(16722, '贵岙乡', 4, 2222), +(16723, '阜山乡', 4, 2222), +(16724, '高市乡', 4, 2222), +(16725, '高湖镇', 4, 2222); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16726, '鹤城镇', 4, 2222), +(16727, '黄垟乡', 4, 2222), +(16728, '上垟镇', 4, 2223), +(16729, '住龙镇', 4, 2223), +(16730, '八都镇', 4, 2223), +(16731, '兰巨乡', 4, 2223), +(16732, '剑池街道', 4, 2223), +(16733, '城北乡', 4, 2223), +(16734, '塔石乡', 4, 2223), +(16735, '安仁镇', 4, 2223), +(16736, '宝溪乡', 4, 2223), +(16737, '小梅镇', 4, 2223), +(16738, '屏南镇', 4, 2223), +(16739, '岩樟乡', 4, 2223), +(16740, '查田镇', 4, 2223), +(16741, '竹垟畲族乡', 4, 2223), +(16742, '西街街道', 4, 2223), +(16743, '道太乡', 4, 2223), +(16744, '锦溪镇', 4, 2223), +(16745, '龙南乡', 4, 2223), +(16746, '龙渊街道', 4, 2223), +(16747, '义兴镇', 4, 2224), +(16748, '义城镇', 4, 2224), +(16749, '大圩乡', 4, 2224), +(16750, '宁国路街道', 4, 2224), +(16751, '巢湖路街道', 4, 2224), +(16752, '常青街道', 4, 2224), +(16753, '烟墩乡', 4, 2224), +(16754, '芜湖路街道', 4, 2224), +(16755, '骆岗街道', 4, 2224), +(16756, '三十岗乡', 4, 2225), +(16757, '三牌楼街道', 4, 2225), +(16758, '亳州路街道', 4, 2225), +(16759, '光明街道', 4, 2225), +(16760, '县桥街道', 4, 2225), +(16761, '双岗街道', 4, 2225), +(16762, '大杨镇', 4, 2225), +(16763, '安庆路街道', 4, 2225), +(16764, '杏林街道', 4, 2225), +(16765, '杏花村街道', 4, 2225), +(16766, '海棠街道', 4, 2225), +(16767, '益民街道', 4, 2225), +(16768, '逍遥津街道', 4, 2225), +(16769, '七里塘街道', 4, 2226), +(16770, '七里站街道', 4, 2226), +(16771, '三里街街道', 4, 2226), +(16772, '和平路街道', 4, 2226), +(16773, '城东街道', 4, 2226), +(16774, '大兴镇', 4, 2226), +(16775, '大通路街道', 4, 2226), +(16776, '方庙街道', 4, 2226), +(16777, '明光路街道', 4, 2226), +(16778, '磨店乡', 4, 2226), +(16779, '红光街道', 4, 2226), +(16780, '胜利路街道', 4, 2226), +(16781, '车站街道', 4, 2226), +(16782, '铜陵路街道', 4, 2226), +(16783, '长淮街道', 4, 2226), +(16784, '众兴乡', 4, 2227), +(16785, '元疃镇', 4, 2227), +(16786, '八斗镇', 4, 2227); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16787, '包公镇', 4, 2227), +(16788, '古城镇', 4, 2227), +(16789, '响导乡', 4, 2227), +(16790, '店埠镇', 4, 2227), +(16791, '张集乡', 4, 2227), +(16792, '撮镇镇', 4, 2227), +(16793, '杨店乡', 4, 2227), +(16794, '桥头集镇', 4, 2227), +(16795, '梁园镇', 4, 2227), +(16796, '牌坊回族满族乡', 4, 2227), +(16797, '白龙镇', 4, 2227), +(16798, '石塘镇', 4, 2227), +(16799, '长临河镇', 4, 2227), +(16800, '陈集乡', 4, 2227), +(16801, '马湖乡', 4, 2227), +(16802, '三河镇', 4, 2228), +(16803, '上派镇', 4, 2228), +(16804, '严店乡', 4, 2228), +(16805, '丰乐镇', 4, 2228), +(16806, '官亭镇', 4, 2228), +(16807, '小庙镇', 4, 2228), +(16808, '山南镇', 4, 2228), +(16809, '柿树岗乡', 4, 2228), +(16810, '桃花镇', 4, 2228), +(16811, '紫蓬镇', 4, 2228), +(16812, '花岗镇', 4, 2228), +(16813, '铭传乡', 4, 2228), +(16814, '高刘镇', 4, 2228), +(16815, '高店乡', 4, 2228), +(16816, '三里庵街道', 4, 2229), +(16817, '五里墩街道', 4, 2229), +(16818, '井岗镇', 4, 2229), +(16819, '南七里站街道', 4, 2229), +(16820, '南岗镇', 4, 2229), +(16821, '琥珀山庄街道', 4, 2229), +(16822, '稻香村街道', 4, 2229), +(16823, '笔架山街道', 4, 2229), +(16824, '荷叶地街道', 4, 2229), +(16825, '西园新村街道', 4, 2229), +(16826, '三十头乡', 4, 2230), +(16827, '下塘镇', 4, 2230), +(16828, '义井乡', 4, 2230), +(16829, '双墩镇', 4, 2230), +(16830, '吴山镇', 4, 2230), +(16831, '岗集镇', 4, 2230), +(16832, '左店乡', 4, 2230), +(16833, '庄墓镇', 4, 2230), +(16834, '朱巷镇', 4, 2230), +(16835, '杜集乡', 4, 2230), +(16836, '杨庙镇', 4, 2230), +(16837, '水湖镇', 4, 2230), +(16838, '罗塘乡', 4, 2230), +(16839, '造甲乡', 4, 2230), +(16840, '陶楼乡', 4, 2230), +(16841, '三山街道', 4, 2231), +(16842, '保定街道', 4, 2231), +(16843, '峨桥镇', 4, 2231), +(16844, '龙湖街道', 4, 2231), +(16845, '三里镇', 4, 2232), +(16846, '何湾镇', 4, 2232), +(16847, '家发镇', 4, 2232), +(16848, '工山镇', 4, 2232), +(16849, '弋江镇', 4, 2232); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16850, '烟墩镇', 4, 2232), +(16851, '籍山镇', 4, 2232), +(16852, '许镇镇', 4, 2232), +(16853, '中山南路街道', 4, 2233), +(16854, '利民路街道', 4, 2233), +(16855, '南瑞街道', 4, 2233), +(16856, '弋江桥街道', 4, 2233), +(16857, '火龙岗镇', 4, 2233), +(16858, '马塘镇', 4, 2233), +(16859, '鲁港镇', 4, 2233), +(16860, '孙村镇', 4, 2234), +(16861, '峨山乡', 4, 2234), +(16862, '平铺镇', 4, 2234), +(16863, '新港镇', 4, 2234), +(16864, '繁阳镇', 4, 2234), +(16865, '荻港镇', 4, 2234), +(16866, '六郎镇', 4, 2235), +(16867, '方村镇', 4, 2235), +(16868, '湾沚镇', 4, 2235), +(16869, '红杨镇', 4, 2235), +(16870, '花桥镇', 4, 2235), +(16871, '陶辛镇', 4, 2235), +(16872, '东门街道', 4, 2236), +(16873, '北京路街道', 4, 2236), +(16874, '北门街道', 4, 2236), +(16875, '吉和街道', 4, 2236), +(16876, '天门山街道', 4, 2236), +(16877, '弋矶山街道', 4, 2236), +(16878, '汀棠街道', 4, 2236), +(16879, '荆山街道', 4, 2236), +(16880, '赭山街道', 4, 2236), +(16881, '赭麓街道', 4, 2236), +(16882, '镜湖街道', 4, 2236), +(16883, '四褐山街道', 4, 2237), +(16884, '大桥街道', 4, 2237), +(16885, '大闸街道', 4, 2237), +(16886, '官陡街道', 4, 2237), +(16887, '张镇街道', 4, 2237), +(16888, '清水街道', 4, 2237), +(16889, '湾里街道', 4, 2237), +(16890, '裕溪口街道', 4, 2237), +(16891, '东刘集镇', 4, 2238), +(16892, '临北回族乡', 4, 2238), +(16893, '双忠庙镇', 4, 2238), +(16894, '城关镇', 4, 2238), +(16895, '大新镇', 4, 2238), +(16896, '头铺镇', 4, 2238), +(16897, '小圩镇', 4, 2238), +(16898, '小溪镇', 4, 2238), +(16899, '新集镇', 4, 2238), +(16900, '朱顶镇', 4, 2238), +(16901, '武桥镇', 4, 2238), +(16902, '沫河口镇', 4, 2238), +(16903, '沱湖乡', 4, 2238), +(16904, '浍南镇', 4, 2238), +(16905, '申集镇', 4, 2238), +(16906, '仲兴乡', 4, 2239), +(16907, '任桥镇', 4, 2239), +(16908, '刘集镇', 4, 2239), +(16909, '城关镇', 4, 2239), +(16910, '新马桥镇', 4, 2239), +(16911, '杨庙乡', 4, 2239); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16912, '湖沟镇', 4, 2239), +(16913, '濠城镇', 4, 2239), +(16914, '王庄镇', 4, 2239), +(16915, '石湖乡', 4, 2239), +(16916, '连城镇', 4, 2239), +(16917, '万福镇', 4, 2240), +(16918, '兰桥乡', 4, 2240), +(16919, '双桥集镇', 4, 2240), +(16920, '古城乡', 4, 2240), +(16921, '唐集镇', 4, 2240), +(16922, '城关镇', 4, 2240), +(16923, '常坟镇', 4, 2240), +(16924, '徐圩乡', 4, 2240), +(16925, '找郢乡', 4, 2240), +(16926, '河溜镇', 4, 2240), +(16927, '淝南乡', 4, 2240), +(16928, '淝河乡', 4, 2240), +(16929, '荆芡乡', 4, 2240), +(16930, '褚集乡', 4, 2240), +(16931, '陈集乡', 4, 2240), +(16932, '马城镇', 4, 2240), +(16933, '魏庄镇', 4, 2240), +(16934, '鲍集镇', 4, 2240), +(16935, '龙亢农场', 4, 2240), +(16936, '龙亢镇', 4, 2240), +(16937, '吴小街镇', 4, 2241), +(16938, '小蚌埠镇', 4, 2241), +(16939, '曹老集镇', 4, 2241), +(16940, '梅桥乡', 4, 2241), +(16941, '淮滨街道', 4, 2241), +(16942, '大庆街道', 4, 2242), +(16943, '张公山街道', 4, 2242), +(16944, '朝阳街道', 4, 2242), +(16945, '秦集镇', 4, 2242), +(16946, '纬四街道', 4, 2242), +(16947, '钓鱼台街道', 4, 2242), +(16948, '长青乡', 4, 2242), +(16949, '天桥街道', 4, 2243), +(16950, '宏业村街道', 4, 2243), +(16951, '燕山乡', 4, 2243), +(16952, '纬二路街道', 4, 2243), +(16953, '胜利街道', 4, 2243), +(16954, '雪华乡', 4, 2243), +(16955, '青年街道', 4, 2243), +(16956, '黄庄街道', 4, 2243), +(16957, '龙湖新村街道', 4, 2243), +(16958, '东升街道', 4, 2244), +(16959, '东风街道', 4, 2244), +(16960, '延安街道', 4, 2244), +(16961, '曹山街道', 4, 2244), +(16962, '李楼乡', 4, 2244), +(16963, '治淮街道', 4, 2244), +(16964, '解放街道', 4, 2244), +(16965, '长淮卫镇', 4, 2244), +(16966, '八公山镇', 4, 2245), +(16967, '土坝孜街道', 4, 2245), +(16968, '山王镇', 4, 2245), +(16969, '新庄孜街道', 4, 2245), +(16970, '毕家岗街道', 4, 2245), +(16971, '丁集乡', 4, 2246), +(16972, '关店乡', 4, 2246), +(16973, '刘集乡', 4, 2246); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(16974, '古店乡', 4, 2246), +(16975, '城关镇', 4, 2246), +(16976, '城北乡', 4, 2246), +(16977, '夏集乡', 4, 2246), +(16978, '大兴集乡', 4, 2246), +(16979, '大山镇', 4, 2246), +(16980, '尚塘乡', 4, 2246), +(16981, '岳张集镇', 4, 2246), +(16982, '新集镇', 4, 2246), +(16983, '朱马店镇', 4, 2246), +(16984, '李冲回族乡', 4, 2246), +(16985, '杨村乡', 4, 2246), +(16986, '桂集乡', 4, 2246), +(16987, '毛集镇', 4, 2246), +(16988, '焦岗乡', 4, 2246), +(16989, '钱庙乡', 4, 2246), +(16990, '顾桥镇', 4, 2246), +(16991, '上窑镇', 4, 2247), +(16992, '九龙岗镇', 4, 2247), +(16993, '大通街道', 4, 2247), +(16994, '孔店乡', 4, 2247), +(16995, '洛河镇', 4, 2247), +(16996, '古沟回族乡', 4, 2248), +(16997, '夹沟乡', 4, 2248), +(16998, '平圩镇', 4, 2248), +(16999, '架河乡', 4, 2248), +(17000, '泥河镇', 4, 2248), +(17001, '潘集镇', 4, 2248), +(17002, '田集街道', 4, 2248), +(17003, '祁集乡', 4, 2248), +(17004, '芦集镇', 4, 2248), +(17005, '贺疃乡', 4, 2248), +(17006, '高皇镇', 4, 2248), +(17007, '三和乡', 4, 2249), +(17008, '公园街道', 4, 2249), +(17009, '史院乡', 4, 2249), +(17010, '国庆街道', 4, 2249), +(17011, '安成镇', 4, 2249), +(17012, '新淮街道', 4, 2249), +(17013, '曹庵镇', 4, 2249), +(17014, '朝阳街道', 4, 2249), +(17015, '泉山街道', 4, 2249), +(17016, '洞山街道', 4, 2249), +(17017, '淮滨街道', 4, 2249), +(17018, '田东街道', 4, 2249), +(17019, '舜耕镇', 4, 2249), +(17020, '龙泉街道', 4, 2249), +(17021, '唐山镇', 4, 2250), +(17022, '孙庙乡', 4, 2250), +(17023, '孤堆回族乡', 4, 2250), +(17024, '平山街道', 4, 2250), +(17025, '望峰岗镇', 4, 2250), +(17026, '李郢孜镇', 4, 2250), +(17027, '杨公镇', 4, 2250), +(17028, '立新街道', 4, 2250), +(17029, '蔡家岗街道', 4, 2250), +(17030, '谢三村街道', 4, 2250), +(17031, '谢家集街道', 4, 2250), +(17032, '丹阳镇', 4, 2251), +(17033, '乌溪镇', 4, 2251), +(17034, '博望镇', 4, 2251), +(17035, '塘南镇', 4, 2251), +(17036, '大陇乡', 4, 2251); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17037, '太白镇', 4, 2251), +(17038, '姑孰镇', 4, 2251), +(17039, '年陡乡', 4, 2251), +(17040, '护河镇', 4, 2251), +(17041, '新市镇', 4, 2251), +(17042, '江心乡', 4, 2251), +(17043, '湖阳乡', 4, 2251), +(17044, '石桥镇', 4, 2251), +(17045, '黄池镇', 4, 2251), +(17046, '桃源路街道', 4, 2252), +(17047, '沙塘路街道', 4, 2252), +(17048, '湖东路街道', 4, 2252), +(17049, '解放路街道', 4, 2252), +(17050, '霍里镇', 4, 2252), +(17051, '塘西街道', 4, 2253), +(17052, '慈湖乡', 4, 2253), +(17053, '慈湖街道', 4, 2253), +(17054, '江边街道', 4, 2253), +(17055, '金家庄街道', 4, 2253), +(17056, '佳山乡', 4, 2254), +(17057, '向山镇', 4, 2254), +(17058, '安民街道', 4, 2254), +(17059, '平湖街道', 4, 2254), +(17060, '采石街道', 4, 2254), +(17061, '银塘镇', 4, 2254), +(17062, '雨山街道', 4, 2254), +(17063, '朔里镇', 4, 2255), +(17064, '段圆镇', 4, 2255), +(17065, '石台镇', 4, 2255), +(17066, '矿山集街道', 4, 2255), +(17067, '高岳街道', 4, 2255), +(17068, '临涣镇', 4, 2256), +(17069, '五沟镇', 4, 2256), +(17070, '刘桥镇', 4, 2256), +(17071, '南坪镇', 4, 2256), +(17072, '双堆集镇', 4, 2256), +(17073, '四铺乡', 4, 2256), +(17074, '孙疃镇', 4, 2256), +(17075, '濉溪镇', 4, 2256), +(17076, '百善镇', 4, 2256), +(17077, '铁佛镇', 4, 2256), +(17078, '韩村镇', 4, 2256), +(17079, '临海童街道', 4, 2257), +(17080, '任楼街道', 4, 2257), +(17081, '前岭街道', 4, 2257), +(17082, '古饶镇', 4, 2257), +(17083, '宋疃镇', 4, 2257), +(17084, '杨庄街道', 4, 2257), +(17085, '烈山镇', 4, 2257), +(17086, '百善街道', 4, 2257), +(17087, '三堤口街道', 4, 2258), +(17088, '东山街道', 4, 2258), +(17089, '任圩街道', 4, 2258), +(17090, '刘桥街道', 4, 2258), +(17091, '渠沟镇', 4, 2258), +(17092, '相南街道', 4, 2258), +(17093, '相山东街道', 4, 2258), +(17094, '相山西街道', 4, 2258), +(17095, '凤凰山街道', 4, 2259), +(17096, '新庙街道', 4, 2259), +(17097, '狮子山街道', 4, 2259); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17098, '矶山街道', 4, 2259), +(17099, '西湖镇', 4, 2259), +(17100, '大通镇', 4, 2260), +(17101, '安铜街道', 4, 2260), +(17102, '普济圩农场', 4, 2260), +(17103, '桥南街道', 4, 2260), +(17104, '灰河乡', 4, 2260), +(17105, '铜山镇', 4, 2260), +(17106, '扫把沟街道', 4, 2261), +(17107, '杨家山街道', 4, 2261), +(17108, '横港街道', 4, 2261), +(17109, '石城路街道', 4, 2261), +(17110, '铜官山街道', 4, 2261), +(17111, '长江路街道', 4, 2261), +(17112, '东联乡', 4, 2262), +(17113, '五松镇', 4, 2262), +(17114, '天门镇', 4, 2262), +(17115, '老洲乡', 4, 2262), +(17116, '胥坝乡', 4, 2262), +(17117, '西联乡', 4, 2262), +(17118, '钟鸣镇', 4, 2262), +(17119, '顺安镇', 4, 2262), +(17120, '十里铺乡', 4, 2263), +(17121, '山口乡', 4, 2263), +(17122, '德宽路街道', 4, 2263), +(17123, '海口镇', 4, 2263), +(17124, '玉琳路街道', 4, 2263), +(17125, '石化路街道', 4, 2263), +(17126, '花亭路街道', 4, 2263), +(17127, '菱湖街道', 4, 2263), +(17128, '集贤路街道', 4, 2263), +(17129, '龙山路街道', 4, 2263), +(17130, '刘畈乡', 4, 2264), +(17131, '北中镇', 4, 2264), +(17132, '城西乡', 4, 2264), +(17133, '大石乡', 4, 2264), +(17134, '天华镇', 4, 2264), +(17135, '寺前镇', 4, 2264), +(17136, '小池镇', 4, 2264), +(17137, '弥陀镇', 4, 2264), +(17138, '徐桥镇', 4, 2264), +(17139, '新仓镇', 4, 2264), +(17140, '晋熙镇', 4, 2264), +(17141, '江塘乡', 4, 2264), +(17142, '汤泉乡', 4, 2264), +(17143, '牛镇镇', 4, 2264), +(17144, '百里镇', 4, 2264), +(17145, '五横乡', 4, 2265), +(17146, '大龙山镇', 4, 2265), +(17147, '杨桥镇', 4, 2265), +(17148, '白泽湖乡', 4, 2265), +(17149, '皖河农场', 4, 2265), +(17150, '罗岭镇', 4, 2265), +(17151, '菱北街道', 4, 2265), +(17152, '下仓镇', 4, 2266), +(17153, '九姑乡', 4, 2266), +(17154, '二郎镇', 4, 2266), +(17155, '五里乡', 4, 2266), +(17156, '佐坝乡', 4, 2266), +(17157, '凉亭镇', 4, 2266), +(17158, '北浴乡', 4, 2266), +(17159, '千岭乡', 4, 2266); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17160, '华阳河农场总场', 4, 2266), +(17161, '复兴镇', 4, 2266), +(17162, '孚玉镇', 4, 2266), +(17163, '柳坪乡', 4, 2266), +(17164, '汇口镇', 4, 2266), +(17165, '河塌乡', 4, 2266), +(17166, '洲头乡', 4, 2266), +(17167, '破凉镇', 4, 2266), +(17168, '程岭乡', 4, 2266), +(17169, '许岭镇', 4, 2266), +(17170, '趾凤乡', 4, 2266), +(17171, '长铺镇', 4, 2266), +(17172, '陈汉乡', 4, 2266), +(17173, '隘口乡', 4, 2266), +(17174, '高岭乡', 4, 2266), +(17175, '中关乡', 4, 2267), +(17176, '主簿镇', 4, 2267), +(17177, '五河镇', 4, 2267), +(17178, '冶溪镇', 4, 2267), +(17179, '包家乡', 4, 2267), +(17180, '古坊乡', 4, 2267), +(17181, '和平乡', 4, 2267), +(17182, '响肠镇', 4, 2267), +(17183, '天堂镇', 4, 2267), +(17184, '头陀镇', 4, 2267), +(17185, '姚河乡', 4, 2267), +(17186, '巍岭乡', 4, 2267), +(17187, '店前镇', 4, 2267), +(17188, '来榜镇', 4, 2267), +(17189, '毛尖山乡', 4, 2267), +(17190, '河图镇', 4, 2267), +(17191, '温泉镇', 4, 2267), +(17192, '田头乡', 4, 2267), +(17193, '白帽镇', 4, 2267), +(17194, '石关乡', 4, 2267), +(17195, '莲云乡', 4, 2267), +(17196, '菖蒲镇', 4, 2267), +(17197, '青天乡', 4, 2267), +(17198, '黄尾镇', 4, 2267), +(17199, '三桥镇', 4, 2268), +(17200, '公岭镇', 4, 2268), +(17201, '凉亭乡', 4, 2268), +(17202, '小市镇', 4, 2268), +(17203, '平山镇', 4, 2268), +(17204, '月山镇', 4, 2268), +(17205, '江镇镇', 4, 2268), +(17206, '洪铺镇', 4, 2268), +(17207, '清河乡', 4, 2268), +(17208, '石牌镇', 4, 2268), +(17209, '石镜乡', 4, 2268), +(17210, '秀山乡', 4, 2268), +(17211, '腊树镇', 4, 2268), +(17212, '茶岭镇', 4, 2268), +(17213, '金拱镇', 4, 2268), +(17214, '雷埠乡', 4, 2268), +(17215, '马庙镇', 4, 2268), +(17216, '高河镇', 4, 2268), +(17217, '黄墩镇', 4, 2268), +(17218, '黄龙镇', 4, 2268), +(17219, '凉泉乡', 4, 2269), +(17220, '华阳镇', 4, 2269), +(17221, '太慈镇', 4, 2269), +(17222, '杨湾镇', 4, 2269), +(17223, '漳湖镇', 4, 2269), +(17224, '赛口镇', 4, 2269); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17225, '长岭镇', 4, 2269), +(17226, '雷池乡', 4, 2269), +(17227, '高士镇', 4, 2269), +(17228, '鸦滩镇', 4, 2269), +(17229, '义津镇', 4, 2270), +(17230, '会宫乡', 4, 2270), +(17231, '凤仪乡', 4, 2270), +(17232, '周潭镇', 4, 2270), +(17233, '固山镇', 4, 2270), +(17234, '官埠桥镇', 4, 2270), +(17235, '枞阳镇', 4, 2270), +(17236, '横埠镇', 4, 2270), +(17237, '汤沟镇', 4, 2270), +(17238, '浮山镇', 4, 2270), +(17239, '白梅乡', 4, 2270), +(17240, '白湖乡', 4, 2270), +(17241, '老洲镇', 4, 2270), +(17242, '金社乡', 4, 2270), +(17243, '钱桥镇', 4, 2270), +(17244, '钱铺乡', 4, 2270), +(17245, '铁铜乡', 4, 2270), +(17246, '长沙乡', 4, 2270), +(17247, '陈瑶湖镇', 4, 2270), +(17248, '雨坛乡', 4, 2270), +(17249, '项铺镇', 4, 2270), +(17250, '麒麟镇', 4, 2270), +(17251, '中义乡', 4, 2271), +(17252, '兴店镇', 4, 2271), +(17253, '卅铺镇', 4, 2271), +(17254, '南演街道', 4, 2271), +(17255, '双港镇', 4, 2271), +(17256, '吕亭镇', 4, 2271), +(17257, '唐湾镇', 4, 2271), +(17258, '大关镇', 4, 2271), +(17259, '大塘乡', 4, 2271), +(17260, '太平街道', 4, 2271), +(17261, '嬉子湖镇', 4, 2271), +(17262, '孔城镇', 4, 2271), +(17263, '挂车河镇', 4, 2271), +(17264, '文昌街道', 4, 2271), +(17265, '新渡镇', 4, 2271), +(17266, '碧峰街道', 4, 2271), +(17267, '老梅镇', 4, 2271), +(17268, '范岗镇', 4, 2271), +(17269, '金神镇', 4, 2271), +(17270, '陶冲镇', 4, 2271), +(17271, '青草镇', 4, 2271), +(17272, '香铺镇', 4, 2271), +(17273, '高桥镇', 4, 2271), +(17274, '鲟鱼镇', 4, 2271), +(17275, '黄铺乡', 4, 2271), +(17276, '龙眠乡', 4, 2271), +(17277, '五庙乡', 4, 2272), +(17278, '余井镇', 4, 2272), +(17279, '塔畈乡', 4, 2272), +(17280, '天柱山镇', 4, 2272), +(17281, '官庄镇', 4, 2272), +(17282, '彭岭工业区', 4, 2272), +(17283, '梅城镇', 4, 2272), +(17284, '槎水镇', 4, 2272), +(17285, '水吼镇', 4, 2272), +(17286, '油坝乡', 4, 2272), +(17287, '源潭镇', 4, 2272), +(17288, '王河镇', 4, 2272), +(17289, '痘姆乡', 4, 2272); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17290, '黄柏镇', 4, 2272), +(17291, '黄泥镇', 4, 2272), +(17292, '黄铺镇', 4, 2272), +(17293, '龙潭乡', 4, 2272), +(17294, '人民路街道', 4, 2273), +(17295, '华中路街道', 4, 2273), +(17296, '孝肃路街道', 4, 2273), +(17297, '宜城路街道', 4, 2273), +(17298, '建设路街道', 4, 2273), +(17299, '新河路街道', 4, 2273), +(17300, '新洲乡', 4, 2273), +(17301, '老峰镇', 4, 2273), +(17302, '长风乡', 4, 2273), +(17303, '龙狮桥乡', 4, 2273), +(17304, '万安镇', 4, 2274), +(17305, '东临溪镇', 4, 2274), +(17306, '五城镇', 4, 2274), +(17307, '商山乡', 4, 2274), +(17308, '山斗乡', 4, 2274), +(17309, '岭南乡', 4, 2274), +(17310, '板桥乡', 4, 2274), +(17311, '榆村乡', 4, 2274), +(17312, '汪村镇', 4, 2274), +(17313, '流口镇', 4, 2274), +(17314, '海阳镇', 4, 2274), +(17315, '渭桥乡', 4, 2274), +(17316, '源芳乡', 4, 2274), +(17317, '溪口镇', 4, 2274), +(17318, '璜尖乡', 4, 2274), +(17319, '白际乡', 4, 2274), +(17320, '蓝田镇', 4, 2274), +(17321, '陈霞乡', 4, 2274), +(17322, '鹤城乡', 4, 2274), +(17323, '齐云山镇', 4, 2274), +(17324, '龙田乡', 4, 2274), +(17325, '奕棋镇', 4, 2275), +(17326, '屯光镇', 4, 2275), +(17327, '新潭镇', 4, 2275), +(17328, '昱东街道', 4, 2275), +(17329, '昱中街道', 4, 2275), +(17330, '昱西街道', 4, 2275), +(17331, '老街街道', 4, 2275), +(17332, '阳湖镇', 4, 2275), +(17333, '黎阳镇', 4, 2275), +(17334, '呈坎镇', 4, 2276), +(17335, '富溪乡', 4, 2276), +(17336, '岩寺镇', 4, 2276), +(17337, '徽州街道', 4, 2276), +(17338, '杨村乡', 4, 2276), +(17339, '洽舍乡', 4, 2276), +(17340, '潜口镇', 4, 2276), +(17341, '西溪南镇', 4, 2276), +(17342, '三阳乡', 4, 2277), +(17343, '上丰乡', 4, 2277), +(17344, '北岸镇', 4, 2277), +(17345, '坑口乡', 4, 2277), +(17346, '富堨镇', 4, 2277), +(17347, '小川乡', 4, 2277), +(17348, '岔口镇', 4, 2277), +(17349, '徽城镇', 4, 2277), +(17350, '新溪口乡', 4, 2277), +(17351, '昌溪乡', 4, 2277), +(17352, '杞梓里镇', 4, 2277), +(17353, '桂林镇', 4, 2277); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17354, '森村乡', 4, 2277), +(17355, '武阳乡', 4, 2277), +(17356, '深渡镇', 4, 2277), +(17357, '溪头镇', 4, 2277), +(17358, '狮石乡', 4, 2277), +(17359, '王村镇', 4, 2277), +(17360, '璜田乡', 4, 2277), +(17361, '石门乡', 4, 2277), +(17362, '绍濂乡', 4, 2277), +(17363, '街口镇', 4, 2277), +(17364, '许村镇', 4, 2277), +(17365, '郑村镇', 4, 2277), +(17366, '金川乡', 4, 2277), +(17367, '长陔乡', 4, 2277), +(17368, '雄村乡', 4, 2277), +(17369, '霞坑镇', 4, 2277), +(17370, '凫峰乡', 4, 2278), +(17371, '历口镇', 4, 2278), +(17372, '古溪乡', 4, 2278), +(17373, '塔坊乡', 4, 2278), +(17374, '大坦乡', 4, 2278), +(17375, '安凌镇', 4, 2278), +(17376, '小路口镇', 4, 2278), +(17377, '平里镇', 4, 2278), +(17378, '新安乡', 4, 2278), +(17379, '柏溪乡', 4, 2278), +(17380, '渚口乡', 4, 2278), +(17381, '溶口乡', 4, 2278), +(17382, '祁山镇', 4, 2278), +(17383, '祁红乡', 4, 2278), +(17384, '箬坑乡', 4, 2278), +(17385, '芦溪乡', 4, 2278), +(17386, '金字牌镇', 4, 2278), +(17387, '闪里镇', 4, 2278), +(17388, '三口镇', 4, 2279), +(17389, '乌石乡', 4, 2279), +(17390, '仙源镇', 4, 2279), +(17391, '太平湖镇', 4, 2279), +(17392, '新丰乡', 4, 2279), +(17393, '新华乡', 4, 2279), +(17394, '新城街道', 4, 2279), +(17395, '新明乡', 4, 2279), +(17396, '永丰乡', 4, 2279), +(17397, '汤口镇', 4, 2279), +(17398, '焦村镇', 4, 2279), +(17399, '甘棠镇', 4, 2279), +(17400, '耿城镇', 4, 2279), +(17401, '谭家桥镇', 4, 2279), +(17402, '龙门乡', 4, 2279), +(17403, '宏村镇', 4, 2280), +(17404, '宏潭乡', 4, 2280), +(17405, '柯村乡', 4, 2280), +(17406, '洪星乡', 4, 2280), +(17407, '渔亭镇', 4, 2280), +(17408, '碧阳镇', 4, 2280), +(17409, '美溪乡', 4, 2280), +(17410, '西递镇', 4, 2280), +(17411, '二郎口镇', 4, 2281), +(17412, '六镇镇', 4, 2281), +(17413, '十字乡', 4, 2281), +(17414, '古河镇', 4, 2281), +(17415, '周岗乡', 4, 2281), +(17416, '复兴乡', 4, 2281), +(17417, '大墅镇', 4, 2281), +(17418, '武岗镇', 4, 2281); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17419, '石沛镇', 4, 2281), +(17420, '程家市乡', 4, 2281), +(17421, '章辉镇', 4, 2281), +(17422, '管坝乡', 4, 2281), +(17423, '草庵乡', 4, 2281), +(17424, '襄河镇', 4, 2281), +(17425, '西王镇', 4, 2281), +(17426, '陈浅乡', 4, 2281), +(17427, '马厂镇', 4, 2281), +(17428, '临淮镇', 4, 2282), +(17429, '二铺乡', 4, 2282), +(17430, '亮岗乡', 4, 2282), +(17431, '刘府镇', 4, 2282), +(17432, '周圩乡', 4, 2282), +(17433, '城西乡', 4, 2282), +(17434, '大庙镇', 4, 2282), +(17435, '大溪河镇', 4, 2282), +(17436, '官塘乡', 4, 2282), +(17437, '官沟乡', 4, 2282), +(17438, '小溪河镇', 4, 2282), +(17439, '府城镇', 4, 2282), +(17440, '总铺镇', 4, 2282), +(17441, '曹店乡', 4, 2282), +(17442, '板桥镇', 4, 2282), +(17443, '枣巷渔业乡', 4, 2282), +(17444, '梅市乡', 4, 2282), +(17445, '武店镇', 4, 2282), +(17446, '殷涧镇', 4, 2282), +(17447, '燃灯乡', 4, 2282), +(17448, '石门山镇', 4, 2282), +(17449, '红心镇', 4, 2282), +(17450, '西泉镇', 4, 2282), +(17451, '门台镇', 4, 2282), +(17452, '黄泥铺镇', 4, 2282), +(17453, '黄湾乡', 4, 2282), +(17454, '三官集乡', 4, 2283), +(17455, '乌衣镇', 4, 2283), +(17456, '南谯街道', 4, 2283), +(17457, '城郊乡', 4, 2283), +(17458, '大柳镇', 4, 2283), +(17459, '大王镇', 4, 2283), +(17460, '常山乡', 4, 2283), +(17461, '施集乡', 4, 2283), +(17462, '汪郢乡', 4, 2283), +(17463, '沙河镇', 4, 2283), +(17464, '珠龙镇', 4, 2283), +(17465, '皇甫乡', 4, 2283), +(17466, '章广镇', 4, 2283), +(17467, '腰铺镇', 4, 2283), +(17468, '花山乡', 4, 2283), +(17469, '黄圩乡', 4, 2283), +(17470, '黄泥岗镇', 4, 2283), +(17471, '万寿乡', 4, 2284), +(17472, '仁和集镇', 4, 2284), +(17473, '便益乡', 4, 2284), +(17474, '关塘集乡', 4, 2284), +(17475, '冶山镇', 4, 2284), +(17476, '十八集乡', 4, 2284), +(17477, '城南街道', 4, 2284), +(17478, '大通镇', 4, 2284), +(17479, '天长街道', 4, 2284), +(17480, '安乐镇', 4, 2284), +(17481, '平安镇', 4, 2284), +(17482, '张铺镇', 4, 2284); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17483, '新街乡', 4, 2284), +(17484, '杨村镇', 4, 2284), +(17485, '桥湾街道', 4, 2284), +(17486, '永丰街道', 4, 2284), +(17487, '汊涧镇', 4, 2284), +(17488, '界牌镇', 4, 2284), +(17489, '石梁镇', 4, 2284), +(17490, '秦栏镇', 4, 2284), +(17491, '芦龙乡', 4, 2284), +(17492, '谕兴乡', 4, 2284), +(17493, '郑集镇', 4, 2284), +(17494, '金集镇', 4, 2284), +(17495, '釜山镇', 4, 2284), +(17496, '铜城镇', 4, 2284), +(17497, '高庙集镇', 4, 2284), +(17498, '龙集乡', 4, 2284), +(17499, '七里塘乡', 4, 2285), +(17500, '三和集镇', 4, 2285), +(17501, '东兴乡', 4, 2285), +(17502, '严桥乡', 4, 2285), +(17503, '九梓乡', 4, 2285), +(17504, '二龙回族乡', 4, 2285), +(17505, '仁和乡', 4, 2285), +(17506, '仓镇镇', 4, 2285), +(17507, '吴圩镇', 4, 2285), +(17508, '大桥乡', 4, 2285), +(17509, '天河乡', 4, 2285), +(17510, '定城镇', 4, 2285), +(17511, '岱山镇', 4, 2285), +(17512, '年家岗镇', 4, 2285), +(17513, '张桥镇', 4, 2285), +(17514, '拂晓乡', 4, 2285), +(17515, '斋朗乡', 4, 2285), +(17516, '朱湾镇', 4, 2285), +(17517, '朱马乡', 4, 2285), +(17518, '桑涧镇', 4, 2285), +(17519, '永康镇', 4, 2285), +(17520, '池河镇', 4, 2285), +(17521, '炉桥镇', 4, 2285), +(17522, '界牌集镇', 4, 2285), +(17523, '程桥乡', 4, 2285), +(17524, '站岗乡', 4, 2285), +(17525, '练铺乡', 4, 2285), +(17526, '能仁乡', 4, 2285), +(17527, '范岗乡', 4, 2285), +(17528, '蒋集乡', 4, 2285), +(17529, '藕塘镇', 4, 2285), +(17530, '西卅店镇', 4, 2285), +(17531, '连江镇', 4, 2285), +(17532, '青山乡', 4, 2285), +(17533, '青洛乡', 4, 2285), +(17534, '靠山乡', 4, 2285), +(17535, '高塘乡', 4, 2285), +(17536, '三关乡', 4, 2286), +(17537, '三界镇', 4, 2286), +(17538, '古沛镇', 4, 2286), +(17539, '司巷乡', 4, 2286), +(17540, '嘉山乡', 4, 2286), +(17541, '城关街道', 4, 2286), +(17542, '城北街道', 4, 2286), +(17543, '城西街道', 4, 2286), +(17544, '太平乡', 4, 2286), +(17545, '女山湖镇', 4, 2286), +(17546, '张八岭镇', 4, 2286); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17547, '招信镇', 4, 2286), +(17548, '明东乡', 4, 2286), +(17549, '柳巷乡', 4, 2286), +(17550, '桥头镇', 4, 2286), +(17551, '横山乡', 4, 2286), +(17552, '泊岗乡', 4, 2286), +(17553, '津里镇', 4, 2286), +(17554, '涝口乡', 4, 2286), +(17555, '涧溪镇', 4, 2286), +(17556, '潘村镇', 4, 2286), +(17557, '石坝镇', 4, 2286), +(17558, '管店镇', 4, 2286), +(17559, '紫阳乡', 4, 2286), +(17560, '自来桥镇', 4, 2286), +(17561, '苏巷镇', 4, 2286), +(17562, '邵岗乡', 4, 2286), +(17563, '马岗乡', 4, 2286), +(17564, '鲁山乡', 4, 2286), +(17565, '三城乡', 4, 2287), +(17566, '兴隆乡', 4, 2287), +(17567, '半塔镇', 4, 2287), +(17568, '双塘乡', 4, 2287), +(17569, '大英镇', 4, 2287), +(17570, '张山乡', 4, 2287), +(17571, '新安镇', 4, 2287), +(17572, '施官镇', 4, 2287), +(17573, '杨郢颖乡', 4, 2287), +(17574, '武集乡', 4, 2287), +(17575, '水口镇', 4, 2287), +(17576, '汊河镇', 4, 2287), +(17577, '独山乡', 4, 2287), +(17578, '相官镇', 4, 2287), +(17579, '舜山乡', 4, 2287), +(17580, '邵集乡', 4, 2287), +(17581, '雷官镇', 4, 2287), +(17582, '龙山乡', 4, 2287), +(17583, '东门街道', 4, 2288), +(17584, '凤凰街道', 4, 2288), +(17585, '北门街道', 4, 2288), +(17586, '南门街道', 4, 2288), +(17587, '扬子街道', 4, 2288), +(17588, '清流街道', 4, 2288), +(17589, '琅玡街道', 4, 2288), +(17590, '西门街道', 4, 2288), +(17591, '于寨镇', 4, 2289), +(17592, '关庙镇', 4, 2289), +(17593, '单桥镇', 4, 2289), +(17594, '同城镇', 4, 2289), +(17595, '吕寨镇', 4, 2289), +(17596, '土陂乡', 4, 2289), +(17597, '城关镇', 4, 2289), +(17598, '姜寨镇', 4, 2289), +(17599, '宋集镇', 4, 2289), +(17600, '庙岔镇', 4, 2289), +(17601, '庞营乡', 4, 2289), +(17602, '张新镇', 4, 2289), +(17603, '张营乡', 4, 2289), +(17604, '杨小街乡', 4, 2289), +(17605, '杨桥镇', 4, 2289), +(17606, '滑集镇', 4, 2289), +(17607, '牛庄乡', 4, 2289), +(17608, '瓦店镇', 4, 2289), +(17609, '田桥乡', 4, 2289), +(17610, '白庙镇', 4, 2289), +(17611, '老集镇', 4, 2289); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17612, '艾亭镇', 4, 2289), +(17613, '范兴集乡', 4, 2289), +(17614, '谢集乡', 4, 2289), +(17615, '谭棚镇', 4, 2289), +(17616, '迎仙镇', 4, 2289), +(17617, '邢塘镇', 4, 2289), +(17618, '长官镇', 4, 2289), +(17619, '陈集镇', 4, 2289), +(17620, '陶老乡', 4, 2289), +(17621, '韦寨镇', 4, 2289), +(17622, '高塘乡', 4, 2289), +(17623, '黄岭镇', 4, 2289), +(17624, '三堂镇', 4, 2290), +(17625, '三塔镇', 4, 2290), +(17626, '二郎乡', 4, 2290), +(17627, '五星镇', 4, 2290), +(17628, '倪邱镇', 4, 2290), +(17629, '关集镇', 4, 2290), +(17630, '原墙镇', 4, 2290), +(17631, '双庙镇', 4, 2290), +(17632, '双浮镇', 4, 2290), +(17633, '坟台镇', 4, 2290), +(17634, '城关镇', 4, 2290), +(17635, '大庙集镇', 4, 2290), +(17636, '大新镇', 4, 2290), +(17637, '官集镇', 4, 2290), +(17638, '旧县镇', 4, 2290), +(17639, '李兴镇', 4, 2290), +(17640, '桑营镇', 4, 2290), +(17641, '洪山镇', 4, 2290), +(17642, '清浅镇', 4, 2290), +(17643, '皮条孙镇', 4, 2290), +(17644, '税镇镇', 4, 2290), +(17645, '肖口镇', 4, 2290), +(17646, '胡总乡', 4, 2290), +(17647, '苗老集镇', 4, 2290), +(17648, '蔡庙镇', 4, 2290), +(17649, '赵庙镇', 4, 2290), +(17650, '赵集乡', 4, 2290), +(17651, '郭庙乡', 4, 2290), +(17652, '阮桥镇', 4, 2290), +(17653, '马集乡', 4, 2290), +(17654, '高庙镇', 4, 2290), +(17655, '东城街道', 4, 2291), +(17656, '任寨乡', 4, 2291), +(17657, '光武镇', 4, 2291), +(17658, '大黄镇', 4, 2291), +(17659, '戴桥镇', 4, 2291), +(17660, '新马集镇', 4, 2291), +(17661, '泉阳镇', 4, 2291), +(17662, '王集镇', 4, 2291), +(17663, '田营镇', 4, 2291), +(17664, '砖集镇', 4, 2291), +(17665, '舒庄镇', 4, 2291), +(17666, '芦村镇', 4, 2291), +(17667, '西城街道', 4, 2291), +(17668, '邴集乡', 4, 2291), +(17669, '陶庙镇', 4, 2291), +(17670, '靳寨乡', 4, 2291), +(17671, '顾集镇', 4, 2291), +(17672, '颍南街道', 4, 2291), +(17673, '三塔集镇', 4, 2292), +(17674, '中岗镇', 4, 2292), +(17675, '于集乡', 4, 2292), +(17676, '会龙乡', 4, 2292); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17677, '公桥乡', 4, 2292), +(17678, '地城镇', 4, 2292), +(17679, '城关镇', 4, 2292), +(17680, '城郊乡', 4, 2292), +(17681, '张寨镇', 4, 2292), +(17682, '新村镇', 4, 2292), +(17683, '方集镇', 4, 2292), +(17684, '曹集镇', 4, 2292), +(17685, '朱寨镇', 4, 2292), +(17686, '柳沟镇', 4, 2292), +(17687, '柴集镇', 4, 2292), +(17688, '段郢乡', 4, 2292), +(17689, '洪河桥镇', 4, 2292), +(17690, '焦陂镇', 4, 2292), +(17691, '王化镇', 4, 2292), +(17692, '王堰镇', 4, 2292), +(17693, '王家坝镇', 4, 2292), +(17694, '王店孜乡', 4, 2292), +(17695, '田集镇', 4, 2292), +(17696, '老观乡', 4, 2292), +(17697, '苗集镇', 4, 2292), +(17698, '袁集镇', 4, 2292), +(17699, '许堂乡', 4, 2292), +(17700, '赵集镇', 4, 2292), +(17701, '郜台乡', 4, 2292), +(17702, '阜蒙农场', 4, 2292), +(17703, '黄岗镇', 4, 2292), +(17704, '龙王乡', 4, 2292), +(17705, '冉庙乡', 4, 2293), +(17706, '口孜镇', 4, 2293), +(17707, '向阳街道', 4, 2293), +(17708, '插花镇', 4, 2293), +(17709, '新乌江镇', 4, 2293), +(17710, '新华街道', 4, 2293), +(17711, '杨楼孜镇', 4, 2293), +(17712, '枣庄镇', 4, 2293), +(17713, '正午镇', 4, 2293), +(17714, '河东街道', 4, 2293), +(17715, '老庙镇', 4, 2293), +(17716, '袁寨镇', 4, 2293), +(17717, '三十里铺镇', 4, 2294), +(17718, '三合镇', 4, 2294), +(17719, '九龙镇', 4, 2294), +(17720, '京九街道', 4, 2294), +(17721, '文峰街道', 4, 2294), +(17722, '清河街道', 4, 2294), +(17723, '王店镇', 4, 2294), +(17724, '程集镇', 4, 2294), +(17725, '西湖景区街道', 4, 2294), +(17726, '西湖镇', 4, 2294), +(17727, '颍西街道', 4, 2294), +(17728, '马寨乡', 4, 2294), +(17729, '鼓楼街道', 4, 2294), +(17730, '中市街道', 4, 2295), +(17731, '伍明镇', 4, 2295), +(17732, '周棚街道', 4, 2295), +(17733, '宁老庄镇', 4, 2295), +(17734, '行流镇', 4, 2295), +(17735, '闻集镇', 4, 2295), +(17736, '五十铺乡', 4, 2296), +(17737, '八里河镇', 4, 2296), +(17738, '六十铺镇', 4, 2296), +(17739, '关屯乡', 4, 2296); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17740, '刘集乡', 4, 2296), +(17741, '十八里铺镇', 4, 2296), +(17742, '半岗镇', 4, 2296), +(17743, '南照镇', 4, 2296), +(17744, '古城乡', 4, 2296), +(17745, '垂岗乡', 4, 2296), +(17746, '城关镇', 4, 2296), +(17747, '夏桥镇', 4, 2296), +(17748, '建颍乡', 4, 2296), +(17749, '新集镇', 4, 2296), +(17750, '杨湖镇', 4, 2296), +(17751, '江口镇', 4, 2296), +(17752, '江店孜镇', 4, 2296), +(17753, '汤店镇', 4, 2296), +(17754, '润河镇', 4, 2296), +(17755, '王岗镇', 4, 2296), +(17756, '盛堂乡', 4, 2296), +(17757, '红星镇', 4, 2296), +(17758, '耿棚镇', 4, 2296), +(17759, '西三十铺镇', 4, 2296), +(17760, '谢桥镇', 4, 2296), +(17761, '赛涧回族乡', 4, 2296), +(17762, '陈桥镇', 4, 2296), +(17763, '颖河乡', 4, 2296), +(17764, '鲁口镇', 4, 2296), +(17765, '黄坝乡', 4, 2296), +(17766, '黄桥镇', 4, 2296), +(17767, '三八街道', 4, 2297), +(17768, '三里湾街道', 4, 2297), +(17769, '东关街道', 4, 2297), +(17770, '北关街道', 4, 2297), +(17771, '南关街道', 4, 2297), +(17772, '城东街道', 4, 2297), +(17773, '墉桥街道', 4, 2297), +(17774, '大店镇', 4, 2297), +(17775, '大营镇', 4, 2297), +(17776, '夹沟镇', 4, 2297), +(17777, '支河乡', 4, 2297), +(17778, '时村镇', 4, 2297), +(17779, '曹村镇', 4, 2297), +(17780, '朱仙庄镇', 4, 2297), +(17781, '杨庄乡', 4, 2297), +(17782, '栏杆镇', 4, 2297), +(17783, '桃园镇', 4, 2297), +(17784, '桃沟乡', 4, 2297), +(17785, '永安镇', 4, 2297), +(17786, '永镇乡', 4, 2297), +(17787, '汴河街道', 4, 2297), +(17788, '沱河街道', 4, 2297), +(17789, '灰古镇', 4, 2297), +(17790, '符离集镇', 4, 2297), +(17791, '芦岭镇', 4, 2297), +(17792, '苗庵乡', 4, 2297), +(17793, '蒿沟乡', 4, 2297), +(17794, '蕲县镇', 4, 2297), +(17795, '褚兰镇', 4, 2297), +(17796, '西二铺乡', 4, 2297), +(17797, '西关街道', 4, 2297), +(17798, '西寺坡镇', 4, 2297), +(17799, '解集乡', 4, 2297), +(17800, '道东街道', 4, 2297), +(17801, '顺河乡', 4, 2297), +(17802, '丁湖镇', 4, 2298), +(17803, '刘圩镇', 4, 2298); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17804, '墩集镇', 4, 2298), +(17805, '大庄镇', 4, 2298), +(17806, '大杨乡', 4, 2298), +(17807, '大路口乡', 4, 2298), +(17808, '屏山镇', 4, 2298), +(17809, '山头镇', 4, 2298), +(17810, '泗城镇', 4, 2298), +(17811, '瓦坊乡', 4, 2298), +(17812, '草庙镇', 4, 2298), +(17813, '草沟镇', 4, 2298), +(17814, '长沟镇', 4, 2298), +(17815, '黄圩镇', 4, 2298), +(17816, '黑塔镇', 4, 2298), +(17817, '下楼镇', 4, 2299), +(17818, '冯庙镇', 4, 2299), +(17819, '向阳乡', 4, 2299), +(17820, '大庙乡', 4, 2299), +(17821, '大路乡', 4, 2299), +(17822, '娄庄镇', 4, 2299), +(17823, '尤集镇', 4, 2299), +(17824, '尹集镇', 4, 2299), +(17825, '朝阳镇', 4, 2299), +(17826, '朱集乡', 4, 2299), +(17827, '杨疃镇', 4, 2299), +(17828, '浍沟镇', 4, 2299), +(17829, '渔沟镇', 4, 2299), +(17830, '灵城镇', 4, 2299), +(17831, '禅堂乡', 4, 2299), +(17832, '虞姬乡', 4, 2299), +(17833, '韦集镇', 4, 2299), +(17834, '高楼镇', 4, 2299), +(17835, '黄湾镇', 4, 2299), +(17836, '关帝庙镇', 4, 2300), +(17837, '刘暗楼乡', 4, 2300), +(17838, '周寨镇', 4, 2300), +(17839, '唐寨镇', 4, 2300), +(17840, '官庄坝镇', 4, 2300), +(17841, '文庄镇', 4, 2300), +(17842, '曹庄镇', 4, 2300), +(17843, '朱楼镇', 4, 2300), +(17844, '权集乡', 4, 2300), +(17845, '李庄镇', 4, 2300), +(17846, '玄庙镇', 4, 2300), +(17847, '砀城镇', 4, 2300), +(17848, '程庄镇', 4, 2300), +(17849, '良梨镇', 4, 2300), +(17850, '葛集镇', 4, 2300), +(17851, '西南门镇', 4, 2300), +(17852, '赵屯乡', 4, 2300), +(17853, '黄楼乡', 4, 2300), +(17854, '丁里镇', 4, 2301), +(17855, '刘套镇', 4, 2301), +(17856, '圣泉乡', 4, 2301), +(17857, '大屯镇', 4, 2301), +(17858, '官桥镇', 4, 2301), +(17859, '庄里乡', 4, 2301), +(17860, '张庄寨镇', 4, 2301), +(17861, '新庄镇', 4, 2301), +(17862, '杜楼镇', 4, 2301), +(17863, '杨楼镇', 4, 2301), +(17864, '永堌镇', 4, 2301), +(17865, '王寨镇', 4, 2301), +(17866, '白土镇', 4, 2301), +(17867, '祖楼镇', 4, 2301), +(17868, '赵庄镇', 4, 2301); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17869, '阎集镇', 4, 2301), +(17870, '青龙集镇', 4, 2301), +(17871, '马井镇', 4, 2301), +(17872, '黄口镇', 4, 2301), +(17873, '龙城镇', 4, 2301), +(17874, '仙踪镇', 4, 2302), +(17875, '昭关镇', 4, 2302), +(17876, '林头镇', 4, 2302), +(17877, '清溪镇', 4, 2302), +(17878, '环峰镇', 4, 2302), +(17879, '运漕镇', 4, 2302), +(17880, '铜闸镇', 4, 2302), +(17881, '陶厂镇', 4, 2302), +(17882, '乌江镇', 4, 2303), +(17883, '功桥镇', 4, 2303), +(17884, '历阳镇', 4, 2303), +(17885, '善厚镇', 4, 2303), +(17886, '姥桥镇', 4, 2303), +(17887, '沈巷镇', 4, 2303), +(17888, '白桥镇', 4, 2303), +(17889, '石杨镇', 4, 2303), +(17890, '西埠镇', 4, 2303), +(17891, '香泉镇', 4, 2303), +(17892, '中垾镇', 4, 2304), +(17893, '中庙街道', 4, 2304), +(17894, '亚父街道', 4, 2304), +(17895, '凤凰山街道', 4, 2304), +(17896, '半汤街道', 4, 2304), +(17897, '卧牛山街道', 4, 2304), +(17898, '坝镇镇', 4, 2304), +(17899, '夏阁镇', 4, 2304), +(17900, '天河街道', 4, 2304), +(17901, '庙岗乡', 4, 2304), +(17902, '散兵镇', 4, 2304), +(17903, '柘皋镇', 4, 2304), +(17904, '栏杆集镇', 4, 2304), +(17905, '槐林镇', 4, 2304), +(17906, '炯炀镇', 4, 2304), +(17907, '苏湾镇', 4, 2304), +(17908, '银屏镇', 4, 2304), +(17909, '黄麓镇', 4, 2304), +(17910, '万山镇', 4, 2305), +(17911, '乐桥镇', 4, 2305), +(17912, '冶父山镇', 4, 2305), +(17913, '同大镇', 4, 2305), +(17914, '庐城镇', 4, 2305), +(17915, '柯坦镇', 4, 2305), +(17916, '汤池镇', 4, 2305), +(17917, '泥河镇', 4, 2305), +(17918, '白山镇', 4, 2305), +(17919, '白湖镇', 4, 2305), +(17920, '盛桥镇', 4, 2305), +(17921, '石头镇', 4, 2305), +(17922, '矾山镇', 4, 2305), +(17923, '罗河镇', 4, 2305), +(17924, '郭河镇', 4, 2305), +(17925, '金牛镇', 4, 2305), +(17926, '龙桥镇', 4, 2305), +(17927, '严桥镇', 4, 2306), +(17928, '二坝镇', 4, 2306), +(17929, '刘渡镇', 4, 2306), +(17930, '十里墩乡', 4, 2306), +(17931, '姚沟镇', 4, 2306), +(17932, '开城镇', 4, 2306), +(17933, '无城镇', 4, 2306); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17934, '昆山乡', 4, 2306), +(17935, '汤沟镇', 4, 2306), +(17936, '泉塘镇', 4, 2306), +(17937, '泥汊镇', 4, 2306), +(17938, '洪巷乡', 4, 2306), +(17939, '牛埠镇', 4, 2306), +(17940, '白茆镇', 4, 2306), +(17941, '石涧镇', 4, 2306), +(17942, '福渡镇', 4, 2306), +(17943, '红庙镇', 4, 2306), +(17944, '蜀山镇', 4, 2306), +(17945, '襄安镇', 4, 2306), +(17946, '赫店镇', 4, 2306), +(17947, '陡沟镇', 4, 2306), +(17948, '高沟镇', 4, 2306), +(17949, '鹤毛乡', 4, 2306), +(17950, '三觉镇', 4, 2307), +(17951, '丰庄镇', 4, 2307), +(17952, '众兴镇', 4, 2307), +(17953, '保义农场', 4, 2307), +(17954, '保义镇', 4, 2307), +(17955, '八公山乡', 4, 2307), +(17956, '刘岗镇', 4, 2307), +(17957, '双庙集镇', 4, 2307), +(17958, '双桥镇', 4, 2307), +(17959, '堰口镇', 4, 2307), +(17960, '大顺镇', 4, 2307), +(17961, '安丰塘镇', 4, 2307), +(17962, '安丰镇', 4, 2307), +(17963, '寿春镇', 4, 2307), +(17964, '寿西湖农场', 4, 2307), +(17965, '小甸镇', 4, 2307), +(17966, '张李乡', 4, 2307), +(17967, '板桥镇', 4, 2307), +(17968, '正阳关农场', 4, 2307), +(17969, '正阳关镇', 4, 2307), +(17970, '涧沟镇', 4, 2307), +(17971, '炎刘镇', 4, 2307), +(17972, '瓦埠镇', 4, 2307), +(17973, '窑口乡', 4, 2307), +(17974, '茶庵镇', 4, 2307), +(17975, '迎河镇', 4, 2307), +(17976, '陶店回族乡', 4, 2307), +(17977, '隐贤镇', 4, 2307), +(17978, '万佛湖镇', 4, 2308), +(17979, '五显镇', 4, 2308), +(17980, '千人桥镇', 4, 2308), +(17981, '南港镇', 4, 2308), +(17982, '县经济技术开发区', 4, 2308), +(17983, '城关镇', 4, 2308), +(17984, '山七镇', 4, 2308), +(17985, '干汊河镇', 4, 2308), +(17986, '庐镇乡', 4, 2308), +(17987, '张母桥镇', 4, 2308), +(17988, '春秋乡', 4, 2308), +(17989, '晓天镇', 4, 2308), +(17990, '杭埠镇', 4, 2308), +(17991, '柏林乡', 4, 2308), +(17992, '桃溪镇', 4, 2308), +(17993, '棠树乡', 4, 2308), +(17994, '汤池镇', 4, 2308), +(17995, '河棚镇', 4, 2308), +(17996, '百神庙镇', 4, 2308), +(17997, '舒茶镇', 4, 2308); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(17998, '阙店乡', 4, 2308), +(17999, '高峰乡', 4, 2308), +(18000, '丁集镇', 4, 2309), +(18001, '分路口镇', 4, 2309), +(18002, '北市街道', 4, 2309), +(18003, '单王乡', 4, 2309), +(18004, '南市街道', 4, 2309), +(18005, '固镇镇', 4, 2309), +(18006, '城南镇', 4, 2309), +(18007, '小华山街道', 4, 2309), +(18008, '平桥乡', 4, 2309), +(18009, '徐集镇', 4, 2309), +(18010, '新安镇', 4, 2309), +(18011, '江家店镇', 4, 2309), +(18012, '独山镇', 4, 2309), +(18013, '狮子岗乡', 4, 2309), +(18014, '石婆店镇', 4, 2309), +(18015, '石板冲乡', 4, 2309), +(18016, '罗集乡', 4, 2309), +(18017, '苏埠镇', 4, 2309), +(18018, '西市街道', 4, 2309), +(18019, '西河口乡', 4, 2309), +(18020, '青山乡', 4, 2309), +(18021, '韩摆渡镇', 4, 2309), +(18022, '顺河镇', 4, 2309), +(18023, '鼓楼街道', 4, 2309), +(18024, '三十铺镇', 4, 2310), +(18025, '三里桥街道', 4, 2310), +(18026, '东市街道', 4, 2310), +(18027, '东桥镇', 4, 2310), +(18028, '东河口镇', 4, 2310), +(18029, '中市街道', 4, 2310), +(18030, '中店乡', 4, 2310), +(18031, '先生店乡', 4, 2310), +(18032, '双河镇', 4, 2310), +(18033, '城北乡', 4, 2310), +(18034, '孙岗镇', 4, 2310), +(18035, '张店镇', 4, 2310), +(18036, '施桥镇', 4, 2310), +(18037, '望城街道', 4, 2310), +(18038, '木厂镇', 4, 2310), +(18039, '椿树镇', 4, 2310), +(18040, '横塘岗乡', 4, 2310), +(18041, '毛坦厂镇', 4, 2310), +(18042, '淠东乡', 4, 2310), +(18043, '清水河街道', 4, 2310), +(18044, '翁墩乡', 4, 2310), +(18045, '马头镇', 4, 2310), +(18046, '全军乡', 4, 2311), +(18047, '关庙乡', 4, 2311), +(18048, '南溪镇', 4, 2311), +(18049, '双河镇', 4, 2311), +(18050, '古碑镇', 4, 2311), +(18051, '吴家店镇', 4, 2311), +(18052, '响洪甸镇', 4, 2311), +(18053, '天堂寨镇', 4, 2311), +(18054, '张冲乡', 4, 2311), +(18055, '张畈乡', 4, 2311), +(18056, '斑竹园镇', 4, 2311), +(18057, '果子园乡', 4, 2311), +(18058, '桃岭乡', 4, 2311), +(18059, '梅山镇', 4, 2311), +(18060, '槐树湾乡', 4, 2311); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18061, '水竹萍乡', 4, 2311), +(18062, '汤家汇镇', 4, 2311), +(18063, '沙河乡', 4, 2311), +(18064, '油坊店乡', 4, 2311), +(18065, '燕子河镇', 4, 2311), +(18066, '白塔畈乡', 4, 2311), +(18067, '花石乡', 4, 2311), +(18068, '铁冲乡', 4, 2311), +(18069, '银山畈乡', 4, 2311), +(18070, '长岭乡', 4, 2311), +(18071, '青山镇', 4, 2311), +(18072, '上士市镇', 4, 2312), +(18073, '下符桥镇', 4, 2312), +(18074, '与儿街镇', 4, 2312), +(18075, '东西溪乡', 4, 2312), +(18076, '但家庙镇', 4, 2312), +(18077, '佛子岭镇', 4, 2312), +(18078, '单龙寺乡', 4, 2312), +(18079, '大化坪镇', 4, 2312), +(18080, '太平畈乡', 4, 2312), +(18081, '太阳乡', 4, 2312), +(18082, '漫水河镇', 4, 2312), +(18083, '磨子潭镇', 4, 2312), +(18084, '落儿岭镇', 4, 2312), +(18085, '衡山镇', 4, 2312), +(18086, '诸佛庵镇', 4, 2312), +(18087, '黑石渡镇', 4, 2312), +(18088, '三流乡', 4, 2313), +(18089, '临水镇', 4, 2313), +(18090, '临淮岗乡', 4, 2313), +(18091, '乌龙镇', 4, 2313), +(18092, '众兴集镇', 4, 2313), +(18093, '冯井镇', 4, 2313), +(18094, '冯瓴乡', 4, 2313), +(18095, '城关镇', 4, 2313), +(18096, '城西湖乡', 4, 2313), +(18097, '夏店镇', 4, 2313), +(18098, '姚李镇', 4, 2313), +(18099, '孟集镇', 4, 2313), +(18100, '宋店乡', 4, 2313), +(18101, '岔路镇', 4, 2313), +(18102, '彭塔乡', 4, 2313), +(18103, '扈胡镇', 4, 2313), +(18104, '新店镇', 4, 2313), +(18105, '曹庙镇', 4, 2313), +(18106, '河口镇', 4, 2313), +(18107, '洪集镇', 4, 2313), +(18108, '潘集乡', 4, 2313), +(18109, '王截流乡', 4, 2313), +(18110, '白莲乡', 4, 2313), +(18111, '石店镇', 4, 2313), +(18112, '花园镇', 4, 2313), +(18113, '范桥乡', 4, 2313), +(18114, '邵岗乡', 4, 2313), +(18115, '长集镇', 4, 2313), +(18116, '马店镇', 4, 2313), +(18117, '高塘镇', 4, 2313), +(18118, '龙潭镇', 4, 2313), +(18119, '中疃镇', 4, 2314), +(18120, '丹风乡', 4, 2314), +(18121, '刘家集乡', 4, 2314), +(18122, '双桥乡', 4, 2314), +(18123, '城关镇', 4, 2314); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18124, '大李集镇', 4, 2314), +(18125, '孙庙乡', 4, 2314), +(18126, '孙集镇', 4, 2314), +(18127, '展沟镇', 4, 2314), +(18128, '巩店镇', 4, 2314), +(18129, '张村镇', 4, 2314), +(18130, '新张集乡', 4, 2314), +(18131, '旧城镇', 4, 2314), +(18132, '春店乡', 4, 2314), +(18133, '望疃镇', 4, 2314), +(18134, '永兴镇', 4, 2314), +(18135, '汝集镇', 4, 2314), +(18136, '江集镇', 4, 2314), +(18137, '王人镇', 4, 2314), +(18138, '王市镇', 4, 2314), +(18139, '程家集镇', 4, 2314), +(18140, '纪王场乡', 4, 2314), +(18141, '胡集镇', 4, 2314), +(18142, '西潘楼镇', 4, 2314), +(18143, '阚疃镇', 4, 2314), +(18144, '马店孜镇', 4, 2314), +(18145, '临湖镇', 4, 2315), +(18146, '丹城镇', 4, 2315), +(18147, '义门镇', 4, 2315), +(18148, '公吉寺镇', 4, 2315), +(18149, '单集林场', 4, 2315), +(18150, '双庙镇', 4, 2315), +(18151, '城东镇', 4, 2315), +(18152, '城关镇', 4, 2315), +(18153, '城西镇', 4, 2315), +(18154, '店集镇', 4, 2315), +(18155, '张老家乡', 4, 2315), +(18156, '新兴镇', 4, 2315), +(18157, '曹市镇', 4, 2315), +(18158, '标里镇', 4, 2315), +(18159, '楚店镇', 4, 2315), +(18160, '牌坊镇', 4, 2315), +(18161, '石弓镇', 4, 2315), +(18162, '耿皇乡', 4, 2315), +(18163, '花沟镇', 4, 2315), +(18164, '西阳镇', 4, 2315), +(18165, '闸北镇', 4, 2315), +(18166, '陈大镇', 4, 2315), +(18167, '青疃镇', 4, 2315), +(18168, '马店集镇', 4, 2315), +(18169, '高公镇', 4, 2315), +(18170, '高炉镇', 4, 2315), +(18171, '龙山镇', 4, 2315), +(18172, '三义镇', 4, 2316), +(18173, '乐土镇', 4, 2316), +(18174, '双涧镇', 4, 2316), +(18175, '吕望乡', 4, 2316), +(18176, '坛城镇', 4, 2316), +(18177, '城关镇', 4, 2316), +(18178, '小涧镇', 4, 2316), +(18179, '小辛集乡', 4, 2316), +(18180, '岳坊镇', 4, 2316), +(18181, '常兴镇', 4, 2316), +(18182, '板桥集镇', 4, 2316), +(18183, '柳林镇', 4, 2316), +(18184, '楚村镇', 4, 2316), +(18185, '漆园镇', 4, 2316), +(18186, '王集乡', 4, 2316), +(18187, '田桥镇', 4, 2316), +(18188, '移村乡', 4, 2316); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18189, '立仓镇', 4, 2316), +(18190, '篱笆乡', 4, 2316), +(18191, '罗集乡', 4, 2316), +(18192, '范集镇', 4, 2316), +(18193, '许疃镇', 4, 2316), +(18194, '马集镇', 4, 2316), +(18195, '五马镇', 4, 2317), +(18196, '十九里镇', 4, 2317), +(18197, '十八里镇', 4, 2317), +(18198, '十河镇', 4, 2317), +(18199, '华佗镇', 4, 2317), +(18200, '双沟镇', 4, 2317), +(18201, '古井镇', 4, 2317), +(18202, '古城镇', 4, 2317), +(18203, '城父镇', 4, 2317), +(18204, '大杨镇', 4, 2317), +(18205, '张店乡', 4, 2317), +(18206, '汤陵街道', 4, 2317), +(18207, '沙土镇', 4, 2317), +(18208, '淝河镇', 4, 2317), +(18209, '牛集镇', 4, 2317), +(18210, '立德镇', 4, 2317), +(18211, '芦庙镇', 4, 2317), +(18212, '花戏楼街道', 4, 2317), +(18213, '薛阁街道', 4, 2317), +(18214, '观堂镇', 4, 2317), +(18215, '谯东镇', 4, 2317), +(18216, '赵桥乡', 4, 2317), +(18217, '颜集镇', 4, 2317), +(18218, '魏岗镇', 4, 2317), +(18219, '龙扬镇', 4, 2317), +(18220, '东流镇', 4, 2318), +(18221, '大渡口镇', 4, 2318), +(18222, '官港镇', 4, 2318), +(18223, '尧渡镇', 4, 2318), +(18224, '张溪镇', 4, 2318), +(18225, '昭潭镇', 4, 2318), +(18226, '木塔乡', 4, 2318), +(18227, '泥溪镇', 4, 2318), +(18228, '洋湖镇', 4, 2318), +(18229, '胜利镇', 4, 2318), +(18230, '花园里乡', 4, 2318), +(18231, '葛公镇', 4, 2318), +(18232, '青山乡', 4, 2318), +(18233, '香隅镇', 4, 2318), +(18234, '龙泉镇', 4, 2318), +(18235, '丁香镇', 4, 2319), +(18236, '七都镇', 4, 2319), +(18237, '仁里镇', 4, 2319), +(18238, '仙寓镇', 4, 2319), +(18239, '大演乡', 4, 2319), +(18240, '小河镇', 4, 2319), +(18241, '横渡镇', 4, 2319), +(18242, '矶滩乡', 4, 2319), +(18243, '乌沙镇', 4, 2320), +(18244, '唐田镇', 4, 2320), +(18245, '墩上街道', 4, 2320), +(18246, '梅村镇', 4, 2320), +(18247, '梅街镇', 4, 2320), +(18248, '梅龙街道', 4, 2320), +(18249, '棠溪镇', 4, 2320), +(18250, '殷汇镇', 4, 2320), +(18251, '江口街道', 4, 2320), +(18252, '池阳街道', 4, 2320), +(18253, '涓桥镇', 4, 2320); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18254, '牌楼镇', 4, 2320), +(18255, '牛头山镇', 4, 2320), +(18256, '秋江街道', 4, 2320), +(18257, '秋浦街道', 4, 2320), +(18258, '里山街道', 4, 2320), +(18259, '马衙街道', 4, 2320), +(18260, '丁桥镇', 4, 2321), +(18261, '乔木乡', 4, 2321), +(18262, '九华乡', 4, 2321), +(18263, '九华镇', 4, 2321), +(18264, '庙前镇', 4, 2321), +(18265, '新河镇', 4, 2321), +(18266, '木镇镇', 4, 2321), +(18267, '朱备镇', 4, 2321), +(18268, '杜村乡', 4, 2321), +(18269, '杨田镇', 4, 2321), +(18270, '蓉城镇', 4, 2321), +(18271, '酉华乡', 4, 2321), +(18272, '陵阳镇', 4, 2321), +(18273, '万家乡', 4, 2322), +(18274, '中溪镇', 4, 2322), +(18275, '云梯畲族乡', 4, 2322), +(18276, '仙霞镇', 4, 2322), +(18277, '南山街道', 4, 2322), +(18278, '南极乡', 4, 2322), +(18279, '天湖镇', 4, 2322), +(18280, '宁墩镇', 4, 2322), +(18281, '方塘乡', 4, 2322), +(18282, '梅林镇', 4, 2322), +(18283, '汪溪镇', 4, 2322), +(18284, '河沥街道', 4, 2322), +(18285, '港口镇', 4, 2322), +(18286, '甲路镇', 4, 2322), +(18287, '竹峰乡', 4, 2322), +(18288, '胡乐镇', 4, 2322), +(18289, '西津街道', 4, 2322), +(18290, '霞西镇', 4, 2322), +(18291, '青龙乡', 4, 2322), +(18292, '五星乡', 4, 2323), +(18293, '养贤乡', 4, 2323), +(18294, '双桥街道', 4, 2323), +(18295, '古泉镇', 4, 2323), +(18296, '向阳镇', 4, 2323), +(18297, '周王镇', 4, 2323), +(18298, '孙埠镇', 4, 2323), +(18299, '寒亭镇', 4, 2323), +(18300, '敬亭山街道', 4, 2323), +(18301, '文昌镇', 4, 2323), +(18302, '新田镇', 4, 2323), +(18303, '朱桥乡', 4, 2323), +(18304, '杨柳镇', 4, 2323), +(18305, '水东镇', 4, 2323), +(18306, '水阳镇', 4, 2323), +(18307, '沈村镇', 4, 2323), +(18308, '洪林镇', 4, 2323), +(18309, '济川街道', 4, 2323), +(18310, '溪口镇', 4, 2323), +(18311, '澄江街道', 4, 2323), +(18312, '狸桥镇', 4, 2323), +(18313, '西林街道', 4, 2323), +(18314, '金坝乡', 4, 2323), +(18315, '飞彩街道', 4, 2323), +(18316, '鳌峰街道', 4, 2323), +(18317, '黄渡乡', 4, 2323); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18318, '东亭乡', 4, 2324), +(18319, '卢村乡', 4, 2324), +(18320, '四合乡', 4, 2324), +(18321, '新杭镇', 4, 2324), +(18322, '杨滩乡', 4, 2324), +(18323, '柏垫镇', 4, 2324), +(18324, '桃州镇', 4, 2324), +(18325, '祠山岗茶场', 4, 2324), +(18326, '誓节镇', 4, 2324), +(18327, '邱村镇', 4, 2324), +(18328, '三溪镇', 4, 2325), +(18329, '云乐乡', 4, 2325), +(18330, '俞村乡', 4, 2325), +(18331, '兴隆乡', 4, 2325), +(18332, '孙村乡', 4, 2325), +(18333, '庙首镇', 4, 2325), +(18334, '旌阳镇', 4, 2325), +(18335, '版书乡', 4, 2325), +(18336, '白地镇', 4, 2325), +(18337, '蔡家桥镇', 4, 2325), +(18338, '丁家桥镇', 4, 2326), +(18339, '云岭镇', 4, 2326), +(18340, '昌桥乡', 4, 2326), +(18341, '桃花潭镇', 4, 2326), +(18342, '榔桥镇', 4, 2326), +(18343, '汀溪乡', 4, 2326), +(18344, '泾川镇', 4, 2326), +(18345, '琴溪镇', 4, 2326), +(18346, '茂林镇', 4, 2326), +(18347, '蔡村镇', 4, 2326), +(18348, '黄村镇', 4, 2326), +(18349, '上庄镇', 4, 2327), +(18350, '临溪镇', 4, 2327), +(18351, '伏岭镇', 4, 2327), +(18352, '华阳镇', 4, 2327), +(18353, '家朋乡', 4, 2327), +(18354, '扬溪镇', 4, 2327), +(18355, '板桥头乡', 4, 2327), +(18356, '瀛洲乡', 4, 2327), +(18357, '荆州乡', 4, 2327), +(18358, '金沙镇', 4, 2327), +(18359, '长安镇', 4, 2327), +(18360, '东夏镇', 4, 2328), +(18361, '凌笪乡', 4, 2328), +(18362, '十字镇', 4, 2328), +(18363, '南丰镇', 4, 2328), +(18364, '姚村乡', 4, 2328), +(18365, '幸福乡', 4, 2328), +(18366, '建平镇', 4, 2328), +(18367, '新发镇', 4, 2328), +(18368, '梅渚镇', 4, 2328), +(18369, '毕桥镇', 4, 2328), +(18370, '涛城镇', 4, 2328), +(18371, '飞里乡', 4, 2328), +(18372, '红星农场', 4, 2329), +(18373, '三叉街街道', 4, 2329), +(18374, '上渡街道', 4, 2329), +(18375, '下渡街道', 4, 2329), +(18376, '东升街道', 4, 2329), +(18377, '临江街道', 4, 2329), +(18378, '仓山镇', 4, 2329), +(18379, '城门镇', 4, 2329), +(18380, '对湖街道', 4, 2329), +(18381, '建新镇', 4, 2329); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18382, '盖山镇', 4, 2329), +(18383, '螺洲镇', 4, 2329), +(18384, '金山街道', 4, 2329), +(18385, '上海街道', 4, 2330), +(18386, '义洲街道', 4, 2330), +(18387, '后洲街道', 4, 2330), +(18388, '宁化街道', 4, 2330), +(18389, '新港街道', 4, 2330), +(18390, '洋中街道', 4, 2330), +(18391, '苍霞街道', 4, 2330), +(18392, '茶亭街道', 4, 2330), +(18393, '鳌峰街道', 4, 2330), +(18394, '东庠乡', 4, 2331), +(18395, '中楼乡', 4, 2331), +(18396, '北厝镇', 4, 2331), +(18397, '南海乡', 4, 2331), +(18398, '大练乡', 4, 2331), +(18399, '屿头乡', 4, 2331), +(18400, '岚城乡', 4, 2331), +(18401, '平原镇', 4, 2331), +(18402, '敖东镇', 4, 2331), +(18403, '流水镇', 4, 2331), +(18404, '潭城镇', 4, 2331), +(18405, '澳前镇', 4, 2331), +(18406, '白青乡', 4, 2331), +(18407, '芦洋乡', 4, 2331), +(18408, '苏澳镇', 4, 2331), +(18409, '宦溪镇', 4, 2332), +(18410, '寿山乡', 4, 2332), +(18411, '岳峰镇', 4, 2332), +(18412, '新店镇', 4, 2332), +(18413, '日溪乡', 4, 2332), +(18414, '王庄街道', 4, 2332), +(18415, '象园街道', 4, 2332), +(18416, '鼓山镇', 4, 2332), +(18417, '东洋乡', 4, 2333), +(18418, '丹云乡', 4, 2333), +(18419, '同安镇', 4, 2333), +(18420, '城峰镇', 4, 2333), +(18421, '塘前乡', 4, 2333), +(18422, '大洋镇', 4, 2333), +(18423, '富泉乡', 4, 2333), +(18424, '岭路乡', 4, 2333), +(18425, '嵩口镇', 4, 2333), +(18426, '梧桐镇', 4, 2333), +(18427, '樟城镇', 4, 2333), +(18428, '洑口乡', 4, 2333), +(18429, '清凉镇', 4, 2333), +(18430, '白云乡', 4, 2333), +(18431, '盖洋乡', 4, 2333), +(18432, '盘谷乡', 4, 2333), +(18433, '红星乡', 4, 2333), +(18434, '葛岭镇', 4, 2333), +(18435, '赤锡乡', 4, 2333), +(18436, '长庆镇', 4, 2333), +(18437, '霞拔乡', 4, 2333), +(18438, '东阁华侨农场', 4, 2334), +(18439, '江镜华侨农场', 4, 2334), +(18440, '一都镇', 4, 2334), +(18441, '三山镇', 4, 2334), +(18442, '上迳镇', 4, 2334), +(18443, '东张镇', 4, 2334), +(18444, '东瀚镇', 4, 2334), +(18445, '元代:', 4, 2334); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18446, '南岭镇', 4, 2334), +(18447, '唐代:', 4, 2334), +(18448, '城头镇', 4, 2334), +(18449, '新厝镇', 4, 2334), +(18450, '江镜镇', 4, 2334), +(18451, '江阴镇', 4, 2334), +(18452, '沙埔镇', 4, 2334), +(18453, '海口镇', 4, 2334), +(18454, '清代:', 4, 2334), +(18455, '渔溪镇', 4, 2334), +(18456, '港头镇', 4, 2334), +(18457, '镜洋镇', 4, 2334), +(18458, '高山镇', 4, 2334), +(18459, '龙田镇', 4, 2334), +(18460, '罗源湾开发区', 4, 2335), +(18461, '中房镇', 4, 2335), +(18462, '松山镇', 4, 2335), +(18463, '洪洋乡', 4, 2335), +(18464, '白塔乡', 4, 2335), +(18465, '碧里乡', 4, 2335), +(18466, '西兰乡', 4, 2335), +(18467, '起步镇', 4, 2335), +(18468, '鉴江镇', 4, 2335), +(18469, '霍口畲族乡', 4, 2335), +(18470, '飞竹镇', 4, 2335), +(18471, '下宫乡', 4, 2336), +(18472, '东岱镇', 4, 2336), +(18473, '东湖镇', 4, 2336), +(18474, '丹阳镇', 4, 2336), +(18475, '坑园镇', 4, 2336), +(18476, '安凯乡', 4, 2336), +(18477, '官坂镇', 4, 2336), +(18478, '小沧畲族乡', 4, 2336), +(18479, '敖江镇', 4, 2336), +(18480, '晓澳镇', 4, 2336), +(18481, '江南乡', 4, 2336), +(18482, '浦口镇', 4, 2336), +(18483, '潘渡乡', 4, 2336), +(18484, '琯头镇', 4, 2336), +(18485, '筱埕镇', 4, 2336), +(18486, '苔菉镇', 4, 2336), +(18487, '蓼沿乡', 4, 2336), +(18488, '透堡镇', 4, 2336), +(18489, '长龙镇', 4, 2336), +(18490, '马祖乡', 4, 2336), +(18491, '马鼻镇', 4, 2336), +(18492, '黄岐镇', 4, 2336), +(18493, '古槐镇', 4, 2337), +(18494, '文岭镇', 4, 2337), +(18495, '文武砂镇', 4, 2337), +(18496, '松下镇', 4, 2337), +(18497, '梅花镇', 4, 2337), +(18498, '江田镇', 4, 2337), +(18499, '湖南镇', 4, 2337), +(18500, '漳港街道', 4, 2337), +(18501, '漳港镇', 4, 2337), +(18502, '潭头镇', 4, 2337), +(18503, '猴屿乡', 4, 2337), +(18504, '玉田镇', 4, 2337), +(18505, '罗联乡', 4, 2337), +(18506, '航城街道', 4, 2337), +(18507, '营前街道', 4, 2337), +(18508, '营前镇', 4, 2337), +(18509, '金峰镇', 4, 2337), +(18510, '首占镇', 4, 2337); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18511, '鹤上镇', 4, 2337), +(18512, '江洋农场', 4, 2338), +(18513, '上街镇', 4, 2338), +(18514, '南屿镇', 4, 2338), +(18515, '南通镇', 4, 2338), +(18516, '大湖乡', 4, 2338), +(18517, '小箬乡', 4, 2338), +(18518, '尚干镇', 4, 2338), +(18519, '廷坪乡', 4, 2338), +(18520, '洋里乡', 4, 2338), +(18521, '白沙镇', 4, 2338), +(18522, '祥谦镇', 4, 2338), +(18523, '竹岐乡', 4, 2338), +(18524, '荆溪镇', 4, 2338), +(18525, '青口镇', 4, 2338), +(18526, '鸿尾乡', 4, 2338), +(18527, '三溪乡', 4, 2339), +(18528, '上莲乡', 4, 2339), +(18529, '下祝乡', 4, 2339), +(18530, '东桥镇', 4, 2339), +(18531, '云龙乡', 4, 2339), +(18532, '坂东镇', 4, 2339), +(18533, '塔庄镇', 4, 2339), +(18534, '桔林乡', 4, 2339), +(18535, '梅溪镇', 4, 2339), +(18536, '池园镇', 4, 2339), +(18537, '白中镇', 4, 2339), +(18538, '白樟镇', 4, 2339), +(18539, '省璜镇', 4, 2339), +(18540, '金沙镇', 4, 2339), +(18541, '雄江镇', 4, 2339), +(18542, '亭江镇', 4, 2340), +(18543, '琅岐镇', 4, 2340), +(18544, '马尾镇', 4, 2340), +(18545, '东街街道', 4, 2341), +(18546, '五凤街道', 4, 2341), +(18547, '华大街道', 4, 2341), +(18548, '南街街道', 4, 2341), +(18549, '安泰街道', 4, 2341), +(18550, '水部街道', 4, 2341), +(18551, '洪山镇', 4, 2341), +(18552, '温泉街道', 4, 2341), +(18553, '鼓西街道', 4, 2341), +(18554, '五显镇', 4, 2342), +(18555, '凤南农场', 4, 2342), +(18556, '北山农场', 4, 2342), +(18557, '大同街道', 4, 2342), +(18558, '新民镇', 4, 2342), +(18559, '汀溪水库', 4, 2342), +(18560, '汀溪镇', 4, 2342), +(18561, '汀溪防护林场', 4, 2342), +(18562, '洪塘镇', 4, 2342), +(18563, '白沙仑农场', 4, 2342), +(18564, '祥平街道', 4, 2342), +(18565, '祥溪林场', 4, 2342), +(18566, '竹坝华侨农场', 4, 2342), +(18567, '莲花镇', 4, 2342), +(18568, '西柯镇', 4, 2342), +(18569, '万石植物园', 4, 2343), +(18570, '中华街道', 4, 2343), +(18571, '云顶岩', 4, 2343), +(18572, '农科所', 4, 2343), +(18573, '嘉莲街道', 4, 2343); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18574, '开元街道', 4, 2343), +(18575, '梧村街道', 4, 2343), +(18576, '滨海街道', 4, 2343), +(18577, '筼筜街道', 4, 2343), +(18578, '莲前街道', 4, 2343), +(18579, '鹭江街道', 4, 2343), +(18580, '鼓浪屿街道', 4, 2343), +(18581, '东孚镇', 4, 2344), +(18582, '天竺山林场', 4, 2344), +(18583, '杏林马銮湾', 4, 2344), +(18584, '海沧农场', 4, 2344), +(18585, '海沧镇', 4, 2344), +(18586, '第一农场', 4, 2344), +(18587, '前哨盐场', 4, 2345), +(18588, '忠仑苗圃', 4, 2345), +(18589, '殿前街道', 4, 2345), +(18590, '江头街道', 4, 2345), +(18591, '湖边水库', 4, 2345), +(18592, '禾山街道', 4, 2345), +(18593, '金山街道', 4, 2345), +(18594, '高崎国际机场', 4, 2345), +(18595, '内厝镇', 4, 2346), +(18596, '大嶝镇', 4, 2346), +(18597, '大帽山农场', 4, 2346), +(18598, '新圩镇', 4, 2346), +(18599, '新店镇', 4, 2346), +(18600, '马巷镇', 4, 2346), +(18601, '侨英街道', 4, 2347), +(18602, '后溪镇', 4, 2347), +(18603, '坂头防护林场', 4, 2347), +(18604, '天马华侨农场', 4, 2347), +(18605, '杏林街道', 4, 2347), +(18606, '杏滨街道', 4, 2347), +(18607, '灌口镇', 4, 2347), +(18608, '省天马种猪场', 4, 2347), +(18609, '第二农场', 4, 2347), +(18610, '集美部队农场', 4, 2347), +(18611, '书峰乡', 4, 2348), +(18612, '园庄镇', 4, 2348), +(18613, '大济镇', 4, 2348), +(18614, '度尾镇', 4, 2348), +(18615, '枫亭镇', 4, 2348), +(18616, '榜头镇', 4, 2348), +(18617, '游洋镇', 4, 2348), +(18618, '盖尾镇', 4, 2348), +(18619, '石苍乡', 4, 2348), +(18620, '社硎乡', 4, 2348), +(18621, '西苑乡', 4, 2348), +(18622, '象溪乡', 4, 2348), +(18623, '赖店镇', 4, 2348), +(18624, '郊尾镇', 4, 2348), +(18625, '钟山镇', 4, 2348), +(18626, '鲤南镇', 4, 2348), +(18627, '龙华镇', 4, 2348), +(18628, '东海镇', 4, 2349), +(18629, '凤凰山街道', 4, 2349), +(18630, '华亭镇', 4, 2349), +(18631, '常太镇', 4, 2349), +(18632, '灵川镇', 4, 2349), +(18633, '霞林街道', 4, 2349), +(18634, '三江口镇', 4, 2350); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18635, '国欢镇', 4, 2350), +(18636, '大洋乡', 4, 2350), +(18637, '庄边镇', 4, 2350), +(18638, '新县镇', 4, 2350), +(18639, '梧塘镇', 4, 2350), +(18640, '江口镇', 4, 2350), +(18641, '涵西街道', 4, 2350), +(18642, '白塘镇', 4, 2350), +(18643, '白沙镇', 4, 2350), +(18644, '萩芦镇', 4, 2350), +(18645, '赤港华侨经济开发区', 4, 2350), +(18646, '东埔镇', 4, 2351), +(18647, '东峤镇', 4, 2351), +(18648, '东庄镇', 4, 2351), +(18649, '南日镇', 4, 2351), +(18650, '埭头镇', 4, 2351), +(18651, '山亭乡', 4, 2351), +(18652, '平海镇', 4, 2351), +(18653, '忠门镇', 4, 2351), +(18654, '月塘乡', 4, 2351), +(18655, '湄洲镇', 4, 2351), +(18656, '笏石镇', 4, 2351), +(18657, '北高镇', 4, 2352), +(18658, '拱辰街道', 4, 2352), +(18659, '新度镇', 4, 2352), +(18660, '西天尾镇', 4, 2352), +(18661, '黄石镇', 4, 2352), +(18662, '中村乡', 4, 2353), +(18663, '城东乡', 4, 2353), +(18664, '富兴堡街道', 4, 2353), +(18665, '岩前镇', 4, 2353), +(18666, '白沙街道', 4, 2353), +(18667, '荆西街道', 4, 2353), +(18668, '莘口镇', 4, 2353), +(18669, '上京镇', 4, 2354), +(18670, '前坪乡', 4, 2354), +(18671, '华兴乡', 4, 2354), +(18672, '吴山乡', 4, 2354), +(18673, '太华镇', 4, 2354), +(18674, '奇韬镇', 4, 2354), +(18675, '屏山乡', 4, 2354), +(18676, '广平镇', 4, 2354), +(18677, '建设镇', 4, 2354), +(18678, '文江乡', 4, 2354), +(18679, '桃源镇', 4, 2354), +(18680, '梅山乡', 4, 2354), +(18681, '武陵乡', 4, 2354), +(18682, '济阳乡', 4, 2354), +(18683, '湖美乡', 4, 2354), +(18684, '石牌镇', 4, 2354), +(18685, '谢洋乡', 4, 2354), +(18686, '中沙乡', 4, 2355), +(18687, '城南乡', 4, 2355), +(18688, '城郊乡', 4, 2355), +(18689, '安乐乡', 4, 2355), +(18690, '安远乡', 4, 2355), +(18691, '方田乡', 4, 2355), +(18692, '曹坊乡', 4, 2355), +(18693, '水茜乡', 4, 2355), +(18694, '河龙乡', 4, 2355), +(18695, '治平乡', 4, 2355), +(18696, '泉上镇', 4, 2355), +(18697, '济村乡', 4, 2355), +(18698, '淮土乡', 4, 2355), +(18699, '湖村镇', 4, 2355); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18700, '石壁镇', 4, 2355), +(18701, '万全乡', 4, 2356), +(18702, '万安镇', 4, 2356), +(18703, '余坊乡', 4, 2356), +(18704, '光明乡', 4, 2356), +(18705, '南口乡', 4, 2356), +(18706, '大源乡', 4, 2356), +(18707, '安仁乡', 4, 2356), +(18708, '水南镇', 4, 2356), +(18709, '漠源乡', 4, 2356), +(18710, '白莲镇', 4, 2356), +(18711, '高唐镇', 4, 2356), +(18712, '黄潭镇', 4, 2356), +(18713, '中仙乡', 4, 2357), +(18714, '八字桥乡', 4, 2357), +(18715, '台溪乡', 4, 2357), +(18716, '坂面乡', 4, 2357), +(18717, '尤溪口镇', 4, 2357), +(18718, '新阳镇', 4, 2357), +(18719, '梅仙镇', 4, 2357), +(18720, '汤川乡', 4, 2357), +(18721, '洋中镇', 4, 2357), +(18722, '溪尾乡', 4, 2357), +(18723, '管前镇', 4, 2357), +(18724, '联合乡', 4, 2357), +(18725, '西城镇', 4, 2357), +(18726, '西滨镇', 4, 2357), +(18727, '伊家乡', 4, 2358), +(18728, '均口镇', 4, 2358), +(18729, '客坊乡', 4, 2358), +(18730, '溪口镇', 4, 2358), +(18731, '溪源乡', 4, 2358), +(18732, '里心镇', 4, 2358), +(18733, '金溪乡', 4, 2358), +(18734, '黄坊乡', 4, 2358), +(18735, '黄埠乡', 4, 2358), +(18736, '城关乡', 4, 2359), +(18737, '夏坊乡', 4, 2359), +(18738, '夏阳乡', 4, 2359), +(18739, '枫溪乡', 4, 2359), +(18740, '沙溪乡', 4, 2359), +(18741, '瀚仙镇', 4, 2359), +(18742, '盖洋镇', 4, 2359), +(18743, '胡坊镇', 4, 2359), +(18744, '列西街道', 4, 2360), +(18745, '北门街道', 4, 2360), +(18746, '徐碧乡', 4, 2360), +(18747, '洋溪乡', 4, 2360), +(18748, '陈大镇', 4, 2360), +(18749, '上坪乡', 4, 2361), +(18750, '大湖镇', 4, 2361), +(18751, '安砂镇', 4, 2361), +(18752, '小陶镇', 4, 2361), +(18753, '曹远镇', 4, 2361), +(18754, '槐南乡', 4, 2361), +(18755, '洪田镇', 4, 2361), +(18756, '燕北街道', 4, 2361), +(18757, '燕南街道', 4, 2361), +(18758, '燕西街道', 4, 2361), +(18759, '罗坊乡', 4, 2361), +(18760, '西洋镇', 4, 2361), +(18761, '贡川镇', 4, 2361), +(18762, '青水畲族乡', 4, 2361), +(18763, '南阳乡', 4, 2362), +(18764, '南霞乡', 4, 2362); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18765, '夏茂镇', 4, 2362), +(18766, '大洛镇', 4, 2362), +(18767, '富口镇', 4, 2362), +(18768, '湖源乡', 4, 2362), +(18769, '虬江街道', 4, 2362), +(18770, '郑湖乡', 4, 2362), +(18771, '青州镇', 4, 2362), +(18772, '高桥镇', 4, 2362), +(18773, '高砂镇', 4, 2362), +(18774, '上青乡', 4, 2363), +(18775, '下渠乡', 4, 2363), +(18776, '大布乡', 4, 2363), +(18777, '大田乡', 4, 2363), +(18778, '开善乡', 4, 2363), +(18779, '新桥乡', 4, 2363), +(18780, '朱口镇', 4, 2363), +(18781, '梅口乡', 4, 2363), +(18782, '龙安乡', 4, 2363), +(18783, '龙湖镇', 4, 2363), +(18784, '东华乡', 4, 2364), +(18785, '余朋乡', 4, 2364), +(18786, '嵩口镇', 4, 2364), +(18787, '嵩溪镇', 4, 2364), +(18788, '李家乡', 4, 2364), +(18789, '林畲乡', 4, 2364), +(18790, '沙芜乡', 4, 2364), +(18791, '温郊乡', 4, 2364), +(18792, '灵地镇', 4, 2364), +(18793, '田源乡', 4, 2364), +(18794, '赖坊乡', 4, 2364), +(18795, '邓家乡', 4, 2364), +(18796, '里田乡', 4, 2364), +(18797, '长校镇', 4, 2364), +(18798, '东海街道', 4, 2365), +(18799, '丰泽街道', 4, 2365), +(18800, '北峰街道', 4, 2365), +(18801, '华大街道', 4, 2365), +(18802, '城东街道', 4, 2365), +(18803, '泉秀街道', 4, 2365), +(18804, '清源街道', 4, 2365), +(18805, '东田镇', 4, 2366), +(18806, '丰州镇', 4, 2366), +(18807, '乐峰镇', 4, 2366), +(18808, '九都镇', 4, 2366), +(18809, '仑苍镇', 4, 2366), +(18810, '向阳乡', 4, 2366), +(18811, '官桥镇', 4, 2366), +(18812, '康美镇', 4, 2366), +(18813, '柳城街道', 4, 2366), +(18814, '梅山镇', 4, 2366), +(18815, '水头镇', 4, 2366), +(18816, '洪梅镇', 4, 2366), +(18817, '洪濑镇', 4, 2366), +(18818, '省新镇', 4, 2366), +(18819, '眉山乡', 4, 2366), +(18820, '石井镇', 4, 2366), +(18821, '码头镇', 4, 2366), +(18822, '罗东镇', 4, 2366), +(18823, '美林街道', 4, 2366), +(18824, '翔云镇', 4, 2366), +(18825, '英都镇', 4, 2366), +(18826, '蓬华镇', 4, 2366), +(18827, '诗山镇', 4, 2366), +(18828, '金淘镇', 4, 2366), +(18829, '霞美镇', 4, 2366); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18830, '剑斗镇', 4, 2367), +(18831, '参内乡', 4, 2367), +(18832, '城厢镇', 4, 2367), +(18833, '大坪乡', 4, 2367), +(18834, '官桥镇', 4, 2367), +(18835, '尚卿乡', 4, 2367), +(18836, '感德镇', 4, 2367), +(18837, '桃舟乡', 4, 2367), +(18838, '湖上乡', 4, 2367), +(18839, '湖头镇', 4, 2367), +(18840, '白濑乡', 4, 2367), +(18841, '祥华乡', 4, 2367), +(18842, '福田乡', 4, 2367), +(18843, '芦田镇', 4, 2367), +(18844, '蓝田乡', 4, 2367), +(18845, '蓬莱镇', 4, 2367), +(18846, '虎邱镇', 4, 2367), +(18847, '西坪镇', 4, 2367), +(18848, '金谷镇', 4, 2367), +(18849, '长坑乡', 4, 2367), +(18850, '魁斗镇', 4, 2367), +(18851, '龙涓乡', 4, 2367), +(18852, '龙门镇', 4, 2367), +(18853, '三班镇', 4, 2368), +(18854, '上涌镇', 4, 2368), +(18855, '南埕镇', 4, 2368), +(18856, '国宝乡', 4, 2368), +(18857, '大铭乡', 4, 2368), +(18858, '春美乡', 4, 2368), +(18859, '杨梅乡', 4, 2368), +(18860, '桂阳乡', 4, 2368), +(18861, '水口镇', 4, 2368), +(18862, '汤头乡', 4, 2368), +(18863, '浔中镇', 4, 2368), +(18864, '盖德乡', 4, 2368), +(18865, '美湖乡', 4, 2368), +(18866, '葛坑镇', 4, 2368), +(18867, '赤水镇', 4, 2368), +(18868, '雷峰镇', 4, 2368), +(18869, '龙浔镇', 4, 2368), +(18870, '龙门滩镇', 4, 2368), +(18871, '东园镇', 4, 2369), +(18872, '东岭镇', 4, 2369), +(18873, '东桥镇', 4, 2369), +(18874, '净峰镇', 4, 2369), +(18875, '小岝镇', 4, 2369), +(18876, '山霞镇', 4, 2369), +(18877, '崇武镇', 4, 2369), +(18878, '张坂镇', 4, 2369), +(18879, '洛阳镇', 4, 2369), +(18880, '涂寨镇', 4, 2369), +(18881, '百崎回族乡', 4, 2369), +(18882, '紫山镇', 4, 2369), +(18883, '螺城镇', 4, 2369), +(18884, '螺阳镇', 4, 2369), +(18885, '辋川镇', 4, 2369), +(18886, '黄塘镇', 4, 2369), +(18887, '东石镇', 4, 2370), +(18888, '五里工业区', 4, 2370), +(18889, '内坑镇', 4, 2370), +(18890, '安平开发区', 4, 2370), +(18891, '安海镇', 4, 2370), +(18892, '新塘街道', 4, 2370), +(18893, '梅岭街道', 4, 2370), +(18894, '永和镇', 4, 2370); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18895, '池店镇', 4, 2370), +(18896, '深沪镇', 4, 2370), +(18897, '灵源街道', 4, 2370), +(18898, '磁灶镇', 4, 2370), +(18899, '紫帽镇', 4, 2370), +(18900, '罗山街道', 4, 2370), +(18901, '英林镇', 4, 2370), +(18902, '西园街道', 4, 2370), +(18903, '西滨镇', 4, 2370), +(18904, '金井镇', 4, 2370), +(18905, '陈埭镇', 4, 2370), +(18906, '龙湖镇', 4, 2370), +(18907, '一都镇', 4, 2371), +(18908, '下洋镇', 4, 2371), +(18909, '东关镇', 4, 2371), +(18910, '东平镇', 4, 2371), +(18911, '五里街镇', 4, 2371), +(18912, '介福乡', 4, 2371), +(18913, '仙夹镇', 4, 2371), +(18914, '吾峰镇', 4, 2371), +(18915, '呈祥乡', 4, 2371), +(18916, '坑仔口镇', 4, 2371), +(18917, '外山乡', 4, 2371), +(18918, '岵山镇', 4, 2371), +(18919, '桂洋镇', 4, 2371), +(18920, '桃城镇', 4, 2371), +(18921, '横口乡', 4, 2371), +(18922, '湖洋镇', 4, 2371), +(18923, '玉斗镇', 4, 2371), +(18924, '石鼓镇', 4, 2371), +(18925, '苏坑镇', 4, 2371), +(18926, '蓬壶镇', 4, 2371), +(18927, '达埔镇', 4, 2371), +(18928, '锦斗镇', 4, 2371), +(18929, '前黄镇', 4, 2372), +(18930, '南埔镇', 4, 2372), +(18931, '后龙镇', 4, 2372), +(18932, '山腰街道', 4, 2372), +(18933, '峰尾镇', 4, 2372), +(18934, '涂岭镇', 4, 2372), +(18935, '界山镇', 4, 2372), +(18936, '双阳镇', 4, 2373), +(18937, '河市镇', 4, 2373), +(18938, '罗溪镇', 4, 2373), +(18939, '虹山乡', 4, 2373), +(18940, '马甲镇', 4, 2373), +(18941, '凤里街道', 4, 2374), +(18942, '宝盖镇', 4, 2374), +(18943, '永宁镇', 4, 2374), +(18944, '灵秀镇', 4, 2374), +(18945, '祥芝镇', 4, 2374), +(18946, '蚶江镇', 4, 2374), +(18947, '锦尚镇', 4, 2374), +(18948, '鸿山镇', 4, 2374), +(18949, '乌丘乡', 4, 2375), +(18950, '烈屿乡', 4, 2375), +(18951, '金城镇', 4, 2375), +(18952, '金宁乡', 4, 2375), +(18953, '金沙镇', 4, 2375), +(18954, '金湖镇', 4, 2375), +(18955, '临江街道', 4, 2376), +(18956, '开元街道', 4, 2376), +(18957, '江南街道', 4, 2376), +(18958, '浮桥街道', 4, 2376); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(18959, '经济技术开发区', 4, 2376), +(18960, '鲤中街道', 4, 2376), +(18961, '前楼镇', 4, 2377), +(18962, '康美镇', 4, 2377), +(18963, '杏陈镇', 4, 2377), +(18964, '樟塘镇', 4, 2377), +(18965, '铜陵(虚拟)镇', 4, 2377), +(18966, '陈城镇', 4, 2377), +(18967, '下河乡', 4, 2378), +(18968, '东厦镇', 4, 2378), +(18969, '列屿镇', 4, 2378), +(18970, '和平乡', 4, 2378), +(18971, '和平农场', 4, 2378), +(18972, '常山华侨经济开发区', 4, 2378), +(18973, '火田镇', 4, 2378), +(18974, '莆美镇', 4, 2378), +(18975, '陈岱镇', 4, 2378), +(18976, '马铺乡', 4, 2378), +(18977, '丰山镇', 4, 2379), +(18978, '仙都镇', 4, 2379), +(18979, '新圩镇', 4, 2379), +(18980, '沙建镇', 4, 2379), +(18981, '湖林乡', 4, 2379), +(18982, '马坑乡', 4, 2379), +(18983, '高安镇', 4, 2379), +(18984, '高车乡', 4, 2379), +(18985, '丰田镇', 4, 2380), +(18986, '书洋镇', 4, 2380), +(18987, '南坑镇', 4, 2380), +(18988, '和溪镇', 4, 2380), +(18989, '奎洋镇', 4, 2380), +(18990, '山城镇', 4, 2380), +(18991, '梅林镇', 4, 2380), +(18992, '船场镇', 4, 2380), +(18993, '金山镇', 4, 2380), +(18994, '靖城镇', 4, 2380), +(18995, '龙山镇', 4, 2380), +(18996, '九峰镇', 4, 2381), +(18997, '五寨乡', 4, 2381), +(18998, '南胜镇', 4, 2381), +(18999, '国强乡', 4, 2381), +(19000, '坂仔镇', 4, 2381), +(19001, '大溪镇', 4, 2381), +(19002, '安厚镇', 4, 2381), +(19003, '小溪镇', 4, 2381), +(19004, '山格镇', 4, 2381), +(19005, '崎岭乡', 4, 2381), +(19006, '文峰镇', 4, 2381), +(19007, '秀峰乡', 4, 2381), +(19008, '芦溪镇', 4, 2381), +(19009, '长乐乡', 4, 2381), +(19010, '霞寨镇', 4, 2381), +(19011, '万安农场', 4, 2382), +(19012, '佛昙镇', 4, 2382), +(19013, '六鳌镇', 4, 2382), +(19014, '前亭镇', 4, 2382), +(19015, '南浦乡', 4, 2382), +(19016, '古雷镇', 4, 2382), +(19017, '大南坂镇', 4, 2382), +(19018, '官浔镇', 4, 2382), +(19019, '旧镇镇', 4, 2382), +(19020, '杜浔镇', 4, 2382), +(19021, '沙西镇', 4, 2382), +(19022, '深土镇', 4, 2382); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19023, '湖西畲族乡', 4, 2382), +(19024, '漳浦盐场', 4, 2382), +(19025, '盘陀镇', 4, 2382), +(19026, '石榴镇', 4, 2382), +(19027, '赤土乡', 4, 2382), +(19028, '赤岭畲族乡', 4, 2382), +(19029, '赤湖镇', 4, 2382), +(19030, '长桥镇', 4, 2382), +(19031, '霞美镇', 4, 2382), +(19032, '马坪镇', 4, 2382), +(19033, '五峰农场', 4, 2383), +(19034, '南坑街道', 4, 2383), +(19035, '后房农场', 4, 2383), +(19036, '大房农场', 4, 2383), +(19037, '天宝林场', 4, 2383), +(19038, '天宝镇', 4, 2383), +(19039, '巷口街道', 4, 2383), +(19040, '新桥街道', 4, 2383), +(19041, '浦南镇', 4, 2383), +(19042, '石亭镇', 4, 2383), +(19043, '芗城区奶牛场', 4, 2383), +(19044, '芝山镇', 4, 2383), +(19045, '西桥街道', 4, 2383), +(19046, '通北街道', 4, 2383), +(19047, '四都镇', 4, 2384), +(19048, '太平镇', 4, 2384), +(19049, '官陂镇', 4, 2384), +(19050, '建设乡', 4, 2384), +(19051, '桥东镇', 4, 2384), +(19052, '梅岭镇', 4, 2384), +(19053, '梅洲乡', 4, 2384), +(19054, '深桥镇', 4, 2384), +(19055, '白洋乡', 4, 2384), +(19056, '秀篆镇', 4, 2384), +(19057, '红星乡', 4, 2384), +(19058, '西潭乡', 4, 2384), +(19059, '边贸旅游区管委会', 4, 2384), +(19060, '金星乡', 4, 2384), +(19061, '闽粤边界开发区管委会', 4, 2384), +(19062, '霞葛镇', 4, 2384), +(19063, '兴泰工业区', 4, 2385), +(19064, '古农农场', 4, 2385), +(19065, '坂里乡', 4, 2385), +(19066, '岩溪镇', 4, 2385), +(19067, '枋洋镇', 4, 2385), +(19068, '陈巷镇', 4, 2385), +(19069, '朝阳镇', 4, 2386), +(19070, '步文镇', 4, 2386), +(19071, '郭坑镇', 4, 2386), +(19072, '龙文工业开发区管委会', 4, 2386), +(19073, '东园开发区', 4, 2387), +(19074, '东园镇', 4, 2387), +(19075, '东泗乡', 4, 2387), +(19076, '九湖镇', 4, 2387), +(19077, '九龙岭林场', 4, 2387), +(19078, '双第华侨农场', 4, 2387), +(19079, '招商局漳州开发区', 4, 2387), +(19080, '林下林场', 4, 2387), +(19081, '榜山镇', 4, 2387), +(19082, '浮宫镇', 4, 2387), +(19083, '海澄镇', 4, 2387); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19084, '港尾镇', 4, 2387), +(19085, '白水镇', 4, 2387), +(19086, '程溪农场', 4, 2387), +(19087, '程溪镇', 4, 2387), +(19088, '紫泥镇', 4, 2387), +(19089, '良种场', 4, 2387), +(19090, '苍坂农场', 4, 2387), +(19091, '角美工业开发区', 4, 2387), +(19092, '角美镇', 4, 2387), +(19093, '隆教畲族乡', 4, 2387), +(19094, '颜厝镇', 4, 2387), +(19095, '龙池开发区', 4, 2387), +(19096, '华桥乡', 4, 2388), +(19097, '司前乡', 4, 2388), +(19098, '寨里镇', 4, 2388), +(19099, '崇仁乡', 4, 2388), +(19100, '李坊乡', 4, 2388), +(19101, '止马镇', 4, 2388), +(19102, '鸾凤乡', 4, 2388), +(19103, '南山镇', 4, 2389), +(19104, '四鹤街道', 4, 2389), +(19105, '塔前镇', 4, 2389), +(19106, '夏道镇', 4, 2389), +(19107, '大横镇', 4, 2389), +(19108, '太平镇', 4, 2389), +(19109, '峡阳镇', 4, 2389), +(19110, '巨口乡', 4, 2389), +(19111, '来舟镇', 4, 2389), +(19112, '樟湖镇', 4, 2389), +(19113, '水东街道', 4, 2389), +(19114, '水南街道', 4, 2389), +(19115, '洋后镇', 4, 2389), +(19116, '炉下镇', 4, 2389), +(19117, '王台镇', 4, 2389), +(19118, '紫云街道', 4, 2389), +(19119, '茫荡镇', 4, 2389), +(19120, '西芹镇', 4, 2389), +(19121, '赤门乡', 4, 2389), +(19122, '黄墩街道', 4, 2389), +(19123, '东峰镇', 4, 2390), +(19124, '东游镇', 4, 2390), +(19125, '南雅镇', 4, 2390), +(19126, '吉阳镇', 4, 2390), +(19127, '小松镇', 4, 2390), +(19128, '小桥镇', 4, 2390), +(19129, '川石乡', 4, 2390), +(19130, '建安街道', 4, 2390), +(19131, '徐墩镇', 4, 2390), +(19132, '房道镇', 4, 2390), +(19133, '水源乡', 4, 2390), +(19134, '玉山镇', 4, 2390), +(19135, '瓯宁街道', 4, 2390), +(19136, '芝山街道', 4, 2390), +(19137, '迪口镇', 4, 2390), +(19138, '通济街道', 4, 2390), +(19139, '顺阳乡', 4, 2390), +(19140, '龙村乡', 4, 2390), +(19141, '书坊乡', 4, 2391), +(19142, '将口镇', 4, 2391), +(19143, '小湖镇', 4, 2391), +(19144, '崇雒乡', 4, 2391), +(19145, '徐市镇', 4, 2391), +(19146, '水吉镇', 4, 2391), +(19147, '漳墩镇', 4, 2391); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19148, '潭城街道', 4, 2391), +(19149, '童游街道', 4, 2391), +(19150, '莒口镇', 4, 2391), +(19151, '回龙乡', 4, 2391), +(19152, '麻沙镇', 4, 2391), +(19153, '黄坑镇', 4, 2391), +(19154, '东平镇', 4, 2392), +(19155, '外屯乡', 4, 2392), +(19156, '岭腰乡', 4, 2392), +(19157, '星溪乡', 4, 2392), +(19158, '杨源乡', 4, 2392), +(19159, '澄源乡', 4, 2392), +(19160, '熊山镇', 4, 2392), +(19161, '石屯镇', 4, 2392), +(19162, '铁山镇', 4, 2392), +(19163, '镇前镇', 4, 2392), +(19164, '旧县乡', 4, 2393), +(19165, '河东乡', 4, 2393), +(19166, '渭田镇', 4, 2393), +(19167, '溪东乡', 4, 2393), +(19168, '祖墩乡', 4, 2393), +(19169, '花桥乡', 4, 2393), +(19170, '茶平乡', 4, 2393), +(19171, '郑墩镇', 4, 2393), +(19172, '上梅乡', 4, 2394), +(19173, '五夫镇', 4, 2394), +(19174, '兴田镇', 4, 2394), +(19175, '吴屯乡', 4, 2394), +(19176, '岚谷乡', 4, 2394), +(19177, '新丰街道', 4, 2394), +(19178, '星村镇', 4, 2394), +(19179, '武夷街道', 4, 2394), +(19180, '洋庄乡', 4, 2394), +(19181, '万安乡', 4, 2395), +(19182, '临江镇', 4, 2395), +(19183, '九牧镇', 4, 2395), +(19184, '仙阳镇', 4, 2395), +(19185, '南浦镇', 4, 2395), +(19186, '古楼乡', 4, 2395), +(19187, '官路乡', 4, 2395), +(19188, '富岭镇', 4, 2395), +(19189, '山下乡', 4, 2395), +(19190, '忠信镇', 4, 2395), +(19191, '枫溪乡', 4, 2395), +(19192, '水北街镇', 4, 2395), +(19193, '水南乡', 4, 2395), +(19194, '永兴镇', 4, 2395), +(19195, '濠村乡', 4, 2395), +(19196, '盘亭乡', 4, 2395), +(19197, '石陂镇', 4, 2395), +(19198, '管厝乡', 4, 2395), +(19199, '莲塘镇', 4, 2395), +(19200, '下沙镇', 4, 2396), +(19201, '卫闽镇', 4, 2396), +(19202, '吴家塘镇', 4, 2396), +(19203, '和平镇', 4, 2396), +(19204, '城郊镇', 4, 2396), +(19205, '大埠岗镇', 4, 2396), +(19206, '大竹镇', 4, 2396), +(19207, '张厝乡', 4, 2396), +(19208, '拿口镇', 4, 2396), +(19209, '晒口街道', 4, 2396), +(19210, '桂林乡', 4, 2396), +(19211, '水北街道', 4, 2396), +(19212, '水北镇', 4, 2396); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19213, '沿山镇', 4, 2396), +(19214, '洪墩镇', 4, 2396), +(19215, '肖家坊镇', 4, 2396), +(19216, '通泰街道', 4, 2396), +(19217, '金坑乡', 4, 2396), +(19218, '仁寿镇', 4, 2397), +(19219, '元坑镇', 4, 2397), +(19220, '双溪镇', 4, 2397), +(19221, '埔上镇', 4, 2397), +(19222, '大历镇', 4, 2397), +(19223, '大干镇', 4, 2397), +(19224, '岚下乡', 4, 2397), +(19225, '建西镇', 4, 2397), +(19226, '水南镇', 4, 2397), +(19227, '洋口镇', 4, 2397), +(19228, '洋墩乡', 4, 2397), +(19229, '郑坊乡', 4, 2397), +(19230, '际会乡', 4, 2397), +(19231, '高阳乡', 4, 2397), +(19232, '下都乡', 4, 2398), +(19233, '中都镇', 4, 2398), +(19234, '临城镇', 4, 2398), +(19235, '南阳镇', 4, 2398), +(19236, '古田镇', 4, 2398), +(19237, '太拔乡', 4, 2398), +(19238, '官庄乡', 4, 2398), +(19239, '庐丰乡', 4, 2398), +(19240, '才溪村', 4, 2398), +(19241, '旧县乡', 4, 2398), +(19242, '步云乡', 4, 2398), +(19243, '泮境乡', 4, 2398), +(19244, '湖洋乡', 4, 2398), +(19245, '溪口乡', 4, 2398), +(19246, '珊瑚乡', 4, 2398), +(19247, '白砂镇', 4, 2398), +(19248, '稔田镇', 4, 2398), +(19249, '茶地乡', 4, 2398), +(19250, '蓝溪镇', 4, 2398), +(19251, '蛟洋乡', 4, 2398), +(19252, '通贤乡', 4, 2398), +(19253, '万安镇', 4, 2399), +(19254, '东肖街道', 4, 2399), +(19255, '中城街道', 4, 2399), +(19256, '南城街道', 4, 2399), +(19257, '大池镇', 4, 2399), +(19258, '小池镇', 4, 2399), +(19259, '岩山乡', 4, 2399), +(19260, '曹溪街道', 4, 2399), +(19261, '江山乡', 4, 2399), +(19262, '白沙镇', 4, 2399), +(19263, '红坊镇', 4, 2399), +(19264, '苏坂乡', 4, 2399), +(19265, '西城街道', 4, 2399), +(19266, '西陂街道', 4, 2399), +(19267, '适中镇', 4, 2399), +(19268, '铁山街道', 4, 2399), +(19269, '雁石镇', 4, 2399), +(19270, '龙门街道', 4, 2399), +(19271, '万安乡', 4, 2400), +(19272, '下坝乡', 4, 2400), +(19273, '东留乡', 4, 2400), +(19274, '中堡镇', 4, 2400), +(19275, '中山镇', 4, 2400), +(19276, '中赤乡', 4, 2400), +(19277, '十方镇', 4, 2400); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19278, '城厢乡', 4, 2400), +(19279, '大禾乡', 4, 2400), +(19280, '岩前镇', 4, 2400), +(19281, '桃溪镇', 4, 2400), +(19282, '武东乡', 4, 2400), +(19283, '民主乡', 4, 2400), +(19284, '永平乡', 4, 2400), +(19285, '湘店乡', 4, 2400), +(19286, '象洞乡', 4, 2400), +(19287, '下洋镇', 4, 2401), +(19288, '仙师镇', 4, 2401), +(19289, '古竹乡', 4, 2401), +(19290, '合溪乡', 4, 2401), +(19291, '坎市镇', 4, 2401), +(19292, '城郊乡', 4, 2401), +(19293, '培丰镇', 4, 2401), +(19294, '堂堡乡', 4, 2401), +(19295, '大溪乡', 4, 2401), +(19296, '岐岭乡', 4, 2401), +(19297, '峰市镇', 4, 2401), +(19298, '抚市镇', 4, 2401), +(19299, '洪山乡', 4, 2401), +(19300, '湖坑镇', 4, 2401), +(19301, '湖山乡', 4, 2401), +(19302, '湖雷镇', 4, 2401), +(19303, '虎岗乡', 4, 2401), +(19304, '西溪乡', 4, 2401), +(19305, '金砂乡', 4, 2401), +(19306, '陈东乡', 4, 2401), +(19307, '高头乡', 4, 2401), +(19308, '高陂镇', 4, 2401), +(19309, '龙潭镇', 4, 2401), +(19310, '南洋乡', 4, 2402), +(19311, '双洋镇', 4, 2402), +(19312, '吾祠乡', 4, 2402), +(19313, '和平镇', 4, 2402), +(19314, '官田乡', 4, 2402), +(19315, '拱桥镇', 4, 2402), +(19316, '新桥镇', 4, 2402), +(19317, '桂林街道', 4, 2402), +(19318, '永福镇', 4, 2402), +(19319, '溪南镇', 4, 2402), +(19320, '灵地乡', 4, 2402), +(19321, '芦芝乡', 4, 2402), +(19322, '菁城街道', 4, 2402), +(19323, '西园乡', 4, 2402), +(19324, '象湖镇', 4, 2402), +(19325, '赤水镇', 4, 2402), +(19326, '北团镇', 4, 2403), +(19327, '四堡乡', 4, 2403), +(19328, '塘前乡', 4, 2403), +(19329, '姑田镇', 4, 2403), +(19330, '宣和乡', 4, 2403), +(19331, '庙前镇', 4, 2403), +(19332, '揭乐乡', 4, 2403), +(19333, '文亨乡', 4, 2403), +(19334, '新泉镇', 4, 2403), +(19335, '曲溪乡', 4, 2403), +(19336, '朋口镇', 4, 2403), +(19337, '李屋乡', 4, 2403), +(19338, '林坊乡', 4, 2403), +(19339, '罗坊乡', 4, 2403), +(19340, '莒溪镇', 4, 2403), +(19341, '莲峰镇', 4, 2403), +(19342, '赖源乡', 4, 2403), +(19343, '隔川乡', 4, 2403); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19344, '三洲乡', 4, 2404), +(19345, '南山镇', 4, 2404), +(19346, '古城镇', 4, 2404), +(19347, '四都镇', 4, 2404), +(19348, '大同镇', 4, 2404), +(19349, '宣成乡', 4, 2404), +(19350, '庵杰乡', 4, 2404), +(19351, '新桥镇', 4, 2404), +(19352, '汀州镇', 4, 2404), +(19353, '河田镇', 4, 2404), +(19354, '涂坊镇', 4, 2404), +(19355, '濯田镇', 4, 2404), +(19356, '童坊镇', 4, 2404), +(19357, '策武乡', 4, 2404), +(19358, '红山乡', 4, 2404), +(19359, '羊牯乡', 4, 2404), +(19360, '铁长乡', 4, 2404), +(19361, '馆前镇', 4, 2404), +(19362, '凤埔乡', 4, 2405), +(19363, '凤都镇', 4, 2405), +(19364, '卓洋乡', 4, 2405), +(19365, '吉巷乡', 4, 2405), +(19366, '大桥镇', 4, 2405), +(19367, '大甲乡', 4, 2405), +(19368, '平湖镇', 4, 2405), +(19369, '新城镇', 4, 2405), +(19370, '杉洋镇', 4, 2405), +(19371, '松吉乡', 4, 2405), +(19372, '水口镇', 4, 2405), +(19373, '泮洋乡', 4, 2405), +(19374, '湖滨乡', 4, 2405), +(19375, '鹤塘镇', 4, 2405), +(19376, '黄田镇', 4, 2405), +(19377, '七步镇', 4, 2406), +(19378, '咸村镇', 4, 2406), +(19379, '李墩镇', 4, 2406), +(19380, '泗桥乡', 4, 2406), +(19381, '浦源镇', 4, 2406), +(19382, '玛坑乡', 4, 2406), +(19383, '礼门乡', 4, 2406), +(19384, '纯池镇', 4, 2406), +(19385, '下党乡', 4, 2407), +(19386, '凤阳乡', 4, 2407), +(19387, '南阳镇', 4, 2407), +(19388, '坑底乡', 4, 2407), +(19389, '大安乡', 4, 2407), +(19390, '平溪乡', 4, 2407), +(19391, '托溪乡', 4, 2407), +(19392, '斜滩镇', 4, 2407), +(19393, '武曲镇', 4, 2407), +(19394, '清源乡', 4, 2407), +(19395, '犀溪乡', 4, 2407), +(19396, '竹管垅乡', 4, 2407), +(19397, '芹洋乡', 4, 2407), +(19398, '双溪镇', 4, 2408), +(19399, '寿山乡', 4, 2408), +(19400, '屏城乡', 4, 2408), +(19401, '岭下乡', 4, 2408), +(19402, '棠口乡', 4, 2408), +(19403, '熙岭乡', 4, 2408), +(19404, '甘棠乡', 4, 2408), +(19405, '路下乡', 4, 2408), +(19406, '长桥镇', 4, 2408), +(19407, '黛溪镇', 4, 2408), +(19408, '东源乡', 4, 2409), +(19409, '乍洋乡', 4, 2409); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19410, '城郊乡', 4, 2409), +(19411, '宅中乡', 4, 2409), +(19412, '富溪镇', 4, 2409), +(19413, '楮坪乡', 4, 2409), +(19414, '英山乡', 4, 2409), +(19415, '黄柏乡', 4, 2409), +(19416, '赛岐开发区', 4, 2410), +(19417, '上白石镇', 4, 2410), +(19418, '下白石镇', 4, 2410), +(19419, '坂中畲族乡', 4, 2410), +(19420, '城北街道', 4, 2410), +(19421, '城阳乡', 4, 2410), +(19422, '康厝畲族乡', 4, 2410), +(19423, '晓阳镇', 4, 2410), +(19424, '松罗乡', 4, 2410), +(19425, '湾坞乡', 4, 2410), +(19426, '溪尾镇', 4, 2410), +(19427, '溪柄镇', 4, 2410), +(19428, '溪潭镇', 4, 2410), +(19429, '潭头镇', 4, 2410), +(19430, '甘棠镇', 4, 2410), +(19431, '社口镇', 4, 2410), +(19432, '穆云畲族乡', 4, 2410), +(19433, '穆阳镇', 4, 2410), +(19434, '范坑乡', 4, 2410), +(19435, '赛岐镇', 4, 2410), +(19436, '阳头街道', 4, 2410), +(19437, '龙安开发区', 4, 2411), +(19438, '佳阳乡', 4, 2411), +(19439, '前岐镇', 4, 2411), +(19440, '叠石乡', 4, 2411), +(19441, '山前街道', 4, 2411), +(19442, '嵛山镇', 4, 2411), +(19443, '店下镇', 4, 2411), +(19444, '桐城街道', 4, 2411), +(19445, '沙埕镇', 4, 2411), +(19446, '点头镇', 4, 2411), +(19447, '白琳镇', 4, 2411), +(19448, '硖门畲族乡', 4, 2411), +(19449, '磻溪镇', 4, 2411), +(19450, '秦屿镇', 4, 2411), +(19451, '管阳镇', 4, 2411), +(19452, '贯岭镇', 4, 2411), +(19453, '东侨开发区', 4, 2412), +(19454, '七都镇', 4, 2412), +(19455, '三都镇', 4, 2412), +(19456, '九都镇', 4, 2412), +(19457, '八都镇', 4, 2412), +(19458, '城南镇', 4, 2412), +(19459, '洋中镇', 4, 2412), +(19460, '洪口乡', 4, 2412), +(19461, '漳湾镇', 4, 2412), +(19462, '石后乡', 4, 2412), +(19463, '蕉北街道', 4, 2412), +(19464, '虎贝乡', 4, 2412), +(19465, '赤溪镇', 4, 2412), +(19466, '金涵畲族乡', 4, 2412), +(19467, '霍童镇', 4, 2412), +(19468, '飞鸾镇', 4, 2412), +(19469, '三沙镇', 4, 2413), +(19470, '下浒镇', 4, 2413), +(19471, '北壁乡', 4, 2413), +(19472, '崇儒畲族乡', 4, 2413); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19473, '松港街道', 4, 2413), +(19474, '柏洋乡', 4, 2413), +(19475, '水门畲族乡', 4, 2413), +(19476, '沙江镇', 4, 2413), +(19477, '海岛乡', 4, 2413), +(19478, '溪南镇', 4, 2413), +(19479, '牙城镇', 4, 2413), +(19480, '盐田畲族乡', 4, 2413), +(19481, '长春镇', 4, 2413), +(19482, '八一桥街道', 4, 2414), +(19483, '公园街道', 4, 2414), +(19484, '墩子塘街道', 4, 2414), +(19485, '大院街道', 4, 2414), +(19486, '彭家桥街道', 4, 2414), +(19487, '沙井街道', 4, 2414), +(19488, '滕王阁街道', 4, 2414), +(19489, '百花洲街道', 4, 2414), +(19490, '董家窑街道', 4, 2414), +(19491, '豫章街道', 4, 2414), +(19492, '贤士湖管委会', 4, 2414), +(19493, '三江镇', 4, 2415), +(19494, '东新乡', 4, 2415), +(19495, '八一乡', 4, 2415), +(19496, '南新乡', 4, 2415), +(19497, '向塘镇', 4, 2415), +(19498, '塔城乡', 4, 2415), +(19499, '塘南镇', 4, 2415), +(19500, '富山乡', 4, 2415), +(19501, '岗上镇', 4, 2415), +(19502, '幽兰镇', 4, 2415), +(19503, '广福镇', 4, 2415), +(19504, '昌东镇', 4, 2415), +(19505, '武阳镇', 4, 2415), +(19506, '泾口乡', 4, 2415), +(19507, '莲塘镇', 4, 2415), +(19508, '蒋巷镇', 4, 2415), +(19509, '麻丘镇', 4, 2415), +(19510, '黄马乡', 4, 2415), +(19511, '万埠镇', 4, 2416), +(19512, '东阳镇', 4, 2416), +(19513, '乔乐乡', 4, 2416), +(19514, '新民乡', 4, 2416), +(19515, '石鼻镇', 4, 2416), +(19516, '长均乡', 4, 2416), +(19517, '长埠镇', 4, 2416), +(19518, '黄洲镇', 4, 2416), +(19519, '鼎湖镇', 4, 2416), +(19520, '龙津镇', 4, 2416), +(19521, '乐化镇', 4, 2417), +(19522, '南矶乡', 4, 2417), +(19523, '厚田乡', 4, 2417), +(19524, '大塘坪乡', 4, 2417), +(19525, '昌邑乡', 4, 2417), +(19526, '望城镇', 4, 2417), +(19527, '松湖镇', 4, 2417), +(19528, '樵舍镇', 4, 2417), +(19529, '流湖乡', 4, 2417), +(19530, '溪霞镇', 4, 2417), +(19531, '生米镇', 4, 2417), +(19532, '石埠乡', 4, 2417), +(19533, '石岗镇', 4, 2417), +(19534, '联圩乡', 4, 2417), +(19535, '西山镇', 4, 2417); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19536, '象山镇', 4, 2417), +(19537, '金桥乡', 4, 2417), +(19538, '铁河乡', 4, 2417), +(19539, '长堎镇', 4, 2417), +(19540, '太平乡', 4, 2418), +(19541, '幸福街道', 4, 2418), +(19542, '招贤镇', 4, 2418), +(19543, '梅岭镇', 4, 2418), +(19544, '站前街道', 4, 2418), +(19545, '罗亭镇', 4, 2418), +(19546, '丁公路街道', 4, 2419), +(19547, '十字街街道', 4, 2419), +(19548, '南浦街道', 4, 2419), +(19549, '南站街道', 4, 2419), +(19550, '广润门街道', 4, 2419), +(19551, '朝阳洲街道', 4, 2419), +(19552, '桃源街道', 4, 2419), +(19553, '桃花镇', 4, 2419), +(19554, '系马桩街道', 4, 2419), +(19555, '绳金塔街道', 4, 2419), +(19556, '西湖街道', 4, 2419), +(19557, '七里乡', 4, 2420), +(19558, '三里乡', 4, 2420), +(19559, '三阳集乡', 4, 2420), +(19560, '下埠集乡', 4, 2420), +(19561, '二塘乡', 4, 2420), +(19562, '前坊镇', 4, 2420), +(19563, '南台乡', 4, 2420), +(19564, '张公镇', 4, 2420), +(19565, '文港镇', 4, 2420), +(19566, '李渡镇', 4, 2420), +(19567, '架桥镇', 4, 2420), +(19568, '梅庄镇', 4, 2420), +(19569, '民和镇', 4, 2420), +(19570, '池溪乡', 4, 2420), +(19571, '泉岭乡', 4, 2420), +(19572, '温圳镇', 4, 2420), +(19573, '白圩乡', 4, 2420), +(19574, '罗溪镇', 4, 2420), +(19575, '衙前乡', 4, 2420), +(19576, '钟陵乡', 4, 2420), +(19577, '长山晏乡', 4, 2420), +(19578, '三家店街道', 4, 2421), +(19579, '京山街道', 4, 2421), +(19580, '岱山街道', 4, 2421), +(19581, '徐家坊街道', 4, 2421), +(19582, '洪都街道', 4, 2421), +(19583, '青云谱镇', 4, 2421), +(19584, '上海路街道', 4, 2422), +(19585, '京东镇', 4, 2422), +(19586, '塘山镇', 4, 2422), +(19587, '扬子洲乡', 4, 2422), +(19588, '湖坊镇', 4, 2422), +(19589, '罗家镇', 4, 2422), +(19590, '蛟桥镇', 4, 2422), +(19591, '青山路街道', 4, 2422), +(19592, '临港镇', 4, 2423), +(19593, '乐港镇', 4, 2423), +(19594, '众埠镇', 4, 2423), +(19595, '十里岗乡', 4, 2423), +(19596, '双田镇', 4, 2423), +(19597, '后港镇', 4, 2423); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19598, '塔前镇', 4, 2423), +(19599, '塔山街道', 4, 2423), +(19600, '接渡镇', 4, 2423), +(19601, '洎阳街道', 4, 2423), +(19602, '洪岩镇', 4, 2423), +(19603, '洺口镇', 4, 2423), +(19604, '浯口镇', 4, 2423), +(19605, '涌山镇', 4, 2423), +(19606, '礼林镇', 4, 2423), +(19607, '金鹅山乡', 4, 2423), +(19608, '镇桥镇', 4, 2423), +(19609, '高家镇', 4, 2423), +(19610, '鸬鹚乡', 4, 2423), +(19611, '丽阳乡', 4, 2424), +(19612, '吕蒙乡', 4, 2424), +(19613, '昌江区开发区', 4, 2424), +(19614, '景德镇高新区管委会', 4, 2424), +(19615, '竟成镇', 4, 2424), +(19616, '荷塘乡', 4, 2424), +(19617, '西郊垦殖场', 4, 2424), +(19618, '西郊街道', 4, 2424), +(19619, '鲇鱼山镇', 4, 2424), +(19620, '三龙乡', 4, 2425), +(19621, '兴田乡', 4, 2425), +(19622, '勒功乡', 4, 2425), +(19623, '寿安镇', 4, 2425), +(19624, '峙滩乡', 4, 2425), +(19625, '庄湾乡', 4, 2425), +(19626, '江村乡', 4, 2425), +(19627, '洪源镇', 4, 2425), +(19628, '浮梁镇', 4, 2425), +(19629, '湘湖镇', 4, 2425), +(19630, '王港乡', 4, 2425), +(19631, '瑶里镇', 4, 2425), +(19632, '经公桥镇', 4, 2425), +(19633, '蛟潭镇', 4, 2425), +(19634, '西湖乡', 4, 2425), +(19635, '鹅湖镇', 4, 2425), +(19636, '黄坛乡', 4, 2425), +(19637, '周路口街道', 4, 2426), +(19638, '太白园街道', 4, 2426), +(19639, '新厂街道', 4, 2426), +(19640, '新村街道', 4, 2426), +(19641, '昌江街道', 4, 2426), +(19642, '昌河街道', 4, 2426), +(19643, '珠山街道', 4, 2426), +(19644, '石狮埠街道', 4, 2426), +(19645, '里村街道', 4, 2426), +(19646, '上栗镇', 4, 2427), +(19647, '东源乡', 4, 2427), +(19648, '彭高镇', 4, 2427), +(19649, '桐木镇', 4, 2427), +(19650, '福田镇', 4, 2427), +(19651, '赤山镇', 4, 2427), +(19652, '金山镇', 4, 2427), +(19653, '长平乡', 4, 2427), +(19654, '鸡冠山乡', 4, 2427), +(19655, '丹江街道', 4, 2428), +(19656, '五陂镇', 4, 2428), +(19657, '八一街道', 4, 2428), +(19658, '凤凰街道', 4, 2428), +(19659, '后埠街道', 4, 2428); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19660, '安源镇', 4, 2428), +(19661, '白源街道', 4, 2428), +(19662, '青山镇', 4, 2428), +(19663, '高坑镇', 4, 2428), +(19664, '下埠镇', 4, 2429), +(19665, '东桥镇', 4, 2429), +(19666, '峡山口街道', 4, 2429), +(19667, '广寒寨乡', 4, 2429), +(19668, '排上镇', 4, 2429), +(19669, '湘东镇', 4, 2429), +(19670, '白竺乡', 4, 2429), +(19671, '老关镇', 4, 2429), +(19672, '腊市镇', 4, 2429), +(19673, '荷尧镇', 4, 2429), +(19674, '麻山镇', 4, 2429), +(19675, '万龙山乡', 4, 2430), +(19676, '上埠镇', 4, 2430), +(19677, '南坑镇', 4, 2430), +(19678, '宣风镇', 4, 2430), +(19679, '张佳坊乡', 4, 2430), +(19680, '新泉乡', 4, 2430), +(19681, '源南乡', 4, 2430), +(19682, '芦溪镇', 4, 2430), +(19683, '银河镇', 4, 2430), +(19684, '长丰乡', 4, 2430), +(19685, '三板桥乡', 4, 2431), +(19686, '六市乡', 4, 2431), +(19687, '升坊镇', 4, 2431), +(19688, '南岭乡', 4, 2431), +(19689, '坊楼镇', 4, 2431), +(19690, '湖上乡', 4, 2431), +(19691, '琴亭镇', 4, 2431), +(19692, '神泉乡', 4, 2431), +(19693, '良坊镇', 4, 2431), +(19694, '荷塘乡', 4, 2431), +(19695, '路口镇', 4, 2431), +(19696, '闪石乡', 4, 2431), +(19697, '高洲乡', 4, 2431), +(19698, '城子镇', 4, 2432), +(19699, '城门乡', 4, 2432), +(19700, '岷山乡', 4, 2432), +(19701, '新合镇', 4, 2432), +(19702, '新塘乡', 4, 2432), +(19703, '永安乡', 4, 2432), +(19704, '江洲镇', 4, 2432), +(19705, '沙河街镇', 4, 2432), +(19706, '涌泉乡', 4, 2432), +(19707, '港口街镇', 4, 2432), +(19708, '狮子镇', 4, 2432), +(19709, '马回岭镇', 4, 2432), +(19710, '三都镇', 4, 2433), +(19711, '上奉镇', 4, 2433), +(19712, '上杭乡', 4, 2433), +(19713, '上衫乡', 4, 2433), +(19714, '东港乡', 4, 2433), +(19715, '义宁镇', 4, 2433), +(19716, '何市镇', 4, 2433), +(19717, '余段乡', 4, 2433), +(19718, '全丰镇', 4, 2433), +(19719, '古市镇', 4, 2433), +(19720, '四都镇', 4, 2433), +(19721, '复源乡', 4, 2433), +(19722, '大桥镇', 4, 2433), +(19723, '大椿乡', 4, 2433), +(19724, '山口镇', 4, 2433); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19725, '布甲乡', 4, 2433), +(19726, '庙岭乡', 4, 2433), +(19727, '征村乡', 4, 2433), +(19728, '新湾乡', 4, 2433), +(19729, '杭口镇', 4, 2433), +(19730, '水源乡', 4, 2433), +(19731, '渣津镇', 4, 2433), +(19732, '港口镇', 4, 2433), +(19733, '溪口镇', 4, 2433), +(19734, '漫江乡', 4, 2433), +(19735, '白岭镇', 4, 2433), +(19736, '石坳乡', 4, 2433), +(19737, '程坊乡', 4, 2433), +(19738, '竹坪乡', 4, 2433), +(19739, '西港镇', 4, 2433), +(19740, '路口乡', 4, 2433), +(19741, '马坳镇', 4, 2433), +(19742, '黄坳乡', 4, 2433), +(19743, '黄沙镇', 4, 2433), +(19744, '黄港镇', 4, 2433), +(19745, '黄龙乡', 4, 2433), +(19746, '七里湖街道', 4, 2434), +(19747, '五里街道', 4, 2434), +(19748, '十里街道', 4, 2434), +(19749, '姑塘镇', 4, 2434), +(19750, '威家镇', 4, 2434), +(19751, '新港镇', 4, 2434), +(19752, '海会镇', 4, 2434), +(19753, '牯岭镇', 4, 2434), +(19754, '莲花镇', 4, 2434), +(19755, '虞家河乡', 4, 2434), +(19756, '赛阳镇', 4, 2434), +(19757, '东升镇', 4, 2435), +(19758, '天红镇', 4, 2435), +(19759, '太平关乡', 4, 2435), +(19760, '定山镇', 4, 2435), +(19761, '杨梓镇', 4, 2435), +(19762, '棉船镇', 4, 2435), +(19763, '浩山乡', 4, 2435), +(19764, '浪溪镇', 4, 2435), +(19765, '芙蓉墩镇', 4, 2435), +(19766, '马垱镇', 4, 2435), +(19767, '黄岭乡', 4, 2435), +(19768, '黄花镇', 4, 2435), +(19769, '龙城镇', 4, 2435), +(19770, '丰林镇', 4, 2436), +(19771, '共青开放开发区城区', 4, 2436), +(19772, '吴山乡', 4, 2436), +(19773, '园艺场', 4, 2436), +(19774, '塘山乡', 4, 2436), +(19775, '宝塔乡', 4, 2436), +(19776, '彭山林场', 4, 2436), +(19777, '林泉乡', 4, 2436), +(19778, '江益镇', 4, 2436), +(19779, '河东乡', 4, 2436), +(19780, '爱民乡', 4, 2436), +(19781, '甘露镇', 4, 2436), +(19782, '磨溪乡', 4, 2436), +(19783, '聂桥镇', 4, 2436), +(19784, '茶山街道', 4, 2436), +(19785, '蒲亭镇', 4, 2436), +(19786, '车桥镇', 4, 2436), +(19787, '邹桥乡', 4, 2436), +(19788, '金湖镇', 4, 2436); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19789, '高塘乡', 4, 2436), +(19790, '华林镇', 4, 2437), +(19791, '南康镇', 4, 2437), +(19792, '横塘镇', 4, 2437), +(19793, '泽泉乡', 4, 2437), +(19794, '温泉镇', 4, 2437), +(19795, '白鹿镇', 4, 2437), +(19796, '苏家当乡', 4, 2437), +(19797, '蓼南乡', 4, 2437), +(19798, '蓼花镇', 4, 2437), +(19799, '蛟塘镇', 4, 2437), +(19800, '上汤乡', 4, 2438), +(19801, '东林乡', 4, 2438), +(19802, '大洞乡', 4, 2438), +(19803, '宋溪镇', 4, 2438), +(19804, '官莲乡', 4, 2438), +(19805, '巾口乡', 4, 2438), +(19806, '新宁镇', 4, 2438), +(19807, '杨洲乡', 4, 2438), +(19808, '横路乡', 4, 2438), +(19809, '泉口镇', 4, 2438), +(19810, '清江乡', 4, 2438), +(19811, '澧溪镇', 4, 2438), +(19812, '甫田乡', 4, 2438), +(19813, '石渡乡', 4, 2438), +(19814, '石门楼镇', 4, 2438), +(19815, '罗坪镇', 4, 2438), +(19816, '罗溪乡', 4, 2438), +(19817, '船滩镇', 4, 2438), +(19818, '鲁溪镇', 4, 2438), +(19819, '三溪桥镇', 4, 2439), +(19820, '三角乡', 4, 2439), +(19821, '九合乡', 4, 2439), +(19822, '吴城镇', 4, 2439), +(19823, '柘林镇', 4, 2439), +(19824, '梅棠镇', 4, 2439), +(19825, '江上乡', 4, 2439), +(19826, '江益镇', 4, 2439), +(19827, '涂埠镇', 4, 2439), +(19828, '滩溪镇', 4, 2439), +(19829, '燕坊镇', 4, 2439), +(19830, '白槎镇', 4, 2439), +(19831, '立新乡', 4, 2439), +(19832, '艾城镇', 4, 2439), +(19833, '虬津镇', 4, 2439), +(19834, '马口镇', 4, 2439), +(19835, '人民路街道', 4, 2440), +(19836, '向阳街道', 4, 2440), +(19837, '湓浦街道', 4, 2440), +(19838, '滨兴街道', 4, 2440), +(19839, '甘棠街道', 4, 2440), +(19840, '白水湖街道', 4, 2440), +(19841, '金鸡坡街道', 4, 2440), +(19842, '付垅乡', 4, 2441), +(19843, '凰村乡', 4, 2441), +(19844, '双钟镇', 4, 2441), +(19845, '城山镇', 4, 2441), +(19846, '大垅乡', 4, 2441), +(19847, '张青乡', 4, 2441), +(19848, '文桥乡', 4, 2441), +(19849, '武山镇', 4, 2441), +(19850, '流泗镇', 4, 2441), +(19851, '流芳乡', 4, 2441), +(19852, '舜德乡', 4, 2441), +(19853, '马影镇', 4, 2441); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19854, '乐园乡', 4, 2442), +(19855, '南义镇', 4, 2442), +(19856, '南阳乡', 4, 2442), +(19857, '夏畈镇', 4, 2442), +(19858, '大德山林场', 4, 2442), +(19859, '桂林街道', 4, 2442), +(19860, '横港镇', 4, 2442), +(19861, '横立山乡', 4, 2442), +(19862, '武蛟乡', 4, 2442), +(19863, '洪一乡', 4, 2442), +(19864, '洪下乡', 4, 2442), +(19865, '湓城街道', 4, 2442), +(19866, '白杨镇', 4, 2442), +(19867, '码头镇', 4, 2442), +(19868, '肇陈镇', 4, 2442), +(19869, '花园乡', 4, 2442), +(19870, '范镇', 4, 2442), +(19871, '赛湖农场', 4, 2442), +(19872, '青山林场', 4, 2442), +(19873, '高丰镇', 4, 2442), +(19874, '黄金乡', 4, 2442), +(19875, '万户镇', 4, 2443), +(19876, '三汊港镇', 4, 2443), +(19877, '中馆镇', 4, 2443), +(19878, '北山乡', 4, 2443), +(19879, '南峰镇', 4, 2443), +(19880, '周溪镇', 4, 2443), +(19881, '和合乡', 4, 2443), +(19882, '土塘镇', 4, 2443), +(19883, '多宝乡', 4, 2443), +(19884, '大树乡', 4, 2443), +(19885, '大沙镇', 4, 2443), +(19886, '大港镇', 4, 2443), +(19887, '左里镇', 4, 2443), +(19888, '徐埠镇', 4, 2443), +(19889, '春桥乡', 4, 2443), +(19890, '汪墩乡', 4, 2443), +(19891, '狮山乡', 4, 2443), +(19892, '芗溪乡', 4, 2443), +(19893, '苏山乡', 4, 2443), +(19894, '蔡岭镇', 4, 2443), +(19895, '西源乡', 4, 2443), +(19896, '都昌镇', 4, 2443), +(19897, '阳峰乡', 4, 2443), +(19898, '鸣山乡', 4, 2443), +(19899, '上村林场', 4, 2444), +(19900, '凤阳乡', 4, 2444), +(19901, '分宜镇', 4, 2444), +(19902, '双林镇', 4, 2444), +(19903, '山下林场', 4, 2444), +(19904, '操场乡', 4, 2444), +(19905, '杨桥镇', 4, 2444), +(19906, '洋江乡', 4, 2444), +(19907, '洞村乡', 4, 2444), +(19908, '湖泽镇', 4, 2444), +(19909, '畜牧良种场', 4, 2444), +(19910, '芳山林场', 4, 2444), +(19911, '钤山镇', 4, 2444), +(19912, '长埠林场', 4, 2444), +(19913, '高岚乡', 4, 2444), +(19914, '下村镇', 4, 2445), +(19915, '九龙山乡', 4, 2445), +(19916, '人和乡', 4, 2445), +(19917, '南安乡', 4, 2445); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19918, '城北街道', 4, 2445), +(19919, '城南街道', 4, 2445), +(19920, '姚圩镇', 4, 2445), +(19921, '新溪乡', 4, 2445), +(19922, '新钢街道', 4, 2445), +(19923, '欧里镇', 4, 2445), +(19924, '水北镇', 4, 2445), +(19925, '水西镇', 4, 2445), +(19926, '河下镇', 4, 2445), +(19927, '珠珊镇', 4, 2445), +(19928, '界水乡', 4, 2445), +(19929, '罗坊镇', 4, 2445), +(19930, '良山镇', 4, 2445), +(19931, '袁河街道', 4, 2445), +(19932, '观巢镇', 4, 2445), +(19933, '鹄山乡', 4, 2445), +(19934, '中童镇', 4, 2446), +(19935, '平定乡', 4, 2446), +(19936, '春涛乡', 4, 2446), +(19937, '杨溪乡', 4, 2446), +(19938, '洪湖乡', 4, 2446), +(19939, '潢溪镇', 4, 2446), +(19940, '画桥镇', 4, 2446), +(19941, '邓埠镇', 4, 2446), +(19942, '锦江镇', 4, 2446), +(19943, '马荃镇', 4, 2446), +(19944, '黄庄乡', 4, 2446), +(19945, '东湖街道', 4, 2447), +(19946, '交通街道', 4, 2447), +(19947, '四青街道', 4, 2447), +(19948, '夏埠乡', 4, 2447), +(19949, '梅园街道', 4, 2447), +(19950, '江边街道', 4, 2447), +(19951, '白露街道', 4, 2447), +(19952, '童家镇', 4, 2447), +(19953, '上清镇', 4, 2448), +(19954, '东门街道', 4, 2448), +(19955, '余家乡', 4, 2448), +(19956, '冷水镇', 4, 2448), +(19957, '周坊镇', 4, 2448), +(19958, '塘湾镇', 4, 2448), +(19959, '彭湾乡', 4, 2448), +(19960, '志光镇', 4, 2448), +(19961, '文坊镇', 4, 2448), +(19962, '樟坪畲族乡', 4, 2448), +(19963, '河潭镇', 4, 2448), +(19964, '泗沥镇', 4, 2448), +(19965, '流口镇', 4, 2448), +(19966, '滨江乡', 4, 2448), +(19967, '白田乡', 4, 2448), +(19968, '罗河镇', 4, 2448), +(19969, '耳口乡', 4, 2448), +(19970, '花园街道', 4, 2448), +(19971, '金屯镇', 4, 2448), +(19972, '雄石街道', 4, 2448), +(19973, '雷溪乡', 4, 2448), +(19974, '鸿塘镇', 4, 2448), +(19975, '龙虎山镇', 4, 2448), +(19976, '东山镇', 4, 2449), +(19977, '五指峰乡', 4, 2449), +(19978, '双溪乡', 4, 2449), +(19979, '安和乡', 4, 2449), +(19980, '寺下乡', 4, 2449), +(19981, '平富乡', 4, 2449); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(19982, '梅水乡', 4, 2449), +(19983, '水岩乡', 4, 2449), +(19984, '油石乡', 4, 2449), +(19985, '社溪镇', 4, 2449), +(19986, '紫阳乡', 4, 2449), +(19987, '营前镇', 4, 2449), +(19988, '陡水镇', 4, 2449), +(19989, '黄埠镇', 4, 2449), +(19990, '仙下乡', 4, 2450), +(19991, '利村乡', 4, 2450), +(19992, '宽田乡', 4, 2450), +(19993, '小溪乡', 4, 2450), +(19994, '岭背镇', 4, 2450), +(19995, '新陂乡', 4, 2450), +(19996, '桥头乡', 4, 2450), +(19997, '梓山镇', 4, 2450), +(19998, '段屋乡', 4, 2450), +(19999, '沙心乡', 4, 2450), +(20000, '盘古山镇', 4, 2450), +(20001, '祁禄山镇', 4, 2450), +(20002, '禾丰镇', 4, 2450), +(20003, '罗坳镇', 4, 2450), +(20004, '罗江乡', 4, 2450), +(20005, '葛坳乡', 4, 2450), +(20006, '贡江镇', 4, 2450), +(20007, '车溪乡', 4, 2450), +(20008, '铁山垅镇', 4, 2450), +(20009, '银坑镇', 4, 2450), +(20010, '靖石乡', 4, 2450), +(20011, '马安乡', 4, 2450), +(20012, '黄麟乡', 4, 2450), +(20013, '中村乡', 4, 2451), +(20014, '右水乡', 4, 2451), +(20015, '周田镇', 4, 2451), +(20016, '富城乡', 4, 2451), +(20017, '小密乡', 4, 2451), +(20018, '庄口镇', 4, 2451), +(20019, '庄埠乡', 4, 2451), +(20020, '文武坝镇', 4, 2451), +(20021, '晓龙乡', 4, 2451), +(20022, '永隆乡', 4, 2451), +(20023, '洞头乡', 4, 2451), +(20024, '清溪乡', 4, 2451), +(20025, '珠兰乡', 4, 2451), +(20026, '白鹅乡', 4, 2451), +(20027, '站塘乡', 4, 2451), +(20028, '筠门岭镇', 4, 2451), +(20029, '西江镇', 4, 2451), +(20030, '高排乡', 4, 2451), +(20031, '麻州镇', 4, 2451), +(20032, '万隆乡', 4, 2452), +(20033, '古陂镇', 4, 2452), +(20034, '嘉定镇', 4, 2452), +(20035, '大塘埠镇', 4, 2452), +(20036, '大桥镇', 4, 2452), +(20037, '大阿镇', 4, 2452), +(20038, '安西镇', 4, 2452), +(20039, '小江镇', 4, 2452), +(20040, '小河镇', 4, 2452), +(20041, '崇仙乡', 4, 2452), +(20042, '新田镇', 4, 2452), +(20043, '正平镇', 4, 2452), +(20044, '油山镇', 4, 2452), +(20045, '虎山乡', 4, 2452), +(20046, '西牛镇', 4, 2452); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20047, '铁石口镇', 4, 2452), +(20048, '中寨乡', 4, 2453), +(20049, '南迳镇', 4, 2453), +(20050, '城厢镇', 4, 2453), +(20051, '大吉山镇', 4, 2453), +(20052, '社迳乡', 4, 2453), +(20053, '金龙镇', 4, 2453), +(20054, '陂头镇', 4, 2453), +(20055, '龙下乡', 4, 2453), +(20056, '龙源坝镇', 4, 2453), +(20057, '东村乡', 4, 2454), +(20058, '兴江乡', 4, 2454), +(20059, '兴莲乡', 4, 2454), +(20060, '南坑乡', 4, 2454), +(20061, '古龙冈镇', 4, 2454), +(20062, '均村乡', 4, 2454), +(20063, '城岗乡', 4, 2454), +(20064, '埠头乡', 4, 2454), +(20065, '崇贤乡', 4, 2454), +(20066, '方太乡', 4, 2454), +(20067, '杰村乡', 4, 2454), +(20068, '枫边乡', 4, 2454), +(20069, '梅窖镇', 4, 2454), +(20070, '樟木乡', 4, 2454), +(20071, '永丰乡', 4, 2454), +(20072, '江背镇', 4, 2454), +(20073, '潋江镇', 4, 2454), +(20074, '社富乡', 4, 2454), +(20075, '良村镇', 4, 2454), +(20076, '茶园乡', 4, 2454), +(20077, '长冈乡', 4, 2454), +(20078, '隆坪乡', 4, 2454), +(20079, '高兴镇', 4, 2454), +(20080, '鼎龙乡', 4, 2454), +(20081, '龙口镇', 4, 2454), +(20082, '三江乡', 4, 2455), +(20083, '东山街道', 4, 2455), +(20084, '凤岗镇', 4, 2455), +(20085, '十八塘乡', 4, 2455), +(20086, '唐江镇', 4, 2455), +(20087, '坪市乡', 4, 2455), +(20088, '大坪乡', 4, 2455), +(20089, '太窝乡', 4, 2455), +(20090, '朱坊乡', 4, 2455), +(20091, '横寨乡', 4, 2455), +(20092, '横市镇', 4, 2455), +(20093, '浮石乡', 4, 2455), +(20094, '潭东镇', 4, 2455), +(20095, '潭口镇', 4, 2455), +(20096, '蓉江街道', 4, 2455), +(20097, '赤土畲族乡', 4, 2455), +(20098, '镜坝镇', 4, 2455), +(20099, '隆木乡', 4, 2455), +(20100, '麻双乡', 4, 2455), +(20101, '龙华乡', 4, 2455), +(20102, '龙回镇', 4, 2455), +(20103, '龙岭镇', 4, 2455), +(20104, '内良乡', 4, 2456), +(20105, '南安镇', 4, 2456), +(20106, '吉村镇', 4, 2456), +(20107, '左拔镇', 4, 2456), +(20108, '新城镇', 4, 2456), +(20109, '樟斗镇', 4, 2456), +(20110, '池江镇', 4, 2456), +(20111, '河洞乡', 4, 2456); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20112, '浮江乡', 4, 2456), +(20113, '青龙镇', 4, 2456), +(20114, '黄龙镇', 4, 2456), +(20115, '东山坝镇', 4, 2457), +(20116, '东韶乡', 4, 2457), +(20117, '会同乡', 4, 2457), +(20118, '固厚乡', 4, 2457), +(20119, '固村镇', 4, 2457), +(20120, '大沽乡', 4, 2457), +(20121, '安福乡', 4, 2457), +(20122, '对坊乡', 4, 2457), +(20123, '小布镇', 4, 2457), +(20124, '梅江镇', 4, 2457), +(20125, '洛口镇', 4, 2457), +(20126, '湛田乡', 4, 2457), +(20127, '田埠乡', 4, 2457), +(20128, '田头镇', 4, 2457), +(20129, '石上镇', 4, 2457), +(20130, '竹笮乡', 4, 2457), +(20131, '肖田乡', 4, 2457), +(20132, '蔡江乡', 4, 2457), +(20133, '赖村镇', 4, 2457), +(20134, '钓峰乡', 4, 2457), +(20135, '长胜镇', 4, 2457), +(20136, '青塘镇', 4, 2457), +(20137, '黄石镇', 4, 2457), +(20138, '黄陂镇', 4, 2457), +(20139, '三百山镇', 4, 2458), +(20140, '凤山乡', 4, 2458), +(20141, '双芫乡', 4, 2458), +(20142, '塘村乡', 4, 2458), +(20143, '天心镇', 4, 2458), +(20144, '孔田镇', 4, 2458), +(20145, '新龙乡', 4, 2458), +(20146, '欣山镇', 4, 2458), +(20147, '浮槎乡', 4, 2458), +(20148, '版石镇', 4, 2458), +(20149, '蔡坊乡', 4, 2458), +(20150, '车头镇', 4, 2458), +(20151, '重石乡', 4, 2458), +(20152, '镇岗乡', 4, 2458), +(20153, '长沙乡', 4, 2458), +(20154, '高云山乡', 4, 2458), +(20155, '鹤子镇', 4, 2458), +(20156, '龙布镇', 4, 2458), +(20157, '历市镇', 4, 2459), +(20158, '天九镇', 4, 2459), +(20159, '岭北镇', 4, 2459), +(20160, '岿美山镇', 4, 2459), +(20161, '老城镇', 4, 2459), +(20162, '鹅公镇', 4, 2459), +(20163, '龙塘镇', 4, 2459), +(20164, '三标乡', 4, 2460), +(20165, '丹溪乡', 4, 2460), +(20166, '南桥镇', 4, 2460), +(20167, '吉潭镇', 4, 2460), +(20168, '文峰乡', 4, 2460), +(20169, '晨光镇', 4, 2460), +(20170, '桂竹帽镇', 4, 2460), +(20171, '水源乡', 4, 2460), +(20172, '澄江镇', 4, 2460), +(20173, '留车镇', 4, 2460), +(20174, '罗珊乡', 4, 2460), +(20175, '菖蒲乡', 4, 2460), +(20176, '长宁镇', 4, 2460); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20177, '项山乡', 4, 2460), +(20178, '龙廷乡', 4, 2460), +(20179, '上堡乡', 4, 2461), +(20180, '丰州乡', 4, 2461), +(20181, '乐洞乡', 4, 2461), +(20182, '关田镇', 4, 2461), +(20183, '思顺乡', 4, 2461), +(20184, '扬眉镇', 4, 2461), +(20185, '文英乡', 4, 2461), +(20186, '杰坝乡', 4, 2461), +(20187, '横水镇', 4, 2461), +(20188, '聂都乡', 4, 2461), +(20189, '过埠镇', 4, 2461), +(20190, '金坑乡', 4, 2461), +(20191, '铅厂镇', 4, 2461), +(20192, '长龙镇', 4, 2461), +(20193, '麟潭乡', 4, 2461), +(20194, '龙勾乡', 4, 2461), +(20195, '丁陂乡', 4, 2462), +(20196, '万田乡', 4, 2462), +(20197, '九堡镇', 4, 2462), +(20198, '云石山乡', 4, 2462), +(20199, '叶坪乡', 4, 2462), +(20200, '壬田镇', 4, 2462), +(20201, '大柏地乡', 4, 2462), +(20202, '岗面乡', 4, 2462), +(20203, '拔英乡', 4, 2462), +(20204, '日东乡', 4, 2462), +(20205, '武阳镇', 4, 2462), +(20206, '沙洲坝镇', 4, 2462), +(20207, '泽覃乡', 4, 2462), +(20208, '瑞林镇', 4, 2462), +(20209, '谢坊镇', 4, 2462), +(20210, '象湖镇', 4, 2462), +(20211, '黄柏乡', 4, 2462), +(20212, '丰山乡', 4, 2463), +(20213, '大由乡', 4, 2463), +(20214, '小松镇', 4, 2463), +(20215, '屏山镇', 4, 2463), +(20216, '木兰乡', 4, 2463), +(20217, '横江镇', 4, 2463), +(20218, '珠坑乡', 4, 2463), +(20219, '琴江镇', 4, 2463), +(20220, '高田镇', 4, 2463), +(20221, '龙岗乡', 4, 2463), +(20222, '东外街道', 4, 2464), +(20223, '南外街道', 4, 2464), +(20224, '水东镇', 4, 2464), +(20225, '水南镇', 4, 2464), +(20226, '水西镇', 4, 2464), +(20227, '沙河镇', 4, 2464), +(20228, '沙石镇', 4, 2464), +(20229, '湖边镇', 4, 2464), +(20230, '蟠龙镇', 4, 2464), +(20231, '解放街道', 4, 2464), +(20232, '赣江街道', 4, 2464), +(20233, '黄金岭街道', 4, 2464), +(20234, '三溪乡', 4, 2465), +(20235, '五云镇', 4, 2465), +(20236, '储潭乡', 4, 2465), +(20237, '南塘镇', 4, 2465), +(20238, '吉埠镇', 4, 2465), +(20239, '大埠乡', 4, 2465), +(20240, '大田乡', 4, 2465), +(20241, '梅林镇', 4, 2465); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20242, '江口镇', 4, 2465), +(20243, '沙地镇', 4, 2465), +(20244, '湖江乡', 4, 2465), +(20245, '王母渡镇', 4, 2465), +(20246, '田村镇', 4, 2465), +(20247, '白鹭乡', 4, 2465), +(20248, '石芫乡', 4, 2465), +(20249, '茅店镇', 4, 2465), +(20250, '长洛乡', 4, 2465), +(20251, '阳埠乡', 4, 2465), +(20252, '韩坊乡', 4, 2465), +(20253, '东江乡', 4, 2466), +(20254, '临塘乡', 4, 2466), +(20255, '关西镇', 4, 2466), +(20256, '南亨乡', 4, 2466), +(20257, '夹湖乡', 4, 2466), +(20258, '杨村镇', 4, 2466), +(20259, '桃江乡', 4, 2466), +(20260, '武当镇', 4, 2466), +(20261, '汶龙镇', 4, 2466), +(20262, '渡江镇', 4, 2466), +(20263, '程龙镇', 4, 2466), +(20264, '里仁镇', 4, 2466), +(20265, '龙南镇', 4, 2466), +(20266, '五丰镇', 4, 2467), +(20267, '夏造镇', 4, 2467), +(20268, '宝山乡', 4, 2467), +(20269, '弹前乡', 4, 2467), +(20270, '枧头镇', 4, 2467), +(20271, '武术乡', 4, 2467), +(20272, '沙坪镇', 4, 2467), +(20273, '涧田乡', 4, 2467), +(20274, '潞田镇', 4, 2467), +(20275, '百加镇', 4, 2467), +(20276, '窑头镇', 4, 2467), +(20277, '罗塘乡', 4, 2467), +(20278, '芙蓉镇', 4, 2467), +(20279, '韶口乡', 4, 2467), +(20280, '顺峰乡', 4, 2467), +(20281, '高陂镇', 4, 2467), +(20282, '下七乡', 4, 2468), +(20283, '东上乡', 4, 2468), +(20284, '厦坪镇', 4, 2468), +(20285, '古城镇', 4, 2468), +(20286, '坳里乡', 4, 2468), +(20287, '大陇镇', 4, 2468), +(20288, '拿山乡', 4, 2468), +(20289, '新城镇', 4, 2468), +(20290, '柏露乡', 4, 2468), +(20291, '睦村乡', 4, 2468), +(20292, '茅坪乡', 4, 2468), +(20293, '茨坪街道', 4, 2468), +(20294, '荷花乡', 4, 2468), +(20295, '葛田乡', 4, 2468), +(20296, '长坪乡', 4, 2468), +(20297, '鹅岭乡', 4, 2468), +(20298, '黄坳乡', 4, 2468), +(20299, '龙市镇', 4, 2468), +(20300, '万福镇', 4, 2469), +(20301, '凤凰镇', 4, 2469), +(20302, '北源乡', 4, 2469), +(20303, '固江镇', 4, 2469), +(20304, '大冲乡', 4, 2469), +(20305, '天河镇', 4, 2469), +(20306, '安塘乡', 4, 2469), +(20307, '官田乡', 4, 2469); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20308, '指阳乡', 4, 2469), +(20309, '敖城镇', 4, 2469), +(20310, '敦厚镇', 4, 2469), +(20311, '桐坪镇', 4, 2469), +(20312, '梅塘乡', 4, 2469), +(20313, '横江镇', 4, 2469), +(20314, '永和镇', 4, 2469), +(20315, '永阳镇', 4, 2469), +(20316, '油田镇', 4, 2469), +(20317, '登龙乡', 4, 2469), +(20318, '里田乡', 4, 2469), +(20319, '习溪桥街道', 4, 2470), +(20320, '兴桥镇', 4, 2470), +(20321, '北门街道', 4, 2470), +(20322, '古南街道', 4, 2470), +(20323, '文山街道', 4, 2470), +(20324, '曲濑乡', 4, 2470), +(20325, '樟山镇', 4, 2470), +(20326, '永叔街道', 4, 2470), +(20327, '白塘街道', 4, 2470), +(20328, '禾埠乡', 4, 2470), +(20329, '长塘镇', 4, 2470), +(20330, '丁江镇', 4, 2471), +(20331, '乌江镇', 4, 2471), +(20332, '八都镇', 4, 2471), +(20333, '冠山乡', 4, 2471), +(20334, '双村镇', 4, 2471), +(20335, '尚贤乡', 4, 2471), +(20336, '文峰镇', 4, 2471), +(20337, '枫江镇', 4, 2471), +(20338, '水南镇', 4, 2471), +(20339, '水田乡', 4, 2471), +(20340, '白水镇', 4, 2471), +(20341, '白沙镇', 4, 2471), +(20342, '盘谷镇', 4, 2471), +(20343, '螺田镇', 4, 2471), +(20344, '醪桥镇', 4, 2471), +(20345, '金滩镇', 4, 2471), +(20346, '阜田镇', 4, 2471), +(20347, '黄桥镇', 4, 2471), +(20348, '严田镇', 4, 2472), +(20349, '寮塘乡', 4, 2472), +(20350, '山庄乡', 4, 2472), +(20351, '平都镇', 4, 2472), +(20352, '彭坊乡', 4, 2472), +(20353, '枫田镇', 4, 2472), +(20354, '横龙镇', 4, 2472), +(20355, '泰山乡', 4, 2472), +(20356, '洋溪镇', 4, 2472), +(20357, '洋门乡', 4, 2472), +(20358, '洲湖镇', 4, 2472), +(20359, '浒坑镇', 4, 2472), +(20360, '瓜畲乡', 4, 2472), +(20361, '甘洛乡', 4, 2472), +(20362, '章庄乡', 4, 2472), +(20363, '竹江乡', 4, 2472), +(20364, '赤谷乡', 4, 2472), +(20365, '金田乡', 4, 2472), +(20366, '钱山乡', 4, 2472), +(20367, '仁和镇', 4, 2473), +(20368, '巴邱镇', 4, 2473), +(20369, '戈坪乡', 4, 2473), +(20370, '桐林乡', 4, 2473), +(20371, '水边镇', 4, 2473), +(20372, '砚溪镇', 4, 2473); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20373, '福民乡', 4, 2473), +(20374, '罗田镇', 4, 2473), +(20375, '金江乡', 4, 2473), +(20376, '马埠镇', 4, 2473), +(20377, '七琴镇', 4, 2474), +(20378, '三湖镇', 4, 2474), +(20379, '城上乡', 4, 2474), +(20380, '大洋洲镇', 4, 2474), +(20381, '桃溪乡', 4, 2474), +(20382, '沂江乡', 4, 2474), +(20383, '溧江乡', 4, 2474), +(20384, '潭丘乡', 4, 2474), +(20385, '界埠乡', 4, 2474), +(20386, '神政桥乡', 4, 2474), +(20387, '荷浦乡', 4, 2474), +(20388, '金川镇', 4, 2474), +(20389, '麦斜镇', 4, 2474), +(20390, '七都乡', 4, 2475), +(20391, '三坊乡', 4, 2475), +(20392, '上固乡', 4, 2475), +(20393, '上溪乡', 4, 2475), +(20394, '中村乡', 4, 2475), +(20395, '佐龙乡', 4, 2475), +(20396, '八江乡', 4, 2475), +(20397, '古县镇', 4, 2475), +(20398, '君埠乡', 4, 2475), +(20399, '坑田镇', 4, 2475), +(20400, '恩江镇', 4, 2475), +(20401, '沙溪镇', 4, 2475), +(20402, '沿陂镇', 4, 2475), +(20403, '潭城乡', 4, 2475), +(20404, '潭头乡', 4, 2475), +(20405, '瑶田镇', 4, 2475), +(20406, '石马镇', 4, 2475), +(20407, '藤田镇', 4, 2475), +(20408, '陶塘乡', 4, 2475), +(20409, '鹿冈乡', 4, 2475), +(20410, '龙冈畲族乡', 4, 2475), +(20411, '三湾乡', 4, 2476), +(20412, '台岭乡', 4, 2476), +(20413, '在中乡', 4, 2476), +(20414, '坳南乡', 4, 2476), +(20415, '埠前镇', 4, 2476), +(20416, '怀忠镇', 4, 2476), +(20417, '才丰乡', 4, 2476), +(20418, '文竹镇', 4, 2476), +(20419, '曲白乡', 4, 2476), +(20420, '沙市镇', 4, 2476), +(20421, '烟阁乡', 4, 2476), +(20422, '石桥镇', 4, 2476), +(20423, '禾川镇', 4, 2476), +(20424, '芦溪乡', 4, 2476), +(20425, '莲洲乡', 4, 2476), +(20426, '象形乡', 4, 2476), +(20427, '里田镇', 4, 2476), +(20428, '高市乡', 4, 2476), +(20429, '高桥楼镇', 4, 2476), +(20430, '高溪乡', 4, 2476), +(20431, '龙源口镇', 4, 2476), +(20432, '龙田乡', 4, 2476), +(20433, '龙门镇', 4, 2476), +(20434, '万合镇', 4, 2477), +(20435, '上圯乡', 4, 2477), +(20436, '上模乡', 4, 2477), +(20437, '中龙乡', 4, 2477); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20438, '冠朝镇', 4, 2477), +(20439, '南溪乡', 4, 2477), +(20440, '塘洲镇', 4, 2477), +(20441, '小龙镇', 4, 2477), +(20442, '桥头镇', 4, 2477), +(20443, '水槎乡', 4, 2477), +(20444, '沙村镇', 4, 2477), +(20445, '沿溪镇', 4, 2477), +(20446, '澄江镇', 4, 2477), +(20447, '灌溪镇', 4, 2477), +(20448, '石山乡', 4, 2477), +(20449, '碧溪镇', 4, 2477), +(20450, '禾市镇', 4, 2477), +(20451, '老营盘镇', 4, 2477), +(20452, '苏溪镇', 4, 2477), +(20453, '苑前镇', 4, 2477), +(20454, '螺溪镇', 4, 2477), +(20455, '马市镇', 4, 2477), +(20456, '五斗江乡', 4, 2478), +(20457, '南江乡', 4, 2478), +(20458, '双桥乡', 4, 2478), +(20459, '堆子前镇', 4, 2478), +(20460, '大坑乡', 4, 2478), +(20461, '大汾镇', 4, 2478), +(20462, '左安镇', 4, 2478), +(20463, '巾石乡', 4, 2478), +(20464, '戴家埔乡', 4, 2478), +(20465, '新江乡', 4, 2478), +(20466, '枚江乡', 4, 2478), +(20467, '汤湖镇', 4, 2478), +(20468, '泉江镇', 4, 2478), +(20469, '珠田乡', 4, 2478), +(20470, '碧洲镇', 4, 2478), +(20471, '禾源镇', 4, 2478), +(20472, '草林镇', 4, 2478), +(20473, '营盘圩乡', 4, 2478), +(20474, '衙前镇', 4, 2478), +(20475, '西溪乡', 4, 2478), +(20476, '雩田镇', 4, 2478), +(20477, '高坪镇', 4, 2478), +(20478, '黄坑乡', 4, 2478), +(20479, '东固畲族乡', 4, 2479), +(20480, '值夏镇', 4, 2479), +(20481, '天玉镇', 4, 2479), +(20482, '富滩镇', 4, 2479), +(20483, '富田镇', 4, 2479), +(20484, '文陂乡', 4, 2479), +(20485, '新圩镇', 4, 2479), +(20486, '河东街道', 4, 2479), +(20487, '三兴镇', 4, 2480), +(20488, '仙源乡', 4, 2480), +(20489, '双桥镇', 4, 2480), +(20490, '岭东乡', 4, 2480), +(20491, '康乐街道', 4, 2480), +(20492, '株潭镇', 4, 2480), +(20493, '潭埠镇', 4, 2480), +(20494, '白水乡', 4, 2480), +(20495, '白良乡', 4, 2480), +(20496, '罗城镇', 4, 2480), +(20497, '茭湖乡', 4, 2480), +(20498, '赤兴乡', 4, 2480), +(20499, '马步乡', 4, 2480), +(20500, '高城乡', 4, 2480), +(20501, '高村镇', 4, 2480), +(20502, '鹅峰乡', 4, 2480); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20503, '黄茅镇', 4, 2480), +(20504, '南港镇', 4, 2481), +(20505, '塔下乡', 4, 2481), +(20506, '徐家渡镇', 4, 2481), +(20507, '敖阳街道', 4, 2481), +(20508, '新界埠乡', 4, 2481), +(20509, '泗溪镇', 4, 2481), +(20510, '田心镇', 4, 2481), +(20511, '翰堂镇', 4, 2481), +(20512, '芦洲乡', 4, 2481), +(20513, '蒙山乡', 4, 2481), +(20514, '野市乡', 4, 2481), +(20515, '锦江镇', 4, 2481), +(20516, '镇渡乡', 4, 2481), +(20517, '上塘镇', 4, 2482), +(20518, '丽村镇', 4, 2482), +(20519, '剑光街道', 4, 2482), +(20520, '剑南街道', 4, 2482), +(20521, '同田乡', 4, 2482), +(20522, '孙渡街道', 4, 2482), +(20523, '小港镇', 4, 2482), +(20524, '尚庄街道', 4, 2482), +(20525, '张巷镇', 4, 2482), +(20526, '拖船镇', 4, 2482), +(20527, '曲江镇', 4, 2482), +(20528, '杜市镇', 4, 2482), +(20529, '桥东镇', 4, 2482), +(20530, '梅林镇', 4, 2482), +(20531, '段潭乡', 4, 2482), +(20532, '河洲街道', 4, 2482), +(20533, '泉港镇', 4, 2482), +(20534, '洛市镇', 4, 2482), +(20535, '淘沙镇', 4, 2482), +(20536, '湖塘乡', 4, 2482), +(20537, '白土镇', 4, 2482), +(20538, '石江乡', 4, 2482), +(20539, '石滩镇', 4, 2482), +(20540, '秀市镇', 4, 2482), +(20541, '筱塘乡', 4, 2482), +(20542, '荣塘镇', 4, 2482), +(20543, '荷湖乡', 4, 2482), +(20544, '董家镇', 4, 2482), +(20545, '蕉坑乡', 4, 2482), +(20546, '袁渡镇', 4, 2482), +(20547, '铁路镇', 4, 2482), +(20548, '隍城镇', 4, 2482), +(20549, '上富镇', 4, 2483), +(20550, '仰山乡', 4, 2483), +(20551, '会埠镇', 4, 2483), +(20552, '冯川镇', 4, 2483), +(20553, '宋埠镇', 4, 2483), +(20554, '干洲镇', 4, 2483), +(20555, '柳溪乡', 4, 2483), +(20556, '澡下镇', 4, 2483), +(20557, '澡溪乡', 4, 2483), +(20558, '甘坊镇', 4, 2483), +(20559, '百丈山名胜风景区', 4, 2483), +(20560, '石溪办事处', 4, 2483), +(20561, '罗市镇', 4, 2483), +(20562, '赤岸镇', 4, 2483), +(20563, '赤田镇', 4, 2483), +(20564, '双峰林场', 4, 2484), +(20565, '同安乡', 4, 2484), +(20566, '天宝乡', 4, 2484); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20567, '新庄镇', 4, 2484), +(20568, '新昌镇', 4, 2484), +(20569, '桥西乡', 4, 2484), +(20570, '棠浦镇', 4, 2484), +(20571, '潭山镇', 4, 2484), +(20572, '澄塘镇', 4, 2484), +(20573, '石市镇', 4, 2484), +(20574, '花桥乡', 4, 2484), +(20575, '芳溪镇', 4, 2484), +(20576, '车上林场', 4, 2484), +(20577, '黄岗乡', 4, 2484), +(20578, '中洲乡', 4, 2485), +(20579, '临江镇', 4, 2485), +(20580, '义成镇', 4, 2485), +(20581, '刘公庙镇', 4, 2485), +(20582, '吴城乡', 4, 2485), +(20583, '城北街道', 4, 2485), +(20584, '大桥街道', 4, 2485), +(20585, '店下镇', 4, 2485), +(20586, '昌付镇', 4, 2485), +(20587, '永泰镇', 4, 2485), +(20588, '洋湖乡', 4, 2485), +(20589, '洲上乡', 4, 2485), +(20590, '淦阳街道', 4, 2485), +(20591, '福城街道', 4, 2485), +(20592, '经楼镇', 4, 2485), +(20593, '观上镇', 4, 2485), +(20594, '阁山镇', 4, 2485), +(20595, '鹿江街道', 4, 2485), +(20596, '黄土岗镇', 4, 2485), +(20597, '三阳镇', 4, 2486), +(20598, '下浦街道', 4, 2486), +(20599, '凤凰街道', 4, 2486), +(20600, '化成街道', 4, 2486), +(20601, '南庙乡', 4, 2486), +(20602, '天台镇', 4, 2486), +(20603, '官园街道', 4, 2486), +(20604, '寨下乡', 4, 2486), +(20605, '彬江镇', 4, 2486), +(20606, '慈化镇', 4, 2486), +(20607, '新坊乡', 4, 2486), +(20608, '新田乡', 4, 2486), +(20609, '柏木乡', 4, 2486), +(20610, '楠木乡', 4, 2486), +(20611, '水江乡', 4, 2486), +(20612, '洪塘镇', 4, 2486), +(20613, '洪江乡', 4, 2486), +(20614, '渥江乡', 4, 2486), +(20615, '温汤镇', 4, 2486), +(20616, '湖田乡', 4, 2486), +(20617, '湛郎街道', 4, 2486), +(20618, '灵泉街道', 4, 2486), +(20619, '珠泉街道', 4, 2486), +(20620, '秀江街道', 4, 2486), +(20621, '竹亭乡', 4, 2486), +(20622, '芦村乡', 4, 2486), +(20623, '西村镇', 4, 2486), +(20624, '绕市乡', 4, 2486), +(20625, '金园街道', 4, 2486), +(20626, '金瑞镇', 4, 2486), +(20627, '飞剑潭乡', 4, 2486), +(20628, '三都镇', 4, 2487), +(20629, '大段镇', 4, 2487), +(20630, '带溪乡', 4, 2487); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20631, '排埠镇', 4, 2487), +(20632, '棋坪镇', 4, 2487), +(20633, '永宁镇', 4, 2487), +(20634, '温泉镇', 4, 2487), +(20635, '港口乡', 4, 2487), +(20636, '高桥乡', 4, 2487), +(20637, '三爪仑乡', 4, 2488), +(20638, '中源乡', 4, 2488), +(20639, '仁首镇', 4, 2488), +(20640, '双溪镇', 4, 2488), +(20641, '宝峰镇', 4, 2488), +(20642, '水口乡', 4, 2488), +(20643, '罗湾乡', 4, 2488), +(20644, '躁都镇', 4, 2488), +(20645, '雷公尖乡', 4, 2488), +(20646, '香田乡', 4, 2488), +(20647, '高湖镇', 4, 2488), +(20648, '上湖乡', 4, 2489), +(20649, '伍桥镇', 4, 2489), +(20650, '八景镇', 4, 2489), +(20651, '大城镇', 4, 2489), +(20652, '太阳镇', 4, 2489), +(20653, '建山镇', 4, 2489), +(20654, '新街镇', 4, 2489), +(20655, '村前镇', 4, 2489), +(20656, '杨圩镇', 4, 2489), +(20657, '汪家圩乡', 4, 2489), +(20658, '灰埠镇', 4, 2489), +(20659, '独城镇', 4, 2489), +(20660, '瑞州街道', 4, 2489), +(20661, '田南镇', 4, 2489), +(20662, '相城镇', 4, 2489), +(20663, '石脑镇', 4, 2489), +(20664, '祥符镇', 4, 2489), +(20665, '筠阳街道', 4, 2489), +(20666, '荷岭镇', 4, 2489), +(20667, '蓝坊镇', 4, 2489), +(20668, '黄沙岗镇', 4, 2489), +(20669, '龙潭镇', 4, 2489), +(20670, '圩上桥镇', 4, 2490), +(20671, '孝岗镇', 4, 2490), +(20672, '小璜镇', 4, 2490), +(20673, '岗上积镇', 4, 2490), +(20674, '杨桥殿镇', 4, 2490), +(20675, '王桥镇', 4, 2490), +(20676, '珀玕乡', 4, 2490), +(20677, '瑶圩乡', 4, 2490), +(20678, '虎圩乡', 4, 2490), +(20679, '詹圩镇', 4, 2490), +(20680, '邓家乡', 4, 2490), +(20681, '马圩镇', 4, 2490), +(20682, '黎圩镇', 4, 2490), +(20683, '七里岗乡', 4, 2491), +(20684, '上顿渡镇', 4, 2491), +(20685, '东馆镇', 4, 2491), +(20686, '云山镇', 4, 2491), +(20687, '六水桥街道', 4, 2491), +(20688, '唱凯镇', 4, 2491), +(20689, '城西街道', 4, 2491), +(20690, '大岗镇', 4, 2491), +(20691, '太阳镇', 4, 2491), +(20692, '孝桥镇', 4, 2491), +(20693, '展坪乡', 4, 2491), +(20694, '崇岗镇', 4, 2491); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20695, '嵩湖乡', 4, 2491), +(20696, '抚北镇', 4, 2491), +(20697, '文昌街道', 4, 2491), +(20698, '桐源乡', 4, 2491), +(20699, '河埠乡', 4, 2491), +(20700, '温泉镇', 4, 2491), +(20701, '湖南乡', 4, 2491), +(20702, '秋溪镇', 4, 2491), +(20703, '罗湖镇', 4, 2491), +(20704, '罗针镇', 4, 2491), +(20705, '腾桥镇', 4, 2491), +(20706, '茅排乡', 4, 2491), +(20707, '荆公路街道', 4, 2491), +(20708, '荣山镇', 4, 2491), +(20709, '西大街街道', 4, 2491), +(20710, '连城乡', 4, 2491), +(20711, '钟岭街道', 4, 2491), +(20712, '青云街道', 4, 2491), +(20713, '青泥镇', 4, 2491), +(20714, '高坪镇', 4, 2491), +(20715, '鹏田乡', 4, 2491), +(20716, '龙溪镇', 4, 2491), +(20717, '万崇镇', 4, 2492), +(20718, '公溪镇', 4, 2492), +(20719, '南村乡', 4, 2492), +(20720, '增田镇', 4, 2492), +(20721, '山砀镇', 4, 2492), +(20722, '戴坊镇', 4, 2492), +(20723, '招携镇', 4, 2492), +(20724, '湖坪乡', 4, 2492), +(20725, '湖溪乡', 4, 2492), +(20726, '牛田镇', 4, 2492), +(20727, '罗陂乡', 4, 2492), +(20728, '谷岗乡', 4, 2492), +(20729, '金竹畲族乡', 4, 2492), +(20730, '鳌溪镇', 4, 2492), +(20731, '龚坊镇', 4, 2492), +(20732, '三溪乡', 4, 2493), +(20733, '东坪乡', 4, 2493), +(20734, '傅坊乡', 4, 2493), +(20735, '太和镇', 4, 2493), +(20736, '太源乡', 4, 2493), +(20737, '市山镇', 4, 2493), +(20738, '桑田镇', 4, 2493), +(20739, '洽湾镇', 4, 2493), +(20740, '琴城镇', 4, 2493), +(20741, '白舍镇', 4, 2493), +(20742, '紫霄镇', 4, 2493), +(20743, '莱溪乡', 4, 2493), +(20744, '万坊镇', 4, 2494), +(20745, '上唐镇', 4, 2494), +(20746, '天井源乡', 4, 2494), +(20747, '建昌镇', 4, 2494), +(20748, '徐家乡', 4, 2494), +(20749, '新丰街镇', 4, 2494), +(20750, '株良镇', 4, 2494), +(20751, '沙洲镇', 4, 2494), +(20752, '洪门镇', 4, 2494), +(20753, '浔溪乡', 4, 2494), +(20754, '里塔镇', 4, 2494), +(20755, '龙湖镇', 4, 2494), +(20756, '东陂镇', 4, 2495), +(20757, '中港乡', 4, 2495), +(20758, '二都镇', 4, 2495), +(20759, '凤冈镇', 4, 2495); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20760, '南源乡', 4, 2495), +(20761, '圳口乡', 4, 2495), +(20762, '新丰乡', 4, 2495), +(20763, '桃陂乡', 4, 2495), +(20764, '梨溪镇', 4, 2495), +(20765, '棠阴镇', 4, 2495), +(20766, '神冈乡', 4, 2495), +(20767, '黄陂镇', 4, 2495), +(20768, '三山乡', 4, 2496), +(20769, '六家桥乡', 4, 2496), +(20770, '孙坊镇', 4, 2496), +(20771, '巴山镇', 4, 2496), +(20772, '桃源乡', 4, 2496), +(20773, '河上镇', 4, 2496), +(20774, '白陂乡', 4, 2496), +(20775, '白鹭乡', 4, 2496), +(20776, '相山镇', 4, 2496), +(20777, '石庄乡', 4, 2496), +(20778, '礼陂镇', 4, 2496), +(20779, '航埠镇', 4, 2496), +(20780, '许坊乡', 4, 2496), +(20781, '郭圩乡', 4, 2496), +(20782, '马鞍镇', 4, 2496), +(20783, '千善乡', 4, 2497), +(20784, '塘坊乡', 4, 2497), +(20785, '头陂镇', 4, 2497), +(20786, '尖峰乡', 4, 2497), +(20787, '杨溪乡', 4, 2497), +(20788, '水南圩乡', 4, 2497), +(20789, '甘竹镇', 4, 2497), +(20790, '盱江镇', 4, 2497), +(20791, '赤水镇', 4, 2497), +(20792, '长桥乡', 4, 2497), +(20793, '驿前镇', 4, 2497), +(20794, '乌石镇', 4, 2498), +(20795, '嵩市镇', 4, 2498), +(20796, '石峡乡', 4, 2498), +(20797, '马头山镇', 4, 2498), +(20798, '高埠镇', 4, 2498), +(20799, '高田乡', 4, 2498), +(20800, '鹤城镇', 4, 2498), +(20801, '何源镇', 4, 2499), +(20802, '双塘镇', 4, 2499), +(20803, '合市镇', 4, 2499), +(20804, '对桥乡', 4, 2499), +(20805, '左坊镇', 4, 2499), +(20806, '浒湾镇', 4, 2499), +(20807, '琅琚镇', 4, 2499), +(20808, '琉璃乡', 4, 2499), +(20809, '石门乡', 4, 2499), +(20810, '秀谷镇', 4, 2499), +(20811, '陆坊乡', 4, 2499), +(20812, '陈坊积乡', 4, 2499), +(20813, '黄通乡', 4, 2499), +(20814, '中田乡', 4, 2500), +(20815, '厚村乡', 4, 2500), +(20816, '宏村镇', 4, 2500), +(20817, '德胜镇', 4, 2500), +(20818, '日峰镇', 4, 2500), +(20819, '樟溪乡', 4, 2500), +(20820, '洵口镇', 4, 2500), +(20821, '湖坊乡', 4, 2500), +(20822, '潭溪乡', 4, 2500), +(20823, '熊村镇', 4, 2500), +(20824, '社苹乡', 4, 2500), +(20825, '荷源乡', 4, 2500); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20826, '西城乡', 4, 2500), +(20827, '龙安镇', 4, 2500), +(20828, '上坊乡', 4, 2501), +(20829, '南溪乡', 4, 2501), +(20830, '大源镇', 4, 2501), +(20831, '大黄乡', 4, 2501), +(20832, '梓埠镇', 4, 2501), +(20833, '汪家乡', 4, 2501), +(20834, '湖云乡', 4, 2501), +(20835, '珠山乡', 4, 2501), +(20836, '珠田乡', 4, 2501), +(20837, '石镇镇', 4, 2501), +(20838, '苏桥乡', 4, 2501), +(20839, '裴梅镇', 4, 2501), +(20840, '陈营镇', 4, 2501), +(20841, '青云镇', 4, 2501), +(20842, '齐埠乡', 4, 2501), +(20843, '上泸镇', 4, 2502), +(20844, '五府山镇', 4, 2502), +(20845, '华坛山镇', 4, 2502), +(20846, '四十八镇', 4, 2502), +(20847, '大地乡', 4, 2502), +(20848, '尊桥乡', 4, 2502), +(20849, '应家乡', 4, 2502), +(20850, '旭日工业园区(开发区)', 4, 2502), +(20851, '旭日镇', 4, 2502), +(20852, '望仙乡', 4, 2502), +(20853, '枫岭头镇', 4, 2502), +(20854, '清水乡', 4, 2502), +(20855, '湖村乡', 4, 2502), +(20856, '煌固镇', 4, 2502), +(20857, '田墩镇', 4, 2502), +(20858, '皂头镇', 4, 2502), +(20859, '石人乡', 4, 2502), +(20860, '石狮乡', 4, 2502), +(20861, '花厅镇', 4, 2502), +(20862, '茶亭镇', 4, 2502), +(20863, '董团乡', 4, 2502), +(20864, '郑坊镇', 4, 2502), +(20865, '铁山乡', 4, 2502), +(20866, '黄市乡', 4, 2502), +(20867, '黄沙岭乡', 4, 2502), +(20868, '三塘乡', 4, 2503), +(20869, '东塘乡', 4, 2503), +(20870, '乌泥镇', 4, 2503), +(20871, '九龙乡', 4, 2503), +(20872, '古埠镇', 4, 2503), +(20873, '大塘乡', 4, 2503), +(20874, '大溪乡', 4, 2503), +(20875, '康山乡', 4, 2503), +(20876, '杨埠乡', 4, 2503), +(20877, '枫港乡', 4, 2503), +(20878, '梅港乡', 4, 2503), +(20879, '江埠乡', 4, 2503), +(20880, '洪家嘴乡', 4, 2503), +(20881, '玉亭镇', 4, 2503), +(20882, '瑞洪镇', 4, 2503), +(20883, '白马桥乡', 4, 2503), +(20884, '石口镇', 4, 2503), +(20885, '社庚乡', 4, 2503), +(20886, '鹭鸶港乡', 4, 2503), +(20887, '黄金埠镇', 4, 2503), +(20888, '三江工业基地', 4, 2504), +(20889, '东市街道', 4, 2504); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20890, '凤凰工业园区', 4, 2504), +(20891, '北门街道', 4, 2504), +(20892, '朝阳乡', 4, 2504), +(20893, '水南街道', 4, 2504), +(20894, '沙溪镇', 4, 2504), +(20895, '灵溪镇', 4, 2504), +(20896, '秦峰乡', 4, 2504), +(20897, '茅家岭街道', 4, 2504), +(20898, '西市街道', 4, 2504), +(20899, '中云镇', 4, 2505), +(20900, '古坦乡', 4, 2505), +(20901, '大鄣山乡', 4, 2505), +(20902, '太白镇', 4, 2505), +(20903, '思口镇', 4, 2505), +(20904, '段莘乡', 4, 2505), +(20905, '江湾镇', 4, 2505), +(20906, '沱川乡', 4, 2505), +(20907, '浙源乡', 4, 2505), +(20908, '清华镇', 4, 2505), +(20909, '溪头乡', 4, 2505), +(20910, '珍珠山乡', 4, 2505), +(20911, '甲路乡', 4, 2505), +(20912, '秋口镇', 4, 2505), +(20913, '紫阳镇', 4, 2505), +(20914, '许村镇', 4, 2505), +(20915, '赋春镇', 4, 2505), +(20916, '镇头镇', 4, 2505), +(20917, '下溪镇', 4, 2506), +(20918, '五都镇', 4, 2506), +(20919, '吴村镇', 4, 2506), +(20920, '塘墀乡', 4, 2506), +(20921, '壶峤镇', 4, 2506), +(20922, '大南镇', 4, 2506), +(20923, '大石乡', 4, 2506), +(20924, '少阳乡', 4, 2506), +(20925, '岭底乡', 4, 2506), +(20926, '嵩峰乡', 4, 2506), +(20927, '排山镇', 4, 2506), +(20928, '枧底镇', 4, 2506), +(20929, '桐畈镇', 4, 2506), +(20930, '横山镇', 4, 2506), +(20931, '毛村镇', 4, 2506), +(20932, '永丰镇', 4, 2506), +(20933, '沙田镇', 4, 2506), +(20934, '泉波镇', 4, 2506), +(20935, '洋口镇', 4, 2506), +(20936, '湖丰镇', 4, 2506), +(20937, '社后乡', 4, 2506), +(20938, '管村乡', 4, 2506), +(20939, '芦林工业园区管理委员会', 4, 2506), +(20940, '铜钹山垦殖场', 4, 2506), +(20941, '霞峰镇', 4, 2506), +(20942, '三县岭乡', 4, 2507), +(20943, '中畈乡', 4, 2507), +(20944, '南岩镇', 4, 2507), +(20945, '叠山镇', 4, 2507), +(20946, '圭峰镇', 4, 2507), +(20947, '弋江镇', 4, 2507), +(20948, '旭光乡', 4, 2507), +(20949, '曹溪镇', 4, 2507), +(20950, '朱坑镇', 4, 2507), +(20951, '樟树墩镇', 4, 2507), +(20952, '清湖乡', 4, 2507), +(20953, '港口镇', 4, 2507); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(20954, '湾里乡', 4, 2507), +(20955, '漆工镇', 4, 2507), +(20956, '烈桥乡', 4, 2507), +(20957, '箭竹乡', 4, 2507), +(20958, '花亭乡', 4, 2507), +(20959, '葛溪乡', 4, 2507), +(20960, '万村乡', 4, 2508), +(20961, '张村乡', 4, 2508), +(20962, '新岗山镇', 4, 2508), +(20963, '李宅乡', 4, 2508), +(20964, '泗洲镇', 4, 2508), +(20965, '海口镇', 4, 2508), +(20966, '皈大乡', 4, 2508), +(20967, '绕二镇', 4, 2508), +(20968, '花桥镇', 4, 2508), +(20969, '银城镇', 4, 2508), +(20970, '黄柏乡', 4, 2508), +(20971, '龙头山乡', 4, 2508), +(20972, '司铺乡', 4, 2509), +(20973, '姚家乡', 4, 2509), +(20974, '岑阳镇', 4, 2509), +(20975, '新篁乡', 4, 2509), +(20976, '港边乡', 4, 2509), +(20977, '莲荷乡', 4, 2509), +(20978, '葛源镇', 4, 2509), +(20979, '青板乡', 4, 2509), +(20980, '龙门畈乡', 4, 2509), +(20981, '三清乡(三清山风景名胜区)', 4, 2510), +(20982, '三清山风景区林场', 4, 2510), +(20983, '下塘乡', 4, 2510), +(20984, '下镇镇', 4, 2510), +(20985, '临湖镇', 4, 2510), +(20986, '仙岩镇', 4, 2510), +(20987, '六都乡', 4, 2510), +(20988, '冰溪镇', 4, 2510), +(20989, '华村乡', 4, 2510), +(20990, '南山乡', 4, 2510), +(20991, '双明镇', 4, 2510), +(20992, '四股桥乡', 4, 2510), +(20993, '岩瑞镇', 4, 2510), +(20994, '必姆镇', 4, 2510), +(20995, '怀玉乡', 4, 2510), +(20996, '文成镇', 4, 2510), +(20997, '樟村镇', 4, 2510), +(20998, '横街镇', 4, 2510), +(20999, '白云镇', 4, 2510), +(21000, '紫湖镇', 4, 2510), +(21001, '金山工业园', 4, 2510), +(21002, '乐丰镇', 4, 2511), +(21003, '侯家岗乡', 4, 2511), +(21004, '凰岗镇', 4, 2511), +(21005, '双港镇', 4, 2511), +(21006, '古南乡', 4, 2511), +(21007, '古县渡镇', 4, 2511), +(21008, '响水滩乡', 4, 2511), +(21009, '四十里街镇', 4, 2511), +(21010, '团林乡', 4, 2511), +(21011, '庙前乡', 4, 2511), +(21012, '昌洲乡', 4, 2511), +(21013, '枧田街乡', 4, 2511), +(21014, '柘港乡', 4, 2511), +(21015, '桐山乡', 4, 2511), +(21016, '桥头街乡', 4, 2511); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21017, '油墩街镇', 4, 2511), +(21018, '游城乡', 4, 2511), +(21019, '珠湖乡', 4, 2511), +(21020, '田畈街镇', 4, 2511), +(21021, '白沙洲乡', 4, 2511), +(21022, '石门街镇', 4, 2511), +(21023, '肖家岭乡', 4, 2511), +(21024, '芦田乡', 4, 2511), +(21025, '莲山乡', 4, 2511), +(21026, '莲湖乡', 4, 2511), +(21027, '莲花山乡', 4, 2511), +(21028, '谢家滩镇', 4, 2511), +(21029, '鄱阳镇', 4, 2511), +(21030, '金盘岭镇', 4, 2511), +(21031, '银宝湖乡', 4, 2511), +(21032, '饶丰镇', 4, 2511), +(21033, '饶埠镇', 4, 2511), +(21034, '高家岭镇', 4, 2511), +(21035, '鸦鹊湖乡', 4, 2511), +(21036, '天柱山乡', 4, 2512), +(21037, '太源畲族乡', 4, 2512), +(21038, '新滩乡', 4, 2512), +(21039, '武夷山镇', 4, 2512), +(21040, '永平镇', 4, 2512), +(21041, '汪二镇', 4, 2512), +(21042, '河口镇', 4, 2512), +(21043, '湖坊镇', 4, 2512), +(21044, '石塘镇', 4, 2512), +(21045, '稼轩乡', 4, 2512), +(21046, '篁碧畲族乡', 4, 2512), +(21047, '紫溪乡', 4, 2512), +(21048, '英将乡', 4, 2512), +(21049, '葛仙山乡', 4, 2512), +(21050, '虹桥乡', 4, 2512), +(21051, '陈坊乡', 4, 2512), +(21052, '鹅湖镇', 4, 2512), +(21053, '东关街道', 4, 2513), +(21054, '东门街道', 4, 2513), +(21055, '司里街街道', 4, 2513), +(21056, '和平路街道', 4, 2513), +(21057, '姚家街道', 4, 2513), +(21058, '建新街道', 4, 2513), +(21059, '文东街道', 4, 2513), +(21060, '智远街道', 4, 2513), +(21061, '泉城路街道', 4, 2513), +(21062, '甸柳街道', 4, 2513), +(21063, '解放路街道', 4, 2513), +(21064, '趵突泉街道', 4, 2513), +(21065, '龙洞街道', 4, 2513), +(21066, '东风街道', 4, 2514), +(21067, '仲宫镇', 4, 2514), +(21068, '全福街道', 4, 2514), +(21069, '华山镇', 4, 2514), +(21070, '唐王镇', 4, 2514), +(21071, '孙村镇', 4, 2514), +(21072, '山大路街道', 4, 2514), +(21073, '彩石乡', 4, 2514), +(21074, '柳埠镇', 4, 2514), +(21075, '洪家楼街道', 4, 2514), +(21076, '港沟镇', 4, 2514), +(21077, '王舍人镇', 4, 2514); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21078, '董家镇', 4, 2514), +(21079, '西营镇', 4, 2514), +(21080, '遥墙镇', 4, 2514), +(21081, '郭店镇', 4, 2514), +(21082, '锦绣川乡', 4, 2514), +(21083, '高而乡', 4, 2514), +(21084, '孙集', 4, 2515), +(21085, '张坊', 4, 2515), +(21086, '怀仁', 4, 2515), +(21087, '殷巷', 4, 2515), +(21088, '沙河', 4, 2515), +(21089, '玉皇庙街道办事处', 4, 2515), +(21090, '白桥', 4, 2515), +(21091, '许商街道办事处', 4, 2515), +(21092, '贾庄', 4, 2515), +(21093, '郑路', 4, 2515), +(21094, '韩庙', 4, 2515), +(21095, '龙桑寺', 4, 2515), +(21096, '制锦市街道', 4, 2516), +(21097, '北园街道', 4, 2516), +(21098, '北坦街街道', 4, 2516), +(21099, '堤口路街道', 4, 2516), +(21100, '大桥镇', 4, 2516), +(21101, '天桥东街街道', 4, 2516), +(21102, '官扎营街道', 4, 2516), +(21103, '宝华街街道', 4, 2516), +(21104, '工人新村北村街道', 4, 2516), +(21105, '工人新村南村街道', 4, 2516), +(21106, '无影山街道', 4, 2516), +(21107, '桑梓店镇', 4, 2516), +(21108, '泺口街道', 4, 2516), +(21109, '纬北路街道', 4, 2516), +(21110, '药山街道', 4, 2516), +(21111, '七贤街道', 4, 2517), +(21112, '七里山街道', 4, 2517), +(21113, '二七街道', 4, 2517), +(21114, '党家街道', 4, 2517), +(21115, '六里山街道', 4, 2517), +(21116, '兴隆街道', 4, 2517), +(21117, '十六里河街道', 4, 2517), +(21118, '四里村街道', 4, 2517), +(21119, '大观园街道', 4, 2517), +(21120, '杆石桥街道', 4, 2517), +(21121, '泺源街道', 4, 2517), +(21122, '王官庄街道', 4, 2517), +(21123, '白马山街道', 4, 2517), +(21124, '舜玉路街道', 4, 2517), +(21125, '舜耕街道', 4, 2517), +(21126, '陡沟街道', 4, 2517), +(21127, '魏家庄街道', 4, 2517), +(21128, '东阿镇', 4, 2518), +(21129, '孔村镇', 4, 2518), +(21130, '孝直镇', 4, 2518), +(21131, '安城乡', 4, 2518), +(21132, '平阴镇', 4, 2518), +(21133, '洪范池镇', 4, 2518), +(21134, '玫瑰镇', 4, 2518), +(21135, '中大槐树街道', 4, 2519), +(21136, '五里沟街道', 4, 2519); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21137, '匡山街道', 4, 2519), +(21138, '南辛庄街道', 4, 2519), +(21139, '吴家堡镇', 4, 2519), +(21140, '张庄路街道', 4, 2519), +(21141, '振兴街街道', 4, 2519), +(21142, '段店北路街道', 4, 2519), +(21143, '段店镇', 4, 2519), +(21144, '美里湖街道', 4, 2519), +(21145, '营市街街道', 4, 2519), +(21146, '西市场街道', 4, 2519), +(21147, '道德街街道', 4, 2519), +(21148, '青年公园街道', 4, 2519), +(21149, '二太平镇', 4, 2520), +(21150, '仁风镇', 4, 2520), +(21151, '垛石镇', 4, 2520), +(21152, '孙耿镇', 4, 2520), +(21153, '崔寨镇', 4, 2520), +(21154, '新市镇', 4, 2520), +(21155, '曲堤镇', 4, 2520), +(21156, '济阳镇', 4, 2520), +(21157, '刁镇', 4, 2521), +(21158, '双山街道', 4, 2521), +(21159, '圣井街道', 4, 2521), +(21160, '垛庄镇', 4, 2521), +(21161, '埠村街道', 4, 2521), +(21162, '宁家埠镇', 4, 2521), +(21163, '官庄乡', 4, 2521), +(21164, '文祖镇', 4, 2521), +(21165, '明水街道', 4, 2521), +(21166, '普集镇', 4, 2521), +(21167, '曹范镇', 4, 2521), +(21168, '枣园街道', 4, 2521), +(21169, '水寨镇', 4, 2521), +(21170, '白云湖镇', 4, 2521), +(21171, '相公庄镇', 4, 2521), +(21172, '绣惠镇', 4, 2521), +(21173, '辛寨乡', 4, 2521), +(21174, '高官寨镇', 4, 2521), +(21175, '黄河乡', 4, 2521), +(21176, '龙山街道', 4, 2521), +(21177, '万德镇', 4, 2522), +(21178, '五峰山街道', 4, 2522), +(21179, '双泉乡', 4, 2522), +(21180, '孝里镇', 4, 2522), +(21181, '崮云湖街道', 4, 2522), +(21182, '平安街道', 4, 2522), +(21183, '张夏镇', 4, 2522), +(21184, '归德镇', 4, 2522), +(21185, '文昌街道', 4, 2522), +(21186, '武家庄乡', 4, 2522), +(21187, '马山镇', 4, 2522), +(21188, '七级镇', 4, 2523), +(21189, '丰城镇', 4, 2523), +(21190, '刘家庄镇', 4, 2523), +(21191, '北安街道', 4, 2523), +(21192, '华山镇', 4, 2523), +(21193, '南泉镇', 4, 2523), +(21194, '大信镇', 4, 2523), +(21195, '岙山卫镇', 4, 2523), +(21196, '店集镇', 4, 2523), +(21197, '普东镇', 4, 2523); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21198, '段泊岚镇', 4, 2523), +(21199, '温泉镇', 4, 2523), +(21200, '潮海街道', 4, 2523), +(21201, '灵山镇', 4, 2523), +(21202, '王村镇', 4, 2523), +(21203, '环秀街道', 4, 2523), +(21204, '田横镇', 4, 2523), +(21205, '移风店镇', 4, 2523), +(21206, '蓝村镇', 4, 2523), +(21207, '通济街道', 4, 2523), +(21208, '金口镇', 4, 2523), +(21209, '龙山街道', 4, 2523), +(21210, '龙泉镇', 4, 2523), +(21211, '兴隆路街道', 4, 2524), +(21212, '嘉兴路街道', 4, 2524), +(21213, '水清沟街道', 4, 2524), +(21214, '河西街道', 4, 2524), +(21215, '洛阳路街道', 4, 2524), +(21216, '海伦路街道', 4, 2524), +(21217, '阜新路街道', 4, 2524), +(21218, '上马街道', 4, 2525), +(21219, '城阳街道', 4, 2525), +(21220, '夏庄街道', 4, 2525), +(21221, '惜福街道', 4, 2525), +(21222, '棘洪滩街道', 4, 2525), +(21223, '河套街道', 4, 2525), +(21224, '流亭街道', 4, 2525), +(21225, '红岛街道', 4, 2525), +(21226, '中韩街道', 4, 2526), +(21227, '北宅街道', 4, 2526), +(21228, '沙子口街道', 4, 2526), +(21229, '王哥庄街道', 4, 2526), +(21230, '冠县路街道', 4, 2527), +(21231, '利津路街道', 4, 2527), +(21232, '北仲路街道', 4, 2527), +(21233, '华阳路街道', 4, 2527), +(21234, '合肥路街道', 4, 2527), +(21235, '威海路街道', 4, 2527), +(21236, '宁夏路街道', 4, 2527), +(21237, '延安路街道', 4, 2527), +(21238, '敦化路街道', 4, 2527), +(21239, '泰山路街道', 4, 2527), +(21240, '热河路街道', 4, 2527), +(21241, '登州路街道', 4, 2527), +(21242, '胶州路街道', 4, 2527), +(21243, '辽宁路街道', 4, 2527), +(21244, '辽源路街道', 4, 2527), +(21245, '黄台路街道', 4, 2527), +(21246, '中山路街道', 4, 2528), +(21247, '云南路街道', 4, 2528), +(21248, '八大关街道', 4, 2528), +(21249, '八大峡街道', 4, 2528), +(21250, '八大湖街道', 4, 2528), +(21251, '台西街道', 4, 2528), +(21252, '江苏路街道', 4, 2528), +(21253, '浮山街道', 4, 2528), +(21254, '湛山街道', 4, 2528); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21255, '珠海路街道', 4, 2528), +(21256, '观海路街道', 4, 2528), +(21257, '金口路街道', 4, 2528), +(21258, '金湖路街道', 4, 2528), +(21259, '金门路街道', 4, 2528), +(21260, '万家镇', 4, 2529), +(21261, '云山镇', 4, 2529), +(21262, '仁兆镇', 4, 2529), +(21263, '兰底镇', 4, 2529), +(21264, '南村镇', 4, 2529), +(21265, '古岘镇', 4, 2529), +(21266, '同和街道', 4, 2529), +(21267, '城关街道', 4, 2529), +(21268, '大泽山镇', 4, 2529), +(21269, '大田镇', 4, 2529), +(21270, '崔召镇', 4, 2529), +(21271, '崔家集镇', 4, 2529), +(21272, '店子镇', 4, 2529), +(21273, '张戈庄镇', 4, 2529), +(21274, '张舍镇', 4, 2529), +(21275, '新河镇', 4, 2529), +(21276, '旧店镇', 4, 2529), +(21277, '明村镇', 4, 2529), +(21278, '李园街道', 4, 2529), +(21279, '灰埠镇', 4, 2529), +(21280, '田庄镇', 4, 2529), +(21281, '白埠镇', 4, 2529), +(21282, '祝沟镇', 4, 2529), +(21283, '蓼兰镇', 4, 2529), +(21284, '郭庄镇', 4, 2529), +(21285, '长乐镇', 4, 2529), +(21286, '门村镇', 4, 2529), +(21287, '香店街道', 4, 2529), +(21288, '马戈庄镇', 4, 2529), +(21289, '麻兰镇', 4, 2529), +(21290, '九水路街道', 4, 2530), +(21291, '兴华路街道', 4, 2530), +(21292, '兴城路街道', 4, 2530), +(21293, '振华路街道', 4, 2530), +(21294, '李村街道', 4, 2530), +(21295, '楼山街道', 4, 2530), +(21296, '永安路街道', 4, 2530), +(21297, '永清路街道', 4, 2530), +(21298, '浮山路街道', 4, 2530), +(21299, '湘潭路街道', 4, 2530), +(21300, '虎山路街道', 4, 2530), +(21301, '六汪镇', 4, 2531), +(21302, '大场镇', 4, 2531), +(21303, '大村镇', 4, 2531), +(21304, '宝山镇', 4, 2531), +(21305, '张家楼镇', 4, 2531), +(21306, '泊里镇', 4, 2531), +(21307, '海青镇', 4, 2531), +(21308, '滨海街道办事处', 4, 2531), +(21309, '灵山卫街道办事处', 4, 2531), +(21310, '王台镇', 4, 2531), +(21311, '珠山街道办事处', 4, 2531), +(21312, '珠海街道办事处', 4, 2531), +(21313, '琅玡台度假区', 4, 2531), +(21314, '琅玡镇', 4, 2531); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21315, '理务关镇', 4, 2531), +(21316, '积米崖港区', 4, 2531), +(21317, '经济技术开发区', 4, 2531), +(21318, '胶河经济区', 4, 2531), +(21319, '藏南镇', 4, 2531), +(21320, '铁山街道办事处', 4, 2531), +(21321, '隐珠街道办事处', 4, 2531), +(21322, '黄山经济区', 4, 2531), +(21323, '中云街道', 4, 2532), +(21324, '九龙镇', 4, 2532), +(21325, '云溪街道', 4, 2532), +(21326, '北关街道', 4, 2532), +(21327, '南关街道', 4, 2532), +(21328, '张应镇', 4, 2532), +(21329, '李哥庄镇', 4, 2532), +(21330, '杜村镇', 4, 2532), +(21331, '洋河镇', 4, 2532), +(21332, '胶东镇', 4, 2532), +(21333, '胶北镇', 4, 2532), +(21334, '胶莱镇', 4, 2532), +(21335, '胶西镇', 4, 2532), +(21336, '营海镇', 4, 2532), +(21337, '里岔镇', 4, 2532), +(21338, '铺集镇', 4, 2532), +(21339, '阜安街道', 4, 2532), +(21340, '马店镇', 4, 2532), +(21341, '南墅镇', 4, 2533), +(21342, '夏格庄镇', 4, 2533), +(21343, '姜山镇', 4, 2533), +(21344, '孙受镇', 4, 2533), +(21345, '店埠镇', 4, 2533), +(21346, '日庄镇', 4, 2533), +(21347, '望城街道', 4, 2533), +(21348, '李权庄镇', 4, 2533), +(21349, '梅花山街道', 4, 2533), +(21350, '武备镇', 4, 2533), +(21351, '水集街道', 4, 2533), +(21352, '河头店镇', 4, 2533), +(21353, '沽河街道', 4, 2533), +(21354, '院上镇', 4, 2533), +(21355, '马连庄镇', 4, 2533), +(21356, '龙水街道', 4, 2533), +(21357, '柳花泊街道', 4, 2534), +(21358, '红石崖街道', 4, 2534), +(21359, '薛家岛街道', 4, 2534), +(21360, '辛安街街道', 4, 2534), +(21361, '长江路街道', 4, 2534), +(21362, '黄岛街道', 4, 2534), +(21363, '凤凰镇', 4, 2535), +(21364, '南王镇', 4, 2535), +(21365, '敬仲镇', 4, 2535), +(21366, '朱台镇', 4, 2535), +(21367, '梧台镇', 4, 2535), +(21368, '皇城镇', 4, 2535), +(21369, '稷下街道', 4, 2535), +(21370, '辛店街道', 4, 2535), +(21371, '边河乡', 4, 2535), +(21372, '金岭镇', 4, 2535), +(21373, '闻韶街道', 4, 2535), +(21374, '雪宫街道', 4, 2535), +(21375, '齐都镇', 4, 2535); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21376, '齐陵街道', 4, 2535), +(21377, '八陡镇', 4, 2536), +(21378, '北博山镇', 4, 2536), +(21379, '南博山镇', 4, 2536), +(21380, '城东街道', 4, 2536), +(21381, '城西街道', 4, 2536), +(21382, '域城镇', 4, 2536), +(21383, '夏家庄镇', 4, 2536), +(21384, '山头镇', 4, 2536), +(21385, '崮山镇', 4, 2536), +(21386, '池上镇', 4, 2536), +(21387, '源泉镇', 4, 2536), +(21388, '白塔镇', 4, 2536), +(21389, '石马镇', 4, 2536), +(21390, '丝绸路街道', 4, 2537), +(21391, '北郊镇', 4, 2537), +(21392, '南郊镇', 4, 2537), +(21393, '城北路街道', 4, 2537), +(21394, '大街街道', 4, 2537), +(21395, '永安街街道', 4, 2537), +(21396, '王村镇', 4, 2537), +(21397, '萌水镇', 4, 2537), +(21398, '青年路街道', 4, 2537), +(21399, '中埠镇', 4, 2538), +(21400, '体育场街道', 4, 2538), +(21401, '傅家镇', 4, 2538), +(21402, '公园街道', 4, 2538), +(21403, '南定镇', 4, 2538), +(21404, '卫固镇', 4, 2538), +(21405, '和平街道', 4, 2538), +(21406, '四宝山办', 4, 2538), +(21407, '房镇镇', 4, 2538), +(21408, '杏园街道', 4, 2538), +(21409, '沣水镇', 4, 2538), +(21410, '湖田镇', 4, 2538), +(21411, '石桥街道', 4, 2538), +(21412, '科苑街道', 4, 2538), +(21413, '车站街道', 4, 2538), +(21414, '马尚镇', 4, 2538), +(21415, '周家镇', 4, 2539), +(21416, '唐山镇', 4, 2539), +(21417, '新城镇', 4, 2539), +(21418, '果里镇', 4, 2539), +(21419, '田庄镇', 4, 2539), +(21420, '索镇镇', 4, 2539), +(21421, '荆家镇', 4, 2539), +(21422, '起凤镇', 4, 2539), +(21423, '邢家镇', 4, 2539), +(21424, '陈庄镇', 4, 2539), +(21425, '马桥镇', 4, 2539), +(21426, '三岔乡', 4, 2540), +(21427, '东里镇', 4, 2540), +(21428, '中庄镇', 4, 2540), +(21429, '南麻镇', 4, 2540), +(21430, '土门镇', 4, 2540), +(21431, '大张庄镇', 4, 2540), +(21432, '张家坡镇', 4, 2540), +(21433, '徐家庄乡', 4, 2540), +(21434, '悦庄镇', 4, 2540), +(21435, '燕崖乡', 4, 2540), +(21436, '石桥乡', 4, 2540), +(21437, '西里镇', 4, 2540), +(21438, '鲁村镇', 4, 2540); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21439, '东坪镇', 4, 2541), +(21440, '双沟镇', 4, 2541), +(21441, '商城路街道', 4, 2541), +(21442, '商家镇', 4, 2541), +(21443, '城南镇', 4, 2541), +(21444, '太河乡', 4, 2541), +(21445, '寨里镇', 4, 2541), +(21446, '岭子镇', 4, 2541), +(21447, '峨庄乡', 4, 2541), +(21448, '张庄乡', 4, 2541), +(21449, '昆仑镇', 4, 2541), +(21450, '杨寨镇', 4, 2541), +(21451, '松龄路街道', 4, 2541), +(21452, '洪山镇', 4, 2541), +(21453, '淄河镇', 4, 2541), +(21454, '磁村镇', 4, 2541), +(21455, '罗村镇', 4, 2541), +(21456, '般阳路街道', 4, 2541), +(21457, '西河镇', 4, 2541), +(21458, '黄家铺镇', 4, 2541), +(21459, '黑旺镇', 4, 2541), +(21460, '龙泉镇', 4, 2541), +(21461, '唐坊镇', 4, 2542), +(21462, '常家镇', 4, 2542), +(21463, '木李镇', 4, 2542), +(21464, '田镇镇', 4, 2542), +(21465, '花沟镇', 4, 2542), +(21466, '赵店镇', 4, 2542), +(21467, '青城镇', 4, 2542), +(21468, '高城镇', 4, 2542), +(21469, '黑里寨镇', 4, 2542), +(21470, '张山子镇', 4, 2543), +(21471, '泥沟镇', 4, 2543), +(21472, '涧头集镇', 4, 2543), +(21473, '运河街道', 4, 2543), +(21474, '邳庄镇', 4, 2543), +(21475, '马兰屯镇', 4, 2543), +(21476, '冯卯镇', 4, 2544), +(21477, '凫城乡', 4, 2544), +(21478, '北庄镇', 4, 2544), +(21479, '城头镇', 4, 2544), +(21480, '山城街道', 4, 2544), +(21481, '店子镇', 4, 2544), +(21482, '徐庄镇', 4, 2544), +(21483, '桑村镇', 4, 2544), +(21484, '水泉镇', 4, 2544), +(21485, '西集镇', 4, 2544), +(21486, '古邵镇', 4, 2545), +(21487, '吴林街道办事处', 4, 2545), +(21488, '坛山街道办事处', 4, 2545), +(21489, '峨山镇', 4, 2545), +(21490, '底阁镇', 4, 2545), +(21491, '榴园镇', 4, 2545), +(21492, '阴平镇', 4, 2545), +(21493, '中心街街道', 4, 2546), +(21494, '光明路街道', 4, 2546), +(21495, '各塔埠矿区街道', 4, 2546), +(21496, '孟庄镇', 4, 2546), +(21497, '文化路街道', 4, 2546), +(21498, '永安乡', 4, 2546), +(21499, '税郭镇', 4, 2546), +(21500, '西王庄乡', 4, 2546), +(21501, '齐村镇', 4, 2546); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21502, '龙山路街道', 4, 2546), +(21503, '东沙河镇', 4, 2547), +(21504, '东郭镇', 4, 2547), +(21505, '北辛街道', 4, 2547), +(21506, '南沙河镇', 4, 2547), +(21507, '善南街道', 4, 2547), +(21508, '大坞镇', 4, 2547), +(21509, '姜屯镇', 4, 2547), +(21510, '官桥镇', 4, 2547), +(21511, '张汪镇', 4, 2547), +(21512, '木石镇', 4, 2547), +(21513, '柴胡店镇', 4, 2547), +(21514, '洪绪镇', 4, 2547), +(21515, '滨湖镇', 4, 2547), +(21516, '界河镇', 4, 2547), +(21517, '级索镇', 4, 2547), +(21518, '羊庄镇', 4, 2547), +(21519, '荆河街道', 4, 2547), +(21520, '西岗镇', 4, 2547), +(21521, '鲍沟镇', 4, 2547), +(21522, '龙泉街道', 4, 2547), +(21523, '龙阳镇', 4, 2547), +(21524, '临城街道', 4, 2548), +(21525, '兴仁街道', 4, 2548), +(21526, '兴城街道', 4, 2548), +(21527, '周营镇', 4, 2548), +(21528, '常庄镇', 4, 2548), +(21529, '张苑镇', 4, 2548), +(21530, '沙沟镇', 4, 2548), +(21531, '邹坞镇', 4, 2548), +(21532, '陶庄镇', 4, 2548), +(21533, '东城街道办事处', 4, 2549), +(21534, '六户镇', 4, 2549), +(21535, '史口镇', 4, 2549), +(21536, '文汇街道办事处', 4, 2549), +(21537, '牛庄镇', 4, 2549), +(21538, '胜利街道办事处', 4, 2549), +(21539, '胜园街道办事处', 4, 2549), +(21540, '辛店街道办事处', 4, 2549), +(21541, '黄河路街道办事处', 4, 2549), +(21542, '龙居乡', 4, 2549), +(21543, '刁口乡', 4, 2550), +(21544, '利津镇', 4, 2550), +(21545, '北宋镇', 4, 2550), +(21546, '北岭乡', 4, 2550), +(21547, '明集乡', 4, 2550), +(21548, '汀罗镇', 4, 2550), +(21549, '盐窝镇', 4, 2550), +(21550, '虎滩乡', 4, 2550), +(21551, '陈庄镇', 4, 2550), +(21552, '垦利镇', 4, 2551), +(21553, '永安镇', 4, 2551), +(21554, '胜坨镇', 4, 2551), +(21555, '董集乡', 4, 2551), +(21556, '西宋乡', 4, 2551), +(21557, '郝家镇', 4, 2551), +(21558, '黄河口镇', 4, 2551), +(21559, '丁庄镇', 4, 2552), +(21560, '城区办事处', 4, 2552), +(21561, '大王镇', 4, 2552), +(21562, '大码头乡', 4, 2552), +(21563, '广饶镇', 4, 2552); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21564, '李鹊镇', 4, 2552), +(21565, '清河办事处', 4, 2552), +(21566, '石村镇', 4, 2552), +(21567, '稻庄镇', 4, 2552), +(21568, '经济开发区办事处', 4, 2552), +(21569, '花官乡', 4, 2552), +(21570, '西刘桥乡', 4, 2552), +(21571, '陈官乡', 4, 2552), +(21572, '义和镇', 4, 2553), +(21573, '仙河镇', 4, 2553), +(21574, '六合乡', 4, 2553), +(21575, '太平乡', 4, 2553), +(21576, '孤岛镇', 4, 2553), +(21577, '新户乡', 4, 2553), +(21578, '河口街道', 4, 2553), +(21579, '夏甸镇', 4, 2554), +(21580, '大秦家镇', 4, 2554), +(21581, '张星镇', 4, 2554), +(21582, '梦芝街道', 4, 2554), +(21583, '毕郭镇', 4, 2554), +(21584, '泉山街道', 4, 2554), +(21585, '玲珑镇', 4, 2554), +(21586, '罗峰街道', 4, 2554), +(21587, '蚕庄镇', 4, 2554), +(21588, '辛庄镇', 4, 2554), +(21589, '金岭镇', 4, 2554), +(21590, '阜山镇', 4, 2554), +(21591, '齐山镇', 4, 2554), +(21592, '亭口镇', 4, 2555), +(21593, '唐家泊镇', 4, 2555), +(21594, '官道镇', 4, 2555), +(21595, '寺口镇', 4, 2555), +(21596, '庄园街道', 4, 2555), +(21597, '庙后镇', 4, 2555), +(21598, '杨础镇', 4, 2555), +(21599, '松山镇', 4, 2555), +(21600, '桃村镇', 4, 2555), +(21601, '翠屏街道', 4, 2555), +(21602, '臧家庄镇', 4, 2555), +(21603, '苏家店镇', 4, 2555), +(21604, '蛇窝泊镇', 4, 2555), +(21605, '西城镇', 4, 2555), +(21606, '观里镇', 4, 2555), +(21607, '东村街道', 4, 2556), +(21608, '二十里店镇', 4, 2556), +(21609, '凤城街道', 4, 2556), +(21610, '发城镇', 4, 2556), +(21611, '大闫家镇', 4, 2556), +(21612, '小纪镇', 4, 2556), +(21613, '徐家店镇', 4, 2556), +(21614, '方圆街道', 4, 2556), +(21615, '朱吴镇', 4, 2556), +(21616, '留格店镇', 4, 2556), +(21617, '盘石店镇', 4, 2556), +(21618, '行村镇', 4, 2556), +(21619, '辛安镇', 4, 2556), +(21620, '郭城镇', 4, 2556), +(21621, '养马岛街道', 4, 2557), +(21622, '大窑镇', 4, 2557), +(21623, '姜格庄镇', 4, 2557), +(21624, '宁海街道', 4, 2557), +(21625, '开发区', 4, 2557), +(21626, '文化街道', 4, 2557); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21627, '武宁镇', 4, 2557), +(21628, '水道镇', 4, 2557), +(21629, '玉林店镇', 4, 2557), +(21630, '王格庄镇', 4, 2557), +(21631, '莒格庄镇', 4, 2557), +(21632, '观水镇', 4, 2557), +(21633, '高陵镇', 4, 2557), +(21634, '龙泉镇', 4, 2557), +(21635, '古现街道', 4, 2558), +(21636, '回里镇', 4, 2558), +(21637, '大季家街道', 4, 2558), +(21638, '张格庄镇', 4, 2558), +(21639, '清洋街道', 4, 2558), +(21640, '福新街道', 4, 2558), +(21641, '门楼镇', 4, 2558), +(21642, '高疃镇', 4, 2558), +(21643, '世回尧街道', 4, 2559), +(21644, '东山街道', 4, 2559), +(21645, '凤凰台街道', 4, 2559), +(21646, '只楚街道', 4, 2559), +(21647, '向阳街道', 4, 2559), +(21648, '奇山街道', 4, 2559), +(21649, '幸福街道', 4, 2559), +(21650, '毓璜顶街道', 4, 2559), +(21651, '白石街道', 4, 2559), +(21652, '芝罘岛街道', 4, 2559), +(21653, '通伸街道', 4, 2559), +(21654, '黄务街道', 4, 2559), +(21655, '初家街道', 4, 2560), +(21656, '滨海路街道', 4, 2560), +(21657, '莱山镇', 4, 2560), +(21658, '解甲庄镇', 4, 2560), +(21659, '黄海路街道', 4, 2560), +(21660, '三山岛街道', 4, 2561), +(21661, '土山镇', 4, 2561), +(21662, '城港路街道', 4, 2561), +(21663, '夏邱镇', 4, 2561), +(21664, '平里店镇', 4, 2561), +(21665, '文峰路街道', 4, 2561), +(21666, '文昌路街道', 4, 2561), +(21667, '朱桥镇', 4, 2561), +(21668, '柞村镇', 4, 2561), +(21669, '永安路街道', 4, 2561), +(21670, '沙河镇', 4, 2561), +(21671, '程郭镇', 4, 2561), +(21672, '虎头崖镇', 4, 2561), +(21673, '郭家店镇', 4, 2561), +(21674, '金城镇', 4, 2561), +(21675, '驿道镇', 4, 2561), +(21676, '万第镇', 4, 2562), +(21677, '冯格庄街道', 4, 2562), +(21678, '古柳街道', 4, 2562), +(21679, '吕格庄镇', 4, 2562), +(21680, '团旺镇', 4, 2562), +(21681, '城厢街道', 4, 2562), +(21682, '大夼镇', 4, 2562), +(21683, '姜疃镇', 4, 2562), +(21684, '山前店镇', 4, 2562), +(21685, '柏林庄镇', 4, 2562), +(21686, '沐浴店镇', 4, 2562), +(21687, '河洛镇', 4, 2562); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21688, '照旺庄镇', 4, 2562), +(21689, '穴坊镇', 4, 2562), +(21690, '羊郡镇', 4, 2562), +(21691, '谭格庄镇', 4, 2562), +(21692, '高格庄镇', 4, 2562), +(21693, '龙旺庄街道', 4, 2562), +(21694, '刘家沟镇', 4, 2563), +(21695, '北沟镇', 4, 2563), +(21696, '南王街道', 4, 2563), +(21697, '大柳行镇', 4, 2563), +(21698, '大辛店镇', 4, 2563), +(21699, '小门家镇', 4, 2563), +(21700, '新港街道', 4, 2563), +(21701, '村里集镇', 4, 2563), +(21702, '潮水镇', 4, 2563), +(21703, '登州街道', 4, 2563), +(21704, '紫荆山街道', 4, 2563), +(21705, '蓬莱阁街道', 4, 2563), +(21706, '北长山乡', 4, 2564), +(21707, '北隍城乡', 4, 2564), +(21708, '南长山镇', 4, 2564), +(21709, '南隍城乡', 4, 2564), +(21710, '大钦岛乡', 4, 2564), +(21711, '小钦岛乡', 4, 2564), +(21712, '砣矶镇', 4, 2564), +(21713, '黑山乡', 4, 2564), +(21714, '七甲镇', 4, 2565), +(21715, '下丁家镇', 4, 2565), +(21716, '东江镇', 4, 2565), +(21717, '东莱街道', 4, 2565), +(21718, '兰高镇', 4, 2565), +(21719, '北马镇', 4, 2565), +(21720, '徐福镇', 4, 2565), +(21721, '新嘉街道', 4, 2565), +(21722, '石良镇', 4, 2565), +(21723, '芦头镇', 4, 2565), +(21724, '诸由观镇', 4, 2565), +(21725, '黄山馆镇', 4, 2565), +(21726, '龙港街道', 4, 2565), +(21727, '七贤镇', 4, 2566), +(21728, '上林镇', 4, 2566), +(21729, '东城街办', 4, 2566), +(21730, '九山镇', 4, 2566), +(21731, '五井镇', 4, 2566), +(21732, '冶源镇', 4, 2566), +(21733, '卧龙镇', 4, 2566), +(21734, '城关街办', 4, 2566), +(21735, '大关镇', 4, 2566), +(21736, '寺头镇', 4, 2566), +(21737, '杨善镇', 4, 2566), +(21738, '柳山镇', 4, 2566), +(21739, '石家河乡', 4, 2566), +(21740, '纸坊镇', 4, 2566), +(21741, '营子镇', 4, 2566), +(21742, '蒋峪镇', 4, 2566), +(21743, '辛寨镇', 4, 2566), +(21744, '龙岗镇', 4, 2566), +(21745, '凤凰街办', 4, 2567), +(21746, '南流镇', 4, 2567), +(21747, '坊安街办', 4, 2567), +(21748, '恒安街办', 4, 2567), +(21749, '眉村镇', 4, 2567); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21750, '穆村镇', 4, 2567), +(21751, '荆山洼镇', 4, 2567), +(21752, '长宁街办', 4, 2567), +(21753, '东关街道', 4, 2568), +(21754, '二十里堡街道', 4, 2568), +(21755, '北苑街道', 4, 2568), +(21756, '南苑街道', 4, 2568), +(21757, '大虞街道', 4, 2568), +(21758, '广文街道', 4, 2568), +(21759, '新城街道', 4, 2568), +(21760, '樱桃园街道', 4, 2568), +(21761, '院校街道', 4, 2568), +(21762, '临浯镇', 4, 2569), +(21763, '关王镇', 4, 2569), +(21764, '凌河镇', 4, 2569), +(21765, '刘家尧镇', 4, 2569), +(21766, '吾山镇', 4, 2569), +(21767, '大盛镇', 4, 2569), +(21768, '安丘镇', 4, 2569), +(21769, '官庄镇', 4, 2569), +(21770, '庵上镇', 4, 2569), +(21771, '景芝镇', 4, 2569), +(21772, '柘山镇', 4, 2569), +(21773, '王家庄镇', 4, 2569), +(21774, '白芬子镇', 4, 2569), +(21775, '石埠子镇', 4, 2569), +(21776, '石堆镇', 4, 2569), +(21777, '管公镇', 4, 2569), +(21778, '红沙沟镇', 4, 2569), +(21779, '贾戈镇', 4, 2569), +(21780, '赵戈镇', 4, 2569), +(21781, '辉渠镇', 4, 2569), +(21782, '金冢子镇', 4, 2569), +(21783, '雹泉镇', 4, 2569), +(21784, '黄旗堡镇', 4, 2569), +(21785, '南孙乡', 4, 2570), +(21786, '双杨店镇', 4, 2570), +(21787, '固堤镇', 4, 2570), +(21788, '央子镇', 4, 2570), +(21789, '寒亭街道', 4, 2570), +(21790, '开元街道', 4, 2570), +(21791, '朱里镇', 4, 2570), +(21792, '河滩镇', 4, 2570), +(21793, '泊子乡', 4, 2570), +(21794, '高里镇', 4, 2570), +(21795, '上口镇', 4, 2571), +(21796, '侯镇', 4, 2571), +(21797, '化龙镇', 4, 2571), +(21798, '卧铺乡', 4, 2571), +(21799, '台头镇', 4, 2571), +(21800, '圣城街道', 4, 2571), +(21801, '孙家集街道', 4, 2571), +(21802, '文家街道', 4, 2571), +(21803, '洛城街道', 4, 2571), +(21804, '王高镇', 4, 2571), +(21805, '田柳镇', 4, 2571), +(21806, '田马镇', 4, 2571), +(21807, '留吕镇', 4, 2571), +(21808, '稻田镇', 4, 2571), +(21809, '纪台镇', 4, 2571), +(21810, '经济开发区', 4, 2571), +(21811, '羊口镇', 4, 2571), +(21812, '营里镇', 4, 2571); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21813, '道口镇', 4, 2571), +(21814, '乔官镇', 4, 2572), +(21815, '五图镇', 4, 2572), +(21816, '北岩镇', 4, 2572), +(21817, '南郝镇', 4, 2572), +(21818, '唐吾镇', 4, 2572), +(21819, '尧沟镇', 4, 2572), +(21820, '崔家庄镇', 4, 2572), +(21821, '昌乐镇', 4, 2572), +(21822, '朱刘镇', 4, 2572), +(21823, '朱汉镇', 4, 2572), +(21824, '白塔镇', 4, 2572), +(21825, '红河镇', 4, 2572), +(21826, '阿陀镇', 4, 2572), +(21827, '马宋镇', 4, 2572), +(21828, '高崖镇', 4, 2572), +(21829, '丈岭镇', 4, 2573), +(21830, '北孟镇', 4, 2573), +(21831, '卜庄镇', 4, 2573), +(21832, '双台乡', 4, 2573), +(21833, '围子镇', 4, 2573), +(21834, '夏店镇', 4, 2573), +(21835, '太保庄乡', 4, 2573), +(21836, '奎聚街道办事处', 4, 2573), +(21837, '宋庄镇', 4, 2573), +(21838, '岞山镇', 4, 2573), +(21839, '柳疃镇', 4, 2573), +(21840, '石埠镇', 4, 2573), +(21841, '都昌街道办事处', 4, 2573), +(21842, '饮马镇', 4, 2573), +(21843, '龙池镇', 4, 2573), +(21844, '于河镇', 4, 2574), +(21845, '军埠口镇', 4, 2574), +(21846, '北关街道', 4, 2574), +(21847, '南关街道', 4, 2574), +(21848, '城关街道', 4, 2574), +(21849, '望留镇', 4, 2574), +(21850, '符山镇', 4, 2574), +(21851, '西关街道', 4, 2574), +(21852, '九台镇', 4, 2575), +(21853, '吕标镇', 4, 2575), +(21854, '孟疃镇', 4, 2575), +(21855, '密州街道', 4, 2575), +(21856, '昌城镇', 4, 2575), +(21857, '朱解镇', 4, 2575), +(21858, '枳沟镇', 4, 2575), +(21859, '桃园乡', 4, 2575), +(21860, '桃林乡', 4, 2575), +(21861, '瓦店镇', 4, 2575), +(21862, '百尺河镇', 4, 2575), +(21863, '皇华镇', 4, 2575), +(21864, '相州镇', 4, 2575), +(21865, '石桥子镇', 4, 2575), +(21866, '程戈庄镇', 4, 2575), +(21867, '舜王街道', 4, 2575), +(21868, '贾悦镇', 4, 2575), +(21869, '辛兴镇', 4, 2575), +(21870, '郝戈庄镇', 4, 2575), +(21871, '郭家屯镇', 4, 2575), +(21872, '马庄镇', 4, 2575), +(21873, '龙都街道', 4, 2575), +(21874, '东坝街道', 4, 2576), +(21875, '东夏镇', 4, 2576); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21876, '东高镇', 4, 2576), +(21877, '云门山街道', 4, 2576), +(21878, '五里镇', 4, 2576), +(21879, '何官镇', 4, 2576), +(21880, '口埠镇', 4, 2576), +(21881, '庙子镇', 4, 2576), +(21882, '弥河镇', 4, 2576), +(21883, '昭德街道', 4, 2576), +(21884, '普通镇', 4, 2576), +(21885, '朱良镇', 4, 2576), +(21886, '王坟镇', 4, 2576), +(21887, '王府街道', 4, 2576), +(21888, '王母宫街道', 4, 2576), +(21889, '益都街道', 4, 2576), +(21890, '谭坊镇', 4, 2576), +(21891, '邵庄镇', 4, 2576), +(21892, '郑母镇', 4, 2576), +(21893, '高柳镇', 4, 2576), +(21894, '黄楼镇', 4, 2576), +(21895, '井沟镇', 4, 2577), +(21896, '仁和镇', 4, 2577), +(21897, '双羊镇', 4, 2577), +(21898, '周戈庄镇', 4, 2577), +(21899, '呼家庄镇', 4, 2577), +(21900, '夏庄镇', 4, 2577), +(21901, '大牟家镇', 4, 2577), +(21902, '姚哥庄镇', 4, 2577), +(21903, '姜庄镇', 4, 2577), +(21904, '密水街办', 4, 2577), +(21905, '康庄镇', 4, 2577), +(21906, '拒城河镇', 4, 2577), +(21907, '朝阳街办', 4, 2577), +(21908, '李家营镇', 4, 2577), +(21909, '柏城镇', 4, 2577), +(21910, '柴沟镇', 4, 2577), +(21911, '河崖镇', 4, 2577), +(21912, '注沟镇', 4, 2577), +(21913, '醴泉街办', 4, 2577), +(21914, '阚家镇', 4, 2577), +(21915, '三贾街道', 4, 2578), +(21916, '二十里铺镇', 4, 2578), +(21917, '南张镇', 4, 2578), +(21918, '唐口镇', 4, 2578), +(21919, '喻屯镇', 4, 2578), +(21920, '安居镇', 4, 2578), +(21921, '接庄镇', 4, 2578), +(21922, '李营镇', 4, 2578), +(21923, '柳行街道', 4, 2578), +(21924, '石桥镇', 4, 2578), +(21925, '许庄街道', 4, 2578), +(21926, '长沟镇', 4, 2578), +(21927, '兴隆庄镇', 4, 2579), +(21928, '大安镇', 4, 2579), +(21929, '小孟镇', 4, 2579), +(21930, '新兖镇', 4, 2579), +(21931, '新驿镇', 4, 2579), +(21932, '永安街道', 4, 2579), +(21933, '漕河镇', 4, 2579), +(21934, '王因镇', 4, 2579), +(21935, '谷村镇', 4, 2579), +(21936, '颜店镇', 4, 2579), +(21937, '黄屯镇', 4, 2579), +(21938, '鼓楼街道', 4, 2579); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(21939, '万张乡', 4, 2580), +(21940, '仲山乡', 4, 2580), +(21941, '卧龙山镇', 4, 2580), +(21942, '嘉祥镇', 4, 2580), +(21943, '大张楼镇', 4, 2580), +(21944, '梁宝寺镇', 4, 2580), +(21945, '满硐乡', 4, 2580), +(21946, '疃里镇', 4, 2580), +(21947, '盂姑集乡', 4, 2580), +(21948, '纸坊镇', 4, 2580), +(21949, '老僧堂乡', 4, 2580), +(21950, '金屯镇', 4, 2580), +(21951, '马村镇', 4, 2580), +(21952, '马集乡', 4, 2580), +(21953, '黄垓乡', 4, 2580), +(21954, '仙营街道', 4, 2581), +(21955, '南苑街道', 4, 2581), +(21956, '槐街道', 4, 2581), +(21957, '济阳街道', 4, 2581), +(21958, '观音阁街道', 4, 2581), +(21959, '越河街道', 4, 2581), +(21960, '金城街道', 4, 2581), +(21961, '阜桥街道', 4, 2581), +(21962, '两城乡', 4, 2582), +(21963, '傅村镇', 4, 2582), +(21964, '南阳镇', 4, 2582), +(21965, '夏镇街道', 4, 2582), +(21966, '张楼乡', 4, 2582), +(21967, '微山岛乡', 4, 2582), +(21968, '昭阳街道', 4, 2582), +(21969, '欢城镇', 4, 2582), +(21970, '留庄镇', 4, 2582), +(21971, '西平乡', 4, 2582), +(21972, '赵庙乡', 4, 2582), +(21973, '韩庄镇', 4, 2582), +(21974, '马坡乡', 4, 2582), +(21975, '高楼乡', 4, 2582), +(21976, '鲁桥镇', 4, 2582), +(21977, '书院街道', 4, 2583), +(21978, '南辛镇', 4, 2583), +(21979, '吴村镇', 4, 2583), +(21980, '姚村镇', 4, 2583), +(21981, '小雪镇', 4, 2583), +(21982, '息陬乡', 4, 2583), +(21983, '时庄镇', 4, 2583), +(21984, '王庄乡', 4, 2583), +(21985, '董庄乡', 4, 2583), +(21986, '防山乡', 4, 2583), +(21987, '陵城镇', 4, 2583), +(21988, '鲁城街道', 4, 2583), +(21989, '大路口乡', 4, 2584), +(21990, '寿张集乡', 4, 2584), +(21991, '小安山镇', 4, 2584), +(21992, '小路口镇', 4, 2584), +(21993, '徐集镇', 4, 2584), +(21994, '拳铺镇', 4, 2584), +(21995, '杨营镇', 4, 2584), +(21996, '梁山镇', 4, 2584), +(21997, '赵固堆乡', 4, 2584), +(21998, '韩垓镇', 4, 2584), +(21999, '韩岗镇', 4, 2584), +(22000, '馆驿镇', 4, 2584), +(22001, '马营乡', 4, 2584); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22002, '黑虎庙乡', 4, 2584), +(22003, '义桥乡', 4, 2585), +(22004, '军屯乡', 4, 2585), +(22005, '刘楼乡', 4, 2585), +(22006, '南旺镇', 4, 2585), +(22007, '南站镇', 4, 2585), +(22008, '寅寺镇', 4, 2585), +(22009, '康驿镇', 4, 2585), +(22010, '杨店乡', 4, 2585), +(22011, '次邱镇', 4, 2585), +(22012, '汶上镇', 4, 2585), +(22013, '白石乡', 4, 2585), +(22014, '苑庄镇', 4, 2585), +(22015, '郭仓乡', 4, 2585), +(22016, '郭楼镇', 4, 2585), +(22017, '中册镇', 4, 2586), +(22018, '圣水峪乡', 4, 2586), +(22019, '大黄沟乡', 4, 2586), +(22020, '星村镇', 4, 2586), +(22021, '杨柳镇', 4, 2586), +(22022, '柘沟镇', 4, 2586), +(22023, '泉林镇', 4, 2586), +(22024, '泗张镇', 4, 2586), +(22025, '泗河街道', 4, 2586), +(22026, '济河街道', 4, 2586), +(22027, '苗馆镇', 4, 2586), +(22028, '金庄镇', 4, 2586), +(22029, '高峪乡', 4, 2586), +(22030, '中心店镇', 4, 2587), +(22031, '凫山街道', 4, 2587), +(22032, '北宿镇', 4, 2587), +(22033, '千泉街道', 4, 2587), +(22034, '唐村镇', 4, 2587), +(22035, '城前镇', 4, 2587), +(22036, '大束镇', 4, 2587), +(22037, '太平镇', 4, 2587), +(22038, '峄山镇', 4, 2587), +(22039, '平阳寺镇', 4, 2587), +(22040, '张庄镇', 4, 2587), +(22041, '田黄镇', 4, 2587), +(22042, '看庄镇', 4, 2587), +(22043, '石墙镇', 4, 2587), +(22044, '郭里镇', 4, 2587), +(22045, '钢山街道', 4, 2587), +(22046, '香城镇', 4, 2587), +(22047, '兴隆乡', 4, 2588), +(22048, '化雨乡', 4, 2588), +(22049, '卜集乡', 4, 2588), +(22050, '司马镇', 4, 2588), +(22051, '王丕镇', 4, 2588), +(22052, '羊山镇', 4, 2588), +(22053, '胡集镇', 4, 2588), +(22054, '金乡镇', 4, 2588), +(22055, '霄云镇', 4, 2588), +(22056, '马庙镇', 4, 2588), +(22057, '高河乡', 4, 2588), +(22058, '鱼山镇', 4, 2588), +(22059, '鸡黍镇', 4, 2588), +(22060, '唐马乡', 4, 2589), +(22061, '张黄镇', 4, 2589), +(22062, '李阁镇', 4, 2589), +(22063, '清河镇', 4, 2589), +(22064, '王庙镇', 4, 2589), +(22065, '王鲁镇', 4, 2589), +(22066, '罗屯乡', 4, 2589); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22067, '老砦乡', 4, 2589), +(22068, '谷亭镇', 4, 2589), +(22069, '鱼城镇', 4, 2589), +(22070, '东平镇', 4, 2590), +(22071, '商老庄乡', 4, 2590), +(22072, '大羊乡', 4, 2590), +(22073, '州城镇', 4, 2590), +(22074, '彭集镇', 4, 2590), +(22075, '戴庙乡', 4, 2590), +(22076, '接山乡', 4, 2590), +(22077, '斑鸠店镇', 4, 2590), +(22078, '新湖乡', 4, 2590), +(22079, '旧县乡', 4, 2590), +(22080, '梯门乡', 4, 2590), +(22081, '沙河站镇', 4, 2590), +(22082, '老湖镇', 4, 2590), +(22083, '银山镇', 4, 2590), +(22084, '东庄乡', 4, 2591), +(22085, '东疏镇', 4, 2591), +(22086, '乡饮乡', 4, 2591), +(22087, '伏山镇', 4, 2591), +(22088, '华丰镇', 4, 2591), +(22089, '堽城镇', 4, 2591), +(22090, '宁阳镇', 4, 2591), +(22091, '泗店镇', 4, 2591), +(22092, '磁窑镇', 4, 2591), +(22093, '葛石镇', 4, 2591), +(22094, '蒋集镇', 4, 2591), +(22095, '鹤山乡', 4, 2591), +(22096, '下港乡', 4, 2592), +(22097, '化马湾乡', 4, 2592), +(22098, '北集坡镇', 4, 2592), +(22099, '夏张镇', 4, 2592), +(22100, '大汶口镇', 4, 2592), +(22101, '太平街道', 4, 2592), +(22102, '山口镇', 4, 2592), +(22103, '徂徕镇', 4, 2592), +(22104, '房村镇', 4, 2592), +(22105, '满庄镇', 4, 2592), +(22106, '祝阳镇', 4, 2592), +(22107, '粥店街道', 4, 2592), +(22108, '良庄镇', 4, 2592), +(22109, '范镇', 4, 2592), +(22110, '角峪镇', 4, 2592), +(22111, '道朗镇', 4, 2592), +(22112, '马庄镇', 4, 2592), +(22113, '黄前镇', 4, 2592), +(22114, '东都镇', 4, 2593), +(22115, '刘杜镇', 4, 2593), +(22116, '天宝镇', 4, 2593), +(22117, '宫里镇', 4, 2593), +(22118, '小协镇', 4, 2593), +(22119, '岳家庄乡', 4, 2593), +(22120, '放城镇', 4, 2593), +(22121, '新汶街道', 4, 2593), +(22122, '果都镇', 4, 2593), +(22123, '楼德镇', 4, 2593), +(22124, '汶南镇', 4, 2593), +(22125, '泉沟镇', 4, 2593), +(22126, '石莱镇', 4, 2593), +(22127, '禹村镇', 4, 2593), +(22128, '羊流镇', 4, 2593), +(22129, '翟镇', 4, 2593), +(22130, '西张庄镇', 4, 2593), +(22131, '谷里镇', 4, 2593); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22132, '青云街道', 4, 2593), +(22133, '龙延镇', 4, 2593), +(22134, '上高街道', 4, 2594), +(22135, '大津口乡', 4, 2594), +(22136, '岱庙街道', 4, 2594), +(22137, '徐家楼街道', 4, 2594), +(22138, '泰前街道', 4, 2594), +(22139, '省庄镇', 4, 2594), +(22140, '财源街道', 4, 2594), +(22141, '邱家店镇', 4, 2594), +(22142, '仪阳乡', 4, 2595), +(22143, '孙伯镇', 4, 2595), +(22144, '安临站镇', 4, 2595), +(22145, '安驾庄镇', 4, 2595), +(22146, '新城街道', 4, 2595), +(22147, '桃园镇', 4, 2595), +(22148, '汶阳镇', 4, 2595), +(22149, '湖屯镇', 4, 2595), +(22150, '潮泉镇', 4, 2595), +(22151, '王庄镇', 4, 2595), +(22152, '王瓜店镇', 4, 2595), +(22153, '石横镇', 4, 2595), +(22154, '老城镇', 4, 2595), +(22155, '边院镇', 4, 2595), +(22156, '下初镇', 4, 2596), +(22157, '乳山口镇', 4, 2596), +(22158, '乳山寨镇', 4, 2596), +(22159, '冯家镇', 4, 2596), +(22160, '午极镇', 4, 2596), +(22161, '南黄镇', 4, 2596), +(22162, '城区街道办事处', 4, 2596), +(22163, '夏村镇', 4, 2596), +(22164, '大孤山镇', 4, 2596), +(22165, '崖子镇', 4, 2596), +(22166, '徐家镇', 4, 2596), +(22167, '海阳所镇', 4, 2596), +(22168, '白沙滩镇', 4, 2596), +(22169, '育黎镇', 4, 2596), +(22170, '诸往镇', 4, 2596), +(22171, '侯家镇', 4, 2597), +(22172, '大水泊镇', 4, 2597), +(22173, '天福路街道办事处', 4, 2597), +(22174, '宋村镇', 4, 2597), +(22175, '小观镇', 4, 2597), +(22176, '张家产镇', 4, 2597), +(22177, '文登营镇', 4, 2597), +(22178, '汪疃镇', 4, 2597), +(22179, '泽头镇', 4, 2597), +(22180, '泽库镇', 4, 2597), +(22181, '环山路街道办事处', 4, 2597), +(22182, '界石镇', 4, 2597), +(22183, '米山镇', 4, 2597), +(22184, '苘山镇', 4, 2597), +(22185, '葛家镇', 4, 2597), +(22186, '高村镇', 4, 2597), +(22187, '龙山路街道办事处', 4, 2597), +(22188, '万欣街道', 4, 2598), +(22189, '凤林街道', 4, 2598), +(22190, '初村镇', 4, 2598), +(22191, '卧龙街道', 4, 2598), +(22192, '孙家疃镇', 4, 2598); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22193, '崮山镇', 4, 2598), +(22194, '张村镇', 4, 2598), +(22195, '怡园街道', 4, 2598), +(22196, '桥头镇', 4, 2598), +(22197, '泊于镇', 4, 2598), +(22198, '温泉镇', 4, 2598), +(22199, '环翠楼街道', 4, 2598), +(22200, '田和街道', 4, 2598), +(22201, '皇冠街道', 4, 2598), +(22202, '竹岛街道', 4, 2598), +(22203, '羊亭镇', 4, 2598), +(22204, '草庙子镇', 4, 2598), +(22205, '西苑街道', 4, 2598), +(22206, '鲸园街道', 4, 2598), +(22207, '上庄镇', 4, 2599), +(22208, '东山街道', 4, 2599), +(22209, '人和镇', 4, 2599), +(22210, '俚岛镇', 4, 2599), +(22211, '埠柳镇', 4, 2599), +(22212, '夏庄镇', 4, 2599), +(22213, '大疃镇', 4, 2599), +(22214, '宁津街道', 4, 2599), +(22215, '崖头镇', 4, 2599), +(22216, '崖西镇', 4, 2599), +(22217, '成山镇', 4, 2599), +(22218, '斥山街道', 4, 2599), +(22219, '桃园街道', 4, 2599), +(22220, '港湾街道', 4, 2599), +(22221, '港西镇', 4, 2599), +(22222, '滕家镇', 4, 2599), +(22223, '王连街道', 4, 2599), +(22224, '石岛管理区', 4, 2599), +(22225, '荫子镇', 4, 2599), +(22226, '虎山镇', 4, 2599), +(22227, '三庄镇', 4, 2600), +(22228, '两城镇', 4, 2600), +(22229, '前三岛乡', 4, 2600), +(22230, '南湖镇', 4, 2600), +(22231, '奎山街道', 4, 2600), +(22232, '日照开发区虚拟街道', 4, 2600), +(22233, '日照街道', 4, 2600), +(22234, '河山镇', 4, 2600), +(22235, '涛雒镇', 4, 2600), +(22236, '石臼街道', 4, 2600), +(22237, '秦楼街道', 4, 2600), +(22238, '西湖镇', 4, 2600), +(22239, '陈疃镇', 4, 2600), +(22240, '中至镇', 4, 2601), +(22241, '于里镇', 4, 2601), +(22242, '叩官镇', 4, 2601), +(22243, '户部乡', 4, 2601), +(22244, '松柏乡', 4, 2601), +(22245, '汪湖镇', 4, 2601), +(22246, '洪凝镇', 4, 2601), +(22247, '潮河镇', 4, 2601), +(22248, '石场乡', 4, 2601), +(22249, '街头镇', 4, 2601), +(22250, '许孟镇', 4, 2601), +(22251, '高泽镇', 4, 2601), +(22252, '后村镇', 4, 2602), +(22253, '安东卫街道', 4, 2602), +(22254, '岚山头街道', 4, 2602), +(22255, '巨峰镇', 4, 2602); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22256, '碑廓镇', 4, 2602), +(22257, '虎山镇', 4, 2602), +(22258, '高兴镇', 4, 2602), +(22259, '黄墩镇', 4, 2602), +(22260, '东莞镇', 4, 2603), +(22261, '中楼镇', 4, 2603), +(22262, '刘家官庄镇', 4, 2603), +(22263, '城阳镇', 4, 2603), +(22264, '夏庄镇', 4, 2603), +(22265, '安庄镇', 4, 2603), +(22266, '寨里河乡', 4, 2603), +(22267, '小店镇', 4, 2603), +(22268, '峤山镇', 4, 2603), +(22269, '库山乡', 4, 2603), +(22270, '店子集镇', 4, 2603), +(22271, '招贤镇', 4, 2603), +(22272, '果庄乡', 4, 2603), +(22273, '桑园乡', 4, 2603), +(22274, '洛河镇', 4, 2603), +(22275, '浮来山镇', 4, 2603), +(22276, '碁山镇', 4, 2603), +(22277, '长岭镇', 4, 2603), +(22278, '阎庄镇', 4, 2603), +(22279, '陵阳镇', 4, 2603), +(22280, '龙山镇', 4, 2603), +(22281, '口镇', 4, 2604), +(22282, '和庄', 4, 2604), +(22283, '大王庄镇', 4, 2604), +(22284, '寨里镇', 4, 2604), +(22285, '张家洼街道', 4, 2604), +(22286, '方下镇', 4, 2604), +(22287, '杨庄镇', 4, 2604), +(22288, '牛泉镇', 4, 2604), +(22289, '羊里镇', 4, 2604), +(22290, '苗山镇', 4, 2604), +(22291, '茶叶口镇', 4, 2604), +(22292, '莱芜市', 4, 2604), +(22293, '辛庄镇', 4, 2604), +(22294, '雪野镇', 4, 2604), +(22295, '高庄街道', 4, 2604), +(22296, '艾山街道', 4, 2605), +(22297, '里辛镇', 4, 2605), +(22298, '颜庄镇', 4, 2605), +(22299, '黄庄镇', 4, 2605), +(22300, '临沭镇', 4, 2606), +(22301, '南古镇', 4, 2606), +(22302, '大兴镇', 4, 2606), +(22303, '店头镇', 4, 2606), +(22304, '曹庄镇', 4, 2606), +(22305, '朱仓乡', 4, 2606), +(22306, '玉山镇', 4, 2606), +(22307, '白旄镇', 4, 2606), +(22308, '石门镇', 4, 2606), +(22309, '蛟龙镇', 4, 2606), +(22310, '郑山镇', 4, 2606), +(22311, '青云镇', 4, 2606), +(22312, '义堂镇', 4, 2607), +(22313, '兰山街道', 4, 2607), +(22314, '半程镇', 4, 2607), +(22315, '南坊街道', 4, 2607), +(22316, '朱保镇', 4, 2607), +(22317, '李官镇', 4, 2607), +(22318, '枣沟头镇', 4, 2607), +(22319, '白沙埠镇', 4, 2607); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22320, '金雀山街道', 4, 2607), +(22321, '银雀山街道', 4, 2607), +(22322, '马厂湖镇', 4, 2607), +(22323, '丰阳镇', 4, 2608), +(22324, '临涧镇', 4, 2608), +(22325, '仲村镇', 4, 2608), +(22326, '保太镇', 4, 2608), +(22327, '卞桥镇', 4, 2608), +(22328, '地方镇', 4, 2608), +(22329, '平邑镇', 4, 2608), +(22330, '柏林镇', 4, 2608), +(22331, '武台镇', 4, 2608), +(22332, '流峪镇', 4, 2608), +(22333, '温水镇', 4, 2608), +(22334, '白彦镇', 4, 2608), +(22335, '资邱乡', 4, 2608), +(22336, '郑城镇', 4, 2608), +(22337, '铜石镇', 4, 2608), +(22338, '魏庄乡', 4, 2608), +(22339, '依汶镇', 4, 2609), +(22340, '双堠镇', 4, 2609), +(22341, '大庄镇', 4, 2609), +(22342, '孙祖镇', 4, 2609), +(22343, '岸堤镇', 4, 2609), +(22344, '张庄镇', 4, 2609), +(22345, '杨家坡镇', 4, 2609), +(22346, '湖头镇', 4, 2609), +(22347, '界湖镇', 4, 2609), +(22348, '砖埠镇', 4, 2609), +(22349, '苏村镇', 4, 2609), +(22350, '葛沟镇', 4, 2609), +(22351, '蒲汪镇', 4, 2609), +(22352, '辛集镇', 4, 2609), +(22353, '铜井镇', 4, 2609), +(22354, '青驼镇', 4, 2609), +(22355, '马牧池乡', 4, 2609), +(22356, '四十里堡镇', 4, 2610), +(22357, '圈里乡', 4, 2610), +(22358, '夏蔚镇', 4, 2610), +(22359, '姚店子镇', 4, 2610), +(22360, '富官庄乡', 4, 2610), +(22361, '崔家峪镇', 4, 2610), +(22362, '杨庄镇', 4, 2610), +(22363, '沂水镇', 4, 2610), +(22364, '沙沟镇', 4, 2610), +(22365, '泉庄乡', 4, 2610), +(22366, '许家湖镇', 4, 2610), +(22367, '诸葛镇', 4, 2610), +(22368, '道托乡', 4, 2610), +(22369, '院东头乡', 4, 2610), +(22370, '马站镇', 4, 2610), +(22371, '高庄镇', 4, 2610), +(22372, '高桥镇', 4, 2610), +(22373, '黄山铺镇', 4, 2610), +(22374, '龙家圈乡', 4, 2610), +(22375, '九曲镇', 4, 2611), +(22376, '八湖镇', 4, 2611), +(22377, '凤凰岭乡', 4, 2611), +(22378, '刘店子乡', 4, 2611), +(22379, '太平镇', 4, 2611), +(22380, '梅埠镇', 4, 2611), +(22381, '汤头镇', 4, 2611), +(22382, '汤河镇', 4, 2611), +(22383, '相公镇', 4, 2611); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22384, '芝麻墩镇', 4, 2611), +(22385, '郑旺镇', 4, 2611), +(22386, '重沟镇', 4, 2611), +(22387, '付庄街道', 4, 2612), +(22388, '册山街道', 4, 2612), +(22389, '双月湖街道', 4, 2612), +(22390, '汤庄街道', 4, 2612), +(22391, '盛庄街道', 4, 2612), +(22392, '罗庄街道', 4, 2612), +(22393, '罗西街道', 4, 2612), +(22394, '高都街道', 4, 2612), +(22395, '三合乡', 4, 2613), +(22396, '下村乡', 4, 2613), +(22397, '二庙乡', 4, 2613), +(22398, '兰陵镇', 4, 2613), +(22399, '兴明乡', 4, 2613), +(22400, '南桥镇', 4, 2613), +(22401, '卞庄镇', 4, 2613), +(22402, '向城镇', 4, 2613), +(22403, '大仲村镇', 4, 2613), +(22404, '尚岩镇', 4, 2613), +(22405, '层山镇', 4, 2613), +(22406, '庄坞镇', 4, 2613), +(22407, '新兴镇', 4, 2613), +(22408, '沂堂镇', 4, 2613), +(22409, '矿坑乡', 4, 2613), +(22410, '磨山镇', 4, 2613), +(22411, '神山镇', 4, 2613), +(22412, '贾庄乡', 4, 2613), +(22413, '车辋镇', 4, 2613), +(22414, '长城镇', 4, 2613), +(22415, '鲁城乡', 4, 2613), +(22416, '十字路镇', 4, 2614), +(22417, '团林镇', 4, 2614), +(22418, '坊前镇', 4, 2614), +(22419, '坪上镇', 4, 2614), +(22420, '壮岗镇', 4, 2614), +(22421, '大店镇', 4, 2614), +(22422, '岭泉镇', 4, 2614), +(22423, '文疃镇', 4, 2614), +(22424, '朱芦镇', 4, 2614), +(22425, '板泉镇', 4, 2614), +(22426, '汀水镇', 4, 2614), +(22427, '洙边镇', 4, 2614), +(22428, '涝坡镇', 4, 2614), +(22429, '相沟乡', 4, 2614), +(22430, '相邸镇', 4, 2614), +(22431, '石莲子镇', 4, 2614), +(22432, '筵宾镇', 4, 2614), +(22433, '道口乡', 4, 2614), +(22434, '坦埠镇', 4, 2615), +(22435, '垛庄镇', 4, 2615), +(22436, '岱崮镇', 4, 2615), +(22437, '常路镇', 4, 2615), +(22438, '旧寨乡', 4, 2615), +(22439, '桃墟镇', 4, 2615), +(22440, '界牌镇', 4, 2615), +(22441, '联城乡', 4, 2615), +(22442, '蒙阴镇', 4, 2615), +(22443, '野店镇', 4, 2615), +(22444, '高都镇', 4, 2615), +(22445, '上冶镇', 4, 2616), +(22446, '刘庄镇', 4, 2616), +(22447, '南张庄乡', 4, 2616); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22448, '城北乡', 4, 2616), +(22449, '大田庄乡', 4, 2616), +(22450, '探沂镇', 4, 2616), +(22451, '新庄镇', 4, 2616), +(22452, '新桥镇', 4, 2616), +(22453, '方城镇', 4, 2616), +(22454, '朱田镇', 4, 2616), +(22455, '梁邱镇', 4, 2616), +(22456, '汪沟镇', 4, 2616), +(22457, '石井乡', 4, 2616), +(22458, '胡阳乡', 4, 2616), +(22459, '芍药山乡', 4, 2616), +(22460, '薛庄镇', 4, 2616), +(22461, '费城镇', 4, 2616), +(22462, '马庄镇', 4, 2616), +(22463, '庙山镇', 4, 2617), +(22464, '归昌乡', 4, 2617), +(22465, '新村乡', 4, 2617), +(22466, '李庄镇', 4, 2617), +(22467, '杨集镇', 4, 2617), +(22468, '沙墩镇', 4, 2617), +(22469, '泉源乡', 4, 2617), +(22470, '港上镇', 4, 2617), +(22471, '褚墩镇', 4, 2617), +(22472, '红花乡', 4, 2617), +(22473, '胜利乡', 4, 2617), +(22474, '花园乡', 4, 2617), +(22475, '郯城镇', 4, 2617), +(22476, '重坊镇', 4, 2617), +(22477, '马头镇', 4, 2617), +(22478, '高峰头镇', 4, 2617), +(22479, '黄山镇', 4, 2617), +(22480, '临南镇', 4, 2618), +(22481, '临盘镇', 4, 2618), +(22482, '临邑镇', 4, 2618), +(22483, '兴隆镇', 4, 2618), +(22484, '孟寺镇', 4, 2618), +(22485, '宿安乡', 4, 2618), +(22486, '德平镇', 4, 2618), +(22487, '林子镇', 4, 2618), +(22488, '理合务乡', 4, 2618), +(22489, '翟家乡', 4, 2618), +(22490, '丁坞镇', 4, 2619), +(22491, '云红街道', 4, 2619), +(22492, '化楼镇', 4, 2619), +(22493, '大孙乡', 4, 2619), +(22494, '孔镇', 4, 2619), +(22495, '寨头堡乡', 4, 2619), +(22496, '市中街道', 4, 2619), +(22497, '朱集镇', 4, 2619), +(22498, '杨安镇', 4, 2619), +(22499, '胡家街道', 4, 2619), +(22500, '花园镇', 4, 2619), +(22501, '西段乡', 4, 2619), +(22502, '郑店镇', 4, 2619), +(22503, '郭家街道', 4, 2619), +(22504, '铁营乡', 4, 2619), +(22505, '黄夹镇', 4, 2619), +(22506, '东李官屯镇', 4, 2620), +(22507, '双庙镇', 4, 2620), +(22508, '夏津镇', 4, 2620), +(22509, '宋楼乡', 4, 2620), +(22510, '新盛店镇', 4, 2620), +(22511, '渡口驿乡', 4, 2620), +(22512, '田庄乡', 4, 2620); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22513, '白马湖镇', 4, 2620), +(22514, '苏留庄镇', 4, 2620), +(22515, '郑保屯镇', 4, 2620), +(22516, '雷集镇', 4, 2620), +(22517, '香赵庄镇', 4, 2620), +(22518, '保店镇', 4, 2621), +(22519, '刘营伍乡', 4, 2621), +(22520, '大曹镇', 4, 2621), +(22521, '大柳镇', 4, 2621), +(22522, '宁津镇', 4, 2621), +(22523, '张大庄乡', 4, 2621), +(22524, '时集镇', 4, 2621), +(22525, '杜集镇', 4, 2621), +(22526, '柴胡店镇', 4, 2621), +(22527, '相衙镇', 4, 2621), +(22528, '长官镇', 4, 2621), +(22529, '三唐乡', 4, 2622), +(22530, '前曹镇', 4, 2622), +(22531, '坊子乡', 4, 2622), +(22532, '平原镇', 4, 2622), +(22533, '张华镇', 4, 2622), +(22534, '恩城镇', 4, 2622), +(22535, '王庙镇', 4, 2622), +(22536, '王打卦乡', 4, 2622), +(22537, '王杲铺镇', 4, 2622), +(22538, '王风楼镇', 4, 2622), +(22539, '腰站镇', 4, 2622), +(22540, '东辛店乡', 4, 2623), +(22541, '严务乡', 4, 2623), +(22542, '中丁乡', 4, 2623), +(22543, '尚堂镇', 4, 2623), +(22544, '崔口镇', 4, 2623), +(22545, '常家镇', 4, 2623), +(22546, '庆云镇', 4, 2623), +(22547, '徐园子乡', 4, 2623), +(22548, '渤海路街道', 4, 2623), +(22549, '东地街道', 4, 2624), +(22550, '二屯镇', 4, 2624), +(22551, '天衢街道', 4, 2624), +(22552, '宋官屯镇', 4, 2624), +(22553, '抬头寺乡', 4, 2624), +(22554, '新华街道', 4, 2624), +(22555, '新湖街道', 4, 2624), +(22556, '袁桥乡', 4, 2624), +(22557, '赵虎镇', 4, 2624), +(22558, '运河街道', 4, 2624), +(22559, '黄河涯镇', 4, 2624), +(22560, '李家户乡', 4, 2625), +(22561, '杨庄乡', 4, 2625), +(22562, '武城镇', 4, 2625), +(22563, '甲马营乡', 4, 2625), +(22564, '老城镇', 4, 2625), +(22565, '膝庄镇', 4, 2625), +(22566, '郝王庄镇', 4, 2625), +(22567, '鲁权屯镇', 4, 2625), +(22568, '伦镇', 4, 2626), +(22569, '十里望回族乡', 4, 2626), +(22570, '安仁镇', 4, 2626), +(22571, '张庄镇', 4, 2626), +(22572, '房寺镇', 4, 2626), +(22573, '李屯乡', 4, 2626), +(22574, '禹石街道', 4, 2626), +(22575, '粱家镇', 4, 2626); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22576, '莒镇乡', 4, 2626), +(22577, '辛寨镇', 4, 2626), +(22578, '辛店镇', 4, 2626), +(22579, '丁庄乡', 4, 2627), +(22580, '义渡口乡', 4, 2627), +(22581, '于集乡', 4, 2627), +(22582, '前孙镇', 4, 2627), +(22583, '宋家镇', 4, 2627), +(22584, '徽王庄镇', 4, 2627), +(22585, '滋镇', 4, 2627), +(22586, '神头镇', 4, 2627), +(22587, '边临镇', 4, 2627), +(22588, '郑家寨镇', 4, 2627), +(22589, '陵城镇', 4, 2627), +(22590, '麋镇', 4, 2627), +(22591, '仁里集镇', 4, 2628), +(22592, '刘桥乡', 4, 2628), +(22593, '华店乡', 4, 2628), +(22594, '大黄乡', 4, 2628), +(22595, '安头乡', 4, 2628), +(22596, '宣章屯镇', 4, 2628), +(22597, '晏城镇', 4, 2628), +(22598, '潘店镇', 4, 2628), +(22599, '焦庙镇', 4, 2628), +(22600, '祝阿镇', 4, 2628), +(22601, '胡官屯镇', 4, 2628), +(22602, '表白寺镇', 4, 2628), +(22603, '赵官镇', 4, 2628), +(22604, '马集乡', 4, 2628), +(22605, '于集镇', 4, 2629), +(22606, '侯营镇', 4, 2629), +(22607, '凤凰办事处', 4, 2629), +(22608, '北城办事处', 4, 2629), +(22609, '古楼办事处', 4, 2629), +(22610, '堂邑镇', 4, 2629), +(22611, '张炉集镇', 4, 2629), +(22612, '斗虎屯镇', 4, 2629), +(22613, '新区办事处', 4, 2629), +(22614, '朱老庄乡', 4, 2629), +(22615, '柳园办事处', 4, 2629), +(22616, '梁水镇', 4, 2629), +(22617, '沙镇', 4, 2629), +(22618, '湖西办事处', 4, 2629), +(22619, '许营乡', 4, 2629), +(22620, '道口铺办事处', 4, 2629), +(22621, '郑家镇', 4, 2629), +(22622, '阎寺办事处', 4, 2629), +(22623, '刘集镇', 4, 2630), +(22624, '单庄乡', 4, 2630), +(22625, '大桥镇', 4, 2630), +(22626, '姚寨镇', 4, 2630), +(22627, '姜楼镇', 4, 2630), +(22628, '工业园', 4, 2630), +(22629, '新城办事处', 4, 2630), +(22630, '牛角店镇', 4, 2630), +(22631, '铜城办事处', 4, 2630), +(22632, '陈集乡', 4, 2630), +(22633, '顾官屯镇', 4, 2630), +(22634, '高集镇', 4, 2630), +(22635, '先锋办事处', 4, 2631), +(22636, '八岔路镇', 4, 2631), +(22637, '刘垓子镇', 4, 2631); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22638, '唐园镇', 4, 2631), +(22639, '大辛庄办事处', 4, 2631), +(22640, '尚店乡', 4, 2631), +(22641, '康庄镇', 4, 2631), +(22642, '戴湾乡', 4, 2631), +(22643, '新华办事处', 4, 2631), +(22644, '松林镇', 4, 2631), +(22645, '潘庄镇', 4, 2631), +(22646, '烟店镇', 4, 2631), +(22647, '老赵庄镇', 4, 2631), +(22648, '金郝庄乡', 4, 2631), +(22649, '青年办事处', 4, 2631), +(22650, '魏湾镇', 4, 2631), +(22651, '万善乡', 4, 2632), +(22652, '东古城镇', 4, 2632), +(22653, '兰沃乡', 4, 2632), +(22654, '冠城镇', 4, 2632), +(22655, '北馆陶镇', 4, 2632), +(22656, '定远寨乡', 4, 2632), +(22657, '店子乡', 4, 2632), +(22658, '斜店乡', 4, 2632), +(22659, '柳林镇', 4, 2632), +(22660, '桑阿镇', 4, 2632), +(22661, '梁堂乡', 4, 2632), +(22662, '清水镇', 4, 2632), +(22663, '烟庄乡', 4, 2632), +(22664, '甘官屯乡', 4, 2632), +(22665, '范寨乡', 4, 2632), +(22666, '贾镇', 4, 2632), +(22667, '辛集乡', 4, 2632), +(22668, '丁块乡', 4, 2633), +(22669, '乐平铺镇', 4, 2633), +(22670, '冯官屯镇', 4, 2633), +(22671, '博平镇', 4, 2633), +(22672, '大桑乡', 4, 2633), +(22673, '孙桥乡', 4, 2633), +(22674, '广平乡', 4, 2633), +(22675, '张营乡', 4, 2633), +(22676, '杜郎口镇', 4, 2633), +(22677, '杨官屯乡', 4, 2633), +(22678, '洪官屯乡', 4, 2633), +(22679, '温陈乡', 4, 2633), +(22680, '王老乡', 4, 2633), +(22681, '肖庄乡', 4, 2633), +(22682, '胡屯乡', 4, 2633), +(22683, '茌平镇', 4, 2633), +(22684, '菜屯镇', 4, 2633), +(22685, '贾寨乡', 4, 2633), +(22686, '赵官屯乡', 4, 2633), +(22687, '郝集乡', 4, 2633), +(22688, '韩屯镇', 4, 2633), +(22689, '韩集乡', 4, 2633), +(22690, '俎店乡', 4, 2634), +(22691, '十八里铺镇', 4, 2634), +(22692, '古云镇', 4, 2634), +(22693, '古城镇', 4, 2634), +(22694, '大张家镇', 4, 2634), +(22695, '大王寨乡', 4, 2634), +(22696, '妹冢镇', 4, 2634), +(22697, '张寨乡', 4, 2634), +(22698, '张鲁镇', 4, 2634), +(22699, '徐庄乡', 4, 2634), +(22700, '朝城镇', 4, 2634), +(22701, '柿子园乡', 4, 2634); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22702, '樱桃园镇', 4, 2634), +(22703, '河店镇', 4, 2634), +(22704, '燕店镇', 4, 2634), +(22705, '王奉镇', 4, 2634), +(22706, '王庄集乡', 4, 2634), +(22707, '莘亭镇', 4, 2634), +(22708, '莘城镇', 4, 2634), +(22709, '董杜庄镇', 4, 2634), +(22710, '观城镇', 4, 2634), +(22711, '魏庄乡', 4, 2634), +(22712, '七级', 4, 2635), +(22713, '侨润', 4, 2635), +(22714, '十五里园', 4, 2635), +(22715, '博济桥', 4, 2635), +(22716, '大布', 4, 2635), +(22717, '安乐', 4, 2635), +(22718, '定水', 4, 2635), +(22719, '寿张', 4, 2635), +(22720, '张秋', 4, 2635), +(22721, '李台', 4, 2635), +(22722, '狮子楼', 4, 2635), +(22723, '石佛', 4, 2635), +(22724, '西湖', 4, 2635), +(22725, '郭屯', 4, 2635), +(22726, '金斗营', 4, 2635), +(22727, '闫楼', 4, 2635), +(22728, '阿城', 4, 2635), +(22729, '高庙王', 4, 2635), +(22730, '三十里铺镇', 4, 2636), +(22731, '人和街道办事处', 4, 2636), +(22732, '固河镇', 4, 2636), +(22733, '姜店乡', 4, 2636), +(22734, '尹集镇', 4, 2636), +(22735, '杨屯乡', 4, 2636), +(22736, '梁村镇', 4, 2636), +(22737, '汇鑫街道办事处', 4, 2636), +(22738, '清平镇', 4, 2636), +(22739, '琉寺镇', 4, 2636), +(22740, '赵寨子乡', 4, 2636), +(22741, '鱼邱湖街道办事处', 4, 2636), +(22742, '乔庄镇', 4, 2637), +(22743, '兴福镇', 4, 2637), +(22744, '博兴镇', 4, 2637), +(22745, '吕艺镇', 4, 2637), +(22746, '店子镇', 4, 2637), +(22747, '庞家镇', 4, 2637), +(22748, '曹王镇', 4, 2637), +(22749, '湖滨镇', 4, 2637), +(22750, '纯化镇', 4, 2637), +(22751, '陈户镇', 4, 2637), +(22752, '何坊乡', 4, 2638), +(22753, '大年陈乡', 4, 2638), +(22754, '姜楼镇', 4, 2638), +(22755, '惠民镇', 4, 2638), +(22756, '李庄镇', 4, 2638), +(22757, '桑落墅镇', 4, 2638), +(22758, '淄角镇', 4, 2638), +(22759, '清河镇', 4, 2638), +(22760, '皂户李乡', 4, 2638), +(22761, '石庙镇', 4, 2638), +(22762, '胡集镇', 4, 2638), +(22763, '辛店乡', 4, 2638), +(22764, '魏集镇', 4, 2638), +(22765, '麻店镇', 4, 2638), +(22766, '佘家巷乡', 4, 2639); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22767, '信阳乡', 4, 2639), +(22768, '埕口镇', 4, 2639), +(22769, '小泊头镇', 4, 2639), +(22770, '无棣镇', 4, 2639), +(22771, '柳堡乡', 4, 2639), +(22772, '水湾镇', 4, 2639), +(22773, '碣石山镇', 4, 2639), +(22774, '西小王乡', 4, 2639), +(22775, '车镇乡', 4, 2639), +(22776, '马山子镇', 4, 2639), +(22777, '下河乡', 4, 2640), +(22778, '下洼镇', 4, 2640), +(22779, '冯家镇', 4, 2640), +(22780, '利国乡', 4, 2640), +(22781, '古城镇', 4, 2640), +(22782, '大高镇', 4, 2640), +(22783, '富国镇', 4, 2640), +(22784, '泊头镇', 4, 2640), +(22785, '海防办事处', 4, 2640), +(22786, '滨海乡', 4, 2640), +(22787, '黄升乡', 4, 2640), +(22788, '北镇街道', 4, 2641), +(22789, '单寺乡', 4, 2641), +(22790, '堡集镇', 4, 2641), +(22791, '小营街道', 4, 2641), +(22792, '尚集乡', 4, 2641), +(22793, '市东街道', 4, 2641), +(22794, '市中街道', 4, 2641), +(22795, '市西街道', 4, 2641), +(22796, '彭李街道', 4, 2641), +(22797, '旧镇', 4, 2641), +(22798, '杜店镇', 4, 2641), +(22799, '梁才街道', 4, 2641), +(22800, '滨北街道', 4, 2641), +(22801, '里则街道', 4, 2641), +(22802, '临池镇', 4, 2642), +(22803, '九户镇', 4, 2642), +(22804, '台子镇', 4, 2642), +(22805, '好升镇', 4, 2642), +(22806, '孙镇', 4, 2642), +(22807, '明集镇', 4, 2642), +(22808, '焦桥镇', 4, 2642), +(22809, '码头镇', 4, 2642), +(22810, '西董镇', 4, 2642), +(22811, '长山镇', 4, 2642), +(22812, '青阳镇', 4, 2642), +(22813, '韩店镇', 4, 2642), +(22814, '高新街道', 4, 2642), +(22815, '魏桥镇', 4, 2642), +(22816, '黄山街道', 4, 2642), +(22817, '黛溪街道', 4, 2642), +(22818, '劳店乡', 4, 2643), +(22819, '商店镇', 4, 2643), +(22820, '水落坡乡', 4, 2643), +(22821, '河流镇', 4, 2643), +(22822, '洋湖乡', 4, 2643), +(22823, '流坡坞镇', 4, 2643), +(22824, '温店镇', 4, 2643), +(22825, '翟王镇', 4, 2643), +(22826, '阳信镇', 4, 2643), +(22827, '三春集镇', 4, 2644), +(22828, '东明集镇', 4, 2644), +(22829, '刘楼镇', 4, 2644), +(22830, '城关镇', 4, 2644); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22831, '大屯镇', 4, 2644), +(22832, '小井乡', 4, 2644), +(22833, '武胜桥乡', 4, 2644), +(22834, '沙窝乡', 4, 2644), +(22835, '焦园乡', 4, 2644), +(22836, '菜园集乡', 4, 2644), +(22837, '长兴集乡', 4, 2644), +(22838, '陆圈镇', 4, 2644), +(22839, '马头镇', 4, 2644), +(22840, '单城镇', 4, 2645), +(22841, '孙溜镇', 4, 2645), +(22842, '张集乡', 4, 2645), +(22843, '徐寨镇', 4, 2645), +(22844, '时楼镇', 4, 2645), +(22845, '曹庄镇', 4, 2645), +(22846, '朱集镇', 4, 2645), +(22847, '李新庄', 4, 2645), +(22848, '李田楼乡', 4, 2645), +(22849, '杨楼镇', 4, 2645), +(22850, '浮岗镇', 4, 2645), +(22851, '终兴镇', 4, 2645), +(22852, '莱河镇', 4, 2645), +(22853, '蔡堂镇', 4, 2645), +(22854, '谢集乡', 4, 2645), +(22855, '郭村镇', 4, 2645), +(22856, '高老家乡', 4, 2645), +(22857, '高韦庄镇', 4, 2645), +(22858, '黄岗镇', 4, 2645), +(22859, '龙王庙乡', 4, 2645), +(22860, '仿山乡', 4, 2646), +(22861, '冉固镇', 4, 2646), +(22862, '半堤乡', 4, 2646), +(22863, '南王店乡', 4, 2646), +(22864, '孟海镇', 4, 2646), +(22865, '定陶镇', 4, 2646), +(22866, '张湾乡', 4, 2646), +(22867, '杜堂乡', 4, 2646), +(22868, '陈集镇', 4, 2646), +(22869, '马集镇', 4, 2646), +(22870, '黄店镇', 4, 2646), +(22871, '万丰镇', 4, 2647), +(22872, '大义镇', 4, 2647), +(22873, '大谢集镇', 4, 2647), +(22874, '太平镇', 4, 2647), +(22875, '巨野镇', 4, 2647), +(22876, '柳林镇', 4, 2647), +(22877, '核桃园镇', 4, 2647), +(22878, '独山镇', 4, 2647), +(22879, '田庄镇', 4, 2647), +(22880, '田桥镇', 4, 2647), +(22881, '章缝镇', 4, 2647), +(22882, '营里镇', 4, 2647), +(22883, '董官屯镇', 4, 2647), +(22884, '陶庙镇', 4, 2647), +(22885, '麒麟镇', 4, 2647), +(22886, '龙堌镇', 4, 2647), +(22887, '九女镇', 4, 2648), +(22888, '伯乐镇', 4, 2648), +(22889, '党集乡', 4, 2648), +(22890, '南鲁镇', 4, 2648), +(22891, '大田集镇', 4, 2648), +(22892, '天宫镇', 4, 2648), +(22893, '孙寺镇', 4, 2648), +(22894, '张楼乡', 4, 2648), +(22895, '成武镇', 4, 2648); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22896, '汶上镇', 4, 2648), +(22897, '白浮镇', 4, 2648), +(22898, '苟村镇', 4, 2648), +(22899, '仵楼乡', 4, 2649), +(22900, '侯集回族镇', 4, 2649), +(22901, '倪集乡', 4, 2649), +(22902, '南李集乡', 4, 2649), +(22903, '古营集镇', 4, 2649), +(22904, '大寨集乡', 4, 2649), +(22905, '大集乡', 4, 2649), +(22906, '孙老家镇', 4, 2649), +(22907, '安仁集乡', 4, 2649), +(22908, '安蔡楼镇', 4, 2649), +(22909, '常乐集乡', 4, 2649), +(22910, '庄寨镇', 4, 2649), +(22911, '普连集镇', 4, 2649), +(22912, '曹城镇', 4, 2649), +(22913, '朱洪庙乡', 4, 2649), +(22914, '桃源集镇', 4, 2649), +(22915, '梁堤头镇', 4, 2649), +(22916, '楼庄乡', 4, 2649), +(22917, '王集镇', 4, 2649), +(22918, '申楼乡', 4, 2649), +(22919, '砖庙镇', 4, 2649), +(22920, '苏集镇', 4, 2649), +(22921, '莘冢集乡', 4, 2649), +(22922, '邵庄镇', 4, 2649), +(22923, '郑庄乡', 4, 2649), +(22924, '阎店楼镇', 4, 2649), +(22925, '青堌集镇', 4, 2649), +(22926, '青岗集乡', 4, 2649), +(22927, '韩集镇', 4, 2649), +(22928, '魏湾镇', 4, 2649), +(22929, '龚楼乡', 4, 2649), +(22930, '万福办事处', 4, 2650), +(22931, '东城办事处', 4, 2650), +(22932, '何楼办事处', 4, 2650), +(22933, '北城办事处', 4, 2650), +(22934, '南城办事处', 4, 2650), +(22935, '吕陵镇', 4, 2650), +(22936, '吴店镇', 4, 2650), +(22937, '大黄集镇', 4, 2650), +(22938, '安兴镇', 4, 2650), +(22939, '小留镇', 4, 2650), +(22940, '李村镇', 4, 2650), +(22941, '沙土镇', 4, 2650), +(22942, '牡丹办事处', 4, 2650), +(22943, '王浩屯镇', 4, 2650), +(22944, '皇镇', 4, 2650), +(22945, '胡集镇', 4, 2650), +(22946, '西城办事处', 4, 2650), +(22947, '都司镇', 4, 2650), +(22948, '马岭岗镇', 4, 2650), +(22949, '高庄镇', 4, 2650), +(22950, '黄堽镇', 4, 2650), +(22951, '丁里长镇', 4, 2651), +(22952, '侯咽集镇', 4, 2651), +(22953, '南赵楼乡', 4, 2651), +(22954, '双桥乡', 4, 2651), +(22955, '唐庙乡', 4, 2651), +(22956, '张营镇', 4, 2651), +(22957, '张鲁集乡', 4, 2651); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(22958, '李集乡', 4, 2651), +(22959, '杨庄集镇', 4, 2651), +(22960, '武安镇', 4, 2651), +(22961, '水堡乡', 4, 2651), +(22962, '潘渡乡', 4, 2651), +(22963, '玉皇庙镇', 4, 2651), +(22964, '程屯镇', 4, 2651), +(22965, '郓城镇', 4, 2651), +(22966, '郭屯镇', 4, 2651), +(22967, '陈坡乡', 4, 2651), +(22968, '随官屯镇', 4, 2651), +(22969, '黄堆集乡', 4, 2651), +(22970, '黄安镇', 4, 2651), +(22971, '黄集乡', 4, 2651), +(22972, '临卜镇', 4, 2652), +(22973, '什集镇', 4, 2652), +(22974, '凤凰乡', 4, 2652), +(22975, '吉山镇', 4, 2652), +(22976, '大埝乡', 4, 2652), +(22977, '富春乡', 4, 2652), +(22978, '左营乡', 4, 2652), +(22979, '引马乡', 4, 2652), +(22980, '彭楼镇', 4, 2652), +(22981, '旧城镇', 4, 2652), +(22982, '李进士堂镇', 4, 2652), +(22983, '红船镇', 4, 2652), +(22984, '董口镇', 4, 2652), +(22985, '郑营乡', 4, 2652), +(22986, '鄄城镇', 4, 2652), +(22987, '闫什镇', 4, 2652), +(22988, '中心路街道', 4, 2653), +(22989, '峡窝镇', 4, 2653), +(22990, '工业路街道', 4, 2653), +(22991, '新安路街道', 4, 2653), +(22992, '济源路街道', 4, 2653), +(22993, '矿山街道', 4, 2653), +(22994, '三官庙街道', 4, 2654), +(22995, '中原西路街道', 4, 2654), +(22996, '建设路街道', 4, 2654), +(22997, '林山寨街道', 4, 2654), +(22998, '桐柏路街道', 4, 2654), +(22999, '棉纺路街道', 4, 2654), +(23000, '汝河路街道', 4, 2654), +(23001, '沟赵乡', 4, 2654), +(23002, '石佛镇', 4, 2654), +(23003, '秦岭路街道', 4, 2654), +(23004, '绿东村街道', 4, 2654), +(23005, '航海西路街道', 4, 2654), +(23006, '须水镇', 4, 2654), +(23007, '万滩镇', 4, 2655), +(23008, '三官庙乡', 4, 2655), +(23009, '九龙镇', 4, 2655), +(23010, '八岗乡', 4, 2655), +(23011, '刁家乡', 4, 2655), +(23012, '刘集乡', 4, 2655), +(23013, '城关镇', 4, 2655), +(23014, '大孟镇', 4, 2655), +(23015, '姚家乡', 4, 2655), +(23016, '官渡镇', 4, 2655), +(23017, '张庄镇', 4, 2655), +(23018, '狼城岗镇', 4, 2655), +(23019, '白沙镇', 4, 2655); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23020, '郑庵镇', 4, 2655), +(23021, '雁鸣湖乡', 4, 2655), +(23022, '韩寺镇', 4, 2655), +(23023, '黄店镇', 4, 2655), +(23024, '一马路街道', 4, 2656), +(23025, '五里堡街道', 4, 2656), +(23026, '京广路街道', 4, 2656), +(23027, '侯寨乡', 4, 2656), +(23028, '大学路街道', 4, 2656), +(23029, '嵩山路街道', 4, 2656), +(23030, '建中街街道', 4, 2656), +(23031, '德化街街道', 4, 2656), +(23032, '淮河路街道', 4, 2656), +(23033, '福华街街道', 4, 2656), +(23034, '蜜蜂张街道', 4, 2656), +(23035, '解放路街道', 4, 2656), +(23036, '铭功路街道', 4, 2656), +(23037, '长江路街道', 4, 2656), +(23038, '马寨镇', 4, 2656), +(23039, '北山口镇', 4, 2657), +(23040, '回郭镇', 4, 2657), +(23041, '大峪沟镇', 4, 2657), +(23042, '夹津口镇', 4, 2657), +(23043, '孝义街道', 4, 2657), +(23044, '小关镇', 4, 2657), +(23045, '康店镇', 4, 2657), +(23046, '新中镇', 4, 2657), +(23047, '新华路街道', 4, 2657), +(23048, '杜甫路街道', 4, 2657), +(23049, '永安路街道', 4, 2657), +(23050, '河洛镇', 4, 2657), +(23051, '涉村镇', 4, 2657), +(23052, '站街镇', 4, 2657), +(23053, '竹林镇', 4, 2657), +(23054, '米河镇', 4, 2657), +(23055, '紫荆路街道', 4, 2657), +(23056, '芝田镇', 4, 2657), +(23057, '西村镇', 4, 2657), +(23058, '鲁庄镇', 4, 2657), +(23059, '刘寨街道', 4, 2658), +(23060, '古荥镇', 4, 2658), +(23061, '大河路街道', 4, 2658), +(23062, '新城街道', 4, 2658), +(23063, '老鸦陈街道', 4, 2658), +(23064, '花园口镇', 4, 2658), +(23065, '迎宾路街道', 4, 2658), +(23066, '长兴路街道', 4, 2658), +(23067, '刘寨镇', 4, 2659), +(23068, '城关镇', 4, 2659), +(23069, '大隗镇', 4, 2659), +(23070, '岳村镇', 4, 2659), +(23071, '平陌镇', 4, 2659), +(23072, '新华路街道', 4, 2659), +(23073, '曲梁乡', 4, 2659), +(23074, '来集镇', 4, 2659), +(23075, '牛店镇', 4, 2659), +(23076, '白寨镇', 4, 2659), +(23077, '矿区街道', 4, 2659), +(23078, '米村镇', 4, 2659), +(23079, '苟堂镇', 4, 2659); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23080, '袁庄乡', 4, 2659), +(23081, '西大街街道', 4, 2659), +(23082, '超化镇', 4, 2659), +(23083, '青屏街街道', 4, 2659), +(23084, '八千乡', 4, 2660), +(23085, '和庄镇', 4, 2660), +(23086, '城关乡', 4, 2660), +(23087, '孟庄镇', 4, 2660), +(23088, '新华路街道', 4, 2660), +(23089, '新建路街道', 4, 2660), +(23090, '新村镇', 4, 2660), +(23091, '新烟街道', 4, 2660), +(23092, '梨河镇', 4, 2660), +(23093, '薛店镇', 4, 2660), +(23094, '观音寺镇', 4, 2660), +(23095, '辛店镇', 4, 2660), +(23096, '郭店镇', 4, 2660), +(23097, '龙湖镇', 4, 2660), +(23098, '龙王乡', 4, 2660), +(23099, '东金店乡', 4, 2661), +(23100, '中岳街道', 4, 2661), +(23101, '卢店镇', 4, 2661), +(23102, '君召乡', 4, 2661), +(23103, '告成镇', 4, 2661), +(23104, '唐庄乡', 4, 2661), +(23105, '大冶镇', 4, 2661), +(23106, '大金店镇', 4, 2661), +(23107, '宣化镇', 4, 2661), +(23108, '少林街道', 4, 2661), +(23109, '嵩阳街道', 4, 2661), +(23110, '徐庄乡', 4, 2661), +(23111, '白坪乡', 4, 2661), +(23112, '石道乡', 4, 2661), +(23113, '颖阳镇', 4, 2661), +(23114, '东大街街道', 4, 2662), +(23115, '二里岗街道', 4, 2662), +(23116, '十八里河镇', 4, 2662), +(23117, '南关街道', 4, 2662), +(23118, '南曹乡', 4, 2662), +(23119, '圃田乡', 4, 2662), +(23120, '城东路街道', 4, 2662), +(23121, '明湖街道', 4, 2662), +(23122, '紫荆山南路街道', 4, 2662), +(23123, '经济开发区潮河街道', 4, 2662), +(23124, '航海东路街道', 4, 2662), +(23125, '西大街街道', 4, 2662), +(23126, '陇海路街道', 4, 2662), +(23127, '乔楼镇', 4, 2663), +(23128, '京城街道', 4, 2663), +(23129, '刘河镇', 4, 2663), +(23130, '城关乡', 4, 2663), +(23131, '崔庙镇', 4, 2663), +(23132, '广武镇', 4, 2663), +(23133, '汜水镇', 4, 2663), +(23134, '王村镇', 4, 2663), +(23135, '索河街道', 4, 2663), +(23136, '豫龙镇', 4, 2663), +(23137, '贾峪镇', 4, 2663), +(23138, '金寨回族乡', 4, 2663), +(23139, '高山镇', 4, 2663), +(23140, '高村乡', 4, 2663); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23141, '东风路街道', 4, 2664), +(23142, '丰产路街道', 4, 2664), +(23143, '人民路街道', 4, 2664), +(23144, '凤凰台街道', 4, 2664), +(23145, '北林路街道', 4, 2664), +(23146, '南阳新村街道', 4, 2664), +(23147, '南阳路街道', 4, 2664), +(23148, '大石桥街道', 4, 2664), +(23149, '庙李镇', 4, 2664), +(23150, '文化路街道', 4, 2664), +(23151, '未来路街道', 4, 2664), +(23152, '杜岭街街道', 4, 2664), +(23153, '柳林镇', 4, 2664), +(23154, '祭城路街道', 4, 2664), +(23155, '经八路街道', 4, 2664), +(23156, '花园路街道', 4, 2664), +(23157, '龙子湖街道', 4, 2664), +(23158, '三义寨乡', 4, 2665), +(23159, '仪封乡', 4, 2665), +(23160, '南彰镇', 4, 2665), +(23161, '固阳镇', 4, 2665), +(23162, '坝头乡', 4, 2665), +(23163, '城关乡', 4, 2665), +(23164, '城关镇', 4, 2665), +(23165, '孟寨乡', 4, 2665), +(23166, '小宋乡', 4, 2665), +(23167, '张君墓镇', 4, 2665), +(23168, '爪营乡', 4, 2665), +(23169, '红庙镇', 4, 2665), +(23170, '葡萄架乡', 4, 2665), +(23171, '许河乡', 4, 2665), +(23172, '谷营乡', 4, 2665), +(23173, '闫楼乡', 4, 2665), +(23174, '十八里镇', 4, 2666), +(23175, '南曹乡', 4, 2666), +(23176, '城关镇', 4, 2666), +(23177, '大桥乡', 4, 2666), +(23178, '大营乡', 4, 2666), +(23179, '大马乡', 4, 2666), +(23180, '小陈乡', 4, 2666), +(23181, '岗李乡', 4, 2666), +(23182, '庄头乡', 4, 2666), +(23183, '张市镇', 4, 2666), +(23184, '朱曲镇', 4, 2666), +(23185, '水坡镇', 4, 2666), +(23186, '永兴镇', 4, 2666), +(23187, '洧川镇', 4, 2666), +(23188, '蔡庄镇', 4, 2666), +(23189, '邢庄乡', 4, 2666), +(23190, '门楼任乡', 4, 2666), +(23191, '万隆乡', 4, 2667), +(23192, '仇楼镇', 4, 2667), +(23193, '八里湾镇', 4, 2667), +(23194, '兴隆乡', 4, 2667), +(23195, '刘店乡', 4, 2667), +(23196, '半坡店乡', 4, 2667), +(23197, '城关镇', 4, 2667), +(23198, '曲兴镇', 4, 2667), +(23199, '朱仙镇', 4, 2667), +(23200, '杜良乡', 4, 2667), +(23201, '罗王乡', 4, 2667), +(23202, '范村乡', 4, 2667); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23203, '袁坊乡', 4, 2667), +(23204, '西姜寨乡', 4, 2667), +(23205, '陈留镇', 4, 2667), +(23206, '于镇镇', 4, 2668), +(23207, '五里河镇', 4, 2668), +(23208, '付集镇', 4, 2668), +(23209, '城关镇', 4, 2668), +(23210, '城郊乡', 4, 2668), +(23211, '宗店乡', 4, 2668), +(23212, '官庄乡', 4, 2668), +(23213, '平城乡', 4, 2668), +(23214, '板木乡', 4, 2668), +(23215, '柿元乡', 4, 2668), +(23216, '沙活乡', 4, 2668), +(23217, '泥沟乡', 4, 2668), +(23218, '湖岗乡', 4, 2668), +(23219, '竹林乡', 4, 2668), +(23220, '苏木乡', 4, 2668), +(23221, '葛岗镇', 4, 2668), +(23222, '裴村店乡', 4, 2668), +(23223, '西寨乡', 4, 2668), +(23224, '邢口镇', 4, 2668), +(23225, '阳固镇', 4, 2668), +(23226, '高阳镇', 4, 2668), +(23227, '三里堡街道', 4, 2669), +(23228, '五一街道', 4, 2669), +(23229, '南郊乡', 4, 2669), +(23230, '官坊街道', 4, 2669), +(23231, '新门关街道', 4, 2669), +(23232, '汪屯乡', 4, 2669), +(23233, '繁塔街道', 4, 2669), +(23234, '菜市街道', 4, 2669), +(23235, '冯庄乡', 4, 2670), +(23236, '厉庄乡', 4, 2670), +(23237, '四所楼镇', 4, 2670), +(23238, '城关镇', 4, 2670), +(23239, '大岗李乡', 4, 2670), +(23240, '孙营乡', 4, 2670), +(23241, '朱砂镇', 4, 2670), +(23242, '玉皇庙镇', 4, 2670), +(23243, '竖岗镇', 4, 2670), +(23244, '练城乡', 4, 2670), +(23245, '邸阁乡', 4, 2670), +(23246, '长智镇', 4, 2670), +(23247, '杏花营农场', 4, 2671), +(23248, '杏花营镇', 4, 2671), +(23249, '经济技术开发区', 4, 2671), +(23250, '西郊乡', 4, 2671), +(23251, '东郊乡', 4, 2672), +(23252, '土柏岗乡', 4, 2672), +(23253, '宋门街道', 4, 2672), +(23254, '工业街道', 4, 2672), +(23255, '曹门街道', 4, 2672), +(23256, '清平街道', 4, 2672), +(23257, '苹果园街道', 4, 2672), +(23258, '铁塔街道', 4, 2672), +(23259, '仙人庄街道', 4, 2673), +(23260, '卧龙街道', 4, 2673), +(23261, '城西街道', 4, 2673), +(23262, '州桥街道', 4, 2673), +(23263, '新华街道', 4, 2673), +(23264, '相国寺街道', 4, 2673); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23265, '西司门街道', 4, 2673), +(23266, '北书店街道', 4, 2674), +(23267, '北道门街道', 4, 2674), +(23268, '北郊乡', 4, 2674), +(23269, '午朝门街道', 4, 2674), +(23270, '大兴街道', 4, 2674), +(23271, '柳园口乡', 4, 2674), +(23272, '半坡乡', 4, 2675), +(23273, '吕店乡', 4, 2675), +(23274, '呜皋镇', 4, 2675), +(23275, '城关镇', 4, 2675), +(23276, '平等乡', 4, 2675), +(23277, '彭婆镇', 4, 2675), +(23278, '水寨镇', 4, 2675), +(23279, '江左乡', 4, 2675), +(23280, '白元乡', 4, 2675), +(23281, '白沙乡', 4, 2675), +(23282, '葛寨乡', 4, 2675), +(23283, '酒后乡', 4, 2675), +(23284, '高山乡', 4, 2675), +(23285, '鸦岭乡', 4, 2675), +(23286, '佃庄镇', 4, 2676), +(23287, '城关镇', 4, 2676), +(23288, '大口乡', 4, 2676), +(23289, '寇店镇', 4, 2676), +(23290, '山化乡', 4, 2676), +(23291, '岳滩镇', 4, 2676), +(23292, '府店镇', 4, 2676), +(23293, '庞村镇', 4, 2676), +(23294, '李村镇', 4, 2676), +(23295, '缑氏镇', 4, 2676), +(23296, '翟镇镇', 4, 2676), +(23297, '诸葛镇', 4, 2676), +(23298, '邙岭乡', 4, 2676), +(23299, '顾县镇', 4, 2676), +(23300, '首阳山镇', 4, 2676), +(23301, '高龙镇', 4, 2676), +(23302, '吉利乡', 4, 2677), +(23303, '大庆路街道', 4, 2677), +(23304, '会盟镇', 4, 2678), +(23305, '城关镇', 4, 2678), +(23306, '小浪底镇', 4, 2678), +(23307, '常袋乡', 4, 2678), +(23308, '平乐镇', 4, 2678), +(23309, '朝阳镇', 4, 2678), +(23310, '横水镇', 4, 2678), +(23311, '白鹤镇', 4, 2678), +(23312, '送庄镇', 4, 2678), +(23313, '麻屯镇', 4, 2678), +(23314, '三乡乡', 4, 2679), +(23315, '上观乡', 4, 2679), +(23316, '丰李镇', 4, 2679), +(23317, '城关乡', 4, 2679), +(23318, '城关镇', 4, 2679), +(23319, '寻村镇', 4, 2679), +(23320, '张坞乡', 4, 2679), +(23321, '柳泉镇', 4, 2679), +(23322, '樊村乡', 4, 2679), +(23323, '白杨镇', 4, 2679), +(23324, '盐镇乡', 4, 2679), +(23325, '穆册乡', 4, 2679), +(23326, '莲庄乡', 4, 2679), +(23327, '董王庄乡', 4, 2679), +(23328, '赵保乡', 4, 2679); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23329, '韩城镇', 4, 2679), +(23330, '高村乡', 4, 2679), +(23331, '九店乡', 4, 2680), +(23332, '五马寺林场', 4, 2680), +(23333, '何村乡', 4, 2680), +(23334, '城关镇', 4, 2680), +(23335, '大坪乡', 4, 2680), +(23336, '大章乡', 4, 2680), +(23337, '库区乡', 4, 2680), +(23338, '德亭乡', 4, 2680), +(23339, '旧县镇', 4, 2680), +(23340, '木植街乡', 4, 2680), +(23341, '王莽寨林场', 4, 2680), +(23342, '田湖镇', 4, 2680), +(23343, '白河乡', 4, 2680), +(23344, '纸房乡', 4, 2680), +(23345, '车村镇', 4, 2680), +(23346, '阎庄乡', 4, 2680), +(23347, '陶村林场', 4, 2680), +(23348, '饭坡乡', 4, 2680), +(23349, '黄庄乡', 4, 2680), +(23350, '五头镇', 4, 2681), +(23351, '仓头乡', 4, 2681), +(23352, '北冶乡', 4, 2681), +(23353, '南李村乡', 4, 2681), +(23354, '城关镇', 4, 2681), +(23355, '曹村乡', 4, 2681), +(23356, '正村乡', 4, 2681), +(23357, '石井乡', 4, 2681), +(23358, '石寺镇', 4, 2681), +(23359, '磁涧镇', 4, 2681), +(23360, '铁门镇', 4, 2681), +(23361, '三川镇', 4, 2682), +(23362, '冷水镇', 4, 2682), +(23363, '叫河乡', 4, 2682), +(23364, '合峪镇', 4, 2682), +(23365, '城关镇', 4, 2682), +(23366, '庙子乡', 4, 2682), +(23367, '栾川乡', 4, 2682), +(23368, '潭头镇', 4, 2682), +(23369, '狮子庙乡', 4, 2682), +(23370, '白土乡', 4, 2682), +(23371, '石庙乡', 4, 2682), +(23372, '秋扒乡', 4, 2682), +(23373, '赤土店镇', 4, 2682), +(23374, '陶湾镇', 4, 2682), +(23375, '三屯乡', 4, 2683), +(23376, '上店镇', 4, 2683), +(23377, '付店镇', 4, 2683), +(23378, '内埠乡', 4, 2683), +(23379, '刘店乡', 4, 2683), +(23380, '勒村乡', 4, 2683), +(23381, '十八盘乡', 4, 2683), +(23382, '城关镇', 4, 2683), +(23383, '小店镇', 4, 2683), +(23384, '柏树乡', 4, 2683), +(23385, '王坪乡', 4, 2683), +(23386, '蔡店乡', 4, 2683), +(23387, '陶营乡', 4, 2683), +(23388, '上戈镇', 4, 2684), +(23389, '下峪乡', 4, 2684), +(23390, '东宋乡', 4, 2684), +(23391, '兴华乡', 4, 2684), +(23392, '城关镇', 4, 2684), +(23393, '城郊乡', 4, 2684); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23394, '小界乡', 4, 2684), +(23395, '山底乡', 4, 2684), +(23396, '底张乡', 4, 2684), +(23397, '故县乡', 4, 2684), +(23398, '河底乡', 4, 2684), +(23399, '涧口乡', 4, 2684), +(23400, '王范回族镇', 4, 2684), +(23401, '罗岭乡', 4, 2684), +(23402, '赵村乡', 4, 2684), +(23403, '长水乡', 4, 2684), +(23404, '陈昊乡', 4, 2684), +(23405, '马店乡', 4, 2684), +(23406, '关林镇', 4, 2685), +(23407, '古城乡', 4, 2685), +(23408, '安乐街道', 4, 2685), +(23409, '安乐镇', 4, 2685), +(23410, '李楼乡', 4, 2685), +(23411, '白马寺镇', 4, 2685), +(23412, '辛店镇', 4, 2685), +(23413, '镇北路街道', 4, 2685), +(23414, '龙门镇', 4, 2685), +(23415, '创业路街道', 4, 2686), +(23416, '南昌路街道', 4, 2686), +(23417, '周山路街道', 4, 2686), +(23418, '天津路街道', 4, 2686), +(23419, '孙旗屯乡', 4, 2686), +(23420, '工农乡', 4, 2686), +(23421, '徐家营街道', 4, 2686), +(23422, '武汉路街道', 4, 2686), +(23423, '湖北路街道', 4, 2686), +(23424, '珠江路街道', 4, 2686), +(23425, '郑州路街道', 4, 2686), +(23426, '重庆路街道', 4, 2686), +(23427, '长安路街道', 4, 2686), +(23428, '长春路街道', 4, 2686), +(23429, '东关街道', 4, 2687), +(23430, '五股路街道', 4, 2687), +(23431, '北窑街道', 4, 2687), +(23432, '塔湾街道', 4, 2687), +(23433, '杨文街道', 4, 2687), +(23434, '瀍河回族乡', 4, 2687), +(23435, '瀍西街道', 4, 2687), +(23436, '东北隅街道', 4, 2688), +(23437, '东南隅街道', 4, 2688), +(23438, '南关街道', 4, 2688), +(23439, '洛浦街道', 4, 2688), +(23440, '西关街道', 4, 2688), +(23441, '西北隅街道', 4, 2688), +(23442, '西南隅街道', 4, 2688), +(23443, '邙山镇', 4, 2688), +(23444, '凯旋东路街道', 4, 2689), +(23445, '唐宫路街道', 4, 2689), +(23446, '汉屯路街道', 4, 2689), +(23447, '洛北乡', 4, 2689), +(23448, '王城路街道', 4, 2689), +(23449, '红山乡', 4, 2689), +(23450, '西工街道', 4, 2689), +(23451, '道北路街道', 4, 2689), +(23452, '邙岭路街道', 4, 2689); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23453, '金谷园街道', 4, 2689), +(23454, '东安路街道', 4, 2690), +(23455, '东工人镇街道', 4, 2690), +(23456, '东环路街道', 4, 2690), +(23457, '东高皇乡', 4, 2690), +(23458, '五一路街道', 4, 2690), +(23459, '优越路街道', 4, 2690), +(23460, '光华路街道', 4, 2690), +(23461, '北环路街道', 4, 2690), +(23462, '建设路街道', 4, 2690), +(23463, '鸿鹰街道', 4, 2690), +(23464, '黄台街道', 4, 2690), +(23465, '仙台镇', 4, 2691), +(23466, '任店镇', 4, 2691), +(23467, '保安镇', 4, 2691), +(23468, '城关乡', 4, 2691), +(23469, '夏李乡', 4, 2691), +(23470, '常村乡', 4, 2691), +(23471, '廉村乡', 4, 2691), +(23472, '旧县乡', 4, 2691), +(23473, '昆阳镇', 4, 2691), +(23474, '水寨乡', 4, 2691), +(23475, '洪庄杨乡', 4, 2691), +(23476, '田庄乡', 4, 2691), +(23477, '辛店乡', 4, 2691), +(23478, '遵化店镇', 4, 2691), +(23479, '邓李乡', 4, 2691), +(23480, '马庄回族乡', 4, 2691), +(23481, '龙泉乡', 4, 2691), +(23482, '龚店乡', 4, 2691), +(23483, '前营乡', 4, 2692), +(23484, '周庄镇', 4, 2692), +(23485, '商酒务镇', 4, 2692), +(23486, '城关镇', 4, 2692), +(23487, '大营镇', 4, 2692), +(23488, '张八桥镇', 4, 2692), +(23489, '李庄乡', 4, 2692), +(23490, '杨庄镇', 4, 2692), +(23491, '石桥镇', 4, 2692), +(23492, '肖旗乡', 4, 2692), +(23493, '赵庄乡', 4, 2692), +(23494, '铁路街道', 4, 2692), +(23495, '闹店镇', 4, 2692), +(23496, '中兴路街道', 4, 2693), +(23497, '光明路街道', 4, 2693), +(23498, '新新街街道', 4, 2693), +(23499, '曙光街街道', 4, 2693), +(23500, '湖滨路街道', 4, 2693), +(23501, '湛河北路街道', 4, 2693), +(23502, '滍阳镇', 4, 2693), +(23503, '焦店镇', 4, 2693), +(23504, '矿工路街道', 4, 2693), +(23505, '西市场街道', 4, 2693), +(23506, '青石山街道', 4, 2693), +(23507, '临汝镇', 4, 2694), +(23508, '夏店乡', 4, 2694), +(23509, '大峪乡', 4, 2694), +(23510, '寄料镇', 4, 2694), +(23511, '小屯镇', 4, 2694), +(23512, '尚庄乡', 4, 2694), +(23513, '庙下乡', 4, 2694); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23514, '杨楼乡', 4, 2694), +(23515, '汝南街道', 4, 2694), +(23516, '洗耳河街道', 4, 2694), +(23517, '温泉镇', 4, 2694), +(23518, '焦村乡', 4, 2694), +(23519, '煤山街道', 4, 2694), +(23520, '王寨乡', 4, 2694), +(23521, '纸坊乡', 4, 2694), +(23522, '蟒川乡', 4, 2694), +(23523, '钟楼街道', 4, 2694), +(23524, '陵头乡', 4, 2694), +(23525, '风穴路街道', 4, 2694), +(23526, '骑岭乡', 4, 2694), +(23527, '九里山街道', 4, 2695), +(23528, '北渡镇', 4, 2695), +(23529, '南环路街道', 4, 2695), +(23530, '姚孟街道', 4, 2695), +(23531, '曹镇乡', 4, 2695), +(23532, '轻工路街道', 4, 2695), +(23533, '马庄街道', 4, 2695), +(23534, '人民路街道', 4, 2696), +(23535, '高庄街道', 4, 2696), +(23536, '龙兴街道', 4, 2696), +(23537, '龙河街道', 4, 2696), +(23538, '八台镇', 4, 2697), +(23539, '垭口街道', 4, 2697), +(23540, '寺坡街道', 4, 2697), +(23541, '尚店镇', 4, 2697), +(23542, '尹集镇', 4, 2697), +(23543, '庙街乡', 4, 2697), +(23544, '朱兰街道', 4, 2697), +(23545, '杨庄乡', 4, 2697), +(23546, '枣林乡', 4, 2697), +(23547, '武功乡', 4, 2697), +(23548, '铁山乡', 4, 2697), +(23549, '院岭街道', 4, 2697), +(23550, '冢头镇', 4, 2698), +(23551, '城关镇', 4, 2698), +(23552, '堂街镇', 4, 2698), +(23553, '姚庄回族乡', 4, 2698), +(23554, '安良镇', 4, 2698), +(23555, '广阔天地乡', 4, 2698), +(23556, '李口乡', 4, 2698), +(23557, '渣元乡', 4, 2698), +(23558, '王集乡', 4, 2698), +(23559, '白庙乡', 4, 2698), +(23560, '茨芭乡', 4, 2698), +(23561, '薛店镇', 4, 2698), +(23562, '长桥镇', 4, 2698), +(23563, '黄道乡', 4, 2698), +(23564, '下汤镇', 4, 2699), +(23565, '仓头乡', 4, 2699), +(23566, '四棵树乡', 4, 2699), +(23567, '尧山镇', 4, 2699), +(23568, '张官营镇', 4, 2699), +(23569, '张店乡', 4, 2699), +(23570, '张良镇', 4, 2699), +(23571, '昭平台库区乡', 4, 2699), +(23572, '梁洼镇', 4, 2699), +(23573, '瀼河乡', 4, 2699), +(23574, '熊背乡', 4, 2699), +(23575, '瓦屋乡', 4, 2699); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23576, '磙子营乡', 4, 2699), +(23577, '背孜乡', 4, 2699), +(23578, '董周乡', 4, 2699), +(23579, '赵村乡', 4, 2699), +(23580, '辛集乡', 4, 2699), +(23581, '马楼乡', 4, 2699), +(23582, '鲁阳镇', 4, 2699), +(23583, '鸡冢乡', 4, 2699), +(23584, '东庄镇', 4, 2700), +(23585, '中召乡', 4, 2700), +(23586, '二安乡', 4, 2700), +(23587, '井店镇', 4, 2700), +(23588, '亳城乡', 4, 2700), +(23589, '六村乡', 4, 2700), +(23590, '后河镇', 4, 2700), +(23591, '城关镇', 4, 2700), +(23592, '宋村乡', 4, 2700), +(23593, '张龙乡', 4, 2700), +(23594, '梁庄镇', 4, 2700), +(23595, '楚旺镇', 4, 2700), +(23596, '田氏乡', 4, 2700), +(23597, '石盘屯乡', 4, 2700), +(23598, '豆公乡', 4, 2700), +(23599, '马上乡', 4, 2700), +(23600, '高堤乡', 4, 2700), +(23601, '彰东街道', 4, 2701), +(23602, '彰北街道', 4, 2701), +(23603, '曙光路街道', 4, 2701), +(23604, '民航路街道', 4, 2701), +(23605, '洹北街道', 4, 2701), +(23606, '灯塔路街道', 4, 2701), +(23607, '红旗路街道', 4, 2701), +(23608, '解放路街道', 4, 2701), +(23609, '豆腐营街道', 4, 2701), +(23610, '伦掌乡', 4, 2702), +(23611, '北郭乡', 4, 2702), +(23612, '吕村镇', 4, 2702), +(23613, '善应镇', 4, 2702), +(23614, '安丰乡', 4, 2702), +(23615, '崔家桥乡', 4, 2702), +(23616, '曲沟镇', 4, 2702), +(23617, '柏庄镇', 4, 2702), +(23618, '水冶镇', 4, 2702), +(23619, '永和乡', 4, 2702), +(23620, '洪河屯乡', 4, 2702), +(23621, '瓦店乡', 4, 2702), +(23622, '白壁镇', 4, 2702), +(23623, '磊口乡', 4, 2702), +(23624, '蒋村乡', 4, 2702), +(23625, '许家沟乡', 4, 2702), +(23626, '辛村乡', 4, 2702), +(23627, '都里乡', 4, 2702), +(23628, '铜冶镇', 4, 2702), +(23629, '韩陵乡', 4, 2702), +(23630, '马家乡', 4, 2702), +(23631, '东关街道', 4, 2703), +(23632, '东大街街道', 4, 2703), +(23633, '中华路街道', 4, 2703), +(23634, '光华路街道', 4, 2703), +(23635, '北大街街道', 4, 2703), +(23636, '南关街道', 4, 2703), +(23637, '头二三街道', 4, 2703), +(23638, '宝莲寺镇', 4, 2703); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23639, '永明路街道', 4, 2703), +(23640, '甜水井街道', 4, 2703), +(23641, '紫薇大道街道', 4, 2703), +(23642, '西关街道', 4, 2703), +(23643, '西大街街道', 4, 2703), +(23644, '高庄乡', 4, 2703), +(23645, '东姚镇', 4, 2704), +(23646, '东岗镇', 4, 2704), +(23647, '临淇镇', 4, 2704), +(23648, '五龙镇', 4, 2704), +(23649, '任村镇', 4, 2704), +(23650, '原康镇', 4, 2704), +(23651, '合涧镇', 4, 2704), +(23652, '城郊乡', 4, 2704), +(23653, '姚村镇', 4, 2704), +(23654, '开元街道', 4, 2704), +(23655, '振林街道', 4, 2704), +(23656, '桂园街道', 4, 2704), +(23657, '桂林镇', 4, 2704), +(23658, '横水镇', 4, 2704), +(23659, '河顺镇', 4, 2704), +(23660, '石板岩乡', 4, 2704), +(23661, '茶店乡', 4, 2704), +(23662, '采桑镇', 4, 2704), +(23663, '陵阳镇', 4, 2704), +(23664, '龙山街道', 4, 2704), +(23665, '北蒙街道', 4, 2705), +(23666, '李珍街道', 4, 2705), +(23667, '梅园庄街道', 4, 2705), +(23668, '水冶街道', 4, 2705), +(23669, '清风街街道', 4, 2705), +(23670, '电厂路街道', 4, 2705), +(23671, '相台街道', 4, 2705), +(23672, '纱厂街道', 4, 2705), +(23673, '西郊乡', 4, 2705), +(23674, '铁西路街道', 4, 2705), +(23675, '五陵镇', 4, 2706), +(23676, '任固镇', 4, 2706), +(23677, '伏道乡', 4, 2706), +(23678, '古贤乡', 4, 2706), +(23679, '城关镇', 4, 2706), +(23680, '宜沟镇', 4, 2706), +(23681, '瓦岗乡', 4, 2706), +(23682, '白营乡', 4, 2706), +(23683, '菜园镇', 4, 2706), +(23684, '韩庄乡', 4, 2706), +(23685, '万古镇', 4, 2707), +(23686, '上官镇', 4, 2707), +(23687, '八里营乡', 4, 2707), +(23688, '半坡店乡', 4, 2707), +(23689, '四间房乡', 4, 2707), +(23690, '城关镇', 4, 2707), +(23691, '大寨乡', 4, 2707), +(23692, '小铺乡', 4, 2707), +(23693, '慈周寨乡', 4, 2707), +(23694, '枣村乡', 4, 2707), +(23695, '桑村乡', 4, 2707), +(23696, '焦虎乡', 4, 2707), +(23697, '牛屯镇', 4, 2707), +(23698, '王庄镇', 4, 2707), +(23699, '瓦岗寨乡', 4, 2707), +(23700, '留固镇', 4, 2707); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23701, '白道口镇', 4, 2707), +(23702, '老店乡', 4, 2707), +(23703, '老爷庙乡', 4, 2707), +(23704, '赵营乡', 4, 2707), +(23705, '道口镇', 4, 2707), +(23706, '高平镇', 4, 2707), +(23707, '东风乡', 4, 2708), +(23708, '中州路街道', 4, 2708), +(23709, '太行小区街道', 4, 2708), +(23710, '彰武街道', 4, 2708), +(23711, '文昌大道街道', 4, 2708), +(23712, '文明大道街道', 4, 2708), +(23713, '田村街道', 4, 2708), +(23714, '马投涧乡', 4, 2708), +(23715, '龙泉镇', 4, 2708), +(23716, '山城路街道', 4, 2709), +(23717, '汤河街街道', 4, 2709), +(23718, '石林乡', 4, 2709), +(23719, '红旗街道', 4, 2709), +(23720, '长风中路街道', 4, 2709), +(23721, '鹿楼乡', 4, 2709), +(23722, '鹿楼街道', 4, 2709), +(23723, '卫贤镇', 4, 2710), +(23724, '善堂镇', 4, 2710), +(23725, '城关镇', 4, 2710), +(23726, '小河镇', 4, 2710), +(23727, '屯子镇', 4, 2710), +(23728, '新镇镇', 4, 2710), +(23729, '王庄乡', 4, 2710), +(23730, '白寺乡', 4, 2710), +(23731, '钜桥镇', 4, 2710), +(23732, '黎阳镇', 4, 2710), +(23733, '北阳镇', 4, 2711), +(23734, '庙口乡', 4, 2711), +(23735, '朝歌镇', 4, 2711), +(23736, '桥盟乡', 4, 2711), +(23737, '西岗乡', 4, 2711), +(23738, '高村镇', 4, 2711), +(23739, '黄洞乡', 4, 2711), +(23740, '上峪乡', 4, 2712), +(23741, '九州路街道', 4, 2712), +(23742, '大河涧乡', 4, 2712), +(23743, '大赉店镇', 4, 2712), +(23744, '金山街道', 4, 2712), +(23745, '长江路街道', 4, 2712), +(23746, '黎阳路街道', 4, 2712), +(23747, '中北街道', 4, 2713), +(23748, '中山路街道', 4, 2713), +(23749, '九矿广场街道', 4, 2713), +(23750, '姬家山乡', 4, 2713), +(23751, '新华街街道', 4, 2713), +(23752, '鹤壁集乡', 4, 2713), +(23753, '鹤山街街道', 4, 2713), +(23754, '大块镇', 4, 2714), +(23755, '宝山东路街道', 4, 2714), +(23756, '宝山西路街道', 4, 2714), +(23757, '潞王坟乡', 4, 2714), +(23758, '耿黄乡', 4, 2714), +(23759, '中同街街道', 4, 2715), +(23760, '健康路街道', 4, 2715); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23761, '南桥街道', 4, 2715), +(23762, '平原乡', 4, 2715), +(23763, '胜利路街道', 4, 2715), +(23764, '自由路街道', 4, 2715), +(23765, '解放路街道', 4, 2715), +(23766, '铁西街道', 4, 2715), +(23767, '上乐村镇', 4, 2716), +(23768, '后河镇', 4, 2716), +(23769, '唐庄镇', 4, 2716), +(23770, '城郊乡', 4, 2716), +(23771, '太公泉镇', 4, 2716), +(23772, '孙杏村镇', 4, 2716), +(23773, '安都乡', 4, 2716), +(23774, '庞寨乡', 4, 2716), +(23775, '李源屯镇', 4, 2716), +(23776, '柳庄乡', 4, 2716), +(23777, '汲水镇', 4, 2716), +(23778, '狮豹头乡', 4, 2716), +(23779, '顿坊店乡', 4, 2716), +(23780, '原武镇', 4, 2717), +(23781, '城关镇', 4, 2717), +(23782, '大宾乡', 4, 2717), +(23783, '太平镇乡', 4, 2717), +(23784, '官厂乡', 4, 2717), +(23785, '师寨镇', 4, 2717), +(23786, '桥北乡', 4, 2717), +(23787, '祝楼乡', 4, 2717), +(23788, '福宁集乡', 4, 2717), +(23789, '葛埠口乡', 4, 2717), +(23790, '蒋庄乡', 4, 2717), +(23791, '路寨乡', 4, 2717), +(23792, '阳阿乡', 4, 2717), +(23793, '陡门乡', 4, 2717), +(23794, '靳堂乡', 4, 2717), +(23795, '韩董庄乡', 4, 2717), +(23796, '齐街乡', 4, 2717), +(23797, '冯村乡', 4, 2718), +(23798, '城关乡', 4, 2718), +(23799, '城关镇', 4, 2718), +(23800, '尹岗乡', 4, 2718), +(23801, '居厢乡', 4, 2718), +(23802, '应举镇', 4, 2718), +(23803, '曹岗乡', 4, 2718), +(23804, '李庄乡', 4, 2718), +(23805, '潘店乡', 4, 2718), +(23806, '王村乡', 4, 2718), +(23807, '留光乡', 4, 2718), +(23808, '荆乡回族乡', 4, 2718), +(23809, '荆隆宫乡', 4, 2718), +(23810, '赵岗镇', 4, 2718), +(23811, '陈固乡', 4, 2718), +(23812, '陈桥镇', 4, 2718), +(23813, '鲁岗乡', 4, 2718), +(23814, '黄德镇', 4, 2718), +(23815, '黄陵镇', 4, 2718), +(23816, '东屯镇', 4, 2719), +(23817, '丰庄镇', 4, 2719), +(23818, '僧固乡', 4, 2719), +(23819, '司寨乡', 4, 2719), +(23820, '城关镇', 4, 2719), +(23821, '小潭乡', 4, 2719), +(23822, '榆林乡', 4, 2719), +(23823, '王楼乡', 4, 2719), +(23824, '石婆固乡', 4, 2719); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23825, '胙城乡', 4, 2719), +(23826, '马庄乡', 4, 2719), +(23827, '魏邱乡', 4, 2719), +(23828, '七里营镇', 4, 2720), +(23829, '古固寨镇', 4, 2720), +(23830, '合河乡', 4, 2720), +(23831, '大召营镇', 4, 2720), +(23832, '小冀镇', 4, 2720), +(23833, '翟坡镇', 4, 2720), +(23834, '郎公庙镇', 4, 2720), +(23835, '东干道街道', 4, 2721), +(23836, '北干道街道', 4, 2721), +(23837, '卫北街道', 4, 2721), +(23838, '和平路街道', 4, 2721), +(23839, '新辉路街道', 4, 2721), +(23840, '牧野乡', 4, 2721), +(23841, '王村镇', 4, 2721), +(23842, '花园街道', 4, 2721), +(23843, '荣校路街道', 4, 2721), +(23844, '东街街道', 4, 2722), +(23845, '关堤乡', 4, 2722), +(23846, '南干道街道', 4, 2722), +(23847, '向阳小区街道', 4, 2722), +(23848, '小店镇', 4, 2722), +(23849, '洪门镇', 4, 2722), +(23850, '渠东街道', 4, 2722), +(23851, '西街街道', 4, 2722), +(23852, '中和镇', 4, 2723), +(23853, '亢村镇', 4, 2723), +(23854, '位庄乡', 4, 2723), +(23855, '冯庄镇', 4, 2723), +(23856, '史庄镇', 4, 2723), +(23857, '城关镇', 4, 2723), +(23858, '大新庄乡', 4, 2723), +(23859, '太山乡', 4, 2723), +(23860, '徐营镇', 4, 2723), +(23861, '照镜镇', 4, 2723), +(23862, '黄堤镇', 4, 2723), +(23863, '上八里镇', 4, 2724), +(23864, '冀屯乡', 4, 2724), +(23865, '北云门镇', 4, 2724), +(23866, '南寨镇', 4, 2724), +(23867, '南村镇', 4, 2724), +(23868, '吴村镇', 4, 2724), +(23869, '城关街道', 4, 2724), +(23870, '孟庄镇', 4, 2724), +(23871, '峪河镇', 4, 2724), +(23872, '常村镇', 4, 2724), +(23873, '张村乡', 4, 2724), +(23874, '拍石头乡', 4, 2724), +(23875, '沙窑乡', 4, 2724), +(23876, '洪洲乡', 4, 2724), +(23877, '百泉镇', 4, 2724), +(23878, '胡桥街道', 4, 2724), +(23879, '薄壁镇', 4, 2724), +(23880, '西平罗乡', 4, 2724), +(23881, '赞城镇', 4, 2724), +(23882, '赵固乡', 4, 2724), +(23883, '高庄乡', 4, 2724), +(23884, '黄水乡', 4, 2724), +(23885, '丁栾镇', 4, 2725), +(23886, '佘家乡', 4, 2725), +(23887, '南蒲街道', 4, 2725); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23888, '孟岗乡', 4, 2725), +(23889, '常村镇', 4, 2725), +(23890, '张三寨乡', 4, 2725), +(23891, '恼里镇', 4, 2725), +(23892, '方里乡', 4, 2725), +(23893, '樊相镇', 4, 2725), +(23894, '武邱乡', 4, 2725), +(23895, '满村乡', 4, 2725), +(23896, '芦岗乡', 4, 2725), +(23897, '苗寨乡', 4, 2725), +(23898, '蒲东街道', 4, 2725), +(23899, '蒲北街道', 4, 2725), +(23900, '蒲西街道', 4, 2725), +(23901, '赵堤镇', 4, 2725), +(23902, '魏庄镇', 4, 2725), +(23903, '丹河街道', 4, 2726), +(23904, '冯封街道', 4, 2726), +(23905, '府城街道', 4, 2726), +(23906, '月山街道', 4, 2726), +(23907, '朱村街道', 4, 2726), +(23908, '李封街道', 4, 2726), +(23909, '王封街道', 4, 2726), +(23910, '许衡街道', 4, 2726), +(23911, '龙洞街道', 4, 2726), +(23912, '龙翔街道', 4, 2726), +(23913, '五里源乡', 4, 2727), +(23914, '周庄乡', 4, 2727), +(23915, '城关镇', 4, 2727), +(23916, '小营工贸区', 4, 2727), +(23917, '岸上乡', 4, 2727), +(23918, '方庄镇', 4, 2727), +(23919, '西村乡', 4, 2727), +(23920, '郇封镇', 4, 2727), +(23921, '高村乡', 4, 2727), +(23922, '孝敬镇', 4, 2728), +(23923, '寨豁乡', 4, 2728), +(23924, '月山镇', 4, 2728), +(23925, '柏山镇', 4, 2728), +(23926, '清化镇', 4, 2728), +(23927, '磨头镇', 4, 2728), +(23928, '苏家作乡', 4, 2728), +(23929, '许良镇', 4, 2728), +(23930, '金城乡', 4, 2728), +(23931, '阳庙镇', 4, 2728), +(23932, '会昌街道', 4, 2729), +(23933, '化工镇', 4, 2729), +(23934, '南庄镇', 4, 2729), +(23935, '城伯镇', 4, 2729), +(23936, '大定街道', 4, 2729), +(23937, '槐树乡', 4, 2729), +(23938, '河阳街道', 4, 2729), +(23939, '河雍街道', 4, 2729), +(23940, '西虢镇', 4, 2729), +(23941, '谷旦镇', 4, 2729), +(23942, '赵和镇', 4, 2729), +(23943, '东方红街道', 4, 2730), +(23944, '中星街道', 4, 2730), +(23945, '光亚街道', 4, 2730), +(23946, '太行街道', 4, 2730), +(23947, '定和街道', 4, 2730), +(23948, '新城街道', 4, 2730), +(23949, '李万街道', 4, 2730), +(23950, '焦东街道', 4, 2730); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(23951, '百间房街道', 4, 2730), +(23952, '艺新街道', 4, 2730), +(23953, '三阳乡', 4, 2731), +(23954, '乔庙乡', 4, 2731), +(23955, '北郭乡', 4, 2731), +(23956, '嘉应观乡', 4, 2731), +(23957, '圪垱店乡', 4, 2731), +(23958, '大封镇', 4, 2731), +(23959, '大虹桥乡', 4, 2731), +(23960, '宁郭农场', 4, 2731), +(23961, '宁郭镇', 4, 2731), +(23962, '小董乡', 4, 2731), +(23963, '木城镇', 4, 2731), +(23964, '西陶镇', 4, 2731), +(23965, '詹店镇', 4, 2731), +(23966, '谢旗营镇', 4, 2731), +(23967, '龙源镇', 4, 2731), +(23968, '太行街道', 4, 2732), +(23969, '山王庄镇', 4, 2732), +(23970, '崇义镇', 4, 2732), +(23971, '常平乡', 4, 2732), +(23972, '怀庆街道', 4, 2732), +(23973, '柏香镇', 4, 2732), +(23974, '沁园街道', 4, 2732), +(23975, '王召乡', 4, 2732), +(23976, '王曲乡', 4, 2732), +(23977, '紫陵镇', 4, 2732), +(23978, '西万镇', 4, 2732), +(23979, '西向镇', 4, 2732), +(23980, '覃怀街道', 4, 2732), +(23981, '北冷乡', 4, 2733), +(23982, '南张羌镇', 4, 2733), +(23983, '岳村乡', 4, 2733), +(23984, '招贤乡', 4, 2733), +(23985, '武德镇', 4, 2733), +(23986, '温泉镇', 4, 2733), +(23987, '番田镇', 4, 2733), +(23988, '祥云镇', 4, 2733), +(23989, '赵堡镇', 4, 2733), +(23990, '黄庄镇', 4, 2733), +(23991, '七百间街道', 4, 2734), +(23992, '上白作街道', 4, 2734), +(23993, '新华街道', 4, 2734), +(23994, '民主街道', 4, 2734), +(23995, '民生街道', 4, 2734), +(23996, '焦北街道', 4, 2734), +(23997, '焦南街道', 4, 2734), +(23998, '焦西街道', 4, 2734), +(23999, '王褚街道', 4, 2734), +(24000, '九里山街道', 4, 2735), +(24001, '冯营街道', 4, 2735), +(24002, '北山街道', 4, 2735), +(24003, '安阳城街道', 4, 2735), +(24004, '待王街道', 4, 2735), +(24005, '演马街道', 4, 2735), +(24006, '马村街道', 4, 2735), +(24007, '中原油田街道', 4, 2736), +(24008, '中原路街道', 4, 2736), +(24009, '人民路街道', 4, 2736), +(24010, '任丘路街道', 4, 2736), +(24011, '大庆路街道', 4, 2736); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24012, '孟轲乡', 4, 2736), +(24013, '岳村乡', 4, 2736), +(24014, '建设路街道', 4, 2736), +(24015, '开发区虚拟街道', 4, 2736), +(24016, '王助乡', 4, 2736), +(24017, '胜利路街道', 4, 2736), +(24018, '胡村乡', 4, 2736), +(24019, '黄河路街道', 4, 2736), +(24020, '元村镇', 4, 2737), +(24021, '千口乡', 4, 2737), +(24022, '城关镇', 4, 2737), +(24023, '寺庄乡', 4, 2737), +(24024, '张果屯乡', 4, 2737), +(24025, '杨村乡', 4, 2737), +(24026, '梁庄乡', 4, 2737), +(24027, '福坎乡', 4, 2737), +(24028, '西邵乡', 4, 2737), +(24029, '谷金楼乡', 4, 2737), +(24030, '近德固乡', 4, 2737), +(24031, '韩张镇', 4, 2737), +(24032, '侯庙镇', 4, 2738), +(24033, '后方乡', 4, 2738), +(24034, '吴坝乡', 4, 2738), +(24035, '城关镇', 4, 2738), +(24036, '夹河乡', 4, 2738), +(24037, '孙口乡', 4, 2738), +(24038, '打渔陈乡', 4, 2738), +(24039, '清水河乡', 4, 2738), +(24040, '马楼乡', 4, 2738), +(24041, '仙庄乡', 4, 2739), +(24042, '六塔乡', 4, 2739), +(24043, '双庙乡', 4, 2739), +(24044, '古城乡', 4, 2739), +(24045, '固城乡', 4, 2739), +(24046, '城关镇', 4, 2739), +(24047, '大屯乡', 4, 2739), +(24048, '大流乡', 4, 2739), +(24049, '巩营乡', 4, 2739), +(24050, '柳格乡', 4, 2739), +(24051, '瓦屋头镇', 4, 2739), +(24052, '纸房乡', 4, 2739), +(24053, '阳邵乡', 4, 2739), +(24054, '韩村乡', 4, 2739), +(24055, '马庄桥镇', 4, 2739), +(24056, '马村乡', 4, 2739), +(24057, '高堡乡', 4, 2739), +(24058, '习城乡', 4, 2740), +(24059, '五星乡', 4, 2740), +(24060, '八公桥镇', 4, 2740), +(24061, '城关镇', 4, 2740), +(24062, '子岸乡', 4, 2740), +(24063, '庆祖镇', 4, 2740), +(24064, '徐镇镇', 4, 2740), +(24065, '户部寨乡', 4, 2740), +(24066, '文留镇', 4, 2740), +(24067, '新习乡', 4, 2740), +(24068, '柳屯镇', 4, 2740), +(24069, '梁庄乡', 4, 2740), +(24070, '梨园乡', 4, 2740), +(24071, '海通乡', 4, 2740), +(24072, '清河头乡', 4, 2740), +(24073, '渠村乡', 4, 2740), +(24074, '王称固乡', 4, 2740), +(24075, '白罡乡', 4, 2740); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24076, '胡状乡', 4, 2740), +(24077, '郎中乡', 4, 2740), +(24078, '鲁河乡', 4, 2740), +(24079, '城关镇', 4, 2741), +(24080, '张庄乡', 4, 2741), +(24081, '杨集乡', 4, 2741), +(24082, '濮城镇', 4, 2741), +(24083, '王楼乡', 4, 2741), +(24084, '白衣阁乡', 4, 2741), +(24085, '辛庄乡', 4, 2741), +(24086, '陆集乡', 4, 2741), +(24087, '陈庄乡', 4, 2741), +(24088, '颜村铺乡', 4, 2741), +(24089, '高码头乡', 4, 2741), +(24090, '龙王庄乡', 4, 2741), +(24091, '古城镇', 4, 2742), +(24092, '夏都街道', 4, 2742), +(24093, '小吕乡', 4, 2742), +(24094, '山货回族乡', 4, 2742), +(24095, '张得乡', 4, 2742), +(24096, '文殊镇', 4, 2742), +(24097, '方山镇', 4, 2742), +(24098, '方岗乡', 4, 2742), +(24099, '无梁镇', 4, 2742), +(24100, '朱阁乡', 4, 2742), +(24101, '梁北镇', 4, 2742), +(24102, '浅井乡', 4, 2742), +(24103, '火龙镇', 4, 2742), +(24104, '磨街乡', 4, 2742), +(24105, '神垕镇', 4, 2742), +(24106, '花石乡', 4, 2742), +(24107, '苌庄乡', 4, 2742), +(24108, '范坡乡', 4, 2742), +(24109, '褚河乡', 4, 2742), +(24110, '郭连乡', 4, 2742), +(24111, '钧台街道', 4, 2742), +(24112, '韩城街道', 4, 2742), +(24113, '顺店镇', 4, 2742), +(24114, '颍川街道', 4, 2742), +(24115, '鸠山乡', 4, 2742), +(24116, '鸿畅镇', 4, 2742), +(24117, '丁营乡', 4, 2743), +(24118, '十里铺乡', 4, 2743), +(24119, '双庙乡', 4, 2743), +(24120, '城关镇', 4, 2743), +(24121, '姜庄乡', 4, 2743), +(24122, '山头店乡', 4, 2743), +(24123, '库庄乡', 4, 2743), +(24124, '汾陈乡', 4, 2743), +(24125, '湛北乡', 4, 2743), +(24126, '王洛镇', 4, 2743), +(24127, '紫云镇', 4, 2743), +(24128, '范湖乡', 4, 2743), +(24129, '茨沟乡', 4, 2743), +(24130, '颍桥回族镇', 4, 2743), +(24131, '颍阳镇', 4, 2743), +(24132, '麦岭镇', 4, 2743), +(24133, '五女店镇', 4, 2744), +(24134, '将官池镇', 4, 2744), +(24135, '小召乡', 4, 2744), +(24136, '尚集镇', 4, 2744), +(24137, '张潘镇', 4, 2744), +(24138, '桂村乡', 4, 2744), +(24139, '椹涧乡', 4, 2744); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24140, '榆林乡', 4, 2744), +(24141, '河街乡', 4, 2744), +(24142, '灵井镇', 4, 2744), +(24143, '艾庄回族乡', 4, 2744), +(24144, '苏桥镇', 4, 2744), +(24145, '蒋李集镇', 4, 2744), +(24146, '邓庄乡', 4, 2744), +(24147, '长村张乡', 4, 2744), +(24148, '陈曹乡', 4, 2744), +(24149, '南坞乡', 4, 2745), +(24150, '只乐乡', 4, 2745), +(24151, '大马乡', 4, 2745), +(24152, '安陵镇', 4, 2745), +(24153, '张桥乡', 4, 2745), +(24154, '彭店乡', 4, 2745), +(24155, '望田镇', 4, 2745), +(24156, '柏梁镇', 4, 2745), +(24157, '陈化店镇', 4, 2745), +(24158, '陶城乡', 4, 2745), +(24159, '马坊乡', 4, 2745), +(24160, '马栏镇', 4, 2745), +(24161, '南席镇', 4, 2746), +(24162, '古桥乡', 4, 2746), +(24163, '后河镇', 4, 2746), +(24164, '和尚桥镇', 4, 2746), +(24165, '坡胡镇', 4, 2746), +(24166, '增福庙乡', 4, 2746), +(24167, '大周镇', 4, 2746), +(24168, '官亭乡', 4, 2746), +(24169, '建设路街道', 4, 2746), +(24170, '石固镇', 4, 2746), +(24171, '石象乡', 4, 2746), +(24172, '老城镇', 4, 2746), +(24173, '董村镇', 4, 2746), +(24174, '金桥路街道', 4, 2746), +(24175, '长兴路街道', 4, 2746), +(24176, '长社路街道', 4, 2746), +(24177, '丁庄街道', 4, 2747), +(24178, '七里店街道', 4, 2747), +(24179, '东大街街道', 4, 2747), +(24180, '五一路街道', 4, 2747), +(24181, '北大街街道', 4, 2747), +(24182, '半截河街道', 4, 2747), +(24183, '南关街道', 4, 2747), +(24184, '文峰街道', 4, 2747), +(24185, '新兴街道', 4, 2747), +(24186, '西关街道', 4, 2747), +(24187, '西大街街道', 4, 2747), +(24188, '高桥营街道', 4, 2747), +(24189, '三家店镇', 4, 2748), +(24190, '台陈镇', 4, 2748), +(24191, '固厢乡', 4, 2748), +(24192, '城关镇', 4, 2748), +(24193, '大郭乡', 4, 2748), +(24194, '巨陵镇', 4, 2748), +(24195, '杜曲镇', 4, 2748), +(24196, '王孟乡', 4, 2748), +(24197, '王岗镇', 4, 2748), +(24198, '瓦店镇', 4, 2748), +(24199, '皇帝庙乡', 4, 2748), +(24200, '石桥乡', 4, 2748), +(24201, '窝城镇', 4, 2748); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24202, '繁城回族镇', 4, 2748), +(24203, '陈庄乡', 4, 2748), +(24204, '万金镇', 4, 2749), +(24205, '召陵镇', 4, 2749), +(24206, '后谢乡', 4, 2749), +(24207, '姬石乡', 4, 2749), +(24208, '翟庄街道', 4, 2749), +(24209, '老窝镇', 4, 2749), +(24210, '邓襄镇', 4, 2749), +(24211, '青年村乡', 4, 2749), +(24212, '大刘镇', 4, 2750), +(24213, '天桥街街道', 4, 2750), +(24214, '干河陈街道', 4, 2750), +(24215, '空冢郭乡', 4, 2750), +(24216, '老街街道', 4, 2750), +(24217, '问十乡', 4, 2750), +(24218, '阴阳赵乡', 4, 2750), +(24219, '顺河街街道', 4, 2750), +(24220, '马路街街道', 4, 2750), +(24221, '九街乡', 4, 2751), +(24222, '侯集乡', 4, 2751), +(24223, '保和乡', 4, 2751), +(24224, '北舞渡镇', 4, 2751), +(24225, '吴城镇', 4, 2751), +(24226, '太尉镇', 4, 2751), +(24227, '姜店乡', 4, 2751), +(24228, '孟寨镇', 4, 2751), +(24229, '文峰乡', 4, 2751), +(24230, '章化乡', 4, 2751), +(24231, '舞泉镇', 4, 2751), +(24232, '莲花镇', 4, 2751), +(24233, '辛安镇', 4, 2751), +(24234, '马村乡', 4, 2751), +(24235, '商桥镇', 4, 2752), +(24236, '城关镇', 4, 2752), +(24237, '孟庙镇', 4, 2752), +(24238, '新店镇', 4, 2752), +(24239, '李集乡', 4, 2752), +(24240, '沙北街道', 4, 2752), +(24241, '裴城镇', 4, 2752), +(24242, '黑龙潭乡', 4, 2752), +(24243, '龙城镇', 4, 2752), +(24244, '东区街道', 4, 2753), +(24245, '千秋路街道', 4, 2753), +(24246, '常村路街道', 4, 2753), +(24247, '新义街街道', 4, 2753), +(24248, '新区街道', 4, 2753), +(24249, '朝阳路街道', 4, 2753), +(24250, '泰山路街道', 4, 2753), +(24251, '东明镇', 4, 2754), +(24252, '五里川镇', 4, 2754), +(24253, '双槐树乡', 4, 2754), +(24254, '城关镇', 4, 2754), +(24255, '官坡镇', 4, 2754), +(24256, '官道口镇', 4, 2754), +(24257, '徐家湾乡', 4, 2754), +(24258, '文峪乡', 4, 2754), +(24259, '木桐乡', 4, 2754), +(24260, '朱阳关镇', 4, 2754), +(24261, '杜关镇', 4, 2754), +(24262, '横涧乡', 4, 2754), +(24263, '汤河乡', 4, 2754); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24264, '沙河乡', 4, 2754), +(24265, '潘河乡', 4, 2754), +(24266, '狮子坪乡', 4, 2754), +(24267, '瓦窑沟乡', 4, 2754), +(24268, '磨沟口乡', 4, 2754), +(24269, '范里镇', 4, 2754), +(24270, '仁村乡', 4, 2755), +(24271, '仰韶乡', 4, 2755), +(24272, '南村乡', 4, 2755), +(24273, '坡头乡', 4, 2755), +(24274, '城关镇', 4, 2755), +(24275, '天池镇', 4, 2755), +(24276, '张村镇', 4, 2755), +(24277, '果园乡', 4, 2755), +(24278, '段村乡', 4, 2755), +(24279, '洪阳镇', 4, 2755), +(24280, '英豪镇', 4, 2755), +(24281, '陈村乡', 4, 2755), +(24282, '交口乡', 4, 2756), +(24283, '前进街道', 4, 2756), +(24284, '向阳街道', 4, 2756), +(24285, '大安街道', 4, 2756), +(24286, '涧河街道', 4, 2756), +(24287, '湖滨街道', 4, 2756), +(24288, '磁钟乡', 4, 2756), +(24289, '车站街道', 4, 2756), +(24290, '高庙乡', 4, 2756), +(24291, '五亩乡', 4, 2757), +(24292, '函谷关镇', 4, 2757), +(24293, '城关镇', 4, 2757), +(24294, '大王镇', 4, 2757), +(24295, '寺河乡', 4, 2757), +(24296, '尹庄镇', 4, 2757), +(24297, '川口乡', 4, 2757), +(24298, '故县镇', 4, 2757), +(24299, '朱阳镇', 4, 2757), +(24300, '焦村镇', 4, 2757), +(24301, '苏村乡', 4, 2757), +(24302, '西阎乡', 4, 2757), +(24303, '豫灵镇', 4, 2757), +(24304, '阳平镇', 4, 2757), +(24305, '阳店镇', 4, 2757), +(24306, '原店镇', 4, 2758), +(24307, '大营镇', 4, 2758), +(24308, '宫前乡', 4, 2758), +(24309, '店子乡', 4, 2758), +(24310, '张汴乡', 4, 2758), +(24311, '张湾乡', 4, 2758), +(24312, '张茅乡', 4, 2758), +(24313, '王家后乡', 4, 2758), +(24314, '硖石乡', 4, 2758), +(24315, '菜园乡', 4, 2758), +(24316, '西张村镇', 4, 2758), +(24317, '西李村乡', 4, 2758), +(24318, '观音堂镇', 4, 2758), +(24319, '七里坪乡', 4, 2759), +(24320, '余关乡', 4, 2759), +(24321, '城关镇', 4, 2759), +(24322, '夏馆镇', 4, 2759), +(24323, '大桥乡', 4, 2759), +(24324, '师岗镇', 4, 2759), +(24325, '板场乡', 4, 2759), +(24326, '湍东镇', 4, 2759), +(24327, '灌涨镇', 4, 2759); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24328, '王店镇', 4, 2759), +(24329, '瓦亭镇', 4, 2759), +(24330, '砟岖乡', 4, 2759), +(24331, '西庙岗乡', 4, 2759), +(24332, '赤眉镇', 4, 2759), +(24333, '赵店乡', 4, 2759), +(24334, '马山口镇', 4, 2759), +(24335, '乔端镇', 4, 2760), +(24336, '云阳镇', 4, 2760), +(24337, '南河店镇', 4, 2760), +(24338, '四棵树乡', 4, 2760), +(24339, '城关镇', 4, 2760), +(24340, '城郊乡', 4, 2760), +(24341, '太山庙乡', 4, 2760), +(24342, '小店乡', 4, 2760), +(24343, '崔庄乡', 4, 2760), +(24344, '板山坪镇', 4, 2760), +(24345, '留山镇', 4, 2760), +(24346, '白土岗镇', 4, 2760), +(24347, '皇后乡', 4, 2760), +(24348, '皇路店镇', 4, 2760), +(24349, '石门乡', 4, 2760), +(24350, '马市坪乡', 4, 2760), +(24351, '七一街道', 4, 2761), +(24352, '七里园乡', 4, 2761), +(24353, '光武街道', 4, 2761), +(24354, '卧龙岗街道', 4, 2761), +(24355, '安皋镇', 4, 2761), +(24356, '梅溪街道', 4, 2761), +(24357, '武侯街道', 4, 2761), +(24358, '潦河镇', 4, 2761), +(24359, '王村乡', 4, 2761), +(24360, '石桥镇', 4, 2761), +(24361, '英庄镇', 4, 2761), +(24362, '蒲山镇', 4, 2761), +(24363, '谢庄乡', 4, 2761), +(24364, '车站街道', 4, 2761), +(24365, '陆营镇', 4, 2761), +(24366, '青华镇', 4, 2761), +(24367, '靳岗街道', 4, 2761), +(24368, '高新区高新街道', 4, 2761), +(24369, '龙兴乡', 4, 2761), +(24370, '上屯镇', 4, 2762), +(24371, '东王集乡', 4, 2762), +(24372, '古城乡', 4, 2762), +(24373, '城关镇', 4, 2762), +(24374, '城郊乡', 4, 2762), +(24375, '大河屯镇', 4, 2762), +(24376, '少拜寺镇', 4, 2762), +(24377, '张店镇', 4, 2762), +(24378, '昝岗乡', 4, 2762), +(24379, '桐寨铺镇', 4, 2762), +(24380, '桐河乡', 4, 2762), +(24381, '毕店镇', 4, 2762), +(24382, '湖阳镇', 4, 2762), +(24383, '源潭镇', 4, 2762), +(24384, '祁仪乡', 4, 2762), +(24385, '苍台镇', 4, 2762), +(24386, '郭滩镇', 4, 2762), +(24387, '马振抚乡', 4, 2762), +(24388, '黑龙镇', 4, 2762), +(24389, '龙潭镇', 4, 2762), +(24390, '东关街道', 4, 2763); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24391, '仲景街道', 4, 2763), +(24392, '官庄镇', 4, 2763), +(24393, '新华街道', 4, 2763), +(24394, '新店乡', 4, 2763), +(24395, '枣林街道', 4, 2763), +(24396, '汉冢乡', 4, 2763), +(24397, '汉冶街道', 4, 2763), +(24398, '溧河乡', 4, 2763), +(24399, '瓦店镇', 4, 2763), +(24400, '白河街道', 4, 2763), +(24401, '红泥湾镇', 4, 2763), +(24402, '茶庵乡', 4, 2763), +(24403, '金华乡', 4, 2763), +(24404, '高庙乡', 4, 2763), +(24405, '黄台岗镇', 4, 2763), +(24406, '上庄乡', 4, 2764), +(24407, '上港乡', 4, 2764), +(24408, '五星镇', 4, 2764), +(24409, '前高庙乡', 4, 2764), +(24410, '城关镇', 4, 2764), +(24411, '城郊乡', 4, 2764), +(24412, '新甸铺镇', 4, 2764), +(24413, '施庵镇', 4, 2764), +(24414, '樊集乡', 4, 2764), +(24415, '歪子镇', 4, 2764), +(24416, '沙堰镇', 4, 2764), +(24417, '溧河铺镇', 4, 2764), +(24418, '王庄镇', 4, 2764), +(24419, '王集镇', 4, 2764), +(24420, '二郎庙乡', 4, 2765), +(24421, '券桥乡', 4, 2765), +(24422, '博望镇', 4, 2765), +(24423, '古庄店乡', 4, 2765), +(24424, '四里店乡', 4, 2765), +(24425, '城关镇', 4, 2765), +(24426, '小史店镇', 4, 2765), +(24427, '广阳镇', 4, 2765), +(24428, '拐河镇', 4, 2765), +(24429, '杨楼乡', 4, 2765), +(24430, '杨集乡', 4, 2765), +(24431, '柳河乡', 4, 2765), +(24432, '清河乡', 4, 2765), +(24433, '独树镇', 4, 2765), +(24434, '袁店回族乡', 4, 2765), +(24435, '赵河镇', 4, 2765), +(24436, '吴城镇', 4, 2766), +(24437, '回龙乡', 4, 2766), +(24438, '固县镇', 4, 2766), +(24439, '城关镇', 4, 2766), +(24440, '城郊乡', 4, 2766), +(24441, '埠江镇', 4, 2766), +(24442, '大河镇', 4, 2766), +(24443, '安棚乡', 4, 2766), +(24444, '平氏镇', 4, 2766), +(24445, '新集乡', 4, 2766), +(24446, '月河镇', 4, 2766), +(24447, '朱庄乡', 4, 2766), +(24448, '毛集镇', 4, 2766), +(24449, '淮源镇', 4, 2766), +(24450, '程湾乡', 4, 2766), +(24451, '黄岗乡', 4, 2766), +(24452, '上集镇', 4, 2767), +(24453, '九重镇', 4, 2767), +(24454, '仓房镇', 4, 2767); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24455, '厚坡镇', 4, 2767), +(24456, '商圣街道', 4, 2767), +(24457, '大石桥乡', 4, 2767), +(24458, '寺湾镇', 4, 2767), +(24459, '毛堂乡', 4, 2767), +(24460, '滔河乡', 4, 2767), +(24461, '盛湾镇', 4, 2767), +(24462, '老城镇', 4, 2767), +(24463, '荆紫关镇', 4, 2767), +(24464, '西簧乡', 4, 2767), +(24465, '金河镇', 4, 2767), +(24466, '香花镇', 4, 2767), +(24467, '马蹬镇', 4, 2767), +(24468, '龙城街道', 4, 2767), +(24469, '下洼乡', 4, 2768), +(24470, '兴隆镇', 4, 2768), +(24471, '唐庄乡', 4, 2768), +(24472, '城郊乡', 4, 2768), +(24473, '大冯营乡', 4, 2768), +(24474, '太和乡', 4, 2768), +(24475, '晋庄镇', 4, 2768), +(24476, '朱集乡', 4, 2768), +(24477, '李店镇', 4, 2768), +(24478, '桥头镇', 4, 2768), +(24479, '苗店镇', 4, 2768), +(24480, '赊店镇', 4, 2768), +(24481, '郝寨镇', 4, 2768), +(24482, '陌陂乡', 4, 2768), +(24483, '饶良镇', 4, 2768), +(24484, '丁河镇', 4, 2769), +(24485, '丹水镇', 4, 2769), +(24486, '二郎坪乡', 4, 2769), +(24487, '五里桥乡', 4, 2769), +(24488, '军马河乡', 4, 2769), +(24489, '双龙镇', 4, 2769), +(24490, '回车镇', 4, 2769), +(24491, '城关镇', 4, 2769), +(24492, '太平镇乡', 4, 2769), +(24493, '寨根乡', 4, 2769), +(24494, '桑坪镇', 4, 2769), +(24495, '田关乡', 4, 2769), +(24496, '石界河乡', 4, 2769), +(24497, '米坪镇', 4, 2769), +(24498, '西坪镇', 4, 2769), +(24499, '重阳乡', 4, 2769), +(24500, '阳城乡', 4, 2769), +(24501, '黄石庵林场', 4, 2769), +(24502, '九龙乡', 4, 2770), +(24503, '刘集镇', 4, 2770), +(24504, '十林镇', 4, 2770), +(24505, '古城街道', 4, 2770), +(24506, '夏集乡', 4, 2770), +(24507, '孟楼镇', 4, 2770), +(24508, '小杨营乡', 4, 2770), +(24509, '张村镇', 4, 2770), +(24510, '张楼乡', 4, 2770), +(24511, '彭桥镇', 4, 2770), +(24512, '文渠乡', 4, 2770), +(24513, '构林镇', 4, 2770), +(24514, '林扒镇', 4, 2770), +(24515, '桑庄镇', 4, 2770), +(24516, '汲滩镇', 4, 2770), +(24517, '湍河街道', 4, 2770), +(24518, '白牛乡', 4, 2770); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24519, '穣东镇', 4, 2770), +(24520, '罗庄镇', 4, 2770), +(24521, '腰店乡', 4, 2770), +(24522, '花洲街道', 4, 2770), +(24523, '裴营乡', 4, 2770), +(24524, '赵集镇', 4, 2770), +(24525, '都司镇', 4, 2770), +(24526, '陶营乡', 4, 2770), +(24527, '高集乡', 4, 2770), +(24528, '龙堰乡', 4, 2770), +(24529, '二龙乡', 4, 2771), +(24530, '侯集镇', 4, 2771), +(24531, '卢医镇', 4, 2771), +(24532, '安字营乡', 4, 2771), +(24533, '张林乡', 4, 2771), +(24534, '彭营乡', 4, 2771), +(24535, '晁陂镇', 4, 2771), +(24536, '曲屯镇', 4, 2771), +(24537, '杨营镇', 4, 2771), +(24538, '枣园镇', 4, 2771), +(24539, '柳泉铺乡', 4, 2771), +(24540, '涅阳街道', 4, 2771), +(24541, '玉都街道', 4, 2771), +(24542, '王岗乡', 4, 2771), +(24543, '石佛寺镇', 4, 2771), +(24544, '老庄镇', 4, 2771), +(24545, '贾宋镇', 4, 2771), +(24546, '遮山镇', 4, 2771), +(24547, '郭庄回族乡', 4, 2771), +(24548, '雪枫街道', 4, 2771), +(24549, '马庄乡', 4, 2771), +(24550, '高丘镇', 4, 2771), +(24551, '业庙乡', 4, 2772), +(24552, '中峰乡', 4, 2772), +(24553, '会亭镇', 4, 2772), +(24554, '何营乡', 4, 2772), +(24555, '刘店集乡', 4, 2772), +(24556, '北镇乡', 4, 2772), +(24557, '城关镇', 4, 2772), +(24558, '太平乡', 4, 2772), +(24559, '孔庄乡', 4, 2772), +(24560, '曹集乡', 4, 2772), +(24561, '李集镇', 4, 2772), +(24562, '杨集镇', 4, 2772), +(24563, '桑固乡', 4, 2772), +(24564, '歧河乡', 4, 2772), +(24565, '济阳镇', 4, 2772), +(24566, '火店乡', 4, 2772), +(24567, '王集乡', 4, 2772), +(24568, '罗庄乡', 4, 2772), +(24569, '胡桥乡', 4, 2772), +(24570, '车站镇', 4, 2772), +(24571, '郭店乡', 4, 2772), +(24572, '韩道口镇', 4, 2772), +(24573, '马头镇', 4, 2772), +(24574, '骆集乡', 4, 2772), +(24575, '乔楼乡', 4, 2773), +(24576, '刘楼乡', 4, 2773), +(24577, '华堡乡', 4, 2773), +(24578, '城关回族镇', 4, 2773), +(24579, '城郊乡', 4, 2773), +(24580, '孔集乡', 4, 2773), +(24581, '张弓镇', 4, 2773), +(24582, '柳河镇', 4, 2773), +(24583, '石桥乡', 4, 2773); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24584, '程楼乡', 4, 2773), +(24585, '赵村乡', 4, 2773), +(24586, '逻岗镇', 4, 2773), +(24587, '阳驿乡', 4, 2773), +(24588, '黄岗乡', 4, 2773), +(24589, '伯岗乡', 4, 2774), +(24590, '城关镇', 4, 2774), +(24591, '大仵乡', 4, 2774), +(24592, '安平镇', 4, 2774), +(24593, '岗王乡', 4, 2774), +(24594, '张桥乡', 4, 2774), +(24595, '惠济乡', 4, 2774), +(24596, '慈圣镇', 4, 2774), +(24597, '李原乡', 4, 2774), +(24598, '梁庄乡', 4, 2774), +(24599, '洪恩乡', 4, 2774), +(24600, '牛城乡', 4, 2774), +(24601, '申桥乡', 4, 2774), +(24602, '皇集乡', 4, 2774), +(24603, '老王集乡', 4, 2774), +(24604, '胡襄镇', 4, 2774), +(24605, '起台镇', 4, 2774), +(24606, '远襄镇', 4, 2774), +(24607, '邵元乡', 4, 2774), +(24608, '陈青集镇', 4, 2774), +(24609, '马集乡', 4, 2774), +(24610, '人和镇', 4, 2775), +(24611, '伯党回族乡', 4, 2775), +(24612, '北关镇', 4, 2775), +(24613, '双塔乡', 4, 2775), +(24614, '城关镇', 4, 2775), +(24615, '孙六乡', 4, 2775), +(24616, '尹店乡', 4, 2775), +(24617, '林七乡', 4, 2775), +(24618, '王庄寨镇', 4, 2775), +(24619, '王桥乡', 4, 2775), +(24620, '程庄镇', 4, 2775), +(24621, '老颜集乡', 4, 2775), +(24622, '胡集回族乡', 4, 2775), +(24623, '花园乡', 4, 2775), +(24624, '褚庙乡', 4, 2775), +(24625, '野岗乡', 4, 2775), +(24626, '顺河乡', 4, 2775), +(24627, '龙塘镇', 4, 2775), +(24628, '候岭乡', 4, 2776), +(24629, '刘河乡', 4, 2776), +(24630, '十八里镇', 4, 2776), +(24631, '卧龙乡', 4, 2776), +(24632, '双桥乡', 4, 2776), +(24633, '城关镇', 4, 2776), +(24634, '城厢乡', 4, 2776), +(24635, '太丘乡', 4, 2776), +(24636, '新桥乡', 4, 2776), +(24637, '李寨乡', 4, 2776), +(24638, '条河乡', 4, 2776), +(24639, '演集镇', 4, 2776), +(24640, '王集乡', 4, 2776), +(24641, '芒山镇', 4, 2776), +(24642, '苗桥乡', 4, 2776), +(24643, '茴村乡', 4, 2776), +(24644, '蒋口镇', 4, 2776), +(24645, '薛湖镇', 4, 2776), +(24646, '裴桥镇', 4, 2776), +(24647, '酂城镇', 4, 2776), +(24648, '酂阳乡', 4, 2776); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24649, '陈官庄乡', 4, 2776), +(24650, '陈集镇', 4, 2776), +(24651, '顺和乡', 4, 2776), +(24652, '马桥镇', 4, 2776), +(24653, '马牧乡', 4, 2776), +(24654, '高庄镇', 4, 2776), +(24655, '黄口乡', 4, 2776), +(24656, '龙岗乡', 4, 2776), +(24657, '匡城乡', 4, 2777), +(24658, '后台乡', 4, 2777), +(24659, '周堂镇', 4, 2777), +(24660, '城关回族镇', 4, 2777), +(24661, '城郊乡', 4, 2777), +(24662, '孙聚寨乡', 4, 2777), +(24663, '尚屯镇', 4, 2777), +(24664, '尤吉屯乡', 4, 2777), +(24665, '平岗镇', 4, 2777), +(24666, '河堤乡', 4, 2777), +(24667, '河集乡', 4, 2777), +(24668, '涧岗乡', 4, 2777), +(24669, '潮庄镇', 4, 2777), +(24670, '白庙乡', 4, 2777), +(24671, '白楼乡', 4, 2777), +(24672, '胡堂乡', 4, 2777), +(24673, '董店乡', 4, 2777), +(24674, '蓼堤镇', 4, 2777), +(24675, '西陵寺镇', 4, 2777), +(24676, '长岗镇', 4, 2777), +(24677, '东方街道', 4, 2778), +(24678, '临河店乡', 4, 2778), +(24679, '冯桥乡', 4, 2778), +(24680, '勒马乡', 4, 2778), +(24681, '包公庙乡', 4, 2778), +(24682, '古城街道', 4, 2778), +(24683, '古宋乡', 4, 2778), +(24684, '坞墙乡', 4, 2778), +(24685, '娄店乡', 4, 2778), +(24686, '宋集镇', 4, 2778), +(24687, '文化街道', 4, 2778), +(24688, '新城街道', 4, 2778), +(24689, '李口镇', 4, 2778), +(24690, '毛固堆乡', 4, 2778), +(24691, '路河乡', 4, 2778), +(24692, '郭村镇', 4, 2778), +(24693, '闫集乡', 4, 2778), +(24694, '高辛镇', 4, 2778), +(24695, '东风街道', 4, 2779), +(24696, '中州街道', 4, 2779), +(24697, '八八街道', 4, 2779), +(24698, '刘口乡', 4, 2779), +(24699, '前进街道', 4, 2779), +(24700, '双八镇', 4, 2779), +(24701, '周集乡', 4, 2779), +(24702, '孙福集乡', 4, 2779), +(24703, '平原街道', 4, 2779), +(24704, '平台镇', 4, 2779), +(24705, '建设街道', 4, 2779), +(24706, '张阁镇', 4, 2779), +(24707, '李庄乡', 4, 2779), +(24708, '水池铺乡', 4, 2779), +(24709, '王楼乡', 4, 2779), +(24710, '白云街道', 4, 2779), +(24711, '观堂乡', 4, 2779), +(24712, '谢集镇', 4, 2779); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24713, '长征街道', 4, 2779), +(24714, '乔集乡', 4, 2780), +(24715, '刘店乡', 4, 2780), +(24716, '刘集乡', 4, 2780), +(24717, '利民镇', 4, 2780), +(24718, '古王集乡', 4, 2780), +(24719, '城关镇', 4, 2780), +(24720, '城郊乡', 4, 2780), +(24721, '大候乡', 4, 2780), +(24722, '大杨集镇', 4, 2780), +(24723, '店集乡', 4, 2780), +(24724, '张集镇', 4, 2780), +(24725, '李老家乡', 4, 2780), +(24726, '杜集镇', 4, 2780), +(24727, '沙集乡', 4, 2780), +(24728, '田庙乡', 4, 2780), +(24729, '界沟镇', 4, 2780), +(24730, '稍岗乡', 4, 2780), +(24731, '站集乡', 4, 2780), +(24732, '芒种桥乡', 4, 2780), +(24733, '营郭镇', 4, 2780), +(24734, '谷熟镇', 4, 2780), +(24735, '贾寨镇', 4, 2780), +(24736, '郑集乡', 4, 2780), +(24737, '镇里固乡', 4, 2780), +(24738, '闻集乡', 4, 2780), +(24739, '黄冢乡', 4, 2780), +(24740, '仙居乡', 4, 2781), +(24741, '凉亭乡', 4, 2781), +(24742, '北向店乡', 4, 2781), +(24743, '十里镇', 4, 2781), +(24744, '南向店乡', 4, 2781), +(24745, '孙铁铺镇', 4, 2781), +(24746, '寨河镇', 4, 2781), +(24747, '弦山街道', 4, 2781), +(24748, '文殊乡', 4, 2781), +(24749, '斛山乡', 4, 2781), +(24750, '晏河乡', 4, 2781), +(24751, '槐店乡', 4, 2781), +(24752, '殷棚乡', 4, 2781), +(24753, '泼陂河镇', 4, 2781), +(24754, '白雀镇', 4, 2781), +(24755, '砖桥镇', 4, 2781), +(24756, '紫水街道', 4, 2781), +(24757, '罗陈乡', 4, 2781), +(24758, '马畈镇', 4, 2781), +(24759, '上石桥镇', 4, 2782), +(24760, '丰集乡', 4, 2782), +(24761, '伏山乡', 4, 2782), +(24762, '余集镇', 4, 2782), +(24763, '冯店乡', 4, 2782), +(24764, '双椿铺镇', 4, 2782), +(24765, '吴河乡', 4, 2782), +(24766, '四顾墩乡', 4, 2782), +(24767, '城关镇', 4, 2782), +(24768, '李集乡', 4, 2782), +(24769, '汤泉池管理处', 4, 2782), +(24770, '汪岗乡', 4, 2782), +(24771, '汪桥镇', 4, 2782), +(24772, '河风桥乡', 4, 2782), +(24773, '苏仙石乡', 4, 2782), +(24774, '观庙乡', 4, 2782), +(24775, '达权店乡', 4, 2782), +(24776, '鄢岗镇', 4, 2782); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24777, '长竹园乡', 4, 2782), +(24778, '鲇鱼山乡', 4, 2782), +(24779, '三河尖乡', 4, 2783), +(24780, '丰港乡', 4, 2783), +(24781, '分水亭乡', 4, 2783), +(24782, '南大桥乡', 4, 2783), +(24783, '城关镇', 4, 2783), +(24784, '城郊乡', 4, 2783), +(24785, '张广庙乡', 4, 2783), +(24786, '张老埠乡', 4, 2783), +(24787, '往流镇', 4, 2783), +(24788, '徐集乡', 4, 2783), +(24789, '方集镇', 4, 2783), +(24790, '李店乡', 4, 2783), +(24791, '杨集乡', 4, 2783), +(24792, '柳树店乡', 4, 2783), +(24793, '武庙乡', 4, 2783), +(24794, '段集乡', 4, 2783), +(24795, '汪棚乡', 4, 2783), +(24796, '沙河铺乡', 4, 2783), +(24797, '泉河铺乡', 4, 2783), +(24798, '洪埠乡', 4, 2783), +(24799, '石佛店乡', 4, 2783), +(24800, '祖师庙乡', 4, 2783), +(24801, '胡族铺镇', 4, 2783), +(24802, '草庙集乡', 4, 2783), +(24803, '蒋集镇', 4, 2783), +(24804, '观堂乡', 4, 2783), +(24805, '赵岗乡', 4, 2783), +(24806, '郭陆滩镇', 4, 2783), +(24807, '陈淋子镇', 4, 2783), +(24808, '陈集乡', 4, 2783), +(24809, '马岗集乡', 4, 2783), +(24810, '黎集镇', 4, 2783), +(24811, '上天梯管理区', 4, 2784), +(24812, '五里店镇', 4, 2784), +(24813, '前进街道', 4, 2784), +(24814, '南京路街道', 4, 2784), +(24815, '平昌镇', 4, 2784), +(24816, '平桥街道', 4, 2784), +(24817, '彭家湾乡', 4, 2784), +(24818, '明港镇', 4, 2784), +(24819, '查山乡', 4, 2784), +(24820, '洋河乡', 4, 2784), +(24821, '王岗乡', 4, 2784), +(24822, '甘岸街道', 4, 2784), +(24823, '羊山街道', 4, 2784), +(24824, '肖店乡', 4, 2784), +(24825, '肖王乡', 4, 2784), +(24826, '胡店乡', 4, 2784), +(24827, '邢集镇', 4, 2784), +(24828, '长台乡', 4, 2784), +(24829, '高粱店乡', 4, 2784), +(24830, '龙井乡', 4, 2784), +(24831, '东岳镇', 4, 2785), +(24832, '临河乡', 4, 2785), +(24833, '八里岔乡', 4, 2785), +(24834, '关店乡', 4, 2785), +(24835, '包信镇', 4, 2785), +(24836, '城关镇', 4, 2785), +(24837, '城郊乡', 4, 2785), +(24838, '夏庄镇', 4, 2785), +(24839, '孙庙乡', 4, 2785); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24840, '小茴店镇', 4, 2785), +(24841, '岗李店乡', 4, 2785), +(24842, '张陶乡', 4, 2785), +(24843, '彭店乡', 4, 2785), +(24844, '曹黄林乡', 4, 2785), +(24845, '杨店乡', 4, 2785), +(24846, '白土店乡', 4, 2785), +(24847, '路口乡', 4, 2785), +(24848, '长陵乡', 4, 2785), +(24849, '陈棚乡', 4, 2785), +(24850, '项店镇', 4, 2785), +(24851, '八里畈镇', 4, 2786), +(24852, '千斤乡', 4, 2786), +(24853, '卡房乡', 4, 2786), +(24854, '吴陈河镇', 4, 2786), +(24855, '周河乡', 4, 2786), +(24856, '新集镇', 4, 2786), +(24857, '沙窝镇', 4, 2786), +(24858, '泗店乡', 4, 2786), +(24859, '浒湾乡', 4, 2786), +(24860, '田铺乡', 4, 2786), +(24861, '箭厂河乡', 4, 2786), +(24862, '苏河镇', 4, 2786), +(24863, '郭家河乡', 4, 2786), +(24864, '陈店乡', 4, 2786), +(24865, '陡山河乡', 4, 2786), +(24866, '东双河镇', 4, 2787), +(24867, '五星街道', 4, 2787), +(24868, '五里墩街道', 4, 2787), +(24869, '十三里桥乡', 4, 2787), +(24870, '南湾街道', 4, 2787), +(24871, '双井街道', 4, 2787), +(24872, '吴家店镇', 4, 2787), +(24873, '李家寨镇', 4, 2787), +(24874, '柳林乡', 4, 2787), +(24875, '民权街道', 4, 2787), +(24876, '浉河港乡', 4, 2787), +(24877, '游河乡', 4, 2787), +(24878, '湖东街道', 4, 2787), +(24879, '老城街道', 4, 2787), +(24880, '董家河乡', 4, 2787), +(24881, '谭家河乡', 4, 2787), +(24882, '车站街道', 4, 2787), +(24883, '金牛山街道', 4, 2787), +(24884, '三空桥乡', 4, 2788), +(24885, '台头乡', 4, 2788), +(24886, '固城乡', 4, 2788), +(24887, '城关镇', 4, 2788), +(24888, '张庄乡', 4, 2788), +(24889, '张里乡', 4, 2788), +(24890, '新里镇', 4, 2788), +(24891, '期思镇', 4, 2788), +(24892, '栏杆镇', 4, 2788), +(24893, '王家岗乡', 4, 2788), +(24894, '王店乡', 4, 2788), +(24895, '芦集乡', 4, 2788), +(24896, '谷堆乡', 4, 2788), +(24897, '赵集镇', 4, 2788), +(24898, '邓湾乡', 4, 2788), +(24899, '防胡镇', 4, 2788), +(24900, '马集镇', 4, 2788), +(24901, '上油岗乡', 4, 2789), +(24902, '仁和镇', 4, 2789); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24903, '付店镇', 4, 2789), +(24904, '伞陂镇', 4, 2789), +(24905, '传流店乡', 4, 2789), +(24906, '卜塔集镇', 4, 2789), +(24907, '双柳树镇', 4, 2789), +(24908, '定城街道', 4, 2789), +(24909, '弋阳街道', 4, 2789), +(24910, '张集乡', 4, 2789), +(24911, '春申街道', 4, 2789), +(24912, '来龙乡', 4, 2789), +(24913, '桃林铺镇', 4, 2789), +(24914, '江家集镇', 4, 2789), +(24915, '白店乡', 4, 2789), +(24916, '老城街道', 4, 2789), +(24917, '谈店乡', 4, 2789), +(24918, '踅孜镇', 4, 2789), +(24919, '隆古乡', 4, 2789), +(24920, '魏岗乡', 4, 2789), +(24921, '黄寺岗镇', 4, 2789), +(24922, '东卜乡', 4, 2790), +(24923, '周党镇', 4, 2790), +(24924, '城关镇', 4, 2790), +(24925, '子路镇', 4, 2790), +(24926, '定远乡', 4, 2790), +(24927, '尤店乡', 4, 2790), +(24928, '山店乡', 4, 2790), +(24929, '庙仙乡', 4, 2790), +(24930, '彭新镇', 4, 2790), +(24931, '朱堂乡', 4, 2790), +(24932, '楠杆镇', 4, 2790), +(24933, '涩港镇', 4, 2790), +(24934, '潘新镇', 4, 2790), +(24935, '竹竿镇', 4, 2790), +(24936, '莽张乡', 4, 2790), +(24937, '铁铺乡', 4, 2790), +(24938, '青山镇', 4, 2790), +(24939, '高店乡', 4, 2790), +(24940, '龙山乡', 4, 2790), +(24941, '化河乡', 4, 2791), +(24942, '固墙镇', 4, 2791), +(24943, '城关乡', 4, 2791), +(24944, '城关镇', 4, 2791), +(24945, '大武乡', 4, 2791), +(24946, '姚集乡', 4, 2791), +(24947, '巴村镇', 4, 2791), +(24948, '平店乡', 4, 2791), +(24949, '张庄乡', 4, 2791), +(24950, '张明乡', 4, 2791), +(24951, '李埠口乡', 4, 2791), +(24952, '汤庄乡', 4, 2791), +(24953, '白寺镇', 4, 2791), +(24954, '练集镇', 4, 2791), +(24955, '胡吉镇', 4, 2791), +(24956, '舒庄乡', 4, 2791), +(24957, '袁老乡', 4, 2791), +(24958, '谭庄镇', 4, 2791), +(24959, '邓城镇', 4, 2791), +(24960, '郝岗乡', 4, 2791), +(24961, '魏集镇', 4, 2791), +(24962, '黄寨镇', 4, 2791), +(24963, '五里口乡', 4, 2792), +(24964, '城关回族镇', 4, 2792), +(24965, '城郊乡', 4, 2792), +(24966, '大许寨乡', 4, 2792); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(24967, '常营镇', 4, 2792), +(24968, '张集乡', 4, 2792), +(24969, '朱口镇', 4, 2792), +(24970, '杨庙乡', 4, 2792), +(24971, '板桥镇', 4, 2792), +(24972, '毛庄镇', 4, 2792), +(24973, '清集乡', 4, 2792), +(24974, '独塘乡', 4, 2792), +(24975, '王集乡', 4, 2792), +(24976, '符草楼镇', 4, 2792), +(24977, '老冢镇', 4, 2792), +(24978, '芝麻洼乡', 4, 2792), +(24979, '转楼乡', 4, 2792), +(24980, '逊母口镇', 4, 2792), +(24981, '马厂镇', 4, 2792), +(24982, '马头镇', 4, 2792), +(24983, '高朗乡', 4, 2792), +(24984, '高贤乡', 4, 2792), +(24985, '龙曲镇', 4, 2792), +(24986, '七一路街道', 4, 2793), +(24987, '人和街道', 4, 2793), +(24988, '城东街道', 4, 2793), +(24989, '城北街道', 4, 2793), +(24990, '城南街道', 4, 2793), +(24991, '小桥街道', 4, 2793), +(24992, '搬口街道', 4, 2793), +(24993, '纺织路街道', 4, 2793), +(24994, '陈州街道', 4, 2793), +(24995, '包屯镇', 4, 2794), +(24996, '吕潭乡', 4, 2794), +(24997, '固城乡', 4, 2794), +(24998, '城关镇', 4, 2794), +(24999, '城郊乡', 4, 2794), +(25000, '大新镇', 4, 2794), +(25001, '大李庄乡', 4, 2794), +(25002, '崔桥镇', 4, 2794), +(25003, '曹里乡', 4, 2794), +(25004, '柴岗乡', 4, 2794), +(25005, '江村镇', 4, 2794), +(25006, '汴岗镇', 4, 2794), +(25007, '白潭镇', 4, 2794), +(25008, '练寺镇', 4, 2794), +(25009, '韭园镇', 4, 2794), +(25010, '付井镇', 4, 2795), +(25011, '冯营乡', 4, 2795), +(25012, '刘庄店镇', 4, 2795), +(25013, '刘湾镇', 4, 2795), +(25014, '北杨集乡', 4, 2795), +(25015, '北郊乡', 4, 2795), +(25016, '卞路口乡', 4, 2795), +(25017, '周营乡', 4, 2795), +(25018, '大邢庄乡', 4, 2795), +(25019, '新安集镇', 4, 2795), +(25020, '李老庄乡', 4, 2795), +(25021, '槐店回族镇', 4, 2795), +(25022, '洪山乡', 4, 2795), +(25023, '留福集镇', 4, 2795), +(25024, '白集镇', 4, 2795), +(25025, '石槽集乡', 4, 2795), +(25026, '纸店镇', 4, 2795), +(25027, '老城镇', 4, 2795), +(25028, '范营乡', 4, 2795), +(25029, '赵德营镇', 4, 2795); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25030, '连池乡', 4, 2795), +(25031, '临蔡镇', 4, 2796), +(25032, '冯塘乡', 4, 2796), +(25033, '刘振屯乡', 4, 2796), +(25034, '四通镇', 4, 2796), +(25035, '城关回族镇', 4, 2796), +(25036, '大连乡', 4, 2796), +(25037, '安岭镇', 4, 2796), +(25038, '新站镇', 4, 2796), +(25039, '曹河乡', 4, 2796), +(25040, '朱集乡', 4, 2796), +(25041, '王店乡', 4, 2796), +(25042, '白楼乡', 4, 2796), +(25043, '葛店乡', 4, 2796), +(25044, '许湾乡', 4, 2796), +(25045, '豆门乡', 4, 2796), +(25046, '郑集乡', 4, 2796), +(25047, '鲁台镇', 4, 2796), +(25048, '黄集乡', 4, 2796), +(25049, '齐老乡', 4, 2796), +(25050, '东夏亭镇', 4, 2797), +(25051, '东王营乡', 4, 2797), +(25052, '叶埠口乡', 4, 2797), +(25053, '址坊镇', 4, 2797), +(25054, '城关镇', 4, 2797), +(25055, '大王庄乡', 4, 2797), +(25056, '奉母镇', 4, 2797), +(25057, '李大庄乡', 4, 2797), +(25058, '清河驿乡', 4, 2797), +(25059, '田口乡', 4, 2797), +(25060, '皮营乡', 4, 2797), +(25061, '红花集镇', 4, 2797), +(25062, '聂堆镇', 4, 2797), +(25063, '艾岗乡', 4, 2797), +(25064, '西华营镇', 4, 2797), +(25065, '西夏亭镇', 4, 2797), +(25066, '迟营乡', 4, 2797), +(25067, '逍遥镇', 4, 2797), +(25068, '黄土桥乡', 4, 2797), +(25069, '丁村乡', 4, 2798), +(25070, '东风乡', 4, 2798), +(25071, '南丰镇', 4, 2798), +(25072, '双楼乡', 4, 2798), +(25073, '吴台镇', 4, 2798), +(25074, '城关镇', 4, 2798), +(25075, '城郊乡', 4, 2798), +(25076, '宁平镇', 4, 2798), +(25077, '宜路镇', 4, 2798), +(25078, '巴集乡', 4, 2798), +(25079, '张完集乡', 4, 2798), +(25080, '李楼乡', 4, 2798), +(25081, '汲冢镇', 4, 2798), +(25082, '汲水乡', 4, 2798), +(25083, '白马镇', 4, 2798), +(25084, '石槽镇', 4, 2798), +(25085, '秋渠乡', 4, 2798), +(25086, '胡集乡', 4, 2798), +(25087, '虎头岗乡', 4, 2798), +(25088, '钱店镇', 4, 2798), +(25089, '丁集镇', 4, 2799), +(25090, '三张店乡', 4, 2799), +(25091, '东方办事处', 4, 2799), +(25092, '付集镇', 4, 2799), +(25093, '光武办事处', 4, 2799); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25094, '千佛阁办事处', 4, 2799), +(25095, '南顿镇', 4, 2799), +(25096, '孙店镇', 4, 2799), +(25097, '官会镇', 4, 2799), +(25098, '新桥镇', 4, 2799), +(25099, '李寨镇', 4, 2799), +(25100, '水寨办事处', 4, 2799), +(25101, '永丰乡', 4, 2799), +(25102, '王明口镇', 4, 2799), +(25103, '秣陵镇', 4, 2799), +(25104, '花园办事处', 4, 2799), +(25105, '范集乡', 4, 2799), +(25106, '莲花办事处', 4, 2799), +(25107, '贾岭镇', 4, 2799), +(25108, '郑郭镇', 4, 2799), +(25109, '高寺镇', 4, 2799), +(25110, '任集乡', 4, 2800), +(25111, '前李农场', 4, 2800), +(25112, '后狄楼农场', 4, 2800), +(25113, '唐集乡', 4, 2800), +(25114, '城关镇', 4, 2800), +(25115, '城郊乡', 4, 2800), +(25116, '太清农场', 4, 2800), +(25117, '太清宫镇', 4, 2800), +(25118, '张店乡', 4, 2800), +(25119, '杨湖口乡', 4, 2800), +(25120, '枣集农场', 4, 2800), +(25121, '枣集镇', 4, 2800), +(25122, '涡北镇', 4, 2800), +(25123, '火王农场', 4, 2800), +(25124, '玄武镇', 4, 2800), +(25125, '王皮溜镇', 4, 2800), +(25126, '生铁冢乡', 4, 2800), +(25127, '穆店乡', 4, 2800), +(25128, '观堂乡', 4, 2800), +(25129, '试量镇', 4, 2800), +(25130, '贾滩乡', 4, 2800), +(25131, '赵村乡', 4, 2800), +(25132, '辛集镇', 4, 2800), +(25133, '邱集乡', 4, 2800), +(25134, '郑家集乡', 4, 2800), +(25135, '马铺镇', 4, 2800), +(25136, '高集乡', 4, 2800), +(25137, '东岸乡', 4, 2801), +(25138, '东洪乡', 4, 2801), +(25139, '五龙乡', 4, 2801), +(25140, '党店镇', 4, 2801), +(25141, '华陂镇', 4, 2801), +(25142, '和店乡', 4, 2801), +(25143, '塔桥乡', 4, 2801), +(25144, '大路李乡', 4, 2801), +(25145, '小岳寺乡', 4, 2801), +(25146, '崇礼乡', 4, 2801), +(25147, '无量寺乡', 4, 2801), +(25148, '朱里镇', 4, 2801), +(25149, '杨屯乡', 4, 2801), +(25150, '杨集镇', 4, 2801), +(25151, '洙湖镇', 4, 2801), +(25152, '百尺乡', 4, 2801), +(25153, '芦岗乡', 4, 2801), +(25154, '蔡沟乡', 4, 2801), +(25155, '蔡都镇', 4, 2801), +(25156, '西洪乡', 4, 2801); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25157, '邵店乡', 4, 2801), +(25158, '韩寨乡', 4, 2801), +(25159, '黄埠镇', 4, 2801), +(25160, '齐海乡', 4, 2801), +(25161, '万冢乡', 4, 2802), +(25162, '万金店乡', 4, 2802), +(25163, '东和店镇', 4, 2802), +(25164, '东皇庙乡', 4, 2802), +(25165, '十字路乡', 4, 2802), +(25166, '双庙乡', 4, 2802), +(25167, '古槐镇', 4, 2802), +(25168, '后刘乡', 4, 2802), +(25169, '射桥镇', 4, 2802), +(25170, '庙湾镇', 4, 2802), +(25171, '李屯乡', 4, 2802), +(25172, '杨埠镇', 4, 2802), +(25173, '玉皇庙乡', 4, 2802), +(25174, '老王岗乡', 4, 2802), +(25175, '西洋店镇', 4, 2802), +(25176, '辛店乡', 4, 2802), +(25177, '郭楼乡', 4, 2802), +(25178, '高杨店乡', 4, 2802), +(25179, '余店乡', 4, 2803), +(25180, '佛阁寺镇', 4, 2803), +(25181, '关津乡', 4, 2803), +(25182, '化庄乡', 4, 2803), +(25183, '十里铺乡', 4, 2803), +(25184, '古吕镇', 4, 2803), +(25185, '孙召乡', 4, 2803), +(25186, '宋岗乡', 4, 2803), +(25187, '弥陀寺乡', 4, 2803), +(25188, '李桥回族镇', 4, 2803), +(25189, '杨庄户乡', 4, 2803), +(25190, '栎城乡', 4, 2803), +(25191, '棠村镇', 4, 2803), +(25192, '河坞乡', 4, 2803), +(25193, '涧头乡', 4, 2803), +(25194, '砖店镇', 4, 2803), +(25195, '练村镇', 4, 2803), +(25196, '陈店镇', 4, 2803), +(25197, '韩集镇', 4, 2803), +(25198, '顿岗乡', 4, 2803), +(25199, '黄楼乡', 4, 2803), +(25200, '龙口镇', 4, 2803), +(25201, '五三农场', 4, 2804), +(25202, '傅寨乡', 4, 2804), +(25203, '兰青乡', 4, 2804), +(25204, '吕河乡', 4, 2804), +(25205, '大林乡', 4, 2804), +(25206, '寒冻镇', 4, 2804), +(25207, '彭桥乡', 4, 2804), +(25208, '慎水乡', 4, 2804), +(25209, '新阮店乡', 4, 2804), +(25210, '永兴乡', 4, 2804), +(25211, '汝南埠镇', 4, 2804), +(25212, '油坊店乡', 4, 2804), +(25213, '熊寨镇', 4, 2804), +(25214, '王勿桥乡', 4, 2804), +(25215, '皮店乡', 4, 2804), +(25216, '真阳镇', 4, 2804), +(25217, '袁寨乡', 4, 2804), +(25218, '铜钟镇', 4, 2804), +(25219, '陡沟镇', 4, 2804), +(25220, '雷寨乡', 4, 2804); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25221, '三桥乡', 4, 2805), +(25222, '三里店乡', 4, 2805), +(25223, '三门闸乡', 4, 2805), +(25224, '南余店乡', 4, 2805), +(25225, '和孝镇', 4, 2805), +(25226, '官庄乡', 4, 2805), +(25227, '常兴乡', 4, 2805), +(25228, '张楼乡', 4, 2805), +(25229, '板店乡', 4, 2805), +(25230, '汝宁镇', 4, 2805), +(25231, '王岗镇', 4, 2805), +(25232, '留盆镇', 4, 2805), +(25233, '罗店乡', 4, 2805), +(25234, '老君庙镇', 4, 2805), +(25235, '金铺镇', 4, 2805), +(25236, '韩庄乡', 4, 2805), +(25237, '马乡镇', 4, 2805), +(25238, '下碑寺乡', 4, 2806), +(25239, '付庄乡', 4, 2806), +(25240, '双庙街乡', 4, 2806), +(25241, '官庄乡', 4, 2806), +(25242, '春水镇', 4, 2806), +(25243, '杨家集乡', 4, 2806), +(25244, '板桥镇', 4, 2806), +(25245, '沙河店镇', 4, 2806), +(25246, '泌水镇', 4, 2806), +(25247, '泰山庙乡', 4, 2806), +(25248, '王店乡', 4, 2806), +(25249, '羊册镇', 4, 2806), +(25250, '老河乡', 4, 2806), +(25251, '花园乡', 4, 2806), +(25252, '象河乡', 4, 2806), +(25253, '贾楼乡', 4, 2806), +(25254, '赊湾乡', 4, 2806), +(25255, '郭集乡', 4, 2806), +(25256, '铜山乡', 4, 2806), +(25257, '陈庄乡', 4, 2806), +(25258, '马谷田镇', 4, 2806), +(25259, '高店乡', 4, 2806), +(25260, '高邑乡', 4, 2806), +(25261, '黄山口乡', 4, 2806), +(25262, '三里河乡', 4, 2807), +(25263, '任店镇', 4, 2807), +(25264, '刘店镇', 4, 2807), +(25265, '双河乡', 4, 2807), +(25266, '新安店镇', 4, 2807), +(25267, '普会寺乡', 4, 2807), +(25268, '李新店乡', 4, 2807), +(25269, '瓦岗乡', 4, 2807), +(25270, '留庄镇', 4, 2807), +(25271, '盘龙镇', 4, 2807), +(25272, '石滚河乡', 4, 2807), +(25273, '竹沟镇', 4, 2807), +(25274, '蚁蜂镇', 4, 2807), +(25275, '专探乡', 4, 2808), +(25276, '二郎乡', 4, 2808), +(25277, '五沟营镇', 4, 2808), +(25278, '人和乡', 4, 2808), +(25279, '出山镇', 4, 2808), +(25280, '吕店乡', 4, 2808), +(25281, '宋集乡', 4, 2808), +(25282, '师灵镇', 4, 2808), +(25283, '权寨镇', 4, 2808), +(25284, '杨庄乡', 4, 2808); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25285, '柏亭街道', 4, 2808), +(25286, '柏城街道', 4, 2808), +(25287, '焦庄乡', 4, 2808), +(25288, '环城乡', 4, 2808), +(25289, '盆尧乡', 4, 2808), +(25290, '老王坡农场', 4, 2808), +(25291, '芦庙乡', 4, 2808), +(25292, '蔡寨回族乡', 4, 2808), +(25293, '谭店乡', 4, 2808), +(25294, '重渠乡', 4, 2808), +(25295, '和兴乡', 4, 2809), +(25296, '常庄乡', 4, 2809), +(25297, '文城乡', 4, 2809), +(25298, '查岈山乡', 4, 2809), +(25299, '查岈山风景区', 4, 2809), +(25300, '槐树乡', 4, 2809), +(25301, '沈寨乡', 4, 2809), +(25302, '玉山镇', 4, 2809), +(25303, '瞿阳镇', 4, 2809), +(25304, '石寨铺乡', 4, 2809), +(25305, '花庄乡', 4, 2809), +(25306, '褚堂乡', 4, 2809), +(25307, '车站镇', 4, 2809), +(25308, '阳丰乡', 4, 2809), +(25309, '东风街道', 4, 2810), +(25310, '人民街道', 4, 2810), +(25311, '关王庙乡', 4, 2810), +(25312, '刘阁街道', 4, 2810), +(25313, '南海街道', 4, 2810), +(25314, '古城乡', 4, 2810), +(25315, '新华街道', 4, 2810), +(25316, '朱古洞乡', 4, 2810), +(25317, '橡林街道', 4, 2810), +(25318, '水屯镇', 4, 2810), +(25319, '老街街道', 4, 2810), +(25320, '胡庙乡', 4, 2810), +(25321, '西园街道', 4, 2810), +(25322, '诸市乡', 4, 2810), +(25323, '金山办事处', 4, 2810), +(25324, '金桥办事处', 4, 2810), +(25325, '金河办事处', 4, 2810), +(25326, '雪松街道', 4, 2810), +(25327, '顺河街道', 4, 2810), +(25328, '下冶乡', 4, 2811), +(25329, '五龙口镇', 4, 2811), +(25330, '亚桥乡', 4, 2811), +(25331, '克井镇', 4, 2811), +(25332, '北海街道', 4, 2811), +(25333, '双桥街道', 4, 2811), +(25334, '坡头镇', 4, 2811), +(25335, '大峪镇', 4, 2811), +(25336, '天坛街道', 4, 2811), +(25337, '思礼乡', 4, 2811), +(25338, '承留镇', 4, 2811), +(25339, '梨林镇', 4, 2811), +(25340, '济水街道', 4, 2811), +(25341, '王屋乡', 4, 2811), +(25342, '轵城镇', 4, 2811), +(25343, '邵原镇', 4, 2811), +(25344, '东山办事处', 4, 2812), +(25345, '吴家山街道', 4, 2812), +(25346, '将军路街道', 4, 2812); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25347, '径河街道', 4, 2812), +(25348, '慈惠街道', 4, 2812), +(25349, '新沟街道', 4, 2812), +(25350, '柏泉办事处', 4, 2812), +(25351, '走马岭街道', 4, 2812), +(25352, '辛安渡办事处', 4, 2812), +(25353, '金银湖街道', 4, 2812), +(25354, '长青街道', 4, 2812), +(25355, '三店街道', 4, 2813), +(25356, '仓埠街道', 4, 2813), +(25357, '凤凰镇', 4, 2813), +(25358, '双柳街道', 4, 2813), +(25359, '徐古镇', 4, 2813), +(25360, '旧街街道', 4, 2813), +(25361, '李集街道', 4, 2813), +(25362, '汪集街道', 4, 2813), +(25363, '涨渡湖街道', 4, 2813), +(25364, '潘塘街道', 4, 2813), +(25365, '辛冲镇', 4, 2813), +(25366, '邾城街道', 4, 2813), +(25367, '阳逻街道', 4, 2813), +(25368, '中华路街道', 4, 2814), +(25369, '中南路街道', 4, 2814), +(25370, '徐家棚街道', 4, 2814), +(25371, '新河街道', 4, 2814), +(25372, '杨园街道', 4, 2814), +(25373, '水果湖街道', 4, 2814), +(25374, '珞珈山街道', 4, 2814), +(25375, '白沙洲街道', 4, 2814), +(25376, '石洞街道', 4, 2814), +(25377, '积玉桥街道', 4, 2814), +(25378, '粮道街街道', 4, 2814), +(25379, '紫阳街道', 4, 2814), +(25380, '首义路街道', 4, 2814), +(25381, '黄鹤楼街道', 4, 2814), +(25382, '东荆街道', 4, 2815), +(25383, '湘口街道', 4, 2815), +(25384, '纱帽街道', 4, 2815), +(25385, '邓南镇', 4, 2815), +(25386, '五里墩街道', 4, 2816), +(25387, '建桥街道', 4, 2816), +(25388, '晴川街道', 4, 2816), +(25389, '月湖街道', 4, 2816), +(25390, '永丰街道', 4, 2816), +(25391, '江堤街道', 4, 2816), +(25392, '江汉二桥街道', 4, 2816), +(25393, '洲头街道', 4, 2816), +(25394, '琴断口街道', 4, 2816), +(25395, '翠微街道', 4, 2816), +(25396, '鹦鹉街道', 4, 2816), +(25397, '乌龙泉街道', 4, 2817), +(25398, '五里界镇', 4, 2817), +(25399, '安山镇', 4, 2817), +(25400, '山坡乡', 4, 2817), +(25401, '法泗镇', 4, 2817), +(25402, '流芳街道', 4, 2817), +(25403, '湖泗镇', 4, 2817), +(25404, '纸坊街道', 4, 2817), +(25405, '舒安乡', 4, 2817); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25406, '豹澥镇', 4, 2817), +(25407, '郑店街道', 4, 2817), +(25408, '金口街道', 4, 2817), +(25409, '一元街道', 4, 2818), +(25410, '上海街道', 4, 2818), +(25411, '丹水池街道', 4, 2818), +(25412, '二七街道', 4, 2818), +(25413, '劳动街道', 4, 2818), +(25414, '台北街道', 4, 2818), +(25415, '后湖街道', 4, 2818), +(25416, '四唯街道', 4, 2818), +(25417, '大智街道', 4, 2818), +(25418, '新村街道', 4, 2818), +(25419, '永清街道', 4, 2818), +(25420, '球场街道', 4, 2818), +(25421, '花桥街道', 4, 2818), +(25422, '西马街道', 4, 2818), +(25423, '谌家矶街道', 4, 2818), +(25424, '车站街道', 4, 2818), +(25425, '万松街道', 4, 2819), +(25426, '前进街道', 4, 2819), +(25427, '北湖街道', 4, 2819), +(25428, '唐家墩街道', 4, 2819), +(25429, '常青街道', 4, 2819), +(25430, '新华街道', 4, 2819), +(25431, '民意街道', 4, 2819), +(25432, '民族街道', 4, 2819), +(25433, '民权街道', 4, 2819), +(25434, '水塔街道', 4, 2819), +(25435, '汉兴街道', 4, 2819), +(25436, '满春街道', 4, 2819), +(25437, '花楼街道', 4, 2819), +(25438, '九峰乡', 4, 2820), +(25439, '关山街道', 4, 2820), +(25440, '和平街道', 4, 2820), +(25441, '天兴乡', 4, 2820), +(25442, '左岭镇', 4, 2820), +(25443, '建设乡', 4, 2820), +(25444, '张家湾街道', 4, 2820), +(25445, '洪山街道', 4, 2820), +(25446, '狮子山街道', 4, 2820), +(25447, '珞南街道', 4, 2820), +(25448, '红旗街道', 4, 2820), +(25449, '花山镇', 4, 2820), +(25450, '葛化街道', 4, 2820), +(25451, '青菱乡', 4, 2820), +(25452, '六角亭街道', 4, 2821), +(25453, '宗关街道', 4, 2821), +(25454, '宝丰街道', 4, 2821), +(25455, '崇仁街道', 4, 2821), +(25456, '易家墩街道', 4, 2821), +(25457, '汉中街道', 4, 2821), +(25458, '汉正街街道', 4, 2821), +(25459, '汉水桥街道', 4, 2821), +(25460, '荣华街道', 4, 2821), +(25461, '长丰街道', 4, 2821), +(25462, '韩家墩街道', 4, 2821), +(25463, '侏儒街道', 4, 2822), +(25464, '军山街道', 4, 2822); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25465, '大集街道', 4, 2822), +(25466, '奓山街道', 4, 2822), +(25467, '张湾街道', 4, 2822), +(25468, '永安街道', 4, 2822), +(25469, '沌口街道', 4, 2822), +(25470, '消泗乡', 4, 2822), +(25471, '玉贤镇', 4, 2822), +(25472, '索河镇', 4, 2822), +(25473, '蔡甸街道', 4, 2822), +(25474, '冶金街道', 4, 2823), +(25475, '厂前街道', 4, 2823), +(25476, '工人村街道', 4, 2823), +(25477, '新沟桥街道', 4, 2823), +(25478, '武东街道', 4, 2823), +(25479, '白玉山街道', 4, 2823), +(25480, '红卫路街道', 4, 2823), +(25481, '红钢城街道', 4, 2823), +(25482, '钢花村街道', 4, 2823), +(25483, '青山镇街道', 4, 2823), +(25484, '三里镇', 4, 2824), +(25485, '六指街道', 4, 2824), +(25486, '前川街道', 4, 2824), +(25487, '天河街道', 4, 2824), +(25488, '姚家集镇', 4, 2824), +(25489, '木兰乡', 4, 2824), +(25490, '李家集镇', 4, 2824), +(25491, '横店街道', 4, 2824), +(25492, '武湖街道', 4, 2824), +(25493, '滠口街道', 4, 2824), +(25494, '王家河镇', 4, 2824), +(25495, '祁家湾街道', 4, 2824), +(25496, '罗汉寺街道', 4, 2824), +(25497, '蔡家榨镇', 4, 2824), +(25498, '蔡店乡', 4, 2824), +(25499, '长轩岭镇', 4, 2824), +(25500, '东方山街道', 4, 2825), +(25501, '团城山街道', 4, 2825), +(25502, '新下陆街道', 4, 2825), +(25503, '老下陆街道', 4, 2825), +(25504, '东岳路街道', 4, 2826), +(25505, '保安镇', 4, 2826), +(25506, '刘仁八镇', 4, 2826), +(25507, '名山乡', 4, 2826), +(25508, '大箕铺镇', 4, 2826), +(25509, '殷祖镇', 4, 2826), +(25510, '汪仁镇', 4, 2826), +(25511, '灵乡镇', 4, 2826), +(25512, '罗家桥街道', 4, 2826), +(25513, '还地桥镇', 4, 2826), +(25514, '金山店镇', 4, 2826), +(25515, '金湖街道', 4, 2826), +(25516, '金牛镇', 4, 2826), +(25517, '陈贵镇', 4, 2826), +(25518, '临江街道', 4, 2827), +(25519, '八泉街道', 4, 2827), +(25520, '河口镇', 4, 2827), +(25521, '澄月街道', 4, 2827), +(25522, '西塞街道', 4, 2827), +(25523, '陈家湾街道', 4, 2827); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25524, '黄思湾街道', 4, 2827), +(25525, '铁山街道', 4, 2828), +(25526, '鹿獐山街道', 4, 2828), +(25527, '三溪镇', 4, 2829), +(25528, '兴国镇', 4, 2829), +(25529, '大王镇', 4, 2829), +(25530, '太子镇', 4, 2829), +(25531, '富池镇', 4, 2829), +(25532, '排市镇', 4, 2829), +(25533, '木港镇', 4, 2829), +(25534, '枫林镇', 4, 2829), +(25535, '洋港镇', 4, 2829), +(25536, '浮屠镇', 4, 2829), +(25537, '王英镇', 4, 2829), +(25538, '白沙镇', 4, 2829), +(25539, '陶港镇', 4, 2829), +(25540, '韦源口镇', 4, 2829), +(25541, '黄颡口镇', 4, 2829), +(25542, '龙港镇', 4, 2829), +(25543, '沈家营街道', 4, 2830), +(25544, '红旗桥街道', 4, 2830), +(25545, '胜阳港街道', 4, 2830), +(25546, '花湖街道', 4, 2830), +(25547, '黄石港街道', 4, 2830), +(25548, '丁家营镇', 4, 2831), +(25549, '三官殿街道', 4, 2831), +(25550, '丹赵路街道', 4, 2831), +(25551, '习家店镇', 4, 2831), +(25552, '六里坪镇', 4, 2831), +(25553, '凉水河镇', 4, 2831), +(25554, '土关垭镇', 4, 2831), +(25555, '土台乡', 4, 2831), +(25556, '均县镇', 4, 2831), +(25557, '均州路街道', 4, 2831), +(25558, '大坝街道', 4, 2831), +(25559, '官山镇', 4, 2831), +(25560, '武当山街道', 4, 2831), +(25561, '浪河镇', 4, 2831), +(25562, '盐池河镇', 4, 2831), +(25563, '石鼓镇', 4, 2831), +(25564, '蒿坪镇', 4, 2831), +(25565, '方滩乡', 4, 2832), +(25566, '柏林镇', 4, 2832), +(25567, '汉江路街道', 4, 2832), +(25568, '红卫街道', 4, 2832), +(25569, '花果街道', 4, 2832), +(25570, '西沟乡', 4, 2832), +(25571, '车城路街道', 4, 2832), +(25572, '黄龙镇', 4, 2832), +(25573, '万峪河乡', 4, 2833), +(25574, '上龛乡', 4, 2833), +(25575, '中坝乡', 4, 2833), +(25576, '九道乡', 4, 2833), +(25577, '军店镇', 4, 2833), +(25578, '化龙堰镇', 4, 2833), +(25579, '土城镇', 4, 2833), +(25580, '城关镇', 4, 2833), +(25581, '大木厂镇', 4, 2833), +(25582, '姚坪乡', 4, 2833), +(25583, '柳林乡', 4, 2833), +(25584, '桥上乡', 4, 2833), +(25585, '榔口乡', 4, 2833); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25586, '沙河乡', 4, 2833), +(25587, '白窝乡', 4, 2833), +(25588, '窑淮乡', 4, 2833), +(25589, '红塔乡', 4, 2833), +(25590, '门古寺镇', 4, 2833), +(25591, '青峰镇', 4, 2833), +(25592, '双台乡', 4, 2834), +(25593, '城关镇', 4, 2834), +(25594, '大庙乡', 4, 2834), +(25595, '官渡镇', 4, 2834), +(25596, '宝丰镇', 4, 2834), +(25597, '得胜镇', 4, 2834), +(25598, '擂鼓镇', 4, 2834), +(25599, '文峰乡', 4, 2834), +(25600, '楼台乡', 4, 2834), +(25601, '深河乡', 4, 2834), +(25602, '溢水镇', 4, 2834), +(25603, '潘口乡', 4, 2834), +(25604, '田家坝镇', 4, 2834), +(25605, '秦古镇', 4, 2834), +(25606, '竹坪乡', 4, 2834), +(25607, '麻家渡镇', 4, 2834), +(25608, '中峰镇', 4, 2835), +(25609, '丰溪镇', 4, 2835), +(25610, '兵营乡', 4, 2835), +(25611, '县河镇', 4, 2835), +(25612, '向坝乡', 4, 2835), +(25613, '城关镇', 4, 2835), +(25614, '天宝乡', 4, 2835), +(25615, '新洲乡', 4, 2835), +(25616, '桃源乡', 4, 2835), +(25617, '水坪镇', 4, 2835), +(25618, '汇湾乡', 4, 2835), +(25619, '泉溪镇', 4, 2835), +(25620, '蒋家堰镇', 4, 2835), +(25621, '鄂坪乡', 4, 2835), +(25622, '龙坝乡', 4, 2835), +(25623, '二堰街道', 4, 2836), +(25624, '五堰街道', 4, 2836), +(25625, '大川镇', 4, 2836), +(25626, '武当路街道', 4, 2836), +(25627, '白浪街道', 4, 2836), +(25628, '茅塔乡', 4, 2836), +(25629, '鸳鸯乡', 4, 2836), +(25630, '五峰乡', 4, 2837), +(25631, '刘洞镇', 4, 2837), +(25632, '南化塘镇', 4, 2837), +(25633, '叶大乡', 4, 2837), +(25634, '城关镇', 4, 2837), +(25635, '大柳乡', 4, 2837), +(25636, '安阳镇', 4, 2837), +(25637, '杨溪铺镇', 4, 2837), +(25638, '柳陂镇', 4, 2837), +(25639, '梅铺镇', 4, 2837), +(25640, '白桑关镇', 4, 2837), +(25641, '白浪镇', 4, 2837), +(25642, '胡家营镇', 4, 2837), +(25643, '茶店镇', 4, 2837), +(25644, '谭山镇', 4, 2837), +(25645, '青山镇', 4, 2837), +(25646, '青曲镇', 4, 2837), +(25647, '鲍峡镇', 4, 2837), +(25648, '上津', 4, 2838), +(25649, '六郎', 4, 2838), +(25650, '关防', 4, 2838); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25651, '土门', 4, 2838), +(25652, '城关', 4, 2838), +(25653, '夹河', 4, 2838), +(25654, '安家', 4, 2838), +(25655, '店子', 4, 2838), +(25656, '景阳', 4, 2838), +(25657, '河夹', 4, 2838), +(25658, '涧池', 4, 2838), +(25659, '湖北口回族乡', 4, 2838), +(25660, '羊尾', 4, 2838), +(25661, '观音', 4, 2838), +(25662, '香口', 4, 2838), +(25663, '马安', 4, 2838), +(25664, '五峰', 4, 2839), +(25665, '仁和坪', 4, 2839), +(25666, '傅家堰', 4, 2839), +(25667, '渔洋关', 4, 2839), +(25668, '湾潭镇', 4, 2839), +(25669, '牛庄乡', 4, 2839), +(25670, '采花', 4, 2839), +(25671, '长乐坪', 4, 2839), +(25672, '万寿桥街道', 4, 2840), +(25673, '伍家乡', 4, 2840), +(25674, '伍家岗街道', 4, 2840), +(25675, '大公桥街道', 4, 2840), +(25676, '宝塔河街道', 4, 2840), +(25677, '南阳镇', 4, 2841), +(25678, '古夫镇', 4, 2841), +(25679, '峡口镇', 4, 2841), +(25680, '榛子乡', 4, 2841), +(25681, '水月寺镇', 4, 2841), +(25682, '高桥乡', 4, 2841), +(25683, '高阳镇', 4, 2841), +(25684, '黄粮镇', 4, 2841), +(25685, '三斗坪镇', 4, 2842), +(25686, '下堡坪乡', 4, 2842), +(25687, '乐天溪镇', 4, 2842), +(25688, '分乡镇', 4, 2842), +(25689, '太平溪镇', 4, 2842), +(25690, '小溪塔街道', 4, 2842), +(25691, '樟村坪镇', 4, 2842), +(25692, '邓村乡', 4, 2842), +(25693, '雾渡河镇', 4, 2842), +(25694, '鸦鹊岭镇', 4, 2842), +(25695, '黄花乡', 4, 2842), +(25696, '龙泉镇', 4, 2842), +(25697, '五眼泉乡', 4, 2843), +(25698, '姚家店乡', 4, 2843), +(25699, '松木坪镇', 4, 2843), +(25700, '枝城镇', 4, 2843), +(25701, '潘家湾土家族乡', 4, 2843), +(25702, '红花套镇', 4, 2843), +(25703, '聂家河镇', 4, 2843), +(25704, '陆城街道', 4, 2843), +(25705, '高坝洲镇', 4, 2843), +(25706, '两河镇', 4, 2844), +(25707, '半月镇', 4, 2844), +(25708, '坝陵街道', 4, 2844), +(25709, '庙前镇', 4, 2844), +(25710, '河溶镇', 4, 2844), +(25711, '淯溪镇', 4, 2844), +(25712, '玉泉街道', 4, 2844), +(25713, '玉阳街道', 4, 2844), +(25714, '王家畈乡', 4, 2844); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25715, '王店镇', 4, 2844), +(25716, '草埠湖镇', 4, 2844), +(25717, '七星台', 4, 2845), +(25718, '仙女镇', 4, 2845), +(25719, '安福寺', 4, 2845), +(25720, '白洋', 4, 2845), +(25721, '百里洲', 4, 2845), +(25722, '董市', 4, 2845), +(25723, '问安', 4, 2845), +(25724, '顾家店', 4, 2845), +(25725, '马家店街道办事处', 4, 2845), +(25726, '土城乡', 4, 2846), +(25727, '桥边镇', 4, 2846), +(25728, '点军街道', 4, 2846), +(25729, '联棚乡', 4, 2846), +(25730, '艾家镇', 4, 2846), +(25731, '两河口镇', 4, 2847), +(25732, '周坪乡', 4, 2847), +(25733, '屈原镇', 4, 2847), +(25734, '归州镇', 4, 2847), +(25735, '杨林桥镇', 4, 2847), +(25736, '梅家河乡', 4, 2847), +(25737, '水田坝乡', 4, 2847), +(25738, '沙镇溪镇', 4, 2847), +(25739, '泄滩乡', 4, 2847), +(25740, '磨坪乡', 4, 2847), +(25741, '茅坪镇', 4, 2847), +(25742, '郭家坝镇', 4, 2847), +(25743, '云池街道', 4, 2848), +(25744, '古老背街', 4, 2848), +(25745, '虎牙街道', 4, 2848), +(25746, '云集街道', 4, 2849), +(25747, '夜明珠街道', 4, 2849), +(25748, '学院街道', 4, 2849), +(25749, '窑湾乡', 4, 2849), +(25750, '葛洲坝街道', 4, 2849), +(25751, '西坝街道', 4, 2849), +(25752, '西陵街道', 4, 2849), +(25753, '旧县镇', 4, 2850), +(25754, '河口乡', 4, 2850), +(25755, '洋坪镇', 4, 2850), +(25756, '花林寺镇', 4, 2850), +(25757, '茅坪场镇', 4, 2850), +(25758, '荷花镇', 4, 2850), +(25759, '鸣凤镇', 4, 2850), +(25760, '大堰乡', 4, 2851), +(25761, '大烧坪乡', 4, 2851), +(25762, '榔坪镇', 4, 2851), +(25763, '渔峡口镇', 4, 2851), +(25764, '磨市镇', 4, 2851), +(25765, '贺家坪镇', 4, 2851), +(25766, '资丘镇', 4, 2851), +(25767, '都镇湾镇', 4, 2851), +(25768, '高家堰镇', 4, 2851), +(25769, '鸭子口乡', 4, 2851), +(25770, '龙舟坪镇', 4, 2851), +(25771, '两峪', 4, 2852), +(25772, '后坪', 4, 2852), +(25773, '城关', 4, 2852), +(25774, '寺坪', 4, 2852), +(25775, '店垭镇', 4, 2852), +(25776, '歇马', 4, 2852), +(25777, '过渡湾', 4, 2852); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25778, '马桥', 4, 2852), +(25779, '马良', 4, 2852), +(25780, '黄堡', 4, 2852), +(25781, '龙坪', 4, 2852), +(25782, '东巩镇', 4, 2853), +(25783, '九集镇', 4, 2853), +(25784, '城关镇', 4, 2853), +(25785, '巡检镇', 4, 2853), +(25786, '李庙镇', 4, 2853), +(25787, '板桥镇', 4, 2853), +(25788, '武安镇', 4, 2853), +(25789, '肖堰镇', 4, 2853), +(25790, '薛坪镇', 4, 2853), +(25791, '长坪镇', 4, 2853), +(25792, '刘猴', 4, 2854), +(25793, '南营', 4, 2854), +(25794, '孔湾', 4, 2854), +(25795, '小河', 4, 2854), +(25796, '板桥店', 4, 2854), +(25797, '流水', 4, 2854), +(25798, '王集', 4, 2854), +(25799, '郑集', 4, 2854), +(25800, '鄢城', 4, 2854), +(25801, '七方镇', 4, 2855), +(25802, '兴隆镇', 4, 2855), +(25803, '刘升镇', 4, 2855), +(25804, '北城街道', 4, 2855), +(25805, '南城街道', 4, 2855), +(25806, '吴店镇', 4, 2855), +(25807, '太平镇', 4, 2855), +(25808, '平林镇', 4, 2855), +(25809, '新市镇', 4, 2855), +(25810, '杨垱镇', 4, 2855), +(25811, '熊集镇', 4, 2855), +(25812, '王城镇', 4, 2855), +(25813, '环城街道', 4, 2855), +(25814, '璩湾镇', 4, 2855), +(25815, '鹿头镇', 4, 2855), +(25816, '七里河街道', 4, 2856), +(25817, '中原街道', 4, 2856), +(25818, '团山镇', 4, 2856), +(25819, '太平店镇', 4, 2856), +(25820, '定中门街道', 4, 2856), +(25821, '屏襄门街道', 4, 2856), +(25822, '柿铺街道', 4, 2856), +(25823, '汉江街道', 4, 2856), +(25824, '清河口街道', 4, 2856), +(25825, '牛首镇', 4, 2856), +(25826, '王寨街道', 4, 2856), +(25827, '米公街道', 4, 2856), +(25828, '紫贞街道', 4, 2856), +(25829, '仙人渡', 4, 2857), +(25830, '光化', 4, 2857), +(25831, '孟楼', 4, 2857), +(25832, '张集', 4, 2857), +(25833, '李楼', 4, 2857), +(25834, '洪山嘴', 4, 2857), +(25835, '竹林桥', 4, 2857), +(25836, '薛集', 4, 2857), +(25837, '袁冲', 4, 2857), +(25838, '酂阳', 4, 2857), +(25839, '卧龙镇', 4, 2858), +(25840, '尹集乡', 4, 2858), +(25841, '庞公街道', 4, 2858), +(25842, '昭明街道', 4, 2858), +(25843, '檀溪街道', 4, 2858); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25844, '欧庙镇', 4, 2858), +(25845, '王府街道', 4, 2858), +(25846, '隆中街道', 4, 2858), +(25847, '东津镇', 4, 2859), +(25848, '伙牌镇', 4, 2859), +(25849, '双沟镇', 4, 2859), +(25850, '古驿镇', 4, 2859), +(25851, '峪山镇', 4, 2859), +(25852, '张家集镇', 4, 2859), +(25853, '张湾镇', 4, 2859), +(25854, '朱集镇', 4, 2859), +(25855, '石桥镇', 4, 2859), +(25856, '程河镇', 4, 2859), +(25857, '米庄镇', 4, 2859), +(25858, '黄集镇', 4, 2859), +(25859, '黄龙镇', 4, 2859), +(25860, '龙王镇', 4, 2859), +(25861, '五山镇', 4, 2860), +(25862, '冷集镇', 4, 2860), +(25863, '南河镇', 4, 2860), +(25864, '城关镇', 4, 2860), +(25865, '庙滩镇', 4, 2860), +(25866, '盛(土康)镇', 4, 2860), +(25867, '石花镇', 4, 2860), +(25868, '紫金镇', 4, 2860), +(25869, '茨河镇', 4, 2860), +(25870, '赵湾乡', 4, 2860), +(25871, '临江乡', 4, 2861), +(25872, '华容镇', 4, 2861), +(25873, '庙岭镇', 4, 2861), +(25874, '段店镇', 4, 2861), +(25875, '蒲团乡', 4, 2861), +(25876, '东沟镇', 4, 2862), +(25877, '太和镇', 4, 2862), +(25878, '沼山镇', 4, 2862), +(25879, '涂家垴镇', 4, 2862), +(25880, '凤凰街道', 4, 2863), +(25881, '古楼街道', 4, 2863), +(25882, '新庙镇', 4, 2863), +(25883, '杜山镇', 4, 2863), +(25884, '杨叶镇', 4, 2863), +(25885, '樊口街道', 4, 2863), +(25886, '汀祖镇', 4, 2863), +(25887, '沙窝乡', 4, 2863), +(25888, '泽林镇', 4, 2863), +(25889, '燕矶镇', 4, 2863), +(25890, '碧石渡镇', 4, 2863), +(25891, '花湖镇', 4, 2863), +(25892, '西山街道', 4, 2863), +(25893, '长港镇', 4, 2863), +(25894, '仙居乡', 4, 2864), +(25895, '子陵镇', 4, 2864), +(25896, '栗溪镇', 4, 2864), +(25897, '泉口街道', 4, 2864), +(25898, '漳河镇', 4, 2864), +(25899, '牌楼镇', 4, 2864), +(25900, '石桥驿镇', 4, 2864), +(25901, '马河镇', 4, 2864), +(25902, '龙泉街道', 4, 2864), +(25903, '三阳镇', 4, 2865), +(25904, '坪坝镇', 4, 2865), +(25905, '孙桥镇', 4, 2865), +(25906, '宋河镇', 4, 2865), +(25907, '新市镇', 4, 2865); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25908, '曹武镇', 4, 2865), +(25909, '杨集镇', 4, 2865), +(25910, '永兴镇', 4, 2865), +(25911, '永漋镇', 4, 2865), +(25912, '石龙镇', 4, 2865), +(25913, '绿林镇', 4, 2865), +(25914, '罗店镇', 4, 2865), +(25915, '钱场镇', 4, 2865), +(25916, '雁门口镇', 4, 2865), +(25917, '团林铺镇', 4, 2866), +(25918, '掇刀石街道', 4, 2866), +(25919, '白庙街道', 4, 2866), +(25920, '麻城镇', 4, 2866), +(25921, '五里铺镇', 4, 2867), +(25922, '十里铺镇', 4, 2867), +(25923, '后港镇', 4, 2867), +(25924, '官当镇', 4, 2867), +(25925, '拾回桥镇', 4, 2867), +(25926, '曾集镇', 4, 2867), +(25927, '李市镇', 4, 2867), +(25928, '毛李镇', 4, 2867), +(25929, '沈集镇', 4, 2867), +(25930, '沙洋镇', 4, 2867), +(25931, '纪山镇', 4, 2867), +(25932, '马良镇', 4, 2867), +(25933, '高阳镇', 4, 2867), +(25934, '东桥镇', 4, 2868), +(25935, '丰乐镇', 4, 2868), +(25936, '九里回族乡', 4, 2868), +(25937, '冷水镇', 4, 2868), +(25938, '双河镇', 4, 2868), +(25939, '客店镇', 4, 2868), +(25940, '张集镇', 4, 2868), +(25941, '文集镇', 4, 2868), +(25942, '旧口镇', 4, 2868), +(25943, '柴湖镇', 4, 2868), +(25944, '洋梓镇', 4, 2868), +(25945, '石牌镇', 4, 2868), +(25946, '磷矿镇', 4, 2868), +(25947, '胡集镇', 4, 2868), +(25948, '郢中街道', 4, 2868), +(25949, '长寿镇', 4, 2868), +(25950, '长滩镇', 4, 2868), +(25951, '下辛店镇', 4, 2869), +(25952, '义堂镇', 4, 2869), +(25953, '伍洛镇', 4, 2869), +(25954, '倒店乡', 4, 2869), +(25955, '吴铺镇', 4, 2869), +(25956, '城关镇', 4, 2869), +(25957, '曾店镇', 4, 2869), +(25958, '沙河乡', 4, 2869), +(25959, '清明河乡', 4, 2869), +(25960, '胡金店镇', 4, 2869), +(25961, '道桥镇', 4, 2869), +(25962, '隔蒲潭镇', 4, 2869), +(25963, '三里镇', 4, 2870), +(25964, '东新乡', 4, 2870), +(25965, '丰店镇', 4, 2870), +(25966, '刘集镇', 4, 2870), +(25967, '吕王镇', 4, 2870), +(25968, '四姑镇', 4, 2870), +(25969, '城关镇', 4, 2870), +(25970, '夏店镇', 4, 2870), +(25971, '大新镇', 4, 2870); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(25972, '宣化店镇', 4, 2870), +(25973, '彭店乡', 4, 2870), +(25974, '新城镇', 4, 2870), +(25975, '河口镇', 4, 2870), +(25976, '芳畈镇', 4, 2870), +(25977, '阳平镇', 4, 2870), +(25978, '高店乡', 4, 2870), +(25979, '黄站镇', 4, 2870), +(25980, '三汊镇', 4, 2871), +(25981, '书院街道', 4, 2871), +(25982, '卧龙乡', 4, 2871), +(25983, '广场街道', 4, 2871), +(25984, '新华街道', 4, 2871), +(25985, '新铺镇', 4, 2871), +(25986, '朋兴乡', 4, 2871), +(25987, '杨店镇', 4, 2871), +(25988, '毛陈镇', 4, 2871), +(25989, '祝站镇', 4, 2871), +(25990, '肖港镇', 4, 2871), +(25991, '西河镇', 4, 2871), +(25992, '车站街道', 4, 2871), +(25993, '闵集乡', 4, 2871), +(25994, '陡岗镇', 4, 2871), +(25995, '丰山', 4, 2872), +(25996, '卫店', 4, 2872), +(25997, '周巷', 4, 2872), +(25998, '季店', 4, 2872), +(25999, '小悟', 4, 2872), +(26000, '小河', 4, 2872), +(26001, '王店', 4, 2872), +(26002, '白沙', 4, 2872), +(26003, '花园', 4, 2872), +(26004, '花西', 4, 2872), +(26005, '邹岗', 4, 2872), +(26006, '陡山', 4, 2872), +(26007, '南城街道', 4, 2873), +(26008, '孛畈镇', 4, 2873), +(26009, '巡店镇', 4, 2873), +(26010, '府城街道', 4, 2873), +(26011, '接官乡', 4, 2873), +(26012, '木梓乡', 4, 2873), +(26013, '李店镇', 4, 2873), +(26014, '棠棣镇', 4, 2873), +(26015, '洑水镇', 4, 2873), +(26016, '烟店镇', 4, 2873), +(26017, '王义贞镇', 4, 2873), +(26018, '赵棚镇', 4, 2873), +(26019, '辛榨乡', 4, 2873), +(26020, '陈店乡', 4, 2873), +(26021, '雷公镇', 4, 2873), +(26022, '三合镇', 4, 2874), +(26023, '东马坊街道', 4, 2874), +(26024, '义和镇', 4, 2874), +(26025, '四里棚街道', 4, 2874), +(26026, '城中街道', 4, 2874), +(26027, '城北街道', 4, 2874), +(26028, '天鹅镇', 4, 2874), +(26029, '杨岭镇', 4, 2874), +(26030, '杨河镇。', 4, 2874), +(26031, '汤池镇', 4, 2874), +(26032, '田店镇', 4, 2874), +(26033, '郎君镇', 4, 2874), +(26034, '长江埠街道', 4, 2874), +(26035, '陈河镇', 4, 2874), +(26036, '黄滩镇', 4, 2874); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26037, '仙女山街道', 4, 2875), +(26038, '分水镇', 4, 2875), +(26039, '刘家隔镇', 4, 2875), +(26040, '南河乡', 4, 2875), +(26041, '回龙镇', 4, 2875), +(26042, '垌冢镇', 4, 2875), +(26043, '城隍镇', 4, 2875), +(26044, '庙头镇', 4, 2875), +(26045, '新堰镇', 4, 2875), +(26046, '新河镇', 4, 2875), +(26047, '杨林沟镇', 4, 2875), +(26048, '沉湖镇', 4, 2875), +(26049, '湾潭乡', 4, 2875), +(26050, '田二河镇', 4, 2875), +(26051, '脉旺镇', 4, 2875), +(26052, '西江乡', 4, 2875), +(26053, '里潭乡', 4, 2875), +(26054, '韩集乡', 4, 2875), +(26055, '马口镇', 4, 2875), +(26056, '马鞍乡', 4, 2875), +(26057, '麻河镇', 4, 2875), +(26058, '南平镇', 4, 2876), +(26059, '埠河镇', 4, 2876), +(26060, '夹竹园镇', 4, 2876), +(26061, '孟家溪镇', 4, 2876), +(26062, '斑竹垱镇', 4, 2876), +(26063, '斗湖堤镇', 4, 2876), +(26064, '杨家厂镇', 4, 2876), +(26065, '毛家港镇', 4, 2876), +(26066, '甘家厂乡', 4, 2876), +(26067, '章庄铺镇', 4, 2876), +(26068, '章田寺乡', 4, 2876), +(26069, '藕池镇', 4, 2876), +(26070, '闸口镇', 4, 2876), +(26071, '麻豪口镇', 4, 2876), +(26072, '黄山头镇', 4, 2876), +(26073, '万家乡', 4, 2877), +(26074, '八宝镇', 4, 2877), +(26075, '刘家场镇', 4, 2877), +(26076, '南海镇', 4, 2877), +(26077, '卸甲坪土家族乡', 4, 2877), +(26078, '斯家场镇', 4, 2877), +(26079, '新江口镇', 4, 2877), +(26080, '杨林市镇', 4, 2877), +(26081, '沙道观镇', 4, 2877), +(26082, '洈水镇', 4, 2877), +(26083, '涴市镇', 4, 2877), +(26084, '王家桥镇', 4, 2877), +(26085, '纸厂河镇', 4, 2877), +(26086, '老城镇', 4, 2877), +(26087, '街河市镇', 4, 2877), +(26088, '陈店镇', 4, 2877), +(26089, '普济', 4, 2878), +(26090, '沙岗', 4, 2878), +(26091, '滩桥', 4, 2878), +(26092, '熊河', 4, 2878), +(26093, '白马寺', 4, 2878), +(26094, '秦市', 4, 2878), +(26095, '资市', 4, 2878), +(26096, '郝穴', 4, 2878), +(26097, '马家寨', 4, 2878), +(26098, '中山路街道', 4, 2879), +(26099, '关沮乡', 4, 2879), +(26100, '岑河镇', 4, 2879); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26101, '崇文街街道', 4, 2879), +(26102, '朝阳路街道', 4, 2879), +(26103, '沙市农场', 4, 2879), +(26104, '立新乡', 4, 2879), +(26105, '联合乡', 4, 2879), +(26106, '胜利街街道', 4, 2879), +(26107, '西湖原种场', 4, 2879), +(26108, '观音垱镇', 4, 2879), +(26109, '解放路街道', 4, 2879), +(26110, '锣场镇', 4, 2879), +(26111, '万全镇', 4, 2880), +(26112, '乌林镇', 4, 2880), +(26113, '大沙管理区', 4, 2880), +(26114, '峰口镇', 4, 2880), +(26115, '府场镇', 4, 2880), +(26116, '戴家场镇', 4, 2880), +(26117, '新堤街道', 4, 2880), +(26118, '新滩镇', 4, 2880), +(26119, '曹市镇', 4, 2880), +(26120, '汊河镇', 4, 2880), +(26121, '沙口镇', 4, 2880), +(26122, '滨湖街道', 4, 2880), +(26123, '燕窝镇', 4, 2880), +(26124, '瞿家湾镇', 4, 2880), +(26125, '老湾回族乡', 4, 2880), +(26126, '螺山镇', 4, 2880), +(26127, '黄家口镇', 4, 2880), +(26128, '龙口镇', 4, 2880), +(26129, '三洲镇', 4, 2881), +(26130, '上车湾镇', 4, 2881), +(26131, '分盐镇', 4, 2881), +(26132, '周老嘴镇', 4, 2881), +(26133, '容城镇', 4, 2881), +(26134, '尺八镇', 4, 2881), +(26135, '新沟镇', 4, 2881), +(26136, '朱河镇', 4, 2881), +(26137, '柘木乡', 4, 2881), +(26138, '桥市镇', 4, 2881), +(26139, '棋盘乡', 4, 2881), +(26140, '毛市镇', 4, 2881), +(26141, '汪桥镇', 4, 2881), +(26142, '汴河镇', 4, 2881), +(26143, '白螺镇', 4, 2881), +(26144, '福田寺镇', 4, 2881), +(26145, '程集镇', 4, 2881), +(26146, '红城乡', 4, 2881), +(26147, '网市镇', 4, 2881), +(26148, '黄歇口镇', 4, 2881), +(26149, '龚场镇', 4, 2881), +(26150, '东升镇', 4, 2882), +(26151, '久合垸乡', 4, 2882), +(26152, '南口镇', 4, 2882), +(26153, '团山寺镇', 4, 2882), +(26154, '大垸镇', 4, 2882), +(26155, '小河口镇', 4, 2882), +(26156, '新厂镇', 4, 2882), +(26157, '桃花山镇', 4, 2882), +(26158, '横沟市镇', 4, 2882), +(26159, '笔架山街道', 4, 2882), +(26160, '绣林街道', 4, 2882), +(26161, '调关镇', 4, 2882), +(26162, '高基庙镇', 4, 2882); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26163, '高陵镇', 4, 2882), +(26164, '东城街道', 4, 2883), +(26165, '八岭山镇', 4, 2883), +(26166, '城南街道', 4, 2883), +(26167, '川店镇', 4, 2883), +(26168, '弥市镇', 4, 2883), +(26169, '李埠镇', 4, 2883), +(26170, '纪南镇', 4, 2883), +(26171, '西城街道', 4, 2883), +(26172, '郢城镇', 4, 2883), +(26173, '马山镇', 4, 2883), +(26174, '上巴河镇', 4, 2884), +(26175, '但店镇', 4, 2884), +(26176, '刘佐乡', 4, 2884), +(26177, '回龙山镇', 4, 2884), +(26178, '团风镇', 4, 2884), +(26179, '总路嘴镇', 4, 2884), +(26180, '方高坪镇', 4, 2884), +(26181, '杜皮乡', 4, 2884), +(26182, '淋山河镇', 4, 2884), +(26183, '贾庙乡', 4, 2884), +(26184, '马曹庙镇', 4, 2884), +(26185, '万文湖街道', 4, 2885), +(26186, '余川镇', 4, 2885), +(26187, '刊江街道', 4, 2885), +(26188, '四望镇', 4, 2885), +(26189, '大法寺镇', 4, 2885), +(26190, '大金镇', 4, 2885), +(26191, '梅川镇', 4, 2885), +(26192, '武穴街道', 4, 2885), +(26193, '田镇街道', 4, 2885), +(26194, '石佛寺镇', 4, 2885), +(26195, '花桥镇', 4, 2885), +(26196, '龙坪镇', 4, 2885), +(26197, '丁司垱镇', 4, 2886), +(26198, '兰溪镇', 4, 2886), +(26199, '关口镇', 4, 2886), +(26200, '团陂镇', 4, 2886), +(26201, '巴河镇', 4, 2886), +(26202, '散花镇', 4, 2886), +(26203, '汪岗镇', 4, 2886), +(26204, '洗马镇', 4, 2886), +(26205, '清泉镇', 4, 2886), +(26206, '白莲镇', 4, 2886), +(26207, '竹瓦镇', 4, 2886), +(26208, '绿杨乡', 4, 2886), +(26209, '蔡河镇', 4, 2886), +(26210, '七里坪镇', 4, 2887), +(26211, '上新集镇', 4, 2887), +(26212, '二程镇', 4, 2887), +(26213, '八里湾镇', 4, 2887), +(26214, '华家河镇', 4, 2887), +(26215, '城关镇', 4, 2887), +(26216, '太平桥镇', 4, 2887), +(26217, '杏花乡', 4, 2887), +(26218, '永佳河镇', 4, 2887), +(26219, '觅儿寺镇', 4, 2887), +(26220, '高桥镇', 4, 2887), +(26221, '三里畈镇', 4, 2888), +(26222, '九资河镇', 4, 2888), +(26223, '凤山镇', 4, 2888), +(26224, '匡河乡', 4, 2888), +(26225, '千基坪林场', 4, 2888); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26226, '大崎乡', 4, 2888), +(26227, '大河岸镇', 4, 2888), +(26228, '平湖乡', 4, 2888), +(26229, '河铺镇', 4, 2888), +(26230, '白庙河乡', 4, 2888), +(26231, '白莲河乡', 4, 2888), +(26232, '胜利镇', 4, 2888), +(26233, '薄刀峰林场', 4, 2888), +(26234, '青苔关林场', 4, 2888), +(26235, '骆驼坳镇', 4, 2888), +(26236, '黄狮寨林场', 4, 2888), +(26237, '南河镇', 4, 2889), +(26238, '孔家坊乡', 4, 2889), +(26239, '方家嘴乡', 4, 2889), +(26240, '杨柳湾镇', 4, 2889), +(26241, '温泉镇', 4, 2889), +(26242, '石头嘴镇', 4, 2889), +(26243, '红山镇', 4, 2889), +(26244, '草盘地镇', 4, 2889), +(26245, '金家铺镇', 4, 2889), +(26246, '陶家河乡', 4, 2889), +(26247, '雷家店镇', 4, 2889), +(26248, '刘河镇', 4, 2890), +(26249, '向桥乡', 4, 2890), +(26250, '大同镇', 4, 2890), +(26251, '张塝镇', 4, 2890), +(26252, '彭思镇', 4, 2890), +(26253, '株林镇', 4, 2890), +(26254, '横车镇', 4, 2890), +(26255, '檀林镇', 4, 2890), +(26256, '漕河镇', 4, 2890), +(26257, '狮子镇', 4, 2890), +(26258, '管窑镇', 4, 2890), +(26259, '蕲州镇', 4, 2890), +(26260, '赤东镇', 4, 2890), +(26261, '青石镇', 4, 2890), +(26262, '三河口镇', 4, 2891), +(26263, '中馆驿镇', 4, 2891), +(26264, '乘马岗镇', 4, 2891), +(26265, '南湖街道', 4, 2891), +(26266, '夫子河镇', 4, 2891), +(26267, '宋埠镇', 4, 2891), +(26268, '张家畈镇', 4, 2891), +(26269, '木子店镇', 4, 2891), +(26270, '歧亭镇', 4, 2891), +(26271, '白果镇', 4, 2891), +(26272, '盐田河镇', 4, 2891), +(26273, '福田河镇', 4, 2891), +(26274, '铁门岗乡', 4, 2891), +(26275, '阎家河镇', 4, 2891), +(26276, '顺河集镇', 4, 2891), +(26277, '黄土岗镇', 4, 2891), +(26278, '鼓楼街道', 4, 2891), +(26279, '龙池桥街道', 4, 2891), +(26280, '龟山乡', 4, 2891), +(26281, '东湖街道', 4, 2892), +(26282, '南湖街道', 4, 2892), +(26283, '堵城镇', 4, 2892), +(26284, '禹王街道', 4, 2892), +(26285, '赤壁街道', 4, 2892), +(26286, '路口镇', 4, 2892), +(26287, '陈策楼镇', 4, 2892); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26288, '陶店乡', 4, 2892), +(26289, '下新镇', 4, 2893), +(26290, '五祖镇', 4, 2893), +(26291, '停前镇', 4, 2893), +(26292, '分路镇', 4, 2893), +(26293, '大河镇', 4, 2893), +(26294, '孔垄镇', 4, 2893), +(26295, '小池镇', 4, 2893), +(26296, '新开镇', 4, 2893), +(26297, '杉木乡', 4, 2893), +(26298, '柳林乡', 4, 2893), +(26299, '濯港镇', 4, 2893), +(26300, '独山镇', 4, 2893), +(26301, '苦竹乡', 4, 2893), +(26302, '蔡山镇', 4, 2893), +(26303, '黄梅镇', 4, 2893), +(26304, '双溪桥镇', 4, 2894), +(26305, '向阳湖镇', 4, 2894), +(26306, '大幕乡', 4, 2894), +(26307, '官埠桥镇', 4, 2894), +(26308, '桂花镇', 4, 2894), +(26309, '横沟桥镇', 4, 2894), +(26310, '永安街道', 4, 2894), +(26311, '汀泗桥镇', 4, 2894), +(26312, '浮山街道', 4, 2894), +(26313, '温泉街道', 4, 2894), +(26314, '贺胜桥镇', 4, 2894), +(26315, '马桥镇', 4, 2894), +(26316, '高桥镇', 4, 2894), +(26317, '官桥镇', 4, 2895), +(26318, '新街镇', 4, 2895), +(26319, '渡普镇', 4, 2895), +(26320, '潘家湾镇', 4, 2895), +(26321, '箄洲湾镇', 4, 2895), +(26322, '陆溪镇', 4, 2895), +(26323, '高铁岭镇', 4, 2895), +(26324, '鱼岳镇', 4, 2895), +(26325, '天城镇', 4, 2896), +(26326, '桂花泉镇', 4, 2896), +(26327, '沙坪镇', 4, 2896), +(26328, '港口乡', 4, 2896), +(26329, '白霓镇', 4, 2896), +(26330, '石城镇', 4, 2896), +(26331, '肖岭乡', 4, 2896), +(26332, '路口镇', 4, 2896), +(26333, '金塘镇', 4, 2896), +(26334, '铜钟乡', 4, 2896), +(26335, '青山镇', 4, 2896), +(26336, '高枧乡', 4, 2896), +(26337, '中伙铺镇', 4, 2897), +(26338, '官塘林场', 4, 2897), +(26339, '官塘驿镇', 4, 2897), +(26340, '新店镇', 4, 2897), +(26341, '柳山湖镇', 4, 2897), +(26342, '沧湖开发区', 4, 2897), +(26343, '洪山开发区', 4, 2897), +(26344, '茶庵岭镇', 4, 2897), +(26345, '蒲圻街道', 4, 2897), +(26346, '赤壁镇', 4, 2897), +(26347, '赤马港街道', 4, 2897), +(26348, '赵李桥镇', 4, 2897), +(26349, '车埠镇', 4, 2897), +(26350, '陆水湖街道', 4, 2897); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26351, '五里镇', 4, 2898), +(26352, '关刀镇', 4, 2898), +(26353, '北港镇', 4, 2898), +(26354, '四庄乡', 4, 2898), +(26355, '塘湖镇', 4, 2898), +(26356, '大坪乡', 4, 2898), +(26357, '沙堆镇', 4, 2898), +(26358, '石南镇', 4, 2898), +(26359, '隽水镇', 4, 2898), +(26360, '马港镇', 4, 2898), +(26361, '麦市镇', 4, 2898), +(26362, '九宫山镇', 4, 2899), +(26363, '南林桥镇', 4, 2899), +(26364, '厦铺镇', 4, 2899), +(26365, '大畈镇', 4, 2899), +(26366, '大路乡', 4, 2899), +(26367, '慈口乡', 4, 2899), +(26368, '杨芳林乡', 4, 2899), +(26369, '洪港镇', 4, 2899), +(26370, '燕夏乡', 4, 2899), +(26371, '通羊镇', 4, 2899), +(26372, '闯王镇', 4, 2899), +(26373, '黄沙铺镇', 4, 2899), +(26374, '余店镇', 4, 2900), +(26375, '关庙镇', 4, 2900), +(26376, '十里街道', 4, 2900), +(26377, '吴店镇', 4, 2900), +(26378, '城郊乡', 4, 2900), +(26379, '太平乡', 4, 2900), +(26380, '广水街道', 4, 2900), +(26381, '应山街道', 4, 2900), +(26382, '杨寨镇', 4, 2900), +(26383, '武胜关镇', 4, 2900), +(26384, '郝店镇', 4, 2900), +(26385, '长岭镇', 4, 2900), +(26386, '陈巷镇', 4, 2900), +(26387, '马坪镇', 4, 2900), +(26388, '骆店乡', 4, 2900), +(26389, '万和镇', 4, 2901), +(26390, '万店镇', 4, 2901), +(26391, '万福店农场', 4, 2901), +(26392, '三里岗镇', 4, 2901), +(26393, '东城街道', 4, 2901), +(26394, '何店镇', 4, 2901), +(26395, '北郊街道', 4, 2901), +(26396, '南郊街道', 4, 2901), +(26397, '厉山镇', 4, 2901), +(26398, '吴山镇', 4, 2901), +(26399, '唐县镇', 4, 2901), +(26400, '均川镇', 4, 2901), +(26401, '安居镇', 4, 2901), +(26402, '小林镇', 4, 2901), +(26403, '尚市镇', 4, 2901), +(26404, '府河镇', 4, 2901), +(26405, '新街镇', 4, 2901), +(26406, '柳林镇', 4, 2901), +(26407, '殷店镇', 4, 2901), +(26408, '洛阳镇', 4, 2901), +(26409, '洪山镇', 4, 2901), +(26410, '淅河镇', 4, 2901), +(26411, '淮河镇', 4, 2901), +(26412, '澴潭镇', 4, 2901), +(26413, '草店镇', 4, 2901), +(26414, '西城街道', 4, 2901); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26415, '长岗镇', 4, 2901), +(26416, '高城镇', 4, 2901), +(26417, '东城街道', 4, 2902), +(26418, '元堡乡', 4, 2902), +(26419, '凉雾乡', 4, 2902), +(26420, '南坪乡', 4, 2902), +(26421, '团堡镇', 4, 2902), +(26422, '建南镇', 4, 2902), +(26423, '忠路镇', 4, 2902), +(26424, '文斗乡', 4, 2902), +(26425, '柏杨坝镇', 4, 2902), +(26426, '毛坝乡', 4, 2902), +(26427, '汪营镇', 4, 2902), +(26428, '沙溪乡', 4, 2902), +(26429, '谋道镇', 4, 2902), +(26430, '都亭街道', 4, 2902), +(26431, '丁寨乡', 4, 2903), +(26432, '小村乡', 4, 2903), +(26433, '尖山乡', 4, 2903), +(26434, '忠堡镇', 4, 2903), +(26435, '朝阳寺镇', 4, 2903), +(26436, '活龙坪乡', 4, 2903), +(26437, '清坪镇', 4, 2903), +(26438, '甲马池镇', 4, 2903), +(26439, '高乐山镇', 4, 2903), +(26440, '黄金洞乡', 4, 2903), +(26441, '万寨乡', 4, 2904), +(26442, '晓关侗族乡', 4, 2904), +(26443, '李家河乡', 4, 2904), +(26444, '椒园镇', 4, 2904), +(26445, '椿木营乡', 4, 2904), +(26446, '沙道沟镇', 4, 2904), +(26447, '珠山镇', 4, 2904), +(26448, '长潭河侗族乡', 4, 2904), +(26449, '高罗乡', 4, 2904), +(26450, '东瀼口镇', 4, 2905), +(26451, '信陵镇', 4, 2905), +(26452, '大支坪镇', 4, 2905), +(26453, '官渡河镇', 4, 2905), +(26454, '水布垭镇', 4, 2905), +(26455, '沿渡河镇', 4, 2905), +(26456, '清太坪镇', 4, 2905), +(26457, '溪丘湾乡', 4, 2905), +(26458, '绿葱坡镇', 4, 2905), +(26459, '茶店子镇', 4, 2905), +(26460, '野三关镇', 4, 2905), +(26461, '金果坪乡', 4, 2905), +(26462, '三里乡', 4, 2906), +(26463, '业州镇', 4, 2906), +(26464, '官店镇', 4, 2906), +(26465, '景阳镇', 4, 2906), +(26466, '红岩寺镇', 4, 2906), +(26467, '花坪乡', 4, 2906), +(26468, '茅田乡', 4, 2906), +(26469, '长梁乡', 4, 2906), +(26470, '高坪镇', 4, 2906), +(26471, '龙坪乡', 4, 2906), +(26472, '三岔乡', 4, 2907), +(26473, '六角亭街道', 4, 2907), +(26474, '太阳河乡', 4, 2907), +(26475, '小渡船街道', 4, 2907), +(26476, '屯堡乡', 4, 2907); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26477, '崔家坝镇', 4, 2907), +(26478, '新塘乡', 4, 2907), +(26479, '板桥镇', 4, 2907), +(26480, '沙地乡', 4, 2907), +(26481, '白杨坪乡', 4, 2907), +(26482, '白果乡', 4, 2907), +(26483, '盛家坝乡', 4, 2907), +(26484, '红土乡', 4, 2907), +(26485, '舞阳坝街道', 4, 2907), +(26486, '芭蕉侗族乡', 4, 2907), +(26487, '龙凤镇', 4, 2907), +(26488, '三胡乡', 4, 2908), +(26489, '大河镇', 4, 2908), +(26490, '旧司乡', 4, 2908), +(26491, '百福司镇', 4, 2908), +(26492, '绿水乡', 4, 2908), +(26493, '翔凤镇', 4, 2908), +(26494, '革勒车乡', 4, 2908), +(26495, '下坪乡', 4, 2909), +(26496, '中营乡', 4, 2909), +(26497, '五里乡', 4, 2909), +(26498, '太平乡', 4, 2909), +(26499, '容美镇', 4, 2909), +(26500, '燕子乡', 4, 2909), +(26501, '走马镇', 4, 2909), +(26502, '邬阳乡', 4, 2909), +(26503, '铁炉乡', 4, 2909), +(26504, '三伏潭镇', 4, 2910), +(26505, '剅河镇', 4, 2910), +(26506, '干河街道', 4, 2910), +(26507, '张沟镇', 4, 2910), +(26508, '彭场镇', 4, 2910), +(26509, '杨林尾镇', 4, 2910), +(26510, '毛嘴镇', 4, 2910), +(26511, '沔城回族镇', 4, 2910), +(26512, '沙嘴街道办', 4, 2910), +(26513, '沙湖镇', 4, 2910), +(26514, '胡场镇', 4, 2910), +(26515, '西流河镇', 4, 2910), +(26516, '通海口镇', 4, 2910), +(26517, '郑场镇', 4, 2910), +(26518, '郭河镇', 4, 2910), +(26519, '长埫口镇', 4, 2910), +(26520, '陈场镇', 4, 2910), +(26521, '龙华山街道', 4, 2910), +(26522, '周矶街道', 4, 2911), +(26523, '园林街道', 4, 2911), +(26524, '广华街道', 4, 2911), +(26525, '张金镇', 4, 2911), +(26526, '杨市街道', 4, 2911), +(26527, '泽口街道', 4, 2911), +(26528, '浩口镇', 4, 2911), +(26529, '渔洋镇', 4, 2911), +(26530, '熊口镇', 4, 2911), +(26531, '王场镇', 4, 2911), +(26532, '积玉口镇', 4, 2911), +(26533, '竹根滩镇', 4, 2911), +(26534, '老新镇', 4, 2911), +(26535, '高石碑镇', 4, 2911), +(26536, '龙湾镇', 4, 2911), +(26537, '九真镇', 4, 2912), +(26538, '佛子山镇', 4, 2912), +(26539, '候口街道', 4, 2912); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26540, '净潭乡', 4, 2912), +(26541, '卢市镇', 4, 2912), +(26542, '多宝镇', 4, 2912), +(26543, '多祥镇', 4, 2912), +(26544, '小板镇', 4, 2912), +(26545, '岳口街道', 4, 2912), +(26546, '干驿镇', 4, 2912), +(26547, '张港镇', 4, 2912), +(26548, '彭市镇', 4, 2912), +(26549, '拖市镇', 4, 2912), +(26550, '杨林街道', 4, 2912), +(26551, '横林镇', 4, 2912), +(26552, '汪场镇', 4, 2912), +(26553, '渔薪镇', 4, 2912), +(26554, '皂市镇', 4, 2912), +(26555, '石河镇', 4, 2912), +(26556, '竟陵街道', 4, 2912), +(26557, '胡市镇', 4, 2912), +(26558, '蒋场镇', 4, 2912), +(26559, '马湾镇', 4, 2912), +(26560, '麻洋镇', 4, 2912), +(26561, '黄潭镇', 4, 2912), +(26562, '下谷平土家族乡', 4, 2913), +(26563, '九湖乡', 4, 2913), +(26564, '宋洛乡', 4, 2913), +(26565, '新华乡', 4, 2913), +(26566, '木鱼镇', 4, 2913), +(26567, '松柏镇', 4, 2913), +(26568, '红坪镇', 4, 2913), +(26569, '阳日镇', 4, 2913), +(26570, '书院路街道', 4, 2914), +(26571, '坡子街街道', 4, 2914), +(26572, '城南路街道', 4, 2914), +(26573, '大托镇', 4, 2914), +(26574, '学院街街道', 4, 2914), +(26575, '开铺街道', 4, 2914), +(26576, '桂花坪街道', 4, 2914), +(26577, '裕南街街道', 4, 2914), +(26578, '金盆岭街道', 4, 2914), +(26579, '青园街道', 4, 2914), +(26580, '东湖塘镇', 4, 2915), +(26581, '偕乐桥镇', 4, 2915), +(26582, '全民乡', 4, 2915), +(26583, '南田坪乡', 4, 2915), +(26584, '历经铺乡', 4, 2915), +(26585, '双凫铺镇', 4, 2915), +(26586, '双江口镇', 4, 2915), +(26587, '喻家坳乡', 4, 2915), +(26588, '回龙铺镇', 4, 2915), +(26589, '坝塘镇', 4, 2915), +(26590, '城郊乡', 4, 2915), +(26591, '夏铎铺镇', 4, 2915), +(26592, '大屯营乡', 4, 2915), +(26593, '大成桥乡', 4, 2915), +(26594, '巷子口镇', 4, 2915), +(26595, '朱良桥乡', 4, 2915), +(26596, '枫木桥乡', 4, 2915), +(26597, '横市镇', 4, 2915), +(26598, '沙田乡', 4, 2915), +(26599, '沩山乡', 4, 2915), +(26600, '流沙河镇', 4, 2915), +(26601, '灰汤镇', 4, 2915); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26602, '煤炭坝镇', 4, 2915), +(26603, '玉潭镇', 4, 2915), +(26604, '白马桥乡', 4, 2915), +(26605, '老粮仓镇', 4, 2915), +(26606, '花明楼镇', 4, 2915), +(26607, '菁华铺乡', 4, 2915), +(26608, '资福乡', 4, 2915), +(26609, '道林镇', 4, 2915), +(26610, '青山桥乡', 4, 2915), +(26611, '黄材镇', 4, 2915), +(26612, '龙田镇', 4, 2915), +(26613, '东方红镇', 4, 2916), +(26614, '咸嘉湖街道', 4, 2916), +(26615, '天顶乡', 4, 2916), +(26616, '岳麓街道', 4, 2916), +(26617, '望城坡街道', 4, 2916), +(26618, '望岳街道', 4, 2916), +(26619, '望月湖街道', 4, 2916), +(26620, '桔子洲街道', 4, 2916), +(26621, '西湖街道', 4, 2916), +(26622, '观沙岭街道', 4, 2916), +(26623, '银盆岭街道', 4, 2916), +(26624, '东风路街道', 4, 2917), +(26625, '伍家岭街道', 4, 2917), +(26626, '四方坪街道', 4, 2917), +(26627, '捞刀河镇', 4, 2917), +(26628, '新河街道', 4, 2917), +(26629, '新港镇', 4, 2917), +(26630, '望麓园街道', 4, 2917), +(26631, '洪山街道', 4, 2917), +(26632, '清水塘街道', 4, 2917), +(26633, '湘雅路街道', 4, 2917), +(26634, '芙蓉北路街道', 4, 2917), +(26635, '通泰街街道', 4, 2917), +(26636, '青竹湖镇', 4, 2917), +(26637, '丁字镇', 4, 2918), +(26638, '东城镇', 4, 2918), +(26639, '乌山镇', 4, 2918), +(26640, '乔口镇', 4, 2918), +(26641, '含浦镇', 4, 2918), +(26642, '坪塘镇', 4, 2918), +(26643, '新康乡', 4, 2918), +(26644, '星城镇', 4, 2918), +(26645, '格塘乡', 4, 2918), +(26646, '桥驿镇', 4, 2918), +(26647, '白箬铺镇', 4, 2918), +(26648, '茶亭镇', 4, 2918), +(26649, '莲花镇', 4, 2918), +(26650, '铜官镇', 4, 2918), +(26651, '雨敞坪镇', 4, 2918), +(26652, '雷锋镇', 4, 2918), +(26653, '靖港镇', 4, 2918), +(26654, '高塘岭镇', 4, 2918), +(26655, '黄金乡', 4, 2918), +(26656, '七宝山乡', 4, 2919), +(26657, '三口乡', 4, 2919), +(26658, '中和镇', 4, 2919), +(26659, '关口街道', 4, 2919), +(26660, '北盛镇', 4, 2919), +(26661, '古港镇', 4, 2919), +(26662, '大围山镇', 4, 2919); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26663, '大瑶镇', 4, 2919), +(26664, '太平桥镇', 4, 2919), +(26665, '官桥乡', 4, 2919), +(26666, '官渡镇', 4, 2919), +(26667, '小河乡', 4, 2919), +(26668, '张坊镇', 4, 2919), +(26669, '文家市镇', 4, 2919), +(26670, '普迹镇', 4, 2919), +(26671, '杨花乡', 4, 2919), +(26672, '枨冲镇', 4, 2919), +(26673, '柏加镇', 4, 2919), +(26674, '永和镇', 4, 2919), +(26675, '永安镇', 4, 2919), +(26676, '沙市镇', 4, 2919), +(26677, '沿溪镇', 4, 2919), +(26678, '洞阳镇', 4, 2919), +(26679, '淮川街道', 4, 2919), +(26680, '淳口镇', 4, 2919), +(26681, '溪江乡', 4, 2919), +(26682, '澄潭江镇', 4, 2919), +(26683, '社港镇', 4, 2919), +(26684, '荷花街道', 4, 2919), +(26685, '葛家乡', 4, 2919), +(26686, '蕉溪乡', 4, 2919), +(26687, '达浒镇', 4, 2919), +(26688, '金刚镇', 4, 2919), +(26689, '镇头镇', 4, 2919), +(26690, '集里街道', 4, 2919), +(26691, '高坪乡', 4, 2919), +(26692, '龙伏镇', 4, 2919), +(26693, '东屯渡街道', 4, 2920), +(26694, '东岸乡', 4, 2920), +(26695, '五里牌街道', 4, 2920), +(26696, '府后街街道', 4, 2920), +(26697, '文艺路街道', 4, 2920), +(26698, '朝阳街街道', 4, 2920), +(26699, '浏正街街道', 4, 2920), +(26700, '湘湖街道', 4, 2920), +(26701, '火星街道', 4, 2920), +(26702, '解放路街道', 4, 2920), +(26703, '都正街街道', 4, 2920), +(26704, '韭菜园街道', 4, 2920), +(26705, '马王堆街道', 4, 2920), +(26706, '北山镇', 4, 2921), +(26707, '双江镇', 4, 2921), +(26708, '安沙镇', 4, 2921), +(26709, '干杉乡', 4, 2921), +(26710, '开慧乡', 4, 2921), +(26711, '星沙镇', 4, 2921), +(26712, '春华镇', 4, 2921), +(26713, '暮云镇', 4, 2921), +(26714, '果园镇', 4, 2921), +(26715, '榔梨镇', 4, 2921), +(26716, '江背镇', 4, 2921), +(26717, '白沙乡', 4, 2921), +(26718, '福临镇', 4, 2921), +(26719, '路口镇', 4, 2921), +(26720, '跳马乡', 4, 2921), +(26721, '金井镇', 4, 2921), +(26722, '青山铺镇', 4, 2921), +(26723, '高桥镇', 4, 2921), +(26724, '黄兴镇', 4, 2921), +(26725, '黄花镇', 4, 2921); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26726, '东塘街道', 4, 2922), +(26727, '井湾子街道', 4, 2922), +(26728, '侯家塘街道', 4, 2922), +(26729, '圭塘街道', 4, 2922), +(26730, '左家塘街道', 4, 2922), +(26731, '洞井镇', 4, 2922), +(26732, '砂子塘街道', 4, 2922), +(26733, '雨花亭街道', 4, 2922), +(26734, '高桥街道', 4, 2922), +(26735, '黎托乡', 4, 2922), +(26736, '嵩山路街道', 4, 2923), +(26737, '栗雨街道', 4, 2923), +(26738, '泰山路街道', 4, 2923), +(26739, '群丰镇', 4, 2923), +(26740, '马家河镇', 4, 2923), +(26741, '上云桥镇', 4, 2924), +(26742, '丫江桥镇', 4, 2924), +(26743, '坪阳庙乡', 4, 2924), +(26744, '城关镇', 4, 2924), +(26745, '大同桥镇', 4, 2924), +(26746, '新市镇', 4, 2924), +(26747, '柏市镇', 4, 2924), +(26748, '桃水镇', 4, 2924), +(26749, '槚山乡', 4, 2924), +(26750, '渌田镇', 4, 2924), +(26751, '湖南坳乡', 4, 2924), +(26752, '皇图岭镇', 4, 2924), +(26753, '石羊塘镇', 4, 2924), +(26754, '网岭镇', 4, 2924), +(26755, '莲塘坳乡', 4, 2924), +(26756, '菜花坪镇', 4, 2924), +(26757, '酒埠江镇', 4, 2924), +(26758, '鸭塘铺乡', 4, 2924), +(26759, '鸾山镇', 4, 2924), +(26760, '黄丰桥镇', 4, 2924), +(26761, '三门镇', 4, 2925), +(26762, '仙井乡', 4, 2925), +(26763, '南阳桥乡', 4, 2925), +(26764, '古岳峰镇', 4, 2925), +(26765, '堂市乡', 4, 2925), +(26766, '太湖乡', 4, 2925), +(26767, '姚家坝乡', 4, 2925), +(26768, '平山乡', 4, 2925), +(26769, '朱亭镇', 4, 2925), +(26770, '洲坪乡', 4, 2925), +(26771, '淦田镇', 4, 2925), +(26772, '渌口镇', 4, 2925), +(26773, '王十万乡', 4, 2925), +(26774, '白关镇', 4, 2925), +(26775, '砖桥乡', 4, 2925), +(26776, '雷打石镇', 4, 2925), +(26777, '龙凤乡', 4, 2925), +(26778, '龙潭乡', 4, 2925), +(26779, '三河镇', 4, 2926), +(26780, '下村乡', 4, 2926), +(26781, '东风乡', 4, 2926), +(26782, '中村乡', 4, 2926), +(26783, '十都镇', 4, 2926), +(26784, '垄溪乡', 4, 2926), +(26785, '平乐乡', 4, 2926), +(26786, '水口镇', 4, 2926), +(26787, '沔渡镇', 4, 2926); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26788, '炎陵县', 4, 2926), +(26789, '石洲乡', 4, 2926), +(26790, '策源乡', 4, 2926), +(26791, '船形乡', 4, 2926), +(26792, '霞阳镇', 4, 2926), +(26793, '鹿原镇', 4, 2926), +(26794, '龙渣瑶族乡', 4, 2926), +(26795, '云田乡', 4, 2927), +(26796, '井龙街道', 4, 2927), +(26797, '响石岭街道', 4, 2927), +(26798, '塘湾街道', 4, 2927), +(26799, '清水塘街道', 4, 2927), +(26800, '田心街道', 4, 2927), +(26801, '龙头铺镇', 4, 2927), +(26802, '五里墩乡', 4, 2928), +(26803, '庆云街道', 4, 2928), +(26804, '建宁街道', 4, 2928), +(26805, '建设街道', 4, 2928), +(26806, '枫溪街道', 4, 2928), +(26807, '董家段街道', 4, 2928), +(26808, '贺家土街道', 4, 2928), +(26809, '龙泉街道', 4, 2928), +(26810, '七地乡', 4, 2929), +(26811, '下东乡', 4, 2929), +(26812, '严塘镇', 4, 2929), +(26813, '八团乡', 4, 2929), +(26814, '城关镇', 4, 2929), +(26815, '尧水乡', 4, 2929), +(26816, '平水镇', 4, 2929), +(26817, '思聪乡', 4, 2929), +(26818, '枣市镇', 4, 2929), +(26819, '桃坑乡', 4, 2929), +(26820, '洣江乡', 4, 2929), +(26821, '浣溪镇', 4, 2929), +(26822, '湖口镇', 4, 2929), +(26823, '潞水镇', 4, 2929), +(26824, '火田镇', 4, 2929), +(26825, '界首镇', 4, 2929), +(26826, '秩堂乡', 4, 2929), +(26827, '腰陂镇', 4, 2929), +(26828, '舲舫乡', 4, 2929), +(26829, '虎踞镇', 4, 2929), +(26830, '马江镇', 4, 2929), +(26831, '高陇镇', 4, 2929), +(26832, '仙庾镇', 4, 2930), +(26833, '宋家桥街道', 4, 2930), +(26834, '明照乡', 4, 2930), +(26835, '月塘街道', 4, 2930), +(26836, '桂花街道', 4, 2930), +(26837, '茨菇塘街道', 4, 2930), +(26838, '金山街道', 4, 2930), +(26839, '东堡乡', 4, 2931), +(26840, '东富镇', 4, 2931), +(26841, '仙霞镇', 4, 2931), +(26842, '南桥镇', 4, 2931), +(26843, '嘉树乡', 4, 2931), +(26844, '均楚镇', 4, 2931), +(26845, '大障镇', 4, 2931), +(26846, '孙家湾乡', 4, 2931), +(26847, '官庄乡', 4, 2931), +(26848, '富里镇', 4, 2931), +(26849, '新阳乡', 4, 2931), +(26850, '来龙门街道', 4, 2931); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26851, '板杉乡', 4, 2931), +(26852, '枫林市乡', 4, 2931), +(26853, '栗山坝镇', 4, 2931), +(26854, '沈潭镇', 4, 2931), +(26855, '泗汾镇', 4, 2931), +(26856, '浦口镇', 4, 2931), +(26857, '清水江乡', 4, 2931), +(26858, '王仙镇', 4, 2931), +(26859, '王坊镇', 4, 2931), +(26860, '白兔潭镇', 4, 2931), +(26861, '石亭镇', 4, 2931), +(26862, '神福港镇', 4, 2931), +(26863, '船湾镇', 4, 2931), +(26864, '西山街道', 4, 2931), +(26865, '贺家桥镇', 4, 2931), +(26866, '阳三街道', 4, 2931), +(26867, '黄泥坳街道', 4, 2931), +(26868, '黄獭嘴镇', 4, 2931), +(26869, '下摄司街道', 4, 2932), +(26870, '东坪街道', 4, 2932), +(26871, '中洲路街道', 4, 2932), +(26872, '书院路街道', 4, 2932), +(26873, '五里堆街道', 4, 2932), +(26874, '双马镇', 4, 2932), +(26875, '宝塔街道', 4, 2932), +(26876, '岳塘街道', 4, 2932), +(26877, '建设路街道', 4, 2932), +(26878, '易家湾镇', 4, 2932), +(26879, '昭山乡', 4, 2932), +(26880, '板塘乡', 4, 2932), +(26881, '滴水埠街道', 4, 2932), +(26882, '社建村街道', 4, 2932), +(26883, '荷塘乡', 4, 2932), +(26884, '霞城乡', 4, 2932), +(26885, '东山街道', 4, 2933), +(26886, '东郊乡', 4, 2933), +(26887, '中沙镇', 4, 2933), +(26888, '壶天镇', 4, 2933), +(26889, '山枣镇', 4, 2933), +(26890, '新湘路街道', 4, 2933), +(26891, '昆仑桥街道', 4, 2933), +(26892, '月山镇', 4, 2933), +(26893, '望春门街道', 4, 2933), +(26894, '栗山镇', 4, 2933), +(26895, '梅桥镇', 4, 2933), +(26896, '棋梓镇', 4, 2933), +(26897, '毛田乡', 4, 2933), +(26898, '泉塘镇', 4, 2933), +(26899, '潭市镇', 4, 2933), +(26900, '白田镇', 4, 2933), +(26901, '翻江镇', 4, 2933), +(26902, '育塅乡', 4, 2933), +(26903, '虞塘镇', 4, 2933), +(26904, '金石镇', 4, 2933), +(26905, '金薮乡', 4, 2933), +(26906, '龙洞乡', 4, 2933), +(26907, '中路铺镇', 4, 2934), +(26908, '乌石镇', 4, 2934), +(26909, '云湖桥镇', 4, 2934), +(26910, '分水乡', 4, 2934), +(26911, '响塘乡', 4, 2934), +(26912, '响水乡', 4, 2934); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26913, '姜畲镇', 4, 2934), +(26914, '射埠镇', 4, 2934), +(26915, '排头乡', 4, 2934), +(26916, '易俗河镇', 4, 2934), +(26917, '杨嘉桥镇', 4, 2934), +(26918, '梅林桥镇', 4, 2934), +(26919, '河口镇', 4, 2934), +(26920, '白石乡', 4, 2934), +(26921, '石潭镇', 4, 2934), +(26922, '石鼓镇', 4, 2934), +(26923, '花石镇', 4, 2934), +(26924, '茶恩寺镇', 4, 2934), +(26925, '谭家山镇', 4, 2934), +(26926, '锦石乡', 4, 2934), +(26927, '青山桥镇', 4, 2934), +(26928, '龙口乡', 4, 2934), +(26929, '中山路街道', 4, 2935), +(26930, '云塘街道', 4, 2935), +(26931, '先锋乡', 4, 2935), +(26932, '城正街街道', 4, 2935), +(26933, '平政路街道', 4, 2935), +(26934, '广场街道', 4, 2935), +(26935, '护潭乡', 4, 2935), +(26936, '昭潭乡', 4, 2935), +(26937, '楠竹山镇', 4, 2935), +(26938, '窑湾街道', 4, 2935), +(26939, '羊牯塘街道', 4, 2935), +(26940, '长城乡', 4, 2935), +(26941, '雨湖路街道', 4, 2935), +(26942, '鹤岭镇', 4, 2935), +(26943, '大坪乡', 4, 2936), +(26944, '如意镇', 4, 2936), +(26945, '杨林乡', 4, 2936), +(26946, '永义乡', 4, 2936), +(26947, '清溪镇', 4, 2936), +(26948, '银田镇', 4, 2936), +(26949, '韶山乡', 4, 2936), +(26950, '南岳镇', 4, 2937), +(26951, '岳林乡', 4, 2937), +(26952, '拜殿乡', 4, 2937), +(26953, '祝融街道', 4, 2937), +(26954, '龙凤乡', 4, 2937), +(26955, '三角塘镇', 4, 2938), +(26956, '兰江乡', 4, 2938), +(26957, '培元街道', 4, 2938), +(26958, '塔山瑶族乡', 4, 2938), +(26959, '大堡乡', 4, 2938), +(26960, '官岭镇', 4, 2938), +(26961, '宜潭乡', 4, 2938), +(26962, '宜阳街道', 4, 2938), +(26963, '庙前镇', 4, 2938), +(26964, '弥泉乡', 4, 2938), +(26965, '新河镇', 4, 2938), +(26966, '松柏镇', 4, 2938), +(26967, '板桥镇', 4, 2938), +(26968, '柏坊镇', 4, 2938), +(26969, '江河乡', 4, 2938), +(26970, '泉峰街道', 4, 2938), +(26971, '洋泉镇', 4, 2938), +(26972, '烟洲镇', 4, 2938), +(26973, '白沙镇', 4, 2938), +(26974, '盐湖镇', 4, 2938), +(26975, '罗桥镇', 4, 2938); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(26976, '胜桥镇', 4, 2938), +(26977, '荫田镇', 4, 2938), +(26978, '蓬塘乡', 4, 2938), +(26979, '西岭镇', 4, 2938), +(26980, '东阳渡镇', 4, 2939), +(26981, '东风路街道', 4, 2939), +(26982, '冶金街道', 4, 2939), +(26983, '和平乡', 4, 2939), +(26984, '广东路街道', 4, 2939), +(26985, '新湘街道', 4, 2939), +(26986, '粤汉街道', 4, 2939), +(26987, '苗圃街道', 4, 2939), +(26988, '茶山坳镇', 4, 2939), +(26989, '酃湖乡', 4, 2939), +(26990, '五一街道', 4, 2940), +(26991, '人民路街道', 4, 2940), +(26992, '合江街道', 4, 2940), +(26993, '松木乡', 4, 2940), +(26994, '潇湘街道', 4, 2940), +(26995, '角山乡', 4, 2940), +(26996, '青山街道', 4, 2940), +(26997, '黄沙湾街道', 4, 2940), +(26998, '凤歧坪乡', 4, 2941), +(26999, '双桥镇', 4, 2941), +(27000, '四明山乡', 4, 2941), +(27001, '城连圩乡', 4, 2941), +(27002, '太和堂镇', 4, 2941), +(27003, '官家嘴镇', 4, 2941), +(27004, '归阳镇', 4, 2941), +(27005, '步云桥镇', 4, 2941), +(27006, '河洲镇', 4, 2941), +(27007, '洪桥镇', 4, 2941), +(27008, '灵官镇', 4, 2941), +(27009, '白地市镇', 4, 2941), +(27010, '白鹤铺镇', 4, 2941), +(27011, '石亭子镇', 4, 2941), +(27012, '砖塘镇', 4, 2941), +(27013, '粮市镇', 4, 2941), +(27014, '蒋家桥镇', 4, 2941), +(27015, '过水坪镇', 4, 2941), +(27016, '金桥镇', 4, 2941), +(27017, '风石堰镇', 4, 2941), +(27018, '马杜桥乡', 4, 2941), +(27019, '鸟江镇', 4, 2941), +(27020, '黄土铺镇', 4, 2941), +(27021, '三都镇', 4, 2942), +(27022, '上架乡', 4, 2942), +(27023, '东湖圩乡', 4, 2942), +(27024, '亮源乡', 4, 2942), +(27025, '仁义乡', 4, 2942), +(27026, '余庆乡', 4, 2942), +(27027, '公平圩镇', 4, 2942), +(27028, '南京乡', 4, 2942), +(27029, '南阳镇', 4, 2942), +(27030, '哲桥镇', 4, 2942), +(27031, '坛下乡', 4, 2942), +(27032, '夏塘镇', 4, 2942), +(27033, '大义乡', 4, 2942), +(27034, '大市乡', 4, 2942), +(27035, '太和圩乡', 4, 2942), +(27036, '太平圩乡', 4, 2942), +(27037, '导子乡', 4, 2942); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27038, '小水镇', 4, 2942), +(27039, '新市镇', 4, 2942), +(27040, '水东江街道', 4, 2942), +(27041, '永济镇', 4, 2942), +(27042, '沙明乡', 4, 2942), +(27043, '泗门洲镇', 4, 2942), +(27044, '洲陂乡', 4, 2942), +(27045, '灶市街街道', 4, 2942), +(27046, '磨形乡', 4, 2942), +(27047, '竹市镇', 4, 2942), +(27048, '肥田乡', 4, 2942), +(27049, '蔡子池街道', 4, 2942), +(27050, '遥田镇', 4, 2942), +(27051, '长坪乡', 4, 2942), +(27052, '马水乡', 4, 2942), +(27053, '黄市镇', 4, 2942), +(27054, '龙塘镇', 4, 2942), +(27055, '华兴街道', 4, 2943), +(27056, '呆鹰岭镇', 4, 2943), +(27057, '红湘街道', 4, 2943), +(27058, '联合街道', 4, 2943), +(27059, '蒸湘街道', 4, 2943), +(27060, '长湖乡', 4, 2943), +(27061, '雨母山乡', 4, 2943), +(27062, '三樟乡', 4, 2944), +(27063, '南湾乡', 4, 2944), +(27064, '吴集镇', 4, 2944), +(27065, '城关镇', 4, 2944), +(27066, '大桥镇', 4, 2944), +(27067, '大浦镇', 4, 2944), +(27068, '德圳乡', 4, 2944), +(27069, '新塘镇', 4, 2944), +(27070, '杨林镇', 4, 2944), +(27071, '杨桥镇', 4, 2944), +(27072, '栗木乡', 4, 2944), +(27073, '珍珠乡', 4, 2944), +(27074, '甘溪镇', 4, 2944), +(27075, '白莲镇', 4, 2944), +(27076, '石湾镇', 4, 2944), +(27077, '石滩乡', 4, 2944), +(27078, '草市镇', 4, 2944), +(27079, '荣桓镇', 4, 2944), +(27080, '莫井乡', 4, 2944), +(27081, '蓬源镇', 4, 2944), +(27082, '踏庄乡', 4, 2944), +(27083, '霞流镇', 4, 2944), +(27084, '高塘乡', 4, 2944), +(27085, '高湖镇', 4, 2944), +(27086, '三塘镇', 4, 2945), +(27087, '云集镇', 4, 2945), +(27088, '以及川口办事处', 4, 2945), +(27089, '冠市镇', 4, 2945), +(27090, '向阳镇', 4, 2945), +(27091, '咸塘镇', 4, 2945), +(27092, '宝盖镇', 4, 2945), +(27093, '廖田镇', 4, 2945), +(27094, '松江乡', 4, 2945), +(27095, '柞市镇', 4, 2945), +(27096, '栗江镇', 4, 2945), +(27097, '江口镇', 4, 2945), +(27098, '泉湖镇', 4, 2945), +(27099, '泉溪镇', 4, 2945), +(27100, '洪山镇', 4, 2945), +(27101, '洲市乡', 4, 2945); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27102, '相市乡', 4, 2945), +(27103, '硫市镇', 4, 2945), +(27104, '花桥镇', 4, 2945), +(27105, '茅市镇', 4, 2945), +(27106, '茶市镇', 4, 2945), +(27107, '谭子山镇', 4, 2945), +(27108, '车江镇', 4, 2945), +(27109, '近尾洲镇', 4, 2945), +(27110, '铁丝塘镇', 4, 2945), +(27111, '鸡笼镇', 4, 2945), +(27112, '东湖镇', 4, 2946), +(27113, '岭坡乡', 4, 2946), +(27114, '店门镇', 4, 2946), +(27115, '开云镇', 4, 2946), +(27116, '新桥镇', 4, 2946), +(27117, '望峰乡', 4, 2946), +(27118, '永和乡', 4, 2946), +(27119, '江东乡', 4, 2946), +(27120, '沙泉乡', 4, 2946), +(27121, '白果镇', 4, 2946), +(27122, '福田铺乡', 4, 2946), +(27123, '萱洲镇', 4, 2946), +(27124, '贯塘乡', 4, 2946), +(27125, '贺家乡', 4, 2946), +(27126, '长江镇', 4, 2946), +(27127, '长青乡', 4, 2946), +(27128, '马迹镇', 4, 2946), +(27129, '三湖镇', 4, 2947), +(27130, '井头镇', 4, 2947), +(27131, '关市乡', 4, 2947), +(27132, '台源镇', 4, 2947), +(27133, '大安乡', 4, 2947), +(27134, '岘山乡', 4, 2947), +(27135, '岣嵝乡', 4, 2947), +(27136, '库宗乡', 4, 2947), +(27137, '曲兰镇', 4, 2947), +(27138, '杉桥镇', 4, 2947), +(27139, '板市乡', 4, 2947), +(27140, '栏栊乡', 4, 2947), +(27141, '樟木乡', 4, 2947), +(27142, '樟树乡', 4, 2947), +(27143, '洪市镇', 4, 2947), +(27144, '渣江镇', 4, 2947), +(27145, '溪江乡', 4, 2947), +(27146, '演陂镇', 4, 2947), +(27147, '潮江乡', 4, 2947), +(27148, '界牌镇', 4, 2947), +(27149, '石市乡', 4, 2947), +(27150, '西渡镇', 4, 2947), +(27151, '金兰镇', 4, 2947), +(27152, '金溪镇', 4, 2947), +(27153, '长安乡', 4, 2947), +(27154, '集兵镇', 4, 2947), +(27155, '先锋街道', 4, 2948), +(27156, '天马山街道', 4, 2948), +(27157, '岳屏镇', 4, 2948), +(27158, '湘江乡', 4, 2948), +(27159, '白沙洲街道', 4, 2948), +(27160, '雁峰街道', 4, 2948), +(27161, '黄茶岭街道', 4, 2948), +(27162, '新滩镇街道', 4, 2949), +(27163, '状元洲街道', 4, 2949), +(27164, '田江乡', 4, 2949), +(27165, '茶元头乡', 4, 2949); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27166, '陈家桥乡', 4, 2949), +(27167, '东风路街道', 4, 2950), +(27168, '云水乡', 4, 2950), +(27169, '兴隆街道', 4, 2950), +(27170, '城东乡', 4, 2950), +(27171, '小江湖街道', 4, 2950), +(27172, '桥头街道', 4, 2950), +(27173, '汽车站街道', 4, 2950), +(27174, '渡头桥镇', 4, 2950), +(27175, '火车站乡', 4, 2950), +(27176, '石桥乡', 4, 2950), +(27177, '高崇山镇', 4, 2950), +(27178, '龙须塘街道', 4, 2950), +(27179, '丹口镇', 4, 2951), +(27180, '五团镇', 4, 2951), +(27181, '儒林镇', 4, 2951), +(27182, '兰蓉乡', 4, 2951), +(27183, '威溪乡', 4, 2951), +(27184, '汀坪乡', 4, 2951), +(27185, '白毛坪乡', 4, 2951), +(27186, '茅坪镇', 4, 2951), +(27187, '西岩镇', 4, 2951), +(27188, '长安营乡', 4, 2951), +(27189, '中心路街道', 4, 2952), +(27190, '城北路街道', 4, 2952), +(27191, '城南乡', 4, 2952), +(27192, '城西路街道', 4, 2952), +(27193, '板桥乡', 4, 2952), +(27194, '檀江乡', 4, 2952), +(27195, '百春园街道', 4, 2952), +(27196, '红旗路街道', 4, 2952), +(27197, '罗市镇', 4, 2952), +(27198, '翠园街道', 4, 2952), +(27199, '蔡锷乡', 4, 2952), +(27200, '雨溪镇', 4, 2952), +(27201, '一渡水镇', 4, 2953), +(27202, '万塘乡', 4, 2953), +(27203, '丰田乡', 4, 2953), +(27204, '回龙寺镇', 4, 2953), +(27205, '安山乡', 4, 2953), +(27206, '崀山镇', 4, 2953), +(27207, '巡田乡', 4, 2953), +(27208, '水庙镇', 4, 2953), +(27209, '清江桥乡', 4, 2953), +(27210, '白沙镇', 4, 2953), +(27211, '金石镇', 4, 2953), +(27212, '靖位乡', 4, 2953), +(27213, '飞仙桥乡', 4, 2953), +(27214, '马头桥乡', 4, 2953), +(27215, '高桥镇', 4, 2953), +(27216, '麻林瑶族乡', 4, 2953), +(27217, '黄金瑶族乡', 4, 2953), +(27218, '黄龙镇', 4, 2953), +(27219, '严塘镇', 4, 2954), +(27220, '坪上镇', 4, 2954), +(27221, '大新乡', 4, 2954), +(27222, '太芝庙乡', 4, 2954), +(27223, '寸石镇', 4, 2954), +(27224, '小塘镇', 4, 2954), +(27225, '巨口铺镇', 4, 2954), +(27226, '新田铺镇', 4, 2954), +(27227, '潭府乡', 4, 2954); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27228, '潭溪镇', 4, 2954), +(27229, '迎光乡', 4, 2954), +(27230, '酿溪镇', 4, 2954), +(27231, '陈家坊镇', 4, 2954), +(27232, '雀塘镇', 4, 2954), +(27233, '龙溪铺镇', 4, 2954), +(27234, '双牌乡', 4, 2955), +(27235, '司马冲镇', 4, 2955), +(27236, '大甸乡', 4, 2955), +(27237, '头堂乡', 4, 2955), +(27238, '安乐乡', 4, 2955), +(27239, '文坪镇', 4, 2955), +(27240, '晏田乡', 4, 2955), +(27241, '水浸坪乡', 4, 2955), +(27242, '水西门街道', 4, 2955), +(27243, '法相岩街道', 4, 2955), +(27244, '湾头桥镇', 4, 2955), +(27245, '秦桥乡', 4, 2955), +(27246, '稠树塘镇', 4, 2955), +(27247, '荆竹铺镇', 4, 2955), +(27248, '辕门口街道', 4, 2955), +(27249, '迎春亭街道', 4, 2955), +(27250, '邓元泰镇', 4, 2955), +(27251, '邓家铺镇', 4, 2955), +(27252, '马坪乡', 4, 2955), +(27253, '龙溪镇', 4, 2955), +(27254, '龙田乡', 4, 2955), +(27255, '古楼乡', 4, 2956), +(27256, '大屋瑶族乡', 4, 2956), +(27257, '山门镇', 4, 2956), +(27258, '岩山乡', 4, 2956), +(27259, '月溪乡', 4, 2956), +(27260, '杨林乡', 4, 2956), +(27261, '桐山乡', 4, 2956), +(27262, '毓兰镇', 4, 2956), +(27263, '水东乡', 4, 2956), +(27264, '江口镇', 4, 2956), +(27265, '洞口镇', 4, 2956), +(27266, '渣坪乡', 4, 2956), +(27267, '石柱乡', 4, 2956), +(27268, '石江镇', 4, 2956), +(27269, '竹市镇', 4, 2956), +(27270, '罗溪瑶族乡', 4, 2956), +(27271, '花古乡', 4, 2956), +(27272, '花园镇', 4, 2956), +(27273, '醪田镇', 4, 2956), +(27274, '长塘瑶族乡', 4, 2956), +(27275, '高沙镇', 4, 2956), +(27276, '黄桥镇', 4, 2956), +(27277, '东山侗族乡', 4, 2957), +(27278, '乐安铺苗族侗族乡', 4, 2957), +(27279, '党坪苗族乡', 4, 2957), +(27280, '关峡苗族乡', 4, 2957), +(27281, '唐家坊镇', 4, 2957), +(27282, '在市苗族乡', 4, 2957), +(27283, '朝仪侗族乡', 4, 2957), +(27284, '李熙桥镇', 4, 2957), +(27285, '枫木团苗族侗族乡', 4, 2957), +(27286, '梅坪乡', 4, 2957), +(27287, '武阳镇', 4, 2957), +(27288, '水口乡', 4, 2957); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27289, '河口苗族乡', 4, 2957), +(27290, '瓦屋塘乡', 4, 2957), +(27291, '白玉乡', 4, 2957), +(27292, '竹舟江苗族乡', 4, 2957), +(27293, '红岩镇', 4, 2957), +(27294, '联民苗族瑶族乡', 4, 2957), +(27295, '金屋塘镇', 4, 2957), +(27296, '长铺子苗族乡', 4, 2957), +(27297, '长铺镇', 4, 2957), +(27298, '鹅公岭侗族苗族乡', 4, 2957), +(27299, '麻塘苗族乡', 4, 2957), +(27300, '黄土矿乡', 4, 2957), +(27301, '黄桑坪苗族乡', 4, 2957), +(27302, '两市镇', 4, 2958), +(27303, '九龙岭镇', 4, 2958), +(27304, '仙槎桥镇', 4, 2958), +(27305, '佘田桥镇', 4, 2958), +(27306, '双凤乡', 4, 2958), +(27307, '周官桥乡', 4, 2958), +(27308, '团山镇', 4, 2958), +(27309, '堡面前乡', 4, 2958), +(27310, '廉桥镇', 4, 2958), +(27311, '斫曹乡', 4, 2958), +(27312, '杨桥镇', 4, 2958), +(27313, '水东江镇', 4, 2958), +(27314, '流光岭镇', 4, 2958), +(27315, '流泽镇', 4, 2958), +(27316, '火厂坪镇', 4, 2958), +(27317, '灵官殿镇', 4, 2958), +(27318, '牛马司镇', 4, 2958), +(27319, '界岭乡', 4, 2958), +(27320, '石株桥乡', 4, 2958), +(27321, '砂石镇', 4, 2958), +(27322, '简家陇乡', 4, 2958), +(27323, '范家山镇', 4, 2958), +(27324, '野鸡坪镇', 4, 2958), +(27325, '魏家桥镇', 4, 2958), +(27326, '黄陂桥乡', 4, 2958), +(27327, '黑田铺乡', 4, 2958), +(27328, '下花桥镇', 4, 2959), +(27329, '九公桥镇', 4, 2959), +(27330, '五峰铺镇', 4, 2959), +(27331, '塘渡口镇', 4, 2959), +(27332, '塘田市镇', 4, 2959), +(27333, '小溪市乡', 4, 2959), +(27334, '岩口铺镇', 4, 2959), +(27335, '河伯乡', 4, 2959), +(27336, '白仓镇', 4, 2959), +(27337, '罗城乡', 4, 2959), +(27338, '蔡桥乡', 4, 2959), +(27339, '诸甲亭乡', 4, 2959), +(27340, '谷洲镇', 4, 2959), +(27341, '郦家坪镇', 4, 2959), +(27342, '金江乡', 4, 2959), +(27343, '金称市镇', 4, 2959), +(27344, '长乐乡', 4, 2959), +(27345, '长阳铺镇', 4, 2959), +(27346, '霞塘云乡', 4, 2959), +(27347, '黄亭市镇', 4, 2959), +(27348, '黄塘乡', 4, 2959); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27349, '黄荆乡', 4, 2959), +(27350, '七江乡', 4, 2960), +(27351, '三阁司乡', 4, 2960), +(27352, '六都寨镇', 4, 2960), +(27353, '北山乡', 4, 2960), +(27354, '南岳庙乡', 4, 2960), +(27355, '司门前镇', 4, 2960), +(27356, '周旺镇', 4, 2960), +(27357, '大水田乡', 4, 2960), +(27358, '小沙江镇', 4, 2960), +(27359, '山界回族乡', 4, 2960), +(27360, '岩口乡', 4, 2960), +(27361, '桃洪镇', 4, 2960), +(27362, '横板桥镇', 4, 2960), +(27363, '滩头镇', 4, 2960), +(27364, '石门乡', 4, 2960), +(27365, '罗洪乡', 4, 2960), +(27366, '羊古坳乡', 4, 2960), +(27367, '荷田乡', 4, 2960), +(27368, '荷香桥镇', 4, 2960), +(27369, '虎形山瑶族乡', 4, 2960), +(27370, '西洋江镇', 4, 2960), +(27371, '金石桥镇', 4, 2960), +(27372, '雨山铺镇', 4, 2960), +(27373, '高平镇', 4, 2960), +(27374, '鸭田镇', 4, 2960), +(27375, '麻塘山乡', 4, 2960), +(27376, '乘风乡', 4, 2961), +(27377, '五里牌乡', 4, 2961), +(27378, '儒溪镇', 4, 2961), +(27379, '坦渡乡', 4, 2961), +(27380, '城南乡', 4, 2961), +(27381, '壁山乡', 4, 2961), +(27382, '定湖镇', 4, 2961), +(27383, '忠防镇', 4, 2961), +(27384, '文白乡', 4, 2961), +(27385, '桃林镇', 4, 2961), +(27386, '桃矿街道', 4, 2961), +(27387, '桥东街道', 4, 2961), +(27388, '横铺乡', 4, 2961), +(27389, '江南镇', 4, 2961), +(27390, '源潭镇', 4, 2961), +(27391, '白云镇', 4, 2961), +(27392, '白羊田镇', 4, 2961), +(27393, '羊楼司镇', 4, 2961), +(27394, '聂市镇', 4, 2961), +(27395, '詹桥镇', 4, 2961), +(27396, '贺畈乡', 4, 2961), +(27397, '长塘镇', 4, 2961), +(27398, '长安街道', 4, 2961), +(27399, '黄盖镇', 4, 2961), +(27400, '龙源乡', 4, 2961), +(27401, '云溪乡', 4, 2962), +(27402, '云溪镇', 4, 2962), +(27403, '岳化社区', 4, 2962), +(27404, '文桥镇', 4, 2962), +(27405, '永济乡', 4, 2962), +(27406, '路口镇', 4, 2962), +(27407, '道仁矶镇', 4, 2962), +(27408, '长岭街道', 4, 2962), +(27409, '陆城镇', 4, 2962), +(27410, '万庾镇', 4, 2963), +(27411, '三封寺镇', 4, 2963); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27412, '东山镇', 4, 2963), +(27413, '北景港镇', 4, 2963), +(27414, '南山乡', 4, 2963), +(27415, '团洲乡', 4, 2963), +(27416, '城关镇', 4, 2963), +(27417, '宋家嘴镇', 4, 2963), +(27418, '幸福乡', 4, 2963), +(27419, '护城乡', 4, 2963), +(27420, '插旗镇', 4, 2963), +(27421, '操军镇', 4, 2963), +(27422, '新建乡', 4, 2963), +(27423, '新河乡', 4, 2963), +(27424, '梅田湖镇', 4, 2963), +(27425, '治河渡镇', 4, 2963), +(27426, '注滋口镇', 4, 2963), +(27427, '终南乡', 4, 2963), +(27428, '胜峰乡', 4, 2963), +(27429, '鲇鱼须镇', 4, 2963), +(27430, '广兴洲镇', 4, 2964), +(27431, '柳林洲镇', 4, 2964), +(27432, '良心堡镇', 4, 2964), +(27433, '西城街道', 4, 2964), +(27434, '许市镇', 4, 2964), +(27435, '采桑湖镇', 4, 2964), +(27436, '钱粮湖镇', 4, 2964), +(27437, '东洞庭湖管委会', 4, 2965), +(27438, '中洲乡', 4, 2965), +(27439, '云山乡', 4, 2965), +(27440, '公田镇', 4, 2965), +(27441, '张谷英镇', 4, 2965), +(27442, '新墙镇', 4, 2965), +(27443, '新开镇', 4, 2965), +(27444, '月田镇', 4, 2965), +(27445, '杨林乡', 4, 2965), +(27446, '柏祥镇', 4, 2965), +(27447, '步仙乡', 4, 2965), +(27448, '毛田镇', 4, 2965), +(27449, '甘田乡', 4, 2965), +(27450, '相思乡', 4, 2965), +(27451, '筻口镇', 4, 2965), +(27452, '荣家湾镇', 4, 2965), +(27453, '长湖乡', 4, 2965), +(27454, '饶村乡', 4, 2965), +(27455, '鹿角镇', 4, 2965), +(27456, '麻塘镇', 4, 2965), +(27457, '黄沙街镇', 4, 2965), +(27458, '三眼桥街道', 4, 2966), +(27459, '三荷乡', 4, 2966), +(27460, '东茅岭街道', 4, 2966), +(27461, '五里牌街道', 4, 2966), +(27462, '冷水铺街道', 4, 2966), +(27463, '北港街道', 4, 2966), +(27464, '南湖街道', 4, 2966), +(27465, '吕仙亭街道', 4, 2966), +(27466, '城陵矶街道', 4, 2966), +(27467, '岳阳楼街道', 4, 2966), +(27468, '康王乡', 4, 2966), +(27469, '新路口街道', 4, 2966), +(27470, '梅溪乡', 4, 2966), +(27471, '洛王街道', 4, 2966), +(27472, '洞庭街道', 4, 2966), +(27473, '西塘镇', 4, 2966); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27474, '郭镇乡', 4, 2966), +(27475, '金鹗山街道', 4, 2966), +(27476, '三墩乡', 4, 2967), +(27477, '三市镇', 4, 2967), +(27478, '三阳乡', 4, 2967), +(27479, '伍市镇', 4, 2967), +(27480, '余坪乡', 4, 2967), +(27481, '冬塔乡', 4, 2967), +(27482, '加义镇', 4, 2967), +(27483, '南桥乡', 4, 2967), +(27484, '南江镇', 4, 2967), +(27485, '向家镇', 4, 2967), +(27486, '咏生乡', 4, 2967), +(27487, '大坪乡', 4, 2967), +(27488, '大洲乡', 4, 2967), +(27489, '安定镇', 4, 2967), +(27490, '岑川镇', 4, 2967), +(27491, '思村乡', 4, 2967), +(27492, '木金乡', 4, 2967), +(27493, '板江乡', 4, 2967), +(27494, '梅仙镇', 4, 2967), +(27495, '汉昌镇', 4, 2967), +(27496, '浯口镇', 4, 2967), +(27497, '瓮江镇', 4, 2967), +(27498, '童市镇', 4, 2967), +(27499, '虹桥镇', 4, 2967), +(27500, '长寿镇', 4, 2967), +(27501, '黄金洞乡', 4, 2967), +(27502, '龙门镇', 4, 2967), +(27503, '三江镇', 4, 2968), +(27504, '八景乡', 4, 2968), +(27505, '凤凰乡', 4, 2968), +(27506, '古仑乡', 4, 2968), +(27507, '古培镇', 4, 2968), +(27508, '城关镇', 4, 2968), +(27509, '城郊乡', 4, 2968), +(27510, '大荆镇', 4, 2968), +(27511, '天井乡', 4, 2968), +(27512, '屈子祠镇', 4, 2968), +(27513, '川山坪镇', 4, 2968), +(27514, '弼时镇', 4, 2968), +(27515, '新塘乡', 4, 2968), +(27516, '新市镇', 4, 2968), +(27517, '智峰乡', 4, 2968), +(27518, '李家段镇', 4, 2968), +(27519, '桃林寺镇', 4, 2968), +(27520, '汨罗镇', 4, 2968), +(27521, '沙溪镇', 4, 2968), +(27522, '河市镇', 4, 2968), +(27523, '火天乡', 4, 2968), +(27524, '玉池乡', 4, 2968), +(27525, '琴棋乡', 4, 2968), +(27526, '白塘乡', 4, 2968), +(27527, '白水镇', 4, 2968), +(27528, '磊石乡', 4, 2968), +(27529, '红花乡', 4, 2968), +(27530, '范家园镇', 4, 2968), +(27531, '营田镇', 4, 2968), +(27532, '长乐镇', 4, 2968), +(27533, '高家坊镇', 4, 2968), +(27534, '黄市乡', 4, 2968), +(27535, '黄柏镇', 4, 2968), +(27536, '黄金乡', 4, 2968), +(27537, '三塘镇', 4, 2969), +(27538, '东塘镇', 4, 2969); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27539, '六塘乡', 4, 2969), +(27540, '南湖洲镇', 4, 2969), +(27541, '和平管区', 4, 2969), +(27542, '城西镇', 4, 2969), +(27543, '岭北镇', 4, 2969), +(27544, '文星镇', 4, 2969), +(27545, '新泉镇', 4, 2969), +(27546, '杨林寨乡', 4, 2969), +(27547, '樟树镇', 4, 2969), +(27548, '湘滨镇', 4, 2969), +(27549, '玉华乡', 4, 2969), +(27550, '界头铺镇', 4, 2969), +(27551, '白泥湖乡', 4, 2969), +(27552, '石塘乡', 4, 2969), +(27553, '胭脂管区', 4, 2969), +(27554, '袁家铺镇', 4, 2969), +(27555, '赛头管区', 4, 2969), +(27556, '长康镇', 4, 2969), +(27557, '青潭乡', 4, 2969), +(27558, '静河乡', 4, 2969), +(27559, '鹤龙湖管区', 4, 2969), +(27560, '九里乡', 4, 2970), +(27561, '佘市桥镇', 4, 2970), +(27562, '修梅镇', 4, 2970), +(27563, '停弦渡镇', 4, 2970), +(27564, '合口镇', 4, 2970), +(27565, '四新岗镇', 4, 2970), +(27566, '城关镇', 4, 2970), +(27567, '太浮镇', 4, 2970), +(27568, '官亭乡', 4, 2970), +(27569, '文家乡', 4, 2970), +(27570, '新安镇', 4, 2970), +(27571, '望城乡', 4, 2970), +(27572, '杉板乡', 4, 2970), +(27573, '杨板乡', 4, 2970), +(27574, '柏枝乡', 4, 2970), +(27575, '烽火乡', 4, 2970), +(27576, '陈二乡', 4, 2970), +(27577, '三岔河镇', 4, 2971), +(27578, '下渔口镇', 4, 2971), +(27579, '城关镇', 4, 2971), +(27580, '大鲸港镇', 4, 2971), +(27581, '安丰乡', 4, 2971), +(27582, '安全乡', 4, 2971), +(27583, '安凝乡', 4, 2971), +(27584, '安宏乡', 4, 2971), +(27585, '安康乡', 4, 2971), +(27586, '安德乡', 4, 2971), +(27587, '安昌乡', 4, 2971), +(27588, '安猷乡', 4, 2971), +(27589, '安生乡', 4, 2971), +(27590, '安福乡', 4, 2971), +(27591, '安裕乡', 4, 2971), +(27592, '安障乡', 4, 2971), +(27593, '官垱镇', 4, 2971), +(27594, '焦圻镇', 4, 2971), +(27595, '陈家嘴镇', 4, 2971), +(27596, '黄山头镇', 4, 2971), +(27597, '三阳港镇', 4, 2972), +(27598, '九溪乡', 4, 2972), +(27599, '佘家坪乡', 4, 2972), +(27600, '兴隆街乡', 4, 2972), +(27601, '凌津滩镇', 4, 2972), +(27602, '剪市镇', 4, 2972); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27603, '双溪口乡', 4, 2972), +(27604, '太平桥乡', 4, 2972), +(27605, '太平铺乡', 4, 2972), +(27606, '寺坪乡', 4, 2972), +(27607, '木塘垸乡', 4, 2972), +(27608, '杨溪桥乡', 4, 2972), +(27609, '枫树维吾尔族回族乡', 4, 2972), +(27610, '架桥镇', 4, 2972), +(27611, '桃花源镇', 4, 2972), +(27612, '沙坪镇', 4, 2972), +(27613, '泥窝潭乡', 4, 2972), +(27614, '浯溪河乡', 4, 2972), +(27615, '深水港乡', 4, 2972), +(27616, '漆河镇', 4, 2972), +(27617, '漳江镇', 4, 2972), +(27618, '热市镇', 4, 2972), +(27619, '牛车河乡', 4, 2972), +(27620, '牯牛山乡', 4, 2972), +(27621, '理公港镇', 4, 2972), +(27622, '盘塘镇', 4, 2972), +(27623, '芦花潭乡', 4, 2972), +(27624, '茶庵铺镇', 4, 2972), +(27625, '西安镇', 4, 2972), +(27626, '观音寺镇', 4, 2972), +(27627, '车湖垸乡', 4, 2972), +(27628, '郑家驿乡', 4, 2972), +(27629, '郝坪乡', 4, 2972), +(27630, '钟家铺乡', 4, 2972), +(27631, '陬市镇', 4, 2972), +(27632, '青林回族维吾尔族乡', 4, 2972), +(27633, '马鬃岭镇', 4, 2972), +(27634, '黄甲铺乡', 4, 2972), +(27635, '黄石镇', 4, 2972), +(27636, '龙潭镇', 4, 2972), +(27637, '三岔路街道', 4, 2973), +(27638, '东江乡', 4, 2973), +(27639, '东郊乡', 4, 2973), +(27640, '丹洲乡', 4, 2973), +(27641, '南坪岗乡', 4, 2973), +(27642, '城东街道', 4, 2973), +(27643, '城北街道', 4, 2973), +(27644, '城南街道', 4, 2973), +(27645, '城西街道', 4, 2973), +(27646, '德山街道', 4, 2973), +(27647, '德山镇', 4, 2973), +(27648, '护城乡', 4, 2973), +(27649, '河洑镇', 4, 2973), +(27650, '芦荻山乡', 4, 2973), +(27651, '三和乡', 4, 2974), +(27652, '东岳庙乡', 4, 2974), +(27653, '丰家铺乡', 4, 2974), +(27654, '军山铺镇', 4, 2974), +(27655, '周文庙乡', 4, 2974), +(27656, '坡头镇', 4, 2974), +(27657, '大南湖乡', 4, 2974), +(27658, '太子庙镇', 4, 2974), +(27659, '岩嘴乡', 4, 2974), +(27660, '岩汪湖镇', 4, 2974), +(27661, '崔家桥镇', 4, 2974), +(27662, '文蔚乡', 4, 2974), +(27663, '新兴乡', 4, 2974); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27664, '月明潭乡', 4, 2974), +(27665, '朱家铺镇', 4, 2974), +(27666, '株木山乡', 4, 2974), +(27667, '毓德铺镇', 4, 2974), +(27668, '毛家滩回族维吾尔族乡', 4, 2974), +(27669, '沧港镇', 4, 2974), +(27670, '洋淘湖镇', 4, 2974), +(27671, '洲口镇', 4, 2974), +(27672, '百禄桥镇', 4, 2974), +(27673, '罐头嘴镇', 4, 2974), +(27674, '聂家桥乡', 4, 2974), +(27675, '蒋家嘴镇', 4, 2974), +(27676, '西湖镇', 4, 2974), +(27677, '酉港镇', 4, 2974), +(27678, '鸭子港乡', 4, 2974), +(27679, '龙潭桥乡', 4, 2974), +(27680, '龙阳镇', 4, 2974), +(27681, '三洲驿街道', 4, 2975), +(27682, '保河堤镇', 4, 2975), +(27683, '新洲镇', 4, 2975), +(27684, '李家铺乡', 4, 2975), +(27685, '棠华乡', 4, 2975), +(27686, '汪家桥街道', 4, 2975), +(27687, '渡口镇', 4, 2975), +(27688, '灵泉乡', 4, 2975), +(27689, '白衣镇', 4, 2975), +(27690, '襄阳街街道', 4, 2975), +(27691, '金鱼岭街道', 4, 2975), +(27692, '中武乡', 4, 2976), +(27693, '九垸乡', 4, 2976), +(27694, '双龙乡', 4, 2976), +(27695, '复兴厂镇', 4, 2976), +(27696, '大坪乡', 4, 2976), +(27697, '大堰垱镇', 4, 2976), +(27698, '太青乡', 4, 2976), +(27699, '如东乡', 4, 2976), +(27700, '官垸乡', 4, 2976), +(27701, '宜万乡', 4, 2976), +(27702, '小渡口镇', 4, 2976), +(27703, '张公庙镇', 4, 2976), +(27704, '方石坪镇', 4, 2976), +(27705, '杨家坊乡', 4, 2976), +(27706, '梦溪镇', 4, 2976), +(27707, '永丰乡', 4, 2976), +(27708, '洞市乡', 4, 2976), +(27709, '涔南乡', 4, 2976), +(27710, '澧东乡', 4, 2976), +(27711, '澧南乡', 4, 2976), +(27712, '澧澹乡', 4, 2976), +(27713, '澧阳镇', 4, 2976), +(27714, '火连坡镇', 4, 2976), +(27715, '王家厂镇', 4, 2976), +(27716, '甘溪滩镇', 4, 2976), +(27717, '盐井镇', 4, 2976), +(27718, '码头铺镇', 4, 2976), +(27719, '车溪乡', 4, 2976), +(27720, '道河乡', 4, 2976), +(27721, '金罗镇', 4, 2976), +(27722, '闸口乡', 4, 2976), +(27723, '雷公塔镇', 4, 2976), +(27724, '三圣乡', 4, 2977), +(27725, '二都乡', 4, 2977); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27726, '南北镇', 4, 2977), +(27727, '壶瓶山镇', 4, 2977), +(27728, '太平镇', 4, 2977), +(27729, '夹山镇', 4, 2977), +(27730, '子良乡', 4, 2977), +(27731, '所街乡', 4, 2977), +(27732, '新关镇', 4, 2977), +(27733, '新铺乡', 4, 2977), +(27734, '易家渡镇', 4, 2977), +(27735, '楚江镇', 4, 2977), +(27736, '白云乡', 4, 2977), +(27737, '皂市镇', 4, 2977), +(27738, '磨市镇', 4, 2977), +(27739, '维新镇', 4, 2977), +(27740, '罗坪乡', 4, 2977), +(27741, '蒙泉镇', 4, 2977), +(27742, '雁池乡', 4, 2977), +(27743, '丁家港乡', 4, 2978), +(27744, '中河口镇', 4, 2978), +(27745, '十美堂镇', 4, 2978), +(27746, '双桥坪镇', 4, 2978), +(27747, '周家店镇', 4, 2978), +(27748, '唐家铺乡', 4, 2978), +(27749, '大龙站镇', 4, 2978), +(27750, '尧天坪镇', 4, 2978), +(27751, '斗姆湖镇', 4, 2978), +(27752, '武陵镇', 4, 2978), +(27753, '沧山乡', 4, 2978), +(27754, '港二口镇', 4, 2978), +(27755, '灌溪镇', 4, 2978), +(27756, '牛鼻滩镇', 4, 2978), +(27757, '白鹤山乡', 4, 2978), +(27758, '石公桥镇', 4, 2978), +(27759, '石板滩镇', 4, 2978), +(27760, '石门桥镇', 4, 2978), +(27761, '祝丰镇', 4, 2978), +(27762, '草坪镇', 4, 2978), +(27763, '蒿子港镇', 4, 2978), +(27764, '蔡家岗镇', 4, 2978), +(27765, '许家桥回族维吾尔族乡', 4, 2978), +(27766, '谢家铺镇', 4, 2978), +(27767, '逆江坪乡', 4, 2978), +(27768, '钱家坪乡', 4, 2978), +(27769, '镇德桥镇', 4, 2978), +(27770, '长岭岗乡', 4, 2978), +(27771, '长茅岭乡', 4, 2978), +(27772, '雷公庙镇', 4, 2978), +(27773, '韩公渡镇', 4, 2978), +(27774, '黄土店镇', 4, 2978), +(27775, '黄珠洲乡', 4, 2978), +(27776, '黑山嘴乡', 4, 2978), +(27777, '三合口乡', 4, 2979), +(27778, '三官寺土家族乡', 4, 2979), +(27779, '东岳观镇', 4, 2979), +(27780, '二坊坪乡', 4, 2979), +(27781, '南山坪乡', 4, 2979), +(27782, '国太桥乡', 4, 2979), +(27783, '宜冲桥乡', 4, 2979), +(27784, '岩泊渡镇', 4, 2979), +(27785, '广福桥镇', 4, 2979), +(27786, '庄塌乡', 4, 2979); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27787, '景龙桥乡', 4, 2979), +(27788, '朝阳乡', 4, 2979), +(27789, '杉木桥镇', 4, 2979), +(27790, '杨柳铺乡', 4, 2979), +(27791, '江垭镇', 4, 2979), +(27792, '洞溪乡', 4, 2979), +(27793, '溪口镇', 4, 2979), +(27794, '甘堰土家族乡', 4, 2979), +(27795, '苗市镇', 4, 2979), +(27796, '许家坊土家族乡', 4, 2979), +(27797, '象市镇', 4, 2979), +(27798, '赵家岗土家族乡', 4, 2979), +(27799, '通津铺镇', 4, 2979), +(27800, '金坪乡', 4, 2979), +(27801, '金岩土家族乡', 4, 2979), +(27802, '阳和土家族乡', 4, 2979), +(27803, '零溪镇', 4, 2979), +(27804, '零阳镇', 4, 2979), +(27805, '高峰土家族乡', 4, 2979), +(27806, '高桥镇', 4, 2979), +(27807, '龙潭河镇', 4, 2979), +(27808, '上河溪乡', 4, 2980), +(27809, '上洞街乡', 4, 2980), +(27810, '两河口乡', 4, 2980), +(27811, '五道水镇', 4, 2980), +(27812, '人潮溪乡', 4, 2980), +(27813, '八大公山乡', 4, 2980), +(27814, '凉水口镇', 4, 2980), +(27815, '刘家坪白族乡', 4, 2980), +(27816, '利福塔镇', 4, 2980), +(27817, '四方溪乡', 4, 2980), +(27818, '官地坪镇', 4, 2980), +(27819, '岩屋口乡', 4, 2980), +(27820, '廖家村镇', 4, 2980), +(27821, '打鼓泉乡', 4, 2980), +(27822, '桥自湾乡', 4, 2980), +(27823, '汨湖乡', 4, 2980), +(27824, '沙塔坪乡', 4, 2980), +(27825, '河口乡', 4, 2980), +(27826, '洪家关白族乡', 4, 2980), +(27827, '淋溪河白族乡', 4, 2980), +(27828, '澧源镇', 4, 2980), +(27829, '瑞塔铺镇', 4, 2980), +(27830, '白石乡', 4, 2980), +(27831, '空壳树乡', 4, 2980), +(27832, '竹叶坪乡', 4, 2980), +(27833, '细沙坪乡', 4, 2980), +(27834, '芙蓉桥白族乡', 4, 2980), +(27835, '芭茅溪乡', 4, 2980), +(27836, '苦竹坪乡', 4, 2980), +(27837, '西莲乡', 4, 2980), +(27838, '谷罗山乡', 4, 2980), +(27839, '走马坪白族乡', 4, 2980), +(27840, '蹇家坡乡', 4, 2980), +(27841, '长潭坪乡', 4, 2980), +(27842, '陈家河镇', 4, 2980), +(27843, '马合口白族乡', 4, 2980), +(27844, '麦地坪白族乡', 4, 2980); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27845, '龙潭坪镇', 4, 2980), +(27846, '中湖乡', 4, 2981), +(27847, '军地坪街道', 4, 2981), +(27848, '协合乡', 4, 2981), +(27849, '天子山镇', 4, 2981), +(27850, '索溪峪土家族乡', 4, 2981), +(27851, '三家馆乡', 4, 2982), +(27852, '三岔乡', 4, 2982), +(27853, '南庄街道', 4, 2982), +(27854, '双溪桥乡', 4, 2982), +(27855, '合作桥乡', 4, 2982), +(27856, '后坪镇', 4, 2982), +(27857, '四都坪乡', 4, 2982), +(27858, '大坪镇', 4, 2982), +(27859, '大庸桥街道', 4, 2982), +(27860, '官黎坪街道', 4, 2982), +(27861, '尹家溪镇', 4, 2982), +(27862, '崇文街道', 4, 2982), +(27863, '教字垭镇', 4, 2982), +(27864, '新桥镇', 4, 2982), +(27865, '枫香岗乡', 4, 2982), +(27866, '桥头乡', 4, 2982), +(27867, '永定街道', 4, 2982), +(27868, '沅古坪镇', 4, 2982), +(27869, '沙堤乡', 4, 2982), +(27870, '温塘镇', 4, 2982), +(27871, '王家坪镇', 4, 2982), +(27872, '罗塔坪乡', 4, 2982), +(27873, '罗水乡', 4, 2982), +(27874, '西溪坪街道', 4, 2982), +(27875, '谢家垭乡', 4, 2982), +(27876, '阳湖坪镇', 4, 2982), +(27877, '青安坪乡', 4, 2982), +(27878, '三仙湖镇', 4, 2983), +(27879, '中鱼口乡', 4, 2983), +(27880, '乌嘴乡', 4, 2983), +(27881, '北洲子镇', 4, 2983), +(27882, '华阁镇', 4, 2983), +(27883, '南洲镇', 4, 2983), +(27884, '厂窖镇', 4, 2983), +(27885, '明山头镇', 4, 2983), +(27886, '武圣宫镇', 4, 2983), +(27887, '河坝镇', 4, 2983), +(27888, '浪拔湖乡', 4, 2983), +(27889, '茅草街镇', 4, 2983), +(27890, '金盆镇', 4, 2983), +(27891, '青树嘴镇', 4, 2983), +(27892, '麻河口镇', 4, 2983), +(27893, '东坪镇', 4, 2984), +(27894, '乐安镇', 4, 2984), +(27895, '仙溪镇', 4, 2984), +(27896, '冷市镇', 4, 2984), +(27897, '南金乡', 4, 2984), +(27898, '古楼乡', 4, 2984), +(27899, '大福镇', 4, 2984), +(27900, '奎溪镇', 4, 2984), +(27901, '小淹镇', 4, 2984), +(27902, '平口镇', 4, 2984), +(27903, '柘溪镇', 4, 2984), +(27904, '梅城镇', 4, 2984), +(27905, '江南镇', 4, 2984), +(27906, '清塘铺镇', 4, 2984); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27907, '渠江镇', 4, 2984), +(27908, '滔溪镇', 4, 2984), +(27909, '烟溪镇', 4, 2984), +(27910, '田庄乡', 4, 2984), +(27911, '羊角塘镇', 4, 2984), +(27912, '长塘镇', 4, 2984), +(27913, '马路镇', 4, 2984), +(27914, '高明乡', 4, 2984), +(27915, '龙塘乡', 4, 2984), +(27916, '三堂街镇', 4, 2985), +(27917, '修山镇', 4, 2985), +(27918, '大栗港镇', 4, 2985), +(27919, '松木塘镇', 4, 2985), +(27920, '桃花江镇', 4, 2985), +(27921, '武潭镇', 4, 2985), +(27922, '沾溪乡', 4, 2985), +(27923, '浮丘山乡', 4, 2985), +(27924, '灰山港镇', 4, 2985), +(27925, '牛田镇', 4, 2985), +(27926, '石牛江镇', 4, 2985), +(27927, '马迹塘镇', 4, 2985), +(27928, '高桥乡', 4, 2985), +(27929, '鲊埠回族乡', 4, 2985), +(27930, '鸬鹚渡镇', 4, 2985), +(27931, '万子湖乡', 4, 2986), +(27932, '三眼塘镇', 4, 2986), +(27933, '共华镇', 4, 2986), +(27934, '千山红镇', 4, 2986), +(27935, '南嘴镇', 4, 2986), +(27936, '南大膳镇', 4, 2986), +(27937, '四季红镇', 4, 2986), +(27938, '庆云山街道', 4, 2986), +(27939, '新湾镇', 4, 2986), +(27940, '泗湖山镇', 4, 2986), +(27941, '琼湖街道', 4, 2986), +(27942, '茶盘洲镇', 4, 2986), +(27943, '草尾镇', 4, 2986), +(27944, '阳罗洲镇', 4, 2986), +(27945, '黄茅洲镇', 4, 2986), +(27946, '大码头街道', 4, 2987), +(27947, '张家塞乡', 4, 2987), +(27948, '新桥河镇', 4, 2987), +(27949, '汽车路街道', 4, 2987), +(27950, '沙头镇', 4, 2987), +(27951, '茈湖口镇', 4, 2987), +(27952, '迎风桥镇', 4, 2987), +(27953, '长春镇', 4, 2987), +(27954, '会龙山街道', 4, 2988), +(27955, '八字哨镇', 4, 2988), +(27956, '兰溪镇', 4, 2988), +(27957, '岳家桥镇', 4, 2988), +(27958, '新市渡镇', 4, 2988), +(27959, '朝阳街道', 4, 2988), +(27960, '桃花仑街道', 4, 2988), +(27961, '欧江岔镇', 4, 2988), +(27962, '沧水铺镇', 4, 2988), +(27963, '泉交河镇', 4, 2988), +(27964, '泥江口镇', 4, 2988), +(27965, '牌口乡', 4, 2988), +(27966, '笔架山乡', 4, 2988), +(27967, '衡龙桥镇', 4, 2988); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(27968, '谢林港镇', 4, 2988), +(27969, '赫山街道', 4, 2988), +(27970, '金银山街道', 4, 2988), +(27971, '龙光桥镇', 4, 2988), +(27972, '万水乡', 4, 2989), +(27973, '三合乡', 4, 2989), +(27974, '南强乡', 4, 2989), +(27975, '双溪乡', 4, 2989), +(27976, '同益乡', 4, 2989), +(27977, '土地乡', 4, 2989), +(27978, '城关镇', 4, 2989), +(27979, '大冲乡', 4, 2989), +(27980, '岚桥镇', 4, 2989), +(27981, '广宜乡', 4, 2989), +(27982, '接龙乡', 4, 2989), +(27983, '楚江乡', 4, 2989), +(27984, '武水镇', 4, 2989), +(27985, '武源乡', 4, 2989), +(27986, '水东乡', 4, 2989), +(27987, '汾市乡', 4, 2989), +(27988, '花塘乡', 4, 2989), +(27989, '西山瑶族乡', 4, 2989), +(27990, '金江镇', 4, 2989), +(27991, '镇南乡', 4, 2989), +(27992, '香花岭镇', 4, 2989), +(27993, '麦市乡', 4, 2989), +(27994, '万华岩镇', 4, 2990), +(27995, '下湄桥街道', 4, 2990), +(27996, '人民路街道', 4, 2990), +(27997, '保和乡', 4, 2990), +(27998, '北湖街道', 4, 2990), +(27999, '华塘镇', 4, 2990), +(28000, '南溪乡', 4, 2990), +(28001, '同和乡', 4, 2990), +(28002, '大塘瑶族乡', 4, 2990), +(28003, '市郊乡', 4, 2990), +(28004, '月峰瑶族乡', 4, 2990), +(28005, '永春乡', 4, 2990), +(28006, '江口乡', 4, 2990), +(28007, '燕泉街道', 4, 2990), +(28008, '石盖塘镇', 4, 2990), +(28009, '芙蓉乡', 4, 2990), +(28010, '郴江镇', 4, 2990), +(28011, '鲁塘镇', 4, 2990), +(28012, '坦坪乡', 4, 2991), +(28013, '城关镇', 4, 2991), +(28014, '塘村镇', 4, 2991), +(28015, '广发乡', 4, 2991), +(28016, '普满乡', 4, 2991), +(28017, '泮头乡', 4, 2991), +(28018, '田心乡', 4, 2991), +(28019, '盘江乡', 4, 2991), +(28020, '石桥镇', 4, 2991), +(28021, '石羔乡', 4, 2991), +(28022, '肖家镇', 4, 2991), +(28023, '莲荷乡', 4, 2991), +(28024, '行廊镇', 4, 2991), +(28025, '袁家镇', 4, 2991), +(28026, '车头镇', 4, 2991), +(28027, '钟水乡', 4, 2991), +(28028, '龙潭镇', 4, 2991), +(28029, '关王镇', 4, 2992), +(28030, '军山乡', 4, 2992), +(28031, '华王乡', 4, 2992); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28032, '坪上乡', 4, 2992), +(28033, '城关镇', 4, 2992), +(28034, '安平镇', 4, 2992), +(28035, '平背乡', 4, 2992), +(28036, '承坪乡', 4, 2992), +(28037, '排山乡', 4, 2992), +(28038, '新洲乡', 4, 2992), +(28039, '洋际乡', 4, 2992), +(28040, '清溪镇', 4, 2992), +(28041, '渡口乡', 4, 2992), +(28042, '灵官镇', 4, 2992), +(28043, '牌楼乡', 4, 2992), +(28044, '禾市乡', 4, 2992), +(28045, '竹山乡', 4, 2992), +(28046, '羊脑乡', 4, 2992), +(28047, '豪山乡', 4, 2992), +(28048, '龙市乡', 4, 2992), +(28049, '龙海镇', 4, 2992), +(28050, '一六镇', 4, 2993), +(28051, '东风乡', 4, 2993), +(28052, '关溪乡', 4, 2993), +(28053, '城关镇', 4, 2993), +(28054, '城南乡', 4, 2993), +(28055, '天塘乡', 4, 2993), +(28056, '太平里乡', 4, 2993), +(28057, '岩泉镇', 4, 2993), +(28058, '平和乡', 4, 2993), +(28059, '新华乡', 4, 2993), +(28060, '杨梅山镇', 4, 2993), +(28061, '栗源镇', 4, 2993), +(28062, '梅田镇', 4, 2993), +(28063, '沙坪乡', 4, 2993), +(28064, '浆水乡', 4, 2993), +(28065, '瑶岗仙镇', 4, 2993), +(28066, '白沙圩乡', 4, 2993), +(28067, '白石渡镇', 4, 2993), +(28068, '笆篱乡', 4, 2993), +(28069, '莽山瑶族乡', 4, 2993), +(28070, '赤石乡', 4, 2993), +(28071, '迎春镇', 4, 2993), +(28072, '里田乡', 4, 2993), +(28073, '长村乡', 4, 2993), +(28074, '长策乡', 4, 2993), +(28075, '麻田镇', 4, 2993), +(28076, '黄沙镇', 4, 2993), +(28077, '三洞乡', 4, 2994), +(28078, '东洛乡', 4, 2994), +(28079, '四都乡', 4, 2994), +(28080, '城关镇', 4, 2994), +(28081, '增口乡', 4, 2994), +(28082, '大塘乡', 4, 2994), +(28083, '大水乡', 4, 2994), +(28084, '寒口乡', 4, 2994), +(28085, '寨前乡', 4, 2994), +(28086, '新坊乡', 4, 2994), +(28087, '普乐乡', 4, 2994), +(28088, '桥头乡', 4, 2994), +(28089, '沙田镇', 4, 2994), +(28090, '流源乡', 4, 2994), +(28091, '清泉镇', 4, 2994), +(28092, '贝溪乡', 4, 2994), +(28093, '青山乡', 4, 2994), +(28094, '黄洞乡', 4, 2994), +(28095, '东城乡', 4, 2995), +(28096, '仁义镇', 4, 2995); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28097, '余田乡', 4, 2995), +(28098, '光明乡', 4, 2995), +(28099, '六合乡', 4, 2995), +(28100, '十字乡', 4, 2995), +(28101, '华山瑶族乡', 4, 2995), +(28102, '华泉乡', 4, 2995), +(28103, '古楼乡', 4, 2995), +(28104, '和平镇', 4, 2995), +(28105, '四里乡', 4, 2995), +(28106, '团结乡', 4, 2995), +(28107, '城关镇', 4, 2995), +(28108, '城郊乡', 4, 2995), +(28109, '塘市镇', 4, 2995), +(28110, '太和镇', 4, 2995), +(28111, '敖泉镇', 4, 2995), +(28112, '方元镇', 4, 2995), +(28113, '杨柳瑶族乡', 4, 2995), +(28114, '板桥乡', 4, 2995), +(28115, '桥市乡', 4, 2995), +(28116, '樟市镇', 4, 2995), +(28117, '樟木乡', 4, 2995), +(28118, '欧阳海乡', 4, 2995), +(28119, '正和乡', 4, 2995), +(28120, '泗洲乡', 4, 2995), +(28121, '洋市镇', 4, 2995), +(28122, '流峰镇', 4, 2995), +(28123, '浩塘乡', 4, 2995), +(28124, '清和乡', 4, 2995), +(28125, '燕塘乡', 4, 2995), +(28126, '白水乡', 4, 2995), +(28127, '荷叶镇', 4, 2995), +(28128, '莲塘镇', 4, 2995), +(28129, '银河乡', 4, 2995), +(28130, '雷坪乡', 4, 2995), +(28131, '青兰乡', 4, 2995), +(28132, '飞仙镇', 4, 2995), +(28133, '黄沙坪镇', 4, 2995), +(28134, '七甲乡', 4, 2996), +(28135, '三塘乡', 4, 2996), +(28136, '千冲乡', 4, 2996), +(28137, '城关镇', 4, 2996), +(28138, '城郊乡', 4, 2996), +(28139, '塘门口镇', 4, 2996), +(28140, '复和乡', 4, 2996), +(28141, '大布江乡', 4, 2996), +(28142, '太和乡', 4, 2996), +(28143, '悦来乡', 4, 2996), +(28144, '柏林镇', 4, 2996), +(28145, '樟树乡', 4, 2996), +(28146, '油市镇', 4, 2996), +(28147, '油麻乡', 4, 2996), +(28148, '洋塘乡', 4, 2996), +(28149, '洞口乡', 4, 2996), +(28150, '湘阴渡镇', 4, 2996), +(28151, '碧塘乡', 4, 2996), +(28152, '金龟镇', 4, 2996), +(28153, '香梅乡', 4, 2996), +(28154, '马田镇', 4, 2996), +(28155, '高亭乡', 4, 2996), +(28156, '鲤鱼塘镇', 4, 2996), +(28157, '黄泥乡', 4, 2996), +(28158, '龙形市乡', 4, 2996), +(28159, '三星镇', 4, 2997), +(28160, '三江口镇', 4, 2997), +(28161, '井坡乡', 4, 2997); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28162, '南洞乡', 4, 2997), +(28163, '土桥镇', 4, 2997), +(28164, '城关镇', 4, 2997), +(28165, '城郊乡', 4, 2997), +(28166, '外沙乡', 4, 2997), +(28167, '大坪镇', 4, 2997), +(28168, '小垣镇', 4, 2997), +(28169, '岭秀瑶族乡', 4, 2997), +(28170, '延寿瑶族乡', 4, 2997), +(28171, '文明乡', 4, 2997), +(28172, '暖水镇', 4, 2997), +(28173, '永丰乡', 4, 2997), +(28174, '濠头乡', 4, 2997), +(28175, '热水镇', 4, 2997), +(28176, '田庄乡', 4, 2997), +(28177, '盈洞瑶族乡', 4, 2997), +(28178, '益将乡', 4, 2997), +(28179, '附城乡', 4, 2997), +(28180, '集龙乡', 4, 2997), +(28181, '马桥乡', 4, 2997), +(28182, '五里牌镇', 4, 2998), +(28183, '南塔街道', 4, 2998), +(28184, '坳上镇', 4, 2998), +(28185, '塘溪乡', 4, 2998), +(28186, '大奎上乡', 4, 2998), +(28187, '太平乡', 4, 2998), +(28188, '岗脚乡', 4, 2998), +(28189, '廖家湾乡', 4, 2998), +(28190, '廖王坪乡', 4, 2998), +(28191, '栖凤渡镇', 4, 2998), +(28192, '桥口镇', 4, 2998), +(28193, '白露塘镇', 4, 2998), +(28194, '白鹿洞镇', 4, 2998), +(28195, '良田镇', 4, 2998), +(28196, '苏仙岭街道', 4, 2998), +(28197, '荷叶坪乡', 4, 2998), +(28198, '许家洞镇', 4, 2998), +(28199, '邓家塘乡', 4, 2998), +(28200, '马头岭乡', 4, 2998), +(28201, '七里镇', 4, 2999), +(28202, '三都镇', 4, 2999), +(28203, '东坪乡', 4, 2999), +(28204, '东江镇', 4, 2999), +(28205, '何家山乡', 4, 2999), +(28206, '兰市乡', 4, 2999), +(28207, '兴宁镇', 4, 2999), +(28208, '唐洞街道', 4, 2999), +(28209, '团结瑶族乡', 4, 2999), +(28210, '坪石乡', 4, 2999), +(28211, '州门司镇', 4, 2999), +(28212, '彭市乡', 4, 2999), +(28213, '汤市乡', 4, 2999), +(28214, '波水乡', 4, 2999), +(28215, '清江乡', 4, 2999), +(28216, '滁口镇', 4, 2999), +(28217, '烟坪乡', 4, 2999), +(28218, '白廊乡', 4, 2999), +(28219, '皮石乡', 4, 2999), +(28220, '碑记乡', 4, 2999), +(28221, '蓼江镇', 4, 2999), +(28222, '连坪瑶族乡', 4, 2999), +(28223, '青腰镇', 4, 2999), +(28224, '香花乡', 4, 2999); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28225, '高码乡', 4, 2999), +(28226, '鲤鱼江镇', 4, 2999), +(28227, '黄草镇', 4, 2999), +(28228, '龙溪乡', 4, 2999), +(28229, '井头圩镇', 4, 3000), +(28230, '南桥镇', 4, 3000), +(28231, '大庙口镇', 4, 3000), +(28232, '大江口乡', 4, 3000), +(28233, '大盛镇', 4, 3000), +(28234, '川岩乡', 4, 3000), +(28235, '新圩江镇', 4, 3000), +(28236, '横塘镇', 4, 3000), +(28237, '水岭乡', 4, 3000), +(28238, '白牙市镇', 4, 3000), +(28239, '石期市镇', 4, 3000), +(28240, '端桥铺镇', 4, 3000), +(28241, '紫溪市镇', 4, 3000), +(28242, '芦洪市镇', 4, 3000), +(28243, '花桥镇', 4, 3000), +(28244, '鹿马桥镇', 4, 3000), +(28245, '上岭桥镇', 4, 3001), +(28246, '仁湾镇', 4, 3001), +(28247, '伊塘镇', 4, 3001), +(28248, '凤凰街道', 4, 3001), +(28249, '岚角山镇', 4, 3001), +(28250, '普利桥镇', 4, 3001), +(28251, '杨家桥街道', 4, 3001), +(28252, '杨村甸乡', 4, 3001), +(28253, '梅湾街道', 4, 3001), +(28254, '梧桐街道', 4, 3001), +(28255, '牛角坝镇', 4, 3001), +(28256, '珊瑚乡', 4, 3001), +(28257, '竹山桥镇', 4, 3001), +(28258, '肖家园街道', 4, 3001), +(28259, '花桥街镇', 4, 3001), +(28260, '菱角山街道', 4, 3001), +(28261, '蔡市镇', 4, 3001), +(28262, '高溪市镇', 4, 3001), +(28263, '黄阳司镇', 4, 3001), +(28264, '上梧江瑶族乡', 4, 3002), +(28265, '五里牌镇', 4, 3002), +(28266, '何家洞乡', 4, 3002), +(28267, '塘底乡', 4, 3002), +(28268, '尚仁里乡', 4, 3002), +(28269, '平福头乡', 4, 3002), +(28270, '永江乡', 4, 3002), +(28271, '江村镇', 4, 3002), +(28272, '泷泊镇', 4, 3002), +(28273, '理家坪乡', 4, 3002), +(28274, '茶林乡', 4, 3002), +(28275, '麻江乡', 4, 3002), +(28276, '中和镇', 4, 3003), +(28277, '九嶷瑶族乡', 4, 3003), +(28278, '仁和镇', 4, 3003), +(28279, '保安乡', 4, 3003), +(28280, '冷水镇', 4, 3003), +(28281, '天堂镇', 4, 3003), +(28282, '太平镇', 4, 3003), +(28283, '柘家坪镇', 4, 3003), +(28284, '桐木漯瑶族乡', 4, 3003), +(28285, '棉花坪瑶族乡', 4, 3003); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28286, '水市镇', 4, 3003), +(28287, '清水桥镇', 4, 3003), +(28288, '湾井镇', 4, 3003), +(28289, '禾亭镇', 4, 3003), +(28290, '舜陵镇', 4, 3003), +(28291, '荒塘瑶族乡', 4, 3003), +(28292, '鲤溪镇', 4, 3003), +(28293, '三井乡', 4, 3004), +(28294, '冷水井乡', 4, 3004), +(28295, '十字乡', 4, 3004), +(28296, '大坪塘乡', 4, 3004), +(28297, '新圩镇', 4, 3004), +(28298, '新隆镇', 4, 3004), +(28299, '枧头镇', 4, 3004), +(28300, '毛里乡', 4, 3004), +(28301, '知市坪乡', 4, 3004), +(28302, '石羊镇', 4, 3004), +(28303, '茂家乡', 4, 3004), +(28304, '莲花乡', 4, 3004), +(28305, '金盆圩乡', 4, 3004), +(28306, '金陵镇', 4, 3004), +(28307, '门楼下瑶族乡', 4, 3004), +(28308, '陶岭乡', 4, 3004), +(28309, '骥村镇', 4, 3004), +(28310, '高山乡', 4, 3004), +(28311, '龙泉镇', 4, 3004), +(28312, '东田镇', 4, 3005), +(28313, '两岔河乡', 4, 3005), +(28314, '务江乡', 4, 3005), +(28315, '大圩镇', 4, 3005), +(28316, '大石桥乡', 4, 3005), +(28317, '大路铺镇', 4, 3005), +(28318, '大锡乡', 4, 3005), +(28319, '小圩镇', 4, 3005), +(28320, '未竹口乡', 4, 3005), +(28321, '桥头铺镇', 4, 3005), +(28322, '桥市乡', 4, 3005), +(28323, '水口镇', 4, 3005), +(28324, '沱江镇', 4, 3005), +(28325, '河路口镇', 4, 3005), +(28326, '涛圩镇', 4, 3005), +(28327, '清塘壮族乡', 4, 3005), +(28328, '湘江乡', 4, 3005), +(28329, '界牌乡', 4, 3005), +(28330, '白芒营镇', 4, 3005), +(28331, '码市镇', 4, 3005), +(28332, '花江乡', 4, 3005), +(28333, '贝江乡', 4, 3005), +(28334, '上江圩镇', 4, 3006), +(28335, '允山镇', 4, 3006), +(28336, '兰溪瑶族乡', 4, 3006), +(28337, '千家峒瑶族乡', 4, 3006), +(28338, '夏层铺镇', 4, 3006), +(28339, '松柏瑶族乡', 4, 3006), +(28340, '桃川镇', 4, 3006), +(28341, '源口瑶族乡', 4, 3006), +(28342, '潇浦镇', 4, 3006), +(28343, '粗石江镇', 4, 3006), +(28344, '回龙圩镇', 4, 3006), +(28345, '黄甲岭乡', 4, 3006), +(28346, '七里桥镇', 4, 3007), +(28347, '三口塘镇', 4, 3007); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28348, '上司源乡', 4, 3007), +(28349, '下马渡镇', 4, 3007), +(28350, '八宝镇', 4, 3007), +(28351, '凤凰乡', 4, 3007), +(28352, '大忠桥镇', 4, 3007), +(28353, '大村甸镇', 4, 3007), +(28354, '小金洞乡', 4, 3007), +(28355, '文富市镇', 4, 3007), +(28356, '文明镇', 4, 3007), +(28357, '晒北滩瑶族乡', 4, 3007), +(28358, '梅溪镇', 4, 3007), +(28359, '浯溪镇', 4, 3007), +(28360, '潘市镇', 4, 3007), +(28361, '白果市乡', 4, 3007), +(28362, '白水镇', 4, 3007), +(28363, '石鼓源乡', 4, 3007), +(28364, '羊角塘镇', 4, 3007), +(28365, '肖家村镇', 4, 3007), +(28366, '茅竹镇', 4, 3007), +(28367, '观音滩镇', 4, 3007), +(28368, '进宝塘镇', 4, 3007), +(28369, '金洞镇', 4, 3007), +(28370, '黄泥塘镇', 4, 3007), +(28371, '黎家坪镇', 4, 3007), +(28372, '龚家坪镇', 4, 3007), +(28373, '土市乡', 4, 3008), +(28374, '塔峰镇', 4, 3008), +(28375, '大桥瑶族乡', 4, 3008), +(28376, '太平圩乡', 4, 3008), +(28377, '所城镇', 4, 3008), +(28378, '新圩镇', 4, 3008), +(28379, '楠市镇', 4, 3008), +(28380, '毛俊镇', 4, 3008), +(28381, '汇源瑶族乡', 4, 3008), +(28382, '浆洞瑶族乡', 4, 3008), +(28383, '犁头瑶族乡', 4, 3008), +(28384, '祠堂圩乡', 4, 3008), +(28385, '竹管寺镇', 4, 3008), +(28386, '紫良瑶族乡', 4, 3008), +(28387, '荆竹瑶族乡', 4, 3008), +(28388, '万家庄乡', 4, 3009), +(28389, '上关乡', 4, 3009), +(28390, '东门乡', 4, 3009), +(28391, '乐福堂乡', 4, 3009), +(28392, '井塘瑶族乡', 4, 3009), +(28393, '仙子脚镇', 4, 3009), +(28394, '四马桥镇', 4, 3009), +(28395, '审章塘瑶族乡', 4, 3009), +(28396, '富塘乡', 4, 3009), +(28397, '寿雁镇', 4, 3009), +(28398, '新车乡', 4, 3009), +(28399, '柑子园乡', 4, 3009), +(28400, '桥头乡', 4, 3009), +(28401, '梅花镇', 4, 3009), +(28402, '横岭瑶族乡', 4, 3009), +(28403, '洪塘营瑶族乡', 4, 3009), +(28404, '清塘镇', 4, 3009), +(28405, '白芒铺乡', 4, 3009), +(28406, '白马渡镇', 4, 3009), +(28407, '祥霖铺镇', 4, 3009), +(28408, '营江乡', 4, 3009); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28409, '蚣坝镇', 4, 3009), +(28410, '道江镇', 4, 3009), +(28411, '七里店街道', 4, 3010), +(28412, '凼底乡', 4, 3010), +(28413, '南津渡街道', 4, 3010), +(28414, '大庆坪乡', 4, 3010), +(28415, '富家桥镇', 4, 3010), +(28416, '徐家井街道', 4, 3010), +(28417, '接履桥镇', 4, 3010), +(28418, '朝阳街道', 4, 3010), +(28419, '梳子铺乡', 4, 3010), +(28420, '水口山镇', 4, 3010), +(28421, '珠山镇', 4, 3010), +(28422, '石山脚乡', 4, 3010), +(28423, '石岩头镇', 4, 3010), +(28424, '菱角塘镇', 4, 3010), +(28425, '邮亭圩镇', 4, 3010), +(28426, '黄田铺镇', 4, 3010), +(28427, '丁家乡', 4, 3011), +(28428, '下坪乡', 4, 3011), +(28429, '中方镇', 4, 3011), +(28430, '接龙乡', 4, 3011), +(28431, '新建乡', 4, 3011), +(28432, '新路河乡', 4, 3011), +(28433, '桐木镇', 4, 3011), +(28434, '泸阳镇', 4, 3011), +(28435, '活水乡', 4, 3011), +(28436, '炉亭坳乡', 4, 3011), +(28437, '牌楼坳镇', 4, 3011), +(28438, '石宝乡', 4, 3011), +(28439, '聂家村乡', 4, 3011), +(28440, '花桥镇', 4, 3011), +(28441, '蒋家乡', 4, 3011), +(28442, '蒿吉坪瑶族乡', 4, 3011), +(28443, '袁家乡', 4, 3011), +(28444, '铁坡镇', 4, 3011), +(28445, '铜湾镇', 4, 3011), +(28446, '铜鼎乡', 4, 3011), +(28447, '锦溪乡', 4, 3011), +(28448, '龙场乡', 4, 3011), +(28449, '团河镇', 4, 3012), +(28450, '地灵乡', 4, 3012), +(28451, '坪村镇', 4, 3012), +(28452, '堡子镇', 4, 3012), +(28453, '宝田侗族苗族乡', 4, 3012), +(28454, '岩头乡', 4, 3012), +(28455, '广坪镇', 4, 3012), +(28456, '朗江镇', 4, 3012), +(28457, '林城镇', 4, 3012), +(28458, '沙溪乡', 4, 3012), +(28459, '洒溪乡', 4, 3012), +(28460, '漠滨侗族苗族乡', 4, 3012), +(28461, '炮团侗族苗族乡', 4, 3012), +(28462, '王家坪乡', 4, 3012), +(28463, '若水镇', 4, 3012), +(28464, '萧家乡', 4, 3012), +(28465, '蒲稳侗族苗族乡', 4, 3012), +(28466, '连山乡', 4, 3012), +(28467, '金子岩侗族苗族乡', 4, 3012), +(28468, '金龙乡', 4, 3012), +(28469, '长寨乡', 4, 3012); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28470, '青朗侗族苗族乡', 4, 3012), +(28471, '马鞍镇', 4, 3012), +(28472, '高椅乡', 4, 3012), +(28473, '黄茅乡', 4, 3012), +(28474, '中寨镇', 4, 3013), +(28475, '兴隆镇', 4, 3013), +(28476, '凉伞镇', 4, 3013), +(28477, '凳寨乡', 4, 3013), +(28478, '大湾罗乡', 4, 3013), +(28479, '天堂乡', 4, 3013), +(28480, '扶罗镇', 4, 3013), +(28481, '新寨乡', 4, 3013), +(28482, '新晃镇', 4, 3013), +(28483, '方家屯乡', 4, 3013), +(28484, '晏家乡', 4, 3013), +(28485, '李树乡', 4, 3013), +(28486, '林冲乡', 4, 3013), +(28487, '步头降苗族乡', 4, 3013), +(28488, '波洲镇', 4, 3013), +(28489, '洞坪乡', 4, 3013), +(28490, '碧朗乡', 4, 3013), +(28491, '禾滩乡', 4, 3013), +(28492, '米贝苗族乡', 4, 3013), +(28493, '茶坪乡', 4, 3013), +(28494, '贡溪乡', 4, 3013), +(28495, '鱼市镇', 4, 3013), +(28496, '黄雷乡', 4, 3013), +(28497, '七甲坪镇', 4, 3014), +(28498, '二酉苗族乡', 4, 3014), +(28499, '五强溪镇', 4, 3014), +(28500, '借母溪乡', 4, 3014), +(28501, '凉水井镇', 4, 3014), +(28502, '北溶乡', 4, 3014), +(28503, '大合坪乡', 4, 3014), +(28504, '太常乡', 4, 3014), +(28505, '官庄镇', 4, 3014), +(28506, '明溪口镇', 4, 3014), +(28507, '杜家坪乡', 4, 3014), +(28508, '楠木铺乡', 4, 3014), +(28509, '沅陵镇', 4, 3014), +(28510, '深溪口乡', 4, 3014), +(28511, '清浪乡', 4, 3014), +(28512, '火场土家族乡', 4, 3014), +(28513, '盘古乡', 4, 3014), +(28514, '筲箕湾镇', 4, 3014), +(28515, '荔溪乡', 4, 3014), +(28516, '萧家桥乡', 4, 3014), +(28517, '陈家滩乡', 4, 3014), +(28518, '马底驿乡', 4, 3014), +(28519, '麻溪铺镇', 4, 3014), +(28520, '双溪镇', 4, 3015), +(28521, '土溪乡', 4, 3015), +(28522, '塘湾镇', 4, 3015), +(28523, '大崇乡', 4, 3015), +(28524, '太平乡', 4, 3015), +(28525, '安江镇', 4, 3015), +(28526, '岔头乡', 4, 3015), +(28527, '岩垅乡', 4, 3015), +(28528, '常青乡', 4, 3015), +(28529, '托口镇', 4, 3015), +(28530, '新街街道', 4, 3015), +(28531, '桂花园乡', 4, 3015), +(28532, '横岩乡', 4, 3015); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28533, '江市镇', 4, 3015), +(28534, '沅江路街道', 4, 3015), +(28535, '沅河镇', 4, 3015), +(28536, '沙湾乡', 4, 3015), +(28537, '河滨路街道', 4, 3015), +(28538, '洗马乡', 4, 3015), +(28539, '深渡苗族乡', 4, 3015), +(28540, '湾溪乡', 4, 3015), +(28541, '熟坪乡', 4, 3015), +(28542, '硖州乡', 4, 3015), +(28543, '红岩乡', 4, 3015), +(28544, '群峰乡', 4, 3015), +(28545, '茅渡乡', 4, 3015), +(28546, '铁山乡', 4, 3015), +(28547, '雪峰镇', 4, 3015), +(28548, '高坡街街道', 4, 3015), +(28549, '黔城镇', 4, 3015), +(28550, '龙田乡', 4, 3015), +(28551, '龙船塘瑶族乡', 4, 3015), +(28552, '两丫坪镇', 4, 3016), +(28553, '两江乡', 4, 3016), +(28554, '中都乡', 4, 3016), +(28555, '九溪江乡', 4, 3016), +(28556, '仲夏乡', 4, 3016), +(28557, '低庄镇', 4, 3016), +(28558, '北斗溪乡', 4, 3016), +(28559, '卢峰镇', 4, 3016), +(28560, '双井镇', 4, 3016), +(28561, '善溪乡', 4, 3016), +(28562, '均坪镇', 4, 3016), +(28563, '大华乡', 4, 3016), +(28564, '大渭溪乡', 4, 3016), +(28565, '小横垅乡', 4, 3016), +(28566, '小江口乡', 4, 3016), +(28567, '岗东乡', 4, 3016), +(28568, '岩家垅乡', 4, 3016), +(28569, '思蒙乡', 4, 3016), +(28570, '新田乡', 4, 3016), +(28571, '木溪乡', 4, 3016), +(28572, '桐木溪乡', 4, 3016), +(28573, '桥江镇', 4, 3016), +(28574, '横板桥乡', 4, 3016), +(28575, '水东镇', 4, 3016), +(28576, '水田庄乡', 4, 3016), +(28577, '水隘乡', 4, 3016), +(28578, '江口镇', 4, 3016), +(28579, '油洋乡', 4, 3016), +(28580, '沿溪乡', 4, 3016), +(28581, '洑水湾乡', 4, 3016), +(28582, '温水乡', 4, 3016), +(28583, '祖市殿镇', 4, 3016), +(28584, '统溪河乡', 4, 3016), +(28585, '舒溶溪乡', 4, 3016), +(28586, '葛竹坪镇', 4, 3016), +(28587, '观音阁镇', 4, 3016), +(28588, '让家溪乡', 4, 3016), +(28589, '谭家湾镇', 4, 3016), +(28590, '陶金坪乡', 4, 3016), +(28591, '黄茅园镇', 4, 3016), +(28592, '龙庄湾乡', 4, 3016), +(28593, '龙潭镇', 4, 3016), +(28594, '龙王江乡', 4, 3016), +(28595, '上坪乡', 4, 3017); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28596, '五郎溪乡', 4, 3017), +(28597, '公坪镇', 4, 3017), +(28598, '冷水溪乡', 4, 3017), +(28599, '土桥乡', 4, 3017), +(28600, '大树坳乡', 4, 3017), +(28601, '大洪山乡', 4, 3017), +(28602, '大龙乡', 4, 3017), +(28603, '岩桥乡', 4, 3017), +(28604, '新店坪镇', 4, 3017), +(28605, '晓坪乡', 4, 3017), +(28606, '木叶溪乡', 4, 3017), +(28607, '杨公庙乡', 4, 3017), +(28608, '板山乡', 4, 3017), +(28609, '梨溪口乡', 4, 3017), +(28610, '楠木坪乡', 4, 3017), +(28611, '水宽乡', 4, 3017), +(28612, '洞下场乡', 4, 3017), +(28613, '牛牯坪乡', 4, 3017), +(28614, '碧涌镇', 4, 3017), +(28615, '禾梨坳乡', 4, 3017), +(28616, '竹坪铺乡', 4, 3017), +(28617, '罗岩乡', 4, 3017), +(28618, '罗旧镇', 4, 3017), +(28619, '艾头坪乡', 4, 3017), +(28620, '芷江镇', 4, 3017), +(28621, '萝卜田乡', 4, 3017), +(28622, '麻缨塘乡', 4, 3017), +(28623, '上蒲溪瑶族乡', 4, 3018), +(28624, '仙人湾瑶族乡', 4, 3018), +(28625, '伍家湾乡', 4, 3018), +(28626, '修溪乡', 4, 3018), +(28627, '后塘瑶族乡', 4, 3018), +(28628, '城郊乡', 4, 3018), +(28629, '大水田乡', 4, 3018), +(28630, '孝坪镇', 4, 3018), +(28631, '安坪镇', 4, 3018), +(28632, '寺前镇', 4, 3018), +(28633, '小龙门乡', 4, 3018), +(28634, '板桥乡', 4, 3018), +(28635, '柿溪乡', 4, 3018), +(28636, '桥头乡', 4, 3018), +(28637, '桥头溪乡', 4, 3018), +(28638, '潭湾镇', 4, 3018), +(28639, '火马冲镇', 4, 3018), +(28640, '田湾镇', 4, 3018), +(28641, '石碧乡', 4, 3018), +(28642, '石马湾乡', 4, 3018), +(28643, '罗子山瑶族乡', 4, 3018), +(28644, '船溪乡', 4, 3018), +(28645, '苏木溪瑶族乡', 4, 3018), +(28646, '谭家场乡', 4, 3018), +(28647, '辰阳镇', 4, 3018), +(28648, '锦滨乡', 4, 3018), +(28649, '长田湾乡', 4, 3018), +(28650, '黄溪口镇', 4, 3018), +(28651, '龙头庵乡', 4, 3018), +(28652, '龙泉岩乡', 4, 3018), +(28653, '下乡乡', 4, 3019), +(28654, '临口镇', 4, 3019), +(28655, '传素瑶族乡', 4, 3019), +(28656, '县溪镇', 4, 3019); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28657, '双江镇', 4, 3019), +(28658, '坪坦乡', 4, 3019), +(28659, '坪阳乡', 4, 3019), +(28660, '大高坪苗族乡', 4, 3019), +(28661, '戈冲苗族乡', 4, 3019), +(28662, '播阳镇', 4, 3019), +(28663, '木脚乡', 4, 3019), +(28664, '杉木桥乡', 4, 3019), +(28665, '江口乡', 4, 3019), +(28666, '溪口镇', 4, 3019), +(28667, '牙屯堡镇', 4, 3019), +(28668, '独坡乡', 4, 3019), +(28669, '甘溪乡', 4, 3019), +(28670, '菁芜洲镇', 4, 3019), +(28671, '陇城镇', 4, 3019), +(28672, '马龙乡', 4, 3019), +(28673, '黄土乡', 4, 3019), +(28674, '三锹乡', 4, 3020), +(28675, '坳上镇', 4, 3020), +(28676, '大堡子镇', 4, 3020), +(28677, '太阳坪乡', 4, 3020), +(28678, '寨牙乡', 4, 3020), +(28679, '平茶镇', 4, 3020), +(28680, '文溪乡', 4, 3020), +(28681, '新厂镇', 4, 3020), +(28682, '横江桥乡', 4, 3020), +(28683, '渠阳镇', 4, 3020), +(28684, '甘棠镇', 4, 3020), +(28685, '藕团乡', 4, 3020), +(28686, '铺口乡', 4, 3020), +(28687, '凉亭坳乡', 4, 3021), +(28688, '坨院街道', 4, 3021), +(28689, '城中街道', 4, 3021), +(28690, '城北街道', 4, 3021), +(28691, '杨村乡', 4, 3021), +(28692, '盈口乡', 4, 3021), +(28693, '石门乡', 4, 3021), +(28694, '红星街道', 4, 3021), +(28695, '芦坪乡', 4, 3021), +(28696, '贺家田乡', 4, 3021), +(28697, '迎丰街道', 4, 3021), +(28698, '鸭嘴岩镇', 4, 3021), +(28699, '黄金坳镇', 4, 3021), +(28700, '兰村乡', 4, 3022), +(28701, '兰里镇', 4, 3022), +(28702, '吕家坪镇', 4, 3022), +(28703, '和坪溪乡', 4, 3022), +(28704, '大桥江乡', 4, 3022), +(28705, '尧市乡', 4, 3022), +(28706, '岩门镇', 4, 3022), +(28707, '拖冲乡', 4, 3022), +(28708, '文昌阁乡', 4, 3022), +(28709, '板栗树乡', 4, 3022), +(28710, '栗坪乡', 4, 3022), +(28711, '江口墟镇', 4, 3022), +(28712, '石羊哨乡', 4, 3022), +(28713, '绿溪口乡', 4, 3022), +(28714, '舒家村乡', 4, 3022), +(28715, '谭家寨乡', 4, 3022), +(28716, '谷达坡乡', 4, 3022), +(28717, '郭公坪乡', 4, 3022), +(28718, '锦和镇', 4, 3022), +(28719, '长潭乡', 4, 3022); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28720, '隆家堡乡', 4, 3022), +(28721, '高村镇', 4, 3022), +(28722, '黄桑乡', 4, 3022), +(28723, '三尖镇', 4, 3023), +(28724, '中连乡', 4, 3023), +(28725, '冷水江街道', 4, 3023), +(28726, '同兴乡', 4, 3023), +(28727, '岩口镇', 4, 3023), +(28728, '布溪街道', 4, 3023), +(28729, '梓龙乡', 4, 3023), +(28730, '毛易镇', 4, 3023), +(28731, '沙塘湾街道', 4, 3023), +(28732, '渣渡镇', 4, 3023), +(28733, '潘桥乡', 4, 3023), +(28734, '矿山乡', 4, 3023), +(28735, '禾青镇', 4, 3023), +(28736, '金竹山乡', 4, 3023), +(28737, '铎山镇', 4, 3023), +(28738, '锡矿山街道', 4, 3023), +(28739, '三塘铺镇', 4, 3024), +(28740, '井字镇', 4, 3024), +(28741, '印塘乡', 4, 3024), +(28742, '杏子铺镇', 4, 3024), +(28743, '梓门桥镇', 4, 3024), +(28744, '永丰镇', 4, 3024), +(28745, '沙塘乡', 4, 3024), +(28746, '洪山殿镇', 4, 3024), +(28747, '甘棠镇', 4, 3024), +(28748, '石牛乡', 4, 3024), +(28749, '花门镇', 4, 3024), +(28750, '荷叶镇', 4, 3024), +(28751, '蛇形山镇', 4, 3024), +(28752, '走马街镇', 4, 3024), +(28753, '锁石镇', 4, 3024), +(28754, '青树坪镇', 4, 3024), +(28755, '万宝镇', 4, 3025), +(28756, '乐坪街道', 4, 3025), +(28757, '双江乡', 4, 3025), +(28758, '大埠桥街道', 4, 3025), +(28759, '大科街道', 4, 3025), +(28760, '小碧乡', 4, 3025), +(28761, '杉山镇', 4, 3025), +(28762, '涟滨街道', 4, 3025), +(28763, '百亩乡', 4, 3025), +(28764, '石井乡', 4, 3025), +(28765, '花山街道', 4, 3025), +(28766, '茶园镇', 4, 3025), +(28767, '长青街道', 4, 3025), +(28768, '黄泥塘街道', 4, 3025), +(28769, '上梅镇', 4, 3026), +(28770, '吉庆镇', 4, 3026), +(28771, '圳上镇', 4, 3026), +(28772, '坐石乡', 4, 3026), +(28773, '天门乡', 4, 3026), +(28774, '奉家镇', 4, 3026), +(28775, '孟公镇', 4, 3026), +(28776, '文田镇', 4, 3026), +(28777, '曹家镇', 4, 3026), +(28778, '桑梓镇', 4, 3026), +(28779, '槎溪镇', 4, 3026), +(28780, '水车镇', 4, 3026), +(28781, '油溪乡', 4, 3026), +(28782, '洋溪镇', 4, 3026); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28783, '温塘镇', 4, 3026), +(28784, '游家镇', 4, 3026), +(28785, '炉观镇', 4, 3026), +(28786, '琅塘镇', 4, 3026), +(28787, '田坪镇', 4, 3026), +(28788, '白溪镇', 4, 3026), +(28789, '石冲口镇', 4, 3026), +(28790, '科头乡', 4, 3026), +(28791, '维山乡', 4, 3026), +(28792, '荣华乡', 4, 3026), +(28793, '西河镇', 4, 3026), +(28794, '金凤乡', 4, 3026), +(28795, '七星街镇', 4, 3027), +(28796, '三甲乡', 4, 3027), +(28797, '伏口镇', 4, 3027), +(28798, '六亩塘镇', 4, 3027), +(28799, '古塘乡', 4, 3027), +(28800, '安平镇', 4, 3027), +(28801, '斗笠山镇', 4, 3027), +(28802, '杨市镇', 4, 3027), +(28803, '枫坪镇', 4, 3027), +(28804, '桥头河镇', 4, 3027), +(28805, '水洞底镇', 4, 3027), +(28806, '渡头塘乡', 4, 3027), +(28807, '湄江镇', 4, 3027), +(28808, '白马镇', 4, 3027), +(28809, '石马山镇', 4, 3027), +(28810, '茅塘镇', 4, 3027), +(28811, '荷塘镇', 4, 3027), +(28812, '蓝田街道', 4, 3027), +(28813, '金石镇', 4, 3027), +(28814, '龙塘乡', 4, 3027), +(28815, '复兴镇', 4, 3028), +(28816, '大妥乡', 4, 3028), +(28817, '夯沙乡', 4, 3028), +(28818, '普戎镇', 4, 3028), +(28819, '比耳镇', 4, 3028), +(28820, '毛沟镇', 4, 3028), +(28821, '水田河镇', 4, 3028), +(28822, '水银乡', 4, 3028), +(28823, '涂乍乡', 4, 3028), +(28824, '清水乡', 4, 3028), +(28825, '清水坪镇', 4, 3028), +(28826, '碗米坡镇', 4, 3028), +(28827, '葫芦镇', 4, 3028), +(28828, '迁陵镇', 4, 3028), +(28829, '野竹坪镇', 4, 3028), +(28830, '阳朝乡', 4, 3028), +(28831, '三拱桥乡', 4, 3029), +(28832, '两林乡', 4, 3029), +(28833, '千工坪乡', 4, 3029), +(28834, '吉信镇', 4, 3029), +(28835, '官庄乡', 4, 3029), +(28836, '山江镇', 4, 3029), +(28837, '廖家桥镇', 4, 3029), +(28838, '新场乡', 4, 3029), +(28839, '木江坪镇', 4, 3029), +(28840, '木里乡', 4, 3029), +(28841, '林峰乡', 4, 3029), +(28842, '柳薄乡', 4, 3029), +(28843, '水打田乡', 4, 3029), +(28844, '沱江镇', 4, 3029), +(28845, '禾库镇', 4, 3029), +(28846, '竿子坪乡', 4, 3029); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28847, '米良乡', 4, 3029), +(28848, '腊尔山镇', 4, 3029), +(28849, '茨岩乡', 4, 3029), +(28850, '茶田镇', 4, 3029), +(28851, '落潮井乡', 4, 3029), +(28852, '都里乡', 4, 3029), +(28853, '阿拉营镇', 4, 3029), +(28854, '麻冲乡', 4, 3029), +(28855, '双溪乡', 4, 3030), +(28856, '古阳镇', 4, 3030), +(28857, '坪坝乡', 4, 3030), +(28858, '山枣乡', 4, 3030), +(28859, '岩头寨乡', 4, 3030), +(28860, '断龙山乡', 4, 3030), +(28861, '河蓬乡', 4, 3030), +(28862, '红石林镇', 4, 3030), +(28863, '罗依溪镇', 4, 3030), +(28864, '高峰乡', 4, 3030), +(28865, '高望界乡', 4, 3030), +(28866, '默戎镇', 4, 3030), +(28867, '丹青镇', 4, 3031), +(28868, '干州街道', 4, 3031), +(28869, '双塘镇', 4, 3031), +(28870, '太坪乡', 4, 3031), +(28871, '寨阳乡', 4, 3031), +(28872, '峒河街道', 4, 3031), +(28873, '已略乡', 4, 3031), +(28874, '排吼乡', 4, 3031), +(28875, '排绸乡', 4, 3031), +(28876, '河溪镇', 4, 3031), +(28877, '白岩乡', 4, 3031), +(28878, '矮寨镇', 4, 3031), +(28879, '石家冲街道', 4, 3031), +(28880, '社塘坡乡', 4, 3031), +(28881, '红旗门街道', 4, 3031), +(28882, '马颈坳镇', 4, 3031), +(28883, '万坪镇', 4, 3032), +(28884, '万民乡', 4, 3032), +(28885, '两岔乡', 4, 3032), +(28886, '列夕乡', 4, 3032), +(28887, '勺哈乡', 4, 3032), +(28888, '吊井乡', 4, 3032), +(28889, '回龙乡', 4, 3032), +(28890, '塔卧镇', 4, 3032), +(28891, '大坝乡', 4, 3032), +(28892, '对山乡', 4, 3032), +(28893, '小溪乡', 4, 3032), +(28894, '抚志乡', 4, 3032), +(28895, '朗溪乡', 4, 3032), +(28896, '松柏乡', 4, 3032), +(28897, '毛坝乡', 4, 3032), +(28898, '永茂镇', 4, 3032), +(28899, '泽家镇', 4, 3032), +(28900, '润雅乡', 4, 3032), +(28901, '灵溪镇', 4, 3032), +(28902, '王村镇', 4, 3032), +(28903, '盐井乡', 4, 3032), +(28904, '石堤镇', 4, 3032), +(28905, '砂坝镇', 4, 3032), +(28906, '西歧乡', 4, 3032), +(28907, '车坪乡', 4, 3032), +(28908, '长官镇', 4, 3032), +(28909, '青坪镇', 4, 3032), +(28910, '颗砂乡', 4, 3032); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28911, '首车镇', 4, 3032), +(28912, '高坪乡', 4, 3032), +(28913, '八什坪乡', 4, 3033), +(28914, '兴隆场镇', 4, 3033), +(28915, '合水镇', 4, 3033), +(28916, '小章乡', 4, 3033), +(28917, '梁家潭乡', 4, 3033), +(28918, '武溪镇', 4, 3033), +(28919, '永兴场乡', 4, 3033), +(28920, '洗溪镇', 4, 3033), +(28921, '浦市镇', 4, 3033), +(28922, '潭溪镇', 4, 3033), +(28923, '白沙镇', 4, 3033), +(28924, '白羊溪乡', 4, 3033), +(28925, '石榴坪乡', 4, 3033), +(28926, '解放岩乡', 4, 3033), +(28927, '达岚镇', 4, 3033), +(28928, '两河乡', 4, 3034), +(28929, '吉卫镇', 4, 3034), +(28930, '团结镇', 4, 3034), +(28931, '排吾乡', 4, 3034), +(28932, '排料乡', 4, 3034), +(28933, '排碧乡', 4, 3034), +(28934, '民乐镇', 4, 3034), +(28935, '猫儿乡', 4, 3034), +(28936, '花垣镇', 4, 3034), +(28937, '董马库乡', 4, 3034), +(28938, '补抽乡', 4, 3034), +(28939, '边城镇', 4, 3034), +(28940, '道二乡', 4, 3034), +(28941, '长乐乡', 4, 3034), +(28942, '雅桥乡', 4, 3034), +(28943, '雅酉镇', 4, 3034), +(28944, '麻栗场镇', 4, 3034), +(28945, '龙潭镇', 4, 3034), +(28946, '三元乡', 4, 3035), +(28947, '乌鸦乡', 4, 3035), +(28948, '他砂乡', 4, 3035), +(28949, '兴隆街乡', 4, 3035), +(28950, '内溪乡', 4, 3035), +(28951, '农车乡', 4, 3035), +(28952, '华塘街道', 4, 3035), +(28953, '召市镇', 4, 3035), +(28954, '咱果乡', 4, 3035), +(28955, '塔泥乡', 4, 3035), +(28956, '大安乡', 4, 3035), +(28957, '新城街道', 4, 3035), +(28958, '桂塘镇', 4, 3035), +(28959, '桶车乡', 4, 3035), +(28960, '民安街道', 4, 3035), +(28961, '水田坝乡', 4, 3035), +(28962, '洗洛乡', 4, 3035), +(28963, '洗车河镇', 4, 3035), +(28964, '洛塔乡', 4, 3035), +(28965, '湾塘乡', 4, 3035), +(28966, '猛必乡', 4, 3035), +(28967, '白羊乡', 4, 3035), +(28968, '石牌镇', 4, 3035), +(28969, '石羔镇', 4, 3035), +(28970, '红岩溪镇', 4, 3035), +(28971, '老兴乡', 4, 3035), +(28972, '苗儿滩镇', 4, 3035), +(28973, '茅坪乡', 4, 3035), +(28974, '茨岩塘镇', 4, 3035); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(28975, '贾坝乡', 4, 3035), +(28976, '贾市乡', 4, 3035), +(28977, '里耶镇', 4, 3035), +(28978, '隆头镇', 4, 3035), +(28979, '靛房镇', 4, 3035), +(28980, '夏港街道', 4, 3036), +(28981, '东区街道', 4, 3036), +(28982, '联和街道', 4, 3036), +(28983, '萝岗街道', 4, 3036), +(28984, '九佛片区', 4, 3036), +(28985, '镇龙片区', 4, 3036), +(28986, '永和片区', 4, 3036), +(28987, '南沙街道', 4, 3037), +(28988, '万项沙镇', 4, 3037), +(28989, '黄阁镇', 4, 3037), +(28990, '横沥镇', 4, 3037), +(28991, '吕田镇', 4, 3038), +(28992, '城郊街道', 4, 3038), +(28993, '太平镇', 4, 3038), +(28994, '江埔街道', 4, 3038), +(28995, '温泉镇', 4, 3038), +(28996, '良口镇', 4, 3038), +(28997, '街口街道', 4, 3038), +(28998, '鳌头镇', 4, 3038), +(28999, '中新镇', 4, 3039), +(29000, '增江街道', 4, 3039), +(29001, '小楼镇', 4, 3039), +(29002, '新塘镇', 4, 3039), +(29003, '朱村街道', 4, 3039), +(29004, '正果镇', 4, 3039), +(29005, '派潭镇', 4, 3039), +(29006, '石滩镇', 4, 3039), +(29007, '荔城街道', 4, 3039), +(29008, '五山街道', 4, 3040), +(29009, '元岗街道', 4, 3040), +(29010, '兴华街道', 4, 3040), +(29011, '冼村街道', 4, 3040), +(29012, '凤凰街道', 4, 3040), +(29013, '前进街道', 4, 3040), +(29014, '员村街道', 4, 3040), +(29015, '天园街道', 4, 3040), +(29016, '天河南街道', 4, 3040), +(29017, '新塘街道', 4, 3040), +(29018, '林和街道', 4, 3040), +(29019, '棠下街道', 4, 3040), +(29020, '沙东街道', 4, 3040), +(29021, '沙河街道', 4, 3040), +(29022, '猎德街道', 4, 3040), +(29023, '珠吉街道', 4, 3040), +(29024, '石牌街道', 4, 3040), +(29025, '车陂街道', 4, 3040), +(29026, '长兴街道', 4, 3040), +(29027, '黄村街道', 4, 3040), +(29028, '龙洞街道', 4, 3040), +(29029, '凤阳街道', 4, 3041), +(29030, '华洲街道', 4, 3041), +(29031, '南华西街道', 4, 3041), +(29032, '南洲街道', 4, 3041), +(29033, '南石头街道', 4, 3041), +(29034, '官洲街道', 4, 3041), +(29035, '新港街道', 4, 3041); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29036, '昌岗街道', 4, 3041), +(29037, '江南中街道', 4, 3041), +(29038, '江海街道', 4, 3041), +(29039, '沙园街道', 4, 3041), +(29040, '海幢街道', 4, 3041), +(29041, '滨江街道', 4, 3041), +(29042, '琶洲街道', 4, 3041), +(29043, '瑞宝街道', 4, 3041), +(29044, '素社街道', 4, 3041), +(29045, '赤岗街道', 4, 3041), +(29046, '龙凤街道', 4, 3041), +(29047, '东涌镇', 4, 3042), +(29048, '东环街道', 4, 3042), +(29049, '化龙镇', 4, 3042), +(29050, '南村镇', 4, 3042), +(29051, '大岗镇', 4, 3042), +(29052, '大石街道', 4, 3042), +(29053, '大龙街道', 4, 3042), +(29054, '小谷围街道', 4, 3042), +(29055, '市桥街道', 4, 3042), +(29056, '新造镇', 4, 3042), +(29057, '桥南街道', 4, 3042), +(29058, '榄核镇', 4, 3042), +(29059, '沙头街道', 4, 3042), +(29060, '沙湾街道', 4, 3042), +(29061, '洛浦街道', 4, 3042), +(29062, '石壁街道', 4, 3042), +(29063, '石楼镇', 4, 3042), +(29064, '石碁镇', 4, 3042), +(29065, '钟村街道', 4, 3042), +(29066, '三元里街道', 4, 3043), +(29067, '京溪街道', 4, 3043), +(29068, '人和镇', 4, 3043), +(29069, '同和街道', 4, 3043), +(29070, '同德街道', 4, 3043), +(29071, '嘉禾街道', 4, 3043), +(29072, '均禾街道', 4, 3043), +(29073, '太和镇', 4, 3043), +(29074, '新市街道', 4, 3043), +(29075, '景泰街道', 4, 3043), +(29076, '松洲街道', 4, 3043), +(29077, '棠景街道', 4, 3043), +(29078, '永平街道', 4, 3043), +(29079, '江高镇', 4, 3043), +(29080, '石井街道', 4, 3043), +(29081, '金沙街道', 4, 3043), +(29082, '钟落潭镇', 4, 3043), +(29083, '黄石街道', 4, 3043), +(29084, '新华街道', 4, 3044), +(29085, '梯面镇', 4, 3044), +(29086, '炭步镇', 4, 3044), +(29087, '狮岭镇', 4, 3044), +(29088, '花东镇', 4, 3044), +(29089, '花山镇', 4, 3044), +(29090, '赤坭镇', 4, 3044), +(29091, '雅瑶镇', 4, 3044), +(29092, '东沙街道', 4, 3045), +(29093, '东漖街道', 4, 3045), +(29094, '中南街道', 4, 3045), +(29095, '冲口街道', 4, 3045), +(29096, '华林街道', 4, 3045); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29097, '南源街道', 4, 3045), +(29098, '多宝街道', 4, 3045), +(29099, '岭南街道', 4, 3045), +(29100, '彩虹街道', 4, 3045), +(29101, '昌华街道', 4, 3045), +(29102, '桥中街道', 4, 3045), +(29103, '沙面街道', 4, 3045), +(29104, '海龙街道', 4, 3045), +(29105, '白鹤洞街道', 4, 3045), +(29106, '石围塘街道', 4, 3045), +(29107, '站前街道', 4, 3045), +(29108, '花地街道', 4, 3045), +(29109, '茶滘街道', 4, 3045), +(29110, '西村街道', 4, 3045), +(29111, '逢源街道', 4, 3045), +(29112, '金花街道', 4, 3045), +(29113, '龙津街道', 4, 3045), +(29114, '东湖街道', 4, 3046), +(29115, '东风街道', 4, 3046), +(29116, '人民街道', 4, 3046), +(29117, '光塔街道', 4, 3046), +(29118, '六榕街道', 4, 3046), +(29119, '农林街道', 4, 3046), +(29120, '北京街道', 4, 3046), +(29121, '华乐街道', 4, 3046), +(29122, '大东街道', 4, 3046), +(29123, '大塘街道', 4, 3046), +(29124, '大新街道', 4, 3046), +(29125, '广卫街道', 4, 3046), +(29126, '建设街道', 4, 3046), +(29127, '梅花村街道', 4, 3046), +(29128, '洪桥街道', 4, 3046), +(29129, '流花街道', 4, 3046), +(29130, '珠光街道', 4, 3046), +(29131, '登峰街道', 4, 3046), +(29132, '白云街道', 4, 3046), +(29133, '矿泉街道', 4, 3046), +(29134, '诗书街道', 4, 3046), +(29135, '黄花岗街道', 4, 3046), +(29136, '南岗街道', 4, 3047), +(29137, '大沙街道', 4, 3047), +(29138, '文冲街道', 4, 3047), +(29139, '穗东街道', 4, 3047), +(29140, '红山街道', 4, 3047), +(29141, '荔联街道', 4, 3047), +(29142, '长洲街道', 4, 3047), +(29143, '鱼珠街道', 4, 3047), +(29144, '黄埔街道', 4, 3047), +(29145, '三溪', 4, 3048), +(29146, '两江', 4, 3048), +(29147, '乐城', 4, 3048), +(29148, '九峰', 4, 3048), +(29149, '云岩', 4, 3048), +(29150, '五山', 4, 3048), +(29151, '北乡', 4, 3048), +(29152, '坪石', 4, 3048), +(29153, '大源', 4, 3048), +(29154, '庆云', 4, 3048), +(29155, '廊田', 4, 3048), +(29156, '梅花', 4, 3048), +(29157, '沙坪', 4, 3048), +(29158, '河南', 4, 3048); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29159, '白石', 4, 3048), +(29160, '秀水', 4, 3048), +(29161, '罗家渡', 4, 3048), +(29162, '老坪石', 4, 3048), +(29163, '长来', 4, 3048), +(29164, '黄圃', 4, 3048), +(29165, '一六镇', 4, 3049), +(29166, '东坪镇', 4, 3049), +(29167, '乳城镇', 4, 3049), +(29168, '大布镇', 4, 3049), +(29169, '大桥镇', 4, 3049), +(29170, '必背镇', 4, 3049), +(29171, '桂头镇', 4, 3049), +(29172, '洛阳镇', 4, 3049), +(29173, '游溪镇', 4, 3049), +(29174, '丹霞镇', 4, 3050), +(29175, '仁化镇', 4, 3050), +(29176, '周田镇', 4, 3050), +(29177, '城口镇', 4, 3050), +(29178, '大桥镇', 4, 3050), +(29179, '扶溪镇', 4, 3050), +(29180, '石塘镇', 4, 3050), +(29181, '红山镇', 4, 3050), +(29182, '董塘镇', 4, 3050), +(29183, '长江镇', 4, 3050), +(29184, '闻韶镇', 4, 3050), +(29185, '黄坑镇', 4, 3050), +(29186, '主田镇', 4, 3051), +(29187, '乌迳镇', 4, 3051), +(29188, '全安镇', 4, 3051), +(29189, '南亩镇', 4, 3051), +(29190, '古市镇', 4, 3051), +(29191, '坪田镇', 4, 3051), +(29192, '帽子峰镇', 4, 3051), +(29193, '水口镇', 4, 3051), +(29194, '江头镇', 4, 3051), +(29195, '油山镇', 4, 3051), +(29196, '湖口镇', 4, 3051), +(29197, '澜河镇', 4, 3051), +(29198, '珠玑镇', 4, 3051), +(29199, '界址镇', 4, 3051), +(29200, '百顺镇', 4, 3051), +(29201, '邓坊镇', 4, 3051), +(29202, '雄州街道', 4, 3051), +(29203, '雄州镇', 4, 3051), +(29204, '黄坑镇', 4, 3051), +(29205, '司前镇', 4, 3052), +(29206, '城南镇', 4, 3052), +(29207, '太平镇', 4, 3052), +(29208, '沈所镇', 4, 3052), +(29209, '深渡水瑶族乡', 4, 3052), +(29210, '澄江镇', 4, 3052), +(29211, '罗坝镇', 4, 3052), +(29212, '隘子镇', 4, 3052), +(29213, '顿岗镇', 4, 3052), +(29214, '马市镇', 4, 3052), +(29215, '丰城街道', 4, 3053), +(29216, '回龙镇', 4, 3053), +(29217, '梅坑镇', 4, 3053), +(29218, '沙田镇', 4, 3053), +(29219, '遥田镇', 4, 3053), +(29220, '马头镇', 4, 3053), +(29221, '黄石祭镇', 4, 3053), +(29222, '乌石镇', 4, 3054), +(29223, '大坑口镇', 4, 3054), +(29224, '大塘镇', 4, 3054); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29225, '小坑镇', 4, 3054), +(29226, '枫湾镇', 4, 3054), +(29227, '樟市镇', 4, 3054), +(29228, '沙溪镇', 4, 3054), +(29229, '白土镇', 4, 3054), +(29230, '罗坑镇', 4, 3054), +(29231, '马坝镇', 4, 3054), +(29232, '惠民街道', 4, 3055), +(29233, '新华街道', 4, 3055), +(29234, '江湾镇', 4, 3055), +(29235, '西河镇', 4, 3055), +(29236, '西联镇', 4, 3055), +(29237, '重阳镇', 4, 3055), +(29238, '龙归镇', 4, 3055), +(29239, '东河街道', 4, 3056), +(29240, '乐园镇', 4, 3056), +(29241, '十里亭镇', 4, 3056), +(29242, '南门街道', 4, 3056), +(29243, '和平街道', 4, 3056), +(29244, '太平街道', 4, 3056), +(29245, '新韶镇', 4, 3056), +(29246, '犁市镇', 4, 3056), +(29247, '花坪镇', 4, 3056), +(29248, '车站街道', 4, 3056), +(29249, '周陂镇', 4, 3057), +(29250, '坝仔镇', 4, 3057), +(29251, '官渡镇', 4, 3057), +(29252, '新江镇', 4, 3057), +(29253, '江尾镇', 4, 3057), +(29254, '翁城镇', 4, 3057), +(29255, '龙仙镇', 4, 3057), +(29256, '南头街道', 4, 3058), +(29257, '南山街道', 4, 3058), +(29258, '招商街道', 4, 3058), +(29259, '桃源街道', 4, 3058), +(29260, '沙河街道', 4, 3058), +(29261, '粤海街道', 4, 3058), +(29262, '蛇口街道', 4, 3058), +(29263, '西丽街道', 4, 3058), +(29264, '光明街道', 4, 3059), +(29265, '公明街道', 4, 3059), +(29266, '大浪街道', 4, 3059), +(29267, '新安街道', 4, 3059), +(29268, '松岗街道', 4, 3059), +(29269, '民治街道', 4, 3059), +(29270, '沙井街道', 4, 3059), +(29271, '石岩街道', 4, 3059), +(29272, '福永街道', 4, 3059), +(29273, '西乡街道', 4, 3059), +(29274, '观澜街道', 4, 3059), +(29275, '龙华街道', 4, 3059), +(29276, '梅沙街道', 4, 3060), +(29277, '沙头角街道', 4, 3060), +(29278, '海山街道', 4, 3060), +(29279, '盐田街道', 4, 3060), +(29280, '华富街道', 4, 3061), +(29281, '南园街道', 4, 3061), +(29282, '园岭街道', 4, 3061), +(29283, '梅林街道', 4, 3061), +(29284, '沙头街道', 4, 3061), +(29285, '福田街道', 4, 3061), +(29286, '莲花街道', 4, 3061); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29287, '香密湖街道', 4, 3061), +(29288, '东晓街道', 4, 3062), +(29289, '东湖街道', 4, 3062), +(29290, '东门街道', 4, 3062), +(29291, '南湖街道', 4, 3062), +(29292, '桂园街道', 4, 3062), +(29293, '清水河街道', 4, 3062), +(29294, '笋岗街道', 4, 3062), +(29295, '翠竹街道', 4, 3062), +(29296, '莲塘街道', 4, 3062), +(29297, '黄贝街道', 4, 3062), +(29298, '南湾街道', 4, 3063), +(29299, '南澳街道', 4, 3063), +(29300, '坂田街道', 4, 3063), +(29301, '坑梓街道', 4, 3063), +(29302, '坪地街道', 4, 3063), +(29303, '坪山街道', 4, 3063), +(29304, '大鹏街道', 4, 3063), +(29305, '布吉街道', 4, 3063), +(29306, '平湖街道', 4, 3063), +(29307, '横岗街道', 4, 3063), +(29308, '葵涌街道', 4, 3063), +(29309, '龙城街道', 4, 3063), +(29310, '龙岗街道', 4, 3063), +(29311, '干务镇', 4, 3064), +(29312, '井岸镇', 4, 3064), +(29313, '斗门镇', 4, 3064), +(29314, '白蕉镇', 4, 3064), +(29315, '莲洲镇', 4, 3064), +(29316, '三灶镇', 4, 3065), +(29317, '南水镇', 4, 3065), +(29318, '平沙镇', 4, 3065), +(29319, '红旗镇', 4, 3065), +(29320, '万山镇', 4, 3066), +(29321, '前山街道', 4, 3066), +(29322, '南屏镇', 4, 3066), +(29323, '吉大街道', 4, 3066), +(29324, '唐家湾镇', 4, 3066), +(29325, '担杆镇', 4, 3066), +(29326, '拱北街道', 4, 3066), +(29327, '桂山镇', 4, 3066), +(29328, '梅华街道', 4, 3066), +(29329, '横琴镇', 4, 3066), +(29330, '湾仔街道', 4, 3066), +(29331, '狮山街道', 4, 3066), +(29332, '翠香街道', 4, 3066), +(29333, '香湾街道', 4, 3066), +(29334, '云澳镇', 4, 3067), +(29335, '后宅镇', 4, 3067), +(29336, '深澳镇', 4, 3067), +(29337, '两英镇', 4, 3068), +(29338, '井都镇', 4, 3068), +(29339, '仙城镇', 4, 3068), +(29340, '司马浦镇', 4, 3068), +(29341, '峡山街道', 4, 3068), +(29342, '成田镇', 4, 3068), +(29343, '红场镇', 4, 3068), +(29344, '胪岗镇', 4, 3068), +(29345, '陇田镇', 4, 3068), +(29346, '陈店镇', 4, 3068), +(29347, '雷岭镇', 4, 3068), +(29348, '关埠镇', 4, 3069); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29349, '和平镇', 4, 3069), +(29350, '城南街道', 4, 3069), +(29351, '文光街道', 4, 3069), +(29352, '棉北街道', 4, 3069), +(29353, '河溪镇', 4, 3069), +(29354, '海门镇', 4, 3069), +(29355, '西胪镇', 4, 3069), +(29356, '谷饶镇', 4, 3069), +(29357, '贵屿镇', 4, 3069), +(29358, '金浦街道', 4, 3069), +(29359, '金灶镇', 4, 3069), +(29360, '铜盂镇', 4, 3069), +(29361, '上华镇', 4, 3070), +(29362, '东里镇', 4, 3070), +(29363, '凤翔街道', 4, 3070), +(29364, '广益街道', 4, 3070), +(29365, '溪南镇', 4, 3070), +(29366, '澄华街道', 4, 3070), +(29367, '盐鸿镇', 4, 3070), +(29368, '莲上镇', 4, 3070), +(29369, '莲下镇', 4, 3070), +(29370, '莲华镇', 4, 3070), +(29371, '隆都镇', 4, 3070), +(29372, '广澳街道', 4, 3071), +(29373, '河浦街道', 4, 3071), +(29374, '滨海街道', 4, 3071), +(29375, '玉新街道', 4, 3071), +(29376, '礐石街道', 4, 3071), +(29377, '达濠街道', 4, 3071), +(29378, '马滘街道', 4, 3071), +(29379, '东墩街道', 4, 3072), +(29380, '东方街道', 4, 3072), +(29381, '乌桥街道', 4, 3072), +(29382, '光华街道', 4, 3072), +(29383, '同益街道', 4, 3072), +(29384, '大华街道', 4, 3072), +(29385, '岐山街道', 4, 3072), +(29386, '广厦街道', 4, 3072), +(29387, '新福街道', 4, 3072), +(29388, '月浦街道', 4, 3072), +(29389, '永祥街道', 4, 3072), +(29390, '海安街道', 4, 3072), +(29391, '石炮台街道', 4, 3072), +(29392, '金厦街道', 4, 3072), +(29393, '金砂街道', 4, 3072), +(29394, '鮀江街道', 4, 3072), +(29395, '鮀莲街道', 4, 3072), +(29396, '外砂镇', 4, 3073), +(29397, '新津街道', 4, 3073), +(29398, '新溪镇', 4, 3073), +(29399, '珠池街道', 4, 3073), +(29400, '金霞街道', 4, 3073), +(29401, '鸥汀街道', 4, 3073), +(29402, '龙祥街道', 4, 3073), +(29403, '乐平镇', 4, 3074), +(29404, '大塘镇', 4, 3074), +(29405, '白坭镇', 4, 3074), +(29406, '芦苞镇', 4, 3074), +(29407, '西南街道', 4, 3074), +(29408, '丹灶镇', 4, 3075), +(29409, '九江镇', 4, 3075), +(29410, '大沥镇', 4, 3075); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29411, '桂城街道', 4, 3075), +(29412, '狮山镇', 4, 3075), +(29413, '罗村街道', 4, 3075), +(29414, '西樵镇', 4, 3075), +(29415, '里水镇', 4, 3075), +(29416, '张槎街道', 4, 3076), +(29417, '石湾镇街道', 4, 3076), +(29418, '祖庙街道', 4, 3076), +(29419, '乐从镇', 4, 3077), +(29420, '伦教街道', 4, 3077), +(29421, '勒流街道', 4, 3077), +(29422, '北滘镇', 4, 3077), +(29423, '均安镇', 4, 3077), +(29424, '大良街道', 4, 3077), +(29425, '容桂街道', 4, 3077), +(29426, '杏坛镇', 4, 3077), +(29427, '陈村镇', 4, 3077), +(29428, '龙江镇', 4, 3077), +(29429, '明城镇', 4, 3078), +(29430, '更合镇', 4, 3078), +(29431, '杨和镇', 4, 3078), +(29432, '荷城街道', 4, 3078), +(29433, '三合镇', 4, 3079), +(29434, '冲蒌镇', 4, 3079), +(29435, '北陡镇', 4, 3079), +(29436, '台城街道', 4, 3079), +(29437, '四九镇', 4, 3079), +(29438, '大江镇', 4, 3079), +(29439, '川岛镇', 4, 3079), +(29440, '广海镇', 4, 3079), +(29441, '斗山镇', 4, 3079), +(29442, '水步镇', 4, 3079), +(29443, '汶村镇', 4, 3079), +(29444, '海宴镇', 4, 3079), +(29445, '深井镇', 4, 3079), +(29446, '白沙镇', 4, 3079), +(29447, '端芬镇', 4, 3079), +(29448, '赤溪镇', 4, 3079), +(29449, '都斛镇', 4, 3079), +(29450, '三埠街道', 4, 3080), +(29451, '塘口镇', 4, 3080), +(29452, '大沙镇', 4, 3080), +(29453, '月山镇', 4, 3080), +(29454, '水口镇', 4, 3080), +(29455, '沙塘镇', 4, 3080), +(29456, '百合镇', 4, 3080), +(29457, '苍城镇', 4, 3080), +(29458, '蚬冈镇', 4, 3080), +(29459, '赤坎镇', 4, 3080), +(29460, '赤水镇', 4, 3080), +(29461, '金鸡镇', 4, 3080), +(29462, '长沙街道', 4, 3080), +(29463, '马冈镇', 4, 3080), +(29464, '龙胜镇', 4, 3080), +(29465, '东安街道', 4, 3081), +(29466, '东成镇', 4, 3081), +(29467, '君堂镇', 4, 3081), +(29468, '圣堂镇', 4, 3081), +(29469, '大槐镇', 4, 3081), +(29470, '大田镇', 4, 3081), +(29471, '平石街道', 4, 3081), +(29472, '恩城街道', 4, 3081), +(29473, '横陂镇', 4, 3081), +(29474, '沙湖镇', 4, 3081); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29475, '牛江镇', 4, 3081), +(29476, '良西镇', 4, 3081), +(29477, '那吉镇', 4, 3081), +(29478, '三江镇', 4, 3082), +(29479, '会城街道', 4, 3082), +(29480, '双水镇', 4, 3082), +(29481, '古井镇', 4, 3082), +(29482, '司前镇', 4, 3082), +(29483, '大敖镇', 4, 3082), +(29484, '大泽镇', 4, 3082), +(29485, '崖门镇', 4, 3082), +(29486, '沙堆镇', 4, 3082), +(29487, '睦洲镇', 4, 3082), +(29488, '罗坑镇', 4, 3082), +(29489, '外海街道', 4, 3083), +(29490, '江南街道', 4, 3083), +(29491, '滘北街道', 4, 3083), +(29492, '滘头街道', 4, 3083), +(29493, '礼乐街道', 4, 3083), +(29494, '仓后街道', 4, 3084), +(29495, '北街街道', 4, 3084), +(29496, '堤东街道', 4, 3084), +(29497, '杜阮镇', 4, 3084), +(29498, '棠下镇', 4, 3084), +(29499, '潮连街道', 4, 3084), +(29500, '环市街道', 4, 3084), +(29501, '白沙街道', 4, 3084), +(29502, '荷塘镇', 4, 3084), +(29503, '云乡镇', 4, 3085), +(29504, '共和镇', 4, 3085), +(29505, '双合镇', 4, 3085), +(29506, '古劳镇', 4, 3085), +(29507, '址山镇', 4, 3085), +(29508, '宅梧镇', 4, 3085), +(29509, '桃源镇', 4, 3085), +(29510, '沙坪镇', 4, 3085), +(29511, '雅瑶镇', 4, 3085), +(29512, '鹤城镇', 4, 3085), +(29513, '龙口镇', 4, 3085), +(29514, '兰石镇', 4, 3086), +(29515, '博铺街道', 4, 3086), +(29516, '吴阳镇', 4, 3086), +(29517, '塘土叕镇(“土、叕”合为一字)', 4, 3086), +(29518, '塘尾街道', 4, 3086), +(29519, '大山江街道', 4, 3086), +(29520, '振文镇', 4, 3086), +(29521, '梅菉街道', 4, 3086), +(29522, '樟铺镇', 4, 3086), +(29523, '浅水镇', 4, 3086), +(29524, '海滨街道', 4, 3086), +(29525, '王村港镇', 4, 3086), +(29526, '覃巴镇', 4, 3086), +(29527, '长岐镇', 4, 3086), +(29528, '黄坡镇', 4, 3086); \ No newline at end of file diff --git a/install/data/common_district_3.sql b/install/data/common_district_3.sql new file mode 100644 index 0000000..78925b4 --- /dev/null +++ b/install/data/common_district_3.sql @@ -0,0 +1,15771 @@ +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29529, '干塘镇', 4, 3087), +(29530, '南三镇', 4, 3087), +(29531, '南调街道', 4, 3087), +(29532, '坡头镇', 4, 3087), +(29533, '官渡镇', 4, 3087), +(29534, '麻斜街道', 4, 3087), +(29535, '龙头镇', 4, 3087), +(29536, '吉水镇', 4, 3088), +(29537, '和寮镇', 4, 3088); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29538, '城北街道', 4, 3088), +(29539, '城南街道', 4, 3088), +(29540, '塘蓬镇', 4, 3088), +(29541, '安铺镇', 4, 3088), +(29542, '新民镇', 4, 3088), +(29543, '横山镇', 4, 3088), +(29544, '河唇镇', 4, 3088), +(29545, '石城镇', 4, 3088), +(29546, '石岭镇', 4, 3088), +(29547, '石角镇', 4, 3088), +(29548, '石颈镇', 4, 3088), +(29549, '罗州街道', 4, 3088), +(29550, '良垌镇', 4, 3088), +(29551, '营仔镇', 4, 3088), +(29552, '车板镇', 4, 3088), +(29553, '长山镇', 4, 3088), +(29554, '雅塘镇', 4, 3088), +(29555, '青平镇', 4, 3088), +(29556, '高桥镇', 4, 3088), +(29557, '下桥镇', 4, 3089), +(29558, '下洋镇', 4, 3089), +(29559, '前山镇', 4, 3089), +(29560, '南山镇', 4, 3089), +(29561, '和安镇', 4, 3089), +(29562, '城北乡', 4, 3089), +(29563, '徐城街道', 4, 3089), +(29564, '新寮镇', 4, 3089), +(29565, '曲界镇', 4, 3089), +(29566, '海安镇', 4, 3089), +(29567, '西连镇', 4, 3089), +(29568, '角尾乡', 4, 3089), +(29569, '迈陈镇', 4, 3089), +(29570, '锦和镇', 4, 3089), +(29571, '龙塘镇', 4, 3089), +(29572, '中华街道', 4, 3090), +(29573, '中山街道', 4, 3090), +(29574, '北桥街道', 4, 3090), +(29575, '南桥街道', 4, 3090), +(29576, '寸金街道', 4, 3090), +(29577, '民主街道', 4, 3090), +(29578, '沙湾街道', 4, 3090), +(29579, '泉庄街道', 4, 3090), +(29580, '调顺街道', 4, 3090), +(29581, '乌塘镇', 4, 3091), +(29582, '乐民镇', 4, 3091), +(29583, '北坡镇', 4, 3091), +(29584, '城月镇', 4, 3091), +(29585, '岭北镇', 4, 3091), +(29586, '建新镇', 4, 3091), +(29587, '杨柑镇', 4, 3091), +(29588, '江洪镇', 4, 3091), +(29589, '河头镇', 4, 3091), +(29590, '洋青镇', 4, 3091), +(29591, '港门镇', 4, 3091), +(29592, '界炮镇', 4, 3091), +(29593, '草潭镇', 4, 3091), +(29594, '遂城镇', 4, 3091), +(29595, '黄略镇', 4, 3091), +(29596, '东里镇', 4, 3092), +(29597, '乌石镇', 4, 3092), +(29598, '企水镇', 4, 3092), +(29599, '北和镇', 4, 3092), +(29600, '南兴镇', 4, 3092), +(29601, '唐家镇', 4, 3092), +(29602, '客路镇', 4, 3092); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29603, '新城街道', 4, 3092), +(29604, '杨家镇', 4, 3092), +(29605, '松竹镇', 4, 3092), +(29606, '沈塘镇', 4, 3092), +(29607, '白沙镇', 4, 3092), +(29608, '纪家镇', 4, 3092), +(29609, '英利镇', 4, 3092), +(29610, '西湖街道', 4, 3092), +(29611, '覃斗镇', 4, 3092), +(29612, '调风镇', 4, 3092), +(29613, '附城镇', 4, 3092), +(29614, '雷城街道', 4, 3092), +(29615, '雷高镇', 4, 3092), +(29616, '龙门镇', 4, 3092), +(29617, '东新街道', 4, 3093), +(29618, '乐华街道', 4, 3093), +(29619, '友谊街道', 4, 3093), +(29620, '工农街道', 4, 3093), +(29621, '建设街道', 4, 3093), +(29622, '新兴街道', 4, 3093), +(29623, '新园街道', 4, 3093), +(29624, '海头街道', 4, 3093), +(29625, '海滨街道', 4, 3093), +(29626, '爱国街道', 4, 3093), +(29627, '解放街道', 4, 3093), +(29628, '东山镇', 4, 3094), +(29629, '东简镇', 4, 3094), +(29630, '太平镇', 4, 3094), +(29631, '民安镇', 4, 3094), +(29632, '湖光镇', 4, 3094), +(29633, '硇洲镇', 4, 3094), +(29634, '麻章镇', 4, 3094), +(29635, '丁堡镇', 4, 3095), +(29636, '东镇街道', 4, 3095), +(29637, '北界镇', 4, 3095), +(29638, '合水镇', 4, 3095), +(29639, '大成镇', 4, 3095), +(29640, '平塘镇', 4, 3095), +(29641, '怀乡镇', 4, 3095), +(29642, '思贺镇', 4, 3095), +(29643, '新宝镇', 4, 3095), +(29644, '朱砂镇', 4, 3095), +(29645, '水口镇', 4, 3095), +(29646, '池洞镇', 4, 3095), +(29647, '洪冠镇', 4, 3095), +(29648, '白石镇', 4, 3095), +(29649, '茶山镇', 4, 3095), +(29650, '贵子镇', 4, 3095), +(29651, '金垌镇', 4, 3095), +(29652, '钱排镇', 4, 3095), +(29653, '镇隆镇', 4, 3095), +(29654, '下郭街道', 4, 3096), +(29655, '东山街道', 4, 3096), +(29656, '中垌镇', 4, 3096), +(29657, '丽岗镇', 4, 3096), +(29658, '南盛街道', 4, 3096), +(29659, '合江镇', 4, 3096), +(29660, '同庆镇', 4, 3096), +(29661, '官桥镇', 4, 3096), +(29662, '宝圩镇', 4, 3096), +(29663, '平定镇', 4, 3096), +(29664, '播扬镇', 4, 3096), +(29665, '文楼镇', 4, 3096), +(29666, '新安镇', 4, 3096); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29667, '杨梅镇', 4, 3096), +(29668, '林尘镇', 4, 3096), +(29669, '江湖镇', 4, 3096), +(29670, '河西街道', 4, 3096), +(29671, '石湾街道', 4, 3096), +(29672, '笪桥镇', 4, 3096), +(29673, '良光镇', 4, 3096), +(29674, '那务镇', 4, 3096), +(29675, '长岐镇', 4, 3096), +(29676, '博贺镇', 4, 3097), +(29677, '岭门镇', 4, 3097), +(29678, '旦场镇', 4, 3097), +(29679, '望夫镇', 4, 3097), +(29680, '林头镇', 4, 3097), +(29681, '树仔镇', 4, 3097), +(29682, '水东镇', 4, 3097), +(29683, '沙琅镇', 4, 3097), +(29684, '电城镇', 4, 3097), +(29685, '罗坑镇', 4, 3097), +(29686, '观珠镇', 4, 3097), +(29687, '那霍镇', 4, 3097), +(29688, '霞洞镇', 4, 3097), +(29689, '马踏镇', 4, 3097), +(29690, '麻岗镇', 4, 3097), +(29691, '黄岭镇', 4, 3097), +(29692, '公馆镇', 4, 3098), +(29693, '官渡街道', 4, 3098), +(29694, '山阁镇', 4, 3098), +(29695, '新华街道', 4, 3098), +(29696, '新坡镇', 4, 3098), +(29697, '河东街道', 4, 3098), +(29698, '河西街道', 4, 3098), +(29699, '站前街道', 4, 3098), +(29700, '红旗街道', 4, 3098), +(29701, '袂花镇', 4, 3098), +(29702, '金塘镇', 4, 3098), +(29703, '镇盛镇', 4, 3098), +(29704, '露天矿街道', 4, 3098), +(29705, '高山镇', 4, 3098), +(29706, '鳌头镇', 4, 3098), +(29707, '七径镇', 4, 3099), +(29708, '南海街道', 4, 3099), +(29709, '坡心镇', 4, 3099), +(29710, '小良镇', 4, 3099), +(29711, '沙院镇', 4, 3099), +(29712, '羊角镇', 4, 3099), +(29713, '高地街道', 4, 3099), +(29714, '东岸镇', 4, 3100), +(29715, '云潭镇', 4, 3100), +(29716, '分界镇', 4, 3100), +(29717, '南塘镇', 4, 3100), +(29718, '古丁镇', 4, 3100), +(29719, '大井镇', 4, 3100), +(29720, '大坡镇', 4, 3100), +(29721, '宝光街道', 4, 3100), +(29722, '山美街道', 4, 3100), +(29723, '平山镇', 4, 3100), +(29724, '新垌镇', 4, 3100), +(29725, '曹江镇', 4, 3100), +(29726, '根子镇', 4, 3100), +(29727, '沙田镇', 4, 3100), +(29728, '泗水镇', 4, 3100), +(29729, '深镇镇', 4, 3100), +(29730, '潘州街道', 4, 3100); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29731, '潭头镇', 4, 3100), +(29732, '石仔岭街道', 4, 3100), +(29733, '石板镇', 4, 3100), +(29734, '石鼓镇', 4, 3100), +(29735, '荷塘镇', 4, 3100), +(29736, '荷花镇', 4, 3100), +(29737, '谢鸡镇', 4, 3100), +(29738, '金山街道', 4, 3100), +(29739, '镇江镇', 4, 3100), +(29740, '长坡镇', 4, 3100), +(29741, '马贵镇', 4, 3100), +(29742, '下茆镇', 4, 3101), +(29743, '东城街道', 4, 3101), +(29744, '地豆镇', 4, 3101), +(29745, '城中街道', 4, 3101), +(29746, '大沙镇', 4, 3101), +(29747, '威整镇', 4, 3101), +(29748, '江谷镇', 4, 3101), +(29749, '石狗镇', 4, 3101), +(29750, '罗源镇', 4, 3101), +(29751, '贞山街道', 4, 3101), +(29752, '迳口镇', 4, 3101), +(29753, '黄田镇', 4, 3101), +(29754, '龙甫镇', 4, 3101), +(29755, '南丰镇', 4, 3102), +(29756, '大洲镇', 4, 3102), +(29757, '大玉口镇', 4, 3102), +(29758, '平凤镇', 4, 3102), +(29759, '杏花镇', 4, 3102), +(29760, '江口镇', 4, 3102), +(29761, '江川镇', 4, 3102), +(29762, '河儿口镇', 4, 3102), +(29763, '渔涝镇', 4, 3102), +(29764, '白垢镇', 4, 3102), +(29765, '罗董镇', 4, 3102), +(29766, '莲都镇', 4, 3102), +(29767, '都平镇', 4, 3102), +(29768, '金装镇', 4, 3102), +(29769, '长安镇', 4, 3102), +(29770, '长岗镇', 4, 3102), +(29771, '五和镇', 4, 3103), +(29772, '北市镇', 4, 3103), +(29773, '南街镇', 4, 3103), +(29774, '古水镇', 4, 3103), +(29775, '坑口镇', 4, 3103), +(29776, '宾亨镇', 4, 3103), +(29777, '排沙镇', 4, 3103), +(29778, '木格镇', 4, 3103), +(29779, '横山镇', 4, 3103), +(29780, '江屯镇', 4, 3103), +(29781, '洲仔镇', 4, 3103), +(29782, '潭布镇', 4, 3103), +(29783, '石咀镇', 4, 3103), +(29784, '石涧镇', 4, 3103), +(29785, '联和镇', 4, 3103), +(29786, '螺岗镇', 4, 3103), +(29787, '赤坑镇', 4, 3103), +(29788, '九市镇', 4, 3104), +(29789, '凤村镇', 4, 3104), +(29790, '回龙镇', 4, 3104), +(29791, '官圩镇', 4, 3104), +(29792, '德城街道', 4, 3104), +(29793, '悦城镇', 4, 3104), +(29794, '播植镇', 4, 3104), +(29795, '新圩镇', 4, 3104); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29796, '武垄镇', 4, 3104), +(29797, '永丰镇', 4, 3104), +(29798, '莫村镇', 4, 3104), +(29799, '马圩镇', 4, 3104), +(29800, '高良镇', 4, 3104), +(29801, '下帅壮族瑶族乡', 4, 3105), +(29802, '中洲镇', 4, 3105), +(29803, '冷坑镇', 4, 3105), +(29804, '凤岗镇', 4, 3105), +(29805, '坳仔镇', 4, 3105), +(29806, '大岗镇', 4, 3105), +(29807, '岗坪镇', 4, 3105), +(29808, '怀城镇', 4, 3105), +(29809, '桥头镇', 4, 3105), +(29810, '梁村镇', 4, 3105), +(29811, '永固镇', 4, 3105), +(29812, '汶朗镇', 4, 3105), +(29813, '洽水镇', 4, 3105), +(29814, '甘洒镇', 4, 3105), +(29815, '蓝钟镇', 4, 3105), +(29816, '诗洞镇', 4, 3105), +(29817, '连麦镇', 4, 3105), +(29818, '闸岗镇', 4, 3105), +(29819, '马宁镇', 4, 3105), +(29820, '城东街道', 4, 3106), +(29821, '城北街道', 4, 3106), +(29822, '城南街道', 4, 3106), +(29823, '城西街道', 4, 3106), +(29824, '睦岗镇', 4, 3106), +(29825, '黄岗镇', 4, 3106), +(29826, '乐城镇', 4, 3107), +(29827, '南岸街道', 4, 3107), +(29828, '回龙镇', 4, 3107), +(29829, '大湾镇', 4, 3107), +(29830, '小湘镇', 4, 3107), +(29831, '新桥镇', 4, 3107), +(29832, '水南镇', 4, 3107), +(29833, '河台镇', 4, 3107), +(29834, '活道镇', 4, 3107), +(29835, '白土镇', 4, 3107), +(29836, '白诸镇', 4, 3107), +(29837, '禄步镇', 4, 3107), +(29838, '莲塘镇', 4, 3107), +(29839, '蚬岗镇', 4, 3107), +(29840, '蛟塘镇', 4, 3107), +(29841, '金利镇', 4, 3107), +(29842, '金渡镇', 4, 3107), +(29843, '凤凰镇', 4, 3108), +(29844, '坑口街道', 4, 3108), +(29845, '广利街道', 4, 3108), +(29846, '桂城街道', 4, 3108), +(29847, '永安镇', 4, 3108), +(29848, '沙浦镇', 4, 3108), +(29849, '莲花镇', 4, 3108), +(29850, '公庄镇', 4, 3109), +(29851, '园洲镇', 4, 3109), +(29852, '杨侨镇', 4, 3109), +(29853, '杨村镇', 4, 3109), +(29854, '柏塘镇', 4, 3109), +(29855, '泰美镇', 4, 3109), +(29856, '湖镇镇', 4, 3109), +(29857, '石坝镇', 4, 3109), +(29858, '石湾镇', 4, 3109), +(29859, '福田镇', 4, 3109), +(29860, '罗阳镇', 4, 3109); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29861, '观音阁镇', 4, 3109), +(29862, '长宁镇', 4, 3109), +(29863, '麻陂镇', 4, 3109), +(29864, '龙华镇', 4, 3109), +(29865, '龙溪镇', 4, 3109), +(29866, '吉隆镇', 4, 3110), +(29867, '多祝镇', 4, 3110), +(29868, '大岭镇', 4, 3110), +(29869, '安墩镇', 4, 3110), +(29870, '宝口镇', 4, 3110), +(29871, '平山街道', 4, 3110), +(29872, '平海镇', 4, 3110), +(29873, '梁化镇', 4, 3110), +(29874, '白盆珠镇', 4, 3110), +(29875, '白花镇', 4, 3110), +(29876, '稔山镇', 4, 3110), +(29877, '铁涌镇', 4, 3110), +(29878, '高潭镇', 4, 3110), +(29879, '三栋镇', 4, 3111), +(29880, '小金口街道', 4, 3111), +(29881, '惠环街道', 4, 3111), +(29882, '桥东街道', 4, 3111), +(29883, '桥西街道', 4, 3111), +(29884, '横沥镇', 4, 3111), +(29885, '水口街道', 4, 3111), +(29886, '汝湖镇', 4, 3111), +(29887, '江北街道', 4, 3111), +(29888, '江南街道', 4, 3111), +(29889, '沥林镇', 4, 3111), +(29890, '河南岸街道', 4, 3111), +(29891, '潼侨镇', 4, 3111), +(29892, '潼湖镇', 4, 3111), +(29893, '芦洲镇', 4, 3111), +(29894, '陈江街道', 4, 3111), +(29895, '马安镇', 4, 3111), +(29896, '大亚湾经济技术开发区', 4, 3112), +(29897, '平潭镇', 4, 3112), +(29898, '新圩镇', 4, 3112), +(29899, '永湖镇', 4, 3112), +(29900, '沙田镇', 4, 3112), +(29901, '淡水街道', 4, 3112), +(29902, '澳头街道', 4, 3112), +(29903, '秋长街道', 4, 3112), +(29904, '良井镇', 4, 3112), +(29905, '镇隆镇', 4, 3112), +(29906, '霞涌街道', 4, 3112), +(29907, '地派镇', 4, 3113), +(29908, '平陵镇', 4, 3113), +(29909, '永汉镇', 4, 3113), +(29910, '蓝田瑶族乡', 4, 3113), +(29911, '麻榨镇', 4, 3113), +(29912, '龙华镇', 4, 3113), +(29913, '龙城街道', 4, 3113), +(29914, '龙江镇', 4, 3113), +(29915, '龙潭镇', 4, 3113), +(29916, '龙田镇', 4, 3113), +(29917, '丰良镇', 4, 3114), +(29918, '八乡山镇', 4, 3114), +(29919, '北斗镇', 4, 3114), +(29920, '埔寨镇', 4, 3114), +(29921, '大龙华镇', 4, 3114), +(29922, '小胜镇', 4, 3114), +(29923, '建桥镇', 4, 3114); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29924, '汤南镇', 4, 3114), +(29925, '汤坑镇', 4, 3114), +(29926, '汤西镇', 4, 3114), +(29927, '潘田镇', 4, 3114), +(29928, '潭江镇', 4, 3114), +(29929, '留隍镇', 4, 3114), +(29930, '砂田镇', 4, 3114), +(29931, '黄金镇', 4, 3114), +(29932, '龙岗镇', 4, 3114), +(29933, '华城镇', 4, 3115), +(29934, '华阳镇', 4, 3115), +(29935, '双华镇', 4, 3115), +(29936, '周江镇', 4, 3115), +(29937, '安流镇', 4, 3115), +(29938, '岐岭镇', 4, 3115), +(29939, '梅林镇', 4, 3115), +(29940, '棉洋镇', 4, 3115), +(29941, '横陂镇', 4, 3115), +(29942, '水寨镇', 4, 3115), +(29943, '河东镇', 4, 3115), +(29944, '潭下镇', 4, 3115), +(29945, '转水镇', 4, 3115), +(29946, '郭田镇', 4, 3115), +(29947, '长布镇', 4, 3115), +(29948, '龙村镇', 4, 3115), +(29949, '兴田街道', 4, 3116), +(29950, '刁坊镇', 4, 3116), +(29951, '叶塘镇', 4, 3116), +(29952, '合水镇', 4, 3116), +(29953, '坭陂镇', 4, 3116), +(29954, '大坪镇', 4, 3116), +(29955, '宁中镇', 4, 3116), +(29956, '宁新街道', 4, 3116), +(29957, '径南镇', 4, 3116), +(29958, '新圩镇', 4, 3116), +(29959, '新陂镇', 4, 3116), +(29960, '水口镇', 4, 3116), +(29961, '永和镇', 4, 3116), +(29962, '石马镇', 4, 3116), +(29963, '福兴街道', 4, 3116), +(29964, '罗岗镇', 4, 3116), +(29965, '罗浮镇', 4, 3116), +(29966, '黄槐镇', 4, 3116), +(29967, '黄陂镇', 4, 3116), +(29968, '龙田镇', 4, 3116), +(29969, '三河镇', 4, 3117), +(29970, '光德镇', 4, 3117), +(29971, '大东镇', 4, 3117), +(29972, '大麻镇', 4, 3117), +(29973, '枫朗镇', 4, 3117), +(29974, '桃源镇', 4, 3117), +(29975, '洲瑞镇', 4, 3117), +(29976, '湖寮镇', 4, 3117), +(29977, '百侯镇', 4, 3117), +(29978, '茶阳镇', 4, 3117), +(29979, '西河镇', 4, 3117), +(29980, '银江镇', 4, 3117), +(29981, '青溪镇', 4, 3117), +(29982, '高陂镇', 4, 3117), +(29983, '上举镇', 4, 3118), +(29984, '东石镇', 4, 3118), +(29985, '中行镇', 4, 3118), +(29986, '仁居镇', 4, 3118), +(29987, '八尺镇', 4, 3118), +(29988, '大拓镇', 4, 3118), +(29989, '差干镇', 4, 3118); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(29990, '河头镇', 4, 3118), +(29991, '泗水镇', 4, 3118), +(29992, '热柘镇', 4, 3118), +(29993, '石正镇', 4, 3118), +(29994, '长田镇', 4, 3118), +(29995, '丙村镇', 4, 3119), +(29996, '南口镇', 4, 3119), +(29997, '城东镇', 4, 3119), +(29998, '大坪镇', 4, 3119), +(29999, '松口镇', 4, 3119), +(30000, '松源镇', 4, 3119), +(30001, '桃尧镇', 4, 3119), +(30002, '梅南镇', 4, 3119), +(30003, '梅西镇', 4, 3119), +(30004, '水车镇', 4, 3119), +(30005, '畲江镇', 4, 3119), +(30006, '白渡镇', 4, 3119), +(30007, '石坑镇', 4, 3119), +(30008, '石扇镇', 4, 3119), +(30009, '程江镇', 4, 3119), +(30010, '西阳镇', 4, 3119), +(30011, '隆文镇', 4, 3119), +(30012, '雁洋镇', 4, 3119), +(30013, '三角镇', 4, 3120), +(30014, '城北镇', 4, 3120), +(30015, '江南街道', 4, 3120), +(30016, '西郊街道', 4, 3120), +(30017, '金山街道', 4, 3120), +(30018, '长沙镇', 4, 3120), +(30019, '三圳镇', 4, 3121), +(30020, '南礤镇', 4, 3121), +(30021, '广福镇', 4, 3121), +(30022, '文福镇', 4, 3121), +(30023, '新铺镇', 4, 3121), +(30024, '蓝坊镇', 4, 3121), +(30025, '蕉城镇', 4, 3121), +(30026, '长潭镇', 4, 3121), +(30027, '东洲街道', 4, 3122), +(30028, '东涌镇', 4, 3122), +(30029, '凤山街道', 4, 3122), +(30030, '捷胜镇', 4, 3122), +(30031, '新港街道', 4, 3122), +(30032, '田干街道', 4, 3122), +(30033, '红草镇', 4, 3122), +(30034, '遮浪街道', 4, 3122), +(30035, '香洲街道', 4, 3122), +(30036, '马宫街道', 4, 3122), +(30037, '公平镇', 4, 3123), +(30038, '可塘镇', 4, 3123), +(30039, '大湖镇', 4, 3123), +(30040, '小漠镇', 4, 3123), +(30041, '平东镇', 4, 3123), +(30042, '梅陇镇', 4, 3123), +(30043, '海城镇', 4, 3123), +(30044, '联安镇', 4, 3123), +(30045, '赤坑镇', 4, 3123), +(30046, '赤石镇', 4, 3123), +(30047, '陶河镇', 4, 3123), +(30048, '鲘门镇', 4, 3123), +(30049, '鹅埠镇', 4, 3123), +(30050, '黄羌镇', 4, 3123), +(30051, '上英镇', 4, 3124), +(30052, '东海街道', 4, 3124), +(30053, '八万镇', 4, 3124), +(30054, '内湖镇', 4, 3124); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30055, '南塘镇', 4, 3124), +(30056, '博美镇', 4, 3124), +(30057, '城东街道', 4, 3124), +(30058, '大安镇', 4, 3124), +(30059, '桥冲镇', 4, 3124), +(30060, '河东镇', 4, 3124), +(30061, '河西街道', 4, 3124), +(30062, '湖东镇', 4, 3124), +(30063, '潭西镇', 4, 3124), +(30064, '甲东镇', 4, 3124), +(30065, '甲子镇', 4, 3124), +(30066, '甲西镇', 4, 3124), +(30067, '碣石镇', 4, 3124), +(30068, '西南镇', 4, 3124), +(30069, '金厢镇', 4, 3124), +(30070, '陂洋镇', 4, 3124), +(30071, '上护镇', 4, 3125), +(30072, '东坑镇', 4, 3125), +(30073, '南万镇', 4, 3125), +(30074, '新田镇', 4, 3125), +(30075, '水唇镇', 4, 3125), +(30076, '河口镇', 4, 3125), +(30077, '河田镇', 4, 3125), +(30078, '螺溪镇', 4, 3125), +(30079, '上莞镇', 4, 3126), +(30080, '义合镇', 4, 3126), +(30081, '仙塘镇', 4, 3126), +(30082, '半江镇', 4, 3126), +(30083, '双江镇', 4, 3126), +(30084, '叶潭镇', 4, 3126), +(30085, '康禾镇', 4, 3126), +(30086, '新回龙镇', 4, 3126), +(30087, '新港镇', 4, 3126), +(30088, '曾田镇', 4, 3126), +(30089, '柳城镇', 4, 3126), +(30090, '涧头镇', 4, 3126), +(30091, '漳溪畲族乡', 4, 3126), +(30092, '灯塔镇', 4, 3126), +(30093, '船塘镇', 4, 3126), +(30094, '蓝口镇', 4, 3126), +(30095, '锡场镇', 4, 3126), +(30096, '顺天镇', 4, 3126), +(30097, '骆湖镇', 4, 3126), +(30098, '黄村镇', 4, 3126), +(30099, '黄田镇', 4, 3126), +(30100, '上陵镇', 4, 3127), +(30101, '下车镇', 4, 3127), +(30102, '东水镇', 4, 3127), +(30103, '优胜镇', 4, 3127), +(30104, '公白镇', 4, 3127), +(30105, '古寨镇', 4, 3127), +(30106, '合水镇', 4, 3127), +(30107, '大坝镇', 4, 3127), +(30108, '彭寨镇', 4, 3127), +(30109, '林寨镇', 4, 3127), +(30110, '浰源镇', 4, 3127), +(30111, '热水镇', 4, 3127), +(30112, '礼士镇', 4, 3127), +(30113, '贝墩镇', 4, 3127), +(30114, '长塘镇', 4, 3127), +(30115, '阳明镇', 4, 3127), +(30116, '青州镇', 4, 3127), +(30117, '上城街道', 4, 3128), +(30118, '东埔街道', 4, 3128), +(30119, '埔前镇', 4, 3128); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30120, '新江街道', 4, 3128), +(30121, '源南镇', 4, 3128), +(30122, '源西街道', 4, 3128), +(30123, '上义镇', 4, 3129), +(30124, '中坝镇', 4, 3129), +(30125, '临江镇', 4, 3129), +(30126, '义容镇', 4, 3129), +(30127, '乌石镇', 4, 3129), +(30128, '九和镇', 4, 3129), +(30129, '凤安镇', 4, 3129), +(30130, '南岭镇', 4, 3129), +(30131, '古竹镇', 4, 3129), +(30132, '好义镇', 4, 3129), +(30133, '敬梓镇', 4, 3129), +(30134, '柏埔镇', 4, 3129), +(30135, '水墩镇', 4, 3129), +(30136, '瓦溪镇', 4, 3129), +(30137, '紫城镇', 4, 3129), +(30138, '苏区镇', 4, 3129), +(30139, '蓝塘镇', 4, 3129), +(30140, '附城镇', 4, 3129), +(30141, '黄塘镇', 4, 3129), +(30142, '龙窝镇', 4, 3129), +(30143, '三角镇', 4, 3130), +(30144, '上坪镇', 4, 3130), +(30145, '元善镇', 4, 3130), +(30146, '内莞镇', 4, 3130), +(30147, '大湖镇', 4, 3130), +(30148, '忠信镇', 4, 3130), +(30149, '油溪镇', 4, 3130), +(30150, '溪山镇', 4, 3130), +(30151, '田源镇', 4, 3130), +(30152, '绣缎镇', 4, 3130), +(30153, '陂头镇', 4, 3130), +(30154, '隆街镇', 4, 3130), +(30155, '高莞镇', 4, 3130), +(30156, '上坪镇', 4, 3131), +(30157, '丰稔镇', 4, 3131), +(30158, '义都镇', 4, 3131), +(30159, '佗城镇', 4, 3131), +(30160, '四都镇', 4, 3131), +(30161, '岩镇', 4, 3131), +(30162, '新田镇', 4, 3131), +(30163, '田心镇', 4, 3131), +(30164, '登云镇', 4, 3131), +(30165, '紫市镇', 4, 3131), +(30166, '细坳镇', 4, 3131), +(30167, '老隆镇', 4, 3131), +(30168, '贝岭镇', 4, 3131), +(30169, '赤光镇', 4, 3131), +(30170, '车田镇', 4, 3131), +(30171, '通衢镇', 4, 3131), +(30172, '回龙镇', 4, 3131), +(30173, '铁场镇', 4, 3131), +(30174, '附城镇', 4, 3131), +(30175, '鹤市镇', 4, 3131), +(30176, '麻布岗镇', 4, 3131), +(30177, '黄布镇', 4, 3131), +(30178, '黄石镇', 4, 3131), +(30179, '黎咀镇', 4, 3131), +(30180, '龙母镇', 4, 3131), +(30181, '南恩街道', 4, 3132), +(30182, '双捷镇', 4, 3132), +(30183, '城东街道', 4, 3132), +(30184, '城南街道', 4, 3132); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30185, '城西街道', 4, 3132), +(30186, '埠场镇', 4, 3132), +(30187, '太傅街道', 4, 3132), +(30188, '岗列街道', 4, 3132), +(30189, '平冈镇', 4, 3132), +(30190, '海陵镇', 4, 3132), +(30191, '渔洲街道', 4, 3132), +(30192, '漠阳街道', 4, 3132), +(30193, '白沙街道', 4, 3132), +(30194, '观光街道', 4, 3132), +(30195, '闸坡镇', 4, 3132), +(30196, '东城镇', 4, 3133), +(30197, '东平镇', 4, 3133), +(30198, '北惯镇', 4, 3133), +(30199, '合山镇', 4, 3133), +(30200, '塘坪镇', 4, 3133), +(30201, '大八镇', 4, 3133), +(30202, '大沟镇', 4, 3133), +(30203, '新洲镇', 4, 3133), +(30204, '那龙镇', 4, 3133), +(30205, '雅韶镇', 4, 3133), +(30206, '麻汕镇', 4, 3133), +(30207, '三甲镇', 4, 3134), +(30208, '八甲镇', 4, 3134), +(30209, '双窖镇', 4, 3134), +(30210, '合水镇', 4, 3134), +(30211, '圭岗镇', 4, 3134), +(30212, '岗美镇', 4, 3134), +(30213, '春城街道', 4, 3134), +(30214, '春湾镇', 4, 3134), +(30215, '松柏镇', 4, 3134), +(30216, '永宁镇', 4, 3134), +(30217, '河口镇', 4, 3134), +(30218, '河塱镇', 4, 3134), +(30219, '潭水镇', 4, 3134), +(30220, '石望镇', 4, 3134), +(30221, '陂面镇', 4, 3134), +(30222, '马水镇', 4, 3134), +(30223, '上洋镇', 4, 3135), +(30224, '儒洞镇', 4, 3135), +(30225, '塘口镇', 4, 3135), +(30226, '新圩镇', 4, 3135), +(30227, '沙扒镇', 4, 3135), +(30228, '溪头镇', 4, 3135), +(30229, '程村镇', 4, 3135), +(30230, '织篢镇', 4, 3135), +(30231, '水头镇', 4, 3136), +(30232, '汤塘镇', 4, 3136), +(30233, '石角镇', 4, 3136), +(30234, '迳头镇', 4, 3136), +(30235, '高岗镇', 4, 3136), +(30236, '龙山镇', 4, 3136), +(30237, '东岗街道', 4, 3137), +(30238, '横荷街道', 4, 3137), +(30239, '洲心街道', 4, 3137), +(30240, '源潭镇', 4, 3137), +(30241, '石角镇', 4, 3137), +(30242, '观城街道', 4, 3137), +(30243, '龙塘镇', 4, 3137), +(30244, '三坑镇', 4, 3138), +(30245, '太和镇', 4, 3138), +(30246, '太平镇', 4, 3138), +(30247, '山塘镇', 4, 3138), +(30248, '浸潭镇', 4, 3138), +(30249, '石潭镇', 4, 3138); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30250, '禾云镇', 4, 3138), +(30251, '飞来峡镇', 4, 3138), +(30252, '龙颈镇', 4, 3138), +(30253, '下石太镇(“石太”合为一字)', 4, 3139), +(30254, '东华镇', 4, 3139), +(30255, '九龙镇', 4, 3139), +(30256, '大洞镇', 4, 3139), +(30257, '大湾镇', 4, 3139), +(30258, '大站镇', 4, 3139), +(30259, '望埠镇', 4, 3139), +(30260, '桥头镇', 4, 3139), +(30261, '横石塘镇', 4, 3139), +(30262, '横石水镇', 4, 3139), +(30263, '水边镇', 4, 3139), +(30264, '沙口镇', 4, 3139), +(30265, '波罗镇', 4, 3139), +(30266, '浛洸镇', 4, 3139), +(30267, '白沙镇', 4, 3139), +(30268, '石灰铺镇', 4, 3139), +(30269, '石牯塘镇', 4, 3139), +(30270, '英城街道', 4, 3139), +(30271, '英红镇', 4, 3139), +(30272, '西牛镇', 4, 3139), +(30273, '连江口镇', 4, 3139), +(30274, '青塘镇', 4, 3139), +(30275, '黄花镇', 4, 3139), +(30276, '黎溪镇', 4, 3139), +(30277, '三排镇', 4, 3140), +(30278, '三江镇', 4, 3140), +(30279, '大坪镇', 4, 3140), +(30280, '大麦山镇', 4, 3140), +(30281, '寨岗镇', 4, 3140), +(30282, '涡水镇', 4, 3140), +(30283, '香坪镇', 4, 3140), +(30284, '上帅镇', 4, 3141), +(30285, '吉田镇', 4, 3141), +(30286, '太保镇', 4, 3141), +(30287, '小三江镇', 4, 3141), +(30288, '永和镇', 4, 3141), +(30289, '福堂镇', 4, 3141), +(30290, '禾洞镇', 4, 3141), +(30291, '三水瑶族乡', 4, 3142), +(30292, '东陂镇', 4, 3142), +(30293, '丰阳镇', 4, 3142), +(30294, '九陂镇', 4, 3142), +(30295, '保安镇', 4, 3142), +(30296, '大路边镇', 4, 3142), +(30297, '星子镇', 4, 3142), +(30298, '瑶安瑶族乡', 4, 3142), +(30299, '西岸镇', 4, 3142), +(30300, '西江镇', 4, 3142), +(30301, '连州镇', 4, 3142), +(30302, '龙坪镇', 4, 3142), +(30303, '七拱镇', 4, 3143), +(30304, '大崀镇', 4, 3143), +(30305, '太平镇', 4, 3143), +(30306, '小江镇', 4, 3143), +(30307, '岭背镇', 4, 3143), +(30308, '杜步镇', 4, 3143), +(30309, '杨梅镇', 4, 3143), +(30310, '江英镇', 4, 3143), +(30311, '秤架瑶族乡', 4, 3143), +(30312, '阳城镇', 4, 3143); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30313, '青莲镇', 4, 3143), +(30314, '黄坌镇', 4, 3143), +(30315, '黎埠镇', 4, 3143), +(30316, '万江街道', 4, 3144), +(30317, '东坑镇', 4, 3144), +(30318, '东城街道', 4, 3144), +(30319, '中堂镇', 4, 3144), +(30320, '企石镇', 4, 3144), +(30321, '凤岗镇', 4, 3144), +(30322, '南城街道', 4, 3144), +(30323, '厚街镇', 4, 3144), +(30324, '塘厦镇', 4, 3144), +(30325, '大岭山镇', 4, 3144), +(30326, '大朗镇', 4, 3144), +(30327, '寮步镇', 4, 3144), +(30328, '常平镇', 4, 3144), +(30329, '望牛墩镇', 4, 3144), +(30330, '桥头镇', 4, 3144), +(30331, '樟木头镇', 4, 3144), +(30332, '横沥镇', 4, 3144), +(30333, '沙田镇', 4, 3144), +(30334, '洪梅镇', 4, 3144), +(30335, '清溪镇', 4, 3144), +(30336, '石排镇', 4, 3144), +(30337, '石碣镇', 4, 3144), +(30338, '石龙镇', 4, 3144), +(30339, '茶山镇', 4, 3144), +(30340, '莞城街道', 4, 3144), +(30341, '虎门镇', 4, 3144), +(30342, '谢岗镇', 4, 3144), +(30343, '道窖镇', 4, 3144), +(30344, '长安镇', 4, 3144), +(30345, '高埗镇', 4, 3144), +(30346, '麻涌镇', 4, 3144), +(30347, '黄江镇', 4, 3144), +(30348, '三乡镇', 4, 3145), +(30349, '三角镇', 4, 3145), +(30350, '东凤镇', 4, 3145), +(30351, '东区街道', 4, 3145), +(30352, '东升镇', 4, 3145), +(30353, '中山港街道', 4, 3145), +(30354, '五桂山街道', 4, 3145), +(30355, '南头镇', 4, 3145), +(30356, '南朗镇', 4, 3145), +(30357, '古镇镇', 4, 3145), +(30358, '坦洲镇', 4, 3145), +(30359, '大涌镇', 4, 3145), +(30360, '小榄镇', 4, 3145), +(30361, '板芙镇', 4, 3145), +(30362, '横栏镇', 4, 3145), +(30363, '民众镇', 4, 3145), +(30364, '沙溪镇', 4, 3145), +(30365, '港口镇', 4, 3145), +(30366, '环城街道', 4, 3145), +(30367, '石岐街道', 4, 3145), +(30368, '神湾镇', 4, 3145), +(30369, '西区街道', 4, 3145), +(30370, '阜沙镇', 4, 3145), +(30371, '黄圃镇', 4, 3145), +(30372, '凤新街道', 4, 3146), +(30373, '南春街道', 4, 3146), +(30374, '城西街道', 4, 3146), +(30375, '太平街道', 4, 3146), +(30376, '意溪镇', 4, 3146); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30377, '桥东街道', 4, 3146), +(30378, '湘桥街道', 4, 3146), +(30379, '西新街道', 4, 3146), +(30380, '西湖街道', 4, 3146), +(30381, '金山街道', 4, 3146), +(30382, '东凤镇', 4, 3147), +(30383, '凤凰镇', 4, 3147), +(30384, '凤塘镇', 4, 3147), +(30385, '古巷镇', 4, 3147), +(30386, '官塘镇', 4, 3147), +(30387, '庵埠镇', 4, 3147), +(30388, '归湖镇', 4, 3147), +(30389, '彩塘镇', 4, 3147), +(30390, '文祠镇', 4, 3147), +(30391, '枫溪镇', 4, 3147), +(30392, '江东镇', 4, 3147), +(30393, '沙溪镇', 4, 3147), +(30394, '浮洋镇', 4, 3147), +(30395, '登塘镇', 4, 3147), +(30396, '磷溪镇', 4, 3147), +(30397, '赤凤镇', 4, 3147), +(30398, '金石镇', 4, 3147), +(30399, '铁铺镇', 4, 3147), +(30400, '龙湖镇', 4, 3147), +(30401, '三饶镇', 4, 3148), +(30402, '上饶镇', 4, 3148), +(30403, '东山镇', 4, 3148), +(30404, '大埕镇', 4, 3148), +(30405, '建饶镇', 4, 3148), +(30406, '所城镇', 4, 3148), +(30407, '新丰镇', 4, 3148), +(30408, '新圩镇', 4, 3148), +(30409, '新塘镇', 4, 3148), +(30410, '柘林镇', 4, 3148), +(30411, '樟溪镇', 4, 3148), +(30412, '汤溪镇', 4, 3148), +(30413, '汫洲镇', 4, 3148), +(30414, '浮山镇', 4, 3148), +(30415, '浮滨镇', 4, 3148), +(30416, '海山镇', 4, 3148), +(30417, '联饶镇', 4, 3148), +(30418, '钱东镇', 4, 3148), +(30419, '饶洋镇', 4, 3148), +(30420, '高堂镇', 4, 3148), +(30421, '黄冈镇', 4, 3148), +(30422, '东港镇', 4, 3149), +(30423, '东陇镇', 4, 3149), +(30424, '仙庵镇', 4, 3149), +(30425, '前詹镇', 4, 3149), +(30426, '华湖镇', 4, 3149), +(30427, '周田镇', 4, 3149), +(30428, '岐石镇', 4, 3149), +(30429, '惠城镇', 4, 3149), +(30430, '溪西镇', 4, 3149), +(30431, '神泉镇', 4, 3149), +(30432, '葵潭镇', 4, 3149), +(30433, '隆江镇', 4, 3149), +(30434, '靖海镇', 4, 3149), +(30435, '鳌江镇', 4, 3149), +(30436, '云路镇', 4, 3150), +(30437, '地都镇', 4, 3150), +(30438, '埔田镇', 4, 3150), +(30439, '新亨镇', 4, 3150), +(30440, '曲溪镇', 4, 3150), +(30441, '月城镇', 4, 3150); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30442, '桂岭镇', 4, 3150), +(30443, '炮台镇', 4, 3150), +(30444, '玉湖镇', 4, 3150), +(30445, '玉窖镇', 4, 3150), +(30446, '登岗镇', 4, 3150), +(30447, '白塔镇', 4, 3150), +(30448, '锡场镇', 4, 3150), +(30449, '霖磐镇', 4, 3150), +(30450, '龙尾镇', 4, 3150), +(30451, '上砂镇', 4, 3151), +(30452, '东园镇', 4, 3151), +(30453, '五云镇', 4, 3151), +(30454, '五经富镇', 4, 3151), +(30455, '京溪园镇', 4, 3151), +(30456, '凤江镇', 4, 3151), +(30457, '南山镇', 4, 3151), +(30458, '坪上镇', 4, 3151), +(30459, '塔头镇', 4, 3151), +(30460, '大溪镇', 4, 3151), +(30461, '棉湖镇', 4, 3151), +(30462, '河婆镇', 4, 3151), +(30463, '灰寨镇', 4, 3151), +(30464, '良田乡', 4, 3151), +(30465, '金和镇', 4, 3151), +(30466, '钱坑镇', 4, 3151), +(30467, '龙潭镇', 4, 3151), +(30468, '下架山镇', 4, 3152), +(30469, '云落镇', 4, 3152), +(30470, '军埠镇', 4, 3152), +(30471, '南径镇', 4, 3152), +(30472, '南溪镇', 4, 3152), +(30473, '占陇镇', 4, 3152), +(30474, '大南山镇', 4, 3152), +(30475, '大坝镇', 4, 3152), +(30476, '大坪镇', 4, 3152), +(30477, '广太镇', 4, 3152), +(30478, '梅塘镇', 4, 3152), +(30479, '梅林镇', 4, 3152), +(30480, '池尾街道', 4, 3152), +(30481, '洪阳镇', 4, 3152), +(30482, '流沙东街道', 4, 3152), +(30483, '流沙北街道', 4, 3152), +(30484, '流沙南街道', 4, 3152), +(30485, '流沙西街道', 4, 3152), +(30486, '燎原镇', 4, 3152), +(30487, '船埔镇', 4, 3152), +(30488, '赤岗镇', 4, 3152), +(30489, '里湖镇', 4, 3152), +(30490, '高埔镇', 4, 3152), +(30491, '鮜溪乡', 4, 3152), +(30492, '麒麟镇', 4, 3152), +(30493, '东兴街道', 4, 3153), +(30494, '东升街道', 4, 3153), +(30495, '东阳街道', 4, 3153), +(30496, '中山街道', 4, 3153), +(30497, '仙桥街道', 4, 3153), +(30498, '新兴街道', 4, 3153), +(30499, '梅云街道', 4, 3153), +(30500, '榕东街道', 4, 3153), +(30501, '榕华街道', 4, 3153), +(30502, '渔湖镇', 4, 3153), +(30503, '磐东街道', 4, 3153), +(30504, '西马街道', 4, 3153); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30505, '云城街道', 4, 3154), +(30506, '安塘街道', 4, 3154), +(30507, '思劳镇', 4, 3154), +(30508, '河口街道', 4, 3154), +(30509, '腰古镇', 4, 3154), +(30510, '都杨镇', 4, 3154), +(30511, '高峰街道', 4, 3154), +(30512, '六都镇', 4, 3155), +(30513, '前锋镇', 4, 3155), +(30514, '南盛镇', 4, 3155), +(30515, '富林镇', 4, 3155), +(30516, '白石镇', 4, 3155), +(30517, '石城镇', 4, 3155), +(30518, '镇安镇', 4, 3155), +(30519, '高村镇', 4, 3155), +(30520, '东成镇', 4, 3156), +(30521, '六祖镇', 4, 3156), +(30522, '大江镇', 4, 3156), +(30523, '天堂镇', 4, 3156), +(30524, '太平镇', 4, 3156), +(30525, '新城镇', 4, 3156), +(30526, '水台镇', 4, 3156), +(30527, '河头镇', 4, 3156), +(30528, '稔村镇', 4, 3156), +(30529, '簕竹镇', 4, 3156), +(30530, '车岗镇', 4, 3156), +(30531, '里洞镇', 4, 3156), +(30532, 'X塘镇', 4, 3157), +(30533, '分界镇', 4, 3157), +(30534, '加益镇', 4, 3157), +(30535, '华石镇', 4, 3157), +(30536, '双东街道', 4, 3157), +(30537, '围底镇', 4, 3157), +(30538, '城东街道', 4, 3157), +(30539, '城西街道', 4, 3157), +(30540, '太平镇', 4, 3157), +(30541, '榃滨镇', 4, 3157), +(30542, '泗纶镇', 4, 3157), +(30543, '生江镇', 4, 3157), +(30544, '素龙街道', 4, 3157), +(30545, '罗城街道', 4, 3157), +(30546, '罗平镇', 4, 3157), +(30547, '罗镜镇', 4, 3157), +(30548, '船步镇', 4, 3157), +(30549, '苹塘镇', 4, 3157), +(30550, '连州镇', 4, 3157), +(30551, '金鸡镇', 4, 3157), +(30552, '附城街道', 4, 3157), +(30553, '黎少镇', 4, 3157), +(30554, '龙湾镇', 4, 3157), +(30555, '东坝镇', 4, 3158), +(30556, '千官镇', 4, 3158), +(30557, '南江口镇', 4, 3158), +(30558, '历洞镇', 4, 3158), +(30559, '大方镇', 4, 3158), +(30560, '大湾镇', 4, 3158), +(30561, '宋桂镇', 4, 3158), +(30562, '宝珠镇', 4, 3158), +(30563, '平台镇', 4, 3158), +(30564, '建城镇', 4, 3158), +(30565, '桂圩镇', 4, 3158), +(30566, '河口镇', 4, 3158), +(30567, '连滩镇', 4, 3158), +(30568, '通门镇', 4, 3158), +(30569, '都城镇', 4, 3158); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30570, '三里镇', 4, 3159), +(30571, '乔贤镇', 4, 3159), +(30572, '塘红乡', 4, 3159), +(30573, '大丰镇', 4, 3159), +(30574, '巷贤镇', 4, 3159), +(30575, '明亮镇', 4, 3159), +(30576, '木山乡', 4, 3159), +(30577, '澄泰乡', 4, 3159), +(30578, '白圩镇', 4, 3159), +(30579, '西燕镇', 4, 3159), +(30580, '镇圩瑶族乡', 4, 3159), +(30581, '三塘镇', 4, 3160), +(30582, '五塘镇', 4, 3160), +(30583, '昆仑镇', 4, 3160), +(30584, '朝阳街道', 4, 3160), +(30585, '民生街道', 4, 3160), +(30586, '中华镇', 4, 3161), +(30587, '古辣镇', 4, 3161), +(30588, '和吉镇', 4, 3161), +(30589, '大桥镇', 4, 3161), +(30590, '思陇镇', 4, 3161), +(30591, '新圩镇', 4, 3161), +(30592, '新桥镇', 4, 3161), +(30593, '武陵镇', 4, 3161), +(30594, '洋桥镇', 4, 3161), +(30595, '王灵镇', 4, 3161), +(30596, '甘棠镇', 4, 3161), +(30597, '芦圩镇', 4, 3161), +(30598, '邹圩镇', 4, 3161), +(30599, '陈平乡', 4, 3161), +(30600, '露圩镇', 4, 3161), +(30601, '黎塘镇', 4, 3161), +(30602, '云表镇', 4, 3162), +(30603, '六景镇', 4, 3162), +(30604, '南乡镇', 4, 3162), +(30605, '峦城镇', 4, 3162), +(30606, '平朗乡', 4, 3162), +(30607, '平马镇', 4, 3162), +(30608, '新福镇', 4, 3162), +(30609, '校椅镇', 4, 3162), +(30610, '横州镇', 4, 3162), +(30611, '百合镇', 4, 3162), +(30612, '石塘镇', 4, 3162), +(30613, '莲塘镇', 4, 3162), +(30614, '那阳镇', 4, 3162), +(30615, '镇龙乡', 4, 3162), +(30616, '陶圩镇', 4, 3162), +(30617, '马山乡', 4, 3162), +(30618, '马岭镇', 4, 3162), +(30619, '两江镇', 4, 3163), +(30620, '仙湖镇', 4, 3163), +(30621, '双桥镇', 4, 3163), +(30622, '城厢镇', 4, 3163), +(30623, '太平镇', 4, 3163), +(30624, '宁武镇', 4, 3163), +(30625, '府城镇', 4, 3163), +(30626, '灵马镇', 4, 3163), +(30627, '甘圩镇', 4, 3163), +(30628, '罗波镇', 4, 3163), +(30629, '锣圩镇', 4, 3163), +(30630, '陆斡镇', 4, 3163), +(30631, '马头镇', 4, 3163), +(30632, '吴圩镇', 4, 3164), +(30633, '延安镇', 4, 3164), +(30634, '江南街道', 4, 3164); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30635, '江西镇', 4, 3164), +(30636, '沙井街道', 4, 3164), +(30637, '福建园街道', 4, 3164), +(30638, '苏圩镇', 4, 3164), +(30639, '那洪街道', 4, 3164), +(30640, '南晓镇', 4, 3165), +(30641, '大塘镇', 4, 3165), +(30642, '良庆镇', 4, 3165), +(30643, '那陈镇', 4, 3165), +(30644, '那马镇', 4, 3165), +(30645, '上尧街道', 4, 3166), +(30646, '北湖街道', 4, 3166), +(30647, '华强街道', 4, 3166), +(30648, '双定镇', 4, 3166), +(30649, '坛洛镇', 4, 3166), +(30650, '安吉街道', 4, 3166), +(30651, '安宁街道', 4, 3166), +(30652, '心圩街道', 4, 3166), +(30653, '新阳街道', 4, 3166), +(30654, '石埠街道', 4, 3166), +(30655, '衡阳街道', 4, 3166), +(30656, '西乡塘街道', 4, 3166), +(30657, '金陵镇', 4, 3166), +(30658, '中和乡', 4, 3167), +(30659, '新江镇', 4, 3167), +(30660, '百济乡', 4, 3167), +(30661, '蒲庙镇', 4, 3167), +(30662, '那楼镇', 4, 3167), +(30663, '丁当镇', 4, 3168), +(30664, '乔建镇', 4, 3168), +(30665, '南圩镇', 4, 3168), +(30666, '古潭乡', 4, 3168), +(30667, '城厢镇', 4, 3168), +(30668, '屏山乡', 4, 3168), +(30669, '布泉乡', 4, 3168), +(30670, '那桐镇', 4, 3168), +(30671, '都结乡', 4, 3168), +(30672, '雁江镇', 4, 3168), +(30673, '中山街道', 4, 3169), +(30674, '伶俐镇', 4, 3169), +(30675, '刘圩镇', 4, 3169), +(30676, '南湖街道', 4, 3169), +(30677, '南阳镇', 4, 3169), +(30678, '建政街道', 4, 3169), +(30679, '新竹街道', 4, 3169), +(30680, '津头街道', 4, 3169), +(30681, '长塘镇', 4, 3169), +(30682, '乔利乡', 4, 3170), +(30683, '加方乡', 4, 3170), +(30684, '古寨瑶族乡', 4, 3170), +(30685, '古零镇', 4, 3170), +(30686, '周鹿镇', 4, 3170), +(30687, '林圩镇', 4, 3170), +(30688, '永州镇', 4, 3170), +(30689, '白山镇', 4, 3170), +(30690, '百龙滩镇', 4, 3170), +(30691, '里当瑶族乡', 4, 3170), +(30692, '金钗镇', 4, 3170), +(30693, '丹洲镇', 4, 3171), +(30694, '八江乡', 4, 3171), +(30695, '古宜镇', 4, 3171), +(30696, '同乐苗族乡', 4, 3171), +(30697, '和平乡', 4, 3171); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30698, '富禄苗族乡', 4, 3171), +(30699, '斗江镇', 4, 3171), +(30700, '林溪乡', 4, 3171), +(30701, '梅林乡', 4, 3171), +(30702, '洋溪乡', 4, 3171), +(30703, '独峒乡', 4, 3171), +(30704, '程村乡', 4, 3171), +(30705, '老堡乡', 4, 3171), +(30706, '良口乡', 4, 3171), +(30707, '高基瑶族乡', 4, 3171), +(30708, '中南街道', 4, 3172), +(30709, '公园街道', 4, 3172), +(30710, '城中街道', 4, 3172), +(30711, '水上街道', 4, 3172), +(30712, '河东街道', 4, 3172), +(30713, '潭中街道', 4, 3172), +(30714, '静兰街道', 4, 3172), +(30715, '柳长街道', 4, 3173), +(30716, '沙塘镇', 4, 3173), +(30717, '洛埠镇', 4, 3173), +(30718, '白露街道', 4, 3173), +(30719, '石碑坪镇', 4, 3173), +(30720, '胜利街道', 4, 3173), +(30721, '解放街道', 4, 3173), +(30722, '钢城街道', 4, 3173), +(30723, '锦绣街道', 4, 3173), +(30724, '长塘镇', 4, 3173), +(30725, '雀儿山街道', 4, 3173), +(30726, '雅儒街道', 4, 3173), +(30727, '南环街道', 4, 3174), +(30728, '南站街道', 4, 3174), +(30729, '太阳村镇', 4, 3174), +(30730, '柳南街道', 4, 3174), +(30731, '柳石街道', 4, 3174), +(30732, '河西街道', 4, 3174), +(30733, '潭西街道', 4, 3174), +(30734, '银山街道', 4, 3174), +(30735, '鹅山街道', 4, 3174), +(30736, '东泉镇', 4, 3175), +(30737, '六塘镇', 4, 3175), +(30738, '冲脉镇', 4, 3175), +(30739, '凤山镇', 4, 3175), +(30740, '古砦仫佬族乡', 4, 3175), +(30741, '大埔镇', 4, 3175), +(30742, '太平镇', 4, 3175), +(30743, '寨隆镇', 4, 3175), +(30744, '沙埔镇', 4, 3175), +(30745, '社冲乡', 4, 3175), +(30746, '马山乡', 4, 3175), +(30747, '龙头镇', 4, 3175), +(30748, '三都镇', 4, 3176), +(30749, '土博镇', 4, 3176), +(30750, '成团镇', 4, 3176), +(30751, '拉堡镇', 4, 3176), +(30752, '洛满镇', 4, 3176), +(30753, '流山镇', 4, 3176), +(30754, '白沙乡', 4, 3176), +(30755, '百朋镇', 4, 3176), +(30756, '穿山镇', 4, 3176), +(30757, '进德镇', 4, 3176), +(30758, '里雍镇', 4, 3176), +(30759, '里高镇', 4, 3176), +(30760, '东起乡', 4, 3177); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30761, '大坡乡', 4, 3177), +(30762, '大将镇', 4, 3177), +(30763, '大良镇', 4, 3177), +(30764, '板榄镇', 4, 3177), +(30765, '桥板乡', 4, 3177), +(30766, '沙子乡', 4, 3177), +(30767, '泗顶镇', 4, 3177), +(30768, '浮石镇', 4, 3177), +(30769, '潭头乡', 4, 3177), +(30770, '长安镇', 4, 3177), +(30771, '雅瑶乡', 4, 3177), +(30772, '三防镇', 4, 3178), +(30773, '同练瑶族乡', 4, 3178), +(30774, '和睦镇', 4, 3178), +(30775, '四荣乡', 4, 3178), +(30776, '大年乡', 4, 3178), +(30777, '大浪乡', 4, 3178), +(30778, '安太乡', 4, 3178), +(30779, '安陲乡', 4, 3178), +(30780, '怀宝镇', 4, 3178), +(30781, '拱洞乡', 4, 3178), +(30782, '杆洞乡', 4, 3178), +(30783, '永乐乡', 4, 3178), +(30784, '汪洞乡', 4, 3178), +(30785, '洞头乡', 4, 3178), +(30786, '滚贝侗族乡', 4, 3178), +(30787, '白云乡', 4, 3178), +(30788, '红水乡', 4, 3178), +(30789, '良寨乡', 4, 3178), +(30790, '融水镇', 4, 3178), +(30791, '香粉乡', 4, 3178), +(30792, '五里亭街道', 4, 3179), +(30793, '天马街道', 4, 3179), +(30794, '白莲街道', 4, 3179), +(30795, '箭盘街道', 4, 3179), +(30796, '荣军街道', 4, 3179), +(30797, '阳和街道', 4, 3179), +(30798, '驾鹤街道', 4, 3179), +(30799, '麒麟街道', 4, 3179), +(30800, '中渡镇', 4, 3180), +(30801, '四排乡', 4, 3180), +(30802, '寨沙镇', 4, 3180), +(30803, '导江乡', 4, 3180), +(30804, '平山镇', 4, 3180), +(30805, '拉沟乡', 4, 3180), +(30806, '江口乡', 4, 3180), +(30807, '雒容镇', 4, 3180), +(30808, '鹿寨镇', 4, 3180), +(30809, '黄冕乡', 4, 3180), +(30810, '七星街道', 4, 3181), +(30811, '东江街道', 4, 3181), +(30812, '朝阳乡', 4, 3181), +(30813, '穿山街道', 4, 3181), +(30814, '两江镇', 4, 3182), +(30815, '中庸乡', 4, 3182), +(30816, '临桂镇', 4, 3182), +(30817, '五通镇', 4, 3182), +(30818, '会仙镇', 4, 3182), +(30819, '六塘镇', 4, 3182), +(30820, '南边山乡', 4, 3182), +(30821, '四塘乡', 4, 3182), +(30822, '宛田瑶族乡', 4, 3182), +(30823, '茶洞乡', 4, 3182), +(30824, '黄沙瑶族乡', 4, 3182); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30825, '东山瑶族乡', 4, 3183), +(30826, '两河乡', 4, 3183), +(30827, '全州镇', 4, 3183), +(30828, '凤凰乡', 4, 3183), +(30829, '咸水乡', 4, 3183), +(30830, '大西江镇', 4, 3183), +(30831, '安和乡', 4, 3183), +(30832, '庙头镇', 4, 3183), +(30833, '才湾镇', 4, 3183), +(30834, '文桥镇', 4, 3183), +(30835, '枧塘乡', 4, 3183), +(30836, '永岁乡', 4, 3183), +(30837, '白宝乡', 4, 3183), +(30838, '石塘镇', 4, 3183), +(30839, '绍水镇', 4, 3183), +(30840, '蕉江瑶族乡', 4, 3183), +(30841, '黄沙河镇', 4, 3183), +(30842, '龙水镇', 4, 3183), +(30843, '严关镇', 4, 3184), +(30844, '兴安镇', 4, 3184), +(30845, '华江瑶族乡', 4, 3184), +(30846, '崔家乡', 4, 3184), +(30847, '湘漓镇', 4, 3184), +(30848, '溶江镇', 4, 3184), +(30849, '漠川乡', 4, 3184), +(30850, '界首镇', 4, 3184), +(30851, '白石乡', 4, 3184), +(30852, '高尚镇', 4, 3184), +(30853, '北门街道', 4, 3185), +(30854, '叠彩街道', 4, 3185), +(30855, '大河乡', 4, 3185), +(30856, '二塘镇', 4, 3186), +(30857, '同安镇', 4, 3186), +(30858, '大发瑶族乡', 4, 3186), +(30859, '平乐镇', 4, 3186), +(30860, '张家镇', 4, 3186), +(30861, '桥亭乡', 4, 3186), +(30862, '沙子镇', 4, 3186), +(30863, '源头镇', 4, 3186), +(30864, '阳安乡', 4, 3186), +(30865, '青龙乡', 4, 3186), +(30866, '三江乡', 4, 3187), +(30867, '嘉会乡', 4, 3187), +(30868, '平安乡', 4, 3187), +(30869, '恭城镇', 4, 3187), +(30870, '栗木镇', 4, 3187), +(30871, '莲花镇', 4, 3187), +(30872, '西岭乡', 4, 3187), +(30873, '观音乡', 4, 3187), +(30874, '龙虎乡', 4, 3187), +(30875, '三皇乡', 4, 3188), +(30876, '堡里乡', 4, 3188), +(30877, '广福乡', 4, 3188), +(30878, '永安乡', 4, 3188), +(30879, '永福镇', 4, 3188), +(30880, '百寿镇', 4, 3188), +(30881, '罗锦镇', 4, 3188), +(30882, '苏桥镇', 4, 3188), +(30883, '龙江乡', 4, 3188), +(30884, '文市镇', 4, 3189), +(30885, '新圩乡', 4, 3189), +(30886, '新街乡', 4, 3189), +(30887, '水车乡', 4, 3189), +(30888, '洞井瑶族乡', 4, 3189); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30889, '灌阳镇', 4, 3189), +(30890, '西山瑶族乡', 4, 3189), +(30891, '观音阁乡', 4, 3189), +(30892, '黄关镇', 4, 3189), +(30893, '三街镇', 4, 3190), +(30894, '兰田瑶族乡', 4, 3190), +(30895, '大圩镇', 4, 3190), +(30896, '大境瑶族乡', 4, 3190), +(30897, '定江镇', 4, 3190), +(30898, '海洋乡', 4, 3190), +(30899, '潭下镇', 4, 3190), +(30900, '潮田乡', 4, 3190), +(30901, '灵川镇', 4, 3190), +(30902, '灵田乡', 4, 3190), +(30903, '青狮潭镇', 4, 3190), +(30904, '丽君街道', 4, 3191), +(30905, '甲山街道', 4, 3191), +(30906, '秀峰街道', 4, 3191), +(30907, '东昌镇', 4, 3192), +(30908, '修仁镇', 4, 3192), +(30909, '双江镇', 4, 3192), +(30910, '大塘镇', 4, 3192), +(30911, '新坪镇', 4, 3192), +(30912, '杜莫镇', 4, 3192), +(30913, '花箦镇', 4, 3192), +(30914, '茶城乡', 4, 3192), +(30915, '荔城镇', 4, 3192), +(30916, '蒲芦瑶族乡', 4, 3192), +(30917, '青山镇', 4, 3192), +(30918, '马岭镇', 4, 3192), +(30919, '龙怀乡', 4, 3192), +(30920, '二塘乡', 4, 3193), +(30921, '南门街道', 4, 3193), +(30922, '平山街道', 4, 3193), +(30923, '象山街道', 4, 3193), +(30924, '两水苗族乡', 4, 3194), +(30925, '中峰乡', 4, 3194), +(30926, '梅溪乡', 4, 3194), +(30927, '河口瑶族乡', 4, 3194), +(30928, '瓜里乡', 4, 3194), +(30929, '资源镇', 4, 3194), +(30930, '车田苗族乡', 4, 3194), +(30931, '兴坪镇', 4, 3195), +(30932, '普益乡', 4, 3195), +(30933, '杨堤乡', 4, 3195), +(30934, '白沙镇', 4, 3195), +(30935, '福利镇', 4, 3195), +(30936, '葡萄镇', 4, 3195), +(30937, '金宝乡', 4, 3195), +(30938, '阳朔镇', 4, 3195), +(30939, '高田镇', 4, 3195), +(30940, '大埠乡', 4, 3196), +(30941, '柘木镇', 4, 3196), +(30942, '草坪回族乡', 4, 3196), +(30943, '雁山街道', 4, 3196), +(30944, '雁山镇', 4, 3196), +(30945, '三门镇', 4, 3197), +(30946, '乐江乡', 4, 3197), +(30947, '伟江乡', 4, 3197), +(30948, '和平乡', 4, 3197), +(30949, '平等乡', 4, 3197), +(30950, '江底乡', 4, 3197), +(30951, '泗水乡', 4, 3197); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(30952, '瓢里镇', 4, 3197), +(30953, '马堤乡', 4, 3197), +(30954, '龙胜镇', 4, 3197), +(30955, '城东街道', 4, 3198), +(30956, '城东镇', 4, 3198), +(30957, '城中街道', 4, 3198), +(30958, '城北街道', 4, 3198), +(30959, '城南街道', 4, 3198), +(30960, '旺甫镇', 4, 3198), +(30961, '三堡镇', 4, 3199), +(30962, '南渡镇', 4, 3199), +(30963, '大业镇', 4, 3199), +(30964, '大隆镇', 4, 3199), +(30965, '安平镇', 4, 3199), +(30966, '岑城镇', 4, 3199), +(30967, '归义镇', 4, 3199), +(30968, '梨木镇', 4, 3199), +(30969, '水汶镇', 4, 3199), +(30970, '波塘镇', 4, 3199), +(30971, '筋竹镇', 4, 3199), +(30972, '糯垌镇', 4, 3199), +(30973, '诚谏镇', 4, 3199), +(30974, '马路镇', 4, 3199), +(30975, '京南镇', 4, 3200), +(30976, '人和镇', 4, 3200), +(30977, '六堡镇', 4, 3200), +(30978, '大坡镇', 4, 3200), +(30979, '岭脚镇', 4, 3200), +(30980, '广平镇', 4, 3200), +(30981, '新地镇', 4, 3200), +(30982, '木双镇', 4, 3200), +(30983, '梨埠镇', 4, 3200), +(30984, '沙头镇', 4, 3200), +(30985, '狮寨镇', 4, 3200), +(30986, '石桥镇', 4, 3200), +(30987, '长发镇', 4, 3200), +(30988, '龙圩镇', 4, 3200), +(30989, '夏宜瑶族乡', 4, 3201), +(30990, '文圩镇', 4, 3201), +(30991, '新圩镇', 4, 3201), +(30992, '汉豪乡', 4, 3201), +(30993, '蒙山镇', 4, 3201), +(30994, '西河镇', 4, 3201), +(30995, '长坪瑶族乡', 4, 3201), +(30996, '陈塘镇', 4, 3201), +(30997, '黄村镇', 4, 3201), +(30998, '东荣镇', 4, 3202), +(30999, '古龙镇', 4, 3202), +(31000, '同心镇', 4, 3202), +(31001, '和平镇', 4, 3202), +(31002, '塘步镇', 4, 3202), +(31003, '大黎镇', 4, 3202), +(31004, '天平镇', 4, 3202), +(31005, '太平镇', 4, 3202), +(31006, '宁康乡', 4, 3202), +(31007, '岭景镇', 4, 3202), +(31008, '平福乡', 4, 3202), +(31009, '新庆镇', 4, 3202), +(31010, '津北镇', 4, 3202), +(31011, '潭东镇', 4, 3202), +(31012, '琅南镇', 4, 3202), +(31013, '蒙江镇', 4, 3202), +(31014, '藤州镇', 4, 3202), +(31015, '象棋镇', 4, 3202), +(31016, '金鸡镇', 4, 3202); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31017, '东兴街道', 4, 3203), +(31018, '夏郢镇', 4, 3203), +(31019, '富民街道', 4, 3203), +(31020, '角嘴街道', 4, 3203), +(31021, '龙湖镇', 4, 3203), +(31022, '倒水镇', 4, 3204), +(31023, '兴龙街道', 4, 3204), +(31024, '大塘街道', 4, 3204), +(31025, '长洲镇', 4, 3204), +(31026, '乌家镇', 4, 3205), +(31027, '党江镇', 4, 3205), +(31028, '公馆镇', 4, 3205), +(31029, '十字路乡', 4, 3205), +(31030, '山口镇', 4, 3205), +(31031, '常乐镇', 4, 3205), +(31032, '廉州镇', 4, 3205), +(31033, '星岛湖乡', 4, 3205), +(31034, '曲樟乡', 4, 3205), +(31035, '沙岗镇', 4, 3205), +(31036, '沙田镇', 4, 3205), +(31037, '白沙镇', 4, 3205), +(31038, '石康镇', 4, 3205), +(31039, '石湾镇', 4, 3205), +(31040, '西场镇', 4, 3205), +(31041, '闸口镇', 4, 3205), +(31042, '东街街道', 4, 3206), +(31043, '中街街道', 4, 3206), +(31044, '地角街道', 4, 3206), +(31045, '海角街道', 4, 3206), +(31046, '涠州镇', 4, 3206), +(31047, '西街街道', 4, 3206), +(31048, '靖海镇', 4, 3206), +(31049, '驿马镇', 4, 3206), +(31050, '兴港镇', 4, 3207), +(31051, '南康镇', 4, 3207), +(31052, '营盘镇', 4, 3207), +(31053, '侨港镇', 4, 3208), +(31054, '咸田镇', 4, 3208), +(31055, '福成镇', 4, 3208), +(31056, '西塘镇', 4, 3208), +(31057, '高德镇', 4, 3208), +(31058, '七门乡', 4, 3209), +(31059, '东屏乡', 4, 3209), +(31060, '公正乡', 4, 3209), +(31061, '华兰乡', 4, 3209), +(31062, '南屏瑶族乡', 4, 3209), +(31063, '叫安乡', 4, 3209), +(31064, '在妙镇', 4, 3209), +(31065, '平福乡', 4, 3209), +(31066, '思阳镇', 4, 3209), +(31067, '那琴乡', 4, 3209), +(31068, '东兴镇', 4, 3210), +(31069, '江平镇', 4, 3210), +(31070, '马路镇', 4, 3210), +(31071, '企沙镇', 4, 3211), +(31072, '光坡镇', 4, 3211), +(31073, '公车镇', 4, 3211), +(31074, '渔洲坪街道', 4, 3211), +(31075, '白沙万街道', 4, 3211), +(31076, '华石镇', 4, 3212), +(31077, '大菉镇', 4, 3212), +(31078, '峒中镇', 4, 3212), +(31079, '扶隆乡', 4, 3212), +(31080, '江山乡', 4, 3212); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31081, '滩营乡', 4, 3212), +(31082, '茅岭乡', 4, 3212), +(31083, '那梭镇', 4, 3212), +(31084, '那良镇', 4, 3212), +(31085, '防城镇', 4, 3212), +(31086, '三合镇', 4, 3213), +(31087, '乐民镇', 4, 3213), +(31088, '六垠镇', 4, 3213), +(31089, '北通镇', 4, 3213), +(31090, '大成镇', 4, 3213), +(31091, '安石镇', 4, 3213), +(31092, '官垌镇', 4, 3213), +(31093, '寨圩镇', 4, 3213), +(31094, '小江镇', 4, 3213), +(31095, '平睦镇', 4, 3213), +(31096, '张黄镇', 4, 3213), +(31097, '樟家乡', 4, 3213), +(31098, '江城镇', 4, 3213), +(31099, '泉水镇', 4, 3213), +(31100, '白石水镇', 4, 3213), +(31101, '石埇镇', 4, 3213), +(31102, '福旺镇', 4, 3213), +(31103, '龙门镇', 4, 3213), +(31104, '三海镇', 4, 3214), +(31105, '三隆镇', 4, 3214), +(31106, '丰塘镇', 4, 3214), +(31107, '伯劳镇', 4, 3214), +(31108, '佛子镇', 4, 3214), +(31109, '太平镇', 4, 3214), +(31110, '平南镇', 4, 3214), +(31111, '平山镇', 4, 3214), +(31112, '文利镇', 4, 3214), +(31113, '新圩镇', 4, 3214), +(31114, '旧州镇', 4, 3214), +(31115, '檀圩镇', 4, 3214), +(31116, '武利镇', 4, 3214), +(31117, '沙坪镇', 4, 3214), +(31118, '灵城镇', 4, 3214), +(31119, '烟墩镇', 4, 3214), +(31120, '石塘镇', 4, 3214), +(31121, '那隆镇', 4, 3214), +(31122, '陆屋镇', 4, 3214), +(31123, '大垌镇', 4, 3215), +(31124, '大寺镇', 4, 3215), +(31125, '大直镇', 4, 3215), +(31126, '小董镇', 4, 3215), +(31127, '平吉镇', 4, 3215), +(31128, '新棠镇', 4, 3215), +(31129, '板城镇', 4, 3215), +(31130, '贵台镇', 4, 3215), +(31131, '那蒙镇', 4, 3215), +(31132, '那香镇', 4, 3215), +(31133, '长滩镇', 4, 3215), +(31134, '青塘镇', 4, 3215), +(31135, '东场镇', 4, 3216), +(31136, '久隆镇', 4, 3216), +(31137, '南珠街道', 4, 3216), +(31138, '向阳街道', 4, 3216), +(31139, '大番坡镇', 4, 3216), +(31140, '尖山镇', 4, 3216), +(31141, '康熙岭镇', 4, 3216), +(31142, '文峰街道', 4, 3216), +(31143, '水东街道', 4, 3216), +(31144, '沙埠镇', 4, 3216), +(31145, '犀牛脚镇', 4, 3216); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31146, '那丽镇', 4, 3216), +(31147, '那彭镇', 4, 3216), +(31148, '那思镇', 4, 3216), +(31149, '黄屋屯镇', 4, 3216), +(31150, '龙门港镇', 4, 3216), +(31151, '上渡镇', 4, 3217), +(31152, '东华乡', 4, 3217), +(31153, '丹竹镇', 4, 3217), +(31154, '六陈镇', 4, 3217), +(31155, '同和镇', 4, 3217), +(31156, '国安瑶族乡', 4, 3217), +(31157, '大坡镇', 4, 3217), +(31158, '大安镇', 4, 3217), +(31159, '大成乡', 4, 3217), +(31160, '大新镇', 4, 3217), +(31161, '大洲镇', 4, 3217), +(31162, '大鹏镇', 4, 3217), +(31163, '安怀镇', 4, 3217), +(31164, '官成镇', 4, 3217), +(31165, '富藏乡', 4, 3217), +(31166, '寺面镇', 4, 3217), +(31167, '平南镇', 4, 3217), +(31168, '平山镇', 4, 3217), +(31169, '思旺镇', 4, 3217), +(31170, '思界乡', 4, 3217), +(31171, '武林镇', 4, 3217), +(31172, '环城镇', 4, 3217), +(31173, '赤马乡', 4, 3217), +(31174, '镇隆镇', 4, 3217), +(31175, '马练瑶族乡', 4, 3217), +(31176, '下湾镇', 4, 3218), +(31177, '中和镇', 4, 3218), +(31178, '中沙镇', 4, 3218), +(31179, '南木镇', 4, 3218), +(31180, '厚禄乡', 4, 3218), +(31181, '垌心乡', 4, 3218), +(31182, '大洋镇', 4, 3218), +(31183, '大湾镇', 4, 3218), +(31184, '寻旺乡', 4, 3218), +(31185, '思宜乡', 4, 3218), +(31186, '木乐镇', 4, 3218), +(31187, '木圭镇', 4, 3218), +(31188, '木根镇', 4, 3218), +(31189, '桂平镇', 4, 3218), +(31190, '江口镇', 4, 3218), +(31191, '油麻镇', 4, 3218), +(31192, '理端乡', 4, 3218), +(31193, '白沙镇', 4, 3218), +(31194, '石嘴镇', 4, 3218), +(31195, '石龙镇', 4, 3218), +(31196, '社坡镇', 4, 3218), +(31197, '社步镇', 4, 3218), +(31198, '紫荆镇', 4, 3218), +(31199, '罗播乡', 4, 3218), +(31200, '罗秀镇', 4, 3218), +(31201, '蒙圩镇', 4, 3218), +(31202, '西山镇', 4, 3218), +(31203, '金田镇', 4, 3218), +(31204, '马皮乡', 4, 3218), +(31205, '麻垌镇', 4, 3218), +(31206, '中里乡', 4, 3219), +(31207, '大圩镇', 4, 3219), +(31208, '奇石乡', 4, 3219), +(31209, '庆丰镇', 4, 3219), +(31210, '根竹乡', 4, 3219); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31211, '武乐乡', 4, 3219), +(31212, '港城镇', 4, 3219), +(31213, '贵城镇', 4, 3219), +(31214, '东津镇', 4, 3220), +(31215, '八塘镇', 4, 3220), +(31216, '平悦乡', 4, 3220), +(31217, '思怀乡', 4, 3220), +(31218, '新塘乡', 4, 3220), +(31219, '木格镇', 4, 3220), +(31220, '木梓镇', 4, 3220), +(31221, '桥圩镇', 4, 3220), +(31222, '横岭乡', 4, 3220), +(31223, '江南街道', 4, 3220), +(31224, '湛江镇', 4, 3220), +(31225, '瓦塘乡', 4, 3220), +(31226, '三里镇', 4, 3221), +(31227, '东龙镇', 4, 3221), +(31228, '五里镇', 4, 3221), +(31229, '古樟乡', 4, 3221), +(31230, '大岭乡', 4, 3221), +(31231, '山北乡', 4, 3221), +(31232, '振南乡', 4, 3221), +(31233, '石卡镇', 4, 3221), +(31234, '蒙公乡', 4, 3221), +(31235, '覃塘镇', 4, 3221), +(31236, '黄练镇', 4, 3221), +(31237, '北市镇', 4, 3222), +(31238, '卖酒乡', 4, 3222), +(31239, '城隍镇', 4, 3222), +(31240, '大平山镇', 4, 3222), +(31241, '小平山镇', 4, 3222), +(31242, '山心镇', 4, 3222), +(31243, '沙塘镇', 4, 3222), +(31244, '洛阳乡', 4, 3222), +(31245, '石南镇', 4, 3222), +(31246, '葵阳镇', 4, 3222), +(31247, '蒲塘镇', 4, 3222), +(31248, '高峰镇', 4, 3222), +(31249, '龙安镇', 4, 3222), +(31250, '六靖镇', 4, 3223), +(31251, '六麻镇', 4, 3223), +(31252, '北流镇', 4, 3223), +(31253, '城北街道', 4, 3223), +(31254, '城南街道', 4, 3223), +(31255, '塘岸镇', 4, 3223), +(31256, '大伦镇', 4, 3223), +(31257, '大坡外镇', 4, 3223), +(31258, '大里镇', 4, 3223), +(31259, '山围镇', 4, 3223), +(31260, '平政镇', 4, 3223), +(31261, '扶新镇', 4, 3223), +(31262, '新丰镇', 4, 3223), +(31263, '新圩镇', 4, 3223), +(31264, '新荣镇', 4, 3223), +(31265, '民乐镇', 4, 3223), +(31266, '民安镇', 4, 3223), +(31267, '沙垌镇', 4, 3223), +(31268, '清水口镇', 4, 3223), +(31269, '清湾镇', 4, 3223), +(31270, '白马镇', 4, 3223), +(31271, '石窝镇', 4, 3223), +(31272, '西垠镇', 4, 3223), +(31273, '陵城街道', 4, 3223), +(31274, '隆盛镇', 4, 3223), +(31275, '三滩镇', 4, 3224); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31276, '东平镇', 4, 3224), +(31277, '亚山镇', 4, 3224), +(31278, '凤山镇', 4, 3224), +(31279, '博白镇', 4, 3224), +(31280, '双凤镇', 4, 3224), +(31281, '双旺镇', 4, 3224), +(31282, '大坝镇', 4, 3224), +(31283, '大垌镇', 4, 3224), +(31284, '宁潭镇', 4, 3224), +(31285, '径口镇', 4, 3224), +(31286, '文地镇', 4, 3224), +(31287, '新田镇', 4, 3224), +(31288, '旺茂镇', 4, 3224), +(31289, '松旺镇', 4, 3224), +(31290, '水鸣镇', 4, 3224), +(31291, '永安镇', 4, 3224), +(31292, '江宁镇', 4, 3224), +(31293, '沙河镇', 4, 3224), +(31294, '沙陂镇', 4, 3224), +(31295, '浪平乡', 4, 3224), +(31296, '英桥镇', 4, 3224), +(31297, '菱角镇', 4, 3224), +(31298, '那卜镇', 4, 3224), +(31299, '那林镇', 4, 3224), +(31300, '顿谷镇', 4, 3224), +(31301, '黄凌镇', 4, 3224), +(31302, '龙潭镇', 4, 3224), +(31303, '六王镇', 4, 3225), +(31304, '十里乡', 4, 3225), +(31305, '县底镇', 4, 3225), +(31306, '容州镇', 4, 3225), +(31307, '容西乡', 4, 3225), +(31308, '杨村镇', 4, 3225), +(31309, '杨梅镇', 4, 3225), +(31310, '松山镇', 4, 3225), +(31311, '浪水乡', 4, 3225), +(31312, '灵山镇', 4, 3225), +(31313, '石头镇', 4, 3225), +(31314, '石寨镇', 4, 3225), +(31315, '罗江镇', 4, 3225), +(31316, '自良镇', 4, 3225), +(31317, '黎村镇', 4, 3225), +(31318, '仁东镇', 4, 3226), +(31319, '仁厚镇', 4, 3226), +(31320, '南江街道', 4, 3226), +(31321, '名山街道', 4, 3226), +(31322, '城北街道', 4, 3226), +(31323, '城西街道', 4, 3226), +(31324, '大塘镇', 4, 3226), +(31325, '成均镇', 4, 3226), +(31326, '新桥镇', 4, 3226), +(31327, '樟木镇', 4, 3226), +(31328, '沙田镇', 4, 3226), +(31329, '玉城街道', 4, 3226), +(31330, '石和镇', 4, 3226), +(31331, '福绵镇', 4, 3226), +(31332, '茂林镇', 4, 3226), +(31333, '乌石镇', 4, 3227), +(31334, '古城镇', 4, 3227), +(31335, '大桥镇', 4, 3227), +(31336, '平乐镇', 4, 3227), +(31337, '横山乡', 4, 3227), +(31338, '沙坡镇', 4, 3227), +(31339, '沙湖乡', 4, 3227), +(31340, '清湖镇', 4, 3227); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31341, '温泉镇', 4, 3227), +(31342, '滩面乡', 4, 3227), +(31343, '珊罗镇', 4, 3227), +(31344, '米场镇', 4, 3227), +(31345, '良田镇', 4, 3227), +(31346, '马坡镇', 4, 3227), +(31347, '同乐镇', 4, 3228), +(31348, '幼平乡', 4, 3228), +(31349, '新化镇', 4, 3228), +(31350, '甘田镇', 4, 3228), +(31351, '花坪镇', 4, 3228), +(31352, '逻沙乡', 4, 3228), +(31353, '逻西乡', 4, 3228), +(31354, '雅长乡', 4, 3228), +(31355, '下甲乡', 4, 3229), +(31356, '东和乡', 4, 3229), +(31357, '伶站瑶族乡', 4, 3229), +(31358, '力洪瑶族乡', 4, 3229), +(31359, '加尤镇', 4, 3229), +(31360, '朝里瑶族乡', 4, 3229), +(31361, '沙里瑶族乡', 4, 3229), +(31362, '泗城镇', 4, 3229), +(31363, '玉洪瑶族乡', 4, 3229), +(31364, '逻楼镇', 4, 3229), +(31365, '四塘镇', 4, 3230), +(31366, '大楞乡', 4, 3230), +(31367, '永乐乡', 4, 3230), +(31368, '汪甸瑶族乡', 4, 3230), +(31369, '泮水乡', 4, 3230), +(31370, '百兰乡', 4, 3230), +(31371, '百城街道', 4, 3230), +(31372, '达江乡', 4, 3230), +(31373, '阳圩镇', 4, 3230), +(31374, '龙和乡', 4, 3230), +(31375, '龙川镇', 4, 3230), +(31376, '龙景街道', 4, 3230), +(31377, '同老乡', 4, 3231), +(31378, '四塘镇', 4, 3231), +(31379, '坡造镇', 4, 3231), +(31380, '城关乡', 4, 3231), +(31381, '堆圩乡', 4, 3231), +(31382, '太平镇', 4, 3231), +(31383, '新安镇', 4, 3231), +(31384, '旧城镇', 4, 3231), +(31385, '果化镇', 4, 3231), +(31386, '榜圩镇', 4, 3231), +(31387, '海城乡', 4, 3231), +(31388, '耶圩乡', 4, 3231), +(31389, '那沙乡', 4, 3231), +(31390, '金沙乡', 4, 3231), +(31391, '风梧乡', 4, 3231), +(31392, '马头镇', 4, 3231), +(31393, '黎明乡', 4, 3231), +(31394, '东关乡', 4, 3232), +(31395, '东凌乡', 4, 3232), +(31396, '兴旺乡', 4, 3232), +(31397, '古寿乡', 4, 3232), +(31398, '城关镇', 4, 3232), +(31399, '大旺乡', 4, 3232), +(31400, '巴头乡', 4, 3232), +(31401, '扶平乡', 4, 3232), +(31402, '敬德镇', 4, 3232), +(31403, '朴圩乡', 4, 3232), +(31404, '燕峒乡', 4, 3232); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31405, '荣华乡', 4, 3232), +(31406, '足荣镇', 4, 3232), +(31407, '那甲乡', 4, 3232), +(31408, '都安乡', 4, 3232), +(31409, '隆桑镇', 4, 3232), +(31410, '马隘乡', 4, 3232), +(31411, '龙光乡', 4, 3232), +(31412, '义圩镇', 4, 3233), +(31413, '作登瑶族乡', 4, 3233), +(31414, '印茶镇', 4, 3233), +(31415, '坡塘乡', 4, 3233), +(31416, '布兵镇', 4, 3233), +(31417, '平马镇', 4, 3233), +(31418, '思林镇', 4, 3233), +(31419, '朔良镇', 4, 3233), +(31420, '林逢镇', 4, 3233), +(31421, '江城镇', 4, 3233), +(31422, '祥周镇', 4, 3233), +(31423, '祷午镇', 4, 3233), +(31424, '那拔镇', 4, 3233), +(31425, '乐里镇', 4, 3234), +(31426, '八桂瑶族乡', 4, 3234), +(31427, '八渡瑶族乡', 4, 3234), +(31428, '六隆镇', 4, 3234), +(31429, '利周瑶族乡', 4, 3234), +(31430, '定安镇', 4, 3234), +(31431, '平塘乡', 4, 3234), +(31432, '旧州镇', 4, 3234), +(31433, '浪平乡', 4, 3234), +(31434, '潞城瑶族乡', 4, 3234), +(31435, '百乐乡', 4, 3234), +(31436, '者苗乡', 4, 3234), +(31437, '那比乡', 4, 3234), +(31438, '高龙乡', 4, 3234), +(31439, '五村乡', 4, 3235), +(31440, '坡洪镇', 4, 3235), +(31441, '坤平乡', 4, 3235), +(31442, '头塘镇', 4, 3235), +(31443, '巴别乡', 4, 3235), +(31444, '桥业乡', 4, 3235), +(31445, '洞靖乡', 4, 3235), +(31446, '玉凤镇', 4, 3235), +(31447, '琴华乡', 4, 3235), +(31448, '田州镇', 4, 3235), +(31449, '百峰乡', 4, 3235), +(31450, '百育镇', 4, 3235), +(31451, '那坡镇', 4, 3235), +(31452, '那满镇', 4, 3235), +(31453, '雷圩乡', 4, 3235), +(31454, '八大河乡', 4, 3236), +(31455, '八达镇', 4, 3236), +(31456, '古障镇', 4, 3236), +(31457, '弄汪乡', 4, 3236), +(31458, '普合苗族乡', 4, 3236), +(31459, '者夯乡', 4, 3236), +(31460, '西平乡', 4, 3236), +(31461, '足别瑶族苗族乡', 4, 3236), +(31462, '那佐苗族乡', 4, 3236), +(31463, '那劳乡', 4, 3236), +(31464, '马蚌乡', 4, 3236), +(31465, '坡荷乡', 4, 3237), +(31466, '城厢镇', 4, 3237), +(31467, '平孟镇', 4, 3237), +(31468, '德隆乡', 4, 3237); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31469, '百南乡', 4, 3237), +(31470, '百合乡', 4, 3237), +(31471, '百省乡', 4, 3237), +(31472, '百都乡', 4, 3237), +(31473, '龙合乡', 4, 3237), +(31474, '介廷乡', 4, 3238), +(31475, '克长乡', 4, 3238), +(31476, '天生桥镇', 4, 3238), +(31477, '岩茶乡', 4, 3238), +(31478, '常么乡', 4, 3238), +(31479, '平班镇', 4, 3238), +(31480, '德峨乡', 4, 3238), +(31481, '新州镇', 4, 3238), +(31482, '桠杈镇', 4, 3238), +(31483, '沙梨乡', 4, 3238), +(31484, '猪场乡', 4, 3238), +(31485, '者保乡', 4, 3238), +(31486, '者浪乡', 4, 3238), +(31487, '者隘乡', 4, 3238), +(31488, '蛇场乡', 4, 3238), +(31489, '金钟山乡', 4, 3238), +(31490, '长发乡', 4, 3238), +(31491, '隆或乡', 4, 3238), +(31492, '革步乡', 4, 3238), +(31493, '龙滩乡', 4, 3238), +(31494, '三合乡', 4, 3239), +(31495, '化峒镇', 4, 3239), +(31496, '南坡乡', 4, 3239), +(31497, '同德乡', 4, 3239), +(31498, '吞盘乡', 4, 3239), +(31499, '地州乡', 4, 3239), +(31500, '壬庄乡', 4, 3239), +(31501, '大甲乡', 4, 3239), +(31502, '大道乡', 4, 3239), +(31503, '安宁乡', 4, 3239), +(31504, '安德镇', 4, 3239), +(31505, '岜蒙乡', 4, 3239), +(31506, '岳圩镇', 4, 3239), +(31507, '新圩乡', 4, 3239), +(31508, '新靖镇', 4, 3239), +(31509, '果乐乡', 4, 3239), +(31510, '武平乡', 4, 3239), +(31511, '渠洋镇', 4, 3239), +(31512, '湖润镇', 4, 3239), +(31513, '禄峒乡', 4, 3239), +(31514, '荣劳乡', 4, 3239), +(31515, '魁圩乡', 4, 3239), +(31516, '龙临镇', 4, 3239), +(31517, '龙邦镇', 4, 3239), +(31518, '仁义镇', 4, 3240), +(31519, '信都镇', 4, 3240), +(31520, '八步镇', 4, 3240), +(31521, '公会镇', 4, 3240), +(31522, '南乡镇', 4, 3240), +(31523, '大宁镇', 4, 3240), +(31524, '大平瑶族乡', 4, 3240), +(31525, '开山镇', 4, 3240), +(31526, '桂岭镇', 4, 3240), +(31527, '步头镇', 4, 3240), +(31528, '水口镇', 4, 3240), +(31529, '沙田镇', 4, 3240), +(31530, '灵峰镇', 4, 3240), +(31531, '莲塘镇', 4, 3240), +(31532, '西湾镇', 4, 3240), +(31533, '贺街镇', 4, 3240), +(31534, '里松镇', 4, 3240); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31535, '铺门镇', 4, 3240), +(31536, '鹅塘镇', 4, 3240), +(31537, '黄洞瑶族乡', 4, 3240), +(31538, '黄田镇', 4, 3240), +(31539, '古城镇', 4, 3241), +(31540, '城北镇', 4, 3241), +(31541, '富阳镇', 4, 3241), +(31542, '新华乡', 4, 3241), +(31543, '朝东镇', 4, 3241), +(31544, '柳家乡', 4, 3241), +(31545, '油沐乡', 4, 3241), +(31546, '白沙镇', 4, 3241), +(31547, '石家乡', 4, 3241), +(31548, '福利镇', 4, 3241), +(31549, '莲山镇', 4, 3241), +(31550, '葛坡镇', 4, 3241), +(31551, '麦岭镇', 4, 3241), +(31552, '五将镇', 4, 3242), +(31553, '仙回瑶族乡', 4, 3242), +(31554, '凤凰乡', 4, 3242), +(31555, '北陀镇', 4, 3242), +(31556, '富罗镇', 4, 3242), +(31557, '文竹镇', 4, 3242), +(31558, '昭平镇', 4, 3242), +(31559, '木格乡', 4, 3242), +(31560, '樟木林乡', 4, 3242), +(31561, '走马乡', 4, 3242), +(31562, '马江镇', 4, 3242), +(31563, '黄姚镇', 4, 3242), +(31564, '两安瑶族乡', 4, 3243), +(31565, '公安镇', 4, 3243), +(31566, '凤翔镇', 4, 3243), +(31567, '同古镇', 4, 3243), +(31568, '回龙镇', 4, 3243), +(31569, '城厢镇', 4, 3243), +(31570, '望高镇', 4, 3243), +(31571, '清塘镇', 4, 3243), +(31572, '燕塘镇', 4, 3243), +(31573, '珊瑚镇', 4, 3243), +(31574, '石龙镇', 4, 3243), +(31575, '红花镇', 4, 3243), +(31576, '羊头镇', 4, 3243), +(31577, '花山瑶族乡', 4, 3243), +(31578, '英家镇', 4, 3243), +(31579, '钟山镇', 4, 3243), +(31580, '三弄瑶族乡', 4, 3244), +(31581, '三石镇', 4, 3244), +(31582, '东兰镇', 4, 3244), +(31583, '兰木乡', 4, 3244), +(31584, '切学乡', 4, 3244), +(31585, '大同乡', 4, 3244), +(31586, '巴畴乡', 4, 3244), +(31587, '武篆镇', 4, 3244), +(31588, '泗孟乡', 4, 3244), +(31589, '花香乡', 4, 3244), +(31590, '金谷乡', 4, 3244), +(31591, '长乐镇', 4, 3244), +(31592, '长江乡', 4, 3244), +(31593, '隘洞镇', 4, 3244), +(31594, '中亭乡', 4, 3245), +(31595, '乔音乡', 4, 3245), +(31596, '凤城镇', 4, 3245), +(31597, '平乐瑶族乡', 4, 3245), +(31598, '更沙乡', 4, 3245), +(31599, '林峒乡', 4, 3245); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31600, '江洲瑶族乡', 4, 3245), +(31601, '砦牙乡', 4, 3245), +(31602, '袍里乡', 4, 3245), +(31603, '金牙瑶族乡', 4, 3245), +(31604, '长洲乡', 4, 3245), +(31605, '中堡苗族乡', 4, 3246), +(31606, '八圩瑶族乡', 4, 3246), +(31607, '六寨镇', 4, 3246), +(31608, '吾隘镇', 4, 3246), +(31609, '城关镇', 4, 3246), +(31610, '大厂镇', 4, 3246), +(31611, '巴定乡', 4, 3246), +(31612, '月里镇', 4, 3246), +(31613, '罗富乡', 4, 3246), +(31614, '芒场镇', 4, 3246), +(31615, '车河镇', 4, 3246), +(31616, '里湖瑶族乡', 4, 3246), +(31617, '七百弄乡', 4, 3247), +(31618, '乙圩乡', 4, 3247), +(31619, '六也乡', 4, 3247), +(31620, '共和乡', 4, 3247), +(31621, '北景乡', 4, 3247), +(31622, '古文乡', 4, 3247), +(31623, '古河乡', 4, 3247), +(31624, '大化镇', 4, 3247), +(31625, '岩滩镇', 4, 3247), +(31626, '板兰乡', 4, 3247), +(31627, '板升乡', 4, 3247), +(31628, '江南乡', 4, 3247), +(31629, '流水乡', 4, 3247), +(31630, '百马乡', 4, 3247), +(31631, '羌圩乡', 4, 3247), +(31632, '贡川乡', 4, 3247), +(31633, '都阳镇', 4, 3247), +(31634, '镇西乡', 4, 3247), +(31635, '雅龙乡', 4, 3247), +(31636, '三堡乡', 4, 3248), +(31637, '下老乡', 4, 3248), +(31638, '八腊瑶族乡', 4, 3248), +(31639, '六排镇', 4, 3248), +(31640, '向阳镇', 4, 3248), +(31641, '坡结乡', 4, 3248), +(31642, '岜暮乡', 4, 3248), +(31643, '更新乡', 4, 3248), +(31644, '纳直乡', 4, 3248), +(31645, '三合乡', 4, 3249), +(31646, '三岔镇', 4, 3249), +(31647, '北山镇', 4, 3249), +(31648, '北牙瑶族乡', 4, 3249), +(31649, '同德乡', 4, 3249), +(31650, '太平乡', 4, 3249), +(31651, '安马乡', 4, 3249), +(31652, '屏南乡', 4, 3249), +(31653, '庆远镇', 4, 3249), +(31654, '德胜镇', 4, 3249), +(31655, '怀远镇', 4, 3249), +(31656, '拉利乡', 4, 3249), +(31657, '拉浪乡', 4, 3249), +(31658, '洛东乡', 4, 3249), +(31659, '洛西镇', 4, 3249), +(31660, '流河乡', 4, 3249), +(31661, '矮山乡', 4, 3249), +(31662, '石别镇', 4, 3249), +(31663, '祥贝乡', 4, 3249); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31664, '福龙瑶族乡', 4, 3249), +(31665, '龙头乡', 4, 3249), +(31666, '东山乡', 4, 3250), +(31667, '凤凰乡', 4, 3250), +(31668, '局桑乡', 4, 3250), +(31669, '巴马镇', 4, 3250), +(31670, '平洞乡', 4, 3250), +(31671, '所略乡', 4, 3250), +(31672, '燕洞乡', 4, 3250), +(31673, '甲篆乡', 4, 3250), +(31674, '百林乡', 4, 3250), +(31675, '西山乡', 4, 3250), +(31676, '那桃乡', 4, 3250), +(31677, '那社乡', 4, 3250), +(31678, '上南乡', 4, 3251), +(31679, '上朝镇', 4, 3251), +(31680, '下南乡', 4, 3251), +(31681, '东兴镇', 4, 3251), +(31682, '大安乡', 4, 3251), +(31683, '大才乡', 4, 3251), +(31684, '川山镇', 4, 3251), +(31685, '思恩镇', 4, 3251), +(31686, '明伦镇', 4, 3251), +(31687, '木论乡', 4, 3251), +(31688, '水源镇', 4, 3251), +(31689, '洛阳镇', 4, 3251), +(31690, '长美乡', 4, 3251), +(31691, '驯乐苗族乡', 4, 3251), +(31692, '龙岩乡', 4, 3251), +(31693, '下里乡', 4, 3252), +(31694, '东门镇', 4, 3252), +(31695, '乔善乡', 4, 3252), +(31696, '兼爱乡', 4, 3252), +(31697, '四把镇', 4, 3252), +(31698, '天河镇', 4, 3252), +(31699, '宝坛乡', 4, 3252), +(31700, '小长安镇', 4, 3252), +(31701, '怀群镇', 4, 3252), +(31702, '桥头镇', 4, 3252), +(31703, '纳翁乡', 4, 3252), +(31704, '黄金镇', 4, 3252), +(31705, '龙岸镇', 4, 3252), +(31706, '三只羊乡', 4, 3253), +(31707, '三弄乡', 4, 3253), +(31708, '下坳乡', 4, 3253), +(31709, '东庙乡', 4, 3253), +(31710, '九渡乡', 4, 3253), +(31711, '五竹乡', 4, 3253), +(31712, '保安乡', 4, 3253), +(31713, '加贵乡', 4, 3253), +(31714, '古山乡', 4, 3253), +(31715, '地苏乡', 4, 3253), +(31716, '大兴乡', 4, 3253), +(31717, '安阳镇', 4, 3253), +(31718, '拉仁乡', 4, 3253), +(31719, '拉烈乡', 4, 3253), +(31720, '板岭乡', 4, 3253), +(31721, '永安乡', 4, 3253), +(31722, '澄江乡', 4, 3253), +(31723, '百旺乡', 4, 3253), +(31724, '菁盛乡', 4, 3253), +(31725, '隆福乡', 4, 3253), +(31726, '高岭镇', 4, 3253), +(31727, '龙湾乡', 4, 3253), +(31728, '东江镇', 4, 3254); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31729, '九圩镇', 4, 3254), +(31730, '五圩镇', 4, 3254), +(31731, '侧岭乡', 4, 3254), +(31732, '保平乡', 4, 3254), +(31733, '六圩镇', 4, 3254), +(31734, '六甲镇', 4, 3254), +(31735, '拔贡镇', 4, 3254), +(31736, '河池镇', 4, 3254), +(31737, '白土乡', 4, 3254), +(31738, '金城江街道', 4, 3254), +(31739, '长老乡', 4, 3254), +(31740, '七洞乡', 4, 3255), +(31741, '三五乡', 4, 3255), +(31742, '五山乡', 4, 3255), +(31743, '凤凰镇', 4, 3255), +(31744, '北五乡', 4, 3255), +(31745, '南泗乡', 4, 3255), +(31746, '城厢乡', 4, 3255), +(31747, '大湾乡', 4, 3255), +(31748, '大里乡', 4, 3255), +(31749, '寺山乡', 4, 3255), +(31750, '小平阳镇', 4, 3255), +(31751, '平阳镇', 4, 3255), +(31752, '来宾镇', 4, 3255), +(31753, '桥巩乡', 4, 3255), +(31754, '正龙乡', 4, 3255), +(31755, '溯社乡', 4, 3255), +(31756, '石牙乡', 4, 3255), +(31757, '石陵镇', 4, 3255), +(31758, '良塘乡', 4, 3255), +(31759, '良江镇', 4, 3255), +(31760, '蒙村乡', 4, 3255), +(31761, '迁江镇', 4, 3255), +(31762, '陶邓乡', 4, 3255), +(31763, '高安乡', 4, 3255), +(31764, '北泗乡', 4, 3256), +(31765, '岭南镇', 4, 3256), +(31766, '河里乡', 4, 3256), +(31767, '北更乡', 4, 3257), +(31768, '古蓬镇', 4, 3257), +(31769, '城关镇', 4, 3257), +(31770, '大塘镇', 4, 3257), +(31771, '宁江乡', 4, 3257), +(31772, '安东乡', 4, 3257), +(31773, '思练镇', 4, 3257), +(31774, '新圩乡', 4, 3257), +(31775, '果遂乡', 4, 3257), +(31776, '欧洞乡', 4, 3257), +(31777, '红渡镇', 4, 3257), +(31778, '遂意乡', 4, 3257), +(31779, '马泗乡', 4, 3257), +(31780, '三里镇', 4, 3258), +(31781, '东乡镇', 4, 3258), +(31782, '二塘镇', 4, 3258), +(31783, '思灵乡', 4, 3258), +(31784, '桐岭镇', 4, 3258), +(31785, '武宣镇', 4, 3258), +(31786, '禄新乡', 4, 3258), +(31787, '通挽镇', 4, 3258), +(31788, '金鸡乡', 4, 3258), +(31789, '黄茆镇', 4, 3258), +(31790, '中平镇', 4, 3259), +(31791, '大乐镇', 4, 3259), +(31792, '妙皇乡', 4, 3259), +(31793, '寺村镇', 4, 3259), +(31794, '水晶乡', 4, 3259); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31795, '百丈乡', 4, 3259), +(31796, '石龙镇', 4, 3259), +(31797, '罗秀镇', 4, 3259), +(31798, '象州镇', 4, 3259), +(31799, '运江镇', 4, 3259), +(31800, '马坪乡', 4, 3259), +(31801, '七建乡', 4, 3260), +(31802, '三江乡', 4, 3260), +(31803, '三角乡', 4, 3260), +(31804, '六巷乡', 4, 3260), +(31805, '大樟乡', 4, 3260), +(31806, '头排镇', 4, 3260), +(31807, '忠良乡', 4, 3260), +(31808, '桐木镇', 4, 3260), +(31809, '罗香乡', 4, 3260), +(31810, '金秀镇', 4, 3260), +(31811, '长垌乡', 4, 3260), +(31812, '上石镇', 4, 3261), +(31813, '凭祥镇', 4, 3261), +(31814, '友谊镇', 4, 3261), +(31815, '夏石镇', 4, 3261), +(31816, '下雷镇', 4, 3262), +(31817, '五山乡', 4, 3262), +(31818, '全茗镇', 4, 3262), +(31819, '堪圩乡', 4, 3262), +(31820, '宝圩乡', 4, 3262), +(31821, '恩城乡', 4, 3262), +(31822, '昌明乡', 4, 3262), +(31823, '桃城镇', 4, 3262), +(31824, '榄圩乡', 4, 3262), +(31825, '硕龙镇', 4, 3262), +(31826, '福隆乡', 4, 3262), +(31827, '那岭乡', 4, 3262), +(31828, '雷平镇', 4, 3262), +(31829, '龙门乡', 4, 3262), +(31830, '上映乡', 4, 3263), +(31831, '东平乡', 4, 3263), +(31832, '向都镇', 4, 3263), +(31833, '天等镇', 4, 3263), +(31834, '宁干乡', 4, 3263), +(31835, '小山乡', 4, 3263), +(31836, '把荷乡', 4, 3263), +(31837, '福新乡', 4, 3263), +(31838, '进结镇', 4, 3263), +(31839, '进远乡', 4, 3263), +(31840, '都康乡', 4, 3263), +(31841, '金洞乡', 4, 3263), +(31842, '驮堪乡', 4, 3263), +(31843, '龙茗镇', 4, 3263), +(31844, '东安乡', 4, 3264), +(31845, '亭亮乡', 4, 3264), +(31846, '北江乡', 4, 3264), +(31847, '城中镇', 4, 3264), +(31848, '寨安乡', 4, 3264), +(31849, '峙浪乡', 4, 3264), +(31850, '明江镇', 4, 3264), +(31851, '板棍乡', 4, 3264), +(31852, '桐棉乡', 4, 3264), +(31853, '海渊镇', 4, 3264), +(31854, '爱店镇', 4, 3264), +(31855, '那堪乡', 4, 3264), +(31856, '那楠乡', 4, 3264), +(31857, '驮龙乡', 4, 3264), +(31858, '东罗镇', 4, 3265), +(31859, '东门镇', 4, 3265), +(31860, '中东镇', 4, 3265); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31861, '山圩镇', 4, 3265), +(31862, '岜盆乡', 4, 3265), +(31863, '新宁镇', 4, 3265), +(31864, '昌平乡', 4, 3265), +(31865, '柳桥镇', 4, 3265), +(31866, '渠旧镇', 4, 3265), +(31867, '渠黎镇', 4, 3265), +(31868, '龙头乡', 4, 3265), +(31869, '太平镇', 4, 3266), +(31870, '左州镇', 4, 3266), +(31871, '新和镇', 4, 3266), +(31872, '板利乡', 4, 3266), +(31873, '江州镇', 4, 3266), +(31874, '濑湍镇', 4, 3266), +(31875, '罗白乡', 4, 3266), +(31876, '那隆镇', 4, 3266), +(31877, '驮卢镇', 4, 3266), +(31878, '上金乡', 4, 3267), +(31879, '上降乡', 4, 3267), +(31880, '上龙乡', 4, 3267), +(31881, '下冻镇', 4, 3267), +(31882, '八角乡', 4, 3267), +(31883, '响水镇', 4, 3267), +(31884, '彬桥乡', 4, 3267), +(31885, '武德乡', 4, 3267), +(31886, '水口镇', 4, 3267), +(31887, '逐卜乡', 4, 3267), +(31888, '金龙镇', 4, 3267), +(31889, '龙州镇', 4, 3267), +(31890, '三门坡镇', 4, 3268), +(31891, '云龙镇', 4, 3268), +(31892, '国兴街道', 4, 3268), +(31893, '大坡镇', 4, 3268), +(31894, '府城镇', 4, 3268), +(31895, '旧州镇', 4, 3268), +(31896, '甲子镇', 4, 3268), +(31897, '红旗镇', 4, 3268), +(31898, '龙塘镇', 4, 3268), +(31899, '东山镇', 4, 3269), +(31900, '永兴镇', 4, 3269), +(31901, '海秀街道', 4, 3269), +(31902, '海秀镇', 4, 3269), +(31903, '石山镇', 4, 3269), +(31904, '秀英街道', 4, 3269), +(31905, '西秀镇', 4, 3269), +(31906, '长流镇', 4, 3269), +(31907, '三江镇', 4, 3270), +(31908, '人民路街道', 4, 3270), +(31909, '博爱街道', 4, 3270), +(31910, '和平南街道', 4, 3270), +(31911, '大致坡镇', 4, 3270), +(31912, '新埠镇', 4, 3270), +(31913, '海府街道', 4, 3270), +(31914, '海甸街道', 4, 3270), +(31915, '演丰镇', 4, 3270), +(31916, '灵山镇', 4, 3270), +(31917, '白沙街道', 4, 3270), +(31918, '白龙街道', 4, 3270), +(31919, '蓝天街道', 4, 3270), +(31920, '中山街道', 4, 3271), +(31921, '城西镇', 4, 3271), +(31922, '大同街道', 4, 3271), +(31923, '新坡镇', 4, 3271), +(31924, '海垦街道', 4, 3271); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31925, '滨海街道', 4, 3271), +(31926, '遵谭镇', 4, 3271), +(31927, '金宇街道', 4, 3271), +(31928, '金贸街道', 4, 3271), +(31929, '龙桥镇', 4, 3271), +(31930, '龙泉镇', 4, 3271), +(31931, '凤凰镇', 4, 3272), +(31932, '天涯镇', 4, 3272), +(31933, '崖城镇', 4, 3272), +(31934, '河东区(虚拟街道办)', 4, 3272), +(31935, '河西区(虚拟街道办)', 4, 3272), +(31936, '海棠湾镇', 4, 3272), +(31937, '田独镇', 4, 3272), +(31938, '冲山镇', 4, 3273), +(31939, '南圣镇', 4, 3273), +(31940, '毛道乡', 4, 3273), +(31941, '毛阳镇', 4, 3273), +(31942, '水满乡', 4, 3273), +(31943, '畅好乡', 4, 3273), +(31944, '番阳镇', 4, 3273), +(31945, '万泉镇', 4, 3274), +(31946, '中原镇', 4, 3274), +(31947, '会山镇', 4, 3274), +(31948, '博鳌镇', 4, 3274), +(31949, '嘉积镇', 4, 3274), +(31950, '塔洋镇', 4, 3274), +(31951, '大路镇', 4, 3274), +(31952, '潭门镇', 4, 3274), +(31953, '石壁镇', 4, 3274), +(31954, '长坡镇', 4, 3274), +(31955, '阳江镇', 4, 3274), +(31956, '龙江镇', 4, 3274), +(31957, '三都镇', 4, 3275), +(31958, '东成镇', 4, 3275), +(31959, '中和镇', 4, 3275), +(31960, '光村镇', 4, 3275), +(31961, '兰洋镇', 4, 3275), +(31962, '南丰镇', 4, 3275), +(31963, '和庆镇', 4, 3275), +(31964, '大成镇', 4, 3275), +(31965, '峨蔓镇', 4, 3275), +(31966, '排浦镇', 4, 3275), +(31967, '新州镇', 4, 3275), +(31968, '木棠镇', 4, 3275), +(31969, '海头镇', 4, 3275), +(31970, '王五镇', 4, 3275), +(31971, '白马井镇', 4, 3275), +(31972, '那大镇', 4, 3275), +(31973, '雅星镇', 4, 3275), +(31974, '东路镇', 4, 3276), +(31975, '东郊镇', 4, 3276), +(31976, '东阁镇', 4, 3276), +(31977, '会文镇', 4, 3276), +(31978, '冯坡镇', 4, 3276), +(31979, '抱罗镇', 4, 3276), +(31980, '文城镇', 4, 3276), +(31981, '文教镇', 4, 3276), +(31982, '昌洒镇', 4, 3276), +(31983, '潭牛镇', 4, 3276), +(31984, '翁田镇', 4, 3276), +(31985, '蓬莱镇', 4, 3276), +(31986, '重兴镇', 4, 3276), +(31987, '铺前镇', 4, 3276), +(31988, '锦山镇', 4, 3276); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(31989, '龙楼镇', 4, 3276), +(31990, '万城镇', 4, 3277), +(31991, '三更罗镇', 4, 3277), +(31992, '东澳镇', 4, 3277), +(31993, '北大镇', 4, 3277), +(31994, '南桥镇', 4, 3277), +(31995, '后安镇', 4, 3277), +(31996, '和乐镇', 4, 3277), +(31997, '大茂镇', 4, 3277), +(31998, '山根镇', 4, 3277), +(31999, '礼纪镇', 4, 3277), +(32000, '长丰镇', 4, 3277), +(32001, '龙滚镇', 4, 3277), +(32002, '三家镇', 4, 3278), +(32003, '东河镇', 4, 3278), +(32004, '八所镇', 4, 3278), +(32005, '四更镇', 4, 3278), +(32006, '大田镇', 4, 3278), +(32007, '天安乡', 4, 3278), +(32008, '感城镇', 4, 3278), +(32009, '新龙镇', 4, 3278), +(32010, '板桥镇', 4, 3278), +(32011, '江边乡', 4, 3278), +(32012, '定城镇', 4, 3279), +(32013, '富文镇', 4, 3279), +(32014, '岭口镇', 4, 3279), +(32015, '新竹镇', 4, 3279), +(32016, '翰林镇', 4, 3279), +(32017, '雷鸣镇', 4, 3279), +(32018, '黄竹镇', 4, 3279), +(32019, '龙河镇', 4, 3279), +(32020, '龙湖镇', 4, 3279), +(32021, '龙门镇', 4, 3279), +(32022, '乌坡镇', 4, 3280), +(32023, '南吕镇', 4, 3280), +(32024, '南坤镇', 4, 3280), +(32025, '坡心镇', 4, 3280), +(32026, '屯城镇', 4, 3280), +(32027, '新兴镇', 4, 3280), +(32028, '枫木镇', 4, 3280), +(32029, '西昌镇', 4, 3280), +(32030, '中兴镇', 4, 3281), +(32031, '仁兴镇', 4, 3281), +(32032, '加乐镇', 4, 3281), +(32033, '文儒镇', 4, 3281), +(32034, '桥头镇', 4, 3281), +(32035, '永发镇', 4, 3281), +(32036, '瑞溪镇', 4, 3281), +(32037, '福山镇', 4, 3281), +(32038, '老城镇', 4, 3281), +(32039, '金江镇', 4, 3281), +(32040, '东英镇', 4, 3282), +(32041, '临城镇', 4, 3282), +(32042, '加来镇', 4, 3282), +(32043, '南宝镇', 4, 3282), +(32044, '博厚镇', 4, 3282), +(32045, '和舍镇', 4, 3282), +(32046, '多文镇', 4, 3282), +(32047, '新盈镇', 4, 3282), +(32048, '波莲镇', 4, 3282), +(32049, '皇桐镇', 4, 3282), +(32050, '调楼镇', 4, 3282), +(32051, '七坊镇', 4, 3283), +(32052, '元门乡', 4, 3283), +(32053, '南开乡', 4, 3283), +(32054, '打安镇', 4, 3283); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32055, '牙叉镇', 4, 3283), +(32056, '细水乡', 4, 3283), +(32057, '荣邦乡', 4, 3283), +(32058, '邦溪镇', 4, 3283), +(32059, '金波乡', 4, 3283), +(32060, '阜龙乡', 4, 3283), +(32061, '青松乡', 4, 3283), +(32062, '七叉镇', 4, 3284), +(32063, '乌烈镇', 4, 3284), +(32064, '十月田镇', 4, 3284), +(32065, '叉河镇', 4, 3284), +(32066, '昌化镇', 4, 3284), +(32067, '海尾镇', 4, 3284), +(32068, '石碌镇', 4, 3284), +(32069, '万冲镇', 4, 3285), +(32070, '九所镇', 4, 3285), +(32071, '佛罗镇', 4, 3285), +(32072, '利国镇', 4, 3285), +(32073, '千家镇', 4, 3285), +(32074, '大安镇', 4, 3285), +(32075, '尖峰镇', 4, 3285), +(32076, '志仲镇', 4, 3285), +(32077, '抱由镇', 4, 3285), +(32078, '莺歌海镇', 4, 3285), +(32079, '黄流镇', 4, 3285), +(32080, '三才镇', 4, 3286), +(32081, '光坡镇', 4, 3286), +(32082, '提蒙乡', 4, 3286), +(32083, '文罗镇', 4, 3286), +(32084, '新村镇', 4, 3286), +(32085, '本号镇', 4, 3286), +(32086, '椰林镇', 4, 3286), +(32087, '群英乡', 4, 3286), +(32088, '英州镇', 4, 3286), +(32089, '隆广镇', 4, 3286), +(32090, '黎安镇', 4, 3286), +(32091, '三道镇', 4, 3287), +(32092, '什玲镇', 4, 3287), +(32093, '保城镇', 4, 3287), +(32094, '六弓乡', 4, 3287), +(32095, '加茂镇', 4, 3287), +(32096, '南林乡', 4, 3287), +(32097, '响水镇', 4, 3287), +(32098, '新政镇', 4, 3287), +(32099, '毛感乡', 4, 3287), +(32100, '上安乡', 4, 3288), +(32101, '中平镇', 4, 3288), +(32102, '什运乡', 4, 3288), +(32103, '吊罗山乡', 4, 3288), +(32104, '和平镇', 4, 3288), +(32105, '湾岭镇', 4, 3288), +(32106, '红毛镇', 4, 3288), +(32107, '营根镇', 4, 3288), +(32108, '长征镇', 4, 3288), +(32109, '黎母山镇', 4, 3288), +(32110, '万安镇', 4, 4209), +(32111, '三星镇', 4, 4209), +(32112, '东升街道', 4, 4209), +(32113, '中和街道', 4, 4209), +(32114, '九江镇', 4, 4209), +(32115, '公兴镇', 4, 4209), +(32116, '兴隆镇', 4, 4209), +(32117, '华阳街道', 4, 4209), +(32118, '合江镇', 4, 4209), +(32119, '大林镇', 4, 4209); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32120, '太平镇', 4, 4209), +(32121, '彭镇镇', 4, 4209), +(32122, '新兴镇', 4, 4209), +(32123, '正兴镇', 4, 4209), +(32124, '永兴镇', 4, 4209), +(32125, '永安镇', 4, 4209), +(32126, '煎茶镇', 4, 4209), +(32127, '白沙镇', 4, 4209), +(32128, '籍田镇', 4, 4209), +(32129, '胜利镇', 4, 4209), +(32130, '西航港街道', 4, 4209), +(32131, '金桥镇', 4, 4209), +(32132, '黄水镇', 4, 4209), +(32133, '黄甲镇', 4, 4209), +(32134, '黄龙溪镇', 4, 4209), +(32135, '三岔镇', 4, 4210), +(32136, '上安镇', 4, 4210), +(32137, '出阝江镇', 4, 4210), +(32138, '唐场镇', 4, 4210), +(32139, '安仁镇', 4, 4210), +(32140, '悦来镇', 4, 4210), +(32141, '斜源镇', 4, 4210), +(32142, '新场镇', 4, 4210), +(32143, '晋原镇', 4, 4210), +(32144, '沙渠镇', 4, 4210), +(32145, '王泗镇', 4, 4210), +(32146, '花水湾镇', 4, 4210), +(32147, '苏家镇', 4, 4210), +(32148, '董场镇', 4, 4210), +(32149, '蔡场镇', 4, 4210), +(32150, '西岭镇', 4, 4210), +(32151, '金星乡', 4, 4210), +(32152, '雾山乡', 4, 4210), +(32153, '青霞镇', 4, 4210), +(32154, '韩场镇', 4, 4210), +(32155, '鹤鸣乡', 4, 4210), +(32156, '三江镇', 4, 4211), +(32157, '三郎镇', 4, 4211), +(32158, '元通镇', 4, 4211), +(32159, '公议乡', 4, 4211), +(32160, '大划镇', 4, 4211), +(32161, '崇平镇', 4, 4211), +(32162, '崇阳镇', 4, 4211), +(32163, '廖家镇', 4, 4211), +(32164, '怀远镇', 4, 4211), +(32165, '文井江镇', 4, 4211), +(32166, '桤泉镇', 4, 4211), +(32167, '梓潼镇', 4, 4211), +(32168, '江源镇', 4, 4211), +(32169, '济协乡', 4, 4211), +(32170, '燎原乡', 4, 4211), +(32171, '王场镇', 4, 4211), +(32172, '白头镇', 4, 4211), +(32173, '羊马镇', 4, 4211), +(32174, '街子镇', 4, 4211), +(32175, '观胜镇', 4, 4211), +(32176, '道明镇', 4, 4211), +(32177, '锦江乡', 4, 4211), +(32178, '隆兴镇', 4, 4211), +(32179, '集贤乡', 4, 4211), +(32180, '鸡冠山乡', 4, 4211), +(32181, '三界镇', 4, 4212), +(32182, '丹景山镇', 4, 4212), +(32183, '丽春镇', 4, 4212), +(32184, '九尺镇', 4, 4212); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32185, '军乐镇', 4, 4212), +(32186, '升平镇', 4, 4212), +(32187, '天彭镇', 4, 4212), +(32188, '小鱼洞镇', 4, 4212), +(32189, '敖平镇', 4, 4212), +(32190, '新兴镇', 4, 4212), +(32191, '桂花镇', 4, 4212), +(32192, '濛阳镇', 4, 4212), +(32193, '白鹿镇', 4, 4212), +(32194, '磁峰镇', 4, 4212), +(32195, '红岩镇', 4, 4212), +(32196, '致和镇', 4, 4212), +(32197, '葛仙山镇', 4, 4212), +(32198, '通济镇', 4, 4212), +(32199, '隆丰镇', 4, 4212), +(32200, '龙门山镇', 4, 4212), +(32201, '万年场街道', 4, 4213), +(32202, '二仙桥街道', 4, 4213), +(32203, '保和街道', 4, 4213), +(32204, '双桥子街道', 4, 4213), +(32205, '双水碾街道', 4, 4213), +(32206, '圣灯街道', 4, 4213), +(32207, '府青路街道', 4, 4213), +(32208, '建设路街道', 4, 4213), +(32209, '新鸿路街道', 4, 4213), +(32210, '桃蹊路街道', 4, 4213), +(32211, '猛追湾街道', 4, 4213), +(32212, '跳蹬河街道', 4, 4213), +(32213, '青龙街道', 4, 4213), +(32214, '龙潭街道', 4, 4213), +(32215, '五津镇', 4, 4214), +(32216, '兴义镇', 4, 4214), +(32217, '安西镇', 4, 4214), +(32218, '文井乡', 4, 4214), +(32219, '新平镇', 4, 4214), +(32220, '方兴镇', 4, 4214), +(32221, '普兴镇', 4, 4214), +(32222, '永商镇', 4, 4214), +(32223, '花桥镇', 4, 4214), +(32224, '花源镇', 4, 4214), +(32225, '邓双镇', 4, 4214), +(32226, '金华镇', 4, 4214), +(32227, '三河街道', 4, 4215), +(32228, '军屯镇', 4, 4215), +(32229, '大丰街道', 4, 4215), +(32230, '斑竹园镇', 4, 4215), +(32231, '新民镇', 4, 4215), +(32232, '新繁镇', 4, 4215), +(32233, '新都镇', 4, 4215), +(32234, '木兰镇', 4, 4215), +(32235, '泰兴镇', 4, 4215), +(32236, '清流镇', 4, 4215), +(32237, '石板滩镇', 4, 4215), +(32238, '马家镇', 4, 4215), +(32239, '龙桥镇', 4, 4215), +(32240, '华兴街道', 4, 4216), +(32241, '双楠街道', 4, 4216), +(32242, '晋阳街道', 4, 4216), +(32243, '望江路街道', 4, 4216), +(32244, '机投桥街道', 4, 4216), +(32245, '桂溪街道', 4, 4216), +(32246, '浆洗街街道', 4, 4216); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32247, '火车南站街道', 4, 4216), +(32248, '玉林街道', 4, 4216), +(32249, '石羊场街道', 4, 4216), +(32250, '簇桥街道', 4, 4216), +(32251, '簇锦街道', 4, 4216), +(32252, '红牌楼街道', 4, 4216), +(32253, '肖家河街道', 4, 4216), +(32254, '芳草街街道', 4, 4216), +(32255, '跳伞塔街道', 4, 4216), +(32256, '金花桥街道', 4, 4216), +(32257, '万春镇', 4, 4217), +(32258, '公平街道', 4, 4217), +(32259, '和盛镇', 4, 4217), +(32260, '天府街道', 4, 4217), +(32261, '寿安镇', 4, 4217), +(32262, '柳城街道', 4, 4217), +(32263, '永宁镇', 4, 4217), +(32264, '永盛镇', 4, 4217), +(32265, '涌泉街道', 4, 4217), +(32266, '金马镇', 4, 4217), +(32267, '光明乡', 4, 4218), +(32268, '复兴乡', 4, 4218), +(32269, '大兴镇', 4, 4218), +(32270, '大塘镇', 4, 4218), +(32271, '寿安镇', 4, 4218), +(32272, '成佳镇', 4, 4218), +(32273, '朝阳湖镇', 4, 4218), +(32274, '甘溪镇', 4, 4218), +(32275, '白云乡', 4, 4218), +(32276, '西来镇', 4, 4218), +(32277, '长秋乡', 4, 4218), +(32278, '鹤山镇', 4, 4218), +(32279, '临济镇', 4, 4219), +(32280, '临邛镇', 4, 4219), +(32281, '冉义镇', 4, 4219), +(32282, '前进镇', 4, 4219), +(32283, '南宝乡', 4, 4219), +(32284, '卧龙镇', 4, 4219), +(32285, '回龙镇', 4, 4219), +(32286, '固驿镇', 4, 4219), +(32287, '大同乡', 4, 4219), +(32288, '天台山镇', 4, 4219), +(32289, '夹关镇', 4, 4219), +(32290, '孔明乡', 4, 4219), +(32291, '宝林镇', 4, 4219), +(32292, '平乐镇', 4, 4219), +(32293, '桑园镇', 4, 4219), +(32294, '水口镇', 4, 4219), +(32295, '油榨乡', 4, 4219), +(32296, '火井镇', 4, 4219), +(32297, '牟礼镇', 4, 4219), +(32298, '羊安镇', 4, 4219), +(32299, '茶园乡', 4, 4219), +(32300, '道佐乡', 4, 4219), +(32301, '高何镇', 4, 4219), +(32302, '高埂镇', 4, 4219), +(32303, '三道堰镇', 4, 4220), +(32304, '友爱镇', 4, 4220), +(32305, '古城镇', 4, 4220), +(32306, '合作镇', 4, 4220), +(32307, '唐元镇', 4, 4220), +(32308, '唐昌镇', 4, 4220), +(32309, '团结镇', 4, 4220); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32310, '安德镇', 4, 4220), +(32311, '安靖镇', 4, 4220), +(32312, '德源镇', 4, 4220), +(32313, '新民场镇', 4, 4220), +(32314, '犀浦镇', 4, 4220), +(32315, '红光镇', 4, 4220), +(32316, '花园镇', 4, 4220), +(32317, '郫筒镇', 4, 4220), +(32318, '中兴镇', 4, 4221), +(32319, '向峨乡', 4, 4221), +(32320, '大观镇', 4, 4221), +(32321, '天马镇', 4, 4221), +(32322, '安龙镇', 4, 4221), +(32323, '崇义镇', 4, 4221), +(32324, '幸福镇', 4, 4221), +(32325, '柳街镇', 4, 4221), +(32326, '灌口镇', 4, 4221), +(32327, '玉堂镇', 4, 4221), +(32328, '石羊镇', 4, 4221), +(32329, '紫坪铺镇', 4, 4221), +(32330, '翠月湖镇', 4, 4221), +(32331, '聚源镇', 4, 4221), +(32332, '胥家镇', 4, 4221), +(32333, '蒲阳镇', 4, 4221), +(32334, '虹口乡', 4, 4221), +(32335, '青城山镇', 4, 4221), +(32336, '龙池镇', 4, 4221), +(32337, '三星镇', 4, 4222), +(32338, '三溪镇', 4, 4222), +(32339, '云合镇', 4, 4222), +(32340, '五凤镇', 4, 4222), +(32341, '又新镇', 4, 4222), +(32342, '土桥镇', 4, 4222), +(32343, '官仓镇', 4, 4222), +(32344, '平桥乡', 4, 4222), +(32345, '广兴镇', 4, 4222), +(32346, '栖贤乡', 4, 4222), +(32347, '淮口镇', 4, 4222), +(32348, '清江镇', 4, 4222), +(32349, '白果镇', 4, 4222), +(32350, '福兴镇', 4, 4222), +(32351, '竹篙镇', 4, 4222), +(32352, '赵家镇', 4, 4222), +(32353, '赵镇', 4, 4222), +(32354, '转龙镇', 4, 4222), +(32355, '金龙镇', 4, 4222), +(32356, '隆盛镇', 4, 4222), +(32357, '高板镇', 4, 4222), +(32358, '九里堤街道', 4, 4223), +(32359, '五块石街道', 4, 4223), +(32360, '人民北路街道', 4, 4223), +(32361, '凤凰山街道', 4, 4223), +(32362, '天回镇街道', 4, 4223), +(32363, '抚琴街道', 4, 4223), +(32364, '沙河源街道', 4, 4223), +(32365, '茶店子街道', 4, 4223), +(32366, '荷花池街道', 4, 4223), +(32367, '营门口街道', 4, 4223), +(32368, '西华街道', 4, 4223), +(32369, '西安路街道', 4, 4223), +(32370, '金泉街道', 4, 4223), +(32371, '驷马桥街道', 4, 4223), +(32372, '黄忠街道', 4, 4223); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32373, '三圣街道', 4, 4224), +(32374, '东光街道', 4, 4224), +(32375, '书院街街道', 4, 4224), +(32376, '双桂路街道', 4, 4224), +(32377, '合江亭街道', 4, 4224), +(32378, '成龙路街道', 4, 4224), +(32379, '春熙路街道', 4, 4224), +(32380, '柳江街道', 4, 4224), +(32381, '水井坊街道', 4, 4224), +(32382, '沙河街道', 4, 4224), +(32383, '牛市口街道', 4, 4224), +(32384, '狮子山街道', 4, 4224), +(32385, '盐市口街道', 4, 4224), +(32386, '督院街街道', 4, 4224), +(32387, '莲新街道', 4, 4224), +(32388, '龙舟路街道', 4, 4224), +(32389, '人和乡', 4, 4225), +(32390, '城厢镇', 4, 4225), +(32391, '大同镇', 4, 4225), +(32392, '大弯街道', 4, 4225), +(32393, '姚渡镇', 4, 4225), +(32394, '弥牟镇', 4, 4225), +(32395, '清泉镇', 4, 4225), +(32396, '祥福镇', 4, 4225), +(32397, '福洪乡', 4, 4225), +(32398, '红阳街道', 4, 4225), +(32399, '龙王镇', 4, 4225), +(32400, '东坡街道', 4, 4226), +(32401, '光华街道', 4, 4226), +(32402, '太升路街道', 4, 4226), +(32403, '少城街道', 4, 4226), +(32404, '府南街道', 4, 4226), +(32405, '文家街道', 4, 4226), +(32406, '新华西路街道', 4, 4226), +(32407, '汪家拐街道', 4, 4226), +(32408, '苏坡街道', 4, 4226), +(32409, '草堂路街道', 4, 4226), +(32410, '草市街街道', 4, 4226), +(32411, '西御河街道', 4, 4226), +(32412, '金沙街道', 4, 4226), +(32413, '黄田坝街道', 4, 4226), +(32414, '万兴乡', 4, 4227), +(32415, '十陵街道', 4, 4227), +(32416, '同安街道', 4, 4227), +(32417, '大面街道', 4, 4227), +(32418, '山泉镇', 4, 4227), +(32419, '柏合镇', 4, 4227), +(32420, '洛带镇', 4, 4227), +(32421, '洪安镇', 4, 4227), +(32422, '茶店镇', 4, 4227), +(32423, '西河镇', 4, 4227), +(32424, '黄土镇', 4, 4227), +(32425, '龙泉街道', 4, 4227), +(32426, '三多寨镇', 4, 4228), +(32427, '何市镇', 4, 4228), +(32428, '凉高山街街道', 4, 4228), +(32429, '凤凰乡', 4, 4228), +(32430, '和平乡', 4, 4228), +(32431, '回龙镇', 4, 4228), +(32432, '团结镇', 4, 4228); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32433, '大安街街道', 4, 4228), +(32434, '大山铺镇', 4, 4228), +(32435, '庙坝镇', 4, 4228), +(32436, '新店镇', 4, 4228), +(32437, '新民镇', 4, 4228), +(32438, '永嘉乡', 4, 4228), +(32439, '牛佛镇', 4, 4228), +(32440, '马冲口街街道', 4, 4228), +(32441, '龙井街街道', 4, 4228), +(32442, '万寿镇', 4, 4229), +(32443, '东湖镇', 4, 4229), +(32444, '中石镇', 4, 4229), +(32445, '互助镇', 4, 4229), +(32446, '代寺镇', 4, 4229), +(32447, '兜山镇', 4, 4229), +(32448, '古佛镇', 4, 4229), +(32449, '安溪镇', 4, 4229), +(32450, '宝庆乡', 4, 4229), +(32451, '富世镇', 4, 4229), +(32452, '富和乡', 4, 4229), +(32453, '彭庙镇', 4, 4229), +(32454, '怀德镇', 4, 4229), +(32455, '李桥镇', 4, 4229), +(32456, '板桥镇', 4, 4229), +(32457, '永年镇', 4, 4229), +(32458, '狮市镇', 4, 4229), +(32459, '琵琶镇', 4, 4229), +(32460, '石道乡', 4, 4229), +(32461, '福善镇', 4, 4229), +(32462, '童寺镇', 4, 4229), +(32463, '赵化镇', 4, 4229), +(32464, '长滩镇', 4, 4229), +(32465, '飞龙镇', 4, 4229), +(32466, '骑龙镇', 4, 4229), +(32467, '龙万乡', 4, 4229), +(32468, '九洪乡', 4, 4230), +(32469, '仙市镇', 4, 4230), +(32470, '兴隆镇', 4, 4230), +(32471, '刘山乡', 4, 4230), +(32472, '卫坪镇', 4, 4230), +(32473, '富全镇', 4, 4230), +(32474, '永安镇', 4, 4230), +(32475, '沿滩镇', 4, 4230), +(32476, '王井镇', 4, 4230), +(32477, '瓦市镇', 4, 4230), +(32478, '联络镇', 4, 4230), +(32479, '邓关镇', 4, 4230), +(32480, '黄市镇', 4, 4230), +(32481, '东兴寺街道', 4, 4231), +(32482, '五星街街道', 4, 4231), +(32483, '仲权镇', 4, 4231), +(32484, '农团乡', 4, 4231), +(32485, '新街街道', 4, 4231), +(32486, '漆树乡', 4, 4231), +(32487, '红旗乡', 4, 4231), +(32488, '舒坪镇', 4, 4231), +(32489, '荣边镇', 4, 4231), +(32490, '郭家坳街道', 4, 4231), +(32491, '高峰乡', 4, 4231), +(32492, '东佳镇', 4, 4232), +(32493, '东兴镇', 4, 4232), +(32494, '乐德镇', 4, 4232), +(32495, '于佳乡', 4, 4232), +(32496, '保华镇', 4, 4232); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32497, '双古镇', 4, 4232), +(32498, '双石镇', 4, 4232), +(32499, '古佳乡', 4, 4232), +(32500, '古文镇', 4, 4232), +(32501, '墨林乡', 4, 4232), +(32502, '复兴乡', 4, 4232), +(32503, '度佳镇', 4, 4232), +(32504, '新桥镇', 4, 4232), +(32505, '旭阳镇', 4, 4232), +(32506, '望佳镇', 4, 4232), +(32507, '来牟镇', 4, 4232), +(32508, '正紫镇', 4, 4232), +(32509, '河口镇', 4, 4232), +(32510, '留佳镇', 4, 4232), +(32511, '观山镇', 4, 4232), +(32512, '过水镇', 4, 4232), +(32513, '金花乡', 4, 4232), +(32514, '铁厂镇', 4, 4232), +(32515, '长山镇', 4, 4232), +(32516, '雷音乡', 4, 4232), +(32517, '高山镇', 4, 4232), +(32518, '鼎新镇', 4, 4232), +(32519, '丹桂街街道', 4, 4233), +(32520, '五宝镇', 4, 4233), +(32521, '建设镇', 4, 4233), +(32522, '成佳镇', 4, 4233), +(32523, '桥头镇', 4, 4233), +(32524, '牛尾乡', 4, 4233), +(32525, '白庙镇', 4, 4233), +(32526, '章佳乡', 4, 4233), +(32527, '筱溪街街道', 4, 4233), +(32528, '艾叶镇', 4, 4233), +(32529, '莲花镇', 4, 4233), +(32530, '贡井街街道', 4, 4233), +(32531, '长土镇', 4, 4233), +(32532, '龙潭镇', 4, 4233), +(32533, '南山街道', 4, 4234), +(32534, '向阳村街道', 4, 4234), +(32535, '大渡口街道', 4, 4234), +(32536, '密地街道', 4, 4234), +(32537, '弄弄坪街道', 4, 4234), +(32538, '枣子坪街道', 4, 4234), +(32539, '炳草岗街道', 4, 4234), +(32540, '瓜子坪街道', 4, 4234), +(32541, '银江镇', 4, 4234), +(32542, '长寿路街道', 4, 4234), +(32543, '中坝乡', 4, 4235), +(32544, '仁和镇', 4, 4235), +(32545, '前进镇', 4, 4235), +(32546, '务本乡', 4, 4235), +(32547, '同德镇', 4, 4235), +(32548, '啊喇彝族乡', 4, 4235), +(32549, '大河中路街道', 4, 4235), +(32550, '大田镇', 4, 4235), +(32551, '大龙潭彝族乡', 4, 4235), +(32552, '太平乡', 4, 4235), +(32553, '布德镇', 4, 4235), +(32554, '平地镇', 4, 4235), +(32555, '总发乡', 4, 4235), +(32556, '福田镇', 4, 4235), +(32557, '金江镇', 4, 4235), +(32558, '共和乡', 4, 4236), +(32559, '和爱彝族乡', 4, 4236); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32560, '国胜乡', 4, 4236), +(32561, '惠民乡', 4, 4236), +(32562, '新九乡', 4, 4236), +(32563, '格萨拉彝族乡', 4, 4236), +(32564, '桐子林镇', 4, 4236), +(32565, '永兴镇', 4, 4236), +(32566, '渔门镇', 4, 4236), +(32567, '温泉彝族乡', 4, 4236), +(32568, '益民乡', 4, 4236), +(32569, '箐河傈僳族乡', 4, 4236), +(32570, '红宝苗族彝族乡', 4, 4236), +(32571, '红果彝族乡', 4, 4236), +(32572, '红格镇', 4, 4236), +(32573, '鳡鱼彝族乡', 4, 4236), +(32574, '丙谷镇', 4, 4237), +(32575, '垭口镇', 4, 4237), +(32576, '得石镇', 4, 4237), +(32577, '撒莲镇', 4, 4237), +(32578, '攀莲镇', 4, 4237), +(32579, '新山傈僳族乡', 4, 4237), +(32580, '普威镇', 4, 4237), +(32581, '湾丘彝族乡', 4, 4237), +(32582, '白坡彝族乡', 4, 4237), +(32583, '白马镇', 4, 4237), +(32584, '草场乡', 4, 4237), +(32585, '麻陇彝族乡', 4, 4237), +(32586, '大宝鼎街道', 4, 4238), +(32587, '摩梭河街道', 4, 4238), +(32588, '格里坪镇', 4, 4238), +(32589, '河门口街道', 4, 4238), +(32590, '清香坪街道', 4, 4238), +(32591, '玉泉街道', 4, 4238), +(32592, '陶家渡街道', 4, 4238), +(32593, '两河镇', 4, 4239), +(32594, '兴隆乡', 4, 4239), +(32595, '分水镇', 4, 4239), +(32596, '叙永镇', 4, 4239), +(32597, '合乐苗族乡', 4, 4239), +(32598, '后山镇', 4, 4239), +(32599, '向林乡', 4, 4239), +(32600, '大石乡', 4, 4239), +(32601, '天池镇', 4, 4239), +(32602, '摩尼镇', 4, 4239), +(32603, '枧槽苗族乡', 4, 4239), +(32604, '水尾镇', 4, 4239), +(32605, '水潦彝族乡', 4, 4239), +(32606, '江门镇', 4, 4239), +(32607, '白腊苗族乡', 4, 4239), +(32608, '石坝彝族乡', 4, 4239), +(32609, '营山乡', 4, 4239), +(32610, '落卜镇', 4, 4239), +(32611, '观兴乡', 4, 4239), +(32612, '赤水镇', 4, 4239), +(32613, '震东乡', 4, 4239), +(32614, '马岭镇', 4, 4239), +(32615, '麻城乡', 4, 4239), +(32616, '黄坭乡', 4, 4239), +(32617, '龙凤乡', 4, 4239), +(32618, '东兴乡', 4, 4240), +(32619, '丹桂镇', 4, 4240), +(32620, '二郎镇', 4, 4240); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32621, '双沙镇', 4, 4240), +(32622, '古蔺镇', 4, 4240), +(32623, '土城乡', 4, 4240), +(32624, '大寨苗族乡', 4, 4240), +(32625, '大村镇', 4, 4240), +(32626, '太平镇', 4, 4240), +(32627, '德跃镇', 4, 4240), +(32628, '护家乡', 4, 4240), +(32629, '桂花乡', 4, 4240), +(32630, '椒园乡', 4, 4240), +(32631, '水口镇', 4, 4240), +(32632, '永乐镇', 4, 4240), +(32633, '白泥乡', 4, 4240), +(32634, '石宝镇', 4, 4240), +(32635, '石屏乡', 4, 4240), +(32636, '箭竹苗族乡', 4, 4240), +(32637, '观文镇', 4, 4240), +(32638, '金星乡', 4, 4240), +(32639, '马嘶苗族乡', 4, 4240), +(32640, '马蹄乡', 4, 4240), +(32641, '鱼化乡', 4, 4240), +(32642, '黄荆乡', 4, 4240), +(32643, '龙山镇', 4, 4240), +(32644, '九支镇', 4, 4241), +(32645, '二里乡', 4, 4241), +(32646, '五通镇', 4, 4241), +(32647, '佛荫镇', 4, 4241), +(32648, '先市镇', 4, 4241), +(32649, '先滩镇', 4, 4241), +(32650, '凤鸣镇', 4, 4241), +(32651, '南滩乡', 4, 4241), +(32652, '参宝乡', 4, 4241), +(32653, '合江镇', 4, 4241), +(32654, '大桥镇', 4, 4241), +(32655, '实录乡', 4, 4241), +(32656, '密溪乡', 4, 4241), +(32657, '尧坝镇', 4, 4241), +(32658, '望龙镇', 4, 4241), +(32659, '榕右乡', 4, 4241), +(32660, '榕山镇', 4, 4241), +(32661, '焦滩乡', 4, 4241), +(32662, '甘雨镇', 4, 4241), +(32663, '白沙镇', 4, 4241), +(32664, '白米乡', 4, 4241), +(32665, '白鹿镇', 4, 4241), +(32666, '石龙乡', 4, 4241), +(32667, '福宝镇', 4, 4241), +(32668, '自怀镇', 4, 4241), +(32669, '虎头乡', 4, 4241), +(32670, '车辋镇', 4, 4241), +(32671, '丹林乡', 4, 4242), +(32672, '况场镇', 4, 4242), +(32673, '分水岭乡', 4, 4242), +(32674, '北城街道', 4, 4242), +(32675, '华阳街道', 4, 4242), +(32676, '南城街道', 4, 4242), +(32677, '大山坪街道', 4, 4242), +(32678, '弥陀镇', 4, 4242), +(32679, '方山镇', 4, 4242), +(32680, '江北镇', 4, 4242), +(32681, '泰安镇', 4, 4242), +(32682, '石寨乡', 4, 4242), +(32683, '茜草街道', 4, 4242), +(32684, '蓝田街道', 4, 4242); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32685, '通滩镇', 4, 4242), +(32686, '邻玉街道', 4, 4242), +(32687, '黄舣镇', 4, 4242), +(32688, '云锦镇', 4, 4243), +(32689, '云龙镇', 4, 4243), +(32690, '兆雅镇', 4, 4243), +(32691, '喻寺镇', 4, 4243), +(32692, '嘉明镇', 4, 4243), +(32693, '天兴镇', 4, 4243), +(32694, '太伏镇', 4, 4243), +(32695, '奇峰镇', 4, 4243), +(32696, '得胜镇', 4, 4243), +(32697, '方洞镇', 4, 4243), +(32698, '毗卢镇', 4, 4243), +(32699, '海潮镇', 4, 4243), +(32700, '潮河镇', 4, 4243), +(32701, '牛滩镇', 4, 4243), +(32702, '玄滩镇', 4, 4243), +(32703, '百和镇', 4, 4243), +(32704, '石桥镇', 4, 4243), +(32705, '福集镇', 4, 4243), +(32706, '立石镇', 4, 4243), +(32707, '上马镇', 4, 4244), +(32708, '丰乐镇', 4, 4244), +(32709, '合面镇', 4, 4244), +(32710, '大渡口镇', 4, 4244), +(32711, '天仙镇', 4, 4244), +(32712, '安富街道', 4, 4244), +(32713, '打古镇', 4, 4244), +(32714, '护国镇', 4, 4244), +(32715, '新乐镇', 4, 4244), +(32716, '棉花坡镇', 4, 4244), +(32717, '渠坝镇', 4, 4244), +(32718, '白节镇', 4, 4244), +(32719, '龙车镇', 4, 4244), +(32720, '双加镇', 4, 4245), +(32721, '安宁镇', 4, 4245), +(32722, '小市街道', 4, 4245), +(32723, '特兴镇', 4, 4245), +(32724, '石洞镇', 4, 4245), +(32725, '红星街道', 4, 4245), +(32726, '罗汉镇', 4, 4245), +(32727, '胡市镇', 4, 4245), +(32728, '莲花池街道', 4, 4245), +(32729, '金龙乡', 4, 4245), +(32730, '长安乡', 4, 4245), +(32731, '高坝厂区街道', 4, 4245), +(32732, '鱼塘镇', 4, 4245), +(32733, '万福镇', 4, 4246), +(32734, '东北镇', 4, 4246), +(32735, '仓山镇', 4, 4246), +(32736, '会龙镇', 4, 4246), +(32737, '元兴乡', 4, 4246), +(32738, '兴隆镇', 4, 4246), +(32739, '冯店镇', 4, 4246), +(32740, '凯江镇', 4, 4246), +(32741, '南华镇', 4, 4246), +(32742, '南山镇', 4, 4246), +(32743, '双龙镇', 4, 4246), +(32744, '古店乡', 4, 4246), +(32745, '合兴乡', 4, 4246), +(32746, '回龙镇', 4, 4246), +(32747, '太安镇', 4, 4246), +(32748, '太平乡', 4, 4246), +(32749, '富兴镇', 4, 4246); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32750, '广福镇', 4, 4246), +(32751, '悦来镇', 4, 4246), +(32752, '普兴镇', 4, 4246), +(32753, '杰兴镇', 4, 4246), +(32754, '柏树乡', 4, 4246), +(32755, '民主乡', 4, 4246), +(32756, '永丰乡', 4, 4246), +(32757, '永兴镇', 4, 4246), +(32758, '永太镇', 4, 4246), +(32759, '永安镇', 4, 4246), +(32760, '清河乡', 4, 4246), +(32761, '玉兴镇', 4, 4246), +(32762, '瓦店乡', 4, 4246), +(32763, '白果乡', 4, 4246), +(32764, '石泉乡', 4, 4246), +(32765, '石笋乡', 4, 4246), +(32766, '石龙乡', 4, 4246), +(32767, '积金镇', 4, 4246), +(32768, '继光镇', 4, 4246), +(32769, '联合镇', 4, 4246), +(32770, '辑庆镇', 4, 4246), +(32771, '通山乡', 4, 4246), +(32772, '通济镇', 4, 4246), +(32773, '集凤镇', 4, 4246), +(32774, '青市乡', 4, 4246), +(32775, '高店乡', 4, 4246), +(32776, '黄鹿镇', 4, 4246), +(32777, '龙台镇', 4, 4246), +(32778, '元石镇', 4, 4247), +(32779, '八角镇', 4, 4247), +(32780, '南泉镇', 4, 4247), +(32781, '双盛镇', 4, 4247), +(32782, '回澜镇', 4, 4247), +(32783, '方亭街道', 4, 4247), +(32784, '洛水镇', 4, 4247), +(32785, '湔氐镇', 4, 4247), +(32786, '皂角街道', 4, 4247), +(32787, '禾丰镇', 4, 4247), +(32788, '红白镇', 4, 4247), +(32789, '蓥华镇', 4, 4247), +(32790, '隐丰镇', 4, 4247), +(32791, '马井镇', 4, 4247), +(32792, '马祖镇', 4, 4247), +(32793, '三水镇', 4, 4248), +(32794, '兴隆镇', 4, 4248), +(32795, '北外乡', 4, 4248), +(32796, '南丰镇', 4, 4248), +(32797, '南兴镇', 4, 4248), +(32798, '向阳镇', 4, 4248), +(32799, '和兴镇', 4, 4248), +(32800, '小汉镇', 4, 4248), +(32801, '新丰镇', 4, 4248), +(32802, '新华镇', 4, 4248), +(32803, '新平镇', 4, 4248), +(32804, '松林镇', 4, 4248), +(32805, '西外乡', 4, 4248), +(32806, '西高镇', 4, 4248), +(32807, '连山镇', 4, 4248), +(32808, '金轮镇', 4, 4248), +(32809, '金鱼镇', 4, 4248), +(32810, '雒城镇', 4, 4248), +(32811, '高坪镇', 4, 4248), +(32812, '东湖乡', 4, 4249), +(32813, '八角井镇', 4, 4249), +(32814, '双东镇', 4, 4249), +(32815, '和新镇', 4, 4249); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32816, '城北街道', 4, 4249), +(32817, '城南街道', 4, 4249), +(32818, '天元镇', 4, 4249), +(32819, '孝感镇', 4, 4249), +(32820, '孝泉镇', 4, 4249), +(32821, '工农街道', 4, 4249), +(32822, '德新镇', 4, 4249), +(32823, '扬嘉镇', 4, 4249), +(32824, '新中镇', 4, 4249), +(32825, '旌东街道', 4, 4249), +(32826, '旌阳街道', 4, 4249), +(32827, '柏隆镇', 4, 4249), +(32828, '黄许镇', 4, 4249), +(32829, '东北镇', 4, 4250), +(32830, '九龙镇', 4, 4250), +(32831, '什地镇', 4, 4250), +(32832, '兴隆镇', 4, 4250), +(32833, '剑南镇', 4, 4250), +(32834, '土门镇', 4, 4250), +(32835, '天池乡', 4, 4250), +(32836, '孝德镇', 4, 4250), +(32837, '富新镇', 4, 4250), +(32838, '广济镇', 4, 4250), +(32839, '拱星镇', 4, 4250), +(32840, '新市镇', 4, 4250), +(32841, '板桥镇', 4, 4250), +(32842, '汉旺镇', 4, 4250), +(32843, '清平乡', 4, 4250), +(32844, '玉泉镇', 4, 4250), +(32845, '绵远镇', 4, 4250), +(32846, '西南镇', 4, 4250), +(32847, '遵道镇', 4, 4250), +(32848, '金花镇', 4, 4250), +(32849, '齐天镇', 4, 4250), +(32850, '万安镇', 4, 4251), +(32851, '御营镇', 4, 4251), +(32852, '慧觉镇', 4, 4251), +(32853, '新盛镇', 4, 4251), +(32854, '略坪镇', 4, 4251), +(32855, '白马关镇', 4, 4251), +(32856, '蟠龙镇', 4, 4251), +(32857, '调元镇', 4, 4251), +(32858, '鄢家镇', 4, 4251), +(32859, '金山镇', 4, 4251), +(32860, '万安镇', 4, 4252), +(32861, '三元镇', 4, 4252), +(32862, '上新乡', 4, 4252), +(32863, '下新乡', 4, 4252), +(32864, '东塔镇', 4, 4252), +(32865, '中太镇', 4, 4252), +(32866, '中新镇', 4, 4252), +(32867, '乐加乡', 4, 4252), +(32868, '乐安镇', 4, 4252), +(32869, '争胜乡', 4, 4252), +(32870, '云同乡', 4, 4252), +(32871, '光辉镇', 4, 4252), +(32872, '八洞镇', 4, 4252), +(32873, '凯河镇', 4, 4252), +(32874, '刘营镇', 4, 4252), +(32875, '前锋镇', 4, 4252), +(32876, '北坝镇', 4, 4252), +(32877, '协和乡', 4, 4252), +(32878, '双乐乡', 4, 4252), +(32879, '双胜乡', 4, 4252), +(32880, '古井镇', 4, 4252); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32881, '塔山镇', 4, 4252), +(32882, '安居镇', 4, 4252), +(32883, '宝泉乡', 4, 4252), +(32884, '富顺镇', 4, 4252), +(32885, '幸福乡', 4, 4252), +(32886, '广利乡', 4, 4252), +(32887, '建中乡', 4, 4252), +(32888, '建平镇', 4, 4252), +(32889, '建设镇', 4, 4252), +(32890, '忠孝乡', 4, 4252), +(32891, '断石乡', 4, 4252), +(32892, '新德镇', 4, 4252), +(32893, '新生镇', 4, 4252), +(32894, '新鲁镇', 4, 4252), +(32895, '景福镇', 4, 4252), +(32896, '曙光乡', 4, 4252), +(32897, '柳池镇', 4, 4252), +(32898, '永新镇', 4, 4252), +(32899, '永明镇', 4, 4252), +(32900, '潼川镇', 4, 4252), +(32901, '灵兴镇', 4, 4252), +(32902, '玉林乡', 4, 4252), +(32903, '百顷镇', 4, 4252), +(32904, '石安镇', 4, 4252), +(32905, '秋林镇', 4, 4252), +(32906, '立新镇', 4, 4252), +(32907, '紫河镇', 4, 4252), +(32908, '老马乡', 4, 4252), +(32909, '芦溪镇', 4, 4252), +(32910, '花园镇', 4, 4252), +(32911, '菊河乡', 4, 4252), +(32912, '西平镇', 4, 4252), +(32913, '观桥镇', 4, 4252), +(32914, '进都乡', 4, 4252), +(32915, '郪江镇', 4, 4252), +(32916, '里程乡', 4, 4252), +(32917, '金石镇', 4, 4252), +(32918, '金鼓乡', 4, 4252), +(32919, '高堰乡', 4, 4252), +(32920, '鲁班镇', 4, 4252), +(32921, '黎曙镇', 4, 4252), +(32922, '龙树镇', 4, 4252), +(32923, '坝底乡', 4, 4253), +(32924, '墩上乡', 4, 4253), +(32925, '小坝乡', 4, 4253), +(32926, '开坪乡', 4, 4253), +(32927, '擂鼓镇', 4, 4253), +(32928, '曲山镇', 4, 4253), +(32929, '桂溪乡', 4, 4253), +(32930, '桃龙藏族乡', 4, 4253), +(32931, '漩坪乡', 4, 4253), +(32932, '片口乡', 4, 4253), +(32933, '白什乡', 4, 4253), +(32934, '白坭乡', 4, 4253), +(32935, '禹里乡', 4, 4253), +(32936, '贯岭乡', 4, 4253), +(32937, '通口镇', 4, 4253), +(32938, '都坝乡', 4, 4253), +(32939, '陈家坝乡', 4, 4253), +(32940, '青片乡', 4, 4253), +(32941, '香泉乡', 4, 4253), +(32942, '马槽乡', 4, 4253), +(32943, '乐兴镇', 4, 4254), +(32944, '兴仁乡', 4, 4254), +(32945, '千佛镇', 4, 4254), +(32946, '塔水镇', 4, 4254); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(32947, '安昌镇', 4, 4254), +(32948, '宝林镇', 4, 4254), +(32949, '晓坝镇', 4, 4254), +(32950, '桑枣镇', 4, 4254), +(32951, '永安镇', 4, 4254), +(32952, '永河镇', 4, 4254), +(32953, '河清镇', 4, 4254), +(32954, '沸水镇', 4, 4254), +(32955, '清泉镇', 4, 4254), +(32956, '界牌镇', 4, 4254), +(32957, '睢水镇', 4, 4254), +(32958, '秀水镇', 4, 4254), +(32959, '花荄镇', 4, 4254), +(32960, '迎新乡', 4, 4254), +(32961, '高川乡', 4, 4254), +(32962, '黄土镇', 4, 4254), +(32963, '南坝镇', 4, 4255), +(32964, '古城镇', 4, 4255), +(32965, '响岩镇', 4, 4255), +(32966, '土城乡', 4, 4255), +(32967, '坝子乡', 4, 4255), +(32968, '大印镇', 4, 4255), +(32969, '大桥镇', 4, 4255), +(32970, '平南羌族乡', 4, 4255), +(32971, '平通镇', 4, 4255), +(32972, '徐塘羌族乡', 4, 4255), +(32973, '旧堡乡', 4, 4255), +(32974, '木座藏族乡', 4, 4255), +(32975, '木皮藏族乡', 4, 4255), +(32976, '水晶镇', 4, 4255), +(32977, '水田乡', 4, 4255), +(32978, '水观乡', 4, 4255), +(32979, '泗耳藏族乡', 4, 4255), +(32980, '白马藏族乡', 4, 4255), +(32981, '虎牙藏族乡', 4, 4255), +(32982, '豆叩镇', 4, 4255), +(32983, '锁江羌族乡', 4, 4255), +(32984, '阔达乡', 4, 4255), +(32985, '高村乡', 4, 4255), +(32986, '黄羊关藏族乡', 4, 4255), +(32987, '龙安镇', 4, 4255), +(32988, '三泉乡', 4, 4256), +(32989, '东石乡', 4, 4256), +(32990, '二洞乡', 4, 4256), +(32991, '交泰乡', 4, 4256), +(32992, '仁和镇', 4, 4256), +(32993, '仙峰乡', 4, 4256), +(32994, '仙鹅乡', 4, 4256), +(32995, '卧龙镇', 4, 4256), +(32996, '双峰乡', 4, 4256), +(32997, '双板乡', 4, 4256), +(32998, '大新乡', 4, 4256), +(32999, '宏仁乡', 4, 4256), +(33000, '定远乡', 4, 4256), +(33001, '宝石乡', 4, 4256), +(33002, '小垭乡', 4, 4256), +(33003, '建兴乡', 4, 4256), +(33004, '文兴乡', 4, 4256), +(33005, '文昌镇', 4, 4256), +(33006, '演武乡', 4, 4256), +(33007, '玛瑙镇', 4, 4256), +(33008, '白云镇', 4, 4256), +(33009, '石台乡', 4, 4256), +(33010, '石牛镇', 4, 4256); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33011, '自强镇', 4, 4256), +(33012, '观义镇', 4, 4256), +(33013, '许州镇', 4, 4256), +(33014, '豢龙乡', 4, 4256), +(33015, '金龙场乡', 4, 4256), +(33016, '长卿镇', 4, 4256), +(33017, '马迎乡', 4, 4256), +(33018, '马鸣乡', 4, 4256), +(33019, '黎雅镇', 4, 4256), +(33020, '三合镇', 4, 4257), +(33021, '东兴乡', 4, 4257), +(33022, '东安乡', 4, 4257), +(33023, '中坝镇', 4, 4257), +(33024, '义新乡', 4, 4257), +(33025, '九岭镇', 4, 4257), +(33026, '二郎庙镇', 4, 4257), +(33027, '云集乡', 4, 4257), +(33028, '八一乡', 4, 4257), +(33029, '六合乡', 4, 4257), +(33030, '华平街道', 4, 4257), +(33031, '厚坝镇', 4, 4257), +(33032, '双河镇', 4, 4257), +(33033, '含增街道', 4, 4257), +(33034, '含增镇', 4, 4257), +(33035, '大堰乡', 4, 4257), +(33036, '大康镇', 4, 4257), +(33037, '太平镇', 4, 4257), +(33038, '小溪坝镇', 4, 4257), +(33039, '彰明镇', 4, 4257), +(33040, '战旗镇', 4, 4257), +(33041, '敬元乡', 4, 4257), +(33042, '文胜乡', 4, 4257), +(33043, '新兴乡', 4, 4257), +(33044, '新安镇', 4, 4257), +(33045, '新春乡', 4, 4257), +(33046, '方水乡', 4, 4257), +(33047, '枫顺乡', 4, 4257), +(33048, '武都街道', 4, 4257), +(33049, '武都镇', 4, 4257), +(33050, '永胜镇', 4, 4257), +(33051, '河口镇', 4, 4257), +(33052, '石元乡', 4, 4257), +(33053, '西屏乡', 4, 4257), +(33054, '贯山乡', 4, 4257), +(33055, '重兴乡', 4, 4257), +(33056, '重华镇', 4, 4257), +(33057, '铜星乡', 4, 4257), +(33058, '长钢街道', 4, 4257), +(33059, '雁门镇', 4, 4257), +(33060, '青莲镇', 4, 4257), +(33061, '香水乡', 4, 4257), +(33062, '马角镇', 4, 4257), +(33063, '龙凤镇', 4, 4257), +(33064, '丰谷镇', 4, 4258), +(33065, '关帝镇', 4, 4258), +(33066, '创业园街道', 4, 4258), +(33067, '南山街道', 4, 4258), +(33068, '吴家镇', 4, 4258), +(33069, '园艺街道', 4, 4258), +(33070, '城北街道', 4, 4258), +(33071, '城厢街道', 4, 4258), +(33072, '城郊乡', 4, 4258), +(33073, '塘汛镇', 4, 4258), +(33074, '工区街道', 4, 4258); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33075, '新皂镇', 4, 4258), +(33076, '朝阳街道', 4, 4258), +(33077, '杨家镇', 4, 4258), +(33078, '永兴镇', 4, 4258), +(33079, '河边镇', 4, 4258), +(33080, '玉皇镇', 4, 4258), +(33081, '石塘镇', 4, 4258), +(33082, '石洞乡', 4, 4258), +(33083, '磨家镇', 4, 4258), +(33084, '经开区城南街道', 4, 4258), +(33085, '金峰镇', 4, 4258), +(33086, '青义镇', 4, 4258), +(33087, '高新区街道', 4, 4258), +(33088, '龙门镇', 4, 4258), +(33089, '三江涪街道', 4, 4259), +(33090, '东宣乡', 4, 4259), +(33091, '东林乡', 4, 4259), +(33092, '云凤乡', 4, 4259), +(33093, '凤凰乡', 4, 4259), +(33094, '刘家镇', 4, 4259), +(33095, '太平乡', 4, 4259), +(33096, '富乐街道', 4, 4259), +(33097, '小枧沟镇', 4, 4259), +(33098, '建华乡', 4, 4259), +(33099, '徐家镇', 4, 4259), +(33100, '忠兴镇', 4, 4259), +(33101, '新桥镇', 4, 4259), +(33102, '朝真乡', 4, 4259), +(33103, '松垭镇', 4, 4259), +(33104, '柏林镇', 4, 4259), +(33105, '梓绵乡', 4, 4259), +(33106, '沉抗镇', 4, 4259), +(33107, '涪江街道', 4, 4259), +(33108, '游仙镇', 4, 4259), +(33109, '玉河镇', 4, 4259), +(33110, '白蝉乡', 4, 4259), +(33111, '石板镇', 4, 4259), +(33112, '石马镇', 4, 4259), +(33113, '科学城华丰街道', 4, 4259), +(33114, '科学城春雷街道', 4, 4259), +(33115, '科学城松林街道', 4, 4259), +(33116, '街子乡', 4, 4259), +(33117, '观太乡', 4, 4259), +(33118, '魏城镇', 4, 4259), +(33119, '三元乡', 4, 4260), +(33120, '两岔河乡', 4, 4260), +(33121, '两河镇', 4, 4260), +(33122, '云溪镇', 4, 4260), +(33123, '五龙乡', 4, 4260), +(33124, '八角镇', 4, 4260), +(33125, '冯河乡', 4, 4260), +(33126, '剑河乡', 4, 4260), +(33127, '双碑乡', 4, 4260), +(33128, '大兴回族乡', 4, 4260), +(33129, '安家镇', 4, 4260), +(33130, '宗海乡', 4, 4260), +(33131, '富驿镇', 4, 4260), +(33132, '巨龙镇', 4, 4260), +(33133, '折弓乡', 4, 4260), +(33134, '新农乡', 4, 4260), +(33135, '来龙乡', 4, 4260), +(33136, '林农镇', 4, 4260), +(33137, '林山乡', 4, 4260); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33138, '柏梓镇', 4, 4260), +(33139, '榉溪乡', 4, 4260), +(33140, '毛公乡', 4, 4260), +(33141, '永泰乡', 4, 4260), +(33142, '洗泽乡', 4, 4260), +(33143, '玉龙镇', 4, 4260), +(33144, '石牛庙乡', 4, 4260), +(33145, '茶亭乡', 4, 4260), +(33146, '金孔镇', 4, 4260), +(33147, '金安乡', 4, 4260), +(33148, '金鸡镇', 4, 4260), +(33149, '高灯镇', 4, 4260), +(33150, '麻秧乡', 4, 4260), +(33151, '黄溪乡', 4, 4260), +(33152, '黄甸镇', 4, 4260), +(33153, '黑坪镇', 4, 4260), +(33154, '龙泉乡', 4, 4260), +(33155, '丁家乡', 4, 4261), +(33156, '元坝镇', 4, 4261), +(33157, '卫子镇', 4, 4261), +(33158, '大朝乡', 4, 4261), +(33159, '太公镇', 4, 4261), +(33160, '子云乡', 4, 4261), +(33161, '家镇', 4, 4261), +(33162, '射箭乡', 4, 4261), +(33163, '张家乡', 4, 4261), +(33164, '拣银岩社区街道', 4, 4261), +(33165, '文村乡', 4, 4261), +(33166, '明觉乡', 4, 4261), +(33167, '昭化镇', 4, 4261), +(33168, '晋贤乡', 4, 4261), +(33169, '朝阳乡', 4, 4261), +(33170, '柏林沟镇', 4, 4261), +(33171, '柳桥乡', 4, 4261), +(33172, '梅树乡', 4, 4261), +(33173, '沙坝乡', 4, 4261), +(33174, '清水乡', 4, 4261), +(33175, '白果乡', 4, 4261), +(33176, '石井铺乡', 4, 4261), +(33177, '磨滩镇', 4, 4261), +(33178, '红岩镇', 4, 4261), +(33179, '虎跳镇', 4, 4261), +(33180, '陈江乡', 4, 4261), +(33181, '青牛乡', 4, 4261), +(33182, '香溪乡', 4, 4261), +(33183, '黄龙乡', 4, 4261), +(33184, '三堆镇', 4, 4262), +(33185, '上西办事处', 4, 4262), +(33186, '东坝街道', 4, 4262), +(33187, '南河办事处', 4, 4262), +(33188, '嘉陵街道', 4, 4262), +(33189, '回龙河办事处', 4, 4262), +(33190, '大石镇', 4, 4262), +(33191, '宝轮镇', 4, 4262), +(33192, '工农镇', 4, 4262), +(33193, '杨家岩办事处', 4, 4262), +(33194, '河西街道', 4, 4262), +(33195, '白朝乡', 4, 4262), +(33196, '盘龙镇', 4, 4262), +(33197, '荣山镇', 4, 4262), +(33198, '袁家坝办事处', 4, 4262), +(33199, '西城办事处', 4, 4262), +(33200, '赤化镇', 4, 4262); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33201, '金洞乡', 4, 4262), +(33202, '雪峰办事处', 4, 4262), +(33203, '龙潭乡', 4, 4262), +(33204, '上寺乡', 4, 4263), +(33205, '下寺镇', 4, 4263), +(33206, '东宝镇', 4, 4263), +(33207, '义兴乡', 4, 4263), +(33208, '元山镇', 4, 4263), +(33209, '公兴镇', 4, 4263), +(33210, '公店乡', 4, 4263), +(33211, '凉山乡', 4, 4263), +(33212, '剑门关镇', 4, 4263), +(33213, '北庙乡', 4, 4263), +(33214, '吼狮乡', 4, 4263), +(33215, '国光乡', 4, 4263), +(33216, '圈龙乡', 4, 4263), +(33217, '垂泉乡', 4, 4263), +(33218, '城北镇', 4, 4263), +(33219, '姚家乡', 4, 4263), +(33220, '广坪乡', 4, 4263), +(33221, '店子乡', 4, 4263), +(33222, '开封镇', 4, 4263), +(33223, '张王乡', 4, 4263), +(33224, '摇铃乡', 4, 4263), +(33225, '普安镇', 4, 4263), +(33226, '木马镇', 4, 4263), +(33227, '杨村镇', 4, 4263), +(33228, '柏垭乡', 4, 4263), +(33229, '柘坝乡', 4, 4263), +(33230, '柳沟镇', 4, 4263), +(33231, '樵店乡', 4, 4263), +(33232, '正兴乡', 4, 4263), +(33233, '武连镇', 4, 4263), +(33234, '毛坝乡', 4, 4263), +(33235, '汉阳镇', 4, 4263), +(33236, '江口镇', 4, 4263), +(33237, '江石乡', 4, 4263), +(33238, '涂山乡', 4, 4263), +(33239, '演圣镇', 4, 4263), +(33240, '王河镇', 4, 4263), +(33241, '田家乡', 4, 4263), +(33242, '白龙镇', 4, 4263), +(33243, '盐店镇', 4, 4263), +(33244, '碑垭乡', 4, 4263), +(33245, '碗泉乡', 4, 4263), +(33246, '禾丰乡', 4, 4263), +(33247, '秀钟乡', 4, 4263), +(33248, '羊岭镇', 4, 4263), +(33249, '西庙乡', 4, 4263), +(33250, '迎水乡', 4, 4263), +(33251, '金仙镇', 4, 4263), +(33252, '锦屏乡', 4, 4263), +(33253, '长岭乡', 4, 4263), +(33254, '闻溪乡', 4, 4263), +(33255, '香沉镇', 4, 4263), +(33256, '马灯乡', 4, 4263), +(33257, '高池乡', 4, 4263), +(33258, '高观乡', 4, 4263), +(33259, '鹤龄镇', 4, 4263), +(33260, '龙源镇', 4, 4263), +(33261, '万家乡', 4, 4264), +(33262, '万山乡', 4, 4264), +(33263, '三江镇', 4, 4264), +(33264, '东河镇', 4, 4264), +(33265, '九龙乡', 4, 4264), +(33266, '五权镇', 4, 4264); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33267, '农建乡', 4, 4264), +(33268, '化龙乡', 4, 4264), +(33269, '双汇镇', 4, 4264), +(33270, '嘉川镇', 4, 4264), +(33271, '国华镇', 4, 4264), +(33272, '大两乡', 4, 4264), +(33273, '大德乡', 4, 4264), +(33274, '大河乡', 4, 4264), +(33275, '天星乡', 4, 4264), +(33276, '尚武镇', 4, 4264), +(33277, '张华镇', 4, 4264), +(33278, '普济镇', 4, 4264), +(33279, '木门镇', 4, 4264), +(33280, '枣林乡', 4, 4264), +(33281, '柳溪乡', 4, 4264), +(33282, '檬子乡', 4, 4264), +(33283, '正源乡', 4, 4264), +(33284, '水磨乡', 4, 4264), +(33285, '燕子乡', 4, 4264), +(33286, '白水镇', 4, 4264), +(33287, '盐河乡', 4, 4264), +(33288, '磨岩社区街道', 4, 4264), +(33289, '福庆乡', 4, 4264), +(33290, '英萃镇', 4, 4264), +(33291, '金溪镇', 4, 4264), +(33292, '陈家岭社区街道', 4, 4264), +(33293, '静乐寺社区街道', 4, 4264), +(33294, '高阳镇', 4, 4264), +(33295, '麻英乡', 4, 4264), +(33296, '黄洋镇', 4, 4264), +(33297, '鼓城乡', 4, 4264), +(33298, '龙凤乡', 4, 4264), +(33299, '东溪河乡', 4, 4265), +(33300, '两河口乡', 4, 4265), +(33301, '中子镇', 4, 4265), +(33302, '临溪乡', 4, 4265), +(33303, '大滩镇', 4, 4265), +(33304, '宣河乡', 4, 4265), +(33305, '小安乡', 4, 4265), +(33306, '平溪乡', 4, 4265), +(33307, '文安乡', 4, 4265), +(33308, '曾家镇', 4, 4265), +(33309, '朝天镇', 4, 4265), +(33310, '李家乡', 4, 4265), +(33311, '柏杨乡', 4, 4265), +(33312, '汪家乡', 4, 4265), +(33313, '沙河镇', 4, 4265), +(33314, '羊木镇', 4, 4265), +(33315, '花石乡', 4, 4265), +(33316, '蒲家乡', 4, 4265), +(33317, '西北乡', 4, 4265), +(33318, '转斗乡', 4, 4265), +(33319, '陈家乡', 4, 4265), +(33320, '青林乡', 4, 4265), +(33321, '马家坝乡', 4, 4265), +(33322, '鱼洞乡', 4, 4265), +(33323, '麻柳乡', 4, 4265), +(33324, '三川镇', 4, 4266), +(33325, '东溪镇', 4, 4266), +(33326, '东青镇', 4, 4266), +(33327, '中土乡', 4, 4266), +(33328, '云峰镇', 4, 4266), +(33329, '五龙镇', 4, 4266), +(33330, '亭子乡', 4, 4266); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33331, '元坝镇', 4, 4266), +(33332, '八庙镇', 4, 4266), +(33333, '双河乡', 4, 4266), +(33334, '唤马镇', 4, 4266), +(33335, '岳东镇', 4, 4266), +(33336, '彭店乡', 4, 4266), +(33337, '文昌镇', 4, 4266), +(33338, '新观乡', 4, 4266), +(33339, '月山乡', 4, 4266), +(33340, '桥溪乡', 4, 4266), +(33341, '歧坪镇', 4, 4266), +(33342, '永宁镇', 4, 4266), +(33343, '河地乡', 4, 4266), +(33344, '浙水乡', 4, 4266), +(33345, '漓江镇', 4, 4266), +(33346, '白山乡', 4, 4266), +(33347, '白桥镇', 4, 4266), +(33348, '白驿镇', 4, 4266), +(33349, '白鹤乡', 4, 4266), +(33350, '石灶乡', 4, 4266), +(33351, '石门乡', 4, 4266), +(33352, '石马镇', 4, 4266), +(33353, '禅林乡', 4, 4266), +(33354, '运山镇', 4, 4266), +(33355, '陵江镇', 4, 4266), +(33356, '雍河乡', 4, 4266), +(33357, '高坡镇', 4, 4266), +(33358, '鸳溪镇', 4, 4266), +(33359, '黄猫乡', 4, 4266), +(33360, '龙山镇', 4, 4266), +(33361, '龙洞乡', 4, 4266), +(33362, '龙王镇', 4, 4266), +(33363, '七佛乡', 4, 4267), +(33364, '三锅乡', 4, 4267), +(33365, '乐安寺乡', 4, 4267), +(33366, '乔庄镇', 4, 4267), +(33367, '关庄镇', 4, 4267), +(33368, '凉水镇', 4, 4267), +(33369, '前进乡', 4, 4267), +(33370, '唐家河国家级自然保护区', 4, 4267), +(33371, '大坝乡', 4, 4267), +(33372, '大院回族乡', 4, 4267), +(33373, '姚渡镇', 4, 4267), +(33374, '孔溪乡', 4, 4267), +(33375, '建峰乡', 4, 4267), +(33376, '房石镇', 4, 4267), +(33377, '曲河乡', 4, 4267), +(33378, '木鱼镇', 4, 4267), +(33379, '板桥乡', 4, 4267), +(33380, '桥楼乡', 4, 4267), +(33381, '楼子乡', 4, 4267), +(33382, '沙州镇', 4, 4267), +(33383, '瓦砾乡', 4, 4267), +(33384, '白家乡', 4, 4267), +(33385, '石坝乡', 4, 4267), +(33386, '竹园镇', 4, 4267), +(33387, '红光乡', 4, 4267), +(33388, '苏河乡', 4, 4267), +(33389, '茅坝乡', 4, 4267), +(33390, '茶坝乡', 4, 4267), +(33391, '营盘乡', 4, 4267), +(33392, '蒿溪回族乡', 4, 4267), +(33393, '观音店乡', 4, 4267), +(33394, '金子山乡', 4, 4267); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33395, '青溪镇', 4, 4267), +(33396, '马公乡', 4, 4267), +(33397, '马鹿乡', 4, 4267), +(33398, '骑马乡', 4, 4267), +(33399, '黄坪乡', 4, 4267), +(33400, '五方乡', 4, 4268), +(33401, '卓筒井镇', 4, 4268), +(33402, '回马镇', 4, 4268), +(33403, '天保镇', 4, 4268), +(33404, '妻阝口镇', 4, 4268), +(33405, '寸塘口乡', 4, 4268), +(33406, '星花乡', 4, 4268), +(33407, '智水乡', 4, 4268), +(33408, '民主镇', 4, 4268), +(33409, '河边镇', 4, 4268), +(33410, '玉峰镇', 4, 4268), +(33411, '石门镇', 4, 4268), +(33412, '福禄乡', 4, 4268), +(33413, '蓬莱镇', 4, 4268), +(33414, '象山镇', 4, 4268), +(33415, '通仙乡', 4, 4268), +(33416, '金元乡', 4, 4268), +(33417, '隆盛镇', 4, 4268), +(33418, '三家镇', 4, 4269), +(33419, '东禅镇', 4, 4269), +(33420, '中兴镇', 4, 4269), +(33421, '会龙镇', 4, 4269), +(33422, '保石镇', 4, 4269), +(33423, '分水镇', 4, 4269), +(33424, '大安乡', 4, 4269), +(33425, '安居镇', 4, 4269), +(33426, '常理乡', 4, 4269), +(33427, '拦江镇', 4, 4269), +(33428, '横山镇', 4, 4269), +(33429, '步云乡', 4, 4269), +(33430, '玉丰镇', 4, 4269), +(33431, '白马镇', 4, 4269), +(33432, '石洞镇', 4, 4269), +(33433, '磨溪镇', 4, 4269), +(33434, '聚贤乡', 4, 4269), +(33435, '莲花乡', 4, 4269), +(33436, '西眉镇', 4, 4269), +(33437, '观音乡', 4, 4269), +(33438, '马家乡', 4, 4269), +(33439, '万林乡', 4, 4270), +(33440, '东岳乡', 4, 4270), +(33441, '仁和镇', 4, 4270), +(33442, '伏河乡', 4, 4270), +(33443, '凤来镇', 4, 4270), +(33444, '双溪乡', 4, 4270), +(33445, '复兴镇', 4, 4270), +(33446, '大榆镇', 4, 4270), +(33447, '天仙镇', 4, 4270), +(33448, '太乙镇', 4, 4270), +(33449, '太兴乡', 4, 4270), +(33450, '太和镇', 4, 4270), +(33451, '官升镇', 4, 4270), +(33452, '广兴镇', 4, 4270), +(33453, '文升乡', 4, 4270), +(33454, '明星镇', 4, 4270), +(33455, '曹碑镇', 4, 4270), +(33456, '柳树镇', 4, 4270), +(33457, '洋溪镇', 4, 4270), +(33458, '涪西镇', 4, 4270), +(33459, '潼射镇', 4, 4270), +(33460, '玉太乡', 4, 4270); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33461, '瞿河乡', 4, 4270), +(33462, '金华镇', 4, 4270), +(33463, '金家镇', 4, 4270), +(33464, '金鹤乡', 4, 4270), +(33465, '陈古镇', 4, 4270), +(33466, '青堤乡', 4, 4270), +(33467, '青岗镇', 4, 4270), +(33468, '香山镇', 4, 4270), +(33469, '九莲街道', 4, 4271), +(33470, '仁里镇', 4, 4271), +(33471, '介福路街道', 4, 4271), +(33472, '保升乡', 4, 4271), +(33473, '凯旋路街道', 4, 4271), +(33474, '北固乡', 4, 4271), +(33475, '南强镇', 4, 4271), +(33476, '南津路街道', 4, 4271), +(33477, '唐家乡', 4, 4271), +(33478, '嘉禾街道', 4, 4271), +(33479, '复桥镇', 4, 4271), +(33480, '富源路街道', 4, 4271), +(33481, '广德寺街道', 4, 4271), +(33482, '慈音街道', 4, 4271), +(33483, '新桥镇', 4, 4271), +(33484, '桂花镇', 4, 4271), +(33485, '永兴镇', 4, 4271), +(33486, '河沙镇', 4, 4271), +(33487, '灵泉寺街道', 4, 4271), +(33488, '老池乡', 4, 4271), +(33489, '育才路街道', 4, 4271), +(33490, '西宁乡', 4, 4271), +(33491, '镇江寺街道', 4, 4271), +(33492, '高升街街道', 4, 4271), +(33493, '龙坪街道', 4, 4271), +(33494, '三凤镇', 4, 4272), +(33495, '下东乡', 4, 4272), +(33496, '任隆镇', 4, 4272), +(33497, '农兴乡', 4, 4272), +(33498, '吉星乡', 4, 4272), +(33499, '吉祥镇', 4, 4272), +(33500, '回水乡', 4, 4272), +(33501, '大石镇', 4, 4272), +(33502, '天福镇', 4, 4272), +(33503, '宝梵镇', 4, 4272), +(33504, '常乐镇', 4, 4272), +(33505, '文井镇', 4, 4272), +(33506, '新会镇', 4, 4272), +(33507, '新星乡', 4, 4272), +(33508, '新胜乡', 4, 4272), +(33509, '明月镇', 4, 4272), +(33510, '板桥乡', 4, 4272), +(33511, '槐花乡', 4, 4272), +(33512, '红江镇', 4, 4272), +(33513, '罗戈乡', 4, 4272), +(33514, '群利镇', 4, 4272), +(33515, '群力乡', 4, 4272), +(33516, '荷叶乡', 4, 4272), +(33517, '蓬南镇', 4, 4272), +(33518, '赤城镇', 4, 4272), +(33519, '金桥乡', 4, 4272), +(33520, '金龙乡', 4, 4272), +(33521, '高升乡', 4, 4272), +(33522, '高坪镇', 4, 4272), +(33523, '鸣凤镇', 4, 4272), +(33524, '黄泥乡', 4, 4272); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33525, '三烈乡', 4, 4273), +(33526, '东兴街道', 4, 4273), +(33527, '中山乡', 4, 4273), +(33528, '双才镇', 4, 4273), +(33529, '双桥乡', 4, 4273), +(33530, '同福乡', 4, 4273), +(33531, '大治乡', 4, 4273), +(33532, '太安乡', 4, 4273), +(33533, '富溪乡', 4, 4273), +(33534, '小河口镇', 4, 4273), +(33535, '平坦乡', 4, 4273), +(33536, '新店乡', 4, 4273), +(33537, '新江街道', 4, 4273), +(33538, '杨家镇', 4, 4273), +(33539, '柳桥乡', 4, 4273), +(33540, '椑南乡', 4, 4273), +(33541, '椑木镇', 4, 4273), +(33542, '永东乡', 4, 4273), +(33543, '永福乡', 4, 4273), +(33544, '田家镇', 4, 4273), +(33545, '白合镇', 4, 4273), +(33546, '石子镇', 4, 4273), +(33547, '胜利镇', 4, 4273), +(33548, '苏家乡', 4, 4273), +(33549, '西林街道', 4, 4273), +(33550, '郭北镇', 4, 4273), +(33551, '顺河镇', 4, 4273), +(33552, '高桥镇', 4, 4273), +(33553, '高梁镇', 4, 4273), +(33554, '东联镇', 4, 4274), +(33555, '两河镇', 4, 4274), +(33556, '严陵镇', 4, 4274), +(33557, '向义镇', 4, 4274), +(33558, '小河镇', 4, 4274), +(33559, '山王镇', 4, 4274), +(33560, '庆卫镇', 4, 4274), +(33561, '新场镇', 4, 4274), +(33562, '新店镇', 4, 4274), +(33563, '界牌镇', 4, 4274), +(33564, '碗厂镇', 4, 4274), +(33565, '观音滩镇', 4, 4274), +(33566, '越溪镇', 4, 4274), +(33567, '连界镇', 4, 4274), +(33568, '铺子湾镇', 4, 4274), +(33569, '镇西镇', 4, 4274), +(33570, '靖和镇', 4, 4274), +(33571, '高石镇', 4, 4274), +(33572, '黄荆沟镇', 4, 4274), +(33573, '龙会镇', 4, 4274), +(33574, '乐贤镇', 4, 4275), +(33575, '交通乡', 4, 4275), +(33576, '伏龙乡', 4, 4275), +(33577, '全安镇', 4, 4275), +(33578, '凌家镇', 4, 4275), +(33579, '凤鸣乡', 4, 4275), +(33580, '史家镇', 4, 4275), +(33581, '四合乡', 4, 4275), +(33582, '城东街道', 4, 4275), +(33583, '城南街道', 4, 4275), +(33584, '城西街道', 4, 4275), +(33585, '壕子口街道', 4, 4275), +(33586, '朝阳镇', 4, 4275), +(33587, '永安镇', 4, 4275), +(33588, '沱江乡', 4, 4275), +(33589, '牌楼街道', 4, 4275); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33590, '玉溪街道', 4, 4275), +(33591, '白马镇', 4, 4275), +(33592, '靖民镇', 4, 4275), +(33593, '龚家乡', 4, 4275), +(33594, '公民镇', 4, 4276), +(33595, '兴隆街镇', 4, 4276), +(33596, '双河镇', 4, 4276), +(33597, '双龙镇', 4, 4276), +(33598, '发轮镇', 4, 4276), +(33599, '太平镇', 4, 4276), +(33600, '孟塘镇', 4, 4276), +(33601, '宋家镇', 4, 4276), +(33602, '归德镇', 4, 4276), +(33603, '新桥镇', 4, 4276), +(33604, '明心寺镇', 4, 4276), +(33605, '板栗垭乡', 4, 4276), +(33606, '水南镇', 4, 4276), +(33607, '狮子镇', 4, 4276), +(33608, '球溪镇', 4, 4276), +(33609, '甘露镇', 4, 4276), +(33610, '罗泉镇', 4, 4276), +(33611, '苏家湾镇', 4, 4276), +(33612, '走马镇', 4, 4276), +(33613, '配龙镇', 4, 4276), +(33614, '重龙镇', 4, 4276), +(33615, '金李井镇', 4, 4276), +(33616, '铁佛镇', 4, 4276), +(33617, '银山镇', 4, 4276), +(33618, '陈家镇', 4, 4276), +(33619, '顺河场镇', 4, 4276), +(33620, '马鞍镇', 4, 4276), +(33621, '骝马镇', 4, 4276), +(33622, '高楼镇', 4, 4276), +(33623, '鱼溪镇', 4, 4276), +(33624, '龙山乡', 4, 4276), +(33625, '龙江镇', 4, 4276), +(33626, '龙结镇', 4, 4276), +(33627, '云顶镇', 4, 4277), +(33628, '双凤镇', 4, 4277), +(33629, '周兴镇', 4, 4277), +(33630, '响石镇', 4, 4277), +(33631, '圣灯镇', 4, 4277), +(33632, '山川镇', 4, 4277), +(33633, '普润乡', 4, 4277), +(33634, '李市镇', 4, 4277), +(33635, '桂花井乡', 4, 4277), +(33636, '渔箭镇', 4, 4277), +(33637, '界市镇', 4, 4277), +(33638, '石燕桥镇', 4, 4277), +(33639, '石碾镇', 4, 4277), +(33640, '胡家镇', 4, 4277), +(33641, '迎祥镇', 4, 4277), +(33642, '金鹅镇', 4, 4277), +(33643, '黄家镇', 4, 4277), +(33644, '龙市镇', 4, 4277), +(33645, '冠英镇', 4, 4278), +(33646, '新云乡', 4, 4278), +(33647, '杨柳镇', 4, 4278), +(33648, '桥沟镇', 4, 4278), +(33649, '牛华镇', 4, 4278), +(33650, '石麟镇', 4, 4278), +(33651, '竹根镇', 4, 4278), +(33652, '蔡金镇', 4, 4278), +(33653, '西坝镇', 4, 4278), +(33654, '辉山镇', 4, 4278); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33655, '金山镇', 4, 4278), +(33656, '金粟镇', 4, 4278), +(33657, '三教乡', 4, 4279), +(33658, '三江镇', 4, 4279), +(33659, '东林镇', 4, 4279), +(33660, '乌抛乡', 4, 4279), +(33661, '分全乡', 4, 4279), +(33662, '千佛镇', 4, 4279), +(33663, '周坡镇', 4, 4279), +(33664, '四合乡', 4, 4279), +(33665, '大佛乡', 4, 4279), +(33666, '天云乡', 4, 4279), +(33667, '宝五乡', 4, 4279), +(33668, '王村镇', 4, 4279), +(33669, '石牛乡', 4, 4279), +(33670, '研城镇', 4, 4279), +(33671, '研经镇', 4, 4279), +(33672, '磨池镇', 4, 4279), +(33673, '竹园镇', 4, 4279), +(33674, '纯复乡', 4, 4279), +(33675, '胜泉乡', 4, 4279), +(33676, '金峰乡', 4, 4279), +(33677, '镇阳乡', 4, 4279), +(33678, '门坎乡', 4, 4279), +(33679, '集益乡', 4, 4279), +(33680, '马踏镇', 4, 4279), +(33681, '高凤乡', 4, 4279), +(33682, '高滩乡', 4, 4279), +(33683, '黄钵乡', 4, 4279), +(33684, '三洞镇', 4, 4280), +(33685, '中兴镇', 4, 4280), +(33686, '华头镇', 4, 4280), +(33687, '南安乡', 4, 4280), +(33688, '吴场镇', 4, 4280), +(33689, '土门乡', 4, 4280), +(33690, '新场镇', 4, 4280), +(33691, '木城镇', 4, 4280), +(33692, '梧凤乡', 4, 4280), +(33693, '歇马乡', 4, 4280), +(33694, '永青乡', 4, 4280), +(33695, '漹城镇', 4, 4280), +(33696, '甘江镇', 4, 4280), +(33697, '甘霖镇', 4, 4280), +(33698, '界牌镇', 4, 4280), +(33699, '迎江乡', 4, 4280), +(33700, '青州乡', 4, 4280), +(33701, '顺河乡', 4, 4280), +(33702, '马村乡', 4, 4280), +(33703, '麻柳乡', 4, 4280), +(33704, '黄土镇', 4, 4280), +(33705, '龙沱乡', 4, 4280), +(33706, '乐都镇', 4, 4281), +(33707, '九里镇', 4, 4281), +(33708, '双福镇', 4, 4281), +(33709, '大为镇', 4, 4281), +(33710, '峨山镇', 4, 4281), +(33711, '川主乡', 4, 4281), +(33712, '新平乡', 4, 4281), +(33713, '普兴乡', 4, 4281), +(33714, '桂花桥镇', 4, 4281), +(33715, '沙溪乡', 4, 4281), +(33716, '符溪镇', 4, 4281), +(33717, '绥山镇', 4, 4281), +(33718, '罗目镇', 4, 4281), +(33719, '胜利镇', 4, 4281), +(33720, '高桥镇', 4, 4281); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33721, '黄湾乡', 4, 4281), +(33722, '龙池镇', 4, 4281), +(33723, '龙门乡', 4, 4281), +(33724, '万坪乡', 4, 4282), +(33725, '五渡镇', 4, 4282), +(33726, '共和乡', 4, 4282), +(33727, '勒乌乡', 4, 4282), +(33728, '哈曲乡', 4, 4282), +(33729, '大堡镇', 4, 4282), +(33730, '宜坪乡', 4, 4282), +(33731, '平等乡', 4, 4282), +(33732, '新场乡', 4, 4282), +(33733, '新林镇', 4, 4282), +(33734, '杨村乡', 4, 4282), +(33735, '杨河乡', 4, 4282), +(33736, '毛坪镇', 4, 4282), +(33737, '沙坪镇', 4, 4282), +(33738, '白杨乡', 4, 4282), +(33739, '红花乡', 4, 4282), +(33740, '觉莫乡', 4, 4282), +(33741, '金岩乡', 4, 4282), +(33742, '黑竹沟镇', 4, 4282), +(33743, '上河街街道', 4, 4283), +(33744, '临江镇', 4, 4283), +(33745, '九峰镇', 4, 4283), +(33746, '九龙乡', 4, 4283), +(33747, '全福镇', 4, 4283), +(33748, '关庙乡', 4, 4283), +(33749, '凌云乡', 4, 4283), +(33750, '剑峰乡', 4, 4283), +(33751, '土主镇', 4, 4283), +(33752, '安谷镇', 4, 4283), +(33753, '平兴乡', 4, 4283), +(33754, '张公桥街道', 4, 4283), +(33755, '悦来乡', 4, 4283), +(33756, '普仁乡', 4, 4283), +(33757, '杨湾乡', 4, 4283), +(33758, '棉竹镇', 4, 4283), +(33759, '水口镇', 4, 4283), +(33760, '泊水街街道', 4, 4283), +(33761, '牟子镇', 4, 4283), +(33762, '白马镇', 4, 4283), +(33763, '石龙乡', 4, 4283), +(33764, '童家镇', 4, 4283), +(33765, '篦子街街道', 4, 4283), +(33766, '罗汉镇', 4, 4283), +(33767, '苏稽镇', 4, 4283), +(33768, '茅桥镇', 4, 4283), +(33769, '车子镇', 4, 4283), +(33770, '迎阳乡', 4, 4283), +(33771, '通江镇', 4, 4283), +(33772, '青平镇', 4, 4283), +(33773, '凤村乡', 4, 4284), +(33774, '利店镇', 4, 4284), +(33775, '大楠镇', 4, 4284), +(33776, '富和乡', 4, 4284), +(33777, '幸福乡', 4, 4284), +(33778, '底堡乡', 4, 4284), +(33779, '建和乡', 4, 4284), +(33780, '新凡乡', 4, 4284), +(33781, '杨村乡', 4, 4284), +(33782, '武圣乡', 4, 4284), +(33783, '永福镇', 4, 4284), +(33784, '沐溪镇', 4, 4284), +(33785, '海云乡', 4, 4284); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33786, '炭库乡', 4, 4284), +(33787, '箭板镇', 4, 4284), +(33788, '舟坝镇', 4, 4284), +(33789, '茨竹乡', 4, 4284), +(33790, '高笋乡', 4, 4284), +(33791, '黄丹镇', 4, 4284), +(33792, '嘉农镇', 4, 4285), +(33793, '太平镇', 4, 4285), +(33794, '沙湾镇', 4, 4285), +(33795, '沫江办事处', 4, 4285), +(33796, '牛石镇', 4, 4285), +(33797, '碧山乡', 4, 4285), +(33798, '福禄镇', 4, 4285), +(33799, '范店乡', 4, 4285), +(33800, '葫芦镇', 4, 4285), +(33801, '谭坝乡', 4, 4285), +(33802, '踏水镇', 4, 4285), +(33803, '轸溪乡', 4, 4285), +(33804, '铜茨乡', 4, 4285), +(33805, '龚嘴镇', 4, 4285), +(33806, '下渡乡', 4, 4286), +(33807, '九井乡', 4, 4286), +(33808, '伏龙乡', 4, 4286), +(33809, '公平乡', 4, 4286), +(33810, '南阳乡', 4, 4286), +(33811, '双溪乡', 4, 4286), +(33812, '同兴乡', 4, 4286), +(33813, '塘坝乡', 4, 4286), +(33814, '大兴乡', 4, 4286), +(33815, '孝姑镇', 4, 4286), +(33816, '定文镇', 4, 4286), +(33817, '寿保乡', 4, 4286), +(33818, '岷东乡', 4, 4286), +(33819, '敖家镇', 4, 4286), +(33820, '新民镇', 4, 4286), +(33821, '新盛乡', 4, 4286), +(33822, '榨鼓乡', 4, 4286), +(33823, '泉水镇', 4, 4286), +(33824, '清溪镇', 4, 4286), +(33825, '玉屏乡', 4, 4286), +(33826, '玉津镇', 4, 4286), +(33827, '石溪镇', 4, 4286), +(33828, '纪家乡', 4, 4286), +(33829, '罗城镇', 4, 4286), +(33830, '舞雩乡', 4, 4286), +(33831, '芭沟镇', 4, 4286), +(33832, '金石井镇', 4, 4286), +(33833, '铁炉乡', 4, 4286), +(33834, '马庙乡', 4, 4286), +(33835, '龙孔镇', 4, 4286), +(33836, '共安彝族乡', 4, 4287), +(33837, '吉星乡', 4, 4287), +(33838, '和平彝族乡', 4, 4287), +(33839, '永和镇', 4, 4287), +(33840, '永胜乡', 4, 4287), +(33841, '金河镇', 4, 4287), +(33842, '三河口乡', 4, 4288), +(33843, '下溪乡', 4, 4288), +(33844, '劳动乡', 4, 4288), +(33845, '大竹堡乡', 4, 4288), +(33846, '建设乡', 4, 4288), +(33847, '梅子坝乡', 4, 4288), +(33848, '民主乡', 4, 4288), +(33849, '民建镇', 4, 4288), +(33850, '永红乡', 4, 4288); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33851, '沙腔乡', 4, 4288), +(33852, '烟烽乡', 4, 4288), +(33853, '石梁乡', 4, 4288), +(33854, '老河坝乡', 4, 4288), +(33855, '苏坝乡', 4, 4288), +(33856, '荍坝乡', 4, 4288), +(33857, '荣丁镇', 4, 4288), +(33858, '袁家溪乡', 4, 4288), +(33859, '镇江庙乡', 4, 4288), +(33860, '雪口山乡', 4, 4288), +(33861, '高卓营乡', 4, 4288), +(33862, '丁字桥镇', 4, 4289), +(33863, '三河镇', 4, 4289), +(33864, '三蛟镇', 4, 4289), +(33865, '中坝乡', 4, 4289), +(33866, '义路镇', 4, 4289), +(33867, '义门乡', 4, 4289), +(33868, '乐兴乡', 4, 4289), +(33869, '九龙乡', 4, 4289), +(33870, '二道镇', 4, 4289), +(33871, '五福镇', 4, 4289), +(33872, '保平镇', 4, 4289), +(33873, '先锋镇', 4, 4289), +(33874, '凤仪乡', 4, 4289), +(33875, '双庆乡', 4, 4289), +(33876, '双盘乡', 4, 4289), +(33877, '双胜镇', 4, 4289), +(33878, '合作乡', 4, 4289), +(33879, '周河镇', 4, 4289), +(33880, '回春镇', 4, 4289), +(33881, '土门镇', 4, 4289), +(33882, '复兴镇', 4, 4289), +(33883, '大仪镇', 4, 4289), +(33884, '大寅镇', 4, 4289), +(33885, '大罗乡', 4, 4289), +(33886, '大风乡', 4, 4289), +(33887, '度门镇', 4, 4289), +(33888, '张公镇', 4, 4289), +(33889, '思德乡', 4, 4289), +(33890, '扬桥镇', 4, 4289), +(33891, '文星镇', 4, 4289), +(33892, '新政镇', 4, 4289), +(33893, '日兴镇', 4, 4289), +(33894, '来仪乡', 4, 4289), +(33895, '板桥乡', 4, 4289), +(33896, '柳垭镇', 4, 4289), +(33897, '柴井乡', 4, 4289), +(33898, '檬垭乡', 4, 4289), +(33899, '武棚乡', 4, 4289), +(33900, '永乐镇', 4, 4289), +(33901, '永光乡', 4, 4289), +(33902, '灯塔乡', 4, 4289), +(33903, '炬光乡', 4, 4289), +(33904, '瓦子镇', 4, 4289), +(33905, '石佛乡', 4, 4289), +(33906, '碧泉乡', 4, 4289), +(33907, '福临乡', 4, 4289), +(33908, '秋垭乡', 4, 4289), +(33909, '立山镇', 4, 4289), +(33910, '老木乡', 4, 4289), +(33911, '芭蕉乡', 4, 4289), +(33912, '茶房乡', 4, 4289), +(33913, '观紫镇', 4, 4289), +(33914, '赛金镇', 4, 4289), +(33915, '金城镇', 4, 4289); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33916, '铜鼓乡', 4, 4289), +(33917, '阳通乡', 4, 4289), +(33918, '马鞍镇', 4, 4289), +(33919, '龙桥乡', 4, 4289), +(33920, '吉安镇', 4, 4290), +(33921, '曲水镇', 4, 4290), +(33922, '李渡镇', 4, 4290), +(33923, '火花街道', 4, 4290), +(33924, '万年镇', 4, 4291), +(33925, '三官镇', 4, 4291), +(33926, '三清乡', 4, 4291), +(33927, '丘垭乡', 4, 4291), +(33928, '东坝镇', 4, 4291), +(33929, '中心乡', 4, 4291), +(33930, '义丰乡', 4, 4291), +(33931, '五灵乡', 4, 4291), +(33932, '伏虎镇', 4, 4291), +(33933, '保城乡', 4, 4291), +(33934, '光中乡', 4, 4291), +(33935, '光华乡', 4, 4291), +(33936, '兴盛乡', 4, 4291), +(33937, '凤台乡', 4, 4291), +(33938, '千秋乡', 4, 4291), +(33939, '升水镇', 4, 4291), +(33940, '升钟镇', 4, 4291), +(33941, '南隆镇', 4, 4291), +(33942, '双佛镇', 4, 4291), +(33943, '双峰乡', 4, 4291), +(33944, '四龙乡', 4, 4291), +(33945, '大坪镇', 4, 4291), +(33946, '大埝乡', 4, 4291), +(33947, '大富乡', 4, 4291), +(33948, '大桥镇', 4, 4291), +(33949, '大河镇', 4, 4291), +(33950, '大王镇', 4, 4291), +(33951, '太华乡', 4, 4291), +(33952, '太霞乡', 4, 4291), +(33953, '宏观乡', 4, 4291), +(33954, '定水镇', 4, 4291), +(33955, '富利镇', 4, 4291), +(33956, '寒坡乡', 4, 4291), +(33957, '小元乡', 4, 4291), +(33958, '平桥乡', 4, 4291), +(33959, '店垭乡', 4, 4291), +(33960, '建兴镇', 4, 4291), +(33961, '柳树乡', 4, 4291), +(33962, '柳驿乡', 4, 4291), +(33963, '桐坪乡', 4, 4291), +(33964, '梅家乡', 4, 4291), +(33965, '楠木镇', 4, 4291), +(33966, '水音乡', 4, 4291), +(33967, '永定镇', 4, 4291), +(33968, '永庆乡', 4, 4291), +(33969, '永红乡', 4, 4291), +(33970, '河东镇', 4, 4291), +(33971, '河坝镇', 4, 4291), +(33972, '流马镇', 4, 4291), +(33973, '火峰乡', 4, 4291), +(33974, '玉镇乡', 4, 4291), +(33975, '王家镇', 4, 4291), +(33976, '皂角乡', 4, 4291), +(33977, '盘龙镇', 4, 4291), +(33978, '石河镇', 4, 4291), +(33979, '石泉乡', 4, 4291), +(33980, '碑院镇', 4, 4291), +(33981, '碧龙乡', 4, 4291); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(33982, '碾垭乡', 4, 4291), +(33983, '碾盘乡', 4, 4291), +(33984, '神坝镇', 4, 4291), +(33985, '窑场乡', 4, 4291), +(33986, '群龙乡', 4, 4291), +(33987, '老鸦镇', 4, 4291), +(33988, '肖家乡', 4, 4291), +(33989, '花罐镇', 4, 4291), +(33990, '董家乡', 4, 4291), +(33991, '西河乡', 4, 4291), +(33992, '谢河镇', 4, 4291), +(33993, '铁佛塘镇', 4, 4291), +(33994, '铁鞭乡', 4, 4291), +(33995, '长坪镇', 4, 4291), +(33996, '雄狮乡', 4, 4291), +(33997, '马王乡', 4, 4291), +(33998, '高云乡', 4, 4291), +(33999, '黄金镇', 4, 4291), +(34000, '龙凤乡', 4, 4291), +(34001, '龙庙乡', 4, 4291), +(34002, '一立镇', 4, 4292), +(34003, '三会镇', 4, 4292), +(34004, '世阳镇', 4, 4292), +(34005, '临江乡', 4, 4292), +(34006, '华兴乡', 4, 4292), +(34007, '双店乡', 4, 4292), +(34008, '双桂镇', 4, 4292), +(34009, '土门乡', 4, 4292), +(34010, '大兴乡', 4, 4292), +(34011, '大同乡', 4, 4292), +(34012, '大观乡', 4, 4292), +(34013, '大通镇', 4, 4292), +(34014, '天星乡', 4, 4292), +(34015, '太和乡', 4, 4292), +(34016, '安平镇', 4, 4292), +(34017, '安福镇', 4, 4292), +(34018, '文峰镇', 4, 4292), +(34019, '新场乡', 4, 4292), +(34020, '新庙乡', 4, 4292), +(34021, '晏家镇', 4, 4292), +(34022, '木老乡', 4, 4292), +(34023, '桃园乡', 4, 4292), +(34024, '桥龙乡', 4, 4292), +(34025, '河西乡', 4, 4292), +(34026, '白家乡', 4, 4292), +(34027, '盐溪乡', 4, 4292), +(34028, '石楼乡', 4, 4292), +(34029, '礼乐乡', 4, 4292), +(34030, '积善乡', 4, 4292), +(34031, '移山乡', 4, 4292), +(34032, '花园乡', 4, 4292), +(34033, '西兴镇', 4, 4292), +(34034, '里坝镇', 4, 4292), +(34035, '金凤镇', 4, 4292), +(34036, '金宝镇', 4, 4292), +(34037, '集凤镇', 4, 4292), +(34038, '龙岭镇', 4, 4292), +(34039, '龙泉镇', 4, 4292), +(34040, '龙蟠镇', 4, 4292), +(34041, '七涧乡', 4, 4293), +(34042, '三元乡', 4, 4293), +(34043, '三兴镇', 4, 4293), +(34044, '东升镇', 4, 4293), +(34045, '丰产乡', 4, 4293), +(34046, '六合乡', 4, 4293), +(34047, '凉风乡', 4, 4293); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34048, '双林乡', 4, 4293), +(34049, '双流镇', 4, 4293), +(34050, '双溪乡', 4, 4293), +(34051, '合兴乡', 4, 4293), +(34052, '四喜乡', 4, 4293), +(34053, '回龙镇', 4, 4293), +(34054, '城南镇', 4, 4293), +(34055, '增产乡', 4, 4293), +(34056, '大庙乡', 4, 4293), +(34057, '太蓬乡', 4, 4293), +(34058, '孔雀乡', 4, 4293), +(34059, '安化乡', 4, 4293), +(34060, '安固乡', 4, 4293), +(34061, '小桥镇', 4, 4293), +(34062, '带河乡', 4, 4293), +(34063, '悦中乡', 4, 4293), +(34064, '新店镇', 4, 4293), +(34065, '明德乡', 4, 4293), +(34066, '星火镇', 4, 4293), +(34067, '普岭乡', 4, 4293), +(34068, '朗池镇', 4, 4293), +(34069, '木桠镇', 4, 4293), +(34070, '木顶乡', 4, 4293), +(34071, '柏坪乡', 4, 4293), +(34072, '柏林乡', 4, 4293), +(34073, '法堂乡', 4, 4293), +(34074, '济川乡', 4, 4293), +(34075, '消水镇', 4, 4293), +(34076, '涌泉乡', 4, 4293), +(34077, '清水乡', 4, 4293), +(34078, '清源乡', 4, 4293), +(34079, '灵鹫镇', 4, 4293), +(34080, '玲珑乡', 4, 4293), +(34081, '福源乡', 4, 4293), +(34082, '绿井镇', 4, 4293), +(34083, '绿水镇', 4, 4293), +(34084, '老林镇', 4, 4293), +(34085, '茶盘乡', 4, 4293), +(34086, '蓼叶镇', 4, 4293), +(34087, '西桥镇', 4, 4293), +(34088, '通天乡', 4, 4293), +(34089, '青山乡', 4, 4293), +(34090, '骆市镇', 4, 4293), +(34091, '高码乡', 4, 4293), +(34092, '黄渡镇', 4, 4293), +(34093, '龙伏乡', 4, 4293), +(34094, '三坝乡', 4, 4294), +(34095, '两路乡', 4, 4294), +(34096, '兴旺镇', 4, 4294), +(34097, '凤石乡', 4, 4294), +(34098, '利溪镇', 4, 4294), +(34099, '南燕乡', 4, 4294), +(34100, '天成乡', 4, 4294), +(34101, '巨龙镇', 4, 4294), +(34102, '平头乡', 4, 4294), +(34103, '开元乡', 4, 4294), +(34104, '徐家镇', 4, 4294), +(34105, '新园乡', 4, 4294), +(34106, '新河乡', 4, 4294), +(34107, '杨家镇', 4, 4294), +(34108, '柳滩乡', 4, 4294), +(34109, '正源镇', 4, 4294), +(34110, '河舒镇', 4, 4294), +(34111, '济渡乡', 4, 4294), +(34112, '海田乡', 4, 4294), +(34113, '相如镇', 4, 4294); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34114, '睦坝乡', 4, 4294), +(34115, '石孔乡', 4, 4294), +(34116, '石梁乡', 4, 4294), +(34117, '碧溪乡', 4, 4294), +(34118, '福德镇', 4, 4294), +(34119, '罗家镇', 4, 4294), +(34120, '群乐乡', 4, 4294), +(34121, '茶亭乡', 4, 4294), +(34122, '诸家乡', 4, 4294), +(34123, '金溪镇', 4, 4294), +(34124, '金甲乡', 4, 4294), +(34125, '银汉镇', 4, 4294), +(34126, '锦屏镇', 4, 4294), +(34127, '长梁乡', 4, 4294), +(34128, '骑龙乡', 4, 4294), +(34129, '高庙乡', 4, 4294), +(34130, '鲜店乡', 4, 4294), +(34131, '龙云镇', 4, 4294), +(34132, '龙蚕镇', 4, 4294), +(34133, '东太乡', 4, 4295), +(34134, '东岱乡', 4, 4295), +(34135, '中南乡', 4, 4295), +(34136, '中岭乡', 4, 4295), +(34137, '义兴镇', 4, 4295), +(34138, '义和乡', 4, 4295), +(34139, '仁和镇', 4, 4295), +(34140, '仙林镇', 4, 4295), +(34141, '关文镇', 4, 4295), +(34142, '凤和乡', 4, 4295), +(34143, '凤鸣镇', 4, 4295), +(34144, '华光乡', 4, 4295), +(34145, '占山乡', 4, 4295), +(34146, '双凤镇', 4, 4295), +(34147, '双江乡', 4, 4295), +(34148, '双洛乡', 4, 4295), +(34149, '古楼镇', 4, 4295), +(34150, '同德乡', 4, 4295), +(34151, '复安乡', 4, 4295), +(34152, '多扶镇', 4, 4295), +(34153, '大全镇', 4, 4295), +(34154, '太平镇', 4, 4295), +(34155, '宏桥乡', 4, 4295), +(34156, '岱林乡', 4, 4295), +(34157, '常林乡', 4, 4295), +(34158, '扶君乡', 4, 4295), +(34159, '晋城镇', 4, 4295), +(34160, '李桥乡', 4, 4295), +(34161, '槐树镇', 4, 4295), +(34162, '永清乡', 4, 4295), +(34163, '祥龙乡', 4, 4295), +(34164, '紫岩乡', 4, 4295), +(34165, '罐垭乡', 4, 4295), +(34166, '莲池乡', 4, 4295), +(34167, '西碾乡', 4, 4295), +(34168, '观凤乡', 4, 4295), +(34169, '车龙乡', 4, 4295), +(34170, '金山乡', 4, 4295), +(34171, '金泉乡', 4, 4295), +(34172, '金源乡', 4, 4295), +(34173, '青狮镇', 4, 4295), +(34174, '青龙乡', 4, 4295), +(34175, '高院镇', 4, 4295), +(34176, '鸣龙镇', 4, 4295), +(34177, '七里街道', 4, 4296), +(34178, '三庙乡', 4, 4296), +(34179, '东兴乡', 4, 4296); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34180, '二龙镇', 4, 4296), +(34181, '五马乡', 4, 4296), +(34182, '保宁街道', 4, 4296), +(34183, '凉水乡', 4, 4296), +(34184, '北门乡', 4, 4296), +(34185, '千佛镇', 4, 4296), +(34186, '博树回族乡', 4, 4296), +(34187, '双龙镇', 4, 4296), +(34188, '垭口乡', 4, 4296), +(34189, '天宫乡', 4, 4296), +(34190, '天林乡', 4, 4296), +(34191, '妙高镇', 4, 4296), +(34192, '宝台乡', 4, 4296), +(34193, '宝马镇', 4, 4296), +(34194, '峰占乡', 4, 4296), +(34195, '彭城镇', 4, 4296), +(34196, '思依镇', 4, 4296), +(34197, '文成镇', 4, 4296), +(34198, '方山乡', 4, 4296), +(34199, '望垭镇', 4, 4296), +(34200, '木兰乡', 4, 4296), +(34201, '朱镇乡', 4, 4296), +(34202, '枣碧乡', 4, 4296), +(34203, '柏垭镇', 4, 4296), +(34204, '桥楼乡', 4, 4296), +(34205, '水观镇', 4, 4296), +(34206, '江南镇', 4, 4296), +(34207, '沙溪街道', 4, 4296), +(34208, '河楼乡', 4, 4296), +(34209, '河溪镇', 4, 4296), +(34210, '治平乡', 4, 4296), +(34211, '洪山镇', 4, 4296), +(34212, '清泉乡', 4, 4296), +(34213, '玉台镇', 4, 4296), +(34214, '石滩镇', 4, 4296), +(34215, '石龙镇', 4, 4296), +(34216, '福星乡', 4, 4296), +(34217, '老观镇', 4, 4296), +(34218, '西山乡', 4, 4296), +(34219, '解元乡', 4, 4296), +(34220, '金垭镇', 4, 4296), +(34221, '金城乡', 4, 4296), +(34222, '金子乡', 4, 4296), +(34223, '飞凤镇', 4, 4296), +(34224, '鹤丰乡', 4, 4296), +(34225, '龙泉镇', 4, 4296), +(34226, '东南街道', 4, 4297), +(34227, '中城街道', 4, 4297), +(34228, '共兴镇', 4, 4297), +(34229, '凤山乡', 4, 4297), +(34230, '北城街道', 4, 4297), +(34231, '华凤街道', 4, 4297), +(34232, '双桥镇', 4, 4297), +(34233, '同仁乡', 4, 4297), +(34234, '大林乡', 4, 4297), +(34235, '搬罾镇', 4, 4297), +(34236, '新复乡', 4, 4297), +(34237, '新建街道', 4, 4297), +(34238, '李家镇', 4, 4297), +(34239, '桂花乡', 4, 4297), +(34240, '梵殿乡', 4, 4297), +(34241, '永丰乡', 4, 4297), +(34242, '渔溪乡', 4, 4297), +(34243, '潆溪镇', 4, 4297), +(34244, '灯台乡', 4, 4297); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34245, '舞凤街道', 4, 4297), +(34246, '芦溪镇', 4, 4297), +(34247, '荆溪镇', 4, 4297), +(34248, '西城街道', 4, 4297), +(34249, '辉景乡', 4, 4297), +(34250, '金台镇', 4, 4297), +(34251, '顺和乡', 4, 4297), +(34252, '鱼龙乡', 4, 4297), +(34253, '黄金乡', 4, 4297), +(34254, '龙桂乡', 4, 4297), +(34255, '万家乡', 4, 4298), +(34256, '东观镇', 4, 4298), +(34257, '会龙镇', 4, 4298), +(34258, '凤凰乡', 4, 4298), +(34259, '南江乡', 4, 4298), +(34260, '喻家乡', 4, 4298), +(34261, '小龙镇', 4, 4298), +(34262, '御史乡', 4, 4298), +(34263, '搽耳镇', 4, 4298), +(34264, '斑竹乡', 4, 4298), +(34265, '永安镇', 4, 4298), +(34266, '江陵镇', 4, 4298), +(34267, '浸水乡', 4, 4298), +(34268, '清溪街道', 4, 4298), +(34269, '溪头乡', 4, 4298), +(34270, '白塔街道', 4, 4298), +(34271, '石圭镇', 4, 4298), +(34272, '老君镇', 4, 4298), +(34273, '胜观镇', 4, 4298), +(34274, '螺溪镇', 4, 4298), +(34275, '走马乡', 4, 4298), +(34276, '都京镇', 4, 4298), +(34277, '鄢家乡', 4, 4298), +(34278, '长乐镇', 4, 4298), +(34279, '阙家镇', 4, 4298), +(34280, '隆兴乡', 4, 4298), +(34281, '青居镇', 4, 4298), +(34282, '青松乡', 4, 4298), +(34283, '青莲镇', 4, 4298), +(34284, '马家乡', 4, 4298), +(34285, '黄溪乡', 4, 4298), +(34286, '龙门镇', 4, 4298), +(34287, '万胜镇', 4, 4299), +(34288, '三苏乡', 4, 4299), +(34289, '修文镇', 4, 4299), +(34290, '土地乡', 4, 4299), +(34291, '复兴乡', 4, 4299), +(34292, '复盛乡', 4, 4299), +(34293, '多悦镇', 4, 4299), +(34294, '大石桥街道', 4, 4299), +(34295, '太和镇', 4, 4299), +(34296, '富牛镇', 4, 4299), +(34297, '尚义镇', 4, 4299), +(34298, '崇仁镇', 4, 4299), +(34299, '崇礼镇', 4, 4299), +(34300, '广济乡', 4, 4299), +(34301, '思濛镇', 4, 4299), +(34302, '悦兴镇', 4, 4299), +(34303, '松江镇', 4, 4299), +(34304, '柳圣乡', 4, 4299), +(34305, '永寿镇', 4, 4299), +(34306, '白马镇', 4, 4299), +(34307, '盘鳌乡', 4, 4299), +(34308, '秦家镇', 4, 4299), +(34309, '苏祠街道', 4, 4299); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34310, '象耳镇', 4, 4299), +(34311, '通惠街道', 4, 4299), +(34312, '金花乡', 4, 4299), +(34313, '丹棱镇', 4, 4300), +(34314, '仁美镇', 4, 4300), +(34315, '双桥镇', 4, 4300), +(34316, '张场镇', 4, 4300), +(34317, '杨场镇', 4, 4300), +(34318, '石桥乡', 4, 4300), +(34319, '顺龙乡', 4, 4300), +(34320, '中农镇', 4, 4301), +(34321, '中岗乡', 4, 4301), +(34322, '促进乡', 4, 4301), +(34323, '元通乡', 4, 4301), +(34324, '兆嘉乡', 4, 4301), +(34325, '兴盛乡', 4, 4301), +(34326, '农旺乡', 4, 4301), +(34327, '凤陵乡', 4, 4301), +(34328, '北斗镇', 4, 4301), +(34329, '双堡乡', 4, 4301), +(34330, '古佛乡', 4, 4301), +(34331, '合兴乡', 4, 4301), +(34332, '向家乡', 4, 4301), +(34333, '四公乡', 4, 4301), +(34334, '城堰乡', 4, 4301), +(34335, '大化镇', 4, 4301), +(34336, '天峨乡', 4, 4301), +(34337, '始建镇', 4, 4301), +(34338, '宝飞镇', 4, 4301), +(34339, '宝马乡', 4, 4301), +(34340, '富加镇', 4, 4301), +(34341, '彰加镇', 4, 4301), +(34342, '慈航镇', 4, 4301), +(34343, '文宫镇', 4, 4301), +(34344, '文林镇', 4, 4301), +(34345, '新店乡', 4, 4301), +(34346, '方家镇', 4, 4301), +(34347, '景贤乡', 4, 4301), +(34348, '曲江乡', 4, 4301), +(34349, '曹家乡', 4, 4301), +(34350, '松峰乡', 4, 4301), +(34351, '板桥乡', 4, 4301), +(34352, '板燕乡', 4, 4301), +(34353, '汪洋镇', 4, 4301), +(34354, '河口乡', 4, 4301), +(34355, '洪峰乡', 4, 4301), +(34356, '涂家乡', 4, 4301), +(34357, '清水镇', 4, 4301), +(34358, '满井镇', 4, 4301), +(34359, '玉龙乡', 4, 4301), +(34360, '珠嘉乡', 4, 4301), +(34361, '石嘴乡', 4, 4301), +(34362, '禄加镇', 4, 4301), +(34363, '禾加镇', 4, 4301), +(34364, '藕塘乡', 4, 4301), +(34365, '虞丞乡', 4, 4301), +(34366, '观寺乡', 4, 4301), +(34367, '视高镇', 4, 4301), +(34368, '识经乡', 4, 4301), +(34369, '谢安乡', 4, 4301), +(34370, '里仁乡', 4, 4301), +(34371, '钟祥镇', 4, 4301), +(34372, '青岗乡', 4, 4301), +(34373, '高家镇', 4, 4301), +(34374, '鳌陵乡', 4, 4301), +(34375, '鸭池乡', 4, 4301); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34376, '黑龙滩镇', 4, 4301), +(34377, '龙桥乡', 4, 4301), +(34378, '龙正镇', 4, 4301), +(34379, '龙马镇', 4, 4301), +(34380, '义和乡', 4, 4302), +(34381, '保胜乡', 4, 4302), +(34382, '公义镇', 4, 4302), +(34383, '凤鸣镇', 4, 4302), +(34384, '彭溪镇', 4, 4302), +(34385, '武阳乡', 4, 4302), +(34386, '江口镇', 4, 4302), +(34387, '灵石镇', 4, 4302), +(34388, '皇陵乡', 4, 4302), +(34389, '观音镇', 4, 4302), +(34390, '谢家镇', 4, 4302), +(34391, '青龙镇', 4, 4302), +(34392, '黄丰镇', 4, 4302), +(34393, '三宝镇', 4, 4303), +(34394, '东岳镇', 4, 4303), +(34395, '中保镇', 4, 4303), +(34396, '中山乡', 4, 4303), +(34397, '余坪镇', 4, 4303), +(34398, '将军乡', 4, 4303), +(34399, '柳江镇', 4, 4303), +(34400, '桃源乡', 4, 4303), +(34401, '槽渔滩镇', 4, 4303), +(34402, '止戈镇', 4, 4303), +(34403, '汉王乡', 4, 4303), +(34404, '洪川镇', 4, 4303), +(34405, '瓦屋山镇', 4, 4303), +(34406, '花溪镇', 4, 4303), +(34407, '高庙镇', 4, 4303), +(34408, '南城镇', 4, 4304), +(34409, '汉阳镇', 4, 4304), +(34410, '河坝子镇', 4, 4304), +(34411, '瑞峰镇', 4, 4304), +(34412, '白果乡', 4, 4304), +(34413, '罗波乡', 4, 4304), +(34414, '西龙镇', 4, 4304), +(34415, '青城镇', 4, 4304), +(34416, '高台乡', 4, 4304), +(34417, '黑龙镇', 4, 4304), +(34418, '九丝城镇', 4, 4305), +(34419, '五星乡', 4, 4305), +(34420, '仙峰苗族乡', 4, 4305), +(34421, '僰王山镇', 4, 4305), +(34422, '共乐镇', 4, 4305), +(34423, '古宋镇', 4, 4305), +(34424, '周家镇', 4, 4305), +(34425, '大坝苗族乡', 4, 4305), +(34426, '大河苗族乡', 4, 4305), +(34427, '太平镇', 4, 4305), +(34428, '玉屏乡', 4, 4305), +(34429, '玉秀苗族乡', 4, 4305), +(34430, '石海镇', 4, 4305), +(34431, '莲花镇', 4, 4305), +(34432, '麒麟苗族乡', 4, 4305), +(34433, '仙临镇', 4, 4306), +(34434, '刘家镇', 4, 4306), +(34435, '南溪镇', 4, 4306), +(34436, '大坪乡', 4, 4306), +(34437, '大观镇', 4, 4306), +(34438, '林丰乡', 4, 4306), +(34439, '江南镇', 4, 4306); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34440, '汪家镇', 4, 4306), +(34441, '留宾乡', 4, 4306), +(34442, '石鼓乡', 4, 4306), +(34443, '罗龙镇', 4, 4306), +(34444, '裴石乡', 4, 4306), +(34445, '长兴镇', 4, 4306), +(34446, '马家乡', 4, 4306), +(34447, '黄沙镇', 4, 4306), +(34448, '凤仪乡', 4, 4307), +(34449, '双谊乡', 4, 4307), +(34450, '双龙镇', 4, 4307), +(34451, '古柏乡', 4, 4307), +(34452, '古罗镇', 4, 4307), +(34453, '合什镇', 4, 4307), +(34454, '商州镇', 4, 4307), +(34455, '喜捷镇', 4, 4307), +(34456, '复龙镇', 4, 4307), +(34457, '孔滩镇', 4, 4307), +(34458, '安边镇', 4, 4307), +(34459, '普安乡', 4, 4307), +(34460, '李场镇', 4, 4307), +(34461, '柏溪镇', 4, 4307), +(34462, '柳嘉镇', 4, 4307), +(34463, '横江镇', 4, 4307), +(34464, '永兴镇', 4, 4307), +(34465, '泥南乡', 4, 4307), +(34466, '泥溪镇', 4, 4307), +(34467, '王场乡', 4, 4307), +(34468, '白花镇', 4, 4307), +(34469, '蕨溪镇', 4, 4307), +(34470, '观音镇', 4, 4307), +(34471, '隆兴乡', 4, 4307), +(34472, '高场镇', 4, 4307), +(34473, '龙池乡', 4, 4307), +(34474, '中都镇', 4, 4308), +(34475, '夏溪乡', 4, 4308), +(34476, '大乘镇', 4, 4308), +(34477, '太平乡', 4, 4308), +(34478, '富荣镇', 4, 4308), +(34479, '屏边彝族乡', 4, 4308), +(34480, '新发乡', 4, 4308), +(34481, '新安镇', 4, 4308), +(34482, '新市镇', 4, 4308), +(34483, '楼东乡', 4, 4308), +(34484, '清平彝族乡', 4, 4308), +(34485, '福延镇', 4, 4308), +(34486, '锦屏镇', 4, 4308), +(34487, '鸭池乡', 4, 4308), +(34488, '龙华镇', 4, 4308), +(34489, '龙溪乡', 4, 4308), +(34490, '五矿镇', 4, 4309), +(34491, '井口镇', 4, 4309), +(34492, '仁和乡', 4, 4309), +(34493, '四面山镇', 4, 4309), +(34494, '夕佳山镇', 4, 4309), +(34495, '大井镇', 4, 4309), +(34496, '大妙乡', 4, 4309), +(34497, '底蓬镇', 4, 4309), +(34498, '怡乐镇', 4, 4309), +(34499, '桐梓镇', 4, 4309), +(34500, '水清镇', 4, 4309), +(34501, '江安镇', 4, 4309), +(34502, '滥坝乡', 4, 4309), +(34503, '留耕镇', 4, 4309), +(34504, '红桥镇', 4, 4309); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34505, '蟠龙乡', 4, 4309), +(34506, '迎安镇', 4, 4309), +(34507, '铁清镇', 4, 4309), +(34508, '上罗镇', 4, 4310), +(34509, '下罗乡', 4, 4310), +(34510, '仁义乡', 4, 4310), +(34511, '孝儿镇', 4, 4310), +(34512, '巡场镇', 4, 4310), +(34513, '底洞镇', 4, 4310), +(34514, '恒丰乡', 4, 4310), +(34515, '曹营乡', 4, 4310), +(34516, '沐滩乡', 4, 4310), +(34517, '洛亥镇', 4, 4310), +(34518, '洛表镇', 4, 4310), +(34519, '玉和苗族乡', 4, 4310), +(34520, '王家镇', 4, 4310), +(34521, '珙泉镇', 4, 4310), +(34522, '石碑乡', 4, 4310), +(34523, '罗渡苗族乡', 4, 4310), +(34524, '观斗苗族乡', 4, 4310), +(34525, '乐义乡', 4, 4311), +(34526, '双腾镇', 4, 4311), +(34527, '团林苗族乡', 4, 4311), +(34528, '塘坝乡', 4, 4311), +(34529, '大雪山镇', 4, 4311), +(34530, '孔雀乡', 4, 4311), +(34531, '巡司镇', 4, 4311), +(34532, '武德乡', 4, 4311), +(34533, '沐爱镇', 4, 4311), +(34534, '筠连镇', 4, 4311), +(34535, '维新镇', 4, 4311), +(34536, '联合苗族乡', 4, 4311), +(34537, '腾达镇', 4, 4311), +(34538, '蒿坝镇', 4, 4311), +(34539, '镇舟镇', 4, 4311), +(34540, '高坎乡', 4, 4311), +(34541, '高坪苗族乡', 4, 4311), +(34542, '龙镇乡', 4, 4311), +(34543, '东城街道', 4, 4312), +(34544, '凉姜乡', 4, 4312), +(34545, '北城街道', 4, 4312), +(34546, '南城街道', 4, 4312), +(34547, '南岸街道', 4, 4312), +(34548, '南广镇', 4, 4312), +(34549, '安阜街道', 4, 4312), +(34550, '宋家乡', 4, 4312), +(34551, '宗场乡', 4, 4312), +(34552, '思坡乡', 4, 4312), +(34553, '明威乡', 4, 4312), +(34554, '李庄镇', 4, 4312), +(34555, '李端镇', 4, 4312), +(34556, '沙坪镇', 4, 4312), +(34557, '牟坪镇', 4, 4312), +(34558, '白沙湾街道', 4, 4312), +(34559, '菜坝镇', 4, 4312), +(34560, '西城街道', 4, 4312), +(34561, '西郊街道', 4, 4312), +(34562, '象鼻街道', 4, 4312), +(34563, '赵场街道', 4, 4312), +(34564, '邱场乡', 4, 4312), +(34565, '金坪镇', 4, 4312), +(34566, '高店镇', 4, 4312), +(34567, '三元乡', 4, 4313); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34568, '下场镇', 4, 4313), +(34569, '井江乡', 4, 4313), +(34570, '双河镇', 4, 4313), +(34571, '古河镇', 4, 4313), +(34572, '富兴乡', 4, 4313), +(34573, '开佛乡', 4, 4313), +(34574, '桃坪乡', 4, 4313), +(34575, '梅白乡', 4, 4313), +(34576, '梅硐镇', 4, 4313), +(34577, '硐底镇', 4, 4313), +(34578, '竹海镇', 4, 4313), +(34579, '老翁镇', 4, 4313), +(34580, '花滩镇', 4, 4313), +(34581, '铜锣乡', 4, 4313), +(34582, '铜鼓乡', 4, 4313), +(34583, '长宁镇', 4, 4313), +(34584, '龙头镇', 4, 4313), +(34585, '双河乡', 4, 4314), +(34586, '可久镇', 4, 4314), +(34587, '嘉乐镇', 4, 4314), +(34588, '四烈乡', 4, 4314), +(34589, '复兴镇', 4, 4314), +(34590, '大窝镇', 4, 4314), +(34591, '庆岭乡', 4, 4314), +(34592, '庆符镇', 4, 4314), +(34593, '文江镇', 4, 4314), +(34594, '月江镇', 4, 4314), +(34595, '来复镇', 4, 4314), +(34596, '沙河镇', 4, 4314), +(34597, '潆溪乡', 4, 4314), +(34598, '罗场镇', 4, 4314), +(34599, '羊田乡', 4, 4314), +(34600, '胜天镇', 4, 4314), +(34601, '落润乡', 4, 4314), +(34602, '蕉村镇', 4, 4314), +(34603, '趱滩乡', 4, 4314), +(34604, '华龙街道', 4, 4315), +(34605, '双河街道', 4, 4315), +(34606, '古桥街道', 4, 4315), +(34607, '天池镇', 4, 4315), +(34608, '庆华镇', 4, 4315), +(34609, '明月镇', 4, 4315), +(34610, '永兴镇', 4, 4315), +(34611, '溪口镇', 4, 4315), +(34612, '禄市镇', 4, 4315), +(34613, '红岩乡', 4, 4315), +(34614, '观音溪镇', 4, 4315), +(34615, '阳和镇', 4, 4315), +(34616, '高兴镇', 4, 4315), +(34617, '东板乡', 4, 4316), +(34618, '中和镇', 4, 4316), +(34619, '临溪镇', 4, 4316), +(34620, '乔家镇', 4, 4316), +(34621, '九龙镇', 4, 4316), +(34622, '伏龙乡', 4, 4316), +(34623, '兴隆镇', 4, 4316), +(34624, '北城乡', 4, 4316), +(34625, '双鄢乡', 4, 4316), +(34626, '同兴镇', 4, 4316), +(34627, '嘉陵乡', 4, 4316), +(34628, '团结乡', 4, 4316), +(34629, '坪滩镇', 4, 4316), +(34630, '大佛乡', 4, 4316), +(34631, '大石乡', 4, 4316), +(34632, '天平镇', 4, 4316), +(34633, '平安乡', 4, 4316); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34634, '恐龙乡', 4, 4316), +(34635, '排楼乡', 4, 4316), +(34636, '新场镇', 4, 4316), +(34637, '普安镇', 4, 4316), +(34638, '朝阳乡', 4, 4316), +(34639, '白庙镇', 4, 4316), +(34640, '石垭镇', 4, 4316), +(34641, '石鼓乡', 4, 4316), +(34642, '秦溪镇', 4, 4316), +(34643, '粽粑乡', 4, 4316), +(34644, '罗渡镇', 4, 4316), +(34645, '花园镇', 4, 4316), +(34646, '花板乡', 4, 4316), +(34647, '苟角镇', 4, 4316), +(34648, '裕民镇', 4, 4316), +(34649, '西板乡', 4, 4316), +(34650, '赛龙镇', 4, 4316), +(34651, '酉溪镇', 4, 4316), +(34652, '镇裕镇', 4, 4316), +(34653, '镇龙乡', 4, 4316), +(34654, '长田乡', 4, 4316), +(34655, '顾县镇', 4, 4316), +(34656, '鱼峰乡', 4, 4316), +(34657, '黄龙乡', 4, 4316), +(34658, '齐福乡', 4, 4316), +(34659, '龙孔镇', 4, 4316), +(34660, '万盛街道', 4, 4317), +(34661, '东岳乡', 4, 4317), +(34662, '中桥街道', 4, 4317), +(34663, '井河镇', 4, 4317), +(34664, '代市镇', 4, 4317), +(34665, '光辉乡', 4, 4317), +(34666, '兴平镇', 4, 4317), +(34667, '前锋镇', 4, 4317), +(34668, '化龙乡', 4, 4317), +(34669, '北辰街道', 4, 4317), +(34670, '协兴镇', 4, 4317), +(34671, '大安镇', 4, 4317), +(34672, '大有乡', 4, 4317), +(34673, '大龙乡', 4, 4317), +(34674, '奎阁街道', 4, 4317), +(34675, '官盛镇', 4, 4317), +(34676, '小井乡', 4, 4317), +(34677, '崇望乡', 4, 4317), +(34678, '广兴镇', 4, 4317), +(34679, '广福街道', 4, 4317), +(34680, '广罗乡', 4, 4317), +(34681, '广门乡', 4, 4317), +(34682, '彭家乡', 4, 4317), +(34683, '恒升镇', 4, 4317), +(34684, '悦来镇', 4, 4317), +(34685, '护安镇', 4, 4317), +(34686, '新桥乡', 4, 4317), +(34687, '方坪乡', 4, 4317), +(34688, '杨坪乡', 4, 4317), +(34689, '枣山镇', 4, 4317), +(34690, '桂兴镇', 4, 4317), +(34691, '浓洄街道', 4, 4317), +(34692, '浓溪镇', 4, 4317), +(34693, '消河乡', 4, 4317), +(34694, '白市镇', 4, 4317), +(34695, '白马乡', 4, 4317), +(34696, '石笋镇', 4, 4317), +(34697, '穿石乡', 4, 4317), +(34698, '肖溪镇', 4, 4317); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34699, '花桥镇', 4, 4317), +(34700, '苏溪乡', 4, 4317), +(34701, '蒲莲乡', 4, 4317), +(34702, '虎城乡', 4, 4317), +(34703, '观塘镇', 4, 4317), +(34704, '观阁镇', 4, 4317), +(34705, '郑山乡', 4, 4317), +(34706, '龙台镇', 4, 4317), +(34707, '龙安乡', 4, 4317), +(34708, '龙滩乡', 4, 4317), +(34709, '万善镇', 4, 4318), +(34710, '万隆镇', 4, 4318), +(34711, '三溪镇', 4, 4318), +(34712, '中心镇', 4, 4318), +(34713, '乐善镇', 4, 4318), +(34714, '八一乡', 4, 4318), +(34715, '华封镇', 4, 4318), +(34716, '双星乡', 4, 4318), +(34717, '宝箴塞乡', 4, 4318), +(34718, '新学乡', 4, 4318), +(34719, '旧县乡', 4, 4318), +(34720, '永胜乡', 4, 4318), +(34721, '沿口镇', 4, 4318), +(34722, '清平镇', 4, 4318), +(34723, '烈面镇', 4, 4318), +(34724, '猛山乡', 4, 4318), +(34725, '白坪乡', 4, 4318), +(34726, '真静乡', 4, 4318), +(34727, '石盘乡', 4, 4318), +(34728, '礼安镇', 4, 4318), +(34729, '胜利镇', 4, 4318), +(34730, '街子镇', 4, 4318), +(34731, '赛马镇', 4, 4318), +(34732, '金光乡', 4, 4318), +(34733, '金牛镇', 4, 4318), +(34734, '飞龙镇', 4, 4318), +(34735, '高石乡', 4, 4318), +(34736, '鸣钟乡', 4, 4318), +(34737, '鼓匠乡', 4, 4318), +(34738, '龙女镇', 4, 4318), +(34739, '龙庭乡', 4, 4318), +(34740, '三古乡', 4, 4319), +(34741, '两河乡', 4, 4319), +(34742, '丰和镇', 4, 4319), +(34743, '九峰乡', 4, 4319), +(34744, '九龙镇', 4, 4319), +(34745, '八耳镇', 4, 4319), +(34746, '关河乡', 4, 4319), +(34747, '兴仁镇', 4, 4319), +(34748, '冷家乡', 4, 4319), +(34749, '凉山乡', 4, 4319), +(34750, '华蓥乡', 4, 4319), +(34751, '古路乡', 4, 4319), +(34752, '合流镇', 4, 4319), +(34753, '同石乡', 4, 4319), +(34754, '四海乡', 4, 4319), +(34755, '坛同镇', 4, 4319), +(34756, '城北镇', 4, 4319), +(34757, '城南镇', 4, 4319), +(34758, '复盛乡', 4, 4319), +(34759, '太和乡', 4, 4319), +(34760, '子中乡', 4, 4319), +(34761, '幺滩镇', 4, 4319), +(34762, '护邻乡', 4, 4319), +(34763, '新镇乡', 4, 4319), +(34764, '柑子镇', 4, 4319); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34765, '柳塘乡', 4, 4319), +(34766, '梁板乡', 4, 4319), +(34767, '椿木乡', 4, 4319), +(34768, '牟家镇', 4, 4319), +(34769, '王家镇', 4, 4319), +(34770, '甘坝乡', 4, 4319), +(34771, '石永镇', 4, 4319), +(34772, '石滓乡', 4, 4319), +(34773, '荆坪乡', 4, 4319), +(34774, '袁市镇', 4, 4319), +(34775, '西天乡', 4, 4319), +(34776, '观音桥镇', 4, 4319), +(34777, '长安乡', 4, 4319), +(34778, '长滩乡', 4, 4319), +(34779, '风垭乡', 4, 4319), +(34780, '高滩镇', 4, 4319), +(34781, '黎家乡', 4, 4319), +(34782, '鼎屏镇', 4, 4319), +(34783, '龙安镇', 4, 4319), +(34784, '龙桥乡', 4, 4319), +(34785, '丝罗乡', 4, 4320), +(34786, '中坪乡', 4, 4320), +(34787, '井溪乡', 4, 4320), +(34788, '八台乡', 4, 4320), +(34789, '固军乡', 4, 4320), +(34790, '堰塘乡', 4, 4320), +(34791, '大沙乡', 4, 4320), +(34792, '大竹镇', 4, 4320), +(34793, '太平镇', 4, 4320), +(34794, '官渡镇', 4, 4320), +(34795, '庙坡乡', 4, 4320), +(34796, '庙垭乡', 4, 4320), +(34797, '庙子乡', 4, 4320), +(34798, '康乐乡', 4, 4320), +(34799, '新店乡', 4, 4320), +(34800, '旧院镇', 4, 4320), +(34801, '曹家乡', 4, 4320), +(34802, '曾家乡', 4, 4320), +(34803, '柳黄乡', 4, 4320), +(34804, '梨树乡', 4, 4320), +(34805, '永宁乡', 4, 4320), +(34806, '沙滩镇', 4, 4320), +(34807, '河口镇', 4, 4320), +(34808, '溪口乡', 4, 4320), +(34809, '玉带乡', 4, 4320), +(34810, '白果乡', 4, 4320), +(34811, '白沙镇', 4, 4320), +(34812, '白羊乡', 4, 4320), +(34813, '皮窝乡', 4, 4320), +(34814, '石人乡', 4, 4320), +(34815, '石塘乡', 4, 4320), +(34816, '石窝乡', 4, 4320), +(34817, '秦河乡', 4, 4320), +(34818, '竹峪镇', 4, 4320), +(34819, '紫溪乡', 4, 4320), +(34820, '罐坝乡', 4, 4320), +(34821, '罗文镇', 4, 4320), +(34822, '花楼乡', 4, 4320), +(34823, '花萼乡', 4, 4320), +(34824, '茶垭乡', 4, 4320), +(34825, '草坝镇', 4, 4320), +(34826, '虹桥乡', 4, 4320), +(34827, '蜂桶乡', 4, 4320), +(34828, '赵塘乡', 4, 4320), +(34829, '钟停乡', 4, 4320), +(34830, '铁矿乡', 4, 4320); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34831, '长坝乡', 4, 4320), +(34832, '长石乡', 4, 4320), +(34833, '青花镇', 4, 4320), +(34834, '魏家乡', 4, 4320), +(34835, '鹰背乡', 4, 4320), +(34836, '黄钟镇', 4, 4320), +(34837, '东柳乡', 4, 4321), +(34838, '中华乡', 4, 4321), +(34839, '中和乡', 4, 4321), +(34840, '乌木镇', 4, 4321), +(34841, '二郎乡', 4, 4321), +(34842, '人和乡', 4, 4321), +(34843, '余华乡', 4, 4321), +(34844, '八渡乡', 4, 4321), +(34845, '双拱镇', 4, 4321), +(34846, '双溪乡', 4, 4321), +(34847, '周家镇', 4, 4321), +(34848, '四合乡', 4, 4321), +(34849, '团坝镇', 4, 4321), +(34850, '城西乡', 4, 4321), +(34851, '天城乡', 4, 4321), +(34852, '妈妈镇', 4, 4321), +(34853, '姚市乡', 4, 4321), +(34854, '安吉乡', 4, 4321), +(34855, '川主乡', 4, 4321), +(34856, '庙坝镇', 4, 4321), +(34857, '张家乡', 4, 4321), +(34858, '文星镇', 4, 4321), +(34859, '新生乡', 4, 4321), +(34860, '朝阳乡', 4, 4321), +(34861, '李家乡', 4, 4321), +(34862, '杨家镇', 4, 4321), +(34863, '杨通乡', 4, 4321), +(34864, '柏家乡', 4, 4321), +(34865, '柏林镇', 4, 4321), +(34866, '欧家镇', 4, 4321), +(34867, '永胜乡', 4, 4321), +(34868, '清水镇', 4, 4321), +(34869, '清河镇', 4, 4321), +(34870, '牌坊乡', 4, 4321), +(34871, '白坝乡', 4, 4321), +(34872, '石子镇', 4, 4321), +(34873, '石桥铺镇', 4, 4321), +(34874, '石河镇', 4, 4321), +(34875, '神合乡', 4, 4321), +(34876, '童家乡', 4, 4321), +(34877, '竹北乡', 4, 4321), +(34878, '竹阳镇', 4, 4321), +(34879, '莲印乡', 4, 4321), +(34880, '蒲包乡', 4, 4321), +(34881, '观音镇', 4, 4321), +(34882, '金鸡乡', 4, 4321), +(34883, '高明乡', 4, 4321), +(34884, '高穴镇', 4, 4321), +(34885, '黄家乡', 4, 4321), +(34886, '黄滩乡', 4, 4321), +(34887, '七里乡', 4, 4322), +(34888, '三墩土家族乡', 4, 4322), +(34889, '三河乡', 4, 4322), +(34890, '上峡乡', 4, 4322), +(34891, '下八乡', 4, 4322), +(34892, '东乡镇', 4, 4322), +(34893, '东林乡', 4, 4322), +(34894, '五宝镇', 4, 4322), +(34895, '凉风乡', 4, 4322), +(34896, '凤林乡', 4, 4322); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34897, '凤鸣乡', 4, 4322), +(34898, '华景镇', 4, 4322), +(34899, '南坝镇', 4, 4322), +(34900, '南坪乡', 4, 4322), +(34901, '厂溪乡', 4, 4322), +(34902, '双河镇', 4, 4322), +(34903, '君塘镇', 4, 4322), +(34904, '土主乡', 4, 4322), +(34905, '土黄镇', 4, 4322), +(34906, '塔河乡', 4, 4322), +(34907, '大成镇', 4, 4322), +(34908, '天台乡', 4, 4322), +(34909, '天宝乡', 4, 4322), +(34910, '天生镇', 4, 4322), +(34911, '峰城镇', 4, 4322), +(34912, '庆云乡', 4, 4322), +(34913, '庙安乡', 4, 4322), +(34914, '新华镇', 4, 4322), +(34915, '明月乡', 4, 4322), +(34916, '普光镇', 4, 4322), +(34917, '柏树镇', 4, 4322), +(34918, '柳池乡', 4, 4322), +(34919, '桃花乡', 4, 4322), +(34920, '樊哙镇', 4, 4322), +(34921, '毛坝镇', 4, 4322), +(34922, '清溪镇', 4, 4322), +(34923, '渡口土家族乡', 4, 4322), +(34924, '漆树土家族乡', 4, 4322), +(34925, '漆碑乡', 4, 4322), +(34926, '白马乡', 4, 4322), +(34927, '石铁乡', 4, 4322), +(34928, '红岭乡', 4, 4322), +(34929, '红峰乡', 4, 4322), +(34930, '老君乡', 4, 4322), +(34931, '胡家镇', 4, 4322), +(34932, '芭蕉镇', 4, 4322), +(34933, '花池乡', 4, 4322), +(34934, '茶河乡', 4, 4322), +(34935, '观山乡', 4, 4322), +(34936, '隘口乡', 4, 4322), +(34937, '马渡乡', 4, 4322), +(34938, '黄石乡', 4, 4322), +(34939, '黄金镇', 4, 4322), +(34940, '龙泉土家族乡', 4, 4322), +(34941, '任市镇', 4, 4323), +(34942, '回龙镇', 4, 4323), +(34943, '天师镇', 4, 4323), +(34944, '宝石乡', 4, 4323), +(34945, '广福镇', 4, 4323), +(34946, '拔妙乡', 4, 4323), +(34947, '新太乡', 4, 4323), +(34948, '新宁镇', 4, 4323), +(34949, '新街乡', 4, 4323), +(34950, '普安镇', 4, 4323), +(34951, '梅家乡', 4, 4323), +(34952, '永兴镇', 4, 4323), +(34953, '沙坝场镇', 4, 4323), +(34954, '灵岩乡', 4, 4323), +(34955, '甘棠镇', 4, 4323), +(34956, '讲治镇', 4, 4323), +(34957, '长岭乡', 4, 4323), +(34958, '长田乡', 4, 4323), +(34959, '靖安乡', 4, 4323), +(34960, '骑龙乡', 4, 4323), +(34961, '万寿乡', 4, 4324); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(34962, '三板乡', 4, 4324), +(34963, '三汇镇', 4, 4324), +(34964, '东安乡', 4, 4324), +(34965, '中滩乡', 4, 4324), +(34966, '丰乐乡', 4, 4324), +(34967, '临巴镇', 4, 4324), +(34968, '义和乡', 4, 4324), +(34969, '千佛乡', 4, 4324), +(34970, '卷硐乡', 4, 4324), +(34971, '双土乡', 4, 4324), +(34972, '和乐乡', 4, 4324), +(34973, '嘉禾乡', 4, 4324), +(34974, '土溪镇', 4, 4324), +(34975, '大义乡', 4, 4324), +(34976, '天星镇', 4, 4324), +(34977, '安北乡', 4, 4324), +(34978, '宋家乡', 4, 4324), +(34979, '定远乡', 4, 4324), +(34980, '宝城镇', 4, 4324), +(34981, '射洪乡', 4, 4324), +(34982, '屏西乡', 4, 4324), +(34983, '岩峰镇', 4, 4324), +(34984, '巨光乡', 4, 4324), +(34985, '平安乡', 4, 4324), +(34986, '报恩乡', 4, 4324), +(34987, '拱市乡', 4, 4324), +(34988, '文崇镇', 4, 4324), +(34989, '新市乡', 4, 4324), +(34990, '有庆镇', 4, 4324), +(34991, '望江乡', 4, 4324), +(34992, '望溪乡', 4, 4324), +(34993, '李渡乡', 4, 4324), +(34994, '李馥乡', 4, 4324), +(34995, '板桥乡', 4, 4324), +(34996, '柏水乡', 4, 4324), +(34997, '水口乡', 4, 4324), +(34998, '氵鲜渡镇', 4, 4324), +(34999, '汇东乡', 4, 4324), +(35000, '汇北乡', 4, 4324), +(35001, '汇南乡', 4, 4324), +(35002, '河东乡', 4, 4324), +(35003, '流溪乡', 4, 4324), +(35004, '涌兴镇', 4, 4324), +(35005, '清溪场镇', 4, 4324), +(35006, '渠北乡', 4, 4324), +(35007, '渠南乡', 4, 4324), +(35008, '渠江镇', 4, 4324), +(35009, '琅玡镇', 4, 4324), +(35010, '白兔乡', 4, 4324), +(35011, '蔡和乡', 4, 4324), +(35012, '贵福镇', 4, 4324), +(35013, '锡溪乡', 4, 4324), +(35014, '青丝乡', 4, 4324), +(35015, '青神乡', 4, 4324), +(35016, '青龙乡', 4, 4324), +(35017, '静边镇', 4, 4324), +(35018, '鹤林乡', 4, 4324), +(35019, '龙凤乡', 4, 4324), +(35020, '龙潭乡', 4, 4324), +(35021, '万家镇', 4, 4325), +(35022, '东兴乡', 4, 4325), +(35023, '九岭乡', 4, 4325), +(35024, '五四乡', 4, 4325), +(35025, '亭子镇', 4, 4325), +(35026, '北山乡', 4, 4325), +(35027, '南外镇', 4, 4325); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35028, '南岳镇', 4, 4325), +(35029, '双庙乡', 4, 4325), +(35030, '堡子镇', 4, 4325), +(35031, '大堰乡', 4, 4325), +(35032, '大树镇', 4, 4325), +(35033, '大滩乡', 4, 4325), +(35034, '大风乡', 4, 4325), +(35035, '安云乡', 4, 4325), +(35036, '安仁乡', 4, 4325), +(35037, '平滩乡', 4, 4325), +(35038, '幺塘乡', 4, 4325), +(35039, '斌郎乡', 4, 4325), +(35040, '景市镇', 4, 4325), +(35041, '木头乡', 4, 4325), +(35042, '木子乡', 4, 4325), +(35043, '桥湾乡', 4, 4325), +(35044, '梓桐乡', 4, 4325), +(35045, '檀木镇', 4, 4325), +(35046, '檬双乡', 4, 4325), +(35047, '永进乡', 4, 4325), +(35048, '江阳乡', 4, 4325), +(35049, '江陵镇', 4, 4325), +(35050, '河市镇', 4, 4325), +(35051, '沿河乡', 4, 4325), +(35052, '洛车乡', 4, 4325), +(35053, '渡市镇', 4, 4325), +(35054, '申家乡', 4, 4325), +(35055, '百节镇', 4, 4325), +(35056, '石板镇', 4, 4325), +(35057, '石桥镇', 4, 4325), +(35058, '石梯镇', 4, 4325), +(35059, '碑庙镇', 4, 4325), +(35060, '碑高乡', 4, 4325), +(35061, '福善镇', 4, 4325), +(35062, '管村镇', 4, 4325), +(35063, '米城乡', 4, 4325), +(35064, '罐子乡', 4, 4325), +(35065, '花红乡', 4, 4325), +(35066, '草兴乡', 4, 4325), +(35067, '葫芦乡', 4, 4325), +(35068, '虎让乡', 4, 4325), +(35069, '赵固乡', 4, 4325), +(35070, '赵家镇', 4, 4325), +(35071, '道让乡', 4, 4325), +(35072, '金垭镇', 4, 4325), +(35073, '金檀乡', 4, 4325), +(35074, '金石乡', 4, 4325), +(35075, '银铁乡', 4, 4325), +(35076, '陈家乡', 4, 4325), +(35077, '青宁乡', 4, 4325), +(35078, '香隆乡', 4, 4325), +(35079, '马家乡', 4, 4325), +(35080, '麻柳镇', 4, 4325), +(35081, '黄庭乡', 4, 4325), +(35082, '黄都乡', 4, 4325), +(35083, '龙会乡', 4, 4325), +(35084, '龙滩乡', 4, 4325), +(35085, '东城街道', 4, 4326), +(35086, '东岳乡', 4, 4326), +(35087, '北外镇', 4, 4326), +(35088, '双龙镇', 4, 4326), +(35089, '复兴镇', 4, 4326), +(35090, '新村乡', 4, 4326), +(35091, '朝阳街道', 4, 4326), +(35092, '盘石乡', 4, 4326), +(35093, '罗江镇', 4, 4326); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35094, '蒲家镇', 4, 4326), +(35095, '西城街道', 4, 4326), +(35096, '西外镇', 4, 4326), +(35097, '魏兴镇', 4, 4326), +(35098, '万古乡', 4, 4327), +(35099, '中峰乡', 4, 4327), +(35100, '前进乡', 4, 4327), +(35101, '双河乡', 4, 4327), +(35102, '城东乡', 4, 4327), +(35103, '廖场乡', 4, 4327), +(35104, '建山乡', 4, 4327), +(35105, '新店镇', 4, 4327), +(35106, '永兴镇', 4, 4327), +(35107, '百丈镇', 4, 4327), +(35108, '红岩乡', 4, 4327), +(35109, '红星镇', 4, 4327), +(35110, '联江乡', 4, 4327), +(35111, '茅河乡', 4, 4327), +(35112, '蒙阳镇', 4, 4327), +(35113, '蒙顶山镇', 4, 4327), +(35114, '解放乡', 4, 4327), +(35115, '车岭镇', 4, 4327), +(35116, '马岭镇', 4, 4327), +(35117, '黑竹镇', 4, 4327), +(35118, '两路乡', 4, 4328), +(35119, '乐英乡', 4, 4328), +(35120, '仁义乡', 4, 4328), +(35121, '兴业乡', 4, 4328), +(35122, '城厢镇', 4, 4328), +(35123, '多功乡', 4, 4328), +(35124, '大坪乡', 4, 4328), +(35125, '始阳镇', 4, 4328), +(35126, '小河乡', 4, 4328), +(35127, '思经乡', 4, 4328), +(35128, '新华乡', 4, 4328), +(35129, '新场乡', 4, 4328), +(35130, '紫石乡', 4, 4328), +(35131, '老场乡', 4, 4328), +(35132, '鱼泉乡', 4, 4328), +(35133, '五龙乡', 4, 4329), +(35134, '大溪乡', 4, 4329), +(35135, '明礼乡', 4, 4329), +(35136, '永富乡', 4, 4329), +(35137, '灵关镇', 4, 4329), +(35138, '硗碛藏族乡', 4, 4329), +(35139, '穆坪镇', 4, 4329), +(35140, '蜂桶寨乡', 4, 4329), +(35141, '陇东镇', 4, 4329), +(35142, '万工乡', 4, 4330), +(35143, '万里乡', 4, 4330), +(35144, '三交乡', 4, 4330), +(35145, '两河乡', 4, 4330), +(35146, '乌斯河镇', 4, 4330), +(35147, '九襄镇', 4, 4330), +(35148, '前域乡', 4, 4330), +(35149, '双溪乡', 4, 4330), +(35150, '后域乡', 4, 4330), +(35151, '唐家乡', 4, 4330), +(35152, '坭美彝族乡', 4, 4330), +(35153, '大堰乡', 4, 4330), +(35154, '大岭乡', 4, 4330), +(35155, '大树镇', 4, 4330), +(35156, '大田乡', 4, 4330), +(35157, '安乐乡', 4, 4330), +(35158, '宜东镇', 4, 4330); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35159, '富乡乡', 4, 4330), +(35160, '富庄镇', 4, 4330), +(35161, '富春乡', 4, 4330), +(35162, '富林镇', 4, 4330), +(35163, '富泉乡', 4, 4330), +(35164, '小堡藏族彝族乡', 4, 4330), +(35165, '市荣乡', 4, 4330), +(35166, '建黎乡', 4, 4330), +(35167, '料林乡', 4, 4330), +(35168, '晒经乡', 4, 4330), +(35169, '桂贤乡', 4, 4330), +(35170, '梨园乡', 4, 4330), +(35171, '永利彝族乡', 4, 4330), +(35172, '河南乡', 4, 4330), +(35173, '河西乡', 4, 4330), +(35174, '清溪镇', 4, 4330), +(35175, '片马彝族乡', 4, 4330), +(35176, '白岩乡', 4, 4330), +(35177, '皇木镇', 4, 4330), +(35178, '西溪乡', 4, 4330), +(35179, '青富乡', 4, 4330), +(35180, '顺河彝族乡', 4, 4330), +(35181, '马烈乡', 4, 4330), +(35182, '丰乐乡', 4, 4331), +(35183, '先锋藏族乡', 4, 4331), +(35184, '回隆彝族乡', 4, 4331), +(35185, '安顺彝族乡', 4, 4331), +(35186, '宰羊乡', 4, 4331), +(35187, '挖角彝族藏族乡', 4, 4331), +(35188, '擦罗彝族乡', 4, 4331), +(35189, '新棉镇', 4, 4331), +(35190, '新民藏族彝族乡', 4, 4331), +(35191, '栗子坪彝族乡', 4, 4331), +(35192, '棉城街道', 4, 4331), +(35193, '永和乡', 4, 4331), +(35194, '田湾彝族乡', 4, 4331), +(35195, '美罗乡', 4, 4331), +(35196, '草科藏族乡', 4, 4331), +(35197, '蟹螺藏族乡', 4, 4331), +(35198, '迎政乡', 4, 4331), +(35199, '双石镇', 4, 4332), +(35200, '大川镇', 4, 4332), +(35201, '太平镇', 4, 4332), +(35202, '宝盛乡', 4, 4332), +(35203, '思延乡', 4, 4332), +(35204, '清仁乡', 4, 4332), +(35205, '芦阳镇', 4, 4332), +(35206, '飞仙关镇', 4, 4332), +(35207, '龙门乡', 4, 4332), +(35208, '三合乡', 4, 4333), +(35209, '严道镇', 4, 4333), +(35210, '五宪乡', 4, 4333), +(35211, '六合乡', 4, 4333), +(35212, '大田坝乡', 4, 4333), +(35213, '天凤乡', 4, 4333), +(35214, '安靖乡', 4, 4333), +(35215, '宝峰彝族乡', 4, 4333), +(35216, '新庙乡', 4, 4333), +(35217, '新建乡', 4, 4333), +(35218, '新添乡', 4, 4333), +(35219, '民建彝族乡', 4, 4333), +(35220, '泗坪乡', 4, 4333); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35221, '烈士乡', 4, 4333), +(35222, '烈太乡', 4, 4333), +(35223, '烟竹乡', 4, 4333), +(35224, '花滩镇', 4, 4333), +(35225, '荥河乡', 4, 4333), +(35226, '附城乡', 4, 4333), +(35227, '青龙乡', 4, 4333), +(35228, '龙苍沟乡', 4, 4333), +(35229, '上里镇', 4, 4334), +(35230, '东城街道', 4, 4334), +(35231, '严桥镇', 4, 4334), +(35232, '中里镇', 4, 4334), +(35233, '八步乡', 4, 4334), +(35234, '凤鸣乡', 4, 4334), +(35235, '北郊镇', 4, 4334), +(35236, '南郊乡', 4, 4334), +(35237, '合江镇', 4, 4334), +(35238, '多营镇', 4, 4334), +(35239, '大兴镇', 4, 4334), +(35240, '孔坪乡', 4, 4334), +(35241, '对岩镇', 4, 4334), +(35242, '晏场镇', 4, 4334), +(35243, '望鱼乡', 4, 4334), +(35244, '沙坪镇', 4, 4334), +(35245, '河北街道', 4, 4334), +(35246, '碧峰峡镇', 4, 4334), +(35247, '草坝镇', 4, 4334), +(35248, '西城街道', 4, 4334), +(35249, '观化乡', 4, 4334), +(35250, '青江街道', 4, 4334), +(35251, '上两乡', 4, 4335), +(35252, '下两镇', 4, 4335), +(35253, '东榆镇', 4, 4335), +(35254, '乐坝镇', 4, 4335), +(35255, '仁和乡', 4, 4335), +(35256, '侯家乡', 4, 4335), +(35257, '傅家乡', 4, 4335), +(35258, '元潭乡', 4, 4335), +(35259, '八庙乡', 4, 4335), +(35260, '关坝乡', 4, 4335), +(35261, '关由乡', 4, 4335), +(35262, '关路乡', 4, 4335), +(35263, '关门乡', 4, 4335), +(35264, '兴马乡', 4, 4335), +(35265, '凤仪乡', 4, 4335), +(35266, '北极乡', 4, 4335), +(35267, '南江镇', 4, 4335), +(35268, '双桂乡', 4, 4335), +(35269, '双流乡', 4, 4335), +(35270, '和平乡', 4, 4335), +(35271, '团结乡', 4, 4335), +(35272, '坪河乡', 4, 4335), +(35273, '大河镇', 4, 4335), +(35274, '天池乡', 4, 4335), +(35275, '寨坡乡', 4, 4335), +(35276, '平岗乡', 4, 4335), +(35277, '朱公乡', 4, 4335), +(35278, '杨坝镇', 4, 4335), +(35279, '柳湾乡', 4, 4335), +(35280, '桃园镇', 4, 4335), +(35281, '桥亭乡', 4, 4335), +(35282, '正直镇', 4, 4335), +(35283, '汇滩乡', 4, 4335), +(35284, '沙坝乡', 4, 4335), +(35285, '沙河镇', 4, 4335); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35286, '流坝乡', 4, 4335), +(35287, '燕山乡', 4, 4335), +(35288, '石滩乡', 4, 4335), +(35289, '红光乡', 4, 4335), +(35290, '红四乡', 4, 4335), +(35291, '红岩乡', 4, 4335), +(35292, '贵民乡', 4, 4335), +(35293, '赤溪乡', 4, 4335), +(35294, '赶场镇', 4, 4335), +(35295, '长赤镇', 4, 4335), +(35296, '高塔乡', 4, 4335), +(35297, '高桥乡', 4, 4335), +(35298, '黑潭乡', 4, 4335), +(35299, '万安乡', 4, 4336), +(35300, '三星乡', 4, 4336), +(35301, '三汇镇', 4, 4336), +(35302, '三江镇', 4, 4336), +(35303, '三河场镇', 4, 4336), +(35304, '上八庙镇', 4, 4336), +(35305, '下八庙镇', 4, 4336), +(35306, '东城街道', 4, 4336), +(35307, '义兴乡', 4, 4336), +(35308, '九镇乡', 4, 4336), +(35309, '光辉乡', 4, 4336), +(35310, '关公乡', 4, 4336), +(35311, '关渡乡', 4, 4336), +(35312, '兴文镇', 4, 4336), +(35313, '兴隆场乡', 4, 4336), +(35314, '凌云乡', 4, 4336), +(35315, '凤溪乡', 4, 4336), +(35316, '化成镇', 4, 4336), +(35317, '双胜乡', 4, 4336), +(35318, '回风街道', 4, 4336), +(35319, '大和乡', 4, 4336), +(35320, '大罗镇', 4, 4336), +(35321, '寺岭乡', 4, 4336), +(35322, '尹家乡', 4, 4336), +(35323, '巴州镇', 4, 4336), +(35324, '平梁乡', 4, 4336), +(35325, '恩阳镇', 4, 4336), +(35326, '曾口镇', 4, 4336), +(35327, '枣林镇', 4, 4336), +(35328, '柳林镇', 4, 4336), +(35329, '梁永镇', 4, 4336), +(35330, '梓橦庙乡', 4, 4336), +(35331, '水宁寺镇', 4, 4336), +(35332, '江北街道', 4, 4336), +(35333, '清江镇', 4, 4336), +(35334, '渔溪镇', 4, 4336), +(35335, '玉井乡', 4, 4336), +(35336, '玉山镇', 4, 4336), +(35337, '白庙乡', 4, 4336), +(35338, '石城乡', 4, 4336), +(35339, '羊凤乡', 4, 4336), +(35340, '群乐乡', 4, 4336), +(35341, '舞凤乡', 4, 4336), +(35342, '花丛镇', 4, 4336), +(35343, '花溪乡', 4, 4336), +(35344, '茶坝镇', 4, 4336), +(35345, '西城街道', 4, 4336), +(35346, '观音井镇', 4, 4336), +(35347, '金碑乡', 4, 4336), +(35348, '青木镇', 4, 4336), +(35349, '鼎山镇', 4, 4336), +(35350, '龙背乡', 4, 4336); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35351, '云台镇', 4, 4337), +(35352, '佛楼镇', 4, 4337), +(35353, '元山镇', 4, 4337), +(35354, '元石乡', 4, 4337), +(35355, '六门乡', 4, 4337), +(35356, '兰草镇', 4, 4337), +(35357, '响滩镇', 4, 4337), +(35358, '喜神乡', 4, 4337), +(35359, '土兴乡', 4, 4337), +(35360, '坦溪镇', 4, 4337), +(35361, '大寨乡', 4, 4337), +(35362, '岩口乡', 4, 4337), +(35363, '岳家镇', 4, 4337), +(35364, '得胜镇', 4, 4337), +(35365, '望京乡', 4, 4337), +(35366, '板庙乡', 4, 4337), +(35367, '江口镇', 4, 4337), +(35368, '泥龙乡', 4, 4337), +(35369, '涵水镇', 4, 4337), +(35370, '白衣镇', 4, 4337), +(35371, '笔山镇', 4, 4337), +(35372, '西兴镇', 4, 4337), +(35373, '邱家镇', 4, 4337), +(35374, '镇龙镇', 4, 4337), +(35375, '青云乡', 4, 4337), +(35376, '驷马镇', 4, 4337), +(35377, '龙岗乡', 4, 4337), +(35378, '三合乡', 4, 4338), +(35379, '三溪乡', 4, 4338), +(35380, '东山乡', 4, 4338), +(35381, '两河口乡', 4, 4338), +(35382, '九层乡', 4, 4338), +(35383, '云昙乡', 4, 4338), +(35384, '兴隆乡', 4, 4338), +(35385, '双泉乡', 4, 4338), +(35386, '唱歌乡', 4, 4338), +(35387, '回林乡', 4, 4338), +(35388, '大兴乡', 4, 4338), +(35389, '广纳镇', 4, 4338), +(35390, '文峰乡', 4, 4338), +(35391, '文胜乡', 4, 4338), +(35392, '新场乡', 4, 4338), +(35393, '春在乡', 4, 4338), +(35394, '朱元乡', 4, 4338), +(35395, '杨柏乡', 4, 4338), +(35396, '松溪乡', 4, 4338), +(35397, '板凳乡', 4, 4338), +(35398, '板桥口乡', 4, 4338), +(35399, '毛裕乡', 4, 4338), +(35400, '民胜镇', 4, 4338), +(35401, '永安镇', 4, 4338), +(35402, '沙坪乡', 4, 4338), +(35403, '沙溪镇', 4, 4338), +(35404, '泥溪乡', 4, 4338), +(35405, '洪口镇', 4, 4338), +(35406, '涪阳镇', 4, 4338), +(35407, '澌波乡', 4, 4338), +(35408, '火炬镇', 4, 4338), +(35409, '烟溪乡', 4, 4338), +(35410, '瓦室镇', 4, 4338), +(35411, '空山乡', 4, 4338), +(35412, '胜利乡', 4, 4338), +(35413, '至诚镇', 4, 4338), +(35414, '芝苞乡', 4, 4338), +(35415, '草池乡', 4, 4338), +(35416, '董溪乡', 4, 4338); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35417, '诺水河镇', 4, 4338), +(35418, '诺江镇', 4, 4338), +(35419, '铁佛镇', 4, 4338), +(35420, '铁厂乡', 4, 4338), +(35421, '铁溪镇', 4, 4338), +(35422, '长坪乡', 4, 4338), +(35423, '陈河乡', 4, 4338), +(35424, '青浴乡', 4, 4338), +(35425, '麻石镇', 4, 4338), +(35426, '龙凤场乡', 4, 4338), +(35427, '东山镇', 4, 4339), +(35428, '中和场镇', 4, 4339), +(35429, '中天镇', 4, 4339), +(35430, '佛星镇', 4, 4339), +(35431, '全胜乡', 4, 4339), +(35432, '凉水乡', 4, 4339), +(35433, '劳动镇', 4, 4339), +(35434, '双河场乡', 4, 4339), +(35435, '回澜镇', 4, 4339), +(35436, '大佛镇', 4, 4339), +(35437, '天池镇', 4, 4339), +(35438, '孔雀乡', 4, 4339), +(35439, '宝林镇', 4, 4339), +(35440, '放生乡', 4, 4339), +(35441, '盛池乡', 4, 4339), +(35442, '石佛镇', 4, 4339), +(35443, '石湍镇', 4, 4339), +(35444, '童家镇', 4, 4339), +(35445, '良安镇', 4, 4339), +(35446, '蟠龙镇', 4, 4339), +(35447, '通旅镇', 4, 4339), +(35448, '金顺镇', 4, 4339), +(35449, '高寺镇', 4, 4339), +(35450, '龙溪乡', 4, 4339), +(35451, '龙门乡', 4, 4339), +(35452, '东胜乡', 4, 4340), +(35453, '两板桥镇', 4, 4340), +(35454, '九龙乡', 4, 4340), +(35455, '干龙乡', 4, 4340), +(35456, '云峰乡', 4, 4340), +(35457, '人和乡', 4, 4340), +(35458, '偏岩乡', 4, 4340), +(35459, '元坝镇', 4, 4340), +(35460, '八庙乡', 4, 4340), +(35461, '共和乡', 4, 4340), +(35462, '兴隆镇', 4, 4340), +(35463, '努力乡', 4, 4340), +(35464, '千佛乡', 4, 4340), +(35465, '华严镇', 4, 4340), +(35466, '协和乡', 4, 4340), +(35467, '南熏乡', 4, 4340), +(35468, '双龙街乡', 4, 4340), +(35469, '合义乡', 4, 4340), +(35470, '周礼镇', 4, 4340), +(35471, '和平乡', 4, 4340), +(35472, '团结乡', 4, 4340), +(35473, '坪河乡', 4, 4340), +(35474, '城北乡', 4, 4340), +(35475, '城西乡', 4, 4340), +(35476, '大埝乡', 4, 4340), +(35477, '天宝乡', 4, 4340), +(35478, '天林镇', 4, 4340), +(35479, '天马乡', 4, 4340), +(35480, '太平乡', 4, 4340), +(35481, '姚市镇', 4, 4340); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35482, '宝华乡', 4, 4340), +(35483, '岳新乡', 4, 4340), +(35484, '岳源乡', 4, 4340), +(35485, '岳阳镇', 4, 4340), +(35486, '建华乡', 4, 4340), +(35487, '忠义乡', 4, 4340), +(35488, '思贤乡', 4, 4340), +(35489, '悦来乡', 4, 4340), +(35490, '护建乡', 4, 4340), +(35491, '护龙镇', 4, 4340), +(35492, '拱桥乡', 4, 4340), +(35493, '文化镇', 4, 4340), +(35494, '朝阳乡', 4, 4340), +(35495, '李家镇', 4, 4340), +(35496, '来凤乡', 4, 4340), +(35497, '林凤镇', 4, 4340), +(35498, '横庙乡', 4, 4340), +(35499, '毛家镇', 4, 4340), +(35500, '永清镇', 4, 4340), +(35501, '永顺镇', 4, 4340), +(35502, '清流乡', 4, 4340), +(35503, '瑞云乡', 4, 4340), +(35504, '白塔寺乡', 4, 4340), +(35505, '白水乡', 4, 4340), +(35506, '石桥铺镇', 4, 4340), +(35507, '石羊镇', 4, 4340), +(35508, '石鼓乡', 4, 4340), +(35509, '自治乡', 4, 4340), +(35510, '通贤镇', 4, 4340), +(35511, '镇子镇', 4, 4340), +(35512, '长河乡', 4, 4340), +(35513, '顶新乡', 4, 4340), +(35514, '驯龙镇', 4, 4340), +(35515, '高升乡', 4, 4340), +(35516, '高屋乡', 4, 4340), +(35517, '鱼龙乡', 4, 4340), +(35518, '鸳大镇', 4, 4340), +(35519, '龙台镇', 4, 4340), +(35520, '龙桥乡', 4, 4340), +(35521, '三合镇', 4, 4341), +(35522, '三岔镇', 4, 4341), +(35523, '三星镇', 4, 4341), +(35524, '东溪镇', 4, 4341), +(35525, '丹景乡', 4, 4341), +(35526, '云龙镇', 4, 4341), +(35527, '五合乡', 4, 4341), +(35528, '五指乡', 4, 4341), +(35529, '五星乡', 4, 4341), +(35530, '养马镇', 4, 4341), +(35531, '同合乡', 4, 4341), +(35532, '周家乡', 4, 4341), +(35533, '坛罐乡', 4, 4341), +(35534, '壮溪乡', 4, 4341), +(35535, '太平桥镇', 4, 4341), +(35536, '安乐乡', 4, 4341), +(35537, '宏缘乡', 4, 4341), +(35538, '平息乡', 4, 4341), +(35539, '平武镇', 4, 4341), +(35540, '平泉镇', 4, 4341), +(35541, '平窝乡', 4, 4341), +(35542, '新市镇', 4, 4341), +(35543, '新星乡', 4, 4341), +(35544, '新民乡', 4, 4341), +(35545, '施家镇', 4, 4341), +(35546, '普安乡', 4, 4341), +(35547, '望水乡', 4, 4341); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35548, '武庙乡', 4, 4341), +(35549, '永宁乡', 4, 4341), +(35550, '江源镇', 4, 4341), +(35551, '海螺乡', 4, 4341), +(35552, '涌泉镇', 4, 4341), +(35553, '清风乡', 4, 4341), +(35554, '灵仙乡', 4, 4341), +(35555, '玉成乡', 4, 4341), +(35556, '石板凳镇', 4, 4341), +(35557, '石桥镇', 4, 4341), +(35558, '石盘镇', 4, 4341), +(35559, '石钟镇', 4, 4341), +(35560, '福田乡', 4, 4341), +(35561, '禾丰镇', 4, 4341), +(35562, '简城镇', 4, 4341), +(35563, '老君井乡', 4, 4341), +(35564, '老龙乡', 4, 4341), +(35565, '芦葭镇', 4, 4341), +(35566, '草池镇', 4, 4341), +(35567, '董家埂乡', 4, 4341), +(35568, '贾家镇', 4, 4341), +(35569, '踏水镇', 4, 4341), +(35570, '金马镇', 4, 4341), +(35571, '镇金镇', 4, 4341), +(35572, '雷家乡', 4, 4341), +(35573, '青龙镇', 4, 4341), +(35574, '飞龙乡', 4, 4341), +(35575, '高明乡', 4, 4341), +(35576, '三贤祠街道', 4, 4342), +(35577, '东峰镇', 4, 4342), +(35578, '中和镇', 4, 4342), +(35579, '丰裕镇', 4, 4342), +(35580, '临江镇', 4, 4342), +(35581, '丹山镇', 4, 4342), +(35582, '伍隍镇', 4, 4342), +(35583, '保和镇', 4, 4342), +(35584, '南津镇', 4, 4342), +(35585, '回龙乡', 4, 4342), +(35586, '堪嘉镇', 4, 4342), +(35587, '宝台镇', 4, 4342), +(35588, '小院镇', 4, 4342), +(35589, '忠义镇', 4, 4342), +(35590, '新场乡', 4, 4342), +(35591, '松涛镇', 4, 4342), +(35592, '清水乡', 4, 4342), +(35593, '狮子山街道', 4, 4342), +(35594, '石岭镇', 4, 4342), +(35595, '碑记镇', 4, 4342), +(35596, '祥符镇', 4, 4342), +(35597, '老君镇', 4, 4342), +(35598, '莲花街道', 4, 4342), +(35599, '资溪街道', 4, 4342), +(35600, '迎接镇', 4, 4342), +(35601, '雁江镇', 4, 4342), +(35602, '保华乡', 4, 4343), +(35603, '勿角乡', 4, 4343), +(35604, '双河乡', 4, 4343), +(35605, '大录乡', 4, 4343), +(35606, '安乐乡', 4, 4343), +(35607, '永丰乡', 4, 4343), +(35608, '永乐镇', 4, 4343), +(35609, '永和乡', 4, 4343), +(35610, '漳扎镇', 4, 4343), +(35611, '玉瓦乡', 4, 4343), +(35612, '白河乡', 4, 4343); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35613, '罗依乡', 4, 4343), +(35614, '草地乡', 4, 4343), +(35615, '郭元乡', 4, 4343), +(35616, '陵江乡', 4, 4343), +(35617, '马家乡', 4, 4343), +(35618, '黑河乡', 4, 4343), +(35619, '上壤塘乡', 4, 4344), +(35620, '上杜柯乡', 4, 4344), +(35621, '中壤塘乡', 4, 4344), +(35622, '南木达乡', 4, 4344), +(35623, '吾伊乡', 4, 4344), +(35624, '壤柯镇', 4, 4344), +(35625, '宗科乡', 4, 4344), +(35626, '尕多乡', 4, 4344), +(35627, '岗木达乡', 4, 4344), +(35628, '石里乡', 4, 4344), +(35629, '茸木达乡', 4, 4344), +(35630, '蒲西乡', 4, 4344), +(35631, '两河乡', 4, 4345), +(35632, '八角乡', 4, 4345), +(35633, '双柏乡', 4, 4345), +(35634, '宅垄乡', 4, 4345), +(35635, '崇德乡', 4, 4345), +(35636, '抚边乡', 4, 4345), +(35637, '新格乡', 4, 4345), +(35638, '新桥乡', 4, 4345), +(35639, '日尔乡', 4, 4345), +(35640, '日隆镇', 4, 4345), +(35641, '木坡乡', 4, 4345), +(35642, '汗牛乡', 4, 4345), +(35643, '沃日乡', 4, 4345), +(35644, '沙龙乡', 4, 4345), +(35645, '潘安乡', 4, 4345), +(35646, '窝底乡', 4, 4345), +(35647, '结斯乡', 4, 4345), +(35648, '美兴镇', 4, 4345), +(35649, '美沃乡', 4, 4345), +(35650, '老营乡', 4, 4345), +(35651, '达维乡', 4, 4345), +(35652, '上八寨乡', 4, 4346), +(35653, '下八寨乡', 4, 4346), +(35654, '十里回族乡', 4, 4346), +(35655, '大姓乡', 4, 4346), +(35656, '大寨乡', 4, 4346), +(35657, '安宏乡', 4, 4346), +(35658, '小姓乡', 4, 4346), +(35659, '小河乡', 4, 4346), +(35660, '山巴乡', 4, 4346), +(35661, '岷江乡', 4, 4346), +(35662, '川主寺镇', 4, 4346), +(35663, '施家堡乡', 4, 4346), +(35664, '水晶乡', 4, 4346), +(35665, '燕云乡', 4, 4346), +(35666, '牟尼乡', 4, 4346), +(35667, '白羊乡', 4, 4346), +(35668, '红土乡', 4, 4346), +(35669, '红扎乡', 4, 4346), +(35670, '草原乡', 4, 4346), +(35671, '进安回族乡', 4, 4346), +(35672, '进安镇', 4, 4346), +(35673, '镇坪乡', 4, 4346), +(35674, '镇江关乡', 4, 4346), +(35675, '青云乡', 4, 4346), +(35676, '黄龙乡', 4, 4346); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35677, '三江乡', 4, 4347), +(35678, '克枯乡', 4, 4347), +(35679, '卧龙镇', 4, 4347), +(35680, '威州镇', 4, 4347), +(35681, '映秀镇', 4, 4347), +(35682, '水磨镇', 4, 4347), +(35683, '漩口镇', 4, 4347), +(35684, '绵虒镇', 4, 4347), +(35685, '耿达乡', 4, 4347), +(35686, '草坡乡', 4, 4347), +(35687, '银杏乡', 4, 4347), +(35688, '雁门乡', 4, 4347), +(35689, '龙溪乡', 4, 4347), +(35690, '上孟乡', 4, 4348), +(35691, '下孟乡', 4, 4348), +(35692, '古尔沟镇', 4, 4348), +(35693, '夹壁乡', 4, 4348), +(35694, '木卡乡', 4, 4348), +(35695, '朴头乡', 4, 4348), +(35696, '杂谷脑镇', 4, 4348), +(35697, '桃坪乡', 4, 4348), +(35698, '甘堡乡', 4, 4348), +(35699, '米亚罗镇', 4, 4348), +(35700, '蒲溪乡', 4, 4348), +(35701, '薛城镇', 4, 4348), +(35702, '通化乡', 4, 4348), +(35703, '刷经寺镇', 4, 4349), +(35704, '壤口乡', 4, 4349), +(35705, '安曲乡', 4, 4349), +(35706, '查尔玛乡', 4, 4349), +(35707, '江茸乡', 4, 4349), +(35708, '瓦切乡', 4, 4349), +(35709, '色地乡', 4, 4349), +(35710, '邛溪镇', 4, 4349), +(35711, '阿木乡', 4, 4349), +(35712, '麦洼乡', 4, 4349), +(35713, '龙日乡', 4, 4349), +(35714, '冻列乡', 4, 4350), +(35715, '包座乡', 4, 4350), +(35716, '占哇乡', 4, 4350), +(35717, '唐克乡', 4, 4350), +(35718, '嫩哇乡', 4, 4350), +(35719, '崇尔乡', 4, 4350), +(35720, '巴西乡', 4, 4350), +(35721, '求吉乡', 4, 4350), +(35722, '热尔乡', 4, 4350), +(35723, '班佑乡', 4, 4350), +(35724, '红星乡', 4, 4350), +(35725, '辖曼乡', 4, 4350), +(35726, '达扎寺镇', 4, 4350), +(35727, '阿西乡', 4, 4350), +(35728, '阿西茸乡', 4, 4350), +(35729, '降扎乡', 4, 4350), +(35730, '麦溪乡', 4, 4350), +(35731, '三龙乡', 4, 4351), +(35732, '东兴乡', 4, 4351), +(35733, '光明乡', 4, 4351), +(35734, '凤仪镇', 4, 4351), +(35735, '南新镇', 4, 4351), +(35736, '叠溪镇', 4, 4351), +(35737, '回龙乡', 4, 4351), +(35738, '土门乡', 4, 4351), +(35739, '太平乡', 4, 4351), +(35740, '富顺乡', 4, 4351), +(35741, '曲谷乡', 4, 4351); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35742, '松坪沟乡', 4, 4351), +(35743, '永和乡', 4, 4351), +(35744, '沟口乡', 4, 4351), +(35745, '洼底乡', 4, 4351), +(35746, '渭门乡', 4, 4351), +(35747, '白溪乡', 4, 4351), +(35748, '石大关乡', 4, 4351), +(35749, '石鼓乡', 4, 4351), +(35750, '维城乡', 4, 4351), +(35751, '雅都乡', 4, 4351), +(35752, '飞虹乡', 4, 4351), +(35753, '黑虎乡', 4, 4351), +(35754, '万林乡', 4, 4352), +(35755, '二嘎里乡', 4, 4352), +(35756, '俄热乡', 4, 4352), +(35757, '勒乌乡', 4, 4352), +(35758, '卡拉脚乡', 4, 4352), +(35759, '卡撒乡', 4, 4352), +(35760, '咯尔乡', 4, 4352), +(35761, '太阳河乡', 4, 4352), +(35762, '安宁乡', 4, 4352), +(35763, '庆宁乡', 4, 4352), +(35764, '撒瓦脚乡', 4, 4352), +(35765, '曾达乡', 4, 4352), +(35766, '毛日乡', 4, 4352), +(35767, '沙耳乡', 4, 4352), +(35768, '河东乡', 4, 4352), +(35769, '河西乡', 4, 4352), +(35770, '独松乡', 4, 4352), +(35771, '观音桥镇', 4, 4352), +(35772, '金川镇', 4, 4352), +(35773, '阿科里乡', 4, 4352), +(35774, '集沐乡', 4, 4352), +(35775, '马奈乡', 4, 4352), +(35776, '马尔邦乡', 4, 4352), +(35777, '各莫乡', 4, 4353), +(35778, '哇尔玛乡', 4, 4353), +(35779, '四洼乡', 4, 4353), +(35780, '垮沙乡', 4, 4353), +(35781, '安斗乡', 4, 4353), +(35782, '安羌乡', 4, 4353), +(35783, '德格乡', 4, 4353), +(35784, '查理乡', 4, 4353), +(35785, '柯河乡', 4, 4353), +(35786, '求吉玛乡', 4, 4353), +(35787, '河支乡', 4, 4353), +(35788, '洛尔达乡', 4, 4353), +(35789, '甲尔多乡', 4, 4353), +(35790, '茸安乡', 4, 4353), +(35791, '贾洛乡', 4, 4353), +(35792, '阿坝镇', 4, 4353), +(35793, '麦尔玛乡', 4, 4353), +(35794, '麦昆乡', 4, 4353), +(35795, '龙藏乡', 4, 4353), +(35796, '党坝乡', 4, 4354), +(35797, '卓克基镇', 4, 4354), +(35798, '大藏乡', 4, 4354), +(35799, '康山乡', 4, 4354), +(35800, '日部乡', 4, 4354), +(35801, '木尔宗乡', 4, 4354), +(35802, '松岗镇', 4, 4354), +(35803, '梭磨乡', 4, 4354), +(35804, '沙尔宗乡', 4, 4354), +(35805, '白湾乡', 4, 4354); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35806, '脚木足乡', 4, 4354), +(35807, '草登乡', 4, 4354), +(35808, '马尔康镇', 4, 4354), +(35809, '龙尔甲乡', 4, 4354), +(35810, '卡龙镇', 4, 4355), +(35811, '双溜索乡', 4, 4355), +(35812, '慈坝乡', 4, 4355), +(35813, '扎窝乡', 4, 4355), +(35814, '晴朗乡', 4, 4355), +(35815, '木苏乡', 4, 4355), +(35816, '沙石多乡', 4, 4355), +(35817, '洛多乡', 4, 4355), +(35818, '瓦钵梁子乡', 4, 4355), +(35819, '知木林乡', 4, 4355), +(35820, '石碉楼乡', 4, 4355), +(35821, '红岩乡', 4, 4355), +(35822, '维古乡', 4, 4355), +(35823, '色尔古乡', 4, 4355), +(35824, '芦花镇', 4, 4355), +(35825, '麻窝乡', 4, 4355), +(35826, '龙坝乡', 4, 4355), +(35827, '东女谷乡', 4, 4356), +(35828, '东谷乡', 4, 4356), +(35829, '丹东乡', 4, 4356), +(35830, '半扇门乡', 4, 4356), +(35831, '太平桥乡', 4, 4356), +(35832, '岳扎乡', 4, 4356), +(35833, '巴底乡', 4, 4356), +(35834, '巴旺乡', 4, 4356), +(35835, '格宗乡', 4, 4356), +(35836, '梭坡乡', 4, 4356), +(35837, '水子乡', 4, 4356), +(35838, '章谷镇', 4, 4356), +(35839, '聂呷乡', 4, 4356), +(35840, '边耳乡', 4, 4356), +(35841, '革什扎乡', 4, 4356), +(35842, '定波乡', 4, 4357), +(35843, '尼斯乡', 4, 4357), +(35844, '正斗乡', 4, 4357), +(35845, '水洼乡', 4, 4357), +(35846, '沙贡乡', 4, 4357), +(35847, '洞松乡', 4, 4357), +(35848, '热打乡', 4, 4357), +(35849, '然乌乡', 4, 4357), +(35850, '白依乡', 4, 4357), +(35851, '青德乡', 4, 4357), +(35852, '青麦乡', 4, 4357), +(35853, '香巴拉镇', 4, 4357), +(35854, '中咱乡', 4, 4358), +(35855, '中心绒乡', 4, 4358), +(35856, '亚日贡乡', 4, 4358), +(35857, '党巴乡', 4, 4358), +(35858, '列衣乡', 4, 4358), +(35859, '地巫乡', 4, 4358), +(35860, '夏邛镇', 4, 4358), +(35861, '德达乡', 4, 4358), +(35862, '拉哇乡', 4, 4358), +(35863, '措拉乡', 4, 4358), +(35864, '昌波乡', 4, 4358), +(35865, '松多乡', 4, 4358), +(35866, '波密乡', 4, 4358), +(35867, '波戈溪乡', 4, 4358), +(35868, '甲英乡', 4, 4358), +(35869, '竹巴龙乡', 4, 4358); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35870, '苏哇龙乡', 4, 4358), +(35871, '茶洛乡', 4, 4358), +(35872, '莫多乡', 4, 4358), +(35873, '三合乡', 4, 4359), +(35874, '前溪乡', 4, 4359), +(35875, '吉居乡', 4, 4359), +(35876, '呷巴乡', 4, 4359), +(35877, '塔公乡', 4, 4359), +(35878, '姑咱镇', 4, 4359), +(35879, '孔玉乡', 4, 4359), +(35880, '捧塔乡', 4, 4359), +(35881, '新都桥镇', 4, 4359), +(35882, '时济乡', 4, 4359), +(35883, '普沙绒乡', 4, 4359), +(35884, '朋布西乡', 4, 4359), +(35885, '沙德乡', 4, 4359), +(35886, '炉城镇', 4, 4359), +(35887, '瓦泽乡', 4, 4359), +(35888, '甲根坝乡', 4, 4359), +(35889, '舍联乡', 4, 4359), +(35890, '贡嘎山乡', 4, 4359), +(35891, '金汤乡', 4, 4359), +(35892, '雅拉乡', 4, 4359), +(35893, '麦崩乡', 4, 4359), +(35894, '八日乡', 4, 4360), +(35895, '古学乡', 4, 4360), +(35896, '奔都乡', 4, 4360), +(35897, '子庚乡', 4, 4360), +(35898, '徐龙乡', 4, 4360), +(35899, '斯闸乡', 4, 4360), +(35900, '日龙乡', 4, 4360), +(35901, '曲雅贡乡', 4, 4360), +(35902, '松麦镇', 4, 4360), +(35903, '白松乡', 4, 4360), +(35904, '茨巫乡', 4, 4360), +(35905, '贡波乡', 4, 4360), +(35906, '上然姑乡', 4, 4361), +(35907, '中扎柯乡', 4, 4361), +(35908, '亚丁乡', 4, 4361), +(35909, '俄南乡', 4, 4361), +(35910, '俄支乡', 4, 4361), +(35911, '八邦乡', 4, 4361), +(35912, '卡松渡乡', 4, 4361), +(35913, '岳巴乡', 4, 4361), +(35914, '年古乡', 4, 4361), +(35915, '所巴乡', 4, 4361), +(35916, '打滚乡', 4, 4361), +(35917, '普马乡', 4, 4361), +(35918, '更庆镇', 4, 4361), +(35919, '柯洛洞乡', 4, 4361), +(35920, '汪布顶乡', 4, 4361), +(35921, '浪多乡', 4, 4361), +(35922, '温拖乡', 4, 4361), +(35923, '玉隆乡', 4, 4361), +(35924, '白垭乡', 4, 4361), +(35925, '窝公乡', 4, 4361), +(35926, '竹庆乡', 4, 4361), +(35927, '达马乡', 4, 4361), +(35928, '错阿乡', 4, 4361), +(35929, '阿须乡', 4, 4361), +(35930, '马尼干戈乡', 4, 4361), +(35931, '龚垭乡', 4, 4361), +(35932, '乐安乡', 4, 4362), +(35933, '博美乡', 4, 4362); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35934, '友谊乡', 4, 4362), +(35935, '和平乡', 4, 4362), +(35936, '大盖乡', 4, 4362), +(35937, '子拖西乡', 4, 4362), +(35938, '尤拉西乡', 4, 4362), +(35939, '拉日马乡', 4, 4362), +(35940, '沙堆乡', 4, 4362), +(35941, '洛古乡', 4, 4362), +(35942, '甲拉西乡', 4, 4362), +(35943, '皮擦乡', 4, 4362), +(35944, '绕鲁乡', 4, 4362), +(35945, '色威乡', 4, 4362), +(35946, '茹龙镇', 4, 4362), +(35947, '通霄乡', 4, 4362), +(35948, '银多乡', 4, 4362), +(35949, '雄龙西乡', 4, 4362), +(35950, '麻日乡', 4, 4362), +(35951, '兴隆镇', 4, 4363), +(35952, '冷碛镇', 4, 4363), +(35953, '加郡乡', 4, 4363), +(35954, '岚安乡', 4, 4363), +(35955, '得妥乡', 4, 4363), +(35956, '德威乡', 4, 4363), +(35957, '新兴乡', 4, 4363), +(35958, '杵坭乡', 4, 4363), +(35959, '泸桥镇', 4, 4363), +(35960, '烹坝乡', 4, 4363), +(35961, '田坝乡', 4, 4363), +(35962, '磨西镇', 4, 4363), +(35963, '上罗柯马乡', 4, 4364), +(35964, '下罗柯马乡', 4, 4364), +(35965, '仁达乡', 4, 4364), +(35966, '充古乡', 4, 4364), +(35967, '卡娘乡', 4, 4364), +(35968, '宗塔乡', 4, 4364), +(35969, '宗麦乡', 4, 4364), +(35970, '宜木乡', 4, 4364), +(35971, '斯木乡', 4, 4364), +(35972, '新都镇', 4, 4364), +(35973, '旦都乡', 4, 4364), +(35974, '更知乡', 4, 4364), +(35975, '朱倭乡', 4, 4364), +(35976, '泥巴乡', 4, 4364), +(35977, '洛秋乡', 4, 4364), +(35978, '雅德乡', 4, 4364), +(35979, '上木拉乡', 4, 4365), +(35980, '下木拉乡', 4, 4365), +(35981, '中木拉乡', 4, 4365), +(35982, '亚火乡', 4, 4365), +(35983, '君坝乡', 4, 4365), +(35984, '呷柯乡', 4, 4365), +(35985, '哈依乡', 4, 4365), +(35986, '喇嘛垭乡', 4, 4365), +(35987, '奔戈乡', 4, 4365), +(35988, '德巫乡', 4, 4365), +(35989, '拉波乡', 4, 4365), +(35990, '曲登乡', 4, 4365), +(35991, '村戈乡', 4, 4365), +(35992, '格木乡', 4, 4365), +(35993, '濯桑乡', 4, 4365), +(35994, '甲洼乡', 4, 4365), +(35995, '禾尼乡', 4, 4365), +(35996, '章纳乡', 4, 4365), +(35997, '绒坝乡', 4, 4365), +(35998, '莫坝乡', 4, 4365); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(35999, '藏坝乡', 4, 4365), +(36000, '觉吾乡', 4, 4365), +(36001, '高城镇', 4, 4365), +(36002, '麦洼乡', 4, 4365), +(36003, '下雄乡', 4, 4366), +(36004, '仁果乡', 4, 4366), +(36005, '南多乡', 4, 4366), +(36006, '卡攻乡', 4, 4366), +(36007, '卡龙乡', 4, 4366), +(36008, '呷拉乡', 4, 4366), +(36009, '四通达乡', 4, 4366), +(36010, '大德乡', 4, 4366), +(36011, '夺多乡', 4, 4366), +(36012, '庭卡乡', 4, 4366), +(36013, '扎科乡', 4, 4366), +(36014, '拖坝乡', 4, 4366), +(36015, '斯俄乡', 4, 4366), +(36016, '昔色乡', 4, 4366), +(36017, '来马乡', 4, 4366), +(36018, '查龙乡', 4, 4366), +(36019, '泥柯乡', 4, 4366), +(36020, '甘孜镇', 4, 4366), +(36021, '生康乡', 4, 4366), +(36022, '色西底乡', 4, 4366), +(36023, '茶扎乡', 4, 4366), +(36024, '贡隆乡', 4, 4366), +(36025, '安孜乡', 4, 4367), +(36026, '山岩乡', 4, 4367), +(36027, '建设镇', 4, 4367), +(36028, '沙马乡', 4, 4367), +(36029, '河坡乡', 4, 4367), +(36030, '热加乡', 4, 4367), +(36031, '登龙乡', 4, 4367), +(36032, '盖玉乡', 4, 4367), +(36033, '章都乡', 4, 4367), +(36034, '纳塔乡', 4, 4367), +(36035, '绒盖乡', 4, 4367), +(36036, '赠科乡', 4, 4367), +(36037, '辽西乡', 4, 4367), +(36038, '金沙乡', 4, 4367), +(36039, '阿察乡', 4, 4367), +(36040, '麻绒乡', 4, 4367), +(36041, '麻邛乡', 4, 4367), +(36042, '俄多马乡', 4, 4368), +(36043, '呷衣乡', 4, 4368), +(36044, '奔达乡', 4, 4368), +(36045, '宜牛乡', 4, 4368), +(36046, '尼呷镇', 4, 4368), +(36047, '德荣马乡', 4, 4368), +(36048, '新荣乡', 4, 4368), +(36049, '格孟乡', 4, 4368), +(36050, '正科乡', 4, 4368), +(36051, '洛须镇', 4, 4368), +(36052, '温波乡', 4, 4368), +(36053, '瓦须乡', 4, 4368), +(36054, '真达乡', 4, 4368), +(36055, '蒙宜乡', 4, 4368), +(36056, '虾扎乡', 4, 4368), +(36057, '起坞乡', 4, 4368), +(36058, '长沙干马乡', 4, 4368), +(36059, '长沙贡马乡', 4, 4368), +(36060, '长须干马乡', 4, 4368), +(36061, '长须贡马乡', 4, 4368), +(36062, '阿日扎乡', 4, 4368), +(36063, '麻呷乡', 4, 4368); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36064, '俄雅同乡', 4, 4369), +(36065, '傍河乡', 4, 4369), +(36066, '各卡乡', 4, 4369), +(36067, '吉呷乡', 4, 4369), +(36068, '巨龙乡', 4, 4369), +(36069, '木拉乡', 4, 4369), +(36070, '桑堆乡', 4, 4369), +(36071, '省母乡', 4, 4369), +(36072, '色拉乡', 4, 4369), +(36073, '蒙自乡', 4, 4369), +(36074, '赤土乡', 4, 4369), +(36075, '邓波乡', 4, 4369), +(36076, '金珠镇', 4, 4369), +(36077, '香格里拉乡', 4, 4369), +(36078, '亚龙乡', 4, 4370), +(36079, '克果乡', 4, 4370), +(36080, '塔子乡', 4, 4370), +(36081, '大则乡', 4, 4370), +(36082, '大章乡', 4, 4370), +(36083, '年龙乡', 4, 4370), +(36084, '康勒乡', 4, 4370), +(36085, '旭日乡', 4, 4370), +(36086, '杨各乡', 4, 4370), +(36087, '歌乐沱乡', 4, 4370), +(36088, '泥朵乡', 4, 4370), +(36089, '洛若乡', 4, 4370), +(36090, '然充乡', 4, 4370), +(36091, '甲学乡', 4, 4370), +(36092, '翁达镇', 4, 4370), +(36093, '色柯镇', 4, 4370), +(36094, '霍西乡', 4, 4370), +(36095, '七美乡', 4, 4371), +(36096, '下拖乡', 4, 4371), +(36097, '亚卓乡', 4, 4371), +(36098, '仲尼乡', 4, 4371), +(36099, '八美镇', 4, 4371), +(36100, '协德乡', 4, 4371), +(36101, '孔色乡', 4, 4371), +(36102, '扎拖乡', 4, 4371), +(36103, '木茹乡', 4, 4371), +(36104, '格西乡', 4, 4371), +(36105, '沙冲乡', 4, 4371), +(36106, '瓦日乡', 4, 4371), +(36107, '甲宗乡', 4, 4371), +(36108, '甲斯孔乡', 4, 4371), +(36109, '红顶乡', 4, 4371), +(36110, '维它乡', 4, 4371), +(36111, '色卡乡', 4, 4371), +(36112, '葛卡乡', 4, 4371), +(36113, '银恩乡', 4, 4371), +(36114, '鲜水镇', 4, 4371), +(36115, '麻孜乡', 4, 4371), +(36116, '龙灯乡', 4, 4371), +(36117, '八衣绒乡', 4, 4372), +(36118, '八角楼乡', 4, 4372), +(36119, '呷拉乡', 4, 4372), +(36120, '德差乡', 4, 4372), +(36121, '恶古乡', 4, 4372), +(36122, '普巴绒乡', 4, 4372), +(36123, '木绒乡', 4, 4372), +(36124, '柯拉乡', 4, 4372), +(36125, '河口镇', 4, 4372), +(36126, '波斯河乡', 4, 4372), +(36127, '牙衣河乡', 4, 4372), +(36128, '瓦多乡', 4, 4372); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36129, '祝桑乡', 4, 4372), +(36130, '米龙乡', 4, 4372), +(36131, '红龙乡', 4, 4372), +(36132, '西俄洛乡', 4, 4372), +(36133, '麻郎错乡', 4, 4372), +(36134, '中心乡', 4, 4373), +(36135, '会东镇', 4, 4373), +(36136, '双堰乡', 4, 4373), +(36137, '发箐乡', 4, 4373), +(36138, '可河乡', 4, 4373), +(36139, '嘎吉乡', 4, 4373), +(36140, '坪塘乡', 4, 4373), +(36141, '堵格乡', 4, 4373), +(36142, '大崇乡', 4, 4373), +(36143, '姜州乡', 4, 4373), +(36144, '小坝乡', 4, 4373), +(36145, '小岔河乡', 4, 4373), +(36146, '小街乡', 4, 4373), +(36147, '岔河乡', 4, 4373), +(36148, '岩坝乡', 4, 4373), +(36149, '干海子乡', 4, 4373), +(36150, '拉马乡', 4, 4373), +(36151, '撒者邑乡', 4, 4373), +(36152, '文箐乡', 4, 4373), +(36153, '新云乡', 4, 4373), +(36154, '新山乡', 4, 4373), +(36155, '新田乡', 4, 4373), +(36156, '新街乡', 4, 4373), +(36157, '新马乡', 4, 4373), +(36158, '新龙乡', 4, 4373), +(36159, '普咩乡', 4, 4373), +(36160, '松坪乡', 4, 4373), +(36161, '柏岩乡', 4, 4373), +(36162, '柏杉乡', 4, 4373), +(36163, '江西街乡', 4, 4373), +(36164, '洛左乡', 4, 4373), +(36165, '海坝乡', 4, 4373), +(36166, '淌塘乡', 4, 4373), +(36167, '溜姑乡', 4, 4373), +(36168, '火山乡', 4, 4373), +(36169, '火石乡', 4, 4373), +(36170, '红岩乡', 4, 4373), +(36171, '红果乡', 4, 4373), +(36172, '老口乡', 4, 4373), +(36173, '野牛坪乡', 4, 4373), +(36174, '野租乡', 4, 4373), +(36175, '铁厂沟乡', 4, 4373), +(36176, '铁柳乡', 4, 4373), +(36177, '铅锌镇', 4, 4373), +(36178, '长新乡', 4, 4373), +(36179, '雪山乡', 4, 4373), +(36180, '马龙乡', 4, 4373), +(36181, '鲁南乡', 4, 4373), +(36182, '鲁吉乡', 4, 4373), +(36183, '鹿鹤村乡', 4, 4373), +(36184, '黄坪乡', 4, 4373), +(36185, '黑嘎乡', 4, 4373), +(36186, '龙树乡', 4, 4373), +(36187, '三地乡', 4, 4374), +(36188, '下村乡', 4, 4374), +(36189, '中厂乡', 4, 4374), +(36190, '云甸乡', 4, 4374), +(36191, '仓田乡', 4, 4374), +(36192, '六华乡', 4, 4374), +(36193, '六民乡', 4, 4374); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36194, '关河乡', 4, 4374), +(36195, '内东乡', 4, 4374), +(36196, '凤营乡', 4, 4374), +(36197, '北关街道', 4, 4374), +(36198, '北街街道', 4, 4374), +(36199, '南街街道', 4, 4374), +(36200, '南阁乡', 4, 4374), +(36201, '城关镇', 4, 4374), +(36202, '外北乡', 4, 4374), +(36203, '太平镇', 4, 4374), +(36204, '富乐乡', 4, 4374), +(36205, '小黑箐乡', 4, 4374), +(36206, '彰冠乡', 4, 4374), +(36207, '新发乡', 4, 4374), +(36208, '新安傣族乡', 4, 4374), +(36209, '普隆乡', 4, 4374), +(36210, '木古乡', 4, 4374), +(36211, '杨家坝乡', 4, 4374), +(36212, '果元乡', 4, 4374), +(36213, '树堡乡', 4, 4374), +(36214, '槽元乡', 4, 4374), +(36215, '横山乡', 4, 4374), +(36216, '江普乡', 4, 4374), +(36217, '江竹乡', 4, 4374), +(36218, '河口乡', 4, 4374), +(36219, '法坪乡', 4, 4374), +(36220, '海潮乡', 4, 4374), +(36221, '爱国乡', 4, 4374), +(36222, '爱民乡', 4, 4374), +(36223, '白果湾乡', 4, 4374), +(36224, '白鸡乡', 4, 4374), +(36225, '益门镇', 4, 4374), +(36226, '矮郎乡', 4, 4374), +(36227, '竹箐乡', 4, 4374), +(36228, '绿水乡', 4, 4374), +(36229, '老街乡', 4, 4374), +(36230, '芭蕉乡', 4, 4374), +(36231, '通安镇', 4, 4374), +(36232, '金雨乡', 4, 4374), +(36233, '马宗乡', 4, 4374), +(36234, '鱼鱼乍乡', 4, 4374), +(36235, '鹿厂镇', 4, 4374), +(36236, '黄柏乡', 4, 4374), +(36237, '黎洪乡', 4, 4374), +(36238, '黎溪镇', 4, 4374), +(36239, '龙泉乡', 4, 4374), +(36240, '健美乡', 4, 4375), +(36241, '先锋乡', 4, 4375), +(36242, '冶勒乡', 4, 4375), +(36243, '南河乡', 4, 4375), +(36244, '后山乡', 4, 4375), +(36245, '和爱藏族乡', 4, 4375), +(36246, '哈哈乡', 4, 4375), +(36247, '回坪乡', 4, 4375), +(36248, '回龙乡', 4, 4375), +(36249, '城厢镇', 4, 4375), +(36250, '复兴镇', 4, 4375), +(36251, '大桥镇', 4, 4375), +(36252, '宏模乡', 4, 4375), +(36253, '彝海乡', 4, 4375), +(36254, '惠安乡', 4, 4375), +(36255, '拖乌乡', 4, 4375), +(36256, '新兴乡', 4, 4375), +(36257, '曹古乡', 4, 4375), +(36258, '林里乡', 4, 4375); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36259, '棉沙湾乡', 4, 4375), +(36260, '森荣乡', 4, 4375), +(36261, '沙坝镇', 4, 4375), +(36262, '河边乡', 4, 4375), +(36263, '河里乡', 4, 4375), +(36264, '泸沽镇', 4, 4375), +(36265, '泽远乡', 4, 4375), +(36266, '漫水湾镇', 4, 4375), +(36267, '石龙乡', 4, 4375), +(36268, '窝堡乡', 4, 4375), +(36269, '联合乡', 4, 4375), +(36270, '腊窝乡', 4, 4375), +(36271, '里庄乡', 4, 4375), +(36272, '金林乡', 4, 4375), +(36273, '铁厂乡', 4, 4375), +(36274, '锦屏乡', 4, 4375), +(36275, '青纳乡', 4, 4375), +(36276, '马头乡', 4, 4375), +(36277, '麦地沟乡', 4, 4375), +(36278, '且拖乡', 4, 4376), +(36279, '东河乡', 4, 4376), +(36280, '两河口镇', 4, 4376), +(36281, '乐武乡', 4, 4376), +(36282, '依洛乡', 4, 4376), +(36283, '光明镇', 4, 4376), +(36284, '冕山镇', 4, 4376), +(36285, '则约乡', 4, 4376), +(36286, '北山乡', 4, 4376), +(36287, '博洛拉达乡', 4, 4376), +(36288, '尼波镇', 4, 4376), +(36289, '巴久乡', 4, 4376), +(36290, '拉克乡', 4, 4376), +(36291, '李子乡', 4, 4376), +(36292, '沙马拉达乡', 4, 4376), +(36293, '洛哈镇', 4, 4376), +(36294, '洛莫乡', 4, 4376), +(36295, '热柯依达乡', 4, 4376), +(36296, '米市镇', 4, 4376), +(36297, '红莫镇', 4, 4376), +(36298, '西河乡', 4, 4376), +(36299, '贺波洛乡', 4, 4376), +(36300, '额尼乡', 4, 4376), +(36301, '鲁基乡', 4, 4376), +(36302, '俱乐乡', 4, 4377), +(36303, '裸洛乡', 4, 4377), +(36304, '六铁乡', 4, 4377), +(36305, '华弹镇', 4, 4377), +(36306, '大同乡', 4, 4377), +(36307, '幸福乡', 4, 4377), +(36308, '披砂镇', 4, 4377), +(36309, '新华乡', 4, 4377), +(36310, '新建乡', 4, 4377), +(36311, '新村乡', 4, 4377), +(36312, '景星乡', 4, 4377), +(36313, '杉树乡', 4, 4377), +(36314, '松新镇', 4, 4377), +(36315, '松林乡', 4, 4377), +(36316, '梁子乡', 4, 4377), +(36317, '海子乡', 4, 4377), +(36318, '白鹤滩镇', 4, 4377), +(36319, '石梨乡', 4, 4377), +(36320, '稻谷乡', 4, 4377), +(36321, '竹寿镇', 4, 4377), +(36322, '红星乡', 4, 4377), +(36323, '葫芦口镇', 4, 4377); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36324, '西瑶乡', 4, 4377), +(36325, '跑马乡', 4, 4377), +(36326, '骑骡沟乡', 4, 4377), +(36327, '乌依乡', 4, 4378), +(36328, '乌科乡', 4, 4378), +(36329, '乐安乡', 4, 4378), +(36330, '九都乡', 4, 4378), +(36331, '包谷坪乡', 4, 4378), +(36332, '合井乡', 4, 4378), +(36333, '四棵乡', 4, 4378), +(36334, '地洛乡', 4, 4378), +(36335, '基只乡', 4, 4378), +(36336, '委只洛乡', 4, 4378), +(36337, '峨里坪乡', 4, 4378), +(36338, '拉果乡', 4, 4378), +(36339, '拉达乡', 4, 4378), +(36340, '拖觉镇', 4, 4378), +(36341, '木尔乡', 4, 4378), +(36342, '沙洛乡', 4, 4378), +(36343, '洛古乡', 4, 4378), +(36344, '浪珠乡', 4, 4378), +(36345, '火烈乡', 4, 4378), +(36346, '牛角湾乡', 4, 4378), +(36347, '特木里镇', 4, 4378), +(36348, '瓦都乡', 4, 4378), +(36349, '罗家坪乡', 4, 4378), +(36350, '美撒乡', 4, 4378), +(36351, '联补乡', 4, 4378), +(36352, '补尔乡', 4, 4378), +(36353, '补洛乡', 4, 4378), +(36354, '觉撒乡', 4, 4378), +(36355, '采哈乡', 4, 4378), +(36356, '龙潭镇', 4, 4378), +(36357, '乐跃镇', 4, 4379), +(36358, '六所乡', 4, 4379), +(36359, '前山乡', 4, 4379), +(36360, '南山傈僳族乡', 4, 4379), +(36361, '大六槽乡', 4, 4379), +(36362, '大山乡', 4, 4379), +(36363, '大湾乡', 4, 4379), +(36364, '宽裕乡', 4, 4379), +(36365, '小高乡', 4, 4379), +(36366, '巴洞乡', 4, 4379), +(36367, '德州镇', 4, 4379), +(36368, '永郎镇', 4, 4379), +(36369, '热河乡', 4, 4379), +(36370, '王所乡', 4, 4379), +(36371, '老碾乡', 4, 4379), +(36372, '茨达乡', 4, 4379), +(36373, '金沙傈僳族乡', 4, 4379), +(36374, '铁炉乡', 4, 4379), +(36375, '银鹿乡', 4, 4379), +(36376, '锦川乡', 4, 4379), +(36377, '阿月乡', 4, 4379), +(36378, '马安乡', 4, 4379), +(36379, '麻栗乡', 4, 4379), +(36380, '三岔河乡', 4, 4380), +(36381, '三岗乡', 4, 4380), +(36382, '且莫乡', 4, 4380), +(36383, '久特洛古乡', 4, 4380), +(36384, '则普乡', 4, 4380), +(36385, '博洛乡', 4, 4380), +(36386, '哈甘乡', 4, 4380), +(36387, '四开乡', 4, 4380); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36388, '地莫乡', 4, 4380), +(36389, '城北乡', 4, 4380), +(36390, '塘且乡', 4, 4380), +(36391, '大坝乡', 4, 4380), +(36392, '央摩租乡', 4, 4380), +(36393, '宜牧地乡', 4, 4380), +(36394, '尼地乡', 4, 4380), +(36395, '庆恒乡', 4, 4380), +(36396, '库依乡', 4, 4380), +(36397, '库莫乡', 4, 4380), +(36398, '拉一木乡', 4, 4380), +(36399, '支尔莫乡', 4, 4380), +(36400, '新城镇', 4, 4380), +(36401, '日哈乡', 4, 4380), +(36402, '普诗乡', 4, 4380), +(36403, '柳且乡', 4, 4380), +(36404, '树坪乡', 4, 4380), +(36405, '比尔乡', 4, 4380), +(36406, '永洛乡', 4, 4380), +(36407, '波洛乡', 4, 4380), +(36408, '洒拉地坡乡', 4, 4380), +(36409, '特口甲谷乡', 4, 4380), +(36410, '特布洛乡', 4, 4380), +(36411, '甘多洛古乡', 4, 4380), +(36412, '碗厂乡', 4, 4380), +(36413, '竹核乡', 4, 4380), +(36414, '美甘乡', 4, 4380), +(36415, '色底乡', 4, 4380), +(36416, '补约乡', 4, 4380), +(36417, '解放乡', 4, 4380), +(36418, '谷曲乡', 4, 4380), +(36419, '达洛乡', 4, 4380), +(36420, '金曲乡', 4, 4380), +(36421, '阿并洛古乡', 4, 4380), +(36422, '革吾乡', 4, 4380), +(36423, '马增依乌乡', 4, 4380), +(36424, '齿可波西乡', 4, 4380), +(36425, '龙恩乡', 4, 4380), +(36426, '龙沟乡', 4, 4380), +(36427, '东山乡', 4, 4381), +(36428, '五道箐乡', 4, 4381), +(36429, '刘家坪乡', 4, 4381), +(36430, '吉乐乡', 4, 4381), +(36431, '向阳乡', 4, 4381), +(36432, '哈力洛乡', 4, 4381), +(36433, '大坪乡', 4, 4381), +(36434, '大槽乡', 4, 4381), +(36435, '夹铁乡', 4, 4381), +(36436, '孟甘乡', 4, 4381), +(36437, '文坪乡', 4, 4381), +(36438, '普基镇', 4, 4381), +(36439, '月吾乡', 4, 4381), +(36440, '永安乡', 4, 4381), +(36441, '洛乌乡', 4, 4381), +(36442, '洛乌沟乡', 4, 4381), +(36443, '洛甘乡', 4, 4381), +(36444, '特兹乡', 4, 4381), +(36445, '特口乡', 4, 4381), +(36446, '特尔果乡', 4, 4381), +(36447, '特补乡', 4, 4381), +(36448, '瓦洛乡', 4, 4381), +(36449, '甘天地乡', 4, 4381), +(36450, '祝联乡', 4, 4381); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36451, '红莫依达乡', 4, 4381), +(36452, '耶底乡', 4, 4381), +(36453, '花山乡', 4, 4381), +(36454, '荞窝镇', 4, 4381), +(36455, '菜子乡', 4, 4381), +(36456, '螺髻山镇', 4, 4381), +(36457, '辉隆乡', 4, 4381), +(36458, '雨水乡', 4, 4381), +(36459, '马洪乡', 4, 4381), +(36460, '黎安乡', 4, 4381), +(36461, '三桷垭乡', 4, 4382), +(36462, '下麦地乡', 4, 4382), +(36463, '东子乡', 4, 4382), +(36464, '东朗乡', 4, 4382), +(36465, '乔瓦镇', 4, 4382), +(36466, '依吉乡', 4, 4382), +(36467, '俄亚纳西族乡', 4, 4382), +(36468, '裸波乡', 4, 4382), +(36469, '克尔乡', 4, 4382), +(36470, '列瓦乡', 4, 4382), +(36471, '博科乡', 4, 4382), +(36472, '博窝乡', 4, 4382), +(36473, '卡拉乡', 4, 4382), +(36474, '后所乡', 4, 4382), +(36475, '唐央乡', 4, 4382), +(36476, '固增苗族乡', 4, 4382), +(36477, '宁郎乡', 4, 4382), +(36478, '屋脚蒙古族乡', 4, 4382), +(36479, '李子坪乡', 4, 4382), +(36480, '桃巴乡', 4, 4382), +(36481, '水洛乡', 4, 4382), +(36482, '沙湾乡', 4, 4382), +(36483, '牦牛坪乡', 4, 4382), +(36484, '白碉苗族乡', 4, 4382), +(36485, '芽祖乡', 4, 4382), +(36486, '西秋乡', 4, 4382), +(36487, '项脚蒙古族乡', 4, 4382), +(36488, '麦地龙乡', 4, 4382), +(36489, '麦日乡', 4, 4382), +(36490, '两河乡', 4, 4383), +(36491, '乌史大桥乡', 4, 4383), +(36492, '则拉乡', 4, 4383), +(36493, '前进乡', 4, 4383), +(36494, '吉米镇', 4, 4383), +(36495, '嘎日乡', 4, 4383), +(36496, '团结乡', 4, 4383), +(36497, '坪坝乡', 4, 4383), +(36498, '尼尔觉乡', 4, 4383), +(36499, '拉莫乡', 4, 4383), +(36500, '斯觉镇', 4, 4383), +(36501, '新市坝镇', 4, 4383), +(36502, '新茶乡', 4, 4383), +(36503, '普昌镇', 4, 4383), +(36504, '沙岱乡', 4, 4383), +(36505, '波波乡', 4, 4383), +(36506, '海棠镇', 4, 4383), +(36507, '玉田镇', 4, 4383), +(36508, '田坝镇', 4, 4383), +(36509, '石海乡', 4, 4383), +(36510, '胜利乡', 4, 4383), +(36511, '苏雄乡', 4, 4383), +(36512, '蓼坪乡', 4, 4383), +(36513, '里克乡', 4, 4383); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36514, '阿兹觉乡', 4, 4383), +(36515, '阿嘎乡', 4, 4383), +(36516, '阿尔乡', 4, 4383), +(36517, '黑马乡', 4, 4383), +(36518, '下海乡', 4, 4384), +(36519, '前所乡', 4, 4384), +(36520, '博大乡', 4, 4384), +(36521, '卫城镇', 4, 4384), +(36522, '双河乡', 4, 4384), +(36523, '右所乡', 4, 4384), +(36524, '大坡蒙古族乡', 4, 4384), +(36525, '大河乡', 4, 4384), +(36526, '大草乡', 4, 4384), +(36527, '巫木乡', 4, 4384), +(36528, '巴折乡', 4, 4384), +(36529, '干海乡', 4, 4384), +(36530, '平川镇', 4, 4384), +(36531, '德石乡', 4, 4384), +(36532, '树河镇', 4, 4384), +(36533, '桃子乡', 4, 4384), +(36534, '梅子坪乡', 4, 4384), +(36535, '梅雨镇', 4, 4384), +(36536, '棉垭乡', 4, 4384), +(36537, '沃底乡', 4, 4384), +(36538, '泸沽湖镇', 4, 4384), +(36539, '洼里乡', 4, 4384), +(36540, '甘塘乡', 4, 4384), +(36541, '田湾乡', 4, 4384), +(36542, '白乌镇', 4, 4384), +(36543, '盐井镇', 4, 4384), +(36544, '盐塘乡', 4, 4384), +(36545, '盖租乡', 4, 4384), +(36546, '藤桥乡', 4, 4384), +(36547, '金河乡', 4, 4384), +(36548, '长柏乡', 4, 4384), +(36549, '阿萨乡', 4, 4384), +(36550, '马鹿乡', 4, 4384), +(36551, '黄草镇', 4, 4384), +(36552, '乐约乡', 4, 4385), +(36553, '九口乡', 4, 4385), +(36554, '井叶特西乡', 4, 4385), +(36555, '佐戈依达乡', 4, 4385), +(36556, '依果觉乡', 4, 4385), +(36557, '依洛拉达乡', 4, 4385), +(36558, '候古莫乡', 4, 4385), +(36559, '候播乃拖乡', 4, 4385), +(36560, '典补乡', 4, 4385), +(36561, '农作乡', 4, 4385), +(36562, '合姑洛乡', 4, 4385), +(36563, '哈洛乡', 4, 4385), +(36564, '子威乡', 4, 4385), +(36565, '尔其乡', 4, 4385), +(36566, '尔合乡', 4, 4385), +(36567, '尼哈乡', 4, 4385), +(36568, '峨曲古乡', 4, 4385), +(36569, '巴古乡', 4, 4385), +(36570, '巴普镇', 4, 4385), +(36571, '拉木阿觉乡', 4, 4385), +(36572, '拖木乡', 4, 4385), +(36573, '柳洪乡', 4, 4385), +(36574, '树窝乡', 4, 4385), +(36575, '洒库乡', 4, 4385), +(36576, '洛俄依甘乡', 4, 4385); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36577, '洛莫依达乡', 4, 4385), +(36578, '炳途乡', 4, 4385), +(36579, '牛牛坝乡', 4, 4385), +(36580, '瓦古乡', 4, 4385), +(36581, '瓦西乡', 4, 4385), +(36582, '竹库乡', 4, 4385), +(36583, '苏洛乡', 4, 4385), +(36584, '觉洛乡', 4, 4385), +(36585, '采红乡', 4, 4385), +(36586, '龙窝乡', 4, 4385), +(36587, '龙门乡', 4, 4385), +(36588, '东城', 4, 4386), +(36589, '中坝', 4, 4386), +(36590, '佑君', 4, 4386), +(36591, '兴胜', 4, 4386), +(36592, '北城', 4, 4386), +(36593, '响水', 4, 4386), +(36594, '四合', 4, 4386), +(36595, '大兴', 4, 4386), +(36596, '大箐', 4, 4386), +(36597, '太和', 4, 4386), +(36598, '安哈', 4, 4386), +(36599, '安宁', 4, 4386), +(36600, '小庙', 4, 4386), +(36601, '川兴', 4, 4386), +(36602, '巴汝', 4, 4386), +(36603, '开元', 4, 4386), +(36604, '新村', 4, 4386), +(36605, '月华', 4, 4386), +(36606, '樟木箐', 4, 4386), +(36607, '民胜', 4, 4386), +(36608, '洛古波', 4, 4386), +(36609, '海南', 4, 4386), +(36610, '琅环', 4, 4386), +(36611, '白马', 4, 4386), +(36612, '磨盘', 4, 4386), +(36613, '礼州', 4, 4386), +(36614, '经久', 4, 4386), +(36615, '荞地', 4, 4386), +(36616, '裕隆回族', 4, 4386), +(36617, '西乡', 4, 4386), +(36618, '西城', 4, 4386), +(36619, '西溪', 4, 4386), +(36620, '西郊', 4, 4386), +(36621, '银厂', 4, 4386), +(36622, '长宁', 4, 4386), +(36623, '长安', 4, 4386), +(36624, '阿七', 4, 4386), +(36625, '马道', 4, 4386), +(36626, '马鞍山', 4, 4386), +(36627, '高枧', 4, 4386), +(36628, '高草回族', 4, 4386), +(36629, '黄水', 4, 4386), +(36630, '黄联关', 4, 4386), +(36631, '丁山乡', 4, 4387), +(36632, '中所镇', 4, 4387), +(36633, '乃托镇', 4, 4387), +(36634, '乐青地乡', 4, 4387), +(36635, '书古乡', 4, 4387), +(36636, '五里箐乡', 4, 4387), +(36637, '依洛地坝乡', 4, 4387), +(36638, '保安藏族乡', 4, 4387), +(36639, '保石乡', 4, 4387), +(36640, '南箐乡', 4, 4387), +(36641, '古二乡', 4, 4387), +(36642, '四甘普乡', 4, 4387), +(36643, '大屯乡', 4, 4387), +(36644, '大瑞乡', 4, 4387), +(36645, '大花乡', 4, 4387); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36646, '尔觉乡', 4, 4387), +(36647, '尔赛乡', 4, 4387), +(36648, '德吉乡', 4, 4387), +(36649, '拉吉乡', 4, 4387), +(36650, '拉普乡', 4, 4387), +(36651, '拉白乡', 4, 4387), +(36652, '新乡乡', 4, 4387), +(36653, '新民镇', 4, 4387), +(36654, '普雄镇', 4, 4387), +(36655, '板桥乡', 4, 4387), +(36656, '梅花乡', 4, 4387), +(36657, '河东乡', 4, 4387), +(36658, '瓦岩乡', 4, 4387), +(36659, '瓦普莫乡', 4, 4387), +(36660, '瓦曲乃乌乡', 4, 4387), +(36661, '瓦曲觉乡', 4, 4387), +(36662, '瓦里觉乡', 4, 4387), +(36663, '申普乡', 4, 4387), +(36664, '申果乡', 4, 4387), +(36665, '白果乡', 4, 4387), +(36666, '竹阿觉乡', 4, 4387), +(36667, '西山乡', 4, 4387), +(36668, '贡莫乡', 4, 4387), +(36669, '越城镇', 4, 4387), +(36670, '铁西乡', 4, 4387), +(36671, '马拖乡', 4, 4387), +(36672, '丙底乡', 4, 4388), +(36673, '丝窝乡', 4, 4388), +(36674, '依莫合乡', 4, 4388), +(36675, '依达乡', 4, 4388), +(36676, '则祖乡', 4, 4388), +(36677, '南瓦乡', 4, 4388), +(36678, '向岭乡', 4, 4388), +(36679, '土沟乡', 4, 4388), +(36680, '基觉乡', 4, 4388), +(36681, '天地坝镇', 4, 4388), +(36682, '寨子乡', 4, 4388), +(36683, '对坪镇', 4, 4388), +(36684, '小银木乡', 4, 4388), +(36685, '尔觉西乡', 4, 4388), +(36686, '山江乡', 4, 4388), +(36687, '德溪乡', 4, 4388), +(36688, '放马坪乡', 4, 4388), +(36689, '春江乡', 4, 4388), +(36690, '木府乡', 4, 4388), +(36691, '桃坪乡', 4, 4388), +(36692, '梗堡乡', 4, 4388), +(36693, '洛觉乡', 4, 4388), +(36694, '派来镇', 4, 4388), +(36695, '热柯觉乡', 4, 4388), +(36696, '热水河乡', 4, 4388), +(36697, '甲依乡', 4, 4388), +(36698, '红峰乡', 4, 4388), +(36699, '红联乡', 4, 4388), +(36700, '老寨子乡', 4, 4388), +(36701, '芦稿镇', 4, 4388), +(36702, '谷德乡', 4, 4388), +(36703, '青松乡', 4, 4388), +(36704, '马依足乡', 4, 4388), +(36705, '高峰乡', 4, 4388), +(36706, '一车乡', 4, 4389), +(36707, '上田坝乡', 4, 4389), +(36708, '中田乡', 4, 4389), +(36709, '五官乡', 4, 4389); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36710, '元宝山乡', 4, 4389), +(36711, '克觉乡', 4, 4389), +(36712, '八寨乡', 4, 4389), +(36713, '千万贯乡', 4, 4389), +(36714, '南田乡', 4, 4389), +(36715, '卡哈洛乡', 4, 4389), +(36716, '双河口乡', 4, 4389), +(36717, '咪姑乡', 4, 4389), +(36718, '回龙场乡', 4, 4389), +(36719, '坪头乡', 4, 4389), +(36720, '大坪子乡', 4, 4389), +(36721, '大岩洞乡', 4, 4389), +(36722, '小沟乡', 4, 4389), +(36723, '山棱岗乡', 4, 4389), +(36724, '岩脚乡', 4, 4389), +(36725, '巴姑乡', 4, 4389), +(36726, '帕哈乡', 4, 4389), +(36727, '拉咪乡', 4, 4389), +(36728, '斯古溪乡', 4, 4389), +(36729, '曲依乡', 4, 4389), +(36730, '杉树堡乡', 4, 4389), +(36731, '松树乡', 4, 4389), +(36732, '柑子乡', 4, 4389), +(36733, '桂花乡', 4, 4389), +(36734, '永盛乡', 4, 4389), +(36735, '汶水镇', 4, 4389), +(36736, '沙沱乡', 4, 4389), +(36737, '海湾乡', 4, 4389), +(36738, '渡口乡', 4, 4389), +(36739, '溪洛米乡', 4, 4389), +(36740, '烂坝子乡', 4, 4389), +(36741, '白铁坝乡', 4, 4389), +(36742, '箐口乡', 4, 4389), +(36743, '簸箕梁子乡', 4, 4389), +(36744, '罗山溪乡', 4, 4389), +(36745, '莫红乡', 4, 4389), +(36746, '西宁镇', 4, 4389), +(36747, '谷堆乡', 4, 4389), +(36748, '谷米乡', 4, 4389), +(36749, '锦城镇', 4, 4389), +(36750, '长河乡', 4, 4389), +(36751, '雷池乡', 4, 4389), +(36752, '顺河乡', 4, 4389), +(36753, '马湖乡', 4, 4389), +(36754, '黄琅镇', 4, 4389), +(36755, '下坝乡', 4, 4390), +(36756, '东风镇', 4, 4390), +(36757, '偏坡布依族乡', 4, 4390), +(36758, '新场乡', 4, 4390), +(36759, '新堡布依族乡', 4, 4390), +(36760, '新天街道', 4, 4390), +(36761, '朱昌镇', 4, 4390), +(36762, '水田镇', 4, 4390), +(36763, '永乐乡', 4, 4390), +(36764, '百宜乡', 4, 4390), +(36765, '羊昌镇', 4, 4390), +(36766, '金华镇', 4, 4390), +(36767, '高新路街道', 4, 4390), +(36768, '三桥路街道', 4, 4391), +(36769, '中华中路街道', 4, 4391), +(36770, '中华北路街道', 4, 4391), +(36771, '中山东路街道', 4, 4391); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36772, '中山西路街道', 4, 4391), +(36773, '北京路街道', 4, 4391), +(36774, '头桥路街道', 4, 4391), +(36775, '威清路街道', 4, 4391), +(36776, '宅吉路街道', 4, 4391), +(36777, '市西路街道', 4, 4391), +(36778, '延安中路街道', 4, 4391), +(36779, '普陀路街道', 4, 4391), +(36780, '环城北路街道', 4, 4391), +(36781, '贵乌路街道', 4, 4391), +(36782, '黔灵东路街道', 4, 4391), +(36783, '黔灵镇', 4, 4391), +(36784, '久长镇', 4, 4392), +(36785, '六屯乡', 4, 4392), +(36786, '六广镇', 4, 4392), +(36787, '六桶乡', 4, 4392), +(36788, '大石布依族乡', 4, 4392), +(36789, '小箐乡', 4, 4392), +(36790, '扎佐镇', 4, 4392), +(36791, '洒坪乡', 4, 4392), +(36792, '谷堡乡', 4, 4392), +(36793, '龙场镇', 4, 4392), +(36794, '中华南路街道', 4, 4393), +(36795, '中曹街道', 4, 4393), +(36796, '二戈寨街道', 4, 4393), +(36797, '云关乡', 4, 4393), +(36798, '兴关街道', 4, 4393), +(36799, '后巢乡', 4, 4393), +(36800, '大南门街道', 4, 4393), +(36801, '太慈桥街道', 4, 4393), +(36802, '市府路街道', 4, 4393), +(36803, '新华路街道', 4, 4393), +(36804, '沙冲街道', 4, 4393), +(36805, '河滨街道', 4, 4393), +(36806, '油榨街街道', 4, 4393), +(36807, '西湖路街道', 4, 4393), +(36808, '遵义路街道', 4, 4393), +(36809, '龙洞堡街道', 4, 4393), +(36810, '平桥社区办、', 4, 4394), +(36811, '金竹社区办', 4, 4394), +(36812, '黄河社区办', 4, 4394), +(36813, '冯三镇', 4, 4395), +(36814, '南江布依族苗族乡', 4, 4395), +(36815, '南龙乡', 4, 4395), +(36816, '双流镇', 4, 4395), +(36817, '城关镇', 4, 4395), +(36818, '宅吉乡', 4, 4395), +(36819, '楠木渡镇', 4, 4395), +(36820, '毛云乡', 4, 4395), +(36821, '永温乡', 4, 4395), +(36822, '禾丰布依族苗族乡', 4, 4395), +(36823, '米坪乡', 4, 4395), +(36824, '花梨乡', 4, 4395), +(36825, '金中镇', 4, 4395), +(36826, '高寨苗族布依族乡', 4, 4395), +(36827, '龙岗镇', 4, 4395), +(36828, '龙水乡', 4, 4395), +(36829, '九庄镇', 4, 4396); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36830, '养龙司乡', 4, 4396), +(36831, '小寨坝镇', 4, 4396), +(36832, '永靖镇', 4, 4396), +(36833, '流长乡', 4, 4396), +(36834, '温泉镇', 4, 4396), +(36835, '石硐乡', 4, 4396), +(36836, '西山乡', 4, 4396), +(36837, '青山苗族乡', 4, 4396), +(36838, '鹿窝乡', 4, 4396), +(36839, '卫城镇', 4, 4397), +(36840, '新店镇', 4, 4397), +(36841, '暗流乡', 4, 4397), +(36842, '流长苗族乡', 4, 4397), +(36843, '犁倭乡', 4, 4397), +(36844, '王庄布依族苗族乡', 4, 4397), +(36845, '百花湖乡', 4, 4397), +(36846, '站街镇', 4, 4397), +(36847, '红枫湖镇', 4, 4397), +(36848, '青龙街道', 4, 4397), +(36849, '麦格苗族布依族乡', 4, 4397), +(36850, '大山洞街道', 4, 4398), +(36851, '沙文镇', 4, 4398), +(36852, '牛场布依族乡', 4, 4398), +(36853, '艳山红街道', 4, 4398), +(36854, '艳山红镇', 4, 4398), +(36855, '都拉布依族乡', 4, 4398), +(36856, '都拉营街道', 4, 4398), +(36857, '麦架镇', 4, 4398), +(36858, '龚家寨街道', 4, 4398), +(36859, '久安乡', 4, 4399), +(36860, '党武乡', 4, 4399), +(36861, '孟关苗族布依族乡', 4, 4399), +(36862, '小碧布依族苗族乡', 4, 4399), +(36863, '清溪街道', 4, 4399), +(36864, '湖潮苗族布依族乡', 4, 4399), +(36865, '溪北街道', 4, 4399), +(36866, '燕楼乡', 4, 4399), +(36867, '石板镇', 4, 4399), +(36868, '贵筑街道', 4, 4399), +(36869, '青岩镇', 4, 4399), +(36870, '马铃布依族苗族乡', 4, 4399), +(36871, '高坡苗族乡', 4, 4399), +(36872, '麦坪乡', 4, 4399), +(36873, '黔陶布依族苗族乡', 4, 4399), +(36874, '中寨苗族彝族布依族乡', 4, 4400), +(36875, '堕却乡', 4, 4400), +(36876, '大用镇', 4, 4400), +(36877, '岩脚镇', 4, 4400), +(36878, '平寨镇', 4, 4400), +(36879, '折溪彝族乡', 4, 4400), +(36880, '新华乡', 4, 4400), +(36881, '新场乡', 4, 4400), +(36882, '新窑乡', 4, 4400), +(36883, '木岗镇', 4, 4400), +(36884, '梭嘎苗族彝族乡', 4, 4400), +(36885, '毛口布依族苗族乡', 4, 4400), +(36886, '洒志彝族布依族苗族乡', 4, 4400); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36887, '牛场苗族彝族乡', 4, 4400), +(36888, '箐口彝族仡佬族布依族乡', 4, 4400), +(36889, '落别布依族彝族乡', 4, 4400), +(36890, '郎岱镇', 4, 4400), +(36891, '陇脚布依族乡', 4, 4400), +(36892, '龙场乡', 4, 4400), +(36893, '保华苗族彝族乡', 4, 4401), +(36894, '勺米彝族苗族乡', 4, 4401), +(36895, '化乐苗族彝族乡', 4, 4401), +(36896, '南开苗族彝族乡', 4, 4401), +(36897, '双嘎彝族乡', 4, 4401), +(36898, '发箐苗族彝族乡', 4, 4401), +(36899, '发耳布依族苗族彝族乡', 4, 4401), +(36900, '坪寨彝族乡', 4, 4401), +(36901, '新街彝族苗族布依族乡', 4, 4401), +(36902, '木果彝族苗族乡', 4, 4401), +(36903, '杨梅彝族苗族回族乡', 4, 4401), +(36904, '果布嘎彝族苗族布依族乡', 4, 4401), +(36905, '比德苗族彝族乡', 4, 4401), +(36906, '滥坝镇', 4, 4401), +(36907, '猴场苗族布依族乡', 4, 4401), +(36908, '玉舍彝族苗族乡', 4, 4401), +(36909, '盐井乡', 4, 4401), +(36910, '米箩布依族苗族彝族乡', 4, 4401), +(36911, '红岩布依族彝族苗族乡', 4, 4401), +(36912, '纸厂彝族乡', 4, 4401), +(36913, '花嘎苗族布依族彝族乡', 4, 4401), +(36914, '营盘苗族彝族白族乡', 4, 4401), +(36915, '董地苗族彝族乡', 4, 4401), +(36916, '蟠龙乡', 4, 4401), +(36917, '都格布依族苗族彝族乡', 4, 4401), +(36918, '野钟苗族彝族布依族乡', 4, 4401), +(36919, '金盆苗族彝族乡', 4, 4401), +(36920, '阿嘎乡', 4, 4401), +(36921, '陡箐苗族彝族乡', 4, 4401), +(36922, '青林苗族彝族乡', 4, 4401), +(36923, '顺场苗族彝族布依族乡', 4, 4401), +(36924, '鸡场布依族彝族苗族乡', 4, 4401), +(36925, '龙场苗族白族彝族乡', 4, 4401), +(36926, '两河乡', 4, 4402), +(36927, '乐民镇', 4, 4402), +(36928, '保基苗族彝族乡', 4, 4402), +(36929, '保田镇', 4, 4402), +(36930, '刘官', 4, 4402), +(36931, '响水镇', 4, 4402), +(36932, '四格彝族乡', 4, 4402), +(36933, '坪地彝族乡', 4, 4402), +(36934, '城关镇', 4, 4402); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36935, '大山镇', 4, 4402), +(36936, '平关镇', 4, 4402), +(36937, '忠义乡', 4, 4402), +(36938, '断江镇', 4, 4402), +(36939, '新民乡', 4, 4402), +(36940, '旧营白族彝族苗族乡', 4, 4402), +(36941, '普古彝族苗族乡', 4, 4402), +(36942, '普田回族乡', 4, 4402), +(36943, '松河彝族乡', 4, 4402), +(36944, '板桥镇', 4, 4402), +(36945, '柏果镇', 4, 4402), +(36946, '民主镇', 4, 4402), +(36947, '水塘镇', 4, 4402), +(36948, '洒基镇', 4, 4402), +(36949, '淤泥彝族乡', 4, 4402), +(36950, '滑石乡', 4, 4402), +(36951, '火铺镇', 4, 4402), +(36952, '玛依镇', 4, 4402), +(36953, '珠东乡', 4, 4402), +(36954, '盘江镇', 4, 4402), +(36955, '石桥镇', 4, 4402), +(36956, '红果镇', 4, 4402), +(36957, '羊场布依族白族苗族乡', 4, 4402), +(36958, '老厂镇', 4, 4402), +(36959, '英武乡', 4, 4402), +(36960, '西冲镇', 4, 4402), +(36961, '马场彝族苗族乡', 4, 4402), +(36962, '鸡场坪彝族乡', 4, 4402), +(36963, '凤凰街道', 4, 4403), +(36964, '大河镇', 4, 4403), +(36965, '大湾镇', 4, 4403), +(36966, '德坞街道', 4, 4403), +(36967, '月照彝族回族苗族乡', 4, 4403), +(36968, '汪家寨镇', 4, 4403), +(36969, '老鹰山镇', 4, 4403), +(36970, '荷城街道', 4, 4403), +(36971, '黄土坡街道', 4, 4403), +(36972, '三岔河乡', 4, 4404), +(36973, '东皇镇', 4, 4404), +(36974, '习酒镇', 4, 4404), +(36975, '二郎乡', 4, 4404), +(36976, '二里乡', 4, 4404), +(36977, '仙源镇', 4, 4404), +(36978, '双龙乡', 4, 4404), +(36979, '同民镇', 4, 4404), +(36980, '回龙镇', 4, 4404), +(36981, '土城镇', 4, 4404), +(36982, '坭坝乡', 4, 4404), +(36983, '大坡乡', 4, 4404), +(36984, '官店镇', 4, 4404), +(36985, '寨坝镇', 4, 4404), +(36986, '桃林乡', 4, 4404), +(36987, '桑木镇', 4, 4404), +(36988, '民化乡', 4, 4404), +(36989, '永安镇', 4, 4404), +(36990, '温水镇', 4, 4404), +(36991, '程寨乡', 4, 4404), +(36992, '良村镇', 4, 4404), +(36993, '醒民镇', 4, 4404), +(36994, '隆兴镇', 4, 4404), +(36995, '三合镇', 4, 4405); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(36996, '中枢街道', 4, 4405), +(36997, '九仓镇', 4, 4405), +(36998, '二合镇', 4, 4405), +(36999, '五马镇', 4, 4405), +(37000, '合马镇', 4, 4405), +(37001, '后山苗族布依族乡', 4, 4405), +(37002, '喜头镇', 4, 4405), +(37003, '坛厂镇', 4, 4405), +(37004, '大坝镇', 4, 4405), +(37005, '学孔乡', 4, 4405), +(37006, '沙滩乡', 4, 4405), +(37007, '火石岗乡', 4, 4405), +(37008, '茅台镇', 4, 4405), +(37009, '茅坝镇', 4, 4405), +(37010, '长岗镇', 4, 4405), +(37011, '高大坪乡', 4, 4405), +(37012, '鲁班镇', 4, 4405), +(37013, '龙井乡', 4, 4405), +(37014, '关兴镇', 4, 4406), +(37015, '大乌江镇', 4, 4406), +(37016, '小腮镇', 4, 4406), +(37017, '敖溪镇', 4, 4406), +(37018, '松烟镇', 4, 4406), +(37019, '构皮滩镇', 4, 4406), +(37020, '白泥镇', 4, 4406), +(37021, '花山苗族乡', 4, 4406), +(37022, '龙家镇', 4, 4406), +(37023, '龙溪镇', 4, 4406), +(37024, '何坝乡', 4, 4407), +(37025, '土溪镇', 4, 4407), +(37026, '天桥乡', 4, 4407), +(37027, '新建乡', 4, 4407), +(37028, '永和镇', 4, 4407), +(37029, '永安镇', 4, 4407), +(37030, '王寨乡', 4, 4407), +(37031, '玡川镇', 4, 4407), +(37032, '石径乡', 4, 4407), +(37033, '绥阳镇', 4, 4407), +(37034, '花坪镇', 4, 4407), +(37035, '蜂岩镇', 4, 4407), +(37036, '进化镇', 4, 4407), +(37037, '龙泉镇', 4, 4407), +(37038, '丰乐镇', 4, 4408), +(37039, '分水乡', 4, 4408), +(37040, '大坪镇', 4, 4408), +(37041, '柏村镇', 4, 4408), +(37042, '泥高乡', 4, 4408), +(37043, '浞水镇', 4, 4408), +(37044, '涪洋镇', 4, 4408), +(37045, '石朝乡', 4, 4408), +(37046, '砚山镇', 4, 4408), +(37047, '红丝乡', 4, 4408), +(37048, '茅天镇', 4, 4408), +(37049, '蕉坝乡', 4, 4408), +(37050, '都濡镇', 4, 4408), +(37051, '镇南镇', 4, 4408), +(37052, '黄都镇', 4, 4408), +(37053, '九坝镇', 4, 4409), +(37054, '坡渡镇', 4, 4409), +(37055, '夜郎镇', 4, 4409), +(37056, '大河镇', 4, 4409), +(37057, '天坪乡', 4, 4409), +(37058, '娄山关镇', 4, 4409), +(37059, '官仓镇', 4, 4409), +(37060, '容光乡', 4, 4409); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37061, '小水乡', 4, 4409), +(37062, '新站镇', 4, 4409), +(37063, '木瓜镇', 4, 4409), +(37064, '松坎镇', 4, 4409), +(37065, '楚米镇', 4, 4409), +(37066, '水坝塘镇', 4, 4409), +(37067, '燎原镇', 4, 4409), +(37068, '狮溪镇', 4, 4409), +(37069, '羊磴镇', 4, 4409), +(37070, '芭蕉乡', 4, 4409), +(37071, '花秋镇', 4, 4409), +(37072, '茅石乡', 4, 4409), +(37073, '风水乡', 4, 4409), +(37074, '马鬃苗族乡', 4, 4409), +(37075, '高桥镇', 4, 4409), +(37076, '黄连乡', 4, 4409), +(37077, '中观镇', 4, 4410), +(37078, '乐俭乡', 4, 4410), +(37079, '俭平乡', 4, 4410), +(37080, '凤仪镇', 4, 4410), +(37081, '和溪镇', 4, 4410), +(37082, '坪镇', 4, 4410), +(37083, '安常镇', 4, 4410), +(37084, '小雅镇', 4, 4410), +(37085, '市坪苗族仡佬族乡', 4, 4410), +(37086, '庙塘镇', 4, 4410), +(37087, '新州镇', 4, 4410), +(37088, '杨兴乡', 4, 4410), +(37089, '格林镇', 4, 4410), +(37090, '桴焉乡', 4, 4410), +(37091, '流渡镇', 4, 4410), +(37092, '班竹乡', 4, 4410), +(37093, '瑞溪镇', 4, 4410), +(37094, '碧峰乡', 4, 4410), +(37095, '谢坝仡佬族苗族乡', 4, 4410), +(37096, '上海路街道', 4, 4411), +(37097, '团泽镇', 4, 4411), +(37098, '板桥镇', 4, 4411), +(37099, '泗渡镇', 4, 4411), +(37100, '洗马路街道', 4, 4411), +(37101, '董公寺镇', 4, 4411), +(37102, '高坪镇', 4, 4411), +(37103, '高桥镇', 4, 4411), +(37104, '兴隆镇', 4, 4412), +(37105, '复兴镇', 4, 4412), +(37106, '天城乡', 4, 4412), +(37107, '抄乐乡', 4, 4412), +(37108, '新南乡', 4, 4412), +(37109, '永兴镇', 4, 4412), +(37110, '洗马乡', 4, 4412), +(37111, '湄江镇', 4, 4412), +(37112, '石莲乡', 4, 4412), +(37113, '茅坪镇', 4, 4412), +(37114, '西河乡', 4, 4412), +(37115, '马山镇', 4, 4412), +(37116, '高台镇', 4, 4412), +(37117, '鱼泉镇', 4, 4412), +(37118, '黄家坝镇', 4, 4412), +(37119, '万里路街道', 4, 4413), +(37120, '中华路街道', 4, 4413), +(37121, '中山路街道', 4, 4413), +(37122, '北京路街道', 4, 4413), +(37123, '南关镇', 4, 4413); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37124, '南门关街道', 4, 4413), +(37125, '巷口镇', 4, 4413), +(37126, '延安路街道', 4, 4413), +(37127, '忠庄镇', 4, 4413), +(37128, '新蒲镇', 4, 4413), +(37129, '海龙镇', 4, 4413), +(37130, '深溪镇', 4, 4413), +(37131, '老城街道', 4, 4413), +(37132, '舟水桥街道', 4, 4413), +(37133, '金鼎山镇', 4, 4413), +(37134, '长征镇', 4, 4413), +(37135, '坪乐乡', 4, 4414), +(37136, '大路槽乡', 4, 4414), +(37137, '太白镇', 4, 4414), +(37138, '宽阔镇', 4, 4414), +(37139, '小关乡', 4, 4414), +(37140, '旺草镇', 4, 4414), +(37141, '枧坝镇', 4, 4414), +(37142, '洋川镇', 4, 4414), +(37143, '温泉镇', 4, 4414), +(37144, '茅垭镇', 4, 4414), +(37145, '蒲场镇', 4, 4414), +(37146, '郑场镇', 4, 4414), +(37147, '青棡塘镇', 4, 4414), +(37148, '风华镇', 4, 4414), +(37149, '黄杨镇', 4, 4414), +(37150, '丙安乡', 4, 4415), +(37151, '两河口乡', 4, 4415), +(37152, '元厚镇', 4, 4415), +(37153, '复兴镇', 4, 4415), +(37154, '大同镇', 4, 4415), +(37155, '天台镇', 4, 4415), +(37156, '官渡镇', 4, 4415), +(37157, '宝源乡', 4, 4415), +(37158, '市中街道', 4, 4415), +(37159, '文华街道', 4, 4415), +(37160, '旺隆镇', 4, 4415), +(37161, '白云乡', 4, 4415), +(37162, '石堡乡', 4, 4415), +(37163, '葫市镇', 4, 4415), +(37164, '金华街道', 4, 4415), +(37165, '长期镇', 4, 4415), +(37166, '长沙镇', 4, 4415), +(37167, '三桥镇', 4, 4416), +(37168, '三江镇', 4, 4416), +(37169, '上坝土家族乡', 4, 4416), +(37170, '大磏镇', 4, 4416), +(37171, '平模镇', 4, 4416), +(37172, '忠信镇', 4, 4416), +(37173, '旧城镇', 4, 4416), +(37174, '桃源乡', 4, 4416), +(37175, '棕坪乡', 4, 4416), +(37176, '河口乡', 4, 4416), +(37177, '洛龙镇', 4, 4416), +(37178, '玉溪镇', 4, 4416), +(37179, '阳溪镇', 4, 4416), +(37180, '隆兴镇', 4, 4416), +(37181, '三合镇', 4, 4417), +(37182, '三岔镇', 4, 4417), +(37183, '三渡镇', 4, 4417), +(37184, '乌江镇', 4, 4417), +(37185, '乐山镇', 4, 4417), +(37186, '南白镇', 4, 4417), +(37187, '喇叭镇', 4, 4417); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37188, '团溪镇', 4, 4417), +(37189, '尚稽镇', 4, 4417), +(37190, '山盆镇', 4, 4417), +(37191, '平正仡佬族乡', 4, 4417), +(37192, '新民镇', 4, 4417), +(37193, '新舟镇', 4, 4417), +(37194, '松林镇', 4, 4417), +(37195, '枫香镇', 4, 4417), +(37196, '毛石镇', 4, 4417), +(37197, '永乐镇', 4, 4417), +(37198, '沙湾镇', 4, 4417), +(37199, '泮水镇', 4, 4417), +(37200, '洪关苗族乡', 4, 4417), +(37201, '石板镇', 4, 4417), +(37202, '芝麻镇', 4, 4417), +(37203, '苟江镇', 4, 4417), +(37204, '茅栗镇', 4, 4417), +(37205, '虾子镇', 4, 4417), +(37206, '西坪镇', 4, 4417), +(37207, '铁厂镇', 4, 4417), +(37208, '马蹄镇', 4, 4417), +(37209, '鸭溪镇', 4, 4417), +(37210, '龙坑镇', 4, 4417), +(37211, '龙坪镇', 4, 4417), +(37212, '上关镇', 4, 4418), +(37213, '八德乡', 4, 4418), +(37214, '关索镇', 4, 4418), +(37215, '坡贡镇', 4, 4418), +(37216, '岗乌镇', 4, 4418), +(37217, '断桥镇', 4, 4418), +(37218, '新铺乡', 4, 4418), +(37219, '普利乡', 4, 4418), +(37220, '板贵乡', 4, 4418), +(37221, '永宁镇', 4, 4418), +(37222, '沙营乡', 4, 4418), +(37223, '白水镇', 4, 4418), +(37224, '花江镇', 4, 4418), +(37225, '顶云乡', 4, 4418), +(37226, '乐平乡', 4, 4419), +(37227, '十字回族苗族乡', 4, 4419), +(37228, '城关镇', 4, 4419), +(37229, '夏云镇', 4, 4419), +(37230, '天龙镇', 4, 4419), +(37231, '白云镇', 4, 4419), +(37232, '羊昌布依族苗族乡', 4, 4419), +(37233, '马场镇', 4, 4419), +(37234, '高峰镇', 4, 4419), +(37235, '齐伯乡', 4, 4419), +(37236, '化处镇', 4, 4420), +(37237, '坪上苗族彝族布依族乡', 4, 4420), +(37238, '城关镇', 4, 4420), +(37239, '猫洞苗族仡佬族乡', 4, 4420), +(37240, '猴场苗族仡佬族乡', 4, 4420), +(37241, '白岩镇', 4, 4420), +(37242, '补郎苗族乡', 4, 4420), +(37243, '马场镇', 4, 4420), +(37244, '马官镇', 4, 4420), +(37245, '鸡场坡乡', 4, 4420), +(37246, '龙场乡', 4, 4420), +(37247, '四大寨乡', 4, 4421), +(37248, '坝羊乡', 4, 4421), +(37249, '大营乡', 4, 4421); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37250, '宗地乡', 4, 4421), +(37251, '松山镇', 4, 4421), +(37252, '板当镇', 4, 4421), +(37253, '水塘镇', 4, 4421), +(37254, '火花乡', 4, 4421), +(37255, '猫营镇', 4, 4421), +(37256, '猴场镇', 4, 4421), +(37257, '白石岩乡', 4, 4421), +(37258, '达帮乡', 4, 4421), +(37259, '七眼桥镇', 4, 4422), +(37260, '东关街道', 4, 4422), +(37261, '东屯乡', 4, 4422), +(37262, '东街街道', 4, 4422), +(37263, '刘官乡', 4, 4422), +(37264, '北街街道', 4, 4422), +(37265, '华西街道', 4, 4422), +(37266, '南街街道', 4, 4422), +(37267, '双堡镇', 4, 4422), +(37268, '大西桥镇', 4, 4422), +(37269, '宁谷镇', 4, 4422), +(37270, '宋旗镇', 4, 4422), +(37271, '岩腊苗族布依族乡', 4, 4422), +(37272, '幺铺镇', 4, 4422), +(37273, '新场布依族苗族乡', 4, 4422), +(37274, '旧州镇', 4, 4422), +(37275, '杨武布依族苗族乡', 4, 4422), +(37276, '蔡官镇', 4, 4422), +(37277, '西街街道', 4, 4422), +(37278, '轿子山镇', 4, 4422), +(37279, '鸡场布依族苗族乡', 4, 4422), +(37280, '黄腊布依族苗族乡', 4, 4422), +(37281, '龙宫镇', 4, 4422), +(37282, '丁旗镇', 4, 4423), +(37283, '六马乡', 4, 4423), +(37284, '募役乡', 4, 4423), +(37285, '城关镇', 4, 4423), +(37286, '大山乡', 4, 4423), +(37287, '扁担山乡', 4, 4423), +(37288, '打帮乡', 4, 4423), +(37289, '本寨乡', 4, 4423), +(37290, '朵卜陇乡', 4, 4423), +(37291, '江龙镇', 4, 4423), +(37292, '沙子乡', 4, 4423), +(37293, '简嘎乡', 4, 4423), +(37294, '良田乡', 4, 4423), +(37295, '革利乡', 4, 4423), +(37296, '马厂乡', 4, 4423), +(37297, '黄果树镇', 4, 4423), +(37298, '万山镇', 4, 4424), +(37299, '下溪侗族乡', 4, 4424), +(37300, '熬寨侗族乡', 4, 4424), +(37301, '高楼坪侗族乡', 4, 4424), +(37302, '黄道侗族乡', 4, 4424), +(37303, '中坝乡', 4, 4425), +(37304, '刀坝乡', 4, 4425), +(37305, '合水镇', 4, 4425), +(37306, '天堂镇', 4, 4425), +(37307, '峨岭镇', 4, 4425), +(37308, '新业乡', 4, 4425), +(37309, '新寨乡', 4, 4425), +(37310, '朗溪镇', 4, 4425); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37311, '木黄镇', 4, 4425), +(37312, '杉树乡', 4, 4425), +(37313, '杨柳乡', 4, 4425), +(37314, '板溪镇', 4, 4425), +(37315, '永义乡', 4, 4425), +(37316, '沙子坡镇', 4, 4425), +(37317, '洋溪镇', 4, 4425), +(37318, '缠溪镇', 4, 4425), +(37319, '罗场乡', 4, 4425), +(37320, '共和土家族乡', 4, 4426), +(37321, '合兴土家族乡', 4, 4426), +(37322, '堰塘土家族乡', 4, 4426), +(37323, '复兴土家族苗族乡', 4, 4426), +(37324, '平原土家族乡', 4, 4426), +(37325, '枫香溪镇', 4, 4426), +(37326, '桶井土家族乡', 4, 4426), +(37327, '楠杆土家族乡', 4, 4426), +(37328, '沙溪土家族乡', 4, 4426), +(37329, '潮砥镇', 4, 4426), +(37330, '煎茶镇', 4, 4426), +(37331, '稳坪镇', 4, 4426), +(37332, '荆角土家族乡', 4, 4426), +(37333, '钱家土家族乡', 4, 4426), +(37334, '长丰土家族乡', 4, 4426), +(37335, '长堡土家族乡', 4, 4426), +(37336, '青龙镇', 4, 4426), +(37337, '高山土家族乡', 4, 4426), +(37338, '龙泉土家族乡', 4, 4426), +(37339, '三道水土家族苗族乡', 4, 4427), +(37340, '东华土家族苗族乡', 4, 4427), +(37341, '亭子坝土家族苗族乡', 4, 4427), +(37342, '兴隆土家族苗族乡', 4, 4427), +(37343, '凉水井镇', 4, 4427), +(37344, '合朋溪镇', 4, 4427), +(37345, '塘头镇', 4, 4427), +(37346, '大坝场镇', 4, 4427), +(37347, '大河坝土家族苗族乡', 4, 4427), +(37348, '天桥土家族苗族乡', 4, 4427), +(37349, '孙家坝镇', 4, 4427), +(37350, '宽坪土家族苗族乡', 4, 4427), +(37351, '张家寨镇', 4, 4427), +(37352, '思唐镇', 4, 4427), +(37353, '思林土家族苗族乡', 4, 4427), +(37354, '文家店镇', 4, 4427), +(37355, '杨家坳苗族土家族乡', 4, 4427), +(37356, '板桥苗族土家族乡', 4, 4427), +(37357, '枫芸土家族苗族乡', 4, 4427), +(37358, '瓮溪镇', 4, 4427), +(37359, '胡家湾苗族土家族乡', 4, 4427), +(37360, '许家坝镇', 4, 4427), +(37361, '邵家桥镇', 4, 4427), +(37362, '长坝苗族土家族乡', 4, 4427), +(37363, '青尪坡镇', 4, 4427); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37364, '香坝苗族土家族乡', 4, 4427), +(37365, '鹦鹉溪镇', 4, 4427), +(37366, '世昌乡', 4, 4428), +(37367, '乌罗镇', 4, 4428), +(37368, '九江乡', 4, 4428), +(37369, '冷水溪乡', 4, 4428), +(37370, '大兴镇', 4, 4428), +(37371, '大坪场镇', 4, 4428), +(37372, '大路乡', 4, 4428), +(37373, '太平营乡', 4, 4428), +(37374, '妙隘乡', 4, 4428), +(37375, '孟溪镇', 4, 4428), +(37376, '寨英镇', 4, 4428), +(37377, '平头乡', 4, 4428), +(37378, '普觉镇', 4, 4428), +(37379, '木树乡', 4, 4428), +(37380, '正大乡', 4, 4428), +(37381, '永安乡', 4, 4428), +(37382, '沙坝河乡', 4, 4428), +(37383, '牛郎镇', 4, 4428), +(37384, '瓦溪乡', 4, 4428), +(37385, '甘龙镇', 4, 4428), +(37386, '盘信镇', 4, 4428), +(37387, '盘石镇', 4, 4428), +(37388, '石梁乡', 4, 4428), +(37389, '蓼皋镇', 4, 4428), +(37390, '迓驾镇', 4, 4428), +(37391, '长兴堡镇', 4, 4428), +(37392, '长坪乡', 4, 4428), +(37393, '黄板乡', 4, 4428), +(37394, '双江镇', 4, 4429), +(37395, '坝盘土家族侗族苗族乡', 4, 4429), +(37396, '太平土家族苗族乡', 4, 4429), +(37397, '官和侗族土家族苗族乡', 4, 4429), +(37398, '德旺土家族苗族乡', 4, 4429), +(37399, '怒溪土家族苗族乡', 4, 4429), +(37400, '桃映土家族苗族乡', 4, 4429), +(37401, '民和侗族土家族苗族乡', 4, 4429), +(37402, '闵孝镇', 4, 4429), +(37403, '中寨乡', 4, 4430), +(37404, '中界乡', 4, 4430), +(37405, '和平镇', 4, 4430), +(37406, '土地坳镇', 4, 4430), +(37407, '垢坪乡', 4, 4430), +(37408, '塘坝乡', 4, 4430), +(37409, '夹石镇', 4, 4430), +(37410, '官舟镇', 4, 4430), +(37411, '客田镇', 4, 4430), +(37412, '思渠镇', 4, 4430), +(37413, '新景乡', 4, 4430), +(37414, '晓景乡', 4, 4430), +(37415, '板场乡', 4, 4430), +(37416, '沙子镇', 4, 4430), +(37417, '泉坝乡', 4, 4430), +(37418, '洪渡镇', 4, 4430), +(37419, '淇滩镇', 4, 4430), +(37420, '甘溪乡', 4, 4430), +(37421, '谯家镇', 4, 4430), +(37422, '黄土乡', 4, 4430), +(37423, '黑水乡', 4, 4430); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37424, '黑獭乡', 4, 4430), +(37425, '亚鱼乡', 4, 4431), +(37426, '大龙镇', 4, 4431), +(37427, '平溪镇', 4, 4431), +(37428, '新店乡', 4, 4431), +(37429, '朱家场镇', 4, 4431), +(37430, '田坪镇', 4, 4431), +(37431, '中坝镇', 4, 4432), +(37432, '五德镇', 4, 4432), +(37433, '国荣乡', 4, 4432), +(37434, '坪地场仡佬族侗族乡', 4, 4432), +(37435, '坪山仡佬族侗族乡', 4, 4432), +(37436, '大沙坝仡佬族侗族乡', 4, 4432), +(37437, '本庄镇', 4, 4432), +(37438, '枫香侗族仡佬族乡', 4, 4432), +(37439, '汤山镇', 4, 4432), +(37440, '河坝场乡', 4, 4432), +(37441, '甘溪仡佬族侗族乡', 4, 4432), +(37442, '白沙镇', 4, 4432), +(37443, '石固仡佬族侗族乡', 4, 4432), +(37444, '聚凤仡佬族侗族乡', 4, 4432), +(37445, '花桥镇', 4, 4432), +(37446, '青阳苗族仡佬族侗族乡', 4, 4432), +(37447, '龙井侗族仡佬族乡', 4, 4432), +(37448, '龙塘镇', 4, 4432), +(37449, '云场坪镇', 4, 4433), +(37450, '六龙山侗族土家族乡', 4, 4433), +(37451, '和平土家族侗族乡', 4, 4433), +(37452, '坝黄镇', 4, 4433), +(37453, '大坪侗族土家族苗族乡', 4, 4433), +(37454, '川硐镇', 4, 4433), +(37455, '市中街道', 4, 4433), +(37456, '桐木坪侗族乡', 4, 4433), +(37457, '河西街道', 4, 4433), +(37458, '滑石侗族苗族土家族乡', 4, 4433), +(37459, '漾头镇', 4, 4433), +(37460, '灯塔街道', 4, 4433), +(37461, '环北街道', 4, 4433), +(37462, '瓦屋侗族乡', 4, 4433), +(37463, '茶店镇', 4, 4433), +(37464, '谢桥街道', 4, 4433), +(37465, '鱼塘侗族苗族乡', 4, 4433), +(37466, '七舍镇', 4, 4434), +(37467, '万屯镇', 4, 4434), +(37468, '三江口镇', 4, 4434), +(37469, '下五屯街道', 4, 4434), +(37470, '乌沙镇', 4, 4434), +(37471, '仓更镇', 4, 4434), +(37472, '则戎乡', 4, 4434), +(37473, '坪东街道', 4, 4434), +(37474, '威舍镇', 4, 4434), +(37475, '巴结镇', 4, 4434), +(37476, '捧乍镇', 4, 4434), +(37477, '敬南镇', 4, 4434), +(37478, '桔山街道', 4, 4434), +(37479, '沧江乡', 4, 4434); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37480, '泥凼镇', 4, 4434), +(37481, '洛万乡', 4, 4434), +(37482, '清水河镇', 4, 4434), +(37483, '猪场坪乡', 4, 4434), +(37484, '白碗窑镇', 4, 4434), +(37485, '郑屯镇', 4, 4434), +(37486, '雄武乡', 4, 4434), +(37487, '顶效镇', 4, 4434), +(37488, '马岭镇', 4, 4434), +(37489, '鲁屯镇', 4, 4434), +(37490, '鲁布格镇', 4, 4434), +(37491, '黄草街道', 4, 4434), +(37492, '下山镇', 4, 4435), +(37493, '四联乡', 4, 4435), +(37494, '回龙镇', 4, 4435), +(37495, '城关镇', 4, 4435), +(37496, '大山乡', 4, 4435), +(37497, '屯脚镇', 4, 4435), +(37498, '巴铃镇', 4, 4435), +(37499, '新马场乡', 4, 4435), +(37500, '新龙场镇', 4, 4435), +(37501, '李关乡', 4, 4435), +(37502, '民建乡', 4, 4435), +(37503, '潘家庄镇', 4, 4435), +(37504, '田湾乡', 4, 4435), +(37505, '百德镇', 4, 4435), +(37506, '雨樟镇', 4, 4435), +(37507, '鲁础营回族乡', 4, 4435), +(37508, '丫他镇', 4, 4436), +(37509, '八渡镇', 4, 4436), +(37510, '冗渡镇', 4, 4436), +(37511, '坝赖镇', 4, 4436), +(37512, '坡妹镇', 4, 4436), +(37513, '威旁乡', 4, 4436), +(37514, '岩架镇', 4, 4436), +(37515, '巧马镇', 4, 4436), +(37516, '庆坪乡', 4, 4436), +(37517, '弼佑乡', 4, 4436), +(37518, '百口乡', 4, 4436), +(37519, '秧坝镇', 4, 4436), +(37520, '者楼镇', 4, 4436), +(37521, '达央乡', 4, 4436), +(37522, '万峰湖镇', 4, 4437), +(37523, '兴隆镇', 4, 4437), +(37524, '坡脚乡', 4, 4437), +(37525, '平乐乡', 4, 4437), +(37526, '德卧镇', 4, 4437), +(37527, '戈塘镇', 4, 4437), +(37528, '新安镇', 4, 4437), +(37529, '新桥镇', 4, 4437), +(37530, '普坪镇', 4, 4437), +(37531, '木咱镇', 4, 4437), +(37532, '洒雨镇', 4, 4437), +(37533, '海子乡', 4, 4437), +(37534, '笃山乡', 4, 4437), +(37535, '钱相乡', 4, 4437), +(37536, '龙山镇', 4, 4437), +(37537, '龙广镇', 4, 4437), +(37538, '三板桥镇', 4, 4438), +(37539, '地瓜镇', 4, 4438), +(37540, '新店乡', 4, 4438), +(37541, '楼下镇', 4, 4438), +(37542, '江西坡镇', 4, 4438), +(37543, '白沙乡', 4, 4438); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37544, '盘水镇', 4, 4438), +(37545, '窝沿乡', 4, 4438), +(37546, '罐子窑镇', 4, 4438), +(37547, '罗汉乡', 4, 4438), +(37548, '雪浦乡', 4, 4438), +(37549, '青山镇', 4, 4438), +(37550, '高棉乡', 4, 4438), +(37551, '龙吟镇', 4, 4438), +(37552, '三宝彝族乡', 4, 4439), +(37553, '中营镇', 4, 4439), +(37554, '光照镇', 4, 4439), +(37555, '大厂镇', 4, 4439), +(37556, '大田乡', 4, 4439), +(37557, '安谷乡', 4, 4439), +(37558, '沙子镇', 4, 4439), +(37559, '碧痕镇', 4, 4439), +(37560, '紫马乡', 4, 4439), +(37561, '花贡镇', 4, 4439), +(37562, '莲城镇', 4, 4439), +(37563, '长流乡', 4, 4439), +(37564, '马场乡', 4, 4439), +(37565, '鸡场镇', 4, 4439), +(37566, '乐元镇', 4, 4440), +(37567, '乐旺镇', 4, 4440), +(37568, '坎边乡', 4, 4440), +(37569, '复兴镇', 4, 4440), +(37570, '大观乡', 4, 4440), +(37571, '岜饶乡', 4, 4440), +(37572, '打尖乡', 4, 4440), +(37573, '打易镇', 4, 4440), +(37574, '新屯镇', 4, 4440), +(37575, '昂武乡', 4, 4440), +(37576, '桑郎镇', 4, 4440), +(37577, '油迈瑶族乡', 4, 4440), +(37578, '石屯镇', 4, 4440), +(37579, '纳夜镇', 4, 4440), +(37580, '蔗香乡', 4, 4440), +(37581, '郊纳乡', 4, 4440), +(37582, '麻山乡', 4, 4440), +(37583, '北盘江镇', 4, 4441), +(37584, '小屯乡', 4, 4441), +(37585, '平街乡', 4, 4441), +(37586, '挽漾乡', 4, 4441), +(37587, '沙坪乡', 4, 4441), +(37588, '珉谷镇', 4, 4441), +(37589, '白层镇', 4, 4441), +(37590, '者相镇', 4, 4441), +(37591, '连环乡', 4, 4441), +(37592, '长田乡', 4, 4441), +(37593, '鲁容乡', 4, 4441), +(37594, '鲁贡镇', 4, 4441), +(37595, '龙场镇', 4, 4441), +(37596, '三元彝族苗族白族乡', 4, 4442), +(37597, '东关乡', 4, 4442), +(37598, '八堡彝族苗族乡', 4, 4442), +(37599, '六龙镇', 4, 4442), +(37600, '兴隆苗族乡', 4, 4442), +(37601, '凤山彝族蒙古族乡', 4, 4442), +(37602, '双山镇', 4, 4442), +(37603, '响水白族彝族仡佬族乡', 4, 4442), +(37604, '大山苗族彝族乡', 4, 4442), +(37605, '大方镇', 4, 4442); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37606, '大水彝族苗族布依族乡', 4, 4442), +(37607, '安乐彝族仡佬族乡', 4, 4442), +(37608, '小屯乡', 4, 4442), +(37609, '文阁乡', 4, 4442), +(37610, '星宿苗族彝族仡佬族乡', 4, 4442), +(37611, '普底彝族苗族白族乡', 4, 4442), +(37612, '果瓦乡', 4, 4442), +(37613, '核桃彝族白族乡', 4, 4442), +(37614, '沙厂彝族乡', 4, 4442), +(37615, '牛场苗族彝族乡', 4, 4442), +(37616, '猫场镇', 4, 4442), +(37617, '理化苗族彝族乡', 4, 4442), +(37618, '瓢井镇', 4, 4442), +(37619, '百纳彝族乡', 4, 4442), +(37620, '竹园彝族苗族乡', 4, 4442), +(37621, '绿塘乡', 4, 4442), +(37622, '羊场镇', 4, 4442), +(37623, '达溪镇', 4, 4442), +(37624, '长石镇', 4, 4442), +(37625, '雨冲乡', 4, 4442), +(37626, '马场镇', 4, 4442), +(37627, '高店乡', 4, 4442), +(37628, '鸡场乡', 4, 4442), +(37629, '黄泥塘镇', 4, 4442), +(37630, '黄泥彝族苗族满族乡', 4, 4442), +(37631, '鼎新彝族苗族乡', 4, 4442), +(37632, '东风镇', 4, 4443), +(37633, '中水镇', 4, 4443), +(37634, '二塘镇', 4, 4443), +(37635, '云贵乡', 4, 4443), +(37636, '兔街乡', 4, 4443), +(37637, '双龙乡', 4, 4443), +(37638, '哈喇河乡', 4, 4443), +(37639, '哲觉镇', 4, 4443), +(37640, '大街乡', 4, 4443), +(37641, '小海镇', 4, 4443), +(37642, '岔河乡', 4, 4443), +(37643, '幺站镇', 4, 4443), +(37644, '斗古乡', 4, 4443), +(37645, '新发布依族乡', 4, 4443), +(37646, '板底乡', 4, 4443), +(37647, '海拉乡', 4, 4443), +(37648, '炉山镇', 4, 4443), +(37649, '牛棚镇', 4, 4443), +(37650, '猴场镇', 4, 4443), +(37651, '玉龙乡', 4, 4443), +(37652, '盐仓镇', 4, 4443), +(37653, '石门乡', 4, 4443), +(37654, '秀水乡', 4, 4443), +(37655, '羊街镇', 4, 4443), +(37656, '草海镇', 4, 4443), +(37657, '观风海镇', 4, 4443), +(37658, '迤那镇', 4, 4443), +(37659, '金斗乡', 4, 4443), +(37660, '金钟镇', 4, 4443), +(37661, '雪山镇', 4, 4443), +(37662, '麻乍乡', 4, 4443), +(37663, '黑土河乡', 4, 4443), +(37664, '黑石头镇', 4, 4443); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37665, '龙场镇', 4, 4443), +(37666, '龙街镇', 4, 4443), +(37667, '三板桥街道', 4, 4444), +(37668, '亮岩镇', 4, 4444), +(37669, '何官屯镇', 4, 4444), +(37670, '八寨镇', 4, 4444), +(37671, '千溪彝族苗族白族乡', 4, 4444), +(37672, '团结彝族苗族乡', 4, 4444), +(37673, '大屯彝族乡', 4, 4444), +(37674, '大新桥街道', 4, 4444), +(37675, '大河乡', 4, 4444), +(37676, '大银镇', 4, 4444), +(37677, '对坡镇', 4, 4444), +(37678, '小吉场镇', 4, 4444), +(37679, '小坝镇', 4, 4444), +(37680, '层台镇', 4, 4444), +(37681, '岔河镇', 4, 4444), +(37682, '市东街道', 4, 4444), +(37683, '市西街道', 4, 4444), +(37684, '撒拉溪镇', 4, 4444), +(37685, '放珠镇', 4, 4444), +(37686, '普宜镇', 4, 4444), +(37687, '朱昌镇', 4, 4444), +(37688, '杨家湾镇', 4, 4444), +(37689, '林口镇', 4, 4444), +(37690, '梨树镇', 4, 4444), +(37691, '水箐镇', 4, 4444), +(37692, '流仓桥街道', 4, 4444), +(37693, '海子街镇', 4, 4444), +(37694, '清水铺镇', 4, 4444), +(37695, '燕子口镇', 4, 4444), +(37696, '生机镇', 4, 4444), +(37697, '田坎彝族乡', 4, 4444), +(37698, '田坝桥镇', 4, 4444), +(37699, '田坝镇', 4, 4444), +(37700, '观音桥街道', 4, 4444), +(37701, '野角乡', 4, 4444), +(37702, '长春堡镇', 4, 4444), +(37703, '阴底彝族苗族白族乡', 4, 4444), +(37704, '阿市苗族彝族乡', 4, 4444), +(37705, '青场镇', 4, 4444), +(37706, '鸭池镇', 4, 4444), +(37707, '龙场营镇', 4, 4444), +(37708, '乐治镇', 4, 4445), +(37709, '勺窝乡', 4, 4445), +(37710, '化作苗族彝族乡', 4, 4445), +(37711, '厍东关彝族苗族白族乡', 4, 4445), +(37712, '姑开苗族彝族乡', 4, 4445), +(37713, '寨乐乡', 4, 4445), +(37714, '左鶂嘎彝族苗族乡', 4, 4445), +(37715, '张家湾镇', 4, 4445), +(37716, '新房彝族苗族乡', 4, 4445), +(37717, '昆寨苗族彝族白族乡', 4, 4445), +(37718, '曙光乡', 4, 4445), +(37719, '水东乡', 4, 4445), +(37720, '沙包乡', 4, 4445), +(37721, '猪场苗族彝族乡', 4, 4445), +(37722, '王家寨镇', 4, 4445); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37723, '百兴镇', 4, 4445), +(37724, '维新镇', 4, 4445), +(37725, '羊场苗族彝族乡', 4, 4445), +(37726, '老凹坝乡', 4, 4445), +(37727, '董地苗族彝族乡', 4, 4445), +(37728, '锅圈岩苗族彝族乡', 4, 4445), +(37729, '阳长镇', 4, 4445), +(37730, '雍熙镇', 4, 4445), +(37731, '鬃岭镇', 4, 4445), +(37732, '龙场镇', 4, 4445), +(37733, '三塘镇', 4, 4446), +(37734, '三甲白族苗族乡', 4, 4446), +(37735, '上坪寨乡', 4, 4446), +(37736, '中寨乡', 4, 4446), +(37737, '以那镇', 4, 4446), +(37738, '八步镇', 4, 4446), +(37739, '化起镇', 4, 4446), +(37740, '后寨苗族乡', 4, 4446), +(37741, '城关镇', 4, 4446), +(37742, '大平苗族彝族乡', 4, 4446), +(37743, '官寨苗族乡', 4, 4446), +(37744, '实兴乡', 4, 4446), +(37745, '少普乡', 4, 4446), +(37746, '普翁乡', 4, 4446), +(37747, '板桥乡', 4, 4446), +(37748, '桂果镇', 4, 4446), +(37749, '熊家场乡', 4, 4446), +(37750, '牛场镇', 4, 4446), +(37751, '猫场镇', 4, 4446), +(37752, '珠藏镇', 4, 4446), +(37753, '白泥乡', 4, 4446), +(37754, '纳雍乡', 4, 4446), +(37755, '绮陌乡', 4, 4446), +(37756, '自强苗族乡', 4, 4446), +(37757, '茶店布依族苗族彝族乡', 4, 4446), +(37758, '营合乡', 4, 4446), +(37759, '金龙苗族彝族布依族乡', 4, 4446), +(37760, '阿弓镇', 4, 4446), +(37761, '马场乡', 4, 4446), +(37762, '鸡场苗族彝族布依族乡', 4, 4446), +(37763, '黑土乡', 4, 4446), +(37764, '龙场镇', 4, 4446), +(37765, '六曲河镇', 4, 4447), +(37766, '兴发苗族彝族回族乡', 4, 4447), +(37767, '双坪彝族乡', 4, 4447), +(37768, '古基乡', 4, 4447), +(37769, '古达苗族彝族乡', 4, 4447), +(37770, '可乐彝族苗族乡', 4, 4447), +(37771, '哲庄乡', 4, 4447), +(37772, '城关镇', 4, 4447), +(37773, '妈姑镇', 4, 4447), +(37774, '威奢乡', 4, 4447), +(37775, '安乐溪乡', 4, 4447), +(37776, '平山乡', 4, 4447), +(37777, '德卓乡', 4, 4447), +(37778, '朱明乡', 4, 4447), +(37779, '松林坡白族彝族苗族乡', 4, 4447), +(37780, '水塘堡彝族苗族乡', 4, 4447); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37781, '河镇彝族苗族乡', 4, 4447), +(37782, '珠市彝族乡', 4, 4447), +(37783, '白果镇', 4, 4447), +(37784, '结构彝族苗族乡', 4, 4447), +(37785, '罗州乡', 4, 4447), +(37786, '财神镇', 4, 4447), +(37787, '辅处彝族苗族乡', 4, 4447), +(37788, '达依乡', 4, 4447), +(37789, '野马川镇', 4, 4447), +(37790, '铁匠苗族乡', 4, 4447), +(37791, '雉街彝族苗族乡', 4, 4447), +(37792, '化觉乡', 4, 4448), +(37793, '后山乡', 4, 4448), +(37794, '城关镇', 4, 4448), +(37795, '大田彝族苗族布依族乡', 4, 4448), +(37796, '太平彝族苗族乡', 4, 4448), +(37797, '安底镇', 4, 4448), +(37798, '安洛苗族彝族满族乡', 4, 4448), +(37799, '官田乡', 4, 4448), +(37800, '岚头镇', 4, 4448), +(37801, '岩孔镇', 4, 4448), +(37802, '平坝乡', 4, 4448), +(37803, '新化苗族彝族满族乡', 4, 4448), +(37804, '木孔乡', 4, 4448), +(37805, '桂花乡', 4, 4448), +(37806, '沙土镇', 4, 4448), +(37807, '清池镇', 4, 4448), +(37808, '源村乡', 4, 4448), +(37809, '石场苗族彝族乡', 4, 4448), +(37810, '禹谟镇', 4, 4448), +(37811, '箐门苗族彝族仡佬族乡', 4, 4448), +(37812, '茶园乡', 4, 4448), +(37813, '西洛乡', 4, 4448), +(37814, '长坝乡', 4, 4448), +(37815, '马路彝族苗族乡', 4, 4448), +(37816, '高坪乡', 4, 4448), +(37817, '龙坝乡', 4, 4448), +(37818, '中坪镇', 4, 4449), +(37819, '中建苗族彝族乡', 4, 4449), +(37820, '五里布依族苗族乡', 4, 4449), +(37821, '仁和彝族苗族乡', 4, 4449), +(37822, '协和彝族苗族乡', 4, 4449), +(37823, '城关镇', 4, 4449), +(37824, '大关镇', 4, 4449), +(37825, '太来彝族苗族乡', 4, 4449), +(37826, '定新彝族苗族乡', 4, 4449), +(37827, '新仁苗族乡', 4, 4449), +(37828, '林泉镇', 4, 4449), +(37829, '永燊彝族苗族乡', 4, 4449), +(37830, '沙井苗族彝族仡佬族乡', 4, 4449), +(37831, '洪水乡', 4, 4449), +(37832, '甘棠乡', 4, 4449), +(37833, '素朴镇', 4, 4449), +(37834, '红林彝族苗族乡', 4, 4449), +(37835, '绿化白族彝族乡', 4, 4449); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37836, '羊场乡', 4, 4449), +(37837, '花溪彝族苗族乡', 4, 4449), +(37838, '谷里镇', 4, 4449), +(37839, '重新镇', 4, 4449), +(37840, '金坡苗族彝族满族乡', 4, 4449), +(37841, '金碧镇', 4, 4449), +(37842, '钟山布依族彝族乡', 4, 4449), +(37843, '铁古苗族彝族乡', 4, 4449), +(37844, '锦星乡', 4, 4449), +(37845, '雨朵镇', 4, 4449), +(37846, '八弓镇', 4, 4450), +(37847, '台烈镇', 4, 4450), +(37848, '桐林镇', 4, 4450), +(37849, '款场乡', 4, 4450), +(37850, '滚马乡', 4, 4450), +(37851, '瓦寨镇', 4, 4450), +(37852, '良上乡', 4, 4450), +(37853, '长吉乡', 4, 4450), +(37854, '雪洞镇', 4, 4450), +(37855, '兴仁镇', 4, 4451), +(37856, '南皋乡', 4, 4451), +(37857, '扬武乡', 4, 4451), +(37858, '排调镇', 4, 4451), +(37859, '长青乡', 4, 4451), +(37860, '雅灰乡', 4, 4451), +(37861, '龙泉镇', 4, 4451), +(37862, '下江镇', 4, 4452), +(37863, '丙妹镇', 4, 4452), +(37864, '东朗乡', 4, 4452), +(37865, '停洞镇', 4, 4452), +(37866, '光辉乡', 4, 4452), +(37867, '刚边壮族乡', 4, 4452), +(37868, '加勉乡', 4, 4452), +(37869, '加榜乡', 4, 4452), +(37870, '加鸠乡', 4, 4452), +(37871, '宰便镇', 4, 4452), +(37872, '庆云乡', 4, 4452), +(37873, '往洞乡', 4, 4452), +(37874, '斗里乡', 4, 4452), +(37875, '洛香镇', 4, 4452), +(37876, '秀塘壮族乡', 4, 4452), +(37877, '翠里瑶族壮族乡', 4, 4452), +(37878, '西山镇', 4, 4452), +(37879, '谷坪乡', 4, 4452), +(37880, '贯洞镇', 4, 4452), +(37881, '雍里乡', 4, 4452), +(37882, '高增乡', 4, 4452), +(37883, '万潮镇', 4, 4453), +(37884, '三棵树镇', 4, 4453), +(37885, '凯棠乡', 4, 4453), +(37886, '城西街道', 4, 4453), +(37887, '大十字街道', 4, 4453), +(37888, '大风洞乡', 4, 4453), +(37889, '旁海镇', 4, 4453), +(37890, '洗马河街道', 4, 4453), +(37891, '湾水镇', 4, 4453), +(37892, '湾溪街道', 4, 4453), +(37893, '炉山镇', 4, 4453), +(37894, '舟溪镇', 4, 4453), +(37895, '西门街道', 4, 4453), +(37896, '鸭塘镇', 4, 4453), +(37897, '龙场镇', 4, 4453); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37898, '久仰乡', 4, 4454), +(37899, '南加镇', 4, 4454), +(37900, '南哨乡', 4, 4454), +(37901, '南寨乡', 4, 4454), +(37902, '南明镇', 4, 4454), +(37903, '太拥乡', 4, 4454), +(37904, '岑松镇', 4, 4454), +(37905, '敏洞乡', 4, 4454), +(37906, '柳川镇', 4, 4454), +(37907, '磻溪乡', 4, 4454), +(37908, '观么乡', 4, 4454), +(37909, '革东镇', 4, 4454), +(37910, '南宫乡', 4, 4455), +(37911, '台拱镇', 4, 4455), +(37912, '台盘乡', 4, 4455), +(37913, '排羊乡', 4, 4455), +(37914, '方召乡', 4, 4455), +(37915, '施洞镇', 4, 4455), +(37916, '老屯乡', 4, 4455), +(37917, '革一乡', 4, 4455), +(37918, '兰田镇', 4, 4456), +(37919, '凤城镇', 4, 4456), +(37920, '地湖乡', 4, 4456), +(37921, '坌处镇', 4, 4456), +(37922, '坪地镇', 4, 4456), +(37923, '江东乡', 4, 4456), +(37924, '注溪乡', 4, 4456), +(37925, '渡马乡', 4, 4456), +(37926, '瓮洞镇', 4, 4456), +(37927, '白市镇', 4, 4456), +(37928, '石洞镇', 4, 4456), +(37929, '社学乡', 4, 4456), +(37930, '竹林乡', 4, 4456), +(37931, '远口镇', 4, 4456), +(37932, '邦洞镇', 4, 4456), +(37933, '高酿镇', 4, 4456), +(37934, '凯本乡', 4, 4457), +(37935, '大有乡', 4, 4457), +(37936, '天星乡', 4, 4457), +(37937, '天马镇', 4, 4457), +(37938, '客楼乡', 4, 4457), +(37939, '平庄乡', 4, 4457), +(37940, '思旸镇', 4, 4457), +(37941, '水尾镇', 4, 4457), +(37942, '注溪乡', 4, 4457), +(37943, '羊桥土家族乡', 4, 4457), +(37944, '龙田镇', 4, 4457), +(37945, '双井镇', 4, 4458), +(37946, '城关镇', 4, 4458), +(37947, '杨柳塘镇', 4, 4458), +(37948, '牛大场镇', 4, 4458), +(37949, '甘溪乡', 4, 4458), +(37950, '白垛乡', 4, 4458), +(37951, '马号乡', 4, 4458), +(37952, '马溪乡', 4, 4458), +(37953, '三江水族乡', 4, 4459), +(37954, '两汪乡', 4, 4459), +(37955, '乐里镇', 4, 4459), +(37956, '仁里水族乡', 4, 4459), +(37957, '八开乡', 4, 4459), +(37958, '兴华水族乡', 4, 4459), +(37959, '古州镇', 4, 4459), +(37960, '塔石瑶族水族乡', 4, 4459), +(37961, '定威水族乡', 4, 4459); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(37962, '寨蒿镇', 4, 4459), +(37963, '崇义乡', 4, 4459), +(37964, '平永镇', 4, 4459), +(37965, '平江乡', 4, 4459), +(37966, '平阳乡', 4, 4459), +(37967, '忠诚镇', 4, 4459), +(37968, '朗洞镇', 4, 4459), +(37969, '栽麻乡', 4, 4459), +(37970, '水尾水族乡', 4, 4459), +(37971, '计划乡', 4, 4459), +(37972, '车江乡', 4, 4459), +(37973, '三江镇', 4, 4460), +(37974, '偶里乡', 4, 4460), +(37975, '启蒙镇', 4, 4460), +(37976, '固本乡', 4, 4460), +(37977, '大同乡', 4, 4460), +(37978, '平略镇', 4, 4460), +(37979, '平秋镇', 4, 4460), +(37980, '彦洞乡', 4, 4460), +(37981, '敦寨镇', 4, 4460), +(37982, '新化乡', 4, 4460), +(37983, '河口乡', 4, 4460), +(37984, '茅坪镇', 4, 4460), +(37985, '钟灵乡', 4, 4460), +(37986, '铜鼓镇', 4, 4460), +(37987, '隆里乡', 4, 4460), +(37988, '大地乡', 4, 4461), +(37989, '尚寨土家族乡', 4, 4461), +(37990, '报京乡', 4, 4461), +(37991, '江古乡', 4, 4461), +(37992, '涌溪乡', 4, 4461), +(37993, '羊场镇', 4, 4461), +(37994, '羊坪镇', 4, 4461), +(37995, '蕉溪镇', 4, 4461), +(37996, '都坪镇', 4, 4461), +(37997, '金堡乡', 4, 4461), +(37998, '阳镇', 4, 4461), +(37999, '青溪镇', 4, 4461), +(38000, '丹江镇', 4, 4462), +(38001, '大塘乡', 4, 4462), +(38002, '方祥乡', 4, 4462), +(38003, '望丰乡', 4, 4462), +(38004, '桃江乡', 4, 4462), +(38005, '永乐镇', 4, 4462), +(38006, '西江镇', 4, 4462), +(38007, '达地水族乡', 4, 4462), +(38008, '郎德镇', 4, 4462), +(38009, '下司镇', 4, 4463), +(38010, '坝芒布依族乡', 4, 4463), +(38011, '宣威镇', 4, 4463), +(38012, '景阳布依族乡', 4, 4463), +(38013, '杏山镇', 4, 4463), +(38014, '碧波乡', 4, 4463), +(38015, '谷硐镇', 4, 4463), +(38016, '贤昌布依族乡', 4, 4463), +(38017, '龙山乡', 4, 4463), +(38018, '一碗水乡', 4, 4464), +(38019, '上塘乡', 4, 4464), +(38020, '平溪镇', 4, 4464), +(38021, '新州镇', 4, 4464), +(38022, '旧州镇', 4, 4464), +(38023, '浪洞乡', 4, 4464), +(38024, '纸房乡', 4, 4464), +(38025, '翁坪乡', 4, 4464); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38026, '苗陇乡', 4, 4464), +(38027, '谷陇镇', 4, 4464), +(38028, '重兴乡', 4, 4464), +(38029, '重安镇', 4, 4464), +(38030, '野洞河乡', 4, 4464), +(38031, '黄飘乡', 4, 4464), +(38032, '中潮镇', 4, 4465), +(38033, '九潮镇', 4, 4465), +(38034, '双江乡', 4, 4465), +(38035, '口江乡', 4, 4465), +(38036, '地坪乡', 4, 4465), +(38037, '坝寨乡', 4, 4465), +(38038, '大稼乡', 4, 4465), +(38039, '孟彦镇', 4, 4465), +(38040, '尚重镇', 4, 4465), +(38041, '岩洞镇', 4, 4465), +(38042, '平寨乡', 4, 4465), +(38043, '德凤镇', 4, 4465), +(38044, '德化乡', 4, 4465), +(38045, '德顺乡', 4, 4465), +(38046, '敖市镇', 4, 4465), +(38047, '水口镇', 4, 4465), +(38048, '永从乡', 4, 4465), +(38049, '洪州镇', 4, 4465), +(38050, '罗里乡', 4, 4465), +(38051, '肇兴乡', 4, 4465), +(38052, '茅贡乡', 4, 4465), +(38053, '雷洞瑶族水族乡', 4, 4465), +(38054, '顺化瑶族乡', 4, 4465), +(38055, '高屯镇', 4, 4465), +(38056, '龙额乡', 4, 4465), +(38057, '三合镇', 4, 4466), +(38058, '三洞乡', 4, 4466), +(38059, '中和镇', 4, 4466), +(38060, '丰乐镇', 4, 4466), +(38061, '九阡镇', 4, 4466), +(38062, '交梨乡', 4, 4466), +(38063, '合江镇', 4, 4466), +(38064, '周覃镇', 4, 4466), +(38065, '坝街乡', 4, 4466), +(38066, '塘州乡', 4, 4466), +(38067, '大河镇', 4, 4466), +(38068, '巫不乡', 4, 4466), +(38069, '廷牌镇', 4, 4466), +(38070, '恒丰乡', 4, 4466), +(38071, '打鱼乡', 4, 4466), +(38072, '拉揽乡', 4, 4466), +(38073, '普安镇', 4, 4466), +(38074, '杨拱乡', 4, 4466), +(38075, '水龙乡', 4, 4466), +(38076, '羊福乡', 4, 4466), +(38077, '都江镇', 4, 4466), +(38078, '克度镇', 4, 4467), +(38079, '卡罗乡', 4, 4467), +(38080, '卡蒲毛南族乡', 4, 4467), +(38081, '四寨镇', 4, 4467), +(38082, '塘边镇', 4, 4467), +(38083, '大塘镇', 4, 4467), +(38084, '平湖镇', 4, 4467), +(38085, '掌布乡', 4, 4467), +(38086, '摆茹镇', 4, 4467), +(38087, '新塘乡', 4, 4467), +(38088, '牙舟镇', 4, 4467), +(38089, '甘寨乡', 4, 4467), +(38090, '白龙乡', 4, 4467); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38091, '者密镇', 4, 4467), +(38092, '苗二河乡', 4, 4467), +(38093, '西凉乡', 4, 4467), +(38094, '谷洞乡', 4, 4467), +(38095, '通州镇', 4, 4467), +(38096, '鼠场乡', 4, 4467), +(38097, '三都镇', 4, 4468), +(38098, '和平镇', 4, 4468), +(38099, '大坝乡', 4, 4468), +(38100, '大龙乡', 4, 4468), +(38101, '太阳乡', 4, 4468), +(38102, '好花红乡', 4, 4468), +(38103, '宁旺乡', 4, 4468), +(38104, '岗度乡', 4, 4468), +(38105, '打引乡', 4, 4468), +(38106, '抵季乡', 4, 4468), +(38107, '抵麻乡', 4, 4468), +(38108, '摆榜乡', 4, 4468), +(38109, '摆金镇', 4, 4468), +(38110, '斗底乡', 4, 4468), +(38111, '断杉镇', 4, 4468), +(38112, '王佑镇', 4, 4468), +(38113, '甲戎乡', 4, 4468), +(38114, '甲烈乡', 4, 4468), +(38115, '羡塘乡', 4, 4468), +(38116, '芦山镇', 4, 4468), +(38117, '长安乡', 4, 4468), +(38118, '长田乡', 4, 4468), +(38119, '雅水镇', 4, 4468), +(38120, '高镇镇', 4, 4468), +(38121, '鸭绒乡', 4, 4468), +(38122, '上司镇', 4, 4469), +(38123, '下司镇', 4, 4469), +(38124, '兔场镇', 4, 4469), +(38125, '城关镇', 4, 4469), +(38126, '基长镇', 4, 4469), +(38127, '尧梭乡', 4, 4469), +(38128, '尧棒乡', 4, 4469), +(38129, '打羊乡', 4, 4469), +(38130, '本寨水族乡', 4, 4469), +(38131, '水岩乡', 4, 4469), +(38132, '甲定水族乡', 4, 4469), +(38133, '甲里镇', 4, 4469), +(38134, '羊凤乡', 4, 4469), +(38135, '翁台水族乡', 4, 4469), +(38136, '董岭乡', 4, 4469), +(38137, '麻万镇', 4, 4469), +(38138, '麻尾镇', 4, 4469), +(38139, '黄后乡', 4, 4469), +(38140, '中坪镇', 4, 4470), +(38141, '天文镇', 4, 4470), +(38142, '小河山乡', 4, 4470), +(38143, '岚关乡', 4, 4470), +(38144, '平定营镇', 4, 4470), +(38145, '建中镇', 4, 4470), +(38146, '木引槽乡', 4, 4470), +(38147, '木老坪乡', 4, 4470), +(38148, '松坪乡', 4, 4470), +(38149, '永和镇', 4, 4470), +(38150, '渔河乡', 4, 4470), +(38151, '牛场乡', 4, 4470), +(38152, '玉华乡', 4, 4470), +(38153, '玉山镇', 4, 4470), +(38154, '珠藏镇', 4, 4470), +(38155, '白沙乡', 4, 4470); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38156, '老坟嘴乡', 4, 4470), +(38157, '草塘镇', 4, 4470), +(38158, '铜锣乡', 4, 4470), +(38159, '银盏乡', 4, 4470), +(38160, '雍阳镇', 4, 4470), +(38161, '高水乡', 4, 4470), +(38162, '龙塘乡', 4, 4470), +(38163, '仙桥乡', 4, 4471), +(38164, '兴隆乡', 4, 4471), +(38165, '凤山镇', 4, 4471), +(38166, '地松镇', 4, 4471), +(38167, '城厢镇', 4, 4471), +(38168, '岔河乡', 4, 4471), +(38169, '牛场镇', 4, 4471), +(38170, '藜山乡', 4, 4471), +(38171, '谷汪乡', 4, 4471), +(38172, '道坪镇', 4, 4471), +(38173, '金山街道', 4, 4471), +(38174, '陆坪镇', 4, 4471), +(38175, '马场坪街道', 4, 4471), +(38176, '高坪镇', 4, 4471), +(38177, '高石乡', 4, 4471), +(38178, '黄丝镇', 4, 4471), +(38179, '龙昌镇', 4, 4471), +(38180, '云干乡', 4, 4472), +(38181, '交砚乡', 4, 4472), +(38182, '八总乡', 4, 4472), +(38183, '凤亭乡', 4, 4472), +(38184, '大亭乡', 4, 4472), +(38185, '平岩乡', 4, 4472), +(38186, '木引乡', 4, 4472), +(38187, '板庚乡', 4, 4472), +(38188, '栗木乡', 4, 4472), +(38189, '沟亭乡', 4, 4472), +(38190, '沫阳镇', 4, 4472), +(38191, '班仁乡', 4, 4472), +(38192, '红水河镇', 4, 4472), +(38193, '纳坪乡', 4, 4472), +(38194, '罗妥乡', 4, 4472), +(38195, '罗悃镇', 4, 4472), +(38196, '罗暮乡', 4, 4472), +(38197, '罗沙乡', 4, 4472), +(38198, '罗苏乡', 4, 4472), +(38199, '茂井镇', 4, 4472), +(38200, '董当乡', 4, 4472), +(38201, '董架乡', 4, 4472), +(38202, '董王乡', 4, 4472), +(38203, '边阳镇', 4, 4472), +(38204, '逢亭镇', 4, 4472), +(38205, '龙坪镇', 4, 4472), +(38206, '佳荣镇', 4, 4473), +(38207, '捞村乡', 4, 4473), +(38208, '播尧乡', 4, 4473), +(38209, '方村乡', 4, 4473), +(38210, '朝阳镇', 4, 4473), +(38211, '水利水族乡', 4, 4473), +(38212, '水尧水族乡', 4, 4473), +(38213, '永康水族乡', 4, 4473), +(38214, '洞塘乡', 4, 4473), +(38215, '玉屏镇', 4, 4473), +(38216, '瑶山瑶族乡', 4, 4473), +(38217, '瑶麓瑶族乡', 4, 4473), +(38218, '甲良镇', 4, 4473), +(38219, '立化镇', 4, 4473); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38220, '翁昂乡', 4, 4473), +(38221, '茂兰镇', 4, 4473), +(38222, '驾欧乡', 4, 4473), +(38223, '云雾镇', 4, 4474), +(38224, '城关镇', 4, 4474), +(38225, '定东乡', 4, 4474), +(38226, '定南乡', 4, 4474), +(38227, '岩下乡', 4, 4474), +(38228, '巩固乡', 4, 4474), +(38229, '德新镇', 4, 4474), +(38230, '抱管乡', 4, 4474), +(38231, '新巴镇', 4, 4474), +(38232, '新铺乡', 4, 4474), +(38233, '旧治镇', 4, 4474), +(38234, '昌明镇', 4, 4474), +(38235, '沿山镇', 4, 4474), +(38236, '洛北河乡', 4, 4474), +(38237, '猴场堡乡', 4, 4474), +(38238, '盘江镇', 4, 4474), +(38239, '窑上乡', 4, 4474), +(38240, '都六乡', 4, 4474), +(38241, '铁厂乡', 4, 4474), +(38242, '马场河乡', 4, 4474), +(38243, '凯口镇', 4, 4475), +(38244, '坝固镇', 4, 4475), +(38245, '基场水族乡', 4, 4475), +(38246, '墨冲镇', 4, 4475), +(38247, '大坪镇', 4, 4475), +(38248, '奉合水族乡', 4, 4475), +(38249, '小围寨街道', 4, 4475), +(38250, '平浪镇', 4, 4475), +(38251, '广惠路街道', 4, 4475), +(38252, '摆忙乡', 4, 4475), +(38253, '文峰路街道', 4, 4475), +(38254, '新华路街道', 4, 4475), +(38255, '杨柳街镇', 4, 4475), +(38256, '江洲镇', 4, 4475), +(38257, '沙包堡街道', 4, 4475), +(38258, '沙寨乡', 4, 4475), +(38259, '河阳乡', 4, 4475), +(38260, '洛帮镇', 4, 4475), +(38261, '王司镇', 4, 4475), +(38262, '甘塘镇', 4, 4475), +(38263, '石龙乡', 4, 4475), +(38264, '良亩乡', 4, 4475), +(38265, '阳和水族乡', 4, 4475), +(38266, '中坝乡', 4, 4476), +(38267, '交麻乡', 4, 4476), +(38268, '代化镇', 4, 4476), +(38269, '凯佐乡', 4, 4476), +(38270, '威远镇', 4, 4476), +(38271, '广顺镇', 4, 4476), +(38272, '摆塘乡', 4, 4476), +(38273, '摆所镇', 4, 4476), +(38274, '改尧镇', 4, 4476), +(38275, '敦操乡', 4, 4476), +(38276, '新寨乡', 4, 4476), +(38277, '睦化乡', 4, 4476), +(38278, '种获乡', 4, 4476), +(38279, '营盘乡', 4, 4476), +(38280, '长寨镇', 4, 4476), +(38281, '马路乡', 4, 4476), +(38282, '鼓扬镇', 4, 4476), +(38283, '三元镇', 4, 4477); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38284, '哪旁乡', 4, 4477), +(38285, '巴江乡', 4, 4477), +(38286, '摆省乡', 4, 4477), +(38287, '水场乡', 4, 4477), +(38288, '洗马镇', 4, 4477), +(38289, '湾寨乡', 4, 4477), +(38290, '羊场镇', 4, 4477), +(38291, '草原乡', 4, 4477), +(38292, '谷脚镇', 4, 4477), +(38293, '谷龙乡', 4, 4477), +(38294, '醒狮镇', 4, 4477), +(38295, '麻芝乡', 4, 4477), +(38296, '龙山镇', 4, 4477), +(38297, '乌龙镇', 4, 4478), +(38298, '因民镇', 4, 4478), +(38299, '拖布卡镇', 4, 4478), +(38300, '汤丹镇', 4, 4478), +(38301, '红土地镇', 4, 4478), +(38302, '舍块乡', 4, 4478), +(38303, '铜都镇', 4, 4478), +(38304, '阿旺镇', 4, 4478), +(38305, '丰宁街道', 4, 4479), +(38306, '华山街道', 4, 4479), +(38307, '厂口乡', 4, 4479), +(38308, '大观街道', 4, 4479), +(38309, '护国街道', 4, 4479), +(38310, '普吉街道', 4, 4479), +(38311, '沙朗白族乡', 4, 4479), +(38312, '红云街道', 4, 4479), +(38313, '莲华街道', 4, 4479), +(38314, '黑林铺街道', 4, 4479), +(38315, '龙翔街道', 4, 4479), +(38316, '七甸乡', 4, 4480), +(38317, '吴家营乡', 4, 4480), +(38318, '大渔乡', 4, 4480), +(38319, '斗南镇', 4, 4480), +(38320, '洛羊镇', 4, 4480), +(38321, '马金铺乡', 4, 4480), +(38322, '龙城镇', 4, 4480), +(38323, '八街镇', 4, 4481), +(38324, '县街镇', 4, 4481), +(38325, '太平镇', 4, 4481), +(38326, '温泉镇', 4, 4481), +(38327, '禄脿镇', 4, 4481), +(38328, '草铺镇', 4, 4481), +(38329, '连然镇', 4, 4481), +(38330, '青龙镇', 4, 4481), +(38331, '东站街道', 4, 4482), +(38332, '六甲乡', 4, 4482), +(38333, '关上街道', 4, 4482), +(38334, '大板桥镇', 4, 4482), +(38335, '太和街道', 4, 4482), +(38336, '官渡镇', 4, 4482), +(38337, '小板桥镇', 4, 4482), +(38338, '矣六乡', 4, 4482), +(38339, '金马街道', 4, 4482), +(38340, '阿拉彝族乡', 4, 4482), +(38341, '九乡彝族回族乡', 4, 4483), +(38342, '北古城镇', 4, 4483), +(38343, '匡远镇', 4, 4483), +(38344, '南羊镇', 4, 4483), +(38345, '汤池镇', 4, 4483), +(38346, '狗街镇', 4, 4483); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38347, '竹山乡', 4, 4483), +(38348, '耿家营彝族苗族乡', 4, 4483), +(38349, '马街乡', 4, 4483), +(38350, '东村乡', 4, 4484), +(38351, '大营镇', 4, 4484), +(38352, '散旦乡', 4, 4484), +(38353, '款庄乡', 4, 4484), +(38354, '永定镇', 4, 4484), +(38355, '罗免彝族苗族乡', 4, 4484), +(38356, '赤鹫乡', 4, 4484), +(38357, '七星乡', 4, 4485), +(38358, '仁德镇', 4, 4485), +(38359, '倘甸镇', 4, 4485), +(38360, '先锋乡', 4, 4485), +(38361, '六哨乡', 4, 4485), +(38362, '功山镇', 4, 4485), +(38363, '塘子镇', 4, 4485), +(38364, '柯渡镇', 4, 4485), +(38365, '河口乡', 4, 4485), +(38366, '甸沙乡', 4, 4485), +(38367, '羊街镇', 4, 4485), +(38368, '联合乡', 4, 4485), +(38369, '金所乡', 4, 4485), +(38370, '金源乡', 4, 4485), +(38371, '风仪乡', 4, 4485), +(38372, '鸡街乡', 4, 4485), +(38373, '小街镇', 4, 4486), +(38374, '嵩阳镇', 4, 4486), +(38375, '杨林镇', 4, 4486), +(38376, '杨桥乡', 4, 4486), +(38377, '滇源镇', 4, 4486), +(38378, '牛栏江镇', 4, 4486), +(38379, '阿子营乡', 4, 4486), +(38380, '上蒜乡', 4, 4487), +(38381, '二街乡', 4, 4487), +(38382, '六街乡', 4, 4487), +(38383, '双河彝族乡', 4, 4487), +(38384, '夕阳彝族乡', 4, 4487), +(38385, '宝峰镇', 4, 4487), +(38386, '新街乡', 4, 4487), +(38387, '昆阳镇', 4, 4487), +(38388, '晋城镇', 4, 4487), +(38389, '东华街道', 4, 4488), +(38390, '双龙乡', 4, 4488), +(38391, '拓东街道', 4, 4488), +(38392, '松华乡', 4, 4488), +(38393, '联盟街道', 4, 4488), +(38394, '茨坝街道', 4, 4488), +(38395, '金辰街道', 4, 4488), +(38396, '青云街道', 4, 4488), +(38397, '鼓楼街道', 4, 4488), +(38398, '龙泉街道', 4, 4488), +(38399, '圭山镇', 4, 4489), +(38400, '大可乡', 4, 4489), +(38401, '板桥镇', 4, 4489), +(38402, '石林镇', 4, 4489), +(38403, '西街口镇', 4, 4489), +(38404, '路美邑镇', 4, 4489), +(38405, '长湖镇', 4, 4489), +(38406, '鹿阜镇', 4, 4489), +(38407, '中屏乡', 4, 4490), +(38408, '乌蒙乡', 4, 4490), +(38409, '九龙乡', 4, 4490); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38410, '云龙乡', 4, 4490), +(38411, '则黑乡', 4, 4490), +(38412, '团街乡', 4, 4490), +(38413, '大松树乡', 4, 4490), +(38414, '屏山镇', 4, 4490), +(38415, '撒营盘镇', 4, 4490), +(38416, '汤郎乡', 4, 4490), +(38417, '皎西乡', 4, 4490), +(38418, '翠华乡', 4, 4490), +(38419, '茂山乡', 4, 4490), +(38420, '转龙镇', 4, 4490), +(38421, '雪山乡', 4, 4490), +(38422, '马鹿塘乡', 4, 4490), +(38423, '前卫街道', 4, 4491), +(38424, '团结镇', 4, 4491), +(38425, '棕树营街道', 4, 4491), +(38426, '永昌街道', 4, 4491), +(38427, '海口镇', 4, 4491), +(38428, '碧鸡镇', 4, 4491), +(38429, '福海街道', 4, 4491), +(38430, '金碧街道', 4, 4491), +(38431, '马街街道', 4, 4491), +(38432, '上村乡', 4, 4492), +(38433, '乐业镇', 4, 4492), +(38434, '五星乡', 4, 4492), +(38435, '大井镇', 4, 4492), +(38436, '大桥乡', 4, 4492), +(38437, '大海乡', 4, 4492), +(38438, '娜姑镇', 4, 4492), +(38439, '待补镇', 4, 4492), +(38440, '新街回族乡', 4, 4492), +(38441, '火红乡', 4, 4492), +(38442, '田坝乡', 4, 4492), +(38443, '矿山镇', 4, 4492), +(38444, '纸厂乡', 4, 4492), +(38445, '老厂乡', 4, 4492), +(38446, '者海镇', 4, 4492), +(38447, '迤车镇', 4, 4492), +(38448, '金钟镇', 4, 4492), +(38449, '雨碌乡', 4, 4492), +(38450, '马路乡', 4, 4492), +(38451, '驾车乡', 4, 4492), +(38452, '鲁纳乡', 4, 4492), +(38453, '东山镇', 4, 4493), +(38454, '乐丰乡', 4, 4493), +(38455, '倘塘镇', 4, 4493), +(38456, '务德镇', 4, 4493), +(38457, '双河乡', 4, 4493), +(38458, '双龙街道', 4, 4493), +(38459, '宛水街道', 4, 4493), +(38460, '宝山镇', 4, 4493), +(38461, '得禄乡', 4, 4493), +(38462, '文兴乡', 4, 4493), +(38463, '普立乡', 4, 4493), +(38464, '来宾镇', 4, 4493), +(38465, '杨柳乡', 4, 4493), +(38466, '板桥镇', 4, 4493), +(38467, '格宜镇', 4, 4493), +(38468, '海岱镇', 4, 4493), +(38469, '热水镇', 4, 4493), +(38470, '田坝镇', 4, 4493), +(38471, '羊场镇', 4, 4493), +(38472, '落水镇', 4, 4493), +(38473, '虹桥街道', 4, 4493); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38474, '西宁街道', 4, 4493), +(38475, '西泽乡', 4, 4493), +(38476, '阿都乡', 4, 4493), +(38477, '龙场镇', 4, 4493), +(38478, '龙潭镇', 4, 4493), +(38479, '中安镇', 4, 4494), +(38480, '古敢水族乡', 4, 4494), +(38481, '后所镇', 4, 4494), +(38482, '墨红镇', 4, 4494), +(38483, '大河镇', 4, 4494), +(38484, '富村镇', 4, 4494), +(38485, '竹园镇', 4, 4494), +(38486, '老厂乡', 4, 4494), +(38487, '营上镇', 4, 4494), +(38488, '雨汪乡', 4, 4494), +(38489, '黄泥河镇', 4, 4494), +(38490, '丹风镇', 4, 4495), +(38491, '五龙壮族乡', 4, 4495), +(38492, '彩云镇', 4, 4495), +(38493, '竹基乡', 4, 4495), +(38494, '葵山镇', 4, 4495), +(38495, '雄壁镇', 4, 4495), +(38496, '高良壮族苗族瑶族乡', 4, 4495), +(38497, '龙庆彝族壮族乡', 4, 4495), +(38498, '大坡乡', 4, 4496), +(38499, '德泽乡', 4, 4496), +(38500, '播乐乡', 4, 4496), +(38501, '炎方乡', 4, 4496), +(38502, '白水镇', 4, 4496), +(38503, '盘江镇', 4, 4496), +(38504, '菱角乡', 4, 4496), +(38505, '西平镇', 4, 4496), +(38506, '九龙镇', 4, 4497), +(38507, '大水井乡', 4, 4497), +(38508, '富乐镇', 4, 4497), +(38509, '旧屋基彝族乡', 4, 4497), +(38510, '板桥镇', 4, 4497), +(38511, '环城乡', 4, 4497), +(38512, '罗雄镇', 4, 4497), +(38513, '老厂乡', 4, 4497), +(38514, '钟山乡', 4, 4497), +(38515, '长底布依族乡', 4, 4497), +(38516, '阿岗镇', 4, 4497), +(38517, '马街镇', 4, 4497), +(38518, '鲁布革布依族苗族乡', 4, 4497), +(38519, '三岔河镇', 4, 4498), +(38520, '中枢镇', 4, 4498), +(38521, '召夸镇', 4, 4498), +(38522, '大莫古镇', 4, 4498), +(38523, '小百户镇', 4, 4498), +(38524, '板桥镇', 4, 4498), +(38525, '活水乡', 4, 4498), +(38526, '芳华镇', 4, 4498), +(38527, '马街镇', 4, 4498), +(38528, '龙海乡', 4, 4498), +(38529, '大庄乡', 4, 4499), +(38530, '旧县镇', 4, 4499), +(38531, '月望乡', 4, 4499), +(38532, '王家庄镇', 4, 4499), +(38533, '纳章镇', 4, 4499), +(38534, '通泉镇', 4, 4499), +(38535, '马过河镇', 4, 4499); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38536, '马鸣乡', 4, 4499), +(38537, '三宝镇', 4, 4500), +(38538, '东山镇', 4, 4500), +(38539, '南宁街道', 4, 4500), +(38540, '廖廓街道', 4, 4500), +(38541, '建宁街道', 4, 4500), +(38542, '沿江乡', 4, 4500), +(38543, '珠街乡', 4, 4500), +(38544, '白石江街道', 4, 4500), +(38545, '茨营乡', 4, 4500), +(38546, '西山街道', 4, 4500), +(38547, '越州镇', 4, 4500), +(38548, '东峨镇', 4, 4501), +(38549, '元江农场', 4, 4501), +(38550, '咪哩乡', 4, 4501), +(38551, '因远镇', 4, 4501), +(38552, '洼垤乡', 4, 4501), +(38553, '澧江镇', 4, 4501), +(38554, '甘庄农场', 4, 4501), +(38555, '红侨农场', 4, 4501), +(38556, '红光农场', 4, 4501), +(38557, '羊岔街乡', 4, 4501), +(38558, '羊街乡', 4, 4501), +(38559, '那诺乡', 4, 4501), +(38560, '青龙厂镇', 4, 4501), +(38561, '龙潭乡', 4, 4501), +(38562, '华溪镇', 4, 4502), +(38563, '吉龙镇', 4, 4502), +(38564, '宁州镇', 4, 4502), +(38565, '盘溪镇', 4, 4502), +(38566, '通红甸彝族苗族乡', 4, 4502), +(38567, '化念农场', 4, 4503), +(38568, '化念镇', 4, 4503), +(38569, '双江镇', 4, 4503), +(38570, '塔甸镇', 4, 4503), +(38571, '大龙潭乡', 4, 4503), +(38572, '富良棚乡', 4, 4503), +(38573, '小街镇', 4, 4503), +(38574, '岔河乡', 4, 4503), +(38575, '甸中镇', 4, 4503), +(38576, '平掌乡', 4, 4504), +(38577, '平甸乡', 4, 4504), +(38578, '建兴乡', 4, 4504), +(38579, '戛洒镇', 4, 4504), +(38580, '扬武镇', 4, 4504), +(38581, '新化乡', 4, 4504), +(38582, '桂山镇', 4, 4504), +(38583, '水塘镇', 4, 4504), +(38584, '漠沙镇', 4, 4504), +(38585, '老厂乡', 4, 4504), +(38586, '者鼋乡', 4, 4504), +(38587, '腰街镇', 4, 4504), +(38588, '六街镇', 4, 4505), +(38589, '十街彝族乡', 4, 4505), +(38590, '小街乡', 4, 4505), +(38591, '浦贝彝族乡', 4, 4505), +(38592, '绿汁镇', 4, 4505), +(38593, '铜厂彝族乡', 4, 4505), +(38594, '龙泉镇', 4, 4505), +(38595, '九溪镇', 4, 4506), +(38596, '前卫镇', 4, 4506), +(38597, '大街镇', 4, 4506), +(38598, '安化彝族乡', 4, 4506); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38599, '江城镇', 4, 4506), +(38600, '路居镇', 4, 4506), +(38601, '雄关乡', 4, 4506), +(38602, '九村镇', 4, 4507), +(38603, '右所镇', 4, 4507), +(38604, '海口镇', 4, 4507), +(38605, '阳宗镇', 4, 4507), +(38606, '风麓镇', 4, 4507), +(38607, '龙街镇', 4, 4507), +(38608, '凤凰路街道', 4, 4508), +(38609, '北城镇', 4, 4508), +(38610, '大营街镇', 4, 4508), +(38611, '小石桥彝族乡', 4, 4508), +(38612, '春和镇', 4, 4508), +(38613, '李棋镇', 4, 4508), +(38614, '洛河彝族乡', 4, 4508), +(38615, '玉兴路街道', 4, 4508), +(38616, '玉带路街道', 4, 4508), +(38617, '研和镇', 4, 4508), +(38618, '高仓镇', 4, 4508), +(38619, '九街镇', 4, 4509), +(38620, '兴蒙蒙古族乡', 4, 4509), +(38621, '四街镇', 4, 4509), +(38622, '杨广镇', 4, 4509), +(38623, '河西镇', 4, 4509), +(38624, '秀山镇', 4, 4509), +(38625, '纳古镇', 4, 4509), +(38626, '里山彝族乡', 4, 4509), +(38627, '高大傣族彝族乡', 4, 4509), +(38628, '万兴乡', 4, 4510), +(38629, '仁和镇', 4, 4510), +(38630, '何元乡', 4, 4510), +(38631, '太平镇', 4, 4510), +(38632, '姚关镇', 4, 4510), +(38633, '摆榔彝族布朗族乡', 4, 4510), +(38634, '旧城乡', 4, 4510), +(38635, '木老元布朗族彝族乡', 4, 4510), +(38636, '水长乡', 4, 4510), +(38637, '由旺镇', 4, 4510), +(38638, '甸阳镇', 4, 4510), +(38639, '老麦乡', 4, 4510), +(38640, '酒房乡', 4, 4510), +(38641, '勐统镇', 4, 4511), +(38642, '卡斯镇', 4, 4511), +(38643, '大田坝乡', 4, 4511), +(38644, '更戛乡', 4, 4511), +(38645, '柯街华侨农场', 4, 4511), +(38646, '柯街镇', 4, 4511), +(38647, '温泉乡', 4, 4511), +(38648, '湾甸傣族乡', 4, 4511), +(38649, '湾甸农场', 4, 4511), +(38650, '漭水镇', 4, 4511), +(38651, '珠街彝族乡', 4, 4511), +(38652, '田园镇', 4, 4511), +(38653, '翁堵乡', 4, 4511), +(38654, '苟街彝族苗族乡', 4, 4511), +(38655, '鸡飞乡', 4, 4511), +(38656, '中和乡', 4, 4512), +(38657, '五合乡', 4, 4512), +(38658, '北海乡', 4, 4512), +(38659, '和顺镇', 4, 4512); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38660, '团田乡', 4, 4512), +(38661, '固东镇', 4, 4512), +(38662, '新华乡', 4, 4512), +(38663, '明光乡', 4, 4512), +(38664, '曲石乡', 4, 4512), +(38665, '清水乡', 4, 4512), +(38666, '滇滩镇', 4, 4512), +(38667, '猴桥镇', 4, 4512), +(38668, '界头乡', 4, 4512), +(38669, '腾越镇', 4, 4512), +(38670, '芒棒乡', 4, 4512), +(38671, '荷花傣族佤族乡', 4, 4512), +(38672, '蒲川乡', 4, 4512), +(38673, '马站乡', 4, 4512), +(38674, '丙麻乡', 4, 4513), +(38675, '新城农场', 4, 4513), +(38676, '杨柳白族彝族乡', 4, 4513), +(38677, '板桥镇', 4, 4513), +(38678, '水寨乡', 4, 4513), +(38679, '永昌街道', 4, 4513), +(38680, '汉庄镇', 4, 4513), +(38681, '河图镇', 4, 4513), +(38682, '潞江农场', 4, 4513), +(38683, '潞江镇', 4, 4513), +(38684, '瓦房彝族苗族乡', 4, 4513), +(38685, '瓦渡乡', 4, 4513), +(38686, '瓦窑镇', 4, 4513), +(38687, '瓦马彝族白族乡', 4, 4513), +(38688, '芒宽彝族傣族乡', 4, 4513), +(38689, '蒲缥镇', 4, 4513), +(38690, '西邑乡', 4, 4513), +(38691, '辛街乡', 4, 4513), +(38692, '金鸡乡', 4, 4513), +(38693, '勐糯镇', 4, 4514), +(38694, '平达乡', 4, 4514), +(38695, '木城彝族傈僳族乡', 4, 4514), +(38696, '河头乡', 4, 4514), +(38697, '碧寨乡', 4, 4514), +(38698, '腊勐乡', 4, 4514), +(38699, '象达乡', 4, 4514), +(38700, '镇安镇', 4, 4514), +(38701, '龙山镇', 4, 4514), +(38702, '龙新乡', 4, 4514), +(38703, '龙江乡', 4, 4514), +(38704, '上高桥回族彝族苗族乡', 4, 4515), +(38705, '吉利镇', 4, 4515), +(38706, '天星镇', 4, 4515), +(38707, '寿山乡', 4, 4515), +(38708, '悦乐镇', 4, 4515), +(38709, '木杆镇', 4, 4515), +(38710, '玉碗镇', 4, 4515), +(38711, '翠华镇', 4, 4515), +(38712, '高桥乡', 4, 4515), +(38713, '三桃乡', 4, 4516), +(38714, '双河苗族彝族乡', 4, 4516), +(38715, '庙沟乡', 4, 4516), +(38716, '扎西镇', 4, 4516), +(38717, '旧城镇', 4, 4516), +(38718, '林凤乡', 4, 4516), +(38719, '水田乡', 4, 4516), +(38720, '罗布乡', 4, 4516), +(38721, '长安乡', 4, 4516); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38722, '高田乡', 4, 4516), +(38723, '东坪乡', 4, 4517), +(38724, '中寨乡', 4, 4517), +(38725, '大寨镇', 4, 4517), +(38726, '小河镇', 4, 4517), +(38727, '崇溪乡', 4, 4517), +(38728, '新店乡', 4, 4517), +(38729, '炉房乡', 4, 4517), +(38730, '白鹤滩镇', 4, 4517), +(38731, '红山乡', 4, 4517), +(38732, '老店镇', 4, 4517), +(38733, '苞谷垴乡', 4, 4517), +(38734, '茂租乡', 4, 4517), +(38735, '药山镇', 4, 4517), +(38736, '蒙姑乡', 4, 4517), +(38737, '金塘乡', 4, 4517), +(38738, '马树镇', 4, 4517), +(38739, '两河乡', 4, 4518), +(38740, '奎香苗族彝族乡', 4, 4518), +(38741, '小草坝乡', 4, 4518), +(38742, '柳溪苗族乡', 4, 4518), +(38743, '树林彝族苗族乡', 4, 4518), +(38744, '洛旺苗族乡', 4, 4518), +(38745, '洛泽河镇', 4, 4518), +(38746, '海子乡', 4, 4518), +(38747, '牛街镇', 4, 4518), +(38748, '荞山乡', 4, 4518), +(38749, '角奎镇', 4, 4518), +(38750, '钟鸣乡', 4, 4518), +(38751, '龙安乡', 4, 4518), +(38752, '龙海乡', 4, 4518), +(38753, '龙街苗族彝族乡', 4, 4518), +(38754, '乐居乡', 4, 4519), +(38755, '凤凰街道', 4, 4519), +(38756, '北闸镇', 4, 4519), +(38757, '大寨子乡', 4, 4519), +(38758, '大山包乡', 4, 4519), +(38759, '太平街道', 4, 4519), +(38760, '守望回族乡', 4, 4519), +(38761, '小龙洞回族彝族乡', 4, 4519), +(38762, '布嘎回族乡', 4, 4519), +(38763, '旧圃镇', 4, 4519), +(38764, '永丰镇', 4, 4519), +(38765, '洒渔乡', 4, 4519), +(38766, '炎山乡', 4, 4519), +(38767, '田坝乡', 4, 4519), +(38768, '盘河乡', 4, 4519), +(38769, '苏家院乡', 4, 4519), +(38770, '苏甲乡', 4, 4519), +(38771, '青岗岭回族彝族乡', 4, 4519), +(38772, '靖安乡', 4, 4519), +(38773, '龙泉街道', 4, 4519), +(38774, '两碗乡', 4, 4520), +(38775, '向家坝镇', 4, 4520), +(38776, '太平乡', 4, 4520), +(38777, '伍寨彝族苗族乡', 4, 4521), +(38778, '务基乡', 4, 4521), +(38779, '团结乡', 4, 4521), +(38780, '墨翰乡', 4, 4521), +(38781, '大兴镇', 4, 4521), +(38782, '桧溪镇', 4, 4521); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38783, '水竹乡', 4, 4521), +(38784, '溪洛渡镇', 4, 4521), +(38785, '码口乡', 4, 4521), +(38786, '细沙乡', 4, 4521), +(38787, '茂林镇', 4, 4521), +(38788, '莲峰镇', 4, 4521), +(38789, '青胜乡', 4, 4521), +(38790, '马楠苗族彝族乡', 4, 4521), +(38791, '黄华镇', 4, 4521), +(38792, '中和镇', 4, 4522), +(38793, '兴隆乡', 4, 4522), +(38794, '庙坝乡', 4, 4522), +(38795, '普洱镇', 4, 4522), +(38796, '柿子乡', 4, 4522), +(38797, '滩头乡', 4, 4522), +(38798, '牛寨乡', 4, 4522), +(38799, '盐井镇', 4, 4522), +(38800, '落雁乡', 4, 4522), +(38801, '豆沙镇', 4, 4522), +(38802, '中城镇', 4, 4523), +(38803, '会仪镇', 4, 4523), +(38804, '南岸镇', 4, 4523), +(38805, '新滩镇', 4, 4523), +(38806, '板栗乡', 4, 4523), +(38807, '中屯乡', 4, 4524), +(38808, '乌峰镇', 4, 4524), +(38809, '五德镇', 4, 4524), +(38810, '以勒镇', 4, 4524), +(38811, '以古镇', 4, 4524), +(38812, '场坝镇塘房镇', 4, 4524), +(38813, '坡头镇', 4, 4524), +(38814, '坪上乡', 4, 4524), +(38815, '大湾镇', 4, 4524), +(38816, '尖山乡', 4, 4524), +(38817, '木卓乡', 4, 4524), +(38818, '杉树乡', 4, 4524), +(38819, '林口彝族苗族乡', 4, 4524), +(38820, '果珠彝族乡', 4, 4524), +(38821, '母享镇', 4, 4524), +(38822, '泼机镇', 4, 4524), +(38823, '牛场镇', 4, 4524), +(38824, '盐源乡', 4, 4524), +(38825, '碗厂乡', 4, 4524), +(38826, '罗坎镇', 4, 4524), +(38827, '芒部镇', 4, 4524), +(38828, '花山乡', 4, 4524), +(38829, '花朗乡', 4, 4524), +(38830, '赤水源镇', 4, 4524), +(38831, '雨河镇', 4, 4524), +(38832, '鱼洞乡', 4, 4524), +(38833, '黑树镇', 4, 4524), +(38834, '乐红乡', 4, 4525), +(38835, '大水井乡', 4, 4525), +(38836, '小寨乡', 4, 4525), +(38837, '文屏镇', 4, 4525), +(38838, '新街乡', 4, 4525), +(38839, '桃源回族乡', 4, 4525), +(38840, '梭山乡', 4, 4525), +(38841, '水磨镇', 4, 4525), +(38842, '火德红乡', 4, 4525), +(38843, '茨院回族乡', 4, 4525), +(38844, '龙头山镇', 4, 4525), +(38845, '龙树乡', 4, 4525), +(38846, '中心镇', 4, 4526); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38847, '兴泉镇', 4, 4526), +(38848, '新庄傈僳族傣族乡', 4, 4526), +(38849, '永兴傈僳族乡', 4, 4526), +(38850, '石龙坝彝族傣族乡', 4, 4526), +(38851, '船房傈僳族傣族乡', 4, 4526), +(38852, '荣将镇', 4, 4526), +(38853, '通达傈僳族乡', 4, 4526), +(38854, '七河乡', 4, 4527), +(38855, '大东乡', 4, 4527), +(38856, '大研街道', 4, 4527), +(38857, '束河街道', 4, 4527), +(38858, '祥和街道', 4, 4527), +(38859, '西安街道', 4, 4527), +(38860, '金安乡', 4, 4527), +(38861, '金山白族乡', 4, 4527), +(38862, '金江白族乡', 4, 4527), +(38863, '大兴镇', 4, 4528), +(38864, '宁利乡', 4, 4528), +(38865, '战河乡', 4, 4528), +(38866, '拉伯乡', 4, 4528), +(38867, '新营盘乡', 4, 4528), +(38868, '永宁乡', 4, 4528), +(38869, '永宁坪乡', 4, 4528), +(38870, '烂泥箐乡', 4, 4528), +(38871, '红桥乡', 4, 4528), +(38872, '翠玉傈僳族普米族乡', 4, 4528), +(38873, '蝉战河乡', 4, 4528), +(38874, '西川乡', 4, 4528), +(38875, '西布河乡', 4, 4528), +(38876, '跑马坪乡', 4, 4528), +(38877, '金棉乡', 4, 4528), +(38878, '三川镇', 4, 4529), +(38879, '东山傈僳族彝族乡', 4, 4529), +(38880, '东风傈僳族乡', 4, 4529), +(38881, '仁和镇', 4, 4529), +(38882, '光华傈僳族彝族乡', 4, 4529), +(38883, '六德傈僳族彝族乡', 4, 4529), +(38884, '大安彝族纳西族乡', 4, 4529), +(38885, '期纳镇', 4, 4529), +(38886, '松坪傈僳族彝族乡', 4, 4529), +(38887, '永北镇', 4, 4529), +(38888, '涛源乡', 4, 4529), +(38889, '片角乡', 4, 4529), +(38890, '程海镇', 4, 4529), +(38891, '羊坪彝族乡', 4, 4529), +(38892, '顺州乡', 4, 4529), +(38893, '九河白族乡', 4, 4530), +(38894, '塔城乡', 4, 4530), +(38895, '大具乡', 4, 4530), +(38896, '太安乡', 4, 4530), +(38897, '奉科乡', 4, 4530), +(38898, '宝山乡', 4, 4530), +(38899, '巨甸镇', 4, 4530), +(38900, '拉市乡', 4, 4530), +(38901, '白沙乡', 4, 4530), +(38902, '石头白族乡', 4, 4530), +(38903, '石鼓镇', 4, 4530), +(38904, '鲁甸乡', 4, 4530); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38905, '鸣音乡', 4, 4530), +(38906, '黄山镇', 4, 4530), +(38907, '黎明傈僳族乡', 4, 4530), +(38908, '龙蟠乡', 4, 4530), +(38909, '南美拉祜族乡', 4, 4531), +(38910, '博尚镇', 4, 4531), +(38911, '圈内乡', 4, 4531), +(38912, '平村彝族傣族乡', 4, 4531), +(38913, '忙畔街道', 4, 4531), +(38914, '章驮乡', 4, 4531), +(38915, '蚂蚁堆乡', 4, 4531), +(38916, '邦东乡', 4, 4531), +(38917, '风翔街道', 4, 4531), +(38918, '马台乡', 4, 4531), +(38919, '后箐彝族乡', 4, 4532), +(38920, '大寨镇', 4, 4532), +(38921, '大朝山西镇', 4, 4532), +(38922, '幸福镇', 4, 4532), +(38923, '忙怀彝族布朗族乡', 4, 4532), +(38924, '晓街乡', 4, 4532), +(38925, '栗树彝族傣族乡', 4, 4532), +(38926, '涌宝镇', 4, 4532), +(38927, '漫湾镇', 4, 4532), +(38928, '爱华镇', 4, 4532), +(38929, '茂兰镇', 4, 4532), +(38930, '茶房乡', 4, 4532), +(38931, '三岔河镇', 4, 4533), +(38932, '凤山镇', 4, 4533), +(38933, '勐佑镇', 4, 4533), +(38934, '大寺乡', 4, 4533), +(38935, '小湾镇', 4, 4533), +(38936, '新华彝族苗族乡', 4, 4533), +(38937, '洛党镇', 4, 4533), +(38938, '腰街彝族乡', 4, 4533), +(38939, '营盘镇', 4, 4533), +(38940, '诗礼乡', 4, 4533), +(38941, '郭大寨彝族白族乡', 4, 4533), +(38942, '雪山镇', 4, 4533), +(38943, '鲁史镇', 4, 4533), +(38944, '勐勐镇', 4, 4534), +(38945, '勐库华侨农场', 4, 4534), +(38946, '勐库镇', 4, 4534), +(38947, '双江农场', 4, 4534), +(38948, '大文乡', 4, 4534), +(38949, '忙糯乡', 4, 4534), +(38950, '沙河乡', 4, 4534), +(38951, '邦丙乡', 4, 4534), +(38952, '乌木龙彝族乡', 4, 4535), +(38953, '亚练乡', 4, 4535), +(38954, '勐底农场', 4, 4535), +(38955, '勐板乡', 4, 4535), +(38956, '大山乡', 4, 4535), +(38957, '大雪山彝族拉祜族傣族乡', 4, 4535), +(38958, '小勐统镇', 4, 4535), +(38959, '崇岗乡', 4, 4535), +(38960, '德党镇', 4, 4535), +(38961, '永康镇', 4, 4535), +(38962, '班卡乡', 4, 4535), +(38963, '勐来乡', 4, 4536), +(38964, '勐省农场', 4, 4536); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(38965, '勐省镇', 4, 4536), +(38966, '勐董镇', 4, 4536), +(38967, '勐角傣族彝族拉祜族乡', 4, 4536), +(38968, '单甲乡', 4, 4536), +(38969, '岩帅镇', 4, 4536), +(38970, '班洪乡', 4, 4536), +(38971, '班老乡', 4, 4536), +(38972, '糯良乡', 4, 4536), +(38973, '芒卡镇', 4, 4536), +(38974, '勐撒农场', 4, 4537), +(38975, '勐撒镇', 4, 4537), +(38976, '勐永镇', 4, 4537), +(38977, '勐简乡', 4, 4537), +(38978, '四排山乡', 4, 4537), +(38979, '大兴乡', 4, 4537), +(38980, '孟定农场', 4, 4537), +(38981, '孟定镇', 4, 4537), +(38982, '耿马镇', 4, 4537), +(38983, '芒洪拉祜族布朗族乡', 4, 4537), +(38984, '贺派乡', 4, 4537), +(38985, '军赛佤族拉祜族傈僳族德昂族乡', 4, 4538), +(38986, '凤尾镇', 4, 4538), +(38987, '勐堆乡', 4, 4538), +(38988, '勐捧镇', 4, 4538), +(38989, '南伞镇', 4, 4538), +(38990, '忙丙乡', 4, 4538), +(38991, '木厂乡', 4, 4538), +(38992, '元马镇', 4, 4539), +(38993, '凉山乡', 4, 4539), +(38994, '姜驿乡', 4, 4539), +(38995, '平田乡', 4, 4539), +(38996, '新华乡', 4, 4539), +(38997, '江边乡', 4, 4539), +(38998, '物茂乡', 4, 4539), +(38999, '羊街镇', 4, 4539), +(39000, '老城乡', 4, 4539), +(39001, '黄瓜园镇', 4, 4539), +(39002, '一街乡', 4, 4540), +(39003, '五街镇', 4, 4540), +(39004, '五顶山乡', 4, 4540), +(39005, '兔街镇', 4, 4540), +(39006, '沙桥镇', 4, 4540), +(39007, '红士坡镇', 4, 4540), +(39008, '罗武庄乡', 4, 4540), +(39009, '雨露白族乡', 4, 4540), +(39010, '马街镇', 4, 4540), +(39011, '龙川镇', 4, 4540), +(39012, '大庄镇', 4, 4541), +(39013, '大麦地镇', 4, 4541), +(39014, '妥甸镇', 4, 4541), +(39015, '安龙堡乡', 4, 4541), +(39016, '法裱镇', 4, 4541), +(39017, '爱尼山乡', 4, 4541), +(39018, '独田乡', 4, 4541), +(39019, '鄂嘉镇', 4, 4541), +(39020, '三台乡', 4, 4542), +(39021, '三岔河乡', 4, 4542), +(39022, '六苴镇', 4, 4542), +(39023, '新街乡', 4, 4542), +(39024, '昙华乡', 4, 4542), +(39025, '桂花乡', 4, 4542), +(39026, '湾碧傣族傈僳族乡', 4, 4542); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39027, '石羊镇', 4, 4542), +(39028, '赵家店乡', 4, 4542), +(39029, '金碧镇', 4, 4542), +(39030, '铁锁乡', 4, 4542), +(39031, '龙街乡', 4, 4542), +(39032, '光禄镇', 4, 4543), +(39033, '前场镇', 4, 4543), +(39034, '大河口乡', 4, 4543), +(39035, '太平镇', 4, 4543), +(39036, '官屯乡', 4, 4543), +(39037, '左门乡', 4, 4543), +(39038, '弥兴镇', 4, 4543), +(39039, '栋川镇', 4, 4543), +(39040, '适中乡', 4, 4543), +(39041, '三街镇', 4, 4544), +(39042, '东华镇', 4, 4544), +(39043, '东瓜镇', 4, 4544), +(39044, '中山镇', 4, 4544), +(39045, '八角镇', 4, 4544), +(39046, '吕合镇', 4, 4544), +(39047, '大地基乡', 4, 4544), +(39048, '大过口乡', 4, 4544), +(39049, '子午镇', 4, 4544), +(39050, '新村镇', 4, 4544), +(39051, '树苴乡', 4, 4544), +(39052, '紫溪镇', 4, 4544), +(39053, '苍岭镇', 4, 4544), +(39054, '西舍路乡', 4, 4544), +(39055, '鹿城镇', 4, 4544), +(39056, '万德乡', 4, 4545), +(39057, '东坡傣族乡', 4, 4545), +(39058, '发窝乡', 4, 4545), +(39059, '己衣乡', 4, 4545), +(39060, '插甸乡', 4, 4545), +(39061, '狮山镇', 4, 4545), +(39062, '猫街镇', 4, 4545), +(39063, '环州乡', 4, 4545), +(39064, '田心乡', 4, 4545), +(39065, '白路乡', 4, 4545), +(39066, '高桥镇', 4, 4545), +(39067, '中和镇', 4, 4546), +(39068, '宜就镇', 4, 4546), +(39069, '永兴傣族乡', 4, 4546), +(39070, '永定镇', 4, 4546), +(39071, '猛虎乡', 4, 4546), +(39072, '维的乡', 4, 4546), +(39073, '莲池乡', 4, 4546), +(39074, '共和镇', 4, 4547), +(39075, '凤屯镇', 4, 4547), +(39076, '安乐乡', 4, 4547), +(39077, '戌街乡', 4, 4547), +(39078, '新桥镇', 4, 4547), +(39079, '江坡镇', 4, 4547), +(39080, '蟠猫乡', 4, 4547), +(39081, '一平浪镇', 4, 4548), +(39082, '中村乡', 4, 4548), +(39083, '仁兴镇', 4, 4548), +(39084, '勤丰镇', 4, 4548), +(39085, '和平镇', 4, 4548), +(39086, '土官镇', 4, 4548), +(39087, '妥安乡', 4, 4548), +(39088, '川街乡', 4, 4548), +(39089, '广通镇', 4, 4548), +(39090, '碧城镇', 4, 4548), +(39091, '罗川镇', 4, 4548); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39092, '金山镇', 4, 4548), +(39093, '高峰乡', 4, 4548), +(39094, '黑井镇', 4, 4548), +(39095, '保和乡', 4, 4549), +(39096, '卡房镇', 4, 4549), +(39097, '城区街道', 4, 4549), +(39098, '大屯镇', 4, 4549), +(39099, '沙甸镇', 4, 4549), +(39100, '老厂镇', 4, 4549), +(39101, '蔓耗镇', 4, 4549), +(39102, '贾沙乡', 4, 4549), +(39103, '锡城镇', 4, 4549), +(39104, '鸡街镇', 4, 4549), +(39105, '上新城乡', 4, 4550), +(39106, '俄扎乡', 4, 4550), +(39107, '南沙镇', 4, 4550), +(39108, '嘎娘乡', 4, 4550), +(39109, '大坪乡', 4, 4550), +(39110, '小新街乡', 4, 4550), +(39111, '攀枝花乡', 4, 4550), +(39112, '新街镇', 4, 4550), +(39113, '沙拉托乡', 4, 4550), +(39114, '牛角寨乡', 4, 4550), +(39115, '逢春岭乡', 4, 4550), +(39116, '马街乡', 4, 4550), +(39117, '黄茅岭乡', 4, 4550), +(39118, '黄草岭乡', 4, 4550), +(39119, '和平乡', 4, 4551), +(39120, '新华乡', 4, 4551), +(39121, '新现乡', 4, 4551), +(39122, '湾塘乡', 4, 4551), +(39123, '玉屏镇', 4, 4551), +(39124, '白云乡', 4, 4551), +(39125, '白河乡', 4, 4551), +(39126, '临安镇', 4, 4552), +(39127, '南庄镇', 4, 4552), +(39128, '坡头乡', 4, 4552), +(39129, '官厅镇', 4, 4552), +(39130, '岔科镇', 4, 4552), +(39131, '普雄乡', 4, 4552), +(39132, '曲江镇', 4, 4552), +(39133, '甸尾乡', 4, 4552), +(39134, '盘江乡', 4, 4552), +(39135, '西庄镇', 4, 4552), +(39136, '青龙镇', 4, 4552), +(39137, '面甸镇', 4, 4552), +(39138, '中和营镇', 4, 4553), +(39139, '乐百道街道', 4, 4553), +(39140, '大庄回族乡', 4, 4553), +(39141, '小龙潭镇', 4, 4553), +(39142, '灵泉街道', 4, 4553), +(39143, '碑格乡', 4, 4553), +(39144, '羊街乡', 4, 4553), +(39145, '东山镇', 4, 4554), +(39146, '东风农场', 4, 4554), +(39147, '五山乡', 4, 4554), +(39148, '巡检司镇', 4, 4554), +(39149, '弥阳镇', 4, 4554), +(39150, '新哨镇', 4, 4554), +(39151, '江边乡', 4, 4554), +(39152, '竹园镇', 4, 4554), +(39153, '虹溪镇', 4, 4554), +(39154, '西一镇', 4, 4554), +(39155, '西三镇', 4, 4554); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39156, '西二镇', 4, 4554), +(39157, '南溪农场', 4, 4555), +(39158, '南溪镇', 4, 4555), +(39159, '坝洒农场', 4, 4555), +(39160, '桥头苗族壮族乡', 4, 4555), +(39161, '河口农场', 4, 4555), +(39162, '河口镇', 4, 4555), +(39163, '瑶山乡', 4, 4555), +(39164, '老范寨乡', 4, 4555), +(39165, '莲花滩乡', 4, 4555), +(39166, '蚂蝗堡农场', 4, 4555), +(39167, '三塘乡', 4, 4556), +(39168, '中枢镇', 4, 4556), +(39169, '午街铺镇', 4, 4556), +(39170, '向阳乡', 4, 4556), +(39171, '旧城镇', 4, 4556), +(39172, '永宁乡', 4, 4556), +(39173, '白水镇', 4, 4556), +(39174, '金马镇', 4, 4556), +(39175, '哨冲镇', 4, 4557), +(39176, '坝心镇', 4, 4557), +(39177, '大桥乡', 4, 4557), +(39178, '宝秀镇', 4, 4557), +(39179, '异龙镇', 4, 4557), +(39180, '新城乡', 4, 4557), +(39181, '牛街镇', 4, 4557), +(39182, '龙朋镇', 4, 4557), +(39183, '龙武镇', 4, 4557), +(39184, '三村乡', 4, 4558), +(39185, '乐育乡', 4, 4558), +(39186, '垤玛乡', 4, 4558), +(39187, '大羊街乡', 4, 4558), +(39188, '宝华乡', 4, 4558), +(39189, '架车乡', 4, 4558), +(39190, '洛恩乡', 4, 4558), +(39191, '浪堤乡', 4, 4558), +(39192, '甲寅乡', 4, 4558), +(39193, '石头寨乡', 4, 4558), +(39194, '车古乡', 4, 4558), +(39195, '迤萨镇', 4, 4558), +(39196, '阿扎河乡', 4, 4558), +(39197, '三猛乡', 4, 4559), +(39198, '半坡乡', 4, 4559), +(39199, '大兴镇', 4, 4559), +(39200, '大水沟乡', 4, 4559), +(39201, '大黑山乡', 4, 4559), +(39202, '平河乡', 4, 4559), +(39203, '戈奎乡', 4, 4559), +(39204, '牛孔乡', 4, 4559), +(39205, '骑马坝乡', 4, 4559), +(39206, '冷泉镇', 4, 4560), +(39207, '文澜镇', 4, 4560), +(39208, '新安所镇', 4, 4560), +(39209, '期路白苗族乡', 4, 4560), +(39210, '水田乡', 4, 4560), +(39211, '老寨苗族乡', 4, 4560), +(39212, '芷村镇', 4, 4560), +(39213, '草坝镇', 4, 4560), +(39214, '西北勒乡', 4, 4560), +(39215, '雨过铺镇', 4, 4560), +(39216, '鸣鹫苗族镇', 4, 4560), +(39217, '勐拉乡', 4, 4561), +(39218, '勐桥乡', 4, 4561); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39219, '大寨乡', 4, 4561), +(39220, '沙依坡乡', 4, 4561), +(39221, '老勐乡', 4, 4561), +(39222, '老集寨乡', 4, 4561), +(39223, '者米拉祜族乡', 4, 4561), +(39224, '营盘乡', 4, 4561), +(39225, '金平农场', 4, 4561), +(39226, '金水河镇', 4, 4561), +(39227, '金河镇', 4, 4561), +(39228, '铜厂乡', 4, 4561), +(39229, '阿得博乡', 4, 4561), +(39230, '马鞍底乡', 4, 4561), +(39231, '八道哨彝族乡', 4, 4562), +(39232, '双龙营镇', 4, 4562), +(39233, '天星乡', 4, 4562), +(39234, '官寨乡', 4, 4562), +(39235, '平寨乡', 4, 4562), +(39236, '新店彝族乡', 4, 4562), +(39237, '曰者镇', 4, 4562), +(39238, '树皮彝族乡', 4, 4562), +(39239, '温浏乡', 4, 4562), +(39240, '腻脚彝族乡', 4, 4562), +(39241, '舍得彝族乡', 4, 4562), +(39242, '锦屏镇', 4, 4562), +(39243, '剥隘镇', 4, 4563), +(39244, '归朝镇', 4, 4563), +(39245, '新华镇', 4, 4563), +(39246, '木央镇', 4, 4563), +(39247, '板仑乡', 4, 4563), +(39248, '洞波瑶族乡', 4, 4563), +(39249, '田蓬镇', 4, 4563), +(39250, '者桑乡', 4, 4563), +(39251, '花甲乡', 4, 4563), +(39252, '谷拉乡', 4, 4563), +(39253, '那能乡', 4, 4563), +(39254, '里达镇', 4, 4563), +(39255, '阿用乡', 4, 4563), +(39256, '五珠乡', 4, 4564), +(39257, '八宝镇', 4, 4564), +(39258, '南屏镇', 4, 4564), +(39259, '坝美镇', 4, 4564), +(39260, '堂上农场', 4, 4564), +(39261, '底圩乡', 4, 4564), +(39262, '旧莫乡', 4, 4564), +(39263, '曙光乡', 4, 4564), +(39264, '杨柳井乡', 4, 4564), +(39265, '板蚌乡', 4, 4564), +(39266, '珠琳镇', 4, 4564), +(39267, '珠街镇', 4, 4564), +(39268, '石山农场', 4, 4564), +(39269, '篆角乡', 4, 4564), +(39270, '者兔乡', 4, 4564), +(39271, '者太乡', 4, 4564), +(39272, '莲城镇', 4, 4564), +(39273, '董堡乡', 4, 4564), +(39274, '那洒镇', 4, 4564), +(39275, '黑支果乡', 4, 4564), +(39276, '东山彝族乡', 4, 4565), +(39277, '古木镇', 4, 4565), +(39278, '喜古乡', 4, 4565), +(39279, '坝心彝族乡', 4, 4565), +(39280, '小街镇', 4, 4565), +(39281, '平坝镇', 4, 4565); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39282, '开化镇', 4, 4565), +(39283, '德厚镇', 4, 4565), +(39284, '新街乡', 4, 4565), +(39285, '柳井彝族乡', 4, 4565), +(39286, '秉烈彝族乡', 4, 4565), +(39287, '红甸回族乡', 4, 4565), +(39288, '薄竹镇', 4, 4565), +(39289, '追栗街镇', 4, 4565), +(39290, '马塘镇', 4, 4565), +(39291, '八嘎乡', 4, 4566), +(39292, '回龙农场', 4, 4566), +(39293, '干河彝族乡', 4, 4566), +(39294, '平远镇', 4, 4566), +(39295, '江那镇', 4, 4566), +(39296, '盘龙彝族乡', 4, 4566), +(39297, '稼依镇', 4, 4566), +(39298, '维末彝族乡', 4, 4566), +(39299, '者腊乡', 4, 4566), +(39300, '蚌峨乡', 4, 4566), +(39301, '阿猛镇', 4, 4566), +(39302, '阿舍彝族乡', 4, 4566), +(39303, '兴街镇', 4, 4567), +(39304, '新马街乡', 4, 4567), +(39305, '柏林乡', 4, 4567), +(39306, '法斗乡', 4, 4567), +(39307, '莲花塘乡', 4, 4567), +(39308, '董马乡', 4, 4567), +(39309, '蚌谷乡', 4, 4567), +(39310, '西洒镇', 4, 4567), +(39311, '鸡街乡', 4, 4567), +(39312, '仁和镇', 4, 4568), +(39313, '健康农场', 4, 4568), +(39314, '八寨镇', 4, 4568), +(39315, '南捞乡', 4, 4568), +(39316, '古林箐乡', 4, 4568), +(39317, '坡脚镇', 4, 4568), +(39318, '大栗树乡', 4, 4568), +(39319, '夹寒箐镇', 4, 4568), +(39320, '小坝子镇', 4, 4568), +(39321, '木厂镇', 4, 4568), +(39322, '篾厂乡', 4, 4568), +(39323, '都龙镇', 4, 4568), +(39324, '金厂镇', 4, 4568), +(39325, '马白镇', 4, 4568), +(39326, '下金厂乡', 4, 4569), +(39327, '八布乡', 4, 4569), +(39328, '八布农场', 4, 4569), +(39329, '六河乡', 4, 4569), +(39330, '南温河乡', 4, 4569), +(39331, '大坪镇', 4, 4569), +(39332, '天保农场', 4, 4569), +(39333, '杨万乡', 4, 4569), +(39334, '猛硐瑶族乡', 4, 4569), +(39335, '董干镇', 4, 4569), +(39336, '铁厂乡', 4, 4569), +(39337, '马街乡', 4, 4569), +(39338, '麻栗镇', 4, 4569), +(39339, '勐宋乡', 4, 4570), +(39340, '勐往乡', 4, 4570), +(39341, '勐海镇', 4, 4570), +(39342, '勐混镇', 4, 4570), +(39343, '勐满镇', 4, 4570), +(39344, '勐遮镇', 4, 4570); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39345, '勐阿镇', 4, 4570), +(39346, '布朗山布朗族乡', 4, 4570), +(39347, '打洛镇', 4, 4570), +(39348, '格朗和哈尼族乡', 4, 4570), +(39349, '西定哈尼族布朗族乡', 4, 4570), +(39350, '黎明农场', 4, 4570), +(39351, '关累镇', 4, 4571), +(39352, '勐仑镇', 4, 4571), +(39353, '勐伴镇', 4, 4571), +(39354, '勐捧镇', 4, 4571), +(39355, '勐棒农场', 4, 4571), +(39356, '勐满农场', 4, 4571), +(39357, '勐满镇', 4, 4571), +(39358, '勐腊农场', 4, 4571), +(39359, '勐腊镇', 4, 4571), +(39360, '勐醒农场', 4, 4571), +(39361, '尚勇镇', 4, 4571), +(39362, '易武乡', 4, 4571), +(39363, '瑶区瑶族乡', 4, 4571), +(39364, '象明彝族乡', 4, 4571), +(39365, '允景洪街道', 4, 4572), +(39366, '勐养农场', 4, 4572), +(39367, '勐养镇', 4, 4572), +(39368, '勐旺乡', 4, 4572), +(39369, '勐罕镇', 4, 4572), +(39370, '勐龙镇', 4, 4572), +(39371, '嘎洒镇', 4, 4572), +(39372, '基诺山基诺族乡', 4, 4572), +(39373, '大渡岗乡', 4, 4572), +(39374, '大渡岗茶场', 4, 4572), +(39375, '普文镇', 4, 4572), +(39376, '景哈哈尼族乡', 4, 4572), +(39377, '景洪农场', 4, 4572), +(39378, '景讷乡', 4, 4572), +(39379, '橄榄坝农场', 4, 4572), +(39380, '关坪乡', 4, 4573), +(39381, '团结彝族乡', 4, 4573), +(39382, '宝丰乡', 4, 4573), +(39383, '旧州镇', 4, 4573), +(39384, '果郎乡', 4, 4573), +(39385, '检槽乡', 4, 4573), +(39386, '民建乡', 4, 4573), +(39387, '漕涧镇', 4, 4573), +(39388, '白石镇', 4, 4573), +(39389, '石门镇', 4, 4573), +(39390, '表村傈僳族乡', 4, 4573), +(39391, '长新乡', 4, 4573), +(39392, '弥沙乡', 4, 4574), +(39393, '沙溪镇', 4, 4574), +(39394, '甸南镇', 4, 4574), +(39395, '红旗林业局', 4, 4574), +(39396, '羊岑乡', 4, 4574), +(39397, '老君山镇', 4, 4574), +(39398, '象图乡', 4, 4574), +(39399, '金华镇', 4, 4574), +(39400, '马登镇', 4, 4574), +(39401, '乐秋乡', 4, 4575), +(39402, '公郎镇', 4, 4575), +(39403, '南涧镇', 4, 4575), +(39404, '宝华镇', 4, 4575), +(39405, '小湾东镇', 4, 4575); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39406, '拥翠乡', 4, 4575), +(39407, '无量乡', 4, 4575), +(39408, '碧溪乡', 4, 4575), +(39409, '上关镇', 4, 4576), +(39410, '下关街道', 4, 4576), +(39411, '下关镇', 4, 4576), +(39412, '凤仪镇', 4, 4576), +(39413, '双廊镇', 4, 4576), +(39414, '喜洲镇', 4, 4576), +(39415, '大理街道', 4, 4576), +(39416, '大理镇', 4, 4576), +(39417, '太邑彝族乡', 4, 4576), +(39418, '挖色镇', 4, 4576), +(39419, '海东镇', 4, 4576), +(39420, '湾桥镇', 4, 4576), +(39421, '银桥镇', 4, 4576), +(39422, '乔甸镇', 4, 4577), +(39423, '力角镇', 4, 4577), +(39424, '国营太和华侨农场', 4, 4577), +(39425, '国营宾居华侨农场', 4, 4577), +(39426, '国营彩风华侨农场', 4, 4577), +(39427, '大营镇', 4, 4577), +(39428, '宾居镇', 4, 4577), +(39429, '州城镇', 4, 4577), +(39430, '平川镇', 4, 4577), +(39431, '拉乌彝族乡', 4, 4577), +(39432, '金牛镇', 4, 4577), +(39433, '钟英傈僳族彝族乡', 4, 4577), +(39434, '鸡足山镇', 4, 4577), +(39435, '五印乡', 4, 4578), +(39436, '南诏镇', 4, 4578), +(39437, '大仓镇', 4, 4578), +(39438, '巍宝山乡', 4, 4578), +(39439, '庙街镇', 4, 4578), +(39440, '永建镇', 4, 4578), +(39441, '牛街乡', 4, 4578), +(39442, '紫金乡', 4, 4578), +(39443, '青华乡', 4, 4578), +(39444, '马鞍山乡', 4, 4578), +(39445, '寅街镇', 4, 4579), +(39446, '密祉乡', 4, 4579), +(39447, '弥城镇', 4, 4579), +(39448, '德苴乡', 4, 4579), +(39449, '新街镇', 4, 4579), +(39450, '牛街彝族乡', 4, 4579), +(39451, '红岩镇', 4, 4579), +(39452, '苴力镇', 4, 4579), +(39453, '北斗彝族乡', 4, 4580), +(39454, '博南镇', 4, 4580), +(39455, '厂街彝族乡', 4, 4580), +(39456, '杉阳镇', 4, 4580), +(39457, '水泄彝族乡', 4, 4580), +(39458, '永和彝族乡', 4, 4580), +(39459, '龙街镇', 4, 4580), +(39460, '龙门乡', 4, 4580), +(39461, '三营镇', 4, 4581), +(39462, '乔后镇', 4, 4581), +(39463, '凤羽镇', 4, 4581), +(39464, '右所镇', 4, 4581), +(39465, '炼铁乡', 4, 4581), +(39466, '牛街乡', 4, 4581), +(39467, '茈碧湖镇', 4, 4581); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39468, '西山乡', 4, 4581), +(39469, '邓川镇', 4, 4581), +(39470, '双涧乡', 4, 4582), +(39471, '太平乡', 4, 4582), +(39472, '富恒乡', 4, 4582), +(39473, '平坡镇', 4, 4582), +(39474, '瓦厂乡', 4, 4582), +(39475, '脉地镇', 4, 4582), +(39476, '苍山西镇', 4, 4582), +(39477, '顺濞乡', 4, 4582), +(39478, '鸡街乡', 4, 4582), +(39479, '龙潭乡', 4, 4582), +(39480, '下庄镇', 4, 4583), +(39481, '东山彝族乡', 4, 4583), +(39482, '云南驿镇', 4, 4583), +(39483, '刘厂镇', 4, 4583), +(39484, '普棚镇', 4, 4583), +(39485, '沙龙镇', 4, 4583), +(39486, '祥城镇', 4, 4583), +(39487, '禾甸镇', 4, 4583), +(39488, '米甸镇', 4, 4583), +(39489, '鹿鸣乡', 4, 4583), +(39490, '中江乡', 4, 4584), +(39491, '云鹤镇', 4, 4584), +(39492, '六合彝族乡', 4, 4584), +(39493, '朵美乡', 4, 4584), +(39494, '松桂镇', 4, 4584), +(39495, '草海镇', 4, 4584), +(39496, '辛屯镇', 4, 4584), +(39497, '金墩乡', 4, 4584), +(39498, '黄坪镇', 4, 4584), +(39499, '九保阿昌族乡', 4, 4585), +(39500, '勐养镇', 4, 4585), +(39501, '大厂乡', 4, 4585), +(39502, '小厂乡', 4, 4585), +(39503, '平山乡', 4, 4585), +(39504, '曩宋阿昌族乡', 4, 4585), +(39505, '河西乡', 4, 4585), +(39506, '芒东镇', 4, 4585), +(39507, '遮岛镇', 4, 4585), +(39508, '三台山德昂族乡', 4, 4586), +(39509, '中山乡', 4, 4586), +(39510, '五岔路乡', 4, 4586), +(39511, '勐戛镇', 4, 4586), +(39512, '江东乡', 4, 4586), +(39513, '芒市镇', 4, 4586), +(39514, '芒海镇', 4, 4586), +(39515, '西山乡', 4, 4586), +(39516, '轩岗乡', 4, 4586), +(39517, '遮放农场', 4, 4586), +(39518, '遮放镇', 4, 4586), +(39519, '风平镇', 4, 4586), +(39520, '勐卯镇', 4, 4587), +(39521, '勐秀乡', 4, 4587), +(39522, '姐相乡', 4, 4587), +(39523, '弄岛镇', 4, 4587), +(39524, '户育乡', 4, 4587), +(39525, '畹町镇', 4, 4587), +(39526, '勐弄乡', 4, 4588), +(39527, '卡场镇', 4, 4588), +(39528, '太平镇', 4, 4588), +(39529, '平原镇', 4, 4588), +(39530, '弄璋镇', 4, 4588), +(39531, '支那乡', 4, 4588); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39532, '新城乡', 4, 4588), +(39533, '旧城镇', 4, 4588), +(39534, '昔马镇', 4, 4588), +(39535, '油松岭乡', 4, 4588), +(39536, '盈江农场', 4, 4588), +(39537, '盏西镇', 4, 4588), +(39538, '芒章乡', 4, 4588), +(39539, '苏典傈僳族乡', 4, 4588), +(39540, '那邦镇', 4, 4588), +(39541, '铜壁关乡', 4, 4588), +(39542, '勐约乡', 4, 4589), +(39543, '城子镇', 4, 4589), +(39544, '户撒阿昌族乡', 4, 4589), +(39545, '护国乡', 4, 4589), +(39546, '景罕镇', 4, 4589), +(39547, '清平乡', 4, 4589), +(39548, '王子树乡', 4, 4589), +(39549, '章凤镇', 4, 4589), +(39550, '陇川农场', 4, 4589), +(39551, '陇把镇', 4, 4589), +(39552, '云岭乡', 4, 4590), +(39553, '佛山乡', 4, 4590), +(39554, '升平镇', 4, 4590), +(39555, '奔子栏镇', 4, 4590), +(39556, '拖顶傈僳族乡', 4, 4590), +(39557, '燕门乡', 4, 4590), +(39558, '羊拉乡', 4, 4590), +(39559, '霞若傈僳族乡', 4, 4590), +(39560, '中路乡', 4, 4591), +(39561, '保和镇', 4, 4591), +(39562, '叶枝镇', 4, 4591), +(39563, '塔城镇', 4, 4591), +(39564, '巴迪乡', 4, 4591), +(39565, '康普乡', 4, 4591), +(39566, '攀天阁乡', 4, 4591), +(39567, '永春乡', 4, 4591), +(39568, '白济讯乡', 4, 4591), +(39569, '维登乡', 4, 4591), +(39570, '三坝纳西族乡', 4, 4592), +(39571, '上江乡', 4, 4592), +(39572, '东旺乡', 4, 4592), +(39573, '五境乡', 4, 4592), +(39574, '小中甸镇', 4, 4592), +(39575, '尼西乡', 4, 4592), +(39576, '建塘镇', 4, 4592), +(39577, '格咱乡', 4, 4592), +(39578, '洛吉乡', 4, 4592), +(39579, '虎跳峡镇', 4, 4592), +(39580, '金江镇', 4, 4592), +(39581, '八廓街道', 4, 4593), +(39582, '公德林街道', 4, 4593), +(39583, '冲赛康街道', 4, 4593), +(39584, '吉崩岗街道', 4, 4593), +(39585, '吉日街道', 4, 4593), +(39586, '嘎玛贡桑街道', 4, 4593), +(39587, '夺底乡', 4, 4593), +(39588, '娘热乡', 4, 4593), +(39589, '札细街道', 4, 4593), +(39590, '纳金乡', 4, 4593), +(39591, '蔡公堂乡', 4, 4593), +(39592, '东嘎镇', 4, 4594), +(39593, '乃琼镇', 4, 4594); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39594, '古荣乡', 4, 4594), +(39595, '德庆乡', 4, 4594), +(39596, '柳梧乡', 4, 4594), +(39597, '羊达乡', 4, 4594), +(39598, '马乡', 4, 4594), +(39599, '塘加乡', 4, 4595), +(39600, '如多乡', 4, 4595), +(39601, '尼玛江热乡', 4, 4595), +(39602, '工卡镇', 4, 4595), +(39603, '扎西岗乡', 4, 4595), +(39604, '扎雪乡', 4, 4595), +(39605, '甲玛乡', 4, 4595), +(39606, '门巴乡', 4, 4595), +(39607, '卡如乡', 4, 4596), +(39608, '吞巴乡', 4, 4596), +(39609, '塔荣镇', 4, 4596), +(39610, '尼木乡', 4, 4596), +(39611, '帕古乡', 4, 4596), +(39612, '普松乡', 4, 4596), +(39613, '续迈乡', 4, 4596), +(39614, '麻江乡', 4, 4596), +(39615, '乌玛塘乡', 4, 4597), +(39616, '公塘乡', 4, 4597), +(39617, '宁中乡', 4, 4597), +(39618, '当曲卡镇', 4, 4597), +(39619, '格达乡', 4, 4597), +(39620, '纳木错乡', 4, 4597), +(39621, '羊八井镇', 4, 4597), +(39622, '龙仁乡', 4, 4597), +(39623, '南木乡', 4, 4598), +(39624, '曲水镇', 4, 4598), +(39625, '聂唐乡', 4, 4598), +(39626, '茶巴拉乡', 4, 4598), +(39627, '菜纳乡', 4, 4598), +(39628, '达嘎乡', 4, 4598), +(39629, '卡孜乡', 4, 4599), +(39630, '唐古乡', 4, 4599), +(39631, '强嘎乡', 4, 4599), +(39632, '旁多乡', 4, 4599), +(39633, '春堆乡', 4, 4599), +(39634, '松盘乡', 4, 4599), +(39635, '江热夏乡', 4, 4599), +(39636, '甘丹曲果镇', 4, 4599), +(39637, '边觉林乡', 4, 4599), +(39638, '阿朗乡', 4, 4599), +(39639, '唐嘎乡', 4, 4600), +(39640, '塔吉乡', 4, 4600), +(39641, '德庆镇', 4, 4600), +(39642, '章多乡', 4, 4600), +(39643, '邦堆乡', 4, 4600), +(39644, '雪乡', 4, 4600), +(39645, '丁青镇', 4, 4601), +(39646, '协雄乡', 4, 4601), +(39647, '嘎塔乡', 4, 4601), +(39648, '尺牍镇', 4, 4601), +(39649, '巴达乡', 4, 4601), +(39650, '布塔乡', 4, 4601), +(39651, '当堆乡', 4, 4601), +(39652, '木塔乡', 4, 4601), +(39653, '桑多乡', 4, 4601), +(39654, '沙贡乡', 4, 4601), +(39655, '甘岩乡', 4, 4601), +(39656, '色扎乡', 4, 4601), +(39657, '觉恩乡', 4, 4601), +(39658, '卡瓦百庆乡', 4, 4602); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39659, '吉中乡', 4, 4602), +(39660, '吉达乡', 4, 4602), +(39661, '同卡镇', 4, 4602), +(39662, '夏里乡', 4, 4602), +(39663, '帮达镇', 4, 4602), +(39664, '拉根乡', 4, 4602), +(39665, '拥巴乡', 4, 4602), +(39666, '林卡乡', 4, 4602), +(39667, '然乌镇', 4, 4602), +(39668, '瓦乡', 4, 4602), +(39669, '白玛镇', 4, 4602), +(39670, '益庆乡', 4, 4602), +(39671, '郭庆乡', 4, 4602), +(39672, '卡贡乡', 4, 4603), +(39673, '吉塘镇', 4, 4603), +(39674, '宗沙乡', 4, 4603), +(39675, '察拉乡', 4, 4603), +(39676, '巴日乡', 4, 4603), +(39677, '扩达乡', 4, 4603), +(39678, '新卡乡', 4, 4603), +(39679, '烟多镇', 4, 4603), +(39680, '王卡乡', 4, 4603), +(39681, '肯通乡', 4, 4603), +(39682, '荣周乡', 4, 4603), +(39683, '阿孜乡', 4, 4603), +(39684, '香堆镇', 4, 4603), +(39685, '下林卡乡', 4, 4604), +(39686, '东坝乡', 4, 4604), +(39687, '中林卡乡', 4, 4604), +(39688, '仁果乡', 4, 4604), +(39689, '扎玉镇', 4, 4604), +(39690, '旺达镇', 4, 4604), +(39691, '田妥镇', 4, 4604), +(39692, '碧土乡', 4, 4604), +(39693, '绕金乡', 4, 4604), +(39694, '美玉乡', 4, 4604), +(39695, '俄洛镇', 4, 4605), +(39696, '卡若镇', 4, 4605), +(39697, '嘎玛乡', 4, 4605), +(39698, '埃西乡', 4, 4605), +(39699, '城关镇', 4, 4605), +(39700, '如意乡', 4, 4605), +(39701, '妥坝乡', 4, 4605), +(39702, '拉多乡', 4, 4605), +(39703, '日通乡', 4, 4605), +(39704, '柴堆乡', 4, 4605), +(39705, '沙贡乡', 4, 4605), +(39706, '约巴乡', 4, 4605), +(39707, '芒达乡', 4, 4605), +(39708, '若巴乡', 4, 4605), +(39709, '面达乡', 4, 4605), +(39710, '卡贡乡', 4, 4606), +(39711, '同普乡', 4, 4606), +(39712, '娘西乡', 4, 4606), +(39713, '字嘎乡', 4, 4606), +(39714, '岗托镇', 4, 4606), +(39715, '岩比乡', 4, 4606), +(39716, '德登乡', 4, 4606), +(39717, '江达镇', 4, 4606), +(39718, '汪布顶乡', 4, 4606), +(39719, '波罗乡', 4, 4606), +(39720, '生达乡', 4, 4606), +(39721, '邓柯乡', 4, 4606), +(39722, '青泥洞乡', 4, 4606), +(39723, '中亦乡', 4, 4607), +(39724, '俄西乡', 4, 4607); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39725, '孜托镇', 4, 4607), +(39726, '康沙镇', 4, 4607), +(39727, '新荣乡', 4, 4607), +(39728, '玉西乡', 4, 4607), +(39729, '白达乡', 4, 4607), +(39730, '硕督镇', 4, 4607), +(39731, '腊久乡', 4, 4607), +(39732, '达龙乡', 4, 4607), +(39733, '马利镇', 4, 4607), +(39734, '伊日乡', 4, 4608), +(39735, '加桑卡乡', 4, 4608), +(39736, '卡玛多乡', 4, 4608), +(39737, '吉多乡', 4, 4608), +(39738, '宾达乡', 4, 4608), +(39739, '尚卡乡', 4, 4608), +(39740, '岗色乡', 4, 4608), +(39741, '桑多镇', 4, 4608), +(39742, '类乌齐镇', 4, 4608), +(39743, '长毛岭乡', 4, 4608), +(39744, '嘎托镇', 4, 4609), +(39745, '嘎波乡', 4, 4609), +(39746, '如美镇', 4, 4609), +(39747, '宗西乡', 4, 4609), +(39748, '帮达乡', 4, 4609), +(39749, '徐中乡', 4, 4609), +(39750, '措瓦乡', 4, 4609), +(39751, '昂多乡', 4, 4609), +(39752, '曲孜卡乡', 4, 4609), +(39753, '曲登乡', 4, 4609), +(39754, '木许乡', 4, 4609), +(39755, '朱巴龙乡', 4, 4609), +(39756, '洛尼乡', 4, 4609), +(39757, '索多西乡', 4, 4609), +(39758, '纳西族乡', 4, 4609), +(39759, '莽岭乡', 4, 4609), +(39760, '克日乡', 4, 4610), +(39761, '则巴乡', 4, 4610), +(39762, '哈加乡', 4, 4610), +(39763, '拉妥乡', 4, 4610), +(39764, '敏都乡', 4, 4610), +(39765, '木协乡', 4, 4610), +(39766, '沙东乡', 4, 4610), +(39767, '相皮乡', 4, 4610), +(39768, '罗麦乡', 4, 4610), +(39769, '莫洛镇', 4, 4610), +(39770, '阿旺乡', 4, 4610), +(39771, '雄松乡', 4, 4610), +(39772, '加贡乡', 4, 4611), +(39773, '尼木乡', 4, 4611), +(39774, '拉孜乡', 4, 4611), +(39775, '沙丁乡', 4, 4611), +(39776, '热玉乡', 4, 4611), +(39777, '草卡镇', 4, 4611), +(39778, '边坝镇', 4, 4611), +(39779, '都瓦乡', 4, 4611), +(39780, '金岭乡', 4, 4611), +(39781, '马武乡', 4, 4611), +(39782, '马秀乡', 4, 4611), +(39783, '亚堆乡', 4, 4612), +(39784, '多颇章乡', 4, 4612), +(39785, '昌珠镇', 4, 4612), +(39786, '泽当镇', 4, 4612), +(39787, '索珠乡', 4, 4612), +(39788, '结巴乡', 4, 4612), +(39789, '颇章乡', 4, 4612); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39790, '冷达乡', 4, 4613), +(39791, '加查镇', 4, 4613), +(39792, '坝乡', 4, 4613), +(39793, '安绕镇', 4, 4613), +(39794, '崔久乡', 4, 4613), +(39795, '拉绥乡', 4, 4613), +(39796, '洛林乡', 4, 4613), +(39797, '吉汝乡', 4, 4614), +(39798, '安扎乡', 4, 4614), +(39799, '扎塘镇', 4, 4614), +(39800, '扎期乡', 4, 4614), +(39801, '桑耶镇', 4, 4614), +(39802, '乃西乡', 4, 4615), +(39803, '古堆乡', 4, 4615), +(39804, '哲古镇', 4, 4615), +(39805, '措美镇', 4, 4615), +(39806, '下江乡', 4, 4616), +(39807, '堆随乡', 4, 4616), +(39808, '曲松镇', 4, 4616), +(39809, '罗布沙镇', 4, 4616), +(39810, '邱多江乡', 4, 4616), +(39811, '增期乡', 4, 4617), +(39812, '桑日镇', 4, 4617), +(39813, '白堆乡', 4, 4617), +(39814, '绒乡', 4, 4617), +(39815, '扎日乡', 4, 4618), +(39816, '拉康镇', 4, 4618), +(39817, '拉郊乡', 4, 4618), +(39818, '洛扎镇', 4, 4618), +(39819, '生格乡', 4, 4618), +(39820, '色乡', 4, 4618), +(39821, '边巴乡', 4, 4618), +(39822, '卡热乡', 4, 4619), +(39823, '卡龙乡', 4, 4619), +(39824, '多却乡', 4, 4619), +(39825, '工布学乡', 4, 4619), +(39826, '张达乡', 4, 4619), +(39827, '打隆镇', 4, 4619), +(39828, '普马江塘乡', 4, 4619), +(39829, '浪卡子镇', 4, 4619), +(39830, '自地乡', 4, 4619), +(39831, '阿扎乡', 4, 4619), +(39832, '下水乡', 4, 4620), +(39833, '加麻乡', 4, 4620), +(39834, '拉玉乡', 4, 4620), +(39835, '琼结镇', 4, 4620), +(39836, '东拉乡', 4, 4621), +(39837, '吉雄镇', 4, 4621), +(39838, '岗堆镇', 4, 4621), +(39839, '昌果乡', 4, 4621), +(39840, '朗杰学乡', 4, 4621), +(39841, '杰德秀镇', 4, 4621), +(39842, '江塘镇', 4, 4621), +(39843, '甲竹林镇', 4, 4621), +(39844, '勒门巴族乡', 4, 4622), +(39845, '卡达乡', 4, 4622), +(39846, '吉巴门巴族乡', 4, 4622), +(39847, '库局乡', 4, 4622), +(39848, '曲卓木乡', 4, 4622), +(39849, '浪波乡', 4, 4622), +(39850, '觉拉乡', 4, 4622), +(39851, '贡日门巴族乡', 4, 4622), +(39852, '错那镇', 4, 4622), +(39853, '麻麻门巴族乡', 4, 4622); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39854, '三安曲林乡', 4, 4623), +(39855, '准巴乡', 4, 4623), +(39856, '列麦乡', 4, 4623), +(39857, '加玉乡', 4, 4623), +(39858, '扎日乡', 4, 4623), +(39859, '斗玉乡', 4, 4623), +(39860, '日当镇', 4, 4623), +(39861, '热荣乡', 4, 4623), +(39862, '玉麦乡', 4, 4623), +(39863, '隆子镇', 4, 4623), +(39864, '雪萨乡', 4, 4623), +(39865, '上亚东乡', 4, 4624), +(39866, '下亚东乡', 4, 4624), +(39867, '下司马镇', 4, 4624), +(39868, '吉汝乡', 4, 4624), +(39869, '堆纳乡', 4, 4624), +(39870, '帕里镇', 4, 4624), +(39871, '康布乡', 4, 4624), +(39872, '仁布乡', 4, 4625), +(39873, '切娃乡', 4, 4625), +(39874, '帕当乡', 4, 4625), +(39875, '康雄乡', 4, 4625), +(39876, '普松乡', 4, 4625), +(39877, '查巴乡', 4, 4625), +(39878, '母乡', 4, 4625), +(39879, '然巴乡', 4, 4625), +(39880, '亚热乡', 4, 4626), +(39881, '仁多乡', 4, 4626), +(39882, '偏吉乡', 4, 4626), +(39883, '吉拉乡', 4, 4626), +(39884, '吉玛乡', 4, 4626), +(39885, '布多乡', 4, 4626), +(39886, '帕江乡', 4, 4626), +(39887, '帕羊镇', 4, 4626), +(39888, '拉让乡', 4, 4626), +(39889, '穷果乡', 4, 4626), +(39890, '纳久乡', 4, 4626), +(39891, '隆格尔乡', 4, 4626), +(39892, '霍尔巴乡', 4, 4626), +(39893, '仁堆乡', 4, 4627), +(39894, '南木林镇', 4, 4627), +(39895, '卡孜乡', 4, 4627), +(39896, '土布加乡', 4, 4627), +(39897, '多角乡', 4, 4627), +(39898, '奴玛乡', 4, 4627), +(39899, '拉布普乡', 4, 4627), +(39900, '普当乡', 4, 4627), +(39901, '查尔乡', 4, 4627), +(39902, '热当乡', 4, 4627), +(39903, '甲措乡', 4, 4627), +(39904, '秋木乡', 4, 4627), +(39905, '索金乡', 4, 4627), +(39906, '艾玛乡', 4, 4627), +(39907, '芒热乡', 4, 4627), +(39908, '达孜乡', 4, 4627), +(39909, '达那乡', 4, 4627), +(39910, '吉隆镇', 4, 4628), +(39911, '宗嘎镇', 4, 4628), +(39912, '差那乡', 4, 4628), +(39913, '折巴乡', 4, 4628), +(39914, '贡当乡', 4, 4628), +(39915, '克玛乡', 4, 4629), +(39916, '加措乡', 4, 4629), +(39917, '协格尔镇', 4, 4629), +(39918, '尼辖乡', 4, 4629); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39919, '岗嘎镇', 4, 4629), +(39920, '扎果乡', 4, 4629), +(39921, '扎西宗乡', 4, 4629), +(39922, '措果乡', 4, 4629), +(39923, '曲当乡', 4, 4629), +(39924, '曲洛乡', 4, 4629), +(39925, '盆古乡', 4, 4629), +(39926, '绒辖乡', 4, 4629), +(39927, '长所乡', 4, 4629), +(39928, '多布扎乡', 4, 4630), +(39929, '定结乡', 4, 4630), +(39930, '扎西岗乡', 4, 4630), +(39931, '日屋镇', 4, 4630), +(39932, '江嘎镇', 4, 4630), +(39933, '琼孜乡', 4, 4630), +(39934, '确布乡', 4, 4630), +(39935, '萨尔乡', 4, 4630), +(39936, '郭加乡', 4, 4630), +(39937, '陈塘镇', 4, 4630), +(39938, '孔玛乡', 4, 4631), +(39939, '岗巴镇', 4, 4631), +(39940, '昌龙乡', 4, 4631), +(39941, '直克乡', 4, 4631), +(39942, '龙中乡', 4, 4631), +(39943, '南尼乡', 4, 4632), +(39944, '嘎拉乡', 4, 4632), +(39945, '少岗乡', 4, 4632), +(39946, '康如乡', 4, 4632), +(39947, '康马镇', 4, 4632), +(39948, '涅如堆乡', 4, 4632), +(39949, '涅如麦乡', 4, 4632), +(39950, '莎玛达乡', 4, 4632), +(39951, '雄章乡', 4, 4632), +(39952, '彭措林乡', 4, 4633), +(39953, '扎西宗乡', 4, 4633), +(39954, '扎西岗乡', 4, 4633), +(39955, '拉孜镇', 4, 4633), +(39956, '曲下镇', 4, 4633), +(39957, '曲玛乡', 4, 4633), +(39958, '查务乡', 4, 4633), +(39959, '柳乡', 4, 4633), +(39960, '热莎乡', 4, 4633), +(39961, '芒普乡', 4, 4633), +(39962, '锡钦乡', 4, 4633), +(39963, '东嘎乡', 4, 4634), +(39964, '城北街道', 4, 4634), +(39965, '城南街道', 4, 4634), +(39966, '年木乡', 4, 4634), +(39967, '曲布雄乡', 4, 4634), +(39968, '曲美乡', 4, 4634), +(39969, '江当乡', 4, 4634), +(39970, '甲措雄乡', 4, 4634), +(39971, '纳尔乡', 4, 4634), +(39972, '聂日雄乡', 4, 4634), +(39973, '联乡', 4, 4634), +(39974, '边雄乡', 4, 4634), +(39975, '亚木乡', 4, 4635), +(39976, '切热乡', 4, 4635), +(39977, '卡嘎镇', 4, 4635), +(39978, '多白乡', 4, 4635), +(39979, '如沙乡', 4, 4635), +(39980, '孔隆乡', 4, 4635), +(39981, '尼果乡', 4, 4635), +(39982, '措迈乡', 4, 4635), +(39983, '日吾其乡', 4, 4635); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(39984, '查孜乡', 4, 4635), +(39985, '桑桑镇', 4, 4635), +(39986, '秋窝乡', 4, 4635), +(39987, '贡久布乡', 4, 4635), +(39988, '达居乡', 4, 4635), +(39989, '达若乡', 4, 4635), +(39990, '阿木雄乡', 4, 4635), +(39991, '雄巴乡', 4, 4635), +(39992, '加克西乡', 4, 4636), +(39993, '卡堆乡', 4, 4636), +(39994, '卡麦乡', 4, 4636), +(39995, '年堆乡', 4, 4636), +(39996, '康卓乡', 4, 4636), +(39997, '日星乡', 4, 4636), +(39998, '日朗乡', 4, 4636), +(39999, '江孜镇', 4, 4636), +(40000, '江热乡', 4, 4636), +(40001, '热索乡', 4, 4636), +(40002, '热龙乡', 4, 4636), +(40003, '紫金乡', 4, 4636), +(40004, '纳如乡', 4, 4636), +(40005, '藏改乡', 4, 4636), +(40006, '车仁乡', 4, 4636), +(40007, '达孜乡', 4, 4636), +(40008, '重孜乡', 4, 4636), +(40009, '金嘎乡', 4, 4636), +(40010, '龙马乡', 4, 4636), +(40011, '东喜乡', 4, 4637), +(40012, '嘎东镇', 4, 4637), +(40013, '嘎普乡', 4, 4637), +(40014, '巴扎乡', 4, 4637), +(40015, '强堆乡', 4, 4637), +(40016, '旺丹乡', 4, 4637), +(40017, '曲奴乡', 4, 4637), +(40018, '杜琼乡', 4, 4637), +(40019, '洛江镇', 4, 4637), +(40020, '玛乡', 4, 4637), +(40021, '者下乡', 4, 4637), +(40022, '乃龙乡', 4, 4638), +(40023, '亚来乡', 4, 4638), +(40024, '樟木镇', 4, 4638), +(40025, '波绒乡', 4, 4638), +(40026, '聂拉木镇', 4, 4638), +(40027, '锁作乡', 4, 4638), +(40028, '门布乡', 4, 4638), +(40029, '加加镇', 4, 4639), +(40030, '夏如乡', 4, 4639), +(40031, '如角乡', 4, 4639), +(40032, '拉藏乡', 4, 4639), +(40033, '旦嘎乡', 4, 4639), +(40034, '昌果乡', 4, 4639), +(40035, '达去岭乡', 4, 4639), +(40036, '雄如乡', 4, 4639), +(40037, '吉定镇', 4, 4640), +(40038, '扎西岗乡', 4, 4640), +(40039, '扯休乡', 4, 4640), +(40040, '拉洛乡', 4, 4640), +(40041, '木拉乡', 4, 4640), +(40042, '查荣乡', 4, 4640), +(40043, '萨迦镇', 4, 4640), +(40044, '赛乡', 4, 4640), +(40045, '雄玛乡', 4, 4640), +(40046, '雄麦乡', 4, 4640), +(40047, '麻布加乡', 4, 4640), +(40048, '仁钦则乡', 4, 4641); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40049, '切琼乡', 4, 4641), +(40050, '列巴乡', 4, 4641), +(40051, '南木切乡', 4, 4641), +(40052, '卡嘎镇', 4, 4641), +(40053, '塔丁乡', 4, 4641), +(40054, '娘热乡', 4, 4641), +(40055, '孜许乡', 4, 4641), +(40056, '措布西乡', 4, 4641), +(40057, '春哲乡', 4, 4641), +(40058, '查布乡', 4, 4641), +(40059, '纳当乡', 4, 4641), +(40060, '美巴切勤乡', 4, 4641), +(40061, '荣玛乡', 4, 4641), +(40062, '达塔乡', 4, 4641), +(40063, '达木夏乡', 4, 4641), +(40064, '达那普乡', 4, 4641), +(40065, '通门乡', 4, 4641), +(40066, '青都乡', 4, 4641), +(40067, '嘉黎镇', 4, 4642), +(40068, '夏玛乡', 4, 4642), +(40069, '忠玉乡', 4, 4642), +(40070, '措多乡', 4, 4642), +(40071, '措拉乡', 4, 4642), +(40072, '林堤乡', 4, 4642), +(40073, '绒多乡', 4, 4642), +(40074, '藏比乡', 4, 4642), +(40075, '阿扎镇', 4, 4642), +(40076, '鸽群乡', 4, 4642), +(40077, '多玛乡', 4, 4643), +(40078, '岗尼乡', 4, 4643), +(40079, '帕那镇', 4, 4643), +(40080, '帮爱乡', 4, 4643), +(40081, '强玛镇', 4, 4643), +(40082, '扎仁镇', 4, 4643), +(40083, '扎曲乡', 4, 4643), +(40084, '措玛乡', 4, 4643), +(40085, '滩堆乡', 4, 4643), +(40086, '玛曲乡', 4, 4643), +(40087, '玛荣乡', 4, 4643), +(40088, '色务乡', 4, 4643), +(40089, '雁石坪镇', 4, 4643), +(40090, '中仓乡', 4, 4644), +(40091, '俄久乡', 4, 4644), +(40092, '军仓乡', 4, 4644), +(40093, '卓尼乡', 4, 4644), +(40094, '卓瓦乡', 4, 4644), +(40095, '吉瓦乡', 4, 4644), +(40096, '尼玛镇', 4, 4644), +(40097, '文布乡', 4, 4644), +(40098, '来多乡', 4, 4644), +(40099, '甲谷乡', 4, 4644), +(40100, '申亚乡', 4, 4644), +(40101, '荣玛乡', 4, 4644), +(40102, '达谷乡', 4, 4644), +(40103, '阿索乡', 4, 4644), +(40104, '岗切乡', 4, 4645), +(40105, '巴青乡', 4, 4645), +(40106, '扎色镇', 4, 4645), +(40107, '拉西镇', 4, 4645), +(40108, '本塔乡', 4, 4645), +(40109, '江绵乡', 4, 4645), +(40110, '玛如乡', 4, 4645), +(40111, '贡日乡', 4, 4645), +(40112, '阿秀乡', 4, 4645), +(40113, '雅安镇', 4, 4645); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40114, '夏曲镇', 4, 4646), +(40115, '恰则乡', 4, 4646), +(40116, '扎拉乡', 4, 4646), +(40117, '比如镇', 4, 4646), +(40118, '白嘎乡', 4, 4646), +(40119, '羊秀乡', 4, 4646), +(40120, '良曲乡', 4, 4646), +(40121, '茶曲乡', 4, 4646), +(40122, '达塘乡', 4, 4646), +(40123, '香曲乡', 4, 4646), +(40124, '佳琼镇', 4, 4647), +(40125, '保吉乡', 4, 4647), +(40126, '北拉镇', 4, 4647), +(40127, '尼玛乡', 4, 4647), +(40128, '德庆镇', 4, 4647), +(40129, '新吉乡', 4, 4647), +(40130, '普保镇', 4, 4647), +(40131, '门当乡', 4, 4647), +(40132, '青龙乡', 4, 4647), +(40133, '马前乡', 4, 4647), +(40134, '下过乡', 4, 4648), +(40135, '买巴乡', 4, 4648), +(40136, '卡乡', 4, 4648), +(40137, '塔尔玛乡', 4, 4648), +(40138, '巴扎乡', 4, 4648), +(40139, '申扎镇', 4, 4648), +(40140, '雄梅镇', 4, 4648), +(40141, '马跃乡', 4, 4648), +(40142, '亚拉镇', 4, 4649), +(40143, '加勒乡', 4, 4649), +(40144, '嘎木乡', 4, 4649), +(40145, '嘎美乡', 4, 4649), +(40146, '江达乡', 4, 4649), +(40147, '热瓦乡', 4, 4649), +(40148, '色昌乡', 4, 4649), +(40149, '若达乡', 4, 4649), +(40150, '荣布镇', 4, 4649), +(40151, '赤多乡', 4, 4649), +(40152, '下曲乡', 4, 4650), +(40153, '尼玛乡', 4, 4650), +(40154, '当木江乡', 4, 4650), +(40155, '查当乡', 4, 4650), +(40156, '桑荣乡', 4, 4650), +(40157, '永曲乡', 4, 4650), +(40158, '白雄乡', 4, 4650), +(40159, '索雄乡', 4, 4650), +(40160, '聂荣镇', 4, 4650), +(40161, '色庆乡', 4, 4650), +(40162, '古露镇', 4, 4651), +(40163, '孔玛乡', 4, 4651), +(40164, '尼玛乡', 4, 4651), +(40165, '油恰乡', 4, 4651), +(40166, '洛麦乡', 4, 4651), +(40167, '罗玛镇', 4, 4651), +(40168, '色雄乡', 4, 4651), +(40169, '达前乡', 4, 4651), +(40170, '达萨乡', 4, 4651), +(40171, '那曲镇', 4, 4651), +(40172, '那玛切乡', 4, 4651), +(40173, '香茂乡', 4, 4651), +(40174, '左左乡', 4, 4652), +(40175, '扎西岗乡', 4, 4652), +(40176, '昆莎乡', 4, 4652), +(40177, '狮泉河镇', 4, 4652), +(40178, '门士乡', 4, 4652), +(40179, '措勤镇', 4, 4653); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40180, '曲洛乡', 4, 4653), +(40181, '江让乡', 4, 4653), +(40182, '磁石乡', 4, 4653), +(40183, '达雄乡', 4, 4653), +(40184, '先遣乡', 4, 4654), +(40185, '古姆乡', 4, 4654), +(40186, '察布乡', 4, 4654), +(40187, '改则镇', 4, 4654), +(40188, '洞措乡', 4, 4654), +(40189, '物玛乡', 4, 4654), +(40190, '麻米乡', 4, 4654), +(40191, '东汝乡', 4, 4655), +(40192, '多玛乡', 4, 4655), +(40193, '日土镇', 4, 4655), +(40194, '日松乡', 4, 4655), +(40195, '热帮乡', 4, 4655), +(40196, '巴嘎乡', 4, 4656), +(40197, '普兰镇', 4, 4656), +(40198, '霍尔乡', 4, 4656), +(40199, '底雅乡', 4, 4657), +(40200, '托林镇', 4, 4657), +(40201, '曲松乡', 4, 4657), +(40202, '萨让乡', 4, 4657), +(40203, '达巴乡', 4, 4657), +(40204, '香孜乡', 4, 4657), +(40205, '亚热乡', 4, 4658), +(40206, '文布当桑乡', 4, 4658), +(40207, '盐湖乡', 4, 4658), +(40208, '雄巴乡', 4, 4658), +(40209, '革吉镇', 4, 4658), +(40210, '加拉萨乡', 4, 4659), +(40211, '墨脱镇', 4, 4659), +(40212, '德兴乡', 4, 4659), +(40213, '旁辛乡', 4, 4659), +(40214, '格当乡', 4, 4659), +(40215, '甘登乡', 4, 4659), +(40216, '背崩乡', 4, 4659), +(40217, '达木珞巴族乡', 4, 4659), +(40218, '上察隅镇', 4, 4660), +(40219, '下察隅镇', 4, 4660), +(40220, '古拉乡', 4, 4660), +(40221, '古玉乡', 4, 4660), +(40222, '察瓦龙乡', 4, 4660), +(40223, '竹瓦根镇', 4, 4660), +(40224, '仲莎乡', 4, 4661), +(40225, '加兴乡', 4, 4661), +(40226, '娘蒲乡', 4, 4661), +(40227, '工布江达镇', 4, 4661), +(40228, '巴河镇', 4, 4661), +(40229, '措高乡', 4, 4661), +(40230, '朱拉乡', 4, 4661), +(40231, '江达乡', 4, 4661), +(40232, '金达镇', 4, 4661), +(40233, '仲达镇', 4, 4662), +(40234, '余东乡', 4, 4662), +(40235, '拉多乡', 4, 4662), +(40236, '朗镇', 4, 4662), +(40237, '洞嘎镇', 4, 4662), +(40238, '登木乡', 4, 4662), +(40239, '八一镇', 4, 4663), +(40240, '布久乡', 4, 4663), +(40241, '更章门巴族乡', 4, 4663), +(40242, '林芝镇', 4, 4663), +(40243, '百巴镇', 4, 4663); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40244, '米瑞乡', 4, 4663), +(40245, '鲁朗镇', 4, 4663), +(40246, '倾多镇', 4, 4664), +(40247, '八盖乡', 4, 4664), +(40248, '古乡', 4, 4664), +(40249, '多吉乡', 4, 4664), +(40250, '康玉乡', 4, 4664), +(40251, '扎木镇', 4, 4664), +(40252, '易贡乡', 4, 4664), +(40253, '松宗镇', 4, 4664), +(40254, '玉仁乡', 4, 4664), +(40255, '玉普乡', 4, 4664), +(40256, '许术乡', 4, 4664), +(40257, '丹娘乡', 4, 4665), +(40258, '南伊珞巴族乡', 4, 4665), +(40259, '卧龙镇', 4, 4665), +(40260, '扎西绕登乡', 4, 4665), +(40261, '派镇', 4, 4665), +(40262, '米林镇', 4, 4665), +(40263, '羌纳乡', 4, 4665), +(40264, '里龙乡', 4, 4665), +(40265, '交口镇', 4, 4666), +(40266, '代王街道', 4, 4666), +(40267, '任留乡', 4, 4666), +(40268, '何寨镇', 4, 4666), +(40269, '北田镇', 4, 4666), +(40270, '土桥乡', 4, 4666), +(40271, '小金乡', 4, 4666), +(40272, '徐杨乡', 4, 4666), +(40273, '斜口街道', 4, 4666), +(40274, '新丰街道', 4, 4666), +(40275, '新市乡', 4, 4666), +(40276, '栎阳镇', 4, 4666), +(40277, '油槐镇', 4, 4666), +(40278, '相桥镇', 4, 4666), +(40279, '秦陵街道', 4, 4666), +(40280, '穆寨乡', 4, 4666), +(40281, '行者街道', 4, 4666), +(40282, '西泉镇', 4, 4666), +(40283, '铁炉乡', 4, 4666), +(40284, '雨金镇', 4, 4666), +(40285, '零口镇', 4, 4666), +(40286, '马额镇', 4, 4666), +(40287, '骊山街道', 4, 4666), +(40288, '九峰乡', 4, 4667), +(40289, '二曲镇', 4, 4667), +(40290, '侯家村乡', 4, 4667), +(40291, '厚畛子镇', 4, 4667), +(40292, '司竹乡', 4, 4667), +(40293, '哑柏镇', 4, 4667), +(40294, '四屯乡', 4, 4667), +(40295, '富仁乡', 4, 4667), +(40296, '尚村镇', 4, 4667), +(40297, '广济镇', 4, 4667), +(40298, '板房子乡', 4, 4667), +(40299, '楼观镇', 4, 4667), +(40300, '王家河乡', 4, 4667), +(40301, '竹峪乡', 4, 4667), +(40302, '终南镇', 4, 4667), +(40303, '翠峰乡', 4, 4667), +(40304, '辛家寨乡', 4, 4667), +(40305, '陈河乡', 4, 4667), +(40306, '集贤镇', 4, 4667), +(40307, '青化乡', 4, 4667); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40308, '马召镇', 4, 4667), +(40309, '骆峪乡', 4, 4667), +(40310, '五竹乡', 4, 4668), +(40311, '余下镇', 4, 4668), +(40312, '大王镇', 4, 4668), +(40313, '天桥乡', 4, 4668), +(40314, '庞光镇', 4, 4668), +(40315, '涝店镇', 4, 4668), +(40316, '渭丰乡', 4, 4668), +(40317, '玉蝉乡', 4, 4668), +(40318, '甘亭镇', 4, 4668), +(40319, '甘河镇', 4, 4668), +(40320, '石井镇', 4, 4668), +(40321, '祖庵镇', 4, 4668), +(40322, '秦渡镇', 4, 4668), +(40323, '苍游乡', 4, 4668), +(40324, '草堂镇', 4, 4668), +(40325, '蒋村镇', 4, 4668), +(40326, '中山门街道', 4, 4669), +(40327, '太华路街道', 4, 4669), +(40328, '胡家庙街道', 4, 4669), +(40329, '自强路街道', 4, 4669), +(40330, '西一路街道', 4, 4669), +(40331, '解放门街道', 4, 4669), +(40332, '长乐中路街道', 4, 4669), +(40333, '长乐西路街道', 4, 4669), +(40334, '韩森寨街道', 4, 4669), +(40335, '三桥街道', 4, 4670), +(40336, '六村堡街道', 4, 4670), +(40337, '大明宫街道', 4, 4670), +(40338, '张家堡街道', 4, 4670), +(40339, '徐家湾街道', 4, 4670), +(40340, '未央宫街道', 4, 4670), +(40341, '汉城街道', 4, 4670), +(40342, '草滩街道', 4, 4670), +(40343, '谭家街道', 4, 4670), +(40344, '辛家庙街道', 4, 4670), +(40345, '十里铺街道', 4, 4671), +(40346, '席王街道', 4, 4671), +(40347, '新合街道', 4, 4671), +(40348, '新筑街道', 4, 4671), +(40349, '洪庆街道', 4, 4671), +(40350, '灞桥街道', 4, 4671), +(40351, '狄寨街道', 4, 4671), +(40352, '红旗街道', 4, 4671), +(40353, '纺织城街道', 4, 4671), +(40354, '东关南街街道', 4, 4672), +(40355, '南院门街道', 4, 4672), +(40356, '太乙路街道', 4, 4672), +(40357, '张家村街道', 4, 4672), +(40358, '文艺路街道', 4, 4672), +(40359, '柏树林街道', 4, 4672), +(40360, '长乐坊街道', 4, 4672), +(40361, '长安路街道', 4, 4672), +(40362, '北关街道', 4, 4673), +(40363, '北院门街道', 4, 4673), +(40364, '土门街道', 4, 4673), +(40365, '枣园街道', 4, 4673), +(40366, '桃园路街道', 4, 4673); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40367, '环城西路街道', 4, 4673), +(40368, '红庙坡街道', 4, 4673), +(40369, '西关街道', 4, 4673), +(40370, '青年路街道', 4, 4673), +(40371, '三官庙乡', 4, 4674), +(40372, '三里镇', 4, 4674), +(40373, '九间房乡', 4, 4674), +(40374, '前卫镇', 4, 4674), +(40375, '华胥镇', 4, 4674), +(40376, '厚镇乡', 4, 4674), +(40377, '史家寨乡', 4, 4674), +(40378, '孟村乡', 4, 4674), +(40379, '安村乡', 4, 4674), +(40380, '小寨乡', 4, 4674), +(40381, '普化镇', 4, 4674), +(40382, '汤峪镇', 4, 4674), +(40383, '泄湖镇', 4, 4674), +(40384, '灞源乡', 4, 4674), +(40385, '焦岱镇', 4, 4674), +(40386, '玉山镇', 4, 4674), +(40387, '玉川乡', 4, 4674), +(40388, '葛牌镇', 4, 4674), +(40389, '蓝关镇', 4, 4674), +(40390, '蓝桥乡', 4, 4674), +(40391, '辋川乡', 4, 4674), +(40392, '金山乡', 4, 4674), +(40393, '东大街道', 4, 4675), +(40394, '五台乡', 4, 4675), +(40395, '五星乡', 4, 4675), +(40396, '兴隆乡', 4, 4675), +(40397, '大兆乡', 4, 4675), +(40398, '太乙宫街道', 4, 4675), +(40399, '子午街道', 4, 4675), +(40400, '引镇街道', 4, 4675), +(40401, '斗门街道', 4, 4675), +(40402, '杜曲镇', 4, 4675), +(40403, '杨庄乡', 4, 4675), +(40404, '滦镇街道', 4, 4675), +(40405, '灵沼乡', 4, 4675), +(40406, '炮里乡', 4, 4675), +(40407, '王寺街道', 4, 4675), +(40408, '王曲镇', 4, 4675), +(40409, '王莽乡', 4, 4675), +(40410, '细柳镇', 4, 4675), +(40411, '郭杜街道', 4, 4675), +(40412, '韦曲街道', 4, 4675), +(40413, '马王街道', 4, 4675), +(40414, '高桥乡', 4, 4675), +(40415, '魏寨乡', 4, 4675), +(40416, '鸣犊镇', 4, 4675), +(40417, '黄良乡', 4, 4675), +(40418, '关山镇', 4, 4676), +(40419, '凤凰路街道', 4, 4676), +(40420, '北屯街道', 4, 4676), +(40421, '振兴街道', 4, 4676), +(40422, '新兴街道', 4, 4676), +(40423, '新华路街道', 4, 4676), +(40424, '武屯镇', 4, 4676), +(40425, '丈八沟街道', 4, 4677), +(40426, '大雁塔街道', 4, 4677), +(40427, '小寨路街道', 4, 4677), +(40428, '曲江街道', 4, 4677); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40429, '电子城街道', 4, 4677), +(40430, '等驾坡街道', 4, 4677), +(40431, '长延堡街道', 4, 4677), +(40432, '鱼化寨街道', 4, 4677), +(40433, '崇皇乡', 4, 4678), +(40434, '张卜乡', 4, 4678), +(40435, '榆楚乡', 4, 4678), +(40436, '泾渭镇', 4, 4678), +(40437, '湾子乡', 4, 4678), +(40438, '耿镇', 4, 4678), +(40439, '通远镇', 4, 4678), +(40440, '鹿苑镇', 4, 4678), +(40441, '三里洞街道', 4, 4679), +(40442, '印台乡', 4, 4679), +(40443, '城关街道', 4, 4679), +(40444, '广阳镇', 4, 4679), +(40445, '焦坪街道', 4, 4679), +(40446, '玉华镇', 4, 4679), +(40447, '王石凹街道', 4, 4679), +(40448, '红土镇', 4, 4679), +(40449, '金锁关镇', 4, 4679), +(40450, '阿庄镇', 4, 4679), +(40451, '陈炉镇', 4, 4679), +(40452, '高楼河乡', 4, 4679), +(40453, '云梦乡', 4, 4680), +(40454, '五里镇', 4, 4680), +(40455, '哭泉乡', 4, 4680), +(40456, '城关镇', 4, 4680), +(40457, '太安镇', 4, 4680), +(40458, '尧生乡', 4, 4680), +(40459, '彭镇', 4, 4680), +(40460, '棋盘镇', 4, 4680), +(40461, '西村乡', 4, 4680), +(40462, '雷塬乡', 4, 4680), +(40463, '七一路街道', 4, 4681), +(40464, '桃园街道', 4, 4681), +(40465, '王家河乡', 4, 4681), +(40466, '王益乡', 4, 4681), +(40467, '红旗街街道', 4, 4681), +(40468, '青年路街道', 4, 4681), +(40469, '黄堡镇', 4, 4681), +(40470, '关庄镇', 4, 4682), +(40471, '坡头镇', 4, 4682), +(40472, '天宝路街道', 4, 4682), +(40473, '孙塬镇', 4, 4682), +(40474, '寺沟镇', 4, 4682), +(40475, '小丘镇', 4, 4682), +(40476, '庙湾镇', 4, 4682), +(40477, '柳林镇', 4, 4682), +(40478, '永安路街道', 4, 4682), +(40479, '演池乡', 4, 4682), +(40480, '照金镇', 4, 4682), +(40481, '瑶曲镇', 4, 4682), +(40482, '石柱乡', 4, 4682), +(40483, '董家河镇', 4, 4682), +(40484, '三岔镇', 4, 4683), +(40485, '凤州镇', 4, 4683), +(40486, '南星镇', 4, 4683), +(40487, '双石铺镇', 4, 4683), +(40488, '唐藏镇', 4, 4683), +(40489, '坪坎镇', 4, 4683), +(40490, '岩湾乡', 4, 4683), +(40491, '平木镇', 4, 4683); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40492, '河口镇', 4, 4683), +(40493, '温江寺乡', 4, 4683), +(40494, '红花铺镇', 4, 4683), +(40495, '黄牛铺镇', 4, 4683), +(40496, '南指挥镇', 4, 4684), +(40497, '唐村乡', 4, 4684), +(40498, '城关镇', 4, 4684), +(40499, '姚家沟镇', 4, 4684), +(40500, '尹家务乡', 4, 4684), +(40501, '彪角镇', 4, 4684), +(40502, '柳林镇', 4, 4684), +(40503, '横水镇', 4, 4684), +(40504, '汉封乡', 4, 4684), +(40505, '田家庄镇', 4, 4684), +(40506, '糜杆桥镇', 4, 4684), +(40507, '范家寨乡', 4, 4684), +(40508, '董家河乡', 4, 4684), +(40509, '虢王镇', 4, 4684), +(40510, '郭店镇', 4, 4684), +(40511, '长青镇', 4, 4684), +(40512, '陈村镇', 4, 4684), +(40513, '南寨镇', 4, 4685), +(40514, '城关镇', 4, 4685), +(40515, '寇家河乡', 4, 4685), +(40516, '崔家头镇', 4, 4685), +(40517, '张家塬镇', 4, 4685), +(40518, '文家坡乡', 4, 4685), +(40519, '柿沟乡', 4, 4685), +(40520, '水沟镇', 4, 4685), +(40521, '沙家坳乡', 4, 4685), +(40522, '草碧镇', 4, 4685), +(40523, '高崖乡', 4, 4685), +(40524, '嘴头镇', 4, 4686), +(40525, '太白河镇', 4, 4686), +(40526, '桃川镇', 4, 4686), +(40527, '王家塄乡', 4, 4686), +(40528, '靖口镇', 4, 4686), +(40529, '高龙乡', 4, 4686), +(40530, '鹦鸽镇', 4, 4686), +(40531, '黄柏塬乡', 4, 4686), +(40532, '五丈原镇', 4, 4687), +(40533, '京当乡', 4, 4687), +(40534, '凤鸣镇', 4, 4687), +(40535, '大营乡', 4, 4687), +(40536, '安乐镇', 4, 4687), +(40537, '故郡乡', 4, 4687), +(40538, '曹家镇', 4, 4687), +(40539, '枣林镇', 4, 4687), +(40540, '益店镇', 4, 4687), +(40541, '祝家庄镇', 4, 4687), +(40542, '蒲村镇', 4, 4687), +(40543, '蔡家坡镇', 4, 4687), +(40544, '雍川镇', 4, 4687), +(40545, '青化镇', 4, 4687), +(40546, '上宋乡', 4, 4688), +(40547, '午井镇', 4, 4688), +(40548, '南阳镇', 4, 4688), +(40549, '召公镇', 4, 4688), +(40550, '城关镇', 4, 4688), +(40551, '天度镇', 4, 4688), +(40552, '太白乡', 4, 4688), +(40553, '揉谷乡', 4, 4688), +(40554, '杏林镇', 4, 4688), +(40555, '段家镇', 4, 4688); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40556, '法门镇', 4, 4688), +(40557, '绛帐镇', 4, 4688), +(40558, '八鱼镇', 4, 4689), +(40559, '姜谭路街道', 4, 4689), +(40560, '晁峪乡', 4, 4689), +(40561, '桥南街道', 4, 4689), +(40562, '清姜街道', 4, 4689), +(40563, '石坝河乡', 4, 4689), +(40564, '神农乡', 4, 4689), +(40565, '经二路街道', 4, 4689), +(40566, '金陵街道', 4, 4689), +(40567, '马营镇', 4, 4689), +(40568, '高家村乡', 4, 4689), +(40569, '常兴镇', 4, 4690), +(40570, '槐芽镇', 4, 4690), +(40571, '横渠镇', 4, 4690), +(40572, '汤峪镇', 4, 4690), +(40573, '营头镇', 4, 4690), +(40574, '金渠镇', 4, 4690), +(40575, '青化乡', 4, 4690), +(40576, '首善镇', 4, 4690), +(40577, '马家镇', 4, 4690), +(40578, '齐镇', 4, 4690), +(40579, '东风路街道', 4, 4691), +(40580, '中山东路街道', 4, 4691), +(40581, '中山西路街道', 4, 4691), +(40582, '十里铺街道', 4, 4691), +(40583, '店子街街道', 4, 4691), +(40584, '硖石乡', 4, 4691), +(40585, '群众路街道', 4, 4691), +(40586, '蟠龙镇', 4, 4691), +(40587, '西关街道', 4, 4691), +(40588, '金河乡', 4, 4691), +(40589, '陈仓镇', 4, 4691), +(40590, '陵原乡', 4, 4691), +(40591, '东南镇', 4, 4692), +(40592, '东风镇', 4, 4692), +(40593, '八渡镇', 4, 4692), +(40594, '固关镇', 4, 4692), +(40595, '城关镇', 4, 4692), +(40596, '堎底下镇', 4, 4692), +(40597, '天成镇', 4, 4692), +(40598, '新集川乡', 4, 4692), +(40599, '曹家湾镇', 4, 4692), +(40600, '李家河乡', 4, 4692), +(40601, '杜阳镇', 4, 4692), +(40602, '河北乡', 4, 4692), +(40603, '温水镇', 4, 4692), +(40604, '火烧寨乡', 4, 4692), +(40605, '牙科乡', 4, 4692), +(40606, '凤阁岭镇', 4, 4693), +(40607, '千河镇', 4, 4693), +(40608, '县功镇', 4, 4693), +(40609, '周原镇', 4, 4693), +(40610, '坪头镇', 4, 4693), +(40611, '天王镇', 4, 4693), +(40612, '幕仪镇', 4, 4693), +(40613, '拓石镇', 4, 4693), +(40614, '新街镇', 4, 4693), +(40615, '桥镇', 4, 4693), +(40616, '磻溪镇', 4, 4693), +(40617, '胡店镇', 4, 4693), +(40618, '虢镇', 4, 4693); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40619, '贾村镇', 4, 4693), +(40620, '赤沙镇', 4, 4693), +(40621, '钓渭镇', 4, 4693), +(40622, '阳平镇', 4, 4693), +(40623, '香泉镇', 4, 4693), +(40624, '丈八乡', 4, 4694), +(40625, '两亭镇', 4, 4694), +(40626, '九成宫镇', 4, 4694), +(40627, '天堂镇', 4, 4694), +(40628, '崔木镇', 4, 4694), +(40629, '常丰乡', 4, 4694), +(40630, '招贤镇', 4, 4694), +(40631, '桑树塬乡', 4, 4694), +(40632, '河西乡', 4, 4694), +(40633, '酒房乡', 4, 4694), +(40634, '城关镇', 4, 4695), +(40635, '大程镇', 4, 4695), +(40636, '安乐镇', 4, 4695), +(40637, '嵯峨乡', 4, 4695), +(40638, '徐木乡', 4, 4695), +(40639, '新兴镇', 4, 4695), +(40640, '渠岸乡', 4, 4695), +(40641, '独李镇', 4, 4695), +(40642, '西阳镇', 4, 4695), +(40643, '陂西镇', 4, 4695), +(40644, '陵前镇', 4, 4695), +(40645, '马额镇', 4, 4695), +(40646, '高渠乡', 4, 4695), +(40647, '鲁桥镇', 4, 4695), +(40648, '临平镇', 4, 4696), +(40649, '关头乡', 4, 4696), +(40650, '周城乡', 4, 4696), +(40651, '城关镇', 4, 4696), +(40652, '大墙乡', 4, 4696), +(40653, '大杨乡', 4, 4696), +(40654, '姜村镇', 4, 4696), +(40655, '峰阳镇', 4, 4696), +(40656, '新阳乡', 4, 4696), +(40657, '梁山乡', 4, 4696), +(40658, '梁村镇', 4, 4696), +(40659, '注泔镇', 4, 4696), +(40660, '漠西乡', 4, 4696), +(40661, '灵源镇', 4, 4696), +(40662, '王村镇', 4, 4696), +(40663, '石牛乡', 4, 4696), +(40664, '薛录镇', 4, 4696), +(40665, '阳峪镇', 4, 4696), +(40666, '阳洪镇', 4, 4696), +(40667, '马连镇', 4, 4696), +(40668, '东城街道', 4, 4697), +(40669, '丰仪乡', 4, 4697), +(40670, '南位镇', 4, 4697), +(40671, '南市镇', 4, 4697), +(40672, '庄头镇', 4, 4697), +(40673, '店张街道', 4, 4697), +(40674, '桑镇', 4, 4697), +(40675, '汤坊乡', 4, 4697), +(40676, '田阜乡', 4, 4697), +(40677, '西吴镇', 4, 4697), +(40678, '西城街道', 4, 4697), +(40679, '赵村镇', 4, 4697), +(40680, '阜寨乡', 4, 4697), +(40681, '马嵬镇', 4, 4697), +(40682, '义门镇', 4, 4698), +(40683, '北极镇', 4, 4698), +(40684, '城关镇', 4, 4698); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40685, '太峪乡', 4, 4698), +(40686, '小章镇', 4, 4698), +(40687, '底店乡', 4, 4698), +(40688, '新堡子乡', 4, 4698), +(40689, '新民镇', 4, 4698), +(40690, '水口镇', 4, 4698), +(40691, '永乐镇', 4, 4698), +(40692, '炭店乡', 4, 4698), +(40693, '西坡乡', 4, 4698), +(40694, '车家庄乡', 4, 4698), +(40695, '韩家乡', 4, 4698), +(40696, '香庙乡', 4, 4698), +(40697, '龙高镇', 4, 4698), +(40698, '丈八寺镇', 4, 4699), +(40699, '原底乡', 4, 4699), +(40700, '土桥镇', 4, 4699), +(40701, '城关镇', 4, 4699), +(40702, '太村镇', 4, 4699), +(40703, '底庙镇', 4, 4699), +(40704, '张洪镇', 4, 4699), +(40705, '排厦乡', 4, 4699), +(40706, '清塬乡', 4, 4699), +(40707, '湫坡头镇', 4, 4699), +(40708, '职田镇', 4, 4699), +(40709, '赤道乡', 4, 4699), +(40710, '郑家镇', 4, 4699), +(40711, '马栏镇', 4, 4699), +(40712, '五泉镇', 4, 4700), +(40713, '大寨乡', 4, 4700), +(40714, '李台乡', 4, 4700), +(40715, '杨村乡', 4, 4700), +(40716, '杨陵街道', 4, 4700), +(40717, '代家乡', 4, 4701), +(40718, '南仁乡', 4, 4701), +(40719, '大庄镇', 4, 4701), +(40720, '小村镇', 4, 4701), +(40721, '普集街乡', 4, 4701), +(40722, '普集镇', 4, 4701), +(40723, '武功镇', 4, 4701), +(40724, '河道乡', 4, 4701), +(40725, '游风镇', 4, 4701), +(40726, '苏坊镇', 4, 4701), +(40727, '贞元镇', 4, 4701), +(40728, '长宁镇', 4, 4701), +(40729, '上邑乡', 4, 4702), +(40730, '仪井镇', 4, 4702), +(40731, '常宁镇', 4, 4702), +(40732, '店头镇', 4, 4702), +(40733, '御驾宫乡', 4, 4702), +(40734, '永太乡', 4, 4702), +(40735, '永平乡', 4, 4702), +(40736, '渠子乡', 4, 4702), +(40737, '渡马乡', 4, 4702), +(40738, '甘井镇', 4, 4702), +(40739, '监军镇', 4, 4702), +(40740, '豆家镇', 4, 4702), +(40741, '马坊镇', 4, 4702), +(40742, '三渠镇', 4, 4703), +(40743, '中张镇', 4, 4703), +(40744, '云阳镇', 4, 4703), +(40745, '兴隆镇', 4, 4703), +(40746, '口镇', 4, 4703), +(40747, '太平镇', 4, 4703), +(40748, '崇文乡', 4, 4703), +(40749, '桥底镇', 4, 4703); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40750, '永乐镇', 4, 4703), +(40751, '泾干镇', 4, 4703), +(40752, '燕王乡', 4, 4703), +(40753, '王桥镇', 4, 4703), +(40754, '白王镇', 4, 4703), +(40755, '蒋路乡', 4, 4703), +(40756, '高庄镇', 4, 4703), +(40757, '龙泉乡', 4, 4703), +(40758, '十里塬乡', 4, 4704), +(40759, '卜家乡', 4, 4704), +(40760, '固贤乡', 4, 4704), +(40761, '城关镇', 4, 4704), +(40762, '大店乡', 4, 4704), +(40763, '官庄镇', 4, 4704), +(40764, '方里镇', 4, 4704), +(40765, '润镇', 4, 4704), +(40766, '石桥乡', 4, 4704), +(40767, '秦庄乡', 4, 4704), +(40768, '秦河乡', 4, 4704), +(40769, '胡家庙乡', 4, 4704), +(40770, '车坞乡', 4, 4704), +(40771, '铁王乡', 4, 4704), +(40772, '马家镇', 4, 4704), +(40773, '中山街道', 4, 4705), +(40774, '北杜镇', 4, 4705), +(40775, '周陵镇', 4, 4705), +(40776, '底张镇', 4, 4705), +(40777, '文汇路街道', 4, 4705), +(40778, '新兴街道', 4, 4705), +(40779, '正阳镇', 4, 4705), +(40780, '渭城镇', 4, 4705), +(40781, '渭阳街道', 4, 4705), +(40782, '窑店镇', 4, 4705), +(40783, '南坊镇', 4, 4706), +(40784, '叱干镇', 4, 4706), +(40785, '史德镇', 4, 4706), +(40786, '城关镇', 4, 4706), +(40787, '建陵镇', 4, 4706), +(40788, '新时乡', 4, 4706), +(40789, '昭陵乡', 4, 4706), +(40790, '烟霞镇', 4, 4706), +(40791, '烽火镇', 4, 4706), +(40792, '石潭镇', 4, 4706), +(40793, '药王洞乡', 4, 4706), +(40794, '西张堡镇', 4, 4706), +(40795, '赵镇', 4, 4706), +(40796, '阡东镇', 4, 4706), +(40797, '骏马乡', 4, 4706), +(40798, '人民路街道', 4, 4707), +(40799, '双照镇', 4, 4707), +(40800, '古渡街道', 4, 4707), +(40801, '吴家堡街道', 4, 4707), +(40802, '沣东镇', 4, 4707), +(40803, '渭滨镇', 4, 4707), +(40804, '渭阳西路街道', 4, 4707), +(40805, '西兰路街道', 4, 4707), +(40806, '钓台镇', 4, 4707), +(40807, '陈杨寨街道', 4, 4707), +(40808, '马庄镇', 4, 4707), +(40809, '马泉镇', 4, 4707), +(40810, '丁家镇', 4, 4708), +(40811, '亭口乡', 4, 4708), +(40812, '冉店乡', 4, 4708), +(40813, '地掌乡', 4, 4708); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40814, '巨家镇', 4, 4708), +(40815, '彭公乡', 4, 4708), +(40816, '昭仁镇', 4, 4708), +(40817, '枣元乡', 4, 4708), +(40818, '洪家镇', 4, 4708), +(40819, '相公镇', 4, 4708), +(40820, '芋园乡', 4, 4708), +(40821, '三张镇', 4, 4709), +(40822, '下吉镇', 4, 4709), +(40823, '丰原镇', 4, 4709), +(40824, '交斜镇', 4, 4709), +(40825, '人民街道', 4, 4709), +(40826, '信义乡', 4, 4709), +(40827, '凭信乡', 4, 4709), +(40828, '南师乡', 4, 4709), +(40829, '双王街道', 4, 4709), +(40830, '向阳街道', 4, 4709), +(40831, '吝店镇', 4, 4709), +(40832, '大王乡', 4, 4709), +(40833, '孝义镇', 4, 4709), +(40834, '官底镇', 4, 4709), +(40835, '官路镇', 4, 4709), +(40836, '官道乡', 4, 4709), +(40837, '崇业路街道', 4, 4709), +(40838, '崇宁镇', 4, 4709), +(40839, '故市镇', 4, 4709), +(40840, '杜桥街道', 4, 4709), +(40841, '桥南镇', 4, 4709), +(40842, '河西乡', 4, 4709), +(40843, '田市镇', 4, 4709), +(40844, '站南街道', 4, 4709), +(40845, '良田街道', 4, 4709), +(40846, '解放街道', 4, 4709), +(40847, '辛市镇', 4, 4709), +(40848, '阎村镇', 4, 4709), +(40849, '阳郭镇', 4, 4709), +(40850, '龙背乡', 4, 4709), +(40851, '下庙镇', 4, 4710), +(40852, '东阳乡', 4, 4710), +(40853, '华州镇', 4, 4710), +(40854, '大明镇', 4, 4710), +(40855, '杏林镇', 4, 4710), +(40856, '柳枝镇', 4, 4710), +(40857, '毕家乡', 4, 4710), +(40858, '瓜坡镇', 4, 4710), +(40859, '莲花寺镇', 4, 4710), +(40860, '赤水镇', 4, 4710), +(40861, '辛庄乡', 4, 4710), +(40862, '金堆镇', 4, 4710), +(40863, '金惠乡', 4, 4710), +(40864, '高塘镇', 4, 4710), +(40865, '五方乡', 4, 4711), +(40866, '北社乡', 4, 4711), +(40867, '华西镇', 4, 4711), +(40868, '卫峪乡', 4, 4711), +(40869, '太华路街道', 4, 4711), +(40870, '孟塬镇', 4, 4711), +(40871, '岳庙街道', 4, 4711), +(40872, '敷水镇', 4, 4711), +(40873, '桃下镇', 4, 4711), +(40874, '玉泉街道', 4, 4711), +(40875, '同家庄镇', 4, 4712), +(40876, '和家庄镇', 4, 4712), +(40877, '坊镇', 4, 4712); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40878, '城关镇', 4, 4712), +(40879, '新池镇', 4, 4712), +(40880, '杨家庄乡', 4, 4712), +(40881, '洽川镇', 4, 4712), +(40882, '王村镇', 4, 4712), +(40883, '甘井镇', 4, 4712), +(40884, '百良镇', 4, 4712), +(40885, '皇甫庄镇', 4, 4712), +(40886, '知堡乡', 4, 4712), +(40887, '路井镇', 4, 4712), +(40888, '防虏寨乡', 4, 4712), +(40889, '马家庄乡', 4, 4712), +(40890, '黑池镇', 4, 4712), +(40891, '下寨镇', 4, 4713), +(40892, '两宜镇', 4, 4713), +(40893, '伯士乡', 4, 4713), +(40894, '八鱼乡', 4, 4713), +(40895, '冯村镇', 4, 4713), +(40896, '双泉镇', 4, 4713), +(40897, '城关镇', 4, 4713), +(40898, '埝桥乡', 4, 4713), +(40899, '安仁镇', 4, 4713), +(40900, '官池镇', 4, 4713), +(40901, '平民乡', 4, 4713), +(40902, '张家乡', 4, 4713), +(40903, '户家乡', 4, 4713), +(40904, '朝邑镇', 4, 4713), +(40905, '步昌乡', 4, 4713), +(40906, '段家乡', 4, 4713), +(40907, '沙底乡', 4, 4713), +(40908, '石槽乡', 4, 4713), +(40909, '羌白镇', 4, 4713), +(40910, '苏村乡', 4, 4713), +(40911, '范家镇', 4, 4713), +(40912, '西寨乡', 4, 4713), +(40913, '许庄镇', 4, 4713), +(40914, '赵渡乡', 4, 4713), +(40915, '韦林镇', 4, 4713), +(40916, '高明镇', 4, 4713), +(40917, '东上官乡', 4, 4714), +(40918, '刘集镇', 4, 4714), +(40919, '到贤镇', 4, 4714), +(40920, '华朱乡', 4, 4714), +(40921, '南社乡', 4, 4714), +(40922, '宫里镇', 4, 4714), +(40923, '小惠乡', 4, 4714), +(40924, '峪岭乡', 4, 4714), +(40925, '庄里镇', 4, 4714), +(40926, '底店乡', 4, 4714), +(40927, '张桥镇', 4, 4714), +(40928, '曹村镇', 4, 4714), +(40929, '梅家坪镇', 4, 4714), +(40930, '流曲镇', 4, 4714), +(40931, '淡村镇', 4, 4714), +(40932, '王寮镇', 4, 4714), +(40933, '留古镇', 4, 4714), +(40934, '白庙乡', 4, 4714), +(40935, '窦村镇', 4, 4714), +(40936, '美原镇', 4, 4714), +(40937, '老庙镇', 4, 4714), +(40938, '薛镇', 4, 4714), +(40939, '觅子乡', 4, 4714), +(40940, '齐村乡', 4, 4714), +(40941, '代字营乡', 4, 4715), +(40942, '南头乡', 4, 4715); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(40943, '城关镇', 4, 4715), +(40944, '太要镇', 4, 4715), +(40945, '安乐乡', 4, 4715), +(40946, '桐峪镇', 4, 4715), +(40947, '秦东镇', 4, 4715), +(40948, '高桥乡', 4, 4715), +(40949, '交道镇', 4, 4716), +(40950, '冯原镇', 4, 4716), +(40951, '刘家洼乡', 4, 4716), +(40952, '善化乡', 4, 4716), +(40953, '城关镇', 4, 4716), +(40954, '安里乡', 4, 4716), +(40955, '寺前镇', 4, 4716), +(40956, '尧头镇', 4, 4716), +(40957, '庄头乡', 4, 4716), +(40958, '王庄镇', 4, 4716), +(40959, '罗家洼乡', 4, 4716), +(40960, '赵庄镇', 4, 4716), +(40961, '雷家洼乡', 4, 4716), +(40962, '韦庄镇', 4, 4716), +(40963, '云台乡', 4, 4717), +(40964, '冯雷镇', 4, 4717), +(40965, '北井头乡', 4, 4717), +(40966, '北塬乡', 4, 4717), +(40967, '史官乡', 4, 4717), +(40968, '城关镇', 4, 4717), +(40969, '尧禾镇', 4, 4717), +(40970, '收水乡', 4, 4717), +(40971, '杜康镇', 4, 4717), +(40972, '林皋乡', 4, 4717), +(40973, '纵目乡', 4, 4717), +(40974, '西固镇', 4, 4717), +(40975, '雷村乡', 4, 4717), +(40976, '雷牙乡', 4, 4717), +(40977, '三合乡', 4, 4718), +(40978, '上王乡', 4, 4718), +(40979, '东阳乡', 4, 4718), +(40980, '东陈镇', 4, 4718), +(40981, '党木镇', 4, 4718), +(40982, '兴镇', 4, 4718), +(40983, '原任乡', 4, 4718), +(40984, '坡头镇', 4, 4718), +(40985, '城关镇', 4, 4718), +(40986, '大孔乡', 4, 4718), +(40987, '孙镇', 4, 4718), +(40988, '平路庙乡', 4, 4718), +(40989, '椿林乡', 4, 4718), +(40990, '永丰镇', 4, 4718), +(40991, '洛滨镇', 4, 4718), +(40992, '罕井镇', 4, 4718), +(40993, '翔村乡', 4, 4718), +(40994, '苏坊镇', 4, 4718), +(40995, '荆姚镇', 4, 4718), +(40996, '贾曲乡', 4, 4718), +(40997, '陈庄镇', 4, 4718), +(40998, '高阳镇', 4, 4718), +(40999, '龙池乡', 4, 4718), +(41000, '龙阳镇', 4, 4718), +(41001, '乔子玄乡', 4, 4719), +(41002, '嵬东乡', 4, 4719), +(41003, '新城区街道', 4, 4719), +(41004, '昝村镇', 4, 4719), +(41005, '板桥乡', 4, 4719), +(41006, '桑树坪镇', 4, 4719), +(41007, '独泉乡', 4, 4719); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41008, '王峰乡', 4, 4719), +(41009, '盘龙乡', 4, 4719), +(41010, '芝川镇', 4, 4719), +(41011, '芝阳镇', 4, 4719), +(41012, '薛峰乡', 4, 4719), +(41013, '西庄镇', 4, 4719), +(41014, '金城区街道', 4, 4719), +(41015, '龙亭镇', 4, 4719), +(41016, '龙门镇', 4, 4719), +(41017, '五谷城乡', 4, 4720), +(41018, '吴仓堡乡', 4, 4720), +(41019, '吴旗镇', 4, 4720), +(41020, '周湾镇', 4, 4720), +(41021, '庙沟乡', 4, 4720), +(41022, '新寨乡', 4, 4720), +(41023, '王洼子乡', 4, 4720), +(41024, '白豹镇', 4, 4720), +(41025, '薛岔乡', 4, 4720), +(41026, '铁边城镇', 4, 4720), +(41027, '长城乡', 4, 4720), +(41028, '长官庙乡', 4, 4720), +(41029, '余家坪乡', 4, 4721), +(41030, '南沟岔镇', 4, 4721), +(41031, '史家畔乡', 4, 4721), +(41032, '安定镇', 4, 4721), +(41033, '寺湾乡', 4, 4721), +(41034, '李家岔镇', 4, 4721), +(41035, '杨家园子镇', 4, 4721), +(41036, '栾家坪乡', 4, 4721), +(41037, '涧峪岔镇', 4, 4721), +(41038, '热寺湾乡', 4, 4721), +(41039, '玉家湾镇', 4, 4721), +(41040, '瓦窑堡镇', 4, 4721), +(41041, '马家砭镇', 4, 4721), +(41042, '化子坪镇', 4, 4722), +(41043, '坪桥镇', 4, 4722), +(41044, '招安镇', 4, 4722), +(41045, '楼坪乡', 4, 4722), +(41046, '沿河湾镇', 4, 4722), +(41047, '王家湾乡', 4, 4722), +(41048, '王窑乡', 4, 4722), +(41049, '真武洞街道', 4, 4722), +(41050, '真武洞镇', 4, 4722), +(41051, '砖窑湾镇', 4, 4722), +(41052, '镰刀湾乡', 4, 4722), +(41053, '高桥乡', 4, 4722), +(41054, '丹州镇', 4, 4723), +(41055, '云岩镇', 4, 4723), +(41056, '交里乡', 4, 4723), +(41057, '壶口乡', 4, 4723), +(41058, '寿峰乡', 4, 4723), +(41059, '新市河乡', 4, 4723), +(41060, '牛家细乡', 4, 4723), +(41061, '秋林镇', 4, 4723), +(41062, '英旺乡', 4, 4723), +(41063, '阁楼镇', 4, 4723), +(41064, '集义镇', 4, 4723), +(41065, '高柏乡', 4, 4723), +(41066, '万花山乡', 4, 4724), +(41067, '临镇镇', 4, 4724), +(41068, '元龙寺乡', 4, 4724), +(41069, '冯庄乡', 4, 4724), +(41070, '凤凰山街道', 4, 4724); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41071, '南市街道', 4, 4724), +(41072, '南泥湾镇', 4, 4724), +(41073, '姚店镇', 4, 4724), +(41074, '官庄乡', 4, 4724), +(41075, '宝塔山街道', 4, 4724), +(41076, '川口乡', 4, 4724), +(41077, '李渠镇', 4, 4724), +(41078, '松树林乡', 4, 4724), +(41079, '枣园镇', 4, 4724), +(41080, '柳林镇', 4, 4724), +(41081, '桥沟镇', 4, 4724), +(41082, '梁村乡', 4, 4724), +(41083, '河庄坪镇', 4, 4724), +(41084, '甘谷驿镇', 4, 4724), +(41085, '蟠龙镇', 4, 4724), +(41086, '贯屯乡', 4, 4724), +(41087, '青化砭镇', 4, 4724), +(41088, '麻洞川乡', 4, 4724), +(41089, '交道镇', 4, 4725), +(41090, '北道德乡', 4, 4725), +(41091, '南道德乡', 4, 4725), +(41092, '吉子现乡', 4, 4725), +(41093, '城区街道', 4, 4725), +(41094, '富城镇', 4, 4725), +(41095, '寺仙乡', 4, 4725), +(41096, '张家湾镇', 4, 4725), +(41097, '张村驿镇', 4, 4725), +(41098, '牛武镇', 4, 4725), +(41099, '直罗镇', 4, 4725), +(41100, '羊泉镇', 4, 4725), +(41101, '茶坊镇', 4, 4725), +(41102, '钳二乡', 4, 4725), +(41103, '关庄镇', 4, 4726), +(41104, '冯家坪乡', 4, 4726), +(41105, '土岗乡', 4, 4726), +(41106, '延川镇', 4, 4726), +(41107, '延水关镇', 4, 4726), +(41108, '文安驿镇', 4, 4726), +(41109, '杨家圪台镇', 4, 4726), +(41110, '永坪镇', 4, 4726), +(41111, '眼岔寺乡', 4, 4726), +(41112, '禹居镇', 4, 4726), +(41113, '贺家湾乡', 4, 4726), +(41114, '贾家坪镇', 4, 4726), +(41115, '马家河乡', 4, 4726), +(41116, '高家屯乡', 4, 4726), +(41117, '七里村镇', 4, 4727), +(41118, '交口镇', 4, 4727), +(41119, '刘家河乡', 4, 4727), +(41120, '南河沟乡', 4, 4727), +(41121, '安沟乡', 4, 4727), +(41122, '安河镇', 4, 4727), +(41123, '张家滩镇', 4, 4727), +(41124, '罗子山乡', 4, 4727), +(41125, '郑庄镇', 4, 4727), +(41126, '郭旗乡', 4, 4727), +(41127, '雷赤乡', 4, 4727), +(41128, '黑家堡镇', 4, 4727), +(41129, '义正乡', 4, 4728), +(41130, '保安镇', 4, 4728), +(41131, '双河乡', 4, 4728), +(41132, '吴堡乡', 4, 4728), +(41133, '张渠乡', 4, 4728); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41134, '旦八镇', 4, 4728), +(41135, '杏河镇', 4, 4728), +(41136, '永宁镇', 4, 4728), +(41137, '纸坊乡', 4, 4728), +(41138, '金丁镇', 4, 4728), +(41139, '顺宁镇', 4, 4728), +(41140, '交口河镇', 4, 4729), +(41141, '京兆乡', 4, 4729), +(41142, '凤栖镇', 4, 4729), +(41143, '土基镇', 4, 4729), +(41144, '旧县镇', 4, 4729), +(41145, '朱牛乡', 4, 4729), +(41146, '杨舒乡', 4, 4729), +(41147, '槐柏镇', 4, 4729), +(41148, '永乡乡', 4, 4729), +(41149, '百益乡', 4, 4729), +(41150, '石头镇', 4, 4729), +(41151, '石泉乡', 4, 4729), +(41152, '秦关乡', 4, 4729), +(41153, '老庙镇', 4, 4729), +(41154, '菩堤乡', 4, 4729), +(41155, '黄章乡', 4, 4729), +(41156, '下寺湾镇', 4, 4730), +(41157, '东沟乡', 4, 4730), +(41158, '劳山乡', 4, 4730), +(41159, '城关镇', 4, 4730), +(41160, '桥镇乡', 4, 4730), +(41161, '石门乡', 4, 4730), +(41162, '道镇镇', 4, 4730), +(41163, '高哨乡', 4, 4730), +(41164, '仓村乡', 4, 4731), +(41165, '候庄乡', 4, 4731), +(41166, '双龙镇', 4, 4731), +(41167, '城区街道', 4, 4731), +(41168, '太贤乡', 4, 4731), +(41169, '店头镇', 4, 4731), +(41170, '桥山镇', 4, 4731), +(41171, '田庄镇', 4, 4731), +(41172, '腰坪乡', 4, 4731), +(41173, '阿党镇', 4, 4731), +(41174, '隆坊镇', 4, 4731), +(41175, '三岔乡', 4, 4732), +(41176, '圪台乡', 4, 4732), +(41177, '崾崄乡', 4, 4732), +(41178, '柏峪乡', 4, 4732), +(41179, '瓦子街镇', 4, 4732), +(41180, '界头庙乡', 4, 4732), +(41181, '白马滩镇', 4, 4732), +(41182, '石堡镇', 4, 4732), +(41183, '红石崖乡', 4, 4732), +(41184, '范家卓子乡', 4, 4732), +(41185, '十亩地乡', 4, 4733), +(41186, '大河坝乡', 4, 4733), +(41187, '岳坝乡', 4, 4733), +(41188, '栗子坝乡', 4, 4733), +(41189, '石墩河乡', 4, 4733), +(41190, '袁家庄镇', 4, 4733), +(41191, '西岔河乡', 4, 4733), +(41192, '长角坝乡', 4, 4733), +(41193, '陈家坝镇', 4, 4733), +(41194, '二道河乡', 4, 4734), +(41195, '元墩镇', 4, 4734), +(41196, '勉阳镇', 4, 4734), +(41197, '同沟寺镇', 4, 4734); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41198, '周家山镇', 4, 4734), +(41199, '土关铺乡', 4, 4734), +(41200, '定军山镇', 4, 4734), +(41201, '小河庙乡', 4, 4734), +(41202, '小砭河乡', 4, 4734), +(41203, '张家河乡', 4, 4734), +(41204, '新街子镇', 4, 4734), +(41205, '新铺镇', 4, 4734), +(41206, '武侯镇', 4, 4734), +(41207, '温泉镇', 4, 4734), +(41208, '漆树坝乡', 4, 4734), +(41209, '老道寺镇', 4, 4734), +(41210, '茶店镇', 4, 4734), +(41211, '褒城镇', 4, 4734), +(41212, '金泉镇', 4, 4734), +(41213, '镇川乡', 4, 4734), +(41214, '长林镇', 4, 4734), +(41215, '长沟河乡', 4, 4734), +(41216, '阜川镇', 4, 4734), +(41217, '青羊驿镇', 4, 4734), +(41218, '黄沙镇', 4, 4734), +(41219, '两河乡', 4, 4735), +(41220, '元坝镇', 4, 4735), +(41221, '协税镇', 4, 4735), +(41222, '喜神乡', 4, 4735), +(41223, '圣水镇', 4, 4735), +(41224, '城关镇', 4, 4735), +(41225, '塘口乡', 4, 4735), +(41226, '大河坎镇', 4, 4735), +(41227, '小南海镇', 4, 4735), +(41228, '忍水乡', 4, 4735), +(41229, '新集镇', 4, 4735), +(41230, '梁山镇', 4, 4735), +(41231, '歇马乡', 4, 4735), +(41232, '法镇镇', 4, 4735), +(41233, '湘水镇', 4, 4735), +(41234, '濂水镇', 4, 4735), +(41235, '牟家坝镇', 4, 4735), +(41236, '白玉乡', 4, 4735), +(41237, '碑坝镇', 4, 4735), +(41238, '福成乡', 4, 4735), +(41239, '红庙镇', 4, 4735), +(41240, '胡家营乡', 4, 4735), +(41241, '西河乡', 4, 4735), +(41242, '郭滩乡', 4, 4735), +(41243, '阳春镇', 4, 4735), +(41244, '青树镇', 4, 4735), +(41245, '高台镇', 4, 4735), +(41246, '高家岭乡', 4, 4735), +(41247, '魏家桥乡', 4, 4735), +(41248, '黄官镇', 4, 4735), +(41249, '三合乡', 4, 4736), +(41250, '上元观镇', 4, 4736), +(41251, '二里镇', 4, 4736), +(41252, '五堵镇', 4, 4736), +(41253, '五郎庙乡', 4, 4736), +(41254, '博望镇', 4, 4736), +(41255, '原公镇', 4, 4736), +(41256, '双溪镇', 4, 4736), +(41257, '大盘乡', 4, 4736), +(41258, '天明镇', 4, 4736), +(41259, '孙坪镇', 4, 4736), +(41260, '宝山镇', 4, 4736), +(41261, '小河镇', 4, 4736); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41262, '崔家山镇', 4, 4736), +(41263, '文川镇', 4, 4736), +(41264, '柳林镇', 4, 4736), +(41265, '桔园镇', 4, 4736), +(41266, '水磨镇', 4, 4736), +(41267, '沙河营镇', 4, 4736), +(41268, '盐井乡', 4, 4736), +(41269, '盘龙乡', 4, 4736), +(41270, '老庄镇', 4, 4736), +(41271, '董家营乡', 4, 4736), +(41272, '龙头镇', 4, 4736), +(41273, '东皇沟乡', 4, 4737), +(41274, '二郎坝乡', 4, 4737), +(41275, '代家坝镇', 4, 4737), +(41276, '南屏乡', 4, 4737), +(41277, '大安镇', 4, 4737), +(41278, '太阳岭乡', 4, 4737), +(41279, '安乐河乡', 4, 4737), +(41280, '宽川乡', 4, 4737), +(41281, '巨亭乡', 4, 4737), +(41282, '巩家河乡', 4, 4737), +(41283, '巴山镇', 4, 4737), +(41284, '广坪镇', 4, 4737), +(41285, '庙坝乡', 4, 4737), +(41286, '曾家河乡', 4, 4737), +(41287, '毛坝河镇', 4, 4737), +(41288, '汉源镇', 4, 4737), +(41289, '燕子砭镇', 4, 4737), +(41290, '禅家岩乡', 4, 4737), +(41291, '胡家坝镇', 4, 4737), +(41292, '舒家坝乡', 4, 4737), +(41293, '苍社乡', 4, 4737), +(41294, '铁锁关镇', 4, 4737), +(41295, '阳平关镇', 4, 4737), +(41296, '青木川镇', 4, 4737), +(41297, '高寨子镇', 4, 4737), +(41298, '黄坝驿乡', 4, 4737), +(41299, '七里街道', 4, 4738), +(41300, '东关街道', 4, 4738), +(41301, '东大街街道', 4, 4738), +(41302, '中山街街道', 4, 4738), +(41303, '北关街道', 4, 4738), +(41304, '宗营镇', 4, 4738), +(41305, '徐家坡乡', 4, 4738), +(41306, '望江乡', 4, 4738), +(41307, '武乡镇', 4, 4738), +(41308, '汉中路街道', 4, 4738), +(41309, '汉王镇', 4, 4738), +(41310, '河东店镇', 4, 4738), +(41311, '老君镇', 4, 4738), +(41312, '舒家营街道', 4, 4738), +(41313, '鑫源街道', 4, 4738), +(41314, '铺镇镇', 4, 4738), +(41315, '龙江镇', 4, 4738), +(41316, '八里关乡', 4, 4739), +(41317, '关帝乡', 4, 4739), +(41318, '华阳镇', 4, 4739), +(41319, '四郎乡', 4, 4739), +(41320, '戚氏镇', 4, 4739), +(41321, '桑溪乡', 4, 4739), +(41322, '槐树关镇', 4, 4739), +(41323, '洋州镇', 4, 4739); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41324, '溢水镇', 4, 4739), +(41325, '白石乡', 4, 4739), +(41326, '石关乡', 4, 4739), +(41327, '磨子桥镇', 4, 4739), +(41328, '秧田乡', 4, 4739), +(41329, '窑坪乡', 4, 4739), +(41330, '胥水镇', 4, 4739), +(41331, '茅坪镇', 4, 4739), +(41332, '草庙乡', 4, 4739), +(41333, '谢村镇', 4, 4739), +(41334, '贯溪镇', 4, 4739), +(41335, '金水镇', 4, 4739), +(41336, '长溪乡', 4, 4739), +(41337, '马畅镇', 4, 4739), +(41338, '黄安镇', 4, 4739), +(41339, '黄家营镇', 4, 4739), +(41340, '黄金峡镇', 4, 4739), +(41341, '龙亭镇', 4, 4739), +(41342, '城关镇', 4, 4740), +(41343, '桑元坝乡', 4, 4740), +(41344, '武关驿镇', 4, 4740), +(41345, '江口镇', 4, 4740), +(41346, '火烧店乡', 4, 4740), +(41347, '玉皇庙乡', 4, 4740), +(41348, '留侯镇', 4, 4740), +(41349, '青桥驿乡', 4, 4740), +(41350, '马道镇', 4, 4740), +(41351, '两河口镇', 4, 4741), +(41352, '乐素河镇', 4, 4741), +(41353, '九中金乡', 4, 4741), +(41354, '仙台坝乡', 4, 4741), +(41355, '何家岩镇', 4, 4741), +(41356, '史家院乡', 4, 4741), +(41357, '城关镇', 4, 4741), +(41358, '徐家坪镇', 4, 4741), +(41359, '接官亭镇', 4, 4741), +(41360, '横现河镇', 4, 4741), +(41361, '白水江镇', 4, 4741), +(41362, '白石沟乡', 4, 4741), +(41363, '白雀寺乡', 4, 4741), +(41364, '硖口驿镇', 4, 4741), +(41365, '西淮坝乡', 4, 4741), +(41366, '观音寺乡', 4, 4741), +(41367, '郭镇镇', 4, 4741), +(41368, '金家河镇', 4, 4741), +(41369, '马蹄湾乡', 4, 4741), +(41370, '鱼洞子乡', 4, 4741), +(41371, '黑河坝乡', 4, 4741), +(41372, '三花石乡', 4, 4742), +(41373, '两河口镇', 4, 4742), +(41374, '五里坝镇', 4, 4742), +(41375, '古城镇', 4, 4742), +(41376, '司上乡', 4, 4742), +(41377, '城关镇', 4, 4742), +(41378, '堰口镇', 4, 4742), +(41379, '大河镇', 4, 4742), +(41380, '子午乡', 4, 4742), +(41381, '峡口镇', 4, 4742), +(41382, '左溪乡', 4, 4742), +(41383, '杨河镇', 4, 4742), +(41384, '柳树镇', 4, 4742), +(41385, '桑园镇', 4, 4742), +(41386, '沙河镇', 4, 4742); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41387, '白勉峡乡', 4, 4742), +(41388, '白龙塘镇', 4, 4742), +(41389, '私渡镇', 4, 4742), +(41390, '罗镇乡', 4, 4742), +(41391, '茶镇', 4, 4742), +(41392, '钟家沟乡', 4, 4742), +(41393, '马家湾乡', 4, 4742), +(41394, '高川镇', 4, 4742), +(41395, '三元镇', 4, 4743), +(41396, '三溪乡', 4, 4743), +(41397, '仁村乡', 4, 4743), +(41398, '兴隆镇', 4, 4743), +(41399, '大池乡', 4, 4743), +(41400, '小洋镇', 4, 4743), +(41401, '巴山乡', 4, 4743), +(41402, '巴庙镇', 4, 4743), +(41403, '平安乡', 4, 4743), +(41404, '杨家河乡', 4, 4743), +(41405, '永乐乡', 4, 4743), +(41406, '泾洋镇', 4, 4743), +(41407, '渔度镇', 4, 4743), +(41408, '田坝乡', 4, 4743), +(41409, '盐场镇', 4, 4743), +(41410, '碾子镇', 4, 4743), +(41411, '简池镇', 4, 4743), +(41412, '观音镇', 4, 4743), +(41413, '赤南乡', 4, 4743), +(41414, '长岭镇', 4, 4743), +(41415, '陈家滩乡', 4, 4743), +(41416, '青水乡', 4, 4743), +(41417, '麻柳滩乡', 4, 4743), +(41418, '黎坝乡', 4, 4743), +(41419, '上高寨乡', 4, 4744), +(41420, '乌镇', 4, 4744), +(41421, '佳芦镇', 4, 4744), +(41422, '兴隆寺乡', 4, 4744), +(41423, '刘国具乡', 4, 4744), +(41424, '刘家山乡', 4, 4744), +(41425, '坑镇', 4, 4744), +(41426, '大佛寺乡', 4, 4744), +(41427, '官庄乡', 4, 4744), +(41428, '峪口乡', 4, 4744), +(41429, '店镇', 4, 4744), +(41430, '康家港乡', 4, 4744), +(41431, '方塌镇', 4, 4744), +(41432, '木头峪乡', 4, 4744), +(41433, '朱官寨乡', 4, 4744), +(41434, '朱家坬乡', 4, 4744), +(41435, '王家砭镇', 4, 4744), +(41436, '螅镇乡', 4, 4744), +(41437, '通镇', 4, 4744), +(41438, '金明寺镇', 4, 4744), +(41439, '丁家湾乡', 4, 4745), +(41440, '宋家川镇', 4, 4745), +(41441, '寇家塬镇', 4, 4745), +(41442, '岔上乡', 4, 4745), +(41443, '张家山乡', 4, 4745), +(41444, '薛下村乡', 4, 4745), +(41445, '辛家沟镇', 4, 4745), +(41446, '郭家沟镇', 4, 4745), +(41447, '三川口镇', 4, 4746), +(41448, '何家集镇', 4, 4746), +(41449, '双湖峪镇', 4, 4746); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41450, '周家碱镇', 4, 4746), +(41451, '李孝河乡', 4, 4746), +(41452, '槐树岔乡', 4, 4746), +(41453, '水地湾乡', 4, 4746), +(41454, '淮宁湾乡', 4, 4746), +(41455, '瓜园则湾乡', 4, 4746), +(41456, '电市镇', 4, 4746), +(41457, '砖庙镇', 4, 4746), +(41458, '老君殿镇', 4, 4746), +(41459, '苗家坪镇', 4, 4746), +(41460, '裴家湾镇', 4, 4746), +(41461, '马岔乡', 4, 4746), +(41462, '马蹄沟镇', 4, 4746), +(41463, '驼耳巷乡', 4, 4746), +(41464, '高家坪乡', 4, 4746), +(41465, '冯地坑乡', 4, 4747), +(41466, '周台子乡', 4, 4747), +(41467, '堆子梁镇', 4, 4747), +(41468, '姬塬镇', 4, 4747), +(41469, '学庄乡', 4, 4747), +(41470, '安边镇', 4, 4747), +(41471, '定边镇', 4, 4747), +(41472, '张要先乡', 4, 4747), +(41473, '新安边镇', 4, 4747), +(41474, '杨井镇', 4, 4747), +(41475, '樊学乡', 4, 4747), +(41476, '武峁子乡', 4, 4747), +(41477, '油房庄乡', 4, 4747), +(41478, '王盘山乡', 4, 4747), +(41479, '白泥井镇', 4, 4747), +(41480, '白湾子镇', 4, 4747), +(41481, '白马要先乡', 4, 4747), +(41482, '盐场堡乡', 4, 4747), +(41483, '石洞沟乡', 4, 4747), +(41484, '砖井镇', 4, 4747), +(41485, '红柳沟镇', 4, 4747), +(41486, '纪畔乡', 4, 4747), +(41487, '贺圈镇', 4, 4747), +(41488, '郝滩乡', 4, 4747), +(41489, '黄湾乡', 4, 4747), +(41490, '三道沟乡', 4, 4748), +(41491, '古城乡', 4, 4748), +(41492, '哈镇镇', 4, 4748), +(41493, '墙头乡', 4, 4748), +(41494, '大昌汗乡', 4, 4748), +(41495, '孤山镇', 4, 4748), +(41496, '庙沟门镇', 4, 4748), +(41497, '府谷镇', 4, 4748), +(41498, '新民镇', 4, 4748), +(41499, '木瓜乡', 4, 4748), +(41500, '武家庄乡', 4, 4748), +(41501, '海则庙乡', 4, 4748), +(41502, '清水乡', 4, 4748), +(41503, '王家墩乡', 4, 4748), +(41504, '田家寨乡', 4, 4748), +(41505, '碛楞乡', 4, 4748), +(41506, '老高川乡', 4, 4748), +(41507, '赵五家湾乡', 4, 4748), +(41508, '麻镇镇', 4, 4748), +(41509, '黄甫镇', 4, 4748), +(41510, '上盐湾镇', 4, 4749), +(41511, '上郡路街道', 4, 4749); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41512, '余兴庄乡', 4, 4749), +(41513, '刘千河乡', 4, 4749), +(41514, '古塔乡', 4, 4749), +(41515, '大河塔乡', 4, 4749), +(41516, '孟家湾乡', 4, 4749), +(41517, '安崖镇', 4, 4749), +(41518, '小壕兔乡', 4, 4749), +(41519, '小纪汗乡', 4, 4749), +(41520, '岔河则乡', 4, 4749), +(41521, '巴拉素镇', 4, 4749), +(41522, '新明楼街道', 4, 4749), +(41523, '榆阳镇', 4, 4749), +(41524, '清泉镇', 4, 4749), +(41525, '牛家梁镇', 4, 4749), +(41526, '红石桥乡', 4, 4749), +(41527, '芹河乡', 4, 4749), +(41528, '补浪河乡', 4, 4749), +(41529, '金鸡滩镇', 4, 4749), +(41530, '镇川镇', 4, 4749), +(41531, '青云乡', 4, 4749), +(41532, '青山路街道', 4, 4749), +(41533, '马合镇', 4, 4749), +(41534, '鱼河峁镇', 4, 4749), +(41535, '鱼河镇', 4, 4749), +(41536, '麻黄梁镇', 4, 4749), +(41537, '鼓楼街道', 4, 4749), +(41538, '党岔镇', 4, 4750), +(41539, '南塔乡', 4, 4750), +(41540, '双城乡', 4, 4750), +(41541, '响水镇', 4, 4750), +(41542, '塔湾镇', 4, 4750), +(41543, '横山镇', 4, 4750), +(41544, '武镇镇', 4, 4750), +(41545, '殿市镇', 4, 4750), +(41546, '波罗镇', 4, 4750), +(41547, '白界乡', 4, 4750), +(41548, '石湾镇', 4, 4750), +(41549, '石窑沟乡', 4, 4750), +(41550, '艾好峁乡', 4, 4750), +(41551, '赵石畔镇', 4, 4750), +(41552, '雷龙湾乡', 4, 4750), +(41553, '韩岔乡', 4, 4750), +(41554, '高镇镇', 4, 4750), +(41555, '魏家楼乡', 4, 4750), +(41556, '下廿里铺乡', 4, 4751), +(41557, '乐堂堡乡', 4, 4751), +(41558, '二郎山乡', 4, 4751), +(41559, '双庙河乡', 4, 4751), +(41560, '宽洲镇', 4, 4751), +(41561, '店则沟镇', 4, 4751), +(41562, '折家坪镇', 4, 4751), +(41563, '李家塔镇', 4, 4751), +(41564, '玉家河镇', 4, 4751), +(41565, '石咀驿镇', 4, 4751), +(41566, '石盘乡', 4, 4751), +(41567, '老舍窠乡', 4, 4751), +(41568, '解家沟镇', 4, 4751), +(41569, '郝家也乡', 4, 4751), +(41570, '高杰村镇', 4, 4751), +(41571, '万镇镇', 4, 4752), +(41572, '中鸡镇', 4, 4752), +(41573, '乔岔滩乡', 4, 4752); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41574, '大保当镇', 4, 4752), +(41575, '大柳塔镇', 4, 4752), +(41576, '太和寨乡', 4, 4752), +(41577, '孙家岔镇', 4, 4752), +(41578, '尔林兔镇', 4, 4752), +(41579, '店塔镇', 4, 4752), +(41580, '栏杆堡镇', 4, 4752), +(41581, '沙峁镇', 4, 4752), +(41582, '神木镇', 4, 4752), +(41583, '花石崖镇', 4, 4752), +(41584, '解家堡乡', 4, 4752), +(41585, '贺家川镇', 4, 4752), +(41586, '锦界镇', 4, 4752), +(41587, '马镇镇', 4, 4752), +(41588, '高家堡镇', 4, 4752), +(41589, '麻家塔乡', 4, 4752), +(41590, '十里铺乡', 4, 4753), +(41591, '印斗镇', 4, 4753), +(41592, '姬家岔乡', 4, 4753), +(41593, '李家站乡', 4, 4753), +(41594, '杜家石沟镇', 4, 4753), +(41595, '杨家沟镇', 4, 4753), +(41596, '桃镇镇', 4, 4753), +(41597, '桥河岔乡', 4, 4753), +(41598, '沙家店镇', 4, 4753), +(41599, '郭兴庄乡', 4, 4753), +(41600, '银洲镇', 4, 4753), +(41601, '高渠乡', 4, 4753), +(41602, '龙镇镇', 4, 4753), +(41603, '中角乡', 4, 4754), +(41604, '义合镇', 4, 4754), +(41605, '吉镇镇', 4, 4754), +(41606, '名州镇', 4, 4754), +(41607, '四十铺镇', 4, 4754), +(41608, '定仙墕镇', 4, 4754), +(41609, '崔家湾镇', 4, 4754), +(41610, '张家砭乡', 4, 4754), +(41611, '枣林坪镇', 4, 4754), +(41612, '河底乡', 4, 4754), +(41613, '满堂川乡', 4, 4754), +(41614, '田庄镇', 4, 4754), +(41615, '白家碱乡', 4, 4754), +(41616, '石家湾镇', 4, 4754), +(41617, '薛家峁镇', 4, 4754), +(41618, '薛家河镇', 4, 4754), +(41619, '赵家砭乡', 4, 4754), +(41620, '辛店乡', 4, 4754), +(41621, '韭园沟乡', 4, 4754), +(41622, '马家川乡', 4, 4754), +(41623, '东坑镇', 4, 4755), +(41624, '中山界镇', 4, 4755), +(41625, '乔沟湾乡', 4, 4755), +(41626, '五里湾乡', 4, 4755), +(41627, '周河镇', 4, 4755), +(41628, '大路沟乡', 4, 4755), +(41629, '天赐湾乡', 4, 4755), +(41630, '宁条梁镇', 4, 4755), +(41631, '小河乡', 4, 4755), +(41632, '席麻湾乡', 4, 4755), +(41633, '张畔镇', 4, 4755), +(41634, '新城乡', 4, 4755), +(41635, '杨桥畔镇', 4, 4755); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41636, '杨米涧乡', 4, 4755), +(41637, '海则滩乡', 4, 4755), +(41638, '王渠则镇', 4, 4755), +(41639, '红墩界镇', 4, 4755), +(41640, '镇靖乡', 4, 4755), +(41641, '青阳岔镇', 4, 4755), +(41642, '高家沟乡', 4, 4755), +(41643, '黄蒿界乡', 4, 4755), +(41644, '龙洲乡', 4, 4755), +(41645, '丰富乡', 4, 4756), +(41646, '四亩地镇', 4, 4756), +(41647, '城关镇', 4, 4756), +(41648, '太山庙乡', 4, 4756), +(41649, '广货街镇', 4, 4756), +(41650, '新场乡', 4, 4756), +(41651, '旬阳坝镇', 4, 4756), +(41652, '梅子乡', 4, 4756), +(41653, '江口镇', 4, 4756), +(41654, '汤坪镇', 4, 4756), +(41655, '皇冠镇', 4, 4756), +(41656, '筒车湾镇', 4, 4756), +(41657, '金川镇', 4, 4756), +(41658, '龙王镇', 4, 4756), +(41659, '佐龙镇', 4, 4757), +(41660, '四季乡', 4, 4757), +(41661, '城关镇', 4, 4757), +(41662, '堰门乡', 4, 4757), +(41663, '大道河镇', 4, 4757), +(41664, '孟石岭乡', 4, 4757), +(41665, '官元镇', 4, 4757), +(41666, '晓道乡', 4, 4757), +(41667, '横溪乡', 4, 4757), +(41668, '民主镇', 4, 4757), +(41669, '溢河乡', 4, 4757), +(41670, '滔河镇', 4, 4757), +(41671, '漳河乡', 4, 4757), +(41672, '石门镇', 4, 4757), +(41673, '花里镇', 4, 4757), +(41674, '蔺河乡', 4, 4757), +(41675, '铁炉乡', 4, 4757), +(41676, '三阳镇', 4, 4758), +(41677, '八仙镇', 4, 4758), +(41678, '兴隆镇', 4, 4758), +(41679, '城关镇', 4, 4758), +(41680, '大贵镇', 4, 4758), +(41681, '女娲山乡', 4, 4758), +(41682, '广佛镇', 4, 4758), +(41683, '正阳乡', 4, 4758), +(41684, '洛河镇', 4, 4758), +(41685, '老县镇', 4, 4758), +(41686, '西河乡', 4, 4758), +(41687, '长安镇', 4, 4758), +(41688, '仁河口乡', 4, 4759), +(41689, '仙河乡', 4, 4759), +(41690, '公馆乡', 4, 4759), +(41691, '兰滩乡', 4, 4759), +(41692, '关口镇', 4, 4759), +(41693, '双河镇', 4, 4759), +(41694, '吕河镇', 4, 4759), +(41695, '城关镇', 4, 4759), +(41696, '小河镇', 4, 4759), +(41697, '庙坪乡', 4, 4759), +(41698, '张坪乡', 4, 4759), +(41699, '构元乡', 4, 4759); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41700, '桂花乡', 4, 4759), +(41701, '桐木乡', 4, 4759), +(41702, '棕溪镇', 4, 4759), +(41703, '段家河', 4, 4759), +(41704, '沙阳乡', 4, 4759), +(41705, '甘溪镇', 4, 4759), +(41706, '白柳镇', 4, 4759), +(41707, '石门乡', 4, 4759), +(41708, '神河镇', 4, 4759), +(41709, '红军乡', 4, 4759), +(41710, '蜀河镇', 4, 4759), +(41711, '赤岩镇', 4, 4759), +(41712, '赵湾镇', 4, 4759), +(41713, '金寨乡', 4, 4759), +(41714, '铜钱关乡', 4, 4759), +(41715, '麻坪镇', 4, 4759), +(41716, '东镇乡', 4, 4760), +(41717, '中原镇', 4, 4760), +(41718, '五里镇', 4, 4760), +(41719, '共进乡', 4, 4760), +(41720, '关家乡', 4, 4760), +(41721, '关庙镇', 4, 4760), +(41722, '前进乡', 4, 4760), +(41723, '南溪乡', 4, 4760), +(41724, '县河乡', 4, 4760), +(41725, '双溪乡', 4, 4760), +(41726, '双龙镇', 4, 4760), +(41727, '叶坪镇', 4, 4760), +(41728, '吉河镇', 4, 4760), +(41729, '坝河乡', 4, 4760), +(41730, '大同镇', 4, 4760), +(41731, '大河镇', 4, 4760), +(41732, '大竹园镇', 4, 4760), +(41733, '富强乡', 4, 4760), +(41734, '建民镇', 4, 4760), +(41735, '张滩镇', 4, 4760), +(41736, '恒口镇', 4, 4760), +(41737, '新坝乡', 4, 4760), +(41738, '新城街道', 4, 4760), +(41739, '早阳乡', 4, 4760), +(41740, '晏坝乡', 4, 4760), +(41741, '梅子铺镇', 4, 4760), +(41742, '江北街道', 4, 4760), +(41743, '沈坝镇', 4, 4760), +(41744, '沙坝乡', 4, 4760), +(41745, '河西镇', 4, 4760), +(41746, '洪山镇', 4, 4760), +(41747, '流水镇', 4, 4760), +(41748, '瀛湖镇', 4, 4760), +(41749, '牛蹄乡', 4, 4760), +(41750, '玉岚乡', 4, 4760), +(41751, '田坝乡', 4, 4760), +(41752, '石梯乡', 4, 4760), +(41753, '石转镇', 4, 4760), +(41754, '老城街道', 4, 4760), +(41755, '花园乡', 4, 4760), +(41756, '茨沟镇', 4, 4760), +(41757, '荆河乡', 4, 4760), +(41758, '谭坝乡', 4, 4760), +(41759, '迎风乡', 4, 4760), +(41760, '运溪乡', 4, 4760), +(41761, '香山乡', 4, 4760), +(41762, '上七镇', 4, 4761), +(41763, '双乳镇', 4, 4761), +(41764, '双坪乡', 4, 4761); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41765, '双河口镇', 4, 4761), +(41766, '城关镇', 4, 4761), +(41767, '平梁镇', 4, 4761), +(41768, '永宁乡', 4, 4761), +(41769, '汉阳镇', 4, 4761), +(41770, '涧池镇', 4, 4761), +(41771, '漩涡镇', 4, 4761), +(41772, '田禾乡', 4, 4761), +(41773, '石条街乡', 4, 4761), +(41774, '蒲溪镇', 4, 4761), +(41775, '观音河乡', 4, 4761), +(41776, '酒店镇', 4, 4761), +(41777, '铁佛寺镇', 4, 4761), +(41778, '铜钱乡', 4, 4761), +(41779, '龙垭镇', 4, 4761), +(41780, '中厂镇', 4, 4762), +(41781, '仓上镇', 4, 4762), +(41782, '冷水镇', 4, 4762), +(41783, '卡子镇', 4, 4762), +(41784, '双河乡', 4, 4762), +(41785, '四新乡', 4, 4762), +(41786, '城关镇', 4, 4762), +(41787, '大双乡', 4, 4762), +(41788, '宋家镇', 4, 4762), +(41789, '小双乡', 4, 4762), +(41790, '构扒镇', 4, 4762), +(41791, '桃元乡', 4, 4762), +(41792, '茅坪镇', 4, 4762), +(41793, '西营镇', 4, 4762), +(41794, '麻虎乡', 4, 4762), +(41795, '两河镇', 4, 4763), +(41796, '中坝乡', 4, 4763), +(41797, '中池乡', 4, 4763), +(41798, '后柳镇', 4, 4763), +(41799, '喜河镇', 4, 4763), +(41800, '城关镇', 4, 4763), +(41801, '曾溪乡', 4, 4763), +(41802, '池河镇', 4, 4763), +(41803, '熨斗镇', 4, 4763), +(41804, '红卫乡', 4, 4763), +(41805, '迎丰镇', 4, 4763), +(41806, '银桥乡', 4, 4763), +(41807, '银龙乡', 4, 4763), +(41808, '长阳乡', 4, 4763), +(41809, '饶峰镇', 4, 4763), +(41810, '东木乡', 4, 4764), +(41811, '双安乡', 4, 4764), +(41812, '双桥镇', 4, 4764), +(41813, '向阳镇', 4, 4764), +(41814, '城关镇', 4, 4764), +(41815, '广城乡', 4, 4764), +(41816, '斑桃镇', 4, 4764), +(41817, '毛坝镇', 4, 4764), +(41818, '汉王镇', 4, 4764), +(41819, '洄水镇', 4, 4764), +(41820, '洞河镇', 4, 4764), +(41821, '焕古镇', 4, 4764), +(41822, '燎原乡', 4, 4764), +(41823, '瓦庙镇', 4, 4764), +(41824, '界岭乡', 4, 4764), +(41825, '红椿镇', 4, 4764), +(41826, '绕溪乡', 4, 4764), +(41827, '联合乡', 4, 4764), +(41828, '芭蕉乡', 4, 4764), +(41829, '苗河乡', 4, 4764), +(41830, '蒿坪镇', 4, 4764); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41831, '金川乡', 4, 4764), +(41832, '高桥镇', 4, 4764), +(41833, '高滩镇', 4, 4764), +(41834, '麻柳镇', 4, 4764), +(41835, '上竹乡', 4, 4765), +(41836, '华坪乡', 4, 4765), +(41837, '城关镇', 4, 4765), +(41838, '小曙河乡', 4, 4765), +(41839, '曙坪乡', 4, 4765), +(41840, '曾家镇', 4, 4765), +(41841, '洪石乡', 4, 4765), +(41842, '牛头店镇', 4, 4765), +(41843, '白家乡', 4, 4765), +(41844, '钟宝镇', 4, 4765), +(41845, '东岭乡', 4, 4766), +(41846, '北赵川乡', 4, 4766), +(41847, '双槽乡', 4, 4766), +(41848, '商镇镇', 4, 4766), +(41849, '土门镇', 4, 4766), +(41850, '寺坪镇', 4, 4766), +(41851, '峦庄镇', 4, 4766), +(41852, '庾岭镇', 4, 4766), +(41853, '月日乡', 4, 4766), +(41854, '桃坪乡', 4, 4766), +(41855, '棣花镇', 4, 4766), +(41856, '武关镇', 4, 4766), +(41857, '毛里岗乡', 4, 4766), +(41858, '留仙坪乡', 4, 4766), +(41859, '竹林关镇', 4, 4766), +(41860, '花园乡', 4, 4766), +(41861, '花瓶乡', 4, 4766), +(41862, '蔡川镇', 4, 4766), +(41863, '资峪乡', 4, 4766), +(41864, '铁峪铺镇', 4, 4766), +(41865, '龙驹寨镇', 4, 4766), +(41866, '党马乡', 4, 4767), +(41867, '十里坪镇', 4, 4767), +(41868, '城关镇', 4, 4767), +(41869, '太吉河镇', 4, 4767), +(41870, '富水镇', 4, 4767), +(41871, '梁家湾镇', 4, 4767), +(41872, '水沟乡', 4, 4767), +(41873, '清油河镇', 4, 4767), +(41874, '湘河镇', 4, 4767), +(41875, '白浪镇', 4, 4767), +(41876, '白鲁础乡', 4, 4767), +(41877, '试马镇', 4, 4767), +(41878, '赵川镇', 4, 4767), +(41879, '过风楼镇', 4, 4767), +(41880, '青山乡', 4, 4767), +(41881, '魏家台乡', 4, 4767), +(41882, '三岔河乡', 4, 4768), +(41883, '上官坊乡', 4, 4768), +(41884, '刘湾街道', 4, 4768), +(41885, '北宽坪镇', 4, 4768), +(41886, '城关街道', 4, 4768), +(41887, '夜村镇', 4, 4768), +(41888, '大荆镇', 4, 4768), +(41889, '大赵峪街道', 4, 4768), +(41890, '孝义镇', 4, 4768), +(41891, '张村镇', 4, 4768), +(41892, '李庙乡', 4, 4768), +(41893, '杨峪河镇', 4, 4768), +(41894, '杨斜镇', 4, 4768); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41895, '板桥镇', 4, 4768), +(41896, '沙河子镇', 4, 4768), +(41897, '牧护关镇', 4, 4768), +(41898, '白杨店镇', 4, 4768), +(41899, '砚池河乡', 4, 4768), +(41900, '红门河乡', 4, 4768), +(41901, '腰市镇', 4, 4768), +(41902, '蒲峪乡', 4, 4768), +(41903, '西荆乡', 4, 4768), +(41904, '金陵寺镇', 4, 4768), +(41905, '阎村乡', 4, 4768), +(41906, '陈塬街道', 4, 4768), +(41907, '麻池河乡', 4, 4768), +(41908, '麻街镇', 4, 4768), +(41909, '黑山镇', 4, 4768), +(41910, '黑龙口镇', 4, 4768), +(41911, '龙王庙乡', 4, 4768), +(41912, '两岭乡', 4, 4769), +(41913, '中村镇', 4, 4769), +(41914, '二峪河乡', 4, 4769), +(41915, '伍竹乡', 4, 4769), +(41916, '元子街镇', 4, 4769), +(41917, '十里铺乡', 4, 4769), +(41918, '南宽坪镇', 4, 4769), +(41919, '城关镇', 4, 4769), +(41920, '天桥乡', 4, 4769), +(41921, '小河口镇', 4, 4769), +(41922, '延坪乡', 4, 4769), +(41923, '户家垣镇', 4, 4769), +(41924, '杨地镇', 4, 4769), +(41925, '板岩镇', 4, 4769), +(41926, '法官乡', 4, 4769), +(41927, '漫川关镇', 4, 4769), +(41928, '牛耳川镇', 4, 4769), +(41929, '王庄乡', 4, 4769), +(41930, '王闫乡', 4, 4769), +(41931, '申家垤乡', 4, 4769), +(41932, '石佛寺乡', 4, 4769), +(41933, '色河铺镇', 4, 4769), +(41934, '莲花池乡', 4, 4769), +(41935, '葛条乡', 4, 4769), +(41936, '西泉乡', 4, 4769), +(41937, '西照川镇', 4, 4769), +(41938, '银花镇', 4, 4769), +(41939, '长沟镇', 4, 4769), +(41940, '高坝镇', 4, 4769), +(41941, '黄龙乡', 4, 4769), +(41942, '下梁镇', 4, 4770), +(41943, '两河乡', 4, 4770), +(41944, '丰北河乡', 4, 4770), +(41945, '九间房乡', 4, 4770), +(41946, '干佑镇', 4, 4770), +(41947, '凤凰镇', 4, 4770), +(41948, '小岭镇', 4, 4770), +(41949, '曹坪镇', 4, 4770), +(41950, '杏坪镇', 4, 4770), +(41951, '柴庄乡', 4, 4770), +(41952, '瓦房口乡', 4, 4770), +(41953, '石瓮镇', 4, 4770), +(41954, '红岩寺镇', 4, 4770), +(41955, '营盘镇', 4, 4770), +(41956, '蔡玉窑镇', 4, 4770), +(41957, '马家台乡', 4, 4770); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(41958, '三要镇', 4, 4771), +(41959, '上寺店乡', 4, 4771), +(41960, '保安镇', 4, 4771), +(41961, '卫东镇', 4, 4771), +(41962, '古城镇', 4, 4771), +(41963, '四皓乡', 4, 4771), +(41964, '城关镇', 4, 4771), +(41965, '寺坡乡', 4, 4771), +(41966, '寺耳镇', 4, 4771), +(41967, '巡检镇', 4, 4771), +(41968, '庙台乡', 4, 4771), +(41969, '庙坪乡', 4, 4771), +(41970, '景村镇', 4, 4771), +(41971, '柏峪寺乡', 4, 4771), +(41972, '永丰镇', 4, 4771), +(41973, '洛源镇', 4, 4771), +(41974, '灵口镇', 4, 4771), +(41975, '王岭乡', 4, 4771), +(41976, '石坡镇', 4, 4771), +(41977, '石门镇', 4, 4771), +(41978, '谢湾乡', 4, 4771), +(41979, '陈耳镇', 4, 4771), +(41980, '驾鹿乡', 4, 4771), +(41981, '高耀乡', 4, 4771), +(41982, '麻坪镇', 4, 4771), +(41983, '东川镇', 4, 4772), +(41984, '云盖寺镇', 4, 4772), +(41985, '关坪河乡', 4, 4772), +(41986, '回龙镇', 4, 4772), +(41987, '大坪镇', 4, 4772), +(41988, '庙沟乡', 4, 4772), +(41989, '张家乡', 4, 4772), +(41990, '月河乡', 4, 4772), +(41991, '木王镇', 4, 4772), +(41992, '杨泗乡', 4, 4772), +(41993, '柴坪镇', 4, 4772), +(41994, '永乐镇', 4, 4772), +(41995, '氽师乡', 4, 4772), +(41996, '灵龙乡', 4, 4772), +(41997, '米粮镇', 4, 4772), +(41998, '结子乡', 4, 4772), +(41999, '茅坪回族镇', 4, 4772), +(42000, '西口回族镇', 4, 4772), +(42001, '西沟乡', 4, 4772), +(42002, '达仁镇', 4, 4772), +(42003, '铁厂镇', 4, 4772), +(42004, '青铜关镇', 4, 4772), +(42005, '高峰镇', 4, 4772), +(42006, '黄家湾乡', 4, 4772), +(42007, '龙胜乡', 4, 4772), +(42008, '八里镇', 4, 4773), +(42009, '建兰路街道', 4, 4773), +(42010, '彭家坪镇', 4, 4773), +(42011, '敦煌路街道', 4, 4773), +(42012, '晏家坪街道', 4, 4773), +(42013, '秀川街道', 4, 4773), +(42014, '西园街道', 4, 4773), +(42015, '西果园镇', 4, 4773), +(42016, '西湖街道', 4, 4773), +(42017, '西站街道', 4, 4773), +(42018, '阿干镇', 4, 4773), +(42019, '魏岭乡', 4, 4773), +(42020, '黄峪乡', 4, 4773); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42021, '龚家湾街道', 4, 4773), +(42022, '东岗街道', 4, 4774), +(42023, '东岗西路街道', 4, 4774), +(42024, '临夏路街道', 4, 4774), +(42025, '五泉街道', 4, 4774), +(42026, '伏龙坪街道', 4, 4774), +(42027, '嘉峪关路街道', 4, 4774), +(42028, '团结新村街道', 4, 4774), +(42029, '广武门街道', 4, 4774), +(42030, '张掖路街道', 4, 4774), +(42031, '拱星墩街道', 4, 4774), +(42032, '渭源路街道', 4, 4774), +(42033, '火车站街道', 4, 4774), +(42034, '焦家湾街道', 4, 4774), +(42035, '白银路街道', 4, 4774), +(42036, '皋兰路街道', 4, 4774), +(42037, '盐场路街道', 4, 4774), +(42038, '草场街街道', 4, 4774), +(42039, '酒泉路街道', 4, 4774), +(42040, '铁路东村街道', 4, 4774), +(42041, '铁路西村街道', 4, 4774), +(42042, '雁北街道', 4, 4774), +(42043, '雁南街道', 4, 4774), +(42044, '青白石街道', 4, 4774), +(42045, '靖远路街道', 4, 4774), +(42046, '刘家堡街道', 4, 4775), +(42047, '十里店街道', 4, 4775), +(42048, '培黎街道', 4, 4775), +(42049, '孔家崖街道', 4, 4775), +(42050, '安宁堡街道', 4, 4775), +(42051, '安宁西路街道', 4, 4775), +(42052, '沙井驿街道', 4, 4775), +(42053, '银滩路街道', 4, 4775), +(42054, '上花岔乡', 4, 4776), +(42055, '中连川乡', 4, 4776), +(42056, '和平镇', 4, 4776), +(42057, '哈岘乡', 4, 4776), +(42058, '园子岔乡', 4, 4776), +(42059, '城关镇', 4, 4776), +(42060, '夏官营镇', 4, 4776), +(42061, '定远镇', 4, 4776), +(42062, '小康营乡', 4, 4776), +(42063, '新营乡', 4, 4776), +(42064, '清水驿乡', 4, 4776), +(42065, '甘草店镇', 4, 4776), +(42066, '贡井乡', 4, 4776), +(42067, '连搭乡', 4, 4776), +(42068, '金崖镇', 4, 4776), +(42069, '青城镇', 4, 4776), +(42070, '韦营乡', 4, 4776), +(42071, '马坡乡', 4, 4776), +(42072, '高崖镇', 4, 4776), +(42073, '龙泉乡', 4, 4776), +(42074, '七山乡', 4, 4777), +(42075, '上川镇', 4, 4777), +(42076, '中堡镇', 4, 4777), +(42077, '坪城乡', 4, 4777), +(42078, '城关镇', 4, 4777); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42079, '大同镇', 4, 4777), +(42080, '柳树乡', 4, 4777), +(42081, '树屏镇', 4, 4777), +(42082, '武胜驿镇', 4, 4777), +(42083, '民乐乡', 4, 4777), +(42084, '河桥镇', 4, 4777), +(42085, '秦川镇', 4, 4777), +(42086, '红城镇', 4, 4777), +(42087, '苦水镇', 4, 4777), +(42088, '连城镇', 4, 4777), +(42089, '通远乡', 4, 4777), +(42090, '龙泉寺镇', 4, 4777), +(42091, '中心乡', 4, 4778), +(42092, '什川镇', 4, 4778), +(42093, '忠和镇', 4, 4778), +(42094, '水阜乡', 4, 4778), +(42095, '石洞镇', 4, 4778), +(42096, '西岔镇', 4, 4778), +(42097, '黑石乡', 4, 4778), +(42098, '下窑街道', 4, 4779), +(42099, '平安镇', 4, 4779), +(42100, '海石湾镇', 4, 4779), +(42101, '矿区街道', 4, 4779), +(42102, '窑街街道', 4, 4779), +(42103, '红古乡', 4, 4779), +(42104, '花庄镇', 4, 4779), +(42105, '东川镇', 4, 4780), +(42106, '临洮街街道', 4, 4780), +(42107, '先锋路街道', 4, 4780), +(42108, '四季青街道', 4, 4780), +(42109, '新城镇', 4, 4780), +(42110, '柳泉乡', 4, 4780), +(42111, '河口乡', 4, 4780), +(42112, '福利路街道', 4, 4780), +(42113, '西固城街道', 4, 4780), +(42114, '西柳沟街道', 4, 4780), +(42115, '达川乡', 4, 4780), +(42116, '金沟乡', 4, 4780), +(42117, '陈坪街道', 4, 4780), +(42118, '五一街道', 4, 4781), +(42119, '前进街道', 4, 4781), +(42120, '峪泉镇', 4, 4781), +(42121, '建设街道', 4, 4781), +(42122, '文殊镇', 4, 4781), +(42123, '新华街道', 4, 4781), +(42124, '新城镇', 4, 4781), +(42125, '胜利街道', 4, 4781), +(42126, '镜铁山矿区街道', 4, 4781), +(42127, '东寨镇', 4, 4782), +(42128, '六坝乡', 4, 4782), +(42129, '南坝乡', 4, 4782), +(42130, '城关镇', 4, 4782), +(42131, '新城子镇', 4, 4782), +(42132, '朱王堡镇', 4, 4782), +(42133, '水源镇', 4, 4782), +(42134, '河西堡镇', 4, 4782), +(42135, '焦家庄乡', 4, 4782), +(42136, '红山窑乡', 4, 4782), +(42137, '北京路街道', 4, 4783), +(42138, '双湾镇', 4, 4783), +(42139, '宁远堡镇', 4, 4783), +(42140, '广州路街道', 4, 4783); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42141, '新华路街道', 4, 4783), +(42142, '桂林路街道', 4, 4783), +(42143, '滨河路街道', 4, 4783), +(42144, '金川路街道', 4, 4783), +(42145, '丁家沟乡', 4, 4784), +(42146, '中川乡', 4, 4784), +(42147, '会师镇', 4, 4784), +(42148, '侯家川乡', 4, 4784), +(42149, '党家岘乡', 4, 4784), +(42150, '八里湾乡', 4, 4784), +(42151, '刘家寨子乡', 4, 4784), +(42152, '四房吴乡', 4, 4784), +(42153, '土门岘乡', 4, 4784), +(42154, '土高山乡', 4, 4784), +(42155, '大沟乡', 4, 4784), +(42156, '太平店乡', 4, 4784), +(42157, '头寨子镇', 4, 4784), +(42158, '平头川乡', 4, 4784), +(42159, '新塬乡', 4, 4784), +(42160, '新庄乡', 4, 4784), +(42161, '新添堡回族乡', 4, 4784), +(42162, '杨崖集乡', 4, 4784), +(42163, '柴家门乡', 4, 4784), +(42164, '汉家岔乡', 4, 4784), +(42165, '河畔镇', 4, 4784), +(42166, '甘沟驿乡', 4, 4784), +(42167, '白草塬乡', 4, 4784), +(42168, '翟家所乡', 4, 4784), +(42169, '老君坡乡', 4, 4784), +(42170, '草滩乡', 4, 4784), +(42171, '郭城驿镇', 4, 4784), +(42172, '韩家集乡', 4, 4784), +(42173, '共和镇', 4, 4785), +(42174, '兴平路街道', 4, 4785), +(42175, '复兴乡', 4, 4785), +(42176, '宝积乡', 4, 4785), +(42177, '宝积路街道', 4, 4785), +(42178, '水泉镇', 4, 4785), +(42179, '王家山镇', 4, 4785), +(42180, '电力路街道', 4, 4785), +(42181, '种田乡', 4, 4785), +(42182, '红会路街道', 4, 4785), +(42183, '黄峤乡', 4, 4785), +(42184, '一条山镇', 4, 4786), +(42185, '上沙沃镇', 4, 4786), +(42186, '中泉乡', 4, 4786), +(42187, '五佛乡', 4, 4786), +(42188, '喜泉镇', 4, 4786), +(42189, '寺滩乡', 4, 4786), +(42190, '正路乡', 4, 4786), +(42191, '漫水滩乡', 4, 4786), +(42192, '红水镇', 4, 4786), +(42193, '芦阳镇', 4, 4786), +(42194, '草窝滩镇', 4, 4786), +(42195, '人民路街道', 4, 4787), +(42196, '公园路街道', 4, 4787), +(42197, '四龙路街道', 4, 4787), +(42198, '四龙镇', 4, 4787), +(42199, '工农路街道', 4, 4787), +(42200, '强湾乡', 4, 4787); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42201, '武川乡', 4, 4787), +(42202, '水川镇', 4, 4787), +(42203, '王岘街道', 4, 4787), +(42204, '纺织路街道', 4, 4787), +(42205, '三滩乡', 4, 4788), +(42206, '东升乡', 4, 4788), +(42207, '东湾镇', 4, 4788), +(42208, '乌兰镇', 4, 4788), +(42209, '五合乡', 4, 4788), +(42210, '兴隆乡', 4, 4788), +(42211, '刘川乡', 4, 4788), +(42212, '北湾镇', 4, 4788), +(42213, '北滩乡', 4, 4788), +(42214, '双龙乡', 4, 4788), +(42215, '大芦乡', 4, 4788), +(42216, '平堡乡', 4, 4788), +(42217, '永新乡', 4, 4788), +(42218, '石门乡', 4, 4788), +(42219, '糜滩乡', 4, 4788), +(42220, '若笠乡', 4, 4788), +(42221, '靖安乡', 4, 4788), +(42222, '高湾乡', 4, 4788), +(42223, '刘堡乡', 4, 4789), +(42224, '大阳乡', 4, 4789), +(42225, '川王乡', 4, 4789), +(42226, '平安乡', 4, 4789), +(42227, '张家川镇', 4, 4789), +(42228, '张棉乡', 4, 4789), +(42229, '恭门镇', 4, 4789), +(42230, '木河乡', 4, 4789), +(42231, '梁山乡', 4, 4789), +(42232, '胡川乡', 4, 4789), +(42233, '连五乡', 4, 4789), +(42234, '阎家乡', 4, 4789), +(42235, '马关乡', 4, 4789), +(42236, '马鹿乡', 4, 4789), +(42237, '龙山镇', 4, 4789), +(42238, '咀头乡', 4, 4790), +(42239, '四门镇', 4, 4790), +(42240, '城关镇', 4, 4790), +(42241, '山丹乡', 4, 4790), +(42242, '杨河乡', 4, 4790), +(42243, '桦林乡', 4, 4790), +(42244, '榆盘乡', 4, 4790), +(42245, '沿安乡', 4, 4790), +(42246, '洛门镇', 4, 4790), +(42247, '温泉乡', 4, 4790), +(42248, '滩歌镇', 4, 4790), +(42249, '马力镇', 4, 4790), +(42250, '高楼乡', 4, 4790), +(42251, '鸳鸯镇', 4, 4790), +(42252, '龙台乡', 4, 4790), +(42253, '丰望乡', 4, 4791), +(42254, '土门乡', 4, 4791), +(42255, '山门镇', 4, 4791), +(42256, '新城乡', 4, 4791), +(42257, '松树乡', 4, 4791), +(42258, '永清镇', 4, 4791), +(42259, '王河乡', 4, 4791), +(42260, '白沙乡', 4, 4791), +(42261, '白驼镇', 4, 4791), +(42262, '秦亭镇', 4, 4791), +(42263, '红堡镇', 4, 4791), +(42264, '草川铺乡', 4, 4791), +(42265, '贾川乡', 4, 4791); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42266, '远门乡', 4, 4791), +(42267, '郭川乡', 4, 4791), +(42268, '金集镇', 4, 4791), +(42269, '陇东乡', 4, 4791), +(42270, '黄门乡', 4, 4791), +(42271, '八里湾乡', 4, 4792), +(42272, '六峰镇', 4, 4792), +(42273, '古坡乡', 4, 4792), +(42274, '大像山镇', 4, 4792), +(42275, '大庄乡', 4, 4792), +(42276, '大石乡', 4, 4792), +(42277, '安远镇', 4, 4792), +(42278, '新兴镇', 4, 4792), +(42279, '武家河乡', 4, 4792), +(42280, '白家湾乡', 4, 4792), +(42281, '磐安镇', 4, 4792), +(42282, '礼辛乡', 4, 4792), +(42283, '西坪乡', 4, 4792), +(42284, '谢家湾乡', 4, 4792), +(42285, '金山乡', 4, 4792), +(42286, '中山乡', 4, 4793), +(42287, '云山乡', 4, 4793), +(42288, '五营乡', 4, 4793), +(42289, '兴丰乡', 4, 4793), +(42290, '兴国镇', 4, 4793), +(42291, '刘坪乡', 4, 4793), +(42292, '千户乡', 4, 4793), +(42293, '叶堡乡', 4, 4793), +(42294, '安伏乡', 4, 4793), +(42295, '王尹乡', 4, 4793), +(42296, '王甫乡', 4, 4793), +(42297, '王窑乡', 4, 4793), +(42298, '莲花镇', 4, 4793), +(42299, '西川镇', 4, 4793), +(42300, '郭嘉镇', 4, 4793), +(42301, '陇城镇', 4, 4793), +(42302, '魏店乡', 4, 4793), +(42303, '七里墩街道', 4, 4794), +(42304, '东关街道', 4, 4794), +(42305, '中城街道', 4, 4794), +(42306, '中梁乡', 4, 4794), +(42307, '关子镇', 4, 4794), +(42308, '华岐乡', 4, 4794), +(42309, '大城街道', 4, 4794), +(42310, '大门乡', 4, 4794), +(42311, '天水郡街道', 4, 4794), +(42312, '天水镇', 4, 4794), +(42313, '太京镇', 4, 4794), +(42314, '娘娘坝镇', 4, 4794), +(42315, '平南镇', 4, 4794), +(42316, '杨家寺乡', 4, 4794), +(42317, '汪川镇', 4, 4794), +(42318, '牡丹镇', 4, 4794), +(42319, '玉泉镇', 4, 4794), +(42320, '皂郊镇', 4, 4794), +(42321, '石马坪街道', 4, 4794), +(42322, '秦岭乡', 4, 4794), +(42323, '藉口镇', 4, 4794), +(42324, '西关街道', 4, 4794), +(42325, '齐寿乡', 4, 4794), +(42326, '三岔乡', 4, 4795), +(42327, '东岔镇', 4, 4795), +(42328, '中滩镇', 4, 4795), +(42329, '五龙乡', 4, 4795); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42330, '伯阳镇', 4, 4795), +(42331, '元龙镇', 4, 4795), +(42332, '党川乡', 4, 4795), +(42333, '利桥乡', 4, 4795), +(42334, '新阳镇', 4, 4795), +(42335, '桥南街道', 4, 4795), +(42336, '渭南镇', 4, 4795), +(42337, '琥珀乡', 4, 4795), +(42338, '甘泉镇', 4, 4795), +(42339, '石佛乡', 4, 4795), +(42340, '社棠镇', 4, 4795), +(42341, '花牛镇', 4, 4795), +(42342, '道北街道', 4, 4795), +(42343, '道南街道', 4, 4795), +(42344, '马跑泉镇', 4, 4795), +(42345, '麦积镇', 4, 4795), +(42346, '下双乡', 4, 4796), +(42347, '东关街街道', 4, 4796), +(42348, '东大街街道', 4, 4796), +(42349, '东河乡', 4, 4796), +(42350, '中坝镇', 4, 4796), +(42351, '丰乐镇', 4, 4796), +(42352, '九墩乡', 4, 4796), +(42353, '五和乡', 4, 4796), +(42354, '双城镇', 4, 4796), +(42355, '发放镇', 4, 4796), +(42356, '古城镇', 4, 4796), +(42357, '吴家井乡', 4, 4796), +(42358, '和平镇', 4, 4796), +(42359, '四坝镇', 4, 4796), +(42360, '地质新村街街道', 4, 4796), +(42361, '大柳乡', 4, 4796), +(42362, '康宁乡', 4, 4796), +(42363, '张义镇', 4, 4796), +(42364, '怀安乡', 4, 4796), +(42365, '新华乡', 4, 4796), +(42366, '松树乡', 4, 4796), +(42367, '柏树乡', 4, 4796), +(42368, '武南镇', 4, 4796), +(42369, '永丰镇', 4, 4796), +(42370, '永昌镇', 4, 4796), +(42371, '河东乡', 4, 4796), +(42372, '洪祥镇', 4, 4796), +(42373, '清水乡', 4, 4796), +(42374, '清源镇', 4, 4796), +(42375, '火车站街街道', 4, 4796), +(42376, '羊下坝镇', 4, 4796), +(42377, '荣华街街道', 4, 4796), +(42378, '西关街街道', 4, 4796), +(42379, '西大街街道', 4, 4796), +(42380, '西营镇', 4, 4796), +(42381, '谢河镇', 4, 4796), +(42382, '金塔乡', 4, 4796), +(42383, '金山乡', 4, 4796), +(42384, '金沙乡', 4, 4796), +(42385, '金羊镇', 4, 4796), +(42386, '长城乡', 4, 4796), +(42387, '韩佐乡', 4, 4796), +(42388, '高坝镇', 4, 4796), +(42389, '黄羊镇', 4, 4796), +(42390, '十八里堡乡', 4, 4797), +(42391, '古丰乡', 4, 4797), +(42392, '古浪镇', 4, 4797); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42393, '古浪镇街道', 4, 4797), +(42394, '土门镇', 4, 4797), +(42395, '大靖镇', 4, 4797), +(42396, '定宁镇', 4, 4797), +(42397, '干城乡', 4, 4797), +(42398, '新堡乡', 4, 4797), +(42399, '横梁乡', 4, 4797), +(42400, '民权乡', 4, 4797), +(42401, '永丰滩乡', 4, 4797), +(42402, '泗水镇', 4, 4797), +(42403, '海子滩镇', 4, 4797), +(42404, '直滩乡', 4, 4797), +(42405, '裴家营镇', 4, 4797), +(42406, '西靖乡', 4, 4797), +(42407, '黄羊川镇', 4, 4797), +(42408, '黄花滩乡', 4, 4797), +(42409, '黑松驿镇', 4, 4797), +(42410, '东坪乡', 4, 4798), +(42411, '东大滩乡', 4, 4798), +(42412, '华藏寺镇', 4, 4798), +(42413, '哈溪镇', 4, 4798), +(42414, '大红沟乡', 4, 4798), +(42415, '天堂乡', 4, 4798), +(42416, '安远镇', 4, 4798), +(42417, '打柴沟镇', 4, 4798), +(42418, '抓喜秀龙乡', 4, 4798), +(42419, '旦马乡', 4, 4798), +(42420, '朵什乡', 4, 4798), +(42421, '松山镇', 4, 4798), +(42422, '毛藏乡', 4, 4798), +(42423, '炭山岭镇', 4, 4798), +(42424, '石门镇', 4, 4798), +(42425, '祁连乡', 4, 4798), +(42426, '西大滩乡', 4, 4798), +(42427, '赛什斯镇', 4, 4798), +(42428, '赛拉隆乡', 4, 4798), +(42429, '三雷镇', 4, 4799), +(42430, '东坝镇', 4, 4799), +(42431, '东湖镇', 4, 4799), +(42432, '南湖乡', 4, 4799), +(42433, '双茨科乡', 4, 4799), +(42434, '大坝乡', 4, 4799), +(42435, '大滩乡', 4, 4799), +(42436, '夹河乡', 4, 4799), +(42437, '收成乡', 4, 4799), +(42438, '昌宁乡', 4, 4799), +(42439, '泉山镇', 4, 4799), +(42440, '红沙梁乡', 4, 4799), +(42441, '花儿园乡', 4, 4799), +(42442, '苏武乡', 4, 4799), +(42443, '蔡旗乡', 4, 4799), +(42444, '薛百乡', 4, 4799), +(42445, '西渠镇', 4, 4799), +(42446, '重兴乡', 4, 4799), +(42447, '倪家营乡', 4, 4800), +(42448, '国营临泽农场', 4, 4800), +(42449, '平川镇', 4, 4800), +(42450, '新华镇', 4, 4800), +(42451, '板桥镇', 4, 4800), +(42452, '沙河镇', 4, 4800), +(42453, '蓼泉镇', 4, 4800), +(42454, '鸭暖乡', 4, 4800), +(42455, '东乐乡', 4, 4801); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42456, '中牧公司山丹马场', 4, 4801), +(42457, '位奇镇', 4, 4801), +(42458, '大马营乡', 4, 4801), +(42459, '山丹农场', 4, 4801), +(42460, '李桥乡', 4, 4801), +(42461, '清泉镇', 4, 4801), +(42462, '老军乡', 4, 4801), +(42463, '陈户乡', 4, 4801), +(42464, '霍城镇', 4, 4801), +(42465, '三堡镇', 4, 4802), +(42466, '丰乐乡', 4, 4802), +(42467, '六坝镇', 4, 4802), +(42468, '南丰乡', 4, 4802), +(42469, '南古镇', 4, 4802), +(42470, '新天镇', 4, 4802), +(42471, '民联乡', 4, 4802), +(42472, '永固镇', 4, 4802), +(42473, '洪水镇', 4, 4802), +(42474, '顺化乡', 4, 4802), +(42475, '三闸镇', 4, 4803), +(42476, '上秦镇', 4, 4803), +(42477, '东街街道', 4, 4803), +(42478, '乌江镇', 4, 4803), +(42479, '党寨镇', 4, 4803), +(42480, '北街街道', 4, 4803), +(42481, '南街街道', 4, 4803), +(42482, '大满镇', 4, 4803), +(42483, '安阳乡', 4, 4803), +(42484, '小满镇', 4, 4803), +(42485, '平山湖蒙古族乡', 4, 4803), +(42486, '新墩镇', 4, 4803), +(42487, '明永乡', 4, 4803), +(42488, '梁家墩镇', 4, 4803), +(42489, '沙井镇', 4, 4803), +(42490, '火车站街道', 4, 4803), +(42491, '甘浚镇', 4, 4803), +(42492, '碱滩镇', 4, 4803), +(42493, '花寨乡', 4, 4803), +(42494, '西街街道', 4, 4803), +(42495, '长安乡', 4, 4803), +(42496, '靖安乡', 4, 4803), +(42497, '龙渠乡', 4, 4803), +(42498, '大河乡', 4, 4804), +(42499, '康乐乡', 4, 4804), +(42500, '明花乡', 4, 4804), +(42501, '白银蒙古族乡', 4, 4804), +(42502, '皇城镇', 4, 4804), +(42503, '祁丰藏族乡', 4, 4804), +(42504, '红湾寺镇', 4, 4804), +(42505, '马蹄藏族乡', 4, 4804), +(42506, '南华镇', 4, 4805), +(42507, '合黎乡', 4, 4805), +(42508, '城关镇', 4, 4805), +(42509, '宣化镇', 4, 4805), +(42510, '巷道乡', 4, 4805), +(42511, '新坝乡', 4, 4805), +(42512, '罗城乡', 4, 4805), +(42513, '骆驼城乡', 4, 4805), +(42514, '黑泉乡', 4, 4805), +(42515, '上关乡', 4, 4806), +(42516, '东华街道', 4, 4806), +(42517, '东华镇', 4, 4806), +(42518, '安口镇', 4, 4806); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42519, '山寨回族乡', 4, 4806), +(42520, '河西乡', 4, 4806), +(42521, '石堡子开发区', 4, 4806), +(42522, '砚峡乡', 4, 4806), +(42523, '神峪回族乡', 4, 4806), +(42524, '策底镇', 4, 4806), +(42525, '西华镇', 4, 4806), +(42526, '马峡镇', 4, 4806), +(42527, '上杨回族乡', 4, 4807), +(42528, '东关街道', 4, 4807), +(42529, '中街街道', 4, 4807), +(42530, '四十里铺镇', 4, 4807), +(42531, '大寨回族乡', 4, 4807), +(42532, '大秦回族乡', 4, 4807), +(42533, '安国乡', 4, 4807), +(42534, '寨河回族乡', 4, 4807), +(42535, '峡门回族乡', 4, 4807), +(42536, '崆峒镇', 4, 4807), +(42537, '柳湖乡', 4, 4807), +(42538, '白庙回族乡', 4, 4807), +(42539, '白水镇', 4, 4807), +(42540, '索罗乡', 4, 4807), +(42541, '花所乡', 4, 4807), +(42542, '草峰镇', 4, 4807), +(42543, '西郊街道', 4, 4807), +(42544, '西阳回族乡', 4, 4807), +(42545, '香莲乡', 4, 4807), +(42546, '麻武乡', 4, 4807), +(42547, '五举农场', 4, 4808), +(42548, '新窑镇', 4, 4808), +(42549, '木林乡', 4, 4808), +(42550, '柏树乡', 4, 4808), +(42551, '锦屏镇', 4, 4808), +(42552, '黄寨乡', 4, 4808), +(42553, '黄花乡', 4, 4808), +(42554, '万泉镇', 4, 4809), +(42555, '南坪乡', 4, 4809), +(42556, '南湖镇', 4, 4809), +(42557, '卧龙乡', 4, 4809), +(42558, '大庄乡', 4, 4809), +(42559, '岳堡乡', 4, 4809), +(42560, '朱店镇', 4, 4809), +(42561, '杨河乡', 4, 4809), +(42562, '柳梁乡', 4, 4809), +(42563, '水洛镇', 4, 4809), +(42564, '永宁乡', 4, 4809), +(42565, '盘安乡', 4, 4809), +(42566, '良邑乡', 4, 4809), +(42567, '赵墩乡', 4, 4809), +(42568, '通化乡', 4, 4809), +(42569, '郑河乡', 4, 4809), +(42570, '阳川乡', 4, 4809), +(42571, '韩店镇', 4, 4809), +(42572, '丰台乡', 4, 4810), +(42573, '党原乡', 4, 4810), +(42574, '城关镇', 4, 4810), +(42575, '太平乡', 4, 4810), +(42576, '张老寺农场', 4, 4810), +(42577, '汭丰乡', 4, 4810), +(42578, '泾明乡', 4, 4810), +(42579, '玉都镇', 4, 4810), +(42580, '王村镇', 4, 4810), +(42581, '窑店镇', 4, 4810); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42582, '红河乡', 4, 4810), +(42583, '罗汉洞乡', 4, 4810), +(42584, '荔堡镇', 4, 4810), +(42585, '街道', 4, 4810), +(42586, '飞云乡', 4, 4810), +(42587, '高平镇', 4, 4810), +(42588, '上良乡', 4, 4811), +(42589, '中台镇', 4, 4811), +(42590, '什字镇', 4, 4811), +(42591, '国营万宝川农场', 4, 4811), +(42592, '新开乡', 4, 4811), +(42593, '星火乡', 4, 4811), +(42594, '朝那镇', 4, 4811), +(42595, '梁原乡', 4, 4811), +(42596, '独店镇', 4, 4811), +(42597, '百里乡', 4, 4811), +(42598, '蒲窝乡', 4, 4811), +(42599, '西屯乡', 4, 4811), +(42600, '邵寨镇', 4, 4811), +(42601, '龙门乡', 4, 4811), +(42602, '三合乡', 4, 4812), +(42603, '仁大乡', 4, 4812), +(42604, '余湾乡', 4, 4812), +(42605, '八里镇', 4, 4812), +(42606, '原安乡', 4, 4812), +(42607, '双岘乡', 4, 4812), +(42608, '古城乡', 4, 4812), +(42609, '司桥乡', 4, 4812), +(42610, '四河乡', 4, 4812), +(42611, '城关镇', 4, 4812), +(42612, '城川乡', 4, 4812), +(42613, '威戎镇', 4, 4812), +(42614, '新店乡', 4, 4812), +(42615, '曹务乡', 4, 4812), +(42616, '李店镇', 4, 4812), +(42617, '治平乡', 4, 4812), +(42618, '深沟乡', 4, 4812), +(42619, '灵芝乡', 4, 4812), +(42620, '甘沟乡', 4, 4812), +(42621, '界石铺镇', 4, 4812), +(42622, '红寺乡', 4, 4812), +(42623, '细巷乡', 4, 4812), +(42624, '贾河乡', 4, 4812), +(42625, '雷大乡', 4, 4812), +(42626, '七里镇', 4, 4813), +(42627, '南湖乡', 4, 4813), +(42628, '吕家堡乡', 4, 4813), +(42629, '国营敦煌农场', 4, 4813), +(42630, '杨家桥乡', 4, 4813), +(42631, '沙州镇', 4, 4813), +(42632, '肃州镇', 4, 4813), +(42633, '莫高镇', 4, 4813), +(42634, '转渠口乡', 4, 4813), +(42635, '郭家堡乡', 4, 4813), +(42636, '青海石油管理局生活基地', 4, 4813), +(42637, '黄渠乡', 4, 4813), +(42638, '下西号乡', 4, 4814), +(42639, '北坪街道', 4, 4814), +(42640, '南坪街道', 4, 4814), +(42641, '国营饮马农场', 4, 4814), +(42642, '国营黄花农场', 4, 4814), +(42643, '小金湾东乡族乡', 4, 4814); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42644, '新市区街道', 4, 4814), +(42645, '昌马乡', 4, 4814), +(42646, '柳河乡', 4, 4814), +(42647, '清泉乡', 4, 4814), +(42648, '玉门东镇', 4, 4814), +(42649, '玉门镇', 4, 4814), +(42650, '花海镇', 4, 4814), +(42651, '赤金镇', 4, 4814), +(42652, '黄闸湾乡', 4, 4814), +(42653, '三道沟镇', 4, 4815), +(42654, '南岔镇', 4, 4815), +(42655, '布隆吉乡', 4, 4815), +(42656, '柳园镇', 4, 4815), +(42657, '河东乡', 4, 4815), +(42658, '渊泉镇', 4, 4815), +(42659, '环城乡', 4, 4815), +(42660, '瓜州乡', 4, 4815), +(42661, '腰站子乡', 4, 4815), +(42662, '西湖乡', 4, 4815), +(42663, '锁阳城镇', 4, 4815), +(42664, '党城乡', 4, 4816), +(42665, '党城湾镇', 4, 4816), +(42666, '别盖乡', 4, 4816), +(42667, '盐池湾乡', 4, 4816), +(42668, '石包城乡', 4, 4816), +(42669, '马鬃山镇', 4, 4816), +(42670, '鱼儿红乡', 4, 4816), +(42671, '鱼儿红牧场', 4, 4816), +(42672, '三墩镇', 4, 4817), +(42673, '上坝镇', 4, 4817), +(42674, '下河清乡', 4, 4817), +(42675, '东北街道', 4, 4817), +(42676, '东南街道', 4, 4817), +(42677, '东洞乡', 4, 4817), +(42678, '丰乐乡', 4, 4817), +(42679, '屯升乡', 4, 4817), +(42680, '工业园街道', 4, 4817), +(42681, '总寨镇', 4, 4817), +(42682, '新城街道', 4, 4817), +(42683, '果园乡', 4, 4817), +(42684, '泉湖乡', 4, 4817), +(42685, '清水镇', 4, 4817), +(42686, '西北街道', 4, 4817), +(42687, '西南街道', 4, 4817), +(42688, '西峰乡', 4, 4817), +(42689, '西洞镇', 4, 4817), +(42690, '金佛寺镇', 4, 4817), +(42691, '铧尖乡', 4, 4817), +(42692, '银达镇', 4, 4817), +(42693, '黄泥堡裕固族乡', 4, 4817), +(42694, '三合乡', 4, 4818), +(42695, '东坝镇', 4, 4818), +(42696, '中东镇', 4, 4818), +(42697, '古城乡', 4, 4818), +(42698, '大庄子乡', 4, 4818), +(42699, '羊井子湾乡', 4, 4818), +(42700, '航天镇', 4, 4818), +(42701, '西坝乡', 4, 4818), +(42702, '金塔镇', 4, 4818), +(42703, '鼎新镇', 4, 4818), +(42704, '和平乡', 4, 4819), +(42705, '团结乡', 4, 4819), +(42706, '多坝沟乡', 4, 4819); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42707, '建设乡', 4, 4819), +(42708, '民主乡', 4, 4819), +(42709, '红柳湾镇', 4, 4819), +(42710, '上里塬乡', 4, 4820), +(42711, '乔川乡', 4, 4820), +(42712, '乔河乡', 4, 4820), +(42713, '五蛟乡', 4, 4820), +(42714, '元城镇', 4, 4820), +(42715, '南梁乡', 4, 4820), +(42716, '城壕乡', 4, 4820), +(42717, '定汉乡', 4, 4820), +(42718, '山庄乡', 4, 4820), +(42719, '庙巷乡', 4, 4820), +(42720, '怀安乡', 4, 4820), +(42721, '悦乐镇', 4, 4820), +(42722, '李良子乡', 4, 4820), +(42723, '林镇乡', 4, 4820), +(42724, '柔远镇', 4, 4820), +(42725, '温台乡', 4, 4820), +(42726, '王咀子乡', 4, 4820), +(42727, '白马乡', 4, 4820), +(42728, '紫坊畔乡', 4, 4820), +(42729, '何家畔乡', 4, 4821), +(42730, '吉岘乡', 4, 4821), +(42731, '固城乡', 4, 4821), +(42732, '太白镇', 4, 4821), +(42733, '太莪乡', 4, 4821), +(42734, '店子乡', 4, 4821), +(42735, '板桥乡', 4, 4821), +(42736, '段家集乡', 4, 4821), +(42737, '老城镇', 4, 4821), +(42738, '肖咀乡', 4, 4821), +(42739, '蒿咀铺乡', 4, 4821), +(42740, '西华池镇', 4, 4821), +(42741, '中村乡', 4, 4822), +(42742, '九岘乡', 4, 4822), +(42743, '南义乡', 4, 4822), +(42744, '和盛镇', 4, 4822), +(42745, '国营湘乐林业总场', 4, 4822), +(42746, '太昌乡', 4, 4822), +(42747, '平子镇', 4, 4822), +(42748, '新宁镇', 4, 4822), +(42749, '新庄镇', 4, 4822), +(42750, '早胜镇', 4, 4822), +(42751, '春荣乡', 4, 4822), +(42752, '湘乐镇', 4, 4822), +(42753, '焦村乡', 4, 4822), +(42754, '瓦斜乡', 4, 4822), +(42755, '盘克镇', 4, 4822), +(42756, '米桥乡', 4, 4822), +(42757, '良平乡', 4, 4822), +(42758, '金村乡', 4, 4822), +(42759, '长庆桥镇', 4, 4822), +(42760, '卅铺镇', 4, 4823), +(42761, '南庄乡', 4, 4823), +(42762, '土桥乡', 4, 4823), +(42763, '太白梁乡', 4, 4823), +(42764, '庆城镇', 4, 4823), +(42765, '桐川乡', 4, 4823), +(42766, '熊家庙乡', 4, 4823), +(42767, '玄马镇', 4, 4823), +(42768, '白马铺乡', 4, 4823), +(42769, '翟家河乡', 4, 4823), +(42770, '蔡口集乡', 4, 4823); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42771, '赤城乡', 4, 4823), +(42772, '马岭镇', 4, 4823), +(42773, '驿马镇', 4, 4823), +(42774, '高楼乡', 4, 4823), +(42775, '三嘉乡', 4, 4824), +(42776, '五顷塬回族乡', 4, 4824), +(42777, '周家乡', 4, 4824), +(42778, '宫河镇', 4, 4824), +(42779, '山河镇', 4, 4824), +(42780, '月明乡', 4, 4824), +(42781, '榆林子镇', 4, 4824), +(42782, '永和镇', 4, 4824), +(42783, '永正乡', 4, 4824), +(42784, '湫头乡', 4, 4824), +(42785, '罗川乡', 4, 4824), +(42786, '西坡乡', 4, 4824), +(42787, '何坪乡', 4, 4825), +(42788, '八珠乡', 4, 4825), +(42789, '南湫乡', 4, 4825), +(42790, '合道乡', 4, 4825), +(42791, '吴城子乡', 4, 4825), +(42792, '四合原乡', 4, 4825), +(42793, '天池乡', 4, 4825), +(42794, '小南沟乡', 4, 4825), +(42795, '山城乡', 4, 4825), +(42796, '曲子镇', 4, 4825), +(42797, '木钵镇', 4, 4825), +(42798, '樊家川乡', 4, 4825), +(42799, '毛井乡', 4, 4825), +(42800, '洪德乡', 4, 4825), +(42801, '演武乡', 4, 4825), +(42802, '环城镇', 4, 4825), +(42803, '甜水镇', 4, 4825), +(42804, '秦团庄乡', 4, 4825), +(42805, '罗山川乡', 4, 4825), +(42806, '耿湾乡', 4, 4825), +(42807, '芦家湾乡', 4, 4825), +(42808, '虎洞乡', 4, 4825), +(42809, '车道乡', 4, 4825), +(42810, '什社乡', 4, 4826), +(42811, '北街街道', 4, 4826), +(42812, '南街街道', 4, 4826), +(42813, '后官寨乡', 4, 4826), +(42814, '彭原乡', 4, 4826), +(42815, '显胜乡', 4, 4826), +(42816, '温泉乡', 4, 4826), +(42817, '肖金镇', 4, 4826), +(42818, '董志镇', 4, 4826), +(42819, '西街街道', 4, 4826), +(42820, '三岔镇', 4, 4827), +(42821, '上肖乡', 4, 4827), +(42822, '中原乡', 4, 4827), +(42823, '临泾乡', 4, 4827), +(42824, '南川乡', 4, 4827), +(42825, '城关镇', 4, 4827), +(42826, '太平镇', 4, 4827), +(42827, '孟坝镇', 4, 4827), +(42828, '小岘乡', 4, 4827), +(42829, '屯字镇', 4, 4827), +(42830, '平泉镇', 4, 4827), +(42831, '庙渠乡', 4, 4827), +(42832, '开边镇', 4, 4827), +(42833, '彭阳乡', 4, 4827), +(42834, '新城乡', 4, 4827); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42835, '新集乡', 4, 4827), +(42836, '方山乡', 4, 4827), +(42837, '曙光乡', 4, 4827), +(42838, '武沟乡', 4, 4827), +(42839, '殷家城乡', 4, 4827), +(42840, '湫池乡', 4, 4827), +(42841, '王寨乡', 4, 4827), +(42842, '郭原乡', 4, 4827), +(42843, '马渠乡', 4, 4827), +(42844, '上营乡', 4, 4828), +(42845, '中铺镇', 4, 4828), +(42846, '八里铺镇', 4, 4828), +(42847, '南屏镇', 4, 4828), +(42848, '太石镇', 4, 4828), +(42849, '峡口镇', 4, 4828), +(42850, '康家集乡', 4, 4828), +(42851, '新添镇', 4, 4828), +(42852, '洮阳镇', 4, 4828), +(42853, '漫洼乡', 4, 4828), +(42854, '玉井镇', 4, 4828), +(42855, '窑店镇', 4, 4828), +(42856, '站滩乡', 4, 4828), +(42857, '红旗乡', 4, 4828), +(42858, '衙下镇', 4, 4828), +(42859, '辛店镇', 4, 4828), +(42860, '连儿湾乡', 4, 4828), +(42861, '龙门镇', 4, 4828), +(42862, '中华路街道', 4, 4829), +(42863, '内官镇', 4, 4829), +(42864, '凤翔镇', 4, 4829), +(42865, '团结镇', 4, 4829), +(42866, '宁远镇', 4, 4829), +(42867, '新集乡', 4, 4829), +(42868, '李家堡镇', 4, 4829), +(42869, '杏园乡', 4, 4829), +(42870, '永定路街道', 4, 4829), +(42871, '白碌乡', 4, 4829), +(42872, '石峡湾乡', 4, 4829), +(42873, '石泉乡', 4, 4829), +(42874, '称钩驿镇', 4, 4829), +(42875, '符家川镇', 4, 4829), +(42876, '葛家岔镇', 4, 4829), +(42877, '西巩驿镇', 4, 4829), +(42878, '青岚山乡', 4, 4829), +(42879, '馋口镇', 4, 4829), +(42880, '香泉回族镇', 4, 4829), +(42881, '高峰乡', 4, 4829), +(42882, '鲁家沟镇', 4, 4829), +(42883, '中寨镇', 4, 4830), +(42884, '十里镇', 4, 4830), +(42885, '寺沟乡', 4, 4830), +(42886, '岷阳镇', 4, 4830), +(42887, '梅川镇', 4, 4830), +(42888, '清水乡', 4, 4830), +(42889, '申都乡', 4, 4830), +(42890, '禾驮乡', 4, 4830), +(42891, '秦许乡', 4, 4830), +(42892, '维新乡', 4, 4830), +(42893, '茶埠镇', 4, 4830), +(42894, '蒲麻镇', 4, 4830), +(42895, '西寨镇', 4, 4830), +(42896, '西江镇', 4, 4830), +(42897, '锁龙乡', 4, 4830), +(42898, '闾井镇', 4, 4830); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42899, '马坞乡', 4, 4830), +(42900, '麻子川乡', 4, 4830), +(42901, '上湾乡', 4, 4831), +(42902, '五竹镇', 4, 4831), +(42903, '会川镇', 4, 4831), +(42904, '北寨镇', 4, 4831), +(42905, '大安乡', 4, 4831), +(42906, '峡城乡', 4, 4831), +(42907, '庆坪乡', 4, 4831), +(42908, '新寨镇', 4, 4831), +(42909, '清源镇', 4, 4831), +(42910, '田家河乡', 4, 4831), +(42911, '祁家庙乡', 4, 4831), +(42912, '秦祁乡', 4, 4831), +(42913, '莲峰镇', 4, 4831), +(42914, '路园镇', 4, 4831), +(42915, '锹峪乡', 4, 4831), +(42916, '麻家集镇', 4, 4831), +(42917, '三岔镇', 4, 4832), +(42918, '东泉乡', 4, 4832), +(42919, '四族乡', 4, 4832), +(42920, '大草滩乡', 4, 4832), +(42921, '新寺镇', 4, 4832), +(42922, '武当乡', 4, 4832), +(42923, '武阳镇', 4, 4832), +(42924, '殪虎桥乡', 4, 4832), +(42925, '盐井乡', 4, 4832), +(42926, '石川乡', 4, 4832), +(42927, '草滩乡', 4, 4832), +(42928, '金钟镇', 4, 4832), +(42929, '马泉乡', 4, 4832), +(42930, '三铺乡', 4, 4833), +(42931, '义岗镇', 4, 4833), +(42932, '什川乡', 4, 4833), +(42933, '北城乡', 4, 4833), +(42934, '华岭乡', 4, 4833), +(42935, '寺子乡', 4, 4833), +(42936, '常河镇', 4, 4833), +(42937, '平襄镇', 4, 4833), +(42938, '新景乡', 4, 4833), +(42939, '李店乡', 4, 4833), +(42940, '榜罗镇', 4, 4833), +(42941, '碧玉乡', 4, 4833), +(42942, '襄南乡', 4, 4833), +(42943, '陇山乡', 4, 4833), +(42944, '陇川乡', 4, 4833), +(42945, '陇阳乡', 4, 4833), +(42946, '马营镇', 4, 4833), +(42947, '鸡川镇', 4, 4833), +(42948, '云田镇', 4, 4834), +(42949, '双泉乡', 4, 4834), +(42950, '和平乡', 4, 4834), +(42951, '宏伟乡', 4, 4834), +(42952, '巩昌镇', 4, 4834), +(42953, '德兴乡', 4, 4834), +(42954, '文峰镇', 4, 4834), +(42955, '权家湾乡', 4, 4834), +(42956, '柯寨乡', 4, 4834), +(42957, '永吉乡', 4, 4834), +(42958, '渭阳乡', 4, 4834), +(42959, '碧岩镇', 4, 4834), +(42960, '福星镇', 4, 4834), +(42961, '菜子镇', 4, 4834), +(42962, '通安驿镇', 4, 4834), +(42963, '首阳镇', 4, 4834); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(42964, '马河镇', 4, 4834), +(42965, '云屏乡', 4, 4835), +(42966, '兴化乡', 4, 4835), +(42967, '城关镇', 4, 4835), +(42968, '左家乡', 4, 4835), +(42969, '张家乡', 4, 4835), +(42970, '显龙乡', 4, 4835), +(42971, '杨店乡', 4, 4835), +(42972, '泰山乡', 4, 4835), +(42973, '站儿巷镇', 4, 4835), +(42974, '西坡镇', 4, 4835), +(42975, '金洞乡', 4, 4835), +(42976, '鱼池乡', 4, 4835), +(42977, '两河口乡', 4, 4836), +(42978, '临江乡', 4, 4836), +(42979, '何家堡乡', 4, 4836), +(42980, '八力乡', 4, 4836), +(42981, '兴化乡', 4, 4836), +(42982, '南河乡', 4, 4836), +(42983, '南阳镇', 4, 4836), +(42984, '哈达铺镇', 4, 4836), +(42985, '城关镇', 4, 4836), +(42986, '好梯乡', 4, 4836), +(42987, '官亭镇', 4, 4836), +(42988, '将台乡', 4, 4836), +(42989, '庞家乡', 4, 4836), +(42990, '新城子藏族乡', 4, 4836), +(42991, '新寨乡', 4, 4836), +(42992, '木耳乡', 4, 4836), +(42993, '沙湾镇', 4, 4836), +(42994, '狮子乡', 4, 4836), +(42995, '理川镇', 4, 4836), +(42996, '甘江头乡', 4, 4836), +(42997, '竹院乡', 4, 4836), +(42998, '贾河乡', 4, 4836), +(42999, '车拉乡', 4, 4836), +(43000, '阿坞乡', 4, 4836), +(43001, '韩院乡', 4, 4836), +(43002, '三河坝乡', 4, 4837), +(43003, '两河镇', 4, 4837), +(43004, '云台镇', 4, 4837), +(43005, '城关镇', 4, 4837), +(43006, '大南峪乡', 4, 4837), +(43007, '大堡镇', 4, 4837), +(43008, '太石乡', 4, 4837), +(43009, '寺台乡', 4, 4837), +(43010, '岸门口镇', 4, 4837), +(43011, '平洛镇', 4, 4837), +(43012, '店子乡', 4, 4837), +(43013, '望关乡', 4, 4837), +(43014, '王坝乡', 4, 4837), +(43015, '白杨乡', 4, 4837), +(43016, '碾坝乡', 4, 4837), +(43017, '豆坝乡', 4, 4837), +(43018, '豆坪乡', 4, 4837), +(43019, '迷坝乡', 4, 4837), +(43020, '铜钱乡', 4, 4837), +(43021, '长坝镇', 4, 4837), +(43022, '阳坝镇', 4, 4837), +(43023, '伏家镇', 4, 4838), +(43024, '嘉陵镇', 4, 4838), +(43025, '城关镇', 4, 4838), +(43026, '大河店乡', 4, 4838), +(43027, '柳林镇', 4, 4838), +(43028, '栗川乡', 4, 4838); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43029, '榆树乡', 4, 4838), +(43030, '水阳乡', 4, 4838), +(43031, '永宁镇', 4, 4838), +(43032, '江洛镇', 4, 4838), +(43033, '泥阳镇', 4, 4838), +(43034, '虞关乡', 4, 4838), +(43035, '银杏树乡', 4, 4838), +(43036, '高桥乡', 4, 4838), +(43037, '麻沿河乡', 4, 4838), +(43038, '二郎乡', 4, 4839), +(43039, '城关镇', 4, 4839), +(43040, '宋坪乡', 4, 4839), +(43041, '小川镇', 4, 4839), +(43042, '店村镇', 4, 4839), +(43043, '抛沙镇', 4, 4839), +(43044, '沙坝镇', 4, 4839), +(43045, '王磨镇', 4, 4839), +(43046, '索池乡', 4, 4839), +(43047, '红川镇', 4, 4839), +(43048, '纸坊镇', 4, 4839), +(43049, '苏元乡', 4, 4839), +(43050, '镡河乡', 4, 4839), +(43051, '陈院镇', 4, 4839), +(43052, '鸡峰镇', 4, 4839), +(43053, '黄渚镇', 4, 4839), +(43054, '黄陈镇', 4, 4839), +(43055, '中寨乡', 4, 4840), +(43056, '中庙乡', 4, 4840), +(43057, '临江乡', 4, 4840), +(43058, '丹堡乡', 4, 4840), +(43059, '刘家坪乡', 4, 4840), +(43060, '口头坝乡', 4, 4840), +(43061, '城关镇', 4, 4840), +(43062, '堡子坝乡', 4, 4840), +(43063, '天池乡', 4, 4840), +(43064, '尖山乡', 4, 4840), +(43065, '尚德镇', 4, 4840), +(43066, '桥头乡', 4, 4840), +(43067, '玉垒乡', 4, 4840), +(43068, '石坊乡', 4, 4840), +(43069, '石鸡坝乡', 4, 4840), +(43070, '碧口镇', 4, 4840), +(43071, '舍书乡', 4, 4840), +(43072, '范坝乡', 4, 4840), +(43073, '铁楼藏族乡', 4, 4840), +(43074, '黎坪乡', 4, 4840), +(43075, '三仓乡', 4, 4841), +(43076, '三河镇', 4, 4841), +(43077, '东江镇', 4, 4841), +(43078, '两水农场', 4, 4841), +(43079, '两水镇', 4, 4841), +(43080, '五库乡', 4, 4841), +(43081, '五马乡', 4, 4841), +(43082, '佛崖乡', 4, 4841), +(43083, '坪垭藏族乡', 4, 4841), +(43084, '城关镇', 4, 4841), +(43085, '城郊乡', 4, 4841), +(43086, '外纳乡', 4, 4841), +(43087, '安化镇', 4, 4841), +(43088, '月照乡', 4, 4841), +(43089, '枫相乡', 4, 4841), +(43090, '柏林乡', 4, 4841), +(43091, '桔柑乡', 4, 4841), +(43092, '汉林乡', 4, 4841), +(43093, '汉王镇', 4, 4841); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43094, '池坝乡', 4, 4841), +(43095, '洛塘镇', 4, 4841), +(43096, '玉皇乡', 4, 4841), +(43097, '琵琶镇', 4, 4841), +(43098, '甘泉镇', 4, 4841), +(43099, '石门乡', 4, 4841), +(43100, '磨坝藏族乡', 4, 4841), +(43101, '蒲池乡', 4, 4841), +(43102, '裕河乡', 4, 4841), +(43103, '角弓镇', 4, 4841), +(43104, '郭河乡', 4, 4841), +(43105, '隆兴乡', 4, 4841), +(43106, '马营乡', 4, 4841), +(43107, '马街镇', 4, 4841), +(43108, '鱼龙镇', 4, 4841), +(43109, '黄坪乡', 4, 4841), +(43110, '龙凤乡', 4, 4841), +(43111, '龙坝乡', 4, 4841), +(43112, '三峪乡', 4, 4842), +(43113, '上坪乡', 4, 4842), +(43114, '中坝乡', 4, 4842), +(43115, '固城乡', 4, 4842), +(43116, '城关镇', 4, 4842), +(43117, '宽川乡', 4, 4842), +(43118, '崖城乡', 4, 4842), +(43119, '桥头乡', 4, 4842), +(43120, '永兴乡', 4, 4842), +(43121, '永坪乡', 4, 4842), +(43122, '江口乡', 4, 4842), +(43123, '沙金乡', 4, 4842), +(43124, '洮坪乡', 4, 4842), +(43125, '湫山乡', 4, 4842), +(43126, '滩坪乡', 4, 4842), +(43127, '王坝乡', 4, 4842), +(43128, '白关堡回族乡', 4, 4842), +(43129, '白河镇', 4, 4842), +(43130, '盐官镇', 4, 4842), +(43131, '石桥镇', 4, 4842), +(43132, '祁山乡', 4, 4842), +(43133, '红河乡', 4, 4842), +(43134, '罗坝乡', 4, 4842), +(43135, '肖良乡', 4, 4842), +(43136, '草坪乡', 4, 4842), +(43137, '雷坝乡', 4, 4842), +(43138, '雷王乡', 4, 4842), +(43139, '马河乡', 4, 4842), +(43140, '龙林乡', 4, 4842), +(43141, '何坝镇', 4, 4843), +(43142, '六巷乡', 4, 4843), +(43143, '兴隆乡', 4, 4843), +(43144, '十里乡', 4, 4843), +(43145, '卢河乡', 4, 4843), +(43146, '大桥乡', 4, 4843), +(43147, '太石河乡', 4, 4843), +(43148, '姜席镇', 4, 4843), +(43149, '晒经乡', 4, 4843), +(43150, '汉源镇', 4, 4843), +(43151, '洛峪镇', 4, 4843), +(43152, '石堡乡', 4, 4843), +(43153, '石峡镇', 4, 4843), +(43154, '稍峪乡', 4, 4843), +(43155, '苏合乡', 4, 4843), +(43156, '蒿林乡', 4, 4843), +(43157, '西峪乡', 4, 4843), +(43158, '西高山乡', 4, 4843); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43159, '长道镇', 4, 4843), +(43160, '马元乡', 4, 4843), +(43161, '东塬乡', 4, 4844), +(43162, '五家乡', 4, 4844), +(43163, '免古池乡', 4, 4844), +(43164, '关卜乡', 4, 4844), +(43165, '北岭乡', 4, 4844), +(43166, '唐汪镇', 4, 4844), +(43167, '坪庄乡', 4, 4844), +(43168, '大树乡', 4, 4844), +(43169, '春台乡', 4, 4844), +(43170, '果园乡', 4, 4844), +(43171, '柳树乡', 4, 4844), +(43172, '汪集乡', 4, 4844), +(43173, '河滩镇', 4, 4844), +(43174, '沿岭乡', 4, 4844), +(43175, '百和乡', 4, 4844), +(43176, '考勒乡', 4, 4844), +(43177, '董岭乡', 4, 4844), +(43178, '赵家乡', 4, 4844), +(43179, '车家湾乡', 4, 4844), +(43180, '达板镇', 4, 4844), +(43181, '那勒寺镇', 4, 4844), +(43182, '锁南镇', 4, 4844), +(43183, '风山乡', 4, 4844), +(43184, '高山乡', 4, 4844), +(43185, '龙泉乡', 4, 4844), +(43186, '三角乡', 4, 4845), +(43187, '井沟东乡族乡', 4, 4845), +(43188, '先锋乡', 4, 4845), +(43189, '刁祁乡', 4, 4845), +(43190, '北塬乡', 4, 4845), +(43191, '南塬乡', 4, 4845), +(43192, '土桥镇', 4, 4845), +(43193, '坡头乡', 4, 4845), +(43194, '安家坡东乡族乡', 4, 4845), +(43195, '尹集镇', 4, 4845), +(43196, '掌子沟乡', 4, 4845), +(43197, '新集镇', 4, 4845), +(43198, '桥寺乡', 4, 4845), +(43199, '榆林乡', 4, 4845), +(43200, '民主乡', 4, 4845), +(43201, '河西乡', 4, 4845), +(43202, '漠泥沟乡', 4, 4845), +(43203, '漫路乡', 4, 4845), +(43204, '红台乡', 4, 4845), +(43205, '莲花镇', 4, 4845), +(43206, '营滩乡', 4, 4845), +(43207, '路盘乡', 4, 4845), +(43208, '铁寨乡', 4, 4845), +(43209, '韩集镇', 4, 4845), +(43210, '马集镇', 4, 4845), +(43211, '麻尼寺沟乡', 4, 4845), +(43212, '黄泥湾乡', 4, 4845), +(43213, '东关街道', 4, 4846), +(43214, '八坊街道', 4, 4846), +(43215, '南龙镇', 4, 4846), +(43216, '城北街道', 4, 4846), +(43217, '城南街道', 4, 4846), +(43218, '城郊镇', 4, 4846), +(43219, '折桥镇', 4, 4846), +(43220, '红园街道', 4, 4846), +(43221, '袍罕镇', 4, 4846), +(43222, '西关街道', 4, 4846); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43223, '三十里铺镇', 4, 4847), +(43224, '三合镇', 4, 4847), +(43225, '买家集镇', 4, 4847), +(43226, '关滩沟乡', 4, 4847), +(43227, '卜家庄乡', 4, 4847), +(43228, '吊滩乡', 4, 4847), +(43229, '城关镇', 4, 4847), +(43230, '新庄乡', 4, 4847), +(43231, '新营乡', 4, 4847), +(43232, '桑家寺东乡族乡', 4, 4847), +(43233, '罗家集乡', 4, 4847), +(43234, '达浪乡', 4, 4847), +(43235, '陈家集乡', 4, 4847), +(43236, '马家堡镇', 4, 4847), +(43237, '三甲集镇', 4, 4848), +(43238, '买家巷镇', 4, 4848), +(43239, '南山乡', 4, 4848), +(43240, '城关镇', 4, 4848), +(43241, '官坊乡', 4, 4848), +(43242, '庄禾集镇', 4, 4848), +(43243, '排子坪乡', 4, 4848), +(43244, '水泉乡', 4, 4848), +(43245, '祁家集镇', 4, 4848), +(43246, '阿力麻土东乡族乡', 4, 4848), +(43247, '上湾乡', 4, 4849), +(43248, '五户乡', 4, 4849), +(43249, '八丹乡', 4, 4849), +(43250, '八松乡', 4, 4849), +(43251, '康丰乡', 4, 4849), +(43252, '普巴乡', 4, 4849), +(43253, '景古镇', 4, 4849), +(43254, '流川乡', 4, 4849), +(43255, '白王乡', 4, 4849), +(43256, '胭脂镇', 4, 4849), +(43257, '苏集镇', 4, 4849), +(43258, '草滩乡', 4, 4849), +(43259, '莲麓镇', 4, 4849), +(43260, '虎关乡', 4, 4849), +(43261, '附城镇', 4, 4849), +(43262, '鸣鹿乡', 4, 4849), +(43263, '三塬镇', 4, 4850), +(43264, '三条岘乡', 4, 4850), +(43265, '关山乡', 4, 4850), +(43266, '刘家峡镇', 4, 4850), +(43267, '坪沟乡', 4, 4850), +(43268, '太极镇', 4, 4850), +(43269, '小岭乡', 4, 4850), +(43270, '岘塬镇', 4, 4850), +(43271, '川城镇', 4, 4850), +(43272, '徐顶乡', 4, 4850), +(43273, '新寺乡', 4, 4850), +(43274, '杨塔乡', 4, 4850), +(43275, '段岭乡', 4, 4850), +(43276, '王台镇', 4, 4850), +(43277, '王坪乡', 4, 4850), +(43278, '盐锅峡镇', 4, 4850), +(43279, '红泉镇', 4, 4850), +(43280, '西河镇', 4, 4850), +(43281, '陈井镇', 4, 4850), +(43282, '中咀岭乡', 4, 4851), +(43283, '关家川乡', 4, 4851), +(43284, '刘集乡', 4, 4851), +(43285, '别藏镇', 4, 4851); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43286, '吹麻滩镇', 4, 4851), +(43287, '四堡子乡', 4, 4851), +(43288, '大河家镇', 4, 4851), +(43289, '安集乡', 4, 4851), +(43290, '寨子沟乡', 4, 4851), +(43291, '小关乡', 4, 4851), +(43292, '居集镇', 4, 4851), +(43293, '徐扈家乡', 4, 4851), +(43294, '柳沟乡', 4, 4851), +(43295, '石塬乡', 4, 4851), +(43296, '胡林家乡', 4, 4851), +(43297, '郭干乡', 4, 4851), +(43298, '银川乡', 4, 4851), +(43299, '铺川乡', 4, 4851), +(43300, '三岔乡', 4, 4852), +(43301, '八角乡', 4, 4852), +(43302, '冶力关镇', 4, 4852), +(43303, '卓洛回族乡', 4, 4852), +(43304, '古战回族乡', 4, 4852), +(43305, '城关镇', 4, 4852), +(43306, '店子乡', 4, 4852), +(43307, '总寨乡', 4, 4852), +(43308, '扁都乡', 4, 4852), +(43309, '新城镇', 4, 4852), +(43310, '新堡乡', 4, 4852), +(43311, '术布乡', 4, 4852), +(43312, '流顺乡', 4, 4852), +(43313, '石门乡', 4, 4852), +(43314, '羊永乡', 4, 4852), +(43315, '羊沙乡', 4, 4852), +(43316, '长川回族乡', 4, 4852), +(43317, '陈旗乡', 4, 4852), +(43318, '龙元乡', 4, 4852), +(43319, '刀告乡', 4, 4853), +(43320, '勺哇土族乡', 4, 4853), +(43321, '卡车乡', 4, 4853), +(43322, '大族乡', 4, 4853), +(43323, '完冒乡', 4, 4853), +(43324, '尼巴乡', 4, 4853), +(43325, '康多乡', 4, 4853), +(43326, '恰盖乡', 4, 4853), +(43327, '扎古录镇', 4, 4853), +(43328, '木耳镇', 4, 4853), +(43329, '柏林乡', 4, 4853), +(43330, '柳林镇', 4, 4853), +(43331, '洮砚乡', 4, 4853), +(43332, '申藏乡', 4, 4853), +(43333, '纳浪乡', 4, 4853), +(43334, '藏巴哇乡', 4, 4853), +(43335, '阿子滩乡', 4, 4853), +(43336, '伊合昂街道', 4, 4854), +(43337, '佐盖多玛乡', 4, 4854), +(43338, '佐盖曼玛乡', 4, 4854), +(43339, '加茂贡乡', 4, 4854), +(43340, '勒秀乡', 4, 4854), +(43341, '卡加曼乡', 4, 4854), +(43342, '卡加道乡', 4, 4854), +(43343, '坚木克尔街道', 4, 4854), +(43344, '当周街道', 4, 4854), +(43345, '通钦街道', 4, 4854), +(43346, '那吾乡', 4, 4854), +(43347, '博拉乡', 4, 4855), +(43348, '吉仓乡', 4, 4855); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43349, '唐尕昂乡', 4, 4855), +(43350, '扎油乡', 4, 4855), +(43351, '拉卜楞镇', 4, 4855), +(43352, '曲奥乡', 4, 4855), +(43353, '桑科乡', 4, 4855), +(43354, '牙利吉乡', 4, 4855), +(43355, '王格尔塘镇', 4, 4855), +(43356, '甘加乡', 4, 4855), +(43357, '科才乡', 4, 4855), +(43358, '达麦乡', 4, 4855), +(43359, '阿木去乎镇', 4, 4855), +(43360, '麻当乡', 4, 4855), +(43361, '尼玛镇', 4, 4856), +(43362, '曼日吗乡', 4, 4856), +(43363, '木西合乡', 4, 4856), +(43364, '欧拉乡', 4, 4856), +(43365, '欧拉秀玛乡', 4, 4856), +(43366, '采日玛乡', 4, 4856), +(43367, '阿万仓乡', 4, 4856), +(43368, '齐哈玛乡', 4, 4856), +(43369, '双岔乡', 4, 4857), +(43370, '尕海乡', 4, 4857), +(43371, '拉仁关乡', 4, 4857), +(43372, '玛艾镇', 4, 4857), +(43373, '西仓乡', 4, 4857), +(43374, '郎木寺镇', 4, 4857), +(43375, '阿拉乡', 4, 4857), +(43376, '三角坪乡', 4, 4858), +(43377, '中牌乡', 4, 4858), +(43378, '八楞乡', 4, 4858), +(43379, '南峪乡', 4, 4858), +(43380, '博峪乡', 4, 4858), +(43381, '坪定乡', 4, 4858), +(43382, '城关镇', 4, 4858), +(43383, '大峪乡', 4, 4858), +(43384, '大川镇', 4, 4858), +(43385, '大年乡', 4, 4858), +(43386, '峰迭乡', 4, 4858), +(43387, '巴藏乡', 4, 4858), +(43388, '弓子石乡', 4, 4858), +(43389, '憨班乡', 4, 4858), +(43390, '拱坝乡', 4, 4858), +(43391, '插岗乡', 4, 4858), +(43392, '曲瓦乡', 4, 4858), +(43393, '武坪乡', 4, 4858), +(43394, '江盘乡', 4, 4858), +(43395, '池干乡', 4, 4858), +(43396, '立节乡', 4, 4858), +(43397, '铁坝乡', 4, 4858), +(43398, '卡坝乡', 4, 4859), +(43399, '多儿乡', 4, 4859), +(43400, '尼傲乡', 4, 4859), +(43401, '旺藏乡', 4, 4859), +(43402, '桑坝乡', 4, 4859), +(43403, '洛大乡', 4, 4859), +(43404, '电尕镇', 4, 4859), +(43405, '益哇乡', 4, 4859), +(43406, '腊子口乡', 4, 4859), +(43407, '花园乡', 4, 4859), +(43408, '达拉乡', 4, 4859), +(43409, '阿夏乡', 4, 4859), +(43410, '东关街道', 4, 4860), +(43411, '乐家湾镇', 4, 4860), +(43412, '八一路街道', 4, 4860); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43413, '周家泉街道', 4, 4860), +(43414, '大众街街道', 4, 4860), +(43415, '林家崖街道', 4, 4860), +(43416, '清真巷街道', 4, 4860), +(43417, '火车站街道', 4, 4860), +(43418, '韵家口镇', 4, 4860), +(43419, '人民街街道', 4, 4861), +(43420, '仓门街街道', 4, 4861), +(43421, '南川东路街道', 4, 4861), +(43422, '南滩街道', 4, 4861), +(43423, '礼让街街道', 4, 4861), +(43424, '饮马街街道', 4, 4861), +(43425, '大堡子镇', 4, 4862), +(43426, '小桥大街街道', 4, 4862), +(43427, '廿里铺镇', 4, 4862), +(43428, '朝阳街道', 4, 4862), +(43429, '马坊街道', 4, 4862), +(43430, '兴海路街道', 4, 4863), +(43431, '南川西路街道', 4, 4863), +(43432, '古城台街道', 4, 4863), +(43433, '彭家寨镇', 4, 4863), +(43434, '胜利路街道', 4, 4863), +(43435, '虎台街道', 4, 4863), +(43436, '西关大街街道', 4, 4863), +(43437, '东峡镇', 4, 4864), +(43438, '向化藏族乡', 4, 4864), +(43439, '城关镇', 4, 4864), +(43440, '塔尔镇', 4, 4864), +(43441, '多林镇', 4, 4864), +(43442, '宝库乡', 4, 4864), +(43443, '斜沟乡', 4, 4864), +(43444, '新庄镇', 4, 4864), +(43445, '景阳镇', 4, 4864), +(43446, '朔北藏族乡', 4, 4864), +(43447, '极乐乡', 4, 4864), +(43448, '桥头镇', 4, 4864), +(43449, '桦林乡', 4, 4864), +(43450, '石山乡', 4, 4864), +(43451, '良教乡', 4, 4864), +(43452, '逊让乡', 4, 4864), +(43453, '长宁镇', 4, 4864), +(43454, '青山乡', 4, 4864), +(43455, '青林乡', 4, 4864), +(43456, '黄家寨镇', 4, 4864), +(43457, '上五庄镇', 4, 4865), +(43458, '上新庄镇', 4, 4865), +(43459, '共和镇', 4, 4865), +(43460, '土门关乡', 4, 4865), +(43461, '多巴镇', 4, 4865), +(43462, '大才回族乡', 4, 4865), +(43463, '总寨镇', 4, 4865), +(43464, '拦隆口镇', 4, 4865), +(43465, '李家山镇', 4, 4865), +(43466, '汉东回族乡', 4, 4865), +(43467, '海子沟乡', 4, 4865), +(43468, '甘河滩镇', 4, 4865), +(43469, '田家寨镇', 4, 4865), +(43470, '群加藏族乡', 4, 4865), +(43471, '西堡镇', 4, 4865); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43472, '鲁沙尔镇', 4, 4865), +(43473, '东峡乡', 4, 4866), +(43474, '和平乡', 4, 4866), +(43475, '城关镇', 4, 4866), +(43476, '大华镇', 4, 4866), +(43477, '寺寨乡', 4, 4866), +(43478, '巴燕乡', 4, 4866), +(43479, '日月藏族乡', 4, 4866), +(43480, '波航乡', 4, 4866), +(43481, '申中乡', 4, 4866), +(43482, '下营藏族乡', 4, 4867), +(43483, '中坝藏族乡', 4, 4867), +(43484, '中岭乡', 4, 4867), +(43485, '共和乡', 4, 4867), +(43486, '城台乡', 4, 4867), +(43487, '寿乐镇', 4, 4867), +(43488, '峰堆乡', 4, 4867), +(43489, '李家乡', 4, 4867), +(43490, '洪水镇', 4, 4867), +(43491, '瞿昙镇', 4, 4867), +(43492, '碾伯镇', 4, 4867), +(43493, '芦化乡', 4, 4867), +(43494, '蒲台乡', 4, 4867), +(43495, '达拉土族乡', 4, 4867), +(43496, '雨润镇', 4, 4867), +(43497, '马厂乡', 4, 4867), +(43498, '马营乡', 4, 4867), +(43499, '高店镇', 4, 4867), +(43500, '高庙镇', 4, 4867), +(43501, '东和乡', 4, 4868), +(43502, '东山乡', 4, 4868), +(43503, '东沟乡', 4, 4868), +(43504, '丹麻镇', 4, 4868), +(43505, '五十镇', 4, 4868), +(43506, '五峰镇', 4, 4868), +(43507, '加定镇', 4, 4868), +(43508, '南门峡镇', 4, 4868), +(43509, '台子乡', 4, 4868), +(43510, '哈拉直沟乡', 4, 4868), +(43511, '塘川镇', 4, 4868), +(43512, '威远镇', 4, 4868), +(43513, '巴扎藏族乡', 4, 4868), +(43514, '松多藏族乡', 4, 4868), +(43515, '林川乡', 4, 4868), +(43516, '红崖子沟乡', 4, 4868), +(43517, '蔡家堡乡', 4, 4868), +(43518, '西山乡', 4, 4868), +(43519, '高寨镇', 4, 4868), +(43520, '二塘乡', 4, 4869), +(43521, '公伯峡管委会', 4, 4869), +(43522, '初么乡', 4, 4869), +(43523, '塔加藏族乡', 4, 4869), +(43524, '巴燕镇', 4, 4869), +(43525, '德恒隆乡', 4, 4869), +(43526, '扎巴镇', 4, 4869), +(43527, '昂思多镇', 4, 4869), +(43528, '李家峡管委会', 4, 4869), +(43529, '查甫藏族乡', 4, 4869), +(43530, '沙连堡乡', 4, 4869), +(43531, '牙什尕镇', 4, 4869), +(43532, '甘都镇', 4, 4869), +(43533, '石大仓乡', 4, 4869); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43534, '群科镇', 4, 4869), +(43535, '谢家滩乡', 4, 4869), +(43536, '金源藏族乡', 4, 4869), +(43537, '阿什奴乡', 4, 4869), +(43538, '雄先藏族乡', 4, 4869), +(43539, '三合镇', 4, 4870), +(43540, '古城回族乡', 4, 4870), +(43541, '小峡镇', 4, 4870), +(43542, '巴藏沟回族乡', 4, 4870), +(43543, '平安镇', 4, 4870), +(43544, '沙沟回族乡', 4, 4870), +(43545, '洪水泉回族乡', 4, 4870), +(43546, '石灰窑回族乡', 4, 4870), +(43547, '尕楞藏族乡', 4, 4871), +(43548, '岗察藏族乡', 4, 4871), +(43549, '文都藏族乡', 4, 4871), +(43550, '查汗都斯乡', 4, 4871), +(43551, '清水乡', 4, 4871), +(43552, '白庄乡', 4, 4871), +(43553, '积石镇', 4, 4871), +(43554, '街子乡', 4, 4871), +(43555, '道帏藏族乡', 4, 4871), +(43556, '中川乡', 4, 4872), +(43557, '前河乡', 4, 4872), +(43558, '北山乡', 4, 4872), +(43559, '古鄯镇', 4, 4872), +(43560, '大庄乡', 4, 4872), +(43561, '官亭镇', 4, 4872), +(43562, '川口镇', 4, 4872), +(43563, '巴州镇', 4, 4872), +(43564, '总堡乡', 4, 4872), +(43565, '新民乡', 4, 4872), +(43566, '李二堡镇', 4, 4872), +(43567, '杏儿藏族乡', 4, 4872), +(43568, '松树乡', 4, 4872), +(43569, '核桃庄乡', 4, 4872), +(43570, '满坪镇', 4, 4872), +(43571, '甘沟乡', 4, 4872), +(43572, '硖门镇', 4, 4872), +(43573, '西沟乡', 4, 4872), +(43574, '转导乡', 4, 4872), +(43575, '隆治乡', 4, 4872), +(43576, '马场垣乡', 4, 4872), +(43577, '马营镇', 4, 4872), +(43578, '伊克乌兰乡', 4, 4873), +(43579, '吉尔孟乡', 4, 4873), +(43580, '哈尔盖镇', 4, 4873), +(43581, '沙柳河镇', 4, 4873), +(43582, '泉吉乡', 4, 4873), +(43583, '三角城镇', 4, 4874), +(43584, '哈勒景蒙古族乡', 4, 4874), +(43585, '西海镇', 4, 4874), +(43586, '达玉蒙古族乡', 4, 4874), +(43587, '金滩乡', 4, 4874), +(43588, '青海湖乡', 4, 4874), +(43589, '八宝镇', 4, 4875), +(43590, '央隆乡', 4, 4875), +(43591, '峨堡镇', 4, 4875), +(43592, '扎麻什乡', 4, 4875), +(43593, '野牛沟乡', 4, 4875), +(43594, '阿柔乡', 4, 4875); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43595, '默勒镇', 4, 4875), +(43596, '东川镇', 4, 4876), +(43597, '仙米乡', 4, 4876), +(43598, '北山乡', 4, 4876), +(43599, '泉口镇', 4, 4876), +(43600, '浩门镇', 4, 4876), +(43601, '珠固乡', 4, 4876), +(43602, '皇城蒙古族乡', 4, 4876), +(43603, '苏吉滩乡', 4, 4876), +(43604, '西滩乡', 4, 4876), +(43605, '阴田乡', 4, 4876), +(43606, '青石咀镇', 4, 4876), +(43607, '麻莲乡', 4, 4876), +(43608, '保安镇', 4, 4877), +(43609, '兰采乡', 4, 4877), +(43610, '加吾乡', 4, 4877), +(43611, '双朋西乡', 4, 4877), +(43612, '多哇乡', 4, 4877), +(43613, '年都乎乡', 4, 4877), +(43614, '扎毛乡', 4, 4877), +(43615, '曲库乎乡', 4, 4877), +(43616, '瓜什则乡', 4, 4877), +(43617, '隆务镇', 4, 4877), +(43618, '黄乃亥乡', 4, 4877), +(43619, '坎布拉镇', 4, 4878), +(43620, '尖扎滩乡', 4, 4878), +(43621, '康扬镇', 4, 4878), +(43622, '当顺乡', 4, 4878), +(43623, '措周乡', 4, 4878), +(43624, '昂拉乡', 4, 4878), +(43625, '能科乡', 4, 4878), +(43626, '贾加乡', 4, 4878), +(43627, '马克堂镇', 4, 4878), +(43628, '优干宁镇', 4, 4879), +(43629, '多松乡', 4, 4879), +(43630, '宁木特乡', 4, 4879), +(43631, '柯生乡', 4, 4879), +(43632, '赛尔龙乡', 4, 4879), +(43633, '和日乡', 4, 4880), +(43634, '多禾茂乡', 4, 4880), +(43635, '宁秀乡', 4, 4880), +(43636, '泽曲镇', 4, 4880), +(43637, '王家乡', 4, 4880), +(43638, '西卜沙乡', 4, 4880), +(43639, '麦秀镇', 4, 4880), +(43640, '倒淌河镇', 4, 4881), +(43641, '切吉乡', 4, 4881), +(43642, '塘格木镇', 4, 4881), +(43643, '廿地乡', 4, 4881), +(43644, '恰卜恰镇', 4, 4881), +(43645, '江西沟乡', 4, 4881), +(43646, '沙珠玉乡', 4, 4881), +(43647, '石乃亥乡', 4, 4881), +(43648, '铁盖乡', 4, 4881), +(43649, '黑马河乡', 4, 4881), +(43650, '龙羊峡镇', 4, 4881), +(43651, '中铁乡', 4, 4882), +(43652, '唐乃亥乡', 4, 4882), +(43653, '子科滩镇', 4, 4882), +(43654, '曲什安镇', 4, 4882), +(43655, '河卡镇', 4, 4882), +(43656, '温泉乡', 4, 4882), +(43657, '龙藏乡', 4, 4882); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43658, '唐谷镇', 4, 4883), +(43659, '尕巴松多镇', 4, 4883), +(43660, '巴沟乡', 4, 4883), +(43661, '河北乡', 4, 4883), +(43662, '秀麻乡', 4, 4883), +(43663, '塔秀乡', 4, 4884), +(43664, '森多乡', 4, 4884), +(43665, '沙沟乡', 4, 4884), +(43666, '茫拉乡', 4, 4884), +(43667, '茫曲镇', 4, 4884), +(43668, '过马营镇', 4, 4884), +(43669, '尕让乡', 4, 4885), +(43670, '常牧镇', 4, 4885), +(43671, '拉西瓦镇', 4, 4885), +(43672, '新街回族乡', 4, 4885), +(43673, '河东乡', 4, 4885), +(43674, '河西镇', 4, 4885), +(43675, '河阴镇', 4, 4885), +(43676, '哇依乡', 4, 4886), +(43677, '哇赛乡', 4, 4886), +(43678, '智青松多镇', 4, 4886), +(43679, '白玉乡', 4, 4886), +(43680, '索呼日麻乡', 4, 4886), +(43681, '门堂乡', 4, 4886), +(43682, '扎陵湖乡', 4, 4887), +(43683, '玛查里镇', 4, 4887), +(43684, '花石峡镇', 4, 4887), +(43685, '黄河乡', 4, 4887), +(43686, '下大武乡', 4, 4888), +(43687, '东倾沟乡', 4, 4888), +(43688, '优云乡', 4, 4888), +(43689, '大武乡', 4, 4888), +(43690, '大武镇', 4, 4888), +(43691, '当洛乡', 4, 4888), +(43692, '拉加镇', 4, 4888), +(43693, '雪山乡', 4, 4888), +(43694, '亚尔堂乡', 4, 4889), +(43695, '吉卡乡', 4, 4889), +(43696, '多贡麻乡', 4, 4889), +(43697, '江日堂乡', 4, 4889), +(43698, '灯塔乡', 4, 4889), +(43699, '玛柯河乡', 4, 4889), +(43700, '知钦乡', 4, 4889), +(43701, '赛来塘镇', 4, 4889), +(43702, '达卡乡', 4, 4889), +(43703, '上贡麻乡', 4, 4890), +(43704, '下藏科乡', 4, 4890), +(43705, '下贡麻乡', 4, 4890), +(43706, '岗龙乡', 4, 4890), +(43707, '柯曲镇', 4, 4890), +(43708, '江千乡', 4, 4890), +(43709, '青珍乡', 4, 4890), +(43710, '上红科乡', 4, 4891), +(43711, '下红科乡', 4, 4891), +(43712, '吉迈镇', 4, 4891), +(43713, '建设乡', 4, 4891), +(43714, '德昂乡', 4, 4891), +(43715, '桑日麻乡', 4, 4891), +(43716, '满掌乡', 4, 4891), +(43717, '特合土乡', 4, 4891), +(43718, '窝赛乡', 4, 4891), +(43719, '莫坝乡', 4, 4891), +(43720, '东坝乡', 4, 4892); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43721, '吉尼赛乡', 4, 4892), +(43722, '吉曲乡', 4, 4892), +(43723, '娘拉乡', 4, 4892), +(43724, '尕羊乡', 4, 4892), +(43725, '毛庄乡', 4, 4892), +(43726, '白扎乡', 4, 4892), +(43727, '着晓乡', 4, 4892), +(43728, '觉拉乡', 4, 4892), +(43729, '香达镇', 4, 4892), +(43730, '叶格乡', 4, 4893), +(43731, '巴干乡', 4, 4893), +(43732, '曲麻河乡', 4, 4893), +(43733, '秋智乡', 4, 4893), +(43734, '约改镇', 4, 4893), +(43735, '麻多乡', 4, 4893), +(43736, '扎青乡', 4, 4894), +(43737, '昂赛乡', 4, 4894), +(43738, '查旦乡', 4, 4894), +(43739, '结多乡', 4, 4894), +(43740, '苏鲁乡', 4, 4894), +(43741, '莫云乡', 4, 4894), +(43742, '萨呼腾镇', 4, 4894), +(43743, '阿多乡', 4, 4894), +(43744, '加吉博洛格镇', 4, 4895), +(43745, '多彩乡', 4, 4895), +(43746, '扎河乡', 4, 4895), +(43747, '治渠乡', 4, 4895), +(43748, '立新乡', 4, 4895), +(43749, '索加乡', 4, 4895), +(43750, '上拉秀乡', 4, 4896), +(43751, '下拉秀镇', 4, 4896), +(43752, '仲达乡', 4, 4896), +(43753, '安冲乡', 4, 4896), +(43754, '小苏莽乡', 4, 4896), +(43755, '巴塘乡', 4, 4896), +(43756, '结古镇', 4, 4896), +(43757, '隆宝镇', 4, 4896), +(43758, '尕朵乡', 4, 4897), +(43759, '扎朵镇', 4, 4897), +(43760, '拉布乡', 4, 4897), +(43761, '歇武镇', 4, 4897), +(43762, '清水河镇', 4, 4897), +(43763, '珍秦镇', 4, 4897), +(43764, '称文镇', 4, 4897), +(43765, '希里沟镇', 4, 4898), +(43766, '柯柯镇', 4, 4898), +(43767, '茶卡镇', 4, 4898), +(43768, '铜普镇', 4, 4898), +(43769, '冷湖镇', 4, 4899), +(43770, '大柴旦镇', 4, 4900), +(43771, '锡铁山镇', 4, 4900), +(43772, '快尔玛乡', 4, 4901), +(43773, '新源镇', 4, 4901), +(43774, '智合玛乡', 4, 4901), +(43775, '木里镇', 4, 4901), +(43776, '江河镇', 4, 4901), +(43777, '生格乡', 4, 4901), +(43778, '舟群乡', 4, 4901), +(43779, '苏里乡', 4, 4901), +(43780, '阳康乡', 4, 4901), +(43781, '龙门乡', 4, 4901), +(43782, '尕海镇', 4, 4902), +(43783, '怀头他拉镇', 4, 4902), +(43784, '柯鲁柯镇', 4, 4902); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43785, '河东街道', 4, 4902), +(43786, '河西街道', 4, 4902), +(43787, '火车站街道', 4, 4902), +(43788, '蓄集乡', 4, 4902), +(43789, '乌图美仁乡', 4, 4903), +(43790, '唐古拉山镇', 4, 4903), +(43791, '大格勒乡', 4, 4903), +(43792, '昆仑路街道', 4, 4903), +(43793, '河西街道', 4, 4903), +(43794, '西藏路街道', 4, 4903), +(43795, '郭勒木德镇', 4, 4903), +(43796, '金峰路街道', 4, 4903), +(43797, '黄河路街道', 4, 4903), +(43798, '花土沟镇', 4, 4904), +(43799, '茫崖镇', 4, 4904), +(43800, '夏日哈镇', 4, 4905), +(43801, '宗加镇', 4, 4905), +(43802, '察汗乌苏镇', 4, 4905), +(43803, '巴隆乡', 4, 4905), +(43804, '沟里乡', 4, 4905), +(43805, '热水乡', 4, 4905), +(43806, '香加乡', 4, 4905), +(43807, '香日德镇', 4, 4905), +(43808, '中山南街街道', 4, 4906), +(43809, '丽景街街道', 4, 4906), +(43810, '凤凰北街街道', 4, 4906), +(43811, '前进街街道', 4, 4906), +(43812, '大新镇', 4, 4906), +(43813, '富宁街街道', 4, 4906), +(43814, '掌政镇', 4, 4906), +(43815, '文化街街道', 4, 4906), +(43816, '新华街街道', 4, 4906), +(43817, '月牙湖乡', 4, 4906), +(43818, '玉皇阁北街街道', 4, 4906), +(43819, '胜利街街道', 4, 4906), +(43820, '解放西街街道', 4, 4906), +(43821, '通贵乡', 4, 4906), +(43822, '银古路街道', 4, 4906), +(43823, '望洪镇', 4, 4907), +(43824, '望远镇', 4, 4907), +(43825, '李俊镇', 4, 4907), +(43826, '杨和街道', 4, 4907), +(43827, '杨和镇', 4, 4907), +(43828, '玉泉营农场', 4, 4907), +(43829, '胜利乡', 4, 4907), +(43830, '闽宁镇', 4, 4907), +(43831, '黄羊滩农场', 4, 4907), +(43832, '东塔镇', 4, 4908), +(43833, '临河镇', 4, 4908), +(43834, '崇兴镇', 4, 4908), +(43835, '梧桐树乡', 4, 4908), +(43836, '灵武农场', 4, 4908), +(43837, '白土岗乡', 4, 4908), +(43838, '磁窑堡镇', 4, 4908), +(43839, '郝家桥镇', 4, 4908), +(43840, '马家滩镇', 4, 4908), +(43841, '兴泾镇', 4, 4909), +(43842, '北京西路街道', 4, 4909), +(43843, '宁华路街道', 4, 4909); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43844, '文昌路街道', 4, 4909), +(43845, '朔方路街道', 4, 4909), +(43846, '芦花镇', 4, 4909), +(43847, '西花园路街道', 4, 4909), +(43848, '习岗镇', 4, 4910), +(43849, '京星农牧场', 4, 4910), +(43850, '南梁台子管委会', 4, 4910), +(43851, '宁夏原种场', 4, 4910), +(43852, '常信乡', 4, 4910), +(43853, '暖泉农场', 4, 4910), +(43854, '洪广镇', 4, 4910), +(43855, '立岗镇', 4, 4910), +(43856, '金贵镇', 4, 4910), +(43857, '上海西路街道', 4, 4911), +(43858, '东街街道', 4, 4911), +(43859, '丰登镇', 4, 4911), +(43860, '北京中路街道', 4, 4911), +(43861, '良田镇', 4, 4911), +(43862, '铁东街街道', 4, 4911), +(43863, '长城中路街道', 4, 4911), +(43864, '人民路街道', 4, 4912), +(43865, '大武口乡', 4, 4912), +(43866, '太西街道', 4, 4912), +(43867, '朝阳街道', 4, 4912), +(43868, '沟口街道', 4, 4912), +(43869, '白芨沟街道', 4, 4912), +(43870, '石炭井街道', 4, 4912), +(43871, '长城街道', 4, 4912), +(43872, '长胜街道', 4, 4912), +(43873, '隆湖经济开发区', 4, 4912), +(43874, '青山街道', 4, 4912), +(43875, '城关镇', 4, 4913), +(43876, '头闸镇', 4, 4913), +(43877, '姚伏镇', 4, 4913), +(43878, '宝丰镇', 4, 4913), +(43879, '崇岗镇', 4, 4913), +(43880, '渠口乡', 4, 4913), +(43881, '灵沙乡', 4, 4913), +(43882, '红崖子乡', 4, 4913), +(43883, '通伏乡', 4, 4913), +(43884, '陶乐镇', 4, 4913), +(43885, '高仁乡', 4, 4913), +(43886, '高庄乡', 4, 4913), +(43887, '黄渠桥镇', 4, 4913), +(43888, '中街街道', 4, 4914), +(43889, '北街街道', 4, 4914), +(43890, '南街街道', 4, 4914), +(43891, '园艺镇', 4, 4914), +(43892, '尾闸镇', 4, 4914), +(43893, '庙台乡', 4, 4914), +(43894, '惠农简泉农场', 4, 4914), +(43895, '河滨街街道', 4, 4914), +(43896, '火车站街道', 4, 4914), +(43897, '燕子墩乡', 4, 4914), +(43898, '礼和乡', 4, 4914), +(43899, '红果子镇', 4, 4914), +(43900, '育才路街道', 4, 4914), +(43901, '上桥街道', 4, 4915), +(43902, '东塔寺乡', 4, 4915); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43903, '古城街道', 4, 4915), +(43904, '孙家滩开发区', 4, 4915), +(43905, '巴浪湖农场', 4, 4915), +(43906, '扁担沟镇', 4, 4915), +(43907, '板桥乡', 4, 4915), +(43908, '郭家桥乡', 4, 4915), +(43909, '金积镇', 4, 4915), +(43910, '金银滩镇', 4, 4915), +(43911, '陈袁滩乡', 4, 4915), +(43912, '马莲渠乡', 4, 4915), +(43913, '高闸镇', 4, 4915), +(43914, '丁塘镇', 4, 4916), +(43915, '下马关镇', 4, 4916), +(43916, '张家垣乡', 4, 4916), +(43917, '河西镇', 4, 4916), +(43918, '王团镇', 4, 4916), +(43919, '田老庄乡', 4, 4916), +(43920, '豫旺镇', 4, 4916), +(43921, '豫海镇', 4, 4916), +(43922, '韦州镇', 4, 4916), +(43923, '马高庄乡', 4, 4916), +(43924, '冯记沟乡', 4, 4917), +(43925, '大水坑镇', 4, 4917), +(43926, '惠安堡镇', 4, 4917), +(43927, '王乐井乡', 4, 4917), +(43928, '花马池镇', 4, 4917), +(43929, '青山乡', 4, 4917), +(43930, '高沙窝镇', 4, 4917), +(43931, '麻黄山乡', 4, 4917), +(43932, '叶盛镇', 4, 4918), +(43933, '大坝镇', 4, 4918), +(43934, '小坝镇', 4, 4918), +(43935, '峡口镇', 4, 4918), +(43936, '瞿靖镇', 4, 4918), +(43937, '裕民街道', 4, 4918), +(43938, '连湖农场', 4, 4918), +(43939, '邵刚镇', 4, 4918), +(43940, '陈袁滩镇', 4, 4918), +(43941, '青铜峡镇', 4, 4918), +(43942, '七营镇', 4, 4919), +(43943, '三营镇', 4, 4919), +(43944, '中山街道', 4, 4919), +(43945, '中河乡', 4, 4919), +(43946, '头营镇', 4, 4919), +(43947, '官厅乡', 4, 4919), +(43948, '寨科乡', 4, 4919), +(43949, '开城镇', 4, 4919), +(43950, '张易镇', 4, 4919), +(43951, '彭堡镇', 4, 4919), +(43952, '河川乡', 4, 4919), +(43953, '清河镇', 4, 4919), +(43954, '炭山乡', 4, 4919), +(43955, '甘城乡', 4, 4919), +(43956, '黑城镇', 4, 4919), +(43957, '交岔乡', 4, 4920), +(43958, '冯庄乡', 4, 4920), +(43959, '古城镇', 4, 4920), +(43960, '城阳乡', 4, 4920), +(43961, '孟塬乡', 4, 4920), +(43962, '小岔乡', 4, 4920), +(43963, '新集乡', 4, 4920), +(43964, '王洼镇', 4, 4920), +(43965, '白阳镇', 4, 4920); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(43966, '红河乡', 4, 4920), +(43967, '罗洼乡', 4, 4920), +(43968, '草庙乡', 4, 4920), +(43969, '六盘山镇', 4, 4921), +(43970, '兴盛乡', 4, 4921), +(43971, '大湾乡', 4, 4921), +(43972, '新民乡', 4, 4921), +(43973, '泾河源镇', 4, 4921), +(43974, '香水镇', 4, 4921), +(43975, '黄花乡', 4, 4921), +(43976, '什字乡', 4, 4922), +(43977, '偏城乡', 4, 4922), +(43978, '兴平乡', 4, 4922), +(43979, '兴隆镇', 4, 4922), +(43980, '吉强镇', 4, 4922), +(43981, '将台乡', 4, 4922), +(43982, '平峰镇', 4, 4922), +(43983, '新营乡', 4, 4922), +(43984, '沙沟乡', 4, 4922), +(43985, '火石寨乡', 4, 4922), +(43986, '王民乡', 4, 4922), +(43987, '田坪乡', 4, 4922), +(43988, '白崖乡', 4, 4922), +(43989, '硝河乡', 4, 4922), +(43990, '红耀乡', 4, 4922), +(43991, '苏堡乡', 4, 4922), +(43992, '西滩乡', 4, 4922), +(43993, '马建乡', 4, 4922), +(43994, '马莲乡', 4, 4922), +(43995, '凤岭乡', 4, 4923), +(43996, '城关镇', 4, 4923), +(43997, '奠安乡', 4, 4923), +(43998, '好水乡', 4, 4923), +(43999, '山河乡', 4, 4923), +(44000, '张程乡', 4, 4923), +(44001, '杨河乡', 4, 4923), +(44002, '沙塘镇', 4, 4923), +(44003, '温堡乡', 4, 4923), +(44004, '神林乡', 4, 4923), +(44005, '联财镇', 4, 4923), +(44006, '观庄乡', 4, 4923), +(44007, '陈靳乡', 4, 4923), +(44008, '余丁乡', 4, 4924), +(44009, '喊叫水乡', 4, 4924), +(44010, '大战场乡', 4, 4924), +(44011, '宁安镇', 4, 4924), +(44012, '恩和镇', 4, 4924), +(44013, '新堡镇', 4, 4924), +(44014, '渠口农场', 4, 4924), +(44015, '白马乡', 4, 4924), +(44016, '石空镇', 4, 4924), +(44017, '舟塔乡', 4, 4924), +(44018, '长山头农场', 4, 4924), +(44019, '鸣沙镇', 4, 4924), +(44020, '东园街道', 4, 4925), +(44021, '宣和街道', 4, 4925), +(44022, '常乐镇', 4, 4925), +(44023, '应理街道', 4, 4925), +(44024, '文昌街道', 4, 4925), +(44025, '柔远街道', 4, 4925), +(44026, '永康街道', 4, 4925), +(44027, '迎水桥街道', 4, 4925), +(44028, '镇罗街道', 4, 4925), +(44029, '香山镇', 4, 4925); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44030, '九彩乡', 4, 4926), +(44031, '关庄乡', 4, 4926), +(44032, '关桥乡', 4, 4926), +(44033, '兴仁镇', 4, 4926), +(44034, '兴隆乡', 4, 4926), +(44035, '史店乡', 4, 4926), +(44036, '徐套乡', 4, 4926), +(44037, '曹洼乡', 4, 4926), +(44038, '李俊乡', 4, 4926), +(44039, '李旺镇', 4, 4926), +(44040, '树台乡', 4, 4926), +(44041, '海城镇', 4, 4926), +(44042, '涵养林总场', 4, 4926), +(44043, '红羊乡', 4, 4926), +(44044, '蒿川乡', 4, 4926), +(44045, '西安镇', 4, 4926), +(44046, '贾塘乡', 4, 4926), +(44047, '郑旗乡', 4, 4926), +(44048, '高崖乡', 4, 4926), +(44049, '卡子湾街道', 4, 4927), +(44050, '地磅街道', 4, 4927), +(44051, '石化街道', 4, 4927), +(44052, '芦草沟乡', 4, 4927), +(44053, '六十户乡', 4, 4928), +(44054, '四十户乡', 4, 4928), +(44055, '安宁渠镇', 4, 4928), +(44056, '托里乡', 4, 4928), +(44057, '板房沟乡', 4, 4928), +(44058, '水西沟镇', 4, 4928), +(44059, '永丰乡', 4, 4928), +(44060, '甘沟乡', 4, 4928), +(44061, '萨尔达坂乡', 4, 4928), +(44062, '青格达湖乡', 4, 4928), +(44063, '东门街道', 4, 4929), +(44064, '和平路街道', 4, 4929), +(44065, '团结路街道', 4, 4929), +(44066, '大湾乡', 4, 4929), +(44067, '幸福路街道', 4, 4929), +(44068, '延安路街道', 4, 4929), +(44069, '新华北路街道', 4, 4929), +(44070, '新华南路街道', 4, 4929), +(44071, '燕儿窝街道', 4, 4929), +(44072, '碱泉街街道', 4, 4929), +(44073, '红雁街道', 4, 4929), +(44074, '胜利路街道', 4, 4929), +(44075, '解放北路街道', 4, 4929), +(44076, '解放南路街道', 4, 4929), +(44077, '青年路街道', 4, 4929), +(44078, '乌昌路街道', 4, 4930), +(44079, '北站西路街道', 4, 4930), +(44080, '头屯河街道', 4, 4930), +(44081, '河南庄村', 4, 4930), +(44082, '火车西站街道', 4, 4930), +(44083, '王家沟街道', 4, 4930), +(44084, '三工街道', 4, 4931), +(44085, '二工乡', 4, 4931), +(44086, '二工街道', 4, 4931), +(44087, '北京路街道', 4, 4931), +(44088, '北站街道', 4, 4931); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44089, '南纬伟路街道', 4, 4931), +(44090, '喀什东路街道', 4, 4931), +(44091, '地窝堡乡', 4, 4931), +(44092, '天津路街道', 4, 4931), +(44093, '杭州路街道', 4, 4931), +(44094, '石油新村街道', 4, 4931), +(44095, '迎宾路街道', 4, 4931), +(44096, '银川路街道', 4, 4931), +(44097, '七道湾乡', 4, 4932), +(44098, '八道湾街道', 4, 4932), +(44099, '六道湾街道', 4, 4932), +(44100, '南湖北路街道', 4, 4932), +(44101, '南湖南路街道', 4, 4932), +(44102, '新民路街道', 4, 4932), +(44103, '水磨沟街道', 4, 4932), +(44104, '苇湖梁街道', 4, 4932), +(44105, '八一街道', 4, 4933), +(44106, '友好北路街道', 4, 4933), +(44107, '友好南路街道', 4, 4933), +(44108, '和田街街道', 4, 4933), +(44109, '扬子江路街道', 4, 4933), +(44110, '炉院街街道', 4, 4933), +(44111, '红庙子街道', 4, 4933), +(44112, '西山街道', 4, 4933), +(44113, '长江路街道', 4, 4933), +(44114, '雅玛里克山街道', 4, 4933), +(44115, '东沟乡', 4, 4934), +(44116, '乌拉泊街道', 4, 4934), +(44117, '星火街道', 4, 4934), +(44118, '艾维尔沟街道', 4, 4934), +(44119, '西沟乡', 4, 4934), +(44120, '达坂城镇', 4, 4934), +(44121, '阿克苏乡', 4, 4934), +(44122, '鱼儿沟街道', 4, 4934), +(44123, '乌尔禾乡', 4, 4935), +(44124, '百口泉街道', 4, 4935), +(44125, '五五新镇街道', 4, 4936), +(44126, '天山路街道', 4, 4936), +(44127, '小拐乡', 4, 4936), +(44128, '昆仑路街道', 4, 4936), +(44129, '胜利路街道', 4, 4936), +(44130, '金龙镇街道', 4, 4936), +(44131, '银河路街道', 4, 4936), +(44132, '北村街道', 4, 4937), +(44133, '西宁路街道', 4, 4937), +(44134, '金山路街道', 4, 4937), +(44135, '三平镇街道', 4, 4938), +(44136, '中兴路街道', 4, 4938), +(44137, '七泉湖镇', 4, 4939), +(44138, '三堡乡', 4, 4939), +(44139, '二堡乡', 4, 4939), +(44140, '亚尔乡', 4, 4939), +(44141, '大河沿镇', 4, 4939), +(44142, '恰特卡勒乡', 4, 4939), +(44143, '老城路街道', 4, 4939), +(44144, '胜金乡', 4, 4939); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44145, '艾丁湖乡', 4, 4939), +(44146, '葡萄乡', 4, 4939), +(44147, '高昌路街道', 4, 4939), +(44148, '伊拉湖乡', 4, 4940), +(44149, '博斯坦乡', 4, 4940), +(44150, '夏乡', 4, 4940), +(44151, '库加依镇', 4, 4940), +(44152, '库米什镇', 4, 4940), +(44153, '托克逊镇', 4, 4940), +(44154, '郭勒布衣乡', 4, 4940), +(44155, '七克台镇', 4, 4941), +(44156, '东巴扎回族乡', 4, 4941), +(44157, '吐峪沟乡', 4, 4941), +(44158, '火车站镇', 4, 4941), +(44159, '辟展乡', 4, 4941), +(44160, '达浪坎乡', 4, 4941), +(44161, '连木沁镇', 4, 4941), +(44162, '迪坎乡', 4, 4941), +(44163, '鄯善镇', 4, 4941), +(44164, '鲁克沁镇', 4, 4941), +(44165, '下马崖乡', 4, 4942), +(44166, '伊吾镇', 4, 4942), +(44167, '前山哈萨克族乡', 4, 4942), +(44168, '吐葫芦乡', 4, 4942), +(44169, '淖毛湖镇', 4, 4942), +(44170, '盐池乡', 4, 4942), +(44171, '苇子峡乡', 4, 4942), +(44172, '七角井镇', 4, 4943), +(44173, '东河区街道', 4, 4943), +(44174, '丽园街道', 4, 4943), +(44175, '乌拉台哈萨克族乡', 4, 4943), +(44176, '二堡镇', 4, 4943), +(44177, '五堡乡', 4, 4943), +(44178, '南湖乡', 4, 4943), +(44179, '双井子乡', 4, 4943), +(44180, '回城乡', 4, 4943), +(44181, '城郊乡', 4, 4943), +(44182, '大泉湾乡', 4, 4943), +(44183, '天山乡', 4, 4943), +(44184, '德外都如克哈萨克族乡', 4, 4943), +(44185, '新市区街道', 4, 4943), +(44186, '星星峡镇', 4, 4943), +(44187, '柳树沟乡', 4, 4943), +(44188, '沁城乡', 4, 4943), +(44189, '白石头乡', 4, 4943), +(44190, '石油新城街道', 4, 4943), +(44191, '花园乡', 4, 4943), +(44192, '西山乡', 4, 4943), +(44193, '西河区街道', 4, 4943), +(44194, '陶家宫乡', 4, 4943), +(44195, '雅满苏镇', 4, 4943), +(44196, '三塘湖乡', 4, 4944), +(44197, '下涝坝乡', 4, 4944), +(44198, '八墙子乡', 4, 4944), +(44199, '博尔羌吉镇', 4, 4944), +(44200, '大河镇', 4, 4944), +(44201, '大红柳峡乡', 4, 4944), +(44202, '奎苏镇', 4, 4944), +(44203, '巴里坤镇', 4, 4944); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44204, '海子沿乡', 4, 4944), +(44205, '石人子乡', 4, 4944), +(44206, '花园乡', 4, 4944), +(44207, '萨尔乔克乡', 4, 4944), +(44208, '三台镇', 4, 4945), +(44209, '二工乡', 4, 4945), +(44210, '北庭镇', 4, 4945), +(44211, '吉木萨尔镇', 4, 4945), +(44212, '大有乡', 4, 4945), +(44213, '庆阳湖乡', 4, 4945), +(44214, '新地乡', 4, 4945), +(44215, '泉子街镇', 4, 4945), +(44216, '老台乡', 4, 4945), +(44217, '五工台镇', 4, 4946), +(44218, '呼图壁镇', 4, 4946), +(44219, '园户村镇', 4, 4946), +(44220, '大丰镇', 4, 4946), +(44221, '廿里店镇', 4, 4946), +(44222, '石梯子哈萨克民族乡', 4, 4946), +(44223, '雀尔沟镇', 4, 4946), +(44224, '七户乡', 4, 4947), +(44225, '三个庄子乡', 4, 4947), +(44226, '东湾镇', 4, 4947), +(44227, '乔仁哈萨克族乡', 4, 4947), +(44228, '五马场哈萨克族乡', 4, 4947), +(44229, '半截沟镇', 4, 4947), +(44230, '古城乡', 4, 4947), +(44231, '吉布库镇', 4, 4947), +(44232, '坎尔孜乡', 4, 4947), +(44233, '大泉塔塔尔族乡', 4, 4947), +(44234, '奇台镇', 4, 4947), +(44235, '碧流河乡', 4, 4947), +(44236, '老奇台镇', 4, 4947), +(44237, '西北湾乡', 4, 4947), +(44238, '西地镇', 4, 4947), +(44239, '三工镇', 4, 4948), +(44240, '中山路街道', 4, 4948), +(44241, '二六工镇', 4, 4948), +(44242, '佃坝乡', 4, 4948), +(44243, '六工镇', 4, 4948), +(44244, '北京南路街道', 4, 4948), +(44245, '大西渠镇', 4, 4948), +(44246, '宁边路街道', 4, 4948), +(44247, '庙尔沟乡', 4, 4948), +(44248, '延安北路街道', 4, 4948), +(44249, '建国路街道', 4, 4948), +(44250, '榆树沟镇', 4, 4948), +(44251, '滨湖乡', 4, 4948), +(44252, '硫磺沟镇', 4, 4948), +(44253, '绿洲路街道', 4, 4948), +(44254, '阿什里哈萨克族乡', 4, 4948), +(44255, '东城镇', 4, 4949), +(44256, '博斯坦乡', 4, 4949), +(44257, '大南沟乌孜别克族乡', 4, 4949), +(44258, '大石头乡', 4, 4949), +(44259, '新户乡', 4, 4949), +(44260, '木垒镇', 4, 4949), +(44261, '照壁山乡', 4, 4949); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44262, '白杨河乡', 4, 4949), +(44263, '英格堡乡', 4, 4949), +(44264, '西吉尔镇', 4, 4949), +(44265, '雀仁乡', 4, 4949), +(44266, '乐土驿镇', 4, 4950), +(44267, '六户地镇', 4, 4950), +(44268, '兰州湾镇', 4, 4950), +(44269, '凉州户镇', 4, 4950), +(44270, '包家店镇', 4, 4950), +(44271, '北五岔镇', 4, 4950), +(44272, '塔西河哈萨克族乡', 4, 4950), +(44273, '头工乡', 4, 4950), +(44274, '广东地乡', 4, 4950), +(44275, '旱卡子滩哈萨克族乡', 4, 4950), +(44276, '清水河哈萨克族乡', 4, 4950), +(44277, '玛纳斯镇', 4, 4950), +(44278, '三道坝镇', 4, 4951), +(44279, '东路街道', 4, 4951), +(44280, '友好路街道', 4, 4951), +(44281, '古牧地镇', 4, 4951), +(44282, '柏杨河哈萨克族乡', 4, 4951), +(44283, '羊毛工镇', 4, 4951), +(44284, '西路街道', 4, 4951), +(44285, '铁厂沟镇', 4, 4951), +(44286, '长山子镇', 4, 4951), +(44287, '三工河哈萨克族乡', 4, 4952), +(44288, '上户沟哈萨克族乡', 4, 4952), +(44289, '九运街镇', 4, 4952), +(44290, '准东街道', 4, 4952), +(44291, '博峰街街道', 4, 4952), +(44292, '城关镇', 4, 4952), +(44293, '水磨沟乡', 4, 4952), +(44294, '滋泥泉子镇', 4, 4952), +(44295, '甘河子镇', 4, 4952), +(44296, '阜新街街道', 4, 4952), +(44297, '乌图布拉格镇', 4, 4953), +(44298, '克尔根卓街道', 4, 4953), +(44299, '小营盘镇', 4, 4953), +(44300, '贝林哈日莫墩乡', 4, 4953), +(44301, '达勒特镇', 4, 4953), +(44302, '青得里乡', 4, 4953), +(44303, '青得里街道', 4, 4953), +(44304, '顾里木图街道', 4, 4953), +(44305, '博格达尔镇', 4, 4954), +(44306, '哈日布呼镇', 4, 4954), +(44307, '塔秀乡', 4, 4954), +(44308, '安格里格乡', 4, 4954), +(44309, '扎勒木特乡', 4, 4954), +(44310, '查干屯格乡', 4, 4954), +(44311, '大河沿子镇', 4, 4955), +(44312, '托托乡', 4, 4955), +(44313, '托里乡', 4, 4955), +(44314, '精河镇', 4, 4955), +(44315, '茫丁乡', 4, 4955), +(44316, '乌兰再格森乡', 4, 4956), +(44317, '博斯腾湖乡', 4, 4956); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44318, '博湖镇', 4, 4956), +(44319, '塔温觉肯乡', 4, 4956), +(44320, '才坎诺尔乡', 4, 4956), +(44321, '本布图镇', 4, 4956), +(44322, '查干诺尔乡', 4, 4956), +(44323, '乃仁克尔乡', 4, 4957), +(44324, '乌什塔拉回族乡', 4, 4957), +(44325, '塔哈其乡', 4, 4957), +(44326, '曲惠乡', 4, 4957), +(44327, '特吾里克镇', 4, 4957), +(44328, '苏哈特乡', 4, 4957), +(44329, '乃门莫墩乡', 4, 4958), +(44330, '克尔古提乡', 4, 4958), +(44331, '协比乃尔布呼乡', 4, 4958), +(44332, '和静镇', 4, 4958), +(44333, '哈尔莫墩镇', 4, 4958), +(44334, '巩乃斯沟乡', 4, 4958), +(44335, '巴仑台镇', 4, 4958), +(44336, '巴润哈尔莫墩镇', 4, 4958), +(44337, '巴音乌鲁乡', 4, 4958), +(44338, '巴音郭愣乡', 4, 4958), +(44339, '阿拉沟乡', 4, 4958), +(44340, '额勒再特乌鲁乡', 4, 4958), +(44341, '兴平乡', 4, 4959), +(44342, '古勒巴格乡', 4, 4959), +(44343, '喀尔曲尕乡', 4, 4959), +(44344, '团结乡', 4, 4959), +(44345, '塔里木乡', 4, 4959), +(44346, '墩阔坦乡', 4, 4959), +(44347, '尉犁镇', 4, 4959), +(44348, '西尼尔镇', 4, 4959), +(44349, '阿克苏普乡', 4, 4959), +(44350, '上户镇', 4, 4960), +(44351, '兰干乡', 4, 4960), +(44352, '和什力克乡', 4, 4960), +(44353, '哈拉玉宫乡', 4, 4960), +(44354, '团结街道', 4, 4960), +(44355, '塔什店街道', 4, 4960), +(44356, '天山街道', 4, 4960), +(44357, '建设路街道', 4, 4960), +(44358, '恰尔巴格乡', 4, 4960), +(44359, '托布力其乡', 4, 4960), +(44360, '新城街道', 4, 4960), +(44361, '普惠乡', 4, 4960), +(44362, '英下乡', 4, 4960), +(44363, '萨依巴格街道', 4, 4960), +(44364, '铁克其乡', 4, 4960), +(44365, '阿瓦提乡', 4, 4960), +(44366, '七个星镇', 4, 4961), +(44367, '五号渠乡', 4, 4961), +(44368, '包尔海乡', 4, 4961), +(44369, '北大渠乡', 4, 4961), +(44370, '四十里城子镇', 4, 4961), +(44371, '查汗采开乡', 4, 4961), +(44372, '永宁镇', 4, 4961), +(44373, '焉耆镇', 4, 4961), +(44374, '依吞布拉克镇', 4, 4962); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44375, '吾塔木乡', 4, 4962), +(44376, '瓦石峡乡', 4, 4962), +(44377, '祁曼塔克乡', 4, 4962), +(44378, '罗布泊镇', 4, 4962), +(44379, '若羌镇', 4, 4962), +(44380, '铁干里克乡', 4, 4962), +(44381, '铁木里克乡', 4, 4962), +(44382, '哈尔巴克乡', 4, 4963), +(44383, '塔尔拉克乡', 4, 4963), +(44384, '大道南乡', 4, 4963), +(44385, '策达雅乡', 4, 4963), +(44386, '群巴克镇', 4, 4963), +(44387, '草湖乡', 4, 4963), +(44388, '轮南镇', 4, 4963), +(44389, '轮台镇', 4, 4963), +(44390, '野云沟乡', 4, 4963), +(44391, '铁热克巴扎乡', 4, 4963), +(44392, '阳霞镇', 4, 4963), +(44393, '阿克萨来乡', 4, 4963), +(44394, '乌什镇', 4, 4964), +(44395, '亚曼苏柯尔克孜族乡', 4, 4964), +(44396, '亚科瑞克乡', 4, 4964), +(44397, '依麻木乡', 4, 4964), +(44398, '奥特贝希乡', 4, 4964), +(44399, '英阿瓦提乡', 4, 4964), +(44400, '阿克托海依乡', 4, 4964), +(44401, '阿合亚乡', 4, 4964), +(44402, '阿恰塔格乡', 4, 4964), +(44403, '乌尊镇', 4, 4965), +(44404, '乌恰镇', 4, 4965), +(44405, '依西哈拉镇', 4, 4965), +(44406, '哈尼喀木乡', 4, 4965), +(44407, '塔里木乡', 4, 4965), +(44408, '墩阔坦镇', 4, 4965), +(44409, '库车镇', 4, 4965), +(44410, '比西巴格乡', 4, 4965), +(44411, '牙哈镇', 4, 4965), +(44412, '玉奇吾斯塘乡', 4, 4965), +(44413, '阿克吾斯塘乡', 4, 4965), +(44414, '阿拉哈格镇', 4, 4965), +(44415, '阿格乡', 4, 4965), +(44416, '雅克拉镇', 4, 4965), +(44417, '齐满镇', 4, 4965), +(44418, '亚吐尔乡', 4, 4966), +(44419, '克孜尔乡', 4, 4966), +(44420, '大桥乡', 4, 4966), +(44421, '察尔其镇', 4, 4966), +(44422, '布隆乡', 4, 4966), +(44423, '康其乡', 4, 4966), +(44424, '托克逊乡', 4, 4966), +(44425, '拜城镇', 4, 4966), +(44426, '温巴什乡', 4, 4966), +(44427, '米吉克乡', 4, 4966), +(44428, '老虎台乡', 4, 4966), +(44429, '赛里木镇', 4, 4966), +(44430, '铁热克镇', 4, 4966), +(44431, '黑英山乡', 4, 4966), +(44432, '依其艾日克乡', 4, 4967); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44433, '塔什艾日克乡', 4, 4967), +(44434, '塔木托格拉克乡', 4, 4967), +(44435, '尤鲁都斯巴格镇', 4, 4967), +(44436, '排先巴扎乡', 4, 4967), +(44437, '新和镇', 4, 4967), +(44438, '渭干乡', 4, 4967), +(44439, '玉其哈特乡', 4, 4967), +(44440, '启浪乡', 4, 4968), +(44441, '柯坪镇', 4, 4968), +(44442, '玉尔其乡', 4, 4968), +(44443, '盖孜力克乡', 4, 4968), +(44444, '阿恰勒乡', 4, 4968), +(44445, '努尔巴格乡', 4, 4969), +(44446, '古勒巴格乡', 4, 4969), +(44447, '塔里木乡', 4, 4969), +(44448, '托依堡勒迪镇', 4, 4969), +(44449, '沙雅镇', 4, 4969), +(44450, '海楼乡', 4, 4969), +(44451, '红旗镇', 4, 4969), +(44452, '英买里镇', 4, 4969), +(44453, '佳木乡', 4, 4970), +(44454, '依希来木其乡', 4, 4970), +(44455, '克孜勒镇', 4, 4970), +(44456, '博孜墩柯尔克孜族乡', 4, 4970), +(44457, '古勒阿瓦提乡', 4, 4970), +(44458, '吐木秀克镇', 4, 4970), +(44459, '恰格拉克乡', 4, 4970), +(44460, '托乎拉乡', 4, 4970), +(44461, '温宿镇', 4, 4970), +(44462, '阿热勒镇', 4, 4970), +(44463, '依干其乡', 4, 4971), +(44464, '南城街道', 4, 4971), +(44465, '喀勒塔勒镇', 4, 4971), +(44466, '库木巴希乡', 4, 4971), +(44467, '托喀依乡', 4, 4971), +(44468, '托普鲁克乡', 4, 4971), +(44469, '拜什吐格曼乡', 4, 4971), +(44470, '新城街道', 4, 4971), +(44471, '栏杆街道', 4, 4971), +(44472, '红桥街道', 4, 4971), +(44473, '英巴扎街道', 4, 4971), +(44474, '阿依库勒镇', 4, 4971), +(44475, '乌鲁却勒镇', 4, 4972), +(44476, '塔木托格拉克乡', 4, 4972), +(44477, '多浪乡', 4, 4972), +(44478, '巴格托格拉克乡', 4, 4972), +(44479, '拜什艾日克镇', 4, 4972), +(44480, '英艾日克乡', 4, 4972), +(44481, '阿依巴格乡', 4, 4972), +(44482, '阿瓦提镇', 4, 4972), +(44483, '乌恰镇', 4, 4973), +(44484, '乌鲁克恰提乡', 4, 4973), +(44485, '吉根乡', 4, 4973), +(44486, '吾合沙鲁乡', 4, 4973), +(44487, '巴音库鲁提乡', 4, 4973), +(44488, '康苏镇', 4, 4973); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44489, '托云乡', 4, 4973), +(44490, '波斯坦铁列克乡', 4, 4973), +(44491, '膘尔托阔依乡', 4, 4973), +(44492, '铁列克乡', 4, 4973), +(44493, '黑孜苇乡', 4, 4973), +(44494, '克孜勒陶乡', 4, 4974), +(44495, '加马铁力克乡', 4, 4974), +(44496, '喀热克其克乡', 4, 4974), +(44497, '塔尔塔吉克族乡', 4, 4974), +(44498, '奥依塔克镇', 4, 4974), +(44499, '巴仁乡', 4, 4974), +(44500, '布伦口乡', 4, 4974), +(44501, '库斯拉甫乡', 4, 4974), +(44502, '恰尔隆乡', 4, 4974), +(44503, '木吉乡', 4, 4974), +(44504, '玉麦乡', 4, 4974), +(44505, '皮拉力乡', 4, 4974), +(44506, '阿克陶镇', 4, 4974), +(44507, '哈拉奇乡', 4, 4975), +(44508, '哈拉布拉克乡', 4, 4975), +(44509, '库兰萨日克乡', 4, 4975), +(44510, '色帕巴依乡', 4, 4975), +(44511, '苏木塔什乡', 4, 4975), +(44512, '阿合奇镇', 4, 4975), +(44513, '上阿图什乡', 4, 4976), +(44514, '光明路街道', 4, 4976), +(44515, '吐古买提乡', 4, 4976), +(44516, '哈拉峻乡', 4, 4976), +(44517, '幸福路街道', 4, 4976), +(44518, '松他克乡', 4, 4976), +(44519, '格达良乡', 4, 4976), +(44520, '阿扎克乡', 4, 4976), +(44521, '阿湖乡', 4, 4976), +(44522, '克孜勒博依乡', 4, 4977), +(44523, '克孜勒苏乡', 4, 4977), +(44524, '卧里托格拉克乡', 4, 4977), +(44525, '古勒鲁克乡', 4, 4977), +(44526, '和夏阿瓦提乡', 4, 4977), +(44527, '夏普吐勒乡', 4, 4977), +(44528, '巴仁镇', 4, 4977), +(44529, '江巴孜乡', 4, 4977), +(44530, '玉代克力克乡', 4, 4977), +(44531, '米夏乡', 4, 4977), +(44532, '英买里乡', 4, 4977), +(44533, '西克尔库勒镇', 4, 4977), +(44534, '铁日木乡', 4, 4977), +(44535, '乌吉热克乡', 4, 4978), +(44536, '乌夏克巴什镇', 4, 4978), +(44537, '伯西热克乡', 4, 4978), +(44538, '依力克其乡', 4, 4978), +(44539, '依提木孔乡', 4, 4978), +(44540, '加依提勒克乡', 4, 4978), +(44541, '吐古其乡', 4, 4978), +(44542, '喀格勒克镇', 4, 4978), +(44543, '夏合甫乡', 4, 4978), +(44544, '宗朗乡', 4, 4978); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44545, '巴仁乡', 4, 4978), +(44546, '恰尔巴格镇', 4, 4978), +(44547, '恰萨美其特乡', 4, 4978), +(44548, '柯克亚乡', 4, 4978), +(44549, '棋盘乡', 4, 4978), +(44550, '江格勒斯乡', 4, 4978), +(44551, '洛克乡', 4, 4978), +(44552, '萨依巴格乡', 4, 4978), +(44553, '西合休乡', 4, 4978), +(44554, '铁提乡', 4, 4978), +(44555, '乃则尔巴格乡', 4, 4979), +(44556, '亚瓦格街道', 4, 4979), +(44557, '吾斯塘博依街道', 4, 4979), +(44558, '夏马勒巴格乡', 4, 4979), +(44559, '多来特巴格乡', 4, 4979), +(44560, '库木代尔瓦扎街道', 4, 4979), +(44561, '恰萨街道', 4, 4979), +(44562, '浩罕乡', 4, 4979), +(44563, '阿拉格尔乡', 4, 4979), +(44564, '塔什库尔干乡', 4, 4980), +(44565, '塔什库尔干镇', 4, 4980), +(44566, '塔合曼乡', 4, 4980), +(44567, '大同乡', 4, 4980), +(44568, '布伦木沙乡', 4, 4980), +(44569, '库科西鲁格乡', 4, 4980), +(44570, '提孜那甫乡', 4, 4980), +(44571, '班迪尔乡', 4, 4980), +(44572, '瓦恰乡', 4, 4980), +(44573, '科克亚尔柯尔克孜族乡', 4, 4980), +(44574, '达布达尔乡', 4, 4980), +(44575, '马尔洋乡', 4, 4980), +(44576, '也克先拜巴扎乡', 4, 4981), +(44577, '岳普湖乡', 4, 4981), +(44578, '岳普湖镇', 4, 4981), +(44579, '巴依阿瓦提乡', 4, 4981), +(44580, '色也克乡', 4, 4981), +(44581, '艾西曼乡', 4, 4981), +(44582, '铁热木乡', 4, 4981), +(44583, '阿其克乡', 4, 4981), +(44584, '阿洪鲁库木乡', 4, 4981), +(44585, '三岔口镇', 4, 4982), +(44586, '夏玛勒乡', 4, 4982), +(44587, '多来提巴格乡', 4, 4982), +(44588, '巴楚镇', 4, 4982), +(44589, '恰尔巴格乡', 4, 4982), +(44590, '琼库尔恰克乡', 4, 4982), +(44591, '色力布亚镇', 4, 4982), +(44592, '英吾斯堂乡', 4, 4982), +(44593, '阿克萨克马热勒乡', 4, 4982), +(44594, '阿瓦提镇', 4, 4982), +(44595, '阿纳库勒乡', 4, 4982), +(44596, '依克苏乡', 4, 4983), +(44597, '依玛乡', 4, 4983), +(44598, '古勒巴格乡', 4, 4983), +(44599, '图呼其乡', 4, 4983); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44600, '奎依巴格乡', 4, 4983), +(44601, '奎依巴格镇', 4, 4983), +(44602, '布依鲁克塔吉克族乡', 4, 4983), +(44603, '波斯喀木乡', 4, 4983), +(44604, '泽普镇', 4, 4983), +(44605, '赛力乡', 4, 4983), +(44606, '阿依库勒乡', 4, 4983), +(44607, '阿克塔木乡', 4, 4983), +(44608, '亚曼牙乡', 4, 4984), +(44609, '塔合其乡', 4, 4984), +(44610, '塔孜洪乡', 4, 4984), +(44611, '巴仁乡', 4, 4984), +(44612, '巴合齐乡', 4, 4984), +(44613, '库木西力克乡', 4, 4984), +(44614, '洋大曼乡', 4, 4984), +(44615, '牙甫泉镇', 4, 4984), +(44616, '疏勒镇', 4, 4984), +(44617, '罕南力克镇', 4, 4984), +(44618, '艾尔木东乡', 4, 4984), +(44619, '英尔力克乡', 4, 4984), +(44620, '英阿瓦提乡', 4, 4984), +(44621, '阿拉力乡', 4, 4984), +(44622, '阿拉甫乡', 4, 4984), +(44623, '乌怕尔乡', 4, 4985), +(44624, '伯什克然木乡', 4, 4985), +(44625, '兰干乡', 4, 4985), +(44626, '吾库萨克乡', 4, 4985), +(44627, '塔什米里克乡', 4, 4985), +(44628, '布拉克苏乡', 4, 4985), +(44629, '怕哈太克里乡', 4, 4985), +(44630, '托克扎克镇', 4, 4985), +(44631, '木什乡', 4, 4985), +(44632, '站敏乡', 4, 4985), +(44633, '色满乡', 4, 4985), +(44634, '英吾斯塘乡', 4, 4985), +(44635, '荒地乡', 4, 4985), +(44636, '萨依巴格乡', 4, 4985), +(44637, '铁日木乡', 4, 4985), +(44638, '阿克喀什乡', 4, 4985), +(44639, '阿瓦提乡', 4, 4985), +(44640, '乌恰乡', 4, 4986), +(44641, '乔勒潘乡', 4, 4986), +(44642, '依格孜也尔乡', 4, 4986), +(44643, '克孜勒乡', 4, 4986), +(44644, '城关乡', 4, 4986), +(44645, '托普鲁克乡', 4, 4986), +(44646, '色提力乡', 4, 4986), +(44647, '艾古斯乡', 4, 4986), +(44648, '芒辛乡', 4, 4986), +(44649, '苏盖提乡', 4, 4986), +(44650, '英也尔乡', 4, 4986), +(44651, '英吉沙镇', 4, 4986), +(44652, '萨罕乡', 4, 4986), +(44653, '龙甫乡', 4, 4986), +(44654, '乌达力克乡', 4, 4987), +(44655, '亚喀艾日克乡', 4, 4987), +(44656, '伊什库力乡', 4, 4987), +(44657, '依盖尔其镇', 4, 4987); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44658, '古勒巴格乡', 4, 4987), +(44659, '喀拉苏乡', 4, 4987), +(44660, '喀群乡', 4, 4987), +(44661, '塔尕尔其乡', 4, 4987), +(44662, '墩巴格乡', 4, 4987), +(44663, '孜热甫夏提塔吉克族乡', 4, 4987), +(44664, '巴格阿瓦提乡', 4, 4987), +(44665, '恰热克镇', 4, 4987), +(44666, '恰热巴格乡', 4, 4987), +(44667, '托木吾斯塘乡', 4, 4987), +(44668, '拍克其乡', 4, 4987), +(44669, '白什坎特镇', 4, 4987), +(44670, '米夏乡', 4, 4987), +(44671, '艾里西湖镇', 4, 4987), +(44672, '英吾斯塘乡', 4, 4987), +(44673, '荒地镇', 4, 4987), +(44674, '莎车镇', 4, 4987), +(44675, '藿什拉甫乡', 4, 4987), +(44676, '达木斯乡', 4, 4987), +(44677, '阔什艾日克乡', 4, 4987), +(44678, '阿扎特巴格乡', 4, 4987), +(44679, '阿拉买提乡', 4, 4987), +(44680, '阿热勒乡', 4, 4987), +(44681, '阿热斯兰巴格乡', 4, 4987), +(44682, '阿瓦提镇', 4, 4987), +(44683, '克孜勒阿瓦提乡', 4, 4988), +(44684, '吐曼塔勒乡', 4, 4988), +(44685, '央塔克乡', 4, 4988), +(44686, '尕孜库勒乡', 4, 4988), +(44687, '巴扎结米乡', 4, 4988), +(44688, '希依提敦乡', 4, 4988), +(44689, '库尔玛乡', 4, 4988), +(44690, '库木库萨尔乡', 4, 4988), +(44691, '昂格特勒克乡', 4, 4988), +(44692, '麦盖提镇', 4, 4988), +(44693, '先拜巴扎镇', 4, 4989), +(44694, '兰干乡', 4, 4989), +(44695, '加依乡', 4, 4989), +(44696, '喀尔克乡', 4, 4989), +(44697, '奥依托格拉克乡', 4, 4989), +(44698, '希吾勒乡', 4, 4989), +(44699, '托格日尕孜乡', 4, 4989), +(44700, '斯也克乡', 4, 4989), +(44701, '木尕拉镇', 4, 4989), +(44702, '科克亚乡', 4, 4989), +(44703, '英巴格乡', 4, 4989), +(44704, '达里亚博依乡', 4, 4989), +(44705, '阿日希乡', 4, 4989), +(44706, '阿热勒乡', 4, 4989), +(44707, '阿羌乡', 4, 4989), +(44708, '伊斯拉木阿瓦提乡', 4, 4990), +(44709, '喀什塔什乡', 4, 4990), +(44710, '塔瓦库勒乡', 4, 4990), +(44711, '巴格其镇', 4, 4990), +(44712, '布扎克乡', 4, 4990), +(44713, '拉依喀乡', 4, 4990); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44714, '朗如乡', 4, 4990), +(44715, '罕艾日克乡', 4, 4990), +(44716, '色格孜库勒乡', 4, 4990), +(44717, '英艾日克乡', 4, 4990), +(44718, '英阿瓦提乡', 4, 4990), +(44719, '伊里其乡', 4, 4991), +(44720, '古勒巴格街道', 4, 4991), +(44721, '古江巴格乡', 4, 4991), +(44722, '古江巴格街道', 4, 4991), +(44723, '拉斯奎镇', 4, 4991), +(44724, '纳尔巴格街道', 4, 4991), +(44725, '肖尔巴格乡', 4, 4991), +(44726, '阿合恰管理区', 4, 4991), +(44727, '乌尔其乡', 4, 4992), +(44728, '加汗巴格乡', 4, 4992), +(44729, '吐外特乡', 4, 4992), +(44730, '喀尔赛乡', 4, 4992), +(44731, '喀拉卡什镇', 4, 4992), +(44732, '喀瓦克乡', 4, 4992), +(44733, '奎牙乡', 4, 4992), +(44734, '扎瓦乡', 4, 4992), +(44735, '托胡拉乡', 4, 4992), +(44736, '普恰克其乡', 4, 4992), +(44737, '芒来乡', 4, 4992), +(44738, '英也尔乡', 4, 4992), +(44739, '萨依巴格乡', 4, 4992), +(44740, '阔依其乡', 4, 4992), +(44741, '阿克萨拉依乡', 4, 4992), +(44742, '雅瓦乡', 4, 4992), +(44743, '叶亦克乡', 4, 4993), +(44744, '安迪尔乡', 4, 4993), +(44745, '尼雅乡', 4, 4993), +(44746, '尼雅镇', 4, 4993), +(44747, '若克雅乡', 4, 4993), +(44748, '萨勒吾则克乡', 4, 4993), +(44749, '多鲁乡', 4, 4994), +(44750, '山普鲁乡', 4, 4994), +(44751, '布雅乡', 4, 4994), +(44752, '恰尔巴格乡', 4, 4994), +(44753, '拜什托格拉克乡', 4, 4994), +(44754, '杭桂乡', 4, 4994), +(44755, '洛浦镇', 4, 4994), +(44756, '纳瓦乡', 4, 4994), +(44757, '乔达乡', 4, 4995), +(44758, '克里阳乡', 4, 4995), +(44759, '固玛镇', 4, 4995), +(44760, '巴什兰干乡', 4, 4995), +(44761, '康克尔柯尔克孜族乡', 4, 4995), +(44762, '木吉乡', 4, 4995), +(44763, '木奎拉乡', 4, 4995), +(44764, '杜瓦镇', 4, 4995), +(44765, '桑株乡', 4, 4995), +(44766, '瑙阿巴提塔吉克族乡', 4, 4995), +(44767, '皮亚勒玛乡', 4, 4995), +(44768, '皮西那乡', 4, 4995), +(44769, '科克铁热克乡', 4, 4995), +(44770, '藏桂乡', 4, 4995); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44771, '阔什塔格乡', 4, 4995), +(44772, '乌鲁克萨依乡', 4, 4996), +(44773, '博斯坦乡', 4, 4996), +(44774, '固拉哈玛乡', 4, 4996), +(44775, '奴尔乡', 4, 4996), +(44776, '恰哈乡', 4, 4996), +(44777, '策勒乡', 4, 4996), +(44778, '策勒镇', 4, 4996), +(44779, '达玛沟乡', 4, 4996), +(44780, '吉里于孜镇', 4, 4997), +(44781, '吐鲁番于孜乡', 4, 4997), +(44782, '喀什乡', 4, 4997), +(44783, '喀拉亚尕奇乡', 4, 4997), +(44784, '墩麻扎镇', 4, 4997), +(44785, '巴依托海乡', 4, 4997), +(44786, '愉群翁回族乡', 4, 4997), +(44787, '曲鲁海乡', 4, 4997), +(44788, '温亚尔乡', 4, 4997), +(44789, '维吾尔玉其温乡', 4, 4997), +(44790, '胡地于孜乡', 4, 4997), +(44791, '英塔木乡', 4, 4997), +(44792, '莫洛托乎提于孜乡', 4, 4997), +(44793, '萨地克于孜乡', 4, 4997), +(44794, '萨木于孜乡', 4, 4997), +(44795, '阿乌利亚乡', 4, 4997), +(44796, '阿热吾斯塘乡', 4, 4997), +(44797, '麻扎乡', 4, 4997), +(44798, '伊犁河路街道', 4, 4998), +(44799, '克伯克于孜乡', 4, 4998), +(44800, '哈尔墩乡', 4, 4998), +(44801, '喀赞其街道', 4, 4998), +(44802, '塔什库勒克乡', 4, 4998), +(44803, '墩买里街道', 4, 4998), +(44804, '巴彦岱镇', 4, 4998), +(44805, '托格拉克乡', 4, 4998), +(44806, '汉宾乡', 4, 4998), +(44807, '潘津乡', 4, 4998), +(44808, '琼库勒克街道', 4, 4998), +(44809, '艾兰木巴格街道', 4, 4998), +(44810, '英也尔乡', 4, 4998), +(44811, '萨依布依街道', 4, 4998), +(44812, '解放路街道', 4, 4998), +(44813, '达达木图乡', 4, 4998), +(44814, '都来提巴格街道', 4, 4998), +(44815, '乌鲁木齐东路街道', 4, 4999), +(44816, '乌鲁木齐西路街道', 4, 4999), +(44817, '北京路街道', 4, 4999), +(44818, '团结路街道', 4, 4999), +(44819, '火车站街道', 4, 4999), +(44820, '加尕斯台乡', 4, 5000), +(44821, '坎乡', 4, 5000), +(44822, '堆齐牛录乡', 4, 5000), +(44823, '孙扎齐牛录乡', 4, 5000), +(44824, '察布查尔镇', 4, 5000), +(44825, '扎库齐牛录乡', 4, 5000); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44826, '海努克乡', 4, 5000), +(44827, '爱新舍里镇', 4, 5000), +(44828, '琼博拉乡', 4, 5000), +(44829, '米粮泉回族乡', 4, 5000), +(44830, '纳达齐牛录乡', 4, 5000), +(44831, '绰霍尔乡', 4, 5000), +(44832, '阔洪奇乡', 4, 5000), +(44833, '乌拉斯台乡', 4, 5001), +(44834, '乌赞乡', 4, 5001), +(44835, '克令乡', 4, 5001), +(44836, '加哈乌拉斯台乡', 4, 5001), +(44837, '喀拉托别乡', 4, 5001), +(44838, '喀拉苏乡', 4, 5001), +(44839, '尼勒克镇', 4, 5001), +(44840, '木斯乡', 4, 5001), +(44841, '科克浩特浩尔蒙古族乡', 4, 5001), +(44842, '胡吉尔台乡', 4, 5001), +(44843, '苏布台乡', 4, 5001), +(44844, '东买里乡', 4, 5002), +(44845, '吉尔格郎乡', 4, 5002), +(44846, '塔斯托别乡', 4, 5002), +(44847, '巩留镇', 4, 5002), +(44848, '提克阿热克乡', 4, 5002), +(44849, '莫乎尔乡', 4, 5002), +(44850, '阿克吐别克乡', 4, 5002), +(44851, '阿尕尔森乡', 4, 5002), +(44852, '则克台镇', 4, 5003), +(44853, '别斯托别乡', 4, 5003), +(44854, '吐尔根乡', 4, 5003), +(44855, '哈拉布拉乡', 4, 5003), +(44856, '坎苏乡', 4, 5003), +(44857, '塔尔德镇', 4, 5003), +(44858, '新源镇', 4, 5003), +(44859, '肖尔布拉克镇', 4, 5003), +(44860, '那拉提镇', 4, 5003), +(44861, '阿勒玛勒乡', 4, 5003), +(44862, '阿热勒托别镇', 4, 5003), +(44863, '乌尊布拉克乡', 4, 5004), +(44864, '喀夏加尔乡', 4, 5004), +(44865, '喀拉苏乡', 4, 5004), +(44866, '夏特柯尔克孜族乡', 4, 5004), +(44867, '察汗乌苏蒙古族乡', 4, 5004), +(44868, '昭苏镇', 4, 5004), +(44869, '洪纳海乡', 4, 5004), +(44870, '胡松图哈尔逊蒙古族乡', 4, 5004), +(44871, '萨尔阔布乡', 4, 5004), +(44872, '阿克达拉乡', 4, 5004), +(44873, '乔拉克铁热克乡', 4, 5005), +(44874, '呼吉尔图蒙古族乡', 4, 5005), +(44875, '喀拉托海乡', 4, 5005), +(44876, '喀拉达拉乡', 4, 5005), +(44877, '特克斯镇', 4, 5005), +(44878, '科克苏乡', 4, 5005), +(44879, '科克铁热克柯孜族乡', 4, 5005); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44880, '齐勒乌泽克乡', 4, 5005), +(44881, '三宫回族乡', 4, 5006), +(44882, '三道河乡', 4, 5006), +(44883, '伊车嘎善锡伯族乡', 4, 5006), +(44884, '兰干乡', 4, 5006), +(44885, '大西沟乡', 4, 5006), +(44886, '惠远镇', 4, 5006), +(44887, '水定镇', 4, 5006), +(44888, '清水河镇', 4, 5006), +(44889, '芦草沟镇', 4, 5006), +(44890, '萨尔布拉克镇', 4, 5006), +(44891, '九间楼乡', 4, 5007), +(44892, '八十四户乡', 4, 5007), +(44893, '南苑街道', 4, 5007), +(44894, '古尔图镇', 4, 5007), +(44895, '吉尔格勒特郭愣蒙古族乡', 4, 5007), +(44896, '哈图布呼镇', 4, 5007), +(44897, '四棵树镇', 4, 5007), +(44898, '塔布勒合特蒙古族乡', 4, 5007), +(44899, '头台乡', 4, 5007), +(44900, '夹河子乡', 4, 5007), +(44901, '奎河街道', 4, 5007), +(44902, '新市区街道', 4, 5007), +(44903, '甘河子镇', 4, 5007), +(44904, '白杨沟镇', 4, 5007), +(44905, '百泉镇', 4, 5007), +(44906, '皇宫镇', 4, 5007), +(44907, '石桥乡', 4, 5007), +(44908, '虹桥街道', 4, 5007), +(44909, '西城区街道', 4, 5007), +(44910, '西大沟镇', 4, 5007), +(44911, '西湖镇', 4, 5007), +(44912, '车排子镇', 4, 5007), +(44913, '和什托洛盖镇', 4, 5008), +(44914, '和布克赛尔镇', 4, 5008), +(44915, '夏孜盖乡', 4, 5008), +(44916, '巴音傲瓦乡', 4, 5008), +(44917, '查干库勒乡', 4, 5008), +(44918, '莫特格乡', 4, 5008), +(44919, '铁布肯乌散乡', 4, 5008), +(44920, '也门勒乡', 4, 5009), +(44921, '二工镇', 4, 5009), +(44922, '和平街道', 4, 5009), +(44923, '喀拉哈巴克乡', 4, 5009), +(44924, '恰夏乡', 4, 5009), +(44925, '新城街道', 4, 5009), +(44926, '杜别克街道', 4, 5009), +(44927, '阿不都拉乡', 4, 5009), +(44928, '阿西尔达斡尔族乡', 4, 5009), +(44929, '乌雪特乡', 4, 5010), +(44930, '加尔巴斯乡', 4, 5010), +(44931, '多拉特乡', 4, 5010), +(44932, '库甫乡', 4, 5010), +(44933, '庙尔沟镇', 4, 5010), +(44934, '托里镇', 4, 5010), +(44935, '铁厂沟镇', 4, 5010), +(44936, '阿合别里斗乡', 4, 5010); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44937, '三道河子镇', 4, 5011), +(44938, '东湾镇', 4, 5011), +(44939, '乌兰乌苏镇', 4, 5011), +(44940, '博尔通古乡', 4, 5011), +(44941, '商户地乡', 4, 5011), +(44942, '四道河子镇', 4, 5011), +(44943, '大泉乡', 4, 5011), +(44944, '安集海镇', 4, 5011), +(44945, '柳毛湾镇', 4, 5011), +(44946, '老沙湾镇', 4, 5011), +(44947, '西戈壁镇', 4, 5011), +(44948, '金沟河镇', 4, 5011), +(44949, '吉也克乡', 4, 5012), +(44950, '哈拉布拉乡', 4, 5012), +(44951, '哈拉布拉镇', 4, 5012), +(44952, '新地乡', 4, 5012), +(44953, '江格斯乡', 4, 5012), +(44954, '阿勒腾也木勒乡', 4, 5012), +(44955, '上户乡', 4, 5013), +(44956, '二道桥乡', 4, 5013), +(44957, '喀拉也木勒乡', 4, 5013), +(44958, '喇嘛昭乡', 4, 5013), +(44959, '杰勒阿尕什乡', 4, 5013), +(44960, '玉什喀拉苏乡', 4, 5013), +(44961, '玛热勒苏乡', 4, 5013), +(44962, '郊区乡', 4, 5013), +(44963, '霍吉尔特蒙古族乡', 4, 5013), +(44964, '额敏镇', 4, 5013), +(44965, '额玛勒郭楞蒙古族乡', 4, 5013), +(44966, '别斯铁热克乡', 4, 5014), +(44967, '吉木乃镇', 4, 5014), +(44968, '喀尔交乡', 4, 5014), +(44969, '恰勒什海乡', 4, 5014), +(44970, '托斯特乡', 4, 5014), +(44971, '托普铁热克乡', 4, 5014), +(44972, '托普铁热克镇', 4, 5014), +(44973, '加依勒玛乡', 4, 5015), +(44974, '库勒拜乡', 4, 5015), +(44975, '萨尔塔木乡', 4, 5015), +(44976, '萨尔布拉克乡', 4, 5015), +(44977, '铁热克提乡', 4, 5015), +(44978, '阿克齐镇', 4, 5015), +(44979, '齐巴尔乡', 4, 5015), +(44980, '可可托海镇', 4, 5016), +(44981, '吐尔洪乡', 4, 5016), +(44982, '喀拉布勒根乡', 4, 5016), +(44983, '喀拉通克乡', 4, 5016), +(44984, '库尔特乡', 4, 5016), +(44985, '库额尔齐斯镇', 4, 5016), +(44986, '恰库尔图镇', 4, 5016), +(44987, '杜热乡', 4, 5016), +(44988, '铁买克乡', 4, 5016), +(44989, '也格孜托别乡', 4, 5017), +(44990, '冲乎尔乡', 4, 5017), +(44991, '布尔津镇', 4, 5017), +(44992, '杜来提乡', 4, 5017); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(44993, '禾木哈纳斯蒙古族乡', 4, 5017), +(44994, '窝依莫克乡', 4, 5017), +(44995, '阔斯特克乡', 4, 5017), +(44996, '喀拉玛盖乡', 4, 5018), +(44997, '福海镇', 4, 5018), +(44998, '解特阿热勒乡', 4, 5018), +(44999, '阔克阿尕什乡', 4, 5018), +(45000, '阿尔达乡', 4, 5018), +(45001, '齐干吉迭乡', 4, 5018), +(45002, '切尔克齐乡', 4, 5019), +(45003, '切木尔切克乡', 4, 5019), +(45004, '北屯镇', 4, 5019), +(45005, '喀拉希力克乡', 4, 5019), +(45006, '团结路街道', 4, 5019), +(45007, '巴里巴盖乡', 4, 5019), +(45008, '拉斯特乡', 4, 5019), +(45009, '汗德尕特蒙古族乡', 4, 5019), +(45010, '红墩镇', 4, 5019), +(45011, '萨尔胡松乡', 4, 5019), +(45012, '解放路街道', 4, 5019), +(45013, '金山路街道', 4, 5019), +(45014, '阿拉哈克乡', 4, 5019), +(45015, '阿苇滩镇', 4, 5019), +(45016, '塔克什肯镇', 4, 5020), +(45017, '查干郭勒乡', 4, 5020), +(45018, '萨尔托海乡', 4, 5020), +(45019, '阿尕什敖包乡', 4, 5020), +(45020, '阿热勒乡', 4, 5020), +(45021, '阿热勒托别乡', 4, 5020), +(45022, '青河镇', 4, 5020), +(45023, '东城街道', 4, 5021), +(45024, '北泉镇', 4, 5021), +(45025, '向阳街道', 4, 5021), +(45026, '新城街道', 4, 5021), +(45027, '石河子乡', 4, 5021), +(45028, '红山街道', 4, 5021), +(45029, '老街街道', 4, 5021), +(45030, '1农一师6团', 4, 5022), +(45031, '农一师10团', 4, 5022), +(45032, '农一师11团', 4, 5022), +(45033, '农一师12团', 4, 5022), +(45034, '农一师13团', 4, 5022), +(45035, '农一师15团', 4, 5022), +(45036, '农一师4团', 4, 5022), +(45037, '农一师7团', 4, 5022), +(45038, '农一师8团', 4, 5022), +(45039, '农一师9团', 4, 5022), +(45040, '托咯依乡', 4, 5022), +(45041, '兵团农三师44团', 4, 5023), +(45042, '兵团农三师49团', 4, 5023), +(45043, '兵团农三师50团', 4, 5023), +(45044, '兵团农三师51团', 4, 5023), +(45045, '兵团农三师52团', 4, 5023), +(45046, '兵团农三师53团', 4, 5023), +(45047, '农六师一〇一团', 4, 5024); +INSERT INTO `pre_common_district` (`id`, `name`, `level`, `upid`) VALUES +(45048, '农六师一〇三团', 4, 5024), +(45049, '农六师一〇二团', 4, 5024), +(45050, '梧桐镇', 4, 5024), +(45051, '蔡家湖镇', 4, 5024); \ No newline at end of file diff --git a/install/data/group_index.xml b/install/data/group_index.xml new file mode 100644 index 0000000..63ea2f3 --- /dev/null +++ b/install/data/group_index.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +[loop] +
  • {title}
  • +[/loop] +
+ +]]>
+ + + + + + + + + + + + + {title}]]> +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/install/data/index.htm b/install/data/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/install/data/install.sql b/install/data/install.sql new file mode 100644 index 0000000..1a3c6f6 --- /dev/null +++ b/install/data/install.sql @@ -0,0 +1,4161 @@ +-- +-- DiscuzX INSTALL MAKE SQL DUMP V1.0 +-- DO NOT modify this file +-- +-- Create: 2013-08-27 16:12:45 +-- +DROP TABLE IF EXISTS pre_common_admincp_cmenu; +CREATE TABLE pre_common_admincp_cmenu ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + title varchar(255) NOT NULL, + url varchar(255) NOT NULL, + sort tinyint(1) NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL, + clicks smallint(6) unsigned NOT NULL DEFAULT '1', + uid mediumint(8) unsigned NOT NULL, + dateline int(10) unsigned NOT NULL, + PRIMARY KEY (id), + KEY uid (uid), + KEY displayorder (displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_admincp_group; +CREATE TABLE pre_common_admincp_group ( + cpgroupid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + cpgroupname varchar(255) NOT NULL, + PRIMARY KEY (cpgroupid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_admincp_member; +CREATE TABLE pre_common_admincp_member ( + uid int(10) unsigned NOT NULL, + cpgroupid int(10) unsigned NOT NULL, + customperm text NOT NULL, + PRIMARY KEY (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_admincp_perm; +CREATE TABLE pre_common_admincp_perm ( + cpgroupid smallint(6) unsigned NOT NULL, + perm varchar(100) NOT NULL, + UNIQUE KEY cpgroupperm (cpgroupid,perm) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_admincp_session; +CREATE TABLE pre_common_admincp_session ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + adminid smallint(6) unsigned NOT NULL DEFAULT '0', + panel tinyint(1) NOT NULL DEFAULT '0', + ip varchar(45) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + errorcount tinyint(1) NOT NULL DEFAULT '0', + `storage` mediumtext NOT NULL, + PRIMARY KEY (uid,panel) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_admingroup; +CREATE TABLE pre_common_admingroup ( + admingid smallint(6) unsigned NOT NULL DEFAULT '0', + alloweditpost tinyint(1) NOT NULL DEFAULT '0', + alloweditpoll tinyint(1) NOT NULL DEFAULT '0', + allowstickthread tinyint(1) NOT NULL DEFAULT '0', + allowmodpost tinyint(1) NOT NULL DEFAULT '0', + allowdelpost tinyint(1) NOT NULL DEFAULT '0', + allowmassprune tinyint(1) NOT NULL DEFAULT '0', + allowrefund tinyint(1) NOT NULL DEFAULT '0', + allowcensorword tinyint(1) NOT NULL DEFAULT '0', + allowviewip tinyint(1) NOT NULL DEFAULT '0', + allowbanip tinyint(1) NOT NULL DEFAULT '0', + allowedituser tinyint(1) NOT NULL DEFAULT '0', + allowmoduser tinyint(1) NOT NULL DEFAULT '0', + allowbanuser tinyint(1) NOT NULL DEFAULT '0', + allowbanvisituser tinyint(1) NOT NULL DEFAULT '0', + allowpostannounce tinyint(1) NOT NULL DEFAULT '0', + allowviewlog tinyint(1) NOT NULL DEFAULT '0', + allowbanpost tinyint(1) NOT NULL DEFAULT '0', + supe_allowpushthread tinyint(1) NOT NULL DEFAULT '0', + allowhighlightthread tinyint(1) NOT NULL DEFAULT '0', + allowlivethread tinyint(1) NOT NULL DEFAULT '0', + allowdigestthread tinyint(1) NOT NULL DEFAULT '0', + allowrecommendthread tinyint(1) NOT NULL DEFAULT '0', + allowbumpthread tinyint(1) NOT NULL DEFAULT '0', + allowclosethread tinyint(1) NOT NULL DEFAULT '0', + allowmovethread tinyint(1) NOT NULL DEFAULT '0', + allowedittypethread tinyint(1) NOT NULL DEFAULT '0', + allowstampthread tinyint(1) NOT NULL DEFAULT '0', + allowstamplist tinyint(1) NOT NULL DEFAULT '0', + allowcopythread tinyint(1) NOT NULL DEFAULT '0', + allowmergethread tinyint(1) NOT NULL DEFAULT '0', + allowsplitthread tinyint(1) NOT NULL DEFAULT '0', + allowrepairthread tinyint(1) NOT NULL DEFAULT '0', + allowwarnpost tinyint(1) NOT NULL DEFAULT '0', + allowviewreport tinyint(1) NOT NULL DEFAULT '0', + alloweditforum tinyint(1) NOT NULL DEFAULT '0', + allowremovereward tinyint(1) NOT NULL DEFAULT '0', + allowedittrade tinyint(1) NOT NULL DEFAULT '0', + alloweditactivity tinyint(1) NOT NULL DEFAULT '0', + allowstickreply tinyint(1) NOT NULL DEFAULT '0', + allowmanagearticle tinyint(1) NOT NULL DEFAULT '0', + allowaddtopic tinyint(1) NOT NULL DEFAULT '0', + allowmanagetopic tinyint(1) NOT NULL DEFAULT '0', + allowdiy tinyint(1) NOT NULL DEFAULT '0', + allowclearrecycle tinyint(1) NOT NULL DEFAULT '0', + allowmanagetag tinyint(1) NOT NULL DEFAULT '0', + alloweditusertag tinyint(1) NOT NULL DEFAULT '0', + managefeed tinyint(1) NOT NULL DEFAULT '0', + managedoing tinyint(1) NOT NULL DEFAULT '0', + manageshare tinyint(1) NOT NULL DEFAULT '0', + manageblog tinyint(1) NOT NULL DEFAULT '0', + managealbum tinyint(1) NOT NULL DEFAULT '0', + managecomment tinyint(1) NOT NULL DEFAULT '0', + managemagiclog tinyint(1) NOT NULL DEFAULT '0', + managereport tinyint(1) NOT NULL DEFAULT '0', + managehotuser tinyint(1) NOT NULL DEFAULT '0', + managedefaultuser tinyint(1) NOT NULL DEFAULT '0', + managemagic tinyint(1) NOT NULL DEFAULT '0', + manageclick tinyint(1) NOT NULL DEFAULT '0', + allowmanagecollection tinyint(1) NOT NULL DEFAULT '0', + allowmakehtml tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (admingid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_adminnote; +CREATE TABLE pre_common_adminnote ( + id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `admin` varchar(15) NOT NULL DEFAULT '', + access tinyint(3) NOT NULL DEFAULT '0', + adminid tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + message text NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_advertisement; +CREATE TABLE pre_common_advertisement ( + advid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + available tinyint(1) NOT NULL DEFAULT '0', + `type` varchar(50) NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + title varchar(255) NOT NULL DEFAULT '', + targets text NOT NULL, + parameters text NOT NULL, + `code` text NOT NULL, + starttime int(10) unsigned NOT NULL DEFAULT '0', + endtime int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (advid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_advertisement_custom; +CREATE TABLE pre_common_advertisement_custom ( + id smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + PRIMARY KEY (id), + KEY `name` (`name`(100)) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_banned; +CREATE TABLE pre_common_banned ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + ip varchar(49) NOT NULL DEFAULT '', + lowerip varbinary(16) NOT NULL DEFAULT 0x0, + upperip varbinary(16) NOT NULL DEFAULT 0x0, + `admin` varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY iprange (lowerip, upperip) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block; +CREATE TABLE pre_common_block ( + bid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + blockclass varchar(255) NOT NULL DEFAULT '0', + blocktype tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL DEFAULT '', + title text NOT NULL, + classname varchar(255) NOT NULL DEFAULT '', + summary text NOT NULL, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + styleid smallint(6) unsigned NOT NULL DEFAULT '0', + blockstyle text NOT NULL, + picwidth mediumint(8) unsigned NOT NULL DEFAULT '0', + picheight mediumint(8) unsigned NOT NULL DEFAULT '0', + target varchar(255) NOT NULL DEFAULT '', + dateformat varchar(255) NOT NULL DEFAULT '', + dateuformat tinyint(1) NOT NULL DEFAULT '0', + script varchar(255) NOT NULL DEFAULT '', + param text NOT NULL, + shownum smallint(6) unsigned NOT NULL DEFAULT '0', + cachetime int(10) NOT NULL DEFAULT '0', + cachetimerange char(5) NOT NULL DEFAULT '', + punctualupdate tinyint(1) NOT NULL DEFAULT '0', + hidedisplay tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + notinherited tinyint(1) NOT NULL DEFAULT '0', + isblank tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (bid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block_favorite; +CREATE TABLE pre_common_block_favorite ( + favid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + bid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (favid), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block_item; +CREATE TABLE pre_common_block_item ( + itemid int(10) unsigned NOT NULL AUTO_INCREMENT, + bid mediumint(8) unsigned NOT NULL DEFAULT '0', + id int(10) unsigned NOT NULL DEFAULT '0', + idtype varchar(255) NOT NULL DEFAULT '', + itemtype tinyint(1) NOT NULL DEFAULT '0', + title varchar(255) NOT NULL DEFAULT '', + url varchar(255) NOT NULL DEFAULT '', + pic varchar(255) NOT NULL DEFAULT '', + picflag tinyint(1) NOT NULL DEFAULT '0', + makethumb tinyint(1) NOT NULL DEFAULT '0', + thumbpath varchar(255) NOT NULL DEFAULT '', + summary text NOT NULL, + showstyle text NOT NULL, + related text NOT NULL, + `fields` text NOT NULL, + displayorder smallint(6) NOT NULL DEFAULT '0', + startdate int(10) unsigned NOT NULL DEFAULT '0', + enddate int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (itemid), + KEY bid (bid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block_item_data; +CREATE TABLE pre_common_block_item_data ( + dataid int(10) unsigned NOT NULL AUTO_INCREMENT, + bid mediumint(8) unsigned NOT NULL DEFAULT '0', + id int(10) unsigned NOT NULL DEFAULT '0', + idtype varchar(255) NOT NULL DEFAULT '', + itemtype tinyint(1) NOT NULL DEFAULT '0', + title varchar(255) NOT NULL DEFAULT '', + url varchar(255) NOT NULL DEFAULT '', + pic varchar(255) NOT NULL DEFAULT '', + picflag tinyint(1) NOT NULL DEFAULT '0', + makethumb tinyint(1) NOT NULL DEFAULT '0', + summary text NOT NULL, + showstyle text NOT NULL, + related text NOT NULL, + `fields` text NOT NULL, + displayorder smallint(6) NOT NULL DEFAULT '0', + startdate int(10) unsigned NOT NULL DEFAULT '0', + enddate int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + isverified tinyint(1) NOT NULL DEFAULT '0', + verifiedtime int(10) unsigned NOT NULL DEFAULT '0', + stickgrade tinyint(2) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (dataid), + KEY bid (bid,stickgrade,displayorder,verifiedtime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block_permission; +CREATE TABLE pre_common_block_permission ( + bid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + allowmanage tinyint(1) NOT NULL DEFAULT '0', + allowrecommend tinyint(1) NOT NULL DEFAULT '0', + needverify tinyint(1) NOT NULL DEFAULT '0', + inheritedtplname varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (bid,uid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block_pic; +CREATE TABLE pre_common_block_pic ( + picid int(10) unsigned NOT NULL AUTO_INCREMENT, + bid mediumint(8) unsigned NOT NULL DEFAULT '0', + itemid int(10) unsigned NOT NULL DEFAULT '0', + pic varchar(255) NOT NULL DEFAULT '', + picflag tinyint(1) NOT NULL DEFAULT '0', + `type` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (picid), + KEY bid (bid,itemid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block_style; +CREATE TABLE pre_common_block_style ( + styleid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + blockclass varchar(255) NOT NULL DEFAULT '', + `name` varchar(255) NOT NULL DEFAULT '', + template text NOT NULL, + `hash` varchar(255) NOT NULL DEFAULT '', + getpic tinyint(1) NOT NULL DEFAULT '0', + getsummary tinyint(1) NOT NULL DEFAULT '0', + makethumb tinyint(1) NOT NULL DEFAULT '0', + settarget tinyint(1) NOT NULL DEFAULT '0', + `fields` text NOT NULL, + moreurl tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (styleid), + KEY `hash` (`hash`(10)), + KEY blockclass (blockclass(50)) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_block_xml; +CREATE TABLE pre_common_block_xml ( + id smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + version varchar(255) NOT NULL, + url varchar(255) NOT NULL, + clientid varchar(255) NOT NULL, + `key` varchar(255) NOT NULL, + signtype varchar(255) NOT NULL, + `data` text NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_cache; +CREATE TABLE pre_common_cache ( + cachekey varchar(190) NOT NULL DEFAULT '', + cachevalue mediumblob NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (cachekey) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_card; +CREATE TABLE pre_common_card ( + id varchar(190) NOT NULL DEFAULT '', + typeid smallint(6) unsigned NOT NULL DEFAULT '1', + maketype tinyint(1) NOT NULL DEFAULT '0', + makeruid mediumint(8) unsigned NOT NULL DEFAULT '0', + price mediumint(8) unsigned NOT NULL DEFAULT '0', + extcreditskey tinyint(1) NOT NULL DEFAULT '0', + extcreditsval int(10) NOT NULL DEFAULT '0', + `status` tinyint(3) unsigned NOT NULL DEFAULT '1', + dateline int(10) unsigned NOT NULL DEFAULT '0', + cleardateline int(10) unsigned NOT NULL DEFAULT '0', + useddateline int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_card_log; +CREATE TABLE pre_common_card_log ( + id smallint(6) NOT NULL AUTO_INCREMENT, + uid mediumint(8) NOT NULL DEFAULT '0', + username varchar(20) NOT NULL DEFAULT '', + cardrule varchar(255) NOT NULL DEFAULT '', + info text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + description mediumtext NOT NULL, + operation tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY dateline (dateline), + KEY operation_dateline (operation,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_card_type; +CREATE TABLE pre_common_card_type ( + id smallint(6) NOT NULL AUTO_INCREMENT, + typename char(20) NOT NULL DEFAULT '', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_connect_guest; +CREATE TABLE pre_common_connect_guest ( + conopenid char(32) NOT NULL DEFAULT '', + conuin char(40) NOT NULL DEFAULT '', + conuinsecret char(16) NOT NULL DEFAULT '', + conqqnick char(100) NOT NULL DEFAULT '', + conuintoken char(32) NOT NULL DEFAULT '', + PRIMARY KEY (conopenid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_credit_log; +CREATE TABLE pre_common_credit_log ( + logid int(10) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + operation char(3) NOT NULL DEFAULT '', + relatedid int(10) unsigned NOT NULL, + dateline int(10) unsigned NOT NULL, + extcredits1 int(10) NOT NULL, + extcredits2 int(10) NOT NULL, + extcredits3 int(10) NOT NULL, + extcredits4 int(10) NOT NULL, + extcredits5 int(10) NOT NULL, + extcredits6 int(10) NOT NULL, + extcredits7 int(10) NOT NULL, + extcredits8 int(10) NOT NULL, + PRIMARY KEY (logid), + KEY uid (uid), + KEY operation (operation), + KEY relatedid (relatedid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_credit_log_field; +CREATE TABLE pre_common_credit_log_field ( + logid mediumint(8) unsigned NOT NULL, + title varchar(100) NOT NULL, + `text` text NOT NULL, + KEY logid (logid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_credit_rule; +CREATE TABLE pre_common_credit_rule ( + rid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + rulename varchar(20) NOT NULL DEFAULT '', + `action` varchar(20) NOT NULL DEFAULT '', + cycletype tinyint(1) NOT NULL DEFAULT '0', + cycletime int(10) NOT NULL DEFAULT '0', + rewardnum tinyint(2) NOT NULL DEFAULT '1', + norepeat tinyint(1) NOT NULL DEFAULT '0', + extcredits1 int(10) NOT NULL DEFAULT '0', + extcredits2 int(10) NOT NULL DEFAULT '0', + extcredits3 int(10) NOT NULL DEFAULT '0', + extcredits4 int(10) NOT NULL DEFAULT '0', + extcredits5 int(10) NOT NULL DEFAULT '0', + extcredits6 int(10) NOT NULL DEFAULT '0', + extcredits7 int(10) NOT NULL DEFAULT '0', + extcredits8 int(10) NOT NULL DEFAULT '0', + fids text NOT NULL, + PRIMARY KEY (rid), + UNIQUE KEY `action` (`action`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_credit_rule_log; +CREATE TABLE pre_common_credit_rule_log ( + clid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + rid mediumint(8) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + total mediumint(8) unsigned NOT NULL DEFAULT '0', + cyclenum mediumint(8) unsigned NOT NULL DEFAULT '0', + extcredits1 int(10) NOT NULL DEFAULT '0', + extcredits2 int(10) NOT NULL DEFAULT '0', + extcredits3 int(10) NOT NULL DEFAULT '0', + extcredits4 int(10) NOT NULL DEFAULT '0', + extcredits5 int(10) NOT NULL DEFAULT '0', + extcredits6 int(10) NOT NULL DEFAULT '0', + extcredits7 int(10) NOT NULL DEFAULT '0', + extcredits8 int(10) NOT NULL DEFAULT '0', + starttime int(10) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (clid), + KEY uid (uid,rid,fid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_credit_rule_log_field; +CREATE TABLE pre_common_credit_rule_log_field ( + clid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + info text NOT NULL, + `user` text NOT NULL, + app text NOT NULL, + PRIMARY KEY (uid,clid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_cron; +CREATE TABLE pre_common_cron ( + cronid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + available tinyint(1) NOT NULL DEFAULT '0', + `type` enum('user','system','plugin') NOT NULL DEFAULT 'user', + `name` char(50) NOT NULL DEFAULT '', + filename char(50) NOT NULL DEFAULT '', + lastrun int(10) unsigned NOT NULL DEFAULT '0', + nextrun int(10) unsigned NOT NULL DEFAULT '0', + weekday tinyint(1) NOT NULL DEFAULT '0', + `day` tinyint(2) NOT NULL DEFAULT '0', + `hour` tinyint(2) NOT NULL DEFAULT '0', + `minute` char(36) NOT NULL DEFAULT '', + PRIMARY KEY (cronid), + KEY nextrun (available,nextrun) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_smsgw; +CREATE TABLE pre_common_smsgw ( + `smsgwid` int(10) unsigned NOT NULL AUTO_INCREMENT, + `available` tinyint(1) NOT NULL DEFAULT '0', + `type` int(10) NOT NULL DEFAULT '0', + `order` int(10) NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL DEFAULT '', + `class` varchar(255) NOT NULL DEFAULT '0', + `sendrule` text NOT NULL, + `parameters` text NOT NULL, + PRIMARY KEY (smsgwid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_smslog; +CREATE TABLE pre_common_smslog ( + `smslogid` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uid` mediumint(8) unsigned NOT NULL, + `smstype` int(10) NOT NULL DEFAULT '0', + `svctype` int(10) NOT NULL DEFAULT '0', + `smsgw` int(10) NOT NULL DEFAULT '0', + `status` int(10) NOT NULL DEFAULT '0', + `verify` int(10) NOT NULL DEFAULT '0', + `secmobicc` varchar(3) NOT NULL DEFAULT '', + `secmobile` varchar(12) NOT NULL DEFAULT '', + `ip` varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + `content` text NOT NULL, + `dateline` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`smslogid`), + KEY dateline (`secmobicc`, `secmobile`, `dateline`), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_smslog_archive; +CREATE TABLE pre_common_smslog_archive ( + `smslogid` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uid` mediumint(8) unsigned NOT NULL, + `smstype` int(10) NOT NULL DEFAULT '0', + `svctype` int(10) NOT NULL DEFAULT '0', + `smsgw` int(10) NOT NULL DEFAULT '0', + `status` int(10) NOT NULL DEFAULT '0', + `verify` int(10) NOT NULL DEFAULT '0', + `secmobicc` varchar(3) NOT NULL DEFAULT '', + `secmobile` varchar(12) NOT NULL DEFAULT '', + `ip` varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + `content` text NOT NULL, + `dateline` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`smslogid`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_devicetoken; +CREATE TABLE pre_common_devicetoken ( + uid mediumint(8) unsigned NOT NULL, + token char(50) NOT NULL, + PRIMARY KEY (uid), + KEY token (token) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_district; +CREATE TABLE pre_common_district ( + id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `level` tinyint(4) unsigned NOT NULL DEFAULT '0', + usetype tinyint(3) unsigned NOT NULL DEFAULT '0', + upid mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY upid (upid,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_diy_data; +CREATE TABLE pre_common_diy_data ( + targettplname varchar(100) NOT NULL DEFAULT '', + tpldirectory varchar(80) NOT NULL DEFAULT '', + primaltplname varchar(255) NOT NULL DEFAULT '', + diycontent mediumtext NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (targettplname,tpldirectory) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_domain; +CREATE TABLE pre_common_domain ( + domain char(30) NOT NULL DEFAULT '', + domainroot char(60) NOT NULL DEFAULT '', + id mediumint(8) unsigned NOT NULL DEFAULT '0', + idtype char(15) NOT NULL DEFAULT '', + PRIMARY KEY (id,idtype), + KEY domain (domain,domainroot), + KEY idtype (idtype) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_failedip; +CREATE TABLE pre_common_failedip ( + ip varchar(45) NOT NULL DEFAULT '', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + count tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (ip,lastupdate), + KEY lastupdate (lastupdate) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_failedlogin; +CREATE TABLE pre_common_failedlogin ( + ip varchar(45) NOT NULL DEFAULT '', + username char(32) NOT NULL DEFAULT '', + count tinyint(3) unsigned NOT NULL DEFAULT '0', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (ip,username) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_friendlink; +CREATE TABLE pre_common_friendlink ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + displayorder tinyint(3) NOT NULL DEFAULT '0', + `name` varchar(100) NOT NULL DEFAULT '', + url varchar(255) NOT NULL DEFAULT '', + description mediumtext NOT NULL, + logo varchar(255) NOT NULL DEFAULT '', + `type` tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_grouppm; +CREATE TABLE pre_common_grouppm ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + authorid mediumint(8) unsigned NOT NULL DEFAULT '0', + author varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + message text NOT NULL, + numbers mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_invite; +CREATE TABLE pre_common_invite ( + id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + `code` char(20) NOT NULL DEFAULT '', + fuid mediumint(8) unsigned NOT NULL DEFAULT '0', + fusername char(20) NOT NULL DEFAULT '', + `type` tinyint(1) NOT NULL DEFAULT '0', + email varchar(255) NOT NULL DEFAULT '', + inviteip varchar(45) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + endtime int(10) unsigned NOT NULL DEFAULT '0', + regdateline int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '1', + orderid char(32) NOT NULL DEFAULT '', + PRIMARY KEY (id), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_magic; +CREATE TABLE pre_common_magic ( + magicid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + available tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(50) NOT NULL, + identifier varchar(40) NOT NULL, + description varchar(255) NOT NULL, + displayorder tinyint(3) NOT NULL DEFAULT '0', + credit tinyint(1) NOT NULL DEFAULT '0', + price mediumint(8) unsigned NOT NULL DEFAULT '0', + num smallint(6) unsigned NOT NULL DEFAULT '0', + salevolume smallint(6) unsigned NOT NULL DEFAULT '0', + supplytype tinyint(1) NOT NULL DEFAULT '0', + supplynum smallint(6) unsigned NOT NULL DEFAULT '0', + useperoid tinyint(1) NOT NULL DEFAULT '0', + usenum smallint(6) unsigned NOT NULL DEFAULT '0', + weight tinyint(3) unsigned NOT NULL DEFAULT '1', + magicperm text NOT NULL, + useevent tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (magicid), + UNIQUE KEY identifier (identifier), + KEY displayorder (available,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_magiclog; +CREATE TABLE pre_common_magiclog ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + magicid smallint(6) unsigned NOT NULL DEFAULT '0', + `action` tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + amount smallint(6) unsigned NOT NULL DEFAULT '0', + credit tinyint(3) unsigned NOT NULL DEFAULT '0', + price mediumint(8) unsigned NOT NULL DEFAULT '0', + targetid int(10) unsigned NOT NULL DEFAULT '0', + idtype char(6) DEFAULT NULL, + targetuid mediumint(8) unsigned NOT NULL DEFAULT '0', + KEY uid (uid,dateline), + KEY `action` (`action`), + KEY targetuid (targetuid,dateline), + KEY magicid (magicid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_mailcron; +CREATE TABLE pre_common_mailcron ( + cid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + touid mediumint(8) unsigned NOT NULL DEFAULT '0', + email varchar(255) NOT NULL DEFAULT '', + sendtime int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (cid), + KEY sendtime (sendtime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_mailqueue; +CREATE TABLE pre_common_mailqueue ( + qid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + cid mediumint(8) unsigned NOT NULL DEFAULT '0', + `subject` text NOT NULL, + message text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (qid), + KEY mcid (cid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member; +CREATE TABLE pre_common_member ( + uid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + email varchar(255) NOT NULL DEFAULT '', + username char(15) NOT NULL DEFAULT '', + `password` char(32) NOT NULL DEFAULT '', + `secmobicc` varchar(3) NOT NULL DEFAULT '', + `secmobile` varchar(12) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT '0', + emailstatus tinyint(1) NOT NULL DEFAULT '0', + avatarstatus tinyint(1) NOT NULL DEFAULT '0', + `secmobilestatus` tinyint(1) NOT NULL DEFAULT '0', + adminid tinyint(1) NOT NULL DEFAULT '0', + groupid smallint(6) unsigned NOT NULL DEFAULT '0', + groupexpiry int(10) unsigned NOT NULL DEFAULT '0', + extgroupids char(20) NOT NULL DEFAULT '', + regdate int(10) unsigned NOT NULL DEFAULT '0', + credits int(10) NOT NULL DEFAULT '0', + notifysound tinyint(1) NOT NULL DEFAULT '0', + timeoffset char(4) NOT NULL DEFAULT '', + newpm smallint(6) unsigned NOT NULL DEFAULT '0', + newprompt smallint(6) unsigned NOT NULL DEFAULT '0', + accessmasks tinyint(1) NOT NULL DEFAULT '0', + allowadmincp tinyint(1) NOT NULL DEFAULT '0', + onlyacceptfriendpm tinyint(1) NOT NULL DEFAULT '0', + conisbind tinyint(1) NOT NULL DEFAULT '0', + freeze tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (uid), + UNIQUE KEY username (username), + KEY email (email(40)), + KEY groupid (groupid), + KEY conisbind (conisbind), + KEY regdate (regdate), + KEY secmobile (`secmobile`, `secmobicc`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_action_log; +CREATE TABLE pre_common_member_action_log ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + `action` tinyint(5) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY dateline (dateline,`action`,uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_connect; +CREATE TABLE pre_common_member_connect ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + conuin char(40) NOT NULL DEFAULT '', + conuinsecret char(16) NOT NULL DEFAULT '', + conopenid char(32) NOT NULL DEFAULT '', + conisfeed tinyint(1) NOT NULL DEFAULT '0', + conispublishfeed tinyint(1) NOT NULL DEFAULT '0', + conispublisht tinyint(1) NOT NULL DEFAULT '0', + conisregister tinyint(1) NOT NULL DEFAULT '0', + conisqzoneavatar tinyint(1) NOT NULL DEFAULT '0', + conisqqshow tinyint(1) NOT NULL DEFAULT '0', + conuintoken char(32) NOT NULL DEFAULT '', + PRIMARY KEY (uid), + KEY conuin (conuin), + KEY conopenid (conopenid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_count; +CREATE TABLE pre_common_member_count ( + uid mediumint(8) unsigned NOT NULL, + extcredits1 int(10) NOT NULL DEFAULT '0', + extcredits2 int(10) NOT NULL DEFAULT '0', + extcredits3 int(10) NOT NULL DEFAULT '0', + extcredits4 int(10) NOT NULL DEFAULT '0', + extcredits5 int(10) NOT NULL DEFAULT '0', + extcredits6 int(10) NOT NULL DEFAULT '0', + extcredits7 int(10) NOT NULL DEFAULT '0', + extcredits8 int(10) NOT NULL DEFAULT '0', + friends smallint(6) unsigned NOT NULL DEFAULT '0', + posts mediumint(8) unsigned NOT NULL DEFAULT '0', + threads mediumint(8) unsigned NOT NULL DEFAULT '0', + digestposts smallint(6) unsigned NOT NULL DEFAULT '0', + doings smallint(6) unsigned NOT NULL DEFAULT '0', + blogs smallint(6) unsigned NOT NULL DEFAULT '0', + albums smallint(6) unsigned NOT NULL DEFAULT '0', + sharings smallint(6) unsigned NOT NULL DEFAULT '0', + attachsize int(10) unsigned NOT NULL DEFAULT '0', + views mediumint(8) unsigned NOT NULL DEFAULT '0', + oltime smallint(6) unsigned NOT NULL DEFAULT '0', + todayattachs smallint(6) unsigned NOT NULL DEFAULT '0', + todayattachsize int(10) unsigned NOT NULL DEFAULT '0', + feeds mediumint(8) unsigned NOT NULL DEFAULT '0', + follower mediumint(8) unsigned NOT NULL DEFAULT '0', + following mediumint(8) unsigned NOT NULL DEFAULT '0', + newfollower mediumint(8) unsigned NOT NULL DEFAULT '0', + blacklist mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid), + KEY posts (posts) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_crime; +CREATE TABLE pre_common_member_crime ( + cid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + operatorid mediumint(8) unsigned NOT NULL DEFAULT '0', + operator varchar(15) NOT NULL, + `action` tinyint(5) NOT NULL, + reason text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (cid), + KEY uid (uid,`action`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_field_forum; +CREATE TABLE pre_common_member_field_forum ( + uid mediumint(8) unsigned NOT NULL, + publishfeed tinyint(3) NOT NULL DEFAULT '0', + customshow tinyint(3) unsigned NOT NULL DEFAULT '26', + customstatus varchar(30) NOT NULL DEFAULT '', + medals text NOT NULL, + sightml text NOT NULL, + groupterms text NOT NULL, + authstr varchar(255) NOT NULL DEFAULT '', + `groups` mediumtext NOT NULL, + attentiongroup varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_field_home; +CREATE TABLE pre_common_member_field_home ( + uid mediumint(8) unsigned NOT NULL, + spacename varchar(255) NOT NULL DEFAULT '', + spacedescription varchar(255) NOT NULL DEFAULT '', + domain char(15) NOT NULL DEFAULT '', + addsize int(10) unsigned NOT NULL DEFAULT '0', + addfriend smallint(6) unsigned NOT NULL DEFAULT '0', + allowasfriend tinyint(1) NOT NULL DEFAULT '1', + allowasfollow tinyint(1) NOT NULL DEFAULT '1', + menunum smallint(6) unsigned NOT NULL DEFAULT '0', + theme varchar(20) NOT NULL DEFAULT '', + spacecss text NOT NULL, + blockposition text NOT NULL, + recentnote text NOT NULL, + spacenote text NOT NULL, + privacy text NOT NULL, + feedfriend mediumtext NOT NULL, + acceptemail text NOT NULL, + magicgift text NOT NULL, + stickblogs text NOT NULL, + PRIMARY KEY (uid), + KEY domain (domain) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_forum_buylog; +CREATE TABLE pre_common_member_forum_buylog ( + uid mediumint(8) unsigned NOT NULL, + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + credits int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,fid), + KEY fid (fid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_grouppm; +CREATE TABLE pre_common_member_grouppm ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + gpmid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `status` tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,gpmid), + KEY gpmid (gpmid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_magic; +CREATE TABLE pre_common_member_magic ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + magicid smallint(6) unsigned NOT NULL DEFAULT '0', + num smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,magicid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_medal; +CREATE TABLE pre_common_member_medal ( + uid mediumint(8) unsigned NOT NULL, + medalid smallint(6) unsigned NOT NULL, + PRIMARY KEY (uid,medalid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_newprompt; +CREATE TABLE pre_common_member_newprompt ( + uid mediumint(8) unsigned NOT NULL, + `data` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_profile; +CREATE TABLE pre_common_member_profile ( + uid mediumint(8) unsigned NOT NULL, + realname varchar(255) NOT NULL DEFAULT '', + gender tinyint(1) NOT NULL DEFAULT '0', + birthyear smallint(6) unsigned NOT NULL DEFAULT '0', + birthmonth tinyint(3) unsigned NOT NULL DEFAULT '0', + birthday tinyint(3) unsigned NOT NULL DEFAULT '0', + constellation varchar(255) NOT NULL DEFAULT '', + zodiac varchar(255) NOT NULL DEFAULT '', + telephone varchar(255) NOT NULL DEFAULT '', + mobile varchar(255) NOT NULL DEFAULT '', + idcardtype varchar(255) NOT NULL DEFAULT '', + idcard varchar(255) NOT NULL DEFAULT '', + address varchar(255) NOT NULL DEFAULT '', + zipcode varchar(255) NOT NULL DEFAULT '', + nationality varchar(255) NOT NULL DEFAULT '', + birthcountry varchar(255) NOT NULL DEFAULT '', + birthprovince varchar(255) NOT NULL DEFAULT '', + birthcity varchar(255) NOT NULL DEFAULT '', + birthdist varchar(20) NOT NULL DEFAULT '', + birthcommunity varchar(255) NOT NULL DEFAULT '', + residecountry varchar(255) NOT NULL DEFAULT '', + resideprovince varchar(255) NOT NULL DEFAULT '', + residecity varchar(255) NOT NULL DEFAULT '', + residedist varchar(20) NOT NULL DEFAULT '', + residecommunity varchar(255) NOT NULL DEFAULT '', + residesuite varchar(255) NOT NULL DEFAULT '', + graduateschool varchar(255) NOT NULL DEFAULT '', + company varchar(255) NOT NULL DEFAULT '', + education varchar(255) NOT NULL DEFAULT '', + occupation varchar(255) NOT NULL DEFAULT '', + position varchar(255) NOT NULL DEFAULT '', + revenue varchar(255) NOT NULL DEFAULT '', + affectivestatus varchar(255) NOT NULL DEFAULT '', + lookingfor varchar(255) NOT NULL DEFAULT '', + bloodtype varchar(255) NOT NULL DEFAULT '', + height varchar(255) NOT NULL DEFAULT '', + weight varchar(255) NOT NULL DEFAULT '', + alipay varchar(255) NOT NULL DEFAULT '', + icq varchar(255) NOT NULL DEFAULT '', + qq varchar(255) NOT NULL DEFAULT '', + yahoo varchar(255) NOT NULL DEFAULT '', + msn varchar(255) NOT NULL DEFAULT '', + taobao varchar(255) NOT NULL DEFAULT '', + site varchar(255) NOT NULL DEFAULT '', + bio text NOT NULL, + interest text NOT NULL, + field1 text NOT NULL, + field2 text NOT NULL, + field3 text NOT NULL, + field4 text NOT NULL, + field5 text NOT NULL, + field6 text NOT NULL, + field7 text NOT NULL, + field8 text NOT NULL, + PRIMARY KEY (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_profile_history; +CREATE TABLE pre_common_member_profile_history ( + hid int(10) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL, + realname varchar(255) NOT NULL DEFAULT '', + gender tinyint(1) NOT NULL DEFAULT '0', + birthyear smallint(6) unsigned NOT NULL DEFAULT '0', + birthmonth tinyint(3) unsigned NOT NULL DEFAULT '0', + birthday tinyint(3) unsigned NOT NULL DEFAULT '0', + constellation varchar(255) NOT NULL DEFAULT '', + zodiac varchar(255) NOT NULL DEFAULT '', + telephone varchar(255) NOT NULL DEFAULT '', + mobile varchar(255) NOT NULL DEFAULT '', + idcardtype varchar(255) NOT NULL DEFAULT '', + idcard varchar(255) NOT NULL DEFAULT '', + address varchar(255) NOT NULL DEFAULT '', + zipcode varchar(255) NOT NULL DEFAULT '', + nationality varchar(255) NOT NULL DEFAULT '', + birthcountry varchar(255) NOT NULL DEFAULT '', + birthprovince varchar(255) NOT NULL DEFAULT '', + birthcity varchar(255) NOT NULL DEFAULT '', + birthdist varchar(20) NOT NULL DEFAULT '', + birthcommunity varchar(255) NOT NULL DEFAULT '', + residecountry varchar(255) NOT NULL DEFAULT '', + resideprovince varchar(255) NOT NULL DEFAULT '', + residecity varchar(255) NOT NULL DEFAULT '', + residedist varchar(20) NOT NULL DEFAULT '', + residecommunity varchar(255) NOT NULL DEFAULT '', + residesuite varchar(255) NOT NULL DEFAULT '', + graduateschool varchar(255) NOT NULL DEFAULT '', + company varchar(255) NOT NULL DEFAULT '', + education varchar(255) NOT NULL DEFAULT '', + occupation varchar(255) NOT NULL DEFAULT '', + position varchar(255) NOT NULL DEFAULT '', + revenue varchar(255) NOT NULL DEFAULT '', + affectivestatus varchar(255) NOT NULL DEFAULT '', + lookingfor varchar(255) NOT NULL DEFAULT '', + bloodtype varchar(255) NOT NULL DEFAULT '', + height varchar(255) NOT NULL DEFAULT '', + weight varchar(255) NOT NULL DEFAULT '', + alipay varchar(255) NOT NULL DEFAULT '', + icq varchar(255) NOT NULL DEFAULT '', + qq varchar(255) NOT NULL DEFAULT '', + yahoo varchar(255) NOT NULL DEFAULT '', + msn varchar(255) NOT NULL DEFAULT '', + taobao varchar(255) NOT NULL DEFAULT '', + site varchar(255) NOT NULL DEFAULT '', + bio text NOT NULL, + interest text NOT NULL, + field1 text NOT NULL, + field2 text NOT NULL, + field3 text NOT NULL, + field4 text NOT NULL, + field5 text NOT NULL, + field6 text NOT NULL, + field7 text NOT NULL, + field8 text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (hid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_profile_setting; +CREATE TABLE pre_common_member_profile_setting ( + fieldid varchar(190) NOT NULL DEFAULT '', + available tinyint(1) NOT NULL DEFAULT '0', + invisible tinyint(1) NOT NULL DEFAULT '0', + needverify tinyint(1) NOT NULL DEFAULT '0', + title varchar(255) NOT NULL DEFAULT '', + description varchar(255) NOT NULL DEFAULT '', + displayorder smallint(6) unsigned NOT NULL DEFAULT '0', + required tinyint(1) NOT NULL DEFAULT '0', + unchangeable tinyint(1) NOT NULL DEFAULT '0', + showincard tinyint(1) NOT NULL DEFAULT '0', + showinthread tinyint(1) NOT NULL DEFAULT '0', + showinregister tinyint(1) NOT NULL DEFAULT '0', + allowsearch tinyint(1) NOT NULL DEFAULT '0', + formtype varchar(255) NOT NULL, + size smallint(6) unsigned NOT NULL DEFAULT '0', + choices text NOT NULL, + validate text NOT NULL, + PRIMARY KEY (fieldid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_security; +CREATE TABLE pre_common_member_security ( + securityid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + fieldid varchar(255) NOT NULL DEFAULT '', + oldvalue text NOT NULL, + newvalue text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (securityid), + KEY uid (uid,fieldid(40)), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_secwhite; +CREATE TABLE pre_common_member_secwhite ( + uid int(10) NOT NULL, + dateline int(10) NOT NULL, + PRIMARY KEY (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_stat_field; +CREATE TABLE pre_common_member_stat_field ( + optionid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + fieldid varchar(255) NOT NULL DEFAULT '', + fieldvalue varchar(255) NOT NULL DEFAULT '', + `hash` varchar(255) NOT NULL DEFAULT '', + users mediumint(8) unsigned NOT NULL DEFAULT '0', + updatetime int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (optionid), + KEY fieldid (fieldid(40)) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_status; +CREATE TABLE pre_common_member_status ( + uid mediumint(8) unsigned NOT NULL, + regip varchar(45) NOT NULL DEFAULT '', + lastip varchar(45) NOT NULL DEFAULT '', + `regport` smallint(6) unsigned NOT NULL DEFAULT '0', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + lastvisit int(10) unsigned NOT NULL DEFAULT '0', + lastactivity int(10) unsigned NOT NULL DEFAULT '0', + lastpost int(10) unsigned NOT NULL DEFAULT '0', + lastsendmail int(10) unsigned NOT NULL DEFAULT '0', + invisible tinyint(1) NOT NULL DEFAULT '0', + buyercredit smallint(6) NOT NULL DEFAULT '0', + sellercredit smallint(6) NOT NULL DEFAULT '0', + favtimes mediumint(8) unsigned NOT NULL DEFAULT '0', + sharetimes mediumint(8) unsigned NOT NULL DEFAULT '0', + profileprogress tinyint(2) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid), + KEY lastactivity (lastactivity,invisible) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_validate; +CREATE TABLE pre_common_member_validate ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + submitdate int(10) unsigned NOT NULL DEFAULT '0', + moddate int(10) unsigned NOT NULL DEFAULT '0', + `admin` varchar(15) NOT NULL DEFAULT '', + submittimes tinyint(3) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '0', + message text NOT NULL, + remark text NOT NULL, + PRIMARY KEY (uid), + KEY `status` (`status`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_verify; +CREATE TABLE pre_common_member_verify ( + uid mediumint(8) unsigned NOT NULL, + verify1 tinyint(1) NOT NULL DEFAULT '0', + verify2 tinyint(1) NOT NULL DEFAULT '0', + verify3 tinyint(1) NOT NULL DEFAULT '0', + verify4 tinyint(1) NOT NULL DEFAULT '0', + verify5 tinyint(1) NOT NULL DEFAULT '0', + verify6 tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (uid), + KEY verify1 (verify1), + KEY verify2 (verify2), + KEY verify3 (verify3), + KEY verify4 (verify4), + KEY verify5 (verify5), + KEY verify6 (verify6) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_member_verify_info; +CREATE TABLE pre_common_member_verify_info ( + vid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(30) NOT NULL DEFAULT '', + verifytype tinyint(1) NOT NULL DEFAULT '0', + flag tinyint(1) NOT NULL DEFAULT '0', + field text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (vid), + KEY verifytype (verifytype,flag), + KEY uid (uid,verifytype,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_mytask; +CREATE TABLE pre_common_mytask ( + uid mediumint(8) unsigned NOT NULL, + username char(15) NOT NULL DEFAULT '', + taskid smallint(6) unsigned NOT NULL, + `status` tinyint(1) NOT NULL DEFAULT '0', + csc char(255) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,taskid), + KEY parter (taskid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_nav; +CREATE TABLE pre_common_nav ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + parentid smallint(6) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + title varchar(255) NOT NULL, + url varchar(255) NOT NULL, + identifier varchar(255) NOT NULL, + target tinyint(1) NOT NULL DEFAULT '0', + `type` tinyint(1) NOT NULL DEFAULT '0', + available tinyint(1) NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL, + highlight tinyint(1) NOT NULL DEFAULT '0', + `level` tinyint(1) NOT NULL DEFAULT '0', + subtype tinyint(1) NOT NULL DEFAULT '0', + subcols tinyint(1) NOT NULL DEFAULT '0', + icon varchar(255) NOT NULL, + subname varchar(255) NOT NULL, + suburl varchar(255) NOT NULL, + navtype tinyint(1) NOT NULL DEFAULT '0', + logo varchar(255) NOT NULL, + PRIMARY KEY (id), + KEY navtype (navtype) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_onlinetime; +CREATE TABLE pre_common_onlinetime ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + thismonth smallint(6) unsigned NOT NULL DEFAULT '0', + total mediumint(8) unsigned NOT NULL DEFAULT '0', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_optimizer; +CREATE TABLE pre_common_optimizer ( + k char(100) NOT NULL DEFAULT '', + v char(255) NOT NULL DEFAULT '', + PRIMARY KEY (k) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_patch; +CREATE TABLE pre_common_patch ( + `serial` varchar(10) NOT NULL DEFAULT '', + rule text NOT NULL, + note text NOT NULL, + `status` tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`serial`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_plugin; +CREATE TABLE pre_common_plugin ( + pluginid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + available tinyint(1) NOT NULL DEFAULT '0', + adminid tinyint(3) unsigned NOT NULL DEFAULT '0', + `name` varchar(40) NOT NULL DEFAULT '', + identifier varchar(40) NOT NULL DEFAULT '', + description varchar(255) NOT NULL DEFAULT '', + datatables varchar(255) NOT NULL DEFAULT '', + `directory` varchar(100) NOT NULL DEFAULT '', + copyright varchar(100) NOT NULL DEFAULT '', + modules text NOT NULL, + version varchar(20) NOT NULL DEFAULT '', + PRIMARY KEY (pluginid), + UNIQUE KEY identifier (identifier) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_pluginvar; +CREATE TABLE pre_common_pluginvar ( + pluginvarid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + pluginid smallint(6) unsigned NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + title varchar(100) NOT NULL DEFAULT '', + description varchar(255) NOT NULL DEFAULT '', + variable varchar(40) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'text', + `value` text NOT NULL, + extra text NOT NULL, + PRIMARY KEY (pluginvarid), + KEY pluginid (pluginid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_process; +CREATE TABLE pre_common_process ( + processid char(32) NOT NULL, + expiry int(10) DEFAULT NULL, + extra int(10) DEFAULT NULL, + PRIMARY KEY (processid), + KEY expiry (expiry) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_regip; +CREATE TABLE pre_common_regip ( + ip varchar(45) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + count smallint(6) NOT NULL DEFAULT '0', + KEY ip (ip) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_relatedlink; +CREATE TABLE pre_common_relatedlink ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL DEFAULT '', + url varchar(255) NOT NULL DEFAULT '', + extent tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_report; +CREATE TABLE pre_common_report ( + id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + urlkey char(32) NOT NULL DEFAULT '', + url varchar(255) NOT NULL DEFAULT '', + message text NOT NULL, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + num smallint(6) unsigned NOT NULL DEFAULT '1', + opuid mediumint(8) unsigned NOT NULL DEFAULT '0', + opname varchar(15) NOT NULL DEFAULT '', + optime int(10) unsigned NOT NULL DEFAULT '0', + opresult varchar(255) NOT NULL DEFAULT '', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY urlkey (urlkey), + KEY fid (fid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_searchindex; +CREATE TABLE pre_common_searchindex ( + searchid int(10) unsigned NOT NULL AUTO_INCREMENT, + srchmod tinyint(3) unsigned NOT NULL, + keywords varchar(255) NOT NULL DEFAULT '', + searchstring text NOT NULL, + useip varchar(45) NOT NULL DEFAULT '', + uid mediumint(10) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + threadsortid smallint(6) unsigned NOT NULL DEFAULT '0', + num smallint(6) unsigned NOT NULL DEFAULT '0', + ids text NOT NULL, + PRIMARY KEY (searchid), + KEY srchmod (srchmod) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_seccheck; +CREATE TABLE pre_common_seccheck ( + ssid int(10) NOT NULL AUTO_INCREMENT, + dateline int(10) NOT NULL, + `code` char(6) NOT NULL, + succeed tinyint(1) NOT NULL, + verified tinyint(1) NOT NULL, + PRIMARY KEY (ssid), + KEY dateline (dateline), + KEY succeed (succeed), + KEY verified (verified) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_secquestion; +CREATE TABLE pre_common_secquestion ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `type` tinyint(3) unsigned NOT NULL, + question text NOT NULL, + answer varchar(255) NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_session; +CREATE TABLE pre_common_session ( + sid char(6) NOT NULL DEFAULT '', + ip varchar(45) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL DEFAULT '', + groupid smallint(6) unsigned NOT NULL DEFAULT '0', + invisible tinyint(1) NOT NULL DEFAULT '0', + `action` tinyint(3) unsigned NOT NULL DEFAULT '0', + lastactivity int(10) unsigned NOT NULL DEFAULT '0', + lastolupdate int(10) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY sid (sid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_setting; +CREATE TABLE pre_common_setting ( + skey varchar(190) NOT NULL DEFAULT '', + svalue text NOT NULL, + PRIMARY KEY (skey) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_smiley; +CREATE TABLE pre_common_smiley ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + typeid smallint(6) unsigned NOT NULL, + displayorder tinyint(1) NOT NULL DEFAULT '0', + `type` enum('smiley','stamp','stamplist') NOT NULL DEFAULT 'smiley', + `code` varchar(30) NOT NULL DEFAULT '', + url varchar(30) NOT NULL DEFAULT '', + PRIMARY KEY (id), + KEY `type` (`type`,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_sphinxcounter; +CREATE TABLE pre_common_sphinxcounter ( + indexid tinyint(1) NOT NULL, + maxid int(10) NOT NULL, + PRIMARY KEY (indexid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_stat; +CREATE TABLE pre_common_stat ( + daytime int(10) unsigned NOT NULL DEFAULT '0', + login int(10) unsigned NOT NULL DEFAULT '0', + mobilelogin int(10) unsigned NOT NULL DEFAULT '0', + connectlogin int(10) unsigned NOT NULL DEFAULT '0', + register int(10) unsigned NOT NULL DEFAULT '0', + invite int(10) unsigned NOT NULL DEFAULT '0', + doing int(10) unsigned NOT NULL DEFAULT '0', + blog int(10) unsigned NOT NULL DEFAULT '0', + pic int(10) unsigned NOT NULL DEFAULT '0', + poll int(10) unsigned NOT NULL DEFAULT '0', + activity int(10) unsigned NOT NULL DEFAULT '0', + `share` int(10) unsigned NOT NULL DEFAULT '0', + thread int(10) unsigned NOT NULL DEFAULT '0', + docomment int(10) unsigned NOT NULL DEFAULT '0', + blogcomment int(10) unsigned NOT NULL DEFAULT '0', + piccomment int(10) unsigned NOT NULL DEFAULT '0', + sharecomment int(10) unsigned NOT NULL DEFAULT '0', + reward int(10) unsigned NOT NULL DEFAULT '0', + debate int(10) unsigned NOT NULL DEFAULT '0', + trade int(10) unsigned NOT NULL DEFAULT '0', + `group` int(10) unsigned NOT NULL DEFAULT '0', + groupjoin int(10) unsigned NOT NULL DEFAULT '0', + groupthread int(10) unsigned NOT NULL DEFAULT '0', + grouppost int(10) unsigned NOT NULL DEFAULT '0', + post int(10) unsigned NOT NULL DEFAULT '0', + wall int(10) unsigned NOT NULL DEFAULT '0', + poke int(10) unsigned NOT NULL DEFAULT '0', + click int(10) unsigned NOT NULL DEFAULT '0', + sendpm int(10) unsigned NOT NULL DEFAULT '0', + friend int(10) unsigned NOT NULL DEFAULT '0', + addfriend int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (daytime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_statuser; +CREATE TABLE pre_common_statuser ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + daytime int(10) unsigned NOT NULL DEFAULT '0', + `type` char(20) NOT NULL DEFAULT '', + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_style; +CREATE TABLE pre_common_style ( + styleid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(20) NOT NULL DEFAULT '', + available tinyint(1) NOT NULL DEFAULT '1', + templateid smallint(6) unsigned NOT NULL DEFAULT '0', + extstyle varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (styleid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_stylevar; +CREATE TABLE pre_common_stylevar ( + stylevarid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + styleid smallint(6) unsigned NOT NULL DEFAULT '0', + variable text NOT NULL, + substitute text NOT NULL, + PRIMARY KEY (stylevarid), + KEY styleid (styleid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_syscache; +CREATE TABLE pre_common_syscache ( + cname varchar(32) NOT NULL, + ctype tinyint(3) unsigned NOT NULL, + dateline int(10) unsigned NOT NULL, + `data` mediumblob NOT NULL, + PRIMARY KEY (cname) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_tag; +CREATE TABLE pre_common_tag ( + tagid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + tagname char(20) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (tagid), + KEY tagname (tagname), + KEY `status` (`status`,tagid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_tagitem; +CREATE TABLE pre_common_tagitem ( + tagid mediumint(8) unsigned NOT NULL DEFAULT '0', + itemid mediumint(8) unsigned NOT NULL DEFAULT '0', + idtype char(10) NOT NULL DEFAULT '', + UNIQUE KEY item (tagid,itemid,idtype), + KEY idtype (idtype,itemid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_task; +CREATE TABLE pre_common_task ( + taskid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + relatedtaskid smallint(6) unsigned NOT NULL DEFAULT '0', + exclusivetaskid smallint(6) unsigned NOT NULL DEFAULT '0', + available tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(50) NOT NULL DEFAULT '', + description text NOT NULL, + icon varchar(150) NOT NULL DEFAULT '', + applicants int(10) unsigned NOT NULL DEFAULT '0', + achievers int(10) unsigned NOT NULL DEFAULT '0', + tasklimits mediumint(8) unsigned NOT NULL DEFAULT '0', + applyperm text NOT NULL, + scriptname varchar(50) NOT NULL DEFAULT '', + starttime int(10) unsigned NOT NULL DEFAULT '0', + endtime int(10) unsigned NOT NULL DEFAULT '0', + period int(10) unsigned NOT NULL DEFAULT '0', + periodtype tinyint(1) NOT NULL DEFAULT '0', + reward enum('credit','magic','medal','invite','group') NOT NULL DEFAULT 'credit', + prize varchar(15) NOT NULL DEFAULT '', + bonus int(10) NOT NULL DEFAULT '0', + displayorder smallint(6) unsigned NOT NULL DEFAULT '0', + version varchar(15) NOT NULL DEFAULT '', + PRIMARY KEY (taskid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_taskvar; +CREATE TABLE pre_common_taskvar ( + taskvarid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + taskid smallint(6) unsigned NOT NULL DEFAULT '0', + sort enum('apply','complete') NOT NULL DEFAULT 'complete', + `name` varchar(100) NOT NULL DEFAULT '', + description varchar(255) NOT NULL DEFAULT '', + variable varchar(40) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'text', + `value` text NOT NULL, + PRIMARY KEY (taskvarid), + KEY taskid (taskid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_template; +CREATE TABLE pre_common_template ( + templateid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(30) NOT NULL DEFAULT '', + `directory` varchar(100) NOT NULL DEFAULT '', + copyright varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (templateid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_template_block; +CREATE TABLE pre_common_template_block ( + targettplname varchar(100) NOT NULL DEFAULT '', + tpldirectory varchar(80) NOT NULL DEFAULT '', + bid mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (targettplname,tpldirectory,bid), + KEY bid (bid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_template_permission; +CREATE TABLE pre_common_template_permission ( + targettplname varchar(100) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + allowmanage tinyint(1) NOT NULL DEFAULT '0', + allowrecommend tinyint(1) NOT NULL DEFAULT '0', + needverify tinyint(1) NOT NULL DEFAULT '0', + inheritedtplname varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (targettplname,uid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_uin_black; +CREATE TABLE pre_common_uin_black ( + uin char(40) NOT NULL, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uin), + UNIQUE KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_usergroup; +CREATE TABLE pre_common_usergroup ( + groupid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + radminid tinyint(3) NOT NULL DEFAULT '0', + `type` enum('system','special','member') NOT NULL DEFAULT 'member', + `system` varchar(255) NOT NULL DEFAULT 'private', + grouptitle varchar(255) NOT NULL DEFAULT '', + creditshigher int(10) NOT NULL DEFAULT '0', + creditslower int(10) NOT NULL DEFAULT '0', + stars tinyint(3) NOT NULL DEFAULT '0', + color varchar(255) NOT NULL DEFAULT '', + icon varchar(255) NOT NULL DEFAULT '', + allowvisit tinyint(1) NOT NULL DEFAULT '0', + allowsendpm tinyint(1) NOT NULL DEFAULT '1', + allowinvite tinyint(1) NOT NULL DEFAULT '0', + allowmailinvite tinyint(1) NOT NULL DEFAULT '0', + allowfollow tinyint(1) NOT NULL DEFAULT '0', + maxinvitenum tinyint(3) unsigned NOT NULL DEFAULT '0', + inviteprice smallint(6) unsigned NOT NULL DEFAULT '0', + maxinviteday smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (groupid), + KEY creditsrange (creditshigher,creditslower) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_usergroup_field; +CREATE TABLE pre_common_usergroup_field ( + groupid smallint(6) unsigned NOT NULL, + readaccess tinyint(3) unsigned NOT NULL DEFAULT '0', + allowpost tinyint(1) NOT NULL DEFAULT '0', + allowreply tinyint(1) NOT NULL DEFAULT '0', + allowpostpoll tinyint(1) NOT NULL DEFAULT '0', + allowpostreward tinyint(1) NOT NULL DEFAULT '0', + allowposttrade tinyint(1) NOT NULL DEFAULT '0', + allowpostactivity tinyint(1) NOT NULL DEFAULT '0', + allowdirectpost tinyint(1) NOT NULL DEFAULT '0', + allowgetattach tinyint(1) NOT NULL DEFAULT '0', + allowgetimage tinyint(1) NOT NULL DEFAULT '0', + allowpostattach tinyint(1) NOT NULL DEFAULT '0', + allowpostimage tinyint(1) NOT NULL DEFAULT '0', + allowvote tinyint(1) NOT NULL DEFAULT '0', + allowsearch tinyint(1) NOT NULL DEFAULT '0', + allowcstatus tinyint(1) NOT NULL DEFAULT '0', + allowinvisible tinyint(1) NOT NULL DEFAULT '0', + allowtransfer tinyint(1) NOT NULL DEFAULT '0', + allowsetreadperm tinyint(1) NOT NULL DEFAULT '0', + allowsetattachperm tinyint(1) NOT NULL DEFAULT '0', + allowposttag tinyint(1) NOT NULL DEFAULT '0', + allowhidecode tinyint(1) NOT NULL DEFAULT '0', + allowhtml tinyint(1) NOT NULL DEFAULT '0', + allowanonymous tinyint(1) NOT NULL DEFAULT '0', + allowsigbbcode tinyint(1) NOT NULL DEFAULT '0', + allowsigimgcode tinyint(1) NOT NULL DEFAULT '0', + allowmagics tinyint(3) unsigned NOT NULL, + disableperiodctrl tinyint(1) NOT NULL DEFAULT '0', + reasonpm tinyint(1) NOT NULL DEFAULT '0', + maxprice smallint(6) unsigned NOT NULL DEFAULT '0', + maxsigsize smallint(6) unsigned NOT NULL DEFAULT '0', + maxattachsize int(10) unsigned NOT NULL DEFAULT '0', + maxsizeperday int(10) unsigned NOT NULL DEFAULT '0', + maxthreadsperhour tinyint(3) unsigned NOT NULL DEFAULT '0', + maxpostsperhour tinyint(3) unsigned NOT NULL DEFAULT '0', + attachextensions char(100) NOT NULL DEFAULT '', + raterange char(150) NOT NULL DEFAULT '', + loginreward char(150) NOT NULL DEFAULT '', + mintradeprice smallint(6) unsigned NOT NULL DEFAULT '1', + maxtradeprice smallint(6) unsigned NOT NULL DEFAULT '0', + minrewardprice smallint(6) unsigned NOT NULL DEFAULT '1', + maxrewardprice smallint(6) unsigned NOT NULL DEFAULT '0', + magicsdiscount tinyint(1) NOT NULL, + maxmagicsweight smallint(6) unsigned NOT NULL, + allowpostdebate tinyint(1) NOT NULL DEFAULT '0', + tradestick tinyint(3) unsigned NOT NULL, + exempt tinyint(3) unsigned NOT NULL, + maxattachnum smallint(6) NOT NULL DEFAULT '0', + allowposturl tinyint(1) NOT NULL DEFAULT '3', + allowrecommend tinyint(3) unsigned NOT NULL DEFAULT '1', + allowpostrushreply tinyint(1) NOT NULL DEFAULT '0', + maxfriendnum smallint(6) unsigned NOT NULL DEFAULT '0', + maxspacesize int(10) unsigned NOT NULL DEFAULT '0', + allowcomment tinyint(1) NOT NULL DEFAULT '0', + allowcommentmod tinyint(1) NOT NULL DEFAULT '0', + allowcommentarticle smallint(6) NOT NULL DEFAULT '0', + allowcommentarticlemod tinyint(1) NOT NULL DEFAULT '0', + searchinterval smallint(6) unsigned NOT NULL DEFAULT '0', + searchignore tinyint(1) NOT NULL DEFAULT '0', + allowblog tinyint(1) NOT NULL DEFAULT '0', + allowdoing tinyint(1) NOT NULL DEFAULT '0', + allowupload tinyint(1) NOT NULL DEFAULT '0', + allowshare tinyint(1) NOT NULL DEFAULT '0', + allowblogmod tinyint(1) NOT NULL DEFAULT '0', + allowdoingmod tinyint(1) NOT NULL DEFAULT '0', + allowuploadmod tinyint(1) NOT NULL DEFAULT '0', + allowsharemod tinyint(1) NOT NULL DEFAULT '0', + allowcss tinyint(1) NOT NULL DEFAULT '0', + allowpoke tinyint(1) NOT NULL DEFAULT '0', + allowfriend tinyint(1) NOT NULL DEFAULT '0', + allowclick tinyint(1) NOT NULL DEFAULT '0', + allowmagic tinyint(1) NOT NULL DEFAULT '0', + allowstat tinyint(1) NOT NULL DEFAULT '0', + allowstatdata tinyint(1) NOT NULL DEFAULT '0', + magicdiscount tinyint(1) NOT NULL DEFAULT '0', + domainlength smallint(6) unsigned NOT NULL DEFAULT '0', + seccode tinyint(1) NOT NULL DEFAULT '1', + disablepostctrl tinyint(1) NOT NULL DEFAULT '0', + allowbuildgroup tinyint(3) unsigned NOT NULL DEFAULT '0', + allowgroupdirectpost tinyint(3) unsigned NOT NULL DEFAULT '0', + allowgroupposturl tinyint(3) unsigned NOT NULL DEFAULT '0', + edittimelimit int(10) unsigned NOT NULL DEFAULT '0', + allowpostarticle tinyint(1) NOT NULL DEFAULT '0', + allowdownlocalimg tinyint(1) NOT NULL DEFAULT '0', + allowdownremoteimg tinyint(1) NOT NULL DEFAULT '0', + allowpostarticlemod tinyint(1) NOT NULL DEFAULT '0', + allowspacediyhtml tinyint(1) NOT NULL DEFAULT '0', + allowspacediybbcode tinyint(1) NOT NULL DEFAULT '0', + allowspacediyimgcode tinyint(1) NOT NULL DEFAULT '0', + allowcommentpost tinyint(1) NOT NULL DEFAULT '2', + allowcommentitem tinyint(1) NOT NULL DEFAULT '0', + allowcommentreply tinyint(1) NOT NULL DEFAULT '0', + allowreplycredit tinyint(1) NOT NULL DEFAULT '0', + ignorecensor tinyint(1) NOT NULL DEFAULT '0', + allowsendallpm tinyint(1) NOT NULL DEFAULT '0', + allowsendpmmaxnum smallint(6) unsigned NOT NULL DEFAULT '0', + maximagesize mediumint(8) unsigned NOT NULL DEFAULT '0', + allowmediacode tinyint(1) NOT NULL DEFAULT '0', + allowbegincode tinyint(1) NOT NULL DEFAULT '0', + allowat smallint(6) unsigned NOT NULL DEFAULT '0', + allowsave tinyint(1) NOT NULL DEFAULT '1', + allowsavereply tinyint(1) NOT NULL DEFAULT '1', + allowsavenum int(10) unsigned NOT NULL DEFAULT '0', + allowsetpublishdate tinyint(1) NOT NULL DEFAULT '0', + allowfollowcollection tinyint(3) unsigned NOT NULL DEFAULT '0', + allowcommentcollection tinyint(1) NOT NULL DEFAULT '0', + allowcreatecollection smallint(6) unsigned NOT NULL DEFAULT '0', + forcesecques tinyint(1) NOT NULL DEFAULT '0', + forcelogin tinyint(3) unsigned NOT NULL DEFAULT '0', + closead tinyint(1) NOT NULL DEFAULT '0', + buildgroupcredits smallint(6) unsigned NOT NULL DEFAULT '0', + allowimgcontent tinyint(1) NOT NULL DEFAULT '0', + allowavatarupload tinyint(1) NOT NULL DEFAULT '0', + allowviewprofile tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (groupid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_visit; +CREATE TABLE pre_common_visit ( + ip varchar(45) NOT NULL DEFAULT '', + `view` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (ip), + KEY ip (ip,`view`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_word; +CREATE TABLE pre_common_word ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `admin` varchar(15) NOT NULL DEFAULT '', + `type` smallint(6) NOT NULL DEFAULT '1', + find varchar(255) NOT NULL DEFAULT '', + replacement varchar(255) NOT NULL DEFAULT '', + extra varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_word_type; +CREATE TABLE pre_common_word_type ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + typename varchar(15) NOT NULL DEFAULT '', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_payment_order; +CREATE TABLE pre_common_payment_order ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `out_biz_no` varchar(64) NOT NULL, + `type` varchar(190) NOT NULL, + `type_name` varchar(255) DEFAULT NULL, + `uid` int(10) unsigned NOT NULL DEFAULT 0, + `amount` int(10) unsigned NOT NULL, + `amount_fee` int(10) unsigned NOT NULL, + `subject` varchar(255) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `expire_time` int(10) unsigned NOT NULL, + `status` tinyint(1) NOT NULL, + `return_url` varchar(255) DEFAULT NULL, + `data` text DEFAULT NULL, + `clientip` varchar(255) NOT NULL DEFAULT '', + `remoteport` smallint(6) unsigned NOT NULL DEFAULT 0, + `dateline` int(10) unsigned NOT NULL, + `trade_no` varchar(255) DEFAULT NULL, + `channel` varchar(255) DEFAULT NULL, + `payment_time` int(10) unsigned DEFAULT NULL, + `callback_status` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `out_biz_no` (`out_biz_no`), + KEY `uid` (`uid`), + KEY `type` (`type`), + KEY `status` (`status`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_payment_refund; +CREATE TABLE pre_common_payment_refund ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `order_id` int(10) unsigned NOT NULL, + `out_biz_no` varchar(64) NOT NULL, + `amount` int(10) unsigned NOT NULL, + `description` varchar(255) NOT NULL, + `status` tinyint(1) NOT NULL, + `error` varchar(255) DEFAULT NULL, + `refund_time` int(10) DEFAULT NULL, + `clientip` varchar(255) NOT NULL DEFAULT '', + `remoteport` smallint(6) unsigned NOT NULL DEFAULT 0, + `dateline` int(10) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `out_biz_no` (`out_biz_no`), + KEY `order_id` (`order_id`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_common_payment_transfer; +CREATE TABLE pre_common_payment_transfer ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uid` int(10) unsigned NOT NULL, + `out_biz_no` varchar(64) NOT NULL, + `amount` int(10) unsigned NOT NULL, + `subject` varchar(255) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `realname` varchar(255) NOT NULL, + `account` varchar(255) NOT NULL, + `channel` varchar(255) DEFAULT NULL, + `status` tinyint(3) unsigned NOT NULL, + `error` varchar(255) DEFAULT NULL, + `trade_no` varchar(255) DEFAULT NULL, + `trade_time` int(10) unsigned DEFAULT NULL, + `clientip` varchar(255) NOT NULL DEFAULT '', + `remoteport` smallint(6) unsigned NOT NULL DEFAULT 0, + `dateline` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `out_biz_no` (`out_biz_no`), + KEY `uid` (`uid`), + KEY `status` (`status`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_connect_disktask; +CREATE TABLE pre_connect_disktask ( + taskid int(10) unsigned NOT NULL AUTO_INCREMENT, + aid int(10) unsigned NOT NULL DEFAULT '0', + uid int(10) unsigned NOT NULL DEFAULT '0', + openid char(32) NOT NULL DEFAULT '', + filename varchar(255) NOT NULL DEFAULT '', + verifycode char(32) NOT NULL DEFAULT '', + `status` smallint(6) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + downloadtime int(10) unsigned NOT NULL DEFAULT '0', + extra text, + PRIMARY KEY (taskid), + KEY openid (openid), + KEY `status` (`status`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_connect_feedlog; +CREATE TABLE pre_connect_feedlog ( + flid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + publishtimes mediumint(8) unsigned NOT NULL DEFAULT '0', + lastpublished int(10) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (flid), + UNIQUE KEY tid (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_connect_memberbindlog; +CREATE TABLE pre_connect_memberbindlog ( + mblid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + uin char(40) NOT NULL, + `type` tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (mblid), + KEY uid (uid), + KEY uin (uin), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_connect_postfeedlog; +CREATE TABLE pre_connect_postfeedlog ( + flid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + publishtimes mediumint(8) unsigned NOT NULL DEFAULT '0', + lastpublished int(10) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (flid), + UNIQUE KEY pid (pid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_connect_tthreadlog; +CREATE TABLE pre_connect_tthreadlog ( + twid char(16) NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + conopenid char(32) NOT NULL, + pagetime int(10) unsigned DEFAULT '0', + lasttwid char(16) DEFAULT NULL, + nexttime int(10) unsigned DEFAULT '0', + updatetime int(10) unsigned DEFAULT '0', + dateline int(10) unsigned DEFAULT '0', + PRIMARY KEY (twid), + KEY nexttime (tid,nexttime), + KEY updatetime (tid,updatetime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_access; +CREATE TABLE pre_forum_access ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + allowview tinyint(1) NOT NULL DEFAULT '0', + allowpost tinyint(1) NOT NULL DEFAULT '0', + allowreply tinyint(1) NOT NULL DEFAULT '0', + allowgetattach tinyint(1) NOT NULL DEFAULT '0', + allowgetimage tinyint(1) NOT NULL DEFAULT '0', + allowpostattach tinyint(1) NOT NULL DEFAULT '0', + allowpostimage tinyint(1) NOT NULL DEFAULT '0', + adminuser mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,fid), + KEY listorder (fid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_activity; +CREATE TABLE pre_forum_activity ( + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + aid int(10) unsigned NOT NULL DEFAULT '0', + cost mediumint(8) unsigned NOT NULL DEFAULT '0', + starttimefrom int(10) unsigned NOT NULL DEFAULT '0', + starttimeto int(10) unsigned NOT NULL DEFAULT '0', + place varchar(255) NOT NULL DEFAULT '', + class varchar(255) NOT NULL DEFAULT '', + gender tinyint(1) NOT NULL DEFAULT '0', + number smallint(5) unsigned NOT NULL DEFAULT '0', + applynumber smallint(5) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + ufield text NOT NULL, + credit smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid), + KEY uid (uid,starttimefrom), + KEY starttimefrom (starttimefrom), + KEY expiration (expiration), + KEY applynumber (applynumber) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_activityapply; +CREATE TABLE pre_forum_activityapply ( + applyid int(10) unsigned NOT NULL AUTO_INCREMENT, + tid int(10) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + message varchar(255) NOT NULL DEFAULT '', + verified tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + payment mediumint(8) NOT NULL DEFAULT '0', + ufielddata text NOT NULL, + PRIMARY KEY (applyid), + KEY uid (uid), + KEY tid (tid), + KEY dateline (tid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_announcement; +CREATE TABLE pre_forum_announcement ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + author varchar(15) NOT NULL DEFAULT '', + `subject` varchar(255) NOT NULL DEFAULT '', + `type` tinyint(1) NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + starttime int(10) unsigned NOT NULL DEFAULT '0', + endtime int(10) unsigned NOT NULL DEFAULT '0', + message text NOT NULL, + `groups` text NOT NULL, + PRIMARY KEY (id), + KEY timespan (starttime,endtime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment; +CREATE TABLE pre_forum_attachment ( + aid int(10) unsigned NOT NULL AUTO_INCREMENT, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + tableid tinyint(3) unsigned NOT NULL DEFAULT '0', + downloads mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_0; +CREATE TABLE pre_forum_attachment_0 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_1; +CREATE TABLE pre_forum_attachment_1 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_2; +CREATE TABLE pre_forum_attachment_2 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_3; +CREATE TABLE pre_forum_attachment_3 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_4; +CREATE TABLE pre_forum_attachment_4 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_5; +CREATE TABLE pre_forum_attachment_5 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_6; +CREATE TABLE pre_forum_attachment_6 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_7; +CREATE TABLE pre_forum_attachment_7 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_8; +CREATE TABLE pre_forum_attachment_8 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_9; +CREATE TABLE pre_forum_attachment_9 ( + aid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + picid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY tid (tid), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_exif; +CREATE TABLE pre_forum_attachment_exif ( + aid int(10) unsigned NOT NULL, + exif text NOT NULL, + PRIMARY KEY (aid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachment_unused; +CREATE TABLE pre_forum_attachment_unused ( + aid int(10) unsigned NOT NULL, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_attachtype; +CREATE TABLE pre_forum_attachtype ( + id smallint(6) unsigned NOT NULL AUTO_INCREMENT, + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + extension char(12) NOT NULL DEFAULT '', + maxsize int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY fid (fid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_bbcode; +CREATE TABLE pre_forum_bbcode ( + id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + available tinyint(1) NOT NULL DEFAULT '0', + tag varchar(100) NOT NULL DEFAULT '', + icon varchar(255) NOT NULL, + replacement text NOT NULL, + example varchar(255) NOT NULL DEFAULT '', + explanation text NOT NULL, + params tinyint(3) unsigned NOT NULL DEFAULT '1', + prompt text NOT NULL, + nest tinyint(3) unsigned NOT NULL DEFAULT '1', + displayorder tinyint(3) NOT NULL DEFAULT '0', + perm text NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_collection; +CREATE TABLE pre_forum_collection ( + ctid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + `name` varchar(50) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + follownum mediumint(8) unsigned NOT NULL DEFAULT '0', + threadnum mediumint(8) unsigned NOT NULL DEFAULT '0', + commentnum mediumint(8) unsigned NOT NULL DEFAULT '0', + `desc` varchar(255) NOT NULL DEFAULT '', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + rate float NOT NULL DEFAULT '0', + ratenum mediumint(8) unsigned NOT NULL DEFAULT '0', + lastpost mediumint(8) unsigned NOT NULL DEFAULT '0', + lastsubject varchar(255) NOT NULL DEFAULT '', + lastposttime int(10) unsigned NOT NULL DEFAULT '0', + lastposter varchar(15) NOT NULL DEFAULT '', + lastvisit int(10) unsigned NOT NULL DEFAULT '0', + keyword varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (ctid), + KEY dateline (dateline), + KEY hotcollection (threadnum,lastupdate), + KEY follownum (follownum), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_collectioncomment; +CREATE TABLE pre_forum_collectioncomment ( + cid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + ctid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + message text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + useip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + rate float NOT NULL DEFAULT '0', + PRIMARY KEY (cid), + KEY ctid (ctid,dateline), + KEY userrate (ctid,uid,rate) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_collectionfollow; +CREATE TABLE pre_forum_collectionfollow ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL DEFAULT '', + ctid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + lastvisit int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,ctid), + KEY ctid (ctid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_collectioninvite; +CREATE TABLE pre_forum_collectioninvite ( + ctid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (ctid,uid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_collectionrelated; +CREATE TABLE pre_forum_collectionrelated ( + tid mediumint(8) unsigned NOT NULL DEFAULT '0', + collection text NOT NULL, + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_collectionteamworker; +CREATE TABLE pre_forum_collectionteamworker ( + ctid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(50) NOT NULL DEFAULT '', + username varchar(15) NOT NULL DEFAULT '', + lastvisit int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (ctid,uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_collectionthread; +CREATE TABLE pre_forum_collectionthread ( + ctid mediumint(8) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + reason varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (ctid,tid), + KEY ctid (ctid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_creditslog; +CREATE TABLE pre_forum_creditslog ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fromto char(15) NOT NULL DEFAULT '', + sendcredits tinyint(1) NOT NULL DEFAULT '0', + receivecredits tinyint(1) NOT NULL DEFAULT '0', + send int(10) unsigned NOT NULL DEFAULT '0', + receive int(10) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + operation char(3) NOT NULL DEFAULT '', + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_debate; +CREATE TABLE pre_forum_debate ( + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + starttime int(10) unsigned NOT NULL DEFAULT '0', + endtime int(10) unsigned NOT NULL DEFAULT '0', + affirmdebaters mediumint(8) unsigned NOT NULL DEFAULT '0', + negadebaters mediumint(8) unsigned NOT NULL DEFAULT '0', + affirmvotes mediumint(8) unsigned NOT NULL DEFAULT '0', + negavotes mediumint(8) unsigned NOT NULL DEFAULT '0', + umpire varchar(15) NOT NULL DEFAULT '', + winner tinyint(1) NOT NULL DEFAULT '0', + bestdebater varchar(50) NOT NULL DEFAULT '', + affirmpoint text NOT NULL, + negapoint text NOT NULL, + umpirepoint text NOT NULL, + affirmvoterids text NOT NULL, + negavoterids text NOT NULL, + affirmreplies mediumint(8) unsigned NOT NULL, + negareplies mediumint(8) unsigned NOT NULL, + PRIMARY KEY (tid), + KEY uid (uid,starttime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_debatepost; +CREATE TABLE pre_forum_debatepost ( + pid int(10) unsigned NOT NULL DEFAULT '0', + stand tinyint(1) NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + voters mediumint(10) unsigned NOT NULL DEFAULT '0', + voterids text NOT NULL, + PRIMARY KEY (pid), + KEY pid (pid,stand), + KEY tid (tid,uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_faq; +CREATE TABLE pre_forum_faq ( + id smallint(6) NOT NULL AUTO_INCREMENT, + fpid smallint(6) unsigned NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + identifier varchar(20) NOT NULL, + keyword varchar(50) NOT NULL, + title varchar(50) NOT NULL, + message text NOT NULL, + PRIMARY KEY (id), + KEY displayplay (displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_filter_post; +CREATE TABLE pre_forum_filter_post ( + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + postlength int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid,pid), + KEY tid (tid,postlength) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_forum; +CREATE TABLE pre_forum_forum ( + fid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + fup mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` enum('group','forum','sub') NOT NULL DEFAULT 'forum', + `name` char(50) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT '0', + displayorder smallint(6) NOT NULL DEFAULT '0', + styleid smallint(6) unsigned NOT NULL DEFAULT '0', + threads mediumint(8) unsigned NOT NULL DEFAULT '0', + posts mediumint(8) unsigned NOT NULL DEFAULT '0', + todayposts mediumint(8) unsigned NOT NULL DEFAULT '0', + yesterdayposts mediumint(8) unsigned NOT NULL DEFAULT '0', + `rank` smallint(6) unsigned NOT NULL DEFAULT '0', + oldrank smallint(6) unsigned NOT NULL DEFAULT '0', + lastpost char(110) NOT NULL DEFAULT '', + domain char(15) NOT NULL DEFAULT '', + allowsmilies tinyint(1) NOT NULL DEFAULT '0', + allowhtml tinyint(1) NOT NULL DEFAULT '0', + allowbbcode tinyint(1) NOT NULL DEFAULT '0', + allowimgcode tinyint(1) NOT NULL DEFAULT '0', + allowmediacode tinyint(1) NOT NULL DEFAULT '0', + allowanonymous tinyint(1) NOT NULL DEFAULT '0', + allowpostspecial smallint(6) unsigned NOT NULL DEFAULT '0', + allowspecialonly tinyint(1) NOT NULL DEFAULT '0', + allowappend tinyint(1) NOT NULL DEFAULT '0', + alloweditrules tinyint(1) NOT NULL DEFAULT '0', + allowfeed tinyint(1) NOT NULL DEFAULT '1', + allowside tinyint(1) NOT NULL DEFAULT '0', + recyclebin tinyint(1) NOT NULL DEFAULT '0', + modnewposts tinyint(1) NOT NULL DEFAULT '0', + jammer tinyint(1) NOT NULL DEFAULT '0', + disablewatermark tinyint(1) NOT NULL DEFAULT '0', + inheritedmod tinyint(1) NOT NULL DEFAULT '0', + autoclose smallint(6) NOT NULL DEFAULT '0', + forumcolumns tinyint(3) unsigned NOT NULL DEFAULT '0', + catforumcolumns tinyint(3) unsigned NOT NULL DEFAULT '0', + threadcaches tinyint(1) NOT NULL DEFAULT '0', + alloweditpost tinyint(1) NOT NULL DEFAULT '1', + `simple` smallint(6) NOT NULL DEFAULT '0', + modworks tinyint(1) NOT NULL DEFAULT '0', + allowglobalstick tinyint(1) NOT NULL DEFAULT '1', + `level` smallint(6) NOT NULL DEFAULT '0', + commoncredits int(10) unsigned NOT NULL DEFAULT '0', + archive tinyint(1) NOT NULL DEFAULT '0', + recommend smallint(6) unsigned NOT NULL DEFAULT '0', + favtimes mediumint(8) unsigned NOT NULL DEFAULT '0', + sharetimes mediumint(8) unsigned NOT NULL DEFAULT '0', + disablethumb tinyint(1) NOT NULL DEFAULT '0', + disablecollect tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (fid), + KEY forum (`status`,`type`,displayorder), + KEY fup_type (fup,`type`,displayorder), + KEY fup (fup) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_forum_threadtable; +CREATE TABLE pre_forum_forum_threadtable ( + fid smallint(6) unsigned NOT NULL, + threadtableid smallint(6) unsigned NOT NULL, + threads int(11) unsigned NOT NULL DEFAULT '0', + posts int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (fid,threadtableid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_forumfield; +CREATE TABLE pre_forum_forumfield ( + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + description text NOT NULL, + `password` varchar(12) NOT NULL DEFAULT '', + icon varchar(255) NOT NULL DEFAULT '', + redirect varchar(255) NOT NULL DEFAULT '', + attachextensions varchar(255) NOT NULL DEFAULT '', + creditspolicy mediumtext NOT NULL, + formulaperm text NOT NULL, + moderators text NOT NULL, + rules text NOT NULL, + threadtypes text NOT NULL, + threadsorts text NOT NULL, + viewperm text NOT NULL, + postperm text NOT NULL, + replyperm text NOT NULL, + getattachperm text NOT NULL, + postattachperm text NOT NULL, + postimageperm text NOT NULL, + spviewperm text NOT NULL, + seotitle text NOT NULL, + keywords text NOT NULL, + seodescription text NOT NULL, + supe_pushsetting text NOT NULL, + modrecommend text NOT NULL, + threadplugin text NOT NULL, + replybg text NOT NULL, + extra text NOT NULL, + jointype tinyint(1) NOT NULL DEFAULT '0', + gviewperm tinyint(1) NOT NULL DEFAULT '0', + membernum smallint(6) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + activity int(10) unsigned NOT NULL DEFAULT '0', + founderuid mediumint(8) unsigned NOT NULL DEFAULT '0', + foundername varchar(255) NOT NULL DEFAULT '', + banner varchar(255) NOT NULL DEFAULT '', + groupnum smallint(6) unsigned NOT NULL DEFAULT '0', + commentitem text NOT NULL, + relatedgroup text NOT NULL, + picstyle tinyint(1) NOT NULL DEFAULT '0', + widthauto tinyint(1) NOT NULL DEFAULT '0', + noantitheft tinyint(1) NOT NULL DEFAULT '0', + noforumhidewater tinyint(1) NOT NULL DEFAULT '0', + noforumrecommend tinyint(1) NOT NULL DEFAULT '0', + livetid int(10) unsigned NOT NULL DEFAULT '0', + price mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (fid), + KEY membernum (membernum), + KEY dateline (dateline), + KEY lastupdate (lastupdate), + KEY activity (activity) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_forumrecommend; +CREATE TABLE pre_forum_forumrecommend ( + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL, + typeid smallint(6) NOT NULL, + displayorder tinyint(1) NOT NULL, + `subject` varchar(255) NOT NULL, + author char(15) NOT NULL, + authorid mediumint(8) NOT NULL, + moderatorid mediumint(8) NOT NULL, + expiration int(10) unsigned NOT NULL, + position tinyint(1) NOT NULL DEFAULT '0', + highlight tinyint(1) NOT NULL DEFAULT '0', + aid int(10) unsigned NOT NULL DEFAULT '0', + filename char(100) NOT NULL DEFAULT '', + PRIMARY KEY (tid), + KEY displayorder (fid,displayorder), + KEY position (position) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_groupcreditslog; +CREATE TABLE pre_forum_groupcreditslog ( + fid mediumint(8) unsigned NOT NULL, + uid mediumint(8) unsigned NOT NULL, + logdate int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (fid,uid,logdate) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_groupfield; +CREATE TABLE pre_forum_groupfield ( + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + privacy tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + `type` varchar(100) NOT NULL, + `data` text NOT NULL, + UNIQUE KEY `types` (fid,`type`), + KEY fid (fid), + KEY `type` (`type`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_groupinvite; +CREATE TABLE pre_forum_groupinvite ( + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + inviteuid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY ids (fid,inviteuid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_grouplevel; +CREATE TABLE pre_forum_grouplevel ( + levelid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `type` enum('special','default') NOT NULL DEFAULT 'default', + leveltitle varchar(255) NOT NULL DEFAULT '', + creditshigher int(10) NOT NULL DEFAULT '0', + creditslower int(10) NOT NULL DEFAULT '0', + icon varchar(255) NOT NULL DEFAULT '', + creditspolicy text NOT NULL, + postpolicy text NOT NULL, + specialswitch text NOT NULL, + PRIMARY KEY (levelid), + KEY creditsrange (creditshigher,creditslower) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_groupuser; +CREATE TABLE pre_forum_groupuser ( + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL, + `level` tinyint(3) unsigned NOT NULL DEFAULT '0', + threads mediumint(8) unsigned NOT NULL DEFAULT '0', + replies mediumint(8) unsigned NOT NULL DEFAULT '0', + joindateline int(10) unsigned NOT NULL DEFAULT '0', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + privacy tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (fid,uid), + KEY uid_lastupdate (uid,lastupdate), + KEY userlist (fid,`level`,lastupdate) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_hotreply_member; +CREATE TABLE pre_forum_hotreply_member ( + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + attitude tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (pid,uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_hotreply_number; +CREATE TABLE pre_forum_hotreply_number ( + pid int(10) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + support smallint(6) unsigned NOT NULL DEFAULT '0', + `against` smallint(6) unsigned NOT NULL DEFAULT '0', + total mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (pid), + KEY tid (tid,total) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_imagetype; +CREATE TABLE pre_forum_imagetype ( + typeid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + available tinyint(1) NOT NULL DEFAULT '0', + `name` char(20) NOT NULL, + `type` enum('smiley','icon','avatar') NOT NULL DEFAULT 'smiley', + displayorder tinyint(3) NOT NULL DEFAULT '0', + `directory` char(100) NOT NULL, + PRIMARY KEY (typeid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_medal; +CREATE TABLE pre_forum_medal ( + medalid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL DEFAULT '', + available tinyint(1) NOT NULL DEFAULT '0', + image varchar(255) NOT NULL DEFAULT '', + `type` tinyint(1) NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + description varchar(255) NOT NULL, + expiration smallint(6) unsigned NOT NULL DEFAULT '0', + permission mediumtext NOT NULL, + credit tinyint(3) unsigned NOT NULL DEFAULT '0', + price mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (medalid), + KEY displayorder (displayorder), + KEY available (available,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_medallog; +CREATE TABLE pre_forum_medallog ( + id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + medalid smallint(6) unsigned NOT NULL DEFAULT '0', + `type` tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `type` (`type`), + KEY `status` (`status`,expiration), + KEY uid (uid,medalid,`type`), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_memberrecommend; +CREATE TABLE pre_forum_memberrecommend ( + tid int(10) unsigned NOT NULL, + recommenduid mediumint(8) unsigned NOT NULL, + dateline int(10) unsigned NOT NULL, + KEY tid (tid), + KEY uid (recommenduid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_moderator; +CREATE TABLE pre_forum_moderator ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + inherited tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (uid,fid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_modwork; +CREATE TABLE pre_forum_modwork ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + modaction char(3) NOT NULL DEFAULT '', + dateline date NOT NULL DEFAULT '2006-01-01', + count smallint(6) unsigned NOT NULL DEFAULT '0', + posts smallint(6) unsigned NOT NULL DEFAULT '0', + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_newthread; +CREATE TABLE pre_forum_newthread ( + tid int(10) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid), + KEY fid (fid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_onlinelist; +CREATE TABLE pre_forum_onlinelist ( + groupid smallint(6) unsigned NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + title varchar(30) NOT NULL DEFAULT '', + url varchar(30) NOT NULL DEFAULT '' +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_order; +CREATE TABLE pre_forum_order ( + orderid char(32) NOT NULL DEFAULT '', + `status` char(3) NOT NULL DEFAULT '', + buyer char(50) NOT NULL DEFAULT '', + `admin` char(15) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + amount int(10) unsigned NOT NULL DEFAULT '0', + price float(7,2) unsigned NOT NULL DEFAULT '0.00', + submitdate int(10) unsigned NOT NULL DEFAULT '0', + confirmdate int(10) unsigned NOT NULL DEFAULT '0', + email varchar(255) NOT NULL DEFAULT '', + ip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY orderid (orderid), + KEY submitdate (submitdate), + KEY uid (uid,submitdate) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_poll; +CREATE TABLE pre_forum_poll ( + tid int(10) unsigned NOT NULL DEFAULT '0', + overt tinyint(1) NOT NULL DEFAULT '0', + multiple tinyint(1) NOT NULL DEFAULT '0', + visible tinyint(1) NOT NULL DEFAULT '0', + maxchoices tinyint(3) unsigned NOT NULL DEFAULT '0', + isimage tinyint(1) NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + pollpreview varchar(255) NOT NULL DEFAULT '', + voters mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_polloption; +CREATE TABLE pre_forum_polloption ( + polloptionid int(10) unsigned NOT NULL AUTO_INCREMENT, + tid int(10) unsigned NOT NULL DEFAULT '0', + votes mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + polloption varchar(80) NOT NULL DEFAULT '', + voterids mediumtext NOT NULL, + PRIMARY KEY (polloptionid), + KEY tid (tid,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_polloption_image; +CREATE TABLE pre_forum_polloption_image ( + aid int(10) unsigned NOT NULL AUTO_INCREMENT, + poid int(10) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + width mediumint(8) unsigned NOT NULL DEFAULT '0', + height mediumint(8) unsigned NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (aid), + KEY poid (poid), + KEY tid (tid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_pollvoter; +CREATE TABLE pre_forum_pollvoter ( + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + `options` text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + KEY tid (tid), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_post; +CREATE TABLE pre_forum_post ( + pid int(10) unsigned NOT NULL, + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + repid int(10) unsigned NOT NULL DEFAULT '0', + `first` tinyint(1) NOT NULL DEFAULT '0', + author varchar(15) NOT NULL DEFAULT '', + authorid mediumint(8) unsigned NOT NULL DEFAULT '0', + `subject` varchar(255) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + updateuid mediumint(8) unsigned NOT NULL DEFAULT '0', + premsg text NOT NULL, + message mediumtext NOT NULL, + useip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + invisible tinyint(1) NOT NULL DEFAULT '0', + anonymous tinyint(1) NOT NULL DEFAULT '0', + usesig tinyint(1) NOT NULL DEFAULT '0', + htmlon tinyint(1) NOT NULL DEFAULT '0', + bbcodeoff tinyint(1) NOT NULL DEFAULT '0', + smileyoff tinyint(1) NOT NULL DEFAULT '0', + parseurloff tinyint(1) NOT NULL DEFAULT '0', + attachment tinyint(1) NOT NULL DEFAULT '0', + rate smallint(6) NOT NULL DEFAULT '0', + ratetimes tinyint(3) unsigned NOT NULL DEFAULT '0', + `status` int(10) NOT NULL DEFAULT '0', + tags varchar(255) NOT NULL DEFAULT '0', + `comment` tinyint(1) NOT NULL DEFAULT '0', + replycredit int(10) NOT NULL DEFAULT '0', + position int(10) unsigned NOT NULL, + PRIMARY KEY (tid,position), + UNIQUE KEY pid (pid), + KEY fid (fid), + KEY authorid (authorid,invisible), + KEY dateline (dateline), + KEY invisible (invisible), + KEY displayorder (tid,invisible,dateline), + KEY `first` (tid,`first`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_post_location; +CREATE TABLE pre_forum_post_location ( + pid int(10) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned DEFAULT '0', + uid mediumint(8) unsigned DEFAULT '0', + mapx varchar(255) NOT NULL, + mapy varchar(255) NOT NULL, + location varchar(255) NOT NULL, + PRIMARY KEY (pid), + KEY tid (tid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_post_moderate; +CREATE TABLE pre_forum_post_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `status` (`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_post_tableid; +CREATE TABLE pre_forum_post_tableid ( + pid int(10) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (pid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_postcache; +CREATE TABLE pre_forum_postcache ( + pid int(10) unsigned NOT NULL, + `comment` mediumtext NOT NULL, + rate mediumtext NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (pid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_postcomment; +CREATE TABLE pre_forum_postcomment ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + author varchar(15) NOT NULL DEFAULT '', + authorid mediumint(8) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + `comment` varchar(255) NOT NULL DEFAULT '', + score tinyint(1) NOT NULL DEFAULT '0', + useip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + rpid int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY tid (tid), + KEY authorid (authorid), + KEY score (score), + KEY rpid (rpid), + KEY pid (pid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_post_history; +CREATE TABLE pre_forum_post_history ( + id int(10) unsigned NOT NULL, + pid int(10) unsigned NOT NULL, + dateline int(10) unsigned NOT NULL, + `subject` varchar(255) NOT NULL DEFAULT '', + message mediumtext NOT NULL, + PRIMARY KEY (id), + KEY pid (pid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_poststick; +CREATE TABLE pre_forum_poststick ( + tid int(10) unsigned NOT NULL, + pid int(10) unsigned NOT NULL, + position int(10) unsigned NOT NULL, + dateline int(10) unsigned NOT NULL, + PRIMARY KEY (tid,pid), + KEY dateline (tid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_promotion; +CREATE TABLE pre_forum_promotion ( + ip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL DEFAULT '', + PRIMARY KEY (ip) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_ratelog; +CREATE TABLE pre_forum_ratelog ( + pid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL DEFAULT '', + extcredits tinyint(3) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + score smallint(6) NOT NULL DEFAULT '0', + reason char(40) NOT NULL DEFAULT '', + KEY pid (pid,dateline), + KEY dateline (dateline), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_relatedthread; +CREATE TABLE pre_forum_relatedthread ( + tid int(10) unsigned NOT NULL DEFAULT '0', + `type` enum('general','trade') NOT NULL DEFAULT 'general', + expiration int(10) NOT NULL DEFAULT '0', + keywords varchar(255) NOT NULL DEFAULT '', + relatedthreads text NOT NULL, + PRIMARY KEY (tid,`type`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_replycredit; +CREATE TABLE pre_forum_replycredit ( + tid int(10) unsigned NOT NULL, + extcredits int(10) unsigned NOT NULL DEFAULT '0', + extcreditstype tinyint(1) NOT NULL DEFAULT '0', + times int(10) unsigned NOT NULL DEFAULT '0', + membertimes int(10) unsigned NOT NULL DEFAULT '0', + random tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_rsscache; +CREATE TABLE pre_forum_rsscache ( + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + forum char(50) NOT NULL DEFAULT '', + author char(15) NOT NULL DEFAULT '', + `subject` varchar(255) NOT NULL DEFAULT '', + description char(255) NOT NULL DEFAULT '', + guidetype char(10) NOT NULL DEFAULT '', + UNIQUE KEY tid (tid), + KEY fid (fid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_sofa; +CREATE TABLE pre_forum_sofa ( + tid int(10) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid), + KEY ftid (fid,tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_spacecache; +CREATE TABLE pre_forum_spacecache ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + variable varchar(20) NOT NULL, + `value` text NOT NULL, + expiration int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,variable) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_statlog; +CREATE TABLE pre_forum_statlog ( + logdate date NOT NULL, + fid mediumint(8) unsigned NOT NULL, + `type` smallint(5) unsigned NOT NULL DEFAULT '0', + `value` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (logdate,fid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_thread; +CREATE TABLE pre_forum_thread ( + tid int(10) unsigned NOT NULL AUTO_INCREMENT, + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + posttableid smallint(6) unsigned NOT NULL DEFAULT '0', + typeid smallint(6) unsigned NOT NULL DEFAULT '0', + sortid smallint(6) unsigned NOT NULL DEFAULT '0', + readperm tinyint(3) unsigned NOT NULL DEFAULT '0', + price smallint(6) NOT NULL DEFAULT '0', + author char(15) NOT NULL DEFAULT '', + authorid mediumint(8) unsigned NOT NULL DEFAULT '0', + `subject` varchar(255) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + lastpost int(10) unsigned NOT NULL DEFAULT '0', + lastposter char(15) NOT NULL DEFAULT '', + views int(10) unsigned NOT NULL DEFAULT '0', + replies mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder tinyint(1) NOT NULL DEFAULT '0', + highlight tinyint(1) NOT NULL DEFAULT '0', + digest tinyint(1) NOT NULL DEFAULT '0', + rate tinyint(1) NOT NULL DEFAULT '0', + special tinyint(1) NOT NULL DEFAULT '0', + attachment tinyint(1) NOT NULL DEFAULT '0', + moderated tinyint(1) NOT NULL DEFAULT '0', + closed mediumint(8) unsigned NOT NULL DEFAULT '0', + stickreply tinyint(1) NOT NULL DEFAULT '0', + recommends smallint(6) NOT NULL DEFAULT '0', + recommend_add smallint(6) NOT NULL DEFAULT '0', + recommend_sub smallint(6) NOT NULL DEFAULT '0', + heats int(10) unsigned NOT NULL DEFAULT '0', + `status` smallint(6) unsigned NOT NULL DEFAULT '0', + isgroup tinyint(1) NOT NULL DEFAULT '0', + favtimes mediumint(8) NOT NULL DEFAULT '0', + sharetimes mediumint(8) NOT NULL DEFAULT '0', + stamp tinyint(3) NOT NULL DEFAULT '-1', + icon tinyint(3) NOT NULL DEFAULT '-1', + pushedaid mediumint(8) NOT NULL DEFAULT '0', + cover smallint(6) NOT NULL DEFAULT '0', + replycredit int(10) NOT NULL DEFAULT '0', + relatebytag char(255) NOT NULL DEFAULT '0', + maxposition int(10) unsigned NOT NULL DEFAULT '0', + bgcolor char(8) NOT NULL DEFAULT '', + comments int(10) unsigned NOT NULL DEFAULT '0', + hidden smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid), + KEY digest (digest), + KEY sortid (sortid), + KEY displayorder (fid,displayorder,lastpost), + KEY typeid (fid,typeid,displayorder,lastpost), + KEY recommends (recommends), + KEY heats (heats), + KEY authorid (authorid), + KEY isgroup (isgroup,lastpost), + KEY special (special) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_thread_moderate; +CREATE TABLE pre_forum_thread_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `status` (`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadaddviews; +CREATE TABLE pre_forum_threadaddviews ( + tid int(10) unsigned NOT NULL DEFAULT '0', + addviews int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadcalendar; +CREATE TABLE pre_forum_threadcalendar ( + cid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + hotnum int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (cid), + KEY fid (fid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadclass; +CREATE TABLE pre_forum_threadclass ( + typeid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + fid mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + displayorder mediumint(9) NOT NULL, + icon varchar(255) NOT NULL, + moderators tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (typeid), + KEY fid (fid,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadclosed; +CREATE TABLE pre_forum_threadclosed ( + tid int(10) unsigned NOT NULL DEFAULT '0', + redirect mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threaddisablepos; +CREATE TABLE pre_forum_threaddisablepos ( + tid int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadhidelog; +CREATE TABLE pre_forum_threadhidelog ( + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY uid (tid,uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadhot; +CREATE TABLE pre_forum_threadhot ( + cid mediumint(8) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (cid,tid), + KEY fid (fid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadimage; +CREATE TABLE pre_forum_threadimage ( + tid int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + remote tinyint(1) NOT NULL DEFAULT '0', + KEY tid (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadmod; +CREATE TABLE pre_forum_threadmod ( + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + `action` char(5) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT '0', + magicid smallint(6) unsigned NOT NULL, + stamp tinyint(3) NOT NULL, + reason char(40) NOT NULL DEFAULT '', + KEY tid (tid,dateline), + KEY expiration (expiration,`status`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadpartake; +CREATE TABLE pre_forum_threadpartake ( + tid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + KEY tid (tid,uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadpreview; +CREATE TABLE pre_forum_threadpreview ( + tid int(10) unsigned NOT NULL DEFAULT '0', + `relay` int(10) unsigned NOT NULL DEFAULT '0', + content text NOT NULL, + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadprofile; +CREATE TABLE pre_forum_threadprofile ( + id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(100) NOT NULL DEFAULT '', + template text NOT NULL, + `global` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `global` (`global`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadprofile_group; +CREATE TABLE pre_forum_threadprofile_group ( + gid mediumint(8) NOT NULL, + tpid mediumint(8) unsigned NOT NULL, + PRIMARY KEY (gid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadrush; +CREATE TABLE pre_forum_threadrush ( + tid int(10) unsigned NOT NULL DEFAULT '0', + stopfloor mediumint(8) unsigned NOT NULL DEFAULT '0', + starttimefrom int(10) unsigned NOT NULL DEFAULT '0', + starttimeto int(10) unsigned NOT NULL DEFAULT '0', + rewardfloor text NOT NULL, + creditlimit int(10) NOT NULL DEFAULT '-996', + replylimit smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (tid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_threadtype; +CREATE TABLE pre_forum_threadtype ( + typeid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder smallint(6) NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL DEFAULT '', + description varchar(255) NOT NULL DEFAULT '', + icon varchar(255) NOT NULL DEFAULT '', + special smallint(6) NOT NULL DEFAULT '0', + modelid smallint(6) unsigned NOT NULL DEFAULT '0', + expiration tinyint(1) NOT NULL DEFAULT '0', + template text NOT NULL, + stemplate text NOT NULL, + ptemplate text NOT NULL, + btemplate text NOT NULL, + PRIMARY KEY (typeid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_trade; +CREATE TABLE pre_forum_trade ( + tid int(10) unsigned NOT NULL, + pid int(10) unsigned NOT NULL, + typeid smallint(6) unsigned NOT NULL, + sellerid mediumint(8) unsigned NOT NULL, + seller char(15) NOT NULL, + account char(50) NOT NULL, + tenpayaccount char(20) NOT NULL DEFAULT '', + `subject` char(100) NOT NULL, + price decimal(8,2) NOT NULL, + amount smallint(6) unsigned NOT NULL DEFAULT '1', + quality tinyint(3) unsigned NOT NULL DEFAULT '0', + locus char(20) NOT NULL, + transport tinyint(1) NOT NULL DEFAULT '0', + ordinaryfee smallint(4) unsigned NOT NULL DEFAULT '0', + expressfee smallint(4) unsigned NOT NULL DEFAULT '0', + emsfee smallint(4) unsigned NOT NULL DEFAULT '0', + itemtype tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + lastbuyer char(15) NOT NULL, + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + totalitems smallint(5) unsigned NOT NULL DEFAULT '0', + tradesum decimal(8,2) NOT NULL DEFAULT '0.00', + closed tinyint(1) NOT NULL DEFAULT '0', + aid int(10) unsigned NOT NULL, + displayorder tinyint(1) NOT NULL, + costprice decimal(8,2) NOT NULL, + credit int(10) unsigned NOT NULL DEFAULT '0', + costcredit int(10) unsigned NOT NULL DEFAULT '0', + credittradesum int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (tid,pid), + KEY pid (pid), + KEY sellerid (sellerid), + KEY totalitems (totalitems), + KEY tradesum (tradesum), + KEY displayorder (tid,displayorder), + KEY sellertrades (sellerid,tradesum,totalitems), + KEY typeid (typeid), + KEY credittradesum (credittradesum), + KEY expiration (expiration) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_tradecomment; +CREATE TABLE pre_forum_tradecomment ( + id mediumint(8) NOT NULL AUTO_INCREMENT, + orderid char(32) NOT NULL, + pid int(10) unsigned NOT NULL, + `type` tinyint(1) NOT NULL, + raterid mediumint(8) unsigned NOT NULL, + rater char(15) NOT NULL, + rateeid mediumint(8) unsigned NOT NULL, + ratee char(15) NOT NULL, + message char(200) NOT NULL, + explanation char(200) NOT NULL, + score tinyint(1) NOT NULL, + dateline int(10) unsigned NOT NULL, + PRIMARY KEY (id), + KEY raterid (raterid,`type`,dateline), + KEY rateeid (rateeid,`type`,dateline), + KEY orderid (orderid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_tradelog; +CREATE TABLE pre_forum_tradelog ( + tid int(10) unsigned NOT NULL, + pid int(10) unsigned NOT NULL, + orderid varchar(32) NOT NULL, + tradeno varchar(32) NOT NULL, + paytype tinyint(3) unsigned NOT NULL DEFAULT '0', + `subject` varchar(100) NOT NULL, + price decimal(8,2) NOT NULL DEFAULT '0.00', + quality tinyint(3) unsigned NOT NULL DEFAULT '0', + itemtype tinyint(1) NOT NULL DEFAULT '0', + number smallint(5) unsigned NOT NULL DEFAULT '0', + tax decimal(6,2) unsigned NOT NULL DEFAULT '0.00', + locus varchar(100) NOT NULL, + sellerid mediumint(8) unsigned NOT NULL, + seller varchar(15) NOT NULL, + selleraccount varchar(50) NOT NULL, + tenpayaccount varchar(20) NOT NULL DEFAULT '0', + buyerid mediumint(8) unsigned NOT NULL, + buyer varchar(15) NOT NULL, + buyercontact varchar(50) NOT NULL, + buyercredits smallint(5) unsigned NOT NULL DEFAULT '0', + buyermsg varchar(200) DEFAULT NULL, + `status` tinyint(1) NOT NULL DEFAULT '0', + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + offline tinyint(1) NOT NULL DEFAULT '0', + buyername varchar(50) NOT NULL, + buyerzip varchar(10) NOT NULL, + buyerphone varchar(20) NOT NULL, + buyermobile varchar(20) NOT NULL, + transport tinyint(1) NOT NULL DEFAULT '0', + transportfee smallint(6) unsigned NOT NULL DEFAULT '0', + baseprice decimal(8,2) NOT NULL, + discount tinyint(1) NOT NULL DEFAULT '0', + ratestatus tinyint(1) NOT NULL DEFAULT '0', + message text NOT NULL, + credit int(10) unsigned NOT NULL DEFAULT '0', + basecredit int(10) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY orderid (orderid), + KEY sellerid (sellerid), + KEY buyerid (buyerid), + KEY `status` (`status`), + KEY buyerlog (buyerid,`status`,lastupdate), + KEY sellerlog (sellerid,`status`,lastupdate), + KEY tid (tid,pid), + KEY pid (pid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_typeoption; +CREATE TABLE pre_forum_typeoption ( + optionid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + classid smallint(6) unsigned NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + expiration tinyint(1) NOT NULL, + protect varchar(255) NOT NULL, + title varchar(255) NOT NULL DEFAULT '', + description varchar(255) NOT NULL DEFAULT '', + identifier varchar(255) NOT NULL DEFAULT '', + `type` varchar(255) NOT NULL DEFAULT '', + unit varchar(255) NOT NULL, + rules mediumtext NOT NULL, + permprompt mediumtext NOT NULL, + PRIMARY KEY (optionid), + KEY classid (classid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_typeoptionvar; +CREATE TABLE pre_forum_typeoptionvar ( + sortid smallint(6) unsigned NOT NULL DEFAULT '0', + tid int(10) unsigned NOT NULL DEFAULT '0', + fid mediumint(8) unsigned NOT NULL DEFAULT '0', + optionid smallint(6) unsigned NOT NULL DEFAULT '0', + expiration int(10) unsigned NOT NULL DEFAULT '0', + `value` mediumtext NOT NULL, + KEY sortid (sortid), + KEY tid (tid), + KEY fid (fid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_typevar; +CREATE TABLE pre_forum_typevar ( + sortid smallint(6) NOT NULL DEFAULT '0', + optionid smallint(6) NOT NULL DEFAULT '0', + available tinyint(1) NOT NULL DEFAULT '0', + required tinyint(1) NOT NULL DEFAULT '0', + unchangeable tinyint(1) NOT NULL DEFAULT '0', + search tinyint(1) NOT NULL DEFAULT '0', + displayorder tinyint(3) NOT NULL DEFAULT '0', + subjectshow tinyint(1) NOT NULL DEFAULT '0', + UNIQUE KEY optionid (sortid,optionid), + KEY sortid (sortid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_forum_warning; +CREATE TABLE pre_forum_warning ( + wid int(10) unsigned NOT NULL AUTO_INCREMENT, + pid int(10) unsigned NOT NULL, + operatorid mediumint(8) unsigned NOT NULL, + operator char(15) NOT NULL, + authorid mediumint(8) unsigned NOT NULL, + author char(15) NOT NULL, + dateline int(10) unsigned NOT NULL, + reason char(40) NOT NULL, + PRIMARY KEY (wid), + UNIQUE KEY pid (pid), + KEY authorid (authorid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_album; +CREATE TABLE pre_home_album ( + albumid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + albumname varchar(50) NOT NULL DEFAULT '', + catid smallint(6) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + updatetime int(10) unsigned NOT NULL DEFAULT '0', + picnum smallint(6) unsigned NOT NULL DEFAULT '0', + pic varchar(255) NOT NULL DEFAULT '', + picflag tinyint(1) NOT NULL DEFAULT '0', + friend tinyint(1) NOT NULL DEFAULT '0', + `password` varchar(10) NOT NULL DEFAULT '', + target_ids text NOT NULL, + favtimes mediumint(8) unsigned NOT NULL, + sharetimes mediumint(8) unsigned NOT NULL, + depict text NOT NULL, + PRIMARY KEY (albumid), + KEY uid (uid,updatetime), + KEY updatetime (updatetime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_album_category; +CREATE TABLE pre_home_album_category ( + catid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + upid mediumint(8) unsigned NOT NULL DEFAULT '0', + catname varchar(255) NOT NULL DEFAULT '', + num mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (catid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_blacklist; +CREATE TABLE pre_home_blacklist ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + buid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,buid), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_blog; +CREATE TABLE pre_home_blog ( + blogid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL DEFAULT '', + `subject` varchar(255) NOT NULL DEFAULT '', + classid smallint(6) unsigned NOT NULL DEFAULT '0', + catid smallint(6) unsigned NOT NULL DEFAULT '0', + viewnum mediumint(8) unsigned NOT NULL DEFAULT '0', + replynum mediumint(8) unsigned NOT NULL DEFAULT '0', + hot mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + picflag tinyint(1) NOT NULL DEFAULT '0', + noreply tinyint(1) NOT NULL DEFAULT '0', + friend tinyint(1) NOT NULL DEFAULT '0', + `password` char(10) NOT NULL DEFAULT '', + favtimes mediumint(8) unsigned NOT NULL DEFAULT '0', + sharetimes mediumint(8) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '0', + click1 smallint(6) unsigned NOT NULL DEFAULT '0', + click2 smallint(6) unsigned NOT NULL DEFAULT '0', + click3 smallint(6) unsigned NOT NULL DEFAULT '0', + click4 smallint(6) unsigned NOT NULL DEFAULT '0', + click5 smallint(6) unsigned NOT NULL DEFAULT '0', + click6 smallint(6) unsigned NOT NULL DEFAULT '0', + click7 smallint(6) unsigned NOT NULL DEFAULT '0', + click8 smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (blogid), + KEY uid (uid,dateline), + KEY hot (hot), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_blog_category; +CREATE TABLE pre_home_blog_category ( + catid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + upid mediumint(8) unsigned NOT NULL DEFAULT '0', + catname varchar(255) NOT NULL DEFAULT '', + num mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (catid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_blog_moderate; +CREATE TABLE pre_home_blog_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `status` (`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_blogfield; +CREATE TABLE pre_home_blogfield ( + blogid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + pic varchar(255) NOT NULL DEFAULT '', + tag varchar(255) NOT NULL DEFAULT '', + message mediumtext NOT NULL, + postip varchar(255) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + related text NOT NULL, + relatedtime int(10) unsigned NOT NULL DEFAULT '0', + target_ids text NOT NULL, + hotuser text NOT NULL, + magiccolor tinyint(6) NOT NULL DEFAULT '0', + magicpaper tinyint(6) NOT NULL DEFAULT '0', + pushedaid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (blogid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_class; +CREATE TABLE pre_home_class ( + classid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + classname char(40) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (classid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_click; +CREATE TABLE pre_home_click ( + clickid smallint(6) unsigned NOT NULL AUTO_INCREMENT, + `name` char(50) NOT NULL DEFAULT '', + icon char(100) NOT NULL DEFAULT '', + idtype char(15) NOT NULL DEFAULT '', + available tinyint(1) NOT NULL DEFAULT '0', + displayorder tinyint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (clickid), + KEY idtype (idtype,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_clickuser; +CREATE TABLE pre_home_clickuser ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + id mediumint(8) unsigned NOT NULL DEFAULT '0', + idtype varchar(15) NOT NULL DEFAULT '', + clickid smallint(6) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + KEY id (id,idtype,dateline), + KEY uid (uid,idtype,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_comment; +CREATE TABLE pre_home_comment ( + cid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + id mediumint(8) unsigned NOT NULL DEFAULT '0', + idtype varchar(20) NOT NULL DEFAULT '', + authorid mediumint(8) unsigned NOT NULL DEFAULT '0', + author varchar(15) NOT NULL DEFAULT '', + ip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + message text NOT NULL, + magicflicker tinyint(1) NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (cid), + KEY authorid (authorid,idtype), + KEY id (id,idtype,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_comment_moderate; +CREATE TABLE pre_home_comment_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + idtype varchar(15) NOT NULL DEFAULT '', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY idtype (idtype,`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_docomment; +CREATE TABLE pre_home_docomment ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + upid int(10) unsigned NOT NULL DEFAULT '0', + doid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + message text NOT NULL, + ip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + grade smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY doid (doid,dateline), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_doing; +CREATE TABLE pre_home_doing ( + doid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + `from` varchar(20) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + message text NOT NULL, + ip varchar(45) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + replynum int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (doid), + KEY uid (uid,dateline), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_doing_moderate; +CREATE TABLE pre_home_doing_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `status` (`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_favorite; +CREATE TABLE pre_home_favorite ( + favid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + id mediumint(8) unsigned NOT NULL DEFAULT '0', + idtype varchar(255) NOT NULL DEFAULT '', + spaceuid mediumint(8) unsigned NOT NULL DEFAULT '0', + title varchar(255) NOT NULL DEFAULT '', + description text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (favid), + KEY idtype (id,idtype(40)), + KEY uid (uid,idtype(40),dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_feed; +CREATE TABLE pre_home_feed ( + feedid int(10) unsigned NOT NULL AUTO_INCREMENT, + icon varchar(30) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + friend tinyint(1) NOT NULL DEFAULT '0', + hash_template varchar(32) NOT NULL DEFAULT '', + hash_data varchar(32) NOT NULL DEFAULT '', + title_template text NOT NULL, + title_data text NOT NULL, + body_template text NOT NULL, + body_data text NOT NULL, + body_general text NOT NULL, + image_1 varchar(255) NOT NULL DEFAULT '', + image_1_link varchar(255) NOT NULL DEFAULT '', + image_2 varchar(255) NOT NULL DEFAULT '', + image_2_link varchar(255) NOT NULL DEFAULT '', + image_3 varchar(255) NOT NULL DEFAULT '', + image_3_link varchar(255) NOT NULL DEFAULT '', + image_4 varchar(255) NOT NULL DEFAULT '', + image_4_link varchar(255) NOT NULL DEFAULT '', + target_ids text NOT NULL, + id mediumint(8) unsigned NOT NULL DEFAULT '0', + idtype varchar(15) NOT NULL DEFAULT '', + hot mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (feedid), + KEY uid (uid,dateline), + KEY dateline (dateline), + KEY hot (hot), + KEY id (id,idtype) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_follow; +CREATE TABLE pre_home_follow ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username char(15) NOT NULL DEFAULT '', + followuid mediumint(8) unsigned NOT NULL DEFAULT '0', + fusername char(15) NOT NULL DEFAULT '', + bkname varchar(255) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT '0', + mutual tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,followuid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_follow_feed; +CREATE TABLE pre_home_follow_feed ( + feedid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + tid int(10) unsigned NOT NULL DEFAULT '0', + note text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (feedid), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_follow_feed_archiver; +CREATE TABLE pre_home_follow_feed_archiver ( + feedid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + tid int(10) unsigned NOT NULL DEFAULT '0', + note text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (feedid), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_friend; +CREATE TABLE pre_home_friend ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fuid mediumint(8) unsigned NOT NULL DEFAULT '0', + fusername varchar(15) NOT NULL DEFAULT '', + gid smallint(6) unsigned NOT NULL DEFAULT '0', + num mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + note varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (uid,fuid), + KEY fuid (fuid), + KEY uid (uid,num,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_friend_request; +CREATE TABLE pre_home_friend_request ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fuid mediumint(8) unsigned NOT NULL DEFAULT '0', + fusername char(15) NOT NULL DEFAULT '', + gid smallint(6) unsigned NOT NULL DEFAULT '0', + note char(60) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,fuid), + KEY fuid (fuid), + KEY dateline (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_friendlog; +CREATE TABLE pre_home_friendlog ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fuid mediumint(8) unsigned NOT NULL DEFAULT '0', + `action` varchar(10) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,fuid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_notification; +CREATE TABLE pre_home_notification ( + id bigint(20) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` varchar(20) NOT NULL DEFAULT '', + `new` tinyint(1) NOT NULL DEFAULT '0', + authorid mediumint(8) unsigned NOT NULL DEFAULT '0', + author varchar(15) NOT NULL DEFAULT '', + note text NOT NULL, + dateline int(10) unsigned NOT NULL DEFAULT '0', + from_id mediumint(8) unsigned NOT NULL DEFAULT '0', + from_idtype varchar(20) NOT NULL DEFAULT '', + from_num mediumint(8) unsigned NOT NULL DEFAULT '0', + category tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY uid (uid,`new`), + KEY category (uid,category,dateline), + KEY by_type (uid,`type`,dateline), + KEY from_id (from_id,from_idtype) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_pic; +CREATE TABLE pre_home_pic ( + picid mediumint(8) NOT NULL AUTO_INCREMENT, + albumid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + postip varchar(255) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + title varchar(255) NOT NULL DEFAULT '', + `type` varchar(255) NOT NULL DEFAULT '', + size int(10) unsigned NOT NULL DEFAULT '0', + filepath varchar(255) NOT NULL DEFAULT '', + thumb tinyint(1) NOT NULL DEFAULT '0', + remote tinyint(1) NOT NULL DEFAULT '0', + hot mediumint(8) unsigned NOT NULL DEFAULT '0', + sharetimes mediumint(8) unsigned NOT NULL DEFAULT '0', + click1 smallint(6) unsigned NOT NULL DEFAULT '0', + click2 smallint(6) unsigned NOT NULL DEFAULT '0', + click3 smallint(6) unsigned NOT NULL DEFAULT '0', + click4 smallint(6) unsigned NOT NULL DEFAULT '0', + click5 smallint(6) unsigned NOT NULL DEFAULT '0', + click6 smallint(6) unsigned NOT NULL DEFAULT '0', + click7 smallint(6) unsigned NOT NULL DEFAULT '0', + click8 smallint(6) unsigned NOT NULL DEFAULT '0', + magicframe tinyint(6) NOT NULL DEFAULT '0', + `status` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (picid), + KEY uid (uid), + KEY albumid (albumid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_pic_moderate; +CREATE TABLE pre_home_pic_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `status` (`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_picfield; +CREATE TABLE pre_home_picfield ( + picid mediumint(8) unsigned NOT NULL DEFAULT '0', + hotuser text NOT NULL, + PRIMARY KEY (picid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_poke; +CREATE TABLE pre_home_poke ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fromuid mediumint(8) unsigned NOT NULL DEFAULT '0', + fromusername varchar(15) NOT NULL DEFAULT '', + note varchar(255) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + iconid smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,fromuid), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_pokearchive; +CREATE TABLE pre_home_pokearchive ( + pid mediumint(8) NOT NULL AUTO_INCREMENT, + pokeuid int(10) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + fromuid mediumint(8) unsigned NOT NULL DEFAULT '0', + note varchar(255) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + iconid smallint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (pid), + KEY pokeuid (pokeuid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_share; +CREATE TABLE pre_home_share ( + sid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + itemid mediumint(8) unsigned NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + fromuid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + title_template text NOT NULL, + body_template text NOT NULL, + body_data text NOT NULL, + body_general text NOT NULL, + image varchar(255) NOT NULL DEFAULT '', + image_link varchar(255) NOT NULL DEFAULT '', + hot mediumint(8) unsigned NOT NULL DEFAULT '0', + hotuser text NOT NULL, + `status` tinyint(1) NOT NULL, + PRIMARY KEY (sid), + KEY uid (uid,dateline), + KEY hot (hot), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_share_moderate; +CREATE TABLE pre_home_share_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `status` (`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_show; +CREATE TABLE pre_home_show ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + unitprice int(10) unsigned NOT NULL DEFAULT '1', + credit int(10) unsigned NOT NULL DEFAULT '0', + note varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (uid), + KEY unitprice (unitprice), + KEY credit (credit) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_specialuser; +CREATE TABLE pre_home_specialuser ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT '0', + dateline int(10) NOT NULL DEFAULT '0', + reason text NOT NULL, + opuid mediumint(8) unsigned NOT NULL DEFAULT '0', + opusername varchar(15) NOT NULL DEFAULT '', + displayorder mediumint(8) unsigned NOT NULL DEFAULT '0', + KEY uid (uid,`status`), + KEY displayorder (`status`,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_home_visitor; +CREATE TABLE pre_home_visitor ( + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + vuid mediumint(8) unsigned NOT NULL DEFAULT '0', + vusername char(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (uid,vuid), + KEY vuid (vuid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_mobile_setting; +CREATE TABLE pre_mobile_setting ( + skey varchar(190) NOT NULL DEFAULT '', + svalue text NOT NULL, + PRIMARY KEY (skey) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_article_content; +CREATE TABLE pre_portal_article_content ( + cid int(10) unsigned NOT NULL AUTO_INCREMENT, + aid mediumint(8) unsigned NOT NULL DEFAULT '0', + id int(10) unsigned NOT NULL DEFAULT '0', + idtype varchar(255) NOT NULL DEFAULT '', + title varchar(255) NOT NULL DEFAULT '', + content text NOT NULL, + pageorder smallint(6) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (cid), + KEY aid (aid,pageorder), + KEY pageorder (pageorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_article_count; +CREATE TABLE pre_portal_article_count ( + aid mediumint(8) unsigned NOT NULL DEFAULT '0', + catid mediumint(8) unsigned NOT NULL DEFAULT '0', + viewnum mediumint(8) unsigned NOT NULL DEFAULT '0', + commentnum mediumint(8) unsigned NOT NULL DEFAULT '0', + favtimes mediumint(8) unsigned NOT NULL DEFAULT '0', + sharetimes mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (aid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_article_moderate; +CREATE TABLE pre_portal_article_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY `status` (`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_article_related; +CREATE TABLE pre_portal_article_related ( + aid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + raid mediumint(8) unsigned NOT NULL DEFAULT '0', + displayorder mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (aid,raid), + KEY aid (aid,displayorder) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_article_title; +CREATE TABLE pre_portal_article_title ( + aid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + catid mediumint(8) unsigned NOT NULL DEFAULT '0', + bid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + title varchar(255) NOT NULL DEFAULT '', + highlight varchar(255) NOT NULL DEFAULT '', + author varchar(255) NOT NULL DEFAULT '', + `from` varchar(255) NOT NULL DEFAULT '', + fromurl varchar(255) NOT NULL DEFAULT '', + url varchar(255) NOT NULL DEFAULT '', + summary varchar(255) NOT NULL DEFAULT '', + pic varchar(255) NOT NULL DEFAULT '', + thumb tinyint(1) NOT NULL DEFAULT '0', + remote tinyint(1) NOT NULL DEFAULT '0', + id int(10) unsigned NOT NULL DEFAULT '0', + idtype varchar(255) NOT NULL DEFAULT '', + contents smallint(6) NOT NULL DEFAULT '0', + allowcomment tinyint(1) NOT NULL DEFAULT '0', + owncomment tinyint(1) NOT NULL DEFAULT '0', + click1 smallint(6) unsigned NOT NULL DEFAULT '0', + click2 smallint(6) unsigned NOT NULL DEFAULT '0', + click3 smallint(6) unsigned NOT NULL DEFAULT '0', + click4 smallint(6) unsigned NOT NULL DEFAULT '0', + click5 smallint(6) unsigned NOT NULL DEFAULT '0', + click6 smallint(6) unsigned NOT NULL DEFAULT '0', + click7 smallint(6) unsigned NOT NULL DEFAULT '0', + click8 smallint(6) unsigned NOT NULL DEFAULT '0', + tag tinyint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '0', + showinnernav tinyint(1) NOT NULL DEFAULT '0', + preaid mediumint(8) unsigned NOT NULL, + nextaid mediumint(8) unsigned NOT NULL, + htmlmade tinyint(1) NOT NULL DEFAULT '0', + htmlname varchar(255) NOT NULL DEFAULT '', + htmldir varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (aid), + KEY catid (catid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_article_trash; +CREATE TABLE pre_portal_article_trash ( + aid mediumint(8) unsigned NOT NULL DEFAULT '0', + content text NOT NULL, + PRIMARY KEY (aid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_attachment; +CREATE TABLE pre_portal_attachment ( + attachid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + filetype varchar(255) NOT NULL DEFAULT '', + filesize int(10) unsigned NOT NULL DEFAULT '0', + attachment varchar(255) NOT NULL DEFAULT '', + isimage tinyint(1) NOT NULL DEFAULT '0', + thumb tinyint(1) NOT NULL DEFAULT '0', + remote tinyint(1) NOT NULL DEFAULT '0', + aid mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (attachid), + KEY aid (aid,attachid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_category; +CREATE TABLE pre_portal_category ( + catid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + upid mediumint(8) unsigned NOT NULL DEFAULT '0', + catname varchar(255) NOT NULL DEFAULT '', + articles mediumint(8) unsigned NOT NULL DEFAULT '0', + allowcomment tinyint(1) NOT NULL DEFAULT '1', + displayorder smallint(6) NOT NULL DEFAULT '0', + notinheritedarticle tinyint(1) NOT NULL DEFAULT '0', + notinheritedblock tinyint(1) NOT NULL DEFAULT '0', + domain varchar(255) NOT NULL DEFAULT '', + url varchar(255) NOT NULL DEFAULT '', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + closed tinyint(1) NOT NULL DEFAULT '0', + shownav tinyint(1) NOT NULL DEFAULT '0', + description text NOT NULL, + seotitle text NOT NULL, + keyword text NOT NULL, + primaltplname varchar(255) NOT NULL DEFAULT '', + articleprimaltplname varchar(255) NOT NULL DEFAULT '', + disallowpublish tinyint(1) NOT NULL DEFAULT '0', + foldername varchar(255) NOT NULL DEFAULT '', + notshowarticlesummay varchar(255) NOT NULL DEFAULT '', + perpage smallint(6) NOT NULL DEFAULT '0', + maxpages smallint(6) NOT NULL DEFAULT '0', + noantitheft tinyint(1) NOT NULL DEFAULT '0', + lastpublish int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (catid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_category_permission; +CREATE TABLE pre_portal_category_permission ( + catid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + allowpublish tinyint(1) NOT NULL DEFAULT '0', + allowmanage tinyint(1) NOT NULL DEFAULT '0', + inheritedcatid mediumint(8) NOT NULL DEFAULT '0', + PRIMARY KEY (catid,uid), + KEY uid (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_comment; +CREATE TABLE pre_portal_comment ( + cid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + id mediumint(8) unsigned NOT NULL DEFAULT '0', + idtype varchar(20) NOT NULL DEFAULT '', + postip varchar(255) NOT NULL DEFAULT '', + `port` smallint(6) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '0', + message text NOT NULL, + PRIMARY KEY (cid), + KEY idtype (id,idtype,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_comment_moderate; +CREATE TABLE pre_portal_comment_moderate ( + id int(10) unsigned NOT NULL DEFAULT '0', + idtype varchar(15) NOT NULL DEFAULT '', + `status` tinyint(3) NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY idtype (idtype,`status`,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_rsscache; +CREATE TABLE pre_portal_rsscache ( + lastupdate int(10) unsigned NOT NULL DEFAULT '0', + catid mediumint(8) unsigned NOT NULL DEFAULT '0', + aid mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + catname char(50) NOT NULL DEFAULT '', + author char(15) NOT NULL DEFAULT '', + `subject` varchar(255) NOT NULL DEFAULT '', + description char(255) NOT NULL DEFAULT '', + UNIQUE KEY aid (aid), + KEY catid (catid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_topic; +CREATE TABLE pre_portal_topic ( + topicid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + title varchar(255) NOT NULL DEFAULT '', + `name` varchar(255) NOT NULL DEFAULT '', + domain varchar(255) NOT NULL DEFAULT '', + summary text NOT NULL, + keyword text NOT NULL, + cover varchar(255) NOT NULL DEFAULT '', + picflag tinyint(1) NOT NULL DEFAULT '0', + primaltplname varchar(255) NOT NULL DEFAULT '', + useheader tinyint(1) NOT NULL DEFAULT '0', + usefooter tinyint(1) NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(255) NOT NULL DEFAULT '', + viewnum mediumint(8) unsigned NOT NULL DEFAULT '0', + dateline int(10) unsigned NOT NULL DEFAULT '0', + closed tinyint(1) NOT NULL DEFAULT '0', + allowcomment tinyint(1) NOT NULL DEFAULT '0', + commentnum mediumint(8) unsigned NOT NULL DEFAULT '0', + htmlmade tinyint(1) NOT NULL DEFAULT '0', + htmldir varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (topicid), + KEY `name` (`name`(40)) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_portal_topic_pic; +CREATE TABLE pre_portal_topic_pic ( + picid mediumint(8) NOT NULL AUTO_INCREMENT, + topicid mediumint(8) unsigned NOT NULL DEFAULT '0', + uid mediumint(8) unsigned NOT NULL DEFAULT '0', + username varchar(15) NOT NULL DEFAULT '', + dateline int(10) unsigned NOT NULL DEFAULT '0', + filename varchar(255) NOT NULL DEFAULT '', + title varchar(255) NOT NULL DEFAULT '', + size int(10) unsigned NOT NULL DEFAULT '0', + filepath varchar(255) NOT NULL DEFAULT '', + thumb tinyint(1) NOT NULL DEFAULT '0', + remote tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (picid), + KEY topicid (topicid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_security_evilpost; +CREATE TABLE pre_security_evilpost ( + pid int(10) unsigned NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + `type` tinyint(1) NOT NULL DEFAULT '0', + evilcount int(10) NOT NULL DEFAULT '0', + eviltype mediumint(8) unsigned NOT NULL DEFAULT '0', + createtime int(10) unsigned NOT NULL DEFAULT '0', + operateresult tinyint(1) NOT NULL DEFAULT '0', + isreported tinyint(1) NOT NULL DEFAULT '0', + censorword char(50) NOT NULL, + PRIMARY KEY (pid), + KEY `type` (tid,`type`), + KEY operateresult (operateresult,createtime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_security_eviluser; +CREATE TABLE pre_security_eviluser ( + uid int(10) unsigned NOT NULL, + evilcount int(10) NOT NULL DEFAULT '0', + eviltype mediumint(8) unsigned NOT NULL DEFAULT '0', + createtime int(10) unsigned NOT NULL DEFAULT '0', + operateresult tinyint(1) NOT NULL DEFAULT '0', + isreported tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (uid), + KEY operateresult (operateresult,createtime) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS pre_security_failedlog; +CREATE TABLE pre_security_failedlog ( + id int(11) NOT NULL AUTO_INCREMENT, + reporttype char(20) NOT NULL, + tid int(10) unsigned NOT NULL DEFAULT '0', + pid int(10) unsigned NOT NULL DEFAULT '0', + uid int(10) unsigned NOT NULL DEFAULT '0', + failcount int(10) unsigned NOT NULL DEFAULT '0', + createtime int(10) unsigned NOT NULL DEFAULT '0', + posttime int(10) unsigned NOT NULL DEFAULT '0', + delreason char(255) NOT NULL, + scheduletime int(10) unsigned NOT NULL DEFAULT '0', + lastfailtime int(10) unsigned NOT NULL DEFAULT '0', + extra1 int(10) unsigned NOT NULL, + extra2 char(255) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY pid (pid), + KEY uid (uid) +) ENGINE=InnoDB; + diff --git a/install/data/install_data.sql b/install/data/install_data.sql new file mode 100644 index 0000000..4374cf9 --- /dev/null +++ b/install/data/install_data.sql @@ -0,0 +1,1121 @@ +INSERT INTO pre_common_admingroup SET `admingid`='1',`alloweditpost`='1',`alloweditpoll`='1',`allowstickthread`='3',`allowmodpost`='1',`allowdelpost`='1',`allowmassprune`='1',`allowrefund`='1',`allowcensorword`='1',`allowviewip`='1',`allowbanip`='1',`allowedituser`='1',`allowmoduser`='1',`allowbanuser`='1',`allowbanvisituser`='1',`allowpostannounce`='1',`allowviewlog`='1',`allowbanpost`='1',`supe_allowpushthread`='1',`allowhighlightthread`='1',`allowlivethread`='1',`allowdigestthread`='3',`allowrecommendthread`='1',`allowbumpthread`='1',`allowclosethread`='1',`allowmovethread`='1',`allowedittypethread`='1',`allowstampthread`='1',`allowcopythread`='1',`allowmergethread`='1',`allowsplitthread`='1',`allowrepairthread`='1',`allowwarnpost`='1',`allowviewreport`='1',`alloweditforum`='1',`allowremovereward`='1',`allowedittrade`='1',`alloweditactivity`='1',`allowstickreply`='1',`allowmanagearticle`='1',`allowaddtopic`='1',`allowmanagetopic`='1',`allowdiy`='1',`allowclearrecycle`='1',`allowmanagetag`='1',`managefeed`='1',`managedoing`='1',`manageshare`='1',`manageblog`='1',`managealbum`='1',`managecomment`='1',`managemagiclog`='1',`managereport`='1',`managehotuser`='1',`managedefaultuser`='1',`managemagic`='1',`manageclick`='1',`allowstamplist`='1',`allowmanagecollection`='1',`allowmakehtml`='1'; +INSERT INTO pre_common_admingroup SET `admingid`='2',`alloweditpost`='1',`alloweditpoll`='0',`allowstickthread`='2',`allowmodpost`='1',`allowdelpost`='1',`allowmassprune`='1',`allowrefund`='1',`allowcensorword`='1',`allowviewip`='1',`allowbanip`='1',`allowedituser`='1',`allowmoduser`='1',`allowbanuser`='1',`allowbanvisituser`='1',`allowpostannounce`='1',`allowviewlog`='1',`allowbanpost`='1',`supe_allowpushthread`='0',`allowhighlightthread`='1',`allowlivethread`='1',`allowdigestthread`='3',`allowrecommendthread`='1',`allowbumpthread`='1',`allowclosethread`='1',`allowmovethread`='1',`allowedittypethread`='1',`allowstampthread`='1',`allowcopythread`='1',`allowmergethread`='1',`allowsplitthread`='1',`allowrepairthread`='1',`allowwarnpost`='1',`allowviewreport`='1',`alloweditforum`='1',`allowremovereward`='1',`allowedittrade`='0',`alloweditactivity`='0',`allowstickreply`='0',`allowmanagearticle`='0',`allowaddtopic`='0',`allowmanagetopic`='0',`allowdiy`='0',`allowclearrecycle`='0',`allowmanagetag`='0',`managefeed`='0',`managedoing`='0',`manageshare`='0',`manageblog`='0',`managealbum`='0',`managecomment`='0',`managemagiclog`='0',`managereport`='0',`managehotuser`='0',`managedefaultuser`='0',`managemagic`='0',`manageclick`='0',`allowstamplist`='1',`allowmanagecollection`='1',`allowmakehtml`='0'; +INSERT INTO pre_common_admingroup SET `admingid`='3',`alloweditpost`='1',`alloweditpoll`='0',`allowstickthread`='1',`allowmodpost`='1',`allowdelpost`='1',`allowmassprune`='0',`allowrefund`='0',`allowcensorword`='0',`allowviewip`='1',`allowbanip`='0',`allowedituser`='0',`allowmoduser`='1',`allowbanuser`='1',`allowbanvisituser`='0',`allowpostannounce`='0',`allowviewlog`='1',`allowbanpost`='1',`supe_allowpushthread`='0',`allowhighlightthread`='1',`allowlivethread`='1',`allowdigestthread`='3',`allowrecommendthread`='1',`allowbumpthread`='1',`allowclosethread`='1',`allowmovethread`='1',`allowedittypethread`='1',`allowstampthread`='1',`allowcopythread`='1',`allowmergethread`='1',`allowsplitthread`='1',`allowrepairthread`='1',`allowwarnpost`='1',`allowviewreport`='1',`alloweditforum`='1',`allowremovereward`='1',`allowedittrade`='0',`alloweditactivity`='0',`allowstickreply`='0',`allowmanagearticle`='0',`allowaddtopic`='0',`allowmanagetopic`='0',`allowdiy`='0',`allowclearrecycle`='0',`allowmanagetag`='0',`managefeed`='0',`managedoing`='0',`manageshare`='0',`manageblog`='0',`managealbum`='0',`managecomment`='0',`managemagiclog`='0',`managereport`='0',`managehotuser`='0',`managedefaultuser`='0',`managemagic`='0',`manageclick`='0',`allowstamplist`='1',`allowmanagecollection`='0',`allowmakehtml`='0'; +INSERT INTO pre_common_admingroup SET `admingid`='16',`alloweditpost`='0',`alloweditpoll`='0',`allowstickthread`='1',`allowmodpost`='0',`allowdelpost`='0',`allowmassprune`='0',`allowrefund`='0',`allowcensorword`='0',`allowviewip`='0',`allowbanip`='0',`allowedituser`='0',`allowmoduser`='0',`allowbanuser`='0',`allowbanvisituser`='0',`allowpostannounce`='0',`allowviewlog`='0',`allowbanpost`='1',`supe_allowpushthread`='0',`allowhighlightthread`='1',`allowlivethread`='0',`allowdigestthread`='1',`allowrecommendthread`='1',`allowbumpthread`='1',`allowclosethread`='1',`allowmovethread`='0',`allowedittypethread`='0',`allowstampthread`='1',`allowcopythread`='0',`allowmergethread`='0',`allowsplitthread`='0',`allowrepairthread`='0',`allowwarnpost`='1',`allowviewreport`='1',`alloweditforum`='0',`allowremovereward`='0',`allowedittrade`='0',`alloweditactivity`='0',`allowstickreply`='0',`allowmanagearticle`='0',`allowaddtopic`='0',`allowmanagetopic`='0',`allowdiy`='0',`allowclearrecycle`='0',`allowmanagetag`='0',`managefeed`='0',`managedoing`='0',`manageshare`='0',`manageblog`='0',`managealbum`='0',`managecomment`='0',`managemagiclog`='0',`managereport`='0',`managehotuser`='0',`managedefaultuser`='0',`managemagic`='0',`manageclick`='0',`allowstamplist`='0',`allowmanagecollection`='0',`allowmakehtml`='0'; +INSERT INTO pre_common_admingroup SET `admingid`='17',`alloweditpost`='1',`alloweditpoll`='0',`allowstickthread`='2',`allowmodpost`='1',`allowdelpost`='0',`allowmassprune`='0',`allowrefund`='1',`allowcensorword`='0',`allowviewip`='1',`allowbanip`='0',`allowedituser`='0',`allowmoduser`='0',`allowbanuser`='0',`allowbanvisituser`='0',`allowpostannounce`='1',`allowviewlog`='1',`allowbanpost`='1',`supe_allowpushthread`='0',`allowhighlightthread`='1',`allowlivethread`='0',`allowdigestthread`='3',`allowrecommendthread`='1',`allowbumpthread`='1',`allowclosethread`='1',`allowmovethread`='1',`allowedittypethread`='1',`allowstampthread`='1',`allowcopythread`='1',`allowmergethread`='1',`allowsplitthread`='1',`allowrepairthread`='1',`allowwarnpost`='1',`allowviewreport`='1',`alloweditforum`='1',`allowremovereward`='1',`allowedittrade`='0',`alloweditactivity`='0',`allowstickreply`='0',`allowmanagearticle`='0',`allowaddtopic`='0',`allowmanagetopic`='0',`allowdiy`='0',`allowclearrecycle`='0',`allowmanagetag`='0',`managefeed`='0',`managedoing`='0',`manageshare`='0',`manageblog`='0',`managealbum`='0',`managecomment`='0',`managemagiclog`='0',`managereport`='0',`managehotuser`='0',`managedefaultuser`='0',`managemagic`='0',`manageclick`='0',`allowstamplist`='0',`allowmanagecollection`='0',`allowmakehtml`='0'; +INSERT INTO pre_common_admingroup SET `admingid`='18',`alloweditpost`='0',`alloweditpoll`='0',`allowstickthread`='0',`allowmodpost`='0',`allowdelpost`='0',`allowmassprune`='0',`allowrefund`='0',`allowcensorword`='0',`allowviewip`='1',`allowbanip`='0',`allowedituser`='0',`allowmoduser`='0',`allowbanuser`='0',`allowbanvisituser`='0',`allowpostannounce`='0',`allowviewlog`='0',`allowbanpost`='0',`supe_allowpushthread`='1',`allowhighlightthread`='0',`allowlivethread`='0',`allowdigestthread`='0',`allowrecommendthread`='0',`allowbumpthread`='0',`allowclosethread`='0',`allowmovethread`='0',`allowedittypethread`='0',`allowstampthread`='0',`allowcopythread`='0',`allowmergethread`='0',`allowsplitthread`='0',`allowrepairthread`='0',`allowwarnpost`='0',`allowviewreport`='0',`alloweditforum`='0',`allowremovereward`='0',`allowedittrade`='0',`alloweditactivity`='0',`allowstickreply`='0',`allowmanagearticle`='0',`allowaddtopic`='0',`allowmanagetopic`='0',`allowdiy`='0',`allowclearrecycle`='0',`allowmanagetag`='0',`managefeed`='0',`managedoing`='0',`manageshare`='0',`manageblog`='0',`managealbum`='0',`managecomment`='0',`managemagiclog`='0',`managereport`='0',`managehotuser`='0',`managedefaultuser`='0',`managemagic`='0',`manageclick`='0',`allowstamplist`='0',`allowmanagecollection`='0',`allowmakehtml`='0'; +INSERT INTO pre_common_admingroup SET `admingid`='19',`alloweditpost`='0',`alloweditpoll`='0',`allowstickthread`='0',`allowmodpost`='1',`allowdelpost`='0',`allowmassprune`='0',`allowrefund`='0',`allowcensorword`='0',`allowviewip`='1',`allowbanip`='1',`allowedituser`='0',`allowmoduser`='1',`allowbanuser`='1',`allowbanvisituser`='0',`allowpostannounce`='0',`allowviewlog`='0',`allowbanpost`='0',`supe_allowpushthread`='0',`allowhighlightthread`='0',`allowlivethread`='0',`allowdigestthread`='0',`allowrecommendthread`='0',`allowbumpthread`='0',`allowclosethread`='0',`allowmovethread`='0',`allowedittypethread`='0',`allowstampthread`='0',`allowcopythread`='0',`allowmergethread`='0',`allowsplitthread`='0',`allowrepairthread`='0',`allowwarnpost`='0',`allowviewreport`='0',`alloweditforum`='0',`allowremovereward`='0',`allowedittrade`='0',`alloweditactivity`='0',`allowstickreply`='0',`allowmanagearticle`='0',`allowaddtopic`='0',`allowmanagetopic`='0',`allowdiy`='0',`allowclearrecycle`='0',`allowmanagetag`='0',`managefeed`='0',`managedoing`='0',`manageshare`='0',`manageblog`='0',`managealbum`='0',`managecomment`='0',`managemagiclog`='0',`managereport`='0',`managehotuser`='0',`managedefaultuser`='0',`managemagic`='0',`manageclick`='0',`allowstamplist`='0',`allowmanagecollection`='0',`allowmakehtml`='0'; + +INSERT INTO pre_common_adminnote VALUES ('1','Discuz','0','0','0','0','感谢您安装使用 Discuz! X,这里是 Discuz! 的管理中心,您可以在这里调整网站的各项设置。'); + +INSERT INTO pre_common_credit_rule VALUES ('1','发表主题','post','4','0','0','0','0','2','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('2','发表回复','reply','4','0','0','0','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('3','加精华','digest','4','0','0','0','0','5','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('4','上传附件','postattach','4','0','0','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('5','下载附件','getattach','4','0','0','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('6','发短消息','sendpm','4','0','0','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('7','搜索','search','4','0','0','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('8','访问推广','promotion_visit','1','0','1','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('9','注册推广','promotion_register','1','0','1','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('10','成功交易','tradefinished','4','0','0','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('11','邮箱认证','realemail','0','0','1','0','0','10','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('12','设置头像','setavatar','0','0','1','0','0','5','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('14','热点信息','hotinfo','4','0','0','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('15','每天登录','daylogin','1','0','1','0','0','2','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('16','访问别人空间','visit','1','0','10','2','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('17','打招呼','poke','1','0','10','2','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('18','留言','guestbook','1','0','20','2','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('19','被留言','getguestbook','1','0','5','2','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('20','发表记录','doing','1','0','5','0','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('21','发表日志','publishblog','1','0','3','0','0','2','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('22','参与投票','joinpoll','1','0','10','1','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('23','发起分享','createshare','1','0','3','0','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('24','评论','comment','1','0','40','1','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('25','被评论','getcomment','1','0','20','1','0','2','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('28','信息表态','click','1','0','10','1','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('29','修改域名','modifydomain','0','0','1','0','0','0','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('30','文章评论','portalcomment','1','0','40','1','0','1','0','0','0','0','0','0',''); +INSERT INTO pre_common_credit_rule VALUES ('31','淘专辑被订阅','followedcollection','1','0','3','0','0','1','0','0','0','0','0','0',''); + + + +INSERT INTO pre_common_cron VALUES ('1','1','system','清空今日发帖数','cron_todaypost_daily.php','1269746623','1269792000','-1','-1','0','0'); +INSERT INTO pre_common_cron VALUES ('2','1','system','清空本月在线时间','cron_onlinetime_monthly.php','1269682366','1270051200','-1','1','0','0'); +INSERT INTO pre_common_cron VALUES ('3','1','system','每日数据清理','cron_cleanup_daily.php','1269746634','1269811800','-1','-1','5','30'); +INSERT INTO pre_common_cron VALUES ('5','1','system','每日公告清理','cron_announcement_daily.php','1269746629','1269792000','-1','-1','0','0'); +INSERT INTO pre_common_cron VALUES ('6','1','system','限时操作清理','cron_threadexpiry_hourly.php','1269746634','1269810000','-1','-1','-1','0'); +INSERT INTO pre_common_cron VALUES ('7','1','system','论坛推广清理','cron_promotion_hourly.php','1269746629','1269792000','-1','-1','0','00'); +INSERT INTO pre_common_cron VALUES ('8','1','system','每月主题清理','cron_cleanup_monthly.php','1269682408','1270072800','-1','1','6','00'); +INSERT INTO pre_common_cron VALUES ('9','1','system','道具自动补货','cron_magic_daily.php','1269746629','1269792000','-1','-1','0','0'); +INSERT INTO pre_common_cron VALUES ('10','1','system','每日验证问答更新','cron_secqaa_daily.php','1269746634','1269813600','-1','-1','6','0'); +INSERT INTO pre_common_cron VALUES ('11','1','system','每日标签更新','cron_tag_daily.php','1269746633','1269792000','-1','-1','0','0'); +INSERT INTO pre_common_cron VALUES ('12','1','system','每日勋章更新','cron_medal_daily.php','1269746634','1269792000','-1','-1','0','0'); +INSERT INTO pre_common_cron VALUES ('13','1','system','清理过期动态','cron_cleanfeed.php','1269746634','1269792000','-1','-1','0','0'); +INSERT INTO pre_common_cron VALUES ('15','1','system','定时发布主题','cron_publish_halfhourly.php','1269746639','1269792000','-1','-1','-1','0 30'); +INSERT INTO pre_common_cron VALUES ('16','1','system','每周广播归档','cron_follow_daily.php','1269746639','1269792000','-1','-1','02','0'); +INSERT INTO pre_common_cron VALUES ('17','1','system','更新每日查看数','cron_todayviews_daily.php','1321500558','1321556400','-1','-1','3','0 5 10 15 20 25 30 35 40 45 50 55'); +INSERT INTO pre_common_cron VALUES ('18','0','system','每日用户分表','cron_member_optimize_daily.php','1321500558','1321556400','-1','-1','2','0 5 10 15 20 25 30 35 40 45 50 55'); +INSERT INTO pre_common_cron VALUES ('19','1','system','统计今日热帖','cron_todayheats_daily.php','1269746623','1269792000','-1','-1','0','0'); +INSERT INTO pre_common_cron VALUES ('20','1','system','更新版块最后发表(防水墙相关)','cron_security_cleanup_lastpost.php','1269746623','1269792000','-1','-1','7','0'); +INSERT INTO pre_common_cron VALUES ('21','1','system','每周短信日志归档','cron_smslog_daily.php','1269746639','1269792000','-1','-1','03','0'); + +INSERT INTO pre_common_friendlink VALUES ('1','0','Discuz! 官方论坛','https://www.discuz.vip/','提供最新 Discuz! 产品新闻、软件下载与技术交流','static/image/common/logo_88_31.gif','2'); +INSERT INTO pre_common_friendlink VALUES ('2','4','Discuz! 应用中心','https://addon.dismall.com/','','','2'); + +INSERT INTO pre_common_member_profile_setting VALUES('realname', 1, 0, 0, '真实姓名', '', 0, 0, 0, 0, 0, 0, 1, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('gender', 1, 0, 0, '性别', '', 0, 0, 0, 0, 0, 0, 1, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthyear', 1, 0, 0, '出生年份', '', 0, 0, 0, 0, 0, 0, 1, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthmonth', 1, 0, 0, '出生月份', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthday', 1, 0, 0, '生日', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('constellation', 1, 1, 0, '星座', '星座(根据生日自动计算)', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('zodiac', 1, 1, 0, '生肖', '生肖(根据生日自动计算)', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('telephone', 1, 1, 0, '固定电话', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('mobile', 1, 1, 0, '手机', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('idcardtype', 1, 1, 0, '证件类型', '身份证 护照 驾驶证等', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '身份证\n护照\n驾驶证', ''); +INSERT INTO pre_common_member_profile_setting VALUES('idcard', 1, 1, 0, '证件号', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('address', 1, 1, 0, '邮寄地址', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('zipcode', 1, 1, 0, '邮编', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('nationality', 0, 0, 0, '国籍', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthcountry', 1, 0, 0, '出生国家', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthprovince', 1, 0, 0, '出生省份', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthcity', 1, 0, 0, '出生地', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthdist', 1, 0, 0, '出生县', '出生行政区/县', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('birthcommunity', 1, 0, 0, '出生小区', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('residecountry', 1, 0, 0, '居住国家', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('resideprovince', 1, 0, 0, '居住省份', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('residecity', 1, 0, 0, '居住地', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('residedist', 1, 0, 0, '居住县', '居住行政区/县', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('residecommunity', 1, 0, 0, '居住小区', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('residesuite', 0, 0, 0, '房间', '小区、写字楼门牌号', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('graduateschool', 1, 0, 0, '毕业学校', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('education', 1, 0, 0, '学历', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, '博士\n硕士\n本科\n专科\n中学\n小学\n其它', ''); +INSERT INTO pre_common_member_profile_setting VALUES('company', 1, 0, 0, '公司', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('occupation', 1, 0, 0, '职业', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('position', 1, 0, 0, '职位', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('revenue', 1, 1, 0, '年收入', '单位 元', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('affectivestatus', 1, 1, 0, '情感状态', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('lookingfor', 1, 0, 0, '交友目的', '希望在网站找到什么样的朋友', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('bloodtype', 1, 1, 0, '血型', '', 0, 0, 0, 0, 0, 0, 0, 'select', 0, 'A\nB\nAB\nO\n其它', ''); +INSERT INTO pre_common_member_profile_setting VALUES('height', 0, 1, 0, '身高', '单位 cm', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('weight', 0, 1, 0, '体重', '单位 kg', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('alipay', 1, 1, 0, '支付宝', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('icq', 0, 1, 0, 'ICQ', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('qq', 1, 1, 0, 'QQ', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('yahoo', 0, 1, 0, 'YAHOO账号', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('msn', 1, 1, 0, 'MSN', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('taobao', 1, 1, 0, '阿里旺旺', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('site', 1, 0, 0, '个人主页', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('bio', 1, 1, 0, '自我介绍', '', 0, 0, 0, 0, 0, 0, 0, 'textarea', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('interest', 1, 0, 0, '兴趣爱好', '', 0, 0, 0, 0, 0, 0, 0, 'textarea', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field1', 0, 1, 0, '自定义字段1', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field2', 0, 1, 0, '自定义字段2', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field3', 0, 1, 0, '自定义字段3', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field4', 0, 1, 0, '自定义字段4', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field5', 0, 1, 0, '自定义字段5', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field6', 0, 1, 0, '自定义字段6', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field7', 0, 1, 0, '自定义字段7', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); +INSERT INTO pre_common_member_profile_setting VALUES('field8', 0, 1, 0, '自定义字段8', '', 0, 0, 0, 0, 0, 0, 0, 'text', 0, '', ''); + +-- INSERT INTO `pre_portal_category` VALUES (1, 0, '产品动态', 0, 0); +-- INSERT INTO `pre_portal_category` VALUES (2, 0, '公司新闻', 0, 0); +-- INSERT INTO `pre_portal_category` VALUES (3, 0, '产品服务', 0, 0); +-- INSERT INTO `pre_portal_category` VALUES (4, 0, '业界动态', 0, 0); +-- INSERT INTO `pre_portal_category` VALUES (5, 2, '市场活动', 0, 0); +-- INSERT INTO `pre_portal_category` VALUES (6, 2, '互联网', 0, 0); +-- INSERT INTO `pre_portal_category` VALUES (7, 2, '走进康盛', 0, 0); + +-- [update_nav] + +INSERT INTO pre_common_nav VALUES ('','0','门户','Portal','portal.php','1','0','0','-1','1','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','论坛','BBS','forum.php','2','0','0','1','2','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','圈子','Group','group.php','3','0','0','-1','7','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','动态','Space','home.php','4','0','0','-1','8','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','插件','Plugin','#','6','0','0','1','9','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','帮助','Help','misc.php?mod=faq','7','0','0','0','10','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','排行榜','Ranklist','misc.php?mod=ranklist','8','0','0','-1','16','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','广播','Follow','home.php?mod=follow','9','0','0','-1','5','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','导读','Guide','forum.php?mod=guide','10','0','0','-1','3','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','淘帖','Collection','forum.php?mod=collection','11','0','0','-1','11','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','日志','Blog','home.php?mod=space&do=blog','12','0','0','-1','12','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','相册','Album','home.php?mod=space&do=album','13','0','0','-1','13','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','分享','Share','home.php?mod=space&do=share','14','0','0','-1','14','0','0','0', 0, '', '', '', 0, ''); +INSERT INTO pre_common_nav VALUES ('','0','记录','Doing','home.php?mod=space&do=doing','15','0','0','-1','15','0','0','0', 0, '', '', '', 0, ''); + +INSERT INTO pre_common_nav VALUES ('', '0', '站点统计', '', 'misc.php?mod=stat', 'stat', 0, 0, 1, 1, 0, 0, 0, 0, '', '', '', 1, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '举报', '', '#', 'report', 0, 0, 1, 2, 0, 0, 0, 0, '', '', '', 1, ''); +INSERT INTO pre_common_nav VALUES ('', '0', 'Archiver', '', 'archiver/', 'archiver', 0, 0, 1, 3, 0, 0, 0, 0, '', '', '', 1, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '手机版', '', 'forum.php?showmobile=yes', 'mobile', 0, 0, 1, 3, 0, 0, 0, 0, '', '', '', 1, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '小黑屋', '', 'forum.php?mod=misc&action=showdarkroom', 'darkroom', 0, 0, 1, 3, 0, 0, 0, 0, '', '', '', 1, ''); + +INSERT INTO pre_common_nav VALUES ('', '0', '日志', '', 'home.php?mod=space&do=blog', 'blog', 0, 0, -1, 2, 0, 0, 0, 0, '{STATICURL}image/feed/blog.gif', '发布', 'home.php?mod=spacecp&ac=blog', 2, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '相册', '', 'home.php?mod=space&do=album', 'album', 0, 0, -1, 3, 0, 0, 0, 0, '{STATICURL}image/feed/album.gif', '上传', 'home.php?mod=spacecp&ac=upload', 2, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '分享', '', 'home.php?mod=space&do=share', 'share', 0, 0, -1, 4, 0, 0, 0, 0, '{STATICURL}image/feed/share.gif', '添加', 'home.php?mod=spacecp&ac=share', 2, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '记录', '', 'home.php?mod=space&do=doing', 'doing', 0, 0, -1, 5, 0, 0, 0, 0, '{STATICURL}image/feed/doing.gif', '', '', 2, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '广播', '', 'home.php?mod=follow', 'follow', 0, 0, -1, 6, 0, 0, 0, 0, '{STATICURL}image/feed/follow.gif', '', '', 2, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '{hr}', '', '', '', 0, 1, 1, 8, 0, 0, 0, 0, '', '', '', 2, ''); + +INSERT INTO pre_common_nav VALUES ('', '0', '好友', '', 'home.php?mod=space&do=friend', 'friend', 0, 0, -1, 1, 0, 0, 0, 0, '{STATICURL}image/feed/friend_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '文章', '', 'home.php?mod=space&do=thread&view=me', 'thread', 0, 0, 0, 2, 0, 0, 0, 0, '{STATICURL}image/feed/thread_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '收藏', '', 'home.php?mod=space&do=favorite&view=me', 'favorite', 0, 0, -1, 3, 0, 0, 0, 0, '{STATICURL}image/feed/favorite_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '道具', '', 'home.php?mod=magic', 'magic', 0, 0, -1, 4, 0, 0, 0, 0, '{STATICURL}image/feed/magic_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '勋章', '', 'home.php?mod=medal', 'medal', 0, 0, -1, 5, 0, 0, 0, 0, '{STATICURL}image/feed/medal_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '任务', '', 'home.php?mod=task', 'task', 0, 0, -1, 6, 0, 0, 0, 0, '{STATICURL}image/feed/task_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '淘帖', '', 'forum.php?mod=collection&op=my', 'collection', 0, 0, -1, 7, 0, 0, 0, 0, '{STATICURL}image/feed/collection_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '动态', '', 'home.php', 'feed', 0, 0, -1, 8, 0, 0, 0, 0, '{STATICURL}image/feed/feed_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '日志', '', 'home.php?mod=space&do=blog', 'blog', 0, 0, -1, 9, 0, 0, 0, 0, '{STATICURL}image/feed/blog_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '相册', '', 'home.php?mod=space&do=album', 'album', 0, 0, -1, 10, 0, 0, 0, 0, '{STATICURL}image/feed/album_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '分享', '', 'home.php?mod=space&do=share', 'share', 0, 0, -1, 11, 0, 0, 0, 0, '{STATICURL}image/feed/share_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '记录', '', 'home.php?mod=space&do=doing', 'doing', 0, 0, -1, 12, 0, 0, 0, 0, '{STATICURL}image/feed/doing_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '留言板', '', 'home.php?mod=space&do=wall', 'wall', 0, 0, -1, 13, 0, 0, 0, 0, '{STATICURL}image/feed/wall_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '广播', '', 'home.php?mod=follow', 'follow', 0, 0, -1, 14, 0, 0, 0, 0, '{STATICURL}image/feed/follow_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '圈子', '', 'group.php', 'group', 0, 0, -1, 15, 0, 0, 0, 0, '{STATICURL}image/feed/group_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '门户', '', 'portal.php', 'portal', 0, 0, -1, 16, 0, 0, 0, 0, '{STATICURL}image/feed/portal_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '导读', '', 'forum.php?mod=guide', 'guide', 0, 0, -1, 17, 0, 0, 0, 0, '{STATICURL}image/feed/guide_b.png', '', '', 3, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '排行榜', '', 'misc.php?mod=ranklist', 'ranklist', 0, 0, -1, 18, 0, 0, 0, 0, '{STATICURL}image/feed/ranklist_b.png', '', '', 3, ''); + + +INSERT INTO pre_common_nav VALUES ('', '0', '设为首页', '', '#', 'sethomepage', 0, 0, 1, 1, 0, 0, 0, 0, '', '', '', 4, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '收藏本站', '', '#', 'setfavorite', 0, 0, 1, 2, 0, 0, 0, 0, '', '', '', 4, ''); + +INSERT INTO pre_common_nav VALUES ('', '0', '搜索', '', 'search.php?mod=forum', 'search', 0, 0, 1, 1, 0, 0, 0, 0, '', '', '', 5, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '公告', '', 'forum.php?mod=announcement', 'announcement', 0, 0, 1, 1, 0, 0, 0, 0, '', '', '', 5, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '导读', '', 'forum.php?mod=guide&view=newthread', 'guide', 0, 0, 0, 1, 0, 0, 0, 0, '', '', '', 5, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '资讯', '', 'portal.php?mod=list&catid=1', 'portal', 0, 0, 0, 1, 0, 0, 0, 0, '', '', '', 5, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '日志', '', 'home.php?mod=space&do=blog', 'blog', 0, 0, 0, 1, 0, 0, 0, 0, '', '', '', 5, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '分享', '', 'home.php?mod=space&do=share', 'share', 0, 0, 0, 1, 0, 0, 0, 0, '', '', '', 5, ''); +INSERT INTO pre_common_nav VALUES ('', '0', '排行榜', '', 'misc.php?mod=ranklist', 'ranklist', 0, 0, 0, 1, 0, 0, 0, 0, '', '', '', 5, ''); + +-- [/update_nav] + +INSERT INTO pre_common_setting VALUES ('accessemail',''); +INSERT INTO pre_common_setting VALUES ('accountguard','a:3:{s:12:\"loginpwcheck\";s:1:\"0\";s:14:\"loginoutofdate\";s:1:\"0\";s:17:\"loginoutofdatenum\";s:0:\"\";}'); +INSERT INTO pre_common_setting VALUES ('activitycredit','1'); +INSERT INTO pre_common_setting VALUES ('activityextnum','0'); +INSERT INTO pre_common_setting VALUES ('activityfield',''); +INSERT INTO pre_common_setting VALUES ('activityforumid','0'); +INSERT INTO pre_common_setting VALUES ('activitypp','8'); +INSERT INTO pre_common_setting VALUES ('activitytype','朋友聚会\r\n出外郊游\r\n自驾出行\r\n公益活动\r\n线上活动'); +INSERT INTO pre_common_setting VALUES ('adminemail',''); +INSERT INTO pre_common_setting VALUES ('adminipaccess',''); +INSERT INTO pre_common_setting VALUES ('adminnotifytypes','verifythread,verifypost,verifyuser,verifyblog,verifydoing,verifypic,verifyshare,verifycommontes,verifyrecycle,verifyrecyclepost,verifyarticle,verifyacommont,verifymedal,verify_1,verify_2,verify_3,verify_4,verify_5,verify_6,verify_7'); +INSERT INTO pre_common_setting VALUES ('advexpiration','a:3:{s:5:\"allow\";b:0;s:3:\"day\";s:0:\"\";s:5:\"users\";s:0:\"\";}'); +INSERT INTO pre_common_setting VALUES ('advtype','a:1:{i:0;s:6:\"custom\";}'); +INSERT INTO pre_common_setting VALUES ('albumcategoryrequired','0'); +INSERT INTO pre_common_setting VALUES ('albumcategorystat','0'); +INSERT INTO pre_common_setting VALUES ('albumstatus','0'); +INSERT INTO pre_common_setting VALUES ('allowattachurl','0'); +INSERT INTO pre_common_setting VALUES ('allowdomain','0'); +INSERT INTO pre_common_setting VALUES ('alloweditpost','0'); +INSERT INTO pre_common_setting VALUES ('allowfastreply','0'); +INSERT INTO pre_common_setting VALUES ('allowgroupdomain', '0'); +INSERT INTO pre_common_setting VALUES ('allowmoderatingthread', '1'); +INSERT INTO pre_common_setting VALUES ('allowpostcomment','a:2:{i:0;s:1:\"1\";i:1;s:1:\"2\";}'); +INSERT INTO pre_common_setting VALUES ('allowquickviewprofile', '1'); +INSERT INTO pre_common_setting VALUES ('allowreplybg','0'); +INSERT INTO pre_common_setting VALUES ('allowspacedomain', '0'); +INSERT INTO pre_common_setting VALUES ('allowswitcheditor','1'); +INSERT INTO pre_common_setting VALUES ('allowthreadplugin',''); +INSERT INTO pre_common_setting VALUES ('allowviewuserthread','a:2:{s:5:\"allow\";s:1:\"1\";s:4:\"fids\";a:1:{i:0;s:0:\"\";}}'); +INSERT INTO pre_common_setting VALUES ('allowwidthauto', '0'); +INSERT INTO pre_common_setting VALUES ('anonymoustext','匿名'); +INSERT INTO pre_common_setting VALUES ('antitheft','a:2:{s:5:"allow";i:0;s:3:"max";i:200;}'); +INSERT INTO pre_common_setting VALUES ('archiver','1'); +INSERT INTO pre_common_setting VALUES ('archiverredirect','0'); +INSERT INTO pre_common_setting VALUES ('attachbanperiods',''); +INSERT INTO pre_common_setting VALUES ('attachdir','./data/attachment'); +INSERT INTO pre_common_setting VALUES ('attachexpire',''); +INSERT INTO pre_common_setting VALUES ('attachimgpost','1'); +INSERT INTO pre_common_setting VALUES ('attachrefcheck','0'); +INSERT INTO pre_common_setting VALUES ('attachsave','3'); +INSERT INTO pre_common_setting VALUES ('attachurl','data/attachment'); +INSERT INTO pre_common_setting VALUES ('at_anyone','0'); +INSERT INTO pre_common_setting VALUES ('authkey','9f50c9zryqZt5FYA'); +INSERT INTO pre_common_setting VALUES ('authoronleft','1'); +INSERT INTO pre_common_setting VALUES ('autoidselect','0'); +INSERT INTO pre_common_setting VALUES ('avatarmethod','0'); +INSERT INTO pre_common_setting VALUES ('backupdir','f027b6'); +INSERT INTO pre_common_setting VALUES ('bannedmessages','1'); +INSERT INTO pre_common_setting VALUES ('bbclosed',''); +INSERT INTO pre_common_setting VALUES ('bbname','Discuz! Board'); +INSERT INTO pre_common_setting VALUES ('bbrules','0'); +INSERT INTO pre_common_setting VALUES ('bbrulesforce','0'); +INSERT INTO pre_common_setting VALUES ('bbrulestxt',''); +INSERT INTO pre_common_setting VALUES ('bdaystatus','0'); +INSERT INTO pre_common_setting VALUES ('binddomains','a:0:{}'); +INSERT INTO pre_common_setting VALUES ('blockmaxaggregationitem','20000'); +INSERT INTO pre_common_setting VALUES ('blogcategoryrequired','0'); +INSERT INTO pre_common_setting VALUES ('blogcategorystat','0'); +INSERT INTO pre_common_setting VALUES ('blogrecyclebin','0'); +INSERT INTO pre_common_setting VALUES ('blogstatus','0'); +INSERT INTO pre_common_setting VALUES ('boardlicensed','0'); +INSERT INTO pre_common_setting VALUES ('cacheindexlife','0'); +INSERT INTO pre_common_setting VALUES ('cachethreaddir','data/threadcache'); +INSERT INTO pre_common_setting VALUES ('cachethreadlife','0'); +INSERT INTO pre_common_setting VALUES ('card', 'a:1:{s:4:"open";s:1:"0";}'); +INSERT INTO pre_common_setting VALUES ('censoremail',''); +INSERT INTO pre_common_setting VALUES ('censoruser',''); +INSERT INTO pre_common_setting VALUES ('change_email','0'); +INSERT INTO pre_common_setting VALUES ('change_secmobile','0'); +INSERT INTO pre_common_setting VALUES ('chatpmrefreshtime','8'); +INSERT INTO pre_common_setting VALUES ('closedallowactivation','0'); +INSERT INTO pre_common_setting VALUES ('closedreason',''); +INSERT INTO pre_common_setting VALUES ('closeforumorderby','0'); +INSERT INTO pre_common_setting VALUES ('close_leftinfo','0'); +INSERT INTO pre_common_setting VALUES ('close_leftinfo_userctrl','0'); +INSERT INTO pre_common_setting VALUES ('collectionnum', '10'); +INSERT INTO pre_common_setting VALUES ('collectionrecommend','a:3:{s:5:\"ctids\";N;s:13:\"autorecommend\";i:0;s:14:\"adminrecommend\";i:0;}'); +INSERT INTO pre_common_setting VALUES ('collectionrecommendnum','0'); +INSERT INTO pre_common_setting VALUES ('collectionstatus','0'); +INSERT INTO pre_common_setting VALUES ('collectionteamworkernum', '3'); +INSERT INTO pre_common_setting VALUES ('commentfirstpost','1'); +INSERT INTO pre_common_setting VALUES ('commentitem',' '); +INSERT INTO pre_common_setting VALUES ('commentnumber','5'); +INSERT INTO pre_common_setting VALUES ('commentpostself','0'); +INSERT INTO pre_common_setting VALUES ('connect', 'a:19:{s:5:"allow";s:1:"1";s:4:"feed";a:2:{s:5:"allow";s:1:"1";s:5:"group";s:1:"0";}s:1:"t";a:2:{s:5:"allow";s:1:"1";s:5:"group";s:1:"0";}s:10:"like_allow";s:1:"1";s:7:"like_qq";s:0:"";s:10:"turl_allow";s:1:"1";s:7:"turl_qq";s:0:"";s:8:"like_url";s:0:"";s:17:"register_birthday";s:1:"0";s:15:"register_gender";s:1:"0";s:17:"register_uinlimit";s:0:"";s:21:"register_rewardcredit";s:1:"1";s:18:"register_addcredit";s:0:"";s:16:"register_groupid";s:1:"0";s:18:"register_regverify";s:1:"1";s:15:"register_invite";s:1:"0";s:10:"newbiespan";s:0:"";s:9:"turl_code";s:0:"";s:13:"mblog_app_key";s:3:"abc";}'); +INSERT INTO pre_common_setting VALUES ('creditnotice','1'); +INSERT INTO pre_common_setting VALUES ('creditsformula','posts+digestposts*5+extcredits1*2+extcredits2+extcredits3'); +INSERT INTO pre_common_setting VALUES ('creditsformulaexp','总积分=发帖数+精华帖数*5+威望*2+金钱+贡献'); +INSERT INTO pre_common_setting VALUES ('creditsnotify',''); +INSERT INTO pre_common_setting VALUES ('creditspolicy','a:12:{s:4:\"post\";a:0:{}s:5:\"reply\";a:0:{}s:6:\"digest\";a:1:{i:1;i:10;}s:10:\"postattach\";a:0:{}s:9:\"getattach\";a:0:{}s:6:\"sendpm\";a:0:{}s:6:\"search\";a:0:{}s:15:\"promotion_visit\";a:0:{}s:18:\"promotion_register\";a:0:{}s:13:\"tradefinished\";a:0:{}s:8:\"votepoll\";a:0:{}s:10:\"lowerlimit\";a:0:{}}'); +INSERT INTO pre_common_setting VALUES ('creditspolicymobile','0'); +INSERT INTO pre_common_setting VALUES ('creditstax','0.2'); +INSERT INTO pre_common_setting VALUES ('creditstrans','2,0,0,0,0,0,0'); +INSERT INTO pre_common_setting VALUES ('csspathv','data/cache/'); +INSERT INTO pre_common_setting VALUES ('customauthorinfo','a:1:{i:0;a:10:{s:5:\"posts\";a:2:{s:5:\"order\";s:0:\"\";s:4:\"menu\";s:1:\"1\";}s:7:\"threads\";a:1:{s:5:\"order\";s:0:\"\";}s:6:\"digest\";a:2:{s:5:\"order\";s:0:\"\";s:4:\"menu\";s:1:\"1\";}s:7:\"credits\";a:2:{s:5:\"order\";s:0:\"\";s:4:\"menu\";s:1:\"1\";}s:8:\"readperm\";a:2:{s:5:\"order\";s:0:\"\";s:4:\"menu\";s:1:\"1\";}s:7:\"regtime\";a:2:{s:5:\"order\";s:0:\"\";s:4:\"menu\";s:1:\"1\";}s:8:\"lastdate\";a:2:{s:5:\"order\";s:0:\"\";s:4:\"menu\";s:1:\"1\";}s:11:\"extcredits1\";a:1:{s:5:\"order\";s:0:\"\";}s:11:\"extcredits2\";a:1:{s:5:\"order\";s:0:\"\";}s:11:\"extcredits3\";a:1:{s:5:\"order\";s:0:\"\";}}}'); +INSERT INTO pre_common_setting VALUES ('custombackup',''); +INSERT INTO pre_common_setting VALUES ('darkroom','1'); +INSERT INTO pre_common_setting VALUES ('dateconvert','1'); +INSERT INTO pre_common_setting VALUES ('dateformat','Y-n-j'); +INSERT INTO pre_common_setting VALUES ('debateforumid','0'); +INSERT INTO pre_common_setting VALUES ('debug','1'); +INSERT INTO pre_common_setting VALUES ('defaulteditormode','1'); +INSERT INTO pre_common_setting VALUES ('defaultindex', 'forum.php'); +INSERT INTO pre_common_setting VALUES ('delayviewcount','0'); +INSERT INTO pre_common_setting VALUES ('deletereason',''); +INSERT INTO pre_common_setting VALUES ('disableipnotice','0'); +INSERT INTO pre_common_setting VALUES ('disallowfloat','a:1:{i:3;s:9:\"newthread\";}'); +INSERT INTO pre_common_setting VALUES ('disfixedavatar','0'); +INSERT INTO pre_common_setting VALUES ('disfixednv_forumdisplay','0'); +INSERT INTO pre_common_setting VALUES ('disfixednv_forumindex','0'); +INSERT INTO pre_common_setting VALUES ('disfixednv_viewthread','0'); +INSERT INTO pre_common_setting VALUES ('doingstatus','0'); +INSERT INTO pre_common_setting VALUES ('domain', 'a:5:{s:12:"defaultindex";s:9:"forum.php";s:10:"holddomain";s:18:"www|*blog*|*space*";s:4:"list";a:0:{}s:3:"app";a:5:{s:6:"portal";s:0:"";s:5:"forum";s:0:"";s:5:"group";s:0:"";s:4:"home";s:0:"";s:7:"default";s:0:"";}s:4:"root";a:5:{s:4:"home";s:0:"";s:5:"group";s:0:"";s:5:"forum";s:0:"";s:5:"topic";s:0:"";s:7:"channel";s:0:"";}}'); +INSERT INTO pre_common_setting VALUES ('domainroot',''); +INSERT INTO pre_common_setting VALUES ('domainwhitelist',''); +INSERT INTO pre_common_setting VALUES ('doublee','1'); +INSERT INTO pre_common_setting VALUES ('dupkarmarate','0'); +INSERT INTO pre_common_setting VALUES ('dynavt','1'); +INSERT INTO pre_common_setting VALUES ('ec_account',''); +INSERT INTO pre_common_setting VALUES ('ec_contract',''); +INSERT INTO pre_common_setting VALUES ('ec_credit','a:2:{s:18:\"maxcreditspermonth\";i:6;s:4:\"rank\";a:15:{i:1;i:4;i:2;i:11;i:3;i:41;i:4;i:91;i:5;i:151;i:6;i:251;i:7;i:501;i:8;i:1001;i:9;i:2001;i:10;i:5001;i:11;i:10001;i:12;i:20001;i:13;i:50001;i:14;i:100001;i:15;i:200001;}}'); +INSERT INTO pre_common_setting VALUES ('ec_maxcredits','1000'); +INSERT INTO pre_common_setting VALUES ('ec_maxcreditspermonth','0'); +INSERT INTO pre_common_setting VALUES ('ec_mincredits','0'); +INSERT INTO pre_common_setting VALUES ('ec_ratio','0'); +INSERT INTO pre_common_setting VALUES ('editedby','1'); +INSERT INTO pre_common_setting VALUES ('editoroptions','6'); +INSERT INTO pre_common_setting VALUES ('editperdel', '1'); +INSERT INTO pre_common_setting VALUES ('edittimelimit',''); +INSERT INTO pre_common_setting VALUES ('exchangemincredits','100'); +INSERT INTO pre_common_setting VALUES ('extcredits',''); +INSERT INTO pre_common_setting VALUES ('fastpost','1'); +INSERT INTO pre_common_setting VALUES ('fastsmiley', 'a:1:{i:1;a:16:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:8;s:1:\"5\";i:9;s:1:\"6\";i:10;s:1:\"7\";i:11;s:1:\"8\";i:12;s:1:\"9\";i:13;s:2:\"10\";i:14;s:2:\"11\";i:15;s:2:\"12\";i:16;s:2:\"13\";i:17;s:2:\"14\";i:18;s:2:\"15\";i:19;s:2:\"16\";}}'); +INSERT INTO pre_common_setting VALUES ('fastsmilies','1'); +INSERT INTO pre_common_setting VALUES ('favoritestatus','0'); +INSERT INTO pre_common_setting VALUES ('feedday','7'); +INSERT INTO pre_common_setting VALUES ('feedhotday','2'); +INSERT INTO pre_common_setting VALUES ('feedhotmin','3'); +INSERT INTO pre_common_setting VALUES ('feedhotnum','3'); +INSERT INTO pre_common_setting VALUES ('feedmaxnum','100'); +INSERT INTO pre_common_setting VALUES ('feedstatus','0'); +INSERT INTO pre_common_setting VALUES ('feedtargetblank','1'); +INSERT INTO pre_common_setting VALUES ('filterednovote','1'); +INSERT INTO pre_common_setting VALUES ('floodctrl','15'); +INSERT INTO pre_common_setting VALUES ('focus', 'a:0:{}'); +INSERT INTO pre_common_setting VALUES ('followaddnotice', '0'); +INSERT INTO pre_common_setting VALUES ('followretainday', '7'); +INSERT INTO pre_common_setting VALUES ('followstatus','0'); +INSERT INTO pre_common_setting VALUES ('forumallowside','0'); +INSERT INTO pre_common_setting VALUES ('forumdisplaythreadpreview','1'); +INSERT INTO pre_common_setting VALUES ('forumdomains','a:0:{}'); +INSERT INTO pre_common_setting VALUES ('forumjump','0'); +INSERT INTO pre_common_setting VALUES ('forumlinkstatus','1'); +INSERT INTO pre_common_setting VALUES ('forumpicstyle','a:3:{s:10:\"thumbwidth\";i:0;s:11:\"thumbheight\";i:0;s:8:\"thumbnum\";i:0;}'); +INSERT INTO pre_common_setting VALUES ('forumseparator','1'); +INSERT INTO pre_common_setting VALUES ('forumstatus','1'); +INSERT INTO pre_common_setting VALUES ('forumstickthreads','a:0:{}'); +INSERT INTO pre_common_setting VALUES ('frameon','0'); +INSERT INTO pre_common_setting VALUES ('framewidth','180'); +INSERT INTO pre_common_setting VALUES ('friendgroupnum','8'); +INSERT INTO pre_common_setting VALUES ('friendstatus','0'); +INSERT INTO pre_common_setting VALUES ('ftp','a:10:{s:2:\"on\";s:1:\"0\";s:3:\"ssl\";s:1:\"0\";s:4:\"host\";s:0:\"\";s:4:\"port\";s:2:\"21\";s:8:\"username\";s:0:\"\";s:8:\"password\";s:0:\"\";s:9:\"attachdir\";s:1:\".\";s:9:\"attachurl\";s:0:\"\";s:7:\"hideurl\";s:1:\"0\";s:7:\"timeout\";s:1:\"0\";}'); +INSERT INTO pre_common_setting VALUES ('globalstick','1'); +INSERT INTO pre_common_setting VALUES ('grid','a:8:{s:8:"showgrid";s:1:"0";s:8:"gridtype";s:1:"0";s:8:"textleng";s:2:"30";s:4:"fids";a:1:{i:0;i:0;}s:9:"highlight";s:1:"1";s:11:"targetblank";s:1:"1";s:8:"showtips";s:1:"1";s:9:"cachelife";s:3:"600";}'); +INSERT INTO pre_common_setting VALUES ('groupmod','0'); +INSERT INTO pre_common_setting VALUES ('groupstatus','0'); +INSERT INTO pre_common_setting VALUES ('group_admingroupids','a:1:{i:1;s:1:\"1\";}'); +INSERT INTO pre_common_setting VALUES ('group_allowfeed','1'); +INSERT INTO pre_common_setting VALUES ('group_description',''); +INSERT INTO pre_common_setting VALUES ('group_imgsizelimit','512'); +INSERT INTO pre_common_setting VALUES ('group_keywords',''); +INSERT INTO pre_common_setting VALUES ('group_recommend','a:0:{}'); +INSERT INTO pre_common_setting VALUES ('group_userperm','a:21:{s:16:\"allowstickthread\";s:1:\"1\";s:15:\"allowbumpthread\";s:1:\"1\";s:20:\"allowhighlightthread\";s:1:\"1\";s:16:\"allowstampthread\";s:1:\"1\";s:16:\"allowclosethread\";s:1:\"1\";s:16:\"allowmergethread\";s:1:\"1\";s:16:\"allowsplitthread\";s:1:\"1\";s:17:\"allowrepairthread\";s:1:\"1\";s:11:\"allowrefund\";s:1:\"1\";s:13:\"alloweditpoll\";s:1:\"1\";s:17:\"allowremovereward\";s:1:\"1\";s:17:\"alloweditactivity\";s:1:\"1\";s:14:\"allowedittrade\";s:1:\"1\";s:17:\"allowdigestthread\";s:1:\"3\";s:13:\"alloweditpost\";s:1:\"1\";s:13:\"allowwarnpost\";s:1:\"1\";s:12:\"allowbanpost\";s:1:\"1\";s:12:\"allowdelpost\";s:1:\"1\";s:13:\"allowupbanner\";s:1:\"1\";s:15:\"disablepostctrl\";s:1:\"0\";s:11:\"allowviewip\";s:1:\"1\";s:15:\"allowlivethread\";s:1:\"1\";}'); +INSERT INTO pre_common_setting VALUES ('guesttipsinthread','a:2:{s:4:\"flag\";i:0;s:4:\"text\";s:0:\"\";}'); +INSERT INTO pre_common_setting VALUES ('guestviewthumb','a:3:{s:4:\"flag\";i:0;s:5:\"width\";i:100;s:6:\"height\";i:100;}'); +INSERT INTO pre_common_setting VALUES ('guide','a:2:{s:5:\"hotdt\";i:604800;s:8:\"digestdt\";i:604800;}'); +INSERT INTO pre_common_setting VALUES ('guidestatus','0'); +INSERT INTO pre_common_setting VALUES ('heatthread','a:5:{s:4:\"type\";s:1:\"2\";s:5:\"reply\";i:5;s:9:\"recommend\";i:3;s:6:\"period\";s:2:\"15\";s:10:\"iconlevels\";s:10:\"50,100,200\";}'); +INSERT INTO pre_common_setting VALUES ('hideattachdown','0'); +INSERT INTO pre_common_setting VALUES ('hideattachtips','0'); +INSERT INTO pre_common_setting VALUES ('hidefilteredpost','0'); +INSERT INTO pre_common_setting VALUES ('hideprivate','1'); +INSERT INTO pre_common_setting VALUES ('historyposts','0 7'); +INSERT INTO pre_common_setting VALUES ('holddomain', 'www|*blog*|*space*|*bbs*'); +INSERT INTO pre_common_setting VALUES ('homepagestyle','0'); +INSERT INTO pre_common_setting VALUES ('homestatus','0'); +INSERT INTO pre_common_setting VALUES ('homestyle','0'); +INSERT INTO pre_common_setting VALUES ('hottopic','10'); +INSERT INTO pre_common_setting VALUES ('icp',''); +INSERT INTO pre_common_setting VALUES ('imageimpath',''); +INSERT INTO pre_common_setting VALUES ('imagelib','0'); +INSERT INTO pre_common_setting VALUES ('imagelistthumb','0'); +INSERT INTO pre_common_setting VALUES ('imagemaxwidth','600'); +INSERT INTO pre_common_setting VALUES ('indexhot','a:7:{s:6:\"status\";s:1:\"0\";s:5:\"limit\";s:2:\"10\";s:4:\"days\";s:1:\"7\";s:10:\"expiration\";s:3:\"900\";s:10:\"messagecut\";s:3:\"200\";s:5:\"width\";i:100;s:6:\"height\";i:70;}'); +INSERT INTO pre_common_setting VALUES ('indextype','classics'); +INSERT INTO pre_common_setting VALUES ('infosidestatus','0'); +INSERT INTO pre_common_setting VALUES ('initcredits','0,0,0,0,0,0,0,0,0'); +INSERT INTO pre_common_setting VALUES ('inviteconfig',''); +INSERT INTO pre_common_setting VALUES ('ipaccess',''); +INSERT INTO pre_common_setting VALUES ('ipregctrl',''); +INSERT INTO pre_common_setting VALUES ('ipregctrltime','72'); +INSERT INTO pre_common_setting VALUES ('ipverifywhite',''); +INSERT INTO pre_common_setting VALUES ('jscachelife','1800'); +INSERT INTO pre_common_setting VALUES ('jsdateformat',''); +INSERT INTO pre_common_setting VALUES ('jspath','data/cache/'); +INSERT INTO pre_common_setting VALUES ('jsrefdomains',''); +INSERT INTO pre_common_setting VALUES ('jsstatus','0'); +INSERT INTO pre_common_setting VALUES ('jswizard',''); +INSERT INTO pre_common_setting VALUES ('karmaratelimit','0'); +INSERT INTO pre_common_setting VALUES ('lazyload','0'); +INSERT INTO pre_common_setting VALUES ('leftsideopen', '0'); +INSERT INTO pre_common_setting VALUES ('leftsidewidth', '0'); +INSERT INTO pre_common_setting VALUES ('losslessdel','365'); +INSERT INTO pre_common_setting VALUES ('magicdiscount','85'); +INSERT INTO pre_common_setting VALUES ('magicmarket','1'); +INSERT INTO pre_common_setting VALUES ('magicstatus','0'); +INSERT INTO pre_common_setting VALUES ('mail','a:10:{s:8:\"mailsend\";s:1:\"1\";s:6:\"server\";s:13:\"smtp.21cn.com\";s:4:\"port\";s:2:\"25\";s:4:\"auth\";s:1:\"1\";s:4:\"from\";s:26:\"Discuz \";s:13:\"auth_username\";s:17:\"username@21cn.com\";s:13:\"auth_password\";s:8:\"password\";s:13:\"maildelimiter\";s:1:\"0\";s:12:\"mailusername\";s:1:\"1\";s:15:\"sendmail_silent\";s:1:\"1\";}'); +INSERT INTO pre_common_setting VALUES ('maxavatarpixel','120'); +INSERT INTO pre_common_setting VALUES ('maxavatarsize','20000'); +INSERT INTO pre_common_setting VALUES ('maxbdays','0'); +INSERT INTO pre_common_setting VALUES ('maxchargespan','0'); +INSERT INTO pre_common_setting VALUES ('maxfavorites','100'); +INSERT INTO pre_common_setting VALUES ('maxincperthread','0'); +INSERT INTO pre_common_setting VALUES ('maxmagicprice','50'); +INSERT INTO pre_common_setting VALUES ('maxmodworksmonths','3'); +INSERT INTO pre_common_setting VALUES ('maxonlinelist','0'); +INSERT INTO pre_common_setting VALUES ('maxonlines','5000'); +INSERT INTO pre_common_setting VALUES ('maxpage','100'); +INSERT INTO pre_common_setting VALUES ('maxpolloptions','20'); +INSERT INTO pre_common_setting VALUES ('maxpostsize','10000'); +INSERT INTO pre_common_setting VALUES ('maxsigrows','100'); +INSERT INTO pre_common_setting VALUES ('maxsmilies','10'); +INSERT INTO pre_common_setting VALUES ('maxsubjectsize','80'); +INSERT INTO pre_common_setting VALUES ('medalstatus','0'); +INSERT INTO pre_common_setting VALUES ('membermaxpages','100'); +INSERT INTO pre_common_setting VALUES ('memberperpage','25'); +INSERT INTO pre_common_setting VALUES ('memliststatus','1'); +INSERT INTO pre_common_setting VALUES ('memory', 'a:16:{s:13:"common_member";i:0;s:19:"common_member_count";i:0;s:20:"common_member_status";i:0;s:21:"common_member_profile";i:0;s:24:"common_member_field_home";i:0;s:25:"common_member_field_forum";i:0;s:20:"common_member_verify";i:0;s:12:"forum_thread";i:172800;s:25:"forum_thread_forumdisplay";i:300;s:23:"forum_collectionrelated";i:0;s:15:"forum_postcache";i:300;s:16:"forum_collection";i:300;s:11:"home_follow";i:86400;s:10:"forumindex";i:30;s:8:"diyblock";i:300;s:14:"diyblockoutput";i:30;}'); +INSERT INTO pre_common_setting VALUES ('minpostsize','10'); +INSERT INTO pre_common_setting VALUES ('minpostsize_mobile','0'); +INSERT INTO pre_common_setting VALUES ('minsubjectsize','1'); +INSERT INTO pre_common_setting VALUES ('mobile','a:13:{s:11:\"allowmobile\";i:1;s:9:\"allowmnew\";i:0;s:13:\"mobileforward\";i:1;s:14:\"mobileregister\";i:1;s:13:\"mobileseccode\";i:0;s:16:\"mobilesimpletype\";i:0;s:15:\"mobilecachetime\";i:0;s:14:\"mobilecomefrom\";s:0:\"\";s:13:\"mobilepreview\";i:0;s:6:\"legacy\";i:1;s:3:\"wml\";i:0;s:6:\"portal\";a:1:{s:6:\"catnav\";i:0;}s:5:\"forum\";a:6:{s:5:\"index\";i:0;s:8:\"statshow\";i:0;s:13:\"displayorder3\";i:1;s:12:\"topicperpage\";i:20;s:11:\"postperpage\";i:10;s:9:\"forumview\";i:0;}}'); +INSERT INTO pre_common_setting VALUES ('modasban','1'); +INSERT INTO pre_common_setting VALUES ('moddetail','0'); +INSERT INTO pre_common_setting VALUES ('moddisplay','flat'); +INSERT INTO pre_common_setting VALUES ('modratelimit','0'); +INSERT INTO pre_common_setting VALUES ('modreasons','广告/SPAM\r\n恶意灌水\r\n违规内容\r\n文不对题\r\n重复发帖\r\n\r\n我很赞同\r\n精品文章\r\n原创内容'); +INSERT INTO pre_common_setting VALUES ('modreasons_public','0'); +INSERT INTO pre_common_setting VALUES ('moduser_public','0'); +INSERT INTO pre_common_setting VALUES ('modworkstatus','1'); +INSERT INTO pre_common_setting VALUES ('mps',''); +INSERT INTO pre_common_setting VALUES ('msgforward','a:3:{s:11:\"refreshtime\";i:2;s:5:\"quick\";i:1;s:8:\"messages\";a:14:{i:0;s:19:\"thread_poll_succeed\";i:1;s:19:\"thread_rate_succeed\";i:2;s:23:\"usergroups_join_succeed\";i:3;s:23:\"usergroups_exit_succeed\";i:4;s:25:\"usergroups_update_succeed\";i:5;s:20:\"buddy_update_succeed\";i:6;s:17:\"post_edit_succeed\";i:7;s:18:\"post_reply_succeed\";i:8;s:24:\"post_edit_delete_succeed\";i:9;s:22:\"post_newthread_succeed\";i:10;s:13:\"admin_succeed\";i:11;s:17:\"pm_delete_succeed\";i:12;s:15:\"search_redirect\";i:13;s:10:\"do_success\";}}'); +INSERT INTO pre_common_setting VALUES ('msn',''); +INSERT INTO pre_common_setting VALUES ('my_closecheckupdate',''); +INSERT INTO pre_common_setting VALUES ('my_ip',''); +INSERT INTO pre_common_setting VALUES ('my_search_data',''); +INSERT INTO pre_common_setting VALUES ('my_siteid',''); +INSERT INTO pre_common_setting VALUES ('my_sitekey',''); +INSERT INTO pre_common_setting VALUES ('navsubhover','0'); +INSERT INTO pre_common_setting VALUES ('need_avatar','0'); +INSERT INTO pre_common_setting VALUES ('need_email','0'); +INSERT INTO pre_common_setting VALUES ('need_secmobile','0'); +INSERT INTO pre_common_setting VALUES ('networkpage','0'); +INSERT INTO pre_common_setting VALUES ('newbie', '20'); +INSERT INTO pre_common_setting VALUES ('newbiespan','2'); +INSERT INTO pre_common_setting VALUES ('newbietasks',''); +INSERT INTO pre_common_setting VALUES ('newbietaskupdate',''); +INSERT INTO pre_common_setting VALUES ('newsletter',''); +INSERT INTO pre_common_setting VALUES ('newspaceavatar','0'); +INSERT INTO pre_common_setting VALUES ('nocacheheaders','0'); +INSERT INTO pre_common_setting VALUES ('nofilteredpost','0'); +INSERT INTO pre_common_setting VALUES ('nsprofiles','1'); +INSERT INTO pre_common_setting VALUES ('numbercard','a:1:{s:3:"row";a:3:{i:1;s:7:"threads";i:2;s:5:"posts";i:3;s:7:"credits";}}'); +INSERT INTO pre_common_setting VALUES ('oltimespan','10'); +INSERT INTO pre_common_setting VALUES ('onlineguestsmultiple','10'); +INSERT INTO pre_common_setting VALUES ('onlinehold','15'); +INSERT INTO pre_common_setting VALUES ('onlinerecord','7 1269749404'); +INSERT INTO pre_common_setting VALUES ('onlyacceptfriendpm','0'); +INSERT INTO pre_common_setting VALUES ('optimizeviews','0'); +INSERT INTO pre_common_setting VALUES ('outlandverify', '0'); +INSERT INTO pre_common_setting VALUES ('pmreportuser','1'); +INSERT INTO pre_common_setting VALUES ('pollforumid','0'); +INSERT INTO pre_common_setting VALUES ('portalarticleimgthumbclosed','0'); +INSERT INTO pre_common_setting VALUES ('portalstatus','0'); +INSERT INTO pre_common_setting VALUES ('postappend','0'); +INSERT INTO pre_common_setting VALUES ('postbanperiods',''); +INSERT INTO pre_common_setting VALUES ('postignorearea',''); +INSERT INTO pre_common_setting VALUES ('postignoreip',''); +INSERT INTO pre_common_setting VALUES ('postmodperiods',''); +INSERT INTO pre_common_setting VALUES ('postno','#'); +INSERT INTO pre_common_setting VALUES ('postnocustom',''); +INSERT INTO pre_common_setting VALUES ('postperpage','10'); +INSERT INTO pre_common_setting VALUES ('preventrefresh','1'); +INSERT INTO pre_common_setting VALUES ('privacy','a:2:{s:4:\"view\";a:8:{s:5:\"index\";i:0;s:6:\"friend\";i:0;s:4:\"wall\";i:0;s:4:\"home\";i:0;s:5:\"doing\";i:0;s:4:\"blog\";i:0;s:5:\"album\";i:0;s:5:\"share\";i:0;}s:4:\"feed\";a:5:{s:5:\"doing\";i:1;s:4:\"blog\";i:1;s:6:\"upload\";i:1;s:4:\"poll\";i:1;s:9:\"newthread\";i:1;}}'); +INSERT INTO pre_common_setting VALUES ('profilegroup', 'a:0:{}'); +INSERT INTO pre_common_setting VALUES ('profilegroupnew',''); +INSERT INTO pre_common_setting VALUES ('profilehistory','0'); +INSERT INTO pre_common_setting VALUES ('pvfrequence','60'); +INSERT INTO pre_common_setting VALUES ('pwlength','6'); +INSERT INTO pre_common_setting VALUES ('qihoo','a:9:{s:6:\"status\";i:0;s:9:\"searchbox\";i:6;s:7:\"summary\";i:1;s:6:\"jammer\";i:1;s:9:\"maxtopics\";i:10;s:8:\"keywords\";s:0:\"\";s:10:\"adminemail\";s:0:\"\";s:8:\"validity\";i:1;s:14:\"relatedthreads\";a:6:{s:6:\"bbsnum\";i:0;s:6:\"webnum\";i:0;s:4:\"type\";a:3:{s:4:\"blog\";s:4:\"blog\";s:4:\"news\";s:4:\"news\";s:3:\"bbs\";s:3:\"bbs\";}s:6:\"banurl\";s:0:\"\";s:8:\"position\";i:1;s:8:\"validity\";i:1;}}'); +INSERT INTO pre_common_setting VALUES ('ranklist', 'a:12:{s:6:"status";s:1:"1";s:10:"membershow";s:1:"1";s:10:"cache_time";s:1:"1";s:12:"index_select";s:8:"thisweek";s:6:"member";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}s:6:"thread";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}s:4:"blog";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}s:4:"poll";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}s:8:"activity";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}s:7:"picture";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}s:5:"forum";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}s:5:"group";a:3:{s:9:"available";s:1:"1";s:10:"cache_time";s:1:"5";s:8:"show_num";s:2:"20";}}'); +INSERT INTO pre_common_setting VALUES ('rankliststatus','0'); +INSERT INTO pre_common_setting VALUES ('ratelogon','1'); +INSERT INTO pre_common_setting VALUES ('ratelogrecord','20'); +INSERT INTO pre_common_setting VALUES ('realname','0'); +INSERT INTO pre_common_setting VALUES ('recommendthread','a:6:{s:6:\"status\";s:1:\"0\";s:7:\"addtext\";s:0:\"\";s:12:\"subtracttext\";s:0:\"\";s:8:\"daycount\";s:1:\"0\";s:9:\"ownthread\";s:1:\"0\";s:10:\"iconlevels\";s:0:\"\";}'); +INSERT INTO pre_common_setting VALUES ('regclosemessage',''); +INSERT INTO pre_common_setting VALUES ('regconnect', '1'); +INSERT INTO pre_common_setting VALUES ('regctrl','0'); +INSERT INTO pre_common_setting VALUES ('regfloodctrl','0'); +INSERT INTO pre_common_setting VALUES ('reginput','a:4:{s:8:\"username\";s:8:\"username\";s:8:\"password\";s:8:\"password\";s:9:\"password2\";s:9:\"password2\";s:5:\"email\";s:5:\"email\";}'); +INSERT INTO pre_common_setting VALUES ('reglinkname','立即注册'); +INSERT INTO pre_common_setting VALUES ('regname','register'); +INSERT INTO pre_common_setting VALUES ('regstatus','1'); +INSERT INTO pre_common_setting VALUES ('regverify','0'); +INSERT INTO pre_common_setting VALUES ('relatedlinkstatus','0'); +INSERT INTO pre_common_setting VALUES ('relatedtag',''); +INSERT INTO pre_common_setting VALUES ('relatenum','10'); +INSERT INTO pre_common_setting VALUES ('relatetime','60'); +INSERT INTO pre_common_setting VALUES ('repliesrank','0'); +INSERT INTO pre_common_setting VALUES ('report_receive', 'a:2:{s:9:"adminuser";a:1:{i:0;s:1:"1";}s:12:"supmoderator";N;}'); +INSERT INTO pre_common_setting VALUES ('report_reward','a:2:{s:3:\"min\";i:-3;s:3:\"max\";i:3;}'); +INSERT INTO pre_common_setting VALUES ('rewardexpiration','30'); +INSERT INTO pre_common_setting VALUES ('rewardforumid','0'); +INSERT INTO pre_common_setting VALUES ('rewritecompatible',''); +INSERT INTO pre_common_setting VALUES ('rewriteguest','0'); +INSERT INTO pre_common_setting VALUES ('rewritemobile','0'); +INSERT INTO pre_common_setting VALUES ('rewriterule',''); +INSERT INTO pre_common_setting VALUES ('rewritestatus','0'); +INSERT INTO pre_common_setting VALUES ('robotarchiver','0'); +INSERT INTO pre_common_setting VALUES ('rssstatus','1'); +INSERT INTO pre_common_setting VALUES ('rssttl','60'); +INSERT INTO pre_common_setting VALUES ('runwizard','1'); +INSERT INTO pre_common_setting VALUES ('search', 'a:6:{s:6:\"portal\";a:4:{s:6:\"status\";i:1;s:10:\"searchctrl\";i:10;s:6:\"maxspm\";i:10;s:16:\"maxsearchresults\";i:500;}s:5:\"forum\";a:4:{s:6:\"status\";i:1;s:10:\"searchctrl\";i:10;s:6:\"maxspm\";i:10;s:16:\"maxsearchresults\";i:500;}s:4:\"blog\";a:4:{s:6:\"status\";i:1;s:10:\"searchctrl\";i:10;s:6:\"maxspm\";i:10;s:16:\"maxsearchresults\";i:500;}s:5:\"album\";a:4:{s:6:\"status\";i:1;s:10:\"searchctrl\";i:10;s:6:\"maxspm\";i:10;s:16:\"maxsearchresults\";i:500;}s:5:\"group\";a:4:{s:6:\"status\";i:1;s:10:\"searchctrl\";i:10;s:6:\"maxspm\";i:10;s:16:\"maxsearchresults\";i:500;}s:10:\"collection\";a:4:{s:6:\"status\";i:1;s:10:\"searchctrl\";i:10;s:6:\"maxspm\";i:10;s:16:\"maxsearchresults\";i:500;}}'); +INSERT INTO pre_common_setting VALUES ('searchbanperiods',''); +INSERT INTO pre_common_setting VALUES ('seccodedata','a:16:{s:7:\"cloudip\";s:1:\"0\";s:4:\"rule\";a:5:{s:8:\"register\";a:3:{s:5:\"allow\";s:1:\"1\";s:8:\"numlimit\";s:0:\"\";s:9:\"timelimit\";s:2:\"60\";}s:5:\"login\";a:7:{s:5:\"allow\";s:1:\"1\";s:7:\"nolocal\";s:1:\"0\";s:8:\"pwsimple\";s:1:\"0\";s:7:\"pwerror\";s:1:\"0\";s:8:\"outofday\";s:0:\"\";s:8:\"numiptry\";s:0:\"\";s:9:\"timeiptry\";s:2:\"60\";}s:4:\"post\";a:5:{s:5:\"allow\";s:1:\"1\";s:8:\"numlimit\";s:0:\"\";s:9:\"timelimit\";s:2:\"60\";s:7:\"nplimit\";s:0:\"\";s:7:\"vplimit\";s:0:\"\";}s:8:\"password\";a:1:{s:5:\"allow\";s:1:\"1\";}s:4:\"card\";a:1:{s:5:\"allow\";s:1:\"1\";}}s:8:\"minposts\";s:0:\"\";s:4:\"type\";s:1:\"0\";s:5:\"width\";i:100;s:6:\"height\";i:30;s:7:\"scatter\";s:0:\"\";s:10:\"background\";s:1:\"0\";s:10:\"adulterate\";s:1:\"0\";s:3:\"ttf\";s:1:\"0\";s:5:\"angle\";s:1:\"0\";s:7:\"warping\";s:1:\"0\";s:5:\"color\";s:1:\"0\";s:4:\"size\";s:1:\"0\";s:6:\"shadow\";s:1:\"0\";s:8:\"animator\";s:1:\"0\";}'); +INSERT INTO pre_common_setting VALUES ('seccodestatus','16'); +INSERT INTO pre_common_setting VALUES ('seclevel','1'); +INSERT INTO pre_common_setting VALUES ('secmobilelogin','0'); +INSERT INTO pre_common_setting VALUES ('secqaa','a:2:{s:8:\"minposts\";s:1:\"1\";s:6:\"status\";i:0;}'); +INSERT INTO pre_common_setting VALUES ('sendmailday','0'); +INSERT INTO pre_common_setting VALUES ('sendregisterurl','0'); +INSERT INTO pre_common_setting VALUES ('seodescription',''); +INSERT INTO pre_common_setting VALUES ('seohead',''); +INSERT INTO pre_common_setting VALUES ('seokeywords',''); +INSERT INTO pre_common_setting VALUES ('seotitle',''); +INSERT INTO pre_common_setting VALUES ('sharestatus','0'); +INSERT INTO pre_common_setting VALUES ('showallfriendnum','8'); +INSERT INTO pre_common_setting VALUES ('showavatars','1'); +INSERT INTO pre_common_setting VALUES ('showemail',''); +INSERT INTO pre_common_setting VALUES ('showexif', '0'); +INSERT INTO pre_common_setting VALUES ('showfjump','1'); +INSERT INTO pre_common_setting VALUES ('showfollowcollection','8'); +INSERT INTO pre_common_setting VALUES ('showimages','1'); +INSERT INTO pre_common_setting VALUES ('shownewuser','0'); +INSERT INTO pre_common_setting VALUES ('showsettings','7'); +INSERT INTO pre_common_setting VALUES ('showsignatures','1'); +INSERT INTO pre_common_setting VALUES ('showsignin','1'); +INSERT INTO pre_common_setting VALUES ('showusercard','1'); +INSERT INTO pre_common_setting VALUES ('sigimgclick','0'); +INSERT INTO pre_common_setting VALUES ('sigviewcond','0'); +INSERT INTO pre_common_setting VALUES ('simplemode','0'); +INSERT INTO pre_common_setting VALUES ('sitemessage','a:5:{s:4:\"time\";s:1:\"3\";s:8:\"register\";s:0:\"\";s:5:\"login\";s:0:\"\";s:9:\"newthread\";s:0:\"\";s:5:\"reply\";s:0:\"\";}'); +INSERT INTO pre_common_setting VALUES ('sitename','Discuz! X'); +INSERT INTO pre_common_setting VALUES ('siteuniqueid','KD1Q6Vbd03ALJ34u'); +INSERT INTO pre_common_setting VALUES ('siteurl','https://www.discuz.vip/'); +INSERT INTO pre_common_setting VALUES ('site_qq',''); +INSERT INTO pre_common_setting VALUES ('smcols','8'); +INSERT INTO pre_common_setting VALUES ('smrows','5'); +INSERT INTO pre_common_setting VALUES ('smsdefaultcc','86'); +INSERT INTO pre_common_setting VALUES ('smsdefaultlength','4'); +INSERT INTO pre_common_setting VALUES ('smsglblimit','1000'); +INSERT INTO pre_common_setting VALUES ('smsinterval','300'); +INSERT INTO pre_common_setting VALUES ('smsmillimit','20'); +INSERT INTO pre_common_setting VALUES ('smsnumlimit','5'); +INSERT INTO pre_common_setting VALUES ('smsstatus','0'); +INSERT INTO pre_common_setting VALUES ('smstimelimit','86400'); +INSERT INTO pre_common_setting VALUES ('smthumb','20'); +INSERT INTO pre_common_setting VALUES ('sourceheight',''); +INSERT INTO pre_common_setting VALUES ('sourcewidth',''); +INSERT INTO pre_common_setting VALUES ('spacedata','a:11:{s:9:\"cachelife\";s:3:\"900\";s:14:\"limitmythreads\";s:1:\"5\";s:14:\"limitmyreplies\";s:1:\"5\";s:14:\"limitmyrewards\";s:1:\"5\";s:13:\"limitmytrades\";s:1:\"5\";s:13:\"limitmyvideos\";s:1:\"0\";s:12:\"limitmyblogs\";s:1:\"8\";s:14:\"limitmyfriends\";s:1:\"0\";s:16:\"limitmyfavforums\";s:1:\"5\";s:17:\"limitmyfavthreads\";s:1:\"0\";s:10:\"textlength\";s:3:\"300\";}'); +INSERT INTO pre_common_setting VALUES ('spacestatus','1'); +INSERT INTO pre_common_setting VALUES ('sphinxhost', ''); +INSERT INTO pre_common_setting VALUES ('sphinxlimit', ''); +INSERT INTO pre_common_setting VALUES ('sphinxmaxquerytime', ''); +INSERT INTO pre_common_setting VALUES ('sphinxmsgindex', 'posts,posts_minute'); +INSERT INTO pre_common_setting VALUES ('sphinxon', ''); +INSERT INTO pre_common_setting VALUES ('sphinxport', ''); +INSERT INTO pre_common_setting VALUES ('sphinxrank', ''); +INSERT INTO pre_common_setting VALUES ('sphinxsubindex', 'threads,threads_minute'); +INSERT INTO pre_common_setting VALUES ('srchcensor','1'); +INSERT INTO pre_common_setting VALUES ('srchhotkeywords','活动\r\n交友\r\ndiscuz'); +INSERT INTO pre_common_setting VALUES ('stamplistlevel','3'); +INSERT INTO pre_common_setting VALUES ('starthreshold','2'); +INSERT INTO pre_common_setting VALUES ('statcode',''); +INSERT INTO pre_common_setting VALUES ('statscachelife','180'); +INSERT INTO pre_common_setting VALUES ('statstatus',''); +INSERT INTO pre_common_setting VALUES ('strongpw','0'); +INSERT INTO pre_common_setting VALUES ('styleid','1'); +INSERT INTO pre_common_setting VALUES ('styleid1','1'); +INSERT INTO pre_common_setting VALUES ('styleid2','1'); +INSERT INTO pre_common_setting VALUES ('styleid3','1'); +INSERT INTO pre_common_setting VALUES ('stylejump','1'); +INSERT INTO pre_common_setting VALUES ('subforumsindex','0'); +INSERT INTO pre_common_setting VALUES ('submitlock','0'); +INSERT INTO pre_common_setting VALUES ('switchwidthauto', '1'); +INSERT INTO pre_common_setting VALUES ('tagstatus','1'); +INSERT INTO pre_common_setting VALUES ('targetblank','0'); +INSERT INTO pre_common_setting VALUES ('taskstatus','0'); +INSERT INTO pre_common_setting VALUES ('tasktypes',''); +INSERT INTO pre_common_setting VALUES ('threadblacklist','1'); +INSERT INTO pre_common_setting VALUES ('threadfilternum','10'); +INSERT INTO pre_common_setting VALUES ('threadguestlite','0'); +INSERT INTO pre_common_setting VALUES ('threadhotreplies','0'); +INSERT INTO pre_common_setting VALUES ('threadmaxpages','1000'); +INSERT INTO pre_common_setting VALUES ('threadsticky','全局置顶,分类置顶,本版置顶'); +INSERT INTO pre_common_setting VALUES ('thumbheight','300'); +INSERT INTO pre_common_setting VALUES ('thumbquality','100'); +INSERT INTO pre_common_setting VALUES ('thumbsource','0'); +INSERT INTO pre_common_setting VALUES ('thumbstatus',''); +INSERT INTO pre_common_setting VALUES ('thumbwidth','400'); +INSERT INTO pre_common_setting VALUES ('timeformat','H:i'); +INSERT INTO pre_common_setting VALUES ('timeoffset','8'); +INSERT INTO pre_common_setting VALUES ('topcachetime','60'); +INSERT INTO pre_common_setting VALUES ('topicperpage','20'); +INSERT INTO pre_common_setting VALUES ('tradeforumid','0'); +INSERT INTO pre_common_setting VALUES ('transfermincredits','1000'); +INSERT INTO pre_common_setting VALUES ('uc','a:1:{s:7:\"addfeed\";i:1;}'); +INSERT INTO pre_common_setting VALUES ('ucactivation','1'); +INSERT INTO pre_common_setting VALUES ('uidlogin','0'); +INSERT INTO pre_common_setting VALUES ('updatestat','1'); +INSERT INTO pre_common_setting VALUES ('userdateformat','Y-n-j\r\nY/n/j\r\nj-n-Y\r\nj/n/Y'); +INSERT INTO pre_common_setting VALUES ('userreasons','很给力!\r\n神马都是浮云\r\n赞一个!\r\n山寨\r\n淡定'); +INSERT INTO pre_common_setting VALUES ('userstatusby','1'); +INSERT INTO pre_common_setting VALUES ('verify','a:0:{}'); +INSERT INTO pre_common_setting VALUES ('video_allowalbum','0'); +INSERT INTO pre_common_setting VALUES ('video_allowblog','0'); +INSERT INTO pre_common_setting VALUES ('video_allowcomment','0'); +INSERT INTO pre_common_setting VALUES ('video_allowdoing','1'); +INSERT INTO pre_common_setting VALUES ('video_allowfriend','1'); +INSERT INTO pre_common_setting VALUES ('video_allowpoke','1'); +INSERT INTO pre_common_setting VALUES ('video_allowshare','0'); +INSERT INTO pre_common_setting VALUES ('video_allowviewspace','1'); +INSERT INTO pre_common_setting VALUES ('video_allowwall','1'); +INSERT INTO pre_common_setting VALUES ('viewthreadtags','100'); +INSERT INTO pre_common_setting VALUES ('visitbanperiods',''); +INSERT INTO pre_common_setting VALUES ('visitedforums','10'); +INSERT INTO pre_common_setting VALUES ('visitedthreads','0'); +INSERT INTO pre_common_setting VALUES ('vtonlinestatus','1'); +INSERT INTO pre_common_setting VALUES ('wallstatus','0'); +INSERT INTO pre_common_setting VALUES ('wapcharset','0'); +INSERT INTO pre_common_setting VALUES ('wapdateformat','n/j'); +INSERT INTO pre_common_setting VALUES ('wapmps','500'); +INSERT INTO pre_common_setting VALUES ('wapppp','5'); +INSERT INTO pre_common_setting VALUES ('wapregister','0'); +INSERT INTO pre_common_setting VALUES ('wapstatus','0'); +INSERT INTO pre_common_setting VALUES ('waptpp','10'); +INSERT INTO pre_common_setting VALUES ('warningexpiration','30'); +INSERT INTO pre_common_setting VALUES ('warninglimit','3'); +INSERT INTO pre_common_setting VALUES ('watermarkminheight', 'a:3:{s:6:\"portal\";s:1:\"0\";s:5:\"forum\";s:1:\"0\";s:5:\"album\";s:1:\"0\";}'); +INSERT INTO pre_common_setting VALUES ('watermarkminwidth', 'a:3:{s:6:\"portal\";s:1:\"0\";s:5:\"forum\";s:1:\"0\";s:5:\"album\";s:1:\"0\";}'); +INSERT INTO pre_common_setting VALUES ('watermarkquality', 'a:3:{s:6:\"portal\";s:2:\"90\";s:5:\"forum\";i:90;s:5:\"album\";i:90;}'); +INSERT INTO pre_common_setting VALUES ('watermarkstatus', 'a:3:{s:6:\"portal\";s:1:\"0\";s:5:\"forum\";s:1:\"0\";s:5:\"album\";s:1:\"0\";}'); +INSERT INTO pre_common_setting VALUES ('watermarktext', 'a:12:{s:4:\"text\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:8:\"fontpath\";a:3:{s:6:\"portal\";s:21:\"FetteSteinschrift.ttf\";s:5:\"forum\";s:21:\"FetteSteinschrift.ttf\";s:5:\"album\";s:21:\"FetteSteinschrift.ttf\";}s:4:\"size\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:5:\"angle\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:5:\"color\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:7:\"shadowx\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:7:\"shadowy\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:11:\"shadowcolor\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:10:\"translatex\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:10:\"translatey\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:5:\"skewx\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}s:5:\"skewy\";a:3:{s:6:\"portal\";s:0:\"\";s:5:\"forum\";s:0:\"\";s:5:\"album\";s:0:\"\";}}'); +INSERT INTO pre_common_setting VALUES ('watermarktrans', 'a:3:{s:6:\"portal\";s:2:\"50\";s:5:\"forum\";i:50;s:5:\"album\";i:50;}'); +INSERT INTO pre_common_setting VALUES ('watermarktype', 'a:3:{s:6:\"portal\";s:3:\"png\";s:5:\"forum\";s:3:\"png\";s:5:\"album\";s:3:\"png\";}'); +INSERT INTO pre_common_setting VALUES ('welcomemsg','1'); +INSERT INTO pre_common_setting VALUES ('welcomemsgtitle','{username},您好,感谢您的注册,请阅读以下内容。'); +INSERT INTO pre_common_setting VALUES ('welcomemsgtxt','尊敬的{username},您已经注册成为{sitename}的会员,请您在发表言论时,遵守当地法律法规。\r\n如果您有什么疑问可以联系管理员,Email: {adminemail}。\r\n\r\n\r\n{bbname}\r\n{time}'); +INSERT INTO pre_common_setting VALUES ('whosonlinestatus','3'); +INSERT INTO pre_common_setting VALUES ('whosonline_contract','0'); +INSERT INTO pre_common_setting VALUES ('zoomstatus','1 600'); + +INSERT INTO pre_common_smiley VALUES ('1','1','1','smiley',':)','smile.gif'); +INSERT INTO pre_common_smiley VALUES ('2','1','2','smiley',':(','sad.gif'); +INSERT INTO pre_common_smiley VALUES ('3','1','3','smiley',':D','biggrin.gif'); +INSERT INTO pre_common_smiley VALUES ('4','1','4','smiley',':\'(','cry.gif'); +INSERT INTO pre_common_smiley VALUES ('5','1','5','smiley',':@','huffy.gif'); +INSERT INTO pre_common_smiley VALUES ('6','1','6','smiley',':o','shocked.gif'); +INSERT INTO pre_common_smiley VALUES ('7','1','7','smiley',':P','tongue.gif'); +INSERT INTO pre_common_smiley VALUES ('8','1','8','smiley',':$','shy.gif'); +INSERT INTO pre_common_smiley VALUES ('9','1','9','smiley',';P','titter.gif'); +INSERT INTO pre_common_smiley VALUES ('10','1','10','smiley',':L','sweat.gif'); +INSERT INTO pre_common_smiley VALUES ('11','1','11','smiley',':Q','mad.gif'); +INSERT INTO pre_common_smiley VALUES ('12','1','12','smiley',':lol','lol.gif'); +INSERT INTO pre_common_smiley VALUES ('13','1','13','smiley',':loveliness:','loveliness.gif'); +INSERT INTO pre_common_smiley VALUES ('14','1','14','smiley',':funk:','funk.gif'); +INSERT INTO pre_common_smiley VALUES ('15','1','15','smiley',':curse:','curse.gif'); +INSERT INTO pre_common_smiley VALUES ('16','1','16','smiley',':dizzy:','dizzy.gif'); +INSERT INTO pre_common_smiley VALUES ('17','1','17','smiley',':shutup:','shutup.gif'); +INSERT INTO pre_common_smiley VALUES ('18','1','18','smiley',':sleepy:','sleepy.gif'); +INSERT INTO pre_common_smiley VALUES ('19','1','19','smiley',':hug:','hug.gif'); +INSERT INTO pre_common_smiley VALUES ('20','1','20','smiley',':victory:','victory.gif'); +INSERT INTO pre_common_smiley VALUES ('21','1','21','smiley',':time:','time.gif'); +INSERT INTO pre_common_smiley VALUES ('22','1','22','smiley',':kiss:','kiss.gif'); +INSERT INTO pre_common_smiley VALUES ('23','1','23','smiley',':handshake','handshake.gif'); +INSERT INTO pre_common_smiley VALUES ('24','1','24','smiley',':call:','call.gif'); +INSERT INTO pre_common_smiley VALUES ('25','2','1','smiley','{:2_25:}','01.gif'); +INSERT INTO pre_common_smiley VALUES ('26','2','2','smiley','{:2_26:}','02.gif'); +INSERT INTO pre_common_smiley VALUES ('27','2','3','smiley','{:2_27:}','03.gif'); +INSERT INTO pre_common_smiley VALUES ('28','2','4','smiley','{:2_28:}','04.gif'); +INSERT INTO pre_common_smiley VALUES ('29','2','5','smiley','{:2_29:}','05.gif'); +INSERT INTO pre_common_smiley VALUES ('30','2','6','smiley','{:2_30:}','06.gif'); +INSERT INTO pre_common_smiley VALUES ('31','2','7','smiley','{:2_31:}','07.gif'); +INSERT INTO pre_common_smiley VALUES ('32','2','8','smiley','{:2_32:}','08.gif'); +INSERT INTO pre_common_smiley VALUES ('33','2','9','smiley','{:2_33:}','09.gif'); +INSERT INTO pre_common_smiley VALUES ('34','2','10','smiley','{:2_34:}','10.gif'); +INSERT INTO pre_common_smiley VALUES ('35','2','11','smiley','{:2_35:}','11.gif'); +INSERT INTO pre_common_smiley VALUES ('36','2','12','smiley','{:2_36:}','12.gif'); +INSERT INTO pre_common_smiley VALUES ('37','2','13','smiley','{:2_37:}','13.gif'); +INSERT INTO pre_common_smiley VALUES ('38','2','14','smiley','{:2_38:}','14.gif'); +INSERT INTO pre_common_smiley VALUES ('39','2','15','smiley','{:2_39:}','15.gif'); +INSERT INTO pre_common_smiley VALUES ('40','2','16','smiley','{:2_40:}','16.gif'); +INSERT INTO pre_common_smiley VALUES ('41','3','1','smiley','{:3_41:}','01.gif'); +INSERT INTO pre_common_smiley VALUES ('42','3','2','smiley','{:3_42:}','02.gif'); +INSERT INTO pre_common_smiley VALUES ('43','3','3','smiley','{:3_43:}','03.gif'); +INSERT INTO pre_common_smiley VALUES ('44','3','4','smiley','{:3_44:}','04.gif'); +INSERT INTO pre_common_smiley VALUES ('45','3','5','smiley','{:3_45:}','05.gif'); +INSERT INTO pre_common_smiley VALUES ('46','3','6','smiley','{:3_46:}','06.gif'); +INSERT INTO pre_common_smiley VALUES ('47','3','7','smiley','{:3_47:}','07.gif'); +INSERT INTO pre_common_smiley VALUES ('48','3','8','smiley','{:3_48:}','08.gif'); +INSERT INTO pre_common_smiley VALUES ('49','3','9','smiley','{:3_49:}','09.gif'); +INSERT INTO pre_common_smiley VALUES ('50','3','10','smiley','{:3_50:}','10.gif'); +INSERT INTO pre_common_smiley VALUES ('51','3','11','smiley','{:3_51:}','11.gif'); +INSERT INTO pre_common_smiley VALUES ('52','3','12','smiley','{:3_52:}','12.gif'); +INSERT INTO pre_common_smiley VALUES ('53','3','13','smiley','{:3_53:}','13.gif'); +INSERT INTO pre_common_smiley VALUES ('54','3','14','smiley','{:3_54:}','14.gif'); +INSERT INTO pre_common_smiley VALUES ('55','3','15','smiley','{:3_55:}','15.gif'); +INSERT INTO pre_common_smiley VALUES ('56','3','16','smiley','{:3_56:}','16.gif'); +INSERT INTO pre_common_smiley VALUES ('57','3','17','smiley','{:3_57:}','17.gif'); +INSERT INTO pre_common_smiley VALUES ('58','3','18','smiley','{:3_58:}','18.gif'); +INSERT INTO pre_common_smiley VALUES ('59','3','19','smiley','{:3_59:}','19.gif'); +INSERT INTO pre_common_smiley VALUES ('60','3','20','smiley','{:3_60:}','20.gif'); +INSERT INTO pre_common_smiley VALUES ('61','3','21','smiley','{:3_61:}','21.gif'); +INSERT INTO pre_common_smiley VALUES ('62','3','22','smiley','{:3_62:}','22.gif'); +INSERT INTO pre_common_smiley VALUES ('63','3','23','smiley','{:3_63:}','23.gif'); +INSERT INTO pre_common_smiley VALUES ('64','3','24','smiley','{:3_64:}','24.gif'); +INSERT INTO pre_common_smiley VALUES ('65','0','0','stamp','精华','001.gif'); +INSERT INTO pre_common_smiley VALUES ('66','0','1','stamp','热帖','002.gif'); +INSERT INTO pre_common_smiley VALUES ('67','0','2','stamp','美图','003.gif'); +INSERT INTO pre_common_smiley VALUES ('68','0','3','stamp','优秀','004.gif'); +INSERT INTO pre_common_smiley VALUES ('69','0','4','stamp','置顶','005.gif'); +INSERT INTO pre_common_smiley VALUES ('70','0','5','stamp','推荐','006.gif'); +INSERT INTO pre_common_smiley VALUES ('71','0','6','stamp','原创','007.gif'); +INSERT INTO pre_common_smiley VALUES ('72','0','7','stamp','版主推荐','008.gif'); +INSERT INTO pre_common_smiley VALUES ('73','0','8','stamp','爆料','009.gif'); +INSERT INTO pre_common_smiley VALUES ('74','0','9','stamplist','精华','001.small.gif'); +INSERT INTO pre_common_smiley VALUES ('75','0','10','stamplist','热帖','002.small.gif'); +INSERT INTO pre_common_smiley VALUES ('76','0','11','stamplist','美图','003.small.gif'); +INSERT INTO pre_common_smiley VALUES ('77','0','12','stamplist','优秀','004.small.gif'); +INSERT INTO pre_common_smiley VALUES ('78','0','13','stamplist','置顶','005.small.gif'); +INSERT INTO pre_common_smiley VALUES ('79','0','14','stamplist','推荐','006.small.gif'); +INSERT INTO pre_common_smiley VALUES ('80','0','15','stamplist','原创','007.small.gif'); +INSERT INTO pre_common_smiley VALUES ('81','0','16','stamplist','版主推荐','008.small.gif'); +INSERT INTO pre_common_smiley VALUES ('82','0','17','stamplist','爆料','009.small.gif'); +INSERT INTO pre_common_smiley VALUES ('83','4','19','stamp','编辑采用','010.gif'); +INSERT INTO pre_common_smiley VALUES ('84','0','18','stamplist','编辑采用','010.small.gif'); +INSERT INTO pre_common_smiley VALUES ('85','0','20','stamplist','新人帖','011.small.gif'); + + + +INSERT INTO pre_common_statuser VALUES ('1','0','login'); + + + +INSERT INTO pre_common_style VALUES ('1','默认风格','1','1', 't1 t2 t3 t4 t5|'); + +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'menuhoverbgcolor', '#004FA0'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'menucurbgcolor', '#005AB4'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'lightlink', '#FFF'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'floatbgcolor', '#FFF'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'dropmenubgcolor', '#FEFEFE'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'floatmaskbgcolor', '#000'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'dropmenuborder', '#DDD'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'specialbg', '#E5EDF2'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'specialborder', '#C2D5E3'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'commonbg', '#F2F2F2'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'commonborder', '#CDCDCD'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'inputbg', '#FFF'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'stypeid', '1'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'inputborderdarkcolor', '#848484'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'headerbgcolor', ''); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'headerborder', '0'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'sidebgcolor', '#E8F0F7'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'msgfontsize', '14px'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'bgcolor', '#FFF'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'noticetext', '#F26C4F'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'highlightlink', '#369'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'link', '#333'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'lighttext', '#999'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'midtext', '#666'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'tabletext', '#444'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'smfontsize', '0.83em'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'threadtitlefont', 'Tahoma,Helvetica,\'Microsoft Yahei\',sans-serif'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'threadtitlefontsize', '14px'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'smfont', 'Tahoma,Helvetica,sans-serif'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'titlebgcolor', '#E5EDF2'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'fontsize', '12px/1.5'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'font', 'Tahoma,Helvetica,\'Microsoft Yahei\',sans-serif'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'styleimgdir', ''); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'imgdir', ''); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'boardimg', 'logo.svg'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'searchimg', 'logo_sc.svg'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'touchimg', 'logo_m.svg'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'available', ''); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'headertext', '#444'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'footertext', '#666'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'menubgcolor', '#2B7ACD'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'menutext', '#FFF'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'menuhovertext', '#FFF'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'wrapbg', '#FFF'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'wrapbordercolor', '#CCC'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'contentwidth', '630px'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'contentseparate', '#C2D5E3'); +INSERT INTO `pre_common_stylevar` (`styleid`, `variable`, `substitute`) VALUES (1, 'inputborder', '#E0E0E0'); + + + +INSERT INTO pre_common_template VALUES ('1','默认模板套系','./template/default','Discuz!'); + + + + +INSERT INTO pre_common_usergroup VALUES ('1','1','system','private','管理员','0','0','9','','','1','1','1','1','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('2','2','system','private','超级版主','0','0','8','','','1','1','1','1','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('3','3','system','private','版主','0','0','7','','','1','1','1','1','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('4','0','system','private','禁止发言','0','0','0','','','1','1','0','0','0','0','0','0'); +INSERT INTO pre_common_usergroup VALUES ('5','0','system','private','禁止访问','0','0','0','','','0','1','0','0','0','0','0','0'); +INSERT INTO pre_common_usergroup VALUES ('6','0','system','private','禁止 IP','0','0','0','','','0','1','0','0','0','0','0','0'); +INSERT INTO pre_common_usergroup VALUES ('7','0','system','private','游客','0','0','0','','','1','1','0','0','0','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('8','0','system','private','等待验证会员','0','0','0','','','1','1','0','0','0','0','0','0'); +INSERT INTO pre_common_usergroup VALUES ('9','0','member','private','限制会员','-9999999','0','0','','','1','1','0','0','0','0','0','0'); +INSERT INTO pre_common_usergroup VALUES ('10','0','member','private','新手上路','0','50','1','','','1','1','0','0','0','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('11','0','member','private','注册会员','50','200','2','','','1','1','0','0','0','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('12','0','member','private','中级会员','200','500','3','','','1','1','0','0','0','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('13','0','member','private','高级会员','500','1000','4','','','1','1','0','0','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('14','0','member','private','金牌会员','1000','3000','6','','','1','1','0','0','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('15','0','member','private','论坛元老','3000','9999999','8','','','1','1','0','0','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('16','3','special','private','实习版主','0','0','7','','','1','1','0','0','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('17','2','special','private','网站编辑','0','0','8','','','1','1','0','0','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('18','1','special','private','信息监察员','0','0','9','','','1','1','0','0','1','0','0','10'); +INSERT INTO pre_common_usergroup VALUES ('19','3','special','private','审核员','0','0','7','','','1','1','0','0','1','0','0','10'); + + +INSERT INTO pre_common_usergroup_field SET `groupid`='1',`allowgroupdirectpost`='3',`allowgroupposturl`='3',`readaccess`='200',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='3',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='127',`allowcstatus`='1',`allowinvisible`='1',`allowtransfer`='1',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='1',`allowhidecode`='1',`allowhtml`='1',`allowanonymous`='1',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='1',`reasonpm`='0',`maxprice`='30',`maxsigsize`='500',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='200',`allowpostdebate`='1',`tradestick`='5',`exempt`='255',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='1',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='1',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='1',`allowbuildgroup`='30',`edittimelimit`='0',`allowpostarticle`='1',`allowdownlocalimg`='1',`allowspacediyhtml`='1',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='3',`allowcommentitem`='1',`allowreplycredit` = '1',`allowstatdata`='1',`ignorecensor`='1',`allowsendallpm`='1', `allowdownremoteimg`='1', `allowmediacode`='1', `allowbegincode`='1', `allowat`='50', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='2',`allowgroupdirectpost`='3',`readaccess`='150',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='3',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='1',`allowtransfer`='1',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='1',`allowhtml`='0',`allowanonymous`='1',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='1',`reasonpm`='0',`maxprice`='20',`maxsigsize`='300',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='180',`allowpostdebate`='1',`tradestick`='5',`exempt`='255',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='1',`allowbuildgroup`='20',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit` = '1',`allowstatdata`='0',`ignorecensor`='1',`allowsendallpm`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='3',`allowgroupdirectpost`='3',`readaccess`='100',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='1',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='0',`allowtransfer`='1',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='1',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='1',`reasonpm`='0',`maxprice`='10',`maxsigsize`='200',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='160',`allowpostdebate`='1',`tradestick`='5',`exempt`='224',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='1',`allowbuildgroup`='15',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit` = '1',`allowstatdata`='0',`ignorecensor`='1',`allowsendallpm`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='4',`allowgroupdirectpost`='3',`readaccess`='0',`allowpost`='0',`allowreply`='0',`allowpostpoll`='0',`allowpostreward`='0',`allowposttrade`='0',`allowpostactivity`='0',`allowdirectpost`='0',`allowgetattach`='0',`allowgetimage`='0',`allowpostattach`='0',`allowpostimage`='0',`allowvote`='0',`allowsearch`='0',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='0',`allowsigimgcode`='0',`allowmagics`='0',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='0',`maxattachsize`='0',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='0',`allowpostdebate`='0',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='0',`allowcommentarticle`='0',`searchinterval`='0',`searchignore`='0',`allowblog`='0',`allowdoing`='0',`allowupload`='0',`allowshare`='0',`allowcss`='0',`allowpoke`='0',`allowfriend`='0',`allowclick`='0',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='0',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='0',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='0',`allowspacediyimgcode`='0',`allowcommentpost`='0',`allowcommentitem`='0',`allowreplycredit`='0',`allowstatdata`='0', `allowavatarupload`='0', `allowviewprofile`='0'; +INSERT INTO pre_common_usergroup_field SET `groupid`='5',`allowgroupdirectpost`='3',`readaccess`='0',`allowpost`='0',`allowreply`='0',`allowpostpoll`='0',`allowpostreward`='0',`allowposttrade`='0',`allowpostactivity`='0',`allowdirectpost`='0',`allowgetattach`='0',`allowgetimage`='0',`allowpostattach`='0',`allowpostimage`='0',`allowvote`='0',`allowsearch`='0',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='0',`allowsigimgcode`='0',`allowmagics`='0',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='0',`maxattachsize`='0',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='0',`allowpostdebate`='0',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='0',`allowcommentarticle`='0',`searchinterval`='0',`searchignore`='0',`allowblog`='0',`allowdoing`='0',`allowupload`='0',`allowshare`='0',`allowcss`='0',`allowpoke`='0',`allowfriend`='0',`allowclick`='0',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='0',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='0',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='0',`allowspacediyimgcode`='0',`allowcommentpost`='0',`allowcommentitem`='0',`allowreplycredit`='0',`allowstatdata`='0', `allowavatarupload`='0', `allowviewprofile`='0'; +INSERT INTO pre_common_usergroup_field SET `groupid`='6',`allowgroupdirectpost`='3',`readaccess`='0',`allowpost`='0',`allowreply`='0',`allowpostpoll`='0',`allowpostreward`='0',`allowposttrade`='0',`allowpostactivity`='0',`allowdirectpost`='0',`allowgetattach`='0',`allowgetimage`='0',`allowpostattach`='0',`allowpostimage`='0',`allowvote`='0',`allowsearch`='0',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='0',`allowsigimgcode`='0',`allowmagics`='0',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='0',`maxattachsize`='0',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='0',`allowpostdebate`='0',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='0',`allowcommentarticle`='0',`searchinterval`='0',`searchignore`='0',`allowblog`='0',`allowdoing`='0',`allowupload`='0',`allowshare`='0',`allowcss`='0',`allowpoke`='0',`allowfriend`='0',`allowclick`='0',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='0',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='0',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='0',`allowspacediyimgcode`='0',`allowcommentpost`='0',`allowcommentitem`='0',`allowreplycredit`='0',`allowstatdata`='0', `allowavatarupload`='0', `allowviewprofile`='0'; +INSERT INTO pre_common_usergroup_field SET `groupid`='7',`allowgroupdirectpost`='3',`readaccess`='1',`allowpost`='0',`allowreply`='0',`allowpostpoll`='0',`allowpostreward`='0',`allowposttrade`='0',`allowpostactivity`='0',`allowdirectpost`='0',`allowgetattach`='0',`allowgetimage`='0',`allowpostattach`='0',`allowpostimage`='0',`allowvote`='0',`allowsearch`='19',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='0',`allowsigimgcode`='0',`allowmagics`='0',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='0',`maxattachsize`='0',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='0',`allowpostdebate`='0',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='0',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcommentarticle`='0',`allowcomment`='0',`searchinterval`='0',`searchignore`='0',`allowblog`='0',`allowdoing`='0',`allowupload`='0',`allowshare`='0',`allowcss`='0',`allowpoke`='0',`allowfriend`='0',`allowclick`='0',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='0',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='0',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='0',`allowspacediyimgcode`='0',`allowcommentpost`='0',`allowcommentitem`='0',`allowreplycredit`='0',`allowstatdata`='0', `allowavatarupload`='0', `allowviewprofile`='0'; +INSERT INTO pre_common_usergroup_field SET `groupid`='8',`allowgroupdirectpost`='3',`readaccess`='0',`allowpost`='0',`allowreply`='0',`allowpostpoll`='0',`allowpostreward`='0',`allowposttrade`='0',`allowpostactivity`='0',`allowdirectpost`='0',`allowgetattach`='0',`allowgetimage`='0',`allowpostattach`='0',`allowpostimage`='0',`allowvote`='0',`allowsearch`='2',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='0',`allowmagics`='0',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='50',`maxattachsize`='0',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='0',`allowpostdebate`='0',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='0',`allowcommentarticle`='0',`searchinterval`='0',`searchignore`='0',`allowblog`='0',`allowdoing`='0',`allowupload`='0',`allowshare`='0',`allowcss`='0',`allowpoke`='0',`allowfriend`='0',`allowclick`='0',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='0',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='0',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='0',`allowspacediyimgcode`='0',`allowcommentpost`='2',`allowcommentitem`='0',`allowreplycredit`='0',`allowstatdata`='0', `allowavatarupload`='0', `allowviewprofile`='0'; +INSERT INTO pre_common_usergroup_field SET `groupid`='9',`allowgroupdirectpost`='0',`readaccess`='0',`allowpost`='0',`allowreply`='0',`allowpostpoll`='0',`allowpostreward`='0',`allowposttrade`='0',`allowpostactivity`='0',`allowdirectpost`='0',`allowgetattach`='0',`allowgetimage`='0',`allowpostattach`='0',`allowpostimage`='0',`allowvote`='0',`allowsearch`='0',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='0',`allowsigimgcode`='0',`allowmagics`='0',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='0',`maxattachsize`='0',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm,pdf,zip,rar,tar,gz,bzip2,gif,jpg,jpeg,png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='1',`maxmagicsweight`='0',`allowpostdebate`='0',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='0',`allowrecommend`='0',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='0',`allowcommentarticle`='0',`searchinterval`='0',`searchignore`='0',`allowblog`='0',`allowdoing`='0',`allowupload`='0',`allowshare`='0',`allowcss`='0',`allowpoke`='0',`allowfriend`='0',`allowclick`='0',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='0',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='0',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='0',`allowspacediyimgcode`='0',`allowcommentpost`='0',`allowcommentitem`='1',`allowreplycredit`='0',`allowstatdata`='0', `allowavatarupload`='0', `allowviewprofile`='0'; +INSERT INTO pre_common_usergroup_field SET `groupid`='10',`allowgroupdirectpost`='3',`readaccess`='10',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='0',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='0',`allowmagics`='1',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='80',`maxattachsize`='1024000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='40',`allowpostdebate`='1',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='5',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='0',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='11',`allowgroupdirectpost`='3',`readaccess`='20',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='0',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='0',`allowmagics`='1',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='100',`maxattachsize`='1024000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='60',`allowpostdebate`='1',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='5',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='12',`allowgroupdirectpost`='3',`readaccess`='30',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='0',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='0',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='0',`allowmagics`='1',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='150',`maxattachsize`='1024000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='80',`allowpostdebate`='1',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='5',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='13',`allowgroupdirectpost`='3',`readaccess`='50',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='0',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='0',`allowsetattachperm`='0',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='0',`allowmagics`='2',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='200',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='100',`allowpostdebate`='1',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='10',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='14',`allowgroupdirectpost`='3',`readaccess`='70',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='0',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='0',`allowtransfer`='0',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='300',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='120',`allowpostdebate`='1',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='10',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='15',`allowgroupdirectpost`='3',`readaccess`='90',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='0',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='1',`allowtransfer`='0',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='0',`allowhtml`='0',`allowanonymous`='1',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='0',`maxsigsize`='500',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='140',`allowpostdebate`='1',`tradestick`='5',`exempt`='0',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='1',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='10',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`= '1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='16',`allowgroupdirectpost`='3',`readaccess`='100',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='1',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='0',`allowtransfer`='1',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='1',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='1',`reasonpm`='0',`maxprice`='10',`maxsigsize`='200',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='160',`allowpostdebate`='1',`tradestick`='5',`exempt`='188',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='0',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='0',`allowbuildgroup`='15',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='17',`allowgroupdirectpost`='3',`readaccess`='150',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='3',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='1',`allowtransfer`='1',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='1',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='1',`reasonpm`='0',`maxprice`='20',`maxsigsize`='300',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='180',`allowpostdebate`='1',`tradestick`='5',`exempt`='255',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='0',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='1',`allowbuildgroup`='15',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='18',`allowgroupdirectpost`='3',`readaccess`='200',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='3',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='0',`allowinvisible`='1',`allowtransfer`='1',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='1',`allowhtml`='1',`allowanonymous`='1',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='0',`reasonpm`='0',`maxprice`='30',`maxsigsize`='500',`maxattachsize`='0',`maxsizeperday`='0',`maxpostsperhour`='1',`attachextensions`='',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='200',`allowpostdebate`='1',`tradestick`='5',`exempt`='255',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='3',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='15',`seccode`='1',`disablepostctrl`='1',`allowbuildgroup`='5',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; +INSERT INTO pre_common_usergroup_field SET `groupid`='19',`allowgroupdirectpost`='3',`readaccess`='100',`allowpost`='1',`allowreply`='1',`allowpostpoll`='1',`allowpostreward`='1',`allowposttrade`='1',`allowpostactivity`='1',`allowdirectpost`='1',`allowgetattach`='1',`allowgetimage`='1',`allowpostattach`='1',`allowpostimage`='1',`allowvote`='1',`allowsearch`='95',`allowcstatus`='1',`allowinvisible`='0',`allowtransfer`='1',`allowsetreadperm`='1',`allowsetattachperm`='1',`allowposttag`='0',`allowhidecode`='1',`allowhtml`='0',`allowanonymous`='0',`allowsigbbcode`='1',`allowsigimgcode`='1',`allowmagics`='2',`disableperiodctrl`='1',`reasonpm`='0',`maxprice`='10',`maxsigsize`='200',`maxattachsize`='2048000',`maxsizeperday`='0',`maxpostsperhour`='0',`attachextensions`='chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png',`raterange`='',`mintradeprice`='1',`maxtradeprice`='0',`minrewardprice`='1',`maxrewardprice`='0',`magicsdiscount`='0',`maxmagicsweight`='160',`allowpostdebate`='1',`tradestick`='5',`exempt`='188',`maxattachnum`='0',`allowposturl`='3',`allowrecommend`='0',`allowpostrushreply`='0',`maxfriendnum`='0',`maxspacesize`='0',`allowcomment`='1',`allowcommentarticle`='1000',`searchinterval`='0',`searchignore`='0',`allowblog`='1',`allowdoing`='1',`allowupload`='1',`allowshare`='1',`allowcss`='0',`allowpoke`='1',`allowfriend`='1',`allowclick`='1',`allowmagic`='0',`allowstat`='0',`magicdiscount`='0',`domainlength`='5',`seccode`='1',`disablepostctrl`='1',`allowbuildgroup`='15',`edittimelimit`='0',`allowpostarticle`='0',`allowspacediyhtml`='0',`allowspacediybbcode`='1',`allowspacediyimgcode`='1',`allowcommentpost`='2',`allowcommentitem`='1',`allowreplycredit`='1',`allowstatdata`='0', `allowcreatecollection`='5', `allowcommentcollection`='1', `allowfollowcollection`='30', `allowavatarupload`='1', `allowviewprofile`='1'; + +INSERT INTO pre_common_word_type SET `id`='1', `typename`='政治'; +INSERT INTO pre_common_word_type SET `id`='2', `typename`='广告'; + +INSERT INTO pre_forum_bbcode VALUES ('1','0','fly','bb_fly.gif','{1}','[fly]This is sample text[/fly]','使内容横向滚动,这个效果类似 HTML 的 marquee 标签,注意:这个效果只在 Internet Explorer 浏览器下有效。','1','请输入滚动显示的文字:','1','19','1 2 3 12 13 14 15 16 17 18 19'); +INSERT INTO pre_forum_bbcode VALUES ('2','2','qq','bb_qq.gif','','[qq]688888[/qq]','显示 QQ 在线状态,点这个图标可以和他(她)聊天','1','请输入 QQ 号码:设置QQ在线状态  ','1','21','1 2 3 10 11 12 13 14 15 16 17 18 19'); +INSERT INTO pre_forum_bbcode VALUES ('3','0','sup','bb_sup.gif','{1}','X[sup]2[/sup]','上标','1','请输入上标文字:','1','22','1 2 3 12 13 14 15 16 17 18 19'); +INSERT INTO pre_forum_bbcode VALUES ('4','0','sub','bb_sub.gif','{1}','X[sub]2[/sub]','下标','1','请输入下标文字:','1','23','1 2 3 12 13 14 15 16 17 18 19'); + + +INSERT INTO pre_forum_forum SET `fid`='1',`fup`='0',`type`='group',`name`='Discuz!',`status`='1'; +INSERT INTO pre_forum_forum SET `fid`='2',`fup`='1',`type`='forum',`name`='默认版块',`status`='1',`allowsmilies`='1',`allowbbcode`='1',`allowimgcode`='1',`allowmediacode`='1',`allowpostspecial`='1',`recyclebin`='1', `allowfeed`='1'; + +INSERT INTO pre_forum_forumfield SET `fid`='1'; +INSERT INTO pre_forum_forumfield SET `fid`='2'; + +INSERT INTO pre_forum_grouplevel VALUES ('1','default','普通级','-999999999','500','','a:1:{s:4:\"post\";s:1:\"1\";s:5:\"reply\";s:1:\"1\";}','a:11:{s:13:\"alloweditpost\";s:1:\"1\";s:10:\"recyclebin\";s:1:\"1\";s:12:\"allowsmilies\";s:1:\"1\";s:9:\"allowhtml\";i:0;s:11:\"allowbbcode\";s:1:\"1\";s:14:\"allowanonymous\";i:0;s:6:\"jammer\";i:0;s:12:\"allowimgcode\";s:1:\"1\";s:14:\"allowmediacode\";s:1:\"1\";s:16:\"allowpostspecial\";i:31;s:16:\"attachextensions\";s:7:\"jpg,gif\";}','a:5:{s:15:\"allowchangename\";s:1:\"1\";s:15:\"allowchangetype\";s:1:\"1\";s:15:\"allowclosegroup\";s:1:\"1\";s:15:\"allowthreadtype\";s:1:\"1\";s:13:\"membermaximum\";s:0:\"\";}'); +INSERT INTO pre_forum_grouplevel VALUES ('2','default','中级','500','3000','','a:2:{s:4:\"post\";s:1:\"1\";s:5:\"reply\";s:1:\"1\";}','a:11:{s:13:\"alloweditpost\";s:1:\"1\";s:10:\"recyclebin\";s:1:\"1\";s:12:\"allowsmilies\";s:1:\"1\";s:9:\"allowhtml\";i:0;s:11:\"allowbbcode\";s:1:\"1\";s:14:\"allowanonymous\";i:0;s:6:\"jammer\";i:0;s:12:\"allowimgcode\";s:1:\"1\";s:14:\"allowmediacode\";s:1:\"1\";s:16:\"allowpostspecial\";i:31;s:16:\"attachextensions\";s:11:\"jpg,gif,rar\";}',''); +INSERT INTO pre_forum_grouplevel VALUES ('3','default','高级','3000','999999999','','a:2:{s:4:\"post\";s:1:\"1\";s:5:\"reply\";s:1:\"1\";}','a:11:{s:13:\"alloweditpost\";s:1:\"1\";s:10:\"recyclebin\";s:1:\"1\";s:12:\"allowsmilies\";s:1:\"1\";s:9:\"allowhtml\";s:1:\"0\";s:11:\"allowbbcode\";s:1:\"1\";s:14:\"allowanonymous\";s:1:\"0\";s:6:\"jammer\";s:1:\"1\";s:12:\"allowimgcode\";s:1:\"1\";s:14:\"allowmediacode\";s:1:\"1\";s:16:\"allowpostspecial\";i:31;s:16:\"attachextensions\";s:31:\"jpg,gif,png,bmp,rar,doc,txt,zip\";}',''); + + + + + + +INSERT INTO pre_forum_imagetype VALUES ('1','1','默认','smiley','1','default'); +INSERT INTO pre_forum_imagetype VALUES ('2','1','酷猴','smiley','2','coolmonkey'); +INSERT INTO pre_forum_imagetype VALUES ('3','1','呆呆男','smiley','3','grapeman'); + + + +INSERT INTO pre_forum_medal VALUES ('1','最佳新人','0','medal1.gif','0','0','注册账号后积极发帖的会员','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('2','活跃会员','0','medal2.gif','0','0','经常参与各类话题的讨论,发帖内容较有主见','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('3','热心会员','0','medal3.gif','0','0','经常帮助其他会员答疑','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('4','推广达人','0','medal4.gif','0','0','积极宣传本站,为本站带来更多注册会员','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('5','宣传达人','0','medal5.gif','0','0','积极宣传本站,为本站带来更多的用户访问量','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('6','灌水之王','0','medal6.gif','0','0','经常在论坛发帖,且发帖量较大','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('7','突出贡献','0','medal7.gif','0','0','长期对论坛的繁荣而不断努力,或多次提出建设性意见','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('8','优秀版主','0','medal8.gif','0','0','活跃且尽责职守的版主','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('9','荣誉管理','0','medal9.gif','0','0','曾经为论坛做出突出贡献目前已离职的版主','0','','0','0'); +INSERT INTO pre_forum_medal VALUES ('10','论坛元老','0','medal10.gif','0','0','为论坛做出突出贡献的会员','0','','0','0'); + + + + + +INSERT INTO pre_forum_onlinelist VALUES ('1','1','管理员','online_admin.gif'); +INSERT INTO pre_forum_onlinelist VALUES ('2','2','超级版主','online_supermod.gif'); +INSERT INTO pre_forum_onlinelist VALUES ('3','3','版主','online_moderator.gif'); +INSERT INTO pre_forum_onlinelist VALUES ('0','4','会员','online_member.gif'); + +INSERT INTO pre_forum_typeoption SET `optionid`=1, `title`='分类A'; +INSERT INTO pre_forum_typeoption SET `optionid`=2, `title`='分类B'; +INSERT INTO pre_forum_typeoption SET `optionid`=3, `title`='分类C'; +INSERT INTO pre_forum_typeoption SET `optionid`=4, `title`='分类D'; +INSERT INTO pre_forum_typeoption SET `optionid`=5, `title`='分类E'; +INSERT INTO pre_forum_typeoption SET `optionid`=6, `title`='分类F'; + +INSERT INTO pre_home_click VALUES ('1','路过','luguo.gif','blogid','1','0'); +INSERT INTO pre_home_click VALUES ('2','雷人','leiren.gif','blogid','1','0'); +INSERT INTO pre_home_click VALUES ('3','握手','woshou.gif','blogid','1','0'); +INSERT INTO pre_home_click VALUES ('4','鲜花','xianhua.gif','blogid','1','0'); +INSERT INTO pre_home_click VALUES ('5','鸡蛋','jidan.gif','blogid','1','0'); +INSERT INTO pre_home_click VALUES ('6','漂亮','piaoliang.gif','picid','1','0'); +INSERT INTO pre_home_click VALUES ('7','酷毙','kubi.gif','picid','1','0'); +INSERT INTO pre_home_click VALUES ('8','雷人','leiren.gif','picid','1','0'); +INSERT INTO pre_home_click VALUES ('9','鲜花','xianhua.gif','picid','1','0'); +INSERT INTO pre_home_click VALUES ('10','鸡蛋','jidan.gif','picid','1','0'); +INSERT INTO pre_home_click VALUES ('11','路过','luguo.gif','aid','1','0'); +INSERT INTO pre_home_click VALUES ('12','雷人','leiren.gif','aid','1','0'); +INSERT INTO pre_home_click VALUES ('13','握手','woshou.gif','aid','1','0'); +INSERT INTO pre_home_click VALUES ('14','鲜花','xianhua.gif','aid','1','0'); +INSERT INTO pre_home_click VALUES ('15','鸡蛋','jidan.gif','aid','1','0'); + +-- [block_style] +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(1, 'html_html', '[内置]空模板', 'a:9:{s:3:"raw";s:0:"";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";a:0:{}}', 'ee3e718a', 0, 0, 0, 0, 'a:0:{}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(2, 'forum_forum', '[内置]版块名称列表', 'a:9:{s:3:"raw";s:130:"
\r\n
    \r\n[loop]\r\n
  • {title}
  • \r\n[/loop]\r\n
\r\n
";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', 'c6c48ef5', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(3, 'forum_forum', '[内置]版块名称+总帖数', 'a:9:{s:3:"raw";s:146:"
    \r\n
      \r\n[loop]\r\n
    • {posts}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:76:"
  • {posts}{title}
  • ";}', '91c25611', 0, 0, 0, 1, 'a:3:{i:0;s:5:"posts";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(4, 'forum_forum', '[内置]版块名称+总帖数(有序)', 'a:9:{s:3:"raw";s:146:"
    \r\n
      \r\n[loop]\r\n
    1. {posts}{title}
    2. \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:76:"
  • {posts}{title}
  • ";}', '951323a8', 0, 0, 0, 1, 'a:3:{i:0;s:5:"posts";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(5, 'forum_forum', '[内置]版块名称+今日发贴数', 'a:9:{s:3:"raw";s:151:"
    \r\n
      \r\n[loop]\r\n
    • {todayposts}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:81:"
  • {todayposts}{title}
  • ";}', 'e08c8a30', 0, 0, 0, 1, 'a:3:{i:0;s:10:"todayposts";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(6, 'forum_forum', '[内置]版块名称+今日发贴数(有序)', 'a:9:{s:3:"raw";s:151:"
    \r\n
      \r\n[loop]\r\n
    1. {todayposts}{title}
    2. \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:81:"
  • {todayposts}{title}
  • ";}', '12516b2d', 0, 0, 0, 1, 'a:3:{i:0;s:10:"todayposts";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(7, 'forum_forum', '[内置]版块名称(两列)', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '0e51a193', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(8, 'forum_forum', '[内置]版块名称+介绍', 'a:9:{s:3:"raw";s:160:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '2bf344ae', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(9, 'forum_thread', '[内置]文章标题', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '079cd140', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(10, 'forum_thread', '[内置]文章标题+回复数', 'a:9:{s:3:"raw";s:148:"
    \r\n
      \r\n[loop]\r\n
    • {replies}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:78:"
  • {replies}{title}
  • ";}', '0cc45858', 0, 0, 0, 1, 'a:3:{i:0;s:7:"replies";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(11, 'forum_thread', '[内置]文章标题+查看数', 'a:9:{s:3:"raw";s:146:"
    \r\n
      \r\n[loop]\r\n
    • {views}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:76:"
  • {views}{title}
  • ";}', 'c5361e32', 0, 0, 0, 1, 'a:3:{i:0;s:5:"views";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(12, 'forum_thread', '[内置]文章标题+热度', 'a:9:{s:3:"raw";s:146:"
    \r\n
      \r\n[loop]\r\n
    • {heats}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:76:"
  • {heats}{title}
  • ";}', 'dfac2b4f', 0, 0, 0, 1, 'a:3:{i:0;s:5:"heats";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(13, 'forum_thread', '[内置]文章标题+发帖时间', 'a:9:{s:3:"raw";s:149:"
    \r\n
      \r\n[loop]\r\n
    • {dateline}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:79:"
  • {dateline}{title}
  • ";}', '37a3603a', 0, 0, 0, 1, 'a:3:{i:0;s:8:"dateline";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(14, 'forum_thread', '[内置]文章标题+最后回复时间', 'a:9:{s:3:"raw";s:149:"
    \r\n
      \r\n[loop]\r\n
    • {lastpost}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:79:"
  • {lastpost}{title}
  • ";}', '1ae9c85b', 0, 0, 0, 1, 'a:3:{i:0;s:8:"lastpost";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(15, 'forum_thread', '[内置]文章标题+作者', 'a:9:{s:3:"raw";s:203:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:133:"
  • {author}{title}
  • ";}', '30def87f', 0, 0, 0, 1, 'a:4:{i:0;s:8:"authorid";i:1;s:6:"author";i:2;s:3:"url";i:3;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(16, 'forum_thread', '[内置]文章标题+作者+摘要', 'a:9:{s:3:"raw";s:251:"
    \r\n[loop]\r\n
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:197:"
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    ";}', '8ebc8d5f', 0, 1, 0, 1, 'a:5:{i:0;s:8:"authorid";i:1;s:6:"author";i:2;s:3:"url";i:3;s:5:"title";i:4;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(17, 'forum_thread', '[内置]文章标题+摘要', 'a:9:{s:3:"raw";s:160:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '1107d2bd', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(18, 'forum_thread', '[内置]焦点模式', 'a:9:{s:3:"raw";s:164:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', 'b6337920', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(19, 'forum_thread', '[内置]文章标题(第一条带摘要)', 'a:9:{s:3:"raw";s:297:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n[order=1]\r\n
    • \r\n
      \r\n
      {title}
      \r\n
      {summary}
      \r\n
      \r\n
      \r\n
    • \r\n[/order]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:1:{i:1;s:148:"
  • \r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n
    \r\n
  • ";}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '2e06f8b5', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(24, 'group_thread', '[内置]文章标题', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '176fcc68', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(25, 'group_thread', '[内置]文章标题+回复数', 'a:9:{s:3:"raw";s:148:"
    \r\n
      \r\n[loop]\r\n
    • {replies}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:78:"
  • {replies}{title}
  • ";}', '8baa57ad', 0, 0, 0, 1, 'a:3:{i:0;s:7:"replies";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(26, 'group_thread', '[内置]文章标题+查看数', 'a:9:{s:3:"raw";s:146:"
    \r\n
      \r\n[loop]\r\n
    • {views}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:76:"
  • {views}{title}
  • ";}', '8f012db4', 0, 0, 0, 1, 'a:3:{i:0;s:5:"views";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(27, 'group_thread', '[内置]文章标题+热度', 'a:9:{s:3:"raw";s:146:"
    \r\n
      \r\n[loop]\r\n
    • {heats}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:76:"
  • {heats}{title}
  • ";}', '7f002523', 0, 0, 0, 1, 'a:3:{i:0;s:5:"heats";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(28, 'group_thread', '[内置]文章标题+发帖时间', 'a:9:{s:3:"raw";s:149:"
    \r\n
      \r\n[loop]\r\n
    • {dateline}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:79:"
  • {dateline}{title}
  • ";}', '23ba8554', 0, 0, 0, 1, 'a:3:{i:0;s:8:"dateline";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(29, 'group_thread', '[内置]文章标题+最后回复时间', 'a:9:{s:3:"raw";s:149:"
    \r\n
      \r\n[loop]\r\n
    • {lastpost}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:79:"
  • {lastpost}{title}
  • ";}', 'a6fbd13d', 0, 0, 0, 1, 'a:3:{i:0;s:8:"lastpost";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(30, 'group_thread', '[内置]文章标题+作者', 'a:9:{s:3:"raw";s:203:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:133:"
  • {author}{title}
  • ";}', '49245e40', 0, 0, 0, 1, 'a:4:{i:0;s:8:"authorid";i:1;s:6:"author";i:2;s:3:"url";i:3;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(31, 'group_thread', '[内置]文章标题+作者+摘要', 'a:9:{s:3:"raw";s:243:"
    \r\n[loop]\r\n
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:189:"
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    ";}', 'd9c23f31', 0, 1, 0, 1, 'a:5:{i:0;s:8:"authorid";i:1;s:6:"author";i:2;s:3:"url";i:3;s:5:"title";i:4;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(32, 'group_thread', '[内置]文章标题+摘要', 'a:9:{s:3:"raw";s:160:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '9e90211d', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(33, 'group_thread', '[内置]焦点模式', 'a:9:{s:3:"raw";s:164:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '9670c626', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(34, 'group_thread', '[内置]文章标题(第一条带摘要)', 'a:9:{s:3:"raw";s:297:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n[order=1]\r\n
    • \r\n
      \r\n
      {title}
      \r\n
      {summary}
      \r\n
      \r\n
      \r\n
    • \r\n[/order]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:1:{i:1;s:148:"
  • \r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n
    \r\n
  • ";}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '9355f559', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(39, 'group_group', '[内置]圈子名称', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '9872d550', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(40, 'group_group', '[内置]圈子名称+成员数', 'a:9:{s:3:"raw";s:150:"
    \r\n
      \r\n[loop]\r\n
    • {membernum}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:80:"
  • {membernum}{title}
  • ";}', '20a09ec8', 0, 0, 0, 1, 'a:3:{i:0;s:9:"membernum";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(41, 'group_group', '[内置]圈子名称+成员数(有序)', 'a:9:{s:3:"raw";s:150:"
    \r\n
      \r\n[loop]\r\n
    1. {membernum}{title}
    2. \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:80:"
  • {membernum}{title}
  • ";}', 'af166b44', 0, 0, 0, 1, 'a:3:{i:0;s:9:"membernum";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(42, 'group_group', '[内置]圈子名称+总帖数', 'a:9:{s:3:"raw";s:146:"
    \r\n
      \r\n[loop]\r\n
    • {posts}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:76:"
  • {posts}{title}
  • ";}', '43ed1e7c', 0, 0, 0, 1, 'a:3:{i:0;s:5:"posts";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(43, 'group_group', '[内置]圈子名称+今日发贴数', 'a:9:{s:3:"raw";s:151:"
    \r\n
      \r\n[loop]\r\n
    • {todayposts}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:81:"
  • {todayposts}{title}
  • ";}', '3c59217b', 0, 0, 0, 1, 'a:3:{i:0;s:10:"todayposts";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(44, 'group_group', '[内置]圈子图标+名称+介绍', 'a:9:{s:3:"raw";s:253:"
    \r\n[loop]\r\n
    \r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:199:"
    \r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '6f470107', 0, 1, 0, 1, 'a:4:{i:0;s:3:"url";i:1;s:4:"icon";i:2;s:5:"title";i:3;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(45, 'group_group', '[内置]圈子图标列表', 'a:9:{s:3:"raw";s:208:"
    \r\n
      \r\n[loop]\r\n
    • {title}

    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:138:"
  • {title}

  • ";}', 'f3646b2a', 0, 0, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:4:"icon";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(46, 'group_group', '[内置]圈子名称(两列)', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '5279d89d', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(47, 'portal_article', '[内置]文章标题', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '527a563d', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(48, 'portal_article', '[内置]文章标题+时间', 'a:9:{s:3:"raw";s:149:"
    \r\n
      \r\n[loop]\r\n
    • {dateline}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:79:"
  • {dateline}{title}
  • ";}', '6e4be436', 0, 0, 0, 1, 'a:3:{i:0;s:8:"dateline";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(49, 'portal_article', '[内置]文章标题+时间(带栏目)', 'a:9:{s:3:"raw";s:206:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:136:"
  • {dateline}{title}
  • ";}', 'c3b98a2f', 0, 0, 0, 1, 'a:5:{i:0;s:8:"dateline";i:1;s:6:"caturl";i:2;s:7:"catname";i:3;s:3:"url";i:4;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(50, 'portal_article', '[内置]文章标题+摘要+缩略图', 'a:9:{s:3:"raw";s:279:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:225:"
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', 'a5b550ee', 1, 1, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(51, 'portal_article', '[内置]文章标题+摘要', 'a:9:{s:3:"raw";s:160:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', 'e57dbe5a', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(52, 'portal_article', '[内置]焦点模式', 'a:9:{s:3:"raw";s:164:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '3b234c9c', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(53, 'portal_article', '[内置]文章图片幻灯', 'a:9:{s:3:"raw";s:333:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    \r\n";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:182:"
  • {title}
  • ";}', '8ff81e35', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(54, 'portal_article', '[内置]文章图文幻灯', 'a:9:{s:3:"raw";s:336:"
    \r\n[loop]\r\n
    \r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    \r\n";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:211:"
    \r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', 'd88aded4', 1, 1, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(55, 'portal_category', '[内置]栏目名称', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '6846b818', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(56, 'portal_category', '[内置]栏目名称(两列)', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', 'fa5b40c1', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(57, 'portal_topic', '[内置]专题名称', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '268501b8', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(58, 'portal_topic', '[内置]专题名称(两列)', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', 'b21a9795', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(59, 'portal_topic', '[内置]专题名称+介绍+缩略图', 'a:9:{s:3:"raw";s:279:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:225:"
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', 'e07e6128', 1, 1, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(60, 'portal_topic', '[内置]专题名称+介绍', 'a:9:{s:3:"raw";s:160:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '573d0170', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(61, 'portal_topic', '[内置]焦点模式', 'a:9:{s:3:"raw";s:164:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '7cc2ab53', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(62, 'space_doing', '[内置]作者+内容', 'a:9:{s:3:"raw";s:202:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:132:"
  • {username}: {title}
  • ";}', 'd0ca1426', 0, 0, 0, 1, 'a:4:{i:0;s:3:"uid";i:1;s:8:"username";i:2;s:3:"url";i:3;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(63, 'space_doing', '[内置]头像+作者+内容', 'a:9:{s:3:"raw";s:392:"
    \r\n[loop]\r\n
    \r\n
    {username}
    \r\n
    {username} {dateline}
    \r\n
    {title}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:338:"
    \r\n
    {username}
    \r\n
    {username} {dateline}
    \r\n
    {title}
    \r\n
    ";}', '13f43cab', 0, 0, 0, 1, 'a:6:{i:0;s:3:"uid";i:1;s:6:"avatar";i:2;s:8:"username";i:3;s:8:"dateline";i:4;s:3:"url";i:5;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(64, 'space_doing', '[内置]作者+内容(多行)+时间', 'a:9:{s:3:"raw";s:236:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:170:"
  • {username}: {title} ({dateline})
  • ";}', '927ed021', 0, 0, 0, 1, 'a:5:{i:0;s:3:"uid";i:1;s:8:"username";i:2;s:3:"url";i:3;s:5:"title";i:4;s:8:"dateline";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(65, 'space_blog', '[内置]日志标题', 'a:9:{s:3:"raw";s:130:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '9349072a', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(66, 'space_blog', '[内置]日志标题+作者', 'a:9:{s:3:"raw";s:200:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:130:"
  • {username}{title}
  • ";}', 'd2a5c82a', 0, 0, 0, 1, 'a:4:{i:0;s:3:"uid";i:1;s:8:"username";i:2;s:3:"url";i:3;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(67, 'space_blog', '[内置]日志标题+发布时间', 'a:9:{s:3:"raw";s:149:"
    \r\n
      \r\n[loop]\r\n
    • {dateline}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:79:"
  • {dateline}{title}
  • ";}', 'c68ceade', 0, 0, 0, 1, 'a:3:{i:0;s:8:"dateline";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(68, 'space_blog', '[内置]日志标题+评论数', 'a:9:{s:3:"raw";s:149:"
    \r\n
      \r\n[loop]\r\n
    • {replynum}{title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:79:"
  • {replynum}{title}
  • ";}', '0345faa7', 0, 0, 0, 1, 'a:3:{i:0;s:8:"replynum";i:1;s:3:"url";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(69, 'space_blog', '[内置]日志标题+作者+简介', 'a:9:{s:3:"raw";s:248:"
    \r\n[loop]\r\n
    \r\n
    {username}{title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:194:"
    \r\n
    {username}{title}
    \r\n
    {summary}
    \r\n
    ";}', 'cd5e700c', 0, 1, 0, 1, 'a:5:{i:0;s:3:"uid";i:1;s:8:"username";i:2;s:3:"url";i:3;s:5:"title";i:4;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(70, 'space_blog', '[内置]日志缩略图+标题+简介', 'a:9:{s:3:"raw";s:361:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {username}{title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:307:"
    \r\n
    {title}
    \r\n
    {username}{title}
    \r\n
    {summary}
    \r\n
    ";}', '323bc8e0', 1, 1, 1, 1, 'a:6:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:3:"uid";i:4;s:8:"username";i:5;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(71, 'space_blog', '[内置]日志图片幻灯', 'a:9:{s:3:"raw";s:333:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    \r\n";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:182:"
  • {title}
  • ";}', 'c23cc347', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(72, 'space_blog', '[内置]焦点模式', 'a:9:{s:3:"raw";s:164:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:106:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '3bb0bf67', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(73, 'space_album', '[内置]相册列表', 'a:9:{s:3:"raw";s:253:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title} ({picnum})

      \r\n
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:187:"
  • \r\n {title}\r\n

    {title} ({picnum})

    \r\n
  • ";}', '73e0a54f', 1, 0, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:6:"picnum";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(74, 'space_album', '[内置]相册列表+名称+用户', 'a:9:{s:3:"raw";s:320:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:254:"
  • \r\n {title}\r\n

    {title} ({picnum})

    \r\n {username}\r\n
  • ";}', 'cc34db30', 1, 0, 1, 1, 'a:6:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:6:"picnum";i:4;s:3:"uid";i:5;s:8:"username";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(75, 'space_pic', '[内置]图片列表', 'a:9:{s:3:"raw";s:271:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:205:"
  • \r\n {title}\r\n

    {title}

    \r\n
  • ";}', '9e9201a8', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(76, 'space_pic', '[内置]图片幻灯', 'a:9:{s:3:"raw";s:333:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    \r\n";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:182:"
  • {title}
  • ";}', 'c5d88e6d', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(77, 'member_member', '[内置]会员头像列表', 'a:9:{s:3:"raw";s:238:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:168:"
  • \r\n {title}\r\n

    {title}

    \r\n
  • ";}', '2ef16e64', 0, 0, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:6:"avatar";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(78, 'member_member', '[内置]用户名列表', 'a:9:{s:3:"raw";s:136:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:66:"
  • {title}
  • ";}', 'ed36c3b0', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(79, 'member_member', '[内置]头像+用户名+发贴数(有序)', 'a:9:{s:3:"raw";s:223:"
    \r\n
      \r\n[loop]\r\n
    1. {posts}{title} {title}
    2. \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:153:"
  • {posts}{title} {title}
  • ";}', 'b185afb9', 0, 0, 0, 1, 'a:4:{i:0;s:5:"posts";i:1;s:6:"avatar";i:2;s:5:"title";i:3;s:3:"url";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(80, 'member_member', '[内置]头像+用户名+积分数(有序)', 'a:9:{s:3:"raw";s:225:"
    \r\n
      \r\n[loop]\r\n
    1. {credits}{title} {title}
    2. \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:155:"
  • {credits}{title} {title}
  • ";}', '8431f4e1', 0, 0, 0, 1, 'a:4:{i:0;s:7:"credits";i:1;s:6:"avatar";i:2;s:5:"title";i:3;s:3:"url";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(81, 'forum_trade', '[内置]商品列表', 'a:9:{s:3:"raw";s:423:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:357:"
  • \r\n{title}\r\n

    {price}

    \r\n

    {title}

    \r\n
  • ";}', '4fd3ffc9', 1, 0, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:5:"price";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(82, 'forum_activity', '[内置]活动列表', 'a:9:{s:3:"raw";s:331:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {time} {place}
    \r\n
    已有 {applynumber} 人报名
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:277:"
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {time} {place}
    \r\n
    已有 {applynumber} 人报名
    \r\n
    ";}', '3d04a558', 1, 0, 1, 1, 'a:6:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:4:"time";i:4;s:5:"place";i:5;s:11:"applynumber";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(83, 'group_trade', '[内置]商品列表', 'a:9:{s:3:"raw";s:288:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n

      {price}

      \r\n
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:222:"
  • \r\n {title}\r\n

    {title}

    \r\n

    {price}

    \r\n
  • ";}', 'edd331a7', 1, 0, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:5:"price";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(84, 'group_activity', '[内置]活动列表', 'a:9:{s:3:"raw";s:331:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {time} {place}
    \r\n
    已有 {applynumber} 人报名
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:277:"
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    {time} {place}
    \r\n
    已有 {applynumber} 人报名
    \r\n
    ";}', '502cc3f6', 1, 0, 1, 1, 'a:6:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:4:"time";i:4;s:5:"place";i:5;s:11:"applynumber";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(85, 'forum_thread', '[内置]文章作者+标题+摘要(带头像)', 'a:9:{s:3:"raw";s:468:"
    \r\n[loop]\r\n
    \r\n
    {author}
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    作者: {author}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:409:"
    \r\n
    {author}
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    作者: {author}
    \r\n
    ";}', '87d533ea', 0, 1, 0, 1, 'a:6:{i:0;s:8:"authorid";i:1;s:6:"avatar";i:2;s:6:"author";i:3;s:3:"url";i:4;s:5:"title";i:5;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(86, 'portal_article', '[内置]频道栏目+标题', 'a:9:{s:3:"raw";s:205:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:135:"
  • {title}
  • ";}', '7720f457', 0, 0, 0, 1, 'a:4:{i:0;s:6:"caturl";i:1;s:7:"catname";i:2;s:3:"url";i:3;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(87, 'forum_thread', '[内置]悬赏主题专用样式', 'a:9:{s:3:"raw";s:139:"
    \r\n
      \r\n[loop]\r\n
    • {title}{summary}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:69:"
  • {title}{summary}
  • ";}', '56bffda0', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(88, 'forum_thread', '[内置]首页热议-文章', 'a:9:{s:3:"raw";s:278:"
    \r\n[loop]\r\n
    \r\n
    {author} ›
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:224:"
    \r\n
    {author} ›
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '08596517', 0, 1, 0, 1, 'a:4:{i:0;s:6:"author";i:1;s:3:"url";i:2;s:5:"title";i:3;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(89, 'group_thread', '[内置]首页热议-圈子文章', 'a:9:{s:3:"raw";s:278:"
    \r\n[loop]\r\n
    \r\n
    {author} ›
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:224:"
    \r\n
    {author} ›
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', 'a75db897', 0, 1, 0, 1, 'a:4:{i:0;s:6:"author";i:1;s:3:"url";i:2;s:5:"title";i:3;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(90, 'space_blog', '[内置]首页热议-日志', 'a:9:{s:3:"raw";s:280:"
    \r\n[loop]\r\n
    \r\n
    {username} ›
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:226:"
    \r\n
    {username} ›
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '9e68bc9b', 0, 1, 0, 1, 'a:4:{i:0;s:8:"username";i:1;s:3:"url";i:2;s:5:"title";i:3;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(91, 'forum_thread', '[内置]投票主题专用样式', 'a:9:{s:3:"raw";s:166:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:105:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', 'fa07a66f', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(92, 'forum_thread', '[内置]辩论主题专用样式', 'a:9:{s:3:"raw";s:168:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:105:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    ";}', '6a480986', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(93, 'group_activity', '[内置]圈子活动:大图+摘要', 'a:9:{s:3:"raw";s:368:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    \r\n

    {summary}

    \r\n

    {place} {class}

    \r\n

    时间: {time}

    \r\n

    {applynumber} 人关注

    \r\n
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:314:"
    \r\n
    {title}
    \r\n
    {title}
    \r\n
    \r\n

    {summary}

    \r\n

    {place} {class}

    \r\n

    时间: {time}

    \r\n

    {applynumber} 人关注

    \r\n
    \r\n
    ";}', '11d4011e', 1, 1, 0, 1, 'a:8:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:7:"summary";i:4;s:5:"place";i:5;s:5:"class";i:6;s:4:"time";i:7;s:11:"applynumber";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(94, 'group_activity', '[内置]圈子活动:小图+标题', 'a:9:{s:3:"raw";s:382:"
    \r\n[loop]\r\n
    \r\n
    \r\n
    {title}
    \r\n
    {time} {place}
    \r\n
    {applynumber} 人关注
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:328:"
    \r\n
    \r\n
    {title}
    \r\n
    {time} {place}
    \r\n
    {applynumber} 人关注
    \r\n
    ";}', '51658dfa', 1, 0, 0, 1, 'a:6:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:4:"time";i:4;s:5:"place";i:5;s:11:"applynumber";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(95, 'space_album', '[内置]相册列表(竖线分隔)', 'a:9:{s:3:"raw";s:594:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title} ({picnum})

      \r\n
    • \r\n[/loop]\r\n[order=odd]\r\n
    • \r\n {title}\r\n

      {title} ({picnum})

      \r\n
    • \r\n[/order]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:1:{s:3:"odd";s:279:"
  • \r\n {title}\r\n

    {title} ({picnum})

    \r\n
  • ";}s:8:"loopplus";a:0:{}s:4:"loop";s:224:"
  • \r\n {title}\r\n

    {title} ({picnum})

    \r\n
  • ";}', '771549b7', 1, 0, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:6:"picnum";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(96, 'space_pic', '[内置]图片列表(竖线分隔)', 'a:9:{s:3:"raw";s:556:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n
    • \r\n[/loop]\r\n[order=odd]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n
    • \r\n[/order]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:1:{s:3:"odd";s:268:"
  • \r\n {title}\r\n

    {title}

    \r\n
  • ";}s:8:"loopplus";a:0:{}s:4:"loop";s:197:"
  • \r\n {title}\r\n

    {title}

    \r\n
  • ";}', 'ab23af19', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(97, 'portal_article', '[内置]碎片式文章标题列表', 'a:9:{s:3:"raw";s:261:"
    \r\n
      \r\n[loop]\r\n
    • {title}\r\n[/loop]\r\n[order=even]\r\n{title}
    • \r\n[/order]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:1:{s:4:"even";s:110:"{title}";}s:8:"loopplus";a:0:{}s:4:"loop";s:55:"
  • {title}";}', 'bc85eab4', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(98, 'portal_article', '[内置]文章封面列表(竖线分隔)', 'a:9:{s:3:"raw";s:556:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n
    • \r\n[/loop]\r\n[order=odd]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n
    • \r\n[/order]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:1:{s:3:"odd";s:268:"
  • \r\n {title}\r\n

    {title}

    \r\n
  • ";}s:8:"loopplus";a:0:{}s:4:"loop";s:197:"
  • \r\n {title}\r\n

    {title}

    \r\n
  • ";}', '6b653acb', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(99, 'html_announcement', '[内置]站点公告', 'a:9:{s:3:"raw";s:197:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:134:"
  • 公告{title}({starttime})
  • ";}', '1f88cc82', 0, 0, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:9:"starttime";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(100, 'forum_thread', '[内置]文章图文展示', 'a:9:{s:3:"raw";s:374:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:320:"
    \r\n
    {title}
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    ";}', '881ee4a3', 1, 1, 1, 1, 'a:6:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:8:"authorid";i:4;s:6:"author";i:5;s:7:"summary";}'); +INSERT INTO pre_common_block_style (styleid, blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES(101, 'group_thread', '[内置]文章图文列表', 'a:9:{s:3:"raw";s:374:"
    \r\n[loop]\r\n
    \r\n
    {title}
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    \r\n[/loop]\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:320:"
    \r\n
    {title}
    \r\n
    {author}{title}
    \r\n
    {summary}
    \r\n
    ";}', 'b67132d6', 1, 1, 1, 1, 'a:6:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";i:3;s:8:"authorid";i:4;s:6:"author";i:5;s:7:"summary";}'); +-- [key:a2f9089e] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('group_thread', '[内置][圈子名]+圈子文章标题', 'a:9:{s:3:"raw";s:177:"
    \r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:107:"
  • [{groupname}] {title}
  • ";}', 'a2f9089e', 0, 0, 0, 1, 'a:4:{i:0;s:8:"groupurl";i:1;s:9:"groupname";i:2;s:3:"url";i:3;s:5:"title";}'); +-- [/key] +-- [key:b921ea24] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('other_otherfriendlink', '[内置]友情链接图文', 'a:9:{s:3:"raw";s:298:"
    \r\n
      \r\n[loop]\r\n
    • \r\n\r\n
      {title}

      {summary}

      \r\n
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:226:"
  • \r\n\r\n
    {title}

    {summary}

    \r\n
  • ";}', 'b921ea24', 0, 1, 1, 1, 'a:4:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:3:"pic";i:3;s:7:"summary";}'); +-- [/key] +-- [key:c8d00338] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('other_otherfriendlink', '[内置]友情链接仅图片', 'a:9:{s:3:"raw";s:147:"
    \r\n
    \r\n[loop]\r\n{title}\r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:71:"{title}";}', 'c8d00338', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:3:"pic";}'); +-- [/key] +-- [key:b615e0d0] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('other_otherfriendlink', '[内置]友情链接仅文字', 'a:9:{s:3:"raw";s:118:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:45:"
  • {title}
  • ";}', 'b615e0d0', 0, 0, 0, 1, 'a:2:{i:0;s:3:"url";i:1;s:5:"title";}'); +-- [/key] +-- [key:027d3e60] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('other_otherstat', '[内置]全部统计信息', 'a:9:{s:3:"raw";s:664:"[loop]
    \r\n
      \r\n
    • {posts_title}:{posts}
    • \r\n
    • {groups_title}:{groups}
    • \r\n
    • {members_title}:{members}
    • \r\n
    • {groupnewposts_title}:{groupnewposts}
    • \r\n
    • {bbsnewposts_title}:{bbsnewposts}
    • \r\n
    • {bbslastposts_title}:{bbslastposts}
    • \r\n
    • {onlinemembers_title}:{onlinemembers}
    • \r\n
    • {maxmembers_title}:{maxmembers}
    • \r\n
    • {doings_title}:{doings}
    • \r\n
    • {blogs_title}:{blogs}
    • \r\n
    • {albums_title}:{albums}
    • \r\n
    • {pics_title}:{pics}
    • \r\n
    • {shares_title}:{shares}
    • \r\n
    \r\n
    \r\n[/loop]";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:649:"
    \r\n
      \r\n
    • {posts_title}:{posts}
    • \r\n
    • {groups_title}:{groups}
    • \r\n
    • {members_title}:{members}
    • \r\n
    • {groupnewposts_title}:{groupnewposts}
    • \r\n
    • {bbsnewposts_title}:{bbsnewposts}
    • \r\n
    • {bbslastposts_title}:{bbslastposts}
    • \r\n
    • {onlinemembers_title}:{onlinemembers}
    • \r\n
    • {maxmembers_title}:{maxmembers}
    • \r\n
    • {doings_title}:{doings}
    • \r\n
    • {blogs_title}:{blogs}
    • \r\n
    • {albums_title}:{albums}
    • \r\n
    • {pics_title}:{pics}
    • \r\n
    • {shares_title}:{shares}
    • \r\n
    \r\n
    ";}', '027d3e60', 0, 0, 0, 0, 'a:26:{i:0;s:11:"posts_title";i:1;s:5:"posts";i:2;s:12:"groups_title";i:3;s:6:"groups";i:4;s:13:"members_title";i:5;s:7:"members";i:6;s:19:"groupnewposts_title";i:7;s:13:"groupnewposts";i:8;s:17:"bbsnewposts_title";i:9;s:11:"bbsnewposts";i:10;s:18:"bbslastposts_title";i:11;s:12:"bbslastposts";i:12;s:19:"onlinemembers_title";i:13;s:13:"onlinemembers";i:14;s:16:"maxmembers_title";i:15;s:10:"maxmembers";i:16;s:12:"doings_title";i:17;s:6:"doings";i:18;s:11:"blogs_title";i:19;s:5:"blogs";i:20;s:12:"albums_title";i:21;s:6:"albums";i:22;s:10:"pics_title";i:23;s:4:"pics";i:24;s:12:"shares_title";i:25;s:6:"shares";}'); +-- [/key] +-- [key:9e2ea31f] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('forum_thread', '[内置]一简介+两列标题', 'a:9:{s:3:"raw";s:284:"
    \r\n[index=1]\r\n
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n
    \r\n[/index]\r\n\r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:1:{i:1;s:127:"
    \r\n
    {title}
    \r\n
    {summary}
    \r\n
    \r\n
    ";}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:60:"
  • {title}
  • ";}', '9e2ea31f', 0, 1, 0, 1, 'a:3:{i:0;s:3:"url";i:1;s:5:"title";i:2;s:7:"summary";}'); +-- [/key] +-- [key:cba1f109] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('forum_thread', '[内置]文章图片幻灯片', 'a:9:{s:3:"raw";s:333:"
    \r\n
      \r\n[loop]\r\n
    • {title}
    • \r\n[/loop]\r\n
    \r\n
    \r\n";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:182:"
  • {title}
  • ";}', 'cba1f109', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +-- [/key] +-- [key:0ab2e307] +INSERT INTO pre_common_block_style (blockclass, `name`, template, `hash`, getpic, getsummary, makethumb, settarget, `fields`) VALUES('forum_thread', '[内置]文章图片列表', 'a:9:{s:3:"raw";s:271:"
    \r\n
      \r\n[loop]\r\n
    • \r\n {title}\r\n

      {title}

      \r\n
    • \r\n[/loop]\r\n
    \r\n
    ";s:6:"footer";s:0:"";s:6:"header";s:0:"";s:9:"indexplus";a:0:{}s:5:"index";a:0:{}s:9:"orderplus";a:0:{}s:5:"order";a:0:{}s:8:"loopplus";a:0:{}s:4:"loop";s:205:"
  • \r\n {title}\r\n

    {title}

    \r\n
  • ";}', '0ab2e307', 1, 0, 1, 1, 'a:3:{i:0;s:3:"url";i:1;s:3:"pic";i:2;s:5:"title";}'); +-- [/key] +-- [/block_style] + +INSERT INTO `pre_common_admincp_group` (`cpgroupid`, `cpgroupname`) VALUES (1, '门户管理员'); +INSERT INTO `pre_common_admincp_group` (`cpgroupid`, `cpgroupname`) VALUES (2, '论坛管理员'); +INSERT INTO `pre_common_admincp_group` (`cpgroupid`, `cpgroupname`) VALUES (3, '圈子管理员'); +INSERT INTO `pre_common_admincp_group` (`cpgroupid`, `cpgroupname`) VALUES (4, '空间管理员'); +INSERT INTO `pre_common_admincp_group` (`cpgroupid`, `cpgroupname`) VALUES (5, '用户管理员'); + +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'albumcategory'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'article'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'block'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'blockstyle'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'blogcategory'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'portalcategory'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'topic'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, 'diytemplate'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (1, '_allowpost'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'attach'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'forums'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'forums_merge'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'misc_attachtype'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'misc_censor'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'moderate_replies'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'moderate_threads'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'prune'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'recyclebin'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'report'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'threads'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'threads_forumstick'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'threads_postposition'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, 'threadtypes'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (2, '_allowpost'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'group_deletegroup'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'group_editgroup'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'group_level'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'group_manage'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'group_setting'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'group_type'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'group_userperm'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, '_allowpost'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'threads_group'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'prune_group'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (3, 'attach_group'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'album'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'blog'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'comment'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'doing'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'feed'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'pic'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'share'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, '_allowpost'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'click'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (4, 'setting_home'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'admingroup'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_access'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_add'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_ban'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_clean'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_credit'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_edit'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_group'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_ipban'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_medal'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_newsletter'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_profile'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_repeat'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_reward'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_search'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'members_verify'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'moderate_members'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'specialuser_defaultuser'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'specialuser_follow'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'usergroups'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, '_allowpost'); +INSERT INTO `pre_common_admincp_perm` (`cpgroupid`, `perm`) VALUES (5, 'verify_verify'); + +INSERT INTO `pre_forum_threadprofile` (`id`, `name`, `template`, `global`) VALUES (1, '默认方案', 'a:2:{s:4:\"left\";s:399:\"{numbercard}\r\n{groupicon}

    {*}

    {/groupicon}\r\n{authortitle}

    {*}

    {/authortitle}\r\n{customstatus}

    {*}

    {/customstatus}\r\n{star}

    {*}

    {/star}\r\n{upgradeprogress}

    {*}

    {/upgradeprogress}\r\n
    \r\n\t
    {baseinfo=credits,1}
    {baseinfo=credits,0}
    \r\n
    \r\n{medal}

    {*}

    {/medal}\r\n
    {baseinfo=field_qq,0}
    \";s:3:\"top\";s:82:\"
    \r\n
    {baseinfo=credits,1}
    {baseinfo=credits,0}
    \r\n
    \";}', 1); diff --git a/install/include/index.htm b/install/include/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/install/include/install_extvar.php b/install/include/install_extvar.php new file mode 100644 index 0000000..864f05d --- /dev/null +++ b/install/include/install_extvar.php @@ -0,0 +1,49 @@ + array( + 1 => array('title' => $lang['init_credits_money'], 'ratio' => 0, 'available' => 1), + 2 => array('title' => $lang['init_credits_karma'], 'ratio' => 0, 'available' => 1), + ), + 'postnocustom' => array( + 0 => $lang['init_postno0'], 1 => $lang['init_postno1'], 2 => $lang['init_postno2'], 3 => $lang['init_postno3'] + ), + + 'recommendthread' => array( + 'status' => '1', + 'addtext' => $lang['init_support'], + 'subtracttext' => $lang['init_opposition'], + 'defaultshow' => '1', + 'daycount' => '0', + 'ownthread' => '0', + 'iconlevels' => '0,100,200', + ), + + 'tasktypes' => array( + 'promotion' => array( + 'name' => $lang['init_promotion_task'], + 'version' => '1.0', + ), + 'gift' => array( + 'name' => $lang['init_gift_task'], + 'version' => '1.0', + ), + 'avatar' => array( + 'name' => $lang['init_avatar_task'], + 'version' => '1.0', + ), + ), + +); + +?> \ No newline at end of file diff --git a/install/include/install_function.php b/install/include/install_function.php new file mode 100644 index 0000000..3589645 --- /dev/null +++ b/install/include/install_function.php @@ -0,0 +1,2306 @@ +\n"; + $str .= "\t\n"; + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + } else { + show_header(); + global $step; + + $title = lang($error_no); + $comment = lang($error_no.'_comment', false); + $errormsg = ''; + + if($error_msg) { + if(!empty($error_msg)) { + foreach ((array)$error_msg as $k => $v) { + if(is_numeric($k)) { + $comment .= "
  • ".lang($v)."
  • "; + } + } + } + } + + if($step > 0) { + echo "

    $title

      $comment
    "; + } else { + echo "

    $title

      $comment
    "; + } + + if($quit) { + echo '
    '.lang('error_quit_msg').'


    '; + } + + echo ''; + + echo '
    '; + + $quit && show_footer(); + } +} + +function check_db($dbhost, $dbuser, $dbpw, $dbname, $tablepre) { + if(!function_exists('mysqli_connect')) { + show_msg('undefine_func', 'mysqli_connect', 0); + } + + mysqli_report(MYSQLI_REPORT_OFF); + + $link = @new mysqli($dbhost, $dbuser, $dbpw); + if($link->connect_errno) { + $errno = $link->connect_errno; + $error = $link->connect_error; + if($errno == 1045) { + show_msg('database_errno_1045', $error, 0); + } elseif($errno == 2003) { + show_msg('database_errno_2003', $error, 0); + } else { + show_msg('database_connect_error', $error, 0); + } + return false; + } else { + if($query = $link->query("SHOW TABLES FROM $dbname")) { + if(!$query) { + return false; + } + while($row = $query->fetch_row()) { + if(preg_match("/^$tablepre/", $row[0])) { + return false; + } + } + } + } + return true; +} + +function dirfile_check(&$dirfile_items) { + foreach($dirfile_items as $key => $item) { + $item_path = $item['path']; + if($item['type'] == 'dir') { + if(!dir_writeable(ROOT_PATH.$item_path)) { + if(is_dir(ROOT_PATH.$item_path)) { + $dirfile_items[$key]['status'] = 0; + $dirfile_items[$key]['current'] = '+r'; + } else { + $dirfile_items[$key]['status'] = -1; + $dirfile_items[$key]['current'] = 'nodir'; + } + } else { + $dirfile_items[$key]['status'] = 1; + $dirfile_items[$key]['current'] = '+r+w'; + } + } else { + if(file_exists(ROOT_PATH.$item_path)) { + if(is_writable(ROOT_PATH.$item_path)) { + $dirfile_items[$key]['status'] = 1; + $dirfile_items[$key]['current'] = '+r+w'; + } else { + $dirfile_items[$key]['status'] = 0; + $dirfile_items[$key]['current'] = '+r'; + } + } else { + if(dir_writeable(dirname(ROOT_PATH.$item_path))) { + $dirfile_items[$key]['status'] = 1; + $dirfile_items[$key]['current'] = '+r+w'; + } else { + $dirfile_items[$key]['status'] = -1; + $dirfile_items[$key]['current'] = 'nofile'; + } + } + } + } +} + +function env_check(&$env_items) { + foreach($env_items as $key => $item) { + if($key == 'php') { + $env_items[$key]['current'] = PHP_VERSION; + } elseif($key == 'attachmentupload') { + $env_items[$key]['current'] = @ini_get('file_uploads') ? getmaxupload() : 'unknow'; + } elseif($key == 'gdversion') { + $tmp = function_exists('gd_info') ? gd_info() : array(); + $env_items[$key]['current'] = empty($tmp['GD Version']) ? 'noext' : $tmp['GD Version']; + unset($tmp); + } elseif($key == 'diskspace') { + if(function_exists('disk_free_space')) { + $env_items[$key]['current'] = disk_free_space(ROOT_PATH); + } else { + $env_items[$key]['current'] = 'unknow'; + } + } elseif(isset($item['c'])) { + $env_items[$key]['current'] = constant($item['c']); + } elseif($key == 'opcache') { + $opcache_data = function_exists('opcache_get_configuration') ? opcache_get_configuration() : array(); + $env_items[$key]['current'] = !empty($opcache_data['directives']['opcache.enable']) ? 'enable' : 'disable'; + } elseif($key == 'curl') { + if(function_exists('curl_init') && function_exists('curl_version')){ + $v = curl_version(); + $env_items[$key]['current'] = 'enable'.' '.$v['version']; + }else{ + $env_items[$key]['current'] = 'disable'; + } + } elseif(isset($item['f'])) { + $env_items[$key]['current'] = function_exists($item['f']) ? 'enable' : 'disable'; + } + + $env_items[$key]['status'] = 1; + if($item['r'] != 'notset' && strcmp($env_items[$key]['current'], $item['r']) < 0) { + $env_items[$key]['status'] = 0; + } + } +} + +function function_check(&$func_items) { + foreach($func_items as $item) { + function_exists($item) or show_msg('undefine_func', $item, 0); + } +} + +function dfloatval($int, $allowarray = false) { + $ret = floatval($int); + if($int == $ret || !$allowarray && is_array($int)) return $ret; + if($allowarray && is_array($int)) { + foreach($int as &$v) { + $v = dfloatval($v, true); + } + return $int; + } elseif($int <= 0xffffffff) { + $l = strlen($int); + $m = substr($int, 0, 1) == '-' ? 1 : 0; + if(($l - $m) === strspn($int,'0987654321', $m)) { + return $int; + } + } + return $ret; +} +function show_env_result(&$env_items, &$dirfile_items, &$func_items, &$filesock_items) { + + $env_str = $file_str = $dir_str = $func_str = ''; + $error_code = 0; + + foreach($env_items as $key => $item) { + if($key == 'php' && strcmp($item['current'], $item['r']) < 0) { + show_msg('php_version_too_low', $item['current'], 0); + } + $status = 1; + if($item['r'] != 'notset') { + if(dfloatval($item['current']) && dfloatval($item['r'])) { + if(dfloatval($item['current']) < dfloatval($item['r'])) { + $status = 0; + $error_code = ENV_CHECK_ERROR; + } + } else { + if(strcmp($item['current'], $item['r']) < 0) { + $status = 0; + $error_code = ENV_CHECK_ERROR; + } + } + } + if($key == 'diskspace') { + $item['current'] = format_space($item['current']); + $item['r'] = format_space($item['r']); + } + if(VIEW_OFF) { + $env_str .= "\t\t\n"; + } else { + $env_str .= '\n"; + $env_str .= "".lang($key)."\n"; + $env_str .= "".lang($item['r'])."\n"; + $env_str .= "".lang($item['b'])."\n"; + $env_str .= ($status ? "" : "").lang($item['current'])."\n"; + $env_str .= "\n"; + } + } + + foreach($dirfile_items as $key => $item) { + $tagname = $item['type'] == 'file' ? 'File' : 'Dir'; + $variable = $item['type'].'_str'; + + if(VIEW_OFF) { + if($item['status'] == 0) { + $error_code = ENV_CHECK_ERROR; + } + $$variable .= "\t\t\t\n"; + } else { + $$variable .= '\n"; + $$variable .= "{$item['path']}".lang('writeable')."\n"; + if($item['status'] == 1) { + $$variable .= "".lang('writeable')."\n"; + } elseif($item['status'] == -1) { + $error_code = ENV_CHECK_ERROR; + $$variable .= "".lang('nodir')."\n"; + } else { + $error_code = ENV_CHECK_ERROR; + $$variable .= "".lang('unwriteable')."\n"; + } + $$variable .= "\n"; + } + } + + if(VIEW_OFF) { + + $str = "\n"; + $str .= "\t\n"; + $str .= $env_str; + $str .= "\t\n"; + $str .= "\t\n"; + $str .= "\t\t\n"; + $str .= $dir_str; + $str .= "\t\t\n"; + $str .= "\t\t\n"; + $str .= $file_str; + $str .= "\t\t\n"; + $str .= "\t\n"; + $str .= "\t\n"; + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + + } else { + + show_header(); + + echo "

    ".lang('env_check')."

    \n"; + echo "\n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n"; + echo $env_str; + echo "
    ".lang('project')."".lang('ucenter_required')."".lang('ucenter_best')."".lang('curr_server')."
    \n"; + + echo "

    ".lang('priv_check')."

    \n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n"; + echo $file_str; + echo $dir_str; + echo "
    ".lang('step1_file')."".lang('step1_need_status')."".lang('step1_status')."
    \n"; + + foreach($func_items as $item) { + $status = function_exists($item); + $func_str .= '\n"; + $func_str .= "$item()\n"; + if($status) { + $func_str .= "".lang('supportted')."\n"; + $func_str .= "".lang('none')."\n"; + } else { + $error_code = ENV_CHECK_ERROR; + $func_str .= "".lang('unsupportted')."\n"; + $func_str .= "".lang('advice_'.$item)."\n"; + } + } + $func_strextra = ''; + $filesock_disabled = 0; + foreach($filesock_items as $item) { + $status = function_exists($item); + $func_strextra .= '\n"; + $func_strextra .= "$item()\n"; + if($status) { + $func_strextra .= "".lang('supportted')."\n"; + $func_strextra .= "".lang('none')."\n"; + break; + } else { + $filesock_disabled++; + $func_strextra .= "".lang('unsupportted')."\n"; + $func_strextra .= "".lang('advice_'.$item)."\n"; + } + } + if($filesock_disabled == count($filesock_items)) { + $error_code = ENV_CHECK_ERROR; + } + echo "

    ".lang('func_depend')."

    \n"; + echo "\n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n"; + echo $func_str.$func_strextra; + echo "
    ".lang('func_name')."".lang('check_result')."".lang('suggestion')."
    \n"; + + echo << + document.querySelectorAll('.box').forEach(function(elem){ + if(!elem.querySelector('.nw')) { + elem.classList.add('valid','collapse'); + elem.addEventListener('click',function(){ + this.classList.contains('collapse') ? this.classList.remove('collapse') : this.classList.add('collapse'); + }); + } + }); + +EOT; + + show_next_step(2, $error_code); + + show_footer(); + + } + +} + +function show_next_step($step, $error_code) { + global $uchidden; + + if(!empty($uchidden)) { + $uc_info_transfer = unserialize(urldecode($uchidden)); + if(!isset($uc_info_transfer['ucapi']) && !isset($uc_info_transfer['ucfounderpw'])){ + $uchidden = ''; + } else { + $uchidden = dhtmlspecialchars($uchidden); + } + } + + echo "
    \n"; + echo ""; + if(isset($GLOBALS['hidden'])) { + echo $GLOBALS['hidden']; + } + echo ""; + if($uchidden) { + echo ""; + } + if($error_code == 0) { + $nextstep = "\n"; + } else { + $nextstep = "\n"; + } + echo "
    ".$nextstep."
    \n"; + echo "
    \n"; +} + +function show_form(&$form_items, $error_msg) { + + global $step, $uchidden; + + if(empty($form_items) || !is_array($form_items)) { + return; + } + + show_header(); + show_setting('start'); + show_setting('hidden', 'step', $step); + if($step == 2) { + echo '
    '; + show_tips('install_dzstandalone'); + show_tips('install_dzfull'); + show_tips('install_dzonly'); + echo '
    '; + } else { + show_setting('hidden', 'install_ucenter', getgpc('install_ucenter')); + } + $is_first = 1; + if(!empty($uchidden)) { + $uc_info_transfer = unserialize(urldecode($uchidden)); + } + echo '
    '; + foreach($form_items as $key => $items) { + global ${'error_'.$key}; + if($is_first == 0) { + echo '
    '; + } + + if(!${'error_'.$key}) { + show_tips('tips_'.$key); + } else { + show_error('tips_admin_config', ${'error_'.$key}); + } + + echo '
    '; + foreach($items as $k => $v) { + $value = ''; + if(!empty($error_msg)) { + $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : ''; + } + if(empty($value)) { + if(isset($v['value']) && is_array($v['value'])) { + if($v['value']['type'] == 'constant') { + $value = defined($v['value']['var']) ? constant($v['value']['var']) : $v['value']['var']; + } else { + $value = $GLOBALS[$v['value']['var']]; + } + } else { + $value = ''; + } + } + + if($k == 'ucurl' && isset($uc_info_transfer['ucapi'])) { + $value = $uc_info_transfer['ucapi']; + } elseif($k == 'ucpw' && isset($uc_info_transfer['ucfounderpw'])) { + $value = $uc_info_transfer['ucfounderpw']; + } elseif($k == 'ucip') { + $value = ''; + } + + show_setting($k, $key.'['.$k.']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key.'_'.$k.'_invalid' : ''); + } + + if($is_first) { + $is_first = 0; + } + } + echo '
    '; + echo '
    '; + echo '
    '; + show_setting('', 'submitname', 'new_step', ($step == 2 ? 'submit|oldbtn' : 'submit' )); + echo '
    '; + show_setting('end'); + show_footer(); +} + +function dunserialize($data) { + if(($ret = unserialize($data)) === false) { + $ret = unserialize(stripslashes($data)); + } + return $ret; +} + +function cloudaddons_getversion($instid) { + $timestamp = time(); + $data = 'product=discuzx&sitever='.DISCUZ_VERSION.'/'.DISCUZ_RELEASE.'&sitecharset='.CHARSET.'&addonversion=1&os='.PHP_OS .'&php='.PHP_VERSION.'&web='.$_SERVER['SERVER_SOFTWARE'].'&lang='.INSTALL_LANG.'&type=installer&instid='.$instid; + $param = 'data='.rawurlencode(base64_encode($data)); + $param .= '&md5hash='.substr(md5($data.$timestamp), 8, 8).'×tamp='.$timestamp; + $param .= '&mod=app&ac=installcheck'; + + $url = 'https://addon.dismall.com/index.php?'.$param; + + $return = dfopen($url, 0, '', '', FALSE, '', 3); + + if(!empty($return)) { + $ret = dunserialize($return); + if(is_array($ret) && isset($ret['is_latest']) && !$ret['is_latest']) { + return $ret; + } else { + return array('is_latest' => 1, 'url' => ''); + } + } else { + return array('is_latest' => 1, 'url' => ''); + } +} + +function show_license() { + global $self, $uchidden, $step, $instid; + $next = $step + 1; + if(VIEW_OFF) { + + show_msg('license_contents', lang('license'), 1); + + } else { + + show_header(); + + $license = str_replace(' ', '  ', lang('license')); + $lang_agreement_yes = lang('agreement_yes'); + $lang_agreement_no = lang('agreement_no'); + + $lang_php8 = lang('php8_tips'); + $lang_noutf8 = lang('no_utf8_tips').lang('next_tips'); + $lang_unstable = lang('unstable_tips').lang('next_tips'); + + $is_php8 = version_compare(PHP_VERSION, '9.0.0', '>=') ? 1 : 0; + $is_utf8 = (strtolower(CHARSET) == 'utf-8') ? 1 : 0; + $is_unstable = (strlen(DISCUZ_RELEASE) != 8 || DISCUZ_RELEASE == 20180101) ? 1 : 0; + + $info = cloudaddons_getversion($instid); + + $hrefurl = empty($info['url']) ? 'https://gitee.com/Discuz/DiscuzX/releases' : $info['url']; + + if($info['is_latest']) { + $is_latest = 1; + $lang_nolatest = lang('no_latest_tips').lang('next_tips'); + } else { + $is_latest = 0; + $lang_nolatest = empty($info['tips']) ? (lang('no_latest_tips').lang('next_tips')) : ($info['tips'].lang('next_tips')); + } + + echo << +
    +
    $license
    +
    +
    + + + + +
    +
    + +EOT; + + show_footer(); + + } +} + +function transfer_ucinfo(&$post) { + global $uchidden; + if(isset($post['ucapi']) && isset($post['ucfounderpw'])) { + $arr = array( + 'ucapi' => $post['ucapi'], + 'ucfounderpw' => $post['ucfounderpw'] + ); + $uchidden = urlencode(serialize($arr)); + } else { + $uchidden = ''; + } +} + +function createtable($sql, $dbver) { + $type = strtoupper(preg_replace("/^\s*CREATE TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU", "\\2", $sql)); + $type = in_array($type, array('INNODB', 'MYISAM', 'HEAP', 'MEMORY')) ? $type : 'INNODB'; + return preg_replace("/^\s*(CREATE TABLE\s+.+\s+\(.+?\)).*$/isU", "\\1", $sql) . + " ENGINE=$type DEFAULT CHARSET=" . DBCHARSET . + (DBCHARSET === 'utf8mb4' ? " COLLATE=utf8mb4_unicode_ci" : ""); +} + +function dir_writeable($dir) { + $writeable = 0; + if(!is_dir($dir)) { + @mkdir($dir, 0777); + } + if(is_dir($dir)) { + if($fp = @fopen("$dir/test.txt", 'w')) { + @fclose($fp); + @unlink("$dir/test.txt"); + $writeable = 1; + } else { + $writeable = 0; + } + } + return $writeable; +} + +function dir_clear($dir) { + global $lang; + showjsmessage($lang['clear_dir'] . ' ' . str_replace(ROOT_PATH, '', $dir) . "\n"); + if($directory = @dir($dir)) { + while($entry = $directory->read()) { + $filename = $dir.'/'.$entry; + if(is_file($filename)) { + @unlink($filename); + } + } + $directory->close(); + @touch($dir.'/index.htm'); + } +} + +function show_header() { + define('SHOW_HEADER', TRUE); + global $step; + $version = DISCUZ_VERSION; + $release = DISCUZ_RELEASE; + $install_lang = lang(INSTALL_LANG); + $title = lang('title_install'); + $titlehtml = ''.SOFT_NAME.''.lang('install_wizard'); + $nostep = $step > 0 ? '' : ' nostep'; + $charset = CHARSET; + $reldisp = is_numeric(DISCUZ_RELEASE) ? ('Release ' . DISCUZ_RELEASE) : DISCUZ_RELEASE; + echo << + + + + + +$title + + + + + +
    +
    +

    $titlehtml

    + Discuz! $version $install_lang $reldisp +EOT; + + $step > 0 && show_step($step); + echo "\r\n"; + echo str_repeat(' ', 1024 * 4); + echo "\r\n"; + flush(); + ob_flush(); +} + +function show_footer($quit = true) { + + $copy = lang('copyright'); + + echo <<$copy
    +
    +
    + + +EOT; + $quit && exit(); +} + +function showjsmessage($message) { + if(VIEW_OFF) return; + append_to_install_log_file($message); +} + +function random($length, $numeric = 0) { + $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35); + $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed)); + if($numeric) { + $hash = ''; + } else { + $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64); + $length--; + } + $max = strlen($seed) - 1; + for($i = 0; $i < $length; $i++) { + $hash .= $seed[mt_rand(0, $max)]; + } + return $hash; +} + +function secrandom($length, $numeric = 0, $strong = false) { + $chars = $numeric ? array('A','B','+','/','=') : array('+','/','='); + $num_find = str_split('CDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'); + $num_repl = str_split('01234567890123456789012345678901234567890123456789'); + $isstrong = false; + if(function_exists('random_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + return random_bytes($length); + }; + } elseif(extension_loaded('mcrypt') && function_exists('mcrypt_create_iv')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + if ($rand !== false && strlen($rand) === $length) { + return $rand; + } else { + return false; + } + }; + } elseif(extension_loaded('openssl') && function_exists('openssl_random_pseudo_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = openssl_random_pseudo_bytes($length, $secure); + if($secure === true) { + return $rand; + } else { + return false; + } + }; + } + if(!$isstrong) { + return $strong ? false : random($length, $numeric); + } + $retry_times = 0; + $return = ''; + while($retry_times < 128) { + $getlen = $length - strlen($return); // 33% extra bytes + $bytes = $random_bytes(max($getlen, 12)); + if($bytes === false) { + return false; + } + $bytes = str_replace($chars, '', base64_encode($bytes)); + $return .= substr($bytes, 0, $getlen); + if(strlen($return) == $length) { + return $numeric ? str_replace($num_find, $num_repl, $return) : $return; + } + $retry_times++; + } +} + +function redirect($url) { + + echo ""; + exit(); + +} + +function validate_ip($ip) { + return filter_var($ip, FILTER_VALIDATE_IP) !== false; +} + +function get_onlineip() { + $onlineip = $_SERVER['REMOTE_ADDR']; + if (isset($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) { + $onlineip = $_SERVER['HTTP_CLIENT_IP']; + } elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ",") > 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $onlineip = validate_ip(trim($exp[0])) ? $exp[0] : $onlineip; + } else { + $onlineip = validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $onlineip; + } + } + return $onlineip; +} + +function timezone_set($timeoffset = 8) { + if(function_exists('date_default_timezone_set')) { + @date_default_timezone_set('Etc/GMT'.($timeoffset > 0 ? '-' : '+').(abs($timeoffset))); + } +} + +function save_config_file($filename, $config, $default) { + $config = setdefault($config, $default); + $date = gmdate("Y-m-d H:i:s", time() + 3600 * 8); + $content = << $config)); + $content .= "\r\n// ".str_pad(' THE END ', 50, '-', STR_PAD_BOTH)." //\r\n\r\n?>"; + file_put_contents($filename, $content); +} + +function setdefault($var, $default) { + foreach ($default as $k => $v) { + if(!isset($var[$k])) { + $var[$k] = $default[$k]; + } elseif(is_array($v)) { + $var[$k] = setdefault($var[$k], $default[$k]); + } + } + return $var; +} + +function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + + $ckey_length = 4; + + $key = md5($key ? $key : UC_KEY); + $keya = md5(substr($key, 0, 16)); + $keyb = md5(substr($key, 16, 16)); + $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; + + $cryptkey = $keya.md5($keya.$keyc); + $key_length = strlen($cryptkey); + + $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; + $string_length = strlen($string); + + $result = ''; + $box = range(0, 255); + + $rndkey = array(); + for($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($cryptkey[$i % $key_length]); + } + + for($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + + for($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); + } + + if($operation == 'DECODE') { + if(((int)substr($result, 0, 10) == 0 || (int)substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26).$keyb), 0, 16)) { + return substr($result, 26); + } else { + return ''; + } + } else { + return $keyc.str_replace('=', '', base64_encode($result)); + } + +} + +function show_db_install() { + if(VIEW_OFF) return; + global $dbhost, $dbuser, $dbpw, $dbname, $tablepre, $username, $password, $email, $uid, $myisam2innodb; + $dzucfull = DZUCFULL; + $dzucstl = DZUCSTL ? 1 : 0; + $succlang = $myisam2innodb ? 'initdbinnodbresult_succ' : 'initdbdataresult_succ'; + $allinfo = base64_encode(serialize(compact('dbhost', 'dbuser', 'dbpw', 'dbname', 'tablepre', 'username', 'password', 'email', 'dzucfull', 'dzucstl', 'uid', 'myisam2innodb'))); + init_install_log_file(); +?> + +
    +
    + +
    +query(createtable($query, $db->version()))) { + showjsmessage(lang('create_table').' '.$name.' ... '.lang('succeed') . "\n"); + } else { + showjsmessage(lang('create_table').' '.$name.' ... '.lang('failed') . "\n"); + return false; + } + } elseif(substr($query, 0, 6) == 'INSERT') { + $name = preg_replace("/INSERT\s+INTO\s+[\`]?([a-z0-9_]+)[\`]? .*/is", "\\1", $query); + if ($db->query($query)) { + if($oldtablename != $name) { + showjsmessage(lang('init_table_data').' '.$name.' ... '.lang('succeed') . "\n"); + $oldtablename = $name; + } + } else { + showjsmessage(lang('init_table_data').' '.$name.' ... '.lang('failed') . "\n"); + return false; + } + }else{ + if (!$db->query($query)) { + showjsmessage(lang('failed') . "\n"); + return false; + } + } + + } + } + return true; +} + +function runucquery($sql, $tablepre) { + global $lang, $db; + + if(!isset($sql) || empty($sql)) return; + + $sql = str_replace("\r", "\n", str_replace(' uc_', ' '.$tablepre, $sql)); + $ret = array(); + $num = 0; + foreach(explode(";\n", trim($sql)) as $query) { + $ret[$num] = ''; + $queries = explode("\n", trim($query)); + foreach($queries as $query) { + $ret[$num] .= (isset($query[0]) && $query[0] == '#') || (isset($query[1]) && isset($query[1]) && $query[0].$query[1] == '--') ? '' : $query; + } + $num++; + } + unset($sql); + + foreach($ret as $query) { + $query = trim($query); + if($query) { + if(substr($query, 0, 12) == 'CREATE TABLE') { + $name = preg_replace("/CREATE TABLE ([a-z0-9_]+) .*/is", "\\1", $query); + if($db->query(createtable($query, $db->version()))) { + showjsmessage(lang('create_table').' '.$name.' ... '.lang('succeed') . "\n"); + } else { + showjsmessage(lang('create_table').' '.$name.' ... '.lang('failed') . "\n"); + return false; + } + } else { + if (!$db->query($query)) { + showjsmessage(lang('failed') . "\n"); + return false; + } + } + + } + } + return true; +} + + +function charcovert($string) { + return str_replace('\'', '\\\'', $string); +} + +function insertconfig($s, $find, $replace) { + if(preg_match($find, $s)) { + $s = preg_replace($find, $replace, $s); + } else { + $s .= "\r\n".$replace; + } + return $s; +} + +function getgpc($k, $t='GP') { + $t = strtoupper($t); + switch($t) { + case 'GP' : isset($_POST[$k]) ? $var = &$_POST : $var = &$_GET; break; + case 'G': $var = &$_GET; break; + case 'P': $var = &$_POST; break; + case 'C': $var = &$_COOKIE; break; + case 'R': $var = &$_REQUEST; break; + } + return isset($var[$k]) ? $var[$k] : null; +} + +function var_to_hidden($k, $v) { + return "\n"; +} + +function fsocketopen($hostname, $port = 80, &$errno = null, &$errstr = null, $timeout = 15) { + $fp = ''; + if(function_exists('fsockopen')) { + $fp = @fsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('pfsockopen')) { + $fp = @pfsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('stream_socket_client')) { + $fp = @stream_socket_client($hostname.':'.$port, $errno, $errstr, $timeout); + } + return $fp; +} + +function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $return = ''; + $matches = parse_url($url); + $scheme = strtolower($matches['scheme']); + $host = $matches['host']; + $path = !empty($matches['path']) ? $matches['path'].(!empty($matches['query']) ? '?'.$matches['query'] : '') : '/'; + $port = !empty($matches['port']) ? $matches['port'] : ($scheme == 'https' ? 443 : 80); + + if(function_exists('curl_init') && function_exists('curl_exec') && $allowcurl) { + $ch = curl_init(); + $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); + curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + if(!empty($ip) && filter_var($ip, FILTER_VALIDATE_IP) && !filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + if($post) { + curl_setopt($ch, CURLOPT_POST, 1); + if($encodetype == 'URLENCODE') { + curl_setopt($ch, CURLOPT_POSTFIELDS, $post); + } else { + parse_str($post, $postarray); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postarray); + } + } + if($cookie) { + curl_setopt($ch, CURLOPT_COOKIE, $cookie); + } + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); + $data = curl_exec($ch); + $status = curl_getinfo($ch); + $errno = curl_errno($ch); + curl_close($ch); + if($errno || $status['http_code'] != 200) { + return; + } else { + return !$limit ? $data : substr($data, 0, $limit); + } + } + + if($post) { + $out = "POST $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + if($allowcurl) { + $encodetype = 'URLENCODE'; + } + $boundary = $encodetype == 'URLENCODE' ? '' : '; boundary='.trim(substr(trim($post), 2, strpos(trim($post), "\n") - 2)); + $header .= $encodetype == 'URLENCODE' ? "Content-Type: application/x-www-form-urlencoded\r\n" : "Content-Type: multipart/form-data$boundary\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= 'Content-Length: '.strlen($post)."\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cache-Control: no-cache\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header.$post; + } else { + $out = "GET $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header; + } + + $fpflag = 0; + $context = array(); + if($scheme == 'https') { + $context['ssl'] = array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'peer_name' => $host + ); + if(version_compare(PHP_VERSION, '5.6.0', '<')) { + $context['ssl']['SNI_enabled'] = true; + $context['ssl']['SNI_server_name'] = $host; + } + } + if(ini_get('allow_url_fopen')) { + $context['http'] = array( + 'method' => $post ? 'POST' : 'GET', + 'header' => $header, + 'timeout' => $timeout + ); + if($post) { + $context['http']['content'] = $post; + } + $context = stream_context_create($context); + $fp = @fopen($scheme.'://'.($ip ? $ip : $host).':'.$port.$path, 'b', false, $context); + $fpflag = 1; + } elseif(function_exists('stream_socket_client')) { + $context = stream_context_create($context); + $fp = @stream_socket_client(($scheme == 'https' ? 'ssl://' : '').($ip ? $ip : $host).':'.$port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context); + } else { + $fp = @fsocketopen(($scheme == 'https' ? 'ssl://' : '').($scheme == 'https' ? $host : ($ip ? $ip : $host)), $port, $errno, $errstr, $timeout); + } + + if(!$fp) { + return ''; + } else { + stream_set_blocking($fp, $block); + stream_set_timeout($fp, $timeout); + if(!$fpflag) { + @fwrite($fp, $out); + } + $status = stream_get_meta_data($fp); + if(!$status['timed_out']) { + while (!feof($fp) && !$fpflag) { + if(($header = @fgets($fp)) && ($header == "\r\n" || $header == "\n")) { + break; + } + } + + $stop = false; + while(!feof($fp) && !$stop) { + $data = fread($fp, ($limit == 0 || $limit > 8192 ? 8192 : $limit)); + $return .= $data; + if($limit) { + $limit -= strlen($data); + $stop = $limit <= 0; + } + } + } + @fclose($fp); + return $return; + } +} + +function check_env() { + + global $lang, $attachdir; + + $errors = array('quit' => false); + $quit = false; + + if(!function_exists('mysqli_connect')) { + $errors[] = 'mysqli_unsupport'; + $quit = true; + } + + if(!file_exists(ROOT_PATH.'./config.inc.php')) { + $errors[] = 'config_nonexistence'; + $quit = true; + } elseif(!is_writeable(ROOT_PATH.'./config.inc.php')) { + $errors[] = 'config_unwriteable'; + $quit = true; + } + + $checkdirarray = array( + 'attach' => $attachdir, + 'forumdata' => './forumdata', + 'cache' => './forumdata/cache', + 'ftemplates' => './forumdata/templates', + 'threadcache' => './forumdata/threadcaches', + 'log' => './forumdata/logs', + 'uccache' => './uc_client/data/cache' + ); + + foreach($checkdirarray as $key => $dir) { + if(!dir_writeable(ROOT_PATH.$dir)) { + $langkey = $key.'_unwriteable'; + $errors[] = $key.'_unwriteable'; + if(!in_array($key, array('ftemplate'))) { + $quit = TRUE; + } + } + } + + $errors['quit'] = $quit; + return $errors; + +} + +function show_error($type, $errors = '', $quit = false) { + + global $lang, $step; + + $title = lang($type); + $comment = lang($type.'_comment', false); + $errormsg = ''; + if($errors) { + if(!empty($errors)) { + foreach ((array)$errors as $k => $v) { + if(is_numeric($k)) { + $comment .= "
  • ".lang($v)."
  • "; + } + } + } + } + + if($step > 0) { + echo "
    $title
      $comment
    "; + } else { + echo "
    $title
      $comment
    "; + } + + if($quit) { + echo '
    '.$lang['error_quit_msg'].'





    '; + } + + echo '
    '; + + $quit && show_footer(); +} + +function show_tips($tip, $title = '', $comment = '', $style = 1) { + global $lang; + $title = empty($title) ? lang($tip) : $title; + $comment = empty($comment) ? lang($tip.'_comment', FALSE) : $comment; + if($style) { + echo "
    $title"; + } else { + echo "
    $title
      "; + } + $comment && print('
      '.$comment.'
      '); + echo "
    "; +} + +function show_setting($setname, $varname = '', $value = '', $type = 'text|password|checkbox', $error = '') { + if($setname == 'start') { + echo "
    \n"; + return; + } elseif($setname == 'end') { + echo "\n
    \n"; + return; + } elseif($setname == 'hidden') { + echo "\n"; + return; + } + + echo "\n".'
    '; + if($type == 'text' || $type == 'password') { + echo "\n".'\n"; + $value = dhtmlspecialchars($value); + echo ""; + } elseif(strpos($type, 'submit') !== FALSE) { + if(strpos($type, 'oldbtn') !== FALSE) { + echo "\n"; + } + $value = empty($value) ? 'new_step' : $value; + echo "\n"; + } elseif($type == 'checkbox') { + if(!is_array($varname) && !is_array($value)) { + echo "\n"; + } + } else { + echo $value; + } + + if($error) { + $comment = '
    '.(is_string($error) ? lang($error) : lang($setname.'_error')).'
    '; + } else { + $comment = lang($setname.'_comment', false); + if($comment) { + $comment = '
    '.$comment.'
    '; + } + } + echo "$comment\n
    \n"; + return true; +} + +function show_step($step) { + + global $method; + + $laststep = 4; + $title = lang('step_'.$method.'_title'); + $comment = lang('step_'.$method.'_desc'); + $step_title_1 = lang('step_title_1'); + $step_title_2 = lang('step_title_2'); + $step_title_3 = lang('step_title_3'); + $step_title_4 = lang('step_title_4'); + + $stepclass = array(); + for($i = 1; $i <= $laststep; $i++) { + $stepclass[$i] = $i == $step ? 'current' : ($i < $step ? '' : 'unactivated'); + } + $stepclass[$laststep] .= ' last'; + + echo << +
    +
    +
    +
    {$step}
    +
    +

    $title

    +

    $comment

    +
    +
    +
    +
    +
    $step_title_1
    +
    $step_title_2
    +
    $step_title_3
    +
    $step_title_4
    +
    +
    +
    +
    +
    +
    +EOT; + +} + +function lang($lang_key, $force = true) { + return isset($GLOBALS['lang'][$lang_key]) ? $GLOBALS['lang'][$lang_key] : ($force ? $lang_key : ''); +} + +function check_adminuser($username, $password, $email) { + + include ROOT_PATH.CONFIG_UC; + include ROOT_PATH.'./uc_client/client.php'; + + $error = ''; + $ucresult = uc_user_login($username, $password); + list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult); + $ucresult = $tmp; + if($ucresult['uid'] <= 0) { + $uid = uc_user_register($username, $password, $email); + if($uid == -1 || $uid == -2) { + $error = 'admin_username_invalid'; + } elseif($uid == -4 || $uid == -5 || $uid == -6) { + $error = 'admin_email_invalid'; + } elseif($uid == -3) { + $error = 'admin_exist_password_error'; + } + } else { + $uid = $ucresult['uid']; + $email = $ucresult['email']; + $password = $ucresult['password']; + } + + if(!$error && $uid > 0) { + $password = md5($password); + uc_user_addprotected($username, ''); + } else { + $uid = 0; + $error = empty($error) ? 'error_unknow_type' : $error; + } + return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error); +} + +function save_uc_config($config, $file) { + + list($appauthkey, $appid, $ucdbhost, $ucdbname, $ucdbuser, $ucdbpw, $ucdbcharset, $uctablepre, $uccharset, $ucapi, $ucip, $dzucstl) = $config; + mysqli_report(MYSQLI_REPORT_OFF); + + $link = new mysqli($ucdbhost, $ucdbuser, $ucdbpw, $ucdbname); + $uc_connnect = $link ? 'mysql' : ''; + + $date = gmdate("Y-m-d H:i:s", time() + 3600 * 8); + $year = date('Y'); + $config = << +EOT; + + if(file_put_contents($file, $config) !== false) { + return true; + } + + return false; +} + +function _generate_key($length = 32) { + $random = secrandom($length); + $info = md5($_SERVER['SERVER_SOFTWARE'].$_SERVER['SERVER_NAME'].(isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '').(isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : '').$_SERVER['HTTP_USER_AGENT'].time()); + $return = ''; + for($i=0; $i<$length; $i++) { + $return .= $random[$i].$info[$i]; + } + return $return; +} + +function uc_write_config($config, $file, $password) { + list($appauthkey, $appid, $ucdbhost, $ucdbname, $ucdbuser, $ucdbpw, $ucdbcharset, $uctablepre, $uccharset, $ucapi, $ucip, $dzucstl) = $config; + $ucauthkey = _generate_key(); + $ucsiteid = _generate_key(); + $ucmykey = _generate_key(); + $salt = ''; + $pw = password_hash($password, PASSWORD_BCRYPT); + $config = " 'HTTP_X_FORWARDED_FOR')));\r\n"; + + file_put_contents($file, $config); +} + +function install_uc_server() { + global $db, $dbhost, $dbuser, $dbpw, $dbname, $tablepre, $username, $password, $email, $dzucstl, $myisam2innodb; + + $ucsql = file_get_contents(ROOT_PATH.'./uc_server/install/uc.sql'); + $uctablepre = $tablepre.'ucenter_'; + $ucsql = str_replace(' uc_', ' '.$uctablepre, $ucsql); + if ($ucsql) { + if($myisam2innodb) { + $ucsql = str_replace('ENGINE=InnoDB', 'ENGINE=MyISAM', $ucsql); + } + if (!runucquery($ucsql, $uctablepre)) { + exit(); + } + } + $appauthkey = _generate_key(); + $ucdbhost = $dbhost; + $ucdbname = $dbname; + $ucdbuser = $dbuser; + $ucdbpw = $dbpw; + $ucdbcharset = DBCHARSET; + + $uccharset = CHARSET; + + $pathinfo = pathinfo($_SERVER['PHP_SELF']); + $pathinfo['dirname'] = substr($pathinfo['dirname'], 0, -8); + $isHTTPS = is_https(); + $appurl = 'http'.($isHTTPS ? 's' : '').'://'. $_SERVER['HTTP_HOST'].$pathinfo['dirname']; + $ucapi = $appurl.'/uc_server'; + $ucip = ''; + + $db->query("INSERT INTO {$uctablepre}applications SET name='Discuz! Board', url='$appurl', ip='$ucip', authkey='$appauthkey', synlogin='1', charset='$uccharset', dbcharset='$ucdbcharset', type='DISCUZX', recvnote='1', tagtemplates=''"); + $appid = $db->insert_id(); + $db->query("ALTER TABLE {$uctablepre}notelist ADD COLUMN app$appid tinyint NOT NULL"); + + $config = array($appauthkey,$appid,$ucdbhost,$ucdbname,$ucdbuser,$ucdbpw,$ucdbcharset,$uctablepre,$uccharset,$ucapi,$ucip,$dzucstl); + save_uc_config($config, ROOT_PATH.'./config/config_ucenter.php'); + + $salt = ''; + $passwordhash = password_hash($password, PASSWORD_BCRYPT); + $db->query("INSERT INTO {$uctablepre}members SET username='$username', password='$passwordhash', email='$email', regip='hidden', regdate='".time()."', salt='$salt'"); + $uid = $db->insert_id(); + $db->query("INSERT INTO {$uctablepre}memberfields SET uid='$uid'"); + + $db->query("INSERT INTO {$uctablepre}admins SET + uid='$uid', + username='$username', + allowadminsetting='1', + allowadminapp='1', + allowadminuser='1', + allowadminbadword='1', + allowadmincredits='1', + allowadmintag='1', + allowadminpm='1', + allowadmindomain='1', + allowadmindb='1', + allowadminnote='1', + allowadmincache='1', + allowadminlog='1'"); + + uc_write_config($config, ROOT_PATH.'./uc_server/data/config.inc.php', $password); + + @unlink(ROOT_PATH.'./uc_server/install/index.php'); + @unlink(ROOT_PATH.'./uc_server/data/cache/settings.php'); + @touch(ROOT_PATH.'./uc_server/data/upgrade.lock'); + @touch(ROOT_PATH.'./uc_server/data/install.lock'); + dir_clear(ROOT_PATH.'./uc_server/data/cache'); + dir_clear(ROOT_PATH.'./uc_server/data/view'); +} + +function install_data($username, $uid) { + global $_G, $db, $tablepre; + showjsmessage(lang('install_data')." ... " . "\n"); + + $_G = array('db'=>$db,'tablepre'=>$tablepre, 'uid'=>$uid, 'username'=>$username); + + $arr = array( + 0=> array('importfile'=>'./data/group_index.xml','primaltplname'=>'group/index', 'targettplname'=>'group/index'), + ); + foreach ($arr as $v) { + import_diy($v['importfile'], $v['primaltplname'], $v['targettplname']); + } + + showjsmessage(lang('install_data').lang('succeed') . "\n"); +} + +function install_testdata($username, $uid) { + global $_G, $db, $tablepre; + + showjsmessage(lang('install_test_data')." : \n"); + $sqlfile = ROOT_PATH.'./install/data/common_district_{#id}.sql'; + for($i = 1; $i < 4; $i++) { + $sqlfileid = str_replace('{#id}', $i, $sqlfile); + if(file_exists($sqlfileid)) { + $sql = file_get_contents($sqlfileid); + $sql = str_replace("\r\n", "\n", $sql); + runquery($sql); + } + } +} + +function getvars($data, $type = 'VAR') { + $evaluate = ''; + foreach($data as $key => $val) { + if(!preg_match("/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/", $key)) { + continue; + } + if(is_array($val)) { + $evaluate .= buildarray($val, 0, "\${$key}")."\r\n"; + } else { + $val = addcslashes($val, '\'\\'); + $evaluate .= $type == 'VAR' ? "\$$key = '$val';\n" : "define('".strtoupper($key)."', '$val');\n"; + } + } + return $evaluate; +} + +function buildarray($array, $level = 0, $pre = '$_config') { + static $ks; + $return = ''; + + if($level == 0) { + $ks = array(); + } + + foreach ($array as $key => $val) { + if(!preg_match("/^[a-zA-Z0-9_\x7f-\xff]+$/", $key)) { + continue; + } + + if($level == 0) { + $newline = str_pad(' CONFIG '.strtoupper($key).' ', 70, '-', STR_PAD_BOTH); + $return .= "\r\n// $newline //\r\n"; + if($key == 'admincp') { + $newline = str_pad(' Founders: $_config[\'admincp\'][\'founder\'] = \'1,2,3\'; ', 70, '-', STR_PAD_BOTH); + $return .= "// $newline //\r\n"; + } + } + $ks[$level] = $level ? $ks[$level - 1] : ''; + if(is_int($key)) { + $ks[$level] .= '['.$key.']'; + } else { + $ks[$level] .= "['$key']"; + } + if(is_array($val)) { + $return .= buildarray($val, $level + 1, $pre); + } else { + $val = is_string($val) || strlen($val) > 12 || ($val !== 0 && !preg_match("/^\-?[1-9]\d*$/", $val)) ? '\''.addcslashes($val, '\'\\').'\'' : $val; + $return .= $pre.$ks[$level]." = $val;\r\n"; + } + } + return $return; +} + +function save_diy_data($primaltplname, $targettplname, $data, $database = false) { + global $_G; + if (empty($data) || !is_array($data)) return false; + + $_G['curtplbid'] = array(); + $_G['curtplframe'] = array(); + + $tpldirectory = './template/default'; + $file = '.'.$tpldirectory.'/'.$primaltplname.'.htm'; + $content = file_get_contents(realpath($file)); + foreach ($data['layoutdata'] as $key => $value) { + $html = ''; + $html .= '
    '; + $html .= getframehtml($value); + $html .= '
    '; + $content = preg_replace("/(\<\!\-\-\[diy\=$key\]\-\-\>).+?(\<\!\-\-\[\/diy\]\-\-\>)/is", "\\1".$html."\\2", $content); + } + $content = preg_replace("/(\'; + echo ''; + $queryparams = array( + 'out_biz_no' => daddslashes($_GET['out_biz_no']), + 'user' => daddslashes($_GET['user']), + 'type' => daddslashes($_GET['type']), + 'channel' => daddslashes($_GET['channel']), + 'status' => daddslashes($_GET['status']), + 'starttime' => daddslashes($_GET['starttime']), + 'endtime' => daddslashes($_GET['endtime']), + ); + + $types = C::t('common_payment_order')->fetch_type_all(); + $typeoptions = array(); + $typeoptions[] = ''; + foreach($types as $k => $v) { + $typeoptions[] = ""; + } + showformheader('ec&operation=paymentorders'); + showtableheader('ec_paymentorders_search'); + showtablerow('', array( + 'style="width:100px"', 'style="width:200px"', + 'style="width:100px"', 'style="width:200px"', + 'style="width:100px"', '' + ), + array( + lang('admincp', 'ec_orders_search_id'), '', + lang('admincp', 'ec_paymentorders_user'), '', + lang('admincp', 'ec_paymentorders_type'), '', + ) + ); + + $channels = payment::channels(); + $channeloptions = array(); + $channeloptions[] = ''; + foreach($channels as $channel) { + $channeloptions[] = ''; + } + $statusoptions = array(); + $statusoptions[] = ''; + $statusoptions[] = ''; + $statusoptions[] = ''; + $statusoptions[] = ''; + showtablerow('', array(), + array( + lang('admincp', 'ec_paymentorders_channel'), '', + lang('admincp', 'ec_paymentorders_status'), '', + lang('admincp', 'ec_paymentorders_date'), ' - ', + ) + ); + showtablefooter(); + showtableheader('', 'notop'); + showsubmit('searchsubmit'); + showtablefooter(); + if($queryparams['user']) { + if(preg_match('/^\d+$/', $queryparams['user'])) { + $queryparams['uid'] = $queryparams['user']; + } else { + $user = C::t('common_member')->fetch_uid_by_username($queryparams['user']); + if($user) { + $queryparams['uid'] = $user['uid']; + } else { + $queryparams['uid'] = -1; + } + } + } + $ordercount = C::t('common_payment_order')->count_by_search($queryparams['uid'], $queryparams['type'], $queryparams['starttime'], $queryparams['endtime'], $queryparams['out_biz_no'], $queryparams['channel'], $queryparams['status']); + $multipage = multi($ordercount, $_G['tpp'], $page, ADMINSCRIPT . "?action=ec&operation=paymentorders&" . http_build_query($queryparams)); + + $tdstyles = array( + 'style="width: 220px;"', + 'style="width: 100px; text-align: center"', + '', + 'style="width: 120px;"', + 'style="width: 100px; text-align: center"', + 'style="width: 120px; text-align: right"', + 'style="width: 100px; text-align: center"', + 'style="width: 100px; text-align: right"', + 'style="width: 100px; text-align: right"', + 'style="width: 110px; text-align: right"' + ); + showtableheader('result'); + showsubtitle(array('ec_paymentorders_no', 'ec_paymentorders_type', 'ec_paymentorders_desc', 'ec_paymentorders_buyer', 'ec_paymentorders_channel', 'ec_paymentorders_amount', 'ec_paymentorders_status', 'ec_orders_submitdate', 'ec_orders_confirmdate', ''), 'header', $tdstyles); + if($ordercount > 0) { + $order_list = C::t('common_payment_order')->fetch_all_by_search($queryparams['uid'], $queryparams['type'], $queryparams['starttime'], $queryparams['endtime'], $queryparams['out_biz_no'], $queryparams['channel'], $queryparams['status'], $start_limit, $_G['tpp']); + $refund_list = C::t('common_payment_refund')->sum_by_orders(array_keys($order_list)); + foreach($order_list as $order) { + $user = getuserbyuid($order['uid']); + if(!$order['status'] && $order['expire_time'] < time()) { + $order['status'] = 2; + } elseif($order['status'] == 1 && $refund_list[$order['id']]) { + $order['status'] = 3; + $order['refund_amount'] = $refund_list[$order['id']]['amount']; + } + + $amountstr = number_format($order['amount'] / 100, 2, '.', ','); + if($order['status'] == 3) { + $amountstr .= '
    ' . $lang['ec_paymentorders_refund_amount'] . ': ' . number_format($order['refund_amount'] / 100, 2, '.', ','); + } + $operations = ''; + if(in_array($order['status'], array(0, 2))) { + $operations .= '' . $lang['ec_paymentorders_op_status'] . ''; + } elseif($order['status'] == 1 && !$order['callback_status']) { + $operations = ''.$lang['ec_paymentorders_callback_tips'].''; + } + + showtablerow('class="order-status-' . $order['status'] . '"', $tdstyles, array( + $order['out_biz_no'], + $order['type_name'], + $order['subject'] . ($order['description'] ? '
    ' . $order['description'] : ''), + $user['username'] . ' (' . $order['uid'] . ')' . '
    ' . $order['clientip'] . ':' . $order['remoteport'], + $channels[$order['channel']]['title'], + $amountstr, + $lang['ec_paymentorders_status_' . $order['status']], + dgmdate($order['dateline']), + $order['payment_time'] ? dgmdate($order['payment_time']) : 'N/A', + $operations + )); + } + showsubmit('', '', '', '', $multipage); + } else { + showtablerow('', array('class="center" colspan="25"'), array($lang['ec_paymentorders_no_data'])); + } + showtablefooter(); + showformfooter(); + } + +} elseif($operation == 'transferorders') { + + shownav('extended', 'nav_ec'); + showsubmenu('nav_ec', array( + array('nav_ec_config', 'setting&operation=ec', 0), + array('nav_ec_qpay', 'ec&operation=qpay', 0), + array('nav_ec_wechat', 'ec&operation=wechat', 0), + array('nav_ec_alipay', 'ec&operation=alipay', 0), + array('nav_ec_credit', 'ec&operation=credit', 0), + array('nav_ec_orders', 'ec&operation=orders', 0), + array('nav_ec_tradelog', 'tradelog', 0), + array('nav_ec_inviteorders', 'ec&operation=inviteorders', 0), + array('nav_ec_paymentorders', 'ec&operation=paymentorders', 0), + array('nav_ec_transferorders', 'ec&operation=transferorders', 1) + )); + + if($_GET['op'] == 'query') { + $transfer_no = daddslashes($_GET['transfer_no']); + + $result = payment::transfer_status($transfer_no); + if($result['code'] == 200) { + cpmsg('payment_transfer_succeed', $_G['siteurl'] . ADMINSCRIPT . '?action=ec&operation=transferorders&out_biz_no=' . $transfer_no, 'succeed'); + } else { + cpmsg($result['message'], $_G['siteurl'] . ADMINSCRIPT . '?action=ec&operation=transferorders&out_biz_no=' . $transfer_no, 'error'); + } + } elseif($_GET['op'] == 'retry') { + $order_id = intval($_GET['order_id']); + $order = C::t('common_payment_transfer')->fetch($order_id); + + $result = payment::transfer($order['channel'], $order['out_biz_no'], $order['amount'], $order['uid'], $order['realname'], $order['account'], $order['subject'], $order['description']); + if($result['code'] == 200) { + cpmsg('payment_transfer_succeed', $_G['siteurl'] . ADMINSCRIPT . '?action=ec&operation=transferorders&out_biz_no=' . $order['out_biz_no'], 'succeed'); + } else { + cpmsg($result['message'], $_G['siteurl'] . ADMINSCRIPT . '?action=ec&operation=transferorders&out_biz_no=' . $order['out_biz_no'], 'error'); + } + } else { + $start_limit = ($page - 1) * $_G['tpp']; + + echo ''; + echo ''; + $queryparams = array( + 'out_biz_no' => daddslashes($_GET['out_biz_no']), + 'user' => daddslashes($_GET['user']), + 'channel' => daddslashes($_GET['channel']), + 'status' => daddslashes($_GET['status']), + 'starttime' => daddslashes($_GET['starttime']), + 'endtime' => daddslashes($_GET['endtime']), + ); + + showformheader('ec&operation=transferorders'); + showtableheader('ec_transferorders_search'); + showtablerow('', array(), + array( + lang('admincp', 'ec_orders_search_id'), '', + lang('admincp', 'ec_transferorders_user'), '', + ) + ); + + $channels = payment::channels(); + $channeloptions = array(); + $channeloptions[] = ''; + foreach($channels as $channel) { + $channeloptions[] = ''; + } + $statusoptions = array(); + $statusoptions[] = ''; + $statusoptions[] = ''; + $statusoptions[] = ''; + $statusoptions[] = ''; + showtablerow('', array( + 'style="width:100px"', 'style="width:200px"', + 'style="width:100px"', 'style="width:200px"', + 'style="width:100px"', '' + ), + array( + lang('admincp', 'ec_transferorders_channel'), '', + lang('admincp', 'ec_paymentorders_status'), '', + lang('admincp', 'ec_paymentorders_date'), ' - ', + ) + ); + showtablefooter(); + showtableheader('', 'notop'); + showsubmit('searchsubmit'); + showtablefooter(); + if($queryparams['user']) { + if(preg_match('/^\d+$/', $queryparams['user'])) { + $queryparams['uid'] = $queryparams['user']; + } else { + $user = C::t('common_member')->fetch_uid_by_username($queryparams['user']); + if($user) { + $queryparams['uid'] = $user['uid']; + } else { + $queryparams['uid'] = -1; + } + } + } + $ordercount = C::t('common_payment_transfer')->count_by_search($queryparams['uid'], $queryparams['starttime'], $queryparams['endtime'], $queryparams['out_biz_no'], $queryparams['channel'], $queryparams['status']); + $multipage = multi($ordercount, $_G['tpp'], $page, ADMINSCRIPT . "?action=ec&operation=transferorders&" . http_build_query($queryparams)); + + $tdstyles = array( + 'style="width: 220px;"', + 'style="width: 100px; text-align: center"', + 'style="width: 100px; text-align: center"', + '', + 'style="width: 130px; text-align: right"', + 'style="width: 100px; text-align: center"', + '', + 'style="width: 100px; text-align: right"', + 'style="width: 100px; text-align: right"', + 'style="width: 25px; text-align: right"' + ); + showtableheader('result'); + showsubtitle(array('ec_paymentorders_no', 'ec_transferorders_user', 'ec_transferorders_channel', 'ec_transferorders_desc', 'ec_paymentorders_amount', 'ec_paymentorders_status', 'ec_transferorders_error', 'ec_orders_submitdate', 'ec_orders_confirmdate', ''), 'header', $tdstyles); + if($ordercount > 0) { + $order_list = C::t('common_payment_transfer')->fetch_all_by_search($queryparams['uid'], $queryparams['type'], $queryparams['starttime'], $queryparams['endtime'], $queryparams['out_biz_no'], $queryparams['channel'], $queryparams['status'], $start_limit, $_G['tpp']); + foreach($order_list as $order) { + $user = getuserbyuid($order['uid']); + if($order['status'] == 1) { + $operations = '' . $lang['ec_paymentorders_op_status'] . ''; + } elseif($order['status'] == 3) { + $operations = '' . $lang['ec_transferorders_op_retry'] . ''; + } + showtablerow('class="order-status-' . $order['status'] . '"', $tdstyles, array( + $order['out_biz_no'], + $user['username'] . ' (' . $order['uid'] . ')' . '
    ' . $order['clientip'] . ':' . $order['remoteport'], + $channels[$order['channel']]['title'], + $order['subject'] . ($order['description'] ? '
    ' . $order['description'] : ''), + number_format($order['amount'] / 100, 2, '.', ','), + $lang['ec_transferorders_status_' . $order['status']], + $order['status'] == 3 ? $order['error'] : '', + dgmdate($order['dateline']), + $order['trade_time'] ? dgmdate($order['trade_time']) : 'N/A', + $operations + )); + } + showsubmit('', '', '', '', $multipage); + } else { + showtablerow('', array('class="center" colspan="25"'), array($lang['ec_transferorders_no_data'])); + } + showtablefooter(); + showformfooter(); + } + +} elseif($operation == 'orders') { + + $orderurl = array( + 'alipay' => 'https://www.alipay.com/trade/query_trade_detail.htm?trade_no=', + 'tenpay' => 'https://www.tenpay.com/med/tradeDetail.shtml?trans_id=', + ); + + if(!$_G['setting']['creditstrans'] || !$_G['setting']['ec_ratio']) { + cpmsg('orders_disabled', '', 'error'); + } + + if(!submitcheck('ordersubmit')) { + + echo ''; + shownav('extended', 'nav_ec'); + showsubmenu('nav_ec', array( + array('nav_ec_config', 'setting&operation=ec', 0), + array('nav_ec_qpay', 'ec&operation=qpay', 0), + array('nav_ec_wechat', 'ec&operation=wechat', 0), + array('nav_ec_alipay', 'ec&operation=alipay', 0), + array('nav_ec_credit', 'ec&operation=credit', 0), + array('nav_ec_orders', 'ec&operation=orders', 1), + array('nav_ec_tradelog', 'tradelog', 0), + array('nav_ec_inviteorders', 'ec&operation=inviteorders', 0), + array('nav_ec_paymentorders', 'ec&operation=paymentorders', 0), + array('nav_ec_transferorders', 'ec&operation=transferorders', 0) + )); + showtips('ec_orders_tips'); + showtagheader('div', 'ordersearch', !submitcheck('searchsubmit', 1)); + showformheader('ec&operation=orders'); + showtableheader('ec_orders_search'); + showsetting('ec_orders_search_status', array('orderstatus', array( + array('', $lang['ec_orders_search_status_all']), + array(1, $lang['ec_orders_search_status_pending']), + array(2, $lang['ec_orders_search_status_auto_finished']), + array(3, $lang['ec_orders_search_status_manual_finished']) + )), intval($orderstatus), 'select'); + showsetting('ec_orders_search_id', 'orderid', $orderid, 'text'); + showsetting('ec_orders_search_users', 'users', $users, 'text'); + showsetting('ec_orders_search_buyer', 'buyer', $buyer, 'text'); + showsetting('ec_orders_search_admin', 'admin', $admin, 'text'); + showsetting('ec_orders_search_submit_date', array('sstarttime', 'sendtime'), array($sstarttime, $sendtime), 'daterange'); + showsetting('ec_orders_search_confirm_date', array('cstarttime', 'cendtime'), array($cstarttime, $cendtime), 'daterange'); + showsubmit('searchsubmit'); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + + if(submitcheck('searchsubmit', 1)) { + + $start_limit = ($page - 1) * $_G['tpp']; + + + $ordercount = C::t('forum_order')->count_by_search(null, $_GET['orderstatus'], $_GET['orderid'], null, ($_GET['users'] ? explode(',', str_replace(' ', '', $_GET['users'])) : null), $_GET['buyer'], $_GET['admin'], strtotime($_GET['sstarttime']), strtotime($_GET['sendtime']), strtotime($_GET['cstarttime']), strtotime($_GET['cendtime'])); + $multipage = multi($ordercount, $_G['tpp'], $page, ADMINSCRIPT."?action=ec&operation=orders&searchsubmit=yes&orderstatus={$_GET['orderstatus']}&orderid={$_GET['orderid']}&users={$_GET['users']}&buyer={$_GET['buyer']}&admin={$_GET['admin']}&sstarttime={$_GET['sstarttime']}&sendtime={$_GET['sendtime']}&cstarttime={$_GET['cstarttime']}&cendtime={$_GET['cendtime']}"); + + showtagheader('div', 'orderlist', true); + showformheader('ec&operation=orders'); + showtableheader('result'); + showsubtitle(array('', 'ec_orders_id', 'ec_orders_status', 'ec_orders_buyer', 'ec_orders_amount', 'ec_orders_price', 'ec_orders_submitdate', 'ec_orders_confirmdate')); + + + foreach(C::t('forum_order')->fetch_all_by_search(null, $_GET['orderstatus'], $_GET['orderid'], null, ($_GET['users'] ? explode(',', str_replace(' ', '', $_GET['users'])) : null), $_GET['buyer'], $_GET['admin'], strtotime($_GET['sstarttime']), strtotime($_GET['sendtime']), strtotime($_GET['cstarttime']), strtotime($_GET['cendtime']), $start_limit, $_G['tpp']) as $order) { + switch($order['status']) { + case 1: $order['orderstatus'] = $lang['ec_orders_search_status_pending']; break; + case 2: $order['orderstatus'] = ''.$lang['ec_orders_search_status_auto_finished'].''; break; + case 3: $order['orderstatus'] = ''.$lang['ec_orders_search_status_manual_finished'].'
    ('.$order['admin'].')'; break; + } + $order['submitdate'] = dgmdate($order['submitdate']); + $order['confirmdate'] = $order['confirmdate'] ? dgmdate($order['confirmdate']) : 'N/A'; + + list($orderid, $apitype) = explode("\t", $order['buyer']); + $apitype = $apitype ? $apitype : 'alipay'; + $orderid = ''.$orderid.''; + showtablerow('', '', array( + "", + "{$order['orderid']}
    $orderid", + $order['orderstatus'], + "{$order['username']}", + "{$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title']} {$order['amount']} {$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit']}", + "{$lang['rmb']} {$order['price']} {$lang['rmb_yuan']}", + $order['submitdate'], + $order['confirmdate'] + )); + } + + showsubmit('ordersubmit', 'submit', '', ''.cplang('research').'', $multipage); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + } + + } else { + + $numvalidate = 0; + if($_GET['validate']) { + $orderids = array(); + $confirmdate = dgmdate(TIMESTAMP); + + foreach(C::t('forum_order')->fetch_all_order($_GET['validate'], '1') as $order) { + updatemembercount($order['uid'], array($_G['setting']['creditstrans'] => $order['amount'])); + $orderids[] = $order['orderid']; + + $submitdate = dgmdate($order['submitdate']); + notification_add($order['uid'], 'system', 'addfunds', array( + 'orderid' => $order['orderid'], + 'price' => $order['price'], + 'from_id' => 0, + 'from_idtype' => 'buycredit', + 'value' => $_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'].' '.$order['amount'].' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit'] + ), 1); + } + if($orderids) { + C::t('forum_order')->update($orderids, array('status' => '3', 'admin' => $_G['username'], 'confirmdate' => $_G['timestamp'])); + } + } + + cpmsg('orders_validate_succeed', "action=ec&operation=orders&searchsubmit=yes&orderstatus={$_GET['orderstatus']}&orderid={$_GET['orderid']}&users={$_GET['users']}&buyer={$_GET['buyer']}&admin={$_GET['admin']}&sstarttime={$_GET['sstarttime']}&sendtime={$_GET['sendtime']}&cstarttime={$_GET['cstarttime']}&cendtime={$_GET['cendtime']}", 'succeed'); + + } + +} elseif($operation == 'credit') { + + $defaultrank = array( + 1 => 4, + 2 => 11, + 3 => 41, + 4 => 91, + 5 => 151, + 6 => 251, + 7 => 501, + 8 => 1001, + 9 => 2001, + 10 => 5001, + 11 => 10001, + 12 => 20001, + 13 => 50001, + 14 => 100001, + 15 => 200001 + ); + + if(!submitcheck('creditsubmit')) { + + $ec_credit = C::t('common_setting')->fetch_setting('ec_credit', true); + $ec_credit = $ec_credit ? $ec_credit : array( + 'maxcreditspermonth' => '6', + 'rank' => $defaultrank + ); + + shownav('extended', 'nav_ec'); + showsubmenu('nav_ec', array( + array('nav_ec_config', 'setting&operation=ec', 0), + array('nav_ec_qpay', 'ec&operation=qpay', 0), + array('nav_ec_wechat', 'ec&operation=wechat', 0), + array('nav_ec_alipay', 'ec&operation=alipay', 0), + array('nav_ec_credit', 'ec&operation=credit', 1), + array('nav_ec_orders', 'ec&operation=orders', 0), + array('nav_ec_tradelog', 'tradelog', 0), + array('nav_ec_inviteorders', 'ec&operation=inviteorders', 0), + array('nav_ec_paymentorders', 'ec&operation=paymentorders', 0), + array('nav_ec_transferorders', 'ec&operation=transferorders', 0) + )); + + showtips('ec_credit_tips'); + showformheader('ec&operation=credit'); + showtableheader('ec_credit', 'nobottom'); + showsetting('ec_credit_maxcreditspermonth', 'ec_creditnew[maxcreditspermonth]', $ec_credit['maxcreditspermonth'], 'text'); + showtablefooter(''); + + showtableheader('ec_credit_rank', 'notop fixpadding'); + showsubtitle(array('ec_credit_rank', 'ec_credit_between', 'ec_credit_sellericon', 'ec_credit_buyericon')); + + $staticurl = STATICURL; + + foreach($ec_credit['rank'] as $rank => $mincredits) { + showtablerow('', '', array( + $rank, + ' ~ '.$ec_credit['rank'][$rank + 1], + "", + "" + )); + } + showsubmit('creditsubmit'); + showtablefooter(); + showformfooter(); + + } else { + $ec_creditnew = $_GET['ec_creditnew']; + $ec_creditnew['maxcreditspermonth'] = intval($ec_creditnew['maxcreditspermonth']); + + if(is_array($ec_creditnew['rank'])) { + foreach($ec_creditnew['rank'] as $rank => $mincredits) { + $mincredits = intval($mincredits); + if($rank == 1 && $mincredits <= 0) { + cpmsg('ecommerce_invalidcredit', '', 'error'); + } elseif($rank > 1 && $mincredits <= $ec_creditnew['rank'][$rank - 1]) { + cpmsg('ecommerce_must_larger', '', 'error', array('rank' => $rank)); + } + $ec_creditnew['rank'][$rank] = $mincredits; + } + } else { + $ec_creditnew['rank'] = $defaultrank; + } + + C::t('common_setting')->update_setting('ec_credit', $ec_creditnew); + updatecache('setting'); + + cpmsg('ec_credit_succeed', 'action=ec&operation=credit', 'succeed'); + + } +} elseif($operation == 'inviteorders') { + if(!submitcheck('ordersubmit')) { + $start_limit = ($page - 1) * $_G['tpp']; + $orderurl = array( + 'alipay' => 'https://www.alipay.com/trade/query_trade_detail.htm?trade_no=', + 'tenpay' => 'https://www.tenpay.com/med/tradeDetail.shtml?trans_id=', + ); + shownav('extended', 'nav_ec'); + showsubmenu('nav_ec', array( + array('nav_ec_config', 'setting&operation=ec', 0), + array('nav_ec_qpay', 'ec&operation=qpay', 0), + array('nav_ec_wechat', 'ec&operation=wechat', 0), + array('nav_ec_alipay', 'ec&operation=alipay', 0), + array('nav_ec_credit', 'ec&operation=credit', 0), + array('nav_ec_orders', 'ec&operation=orders', 0), + array('nav_ec_tradelog', 'tradelog', 0), + array('nav_ec_inviteorders', 'ec&operation=inviteorders', 1), + array('nav_ec_paymentorders', 'ec&operation=paymentorders', 0), + array('nav_ec_transferorders', 'ec&operation=transferorders', 0) + )); + + $ordercount = C::t('forum_order')->count_by_search(0, $_GET['orderstatus'], $_GET['orderid'], $_GET['email']); + $multipage = multi($ordercount, $_G['tpp'], $page, ADMINSCRIPT."?action=ec&operation=inviteorders&orderstatus={$_GET['orderstatus']}&orderid={$_GET['orderid']}&email={$_GET['email']}"); + + showtagheader('div', 'orderlist', TRUE); + showformheader('ec&operation=inviteorders'); + showtableheader('ec_inviteorders_search'); + $_G['showsetting_multirow'] = 1; + showsetting('ec_orders_search_status', array('orderstatus', array( + array('', $lang['ec_orders_search_status_all']), + array(1, $lang['ec_orders_search_status_pending']), + array(2, $lang['ec_orders_search_status_auto_finished']) + )), intval($_GET['orderstatus']), 'select'); + showsetting('ec_orders_search_id', 'orderid', $_GET['orderid'], 'text'); + showsetting('ec_orders_search_email', 'email', $_GET['email'], 'text'); + showsubmit('searchsubmit', 'submit'); + showtablefooter(); + showtableheader('result'); + showsubtitle(array('', 'ec_orders_id', 'ec_inviteorders_status', 'ec_inviteorders_buyer', 'ec_orders_amount', 'ec_orders_price', 'ec_orders_submitdate', 'ec_orders_confirmdate')); + + foreach(C::t('forum_order')->fetch_all_by_search(0, $_GET['orderstatus'], $_GET['orderid'], $_GET['email'], null, null, null, null, null, null, null, $start_limit, $_G['tpp']) as $order) { + switch($order['status']) { + case 1: $order['orderstatus'] = $lang['ec_orders_search_status_pending']; break; + case 2: $order['orderstatus'] = ''.$lang['ec_orders_search_status_auto_finished'].''; break; + case 3: $order['orderstatus'] = ''.$lang['ec_orders_search_status_manual_finished'].'
    ('.$order['admin'].')'; break; + } + $order['submitdate'] = dgmdate($order['submitdate']); + $order['confirmdate'] = $order['confirmdate'] ? dgmdate($order['confirmdate']) : 'N/A'; + + list($orderid, $apitype) = explode("\t", $order['buyer']); + $apitype = $apitype ? $apitype : 'alipay'; + $orderid = ''.$orderid.''; + showtablerow('', '', array( + "", + "{$order['orderid']}
    $orderid", + $order['orderstatus'], + "{$order['email']}
    {$order['ip']}", + $order['amount'], + "{$lang['rmb']} {$order['price']} {$lang['rmb_yuan']}", + $order['submitdate'], + $order['confirmdate'] + )); + } + showtablerow('', array('colspan="7"'), array($multipage)); + showsubmit('ordersubmit', 'ec_orders_validate', ''); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + } else { + if($_GET['validate']) { + if(C::t('forum_order')->fetch_all_order($_GET['validate'], '1')) { + C::t('forum_order')->update($_GET['validate'], array('status' => '3', 'admin' => $_G['username'], 'confirmdate' => $_G['timestamp'])); + } + } + cpmsg('orders_validate_succeed', "action=ec&operation=inviteorders&orderstatus={$_GET['orderstatus']}&orderid={$_GET['orderid']}&email={$_GET['email']}", 'succeed'); + } +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_faq.php b/source/admincp/admincp_faq.php new file mode 100644 index 0000000..ec1ffb3 --- /dev/null +++ b/source/admincp/admincp_faq.php @@ -0,0 +1,170 @@ +'.$lang['display_order'].''.$lang['faq_thread'].''; + + $faqparent = $faqsub = array(); + $faqlists = $faqselect = ''; + foreach(C::t('forum_faq')->fetch_all_by_fpid() as $faq) { + if(empty($faq['fpid'])) { + $faqparent[$faq['id']] = $faq; + $faqselect .= ""; + } else { + $faqsub[$faq['fpid']][] = $faq; + } + } + + foreach($faqparent as $parent) { + $disabled = !empty($faqsub[$parent['id']]) ? 'disabled' : ''; + showtablerow('', array('', 'class="td23 td28"'), array( + "", + "", + "
    ", + "".$lang['detail']."" + )); + if(!empty($faqsub[$parent['id']])) { + foreach($faqsub[$parent['id']] as $sub) { + showtablerow('', array('', 'class="td23 td28"'), array( + "", + "", + "
    ", + "".$lang['detail']."" + )); + } + } + echo ''; + } + echo ''; + + echo << +var rowtypedata = [ + [[1,''], [1,'', 'td25'], [1, ''], [1, '']], + [[1,''], [1,'', 'td25'], [1, '
    '], [1, '']] +]; + +EOT; + + showsubmit('faqsubmit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + + } else { + + if($_GET['delete']) { + C::t('forum_faq')->delete($_GET['delete']); + } + + if(is_array($_GET['title'])) { + foreach($_GET['title'] as $id => $val) { + C::t('forum_faq')->update($id, array( + 'displayorder' => $_GET['displayorder'][$id], + 'title' => $_GET['title'][$id] + )); + } + } + + if(is_array($_GET['newtitle'])) { + foreach($_GET['newtitle'] as $k => $v) { + $v = trim($v); + if($v) { + C::t('forum_faq')->insert(array( + 'fpid' => intval($_GET['newfpid'][$k]), + 'displayorder' => intval($_GET['newdisplayorder'][$k]), + 'title' => $v + )); + } + } + } + + cpmsg('faq_list_update', 'action=faq&operation=list', 'succeed'); + + } + +} elseif($operation == 'detail') { + $id = $_GET['id']; + if(!submitcheck('detailsubmit')) { + + $faq = C::t('forum_faq')->fetch($id); + if(!$faq) { + cpmsg('faq_nonexistence', '', 'error'); + } + + foreach(C::t('forum_faq')->fetch_all_by_fpid(0) as $parent) { + $faqselect .= ""; + } + + shownav('extended', 'faq'); + showsubmenu('faq'); + showformheader("faq&operation=detail&id=$id"); + showtableheader(); + showtitle('faq_edit'); + showsetting('faq_title', 'titlenew', $faq['title'], 'text'); + if(!empty($faq['fpid'])) { + showsetting('faq_sortup', '', '', ''); + showsetting('faq_identifier', 'identifiernew', $faq['identifier'], 'text'); + showsetting('faq_keywords', 'keywordnew', $faq['keyword'], 'text'); + showsetting('faq_content', 'messagenew', $faq['message'], 'textarea'); + } + showsubmit('detailsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + if(!$_GET['titlenew']) { + cpmsg('faq_no_title', '', 'error'); + } + + if(!empty($_GET['identifiernew'])) { + if(C::t('forum_faq')->check_identifier($_GET['identifiernew'], $id)) { + cpmsg('faq_identifier_invalid', '', 'error'); + } + } + + if(strlen($_GET['keywordnew']) > 50) { + cpmsg('faq_keyword_toolong', '', 'error'); + } + + $fpidnew = $_GET['fpidnew'] ? intval($_GET['fpidnew']) : 0; + $titlenew = trim($_GET['titlenew']); + $messagenew = trim($_GET['messagenew']); + $identifiernew = trim($_GET['identifiernew']); + $keywordnew = trim($_GET['keywordnew']); + + C::t('forum_faq')->update($id, array( + 'fpid' => $fpidnew, + 'identifier' => $identifiernew, + 'keyword' => $keywordnew, + 'title' => $titlenew, + 'message' => $messagenew, + )); + + cpmsg('faq_list_update', 'action=faq&operation=list', 'succeed'); + + } + +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_feed.php b/source/admincp/admincp_feed.php new file mode 100644 index 0000000..7e034b1 --- /dev/null +++ b/source/admincp/admincp_feed.php @@ -0,0 +1,341 @@ + 1); +showsubmenu('nav_feed', array( + array('nav_feed', 'feed', $current['search']), + array('feed_global', 'feed&operation=global', $current['global']), +)); + +if($operation == 'global') { + + if(!submitcheck('globalsubmit')) { + $feedid = intval($_GET['feedid']); + $feed = array(); + if($feedid) { + $feed = C::t('home_feed')->fetch_feed('', '', '', $feedid); + + if($feed['uid']) { + require_once libfile('function/feed'); + $feed = mkfeed($feed); + } + $feed['body_template'] = dhtmlspecialchars($feed['body_template']); + $feed['body_general'] = dhtmlspecialchars($feed['body_general']); + + $feed['dateline'] = dgmdate($feed['dateline'], 'Y-m-d H:i'); + } + if(empty($feed['dateline'])) { + $feed['dateline'] = dgmdate($_G['timestamp'], 'Y-m-d H:i'); + } + showformheader('feed&operation=global', $feed['uid'] ? '' : 'onsubmit="edit_save();"'); + echo ''; + echo ""; + showtableheader(); + if(empty($feed['uid'])) { + showsetting('feed_global_title', 'feednew[title_template]', $feed['title_template'], 'text'); + $src = 'home.php?mod=editor&charset='.CHARSET.'&allowhtml=1&doodle=0'; + print <<{$lang['message']} + + + + + + +EOF; + showsetting('feed_global_body_general', 'feednew[body_general]', $feed['body_general'], 'text'); + } else { + print <<{$lang['feed_global_title']} + {$feed['title_template']}  + + {$lang['message']} + {$feed['body_template']}  + + {$lang['feed_global_body_general']} + {$feed['body_general']}  +EOF; + } + + showsetting('feed_global_image_1', 'feednew[image_1]', $feed['image_1'], 'text'); + showsetting('feed_global_image_1_link', 'feednew[image_1_link]', $feed['image_1_link'], 'text'); + showsetting('feed_global_image_2', 'feednew[image_2]', $feed['image_2'], 'text'); + showsetting('feed_global_image_2_link', 'feednew[image_2_link]', $feed['image_2_link'], 'text'); + showsetting('feed_global_image_3', 'feednew[image_3]', $feed['image_3'], 'text'); + showsetting('feed_global_image_3_link', 'feednew[image_3_link]', $feed['image_3_link'], 'text'); + showsetting('feed_global_image_4', 'feednew[image_4]', $feed['image_4'], 'text'); + showsetting('feed_global_image_4_link', 'feednew[image_4_link]', $feed['image_4_link'], 'text'); + + showsetting('feed_global_dateline', 'feednew[dateline]', $feed['dateline'], 'text'); + if($feed['id']) { + showsetting('feed_global_hot', 'feednew[hot]', $feed['hot'], 'text'); + } + showsubmit('globalsubmit'); + showtablefooter(); + showformfooter(); + } else { + $feednew = getgpc('feednew'); + $feedid = intval($feednew['feedid']); + + if(empty($feednew['feeduid']) || empty($feedid)) { + $setarr = array( + 'title_template' => trim($feednew['title_template']), + 'body_template' => trim($feednew['body_template']) + ); + if(empty($setarr['title_template']) && empty($setarr['body_template'])) { + cpmsg('sitefeed_error', '', 'error'); + } + + } else { + $setarr = array(); + } + + $feednew['dateline'] = trim($feednew['dateline']); + if($feednew['dateline']) { + require_once libfile('function/home'); + $newtimestamp = strtotime($feednew['dateline']); + if($newtimestamp > $_G['timestamp']) { + $_G['timestamp'] = $newtimestamp; + } + } + + if(empty($feedid)) { + $_G['uid'] = 0; + require_once libfile('function/feed'); + $feedid = feed_add('sitefeed', + trim($feednew['title_template']),array(), + trim($feednew['body_template']),array(), + trim($feednew['body_general']), + array(trim($feednew['image_1']),trim($feednew['image_2']),trim($feednew['image_3']),trim($feednew['image_4'])), + array(trim($feednew['image_1_link']),trim($feednew['image_2_link']),trim($feednew['image_3_link']),trim($feednew['image_4_link'])), + '','','',1 + ); + + } else { + if(empty($feednew['feeduid'])) { + $setarr['body_general'] = trim($feednew['body_general']); + } + $setarr['image_1'] = trim($feednew['image_1']); + $setarr['image_1_link'] = trim($feednew['image_1_link']); + $setarr['image_2'] = trim($feednew['image_2']); + $setarr['image_2_link'] = trim($feednew['image_2_link']); + $setarr['image_3'] = trim($feednew['image_3']); + $setarr['image_3_link'] = trim($feednew['image_3_link']); + $setarr['image_4'] = trim($feednew['image_4']); + $setarr['image_4_link'] = trim($feednew['image_4_link']); + + $setarr['dateline'] = $newtimestamp; + $setarr['hot'] = intval($feednew['hot']); + + C::t('home_feed')->update_feed('', $setarr, '', '', $feedid); + } + cpmsg('feed_global_add_success', '', 'succeed'); + } + +} else { + + $detail = $_GET['detail']; + $uid = $_GET['uid']; + $users = $_GET['users']; + $feedid = $_GET['feedid']; + $icon = $_GET['icon']; + $hot1 = $_GET['hot1']; + $hot2 = $_GET['hot2']; + $starttime = $_GET['starttime']; + $endtime = $_GET['endtime']; + $searchsubmit = $_GET['searchsubmit']; + $feedids = $_GET['feedids']; + + $fromumanage = $_GET['fromumanage'] ? 1 : 0; + + showtips('feed_tips'); + if(!submitcheck('feedsubmit')) { + + if($fromumanage) { + $starttime = !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", $starttime) ? '' : $starttime; + $endtime = $_G['adminid'] == 3 || !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", $endtime) ? '' : $endtime; + } else { + $starttime = !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", $starttime) ? dgmdate(TIMESTAMP - 86400 * 7, 'Y-n-j') : $starttime; + $endtime = $_G['adminid'] == 3 || !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", $endtime) ? dgmdate(TIMESTAMP, 'Y-n-j') : $endtime; + } + + $staticurl = STATICURL; + + echo << + +EOT; + showtagheader('div', 'searchposts', !$searchsubmit); + showformheader("feed", '', 'feedforum'); + showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); + showtableheader(); + showsetting('feed_search_detail', 'detail', $detail, 'radio'); + showsetting('feed_search_perpage', '', $_GET['perpage'], ""); + $selected[$icon] = $icon ? 'selected="selected"' : ''; + showsetting('feed_search_icon', '', $icon, ""); + showsetting('feed_search_uid', 'uid', $uid, 'text'); + showsetting('feed_search_user', 'users', $users, 'text'); + showsetting('feed_search_feedid', 'feedid', $feedid, 'text'); + showsetting('feed_search_hot', array('hot1', 'hot2'), array('', ''), 'range'); + showsetting('feed_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); + echo ''; + showsubmit('searchsubmit'); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + + } else { + $feedids = authcode($feedids, 'DECODE'); + $feedidsadd = $feedids ? explode(',', $feedids) : $_GET['delete']; + include_once libfile('function/delete'); + $deletecount = count(deletefeeds($feedidsadd)); + $cpmsg = cplang('feed_succeed', array('deletecount' => $deletecount)); + + ?> + + fetch_uid_by_username(explode(',', $users)); + $uids = array_keys($query) + $uids; + } + + if($icon != '') { + $feedarr = C::t('home_feed')->fetch_icon_by_icon($icon); + $icon = $feedarr['icon']; + if($icon == '') { + $icon = '-1'; + } + } + + if($starttime != '') { + $starttime = strtotime($starttime); + } + + if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { + if($endtime != '') { + $endtime = strtotime($endtime); + } + } else { + $endtime = TIMESTAMP; + } + + if($feedid != '') { + $feedids = array(-1); + $query = C::t('home_feed')->fetch_feedid_by_feedid(explode(',', $feedid)); + $feedids = array_keys($query) + $feedids; + } + + if($uid != '') { + $query = C::t('home_feed')->fetch_uid_by_uid(explode(',', $uid)); + if(!$uids) { + $uids = array_keys($query); + } else { + $uids = array_intersect(array_keys($query), $uids); + } + if(!$uids) { + $uids = array(-1); + } + } + + + if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { + $error = 'feed_mod_range_illegal'; + } + + if(!$error) { + if($detail) { + $_GET['perpage'] = intval($_GET['perpage']) < 1 ? 20 : intval($_GET['perpage']); + $perpage = $_GET['pp'] ? $_GET['pp'] : $_GET['perpage']; + $query = C::t('home_feed')->fetch_all_by_search(1, $uids, $icon, $starttime, $endtime, $feedids, $hot1, $hot2, (($page - 1) * $perpage), $perpage); + $feeds = ''; + include_once libfile('function/feed'); + foreach ($query as $feed) { + $feed['dateline'] = dgmdate($feed['dateline']); + + $feed = mkfeed($feed); + + $feeds .= showtablerow('', array('style="width:20px;"', 'style="width:260px;"', '', 'style="width:120px;"', 'style="width:60px;"'), array( + "", + $feed['title_template'], + $feed['body_template'], + $feed['dateline'], + ''.$lang['edit'].'' + ), TRUE); + } + $feedcount = C::t('home_feed')->fetch_all_by_search(3, $uids, $icon, $starttime, $endtime, $feedids, $hot1, $hot2); + $multi = multi($feedcount, $perpage, $page, ADMINSCRIPT."?action=feed"); + $multi = preg_replace("/href=\"".ADMINSCRIPT."\?action=feed&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi); + $multi = str_replace("window.location='".ADMINSCRIPT."?action=feed&page='+this.value", "page(this.value)", $multi); + } else { + $feedcount = 0; + $query = C::t('home_feed')->fetch_all_by_search(2, $uids, $icon, $starttime, $endtime, $feedids, $hot1, $hot2); + foreach ($query as $feed) { + $feedids .= ','.$feed['feedid']; + $feedcount++; + } + $multi = ''; + } + + if(!$feedcount) { + $error = 'feed_post_nonexistence'; + } + } + + showtagheader('div', 'postlist', $searchsubmit); + showformheader('feed&frame=no', 'target="feedframe"'); + showhiddenfields(array('feedids' => authcode($feedids, 'ENCODE'))); + showtableheader(cplang('feed_result').' '.$feedcount.' '.cplang('research').'', 'fixpadding'); + + if($error) { + echo "$lang[$error]"; + } else { + if($detail) { + showsubtitle(array('', 'feed_title', 'feed_body', 'time', '')); + echo $feeds; + } + } + + showsubmit('feedsubmit', 'delete', $detail ? 'del' : '', '', $multi); + showtablefooter(); + showformfooter(); + echo ''; + showtagfooter('div'); + + } +} +?> \ No newline at end of file diff --git a/source/admincp/admincp_forums.php b/source/admincp/admincp_forums.php new file mode 100644 index 0000000..6e54195 --- /dev/null +++ b/source/admincp/admincp_forums.php @@ -0,0 +1,2200 @@ + + +'.cplang('show_all').' | '.cplang('hide_all').'   
    '; + showtableheader(); + showsubtitle(array('', 'display_order', 'forums_admin_name', '', 'forums_moderators', ''.$lang['multiedit'].'')); + + $forumcount = C::t('forum_forum')->fetch_forum_num(); + + $query = C::t('forum_forum')->fetch_all_forum_for_sub_order(); + $groups = $forums = $subs = $fids = $showed = array(); + foreach($query as $forum) { + if($forum['type'] == 'group') { + $groups[$forum['fid']] = $forum; + } elseif($forum['type'] == 'sub') { + $subs[$forum['fup']][] = $forum; + } else { + $forums[$forum['fup']][] = $forum; + } + $fids[] = $forum['fid']; + } + + foreach ($groups as $id => $gforum) { + $toggle = $forumcount > 50 && isset($forums[$id]) && is_array($forums[$id]) && count($forums[$id]) > 2; + $showed[] = showforum($gforum, 'group', '', $toggle); + if(!empty($forums[$id])) { + foreach ($forums[$id] as $forum) { + $showed[] = showforum($forum); + $lastfid = 0; + if(!empty($subs[$forum['fid']])) { + foreach ($subs[$forum['fid']] as $sub) { + $showed[] = showforum($sub, 'sub'); + $lastfid = $sub['fid']; + } + } + showforum($forum, $lastfid, 'lastchildboard'); + } + } + showforum($gforum, '', 'lastboard'); + } + + if(count($fids) != count($showed)) { + foreach($fids as $fid) { + if(!in_array($fid, $showed)) { + C::t('forum_forum')->update($fid, array('fup' => '0', 'type' => 'forum')); + } + } + } + + showforum($gforum, '', 'last'); + + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + $usergroups = array(); + $query = C::t('common_usergroup')->range(); + foreach($query as $group) { + $usergroups[$group['groupid']] = $group; + } + + if(is_array($_GET['order'])) { + foreach($_GET['order'] as $fid => $value) { + C::t('forum_forum')->update($fid, array('name' => $_GET['name'][$fid], 'displayorder' => $_GET['order'][$fid])); + } + } + + if(is_array($_GET['newcat'])) { + foreach($_GET['newcat'] as $key => $forumname) { + if(empty($forumname)) { + continue; + } + $fid = C::t('forum_forum')->insert(array('type' => 'group', 'name' => $forumname, 'status' => 1, 'displayorder' => $_GET['newcatorder'][$key]), 1); + C::t('forum_forumfield')->insert(array('fid' => $fid)); + } + } + + $table_forum_columns = array('fup', 'type', 'name', 'status', 'displayorder', 'styleid', 'allowsmilies', + 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowanonymous', 'allowpostspecial', 'alloweditrules', + 'alloweditpost', 'modnewposts', 'recyclebin', 'jammer', 'forumcolumns', 'threadcaches', 'disablewatermark', 'disablethumb', + 'autoclose', 'simple', 'allowside', 'allowfeed'); + $table_forumfield_columns = array('fid', 'attachextensions', 'threadtypes', 'viewperm', 'postperm', 'replyperm', + 'getattachperm', 'postattachperm', 'postimageperm'); + + if(is_array($_GET['newforum'])) { + + foreach($_GET['newforum'] as $fup => $forums) { + + $fupforum = C::t('forum_forum')->get_forum_by_fid($fup); + if(empty($fupforum)) continue; + + if($fupforum['fup']) { + $groupforum = C::t('forum_forum')->get_forum_by_fid($fupforum['fup']); + } else { + $groupforum = $fupforum; + } + + foreach($forums as $key => $forumname) { + + if(empty($forumname) || strlen($forumname) > 50) continue; + + $forum = $forumfields = array(); + $inheritedid = !empty($_GET['inherited'][$fup]) ? $fup : (!empty($_GET['newinherited'][$fup][$key]) ? $_GET['newinherited'][$fup][$key] : ''); + + if(!empty($inheritedid)) { + + $forum = C::t('forum_forum')->get_forum_by_fid($inheritedid); + $forumfield = C::t('forum_forum')->get_forum_by_fid($inheritedid, null, 'forumfield'); + + foreach($table_forum_columns as $field) { + $forumfields[$field] = $forum[$field]; + } + + foreach($table_forumfield_columns as $field) { + $forumfields[$field] = $forumfield[$field]; + } + + } else { + $forumfields['allowsmilies'] = $forumfields['allowbbcode'] = $forumfields['allowimgcode'] = 1; + $forumfields['allowpostspecial'] = 1; + $forumfields['allowside'] = 0; + $forumfields['allowfeed'] = 0; + $forumfields['recyclebin'] = 1; + } + + $forumfields['fup'] = $fup ? $fup : 0; + $forumfields['type'] = $fupforum['type'] == 'forum' ? 'sub' : 'forum'; + $forumfields['styleid'] = $groupforum['styleid']; + $forumfields['name'] = $forumname; + $forumfields['status'] = 1; + $forumfields['displayorder'] = $_GET['neworder'][$fup][$key]; + + $data = array(); + foreach($table_forum_columns as $field) { + if(isset($forumfields[$field])) { + $data[$field] = $forumfields[$field]; + } + } + + $forumfields['fid'] = $fid = C::t('forum_forum')->insert($data, 1); + + $data = array(); + $forumfields['threadtypes'] = copy_threadclasses($forumfields['threadtypes'], $fid); + foreach($table_forumfield_columns as $field) { + if(isset($forumfields[$field])) { + $data[$field] = $forumfields[$field]; + } + } + + C::t('forum_forumfield')->insert($data); + + foreach(C::t('forum_moderator')->fetch_all_by_fid($fup, false) as $mod) { + if($mod['inherited'] || $fupforum['inheritedmod']) { + C::t('forum_moderator')->insert(array('uid' => $mod['uid'], 'fid' => $fid, 'inherited' => 1), false, true); + } + } + } + } + } + + + updatecache('forums'); + + cpmsg('forums_update_succeed', 'action=forums', 'succeed'); + } + +} elseif($operation == 'moderators' && $fid) { + + if(!submitcheck('modsubmit')) { + + $forum = C::t('forum_forum')->fetch($fid); + shownav('forum', 'forums_moderators_edit'); + showsubmenu(cplang('forums_moderators_edit').' - '.$forum['name']); + showtips('forums_moderators_tips'); + showformheader("forums&operation=moderators&fid=$fid&"); + showtableheader('', 'fixpadding'); + showsubtitle(array('', 'display_order', 'username', 'usergroups', 'forums_moderators_inherited')); + + $modgroups = C::t('common_admingroup')->fetch_all_merge_usergroup(array_keys(C::t('common_usergroup')->fetch_all_by_radminid(0))); + $groupselect = ''; + + $moderators = C::t('forum_moderator')->fetch_all_by_fid($fid); + $uids = array_keys($moderators); + if($uids) { + $users = C::t('common_member')->fetch_all($uids); + } + + foreach($moderators as $mod) { + showtablerow('', array('class="td25"', 'class="td28"'), array( + '', + '', + "{$users[$mod['uid']]['username']}", + $modgroups[$users[$mod['uid']]['groupid']], + cplang($mod['inherited'] ? 'yes' : 'no'), + )); + } + + if($forum['type'] == 'group' || $forum['type'] == 'sub') { + $checked = $forum['type'] == 'group' ? 'checked' : ''; + $disabled = 'disabled'; + } else { + $checked = $forum['inheritedmod'] ? 'checked' : ''; + $disabled = ''; + } + + showtablerow('', array('class="td25"', 'class="td28"'), array( + cplang('add_new'), + '', + '', + $groupselect, + '' + )); + + showsubmit('modsubmit', 'submit', 'del', ''); + showtablefooter(); + showformfooter(); + + } else { + $forum = C::t('forum_forum')->fetch($fid); + $inheritedmodnew = $_GET['inheritedmodnew']; + if($forum['type'] == 'group') { + $inheritedmodnew = 1; + } elseif($forum['type'] == 'sub') { + $inheritedmodnew = 0; + } + + if(!empty($_GET['delete']) || $_GET['newmoderator'] || (bool)$forum['inheritedmod'] != (bool)$inheritedmodnew) { + + $fidarray = $newmodarray = $origmodarray = array(); + + if($forum['type'] == 'group') { + $query = C::t('forum_forum')->fetch_all_fids(1, 'forum', $fid); + foreach($query as $sub) { + $fidarray[] = $sub['fid']; + } + $query = C::t('forum_forum')->fetch_all_fids(1, 'sub', $fidarray); + foreach($query as $sub) { + $fidarray[] = $sub['fid']; + } + } elseif($forum['type'] == 'forum') { + $query = C::t('forum_forum')->fetch_all_fids(1, 'sub', $fid); + foreach($query as $sub) { + $fidarray[] = $sub['fid']; + } + } + + if(is_array($_GET['delete'])) { + foreach($_GET['delete'] as $uid) { + C::t('forum_moderator')->delete_by_uid_fid_inherited($uid, $fid, $fidarray); + } + + $excludeuids = array(); + $deleteuids = '\''.implode('\',\'', $_GET['delete']).'\''; + foreach(C::t('forum_moderator')->fetch_all_by_uid($_GET['delete']) as $mod) { + $excludeuids[] = $mod['uid']; + } + + $usergroups = array(); + $query = C::t('common_usergroup')->range(); + foreach($query as $group) { + $usergroups[$group['groupid']] = $group; + } + + $members = C::t('common_member')->fetch_all($_GET['delete'], false, 0); + foreach($members as $uid => $member) { + if(!in_array($uid, $excludeuids) && !in_array($member['adminid'], array(1,2))) { + if($usergroups[$member['groupid']]['type'] == 'special' && $usergroups[$member['groupid']]['radminid'] != 3) { + $adminidnew = -1; + $groupidnew = $member['groupid']; + } else { + $adminidnew = 0; + foreach($usergroups as $group) { + if($group['type'] == 'member' && $member['credits'] >= $group['creditshigher'] && $member['credits'] < $group['creditslower']) { + $groupidnew = $group['groupid']; + break; + } + } + } + C::t('common_member')->update($member['uid'], array('adminid'=>$adminidnew, 'groupid'=>$groupidnew)); + } + } + } + + if($_GET['newmoderator']) { + $member = C::t('common_member')->fetch_by_username($_GET['newmoderator']); + if(!$member) { + cpmsg_error('members_edit_nonexistence'); + } else { + $newmodarray[] = $member['uid']; + $membersetarr = array(); + if(!in_array($member['adminid'],array(1,2,3,4,5,6,7,8,-1))) { + $membersetarr['groupid'] = $_GET['newgroup']; + } + if(!in_array($member['adminid'],array(1,2))) { + $membersetarr['adminid'] = '3'; + } + if(!empty($membersetarr)) { + C::t('common_member')->update($member['uid'], $membersetarr); + } + + C::t('forum_moderator')->insert(array( + 'uid' => $member['uid'], + 'fid' => $fid, + 'displayorder' => $_GET['newdisplayorder'], + 'inherited' => '0', + ), false, true); + } + } + + if((bool)$forum['inheritedmod'] != (bool)$inheritedmodnew) { + foreach(C::t('forum_moderator')->fetch_all_by_fid_inherited($fid) as $mod) { + $origmodarray[] = $mod['uid']; + if(!$forum['inheritedmod'] && $inheritedmodnew) { + $newmodarray[] = $mod['uid']; + } + } + if($forum['inheritedmod'] && !$inheritedmodnew) { + C::t('forum_moderator')->delete_by_uid_fid($origmodarray, $fidarray); + } + } + + foreach($newmodarray as $uid) { + C::t('forum_moderator')->insert(array( + 'uid' => $uid, + 'fid' => $fid, + 'displayorder' => $_GET['newdisplayorder'], + 'inherited' => '0', + ), false, true); + + if($inheritedmodnew) { + foreach($fidarray as $ifid) { + C::t('forum_moderator')->insert(array( + 'uid' => $uid, + 'fid' => $ifid, + 'inherited' => '1', + ), false, true); + } + } + } + + if($forum['type'] == 'group') { + $inheritedmodnew = 1; + } elseif($forum['type'] == 'sub') { + $inheritedmodnew = 0; + } + C::t('forum_forum')->update($fid, array('inheritedmod' => $inheritedmodnew)); + } + + if(is_array($_GET['displayordernew'])) { + foreach($_GET['displayordernew'] as $uid => $order) { + C::t('forum_moderator')->update_by_fid_uid($fid, $uid, array( + 'displayorder' => $order, + )); + } + } + + $fidarray[] = $fid; + foreach($fidarray as $fid) { + $moderators = $tab = ''; + $modorder = array(); + $modmemberarray = C::t('forum_moderator')->fetch_all_no_inherited_by_fid($fid); + foreach($modmemberarray as $moduid => $modmember) { + $modorder[] = $moduid; + } + $members = C::t('common_member')->fetch_all_username_by_uid($modorder); + foreach($modorder as $mod) { + if(!$members[$mod]) { + continue; + } + $moderators .= $tab.addslashes($members[$mod]); + $tab = "\t"; + } + + C::t('forum_forumfield')->update($fid, array('moderators' => $moderators)); + } + cpmsg('forums_moderators_update_succeed', "mod=forum&action=forums&operation=moderators&fid=$fid", 'succeed'); + + } + +} elseif($operation == 'merge') { + $source = $_GET['source']; + $target = $_GET['target']; + if(!submitcheck('mergesubmit') || $source == $target) { + + require_once libfile('function/forumlist'); + loadcache('forums'); + $forumselect = "'; + shownav('forum', 'forums_merge'); + showsubmenu('forums_merge'); + showformheader('forums&operation=merge'); + showtableheader(); + showsetting('forums_merge_source', '', '', sprintf($forumselect, 'source')); + showsetting('forums_merge_target', '', '', sprintf($forumselect, 'target')); + showsubmit('mergesubmit'); + showtablefooter(); + showformfooter(); + + } else { + if(C::t('forum_forum')->check_forum_exists(array($source,$target)) != 2) { + cpmsg_error('forums_nonexistence'); + } + if(C::t('forum_forum')->fetch_forum_num('', $source)) { + cpmsg_error('forums_merge_source_sub_notnull'); + } + + C::t('forum_thread')->update_by_fid($source, array('fid' => $target)); + loadcache('posttableids'); + $posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0'); + foreach($posttableids as $id) { + C::t('forum_post')->update_fid_by_fid($id, $source, $target); + } + + $sourceforum = C::t('forum_forum')->fetch_info_by_fid($source); + $targetforum = C::t('forum_forum')->fetch_info_by_fid($target); + $sourcethreadtypes = (array)dunserialize($sourceforum['threadtypes']); + $targethreadtypes = (array)dunserialize($targetforum['threadtypes']); + $targethreadtypes['types'] = array_merge((array)$targethreadtypes['types'], (array)$sourcethreadtypes['types']); + $targethreadtypes['icons'] = array_merge((array)$targethreadtypes['icons'], (array)$sourcethreadtypes['icons']); + C::t('forum_forum')->update($target, array('threads' => $targetforum['threads'] + $sourceforum['threads'], 'posts' => $targetforum['posts'] + $sourceforum['posts'])); + C::t('forum_forumfield')->update($target, array('threadtypes' => serialize($targethreadtypes))); + C::t('forum_threadclass')->update_by_fid($source, array('fid' => $target)); + C::t('forum_forum')->delete_by_fid($source); + C::t('home_favorite')->delete_by_id_idtype($source, 'fid'); + C::t('forum_moderator')->delete_by_fid($source); + C::t('common_member_forum_buylog')->delete_by_fid($target); + + $query = C::t('forum_access')->fetch_all_by_fid_uid($source); + foreach($query as $access) { + C::t('forum_access')->insert(array('uid' => $access['uid'], 'fid' => $target, 'allowview' => $access['allowview'], 'allowpost' => $access['allowpost'], 'allowreply' => $access['allowreply'], 'allowgetattach' => $access['allowgetattach']), false, true); + } + C::t('forum_access')->delete_by_fid($source); + C::t('forum_thread')->clear_cache(array($source,$target), 'forumdisplay_'); + updatecache('forums'); + + cpmsg('forums_merge_succeed', 'action=forums', 'succeed'); + } + +} elseif($operation == 'edit') { + + require_once libfile('function/forumlist'); + require_once libfile('function/domain'); + $highlight = getgpc('highlight'); + $highlight = !empty($highlight) ? dhtmlspecialchars($highlight, ENT_QUOTES) : ''; + $anchor = getgpc('anchor'); + + list($pluginsetting, $pluginvalue) = get_pluginsetting('forums'); + + $multiset = 0; + if(empty($_GET['multi'])) { + $fids = $fid; + } else { + $multiset = 1; + if(is_array($_GET['multi'])) { + $fids = $_GET['multi']; + } else { + $_GET['multi'] = explode(',', $_GET['multi']); + $fids = &$_GET['multi']; + } + } + if(!empty($_GET['multi']) && is_array($_GET['multi']) && count($_GET['multi']) == 1) { + $fids = $_GET['multi'][0]; + $multiset = 0; + } + if(empty($fids)) { + cpmsg('forums_edit_nonexistence', 'action=forums&operation=edit'.(!empty($highlight) ? "&highlight=$highlight" : '').(!empty($anchor) ? "&anchor=$anchor" : ''), 'form', array(), ''); + } + $mforum = array(); + $perms = array('viewperm', 'postperm', 'replyperm', 'getattachperm', 'postattachperm', 'postimageperm'); + + $query = C::t('forum_forum')->fetch_all_info_by_fids($fids); + if(empty($query)) { + cpmsg('forums_nonexistence', '', 'error'); + } else { + foreach($query as $forum) { + if(isset($pluginvalue[$forum['fid']])) { + $forum['plugin'] = $pluginvalue[$forum['fid']]; + } + $mforum[] = $forum; + } + } + + $dactionarray = array(); + $allowthreadtypes = !in_array('threadtypes', $dactionarray); + + + $forumkeys = C::t('common_setting')->fetch_setting('forumkeys', true); + + $rules = array(); + foreach(C::t('common_credit_rule')->fetch_all_by_action(array('reply', 'post', 'digest', 'postattach', 'getattach')) as $value) { + $rules[$value['rid']] = $value; + } + $navs = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype_type(0, 5) as $nav) { + $navs[$nav['identifier']] = $nav['id']; + } + + if(!submitcheck('detailsubmit')) { + $anchor = in_array($_GET['anchor'], array('basic', 'extend', 'posts', 'attachtype', 'credits', 'threadtypes', 'threadsorts', 'perm', 'plugin')) ? $_GET['anchor'] : 'basic'; + shownav('forum', 'forums_edit'); + + loadcache('forums'); + $forumselect = ''; + $sgid = 0; + foreach($_G['cache']['forums'] as $forums) { + $checked = $fid == $forums['fid'] || (is_array($_GET['multi']) && in_array($ggroup['groupid'], $_GET['multi'])); + if($forums['type'] == 'group') { + $sgid = $forums['fid']; + $forumselect .= '
    '. + ''. + ' '.$forums['name'].'
    '; + } elseif($forums['type'] == 'forum') { + $forumselect .= ''.$forums['name'].''; + } elseif($forums['type'] == 'sub') { + $forumselect .= ''.$forums['name'].''; + } + } + $forumselect = ''.cplang('forums_edit_switch').'  '. + ''; + + showformheader('', '', 'menuform', 'get'); + showhiddenfields(array('action' => 'forums', 'operation' => 'edit')); + if(count($mforum) == 1 && $mforum[0]['type'] == 'group') { + showsubmenu(cplang('forums_cat_detail').(count($mforum) == 1 ? ' - '.$mforum[0]['name'].'(gid:'.$mforum[0]['fid'].')' : ''), array(), $forumselect); + } else { + if($multiset && !in_array($anchor, array('basic', 'extend', 'posts', 'perm', 'plugin'))) { + $anchor = 'basic'; + } + showsubmenuanchors(cplang('forums_edit').(count($mforum) == 1 ? ' - '.$mforum[0]['name'].'(fid:'.$mforum[0]['fid'].')' : ''), array( + array('forums_edit_basic', 'basic', $anchor == 'basic'), + array('forums_edit_extend', 'extend', $anchor == 'extend'), + array('forums_edit_posts', 'posts', $anchor == 'posts'), + array('forums_edit_perm', 'perm', $anchor == 'perm'), + !$multiset ? array('forums_edit_credits', 'credits', $anchor == 'credits') : array(), + !$multiset ? array(array('menu' => 'usergroups_edit_other', 'submenu' => array( + array('forums_edit_threadtypes', 'threadtypes', $anchor == 'threadtypes'), + array('forums_edit_threadsorts', 'threadsorts', $anchor == 'threadsorts'), + !$multiset ? array('forums_edit_attachtype', 'attachtype', $anchor == 'attachtype') : array(), + !$pluginsetting ? array() : array('forums_edit_plugin', 'plugin', $anchor == 'plugin'), + ))) : array(), + $multiset && $pluginsetting ? array('forums_edit_plugin', 'plugin', $anchor == 'plugin') : array(), + ), $forumselect); + } + showformfooter(); + + $groups = array(); + $query = C::t('common_usergroup')->range_orderby_credit(); + foreach($query as $group) { + $group['type'] = $group['type'] == 'special' && $group['radminid'] ? 'specialadmin' : $group['type']; + $groups[$group['type']][] = $group; + } + + $styleselect = "'; + + if(!$multiset) { + $attachtypes = ''; + foreach(C::t('forum_attachtype')->fetch_all_by_fid($fid) as $type) { + $type['maxsize'] = round($type['maxsize'] / 1024); + $attachtypes .= showtablerow('', array('class="td25"', 'class="td24"'), array( + "", + "", + "" + ), TRUE); + } + } else { + showtips('setting_multi_tips'); + } + showformheader("forums&operation=edit&fid=$fid&", 'enctype'); + showhiddenfields(array('type' => $mforum[0]['type'])); + + if(count($mforum) == 1 && $mforum[0]['type'] == 'group') { + $mforum[0]['extra'] = dunserialize($mforum[0]['extra']); + showtableheader(); + showsetting('forums_edit_basic_cat_name', 'namenew', $mforum[0]['name'], 'text'); + showsetting('forums_edit_basic_cat_name_color', 'extranew[namecolor]', $mforum[0]['extra']['namecolor'], 'color'); + showsetting('forums_edit_basic_cat_style', '', '', $styleselect); + showsetting('forums_edit_extend_forum_horizontal', 'forumcolumnsnew', $mforum[0]['forumcolumns'], 'text'); + showsetting('forums_edit_extend_cat_sub_horizontal', 'catforumcolumnsnew', $mforum[0]['catforumcolumns'], 'text'); + if(!empty($_G['setting']['domain']['root']['forum'])) { + showsetting('forums_edit_extend_domain', '', '', $_G['scheme'].'://.'.$_G['setting']['domain']['root']['forum']); + } else { + showsetting('forums_edit_extend_domain', 'domainnew', '', 'text', 'disabled'); + } + showsetting('forums_cat_display', 'statusnew', $mforum[0]['status'], 'radio'); + showsetting('forums_edit_basic_shownav', 'shownavnew', array_key_exists($mforum[0]['fid'], $navs) ? 1 : 0, 'radio'); + showtablefooter(); + showtips('setting_seo_forum_tips', 'seo_tips', true, 'setseotips'); + showtableheader(); + showsetting('forums_edit_basic_seotitle', 'seotitlenew', dhtmlspecialchars($mforum[0]['seotitle']), 'text'); + showsetting('forums_edit_basic_keyword', 'keywordsnew', dhtmlspecialchars($mforum[0]['keywords']), 'text'); + showsetting('forums_edit_basic_seodescription', 'seodescriptionnew', dhtmlspecialchars($mforum[0]['seodescription']), 'textarea'); + showsubmit('detailsubmit'); + showtablefooter(); + + } else { + + require_once libfile('function/editor'); + + if($multiset) { + $_G['showsetting_multi'] = 0; + $_G['showsetting_multicount'] = count($mforum); + foreach($mforum as $forum) { + $_G['showtableheader_multi'][] = ''.$forum['name'].'(fid:'.$forum['fid'].')'; + } + } + $mfids = array(); + foreach($mforum as $forum) { + $fid = $forum['fid']; + $mfids[] = $fid; + if(!$multiset) { + $fupselect = "'; + + if($forum['threadtypes']) { + $forum['threadtypes'] = dunserialize($forum['threadtypes']); + $forum['threadtypes']['status'] = 1; + } else { + $forum['threadtypes'] = array('status' => 0, 'required' => 0, 'listable' => 0, 'prefix' => 0, 'options' => array()); + } + + if($forum['threadsorts']) { + $forum['threadsorts'] = dunserialize($forum['threadsorts']); + $forum['threadsorts']['status'] = 1; + } else { + $forum['threadsorts'] = array('status' => 0, 'required' => 0, 'listable' => 0, 'prefix' => 0, 'options' => array()); + } + + $typeselect = $sortselect = ''; + + $query = C::t('forum_threadtype')->fetch_all_for_order(); + $typeselect = getthreadclasses_html($fid); + foreach($query as $type) { + $typeselected = array(); + $enablechecked = ''; + + $keysort = $type['special'] ? 'threadsorts' : 'threadtypes'; + if(isset($forum[$keysort]['types'][$type['typeid']])) { + $enablechecked = ' checked="checked"'; + } + + $showtype = TRUE; + + loadcache('threadsort_option_'.$type['typeid']); + if($type['special'] && !$_G['cache']['threadsort_option_'.$type['typeid']]) { + $showtype = FALSE; + } + if($type['special']) { + $typeselected[3] = $forum['threadsorts']['show'][$type['typeid']] ? ' checked="checked"' : ''; + $sortselect .= $showtype ? showtablerow('', array('class="td25"'), array( + '', + $type['name'], + $type['description'], + "", + "" + ), TRUE) : ''; + } + } + $forum['creditspolicy'] = $forum['creditspolicy'] ? dunserialize($forum['creditspolicy']) : array(); + } + + if($forum['autoclose']) { + $forum['autoclosetime'] = abs($forum['autoclose']); + $forum['autoclose'] = $forum['autoclose'] / abs($forum['autoclose']); + } + + if($forum['threadplugin']) { + $forum['threadplugin'] = dunserialize($forum['threadplugin']); + } + + $simplebin = sprintf('%08b', $forum['simple']); + $forum['defaultorderfield'] = bindec(substr($simplebin, 0, 2)); + $forum['defaultorder'] = ($forum['simple'] & 32) ? 1 : 0; + $forum['subforumsindex'] = bindec(substr($simplebin, 3, 2)); + $forum['subforumsindex'] = $forum['subforumsindex'] == 0 ? -1 : ($forum['subforumsindex'] == 2 ? 0 : 1); + $forum['simple'] = $forum['simple'] & 1; + $forum['modrecommend'] = $forum['modrecommend'] ? dunserialize($forum['modrecommend']) : array(); + $forum['formulaperm'] = dunserialize($forum['formulaperm']); + $forum['medal'] = $forum['formulaperm']['medal']; + $forum['formulapermmessage'] = $forum['formulaperm']['message']; + $forum['formulapermusers'] = $forum['formulaperm']['users']; + $forum['formulaperm'] = $forum['formulaperm'][0]; + $forum['extra'] = dunserialize($forum['extra']); + $forum['threadsorts'] = is_array($forum['threadsorts']) ? $forum['threadsorts'] : array(); + $forum['threadsorts']['default'] = $forum['threadsorts']['defaultshow'] ? 1 : 0; + + $_G['multisetting'] = $multiset ? 1 : 0; + showmultititle(); + showtagheader('div', 'basic', $anchor == 'basic'); + if(!$multiset) { + showtips('forums_edit_tips'); + } + showtableheader('forums_edit_basic'); + showsetting('forums_edit_basic_name', 'namenew', $forum['name'], 'text'); + showsetting('forums_edit_base_name_color', 'extranew[namecolor]', $forum['extra']['namecolor'], 'color'); + if(!$multiset) { + if($forum['icon']) { + $valueparse = parse_url($forum['icon']); + if(isset($valueparse['host'])) { + $forumicon = $forum['icon']; + } else { + $forumicon = $_G['setting']['attachurl'].'common/'.$forum['icon'].'?'.random(6); + } + $forumiconhtml = '

    '; + } + showsetting('forums_edit_basic_icon', 'iconnew', $forum['icon'], 'filetext', '', 0, $forumiconhtml); + showsetting('forums_edit_basic_icon_width', 'extranew[iconwidth]', $forum['extra']['iconwidth'], 'text'); + if($forum['banner']) { + $valueparse = parse_url($forum['banner']); + if(isset($valueparse['host'])) { + $forumbanner = $forum['banner']; + } else { + $forumbanner = $_G['setting']['attachurl'].'common/'.$forum['banner'].'?'.random(6); + } + $forumbannerhtml = '

    '; + } + showsetting('forums_edit_basic_banner', 'bannernew', $forum['banner'], 'filetext', '', 0, $forumbannerhtml); + } + showsetting('forums_edit_basic_display', 'statusnew', $forum['status'], 'radio'); + showsetting('forums_edit_basic_shownav', 'shownavnew', array_key_exists($fid, $navs) ? 1 : 0, 'radio'); + if(!$multiset) { + showsetting('forums_edit_basic_up', '', '', $fupselect); + } + showsetting('forums_edit_basic_redirect', 'redirectnew', $forum['redirect'], 'text'); + showsetting('forums_edit_basic_description', 'descriptionnew', htmlspecialchars_decode(html2bbcode($forum['description'])), 'textarea'); + showsetting('forums_edit_basic_rules', 'rulesnew', htmlspecialchars_decode(html2bbcode($forum['rules'])), 'textarea'); + showsetting('forums_edit_basic_keys', 'keysnew', $forumkeys[$fid], 'text'); + if(!empty($_G['setting']['domain']['root']['forum'])) { + $iname = $multiset ? "multinew[{$_G['showsetting_multi']}][domainnew]" : 'domainnew'; + showsetting('forums_edit_extend_domain', '', '', $_G['scheme'].'://.'.$_G['setting']['domain']['root']['forum']); + } elseif(!$multiset) { + showsetting('forums_edit_extend_domain', 'domainnew', '', 'text', 'disabled'); + } + showtablefooter(); + if(!$multiset) { + showtips('setting_seo_forum_tips', 'seo_tips', true, 'setseotips'); + } + showtableheader(); + showsetting('forums_edit_basic_seotitle', 'seotitlenew', dhtmlspecialchars($forum['seotitle']), 'text'); + showsetting('forums_edit_basic_keyword', 'keywordsnew', dhtmlspecialchars($forum['keywords']), 'text'); + showsetting('forums_edit_basic_seodescription', 'seodescriptionnew', dhtmlspecialchars($forum['seodescription']), 'textarea'); + showtablefooter(); + showtagfooter('div'); + + showtagheader('div', 'extend', $anchor == 'extend'); + if(!$multiset) { + showtips('forums_edit_tips'); + } + showtableheader('forums_edit_extend', 'nobottom'); + $multi_styleselect = $_GET['multi'] ? preg_replace('/\w+new/', 'multinew['.$_G['showsetting_multi'].'][\\0]', $styleselect) : $styleselect; + $styleid = $forum['styleid']; + $multi_styleselect = str_replace("selected=\"selected\"", "", $multi_styleselect); + $multi_styleselect = str_replace("value=\"$styleid\"", "value=\"$styleid\" selected=\"selected\"", $multi_styleselect); + showsetting('forums_edit_extend_style', '', '', $multi_styleselect); + if($forum['type'] != 'sub') { + showsetting('forums_edit_extend_sub_horizontal', 'forumcolumnsnew', $forum['forumcolumns'], 'text'); + showsetting('forums_edit_extend_subforumsindex', array('subforumsindexnew', array( + array(-1, cplang('default')), + array(1, cplang('yes')), + array(0, cplang('no')) + ), 1), $forum['subforumsindex'], 'mradio'); + showsetting('forums_edit_extend_simple', 'simplenew', $forum['simple'], 'radio'); + } else { + if($_GET['multi']) { + showsetting('forums_edit_extend_sub_horizontal', '', '', cplang('forums_edit_sub_multi_tips')); + showsetting('forums_edit_extend_subforumsindex', '', '', cplang('forums_edit_sub_multi_tips')); + showsetting('forums_edit_extend_simple', '', '', cplang('forums_edit_sub_multi_tips')); + } + } + showsetting('forums_edit_extend_widthauto', array('widthautonew', array( + array(0, cplang('default')), + array(-1, cplang('forums_edit_extend_widthauto_-1')), + array(1, cplang('forums_edit_extend_widthauto_1')), + ), 1), $forum['widthauto'], 'mradio'); + showsetting('forums_edit_extend_picstyle', 'picstylenew', $forum['picstyle'], 'radio'); + showsetting('forums_edit_extend_allowside', 'allowsidenew', $forum['allowside'], 'radio'); + showsetting('forums_edit_extend_recommend_top', 'allowglobalsticknew', $forum['allowglobalstick'], 'radio'); + showsetting('forums_edit_extend_defaultorderfield', array('defaultorderfieldnew', array( + array(0, cplang('forums_edit_extend_order_lastpost')), + array(1, cplang('forums_edit_extend_order_starttime')), + array(2, cplang('forums_edit_extend_order_replies')), + array(3, cplang('forums_edit_extend_order_views')) + )), $forum['defaultorderfield'], 'mradio'); + showsetting('forums_edit_extend_defaultorder', array('defaultordernew', array( + array(0, cplang('forums_edit_extend_order_desc')), + array(1, cplang('forums_edit_extend_order_asc')) + )), $forum['defaultorder'], 'mradio'); + if($_G['setting']['allowreplybg']) { + $replybghtml = ''; + if($forum['replybg']) { + $replybgurl = parse_url($forum['replybg']); + if(isset($replybgurl['host'])) { + $replybgicon = $forum['replybg']; + } else { + $replybgicon = $_G['setting']['attachurl'].'common/'.$forum['replybg'].'?'.random(6); + } + $replybghtml = '
    '; + } + showsetting('forums_edit_extend_reply_background', 'replybgnew', (!$replybgurl['host'] ? str_replace($_G['setting']['attachurl'].'common/', '', $forum['replybg']) : $forum['replybg']), 'filetext', '', 0, $replybghtml); + } + showsetting('forums_edit_extend_threadcache', 'threadcachesnew', $forum['threadcaches'], 'text'); + showsetting('forums_edit_extend_relatedgroup', 'relatedgroupnew', $forum['relatedgroup'], 'text'); + showsetting('forums_edit_extend_edit_rules', 'alloweditrulesnew', $forum['alloweditrules'], 'radio'); + showsetting('forums_edit_extend_disablecollect', 'disablecollectnew', $forum['disablecollect'], 'radio'); + showsetting('forums_edit_extend_recommend', 'modrecommendnew[open]', $forum['modrecommend']['open'], 'radio', '', 1); + showsetting('forums_edit_extend_recommend_sort', array('modrecommendnew[sort]', array( + array(1, cplang('forums_edit_extend_recommend_sort_auto')), + array(0, cplang('forums_edit_extend_recommend_sort_manual')), + array(2, cplang('forums_edit_extend_recommend_sort_mix')))), $forum['modrecommend']['sort'], 'mradio'); + showsetting('forums_edit_extend_recommend_orderby', array('modrecommendnew[orderby]', array( + array(0, cplang('forums_edit_extend_recommend_orderby_dateline')), + array(1, cplang('forums_edit_extend_recommend_orderby_lastpost')), + array(2, cplang('forums_edit_extend_recommend_orderby_views')), + array(3, cplang('forums_edit_extend_recommend_orderby_replies')), + array(4, cplang('forums_edit_extend_recommend_orderby_digest')), + array(5, cplang('forums_edit_extend_recommend_orderby_recommend')), + array(6, cplang('forums_edit_extend_recommend_orderby_heats')), + )), $forum['modrecommend']['orderby'], 'mradio'); + showsetting('forums_edit_extend_recommend_num', 'modrecommendnew[num]', $forum['modrecommend']['num'], 'text'); + showsetting('forums_edit_extend_recommend_imagenum', 'modrecommendnew[imagenum]', $forum['modrecommend']['imagenum'], 'text'); + showsetting('forums_edit_extend_recommend_imagesize', array('modrecommendnew[imagewidth]', 'modrecommendnew[imageheight]'), array(intval($forum['modrecommend']['imagewidth']), intval($forum['modrecommend']['imageheight'])), 'multiply'); + showsetting('forums_edit_extend_recommend_maxlength', 'modrecommendnew[maxlength]', $forum['modrecommend']['maxlength'], 'text'); + showsetting('forums_edit_extend_recommend_cachelife', 'modrecommendnew[cachelife]', $forum['modrecommend']['cachelife'], 'text'); + showsetting('forums_edit_extend_recommend_dateline', 'modrecommendnew[dateline]', $forum['modrecommend']['dateline'], 'text'); + showtablefooter(); + showtagfooter('div'); + + showtagheader('div', 'posts', $anchor == 'posts'); + if(!$multiset) { + showtips('forums_edit_tips'); + } + showtableheader('forums_edit_posts', 'nobottom'); + showsetting('forums_edit_posts_modposts', array('modnewpostsnew', array( + array(0, cplang('none')), + array(1, cplang('forums_edit_posts_modposts_threads')), + array(2, cplang('forums_edit_posts_modposts_posts')) + )), $forum['modnewposts'], 'mradio'); + showsetting('forums_edit_posts_alloweditpost', 'alloweditpostnew', $forum['alloweditpost'], 'radio'); + showsetting('forums_edit_posts_recyclebin', 'recyclebinnew', $forum['recyclebin'], 'radio'); + showsetting('forums_edit_posts_html', 'allowhtmlnew', $forum['allowhtml'], 'radio'); + showsetting('forums_edit_posts_bbcode', 'allowbbcodenew', $forum['allowbbcode'], 'radio'); + showsetting('forums_edit_posts_imgcode', 'allowimgcodenew', $forum['allowimgcode'], 'radio'); + showsetting('forums_edit_posts_mediacode', 'allowmediacodenew', $forum['allowmediacode'], 'radio'); + showsetting('forums_edit_posts_smilies', 'allowsmiliesnew', $forum['allowsmilies'], 'radio'); + showsetting('forums_edit_posts_jammer', 'jammernew', $forum['jammer'], 'radio'); + showsetting('forums_edit_posts_anonymous', 'allowanonymousnew', $forum['allowanonymous'], 'radio'); + showsetting('forums_edit_posts_disablethumb', 'disablethumbnew', $forum['disablethumb'], 'radio'); + showsetting('forums_edit_posts_disablewatermark', 'disablewatermarknew', $forum['disablewatermark'], 'radio'); + + showsetting('forums_edit_posts_allowpostspecial', array('allowpostspecialnew', array( + cplang('thread_poll'), + cplang('thread_trade'), + cplang('thread_reward'), + cplang('thread_activity'), + cplang('thread_debate') + )), $forum['allowpostspecial'], 'binmcheckbox'); + $threadpluginarray = array(); + if(is_array($_G['setting']['threadplugins'])) foreach($_G['setting']['threadplugins'] as $tpid => $data) { + $threadpluginarray[] = array($tpid, $data['name']); + } + if($threadpluginarray) { + showsetting('forums_edit_posts_threadplugin', array('threadpluginnew', $threadpluginarray), $forum['threadplugin'], 'mcheckbox'); + } + showsetting('forums_edit_posts_allowspecialonly', 'allowspecialonlynew', $forum['allowspecialonly'], 'radio'); + showsetting('forums_edit_posts_autoclose', array('autoclosenew', array( + array(0, cplang('forums_edit_posts_autoclose_none'), array('autoclose_time' => 'none')), + array(1, cplang('forums_edit_posts_autoclose_dateline'), array('autoclose_time' => '')), + array(-1, cplang('forums_edit_posts_autoclose_lastpost'), array('autoclose_time' => '')) + )), $forum['autoclose'], 'mradio'); + showtagheader('tbody', 'autoclose_time', $forum['autoclose'], 'sub'); + showsetting('forums_edit_posts_autoclose_time', 'autoclosetimenew', $forum['autoclosetime'], 'text'); + showtagfooter('tbody'); + showsetting('forums_edit_posts_attach_ext', 'attachextensionsnew', $forum['attachextensions'], 'text'); + showsetting('forums_edit_posts_allowfeed', 'allowfeednew', $forum['allowfeed'], 'radio'); + showsetting('forums_edit_posts_commentitem', 'commentitemnew', $forum['commentitem'], 'textarea'); + showsetting('forums_edit_posts_noantitheft', 'noantitheftnew', $forum['noantitheft'], 'radio'); + showsetting('forums_edit_posts_noforumhidewater', 'noforumhidewaternew', $forum['noforumhidewater'], 'radio'); + showsetting('forums_edit_posts_noforumrecommend', 'noforumrecommendnew', $forum['noforumrecommend'], 'radio'); + + showtablefooter(); + showtagfooter('div'); + + if(!$multiset) { + showtagheader('div', 'attachtype', $anchor == 'attachtype'); + showtips('forums_edit_attachtype_tips'); + showtableheader('', 'nobottom'); + showtablerow('class="partition"', array('class="td25"', 'class="td24"'), array(cplang('del'), cplang('misc_attachtype_ext'), cplang('misc_attachtype_maxsize'))); + echo $attachtypes; + echo ''; + showtablefooter(); + showtagfooter('div'); + + showtagheader('div', 'credits', $anchor == 'credits'); + if(!$multiset) { + showtips('forums_edit_tips'); + } + showtableheader('forums_edit_credits_policy', 'fixpadding nobottom'); + echo ''.cplang('credits_id').''.cplang('setting_credits_policy_cycletype').''.cplang('setting_credits_policy_rewardnum').''.cplang('custom').''; + foreach($_G['setting']['extcredits'] as $i => $extcredit) { + echo ''.$extcredit['title'].''; + } + echo ' '; + + if(is_array($_G['setting']['extcredits'])) { + foreach($rules as $rid => $rule) { + $globalrule = $rule; + $readonly = $checked = ''; + if(isset($forum['creditspolicy'][$rule['action']])) { + $rule = $forum['creditspolicy'][$rule['action']]; + $checked = ' checked="checked"'; + } else { + for($i = 1; $i <= 8; $i++) { + $rule['extcredits'.$i] = ''; + } + $readonly = ' readonly="readonly" style="display:none;"'; + } + $usecustom = ''; + $tdarr = array($rule['rulename'], $rule['rid'] ? cplang('setting_credits_policy_cycletype_'.$rule['cycletype']) : 'N/A', $rule['rid'] && $rule['cycletype'] ? $rule['rewardnum'] : 'N/A', $usecustom); + + for($i = 1; $i <= 8; $i++) { + if($_G['setting']['extcredits'][$i]) { + array_push($tdarr, '('.($globalrule['extcredits'.$i]).')'); + } + } + $opstr = ''.cplang('edit').''; + array_push($tdarr, $opstr); + showtablerow('', array_fill(4, count($_G['setting']['extcredits']) + 4, 'width="70"'), $tdarr); + } + + } + showtablerow('', 'class="lineheight" colspan="13"', cplang('forums_edit_credits_comment', array('fid' => $fid))); + + showtablefooter(); + print << + function modifystate(custom) { + var trObj = custom.parentNode.parentNode; + var inputsObj = trObj.getElementsByTagName('input'); + for(key in inputsObj) { + var obj = inputsObj[key]; + if(typeof obj == 'object' && obj.type != 'checkbox') { + obj.value = ''; + obj.readOnly = custom.checked ? false : true; + obj.style.display = obj.readOnly ? 'none' : ''; + } + } + } + +EOF; + showtagfooter('div'); + } + + if($allowthreadtypes && !$multiset) { + $lang_forums_edit_threadtypes_use_cols = cplang('forums_edit_threadtypes_use_cols'); + $lang_forums_edit_threadtypes_use_choice = cplang('forums_edit_threadtypes_use_choice'); + echo << + var rowtypedata = [ + [ + [1,'', 'td25'], + [1,''], + [1,''], + [1,''], + [1,''], + [1,''], + [1,''] + ], + [ + [1,'', 'td25'], + [1,'', 'td24'], + [1,''] + ] + ]; + +EOT; + showtagheader('div', 'threadtypes', $anchor == 'threadtypes'); + if(!$multiset) { + showtips('forums_edit_tips'); + } + showtableheader('forums_edit_threadtypes_config', 'nobottom'); + showsetting('forums_edit_threadtypes_status', array('threadtypesnew[status]', array( + array(1, cplang('yes'), array('threadtypes_config' => '', 'threadtypes_manage' => '')), + array(0, cplang('no'), array('threadtypes_config' => 'none', 'threadtypes_manage' => 'none')) + ), TRUE), $forum['threadtypes']['status'], 'mradio'); + showtagheader('tbody', 'threadtypes_config', $forum['threadtypes']['status']); + showsetting('forums_edit_threadtypes_required', 'threadtypesnew[required]', $forum['threadtypes']['required'], 'radio'); + showsetting('forums_edit_threadtypes_listable', 'threadtypesnew[listable]', $forum['threadtypes']['listable'], 'radio'); + showsetting('forums_edit_threadtypes_prefix', + array( + 'threadtypesnew[prefix]', + array( + array(0, cplang('forums_edit_threadtypes_noprefix')), + array(1, cplang('forums_edit_threadtypes_textonly')), + array(2, cplang('forums_edit_threadtypes_icononly')), + ), + ), + $forum['threadtypes']['prefix'], 'mradio' + ); + showtagfooter('tbody'); + showtablefooter(); + + showtagheader('div', 'threadtypes_manage', $forum['threadtypes']['status']); + showtableheader('forums_edit_threadtypes', 'noborder fixpadding'); + showsubtitle(array('delete', 'display_order', cplang('forums_edit_threadtypes_name').' '.cplang('tiny_bbcode_support'), 'forums_edit_threadtypes_icon', 'enable', 'forums_edit_threadtypes_moderators')); + echo $typeselect; + echo ''; + showtablefooter(); + showtagfooter('div'); + showtagfooter('div'); + + showtagheader('div', 'threadsorts', $anchor == 'threadsorts'); + if(!$multiset) { + showtips('forums_edit_tips'); + } + showtableheader('forums_edit_threadsorts', 'nobottom'); + showsetting('forums_edit_threadsorts_status', array('threadsortsnew[status]', array( + array(1, cplang('yes'), array('threadsorts_config' => '', 'threadsorts_manage' => '')), + array(0, cplang('no'), array('threadsorts_config' => 'none', 'threadsorts_manage' => 'none')) + ), TRUE), $forum['threadsorts']['status'], 'mradio'); + showtagheader('tbody', 'threadsorts_config', $forum['threadsorts']['status']); + showsetting('forums_edit_threadtypes_required', 'threadsortsnew[required]', $forum['threadsorts']['required'], 'radio'); + showsetting('forums_edit_threadtypes_prefix', 'threadsortsnew[prefix]', $forum['threadsorts']['prefix'], 'radio'); + showsetting('forums_edit_threadsorts_default', 'threadsortsnew[default]', $forum['threadsorts']['default'], 'radio'); + showtagfooter('tbody'); + showtablefooter(); + + showtagheader('div', 'threadsorts_manage', $forum['threadsorts']['status']); + showtableheader('', 'noborder fixpadding'); + showsubtitle(array('enable', 'forums_edit_threadtypes_name', 'forums_edit_threadtypes_note', 'forums_edit_threadtypes_show', 'forums_edit_threadtypes_defaultshow')); + echo $sortselect; + showtablefooter(); + showtagfooter('div'); + showtagfooter('div'); + } + + showtagheader('div', 'perm', $anchor == 'perm'); + if(!$multiset) { + showtips('forums_edit_tips'); + } + showtableheader('', 'nobottom'); + showsetting('forums_edit_perm_price', 'pricenew', $forum['price'], 'text'); + showsetting('forums_edit_perm_passwd', 'passwordnew', $forum['password'], 'text'); + showsetting('forums_edit_perm_users', 'formulapermusersnew', $forum['formulapermusers'], 'textarea'); + $colums = array(); + loadcache('medals'); + foreach($_G['cache']['medals'] as $medalid => $medal) { + $colums[] = array($medalid, $medal['name']); + } + showtagheader('tbody', '', $_G['setting']['medalstatus']); + showsetting('forums_edit_perm_medal', array('medalnew', $colums), $forum['medal'], 'mcheckbox'); + showtagfooter('tbody'); + showtablefooter(); + + if(!$multiset) { + showtableheader('forums_edit_perm_forum', 'noborder fixpadding'); + showsubtitle(array( + '', + '', + '', + '', + '', + '', + '' + )); + + $spviewgroup = array(); + foreach(array('member', 'special', 'specialadmin', 'system') as $type) { + $tgroups = is_array($groups[$type]) ? $groups[$type] : array(); + showtablerow('', '', array(''.cplang('usergroups_'.$type).'')); + foreach($tgroups as $group) { + if($group['groupid'] != 1) { + $spviewgroup[] = array($group['groupid'], $group['grouptitle']); + } + $colums = array(''); + foreach($perms as $perm) { + $checked = strstr($forum[$perm], "\t{$group['groupid']}\t") ? 'checked="checked"' : NULL; + $colums[] = ''; + } + showtablerow('', array('width="21%"', 'width="13%"', 'width="13%"', 'width="13%"', 'width="16%"', 'width="13%"', 'width="13%"'), $colums); + } + } + $showverify = true; + foreach($_G['setting']['verify'] as $vid => $verify) { + if($verify['available']) { + if($showverify) { + showtablerow('', '', array(''.$lang['forums_edit_perm_verify'].'')); + $showverify = false; + } + + $colums = array(''); + foreach($perms as $perm) { + $checked = strstr($forum[$perm], "\tv$vid\t") ? 'checked="checked"' : NULL; + $colums[] = ''; + } + showtablerow('', array('width="21%"', 'width="13%"', 'width="13%"', 'width="13%"', 'width="13%"', 'width="13%"', 'width="13%"'), $colums); + } + } + showtablerow('', 'class="lineheight" colspan="6"', cplang('forums_edit_perm_forum_comment')); + showtablefooter(); + + showtableheader('forums_edit_perm_formula', 'fixpadding'); + $formulareplace .= '\''.cplang('setting_credits_formula_digestposts').'\',\''.cplang('setting_credits_formula_posts').'\''; + + ?> + +
    + +     +     +     +     +     +     +   +   +   +   +  +   +  -   +  *   +  /   +  >   +  >=   +  <   +  <=   +  =   +  !=   +  ( )   +     +    
    + + + +
    +
    + + +
    + + $var) { + if($var['type'] != 'select') { + showsetting($var['title'], 'pluginnew['.$varid.']', $forum['plugin'][$varid], $var['type'], '', 0, $var['description']); + } else { + showsetting($var['title'], array('pluginnew['.$varid.']', $var['select']), $forum['plugin'][$varid], $var['type'], '', 0, $var['description']); + } + } + } + showtablefooter(); + } + + showtagfooter('div'); + + showtableheader('', 'notop'); + showsubmit('detailsubmit', 'submit'); + showtablefooter(); + $_G['showsetting_multi']++; + }} + + if($_G['showsetting_multicount'] > 1) { + $mfids = is_array($mfids) ? $mfids : array($mfids); + showhiddenfields(array('multi' => implode(',', $mfids))); + showmulti(); + } + + showformfooter(); + + } else { + + if(!$multiset) { + $_GET['multinew'] = array(0 => array('single' => 1)); + } + $pluginvars = array(); + require_once libfile('function/delete'); + foreach($_GET['multinew'] as $k => $row) { + if(empty($row['single'])) { + foreach($row as $key => $value) { + $_GET[''.$key] = $value; + } + $fid = $_GET['multi'][$k]; + } + $forum = $mforum[$k]; + + if(strlen($_GET['namenew']) > 50) { + cpmsg('forums_name_toolong', '', 'error'); + } + + if(!$multiset) { + if(!checkformulaperm($_GET['formulapermnew'])) { + cpmsg('forums_formulaperm_error', '', 'error'); + } + $_GET['formulapermnew'] = trim($_GET['formulapermnew']); + $formulapermary[0] = $_GET['formulapermnew']; + $formulapermary[1] = preg_replace( + array("/(digestposts|posts|threads|oltime|extcredits[1-8])/", "/(regdate|regday|regip|lastip|buyercredit|sellercredit|field\d+)/"), + array("getuserprofile('\\1')", "\$memberformula['\\1']"), + $_GET['formulapermnew']); + $formulapermary['message'] = $_GET['formulapermmessagenew']; + } else { + $formulapermary = dunserialize($forum['formulaperm']); + } + $formulapermary['medal'] = $_GET['medalnew']; + $formulapermary['users'] = $_GET['formulapermusersnew']; + $_GET['formulapermnew'] = serialize($formulapermary); + + $domain = ''; + if(!empty($_GET['domainnew']) && !empty($_G['setting']['domain']['root']['forum'])) { + $domain = strtolower(trim($_GET['domainnew'])); + } + require_once libfile('function/discuzcode'); + if($_GET['type'] == 'group') { + if($_GET['namenew']) { + $newstyleid = intval($_GET['styleidnew']); + $forumcolumnsnew = $_GET['forumcolumnsnew'] > 1 ? intval($_GET['forumcolumnsnew']) : 0; + $catforumcolumnsnew = $_GET['catforumcolumnsnew'] > 1 ? intval($_GET['catforumcolumnsnew']) : 0; + $descriptionnew = preg_replace('/on(mousewheel|mouseover|click|load|onload|submit|focus|blur)="[^"]*"/i', '', discuzcode($_GET['descriptionnew'], 1, 0, 0, 0, 1, 1, 0, 0, 1)); + if(!empty($_G['setting']['domain']['root']['forum'])) { + deletedomain($fid, 'subarea'); + if(!empty($domain)) { + domaincheck($domain, $_G['setting']['domain']['root']['forum'], 1, 0); + C::t('common_domain')->insert(array('domain' => $domain, 'domainroot' => $_G['setting']['domain']['root']['forum'], 'id' => $fid, 'idtype' => 'subarea')); + } + } + C::t('forum_forum')->update($fid, array( + 'name' => $_GET['namenew'], + 'forumcolumns' => $forumcolumnsnew, + 'catforumcolumns' => $catforumcolumnsnew, + 'domain' => $domain, + 'status' => intval($_GET['statusnew']), + 'styleid' => $newstyleid, + )); + + $extranew = is_array($_GET['extranew']) ? $_GET['extranew'] : array(); + $extranew = serialize($extranew); + C::t('forum_forumfield')->update($fid, array( + 'extra' => $extranew, + 'description' => $descriptionnew, + 'seotitle' => $_GET['seotitlenew'], + 'keywords' => $_GET['keywordsnew'], + 'seodescription' => $_GET['seodescriptionnew'], + )); + loadcache('forums'); + $subfids = array(); + get_subfids($fid); + + if($newstyleid != $mforum[0]['styleid'] && !empty($subfids)) { + C::t('forum_forum')->update($subfids, array('styleid' => $newstyleid)); + } + + if(array_key_exists($fid, $navs) && !$_GET['shownavnew']) { + C::t('common_nav')->delete($navs[$fid]); + } elseif(!array_key_exists($fid, $navs) && $_GET['shownavnew']) { + $data = array( + 'url' => 'forum.php?mod=forumdisplay&fid='.$fid, + 'identifier' => $fid, + 'parentid' => 0, + 'name' => $_GET['namenew'], + 'displayorder' => 0, + 'subtype' => '', + 'type' => 5, + 'available' => 1, + 'navtype' => 0 + ); + C::t('common_nav')->insert($data); + } + + updatecache(array('forums', 'setting')); + + cpmsg('forums_edit_succeed', 'action=forums', 'succeed'); + } else { + cpmsg('forums_edit_name_invalid', '', 'error'); + } + + } else { + $extensionarray = array(); + foreach(explode(',', $_GET['attachextensionsnew']) as $extension) { + if($extension = trim($extension)) { + $extensionarray[] = $extension; + } + } + $_GET['attachextensionsnew'] = strtolower(implode(', ', $extensionarray)); + + foreach($perms as $perm) { + $_GET[''.$perm.'new'] = is_array($_GET[''.$perm]) && !empty($_GET[''.$perm]) ? "\t".implode("\t", $_GET[''.$perm])."\t" : ''; + } + + if(!$multiset) { + if($_GET['delete']) { + C::t('forum_attachtype')->delete_by_id_fid($_GET['delete'], $fid); + } + + if(is_array($_GET['extension'])) { + foreach($_GET['extension'] as $id => $val) { + C::t('forum_attachtype')->update($id, array( + 'extension' => $_GET['extension'][$id], + 'maxsize' => $_GET['maxsize'][$id] * 1024, + )); + } + } + + if(is_array($_GET['newextension'])) { + foreach($_GET['newextension'] as $key => $value) { + if($newextension1 = trim($value)) { + if(C::t('forum_attachtype')->count_by_extension_fid($newextension1, $fid)) { + cpmsg('attachtypes_duplicate', '', 'error'); + } + C::t('forum_attachtype')->insert(array( + 'extension' => $newextension1, + 'maxsize' => $_GET['newmaxsize'][$key] * 1024, + 'fid' => $fid + )); + } + } + } + } + + $fupadd = ''; + $forumdata = $forumfielddata = array(); + if($_GET['fupnew'] != $forum['fup'] && !$multiset) { + if(C::t('forum_forum')->fetch_forum_num('', $fid)) { + cpmsg('forums_edit_sub_notnull', '', 'error'); + } + + $fup = C::t('forum_forum')->fetch($_GET['fupnew']); + + $fupadd = ", type='".($fup['type'] == 'forum' ? 'sub' : 'forum')."', fup='{$fup['fid']}'"; + $forumdata['type'] = $fup['type'] == 'forum' ? 'sub' : 'forum'; + $forumdata['fup'] = $fup['fid']; + C::t('forum_moderator')->delete_by_fid_inherited($fid, 1); + if($fup['inheritedmod']) { + $query = C::t('forum_moderator')->fetch_all_by_fid($_GET['fupnew'], FALSE); + } else { + $query = C::t('forum_moderator')->fetch_all_by_fid_inherited($_GET['fupnew'], 1); + } + foreach($query as $mod) { + C::t('forum_moderator')->insert(array( + 'uid' => $mod['uid'], + 'fid' => $fid, + 'displayorder' => 0, + 'inherited' => 1 + ), false, true); + } + + $moderators = ''; + $modmemberarray = C::t('forum_moderator')->fetch_all_no_inherited_by_fid($fid); + $members = C::t('common_member')->fetch_all_username_by_uid(array_keys($modmemberarray)); + $moderators = implode("\t", $members); + + C::t('forum_forumfield')->update($fid, array('moderators' => $moderators)); + } + + $allowpostspecialtrade = intval($_GET['allowpostspecialnew'][2]); + $_GET['allowpostspecialnew'] = bindec(intval($_GET['allowpostspecialnew'][6]).intval($_GET['allowpostspecialnew'][5]).intval($_GET['allowpostspecialnew'][4]).intval($_GET['allowpostspecialnew'][3]).intval($_GET['allowpostspecialnew'][2]).intval($_GET['allowpostspecialnew'][1])); + $allowspecialonlynew = $_GET['allowpostspecialnew'] || $_G['setting']['threadplugins'] && $_GET['threadpluginnew'] ? $_GET['allowspecialonlynew'] : 0; + $forumcolumnsnew = $_GET['forumcolumnsnew'] > 1 ? intval($_GET['forumcolumnsnew']) : 0; + $threadcachesnew = max(0, min(100, intval($_GET['threadcachesnew']))); + $subforumsindexnew = $_GET['subforumsindexnew'] == -1 ? 0 : ($_GET['subforumsindexnew'] == 0 ? 2 : 1); + $_GET['simplenew'] = isset($_GET['simplenew']) ? $_GET['simplenew'] : 0; + $simplenew = bindec(sprintf('%02d', decbin($_GET['defaultorderfieldnew'])).$_GET['defaultordernew'].sprintf('%02d', decbin($subforumsindexnew)).'00'.$_GET['simplenew']); + $allowglobalsticknew = $_GET['allowglobalsticknew'] ? 1 : 0; + + if(!empty($_G['setting']['domain']['root']['forum'])) { + deletedomain($fid, 'forum'); + if(!empty($domain)) { + domaincheck($domain, $_G['setting']['domain']['root']['forum'], 1, 0); + C::t('common_domain')->insert(array('domain' => $domain, 'domainroot' => $_G['setting']['domain']['root']['forum'], 'id' => $fid, 'idtype' => 'forum')); + } + } + $forumdata = array_merge($forumdata, array( + 'status' => $_GET['statusnew'], + 'name' => $_GET['namenew'], + 'styleid' => $_GET['styleidnew'], + 'alloweditpost' => $_GET['alloweditpostnew'], + 'allowpostspecial' => $_GET['allowpostspecialnew'], + 'allowspecialonly' => $allowspecialonlynew, + 'allowhtml' => $_GET['allowhtmlnew'], + 'allowbbcode' => $_GET['allowbbcodenew'], + 'allowimgcode' => $_GET['allowimgcodenew'], + 'allowmediacode' => $_GET['allowmediacodenew'], + 'allowsmilies' => $_GET['allowsmiliesnew'], + 'alloweditrules' => $_GET['alloweditrulesnew'], + 'allowside' => $_GET['allowsidenew'], + 'disablecollect' => $_GET['disablecollectnew'], + 'modnewposts' => $_GET['modnewpostsnew'], + 'recyclebin' => $_GET['recyclebinnew'], + 'jammer' => $_GET['jammernew'], + 'allowanonymous' => $_GET['allowanonymousnew'], + 'forumcolumns' => $forumcolumnsnew, + 'catforumcolumns' => $catforumcolumnsnew, + 'threadcaches' => $threadcachesnew, + 'simple' => $simplenew, + 'allowglobalstick' => $allowglobalsticknew, + 'disablethumb' => $_GET['disablethumbnew'], + 'disablewatermark' => $_GET['disablewatermarknew'], + 'autoclose' => (!empty($_GET['autoclosenew']) && !empty($_GET['autoclosetimenew'])) ? (intval((int)$_GET['autoclosenew'] * (int)$_GET['autoclosetimenew'])) : 0, + 'allowfeed' => $_GET['allowfeednew'], + 'domain' => $domain, + )); + C::t('forum_forum')->update($fid, $forumdata); + + if(!(C::t('forum_forumfield')->fetch($fid))) { + C::t('forum_forumfield')->insert(array('fid' => $fid)); + } + + if(!$multiset) { + $creditspolicynew = array(); + $creditspolicy = $forum['creditspolicy'] ? dunserialize($forum['creditspolicy']) : array(); + foreach($_GET['creditnew'] as $rid => $rule) { + $creditspolicynew[$rules[$rid]['action']] = isset($creditspolicy[$rules[$rid]['action']]) ? $creditspolicy[$rules[$rid]['action']] : $rules[$rid]; + $usedefault = $_GET['usecustom'][$rid] ? false : true; + + if(!$usedefault) { + foreach($rule as $i => $v) { + $creditspolicynew[$rules[$rid]['action']]['extcredits'.$i] = is_numeric($v) ? intval($v) : 0; + } + } + + $cpfids = explode(',', $rules[$rid]['fids']); + $cpfidsnew = array(); + foreach($cpfids as $cpfid) { + if(!$cpfid) { + continue; + } + if($cpfid != $fid) { + $cpfidsnew[] = $cpfid; + } + } + if(!$usedefault) { + $cpfidsnew[] = $fid; + $creditspolicynew[$rules[$rid]['action']]['fids'] = $rules[$rid]['fids'] = implode(',', $cpfidsnew); + } else { + $rules[$rid]['fids'] = implode(',', $cpfidsnew); + unset($creditspolicynew[$rules[$rid]['action']]); + } + C::t('common_credit_rule')->update($rid, array('fids' => $rules[$rid]['fids'])); + } + $forumfielddata = array(); + $forumfielddata['creditspolicy'] = serialize($creditspolicynew); + + $threadtypesnew = $_GET['threadtypesnew']; + $threadtypesnew['types'] = $threadtypes['special'] = $threadtypes['show'] = array(); + $threadsortsnew['types'] = $threadsorts['special'] = $threadsorts['show'] = array(); + + if($allowthreadtypes) { + if(is_array($_GET['newname']) && $_GET['newname']) { + $newname = array_unique($_GET['newname']); + if($newname) { + foreach($newname as $key => $val) { + $newname[$key] = $val = strip_tags(trim(str_replace(array("'", "\""), array(), $val)), ""); + if($_GET['newenable'][$key] && $val) { + $newtypearr = C::t('forum_threadclass')->fetch_by_fid_name($fid, $val); + $newtypeid = $newtypearr['typeid']; + if(!$newtypeid) { + $threadtypes_newdisplayorder = intval($_GET['newdisplayorder'][$key]); + $threadtypes_newicon = trim($_GET['newicon'][$key]); + $newtypeid = C::t('forum_threadclass')->insert(array('fid' => $fid, 'name' => $val, 'displayorder' => $threadtypes_newdisplayorder, 'icon' => $threadtypes_newicon, 'moderators' => intval($_GET['newmoderators'][$key])), true); + } else { + $threadtypes_newicon = $newtypearr['icon']; + $threadtypes_newdisplayorder = $newtypearr['displayorder']; + $_GET['newmoderators'][$key] = $newtypearr['moderators']; + } + $threadtypesnew['options']['name'][$newtypeid] = $val; + $threadtypesnew['options']['icon'][$newtypeid] = $threadtypes_newicon; + $threadtypesnew['options']['displayorder'][$newtypeid] = $threadtypes_newdisplayorder; + $threadtypesnew['options']['enable'][$newtypeid] = 1; + $threadtypesnew['options']['moderators'][$newtypeid] = $_GET['newmoderators'][$key]; + } + } + } + $threadtypesnew['status'] = 1; + } else { + $newname = array(); + } + if($threadtypesnew['status']) { + if(is_array($threadtypesnew['options']) && $threadtypesnew['options']) { + if(!empty($threadtypesnew['options']['enable'])) { + $typeids = array_keys($threadtypesnew['options']['enable']); + } else { + $typeids = array(0); + } + foreach(C::t('forum_threadclass')->fetch_all_by_typeid($typeids) as $type) { + if($threadtypesnew['options']['name'][$type['typeid']] != $type['name'] || + $threadtypesnew['options']['displayorder'][$type['typeid']] != $type['displayorder'] || + $threadtypesnew['options']['icon'][$type['typeid']] != $type['icon'] || + $threadtypesnew['options']['moderators'][$type['typeid']] != $type['moderators']) { + $threadtypesnew['options']['name'][$type['typeid']] = strip_tags(trim(str_replace(array("'", "\""), array(), $threadtypesnew['options']['name'][$type['typeid']])), ""); + C::t('forum_threadclass')->update_by_typeid($type['typeid'], array( + 'name' => $threadtypesnew['options']['name'][$type['typeid']], + 'displayorder' => $threadtypesnew['options']['displayorder'][$type['typeid']], + 'icon' => $threadtypesnew['options']['icon'][$type['typeid']], + 'moderators' => $threadtypesnew['options']['moderators'][$type['typeid']], + )); + } + } + if(!empty($threadtypesnew['options']['delete'])) { + C::t('forum_threadclass')->delete_by_typeid($threadtypesnew['options']['delete']); + } + } + } else { + $threadtypesnew = ''; + } + if($threadtypesnew && $typeids) { + foreach(C::t('forum_threadclass')->fetch_all_by_typeid($typeids) as $type) { + if($threadtypesnew['options']['enable'][$type['typeid']]) { + $threadtypesnew['types'][$type['typeid']] = $threadtypesnew['options']['name'][$type['typeid']]; + } + $threadtypesnew['icons'][$type['typeid']] = trim($threadtypesnew['options']['icon'][$type['typeid']]); + $threadtypesnew['moderators'][$type['typeid']] = $threadtypesnew['options']['moderators'][$type['typeid']]; + } + $threadtypesnew = $threadtypesnew['types'] ? serialize(array + ( + 'required' => (bool)$threadtypesnew['required'], + 'listable' => (bool)$threadtypesnew['listable'], + 'prefix' => $threadtypesnew['prefix'], + 'types' => $threadtypesnew['types'], + 'icons' => $threadtypesnew['icons'], + 'moderators' => $threadtypesnew['moderators'], + )) : ''; + } + $forumfielddata['threadtypes'] = is_array($threadtypesnew) ? serialize($threadtypesnew) : $threadtypesnew; + + $threadsortsnew = $_GET['threadsortsnew']; + if($threadsortsnew['status']) { + if(is_array($threadsortsnew['options']) && $threadsortsnew['options']) { + if(!empty($threadsortsnew['options']['enable'])) { + $sortids = array_keys($threadsortsnew['options']['enable']); + } else { + $sortids = array(); + } + + $query = C::t('forum_threadtype')->fetch_all_for_order($sortids); + foreach($query as $sort) { + if($threadsortsnew['options']['enable'][$sort['typeid']]) { + $threadsortsnew['types'][$sort['typeid']] = $sort['name']; + } + $threadsortsnew['expiration'][$sort['typeid']] = $sort['expiration']; + $threadsortsnew['description'][$sort['typeid']] = $sort['description']; + $threadsortsnew['show'][$sort['typeid']] = $threadsortsnew['options']['show'][$sort['typeid']] ? 1 : 0; + } + } + + if($threadsortsnew['default'] && !$threadsortsnew['defaultshow']) { + cpmsg('forums_edit_threadsort_nonexistence', '', 'error'); + } + + $threadsortsnew = $threadsortsnew['types'] ? serialize(array + ( + 'required' => (bool)$threadsortsnew['required'], + 'prefix' => (bool)$threadsortsnew['prefix'], + 'types' => $threadsortsnew['types'], + 'show' => $threadsortsnew['show'], + 'expiration' => $threadsortsnew['expiration'], + 'description' => $threadsortsnew['description'], + 'defaultshow' => $threadsortsnew['default'] ? $threadsortsnew['defaultshow'] : '', + )) : ''; + } else { + $threadsortsnew = ''; + } + + $forumfielddata['threadsorts'] = $threadsortsnew; + + } + } + + $threadpluginnew = serialize($_GET['threadpluginnew']); + $modrecommendnew = $_GET['modrecommendnew']; + $modrecommendnew['num'] = $modrecommendnew['num'] ? intval($modrecommendnew['num']) : 10; + $modrecommendnew['cachelife'] = intval($modrecommendnew['cachelife']); + $modrecommendnew['maxlength'] = $modrecommendnew['maxlength'] ? intval($modrecommendnew['maxlength']) : 0; + $modrecommendnew['dateline'] = $modrecommendnew['dateline'] ? intval($modrecommendnew['dateline']) : 0; + $modrecommendnew['imagenum'] = $modrecommendnew['imagenum'] ? intval($modrecommendnew['imagenum']) : 0; + $modrecommendnew['imagewidth'] = $modrecommendnew['imagewidth'] ? intval($modrecommendnew['imagewidth']) : 300; + $modrecommendnew['imageheight'] = $modrecommendnew['imageheight'] ? intval($modrecommendnew['imageheight']): 250; + $descriptionnew = preg_replace('/on(mousewheel|mouseover|click|load|onload|submit|focus|blur)="[^"]*"/i', '', discuzcode($_GET['descriptionnew'], 1, 0, 0, 0, 1, 1, 0, 0, 1)); + $rulesnew = preg_replace('/on(mousewheel|mouseover|click|load|onload|submit|focus|blur)="[^"]*"/i', '', discuzcode($_GET['rulesnew'], 1, 0, 0, 0, 1, 1, 0, 0, 1)); + $extranew = is_array($_GET['extranew']) ? $_GET['extranew'] : array(); + $forum['extra'] = dunserialize($forum['extra']); + $forum['extra']['namecolor'] = $extranew['namecolor']; + + if(!$multiset) { + if(($_GET['deletebanner'] || $_FILES['bannernew']) && $forum['banner']) { + $valueparse = parse_url($forum['banner']); + if(!isset($valueparse['host'])) { + @unlink($_G['setting']['attachurl'].'common/'.$forum['banner']); + } + $forumfielddata['banner'] = ''; + if($_GET['bannernew'] == $forum['banner']) { + $_GET['bannernew'] = ''; + } + } + if($_FILES['bannernew']) { + $bannernew = upload_icon_banner($forum, $_FILES['bannernew'], 'banner'); + } else { + $bannernew = $_GET['bannernew']; + } + if($bannernew) { + $forumfielddata['banner'] = $bannernew; + } + + if($_GET['deleteicon'] || $_FILES['iconnew']) { + $valueparse = parse_url($forum['icon']); + if(!isset($valueparse['host'])) { + @unlink($_G['setting']['attachurl'].'common/'.$forum['icon']); + } + $forumfielddata['icon'] = ''; + $forum['extra']['iconwidth'] = ''; + if($_GET['iconnew'] == $forum['icon']) { + $_GET['iconnew'] = ''; + } + } + if($_FILES['iconnew']) { + $iconnew = upload_icon_banner($forum, $_FILES['iconnew'], 'icon'); + } else { + $iconnew = $_GET['iconnew']; + } + if($iconnew) { + $forumfielddata['icon'] = $iconnew; + if(!$extranew['iconwidth']) { + $valueparse = parse_url($forumfielddata['icon']); + if(!isset($valueparse['host'])) { + $iconnew = $_G['setting']['attachurl'].'common/'.$forumfielddata['icon']; + } + if($info = @getimagesize($iconnew)) { + $extranew['iconwidth'] = $info[0]; + } + } + $forum['extra']['iconwidth'] = $extranew['iconwidth']; + } else { + $forum['extra']['iconwidth'] = ''; + } + } + + $extranew = serialize($forum['extra']); + + $forumfielddata = array_merge($forumfielddata, array( + 'description' => $descriptionnew, + 'password' => $_GET['passwordnew'], + 'redirect' => $_GET['redirectnew'], + 'rules' => $rulesnew, + 'attachextensions' => $_GET['attachextensionsnew'], + 'modrecommend' => $modrecommendnew && is_array($modrecommendnew) ? serialize($modrecommendnew) : '', + 'seotitle' => $_GET['seotitlenew'], + 'keywords' => $_GET['keywordsnew'], + 'seodescription' => $_GET['seodescriptionnew'], + 'threadplugin' => $threadpluginnew, + 'extra' => $extranew, + 'commentitem' => $_GET['commentitemnew'], + 'formulaperm' => $_GET['formulapermnew'], + 'picstyle' => $_GET['picstylenew'], + 'widthauto' => $_GET['widthautonew'], + 'noantitheft' => intval($_GET['noantitheftnew']), + 'noforumhidewater' => intval($_GET['noforumhidewaternew']), + 'noforumrecommend' => intval($_GET['noforumrecommendnew']), + 'price' => intval($_GET['pricenew']), + )); + if(!$multiset) { + + if($_GET['delreplybg']) { + $valueparse = parse_url($forum['replybg']); + if(!isset($valueparse['host']) && file_exists($_G['setting']['attachurl'].'common/'.$forum['replybg'])) { + @unlink($_G['setting']['attachurl'].'common/'.$forum['replybg']); + } + $_GET['replybgnew'] = ''; + } + if($_FILES['replybgnew']) { + $data = array('fid' => "$fid"); + $replybgnew = upload_icon_banner($data, $_FILES['replybgnew'], 'replybg'); + } else { + $replybgnew = $_GET['replybgnew']; + } + + $forumfielddata = array_merge($forumfielddata, array( + 'viewperm' => $_GET['viewpermnew'], + 'postperm' => $_GET['postpermnew'], + 'replyperm' => $_GET['replypermnew'], + 'getattachperm' => $_GET['getattachpermnew'], + 'postattachperm' => $_GET['postattachpermnew'], + 'postimageperm' => $_GET['postimagepermnew'], + 'relatedgroup' => $_GET['relatedgroupnew'], + 'spviewperm' => implode("\t", is_array($_GET['spviewpermnew']) ? $_GET['spviewpermnew'] : array()), + 'replybg' => $replybgnew + )); + } + if($forumfielddata) { + C::t('forum_forumfield')->update($fid, $forumfielddata); + } + if($pluginsetting) { + foreach($_GET['pluginnew'] as $pluginvarid => $value) { + $pluginvars[$pluginvarid][$fid] = $value; + } + } + + if($modrecommendnew && !$modrecommendnew['sort']) { + require_once libfile('function/forumlist'); + recommendupdate($fid, $modrecommendnew, '1'); + } + + if($forumkeys[$fid] != $_GET['keysnew'] && preg_match('/^\w*$/', $_GET['keysnew']) && !preg_match('/^\d+$/', $_GET['keysnew'])) { + $forumkeys[$fid] = $_GET['keysnew']; + C::t('common_setting')->update_setting('forumkeys', $forumkeys); + } + + } + if(array_key_exists($fid, $navs) && !$_GET['shownavnew']) { + C::t('common_nav')->delete($navs[$fid]); + } elseif(!array_key_exists($fid, $navs) && $_GET['shownavnew']) { + $data = array( + 'url' => 'forum.php?mod=forumdisplay&fid='.$fid, + 'identifier' => $fid, + 'parentid' => 0, + 'name' => $_GET['namenew'], + 'displayorder' => 0, + 'subtype' => '', + 'type' => 5, + 'available' => 1, + 'navtype' => 0 + ); + C::t('common_nav')->insert($data); + } + if(empty($row['single'])) { + foreach($row as $key => $value) { + unset($_GET[''.$key]); + } + } + } + + if($pluginvars) { + set_pluginsetting($pluginvars); + } + + updatecache(array('forums', 'setting', 'creditrule', 'attachtype')); + cpmsg('forums_edit_succeed', "mod=forum&action=forums&operation=edit&".($multiset ? 'multi='.implode(',', $_GET['multi']) : "fid=$fid").($_GET['anchor'] ? "&anchor={$_GET['anchor']}" : ''), 'succeed'); + + } + +} elseif($operation == 'delete' && FORMHASH == $_GET['formhash']) { + $ajax = $_GET['ajax']; + $confirmed = $_GET['confirmed']; + $finished = $_GET['finished']; + $total = intval($_GET['total']); + $pp = intval($_GET['pp']); + $currow = intval($_GET['currow']); + + if($_GET['ajax']) { + require_once libfile('function/post'); + $tids = array(); + + foreach(C::t('forum_thread')->fetch_all_by_fid($fid, $pp) as $thread) { + $tids[] = $thread['tid']; + } + require_once libfile('function/delete'); + deletethread($tids); + deletedomain($fid, 'forum'); + deletedomain($fid, 'subarea'); + if($currow + $pp > $total) { + C::t('forum_forum')->delete_by_fid($fid); + C::t('common_nav')->delete_by_type_identifier(5, $fid); + C::t('home_favorite')->delete_by_id_idtype($fid, 'fid'); + C::t('forum_moderator')->delete_by_fid($fid); + C::t('common_member_forum_buylog')->delete_by_fid($fid); + C::t('forum_access')->delete_by_fid($fid); + echo 'TRUE'; + exit; + } + + echo 'GO'; + exit; + + } else { + + if($_GET['finished']) { + updatecache('forums'); + cpmsg('forums_delete_succeed', 'action=forums', 'succeed'); + + } + + if(C::t('forum_forum')->fetch_forum_num('', $fid)) { + cpmsg('forums_delete_sub_notnull', '', 'error'); + } + + if(!$_GET['confirmed']) { + + cpmsg('forums_delete_confirm', "action=forums&operation=delete&fid=$fid&formhash=".FORMHASH, 'form'); + + } else { + + $threads = C::t('forum_thread')->count_by_fid($fid); + cpmsg('forums_delete_alarm', "action=forums&operation=delete&fid=$fid&confirmed=1&formhash=".FORMHASH, 'loadingform', '', '
    0%
    ', FALSE); + + echo " +
    + + "; + } + } + +} elseif($operation == 'copy') { + + loadcache('forums'); + + $source = intval($_GET['source']); + $sourceforum = $_G['cache']['forums'][$source]; + + if(empty($sourceforum) || $sourceforum['type'] == 'group') { + cpmsg('forums_copy_source_invalid', '', 'error'); + } + + $delfields = array( + 'forums' => array('fid', 'fup', 'type', 'name', 'status', 'displayorder', 'threads', 'posts', 'todayposts', 'lastpost', 'modworks', 'icon', 'level', 'commoncredits', 'archive', 'recommend'), + 'forumfields' => array('description', 'password', 'redirect', 'moderators', 'rules', 'threadtypes', 'threadsorts', 'threadplugin', 'jointype', 'gviewperm', 'membernum', 'dateline', 'lastupdate', 'founderuid', 'foundername', 'banner', 'groupnum', 'activity'), + ); + $fields = array( + 'forums' => C::t('forum_forum')->fetch_table_struct('forum_forum'), + 'forumfields' => C::t('forum_forum')->fetch_table_struct('forum_forumfield'), + ); + + if(!submitcheck('copysubmit')) { + + require_once libfile('function/forumlist'); + + $forumselect = ''; + $optselect = ''; + shownav('forum', 'forums_copy'); + showsubmenu('forums_copy'); + showtips('forums_copy_tips'); + showformheader('forums&operation=copy'); + showhiddenfields(array('source' => $source)); + showtableheader(); + showtitle('forums_copy'); + showsetting(cplang('forums_copy_source').':','','', $sourceforum['name']); + showsetting('forums_copy_target', '', '', $forumselect); + showsetting('forums_copy_options', '', '', $optselect); + showsubmit('copysubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $fids = array(); + if(!empty($_GET['target']) && is_array($_GET['target']) && count($_GET['target'])) { + foreach($_GET['target'] as $fid) { + if(($fid = intval($fid)) && $fid != $source ) { + $fids[] = $fid; + } + } + } + if(empty($fids)) { + cpmsg('forums_copy_target_invalid', '', 'error'); + } + + $forumoptions = array(); + if(is_array($_GET['options']) && !empty($_GET['options'])) { + foreach($_GET['options'] as $option) { + if($option = trim($option)) { + if(in_array($option, $fields['forums'])) { + $forumoptions['forum_forum'][] = $option; + } elseif(in_array($option, $fields['forumfields'])) { + $forumoptions['forum_forumfield'][] = $option; + } + } + } + } + + if(empty($forumoptions)) { + cpmsg('forums_copy_options_invalid', '', 'error'); + } + foreach(array('forum_forum', 'forum_forumfield') as $table) { + if(is_array($forumoptions[$table]) && !empty($forumoptions[$table])) { + $sourceforum = C::t($table)->fetch($source); + foreach($sourceforum as $key=>$value) { + if(!in_array($key, $forumoptions[$table])) { + unset($sourceforum[$key]); + } + } + if(!$sourceforum) { + cpmsg('forums_copy_source_invalid', '', 'error'); + } + C::t($table)->update($fids, $sourceforum); + } + } + + updatecache('forums'); + cpmsg('forums_copy_succeed', 'action=forums', 'succeed'); + + } + +} + +function showforum(&$forum, $type = '', $last = '', $toggle = false) { + + global $_G; + + if($last == '') { + + $navs = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype_type(0, 5) as $nav) { + $navs[] = $nav['identifier']; + } + $return = ''. + ''.($type == 'group' ? ''.($toggle ? '[+]' : '[-]').'' : '').' + '; + if($type == 'group') { + $return .= '
    '; + $_G['fg'] = !empty($_G['fg']) ? intval($_G['fg']) : 0; + $_G['fg']++; + } elseif($type == '') { + $return .= '
    '; + } elseif($type == 'sub') { + $return .= '
    '; + } + + $boardattr = ''; + if(!$forum['status'] || $forum['password'] || $forum['redirect'] || in_array($forum['fid'], $navs)) { + $boardattr = '
    '; + $boardattr .= $forum['status'] ? '' : cplang('forums_admin_hidden'); + $boardattr .= !$forum['password'] ? '' : ' '.cplang('forums_admin_password'); + $boardattr .= !$forum['redirect'] ? '' : ' '.cplang('forums_admin_url'); + $boardattr .= !in_array($forum['fid'], $navs) ? '' : ' '.cplang('misc_customnav_parent_top'); + $boardattr .= '
    '; + } + + $return .= ''. + ($type == '' ? ''.cplang('forums_admin_add_sub').'' : ''). + '
    '.$boardattr. + '('.($type == 'group' ? 'gid:' : 'fid:').$forum['fid'].')'. + ''.showforum_moderators($forum).' + '.' + '.cplang('edit').''. + ($type != 'group' ? ''.cplang('forums_copy').'' : ''). + ''.cplang('delete').''; + if($type == 'group') $return .= ''; + } else { + if($last == 'lastboard') { + $return = ' '; + } elseif($last == 'lastchildboard' && $type) { + $return = ''; + } elseif($last == 'last') { + $return = ''. + ''.cplang('multiedit').''. + ''; + } + } + + echo $return = isset($return) ? $return : ''; + + return $forum['fid']; +} + +function showforum_moderators($forum) { + global $_G; + if($forum['moderators']) { + $moderators = explode("\t", $forum['moderators']); + $count = count($moderators); + $max = $count > 2 ? 2 : $count; + $mods = array(); + for($i = 0;$i < $max;$i++) { + $mods[] = $forum['inheritedmod'] ? ''.$moderators[$i].'' : $moderators[$i]; + } + $r = implode(', ', $mods); + if($count > 2) { + $r = ''.$r.''; + $mods = array(); + foreach($moderators as $moderator) { + $mods[] = $forum['inheritedmod'] ? ''.$moderator.'' : $moderator; + } + $r = ''.$r.' »'; + $r .= ''; + } else { + $r = ''.$r.' »'; + } + + + } else { + $r = ''.cplang('forums_admin_no_moderator').''; + } + return $r; +} + +function getthreadclasses_html($fid) { + $threadtypes = C::t('forum_forumfield')->fetch($fid); + $threadtypes = dunserialize($threadtypes['threadtypes']); + + foreach(C::t('forum_threadclass')->fetch_all_by_fid($fid) as $type) { + $enablechecked = $moderatorschecked = ''; + $typeselected = array(); + if(isset($threadtypes['types'][$type['typeid']])) { + $enablechecked = ' checked="checked"'; + } + if($type['moderators']) { + $moderatorschecked = ' checked="checked"'; + } + $typeselect .= showtablerow('', array('class="td25"'), array( + "", + "", + "", + "", + '', + "", + ), TRUE); + } + return $typeselect; +} + +function get_subfids($fid) { + global $subfids, $_G; + $subfids[] = $fid; + foreach($_G['cache']['forums'] as $key => $value) { + if($value['fup'] == $fid) { + get_subfids($value['fid']); + } + } +} + +function copy_threadclasses($threadtypes, $fid) { + global $_G; + if($threadtypes) { + $threadtypes = dunserialize($threadtypes); + $i = 0; + $data = array(); + foreach($threadtypes['types'] as $key => $val) { + $data = array('fid' => $fid, 'name' => $val, 'displayorder' => $i++, 'icon' => $threadtypes['icons'][$key], 'moderators' => $threadtypes['moderators'][$key]); + $newtypeid = C::t('forum_threadclass')->insert($data, true); + $newtypes[$newtypeid] = $val; + $newicons[$newtypeid] = $threadtypes['icons'][$key]; + $newmoderators[$newtypeid] = $threadtypes['moderators'][$key]; + } + $threadtypes['types'] = $newtypes; + $threadtypes['icons'] = $newicons; + $threadtypes['moderators'] = $newmoderators; + return serialize($threadtypes); + } + return ''; +} +?> \ No newline at end of file diff --git a/source/admincp/admincp_founder.php b/source/admincp/admincp_founder.php new file mode 100644 index 0000000..7a8725d --- /dev/null +++ b/source/admincp/admincp_founder.php @@ -0,0 +1,471 @@ +isfounder) { + exit('Access Denied'); +} + +if($operation == 'perm') { + + $do = !in_array(getgpc('do'), array('group', 'member', 'gperm', 'notifyusers')) ? 'member' : getgpc('do'); + shownav('founder', 'menu_founder_perm'); + + if($do == 'group') { + $id = intval(getgpc('id')); + + if(!$id) { + foreach(C::t('common_admincp_group')->range() as $group) { + $groups[$group['cpgroupid']] = $group['cpgroupname']; + } + if(!submitcheck('submit')) { + showsubmenu('menu_founder_perm', array( + array('nav_founder_perm_member', 'founder&operation=perm&do=member', 0), + array('nav_founder_perm_group', 'founder&operation=perm&do=group', 1), + array('nav_founder_perm_notifyusers', 'founder&operation=perm&do=notifyusers', 0), + )); + showformheader('founder&operation=perm&do=group'); + showtableheader(); + showsubtitle(array('', 'founder_cpgroupname', '')); + foreach($groups as $id => $group) { + showtablerow('style="height:20px"', array('class="td25"', 'class="td24"'), array( + "", + "", + ''.cplang('edit').'' + )); + } + showtablerow('style="height:20px"', array(), array(cplang('add_new'), '', '')); + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + } else { + if(!empty($_GET['newcpgroupname'])) { + if(C::t('common_admincp_group')->fetch_by_cpgroupname($_GET['newcpgroupname'])) { + cpmsg('founder_perm_group_name_duplicate', '', 'error', array('name' => $_GET['newcpgroupname'])); + } + C::t('common_admincp_group')->insert(array('cpgroupname' => strip_tags($_GET['newcpgroupname']))); + } + if(!empty($_GET['delete'])) { + C::t('common_admincp_perm')->delete_by_cpgroupid_perm($_GET['delete']); + C::t('common_admincp_member')->update_cpgroupid_by_cpgroupid($_GET['delete'], array('cpgroupid' => 0)); + C::t('common_admincp_group')->delete($_GET['delete']); + } + if(!empty($_GET['name'])) { + foreach($_GET['name'] as $id => $name) { + if($groups[$id] != $name) { + $cpgroupid = ($cpgroup = C::t('common_admincp_group')->fetch_by_cpgroupname($name)) ? $cpgroup['cpgroupid'] : 0; + if($cpgroupid && $_GET['name'][$cpgroupid] == $groups[$cpgroupid]) { + cpmsg('founder_perm_group_name_duplicate', '', 'error', array('name' => $name)); + } + C::t('common_admincp_group')->update($id, array('cpgroupname' => $name)); + } + } + } + cpmsg('founder_perm_group_update_succeed', 'action=founder&operation=perm&do=group', 'succeed'); + } + } else { + if(!submitcheck('submit')) { + + showpermstyle(); + $perms = array(); + foreach(C::t('common_admincp_perm')->fetch_all_by_cpgroupid($id) as $perm) { + $perms[] = $perm['perm']; + } + + $cpgroupname = ($cpgroup = C::t('common_admincp_group')->fetch($id)) ? $cpgroup['cpgroupname'] : ''; + $data = getactionarray(); + $grouplist = ''; + foreach(C::t('common_admincp_group')->range() as $ggroup) { + $grouplist .= ''.$ggroup['cpgroupname'].''; + } + $grouplist = ''.cplang('founder_group_switch').'  '. + ''; + + showsubmenu('menu_founder_groupperm', array(array()), $grouplist, array('group' => $cpgroupname)); + showformheader('founder&operation=perm&do=group&id='.$id); + showboxheader('', '', '', 1); + foreach($data['cats'] as $topkey) { + if(!$data['actions'][$topkey]) { + continue; + } + $checkedall = true; + $row = '
    '; + foreach($data['actions'][$topkey] as $k => $item) { + if(!$item) { + continue; + } + $checked = is_array($perms) ? in_array($item[1], $perms) : false; + if(!$checked) { + $checkedall = false; + } + $row .= $item[1] ? '
     
    ' : ''; + } + $row .= '
    '; + if($topkey != 'setting') { + showboxtitle(''); + } else { + showboxtitle('founder_perm_setting'); + } + echo $row; + } + showsubmit('submit'); + showboxfooter(1); + showformfooter(); + if(!empty($_GET['switch'])) { + echo ''; + } + + } else { + C::t('common_admincp_perm')->delete_by_cpgroupid_perm($id); + if($_GET['permnew']) { + foreach($_GET['permnew'] as $perm) { + C::t('common_admincp_perm')->insert(array('cpgroupid' => $id, 'perm' => $perm)); + } + } + + cpmsg('founder_perm_groupperm_update_succeed', 'action=founder&operation=perm&do=group', 'succeed'); + } + } + + } elseif($do == 'member') { + + $founders = $_G['config']['admincp']['founder'] !== '' ? explode(',', str_replace(' ', '', addslashes($_G['config']['admincp']['founder']))) : array(); + if($founders) { + $founderexists = true; + $fuid = $fuser = array(); + foreach($founders as $founder) { + if(is_numeric($founder)) { + $fuid[] = $founder; + } else { + $fuser[] = $founder; + } + } + $founders = array(); + if($fuid) { + $founders = $founders + C::t('common_member')->fetch_all($fuid, false, 0); + } + if($fuser) { + $founders = $founders + C::t('common_member')->fetch_all_by_username($fuser); + } + } else { + $founderexists = false; + $founders = C::t('common_member')->fetch_all_by_adminid(1); + } + $id = empty($_GET['id']) ? 0 : $_GET['id']; + + if(!$id) { + if(!submitcheck('submit')) { + showsubmenu('menu_founder_perm', array( + array('nav_founder_perm_member', 'founder&operation=perm&do=member', 1), + array('nav_founder_perm_group', 'founder&operation=perm&do=group', 0), + array('nav_founder_perm_notifyusers', 'founder&operation=perm&do=notifyusers', 0), + )); + $groupselect = ''; + $members = $adminmembers = array(); + $adminmembers = C::t('common_admincp_member')->range(); + foreach ($adminmembers as $adminmember) { + $adminmembers[$adminmember['uid']] = $adminmember; + } + foreach($founders as $uid => $founder) { + $members[$uid] = array('uid' => $uid, 'username' => $founder['username'], 'cpgroupname' => cplang('founder_admin')); + } + if($adminmembers) { + foreach(C::t('common_member')->fetch_all(array_keys($adminmembers), false, 0) as $member) { + if(isset($members[$member['uid']])) { + C::t('common_admincp_member')->delete($member['uid']); + continue; + } + $member['cpgroupname'] = !empty($adminmembers[$member['uid']]['cpgroupid']) ? $groups[$adminmembers[$member['uid']]['cpgroupid']] : cplang('founder_master'); + if(!$founderexists && in_array($member['uid'], array_keys($founders))) { + $member['cpgroupname'] = cplang('founder_admin'); + } + $members[$member['uid']] = $member; + } + } + if(!$founderexists) { + showtips(cplang('home_security_nofounder').cplang('home_security_founder')); + } else { + showtips('home_security_founder'); + } + showformheader('founder&operation=perm&do=member'); + showtableheader(); + showsubtitle(array('', 'founder_username', 'founder_usergname', '')); + foreach($members as $id => $member) { + $isfounder = array_key_exists($id, $founders); + showtablerow('style="height:20px"', array('class="td25"', 'class="td24"', 'class="td24"'), array( + !$isfounder || isset($adminmembers[$member['uid']]['cpgroupid']) ? "" : '', + "{$member['username']}", + $member['cpgroupname'], + !$isfounder && $adminmembers[$member['uid']]['cpgroupid'] ? ''.cplang('edit').'' : '' + )); + } + showtablerow('style="height:20px"', array('class="td25"', 'class="td24"', 'class="td24"'), array(cplang('add_new'), '', $groupselect, '')); + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + } else { + if(!empty($_GET['newcpusername'])) { + $newcpuid = C::t('common_member')->fetch_uid_by_username($_GET['newcpusername']); + if(!$newcpuid) { + cpmsg('founder_perm_member_noexists', '', 'error', array('name' => $_GET['newcpusername'])); + } + if(C::t('common_admincp_member')->count_by_uid($newcpuid) || array_key_exists($newcpuid, $founders)) { + cpmsg('founder_perm_member_duplicate', '', 'error', array('name' => $_GET['newcpusername'])); + } + C::t('common_admincp_member')->insert(array('uid' => $newcpuid, 'cpgroupid' => $_GET['newcpgroupid'])); + } + if(!empty($_GET['delete'])) { + C::t('common_admincp_member')->delete($_GET['delete']); + } + updatecache('founder'); + cpmsg('founder_perm_member_update_succeed', 'action=founder&operation=perm&do=member', 'succeed'); + } + } else { + if(!submitcheck('submit')) { + $member = C::t('common_admincp_member')->fetch($id); + if(!$member) { + cpmsg('founder_perm_member_noexists', '', 'error'); + } + $user = getuserbyuid($id); + $username = $user['username']; + $cpgroupid = empty($_GET['cpgroupid']) ? $member['cpgroupid'] : $_GET['cpgroupid']; + $member['customperm'] = empty($_GET['cpgroupid']) || $_GET['cpgroupid'] == $member['cpgroupid'] ? dunserialize($member['customperm']) : array(); + $perms = array(); + foreach(C::t('common_admincp_perm')->fetch_all_by_cpgroupid($cpgroupid) as $perm) { + $perms[] = $perm['perm']; + } + $data = getactionarray(); + + $groupselect = ''; + + showpermstyle(); + showsubmenu('menu_founder_memberperm', array(array()), '', array('username' => $username)); + + showformheader('founder&operation=perm&do=member&id='.$id); + showtableheader(); + showsetting('founder_usergname', '', '', $groupselect); + showtablefooter(); + showtableheader(); + foreach($data['cats'] as $topkey) { + if(!$data['actions'][$topkey]) { + continue; + } + $checkedall = true; + $row = ''; + foreach($data['actions'][$topkey] as $item) { + if(!$item) { + continue; + } + $checked = is_array($perms) ? in_array($item[1], $perms) : false; + $customchecked = is_array($member['customperm']) ? in_array($item[1], $member['customperm']) : false; + $extra = $checked ? ($customchecked ? '' : 'checked="checked" ').' onclick="checkclk(this)"' : 'disabled="disabled" '; + if(!$checked || $customchecked) { + $checkedall = false; + } + $row .= '
    '; + } + $row .= ''; + if($topkey != 'setting') { + showtitle(' '.cplang('header_'.$topkey).''); + } else { + showtitle('founder_perm_setting'); + } + echo $row; + } + showsubmit('submit'); + showtablefooter(); + showformfooter(); + } else { + $_permnew = !empty($_GET['permnew']) ? $_GET['permnew'] : array(); + $cpgroupidnew = $_GET['cpgroupidnew']; + $dbperms = C::t('common_admincp_perm')->fetch_all_by_cpgroupid($cpgroupidnew); + $perms = array(); + foreach($dbperms as $dbperm) { + $perms[] = $dbperm['perm']; + } + $customperm = serialize(array_diff($perms, $_permnew)); + C::t('common_admincp_member')->update($id, array('cpgroupid' => $cpgroupidnew, 'customperm' => $customperm)); + cpmsg('founder_perm_member_update_succeed', 'action=founder&operation=perm&do=member', 'succeed'); + } + } + + } elseif($do == 'gperm' && !empty($_GET['gset'])) { + + $gset = $_GET['gset']; + list($topkey, $k) = explode('_', $gset); + $data = getactionarray(); + $gset = $data['actions'][$topkey][$k]; + if(!$gset) { + cpmsg('undefined_action', '', 'error'); + } + if(!submitcheck('submit')) { + $allperms = C::t('common_admincp_perm')->fetch_all_by_perm($gset[1]); + $groups = C::t('common_admincp_group')->range(); + showsubmenu('menu_founder_permgrouplist', array(array()), '', array('perm' => cplang($gset[0]))); + + showformheader('founder&operation=perm&do=gperm&gset='.$_GET['gset']); + showtableheader(); + showsubtitle(array('', 'founder_usergname')); + foreach($groups as $id => $group) { + showtablerow('style="height:20px"', array('class="td25"', ''), array( + "", + $group['cpgroupname'] + )); + } + showsubmit('submit'); + showtablefooter(); + showformfooter(); + } else { + foreach(C::t('common_admincp_group')->range() as $group) { + if(in_array($group['cpgroupid'], $_GET['permnew'])) { + C::t('common_admincp_perm')->insert(array('cpgroupid' => $group['cpgroupid'], 'perm' => $gset[1]), false, true); + } else { + C::t('common_admincp_perm')->delete_by_cpgroupid_perm($group['cpgroupid'], $gset[1]); + } + } + cpmsg('founder_perm_gperm_update_succeed', 'action=founder&operation=perm', 'succeed'); + } + + } elseif($do == 'notifyusers') { + $notifyusers = dunserialize($_G['setting']['notifyusers']); + $notifytypes = explode(',', $_G['setting']['adminnotifytypes']); + if(!submitcheck('submit')) { + showpermstyle(); + showsubmenu('menu_founder_perm', array( + array('nav_founder_perm_member', 'founder&operation=perm&do=member', 0), + array('nav_founder_perm_group', 'founder&operation=perm&do=group', 0), + array('nav_founder_perm_notifyusers', 'founder&operation=perm&do=notifyusers', 1), + )); + showtips('founder_notifyusers_tips'); + showformheader('founder&operation=perm&do=notifyusers'); + showtableheader(); + showsubtitle(array('', 'username', '', 'founder_notifyusers_types')); + foreach($notifyusers as $uid => $user) { + $types = ''; + foreach($notifytypes as $key => $typename) { + $checked = $user['types'][$key] ? ' checked' : ''; + if(substr($typename, 0, 7) == 'verify_') { + $i = substr($typename, -1, 1); + if($_G['setting']['verify'][$i]['available']) { + $tname = $_G['setting']['verify'][$i]['title']; + } else { + continue; + } + } else { + $tname = cplang('founder_notidyusers_'.$typename); + } + $types .= "
    '; + } + showtablerow('style="height:20px"', array('class="td25"', 'class="td24"', 'class="td25"', 'class="vtop"'), array( + "", + "{$user['username']}", + ''.cplang('select_all'), + $types + )); + } + showtablerow('style="height:20px"', array('', 'colspan="3"'), array(cplang('add_new'), '')); + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + } else { + $newnotifyusers = array(); + if($_GET['name']) { + foreach($_GET['name'] as $uid => $username) { + if($_GET['delete'] && in_array($uid, $_GET['delete'])) { + continue; + } + $types = ''; + foreach($notifytypes as $typename) { + $types .= intval($_GET['notifytypes_'.$uid][$typename]); + } + $newnotifyusers[$uid] = array('username' => $username, 'types' => $types); + } + } + if($_GET['newusername']) { + $newusername = addslashes($_GET['newusername']); + $newuid = C::t('common_member')->fetch_uid_by_username($newusername); + if($newuid) { + $newnotifyusers[$newuid] = array('username' => $newusername, 'types' => ''); + } + } + C::t('common_setting')->update_setting('notifyusers', $newnotifyusers); + updatecache('setting'); + cpmsg('founder_perm_notifyusers_succeed', 'action=founder&operation=perm&do=notifyusers', 'succeed'); + } + } +} + +function getactionarray() { + $isfounder = false; + require './source/admincp/admincp_menu.php'; + require './source/admincp/admincp_perm.php'; + unset($menu['cloud'][0]); + unset($topmenu['index'], $menu['index']); + $actioncat = $actionarray = array(); + $actioncat[] = 'setting'; + $actioncat = array_merge($actioncat, array_keys($topmenu)); + $actionarray['setting'][] = array('founder_perm_allowpost', '_allowpost'); + foreach($menu as $tkey => $items) { + foreach($items as $item) { + $actionarray[$tkey][] = $item; + } + } + return array('actions' => $actionarray, 'cats' => $actioncat); +} + +function showpermstyle() { + $staticurl = STATICURL; + echo << +.item{ float: left; width: 180px; line-height: 25px; margin-left: 5px; border-right: 1px #deeffb dotted; } +.vtop .right, .item .right{ padding: 0 10px; line-height: 22px; background: url('{$staticurl}/image/admincp/bg_repno.gif') no-repeat -286px -145px; font-weight: normal;margin-right:10px; } +.vtop a:hover.right, .item a:hover.right { text-decoration:none; } + + +EOF; +} \ No newline at end of file diff --git a/source/admincp/admincp_grid.php b/source/admincp/admincp_grid.php new file mode 100644 index 0000000..34cd98f --- /dev/null +++ b/source/admincp/admincp_grid.php @@ -0,0 +1,42 @@ +fetch_setting('grid', true); + shownav('forum', 'forums_grid'); + showsubmenu('forums_grid'); + showtips('forums_grid_tips'); + showformheader('grid'); + showtableheader(''); + showsetting('forums_grid_show_grid', 'grid[showgrid]', $grid['showgrid'], 'radio', '', 1); + showsetting('forums_grid_style_type', array(0 => 'grid[gridtype]', array(array('0', $lang['forums_grid_style_image']), array(1, $lang['forums_grid_style_text']))), $grid['gridtype'], 'select'); + showsetting('forums_grid_text_length', 'grid[textleng]', $grid['textleng'], 'text'); + include_once libfile('function/forumlist'); + $forumselect = ''; + showsetting('forums_grid_data_source', '', '', $forumselect); + showsetting('forums_grid_high_light', 'grid[highlight]', $grid['highlight'], 'radio'); + showsetting('forums_grid_target_blank', 'grid[targetblank]', $grid['targetblank'], 'radio'); + showsetting('forums_grid_show_tips', 'grid[showtips]', $grid['showtips'], 'radio'); + showsetting('forums_grid_cache_life', 'grid[cachelife]', $grid['cachelife'], 'text'); + showtagfooter('tbody'); + showsubmit('gridssubmit'); + showtablefooter(); + showformfooter(); +} else { + $_POST['grid']['fids'] = in_array(0, $_POST['grid']['fids']) ? array(0) : $_POST['grid']['fids']; + C::t('common_setting')->update_setting('grid', $_POST['grid']); + updatecache('setting'); + C::t('common_syscache')->delete_syscache('grids'); + cpmsg('setting_update_succeed', 'action=grid', 'succeed'); +} +?> \ No newline at end of file diff --git a/source/admincp/admincp_group.php b/source/admincp/admincp_group.php new file mode 100644 index 0000000..2f603c9 --- /dev/null +++ b/source/admincp/admincp_group.php @@ -0,0 +1,1233 @@ +fetch_all_by_radminid(array(1, 2), '=', 'groupid'); + foreach($query as $ugroup) { + $varname[1][] = array($ugroup['groupid'], $ugroup['grouptitle'], '1'); + } + showsetting('', $varname, $group_admingroupids, 'omcheckbox'); + showsetting('forums_edit_posts_allowfeed', 'settingnew[group_allowfeed]', $setting['group_allowfeed'], 'radio'); + + showsubmit('updategroupsetting'); + showtablefooter(); + showformfooter(); + } else { + + require_once libfile('function/group'); + $settings = array(); + $settings['group_recommend'] = cacherecommend($_GET['settingnew']['group_recommend']); + require_once libfile('function/discuzcode'); + $skey_array = array('group_imgsizelimit','group_allowfeed', 'groupmod'); + foreach($_GET['settingnew'] as $skey => $svalue) { + if(in_array($skey, $skey_array)){ + $settings[$skey] = intval($svalue); + } + } + + $settings['group_admingroupids'] = $_GET['newgroup_admingroupids']; + $descriptionnew = preg_replace('/on(mousewheel|mouseover|click|load|onload|submit|focus|blur)="[^"]*"/i', '', $_GET['descriptionnew']); + $keywordsnew = $_GET['keywordsnew']; + $settings['group_description'] = $descriptionnew; + $settings['group_keywords'] = $keywordsnew; + C::t('common_setting')->update_batch($settings); + + updatecache('setting'); + cpmsg('groups_setting_succeed', 'action=group&operation=setting', 'succeed'); + } +} elseif($operation == 'type') { + shownav('group', 'nav_group_type'); + showsubmenu('nav_group_type'); + if(!submitcheck('editsubmit')) { +?> + +fetch_all_group_type(); + $groups = $forums = $subs = $fids = $showed = array(); + foreach($query as $forum) { + if($forum['type'] == 'group') { + $groups[$forum['fid']] = $forum; + } else { + $forums[$forum['fup']][] = $forum; + } + $fids[] = $forum['fid']; + } + + foreach ($groups as $id => $gforum) { + $showed[] = showgroup($gforum, 'group'); + if(!empty($forums[$id])) { + foreach ($forums[$id] as $forum) { + $showed[] = showgroup($forum); + $lastfid = 0; + if(!empty($subs[$forum['fid']])) { + foreach ($subs[$forum['fid']] as $sub) { + $showed[] = showgroup($sub, 'sub'); + $lastfid = $sub['fid']; + } + } + showgroup($forum, $lastfid, 'lastchildboard'); + } + } + showgroup($gforum, '', 'lastboard'); + } + + if(count($fids) != count($showed)) { + foreach($fids as $fid) { + if(!in_array($fid, $showed)) { + C::t('forum_forum')->update($fid, array('fup' => '0', 'type' => 'forum')); + } + } + } + + showgroup($gforum, '', 'last'); + + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + $order = $_GET['order']; + $name = $_GET['name']; + $newforum = $_GET['newforum']; + $newcat = $_GET['newcat']; + $neworder = $_GET['neworder']; + $newforumcolumns = $_GET['newforumcolumns']; + $forumcolumnsnew = $_GET['forumcolumnsnew']; + if(is_array($order)) { + foreach($order as $fid => $value) { + if(empty($name[$fid])) { + continue; + } + C::t('forum_forum')->update($fid, array('name'=>$name[$fid], 'displayorder'=>$order[$fid], 'forumcolumns'=>$forumcolumnsnew[$fid])); + } + } + + if(is_array($newcat)) { + foreach($newcat as $key => $forumname) { + if(empty($forumname)) { + continue; + } + $fid = C::t('forum_forum')->insert(array('type' => 'group', 'name' => $forumname, 'status' => 3, 'displayorder' => $newcatorder[$key], 'forumcolumns' => $newforumcolumns[$key]), 1); + C::t('forum_forumfield')->insert(array('fid' => $fid)); + } + } + + $table_forum_columns = array('fup', 'type', 'name', 'status', 'displayorder', 'styleid', 'allowsmilies', 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowanonymous', 'allowpostspecial', 'alloweditrules', 'alloweditpost', 'modnewposts', 'recyclebin', 'jammer', 'forumcolumns', 'threadcaches', 'disablewatermark', 'autoclose', 'simple'); + $table_forumfield_columns = array('fid', 'attachextensions', 'threadtypes', 'creditspolicy', 'viewperm', 'postperm', 'replyperm', 'getattachperm', 'postattachperm'); + $projectdata = array(); + + if(is_array($newforum)) { + foreach($newforum as $fup => $forums) { + $forum = C::t('forum_forum')->fetch($fup); + foreach($forums as $key => $forumname) { + if(empty($forumname)) { + continue; + } + $forumfields = array(); + + $forumfields['allowsmilies'] = $forumfields['allowbbcode'] = $forumfields['allowimgcode'] = 1; + $forumfields['allowpostspecial'] = 127; + + + $forumfields['fup'] = $forum ? $fup : 0; + $forumfields['type'] = 'forum'; + $forumfields['name'] = $forumname; + $forumfields['status'] = 3; + $forumfields['displayorder'] = $neworder[$fup][$key]; + $forumfields['forumcolumns'] = $newforumcolumns[$fup][$key]; + + $data = array(); + foreach($table_forum_columns as $field) { + if(isset($forumfields[$field])) { + $data[$field] = $forumfields[$field]; + } + } + + $forumfields['fid'] = $fid = C::t('forum_forum')->insert($data, 1); + + $data = array(); + foreach($table_forumfield_columns as $field) { + if(isset($forumfields[$field])) { + $data[$field] = $forumfields[$field]; + } + } + C::t('forum_forumfield')->insert($data); + } + } + } + updatecache('grouptype'); + cpmsg('group_update_succeed', 'action=group&operation=type', 'succeed'); + } +} elseif($operation == 'manage') { + if(!$_GET['mtype']) { + if(!submitcheck('submit', 1)) { + + shownav('group', 'nav_group_manage'); + showsubmenu('nav_group_manage'); + searchgroups($_GET['submit']); + + } else { + list($page, $start_limit, $groupnum, $conditions, $urladd) = countgroups(); + $multipage = multi($groupnum, $_G['setting']['group_perpage'], $page, ADMINSCRIPT."?action=group&operation=manage&submit=yes".$urladd); + $query = C::t('forum_forum')->fetch_all_for_search($conditions, $start_limit, $_G['setting']['group_perpage']); + foreach($query as $group) { + $groups .= showtablerow('', array('class="td25"', '', ''), array( + "", + "(fid:{$group['fid']}){$group['name']}", + $group['posts'], + $group['threads'], + $group['membernum'], + "{$group['foundername']}", + "".cplang('detail')."" + ), TRUE); + } + + shownav('group', 'nav_group_manage'); + showsubmenu('nav_group_manage'); + showformheader("group&operation=manage&mtype=managetype"); + showtableheader(cplang('groups_search_result', array('groupnum' => $groupnum)).' '.cplang('research').''); + showsubtitle(array('', 'groups_manage_name', 'groups_manage_postcount', 'groups_manage_threadcount', 'groups_manage_membercount', 'groups_manage_founder', '')); + echo $groups; + showtablerow('', array('class="td25"'), array('')); + showtablefooter(); + showtableheader('operation', 'notop'); + showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array( + '', + cplang('founder_perm_group_deletegroup'), cplang('founder_perm_group_deletegroupcomments'))); + require_once libfile('function/group'); + $groupselect = get_groupselect(0, $group['fup'], 0); + showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array( + '', + cplang('group_changetype'), + '')); + showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array( + '', + cplang('group_mergegroup'), + '  '.cplang('groups_mergegroup_id') + )); + showsubmit('submit', 'submit', '', '', $multipage); + showtablefooter(); + showformfooter(); + + } + } elseif($_GET['mtype'] == 'managetype') { + $fidarray = $_GET['fidarray']; + $optype = $_GET['optype']; + $newtypeid = intval($_GET['newtypeid']); + $targetgroup = intval($_GET['targetgroup']); + if(submitcheck('confirmed', 1)){ + $fidarray = explode(',', $fidarray); + $recommend = $_G['setting']['group_recommend'] ? array_keys(dunserialize($_G['setting']['group_recommend'])) : array(); + $fidstr = $_G['setting']['group_recommend'] ? implode(',', $recommend) : ''; + $updaterecommend = false; + foreach($fidarray as $fid) { + if(in_array($fid, $recommend)) { + $updaterecommend = true; + break; + } + } + if($optype == 'delete') { + delete_groupimg($fidarray); + require_once libfile('function/post'); + $tids = $nums = array(); + $pp = 100; + $start = intval($_GET['start']); + $query = C::t('forum_forum')->fetch_all_info_by_fids($fidarray); + foreach($query as $fup) { + $nums[$fup['fup']] ++; + } + foreach($nums as $fup => $num) { + empty($start) && C::t('forum_forumfield')->update_groupnum($fup, -$num); + } + foreach(C::t('forum_thread')->fetch_all_by_fid($fidarray, $start, $pp) as $thread) { + $tids[] = $thread['tid']; + } + require_once libfile('function/delete'); + if($tids) { + deletepost($tids, 'tid'); + deletethread($tids); + cpmsg('group_thread_removing', 'action=group&operation=manage&mtype=managetype&optype=delete&submit=yes&confirmed=yes&fidarray='.$_GET['fidarray'].'&start='.($start + $pp)); + } + loadcache('posttable_info'); + if(!empty($_G['cache']['posttable_info']) && is_array($_G['cache']['posttable_info'])) { + foreach($_G['cache']['posttable_info'] as $key => $value) { + C::t('forum_post')->delete_by_fid($key, $fidarray, true); + } + } + loadcache('threadtableids'); + $threadtableids = !empty($_G['cache']['threadtableids']) ? $_G['cache']['threadtableids'] : array('0'); + foreach($threadtableids as $tableid) { + C::t('forum_thread')->delete_by_fid($fidarray, true, $tableid); + } + C::t('forum_forumrecommend')->delete_by_fid($fidarray); + C::t('forum_forumrecommend')->delete_by_fid($fidarray); + C::t('forum_forum')->delete_by_fid($fidarray); + C::t('home_favorite')->delete_by_id_idtype($fidarray, 'gid'); + C::t('forum_groupuser')->delete_by_fid($fidarray); + C::t('forum_groupcreditslog')->delete_by_fid($fidarray); + C::t('forum_groupfield')->delete($fidarray); + + + require_once libfile('function/delete'); + deletedomain($fidarray, 'group'); + if($updaterecommend) { + cacherecommend($fidstr, false); + } + updatecache(array('setting', 'grouptype')); + cpmsg('group_delete_succeed', 'action=group&operation=manage', 'succeed'); + } elseif($optype == 'changetype') { + $fups = array(); + $query = C::t('forum_forum')->fetch_all_info_by_fids($fidarray); + foreach($query as $fup) { + $fups[$fup['fup']] ++; + } + C::t('forum_forum')->update($fidarray, array('fup' => $newtypeid)); + C::t('forum_forumfield')->update_groupnum($newtypeid, count($fidarray)); + foreach($fups as $fup => $num) { + C::t('forum_forumfield')->update_groupnum($fup, -$num); + } + updatecache('grouptype'); + cpmsg('group_changetype_succeed', 'action=group&operation=manage', 'succeed'); + + } elseif($optype == 'mergegroup') { + $start = intval($_GET['start']) ? $_GET['start'] : 0; + $threadtables = array('0'); + foreach(C::t('forum_forum_threadtable')->fetch_all_by_fid($targetgroup) as $data) { + $threadtables[] = $data['threadtableid']; + } + + if($fidarray[$start]) { + $sourcefid = $fidarray[$start]; + if(empty($start)) { + $nums = array(); + $query = C::t('forum_forum')->fetch_all_info_by_fids($fidarray); + foreach($query as $fup) { + $nums[$fup['fup']] ++; + } + foreach($nums as $fup => $num) { + C::t('forum_forumfield')->update_groupnum($fup, -$num); + } + } + foreach($threadtables as $tableid) { + C::t('forum_thread')->update_by_fid($sourcefid, array('fid'=>$targetgroup), $tableid); + } + loadcache('posttableids'); + $posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0'); + foreach($posttableids as $id) { + C::t('forum_post')->update_fid_by_fid($id, $sourcefid, $targetgroup); + } + + $targetusers = $newgroupusers = array(); + $query = C::t('forum_groupuser')->fetch_all_by_fid($targetgroup, -1); + foreach($query as $row) { + $targetusers[$row['uid']] = $row['uid']; + } + $adduser = 0; + $query = C::t('forum_groupuser')->fetch_all_by_fid($sourcefid, -1); + foreach($query as $row) { + if(empty($targetusers[$row['uid']])) { + $newgroupusers[$row['uid']] = daddslashes($row['username']); + $adduser ++; + } + } + if($adduser) { + foreach($newgroupusers as $newuid => $newusername) { + C::t('forum_groupuser')->insert($targetgroup, $newuid, $newusername, 4, TIMESTAMP); + } + C::t('forum_forumfield')->update_membernum($targetgroup, $adduser); + } + C::t('forum_groupuser')->delete_by_fid($sourcefid); + C::t('forum_groupcreditslog')->delete_by_fid($sourcefid); + C::t('forum_groupfield')->delete($sourcefid); + $start ++; + cpmsg('group_merge_continue', 'action=group&operation=manage&mtype=managetype&optype='.$optype.'&submit=yes&confirmed=yes&targetgroup='.$targetgroup.'&fidarray='.$_GET['fidarray'].'&start='.$start, '', array('m' => $start, 'n' => count($fidarray)-$start)); + } + $threads = $posts = 0; + $archive = 0; + foreach($threadtables as $tableid) { + $data = C::t('forum_thread')->count_posts_by_fid($targetgroup, $tableid); + $threads += $data['threads']; + $posts += $data['posts']; + if($data['threads'] > 0 && $tableid != 0) { + $archive = 1; + } + } + C::t('forum_forum')->update($targetgroup, array('archive' => $archive)); + C::t('forum_forum')->update_forum_counter($targetgroup, $threads, $posts); + + delete_groupimg($fidarray); + C::t('forum_forum')->delete_by_fid($fidarray); + C::t('home_favorite')->delete_by_id_idtype($fidarray, 'gid'); + require_once libfile('function/delete'); + deletedomain($fidarray, 'group'); + if($updaterecommend) { + cacherecommend($fidstr, false); + } + updatecache(array('setting', 'grouptype')); + cpmsg('group_mergegroup_succeed', 'action=group&operation=manage', 'succeed'); + } + + } + if(empty($optype) || !in_array($optype, array('delete', 'changetype', 'mergegroup'))) { + cpmsg('group_optype_no_choice', '', 'error'); + } + if($optype == 'changetype' && empty($newtypeid)) { + cpmsg('group_newtypeid_no_choice', '', 'error'); + } + if($optype == 'mergegroup' && empty($targetgroup)) { + cpmsg('group_targetgroup_no_choice', '', 'error'); + } + if($fidarray) { + $targetid = 0; + $targetname = ''; + if($optype == 'changetype' && $newtypeid) { + $targetid = $newtypeid; + } elseif($optype == 'mergegroup' && $targetgroup) { + if(in_array($targetgroup, $fidarray)) { + cpmsg('group_targetgroup_repeat', '', 'error'); + } + $targetid = $targetgroup; + } + if($targetid) { + $targetname = C::t('forum_forum')->fetch($targetid); + $targetname = $targetname['name']; + if(empty($targetname)) { + cpmsg('group_targetid_error'); + } + } + if(is_array($fidarray)) { + $fidarray = implode(',', $fidarray); + } + cpmsg('group_'.$optype.'_confirm', 'action=group&operation=manage&mtype=managetype&optype='.$optype.'&submit=yes', 'form', array('targetname' => $targetname), ''); + } else { + cpmsg('group_group_no_choice', '', 'error'); + } + } +} elseif($operation == 'deletetype') { + $fid = $_GET['fid']; + $ajax = $_GET['ajax']; + $confirmed = $_GET['confirmed']; + $finished = $_GET['finished']; + $total = intval($_GET['total']); + $pp = intval($_GET['pp']); + $currow = intval($_GET['currow']); + if($ajax && $_GET['formhash'] == formhash()) { + ob_end_clean(); + require_once libfile('function/post'); + $tids = array(); + foreach(C::t('forum_thread')->fetch_all_by_fid($fid, $pp) as $thread) { + $tids[] = $thread['tid']; + } + require_once libfile('function/delete'); + deletethread($tids); + + if($currow + $pp > $total) { + C::t('forum_forum')->delete_by_fid($fid); + C::t('home_favorite')->delete_by_id_idtype($fid, 'gid'); + C::t('forum_moderator')->delete_by_fid($fid); + C::t('forum_access')->delete_by_fid($fid); + + echo 'TRUE'; + exit; + } + + echo 'GO'; + exit; + + } else { + if($finished) { + updatecache('grouptype'); + cpmsg('grouptype_delete_succeed', 'action=group&operation=type', 'succeed'); + + } + + if(C::t('forum_forum')->fetch_forum_num('group', $fid)) { + cpmsg('grouptype_delete_sub_notnull', '', 'error'); + } + + if(!$confirmed) { + + cpmsg('grouptype_delete_confirm', "action=group&operation=deletetype&fid=$fid", 'form'); + + } else { + + $threads = C::t('forum_thread')->count_by_fid($fid); + $formhash = formhash(); + cpmsg('grouptype_delete_alarm', "action=group&operation=deletetype&fid=$fid&confirmed=1&formhash=$formhash", 'loadingform', array(), '
    0%
    ', FALSE); + echo " +
    + + "; + } + } +} elseif($operation == 'editgroup') { + require_once libfile('function/group'); + $fid = intval($_GET['fid']); + if(empty($fid)) { + cpmsg('group_nonexist', 'action=group&operation=manage', 'error'); + } + $group = C::t('forum_forum')->fetch_info_by_fid($fid); + require_once libfile('function/editor'); + $group['description'] = html2bbcode($group['description']); + + if(!$group || $group['status'] != 3 || $group['type'] != 'sub') { + cpmsg('group_nonexist', '', 'error'); + } + + require_once libfile('function/group'); + require_once libfile('function/discuzcode'); + $groupicon = get_groupimg($group['icon'], 'icon'); + $groupbanner = get_groupimg($group['banner']); + $jointypeselect = array(array('-1', cplang('closed')), array('0', cplang('public')), array('1', cplang('invite')), array('2', cplang('moderate'))); + if(!submitcheck('editsubmit')) { + $groupselect = get_groupselect(0, $group['fup'], 0); + shownav('group', 'nav_group_manage'); + showsubmenu('nav_group_manage'); + showformheader("group&operation=editgroup&fid=$fid", 'enctype'); + showtableheader(); + showsetting('groups_editgroup_name', 'namenew', $group['name'], 'text'); + showsetting('groups_editgroup_category', '', '', ''); + showsetting('groups_editgroup_jointype', array('jointypenew', $jointypeselect), $group['jointype'], 'select'); + showsetting('groups_editgroup_visible_all', 'gviewpermnew', $group['gviewperm'], 'radio'); + showsetting('groups_editgroup_description', 'descriptionnew', $group['description'], 'textarea'); + if($groupicon) { + $groupicon = ' '.$lang['delete'].'
    '; + } + if($groupbanner) { + $groupbanner = ' '.$lang['delete'].'
    '; + } + showsetting('groups_editgroup_icon', 'iconnew', '', 'file', '', 0, $groupicon); + showsetting('groups_editgroup_banner', 'bannernew', '', 'file', '', 0, $groupbanner); + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + $_GET['jointypenew'] = intval($_GET['jointypenew']); + $_GET['fupnew'] = intval($_GET['fupnew']); + $_GET['gviewpermnew'] = intval($_GET['gviewpermnew']); + require_once libfile('function/discuzcode'); + $_GET['descriptionnew'] = discuzcode(dhtmlspecialchars(censor(trim($_GET['descriptionnew']))), 0, 0, 0, 0, 1, 1, 0, 0, 1); + $_GET['namenew'] = dhtmlspecialchars(censor(trim($_GET['namenew']))); + $icondata = array(); + $iconnew = upload_icon_banner($group, $_FILES['iconnew'], 'icon'); + $bannernew = upload_icon_banner($group, $_FILES['bannernew'], 'banner'); + if($iconnew) { + $icondata['icon'] = $iconnew; + } + if($bannernew) { + $icondata['banner'] = $bannernew; + }; + + if($_GET['deleteicon']) { + @unlink($_G['setting']['attachurl'].'group/'.$group['icon']); + $icondata['icon'] = ''; + } + if($_GET['deletebanner']) { + @unlink($_G['setting']['attachurl'].'group/'.$group['banner']); + $icondata['banner'] = ''; + } + $groupdata = array_merge($icondata, array( + 'description' => $_GET['descriptionnew'], + 'gviewperm' => $_GET['gviewpermnew'], + 'jointype' => $_GET['jointypenew'], + )); + C::t('forum_forumfield')->update($fid, $groupdata); + $setarr = array(); + if($_GET['fupnew']) { + $setarr['fup'] = $_GET['fupnew']; + } + if($_GET['namenew'] && $_GET['namenew'] != $group['name'] && C::t('forum_forum')->fetch_fid_by_name($_GET['namenew'])) { + cpmsg('group_name_exist', 'action=group&operation=editgroup&fid='.$fid, 'error'); + } + trim($_GET['namenew']) && $setarr['name'] = $_GET['namenew']; + C::t('forum_forum')->update($fid, $setarr); + + if(!empty($_GET['fupnew']) && $_GET['fupnew'] != $group['fup']) { + C::t('forum_forumfield')->update_groupnum($_GET['fupnew'], 1); + C::t('forum_forumfield')->update_groupnum($group['fup'], -1); + require_once libfile('function/cache'); + updatecache('grouptype'); + } + + cpmsg('group_edit_succeed', 'action=group&operation=editgroup&fid='.$fid, 'succeed'); + } + +} elseif($operation == 'userperm') { + if(!($group_userperm = dunserialize($_G['setting']['group_userperm']))) { + $group_userperm = array(); + } + if(!submitcheck('permsubmit')) { + shownav('group', 'nav_group_userperm'); + $varname = array('newgroup_userperm', array(), 'isfloat'); + showsubmenu(cplang('nav_group_userperm').' - '.cplang('group_userperm_moderator')); + showformheader("group&operation=userperm&id=$id"); + showtableheader(); + $varname[1] = array( + array('allowstickthread', cplang('admingroup_edit_stick_thread'), '1'), + array('allowbumpthread', cplang('admingroup_edit_bump_thread'), '1'), + array('allowhighlightthread', cplang('admingroup_edit_highlight_thread'), '1'), + array('allowlivethread', cplang('admingroup_edit_live_thread'), '1'), + array('allowstampthread', cplang('admingroup_edit_stamp_thread'), '1'), + array('allowrepairthread', cplang('admingroup_edit_repair_thread'), '1'), + array('allowrefund', cplang('admingroup_edit_refund'), '1'), + array('alloweditpoll', cplang('admingroup_edit_edit_poll'), '1'), + array('allowremovereward', cplang('admingroup_edit_remove_reward'), '1'), + array('alloweditactivity', cplang('admingroup_edit_edit_activity'), '1'), + array('allowedittrade', cplang('admingroup_edit_edit_trade'), '1'), + ); + showsetting('admingroup_edit_threadperm', $varname, $group_userperm, 'omcheckbox'); + + showsetting('admingroup_edit_digest_thread', array('newgroup_userperm[allowdigestthread]', array( + array(0, cplang('admingroup_edit_digest_thread_none')), + array(1, cplang('admingroup_edit_digest_thread_1')), + array(2, cplang('admingroup_edit_digest_thread_2')), + array(3, cplang('admingroup_edit_digest_thread_3')), + )), $group_userperm['allowdigestthread'], 'mradio'); + + $varname[1] = array( + array('alloweditpost', cplang('admingroup_edit_edit_post'), '1'), + array('allowwarnpost', cplang('admingroup_edit_warn_post'), '1'), + array('allowbanpost', cplang('admingroup_edit_ban_post'), '1'), + array('allowdelpost', cplang('admingroup_edit_del_post'), '1'), + ); + showsetting('admingroup_edit_postperm', $varname, $group_userperm, 'omcheckbox'); + + $varname[1] = array( + array('allowupbanner', cplang('group_userperm_upload_banner'), '1'), + ); + showsetting('admingroup_edit_modcpperm', $varname, $group_userperm, 'omcheckbox'); + + $varname[1] = array( + array('disablepostctrl', cplang('admingroup_edit_disable_postctrl'), '1'), + array('allowviewip', cplang('admingroup_edit_view_ip'), '1') + ); + showsetting('group_userperm_others', $varname, $group_userperm, 'omcheckbox'); + + showsubmit('permsubmit', 'submit'); + showtablefooter(); + showformfooter(); + } else { + $default_perm = array('allowstickthread' => 0, 'allowbumpthread' => 0, 'allowhighlightthread' => 0, 'allowlivethread' => 0, 'allowstampthread' => 0, 'allowclosethread' => 0, 'allowmergethread' => 0, 'allowsplitthread' => 0, 'allowrepairthread' => 0, 'allowrefund' => 0, 'alloweditpoll' => 0, 'allowremovereward' => 0, 'alloweditactivity' => 0, 'allowedittrade' => 0, 'allowdigestthread' => 0, 'alloweditpost' => 0, 'allowwarnpost' => 0, 'allowbanpost' => 0, 'allowdelpost' => 0, 'allowupbanner' => 0, 'disablepostctrl' => 0, 'allowviewip' => 0); + if(empty($_GET['newgroup_userperm']) || !is_array($_GET['newgroup_userperm'])) { + $_GET['newgroup_userperm'] = array(); + } + $_GET['newgroup_userperm'] = array_merge($default_perm, $_GET['newgroup_userperm']); + if(serialize($_GET['newgroup_userperm']) != serialize($group_userperm)) { + C::t('common_setting')->update_setting('group_userperm', $_GET['newgroup_userperm']); + updatecache('setting'); + } + cpmsg('group_userperm_succeed', 'action=group&operation=userperm', 'succeed'); + } +} elseif($operation == 'level') { + $levelid = !empty($_GET['levelid']) ? intval($_GET['levelid']) : 0; + if(empty($levelid)) { + $grouplevels = ''; + if(!submitcheck('grouplevelsubmit')) { + $query = C::t('forum_grouplevel')->fetch_all_creditslower_order(); + foreach($query as $level) { + $grouplevels .= showtablerow('', array('class="td25"', '', 'class="td28"', 'class=td28'), array( + "", + "", + " ~ ", + "{$lang['detail']}" + ), TRUE); + } +echo << +var rowtypedata = [ + [ + [1,'', 'td25'], + [1,''], + [1,'', 'td28'], + [4,''] + ], + [ + [1,'', 'td25'], + [1,''], + [1,'', 'td28'], + [4, ''] + ] +]; + +EOT; + shownav('group', 'nav_group_level'); + showsubmenu('nav_group_level'); + showtips('group_level_tips'); + + showformheader('group&operation=level'); + showtableheader('group_level', 'fixpadding', 'id="grouplevel"'); + showsubtitle(array('del', 'group_level_title', 'group_level_creditsrange', '')); + echo $grouplevels; + echo ' '; + showsubmit('grouplevelsubmit', 'submit'); + showtablefooter(); + showformfooter(); + } else { + $levelnewadd = $levelnewkeys = $orderarray = array(); + $maxlevelid = 0; + if(!empty($_GET['levelnewadd'])) { + $levelnewadd = array_flip_keys($_GET['levelnewadd']); + foreach($levelnewadd as $k => $v) { + if(!$v['leveltitle'] || !$v['creditshigher']) { + unset($levelnewadd[$k]); + } + } + } + if(!empty($_GET['levelnew'])) { + $levelnewkeys = array_keys($_GET['levelnew']); + $maxlevelid = max($levelnewkeys); + } + + foreach($levelnewadd as $k=>$v) { + $_GET['levelnew'][$k+$maxlevelid+1] = $v; + } + if(is_array($_GET['levelnew'])) { + foreach($_GET['levelnew'] as $id => $level) { + if((is_array($_GET['delete']) && in_array($id, $_GET['delete'])) || ($id == 0 && (!$level['leveltitle'] || $level['creditshigher'] == ''))) { + unset($_GET['levelnew'][$id]); + } else { + $orderarray[$level['creditshigher']] = $id; + } + } + } + ksort($orderarray); + $rangearray = array(); + $lowerlimit = array_keys($orderarray); + for($i = 0; $i < count($lowerlimit); $i++) { + $rangearray[$orderarray[$lowerlimit[$i]]] = array + ( + 'creditshigher' => isset($lowerlimit[$i - 1]) ? $lowerlimit[$i] : -999999999, + 'creditslower' => isset($lowerlimit[$i + 1]) ? $lowerlimit[$i + 1] : 999999999 + ); + } + foreach($_GET['levelnew'] as $id => $level) { + $creditshighernew = $rangearray[$id]['creditshigher']; + $creditslowernew = $rangearray[$id]['creditslower']; + if($creditshighernew == $creditslowernew) { + cpmsg('group_level_update_credits_duplicate', '', 'error'); + } + $data = array( + 'leveltitle' => $level['leveltitle'], + 'creditshigher' => $creditshighernew, + 'creditslower' => $creditslowernew, + ); + if(in_array($id, $levelnewkeys)) { + C::t('forum_grouplevel')->update($id, $data); + } elseif($level['leveltitle'] && $level['creditshigher'] != '') { + $data = array( + 'leveltitle' => $level['leveltitle'], + 'type' => 'default', + 'creditshigher' => $creditshighernew, + 'creditslower' => $creditslowernew, + ); + $data['type'] = 'default'; + $newlevelid = C::t('forum_grouplevel')->insert($data, 1); + } + } + if($ids = dimplode($_GET['delete'])) { + $levelcount = C::t('forum_grouplevel')->fetch_count(); + if(!empty($_GET['delete']) && is_array($_GET['delete']) && count($_GET['delete']) == $levelcount) { + updatecache('grouplevels'); + cpmsg('group_level_succeed_except_all_levels', 'action=group&operation=level', 'succeed'); + + } + C::t('forum_grouplevel')->delete($ids); + } + updatecache('grouplevels'); + cpmsg('group_level_update_succeed', 'action=group&operation=level', 'succeed'); + } + } else { + $grouplevel = C::t('forum_grouplevel')->fetch($levelid); + if(empty($grouplevel)) { + cpmsg('group_level_noexist', 'action=group&operation=level', 'error'); + } + if(!($group_creditspolicy = dunserialize($grouplevel['creditspolicy']))) { + $group_creditspolicy = array(); + } + if(!($group_postpolicy = dunserialize($grouplevel['postpolicy']))) { + $group_postpolicy = array(); + } + if(!($specialswitch = dunserialize($grouplevel['specialswitch']))) { + $specialswitch = array(); + } + if(!submitcheck('editgrouplevel')) { + shownav('group', 'nav_group_level'); + showsubmenu('nav_group_level_editor'); + showtips('group_level_tips'); + + showformheader('group&operation=level&levelid='.$levelid, 'enctype'); + showtableheader(); + showtitle('groups_setting_basic'); + showsetting('group_level_title', 'levelnew[leveltitle]', $grouplevel['leveltitle'], 'text'); + if($grouplevel['icon']) { + $valueparse = parse_url($grouplevel['icon']); + if(isset($valueparse['host'])) { + $grouplevelicon = $grouplevel['icon']; + } else { + $grouplevelicon = $_G['setting']['attachurl'].'common/'.$grouplevel['icon'].'?'.random(6); + } + $groupleveliconhtml = '
    '; + } + showsetting('group_level_icon', 'iconnew', $grouplevel['icon'], 'filetext', '', 0, $groupleveliconhtml); + + showtitle('group_level_credits'); + $varname = array('levelnew[creditspolicy]', array(), 'isfloat'); + $varname[1] = array( + array('post', cplang('group_level_credits_post'), '1'), + array('reply', cplang('group_level_credits_reply'), '1'), + array('digest', cplang('group_level_credits_digest'), '1'), + array('postattach', cplang('group_level_credits_upload'), '1'), + array('getattach', cplang('group_level_credits_download'), '1'), + array('tradefinished', cplang('group_level_credits_trade'), '1'), + array('joinpoll', cplang('group_level_credits_poll'), '1'), + ); + showsetting('', $varname, $group_creditspolicy, 'omcheckbox'); + showtitle('group_level_posts'); + $varname = array('levelnew[postpolicy]', array(), 'isfloat'); + $varname[1] = array( + array('alloweditpost', cplang('forums_edit_posts_alloweditpost'), '1'), + array('recyclebin', cplang('forums_edit_posts_recyclebin'), '1'), + array('allowsmilies', cplang('forums_edit_posts_smilies'), '1'), + array('allowhtml', cplang('forums_edit_posts_html'), '1'), + array('allowbbcode', cplang('forums_edit_posts_bbcode'), '1'), + array('allowanonymous', cplang('forums_edit_posts_anonymous'), '1'), + array('jammer', cplang('forums_edit_posts_jammer'), '1'), + array('allowimgcode', cplang('forums_edit_posts_imgcode'), '1'), + array('allowmediacode', cplang('forums_edit_posts_mediacode'), '1'), + ); + showsetting('', $varname, $group_postpolicy, 'omcheckbox'); + + showsetting('forums_edit_posts_allowpostspecial', array('levelnew[postpolicy][allowpostspecial]', array( + cplang('thread_poll'), + cplang('thread_trade'), + cplang('thread_reward'), + cplang('thread_activity'), + cplang('thread_debate') + )), $group_postpolicy['allowpostspecial'], 'binmcheckbox'); + showsetting('forums_edit_posts_attach_ext', 'levelnew[postpolicy][attachextensions]', $group_postpolicy['attachextensions'], 'text'); + + showtitle('group_level_special'); + showsetting('group_level_special_allowchangename', 'specialswitchnew[allowchangename]', $specialswitch['allowchangename'], 'radio'); + showsetting('group_level_special_allowchangetype', 'specialswitchnew[allowchangetype]', $specialswitch['allowchangetype'], 'radio'); + showsetting('group_level_special_allowclose', 'specialswitchnew[allowclosegroup]', $specialswitch['allowclosegroup'], 'radio'); + showsetting('group_level_special_allowthreadtype', 'specialswitchnew[allowthreadtype]', $specialswitch['allowthreadtype'], 'radio'); + showsetting('group_level_special_membermax', 'specialswitchnew[membermaximum]', $specialswitch['membermaximum'], 'text'); + + showsubmit('editgrouplevel'); + showtablefooter(); + showformfooter(); + } else { + $dataarr = array(); + $levelnew = (!empty($_GET['levelnew']) && is_array($_GET['levelnew'])) ? $_GET['levelnew'] : array(); + $dataarr['leveltitle'] = $levelnew['leveltitle']; + $default_creditspolicy = array('post' => 0, 'reply' => 0, 'digest' => 0, 'postattach' => 0, 'getattach' => 0, 'tradefinished' => 0, 'joinpoll' => 0); + $levelnew['creditspolicy'] = empty($levelnew['creditspolicy']) ? $default_creditspolicy : array_merge($default_creditspolicy, $levelnew['creditspolicy']); + $dataarr['creditspolicy'] = serialize($levelnew['creditspolicy']); + $default_postpolicy = array('alloweditpost' => 0, 'recyclebin' => 0, 'allowsmilies' => 0, 'allowhtml' => 0, 'allowbbcode' => 0, 'allowanonymous' => 0, 'jammer' => 0, 'allowimgcode' => 0, 'allowmediacode' => 0); + $levelnew['postpolicy'] = array_merge($default_postpolicy, $levelnew['postpolicy']); + + $levelnew['postpolicy']['allowpostspecial'] = bindec(intval($levelnew['postpolicy']['allowpostspecial'][6]).intval($levelnew['postpolicy']['allowpostspecial'][5]).intval($levelnew['postpolicy']['allowpostspecial'][4]).intval($levelnew['postpolicy']['allowpostspecial'][3]).intval($levelnew['postpolicy']['allowpostspecial'][2]).intval($levelnew['postpolicy']['allowpostspecial'][1])); + + $dataarr['postpolicy'] = serialize($levelnew['postpolicy']); + $_GET['specialswitchnew']['membermaximum'] = intval($_GET['specialswitchnew']['membermaximum']); + $dataarr['specialswitch'] = serialize($_GET['specialswitchnew']); + if($_GET['deleteicon']) { + @unlink($_G['setting']['attachurl'].'common/'.$grouplevel['icon']); + $dataarr['icon'] = ''; + } else { + if($_FILES['iconnew']) { + $data = array('extid' => "$levelid"); + $dataarr['icon'] = upload_icon_banner($data, $_FILES['iconnew'], 'grouplevel_icon'); + } else { + $dataarr['icon'] = $_GET['iconnew']; + } + } + C::t('forum_grouplevel')->update($levelid, $dataarr); + updatecache('grouplevels'); + cpmsg('groups_setting_succeed', 'action=group&operation=level&levelid='.$levelid, 'succeed'); + } + } +} elseif($operation == 'mergetype') { + require_once libfile('function/group'); + loadcache('grouptype'); + $fid = $_GET['fid']; + $sourcetype = C::t('forum_forum')->fetch_info_by_fid($fid); + $firstgroup = $_G['cache']['grouptype']['first']; + if($firstgroup[$fid]['secondlist']) { + cpmsg('grouptype_delete_sub_notnull'); + } + shownav('group', 'nav_group_type'); + showsubmenu(cplang('nav_group_type').' - '.cplang('group_mergetype').' - '.$sourcetype['name']); + if(!submitcheck('mergesubmit', 1)) { + $groupselect = get_groupselect(0, 0, 0); + showformheader("group&operation=mergetype&fid=$fid", 'enctype'); + showtableheader(); + showsetting('group_mergetype_selecttype', '', '', ''); + showsubmit('mergesubmit'); + showtablefooter(); + showformfooter(); + } else { + $mergefid = $_GET['mergefid']; + if(empty($_GET['confirm'])) { + cpmsg('group_mergetype_confirm', 'action=group&operation=mergetype&fid='.$fid.'&mergesubmit=yes&confirm=1', 'form', array(), ''); + } + if($mergefid == $fid) { + cpmsg('group_mergetype_target_error', 'action=group&operation=mergetype&fid='.$fid, 'error'); + } + C::t('forum_forum')->update_fup_by_fup($fid, $mergefid); + C::t('forum_forum')->delete_by_fid($fid); + C::t('home_favorite')->delete_by_id_idtype($fid, 'gid'); + C::t('forum_forumfield')->update_groupnum($mergefid, $sourcetype['groupnum']); + updatecache('grouptype'); + cpmsg('group_mergetype_succeed', 'action=group&operation=type'); + } +} elseif($operation == 'mod') { + if(!empty($_GET['fidarray'])) { + $groups = array(); + $query = C::t('forum_forum')->fetch_all_info_by_fids($_GET['fidarray']); + foreach($query as $group) { + $groups[$group['fid']] = $group; + $fups[$group['fup']] ++; + } + if(submitcheck('validate')) { + C::t('forum_forum')->validate_level_for_group($_GET['fidarray']); + $updateforum = ''; + foreach($groups as $fid => $group) { + notification_add($group['founderuid'], 'group', 'group_mod_check', array('fid' => $fid, 'groupname' => $group['name'], 'url' => $_G['siteurl'].'forum.php?mod=group&fid='.$fid), 1); + } + } elseif(submitcheck('delsubmit')) { + C::t('forum_forum')->delete_by_fid($_GET['fidarray']); + C::t('home_favorite')->delete_by_id_idtype($_GET['fidarray'], 'gid'); + C::t('forum_groupuser')->delete_by_fid($_GET['fidarray']); + $updateforum = '-'; + } + foreach($fups as $fid => $num) { + $updateforum && C::t('forum_forumfield')->update_groupnum($fid, $updateforum.$num); + } + cpmsg('group_mod_succeed', 'action=group&operation=mod', 'succeed'); + } + + loadcache('grouptype'); + $perpage = 50; + $page = intval($_GET['page']) ? intval($_GET['page']) : 1; + $startlimit = ($page - 1) * $perpage; + $count = C::t('forum_forum')->validate_level_num(); + $multipage = multi($count, $perpage, $page, ADMINSCRIPT."?action=group&operation=mod&submit=yes"); + $query = C::t('forum_forum')->fetch_all_validate($startlimit, $startlimit+$perpage); + foreach($query as $group) { + $groups .= showtablerow('', array('class="td25"', '', ''), array( + "", + "{$group['name']}", + empty($_G['cache']['grouptype']['first'][$group['fup']]) ? $_G['cache']['grouptype']['second'][$group['fup']]['name'] : $_G['cache']['grouptype']['first'][$group['fup']]['name'], + "{$group['foundername']}", + dgmdate($group['dateline']) + ), TRUE); + $groups .=showtablerow('', array('','colspan="4"'), array('',cplang('group_mod_description').' : '.$group['description']), TRUE); + } + shownav('group', 'nav_group_mod'); + showsubmenu('nav_group_mod'); + showformheader("group&operation=mod"); + showtableheader('group_mod_wait'); + showsubtitle(array('', 'groups_manage_name', 'groups_editgroup_category', 'groups_manage_founder', 'groups_manage_createtime')); + echo $groups; + showsubmit('', '', '', '              ', $multipage); + showtablefooter(); + showformfooter(); +} + +function showgroup(&$forum, $type = '', $last = '') { + global $_G; + loadcache('grouptype'); + if($last == '') { + $return = ''; + if($type == 'group') { + $return .= '
    '; + } elseif($type == '') { + $return .= '
    '; + } elseif($type == 'sub') { + $return .= '
    '; + } + + $boardattr = $fcolumns = ''; + $fcolumns = ' '.cplang('groups_type_show_rows').''; + + if(!$forum['status'] || $forum['password'] || $forum['redirect']) { + $boardattr = '
    '; + $boardattr .= $forum['status'] ? '' : cplang('forums_admin_hidden'); + $boardattr .= !$forum['password'] ? '' : ' '.cplang('forums_admin_password'); + $boardattr .= !$forum['redirect'] ? '' : ' '.cplang('forums_admin_url'); + $boardattr .= '
    '; + } + $selectgroups = ''; + if($type == 'group') { + $secondlist = array(); + if(!empty($_G['cache']['grouptype']['first'][$forum['fid']]['secondlist'])){ + $secondlist = $_G['cache']['grouptype']['first'][$forum['fid']]['secondlist']; + } + $secondlist[] = $forum['fid']; + foreach($secondlist as $sfid) { + $selectgroups .= "&selectgroupid[]=$sfid"; + } + $forum['groupnum'] = $_G['cache']['grouptype']['first'][$forum['fid']]['groupnum']; + } else { + $selectgroups = '&selectgroupid[]='.$forum['fid']; + } + + $return .= ' '.$fcolumns.'
    '.$boardattr. + ' + '.$forum['groupnum'].' + '.cplang('delete').''; + $return .= ''.cplang('groups_type_search').''.cplang('group_mergetype').''; + $return .= ''; + } else { + if($last == 'lastboard') { + $return = ''; + } elseif($last == 'lastchildboard' && $type) { + $return = ''; + } elseif($last == 'last') { + $return = ''; + } + } + echo $return; + return $forum['fid']; +} + +function searchgroups($submit) { + global $_G; + require_once libfile('function/group'); + empty($_GET['selectgroupid']) && $_GET['selectgroupid'] = array(); + $groupselect = get_groupselect(0, $_GET['selectgroupid'], 0); + $monthselect = $dayselect = $birthmonth = $birthday = ''; + for($m=1; $m<=12; $m++) { + $m = sprintf("%02d", $m); + $monthselect .= "\n"; + } + for($d=1; $d<=31; $d++) { + $d = sprintf("%02d", $d); + $dayselect .= "\n"; + } + + showtagheader('div', 'searchgroups', !$submit); + echo ''; + showformheader("group&operation=manage"); + showtableheader(); + showsetting('groups_manage_name', 'srchname', $srchname, 'text'); + showsetting('groups_manage_id', 'srchfid', $srchfid, 'text'); + showsetting('groups_editgroup_category', '', '', ''); + showsetting('groups_manage_membercount', array('memberlower', 'memberhigher'), array($_GET['memberlower'], $_GET['memberhigher']), 'range'); + showsetting('groups_manage_threadcount', array('threadshigher', 'threadslower'), array($threadshigher, $threadslower), 'range'); + showsetting('groups_manage_replycount', array('postshigher', 'postslower'), array($postshigher, $postslower), 'range'); + showsetting('groups_manage_createtime', array('datelineafter', 'datelinebefore'), array($datelineafter, $datelinebefore), 'daterange'); + showsetting('groups_manage_updatetime', array('lastupdateafter', 'lastupdatebefore'), array($lastupdateafter, $lastupdatebefore), 'daterange'); + showsetting('groups_manage_founder', 'srchfounder', $srchfounder, 'text'); + showsetting('groups_manage_founder_uid', 'srchfounderid', $srchfounderid, 'text'); + + showtagfooter('tbody'); + showsubmit('submit'); + showtablefooter(); + showformfooter(); + showtagfooter('div'); +} + +function countgroups() { + global $_G; + $_G['setting']['group_perpage'] = 100; + $page = $_GET['page'] ? $_GET['page'] : 1; + $start_limit = ($page - 1) * $_G['setting']['group_perpage']; + $dateoffset = date('Z') - ($_G['setting']['timeoffset'] * 3600); + $username = trim($username); + + $conditions = 'f.type=\'sub\' AND f.status=\'3\''; + if($_GET['srchname'] != '') { + $srchname = explode(',', addslashes($_GET['srchname'])); + foreach($srchname as $u) { + $srchnameary[] = " f.name LIKE '%".str_replace(array('%', '*', '_'), array('\%', '%', '\_'), $u)."%'"; + } + $srchnameary = is_array($srchnameary) ? $srchnameary : array($srchnameary); + $conditions .= " AND (".implode(' OR ', $srchnameary).")"; + } + $conditions .= intval($_GET['srchfid']) ? " AND f.fid='".intval($_GET['srchfid'])."'" : ''; + $conditions .= !empty($_GET['selectgroupid']) && !in_array('all', $_GET['selectgroupid']) != '' ? " AND f.fup IN ('".implode('\',\'', dintval($_GET['selectgroupid'], true))."')" : ''; + + $conditions .= $_GET['postshigher'] != '' ? " AND f.posts>'".intval($_GET['postshigher'])."'" : ''; + $conditions .= $_GET['postslower'] != '' ? " AND f.posts<'".intval($_GET['postslower'])."'" : ''; + + $conditions .= $_GET['threadshigher'] != '' ? " AND f.threads>'".intval($_GET['threadshigher'])."'" : ''; + $conditions .= $_GET['threadslower'] != '' ? " AND f.threads<'".intval($_GET['threadslower'])."'" : ''; + + $conditions .= $_GET['memberhigher'] != '' ? " AND ff.membernum<'".intval($_GET['memberhigher'])."'" : ''; + $conditions .= $_GET['memberlower'] != '' ? " AND ff.membernum>'".intval($_GET['memberlower'])."'" : ''; + + $conditions .= $_GET['datelinebefore'] != '' ? " AND ff.dateline<'".strtotime($_GET['datelinebefore'])."'" : ''; + $conditions .= $_GET['datelineafter'] != '' ? " AND ff.dateline>'".strtotime($_GET['datelineafter'])."'" : ''; + + $conditions .= $_GET['lastupbefore'] != '' ? " AND ff.lastupdate<'".strtotime($_GET['lastupbefore'])."'" : ''; + $conditions .= $_GET['lastupafter'] != '' ? " AND ff.lastupdate>'".strtotime($_GET['lastupafter'])."'" : ''; + + if($_GET['srchfounder'] != '') { + $srchfounder = explode(',', addslashes($_GET['srchfounder'])); + foreach($srchfounder as $fu) { + $srchfnameary[] = " ff.foundername LIKE '".str_replace(array('%', '*', '_'), array('\%', '%', '\_'), $fu)."'"; + } + $srchfnameary = is_array($srchnameary) ? $srchfnameary : array($srchfnameary); + $conditions .= " AND (".implode(' OR ', $srchfnameary).")"; + } + + $conditions .= intval($_GET['srchfounderid']) ? " AND ff.founderuid='".intval($_GET['srchfounderid'])."'" : ''; + + + if(!$conditions && !$uidarray && $operation == 'clean') { + cpmsg('groups_search_invalid', '', 'error'); + } + + $urladd = "&srchname=".rawurlencode($_GET['srchname'])."&srchfid=".intval($_GET['srchfid'])."&postshigher=".rawurlencode($_GET['postshigher'])."&postslower=".rawurlencode($_GET['postslower'])."&threadshigher=".rawurlencode($_GET['threadshigher'])."&threadslower=".rawurlencode($_GET['threadslower'])."&memberhigher=".rawurlencode($_GET['memberhigher'])."&memberlower=".rawurlencode($_GET['memberlower'])."&datelinebefore=".rawurlencode($_GET['datelinebefore'])."&datelineafter=".rawurlencode($_GET['datelineafter'])."&lastupbefore=".rawurlencode($_GET['lastupbefore'])."&lastupafter=".rawurlencode($_GET['lastupafter'])."&srchfounderid=".rawurlencode($_GET['srchfounderid']); + + $groupnum = C::t('forum_forum')->fetch_all_for_search($conditions, -1); + return array($page, $start_limit, $groupnum, $conditions, $urladd); +} + +function delete_groupimg($fidarray) { + global $_G; + if(!empty($fidarray)) { + $query = C::t('forum_forumfield')->fetch_all($fidarray); + $imgdir = $_G['setting']['attachdir'].'/group/'; + foreach($query as $group) { + @unlink($imgdir.$group['icon']); + @unlink($imgdir.$group['banner']); + } + } +} + +function array_flip_keys($arr) { + $arr2 = array(); + $arr = is_array($arr) ? $arr : array(); + $arrkeys = is_array($arr) ? array_keys($arr) : array(); + $first = current(array_slice($arr, 0, 1)); + if($first) { + foreach($first as $k=>$v) { + foreach($arrkeys as $key) { + $arr2[$k][$key] = $arr[$key][$k]; + } + } + } + return $arr2; +} +function cacherecommend($fidstr, $return = true) { + require_once libfile('function/group'); + $group_recommend = array(); + $recommend_num = 8; + $recommends = $fidstr ? explode(',', $fidstr) : array(); + if($recommends) { + $query = C::t('forum_forum')->fetch_all_info_by_fids($recommends, 3); + foreach($query as $val) { + $row = array(); + if($val['type'] == 'sub') { + $row = array('fid' => $val['fid'], 'name' => $val['name'], 'description' => $val['description'], 'icon' => $val['icon']); + $row['icon'] = get_groupimg($row['icon'], 'icon'); + $temp[$row['fid']] = $row; + } + } + foreach($recommends as $key) { + if(!empty($temp[$key])) { + $group_recommend[$key] = $temp[$key]; + } + } + } + if(count($group_recommend) < $recommend_num) { + $query = C::t('forum_forum')->fetch_all_default_recommend($recommend_num); + foreach($query as $row) { + $row['icon'] = get_groupimg($row['icon'], 'icon'); + if(count($group_recommend) == $recommend_num) { + break; + } elseif(empty($group_recommend[$row['fid']])) { + $group_recommend[$row['fid']] = $row; + } + } + } + if($return) { + return $group_recommend; + } else { + C::t('common_setting')->update_batch(array('group_recommend' => $group_recommend)); + } +} +?> \ No newline at end of file diff --git a/source/admincp/admincp_index.php b/source/admincp/admincp_index.php new file mode 100644 index 0000000..78a385d --- /dev/null +++ b/source/admincp/admincp_index.php @@ -0,0 +1,573 @@ +delete_note($_GET['noteid'], (isfounder() ? '' : $_G['username'])); + } + if(!empty($_GET['newmessage'])) { + $newaccess = 0; + $_GET['newexpiration'] = TIMESTAMP + (intval($_GET['newexpiration']) > 0 ? intval($_GET['newexpiration']) : 30) * 86400; + $_GET['newmessage'] = nl2br(dhtmlspecialchars($_GET['newmessage'])); + $data = array( + 'admin' => $_G['username'], + 'access' => 0, + 'adminid' => $_G['adminid'], + 'dateline' => $_G['timestamp'], + 'expiration' => $_GET['newexpiration'], + 'message' => $_GET['newmessage'], + ); + C::t('common_adminnote')->insert($data); + } +} + +require_once libfile('function/cloudaddons'); +$newversion = (CHARSET == 'utf-8') ? dunserialize($_G['setting']['cloudaddons_newversion']) : json_decode($_G['setting']['cloudaddons_newversion'], true); +if(empty($newversion['newversion']) || !is_array($newversion['newversion']) || abs($_G['timestamp'] - $newversion['updatetime']) > 86400 || (isset($_GET['checknewversion']) && $_G['formhash'] == $_GET['formhash'])) { + $newversion = json_decode(cloudaddons_open('&mod=app&ac=upgrade'), true); + if(!empty($newversion['newversion'])) { + $newversion['updatetime'] = $_G['timestamp']; + C::t('common_setting')->update_setting('cloudaddons_newversion', ((CHARSET == 'utf-8') ? $newversion : json_encode($newversion))); + updatecache('setting'); + } else { + $newversion = array(); + } +} + +$reldisp = is_numeric(DISCUZ_RELEASE) ? ('Release '.DISCUZ_RELEASE) : DISCUZ_RELEASE; + +cpheader(); +shownav(); + +show_user_bar(); +show_todo(); +show_security_advise(); +show_releasetips(); +show_envcheck(); + +echo ' + +'; + + +echo '
    '; + +echo '
    '; +show_sysinfo(); +show_news(); +show_forever_thanks(); +echo '
    '; + +echo '
    '; +show_widgets(); +echo '
    '; + +echo '
    '; + +echo '
    '; + +$now = date('Y'); +echo << +

    Powered by Discuz! {$_G['setting']['version']}

    +

    © 2001-$now Discuz! Team.

    +
    +EOT; + +function show_user_bar() { + global $_G; + if(isfounder()) { + $cpadmingroup = cplang('founder_admin'); + } else { + if($GLOBALS['admincp']->adminsession['cpgroupid']) { + $cpgroup = C::t('common_admincp_group')->fetch($GLOBALS['admincp']->adminsession['cpgroupid']); + $cpadmingroup = $cpgroup['cpgroupname']; + } else { + $cpadmingroup = cplang('founder_master'); + } + } + + showsubmenu('home_welcome', array(), '
    '.avatar(getglobal('uid'), 'middle', array('class' => 'avt')).' +
    +

    '.cplang('home_welcome_txt').$_G['member']['username'].'

    +

    '.$cpadmingroup.' | '.cplang('home_mods').': 0

    +
    ', array('bbname' => $_G['setting']['bbname'])); +} + +function show_security_advise() { + if(!isfounder()) { + return; + } + global $lang, $_G; + + $securityadvise = ''; + $securityadvise .= !$_G['config']['admincp']['founder'] ? $lang['home_security_nofounder'] : ''; + $securityadvise .= !$_G['config']['admincp']['checkip'] ? $lang['home_security_checkip'] : ''; + $securityadvise .= $_G['config']['admincp']['runquery'] ? $lang['home_security_runquery'] : ''; + if($securityadvise) { + showtableheader('home_security_tips', '', '', 0); + showtablerow('', 'class="tipsblock"', '
      '.$securityadvise.'
    '); + showtablefooter(); + } +} + +function show_todo() { + global $_G; + + $membersmod = C::t('common_member_validate')->count_by_status(0); + $threadsdel = C::t('forum_thread')->count_by_displayorder(-1); + $groupmod = C::t('forum_forum')->validate_level_num(); + $reportcount = C::t('common_report')->fetch_count(); + + $modcount = array(); + foreach (C::t('common_moderate')->count_group_idtype_by_status(0) as $value) { + $modcount[$value['idtype']] = $value['count']; + } + + $medalsmod = C::t('forum_medallog')->count_by_type(2); + $threadsmod = $modcount['tid']; + $postsmod = $modcount['pid']; + $blogsmod = $modcount['blogid']; + $doingsmod = $modcount['doid']; + $picturesmod = $modcount['picid']; + $sharesmod = $modcount['sid']; + $commentsmod = $modcount['uid_cid'] + $modcount['blogid_cid'] + $modcount['sid_cid'] + $modcount['picid_cid']; + $articlesmod = $modcount['aid']; + $articlecommentsmod = $modcount['aid_cid']; + $topiccommentsmod = $modcount['topicid_cid']; + $verify = ''; + foreach (C::t('common_member_verify_info')->group_by_verifytype_count() as $value) { + if($value['num']) { + if($value['verifytype']) { + $verifyinfo = !empty($_G['setting']['verify'][$value['verifytype']]) ? $_G['setting']['verify'][$value['verifytype']] : array(); + if($verifyinfo['available']) { + $verify .= ''.cplang('home_mod_verify_prefix').$verifyinfo['title'].'('.$value['num'].')'; + } + } else { + $verify .= ''.cplang('home_mod_verify_prefix').cplang('members_verify_profile').'('.$value['num'].')'; + } + } + } + + $modtotalnum = intval($membersmod + $threadsmod + $postsmod + $medalsmod + $blogsmod + $picturesmod + $doingsmod + $sharesmod + $commentsmod + $articlesmod + $articlecommentsmod + $topiccommentsmod + $reportcount + $threadsdel); + if($modtotalnum > 0) { + echo ''; + } + if($membersmod || $threadsmod || $postsmod || $medalsmod || $blogsmod || $picturesmod || $doingsmod || $sharesmod || $commentsmod || $articlesmod || $articlecommentsmod || $topiccommentsmod || $reportcount || $threadsdel || !empty($verify)) { + showboxheader('', '', '', 1); + echo '
    +

    '.cplang('home_mods').':

    '; + showboxfooter(); + } +} + +function show_releasetips() { + global $_G, $reldisp, $newversion; + + $siteuniqueid = C::t('common_setting')->fetch_setting('siteuniqueid'); + if(empty($siteuniqueid) || strlen($siteuniqueid) < 16) { + $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; + $siteuniqueid = 'DX'.$chars[date('y') % 60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($_G['clientip'].$_G['username'].TIMESTAMP), 0, 4).random(4); + C::t('common_setting')->update_setting('siteuniqueid', $siteuniqueid); + require_once libfile('function/cache'); + updatecache('setting'); + } + + if(!empty($_GET['closesitereleasetips'])) { + C::t('common_setting')->update('sitereleasetips', 0); + $sitereleasetips = 0; + require_once libfile('function/cache'); + updatecache('setting'); + } else { + $sitereleasetips = C::t('common_setting')->fetch('sitereleasetips'); + } + + $siterelease = C::t('common_setting')->fetch('siterelease'); + $releasehash = substr(hash('sha512', $_G['config']['security']['authkey'].DISCUZ_VERSION.DISCUZ_RELEASE.$siteuniqueid), 0, 32); + if(empty($siterelease) || strcmp($siterelease, $releasehash) !== 0) { + C::t('common_setting')->update('siteversion', DISCUZ_VERSION); + C::t('common_setting')->update('siterelease', $releasehash); + C::t('common_setting')->update('sitereleasetips', 1); + $sitereleasetips = 1; + require_once libfile('function/cloudaddons'); + $newversion = json_decode(cloudaddons_open('&mod=app&ac=upgrade'), true); + if(!empty($newversion['newversion'])) { + $newversion['updatetime'] = $_G['timestamp']; + C::t('common_setting')->update_setting('cloudaddons_newversion', ((CHARSET == 'utf-8') ? $newversion : json_encode($newversion))); + } else { + $newversion = array(); + } + require_once libfile('function/cache'); + updatecache('setting'); + } + + if($sitereleasetips) { + showboxheader('version_tips', '', 'id="version_tips"'); + echo ''.lang("admincp", "version_tips_msg", array('ADMINSCRIPT' => ADMINSCRIPT, 'version' => constant("DISCUZ_VERSION").' '.$reldisp)).''; + showboxfooter(); + } +} + +function show_onlines() { + $admincp_session = C::t('common_admincp_session')->fetch_all_by_panel(1); + if(count($admincp_session) == 1) { + return; + } + $onlines = ''; + $members = C::t('common_member')->fetch_all(array_keys($admincp_session), false, 0); + foreach ($admincp_session as $uid => $online) { + $onlines .= ''.$members[$uid]['username'].'   '; + } + showboxheader('home_onlines', '', 'id="home_onlines"'); + echo $onlines; + showboxfooter(); +} + +function show_note() { + global $_G; + + showformheader('index'); + showboxheader('home_notes', '', 'id="home_notes"'); + + $notemsghtml = ''; + foreach (C::t('common_adminnote')->fetch_all_by_access(0) as $note) { + if($note['expiration'] < TIMESTAMP) { + C::t('common_adminnote')->delete_note($note['id']); + } else { + $note['adminenc'] = rawurlencode($note['admin']); + $note['expiration'] = ceil(($note['expiration'] - $note['dateline']) / 86400); + $note['dateline'] = dgmdate($note['dateline'], 'dt'); + $notemsghtml .= '
    '.''. + ("

    {$note['admin']}

    {$note['dateline']}

    (".cplang('home_notes_add').cplang('validity').": {$note['expiration']} ".cplang('days').")

    {$note['message']}

    ").'
    '; + } + } + + if($notemsghtml) { + echo '
    '.$notemsghtml.'
    '; + } + + showboxrow('style="align-items: center"', array('class="dcol lineheight"', 'class="dcol lineheight"'), array( + cplang('home_notes_add'), + ''.cplang('validity').': '.cplang('days').' ' + )); + showboxfooter(); + showformfooter(); +} + +function show_filecheck() { + global $lang; + + if(!isfounder()) { + return; + } + + $filecheck = C::t('common_cache')->fetch('checktools_filecheck_result'); + if($filecheck) { + list($modifiedfiles, $deletedfiles, $unknownfiles, $doubt) = dunserialize($filecheck['cachevalue']); + $filecheckresult = "
    {$lang['filecheck_modify']}$modifiedfiles". + "{$lang['filecheck_delete']}$deletedfiles". + "{$lang['filecheck_unknown']}$unknownfiles". + "{$lang['filecheck_doubt']}$doubt

    ". + $lang['filecheck_last_homecheck'].': '.dgmdate($filecheck['dateline'], 'u').' ['.$lang['filecheck_view_list'].']

    '; + } else { + $filecheckresult = ''; + } + + showboxheader($lang['nav_filecheck'].' ['.$lang['filecheck_check_now'].']', 'nobottom fixpadding', 'id="filecheck"'); + echo '
    '.$filecheckresult.'
    '; + showboxfooter(); + if(TIMESTAMP - $filecheck['dateline'] > 86400 * 7) { + echo ''; + } +} + +function show_envcheck() { + global $reldisp; + + $return = ''; + $env_ok = true; + $now_ver_gd = function_exists('gd_info') ? gd_info() : false; + $now_ver = array('PHP' => constant('PHP_VERSION'), 'MySQL' => helper_dbtool::dbversion(), 'XML' => function_exists('xml_parser_create'), 'JSON' => function_exists('json_encode'), 'FileSock Function' => (function_exists('fsockopen') || function_exists('pfsockopen') || function_exists('stream_socket_client') || function_exists('curl_init')), 'GD' => ($now_ver_gd ? preg_replace('/[^0-9.]+/', '', $now_ver_gd['GD Version']) : false)); + $req_ver = array('PHP' => '5.6.0', 'MySQL' => '5.5.3', 'XML' => true, 'JSON' => true, 'FileSock Function' => true, 'GD' => '1.0'); + $sug_ver = array('PHP' => '7.4.0', 'MySQL' => '8.0.0', 'XML' => true, 'JSON' => true, 'FileSock Function' => true, 'GD' => '2.0'); + foreach ($now_ver as $key => $value) { + if($req_ver[$key] === true) { + if(!$value) { + $return .= ''.lang("admincp", "req_not_found", array('req' => $key)).''; + $env_ok = false; + } + } elseif(version_compare($value, $req_ver[$key], '<')) { + $return .= ''.lang("admincp", "req_ver_too_low", array('req' => $key, 'now_ver' => $value, 'sug_ver' => $sug_ver[$key], 'req_ver' => $req_ver[$key])).''; + $env_ok = false; + } + } + if(!$env_ok) { + showboxheader('detect_environment', '', 'id="detect_environment"'); + echo $return; + showboxfooter(); + } +} + +function show_sysinfo() { + global $newversion, $reldisp, $lang, $_G; + + loaducenter(); + + if(empty($newversion['newversion']['qqqun'])) { + $newversion['newversion']['qqqun'] = '73'.'210'.'36'.'90'; + } + + showboxheader('home_sys_info', 'listbox', 'id="home_sys_info"'); + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_discuz_version'), + 'Discuz! '.DISCUZ_VERSION.' '.$reldisp.' '.strtoupper(CHARSET).((strlen(DISCUZ_RELEASE) == 8 && DISCUZ_RELEASE != '20180101') ? '' : cplang('home_git_version')) + )); + + $newversion['newversion'] = !empty($newversion['newversion']) ? $newversion['newversion'] : array(); + $reldisp_addon = is_numeric($newversion['newversion']['release']) ? ('Release '.$newversion['newversion']['release']) : $newversion['newversion']['release']; + + $downlist = array(); + foreach ($newversion['newversion']['downlist'] as $key => $value) { + $downlist[] = ''.discuzcode(strip_tags(diconv($value['title'], 'utf-8', CHARSET)), 1, 0).''; + } + + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_check_newversion'), + ($newversion['newversion']['release'] ? ($newversion['newversion']['release'] != DISCUZ_RELEASE ? '' : '').'Discuz! '.$newversion['newversion']['version'].' '.$reldisp_addon.' '.strtoupper(CHARSET).' '.($newversion['newversion']['release'] != DISCUZ_RELEASE ? '' : '') : ''.cplang('detect_environment_error').''). + ' [ '.cplang('refresh').' ]  

    '. + (!empty($downlist) ? implode('、', $downlist).($newversion['newversion']['qqqun'] ? '  |  '.cplang('qq_group').$newversion['newversion']['qqqun'].'' : '') : ''.cplang('download_latest').' | '.cplang('qq_group').'73'.'21'.'03'.'690') + )); + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_ucclient_version'), + 'UCenter '.UC_CLIENT_VERSION.' Release '.UC_CLIENT_RELEASE + )); + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_environment'), + PHP_OS.'('.PHP_OS_FAMILY.') / PHP '.PHP_VERSION.(PHP_ZTS ? ' TS' : '').(PHP_DEBUG ? ' DEBUG' : '').' / '.PHP_SAPI + )); + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_serversoftware'), + $_SERVER['SERVER_SOFTWARE'] + )); + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_database'), + helper_dbtool::dbversion() + )); + if(@ini_get('file_uploads')) { + require_once libfile('function/upload'); + $fileupload = getmaxupload(); + } else { + $fileupload = ''.$lang['no'].''; + } + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_upload_perm'), + $fileupload + )); + $dbsize = helper_dbtool::dbsize(); + $dbsize = $dbsize ? sizecount($dbsize) : $lang['unknown']; + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_database_size'), + $dbsize + )); + if(isset($_GET['attachsize'])) { + $attachsize = C::t('forum_attachment_n')->get_total_filesize(); + $attachsize = is_numeric($attachsize) ? sizecount($attachsize) : $lang['unknown']; + } else { + $attachsize = '[ '.$lang['detail'].' ]'; + } + showboxrow('', array('class="dcol lineheight d-14"', 'class="dcol lineheight d-1"'), array( + cplang('home_attach_size'), + $attachsize + )); + showboxfooter(); +} + +function show_news() { + global $newversion; + + showboxheader('discuz_news', 'listbox', 'id="discuz_news"'); + if(!empty($newversion['news'])) { + $newversion['news'] = dhtmlspecialchars($newversion['news']); + foreach ($newversion['news'] as $v) { + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol"'), array( + ''.discuzcode(strip_tags(diconv($v['title'], 'utf-8', CHARSET)), 1, 0).'', + '['.discuzcode(strip_tags($v['date']), 1, 0).']', + )); + } + } else { + showboxrow('', array('class="dcol d-1"', 'class="dcol td21" style="text-align:right;"'), array( + ''.cplang('log_in_to_update').'', + '', + )); + showboxrow('', array('class="dcol d-1"', 'class="dcol td21" style="text-align:right;"'), array( + ''.cplang('download_latest').'', + '', + )); + } + showboxfooter(); +} + +function show_widgets() { + $widgets = array( + array('.', 'show_onlines'), + array('.', 'show_note'), + array('.', 'show_filecheck'), + ); + $plugins = C::t('common_plugin')->fetch_all_data(); + foreach ($plugins as $plugin) { + $cpindexfile = DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/admin/admin_widget.php'; + if(!file_exists($cpindexfile)) { + continue; + } + $widgets[] = array($cpindexfile, 'widget_'.$plugin['identifier']); + } + + foreach ($widgets as $widget) { + list($file, $func) = $widget; + if($file != '.') { + require_once $file; + } + if(!function_exists($func)) { + continue; + } + $func(); + } +} + +function show_forever_thanks() { + $copyRightMessage = array( + '版权所有', + '腾讯云计算(北京)有限责任公司', + '承接运营', + '合肥贰道网络科技有限公司', + ); + $gitTeamStr = ''; + $gitTeam = array( + 'laozhoubuluo' => '老周部落', + 'popcorner' => 'popcorner', + 'oldhuhu' => 'oldhuhu', + 'zoewho' => '湖中沉', + '3dming' => '诸葛晓明', + 'brotherand2' => 'brotherand2', + 'contributions' => 'git', + 'nftstudio' => '逆风天', + 'ONEXIN' => 'ONEXIN', + ); + foreach ($gitTeam as $id => $name) { + $gitTeamStr .= ''.$name.''; + } + $devTeamStr = ''; + $devTeam = array( + '174393' => 'Guode \'sup\' Li', + '859' => 'Hypo \'Cnteacher\' Wang', + '263098' => 'Liming \'huangliming\' Huang', + '706770' => 'Jun \'Yujunhao\' Du', + '80629' => 'Ning \'Monkeye\' Hou', + '246213' => 'Lanbo Liu', + '322293' => 'Qingpeng \'andy888\' Zheng', + '401635' => 'Guosheng \'bilicen\' Zhang', + '2829' => 'Mengshu \'msxcms\' Chen', + '492114' => 'Liang \'Metthew\' Xu', + '1087718' => 'Yushuai \'Max\' Cong', + '875919' => 'Jie \'tom115701\' Zhang', + ); + foreach ($devTeam as $id => $name) { + $devTeamStr .= ''.$name.''; + } + $devSkins = array( + '294092' => 'Fangming \'Lushnis\' Li', + '674006' => 'Jizhou \'Iavav\' Yuan', + '717854' => 'Ruitao \'Pony.M\' Ma', + ); + $devSkinsStr = ''; + foreach ($devSkins as $id => $name) { + $devSkinsStr .= ''.$name.''; + } + $devThanksStr = ''; + $devThanks = array( + '122246' => 'Heyond', + '632268' => 'JinboWang', + '15104' => 'Redstone', + '10407' => 'Qiang Liu', + '210272' => 'XiaoDunFang', + '86282' => 'Jianxieshui', + '9600' => 'Theoldmemory', + '2629' => 'Rain5017', + '26926' => 'Snow Wolf', + '17149' => 'Hehechuan', + '9132' => 'Pk0909', + '248' => 'feixin', + '675' => 'Laobing Jiuba', + '13877' => 'Artery', + '233' => 'Huli Hutu', + '122' => 'Lao Gui', + '159' => 'Tyc', + '177' => 'Stoneage', + '7155' => 'Gregry', + ); + foreach ($devThanks as $id => $name) { + $devThanksStr .= ''.$name.''; + } + + showboxheader('home_dev', 'fixpadding', 'id="home_dev"'); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array($copyRightMessage[0], ''.$copyRightMessage[1].'')); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array($copyRightMessage[2], ''.$copyRightMessage[3].'')); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array(cplang('contributors'), $gitTeamStr)); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array('', ''.cplang('contributors_see').'')); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array(cplang('home_dev_manager'), ''.cplang('dev_manager').'')); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array(cplang('home_dev_team'), $devTeamStr)); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array(cplang('home_dev_skins'), $devSkinsStr)); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team"'), array(cplang('home_dev_thanks'), $devThanksStr)); + showboxrow('', array('class="dcol d-1 lineheight"', 'class="dcol lineheight team tm"'), array(cplang('home_dev_links'), ' + '.cplang('discuz_git').',  + '.cplang('discussion_area').',   + '.cplang('app_discussion').',  + '.cplang('app_center').'')); + showboxfooter(); +} \ No newline at end of file diff --git a/source/admincp/admincp_login.php b/source/admincp/admincp_login.php new file mode 100644 index 0000000..50c67cc --- /dev/null +++ b/source/admincp/admincp_login.php @@ -0,0 +1,168 @@ +core->var['inajax']) { + ajaxshowheader(); + ajaxshowfooter(); +} +if($this->cpaccess == -2 || $this->cpaccess == -3) { + html_login_header(false); +} else { + html_login_header(); +} + +if($this->cpaccess == -5) { + echo '
    '.lang('admincp_login', 'login_cp_guest').'
    '; + +}elseif($this->cpaccess == -2 || $this->cpaccess == -3) { + echo '
    '.lang('admincp_login', 'login_cp_noaccess').''; + +}elseif($this->cpaccess == -1) { + $ltime = $this->sessionlife - (TIMESTAMP - $this->adminsession['dateline']); + echo '
    '.lang('admincp_login', 'login_cplock', array('ltime' => $ltime)).'
    '; + +}elseif($this->cpaccess == -4) { + $ltime = $this->sessionlife - (TIMESTAMP - $this->adminsession['dateline']); + echo '
    '.lang('admincp_login', 'login_user_lock').'
    '; + +} else { + html_login_form(); +} + +html_login_footer(); + +function html_login_header($form = true) { + global $_G; + $charset = CHARSET; + $cptitle = lang('admincp_login', 'admincp_title'); + $title = lang('admincp_login', 'login_title'); + $tips = lang('admincp_login', 'login_tips'); + $staticurl = STATICURL; + $light_mode = lang('admincp_login', 'login_dk_light_mode'); + $by_system = lang('admincp_login', 'login_dk_by_system'); + $normal_mode = lang('admincp_login', 'login_dk_normal_mode'); + $dark_mode = lang('admincp_login', 'login_dk_dark_mode'); + echo << + + + + + + + +$title + + + + + + + +
    +
    +
    + + + +
    +
    + + + +
    +
    + +
    +EOT; + + if($form) { + echo << +
    +

    $cptitle

    +

    $tips

    +
    +EOT; + } +} + +function html_login_footer($halt = true) { + $version = getglobal('setting/version'); + $cookiepre = getglobal('config/cookie/cookiepre'); + $copy = lang('admincp_login', 'copyright'); + echo << + + + + +EOT; + + $halt && exit(); +} + +function html_login_form() { + global $_G; + $isguest = !getglobal('uid'); + $lang = lang('admincp_login'); + $sid = getglobal('sid'); + $formhash = getglobal('formhash'); + $_SERVER['QUERY_STRING'] = str_replace('&', '&', dhtmlspecialchars($_SERVER['QUERY_STRING'])); + $extra = ADMINSCRIPT.'?'.(getgpc('action') && getgpc('frames') ? 'frames=yes&' : '').$_SERVER['QUERY_STRING']; + $forcesecques = ''; + echo << + + + +EOT; + if($isguest) { + echo <<
    ", + $nav['type'] == '0' ? $nav['url'] : "", + cplang($nav['type'] == '0' ? 'inbuilt' : ($nav['type'] == '3' ? 'nav_plugin' : ($nav['type'] == '4' ? 'channel' : 'custom'))), + "", + "{$lang['edit']}" + )); + } + echo ''; + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + + echo << + var rowtypedata = [ + [[1, '', 'td25'], [1,'', 'td25'], [1, ''], [4, '']], + ]; + +EOT; + + } else { + + if($ids = dimplode($_GET['delete'])) { + C::t('common_nav')->delete_by_navtype_id(1, $_GET['delete']); + } + + if(is_array($_GET['namenew'])) { + foreach($_GET['namenew'] as $id => $name) { + $name = trim(dhtmlspecialchars($name)); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'][$id])); + $availablenew[$id] = $name && (!isset($_GET['urlnew'][$id]) || $_GET['urlnew'][$id]) && $_GET['availablenew'][$id]; + $displayordernew[$id] = intval($_GET['displayordernew'][$id]); + $data = array( + 'displayorder' => $displayordernew[$id], + 'available' => $availablenew[$id], + ); + if(!empty($_GET['urlnew'][$id])) { + $data['url'] = $urlnew; + } + if(!empty($name)) { + $data['name'] = $name; + } + C::t('common_nav')->update($id, $data); + } + } + + if(is_array($_GET['newname'])) { + foreach($_GET['newname'] as $k => $v) { + $v = dhtmlspecialchars(trim($v)); + if(!empty($v)) { + $newavailable = $v && $_GET['newurl'][$k]; + $newdisplayorder[$k] = intval($_GET['newdisplayorder'][$k]); + $newurl[$k] = str_replace('&', '&', dhtmlspecialchars($_GET['newurl'][$k])); + $data = array( + 'name' => $v, + 'displayorder' => $newdisplayorder[$k], + 'url' => $newurl[$k], + 'type' => 1, + 'available' => $newavailable, + 'navtype' => 1 + ); + C::t('common_nav')->insert($data); + } + } + } + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=footernav', 'succeed'); + + } + + } elseif($do == 'edit' && ($id = $_GET['id'])) { + + $nav = C::t('common_nav')->fetch_by_id_navtype($id, 1); + if(!$nav) { + cpmsg('nav_not_found', '', 'error'); + } + + if(!submitcheck('editsubmit')) { + + $string = sprintf('%02d', $nav['highlight']); + + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader("nav&operation=footernav&do=edit&id=$id"); + showtableheader(); + showtitle(cplang('nav_nav_footernav').' - '.$nav['name']); + showsetting('misc_customnav_name', 'namenew', $nav['name'], 'text'); + showsetting('misc_customnav_title', 'titlenew', $nav['title'], 'text'); + showsetting('misc_customnav_url', 'urlnew', $nav['url'], 'text', $nav['type'] == '0'); + showsetting('misc_customnav_style', array('stylenew', array(cplang('misc_customnav_style_underline'), cplang('misc_customnav_style_italic'), cplang('misc_customnav_style_bold'))), $string[0], 'binmcheckbox'); + showsetting('misc_customnav_style_color', array('colornew', array( + array(0, 'Default'), + array(1, 'Red'), + array(2, 'Orange'), + array(3, 'Yellow'), + array(4, 'Green'), + array(5, 'Cyan'), + array(6, 'Blue'), + array(7, 'Purple'), + array(8, 'Gray'), + )), $string[1], 'mradio2'); + showsetting('misc_customnav_url_open', array('targetnew', array( + array(0, cplang('misc_customnav_url_open_default')), + array(1, cplang('misc_customnav_url_open_blank')) + ), TRUE), $nav['target'], 'mradio'); + if($nav['type']) { + showsetting('misc_customnav_level', array('levelnew', array( + array(0, cplang('nolimit')), + array(1, cplang('member')), + array(2, cplang('usergroups_system_3')), + array(3, cplang('usergroups_system_1')), + )), $nav['level'], 'select'); + } + showtagfooter('tbody'); + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $namenew = trim(dhtmlspecialchars($_GET['namenew'])); + $titlenew = trim(dhtmlspecialchars($_GET['titlenew'])); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'])); + $colornew = $_GET['colornew']; + $stylebin = ''; + for($i = 3; $i >= 1; $i--) { + $stylebin .= empty($_GET['stylenew'][$i]) ? '0' : '1'; + } + $stylenew = bindec($stylebin); + $targetnew = intval($_GET['targetnew']) ? 1 : 0; + $levelnew = $nav['type'] ? (intval($_GET['levelnew']) && $_GET['levelnew'] > 0 && $_GET['levelnew'] < 4 ? intval($_GET['levelnew']) : 0) : 0; + $urladd = $nav['type'] != '0' && $urlnew ? ", url='".$urlnew."'" : ''; + + $data = array( + 'name' => $namenew, + 'title' => $titlenew, + 'highlight' => "$stylenew$colornew", + 'target' => $targetnew, + 'level' => $levelnew + ); + if($nav['type'] != '0' && $urlnew) { + $data['url'] = $urlnew; + } + C::t('common_nav')->update($id, $data); + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=footernav', 'succeed'); + + } + + } + +} elseif($operation == 'spacenav') { + + if(!$do) { + + if(!submitcheck('submit')) { + + shownav('style', 'nav_setting_customnav'); + + showsubmenu('nav_setting_customnav', $navdata); + showtips('nav_spacenav_tips'); + showformheader('nav&operation=spacenav'); + showtableheader(); + showsubtitle(array('', 'display_order', 'name', 'url', 'type', 'available', '')); + + $navlist = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype(2) as $nav) { + if($nav['available'] < 0) { + continue; + } + $navlist[$nav['id']] = $nav; + } + + foreach($navlist as $nav) { + $navicon = str_replace('{STATICURL}', STATICURL, $nav['icon']); + if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navicon) && !(($valueparse = parse_url($navicon)) && isset($valueparse['host']))) { + $navicon = $_G['setting']['attachurl'].'common/'.$nav['icon'].'?'.random(6); + } + showtablerow('', array('class="td25"', 'class="td25"', '', ''), array( + in_array($nav['type'], array('2', '1')) ? "" : '', + "", + !in_array($nav['name'], array('{hr}')) ? ("". + ($nav['icon'] ? '' : '')) : "".cplang('nav_spacenav_'.str_replace(array('{', '}'), '', $nav['name']), array('navname' => $_G['setting']['navs'][5]['navname'])), + $nav['type'] == '0' || $nav['name'] == '{hr}' ? $nav['url'] : "", + cplang($nav['type'] == '0' ? 'inbuilt' : ($nav['type'] == '3' ? 'nav_plugin' : ($nav['type'] == '4' ? 'channel' : 'custom'))), + "", + !in_array($nav['name'], array('{hr}')) ? "{$lang['edit']}" : '' + )); + } + echo ''; + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + + echo << + var rowtypedata = [ + [[1, '', 'td25'], [1,'', 'td25'], [1, ''], [4, '']], + [[1, '', 'td25'], [1,'', 'td25'], [1, '{$lang['nav_spacenav_hr']}'], [4, '']], + ]; + +EOT; + + } else { + + if($ids = dimplode($_GET['delete'])) { + C::t('common_nav')->delete_by_navtype_id(2, $_GET['delete']); + } + + if(is_array($_GET['namenew'])) { + foreach($_GET['namenew'] as $id => $name) { + $name = trim(dhtmlspecialchars($name)); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'][$id])); + $urladd = !empty($_GET['urlnew'][$id]) ? ", url='$urlnew'" : ''; + $availablenew[$id] = $name && (!isset($_GET['urlnew'][$id]) || $_GET['urlnew'][$id]) && $_GET['availablenew'][$id]; + $displayordernew[$id] = intval($_GET['displayordernew'][$id]); + $nameadd = !empty($name) ? ", name='$name'" : ''; + $data = array( + 'displayorder' => $displayordernew[$id], + 'available' => $availablenew[$id] + ); + if(!empty($_GET['urlnew'][$id])) { + $data['url'] = $urlnew; + } + if(!empty($name)) { + $data['name'] = $name; + } + C::t('common_nav')->update($id, $data); + } + } + + if(is_array($_GET['newname'])) { + foreach($_GET['newname'] as $k => $v) { + $v = dhtmlspecialchars(trim($v)); + if(!empty($v)) { + $newavailable = $v && $_GET['newurl'][$k]; + $newdisplayorder[$k] = intval($_GET['newdisplayorder'][$k]); + $newurl[$k] = str_replace('&', '&', dhtmlspecialchars($_GET['newurl'][$k])); + $data = array( + 'name' => $v, + 'displayorder' => $newdisplayorder[$k], + 'url' => $newurl[$k], + 'type' => 1, + 'available' => $newavailable, + 'navtype' => 2 + ); + C::t('common_nav')->insert($data); + } + } + } + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=spacenav', 'succeed'); + + } + + } elseif($do == 'edit' && ($id = $_GET['id'])) { + + $nav = C::t('common_nav')->fetch_by_id_navtype($id, 2); + if(!$nav) { + cpmsg('nav_not_found', '', 'error'); + } + + if(!submitcheck('editsubmit')) { + + $nav['allowsubnew'] = 1; + if(substr($nav['subname'], 0, 1) == "\t") { + $nav['allowsubnew'] = 0; + $nav['subname'] = substr($nav['subname'], 1); + } + if($nav['icon']) { + $navicon = str_replace('{STATICURL}', STATICURL, $nav['icon']); + if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navicon) && !(($valueparse = parse_url($navicon)) && isset($valueparse['host']))) { + $navicon = $_G['setting']['attachurl'].'common/'.$nav['icon'].'?'.random(6); + } + $naviconhtml = '

    '; + } + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader("nav&operation=spacenav&do=edit&id=$id", 'enctype'); + showtableheader(); + showtitle(cplang('nav_nav_spacenav').' - '.$nav['name']); + showsetting('misc_customnav_name', 'namenew', $nav['name'], 'text'); + showsetting('misc_customnav_title', 'titlenew', $nav['title'], 'text'); + showsetting('misc_customnav_url', 'urlnew', $nav['url'], 'text', $nav['type'] == '0'); + showsetting('misc_customnav_icon', 'iconnew', $nav['icon'], 'filetext', '', 0, cplang('misc_customnav_icon_comment').$naviconhtml); + showsetting('misc_customnav_allowsub', 'allowsubnew', $nav['allowsubnew'], 'radio', '', 1); + showsetting('misc_customnav_subname', 'subnamenew', $nav['subname'], 'text'); + showsetting('misc_customnav_suburl', 'suburlnew', $nav['suburl'], 'text', $nav['type'] == '0'); + showtagfooter('tbody'); + showsetting('misc_customnav_url_open', array('targetnew', array( + array(0, cplang('misc_customnav_url_open_default')), + array(1, cplang('misc_customnav_url_open_blank')) + ), TRUE), $nav['target'], 'mradio'); + showsetting('misc_customnav_level', array('levelnew', array( + array(0, cplang('nolimit')), + array(1, cplang('member')), + array(2, cplang('usergroups_system_3')), + array(3, cplang('usergroups_system_1')), + )), $nav['level'], 'select'); + showtagfooter('tbody'); + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $namenew = trim(dhtmlspecialchars($_GET['namenew'])); + $titlenew = trim(dhtmlspecialchars($_GET['titlenew'])); + $subnamenew = trim(dhtmlspecialchars($_GET['subnamenew'])); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'])); + $suburlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['suburlnew'])); + $targetnew = intval($_GET['targetnew']) ? 1 : 0; + $levelnew = intval($_GET['levelnew']) && $_GET['levelnew'] > 0 && $_GET['levelnew'] < 4 ? intval($_GET['levelnew']) : 0 ; + $urladd = $nav['type'] != '0' && $urlnew ? ", url='$urlnew'" : ''; + $urladd .= $nav['type'] != '0' && $suburlnew ? ", suburl='$suburlnew'" : ''; + + if(empty($_GET['allowsubnew'])) { + $subnamenew = "\t".$subnamenew; + } + $iconnew = addslashes($nav['icon']); + if($_FILES['iconnew']) { + $upload = new discuz_upload(); + if($upload->init($_FILES['iconnew'], 'common') && $upload->save()) { + $iconnew = $upload->attach['attachment']; + } + } else { + $iconnew = $_GET['iconnew']; + } + if($_GET['deleteicon'] && $nav['icon']) { + $valueparse = parse_url($nav['icon']); + if(!isset($valueparse['host']) && !strexists($nav['icon'], '{STATICURL}')) { + @unlink($_G['setting']['attachurl'].'common/'.$nav['icon']); + } + $iconnew = ''; + } + $iconadd = ", icon='$iconnew'"; + + $data = array( + 'name' => $namenew, + 'subname' => $subnamenew, + 'title' => $titlenew, + 'target' => $targetnew, + 'level' => $levelnew, + 'icon' => $iconnew + ); + if($nav['type'] != '0' && $urlnew) { + $data['url'] = $urlnew; + } + if($nav['type'] != '0' && $suburlnew) { + $data['suburl'] = $suburlnew; + } + C::t('common_nav')->update($id, $data); + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=spacenav', 'succeed'); + + } + + } + +} elseif($operation == 'mynav') { + + if(!$do) { + + if(!submitcheck('submit')) { + + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader('nav&operation=mynav'); + showtableheader(); + showsubtitle(array('', 'display_order', 'name', 'url', 'type', 'available', '')); + + $navlist = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype(3) as $nav) { + if($nav['available'] < 0) { + continue; + } + $navlist[$nav['id']] = $nav; + } + + foreach($navlist as $nav) { + $navicon = str_replace('{STATICURL}', STATICURL, $nav['icon']); + if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navicon) && !(($valueparse = parse_url($navicon)) && isset($valueparse['host']))) { + $navicon = $_G['setting']['attachurl'].'common/'.$nav['icon'].'?'.random(6); + } + showtablerow('', array('class="td25"', 'class="td25"', '', ''), array( + in_array($nav['type'], array('2', '1')) ? "" : '', + "", + "". + ($nav['icon'] ? '' : ''), + $nav['type'] == '0' ? $nav['url'] : "", + cplang($nav['type'] == '0' ? 'inbuilt' : ($nav['type'] == '3' ? 'nav_plugin' : ($nav['type'] == '4' ? 'channel' : 'custom'))), + "", + "{$lang['edit']}" + )); + } + echo ''; + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + + echo << + var rowtypedata = [ + [[1, '', 'td25'], [1,'', 'td25'], [1, ''], [4, '']], + ]; + +EOT; + + } else { + + if($_GET['delete']) { + C::t('common_nav')->delete_by_navtype_id(3, $_GET['delete']); + } + + if(is_array($_GET['namenew'])) { + foreach($_GET['namenew'] as $id => $name) { + $name = trim(dhtmlspecialchars($name)); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'][$id])); + $urladd = !empty($_GET['urlnew'][$id]) ? ", url='$urlnew'" : ''; + $availablenew[$id] = $name && (!isset($_GET['urlnew'][$id]) || $_GET['urlnew'][$id]) && $_GET['availablenew'][$id]; + $displayordernew[$id] = intval($_GET['displayordernew'][$id]); + $nameadd = !empty($name) ? ", name='$name'" : ''; + $data = array( + 'displayorder' => $displayordernew[$id], + 'available' => $availablenew[$id] + ); + if(!empty($_GET['urlnew'][$id])) { + $data['url'] = $urlnew; + } + if(!empty($name)) { + $data['name'] = $name; + } + C::t('common_nav')->update($id, $data); + } + } + + if(is_array($_GET['newname'])) { + foreach($_GET['newname'] as $k => $v) { + $v = dhtmlspecialchars(trim($v)); + if(!empty($v)) { + $newavailable = $v && $_GET['newurl'][$k]; + $newdisplayorder[$k] = intval($_GET['newdisplayorder'][$k]); + $newurl[$k] = str_replace('&', '&', dhtmlspecialchars($_GET['newurl'][$k])); + $data = array( + 'name' => $v, + 'displayorder' => $newdisplayorder[$k], + 'url' => $newurl[$k], + 'type' => 1, + 'available' => $newavailable, + 'navtype' => 3 + ); + C::t('common_nav')->insert($data); + } + } + } + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=mynav', 'succeed'); + + } + + } elseif($do == 'edit' && ($id = $_GET['id'])) { + + $nav = C::t('common_nav')->fetch_by_id_navtype($id, 3); + if(!$nav) { + cpmsg('nav_not_found', '', 'error'); + } + + if(!submitcheck('editsubmit')) { + + $nav['allowsubnew'] = 1; + if(substr($nav['subname'], 0, 1) == "\t") { + $nav['allowsubnew'] = 0; + $nav['subname'] = substr($nav['subname'], 1); + } + if($nav['icon']) { + $navicon = str_replace('{STATICURL}', STATICURL, $nav['icon']); + if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navicon) && !(($valueparse = parse_url($navicon)) && isset($valueparse['host']))) { + $navicon = $_G['setting']['attachurl'].'common/'.$nav['icon'].'?'.random(6); + } + $naviconhtml = '

    '; + } + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader("nav&operation=mynav&do=edit&id=$id", 'enctype'); + showtableheader(); + showtitle(cplang('nav_nav_mynav').' - '.$nav['name']); + showsetting('misc_customnav_name', 'namenew', $nav['name'], 'text'); + showsetting('misc_customnav_title', 'titlenew', $nav['title'], 'text'); + showsetting('misc_customnav_url', 'urlnew', $nav['url'], 'text', $nav['type'] == '0'); + showsetting('misc_customnav_icon', 'iconnew', $nav['icon'], 'filetext', '', 0, cplang('misc_mynav_icon_comment').$naviconhtml); + showsetting('misc_customnav_url_open', array('targetnew', array( + array(0, cplang('misc_customnav_url_open_default')), + array(1, cplang('misc_customnav_url_open_blank')) + ), TRUE), $nav['target'], 'mradio'); + showsetting('misc_customnav_level', array('levelnew', array( + array(0, cplang('nolimit')), + array(1, cplang('member')), + array(2, cplang('usergroups_system_3')), + array(3, cplang('usergroups_system_1')), + )), $nav['level'], 'select'); + showtagfooter('tbody'); + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $namenew = trim(dhtmlspecialchars($_GET['namenew'])); + $titlenew = trim(dhtmlspecialchars($_GET['titlenew'])); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'])); + $targetnew = intval($_GET['targetnew']) ? 1 : 0; + $levelnew = intval($_GET['levelnew']) && $_GET['levelnew'] > 0 && $_GET['levelnew'] < 4 ? intval($_GET['levelnew']) : 0 ; + $urladd = $nav['type'] != '0' && $urlnew ? ", url='$urlnew'" : ''; + + $iconnew = addslashes($nav['icon']); + if($_FILES['iconnew']) { + $upload = new discuz_upload(); + if($upload->init($_FILES['iconnew'], 'common') && $upload->save()) { + $iconnew = $upload->attach['attachment']; + } + } else { + $iconnew = $_GET['iconnew']; + } + if($_GET['deleteicon'] && $nav['icon']) { + $valueparse = parse_url($nav['icon']); + if(!isset($valueparse['host']) && !strexists($nav['icon'], '{STATICURL}')) { + @unlink($_G['setting']['attachurl'].'common/'.$nav['icon']); + } + $iconnew = ''; + } + $iconadd = ", icon='$iconnew'"; + + $data = array( + 'name' => $namenew, + 'title' => $titlenew, + 'target' => $targetnew, + 'level' => $levelnew, + 'icon' => $iconnew + ); + if($nav['type'] != '0' && $urlnew) { + $data['url'] = $urlnew; + } + C::t('common_nav')->update($id, $data); + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=mynav', 'succeed'); + + } + + } + +} elseif($operation == 'topnav') { + + if(!$do) { + + if(!submitcheck('submit')) { + + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader('nav&operation=topnav'); + showtableheader(); + showsubtitle(array('', 'display_order', 'name', 'setting_styles_global_topnavtype', 'url', 'type', 'available', '')); + + $navlist = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype(4) as $nav) { + $navlist[$nav['id']] = $nav; + } + + foreach($navlist as $nav) { + $navtype = array(); + $navtype[$nav['subtype']] = 'selected="selected"'; + showtablerow('', array('class="td25"', 'class="td25"', '', ''), array( + in_array($nav['type'], array('2', '1')) ? "" : '', + "", + "
    ", + "", + $nav['type'] == '0' ? $nav['url'] : "", + cplang($nav['type'] == '0' ? 'inbuilt' : ($nav['type'] == '3' ? 'nav_plugin' : ($nav['type'] == '4' ? 'channel' : 'custom'))), + "", + "{$lang['edit']}" + )); + } + echo ''; + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + + echo << + var rowtypedata = [ + [[1, '', 'td25'], [1,'', 'td25'], [1, ''], [1, ''], [4, '']], + ]; + +EOT; + + } else { + + if($_GET['delete']) { + C::t('common_nav')->delete_by_navtype_id(4, $_GET['delete']); + } + + if(is_array($_GET['namenew'])) { + foreach($_GET['namenew'] as $id => $name) { + $name = trim(dhtmlspecialchars($name)); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'][$id])); + $availablenew[$id] = $name && (!isset($_GET['urlnew'][$id]) || $_GET['urlnew'][$id]) && $_GET['availablenew'][$id]; + $displayordernew[$id] = intval($_GET['displayordernew'][$id]); + $data = array( + 'displayorder' => $displayordernew[$id], + 'available' => $availablenew[$id] + ); + if(!empty($_GET['urlnew'][$id])) { + $data['url'] = $urlnew; + } + if(!empty($name)) { + $data['name'] = $name; + } + if(isset($_GET['subtypenew'][$id])) { + $data['subtype'] = intval($_GET['subtypenew'][$id]); + } + C::t('common_nav')->update($id, $data); + } + } + + if(is_array($_GET['newname'])) { + foreach($_GET['newname'] as $k => $v) { + $v = dhtmlspecialchars(trim($v)); + if(!empty($v)) { + $newavailable = $v && $_GET['newurl'][$k]; + $newdisplayorder[$k] = intval($_GET['newdisplayorder'][$k]); + $subtype = isset($_GET['newsubtype'][$k]) ? intval($_GET['newsubtype'][$k]) : 0; + $newurl[$k] = str_replace('&', '&', dhtmlspecialchars($_GET['newurl'][$k])); + $data = array( + 'name' => $v, + 'displayorder' => $newdisplayorder[$k], + 'subtype' => $subtype, + 'url' => $newurl[$k], + 'type' => 1, + 'available' => $newavailable, + 'navtype' => 4 + ); + C::t('common_nav')->insert($data); + } + } + } + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=topnav', 'succeed'); + + } + + } elseif($do == 'edit' && ($id = $_GET['id'])) { + + $nav = C::t('common_nav')->fetch_by_id_navtype($id, 4); + if(!$nav) { + cpmsg('nav_not_found', '', 'error'); + } + + if(!submitcheck('editsubmit')) { + + $string = sprintf('%02d', $nav['highlight']); + + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader("nav&operation=topnav&do=edit&id=$id"); + showtableheader(); + showtitle(cplang('nav_nav_topnav').' - '.$nav['name']); + showsetting('misc_customnav_name', 'namenew', $nav['name'], 'text'); + showsetting('setting_styles_global_topnavtype', array('subtypenew', array( + array(0, cplang('setting_styles_global_topnavtype_0')), + array(1, cplang('setting_styles_global_topnavtype_1')), + )), $nav['subtype'], 'select'); + showsetting('misc_customnav_title', 'titlenew', $nav['title'], 'text'); + showsetting('misc_customnav_url', 'urlnew', $nav['url'], 'text', $nav['type'] == '0'); + showsetting('misc_customnav_style', array('stylenew', array(cplang('misc_customnav_style_underline'), cplang('misc_customnav_style_italic'), cplang('misc_customnav_style_bold'))), $string[0], 'binmcheckbox'); + showsetting('misc_customnav_style_color', array('colornew', array( + array(0, 'Default'), + array(1, 'Red'), + array(2, 'Orange'), + array(3, 'Yellow'), + array(4, 'Green'), + array(5, 'Cyan'), + array(6, 'Blue'), + array(7, 'Purple'), + array(8, 'Gray'), + )), $string[1], 'mradio2'); + showsetting('misc_customnav_url_open', array('targetnew', array( + array(0, cplang('misc_customnav_url_open_default')), + array(1, cplang('misc_customnav_url_open_blank')) + ), TRUE), $nav['target'], 'mradio'); + if($nav['type']) { + showsetting('misc_customnav_level', array('levelnew', array( + array(0, cplang('nolimit')), + array(1, cplang('member')), + array(2, cplang('usergroups_system_3')), + array(3, cplang('usergroups_system_1')), + )), $nav['level'], 'select'); + } + showtagfooter('tbody'); + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $namenew = trim(dhtmlspecialchars($_GET['namenew'])); + $titlenew = trim(dhtmlspecialchars($_GET['titlenew'])); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'])); + $colornew = $_GET['colornew']; + $subtypenew = $_GET['subtypenew']; + $stylebin = ''; + for($i = 3; $i >= 1; $i--) { + $stylebin .= empty($_GET['stylenew'][$i]) ? '0' : '1'; + } + $stylenew = bindec($stylebin); + $targetnew = intval($_GET['targetnew']) ? 1 : 0; + $levelnew = $nav['type'] ? (intval($_GET['levelnew']) && $_GET['levelnew'] > 0 && $_GET['levelnew'] < 4 ? intval($_GET['levelnew']) : 0) : 0; + $urladd = $nav['type'] != '0' && $urlnew ? ", url='".$urlnew."'" : ''; + + $data = array( + 'name' => $namenew, + 'title' => $titlenew, + 'highlight' => "$stylenew$colornew", + 'target' => $targetnew, + 'level' => $levelnew, + 'subtype' => $subtypenew + ); + if($nav['type'] != '0' && $urlnew) { + $data['url'] = $urlnew; + } + C::t('common_nav')->update($id, $data); + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=topnav', 'succeed'); + + } + + } + +} elseif ($operation == 'mfindnav') { + + if (!$do) { + + if (!submitcheck('submit')) { + + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader('nav&operation=mfindnav'); + showtableheader(); + showsubtitle(array('', 'display_order', 'name', 'url', 'type', 'available', '')); + + $navlist = array(); + foreach (C::t('common_nav')->fetch_all_by_navtype(5) as $nav) { + $navlist[$nav['id']] = $nav; + } + + foreach ($navlist as $nav) { + showtablerow('', array('class="td25"', 'class="td25"', '', ''), array( + in_array($nav['type'], array('2', '1')) ? "" : '', + "", + "
    ", + $nav['type'] == '0' ? $nav['url'] : "", + cplang($nav['type'] == '0' ? 'inbuilt' : ($nav['type'] == '3' ? 'nav_plugin' : ($nav['type'] == '4' ? 'channel' : 'custom'))), + "", + "{$lang['edit']}" + )); + } + echo ''; + showsubmit('submit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + + echo << + var rowtypedata = [ + [[1, '', 'td25'], [1,'', 'td25'], [1, ''], [4, '']], + ]; + +EOT; + + } else { + + if ($ids = dimplode($_GET['delete'])) { + C::t('common_nav')->delete_by_navtype_id(5, $_GET['delete']); + } + + if (is_array($_GET['namenew'])) { + foreach ($_GET['namenew'] as $id => $name) { + $name = trim(dhtmlspecialchars($name)); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'][$id])); + $availablenew[$id] = $name && (!isset($_GET['urlnew'][$id]) || $_GET['urlnew'][$id]) && $_GET['availablenew'][$id]; + $displayordernew[$id] = intval($_GET['displayordernew'][$id]); + $data = array( + 'displayorder' => $displayordernew[$id], + 'available' => $availablenew[$id], + ); + if (!empty($_GET['urlnew'][$id])) { + $data['url'] = $urlnew; + } + if (!empty($name)) { + $data['name'] = $name; + } + C::t('common_nav')->update($id, $data); + } + } + + if (is_array($_GET['newname'])) { + foreach ($_GET['newname'] as $k => $v) { + $v = dhtmlspecialchars(trim($v)); + if (!empty($v)) { + $newavailable = $v && $_GET['newurl'][$k]; + $newdisplayorder[$k] = intval($_GET['newdisplayorder'][$k]); + $newurl[$k] = str_replace('&', '&', dhtmlspecialchars($_GET['newurl'][$k])); + $data = array( + 'name' => $v, + 'displayorder' => $newdisplayorder[$k], + 'url' => $newurl[$k], + 'type' => 1, + 'available' => $newavailable, + 'navtype' => 5 + ); + C::t('common_nav')->insert($data); + } + } + } + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=mfindnav', 'succeed'); + + } + + } elseif ($do == 'edit' && ($id = $_GET['id'])) { + + $nav = C::t('common_nav')->fetch_by_id_navtype($id, 5); + if (!$nav) { + cpmsg('nav_not_found', '', 'error'); + } + + if (!submitcheck('editsubmit')) { + + shownav('style', 'nav_setting_customnav'); + showsubmenu('nav_setting_customnav', $navdata); + + showformheader("nav&operation=mfindnav&do=edit&id=$id"); + showtableheader(); + showtitle(cplang('nav_nav_mfindnav') . ' - ' . $nav['name']); + showsetting('misc_customnav_name', 'namenew', $nav['name'], 'text'); + showsetting('misc_customnav_url', 'urlnew', $nav['url'], 'text', $nav['type'] == '0'); + if ($nav['type']) { + showsetting('misc_customnav_level', array('levelnew', array( + array(0, cplang('nolimit')), + array(1, cplang('member')), + array(2, cplang('usergroups_system_3')), + array(3, cplang('usergroups_system_1')), + )), $nav['level'], 'select'); + } + showtagfooter('tbody'); + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $namenew = trim(dhtmlspecialchars($_GET['namenew'])); + $urlnew = str_replace(array('&'), array('&'), dhtmlspecialchars($_GET['urlnew'])); + $levelnew = $nav['type'] ? (intval($_GET['levelnew']) && $_GET['levelnew'] > 0 && $_GET['levelnew'] < 4 ? intval($_GET['levelnew']) : 0) : 0; + + $data = array( + 'name' => $namenew, + 'level' => $levelnew + ); + if ($nav['type'] != '0' && $urlnew) { + $data['url'] = $urlnew; + } + C::t('common_nav')->update($id, $data); + + updatecache('setting'); + cpmsg('nav_add_succeed', 'action=nav&operation=mfindnav', 'succeed'); + + } + + } + +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_optimizer.php b/source/admincp/admincp_optimizer.php new file mode 100644 index 0000000..1df8c8c --- /dev/null +++ b/source/admincp/admincp_optimizer.php @@ -0,0 +1,329 @@ +optimizer(); + +} elseif($operation == 'check_unit') { + + $checkstatus = $optimizer->check(); + + C::t('common_optimizer')->update_optimizer($type.'_checkrecord', ($checkstatus['status'] == 1 ? $checkstatus['status'] : 0)); + C::t('common_optimizer')->update_optimizer($check_record_time_key, $_G['timestamp']); + + include template('common/header_ajax'); + echo ''; + include template('common/footer_ajax'); + exit; + +} elseif($operation == 'setting_optimizer') { + + if(submitcheck('setting_optimizer', 1)) { + $setting_options = $_GET['options']; + if($optimizer->option_optimizer($setting_options)) { + cpmsg('founder_optimizer_setting_succeed', 'action=optimizer&operation=setting_optimizer&type=optimizer_setting', 'succeed'); + } else { + cpmsg('founder_optimizer_setting_error', '', 'error'); + } + } else { + + showformheader('optimizer&operation=setting_optimizer&type=optimizer_setting'); + showtableheader(); + + $option = $optimizer->get_option(); + + echo ''; + echo ''; + echo ''.$lang['founder_optimizer_setting_option'].''; + echo ''.$lang['founder_optimizer_setting_option_description'].''; + echo ''.$lang['founder_optimizer_setting_description'].''; + echo ''; + foreach($option as $setting) { + $color = ' style="'.($setting[4] ? 'color:red;' : 'color:green').'"'; + echo ''; + echo ''; + echo ''.$setting[1].''; + echo ''.$setting[2].''; + echo ''.$setting[3].''; + echo ''; + } + showsubmit('setting_optimizer'); + + showtablefooter(); + showformfooter(); + } + + +} else { + + $checkrecordtime = C::t('common_optimizer')->fetch_optimizer($check_record_time_key); + + if(!$_GET['checking']) { + showtips('optimizer_'.$_GET['anchor'].'_tips'); + } + + showboxheader(); + + echo ''; + if($_GET['checking']) { + echo '
    '; + echo '
    '; + echo '
    0%
    '; + echo '
    '; + } + echo '
    '; + if(!$checkrecordtime) { + echo $lang['founder_optimizer_first_use']; + } else { + $num = 0; + $checkrecordkey = array(); + foreach($optimizer_option as $option) { + $checkrecordkey[] = $option.'_checkrecord'; + } + foreach(C::t('common_optimizer')->fetch_all($checkrecordkey) as $checkrecordvalue) { + if($checkrecordvalue['v'] == 1) { + $num++; + } + } + if(!$_GET['checking']) { + echo $lang['founder_optimizer_lastcheck'].dgmdate($checkrecordtime).$lang['founder_optimizer_findnum'].$num.$lang['founder_optimizer_neednum']; + } + } + echo '
    '; + echo '
    '; + if($_GET['checking']) { + $inc_unit = ceil(100/count($optimizer_option)); + $adminscipt = ADMINSCRIPT; + $C = '$C'; + print << + var checkpercent = 0; + var checknum = 0; + var optimize_num = 0; + var security_num = 0; + var tip_num = 0; + var securitygrade = ''; + function updatecheckpercent() { + checkpercent += {$inc_unit}; + checknum++; + $('percent').innerHTML = parseInt(checkpercent) + '%'; + $('percentprocess').style.width = parseInt(checkpercent) * 2 + 'px'; + } + function updatecheckstatus(id, msg, status, type, extraurl) { + var optimize_table = $('optimizerable'); + var optimize_tablerows = optimize_table.rows.length; + var security_table = $('securityoption'); + var security_tablerows = security_table.rows.length; + var tip_table = $('tipoption'); + var tip_tablerows = tip_table.rows.length; + + if(id == 'optimizer_upgrade' || id == 'optimizer_patch') { + securitygrade = '{$lang['founder_optimizer_low']}'; + } + + var optiontype = id; + id = 'progress_' + id; + $(id + '_tr').style.display = 'none'; + var color = 'green'; + if(status == 1) { + color = 'red'; + optimize_num++; + $('optimizerablenum').innerHTML = optimize_num; + optimize_table.style.display = 'block'; + var newtr = optimize_table.insertRow(optimize_tablerows); + newtr.className = 'ooclass'; + } else if(status == 2) { + color = 'blue'; + tip_num++; + $('tipoptionnum').innerHTML = tip_num; + tip_table.style.display = 'block'; + var newtr = tip_table.insertRow(tip_tablerows); + newtr.className = 'toclass'; + newtr.style.display = 'none'; + } else { + color = 'green'; + security_num++; + $('securityoptionnum').innerHTML = security_num; + security_table.style.display = 'block'; + var newtr = security_table.insertRow(security_tablerows); + newtr.className = 'soclass'; + newtr.style.display = 'none'; + } + var statusstr = ''; + if(status != 0) { + if(type == 'header') { + statusstr = '{$lang['founder_optimizer_optimizer']}'; + } else if(type == 'view') { + statusstr = '{$lang['founder_optimizer_view']}'; + } else if(type == 'scan') { + statusstr = '{$lang['founder_optimizer_scan']}'; + } + } + newtr.insertCell(0).innerHTML = $(id + '_unit').innerHTML; + newtr.insertCell(1).innerHTML = msg; + newtr.insertCell(2).innerHTML = statusstr; + + if(parseInt(checkpercent) >= 100) { + $('checking').innerHTML = '{$lang['founder_optimizer_recheck_js']}'; + $('checking').href = '{$adminscipt}?action=optimizer&checking=1&anchor={$_GET['anchor']}'; + $('processid').style.display = 'none'; + if('{$_GET['anchor']}' == 'security') { + if(securitygrade == '') { + if(optimize_num <= 1) { + securitygrade = '{$lang['founder_optimizer_high']}'; + } else if(optimize_num >=2 && optimize_num <=4) { + securitygrade = '{$lang['founder_optimizer_middle']}'; + } else { + securitygrade = '{$lang['founder_optimizer_low']}'; + } + } + $('checkstatus').innerHTML = '{$lang['founder_optimizer_check_complete_js']}' + checknum + '{$lang['founder_optimizer_findnum']}' + optimize_num + '{$lang['founder_optimizer_neednum']}' + ' {$lang['founder_optimizer_level']}: ' + securitygrade + ''; + } else { + $('checkstatus').innerHTML = '{$lang['founder_optimizer_check_complete_js']}' + checknum + '{$lang['founder_optimizer_findnum']}' + optimize_num + '{$lang['founder_optimizer_neednum']}'; + } + } + } + function showoptions(obj, option) { + var o = $C(option); + var isopen = 0; + if(obj.innerHTML == '[-]') { + isoepn = 0; + obj.innerHTML = '[+]'; + } else { + isopen = 1; + obj.innerHTML = '[-]'; + } + for(var i=0; i +END; + echo ''; + foreach($optimizer_option as $option) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + echo '
    '.$lang['optimizer_check_unit_'.$option].'
    '.$lang['founder_optimizer_checking'].'...
    '; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + + showboxfooter(); +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_perm.php b/source/admincp/admincp_perm.php new file mode 100644 index 0000000..77d7f4d --- /dev/null +++ b/source/admincp/admincp_perm.php @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/source/admincp/admincp_pic.php b/source/admincp/admincp_pic.php new file mode 100644 index 0000000..45d9b00 --- /dev/null +++ b/source/admincp/admincp_pic.php @@ -0,0 +1,252 @@ + + +EOT; + showtagheader('div', 'searchposts', !$searchsubmit && empty($newlist)); + showformheader("pic".(!empty($_GET['search']) ? '&search=true' : ''), '', 'picforum'); + showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); + showtableheader(); + showsetting('pic_search_detail', 'detail', $detail, 'radio'); + showsetting('pic_search_perpage', '', $_GET['perpage'], ""); + showsetting('resultsort', '', $orderby, " "); + showsetting('', '', $ordersc, "", '', 0, '', '', '', true); + showsetting('pic_search_albumid', 'albumid', $albumid, 'text'); + showsetting('pic_search_user', 'users', $users, 'text'); + showsetting('pic_search_picid', 'picid', $picid, 'text'); + showsetting('pic_search_title', 'title', $title, 'text'); + showsetting('pic_search_ip', 'postip', $postip, 'text'); + showsetting('pic_search_hot', array('hot1', 'hot2'), array('', ''), 'range'); + showsetting('pic_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); + echo ''; + showsubmit('searchsubmit'); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + +} else { + $picids = authcode($picids, 'DECODE'); + $picidsadd = $picids ? explode(',', $picids) : $_GET['delete']; + include_once libfile('function/delete'); + $deletecount = count(deletepics($picidsadd)); + $cpmsg = cplang('pic_succeed', array('deletecount' => $deletecount)); + +?> + +'); + } + + if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { + if($endtime != '') { + $endtime = strtotime($endtime); + $sql .= ' AND p.'.DB::field('dateline', $endtime, '<'); + } + } else { + $endtime = TIMESTAMP; + } + + if($picid !='') { + $picids = '-1'; + $picidsarr = array('-1'); + $query = C::t('home_pic')->fetch_all(explode(',', str_replace(' ', '', $picid))); + foreach($query as $arr) { + $picids .=",{$arr['picid']}"; + $picidsarr[] = $arr['picid']; + } + $sql .= ' AND p.'.DB::field('picid', $picidsarr); + } + + if($albumid !='') { + $albumids = '-1'; + $albumidsarr = array('-1'); + $query = C::t('home_album')->fetch_all_album(explode(',', $albumid)); + foreach($query as $arr) { + $albumids .=",{$arr['albumid']}"; + $albumidsarr[] = $arr['albumid']; + } + $sql .= ' AND p.'.DB::field('albumid', $albumidsarr); + } + + if($users != '') { + $uids = '-1'; + $uidsarr = array('-1'); + $query = C::t('home_album')->fetch_uid_by_username(explode(',', $users)); + foreach($query as $arr) { + $uids .= ",{$arr['uid']}"; + $uidsarr[] = $arr['uid']; + } + $sql .= ' AND p.'.DB::field('uid', $uidsarr); + } + + if($postip != '') { + $sql .= ' AND p.'.DB::field('postip', str_replace('*', '%', $postip), 'like'); + } + + $sql .= $hot1 ? ' AND p.'.DB::field('hot', $hot1, '>=') : ''; + $sql .= $hot2 ? ' AND p.'.DB::field('hot', $hot2, '<=') : ''; + $sql .= $title ? ' AND p.'.DB::field('title', '%'.$title.'%', 'like') : ''; + $orderby = $orderby ? $orderby : 'dateline'; + $ordersc = $ordersc ? "$ordersc" : 'DESC'; + + if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { + $error = 'pic_mod_range_illegal'; + } + + if(!$error) { + if($detail) { + $_GET['perpage'] = intval($_GET['perpage']) < 1 ? 20 : intval($_GET['perpage']); + $perpage = $_GET['pp'] ? $_GET['pp'] : $_GET['perpage']; + $query = C::t('home_pic')->fetch_all_by_sql('1 '.$sql, 'p.'.DB::order($orderby, $ordersc), (($page - 1) * $perpage), $perpage); + $pics = ''; + + include_once libfile('function/home'); + foreach($query as $pic) { + $pic['dateline'] = dgmdate($pic['dateline']); + $pic['pic'] = pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote']); + $pic['albumname'] = empty($pic['albumname']) && empty($pic['albumid']) ? $lang['album_default'] : $pic['albumname']; + $pic['albumid'] = empty($pic['albumid']) ? -1 : $pic['albumid']; + $pics .= showtablerow('', '', array( + "", + "", + $pic['size'], + "{$pic['albumname']}", + "".$pic['username']."", + $pic['dateline'], "".$lang['pic_comment']."" + ), TRUE); + } + $piccount = C::t('home_pic')->fetch_all_by_sql('1 '.$sql, '', 0, 0, 1); + $multi = multi($piccount, $perpage, $page, ADMINSCRIPT."?action=pic$muticondition"); + } else { + $piccount = 0; + $query = C::t('home_pic')->fetch_all_by_sql('1 '.$sql, '', 0, 0, 0, 0); + foreach($query as $pic) { + $picids .= ','.$pic['picid']; + $piccount++; + } + $multi = ''; + } + + if(!$piccount) { + $error = 'pic_post_nonexistence'; + } + } + + showtagheader('div', 'postlist', $searchsubmit || $newlist); + showformheader('pic&frame=no', 'target="picframe"'); + showhiddenfields(array('picids' => authcode($picids, 'ENCODE'))); + if(!$muticondition) { + showtableheader(cplang('pic_new_result').' '.$piccount, 'fixpadding'); + } else { + showtableheader(cplang('pic_result').' '.$piccount.(empty($newlist) ? ' '.cplang('research').'' : ''), 'fixpadding'); + } + + if($error) { + echo "$lang[$error]"; + } else { + if($detail) { + showsubtitle(array('', 'albumpic', 'pic_size', 'albumname', 'author', 'time', 'pic_comment')); + echo $pics; + } + } + + showsubmit('picsubmit', 'delete', $detail ? 'del' : '', '', $multi); + showtablefooter(); + showformfooter(); + echo ''; + showtagfooter('div'); + +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_plugins.php b/source/admincp/admincp_plugins.php new file mode 100644 index 0000000..1eb0213 --- /dev/null +++ b/source/admincp/admincp_plugins.php @@ -0,0 +1,1734 @@ +isfounder) { + cpmsg('noaccess_isfounder', '', 'error'); +} + +$pluginid = !empty($_GET['pluginid']) ? intval($_GET['pluginid']) : 0; +$anchor = !empty($_GET['anchor']) ? $_GET['anchor'] : ''; +$isplugindeveloper = isset($_G['config']['plugindeveloper']) && $_G['config']['plugindeveloper'] > 0; +if(!empty($_GET['dir']) && !ispluginkey($_GET['dir'])) { + unset($_GET['dir']); +} + +require_once libfile('function/plugin'); + +if(!$operation) { + + if(!submitcheck('submit')) { + + loadcache('plugin'); + $outputsubmit = false; + $plugins = $addonids = $pluginlist = array(); + $plugins = C::t('common_plugin')->fetch_all_data(); + if(empty($_G['cookie']['addoncheck_plugin'])) { + foreach($plugins as $plugin) { + $addonids[$plugin['pluginid']] = $plugin['identifier'].'.plugin'; + } + $checkresult = dunserialize(cloudaddons_upgradecheck($addonids)); + savecache('addoncheck_plugin', $checkresult); + dsetcookie('addoncheck_plugin', 1, 7200); + } else { + loadcache('addoncheck_plugin'); + $checkresult = $_G['cache']['addoncheck_plugin']; + } + $updatecount = 0; + $splitavailable = array(); + foreach($plugins as $plugin) { + $addonid = $plugin['identifier'].'.plugin'; + $updateinfo = $newver = $sysver = ''; + if(is_array($checkresult) && isset($checkresult[$addonid])) { + list(, $newver, $sysver) = explode(':', $checkresult[$addonid]); + } + if(!empty($sysver) && $sysver > $plugin['version']) { + $updateinfo = ''.$lang['plugins_find_newversion'].' '.$sysver.''; + } elseif(!empty($newver)) { + $updateinfo = ''.$lang['plugins_find_newversion'].' '.$newver.''; + } + $plugins[] = $plugin['identifier']; + $hookexists = FALSE; + $plugin['modules'] = dunserialize($plugin['modules']); + $submenuitem = array(); + if(isset($_G['cache']['plugin'][$plugin['identifier']])) { + $configexists = FALSE; + if(is_array($plugin['modules'])) { + foreach($plugin['modules'] as $k => $module) { + if (isset($module['type']) && $module['type'] == 3) { + if ($module['name'] == 'config') { + $configexists = TRUE; + } + break; + } + } + } + if (!$configexists) { + $submenuitem[] = ''.$lang['config'].''; + } + } + if(is_array($plugin['modules'])) { + foreach($plugin['modules'] as $k => $module) { + if (isset($module['type'])) { + if($module['type'] == 11) { + $hookorder = $module['displayorder']; + $hookexists = $k; + } + if($module['type'] == 3) { + $submenuitem[] = ''.$module['menu'].''; + } + if($module['type'] == 29) { + $submenuitem[] = ''.$module['menu'].''; + } + } + } + } + $outputsubmit = $hookexists !== FALSE && $plugin['available'] || $outputsubmit; + $hl = !empty($_GET['hl']) && $_GET['hl'] == $plugin['pluginid']; + $intro = $title = ''; + if($updateinfo) { + $updatecount++; + } + $order = $plugin['available'] ? 'open' : 'close'; + if($plugin['pluginid'] == $_GET['hl']) { + $order = 'hightlight'; + } else { + if($plugin['available']) { + if(empty($splitavailable[0])) { + if(!empty($splitavailable)) { + $title = '
    '; + } + $title .= '
    '.cplang('plugins_list_available').'
    '; + $splitavailable[0] = 1; + } + } else { + if(empty($splitavailable[1])) { + if(!empty($splitavailable)) { + $title = '
    '; + } + $title .= '
    '.cplang('plugins_list_unavailable').'
    '; + $splitavailable[1] = 1; + } + } + } + $pluginlist[$order][$plugin['pluginid']] = $title.'
    '.showboxrow('', array('class="dcol"', 'class="dcol d-1"', 'style="width:160px;text-align:right;"'), array( + '', + '

    '.dhtmlspecialchars($plugin['name']).' '.dhtmlspecialchars($plugin['version']).' ('.$plugin['identifier'].')'.($updateinfo ? ' '.$updateinfo.'' : ''). + ($plugin['description'] || $plugin['modules']['extra']['intro'] ? ''.cplang('plugins_home').'

    ' : ''). + '

    '.($plugin['copyright'] ? cplang('author').': '.dhtmlspecialchars($plugin['copyright']).' | ' : ''). + ''.$lang['plugins_visit'].'

    '. + '

    '.implode(' | ', $submenuitem).'

    ', + ($hookexists !== FALSE && $plugin['available'] ? $lang['display_order'].":

    " : ''). + (!$plugin['available'] ? "{$lang['enable']}  " : "{$lang['closed']}  "). + "{$lang['plugins_config_upgrade']}  ". + (!$plugin['modules']['system'] ? " dhtmlspecialchars($plugin['name'])))."');\">{$lang['plugins_config_uninstall']}  " : ''). + ($isplugindeveloper && !$plugin['modules']['system'] ? "{$lang['plugins_editlink']}  " : ''), + ), true).'
    '; + } + + shownav('plugin', 'plugins_list'); + showsubmenu('nav_plugins', array( + array('plugins_list', 'plugins', 1), + $isplugindeveloper ? array('plugins_add', 'plugins&operation=add', 0) : array(), + array('plugins_validator'.($updatecount ? '_new' : ''), 'plugins&operation=upgradecheck', 0), + array('cloudaddons_plugin_link', 'cloudaddons&frame=no&operation=plugins&from=more', 0, 1), + ), ''.$lang['plugins_question'].'', array('updatecount' => $updatecount)); + showformheader('plugins', 'class="pluginlist"'); + showboxheader('', 'psetting', '', 1); + + ksort($pluginlist); + $pluginlist = (array)$pluginlist['hightlight'] + (array)$pluginlist['open'] + (array)$pluginlist['close']; + echo implode('', $pluginlist); + showboxfooter(1); + + if(empty($_GET['system'])) { + $plugindir = DISCUZ_ROOT.'./source/plugin'; + $pluginsdir = dir($plugindir); + $newplugins = array(); + $newlist = ''; + while($entry = $pluginsdir->read()) { + if(!in_array($entry, array('.', '..')) && is_dir($plugindir.'/'.$entry) && !in_array($entry, $plugins)) { + $entrydir = DISCUZ_ROOT.'./source/plugin/'.$entry; + $d = dir($entrydir); + $filemtime = filemtime($entrydir); + $entrytitle = $entry; + $entryversion = $entrycopyright = $importtxt = ''; + $extra = currentlang(); + $extra = $extra ? '_'.$extra : ''; + if(file_exists($entrydir.'/discuz_plugin_'.$entry.$extra.'.xml')) { + $importtxt = @implode('', file($entrydir.'/discuz_plugin_'.$entry.$extra.'.xml')); + } elseif(file_exists($entrydir.'/discuz_plugin_'.$entry.'.xml')) { + $importtxt = @implode('', file($entrydir.'/discuz_plugin_'.$entry.'.xml')); + } + if($importtxt) { + $pluginarray = getimportdata('Discuz! Plugin', 0, 1); + if(!empty($pluginarray['plugin']['name'])) { + $entrytitle = dhtmlspecialchars($pluginarray['plugin']['name']); + $entryversion = dhtmlspecialchars($pluginarray['plugin']['version']); + $entrycopyright = dhtmlspecialchars($pluginarray['plugin']['copyright']); + } + $file = $entrydir.'/'.$f; + $newlist .= '
    '.showboxrow('', array('class="dcol"', 'class="dcol d-1"', ' class="dcol" style="width:160px;text-align:right;"'), array( + '', + '

    '.$entrytitle.' '.$entryversion.($filemtime > TIMESTAMP - 86400 ? ' New!' : '').' ('.$entry.')

    '. + '

    '.($entrycopyright ? cplang('author').': '.$entrycopyright.' | ' : ''). + ''.$lang['plugins_visit'].'

    ', + ''.$lang['plugins_config_install'].'' + ), true).'
    '; + } + } + } + if($newlist) { + showboxheader('', 'psetting', '', 1); + showboxtitle('plugins_list_new'); + echo $newlist; + showboxfooter(1); + } + } + + showtableheader(); + if($outputsubmit) { + showsubmit('submit', 'submit', '', ''.cplang('cloudaddons_plugin_link').''); + } else { + showsubmit('', '', '', ''.cplang('cloudaddons_plugin_link').''); + } + showtablefooter(); + showformfooter(); + + } else { + + foreach(C::t('common_plugin')->fetch_all_data(1) as $plugin) { + if(!empty($_GET['displayordernew'][$plugin['pluginid']])) { + $plugin['modules'] = dunserialize($plugin['modules']); + $k = array_keys($_GET['displayordernew'][$plugin['pluginid']]); + $v = array_values($_GET['displayordernew'][$plugin['pluginid']]); + foreach($plugin['modules'] as $key => $value) { + if(isset($value['type']) && in_array($value['type'], array(11, 28))) { + $plugin['modules'][$key]['displayorder'] = $v[0]; + } + } + C::t('common_plugin')->update($plugin['pluginid'], array('modules' => serialize($plugin['modules']))); + } + } + + updatecache(array('plugin', 'setting', 'styles')); + cleartemplatecache(); + + cpmsg('plugins_edit_succeed', 'action=plugins', 'succeed'); + + } + +} elseif(FORMHASH == $_GET['formhash'] && ($operation == 'enable' || $operation == 'disable')) { + + $conflictplugins = ''; + $plugin = C::t('common_plugin')->fetch($_GET['pluginid']); + if(!$plugin) { + cpmsg('plugin_not_found', '', 'error'); + } + $dir = substr($plugin['directory'], 0, -1); + $modules = dunserialize($plugin['modules']); + $file = DISCUZ_ROOT.'./source/plugin/'.$dir.'/discuz_plugin_'.$dir.($modules['extra']['installtype'] ? '_'.$modules['extra']['installtype'] : '').'.xml'; + if(!file_exists($file)) { + $pluginarray[$operation.'file'] = $modules['extra'][$operation.'file']; + $pluginarray['plugin']['version'] = $plugin['version']; + } else { + $importtxt = @implode('', file($file)); + $pluginarray = getimportdata('Discuz! Plugin'); + } + if(!empty($pluginarray[$operation.'file']) && preg_match('/^[\w\.]+$/', $pluginarray[$operation.'file'])) { + $filename = DISCUZ_ROOT.'./source/plugin/'.$dir.'/'.$pluginarray[$operation.'file']; + if(file_exists($filename)) { + @include $filename; + } + } + + $available = $operation == 'enable' ? 1 : 0; + if($operation == 'enable') { + + require_once libfile('cache/setting', 'function'); + list(,, $hookscript) = get_cachedata_setting_plugin($plugin['identifier']); + $exists = array(); + foreach($hookscript as $script => $modules) { + foreach($modules as $module => $data) { + foreach(array('funcs' => '', 'outputfuncs' => '_output', 'messagefuncs' => '_message') as $functype => $funcname) { + foreach($data[$functype] as $k => $funcs) { + $pluginids = array(); + foreach($funcs as $func) { + $pluginids[$func[0]] = $func[0]; + } + if(in_array($plugin['identifier'], $pluginids) && count($pluginids) > 1) { + unset($pluginids[$plugin['identifier']]); + foreach($pluginids as $pluginid) { + $exists[$pluginid][$k.$funcname] = $k.$funcname; + } + } + } + } + } + } + $addonid = $dir.'.plugin'; + $array = cloudaddons_getmd5($addonid); + $array = array(); + if(preg_match('/^[a-z0-9_\.]+$/i', $addonid) && file_exists(DISCUZ_ROOT.'./data/addonmd5/'.$addonid.'.xml')) { + require_once libfile('class/xml'); + $xml = implode('', @file(DISCUZ_ROOT.'./data/addonmd5/'.$addonid.'.xml')); + $array = xml2array($xml); + } else { + $array = false; + } + if(dfsockopen(cloudaddons_url('&from=s').'&mod=app&ac=vali'.'dator&ver=2&addonid='.$addonid.($array !== false ? '&rid='.$array['RevisionID'].'&sn='.$array['SN'].'&rd='.$array['RevisionDateline'] : ''), 0, '', '', false, CLOUDADDONS_DOWNLOAD_IP, 15) === '0') { + $available = 0; + } + if($exists) { + $plugins = array(); + foreach(C::t('common_plugin')->fetch_all_by_identifier(array_keys($exists)) as $plugin) { + $plugins[] = ''.$plugin['name'].':'. + ' '.cplang('plugins_conflict_view').''. + ' '.cplang('plugins_conflict_info').''. + ''; + } + $conflictplugins = '
    '.implode('
    ', $plugins).'
    '; + } + } + C::t('common_plugin')->update($_GET['pluginid'], array('available' => $available)); + updatecache(array('plugin', 'setting', 'styles')); + cleartemplatecache(); + updatemenu('plugin'); + if($operation == 'enable') { + if(!$conflictplugins) { + cpmsg('plugins_enable_succeed', 'action=plugins'.(!empty($_GET['system']) ? '&system=1' : ''), 'succeed'); + } else { + cpmsg('plugins_conflict', 'action=plugins'.(!empty($_GET['system']) ? '&system=1' : ''), 'succeed', array('plugins' => $conflictplugins)); + } + } else { + cpmsg('plugins_disable_succeed', 'action=plugins'.(!empty($_GET['system']) ? '&system=1' : ''), 'succeed'); + } + cpmsg('plugins_'.$operation.'_succeed', 'action=plugins'.(!empty($_GET['system']) ? '&system=1' : ''), 'succeed'); + +} elseif($operation == 'export' && $pluginid) { + + if(!$isplugindeveloper) { + cpmsg('undefined_action', '', 'error'); + } + + $plugin = C::t('common_plugin')->fetch($pluginid); + if(!$plugin) { + cpheader(); + cpmsg('plugin_not_found', '', 'error'); + } + + unset($plugin['pluginid']); + + $pluginarray = array(); + $pluginarray['plugin'] = $plugin; + $pluginarray['version'] = strip_tags($_G['setting']['version']); + + foreach(C::t('common_pluginvar')->fetch_all_by_pluginid($pluginid) as $var) { + unset($var['pluginvarid'], $var['pluginid']); + $pluginarray['var'][] = $var; + } + $modules = dunserialize($pluginarray['plugin']['modules']); + if($modules['extra']['langexists'] && file_exists($file = DISCUZ_ROOT.'./data/plugindata/'.$pluginarray['plugin']['identifier'].'.lang.php')) { + include $file; + if(!empty($scriptlang[$pluginarray['plugin']['identifier']])) { + $pluginarray['language']['scriptlang'] = $scriptlang[$pluginarray['plugin']['identifier']]; + } + if(!empty($templatelang[$pluginarray['plugin']['identifier']])) { + $pluginarray['language']['templatelang'] = $templatelang[$pluginarray['plugin']['identifier']]; + } + if(!empty($installlang[$pluginarray['plugin']['identifier']])) { + $pluginarray['language']['installlang'] = $installlang[$pluginarray['plugin']['identifier']]; + } + if(!empty($systemlang[$pluginarray['plugin']['identifier']])) { + $pluginarray['language']['systemlang'] = $systemlang[$pluginarray['plugin']['identifier']]; + } + } + unset($modules['extra']); + $pluginarray['plugin']['modules'] = serialize($modules); + $plugindir = DISCUZ_ROOT.'./source/plugin/'.$pluginarray['plugin']['directory']; + if(file_exists($plugindir.'/install.php')) { + $pluginarray['installfile'] = 'install.php'; + } + if(file_exists($plugindir.'/uninstall.php')) { + $pluginarray['uninstallfile'] = 'uninstall.php'; + } + if(file_exists($plugindir.'/upgrade.php')) { + $pluginarray['upgradefile'] = 'upgrade.php'; + } + if(file_exists($plugindir.'/check.php')) { + $pluginarray['checkfile'] = 'check.php'; + } + if(file_exists($plugindir.'/enable.php')) { + $pluginarray['enablefile'] = 'enable.php'; + } + if(file_exists($plugindir.'/disable.php')) { + $pluginarray['disablefile'] = 'disable.php'; + } + + exportdata('Discuz! Plugin', $plugin['identifier'], $pluginarray); + +} elseif($operation == 'import') { + + if(submitcheck('importsubmit') || isset($_GET['dir'])) { + if(!isset($_GET['installtype'])) { + cloudaddons_validator($_GET['dir'].'.plugin'); + $pdir = DISCUZ_ROOT.'./source/plugin/'.$_GET['dir']; + $d = dir($pdir); + $xmls = ''; + $count = 0; + $noextra = false; + $currentlang = currentlang(); + while($f = $d->read()) { + if(preg_match('/^discuz\_plugin_'.$_GET['dir'].'(\_\w+)?\.xml$/', $f, $a)) { + $extratxt = $extra = substr($a[1], 1); + if($extra) { + if($currentlang && $currentlang == $extra) { + dheader('location: '.ADMINSCRIPT.'?action=plugins&operation=import&dir='.$_GET['dir'].'&installtype='.rawurlencode($extra)); + } + } else { + $noextra = true; + } + $url = ADMINSCRIPT.'?action=plugins&operation=import&dir='.$_GET['dir'].'&installtype='.rawurlencode($extra); + $xmls .= '  '; + $count++; + } + } + if($count == 1 && $noextra) { + dheader('location: '.ADMINSCRIPT.'?action=plugins&operation=import&dir='.$_GET['dir'].'&installtype='); + } + $xmls .= '

    '; + echo '

    '.$lang['plugins_import_installtype_1'].' '.$_GET['dir'].' '.$lang['plugins_import_installtype_2'].' '.$count.' '.$lang['plugins_import_installtype_3'].'

    '.$xmls.'
    '; + exit; + } else { + $installtype = $_GET['installtype']; + $dir = $_GET['dir']; + $license = $_GET['license']; + $extra = $installtype ? '_'.$installtype : ''; + $importfile = DISCUZ_ROOT.'./source/plugin/'.$dir.'/discuz_plugin_'.$dir.$extra.'.xml'; + $importtxt = @implode('', file($importfile)); + $pluginarray = getimportdata('Discuz! Plugin'); + if(empty($license) && $pluginarray['license']) { + require_once libfile('function/discuzcode'); + $pluginarray['license'] = discuzcode(strip_tags($pluginarray['license']), 1, 0); + echo '

    '.$pluginarray['plugin']['name'].' '.$pluginarray['plugin']['version'].' '.$lang['plugins_import_license'].'

    '.$pluginarray['license'].'


    '. + '  '. + '
    '; + exit; + } + $addonid = $dir.'.plugin'; + $array = cloudaddons_getmd5($addonid); + if(cloudaddons_open('&mod=app&ac=validator&ver=2&addonid='.$addonid.($array !== false ? '&rid='.$array['RevisionID'].'&sn='.$array['SN'].'&rd='.$array['RevisionDateline'] : '')) === '0') { + cpmsg('c'.'lou'.'dad'.'dons'.'_genu'.'ine_m'.'essa'.'ge', '', 'error', array('addonid' => $addonid)); + } + } + + if(!ispluginkey($pluginarray['plugin']['identifier'])) { + cpmsg('plugins_edit_identifier_invalid', 'action=plugins', 'error'); + } + if(is_array($pluginarray['vars'])) { + foreach($pluginarray['vars'] as $config) { + if(!ispluginkey($config['variable'])) { + cpmsg('plugins_import_var_invalid', 'action=plugins', 'error'); + } + } + } + + $plugin = C::t('common_plugin')->fetch_by_identifier($pluginarray['plugin']['identifier']); + if($plugin) { + cpmsg('plugins_import_identifier_duplicated', 'action=plugins', 'error', array('plugin_name' => $plugin['name'])); + } + + if(!empty($pluginarray['checkfile']) && preg_match('/^[\w\.]+$/', $pluginarray['checkfile'])) { + $filename = DISCUZ_ROOT.'./source/plugin/'.$_GET['dir'].'/'.$pluginarray['checkfile']; + if(file_exists($filename)) { + loadcache('pluginlanguage_install'); + $installlang = $pluginarray['language']['installlang']; + @include $filename; + } + } + + if(empty($_GET['ignoreversion']) && !versioncompatible($pluginarray['version'])) { + if(isset($dir)) { + cpmsg('plugins_import_version_invalid_confirm', 'action=plugins&operation=import&ignoreversion=yes&dir='.$dir.'&installtype='.$installtype.'&license='.$license, 'form', array('cur_version' => $pluginarray['version'], 'set_version' => $_G['setting']['version']), '', true, ADMINSCRIPT.'?action=plugins'); + } else { + cpmsg('plugins_import_version_invalid', 'action=plugins', 'error', array('cur_version' => $pluginarray['version'], 'set_version' => $_G['setting']['version'])); + } + } + + $pluginid = plugininstall($pluginarray, $installtype); + + updatemenu('plugin'); + + if(!empty($dir) && !empty($pluginarray['installfile']) && preg_match('/^[\w\.]+$/', $pluginarray['installfile'])) { + dheader('location: '.ADMINSCRIPT.'?action=plugins&operation=plugininstall&dir='.$dir.'&installtype='.$installtype.'&pluginid='.$pluginid); + } + + cloudaddons_clear('plugin', $dir); + + if(!empty($dir)) { + cpmsg('plugins_install_succeed', 'action=plugins&hl='.$pluginid, 'succeed'); + } else { + cpmsg('plugins_import_succeed', 'action=plugins&hl='.$pluginid, 'succeed'); + } + + } + +} elseif($operation == 'plugininstall' || $operation == 'pluginupgrade') { + + $finish = FALSE; + $dir = $_GET['dir']; + $installtype = str_replace('/', '', $_GET['installtype']); + $extra = $installtype ? '_'.$installtype : ''; + $xmlfile = 'discuz_plugin_'.$dir.$extra.'.xml'; + $importfile = DISCUZ_ROOT.'./source/plugin/'.$dir.'/'.$xmlfile; + if(!file_exists($importfile)) { + cpmsg('plugin_file_error', '', 'error'); + } + $importtxt = @implode('', file($importfile)); + $pluginarray = getimportdata('Discuz! Plugin'); + if($operation == 'plugininstall') { + $filename = $pluginarray['installfile']; + } else { + $filename = $pluginarray['upgradefile']; + $toversion = $pluginarray['plugin']['version']; + } + loadcache('pluginlanguage_install'); + $installlang = $_G['cache']['pluginlanguage_install'][$dir]; + + if(!empty($filename) && preg_match('/^[\w\.]+$/', $filename)) { + $filename = DISCUZ_ROOT.'./source/plugin/'.$dir.'/'.$filename; + if(file_exists($filename)) { + @include_once $filename; + } else { + $finish = TRUE; + } + } else { + $finish = TRUE; + } + + if($finish) { + updatecache('setting'); + updatemenu('plugin'); + if($operation == 'plugininstall') { + cloudaddons_clear('plugin', $dir); + cpmsg('plugins_install_succeed', 'action=plugins&hl='.$_GET['pluginid'], 'succeed'); + } else { + cloudaddons_clear('plugin', $dir); + cpmsg('plugins_upgrade_succeed', "action=plugins", 'succeed', array('toversion' => $toversion)); + } + } + +} elseif($operation == 'upgrade') { + + $plugin = C::t('common_plugin')->fetch($pluginid); + $modules = dunserialize($plugin['modules']); + $dir = substr($plugin['directory'], 0, -1); + + if(!$_GET['confirmed']) { + cloudaddons_validator($dir.'.plugin'); + $file = DISCUZ_ROOT.'./source/plugin/'.$dir.'/discuz_plugin_'.$dir.($modules['extra']['installtype'] ? '_'.$modules['extra']['installtype'] : '').'.xml'; + $upgrade = false; + if(file_exists($file)) { + $importtxt = @implode('', file($file)); + $pluginarray = getimportdata('Discuz! Plugin'); + $newver = !empty($pluginarray['plugin']['version']) ? $pluginarray['plugin']['version'] : 0; + $upgrade = $newver > $plugin['version'] ? true : false; + } + $entrydir = DISCUZ_ROOT.'./source/plugin/'.$dir; + $upgradestr = ''; + if(file_exists($entrydir)) { + $d = dir($entrydir); + while($f = $d->read()) { + if(preg_match('/^discuz\_plugin\_'.$plugin['identifier'].'(\_\w+)?\.xml$/', $f, $a)) { + $extratxt = $extra = substr($a[1], 1); + if(preg_match('/^SC\_GBK$/i', $extra)) { + $extratxt = '简体中文版'; + } elseif(preg_match('/^SC\_UTF8$/i', $extra)) { + $extratxt = '简体中文UTF8版'; + } elseif(preg_match('/^TC\_BIG5$/i', $extra)) { + $extratxt = '繁體中文版'; + } elseif(preg_match('/^TC\_UTF8$/i', $extra)) { + $extratxt = '繁體中文UTF8版'; + } + if($modules['extra']['installtype'] == $extratxt) { + continue; + } + $importtxt = @implode('', file($entrydir.'/'.$f)); + $pluginarray = getimportdata('Discuz! Plugin'); + $newverother = !empty($pluginarray['plugin']['version']) ? $pluginarray['plugin']['version'] : 0; + $upgradestr .= $newverother > $plugin['version'] ? '   ' : ''; + } + } + } + if(!empty($pluginarray['checkfile']) && preg_match('/^[\w\.]+$/', $pluginarray['checkfile'])) { + $filename = DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/'.$pluginarray['checkfile']; + if(file_exists($filename)) { + loadcache('pluginlanguage_install'); + $installlang = $_G['cache']['pluginlanguage_install'][$plugin['identifier']]; + @include $filename; + } + } + + if($upgrade) { + + cpmsg('plugins_config_upgrade_confirm', 'action=plugins&operation=upgrade&pluginid='.$pluginid.'&confirm=yes', 'form', array('pluginname' => $plugin['name'], 'version' => $plugin['version'], 'toversion' => $newver)); + + } elseif($upgradestr) { + + echo '

    '.cplang('discuz_message').'

    '.cplang('plugins_config_upgrade_other', array('pluginname' => $plugin['name'], 'version' => $plugin['version'])).'


    '.$upgradestr. + '

    '; + + } else { + + $addonid = $plugin['identifier'].'.plugin'; + $checkresult = dunserialize(cloudaddons_upgradecheck(array($addonid))); + + if(is_array($checkresult) && isset($checkresult[$addonid])) { + list($return, $newver, $sysver) = explode(':', $checkresult[$addonid]); + } else { + $newver = $sysver = ''; + } + + cloudaddons_installlog($pluginarray['plugin']['identifier'].'.plugin'); + dsetcookie('addoncheck_plugin', '', -1); + + cloudaddons_clear('plugin', $dir); + + if(!empty($sysver) && $sysver > $plugin['version']) { + cpmsg('plugins_config_upgrade_new', '', 'succeed', array('newver' => $sysver, 'addonid' => $addonid)); + } elseif(!empty($newver)) { + cpmsg('plugins_config_upgrade_new', '', 'succeed', array('newver' => $newver, 'addonid' => $addonid)); + } else { + cpmsg('plugins_config_upgrade_missed', 'action=plugins', 'succeed'); + } + + } + + } else { + + $installtype = !isset($_GET['installtype']) ? $modules['extra']['installtype'] : (preg_match('/^\w+$/', $_GET['installtype']) ? $_GET['installtype'] : ''); + $importfile = DISCUZ_ROOT.'./source/plugin/'.$dir.'/discuz_plugin_'.$dir.($installtype ? '_'.$installtype : '').'.xml'; + if(!file_exists($importfile)) { + cpmsg('plugin_file_error', '', 'error'); + } + + cloudaddons_validator($dir.'.plugin'); + + $importtxt = @implode('', file($importfile)); + $pluginarray = getimportdata('Discuz! Plugin'); + + if(!ispluginkey($pluginarray['plugin']['identifier']) || $pluginarray['plugin']['identifier'] != $plugin['identifier']) { + cpmsg('plugins_edit_identifier_invalid', '', 'error'); + } + if(is_array($pluginarray['vars'])) { + foreach($pluginarray['vars'] as $config) { + if(!ispluginkey($config['variable'])) { + cpmsg('plugins_upgrade_var_invalid', '', 'error'); + } + } + } + + if(!empty($pluginarray['checkfile']) && preg_match('/^[\w\.]+$/', $pluginarray['checkfile'])) { + if(!empty($pluginarray['language'])) { + $installlang[$pluginarray['plugin']['identifier']] = $pluginarray['language']['installlang']; + } + $filename = DISCUZ_ROOT.'./source/plugin/'.$plugin['directory'].$pluginarray['checkfile']; + if(file_exists($filename)) { + loadcache('pluginlanguage_install'); + $installlang = $_G['cache']['pluginlanguage_install'][$plugin['identifier']]; + @include $filename; + } + } + + pluginupgrade($pluginarray, $installtype); + + if(!empty($plugin['directory']) && !empty($pluginarray['upgradefile']) && preg_match('/^[\w\.]+$/', $pluginarray['upgradefile'])) { + dheader('location: '.ADMINSCRIPT.'?action=plugins&operation=pluginupgrade&dir='.$dir.'&installtype='.$installtype.'&fromversion='.$plugin['version']); + } + $toversion = $pluginarray['plugin']['version']; + + cloudaddons_clear('plugin', $dir); + + cpmsg('plugins_upgrade_succeed', "action=plugins", 'succeed', array('toversion' => $toversion)); + + } + +} elseif($operation == 'config') { + + if(empty($pluginid) && !empty($do)) { + $pluginid = $do; + } + if($_GET['identifier']) { + $plugin = C::t('common_plugin')->fetch_by_identifier($_GET['identifier']); + } else { + $plugin = C::t('common_plugin')->fetch($pluginid); + } + if(!$plugin) { + cpmsg('plugin_not_found', '', 'error'); + } else { + $pluginid = $plugin['pluginid']; + } + + $plugin['modules'] = dunserialize($plugin['modules']); + + $pluginvars = array(); + foreach(C::t('common_pluginvar')->fetch_all_by_pluginid($pluginid) as $var) { + if(strexists($var['type'], '_')) { + continue; + } + $pluginvars[$var['variable']] = $var; + } + + if($pluginvars) { + $submenuitem[] = array('config', "plugins&operation=config&do=$pluginid", !$_GET['pmod']); + } + if(is_array($plugin['modules'])) { + foreach($plugin['modules'] as $module) { + if(isset($module['type']) && $module['type'] == 3) { + parse_str($module['param'], $param); + if(!$pluginvars && empty($_GET['pmod'])) { + $_GET['pmod'] = $module['name']; + if($param) { + foreach($param as $_k => $_v) { + $_GET[$_k] = $_v; + } + } + } + if($param) { + $m = true; + foreach($param as $_k => $_v) { + if(!isset($_GET[$_k]) || $_GET[$_k] != $_v) { + $m = false; + break; + } + } + } else { + $m = true; + } + $submenuitem[] = array($module['menu'], "plugins&operation=config&do=$pluginid&identifier={$plugin['identifier']}&pmod={$module['name']}".($module['param'] ? '&'.$module['param'] : ''), $_GET['pmod'] == $module['name'] && $m, !$_GET['pmod'] ? 1 : 0); + } + } + } + + if(empty($_GET['pmod'])) { + + if(!submitcheck('editsubmit')) { + $operation = ''; + shownav('plugin', $plugin['name']); + showsubmenuanchors($plugin['name'].' '.$plugin['version'].(!$plugin['available'] ? ' ('.$lang['plugins_unavailable'].')' : ''), $submenuitem); + + if($pluginvars) { + showformheader("plugins&operation=config&do=$pluginid"); + showtableheader(); + showtitle($lang['plugins_config']); + + $extra = array(); + foreach($pluginvars as $var) { + if(strexists($var['type'], '_')) { + continue; + } + $var['variable'] = 'varsnew['.$var['variable'].']'; + if($var['type'] == 'number') { + $var['type'] = 'text'; + } elseif($var['type'] == 'select') { + $var['type'] = "\n"; + $var['variable'] = $var['value'] = ''; + } elseif($var['type'] == 'selects') { + $var['value'] = dunserialize($var['value']); + $var['value'] = is_array($var['value']) ? $var['value'] : array($var['value']); + $var['type'] = "\n"; + $var['variable'] = $var['value'] = ''; + } elseif($var['type'] == 'date') { + $var['type'] = 'calendar'; + $extra['date'] = ''; + } elseif($var['type'] == 'datetime') { + $var['type'] = 'calendar'; + $var['extra'] = 1; + $extra['date'] = ''; + } elseif($var['type'] == 'forum') { + require_once libfile('function/forumlist'); + $var['type'] = ''; + $var['variable'] = $var['value'] = ''; + } elseif($var['type'] == 'forums') { + $var['description'] = ($var['description'] ? (isset($lang[$var['description']]) ? $lang[$var['description']] : $var['description'])."\n" : '').$lang['plugins_edit_vars_multiselect_comment']."\n".$var['comment']; + $var['value'] = dunserialize($var['value']); + $var['value'] = is_array($var['value']) ? $var['value'] : array(); + require_once libfile('function/forumlist'); + $var['type'] = ''; + foreach($var['value'] as $v) { + $var['type'] = str_replace(''; + } + $var['value'] = is_array($var['value']) ? $var['value'] : array($var['value']); + + $query = C::t('common_usergroup')->range_orderby_credit(); + $groupselect = array(); + foreach($query as $group) { + $group['type'] = $group['type'] == 'special' && $group['radminid'] ? 'specialadmin' : $group['type']; + $groupselect[$group['type']] .= ''; + } + $var['type'] .= ''.$groupselect['member'].''. + ($groupselect['special'] ? ''.$groupselect['special'].'' : ''). + ($groupselect['specialadmin'] ? ''.$groupselect['specialadmin'].'' : ''). + ''.$groupselect['system'].''; + $var['variable'] = $var['value'] = ''; + } elseif($var['type'] == 'extcredit') { + $var['type'] = ''; + $var['variable'] = $var['value'] = ''; + } + + showsetting(isset($lang[$var['title']]) ? $lang[$var['title']] : dhtmlspecialchars($var['title']), $var['variable'], $var['value'], $var['type'], '', 0, isset($lang[$var['description']]) ? $lang[$var['description']] : nl2br(dhtmlspecialchars($var['description'])), dhtmlspecialchars($var['extra']), '', true); + } + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + echo implode('', $extra); + } + + } else { + + if(is_array($_GET['varsnew'])) { + foreach($_GET['varsnew'] as $variable => $value) { + if(isset($pluginvars[$variable])) { + if($pluginvars[$variable]['type'] == 'number') { + $value = (float)$value; + } elseif(in_array($pluginvars[$variable]['type'], array('forums', 'groups', 'selects'))) { + $value = serialize($value); + } + $value = (string)$value; + C::t('common_pluginvar')->update_by_variable($pluginid, $variable, array('value' => $value)); + } + } + } + + updatecache(array('plugin', 'setting', 'styles')); + cleartemplatecache(); + cpmsg('plugins_setting_succeed', 'action=plugins&operation=config&do='.$pluginid.'&anchor='.$anchor, 'succeed'); + + } + + } else { + + $scriptlang[$plugin['identifier']] = lang('plugin/'.$plugin['identifier']); + $modfile = ''; + if(is_array($plugin['modules'])) { + foreach($plugin['modules'] as $module) { + if(isset($module['type']) && $module['type'] == 3 && $module['name'] == $_GET['pmod']) { + $plugin['directory'] .= (!empty($plugin['directory']) && substr($plugin['directory'], -1) != '/') ? '/' : ''; + $modfile = './source/plugin/'.$plugin['directory'].$module['name'].'.inc.php'; + break; + } + } + } + + if($modfile) { + shownav('plugin', $plugin['name']); + showsubmenu($plugin['name'].' '.$plugin['version'].(!$plugin['available'] ? ' ('.$lang['plugins_unavailable'].')' : ''), $submenuitem); + if(!@include(DISCUZ_ROOT.$modfile)) { + cpmsg('plugins_setting_module_nonexistence', '', 'error', array('modfile' => $modfile)); + } else { + exit(); + } + } else { + cpmsg('plugin_file_error', '', 'error'); + } + + } + +} elseif($operation == 'add') { + + if(!$isplugindeveloper) { + cpmsg('undefined_action', '', 'error'); + } + + if(!submitcheck('addsubmit')) { + shownav('plugin'); + showsubmenu('nav_plugins', array( + array('plugins_list', 'plugins', 0), + array('plugins_add', 'plugins&operation=add', 1), + array('cloudaddons_plugin_link', 'cloudaddons&frame=no&operation=plugins&from=more', 0, 1), + )); + showtips('plugins_add_tips'); + + showformheader("plugins&operation=add", '', 'configform'); + showtableheader(); + showsetting('plugins_edit_name', 'namenew', '', 'text'); + showsetting('plugins_edit_version', 'versionnew', '', 'text'); + showsetting('plugins_edit_copyright', 'copyrightnew', '', 'text'); + showsetting('plugins_edit_identifier', 'identifiernew', '', 'text'); + showsubmit('addsubmit'); + showtablefooter(); + showformfooter(); + } else { + $namenew = dhtmlspecialchars(trim($_GET['namenew'])); + $versionnew = strip_tags(trim($_GET['versionnew'])); + $identifiernew = trim($_GET['identifiernew']); + $copyrightnew = dhtmlspecialchars($_GET['copyrightnew']); + + if(!$namenew) { + cpmsg('plugins_edit_name_invalid', '', 'error'); + } else { + if(!ispluginkey($identifiernew) || C::t('common_plugin')->fetch_by_identifier($identifiernew)) { + cpmsg('plugins_edit_identifier_invalid', '', 'error'); + } + } + $data = array( + 'name' => $namenew, + 'version' => $versionnew, + 'identifier' => $identifiernew, + 'directory' => $identifiernew.'/', + 'available' => 0, + 'copyright' => $copyrightnew, + ); + $pluginid = C::t('common_plugin')->insert($data, true); + dmkdir(DISCUZ_ROOT.'./source/plugin/'.$identifiernew.'/'); + updatecache(array('plugin', 'setting', 'styles')); + cleartemplatecache(); + cpmsg('plugins_add_succeed', "action=plugins&operation=edit&pluginid=$pluginid", 'succeed'); + } + +} elseif($operation == 'edit') { + + if(!$isplugindeveloper) { + cpmsg('undefined_action', '', 'error'); + } + + if(empty($pluginid) ) { + $pluginlist = ''; + $highlight = getgpc('highlight'); + $highlight = !empty($highlight) ? dhtmlspecialchars($highlight, ENT_QUOTES) : ''; + cpmsg('plugins_nonexistence', 'action=plugins&operation=edit'.(!empty($highlight) ? "&highlight=$highlight" : ''), 'form', $pluginlist); + } else { + $condition = !empty($uid) ? "uid='$uid'" : "username='$username'"; + } + + $plugin = C::t('common_plugin')->fetch($pluginid); + if(!$plugin) { + cpmsg('plugin_not_found', '', 'error'); + } + + $plugin['modules'] = dunserialize($plugin['modules']); + + if($plugin['modules']['system']) { + cpmsg('plugin_donot_edit', '', 'error'); + } + + if(!submitcheck('editsubmit')) { + + $adminidselect = array($plugin['adminid'] => 'selected'); + + shownav('plugin'); + $anchor = in_array($_GET['anchor'], array('config', 'modules', 'vars')) ? $_GET['anchor'] : 'config'; + showsubmenuanchors($lang['plugins_edit'].' - '.$plugin['name'].($plugin['available'] ? cplang('plugins_edit_available') : ''), array( + array('plugins_list', 'plugins', 0, 1), + array('config', 'config', $anchor == 'config'), + array('plugins_config_module', 'modules', $anchor == 'modules'), + array('plugins_config_vars', 'vars', $anchor == 'vars'), + array('export', 'plugins&operation=export&pluginid='.$plugin['pluginid'], 0, 1), + )); + showtips('plugins_edit_tips'); + + showtagheader('div', 'config', $anchor == 'config'); + showformheader("plugins&operation=edit&type=common&pluginid=$pluginid", '', 'configform'); + showtableheader(); + showsetting('plugins_edit_name', 'namenew', $plugin['name'], 'text'); + showsetting('plugins_edit_version', 'versionnew', $plugin['version'], 'text'); + if(!$plugin['copyright']) { + showsetting('plugins_edit_copyright', 'copyrightnew', $plugin['copyright'], 'text'); + } + showsetting('plugins_edit_identifier', 'identifiernew', $plugin['identifier'], 'text'); + showsetting('plugins_edit_directory', 'directorynew', $plugin['directory'], 'text'); + showsetting('plugins_edit_description', 'descriptionnew', $plugin['description'], 'textarea'); + showsetting('plugins_edit_langexists', 'langexists', $plugin['modules']['extra']['langexists'], 'radio'); + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + + showtagheader('div', 'modules', $anchor == 'modules'); + showformheader("plugins&operation=edit&type=modules&pluginid=$pluginid", '', 'modulesform'); + showtableheader('plugins_edit_modules'); + showsubtitle(array('', 'plugins_edit_modules_type', 'plugins_edit_modules_name', 'plugins_edit_modules_menu', 'plugins_edit_modules_menu_url', 'plugins_edit_modules_adminid', 'display_order')); + + $moduleids = array(); + if(is_array($plugin['modules'])) { + foreach($plugin['modules'] as $moduleid => $module) { + if($moduleid === 'extra' || $moduleid === 'system' || !isset($module['type'])) { + continue; + } + $module = dhtmlspecialchars($module); + $adminidselect = array($module['adminid'] => 'selected'); + $includecheck = empty($val['include']) ? $lang['no'] : $lang['yes']; + + $typeselect = ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''; + showtablerow('', array('class="td25"', 'class="td28"'), array( + "", + "". + ' '.cplang('plugins_module_sample').'', + "", + "", + "", + "", + "" + )); + showtagheader('tbody', 'n_'.$moduleid); + showtablerow('class="noborder"', array('', 'colspan="6"'), array( + '', + '   '.$lang['plugins_edit_modules_navtitle'].': + '.$lang['plugins_edit_modules_navicon'].': + '.$lang['plugins_edit_modules_navsubname'].': + '.$lang['plugins_edit_modules_navsuburl'].': + ', + )); + showtagfooter('tbody'); + showtagheader('tbody', 'n2_'.$moduleid); + showtablerow('class="noborder"', array('', 'colspan="6"'), array( + '', + '   '.$lang['plugins_edit_modules_param'].':', + )); + showtagfooter('tbody'); + + $moduleids[] = $moduleid; + } + } + showtablerow('', array('class="td25"', 'class="td28"'), array( + cplang('add_new'), + '', + '', + '', + '', + '', + '', + )); + showtagheader('tbody', 'n_n'); + showtablerow('class="noborder"', array('', 'colspan="7"'), array( + '', + '   '.$lang['plugins_edit_modules_navtitle'].': + '.$lang['plugins_edit_modules_navicon'].': + '.$lang['plugins_edit_modules_navsubname'].': + '.$lang['plugins_edit_modules_navsuburl'].': + ', + )); + showtagfooter('tbody'); + showtagheader('tbody', 'n2_n'); + showtablerow('class="noborder"', array('', 'colspan="6"'), array( + '', + '   '.$lang['plugins_edit_modules_param'].':', + )); + showtagfooter('tbody'); + showsubmit('editsubmit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + $shideinit = ''; + foreach($moduleids as $moduleid) { + $shideinit .= 'shide($("s_'.$moduleid.'"), \''.$moduleid.'\');'; + } + echo ''; + + showtagheader('div', 'vars', $anchor == 'vars'); + showformheader("plugins&operation=edit&type=vars&pluginid=$pluginid", '', 'varsform'); + showtableheader('plugins_edit_vars'); + showsubtitle(array('', 'display_order', 'plugins_vars_title', 'plugins_vars_variable', 'plugins_vars_type', '')); + foreach(C::t('common_pluginvar')->fetch_all_by_pluginid($plugin['pluginid']) as $var) { + $var['type'] = $lang['plugins_edit_vars_type_'. $var['type']]; + $var['title'] .= isset($lang[$var['title']]) ? '
    '.$lang[$var['title']] : ''; + showtablerow('', array('class="td25"', 'class="td28"'), array( + "", + "", + $var['title'], + $var['variable'], + $var['type'], + "{$lang['detail']}" + )); + } + showtablerow('', array('class="td25"', 'class="td28"'), array( + cplang('add_new'), + '', + '', + '', + ''; + foreach(array('number', 'text', 'radio', 'textarea', 'select', 'selects', 'color', 'date', 'datetime', 'forum', 'forums', 'group', 'groups', 'extcredit', + 'forum_text', 'forum_textarea', 'forum_radio', 'forum_select', 'group_text', 'group_textarea', 'group_radio', 'group_select') as $type) { + $typeselect .= ''; + } + $typeselect .= ''; + + showformheader("plugins&operation=vars&pluginid=$pluginid&pluginvarid=$pluginvarid"); + showtableheader(); + showtitle($lang['plugins_edit_vars'].' - '.$pluginvar['title']); + showsetting('plugins_edit_vars_title', 'titlenew', $pluginvar['title'], 'text'); + showsetting('plugins_edit_vars_description', 'descriptionnew', $pluginvar['description'], 'textarea'); + showsetting('plugins_edit_vars_type', '', '', $typeselect); + showsetting('plugins_edit_vars_variable', 'variablenew', $pluginvar['variable'], 'text'); + showtagheader('tbody', 'extra', $pluginvar['type'] == 'select' || $pluginvar['type'] == 'selects'); + showsetting('plugins_edit_vars_extra', 'extranew', $pluginvar['extra'], 'textarea'); + showtagfooter('tbody'); + showsubmit('varsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $titlenew = cutstr(trim($_GET['titlenew']), 25); + $descriptionnew = cutstr(trim($_GET['descriptionnew']), 255); + $variablenew = trim($_GET['variablenew']); + $extranew = trim($_GET['extranew']); + + if(!$titlenew) { + cpmsg('plugins_edit_var_title_invalid', '', 'error'); + } elseif($variablenew != $pluginvar['variable']) { + if(!$variablenew || strlen($variablenew) > 40 || !ispluginkey($variablenew) || C::t('common_pluginvar')->check_variable($pluginid, $variablenew)) { + cpmsg('plugins_edit_vars_invalid', '', 'error'); + } + } + + C::t('common_pluginvar')->update_by_pluginvarid($pluginid, $pluginvarid, array( + 'title' => $titlenew, + 'description' => $descriptionnew, + 'type' => $_GET['typenew'], + 'variable' => $variablenew, + 'extra' => $extranew + )); + + updatecache(array('plugin', 'setting', 'styles')); + cleartemplatecache(); + cpmsg('plugins_edit_vars_succeed', "action=plugins&operation=edit&pluginid=$pluginid&anchor=vars", 'succeed'); + } + +} elseif($operation == 'upgradecheck') { + if(empty($_GET['identifier'])) { + $pluginarray = C::t('common_plugin')->fetch_all_data(); + } else { + $plugin = C::t('common_plugin')->fetch_by_identifier($_GET['identifier']); + $pluginarray = $plugin ? array($plugin) : array(); + } + $plugins = $errarray = $newarray = $nowarray = array(); + if(!$pluginarray) { + cpmsg('plugin_not_found', '', 'error'); + } else { + $addonids = array(); + foreach($pluginarray as $row) { + if(ispluginkey($row['identifier'])) { + $addonids[] = $row['identifier'].'.plugin'; + } + } + $checkresult = dunserialize(cloudaddons_upgradecheck($addonids)); + savecache('addoncheck_plugin', $checkresult); + foreach($pluginarray as $row) { + $addonid = $row['identifier'].'.plugin'; + if(is_array($checkresult) && isset($checkresult[$addonid])) { + list($return, $newver, $sysver) = explode(':', $checkresult[$addonid]); + $result[$row['identifier']]['result'] = $return; + if($sysver) { + if($sysver > $row['version']) { + $result[$row['identifier']]['result'] = 2; + $result[$row['identifier']]['newver'] = $sysver; + } else { + $result[$row['identifier']]['result'] = 1; + } + } elseif($newver) { + $result[$row['identifier']]['newver'] = $newver; + } + } + $plugins[$row['identifier']] = $row['name'].' '.$row['version']; + $modules = dunserialize($row['modules']); + + $file = DISCUZ_ROOT.'./source/plugin/'.$row['identifier'].'/discuz_plugin_'.$row['identifier'].($modules['extra']['installtype'] ? '_'.$modules['extra']['installtype'] : '').'.xml'; + $upgrade = false; + if(file_exists($file)) { + $importtxt = @implode('', file($file)); + $pluginarray = getimportdata('Discuz! Plugin', 0, 1); + $newver = !empty($pluginarray['plugin']['version']) ? $pluginarray['plugin']['version'] : 0; + if($newver > $row['version']) { + $upgrade = true; + $nowarray[] = ''.$plugins[$row['identifier']].' -> '.$newver.''; + } + } + if(!$upgrade) { + $entrydir = DISCUZ_ROOT.'./source/plugin/'.$row['identifier']; + $upgradestr = ''; + if(file_exists($entrydir)) { + $d = dir($entrydir); + while($f = $d->read()) { + if(preg_match('/^discuz\_plugin\_'.$row['identifier'].'(\_\w+)?\.xml$/', $f, $a)) { + $extratxt = $extra = substr($a[1], 1); + if(preg_match('/^SC\_GBK$/i', $extra)) { + $extratxt = '简体中文版'; + } elseif(preg_match('/^SC\_UTF8$/i', $extra)) { + $extratxt = '简体中文UTF8版'; + } elseif(preg_match('/^TC\_BIG5$/i', $extra)) { + $extratxt = '繁體中文版'; + } elseif(preg_match('/^TC\_UTF8$/i', $extra)) { + $extratxt = '繁體中文UTF8版'; + } + if($modules['extra']['installtype'] == $extratxt) { + continue; + } + $importtxt = @implode('', file($entrydir.'/'.$f)); + $pluginarray = getimportdata('Discuz! Plugin', 0, 1); + $newverother = !empty($pluginarray['plugin']['version']) ? $pluginarray['plugin']['version'] : 0; + if($newverother > $row['version']) { + $nowarray[] = ''.$plugins[$row['identifier']].' -> '.$newverother.($extra ? ' ('.$extratxt.')' : '').''; + } + } + } + } + } + } + } + foreach($result as $id => $row) { + if($row['result'] == 0) { + $errarray[] = ''.$plugins[$id].''; + } elseif($row['result'] == 2) { + $newarray[] = ''.$plugins[$id].($row['newver'] ? ' -> '.$row['newver'] : '').''; + } + } + if(!$nowarray && !$newarray && !$errarray) { + cpmsg('plugins_validator_noupdate', '', 'error'); + } else { + shownav('plugin'); + showsubmenu('nav_plugins', array( + array('plugins_list', 'plugins', 0), + $isplugindeveloper ? array('plugins_add', 'plugins&operation=add', 0) : array(), + array('plugins_validator', 'plugins&operation=upgradecheck', 1), + array('cloudaddons_plugin_link', 'cloudaddons&frame=no&operation=plugins&from=more', 0, 1), + ), ''.$lang['plugins_question'].''); + showboxheader('', '', '', 1); + if($nowarray) { + showboxtitle('plugins_validator_nowupgrade'); + foreach($nowarray as $row) { + showboxbody('hover', $row); + } + } + if($newarray) { + showboxtitle('plugins_validator_newversion'); + foreach($newarray as $row) { + showboxbody('hover', $row); + } + } + if($errarray) { + showboxtitle('plugins_validator_error'); + foreach($errarray as $row) { + showboxbody('hover', $row); + } + } + showboxfooter(1); + } +} elseif($operation == 'sample') { + $plugin = C::t('common_plugin')->fetch($pluginid); + if(!$plugin) { + cpmsg('plugin_not_found', '', 'error'); + } + $code = moduleample($_GET['typeid'], $_GET['module'], $plugin); + if(!$code) { + cpmsg('NO_OPERATION'); + } + dheader('Content-Disposition: attachment; filename='.$_GET['module'].$_GET['fn']); + dheader('Content-Type: application/octet-stream'); + ob_end_clean(); + echo $code; + define('FOOTERDISABLED' , 1); + exit(); +} + +function moduleample($typeid, $module, $plugin) { + $samples = array( + 1 => "", + 2 => "", + 3 => "", + 4 => "", + 5 => "", + 6 => ""); + $types = array(1 => 1, 5 => 1, 27 => 1, 23 => 1, 25 => 1, 24 => 1, 7 => 2, 17 => 2, 19 => 2, 14 => 2, 26 => 2, 21 => 2, 15 => 2, 16 => 2, 3 => 3, 11 => 4, 28 => 5, 12 => 6); + + $code = $samples[$types[$typeid]]; + $code = str_replace( + array( + '{DATE}', + '{PLUGINID}', + '{MODULE}', + '{MODULENAME}', + '{COPYRIGHT}', + ), + array( + dgmdate(TIMESTAMP, 'Y'), + $plugin['identifier'], + $module, + cplang('plugins_edit_modules_type_'.$typeid), + $plugin['copyright'], + ), $code); + return $code; +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_portalcategory.php b/source/admincp/admincp_portalcategory.php new file mode 100644 index 0000000..ebb0d84 --- /dev/null +++ b/source/admincp/admincp_portalcategory.php @@ -0,0 +1,1089 @@ +count()) { + updatecache('portalcategory'); + loadcache('portalcategory', true); + $portalcategory = $_G['cache']['portalcategory']; + } + if(!submitcheck('editsubmit')) { + + shownav('portal', 'portalcategory'); + showsubmenu('portalcategory', array( + array('list', 'portalcategory', 1) + )); + + $tdstyle = array('width="25"', 'width="80"', '', 'width="50"', 'width="65"', 'width="35"', 'width="35"', 'width="35"', 'width="215"', 'width="110"'); + showformheader('portalcategory'); + echo ''; + showtableheader('', '', 'id="portalcategory_header" style="min-width:900px;*width:900px;"'); + showsubtitle(array('', '', 'portalcategory_name', 'portalcategory_articles', 'portalcategory_allowpublish', 'portalcategory_allowcomment', 'portalcategory_is_closed', 'setindex', 'operation', 'portalcategory_article_op'), 'header tbm', $tdstyle); + showtablefooter(); + showtableheader('', '', 'id="portalcategorytable" style="min-width:900px;*width:900px;"'); + showsubtitle(array('', '', 'portalcategory_name', 'portalcategory_articles', 'portalcategory_allowpublish', 'portalcategory_allowcomment', 'portalcategory_is_closed', 'setindex', 'operation', 'portalcategory_article_op'), 'header', $tdstyle); + foreach ($portalcategory as $key=>$value) { + if($value['level'] == 0) { + echo showcategoryrow($key, 0, ''); + } + } + echo '  '; + showsubmit('editsubmit'); + showtablefooter(); + showformfooter(); + echo ''; + + $langs = array(); + $keys = array('portalcategory_addcategory', 'portalcategory_addsubcategory', 'portalcategory_addthirdcategory'); + foreach ($keys as $key) { + $langs[$key] = cplang($key); + } + echo << +SCRIPT; + + } else { + $cachearr = array('portalcategory'); + if($_POST['name']) { + $openarr = $closearr = array(); + foreach($_POST['name'] as $key=>$value) { + $sets = array(); + $value = trim($value); + if($portalcategory[$key] && $portalcategory[$key]['catname'] != $value) { + $sets['catname'] = $value; + } + if($portalcategory[$key] && $portalcategory[$key]['displayorder'] != $_POST['neworder'][$key]) { + $sets['displayorder'] = $_POST['neworder'][$key]; + } + if($sets) { + C::t('portal_category')->update($key, $sets); + C::t('common_diy_data')->update_diy('portal/list_'.$key, getdiydirectory($portalcategory[$key]['primaltplname']), array('name'=>$value)); + C::t('common_diy_data')->update_diy('portal/view_'.$key, getdiydirectory($portalcategory[$key]['articleprimaltplname']), array('name'=>$value)); + $cachearr[] = 'diytemplatename'; + } + } + } + + if($_GET['newsetindex']) { + C::t('common_setting')->update_setting('defaultindex', $portalcategory[$_GET['newsetindex']]['caturl']); + $cachearr[] = 'setting'; + } + include_once libfile('function/cache'); + updatecache($cachearr); + + cpmsg('portalcategory_update_succeed', 'action=portalcategory', 'succeed'); + } + +} elseif($operation == 'perm') { + + $catid = intval($_GET['catid']); + if(!submitcheck('permsubmit')) { + $category = C::t('portal_category')->fetch($catid); + shownav('portal', 'portalcategory'); + $upcat = $category['upid'] ? ' - '.$portalcategory[$category['upid']]['catname'].' ' : ''; + showsubmenu(''.cplang('portalcategory_perm_edit').''.$upcat.' - '.$category['catname']); + showtips('portalcategory_article_perm_tips'); + showformheader("portalcategory&operation=perm&catid=$catid"); + + showtableheader('', 'fixpadding'); + + $inherited_checked = !$category['notinheritedarticle'] ? 'checked' : ''; + if($portalcategory[$catid]['level'])showsubtitle(array('',''.cplang('portalcategory_inheritance'),'','')); + showsubtitle(array('', 'username', + '', + '', + 'block_perm_inherited' + )); + + $line = '−'; + $permissions = C::t('portal_category_permission')->fetch_all_by_catid($catid); + $members = C::t('common_member')->fetch_all(array_keys($permissions)); + foreach($permissions as $uid => $value) { + $value = array_merge($value, $members[$uid]); + if(!empty($value['inheritedcatid'])) { + showtablerow('', array('class="td25"'), array( + "", + "{$value['username']}", + $value['allowpublish'] ? '√' : $line, + $value['allowmanage'] ? '√' : $line, + ''.$portalcategory[$value['inheritedcatid']]['catname'].'', + )); + } else { + showtablerow('', array('class="td25"'), array( + " + + ", + "{$value['username']}", + "', + "', + $line, + )); + } + } + showtablerow('', array('class="td25"'), array( + cplang('add_new'), + '', + '', + '', + '', + )); + + showsubmit('permsubmit', 'submit', 'del'); + showtablefooter(); + showformfooter(); + } else { + + $users = array(); + if(is_array($_GET['perm'])) { + foreach($_GET['perm'] as $uid => $value) { + if(empty($_GET['delete']) || !in_array($uid, $_GET['delete'])) { + $user = array(); + $user['allowpublish'] = $_GET['allowpublish'][$uid] ? 1 : 0; + $user['allowmanage'] = $_GET['allowmanage'][$uid] ? 1 : 0; + if($value['allowpublish'] != $user['allowpublish'] || $value['allowmanage'] != $user['allowmanage']) { + $user['uid'] = intval($uid); + $users[] = $user; + } + } + } + } + if(!empty($_GET['newuser'])) { + $newuid = C::t('common_member')->fetch_uid_by_username($_GET['newuser']); + if($newuid) { + $user['uid'] = $newuid; + $user['allowpublish'] = $_GET['newpublish'] ? 1 : 0; + $user['allowmanage'] = $_GET['newmanage'] ? 1 : 0; + $users[$user['uid']] = $user; + } else { + cpmsg_error($_GET['newuser'].cplang('portalcategory_has_no_allowauthorizedarticle')); + } + } + + require_once libfile('class/portalcategory'); + $categorypermsission = & portal_category::instance(); + if(!empty($users)) { + $categorypermsission->add_users_perm($catid, $users); + } + + if(!empty($_GET['delete'])) { + $categorypermsission->delete_users_perm($catid, $_GET['delete']); + } + + $notinherited = !$_POST['inherited'] ? '1' : '0'; + if($notinherited != $portalcategory[$catid]['notinheritedarticle']) { + if($notinherited) { + $categorypermsission->delete_inherited_perm_by_catid($catid, $portalcategory[$catid]['upid']); + } else { + $categorypermsission->remake_inherited_perm($catid); + } + C::t('portal_category')->update($catid, array('notinheritedarticle'=>$notinherited)); + } + + include_once libfile('function/cache'); + updatecache('portalcategory'); + + cpmsg('portalcategory_perm_update_succeed', "action=portalcategory&operation=perm&catid=$catid", 'succeed'); + } + +} elseif($operation == 'delete') { + + $_GET['catid'] = max(0, intval($_GET['catid'])); + if(!$_GET['catid'] || !$portalcategory[$_GET['catid']]) { + cpmsg('portalcategory_catgory_not_found', '', 'error'); + } + $catechildren = $portalcategory[$_GET['catid']]['children']; + include_once libfile('function/cache'); + if(!submitcheck('deletesubmit')) { + $article_count = C::t('portal_article_title')->fetch_count_for_cat($_GET['catid']); + if(!$article_count && empty($catechildren)) { + + if($portalcategory[$_GET['catid']]['foldername']) delportalcategoryfolder($_GET['catid']); + + deleteportalcategory($_GET['catid']); + updatecache(array('portalcategory','diytemplatename')); + cpmsg('portalcategory_delete_succeed', 'action=portalcategory', 'succeed'); + } + + shownav('portal', 'portalcategory'); + showsubmenu('portalcategory', array( + array('list', 'portalcategory', 0), + array('delete', 'portalcategory&operation=delete&catid='.$_GET['catid'], 1) + )); + + showformheader('portalcategory&operation=delete&catid='.$_GET['catid']); + showtableheader(); + if($portalcategory[$_GET['catid']]['children']) { + showsetting('portalcategory_subcategory_moveto', '', '', + '
    '. + ' '. + '   '. + ' 
    ' + ); + } + include_once libfile('function/portalcp'); + echo "".cplang('portalcategory_article').": + + +
      +
    •  ".cplang('portalcategory_article_moveto')."   ".category_showselect('portal', 'tocatid', false, $portalcategory[$_GET['catid']]['upid'])."
    • +
    •  ".cplang('portalcategory_article_delete')."
    • +
    + + "; + + showsubmit('deletesubmit', 'portalcategory_delete'); + showtablefooter(); + showformfooter(); + + } else { + + if($_POST['article_op'] == 'delete') { + if(!$_GET['confirmed']) { + cpmsg('portal_delete_confirm', "action=portalcategory&operation=delete&catid={$_GET['catid']}", 'form', array(), + ' + '); + } + } + + if($_POST['article_op'] == 'move') { + if($_POST['tocatid'] == $_GET['catid'] || empty($portalcategory[$_POST['tocatid']])) { + cpmsg('portalcategory_move_category_failed', 'action=portalcategory', 'error'); + } + } + + $delids = array($_GET['catid']); + $updatecategoryfile = array(); + if($catechildren) { + if($_POST['subcat_op'] == 'parent') { + $upid = intval($portalcategory[$_GET['catid']]['upid']); + if(!empty($portalcategory[$upid]['foldername']) || ($portalcategory[$_GET['catid']]['level'] == '0' && $portalcategory[$_GET['catid']]['foldername'])) { + $parentdir = DISCUZ_ROOT.'/'.getportalcategoryfulldir($upid); + foreach($catechildren as $subcatid) { + if($portalcategory[$subcatid]['foldername']) { + $olddir = DISCUZ_ROOT.'/'.getportalcategoryfulldir($subcatid); + rename($olddir, $parentdir.$portalcategory[$subcatid]['foldername']); + $updatecategoryfile[] = $subcatid; + } + } + } + C::t('portal_category')->update($catechildren, array('upid' => $upid)); + require_once libfile('class/blockpermission'); + require_once libfile('class/portalcategory'); + $tplpermission = & template_permission::instance(); + $tplpermission->delete_perm_by_inheritedtpl('portal/list_'.$_GET['catid']); + $categorypermission = & portal_category::instance(); + $categorypermission->delete_perm_by_inheritedcatid($_GET['catid']); + + } else { + $delids = array_merge($delids, $catechildren); + foreach ($catechildren as $id) { + $value = $portalcategory[$id]; + if($value['children']) { + $delids = array_merge($delids, $value['children']); + } + } + if($_POST['article_op'] == 'move') { + if(!$portalcategory[$_POST['tocatid']] || in_array($_POST['tocatid'], $delids)) { + cpmsg('portalcategory_move_category_failed', 'action=portalcategory', 'error'); + } + } + } + } + + if($delids) { + deleteportalcategory($delids); + if($_POST['article_op'] == 'delete') { + require_once libfile('function/delete'); + $aidarr = array(); + $query = C::t('portal_article_title')->fetch_all_for_cat($delids); + foreach($query as $value) { + $aidarr[] = $value['aid']; + } + if($aidarr) { + deletearticle($aidarr, '0'); + } + } else { + C::t('portal_article_title')->update_for_cat($delids, array('catid'=>$_POST['tocatid'])); + $num = C::t('portal_article_title')->fetch_count_for_cat($_POST['tocatid']); + C::t('portal_category')->update($_POST['tocatid'], array('articles'=>dintval($num))); + } + } + + if($portalcategory[$_GET['catid']]['foldername']) delportalcategoryfolder($_GET['catid']); + updatecache(array('portalcategory','diytemplatename')); + loadcache('portalcategory', true); + remakecategoryfile($updatecategoryfile); + cpmsg('portalcategory_delete_succeed', 'action=portalcategory', 'succeed'); + } + +} elseif($operation == 'move') { + $_GET['catid'] = intval($_GET['catid']); + if(!$_GET['catid'] || !$portalcategory[$_GET['catid']]) { + cpmsg('portalcategory_catgory_not_found', '', 'error'); + } + if(!submitcheck('movesubmit')) { + $article_count = C::t('portal_article_title')->fetch_count_for_cat($_GET['catid']); + if(!$article_count) { + cpmsg('portalcategory_move_empty_error', 'action=portalcategory', 'succeed'); + } + + shownav('portal', 'portalcategory'); + showsubmenu('portalcategory', array( + array('list', 'portalcategory', 0), + array('portalcategory_move', 'portalcategory&operation=move&catid='.$_GET['catid'], 1) + )); + + showformheader('portalcategory&operation=move&catid='.$_GET['catid']); + showtableheader(); + include_once libfile('function/portalcp'); + showsetting('portalcategory_article_moveto', '', '', category_showselect('portal', 'tocatid', false, $portalcategory[$_GET['catid']]['upid'])); + showsubmit('movesubmit', 'portalcategory_move'); + showtablefooter(); + showformfooter(); + + } else { + + if($_POST['tocatid'] == $_GET['catid'] || empty($portalcategory[$_POST['tocatid']])) { + cpmsg('portalcategory_move_category_failed', 'action=portalcategory', 'error'); + } + + C::t('portal_article_title')->update_for_cat($_GET['catid'], array('catid' => $_POST['tocatid'])); + C::t('portal_category')->update($_GET['catid'], array('articles'=>0)); + $num = C::t('portal_article_title')->fetch_count_for_cat($_POST['tocatid']); + C::t('portal_category')->update($_POST['tocatid'], array('articles'=>$num)); + updatecache('portalcategory'); + + cpmsg('portalcategory_move_succeed', 'action=portalcategory', 'succeed'); + } +} elseif($operation == 'edit' || $operation == 'add') { + $_GET['catid'] = intval($_GET['catid']); + $anchor = in_array($_GET['anchor'], array('basic', 'html')) ? $_GET['anchor'] : 'basic'; + + if($_GET['catid'] && !$portalcategory[$_GET['catid']]) { + cpmsg('portalcategory_catgory_not_found', '', 'error'); + } + + $cate = $_GET['catid'] ? $portalcategory[$_GET['catid']] : array(); + if($operation == 'add') { + $_GET['upid'] = intval($_GET['upid']); + if($_GET['upid']) { + $cate['level'] = $portalcategory[$_GET['upid']] ? $portalcategory[$_GET['upid']]['level']+1 : 0; + $cate['upid'] = intval($_GET['upid']); + } else { + $cate['level'] = 0; + $cate['upid'] = 0; + } + $cate['displayorder'] = 0; + $cate['closed'] = 1; + } + @include_once DISCUZ_ROOT.'./data/cache/cache_domain.php'; + $channeldomain = isset($rootdomain['channel']) && $rootdomain['channel'] ? $rootdomain['channel'] : array(); + + if(!submitcheck('detailsubmit')) { + shownav('portal', 'portalcategory'); + $url = 'portalcategory&operation='.$operation.($operation == 'add' ? '&upid='.$_GET['upid'] : '&catid='.$_GET['catid']); + showsubmenuanchors(cplang('portalcategory_detail').($cate['catname'] ? ' - '.$cate['catname'] : ''), array( + array('edit', 'basic', $anchor == 'basic'), + )); + + showtagheader('div', 'basic', $anchor == 'basic'); + showformheader($url); + showtableheader(); + $catemsg = ''; + if($cate['username']) $catemsg .= $lang['portalcategory_username'].' '.$cate['username']; + if($cate['dateline']) $catemsg .= ' '.$lang['portalcategory_dateline'].' '.dgmdate($cate['dateline'],'Y-m-d m:i:s'); + if($cate['upid']) $catemsg .= ' '.$lang['portalcategory_upname'].': '.$portalcategory[$cate['upid']]['catname'].''; + if($catemsg) showtitle($catemsg); + showsetting('portalcategory_catname', 'catname', html_entity_decode($cate['catname']), 'text'); + showsetting('display_order', 'displayorder', $cate['displayorder'], 'text'); + showsetting('portalcategory_foldername', 'foldername', $cate['foldername'], 'text'); + showsetting('portalcategory_url', 'url', $cate['url'], 'text'); + showsetting('portalcategory_perpage', 'perpage', $cate['perpage'] ? $cate['perpage'] : 15, 'text'); + showsetting('portalcategory_maxpages', 'maxpages', $cate['maxpages'] ? $cate['maxpages'] : 1000, 'text'); + + showportalprimaltemplate($cate['primaltplname'], 'list'); + showportalprimaltemplate($cate['articleprimaltplname'], 'view'); + + showsetting('portalcategory_allowpublish', 'allowpublish', $cate['disallowpublish'] ? 0 : 1, 'radio'); + showsetting('portalcategory_notshowarticlesummay', 'notshowarticlesummay', $cate['notshowarticlesummay'] ? 0 : 1, 'radio'); + showsetting('portalcategory_allowcomment', 'allowcomment', $cate['allowcomment'], 'radio'); + if($cate['level']) { + showsetting('portalcategory_inheritancearticle', 'inheritancearticle', !$cate['notinheritedarticle'] ? '1' : '0', 'radio'); + showsetting('portalcategory_inheritanceblock', 'inheritanceblock', !$cate['notinheritedblock'] ? '1' : '0', 'radio'); + } + showsetting('portalcategory_is_closed', 'closed', $cate['closed'] ? 0 : 1, 'radio'); + if($cate['level'] != 2) showsetting('portalcategory_shownav', 'shownav', $cate['shownav'], 'radio'); + $setindex = !empty($_G['setting']['defaultindex']) && $_G['setting']['defaultindex'] == $cate['caturl'] ? 1 : 0; + showsetting('setindex', 'setindex', $setindex, 'radio'); + if($cate['level'] == 0) { + if(!empty($_G['setting']['domain']['root']['channel'])) { + showsetting('forums_edit_extend_domain', '', '', $_G['scheme'].'://.'.$_G['setting']['domain']['root']['channel']); + } else { + showsetting('forums_edit_extend_domain', 'domain', '', 'text', 'disabled'); + } + } + showsetting('portalcategory_noantitheft', 'noantitheft', $cate['noantitheft'], 'radio'); + showtablefooter(); + showtips('setting_seo_portal_tips', 'tips', true, 'setseotips'); + showtableheader(); + showsetting('portalcategory_seotitle', 'seotitle', $cate['seotitle'], 'text'); + showsetting('portalcategory_keyword', 'keyword', $cate['keyword'], 'text'); + showsetting('portalcategory_summary', 'description', $cate['description'], 'textarea'); + showtablefooter(); + + showtableheader(); + showsubmit('detailsubmit'); + if($operation == 'add') showsetting('', '', '', ''); + showtablefooter(); + showformfooter(); + + } else { + require_once libfile('function/portalcp'); + $domain = $_GET['domain'] ? $_GET['domain'] : ''; + $_GET['closed'] = intval($_GET['closed']) ? 0 : 1; + $_GET['catname'] = trim($_GET['catname']); + $foldername = trim($_GET['foldername']); + $oldsetindex = !empty($_G['setting']['defaultindex']) && $_G['setting']['defaultindex'] == $cate['caturl'] ? 1 : 0; + $perpage = intval($_GET['perpage']); + $maxpages = intval($_GET['maxpages']); + $perpage = empty($perpage) ? 15 : $perpage; + $maxpages = empty($maxpages) ? 1000 : $maxpages; + + if($_GET['catid'] && !empty($cate['domain'])) { + require_once libfile('function/delete'); + deletedomain($_GET['catid'], 'channel'); + } + if(!empty($domain)) { + require_once libfile('function/domain'); + domaincheck($domain, $_G['setting']['domain']['root']['channel'], 1); + } + + $updatecategoryfile = array(); + + + $editcat = array( + 'catname' => $_GET['catname'], + 'allowcomment'=>$_GET['allowcomment'], + 'url' => $_GET['url'], + 'closed' => $_GET['closed'], + 'seotitle' => $_GET['seotitle'], + 'keyword' => $_GET['keyword'], + 'description' => $_GET['description'], + 'displayorder' => intval($_GET['displayorder']), + 'notinheritedarticle' => $_GET['inheritancearticle'] ? '0' : '1', + 'notinheritedblock' => $_GET['inheritanceblock'] ? '0' : '1', + 'disallowpublish' => $_GET['allowpublish'] ? '0' : '1', + 'notshowarticlesummay' => $_GET['notshowarticlesummay'] ? '0' : '1', + 'perpage' => $perpage, + 'maxpages' => $maxpages, + 'noantitheft' => intval($_GET['noantitheft']), + ); + + $dir = ''; + if(!empty($foldername)) { + $oldfoldername = empty($_GET['catid']) ? '' : $portalcategory[$_GET['catid']]['foldername']; + preg_match_all('/[^\w\d\_]/',$foldername,$re); + if(!empty($re[0])) { + cpmsg(cplang('portalcategory_foldername_rename_error').','.cplang('return'), NULL, 'error'); + } + $parentdir = getportalcategoryfulldir($cate['upid']); + if($parentdir === false) cpmsg(cplang('portalcategory_parentfoldername_empty').','.cplang('return'), NULL, 'error'); + if($foldername == $oldfoldername) { + $dir = $parentdir.$foldername; + } elseif(is_dir(DISCUZ_ROOT.'./'.$parentdir.$foldername)) { + cpmsg(cplang('portalcategory_foldername_duplicate').','.cplang('return'), NULL, 'error'); + } elseif ($portalcategory[$_GET['catid']]['foldername']) { + $r = rename(DISCUZ_ROOT.'./'.$parentdir.$portalcategory[$_GET['catid']]['foldername'], DISCUZ_ROOT.'./'.$parentdir.$foldername); + if($r) { + $updatecategoryfile[] = $_GET['catid']; + $editcat['foldername'] = $foldername; + } else { + cpmsg(cplang('portalcategory_foldername_rename_error').','.cplang('return'), NULL, 'error'); + } + } elseif (empty($portalcategory[$_GET['catid']]['foldername'])) { + $dir = $parentdir.$foldername; + $editcat['foldername'] = $foldername; + } + } elseif(empty($foldername) && $portalcategory[$_GET['catid']]['foldername']) { + delportalcategoryfolder($_GET['catid']); + $editcat['foldername'] = ''; + } + $primaltplname = $viewprimaltplname = ''; + if(!empty($_GET['listprimaltplname'])) { + $primaltplname = $_GET['listprimaltplname']; + if(!isset($_GET['signs']['list'][dsign($primaltplname)])) { + cpmsg(cplang('diy_sign_invalid').','.cplang('return'), NULL, 'error'); + } + $checktpl = checkprimaltpl($primaltplname); + if($checktpl !== true) { + cpmsg(cplang($checktpl).','.cplang('return'), NULL, 'error'); + } + } + + if(empty($_GET['viewprimaltplname'])) { + $_GET['viewprimaltplname'] = getparentviewprimaltplname($_GET['catid']); + } else if(!isset($_GET['signs']['view'][dsign($_GET['viewprimaltplname'])])) { + cpmsg(cplang('diy_sign_invalid').','.cplang('return'), NULL, 'error'); + } + $viewprimaltplname = strpos($_GET['viewprimaltplname'], ':') === false ? $_G['cache']['style_default']['tpldir'].':portal/'.$_GET['viewprimaltplname'] : $_GET['viewprimaltplname']; + $checktpl = checkprimaltpl($viewprimaltplname); + if($checktpl !== true) { + cpmsg(cplang($checktpl).','.cplang('return'), NULL, 'error'); + } + + $editcat['primaltplname'] = $primaltplname; + $editcat['articleprimaltplname'] = $viewprimaltplname; + + if($_GET['catid']) { + if($portalcategory[$_G['catid']]['level'] < 2) $editcat['shownav'] = intval($_GET['shownav']); + if($domain && $portalcategory[$_G['catid']]['level'] == 0) { + $editcat['domain'] = $domain; + } else { + $editcat['domain'] = ''; + } + } else { + if($portalcategory[$cate['upid']]) { + if($portalcategory[$cate['upid']]['level'] == 0) $editcat['shownav'] = intval($_GET['shownav']); + } else { + $editcat['shownav'] = intval($_GET['shownav']); + $editcat['domain'] = $domain; + } + } + $cachearr = array('portalcategory'); + if($_GET['catid']) { + C::t('portal_category')->update($cate['catid'], $editcat); + if($cate['catname'] != $_GET['catname']) { + C::t('common_diy_data')->update_diy('portal/list_'.$cate['catid'], getdiydirectory($cate['primaltplname']), array('name'=>$_GET['catname'])); + C::t('common_diy_data')->update_diy('portal/view_'.$cate['catid'], getdiydirectory($cate['articleprimaltplname']), array('name'=>$_GET['catname'])); + $cachearr[] = 'diytemplatename'; + } + } else { + $editcat['upid'] = $cate['upid']; + $editcat['dateline'] = TIMESTAMP; + $editcat['uid'] = $_G['uid']; + $editcat['username'] = $_G['username']; + $_GET['catid'] = C::t('portal_category')->insert($editcat, true); + $cachearr[] = 'diytemplatename'; + } + + if(!empty($domain)) { + C::t('common_domain')->insert(array('domain' => $domain, 'domainroot' => $_G['setting']['domain']['root']['channel'], 'id' => $_GET['catid'], 'idtype' => 'channel')); + $cachearr[] = 'setting'; + } + if($_GET['listprimaltplname'] && (empty($cate['primaltplname']) || $cate['primaltplname'] != $primaltplname)) { + remakediytemplate($primaltplname, 'portal/list_'.$_GET['catid'], $_GET['catname'], getdiydirectory($cate['primaltplname'])); + } + + if($cate['articleprimaltplname'] != $viewprimaltplname) { + remakediytemplate($viewprimaltplname, 'portal/view_'.$_GET['catid'], $_GET['catname'].'-'.cplang('portalcategory_viewpage'), getdiydirectory($cate['articleprimaltplname'])); + } + + include_once libfile('function/cache'); + updatecache('portalcategory'); + loadcache('portalcategory',true); + $portalcategory = $_G['cache']['portalcategory']; + + require libfile('class/blockpermission'); + $tplpermsission = & template_permission::instance(); + $tplpre = 'portal/list_'; + + require libfile('class/portalcategory'); + $categorypermsission = & portal_category::instance(); + + if($operation == 'add') { + if($cate['upid'] && $_GET['catid']) { + if(!$editcat['notinheritedblock']) { + $tplpermsission->remake_inherited_perm($tplpre.$_GET['catid'], $tplpre.$cate['upid']); + } + if(!$editcat['notinheritedarticle']) { + $categorypermsission->remake_inherited_perm($_GET['catid']); + } + } + } elseif($operation == 'edit') { + if($editcat['notinheritedblock'] != $cate['notinheritedblock']) { + $tplname = $tplpre.$cate['catid']; + if($editcat['notinheritedblock']) { + $tplpermsission->delete_inherited_perm_by_tplname($tplname, $tplpre.$cate['upid']); + } else { + if($portalcategory[$cate['catid']]['upid']) { + $tplpermsission->remake_inherited_perm($tplname, $tplpre.$portalcategory[$cate['catid']]['upid']); + } + } + } + if($editcat['notinheritedarticle'] != $cate['notinheritedarticle']) { + if($editcat['notinheritedarticle']) { + $categorypermsission->delete_inherited_perm_by_catid($cate['catid'], $cate['upid']); + } else { + $categorypermsission->remake_inherited_perm($cate['catid']); + } + } + } + + if(!empty($updatecategoryfile)) { + remakecategoryfile($updatecategoryfile); + } + + if($dir) { + if(!makecategoryfile($dir, $_GET['catid'], $domain)) { + cpmsg(cplang('portalcategory_filewrite_error').','.cplang('return'), NULL, 'error'); + } + remakecategoryfile($portalcategory[$_GET['catid']]['children']); + } + + if(($_GET['catid'] && $cate['level'] < 2) || empty($_GET['upid']) || ($_GET['upid'] && $portalcategory[$_GET['upid']]['level'] == 0)) { + $nav = C::t('common_nav')->fetch_by_type_identifier(4, $_GET['catid']); + if($editcat['shownav']) { + if(empty($nav)) { + $navparentid = 0; + if($_GET['catid'] && $cate['level'] > 0 || !empty($_GET['upid'])) { + $identifier = !empty($cate['upid']) ? $cate['upid'] : ($_GET['upid'] ? $_GET['upid'] : 0); + $navparent = C::t('common_nav')->fetch_by_type_identifier(4, $identifier); + $navparentid = $navparent['id']; + if(empty($navparentid)) { + cpmsg(cplang('portalcategory_parentcategory_no_shownav').','.cplang('return'), NULL, 'error'); + } + } + $setarr = array( + 'parentid' => $navparentid, + 'name' => $editcat['catname'], + 'url' => $portalcategory[$_GET['catid']]['caturl'], + 'type' => '4', + 'available' => '1', + 'identifier' => $_GET['catid'], + ); + if($_GET['catid'] && $cate['level'] == 0 || empty($_GET['upid']) && empty($_GET['catid'])) { + $setarr['subtype'] = '1'; + } + $navid = C::t('common_nav')->insert($setarr, true); + + if($_GET['catid'] && $cate['level'] == 0) { + if(!empty($cate['children'])) { + foreach($cate['children'] as $subcatid) { + if($portalcategory[$subcatid]['shownav']) { + $setarr = array( + 'parentid' => $navid, + 'name' => $portalcategory[$subcatid]['catname'], + 'url' => $portalcategory[$subcatid]['caturl'], + 'type' => '4', + 'available' => '1', + 'identifier' => $subcatid, + ); + C::t('common_nav')->insert($setarr); + } + } + } + } + + } else { + $setarr = array('available'=>'1','url' => $portalcategory[$_GET['catid']]['caturl']); + C::t('common_nav')->update_by_type_identifier(4, $_GET['catid'], $setarr); + if($portalcategory[$_GET['catid']]['level'] == 0 && $portalcategory[$_GET['catid']]['children']) { + foreach($portalcategory[$_GET['catid']]['children'] as $subcatid) { + C::t('common_nav')->update_by_type_identifier(4, $subcatid, array('url' => $portalcategory[$subcatid]['caturl'])); + } + } + } + $cachearr[] = 'setting'; + } else { + if(!empty($nav)) { + C::t('common_nav')->delete($nav['id']); + if($portalcategory[$_GET['catid']]['level'] == 0 && !empty($portalcategory[$_GET['catid']]['children'])) { + C::t('common_nav')->delete_by_parentid($nav['id']); + C::t('portal_category')->update($portalcategory[$_GET['catid']]['children'], array('shownav'=>'0')); + } + $cachearr[] = 'setting'; + } + } + } + + if($_GET['setindex']) { + C::t('common_setting')->update_setting('defaultindex', $portalcategory[$_GET['catid']]['caturl']); + $cachearr[] = 'setting'; + } elseif($oldsetindex) { + C::t('common_setting')->update_setting('defaultindex', ''); + $cachearr[] = 'setting'; + } + + updatecache(array_unique($cachearr)); + + $url = $operation == 'add' ? 'action=portalcategory#cat'.$_GET['catid'] : 'action=portalcategory&operation=edit&catid='.$_GET['catid']; + cpmsg('portalcategory_edit_succeed', $url, 'succeed'); + } +} + +function showcategoryrow($key, $level = 0, $last = '') { + global $_G; + + loadcache('portalcategory'); + $value = $_G['cache']['portalcategory'][$key]; + $return = ''; + + include_once libfile('function/portalcp'); + $value['articles'] = category_get_num('portal', $key); + $publish = ''; + if(empty($_G['cache']['portalcategory'][$key]['disallowpublish'])) { + $publish = ' '.cplang('portalcategory_publish').''; + } + if($level == 2) { + $class = $last ? 'lastchildboard' : 'childboard'; + $return = ' 
    '. + ''. + '
    '. + ''.$value['articles'].''. + ''.(empty($value['disallowpublish']) ? cplang('yes') : cplang('no')).''. + ''.(!empty($value['allowcomment']) ? cplang('yes') : cplang('no')).''. + ''.(empty($value['closed']) ? cplang('yes') : cplang('no')).''. + ''. + ''.cplang('view').'  + '.cplang('edit').'  + '.cplang('portalcategory_move').'  + '.cplang('delete').'  + '.cplang('portalcategory_blockperm').' + '.cplang('portalcategory_articlemanagement').'  + '.cplang('portalcategory_articleperm').''.$publish.''; + } elseif($level == 1) { + $return = ' '. + ''.$value['articles'].''. + ''.(empty($value['disallowpublish']) ? cplang('yes') : cplang('no')).''. + ''.(!empty($value['allowcomment']) ? cplang('yes') : cplang('no')).''. + ''.(empty($value['closed']) ? cplang('yes') : cplang('no')).''. + ''. + ''.cplang('view').'  + '.cplang('edit').'  + '.cplang('portalcategory_move').'  + '.cplang('delete').'  + '.cplang('portalcategory_blockperm').' + '.cplang('portalcategory_articlemanagement').'  + '.cplang('portalcategory_articleperm').''.$publish.''; + for($i=0,$L=(is_array($value['children']) ? count($value['children']) : 0); $i<$L; $i++) { + $return .= showcategoryrow($value['children'][$i], 2, $i==$L-1); + } + } else { + $childrennum = is_array($_G['cache']['portalcategory'][$key]['children']) ? count($_G['cache']['portalcategory'][$key]['children']) : 0; + $toggle = $childrennum > 25 ? ' style="display:none"' : ''; + $return = ''.($toggle ? '[+]' : '[-]').'' + .'
    '. + ''. + '
    '. + ''.$value['articles'].''. + ''.(empty($value['disallowpublish']) ? cplang('yes') : cplang('no')).''. + ''.(!empty($value['allowcomment']) ? cplang('yes') : cplang('no')).''. + ''.(empty($value['closed']) ? cplang('yes') : cplang('no')).''. + ''. + ''.cplang('view').'  + '.cplang('edit').'  + '.cplang('portalcategory_move').'  + '.cplang('delete').'  + '.cplang('portalcategory_blockperm').' + '.cplang('portalcategory_articlemanagement').'  + '.cplang('portalcategory_articleperm').''.$publish.' + '; + for($i=0,$L=(is_array($value['children']) ? count($value['children']) : 0); $i<$L; $i++) { + $return .= showcategoryrow($value['children'][$i], 1, ''); + } + $return .= ' '; + } + return $return; +} + +function deleteportalcategory($ids) { + global $_G; + + if(empty($ids)) return false; + if(!is_array($ids) && $_G['cache']['portalcategory'][$ids]['upid'] == 0) { + @require_once libfile('function/delete'); + deletedomain(intval($ids), 'channel'); + } + if(!is_array($ids)) $ids = array($ids); + + require_once libfile('class/blockpermission'); + require_once libfile('class/portalcategory'); + $tplpermission = & template_permission::instance(); + $templates = array(); + foreach($ids as $id) { + $templates[] = 'portal/list_'.$id; + $templates[] = 'portal/view_'.$id; + } + $tplpermission->delete_allperm_by_tplname($templates); + $categorypermission = & portal_category::instance(); + $categorypermission->delete_allperm_by_catid($ids); + + C::t('portal_category')->delete($ids); + C::t('common_nav')->delete_by_type_identifier(4, $ids); + + $tpls = $defaultindex = array(); + foreach($ids as $id) { + $defaultindex[] = $_G['cache']['portalcategory'][$id]['caturl']; + $tpls[] = 'portal/list_'.$id; + $tpls[] = 'portal/view_'.$id; + } + if(in_array($_G['setting']['defaultindex'], $defaultindex)) { + C::t('common_setting')->update_setting('defaultindex', ''); + } + C::t('common_diy_data')->delete($tpls, NULL); + C::t('common_template_block')->delete_by_targettplname($tpls); + +} + + +function makecategoryfile($dir, $catid, $domain) { + dmkdir(DISCUZ_ROOT.'./'.$dir, 0777, FALSE); + $portalcategory = getglobal('cache/portalcategory'); + $prepath = str_repeat('../', $portalcategory[$catid]['level']+1); + if($portalcategory[$catid]['level']) { + $upid = $portalcategory[$catid]['upid']; + while($portalcategory[$upid]['upid']) { + $upid = $portalcategory[$upid]['upid']; + } + $domain = $portalcategory[$upid]['domain']; + } + + $sub_dir = $dir; + if($sub_dir) { + $sub_dir = substr($sub_dir, -1, 1) == '/' ? '/'.$sub_dir : '/'.$sub_dir.'/'; + } + $code = ""; + $r = file_put_contents($dir.'/index.php', $code); + return $r; +} +function getportalcategoryfulldir($catid) { + if(empty($catid)) return ''; + $portalcategory = getglobal('cache/portalcategory'); + $curdir = $portalcategory[$catid]['foldername']; + $curdir = $curdir ? $curdir : ''; + if($catid && empty($curdir)) return FALSE; + $upid = $portalcategory[$catid]['upid']; + while($upid) { + $updir = $portalcategory[$upid]['foldername']; + if(!empty($updir)) { + $curdir = $updir.'/'.$curdir; + } else { + return FALSE; + } + $upid = $portalcategory[$upid]['upid']; + } + return $curdir ? $curdir.'/' : ''; +} + +function delportalcategoryfolder($catid) { + if(empty($catid)) return FALSE; + $updatearr = array(); + $portalcategory = getglobal('cache/portalcategory'); + $children = $portalcategory[$catid]['children']; + if($children) { + foreach($children as $subcatid) { + if($portalcategory[$subcatid]['foldername']) { + $arr = delportalcategorysubfolder($subcatid); + $updatearr = array_merge($updatearr, $arr); + } + } + } + + $dir = getportalcategoryfulldir($catid); + if(!empty($dir)) { + unlink(DISCUZ_ROOT.$dir.'index.html'); + unlink(DISCUZ_ROOT.$dir.'index.php'); + rmdir(DISCUZ_ROOT.$dir); + $updatearr[] = $catid; + } + if(dimplode($updatearr)) { + C::t('portal_category')->update($updatearr, array('foldername'=>'')); + } +} + +function delportalcategorysubfolder($catid) { + if(empty($catid)) return FALSE; + $updatearr = array(); + $portalcategory = getglobal('cache/portalcategory'); + $children = $portalcategory[$catid]['children']; + if($children) { + foreach($children as $subcatid) { + if($portalcategory[$subcatid]['foldername']) { + $arr = delportalcategorysubfolder($subcatid); + $updatearr = array_merge($updatearr, $arr); + } + } + } + + $dir = getportalcategoryfulldir($catid); + if(!empty($dir)) { + unlink(DISCUZ_ROOT.$dir.'index.html'); + unlink(DISCUZ_ROOT.$dir.'index.php'); + rmdir(DISCUZ_ROOT.$dir); + $updatearr[] = $catid; + } + return $updatearr; +} + +function remakecategoryfile($categorys) { + if(is_array($categorys)) { + $portalcategory = getglobal('cache/portalcategory'); + foreach($categorys as $subcatid) { + $dir = getportalcategoryfulldir($subcatid); + makecategoryfile($dir, $subcatid, $portalcategory[$subcatid]['domain']); + if($portalcategory[$subcatid]['children']) { + remakecategoryfile($portalcategory[$subcatid]['children']); + } + } + } +} + +function showportalprimaltemplate($pritplname, $type) { + global $_G; + include_once libfile('function/portalcp'); + $default_tpls = array(); + $tpls = array('./template/default:portal/'.$type=>getprimaltplname('./template/default:portal/'.$type.'.htm')); + foreach($alltemplate = C::t('common_template')->range() as $template) { + if(($dir = dir(DISCUZ_ROOT.$template['directory'].'/portal/'))) { + while(false !== ($file = $dir->read())) { + $file = strtolower($file); + if (in_array(fileext($file), array('htm', 'php')) && (substr($file, 0, strlen($type)+1) == $type.'_') || (substr($file, 0, -4) == $type && $template['directory'] != './template/default')) { + $key = $template['directory'].':portal/'.substr($file, 0, -4); + if ($_G['cache']['style_default']['tpldir'] && $_G['cache']['style_default']['tpldir'] == $template['directory']) { + $default_tpls[$key] = getprimaltplname($template['directory'].':portal/'.$file); + }else{ + $tpls[$key] = getprimaltplname($template['directory'].':portal/'.$file); + } + } + } + } + } + $tpls = array_merge($default_tpls, $tpls); + + foreach($tpls as $key => $value) { + echo ""; + } + + $pritplvalue = ''; + if(empty($pritplname)) { + $pritplhide = ''; + $pritplvalue = ' style="display:none;"'; + } else { + $pritplhide = ' style="display:none;"'; + } + $catetplselect = ' '.cplang('cancel').''; + + if(empty($pritplname)) { + showsetting('portalcategory_'.$type.'primaltplname', '', '', $catetplselect); + } else { + $tplname = getprimaltplname($pritplname.'.htm'); + $html = ' '.$tplname.' '.cplang('modify').''; + showsetting('portalcategory_'.$type.'primaltplname', '', '', $catetplselect.$html); + } +} + +function remakediytemplate($primaltplname, $targettplname, $diytplname, $olddirectory){ + global $_G; + if(empty($targettplname)) return false; + $tpldirectory = ''; + if(strpos($primaltplname, ':') !== false) { + list($tpldirectory, $primaltplname) = explode(':', $primaltplname); + } + $tpldirectory = ($tpldirectory ? $tpldirectory : $_G['cache']['style_default']['tpldir']); + $newdiydata = C::t('common_diy_data')->fetch_diy($targettplname, $tpldirectory); + if($newdiydata) { + return false; + } + $diydata = C::t('common_diy_data')->fetch_diy($targettplname, $olddirectory); + $diycontent = empty($diydata['diycontent']) ? '' : $diydata['diycontent']; + if($diydata) { + C::t('common_diy_data')->update_diy($targettplname, $olddirectory, array('primaltplname'=>$primaltplname, 'tpldirectory'=>$tpldirectory)); + } else { + $diycontent = ''; + if(in_array($primaltplname, array('portal/list', 'portal/view'))) { + $diydata = C::t('common_diy_data')->fetch_diy($targettplname, $olddirectory); + $diycontent = empty($diydata['diycontent']) ? '' : $diydata['diycontent']; + } + $diyarr = array( + 'targettplname' => $targettplname, + 'tpldirectory' => $tpldirectory, + 'primaltplname' => $primaltplname, + 'diycontent' => $diycontent, + 'name' => $diytplname, + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => TIMESTAMP, + ); + C::t('common_diy_data')->insert($diyarr); + } + if(empty($diycontent)) { + $file = $tpldirectory.'/'.$primaltplname.'.htm'; + if (!file_exists($file)) { + $file = './template/default/'.$primaltplname.'.htm'; + } + $content = @file_get_contents(DISCUZ_ROOT.$file); + if(!$content) $content = ''; + $content = preg_replace("/\<\!\-\-\[name\](.+?)\[\/name\]\-\-\>/i", '', $content); + file_put_contents(DISCUZ_ROOT.'./data/diy/'.$tpldirectory.'/'.$targettplname.'.htm', $content); + } else { + updatediytemplate($targettplname, $tpldirectory); + } + return true; +} + +function getparentviewprimaltplname($catid) { + global $_G; + $tpl = 'view'; + if(empty($catid)) { + return $tpl; + } + $cat = $_G['cache']['portalcategory'][$catid]; + if(!empty($cat['upid']['articleprimaltplname'])) { + $tpl = $cat['upid']['articleprimaltplname']; + } else { + $cat = $_G['cache']['portalcategory'][$cat['upid']]; + if($cat && $cat['articleprimaltplname']) { + $tpl = $cat['articleprimaltplname']; + } + } + return $tpl; +} +?> \ No newline at end of file diff --git a/source/admincp/admincp_portalpermission.php b/source/admincp/admincp_portalpermission.php new file mode 100644 index 0000000..83c7600 --- /dev/null +++ b/source/admincp/admincp_portalpermission.php @@ -0,0 +1,187 @@ +fetch_all_by_like_username($_GET['username'])); + $uids = $uids ? $uids : array(0); + $mpurl .= '&username='.dhtmlspecialchars($_GET['username']); +} +if($_GET['inherited']) { + $inherited = ' checked'; + $mpurl .= '&inherited=1'; +} +$ordersc = array($_GET['ordersc']=>' selected'); +$perpage = in_array($_GET['perpage'], array(10,20,50,100)) ? $_GET['perpage'] : 20; +$start = ($page-1)*$perpage; +$perpages = array($perpage => ' selected'); +$searchlang = array(); +$keys = array('search', 'resultsort', 'orderdesc', 'orderasc', 'perpage_10', 'perpage_20', 'perpage_50', 'perpage_100', 'likesupport', + 'uid', 'username', 'portalpermission_no_inherited'); +foreach ($keys as $key) { + $searchlang[$key] = cplang($key); +} +echo << + + + + + + + + + + + +
    {$searchlang['uid']}{$searchlang['username']}* *{$searchlang['likesupport']}
    {$searchlang['resultsort']} + + + + + + + +
    + +SEARCH; + +showformheader('portalpermission&operation='.$operation); +showtableheader('portalpermission'); + +if($operation == 'article') { + showsubtitle(array('username', 'portalcategory', 'portalcategory_perm_publish', 'portalcategory_perm_manage', 'block_perm_inherited')); + showtagheader('tbody', '', true); + loadcache('portalcategory'); + $wherearr = array(); + if(($where = $_GET['uid'] ? 'uid='.$_GET['uid'] : ($uids ? 'uid IN('.dimplode($uids).')' : ''))) { + $wherearr[] = $where; + } + if($inherited) { + $wherearr[] = 'inheritedcatid = \'\''; + } + $wheresql = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + $uids = $_GET['uid'] ? array($_GET['uid']) : $uids; + $count = C::t('portal_category_permission')->count_by_uids($uids, !$inherited); + if($count) { + $permissions = C::t('portal_category_permission')->fetch_all_by_uid($uids, !$inherited, $_GET['ordersc'], $start, $perpage); + foreach($permissions as $value) { + $uids[$value['uid']] = $value['uid']; + } + if(empty($members)) $members = C::t('common_member')->fetch_all($uids); + $multipage = multi($count, $perpage, $page, $mpurl.'&perpage='.$perpage); + foreach($permissions as $value){ + showtablerow('', '', array( + $members[$value['uid']]['username'], + ''.$_G['cache']['portalcategory'][$value['catid']]['catname'].'', + $value['allowpublish'] ? $right : $line, + $value['allowmanage'] ? $right : $line, + $value['inheritedcatid'] ? ''.$_G['cache']['portalcategory'][$value['inheritedcatid']]['catname'].'' : $line, + )); + } + echo ''.$multipage.''; + } + showtagfooter('tbody'); + +} elseif ($operation == 'template') { + + showsubtitle(array('username', 'diytemplate_name', 'block_perm_manage', 'block_perm_recommend', 'block_perm_needverify', 'block_perm_inherited')); + showtagheader('tbody', '', true); + loadcache('diytemplatename'); + $uids = $_GET['uid'] ? array($_GET['uid']) : $uids; + $count = C::t('common_template_permission')->count_by_uids($uids, !$inherited); + if($count) { + $permissions = C::t('common_template_permission')->fetch_all_by_uid($uids, !$inherited, $_GET['ordersc'], $start, $perpage); + foreach($permissions as $value) { + $uids[$value['uid']] = $value['uid']; + } + if(empty($members)) $members = C::t('common_member')->fetch_all($uids); + $multipage = multi($count, $perpage, $page, $mpurl.'&perpage='.$perpage); + foreach($permissions as $value){ + $targettplname = $_G['cache']['diytemplatename'][$value['targettplname']]; + showtablerow('', '', array( + $members[$value['uid']]['username'], + ''.$targettplname.'', + $value['allowmanage'] ? $right : $line, + $value['allowrecommend'] ? $right : $line, + $value['needverify'] ? $right : $line, + $value['inheritedtplname'] ? ''.$_G['cache']['diytemplatename'][$value['inheritedtplname']].'' : $line, + )); + } + echo ''.$multipage.''; + } + showtagfooter('tbody'); +} elseif ($operation == 'block') { + + showsubtitle(array('username', 'block_name', 'block_perm_manage', 'block_perm_recommend', 'block_perm_needverify', 'block_perm_inherited')); + showtagheader('tbody', '', true); + loadcache('diytemplatename'); + $uids = $_GET['uid'] ? array($_GET['uid']) : $uids; + if(($count = C::t('common_block_permission')->count_by_uids($uids, !$inherited))) { + $blocks = $bids = array(); + $permissions = C::t('common_block_permission')->fetch_all_by_uid($uids, !$inherited, $_GET['ordersc'], $start, $perpage); + foreach($permissions as $value) { + $uids[$value['uid']] = $value['uid']; + $bids[$value['bid']] = $value['bid']; + } + if($bids) $blocks = C::t('common_block')->fetch_all($bids); + if(empty($members)) $members = C::t('common_member')->fetch_all($uids); + $multipage = multi($count, $perpage, $page, $mpurl.'&perpage='.$perpage); + foreach($permissions as $value){ + $blockname = $blocks[$value['bid']]['name'] ? $blocks[$value['bid']]['name'] : $value['bid']; + showtablerow('', '', array( + $members[$value['uid']]['username'], + ''.$blockname.'', + $value['allowmanage'] ? $right : $line, + $value['allowrecommend'] ? $right : $line, + $value['needverify'] ? $right : $line, + $value['inheritedtplname'] ? ''.$_G['cache']['diytemplatename'][$value['inheritedtplname']].'' : $line, + )); + } + echo ''.$multipage.''; + } + showtagfooter('tbody'); +} + +showtablefooter(); +showformfooter(); +?> \ No newline at end of file diff --git a/source/admincp/admincp_postcomment.php b/source/admincp/admincp_postcomment.php new file mode 100644 index 0000000..0aff08a --- /dev/null +++ b/source/admincp/admincp_postcomment.php @@ -0,0 +1,192 @@ + + +EOT; + showtagheader('div', 'searchposts', !$searchsubmit && empty($newlist)); + showformheader("postcomment".(!empty($_GET['search']) ? '&search=true' : ''), '', 'postcommentforum'); + showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); + showtableheader(); + showsetting('postcomment_search_detail', 'detail', $detail, 'radio'); + showsetting('comment_search_perpage', '', $_GET['perpage'], ""); + showsetting('postcomment_content', 'message', $message, 'text'); + showsetting('postcomment_search_tid', 'searchtid', $searchtid, 'text'); + showsetting('postcomment_search_pid', 'searchpid', $searchpid, 'text'); + showsetting('postcomment_search_author', 'author', $author, 'text'); + showsetting('postcomment_search_authorid', 'authorid', $authorid, 'text'); + showsetting('comment_search_ip', 'ip', $ip, 'text'); + showsetting('postcomment_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); + showsubmit('searchsubmit'); + showtablefooter(); + showformfooter(); + showtagfooter('div'); + +} else { + $cids = authcode($cids, 'DECODE'); + $cidsadd = $cids ? explode(',', $cids) : $_GET['delete']; + $pids = array(); + foreach(C::t('forum_postcomment')->fetch_all($cidsadd) as $postcomment) { + $pids[$postcomment['pid']] = $postcomment['pid']; + } + C::t('forum_postcache')->delete($pids); + $cidsadd && C::t('forum_postcomment')->delete($cidsadd); + $cpmsg = cplang('postcomment_delete'); + +?> + +fetch_all_uid_by_username(array_map('trim', explode(',', $author))); + $authorid = ($authorid ? $authorid.',' : '').implode(',',$authorids); + } + $authorid = trim($authorid,', '); + + if($starttime != '0') { + $starttime = strtotime($starttime); + } + + if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { + if($endtime != '0') { + $endtime = strtotime($endtime); + } + } else { + $endtime = TIMESTAMP; + } + + + if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { + $error = 'comment_mod_range_illegal'; + } + + + if(!$error) { + if($detail) { + $commentcount = C::t('forum_postcomment')->count_by_search($searchtid, $searchpid, ($authorid ? explode(',', str_replace(' ', '', $authorid)) : null), $starttime, $endtime, $ip, $message); + if($commentcount) { + $_GET['perpage'] = intval($_GET['perpage']) < 1 ? 20 : intval($_GET['perpage']); + $perpage = $_GET['pp'] ? $_GET['pp'] : $_GET['perpage']; + + $comments = ''; + + foreach(C::t('forum_postcomment')->fetch_all_by_search($searchtid, $searchpid, ($authorid ? explode(',', str_replace(' ', '', $authorid)) : null), $starttime, $endtime, $ip, $message, (($page - 1) * $perpage), $perpage) as $comment) { + $comment['dateline'] = dgmdate($comment['dateline']); + $comments .= showtablerow('', '', array( + "", + str_replace(array('[b]', '[/b]', '[/color]'), array('', '', '
    '), preg_replace("/\[color=([#\w]+?)\]/i", "", $comment['comment'])), + ($comment['author'] ? "".$comment['author']."" : cplang('postcomment_guest')), + $comment['dateline'], + $comment['useip'], + "".cplang('postcomment_pid')."" + ), TRUE); + } + + $multi = multi($commentcount, $perpage, $page, ADMINSCRIPT."?action=postcomment"); + $multi = preg_replace("/href=\"".ADMINSCRIPT."\?action=postcomment&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi); + $multi = str_replace("window.location='".ADMINSCRIPT."?action=postcomment&page='+this.value", "page(this.value)", $multi); + } else { + $error = 'postcomment_nonexistence'; + } + } else { + $commentcount = 0; + foreach(C::t('forum_postcomment')->fetch_all_by_search($searchtid, $searchpid, ($authorid ? explode(',', str_replace(' ', '', $authorid)) : null), $starttime, $endtime, $ip, $message) as $row) { + $cids .= ','.$row['id']; + $commentcount++; + } + $multi = ''; + } + } + + showtagheader('div', 'postlist', $searchsubmit || $newlist); + showformheader('postcomment&frame=no', 'target="postcommentframe"'); + showhiddenfields(array('cids' => authcode($cids, 'ENCODE'))); + if(!$search_tips) { + showtableheader(cplang('postcomment_new_result').' '.$commentcount, 'fixpadding'); + } else { + showtableheader(cplang('postcomment_result').' '.$commentcount.(empty($newlist) ? ' '.cplang('research').'' : ''), 'fixpadding'); + } + + if($error) { + echo "$lang[$error]"; + } elseif($detail) { + showsubtitle(array('', 'postcomment_content', 'author', 'time', 'ip' ,'')); + echo $comments; + } + + showsubmit('postcommentsubmit', 'delete', $detail ? 'del' : '', '', $multi); + showtablefooter(); + showformfooter(); + echo ''; + showtagfooter('div'); + +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_postsplit.php b/source/admincp/admincp_postsplit.php new file mode 100644 index 0000000..17edf36 --- /dev/null +++ b/source/admincp/admincp_postsplit.php @@ -0,0 +1,365 @@ +fetch_all_setting(array('posttable_info', 'posttableids', 'threadtableids'), true); +if($setting['posttable_info']) { + $posttable_info = $setting['posttable_info']; +} else { + $posttable_info = array(); + $posttable_info[0]['type'] = 'primary'; +} +$posttableids = $setting['posttableids'] ? $setting['posttableids'] : array(); +$threadtableids = $setting['threadtableids']; + +if($operation == 'manage') { + shownav('founder', 'nav_postsplit'); + if(!submitcheck('postsplit_manage')) { + + showsubmenu('nav_postsplit_manage'); + showtips('postsplit_manage_tips'); + showformheader('postsplit&operation=manage'); + showtableheader(); + + showsubtitle(array('postsplit_manage_tablename', 'postsplit_manage_datalength', 'postsplit_manage_table_memo', '')); + + + $tablename = C::t('forum_post')->getposttable(0, true); + $tableid = 0; + $tablestatus = helper_dbtool::gettablestatus($tablename); + $postcount = $tablestatus['Rows']; + $data_length = $tablestatus['Data_length']; + $index_length = $tablestatus['Index_length']; + + + + $opstr = ''.cplang('postsplit_name').''; + showtablerow('', array('', '', '', 'class="td25"'), array($tablename, $data_length, "", $opstr)); + + foreach(C::t('forum_post')->show_table() as $table) { + $tablename = current($table); + $tableid = gettableid($tablename); + if(!preg_match('/^\d+$/', $tableid)) { + continue; + } + $tablestatus = helper_dbtool::gettablestatus($tablename); + + $opstr = ''.cplang('postsplit_name').''; + showtablerow('', array('', '', '', 'class="td25"'), array($tablename, $tablestatus['Data_length'], "", $opstr)); + } + showsubmit('postsplit_manage', 'postsplit_manage_update_memo_submit'); + showtablefooter(); + showformfooter(); + } else { + $posttable_info = array(); + foreach($_GET['memo'] as $key => $value) { + $key = intval($key); + $posttable_info[$key]['memo'] = dhtmlspecialchars($value); + } + + C::t('common_setting')->update_setting('posttable_info', $posttable_info); + savecache('posttable_info', $posttable_info); + update_posttableids(); + updatecache('setting'); + + cpmsg('postsplit_table_memo_update_succeed', 'action=postsplit&operation=manage', 'succeed'); + } +} elseif($operation == 'split') { + + if(!$_G['setting']['bbclosed']) { + cpmsg('postsplit_forum_must_be_closed', 'action=postsplit&operation=manage', 'error'); + } + + $tableid = intval($_GET['tableid']); + $tablename = getposttable($tableid); + if($tableid && $tablename != 'forum_post' || !$tableid) { + $status = helper_dbtool::gettablestatus(getposttable($tableid, true), false); + $allowsplit = false; + + if($status && ((!$tableid && $status['Data_length'] > 400 * 1048576) || ($tableid && $status['Data_length']))) { + + if(!submitcheck('splitsubmit')) { + showsubmenu('nav_postsplit_manage'); + showtips('postsplit_manage_tips'); + showformheader('postsplit&operation=split&tableid='.$tableid); + showtableheader(); + showsetting('postsplit_from', '', '', getposttable($tableid, true).(!empty($posttable_info[$tableid]['memo']) ? '('.$posttable_info[$tableid]['memo'].')' : '')); + $tablelist = ''; + foreach($posttable_info as $tid => $info) { + if($tableid != $tid) { + $tablestatus = helper_dbtool::gettablestatus(getposttable($tid, true)); + $tablelist .= ''; + } + } + showsetting('postsplit_to', '', '', ''); + showtagheader('tbody', 'tableinfo', true, 'sub'); + showsetting('postsplit_manage_table_memo', "memo", '', 'text'); + showtagfooter('tbody'); + + $datasize = round($status['Data_length'] / 1048576); + $maxsize = round(($datasize - ($tableid ? 0 : 300)) / 100); + $maxi = $maxsize > 10 ? 10 : ($maxsize < 1 ? 1 : $maxsize); + for($i = 1; $i <= $maxi; $i++) { + $movesize = $i == 10 ? 1024 : $i * 100; + $maxsizestr .= ''; + } + showsetting('postsplit_move_size', '', '', ''); + + showsubmit('splitsubmit', 'postsplit_manage_submit'); + showtablefooter(); + showformfooter(); + } else { + + $targettable = intval($_GET['targettable']); + $createtable = false; + if($targettable == -1) { + $maxtableid = getmaxposttableid(); + DB::query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT'); + $tableinfo = C::t('forum_post')->show_table_by_tableid(0); + $createsql = $tableinfo['Create Table']; + $targettable = $maxtableid + 1; + $newtable = 'forum_post_'.$targettable; + $createsql = str_replace(getposttable(), $newtable, $createsql); + DB::query($createsql); + + $posttable_info[$targettable]['memo'] = $_GET['memo']; + C::t('common_setting')->update_setting('posttable_info', $posttable_info); + savecache('posttable_info', $posttable_info); + update_posttableids(); + $createtable = true; + } + $sourcetablearr = gettablefields(getposttable($tableid)); + $targettablearr = gettablefields(getposttable($targettable)); + $fields = array_diff(array_keys($sourcetablearr), array_keys($targettablearr)); + if(!empty($fields)) { + cpmsg('postsplit_do_error', '', '', array('tableid' => getposttable($targettable, true), 'fields' => implode(',', $fields))); + } + + $movesize = intval($_GET['movesize']); + $movesize = $movesize >= 100 && $movesize <= 1024 ? $movesize : 100; + $targetstatus = helper_dbtool::gettablestatus(getposttable($targettable, true), false); + $hash = urlencode(authcode("$tableid\t$movesize\t$targettable\t{$targetstatus['Data_length']}", 'ENCODE')); + if($createtable) { + cpmsg('postsplit_table_create_succeed', 'action=postsplit&operation=movepost&fromtable='.$tableid.'&movesize='.$movesize.'&targettable='.$targettable.'&hash='.$hash, 'loadingform'); + } else { + cpmsg('postsplit_finish', 'action=postsplit&operation=movepost&fromtable='.$tableid.'&movesize='.$movesize.'&targettable='.$targettable.'&hash='.$hash, 'loadingform'); + } + + } + } else { + cpmsg('postsplit_unallow', 'action=postsplit'); + } + } + +} elseif($operation == 'movepost') { + + if(!$_G['setting']['bbclosed']) { + cpmsg('postsplit_forum_must_be_closed', 'action=postsplit&operation=manage', 'error'); + } + list($tableid, $movesize, $targettableid, $sourcesize) = explode("\t", urldecode(authcode($_GET['hash']))); + $hash = urlencode($_GET['hash']); + + if($tableid == $_GET['fromtable'] && $movesize == $_GET['movesize'] && $targettableid == $_GET['targettable']) { + $fromtableid = intval($_GET['fromtable']); + $movesize = intval($_GET['movesize']); + $targettableid = intval($_GET['targettable']); + + $targettable = gettablefields(getposttable($targettableid)); + $fieldstr = '`'.implode('`, `', array_keys($targettable)).'`'; + + loadcache('threadtableids'); + $threadtableids = array(0); + if(!empty($_G['cache']['threadtableids'])) { + $threadtableids = array_merge($threadtableids, $_G['cache']['threadtableids']); + } + $tableindex = intval(!empty($_GET['tindex']) ? $_GET['tindex'] : 0); + if(isset($threadtableids[$tableindex])) { + + if(!$fromtableid) { + $threadtableid = $threadtableids[$tableindex]; + + $count = C::t('forum_thread')->count_by_posttableid_displayorder($threadtableid); + if($count) { + $tids = array(); + foreach(C::t('forum_thread')->fetch_all_by_posttableid_displayorder($threadtableid) as $tid => $thread) { + $tids[$tid] = $tid; + } + movedate($tids); + } + if($tableindex+1 < count($threadtableids)) { + $tableindex++; + $status = helper_dbtool::gettablestatus(getposttable($targettableid, true), false); + $targetsize = $sourcesize + $movesize * 1048576; + $nowdatasize = $targetsize - $status['Data_length']; + + cpmsg('postsplit_doing', 'action=postsplit&operation=movepost&fromtable='.$tableid.'&movesize='.$movesize.'&targettable='.$targettableid.'&hash='.$hash.'&tindex='.$tableindex, 'loadingform', array('datalength' => sizecount($status['Data_length']), 'nowdatalength' => sizecount($nowdatasize))); + } + + } else { + $count = C::t('forum_post')->count_by_first($fromtableid, 1); + if($count) { + $threads = C::t('forum_post')->fetch_all_tid_by_first($fromtableid, 1, 0, 1000); + $tids = array(); + foreach($threads as $thread) { + $tids[$thread['tid']] = $thread['tid']; + } + movedate($tids); + } else { + cpmsg('postsplit_done', 'action=postsplit&operation=optimize&tableid='.$fromtableid, 'form'); + } + + } + } + + + } else { + cpmsg('postsplit_abnormal', 'action=postsplit', 'succeed'); + } +} elseif($operation == 'optimize') { + + if(!$_G['setting']['bbclosed']) { + cpmsg('postsplit_forum_must_be_closed', 'action=postsplit&operation=manage', 'error'); + } + + $fromtableid = intval($_GET['tableid']); + $optimize = true; + $tablename = getposttable($fromtableid); + if($fromtableid && $tablename != 'forum_post') { + $count = C::t('forum_post')->count_table($fromtableid); + if(!$count) { + C::t('forum_post')->drop_table($fromtableid); + + unset($posttable_info[$fromtableid]); + C::t('common_setting')->update_setting('posttable_info', $posttable_info); + savecache('posttable_info', $posttable_info); + update_posttableids(); + $optimize = false; + } + + } + if($optimize) { + C::t('forum_post')->optimize_table($fromtableid); + } + cpmsg('postsplit_do_succeed', 'action=postsplit', 'succeed'); + +} elseif($operation == 'pidreset') { + loadcache('posttableids'); + if(!empty($_G['cache']['posttableids'])) { + $posttableids = $_G['cache']['posttableids']; + } else { + $posttableids = array('0'); + } + $pidmax = 0; + foreach($posttableids as $id) { + if($id == 0) { + $pidtmp = C::t('forum_post')->fetch_maxid(0); + } else { + $pidtmp = C::t('forum_post')->fetch_maxid($id); + } + if($pidtmp > $pidmax) { + $pidmax = $pidtmp; + } + } + $auto_increment = $pidmax + 1; + C::t('forum_post_tableid')->alter_auto_increment($auto_increment); + cpmsg('postsplit_resetpid_succeed', 'action=postsplit&operation=manage', 'succeed'); +} + +function gettableid($tablename) { + $tableid = substr($tablename, strrpos($tablename, '_') + 1); + return $tableid; +} + +function getmaxposttableid() { + $maxtableid = 0; + foreach(C::t('forum_post')->show_table() as $table) { + $tablename = current($table); + $tableid = intval(gettableid($tablename)); + if($tableid > $maxtableid) { + $maxtableid = $tableid; + } + } + return $maxtableid; +} + +function update_posttableids() { + $tableids = get_posttableids(); + C::t('common_setting')->update_setting('posttableids', $tableids); + savecache('posttableids', $tableids); +} + +function get_posttableids() { + $tableids = array(0); + foreach(C::t('forum_post')->show_table() as $table) { + $tablename = current($table); + $tableid = gettableid($tablename); + if(!preg_match('/^\d+$/', $tableid)) { + continue; + } + $tableid = intval($tableid); + if(!$tableid) { + continue; + } + $tableids[] = $tableid; + } + return $tableids; +} + + + +function gettablefields($table) { + static $tables = array(); + + if(!isset($tables[$table])) { + $tables[$table] = C::t('forum_post')->show_table_columns($table); + } + return $tables[$table]; +} + +function movedate($tids) { + global $sourcesize, $tableid, $movesize, $targettableid, $hash, $tableindex, $threadtableids, $fieldstr, $fromtableid, $posttable_info; + + $fromtable = getposttable($fromtableid, true); + C::t('forum_post')->move_table($targettableid, $fieldstr, $fromtable, $tids); + if(DB::errno()) { + C::t('forum_post')->delete_by_tid($targettableid, $tids); + } else { + foreach($threadtableids as $threadtableid) { + $affected_rows = C::t('forum_thread')->update($tids, array('posttableid' => $targettableid), false, false, $threadtableid); + if($affected_rows == count($tids)) { + break; + } + } + C::t('forum_post')->delete_by_tid($fromtableid, $tids); + } + $status = helper_dbtool::gettablestatus(getposttable($targettableid, true), false); + $targetsize = $sourcesize + $movesize * 1048576; + $nowdatasize = $targetsize - $status['Data_length']; + + if($status['Data_length'] >= $targetsize) { + cpmsg('postsplit_done', 'action=postsplit&operation=optimize&tableid='.$fromtableid, 'form'); + } + + cpmsg('postsplit_doing', 'action=postsplit&operation=movepost&fromtable='.$tableid.'&movesize='.$movesize.'&targettable='.$targettableid.'&hash='.$hash.'&tindex='.$tableindex, 'loadingform', array('datalength' => sizecount($status['Data_length']), 'nowdatalength' => sizecount($nowdatasize))); +} + +?> \ No newline at end of file diff --git a/source/admincp/admincp_prune.php b/source/admincp/admincp_prune.php new file mode 100644 index 0000000..cc20f17 --- /dev/null +++ b/source/admincp/admincp_prune.php @@ -0,0 +1,291 @@ +'. + ''.forumselect(FALSE, 0, 0, TRUE).''; + + if($_GET['forums']) { + $forumselect = preg_replace("/(\
    + + +EOT; + } + return array('html' => $html, 'data' => null); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/html/block_sort.php b/source/class/block/html/block_sort.php new file mode 100644 index 0000000..793d1c5 --- /dev/null +++ b/source/class/block/html/block_sort.php @@ -0,0 +1,274 @@ +setting = array( + 'tids' => array( + 'title' => 'sortlist_tids', + 'type' => 'text' + ), + 'fids' => array( + 'title' => 'sortlist_fids', + 'type' => 'mselect', + 'value' => array() + ), + 'sortids' => array( + 'title' => 'sortlist_sortids', + 'type' => 'mradio', + 'value' => array() + ), + 'digest' => array( + 'title' => 'sortlist_digest', + 'type' => 'mcheckbox', + 'value' => array( + array(1, 'sortlist_digest_1'), + array(2, 'sortlist_digest_2'), + array(3, 'sortlist_digest_3'), + array(0, 'sortlist_digest_0') + ), + ), + 'stick' => array( + 'title' => 'sortlist_stick', + 'type' => 'mcheckbox', + 'value' => array( + array(1, 'sortlist_stick_1'), + array(2, 'sortlist_stick_2'), + array(3, 'sortlist_stick_3'), + array(0, 'sortlist_stick_0') + ), + ), + 'recommend' => array( + 'title' => 'sortlist_recommend', + 'type' => 'radio' + ), + 'orderby' => array( + 'title' => 'sortlist_orderby', + 'type'=> 'mradio', + 'value' => array( + array('lastpost', 'sortlist_orderby_lastpost'), + array('dateline', 'sortlist_orderby_dateline'), + array('replies', 'sortlist_orderby_replies'), + array('views', 'sortlist_orderby_views'), + array('heats', 'sortlist_orderby_heats'), + array('recommends', 'sortlist_orderby_recommends'), + ), + 'default' => 'lastpost' + ), + 'lastpost' => array( + 'title' => 'sortlist_lastpost', + 'type'=> 'mradio', + 'value' => array( + array('0', 'sortlist_lastpost_nolimit'), + array('3600', 'sortlist_lastpost_hour'), + array('86400', 'sortlist_lastpost_day'), + array('604800', 'sortlist_lastpost_week'), + array('2592000', 'sortlist_lastpost_month'), + ), + 'default' => '0' + ), + 'startrow' => array( + 'title' => 'sortlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + 'showitems' => array( + 'title' => 'sortlist_showitems', + 'type' => 'text', + 'default' => 10 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_html_script_sort'); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + if($settings['fids']) { + loadcache('forums'); + $settings['fids']['value'][] = array(0, lang('portalcp', 'block_all_forum')); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + } + if($settings['sortids']) { + $defaultvalue = ''; + $query = DB::query("SELECT typeid, name, special FROM ".DB::table('forum_threadtype')." ORDER BY typeid DESC"); + while($threadtype = DB::fetch($query)) { + if($threadtype['special']) { + if(empty($defaultvalue)) { + $defaultvalue = $threadtype['typeid']; + } + $settings['sortids']['value'][] = array($threadtype['typeid'], $threadtype['name']); + } + } + $settings['sortids']['default'] = $defaultvalue; + } + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + + loadcache('forums'); + $tids = !empty($parameter['tids']) ? explode(',', $parameter['tids']) : array(); + $fids = isset($parameter['fids']) && !in_array(0, (array)$parameter['fids']) ? $parameter['fids'] : array_keys($_G['cache']['forums']); + $startrow = !empty($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = !empty($parameter['showitems']) ? intval($parameter['showitems']) : 10; + $digest = isset($parameter['digest']) ? $parameter['digest'] : 0; + $stick = isset($parameter['stick']) ? $parameter['stick'] : 0; + $orderby = isset($parameter['orderby']) ? (in_array($parameter['orderby'],array('lastpost','dateline','replies','views','heats','recommends')) ? $parameter['orderby'] : 'lastpost') : 'lastpost'; + $lastpost = isset($parameter['lastpost']) ? intval($parameter['lastpost']) : 0; + $recommend = !empty($parameter['recommend']) ? 1 : 0; + $sortid = isset($parameter['sortids']) ? intval($parameter['sortids']) : ''; + + if($fids) { + $thefids = array(); + foreach($fids as $fid) { + if($_G['cache']['forums'][$fid]['type']=='group') { + $thefids[] = $fid; + } + } + if($thefids) { + foreach($_G['cache']['forums'] as $value) { + if($value['fup'] && in_array($value['fup'], $thefids)) { + $fids[] = intval($value['fid']); + } + } + } + $fids = array_unique($fids); + } + + $datalist = $list = array(); + $threadtypeids = array(); + + $sql = ($tids ? ' AND t.tid IN ('.dimplode($tids).')' : '') + .($sortid ? ' AND t.sortid='.$sortid : '') + .($fids ? ' AND t.fid IN ('.dimplode($fids).')' : '') + .($digest ? ' AND t.digest IN ('.dimplode($digest).')' : '') + .($stick ? ' AND t.displayorder IN ('.dimplode($stick).')' : '') + ." AND t.closed='0' AND t.isgroup='0'"; + if($lastpost) { + $historytime = TIMESTAMP - $lastpost; + $sql .= " AND t.dateline>='$historytime'"; + } + if($orderby == 'heats') { + $_G['setting']['indexhot']['days'] = !empty($_G['setting']['indexhot']['days']) ? intval($_G['setting']['indexhot']['days']) : 8; + $heatdateline = TIMESTAMP - 86400 * $_G['setting']['indexhot']['days']; + $sql .= " AND t.dateline>'$heatdateline' AND t.heats>'0'"; + } + $sqlfrom = "FROM `".DB::table('forum_thread')."` t"; + $joinmethod = empty($tids) ? 'INNER' : 'LEFT'; + if($recommend) { + $sqlfrom .= " $joinmethod JOIN `".DB::table('forum_forumrecommend')."` fc ON fc.tid=t.tid"; + } + + require_once libfile('function/threadsort'); + $templatearray = $sortoptionarray = array(); + loadcache(array('threadsort_option_'.$sortid, 'threadsort_template_'.$sortid)); + sortthreadsortselectoption($sortid); + $templatearray[$sortid] = $_G['cache']['threadsort_template_'.$sortid]['block']; + $sortoptionarray[$sortid] = $_G['cache']['threadsort_option_'.$sortid]; + $isthreadtype = (strpos($templatearray[$sortid], '{typename}') !== false || strpos($templatearray[$sortid], '{typename_url}') !== false ) ? true : false; + $threadtypes = array(); + if($isthreadtype && $fids) { + foreach(C::t('forum_forumfield')->fetch_all($fids) as $fid => $forum) { + $threadtypes[$fid] = dunserialize($forum['threadtypes']); + } + } + + $html = ''; + $threadlist = $verify = $verifyuids = array(); + $query = DB::query("SELECT t.* + $sqlfrom WHERE 1 $sql + AND t.readperm='0' + AND t.displayorder>='0' + ORDER BY t.$orderby DESC + LIMIT $startrow,$items;" + ); + + while($thread = DB::fetch($query)) { + + if(isset($_G['setting']['verify']['enabled']) && $_G['setting']['verify']['enabled']) { + $verifyuids[$thread['authorid']] = $thread['authorid']; + } + + if($thread['highlight']) { + $color = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282'); + $string = sprintf('%02d', $thread['highlight']); + $stylestr = sprintf('%03b', $string[0]); + + $thread['highlight'] = ' style="'; + $thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : ''; + $thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : ''; + $thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : ''; + $thread['highlight'] .= $string[1] ? 'color: '.$color[$string[1]] : ''; + $thread['highlight'] .= '"'; + } else { + $thread['highlight'] = ''; + } + + $thread['lastposterenc'] = rawurlencode($thread['lastposter']); + $fid = $thread['fid']; + if($thread['typeid'] && $isthreadtype && $threadtypes[$fid] && !empty($threadtypes[$fid]['prefix']) && isset($threadtypes[$fid]['types'][$thread['typeid']])) { + if($threadtypes[$fid]['prefix'] == 1) { + $thread['typehtml'] = '['.$threadtypes[$fid]['types'][$thread['typeid']].']'; + } elseif($threadtypes[$fid]['icons'][$thread['typeid']] && $threadtypes[$fid]['prefix'] == 2) { + $thread['typehtml'] = ''.''.$threadtypes[$fid]['types'][$thread['typeid']].''; + } + $thread['typename'] = $threadtypes[$fid]['types'][$thread['typeid']]; + } else { + $thread['typename'] = $thread['typehtml'] = ''; + } + + $thread['dateline'] = dgmdate($thread['dateline'], 'u', '9999', getglobal('setting/dateformat')); + $thread['lastpost'] = dgmdate($thread['lastpost'], 'u'); + $threadlist[$thread['tid']] = $thread; + } + + if(!empty($threadlist)) { + if($verifyuids) { + foreach(C::t('common_member_verify')->fetch_all($verifyuids) as $value) { + foreach($_G['setting']['verify'] as $vid => $vsetting) { + if($vsetting['available'] && $vsetting['showicon'] && $value['verify'.$vid] == 1) { + $srcurl = ''; + if(!empty($vsetting['icon'])) { + $srcurl = $vsetting['icon']; + } + $verify[$value['uid']] .= "".(!empty($srcurl) ? ''.$vsetting['title'].'' : $vsetting['title']).''; + } + } + + } + } + $html = implode('', showsortmodetemplate($sortid, $fids, $sortoptionarray, $templatearray, $threadlist, array_keys($threadlist), $verify)); + } + + return array('html' => $html, 'data' => null); + } + +} + + +?> \ No newline at end of file diff --git a/source/class/block/html/block_stat.php b/source/class/block/html/block_stat.php new file mode 100644 index 0000000..c4ba04e --- /dev/null +++ b/source/class/block/html/block_stat.php @@ -0,0 +1,201 @@ + array( + 'title' => 'stat_option', + 'type' => 'mcheckbox', + 'value' => array( + array('posts', 'stat_option_posts'), + array('groups', 'stat_option_groups'), + array('members', 'stat_option_members'), + array('groupnewposts', 'stat_option_groupnewposts'), + array('bbsnewposts', 'stat_option_bbsnewposts'), + array('bbslastposts', 'stat_option_bbslastposts'), + array('onlinemembers', 'stat_option_onlinemembers'), + array('maxmembers', 'stat_option_maxmembers'), + array('doings', 'stat_option_doings'), + array('blogs', 'stat_option_blogs'), + array('albums', 'stat_option_albums'), + array('pics', 'stat_option_pics'), + array('shares', 'stat_option_shares'), + ), + 'default' => array('posts', 'groups', 'members') + ), + 'tip' => array( + 'title' => 'stat_edit_showtitle', + 'type' => lang('block/stat', 'stat_edit_showtitle_detail'), + ), + 'posts_title' => array( + 'title' => 'stat_option_posts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_posts') + ), + 'groups_title' => array( + 'title' => 'stat_option_groups', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_groups') + ), + 'members_title' => array( + 'title' => 'stat_option_members', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_members') + ), + 'groupnewposts_title' => array( + 'title' => 'stat_option_groupnewposts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_groupnewposts') + ), + 'bbsnewposts_title' => array( + 'title' => 'stat_option_bbsnewposts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_bbsnewposts') + ), + 'bbslastposts_title' => array( + 'title' => 'stat_option_bbslastposts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_bbslastposts') + ), + 'onlinemembers_title' => array( + 'title' => 'stat_option_onlinemembers', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_onlinemembers') + ), + 'maxmembers_title' => array( + 'title' => 'stat_option_maxmembers', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_maxmembers') + ), + 'doings_title' => array( + 'title' => 'stat_option_doings', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_doings') + ), + 'blogs_title' => array( + 'title' => 'stat_option_blogs', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_blogs') + ), + 'albums_title' => array( + 'title' => 'stat_option_albums', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_albums') + ), + 'pics_title' => array( + 'title' => 'stat_option_pics', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_pics') + ), + 'shares_title' => array( + 'title' => 'stat_option_shares', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_shares') + ), + ); + return $settings; + } + + function getdata($style, $parameter) { + $parameter = $this->cookparameter($parameter); + global $_G; + if(in_array('posts', $parameter['option']) || in_array('bbsnewposts', $parameter['option'])) { + $sql = "SELECT sum(f.posts) AS posts, sum(f.todayposts) AS todayposts FROM ".DB::table('forum_forum')." f WHERE f.status='1'"; + $forum = DB::fetch_first($sql); + } + if(in_array('groups', $parameter['option']) || in_array('groupnewposts', $parameter['option'])) { + loadcache('groupindex'); + } + $index = count($parameter['option']) - 1; + $html = '
    '; + if(in_array('posts', $parameter['option'])) { + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($forum['posts']).'

    '.(!empty($parameter['posts_title']) ? $parameter['posts_title'] : lang('block/stat', 'stat_posts')).''; + } + if(in_array('groups', $parameter['option'])) { + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($_G['cache']['groupindex']['groupnum']).'

    '.(!empty($parameter['groups_title']) ? $parameter['groups_title'] : lang('block/stat', 'stat_groups')).''; + } + if(in_array('members', $parameter['option'])) { + loadcache('userstats'); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($_G['cache']['userstats']['totalmembers']).'

    '.(!empty($parameter['members_title']) ? $parameter['members_title'] : lang('block/stat', 'stat_members')).''; + } + if(in_array('groupnewposts', $parameter['option'])) { + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($_G['cache']['groupindex']['todayposts']).'

    '.(!empty($parameter['groupnewposts_title']) ? $parameter['groupnewposts_title'] : lang('block/stat', 'stat_groupnewposts')).''; + } + if(in_array('bbsnewposts', $parameter['option'])) { + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($forum['todayposts']).'

    '.(!empty($parameter['bbsnewposts_title']) ? $parameter['bbsnewposts_title'] : lang('block/stat', 'stat_bbsnewposts')).''; + } + if(in_array('bbslastposts', $parameter['option'])) { + loadcache('historyposts'); + $postdata = $_G['cache']['historyposts'] ? explode("\t", $_G['cache']['historyposts']) : array(); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($postdata[0]).'

    '.(!empty($parameter['bbslastposts_title']) ? $parameter['bbslastposts_title'] : lang('block/stat', 'stat_bbslastposts')).''; + } + if(in_array('onlinemembers', $parameter['option'])) { + $num = !empty($_G['cookie']['onlineusernum']) ? intval($_G['cookie']['onlineusernum']) : C::app()->session->count(); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($num).'

    '.(!empty($parameter['onlinemembers_title']) ? $parameter['onlinemembers_title'] : lang('block/stat', 'stat_onlinemembers')).''; + } + if(in_array('maxmembers', $parameter['option'])) { + loadcache('onlinerecord'); + $onlineinfo = explode("\t", $_G['cache']['onlinerecord']); + $num = !empty($onlineinfo[0]) ? intval($onlineinfo[0]) : 0; + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($num).'

    '.(!empty($parameter['maxmembers_title']) ? $parameter['maxmembers_title'] : lang('block/stat', 'stat_maxmembers')).''; + } + if(in_array('doings', $parameter['option'])) { + $num = C::t('home_doing')->count(); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($num).'

    '.(!empty($parameter['doings_title']) ? $parameter['doings_title'] : lang('block/stat', 'stat_doings')).''; + } + if(in_array('blogs', $parameter['option'])) { + $num = C::t('home_blog')->count(); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($num).'

    '.(!empty($parameter['blogs_title']) ? $parameter['blogs_title'] : lang('block/stat', 'stat_blogs')).''; + } + if(in_array('albums', $parameter['option'])) { + $num = C::t('home_album')->count(); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($num).'

    '.(!empty($parameter['albums_title']) ? $parameter['albums_title'] : lang('block/stat', 'stat_albums')).''; + } + if(in_array('pics', $parameter['option'])) { + $num = C::t('home_pic')->count(); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($num).'

    '.(!empty($parameter['pics_title']) ? $parameter['pics_title'] : lang('block/stat', 'stat_pics')).''; + } + if(in_array('shares', $parameter['option'])) { + $num = C::t('home_share')->count(); + $class = ($index-- == 0) ? ' class="bbn"' : ''; + $html .= "

    ".intval($num).'

    '.(!empty($parameter['shares_title']) ? $parameter['shares_title'] : lang('block/stat', 'stat_shares')).''; + } + $html .= '
    '; + return array('html' => $html, 'data' => null); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/html/block_vedio.php b/source/class/block/html/block_vedio.php new file mode 100644 index 0000000..c0b5435 --- /dev/null +++ b/source/class/block/html/block_vedio.php @@ -0,0 +1,60 @@ + array( + 'title' => 'vedio_url', + 'type' => 'text', + 'default' => 'http://' + ), + 'width' => array( + 'title' => 'vedio_width', + 'type' => 'text', + 'default' => '' + ), + 'height' => array( + 'title' => 'vedio_height', + 'type' => 'text', + 'default' => '' + ), + ); + + return $settings; + } + + function getdata($style, $parameter) { + require_once libfile('function/discuzcode'); + $parameter['width'] = !empty($parameter['width']) ? intval($parameter['width']) : 'auto'; + $parameter['height'] = !empty($parameter['height']) ? intval($parameter['height']) : 'auto'; + $parameter['url'] = addslashes($parameter['url']); + $return = parseflv($parameter['url'], $parameter['width'], $parameter['height']); + if($return == false) { + $return = $parameter['url']; + } + return array('html' => $return, 'data' => null); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/html/blockclass.php b/source/class/block/html/blockclass.php new file mode 100644 index 0000000..e86bce4 --- /dev/null +++ b/source/class/block/html/blockclass.php @@ -0,0 +1,19 @@ + lang('blockclass', 'blockclass_html'), +); + + +?> \ No newline at end of file diff --git a/source/class/block/html/commonblock_html.php b/source/class/block/html/commonblock_html.php new file mode 100644 index 0000000..f47fc95 --- /dev/null +++ b/source/class/block/html/commonblock_html.php @@ -0,0 +1,24 @@ +setting = array( + 'uids' => array( + 'title' => 'memberlist_uids', + 'type' => 'text' + ), + 'groupid' => array( + 'title' => 'memberlist_groupid', + 'type' => 'mselect', + 'value' => array() + ), + 'special' => array( + 'title' => 'memberlist_special', + 'type' => 'mradio', + 'value' => array( + array('', 'memberlist_special_nolimit'), + array('0', 'memberlist_special_hot'), + array('1', 'memberlist_special_default'), + ), + 'default' => '' + ), + 'gender' => array( + 'title' => 'memberlist_gender', + 'type' => 'mradio', + 'value' => array( + array('1', 'memberlist_gender_male'), + array('2', 'memberlist_gender_female'), + array('', 'memberlist_gender_nolimit'), + ), + 'default' => '' + ), + 'birthcity' => array( + 'title' => 'memberlist_birthcity', + 'type' => 'district', + 'value' => array('xbirthcountry', 'xbirthprovince', 'xbirthcity', 'xbirthdist', 'xbirthcommunity'), + ), + 'residecity' => array( + 'title' => 'memberlist_residecity', + 'type' => 'district', + 'value' => array('xresidecountry', 'xresideprovince', 'xresidecity', 'xresidedist', 'xresidecommunity') + ), + 'avatarstatus' => array( + 'title' => 'memberlist_avatarstatus', + 'type' => 'radio', + 'default' => '' + ), + 'emailstatus' => array( + 'title' => 'memberlist_emailstatus', + 'type' => 'mcheckbox', + 'value' => array( + array(1, 'memberlist_yes'), + ), + 'default' => '' + ), + 'secmobilestatus' => array( + 'title' => 'memberlist_secmobilestatus', + 'type' => 'mcheckbox', + 'value' => array( + array(1, 'memberlist_yes'), + ), + 'default' => '' + ), + 'verifystatus' => array( + 'title' => 'memberlist_verifystatus', + 'type' => 'mcheckbox', + 'value' => array(), + 'default' => '', + ), + 'orderby' => array( + 'title' => 'memberlist_orderby', + 'type' => 'mradio', + 'value' => array( + array('credits', 'memberlist_orderby_credits'), + array('extcredits', 'memberlist_orderby_extcredits'), + array('threads', 'memberlist_orderby_threads'), + array('posts', 'memberlist_orderby_posts'), + array('blogs', 'memberlist_orderby_blogs'), + array('doings', 'memberlist_orderby_doings'), + array('albums', 'memberlist_orderby_albums'), + array('sharings', 'memberlist_orderby_sharings'), + array('digestposts', 'memberlist_orderby_digestposts'), + array('regdate', 'memberlist_orderby_regdate'), + array('show', 'memberlist_orderby_show'), + array('special', 'memberlist_orderby_special'), + array('todayposts', 'memberlist_orderby_todayposts'), + ), + 'default' => 'credits' + ), + 'extcredit' => array( + 'title' => 'memberlist_orderby_extcreditselect', + 'type' => 'select', + 'value' => array() + ), + 'lastpost' => array( + 'title' => 'memberlist_lastpost', + 'type' => 'mradio', + 'value' => array( + array('', 'memberlist_lastpost_nolimit'), + array('3600', 'memberlist_lastpost_hour'), + array('86400', 'memberlist_lastpost_day'), + array('604800', 'memberlist_lastpost_week'), + array('2592000', 'memberlist_lastpost_month'), + ), + 'default' => '' + ), + 'startrow' => array( + 'title' => 'memberlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + $verifys = getglobal('setting/verify'); + if(!empty($verifys)) { + foreach($verifys as $key => $value) { + if($value['title']) { + $this->setting['verifystatus']['value'][] = array($key, $value['title']); + } + } + } + if(empty($this->setting['verifystatus']['value'])) { + unset($this->setting['verifystatus']); + } + } + + function name() { + return lang('blockclass', 'blockclass_member_script_member'); + } + + function blockclass() { + return array('member', lang('blockclass', 'blockclass_member_member')); + } + + function fields() { + global $_G; + $fields = array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'url' => array('name' => lang('blockclass', 'blockclass_member_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_member_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'avatar' => array('name' => lang('blockclass', 'blockclass_member_field_avatar'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_middle' => array('name' => lang('blockclass', 'blockclass_member_field_avatar_middle'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_big' => array('name' => lang('blockclass', 'blockclass_member_field_avatar_big'), 'formtype' => 'text', 'datatype' => 'string'), + 'regdate' => array('name' => lang('blockclass', 'blockclass_member_field_regdate'), 'formtype' => 'date', 'datatype' => 'date'), + 'posts' => array('name' => lang('blockclass', 'blockclass_member_field_posts'), 'formtype' => 'text', 'datatype' => 'int'), + 'threads' => array('name' => lang('blockclass', 'blockclass_member_field_threads'), 'formtype' => 'text', 'datatype' => 'int'), + 'digestposts' => array('name' => lang('blockclass', 'blockclass_member_field_digestposts'), 'formtype' => 'text', 'datatype' => 'int'), + 'credits' => array('name' => lang('blockclass', 'blockclass_member_field_credits'), 'formtype' => 'text', 'datatype' => 'int'), + 'reason' => array('name' => lang('blockclass', 'blockclass_member_field_reason'), 'formtype' => 'text', 'datatype' => 'string'), + 'unitprice' => array('name' => lang('blockclass', 'blockclass_member_field_unitprice'), 'formtype' => 'text', 'datatype' => 'int'), + 'showcredit' => array('name' => lang('blockclass', 'blockclass_member_field_showcredit'), 'formtype' => 'text', 'datatype' => 'int'), + 'shownote' => array('name' => lang('blockclass', 'blockclass_member_field_shownote'), 'formtype' => 'text', 'datatype' => 'string'), + ); + foreach($_G['setting']['extcredits'] as $key=>$value) { + $fields['extcredits'.$key] = array('name'=>$value['title'], 'formtype'=>'text', 'datatype'=>'int'); + } + loadcache('profilesetting'); + foreach($_G['cache']['profilesetting'] as $key=>$value) { + if($value['available']) { + $fields[$key] = array('name'=>$value['title'], 'formtype'=>'text', 'datatype'=>'string'); + } + } + return $fields; + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + if($settings['extcredit']) { + foreach($_G['setting']['extcredits'] as $id => $credit) { + $settings['extcredit']['value'][] = array($id, $credit['title']); + } + } + if($settings['groupid']) { + $settings['groupid']['value'][] = array(0, lang('portalcp', 'block_all_group')); + foreach(C::t('common_usergroup')->fetch_all_by_type(array('member', 'special')) as $value) { + $settings['groupid']['value'][] = array($value['groupid'], $value['grouptitle']); + } + } + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + + $uids = !empty($parameter['uids']) ? explode(',',$parameter['uids']) : array(); + $groupid = !empty($parameter['groupid']) && !in_array(0, $parameter['groupid']) ? $parameter['groupid'] : array(); + $startrow = !empty($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = !empty($parameter['items']) ? intval($parameter['items']) : 10; + $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'],array('credits', 'extcredits', 'threads', 'posts', 'digestposts', 'regdate', 'show', 'blogs', 'albums', 'doings', 'sharings', 'special', 'todayposts')) ? $parameter['orderby'] : ''; + $special = isset($parameter['special']) && strlen($parameter['special']) ? intval($parameter['special']) : null; + $lastpost = !empty($parameter['lastpost']) ? intval($parameter['lastpost']) : ''; + $avatarstatus = !empty($parameter['avatarstatus']) ? 1 : 0; + $emailstatus = !empty($parameter['emailstatus']) ? 1 : 0; + $secmobilestatus = !empty($parameter['secmobilestatus']) ? 1 : 0; + $verifystatus = !empty($parameter['verifystatus']) ? $parameter['verifystatus'] : array(); + $profiles = array(); + $profiles['gender'] = !empty($parameter['gender']) ? intval($parameter['gender']) : 0; + $profiles['residecountry'] = !empty($parameter['xresidecountry']) ? $parameter['xresidecountry'] : ''; + $profiles['resideprovince'] = !empty($parameter['xresideprovince']) ? $parameter['xresideprovince'] : ''; + $profiles['residecity'] = !empty($parameter['xresidecity']) ? $parameter['xresidecity'] : ''; + $profiles['residedist'] = !empty($parameter['xresidedist']) ? $parameter['xresidedist'] : ''; + $profiles['residecommunity'] = !empty($parameter['xresidecommunity']) ? $parameter['xresidecommunity'] : ''; + $profiles['birthcountry'] = !empty($parameter['xbirthcountry']) ? $parameter['xbirthcountry'] : ''; + $profiles['birthprovince'] = !empty($parameter['xbirthprovince']) ? $parameter['xbirthprovince'] : ''; + $profiles['birthcity'] = !empty($parameter['xbirthcity']) ? $parameter['xbirthcity'] : ''; + + $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array(); + + $list = $todayuids = $todayposts = array(); + $tables = $wheres = array(); + $sqlorderby = ''; + $olditems = $items; + $tables[] = DB::table('common_member').' m'; + if($groupid) { + $wheres[] = 'm.groupid IN ('.dimplode($groupid).')'; + } + if($bannedids) { + $wheres[] = 'm.uid NOT IN ('.dimplode($bannedids).')'; + } + if($avatarstatus) { + $wheres[] = "m.avatarstatus='1'"; + } + if($emailstatus) { + $wheres[] = "m.emailstatus='1'"; + } + if($secmobilestatus) { + $wheres[] = "m.secmobilestatus='1'"; + } + if(!empty($verifystatus)) { + $flag = false; + foreach($verifystatus as $value) { + if(isset($_G['setting']['verify'][$value])) { + $flag = true; + $wheres[] = "cmv.verify$value='1'"; + } + } + if($flag) { + $tables[] = DB::table('common_member_verify').' cmv'; + $wheres[] = 'cmv.uid=m.uid'; + } + } + $tables[] = DB::table('common_member_count').' mc'; + $wheres[] = 'mc.uid=m.uid'; + foreach($profiles as $key=>$value) { + if($value) { + $tables[] = DB::table('common_member_profile').' mp'; + $wheres[] = 'mp.uid=m.uid'; + $wheres[] = "mp.$key='$value'"; + } + } + + $reason = $show = ''; + if($special !== null) { + $special = in_array($special, array(-1, 0, 1)) ? $special : -1; + $tables[] = DB::table('home_specialuser').' su'; + if($special != -1) { + $wheres[] = "su.status='$special'"; + } + $wheres[] = 'su.uid=m.uid'; + $reason = ', su.reason'; + } + if($lastpost && $orderby != 'todayposts') { + $time = TIMESTAMP - $lastpost; + $tables[] = DB::table('common_member_status')." ms"; + $wheres[] = "ms.uid=m.uid"; + $wheres[] = "ms.lastpost>'$time'"; + } + switch($orderby) { + case 'credits': + case 'regdate': + $sqlorderby = " ORDER BY m.$orderby DESC"; + break; + case 'extcredits': + $extcredits = 'extcredits'.(in_array($parameter['extcredit'], range(1, 8)) ? $parameter['extcredit'] : '1'); + $sqlorderby = " ORDER BY mc.$extcredits DESC"; + break; + case 'threads': + case 'posts': + case 'blogs': + case 'albums': + case 'doings': + case 'sharings': + case 'digestposts': + $sqlorderby = " ORDER BY mc.$orderby DESC"; + break; + case 'show': + $show = ', s.unitprice, s.credit as showcredit, s.note as shownote'; + $tables[] = DB::table('home_show')." s"; + $wheres[] = 's.uid=m.uid'; + $sqlorderby = ' ORDER BY s.unitprice DESC, s.credit DESC'; + break; + case 'special': + $sqlorderby = $special !== null ? ' ORDER BY su.displayorder, dateline DESC' : ''; + break; + case 'todayposts': + $todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd')); + $inuids = $uids ? ' AND uid IN ('.dimplode($uids).')' : ''; + $items = $items * 5; + $query = DB::query('SELECT uid, count(*) as sum FROM '.DB::table('common_member_action_log')." + WHERE dateline>=$todaytime AND action='".getuseraction('pid')."'$inuids GROUP BY uid ORDER BY sum DESC LIMIT $items"); + while($value = DB::fetch($query)) { + $todayposts[$value['uid']] = $value['sum']; + $todayuids[] = $value['uid']; + } + if(empty($todayuids)) { + $todayuids = array(0); + } + $uids = $todayuids; + break; + } + + if($uids) { + $wheres[] = 'm.uid IN ('.dimplode($uids).')'; + } + $wheres[] = '(m.groupid < 4 OR m.groupid > 8)'; + + $tables = array_unique($tables); + $wheres = array_unique($wheres); + $tablesql = implode(',',$tables); + $wheresql = implode(' AND ',$wheres); + $query = DB::query("SELECT m.*, mc.*$reason$show FROM $tablesql WHERE $wheresql $sqlorderby LIMIT $startrow,$items"); + $resultuids = array(); + while($data = DB::fetch($query)){ + $resultuids[] = intval($data['uid']); + $list[] = array( + 'id' => $data['uid'], + 'idtype' => 'uid', + 'title' => $data['username'], + 'url' => 'home.php?mod=space&uid='.$data['uid'], + 'pic' => '', + 'picflag' => 0, + 'summary' => '', + 'fields' => array( + 'avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']), + 'credits' => $data['credits'], + 'extcredits1' => $data['extcredits1'], + 'extcredits2' => $data['extcredits2'], + 'extcredits3' => $data['extcredits3'], + 'extcredits4' => $data['extcredits4'], + 'extcredits5' => $data['extcredits5'], + 'extcredits6' => $data['extcredits6'], + 'extcredits7' => $data['extcredits7'], + 'extcredits8' => $data['extcredits8'], + 'regdate' => $data['regdate'], + 'posts' => empty($todayposts[$data['uid']]) ? $data['posts'] : $todayposts[$data['uid']], + 'threads' => $data['threads'], + 'digestposts' => $data['digestposts'], + 'reason' => isset($data['reason']) ? $data['reason'] : '', + 'unitprice' => isset($data['unitprice']) ? $data['unitprice'] : '', + 'showcredit' => isset($data['showcredit']) ? $data['showcredit'] : '', + 'shownote' => isset($data['shownote']) ? $data['shownote'] : '', + ) + ); + } + if($resultuids) { + include_once libfile('function/profile'); + $profiles = array(); + $query = DB::query('SELECT * FROM '.DB::table('common_member_profile')." WHERE uid IN (".dimplode($resultuids).")"); + while($data = DB::fetch($query)) { + $profile = array(); + foreach($data as $fieldid=>$fieldvalue) { + $fieldvalue = profile_show($fieldid, $data, true); + if(false !== $fieldvalue) { + $profile[$fieldid] = $fieldvalue; + } + } + $profiles[$data['uid']] = $profile; + } + for($i=0,$L=count($list); $i<$L; $i++) { + $uid = $list[$i]['id']; + if($profiles[$uid]) { + $list[$i]['fields'] = array_merge($list[$i]['fields'], $profiles[$uid]); + } + } + + if(!empty($todayuids)) { + $datalist = array(); + foreach($todayuids as $uid) { + foreach($list as $user) { + if($user['id'] == $uid) { + $datalist[] = $user; + break; + } + } + if(count($datalist) >= $olditems) { + break; + } + } + $list = $datalist; + } + } + return array('html' => '', 'data' => $list); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/member/block_membercredit.php b/source/class/block/member/block_membercredit.php new file mode 100644 index 0000000..4a23a02 --- /dev/null +++ b/source/class/block/member/block_membercredit.php @@ -0,0 +1,46 @@ +setting = array( + 'orderby' => array( + 'title' => 'memberlist_orderby', + 'type' => 'mradio', + 'value' => array( + array('credits', 'memberlist_orderby_credits'), + array('extcredits', 'memberlist_orderby_extcredits'), + ), + 'default' => 'credits' + ), + 'extcredit' => array( + 'title' => 'memberlist_orderby_extcreditselect', + 'type' => 'select', + 'value' => array() + ), + 'startrow' => array( + 'title' => 'memberlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_member_script_membercredit'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/member/block_membernew.php b/source/class/block/member/block_membernew.php new file mode 100644 index 0000000..71551a9 --- /dev/null +++ b/source/class/block/member/block_membernew.php @@ -0,0 +1,62 @@ +setting = array( + 'gender' => array( + 'title' => 'memberlist_gender', + 'type' => 'mradio', + 'value' => array( + array('1', 'memberlist_gender_male'), + array('2', 'memberlist_gender_female'), + array('', 'memberlist_gender_nolimit'), + ), + 'default' => '' + ), + 'birthcity' => array( + 'title' => 'memberlist_birthcity', + 'type' => 'district', + 'value' => array('xbirthcountry', 'xbirthprovince', 'xbirthcity', 'xbirthdist', 'xbirthcommunity'), + ), + 'residecity' => array( + 'title' => 'memberlist_residecity', + 'type' => 'district', + 'value' => array('xresidecountry', 'xresideprovince', 'xresidecity', 'xresidedist', 'xresidecommunity') + ), + 'avatarstatus' => array( + 'title' => 'memberlist_avatarstatus', + 'type' => 'radio', + 'default' => '' + ), + 'startrow' => array( + 'title' => 'memberlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_member_script_membernew'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'regdate'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/member/block_memberposts.php b/source/class/block/member/block_memberposts.php new file mode 100644 index 0000000..c76a478 --- /dev/null +++ b/source/class/block/member/block_memberposts.php @@ -0,0 +1,54 @@ +setting = array( + 'orderby' => array( + 'title' => 'memberlist_orderby', + 'type' => 'mradio', + 'value' => array( + array('threads', 'memberlist_orderby_threads'), + array('posts', 'memberlist_orderby_posts'), + array('digestposts', 'memberlist_orderby_digestposts'), + ), + 'default' => 'threads' + ), + 'lastpost' => array( + 'title' => 'memberlist_lastpost', + 'type' => 'mradio', + 'value' => array( + array('', 'memberlist_lastpost_nolimit'), + array('3600', 'memberlist_lastpost_hour'), + array('86400', 'memberlist_lastpost_day'), + array('604800', 'memberlist_lastpost_week'), + array('2592000', 'memberlist_lastpost_month'), + ), + 'default' => '' + ), + 'startrow' => array( + 'title' => 'memberlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_member_script_memberposts'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/member/block_membershow.php b/source/class/block/member/block_membershow.php new file mode 100644 index 0000000..1060d8a --- /dev/null +++ b/source/class/block/member/block_membershow.php @@ -0,0 +1,37 @@ +setting = array( + 'startrow' => array( + 'title' => 'memberlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'show'; + return parent::cookparameter($parameter); + } + + function name() { + return lang('blockclass', 'blockclass_member_script_membershow'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/member/block_memberspecial.php b/source/class/block/member/block_memberspecial.php new file mode 100644 index 0000000..0a542a5 --- /dev/null +++ b/source/class/block/member/block_memberspecial.php @@ -0,0 +1,52 @@ +setting = array( + 'special' => array( + 'title' => 'memberlist_special', + 'type' => 'mradio', + 'value' => array( + array('', 'memberlist_special_nolimit'), + array('0', 'memberlist_special_hot'), + array('1', 'memberlist_special_default'), + ), + 'default' => '' + ), + 'startrow' => array( + 'title' => 'memberlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_member_script_memberspecial'); + } + + function cookparameter($parameter) { + if($parameter['special'] === '') { + $parameter['special'] = -1; + } else { + $parameter['special'] = intval($parameter['special']); + } + $parameter['orderby'] = 'special'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/member/block_memberspecified.php b/source/class/block/member/block_memberspecified.php new file mode 100644 index 0000000..6149d8c --- /dev/null +++ b/source/class/block/member/block_memberspecified.php @@ -0,0 +1,46 @@ +setting = array( + 'uids' => array( + 'title' => 'memberlist_uids', + 'type' => 'text' + ), + 'groupid' => array( + 'title' => 'memberlist_groupid', + 'type' => 'mselect', + 'value' => array() + ), + 'special' => array( + 'title' => 'memberlist_special', + 'type' => 'mradio', + 'value' => array( + array('', 'memberlist_special_nolimit'), + array('0', 'memberlist_special_hot'), + array('1', 'memberlist_special_default'), + ), + 'default' => '' + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_member_script_memberspecified'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/member/blockclass.php b/source/class/block/member/blockclass.php new file mode 100644 index 0000000..42a57c0 --- /dev/null +++ b/source/class/block/member/blockclass.php @@ -0,0 +1,19 @@ + lang('blockclass', 'blockclass_member'), +); + + +?> \ No newline at end of file diff --git a/source/class/block/member/index.htm b/source/class/block/member/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/block/other/block_otherfriendlink.php b/source/class/block/other/block_otherfriendlink.php new file mode 100644 index 0000000..abf0c5b --- /dev/null +++ b/source/class/block/other/block_otherfriendlink.php @@ -0,0 +1,100 @@ +setting = array( + 'type' => array( + 'title' => 'friendlink_type', + 'type' => 'mcheckbox', + 'value' => array( + array('1', 'friendlink_type_group1'), + array('2', 'friendlink_type_group2'), + array('3', 'friendlink_type_group3'), + array('4', 'friendlink_type_group4'), + ), + 'default' => array('1','2','3','4') + ), + 'titlelength' => array( + 'title' => 'friendlink_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'friendlink_summarylength', + 'type' => 'text', + 'default' => 80 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_other_script_friendlink'); + } + + function blockclass() { + return array('otherfriendlink', lang('blockclass', 'blockclass_other_friendlink')); + } + + function fields() { + return array( + 'url' => array('name' => lang('blockclass', 'blockclass_other_friendlink_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_other_friendlink_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'pic' => array('name' => lang('blockclass', 'blockclass_other_friendlink_field_pic'), 'formtype' => 'pic', 'datatype' => 'pic'), + 'summary' => array('name' => lang('blockclass', 'blockclass_other_friendlink_field_summary'), 'formtype' => 'summary', 'datatype' => 'summary'), + ); + } + + function getsetting() { + return $this->setting; + } + + function getdata($style, $parameter) { + + $parameter = $this->cookparameter($parameter); + $titlelength = isset($parameter['titlelength']) ? intval($parameter['titlelength']) : 40; + $summarylength = isset($parameter['summarylength']) ? intval($parameter['summarylength']) : 80; + $type = !empty($parameter['type']) && is_array($parameter['type']) ? $parameter['type'] : array(); + $b = '0000'; + for($i=1;$i<=4;$i++) { + if(in_array($i, $type)) { + $b[$i-1] = '1'; + } + } + $type = intval($b, '2'); + $list = array(); + $query = C::t('common_friendlink')->fetch_all_by_displayorder($type); + foreach ($query as $data) { + $list[] = array( + 'id' => $data['id'], + 'idtype' => 'flid', + 'title' => cutstr($data['name'], $titlelength), + 'url' => $data['url'], + 'pic' => $data['logo'] ? $data['logo'] : $_G['style']['imgdir'].'/nophoto.gif', + 'picflag' => '0', + 'summary' => $data['description'], + 'fields' => array( + 'fulltitle' => $data['name'], + ) + ); + } + return array('html' => '', 'data' => $list); + } +} + + + +?> \ No newline at end of file diff --git a/source/class/block/other/block_otherstat.php b/source/class/block/other/block_otherstat.php new file mode 100644 index 0000000..866a7c1 --- /dev/null +++ b/source/class/block/other/block_otherstat.php @@ -0,0 +1,250 @@ + array('name' => lang('blockclass', 'blockclass_other_stat_posts'), 'formtype' => 'text', 'datatype' => 'int'), + 'posts_title' => array('name' => lang('blockclass', 'blockclass_other_stat_posts_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'groups' => array('name' => lang('blockclass', 'blockclass_other_stat_groups'), 'formtype' => 'text', 'datatype' => 'int'), + 'groups_title' => array('name' => lang('blockclass', 'blockclass_other_stat_groups_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'members' => array('name' => lang('blockclass', 'blockclass_other_stat_members'), 'formtype' => 'text', 'datatype' => 'int'), + 'members_title' => array('name' => lang('blockclass', 'blockclass_other_stat_members_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'groupnewposts' => array('name' => lang('blockclass', 'blockclass_other_stat_groupnewposts'), 'formtype' => 'text', 'datatype' => 'int'), + 'groupnewposts_title' => array('name' => lang('blockclass', 'blockclass_other_stat_groupnewposts_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'bbsnewposts' => array('name' => lang('blockclass', 'blockclass_other_stat_bbsnewposts'), 'formtype' => 'text', 'datatype' => 'int'), + 'bbsnewposts_title' => array('name' => lang('blockclass', 'blockclass_other_stat_bbsnewposts_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'bbslastposts' => array('name' => lang('blockclass', 'blockclass_other_stat_bbslastposts'), 'formtype' => 'text', 'datatype' => 'int'), + 'bbslastposts_title' => array('name' => lang('blockclass', 'blockclass_other_stat_bbslastposts_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'onlinemembers' => array('name' => lang('blockclass', 'blockclass_other_stat_onlinemembers'), 'formtype' => 'text', 'datatype' => 'int'), + 'onlinemembers_title' => array('name' => lang('blockclass', 'blockclass_other_stat_onlinemembers_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'maxmembers' => array('name' => lang('blockclass', 'blockclass_other_stat_maxmembers'), 'formtype' => 'text', 'datatype' => 'int'), + 'maxmembers_title' => array('name' => lang('blockclass', 'blockclass_other_stat_maxmembers_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'doings' => array('name' => lang('blockclass', 'blockclass_other_stat_doings'), 'formtype' => 'text', 'datatype' => 'int'), + 'doings_title' => array('name' => lang('blockclass', 'blockclass_other_stat_doings_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'blogs' => array('name' => lang('blockclass', 'blockclass_other_stat_blogs'), 'formtype' => 'text', 'datatype' => 'int'), + 'blogs_title' => array('name' => lang('blockclass', 'blockclass_other_stat_blogs_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'albums' => array('name' => lang('blockclass', 'blockclass_other_stat_albums'), 'formtype' => 'text', 'datatype' => 'int'), + 'albums_title' => array('name' => lang('blockclass', 'blockclass_other_stat_albums_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'pics' => array('name' => lang('blockclass', 'blockclass_other_stat_pics'), 'formtype' => 'text', 'datatype' => 'int'), + 'pics_title' => array('name' => lang('blockclass', 'blockclass_other_stat_pics_title'), 'formtype' => 'text', 'datatype' => 'string'), + 'shares' => array('name' => lang('blockclass', 'blockclass_other_stat_shares'), 'formtype' => 'text', 'datatype' => 'int'), + 'shares_title' => array('name' => lang('blockclass', 'blockclass_other_stat_shares_title'), 'formtype' => 'text', 'datatype' => 'string'), + ); + } + function getsetting() { + global $_G; + $settings = array( + 'option' => array( + 'title' => 'stat_option', + 'type' => 'mcheckbox', + 'value' => array( + array('posts', 'stat_option_posts'), + array('groups', 'stat_option_groups'), + array('members', 'stat_option_members'), + array('groupnewposts', 'stat_option_groupnewposts'), + array('bbsnewposts', 'stat_option_bbsnewposts'), + array('bbslastposts', 'stat_option_bbslastposts'), + array('onlinemembers', 'stat_option_onlinemembers'), + array('maxmembers', 'stat_option_maxmembers'), + array('doings', 'stat_option_doings'), + array('blogs', 'stat_option_blogs'), + array('albums', 'stat_option_albums'), + array('pics', 'stat_option_pics'), + array('shares', 'stat_option_shares'), + ), + 'default' => array('posts', 'groups', 'members') + ), + 'tip' => array( + 'title' => 'stat_edit_showtitle', + 'type' => lang('block/stat', 'stat_edit_showtitle_detail'), + ), + 'posts_title' => array( + 'title' => 'stat_option_posts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_posts') + ), + 'groups_title' => array( + 'title' => 'stat_option_groups', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_groups') + ), + 'members_title' => array( + 'title' => 'stat_option_members', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_members') + ), + 'groupnewposts_title' => array( + 'title' => 'stat_option_groupnewposts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_groupnewposts') + ), + 'bbsnewposts_title' => array( + 'title' => 'stat_option_bbsnewposts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_bbsnewposts') + ), + 'bbslastposts_title' => array( + 'title' => 'stat_option_bbslastposts', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_bbslastposts') + ), + 'onlinemembers_title' => array( + 'title' => 'stat_option_onlinemembers', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_onlinemembers') + ), + 'maxmembers_title' => array( + 'title' => 'stat_option_maxmembers', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_maxmembers') + ), + 'doings_title' => array( + 'title' => 'stat_option_doings', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_doings') + ), + 'blogs_title' => array( + 'title' => 'stat_option_blogs', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_blogs') + ), + 'albums_title' => array( + 'title' => 'stat_option_albums', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_albums') + ), + 'pics_title' => array( + 'title' => 'stat_option_pics', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_pics') + ), + 'shares_title' => array( + 'title' => 'stat_option_shares', + 'type' => 'text', + 'default' => lang('block/stat', 'stat_shares') + ), + ); + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + $parameter = $this->cookparameter($parameter); + $fields = array( + 'posts' => 0, + 'posts_title' => !empty($parameter['posts_title']) ? $parameter['posts_title'] : lang('block/stat', 'stat_posts'), + 'groups' => 0, + 'groups_title' => !empty($parameter['groups_title']) ? $parameter['groups_title'] : lang('block/stat', 'stat_groups'), + 'members' => 0, + 'members_title' => !empty($parameter['members_title']) ? $parameter['members_title'] : lang('block/stat', 'stat_members'), + 'groupnewposts' => 0, + 'groupnewposts_title' => !empty($parameter['groupnewposts_title']) ? $parameter['groupnewposts_title'] : lang('block/stat', 'stat_groupnewposts'), + 'bbsnewposts' => 0, + 'bbsnewposts_title' => !empty($parameter['bbsnewposts_title']) ? $parameter['bbsnewposts_title'] : lang('block/stat', 'stat_bbsnewposts'), + 'bbslastposts' => 0, + 'bbslastposts_title' => !empty($parameter['bbslastposts_title']) ? $parameter['bbslastposts_title'] : lang('block/stat', 'stat_bbslastposts'), + 'onlinemembers' => 0, + 'onlinemembers_title' => !empty($parameter['onlinemembers_title']) ? $parameter['onlinemembers_title'] : lang('block/stat', 'stat_onlinemembers'), + 'maxmembers' => 0, + 'maxmembers_title' => !empty($parameter['maxmembers_title']) ? $parameter['maxmembers_title'] : lang('block/stat', 'stat_maxmembers'), + 'doings' => 0, + 'doings_title' => !empty($parameter['doings_title']) ? $parameter['doings_title'] : lang('block/stat', 'stat_doings'), + 'blogs' => 0, + 'blogs_title' => !empty($parameter['blogs_title']) ? $parameter['blogs_title'] : lang('block/stat', 'stat_blogs'), + 'albums' => 0, + 'albums_title' => !empty($parameter['albums_title']) ? $parameter['albums_title'] : lang('block/stat', 'stat_albums'), + 'pics' => 0, + 'pics_title' => !empty($parameter['pics_title']) ? $parameter['pics_title'] : lang('block/stat', 'stat_pics'), + 'shares' => 0, + 'shares_title' => !empty($parameter['shares_title']) ? $parameter['shares_title'] : lang('block/stat', 'stat_shares'), + ); + if(in_array('posts', $parameter['option']) || in_array('bbsnewposts', $parameter['option'])) { + $sql = "SELECT sum(f.posts) AS posts, sum(f.todayposts) AS todayposts FROM ".DB::table('forum_forum')." f WHERE f.status='1'"; + $forum = DB::fetch_first($sql); + } + if(in_array('groups', $parameter['option']) || in_array('groupnewposts', $parameter['option'])) { + loadcache('groupindex'); + } + if(in_array('posts', $parameter['option'])) { + $fields['posts'] = intval($forum['posts']); + } + if(in_array('groups', $parameter['option'])) { + $fields['groups'] = intval($_G['cache']['groupindex']['groupnum']); + } + if(in_array('members', $parameter['option'])) { + loadcache('userstats'); + $fields['members'] = intval($_G['cache']['userstats']['totalmembers']); + } + if(in_array('groupnewposts', $parameter['option'])) { + $fields['groupnewposts'] = intval($_G['cache']['groupindex']['todayposts']); + } + if(in_array('bbsnewposts', $parameter['option'])) { + $fields['bbsnewposts'] = intval($forum['todayposts']); + } + if(in_array('bbslastposts', $parameter['option'])) { + loadcache('historyposts'); + $postdata = $_G['cache']['historyposts'] ? explode("\t", $_G['cache']['historyposts']) : array(); + $fields['bbslastposts'] = intval($postdata[0]); + } + if(in_array('onlinemembers', $parameter['option'])) { + $num = !empty($_G['cookie']['onlineusernum']) ? intval($_G['cookie']['onlineusernum']) : C::app()->session->count(); + $fields['onlinemembers'] = intval($num); + } + if(in_array('maxmembers', $parameter['option'])) { + loadcache('onlinerecord'); + $onlineinfo = explode("\t", $_G['cache']['onlinerecord']); + $fields['maxmembers'] = !empty($onlineinfo[0]) ? intval($onlineinfo[0]) : 0; + } + if(in_array('doings', $parameter['option'])) { + $num = C::t('home_doing')->count(); + $fields['doings'] = intval($num); + } + if(in_array('blogs', $parameter['option'])) { + $num = C::t('home_blog')->count(); + $fields['blogs'] = intval($num); + } + if(in_array('albums', $parameter['option'])) { + $num = C::t('home_album')->count(); + $fields['albums'] = intval($num); + } + if(in_array('pics', $parameter['option'])) { + $num = C::t('home_pic')->count(); + $fields['pics'] = intval($num); + } + if(in_array('shares', $parameter['option'])) { + $num = C::t('home_share')->count(); + $fields['shares'] = intval($num); + } + $list = array(); + $list[1] = array( + 'id' => 1, + 'idtype' => 'statid', + 'fields' => $fields + ); + return array('html' => '', 'data' => $list); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/other/blockclass.php b/source/class/block/other/blockclass.php new file mode 100644 index 0000000..9eb2d65 --- /dev/null +++ b/source/class/block/other/blockclass.php @@ -0,0 +1,19 @@ + lang('blockclass', 'blockclass_other'), +); + + +?> \ No newline at end of file diff --git a/source/class/block/other/index.htm b/source/class/block/other/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/block/portal/block_article.php b/source/class/block/portal/block_article.php new file mode 100644 index 0000000..859ab1c --- /dev/null +++ b/source/class/block/portal/block_article.php @@ -0,0 +1,347 @@ +setting = array( + 'aids' => array( + 'title' => 'articlelist_aids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'articlelist_uids', + 'type' => 'text', + 'value' => '' + ), + 'keyword' => array( + 'title' => 'articlelist_keyword', + 'type' => 'text' + ), + 'catid' => array( + 'title' => 'articlelist_catid', + 'type' => 'mselect', + 'value' => array( + ), + ), + 'tag' => array( + 'title' => 'articlelist_tag', + 'type' => 'mcheckbox', + 'value' => array( + ), + ), + 'picrequired' => array( + 'title' => 'articlelist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'starttime' => array( + 'title' => 'articlelist_starttime', + 'type' => 'calendar', + 'default' => '' + ), + 'endtime' => array( + 'title' => 'articlelist_endtime', + 'type' => 'calendar', + 'default' => '' + ), + 'orderby' => array( + 'title' => 'articlelist_orderby', + 'type' => 'mradio', + 'value' => array( + array('dateline', 'articlelist_orderby_dateline'), + array('viewnum', 'articlelist_orderby_viewnum'), + array('commentnum', 'articlelist_orderby_commentnum'), + ), + 'default' => 'dateline' + ), + 'publishdateline' => array( + 'title' => 'articlelist_publishdateline', + 'type'=> 'mradio', + 'value' => array( + array('0', 'articlelist_publishdateline_nolimit'), + array('3600', 'articlelist_publishdateline_hour'), + array('86400', 'articlelist_publishdateline_day'), + array('604800', 'articlelist_publishdateline_week'), + array('2592000', 'articlelist_publishdateline_month'), + ), + 'default' => '0' + ), + 'titlelength' => array( + 'title' => 'articlelist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'articlelist_summarylength', + 'type' => 'text', + 'default' => 80 + ), + 'startrow' => array( + 'title' => 'articlelist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + loadcache('click'); + $clicks = !empty($_G['cache']['click']['aid']) ? $_G['cache']['click']['aid'] : array(); + if(!empty($clicks)){ + foreach($clicks as $key => $value) { + if($value['available']) { + $this->setting['orderby']['value'][] = array('click'.$key, lang('block/articlelist', 'articlelist_orderby_click', array('clickname'=>$value['name']))); + } + } + } + } + + function name() { + return lang('blockclass', 'blockclass_article_script_article'); + } + + function blockclass() { + return array('article', lang('blockclass', 'blockclass_portal_article')); + } + + function fields() { + return array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'uid' => array('name' => lang('blockclass', 'blockclass_article_field_uid'), 'formtype' => 'text', 'datatype' => 'int'), + 'username' => array('name' => lang('blockclass', 'blockclass_article_field_username'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar' => array('name' => lang('blockclass', 'blockclass_article_field_avatar'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_middle' => array('name' => lang('blockclass', 'blockclass_article_field_avatar_middle'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_big' => array('name' => lang('blockclass', 'blockclass_article_field_avatar_big'), 'formtype' => 'text', 'datatype' => 'string'), + 'url' => array('name' => lang('blockclass', 'blockclass_article_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_article_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'fromurl' => array('name' => lang('blockclass', 'blockclass_article_field_fromurl'), 'formtype' => 'text', 'datatype' => 'string'), + 'from' => array('name' => lang('blockclass', 'blockclass_article_field_from'), 'formtype' => 'text', 'datatype' => 'string'), + 'pic' => array('name' => lang('blockclass', 'blockclass_article_field_pic'), 'formtype' => 'pic', 'datatype' => 'pic'), + 'summary' => array('name' => lang('blockclass', 'blockclass_article_field_summary'), 'formtype' => 'summary', 'datatype' => 'summary'), + 'dateline' => array('name' => lang('blockclass', 'blockclass_article_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'), + 'caturl' => array('name' => lang('blockclass', 'blockclass_article_field_caturl'), 'formtype' => 'text', 'datatype' => 'string'), + 'catname' => array('name' => lang('blockclass', 'blockclass_article_field_catname'), 'formtype' => 'text', 'datatype' => 'string'), + 'articles' => array('name' => lang('blockclass', 'blockclass_article_field_articles'), 'formtype' => 'text', 'datatype' => 'int'), + 'viewnum' => array('name' => lang('blockclass', 'blockclass_article_field_viewnum'), 'formtype' => 'text', 'datatype' => 'int'), + 'commentnum' => array('name' => lang('blockclass', 'blockclass_article_field_commentnum'), 'formtype' => 'text', 'datatype' => 'int'), + ); + } + + function fieldsconvert() { + return array( + 'forum_thread' => array( + 'name' => lang('blockclass', 'blockclass_forum_thread'), + 'script' => 'thread', + 'searchkeys' => array('username', 'uid', 'caturl', 'catname', 'articles', 'viewnum', 'commentnum'), + 'replacekeys' => array('author', 'authorid', 'forumurl', 'forumname', 'posts', 'views', 'replies'), + ), + 'group_thread' => array( + 'name' => lang('blockclass', 'blockclass_group_thread'), + 'script' => 'groupthread', + 'searchkeys' => array('username', 'uid', 'caturl', 'catname', 'articles', 'viewnum', 'commentnum'), + 'replacekeys' => array('author', 'authorid', 'groupurl', 'groupname', 'posts', 'views', 'replies'), + ), + 'space_blog' => array( + 'name' => lang('blockclass', 'blockclass_space_blog'), + 'script' => 'blog', + 'searchkeys' => array('commentnum'), + 'replacekeys' => array('replynum'), + ), + ); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + if($settings['catid']) { + $settings['catid']['value'][] = array(0, lang('portalcp', 'block_all_category')); + loadcache('portalcategory'); + foreach($_G['cache']['portalcategory'] as $value) { + if($value['level'] == 0) { + $settings['catid']['value'][] = array($value['catid'], $value['catname']); + if($value['children']) { + foreach($value['children'] as $catid2) { + $value2 = $_G['cache']['portalcategory'][$catid2]; + $settings['catid']['value'][] = array($value2['catid'], '-- '.$value2['catname']); + if($value2['children']) { + foreach($value2['children'] as $catid3) { + $value3 = $_G['cache']['portalcategory'][$catid3]; + $settings['catid']['value'][] = array($value3['catid'], '---- '.$value3['catname']); + } + } + } + } + } + } + } + if($settings['tag']) { + $tagnames = article_tagnames(); + foreach($tagnames as $k=>$v) { + $settings['tag']['value'][] = array($k, $v); + } + } + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + require_once libfile('function/portal'); + + $parameter = $this->cookparameter($parameter); + $aids = !empty($parameter['aids']) ? explode(',', $parameter['aids']) : array(); + $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array(); + $keyword = !empty($parameter['keyword']) ? $parameter['keyword'] : ''; + $tag = !empty($parameter['tag']) ? $parameter['tag'] : array(); + $starttime = !empty($parameter['starttime']) ? strtotime($parameter['starttime']) : 0; + $endtime = !empty($parameter['endtime']) ? strtotime($parameter['endtime']) : 0; + $publishdateline = isset($parameter['publishdateline']) ? intval($parameter['publishdateline']) : 0; + $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = isset($parameter['items']) ? intval($parameter['items']) : 10; + $titlelength = isset($parameter['titlelength']) ? intval($parameter['titlelength']) : 40; + $summarylength = isset($parameter['summarylength']) ? intval($parameter['summarylength']) : 80; + $clickarr = array('click1', 'click2', 'click3', 'click4', 'click5', 'click6', 'click7', 'click8'); + $orderby = in_array($parameter['orderby'], array_merge(array('dateline', 'viewnum', 'commentnum'), $clickarr)) ? $parameter['orderby'] : 'dateline'; + $catid = array(); + if(!empty($parameter['catid'])) { + if($parameter['catid'][0] == '0') { + unset($parameter['catid'][0]); + } + $catid = $parameter['catid']; + } + + $picrequired = !empty($parameter['picrequired']) ? 1 : 0; + + $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array(); + + loadcache('portalcategory'); + + $list = array(); + $wheres = array(); + + if($aids) { + $wheres[] = 'at.aid IN ('.dimplode($aids).')'; + } + if($uids) { + $wheres[] = 'at.uid IN ('.dimplode($uids).')'; + } + if($catid) { + include_once libfile('function/portalcp'); + $childids = array(); + foreach($catid as $id) { + if($_G['cache']['portalcategory'][$id]['disallowpublish']) { + $childids = array_merge($childids, category_get_childids('portal', $id)); + } + } + $catid = array_merge($catid, $childids); + $catid = array_unique($catid); + $wheres[] = 'at.catid IN ('.dimplode($catid).')'; + } + if(!$aids && !$catid && $_G['setting']['blockmaxaggregationitem']) { + if(($maxid = $this->getmaxid() - $_G['setting']['blockmaxaggregationitem'] ) > 0) { + $wheres[] = 'at.aid > '.$maxid; + } + } + if(empty($aids) && ($picrequired)) { + $wheres[] = "at.pic != ''"; + } + if($publishdateline) { + $time = TIMESTAMP - $publishdateline; + $wheres[] = "at.dateline >= '$time'"; + } + if($starttime) { + $wheres[] = "at.dateline >= '$starttime'"; + } + if($endtime) { + $wheres[] = "at.dateline <= '$endtime'"; + } + if($bannedids) { + $wheres[] = 'at.aid NOT IN ('.dimplode($bannedids).')'; + } + $wheres[] = "at.status='0'"; + if(is_array($tag)) { + $article_tags = array(); + foreach($tag as $k) { + $article_tags[$k] = 1; + } + include_once libfile('function/portalcp'); + $v=article_make_tag($article_tags); + if($v > 0) { + $wheres[] = "(at.tag & $v) = $v"; + } + } + if($keyword) { + require_once libfile('function/search'); + $keyword = searchkey($keyword, "at.title LIKE '%{text}%'"); + } + + $wheresql = $wheres ? implode(' AND ', $wheres) : '1'; + if(in_array($orderby, $clickarr)) { + $orderby = "at.$orderby DESC,at.dateline DESC"; + } else { + $orderby = ($orderby == 'dateline') ? 'at.dateline DESC ' : "ac.$orderby DESC"; + } + $query = DB::query("SELECT at.*, ac.viewnum, ac.commentnum FROM ".DB::table('portal_article_title')." at LEFT JOIN ".DB::table('portal_article_count')." ac ON at.aid=ac.aid WHERE $wheresql$keyword ORDER BY $orderby LIMIT $startrow, $items"); + while($data = DB::fetch($query)) { + if(empty($data['pic'])) { + $data['pic'] = STATICURL.'image/common/nophoto.gif'; + $data['picflag'] = '0'; + } else { + $data['pic'] = $data['pic']; + $data['picflag'] = $data['remote'] == '1' ? '2' : '1'; + } + $list[] = array( + 'id' => $data['aid'], + 'idtype' => 'aid', + 'title' => cutstr($data['title'], $titlelength, ''), + 'url' => fetch_article_url($data), + 'pic' => $data['pic'], + 'picflag' => $data['picflag'], + 'summary' => cutstr(strip_tags($data['summary']), $summarylength, ''), + 'fields' => array( + 'uid'=>$data['uid'], + 'username'=>$data['username'], + 'avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']), + 'fulltitle' => $data['title'], + 'dateline'=>$data['dateline'], + 'caturl'=> $_G['cache']['portalcategory'][$data['catid']]['caturl'], + 'catname' => $_G['cache']['portalcategory'][$data['catid']]['catname'], + 'fromurl'=> $data['fromurl'], + 'from' => $data['from'], + 'articles' => $_G['cache']['portalcategory'][$data['catid']]['articles'], + 'viewnum' => intval($data['viewnum']), + 'commentnum' => intval($data['commentnum']) + ) + ); + } + return array('html' => '', 'data' => $list); + } + + function getmaxid() { + loadcache('databasemaxid'); + $data = getglobal('cache/databasemaxid'); + if(!is_array($data)) { + $data = array(); + } + if(!isset($data['article']) || TIMESTAMP - $data['article']['dateline'] >= 86400) { + $data['article']['dateline'] = TIMESTAMP; + $data['article']['id'] = DB::result_first('SELECT MAX(aid) FROM '.DB::table('portal_article_title')); + savecache('databasemaxid', $data); + } + return $data['article']['id']; + } + +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_articlehot.php b/source/class/block/portal/block_articlehot.php new file mode 100644 index 0000000..a6e8db0 --- /dev/null +++ b/source/class/block/portal/block_articlehot.php @@ -0,0 +1,57 @@ +setting = array( + 'catid' => array( + 'title' => 'articlelist_catid', + 'type' => 'mselect', + 'value' => array( + ), + ), + 'picrequired' => array( + 'title' => 'articlelist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'orderby' => array( + 'title' => 'articlelist_orderby', + 'type' => 'mradio', + 'value' => array( + array('viewnum', 'articlelist_orderby_viewnum'), + array('commentnum', 'articlelist_orderby_commentnum'), + ), + 'default' => 'viewnum' + ), + 'titlelength' => array( + 'title' => 'articlelist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'articlelist_summarylength', + 'type' => 'text', + 'default' => 80 + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_article_script_articlehot'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_articlenew.php b/source/class/block/portal/block_articlenew.php new file mode 100644 index 0000000..06c5c54 --- /dev/null +++ b/source/class/block/portal/block_articlenew.php @@ -0,0 +1,48 @@ +setting = array( + 'catid' => array( + 'title' => 'articlelist_catid', + 'type' => 'mselect', + 'value' => array( + ), + ), + 'picrequired' => array( + 'title' => 'articlelist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'titlelength' => array( + 'title' => 'articlelist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'articlelist_summarylength', + 'type' => 'text', + 'default' => 80 + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_article_script_articlenew'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_articlespecified.php b/source/class/block/portal/block_articlespecified.php new file mode 100644 index 0000000..8f12b80 --- /dev/null +++ b/source/class/block/portal/block_articlespecified.php @@ -0,0 +1,64 @@ +setting = array( + 'aids' => array( + 'title' => 'articlelist_aids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'articlelist_uids', + 'type' => 'text', + 'value' => '' + ), + 'tag' => array( + 'title' => 'articlelist_tag', + 'type' => 'mcheckbox', + 'value' => array( + ), + ), + 'starttime' => array( + 'title' => 'articlelist_starttime', + 'type' => 'calendar', + 'default' => '' + ), + 'endtime' => array( + 'title' => 'articlelist_endtime', + 'type' => 'calendar', + 'default' => '' + ), + 'titlelength' => array( + 'title' => 'articlelist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'articlelist_summarylength', + 'type' => 'text', + 'default' => 80 + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_article_script_articlespecified'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_portalcategory.php b/source/class/block/portal/block_portalcategory.php new file mode 100644 index 0000000..6c5f8b7 --- /dev/null +++ b/source/class/block/portal/block_portalcategory.php @@ -0,0 +1,145 @@ +setting = array( + 'thecatid' => array( + 'title' => 'portalcategory_thecatid', + 'type' => 'text', + ), + 'catid' => array( + 'title' => 'portalcategory_catid', + 'type' => 'mselect', + 'value' => array( + ), + ), + 'orderby' => array( + 'title' => 'portalcategory_orderby', + 'type' => 'mradio', + 'value' => array( + array('displayorder', 'portalcategory_orderby_displayorder'), + array('articles', 'portalcategory_orderby_articles') + ), + 'default' => 'displayorder' + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_category_script_portalcategory'); + } + + function blockclass() { + return array('category', lang('blockclass', 'blockclass_portal_category')); + } + + function fields() { + return array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'url' => array('name' => lang('blockclass', 'blockclass_category_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_category_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'articles' => array('name' => lang('blockclass', 'blockclass_category_field_articles'), 'formtype' => 'text', 'datatype' => 'int'), + ); + } + + function fieldsconvert() { + return array( + 'forum_forum' => array( + 'name' => lang('blockclass', 'blockclass_forum_forum'), + 'script' => 'forum', + 'searchkeys' => array('articles'), + 'replacekeys' => array('threads'), + ), + 'group_group' => array( + 'name' => lang('blockclass', 'blockclass_group_group'), + 'script' => 'group', + 'searchkeys' => array('articles'), + 'replacekeys' => array('threads'), + ), + ); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + if($settings['catid']) { + $settings['catid']['value'][] = array(0, lang('portalcp', 'block_first_category')); + loadcache('portalcategory'); + foreach($_G['cache']['portalcategory'] as $value) { + if($value['level'] == 0) { + $settings['catid']['value'][] = array($value['catid'], $value['catname']); + if($value['children']) { + foreach($value['children'] as $catid2) { + $value2 = $_G['cache']['portalcategory'][$catid2]; + $settings['catid']['value'][] = array($value2['catid'], '-- '.$value2['catname']); + if($value2['children']) { + foreach($value2['children'] as $catid3) { + $value3 = $_G['cache']['portalcategory'][$catid3]; + $settings['catid']['value'][] = array($value3['catid'], '---- '.$value3['catname']); + } + } + } + } + } + } + } + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + loadcache('portalcategory'); + $thecatid = !empty($parameter['thecatid']) ? explode(',',$parameter['thecatid']) : array(); + if(!empty($parameter['catid'])) { + $catid = $parameter['catid']; + } else { + $catid = array_keys($_G['cache']['portalcategory']); + $catid[] = '0'; + } + $orderby = $parameter['orderby'] == 'articles' ? ' ORDER BY articles DESC' : ' ORDER BY displayorder'; + + $wheres = array(); + if($thecatid) { + $wheres[] = "catid IN (".dimplode($thecatid).")"; + } + if($catid) { + $wheres[] = "upid IN (".dimplode($catid).")"; + } + $wheresql = $wheres ? implode(' AND ', $wheres) : '1'; + + $list = array(); + $query = DB::query('SELECT * FROM '.DB::table('portal_category')." WHERE $wheresql $orderby"); + while($data = DB::fetch($query)) { + $list[] = array( + 'id' => $data['catid'], + 'idtype' => 'catid', + 'title' => dhtmlspecialchars($data['catname']), + 'url' => $_G['cache']['portalcategory'][$data['catid']]['caturl'], + 'pic' => '', + 'picflag' => '0', + 'summary' => '', + 'fields' => array( + 'dateline'=>$data['dateline'], + 'articles' => $data['articles'] + ) + ); + } + return array('html' => '', 'data' => $list); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_topic.php b/source/class/block/portal/block_topic.php new file mode 100644 index 0000000..f4fdd4e --- /dev/null +++ b/source/class/block/portal/block_topic.php @@ -0,0 +1,145 @@ +setting = array( + 'topicids' => array( + 'title' => 'topiclist_topicids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'topiclist_uids', + 'type' => 'text', + 'value' => '' + ), + 'picrequired' => array( + 'title' => 'topiclist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'orderby' => array( + 'title' => 'topiclist_orderby', + 'type' => 'mradio', + 'value' => array( + array('dateline', 'topiclist_orderby_dateline'), + array('viewnum', 'topiclist_orderby_viewnum') + ), + 'default' => 'dateline' + ), + 'titlelength' => array( + 'title' => 'topiclist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'summary' => 'topiclist_summarylength', + 'type' => 'text', + 'default' => 80 + ), + 'startrow' => array( + 'title' => 'topiclist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_topic_script_topic'); + } + + function blockclass() { + return array('topic', lang('blockclass', 'blockclass_portal_topic')); + } + + function fields() { + return array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'url' => array('name' => lang('blockclass', 'blockclass_topic_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_topic_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'pic' => array('name' => lang('blockclass', 'blockclass_topic_field_pic'), 'formtype' => 'pic', 'datatype' => 'pic'), + 'summary' => array('name' => lang('blockclass', 'blockclass_topic_field_summary'), 'formtype' => 'summary', 'datatype' => 'summary'), + 'uid' => array('name' => lang('blockclass', 'blockclass_topic_field_uid'), 'formtype' => 'text', 'datatype' => 'int'), + 'username' => array('name' => lang('blockclass', 'blockclass_topic_field_username'), 'formtype' => 'text', 'datatype' => 'string'), + 'dateline' => array('name' => lang('blockclass', 'blockclass_topic_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'), + 'viewnum' => array('name' => lang('blockclass', 'blockclass_topic_field_viewnum'), 'formtype' => 'text', 'datatype' => 'int'), + ); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + $topicids = !empty($parameter['topicids']) ? explode(',',$parameter['topicids']) : array(); + $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array(); + $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = isset($parameter['items']) ? intval($parameter['items']) : 10; + $titlelength = $parameter['titlelength'] ? intval($parameter['titlelength']) : 40; + $summarylength = $parameter['summarylength'] ? intval($parameter['summarylength']) : 80; + $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'],array('dateline', 'viewnum')) ? $parameter['orderby'] : 'dateline'; + $picrequired = !empty($parameter['picrequired']) ? 1 : 0; + + $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array(); + + $datalist = $list = array(); + $wherearr = array(); + if($topicids) { + $wherearr[] = 'topicid IN ('.dimplode($topicids).')'; + } + if($bannedids) { + $wherearr[] = 'topicid NOT IN ('.dimplode($bannedids).')'; + } + if($uids) { + $wherearr[] = 'uid IN ('.dimplode($uids).')'; + } + if($picrequired) { + $wherearr[] = "cover != ''"; + } + $wherearr[] = "closed = '0'"; + require_once libfile('function/portal'); + foreach(C::t('portal_topic')->fetch_all_by_search_where($wherearr, "ORDER BY $orderby DESC", $startrow, $items) as $data) { + if(empty($data['cover'])) { + $data['cover'] = STATICURL.'image/common/nophoto.gif'; + $data['picflag'] = '0'; + } + $list[] = array( + 'id' => $data['topicid'], + 'idtype' => 'topicid', + 'title' => cutstr($data['title'], $titlelength, ''), + 'url' => !empty($_G['setting']['makehtml']['flag']) && !empty($_G['setting']['makehtml']['topichtmldir']) && !$data['htmlmade'] ? fetch_topic_url($data) : 'portal.php?mod=topic&topic='.$data['name'], + 'pic' => $data['cover'] ? $data['cover'] : '', + 'picflag' => $data['picflag'] ? $data['picflag'] : '', + 'summary' => $data['summary'] ? cutstr($data['summary'], $summarylength, '') : '', + 'fields' => array( + 'fulltitle' => $data['title'], + 'uid'=>$data['uid'], + 'username'=>$data['username'], + 'dateline'=>$data['dateline'], + 'viewnum'=>$data['viewnum'], + ) + ); + } + return array('html' => '', 'data' => $list); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_topichot.php b/source/class/block/portal/block_topichot.php new file mode 100644 index 0000000..c0b9383 --- /dev/null +++ b/source/class/block/portal/block_topichot.php @@ -0,0 +1,52 @@ +setting = array( + 'picrequired' => array( + 'title' => 'topiclist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'titlelength' => array( + 'title' => 'topiclist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'summary' => 'topiclist_summarylength', + 'type' => 'text', + 'default' => 80 + ), + 'startrow' => array( + 'title' => 'topiclist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_topic_script_topichot'); + } + + function cookeparameter($parameter) { + $parameter['orderby'] = 'viewnum'; + return $parameter; + } +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_topicnew.php b/source/class/block/portal/block_topicnew.php new file mode 100644 index 0000000..ef51015 --- /dev/null +++ b/source/class/block/portal/block_topicnew.php @@ -0,0 +1,52 @@ +setting = array( + 'picrequired' => array( + 'title' => 'topiclist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'titlelength' => array( + 'title' => 'topiclist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'summary' => 'topiclist_summarylength', + 'type' => 'text', + 'default' => 80 + ), + 'startrow' => array( + 'title' => 'topiclist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_topic_script_topicnew'); + } + + function cookeparameter($parameter) { + $parameter['orderby'] = 'dateline'; + return $parameter; + } +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/block_topicspecified.php b/source/class/block/portal/block_topicspecified.php new file mode 100644 index 0000000..59616c8 --- /dev/null +++ b/source/class/block/portal/block_topicspecified.php @@ -0,0 +1,47 @@ +setting = array( + 'topicids' => array( + 'title' => 'topiclist_topicids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'topiclist_uids', + 'type' => 'text', + 'value' => '' + ), + 'titlelength' => array( + 'title' => 'topiclist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'summary' => 'topiclist_summarylength', + 'type' => 'text', + 'default' => 80 + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_topic_script_topicspecified'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/portal/blockclass.php b/source/class/block/portal/blockclass.php new file mode 100644 index 0000000..0707601 --- /dev/null +++ b/source/class/block/portal/blockclass.php @@ -0,0 +1,19 @@ + lang('blockclass', 'blockclass_portal'), +); + + +?> \ No newline at end of file diff --git a/source/class/block/portal/index.htm b/source/class/block/portal/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/block/space/block_album.php b/source/class/block/space/block_album.php new file mode 100644 index 0000000..8a53fe8 --- /dev/null +++ b/source/class/block/space/block_album.php @@ -0,0 +1,145 @@ +setting = array( + 'aids' => array( + 'title' => 'albumlist_aids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'albumlist_uids', + 'type' => 'text', + 'value' => '' + ), + 'catid' => array( + 'title' => 'albumlist_catid', + 'type' => 'mselect', + ), + 'orderby' => array( + 'title' => 'albumlist_orderby', + 'type' => 'mradio', + 'value' => array( + array('dateline', 'albumlist_orderby_dateline'), + array('updatetime', 'albumlist_orderby_updatetime'), + array('picnum', 'albumlist_orderby_picnum'), + ), + 'default' => 'dateline' + ), + 'titlelength' => array( + 'title' => 'albumlist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'startrow' => array( + 'title' => 'albumlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_album_script_album'); + } + + function blockclass() { + return array('album', lang('blockclass', 'blockclass_space_album')); + } + + function fields() { + return array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'url' => array('name' => lang('blockclass', 'blockclass_album_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_album_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'pic' => array('name' => lang('blockclass', 'blockclass_album_field_pic'), 'formtype' => 'pic', 'datatype' => 'pic'), + 'uid' => array('name' => lang('blockclass', 'blockclass_album_field_uid'), 'formtype' => 'text', 'datatype' => 'int'), + 'username' => array('name' => lang('blockclass', 'blockclass_album_field_username'), 'formtype' => 'text', 'datatype' => 'string'), + 'dateline' => array('name' => lang('blockclass', 'blockclass_album_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'), + 'updatetime' => array('name' => lang('blockclass', 'blockclass_album_field_updatetime'), 'formtype' => 'date', 'datatype' => 'date'), + 'picnum' => array('name' => lang('blockclass', 'blockclass_album_field_picnum'), 'formtype' => 'text', 'datatype' => 'int'), + ); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + if($settings['catid']) { + $settings['catid']['value'][] = array(0, lang('portalcp', 'block_all_category')); + loadcache('albumcategory'); + foreach($_G['cache']['albumcategory'] as $value) { + if($value['level'] == 0) { + $settings['catid']['value'][] = array($value['catid'], $value['catname']); + if($value['children']) { + foreach($value['children'] as $catid2) { + $value2 = $_G['cache']['albumcategory'][$catid2]; + $settings['catid']['value'][] = array($value2['catid'], '-- '.$value2['catname']); + if($value2['children']) { + foreach($value2['children'] as $catid3) { + $value3 = $_G['cache']['albumcategory'][$catid3]; + $settings['catid']['value'][] = array($value3['catid'], '---- '.$value3['catname']); + } + } + } + } + } + } + } + return $settings; + } + + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array(); + $aids = !empty($parameter['aids']) ? explode(',', $parameter['aids']) : array(); + $catid = !empty($parameter['catid']) ? $parameter['catid'] : array(); + $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = isset($parameter['items']) ? intval($parameter['items']) : 10; + $titlelength = isset($parameter['titlelength']) ? intval($parameter['titlelength']) : 40; + $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'],array('dateline', 'picnum', 'updatetime')) ? $parameter['orderby'] : 'dateline'; + + $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array(); + + $list = array(); + + $query = C::t('home_album')->fetch_all_by_block($aids, $bannedids, $uids, $catid, $startrow, $items, $orderby); + foreach($query as $data) { + $list[] = array( + 'id' => $data['albumid'], + 'idtype' => 'albumid', + 'title' => cutstr($data['albumname'], $titlelength, ''), + 'url' => "home.php?mod=space&uid={$data['uid']}&do=album&id={$data['albumid']}", + 'pic' => 'album/'.$data['pic'], + 'picflag' => $data['picflag'], + 'summary' => '', + 'fields' => array( + 'fulltitle' => $data['albumname'], + 'uid'=>$data['uid'], + 'username'=>$data['username'], + 'dateline'=>$data['dateline'], + 'updatetime'=>$data['updatetime'], + 'picnum'=>$data['picnum'], + ) + ); + } + return array('html' => '', 'data' => $list); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_albumnew.php b/source/class/block/space/block_albumnew.php new file mode 100644 index 0000000..792d4d9 --- /dev/null +++ b/source/class/block/space/block_albumnew.php @@ -0,0 +1,46 @@ +setting = array( + 'catid' => array( + 'title' => 'albumlist_catid', + 'type' => 'mselect', + ), + 'titlelength' => array( + 'title' => 'albumlist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'startrow' => array( + 'title' => 'albumlist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_album_script_albumnew'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'updatetime'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_albumspecified.php b/source/class/block/space/block_albumspecified.php new file mode 100644 index 0000000..062dfa4 --- /dev/null +++ b/source/class/block/space/block_albumspecified.php @@ -0,0 +1,46 @@ +setting = array( + 'catid' => array( + 'title' => 'albumlist_catid', + 'type' => 'mselect', + ), + 'aids' => array( + 'title' => 'albumlist_aids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'albumlist_uids', + 'type' => 'text', + 'value' => '' + ), + 'titlelength' => array( + 'title' => 'albumlist_titlelength', + 'type' => 'text', + 'default' => 40 + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_album_script_albumspecified'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_blog.php b/source/class/block/space/block_blog.php new file mode 100644 index 0000000..fceeec2 --- /dev/null +++ b/source/class/block/space/block_blog.php @@ -0,0 +1,272 @@ +setting = array( + 'blogids' => array( + 'title' => 'bloglist_blogids', + 'type' => 'text' + ), + 'uids' => array( + 'title' => 'bloglist_uids', + 'type' => 'text', + ), + 'catid' => array( + 'title' => 'bloglist_catid', + 'type'=>'mselect', + ), + 'picrequired' => array( + 'title' => 'bloglist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'orderby' => array( + 'title' => 'bloglist_orderby', + 'type' => 'mradio', + 'value' => array( + array('dateline', 'bloglist_orderby_dateline'), + array('viewnum', 'bloglist_orderby_viewnum'), + array('replynum', 'bloglist_orderby_replynum'), + array('hot', 'bloglist_orderby_hot') + ), + 'default' => 'dateline' + ), + 'hours' => array( + 'title' => 'bloglist_hours', + 'type' => 'mradio', + 'value' => array( + array('', 'bloglist_hours_nolimit'), + array('1', 'bloglist_hours_hour'), + array('24', 'bloglist_hours_day'), + array('168', 'bloglist_hours_week'), + array('720', 'bloglist_hours_month'), + array('8760', 'bloglist_hours_year'), + ), + 'default' => '' + ), + 'titlelength' => array( + 'title' => 'bloglist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'bloglist_summarylength', + 'type' => 'text', + 'default' => 80 + ), + 'startrow' => array( + 'title' => 'bloglist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_blog_script_blog'); + } + + function blockclass() { + return array('blog', lang('blockclass', 'blockclass_space_blog')); + } + + function fields() { + return array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'url' => array('name' => lang('blockclass', 'blockclass_blog_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_blog_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'summary' => array('name' => lang('blockclass', 'blockclass_blog_field_summary'), 'formtype' => 'summary', 'datatype' => 'summary'), + 'pic' => array('name' => lang('blockclass', 'blockclass_blog_field_pic'), 'formtype' => 'pic', 'datatype' => 'pic'), + 'dateline' => array('name' => lang('blockclass', 'blockclass_blog_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'), + 'uid' => array('name' => lang('blockclass', 'blockclass_blog_field_uid'), 'formtype' => 'text', 'datatype' => 'int'), + 'username' => array('name' => lang('blockclass', 'blockclass_blog_field_username'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar' => array('name' => lang('blockclass', 'blockclass_blog_field_avatar'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_middle' => array('name' => lang('blockclass', 'blockclass_blog_field_avatar_middle'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_big' => array('name' => lang('blockclass', 'blockclass_blog_field_avatar_big'), 'formtype' => 'text', 'datatype' => 'string'), + 'replynum' => array('name' => lang('blockclass', 'blockclass_blog_field_replynum'), 'formtype' => 'text', 'datatype' => 'int'), + 'viewnum' => array('name' => lang('blockclass', 'blockclass_blog_field_viewnum'), 'formtype' => 'text', 'datatype' => 'int'), + 'click1' => array('name' => lang('blockclass', 'blockclass_blog_field_click1'), 'formtype' => 'text', 'datatype' => 'int'), + 'click2' => array('name' => lang('blockclass', 'blockclass_blog_field_click2'), 'formtype' => 'text', 'datatype' => 'int'), + 'click3' => array('name' => lang('blockclass', 'blockclass_blog_field_click3'), 'formtype' => 'text', 'datatype' => 'int'), + 'click4' => array('name' => lang('blockclass', 'blockclass_blog_field_click4'), 'formtype' => 'text', 'datatype' => 'int'), + 'click5' => array('name' => lang('blockclass', 'blockclass_blog_field_click5'), 'formtype' => 'text', 'datatype' => 'int'), + 'click6' => array('name' => lang('blockclass', 'blockclass_blog_field_click6'), 'formtype' => 'text', 'datatype' => 'int'), + 'click7' => array('name' => lang('blockclass', 'blockclass_blog_field_click7'), 'formtype' => 'text', 'datatype' => 'int'), + 'click8' => array('name' => lang('blockclass', 'blockclass_blog_field_click8'), 'formtype' => 'text', 'datatype' => 'int'), + ); + } + + function fieldsconvert() { + return array( + 'forum_thread' => array( + 'name' => lang('blockclass', 'blockclass_forum_thread'), + 'script' => 'thread', + 'searchkeys' => array('username', 'uid', 'viewnum', 'replynum'), + 'replacekeys' => array('author', 'authorid', 'views', 'replies'), + ), + 'group_thread' => array( + 'name' => lang('blockclass', 'blockclass_group_thread'), + 'script' => 'groupthread', + 'searchkeys' => array('username', 'uid', 'viewnum', 'replynum'), + 'replacekeys' => array('author', 'authorid', 'views', 'replies'), + ), + 'portal_article' => array( + 'name' => lang('blockclass', 'blockclass_portal_article'), + 'script' => 'article', + 'searchkeys' => array('replynum'), + 'replacekeys' => array('commentnum'), + ), + ); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + if(!empty($settings['catid'])) { + $settings['catid']['value'][] = array(0, lang('portalcp', 'block_all_category')); + loadcache('blogcategory'); + foreach($_G['cache']['blogcategory'] as $value) { + if($value['level'] == 0) { + $settings['catid']['value'][] = array($value['catid'], $value['catname']); + if($value['children']) { + foreach($value['children'] as $catid2) { + $value2 = $_G['cache']['blogcategory'][$catid2]; + $settings['catid']['value'][] = array($value2['catid'], '-- '.$value2['catname']); + if($value2['children']) { + foreach($value2['children'] as $catid3) { + $value3 = $_G['cache']['blogcategory'][$catid3]; + $settings['catid']['value'][] = array($value3['catid'], '---- '.$value3['catname']); + } + } + } + } + } + } + } + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + $blogids = !empty($parameter['blogids']) ? explode(',',$parameter['blogids']) : array(); + $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array(); + $catid = !empty($parameter['catid']) ? $parameter['catid'] : array(); + $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = isset($parameter['items']) ? intval($parameter['items']) : 10; + $hours = isset($parameter['hours']) ? intval($parameter['hours']) : ''; + $titlelength = $parameter['titlelength'] ? intval($parameter['titlelength']) : 40; + $summarylength = $parameter['summarylength'] ? intval($parameter['summarylength']) : 80; + $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'],array('dateline', 'viewnum', 'replynum', 'hot')) ? $parameter['orderby'] : 'dateline'; + $picrequired = !empty($parameter['picrequired']) ? 1 : 0; + + $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array(); + + $datalist = $list = array(); + $wheres = array(); + if(!$blogids && !$catid && $_G['setting']['blockmaxaggregationitem']) { + if(($maxid = $this->getmaxid() - $_G['setting']['blockmaxaggregationitem']) > 0) { + $wheres[] = 'b.blogid > '.$maxid; + } + } + if($blogids) { + $wheres[] = 'b.blogid IN ('.dimplode($blogids).')'; + } + if($bannedids) { + $wheres[] = 'b.blogid NOT IN ('.dimplode($bannedids).')'; + } + if($uids) { + $wheres[] = 'b.uid IN ('.dimplode($uids).')'; + } + if($catid && !in_array('0', $catid)) { + $wheres[] = 'b.catid IN ('.dimplode($catid).')'; + } + if($hours) { + $timestamp = TIMESTAMP - 3600 * $hours; + $wheres[] = "b.dateline >= '$timestamp'"; + } + $tablesql = $fieldsql = ''; + if($style['getsummary'] || $picrequired || $style['getpic']) { + if($picrequired) { + $wheres[] = "bf.pic != ''"; + } + $tablesql = ' LEFT JOIN '.DB::table('home_blogfield')." bf ON b.blogid = bf.blogid"; + $fieldsql = ', bf.pic, b.picflag, bf.message'; + } + $wheres[] = "b.friend = '0'"; + $wheres[] = "b.status='0'"; + $wheresql = $wheres ? implode(' AND ', $wheres) : '1'; + $sql = "SELECT b.* $fieldsql FROM ".DB::table('home_blog')." b $tablesql WHERE $wheresql ORDER BY b.$orderby DESC"; + $query = DB::query($sql." LIMIT $startrow,$items;"); + while($data = DB::fetch($query)) { + if(empty($data['pic'])) { + $data['pic'] = STATICURL.'image/common/nophoto.gif'; + $data['picflag'] = '0'; + } else { + $data['pic'] = preg_replace('/\.thumb\.jpg$/', '', $data['pic']); + $data['pic'] = 'album/'.$data['pic']; + $data['picflag'] = $data['remote'] == '1' ? '2' : '1'; + } + $list[] = array( + 'id' => $data['blogid'], + 'idtype' => 'blogid', + 'title' => cutstr($data['subject'], $titlelength, ''), + 'url' => 'home.php?mod=space&uid='.$data['uid'].'&do=blog&id='.$data['blogid'], + 'pic' => $data['pic'], + 'picflag' => $data['picflag'], + 'summary' => $data['message'] ? preg_replace("/&[a-z]+\;/i", '', cutstr(strip_tags($data['message']), $summarylength, '')) : '', + 'fields' => array( + 'fulltitle' => $data['subject'], + 'dateline'=>$data['dateline'], + 'uid'=>$data['uid'], + 'username'=>$data['username'], + 'avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']), + 'replynum'=>$data['replynum'], + 'viewnum'=>$data['viewnum'], + 'click1'=>$data['click1'], + 'click2'=>$data['click2'], + 'click3'=>$data['click3'], + 'click4'=>$data['click4'], + 'click5'=>$data['click5'], + 'click6'=>$data['click6'], + 'click7'=>$data['click7'], + 'click8'=>$data['click8'], + ) + ); + } + return array('html' => '', 'data' => $list); + } + + function getmaxid() { + loadcache('databasemaxid'); + $data = getglobal('cache/databasemaxid'); + if(!is_array($data)) { + $data = array(); + } + if(!isset($data['blog']) || TIMESTAMP - $data['blog']['dateline'] >= 86400) { + $data['blog']['dateline'] = TIMESTAMP; + $data['blog']['id'] = DB::result_first('SELECT MAX(blogid) FROM '.DB::table('home_blog')); + savecache('databasemaxid', $data); + } + return $data['blog']['id']; + } + + +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_bloghot.php b/source/class/block/space/block_bloghot.php new file mode 100644 index 0000000..7a6d7be --- /dev/null +++ b/source/class/block/space/block_bloghot.php @@ -0,0 +1,71 @@ +setting = array( + 'hours' => array( + 'title' => 'bloglist_hours', + 'type' => 'mradio', + 'value' => array( + array('', 'bloglist_hours_nolimit'), + array('1', 'bloglist_hours_hour'), + array('24', 'bloglist_hours_day'), + array('168', 'bloglist_hours_week'), + array('720', 'bloglist_hours_month'), + array('8760', 'bloglist_hours_year'), + ), + 'default' => '720' + ), + 'catid' => array( + 'title' => 'bloglist_catid', + 'type'=>'mselect', + ), + 'picrequired' => array( + 'title' => 'bloglist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'titlelength' => array( + 'title' => 'bloglist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'bloglist_summarylength', + 'type' => 'text', + 'default' => 80 + ), + 'startrow' => array( + 'title' => 'bloglist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_blog_script_bloghot'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'hot'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_blognew.php b/source/class/block/space/block_blognew.php new file mode 100644 index 0000000..5f9002c --- /dev/null +++ b/source/class/block/space/block_blognew.php @@ -0,0 +1,58 @@ +setting = array( + 'catid' => array( + 'title' => 'bloglist_catid', + 'type'=>'mselect', + ), + 'picrequired' => array( + 'title' => 'bloglist_picrequired', + 'type' => 'radio', + 'default' => '0' + ), + 'titlelength' => array( + 'title' => 'bloglist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'bloglist_summarylength', + 'type' => 'text', + 'default' => 80 + ), + 'startrow' => array( + 'title' => 'bloglist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_blog_script_blognew'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'dateline'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_blogspecified.php b/source/class/block/space/block_blogspecified.php new file mode 100644 index 0000000..aa5eb8b --- /dev/null +++ b/source/class/block/space/block_blogspecified.php @@ -0,0 +1,50 @@ +setting = array( + 'blogids' => array( + 'title' => 'bloglist_blogids', + 'type' => 'text' + ), + 'uids' => array( + 'title' => 'bloglist_uids', + 'type' => 'text', + ), + 'catid' => array( + 'title' => 'bloglist_catid', + 'type'=>'mselect', + ), + 'titlelength' => array( + 'title' => 'bloglist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'summarylength' => array( + 'title' => 'bloglist_summarylength', + 'type' => 'text', + 'default' => 80 + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_blog_script_blogspecified'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_doing.php b/source/class/block/space/block_doing.php new file mode 100644 index 0000000..aaae79c --- /dev/null +++ b/source/class/block/space/block_doing.php @@ -0,0 +1,118 @@ +setting = array( + 'uids' => array( + 'title' => 'doinglist_uids', + 'type' => 'text', + 'value' => '' + ), + 'titlelength' => array( + 'title' => 'doinglist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'orderby' => array( + 'title' => 'doinglist_orderby', + 'type' => 'mradio', + 'value' => array( + array('dateline', 'doinglist_orderby_dateline'), + array('replynum', 'doinglist_orderby_replynum') + ), + 'default' => 'dateline' + ), + 'startrow' => array( + 'title' => 'doinglist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_doing_script_doing'); + } + + function blockclass() { + return array('doing', lang('blockclass', 'blockclass_space_doing')); + } + + function fields() { + return array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'url' => array('name' => lang('blockclass', 'blockclass_doing_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_doing_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'uid' => array('name' => lang('blockclass', 'blockclass_doing_field_uid'), 'formtype' => 'text', 'datatype' => 'pic'), + 'username' => array('name' => lang('blockclass', 'blockclass_doing_field_username'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar' => array('name' => lang('blockclass', 'blockclass_doing_field_avatar'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_middle' => array('name' => lang('blockclass', 'blockclass_doing_field_avatar_middle'), 'formtype' => 'text', 'datatype' => 'string'), + 'avatar_big' => array('name' => lang('blockclass', 'blockclass_doing_field_avatar_big'), 'formtype' => 'text', 'datatype' => 'string'), + 'dateline' => array('name' => lang('blockclass', 'blockclass_doing_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'), + 'replynum' => array('name' => lang('blockclass', 'blockclass_doing_field_replynum'), 'formtype' => 'text', 'datatype' => 'int'), + ); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + $uids = isset($parameter['uids']) && !in_array(0, (array)$parameter['uids']) ? $parameter['uids'] : ''; + $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = isset($parameter['items']) ? intval($parameter['items']) : 10; + $titlelength = intval($parameter['titlelength']); + + $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array(); + + $datalist = $list = array(); + + $query = C::t('home_doing')->fetch_all_by_uid_doid($uids, $bannedids, $parameter['orderby'], $startrow, $items, true, true); + foreach($query as $data) { + $datalist = array( + 'id' => $data['doid'], + 'idtype' => 'doid', + 'title' => cutstr(strip_tags($data['message']), $titlelength, ''), + 'url' => 'home.php?mod=space&uid='.$data['uid'].'&do=doing&doid='.$data['doid'], + 'pic' => '', + 'summary' => '', + 'fields' => array( + 'fulltitle' => strip_tags($data['message']), + 'uid' => $data['uid'], + 'username' => $data['username'], + 'avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']), + 'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']), + 'dateline'=>$data['dateline'], + 'replynum'=>$data['replynum'], + ) + ); + if($titlelength) { + $datalist['title'] = cutstr(strip_tags($data['message']), $titlelength); + } else { + $datalist['title'] = strip_tags($data['message'], ''); + } + $list[] = $datalist; + } + return array('html' => '', 'data' => $list); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_doinghot.php b/source/class/block/space/block_doinghot.php new file mode 100644 index 0000000..72dbfef --- /dev/null +++ b/source/class/block/space/block_doinghot.php @@ -0,0 +1,44 @@ +setting = array( + 'titlelength' => array( + 'title' => 'doinglist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'startrow' => array( + 'title' => 'doinglist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_doing_script_doinghot'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'replynum'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_doingnew.php b/source/class/block/space/block_doingnew.php new file mode 100644 index 0000000..638ec9b --- /dev/null +++ b/source/class/block/space/block_doingnew.php @@ -0,0 +1,44 @@ +setting = array( + 'titlelength' => array( + 'title' => 'doinglist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'startrow' => array( + 'title' => 'doinglist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_doing_script_doingnew'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'dateine'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_pic.php b/source/class/block/space/block_pic.php new file mode 100644 index 0000000..69b2098 --- /dev/null +++ b/source/class/block/space/block_pic.php @@ -0,0 +1,169 @@ +setting = array( + 'picids' => array( + 'title' => 'piclist_picids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'piclist_uids', + 'type' => 'text', + 'value' => '' + ), + 'aids' => array( + 'title' => 'piclist_aids', + 'type' => 'text', + 'value' => '' + ), + 'titlelength' => array( + 'title' => 'piclist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'orderby' => array( + 'title' => 'piclist_orderby', + 'type' => 'mradio', + 'value' => array( + array('dateline', 'piclist_orderby_dateline'), + array('hot', 'piclist_orderby_hot') + ), + 'default' => 'dateline' + ), + 'hours' => array( + 'title' => 'piclist_hours', + 'type' => 'mradio', + 'value' => array( + array('', 'piclist_hours_nolimit'), + array('1', 'piclist_hours_hour'), + array('24', 'piclist_hours_day'), + array('168', 'piclist_hours_week'), + array('720', 'piclist_hours_month'), + array('8760', 'piclist_hours_year'), + ), + 'default' => '' + ), + 'startrow' => array( + 'title' => 'piclist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_pic_script_pic'); + } + + function blockclass() { + return array('pic', lang('blockclass', 'blockclass_space_pic')); + } + + function fields() { + return array( + 'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'), + 'url' => array('name' => lang('blockclass', 'blockclass_pic_field_url'), 'formtype' => 'text', 'datatype' => 'string'), + 'title' => array('name' => lang('blockclass', 'blockclass_pic_field_title'), 'formtype' => 'title', 'datatype' => 'title'), + 'pic' => array('name' => lang('blockclass', 'blockclass_pic_field_pic'), 'formtype' => 'pic', 'datatype' => 'pic'), + 'summary' => array('name' => lang('blockclass', 'blockclass_pic_field_summary'), 'formtype' => 'summary', 'datatype' => 'summary'), + 'uid' => array('name' => lang('blockclass', 'blockclass_pic_field_uid'), 'formtype' => 'text', 'datatype' => 'int'), + 'username' => array('name' => lang('blockclass', 'blockclass_pic_field_username'), 'formtype' => 'text', 'datatype' => 'string'), + 'dateline' => array('name' => lang('blockclass', 'blockclass_pic_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'), + 'viewnum' => array('name' => lang('blockclass', 'blockclass_pic_field_viewnum'), 'formtype' => 'text', 'datatype' => 'int'), + 'click1' => array('name' => lang('blockclass', 'blockclass_pic_field_click1'), 'formtype' => 'text', 'datatype' => 'int'), + 'click2' => array('name' => lang('blockclass', 'blockclass_pic_field_click2'), 'formtype' => 'text', 'datatype' => 'int'), + 'click3' => array('name' => lang('blockclass', 'blockclass_pic_field_click3'), 'formtype' => 'text', 'datatype' => 'int'), + 'click4' => array('name' => lang('blockclass', 'blockclass_pic_field_click4'), 'formtype' => 'text', 'datatype' => 'int'), + 'click5' => array('name' => lang('blockclass', 'blockclass_pic_field_click5'), 'formtype' => 'text', 'datatype' => 'int'), + 'click6' => array('name' => lang('blockclass', 'blockclass_pic_field_click6'), 'formtype' => 'text', 'datatype' => 'int'), + 'click7' => array('name' => lang('blockclass', 'blockclass_pic_field_click7'), 'formtype' => 'text', 'datatype' => 'int'), + 'click8' => array('name' => lang('blockclass', 'blockclass_pic_field_click8'), 'formtype' => 'text', 'datatype' => 'int'), + ); + } + + function getsetting() { + global $_G; + $settings = $this->setting; + + return $settings; + } + + function getdata($style, $parameter) { + global $_G; + + $parameter = $this->cookparameter($parameter); + $picids = !empty($parameter['picids']) ? explode(',', $parameter['picids']) : array(); + $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array(); + $aids = !empty($parameter['aids']) ? explode(',', $parameter['aids']) : array(); + $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0; + $items = isset($parameter['items']) ? intval($parameter['items']) : 10; + $hours = isset($parameter['hours']) ? intval($parameter['hours']) : ''; + $titlelength = isset($parameter['titlelength']) ? intval($parameter['titlelength']) : 40; + $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'],array('dateline', 'viewnum', 'replynum', 'hot')) ? $parameter['orderby'] : 'dateline'; + + $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array(); + + $list = array(); + $wheres = array(); + if($picids) { + $wheres[] = 'p.'.DB::field('picid', $picids); + } + if($uids) { + $wheres[] = 'p.'.DB::field('uid', $uids); + } + if($aids) { + $wheres[] = 'p.'.DB::field('albumid', $aids); + } + if($hours) { + $timestamp = TIMESTAMP - 3600 * $hours; + $wheres[] = 'p.'.DB::field('dateline', $timestamp, '>='); + } + if($bannedids) { + $wheres[] = 'p.'.DB::field('picid', $bannedids, 'notin'); + } + $wheresql = $wheres ? implode(' AND ', $wheres) : '1'; + $query = C::t('home_pic')->fetch_all_by_sql($wheresql." AND a.friend='0'", 'p.'.$orderby.' DESC'); + foreach($query as $data) { + $list[] = array( + 'id' => $data['picid'], + 'idtype' => 'picid', + 'title' => cutstr($data['title'], $titlelength, ''), + 'url' => "home.php?mod=space&uid={$data['uid']}&do=album&picid={$data['picid']}", + 'pic' => $data['remote'] >= 2 ? 'forum/'.$data['filepath'] : 'album/'.$data['filepath'], + 'picflag' => ($data['remote'] == 1 || $data['remote'] == 3) ? '2' : '1', + 'summary' => $data['title'], + 'fields' => array( + 'fulltitle' => $data['title'], + 'uid'=>$data['uid'], + 'username'=>$data['username'], + 'dateline'=>$data['dateline'], + 'replynum'=>$data['replynum'], + 'click1'=>$data['click1'], + 'click2'=>$data['click2'], + 'click3'=>$data['click3'], + 'click4'=>$data['click4'], + 'click5'=>$data['click5'], + 'click6'=>$data['click6'], + 'click7'=>$data['click7'], + 'click8'=>$data['click8'], + ) + ); + } + return array('html' => '', 'data' => $list); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_pichot.php b/source/class/block/space/block_pichot.php new file mode 100644 index 0000000..55f2d1f --- /dev/null +++ b/source/class/block/space/block_pichot.php @@ -0,0 +1,55 @@ +setting = array( + 'hours' => array( + 'title' => 'piclist_hours', + 'type' => 'mradio', + 'value' => array( + array('', 'piclist_hours_nolimit'), + array('1', 'piclist_hours_hour'), + array('24', 'piclist_hours_day'), + array('168', 'piclist_hours_week'), + array('720', 'piclist_hours_month'), + array('8760', 'piclist_hours_year'), + ), + 'default' => '720' + ), + 'titlelength' => array( + 'title' => 'piclist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'startrow' => array( + 'title' => 'piclist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_pic_script_pichot'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'hot'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_picnew.php b/source/class/block/space/block_picnew.php new file mode 100644 index 0000000..762c440 --- /dev/null +++ b/source/class/block/space/block_picnew.php @@ -0,0 +1,42 @@ +setting = array( + 'titlelength' => array( + 'title' => 'piclist_titlelength', + 'type' => 'text', + 'default' => 40 + ), + 'startrow' => array( + 'title' => 'piclist_startrow', + 'type' => 'text', + 'default' => 0 + ), + ); + } + + function name() { + return lang('blockclass', 'blockclass_pic_script_picnew'); + } + + function cookparameter($parameter) { + $parameter['orderby'] = 'dateline'; + return parent::cookparameter($parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/block_picspecified.php b/source/class/block/space/block_picspecified.php new file mode 100644 index 0000000..3b201f4 --- /dev/null +++ b/source/class/block/space/block_picspecified.php @@ -0,0 +1,47 @@ +setting = array( + 'picids' => array( + 'title' => 'piclist_picids', + 'type' => 'text', + 'value' => '' + ), + 'uids' => array( + 'title' => 'piclist_uids', + 'type' => 'text', + 'value' => '' + ), + 'aids' => array( + 'title' => 'piclist_aids', + 'type' => 'text', + 'value' => '' + ), + 'titlelength' => array( + 'title' => 'piclist_titlelength', + 'type' => 'text', + 'default' => 40 + ) + ); + } + + function name() { + return lang('blockclass', 'blockclass_pic_script_picspecified'); + } +} + +?> \ No newline at end of file diff --git a/source/class/block/space/blockclass.php b/source/class/block/space/blockclass.php new file mode 100644 index 0000000..7465f36 --- /dev/null +++ b/source/class/block/space/blockclass.php @@ -0,0 +1,19 @@ + lang('blockclass', 'blockclass_space'), +); + + +?> \ No newline at end of file diff --git a/source/class/block/space/index.htm b/source/class/block/space/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/block/xml/block_xml.php b/source/class/block/xml/block_xml.php new file mode 100644 index 0000000..c96f52b --- /dev/null +++ b/source/class/block/xml/block_xml.php @@ -0,0 +1,87 @@ +fetch($xmlid))) { + return; + } + $this->blockdata = $blockxml; + $this->blockdata['data'] = (array)dunserialize($blockxml['data']); + } else { + foreach(C::t('common_block_xml')->range() as $value) { + $one = $value; + $one['data'] = (array)dunserialize($value['data']); + $this->blockdata[] = $one; + } + } + } + + function name() { + return dhtmlspecialchars($this->blockdata['data']['name']); + } + + function blockclass() { + return dhtmlspecialchars($this->blockdata['data']['blockclass']); + } + + function fields() { + return dhtmlspecialchars($this->blockdata['data']['fields']); + } + + function getsetting() { + return dhtmlspecialchars($this->blockdata['data']['getsetting']); + } + + function getdata($style, $parameter) { + $parameter = $this->cookparameter($parameter); + $array = array(); + foreach($parameter as $key => $value) { + if(is_array($value)) { + $parameter[$key] = implode(',', $value); + } + } + $parameter['clientid'] = $this->blockdata['clientid']; + $parameter['op'] = 'getdata'; + $parameter['charset'] = CHARSET; + $parameter['version'] = $this->blockdata['version']; + $xmlurl = $this->blockdata['url']; + $parse = parse_url($xmlurl); + if(!empty($parse['host'])) { + define('IN_ADMINCP', true); + require_once libfile('function/importdata'); + $importtxt = @dfsockopen($xmlurl, 0, create_sign_url($parameter, $this->blockdata['key'], $this->blockdata['signtype'])); + } else { + $ctx = stream_context_create(array('http' => array('timeout' => 20))); + $importtxt = @file_get_contents($xmlurl, false, $ctx); + } + if($importtxt) { + require libfile('class/xml'); + $array = xml2array($importtxt); + } + $idtype = 'xml_'.$this->blockdata['id']; + foreach($array['data'] as $key=>$value) { + $value['idtype'] = $idtype; + $array['data'][$key] = $value; + } + if(empty($array['data'])) $array['data'] = null; + return $array; + } + +} + +?> \ No newline at end of file diff --git a/source/class/block/xml/blockclass.php b/source/class/block/xml/blockclass.php new file mode 100644 index 0000000..6d5033e --- /dev/null +++ b/source/class/block/xml/blockclass.php @@ -0,0 +1,19 @@ + lang('blockclass', 'blockclass_xml'), +); + + +?> \ No newline at end of file diff --git a/source/class/block/xml/index.htm b/source/class/block/xml/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/cache/cache_file.php b/source/class/cache/cache_file.php new file mode 100644 index 0000000..9b2a8bb --- /dev/null +++ b/source/class/cache/cache_file.php @@ -0,0 +1,85 @@ +conf = $conf; + } + + function get_cache($key) { + if($this->cache_exists($key)) { + $data = $this->_get_cache($key); + return $data['data']; + } + return false; + } + + function set_cache($key, $value, $life) { + global $_G; + $data = array($key => array('data' => $value, 'life' => $life)); + require_once libfile('function/cache'); + $cache_file = $this->get_cache_file_path($key); + dmkdir(dirname($cache_file)); + $cachedata = "\$data = ".arrayeval($data).";\n"; + $cachedata_save = ""; + $fp = fopen($cache_file, 'cb'); + if(!($fp && flock($fp, LOCK_EX) && ftruncate($fp, 0) && fwrite($fp, $cachedata_save) && fflush($fp) && flock($fp, LOCK_UN) && fclose($fp))) { + flock($fp, LOCK_UN); + fclose($fp); + unlink($cache_file); + exit('Can not write to cache files, please check directory ./data/ and ./data/ultraxcache/ .'); + } + return true; + } + + function del_cache($key) { + $cache_file = $this->get_cache_file_path($key); + if(file_exists($cache_file)) { + return @unlink($cache_file); + } + return true; + } + + function _get_cache($key) { + static $data = array(); + if(!isset($data[$key])) { + include $this->get_cache_file_path($key); + } + return $data[$key]; + } + + function cache_exists($key) { + $cache_file = $this->get_cache_file_path($key); + if(!file_exists($cache_file)) { + return false; + } + $data = $this->_get_cache($key); + if($data['life'] && (filemtime($cache_file) < time() - $data['life'])) { + return false; + } + return true; + } + + function get_cache_file_path($key) { + static $cache_path = array(); + if(!isset($cache_path[$key])) { + $dir = hexdec($key[0].$key[1].$key[2]) % 1000; + $cache_path[$key] = $this->conf['path'].'/'.$dir.'/'.$key.'.php'; + } + return $cache_path[$key]; + } + +} \ No newline at end of file diff --git a/source/class/cache/cache_sql.php b/source/class/cache/cache_sql.php new file mode 100644 index 0000000..e61dcde --- /dev/null +++ b/source/class/cache/cache_sql.php @@ -0,0 +1,47 @@ +conf = $conf; + } + + function get_cache($key) { + static $data = array(); + if(!isset($data[$key])) { + $cache = C::t('common_cache')->fetch($key); + if(!$cache) { + return false; + } + $data[$key] = dunserialize($cache['cachevalue']); + if($cache['life'] && ($cache['dateline'] < time() - $data[$key]['life'])) { + return false; + } + } + return $data[$key]['data']; + } + + function set_cache($key, $value, $life) { + $data = array( + 'cachekey' => $key, + 'cachevalue' => serialize(array('data' => $value, 'life' => $life)), + 'dateline' => time(), + ); + return C::t('common_cache')->insert($data); + } + + function del_cache($key) { + return C::t('common_cache')->delete($key); + } +} \ No newline at end of file diff --git a/source/class/cache/index.htm b/source/class/cache/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/class_bbcode.php b/source/class/class_bbcode.php new file mode 100644 index 0000000..4990f15 --- /dev/null +++ b/source/class/class_bbcode.php @@ -0,0 +1,117 @@ +search_exp)) { + $this->search_exp = array( + "/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is", + "/\[url\]\s*(https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/|callto:\/\/|ed2k:\/\/){1}([^\[\"']+?)\s*\[\/url\]/i", + "/\[em:([0-9]+):\]/i", + ); + $this->replace_exp = array( + "
    \\1
    ", + "\\1\\2", + " " + ); + $this->replace_exp[] = '$this->bb_img(\'\\1\')'; + $this->search_str = array('[b]', '[/b]','[i]', '[/i]', '[u]', '[/u]'); + $this->replace_str = array('', '', '','', '', ''); + } + + if($parseurl==2) { + $message = bbcode::parseurl($message); + } + + @$message = preg_replace($this->search_exp, $this->replace_exp, $message, 20); + + if($parseurl==2) { + @$message = preg_replace_callback("/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", array($this, 'bbcode2html_callback_bb_img_1'), $message, 20); + } + + @$message = str_replace($this->search_str, $this->replace_str, $message); + return nl2br(str_replace(array("\t", ' ', ' '), array('        ', '   ', '  '), $message)); + } + + function bbcode2html_callback_bb_img_1($matches) { + return $this->bb_img($matches[1]); + } + + function parseurl($message) { + return preg_replace("/(?<=[^\]a-z0-9-=\"'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i", "[url]\\1\\3[/url]", ' '.$message); + } + + function html2bbcode($message) { + + if(empty($this->html_s_exp)) { + $this->html_s_exp = array( + "/\
    \(.*?)\<\/blockquote\>\<\/div\>/is", + "/\/is", + "/(\r\n|\n|\r)/", + "//siU", + "/[ \t]*\[ \t]*/is", + "/\s*\\s*/is" + ); + $this->html_r_exp = array( + "[quote]\\1[/quote]", + "\\1", + '', + "\n", + "[em:\\1:]", + "\n[img]\\1[/img]\n" + ); + $this->html_s_str = array('', '', '','', '', '', '        ', '   ', '  ', '<', '>', '&'); + $this->html_r_str = array('[b]', '[/b]','[i]', '[/i]', '[u]', '[/u]', "\t", ' ', ' ', '<', '>', '&'); + } + + @$message = str_replace($this->html_s_str, $this->html_r_str, + preg_replace($this->html_s_exp, $this->html_r_exp, $message)); + + $message = dhtmlspecialchars($message); + + return trim($message); + } + + function bb_img($url) { + global $_G; + + if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) { + $url = isset($_G['siteurl']) && !empty($_G['siteurl']) ? $_G['siteurl'].$url : 'http://'.$url; + } + $url = addslashes($url); + return ""; + } +} + +?> \ No newline at end of file diff --git a/source/class/class_blockpermission.php b/source/class/class_blockpermission.php new file mode 100644 index 0000000..361c7cd --- /dev/null +++ b/source/class/class_blockpermission.php @@ -0,0 +1,270 @@ +insert_by_bid($bid, $users))) { + $this->_update_member_allowadmincp($uids); + } + + } + + function _update_member_allowadmincp($uids) { + if(!empty($uids)) { + $userperms = C::t('common_block_permission')->fetch_permission_by_uid($uids); + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $v) { + $v['allowadmincp'] = setstatus(4, empty($userperms[$uid]['allowmanage']) ? 0 : 1, $v['allowadmincp']); + if($userperms[$uid]['allowrecommend'] > 0 ) { + if($userperms[$uid]['allowrecommend'] == $userperms[$uid]['needverify']) { + $v['allowadmincp'] = setstatus(5, 1, $v['allowadmincp']); + $v['allowadmincp'] = setstatus(6, 0, $v['allowadmincp']); + } else { + $v['allowadmincp'] = setstatus(5, 0, $v['allowadmincp']); + $v['allowadmincp'] = setstatus(6, 1, $v['allowadmincp']); + } + } else { + $v['allowadmincp'] = setstatus(5, 0, $v['allowadmincp']); + $v['allowadmincp'] = setstatus(6, 0, $v['allowadmincp']); + } + C::t('common_member')->update($uid, array('allowadmincp'=>$v['allowadmincp'])); + } + } + } + + function delete_users_perm($bid, $users) { + $bid = intval($bid); + if($bid && $users) { + C::t('common_block_permission')->delete_by_bid_uid_inheritedtplname($bid, $users, ''); + C::t('common_block_favorite')->delete_by_uid_bid($users, $bid); + $this->_update_member_allowadmincp($users); + } + } + + function delete_inherited_perm_by_bid($bids, $inheritedtplname = '', $uid = 0) { + if(!is_array($bids)) $bids = array($bids); + if($bids) { + $uid = intval($uid); + C::t('common_block_permission')->delete_by_bid_uid_inheritedtplname($bids, $users, empty($inheritedtplname) ? true : $inheritedtplname); + if($uid) { + C::t('common_block_favorite')->delete_by_uid_bid($uid, $bids); + $this->_update_member_allowadmincp(array($uid)); + } + } + } + + function remake_inherited_perm($bid) { + $bid = intval($bid); + if($bid) { + if(($targettplname = C::t('common_template_block')->fetch_targettplname_by_bid($bid))) { + $tplpermsission = & template_permission::instance(); + $userperm = $tplpermsission->get_users_perm_by_template($targettplname); + $this->add_users_blocks($userperm, $bid, $targettplname); + } + } + } + + function get_perms_by_bid($bid, $uid = 0) { + $perms = array(); + $bid = intval($bid); + $uid = intval($uid); + if($bid) { + $perms = C::t('common_block_permission')->fetch_all_by_bid($bid, $uid); + } + return $perms; + } + + + function add_users_blocks($users, $bids, $tplname = '') { + if(($uids = C::t('common_block_permission')->insert_batch($users, $bids, $tplname))) { + $this->_update_member_allowadmincp($uids); + } + } + + function delete_perm_by_inheritedtpl($tplname, $uids) { + if(!empty($uids) && !is_array($uids)) $uids = array($uids); + if($tplname) { + C::t('common_block_permission')->delete_by_bid_uid_inheritedtplname(FALSE, $uids, $tplname); + if($uids) { + $this->_update_member_allowadmincp($uids); + } + } + } + + function delete_perm_by_template($templates) { + if($templates) { + C::t('common_block_permission')->delete_by_bid_uid_inheritedtplname(FALSE, FALSE, $templates); + } + } + function get_bids_by_template($tplname) { + return $tplname ? C::t('common_template_block')->fetch_all_bid_by_targettplname_notinherited($tplname, 0) : array(); + } +} + +class template_permission { + function __construct() {} + + public static function &instance() { + static $object; + if(empty($object)) { + $object = new template_permission(); + } + return $object; + } + + function add_users($tplname, $users) { + $templates = $this->_get_templates_subs($tplname); + $this->_add_users_templates($users, $templates); + + $blockpermission = & block_permission::instance(); + $bids = $blockpermission->get_bids_by_template($templates); + $blockpermission->add_users_blocks($users, $bids, $tplname); + } + + function delete_users($tplname, $uids) { + $uids = !is_array($uids) ? array($uids) : $uids; + $uids = array_map('intval', $uids); + $uids = array_filter($uids); + if($uids) { + C::t('common_template_permission')->delete_by_targettplname_uid_inheritedtplname($tplname, $uids, ''); + } + $this->delete_perm_by_inheritedtpl($tplname, $uids); + } + + function add_blocks($tplname, $bids){ + $users = $this->get_users_perm_by_template($tplname); + if($users) { + $blockpermission = & block_permission::instance(); + $blockpermission->add_users_blocks($users, $bids, $tplname); + } + } + + function get_users_perm_by_template($tplname){ + $perm = array(); + if($tplname) { + $perm = C::t('common_template_permission')->fetch_all_by_targettplname($tplname); + } + return $perm; + } + + function _add_users_templates($users, $templates, $uptplname = '') { + C::t('common_template_permission')->insert_batch($users, $templates, $uptplname); + } + + function delete_allperm_by_tplname($tplname){ + if($tplname) { + $tplname = is_array($tplname) ? $tplname : array($tplname); + $blockpermission = & block_permission::instance(); + $blockpermission->delete_perm_by_template($tplname); + $tplnames = dimplode($tplname); + C::t('common_template_permission')->delete_by_targettplname_uid_inheritedtplname($tplnames); + C::t('common_template_permission')->delete_by_targettplname_uid_inheritedtplname(false, false, $tplnames); + } + } + function delete_inherited_perm_by_tplname($templates, $inheritedtplname = '', $uid = 0) { + if($templates && !is_array($templates)) { + $templates = $this->_get_templates_subs($templates); + } + if($templates) { + $uid = intval($uid); + C::t('common_template_permission')->delete_by_targettplname_uid_inheritedtplname($templates, $uid, $inheritedtplname ? $inheritedtplname : true); + + $blockpermission = & block_permission::instance(); + $blocks = $blockpermission->get_bids_by_template($templates); + $blockpermission->delete_inherited_perm_by_bid($blocks, $inheritedtplname, $uid); + } + } + + function delete_perm_by_inheritedtpl($tplname, $uids = array()) { + if($uids && !is_array($uids)) $uids = array($uids); + if($tplname) { + C::t('common_template_permission')->delete_by_targettplname_uid_inheritedtplname(false, $uids, $tplname); + $blockpermission = & block_permission::instance(); + $blockpermission->delete_perm_by_inheritedtpl($tplname, $uids); + } + } + + function remake_inherited_perm($tplname, $parenttplname) { + if($tplname && $parenttplname) { + $users = $this->get_users_perm_by_template($parenttplname); + $templates = $this->_get_templates_subs($tplname); + $this->_add_users_templates($users, $templates, $parenttplname); + + $blockpermission = & block_permission::instance(); + $bids = $blockpermission->get_bids_by_template($templates); + $blockpermission->add_users_blocks($users, $bids, $parenttplname); + } + } + + function _get_templates_subs($tplname){ + global $_G; + $tplpre = 'portal/list_'; + $cattpls = array($tplname); + if(substr($tplname, 0, 12) == $tplpre){ + loadcache('portalcategory'); + $portalcategory = $_G['cache']['portalcategory']; + $catid = intval(str_replace($tplpre, '', $tplname)); + if(isset($portalcategory[$catid]) && !empty($portalcategory[$catid]['children'])) { + $children = array(); + foreach($portalcategory[$catid]['children'] as $cid) { + if(!$portalcategory[$cid]['notinheritedblock']) { + $cattpls[] = $tplpre.$cid; + if(!empty($portalcategory[$cid]['children'])) { + $children = array_merge($children, $portalcategory[$cid]['children']); + } + } + } + if(!empty($children)) { + foreach($children as $cid) { + if(!$portalcategory[$cid]['notinheritedblock']) { + $cattpls[] = $tplpre.$cid; + } + } + } + } + } + return $cattpls; + } + + function _get_templates_ups($tplname){ + global $_G; + $tplpre = 'portal/list_'; + $cattpls = array($tplname); + if(substr($tplname, 0, 12) == $tplpre){ + loadcache('portalcategory'); + $portalcategory = $_G['cache']['portalcategory']; + $catid = intval(str_replace($tplpre, '', $tplname)); + if(isset($portalcategory[$catid]) && !$portalcategory[$catid]['notinheritedblock']) { + $upid = $portalcategory[$catid]['upid']; + while(!empty($upid)) { + $cattpls[] = $tplpre.$upid; + $upid = !$portalcategory[$upid]['notinheritedblock'] ? $portalcategory[$upid]['upid'] : 0; + } + } + } + return $cattpls; + } + +} + +?> \ No newline at end of file diff --git a/source/class/class_card.php b/source/class/class_card.php new file mode 100644 index 0000000..ea53214 --- /dev/null +++ b/source/class/class_card.php @@ -0,0 +1,125 @@ +"\@", "num"=>"\#", "full"=>"\*"); + var $sysrule = ''; + var $rule = ''; + var $rulemap_str = "ABCDEFGHIJKLMNPQRSTUVWXYZ"; + var $rulemap_num = "123456789"; + + var $rulereturn = array(); + var $cardlist = array(); + + var $succeed = 0; + var $fail = 0; + var $failmin = 1; + var $failrate = '0.1'; + + + function __construct() { + $this->init(); + } + + function init() { + global $_G; + $this->set = &$_G['setting']['card']; + $this->sysrule = "^[A-Z0-9".implode('|', $this->rulekey)."]+$"; + } + + function make($rule = '', $num = 1, $cardval = array()) { + global $_G; + $this->rule = empty($rule) ? $this->set['rule'] : trim($rule) ; + if(empty($this->rule)) { + return -1; + } + $this->fail($num); + $cardval['makeruid'] = $_G['uid']; + $cardval['dateline'] = $_G['timestamp']; + for($i = 0; $i < $num ; $i++) { + if($this->checkrule($this->rule)) { + $card = $this->rule; + foreach($this->rulereturn AS $key => $val) { + $search = array(); + foreach($val AS $skey => $sval) { + $search[] = '/'.$this->rulekey[$key].'/'; + } + $card = preg_replace($search, $val, $card, 1); + } + } else { + return 0; + } + $cardval['id'] = $card; + C::t('common_card')->insert($cardval, false, false, 'SILENT'); + if(($sqlerror = DB::error())) { + if($sqlerror == 1062) { + $this->fail++; + if($this->failmin > $this->fail) { + $num++; + } else { + $num = $i - 1; + } + }/* else { + DB::halt($sqlerror, $sql); + }*/ + } else { + $this->succeed += intval(DB::affected_rows()); + $this->cardlist[] = $card; + } + } + return true; + } + + + function checkrule($rule, $type = '0') { + if(!preg_match("/($this->sysrule)/i", $rule)){ + return -2; + } + if($type == 0) { + foreach($this->rulekey AS $key => $val) { + $match = array(); + preg_match_all("/($val){1}/i", $rule, $match); + $number[$key] = count($match[0]); + if($number[$key] > 0) { + for($i = 0; $i < $number[$key]; $i++) { + switch($key) { + case 'str': + $rand = mt_rand(0, (strlen($this->rulemap_str) - 1)); + $this->rulereturn[$key][$i] = $this->rulemap_str[$rand]; + break; + case 'num': + $rand = mt_rand(0, (strlen($this->rulemap_num) - 1)); + $this->rulereturn[$key][$i] = $this->rulemap_num[$rand]; + break; + case 'full': + $fullstr = $this->rulemap_str.$this->rulemap_num; + $rand = mt_rand(0,(strlen($fullstr) - 1)); + $this->rulereturn[$key][$i] = $fullstr[$rand]; + break; + } + } + } + } + } + return true; + + } + + function fail($num = 1) { + $failrate = $this->failrate ? (float)$this->failrate : '0.1'; + $this->failmin = ceil($num * $failrate); + $this->failmin = $this->failmin > 100 ? 100 : $this->failmin; + } +}; +?> \ No newline at end of file diff --git a/source/class/class_cexception.php b/source/class/class_cexception.php new file mode 100644 index 0000000..5a35c9d --- /dev/null +++ b/source/class/class_cexception.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/source/class/class_chinese.php b/source/class/class_chinese.php new file mode 100644 index 0000000..67bd6c6 --- /dev/null +++ b/source/class/class_chinese.php @@ -0,0 +1,250 @@ + '', + 'TargetLang' => '', + 'GBtoUnicode_table' => 'gb-unicode.table', + 'BIG5toUnicode_table' => 'big5-unicode.table', + 'GBtoBIG5_table' => 'gb-big5.table', + ); + + function __construct($SourceLang, $TargetLang, $ForceTable = FALSE) { + $this->config['SourceLang'] = $this->_lang($SourceLang); + $this->config['TargetLang'] = $this->_lang($TargetLang); + + if(ICONV_ENABLE && $this->config['TargetLang'] != 'BIG5' && !$ForceTable) { + $this->iconv_enabled = true; + } else { + $this->iconv_enabled = false; + $this->OpenTable(); + } + } + + function _lang($LangCode) { + $LangCode = strtoupper($LangCode); + + if(substr($LangCode, 0, 2) == 'GB') { + return 'GBK'; + } elseif(substr($LangCode, 0, 3) == 'BIG') { + return 'BIG5'; + } elseif(substr($LangCode, 0, 3) == 'UTF') { + return 'UTF-8'; + } elseif(substr($LangCode, 0, 3) == 'UNI') { + return 'UNICODE'; + } + } + + function _hex2bin($hexdata) { + for($i=0; $i < strlen($hexdata); $i += 2) { + $bindata .= chr(hexdec(substr($hexdata, $i, 2))); + } + return $bindata; + } + + function OpenTable() { + $this->unicode_table = array(); + if(!$this->iconv_enabled && $this->config['TargetLang'] == 'BIG5') { + $this->config['TargetLang'] = 'GBK'; + $this->convertbig5 = TRUE; + } + if($this->config['SourceLang'] == 'GBK' || $this->config['TargetLang'] == 'GBK') { + $this->table = CODETABLE_DIR.$this->config['GBtoUnicode_table']; + } elseif($this->config['SourceLang'] == 'BIG5' || $this->config['TargetLang'] == 'BIG5') { + $this->table = CODETABLE_DIR.$this->config['BIG5toUnicode_table']; + } + if(!$this->table) { + return; + } + $fp = fopen($this->table, 'rb'); + $tabletmp = fread($fp, filesize($this->table)); + for($i = 0; $i < strlen($tabletmp); $i += 4) { + $tmp = unpack('nkey/nvalue', substr($tabletmp, $i, 4)); + if($this->config['TargetLang'] == 'UTF-8') { + $this->unicode_table[$tmp['key']] = '0x'.dechex($tmp['value']); + } elseif($this->config['SourceLang'] == 'UTF-8') { + $this->unicode_table[$tmp['value']] = '0x'.dechex($tmp['key']); + } elseif($this->config['TargetLang'] == 'UNICODE') { + $this->unicode_table[$tmp['key']] = dechex($tmp['value']); + } + } + } + + function CHSUtoUTF8($c) { + $str = ''; + if($c < 0x80) { + $str .= $c; + } elseif($c < 0x800) { + $str .= (0xC0 | $c >> 6); + $str .= (0x80 | $c & 0x3F); + } elseif($c < 0x10000) { + $str .= (0xE0 | $c >> 12); + $str .= (0x80 | $c >> 6 & 0x3F); + $str .=( 0x80 | $c & 0x3F); + } elseif($c < 0x200000) { + $str .= (0xF0 | $c >> 18); + $str .= (0x80 | $c >> 12 & 0x3F); + $str .= (0x80 | $c >> 6 & 0x3F); + $str .= (0x80 | $c & 0x3F); + } + return $str; + } + + function GB2312toBIG5($c) { + $f = fopen(CODETABLE_DIR.$this->config['GBtoBIG5_table'], 'r'); + $max=strlen($c)-1; + for($i = 0;$i < $max;$i++){ + $h=ord($c[$i]); + if($h>=160) { + $l=ord($c[$i+1]); + if($h==161 && $l==64){ + $gb=" "; + } else{ + fseek($f,($h-160)*510+($l-1)*2); + $gb=fread($f,2); + } + $c[$i]=$gb[0]; + $c[$i+1]=$gb[1]; + $i++; + } + } + $result = $c; + return $result; + } + + function Convert($SourceText) { + if($this->config['SourceLang'] == $this->config['TargetLang']) { + return $SourceText; + } elseif($this->iconv_enabled) { + if($this->config['TargetLang'] <> 'UNICODE') { + return iconv($this->config['SourceLang'], $this->config['TargetLang'], $SourceText); + } else { + $return = ''; + while($SourceText != '') { + if(ord(substr($SourceText, 0, 1)) > 127) { + $return .= "&#x".dechex($this->Utf8_Unicode(iconv($this->config['SourceLang'],"UTF-8", substr($SourceText, 0, 2)))).";"; + $SourceText = substr($SourceText, 2, strlen($SourceText)); + } else { + $return .= substr($SourceText, 0, 1); + $SourceText = substr($SourceText, 1, strlen($SourceText)); + } + } + return $return; + } + + } elseif($this->config['TargetLang'] == 'UNICODE') { + $utf = ''; + while($SourceText != '') { + if(ord(substr($SourceText, 0, 1)) > 127) { + if($this->config['SourceLang'] == 'GBK') { + $utf .= '&#x'.$this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2))) - 0x8080].';'; + } elseif($this->config['SourceLang'] == 'BIG5') { + $utf .= '&#x'.$this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2)))].';'; + } + $SourceText = substr($SourceText, 2, strlen($SourceText)); + } else { + $utf .= substr($SourceText, 0, 1); + $SourceText = substr($SourceText, 1, strlen($SourceText)); + } + } + return $utf; + } else { + $ret = ''; + if($this->config['SourceLang'] == 'UTF-8') { + $out = ''; + $len = strlen($SourceText); + $i = 0; + while($i < $len) { + $c = ord(substr($SourceText, $i++, 1)); + switch($c >> 4) { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + $out .= substr($SourceText, $i - 1, 1); + break; + case 12: case 13: + $char2 = ord(substr($SourceText, $i++, 1)); + $char3 = $this->unicode_table[(($c & 0x1F) << 6) | ($char2 & 0x3F)]; + if($this->config['TargetLang'] == 'GBK') { + $out .= $this->_hex2bin(dechex($char3 + 0x8080)); + } elseif($this->config['TargetLang'] == 'BIG5') { + $out .= $this->_hex2bin($char3); + } + break; + case 14: + $char2 = ord(substr($SourceText, $i++, 1)); + $char3 = ord(substr($SourceText, $i++, 1)); + $char4 = $this->unicode_table[(($c & 0x0F) << 12) | (($char2 & 0x3F) << 6) | (($char3 & 0x3F) << 0)]; + if($this->config['TargetLang'] == 'GBK') { + $out .= $this->_hex2bin(dechex($char4 + 0x8080)); + } elseif($this->config['TargetLang'] == 'BIG5') { + $out .= $this->_hex2bin($char4); + } + break; + } + } + return !$this->convertbig5 ? $out : $this->GB2312toBIG5($out); + } else { + while($SourceText != '') { + if(ord(substr($SourceText, 0, 1)) > 127) { + if($this->config['SourceLang'] == 'BIG5') { + $utf8 = $this->CHSUtoUTF8(hexdec($this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2)))])); + } elseif($this->config['SourceLang'] == 'GBK') { + $utf8=$this->CHSUtoUTF8(hexdec($this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2))) - 0x8080])); + } + for($i = 0; $i < strlen($utf8); $i += 3) { + $ret .= chr(substr($utf8, $i, 3)); + } + $SourceText = substr($SourceText, 2, strlen($SourceText)); + } else { + $ret .= substr($SourceText, 0, 1); + $SourceText = substr($SourceText, 1, strlen($SourceText)); + } + } + $SourceText = ''; + return $ret; + } + } + } + + function Utf8_Unicode($char) { + switch(strlen($char)) { + case 1: + return ord($char); + case 2: + $n = (ord($char[0]) & 0x3f) << 6; + $n += ord($char[1]) & 0x3f; + return $n; + case 3: + $n = (ord($char[0]) & 0x1f) << 12; + $n += (ord($char[1]) & 0x3f) << 6; + $n += ord($char[2]) & 0x3f; + return $n; + case 4: + $n = (ord($char[0]) & 0x0f) << 18; + $n += (ord($char[1]) & 0x3f) << 12; + $n += (ord($char[2]) & 0x3f) << 6; + $n += ord($char[3]) & 0x3f; + return $n; + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/class_core.php b/source/class/class_core.php new file mode 100644 index 0000000..680fb4d --- /dev/null +++ b/source/class/class_core.php @@ -0,0 +1,204 @@ + 1) { + $args = func_get_args(); + unset($args[0]); + } + return self::_make_obj($name, 'model', true, $args); + } + + protected static function _make_obj($name, $type, $extendable = false, $p = array()) { + $pluginid = null; + if($name[0] === '#') { + list(, $pluginid, $name) = explode('#', $name); + } + $cname = $type.'_'.$name; + if(!isset(self::$_tables[$cname])) { + if(!class_exists($cname, false)) { + self::import(($pluginid ? 'plugin/'.$pluginid : 'class').'/'.$type.'/'.$name); + } + if($extendable) { + self::$_tables[$cname] = new discuz_container(); + switch (count($p)) { + case 0: self::$_tables[$cname]->obj = new $cname();break; + case 1: self::$_tables[$cname]->obj = new $cname($p[1]);break; + case 2: self::$_tables[$cname]->obj = new $cname($p[1], $p[2]);break; + case 3: self::$_tables[$cname]->obj = new $cname($p[1], $p[2], $p[3]);break; + case 4: self::$_tables[$cname]->obj = new $cname($p[1], $p[2], $p[3], $p[4]);break; + case 5: self::$_tables[$cname]->obj = new $cname($p[1], $p[2], $p[3], $p[4], $p[5]);break; + default: $ref = new ReflectionClass($cname);self::$_tables[$cname]->obj = $ref->newInstanceArgs($p);unset($ref);break; + } + } else { + self::$_tables[$cname] = new $cname(); + } + } + return self::$_tables[$cname]; + } + + public static function memory() { + if(!self::$_memory) { + self::$_memory = new discuz_memory(); + self::$_memory->init(self::app()->config['memory']); + } + return self::$_memory; + } + + public static function import($name, $folder = '', $force = true) { + $key = $folder.$name; + if(!isset(self::$_imports[$key])) { + $path = DISCUZ_ROOT.'/source/'.$folder; + if(strpos($name, '/') !== false) { + $pre = basename(dirname($name)); + $filename = dirname($name).'/'.$pre.'_'.basename($name).'.php'; + } else { + $filename = $name.'.php'; + } + + if(is_file($path.'/'.$filename)) { + include $path.'/'.$filename; + self::$_imports[$key] = true; + + return true; + } elseif(!$force) { + return false; + } else { + throw new Exception('Oops! System file lost: '.$filename); + } + } + return true; + } + + public static function handleException($exception) { + discuz_error::exception_error($exception); + } + + + public static function handleError($errno, $errstr, $errfile, $errline) { + if($errno & DISCUZ_CORE_DEBUG) { + discuz_error::system_error($errstr, false, true, false); + } + } + + public static function handleShutdown() { + if(($error = error_get_last()) && $error['type'] & DISCUZ_CORE_DEBUG) { + discuz_error::system_error($error['message'], false, true, false); + } + } + + public static function autoload($class) { + $class = strtolower($class); + if(strpos($class, '_') !== false) { + list($folder) = explode('_', $class); + $file = 'class/'.$folder.'/'.substr($class, strlen($folder) + 1); + } else { + $file = 'class/'.$class; + } + + try { + + self::import($file); + return true; + + } catch (Exception $exc) { + + $trace = $exc->getTrace(); + foreach ($trace as $log) { + if(empty($log['class']) && $log['function'] == 'class_exists') { + return false; + } + } + discuz_error::exception_error($exc); + } + } + + public static function analysisStart($name){ + $key = 'other'; + if($name[0] === '#') { + list(, $key, $name) = explode('#', $name); + } + if(!isset($_ENV['analysis'])) { + $_ENV['analysis'] = array(); + } + if(!isset($_ENV['analysis'][$key])) { + $_ENV['analysis'][$key] = array(); + $_ENV['analysis'][$key]['sum'] = 0; + } + $_ENV['analysis'][$key][$name]['start'] = microtime(TRUE); + $_ENV['analysis'][$key][$name]['start_memory_get_usage'] = memory_get_usage(); + $_ENV['analysis'][$key][$name]['start_memory_get_real_usage'] = memory_get_usage(true); + $_ENV['analysis'][$key][$name]['start_memory_get_peak_usage'] = memory_get_peak_usage(); + $_ENV['analysis'][$key][$name]['start_memory_get_peak_real_usage'] = memory_get_peak_usage(true); + } + + public static function analysisStop($name) { + $key = 'other'; + if($name[0] === '#') { + list(, $key, $name) = explode('#', $name); + } + if(isset($_ENV['analysis'][$key][$name]['start'])) { + $diff = round((microtime(TRUE) - $_ENV['analysis'][$key][$name]['start']) * 1000, 5); + $_ENV['analysis'][$key][$name]['time'] = $diff; + $_ENV['analysis'][$key]['sum'] = $_ENV['analysis'][$key]['sum'] + $diff; + unset($_ENV['analysis'][$key][$name]['start']); + $_ENV['analysis'][$key][$name]['stop_memory_get_usage'] = memory_get_usage(); + $_ENV['analysis'][$key][$name]['stop_memory_get_real_usage'] = memory_get_usage(true); + $_ENV['analysis'][$key][$name]['stop_memory_get_peak_usage'] = memory_get_peak_usage(); + $_ENV['analysis'][$key][$name]['stop_memory_get_peak_real_usage'] = memory_get_peak_usage(true); + } + return $_ENV['analysis'][$key][$name]; + } +} + +class C extends core {} +class DB extends discuz_database {} + +?> \ No newline at end of file diff --git a/source/class/class_credit.php b/source/class/class_credit.php new file mode 100644 index 0000000..51a77aa --- /dev/null +++ b/source/class/class_credit.php @@ -0,0 +1,517 @@ +coef = $coef; + $uid = intval($uid ? $uid : $_G['uid']); + $fid = $fid ? $fid : (isset($_G['fid']) && $_G['fid'] ? $_G['fid'] : 0); + $rule = $this->getrule($action, $fid); + $updatecredit = false; + + $enabled = false; + if($rule) { + for ($i = 1; $i<=8; $i++) { + if(!empty($rule['extcredits'.$i])) { + $enabled = true; break; + } + } + } + + if($enabled) { + $rulelog = array(); + $fids = $rule['fids'] ? explode(',', $rule['fids']) : array(); + $fid = in_array($fid, $fids) ? $fid : 0; + $rulelog = $this->getrulelog($rule['rid'], $uid, $fid); + if($rulelog && $rule['norepeat']) { + $rulelog = array_merge($rulelog, $this->getchecklogbyclid($rulelog['clid'], $uid)); + $rulelog['norepeat'] = $rule['norepeat']; + } + if($rule['rewardnum'] && $rule['rewardnum'] < $coef) { + $coef = $rule['rewardnum']; + } + if(empty($rulelog)) { + $logarr = array( + 'uid' => $uid, + 'rid' => $rule['rid'], + 'fid' => $fid, + 'total' => $coef, + 'cyclenum' => $coef, + 'dateline' => $_G['timestamp'] + ); + + if(in_array($rule['cycletype'], array(2,3))) { + $logarr['starttime'] = $_G['timestamp']; + } + $logarr = $this->addlogarr($logarr, $rule, false); + if($update) { + $clid = C::t('common_credit_rule_log')->insert($logarr, 1); + if($rule['norepeat']) { + $rulelog['isnew'] = 1; + $rulelog['clid'] = $clid; + $rulelog['uid'] = $uid; + $rulelog['norepeat'] = $rule['norepeat']; + $this->updatecheating($rulelog, $needle, true); + } + } + $updatecredit = true; + } else { + + $newcycle = false; + $logarr = array(); + switch($rule['cycletype']) { + case 0: + break; + case 1: + case 4: + if($rule['cycletype'] == 1) { + $today = strtotime(dgmdate($_G['timestamp'], 'Y-m-d')); + if($rulelog['dateline'] < $today && $rule['rewardnum']) { + $rulelog['cyclenum'] = 0; + $newcycle = true; + } + } + if(empty($rule['rewardnum']) || $rulelog['cyclenum'] < $rule['rewardnum']) { + if($rule['norepeat']) { + $repeat = $this->checkcheating($rulelog, $needle, $rule['norepeat']); + if($repeat && !$newcycle) { + return false; + } + } + if($rule['rewardnum']) { + $remain = $rule['rewardnum'] - $rulelog['cyclenum']; + if($remain < $coef) { + $coef = $remain; + } + } + $cyclenunm = $newcycle ? $coef : "cyclenum+'$coef'"; + $logarr = array( + 'cyclenum' => "cyclenum=$cyclenunm", + 'total' => "total=total+'$coef'", + 'dateline' => "dateline='{$_G['timestamp']}'" + ); + $updatecredit = true; + } + break; + + case 2: + case 3: + $nextcycle = 0; + if($rulelog['starttime']) { + if($rule['cycletype'] == 2) { + $start = strtotime(dgmdate($rulelog['starttime'], 'Y-m-d H:00:00')); + $nextcycle = $start+$rule['cycletime']*3600; + } else { + $nextcycle = $rulelog['starttime']+$rule['cycletime']*60; + } + } + if($_G['timestamp'] <= $nextcycle && $rulelog['cyclenum'] < $rule['rewardnum']) { + if($rule['norepeat']) { + $repeat = $this->checkcheating($rulelog, $needle, $rule['norepeat']); + if($repeat && !$newcycle) { + return false; + } + } + if($rule['rewardnum']) { + $remain = $rule['rewardnum'] - $rulelog['cyclenum']; + if($remain < $coef) { + $coef = $remain; + } + } + $logarr = array( + 'cyclenum' => "cyclenum=cyclenum+'$coef'", + 'total' => "total=total+'$coef'", + 'dateline' => "dateline='{$_G['timestamp']}'" + ); + $updatecredit = true; + } elseif($_G['timestamp'] >= $nextcycle) { + $newcycle = true; + $logarr = array( + 'cyclenum' => "cyclenum=$coef", + 'total' => "total=total+'$coef'", + 'dateline' => "dateline='{$_G['timestamp']}'", + 'starttime' => "starttime='{$_G['timestamp']}'", + ); + $updatecredit = true; + } + break; + } + if($update) { + if($rule['norepeat'] && $needle) { + $this->updatecheating($rulelog, $needle, $newcycle); + } + if($logarr) { + $logarr = $this->addlogarr($logarr, $rule, true); + C::t('common_credit_rule_log')->increase($rulelog['clid'], $logarr); + } + } + + } + + } + if($update && ($updatecredit || $this->extrasql)) { + if(!$updatecredit) { + for($i = 1; $i <= 8; $i++) { + if(isset($_G['setting']['extcredits'][$i])) { + $rule['extcredits'.$i] = 0; + } + } + } + $this->updatecreditbyrule($rule, $uid, $coef, $fid); + } + $rule['updatecredit'] = $updatecredit; + + return $rule; + } + + function lowerlimit($rule, $uid = 0, $coef = 1, $fid = 0) { + global $_G; + + $uid = $uid ? $uid : intval($_G['uid']); + if($this->checklowerlimit && $uid && $_G['setting']['creditspolicy']['lowerlimit']) { + $member = C::t('common_member_count')->fetch($uid); + $fid = $fid ? $fid : (isset($_G['fid']) && $_G['fid'] ? $_G['fid'] : 0); + $rule = is_array($rule) ? $rule : $this->getrule($rule, $fid); + for($i = 1; $i <= 8; $i++) { + if($_G['setting']['extcredits'][$i] && $rule['extcredits'.$i]) { + $limit = (float)$_G['setting']['creditspolicy']['lowerlimit'][$i]; + $extcredit = (float)$rule['extcredits'.$i] * $coef; + if($extcredit < 0 && ($member['extcredits'.$i] + $extcredit) < $limit) { + return $i; + } + } + } + } + return true; + } + + function updatecreditbyrule($rule, $uids = 0, $coef = 1, $fid = 0) { + global $_G; + + $this->coef = intval($coef); + $fid = $fid ? $fid : (isset($_G['fid']) && $_G['fid'] ? $_G['fid'] : 0); + $uids = $uids ? $uids : intval($_G['uid']); + $rule = is_array($rule) ? $rule : $this->getrule($rule, $fid); + $creditarr = array(); + $updatecredit = false; + for($i = 1; $i <= 8; $i++) { + if(isset($_G['setting']['extcredits'][$i])) { + $creditarr['extcredits'.$i] = intval($rule['extcredits'.$i]) * $this->coef; + if(defined('IN_MOBILE') && $creditarr['extcredits'.$i] > 0) { + $creditarr['extcredits'.$i] += (int)$_G['setting']['creditspolicymobile']; + } + $updatecredit = true; + } + } + if($updatecredit || $this->extrasql) { + require_once libfile('function/credit'); + credit_log($uids, 'RUL', $rule['rid'], $creditarr, $rule['rulename'].($fid ? '(fid:'.$fid.')' : '')); + $this->updatemembercount($creditarr, $uids, is_array($uids) ? false : true, $this->coef > 0 ? urldecode($rule['rulenameuni']) : ''); + } + } + + function frequencycheck($uids) { + global $_G; + if(empty($_G['config']['security']['creditsafe']['second']) || empty($_G['config']['security']['creditsafe']['times'])) { + return true; + } + foreach($uids as $uid) { + $key = 'credit_fc'.$uid; + $v = intval(memory('get', $key)); + memory('set', $key, ++$v, $_G['config']['security']['creditsafe']['second']); + if($v > $_G['config']['security']['creditsafe']['times']) { + system_error('credit frequency limit', true); + return false; + } + } + return true; + } + + function updatemembercount($creditarr, $uids = 0, $checkgroup = true, $ruletxt = '') { + global $_G; + + if(!$uids) $uids = intval($_G['uid']); + $uids = is_array($uids) ? $uids : array($uids); + $this->frequencycheck($uids); + if($uids && ($creditarr || $this->extrasql)) { + if($this->extrasql) $creditarr = array_merge($creditarr, $this->extrasql); + $sql = array(); + $allowkey = array('extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8', 'friends', 'posts', 'threads', 'oltime', 'digestposts', 'doings', 'blogs', 'albums', 'sharings', 'attachsize', 'views', 'todayattachs', 'todayattachsize'); + $creditnotice = $_G['setting']['creditnotice'] && $_G['uid'] && $uids == array($_G['uid']); + if($creditnotice) { + if(!isset($_G['cookiecredits'])) { + $_G['cookiecredits'] = !empty($_COOKIE['creditnotice']) ? explode('D', $_COOKIE['creditnotice']) : array_fill(0, 9, 0); + for($i = 1; $i <= 8; $i++) { + $_G['cookiecreditsbase'][$i] = getuserprofile('extcredits'.$i); + } + } + if($ruletxt) { + $_G['cookiecreditsrule'][$ruletxt] = $ruletxt; + } + } + foreach($creditarr as $key => $value) { + if(!empty($key) && $value && in_array($key, $allowkey)) { + $sql[$key] = $value; + if($creditnotice && substr($key, 0, 10) == 'extcredits') { + $i = substr($key, 10); + $_G['cookiecredits'][$i] += $value; + } + } + } + if($creditnotice) { + dsetcookie('creditnotice', implode('D', $_G['cookiecredits']).'D'.$_G['uid']); + dsetcookie('creditbase', '0D'.implode('D', $_G['cookiecreditsbase'])); + if(!empty($_G['cookiecreditsrule'])) { + dsetcookie('creditrule', strip_tags(implode("\t", $_G['cookiecreditsrule']))); + } + } + if($sql) { + C::t('common_member_count')->increase($uids, $sql); + } + if($checkgroup && count($uids) == 1) $this->checkusergroup($uids[0]); + $this->extrasql = array(); + } + } + + function countcredit($uid, $update = true) { + global $_G; + + $credits = 0; + if($uid && !empty($_G['setting']['creditsformula'])) { + $member = C::t('common_member_count')->fetch($uid); + eval("\$credits = round(".$_G['setting']['creditsformula'].");"); + if($uid == $_G['uid']) { + if($update && $_G['member']['credits'] != $credits) { + C::t('common_member')->update_credits($uid, $credits); + $_G['member']['credits'] = $credits; + } + } elseif($update) { + C::t('common_member')->update_credits($uid, $credits); + } + } + return $credits; + } + + function checkusergroup($uid) { + global $_G; + + $uid = intval($uid ? $uid : $_G['uid']); + $groupid = 0; + if(!$uid) return $groupid; + if($uid != $_G['uid']) { + $member = getuserbyuid($uid); + } else { + $member = $_G['member']; + } + if(empty($member)) return $groupid; + + $credits = $this->countcredit($uid, false); + $updatearray = array(); + $groupid = $member['groupid']; + $group = C::t('common_usergroup')->fetch($member['groupid']); + if($member['credits'] != $credits) { + $updatearray['credits'] = $credits; + $member['credits'] = $credits; + } + $member['credits'] = $member['credits'] == '' ? 0 : $member['credits'] ; + $sendnotify = false; + if(empty($group) || $group['type'] == 'member' && !($member['credits'] >= $group['creditshigher'] && $member['credits'] < $group['creditslower'])) { + $newgroup = C::t('common_usergroup')->fetch_by_credits($member['credits']); + if(!empty($newgroup)) { + if($member['groupid'] != $newgroup['groupid']) { + $updatearray['groupid'] = $groupid = $newgroup['groupid']; + if($uid == $_G['uid']) { + $_G['member']['groupid'] = $newgroup['groupid']; + } + $sendnotify = true; + } + } + } + if($updatearray) { + C::t('common_member')->update($uid, $updatearray); + } + if($sendnotify) { + notification_add($uid, 'system', 'user_usergroup', array('usergroup' => ''.$newgroup['grouptitle'].'', 'from_id' => 0, 'from_idtype' => 'changeusergroup'), 1); + } + + return $groupid; + + } + + public static function deletelogbyfid($rid, $fid) { + + $fid = intval($fid); + if($rid && $fid) { + $lids = C::t('common_credit_rule_log')->fetch_ids_by_rid_fid($rid, $fid); + if($lids) { + C::t('common_credit_rule_log')->delete($lids); + C::t('common_credit_rule_log_field')->delete_clid($lids); + } + } + } + + function updatecheating($rulelog, $needle, $newcycle) { + if($needle) { + $logarr = array(); + switch($rulelog['norepeat']) { + case 0: + break; + case 1: + $info = empty($rulelog['info'])||$newcycle ? $needle : $rulelog['info'].','.$needle; + $logarr['info'] = addslashes($info); + break; + case 2: + $user = empty($rulelog['user'])||$newcycle ? $needle : $rulelog['user'].','.$needle; + $logarr['user'] = addslashes($user); + break; + case 3: + $app = empty($rulelog['app'])||$newcycle ? $needle : $rulelog['app'].','.$needle; + $logarr['app'] = addslashes($app); + break; + } + if($rulelog['isnew']) { + $logarr['clid'] = $rulelog['clid']; + $logarr['uid'] = $rulelog['uid']; + C::t('common_credit_rule_log_field')->insert($logarr); + } elseif($logarr) { + C::t('common_credit_rule_log_field')->update_field($rulelog['uid'], $rulelog['clid'],$logarr); + } + } + } + + function addlogarr($logarr, $rule, $issql = 0) { + global $_G; + + for($i = 1; $i <= 8; $i++) { + if(getglobal('setting/extcredits/'.$i)) { + $extcredit = intval($rule['extcredits'.$i]) * $this->coef; + if($issql) { + $logarr['extcredits'.$i] = 'extcredits'.$i."='$extcredit'"; + } else { + $logarr['extcredits'.$i] = $extcredit; + } + } + } + return $logarr; + } + + function getrule($action, $fid = 0) { + global $_G; + + if(empty($action)) { + return false; + } + $fid = $fid ? $fid : (isset($_G['fid']) && $_G['fid'] ? $_G['fid'] : 0); + if($_G['forum'] && $_G['forum']['status'] == 3) { + $group_creditspolicy = $_G['grouplevels'][$_G['forum']['level']]['creditspolicy']; + if(is_array($group_creditspolicy) && empty($group_creditspolicy[$action])) { + return false; + } else { + $fid = 0; + } + } + loadcache('creditrule'); + $rule = false; + if(is_array($_G['cache']['creditrule'][$action])) { + $rule = $_G['cache']['creditrule'][$action]; + $rulenameuni = $rule['rulenameuni']; + if($rule['fids'] && $fid) { + $fid = intval($fid); + $fids = explode(',', $rule['fids']); + if(in_array($fid, $fids)) { + $forumfield = C::t('forum_forumfield')->fetch($fid); + $policy = dunserialize($forumfield['creditspolicy']); + if(isset($policy[$action])) { + $rule = $policy[$action]; + $rule['rulenameuni'] = $rulenameuni; + $rule['fids'] = implode(',', $fids); + } + } + } + + for($i = 1; $i <= 8; $i++) { + if(empty($_G['setting']['extcredits'][$i])) { + unset($rule['extcredits'.$i]); + continue; + } + $rule['extcredits'.$i] = intval($rule['extcredits'.$i]); + } + } + return $rule; + } + + function getrulelog($rid, $uid = 0, $fid = 0) { + global $_G; + + $log = array(); + $uid = $uid ? $uid : $_G['uid']; + if($rid && $uid) { + $log = C::t('common_credit_rule_log')->fetch_rule_log($rid, $uid, $fid); + } + return $log; + } + + function checkcheating($rulelog, $needle, $checktype) { + + $repeat = false; + switch($checktype) { + case 0: + break; + case 1: + $infoarr = explode(',', $rulelog['info']); + if(!empty($rulelog['info']) && in_array($needle, $infoarr)) { + $repeat = true; + } + break; + case 2: + $userarr = explode(',', $rulelog['user']); + if(!empty($rulelog['user']) && in_array($needle, $userarr)) { + $repeat = true; + } + break; + case 3: + $apparr = explode(',', $rulelog['app']); + if(!empty($rulelog['app']) && in_array($needle, $apparr)) { + $repeat = true; + } + break; + } + return $repeat; + } + + function getchecklogbyclid($clid, $uid = 0) { + global $_G; + + $uid = $uid ? $uid : $_G['uid']; + return C::t('common_credit_rule_log_field')->fetch_field($uid, $clid); + } +} + +?> \ No newline at end of file diff --git a/source/class/class_dbexception.php b/source/class/class_dbexception.php new file mode 100644 index 0000000..7842276 --- /dev/null +++ b/source/class/class_dbexception.php @@ -0,0 +1,27 @@ +sql = $sql; + parent::__construct($message, $code); + } + + public function getSql() { + return $this->sql; + } +} +?> \ No newline at end of file diff --git a/source/class/class_filesock.php b/source/class/class_filesock.php new file mode 100644 index 0000000..0f9d063 --- /dev/null +++ b/source/class/class_filesock.php @@ -0,0 +1,20 @@ +mod = $model; + } + if($loop > -1) { + $this->loop = floor($loop - 1); + $this->use_loop = true; + } + if($t1 > -1 && $t2 > -1 && $t3 > -1) { + $this->trans1 = $t1; + $this->trans2 = $t2; + $this->trans3 = $t3; + $this->transparent = true; + } + for($i = 0; $i < count($images); $i++) { + $dl[$i] ? $this->delay = $dl[$i] : $this->delay = $this->dly; + $xpos[$i] ? $this->x = $xpos[$i] : $this->x = 0; + $ypos[$i] ? $this->y = $ypos[$i] : $this->y = 0; + $this->start_gifmerge_process($images[$i]); + } + $this->fout .= "\x3b"; + } + + function start_gifmerge_process($fp) { + if($this->mod == 'C_FILE') { + if(!$this->fin = fopen($fp, 'rb')) { + return; + } + } elseif($this->mod == 'C_MEMORY') { + $this->ch = 0; + $this->fin = $fp; + } + $this->getbytes(6); + if(!$this->arrcmp($this->buffer, $this->gif, 3)) { + return; + } + $this->getbytes(7); + if($this->first) $this->logical_screen_descriptor = $this->buffer; + $this->global_color_table_sizecode = $this->buffer[4] & 0x07; + $this->global_color_table_size = 2 << $this->global_color_table_sizecode; + if($this->buffer[4] & 0x80) { + $this->getbytes((3 * $this->global_color_table_size)); + for($i = 0; $i < ((3 * $this->global_color_table_size)); $i++) { + $this->global_in[$i] = $this->buffer[$i]; + } + if($this->out_color_table_size == 0) { + $this->out_color_table_size = $this->global_color_table_size; + $this->out_color_table_sizecode = $this->global_color_table_sizecode; + $this->global_out = $this->global_in; + } + if($this->global_color_table_size != $this->out_color_table_size || $this->arrcmp($this->global_out, $this->global_in, (3 * $this->global_color_table_size))) { + $this->use_global_in = true; + } + } + for($loop = true; $loop;) { + $this->getbytes(1); + switch($this->buffer[0]) { + case 0x21: + $this->read_extension(); + break; + case 0x2c: + $this->read_image_descriptor(); + break; + case 0x3b: + $loop = false; + break; + default: + $loop = false; + } + } + if($this->mod == 'C_FILE') { + fclose($this->fin); + } + } + + function read_image_descriptor() { + $this->getbytes(9); + $head = $this->buffer; + $this->local_color_table_flag = ($this->buffer[8] & 0x80) ? true : false; + if($this->local_color_table_flag) { + $sizecode = $this->buffer[8] & 0x07; + $size = 2 << $sizecode; + $this->getbytes(3 * $size); + for($i = 0; $i < (3 * $size); $i++) { + $this->local_in[$i] = $this->buffer[$i]; + } + if($this->out_color_table_size == 0) { + $this->out_color_table_size = $size; + $this->out_color_table_sizecode = $sizecode; + for($i = 0; $i < (3 * $size); $i++) { + $this->global_out[$i] = $this->local_in[$i]; + } + } + } + if($this->first) { + $this->first = false; + $this->fout .= "\x47\x49\x46\x38\x39\x61"; + if($this->width && $this->height) { + $this->logical_screen_descriptor[0] = $this->width & 0xFF; + $this->logical_screen_descriptor[1] = ($this->width & 0xFF00) >> 8; + $this->logical_screen_descriptor[2] = $this->height & 0xFF; + $this->logical_screen_descriptor[3] = ($this->height & 0xFF00) >> 8; + } + $this->logical_screen_descriptor[4] |= 0x80; + $this->logical_screen_descriptor[5] &= 0xF0; + $this->logical_screen_descriptor[6] |= $this->out_color_table_sizecode; + $this->putbytes($this->logical_screen_descriptor, 7); + $this->putbytes($this->global_out, ($this->out_color_table_size * 3)); + if($this->use_loop) { + $ns[0] = 0x21; + $ns[1] = 0xFF; + $ns[2] = 0x0B; + $ns[3] = 0x4e; + $ns[4] = 0x45; + $ns[5] = 0x54; + $ns[6] = 0x53; + $ns[7] = 0x43; + $ns[8] = 0x41; + $ns[9] = 0x50; + $ns[10] = 0x45; + $ns[11] = 0x32; + $ns[12] = 0x2e; + $ns[13] = 0x30; + $ns[14] = 0x03; + $ns[15] = 0x01; + $ns[16] = $this->loop & 255; + $ns[17] = $this->loop >> 8; + $ns[18] = 0x00; + $this->putbytes($ns, 19); + } + } + if($this->use_global_in) { + $outtable = $this->global_in; + $outsize = $this->global_color_table_size; + $outsizecode = $this->global_color_table_sizecode; + } else { + $outtable = $this->global_out; + $outsize = $this->out_color_table_size; + } + if($this->local_color_table_flag) { + if($size == $this->out_color_table_size && !$this->arrcmp($this->local_in, $this->global_out, $size)) { + $outtable = $this->global_out; + $outsize = $this->out_color_table_size; + } else { + $outtable = $this->local_in; + $outsize = $size; + $outsizecode = $sizecode; + } + } + $use_trans = false; + if($this->transparent) { + for($i = 0; $i < $outsize; $i++) { + if($outtable[3 * $i] == $this->trans1 && $outtable [3 * $i + 1] == $this->trans2 && $outtable [3 * $i + 2] == $this->trans3) { + break; + } + } + if($i < $outsize) { + $transindex = $i; + $use_trans = true; + } + } + if($this->delay || $use_trans) { + $this->buffer[0] = 0x21; + $this->buffer[1] = 0xf9; + $this->buffer[2] = 0x04; + $this->buffer[3] = ($this->disposal << 2) + ($use_trans ? 1 : 0); + $this->buffer[4] = $this->delay & 0xff; + $this->buffer[5] = ($this->delay & 0xff00) >> 8; + $this->buffer[6] = $use_trans ? $transindex : 0; + $this->buffer[7] = 0x00; + $this->putbytes($this->buffer,8); + } + $this->buffer[0] = 0x2c; + $this->putbytes($this->buffer,1); + $head[0] = $this->x & 0xff; + $head[1] = ($this->x & 0xff00) >> 8; + $head[2] = $this->y & 0xff; + $head[3] = ($this->y & 0xff00) >> 8; + $head[8] &= 0x40; + if($outtable != $this->global_out) { + $head[8] |= 0x80; + $head[8] |= $outsizecode; + } + $this->putbytes($head,9); + if($outtable != $this->global_out) { + $this->putbytes($outtable, (3 * $outsize)); + } + $this->getbytes(1); + $this->putbytes($this->buffer,1); + for(;;) { + $this->getbytes(1); + $this->putbytes($this->buffer,1); + if(($u = $this->buffer[0]) == 0) { + break; + } + $this->getbytes($u); + $this->putbytes($this->buffer, $u); + } + } + + function read_extension() { + $this->getbytes(1); + switch($this->buffer[0]) { + case 0xf9: + $this->getbytes(6); + break; + case 0xfe: + for(;;) { + $this->getbytes(1); + if(($u = $this->buffer[0]) == 0) { + break; + } + $this->getbytes($u); + } + break; + case 0x01: + $this->getbytes(13); + for(;;) { + $this->getbytes(0); + if(($u = $this->buffer[0]) == 0) { + break; + } + $this->getbytes($u); + } + break; + case 0xff: + $this->getbytes(9); + $this->getbytes(3); + for(;;) { + $this->getbytes(1); + if(!$this->buffer[0]) { + break; + } + $this->getbytes($this->buffer[0]); + } + break; + default: + for(;;) { + $this->getbytes(1); + if(!$this->buffer[0]) { + break; + } + $this->getbytes($this->buffer[0]); + } + } + } + + function arrcmp($b, $s, $l) { + for($i = 0; $i < $l; $i++) { + if($s[$i] != $b[$i]) { + return false; + } + } + return true; + } + + function getbytes($l) { + for($i = 0; $i < $l; $i++) { + if($this->mod == 'C_FILE') { + $bin = unpack('C*', fread($this->fin, 1)); + $this->buffer[$i] = $bin[1]; + } elseif($this->mod == 'C_MEMORY') { + $bin = unpack('C*', substr($this->fin, $this->ch, 1)); + $this->buffer[$i] = $bin[1]; + $this->ch++; + } + } + return $this->buffer; + } + + function putbytes($s, $l) { + for($i = 0; $i < $l; $i++) { + $this->fout .= pack('C*', $s[$i]); + } + } + + function getAnimation() { + return $this->fout; + } +} + +?> \ No newline at end of file diff --git a/source/class/class_image.php b/source/class/class_image.php new file mode 100644 index 0000000..834f10c --- /dev/null +++ b/source/class/class_image.php @@ -0,0 +1,693 @@ +extension['gd'] = extension_loaded('gd'); + $this->extension['imagick'] = extension_loaded('imagick'); + + $this->param = array( + 'imagelib' => $_G['setting']['imagelib'], + 'imageimpath' => $_G['setting']['imageimpath'], + 'thumbquality' => $_G['setting']['thumbquality'], + 'watermarkstatus' => dunserialize($_G['setting']['watermarkstatus']), + 'watermarkminwidth' => dunserialize($_G['setting']['watermarkminwidth']), + 'watermarkminheight' => dunserialize($_G['setting']['watermarkminheight']), + 'watermarktype' => $_G['setting']['watermarktype'], + 'watermarktext' => $_G['setting']['watermarktext'], + 'watermarktrans' => dunserialize($_G['setting']['watermarktrans']), + 'watermarkquality' => dunserialize($_G['setting']['watermarkquality']), + ); + } + + + function Thumb($source, $target, $thumbwidth, $thumbheight, $thumbtype = 1, $nosuffix = 0) { + $return = $this->init('thumb', $source, $target, $nosuffix); + if($return <= 0) { + return $this->returncode($return); + } + + if($this->imginfo['animated']) { + return $this->returncode(0); + } + $this->param['thumbwidth'] = intval($thumbwidth); + if(!$thumbheight || $thumbheight > $this->imginfo['height']) { + $thumbheight = $thumbwidth > $this->imginfo['width'] ? $this->imginfo['height'] : $this->imginfo['height']*($thumbwidth/$this->imginfo['width']); + } + $this->param['thumbheight'] = intval($thumbheight); + $this->param['thumbtype'] = $thumbtype; + if($thumbwidth < 100 && $thumbheight < 100) { + $this->param['thumbquality'] = 100; + } + + $return = !$this->libmethod ? $this->Thumb_GD() : $this->Thumb_IM(); + $return = !$nosuffix ? $return : 0; + + return $this->sleep($return); + } + + function Cropper($source, $target, $dstwidth, $dstheight, $srcx = 0, $srcy = 0, $srcwidth = 0, $srcheight = 0) { + + $return = $this->init('thumb', $source, $target, 1); + if($return <= 0) { + return $this->returncode($return); + } + if($dstwidth < 0 || $dstheight < 0) { + return $this->returncode(false); + } + $this->param['dstwidth'] = intval($dstwidth); + $this->param['dstheight'] = intval($dstheight); + $this->param['srcx'] = intval($srcx); + $this->param['srcy'] = intval($srcy); + $this->param['srcwidth'] = intval($srcwidth ? $srcwidth : $dstwidth); + $this->param['srcheight'] = intval($srcheight ? $srcheight : $dstheight); + + $return = !$this->libmethod ? $this->Cropper_GD() : $this->Cropper_IM(); + } + + function Watermark($source, $target = '', $type = 'forum') { + $return = $this->init('watermask', $source, $target); + if($return <= 0) { + return $this->returncode($return); + } + + if(!$this->param['watermarkstatus'][$type] || ($this->param['watermarkminwidth'][$type] && $this->imginfo['width'] <= $this->param['watermarkminwidth'][$type] && $this->param['watermarkminheight'][$type] && $this->imginfo['height'] <= $this->param['watermarkminheight'][$type])) { + return $this->returncode(0); + } + $this->param['watermarkfile'][$type] = './static/image/common/'.($this->param['watermarktype'][$type] == 'png' ? 'watermark.png' : 'watermark.gif'); + if(!is_readable($this->param['watermarkfile'][$type]) || ($this->param['watermarktype'][$type] == 'text' && (!file_exists($this->param['watermarktext']['fontpath'][$type]) || !is_file($this->param['watermarktext']['fontpath'][$type])))) { + return $this->returncode(-3); + } + + $return = !$this->libmethod ? $this->Watermark_GD($type) : $this->Watermark_IM($type); + + return $this->sleep($return); + } + + function error() { + return $this->errorcode; + } + + function init($method, $source, $target, $nosuffix = 0) { + global $_G; + + $this->errorcode = 0; + if(empty($source)) { + return -2; + } + $parse = parse_url($source); + if(isset($parse['host'])) { + if(empty($target)) { + return -2; + } + $data = dfsockopen($source); + $this->tmpfile = $source = tempnam($_G['setting']['attachdir'].'./temp/', 'tmpimg_'); + if(!$data || $source === FALSE) { + return -2; + } + file_put_contents($source, $data); + } + if($method == 'thumb') { + $target = empty($target) ? (!$nosuffix ? getimgthumbname($source) : $source) : $_G['setting']['attachdir'].'./'.$target; + } elseif($method == 'watermask') { + $target = empty($target) ? $source : $_G['setting']['attachdir'].'./'.$target; + } + $targetpath = dirname($target); + dmkdir($targetpath); + + clearstatcache(); + if(!is_readable($source) || !is_writable($targetpath)) { + return -2; + } + + $imginfo = @getimagesize($source); + if($imginfo === FALSE) { + return -1; + } + + $this->source = $source; + $this->target = $target; + $this->imginfo['width'] = $imginfo[0]; + $this->imginfo['height'] = $imginfo[1]; + $this->imginfo['mime'] = $imginfo['mime']; + $this->imginfo['size'] = @filesize($source); + $this->libmethod = $this->param['imagelib']; + if(!$this->param['imagelib'] && $this->extension['gd']) { + $this->libmethod = 0; + } elseif($this->param['imagelib'] && $this->extension['imagick']) { + $this->libmethod = 1; + } else { + return -4; + } + + if(!$this->libmethod) { + switch($this->imginfo['mime']) { + case 'image/jpeg': + $this->imagecreatefromfunc = function_exists('imagecreatefromjpeg') ? 'imagecreatefromjpeg' : ''; + $this->imagefunc = function_exists('imagejpeg') ? 'imagejpeg' : ''; + break; + case 'image/gif': + $this->imagecreatefromfunc = function_exists('imagecreatefromgif') ? 'imagecreatefromgif' : ''; + $this->imagefunc = function_exists('imagegif') ? 'imagegif' : ''; + break; + case 'image/png': + $this->imagecreatefromfunc = function_exists('imagecreatefrompng') ? 'imagecreatefrompng' : ''; + $this->imagefunc = function_exists('imagepng') ? 'imagepng' : ''; + break; + case 'image/webp': + $this->imagecreatefromfunc = function_exists('imagecreatefromwebp') ? 'imagecreatefromwebp' : ''; + $this->imagefunc = function_exists('imagewebp') ? 'imagewebp' : ''; + break; + } + } else { + $this->imagecreatefromfunc = $this->imagefunc = TRUE; + } + + if(!$this->libmethod && $this->imginfo['mime'] == 'image/gif') { + if(!$this->imagecreatefromfunc) { + return -4; + } + if(!($fp = @fopen($source, 'rb'))) { + return -2; + } + $content = fread($fp, $this->imginfo['size']); + fclose($fp); + $this->imginfo['animated'] = strpos($content, 'NETSCAPE2.0') === FALSE ? 0 : 1; + } elseif(!$this->libmethod && $this->imginfo['mime'] == 'image/webp') { + if(!$this->imagecreatefromfunc) { + return -4; + } + if(!($fp = @fopen($source, 'rb'))) { + return -2; + } + $content = fread($fp, 40); + fclose($fp); + if (stripos($content, 'WEBPVP8X') !== FALSE && stripos($content, 'ANIM') !== FALSE) { + $this->imginfo['animated'] = 1; + }else{ + $this->imginfo['animated'] = 0; + } + }else { + $this->imginfo['animated'] = 0; + } + + return $this->imagecreatefromfunc ? 1 : -4; + } + + function sleep($return) { + if($this->tmpfile) { + @unlink($this->tmpfile); + } + $this->imginfo['size'] = @filesize($this->target); + return $this->returncode($return); + } + + function returncode($return) { + if($return > 0 && file_exists($this->target)) { + return true; + } else { + if($this->tmpfile) { + @unlink($this->tmpfile); + } + $this->errorcode = $return; + return false; + } + } + + function sizevalue($method) { + $x = $y = $w = $h = 0; + if($method > 0) { + $imgratio = $this->imginfo['width'] / $this->imginfo['height']; + $thumbratio = $this->param['thumbwidth'] / $this->param['thumbheight']; + if($imgratio >= 1 && $imgratio >= $thumbratio || $imgratio < 1 && $imgratio > $thumbratio) { + $h = $this->imginfo['height']; + $w = $h * $thumbratio; + $x = ($this->imginfo['width'] - $thumbratio * $this->imginfo['height']) / 2; + } elseif($imgratio >= 1 && $imgratio <= $thumbratio || $imgratio < 1 && $imgratio <= $thumbratio) { + $w = $this->imginfo['width']; + $h = $w / $thumbratio; + } + } else { + $x_ratio = $this->param['thumbwidth'] / $this->imginfo['width']; + $y_ratio = $this->param['thumbheight'] / $this->imginfo['height']; + if(($x_ratio * $this->imginfo['height']) < $this->param['thumbheight']) { + $h = ceil($x_ratio * $this->imginfo['height']); + $w = $this->param['thumbwidth']; + } else { + $w = ceil($y_ratio * $this->imginfo['width']); + $h = $this->param['thumbheight']; + } + } + return array($x, $y, $w, $h); + } + + function loadsource() { + $imagecreatefromfunc = &$this->imagecreatefromfunc; + $im = @$imagecreatefromfunc($this->source); + if(!$im) { + if(!function_exists('imagecreatefromstring')) { + return -4; + } + $fp = @fopen($this->source, 'rb'); + $contents = @fread($fp, filesize($this->source)); + fclose($fp); + $im = @imagecreatefromstring($contents); + if($im == FALSE) { + return -1; + } + } + return $im; + } + + function Thumb_GD() { + if(!function_exists('imagecreatetruecolor') || !function_exists('imagecopyresampled') || !function_exists('imagejpeg') || !function_exists('imagecopymerge')) { + return -4; + } + + $imagefunc = &$this->imagefunc; + $attach_photo = $this->loadsource(); + if($attach_photo < 0) { + return $attach_photo; + } + if($this->imginfo['mime'] != 'image/png') { + $copy_photo = imagecreatetruecolor($this->imginfo['width'], $this->imginfo['height']); + imagecopy($copy_photo, $attach_photo , 0, 0, 0, 0, $this->imginfo['width'], $this->imginfo['height']); + $attach_photo = $copy_photo; + } + + $thumb_photo = null; + switch($this->param['thumbtype']) { + case 'fixnone': + case 1: + if($this->imginfo['width'] >= $this->param['thumbwidth'] || $this->imginfo['height'] >= $this->param['thumbheight']) { + $thumb = array(); + list(,,$thumb['width'], $thumb['height']) = $this->sizevalue(0); + $cx = $this->imginfo['width']; + $cy = $this->imginfo['height']; + $thumb_photo = imagecreatetruecolor($thumb['width'], $thumb['height']); + if($this->imginfo['mime'] == 'image/png') { + imagealphablending($thumb_photo, false); + imagesavealpha($thumb_photo, true); + } + imagecopyresampled($thumb_photo, $attach_photo ,0, 0, 0, 0, $thumb['width'], $thumb['height'], $cx, $cy); + } + break; + case 'fixwr': + case 2: + if(!($this->imginfo['width'] <= $this->param['thumbwidth'] || $this->imginfo['height'] <= $this->param['thumbheight'])) { + list($startx, $starty, $cutw, $cuth) = $this->sizevalue(1); + $dst_photo = imagecreatetruecolor($cutw, $cuth); + imagecopymerge($dst_photo, $attach_photo, 0, 0, $startx, $starty, $cutw, $cuth, 100); + $thumb_photo = imagecreatetruecolor($this->param['thumbwidth'], $this->param['thumbheight']); + if($this->imginfo['mime'] == 'image/png') { + imagealphablending($thumb_photo, false); + imagesavealpha($thumb_photo, true); + } + imagecopyresampled($thumb_photo, $dst_photo ,0, 0, 0, 0, $this->param['thumbwidth'], $this->param['thumbheight'], $cutw, $cuth); + } else { + $thumb_photo = imagecreatetruecolor($this->param['thumbwidth'], $this->param['thumbheight']); + if($this->imginfo['mime'] == 'image/png') { + imagealphablending($thumb_photo, false); + imagesavealpha($thumb_photo, true); + } + $bgcolor = imagecolorallocate($thumb_photo, 255, 255, 255); + imagefill($thumb_photo, 0, 0, $bgcolor); + $startx = ($this->param['thumbwidth'] - $this->imginfo['width']) / 2; + $starty = ($this->param['thumbheight'] - $this->imginfo['height']) / 2; + imagecopymerge($thumb_photo, $attach_photo, $startx, $starty, 0, 0, $this->imginfo['width'], $this->imginfo['height'], 100); + } + break; + } + clearstatcache(); + if($thumb_photo) { + if($this->imginfo['mime'] == 'image/jpeg') { + @$imagefunc($thumb_photo, $this->target, $this->param['thumbquality']); + } else { + @$imagefunc($thumb_photo, $this->target); + } + return 1; + } else { + return 0; + } + } + + function Thumb_IM() { + if($this->imginfo['mime'] == 'image/gif') { + return 1; + } + switch($this->param['thumbtype']) { + case 'fixnone': + case 1: + if($this->imginfo['width'] >= $this->param['thumbwidth'] || $this->imginfo['height'] >= $this->param['thumbheight']) { + $im = new Imagick(); + $im->readImage(realpath($this->source)); + $im->setImageCompressionQuality($this->param['thumbquality']); + $im->thumbnailImage($this->param['thumbwidth'], $this->param['thumbheight'], true); + if(!$im->writeImage($this->target)) { + $im->destroy(); + return -3; + } + $im->destroy(); + } + break; + case 'fixwr': + case 2: + if(!($this->imginfo['width'] <= $this->param['thumbwidth'] || $this->imginfo['height'] <= $this->param['thumbheight'])) { + list($startx, $starty, $cutw, $cuth) = $this->sizevalue(1); + $im = new Imagick(); + $im->readImage(realpath($this->source)); + $im->setImageCompressionQuality($this->param['thumbquality']); + $im->cropImage($cutw, $cuth, $startx, $starty); + if(!$im->writeImage($this->target)) { + $im->destroy(); + return -3; + } + + $im->readImage(realpath($this->target)); + $im->setImageCompressionQuality($this->param['thumbquality']); + $im->thumbnailImage($this->param['thumbwidth'], $this->param['thumbheight']); + $im->resizeImage($this->param['thumbwidth'], $this->param['thumbheight'], imagick::FILTER_LANCZOS, 1, true); + $im->setGravity(imagick::GRAVITY_CENTER ); + $im->extentImage($this->param['thumbwidth'], $this->param['thumbheight'], 0, 0); + + if(!$im->writeImage($this->target)) { + $im->destroy(); + return -3; + } + $im->destroy(); + } else { + $startx = -($this->param['thumbwidth'] - $this->imginfo['width']) / 2; + $starty = -($this->param['thumbheight'] - $this->imginfo['height']) / 2; + + $im = new Imagick(); + $im->readImage(realpath($this->source)); + $im->setImageCompressionQuality($this->param['thumbquality']); + $im->cropImage($this->param['thumbwidth'], $this->param['thumbheight'], $startx, $starty); + if(!$im->writeImage($this->target)) { + $im->destroy(); + return -3; + } + + $im->readImage(realpath($this->target)); + $im->setImageCompressionQuality($this->param['thumbquality']); + $im->thumbnailImage($this->param['thumbwidth'], $this->param['thumbheight']); + $im->setGravity(imagick::GRAVITY_CENTER ); + $im->extentImage($this->param['thumbwidth'], $this->param['thumbheight'], 0, 0); + if(!$im->writeImage($this->target)) { + $im->destroy(); + return -3; + } + $im->destroy(); + } + break; + } + return 1; + } + + function Cropper_GD() { + $image = $this->loadsource(); + if($image < 0) { + return $image; + } + $newimage = imagecreatetruecolor($this->param['dstwidth'], $this->param['dstheight']); + imagecopyresampled($newimage, $image, 0, 0, $this->param['srcx'], $this->param['srcy'], $this->param['dstwidth'], $this->param['dstheight'], $this->param['srcwidth'], $this->param['srcheight']); + ImageJpeg($newimage, $this->target, 100); + imagedestroy($newimage); + imagedestroy($image); + return true; + } + function Cropper_IM() { + $im = new Imagick(); + $im->readImage(realpath($this->source)); + $im->cropImage($this->param['srcwidth'], $this->param['srcheight'], $this->param['srcx'], $this->param['srcy']); + $im->thumbnailImage($this->param['dstwidth'], $this->param['dstheight']); + + $result = $im->writeImage($this->target); + $im->destroy(); + if(!$result) { + return -3; + } + } + + function Watermark_GD($type = 'forum') { + if(!function_exists('imagecreatetruecolor')) { + return -4; + } + + $imagefunc = &$this->imagefunc; + + if($this->param['watermarktype'][$type] != 'text') { + if(!function_exists('imagecopy') || !function_exists('imagecreatefrompng') || !function_exists('imagecreatefromgif') || !function_exists('imagealphablending') || !function_exists('imagecopymerge')) { + return -4; + } + $watermarkinfo = @getimagesize($this->param['watermarkfile'][$type]); + if($watermarkinfo === FALSE) { + return -3; + } + $watermark_logo = $this->param['watermarktype'][$type] == 'png' ? @imageCreateFromPNG($this->param['watermarkfile'][$type]) : @imageCreateFromGIF($this->param['watermarkfile'][$type]); + if(!$watermark_logo) { + return 0; + } + list($logo_w, $logo_h) = $watermarkinfo; + } else { + if(!function_exists('imagettfbbox') || !function_exists('imagettftext') || !function_exists('imagecolorallocate')) { + return -4; + } + if(!class_exists('Chinese')) { + include libfile('class/chinese'); + } + + $watermarktextcvt = pack("H*", $this->param['watermarktext']['text'][$type]); + $box = imagettfbbox(floatval($this->param['watermarktext']['size'][$type]), floatval($this->param['watermarktext']['angle'][$type]), $this->param['watermarktext']['fontpath'][$type], $watermarktextcvt); + $logo_h = max($box[1], $box[3]) - min($box[5], $box[7]); + $logo_w = max($box[2], $box[4]) - min($box[0], $box[6]); + $ax = min($box[0], $box[6]) * -1; + $ay = min($box[5], $box[7]) * -1; + } + $wmwidth = $this->imginfo['width'] - $logo_w; + $wmheight = $this->imginfo['height'] - $logo_h; + + if($wmwidth > 10 && $wmheight > 10 && !$this->imginfo['animated']) { + switch($this->param['watermarkstatus'][$type]) { + case 1: + $x = 5; + $y = 5; + break; + case 2: + $x = ($this->imginfo['width'] - $logo_w) / 2; + $y = 5; + break; + case 3: + $x = $this->imginfo['width'] - $logo_w - 5; + $y = 5; + break; + case 4: + $x = 5; + $y = ($this->imginfo['height'] - $logo_h) / 2; + break; + case 5: + $x = ($this->imginfo['width'] - $logo_w) / 2; + $y = ($this->imginfo['height'] - $logo_h) / 2; + break; + case 6: + $x = $this->imginfo['width'] - $logo_w; + $y = ($this->imginfo['height'] - $logo_h) / 2; + break; + case 7: + $x = 5; + $y = $this->imginfo['height'] - $logo_h - 5; + break; + case 8: + $x = ($this->imginfo['width'] - $logo_w) / 2; + $y = $this->imginfo['height'] - $logo_h - 5; + break; + case 9: + $x = $this->imginfo['width'] - $logo_w - 5; + $y = $this->imginfo['height'] - $logo_h - 5; + break; + } + if($this->imginfo['mime'] != 'image/png') { + $color_photo = imagecreatetruecolor($this->imginfo['width'], $this->imginfo['height']); + } + $dst_photo = $this->loadsource(); + if($dst_photo < 0) { + return $dst_photo; + } + imagealphablending($dst_photo, true); + imagesavealpha($dst_photo, true); + if($this->imginfo['mime'] != 'image/png') { + imageCopy($color_photo, $dst_photo, 0, 0, 0, 0, $this->imginfo['width'], $this->imginfo['height']); + $dst_photo = $color_photo; + } + if($this->param['watermarktype'][$type] == 'png') { + imageCopy($dst_photo, $watermark_logo, $x, $y, 0, 0, $logo_w, $logo_h); + } elseif($this->param['watermarktype'][$type] == 'text') { + if(($this->param['watermarktext']['shadowx'][$type] || $this->param['watermarktext']['shadowy'][$type]) && $this->param['watermarktext']['shadowcolor'][$type]) { + $shadowcolorrgb = explode(',', $this->param['watermarktext']['shadowcolor'][$type]); + $shadowcolor = imagecolorallocate($dst_photo, intval($shadowcolorrgb[0]), intval($shadowcolorrgb[1]), intval($shadowcolorrgb[2])); + imagettftext($dst_photo, floatval($this->param['watermarktext']['size'][$type]), $this->param['watermarktext']['angle'][$type], $x + $ax + $this->param['watermarktext']['shadowx'][$type], $y + $ay + $this->param['watermarktext']['shadowy'][$type], $shadowcolor, $this->param['watermarktext']['fontpath'][$type], $watermarktextcvt); + } + + $colorrgb = explode(',', $this->param['watermarktext']['color'][$type]); + $color = imagecolorallocate($dst_photo, intval($colorrgb[0]), intval($colorrgb[1]), intval($colorrgb[2])); + imagettftext($dst_photo, floatval($this->param['watermarktext']['size'][$type]), $this->param['watermarktext']['angle'][$type], $x + $ax, $y + $ay, $color, $this->param['watermarktext']['fontpath'][$type], $watermarktextcvt); + } else { + imageAlphaBlending($watermark_logo, true); + imageCopyMerge($dst_photo, $watermark_logo, $x, $y, 0, 0, $logo_w, $logo_h, $this->param['watermarktrans'][$type]); + } + + clearstatcache(); + if($this->imginfo['mime'] == 'image/jpeg') { + @$imagefunc($dst_photo, $this->target, $this->param['watermarkquality'][$type]); + } else { + @$imagefunc($dst_photo, $this->target); + } + } + return 1; + } + + function Watermark_IM($type = 'forum') { + switch($this->param['watermarkstatus'][$type]) { + case 1: + $gravity = imagick::GRAVITY_NORTHWEST; + break; + case 2: + $gravity = imagick::GRAVITY_NORTH; + break; + case 3: + $gravity = imagick::GRAVITY_NORTHEAST; + break; + case 4: + $gravity = imagick::GRAVITY_WEST; + break; + case 5: + $gravity = imagick::GRAVITY_CENTER; + break; + case 6: + $gravity = imagick::GRAVITY_EAST; + break; + case 7: + $gravity = imagick::GRAVITY_SOUTHWEST; + break; + case 8: + $gravity = imagick::GRAVITY_SOUTH; + break; + case 9: + $gravity = imagick::GRAVITY_SOUTHEAST; + break; + } + + if($this->param['watermarktype'][$type] != 'text') { + $watermark = new Imagick(realpath($this->param['watermarkfile'][$type])); + if($this->param['watermarktype'][$type] != 'png' && $this->param['watermarktrans'][$type] != '100') { + $watermark->setImageOpacity($this->param['watermarktrans'][$type]); + } + if($this->imginfo['mime'] == 'image/gif') { + return 0; + } + + $canvas = new Imagick(realpath($this->source)); + $canvas->setImageCompressionQuality($this->param['watermarkquality'][$type]); + + $dw = new ImagickDraw(); + $dw->setGravity($gravity); + $dw->composite($watermark->getImageCompose(), 0, 0, 0, 0, $watermark); + $canvas->drawImage($dw); + + $result = $canvas->writeImage($this->target); + $watermark->destroy(); + $canvas->destroy(); + $dw->destroy(); + + if(!$result) { + return -3; + } + } else { + $watermarktextcvt = escapeshellcmd(pack("H*", $this->param['watermarktext']['text'][$type])); + $angle = -$this->param['watermarktext']['angle'][$type]; + $translate = $this->param['watermarktext']['translatex'][$type] || $this->param['watermarktext']['translatey'][$type] ? ' translate '.intval($this->param['watermarktext']['translatex'][$type]).','.intval($this->param['watermarktext']['translatey'][$type]) : ''; + $skewX = $this->param['watermarktext']['skewx'][$type] ? ' skewX '.intval($this->param['watermarktext']['skewx'][$type]) : ''; + $skewY = $this->param['watermarktext']['skewy'][$type] ? ' skewY '.intval($this->param['watermarktext']['skewy'][$type]) : ''; + + $canvas = new Imagick(realpath($this->source)); + $canvas->setImageCompressionQuality($this->param['watermarkquality'][$type]); + + $dw = new ImagickDraw(); + $dw->setFont($this->param['watermarktext']['fontpath'][$type]); + $dw->setFontSize($this->param['watermarktext']['size'][$type]); + + if(($this->param['watermarktext']['shadowx'][$type] || $this->param['watermarktext']['shadowy'][$type]) && $this->param['watermarktext']['shadowcolor'][$type]) { + $dw->setFillColor(new ImagickPixel($this->param['watermarktext']['shadowcolor'][$type])); + $dw->setGravity($gravity); + if($translate) { + $dw->translate($this->param['watermarktext']['translatex'][$type], $this->param['watermarktext']['translatey'][$type]); + } + if($skewX) { + $dw->skewX($this->param['watermarktext']['skewx'][$type]); + } + if($skewY) { + $dw->skewY($this->param['watermarktext']['skewy'][$type]); + } + $dw->annotation($this->param['watermarktext']['shadowx'][$type], $this->param['watermarktext']['shadowy'][$type], escapeshellcmd(pack("H*", $this->param['watermarktext']['text'][$type]))); + $canvas->drawImage($dw); + + } + + $dw->setFillColor(new ImagickPixel($this->param['watermarktext']['shadowcolor'][$type])); + $dw->setGravity($gravity); + if($translate) { + $dw->translate($this->param['watermarktext']['translatex'][$type], $this->param['watermarktext']['translatey'][$type]); + } + if($skewX) { + $dw->skewX($this->param['watermarktext']['skewx'][$type]); + } + if($skewY) { + $dw->skewY($this->param['watermarktext']['skewy'][$type]); + } + $dw->rotate($angle); + $dw->annotation(0, 0, escapeshellcmd(pack("H*", $this->param['watermarktext']['text'][$type]))); + + $canvas->drawImage($dw); + + $result = $canvas->writeImage($this->target); + $canvas->destroy(); + $dw->destroy(); + if(!$result) { + return -3; + } + } + return 1; + } + + function IM_filter($str) { + return escapeshellarg(str_replace(' ', '', $str)); + } + +} \ No newline at end of file diff --git a/source/class/class_ip.php b/source/class/class_ip.php new file mode 100644 index 0000000..178b1ed --- /dev/null +++ b/source/class/class_ip.php @@ -0,0 +1,242 @@ + 128 || ($newmask > 32 && strpos($newip, ':') === FALSE)) { + return FALSE; + } + $new_str = $newip . "/" . $mask; + return TRUE; + } + return FALSE; + } + + public static function calc_cidr_range($str, $as_hex = false) { + if(self::validate_cidr($str, $str)) { + list($ip, $prefix) = explode('/', $str); + } elseif (filter_var($str, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { + $ip = $str; + $prefix = 32; + } elseif (filter_var($str, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { + $ip = $str; + $prefix = 128; + } else { + return FALSE; + } + + $ip_bytes = unpack("C*", inet_pton($ip)); + $total_bytes = count($ip_bytes); + $num_diff_bits = 8 * $total_bytes - $prefix; + if ($num_diff_bits >= 0) { + $num_same_bytes = $prefix >> 3; + $same_bytes = array_slice($ip_bytes, 0, $num_same_bytes); + $diff_bytes_start = ($total_bytes === $num_same_bytes) ? array() : array_fill(0, $total_bytes - $num_same_bytes, 0); + $diff_bytes_end = ($total_bytes === $num_same_bytes) ? array() : array_fill(0, $total_bytes - $num_same_bytes, 255); + $start_same_bits = $prefix % 8; + if ($start_same_bits !== 0) { + $vary_byte = $ip_bytes[$num_same_bytes]; + $diff_bytes_start[0] = $vary_byte & bindec(str_pad(str_repeat('1', $start_same_bits), 8, '0', STR_PAD_RIGHT)); + $diff_bytes_end[0] = $diff_bytes_start[0] + bindec(str_repeat('1', 8 - $start_same_bits)); + } + + $start_array = array_merge($same_bytes, $diff_bytes_start); + $end_array = array_merge($same_bytes, $diff_bytes_end); + if ($as_hex) { + if ($total_bytes < 16) { + $start_array = array_merge(array_fill(0, 16 - $total_bytes, 0), $start_array); + $end_array = array_merge(array_fill(0, 16 - $total_bytes, 0), $end_array); + } + $start = unpack('H*hex', join(array_map('chr', $start_array)))['hex']; + $end = unpack('H*hex', join(array_map('chr', $end_array)))['hex']; + return array($start, $end); + } else { + $start = call_user_func_array('pack', array_merge(array("C*"), $start_array)); + $end = call_user_func_array('pack', array_merge(array("C*"), $end_array)); + return array($start, $end); + } + } + + return FALSE; + } + + public static function ip_to_hex_str($ip) + { + if (!self::validate_ip($ip)) { + return false; + } + $ip_bytes = unpack("C*", inet_pton($ip)); + $total_bytes = count($ip_bytes); + if ($total_bytes < 16) { + $ip_bytes = array_merge(array_fill(0, 16 - $total_bytes, 0), $ip_bytes); + } + return unpack('H*hex', join(array_map('chr', $ip_bytes)))['hex']; + } + + + public static function check_ip($requestIp, $ips) + { + if (!self::validate_ip($requestIp)) { + return false; + } + if (!\is_array($ips)) { + $ips = [$ips]; + } + $method = substr_count($requestIp, ':') > 1 ? 'check_ip6' : 'check_ip4'; + foreach ($ips as $ip) { + if (self::$method($requestIp, $ip)) { + return true; + } + } + return false; + } + + public static function check_ip6($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + if ('0' === $netmask) { + return (bool) unpack('n*', @inet_pton($address)); + } + if ($netmask < 1 || $netmask > 128) { + return false; + } + } else { + $address = $ip; + $netmask = 128; + } + $bytesAddr = unpack('n*', @inet_pton($address)); + $bytesTest = unpack('n*', @inet_pton($requestIp)); + if (!$bytesAddr || !$bytesTest) { + return false; + } + for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { + $left = $netmask - 16 * ($i - 1); + $left = ($left <= 16) ? $left : 16; + $mask = ~(0xffff >> $left) & 0xffff; + if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { + return false; + } + } + return true; + } + + public static function check_ip4($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + if ('0' === $netmask) { + return false; + } + if ($netmask < 0 || $netmask > 32) { + return false; + } + } else { + $address = $ip; + $netmask = 32; + } + if (false === ip2long($address)) { + return false; + } + return 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); + } + + public static function convert($ip) { + global $_G; + if (false !== strpos($ip, '/')) { + list($ip, $netmask) = explode('/', $ip, 2); + } + if(!self::validate_ip($ip)) { + return '- Invalid'; + } + if (!(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) !== false)) { + return '- LAN'; + } + if (!(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) !== false)) { + return '- Reserved'; + } + if (array_key_exists('ipdb', $_G['config']) && array_key_exists('setting', $_G['config']['ipdb'])) { + $s = $_G['config']['ipdb']['setting']; + if (!empty($s['fullstack'])) { + $c = 'ip_'.$s['fullstack']; + } else if (!empty($s['ipv4']) && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) { + $c = 'ip_'.$s['ipv4']; + } else if (!empty($s['ipv6']) && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) { + $c = 'ip_'.$s['ipv6']; + } else if (!empty($s['default'])) { + $c = 'ip_'.$s['default']; + } else { + $c = 'ip_tiny'; + } + } else { + $c = 'ip_tiny'; + } + $ipobject = $c::getInstance(); + return $ipobject === NULL ? '- Error' : $ipobject->convert($ip); + } + + public static function checkaccess($ip, $accesslist) { + return preg_match("/^(".str_replace(array("\r\n", ' '), array('|', ''), preg_quote($accesslist, '/')).")/", $ip); + } + + public static function checkbanned($ip) { + global $_G; + + if (array_key_exists('security', $_G['config']) && array_key_exists('useipban', $_G['config']['security']) && $_G['config']['security']['useipban'] == 0) { + return false; + } + + if($_G['setting']['ipaccess'] && !self::checkaccess($ip, $_G['setting']['ipaccess'])) { + return true; + } + + return C::t('common_banned')->check_banned(TIMESTAMP, $ip); + } + +} +?> \ No newline at end of file diff --git a/source/class/class_member.php b/source/class/class_member.php new file mode 100644 index 0000000..ee99a69 --- /dev/null +++ b/source/class/class_member.php @@ -0,0 +1,1037 @@ +showWindow(\'login\', \'member.php?mod=logging&action=login&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()).(!empty($_GET['cookietime']) ? '&cookietime=1' : '').'\')'; + showmessage('location_login', '', array('type' => 1), array('extrajs' => $js)); + } + + function on_login() { + global $_G; + if($_G['uid']) { + $referer = dreferer(); + $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : ''; + $param = array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['member']['uid']); + showmessage('login_succeed', $referer ? $referer : './', $param, array('showdialog' => 1, 'locationtime' => true, 'extrajs' => $ucsynlogin)); + } + + list($seccodecheck, $secqaacheck) = seccheck('login'); + if(!empty($_GET['auth'])) { + $dauth = authcode($_GET['auth'], 'DECODE', $_G['config']['security']['authkey']); + list(,,,$secchecklogin2) = explode("\t", $dauth); + if($secchecklogin2) { + $seccodecheck = true; + } + } + $seccodestatus = !empty($_GET['lssubmit']) ? false : $seccodecheck; + $secqaastatus = !empty($_GET['lssubmit']) ? false : $secqaacheck; + $invite = getinvite(); + + if(!submitcheck('loginsubmit', 1, $seccodestatus, $secqaastatus)) { + + $auth = ''; + $username = !empty($_G['cookie']['loginuser']) ? dhtmlspecialchars($_G['cookie']['loginuser']) : ''; + + if(!empty($_GET['auth'])) { + list($username, $password, $questionexist) = explode("\t", authcode($_GET['auth'], 'DECODE', $_G['config']['security']['authkey'])); + $username = dhtmlspecialchars($username); + $auth = dhtmlspecialchars($_GET['auth']); + } + + $cookietimecheck = !empty($_G['cookie']['cookietime']) || !empty($_GET['cookietime']) ? 'checked="checked"' : ''; + + if($seccodecheck) { + $seccode = random(6, 1) + $seccode[0] * 1000000; + } + + if($this->extrafile && file_exists($this->extrafile)) { + require_once $this->extrafile; + } + + $navtitle = lang('core', 'title_login'); + include template($this->template); + + } else { + + if(!empty($_GET['auth'])) { + list($_GET['username'], $_GET['password']) = daddslashes(explode("\t", authcode($_GET['auth'], 'DECODE', $_G['config']['security']['authkey']))); + } + + $loginhash = !empty($_GET['loginhash']) && preg_match('/^\w+$/', $_GET['loginhash']) ? $_GET['loginhash'] : ''; + + if(!($_G['member_loginperm'] = logincheck($_GET['username']))) { + showmessage('login_strike'); + } + if($_GET['fastloginfield']) { + $_GET['loginfield'] = $_GET['fastloginfield']; + } + $_G['uid'] = $_G['member']['uid'] = 0; + $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = ''; + if(!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) { + showmessage('profile_passwd_illegal'); + } + $result = userlogin($_GET['username'], $_GET['password'], $_GET['questionid'], $_GET['answer'], $this->setting['autoidselect'] ? 'auto' : $_GET['loginfield'], $_G['clientip']); + $uid = $result['ucresult']['uid']; + + if(!empty($_GET['lssubmit']) && ($result['ucresult']['uid'] == -3 || $seccodecheck || $secqaacheck)) { + $_GET['username'] = $result['ucresult']['username']; + $this->logging_more($result['ucresult']['uid'] == -3); + } + + if($result['status'] == -1) { + if(!$this->setting['fastactivation']) { + $auth = authcode($result['ucresult']['username']."\t".FORMHASH, 'ENCODE'); + showmessage('location_activation', 'member.php?mod='.$this->setting['regname'].'&action=activation&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()), array(), array('location' => true)); + } else { + $init_arr = explode(',', $this->setting['initcredits']); + $groupid = $this->setting['regverify'] ? 8 : $this->setting['newusergroupid']; + + C::t('common_member')->insert_user($uid, $result['ucresult']['username'], md5(random(10)), $result['ucresult']['email'], $_G['clientip'], $groupid, $init_arr); + $_G['member']['lastvisit'] = TIMESTAMP; + $result['member'] = getuserbyuid($uid); + $result['status'] = 1; + } + } + + if($result['status'] > 0) { + + if($this->extrafile && file_exists($this->extrafile)) { + require_once $this->extrafile; + } + + setloginstatus($result['member'], $_GET['cookietime'] ? 2592000 : 0); + checkfollowfeed(); + if($_G['group']['forcelogin']) { + if($_G['group']['forcelogin'] == 1) { + clearcookies(); + showmessage('location_login_force_qq'); + } elseif($_G['group']['forcelogin'] == 2 && $_GET['loginfield'] != 'email' && $_GET['username'] !== $result['ucresult']['email']) { + clearcookies(); + showmessage('location_login_force_mail'); + } + } + + if($_G['member']['lastip'] && $_G['member']['lastvisit']) { + dsetcookie('lip', $_G['member']['lastip'].','.$_G['member']['lastvisit']); + } + C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'port' => $_G['remoteport'], 'lastvisit' =>TIMESTAMP, 'lastactivity' => TIMESTAMP)); + $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : ''; + + $pwold = false; + if($this->setting['strongpw']) { + if(in_array(1, $this->setting['strongpw']) && !preg_match("/\d+/", $_GET['password'])) { + $pwold = true; + } + if(in_array(2, $this->setting['strongpw']) && !preg_match("/[a-z]+/", $_GET['password'])) { + $pwold = true; + } + if(in_array(3, $this->setting['strongpw']) && !preg_match("/[A-Z]+/", $_GET['password'])) { + $pwold = true; + } + if(in_array(4, $this->setting['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['password'])) { + $pwold = true; + } + } + + if($_G['member']['adminid'] != 1) { + if($this->setting['accountguard']['loginoutofdate'] && $_G['member']['lastvisit'] && TIMESTAMP - $_G['member']['lastvisit'] > ($this->setting['accountguard']['loginoutofdatenum'] >= 1 ? (int)$this->setting['accountguard']['loginoutofdatenum'] : 90) * 86400 && $_G['member']['freeze'] != -1) { + C::t('common_member')->update($_G['uid'], array('freeze' => 2)); + showmessage('location_login_outofdate', 'home.php?mod=spacecp&ac=profile&op=password&resend=1&formhash='.formhash(), array('type' => 1), array('showdialog' => true, 'striptags' => false, 'locationtime' => true)); + } + + if($this->setting['accountguard']['loginpwcheck'] && $pwold && $_G['member']['freeze'] == 0) { + $freeze = $pwold; + if($this->setting['accountguard']['loginpwcheck'] == 2 && $freeze) { + C::t('common_member')->update($_G['uid'], array('freeze' => 1)); + } + } + } + + $seccheckrule = & $_G['setting']['seccodedata']['rule']['login']; + if($seccheckrule['allow'] == 2) { + if($seccheckrule['nolocal']) { + require_once libfile('function/misc'); + $lastipConvert = process_ipnotice(convertip($_G['member']['lastip'])); + $nowipConvert = process_ipnotice(convertip($_G['clientip'])); + if($lastipConvert != $nowipConvert && stripos($lastipConvert, $nowipConvert) == false && stripos($nowipConvert, $lastipConvert) == false) { + $seccodecheck = true; + } + } + if(!$seccodecheck && $seccheckrule['pwsimple'] && $pwold) { + $seccodecheck = true; + } + if(!$seccodecheck && $seccheckrule['outofday'] && $_G['member']['lastvisit'] && TIMESTAMP - $_G['member']['lastvisit'] > $seccheckrule['outofday'] * 86400) { + $seccodecheck = true; + } + if(!$seccodecheck && $_G['member_loginperm'] != -1 && $_G['member_loginperm'] < 4) { + $seccodecheck = true; + } + if(!$seccodecheck && $seccheckrule['numiptry']) { + $seccodecheck = failedipcheck($seccheckrule['numiptry'], $seccheckrule['timeiptry']); + } + if($seccodecheck && !$secchecklogin2) { + clearcookies(); + $auth = authcode($_GET['username']."\t".$_GET['password']."\t".($_GET['questionid'] ? 1 : 0)."\t1", 'ENCODE', $_G['config']['security']['authkey']); + $location = 'member.php?mod=logging&action=login&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()).(!empty($_GET['cookietime']) ? '&cookietime=1' : ''); + if(defined('IN_MOBILE')) { + showmessage('login_seccheck2', $location); + } else { + $js = ''; + showmessage('login_seccheck2', '', array('type' => 1), array('extrajs' => $js)); + } + } + } + + if($invite['id']) { + $result = C::t('common_invite')->count_by_uid_fuid($invite['uid'], $uid); + if(!$result) { + C::t('common_invite')->update($invite['id'], array('fuid'=>$uid, 'fusername'=>$_G['username'])); + updatestat('invite'); + } else { + $invite = array(); + } + } + if($invite['uid']) { + require_once libfile('function/friend'); + friend_make($invite['uid'], $invite['username'], false); + dsetcookie('invite_auth', ''); + } + + $param = array( + 'username' => $result['ucresult']['username'], + 'usergroup' => $_G['group']['grouptitle'], + 'uid' => $_G['member']['uid'], + 'groupid' => $_G['groupid'], + 'syn' => $ucsynlogin ? 1 : 0 + ); + + $extra = array( + 'showdialog' => true, + 'locationtime' => true, + 'extrajs' => $ucsynlogin + ); + + if(!$freeze || !$this->setting['accountguard']['loginpwcheck']) { + $loginmessage = $_G['groupid'] == 8 ? 'login_succeed_inactive_member' : 'login_succeed'; + $location = $invite || $_G['groupid'] == 8 ? 'home.php?mod=spacecp&ac=profile&op=password' : dreferer(); + } else { + $loginmessage = 'login_succeed_password_change'; + $location = 'home.php?mod=spacecp&ac=profile&op=password'; + $_GET['lssubmit'] = 0; + } + if(empty($_GET['handlekey']) || !empty($_GET['lssubmit'])) { + if(defined('IN_MOBILE')) { + showmessage($loginmessage, $location, $param, array('location' => true)); + } else { + if(!empty($_GET['lssubmit'])) { + if(!$ucsynlogin) { + $extra['location'] = true; + } + showmessage($loginmessage, $location, $param, $extra); + } else { + $href = str_replace("'", "\'", $location); + showmessage('location_login_succeed', $location, array(), + array( + 'showid' => 'succeedmessage', + 'extrajs' => ''.$ucsynlogin, + 'striptags' => false, + 'showdialog' => true + ) + ); + } + } + } else { + showmessage($loginmessage, $location, $param, $extra); + } + } else { + $password = preg_replace("/^(.{".round(strlen($_GET['password']) / 4)."})(.+?)(.{".round(strlen($_GET['password']) / 6)."})$/s", "\\1***\\3", $_GET['password']); + $errorlog = dhtmlspecialchars( + TIMESTAMP."\t". + ($result['ucresult']['username'] ? $result['ucresult']['username'] : $_GET['username'])."\t". + $password."\t". + "Ques #".intval($_GET['questionid'])."\t". + $_G['clientip']); + writelog('illegallog', $errorlog); + loginfailed($_GET['username']); + failedip(); + $fmsg = $result['ucresult']['uid'] == '-3' ? (empty($_GET['questionid']) || $answer == '' ? 'login_question_empty' : 'login_question_invalid') : 'login_invalid'; + if($_G['member_loginperm'] > 1) { + showmessage($fmsg, '', array('loginperm' => $_G['member_loginperm'] - 1)); + } elseif($_G['member_loginperm'] == -1) { + showmessage('login_password_invalid'); + } else { + showmessage('login_strike'); + } + } + + } + + } + + function on_logout() { + global $_G; + + $ucsynlogout = $this->setting['allowsynlogin'] ? uc_user_synlogout() : ''; + + if($_GET['formhash'] != $_G['formhash']) { + showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout, 'referer' => rawurlencode(dreferer()))); + } + + clearcookies(); + $_G['groupid'] = $_G['member']['groupid'] = 7; + $_G['uid'] = $_G['member']['uid'] = 0; + $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = ''; + $_G['setting']['styleid'] = $this->setting['styleid']; + + if(defined('IN_MOBILE')) { + showmessage('location_logout_succeed_mobile', dreferer(), array('formhash' => FORMHASH, 'referer' => rawurlencode(dreferer()))); + } else { + showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout, 'referer' => rawurlencode(dreferer()))); + } + } + +} + +class register_ctl { + + var $showregisterform = 1; + + function __construct() { + global $_G; + if($_G['setting']['bbclosed']) { + if(($_GET['action'] != 'activation' && !$_GET['activationauth']) || !$_G['setting']['closedallowactivation'] ) { + showmessage('register_disable', NULL, array(), array('login' => 1)); + } + } + + loadcache(array('modreasons', 'stamptypeid', 'fields_required', 'fields_optional', 'fields_register', 'ipctrl')); + require_once libfile('function/misc'); + require_once libfile('function/profile'); + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + loaducenter(); + } + + function on_register() { + global $_G; + + $_GET['username'] = trim($_GET[''.$this->setting['reginput']['username']]); + $_GET['password'] = $_GET[''.$this->setting['reginput']['password']]; + $_GET['password2'] = $_GET[''.$this->setting['reginput']['password2']]; + $_GET['email'] = $_GET[''.$this->setting['reginput']['email']]; + + if($_G['uid']) { + $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : ''; + $url_forward = dreferer(); + if(strpos($url_forward, $this->setting['regname']) !== false) { + $url_forward = 'forum.php'; + } + showmessage('login_succeed', $url_forward ? $url_forward : './', array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']), array('extrajs' => $ucsynlogin)); + } elseif(!$this->setting['regclosed'] && (!$this->setting['regstatus'] || !$this->setting['ucactivation'])) { + if($_GET['action'] == 'activation' || $_GET['activationauth']) { + if(!$this->setting['ucactivation'] && !$this->setting['closedallowactivation']) { + showmessage('register_disable_activation'); + } + } elseif(!$this->setting['regstatus']) { + if($this->setting['regconnect']) { + if(CURMODULE != 'connect'){ + dheader('location:connect.php?mod=login&op=init&referer=forum.php&statfrom=login_simple'); + } + }else{ + showmessage(!$this->setting['regclosemessage'] ? 'register_disable' : str_replace(array("\r", "\n"), '', $this->setting['regclosemessage'])); + } + } + } + + $bbrules = & $this->setting['bbrules']; + $bbrulesforce = & $this->setting['bbrulesforce']; + $bbrulestxt = & $this->setting['bbrulestxt']; + $welcomemsg = & $this->setting['welcomemsg']; + $welcomemsgtitle = & $this->setting['welcomemsgtitle']; + $welcomemsgtxt = & $this->setting['welcomemsgtxt']; + $regname = $this->setting['regname']; + + if($this->setting['regverify']) { + if($this->setting['areaverifywhite']) { + $location = $whitearea = ''; + $location = trim(convertip($_G['clientip'])); + if($location) { + $whitearea = preg_quote(trim($this->setting['areaverifywhite']), '/'); + $whitearea = str_replace(array("\\*"), array('.*'), $whitearea); + $whitearea = '.*'.$whitearea.'.*'; + $whitearea = '/^('.str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea).')$/i'; + if(@preg_match($whitearea, $location)) { + $this->setting['regverify'] = 0; + } + } + } + + if($_G['cache']['ipctrl']['ipverifywhite']) { + foreach(explode("\n", $_G['cache']['ipctrl']['ipverifywhite']) as $ctrlip) { + if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) { + $this->setting['regverify'] = 0; + break; + } + } + } + } + + $invitestatus = false; + if($this->setting['regstatus'] == 2) { + if($this->setting['inviteconfig']['inviteareawhite']) { + $location = $whitearea = ''; + $location = trim(convertip($_G['clientip'])); + if($location) { + $whitearea = preg_quote(trim($this->setting['inviteconfig']['inviteareawhite']), '/'); + $whitearea = str_replace(array("\\*"), array('.*'), $whitearea); + $whitearea = '.*'.$whitearea.'.*'; + $whitearea = '/^('.str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea).')$/i'; + if(@preg_match($whitearea, $location)) { + $invitestatus = true; + } + } + } + + if($this->setting['inviteconfig']['inviteipwhite']) { + foreach(explode("\n", $this->setting['inviteconfig']['inviteipwhite']) as $ctrlip) { + if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) { + $invitestatus = true; + break; + } + } + } + } + + $groupinfo = array(); + if($this->setting['regverify']) { + $groupinfo['groupid'] = 8; + } else { + $groupinfo['groupid'] = $this->setting['newusergroupid']; + } + + list($seccodecheck, $secqaacheck) = seccheck('register'); + $fromuid = !empty($_G['cookie']['promotion']) && $this->setting['creditspolicy']['promotion_register'] ? intval($_G['cookie']['promotion']) : 0; + $username = isset($_GET['username']) ? $_GET['username'] : ''; + $bbrulehash = $bbrules ? substr(md5(FORMHASH), 0, 8) : ''; + $auth = $_GET['auth']; + + if(!$invitestatus) { + $invite = getinvite(); + } + $paramexist = preg_match_all('/(\?|&(amp)?(;)?)(.+?)=([^&?]*)/i', $_SERVER['QUERY_STRING'], $parammatchs); + if($paramexist){ + foreach($parammatchs[5] as $paramk => $paramv){ + $param[$parammatchs[4][$paramk]] = $paramv; + } + } + $gethash = isset($_GET['hash']) ? $_GET['hash'] : $param['hash']; + $email = isset($_GET['email']) ? $_GET['email'] : $param['email']; + $sendurl = $this->setting['sendregisterurl'] ? true : false; + if($sendurl) { + if(!empty($gethash)) { + $gethash = preg_replace("/[^\[A-Za-z0-9_\]%\s+-\/=]/", '', $gethash); + $hash = explode("\t", authcode($gethash, 'DECODE', $_G['config']['security']['authkey'])); + if(is_array($hash) && isemail($hash[0]) && TIMESTAMP - $hash[1] < 259200) { + $sendurl = false; + } + } + } + if(!submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck)) { + + if($_GET['action'] == 'activation') { + $auth = explode("\t", authcode($auth, 'DECODE')); + if(FORMHASH != $auth[1]) { + showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); + } + $username = $auth[0]; + $activationauth = authcode("$auth[0]\t".FORMHASH, 'ENCODE'); + $sendurl = false; + } + + if(!$sendurl) { + + if($fromuid) { + $member = getuserbyuid($fromuid); + if(!empty($member)) { + $fromuser = dhtmlspecialchars($member['username']); + } else { + dsetcookie('promotion'); + } + } + + if($_GET['action'] == 'activation') { + $auth = dhtmlspecialchars($auth); + } + + if($seccodecheck) { + $seccode = random(6, 1); + } + + $username = dhtmlspecialchars($username); + + $htmls = $settings = array(); + foreach($_G['cache']['fields_register'] as $field) { + $fieldid = $field['fieldid']; + $html = profile_setting($fieldid, array(), false, false, true); + if($html) { + $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid]; + $htmls[$fieldid] = $html; + } + } + + $navtitle = $this->setting['reglinkname']; + + if($this->extrafile && file_exists($this->extrafile)) { + require_once $this->extrafile; + } + } else { + $navtitle = $this->setting['reglinkname']; + } + $bbrulestxt = nl2br("\n$bbrulestxt\n\n"); + $dreferer = dreferer(); + + include template($this->template); + + } else { + + $activationauth = array(); + if(isset($_GET['activationauth']) && $_GET['activationauth']) { + $activationauth = explode("\t", authcode($_GET['activationauth'], 'DECODE')); + if($activationauth[1] != FORMHASH) { + showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); + } + $sendurl = false; + } + if(!$activationauth) { + $email = $email ? $email : $_GET['email']; + checkemail($email); + } + if($sendurl) { + $mobile = $this->setting['mobile']['mobileregister'] ? '' : ($this->setting['mobile']['allowmobile'] ? '&mobile=no' : ''); + $hashstr = urlencode(authcode("{$email}\t{$_G['timestamp']}", 'ENCODE', $_G['config']['security']['authkey'])); + $registerurl = $_G['setting']['securesiteurl']."member.php?mod=".$this->setting['regname']."&hash={$hashstr}&email={$email}{$mobile}"; + $email_register_message = array( + 'tpl' => 'email_register', + 'var' => array( + 'bbname' => $this->setting['bbname'], + 'siteurl' => $_G['setting']['securesiteurl'], + 'url' => $registerurl + ) + ); + if(!sendmail("{$email} <{$email}>", $email_register_message)) { + runlog('sendmail', "{$email} sendmail failed."); + } + showmessage('register_email_send_succeed', dreferer(), array('bbname' => $this->setting['bbname']), array('showdialog' => false, 'msgtype' => 3, 'closetime' => 10)); + } + $emailstatus = 0; + if($this->setting['sendregisterurl'] && !$sendurl) { + $email = strtolower($hash[0]); + $this->setting['regverify'] = $this->setting['regverify'] == 1 ? 0 : $this->setting['regverify']; + if(!$this->setting['regverify']) { + $groupinfo['groupid'] = $this->setting['newusergroupid']; + } + $emailstatus = 1; + } + + if($this->setting['regstatus'] == 2 && empty($invite) && !$invitestatus) { + showmessage('not_open_registration_invite'); + } + + if($bbrules && $bbrulehash != $_POST['agreebbrule']) { + showmessage('register_rules_agree'); + } + + $activation = array(); + if(isset($_GET['activationauth']) && $activationauth && is_array($activationauth)) { + if($activationauth[1] == FORMHASH && !($activation = uc_get_user($activationauth[0]))) { + showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); + } + } + + if(!$activation) { + $usernamelen = dstrlen($username); + if($usernamelen < 3) { + showmessage('profile_username_tooshort'); + } elseif($usernamelen > 15) { + showmessage('profile_username_toolong'); + } + if(uc_get_user(addslashes($username)) && !C::t('common_member')->fetch_uid_by_username($username) && !C::t('common_member_archive')->fetch_uid_by_username($username)) { + if($_G['inajax']) { + showmessage('profile_username_duplicate'); + } else { + showmessage('register_activation_message', 'member.php?mod=logging&action=login', array('username' => $username)); + } + } + if($this->setting['pwlength']) { + if(strlen($_GET['password']) < $this->setting['pwlength']) { + showmessage('profile_password_tooshort', '', array('pwlength' => $this->setting['pwlength'])); + } + } + if($this->setting['strongpw']) { + $strongpw_str = array(); + if(in_array(1, $this->setting['strongpw']) && !preg_match("/\d+/", $_GET['password'])) { + $strongpw_str[] = lang('member/template', 'strongpw_1'); + } + if(in_array(2, $this->setting['strongpw']) && !preg_match("/[a-z]+/", $_GET['password'])) { + $strongpw_str[] = lang('member/template', 'strongpw_2'); + } + if(in_array(3, $this->setting['strongpw']) && !preg_match("/[A-Z]+/", $_GET['password'])) { + $strongpw_str[] = lang('member/template', 'strongpw_3'); + } + if(in_array(4, $this->setting['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['password'])) { + $strongpw_str[] = lang('member/template', 'strongpw_4'); + } + if($strongpw_str) { + showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str)); + } + } + $email = strtolower(trim($email)); + if(empty($this->setting['ignorepassword'])) { + if($_GET['password'] !== $_GET['password2']) { + showmessage('profile_passwd_notmatch'); + } + + if(!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) { + showmessage('profile_passwd_illegal'); + } + $password = $_GET['password']; + } else { + $password = md5(random(10)); + } + } + + $censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($this->setting['censoruser'] = trim($this->setting['censoruser'])), '/')).')$/i'; + + if($this->setting['censoruser'] && @preg_match($censorexp, $username)) { + showmessage('profile_username_protect'); + } + + if($this->setting['regverify'] == 2 && !trim($_GET['regmessage'])) { + showmessage('profile_required_info_invalid'); + } + + if($_G['cache']['ipctrl']['ipregctrl']) { + foreach(explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) { + if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) { + $ctrlip = $ctrlip.'%'; + $this->setting['regctrl'] = $this->setting['ipregctrltime']; + break; + } else { + $ctrlip = $_G['clientip']; + } + } + } else { + $ctrlip = $_G['clientip']; + } + + if($this->setting['regctrl']) { + if(C::t('common_regip')->count_by_ip_dateline($ctrlip, $_G['timestamp']-$this->setting['regctrl']*3600)) { + showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl'])); + } + } + + $setregip = null; + if($this->setting['regfloodctrl']) { + $regip = C::t('common_regip')->fetch_by_ip_dateline($_G['clientip'], $_G['timestamp']-86400); + if($regip) { + if($regip['count'] >= $this->setting['regfloodctrl']) { + showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $this->setting['regfloodctrl'])); + } else { + $setregip = 1; + } + } else { + $setregip = 2; + } + } + + $profile = $verifyarr = array(); + foreach($_G['cache']['fields_register'] as $field) { + $field_key = $field['fieldid']; + $field_val = $_GET[''.$field_key]; + if($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) { + $field_val = true; + } + + if(!profile_check($field_key, $field_val)) { + $showid = !in_array($field['fieldid'], array('birthyear', 'birthmonth')) ? $field['fieldid'] : 'birthday'; + showmessage($field['title'].lang('message', 'profile_illegal'), '', array(), array( + 'showid' => 'chk_'.$showid, + 'extrajs' => $field['title'].lang('message', 'profile_illegal').($field['formtype'] == 'text' ? '' : '') + )); + } + if($field['needverify']) { + $verifyarr[$field_key] = $field_val; + } else { + $profile[$field_key] = $field_val; + } + } + + if(!$activation) { + $uid = uc_user_register(addslashes($username), $password, $email, $questionid, $answer, $_G['clientip']); + if($uid <= 0) { + if($uid == -1) { + showmessage('profile_username_illegal'); + } elseif($uid == -2) { + showmessage('profile_username_protect'); + } elseif($uid == -3) { + showmessage('profile_username_duplicate'); + } elseif($uid == -4) { + showmessage('profile_email_illegal'); + } elseif($uid == -5) { + showmessage('profile_email_domain_illegal'); + } elseif($uid == -6) { + showmessage('profile_email_duplicate'); + } else { + showmessage('undefined_action'); + } + } + } else { + list($uid, $username, $email) = $activation; + } + $_G['username'] = $username; + if(getuserbyuid($uid, 1)) { + if(!$activation) { + uc_user_delete($uid); + } + showmessage('profile_uid_duplicate', '', array('uid' => $uid)); + } + + $password = md5(random(10)); + $secques = $questionid > 0 ? random(8) : ''; + + if(isset($_POST['birthmonth']) && isset($_POST['birthday'])) { + $profile['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']); + } + if(isset($_POST['birthyear'])) { + $profile['zodiac'] = get_zodiac($_POST['birthyear']); + } + + if($_FILES) { + $upload = new discuz_upload(); + + foreach($_FILES as $key => $file) { + $field_key = 'field_'.$key; + if(!empty($_G['cache']['fields_register'][$field_key]) && $_G['cache']['fields_register'][$field_key]['formtype'] == 'file') { + + $upload->init($file, 'profile'); + $attach = $upload->attach; + + if(!$upload->error()) { + $upload->save(); + + if(!$upload->get_image_info($attach['target'])) { + @unlink($attach['target']); + continue; + } + + $attach['attachment'] = dhtmlspecialchars(trim($attach['attachment'])); + if($_G['cache']['fields_register'][$field_key]['needverify']) { + $verifyarr[$key] = $attach['attachment']; + } else { + $profile[$key] = $attach['attachment']; + } + } + } + } + } + + if($setregip !== null) { + if($setregip == 1) { + C::t('common_regip')->update_count_by_ip($_G['clientip']); + } else { + C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => 1, 'dateline' => $_G['timestamp'])); + } + } + + if($invite && $this->setting['inviteconfig']['invitegroupid']) { + $groupinfo['groupid'] = $this->setting['inviteconfig']['invitegroupid']; + } + + $init_arr = array('credits' => explode(',', $this->setting['initcredits']), 'profile'=>$profile, 'emailstatus' => $emailstatus); + + C::t('common_member')->insert_user($uid, $username, $password, $email, $_G['clientip'], $groupinfo['groupid'], $init_arr, 0, $_G['remoteport']); + if($emailstatus) { + updatecreditbyaction('realemail', $uid); + } + if($verifyarr) { + $setverify = array( + 'uid' => $uid, + 'username' => $username, + 'verifytype' => '0', + 'field' => serialize($verifyarr), + 'dateline' => TIMESTAMP, + ); + C::t('common_member_verify_info')->insert($setverify); + C::t('common_member_verify')->insert(array('uid' => $uid)); + } + + require_once libfile('cache/userstats', 'function'); + build_cache_userstats(); + + if($this->extrafile && file_exists($this->extrafile)) { + require_once $this->extrafile; + } + + if($this->setting['regctrl'] || $this->setting['regfloodctrl']) { + C::t('common_regip')->delete_by_dateline($_G['timestamp']-($this->setting['regctrl'] > 72 ? $this->setting['regctrl'] : 72)*3600); + if($this->setting['regctrl']) { + C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => -1, 'dateline' => $_G['timestamp'])); + } + } + + $regmessage = dhtmlspecialchars($_GET['regmessage']); + if($this->setting['regverify'] == 2) { + C::t('common_member_validate')->insert(array( + 'uid' => $uid, + 'submitdate' => $_G['timestamp'], + 'moddate' => 0, + 'admin' => '', + 'submittimes' => 1, + 'status' => 0, + 'message' => $regmessage, + 'remark' => '', + ), false, true); + manage_addnotify('verifyuser'); + } + + setloginstatus(array( + 'uid' => $uid, + 'username' => $_G['username'], + 'password' => $password, + 'groupid' => $groupinfo['groupid'], + ), 0); + include_once libfile('function/stat'); + updatestat('register'); + + if($invite['id']) { + $result = C::t('common_invite')->count_by_uid_fuid($invite['uid'], $uid); + if(!$result) { + C::t('common_invite')->update($invite['id'], array('fuid'=>$uid, 'fusername'=>$_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2)); + updatestat('invite'); + } else { + $invite = array(); + } + } + if($invite['uid']) { + if($this->setting['inviteconfig']['inviteaddcredit']) { + updatemembercount($uid, array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['inviteaddcredit'])); + } + if($this->setting['inviteconfig']['invitedaddcredit']) { + updatemembercount($invite['uid'], array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['invitedaddcredit'])); + } + require_once libfile('function/friend'); + friend_make($invite['uid'], $invite['username'], false); + notification_add($invite['uid'], 'friend', 'invite_friend', array('actor' => ''.$invite['username'].''), 1); + + space_merge($invite, 'field_home'); + if(!empty($invite['privacy']['feed']['invite'])) { + require_once libfile('function/feed'); + $tite_data = array('username' => ''.$_G['username'].''); + feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $invite['uid'], $invite['username']); + } + } + + if($welcomemsg && !empty($welcomemsgtxt)) { + $welcomemsgtitle = replacesitevar($welcomemsgtitle); + $welcomemsgtxt = replacesitevar($welcomemsgtxt); + if($welcomemsg == 1) { + $welcomemsgtxt = nl2br(str_replace(':', ':', $welcomemsgtxt)); + notification_add($uid, 'system', $welcomemsgtxt, array('from_id' => 0, 'from_idtype' => 'welcomemsg'), 1); + } elseif($welcomemsg == 2) { + sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt); + } elseif($welcomemsg == 3) { + sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt); + $welcomemsgtxt = nl2br(str_replace(':', ':', $welcomemsgtxt)); + notification_add($uid, 'system', $welcomemsgtxt, array('from_id' => 0, 'from_idtype' => 'welcomemsg'), 1); + } + } + + if($fromuid) { + updatecreditbyaction('promotion_register', $fromuid); + dsetcookie('promotion', ''); + } + dsetcookie('loginuser', ''); + dsetcookie('activationauth', ''); + dsetcookie('invite_auth', ''); + + $url_forward = dreferer(); + $refreshtime = 3000; + switch($this->setting['regverify']) { + case 1: + require_once libfile('function/spacecp'); + emailcheck_send($_G['uid'], $email); + dsetcookie('resendemail', TIMESTAMP); + $message = 'register_email_verify'; + $locationmessage = 'register_email_verify_location'; + $refreshtime = 10000; + break; + case 2: + $message = 'register_manual_verify'; + $locationmessage = 'register_manual_verify_location'; + break; + default: + $message = 'register_succeed'; + $locationmessage = 'register_succeed_location'; + break; + } + $param = array('bbname' => $this->setting['bbname'], 'username' => $_G['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']); + if(strpos($url_forward, $this->setting['regname']) !== false || strpos($url_forward, 'buyinvitecode') !== false) { + $url_forward = 'forum.php'; + } + $href = str_replace("'", "\'", $url_forward); + $extra = array( + 'showid' => 'succeedmessage', + 'extrajs' => '', + 'striptags' => false, + ); + showmessage($message, $url_forward, $param, $extra); + } + } + +} + +class crime_action_ctl { + + static $actions = array('all', 'crime_delpost', 'crime_warnpost', 'crime_banpost', 'crime_banspeak', 'crime_banvisit', 'crime_banstatus', 'crime_avatar', 'crime_sightml', 'crime_customstatus', 'members_ban_none'); + + function __construct() {} + + public static function &instance() { + static $object; + if(empty($object)) { + $object = new crime_action_ctl(); + } + return $object; + } + + function recordaction($uid, $action, $reason) { + global $_G; + + $uid = intval($uid); + $key = array_search($action, self::$actions); + if($key === FALSE) { + return false; + } + $insert = array( + 'uid' => $uid, + 'operatorid' => $_G['uid'], + 'operator' => $_G['username'], + 'action' => $key, + 'reason' => $reason, + 'dateline' => $_G['timestamp'] + ); + C::t('common_member_crime')->insert($insert); + return true; + } + + function getactionlist($uid) { + $uid = intval($uid); + $clist = array(); + foreach(C::t('common_member_crime')->fetch_all_by_uid($uid) as $c) { + $c['action'] = self::$actions[$c['action']]; + $clist[] = $c; + } + return $clist; + } + + function getcount($uid, $action) { + $uid = intval($uid); + $key = array_search($action, self::$actions); + if($key === FALSE) { + return 0; + } + return C::t('common_member_crime')->count_by_uid_action($uid, $key); + } + + function search($action, $username, $operator, $starttime, $endtime, $reason, $start, $limit) { + $action = intval($action); + $operator = daddslashes(trim($operator)); + $starttime = $starttime ? strtotime($starttime) : 0; + $endtime = $endtime ? (strtotime($endtime) + 3600 * 24) : 0; + $reason = daddslashes(trim($reason)); + $start = intval($start); + $limit = intval($limit); + + if(!empty($username)) { + $uid = C::t('common_member')->fetch_uid_by_username($username); + $wheresql[] = "uid='$uid'"; + } + + if($action) { + $wheresql[] = "action='$action'"; + } + if($operator) { + $wheresql[] = "operator='$operator'"; + } + if($starttime) { + $wheresql[] = "dateline>='$starttime'"; + } + if($endtime) { + $wheresql[] = "dateline<='$endtime'"; + } + if($reason) { + $wheresql[] = "reason LIKE '%$reason%'"; + } + + if($wheresql) { + $wheresql = 'WHERE '.implode(' AND ', $wheresql); + } else { + $wheresql = ''; + } + $clist = array(); + $count = C::t('common_member_crime')->count_by_where($wheresql); + + if($count) { + $uids = array(); + foreach(C::t('common_member_crime')->fetch_all_by_where($wheresql, $start, $limit) as $crime) { + $crime['action'] = self::$actions[$crime['action']]; + $clist[] = $crime; + $uids[$crime['uid']] = $crime['uid']; + } + $members = C::t('common_member')->fetch_all($uids, false, 0); + foreach($clist as $key => $crime) { + $crime['username'] = $members[$crime['uid']]['username']; + $clist[$key] = $crime; + } + } + return array($count, $clist); + } +} +?> \ No newline at end of file diff --git a/source/class/class_membersearch.php b/source/class/class_membersearch.php new file mode 100644 index 0000000..824a952 --- /dev/null +++ b/source/class/class_membersearch.php @@ -0,0 +1,267 @@ +'member', 'username'=>'member', 'groupid'=>'member', 'medalid'=>'medal','tagid'=>'tag','idtype'=>'tag', + 'email'=>'member', 'credits'=>'member', 'regdate'=>'member', + 'status'=>'member', 'freeze'=>'member', 'emailstatus'=>'member', 'avatarstatus'=>'member', + 'conisbind'=>'member','uin' => 'black','sid'=>'session', + 'extcredits1'=>'count', 'extcredits2'=>'count', 'extcredits3'=>'count', 'extcredits4'=>'count', + 'extcredits5'=>'count', 'extcredits6'=>'count', 'extcredits7'=>'count', 'extcredits8'=>'count', + 'posts'=>'count','threads'=>'count','friends'=>'count','oltime'=>'count', + 'fid' => 'groupuser', 'level' => 'groupuser', + 'verify1' => 'verify', 'verify2' => 'verify', 'verify3' => 'verify', 'verify4' => 'verify', 'verify5' => 'verify', 'verify6' => 'verify', + 'regip'=>'status', 'lastip'=>'status', 'lastvisit'=>'status', 'lastpost' => 'status', 'realname'=>'profile', + 'birthyear'=>'profile', 'birthmonth'=>'profile', 'birthday'=>'profile', 'gender'=>'profile', + 'constellation'=>'profile', 'zodiac'=>'profile', 'telephone'=>'profile', 'mobile'=>'profile', + 'idcardtype'=>'profile', 'idcard'=>'profile', 'address'=>'profile', 'zipcode'=>'profile', 'nationality'=>'profile', + 'birthcountry'=>'profile', 'birthprovince'=>'profile', 'birthcity'=>'profile', 'residecountry'=>'profile', 'resideprovince'=>'profile', + 'residecity'=>'profile', 'residedist'=>'profile', 'residecommunity'=>'profile', + 'residesuite'=>'profile', 'graduateschool'=>'profile', 'education'=>'profile', + 'occupation'=>'profile', 'company'=>'profile', 'position'=>'profile', 'revenue'=>'profile', + 'affectivestatus'=>'profile', 'lookingfor'=>'profile', 'bloodtype'=>'profile', + 'height'=>'profile', 'weight'=>'profile', 'alipay'=>'profile', 'icq'=>'profile', + 'qq'=>'profile', 'yahoo'=>'profile', 'msn'=>'profile', 'taobao'=>'profile', 'site'=>'profile', + 'bio'=>'profile', 'interest'=>'profile', 'field1'=>'profile', 'field2'=>'profile', + 'field3'=>'profile', 'field4'=>'profile', 'field5'=>'profile', 'field6'=>'profile', + 'field7'=>'profile', 'field8'=>'profile', 'token' => 'token'); + return $fieldid ? $fields[$fieldid] : $fields; + } + + function gettype($fieldid) { + static $types = array( + 'uid'=>'int', 'groupid'=>'int', 'medalid'=>'int', 'tagid'=>'int', 'credits'=>'int', + 'status'=>'int', 'freeze'=>'int', 'emailstatus'=>'int', 'avatarstatus'=>'int', + 'extcredits1'=>'int', 'extcredits2'=>'int', 'extcredits3'=>'int', 'extcredits4'=>'int', + 'extcredits5'=>'int', 'extcredits6'=>'int', 'extcredits7'=>'int', 'extcredits8'=>'int', + 'posts'=>'int', 'threads'=>'int', 'friends'=>'int', 'birthyear'=>'int', 'birthmonth'=>'int', 'birthday'=>'int', 'gender'=>'int', + 'uin'=>'int', 'sid'=>'noempty', 'token' => 'noempty' + ); + return $types[$fieldid] ? $types[$fieldid] : 'string'; + } + + function search($condition, $maxsearch=100, $start=0){ + $list = array(); + $sql = membersearch::makesql($condition); + if($maxsearch) { + $sql .= " LIMIT $start, $maxsearch"; + } + if(isset($condition['token_noempty'])) { + try { + $query = DB::query($sql); + while($value = DB::fetch($query)) { + $list[] = intval($value['uid']); + } + } catch (Exception $e) {} + } else { + $query = DB::query($sql); + while($value = DB::fetch($query)) { + $list[] = intval($value['uid']); + } + } + return $list; + } + + function getcount($condition) { + $count = 0; + if(isset($condition['token_noempty'])) { + try { + $count = DB::result_first(membersearch::makesql($condition, true)); + } catch (Exception $e) {} + } else { + $count = DB::result_first(membersearch::makesql($condition, true)); + } + return intval($count); + } + + function filtercondition($condition) { + $tablename = isset($condition['tablename']) ? $condition['tablename'] : ''; + unset($condition['tablename']); + $fields = membersearch::getfield(); + foreach($condition as $key => $value) { + $rkey = str_replace(array('_low', '_high', '_noempty', '_after', '_before'), '', $key); + if(!(isset($fields[$rkey]) || in_array($key, array('verify', 'fid', 'tagid')))) { + unset($condition[$key]); + } + } + $condition['tablename'] = $tablename; + return $condition; + } + + function makesql($condition, $onlyCount=false) { + + $tables = $wheres = array(); + $isarchive = $condition['tablename'] === 'archive' ? true : false; + if($condition['verify']) { + foreach($condition['verify'] as $key => $value) { + $condition[$value] = 1; + } + unset($condition['verify']); + } + if($condition['fid']) { + $condition['level'] = '1,2,3,4'; + } + if($condition['tagid']) { + $condition['idtype'] = 'uid'; + } + + $fields = membersearch::getfield(); + foreach ($fields as $key=>$value) { + $return = array(); + if(isset($condition[$key])) { + $return = membersearch::makeset($key, $condition[$key], membersearch::gettype($key)); + } elseif(isset($condition[$key.'_low']) || isset($condition[$key.'_high'])) { + $return = membersearch::makerange($key, $condition[$key.'_low'], $condition[$key.'_high'], membersearch::gettype($key)); + } elseif(isset($condition[$key.'_noempty'])) { + $return = membersearch::makeset($key, $condition[$key.'_noempty'], membersearch::gettype($key)); + } elseif(isset($condition[$key.'_after']) || isset($condition[$key.'_before'])) { + $condition[$key.'_after'] = dmktime($condition[$key.'_after']); + $condition[$key.'_before'] = dmktime($condition[$key.'_before']); + $return = membersearch::makerange($key, $condition[$key.'_after'], $condition[$key.'_before'], membersearch::gettype($key)); + } + if($return) { + $tables[$return['table']] = true; + $wheres[] = $return['where']; + } + } + if($tables && $wheres) { + $parts = array(); + $table1 = $asuid = ''; + $uidfield = 'uid'; + foreach ($tables as $key => $value) { + $value = membersearch::gettable($key, $isarchive); + $parts[] = "$value as `$key`"; + if(! $table1) { + $table1 = $key; + if($table1 == 'tag') { + $uidfield = 'itemid'; + $asuid = ' as uid'; + } + } else { + if($key == 'tag') { + $keyuid = 'itemid'; + } else { + $keyuid = 'uid'; + } + $wheres[] = $table1.'.'.$uidfield.' = '.$key.'.'.$keyuid; + } + } + + $selectsql = $onlyCount ? 'SELECT COUNT(DISTINCT '.$table1.'.'.$uidfield.') as cnt ' : 'SELECT DISTINCT '.$table1.'.'.$uidfield.$asuid; + return $selectsql.' FROM '.implode(', ', $parts).' WHERE '.implode(' AND ', $wheres)." ORDER BY ".$table1.".".$uidfield; + } else { + $selectsql = $onlyCount ? 'SELECT COUNT(uid) as cnt ' : 'SELECT uid'; + return $selectsql.' FROM '.DB::table('common_member'.($isarchive ? '_archive' : ''))." WHERE 1 ORDER BY uid"; + } + } + + function makeset($field, $condition, $type='string') { + $return = $values = array(); + + $return['table'] = membersearch::getfield($field); + if(! $return['table']){ + return array(); + } + $field = $return['table'].'.'.$field; + + $islikesearch = $noempty = false; + if(!is_array($condition)) { + $condition = explode(',', $condition); + } + foreach ($condition as $value) { + $value = trim($value); + if($type == 'int') { + $value = intval($value); + } elseif($type == 'noempty') { + $noempty = true; + } elseif(!$islikesearch && strexists($value, '*')) { + $islikesearch = true; + } + if($type != 'int') $value = addslashes($value); + if($value !== null) { + $values[] = $value; + } + } + + if(!$values) { + return array(); + } + + if($islikesearch) { + $likes = array(); + foreach ($values as $value) { + if(strexists($value, '*')) { + $value = str_replace('*', '%', $value); + $likes[] = "$field LIKE '$value'"; + } else { + $likes[] = "$field = '$value'"; + } + } + $return['where'] = '('.implode(' OR ', $likes).')'; + } elseif($noempty) { + $return['where'] = "$field != ''"; + } elseif(count($values) > 1) { + $return['where'] = "$field IN ('".implode("','", $values)."')"; + } else { + $return['where'] = "$field = '$values[0]'"; + } + return $return; + } + + function makerange($field, $range_low=null, $range_high=null, $type='string') { + $return = array(); + + $return['table'] = membersearch::getfield($field); + if(!$return['table']){ + return array(); + } + $field = $return['table'].'.'.$field; + + if($type == 'int') { + $range_low = intval($range_low); + $range_high = intval($range_high); + } else { + $range_low = addslashes(trim($range_low)); + $range_high = addslashes(trim($range_high)); + } + + $wheres = array(); + if($range_low !== null) { + $wheres[] = "$field >= '$range_low'"; + } + if($range_high !== null && $range_high >= $range_low) { + $wheres[] = "$field <= '$range_high'"; + } + if($wheres) { + $return['where'] = implode(' AND ', $wheres); + return $return; + } else { + return array(); + } + } + + + function gettable($alias, $isarchive = false) { + static $mapping = array('member'=>'common_member', 'status'=>'common_member_status', 'profile'=>'common_member_profile', 'count'=>'common_member_count', 'session'=>'common_session', 'groupuser' => 'forum_groupuser', 'verify' => 'common_member_verify', 'black'=>'common_uin_black', 'medal'=>'common_member_medal', 'tag'=>'common_tagitem', 'token' => 'common_devicetoken'); + return DB::table($isarchive && in_array($alias, array('member', 'status', 'profile', 'count')) ? $mapping[$alias].'_archive' : $mapping[$alias]); + } + +} + + +?> \ No newline at end of file diff --git a/source/class/class_optimizer.php b/source/class/class_optimizer.php new file mode 100644 index 0000000..3b6ee16 --- /dev/null +++ b/source/class/class_optimizer.php @@ -0,0 +1,39 @@ +optimizer = new $type(); + } + + + public function check() { + return $this->optimizer->check(); + } + + public function optimizer() { + return $this->optimizer->optimizer(); + } + + public function option_optimizer($options) { + return $this->optimizer->option_optimizer($options); + } + + public function get_option() { + return $this->optimizer->get_option(); + } +} +?> \ No newline at end of file diff --git a/source/class/class_payment.php b/source/class/class_payment.php new file mode 100644 index 0000000..78c72c1 --- /dev/null +++ b/source/class/class_payment.php @@ -0,0 +1,367 @@ +fetch_all_setting(array('ec_wechat', 'ec_alipay', 'ec_qpay'), true); + if($channels['ec_alipay']['on']) { + return true; + } + if($channels['ec_wechat']['on']) { + return true; + } + if($channels['ec_qpay']['on']) { + return true; + } + return false; + } + + public static function channels() { + $result = array(); + $result['qpay'] = array( + 'id' => 'qpay', + 'title' => lang('spacecp', 'payment_qpay'), + 'logo' => 'static/image/common/qpay_logo.svg', + 'enable' => 0 + ); + $result['wechat'] = array( + 'id' => 'wechat', + 'title' => lang('spacecp', 'payment_wechat'), + 'logo' => 'static/image/common/wechatpay_logo.svg', + 'enable' => 0 + ); + $result['alipay'] = array( + 'id' => 'alipay', + 'title' => lang('spacecp', 'payment_alipay'), + 'logo' => 'static/image/common/alipay_logo.svg', + 'enable' => 0 + ); + + $channels = C::t('common_setting')->fetch_all_setting(array('ec_wechat', 'ec_alipay', 'ec_qpay'), true); + if($channels['ec_alipay']['on']) { + $result['alipay']['enable'] = 1; + } + if($channels['ec_wechat']['on']) { + $result['wechat']['enable'] = 1; + } + if($channels['ec_qpay']['on']) { + $result['qpay']['enable'] = 1; + } + return $result; + } + + public static function get($channel) { + $sdk_class = DISCUZ_ROOT . './api/payment/payment_' . $channel . '.php'; + if(!file_exists($sdk_class)) { + return false; + } + require_once $sdk_class; + $classname = 'payment_' . $channel; + if(!class_exists($classname)) { + return false; + } + return new $classname(); + } + + public static function create_order($type, $subject, $description, $amount, $return_url, $params = null, $fee = 0, $expire = 3600) { + global $_G; + + if(strpos($type, ':') !== false) { + $type_values = explode(':', $type); + $type_name = lang('plugin/' . $type_values[0], $type_values[1]); + } else { + $type_name = lang('payment/type', $type); + } + + $out_biz_no = dgmdate(TIMESTAMP, 'YmdHis') . random(14, 1); + $data = array( + 'out_biz_no' => $out_biz_no, + 'type' => $type, + 'type_name' => $type_name, + 'uid' => $_G['uid'], + 'amount' => $amount, + 'amount_fee' => $fee, + 'subject' => $subject, + 'description' => $description, + 'expire_time' => time() + $expire, + 'status' => 0, + 'return_url' => str_replace(array('{out_biz_no}'), array($out_biz_no), $return_url), + 'clientip' => $_G['clientip'], + 'remoteport' => $_G['remoteport'], + 'dateline' => time() + ); + if($params) { + $data['data'] = serialize($params); + } + $id = C::t('common_payment_order')->insert($data, true); + return $_G['siteurl'] . 'home.php?mod=spacecp&ac=payment&op=pay&order_id=' . $id; + } + + public static function finish_order($channel, $out_biz_no, $trade_no, $payment_time) { + $order = C::t('common_payment_order')->fetch_by_biz_no($out_biz_no); + if(!$order || $order['status']) { + if(!$order) { + $error = 50002; + } else { + $error = 50003; + } + self::paymentlog($channel, 0, 0, 0, $error, array('out_biz_no' => $out_biz_no, 'trade_no' => $trade_no)); + return true; + } + + $order['trade_no'] = $trade_no; + $order['payment_time'] = $payment_time; + $order['channel'] = $channel; + $order['status'] = 1; + + $status = C::t('common_payment_order')->update_order_finish($order['id'], $order['trade_no'], $order['payment_time'], $order['channel']); + if($status) { + self::retry_callback_order($order); + } else { + self::paymentlog($channel, 0, $order['uid'], $order['id'], 50004, array('out_biz_no' => $out_biz_no, 'trade_no' => $trade_no)); + } + return true; + } + + public static function retry_callback_order($order) { + if($order['status'] != 1) { + return array('code' => 500, 'message' => lang('message', 'payment_retry_callback_no_pay')); + } + if(!$order['callback_status']) { + $order_type = $order['type']; + if(strpos($order_type, ':') !== false) { + $order_type_values = explode(':', $order_type); + $callback_class = DISCUZ_ROOT . './source/plugin/' . $order_type_values[0] . '/payment/' . $order_type_values[1] . '.php'; + $class_name = $order_type_values[1]; + } else { + $callback_class = DISCUZ_ROOT . './source/class/payment/' . $order_type . '.php'; + $class_name = $order_type; + } + if(file_exists($callback_class)) { + require_once $callback_class; + if(class_exists($class_name)) { + $callback = new $class_name(); + $callback->callback(dunserialize($order['data']), $order); + } + } + C::t('common_payment_order')->update($order['id'], array('callback_status' => 1)); + } + return array('code' => 200); + } + + public static function query_order($channel, $order_id) { + $order = C::t('common_payment_order')->fetch($order_id); + if(!$order) { + return array('code' => 500, 'message' => lang('message', 'payment_order_no_exist')); + } + $payment = payment::get($channel); + if(!$payment) { + return array('code' => 500, 'message' => lang('message', 'payment_type_no_exist')); + } + $result = $payment->status($order['out_biz_no']); + if($result['code'] == 200 && $order['status'] != 1 && $result['data']) { + payment::finish_order($channel, $order['out_biz_no'], $result['data']['trade_no'], $result['data']['payment_time']); + } + return $result; + } + + public static function refund($refund_no, $order_id, $amount, $refund_desc) { + global $_G; + $order = C::t('common_payment_order')->fetch($order_id); + if(!$order || $order['status'] != 1) { + return array('code' => 500, 'message' => lang('message', 'payment_order_no_exist')); + } + + $refund_order = C::t('common_payment_refund')->fetch_by_no($refund_no); + if($refund_order) { + if($refund_order['order_id'] != $order_id) { + return array('code' => 500, 'message' => lang('message', 'payment_refund_id_exist')); + } + if($refund_order['status'] == 2) { + return array('code' => 200, 'data' => array( + 'refund_time' => $refund_order['refund_time'] + )); + } + if($refund_order['status'] == 1) { + return array('code' => 500, 'message' => lang('message', 'payment_refund_exist')); + } + + C::t('common_payment_refund')->update_refund_by_no($refund_no, array( + 'amount' => $amount, + 'description' => $refund_desc, + 'clientip' => $_G['clientip'], + 'remoteport' => $_G['remoteport'], + 'status' => 1, + 'dateline' => time() + )); + } else { + C::t('common_payment_refund')->insert(array( + 'order_id' => $order_id, + 'out_biz_no' => $refund_no, + 'amount' => $amount, + 'description' => $refund_desc, + 'status' => 1, + 'clientip' => $_G['clientip'], + 'remoteport' => $_G['remoteport'], + 'dateline' => time() + )); + } + + $payment = payment::get($order['channel']); + $result = $payment->refund($refund_no, $order['trade_no'], $order['amount'], $amount, $refund_desc); + if($result['code'] == 200) { + C::t('common_payment_refund')->update_refund_by_no($refund_no, array( + 'status' => 2, + 'refund_time' => $result['data']['refund_time'] + )); + } else { + C::t('common_payment_refund')->update_refund_by_no($refund_no, array( + 'status' => 2, + 'error' => $result['message'] + )); + } + return $result; + } + + public static function refund_status($refund_no, $order_id) { + $order = C::t('common_payment_order')->fetch($order_id); + if(!$order || $order['status'] != 1) { + return array('code' => 500, 'message' => lang('message', 'payment_order_no_exist')); + } + $refund_order = C::t('common_payment_refund')->fetch_by_no($refund_no); + if($refund_order) { + if($refund_order['order_id'] != $order_id) { + return array('code' => 500, 'message' => lang('message', 'payment_refund_id_exist')); + } elseif($refund_order['status'] == 1) { + return array('code' => 200, 'data' => array('refund_time' => $refund_order['refund_time'])); + } + } + + $payment = payment::get($order['channel']); + $result = $payment->refund_status($refund_no, $order['trade_no']); + if($result['code'] == 200) { + C::t('common_payment_refund')->update_refund_by_no($refund_no, array( + 'status' => 2, + 'refund_time' => $result['data']['refund_time'] + )); + } else { + C::t('common_payment_refund')->update_refund_by_no($refund_no, array( + 'status' => 2, + 'error' => $result['message'] + )); + } + return $result; + } + + public static function transfer($channel, $transfer_no, $amount, $uid, $realname, $account, $title = '', $desc = '') { + global $_G; + $transfer_order = C::t('common_payment_transfer')->fetch_by_no($transfer_no); + if($transfer_order) { + if($transfer_order['channel'] != $channel || $transfer_order['amount'] != $amount || $transfer_order['account'] != $account) { + return array('code' => 500, 'message' => lang('message', 'payment_transfer_id_exist')); + } + if($transfer_order['status'] == 2) { + return array('code' => 200, 'data' => array( + 'transfer_time' => $transfer_order['trade_time'] + )); + } + if($transfer_order['status'] == 1) { + return array('code' => 500, 'message' => lang('message', 'payment_transfer_exist')); + } + + C::t('common_payment_transfer')->update_transfer_by_no($transfer_no, array( + 'subject' => $title, + 'description' => $desc, + 'realname' => $realname, + 'clientip' => $_G['clientip'], + 'remoteport' => $_G['remoteport'], + 'uid' => $uid, + 'status' => 1, + 'dateline' => time() + )); + } else { + C::t('common_payment_transfer')->insert(array( + 'out_biz_no' => $transfer_no, + 'amount' => $amount, + 'subject' => $title, + 'description' => $desc, + 'realname' => $realname, + 'account' => $account, + 'channel' => $channel, + 'uid' => $uid, + 'status' => 1, + 'clientip' => $_G['clientip'], + 'remoteport' => $_G['remoteport'], + 'dateline' => time() + )); + } + + $payment = payment::get($channel); + $result = $payment->transfer($transfer_no, $amount, $realname, $account, $title, $desc); + if($result['code'] == 200) { + C::t('common_payment_transfer')->update_transfer_by_no($transfer_no, array( + 'status' => 2, + 'trade_time' => $result['data']['transfer_time'] + )); + } else { + C::t('common_payment_transfer')->update_transfer_by_no($transfer_no, array( + 'status' => 3, + 'error' => $result['message'] + )); + } + return $result; + } + + public static function transfer_status($transfer_no) { + $refund_order = C::t('common_payment_transfer')->fetch_by_no($transfer_no); + if(!$refund_order) { + return array('code' => 500, 'message' => lang('message', 'payment_transfer_id_no_exist')); + } elseif($refund_order['status'] == 2) { + return array('code' => 200, 'data' => array('transfer_time' => $refund_order['trade_time'])); + } + + $payment = payment::get($refund_order['channel']); + $result = $payment->transfer_status($transfer_no); + if($result['code'] == 200) { + C::t('common_payment_transfer')->update_transfer_by_no($transfer_no, array( + 'status' => 2, + 'trade_time' => $result['data']['transfer_time'] + )); + } else { + C::t('common_payment_transfer')->update_transfer_by_no($transfer_no, array( + 'status' => 3, + 'error' => $result['message'] + )); + } + return $result; + } + + public static function paymentlog($channel, $status, $uid, $order_id, $error, $data) { + global $_G; + require_once libfile('function/misc'); + + writelog('pmtlog', implode("\t", clearlogstring(array( + $_G['timestamp'], + $channel, + $status, + $order_id, + $uid, + $_G['clientip'], + $_G['remoteport'], + $error, + is_array($data) ? json_encode($data) : $data + )))); + } +} \ No newline at end of file diff --git a/source/class/class_portalcategory.php b/source/class/class_portalcategory.php new file mode 100644 index 0000000..6c8ec23 --- /dev/null +++ b/source/class/class_portalcategory.php @@ -0,0 +1,148 @@ +get_subcatids_by_catid($catid); + $this->_add_users_cats($users, $catids); + foreach($users as $v) { + $uids[$v['uid']] = $v['uid']; + } + $this->_update_member_allowadmincp($uids); + } + } + + function _update_member_allowadmincp($uids) { + if(!empty($uids)) { + $userperms = array(); + $userperms = C::t('portal_category_permission')->fetch_permission_by_uid($uids); + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $v) { + $v['allowadmincp'] = setstatus(3, empty($userperms[$v['uid']]['allowpublish']) ? 0 : 1, $v['allowadmincp']); + $v['allowadmincp'] = setstatus(2, empty($userperms[$v['uid']]['allowmanage']) ? 0 : 1, $v['allowadmincp']); + C::t('common_member')->update($uid, array('allowadmincp'=>$v['allowadmincp'])); + } + } + } + + function delete_users_perm($catid, $uids) { + + $uids = !is_array($uids) ? array($uids) : $uids; + $uids = array_map('intval', $uids); + $uids = array_filter($uids); + if($uids) { + C::t('portal_category_permission')->delete_by_catid_uid_inheritedcatid($catid, $uids, 0); + $this->delete_inherited_perm_by_catid($catid, $catid, $uids); + $this->_update_member_allowadmincp($uids); + } + } + + function delete_inherited_perm_by_catid($catid, $upid = 0, $uid = 0) { + if(!is_array($catid)) { + $catids = $this->get_subcatids_by_catid($catid); + } + if($catids) { + $uids = is_array($uid) ? $uid : array($uid); + foreach($uids as $uid_) { + $uid_ = intval($uid_); + C::t('portal_category_permission')->delete_by_catid_uid_inheritedcatid($catids, $uid_, $upid ? $upid : true); + if($uid_) { + $this->_update_member_allowadmincp(array($uid_)); + } + } + } + } + + function remake_inherited_perm($catid) { + loadcache('portalcategory'); + $portalcategory = getglobal('cache/portalcategory'); + $catid = intval($catid); + $upid = !empty($portalcategory[$catid]) ? $portalcategory[$catid]['upid'] : 0; + if($upid) { + $catids = $this->get_subcatids_by_catid($catid); + $users = $this->get_perms_by_catid($upid); + $this->_add_users_cats($users, $catids, $upid); + } + } + + function get_perms_by_catid($catid, $uid = 0) { + $perms = array(); + $catid = intval($catid); + $uid = intval($uid); + if($catid) { + $perms = C::t('portal_category_permission')->fetch_all_by_catid($catid, $uid); + } + return $perms; + } + + + function _add_users_cats($users, $catids, $upid = 0) { + C::t('portal_category_permission')->insert_batch($users, $catids, $upid); + } + + function delete_perm_by_inheritedcatid($catid, $uids = array()) { + if($uids && !is_array($uids)) $uids = array($uids); + if($catid) { + C::t('portal_category_permission')->delete_by_catid_uid_inheritedcatid(false, $uids, $catid); + if($uids) { + $this->_update_member_allowadmincp($uids); + } + } + } + + function delete_allperm_by_catid($catid) { + if($catid) { + C::t('portal_category_permission')->delete_by_catid_uid_inheritedcatid($catid); + C::t('portal_category_permission')->delete_by_catid_uid_inheritedcatid(false, false, $catid); + } + } + function get_subcatids_by_catid($catid) { + loadcache('portalcategory'); + $portalcategory = getglobal('cache/portalcategory'); + $catids = array(); + $catids[$catid] = $catid; + if(isset($portalcategory[$catid]) && !empty($portalcategory[$catid]['children'])) { + $children = array(); + foreach($portalcategory[$catid]['children'] as $cid) { + if(!$portalcategory[$cid]['notinheritedarticle']) { + $catids[$cid] = $cid; + if(!empty($portalcategory[$cid]['children'])) { + $children = array_merge($children, $portalcategory[$cid]['children']); + } + } + } + if(!empty($children)) { + foreach($children as $cid) { + if(!$portalcategory[$cid]['notinheritedarticle']) { + $catids[$cid] = $cid; + } + } + } + } + return $catids; + } +} +?> \ No newline at end of file diff --git a/source/class/class_seccode.php b/source/class/class_seccode.php new file mode 100644 index 0000000..25867c0 --- /dev/null +++ b/source/class/class_seccode.php @@ -0,0 +1,467 @@ +type == 2 && !extension_loaded('ming') && $this->type = 0; + if($this->type < 2 && function_exists('imagecreate') && function_exists('imagecolorset') && function_exists('imagecopyresized') && + function_exists('imagecolorallocate') && function_exists('imagechar') && function_exists('imagecolorsforindex') && + function_exists('imageline') && function_exists('imagecreatefromstring') && (function_exists('imagegif') || function_exists('imagepng') || function_exists('imagejpeg'))) { + $this->image(); + } elseif($this->type == 2 && extension_loaded('ming')) { + $this->flash(); + } elseif($this->type == 3) { + $this->audio(); + } else { + $this->bitmap(); + } + } + + function image() { + $bgcontent = $this->background(); + + if($this->animator == 1 && function_exists('imagegif')) { + include_once $this->includepath.'class_gifmerge.php'; + $trueframe = mt_rand(1, 9); + + for($i = 0; $i <= 9; $i++) { + $this->im = imagecreatefromstring($bgcontent); + $x[$i] = $y[$i] = 0; + $this->adulterate && $this->adulterate(); + if($i == $trueframe) { + $this->ttf && function_exists('imagettftext') || $this->type == 1 ? $this->ttffont() : $this->giffont(); + $d[$i] = mt_rand(250, 400); + $this->scatter && $this->scatter($this->im); + } else { + $this->adulteratefont(); + $d[$i] = mt_rand(5, 15); + $this->scatter && $this->scatter($this->im, 1); + } + ob_start(); + imagegif($this->im); + imagedestroy($this->im); + $frame[$i] = ob_get_contents(); + ob_end_clean(); + } + $anim = new GifMerge($frame, 255, 255, 255, 0, $d, $x, $y, 'C_MEMORY'); + header('Content-type: image/gif'); + echo $anim->getAnimation(); + } else { + $this->im = imagecreatefromstring($bgcontent); + $this->adulterate && $this->adulterate(); + $this->ttf && function_exists('imagettftext') || $this->type == 1 ? $this->ttffont() : $this->giffont(); + $this->scatter && $this->scatter($this->im); + + if(function_exists('imagepng')) { + header('Content-type: image/png'); + imagepng($this->im); + } else { + header('Content-type: image/jpeg'); + imagejpeg($this->im, '', 100); + } + imagedestroy($this->im); + } + } + + function background() { + $this->im = imagecreatetruecolor($this->width, $this->height); + $backgrounds = $c = array(); + if($this->background && function_exists('imagecreatefromjpeg') && function_exists('imagecolorat') && function_exists('imagecopymerge') && + function_exists('imagesetpixel') && function_exists('imageSX') && function_exists('imageSY')) { + if($handle = @opendir($this->datapath.'background/')) { + while($bgfile = @readdir($handle)) { + if(preg_match('/\.jpg$/i', $bgfile)) { + $backgrounds[] = $this->datapath.'background/'.$bgfile; + } + } + @closedir($handle); + } + if($backgrounds) { + $imwm = imagecreatefromjpeg($backgrounds[array_rand($backgrounds)]); + $colorindex = imagecolorat($imwm, 0, 0); + $c = imagecolorsforindex($imwm, $colorindex); + $colorindex = imagecolorat($imwm, 1, 0); + imagesetpixel($imwm, 0, 0, $colorindex); + $c[0] = $c['red'];$c[1] = $c['green'];$c[2] = $c['blue']; + imagecopymerge($this->im, $imwm, 0, 0, mt_rand(0, 200 - $this->width), mt_rand(0, 80 - $this->height), imageSX($imwm), imageSY($imwm), 100); + imagedestroy($imwm); + } + } + if(!$this->background || !$backgrounds) { + for($i = 0;$i < 3;$i++) { + $start[$i] = mt_rand(200, 255);$end[$i] = mt_rand(100, 150);$step[$i] = ($end[$i] - $start[$i]) / $this->width;$c[$i] = $start[$i]; + } + for($i = 0;$i < $this->width;$i++) { + $color = imagecolorallocate($this->im, $c[0], $c[1], $c[2]); + imageline($this->im, $i, 0, $i, $this->height, $color); + $c[0] += $step[0];$c[1] += $step[1];$c[2] += $step[2]; + } + $c[0] -= 20;$c[1] -= 20;$c[2] -= 20; + } + ob_start(); + if(function_exists('imagepng')) { + imagepng($this->im); + } else { + imagejpeg($this->im, '', 100); + } + imagedestroy($this->im); + $bgcontent = ob_get_contents(); + ob_end_clean(); + $this->fontcolor = $c; + return $bgcontent; + } + + function adulterate() { + $linenums = $this->height / 10; + for($i = 0; $i <= $linenums;$i++) { + $color = $this->color ? imagecolorallocate($this->im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)) : imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + $x = mt_rand(0, $this->width); + $y = mt_rand(0, $this->height); + if(mt_rand(0, 1)) { + $w = mt_rand(0, $this->width); + $h = mt_rand(0, $this->height); + $s = mt_rand(0, 360); + $e = mt_rand(0, 360); + for($j = 0;$j < 3;$j++) { + imagearc($this->im, $x + $j, $y, $w, $h, $s, $e, $color); + } + } else { + $xe = mt_rand(0, $this->width); + $ye = mt_rand(0, $this->height); + imageline($this->im, $x, $y, $xe, $ye, $color); + for($j = 0;$j < 3;$j++) { + imageline($this->im, $x + $j, $y, $xe, $ye, $color); + } + } + } + } + + function adulteratefont() { + $seccodeunits = 'BCEFGHJKMPQRTVWXY2346789'; + $x = $this->width / 4; + $y = $this->height / 10; + $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + for($i = 0; $i <= 3; $i++) { + $adulteratecode = $seccodeunits[mt_rand(0, 23)]; + imagechar($this->im, 5, $x * $i + mt_rand(0, $x - 10), mt_rand($y, $this->height - 10 - $y), $adulteratecode, $text_color); + } + } + + function ttffont() { + $seccode = $this->code; + $seccoderoot = $this->type ? $this->fontpath.'ch/' : $this->fontpath.'en/'; + $dirs = opendir($seccoderoot); + $seccodettf = array(); + while($entry = readdir($dirs)) { + if($entry != '.' && $entry != '..' && in_array(strtolower(fileext($entry)), array('ttf', 'ttc'))) { + $seccodettf[] = $entry; + } + } + if(empty($seccodettf)) { + $this->giffont(); + return; + } + $seccodelength = 4; + if($this->type && !empty($seccodettf)) { + if(strtoupper(CHARSET) != 'UTF-8') { + include $this->includepath.'class_chinese.php'; + $cvt = new Chinese(CHARSET, 'utf8'); + $seccode = $cvt->Convert($seccode); + } + $seccode = array(substr($seccode, 0, 3), substr($seccode, 3, 3)); + $seccodelength = 2; + } + $widthtotal = 0; + for($i = 0; $i < $seccodelength; $i++) { + $font[$i]['font'] = $seccoderoot.$seccodettf[array_rand($seccodettf)]; + $font[$i]['angle'] = $this->angle ? mt_rand(-30, 30) : 0; + $font[$i]['size'] = $this->type ? $this->width / 7 : $this->width / 6; + $this->size && $font[$i]['size'] = mt_rand($font[$i]['size'] - $this->width / 40, $font[$i]['size'] + $this->width / 20); + $box = imagettfbbox($font[$i]['size'], 0, $font[$i]['font'], $seccode[$i]); + $font[$i]['zheight'] = max($box[1], $box[3]) - min($box[5], $box[7]); + $box = imagettfbbox($font[$i]['size'], $font[$i]['angle'], $font[$i]['font'], $seccode[$i]); + $font[$i]['height'] = max($box[1], $box[3]) - min($box[5], $box[7]); + $font[$i]['hd'] = $font[$i]['height'] - $font[$i]['zheight']; + $font[$i]['width'] = (max($box[2], $box[4]) - min($box[0], $box[6])) + mt_rand(0, $this->width / 8); + $font[$i]['width'] = $font[$i]['width'] > $this->width / $seccodelength ? $this->width / $seccodelength : $font[$i]['width']; + $widthtotal += $font[$i]['width']; + } + $x = mt_rand($font[0]['angle'] > 0 ? cos(deg2rad(90 - $font[0]['angle'])) * $font[0]['zheight'] : 1, $this->width - $widthtotal); + !$this->color && $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + for($i = 0; $i < $seccodelength; $i++) { + if($this->color) { + $this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)); + $this->shadow && $text_shadowcolor = imagecolorallocate($this->im, 0, 0, 0); + $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + } elseif($this->shadow) { + $text_shadowcolor = imagecolorallocate($this->im, 0, 0, 0); + } + $y = $font[0]['angle'] > 0 ? mt_rand($font[$i]['height'], $this->height) : mt_rand($font[$i]['height'] - $font[$i]['hd'], $this->height - $font[$i]['hd']); + $this->shadow && imagettftext($this->im, $font[$i]['size'], $font[$i]['angle'], $x + 1, $y + 1, $text_shadowcolor, $font[$i]['font'], $seccode[$i]); + imagettftext($this->im, $font[$i]['size'], $font[$i]['angle'], $x, $y, $text_color, $font[$i]['font'], $seccode[$i]); + $x += $font[$i]['width']; + } + $this->warping && $this->warping($this->im); + } + + function warping(&$obj) { + $rgb = array(); + $direct = rand(0, 1); + $width = imagesx($obj); + $height = imagesy($obj); + $level = $width / 20; + for($j = 0;$j < $height;$j++) { + for($i = 0;$i < $width;$i++) { + $rgb[$i] = imagecolorat($obj, $i , $j); + } + for($i = 0;$i < $width;$i++) { + $r = sin($j / $height * 2 * M_PI - M_PI * 0.5) * ($direct ? $level : -$level); + imagesetpixel($obj, $i + $r , $j , $rgb[$i]); + } + } + } + + function scatter(&$obj, $level = 0) { + $rgb = array(); + $this->scatter = $level ? $level : $this->scatter; + $width = imagesx($obj); + $height = imagesy($obj); + for($j = 0;$j < $height;$j++) { + for($i = 0;$i < $width;$i++) { + $rgb[$i] = imagecolorat($obj, $i , $j); + } + for($i = 0;$i < $width;$i++) { + $r = rand(-$this->scatter, $this->scatter); + imagesetpixel($obj, $i + $r , $j , $rgb[$i]); + } + } + } + + function giffont() { + $seccode = $this->code; + $seccodedir = array(); + if(function_exists('imagecreatefromgif')) { + $seccoderoot = $this->datapath.'gif/'; + $dirs = opendir($seccoderoot); + while($dir = readdir($dirs)) { + if($dir != '.' && $dir != '..' && file_exists($seccoderoot.$dir.'/9.gif')) { + $seccodedir[] = $dir; + } + } + } + $widthtotal = 0; + for($i = 0; $i <= 3; $i++) { + $this->imcodefile = $seccodedir ? $seccoderoot.$seccodedir[array_rand($seccodedir)].'/'.strtolower($seccode[$i]).'.gif' : ''; + if(!empty($this->imcodefile) && file_exists($this->imcodefile)) { + $font[$i]['file'] = $this->imcodefile; + $font[$i]['data'] = getimagesize($this->imcodefile); + $font[$i]['width'] = $font[$i]['data'][0] + mt_rand(0, 6) - 4; + $font[$i]['height'] = $font[$i]['data'][1] + mt_rand(0, 6) - 4; + $font[$i]['width'] += mt_rand(0, max(0, $this->width / 5 - $font[$i]['width'])); + $widthtotal += $font[$i]['width']; + } else { + $font[$i]['file'] = ''; + $font[$i]['width'] = 8 + mt_rand(0, $this->width / 5 - 5); + $widthtotal += $font[$i]['width']; + } + } + $x = mt_rand(1, $this->width - $widthtotal); + for($i = 0; $i <= 3; $i++) { + $this->color && $this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)); + if($font[$i]['file']) { + $this->imcode = imagecreatefromgif($font[$i]['file']); + if($this->size) { + $font[$i]['width'] = mt_rand($font[$i]['width'] - $this->width / 20, $font[$i]['width'] + $this->width / 20); + $font[$i]['height'] = mt_rand($font[$i]['height'] - $this->width / 20, $font[$i]['height'] + $this->width / 20); + } + $y = mt_rand(0, max(0, $this->height - $font[$i]['height'])); + if($this->shadow) { + $this->imcodeshadow = $this->imcode; + imagecolorset($this->imcodeshadow, 0, 0, 0, 0); + imagecopyresized($this->im, $this->imcodeshadow, $x + 1, $y + 1, 0, 0, $font[$i]['width'], $font[$i]['height'], $font[$i]['data'][0], $font[$i]['data'][1]); + } + imagecolorset($this->imcode, 0 , $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + imagecopyresized($this->im, $this->imcode, $x, $y, 0, 0, $font[$i]['width'], $font[$i]['height'], $font[$i]['data'][0], $font[$i]['data'][1]); + } else { + $y = mt_rand(0, $this->height - 20); + if($this->shadow) { + $text_shadowcolor = imagecolorallocate($this->im, 0, 0, 0); + imagechar($this->im, 5, $x + 1, $y + 1, $seccode[$i], $text_shadowcolor); + } + $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + imagechar($this->im, 5, $x, $y, $seccode[$i], $text_color); + } + $x += $font[$i]['width']; + } + } + + function flash() { + $spacing = 5; + $codewidth = ($this->width - $spacing * 5) / 4; + $strforswdaction = ''; + for($i = 0; $i <= 3; $i++) { + $strforswdaction .= $this->swfcode($codewidth, $spacing, $this->code[$i], $i+1); + } + + ming_setScale(20.00000000); + ming_useswfversion(6); + $movie = new SWFMovie(); + $movie->setDimension($this->width, $this->height); + $movie->setBackground(255, 255, 255); + $movie->setRate(31); + + $fontcolor = '0x'.(sprintf('%02s', dechex (mt_rand(0, 255)))).(sprintf('%02s', dechex (mt_rand(0, 128)))).(sprintf('%02s', dechex (mt_rand(0, 255)))); + $strAction = " + _root.createEmptyMovieClip ( 'triangle', 1 ); + with ( _root.triangle ) { + lineStyle( 3, $fontcolor, 100 ); + $strforswdaction + } + "; + $movie->add(new SWFAction( str_replace("\r", "", $strAction) )); + header('Content-type: application/x-shockwave-flash'); + $movie->output(); + } + + function swfcode($width, $d, $code, $order) { + $str = ''; + $height = $this->height - $d * 2; + $x_0 = ($order * ($width + $d) - $width); + $x_1 = $x_0 + $width / 2; + $x_2 = $x_0 + $width; + $y_0 = $d; + $y_2 = $y_0 + $height; + $y_1 = $y_2 / 2; + $y_0_5 = $y_2 / 4; + $y_1_5 = $y_1 + $y_0_5; + switch($code) { + case 'B':$str .= 'moveTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_1.', '.$y_2.');lineTo('.$x_2.', '.$y_1_5.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'C':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');';break; + case 'E':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'F':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'G':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'H':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case 'J':$str .= 'moveTo('.$x_1.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_1_5.');';break; + case 'K':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');';break; + case 'M':$str .= 'moveTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');';break; + case 'P':$str .= 'moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');';break; + case 'Q':$str .= 'moveTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_1.', '.$y_1.');';break; + case 'R':$str .= 'moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');';break; + case 'T':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');moveTo('.$x_1.', '.$y_0.');lineTo('.$x_1.', '.$y_2.');';break; + case 'V':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');';break; + case 'W':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');';break; + case 'X':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');';break; + case 'Y':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_1.', '.$y_2.');';break; + case '2':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');';break; + case '3':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case '4':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case '6':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');';break; + case '7':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');';break; + case '8':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case '9':$str .= 'moveTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');';break; + } + return $str; + } + + function audio() { + header('Content-type: audio/mpeg'); + for($i = 0;$i <= 3; $i++) { + readfile($this->datapath.'sound/'.strtolower($this->code[$i]).'.mp3'); + } + } + + function bitmap() { + $numbers = array + ( + 'B' => array('00','fc','66','66','66','7c','66','66','fc','00'), + 'C' => array('00','38','64','c0','c0','c0','c4','64','3c','00'), + 'E' => array('00','fe','62','62','68','78','6a','62','fe','00'), + 'F' => array('00','f8','60','60','68','78','6a','62','fe','00'), + 'G' => array('00','78','cc','cc','de','c0','c4','c4','7c','00'), + 'H' => array('00','e7','66','66','66','7e','66','66','e7','00'), + 'J' => array('00','f8','cc','cc','cc','0c','0c','0c','7f','00'), + 'K' => array('00','f3','66','66','7c','78','6c','66','f7','00'), + 'M' => array('00','f7','63','6b','6b','77','77','77','e3','00'), + 'P' => array('00','f8','60','60','7c','66','66','66','fc','00'), + 'Q' => array('00','78','cc','cc','cc','cc','cc','cc','78','00'), + 'R' => array('00','f3','66','6c','7c','66','66','66','fc','00'), + 'T' => array('00','78','30','30','30','30','b4','b4','fc','00'), + 'V' => array('00','1c','1c','36','36','36','63','63','f7','00'), + 'W' => array('00','36','36','36','77','7f','6b','63','f7','00'), + 'X' => array('00','f7','66','3c','18','18','3c','66','ef','00'), + 'Y' => array('00','7e','18','18','18','3c','24','66','ef','00'), + '2' => array('fc','c0','60','30','18','0c','cc','cc','78','00'), + '3' => array('78','8c','0c','0c','38','0c','0c','8c','78','00'), + '4' => array('00','3e','0c','fe','4c','6c','2c','3c','1c','1c'), + '6' => array('78','cc','cc','cc','ec','d8','c0','60','3c','00'), + '7' => array('30','30','38','18','18','18','1c','8c','fc','00'), + '8' => array('78','cc','cc','cc','78','cc','cc','cc','78','00'), + '9' => array('f0','18','0c','6c','dc','cc','cc','cc','78','00') + ); + + foreach($numbers as $i => $number) { + for($j = 0; $j < 6; $j++) { + $a1 = substr('012', mt_rand(0, 2), 1).substr('012345', mt_rand(0, 5), 1); + $a2 = substr('012345', mt_rand(0, 5), 1).substr('0123', mt_rand(0, 3), 1); + mt_rand(0, 1) == 1 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a1); + mt_rand(0, 1) == 0 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a2); + } + } + + $bitmap = array(); + for($i = 0; $i < 20; $i++) { + for($j = 0; $j <= 3; $j++) { + $bytes = $numbers[$this->code[$j]][$i]; + $a = mt_rand(0, 14); + array_push($bitmap, $bytes); + } + } + + for($i = 0; $i < 8; $i++) { + $a = substr('012345', mt_rand(0, 2), 1) . substr('012345', mt_rand(0, 5), 1); + array_unshift($bitmap, $a); + array_push($bitmap, $a); + } + + $image = pack('H*', '424d9e000000000000003e000000280000002000000018000000010001000000'. + '0000600000000000000000000000000000000000000000000000FFFFFF00'.implode('', $bitmap)); + + header('Content-Type: image/bmp'); + echo $image; + } + +} + +?> \ No newline at end of file diff --git a/source/class/class_sms.php b/source/class/class_sms.php new file mode 100644 index 0000000..9a055f6 --- /dev/null +++ b/source/class/class_sms.php @@ -0,0 +1,171 @@ + 0 ? $smstimelimit : 86400; + $lastsend = C::t('common_smslog')->get_lastsms_by_uumm($uid, $svctype, $secmobicc, $secmobile); + $result = self::DISCUZ_CLASS_SMS_VERIFY_FAIL; + if($seccode == $lastsend['content'] && !$lastsend['verify'] && time() - $lastsend['dateline'] < $smstimelimit) { + $result = self::DISCUZ_CLASS_SMS_VERIFY_PASS; + } + if($updateverify) { + C::t('common_smslog')->update($lastsend['smslogid'], array('verify' => 1)); + } + return $result; + } + + public static function send($uid, $smstype, $svctype, $secmobicc, $secmobile, $content, $force) { + $time = time(); + $ip = getglobal('clientip'); + $port = getglobal('remoteport'); + + $check = self::check($uid, $secmobicc, $secmobile, $time, $ip, $port, $force); + if($check < 0) { + self::log($smstype, $svctype, 0, $check, $uid, $secmobicc, $secmobile, $time, $ip, $port, $content); + return $check; + } + + $smsgw = self::smsgw($smstype, $secmobicc); + if($smsgw < 0) { + self::log($smstype, $svctype, 0, $smsgw, $uid, $secmobicc, $secmobile, $time, $ip, $port, $content); + return $smsgw; + } + + $output = self::output($smsgw, $uid, $smstype, $svctype, $secmobicc, $secmobile, $content); + self::log($smstype, $svctype, 0, $output, $uid, $secmobicc, $secmobile, $time, $ip, $port, $content); + return $output; + } + + protected static function check($uid, $secmobicc, $secmobile, $time, $ip, $port, $force) { + if(!getglobal('setting/smsstatus')) { + return self::DISCUZ_CLASS_SMS_ERROR_SMSDISAB; + } + + if(!$force) { + $smstimelimit = getglobal('setting/smstimelimit'); + $smstimelimit = $smstimelimit > 0 ? $smstimelimit : 86400; + $smsnumlimit = getglobal('setting/smsnumlimit'); + $smsnumlimit = $smsnumlimit > 0 ? $smsnumlimit : 5; + $smsinterval = getglobal('setting/smsinterval'); + $smsinterval = $smsinterval > 0 ? $smsinterval : 300; + $smsmillimit = getglobal('setting/smsmillimit'); + $smsmillimit = $smsmillimit > 0 ? $smsmillimit : 20; + $smsglblimit = getglobal('setting/smsglblimit'); + $smsglblimit = $smsglblimit > 0 ? $smsglblimit : 1000; + + $ut = C::t('common_smslog')->get_sms_by_ut($uid, $smstimelimit); + $mmt = C::t('common_smslog')->get_sms_by_mmt($secmobicc, $secmobile, $smstimelimit); + if($time - $ut[0]['dateline'] < $smsinterval || $time - $mmt[0]['dateline'] < $smsinterval) { + return self::DISCUZ_CLASS_SMS_ERROR_TIMELESS; + } + if(count($ut) > $smsnumlimit || count($mmt) > $smsnumlimit) { + return self::DISCUZ_CLASS_SMS_ERROR_NUMLIMIT; + } + + $lastmilion = C::t('common_smslog')->count_sms_by_milions_mmt($secmobicc, $secmobile, $smstimelimit); + if($lastmilion > $smsmillimit) { + return self::DISCUZ_CLASS_SMS_ERROR_MILLIMIT; + } + + $globalsend = C::t('common_smslog')->count_sms_by_time($smstimelimit); + if($globalsend > $smsglblimit) { + return self::DISCUZ_CLASS_SMS_ERROR_GLBLIMIT; + } + } + + return self::DISCUZ_CLASS_SMS_ERROR_NOWNOERR; + } + + protected static function smsgw($smstype, $secmobicc) { + $smsgwlist = C::t('common_smsgw')->fetch_all_gw_avaliable(); + foreach($smsgwlist as $key => $value) { + if(array_search($secmobicc, explode(',', $value['sendrule'])) !== false) { + if($smstype == self::DISCUZ_CLASS_SMS_TYPE_MESSAGE && $value['type'] == self::DISCUZ_CLASS_SMSGW_GWTYPE_TPL) { + continue; + } + $smsgw = $value; + } + } + + if(isset($smsgw)) { + return $smsgw; + } else { + return self::DISCUZ_CLASS_SMS_ERROR_CTFSMSGW; + } + + } + + protected static function output($smsgw, $uid, $smstype, $svctype, $secmobicc, $secmobile, $content) { + global $_G; + $efile = explode(':', $smsgw['class']); + if(is_array($efile) && count($efile) > 1) { + $smsgwfile = in_array($efile[0], $_G['setting']['plugins']['available']) ? DISCUZ_ROOT.'./source/plugin/'.$efile[0].'/smsgw/smsgw_'. $efile[1] . '.php' : ''; + } else { + $smsgwfile = DISCUZ_ROOT.'./source/class/smsgw/smsgw_' . $smsgw['class'] . '.php'; + } + + if($smsgwfile) { + include($smsgwfile); + $classname = 'smsgw_' . ((is_array($efile) && count($efile) > 1) ? $efile[1] : $smsgw['class']); + if(class_exists($classname)) { + $class = new $classname(); + $class->parameters = dunserialize($smsgw['parameters']); + $result = $class->send($uid, $smstype, $svctype, $secmobicc, $secmobile, array('content' => $content)); + } else { + $result = self::DISCUZ_CLASS_SMS_ERROR_CTFGWCLS; + } + } else { + $result = self::DISCUZ_CLASS_SMS_ERROR_CTFGWNME; + } + + if($result < 0 && ($result == self::DISCUZ_CLASS_SMS_ERROR_CTFGWCLS || $result == self::DISCUZ_CLASS_SMS_ERROR_CTFGWNME)) { + $data = array('available' => '0'); + C::t('common_smsgw')->update($smsgw['smsgwid'], $data); + } + + return $result; + } + + protected static function log($smstype, $svctype, $smsgw, $status, $uid, $secmobicc, $secmobile, $time, $ip, $port, $content = '') { + return C::t('common_smslog')->insert(array('smstype' => $smstype, 'svctype' => $svctype, 'smsgw' => $smsgw, 'status' => $status, 'uid' => $uid, 'secmobicc' => $secmobicc, 'secmobile' => $secmobile, 'dateline' => $time, 'ip' => $ip, 'port' => $port, 'content' => $content)); + } + +} \ No newline at end of file diff --git a/source/class/class_sphinx.php b/source/class/class_sphinx.php new file mode 100644 index 0000000..df3d6df --- /dev/null +++ b/source/class/class_sphinx.php @@ -0,0 +1,1402 @@ +=8 ) + { + $v = (int)$v; + return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); + } + + if ( is_int($v) ) + return pack ( "NN", $v < 0 ? -1 : 0, $v ); + + if ( function_exists("bcmul") ) + { + if ( bccomp ( $v, 0 ) == -1 ) + $v = bcadd ( "18446744073709551616", $v ); + $h = bcdiv ( $v, "4294967296", 0 ); + $l = bcmod ( $v, "4294967296" ); + return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit + } + + $p = max(0, strlen($v) - 13); + $lo = abs((float)substr($v, $p)); + $hi = abs((float)substr($v, 0, $p)); + + $m = $lo + $hi*1316134912.0; // (10 ^ 13) % (1 << 32) = 1316134912 + $q = floor($m/4294967296.0); + $l = $m - ($q*4294967296.0); + $h = $hi*2328.0 + $q; // (10 ^ 13) / (1 << 32) = 2328 + + if ( $v<0 ) + { + if ( $l==0 ) + $h = 4294967296.0 - $h; + else + { + $h = 4294967295.0 - $h; + $l = 4294967296.0 - $l; + } + } + return pack ( "NN", $h, $l ); +} + +function sphPackU64 ( $v ) +{ + assert ( is_numeric($v) ); + + if ( PHP_INT_SIZE>=8 ) + { + assert ( $v>=0 ); + + if ( is_int($v) ) + return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); + + if ( function_exists("bcmul") ) + { + $h = bcdiv ( $v, 4294967296, 0 ); + $l = bcmod ( $v, 4294967296 ); + return pack ( "NN", $h, $l ); + } + + $p = max ( 0, strlen($v) - 13 ); + $lo = (int)substr ( $v, $p ); + $hi = (int)substr ( $v, 0, $p ); + + $m = $lo + $hi*1316134912; + $l = $m % 4294967296; + $h = $hi*2328 + (int)($m/4294967296); + + return pack ( "NN", $h, $l ); + } + + if ( is_int($v) ) + return pack ( "NN", 0, $v ); + + if ( function_exists("bcmul") ) + { + $h = bcdiv ( $v, "4294967296", 0 ); + $l = bcmod ( $v, "4294967296" ); + return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit + } + + $p = max(0, strlen($v) - 13); + $lo = (float)substr($v, $p); + $hi = (float)substr($v, 0, $p); + + $m = $lo + $hi*1316134912.0; + $q = floor($m / 4294967296.0); + $l = $m - ($q * 4294967296.0); + $h = $hi*2328.0 + $q; + + return pack ( "NN", $h, $l ); +} + +function sphUnpackU64 ( $v ) +{ + list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); + + if ( PHP_INT_SIZE>=8 ) + { + if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again + if ( $lo<0 ) $lo += (1<<32); + + if ( $hi<=2147483647 ) + return ($hi<<32) + $lo; + + if ( function_exists("bcmul") ) + return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); + + $C = 100000; + $h = ((int)($hi / $C) << 32) + (int)($lo / $C); + $l = (($hi % $C) << 32) + ($lo % $C); + if ( $l>$C ) + { + $h += (int)($l / $C); + $l = $l % $C; + } + + if ( $h==0 ) + return $l; + return sprintf ( "%d%05d", $h, $l ); + } + + if ( $hi==0 ) + { + if ( $lo>0 ) + return $lo; + return sprintf ( "%u", $lo ); + } + + $hi = sprintf ( "%u", $hi ); + $lo = sprintf ( "%u", $lo ); + + if ( function_exists("bcmul") ) + return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); + + $hi = (float)$hi; + $lo = (float)$lo; + + $q = floor($hi/10000000.0); + $r = $hi - $q*10000000.0; + $m = $lo + $r*4967296.0; + $mq = floor($m/10000000.0); + $l = $m - $mq*10000000.0; + $h = $q*4294967296.0 + $r*429.0 + $mq; + + $h = sprintf ( "%.0f", $h ); + $l = sprintf ( "%07.0f", $l ); + if ( $h=="0" ) + return sprintf( "%.0f", (float)$l ); + return $h . $l; +} + +function sphUnpackI64 ( $v ) +{ + list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); + + if ( PHP_INT_SIZE>=8 ) + { + if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again + if ( $lo<0 ) $lo += (1<<32); + + return ($hi<<32) + $lo; + } + + if ( $hi==0 ) + { + if ( $lo>0 ) + return $lo; + return sprintf ( "%u", $lo ); + } + elseif ( $hi==-1 ) + { + if ( $lo<0 ) + return $lo; + return sprintf ( "%.0f", $lo - 4294967296.0 ); + } + + $neg = ""; + $c = 0; + if ( $hi<0 ) + { + $hi = ~$hi; + $lo = ~$lo; + $c = 1; + $neg = "-"; + } + + $hi = sprintf ( "%u", $hi ); + $lo = sprintf ( "%u", $lo ); + + if ( function_exists("bcmul") ) + return $neg . bcadd ( bcadd ( $lo, bcmul ( $hi, "4294967296" ) ), $c ); + + $hi = (float)$hi; + $lo = (float)$lo; + + $q = floor($hi/10000000.0); + $r = $hi - $q*10000000.0; + $m = $lo + $r*4967296.0; + $mq = floor($m/10000000.0); + $l = $m - $mq*10000000.0 + $c; + $h = $q*4294967296.0 + $r*429.0 + $mq; + if ( $l==10000000 ) + { + $l = 0; + $h += 1; + } + + $h = sprintf ( "%.0f", $h ); + $l = sprintf ( "%07.0f", $l ); + if ( $h=="0" ) + return $neg . sprintf( "%.0f", (float)$l ); + return $neg . $h . $l; +} + + +function sphFixUint ( $value ) +{ + if ( PHP_INT_SIZE>=8 ) + { + if ( $value<0 ) $value += (1<<32); + return $value; + } + else + { + return sprintf ( "%u", $value ); + } +} + + +class SphinxClient +{ + var $_host; ///< searchd host (default is "localhost") + var $_port; ///< searchd port (default is 9312) + var $_offset; ///< how many records to seek from result-set start (default is 0) + var $_limit; ///< how many records to return from result-set starting at offset (default is 20) + var $_mode; ///< query matching mode (default is SPH_MATCH_ALL) + var $_weights; ///< per-field weights (default is 1 for all fields) + var $_sort; ///< match sorting mode (default is SPH_SORT_RELEVANCE) + var $_sortby; ///< attribute to sort by (defualt is "") + var $_min_id; ///< min ID to match (default is 0, which means no limit) + var $_max_id; ///< max ID to match (default is 0, which means no limit) + var $_filters; ///< search filters + var $_groupby; ///< group-by attribute name + var $_groupfunc; ///< group-by function (to pre-process group-by attribute value with) + var $_groupsort; ///< group-by sorting clause (to sort groups in result set with) + var $_groupdistinct;///< group-by count-distinct attribute + var $_maxmatches; ///< max matches to retrieve + var $_cutoff; ///< cutoff to stop searching at (default is 0) + var $_retrycount; ///< distributed retries count + var $_retrydelay; ///< distributed retries delay + var $_anchor; ///< geographical anchor point + var $_indexweights; ///< per-index weights + var $_ranker; ///< ranking mode (default is SPH_RANK_PROXIMITY_BM25) + var $_maxquerytime; ///< max query time, milliseconds (default is 0, do not limit) + var $_fieldweights; ///< per-field-name weights + var $_overrides; ///< per-query attribute values overrides + var $_select; ///< select-list (attributes or expressions, with optional aliases) + + var $_error; ///< last error message + var $_warning; ///< last warning message + var $_connerror; ///< connection error vs remote error flag + + var $_reqs; ///< requests array for multi-query + var $_mbenc; ///< stored mbstring encoding + var $_arrayresult; ///< whether $result["matches"] should be a hash or an array + var $_timeout; ///< connect timeout + + + function __construct() + { + $this->_host = "localhost"; + $this->_port = 9312; + $this->_path = false; + $this->_socket = false; + + $this->_offset = 0; + $this->_limit = 20; + $this->_mode = SPH_MATCH_ALL; + $this->_weights = array (); + $this->_sort = SPH_SORT_RELEVANCE; + $this->_sortby = ""; + $this->_min_id = 0; + $this->_max_id = 0; + $this->_filters = array (); + $this->_groupby = ""; + $this->_groupfunc = SPH_GROUPBY_DAY; + $this->_groupsort = "@group desc"; + $this->_groupdistinct= ""; + $this->_maxmatches = 1000; + $this->_cutoff = 0; + $this->_retrycount = 0; + $this->_retrydelay = 0; + $this->_anchor = array (); + $this->_indexweights= array (); + $this->_ranker = SPH_RANK_PROXIMITY_BM25; + $this->_maxquerytime= 0; + $this->_fieldweights= array(); + $this->_overrides = array(); + $this->_select = "*"; + + $this->_error = ""; // per-reply fields (for single-query case) + $this->_warning = ""; + $this->_connerror = false; + + $this->_reqs = array (); // requests storage (for multi-query case) + $this->_mbenc = ""; + $this->_arrayresult = false; + $this->_timeout = 0; + } + + function __destruct() + { + if ( $this->_socket !== false ) + fclose ( $this->_socket ); + } + + function GetLastError () + { + return $this->_error; + } + + function GetLastWarning () + { + return $this->_warning; + } + + function IsConnectError() + { + return $this->_connerror; + } + + function SetServer ( $host, $port = 0 ) + { + assert ( is_string($host) ); + if ( $host[0] == '/') + { + $this->_path = 'unix://' . $host; + return; + } + if ( substr ( $host, 0, 7 )=="unix://" ) + { + $this->_path = $host; + return; + } + + assert ( is_int($port) ); + $this->_host = $host; + $this->_port = $port; + $this->_path = ''; + + } + + function SetConnectTimeout ( $timeout ) + { + assert ( is_numeric($timeout) ); + $this->_timeout = $timeout; + } + + + function _Send ( $handle, $data, $length ) + { + if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length ) + { + $this->_error = 'connection unexpectedly closed (timed out?)'; + $this->_connerror = true; + return false; + } + return true; + } + + + function _MBPush () + { + $this->_mbenc = ""; + if ( ini_get ( "mbstring.func_overload" ) & 2 ) + { + $this->_mbenc = mb_internal_encoding(); + mb_internal_encoding ( "latin1" ); + } + } + + function _MBPop () + { + if ( $this->_mbenc ) + mb_internal_encoding ( $this->_mbenc ); + } + + function _Connect () + { + if ( $this->_socket!==false ) + { + if ( !@feof ( $this->_socket ) ) + return $this->_socket; + + $this->_socket = false; + } + + $errno = 0; + $errstr = ""; + $this->_connerror = false; + + if ( $this->_path ) + { + $host = $this->_path; + $port = 0; + } + else + { + $host = $this->_host; + $port = $this->_port; + } + + if ( $this->_timeout<=0 ) + $fp = fsocketopen ( $host, $port, $errno, $errstr ); + else + $fp = fsocketopen ( $host, $port, $errno, $errstr, $this->_timeout ); + + if ( !$fp ) + { + if ( $this->_path ) + $location = $this->_path; + else + $location = "{$this->_host}:{$this->_port}"; + + $errstr = trim ( $errstr ); + $this->_error = "connection to $location failed (errno=$errno, msg=$errstr)"; + $this->_connerror = true; + return false; + } + + if ( !$this->_Send ( $fp, pack ( "N", 1 ), 4 ) ) + { + fclose ( $fp ); + $this->_error = "failed to send client protocol version"; + return false; + } + + list(,$v) = unpack ( "N*", fread ( $fp, 4 ) ); + $v = (int)$v; + if ( $v<1 ) + { + fclose ( $fp ); + $this->_error = "expected searchd protocol version 1+, got version '$v'"; + return false; + } + + return $fp; + } + + function _GetResponse ( $fp, $client_ver ) + { + $response = ""; + $len = 0; + + $header = fread ( $fp, 8 ); + if ( strlen($header)==8 ) + { + list ( $status, $ver, $len ) = array_values ( unpack ( "n2a/Nb", $header ) ); + $left = $len; + while ( $left>0 && !feof($fp) ) + { + $chunk = fread ( $fp, $left ); + if ( $chunk ) + { + $response .= $chunk; + $left -= strlen($chunk); + } + } + } + if ( $this->_socket === false ) + fclose ( $fp ); + + $read = strlen ( $response ); + if ( !$response || $read!=$len ) + { + $this->_error = $len + ? "failed to read searchd response (status=$status, ver=$ver, len=$len, read=$read)" + : "received zero-sized searchd response"; + return false; + } + + if ( $status==SEARCHD_WARNING ) + { + list(,$wlen) = unpack ( "N*", substr ( $response, 0, 4 ) ); + $this->_warning = substr ( $response, 4, $wlen ); + return substr ( $response, 4+$wlen ); + } + if ( $status==SEARCHD_ERROR ) + { + $this->_error = "searchd error: " . substr ( $response, 4 ); + return false; + } + if ( $status==SEARCHD_RETRY ) + { + $this->_error = "temporary searchd error: " . substr ( $response, 4 ); + return false; + } + if ( $status!=SEARCHD_OK ) + { + $this->_error = "unknown status code '$status'"; + return false; + } + + if ( $ver<$client_ver ) + { + $this->_warning = sprintf ( "searchd command v.%d.%d older than client's v.%d.%d, some options might not work", + $ver>>8, $ver&0xff, $client_ver>>8, $client_ver&0xff ); + } + + return $response; + } + + + function SetLimits ( $offset, $limit, $max=0, $cutoff=0 ) + { + assert ( is_int($offset) ); + assert ( is_int($limit) ); + assert ( $offset>=0 ); + assert ( $limit>0 ); + assert ( $max>=0 ); + $this->_offset = $offset; + $this->_limit = $limit; + if ( $max>0 ) + $this->_maxmatches = $max; + if ( $cutoff>0 ) + $this->_cutoff = $cutoff; + } + + function SetMaxQueryTime ( $max ) + { + assert ( is_int($max) ); + assert ( $max>=0 ); + $this->_maxquerytime = $max; + } + + function SetMatchMode ( $mode ) + { + assert ( $mode==SPH_MATCH_ALL + || $mode==SPH_MATCH_ANY + || $mode==SPH_MATCH_PHRASE + || $mode==SPH_MATCH_BOOLEAN + || $mode==SPH_MATCH_EXTENDED + || $mode==SPH_MATCH_FULLSCAN + || $mode==SPH_MATCH_EXTENDED2 ); + $this->_mode = $mode; + } + + function SetRankingMode ( $ranker ) + { + assert ( $ranker==SPH_RANK_PROXIMITY_BM25 + || $ranker==SPH_RANK_BM25 + || $ranker==SPH_RANK_NONE + || $ranker==SPH_RANK_WORDCOUNT + || $ranker==SPH_RANK_PROXIMITY ); + $this->_ranker = $ranker; + } + + function SetSortMode ( $mode, $sortby="" ) + { + assert ( + $mode==SPH_SORT_RELEVANCE || + $mode==SPH_SORT_ATTR_DESC || + $mode==SPH_SORT_ATTR_ASC || + $mode==SPH_SORT_TIME_SEGMENTS || + $mode==SPH_SORT_EXTENDED || + $mode==SPH_SORT_EXPR ); + assert ( is_string($sortby) ); + assert ( $mode==SPH_SORT_RELEVANCE || strlen($sortby)>0 ); + + $this->_sort = $mode; + $this->_sortby = $sortby; + } + + function SetWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $weight ) + assert ( is_int($weight) ); + + $this->_weights = $weights; + } + + function SetFieldWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $name=>$weight ) + { + assert ( is_string($name) ); + assert ( is_int($weight) ); + } + $this->_fieldweights = $weights; + } + + function SetIndexWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $index=>$weight ) + { + assert ( is_string($index) ); + assert ( is_int($weight) ); + } + $this->_indexweights = $weights; + } + + function SetIDRange ( $min, $max ) + { + assert ( is_numeric($min) ); + assert ( is_numeric($max) ); + assert ( $min<=$max ); + $this->_min_id = $min; + $this->_max_id = $max; + } + + function SetFilter ( $attribute, $values, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_array($values) ); + assert ( count($values) ); + + if ( is_array($values) && count($values) ) + { + foreach ( $values as $value ) + assert ( is_numeric($value) ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_VALUES, "attr"=>$attribute, "exclude"=>$exclude, "values"=>$values ); + } + } + + function SetFilterRange ( $attribute, $min, $max, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_numeric($min) ); + assert ( is_numeric($max) ); + assert ( $min<=$max ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_RANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); + } + + function SetFilterFloatRange ( $attribute, $min, $max, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_float($min) ); + assert ( is_float($max) ); + assert ( $min<=$max ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_FLOATRANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); + } + + function SetGeoAnchor ( $attrlat, $attrlong, $lat, $long ) + { + assert ( is_string($attrlat) ); + assert ( is_string($attrlong) ); + assert ( is_float($lat) ); + assert ( is_float($long) ); + + $this->_anchor = array ( "attrlat"=>$attrlat, "attrlong"=>$attrlong, "lat"=>$lat, "long"=>$long ); + } + + function SetGroupBy ( $attribute, $func, $groupsort="@group desc" ) + { + assert ( is_string($attribute) ); + assert ( is_string($groupsort) ); + assert ( $func==SPH_GROUPBY_DAY + || $func==SPH_GROUPBY_WEEK + || $func==SPH_GROUPBY_MONTH + || $func==SPH_GROUPBY_YEAR + || $func==SPH_GROUPBY_ATTR + || $func==SPH_GROUPBY_ATTRPAIR ); + + $this->_groupby = $attribute; + $this->_groupfunc = $func; + $this->_groupsort = $groupsort; + } + + function SetGroupDistinct ( $attribute ) + { + assert ( is_string($attribute) ); + $this->_groupdistinct = $attribute; + } + + function SetRetries ( $count, $delay=0 ) + { + assert ( is_int($count) && $count>=0 ); + assert ( is_int($delay) && $delay>=0 ); + $this->_retrycount = $count; + $this->_retrydelay = $delay; + } + + function SetArrayResult ( $arrayresult ) + { + assert ( is_bool($arrayresult) ); + $this->_arrayresult = $arrayresult; + } + + function SetOverride ( $attrname, $attrtype, $values ) + { + assert ( is_string ( $attrname ) ); + assert ( in_array ( $attrtype, array ( SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT ) ) ); + assert ( is_array ( $values ) ); + + $this->_overrides[$attrname] = array ( "attr"=>$attrname, "type"=>$attrtype, "values"=>$values ); + } + + function SetSelect ( $select ) + { + assert ( is_string ( $select ) ); + $this->_select = $select; + } + + + function ResetFilters () + { + $this->_filters = array(); + $this->_anchor = array(); + } + + function ResetGroupBy () + { + $this->_groupby = ""; + $this->_groupfunc = SPH_GROUPBY_DAY; + $this->_groupsort = "@group desc"; + $this->_groupdistinct= ""; + } + + function ResetOverrides () + { + $this->_overrides = array (); + } + + + function Query ( $query, $index="*", $comment="" ) + { + assert ( empty($this->_reqs) ); + + $this->AddQuery ( $query, $index, $comment ); + + $results = $this->RunQueries (); + + $this->_reqs = array (); // just in case it failed too early + + if ( !is_array($results) ) + return false; // probably network error; error message should be already filled + + $this->_error = $results[0]["error"]; + $this->_warning = $results[0]["warning"]; + if ( $results[0]["status"]==SEARCHD_ERROR ) + return false; + else + return $results[0]; + } + + function _PackFloat ( $f ) + { + $t1 = pack ( "f", $f ); // machine order + list(,$t2) = unpack ( "L*", $t1 ); // int in machine order + return pack ( "N", $t2 ); + } + + function AddQuery ( $query, $index="*", $comment="" ) + { + $this->_MBPush (); + + $req = pack ( "NNNNN", $this->_offset, $this->_limit, $this->_mode, $this->_ranker, $this->_sort ); // mode and limits + $req .= pack ( "N", strlen($this->_sortby) ) . $this->_sortby; + $req .= pack ( "N", strlen($query) ) . $query; // query itself + $req .= pack ( "N", count($this->_weights) ); // weights + foreach ( $this->_weights as $weight ) + $req .= pack ( "N", (int)$weight ); + $req .= pack ( "N", strlen($index) ) . $index; // indexes + $req .= pack ( "N", 1 ); // id64 range marker + $req .= sphPackU64 ( $this->_min_id ) . sphPackU64 ( $this->_max_id ); // id64 range + + $req .= pack ( "N", count($this->_filters) ); + foreach ( $this->_filters as $filter ) + { + $req .= pack ( "N", strlen($filter["attr"]) ) . $filter["attr"]; + $req .= pack ( "N", $filter["type"] ); + switch ( $filter["type"] ) + { + case SPH_FILTER_VALUES: + $req .= pack ( "N", count($filter["values"]) ); + foreach ( $filter["values"] as $value ) + $req .= sphPackI64 ( $value ); + break; + + case SPH_FILTER_RANGE: + $req .= sphPackI64 ( $filter["min"] ) . sphPackI64 ( $filter["max"] ); + break; + + case SPH_FILTER_FLOATRANGE: + $req .= $this->_PackFloat ( $filter["min"] ) . $this->_PackFloat ( $filter["max"] ); + break; + + default: + assert ( 0 && "internal error: unhandled filter type" ); + } + $req .= pack ( "N", $filter["exclude"] ); + } + + $req .= pack ( "NN", $this->_groupfunc, strlen($this->_groupby) ) . $this->_groupby; + $req .= pack ( "N", $this->_maxmatches ); + $req .= pack ( "N", strlen($this->_groupsort) ) . $this->_groupsort; + $req .= pack ( "NNN", $this->_cutoff, $this->_retrycount, $this->_retrydelay ); + $req .= pack ( "N", strlen($this->_groupdistinct) ) . $this->_groupdistinct; + + if ( empty($this->_anchor) ) + { + $req .= pack ( "N", 0 ); + } else + { + $a =& $this->_anchor; + $req .= pack ( "N", 1 ); + $req .= pack ( "N", strlen($a["attrlat"]) ) . $a["attrlat"]; + $req .= pack ( "N", strlen($a["attrlong"]) ) . $a["attrlong"]; + $req .= $this->_PackFloat ( $a["lat"] ) . $this->_PackFloat ( $a["long"] ); + } + + $req .= pack ( "N", count($this->_indexweights) ); + foreach ( $this->_indexweights as $idx=>$weight ) + $req .= pack ( "N", strlen($idx) ) . $idx . pack ( "N", $weight ); + + $req .= pack ( "N", $this->_maxquerytime ); + + $req .= pack ( "N", count($this->_fieldweights) ); + foreach ( $this->_fieldweights as $field=>$weight ) + $req .= pack ( "N", strlen($field) ) . $field . pack ( "N", $weight ); + + $req .= pack ( "N", strlen($comment) ) . $comment; + + $req .= pack ( "N", count($this->_overrides) ); + foreach ( $this->_overrides as $key => $entry ) + { + $req .= pack ( "N", strlen($entry["attr"]) ) . $entry["attr"]; + $req .= pack ( "NN", $entry["type"], count($entry["values"]) ); + foreach ( $entry["values"] as $id=>$val ) + { + assert ( is_numeric($id) ); + assert ( is_numeric($val) ); + + $req .= sphPackU64 ( $id ); + switch ( $entry["type"] ) + { + case SPH_ATTR_FLOAT: $req .= $this->_PackFloat ( $val ); break; + case SPH_ATTR_BIGINT: $req .= sphPackI64 ( $val ); break; + default: $req .= pack ( "N", $val ); break; + } + } + } + + $req .= pack ( "N", strlen($this->_select) ) . $this->_select; + + $this->_MBPop (); + + $this->_reqs[] = $req; + return count($this->_reqs)-1; + } + + function RunQueries () + { + + if ( empty($this->_reqs) ) + { + $this->_error = "no queries defined, issue AddQuery() first"; + return false; + } + + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop (); + return false; + } + + $nreqs = count($this->_reqs); + $req = join ( "", $this->_reqs ); + $len = 4+strlen($req); + $req = pack ( "nnNN", SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, $nreqs ) . $req; // add header + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_SEARCH ) ) ) + { + $this->_MBPop (); + return false; + } + + $this->_reqs = array (); + + return $this->_ParseSearchResponse ( $response, $nreqs ); + } + + function _ParseSearchResponse ( $response, $nreqs ) + { + $p = 0; // current position + $max = strlen($response); // max position for checks, to protect against broken responses + + $results = array (); + for ( $ires=0; $ires<$nreqs && $p<$max; $ires++ ) + { + $results[] = array(); + $result =& $results[$ires]; + + $result["error"] = ""; + $result["warning"] = ""; + + list(,$status) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $result["status"] = $status; + if ( $status!=SEARCHD_OK ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $message = substr ( $response, $p, $len ); $p += $len; + + if ( $status==SEARCHD_WARNING ) + { + $result["warning"] = $message; + } else + { + $result["error"] = $message; + continue; + } + } + + $fields = array (); + $attrs = array (); + + list(,$nfields) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + while ( $nfields-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $fields[] = substr ( $response, $p, $len ); $p += $len; + } + $result["fields"] = $fields; + + list(,$nattrs) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + while ( $nattrs-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attr = substr ( $response, $p, $len ); $p += $len; + list(,$type) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attrs[$attr] = $type; + } + $result["attrs"] = $attrs; + + list(,$count) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + list(,$id64) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + + $idx = -1; + while ( $count-->0 && $p<$max ) + { + $idx++; + + if ( $id64 ) + { + $doc = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8; + list(,$weight) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + } + else + { + list ( $doc, $weight ) = array_values ( unpack ( "N*N*", + substr ( $response, $p, 8 ) ) ); + $p += 8; + $doc = sphFixUint($doc); + } + $weight = sprintf ( "%u", $weight ); + + if ( $this->_arrayresult ) + $result["matches"][$idx] = array ( "id"=>$doc, "weight"=>$weight ); + else + $result["matches"][$doc]["weight"] = $weight; + + $attrvals = array (); + foreach ( $attrs as $attr=>$type ) + { + if ( $type==SPH_ATTR_BIGINT ) + { + $attrvals[$attr] = sphUnpackI64 ( substr ( $response, $p, 8 ) ); $p += 8; + continue; + } + + if ( $type==SPH_ATTR_FLOAT ) + { + list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + list(,$fval) = unpack ( "f*", pack ( "L", $uval ) ); + $attrvals[$attr] = $fval; + continue; + } + + list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + if ( $type & SPH_ATTR_MULTI ) + { + $attrvals[$attr] = array (); + $nvalues = $val; + while ( $nvalues-->0 && $p<$max ) + { + list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attrvals[$attr][] = sphFixUint($val); + } + } else + { + $attrvals[$attr] = sphFixUint($val); + } + } + + if ( $this->_arrayresult ) + $result["matches"][$idx]["attrs"] = $attrvals; + else + $result["matches"][$doc]["attrs"] = $attrvals; + } + + list ( $total, $total_found, $msecs, $words ) = + array_values ( unpack ( "N*N*N*N*", substr ( $response, $p, 16 ) ) ); + $result["total"] = sprintf ( "%u", $total ); + $result["total_found"] = sprintf ( "%u", $total_found ); + $result["time"] = sprintf ( "%.3f", $msecs/1000 ); + $p += 16; + + while ( $words-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $word = substr ( $response, $p, $len ); $p += $len; + list ( $docs, $hits ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; + $result["words"][$word] = array ( + "docs"=>sprintf ( "%u", $docs ), + "hits"=>sprintf ( "%u", $hits ) ); + } + } + + $this->_MBPop (); + return $results; + } + + + function BuildExcerpts ( $docs, $index, $words, $opts=array() ) + { + assert ( is_array($docs) ); + assert ( is_string($index) ); + assert ( is_string($words) ); + assert ( is_array($opts) ); + + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + + if ( !isset($opts["before_match"]) ) $opts["before_match"] = ""; + if ( !isset($opts["after_match"]) ) $opts["after_match"] = ""; + if ( !isset($opts["chunk_separator"]) ) $opts["chunk_separator"] = " ... "; + if ( !isset($opts["limit"]) ) $opts["limit"] = 256; + if ( !isset($opts["around"]) ) $opts["around"] = 5; + if ( !isset($opts["exact_phrase"]) ) $opts["exact_phrase"] = false; + if ( !isset($opts["single_passage"]) ) $opts["single_passage"] = false; + if ( !isset($opts["use_boundaries"]) ) $opts["use_boundaries"] = false; + if ( !isset($opts["weight_order"]) ) $opts["weight_order"] = false; + + + $flags = 1; // remove spaces + if ( $opts["exact_phrase"] ) $flags |= 2; + if ( $opts["single_passage"] ) $flags |= 4; + if ( $opts["use_boundaries"] ) $flags |= 8; + if ( $opts["weight_order"] ) $flags |= 16; + $req = pack ( "NN", 0, $flags ); // mode=0, flags=$flags + $req .= pack ( "N", strlen($index) ) . $index; // req index + $req .= pack ( "N", strlen($words) ) . $words; // req words + + $req .= pack ( "N", strlen($opts["before_match"]) ) . $opts["before_match"]; + $req .= pack ( "N", strlen($opts["after_match"]) ) . $opts["after_match"]; + $req .= pack ( "N", strlen($opts["chunk_separator"]) ) . $opts["chunk_separator"]; + $req .= pack ( "N", (int)$opts["limit"] ); + $req .= pack ( "N", (int)$opts["around"] ); + + $req .= pack ( "N", count($docs) ); + foreach ( $docs as $doc ) + { + assert ( is_string($doc) ); + $req .= pack ( "N", strlen($doc) ) . $doc; + } + + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_EXCERPT, VER_COMMAND_EXCERPT, $len ) . $req; // add header + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_EXCERPT ) ) ) + { + $this->_MBPop (); + return false; + } + + + $pos = 0; + $res = array (); + $rlen = strlen($response); + for ( $i=0; $i $rlen ) + { + $this->_error = "incomplete reply"; + $this->_MBPop (); + return false; + } + $res[] = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + } + + $this->_MBPop (); + return $res; + } + + + + function BuildKeywords ( $query, $index, $hits ) + { + assert ( is_string($query) ); + assert ( is_string($index) ); + assert ( is_bool($hits) ); + + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + + $req = pack ( "N", strlen($query) ) . $query; // req query + $req .= pack ( "N", strlen($index) ) . $index; // req index + $req .= pack ( "N", (int)$hits ); + + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_KEYWORDS, VER_COMMAND_KEYWORDS, $len ) . $req; // add header + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_KEYWORDS ) ) ) + { + $this->_MBPop (); + return false; + } + + + $pos = 0; + $res = array (); + $rlen = strlen($response); + list(,$nwords) = unpack ( "N*", substr ( $response, $pos, 4 ) ); + $pos += 4; + for ( $i=0; $i<$nwords; $i++ ) + { + list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; + $tokenized = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + + list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; + $normalized = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + + $res[] = array ( "tokenized"=>$tokenized, "normalized"=>$normalized ); + + if ( $hits ) + { + list($ndocs,$nhits) = array_values ( unpack ( "N*N*", substr ( $response, $pos, 8 ) ) ); + $pos += 8; + $res [$i]["docs"] = $ndocs; + $res [$i]["hits"] = $nhits; + } + + if ( $pos > $rlen ) + { + $this->_error = "incomplete reply"; + $this->_MBPop (); + return false; + } + } + + $this->_MBPop (); + return $res; + } + + function EscapeString ( $string ) + { + $from = array ( '\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=' ); + $to = array ( '\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=' ); + + return str_replace ( $from, $to, $string ); + } + + + function UpdateAttributes ( $index, $attrs, $values, $mva=false ) + { + assert ( is_string($index) ); + assert ( is_bool($mva) ); + + assert ( is_array($attrs) ); + foreach ( $attrs as $attr ) + assert ( is_string($attr) ); + + assert ( is_array($values) ); + foreach ( $values as $id=>$entry ) + { + assert ( is_numeric($id) ); + assert ( is_array($entry) ); + assert ( count($entry)==count($attrs) ); + foreach ( $entry as $v ) + { + if ( $mva ) + { + assert ( is_array($v) ); + foreach ( $v as $vv ) + assert ( is_int($vv) ); + } else + assert ( is_int($v) ); + } + } + + $req = pack ( "N", strlen($index) ) . $index; + + $req .= pack ( "N", count($attrs) ); + foreach ( $attrs as $attr ) + { + $req .= pack ( "N", strlen($attr) ) . $attr; + $req .= pack ( "N", $mva ? 1 : 0 ); + } + + $req .= pack ( "N", count($values) ); + foreach ( $values as $id=>$entry ) + { + $req .= sphPackU64 ( $id ); + foreach ( $entry as $v ) + { + $req .= pack ( "N", $mva ? count($v) : $v ); + if ( $mva ) + foreach ( $v as $vv ) + $req .= pack ( "N", $vv ); + } + } + + if (!( $fp = $this->_Connect() )) + return -1; + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_UPDATE, VER_COMMAND_UPDATE, $len ) . $req; // add header + if ( !$this->_Send ( $fp, $req, $len+8 ) ) + return -1; + + if (!( $response = $this->_GetResponse ( $fp, VER_COMMAND_UPDATE ) )) + return -1; + + list(,$updated) = unpack ( "N*", substr ( $response, 0, 4 ) ); + return $updated; + } + + + function Open() + { + if ( $this->_socket !== false ) + { + $this->_error = 'already connected'; + return false; + } + if ( !$fp = $this->_Connect() ) + return false; + + $req = pack ( "nnNN", SEARCHD_COMMAND_PERSIST, 0, 4, 1 ); + if ( !$this->_Send ( $fp, $req, 12 ) ) + return false; + + $this->_socket = $fp; + return true; + } + + function Close() + { + if ( $this->_socket === false ) + { + $this->_error = 'not connected'; + return false; + } + + fclose ( $this->_socket ); + $this->_socket = false; + + return true; + } + + + function Status () + { + $this->_MBPush (); + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + $req = pack ( "nnNN", SEARCHD_COMMAND_STATUS, VER_COMMAND_STATUS, 4, 1 ); // len=4, body=1 + if ( !( $this->_Send ( $fp, $req, 12 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_STATUS ) ) ) + { + $this->_MBPop (); + return false; + } + + $res = substr ( $response, 4 ); // just ignore length, error handling, etc + $p = 0; + list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; + + $res = array(); + for ( $i=0; $i<$rows; $i++ ) + for ( $j=0; $j<$cols; $j++ ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $res[$i][] = substr ( $response, $p, $len ); $p += $len; + } + + $this->_MBPop (); + return $res; + } +} \ No newline at end of file diff --git a/source/class/class_tag.php b/source/class/class_tag.php new file mode 100644 index 0000000..580eb19 --- /dev/null +++ b/source/class/class_tag.php @@ -0,0 +1,226 @@ +get_bytagname($tagname, $idtype); + if($result['tagid']) { + if($result['status'] == $status) { + $tagid = $result['tagid']; + } + } else { + $tagid = C::t('common_tag')->insert_tag($tagname,$status); + } + if($tagid) { + if($itemid) { + C::t('common_tagitem')->replace($tagid,$itemid,$idtype); + } + $tagcount++; + if(!$returnarray) { + $return .= $tagid.','.$tagname."\t"; + } else { + $return[$tagid] = $tagname; + } + + } + if($tagcount > 4) { + unset($tagarray); + break; + } + } + } + return $return; + } + + public function update_field($tags, $itemid, $idtype = 'tid', $typeinfo = array()) { + + if($idtype == 'tid') { + $tagstr = C::t('forum_post')->fetch_threadpost_by_tid_invisible($itemid); + $tagstr = $tagstr['tags']; + + } elseif($idtype == 'blogid') { + $tagstr = C::t('home_blogfield')->fetch_tag_by_blogid($itemid); + + } else { + return ''; + } + + $tagarray = $tagidarray = $tagarraynew = array(); + $results = C::t('common_tagitem')->select(0, $itemid, $idtype); + foreach($results as $result) { + $tagidarray[] = $result['tagid']; + } + if($tagidarray) { + $results = C::t('common_tag')->get_byids($tagidarray); + foreach($results as $result) { + $tagarray[$result['tagid']] = $result['tagname']; + } + } + $tags = $this->add_tag($tags, $itemid, $idtype, 1); + foreach($tags as $tagid => $tagname) { + $tagarraynew[] = $tagname; + if(empty($tagarray[$tagid])) { + $tagstr = $tagstr.$tagid.','.$tagname."\t"; + } + } + foreach($tagarray as $tagid => $tagname) { + if(!in_array($tagname, $tagarraynew)) { + C::t('common_tagitem')->delete_tagitem($tagid, $itemid, $idtype); + $tagstr = str_replace("$tagid,$tagname\t", '', $tagstr); + } + } + return $tagstr; + } + + public function copy_tag($oldid, $newid, $idtype = 'tid') { + $results = C::t('common_tagitem')->select(0, $oldid, $idtype); + foreach($results as $result) { + C::t('common_tagitem')->insert(array( + 'tagid' => $result['tagid'], + 'itemid' => $newid, + 'idtype' => $idtype + )); + } + } + + public function merge_tag($tagidarray, $newtag, $idtype = '') { + $newtag = str_replace(',', '', $newtag); + $newtag = trim($newtag); + if(!$newtag) { + return 'tag_empty'; + } + if(preg_match('/^([\x7f-\xff_-]|\w|\s){2,20}$/', $newtag)) { + $tidarray = $blogidarray = array(); + $newtaginfo = $this->add_tag($newtag, 0, $idtype, 1); + foreach($newtaginfo as $tagid => $tagname) { + $newid = $tagid; + } + $tagidarray = array_diff((array)$tagidarray, (array)$newid); + if($idtype !== 'uid') { + $tagnames = C::t('common_tag')->get_byids($tagidarray); + $results = C::t('common_tagitem')->select($tagidarray); + foreach($results as $result) { + $result['tagname'] = addslashes($tagnames[$result['tagid']]['tagname']); + if($result['idtype'] == 'tid') { + $itemid = $result['itemid']; + if(!isset($tidarray[$itemid])) { + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($itemid); + $tidarray[$itemid] = $post['tags']; + } + $tidarray[$itemid] = str_replace("{$result['tagid']},{$result['tagname']}\t", '', $tidarray[$itemid]); + } elseif($result['idtype'] == 'blogid') { + $itemid = $result['itemid']; + if(!isset($blogidarray[$itemid])) { + $blogfield = C::t('home_blogfield')->fetch($itemid); + $blogidarray[$itemid] = $blogfield['tag']; + } + $blogidarray[$itemid] = str_replace("{$result['tagid']},{$result['tagname']}\t", '', $blogidarray[$itemid]); + } + } + } + $checkunique = array(); + $checktagids = $tagidarray; + $checktagids[] = $newid; + $results = C::t('common_tagitem')->select($checktagids); + foreach($results as $row) { + if($checkunique[$row['itemid'].'_'.$row['idtype']] == 'deleted' || empty($checkunique[$row['itemid'].'_'.$row['idtype']])) { + if(empty($checkunique[$row['itemid'].'_'.$row['idtype']])) { + $checkunique[$row['itemid'].'_'.$row['idtype']] = 1; + } + } else { + C::t('common_tagitem')->unique($row['tagid'], $row['itemid'], $row['idtype']); + $checkunique[$row['itemid'].'_'.$row['idtype']] = 'deleted'; + } + } + C::t('common_tagitem')->merge_by_tagids($newid, $tagidarray); + C::t('common_tag')->delete_byids($tagidarray); + + if($tidarray) { + foreach($tidarray as $key => $var) { + C::t('forum_post')->update_by_tid('tid:'.$key, $key, array('tags' => $var), false, false, 1); + C::t('forum_post')->concat_threadtags_by_tid($key, "$newid,$newtag\t"); + } + } + if($blogidarray) { + foreach($blogidarray as $key => $var) { + C::t('home_blogfield')->update($key, array('tag' => $var.$newid.','.$newtag.'\t')); + } + } + } else { + return 'tag_length'; + } + return 'succeed'; + } + + public function delete_tag($tagidarray, $idtype = '') { + $tidarray = $blogidarray = array(); + if(!is_array($tagidarray)) { + return false; + } + if($idtype != 'uid') { + $tagnames = C::t('common_tag')->get_byids($tagidarray); + $items = C::t('common_tagitem')->select($tagidarray); + foreach($items as $result) { + $result['tagname'] = addslashes($tagnames[$result['tagid']]['tagname']); + if($result['idtype'] == 'tid') { + $itemid = $result['itemid']; + if(!isset($tidarray[$itemid])) { + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($itemid); + $tidarray[$itemid] = $post['tags']; + } + $tidarray[$itemid] = str_replace("{$result['tagid']},{$result['tagname']}\t", '', $tidarray[$itemid]); + } elseif($result['idtype'] == 'blogid') { + $itemid = $result['itemid']; + if(!isset($blogidarray[$itemid])) { + $blogfield = C::t('home_blogfield')->fetch($itemid); + $blogidarray[$itemid] = $blogfield['tag']; + } + $blogidarray[$itemid] = str_replace("{$result['tagid']},{$result['tagname']}\t", '', $blogidarray[$itemid]); + } + } + } + + if($tidarray) { + foreach($tidarray as $key => $var) { + C::t('forum_post')->update_by_tid('tid:'.$key, $key, array('tags' => $var), false, false, 1); + } + } + if($blogidarray) { + foreach($blogidarray as $key => $var) { + C::t('home_blogfield')->update($key, array('tag' => $var)); + } + } + C::t('common_tag')->delete_byids($tagidarray); + C::t('common_tagitem')->delete_tagitem($tagidarray); + return true; + } + +} +?> \ No newline at end of file diff --git a/source/class/class_task.php b/source/class/class_task.php new file mode 100644 index 0000000..02c6442 --- /dev/null +++ b/source/class/class_task.php @@ -0,0 +1,705 @@ +fetch_all_by_status($_G['uid'], $item) as $task) { + if($item == 'new' || $item == 'canapply') { + list($task['allowapply'], $task['t']) = $this->checknextperiod($task); + if($task['allowapply'] < 0) { + continue; + } + $task['noperm'] = $task['applyperm'] && $task['applyperm'] != 'all' && !(($task['applyperm'] == 'member' && in_array($_G['adminid'], array(0, -1))) || ($task['applyperm'] == 'admin' && $_G['adminid'] > '0') || forumperm($task['applyperm'])); + $task['appliesfull'] = $task['tasklimits'] && $task['achievers'] >= $task['tasklimits']; + if($item == 'canapply' && ($task['noperm'] || $task['appliesfull'])) { + continue; + } + } + $num++; + if($task['reward'] == 'magic') { + $magicids[] = $task['prize']; + } elseif($task['reward'] == 'medal') { + $medalids[] = $task['prize']; + } elseif($task['reward'] == 'invite') { + $invitenum = $task['prize']; + } elseif($task['reward'] == 'group') { + $groupids[] = $task['prize']; + } + if($task['available'] == '2' && ($task['starttime'] > TIMESTAMP || ($task['endtime'] && $task['endtime'] <= TIMESTAMP))) { + $endtaskids[] = $task['taskid']; + } + $csc = explode("\t", $task['csc']); + $task['csc'] = floatval($csc[0]); + $task['lastupdate'] = intval($csc[1]); + if(!$updated && $item == 'doing' && $task['csc'] < 100) { + $updated = TRUE; + $escript = explode(':', $task['scriptname']); + if(count($escript) > 1) { + include_once DISCUZ_ROOT.'./source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.php'; + $taskclassname = 'task_'.$escript[1]; + } else { + require_once libfile('task/'.$task['scriptname'], 'class'); + $taskclassname = 'task_'.$task['scriptname']; + } + $taskclass = new $taskclassname; + $task['applytime'] = $task['dateline']; + if(method_exists($taskclass, 'csc')) { + $result = $taskclass->csc($task); + } else { + showmessage('task_not_found', '', array('taskclassname' => $taskclassname)); + } + if($result === TRUE) { + $task['csc'] = '100'; + C::t('common_mytask')->update_mytask($_G['uid'], $task['taskid'], array('csc' => $task['csc'])); + } elseif($result === FALSE) { + C::t('common_mytask')->update_mytask($_G['uid'], $task['taskid'], array('status' => -1)); + } else { + $task['csc'] = floatval($result['csc']); + C::t('common_mytask')->update_mytask($_G['uid'], $task['taskid'], array('csc' => $task['csc']."\t".$_G['timestamp'])); + } + } + if(in_array($item, array('done', 'failed')) && $task['period']) { + list($task['allowapply'], $task['t']) = $this->checknextperiod($task); + $task['allowapply'] = $task['allowapply'] > 0 ? 1 : 0; + } + $task['icon'] = $task['icon'] ? $task['icon'] : 'task.gif'; + if(!preg_match('/^https?:\/\//is', $task['icon'])) { + $escript = explode(':', $task['scriptname']); + if(count($escript) > 1 && file_exists(DISCUZ_ROOT.'./source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.gif')) { + $task['icon'] = 'source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.gif'; + } else { + $task['icon'] = 'static/image/task/'.$task['icon']; + } + } + $task['dateline'] = $task['dateline'] ? dgmdate($task['dateline'], 'u') : ''; + $tasklist[] = $task; + } + + if($magicids) { + foreach(C::t('common_magic')->fetch_all($magicids) as $magic) { + $this->listdata[$magic['magicid']] = $magic['name']; + } + } + + if($medalids) { + foreach(C::t('forum_medal')->fetch_all($medalids) as $medal) { + $this->listdata[$medal['medalid']] = $medal['name']; + } + } + + if($groupids) { + foreach(C::t('common_usergroup')->fetch_all_usergroup($groupids) as $group) { + $this->listdata[$group['groupid']] = $group['grouptitle']; + } + } + + if($invitenum) { + $this->listdata[$invitenum] = $_G['lang']['invite_code']; + } + + if($endtaskids) { + } + + return $tasklist; + } + function view($id) { + global $_G; + + $this->task = C::t('common_task')->fetch_by_uid($_G['uid'], $id); + if(!$this->task) { + showmessage('task_nonexistence'); + } + switch($this->task['reward']) { + case 'magic': + $this->task['rewardtext'] = C::t('common_magic')->fetch($this->task['prize']); + $this->task['rewardtext'] = $this->task['rewardtext']['name']; + break; + case 'medal': + $this->task['rewardtext'] = C::t('forum_medal')->fetch($this->task['prize']); + $this->task['rewardtext'] = $this->task['rewardtext']['name']; + break; + case 'group': + $group = C::t('common_usergroup')->fetch($this->task['prize']); + $this->task['rewardtext'] = $group['grouptitle']; + break; + } + $this->task['icon'] = $this->task['icon'] ? $this->task['icon'] : 'task.gif'; + if(!preg_match('/^https?:\/\//is', $this->task['icon'])) { + $escript = explode(':', $this->task['scriptname']); + if(count($escript) > 1 && file_exists(DISCUZ_ROOT.'./source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.gif')) { + $this->task['icon'] = 'source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.gif'; + } else { + $this->task['icon'] = 'static/image/task/'.$this->task['icon']; + } + } + $this->task['endtime'] = $this->task['endtime'] ? dgmdate($this->task['endtime'], 'u') : ''; + $this->task['description'] = nl2br($this->task['description']); + + $this->taskvars = array(); + foreach(C::t('common_taskvar')->fetch_all_by_taskid($id) as $taskvar) { + if(!$taskvar['variable'] || $taskvar['value']) { + if(!$taskvar['variable']) { + $taskvar['value'] = $taskvar['description']; + } + if($taskvar['sort'] == 'apply') { + $this->taskvars['apply'][] = $taskvar; + } elseif($taskvar['sort'] == 'complete') { + $this->taskvars['complete'][$taskvar['variable']] = $taskvar; + } elseif($taskvar['sort'] == 'setting') { + $this->taskvars['setting'][$taskvar['variable']] = $taskvar; + } + } + } + + $this->task['grouprequired'] = $comma = ''; + $this->task['applyperm'] = $this->task['applyperm'] == 'all' ? '' : $this->task['applyperm']; + if(!in_array($this->task['applyperm'], array('', 'member', 'admin'))) { + $query = C::t('common_usergroup')->fetch_all_usergroup(explode(',', str_replace("\t", ',', $this->task['applyperm']))); + foreach($query as $group) { + $this->task['grouprequired'] .= $comma.$group['grouptitle']; + $comma = ', '; + } + } + + if($this->task['relatedtaskid']) { + $task = C::t('common_task')->fetch($this->task['relatedtaskid']); + $_G['taskrequired'] = $task['name']; + } + + if($this->task['exclusivetaskid']) { + $task = C::t('common_task')->fetch($this->task['exclusivetaskid']); + $_G['taskexclusive'] = $task['name']; + } + + $escript = explode(':', $this->task['scriptname']); + if(count($escript) > 1) { + include_once DISCUZ_ROOT.'./source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.php'; + $taskclassname = 'task_'.$escript[1]; + } else { + require_once libfile('task/'.$this->task['scriptname'], 'class'); + $taskclassname = 'task_'.$this->task['scriptname']; + } + $taskclass = new $taskclassname; + if($this->task['status'] == '-1') { + if($this->task['period']) { + list($allowapply, $this->task['t']) = $this->checknextperiod($this->task); + } else { + $allowapply = -4; + } + } elseif($this->task['status'] == '0') { + $allowapply = -1; + $csc = explode("\t", $this->task['csc']); + $this->task['csc'] = floatval($csc[0]); + $this->task['lastupdate'] = intval($csc[1]); + if($this->task['csc'] < 100) { + if(method_exists($taskclass, 'csc')) { + $result = $taskclass->csc($this->task); + } + if($result === TRUE) { + $this->task['csc'] = '100'; + C::t('common_mytask')->update_mytask($_G['uid'], $id, array('csc' => $this->task['csc'])); + } elseif($result === FALSE) { + C::t('common_mytask')->update_mytask($_G['uid'], $id, array('status' => -1)); + dheader("Location: home.php?mod=task&do=view&id=$id"); + } else { + $this->task['csc'] = floatval($result['csc']); + C::t('common_mytask')->update_mytask($_G['uid'], $id, array('csc' => $this->task['csc']."\t".$_G['timestamp'])); + } + } + } elseif($this->task['status'] == '1') { + if($this->task['period']) { + list($allowapply, $this->task['t']) = $this->checknextperiod($this->task); + } else { + $allowapply = -5; + } + } else { + $allowapply = 1; + } + if(method_exists($taskclass, 'view')) { + $this->task['viewmessage'] = $taskclass->view($this->task, $this->taskvars); + } else { + $this->task['viewmessage'] = ''; + } + + if($allowapply > 0) { + if($this->task['applyperm'] && $this->task['applyperm'] != 'all' && !(($this->task['applyperm'] == 'member' && in_array($_G['adminid'], array(0, -1))) || ($this->task['applyperm'] == 'admin' && $_G['adminid'] > '0') || preg_match("/(^|\t)(".$_G['groupid'].")(\t|$)/", $this->task['applyperm']))) { + $allowapply = -2; + } elseif($this->task['tasklimits'] && $this->task['achievers'] >= $this->task['tasklimits']) { + $allowapply = -3; + } + } + + $this->task['dateline'] = dgmdate($this->task['dateline'], 'u'); + return $allowapply; + + } + + function checknextperiod($task) { + global $_G; + + $allowapply = false; + $nextapplytime = ''; + if($task['periodtype'] == 0) { + $allowapply = TIMESTAMP - $task['dateline'] >= $task['period'] * 3600 ? 2 : -6; + $nextapplytime = tasktimeformat($task['period'] * 3600 - TIMESTAMP + $task['dateline']); + } elseif($task['periodtype'] == 1) { + $todaytimestamp = TIMESTAMP - (TIMESTAMP + $_G['setting']['timeoffset'] * 3600) % 86400; + $allowapply = $task['dateline'] < $todaytimestamp - ($task['period'] - 1) * 86400 ? 2 : -6; + $nextapplytime = ($task['dateline'] - ($task['dateline'] + $_G['setting']['timeoffset'] * 3600) % 86400) + $task['period'] * 86400; + $nextapplytime = dgmdate($nextapplytime); + } elseif($task['periodtype'] == 2 && $task['period'] > 0 && $task['period'] <= 7) { + $task['period'] = $task['period'] != 7 ? $task['period'] : 0; + $todayweek = dgmdate(TIMESTAMP, 'w'); + $weektimestamp = TIMESTAMP - ($todayweek - $task['period']) * 86400; + $weekstart = $weektimestamp - ($weektimestamp + $_G['setting']['timeoffset'] * 3600) % 86400; + $weekfirstday = $weekstart - $task['period'] * 86400; + if($task['dateline'] && ($task['dateline'] > $weekstart || $task['dateline'] > $weekfirstday)) { + $allowapply = -6; + if($task['dateline'] > $weekfirstday) { + $weekstart += 604800; + } + $nextapplytime = dgmdate($weekstart); + } else { + $allowapply = 2; + } + } elseif($task['periodtype'] == 3 && $task['period'] > 0) { + list($year, $month) = explode('/', dgmdate(TIMESTAMP, 'Y/n')); + $monthstart = mktime(0, 0, 0, $month, $task['period'], $year); + $monthfirstday = mktime(0, 0, 0, $month, 1, $year); + if($task['dateline'] && ($task['dateline'] > $monthstart || $task['dateline'] > $monthfirstday)) { + $allowapply = -6; + if($task['dateline'] > $monthfirstday) { + $monthstart = mktime(0, 0, 0, $month + 1, $task['period'], $year); + } + $nextapplytime = dgmdate($monthstart); + } else { + $allowapply = 2; + } + } + return array($allowapply, $nextapplytime); + } + + function apply($id) { + global $_G; + + $this->task = C::t('common_task')->fetch($id); + if($this->task['available'] != 2) { + showmessage('task_nonexistence'); + } elseif(($this->task['starttime'] && $this->task['starttime'] > TIMESTAMP) || ($this->task['endtime'] && $this->task['endtime'] <= TIMESTAMP)) { + showmessage('task_offline'); + } elseif($this->task['tasklimits'] && $this->task['achievers'] >= $this->task['tasklimits']) { + showmessage('task_full'); + } + + if($this->task['relatedtaskid'] && !C::t('common_mytask')->count_mytask($_G['uid'], $this->task['relatedtaskid'], 1)) { + return -1; + } elseif($this->task['exclusivetaskid'] && C::t('common_mytask')->count_mytask($_G['uid'], $this->task['exclusivetaskid'])) { + return -5; + } elseif($this->task['applyperm'] && $this->task['applyperm'] != 'all' && !(($this->task['applyperm'] == 'member' && in_array($_G['adminid'], array(0, -1))) || ($this->task['applyperm'] == 'admin' && $_G['adminid'] > '0') || preg_match("/(^|\t)(".$_G['groupid'].")(\t|$)/", $this->task['applyperm']))) { + return -2; + } elseif(!$this->task['period'] && C::t('common_mytask')->count_mytask($_G['uid'], $id)) { + return -3; + } elseif($this->task['period']) { + $mytask = C::t('common_mytask')->fetch_mytask($_G['uid'], $id); + $task = C::t('common_task')->fetch($id); + $mytask['period'] = $task['period']; + $mytask['periodtype'] = $task['periodtype']; + unset($task); + list($allowapply) = $this->checknextperiod($mytask); + if($allowapply < 0) { + return -4; + } + } + + $escript = explode(':', $this->task['scriptname']); + if(count($escript) > 1) { + include_once DISCUZ_ROOT.'./source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.php'; + $taskclassname = 'task_'.$escript[1]; + } else { + require_once libfile('task/'.$this->task['scriptname'], 'class'); + $taskclassname = 'task_'.$this->task['scriptname']; + } + $taskclass = new $taskclassname; + if(method_exists($taskclass, 'condition')) { + $taskclass->condition(); + } + C::t('common_mytask')->insert(array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'taskid' => $this->task['taskid'], + 'csc' => '0\t'.$_G['timestamp'], + 'dateline' => $_G['timestamp'] + ), false, true); + C::t('common_task')->update_applicants($this->task['taskid'], 1); + if(method_exists($taskclass, 'preprocess')) { + $taskclass->preprocess($this->task); + } + return true; + } + + function draw($id) { + global $_G; + + if(!($this->task = C::t('common_task')->fetch_by_uid($_G['uid'], $id))) { + showmessage('task_nonexistence'); + } elseif(!isset($this->task['status']) || $this->task['status'] != 0) { + showmessage('task_not_underway'); + } elseif($this->task['tasklimits'] && $this->task['achievers'] >= $this->task['tasklimits']) { + return -1; + } elseif($this->task['exclusivetaskid'] && C::t('common_mytask')->count_mytask($_G['uid'], $this->task['exclusivetaskid'])) { + return -4; + } + + $escript = explode(':', $this->task['scriptname']); + if(count($escript) > 1) { + include_once DISCUZ_ROOT.'./source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.php'; + $taskclassname = 'task_'.$escript[1]; + } else { + require_once libfile('task/'.$this->task['scriptname'], 'class'); + $taskclassname = 'task_'.$this->task['scriptname']; + } + $taskclass = new $taskclassname; + if(method_exists($taskclass, 'csc')) { + $result = $taskclass->csc($this->task); + } else { + showmessage('task_not_found', '', array('taskclassname' => $taskclassname)); + } + + if($result === TRUE) { + + if($this->task['reward'] && C::t('common_mytask')->update_to_success($_G['uid'], $id, $_G['timestamp']) && C::t('common_task')->update_achievers($id, 1)) { + $rewards = $this->reward(); + $notification = $this->task['reward']; + if($this->task['reward'] == 'magic') { + $rewardtext = C::t('common_magic')->fetch($this->task['prize']); + $rewardtext = $rewardtext['name']; + } elseif($this->task['reward'] == 'medal') { + $rewardtext = C::t('forum_medal')->fetch($this->task['prize']); + $rewardtext = $rewardtext['name']; + if(!$this->task['bonus']) { + $notification = 'medal_forever'; + } + } elseif($this->task['reward'] == 'group') { + $group = C::t('common_usergroup')->fetch($this->task['prize']); + $rewardtext = $group['grouptitle']; + } elseif($this->task['reward'] == 'invite') { + $rewardtext = $this->task['prize']; + } + notification_add($_G['uid'], 'task', 'task_reward_'.$notification, array( + 'taskid' => $this->task['taskid'], + 'name' => $this->task['name'], + 'creditbonus' => $_G['setting']['extcredits'][$this->task['prize']]['title'].' '.$this->task['bonus'].' '.$_G['setting']['extcredits'][$this->task['prize']]['unit'], + 'rewardtext' => $rewardtext, + 'bonus' => $this->task['bonus'], + 'prize' => $this->task['prize'], + )); + } + + if(method_exists($taskclass, 'sufprocess')) { + $taskclass->sufprocess($this->task); + } + + if($_G['inajax']) { + $this->message('100', $this->task['reward'] ? 'task_reward_'.$this->task['reward'] : 'task_completed', array( + 'creditbonus' => $_G['setting']['extcredits'][$this->task['prize']]['title'].' '.$this->task['bonus'].' '.$_G['setting']['extcredits'][$this->task['prize']]['unit'], + 'rewardtext' => $rewardtext, + 'bonus' => $this->task['bonus'], + 'prize' => $this->task['prize'] + ) + ); + } else { + return true; + } + + } elseif($result === FALSE) { + + C::t('common_mytask')->update_mytask($_G['uid'], $id, array('status' => -1)); + if($_G['inajax']) { + $this->message('-1', 'task_failed'); + } else { + return -2; + } + + } else { + + $result['t'] = $this->timeformat($result['remaintime']); + $this->messagevalues['values'] = array('csc' => $result['csc'], 't' => $result['t']); + if($result['csc']) { + C::t('common_mytask')->update_mytask($_G['uid'], $id, array('csc' => $result['csc']."\t".$_G['timestamp'])); + $this->messagevalues['msg'] = $result['t'] ? 'task_doing_rt' : 'task_doing'; + } else { + $this->messagevalues['msg'] = $result['t'] ? 'task_waiting_rt' : 'task_waiting'; + } + if($_G['inajax']) { + $this->message($result['csc'], $this->messagevalues['msg'], $this->messagevalues['values']); + } else { + return -3; + } + + } + } + + function giveup($id) { + global $_G; + + if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action'); + } elseif(!($this->task = C::t('common_task')->fetch_by_uid($_G['uid'], $id))) { + showmessage('task_nonexistence'); + } elseif($this->task['status'] != '0') { + showmessage('task_not_underway'); + } + + C::t('common_mytask')->delete_mytask($_G['uid'], $id); + C::t('common_task')->update_applicants($id, -1); + } + + function parter($id) { + $parterlist = array(); + foreach(C::t('common_mytask')->fetch_all_by_taskid($id, 8) as $parter) { + $parter['avatar'] = avatar($parter['uid'], 'small'); + $csc = explode("\t", $parter['csc']); + $parter['csc'] = floatval($csc[0]); + $parterlist[] = $parter; + } + return $parterlist; + } + + function delete($id) { + global $_G; + $mytask = C::t('common_mytask')->fetch_mytask($_G['uid'], $id); + $this->task = C::t('common_task')->fetch($id); + if($this->task['available'] != 2 || empty($mytask) || $mytask['status'] == 1) { + showmessage('task_nonexistence'); + } + + $escript = explode(':', $this->task['scriptname']); + if(count($escript) > 1) { + include_once DISCUZ_ROOT.'./source/plugin/'.$escript[0].'/task/task_'.$escript[1].'.php'; + $taskclassname = 'task_'.$escript[1]; + } else { + require_once libfile('task/'.$this->task['scriptname'], 'class'); + $taskclassname = 'task_'.$this->task['scriptname']; + } + $taskclass = new $taskclassname; + if(method_exists($taskclass, 'delete')) { + $taskclass->delete($this->task); + } + + C::t('common_mytask')->delete_mytask($_G['uid'], $id); + C::t('common_task')->update_applicants($id, -1); + return true; + } + + function update_available($update = 0) { + global $_G; + $updatetasknext = 0; + loadcache('tasknext'); + $tasknext = getglobal('cache/tasknext'); + if(!is_array($tasknext)) { + $tasknext = array(); + } + if(!isset($tasknext['starttime']) || $tasknext['starttime'] > TIMESTAMP + 86400) { + $tasknext['starttime'] = 0; + } + if(!isset($tasknext['endtime']) || $tasknext['endtime'] > TIMESTAMP + 86400) { + $tasknext['endtime'] = 0; + } + if(TIMESTAMP >= $tasknext['starttime'] || TIMESTAMP >= $tasknext['endtime'] || $update) { + $processname = 'update_task_available'; + if($update || !discuz_process::islocked($processname, 600)) { + if(TIMESTAMP >= $tasknext['starttime'] || $update) { + C::t('common_task')->update_available(2); + $starttime = C::t('common_task')->fetch_next_starttime(); + $tasknext['starttime'] = $starttime ? min($starttime, TIMESTAMP + 86400) : TIMESTAMP + 86400; + $updatetasknext = 1; + } + + if(TIMESTAMP >= $tasknext['endtime'] || $update) { + C::t('common_task')->update_available(1); + $endtime = C::t('common_task')->fetch_next_endtime(); + $tasknext['endtime'] = $endtime ? min($endtime, TIMESTAMP + 86400) : TIMESTAMP + 86400; + $updatetasknext = 1; + } + + if($updatetasknext) { + savecache('tasknext', $tasknext); + } + discuz_process::unlock($processname); + } + } + return true; + } + + function reward() { + switch($this->task['reward']) { + case 'credit': return $this->reward_credit($this->task['prize'], $this->task['bonus']); break; + case 'magic': return $this->reward_magic($this->task['prize'], $this->task['bonus']); break; + case 'medal': return $this->reward_medal($this->task['prize'], $this->task['bonus']); break; + case 'invite': return $this->reward_invite($this->task['prize'], $this->task['bonus']); break; + case 'group': return $this->reward_group($this->task['prize'], $this->task['bonus']); break; + } + } + + function reward_credit($extcreditid, $credits) { + global $_G; + + $creditsarray[$extcreditid] = $credits; + updatemembercount($_G['uid'], $creditsarray, 1, 'TRC', $this->task['taskid']); + } + + function reward_magic($magicid, $num) { + global $_G; + + if(C::t('common_member_magic')->count_magic($_G['uid'], $magicid)) { + C::t('common_member_magic')->increase($_G['uid'], $magicid, array('num' => $num), false, true); + } else { + C::t('common_member_magic')->insert(array( + 'uid' => $_G['uid'], + 'magicid' => $magicid, + 'num' => $num + )); + } + } + + function reward_medal($medalid, $day) { + global $_G; + + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $medals = $memberfieldforum['medals']; + unset($memberfieldforum); + if(empty($medals) || !in_array($medalid, explode("\t", $medals))) { + $medalsnew = $medals ? $medals."\t".$medalid : $medalid; + C::t('common_member_field_forum')->update($_G['uid'], array('medals' => $medalsnew), 'UNBUFFERED'); + C::t('common_member_medal')->insert(array('uid' => $_G['uid'], 'medalid' => $medalid), 0, 1); + $data = array( + 'uid' => $_G['uid'], + 'medalid' => $medalid, + 'type' => 0, + 'dateline' => TIMESTAMP, + 'expiration' => $day ? TIMESTAMP + $day * 86400 : '', + 'status' => 1, + ); + C::t('forum_medallog')->insert($data); + } + } + + function reward_invite($num, $day) { + global $_G; + $day = empty($day) ? 5 : $day; + $expiration = $_G['timestamp'] + $day * 86400; + $codes = array(); + for ($i=0; $i < $num; $i++) { + $code = strtolower(random(6)); + $codes[] = "('{$_G['uid']}', '$code', '{$_G['timestamp']}', '$expiration', '{$_G['clientip']}')"; + $invitedata = array( + 'uid' => $_G['uid'], + 'code' => $code, + 'dateline' => $_G['timestamp'], + 'endtime' => $expiration, + 'inviteip' => $_G['clientip'] + ); + C::t('common_invite')->insert($invitedata); + } + + } + + function reward_group($gid, $day = 0) { + global $_G; + + $exists = FALSE; + if($_G['member']['extgroupids']) { + $_G['member']['extgroupids'] = explode("\t", $_G['member']['extgroupids']); + if(in_array($gid, $_G['member']['extgroupids'])) { + $exists = TRUE; + } else { + $_G['member']['extgroupids'][] = $gid; + } + $_G['member']['extgroupids'] = implode("\t", $_G['member']['extgroupids']); + } else { + $_G['member']['extgroupids'] = $gid; + } + + C::t('common_member')->update($_G['uid'], array('extgroupids' => $_G['member']['extgroupids']), 'UNBUFFERED'); + + if($day) { + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $groupterms = !empty($memberfieldforum['groupterms']) ? dunserialize($memberfieldforum['groupterms']) : array(); + unset($memberfieldforum); + $groupterms['ext'][$gid] = $exists && $groupterms['ext'][$gid] ? max($groupterms['ext'][$gid], TIMESTAMP + $day * 86400) : TIMESTAMP + $day * 86400; + C::t('common_member_field_forum')->update($_G['uid'], array('groupterms' => serialize($groupterms)), 'UNBUFFERED'); + + } + } + + function message($csc, $msg, $values = array()) { + include template('common/header_ajax'); + $msg = lang('message', $msg, $values); + echo "$csc|$msg"; + include template('common/footer_ajax'); + exit; + } + + function timeformat($t) { + global $_G; + + if($t) { + $h = floor($t / 3600); + $m = floor(($t - $h * 3600) / 60); + $s = floor($t - $h * 3600 - $m * 60); + return ($h ? "$h{$_G['setting']['dlang']['date'][4]}" : '').($m ? "$m{$_G['setting']['dlang']['date'][6]}" : '').($h || !$s ? '' : "$s{$_G['setting']['dlang']['date'][7]}"); + } + return ''; + } + +} + +function tasktimeformat($t) { + global $_G; + + if($t) { + $h = floor($t / 3600); + $m = floor(($t - $h * 3600) / 60); + $s = floor($t - $h * 3600 - $m * 60); + return ($h ? "$h{$_G['lang']['core']['date']['hour']}" : '').($m ? "$m{$_G['lang']['core']['date']['min']}" : '').($h || !$s ? '' : "$s{$_G['lang']['core']['date']['sec']}"); + } + return ''; +} +?> \ No newline at end of file diff --git a/source/class/class_template.php b/source/class/class_template.php new file mode 100644 index 0000000..5bbcc73 --- /dev/null +++ b/source/class/class_template.php @@ -0,0 +1,502 @@ + array(), 'replace' => array()); + var $blocks = array(); + var $language = array(); + var $file = ''; + var $filetype = 'htm'; + var $debug = 0; + + function parse_template($tplfile, $templateid = 1, $tpldir = '', $file = '', $cachefile = '', $postparse = null) { + $basefile = basename(DISCUZ_ROOT.$tplfile, '.'.$this->filetype); + $file == 'common/header' && defined('CURMODULE') && CURMODULE && $file = 'common/header_'.CURMODULE; + $this->file = $file; + + if($fp = @fopen(DISCUZ_ROOT.$tplfile, 'r')) { + $template = filesize(DISCUZ_ROOT.$tplfile) ? fread($fp, filesize(DISCUZ_ROOT.$tplfile)) : ''; + fclose($fp); + } elseif($fp = @fopen($filename = substr(DISCUZ_ROOT.$tplfile, 0, -(strlen($this->filetype) + 1)).'.php', 'r')) { + $template = filesize($filename) ? fread($fp, filesize($filename)) : ''; + $template = $this->getphptemplate($template); + fclose($fp); + } else { + $tpl = $tpldir.'/'.$file.'.'.$this->filetype; + $tplfile = $tplfile != $tpl ? $tpl.', '.$tplfile : $tplfile; + $this->error('template_notfound', $tplfile); + } + + if($this->debug) { + $template = $this->insertdebugmsg($template, $tplfile); + } + + $var_regexp = "((\\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\-\>)?[a-zA-Z0-9_\x7f-\xff]*)(\[[a-zA-Z0-9_\-\.\"\'\[\]\$\x7f-\xff]+\])*)"; + $const_regexp = "([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)"; + + $headerexists = preg_match("/{(sub)?template\s+[\w:\/]+?header\}/", $template); + $this->subtemplates = array(); + for($i = 1; $i <= 3; $i++) { + if(strexists($template, '{subtemplate')) { + $template = preg_replace_callback("/[\n\r\t]*(\<\!\-\-)?\{subtemplate\s+([a-z0-9_:\/]+)\}(\-\-\>)?[\n\r\t]*/is", array($this, 'parse_template_callback_loadsubtemplate_2'), $template); + } + } + + $template = preg_replace("/([\n\r]+)\t+/s", "\\1", $template); + $template = preg_replace("/\/\*\*\{(.+?)\}\*\//s", "{\\1}", $template); + $template = preg_replace("/\<\!\-\-\{(.+?)\}\-\-\>/s", "{\\1}", $template); + $template = preg_replace_callback("/\{lang\s+(.+?)\}/is", array($this, 'parse_template_callback_languagevar_1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{block\/(\d+?)\}[\n\r\t]*/i", array($this, 'parse_template_callback_blocktags_1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{blockdata\/(\d+?)\}[\n\r\t]*/i", array($this, 'parse_template_callback_blockdatatags_1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{ad\/(.+?)\}[\n\r\t]*/i", array($this, 'parse_template_callback_adtags_1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{ad\s+([a-zA-Z0-9_\[\]]+)\/(.+?)\}[\n\r\t]*/i", array($this, 'parse_template_callback_adtags_21'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{date\((.+?)\)\}[\n\r\t]*/i", array($this, 'parse_template_callback_datetags_1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{avatar\((.+?)\)\}[\n\r\t]*/i", array($this, 'parse_template_callback_avatartags_1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{eval\}\s*(\<\!\-\-)*(.+?)(\-\-\>)*\s*\{\/eval\}[\n\r\t]*/is", array($this, 'parse_template_callback_evaltags_2'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{eval\s+(.+?)\s*\}[\n\r\t]*/is", array($this, 'parse_template_callback_evaltags_1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{csstemplate\}[\n\r\t]*/is", array($this, 'parse_template_callback_loadcsstemplate'), $template); + $template = str_replace("{LF}", "", $template); + $template = preg_replace("/\{(\\\$[a-zA-Z0-9_\-\>\[\]\'\"\$\.\x7f-\xff]+)\s(or|\?\?)\s([a-zA-Z0-9\']+)\}/s", "{echo \\1 ?? \\3}", $template); + $template = preg_replace("/\{(\\\$[a-zA-Z0-9_\-\>\[\]\'\"\$\.\x7f-\xff]+)\}/s", "", $template); + $template = preg_replace_callback("/\{hook\/(\w+?)(\s+(.+?))?\}/i", array($this, 'parse_template_callback_hooktags_13'), $template); + $template = preg_replace_callback("/$var_regexp/s", array($this, 'parse_template_callback_addquote_1'), $template); + $template = preg_replace_callback("/\<\?\=\<\?\=$var_regexp\?\>\?\>/s", array($this, 'parse_template_callback_addquote_1'), $template); + + $headeradd = $headerexists ? "hookscriptoutput('$basefile');" : ''; + if(!empty($this->subtemplates)) { + $headeradd .= "\n0\n"; + foreach($this->subtemplates as $fname) { + $headeradd .= "|| checktplrefresh('$tplfile', '$fname', ".time().", '$templateid', '$cachefile', '$tpldir', '$file')\n"; + } + $headeradd .= ';'; + } + + if(!empty($this->blocks)) { + $headeradd .= "\n"; + $headeradd .= "block_get('".implode(',', $this->blocks)."');"; + } + + if($cachefile) { + $template = "\n$template"; + } + + $template = preg_replace_callback("/[\n\r\t]*\{template\s+([a-z0-9_:\/]+)\}[\n\r\t]*/is", array($this, 'parse_template_callback_stripvtags_template1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{template\s+(.+?)\}[\n\r\t]*/is", array($this, 'parse_template_callback_stripvtags_template1'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{echo\s+(.+?)\}[\n\r\t]*/is", array($this, 'parse_template_callback_stripvtags_echo1'), $template); + + $template = preg_replace_callback("/([\n\r\t]*)\{if\s+(.+?)\}([\n\r\t]*)/is", array($this, 'parse_template_callback_stripvtags_if123'), $template); + $template = preg_replace_callback("/([\n\r\t]*)\{elseif\s+(.+?)\}([\n\r\t]*)/is", array($this, 'parse_template_callback_stripvtags_elseif123'), $template); + $template = preg_replace("/\{else\}/i", "", $template); + $template = preg_replace("/\{\/if\}/i", "", $template); + + $template = preg_replace_callback("/[\n\r\t]*\{loop\s+(\S+)\s+(\S+)\}[\n\r\t]*/is", array($this, 'parse_template_callback_stripvtags_loop12'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{loop\s+(\S+)\s+(\S+)\s+(\S+)\}[\n\r\t]*/is", array($this, 'parse_template_callback_stripvtags_loop123'), $template); + $template = preg_replace("/\{\/loop\}/i", "", $template); + + $template = preg_replace("/\{$const_regexp\}/s", "", $template); + if(!empty($this->replacecode)) { + $template = str_replace($this->replacecode['search'], $this->replacecode['replace'], $template); + } + $template = preg_replace("/ \?\>[\n\r]*\<\? /s", " ", $template); + + if($cachefile && !@$fp = fopen(DISCUZ_ROOT.$cachefile, 'c')) { + $this->error('directory_notfound', dirname(DISCUZ_ROOT.$cachefile)); + } + + $template = preg_replace_callback("/\"(http)?[\w\.\/:]+\?[^\"]+?&[^\"]+?\"/", array($this, 'parse_template_callback_transamp_0'), $template); + $template = preg_replace_callback("/\]*?src=\"(.+?)\"(.*?)\>\s*\<\/script\>/is", array($this, 'parse_template_callback_stripscriptamp_12'), $template); + $template = preg_replace_callback("/[\n\r\t]*\{block\s+([a-zA-Z0-9_\[\]']+)\}(.+?)\{\/block\}/is", array($this, 'parse_template_callback_stripblock_12'), $template); + $template = preg_replace("/\<\?(\s{1})/is", "/is", "", $template); + if($this->debug) { + $template = preg_replace_callback("/\.+?\<\/script\>/is", array($this, 'parse_template_callback_scriptdebugconvert_0'), $template); + } + if(is_callable($postparse)) { + $template = $postparse($template); + } + + if(!($cachefile && $fp && flock($fp, LOCK_EX) && ftruncate($fp, 0) && fwrite($fp, $template) && fflush($fp) && flock($fp, LOCK_UN) && fclose($fp))) { + return $template; + } + } + + function parse_template_callback_loadsubtemplate_2($matches) { + return $this->loadsubtemplate($matches[2]); + } + + function parse_template_callback_languagevar_1($matches) { + return $this->languagevar($matches[1]); + } + + function parse_template_callback_blocktags_1($matches) { + return $this->blocktags($matches[1]); + } + + function parse_template_callback_blockdatatags_1($matches) { + return $this->blockdatatags($matches[1]); + } + + function parse_template_callback_adtags_1($matches) { + return $this->adtags($matches[1]); + } + + function parse_template_callback_adtags_21($matches) { + return $this->adtags($matches[2], $matches[1]); + } + + function parse_template_callback_datetags_1($matches) { + return $this->datetags($matches[1]); + } + + function parse_template_callback_avatartags_1($matches) { + return $this->avatartags($matches[1]); + } + + function parse_template_callback_evaltags_2($matches) { + return $this->evaltags($matches[2]); + } + + function parse_template_callback_evaltags_1($matches) { + return $this->evaltags($matches[1]); + } + + function parse_template_callback_loadcsstemplate($matches) { + return $this->loadcsstemplate(); + } + + function parse_template_callback_hooktags_13($matches) { + return $this->hooktags($matches[1], isset($matches[3]) ? $matches[3] : ''); + } + + function parse_template_callback_addquote_1($matches) { + return $this->addquote(''); + } + + function parse_template_callback_stripvtags_template1($matches) { + return $this->stripvtags(''); + } + + function parse_template_callback_stripvtags_echo1($matches) { + return $this->stripvtags('echopolyfill($matches[1]).'; ?>'); + } + + function parse_template_callback_stripvtags_if123($matches) { + return $this->stripvtags($matches[1].''.$matches[3]); + } + + function parse_template_callback_stripvtags_elseif123($matches) { + return $this->stripvtags($matches[1].''.$matches[3]); + } + + function parse_template_callback_stripvtags_loop12($matches) { + return $this->stripvtags($this->looptags($matches[1], $matches[2])); + } + + function parse_template_callback_stripvtags_loop123($matches) { + return $this->stripvtags($this->looptags($matches[1], $matches[2], $matches[3])); + } + + function parse_template_callback_transamp_0($matches) { + return $this->transamp($matches[0]); + } + + function parse_template_callback_stripscriptamp_12($matches) { + return $this->stripscriptamp($matches[1], $matches[2]); + } + + function parse_template_callback_stripblock_12($matches) { + return $this->stripblock($matches[1], $matches[2]); + } + + function parse_template_callback_scriptdebugconvert_0($matches) { + return $this->scriptdebugconvert($matches[0]); + } + + function languagevar($var) { + $vars = explode(':', $var); + $isplugin = count($vars) == 2; + if(!$isplugin) { + !isset($this->language['inner']) && $this->language['inner'] = array(); + $langvar = &$this->language['inner']; + } else { + !isset($this->language['plugin'][$vars[0]]) && $this->language['plugin'][$vars[0]] = array(); + $langvar = &$this->language['plugin'][$vars[0]]; + $var = &$vars[1]; + } + if(!isset($langvar[$var])) { + $this->language['inner'] = lang('template'); + if(!$isplugin) { + + if(defined('IN_MOBILE')) { + $mobiletpl = getglobal('mobiletpl'); + list($path) = explode('/', str_replace($mobiletpl[IN_MOBILE].'/', '', $this->file)); + } else { + list($path) = explode('/', $this->file); + } + $path = $path == 'common' ? '' : $path.'/'; + + foreach(lang($path.'template') as $k => $v) { + $this->language['inner'][$k] = $v; + } + + if(defined('IN_MOBILE')) { + foreach(lang('touch/template') as $k => $v) { + $this->language['inner'][$k] = $v; + } + } + } else { + global $_G; + if(empty($_G['config']['plugindeveloper'])) { + loadcache('pluginlanguage_template'); + } elseif(!isset($_G['cache']['pluginlanguage_template'][$vars[0]]) && preg_match("/^[a-z]+[a-z0-9_]*$/i", $vars[0])) { + if(@include(DISCUZ_ROOT.'./data/plugindata/'.$vars[0].'.lang.php')) { + $_G['cache']['pluginlanguage_template'][$vars[0]] = $templatelang[$vars[0]]; + } else { + loadcache('pluginlanguage_template'); + } + } + $this->language['plugin'][$vars[0]] = $_G['cache']['pluginlanguage_template'][$vars[0]]; + } + } + if(isset($langvar[$var])) { + return $langvar[$var]; + } else { + return '!'.$var.'!'; + } + } + + function blocktags($parameter) { + $bid = intval(trim($parameter)); + $this->blocks[] = $bid; + $i = count($this->replacecode['search']); + $this->replacecode['search'][$i] = $search = ""; + $this->replacecode['replace'][$i] = ""; + return $search; + } + + function blockdatatags($parameter) { + $bid = intval(trim($parameter)); + $this->blocks[] = $bid; + $i = count($this->replacecode['search']); + $this->replacecode['search'][$i] = $search = ""; + $this->replacecode['replace'][$i] = ""; + return $search; + } + + function adtags($parameter, $varname = '') { + $parameter = stripslashes($parameter); + $parameter = preg_replace("/(\\\$[a-zA-Z0-9_\-\>\[\]\'\"\$\.\x7f-\xff]+)/s", "{\\1}", $this->addquote($parameter)); + $i = count($this->replacecode['search']); + $this->replacecode['search'][$i] = $search = ""; + $this->replacecode['replace'][$i] = ""; + return $search; + } + + function datetags($parameter) { + $parameter = stripslashes($parameter); + $i = count($this->replacecode['search']); + $this->replacecode['search'][$i] = $search = ""; + $this->replacecode['replace'][$i] = ""; + return $search; + } + + function avatartags($parameter) { + $parameter = stripslashes($parameter); + $i = count($this->replacecode['search']); + $this->replacecode['search'][$i] = $search = ""; + $this->replacecode['replace'][$i] = ""; + return $search; + } + + function evaltags($php) { + $i = count($this->replacecode['search']); + $this->replacecode['search'][$i] = $search = ""; + $this->replacecode['replace'][$i] = $this->debug ? '/', '/\<\!\-\-L\d+[\w\.\/]*\-\-\>/', '/\<\!\-\-L\d+[\w\.\/]*$/', '/^\s*\<\!\-\-/', '/\-\-\>\s*$/'), '', $php).'?>' : ""; + return $search; + } + + function hooktags($hookid, $key = '') { + global $_G; + $i = count($this->replacecode['search']); + $this->replacecode['search'][$i] = $search = ""; + $dev = ''; + if(isset($_G['config']['plugindeveloper']) && $_G['config']['plugindeveloper'] == 2) { + $dev = "echo '[".($key ? 'array' : 'string')." $hookid".($key ? '/\'.'.$key.'.\'' : '')."]';"; + } + $key = $key != '' ? "[$key]" : ''; + $this->replacecode['replace'][$i] = ""; + return $search; + } + + function stripphpcode($type, $code) { + $this->phpcode[$type][] = $code; + return '{phpcode:'.$type.'/'.(count($this->phpcode[$type]) - 1).'}'; + } + + function loadsubtemplate($file) { + $tplfile = template($file, 0, '', 1); + $filename = DISCUZ_ROOT.$tplfile; + if((file_exists($filename) && is_readable($filename) && ($content = implode('', file($filename)))) || (file_exists(substr($filename, 0, -4).'.php') && is_readable(substr($filename, 0, -4).'.php') && ($content = $this->getphptemplate(implode('', file(substr($filename, 0, -4).'.php')))))) { + $this->subtemplates[] = $tplfile; + return $this->debug ? $this->insertdebugmsg($content, $tplfile) : $content; + } else { + return ''; + } + } + + function getphptemplate($content) { + $pos = strpos($content, "\n"); + return $pos !== false ? substr($content, $pos + 1) : $content; + } + + function loadcsstemplate() { + global $_G; + $file = file(DISCUZ_ROOT.'./data/cache/style_'.STYLEID.'_module.css'); + $scripts = array(STYLEID.'_common'); + $content = $this->csscurmodules = ''; + $content = implode('', is_array($file) ? $file : array()); + $content = preg_replace_callback("/\[(.+?)\](.*?)\[end\]/is", array($this, 'loadcsstemplate_callback_cssvtags_12'), $content); + if($this->csscurmodules) { + $this->csscurmodules = preg_replace(array('/\s*([,;:\{\}])\s*/', '/[\t\n\r]/', '/\/\*.+?\*\//'), array('\\1', '',''), $this->csscurmodules); + if(file_put_contents(DISCUZ_ROOT.'./data/cache/style_'.STYLEID.'_'.$_G['basescript'].'_'.CURMODULE.'.css', $this->csscurmodules, LOCK_EX) === false) { + exit('Can not write to cache files, please check directory ./data/ and ./data/cache/ .'); + } + $scripts[] = STYLEID.'_'.$_G['basescript'].'_'.CURMODULE; + } + $scriptcss = ''; + foreach($scripts as $css) { + $scriptcss .= ''; + } + $scriptcss .= '{if $_G[\'uid\'] && isset($_G[\'cookie\'][\'extstyle\']) && strpos($_G[\'cookie\'][\'extstyle\'], TPLDIR) !== false}{elseif $_G[\'style\'][\'defaultextstyle\']}{/if}'; + if(isset($_G['config']['output']['css4legacyie']) && $_G['config']['output']['css4legacyie']) { + $scriptcss .= ''; + } + return $scriptcss; + } + + function loadcsstemplate_callback_cssvtags_12($matches) { + return $this->cssvtags($matches[1], $matches[2]); + } + + function cssvtags($param, $content) { + global $_G; + $modules = explode(',', $param); + foreach($modules as $module) { + $module .= '::'; //fix notice + list($b, $m) = explode('::', $module); + if($b && $b == $_G['basescript'] && (!$m || $m == CURMODULE)) { + $this->csscurmodules .= $content; + return; + } + } + return; + } + + function looptags($param1, $param2, $param3 = '') { + if(preg_match("/^\<\?\=\\\$.+?\?\>$/s", $param1)) { + $exprtemp = $param1; + $return = ' '.$param3.') { ?>'; + } else { + $return .= 'foreach('.$exprtemp.' as '.$param2.') { ?>'; + } + return $return; + } + + function echopolyfill($str) { + $str = str_replace(' or ', ' ?? ', $str); + if(strpos($str, ' ?? ') !== false && version_compare(PHP_VERSION, '7.0', '<')) { + $str = preg_replace('/^(.+)\s\?\?\s(.+)$/', "isset(\\1) ? (\\1) : (\\2)", $str); + } + return $str; + } + + function transamp($str) { + $str = str_replace('&', '&', $str); + $str = str_replace('&amp;', '&', $str); + return $str; + } + + function addquote($var) { + return str_replace("\\\"", "\"", preg_replace_callback("/\[([a-zA-Z0-9_\-\.\x7f-\xff]+)\]/s", array($this, 'addquote_exec'), $var)); + } + + function addquote_exec($matches) { + return is_numeric($matches[1]) ? '['.$matches[1].']' : "['".$matches[1]."']"; + } + + + function stripvtags($expr, $statement = '') { + $expr = str_replace('\\\"', '\"', preg_replace("/\<\?\=(\\\$.+?)\?\>/s", "\\1", $expr)); + if($this->debug) { + $expr = preg_replace('/\<\!\-\-L\d+[\w\.\/]*\-\-\>/', '', $expr); + } + $statement = str_replace('\\\"', '\"', $statement); + return $expr.$statement; + } + + function stripscriptamp($s, $extra) { + $s = str_replace('&', '&', $s); + return ""; + } + + function stripblock($var, $s) { + $var = $this->addquote($var); + $s = preg_replace("/<\?=\\\$(.+?)\?>/", "{\$\\1}", $s); + preg_match_all("/<\?=(.+?)\?>/", $s, $constary); + $constadd = ''; + $constary[1] = array_unique($constary[1]); + foreach($constary[1] as $const) { + $constadd .= '$__'.$const.' = '.$const.';'; + } + $s = preg_replace("/<\?=(.+?)\?>/", "{\$__\\1}", $s); + $s = str_replace('?>', "\n\$$var .= <<"; + } + + function scriptdebugconvert($str) { + return preg_replace('/\<\!\-\-L(\d+[\w\.\/]*)\-\-\>/', '/**L\1*/', $str); + } + + function insertdebugmsg($str, $filename) { + $startmsg = ''; + $endmsg = ''; + $count = 2; + $debuglevel = $this->debug; + $str = preg_replace_callback('/\n(\t*)/', function($matches) use (&$count, $filename, $debuglevel){ + if($debuglevel > 1) { + return "\n".$matches[1].''; + } else { + return "\n".$matches[1].''; + } + }, $str); + return $startmsg.$str.$endmsg; + } + + function error($message, $tplname) { + discuz_error::template_error($message, $tplname); + } + +} + +?> \ No newline at end of file diff --git a/source/class/class_xml.php b/source/class/class_xml.php new file mode 100644 index 0000000..6501f80 --- /dev/null +++ b/source/class/class_xml.php @@ -0,0 +1,109 @@ +parse($xml); + $xml_parser->destruct(); + return $data; +} + +function array2xml($arr, $htmlon = TRUE, $isnormal = FALSE, $level = 1) { + $s = $level == 1 ? "\r\n\r\n" : ''; + $space = str_repeat("\t", $level); + foreach($arr as $k => $v) { + if(!is_array($v)) { + $s .= $space."".($htmlon ? '' : '')."\r\n"; + } else { + $s .= $space."\r\n".array2xml($v, $htmlon, $isnormal, $level + 1).$space."\r\n"; + } + } + $s = preg_replace("/([\x01-\x08\x0b-\x0c\x0e-\x1f])+/", ' ', $s); + return $level == 1 ? $s."" : $s; +} + +class XMLparse { + + var $parser; + var $document; + var $stack; + var $data; + var $last_opened_tag; + var $isnormal; + var $attrs = array(); + var $failed = FALSE; + + function __construct($isnormal) { + $this->XMLparse($isnormal); + } + + function XMLparse($isnormal) { + $this->isnormal = $isnormal; + $this->parser = xml_parser_create('ISO-8859-1'); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false); + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, 'open','close'); + xml_set_character_data_handler($this->parser, 'data'); + } + + function destruct() { + xml_parser_free($this->parser); + } + + function parse(&$data) { + $this->document = array(); + $this->stack = array(); + return xml_parse($this->parser, $data, true) && !$this->failed ? $this->document : array(); + } + + function open($parser, $tag, $attributes) { + $this->data = ''; + $this->failed = FALSE; + if(!$this->isnormal) { + if(isset($attributes['id']) && !(isset($this->document[$attributes['id']]) && is_string($this->document[$attributes['id']]))) { + $this->document = &$this->document[$attributes['id']]; + } else { + $this->failed = TRUE; + } + } else { + if(!isset($this->document[$tag]) || !is_string($this->document[$tag])) { + $this->document = &$this->document[$tag]; + } else { + $this->failed = TRUE; + } + } + $this->stack[] = &$this->document; + $this->last_opened_tag = $tag; + $this->attrs = $attributes; + } + + function data($parser, $data) { + if($this->last_opened_tag != NULL) { + $this->data .= $data; + } + } + + function close($parser, $tag) { + if($this->last_opened_tag == $tag) { + $this->document = $this->data; + $this->last_opened_tag = NULL; + } + array_pop($this->stack); + if($this->stack) { + $this->document = &$this->stack[count($this->stack)-1]; + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/class_zip.php b/source/class/class_zip.php new file mode 100644 index 0000000..c86ac11 --- /dev/null +++ b/source/class/class_zip.php @@ -0,0 +1,310 @@ +> 1); + } // end of the 'unix2DosTime()' method + + + function addFile($data, $name, $time = 0) { + $name = str_replace('\\', '/', $name); + + $dtime = dechex($this->unix2DosTime($time)); + $hexdtime = '\x' . $dtime[6] . $dtime[7] + . '\x' . $dtime[4] . $dtime[5] + . '\x' . $dtime[2] . $dtime[3] + . '\x' . $dtime[0] . $dtime[1]; + eval('$hexdtime = "' . $hexdtime . '";'); + + $fr = "\x50\x4b\x03\x04"; + $fr .= "\x14\x00"; // ver needed to extract + $fr .= "\x00\x00"; // gen purpose bit flag + $fr .= "\x08\x00"; // compression method + $fr .= $hexdtime; // last mod time and date + + $unc_len = strlen($data); + $crc = crc32($data); + $zdata = gzcompress($data); + $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug + $c_len = strlen($zdata); + $fr .= pack('V', $crc); // crc32 + $fr .= pack('V', $c_len); // compressed filesize + $fr .= pack('V', $unc_len); // uncompressed filesize + $fr .= pack('v', strlen($name)); // length of filename + $fr .= pack('v', 0); // extra field length + $fr .= $name; + + $fr .= $zdata; + + + $this -> datasec[] = $fr; + + $cdrec = "\x50\x4b\x01\x02"; + $cdrec .= "\x00\x00"; // version made by + $cdrec .= "\x14\x00"; // version needed to extract + $cdrec .= "\x00\x00"; // gen purpose bit flag + $cdrec .= "\x08\x00"; // compression method + $cdrec .= $hexdtime; // last mod time & date + $cdrec .= pack('V', $crc); // crc32 + $cdrec .= pack('V', $c_len); // compressed filesize + $cdrec .= pack('V', $unc_len); // uncompressed filesize + $cdrec .= pack('v', strlen($name) ); // length of filename + $cdrec .= pack('v', 0 ); // extra field length + $cdrec .= pack('v', 0 ); // file comment length + $cdrec .= pack('v', 0 ); // disk number start + $cdrec .= pack('v', 0 ); // internal file attributes + $cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set + + $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header + $this -> old_offset += strlen($fr); + + $cdrec .= $name; + + $this -> ctrl_dir[] = $cdrec; + } // end of the 'addFile()' method + + + function file() { + $data = implode('', $this -> datasec); + $ctrldir = implode('', $this -> ctrl_dir); + + return + $data . + $ctrldir . + $this -> eof_ctrl_dir . + pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk" + pack('v', sizeof($this -> ctrl_dir)) . // total # of entries overall + pack('V', strlen($ctrldir)) . // size of central dir + pack('V', strlen($data)) . // offset to start of central dir + "\x00\x00"; // .zip file comment length + } // end of the 'file()' method + +} // end of the 'zipfile' class + + +class SimpleUnzip { + var $Comment = ''; + + var $Entries = array(); + + var $Name = ''; + + var $Size = 0; + + var $Time = 0; + + function __construct($in_FileName = '') { + if($in_FileName !== '') { + SimpleUnzip::ReadFile($in_FileName); + } + } // end of the 'SimpleUnzip' constructor + + function Count() { + return count($this->Entries); + } // end of the 'Count()' method + + function GetData($in_Index) { + return $this->Entries[$in_Index]->Data; + } // end of the 'GetData()' method + + function GetEntry($in_Index) { + return $this->Entries[$in_Index]; + } // end of the 'GetEntry()' method + + function GetError($in_Index) { + return $this->Entries[$in_Index]->Error; + } // end of the 'GetError()' method + + function GetErrorMsg($in_Index) { + return $this->Entries[$in_Index]->ErrorMsg; + } // end of the 'GetErrorMsg()' method + + function GetName($in_Index) { + return $this->Entries[$in_Index]->Name; + } // end of the 'GetName()' method + + function GetPath($in_Index) { + return $this->Entries[$in_Index]->Path; + } // end of the 'GetPath()' method + + function GetTime($in_Index) { + return $this->Entries[$in_Index]->Time; + } // end of the 'GetTime()' method + + function ReadFile($in_FileName) { + $this->Entries = array(); + + $this->Name = $in_FileName; + $this->Time = filemtime($in_FileName); + $this->Size = filesize($in_FileName); + + $oF = fopen($in_FileName, 'rb'); + $vZ = fread($oF, $this->Size); + fclose($oF); + + $aE = explode("\x50\x4b\x05\x06", $vZ); + + + $aP = unpack('x16/v1CL', $aE[1]); + $this->Comment = substr($aE[1], 18, $aP['CL']); + + $this->Comment = strtr($this->Comment, array("\r\n" => "\n", + "\r" => "\n")); + + $aE = explode("\x50\x4b\x01\x02", $vZ); + $aE = explode("\x50\x4b\x03\x04", $aE[0]); + array_shift($aE); + + foreach($aE as $vZ) { + $aI = array(); + $aI['E'] = 0; + $aI['EM'] = ''; + $aP = unpack('v1VN/v1GPF/v1CM/v1FT/v1FD/V1CRC/V1CS/V1UCS/v1FNL', $vZ); + $bE = ($aP['GPF'] && 0x0001) ? TRUE : FALSE; + $nF = $aP['FNL']; + + if($aP['GPF'] & 0x0008) { + $aP1 = unpack('V1CRC/V1CS/V1UCS', substr($vZ, -12)); + + $aP['CRC'] = $aP1['CRC']; + $aP['CS'] = $aP1['CS']; + $aP['UCS'] = $aP1['UCS']; + + $vZ = substr($vZ, 0, -12); + } + + $aI['N'] = substr($vZ, 26, $nF); + + if(substr($aI['N'], -1) == '/') { + continue; + } + + $aI['P'] = dirname($aI['N']); + $aI['P'] = $aI['P'] == '.' ? '' : $aI['P']; + $aI['N'] = basename($aI['N']); + + $vZ = substr($vZ, 26 + $nF); + + if(strlen($vZ) != $aP['CS']) { + $aI['E'] = 1; + $aI['EM'] = 'Compressed size is not equal with the value in header information.'; + } else { + if($bE) { + $aI['E'] = 5; + $aI['EM'] = 'File is encrypted, which is not supported from this class.'; + } else { + switch($aP['CM']) { + case 0: // Stored + break; + + case 8: // Deflated + $vZ = gzinflate($vZ); + break; + + case 12: // BZIP2 + if(extension_loaded('bz2')) { + $vZ = bzdecompress($vZ); + } else { + $aI['E'] = 7; + $aI['EM'] = "PHP BZIP2 extension not available."; + } + + break; + + default: + $aI['E'] = 6; + $aI['EM'] = "De-/Compression method {$aP['CM']} is not supported."; + } + + if(! $aI['E']) { + if($vZ === FALSE) { + $aI['E'] = 2; + $aI['EM'] = 'Decompression of data failed.'; + } else { + if(strlen($vZ) != $aP['UCS']) { + $aI['E'] = 3; + $aI['EM'] = 'Uncompressed size is not equal with the value in header information.'; + } else { + if(crc32($vZ) != $aP['CRC']) { + $aI['E'] = 4; + $aI['EM'] = 'CRC32 checksum is not equal with the value in header information.'; + } + } + } + } + } + } + + $aI['D'] = $vZ; + + $aI['T'] = mktime(($aP['FT'] & 0xf800) >> 11, + ($aP['FT'] & 0x07e0) >> 5, + ($aP['FT'] & 0x001f) << 1, + ($aP['FD'] & 0x01e0) >> 5, + ($aP['FD'] & 0x001f), + (($aP['FD'] & 0xfe00) >> 9) + 1980); + + $this->Entries[] = new SimpleUnzipEntry($aI); + } // end for each entries + + return $this->Entries; + } // end of the 'ReadFile()' method +} // end of the 'SimpleUnzip' class + +class SimpleUnzipEntry { + var $Data = ''; + + var $Error = 0; + + var $ErrorMsg = ''; + + var $Name = ''; + + var $Path = ''; + + var $Time = 0; + + function __construct($in_Entry) { + $this->Data = $in_Entry['D']; + $this->Error = $in_Entry['E']; + $this->ErrorMsg = $in_Entry['EM']; + $this->Name = $in_Entry['N']; + $this->Path = $in_Entry['P']; + $this->Time = $in_Entry['T']; + } // end of the 'SimpleUnzipEntry' constructor +} // end of the 'SimpleUnzipEntry' class + +?> \ No newline at end of file diff --git a/source/class/db/db_driver_mysqli.php b/source/class/db/db_driver_mysqli.php new file mode 100644 index 0000000..42de9b9 --- /dev/null +++ b/source/class/db/db_driver_mysqli.php @@ -0,0 +1,250 @@ +set_config($config); + } + } + + function set_config($config) { + $this->config = &$config; + $this->tablepre = $config['1']['tablepre']; + if(!empty($this->config['map'])) { + $this->map = $this->config['map']; + for($i = 1; $i <= 100; $i++) { + if(isset($this->map['forum_thread'])) { + $this->map['forum_thread_'.$i] = $this->map['forum_thread']; + } + if(isset($this->map['forum_post'])) { + $this->map['forum_post_'.$i] = $this->map['forum_post']; + } + if(isset($this->map['forum_attachment']) && $i <= 10) { + $this->map['forum_attachment_'.($i-1)] = $this->map['forum_attachment']; + } + } + if(isset($this->map['common_member'])) { + $this->map['common_member_archive'] = + $this->map['common_member_count'] = $this->map['common_member_count_archive'] = + $this->map['common_member_status'] = $this->map['common_member_status_archive'] = + $this->map['common_member_profile'] = $this->map['common_member_profile_archive'] = + $this->map['common_member_field_forum'] = $this->map['common_member_field_forum_archive'] = + $this->map['common_member_field_home'] = $this->map['common_member_field_home_archive'] = + $this->map['common_member_validate'] = $this->map['common_member_verify'] = + $this->map['common_member_verify_info'] = $this->map['common_member']; + } + } + } + + function connect($serverid = 1) { + + if(empty($this->config) || empty($this->config[$serverid])) { + $this->halt('config_db_not_found'); + } + + $this->link[$serverid] = $this->_dbconnect( + $this->config[$serverid]['dbhost'], + $this->config[$serverid]['dbuser'], + $this->config[$serverid]['dbpw'], + $this->config[$serverid]['dbcharset'], + $this->config[$serverid]['dbname'], + $this->config[$serverid]['pconnect'] + ); + $this->curlink = $this->link[$serverid]; + + } + + function _dbconnect($dbhost, $dbuser, $dbpw, $dbcharset, $dbname, $pconnect, $halt = true) { + mysqli_report(MYSQLI_REPORT_OFF); + if (intval($pconnect) === 1) $dbhost = 'p:' . $dbhost; + $link = new mysqli(); + if(!$link->real_connect($dbhost, $dbuser, $dbpw, $dbname, null, null, MYSQLI_CLIENT_COMPRESS)) { + $halt && $this->halt('notconnect', $this->errno()); + } else { + $this->curlink = $link; + $link->options(MYSQLI_OPT_LOCAL_INFILE, false); + $link->set_charset($dbcharset ? $dbcharset : $this->config[1]['dbcharset']); + $serverset = 'sql_mode=\'\','; + $serverset .= 'character_set_client=binary'; + $serverset && $link->query("SET $serverset"); + } + return $link; + } + + function table_name($tablename) { + if(!empty($this->map) && !empty($this->map[$tablename])) { + $id = $this->map[$tablename]; + if(!$this->link[$id]) { + $this->connect($id); + } + $this->curlink = $this->link[$id]; + } else { + $this->curlink = $this->link[1]; + } + return $this->tablepre.$tablename; + } + + function select_db($dbname) { + return $this->curlink->select_db($dbname); + } + + function fetch_array($query, $result_type = MYSQLI_ASSOC) { + return $query ? $query->fetch_array($result_type) : null; + } + + function fetch_first($sql) { + return $this->fetch_array($this->query($sql)); + } + + function result_first($sql) { + return $this->result($this->query($sql), 0); + } + + public function query($sql, $silent = false, $unbuffered = false) { + if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) { + $starttime = microtime(true); + } + + if('UNBUFFERED' === $silent) { + $silent = false; + $unbuffered = true; + } elseif('SILENT' === $silent) { + $silent = true; + $unbuffered = false; + } + + $resultmode = $unbuffered ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT; + + if(!($query = $this->curlink->query($sql, $resultmode))) { + if(in_array($this->errno(), array(2006, 2013)) && substr($silent, 0, 5) != 'RETRY') { + $this->connect(); + return $this->query($sql, 'RETRY'.$silent); + } + if(!$silent) { + $this->halt($this->error(), $this->errno(), $sql); + } + } + + if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) { + $this->sqldebug[] = array($sql, number_format((microtime(true) - $starttime), 6), debug_backtrace(), $this->curlink); + } + + $this->querynum++; + return $query; + } + + function affected_rows() { + return $this->curlink->affected_rows; + } + + function error() { + return $this->curlink->error; + } + + function errno() { + return $this->curlink->errno; + } + + function result($query, $row = 0) { + if(!$query || $query->num_rows == 0) { + return null; + } + $query->data_seek($row); + $assocs = $query->fetch_row(); + return $assocs[0]; + } + + function num_rows($query) { + $query = $query ? $query->num_rows : 0; + return $query; + } + + function num_fields($query) { + return $query ? $query->field_count : null; + } + + function free_result($query) { + return $query ? $query->free() : false; + } + + function insert_id() { + return ($id = $this->curlink->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); + } + + function fetch_row($query) { + $query = $query ? $query->fetch_row() : null; + return $query; + } + + function fetch_fields($query) { + return $query ? $query->fetch_field() : null; + } + + function version() { + if(empty($this->version)) { + $this->version = $this->curlink->server_info; + } + return $this->version; + } + + function escape_string($str) { + return $this->curlink->escape_string($str); + } + + function close() { + return $this->curlink->close(); + } + + function halt($message = '', $code = 0, $sql = '') { + throw new DbException($message, $code, $sql); + } + + function begin_transaction() { + if (PHP_VERSION < '5.5') { + return $this->curlink->autocommit(false); + } + return $this->curlink->begin_transaction(); + } + + function commit() { + $cr = $this->curlink->commit(); + if (PHP_VERSION < '5.5') { + $this->curlink->autocommit(true); + } + return $cr; + } + + function rollback() { + $rr = $this->curlink->rollback(); + if (PHP_VERSION < '5.5') { + $this->curlink->autocommit(true); + } + return $rr; + } + +} + +?> \ No newline at end of file diff --git a/source/class/db/db_driver_mysqli_slave.php b/source/class/db/db_driver_mysqli_slave.php new file mode 100644 index 0000000..465c580 --- /dev/null +++ b/source/class/db/db_driver_mysqli_slave.php @@ -0,0 +1,96 @@ +config['common']['slave_except_table']) { + $this->excepttables = explode(',', str_replace(' ', '', $this->config['common']['slave_except_table'])); + } + } + + public function table_name($tablename) { + $this->tablename = $tablename; + if(!$this->slaveexcept && $this->excepttables) { + $this->slaveexcept = in_array($tablename, $this->excepttables, true); + } + $this->serverid = isset($this->map[$this->tablename]) ? $this->map[$this->tablename] : 1; + return $this->tablepre.$tablename; + } + + protected function _slave_connect() { + if(!empty($this->config[$this->serverid]['slave'])) { + $this->_choose_slave(); + if($this->slaveid) { + if(!isset($this->link[$this->slaveid])) { + $this->connect($this->slaveid); + } + $this->slavequery ++; + $this->curlink = $this->link[$this->slaveid]; + } + return true; + } else { + return false; + } + } + + protected function _choose_slave(){ + if(!isset($this->_weighttable[$this->serverid])) { + foreach ($this->config[$this->serverid]['slave'] as $key => $value) { + $this->_weighttable[$this->serverid] .= str_repeat($key, 1 + intval($value['weight'])); + } + } + $sid = $this->_weighttable[$this->serverid][mt_rand(0, strlen($this->_weighttable[$this->serverid]) -1)]; + $this->slaveid = $this->serverid.'_'.$sid; + if(!isset($this->config[$this->slaveid])) { + $this->config[$this->slaveid] = $this->config[$this->serverid]['slave'][$sid]; + } + } + + protected function _master_connect() { + if ($this->serverid === null) { + $this->serverid = 1; + } + if(!$this->link[$this->serverid]) { + $this->connect($this->serverid); + } + $this->curlink = $this->link[$this->serverid]; + } + + public function query($sql, $silent = false, $unbuffered = false) { + if(!(!$this->slaveexcept && strtoupper(substr($sql, 0 , 6)) === 'SELECT' && strpos(strtoupper($sql), 'FOR UPDATE') === FALSE && $this->_slave_connect())) { + $this->_master_connect(); + } + $this->tablename = ''; + $this->slaveexcept = false; + return parent::query($sql, $silent, $unbuffered); + } + +} +?> \ No newline at end of file diff --git a/source/class/db/index.htm b/source/class/db/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/discuz/discuz_admincp.php b/source/class/discuz/discuz_admincp.php new file mode 100644 index 0000000..3a45778 --- /dev/null +++ b/source/class/discuz/discuz_admincp.php @@ -0,0 +1,312 @@ +core) || !is_object($this->core)) { + exit('No Discuz core found'); + } + + $this->cpsetting = $this->core->config['admincp']; + $this->adminuser = & $this->core->var['member']; + $this->core->var['setting']['jspath'] = 'static/js/'; + + $this->isfounder = $this->checkfounder($this->adminuser); + + $this->sessionlimit = TIMESTAMP - $this->sessionlife; + + $this->check_cpaccess(); + + $this->writecplog(); + } + + function writecplog() { + global $_G; + $extralog = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('formhash', 'submit', 'addsubmit', 'admin_password', 'sid', 'action')); + writelog('cplog', implode("\t", clearlogstring(array($_G['timestamp'], $_G['username'], $_G['adminid'], $_G['clientip'], getgpc('action'), $extralog)))); + } + + function check_cpaccess() { + + global $_G; + $session = array(); + + if(!$this->adminuser['uid']) { + $this->cpaccess = getglobal('config/admincp/mustlogin') ? -5 : 0; + } else { + + if(!$this->isfounder) { + $session = C::t('common_admincp_member')->fetch($this->adminuser['uid']); + if($session) { + $session = array_merge($session, C::t('common_admincp_session')->fetch_session($this->adminuser['uid'], $this->panel)); + } + } else { + $session = C::t('common_admincp_session')->fetch_session($this->adminuser['uid'], $this->panel); + } + + if(empty($session)) { + $this->cpaccess = $this->isfounder ? 1 : -2; + + } elseif($_G['setting']['adminipaccess'] && !ipaccess($_G['clientip'], $_G['setting']['adminipaccess'])) { + $this->do_user_login(); + + } elseif ($session && empty($session['uid'])) { + $this->cpaccess = 1; + + } elseif ($session['dateline'] < $this->sessionlimit) { + $this->cpaccess = 1; + + } elseif ($this->cpsetting['checkip'] && ($session['ip'] != $this->core->var['clientip'])) { + $this->cpaccess = 1; + $_G['admincp_checkip_noaccess'] = 1; + + } elseif ($session['errorcount'] >= 0 && $session['errorcount'] <= 3) { + $this->cpaccess = 2; + + } elseif ($session['errorcount'] == -1) { + $this->cpaccess = 3; + + } else { + $this->cpaccess = -1; + } + } + + if($this->cpaccess == 2 || $this->cpaccess == 3) { + if(!empty($session['customperm'])) { + $session['customperm'] = dunserialize($session['customperm']); + } + } + + $this->adminsession = $session; + + if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['admin_password'])) { + if($this->cpaccess == 2) { + $this->check_admin_login(); + } elseif($this->cpaccess == 0) { + $this->check_user_login(); + } + } + + if($this->cpaccess == 1) { + C::t('common_admincp_session')->delete_session($this->adminuser['uid'], $this->panel, $this->sessionlife); + C::t('common_admincp_session')->insert(array( + 'uid' => $this->adminuser['uid'], + 'adminid' => $this->adminuser['adminid'], + 'panel' => $this->panel, + 'ip' => $this->core->var['clientip'], + 'dateline' => TIMESTAMP, + 'errorcount' => 0, + )); + } elseif ($this->cpaccess == 3) { + $this->load_admin_perms(); + C::t('common_admincp_session')->update_session($this->adminuser['uid'], $this->panel, array('dateline' => TIMESTAMP, 'ip' => $this->core->var['clientip'], 'errorcount' => -1)); + } + + if($this->cpaccess != 3) { + $this->do_user_login(); + } + + } + + function check_admin_login() { + global $_G; + if((empty($_POST['admin_questionid']) || empty($_POST['admin_answer'])) && ($_G['config']['admincp']['forcesecques'] || $_G['group']['forcesecques'])) { + $this->do_user_login(); + } + loaducenter(); + $ucresult = uc_user_login($this->adminuser['uid'], $_POST['admin_password'], 1, 1, $_POST['admin_questionid'], $_POST['admin_answer'], $this->core->var['clientip']); + if($ucresult[0] > 0) { + C::t('common_admincp_session')->update_session($this->adminuser['uid'], $this->panel, array('dateline' => TIMESTAMP, 'ip' => $this->core->var['clientip'], 'errorcount' => -1)); + dheader('Location: '.ADMINSCRIPT.'?'.cpurl('url', array('sid'))); + } else { + $errorcount = $this->adminsession['errorcount'] + 1; + C::t('common_admincp_session')->update_session($this->adminuser['uid'], $this->panel, array('dateline' => TIMESTAMP, 'ip' => $this->core->var['clientip'], 'errorcount' => $errorcount)); + } + } + + function check_user_login() { + global $_G; + $admin_username = isset($_POST['admin_username']) ? trim($_POST['admin_username']) : ''; + if($admin_username != '') { + + require_once libfile('function/member'); + if(logincheck($_POST['admin_username'])) { + if((empty($_POST['admin_questionid']) || empty($_POST['admin_answer'])) && ($_G['config']['admincp']['forcesecques'] || $_G['group']['forcesecques'])) { + $this->do_user_login(); + } + $result = userlogin($_POST['admin_username'], $_POST['admin_password'], $_POST['admin_questionid'], $_POST['admin_answer'], 'username', $this->core->var['clientip']); + if($result['status'] == 1) { + $cpgroupid = C::t('common_admincp_member')->fetch($result['member']['uid']); + $cpgroupid = $cpgroupid['uid']; + if($cpgroupid || $this->checkfounder($result['member'])) { + C::t('common_admincp_session')->insert(array( + 'uid' =>$result['member']['uid'], + 'adminid' =>$result['member']['adminid'], + 'panel' =>$this->panel, + 'dateline' => TIMESTAMP, + 'ip' => $this->core->var['clientip'], + 'errorcount' => -1), false, true); + + setloginstatus($result['member'], 0); + dheader('Location: '.ADMINSCRIPT.'?'.cpurl('url', array('sid'))); + } else { + $this->cpaccess = -2; + } + } else { + loginfailed($_POST['admin_username']); + } + } else { + $this->cpaccess = -4; + } + } + } + + function allow($action, $operation, $do) { + + if($this->perms === null) { + $this->load_admin_perms(); + } + + if(isset($this->perms['all'])) { + return $this->perms['all']; + } + + if(!empty($_POST) && !array_key_exists('_allowpost', $this->perms) && $action.'_'.$operation != 'misc_custommenu') { + return false; + } + $this->perms['misc_custommenu'] = 1; + + $key = $action; + if(isset($this->perms[$key])) { + return $this->perms[$key]; + } + $key = $action.'_'.$operation; + if(isset($this->perms[$key])) { + return $this->perms[$key]; + } + $key = $action.'_'.$operation.'_'.$do; + if(isset($this->perms[$key])) { + return $this->perms[$key]; + } + return false; + } + + function load_admin_perms() { + + $this->perms = array(); + if(!$this->isfounder) { + if($this->adminsession['cpgroupid']) { + foreach(C::t('common_admincp_perm')->fetch_all_by_cpgroupid($this->adminsession['cpgroupid']) as $perm) { + if(empty($this->adminsession['customperm'])) { + $this->perms[$perm['perm']] = true; + } elseif(!in_array($perm['perm'], (array)$this->adminsession['customperm'])) { + $this->perms[$perm['perm']] = true; + } + } + } else { + $this->perms['all'] = true; + } + } else { + $this->perms['all'] = true; + } + } + + function checkfounder($user) { + + $founders = str_replace(' ', '', $this->cpsetting['founder']); + if(!$user['uid'] || $user['groupid'] != 1 || $user['adminid'] != 1) { + return false; + } elseif(empty($founders)) { + return true; + } elseif(strexists(",$founders,", ",{$user['uid']},")) { + return true; + } elseif(!is_numeric($user['username']) && strexists(",$founders,", ",{$user['username']},")) { + return true; + } else { + return FALSE; + } + } + + function do_user_login() { + require $this->admincpfile('login'); + } + + function do_admin_logout() { + C::t('common_admincp_session')->delete_session($this->adminuser['uid'], $this->panel, $this->sessionlife); + } + + function admincpfile($action) { + return DISCUZ_ROOT.'./source/admincp/admincp_'.$action.'.php'; + } + + function show_admincp_main() { + $this->do_request('main'); + } + + function show_no_access() { + cpheader(); + cpmsg('action_noaccess', '', 'error'); + cpfooter(); + } + + function do_request($action) { + + global $_G; + + $lang = lang('admincp'); + $title = 'cplog_'.getgpc('action').(getgpc('operation') ? '_'.getgpc('operation') : ''); + $operation = getgpc('operation'); + $do = getgpc('do'); + $sid = $_G['sid']; + $isfounder = $this->isfounder; + if($action == 'main' || $this->allow($action, $operation, $do)) { + require DISCUZ_ROOT.'./source/admincp/admincp_'.$action.'.php'; + } else { + cpheader(); + cpmsg('action_noaccess', '', 'error'); + } + } +} \ No newline at end of file diff --git a/source/class/discuz/discuz_application.php b/source/class/discuz/discuz_application.php new file mode 100644 index 0000000..eaeaaac --- /dev/null +++ b/source/class/discuz/discuz_application.php @@ -0,0 +1,905 @@ + 1, + '_GET' => 1, + '_POST' => 1, + '_REQUEST' => 1, + '_COOKIE' => 1, + '_SERVER' => 1, + '_ENV' => 1, + '_FILES' => 1, + ); + + static function &instance() { + static $object; + if(empty($object)) { + $object = new self(); + } + return $object; + } + + public function __construct() { + $this->_init_cnf(); + $this->_init_env(); + $this->_init_config(); + $this->_init_input(); + $this->_init_output(); + } + + public function init() { + if(!$this->initated) { + $this->_init_db(); + $this->_init_setting(); + $this->_init_user(); + $this->_init_session(); + $this->_init_mobile(); + $this->_init_cron(); + $this->_init_misc(); + } + $this->initated = true; + } + + private function _init_env() { + + error_reporting(E_ERROR); + + define('ICONV_ENABLE', function_exists('iconv')); + define('MB_ENABLE', function_exists('mb_convert_encoding')); + define('EXT_OBGZIP', function_exists('ob_gzhandler')); + + define('TIMESTAMP', time()); + $this->timezone_set(); + + if(!defined('DISCUZ_CORE_FUNCTION') && !@include(DISCUZ_ROOT.'./source/function/function_core.php')) { + exit('function_core.php is missing'); + } + + if(function_exists('ini_get')) { + $memorylimit = @ini_get('memory_limit'); + if($memorylimit && return_bytes($memorylimit) < 33554432 && function_exists('ini_set')) { + ini_set('memory_limit', '128m'); + } + } + + define('IS_ROBOT', checkrobot()); + + foreach ($GLOBALS as $key => $value) { + if (!isset($this->superglobal[$key])) { + $GLOBALS[$key] = null; unset($GLOBALS[$key]); + } + } + + if(!defined('APPTYPEID')) { + define('APPTYPEID', 0); + } + + if(!defined('CURSCRIPT')) { + define('CURSCRIPT', null); + } + + global $_G; + $_G = array( + 'uid' => 0, + 'username' => '', + 'adminid' => 0, + 'groupid' => 1, + 'sid' => '', + 'formhash' => '', + 'connectguest' => 0, + 'timestamp' => TIMESTAMP, + 'starttime' => microtime(true), + 'clientip' => $this->_get_client_ip(), + 'remoteport' => $_SERVER['REMOTE_PORT'], + 'referer' => '', + 'charset' => '', + 'gzipcompress' => '', + 'authkey' => '', + 'timenow' => array(), + 'widthauto' => 0, + 'disabledwidthauto' => 0, + + 'PHP_SELF' => '', + 'siteurl' => '', + 'siteroot' => '', + 'siteport' => '', + + 'pluginrunlist' => !defined('PLUGINRUNLIST') ? array() : explode(',', PLUGINRUNLIST), + + 'config' => & $this->config, + 'setting' => array(), + 'member' => array(), + 'group' => array(), + 'cookie' => array(), + 'style' => array(), + 'cache' => array(), + 'session' => array(), + 'lang' => array(), + + 'fid' => 0, + 'tid' => 0, + 'forum' => array(), + 'thread' => array(), + 'rssauth' => '', + + 'home' => array(), + 'space' => array(), + + 'block' => array(), + 'article' => array(), + + 'action' => array( + 'action' => APPTYPEID, + 'fid' => 0, + 'tid' => 0, + ), + + 'mobile' => '', + 'notice_structure' => array( + 'mypost' => array('post','rate','pcomment','activity','reward','goods','at'), + 'interactive' => array('poke','friend','wall','comment','click','sharenotice'), + 'system' => array('system','credit','group','verify','magic','task','show','group','pusearticle','mod_member','blog','article'), + 'manage' => array('mod_member','report','pmreport'), + 'app' => array(), + ), + 'mobiletpl' => array('1' => 'touch', '2' => 'touch', '3' => 'touch', 'yes' => 'touch'), + ); + $_G['PHP_SELF'] = dhtmlspecialchars($this->_get_script_url()); + $_G['basescript'] = CURSCRIPT; + $_G['basefilename'] = basename($_G['PHP_SELF']); + $sitepath = substr($_G['PHP_SELF'], 0, strrpos($_G['PHP_SELF'], '/')); + if(defined('IN_API')) { + $sitepath = preg_replace("/\/api\/?.*?$/i", '', $sitepath); + } elseif(defined('IN_ARCHIVER')) { + $sitepath = preg_replace("/\/archiver/i", '', $sitepath); + } + if(defined('IN_NEWMOBILE')) { + $sitepath = preg_replace("/\/m/i", '', $sitepath); + } + $_G['isHTTPS'] = $this->_is_https(); + $_G['scheme'] = 'http'.($_G['isHTTPS'] ? 's' : ''); + $_G['siteurl'] = dhtmlspecialchars($_G['scheme'].'://'.$_SERVER['HTTP_HOST'].$sitepath.'/'); + + $url = parse_url($_G['siteurl']); + $_G['siteroot'] = isset($url['path']) ? $url['path'] : ''; + $_G['siteport'] = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' || $_SERVER['SERVER_PORT'] == '443' ? '' : ':'.$_SERVER['SERVER_PORT']; + + if(defined('SUB_DIR')) { + $_G['siteurl'] = str_replace(SUB_DIR, '/', $_G['siteurl']); + $_G['siteroot'] = str_replace(SUB_DIR, '/', $_G['siteroot']); + } + + $this->var = & $_G; + + } + + private function _get_script_url() { + if(!isset($this->var['PHP_SELF'])){ + $scriptName = basename($_SERVER['SCRIPT_FILENAME']); + if(basename($_SERVER['SCRIPT_NAME']) === $scriptName) { + $this->var['PHP_SELF'] = $_SERVER['SCRIPT_NAME']; + } else if(basename($_SERVER['PHP_SELF']) === $scriptName) { + $this->var['PHP_SELF'] = $_SERVER['PHP_SELF']; + } else if(isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME']) === $scriptName) { + $this->var['PHP_SELF'] = $_SERVER['ORIG_SCRIPT_NAME']; + } else if(($pos = strpos($_SERVER['PHP_SELF'],'/'.$scriptName)) !== false) { + $this->var['PHP_SELF'] = substr($_SERVER['SCRIPT_NAME'],0,$pos).'/'.$scriptName; + } else if(isset($_SERVER['DOCUMENT_ROOT']) && strpos($_SERVER['SCRIPT_FILENAME'],$_SERVER['DOCUMENT_ROOT']) === 0) { + $this->var['PHP_SELF'] = str_replace('\\','/',str_replace($_SERVER['DOCUMENT_ROOT'],'',$_SERVER['SCRIPT_FILENAME'])); + $this->var['PHP_SELF'][0] != '/' && $this->var['PHP_SELF'] = '/'.$this->var['PHP_SELF']; + } else { + system_error('request_tainting'); + } + } + return $this->var['PHP_SELF']; + } + + private function _init_input() { + if (isset($_GET['GLOBALS']) ||isset($_POST['GLOBALS']) || isset($_COOKIE['GLOBALS']) || isset($_FILES['GLOBALS'])) { + system_error('request_tainting'); + } + + $prelength = strlen($this->config['cookie']['cookiepre']); + foreach($_COOKIE as $key => $val) { + if(substr($key, 0, $prelength) == $this->config['cookie']['cookiepre']) { + $this->var['cookie'][substr($key, $prelength)] = $val; + } + } + + + if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST)) { + $_GET = array_merge($_GET, $_POST); + } + + if(isset($_GET['page'])) { + $_GET['page'] = rawurlencode($_GET['page']); + } + + if(!(!empty($_GET['handlekey']) && preg_match('/^\w+$/', $_GET['handlekey']))) { + unset($_GET['handlekey']); + } + + if(!empty($this->var['config']['input']['compatible']) && !defined('DISCUZ_DEPRECATED')) { + foreach($_GET as $k => $v) { + $this->var['gp_'.$k] = daddslashes($v); + } + } + + $this->var['mod'] = empty($_GET['mod']) ? '' : dhtmlspecialchars($_GET['mod']); + $this->var['inajax'] = empty($_GET['inajax']) ? 0 : (empty($this->var['config']['output']['ajaxvalidate']) ? 1 : ($_SERVER['REQUEST_METHOD'] == 'GET' && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || $_SERVER['REQUEST_METHOD'] == 'POST' ? 1 : 0)); + $this->var['page'] = empty($_GET['page']) ? 1 : max(1, intval($_GET['page'])); + $this->var['sid'] = $this->var['cookie']['sid'] = isset($this->var['cookie']['sid']) ? dhtmlspecialchars($this->var['cookie']['sid']) : ''; + + if(empty($this->var['cookie']['saltkey'])) { + $this->var['cookie']['saltkey'] = random(8); + dsetcookie('saltkey', $this->var['cookie']['saltkey'], 86400 * 30, 1, 1); + } + $this->var['authkey'] = md5($this->var['config']['security']['authkey'].$this->var['cookie']['saltkey']); + + } + + private function _init_cnf() { + + $_config = array(); + @include DISCUZ_ROOT.'./config/config_global.php'; + if(empty($_config)) { + if(!file_exists(DISCUZ_ROOT.'./data/install.lock')) { + header('location: install/'); + exit; + } else { + system_error('config_notfound'); + } + } + + $this->config = & $_config; + + } + + private function _init_config() { + + if(empty($this->var['config']['security']['authkey'])) { + $this->var['config']['security']['authkey'] = md5($this->var['config']['cookie']['cookiepre'].$this->var['config']['db'][1]['dbname']); + } + + if(empty($this->var['config']['debug']) || !file_exists(libfile('function/debug'))) { + define('DISCUZ_DEBUG', false); + error_reporting(0); + } elseif($this->var['config']['debug'] === 1 || $this->var['config']['debug'] === 2 || !empty($_REQUEST['debug']) && $_REQUEST['debug'] === $this->var['config']['debug']) { + define('DISCUZ_DEBUG', true); + error_reporting(E_ERROR); + if($this->var['config']['debug'] === 2) { + error_reporting(E_ALL); + } + } else { + define('DISCUZ_DEBUG', false); + error_reporting(0); + } + + if(!empty($this->var['config']['deprecated'])) { + define('DISCUZ_DEPRECATED', $this->var['config']['deprecated']); + } + + define('STATICURL', !empty($this->var['config']['output']['staticurl']) ? $this->var['config']['output']['staticurl'] : 'static/'); + $this->var['staticurl'] = STATICURL; + + if(substr($this->var['config']['cookie']['cookiepath'], 0, 1) != '/') { + $this->var['config']['cookie']['cookiepath'] = '/'.$this->var['config']['cookie']['cookiepath']; + } + $this->var['config']['cookie']['cookiepre'] = $this->var['config']['cookie']['cookiepre'].substr(md5($this->var['config']['cookie']['cookiepath'].'|'.$this->var['config']['cookie']['cookiedomain']), 0, 4).'_'; + + + } + + private function _init_output() { + + + if($this->config['security']['attackevasive'] && (!defined('CURSCRIPT') || !in_array($this->var['mod'], array('seccode', 'secqaa', 'swfupload')) && !defined('DISABLEDEFENSE'))) { + require_once libfile('misc/security', 'include'); + } + + if(!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === false) { + $this->config['output']['gzip'] = false; + } + + $allowgzip = $this->config['output']['gzip'] && empty($this->var['inajax']) && $this->var['mod'] != 'attachment' && EXT_OBGZIP; + setglobal('gzipcompress', $allowgzip); + + if(!ob_start($allowgzip ? 'ob_gzhandler' : null)) { + ob_start(); + } + + setglobal('charset', $this->config['output']['charset']); + define('CHARSET', $this->config['output']['charset']); + if($this->config['output']['forceheader']) { + @header('Content-Type: text/html; charset='.CHARSET); + } + + if($this->var['isHTTPS'] && isset($this->config['output']['upgradeinsecure']) && $this->config['output']['upgradeinsecure']) { + @header('Content-Security-Policy: upgrade-insecure-requests'); + } + + } + + public function reject_robot() { + if(IS_ROBOT) { + exit(header("HTTP/1.1 403 Forbidden")); + } + } + + private function _xss_check() { + + static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING'); + + if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) { + if(defined('CURMODULE') && constant('CURMODULE') == 'logging' && isset($_GET['action']) && $_GET['action'] == 'logout') { + header("HTTP/1.1 302 Found"); + header("Location: index.php"); + exit(); + } else { + system_error('request_tainting'); + } + } + + if($_SERVER['REQUEST_METHOD'] == 'GET' ) { + $temp = $_SERVER['REQUEST_URI']; + } elseif(empty ($_GET['formhash'])) { + $temp = $_SERVER['REQUEST_URI'].http_build_query($_POST); + } else { + $temp = ''; + } + + if(!empty($temp)) { + $temp = strtoupper(urldecode(urldecode($temp))); + foreach ($check as $str) { + if(strpos($temp, $str) !== false) { + system_error('request_tainting'); + } + } + } + + return true; + } + + private function _is_https() { + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { + return true; + } + return false; + } + + private function _get_client_ip() { + $ip = $_SERVER['REMOTE_ADDR']; + if (!array_key_exists('security', $this->config) || !$this->config['security']['onlyremoteaddr']) { + if (array_key_exists('ipgetter', $this->config) && !empty($this->config['ipgetter']['setting'])) { + $s = empty($this->config['ipgetter'][$this->config['ipgetter']['setting']]) ? array() : $this->config['ipgetter'][$this->config['ipgetter']['setting']]; + $c = 'ip_getter_'.$this->config['ipgetter']['setting']; + $r = $c::get($s); + $ip = ip::validate_ip($r) ? $r : $ip; + } elseif (isset($_SERVER['HTTP_CLIENT_IP']) && ip::validate_ip($_SERVER['HTTP_CLIENT_IP'])) { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ",") > 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + } + return $ip; + } + + private function _init_db() { + if($this->init_db) { + $driver = 'db_driver_mysqli'; + if(getglobal('config/db/slave')) { + $driver = 'db_driver_mysqli_slave'; + } + DB::init($driver, $this->config['db']); + } + } + + private function _init_session() { + + $sessionclose = !empty($this->var['setting']['sessionclose']); + $this->session = $sessionclose ? new discuz_session_close() : new discuz_session(); + + if($this->init_session) { + $this->session->init($this->var['cookie']['sid'], $this->var['clientip'], $this->var['uid']); + $this->var['sid'] = $this->session->sid; + $this->var['session'] = $this->session->var; + + if(isset($this->var['sid']) && $this->var['sid'] !== $this->var['cookie']['sid']) { + dsetcookie('sid', $this->var['sid'], 86400); + } + + if(ip::checkbanned($this->var['clientip'])) { + $this->session->set('groupid', 6); + } + + if($this->session->get('groupid') == 6) { + $this->var['member']['groupid'] = 6; + if(!defined('IN_MOBILE_API')) { + sysmessage('user_banned'); + } else { + mobile_core::result(array('error' => 'user_banned')); + } + } + + if($this->var['uid'] && !$sessionclose && ($this->session->isnew || ($this->session->get('lastactivity') + 600) < TIMESTAMP)) { + $this->session->set('lastactivity', TIMESTAMP); + if($this->session->isnew) { + if($this->var['member']['lastip'] && $this->var['member']['lastvisit']) { + dsetcookie('lip', $this->var['member']['lastip'].','.$this->var['member']['lastvisit']); + } + C::t('common_member_status')->update($this->var['uid'], array('lastip' => $this->var['clientip'], 'port' => $this->var['remoteport'], 'lastvisit' => TIMESTAMP)); + } + } + + } + } + + private function _init_user() { + if($this->init_user) { + if($auth = getglobal('auth', 'cookie')) { + $auth = daddslashes(explode("\t", authcode($auth, 'DECODE'))); + } + list($discuz_pw, $discuz_uid) = empty($auth) || count($auth) < 2 ? array('', '') : $auth; + + if($discuz_uid) { + $user = getuserbyuid($discuz_uid, 1); + } + + if(!empty($user) && $user['password'] == $discuz_pw) { + if(isset($user['_inarchive'])) { + C::t('common_member_archive')->move_to_master($discuz_uid); + } + $this->var['member'] = $user; + } else { + $user = array(); + $this->_init_guest(); + } + + if($user && $user['groupexpiry'] > 0 && $user['groupexpiry'] < TIMESTAMP) { + $memberfieldforum = C::t('common_member_field_forum')->fetch($discuz_uid); + $groupterms = dunserialize($memberfieldforum['groupterms']); + if(!empty($groupterms['main'])) { + if($groupterms['main']['groupid']) { + $user['groupid'] = $groupterms['main']['groupid']; + } else { + $groupnew = C::t('common_usergroup')->fetch_by_credits($user['credits']); + $user['groupid'] = $groupnew['groupid']; + } + $user['adminid'] = $groupterms['main']['adminid']; + C::t("common_member")->update($user['uid'], array('groupexpiry'=> 0, 'groupid' => $user['groupid'], 'adminid' => $user['adminid'])); + unset($groupterms['main'], $groupterms['ext'][$this->var['member']['groupid']]); + $this->var['member'] = $user; + C::t('common_member_field_forum')->update($discuz_uid, array('groupterms' => serialize($groupterms))); + } elseif((getgpc('mod') != 'spacecp' || CURSCRIPT != 'home') && CURSCRIPT != 'member') { + dheader('location: home.php?mod=spacecp&ac=usergroup&do=expiry'); + } + } + + if($user && $user['freeze'] && (getgpc('mod') != 'spacecp' && getgpc('mod') != 'misc' || CURSCRIPT != 'home') && CURSCRIPT != 'member' && CURSCRIPT != 'misc') { + dheader('location: home.php?mod=spacecp&ac=profile&op=password'); + } + + $this->cachelist[] = 'usergroup_'.$this->var['member']['groupid']; + if($user && $user['adminid'] > 0 && $user['groupid'] != $user['adminid']) { + $this->cachelist[] = 'admingroup_'.$this->var['member']['adminid']; + } + + } else { + $this->_init_guest(); + } + setglobal('groupid', getglobal('groupid', 'member')); + !empty($this->cachelist) && loadcache($this->cachelist); + + if($this->var['member'] && $this->var['group']['radminid'] == 0 && $this->var['member']['adminid'] > 0 && $this->var['member']['groupid'] != $this->var['member']['adminid'] && !empty($this->var['cache']['admingroup_'.$this->var['member']['adminid']])) { + $this->var['group'] = array_merge($this->var['group'], $this->var['cache']['admingroup_'.$this->var['member']['adminid']]); + } + + if(!empty($this->var['group']['allowmakehtml']) && isset($_GET['_makehtml'])) { + $this->var['makehtml'] = 1; + $this->_init_guest(); + loadcache(array('usergroup_7')); + $this->var['group'] = $this->var['cache']['usergroup_7']; + unset($this->var['inajax']); + } + + if(empty($this->var['cookie']['lastvisit'])) { + $this->var['member']['lastvisit'] = TIMESTAMP - 3600; + dsetcookie('lastvisit', TIMESTAMP - 3600, 86400 * 30); + } else { + $this->var['member']['lastvisit'] = $this->var['cookie']['lastvisit']; + } + + setglobal('uid', getglobal('uid', 'member')); + setglobal('username', getglobal('username', 'member')); + setglobal('adminid', getglobal('adminid', 'member')); + setglobal('groupid', getglobal('groupid', 'member')); + if(!empty($this->var['member']['newprompt'])) { + $this->var['member']['newprompt_num'] = C::t('common_member_newprompt')->fetch($this->var['member']['uid']); + $this->var['member']['newprompt_num'] = dunserialize($this->var['member']['newprompt_num']['data']); + $this->var['member']['category_num'] = helper_notification::get_categorynum($this->var['member']['newprompt_num']); + } + + } + + private function _init_guest() { + $username = ''; + $groupid = 7; + if(!empty($this->var['cookie']['con_auth_hash']) && ($openid = authcode($this->var['cookie']['con_auth_hash']))) { + $this->var['connectguest'] = 1; + $username = 'QQ_'.substr($openid, -6); + $this->var['setting']['cacheindexlife'] = 0; + $this->var['setting']['cachethreadlife'] = 0; + $groupid = $this->var['setting']['connect']['guest_groupid'] ? $this->var['setting']['connect']['guest_groupid'] : $this->var['setting']['newusergroupid']; + } + setglobal('member', array( 'uid' => 0, 'username' => $username, 'adminid' => 0, 'groupid' => $groupid, 'credits' => 0, 'timeoffset' => 9999)); + } + + private function _init_cron() { + $ext = empty($this->config['remote']['on']) || empty($this->config['remote']['cron']) || APPTYPEID == 200; + if($this->init_cron && $this->init_setting && $ext) { + if($this->var['cache']['cronnextrun'] <= TIMESTAMP) { + discuz_cron::run(); + } + } + } + + private function _init_misc() { + + if($this->config['security']['urlxssdefend'] && !defined('DISABLEXSSCHECK')) { + $this->_xss_check(); + } + + if(!$this->init_misc) { + return false; + } + lang('core'); + + if($this->init_setting && $this->init_user) { + if(!isset($this->var['member']['timeoffset']) || $this->var['member']['timeoffset'] == 9999 || $this->var['member']['timeoffset'] === '') { + $this->var['member']['timeoffset'] = $this->var['setting']['timeoffset']; + } + } + + $timeoffset = $this->init_setting ? $this->var['member']['timeoffset'] : $this->var['setting']['timeoffset']; + $this->var['timenow'] = array( + 'time' => dgmdate(TIMESTAMP), + 'offset' => $timeoffset >= 0 ? ($timeoffset == 0 ? '' : '+'.$timeoffset) : $timeoffset + ); + $this->timezone_set($timeoffset); + + $this->var['formhash'] = formhash(); + define('FORMHASH', $this->var['formhash']); + + if($this->init_user) { + $allowvisitflag = in_array(CURSCRIPT, array('member')) || defined('ALLOWGUEST') && ALLOWGUEST; + if($this->var['group'] && isset($this->var['group']['allowvisit']) && !$this->var['group']['allowvisit']) { + if($this->var['uid'] && !$allowvisitflag) { + if(!defined('IN_MOBILE_API')) { + ($this->var['member']['groupexpiry'] > 0) ? showmessage('user_banned_has_expiry', '', array('expiry' => dgmdate($this->var['member']['groupexpiry'], 'Y-m-d H:i:s'))) : showmessage('user_banned'); + } else { + ($this->var['member']['groupexpiry'] > 0) ? mobile_core::result(array('error' => 'user_banned_has_expiry')) : mobile_core::result(array('error' => 'user_banned')); + } + } elseif((!defined('ALLOWGUEST') || !ALLOWGUEST) && !in_array(CURSCRIPT, array('member', 'api'))) { + if(defined('IN_ARCHIVER')) { + dheader('location: ../member.php?mod=logging&action=login&referer='.rawurlencode($this->var['siteurl']."archiver/".$this->var['basefilename'].($_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : ''))); + } else if(!defined('IN_MOBILE_API')) { + dheader('location: member.php?mod=logging&action=login&referer='.rawurlencode($this->var['siteurl'].$this->var['basefilename'].($_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : ''))); + } else { + mobile_core::result(array('error' => 'to_login')); + } + } + } + if(isset($this->var['member']['status']) && $this->var['member']['status'] == -1 && !$allowvisitflag) { + if(!defined('IN_MOBILE_API')) { + showmessage('user_banned'); + } else { + mobile_core::result(array('error' => 'user_banned')); + } + } + } + + if($this->var['setting']['ipaccess'] && !ipaccess($this->var['clientip'], $this->var['setting']['ipaccess'])) { + if(!defined('IN_MOBILE_API')) { + showmessage('user_banned'); + } else { + mobile_core::result(array('error' => 'user_banned')); + } + } + + if($this->var['setting']['bbclosed']) { + if($this->var['uid'] && ($this->var['group']['allowvisit'] == 2 || $this->var['groupid'] == 1)) { + } elseif(in_array(CURSCRIPT, array('admin', 'member', 'api')) || defined('ALLOWGUEST') && ALLOWGUEST) { + } else { + $closedreason = C::t('common_setting')->fetch_setting('closedreason'); + $closedreason = str_replace(':', ':', $closedreason); + if(!defined('IN_MOBILE_API')) { + showmessage($closedreason ? $closedreason : 'board_closed', NULL, array('adminemail' => $this->var['setting']['adminemail']), array('login' => 1)); + } else { + mobile_core::result(array('error' => $closedreason ? $closedreason : 'board_closed')); + } + } + } + + if(CURSCRIPT != 'admin' && !(in_array($this->var['mod'], array('logging', 'seccode')))) { + periodscheck('visitbanperiods'); + } + + if(defined('IN_MOBILE')) { + $this->var['tpp'] = $this->var['setting']['mobile']['forum']['topicperpage'] ? intval($this->var['setting']['mobile']['forum']['topicperpage']) : ($this->var['setting']['topicperpage'] ? intval($this->var['setting']['topicperpage']) : 20); + $this->var['ppp'] = $this->var['setting']['mobile']['forum']['postperpage'] ? intval($this->var['setting']['mobile']['forum']['postperpage']) : ($this->var['setting']['postperpage'] ? intval($this->var['setting']['postperpage']) : 10); + } else { + $this->var['tpp'] = $this->var['setting']['topicperpage'] ? intval($this->var['setting']['topicperpage']) : 20; + $this->var['ppp'] = $this->var['setting']['postperpage'] ? intval($this->var['setting']['postperpage']) : 10; + } + + if($this->var['setting']['nocacheheaders']) { + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + } + + if($this->session->isnew && $this->var['uid']) { + updatecreditbyaction('daylogin', $this->var['uid']); + + include_once libfile('function/stat'); + updatestat('login', 1); + if(defined('IN_MOBILE')) { + updatestat('mobilelogin', 1); + } + if($this->var['setting']['connect']['allow'] && $this->var['member']['conisbind']) { + updatestat('connectlogin', 1); + } + } + if(isset($this->var['member']['conisbind']) && $this->var['member']['conisbind'] && $this->var['setting'] && $this->var['setting']['connect']['newbiespan'] !== '') { + $this->var['setting']['newbiespan'] = $this->var['setting']['connect']['newbiespan']; + } + + $lastact = TIMESTAMP."\t".dhtmlspecialchars(basename($this->var['PHP_SELF']))."\t".dhtmlspecialchars($this->var['mod']); + dsetcookie('lastact', $lastact, 86400); + setglobal('currenturl_encode', base64_encode($this->var['scheme'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])); + + if((!empty($_GET['fromuid']) || !empty($_GET['fromuser'])) && ($this->var['setting']['creditspolicy']['promotion_visit'] || $this->var['setting']['creditspolicy']['promotion_register'])) { + require_once libfile('misc/promotion', 'include'); + } + + $this->var['seokeywords'] = !empty($this->var['setting']['seokeywords'][CURSCRIPT]) ? $this->var['setting']['seokeywords'][CURSCRIPT] : ''; + $this->var['seodescription'] = !empty($this->var['setting']['seodescription'][CURSCRIPT]) ? $this->var['setting']['seodescription'][CURSCRIPT] : ''; + + } + + private function _init_setting() { + if($this->init_setting) { + if(empty($this->var['setting'])) { + $this->cachelist[] = 'setting'; + } + + if(empty($this->var['style'])) { + $this->cachelist[] = 'style_default'; + } + + if(!isset($this->var['cache']['cronnextrun'])) { + $this->cachelist[] = 'cronnextrun'; + } + } + + !empty($this->cachelist) && loadcache($this->cachelist); + + if(!is_array($this->var['setting']) && !is_a($this->var['setting'], 'memory_setting_array')) { + $this->var['setting'] = array(); + } + + } + + public function _init_style() { + if(defined('IN_MOBILE')) { + $mobile = max(1, intval(IN_MOBILE)); + if($mobile && $this->var['setting']['styleid'.$mobile]) { + $styleid = $this->var['setting']['styleid'.$mobile]; + } + } else { + $styleid = !empty($this->var['cookie']['styleid']) ? $this->var['cookie']['styleid'] : 0; + + if(intval(!empty($this->var['forum']['styleid']))) { + $this->var['cache']['style_default']['styleid'] = $styleid = $this->var['forum']['styleid']; + } elseif(intval(!empty($this->var['category']['styleid']))) { + $this->var['cache']['style_default']['styleid'] = $styleid = $this->var['category']['styleid']; + } + } + + if(defined('IN_NEWMOBILE') && $this->var['setting']['mobile']['allowmnew'] && $this->var['setting']['styleid2']) { + $styleid = $this->var['setting']['styleid2']; + } + + $styleid = intval($styleid); + + if($styleid && $styleid != $this->var['setting']['styleid']) { + loadcache('style_'.$styleid); + if($this->var['cache']['style_'.$styleid]) { + $this->var['style'] = $this->var['cache']['style_'.$styleid]; + } + } + + define('IMGDIR', $this->var['style']['imgdir']); + define('STYLEID', $this->var['style']['styleid']); + define('VERHASH', $this->var['style']['verhash']); + define('TPLDIR', $this->var['style']['tpldir']); + define('TEMPLATEID', $this->var['style']['templateid']); + } + + private function _init_mobile() { + if(!$this->init_mobile) { + if(!defined('HOOKTYPE')) { + define('HOOKTYPE', 'hookscript'); + } + return false; + } + + if(!$this->var['setting'] || !$this->var['setting']['mobile']['allowmobile'] || !is_array($this->var['setting']['mobile'])) { + $nomobile = true; + $unallowmobile = true; + } + + if(getgpc('forcemobile')) { + dsetcookie('dismobilemessage', '1', 3600); + } + + $mobile = getgpc('mobile'); + if(!getgpc('mobile') && getgpc('showmobile')) { + $mobile = getgpc('showmobile'); + } + $mobileflag = isset($this->var['mobiletpl'][$mobile]); + if($mobile === 'no') { + dsetcookie('mobile', 'no', 3600); + $nomobile = true; + } elseif(isset($this->var['cookie']['mobile']) && $this->var['cookie']['mobile'] == 'no' && $mobileflag) { + checkmobile(); + dsetcookie('mobile', ''); + } elseif(isset($this->var['cookie']['mobile']) && $this->var['cookie']['mobile'] == 'no') { + $nomobile = true; + } elseif(!($mobile_ = checkmobile())) { + $nomobile = true; + } + if(!$mobile || $mobile == 'yes') { + $mobile = isset($mobile_) ? $mobile_ : 2; + } + + if(!$this->var['mobile'] && empty($unallowmobile) && $mobileflag) { + if(getgpc('showmobile')) { + dheader("Location:misc.php?mod=mobile"); + } + parse_str($_SERVER['QUERY_STRING'], $query); + $query['mobile'] = 'no'; + unset($query['simpletype']); + $query_sting_tmp = http_build_query($query); + $redirect = ($this->var['setting']['domain']['app']['forum'] ? $this->var['scheme'].'://'.$this->var['setting']['domain']['app']['forum'].'/' : $this->var['siteurl']).$this->var['basefilename'].'?'.$query_sting_tmp; + dheader('Location: '.$redirect); + } + + if($nomobile || (!$this->var['setting']['mobile']['mobileforward'] && !$mobileflag)) { + if(!defined('HOOKTYPE')) { + define('HOOKTYPE', 'hookscript'); + } + if(!empty($this->var['setting']['domain']['app']['mobile']) && $_SERVER['HTTP_HOST'] == $this->var['setting']['domain']['app']['mobile'] && !empty($this->var['setting']['domain']['app']['default'])) { + dheader('Location:'.$this->var['scheme'].'://'.$this->var['setting']['domain']['app']['default'].$_SERVER['REQUEST_URI']); + return false; + } else { + return false; + } + } + + if($mobile !== '2' && $mobile !== '3' && empty($this->var['setting']['mobile']['legacy'])) { + $mobile = '2'; + } + define('IN_MOBILE', isset($this->var['mobiletpl'][$mobile]) ? $mobile : '2'); + if(!defined('HOOKTYPE')) { + define('HOOKTYPE', 'hookscriptmobile'); + } + setglobal('gzipcompress', 0); + + $arr = array(); + foreach(array_keys($this->var['mobiletpl']) as $mobiletype) { + $arr[] = '&mobile='.$mobiletype; + $arr[] = 'mobile='.$mobiletype; + } + + parse_str($_SERVER['QUERY_STRING'], $query); + $query['mobile'] = 'no'; + unset($query['simpletype']); + $query_sting_tmp = http_build_query($query); + $this->var['setting']['mobile']['nomobileurl'] = ($this->var['setting']['domain']['app']['forum'] ? $this->var['scheme'].'://'.$this->var['setting']['domain']['app']['forum'].'/' : $this->var['siteurl']).$this->var['basefilename'].'?'.$query_sting_tmp; + + $this->var['setting']['lazyload'] = 0; + + if('utf-8' != CHARSET) { + if(strtolower($_SERVER['REQUEST_METHOD']) === 'post') { + foreach($_POST AS $pk => $pv) { + if(!is_numeric($pv)) { + $_GET[$pk] = $_POST[$pk] = $this->mobile_iconv_recurrence($pv); + if(!empty($this->var['config']['input']['compatible'])) { + $this->var['gp_'.$pk] = daddslashes($_GET[$pk]); + } + } + } + } + } + + + if(!$this->var['setting']['mobile']['mobilesimpletype']) { + $this->var['setting']['imagemaxwidth'] = 224; + } + + $this->var['setting']['regstatus'] = $this->var['setting']['mobile']['mobileregister'] ? $this->var['setting']['regstatus'] : 0 ; + $this->var['setting']['avatarmethod'] = 0; + ob_start(); + } + + public function timezone_set($timeoffset = 0) { + if(function_exists('date_default_timezone_set')) { + @date_default_timezone_set('Etc/GMT'.($timeoffset > 0 ? '-' : '+').(abs($timeoffset))); + } + } + + public function mobile_iconv_recurrence($value) { + if(is_array($value)) { + foreach($value AS $key => $val) { + $value[$key] = $this->mobile_iconv_recurrence($val); + } + } else { + $value = diconv($value, 'utf-8', CHARSET); + } + return $value; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_base.php b/source/class/discuz/discuz_base.php new file mode 100644 index 0000000..46863a5 --- /dev/null +++ b/source/class/discuz/discuz_base.php @@ -0,0 +1,66 @@ +$setter($value); + } elseif($this->canGetProperty($name)) { + throw new Exception('The property "'.get_class($this).'->'.$name.'" is readonly'); + } else { + throw new Exception('The property "'.get_class($this).'->'.$name.'" is not defined'); + } + } + + public function __get($name) { + $getter='get'.$name; + if(method_exists($this,$getter)) { + return $this->$getter(); + } else { + throw new Exception('The property "'.get_class($this).'->'.$name.'" is not defined'); + } + } + + public function __call($name,$parameters) { + throw new Exception('Class "'.get_class($this).'" does not have a method named "'.$name.'".'); + } + + public function canGetProperty($name) + { + return method_exists($this,'get'.$name); + } + + public function canSetProperty($name) + { + return method_exists($this,'set'.$name); + } + + public function __toString() { + return get_class($this); + } + + public function __invoke() { + return get_class($this); + } + +} +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_block.php b/source/class/discuz/discuz_block.php new file mode 100644 index 0000000..58926ee --- /dev/null +++ b/source/class/discuz/discuz_block.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/source/class/discuz/discuz_censor.php b/source/class/discuz/discuz_censor.php new file mode 100644 index 0000000..6c10c3f --- /dev/null +++ b/source/class/discuz/discuz_censor.php @@ -0,0 +1,111 @@ +censor_words = !empty($_G['cache']['censor']) ? $_G['cache']['censor'] : array(); + $this->bbcodes_display = $_G['cache']['bbcodes_display'][$_G['groupid']]; + } + + public static function & instance() { + static $instance; + if(!$instance) { + $instance = new self(); + } + return $instance; + } + + function highlight($message, $badwords_regex) { + $color = $this->highlight; + if(empty($color)) { + return $message; + } + $message = preg_replace($badwords_regex, '\\1', $message); + return $message; + } + + function check(&$message, $modword = NULL) { + $limitnum = 500; + $this->words_found = array(); + $bbcodes = 'b|i|color|size|font|align|list|indent|email|hide|quote|code|free|table|tr|td|img|swf|attach|payto|float'.($this->bbcodes_display ? '|'.implode('|', array_keys($this->bbcodes_display)) : ''); + if(is_array($this->censor_words['banned']) && !empty($this->censor_words['banned'])) { + foreach($this->censor_words['banned'] as $banned_words) { + if(preg_match_all($banned_words, @preg_replace(array("/\[($bbcodes)=?(.*)\]/iU", "/\[\/($bbcodes)\]/i"), array('${2}', ''), $message), $matches)) { + $this->words_found = $matches[0]; + $this->result = DISCUZ_CENSOR_BANNED; + $this->words_found = array_unique($this->words_found); + $message = $this->highlight($message, $banned_words); + return DISCUZ_CENSOR_BANNED; + } + } + } + if(is_array($this->censor_words['mod']) && !empty($this->censor_words['mod'])) { + if($modword !== NULL) { + $message = preg_replace($this->censor_words['mod'], $modword, $message); + } + foreach($this->censor_words['mod'] as $mod_words) { + if(preg_match_all($mod_words, @preg_replace(array("/\[($bbcodes)=?(.*)\]/iU", "/\[\/($bbcodes)\]/i"), array('${2}', ''), $message), $matches)) { + $this->words_found = $matches[0]; + $this->result = DISCUZ_CENSOR_MODERATED; + $message = $this->highlight($message, $mod_words); + $this->words_found = array_unique($this->words_found); + return DISCUZ_CENSOR_MODERATED; + } + } + } + if(!empty($this->censor_words['filter'])) { + $i = 0; + while($find_words = array_slice($this->censor_words['filter']['find'], $i, $limitnum)) { + if(empty($find_words)) break; + $replace_words = array_slice($this->censor_words['filter']['replace'], $i, $limitnum); + $i += $limitnum; + $message = preg_replace($find_words, $replace_words, $message); + } + $this->result = DISCUZ_CENSOR_REPLACED; + return DISCUZ_CENSOR_REPLACED; + } + $this->result = DISCUZ_CENSOR_SUCCEED; + return DISCUZ_CENSOR_SUCCEED; + } + + function modbanned() { + return $this->result == DISCUZ_CENSOR_BANNED; + } + + function modmoderated() { + return $this->result == DISCUZ_CENSOR_MODERATED; + } + + function modreplaced() { + return $this->result == DISCUZ_CENSOR_REPLACED; + } + + function modsucceed() { + return $this->result == DISCUZ_CENSOR_SUCCEED; + } +} \ No newline at end of file diff --git a/source/class/discuz/discuz_container.php b/source/class/discuz/discuz_container.php new file mode 100644 index 0000000..fbcb77d --- /dev/null +++ b/source/class/discuz/discuz_container.php @@ -0,0 +1,154 @@ +_obj = $obj; + } else if(is_string($obj)) { + try { + if(func_num_args()) { + $p = func_get_args(); + unset($p[0]); + $ref = new ReflectionClass($obj); + $this->_obj = $ref->newInstanceArgs($p); + unset($ref); + } else { + $this->_obj = new $obj; + } + } catch (Exception $e) { + throw new Exception('Class "'.$obj.'" does not exists.'); + } + } + } + parent::__construct(); + } + + public function getobj() { + return $this->_obj; + } + + public function setobj($value) { + $this->_obj = $value; + } + + public function __call($name, $p) { + if(method_exists($this->_obj, $name)) { + if(isset($this->_obj->methods[$name][0])) { + $this->_call($name, $p, 0); + } + switch (count($p)) { + case 0: $this->_obj->data = $this->_obj->{$name}();break; + case 1: $this->_obj->data = $this->_obj->{$name}($p[0]);break; + case 2: $this->_obj->data = $this->_obj->{$name}($p[0], $p[1]);break; + case 3: $this->_obj->data = $this->_obj->{$name}($p[0], $p[1], $p[2]);break; + case 4: $this->_obj->data = $this->_obj->{$name}($p[0], $p[1], $p[2], $p[3]);break; + case 5: $this->_obj->data = $this->_obj->{$name}($p[0], $p[1], $p[2], $p[3], $p[4]);break; + default: $this->_obj->data = call_user_func_array(array($this->_obj, $name), $p);break; + } + if(isset($this->_obj->methods[$name][1])) { + $this->_call($name, $p, 1); + } + + return $this->_obj->data; + } else { + throw new Exception('Class "'.get_class($this->_obj).'" does not have a method named "'.$name.'".'); + } + } + + protected function _call($name, $p, $type) { + $ret = null; + if(isset($this->_obj->methods[$name][$type])) { + foreach($this->_obj->methods[$name][$type] as $extend) { + if(is_array($extend) && isset($extend['class'])) { + $obj = $this->_getobj($extend['class'], $this->_obj); + switch (count($p)) { + case 0: $ret = $obj->{$extend['method']}();break; + case 1: $ret = $obj->{$extend['method']}($p[0]);break; + case 2: $ret = $obj->{$extend['method']}($p[0], $p[1]);break; + case 3: $ret = $obj->{$extend['method']}($p[0], $p[1], $p[2]);break; + case 4: $ret = $obj->{$extend['method']}($p[0], $p[1], $p[2], $p[3]);break; + case 5: $ret = $obj->{$extend['method']}($p[0], $p[1], $p[2], $p[3], $p[4]);break; + default: $ret = call_user_func_array(array($obj, $extend['method']), $p);break; + } + } elseif(is_callable($extend, true)) { + if(is_array($extend)) { + list($obj, $method) = $extend; + if(method_exists($obj, $method)) { + if(is_object($obj)) { + $obj->obj = $this->_obj; + switch (count($p)) { + case 0: $ret = $obj->{$method}();break; + case 1: $ret = $obj->{$method}($p[0]);break; + case 2: $ret = $obj->{$method}($p[0], $p[1]);break; + case 3: $ret = $obj->{$method}($p[0], $p[1], $p[2]);break; + case 4: $ret = $obj->{$method}($p[0], $p[1], $p[2], $p[3]);break; + case 5: $ret = $obj->{$method}($p[0], $p[1], $p[2], $p[3], $p[4]);break; + default: $ret = call_user_func_array(array($obj, $method), $p);break; + } + } else { + $p[] = $this; + $ret = call_user_func_array($extend, $p); + } + }/* else { + throw new Exception('Class "'.get_class($extend[0]).'" does not have a method named "'.$extend[1].'".'); + }*/ + } else { + $p[] = $this->_obj; + $ret = call_user_func_array($extend, $p); + } + } + } + } + return $ret; + } + + protected function _getobj($class, $obj) { + if(!isset($this->_objs[$class])) { + $this->_objs[$class] = new $class($obj); + if(method_exists($this->_objs[$class], 'init_base_var')) { + $this->_objs[$class]->init_base_var(); + } + } + return $this->_objs[$class]; + } + + public function __get($name) { + if(isset($this->_obj) && property_exists($this->_obj, $name) === true) { + return $this->_obj->$name; + } else { + return parent::__get($name); + } + } + + public function __set($name, $value) { + if(isset($this->_obj) && property_exists($this->_obj, $name) === true) { + return $this->_obj->$name = $value; + } else { + return parent::__set($name, $value); + } + } + + public function __isset($name) { + return isset($this->_obj->$name); + } + +} +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_core.php b/source/class/discuz/discuz_core.php new file mode 100644 index 0000000..ea1f15c --- /dev/null +++ b/source/class/discuz/discuz_core.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/source/class/discuz/discuz_cron.php b/source/class/discuz/discuz_cron.php new file mode 100644 index 0000000..c0fe996 --- /dev/null +++ b/source/class/discuz/discuz_cron.php @@ -0,0 +1,175 @@ +fetch($cronid) : C::t('common_cron')->fetch_nextrun(TIMESTAMP); + + $processname ='DZ_CRON_'.(empty($cron) ? 'CHECKER' : $cron['cronid']); + + if($cronid && !empty($cron)) { + discuz_process::unlock($processname); + } + + if(discuz_process::islocked($processname, 600)) { + return false; + } + + if($cron) { + + $cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']); + $efile = explode(':', $cron['filename']); + if(count($efile) > 1) { + $cronfile = in_array($efile[0], $_G['setting']['plugins']['available']) ? DISCUZ_ROOT.'./source/plugin/'.$efile[0].'/cron/'.$efile[1] : ''; + } else { + $cronfile = DISCUZ_ROOT.'./source/include/cron/'.$cron['filename']; + } + + if($cronfile) { + $cron['minute'] = explode("\t", $cron['minute']); + self::setnextime($cron); + + @set_time_limit(1000); + @ignore_user_abort(TRUE); + + if(!@include $cronfile) { + return false; + } + }else{ + $data = array('available' => '0'); + C::t('common_cron')->update($cron['cronid'], $data); + } + + } + + self::nextcron(); + discuz_process::unlock($processname); + return true; + } + + private static function nextcron() { + $cron = C::t('common_cron')->fetch_nextcron(); + if($cron && isset($cron['nextrun'])) { + savecache('cronnextrun', $cron['nextrun']); + } else { + savecache('cronnextrun', TIMESTAMP + 86400 * 365); + } + return true; + } + + private static function setnextime($cron) { + + if(empty($cron)) return FALSE; + + list($yearnow, $monthnow, $daynow, $weekdaynow, $hournow, $minutenow) = explode('-', gmdate('Y-m-d-w-H-i', TIMESTAMP + getglobal('setting/timeoffset') * 3600)); + + if($cron['weekday'] == -1) { + if($cron['day'] == -1) { + $firstday = $daynow; + $secondday = $daynow + 1; + } else { + $firstday = $cron['day']; + $secondday = $cron['day'] + gmdate('t', TIMESTAMP + getglobal('setting/timeoffset') * 3600); + } + } else { + $firstday = $daynow + ($cron['weekday'] - $weekdaynow); + $secondday = $firstday + 7; + } + + if($firstday < $daynow) { + $firstday = $secondday; + } + + if($firstday == $daynow) { + $todaytime = self::todaynextrun($cron); + if($todaytime['hour'] == -1 && $todaytime['minute'] == -1) { + $cron['day'] = $secondday; + $nexttime = self::todaynextrun($cron, 0, -1); + $cron['hour'] = $nexttime['hour']; + $cron['minute'] = $nexttime['minute']; + } else { + $cron['day'] = $firstday; + $cron['hour'] = $todaytime['hour']; + $cron['minute'] = $todaytime['minute']; + } + } else { + $cron['day'] = $firstday; + $nexttime = self::todaynextrun($cron, 0, -1); + $cron['hour'] = $nexttime['hour']; + $cron['minute'] = $nexttime['minute']; + } + + $nextrun = @gmmktime($cron['hour'], $cron['minute'] > 0 ? $cron['minute'] : 0, 0, $monthnow, $cron['day'], $yearnow) - getglobal('setting/timeoffset') * 3600; + $data = array('lastrun' => TIMESTAMP, 'nextrun' => $nextrun); + if(!($nextrun > TIMESTAMP)) { + $data['available'] = '0'; + } + C::t('common_cron')->update($cron['cronid'], $data); + + return true; + } + + private static function todaynextrun($cron, $hour = -2, $minute = -2) { + + $hour = $hour == -2 ? gmdate('H', TIMESTAMP + getglobal('setting/timeoffset') * 3600) : $hour; + $minute = $minute == -2 ? gmdate('i', TIMESTAMP + getglobal('setting/timeoffset') * 3600) : $minute; + + $nexttime = array(); + if($cron['hour'] == -1 && !$cron['minute']) { + $nexttime['hour'] = $hour; + $nexttime['minute'] = $minute + 1; + } elseif($cron['hour'] == -1 && $cron['minute'] != '') { + $nexttime['hour'] = $hour; + if(($nextminute = self::nextminute($cron['minute'], $minute)) === false) { + ++$nexttime['hour']; + $nextminute = $cron['minute'][0]; + } + $nexttime['minute'] = $nextminute; + } elseif($cron['hour'] != -1 && $cron['minute'] == '') { + if($cron['hour'] < $hour) { + $nexttime['hour'] = $nexttime['minute'] = -1; + } elseif($cron['hour'] == $hour) { + $nexttime['hour'] = $cron['hour']; + $nexttime['minute'] = $minute + 1; + } else { + $nexttime['hour'] = $cron['hour']; + $nexttime['minute'] = 0; + } + } elseif($cron['hour'] != -1 && $cron['minute'] != '') { + $nextminute = self::nextminute($cron['minute'], $minute); + if($cron['hour'] < $hour || ($cron['hour'] == $hour && $nextminute === false)) { + $nexttime['hour'] = -1; + $nexttime['minute'] = -1; + } else { + $nexttime['hour'] = $cron['hour']; + $nexttime['minute'] = $nextminute; + } + } + + return $nexttime; + } + + private static function nextminute($nextminutes, $minutenow) { + foreach($nextminutes as $nextminute) { + if($nextminute > $minutenow) { + return $nextminute; + } + } + return false; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_database.php b/source/class/discuz/discuz_database.php new file mode 100644 index 0000000..9d762ff --- /dev/null +++ b/source/class/discuz/discuz_database.php @@ -0,0 +1,493 @@ +set_config($config); + self::$db->connect(); + } + + public static function object() { + return self::$db; + } + + public static function table($table) { + return self::$db->table_name($table); + } + + public static function delete($table, $condition, $limit = 0, $unbuffered = true) { + if (empty($condition)) { + return false; + } elseif (is_array($condition)) { + if (count($condition) == 2 && isset($condition['where']) && isset($condition['arg'])) { + $where = self::format($condition['where'], $condition['arg']); + } else { + $where = self::implode_field_value($condition, ' AND '); + } + } else { + $where = $condition; + } + $limit = dintval($limit); + $sql = "DELETE FROM " . self::table($table) . " WHERE $where " . ($limit > 0 ? "LIMIT $limit" : ''); + return self::query($sql, ($unbuffered ? 'UNBUFFERED' : '')); + } + + public static function insert($table, $data, $return_insert_id = false, $replace = false, $silent = false) { + + $sql = self::implode($data); + + $cmd = $replace ? 'REPLACE INTO' : 'INSERT INTO'; + + $table = self::table($table); + $silent = $silent ? 'SILENT' : ''; + + return self::query("$cmd $table SET $sql", null, $silent, !$return_insert_id); + } + + public static function update($table, $data, $condition = '', $unbuffered = false, $low_priority = false) { + $sql = self::implode($data); + if(empty($sql)) { + return false; + } + $cmd = "UPDATE " . ($low_priority ? 'LOW_PRIORITY' : ''); + $table = self::table($table); + $where = ''; + if (empty($condition)) { + $where = '1'; + } elseif (is_array($condition)) { + $where = self::implode($condition, ' AND '); + } else { + $where = $condition; + } + $res = self::query("$cmd $table SET $sql WHERE $where", $unbuffered ? 'UNBUFFERED' : ''); + return $res; + } + + public static function insert_id() { + return self::$db->insert_id(); + } + + public static function fetch($resourceid, $type = null) { + if (!isset($type)) { + $type = constant('MYSQLI_ASSOC'); + } + return self::$db->fetch_array($resourceid, $type); + } + + public static function fetch_first($sql, $arg = array(), $silent = false) { + $res = self::query($sql, $arg, $silent, false); + if($res === 0){ + return array(); + } + $ret = self::$db->fetch_array($res); + self::$db->free_result($res); + return $ret ? $ret : array(); + } + + public static function fetch_all($sql, $arg = array(), $keyfield = '', $silent=false) { + + $data = array(); + $query = self::query($sql, $arg, $silent, false); + while ($row = self::$db->fetch_array($query)) { + if ($keyfield && isset($row[$keyfield])) { + $data[$row[$keyfield]] = $row; + } else { + $data[] = $row; + } + } + self::$db->free_result($query); + return $data; + } + + public static function result($resourceid, $row = 0) { + return self::$db->result($resourceid, $row); + } + + public static function result_first($sql, $arg = array(), $silent = false) { + $res = self::query($sql, $arg, $silent, false); + $ret = self::$db->result($res, 0); + self::$db->free_result($res); + return $ret; + } + + public static function query($sql, $arg = array(), $silent = false, $unbuffered = false) { + if (!empty($arg)) { + if (is_array($arg)) { + $sql = self::format($sql, $arg); + } elseif ($arg === 'SILENT') { + $silent = true; + + } elseif ($arg === 'UNBUFFERED') { + $unbuffered = true; + } + } + self::checkquery($sql); + + $ret = self::$db->query($sql, $silent, $unbuffered); + if (!$unbuffered && $ret) { + $cmd = trim(strtoupper(substr($sql, 0, strpos($sql, ' ')))); + if ($cmd === 'SELECT') { + + } elseif ($cmd === 'UPDATE' || $cmd === 'DELETE') { + $ret = self::$db->affected_rows(); + } elseif ($cmd === 'INSERT') { + $ret = self::$db->insert_id(); + } + } + return $ret; + } + + public static function num_rows($resourceid) { + return self::$db->num_rows($resourceid); + } + + public static function affected_rows() { + return self::$db->affected_rows(); + } + + public static function free_result($query) { + return self::$db->free_result($query); + } + + public static function error() { + return self::$db->error(); + } + + public static function errno() { + return self::$db->errno(); + } + + public static function checkquery($sql) { + return discuz_database_safecheck::checkquery($sql); + } + + public static function quote($str, $noarray = false) { + + if (is_string($str)) + return '\'' . self::$db->escape_string($str) . '\''; + + if (is_int($str) or is_float($str)) + return '\'' . $str . '\''; + + if (is_array($str)) { + if($noarray === false) { + foreach ($str as &$v) { + $v = self::quote($v, true); + } + return $str; + } else { + return '\'\''; + } + } + + if (is_bool($str)) + return $str ? '1' : '0'; + + return '\'\''; + } + + public static function quote_field($field) { + if (is_array($field)) { + foreach ($field as $k => $v) { + $field[$k] = self::quote_field($v); + } + } else { + if (strpos($field, '`') !== false) + $field = str_replace('`', '', $field); + $field = '`' . $field . '`'; + } + return $field; + } + + public static function limit($start, $limit = 0) { + $limit = intval($limit > 0 ? $limit : 0); + $start = intval($start > 0 ? $start : 0); + if ($start > 0 && $limit > 0) { + return " LIMIT $start, $limit"; + } elseif ($limit) { + return " LIMIT $limit"; + } elseif ($start) { + return " LIMIT $start"; + } else { + return ''; + } + } + + public static function order($field, $order = 'ASC') { + if(empty($field)) { + return ''; + } + $order = strtoupper($order) == 'ASC' || empty($order) ? 'ASC' : 'DESC'; + return self::quote_field($field) . ' ' . $order; + } + + public static function field($field, $val, $glue = '=') { + + $field = self::quote_field($field); + + if (is_array($val)) { + $glue = $glue == 'notin' ? 'notin' : 'in'; + } elseif ($glue == 'in') { + $glue = '='; + } + + switch ($glue) { + case '=': + return $field . $glue . self::quote($val); + break; + case '-': + case '+': + return $field . '=' . $field . $glue . self::quote((string) $val); + break; + case '|': + case '&': + case '^': + case '&~': + return $field . '=' . $field . $glue . self::quote($val); + break; + case '>': + case '<': + case '<>': + case '<=': + case '>=': + return $field . $glue . self::quote($val); + break; + + case 'like': + return $field . ' LIKE(' . self::quote($val) . ')'; + break; + + case 'in': + case 'notin': + $val = $val ? implode(',', self::quote($val)) : '\'\''; + return $field . ($glue == 'notin' ? ' NOT' : '') . ' IN(' . $val . ')'; + break; + + default: + throw new DbException('Not allow this glue between field and value: "' . $glue . '"'); + } + } + + public static function implode($array, $glue = ',') { + $sql = $comma = ''; + $glue = ' ' . trim($glue) . ' '; + foreach ($array as $k => $v) { + $sql .= $comma . self::quote_field($k) . '=' . self::quote($v); + $comma = $glue; + } + return $sql; + } + + public static function implode_field_value($array, $glue = ',') { + return self::implode($array, $glue); + } + + public static function format($sql, $arg) { + $count = substr_count($sql, '%'); + if (!$count) { + return $sql; + } elseif ($count > count($arg)) { + throw new DbException('SQL string format error! This SQL need "' . $count . '" vars to replace into.', 0, $sql); + } + + $len = strlen($sql); + $i = $find = 0; + $ret = ''; + while ($i <= $len && $find < $count) { + if ($sql[$i] == '%') { + $next = $sql[$i + 1]; + if ($next == 't') { + $ret .= self::table($arg[$find]); + } elseif ($next == 's') { + $ret .= self::quote(is_array($arg[$find]) ? serialize($arg[$find]) : (string) $arg[$find]); + } elseif ($next == 'f') { + $ret .= sprintf('%F', $arg[$find]); + } elseif ($next == 'd') { + $ret .= dintval($arg[$find]); + } elseif ($next == 'i') { + $ret .= $arg[$find]; + } elseif ($next == 'n') { + if (!empty($arg[$find])) { + $ret .= is_array($arg[$find]) ? implode(',', self::quote($arg[$find])) : self::quote($arg[$find]); + } else { + $ret .= '0'; + } + } else { + $ret .= self::quote($arg[$find]); + } + $i++; + $find++; + } else { + $ret .= $sql[$i]; + } + $i++; + } + if ($i < $len) { + $ret .= substr($sql, $i); + } + return $ret; + } + + public static function begin_transaction() { + return self::$db->begin_transaction(); + } + + public static function commit() { + return self::$db->commit(); + } + + public static function rollback() { + return self::$db->rollback(); + } + +} + +class discuz_database_safecheck { + + protected static $checkcmd = array('SEL'=>1, 'UPD'=>1, 'INS'=>1, 'REP'=>1, 'DEL'=>1); + protected static $config; + + public static function checkquery($sql) { + if (self::$config === null) { + self::$config = getglobal('config/security/querysafe'); + } + if (self::$config['status']) { + $check = 1; + $cmd = strtoupper(substr(trim($sql), 0, 3)); + if(isset(self::$checkcmd[$cmd])) { + $check = self::_do_query_safe($sql); + } elseif(substr($cmd, 0, 2) === '/*') { + $check = -1; + } + + if ($check < 1) { + throw new DbException('It is not safe to do this query', 0, $sql); + } + } + return true; + } + + private static function _do_query_safe($sql) { + $sql = str_replace(array('\\\\', '\\\'', '\\"', '\'\''), '', $sql); + $mark = $clean = ''; + if (strpos($sql, '/') === false && strpos($sql, '#') === false && strpos($sql, '-- ') === false && strpos($sql, '@') === false && strpos($sql, '`') === false && strpos($sql, '"') === false) { + $clean = preg_replace("/'(.+?)'/s", '', $sql); + } else { + $len = strlen($sql); + $mark = $clean = ''; + for ($i = 0; $i < $len; $i++) { + $str = $sql[$i]; + switch ($str) { + case '`': + if(!$mark) { + $mark = '`'; + $clean .= $str; + } elseif ($mark == '`') { + $mark = ''; + } + break; + case '\'': + if (!$mark) { + $mark = '\''; + $clean .= $str; + } elseif ($mark == '\'') { + $mark = ''; + } + break; + case '/': + if (empty($mark) && $sql[$i + 1] == '*') { + $mark = '/*'; + $clean .= $mark; + $i++; + } elseif ($mark == '/*' && $sql[$i - 1] == '*') { + $mark = ''; + $clean .= '*'; + } + break; + case '#': + if (empty($mark)) { + $mark = $str; + $clean .= $str; + } + break; + case "\n": + if ($mark == '#' || $mark == '--') { + $mark = ''; + } + break; + case '-': + if (empty($mark) && substr($sql, $i, 3) == '-- ') { + $mark = '-- '; + $clean .= $mark; + } + break; + + default: + + break; + } + $clean .= $mark ? '' : $str; + } + } + + if(strpos($clean, '@') !== false) { + return '-3'; + } + + $clean = preg_replace("/[^a-z0-9_\-\(\)#\*\/\"]+/is", "", strtolower($clean)); + + if (self::$config['afullnote']) { + $clean = str_replace('/**/', '', $clean); + } + + if (is_array(self::$config['dfunction'])) { + foreach (self::$config['dfunction'] as $fun) { + if (strpos($clean, $fun . '(') !== false) + return '-1'; + } + } + + if (is_array(self::$config['daction'])) { + foreach (self::$config['daction'] as $action) { + if (strpos($clean, $action) !== false) + return '-3'; + } + } + + if (self::$config['dlikehex'] && strpos($clean, 'like0x')) { + return '-2'; + } + + if (is_array(self::$config['dnote'])) { + foreach (self::$config['dnote'] as $note) { + if (strpos($clean, $note) !== false) + return '-4'; + } + } + + return 1; + } + + public static function setconfigstatus($data) { + self::$config['status'] = $data ? 1 : 0; + } + +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_error.php b/source/class/discuz/discuz_error.php new file mode 100644 index 0000000..b5a79d5 --- /dev/null +++ b/source/class/discuz/discuz_error.php @@ -0,0 +1,375 @@ +'.$message.'
    PHP:'.$logtrace; + discuz_error::write_error_log($messagesave); + } + + if($show) { + discuz_error::show_error('system', "
  • $message
  • ", $showtrace, '', md5(discuz_error::clear($messagesave))); + } + + if($halt) { + exit(); + } else { + return $message; + } + } + + public static function template_error($message, $tplname) { + $message = lang('error', $message); + $tplname = str_replace(DISCUZ_ROOT, '', $tplname); + $message = $message.': '.$tplname; + discuz_error::system_error($message); + } + + public static function debug_backtrace() { + $skipfunc[] = 'discuz_error->debug_backtrace'; + $skipfunc[] = 'discuz_error->db_error'; + $skipfunc[] = 'discuz_error->template_error'; + $skipfunc[] = 'discuz_error->system_error'; + $skipfunc[] = 'db_mysql->halt'; + $skipfunc[] = 'db_mysql->query'; + $skipfunc[] = 'DB::_execute'; + + $show = $log = ''; + $debug_backtrace = debug_backtrace(); + krsort($debug_backtrace); + foreach ($debug_backtrace as $k => $error) { + $file = str_replace(DISCUZ_ROOT, '', $error['file']); + $func = isset($error['class']) ? $error['class'] : ''; + $func .= isset($error['type']) ? $error['type'] : ''; + $func .= isset($error['function']) ? $error['function'] : ''; + if(in_array($func, $skipfunc)) { + break; + } + $error['line'] = sprintf('%04d', $error['line']); + + $show .= "
  • [Line: {$error['line']}]".$file."($func)
  • "; + $log .= (!empty($log) ? ' -> ' : '').$file.'#'.$func.':'.$error['line']; + } + return array($show, $log); + } + + public static function db_error($message, $sql) { + global $_G; + + list($showtrace, $logtrace) = discuz_error::debug_backtrace(); + + $title = lang('error', 'db_'.$message); + $title_msg = lang('error', 'db_error_message'); + $title_sql = lang('error', 'db_query_sql'); + $title_backtrace = lang('error', 'backtrace'); + $title_help = lang('error', 'db_help_link'); + + $db = &DB::object(); + $dberrno = $db->errno(); + $dberror = str_replace($db->tablepre, '', $db->error()); + $sql = dhtmlspecialchars(str_replace($db->tablepre, '', $sql)); + + $msg = '
  • [Type] '.$title.'
  • '; + $msg .= $dberrno ? '
  • ['.$dberrno.'] '.$dberror.'
  • ' : ''; + $msg .= $sql ? '
  • [Query] '.$sql.'
  • ' : ''; + + $errormsg = ''.$title.''; + $errormsg .= "[$dberrno]
    ERR: $dberror
    "; + if($sql) { + $errormsg .= 'SQL: '.$sql; + } + $errormsg .= "
    "; + $errormsg .= 'PHP: '.$logtrace; + + discuz_error::write_error_log($errormsg); + discuz_error::show_error('db', $msg, $showtrace, '', md5(discuz_error::clear($errormsg))); + exit(); + + } + + public static function exception_error($exception) { + + if($exception instanceof DbException) { + $type = 'db'; + } else { + $type = 'system'; + } + + if($type == 'db') { + $errormsg = '('.$exception->getCode().') '; + $errormsg .= self::sql_clear($exception->getMessage()); + if($exception->getSql()) { + $errormsg .= '
    '; + $errormsg .= self::sql_clear($exception->getSql()); + $errormsg .= '
    '; + } + } else { + $errormsg = $exception->getMessage(); + } + + $trace = $exception->getTrace(); + krsort($trace); + + $trace[] = array('file'=>$exception->getFile(), 'line'=>$exception->getLine(), 'function'=> 'break'); + $logmsg = ''; + $phpmsg = array(); + foreach ($trace as $error) { + if(!empty($error['function'])) { + $fun = ''; + if(!empty($error['class'])) { + $fun .= $error['class'].$error['type']; + } + $fun .= $error['function'].'('; + if(!empty($error['args'])) { + $mark = ''; + foreach($error['args'] as $arg) { + $fun .= $mark; + if(is_array($arg)) { + $fun .= 'Array'; + } elseif(is_bool($arg)) { + $fun .= $arg ? 'true' : 'false'; + } elseif(is_int($arg)) { + $fun .= (defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) ? $arg : '%d'; + } elseif(is_float($arg)) { + $fun .= (defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) ? $arg : '%f'; + } elseif(is_resource($arg)) { + $fun .= (defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) ? 'Resource' : '%f'; + } elseif(is_object($arg)) { + $fun .= (defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) ? 'Object' : '%f'; + } else { + $arg = (string)$arg; + $fun .= (defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) ? '\''.dhtmlspecialchars(substr(self::clear($arg), 0, 10)).(strlen($arg) > 10 ? ' ...' : '').'\'' : '%s'; + } + $mark = ', '; + } + } + + $fun .= ')'; + $error['function'] = $fun; + } + $phpmsg[] = array( + 'file' => str_replace(array(DISCUZ_ROOT, '\\'), array('', '/'), $error['file']), + 'line' => $error['line'], + 'function' => $error['function'], + ); + $file = str_replace(array(DISCUZ_ROOT, '\\'), array('', '/'), $error['file']); + $func = isset($error['class']) ? $error['class'] : ''; + $func .= isset($error['type']) ? $error['type'] : ''; + $func .= isset($error['function']) ? $error['function'] : ''; + $line = sprintf('%04d', $error['line']); + $logmsg .= (!empty($logmsg) ? ' -> ' : '').$file.'#'.$func.':'.$line; + } + + $messagesave = ''.$errormsg.'
    PHP:'.$logmsg; + self::write_error_log($messagesave); + + self::show_error($type, $errormsg, $phpmsg, '', md5(discuz_error::clear($messagesave))); + exit(); + + } + + public static function show_error($type, $errormsg, $phpmsg = '', $typemsg = '', $backtraceid = '') { + global $_G; + + ob_end_clean(); + $gzip = getglobal('gzipcompress'); + ob_start($gzip ? 'ob_gzhandler' : null); + + header("HTTP/1.1 503 Service Temporarily Unavailable"); + header("Status: 503 Service Temporarily Unavailable"); + header("Retry-After: 3600"); + + $host = $_SERVER['HTTP_HOST']; + $title = (!isset($_G['config']['security']['error']['showerror']) || !empty($_G['config']['security']['error']['showerror'])) ? ($type == 'db' ? 'Database' : 'System') : 'General'; + echo << + + + $host - $title Error + + + + + + + + +
    +

    Discuz! $title Error

    +EOT; + + echo '

    Time: ' . date('Y-m-d H:i:s O') .' IP: ' . getglobal('clientip') . ' BackTraceID: ' . $backtraceid . '

    '; + + if(!empty($errormsg) && (!isset($_G['config']['security']['error']['showerror']) || !empty($_G['config']['security']['error']['showerror']))) { + echo '
    '.$errormsg.'
    '; + } + if(isset($_G['config']['security']['error']['showerror']) && empty($_G['config']['security']['error']['showerror'])) { + echo '
    '; + } + + if(!empty($phpmsg) && (!isset($_G['config']['security']['error']['showerror']) || $_G['config']['security']['error']['showerror'] == '1')) { + echo '
    '; + echo '

    PHP Debug

    '; + echo ''; + if(is_array($phpmsg)) { + echo ''; + foreach($phpmsg as $k => $msg) { + $k++; + $explode = explode("/", $msg['file']); + if (isset($explode['1']) && $explode['1'] == 'plugin') { + $guess = $explode['2']; + $bg = "bg3"; + } else { + $bg = "bg1"; + } + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + } else { + echo ''; + } + echo '
    No.FileLineCode
    '.$k.''.$msg['file'].''.$msg['line'].''.$msg['function'].'
      '.$phpmsg.'
    '; + } + + echo '
    '.lang('error', 'suggestion_user').'
    '; + + if (!isset($_G['config']['security']['error']['guessplugin']) || !empty($_G['config']['security']['error']['guessplugin'])) { + if (!empty($guess)) { + $suggestion = lang('error', 'suggestion_plugin', array('guess'=>$guess)); + } else { + $suggestion = lang('error', 'suggestion'); + } + echo '
    '.$suggestion.'
    '; + } + + $endmsg = lang('error', 'error_end_message', array('host'=>$host)); + echo <<$endmsg
    +
    + + +EOT; + + } + + public static function clear($message) { + return str_replace(array("\t", "\r", "\n"), " ", $message); + } + + public static function sql_clear($message) { + $message = self::clear($message); + $message = str_replace(DB::object()->tablepre, '', $message); + $message = dhtmlspecialchars($message); + return $message; + } + + public static function write_error_log($message) { + + $message = discuz_error::clear($message); + $time = time(); + $file = DISCUZ_ROOT.'./data/log/'.date("Ym").'_errorlog.php'; + $hash = md5($message); + + $uid = getglobal('uid'); + $ip = getglobal('clientip'); + + $user = 'User: uid='.intval($uid).'; IP='.$ip.'; RIP:'.$_SERVER['REMOTE_ADDR']; + $uri = 'Request: '.dhtmlspecialchars(discuz_error::clear($_SERVER['REQUEST_URI'])); + $message = "\t{$time}\t$message\t$hash\t$user $uri\n"; + if($fp = @fopen($file, 'rb')) { + $lastlen = 50000; + $maxtime = 60 * 10; + $offset = filesize($file) - $lastlen; + if($offset > 0) { + fseek($fp, $offset); + } + if($data = fread($fp, $lastlen)) { + $array = explode("\n", $data); + if(is_array($array)) foreach($array as $key => $val) { + $row = explode("\t", $val); + if($row[0] != '') continue; + if($row[3] == $hash && ($row[1] > $time - $maxtime)) { + return; + } + } + } + } + error_log($message, 3, $file); + } + +} \ No newline at end of file diff --git a/source/class/discuz/discuz_extend.php b/source/class/discuz/discuz_extend.php new file mode 100644 index 0000000..fc57e58 --- /dev/null +++ b/source/class/discuz/discuz_extend.php @@ -0,0 +1,52 @@ +_obj, $name)) { + switch (count($p)) { + case 0: return $this->_obj->{$name}();break; + case 1: return $this->_obj->{$name}($p[0]);break; + case 2: return $this->_obj->{$name}($p[0], $p[1]);break; + case 3: return $this->_obj->{$name}($p[0], $p[1], $p[2]);break; + case 4: return $this->_obj->{$name}($p[0], $p[1], $p[2], $p[3]);break; + case 5: return $this->_obj->{$name}($p[0], $p[1], $p[2], $p[3], $p[4]);break; + default: return call_user_func_array(array($this->_obj, $name), $p);break; + } + } else { + return parent::__call($name, $p); + } + } + + public function init_base_var(){ + $this->setting = &$this->_obj->setting; + $this->member = &$this->_obj->member; + $this->group = &$this->_obj->group; + $this->param = &$this->_obj->param; + } + + + +} +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_ftp.php b/source/class/discuz/discuz_ftp.php new file mode 100644 index 0000000..8f7941f --- /dev/null +++ b/source/class/discuz/discuz_ftp.php @@ -0,0 +1,258 @@ +set_error(0); + $this->config = !$config ? getglobal('setting/ftp') : $config; + $this->enabled = false; + if(empty($this->config['on']) || empty($this->config['host'])) { + $this->set_error(FTP_ERR_CONFIG_OFF); + } else { + $this->func = $this->config['ssl'] && function_exists('ftp_ssl_connect') ? 'ftp_ssl_connect' : 'ftp_connect'; + if($this->func == 'ftp_connect' && !function_exists('ftp_connect')) { + $this->set_error(FTP_ERR_SERVER_DISABLED); + } else { + $this->config['host'] = discuz_ftp::clear($this->config['host']); + $this->config['port'] = intval($this->config['port']); + $this->config['ssl'] = intval($this->config['ssl']); + $this->config['username'] = discuz_ftp::clear($this->config['username']); + $this->config['password'] = authcode($this->config['password'], 'DECODE', md5(getglobal('config/security/authkey'))); + $this->config['timeout'] = intval($this->config['timeout']); + $this->enabled = true; + } + } + } + + function upload($source, $target) { + if($this->error()) { + return 0; + } + $old_dir = $this->ftp_pwd(); + $dirname = dirname($target); + $filename = basename($target); + if(!$this->ftp_chdir($dirname)) { + if($this->ftp_mkdir($dirname)) { + $this->ftp_chmod($dirname); + if(!$this->ftp_chdir($dirname)) { + $this->set_error(FTP_ERR_CHDIR); + } + $this->ftp_put('index.htm', getglobal('setting/attachdir').'/index.htm', FTP_BINARY); + } else { + $this->set_error(FTP_ERR_MKDIR); + } + } + + $res = 0; + if(!$this->error()) { + if($fp = @fopen($source, 'rb')) { + $res = $this->ftp_fput($filename, $fp, FTP_BINARY); + @fclose($fp); + !$res && $this->set_error(FTP_ERR_TARGET_WRITE); + } else { + $this->set_error(FTP_ERR_SOURCE_READ); + } + } + + $this->ftp_chdir($old_dir); + + return $res ? 1 : 0; + } + + function connect() { + if(!$this->enabled || empty($this->config)) { + return 0; + } else { + return $this->ftp_connect( + $this->config['host'], + $this->config['username'], + $this->config['password'], + $this->config['attachdir'], + $this->config['port'], + $this->config['timeout'], + $this->config['ssl'], + $this->config['pasv'] + ); + } + + } + + function ftp_connect($ftphost, $username, $password, $ftppath, $ftpport = 21, $timeout = 30, $ftpssl = 0, $ftppasv = 0) { + $res = 0; + $fun = $this->func; + if($this->connectid = $fun($ftphost, $ftpport, 20)) { + + $timeout && $this->set_option(FTP_TIMEOUT_SEC, $timeout); + if($this->ftp_login($username, $password)) { + $this->ftp_pasv($ftppasv); + if($this->ftp_chdir($ftppath)) { + $res = $this->connectid; + } else { + $this->set_error(FTP_ERR_CHDIR); + } + } else { + $this->set_error(FTP_ERR_USER_NO_LOGGIN); + } + + } else { + $this->set_error(FTP_ERR_CONNECT_TO_SERVER); + } + + if($res > 0) { + $this->set_error(); + $this->enabled = 1; + } else { + $this->enabled = 0; + $this->ftp_close(); + } + + return $res; + + } + + function set_error($code = 0) { + $this->_error = $code; + } + + function error() { + return $this->_error; + } + + function clear($str) { + return str_replace(array( "\n", "\r", '..'), '', $str); + } + + + function set_option($cmd, $value) { + if(function_exists('ftp_set_option')) { + return @ftp_set_option($this->connectid, $cmd, $value); + } + } + + function ftp_mkdir($directory) { + $directory = discuz_ftp::clear($directory); + $epath = explode('/', $directory); + $dir = '';$comma = ''; + foreach($epath as $path) { + $dir .= $comma.$path; + $comma = '/'; + $return = @ftp_mkdir($this->connectid, $dir); + $this->ftp_chmod($dir); + } + return $return; + } + + function ftp_rmdir($directory) { + $directory = discuz_ftp::clear($directory); + return @ftp_rmdir($this->connectid, $directory); + } + + function ftp_put($remote_file, $local_file, $mode = FTP_BINARY) { + $remote_file = discuz_ftp::clear($remote_file); + $local_file = discuz_ftp::clear($local_file); + $mode = intval($mode); + return @ftp_put($this->connectid, $remote_file, $local_file, $mode); + } + + function ftp_fput($remote_file, $sourcefp, $mode = FTP_BINARY) { + $remote_file = discuz_ftp::clear($remote_file); + $mode = intval($mode); + return @ftp_fput($this->connectid, $remote_file, $sourcefp, $mode); + } + + function ftp_size($remote_file) { + $remote_file = discuz_ftp::clear($remote_file); + return @ftp_size($this->connectid, $remote_file); + } + + function ftp_close() { + return @ftp_close($this->connectid); + } + + function ftp_delete($path) { + $path = discuz_ftp::clear($path); + return @ftp_delete($this->connectid, $path); + } + + function ftp_get($local_file, $remote_file, $mode, $resumepos = 0) { + $remote_file = discuz_ftp::clear($remote_file); + $local_file = discuz_ftp::clear($local_file); + $mode = intval($mode); + $resumepos = intval($resumepos); + return @ftp_get($this->connectid, $local_file, $remote_file, $mode, $resumepos); + } + + function ftp_login($username, $password) { + $username = $this->clear($username); + $password = str_replace(array("\n", "\r"), array('', ''), $password); + return @ftp_login($this->connectid, $username, $password); + } + + function ftp_pasv($pasv) { + return @ftp_pasv($this->connectid, $pasv ? true : false); + } + + function ftp_chdir($directory) { + $directory = discuz_ftp::clear($directory); + return @ftp_chdir($this->connectid, $directory); + } + + function ftp_site($cmd) { + $cmd = discuz_ftp::clear($cmd); + return @ftp_site($this->connectid, $cmd); + } + + function ftp_chmod($filename, $mod = 0777) { + $filename = discuz_ftp::clear($filename); + if(function_exists('ftp_chmod')) { + return @ftp_chmod($this->connectid, $mod, $filename); + } else { + return @ftp_site($this->connectid, 'CHMOD '.$mod.' '.$filename); + } + } + + function ftp_pwd() { + return @ftp_pwd($this->connectid); + } + +} \ No newline at end of file diff --git a/source/class/discuz/discuz_memory.php b/source/class/discuz/discuz_memory.php new file mode 100644 index 0000000..e7db236 --- /dev/null +++ b/source/class/discuz/discuz_memory.php @@ -0,0 +1,386 @@ +config = $config; + $this->prefix = empty($config['prefix']) ? substr(md5($_SERVER['HTTP_HOST']), 0, 6).'_' : $config['prefix']; + unset($this->config['prefix']); + + foreach($this->config as $cache => $config) { + $available = is_array($config) ? !empty($config['server']) : !empty($config); + if($available && !is_object($this->memory)) { + $class_name = 'memory_driver_'.$cache; + $this->memory = new $class_name(); + $this->memory->init($config); + if(!$this->memory->enable) { + $this->memory = null; + } else { + $this->type = $this->memory->cacheName; + $this->enable = true; + $this->gotset = method_exists($this->memory, 'feature') && $this->memory->feature('set'); + $this->gothash = method_exists($this->memory, 'feature') && $this->memory->feature('hash'); + $this->goteval = method_exists($this->memory, 'feature') && $this->memory->feature('eval'); + $this->gotsortedset = method_exists($this->memory, 'feature') && $this->memory->feature('sortedset');; + $this->gotcluster = method_exists($this->memory, 'feature') && $this->memory->feature('cluster'); + $this->gotpipeline = method_exists($this->memory, 'feature') && $this->memory->feature('pipeline'); + break; + } + } + } + } + + public function get($key, $prefix = '') { + static $getmulti = null; + $ret = false; + if($this->enable) { + if(!isset($getmulti)) $getmulti = method_exists($this->memory, 'getMulti'); + $this->userprefix = $prefix; + if(is_array($key)) { + if($getmulti) { + $ret = $this->memory->getMulti($this->_key($key)); + if($ret !== false && !empty($ret)) { + $_ret = array(); + foreach((array)$ret as $_key => $value) { + $_ret[$this->_trim_key($_key)] = $value; + } + $ret = $_ret; + } + } else { + $ret = array(); + $_ret = false; + foreach($key as $id) { + if(($_ret = $this->memory->get($this->_key($id))) !== false && isset($_ret)) { + $ret[$id] = $_ret; + } + } + } + if(empty($ret)) $ret = false; + } else { + $ret = $this->memory->get($this->_key($key)); + if(!isset($ret)) $ret = false; + } + } + return $ret; + } + + public function set($key, $value, $ttl = 0, $prefix = '') { + + $ret = false; + if($value === false) $value = ''; + if($this->enable) { + $this->userprefix = $prefix; + $ret = $this->memory->set($this->_key($key), $value, $ttl); + } + return $ret; + } + + public function add($key, $value, $ttl = 0, $prefix = '') { + $ret = false; + if($value === false) $value = ''; + if($this->enable) { + $this->userprefix = $prefix; + $ret = $this->memory->add($this->_key($key), $value, $ttl); + } + return $ret; + } + + public function exists($key, $prefix = '') { + $ret = false; + if ($this->enable && method_exists($this->memory, 'exists')) { + $this->userprefix = $prefix; + $ret = $this->memory->exists($this->_key($key)); + } + return $ret; + } + + public function rm($key, $prefix = '') { + $ret = false; + if($this->enable) { + $this->userprefix = $prefix; + $key = $this->_key($key); + foreach((array)$key as $id) { + $ret = $this->memory->rm($id); + } + } + return $ret; + } + + public function clear() { + $ret = false; + if($this->enable && method_exists($this->memory, 'clear')) { + $ret = $this->memory->clear(); + } + return $ret; + } + + public function inc($key, $step = 1, $prefix = '') { + static $hasinc = null; + $ret = false; + if($this->enable) { + $this->userprefix = $prefix; + if(!isset($hasinc)) $hasinc = method_exists($this->memory, 'inc'); + if($hasinc) { + $ret = $this->memory->inc($this->_key($key), $step); + } else { + if(($data = $this->memory->get($key)) !== false) { + $ret = ($this->memory->set($key, $data + ($step)) !== false ? $this->memory->get($key) : false); + } + } + } + return $ret; + } + + public function incex($key, $value, $prefix = '') { + if (!$this->enable || !$this->gotset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->incex($this->_key($key), $value); + } + + + public function dec($key, $step = 1, $prefix = '') { + static $hasdec = null; + $ret = false; + if($this->enable) { + $this->userprefix = $prefix; + if(!isset($hasdec)) $hasdec = method_exists($this->memory, 'dec'); + if($hasdec) { + $ret = $this->memory->dec($this->_key($key), $step); + } else { + if(($data = $this->memory->get($key)) !== false) { + $ret = ($this->memory->set($key, $data - ($step)) !== false ? $this->memory->get($key) : false); + } + } + } + return $ret; + } + + public function sadd($key, $value, $prefix = '') { + if (!$this->enable || !$this->gotset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->sadd($this->_key($key), $value); + } + + public function srem($key, $value, $prefix = '') { + if (!$this->enable || !$this->gotset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->srem($this->_key($key), $value); + } + + public function sismember($key, $value, $prefix = '') { + if (!$this->enable || !$this->gotset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->sismember($this->_key($key), $value); + } + + public function scard($key, $prefix = '') { + if (!$this->enable || !$this->gotset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->scard($this->_key($key)); + } + + public function smembers($key, $prefix = '') { + if (!$this->enable || !$this->gotset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->smembers($this->_key($key)); + } + + public function hmset($key, $value, $prefix = '') { + if (!$this->enable || !$this->gothash) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->hmset($this->_key($key), $value); + } + + public function hgetall($key, $prefix = '') { + if (!$this->enable || !$this->gothash) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->hgetall($this->_key($key)); + } + + public function hexists($key, $field, $prefix = '') { + if (!$this->enable || !$this->gothash) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->hexists($this->_key($key), $field); + } + + public function hget($key, $field, $prefix = '') { + if (!$this->enable || !$this->gothash) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->hget($this->_key($key), $field); + } + + public function evalscript($script, $argv, $sha_key, $prefix = '') { + if (!$this->enable || !$this->goteval) { + return false; + } + if (!is_array($argv)) { + $argv = array(); + } + $this->userprefix = $prefix; + if ($sha_key) { + $sha_key = $sha_key . '_eval_sha'; + $sha = $this->memory->get($this->_key($sha_key)); + $should_load = false; + if (!$sha) { + if (!$script) return false; + $should_load = true; + } else { + if (!$this->memory->scriptexists($sha)) { + $should_load = true; + } + } + if ($should_load) { + $sha = $this->memory->loadscript($script); + $this->memory->set($this->_key($sha_key), $sha); + } + return $this->memory->evalSha($sha, array_merge(array($this->_key('')), $argv)); + } else { + return $this->memory->evalscript($script, array_merge(array($this->_key('')), $argv)); + } + } + + public function zadd($key, $value, $score, $prefix = '') { + if (!$this->enable || !$this->gotsortedset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->zadd($this->_key($key), $value, $score); + } + + public function zrem($key, $value, $prefix = '') { + if (!$this->enable || !$this->gotsortedset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->zrem($this->_key($key), $value); + } + + public function zscore($key, $member, $prefix = '') { + if (!$this->enable || !$this->gotsortedset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->zscore($this->_key($key), $member); + } + + public function zcard($key, $prefix = '') { + if (!$this->enable || !$this->gotsortedset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->zcard($this->_key($key)); + } + + public function zrevrange($key, $start, $end, $prefix = '', $withscore = false) { + if (!$this->enable || !$this->gotsortedset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->zrevrange($this->_key($key), $start, $end, $withscore); + } + + public function zincrby($key, $member, $value, $prefix = '') { + if (!$this->enable || !$this->gotsortedset) { + return false; + } + $this->userprefix = $prefix; + return $this->memory->zincrby($this->_key($key), $member, $value); + } + + public function pipeline() { + if (!$this->enable || !$this->gotpipeline) { + return false; + } + return $this->memory->pipeline(); + } + + public function commit() { + if (!$this->enable || !$this->gotpipeline) { + return false; + } + return $this->memory->commit(); + } + + public function discard() { + if (!$this->enable || !$this->gotpipeline) { + return false; + } + return $this->memory->discard(); + } + + private function _key($str) { + $perfix = $this->prefix.$this->userprefix; + if(is_array($str)) { + foreach($str as &$val) { + $val = $perfix.$val; + } + } else { + $str = $perfix.$str; + } + return $str; + } + + private function _trim_key($str) { + return substr($str, strlen($this->prefix.$this->userprefix)); + } + + public function getextension() { + return $this->extension; + } + + public function getconfig() { + return $this->config; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_model.php b/source/class/discuz/discuz_model.php new file mode 100644 index 0000000..ac51461 --- /dev/null +++ b/source/class/discuz/discuz_model.php @@ -0,0 +1,174 @@ +app = C::app(); + $this->setting = &$this->app->var['setting']; + $this->group = &$this->app->var['group']; + $this->member = &$this->app->var['member']; + parent::__construct(); + } + + public function config($name) { + return getglobal('config/'.$name); + } + + public function setting($name = null, $val = null) { + if(isset($val)) { + return $this->setvar($this->setting, $name, $val); + } + return $this->getvar($this->setting, $name); + } + + public function table($name) { + return C::t($name); + } + + public function cache($name, $val = null) { + if(isset($val)) { + savecache($name, $val); + $this->app->var['cache'][$name] = $val; + return true; + } else { + if (!isset($this->app->var['cache'][$name])) { + loadcache($name); + } + if($this->app->var['cache'][$name] === null) { + return null; + } else { + return getglobal('cache/'.$name); + } + } + } + + public function member($name = null, $val = null){ + if(isset($val)) { + return $this->setvar($this->member, $name, $val); + } else { + return $this->getvar($this->member, $name); + } + } + + public function group($name = null, $val = null){ + if(isset($val)) { + return $this->setvar($this->group, $name, $val); + } else { + return $this->getvar($this->group, $name); + } + } + + public function param($name = null, $val = null){ + if(isset($val)) { + return $this->setvar($this->param, $name, $val); + } + return $this->getvar($this->param, $name); + } + + public function setvar(&$var, $key, $value) { + if(isset($key)) { + $key = explode('/', $key); + $p = &$var; + foreach ($key as $k) { + if(!isset($p[$k]) || !is_array($p[$k])) { + $p[$k] = array(); + } + $p = &$p[$k]; + } + $p = $value; + } else { + $var = $value; + } + return true; + } + + public function getvar(&$var, $key = null) { + if(isset($key)) { + $key = explode('/', $key); + foreach ($key as $k) { + if (!isset($var[$k])) { + return null; + } + $var = &$var[$k]; + } + } + return $var; + } + + + public function showmessage() { + if(!empty($this->showmessage) && is_callable($this->showmessage)) { + $p = func_get_args(); + if(is_string($this->showmessage)) { + $fn = $this->showmessage; + switch (func_num_args()) { + case 0: return $fn();break; + case 1: return $fn($p[0]);break; + case 2: return $fn($p[0], $p[1]);break; + case 3: return $fn($p[0], $p[1], $p[2]);exit;break; + case 4: return $fn($p[0], $p[1], $p[2], $p[3]);break; + case 5: return $fn($p[0], $p[1], $p[2], $p[3], $p[4]);break; + default: return call_user_func_array($this->showmessage, $p);break; + } + } else { + return call_user_func_array($this->showmessage, $p); + } + } else { + return func_get_args(); + } + } + + public function attach_before_method($name, $fn) { + $this->methods[$name][0][] = $fn; + } + + public function attach_after_method($name, $fn) { + $this->methods[$name][1][] = $fn; + } + + public function attach_before_methods($name, $methods){ + if(!empty($methods)) { + foreach($methods as $method) { + $this->methods[$name][0][] = $method; + } + } + } + + public function attach_after_methods($name, $methods){ + if(!empty($methods)) { + foreach($methods as $method) { + $this->methods[$name][1][] = $method; + } + } + } + + abstract protected function _init_parameters($parameters); + +} +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_panel.php b/source/class/discuz/discuz_panel.php new file mode 100644 index 0000000..ec8589a --- /dev/null +++ b/source/class/discuz/discuz_panel.php @@ -0,0 +1,210 @@ +uid = (int)$_G['uid']; + $this->adminid = (int)$_G['adminid']; + $this->groupid = (int)$_G['groupid']; + $this->panel = (int)$panel; + $this->ip = $_G['clientip']; + + $this->table = C::t('common_admincp_session'); + + $this->_cpaccess(); + } + + function _session_load() { + + $this->session = $this->table->fetch($this->uid, $this->panel); + + if(empty($this->session) || (time() - $this->session['dateline'] > $this->ttl)) { + $this->session = array(); + } elseif($this->session['errorcount'] >=5 && (time() - $this->session['dateline'] > $this->lockttl)) { + $this->session = array(); + } elseif(!empty($this->session['storage'])) { + $this->storage = dunserialize(base64_decode($this->session['storage'])); + $this->session['storage'] = ''; + } + return $this->session; + } + + function _session_destroy($uid = 0) { + $uid = empty($uid) ? $this->uid : $uid; + $this->table->delete($uid, $this->panel, $this->ttl); + } + + function _loadstorage() { + $ret = $this->table->fetch($this->uid, $this->panel); + $storage = $ret['storage']; + if(!empty($storage)) { + $this->storage = dunserialize(base64_decode($storage)); + } else { + $this->storage = array(); + } + } + + function geturl() { + $url = getglobal('basefilename').'?'; + if(!empty($_GET)) { + foreach ($_GET as $key => $value) { + $url .= urlencode($key).'='.urlencode($value).'&'; + } + } + return $url; + } + + function isfounder($user = '') { + global $_G; + $user = empty($user) ? array('uid' => $_G['uid'], 'adminid' => $_G['adminid'], 'username' => $_G['member']['username']) : $user; + $founders = str_replace(' ', '', $GLOBALS['forumfounders']); + if($user['adminid'] <> 1) { + return FALSE; + } elseif(empty($founders)) { + return TRUE; + } elseif(strexists(",$founders,", ",{$user['uid']},")) { + return TRUE; + } elseif(!is_numeric($user['username']) && strexists(",$founders,", ",{$user['username']},")) { + return TRUE; + } else { + return FALSE; + } + } + + function set($varname, $value, $updatedb = false) { + $this->storage[$varname] = $value; + $updatedb && $this->update(); + } + + function get($varname, $fromdb = false) { + $return = null; + $fromdb && $this->_loadstorage(); + if(isset($this->storage[$varname])) { + $return = $this->storage[$varname]; + } + return $return; + } + + function clear($updatedb = false) { + $this->storage = array(); + $updatedb && $this->update(); + } + + function _sesssion_creat() { + $this->_session_destroy(); + $this->set('url_forward', $this->geturl()); + $this->session = array( + 'uid' => $this->uid, + 'adminid' => $this->adminid, + 'panel' => $this->panel, + 'ip' => $this->ip, + 'errorcount' => 0, + ); + $this->update(true); + } + + function update($isnew = false) { + $data = array(); + $this->session['dateline'] = time(); + $this->session['storage'] = !empty($this->storage) ? base64_encode((serialize($this->storage))) : ''; + if($isnew) { + $this->table->insert($this->session, false, true); + } else { + $this->table->update($this->uid, $this->panel, $this->session); + } + } + + function _cpaccess() { + + if(empty($this->uid)) { + $this->_user_login(); + } elseif($this->panel == MODCP_PANEL && $this->adminid <= 0) { + $this->showmessage('admin_cpanel_noaccess'); + } + + $this->_session_load(); + if(empty($this->session)) { + $this->_sesssion_creat(); + } elseif($this->session['errorcount'] > 5) { + $this->_panel_locked(); + } elseif($this->session['errorcount'] == -1) { + $this->islogin = true; + $this->update(); + } else { + $this->islogin = false; + } + } + + function dologin($username, $password, $isuid = false) { + loaducenter(); + if(!$isuid) { + $username = addslashes($username); + } + $ucresult = uc_user_login($username, $password, $isuid ? 1 : 0); + if($ucresult[0] > 0) { + $this->loginsucced(); + } else { + $this->session['errorcount'] ++; + } + $this->update(); + return $this->islogin; + } + + function dologout() { + $this->_session_destroy(); + } + + function loginsucced() { + $this->session['errorcount'] = '-1'; + $this->islogin = true; + $this->update(); + dheader('Location: '.$this->get('url_forward')); + } + + function showmessage($message, $url_forward = '', $values = array(), $ext = array()) { + showmessage($message, $url_forward, $values, $ext); + dexit(); + } + + function _panel_locked() { + $unlocktime = dgmdate($this->session['dateline'] + $this->lockttl + 30); + $this->showmessage('admin_cpanel_locked', '', array('unlocktime' => $unlocktime)); + } + + function _user_login() { + $this->showmessage('to_login', 'member.php?mod=logging&action=login', array(), array('showmsg' => true, 'login' => 1)); + } + +} +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_process.php b/source/class/discuz/discuz_process.php new file mode 100644 index 0000000..e5def48 --- /dev/null +++ b/source/class/discuz/discuz_process.php @@ -0,0 +1,109 @@ +insert(array('processid' => $name, 'expiry' => time() + $ttl), FALSE, true); + break; + case 'get': + $ret = C::t('common_process')->fetch($name); + if(empty($ret) || $ret['expiry'] < time()) { + C::t('common_process')->delete_process($name, time()); + $ret = false; + } else { + $ret = true; + } + break; + case 'rm': + $ret = C::t('common_process')->delete_process($name, time()); + break; + } + return $ret; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_rank.php b/source/class/discuz/discuz_rank.php new file mode 100644 index 0000000..faaa3e6 --- /dev/null +++ b/source/class/discuz/discuz_rank.php @@ -0,0 +1,56 @@ +name = $name; + } else { + throw new Exception('The property "'.get_class($this).'->name" is empty'); + } + } + + public function fetch_list($order = 'DESC', $start = 0, $limit = 0) { + return C::t('common_rank')->fetch_list($this->name, $order, $limit); + } + + public function fetch_rank($key) { + return C::t('common_rank')->fetch_rank($this->name, $key); + } + + public function set($key, $value) { + return C::t('common_rank')->insert($this->name, $key, $value); + } + + public function inc($key, $value) { + return C::t('common_rank')->inc($this->name, $key, $value); + } + + public function dec($key, $value) { + return C::t('common_rank')->dec($this->name, $key, $value); + } + + public function clear() { + return C::t('common_rank')->delete($this->name); + } + + public function rm($key) { + return $key ? C::t('common_rank')->delete($this->name, $key) : false; + } + +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_session.php b/source/class/discuz/discuz_session.php new file mode 100644 index 0000000..a719bbe --- /dev/null +++ b/source/class/discuz/discuz_session.php @@ -0,0 +1,232 @@ + 0, 'ip' => '', + 'uid' => 0, 'username' => '', 'groupid' => 7, 'invisible' => 0, 'action' => 0, + 'lastactivity' => 0, 'fid' => 0, 'tid' => 0, 'lastolupdate' => 0); + + private $old = array('sid' => '', 'ip' => '', 'uid' => 0); + + private $table; + + public function __construct($sid = '', $ip = '', $uid = 0) { + $this->old = array('sid' => $sid, 'ip' => $ip, 'uid' => $uid); + $this->var = $this->newguest; + + $enable_mem = !C::memory()->gotcluster && C::memory()->gotset && + C::memory()->gothash && C::memory()->goteval && C::memory()->gotsortedset; + if ($enable_mem) { + $this->table = new memory_common_session(); + } else { + $this->table = C::t('common_session'); + } + + if(!empty($ip)) { + $this->init($sid, $ip, $uid); + } + } + + public function set($key, $value) { + if(isset($this->newguest[$key])) { + $this->var[$key] = $value; + } + } + + public function get($key) { + if(isset($this->newguest[$key])) { + return $this->var[$key]; + } + } + + public function init($sid, $ip, $uid) { + $this->old = array('sid' => $sid, 'ip' => $ip, 'uid' => $uid); + $session = array(); + if($sid) { + $session = $this->table->fetch($sid, $ip, $uid); + } + + if(empty($session) || $session['uid'] != $uid) { + $session = $this->create($ip, $uid); + } + + $this->var = $session; + $this->sid = $session['sid']; + } + + public function create($ip, $uid) { + + $this->isnew = true; + $this->var = $this->newguest; + $this->set('sid', random(6)); + $this->set('uid', $uid); + $this->set('ip', $ip); + $uid && $this->set('invisible', getuserprofile('invisible')); + $this->set('lastactivity', time()); + $this->sid = $this->var['sid']; + + return $this->var; + } + + public function delete() { + + return $this->table->delete_by_session($this->var, getglobal('setting/onlinehold'), 60); + + } + + public function update() { + if($this->sid !== null) { + + if($this->isnew) { + $this->delete(); + $this->table->insert($this->var, false, false, true); + } else { + $this->table->update($this->var['sid'], $this->var); + } + setglobal('sessoin', $this->var); + dsetcookie('sid', $this->sid, 86400); + } + } + + public function count($type = 0) { + return $this->table->count($type); + } + + public function fetch_member($ismember = 0, $invisible = 0, $start = 0, $limit = 0) { + return $this->table->fetch_member($ismember, $invisible, $start, $limit); + } + + public function count_invisible($type = 1) { + return $this->table->count_invisible($type); + } + + public function update_max_rows($max_rows) { + return $this->table->update_max_rows($max_rows); + } + + public function clear() { + return $this->table->clear(); + } + + public function count_by_fid($fid) { + return $this->table->count_by_fid($fid); + } + + public function fetch_all_by_fid($fid, $limit = 0) { + $data = array(); + if(!($fid = dintval($fid))) { + return $data; + } + $onlinelist = getglobal('cache/onlinelist'); + foreach($this->table->fetch_all_by_fid($fid, $limit) as $online) { + if($online['uid']) { + $online['icon'] = isset($onlinelist[$online['groupid']]) ? $onlinelist[$online['groupid']] : $onlinelist[0]; + } else { + $online['icon'] = $onlinelist[7]; + $online['username'] = $onlinelist['guest']; + } + $online['lastactivity'] = dgmdate($online['lastactivity'], 't'); + $data[$online['uid']] = $online; + } + return $data; + } + + public function fetch_by_uid($uid) { + return $this->table->fetch_by_uid($uid); + } + + public function fetch_all_by_uid($uids, $start = 0, $limit = 0) { + return $this->table->fetch_all_by_uid($uids, $start, $limit); + } + + public function update_by_uid($uid, $data) { + return $this->table->update_by_uid($uid, $data); + } + + public function count_by_ip($ip) { + return $this->table->count_by_ip($ip); + } + + public function fetch_all_by_ip($ip, $start = 0, $limit = 0) { + return $this->table->fetch_all_by_ip($ip, $start, $limit); + } + + public static function updatesession() { + static $updated = false; + if(!$updated) { + global $_G; + $ulastactivity = 0; + if($_G['uid']) { + if($_G['cookie']['ulastactivity']) { + $ulastactivity = authcode($_G['cookie']['ulastactivity'], 'DECODE'); + } else { + $ulastactivity = getuserprofile('lastactivity'); + dsetcookie('ulastactivity', authcode($ulastactivity, 'ENCODE'), 31536000); + } + } + $ulastactivity = (int)$ulastactivity; + $oltimespan = (int)$_G['setting']['oltimespan']; + $lastolupdate = (int)C::app()->session->var['lastolupdate']; + if($_G['uid'] && $oltimespan && (int)TIMESTAMP - ($lastolupdate ? $lastolupdate : $ulastactivity) > $oltimespan * 60) { + $isinsert = false; + if(C::app()->session->isnew) { + $oldata = C::t('common_onlinetime')->fetch($_G['uid']); + if(empty($oldata)) { + $isinsert = true; + } else if(TIMESTAMP - $oldata['lastupdate'] > $oltimespan * 60) { + C::t('common_onlinetime')->update_onlinetime($_G['uid'], $oltimespan, $oltimespan, TIMESTAMP); + } + } else { + $isinsert = !C::t('common_onlinetime')->update_onlinetime($_G['uid'], $oltimespan, $oltimespan, TIMESTAMP); + } + if($isinsert) { + C::t('common_onlinetime')->insert(array( + 'uid' => $_G['uid'], + 'thismonth' => $oltimespan, + 'total' => $oltimespan, + 'lastupdate' => TIMESTAMP, + )); + } + C::app()->session->set('lastolupdate', TIMESTAMP); + } + foreach(C::app()->session->var as $k => $v) { + if(isset($_G['member'][$k]) && $k != 'lastactivity') { + C::app()->session->set($k, $_G['member'][$k]); + } + } + + foreach($_G['action'] as $k => $v) { + C::app()->session->set($k, $v); + } + + C::app()->session->update(); + + if($_G['uid'] && TIMESTAMP - $ulastactivity > 21600) { + if($oltimespan && TIMESTAMP - $ulastactivity > 43200) { + $onlinetime = C::t('common_onlinetime')->fetch($_G['uid']); + C::t('common_member_count')->update($_G['uid'], array('oltime' => round(intval($onlinetime['total']) / 60))); + } + dsetcookie('ulastactivity', authcode(TIMESTAMP, 'ENCODE'), 31536000); + C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'port' => $_G['remoteport'], 'lastactivity' => TIMESTAMP, 'lastvisit' => TIMESTAMP)); + } + $updated = true; + } + return $updated; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_session_close.php b/source/class/discuz/discuz_session_close.php new file mode 100644 index 0000000..986f0fa --- /dev/null +++ b/source/class/discuz/discuz_session_close.php @@ -0,0 +1,174 @@ + 0, 'ip' => '', + 'uid' => 0, 'username' => '', 'groupid' => 7, 'invisible' => 0, 'action' => 0, + 'lastactivity' => 0, 'fid' => 0, 'tid' => 0, 'lastolupdate' => 0); + + protected $table; + + public function __construct($sid = '', $ip = '', $uid = 0) { + $this->old = array('sid' => $sid, 'ip' => $ip, 'uid' => $uid); + $this->var = $this->newguest; + $this->onlinehold = getglobal('setting/onlinehold'); + $this->oltimestamp = TIMESTAMP - $this->onlinehold; + + $this->table = C::t('common_member_status'); + + if(!empty($ip)) { + $this->init($sid, $ip, $uid); + } + } + + public function set($key, $value) { + if(isset($this->newguest[$key])) { + $this->var[$key] = $value; + } + } + + public function get($key) { + if(isset($this->newguest[$key])) { + return $this->var[$key]; + } + } + + public function init($sid, $ip, $uid) { + if(($uid = intval($uid)) > 0) { + $this->var = $this->newguest; + $this->set('sid', 0); + $this->set('uid', $uid); + $this->set('username', getglobal('member/username')); + $this->set('groupid', getglobal('member/groupid')); + $this->set('ip', $ip); + if(($ulastactivity = getglobal('cookie/ulastactivity'))) { + list($lastactivity, $invisible) = explode('|', $ulastactivity); + $lastactivity = intval($lastactivity); + $invisible = intval($invisible); + } + if(!$lastactivity) { + $lastactivity = getuserprofile('lastactivity'); + $invisible = getuserprofile('invisible'); + dsetcookie('ulastactivity', $lastactivity.'|'.$invisible, 31536000); + } + if($this->oltimestamp >= $lastactivity) { + $this->isnew = true; + } + $this->set('invisible', $invisible); + $this->set('lastactivity', $lastactivity); + $this->sid = 0; + } + } + + public function create($ip, $uid) { + return $this->var; + } + + public function delete() { + return true; + + } + + public function update() { + return true; + } + + public function count($type = 0) { + loadcache('onlinecount'); + $onlinecount = getglobal('cache/onlinecount'); + if($onlinecount && $onlinecount['dateline'] > TIMESTAMP - 600) { + $count = $onlinecount['count']; + } else { + $count = $this->table->count_by_lastactivity_invisible($this->oltimestamp); + savecache('onlinecount', array('count' => $count, 'dateline' => TIMESTAMP)); + } + if($type == 1) { + return $count; + } + + if(!($multiple = getglobal('setting/onlineguestsmultiple'))) $multiple = 11; + $add = mt_rand(0, $multiple); + if($type == 2) { + return intval($count * $multiple) + $add - $count; + } else { + return intval($count * $multiple) + $add; + } + } + + public function fetch_member($ismember = 0, $invisible = 0, $start = 0, $limit = 0) { + return $this->table->fetch_all_by_lastactivity_invisible($this->oltimestamp, $invisible, $start, $limit); + } + + public function count_invisible($type = 1) { + return $this->table->count_by_lastactivity_invisible($this->oltimestamp, $type); + } + + public function update_max_rows($max_rows) { + return false; + } + + public function clear() { + return false; + } + + public function count_by_fid($fid) { + return 0; + } + + public function fetch_all_by_fid($fid, $limit = 0) { + return array(); + } + + public function fetch_by_uid($uid) { + if(($member = $this->table->fetch($uid)) && $member['lastactivity'] >= $this->oltimestamp) { + return $member; + } + return array(); + } + + public function fetch_all_by_uid($uids, $start = 0, $limit = 0) { + return $this->table->fetch_all_onlines($uids, $this->oltimestamp, $start, $limit); + } + + public function update_by_uid($uid, $data) { + return false; + } + + public function count_by_ip($ip) { + return 0; + } + + public function fetch_all_by_ip($ip, $start = 0, $limit = 0) { + return array(); + } + + public function updatesession() { + static $updated = false; + if(!$updated && $this->isnew) { + global $_G; + C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'port' => $_G['remoteport'], 'lastactivity' => TIMESTAMP, 'lastvisit' => TIMESTAMP)); + dsetcookie('ulastactivity', TIMESTAMP.'|'.getuserprofile('invisible'), 31536000); + $updated = true; + } + return $updated; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_table.php b/source/class/discuz/discuz_table.php new file mode 100644 index 0000000..333737b --- /dev/null +++ b/source/class/discuz/discuz_table.php @@ -0,0 +1,247 @@ +_table = $para['table']; + $this->_pk = $para['pk']; + } + if(isset($this->_pre_cache_key) && (($ttl = getglobal('setting/memory/'.$this->_table)) !== null || ($ttl = $this->_cache_ttl) !== null) && memory('check')) { + $this->_cache_ttl = $ttl; + $this->_allowmem = true; + } + $this->_init_extend(); + parent::__construct(); + } + + public function getTable() { + return $this->_table; + } + + public function setTable($name) { + return $this->_table = $name; + } + + public function count() { + $count = (int) DB::result_first("SELECT count(*) FROM ".DB::table($this->_table)); + return $count; + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if(isset($val) && !empty($data) && is_array($data)) { + $this->checkpk(); + $ret = DB::update($this->_table, $data, DB::field($this->_pk, $val), $unbuffered, $low_priority); + foreach((array)$val as $id) { + $this->update_cache($id, $data); + } + return $ret; + } + return !$unbuffered ? 0 : false; + } + + public function delete($val, $unbuffered = false) { + $ret = false; + if(isset($val)) { + $this->checkpk(); + $ret = DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + $this->clear_cache($val); + } + return $ret; + } + + public function truncate() { + DB::query("TRUNCATE ".DB::table($this->_table)); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + return DB::insert($this->_table, $data, $return_insert_id, $replace, $silent); + } + + public function checkpk() { + if(!$this->_pk) { + throw new DbException('Table '.$this->_table.' has not PRIMARY KEY defined'); + } + } + + public function fetch($id, $force_from_db = false){ + $data = array(); + if(!empty($id)) { + if($force_from_db || ($data = $this->fetch_cache($id)) === false) { + $data = DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)); + if(!empty($data)) $this->store_cache($id, $data); + } + } + return $data; + } + + public function fetch_all($ids, $force_from_db = false) { + $data = array(); + if(!empty($ids)) { + if($force_from_db || ($data = $this->fetch_cache($ids)) === false || count($ids) != count($data)) { + if(is_array($data) && !empty($data)) { + $ids = array_diff($ids, array_keys($data)); + } + if($data === false) $data =array(); + if(!empty($ids)) { + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids)); + while($value = DB::fetch($query)) { + $data[$value[$this->_pk]] = $value; + $this->store_cache($value[$this->_pk], $value); + } + } + } + } + return $data; + } + + public function fetch_all_field(){ + $data = false; + $query = DB::query('SHOW FIELDS FROM '.DB::table($this->_table), '', 'SILENT'); + if($query) { + $data = array(); + while($value = DB::fetch($query)) { + $data[$value['Field']] = $value; + } + } + return $data; + } + + public function range($start = 0, $limit = 0, $sort = '') { + if($sort) { + $this->checkpk(); + } + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).($sort ? ' ORDER BY '.DB::order($this->_pk, $sort) : '').DB::limit($start, $limit), null, $this->_pk ? $this->_pk : ''); + } + + public function optimize() { + DB::query('OPTIMIZE TABLE '.DB::table($this->_table), 'SILENT'); + } + + public function fetch_cache($ids, $pre_cache_key = null) { + $data = false; + if($this->_allowmem) { + if($pre_cache_key === null) $pre_cache_key = $this->_pre_cache_key; + $data = memory('get', $ids, $pre_cache_key); + } + return $data; + } + + public function store_cache($id, $data, $cache_ttl = null, $pre_cache_key = null) { + $ret = false; + if($this->_allowmem) { + if($pre_cache_key === null) $pre_cache_key = $this->_pre_cache_key; + if($cache_ttl === null) $cache_ttl = $this->_cache_ttl; + $ret = memory('set', $id, $data, $cache_ttl, $pre_cache_key); + } + return $ret; + } + + public function clear_cache($ids, $pre_cache_key = null) { + $ret = false; + if($this->_allowmem) { + if($pre_cache_key === null) $pre_cache_key = $this->_pre_cache_key; + $ret = memory('rm', $ids, $pre_cache_key); + } + return $ret; + } + + public function update_cache($id, $data, $cache_ttl = null, $pre_cache_key = null) { + $ret = false; + if($this->_allowmem) { + if($pre_cache_key === null) $pre_cache_key = $this->_pre_cache_key; + if($cache_ttl === null) $cache_ttl = $this->_cache_ttl; + if(($_data = memory('get', $id, $pre_cache_key)) !== false) { + $ret = $this->store_cache($id, array_merge($_data, $data), $cache_ttl, $pre_cache_key); + } + } + return $ret; + } + + public function update_batch_cache($ids, $data, $cache_ttl = null, $pre_cache_key = null) { + $ret = false; + if($this->_allowmem) { + if($pre_cache_key === null) $pre_cache_key = $this->_pre_cache_key; + if($cache_ttl === null) $cache_ttl = $this->_cache_ttl; + if(($_data = memory('get', $ids, $pre_cache_key)) !== false) { + foreach($_data as $id => $value) { + $ret = $this->store_cache($id, array_merge($value, $data), $cache_ttl, $pre_cache_key); + } + } + } + return $ret; + } + + public function reset_cache($ids, $pre_cache_key = null) { + $ret = false; + if($this->_allowmem) { + $keys = array(); + if(($cache_data = $this->fetch_cache($ids, $pre_cache_key)) !== false) { + $keys = array_intersect(array_keys($cache_data), $ids); + unset($cache_data); + } + if(!empty($keys)) { + $this->fetch_all($keys, true); + $ret = true; + } + } + return $ret; + } + + public function increase_cache($ids, $data, $cache_ttl = null, $pre_cache_key = null) { + if($this->_allowmem) { + if(($cache_data = $this->fetch_cache($ids, $pre_cache_key)) !== false) { + foreach($cache_data as $id => $one) { + foreach($data as $key => $value) { + if(is_array($value)) { + $one[$key] = $value[0]; + } else { + $one[$key] = $one[$key] + ($value); + } + } + $this->store_cache($id, $one, $cache_ttl, $pre_cache_key); + } + } + } + } + + public function __toString() { + return $this->_table; + } + + protected function _init_extend() { + } + + public function attach_before_method($name, $fn) { + $this->methods[$name][0][] = $fn; + } + + public function attach_after_method($name, $fn) { + $this->methods[$name][1][] = $fn; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_table_archive.php b/source/class/discuz/discuz_table_archive.php new file mode 100644 index 0000000..b873bae --- /dev/null +++ b/source/class/discuz/discuz_table_archive.php @@ -0,0 +1,150 @@ +membersplit = getglobal('setting/membersplit'); + parent::__construct($para); + } + + public $tablestatus = array(); + + public function fetch($id, $force_from_db = false, $fetch_archive = 0){ + $data = array(); + if(!empty($id)) { + $data = parent::fetch($id, $force_from_db); + if(isset($this->membersplit) && $fetch_archive && empty($data)) { + $data = C::t($this->_table.'_archive')->fetch($id); + } + } + return $data; + } + + + public function fetch_all($ids, $force_from_db = false, $fetch_archive = 1) { + $data = array(); + if(!empty($ids)) { + $data = parent::fetch_all($ids, $force_from_db); + if(isset($this->membersplit) && $fetch_archive && count($data) != count($ids)) { + $data = $data + C::t($this->_table.'_archive')->fetch_all(array_diff($ids, array_keys($data))); + } + } + return $data; + } + + + public function delete($val, $unbuffered = false, $fetch_archive = 0) { + $ret = false; + if($val) { + $ret = parent::delete($val, $unbuffered); + if(isset($this->membersplit) && $fetch_archive) { + $_ret = C::t($this->_table.'_archive')->delete($val, $unbuffered); + if(!$unbuffered) { + $ret = $ret + $_ret; + } + } + } + return $ret; + } + + public function split_check($wheresql) { + $status = helper_dbtool::gettablestatus(DB::table($this->_table), false); + if($status && $status['Data_length'] > 100 * 1048576) {//400 * 1048576 + if($moverows = DB::result_first('SELECT COUNT(*) FROM %t WHERE '.$wheresql, array($this->_table))) { + $status['Move_rows'] = $moverows; + $this->tablestatus = $status; + return true; + } + } + return false; + } + + public function create_relatedtable($relatedtablename) { + if(!helper_dbtool::isexisttable($relatedtablename)) { + DB::query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT'); + $tableinfo = DB::fetch_first("SHOW CREATE TABLE ".DB::table($this->_table)); + $createsql = $tableinfo['Create Table']; + $createsql = str_replace($this->_table, $relatedtablename, $createsql); + DB::query($createsql); + } + return true; + } + + public function split_table($wheresql) { + $limit = 2000; + $targettable = helper_dbtool::showtablecloumn($this->_table); + $fieldstr = '`'.implode('`, `', array_keys($targettable)).'`'; + + if(!$this->_pk && !in_array('split_id', array_keys($targettable))) { + DB::query('ALTER TABLE %t ADD split_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, ADD UNIQUE KEY split_id (split_id)', array($this->_table)); + return 1; + } + + $tmptable = $this->_table.'_tmp___'; + $archivetable = $this->_table.'_archive'; + $key = $this->_pk ? $this->_pk : 'split_id'; + $this->create_relatedtable($tmptable); + $this->create_relatedtable($archivetable); + DB::query("INSERT INTO %t ($fieldstr) SELECT $fieldstr FROM %t WHERE $wheresql ".DB::limit($limit), array($tmptable, $this->_table)); + if(DB::result_first('SELECT COUNT(*) FROM %t', array($tmptable))) { + $keylist = DB::fetch_all('SELECT '.$key.' FROM %t', array($tmptable), $key); + $keylist = dimplode(array_keys($keylist)); + if(DB::query("INSERT INTO %t ($fieldstr) SELECT $fieldstr FROM %t WHERE $key in ($keylist)", array($archivetable, $this->_table), false, true)) { + DB::query("DELETE FROM %t WHERE $key in ($keylist)", array($this->_table), false, true); + } + DB::query('DROP TABLE %t', array($tmptable)); + return 1; + } else { + DB::query('DROP TABLE %t', array($tmptable)); + $this->optimize(); + return 2; + } + } + + public function merge_table() { + $limit = 2000; + + $tmptable = $this->_table.'_tmp___'; + $archivetable = $this->_table.'_archive'; + $key = $this->_pk ? $this->_pk : 'split_id'; + + if(!helper_dbtool::isexisttable($archivetable)) { + return 2; + } + + $this->create_relatedtable($tmptable); + $targettable = helper_dbtool::showtablecloumn($this->_table); + $fieldstr = '`'.implode('`, `', array_keys($targettable)).'`'; + DB::query("INSERT INTO %t ($fieldstr) SELECT $fieldstr FROM %t ".DB::limit($limit), array($tmptable, $archivetable)); + if(DB::result_first('SELECT COUNT(*) FROM %t', array($tmptable))) { + $keylist = DB::fetch_all('SELECT '.$key.' FROM %t', array($tmptable), $key); + $keylist = dimplode(array_keys($keylist)); + if(DB::query("INSERT INTO %t ($fieldstr) SELECT $fieldstr FROM %t WHERE $key in ($keylist)", array($this->_table, $archivetable), false, true)) { + DB::query("DELETE FROM %t WHERE $key in ($keylist)", array($archivetable), false, true); + } + DB::query('DROP TABLE %t', array($tmptable)); + return 1; + } else { + DB::query('DROP TABLE %t', array($tmptable)); + DB::query('DROP TABLE %t', array($archivetable)); + $this->optimize(); + return 2; + } + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_upgrade.php b/source/class/discuz/discuz_upgrade.php new file mode 100644 index 0000000..3aa344f --- /dev/null +++ b/source/class/discuz/discuz_upgrade.php @@ -0,0 +1,269 @@ +upgradeurl.substr($upgradeinfo['upgradelist'], 0, -4).strtolower('_'.$this->locale.'_'.$this->charset).'.txt'); + $upgradedataflag = false; + } + + $return = array(); + $upgradedataarr = explode("\r\n", $upgradedata); + foreach($upgradedataarr as $k => $v) { + if(!$v) { + continue; + } + $return['file'][$k] = trim(substr($v, 34)); + $return['md5'][$k] = substr($v, 0, 32); + if(trim(substr($v, 32, 2)) != '*') { + @unlink($file); + return array(); + } + + } + if(!$upgradedataflag) { + $this->mkdirs(dirname($file)); + if(file_put_contents($file, $upgradedata) === false) { + return array(); + } + } + + return $return; + } + + public function compare_basefile($upgradeinfo, $upgradefilelist) { + if(!$discuzfiles = @file('./source/admincp/discuzfiles.md5')) { + return array(); + } + + $newupgradefilelist = array(); + foreach($upgradefilelist as $v) { + $newupgradefilelist[$v] = md5_file(DISCUZ_ROOT.'./'.$v); + } + + $modifylist = $showlist = $searchlist = array(); + foreach($discuzfiles as $line) { + $file = trim(substr($line, 34)); + $md5datanew[$file] = substr($line, 0, 32); + if(isset($newupgradefilelist[$file])) { + if($md5datanew[$file] != $newupgradefilelist[$file]) { + if(!$upgradeinfo['isupdatetemplate'] && preg_match('/\.htm$/i', $file)) { + $ignorelist[$file] = $file; + $searchlist[] = "\r\n".$file; + continue; + } + $modifylist[$file] = $file; + } else { + $showlist[$file] = $file; + } + } + } + if($searchlist) { + $file = DISCUZ_ROOT.'./data/update/Discuz! X'.$upgradeinfo['latestversion'].' Release['.$upgradeinfo['latestrelease'].']/updatelist.tmp'; + $upgradedata = file_get_contents($file); + $upgradedata = str_replace($searchlist, '', $upgradedata); + if(file_put_contents($file, $upgradedata) === false) { + return array(); + } + } + + return array($modifylist, $showlist, $ignorelist); + } + + public function compare_file_content($file, $remotefile) { + if(!preg_match('/\.php$|\.htm$/i', $file)) { + return false; + } + $content = preg_replace('/\s/', '', file_get_contents($file)); + $ctx = stream_context_create(array('http' => array('timeout' => 60))); + $remotecontent = preg_replace('/\s/', '', file_get_contents($remotefile, false, $ctx)); + if(strcmp($content, $remotecontent)) { + return false; + } else { + return true; + } + } + + public function check_upgrade() { + + include_once libfile('class/xml'); + include_once libfile('function/cache'); + + $return = false; + $upgradefile = $this->upgradeurl.$this->versionpath().'/'.DISCUZ_RELEASE.'/upgrade.xml'; + $response_xml = dfsockopen($upgradefile); + $response = xml2array($response_xml); + if(isset($response['cross']) || isset($response['patch'])) { + C::t('common_setting')->update_setting('upgrade', $response); + $return = true; + } else { + C::t('common_setting')->update_setting('upgrade', ''); + $return = false; + } + updatecache('setting'); + return $return; + } + + public function check_folder_perm($updatefilelist) { + foreach($updatefilelist as $file) { + if(!file_exists(DISCUZ_ROOT.$file)) { + if(!$this->test_writable(dirname(DISCUZ_ROOT.$file))) { + return false; + } + } else { + if(!is_writable(DISCUZ_ROOT.$file)) { + return false; + } + } + } + return true; + } + + public function test_writable($dir) { + $writeable = 0; + $this->mkdirs($dir); + if(is_dir($dir)) { + if($fp = @fopen("$dir/test.txt", 'w')) { + @fclose($fp); + @unlink("$dir/test.txt"); + $writeable = 1; + } else { + $writeable = 0; + } + } + return $writeable; + } + + + public function download_file($upgradeinfo, $file, $folder = 'upload', $md5 = '', $position = 0, $offset = 0) { + $dir = DISCUZ_ROOT.'./data/update/Discuz! X'.$upgradeinfo['latestversion'].' Release['.$upgradeinfo['latestrelease'].']/'; + $this->mkdirs(dirname($dir.$file)); + $downloadfileflag = true; + + if(!$position) { + $mode = 'wb'; + } else { + $mode = 'ab'; + } + $fp = fopen($dir.$file, $mode); + if(!$fp) { + return 0; + } + $response = dfsockopen($this->upgradeurl.$upgradeinfo['latestversion'].'/'.$upgradeinfo['latestrelease'].'/'.$this->locale.'_'.$this->charset.'/'.$folder.'/'.$file.'sc', $offset, '', '', FALSE, '', 120, TRUE, 'URLENCODE', FALSE, $position); + if($response) { + if($offset && strlen($response) == $offset) { + $downloadfileflag = false; + } + fwrite($fp, $response); + } + fclose($fp); + + if($downloadfileflag) { + if(md5_file($dir.$file) == $md5) { + return 2; + } else { + return 0; + } + } else { + return 1; + } + } + + public function mkdirs($dir) { + if(!is_dir($dir)) { + if(!self::mkdirs(dirname($dir))) { + return false; + } + if(!@mkdir($dir, 0777)) { + return false; + } + @touch($dir.'/index.htm'); @chmod($dir.'/index.htm', 0777); + } + return true; + } + + public function copy_file($srcfile, $desfile, $type) { + global $_G; + + if(!is_file($srcfile)) { + return false; + } + if($type == 'file') { + $this->mkdirs(dirname($desfile)); + copy($srcfile, $desfile); + } elseif($type == 'ftp') { + $siteftp = $_GET['siteftp']; + $siteftp['on'] = 1; + $siteftp['password'] = authcode($siteftp['password'], 'ENCODE', md5($_G['config']['security']['authkey'])); + $ftp = & discuz_ftp::instance($siteftp); + $ftp->connect(); + $ftp->upload($srcfile, $desfile); + if($ftp->error()) { + return false; + } + } + return true; + } + + public function versionpath() { + $versionpath = ''; + foreach(explode(' ', substr(DISCUZ_VERSION, 1)) as $unit) { + $versionpath = $unit; + break; + } + return $versionpath; + } + + function copy_dir($srcdir, $destdir) { + $dir = @opendir($srcdir); + while($entry = @readdir($dir)) { + $file = $srcdir.$entry; + if($entry != '.' && $entry != '..') { + if(is_dir($file)) { + self::copy_dir($file.'/', $destdir.$entry.'/'); + } else { + self::mkdirs(dirname($destdir.$entry)); + copy($file, $destdir.$entry); + } + } + } + closedir($dir); + } + + function rmdirs($srcdir) { + $dir = @opendir($srcdir); + while($entry = @readdir($dir)) { + $file = $srcdir.$entry; + if($entry != '.' && $entry != '..') { + if(is_dir($file)) { + self::rmdirs($file.'/'); + } else { + @unlink($file); + } + } + } + closedir($dir); + rmdir($srcdir); + } +} +?> \ No newline at end of file diff --git a/source/class/discuz/discuz_upload.php b/source/class/discuz/discuz_upload.php new file mode 100644 index 0000000..e9e1d7f --- /dev/null +++ b/source/class/discuz/discuz_upload.php @@ -0,0 +1,251 @@ +is_upload_file($attach['tmp_name']) || trim($attach['name']) == '' || $attach['size'] == 0) { + $this->attach = array(); + $this->errorcode = -1; + return false; + } else { + $this->type = $this->check_dir_type($type); + $this->extid = intval($extid); + $this->forcename = preg_match("/^[a-z0-9_]+$/i", $forcename) ? $forcename : ''; + $subdir = preg_match("/^[a-z0-9_]+$/i", $subdir) ? $subdir : ''; + $filename = preg_match("/^[a-z0-9_]+$/i", $filename) ? $filename : ''; + + $attach['size'] = intval($attach['size']); + $attach['name'] = trim($attach['name']); + $attach['thumb'] = ''; + $attach['ext'] = $this->fileext($attach['name']); + + $attach['name'] = dhtmlspecialchars($attach['name'], ENT_QUOTES); + if(dstrlen($attach['name']) > 90) { + $attach['name'] = cutstr($attach['name'], 80, '').'.'.$attach['ext']; + } + + $attach['isimage'] = $this->is_image_ext($attach['ext']); + $attach['extension'] = $this->get_target_extension($attach['ext']); + $attach['attachdir'] = $this->get_target_dir($this->type, $extid, true, $subdir, $dirtype); + $attach['attachment'] = $attach['attachdir'].$this->get_target_filename($this->type, $this->extid, $this->forcename, $filename).'.'.$attach['extension']; + $attach['target'] = getglobal('setting/attachdir').'./'.$this->type.'/'.$attach['attachment']; + $this->attach = & $attach; + $this->errorcode = 0; + return true; + } + + } + + function save($ignore = 0) { + if($ignore) { + if(!$this->save_to_local($this->attach['tmp_name'], $this->attach['target'])) { + $this->errorcode = -103; + return false; + } else { + $this->errorcode = 0; + return true; + } + } + + if(empty($this->attach) || empty($this->attach['tmp_name']) || empty($this->attach['target'])) { + $this->errorcode = -101; + } elseif(in_array($this->type, array('group', 'album', 'category')) && !$this->attach['isimage']) { + $this->errorcode = -102; + } elseif(in_array($this->type, array('common')) && (!$this->attach['isimage'] && !in_array($this->attach['ext'], array('ext', 'svg')))) { + $this->errorcode = -102; + } elseif(!$this->save_to_local($this->attach['tmp_name'], $this->attach['target'])) { + $this->errorcode = -103; + } elseif(($this->attach['isimage'] || $this->attach['ext'] == 'swf') && (!$this->attach['imageinfo'] = $this->get_image_info($this->attach['target'], true))) { + $this->errorcode = -104; + @unlink($this->attach['target']); + } else { + $this->errorcode = 0; + return true; + } + + return false; + } + + function error() { + return $this->errorcode; + } + + function errormessage() { + return lang('error', 'file_upload_error_'.$this->errorcode); + } + + public static function fileext($filename) { + return addslashes(strtolower(substr(strrchr($filename, '.'), 1, 10))); + } + + public static function is_image_ext($ext) { + static $imgext = array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'webp'); + return in_array($ext, $imgext) ? 1 : 0; + } + + public static function get_image_info($target, $allowswf = false) { + $ext = discuz_upload::fileext($target); + $isimage = discuz_upload::is_image_ext($ext); + if(!$isimage && ($ext != 'swf' || !$allowswf)) { + return false; + } elseif(!is_readable($target)) { + return false; + } elseif($imageinfo = @getimagesize($target)) { + list($width, $height, $type) = !empty($imageinfo) ? $imageinfo : array('', '', ''); + $size = $width * $height; + if((!getglobal('setting/imagelib') && $size > (getglobal('setting/gdlimit') ? getglobal('setting/gdlimit') : 16777216)) || $size < 16 ) { + return false; + } elseif($ext == 'swf' && $type != 4 && $type != 13) { + return false; + } elseif($isimage && !in_array($type, array(1,2,3,6,13,18))) { + return false; + } elseif(!$allowswf && ($ext == 'swf' || $type == 4 || $type == 13)) { + return false; + } + return $imageinfo; + } else { + return false; + } + } + + public static function is_upload_file($source) { + return $source && ($source != 'none') && (is_uploaded_file($source) || is_uploaded_file(str_replace('\\\\', '\\', $source))); + } + + public static function get_target_filename($type, $extid = 0, $forcename = '', $filename = '') { + if (empty($filename)) { + if($type == 'group' || ($type == 'common' && $forcename != '')) { + $filename = $type.'_'.intval($extid).($forcename != '' ? "_$forcename" : ''); + } else { + $filename = date('His').strtolower(random(16)); + } + } + return $filename; + } + + public static function get_target_extension($ext) { + static $safeext = array('attach', 'jpg', 'jpeg', 'gif', 'png', 'webp', 'swf', 'bmp', 'txt', 'zip', 'rar', 'mp3'); + if(defined('IN_ADMINCP')) { + $safeext[] = 'svg'; + } + return strtolower(!in_array(strtolower($ext), $safeext) ? 'attach' : $ext); + } + + public static function get_target_dir($type, $extid = '', $check_exists = true, $subdir = '', $dirtype = 1) { + + $dir = $subdir1 = $subdir2 = ''; + if($dirtype == 1) { + if($type == 'group' || $type == 'common') { + $dir = $subdir1 = substr(md5($extid), 0, 2).'/'; + } elseif($type != 'temp') { + $subdir1 = date('Ym'); + $subdir2 = date('d'); + $dir = $subdir1.'/'.$subdir2.'/'; + } + } elseif($dirtype == 2) { + $subdir1 = date('Ym'); + $subdir2 = date('d'); + $dir = $subdir1.'/'.$subdir2.'/'; + } elseif($dirtype == 3) { + $dir = $subdir1 = substr(md5($extid), 0, 2).'/'; + } + + if($subdir) { + $dir = $subdir.'/'.$dir; + } + + if($check_exists) { + if($subdir) { + discuz_upload::check_dir_exists($type, $subdir, $subdir1); + discuz_upload::check_dir_exists($type, $subdir.'/'.$subdir1.'/'.$subdir2); + } else { + discuz_upload::check_dir_exists($type, $subdir1, $subdir2); + } + } + + return $dir; + } + + public static function check_dir_type($type) { + return preg_match("/^[a-z]+[a-z0-9_]*$/i", $type) ? $type : 'temp'; + } + + public static function check_dir_exists($type = '', $sub1 = '', $sub2 = '') { + + $type = discuz_upload::check_dir_type($type); + + $basedir = !getglobal('setting/attachdir') ? (DISCUZ_ROOT.'./data/attachment') : getglobal('setting/attachdir'); + + $typedir = $type ? ($basedir.'/'.$type) : ''; + $subdir1 = $type && $sub1 !== '' ? ($typedir.'/'.$sub1) : ''; + $subdir2 = $sub1 && $sub2 !== '' ? ($subdir1.'/'.$sub2) : ''; + + $res = $subdir2 ? is_dir($subdir2) : ($subdir1 ? is_dir($subdir1) : is_dir($typedir)); + if(!$res) { + $res = $typedir && discuz_upload::make_dir($typedir); + $res && $subdir1 && ($res = discuz_upload::make_dir($subdir1)); + $res && $subdir1 && $subdir2 && ($res = discuz_upload::make_dir($subdir2)); + } + + return $res; + } + + function save_to_local($source, $target) { + if(!discuz_upload::is_upload_file($source)) { + $succeed = false; + }elseif(@copy($source, $target)) { + $succeed = true; + }elseif(function_exists('move_uploaded_file') && @move_uploaded_file($source, $target)) { + $succeed = true; + }elseif (@is_readable($source) && (@$fp_s = fopen($source, 'rb')) && (@$fp_t = fopen($target, 'wb'))) { + while (!feof($fp_s)) { + $s = @fread($fp_s, 1024 * 512); + @fwrite($fp_t, $s); + } + fclose($fp_s); fclose($fp_t); + $succeed = true; + } + if($succeed) { + $this->errorcode = 0; + @chmod($target, 0644); @unlink($source); + } else { + $this->errorcode = 0; + } + + return $succeed; + } + + public static function make_dir($dir, $index = true) { + $res = true; + if(!is_dir($dir)) { + $res = @mkdir($dir, 0777); + $index && @touch($dir.'/index.html'); + } + return $res; + } +} + +?> \ No newline at end of file diff --git a/source/class/discuz/index.htm b/source/class/discuz/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/extend/extend_thread_activity.php b/source/class/extend/extend_thread_activity.php new file mode 100644 index 0000000..738a530 --- /dev/null +++ b/source/class/extend/extend_thread_activity.php @@ -0,0 +1,172 @@ +activitytime = intval($_GET['activitytime']); + if(empty($_GET['starttimefrom'][$this->activitytime])) { + showmessage('activity_fromtime_please'); + } elseif(@strtotime($_GET['starttimefrom'][$this->activitytime]) === -1 || @strtotime($_GET['starttimefrom'][$this->activitytime]) === FALSE) { + showmessage('activity_fromtime_error'); + } elseif($this->activitytime && ((@strtotime($_GET['starttimefrom'][$this->activitytime]) > @strtotime($_GET['starttimeto']) || !$_GET['starttimeto']))) { + showmessage('activity_fromtime_error'); + } elseif(!trim($_GET['activityclass'])) { + showmessage('activity_sort_please'); + } elseif(!trim($_GET['activityplace'])) { + showmessage('activity_address_please'); + } elseif(trim($_GET['activityexpiration']) && (@strtotime($_GET['activityexpiration']) === -1 || @strtotime($_GET['activityexpiration']) === FALSE)) { + showmessage('activity_totime_error'); + } + + $this->activity = array(); + $this->activity['class'] = censor(dhtmlspecialchars(trim($_GET['activityclass']))); + $this->activity['starttimefrom'] = @strtotime($_GET['starttimefrom'][$this->activitytime]); + $this->activity['starttimeto'] = $this->activitytime ? @strtotime($_GET['starttimeto']) : 0; + $this->activity['place'] = censor(dhtmlspecialchars(trim($_GET['activityplace']))); + $this->activity['cost'] = intval($_GET['cost']); + $this->activity['gender'] = intval($_GET['gender']); + $this->activity['number'] = intval($_GET['activitynumber']); + + if($_GET['activityexpiration']) { + $this->activity['expiration'] = @strtotime($_GET['activityexpiration']); + } else { + $this->activity['expiration'] = 0; + } + if(trim($_GET['activitycity'])) { + $this->param['subject'] = $parameters['subject'].'['.dhtmlspecialchars(trim($_GET['activitycity'])).']'; + } + $extfield = $_GET['extfield']; + $extfield = explode("\n", $_GET['extfield']); + foreach($extfield as $key => $value) { + $extfield[$key] = dhtmlspecialchars(strip_tags(censor(trim($value)))); + if($extfield[$key] === '' || is_numeric($extfield[$key])) { + unset($extfield[$key]); + } + } + $extfield = array_unique($extfield); + if(count($extfield) > $this->setting['activityextnum']) { + showmessage('post_activity_extfield_toomany', '', array('maxextfield' => $this->setting['activityextnum'])); + } + $this->activity['ufield'] = array('userfield' => $_GET['userfield'], 'extfield' => $extfield); + $this->activity['ufield'] = serialize($this->activity['ufield']); + if(intval($_GET['activitycredit']) > 0) { + $this->activity['credit'] = intval($_GET['activitycredit']); + } + $this->param['extramessage'] = "\t".$_GET['activityplace']."\t".$_GET['activitycity']."\t".$_GET['activityclass']; + } + + public function after_newthread() { + if($this->group['allowpostactivity']) { + $data = array('tid' => $this->tid, 'uid' => $this->member['uid'], 'cost' => $this->activity['cost'], 'starttimefrom' => $this->activity['starttimefrom'], 'starttimeto' => $this->activity['starttimeto'], 'place' => $this->activity['place'], 'class' => $this->activity['class'], 'gender' => $this->activity['gender'], 'number' => $this->activity['number'], 'expiration' => $this->activity['expiration'], 'aid' => $_GET['activityaid'], 'ufield' => $this->activity['ufield'], 'credit' => $this->activity['credit']); + C::t('forum_activity')->insert($data); + } + } + + public function before_feed() { + $message = !$this->param['price'] && !$this->param['readperm'] ? $this->param['message'] : ''; + $this->feed['icon'] = 'activity'; + $this->feed['title_template'] = 'feed_thread_activity_title'; + $this->feed['body_template'] = 'feed_thread_activity_message'; + $this->feed['body_data'] = array( + 'subject' => "tid}\">{$this->param['subject']}", + 'starttimefrom' => $_GET['starttimefrom'][$this->activitytime], + 'activityplace'=> $this->activity['place'], + 'message' => messagecutstr($message, 150), + ); + if($_GET['activityaid']) { + $this->feed['images'] = array(getforumimg($_GET['activityaid'])); + $this->feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$this->tid}&pid={$this->pid}"); + } + } + + public function before_editpost($parameters) { + $isfirstpost = $this->post['first'] ? 1 : 0; + if($isfirstpost) { + if($this->thread['special'] == 4 && $this->group['allowpostactivity']) { + $activitytime = intval($_GET['activitytime']); + if(empty($_GET['starttimefrom'][$activitytime])) { + showmessage('activity_fromtime_please'); + } elseif(strtotime($_GET['starttimefrom'][$activitytime]) === -1 || @strtotime($_GET['starttimefrom'][$activitytime]) === FALSE) { + showmessage('activity_fromtime_error'); + } elseif($activitytime && ((@strtotime($_GET['starttimefrom'][$activitytime]) > @strtotime($_GET['starttimeto']) || !$_GET['starttimeto']))) { + showmessage('activity_fromtime_error'); + } elseif(!trim($_GET['activityclass'])) { + showmessage('activity_sort_please'); + } elseif(!trim($_GET['activityplace'])) { + showmessage('activity_address_please'); + } elseif(trim($_GET['activityexpiration']) && (@strtotime($_GET['activityexpiration']) === -1 || @strtotime($_GET['activityexpiration']) === FALSE)) { + showmessage('activity_totime_error'); + } + + $activity = array(); + $activity['class'] = censor(dhtmlspecialchars(trim($_GET['activityclass']))); + $activity['starttimefrom'] = @strtotime($_GET['starttimefrom'][$activitytime]); + $activity['starttimeto'] = $activitytime ? @strtotime($_GET['starttimeto']) : 0; + $activity['place'] = censor(dhtmlspecialchars(trim($_GET['activityplace']))); + $activity['cost'] = intval($_GET['cost']); + $activity['gender'] = intval($_GET['gender']); + $activity['number'] = intval($_GET['activitynumber']); + if($_GET['activityexpiration']) { + $activity['expiration'] = @strtotime($_GET['activityexpiration']); + } else { + $activity['expiration'] = 0; + } + $extfield = $_GET['extfield']; + $extfield = explode("\n", $_GET['extfield']); + foreach($extfield as $key => $value) { + $extfield[$key] = dhtmlspecialchars(strip_tags(censor(trim($value)))); + if($extfield[$key] === '' || is_numeric($extfield[$key])) { + unset($extfield[$key]); + } + } + $extfield = array_unique($extfield); + if(count($extfield) > $this->setting['activityextnum']) { + showmessage('post_activity_extfield_toomany', '', array('maxextfield' => $this->setting['activityextnum'])); + } + $activity['ufield'] = array('userfield' => $_GET['userfield'], 'extfield' => $extfield); + $activity['ufield'] = serialize($activity['ufield']); + if(intval($_GET['activitycredit']) > 0) { + $activity['credit'] = intval($_GET['activitycredit']); + } + $data = array('cost' => $activity['cost'], 'starttimefrom' => $activity['starttimefrom'], 'starttimeto' => $activity['starttimeto'], 'place' => $activity['place'], 'class' => $activity['class'], 'gender' => $activity['gender'], 'number' => $activity['number'], 'expiration' => $activity['expiration'], 'ufield' => $activity['ufield'], 'credit' => $activity['credit']); + C::t('forum_activity')->update($this->thread['tid'], $data); + + } + } + + + if($parameters['special'] == 4 && $isfirstpost && $this->group['allowpostactivity']) { + $activity = C::t('forum_activity')->fetch($this->thread['tid']); + $activityaid = $activity['aid']; + if($activityaid && $activityaid != $_GET['activityaid']) { + $attach = C::t('forum_attachment_n')->fetch_attachment('tid:'.$this->thread['tid'], $activityaid); + C::t('forum_attachment')->delete($activityaid); + C::t('forum_attachment_n')->delete_attachment('tid:'.$this->thread['tid'], $activityaid); + dunlink($attach); + } + if($_GET['activityaid']) { + $threadimageaid = $_GET['activityaid']; + convertunusedattach($_GET['activityaid'], $this->thread['tid'], $this->post['pid']); + C::t('forum_activity')->update($this->thread['tid'], array('aid' => $_GET['activityaid'])); + } + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_allowat.php b/source/class/extend/extend_thread_allowat.php new file mode 100644 index 0000000..1eb4c3e --- /dev/null +++ b/source/class/extend/extend_thread_allowat.php @@ -0,0 +1,184 @@ +group['allowat']) { + $this->atlist = $atlist_tmp = array(); + preg_match_all("/@([^\r\n]*?)\s/i", $parameters['message'].' ', $atlist_tmp); + $atlist_tmp = array_slice(array_unique($atlist_tmp[1]), 0, $this->group['allowat']); + if(!empty($atlist_tmp)) { + if(!$this->setting['at_anyone']) { + foreach(C::t('home_follow')->fetch_all_by_uid_fusername($this->member['uid'], $atlist_tmp) as $row) { + $this->atlist[$row['followuid']] = $row['fusername']; + } + if(count($this->atlist) < $this->group['allowat']) { + $query = C::t('home_friend')->fetch_all_by_uid_username($this->member['uid'], $atlist_tmp); + foreach($query as $row) { + $this->atlist[$row['fuid']] = $row['fusername']; + } + } + } else { + foreach(C::t('common_member')->fetch_all_by_username($atlist_tmp) as $row) { + $this->atlist[$row['uid']] = $row['username']; + } + } + } + if($this->atlist) { + foreach($this->atlist as $atuid => $atusername) { + $atsearch[] = "/@".preg_quote($atusername, '/')." /i"; + $atreplace[] = "[url=home.php?mod=space&uid=$atuid]@{$atusername}[/url] "; + } + $this->param['message'] = preg_replace($atsearch, $atreplace, $parameters['message'].' ', 1); + $this->param['message'] = substr($this->param['message'], 0, strlen($this->param['message']) - 1); + } + } + } + + public function after_newthread() { + if($this->group['allowat'] && $this->atlist) { + foreach($this->atlist as $atuid => $atusername) { + notification_add($atuid, 'at', 'at_message', array('from_id' => $this->tid, 'from_idtype' => 'at', 'buyerid' => $this->member['uid'], 'buyer' => $this->member['username'], 'tid' => $this->tid, 'subject' => $this->param['subject'], 'pid' => $this->pid, 'message' => messagecutstr($this->param['message'], 150))); + } + set_atlist_cookie(array_keys($this->atlist)); + } + } + + public function before_newreply($parameters) { + if($this->group['allowat']) { + $this->atlist = $atlist_tmp = $ateduids = array(); + preg_match_all("/@([^\r\n]*?)\s/i", $parameters['message'].' ', $atlist_tmp); + $atlist_tmp = array_slice(array_unique($atlist_tmp[1]), 0, $this->group['allowat']); + $atnum = $maxselect = 0; + foreach(C::t('home_notification')->fetch_all_by_authorid_fromid($this->member['uid'], $this->thread['tid'], 'at') as $row) { + $atnum ++; + $ateduids[$row['uid']] = $row['uid']; + } + $maxselect = $this->group['allowat'] - $atnum; + if($maxselect > 0 && !empty($atlist_tmp)) { + $at_anyone = $this->setting['at_anyone']; + if(empty($at_anyone)) { + foreach(C::t('home_follow')->fetch_all_by_uid_fusername($this->member['uid'], $atlist_tmp) as $row) { + if(!in_array($row['followuid'], $ateduids)) { + $this->atlist[$row['followuid']] = $row['fusername']; + } + if(count($this->atlist) == $maxselect) { + break; + } + } + if(count($this->atlist) < $maxselect) { + $query = C::t('home_friend')->fetch_all_by_uid_username($this->member['uid'], $atlist_tmp); + foreach($query as $row) { + if(!in_array($row['fuid'], $ateduids)) { + $this->atlist[$row['fuid']] = $row['fusername']; + } + } + } + } else { + foreach(C::t('common_member')->fetch_all_by_username($atlist_tmp) as $row) { + if(!in_array($row['uid'], $ateduids)) { + $this->atlist[$row['uid']] = $row['username']; + } + if(count($this->atlist) == $maxselect) { + break; + } + } + } + } + if($this->atlist) { + foreach($this->atlist as $atuid => $atusername) { + $atsearch[] = "/@".preg_quote($atusername, '/')." /i"; + $atreplace[] = "[url=home.php?mod=space&uid=$atuid]@{$atusername}[/url] "; + } + $this->param['message'] = preg_replace($atsearch, $atreplace, $parameters['message'].' ', 1); + $this->param['message'] = substr($this->param['message'], 0, strlen($this->param['message']) - 1); + } + } + } + + public function after_newreply() { + if($this->group['allowat'] && $this->atlist) { + foreach($this->atlist as $atuid => $atusername) { + notification_add($atuid, 'at', 'at_message', array('from_id' => $this->thread['tid'], 'from_idtype' => 'at', 'buyerid' => $this->member['uid'], 'buyer' => $this->member['username'], 'tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'pid' => $this->pid, 'message' => messagecutstr($this->param['message'], 150))); + } + set_atlist_cookie(array_keys($this->atlist)); + } + } + + public function before_editpost($parameters) { + if($this->group['allowat']) { + $this->atlist = $atlist_tmp = $ateduids = array(); + $atnum = $maxselect = 0; + foreach(C::t('home_notification')->fetch_all_by_authorid_fromid($this->member['uid'], $this->thread['tid'], 'at') as $row) { + $atnum ++; + $ateduids[$row['uid']] = $row['uid']; + } + $maxselect = $this->group['allowat'] - $atnum; + preg_match_all("/@([^\r\n]*?)\s/i", $parameters['message'].' ', $atlist_tmp); + $atlist_tmp = array_slice(array_unique($atlist_tmp[1]), 0, $this->group['allowat']); + if($maxselect > 0 && !empty($atlist_tmp)) { + if(empty($this->setting['at_anyone'])) { + foreach(C::t('home_follow')->fetch_all_by_uid_fusername($this->member['uid'], $atlist_tmp) as $row) { + if(!in_array($row['followuid'], $ateduids)) { + $this->atlist[$row['followuid']] = $row['fusername']; + } + if(count($this->atlist) == $maxselect) { + break; + } + } + if(count($this->atlist) < $maxselect) { + $query = C::t('home_friend')->fetch_all_by_uid_username($this->member['uid'], $atlist_tmp); + foreach($query as $row) { + if(!in_array($row['fuid'], $ateduids)) { + $this->atlist[$row['fuid']] = $row['fusername']; + } + } + } + } else { + foreach(C::t('common_member')->fetch_all_by_username($atlist_tmp) as $row) { + if(!in_array($row['uid'], $ateduids)) { + $this->atlist[$row['uid']] = $row['username']; + } + if(count($this->atlist) == $maxselect) { + break; + } + } + } + if($this->atlist) { + foreach($this->atlist as $atuid => $atusername) { + $atsearch[] = "/@".preg_quote($atusername, '/')." /i"; + $atreplace[] = "[url=home.php?mod=space&uid=$atuid]@{$atusername}[/url] "; + } + $this->param['message'] = preg_replace($atsearch, $atreplace, $parameters['message'].' ', 1); + $this->param['message'] = substr($this->param['message'], 0, strlen($this->param['message']) - 1); + } + } + } + } + + public function after_editpost() { + if($this->group['allowat'] && $this->atlist) { + foreach($this->atlist as $atuid => $atusername) { + notification_add($atuid, 'at', 'at_message', array('from_id' => $this->thread['tid'], 'from_idtype' => 'at', 'buyerid' => $this->member['uid'], 'buyer' => $this->member['username'], 'tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'pid' => $this->post['pid'], 'message' => messagecutstr($this->param['message'], 150))); + } + set_atlist_cookie(array_keys($this->atlist)); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_base.php b/source/class/extend/extend_thread_base.php new file mode 100644 index 0000000..d3bcf91 --- /dev/null +++ b/source/class/extend/extend_thread_base.php @@ -0,0 +1,31 @@ +forum = &$this->_obj->forum; + $this->thread = &$this->_obj->thread; + $this->post = &$this->_obj->post; + $this->feed = &$this->_obj->feed; + parent::init_base_var(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_comment.php b/source/class/extend/extend_thread_comment.php new file mode 100644 index 0000000..018f599 --- /dev/null +++ b/source/class/extend/extend_thread_comment.php @@ -0,0 +1,61 @@ +param['modnewreplies']) = threadmodstatus($this->param['subject']."\t".$this->param['message'].$this->param['extramessage']); + if($this->thread['displayorder'] == -4) { + $this->param['modnewreplies'] = 0; + } + $pinvisible = $parameters['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0); + $this->postcomment = is_array($this->setting['allowpostcomment']) && in_array(2, $this->setting['allowpostcomment']) && $this->group['allowcommentreply'] && !$pinvisible && !empty($_GET['reppid']) && ($nauthorid != $this->member['uid'] || $this->setting['commentpostself']) ? messagecutstr($parameters['message'], 200, ' ') : ''; + } + + public function after_newreply() { + if(!empty($_GET['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) { + if($this->postcomment) { + $rpid = intval($_GET['reppid']); + if($rpost = C::t('forum_post')->fetch_post('tid:'.$this->thread['tid'], $rpid)) { + if(!$rpost['first']) { + $cid = C::t('forum_postcomment')->insert(array( + 'tid' => $this->thread['tid'], + 'pid' => $rpid, + 'rpid' => $this->pid, + 'author' => $this->member['username'], + 'authorid' => $this->member['uid'], + 'dateline' => TIMESTAMP, + 'comment' => $this->postcomment, + 'score' => 0, + 'useip' => getglobal('clientip'), + 'port'=>getglobal('remoteport') + ), true); + + C::t('forum_post')->update_post('tid:'.$this->thread['tid'], $rpid, array('comment' => 1)); + C::t('forum_postcache')->delete($rpid); + } + } + unset($this->postcomment); + } + } + } + + public function after_deletepost() { + C::t('forum_postcomment')->delete_by_rpid($this->post['pid']); + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_debate.php b/source/class/extend/extend_thread_debate.php new file mode 100644 index 0000000..f08261e --- /dev/null +++ b/source/class/extend/extend_thread_debate.php @@ -0,0 +1,140 @@ +endtime = @strtotime($_GET['endtime'])) || $this->endtime < TIMESTAMP)) { + showmessage('debate_endtime_invalid'); + } elseif(!empty($_GET['umpire'])) { + if(!C::t('common_member')->fetch_uid_by_username($_GET['umpire'])) { + $_GET['umpire'] = dhtmlspecialchars($_GET['umpire']); + showmessage('debate_umpire_invalid', '', array('umpire' => $_GET['umpire'])); + } + } + $this->affirmpoint = censor(dhtmlspecialchars($_GET['affirmpoint'])); + $this->negapoint = censor(dhtmlspecialchars($_GET['negapoint'])); + $this->stand = intval($_GET['stand']); + $this->param['extramessage'] = "\t".$_GET['affirmpoint']."\t".$_GET['negapoint']; + } + + public function after_newthread() { + if($this->group['allowpostdebate']) { + + C::t('forum_debate')->insert(array( + 'tid' => $this->tid, + 'uid' => $this->member['uid'], + 'starttime' => $this->param['publishdate'], + 'endtime' => $this->endtime, + 'affirmdebaters' => 0, + 'negadebaters' => 0, + 'affirmvotes' => 0, + 'negavotes' => 0, + 'umpire' => $_GET['umpire'], + 'winner' => '', + 'bestdebater' => '', + 'affirmpoint' => $this->affirmpoint, + 'negapoint' => $this->negapoint, + 'umpirepoint' => '' + )); + + } + } + + public function before_feed() { + + $message = !$this->param['price'] && !$this->param['readperm'] ? $this->param['message'] : ''; + $this->feed['icon'] = 'debate'; + $this->feed['title_template'] = 'feed_thread_debate_title'; + $this->feed['body_template'] = 'feed_thread_debate_message'; + $this->feed['body_data'] = array( + 'subject' => "tid}\">{$this->param['subject']}", + 'message' => messagecutstr($message, 150), + 'affirmpoint'=> messagecutstr($this->affirmpoint, 150), + 'negapoint'=> messagecutstr($this->negapoint, 150) + ); + } + + public function after_newreply() { + global $firststand, $stand; + if($this->param['special'] == 5) { + if(!$firststand) { + C::t('forum_debate')->update_debaters($this->thread['tid'], $stand); + } else { + $stand = $firststand; + } + C::t('forum_debate')->update_replies($this->thread['tid'], $stand); + C::t('forum_debatepost')->insert(array( + 'tid' => $this->thread['tid'], + 'pid' => $this->pid, + 'uid' => $this->member['uid'], + 'dateline' => getglobal('timestamp'), + 'stand' => $stand, + 'voters' => 0, + 'voterids' => '', + )); + } + } + + public function before_replyfeed() { + global $stand; + if($this->forum['allowfeed'] && !$this->param['isanonymous']) { + if($this->param['special'] == 5 && $this->thread['authorid'] != $this->member['uid']) { + $this->feed['icon'] = 'debate'; + if($stand == 1) { + $this->feed['title_template'] = 'feed_thread_debatevote_title_1'; + } elseif($stand == 2) { + $this->feed['title_template'] = 'feed_thread_debatevote_title_2'; + } else { + $this->feed['title_template'] = 'feed_thread_debatevote_title_3'; + } + $this->feed['title_data'] = array( + 'subject' => "thread['tid']."\">".$this->thread['subject']."", + 'author' => "thread['authorid']."\">".$this->thread['author']."" + ); + } + } + } + + public function before_editpost($parameters) { + $isfirstpost = $this->post['first'] ? 1 : 0; + if($isfirstpost) { + if($this->thread['special'] == 5 && $this->group['allowpostdebate']) { + + if(empty($_GET['affirmpoint']) || empty($_GET['negapoint'])) { + showmessage('debate_position_nofound'); + } elseif(!empty($_GET['endtime']) && (!($endtime = @strtotime($_GET['endtime'])) || $endtime < TIMESTAMP)) { + showmessage('debate_endtime_invalid'); + } elseif(!empty($_GET['umpire'])) { + if(!C::t('common_member')->fetch_uid_by_username($_GET['umpire'])) { + $_GET['umpire'] = dhtmlspecialchars($_GET['umpire']); + showmessage('debate_umpire_invalid'); + } + } + $affirmpoint = censor(dhtmlspecialchars($_GET['affirmpoint'])); + $negapoint = censor(dhtmlspecialchars($_GET['negapoint'])); + C::t('forum_debate')->update($this->thread['tid'], array('affirmpoint' => $affirmpoint, 'negapoint' => $negapoint, 'endtime' => $endtime, 'umpire' => $_GET['umpire'])); + + } + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_filter.php b/source/class/extend/extend_thread_filter.php new file mode 100644 index 0000000..4f3563e --- /dev/null +++ b/source/class/extend/extend_thread_filter.php @@ -0,0 +1,97 @@ +param['special'] || $this->thread['special'] || getstatus($this->thread['status'], 3) || !$length) { + return 0; + } + require_once libfile('function/discuzcode'); + $langthread = lang('forum/thread'); + $content = discuzcode($message); + $content = strip_tags($content); + $content = str_replace(array(',', '.', '?', '!', $langthread['t_question'], $langthread['t_exclamatory'], $langthread['t_period'], $langthread['t_comma'], '~', $langthread['t_suspension']), '', $content); + $content = preg_replace('/\s+/', '', $content); + $realLength = dstrlen($content); + + $checkQuote = (preg_match("/\s?\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s?/is", $message) > 0) || (preg_match("/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/i", $message) > 0) || (preg_match("/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/i", $message) > 0) || (preg_match("/\[attach\](\d+)\[\/attach\]/i", $message) > 0); + if($checkQuote || $realLength >= $length) { + return ($realLength <= 0 ? 1 : $realLength) ; + } else { + return 0; + } + } + + public function before_newreply($parameters) { + $this->curFilterCheck = $this->_check_post_length($parameters['noticetrimstr'].$parameters['message'], $this->setting['threadfilternum']); + if($this->curFilterCheck <= 0) { + $this->param['modstatus'][11] = 1; + } + } + + public function after_newreply() { + if($this->curFilterCheck > 0) { + $data = array( + 'tid' => $this->thread['tid'], + 'pid' => $this->pid, + 'postlength' => $this->curFilterCheck + ); + C::t('forum_filter_post')->insert($data); + } + } + + public function before_editpost($parameters) { + $isfirstpost = $this->post['first'] ? 1 : 0; + if(!$isfirstpost) { + $this->curFilterCheck = $this->_check_post_length($parameters['message'], $this->setting['threadfilternum']); + if($this->curFilterCheck <= 0) { + $this->param['modstatus'][11] = 1; + } else { + $this->param['modstatus'][11] = 0; + } + } + } + + public function after_editpost() { + $isfirstpost = $this->post['first'] ? 1 : 0; + if(!$isfirstpost) { + if($this->curFilterCheck > 0) { + $data = array( + 'tid' => $this->thread['tid'], + 'pid' => $this->post['pid'], + 'postlength' => $this->curFilterCheck + ); + C::t('forum_filter_post')->insert($data, false, true); + } else { + C::t('forum_filter_post')->delete_by_tid_pid($this->thread['tid'], $this->post['pid']); + } + } + } + + public function after_deletepost() { + $isfirstpost = $this->post['first'] ? 1 : 0; + if($isfirstpost) { + C::t('forum_filter_post')->delete_by_tid($this->thread['tid']); + C::t('forum_hotreply_number')->delete_by_tid($this->thread['tid']); + C::t('forum_hotreply_member')->delete_by_tid($this->thread['tid']); + } else { + C::t('forum_filter_post')->delete_by_tid_pid($this->thread['tid'], $this->post['pid']); + C::t('forum_hotreply_number')->delete_by_pid($this->post['pid']); + C::t('forum_hotreply_member')->delete_by_pid($this->post['pid']); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_follow.php b/source/class/extend/extend_thread_follow.php new file mode 100644 index 0000000..2aaf17c --- /dev/null +++ b/source/class/extend/extend_thread_follow.php @@ -0,0 +1,92 @@ +tid; + $pid = $this->pid; + $uid = $this->member['uid']; + if($this->param['displayorder'] >= 0 && helper_access::check_module('follow') && !$this->param['isanonymous']) { + $values = array(); + require_once libfile('function/discuzcode'); + require_once libfile('function/followcode'); + $feedcontent = array( + 'tid' => $tid, + 'content' => followcode($this->param['message'], $tid, $pid, 1000), + ); + C::t('forum_threadpreview')->insert($feedcontent); + C::t('forum_thread')->update_status_by_tid($tid, '512'); + $followfeed = array( + 'uid' => $uid, + 'username' => $this->member['username'], + 'tid' => $tid, + 'note' => '', + 'dateline' => TIMESTAMP + ); + $values['feedid'] = C::t('home_follow_feed')->insert($followfeed, true); + C::t('common_member_count')->increase($uid, array('feeds'=>1)); + + $this->param['values'] = array_merge((array)$this->param['values'], $values); + } + + } + + public function after_newreply() { + $feedid = 0; + if(helper_access::check_module('follow') && !$this->param['isanonymous']) { + require_once libfile('function/discuzcode'); + require_once libfile('function/followcode'); + $feedcontent = C::t('forum_threadpreview')->count_by_tid($this->thread['tid']); + $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid']); + + if(empty($feedcontent)) { + $feedcontent = array( + 'tid' => $this->thread['tid'], + 'content' => followcode($firstpost['message'], $this->thread['tid'], $this->pid, 1000), + ); + C::t('forum_threadpreview')->insert($feedcontent); + C::t('forum_thread')->update_status_by_tid($this->thread['tid'], '512'); + } else { + C::t('forum_threadpreview')->update_relay_by_tid($this->thread['tid'], 1); + } + $notemsg = cutstr(followcode($this->param['message'], $this->thread['tid'], $this->pid, 0, false), 140); + $followfeed = array( + 'uid' => $this->member['uid'], + 'username' => $this->member['username'], + 'tid' => $this->thread['tid'], + 'note' => $notemsg, + 'dateline' => TIMESTAMP + ); + $feedid = C::t('home_follow_feed')->insert($followfeed, true); + C::t('common_member_count')->increase($this->member['uid'], array('feeds'=>1)); + } + if($feedid) { + $this->param['showmsgparam'] = array_merge((array)$this->param['showmsgparam'], array('feedid' => $feedid)); + } + } + + public function after_editpost() { + $isfirstpost = $this->post['first'] ? 1 : 0; + if($isfirstpost) { + require_once libfile('function/discuzcode'); + require_once libfile('function/followcode'); + $feed = C::t('forum_threadpreview')->fetch($this->thread['tid']); + if($feed) { + C::t('forum_threadpreview')->update($this->thread['tid'], array('content' => followcode($this->param['message'], $this->thread['tid'], $this->post['pid'], 1000))); + } + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_image.php b/source/class/extend/extend_thread_image.php new file mode 100644 index 0000000..ac10daf --- /dev/null +++ b/source/class/extend/extend_thread_image.php @@ -0,0 +1,149 @@ +tid; + $pid = $this->pid; + $fid = $this->forum['fid']; + if($this->param['special'] == 4 && $_GET['activityaid']) { + $threadimageaid = $_GET['activityaid']; + convertunusedattach($_GET['activityaid'], $tid, $pid); + } + $this->mobile_upload(); + if(($this->group['allowpostattach'] || $this->group['allowpostimage']) && (getgpc('attachnew') || $this->param['sortid'] || !empty($_GET['activityaid']))) { + updateattach($this->param['displayorder'] == -4 || $this->param['modnewthreads'], $tid, $pid, $_GET['attachnew']); + if(!$threadimageaid) { + $threadimage = C::t('forum_attachment_n')->fetch_max_image('tid:'.$tid, 'tid', $tid); + $threadimageaid = $threadimage['aid']; + } + } + + $values = array('fid' => $fid, 'tid' => $tid, 'pid' => $pid, 'coverimg' => ''); + $param = array(); + setthreadcover($pid, 0, $threadimageaid); + + if($threadimageaid) { + if(!$threadimage) { + $threadimage = C::t('forum_attachment_n')->fetch_attachment('tid:'.$tid, $threadimageaid); + } + $threadimage = daddslashes($threadimage); + C::t('forum_threadimage')->insert(array( + 'tid' => $tid, + 'attachment' => $threadimage['attachment'], + 'remote' => $threadimage['remote'], + )); + } + + $this->param['values'] = array_merge((array)$this->param['values'], $values); + $this->param['param'] = array_merge((array)$this->param['param'], $param); + } + private function mobile_upload() { + global $_G; + if(getgpc('mobile') == 'yes' && !empty($_FILES['Filedata'])) { + $forumattachextensions = ''; + if($_G['forum']) { + $forum = $_G['forum']; + if($forum['status'] == 3 && $forum['level']) { + $levelinfo = C::t('forum_grouplevel')->fetch($forum['level']); + if($postpolicy = $levelinfo['postpolicy']) { + $postpolicy = dunserialize($postpolicy); + $forumattachextensions = $postpolicy['attachextensions']; + } + } else { + $forumattachextensions = $forum['attachextensions']; + } + if($forumattachextensions) { + $_G['group']['attachextensions'] = $forumattachextensions; + } + } + $upload = new forum_upload(1); + if($upload) { + $_GET['attachnew'][$upload->getaid] = array('description' => ''); + } + } + } + public function after_newreply() { + $this->mobile_upload(); + ($this->group['allowpostattach'] || $this->group['allowpostimage']) && ($_GET['attachnew'] || $this->param['special'] == 2 && $_GET['tradeaid']) && updateattach($this->thread['displayorder'] == -4 || $this->param['modnewreplies'], $this->thread['tid'], $this->pid, $_GET['attachnew']); + } + + public function before_editpost($parameters) { + global $_G; + $isfirstpost = $this->post['first'] ? 1 : 0; + $attachupdate = !empty($_GET['delattachop']) || ($this->group['allowpostattach'] || $this->group['allowpostimage']) && ($_GET['attachnew'] || $parameters['special'] == 2 && $_GET['tradeaid'] || $parameters['special'] == 4 && $_GET['activityaid'] || $isfirstpost && $parameters['sortid']); + + if($attachupdate) { + updateattach($this->thread['displayorder'] == -4 || $_G['forum_auditstatuson'], $this->thread['tid'], $this->post['pid'], $_GET['attachnew'], $_GET['attachupdate'], $this->post['authorid']); + } + + + if($isfirstpost && $attachupdate) { + if(!$this->param['threadimageaid']) { + $this->param['threadimage'] = C::t('forum_attachment_n')->fetch_max_image('tid:'.$this->thread['tid'], 'pid', $this->post['pid']); + $this->param['threadimageaid'] = $this->param['threadimage']['aid']; + } + + if(empty($this->thread['cover'])) { + setthreadcover($this->post['pid'], 0, $this->param['threadimageaid']); + } else { + setthreadcover($this->post['pid'], $this->thread['tid'], 0, 1); + } + + if($this->param['threadimageaid']) { + if(!$this->param['threadimage']) { + $this->param['threadimage'] = C::t('forum_attachment_n')->fetch_max_image('tid:'.$this->thread['tid'], 'tid', $this->thread['tid']); + } + C::t('forum_threadimage')->delete_by_tid($this->thread['tid']); + C::t('forum_threadimage')->insert(array( + 'tid' => $this->thread['tid'], + 'attachment' => $this->param['threadimage']['attachment'], + 'remote' => $this->param['threadimage']['remote'], + )); + } + } + } + + public function before_deletepost($parameters) { + $thread_attachment = $post_attachment = 0; + foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$this->thread['tid'], 'tid', $this->thread['tid']) as $attach) { + if($attach['pid'] == $this->post['pid']) { + if($this->thread['displayorder'] >= 0) { + $post_attachment++; + } + dunlink($attach); + } else { + if($attach['isimage']) { + $thread_attachment = 2; + } + if($thread_attachment == 0) { + $thread_attachment = 1; + } + } + } + + $this->param['updatefieldarr']['attachment'] = array($thread_attachment); + + if($post_attachment) { + C::t('forum_attachment')->delete_by_id('pid', $this->post['pid']); + DB::query("DELETE FROM ".DB::table(getattachtablebytid($this->thread['tid']))." WHERE pid='".$this->post['pid']."'", 'UNBUFFEREED'); + updatecreditbyaction('postattach', $this->post['authorid'], array(), '', -$post_attachment); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_poll.php b/source/class/extend/extend_thread_poll.php new file mode 100644 index 0000000..505b6be --- /dev/null +++ b/source/class/extend/extend_thread_poll.php @@ -0,0 +1,194 @@ + $value) { + $polloption[$key] = censor($polloption[$key]); + if(trim($value) === '') { + unset($polloption[$key]); + } + } + + $maxpolloptions = $this->setting['maxpolloptions']; + if(count($polloption) > $maxpolloptions) { + showmessage('post_poll_option_toomany', '', array('maxpolloptions' => $maxpolloptions)); + } elseif(count($polloption) < 2) { + showmessage('post_poll_inputmore'); + } + + $curpolloption = count($polloption); + $this->pollarray['maxchoices'] = empty($_GET['maxchoices']) ? 0 : ($_GET['maxchoices'] > $curpolloption ? $curpolloption : $_GET['maxchoices']); + $this->pollarray['multiple'] = empty($_GET['maxchoices']) || $_GET['maxchoices'] == 1 ? 0 : 1; + $this->pollarray['options'] = $polloption; + $this->pollarray['visible'] = empty($_GET['visibilitypoll']); + $this->pollarray['overt'] = !empty($_GET['overt']); + $this->pollarray['pollimage'] = $_GET['pollimage']; + $this->pollarray['isimage'] = 0; + + if(preg_match("/^\d*$/", trim($_GET['expiration']))) { + if(empty($_GET['expiration'])) { + $this->pollarray['expiration'] = 0; + } else { + $this->pollarray['expiration'] = TIMESTAMP + 86400 * $_GET['expiration']; + } + } else { + showmessage('poll_maxchoices_expiration_invalid'); + } + if($_GET['polloptions'] || $_GET['polloption']) { + $this->param['extramessage'] = "\t".implode("\t", $_GET['tpolloption'] == 2 ? explode("\n", $_GET['polloptions']) : $_GET['polloption']); + } + } + + public function after_newthread() { + foreach($this->pollarray['options'] as $ppkey => $polloptvalue) { + $polloptvalue = dhtmlspecialchars(trim($polloptvalue)); + $polloptionid = C::t('forum_polloption')->insert(array('tid' => $this->tid, 'polloption' => $polloptvalue), true); + if($this->pollarray['pollimage'][$ppkey]) { + C::t('forum_polloption_image')->update($this->pollarray['pollimage'][$ppkey], array('poid' => $polloptionid, 'tid' => $this->tid, 'pid' => $this->pid)); + $this->pollarray['isimage'] = 1; + } + } + $this->polloptionpreview = ''; + $query = C::t('forum_polloption')->fetch_all_by_tid($this->tid, 1, 2); + foreach($query as $option) { + $polloptvalue = preg_replace("/\[url=(https?){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/i", "\\3", $option['polloption']); + $this->polloptionpreview .= $polloptvalue."\t"; + } + + $this->polloptionpreview = daddslashes($this->polloptionpreview); + + $data = array('tid' => $this->tid, 'multiple' => $this->pollarray['multiple'], 'visible' => $this->pollarray['visible'], 'maxchoices' => $this->pollarray['maxchoices'], 'expiration' => $this->pollarray['expiration'], 'overt' => $this->pollarray['overt'], 'pollpreview' => $this->polloptionpreview, 'isimage' => $this->pollarray['isimage']); + C::t('forum_poll')->insert($data); + } + + public function before_feed() { + $pvs = explode("\t", messagecutstr($this->polloptionpreview, 150)); + $s = ''; + $i = 1; + foreach($pvs as $pv) { + $s .= $i.'. '.$pv.'
    '; + } + $s .= '   ...'; + $this->feed['icon'] = 'poll'; + $this->feed['title_template'] = 'feed_thread_poll_title'; + $this->feed['body_template'] = 'feed_thread_poll_message'; + $this->feed['body_data'] = array( + 'subject' => "tid}\">".$this->param['subject']."", + 'message' => $s + ); + } + + public function before_editpost($parameters) { + $isfirstpost = $this->post['first'] ? 1 : 0; + $isorigauthor = $this->member['uid'] && $this->member['uid'] == $this->post['authorid']; + if($isfirstpost) { + if($this->thread['special'] == 1 && ($this->group['alloweditpoll'] || $isorigauthor) && !empty($_GET['polls'])) { + $pollarray = array(); + foreach($_GET['polloption'] as $key => $val) { + if(trim($val) === '') { + unset($_GET['polloption'][$key]); + } + } + $pollarray['options'] = $_GET['polloption']; + if($pollarray['options']) { + if(count($pollarray['options']) > $this->setting['maxpolloptions']) { + showmessage('post_poll_option_toomany', '', array('maxpolloptions' => $this->setting['maxpolloptions'])); + } + foreach($pollarray['options'] as $key => $value) { + $pollarray['options'][$key] = censor($pollarray['options'][$key]); + if(!trim($value)) { + C::t('forum_polloption')->delete_safe_tid($this->thread['tid'], $key); + unset($pollarray['options'][$key]); + } + } + $this->param['threadupdatearr']['special'] = 1; + foreach($_GET['displayorder'] as $key => $value) { + if(preg_match("/^-?\d*$/", $value)) { + $pollarray['displayorder'][$key] = $value; + } + } + $curpolloption = count($pollarray['options']); + $pollarray['maxchoices'] = empty($_GET['maxchoices']) ? 0 : ($_GET['maxchoices'] > $curpolloption ? $curpolloption : $_GET['maxchoices']); + $pollarray['multiple'] = empty($_GET['maxchoices']) || $_GET['maxchoices'] == 1 ? 0 : 1; + $pollarray['visible'] = empty($_GET['visibilitypoll']); + $pollarray['expiration'] = $_GET['expiration']; + $pollarray['overt'] = !empty($_GET['overt']); + $pollarray['pollimage'] = $_GET['pollimage']; + foreach($_GET['polloptionid'] as $key => $value) { + if(!preg_match("/^\d*$/", $value)) { + showmessage('submit_invalid'); + } + } + $expiration = intval($_GET['expiration']); + if($this->thread['close']) { + $pollarray['expiration'] = TIMESTAMP; + } elseif($expiration) { + if(empty($pollarray['expiration'])) { + $pollarray['expiration'] = 0; + } else { + $pollarray['expiration'] = TIMESTAMP + 86400 * $expiration; + } + } + $optid = array(); + $query = C::t('forum_polloption')->fetch_all_by_tid($this->thread['tid']); + foreach($query as $tempoptid) { + $optid[] = $tempoptid['polloptionid']; + } + foreach($pollarray['options'] as $key => $value) { + $value = dhtmlspecialchars(trim($value)); + if(in_array($_GET['polloptionid'][$key], $optid)) { + if($this->group['alloweditpoll']) { + C::t('forum_polloption')->update_safe_tid($_GET['polloptionid'][$key], $this->thread['tid'], $pollarray['displayorder'][$key], $value); + } else { + C::t('forum_polloption')->update_safe_tid($_GET['polloptionid'][$key], $this->thread['tid'], $pollarray['displayorder'][$key]); + } + } else { + $polloptionid = C::t('forum_polloption')->insert(array('tid' => $this->thread['tid'], 'displayorder' => $pollarray['displayorder'][$key], 'polloption' => $value), true); + if($pollarray['pollimage'][$key]) { + C::t('forum_polloption_image')->update($pollarray['pollimage'][$key], array('poid' => $polloptionid, 'tid' => $this->thread['tid'], 'pid' => $this->post['pid'])); + $pollarray['isimage'] = 1; + } + } + } + $polloptionpreview = ''; + $query = C::t('forum_polloption')->fetch_all_by_tid($this->thread['tid'], 1, 2); + foreach($query as $option) { + $polloptvalue = preg_replace("/\[url=(https?){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/i", "\\3", $option['polloption']); + $polloptionpreview .= $polloptvalue."\t"; + } + + $polloptionpreview = daddslashes($polloptionpreview); + + $data = array('multiple' => $pollarray['multiple'], 'visible' => $pollarray['visible'], 'maxchoices' => $pollarray['maxchoices'], 'expiration' => $pollarray['expiration'], 'overt' => $pollarray['overt'], 'pollpreview' => $polloptionpreview); + if($pollarray['isimage']) { + $data['isimage'] = 1; + } + C::t('forum_poll')->update($this->thread['tid'], $data); + } else { + $this->param['threadupdatearr']['special'] = 0; + C::t('forum_poll')->delete($this->thread['tid']); + C::t('forum_polloption')->delete_safe_tid($this->thread['tid']); + } + } + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_replycredit.php b/source/class/extend/extend_thread_replycredit.php new file mode 100644 index 0000000..5c400c2 --- /dev/null +++ b/source/class/extend/extend_thread_replycredit.php @@ -0,0 +1,147 @@ +group['allowreplycredit']) { + $_GET['replycredit_extcredits'] = intval($_GET['replycredit_extcredits']); + $_GET['replycredit_times'] = intval($_GET['replycredit_times']); + $_GET['replycredit_membertimes'] = intval($_GET['replycredit_membertimes']) > 0 && intval($_GET['replycredit_membertimes']) <= 10 ? intval($_GET['replycredit_membertimes']) : 1; + $_GET['replycredit_random'] = intval($_GET['replycredit_random']); + + $_GET['replycredit_random'] = $_GET['replycredit_random'] < 0 || $_GET['replycredit_random'] > 99 ? 0 : $_GET['replycredit_random'] ; + $this->replycredit_real = 0; + $this->param['replycredit'] = 0; + if($_GET['replycredit_extcredits'] > 0 && $_GET['replycredit_times'] > 0) { + $this->replycredit_real = ceil(($_GET['replycredit_extcredits'] * $_GET['replycredit_times']) + ($_GET['replycredit_extcredits'] * $_GET['replycredit_times'] * $this->setting['creditstax'])); + if($this->replycredit_real > getuserprofile('extcredits'.$this->setting['creditstransextra']['10'])) { + showmessage('replycredit_morethan_self'); + } else { + $this->param['replycredit'] = ceil($_GET['replycredit_extcredits'] * $_GET['replycredit_times']); + } + } + } + } + + public function after_newthread() { + + if($this->group['allowreplycredit']) { + if($this->param['replycredit'] > 0 && $this->replycredit_real > 0) { + updatemembercount($this->member['uid'], array('extcredits'.$this->setting['creditstransextra']['10'] => -$this->replycredit_real), 1, 'RCT', $this->tid); + $insertdata = array( + 'tid' => $this->tid, + 'extcredits' => $_GET['replycredit_extcredits'], + 'extcreditstype' => $this->setting['creditstransextra']['10'], + 'times' => $_GET['replycredit_times'], + 'membertimes' => $_GET['replycredit_membertimes'], + 'random' => $_GET['replycredit_random'] + ); + C::t('forum_replycredit')->insert($insertdata); + } + } + + } + + public function after_newreply() { + if($this->thread['replycredit'] > 0 && !$this->param['modnewreplies'] && $this->thread['authorid'] != $this->member['uid'] && $this->member['uid']) { + + $replycredit_rule = C::t('forum_replycredit')->fetch($this->thread['tid']); + if(!empty($replycredit_rule['times'])) { + $have_replycredit = C::t('common_credit_log')->count_by_uid_operation_relatedid($this->member['uid'], 'RCA', $this->thread['tid']); + if($replycredit_rule['membertimes'] - $have_replycredit > 0 && $this->thread['replycredit'] - $replycredit_rule['extcredits'] >= 0) { + $creditstransextra = $this->setting['creditstransextra']; + $replycredit_rule['extcreditstype'] = $replycredit_rule['extcreditstype'] ? $replycredit_rule['extcreditstype'] : $creditstransextra[10]; + if($replycredit_rule['random'] > 0) { + $rand = rand(1, 100); + $rand_replycredit = $rand <= $replycredit_rule['random'] ? true : false ; + } else { + $rand_replycredit = true; + } + if($rand_replycredit) { + updatemembercount($this->member['uid'], array($replycredit_rule['extcreditstype'] => $replycredit_rule['extcredits']), 1, 'RCA', $this->thread['tid']); + C::t('forum_post')->update_post('tid:'.$this->thread['tid'], $this->pid, array('replycredit' => $replycredit_rule['extcredits'])); + C::t('forum_thread')->update($this->thread['tid'], (array)DB::field('replycredit', $this->thread['replycredit'] - $replycredit_rule['extcredits']), false, false, 0, true); + } + } + } + } + } + + public function before_editpost($parameters) { + $isfirstpost = $this->post['first'] ? 1 : 0; + $isorigauthor = $this->member['uid'] && $this->member['uid'] == $this->post['authorid']; + if($isfirstpost) { + if($isorigauthor && $this->group['allowreplycredit']) { + $replycredit_rule = isset($parameters['replycredit_rule']) && $parameters['replycredit_rule'] ? $parameters['replycredit_rule'] : array(); + $_POST['replycredit_extcredits'] = intval($_POST['replycredit_extcredits']); + $_POST['replycredit_times'] = intval($_POST['replycredit_times']); + $_POST['replycredit_membertimes'] = intval($_POST['replycredit_membertimes']) > 0 && intval($_POST['replycredit_membertimes']) <= 10 ? intval($_POST['replycredit_membertimes']) : 1; + $_POST['replycredit_random'] = intval($_POST['replycredit_random']) < 0 || intval($_POST['replycredit_random']) > 99 ? 0 : intval($_POST['replycredit_random']) ; + if($_POST['replycredit_extcredits'] > 0 && $_POST['replycredit_times'] > 0) { + $replycredit = $_POST['replycredit_extcredits'] * $_POST['replycredit_times']; + $replycredit_diff = $replycredit - $this->thread['replycredit']; + if($replycredit_diff > 0) { + $replycredit_diff = ceil($replycredit_diff + ($replycredit_diff * $this->setting['creditstax'])); + if(!$replycredit_rule) { + if($this->setting['creditstransextra']['10']) { + $replycredit_rule['extcreditstype'] = $this->setting['creditstransextra']['10']; + } + } + + if($replycredit_diff > getuserprofile('extcredits'.$replycredit_rule['extcreditstype'])) { + showmessage('post_edit_thread_replaycredit_nocredit'); + } + } + if($replycredit_diff) { + updatemembercount($this->thread['authorid'], array($replycredit_rule['extcreditstype'] => ($replycredit_diff > 0 ? -$replycredit_diff : abs($replycredit_diff))), 1, ($replycredit_diff > 0 ? 'RCT' : 'RCB'), $this->thread['tid']); + } + } elseif(($_POST['replycredit_extcredits'] == 0 || $_POST['replycredit_times'] == 0) && $this->thread['replycredit'] > 0) { + $replycredit = 0; + C::t('forum_replycredit')->delete($this->thread['tid']); + updatemembercount($this->thread['authorid'], array($replycredit_rule['extcreditstype'] => $this->thread['replycredit']), 1, 'RCB', $this->thread['tid']); + $this->param['threadupdatearr']['replycredit'] = 0; + } else { + $replycredit = $this->thread['replycredit']; + } + if($replycredit) { + $this->param['threadupdatearr']['replycredit'] = $replycredit; + $replydata = array( + 'tid' => $this->thread['tid'], + 'extcredits' => $_POST['replycredit_extcredits'], + 'extcreditstype' => $replycredit_rule['extcreditstype'], + 'times' => $_POST['replycredit_times'], + 'membertimes' => $_POST['replycredit_membertimes'], + 'random' => $_POST['replycredit_random'] + ); + C::t('forum_replycredit')->insert($replydata, false, true); + } + } + } + } + + public function before_deletepost() { + global $replycredit_rule; + $isfirstpost = $this->post['first'] ? 1 : 0; + if($this->thread['replycredit'] && $isfirstpost && !$this->param['isanonymous']) { + updatemembercount($this->post['authorid'], array($replycredit_rule['extcreditstype'] => $this->thread['replycredit']), true, 'RCB', $this->thread['tid']); + C::t('forum_replycredit')->delete($this->thread['tid']); + + $this->param['handlereplycredit'] = true; + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_reward.php b/source/class/extend/extend_thread_reward.php new file mode 100644 index 0000000..0e1d704 --- /dev/null +++ b/source/class/extend/extend_thread_reward.php @@ -0,0 +1,126 @@ +rewardprice = intval($_GET['rewardprice']); + $minrewardprice = $this->group['minrewardprice']; + $maxrewardprice = $this->group['maxrewardprice']; + if($this->rewardprice < 1) { + showmessage('reward_credits_please'); + } elseif($this->rewardprice > 32767) { + showmessage('reward_credits_overflow'); + } elseif($this->rewardprice < $minrewardprice || ($maxrewardprice > 0 && $this->rewardprice > $maxrewardprice)) { + if($maxrewardprice > 0) { + showmessage('reward_credits_between', '', array('minrewardprice' => $minrewardprice, 'maxrewardprice' => $maxrewardprice)); + } else { + showmessage('reward_credits_lower', '', array('minrewardprice' => $minrewardprice)); + } + } elseif(($this->realprice = $this->rewardprice + ceil($this->rewardprice * $this->setting['creditstax'])) > getuserprofile('extcredits'.$this->setting['creditstransextra'][2])) { + showmessage('reward_credits_shortage'); + } + + $this->param['price'] = $this->rewardprice; + + } + + public function after_newthread() { + if($this->group['allowpostreward']) { + updatemembercount($this->member['uid'], array($this->setting['creditstransextra']['2'] => -$this->realprice), 1, 'RTC', $this->tid); + } + } + + public function before_feed() { + $this->feed['icon'] = 'reward'; + $this->feed['title_template'] = 'feed_thread_reward_title'; + $this->feed['body_template'] = 'feed_thread_reward_message'; + $this->feed['body_data'] = array( + 'subject'=> "tid}\">".$this->param['subject']."", + 'rewardprice'=> $this->rewardprice, + 'extcredits' => $this->setting['extcredits'][$this->setting['creditstransextra']['2']]['title'], + ); + } + + public function before_replyfeed() { + if($this->forum['allowfeed'] && !$this->param['isanonymous']) { + if($this->param['special'] == 3 && $this->thread['authorid'] != $this->member['uid']) { + $this->feed['icon'] = 'reward'; + $this->feed['title_template'] = 'feed_reply_reward_title'; + $this->feed['title_data'] = array( + 'subject' => "thread['tid']."\">".$this->thread['subject']."", + 'author' => "thread['authorid']."\">".$this->thread['author']."" + ); + } + } + } + + public function before_editpost($parameters) { + $isfirstpost = $this->post['first'] ? 1 : 0; + $isorigauthor = $this->member['uid'] && $this->member['uid'] == $this->post['authorid']; + if($isfirstpost) { + if($this->thread['special'] == 3) { + $this->param['price'] = $isorigauthor ? ($this->thread['price'] > 0 && $this->thread['price'] != $_GET['rewardprice'] ? $_GET['rewardprice'] : 0) : $this->thread['price']; + } + + if($this->thread['special'] == 3 && $isorigauthor) { + $rewardprice = $this->thread['price'] > 0 ? intval($_GET['rewardprice']) : $this->thread['price']; + if($this->thread['price'] > 0 && $this->thread['price'] != $_GET['rewardprice']) { + if($rewardprice <= 0){ + showmessage('reward_credits_invalid'); + } + $addprice = ceil(($rewardprice - $this->thread['price']) + ($rewardprice - $this->thread['price']) * $this->setting['creditstax']); + if($rewardprice < $this->thread['price']) { + showmessage('reward_credits_fall'); + } elseif($rewardprice < $this->group['minrewardprice'] || ($this->group['maxrewardprice'] > 0 && $rewardprice > $this->group['maxrewardprice'])) { + showmessage('reward_credits_between', '', array('minrewardprice' => $this->group['minrewardprice'], 'maxrewardprice' => $this->group['maxrewardprice'])); + } elseif($addprice > getuserprofile('extcredits'.$this->setting['creditstransextra'][2])) { + showmessage('reward_credits_shortage'); + } + $realprice = ceil($rewardprice + $rewardprice * $this->setting['creditstax']); + + updatemembercount($this->thread['authorid'], array($this->setting['creditstransextra'][2] => -$addprice)); + C::t('common_credit_log')->update_by_uid_operation_relatedid($this->thread['authorid'], 'RTC', $this->thread['tid'], array('extcredits'.$this->setting['creditstransextra'][2] => -$realprice)); + } + + if(!$this->forum['ismoderator']) { + if($this->thread['replies'] > 1) { + $this->param['subject'] = addslashes($this->thread['subject']); + } + } + + $this->param['price'] = $rewardprice; + } + } + } + + public function before_deletepost($parameters) { + $isfirstpost = $this->post['first'] ? 1 : 0; + if($this->thread['special'] == 3) { + if($this->thread['price'] < 0 && ($this->thread['dateline'] + 1 == $this->post['dateline'])) { + showmessage('post_edit_reward_nopermission', NULL); + } + } + + + if($this->thread['special'] == 3 && $isfirstpost) { + updatemembercount($this->post['authorid'], array($this->setting['creditstransextra'][2] => $this->thread['price'])); + C::t('common_credit_log')->delete_by_uid_operation_relatedid($this->thread['authorid'], 'RTC', $this->thread['tid']); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_rushreply.php b/source/class/extend/extend_thread_rushreply.php new file mode 100644 index 0000000..3082b94 --- /dev/null +++ b/source/class/extend/extend_thread_rushreply.php @@ -0,0 +1,128 @@ +group['allowpostrushreply']) { + $_GET['rushreplyfrom'] = strtotime($_GET['rushreplyfrom']); + $_GET['rushreplyto'] = strtotime($_GET['rushreplyto']); + $_GET['rewardfloor'] = preg_replace('#[^0-9|*|,]#', '', $_GET['rewardfloor']); + $_GET['stopfloor'] = intval($_GET['stopfloor']); + $_GET['replylimit'] = intval($_GET['replylimit']); + $_GET['creditlimit'] = $_GET['creditlimit'] == '' ? '-996' : intval($_GET['creditlimit']); + if($_GET['rushreplyfrom'] > $_GET['rushreplyto'] && !empty($_GET['rushreplyto'])) { + showmessage('post_rushreply_timewrong'); + } + if(($_GET['rushreplyfrom'] > TIMESTAMP) || (!empty($_GET['rushreplyto']) && $_GET['rushreplyto'] < TIMESTAMP) || ($_GET['stopfloor'] == 1) ) { + $this->param['closed'] = true; + } + if(!empty($_GET['rewardfloor']) && !empty($_GET['stopfloor'])) { + $floors = explode(',', $_GET['rewardfloor']); + if(!empty($floors) && is_array($floors)) { + foreach($floors AS $key => $floor) { + if(strpos($floor, '*') === false) { + if(intval($floor) == 0) { + unset($floors[$key]); + } elseif($floor > $_GET['stopfloor']) { + unset($floors[$key]); + } + } + } + $_GET['rewardfloor'] = implode(',', $floors); + } + } + $parameters['tstatus'] = setstatus(3, 1, $parameters['tstatus']); + $parameters['tstatus'] = setstatus(1, 1, $parameters['tstatus']); + $this->param['tstatus'] = $parameters['tstatus']; + } + + } + + + public function after_newthread() { + if($this->group['allowpostrushreply']) { + $rushdata = array('tid' => $this->tid, 'stopfloor' => $_GET['stopfloor'], 'starttimefrom' => $_GET['rushreplyfrom'], 'starttimeto' => $_GET['rushreplyto'], 'rewardfloor' => $_GET['rewardfloor'], 'creditlimit' => $_GET['creditlimit'], 'replylimit' => $_GET['replylimit']); + C::t('forum_threadrush')->insert($rushdata); + } + } + public function before_newreply() { + global $_G, $rushinfo; + if(getstatus($this->thread['status'], 3) && $rushinfo['replylimit'] > 0) { + $replycount = C::t('forum_post')->count_by_tid_invisible_authorid($this->thread['tid'], $_G['uid']); + if($replycount >= $rushinfo['replylimit']) { + showmessage('noreply_replynum_error'); + } + } + } + public function after_newreply() { + global $rushinfo; + if(getstatus($this->thread['status'], 3) && $this->param['maxposition']) { + $rushstopfloor = $rushinfo['stopfloor']; + if($rushstopfloor > 0 && $this->thread['closed'] == 0 && $this->param['maxposition'] >= $rushstopfloor) { + $this->param['updatethreaddata'] = array_merge((array)$this->param['updatethreaddata'], array('closed' => 1)); + } + } + } + + public function before_editpost($parameters) { + global $_G, $rushreply; + $isfirstpost = $this->post['first'] ? 1 : 0; + if($isfirstpost) { + if($rushreply) { + $_GET['rushreplyfrom'] = strtotime($_GET['rushreplyfrom']); + $_GET['rushreplyto'] = strtotime($_GET['rushreplyto']); + $_GET['rewardfloor'] = preg_replace('#[^0-9|*|,]#', '', $_GET['rewardfloor']); + $_GET['stopfloor'] = intval($_GET['stopfloor']); + $_GET['replylimit'] = intval($_GET['replylimit']); + $_GET['creditlimit'] = $_GET['creditlimit'] == '' ? '-996' : intval($_GET['creditlimit']); + if($_GET['rushreplyfrom'] > $_GET['rushreplyto'] && !empty($_GET['rushreplyto'])) { + showmessage('post_rushreply_timewrong'); + } + $maxposition = C::t('forum_post')->fetch_maxposition_by_tid($this->thread['posttableid'], $this->thread['tid']); + if($this->thread['closed'] == 1 && ((!$_GET['rushreplyfrom'] && !$_GET['rushreplyto']) || ($_GET['rushreplyfrom'] < $_G['timestamp'] && $_GET['rushreplyto'] > $_G['timestamp']) || (!$_GET['rushreplyfrom'] && $_GET['rushreplyto'] > $_G['timestamp']) || ($_GET['stopfloor'] && $_GET['stopfloor'] > $maxposition) )) { + $this->param['threadupdatearr']['closed'] = 0; + } elseif($this->thread['closed'] == 0 && (($_GET['rushreplyfrom'] && $_GET['rushreplyfrom'] > $_G['timestamp']) || ($_GET['rushreplyto'] && $_GET['rushreplyto'] && $_GET['rushreplyto'] < $_G['timestamp']) || ($_GET['stopfloor'] && $_GET['stopfloor'] <= $maxposition) )) { + $this->param['threadupdatearr']['closed'] = 1; + } + if(!empty($_GET['rewardfloor']) && !empty($_GET['stopfloor'])) { + $floors = explode(',', $_GET['rewardfloor']); + if(!empty($floors)) { + foreach($floors AS $key => $floor) { + if(strpos($floor, '*') === false) { + if(intval($floor) == 0) { + unset($floors[$key]); + } elseif($floor > $_GET['stopfloor']) { + unset($floors[$key]); + } + } + } + } + $_GET['rewardfloor'] = is_array($floors) ? implode(',', $floors) : (string)$floors; + } + $rushdata = array('stopfloor' => $_GET['stopfloor'], 'starttimefrom' => $_GET['rushreplyfrom'], 'starttimeto' => $_GET['rushreplyto'], 'rewardfloor' => $_GET['rewardfloor'], 'creditlimit' => $_GET['creditlimit'], 'replylimit' => $_GET['replylimit']); + C::t('forum_threadrush')->update($this->thread['tid'], $rushdata); + } + } + } + + public function before_deletepost() { + global $rushreply; + if($rushreply) { + showmessage('post_edit_delete_rushreply_nopermission', NULL); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_sort.php b/source/class/extend/extend_thread_sort.php new file mode 100644 index 0000000..bd08d41 --- /dev/null +++ b/source/class/extend/extend_thread_sort.php @@ -0,0 +1,151 @@ +param['extramessage'] = "\t".implode("\t", $_GET['typeoption']); + } + } + + public function after_newthread() { + global $_G; + + $sortid = $this->param['sortid']; + $pid = $this->pid; + $_G['forum_optiondata'] = array(); + if($this->forum['threadsorts']['types'][$sortid] && !$this->forum['allowspecialonly']) { + $_G['forum_optiondata'] = threadsort_validator($_GET['typeoption'], $pid); + } + + if($this->forum['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata'])) { + $sortaids = array(); + $filedname = $valuelist = $separator = ''; + $fid = $this->forum['fid']; + $tid = $this->tid; + foreach($_G['forum_optiondata'] as $optionid => $value) { + if($value) { + $filedname .= $separator.$_G['forum_optionlist'][$optionid]['identifier']; + $valuelist .= $separator."'".daddslashes($value)."'"; + $separator = ' ,'; + } + + if($_G['forum_optionlist'][$optionid]['type'] == 'image') { + $identifier = $_G['forum_optionlist'][$optionid]['identifier']; + $sortaids[] = intval($_GET['typeoption'][$identifier]['aid']); + } + $typeexpiration = intval($_GET['typeexpiration']); + + C::t('forum_typeoptionvar')->insert(array( + 'sortid' => $sortid, + 'tid' => $tid, + 'fid' => $fid, + 'optionid' => $optionid, + 'value' => $value, + 'expiration' => ($typeexpiration ? $this->param['publishdate'] + $typeexpiration : 0), + )); + } + + if($filedname && $valuelist) { + C::t('forum_optionvalue')->insert_optionvalue($sortid, "($filedname, tid, fid) VALUES ($valuelist, '{$tid}', '$fid')"); + } + + if($sortaids) { + foreach($sortaids as $sortaid) { + convertunusedattach($sortaid, $tid, $pid); + } + } + } + + } + + public function before_editpost($parameters) { + global $_G; + $sortid = $parameters['sortid']; + $isfirstpost = $this->post['first'] ? 1 : 0; + if($isfirstpost) { + + $parameters['typeid'] = isset($this->forum['threadtypes']['types'][$parameters['typeid']]) ? $parameters['typeid'] : 0; + if(!$this->forum['ismoderator'] && !empty($this->forum['threadtypes']['moderators'][$this->thread['typeid']])) { + $parameters['typeid'] = $this->thread['typeid']; + } + $parameters['sortid'] = isset($this->forum['threadsorts']['types'][$parameters['sortid']]) ? $parameters['sortid'] : 0; + $typeexpiration = intval($_GET['typeexpiration']); + + if(!$parameters['typeid'] && $this->forum['threadtypes']['required'] && !$this->thread['special']) { + showmessage('post_type_isnull'); + } + + + if($this->forum['threadsorts']['types'][$sortid] && $_G['forum_checkoption']) { + $_G['forum_optiondata'] = threadsort_validator($_GET['typeoption'], $this->post['pid']); + } + + $this->param['threadimageaid'] = 0; + $this->param['threadimage'] = array(); + + if($this->forum['threadsorts']['types'][$parameters['sortid']] && $_G['forum_optiondata'] && is_array($_G['forum_optiondata'])) { + $sql = $separator = $filedname = $valuelist = ''; + foreach($_G['forum_optiondata'] as $optionid => $value) { + $value = censor(daddslashes($value)); + if($_G['forum_optionlist'][$optionid]['type'] == 'image') { + $identifier = $_G['forum_optionlist'][$optionid]['identifier']; + $newsortaid = intval($_GET['typeoption'][$identifier]['aid']); + if($newsortaid && $_GET['oldsortaid'][$identifier] && $newsortaid != $_GET['oldsortaid'][$identifier]) { + $attach = C::t('forum_attachment_n')->fetch_attachment('tid:'.$this->thread['tid'], $_GET['oldsortaid'][$identifier]); + C::t('forum_attachment')->delete($_GET['oldsortaid'][$identifier]); + C::t('forum_attachment_n')->delete_attachment('tid:'.$this->thread['tid'], $_GET['oldsortaid'][$identifier]); + dunlink($attach); + $this->param['threadimageaid'] = $newsortaid; + convertunusedattach($newsortaid, $this->thread['tid'], $this->post['pid']); + } + } + if($_G['forum_optionlist'][$optionid]['unchangeable']) { + continue; + } + if(($_G['forum_optionlist'][$optionid]['search'] || in_array($_G['forum_optionlist'][$optionid]['type'], array('radio', 'select', 'number'))) && $value) { + $filedname .= $separator.$_G['forum_optionlist'][$optionid]['identifier']; + $valuelist .= $separator."'$value'"; + $sql .= $separator.$_G['forum_optionlist'][$optionid]['identifier']."='$value'"; + $separator = ' ,'; + } + C::t('forum_typeoptionvar')->update_by_tid($this->thread['tid'], array('value' => $value, 'sortid' => $parameters['sortid']), false, false, $optionid); + } + + if($typeexpiration) { + C::t('forum_typeoptionvar')->update_by_tid($this->thread['tid'], array('expiration' => (TIMESTAMP + $typeexpiration)), false, false, null, $parameters['sortid']); + } + + if($sql || ($filedname && $valuelist)) { + if(C::t('forum_optionvalue')->fetch_all_tid($parameters['sortid'], "WHERE tid='".$this->thread['tid']."'")) { + if($sql) { + C::t('forum_optionvalue')->update_optionvalue($parameters['sortid'], $this->thread['tid'], $this->forum['fid'], $sql); + } + } elseif($filedname && $valuelist) { + C::t('forum_optionvalue')->insert_optionvalue($parameters['sortid'], "($filedname, tid, fid) VALUES ($valuelist, '".$this->thread['tid']."', '".$this->forum['fid']."')"); + } + } + } + } + } + + public function after_deletepost() { + $isfirstpost = $this->post['first'] ? 1 : 0; + if($isfirstpost) { + C::t('forum_typeoptionvar')->delete_by_tid($this->thread['tid']); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/extend_thread_trade.php b/source/class/extend/extend_thread_trade.php new file mode 100644 index 0000000..d932549 --- /dev/null +++ b/source/class/extend/extend_thread_trade.php @@ -0,0 +1,349 @@ +showmessage('trade_please_name'); + } elseif($this->group['maxtradeprice'] && $item_price > 0 && ($this->group['mintradeprice'] > $item_price || $this->group['maxtradeprice'] < $item_price)) { + return $this->showmessage('trade_price_between', '', array('mintradeprice' => $this->group['mintradeprice'], 'maxtradeprice' => $this->group['maxtradeprice'])); + } elseif($this->group['maxtradeprice'] && $item_credit > 0 && ($this->group['mintradeprice'] > $item_credit || $this->group['maxtradeprice'] < $item_credit)) { + return $this->showmessage('trade_credit_between', '', array('mintradeprice' => $this->group['mintradeprice'], 'maxtradeprice' => $this->group['maxtradeprice'])); + } elseif(!$this->group['maxtradeprice'] && $item_price > 0 && $this->group['mintradeprice'] > $item_price) { + return $this->showmessage('trade_price_more_than', '', array('mintradeprice' => $this->group['mintradeprice'])); + } elseif(!$this->group['maxtradeprice'] && $item_credit > 0 && $this->group['mintradeprice'] > $item_credit) { + return $this->showmessage('trade_credit_more_than', '', array('mintradeprice' => $this->group['mintradeprice'])); + } elseif($item_price <= 0 && $item_credit <= 0) { + return $this->showmessage('trade_pricecredit_need'); + } elseif($_GET['item_number'] < 1) { + return $this->showmessage('tread_please_number'); + } + + if(!empty($_FILES['tradeattach']['tmp_name'][0])) { + $_FILES['attach'] = array_merge_recursive((array)$_FILES['attach'], $_FILES['tradeattach']); + } + + if(($this->group['allowpostattach'] || $this->group['allowpostimage']) && is_array($_FILES['attach'])) { + foreach($_FILES['attach']['name'] as $attachname) { + if($attachname != '') { + checklowerlimit('postattach', 0, 1, $this->forum['fid']); + break; + } + } + } + + $this->trademessage = $parameters['message']; + $this->param['message'] = ''; + } + + public function after_newthread() { + if(!$this->tid) { + return; + } + $this->trademessage = preg_replace('/\[attachimg\](\d+)\[\/attachimg\]/is', '[attach]\1[/attach]', $this->trademessage); + $pid = insertpost(array( + 'fid' => $this->forum['fid'], + 'tid' => $this->tid, + 'first' => '0', + 'author' => $this->member['username'], + 'authorid' => $this->member['uid'], + 'subject' => $this->param['subject'], + 'dateline' => getglobal('timestamp'), + 'message' => $this->trademessage, + 'useip' => getglobal('clientip'), + 'invisible' => 0, + 'anonymous' => $this->param['isanonymous'], + 'usesig' => $_GET['usesig'], + 'htmlon' => $this->param['htmlon'], + 'bbcodeoff' => 0, + 'smileyoff' => $this->param['smileyoff'], + 'parseurloff' => $this->param['parseurloff'], + 'attachment' => 0, + 'tags' => $this->param['tagstr'], + 'status' => (defined('IN_MOBILE') ? 8 : 0) + )); + if(!empty($_GET['tradeaid'])) { + convertunusedattach($_GET['tradeaid'], $this->tid, $pid); + } + + ($this->group['allowpostattach'] || $this->group['allowpostimage']) && ($_GET['attachnew'] || $_GET['tradeaid']) && updateattach($this->param['displayorder'] == -4 || $this->param['modnewthreads'], $this->tid, $pid, $_GET['attachnew']); + require_once libfile('function/trade'); + $author = !$this->param['isanonymous'] ? $this->member['username'] : ''; + trade_create(array( + 'tid' => $this->tid, + 'pid' => $pid, + 'aid' => $_GET['tradeaid'], + 'item_expiration' => $_GET['item_expiration'], + 'thread' => $this->thread, + 'discuz_uid' => $this->member['uid'], + 'author' => $author, + 'seller' => empty($_GET['paymethod']) && $_GET['seller'] ? dhtmlspecialchars(trim($_GET['seller'])) : '', + 'tenpayaccount' => $_GET['tenpay_account'], + 'item_name' => $_GET['item_name'], + 'item_price' => $_GET['item_price'], + 'item_number' => $_GET['item_number'], + 'item_quality' => $_GET['item_quality'], + 'item_locus' => $_GET['item_locus'], + 'transport' => $_GET['transport'], + 'postage_mail' => $_GET['postage_mail'], + 'postage_express' => $_GET['postage_express'], + 'postage_ems' => $_GET['postage_ems'], + 'item_type' => $_GET['item_type'], + 'item_costprice' => $_GET['item_costprice'], + 'item_credit' => $_GET['item_credit'], + 'item_costcredit' => $_GET['item_costcredit'] + )); + $this->param['tradepid'] = $pid; + + + } + + public function before_feed() { + if(!empty($_GET['addfeed']) && $this->forum['allowfeed'] && !$this->param['isanonymous']) { + $this->feed['icon'] = 'goods'; + $this->feed['title_template'] = 'feed_thread_goods_title'; + if($_GET['item_price'] > 0) { + if($this->setting['creditstransextra'][5] != -1 && $_GET['item_credit']) { + $this->feed['body_template'] = 'feed_thread_goods_message_1'; + } else { + $this->feed['body_template'] = 'feed_thread_goods_message_2'; + } + } else { + $this->feed['body_template'] = 'feed_thread_goods_message_3'; + } + $pid = $this->param['tradepid']; + $this->feed['body_data'] = array( + 'itemname'=> "tid."&pid=$pid\">{$_GET['item_name']}", + 'itemprice'=> $_GET['item_price'], + 'itemcredit'=> $_GET['item_credit'], + 'creditunit'=> $this->setting['extcredits'][$this->setting['creditstransextra'][5]]['unit'].$this->setting['extcredits'][$this->setting['creditstransextra'][5]]['title'] + ); + if($_GET['tradeaid']) { + $this->feed['images'] = array(getforumimg($_GET['tradeaid'])); + $this->feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid=".$this->tid."&pid=$pid"); + } + if($_GET['tradeaid']) { + $attachment = C::t('forum_attachment_n')->fetch_attachment('tid:'.$this->tid, $_GET['tradeaid']); + if(in_array($attachment['filetype'], array('image/gif', 'image/jpeg', 'image/png'))) { + $imgurl = $this->setting['attachurl'].'forum/'.($attachment['thumb'] && $attachment['filetype'] != 'image/gif' ? getimgthumbname($attachment['attachment']) : $attachment['attachment']); + $this->feed['images'][] = $attachment['attachment'] ? $imgurl : ''; + $this->feed['image_links'][] = $attachment['attachment'] ? "forum.php?mod=viewthread&tid=".$this->tid : ''; + } + } + } + } + + public function after_feed() { + global $extra; + $values = array('fid' => $this->forum['fid'], 'tid' => $this->tid, 'pid' => $this->pid, 'coverimg' => ''); + $values = array_merge($values, (array)$this->param['values'], $this->param['param']); + if(!empty($_GET['continueadd'])) { + showmessage('post_newthread_succeed', "forum.php?mod=post&action=reply&fid=".$this->forum['fid']."&tid=".$this->tid."&addtrade=yes", $values, array('header' => true)); + } else { + showmessage('post_newthread_succeed', "forum.php?mod=viewthread&tid=".$this->tid."&extra=$extra", $values); + } + } + + public function before_newreply($parameters) { + $item_price = floatval($_GET['item_price']); + $item_credit = intval($_GET['item_credit']); + if(!trim($_GET['item_name'])) { + return $this->showmessage('trade_please_name'); + } elseif($this->group['maxtradeprice'] && $item_price > 0 && ($this->group['mintradeprice'] > $item_price || $this->group['maxtradeprice'] < $item_price)) { + return $this->showmessage('trade_price_between', '', array('mintradeprice' => $this->group['mintradeprice'], 'maxtradeprice' => $this->group['maxtradeprice'])); + } elseif($this->group['maxtradeprice'] && $item_credit > 0 && ($this->group['mintradeprice'] > $item_credit || $this->group['maxtradeprice'] < $item_credit)) { + return $this->showmessage('trade_credit_between', '', array('mintradeprice' => $this->group['mintradeprice'], 'maxtradeprice' => $this->group['maxtradeprice'])); + } elseif(!$this->group['maxtradeprice'] && $item_price > 0 && $this->group['mintradeprice'] > $item_price) { + return $this->showmessage('trade_price_more_than', '', array('mintradeprice' => $this->group['mintradeprice'])); + } elseif(!$this->group['maxtradeprice'] && $item_credit > 0 && $this->group['mintradeprice'] > $item_credit) { + return $this->showmessage('trade_credit_more_than', '', array('mintradeprice' => $this->group['mintradeprice'])); + } elseif($item_price <= 0 && $item_credit <= 0) { + return $this->showmessage('trade_pricecredit_need'); + } elseif($_GET['item_number'] < 1) { + return $this->showmessage('tread_please_number'); + } + } + + public function after_newreply() { + if(!$this->pid) { + return; + } + if($this->param['special'] == 2 && $this->group['allowposttrade'] && $this->thread['authorid'] == $this->member['uid'] && !empty($_GET['trade']) && !empty($_GET['item_name'])) { + $author = (!$this->param['isanonymous']) ? $this->member['username'] : ''; + require_once libfile('function/trade'); + trade_create(array( + 'tid' => $this->thread['tid'], + 'pid' => $this->pid, + 'aid' => $_GET['tradeaid'], + 'item_expiration' => $_GET['item_expiration'], + 'thread' => $this->thread, + 'discuz_uid' => $this->member['uid'], + 'author' => $author, + 'seller' => empty($_GET['paymethod']) && $_GET['seller'] ? dhtmlspecialchars(trim($_GET['seller'])) : '', + 'item_name' => $_GET['item_name'], + 'item_price' => $_GET['item_price'], + 'item_number' => $_GET['item_number'], + 'item_quality' => $_GET['item_quality'], + 'item_locus' => $_GET['item_locus'], + 'transport' => $_GET['transport'], + 'postage_mail' => $_GET['postage_mail'], + 'postage_express' => $_GET['postage_express'], + 'postage_ems' => $_GET['postage_ems'], + 'item_type' => $_GET['item_type'], + 'item_costprice' => $_GET['item_costprice'], + 'item_credit' => $_GET['item_credit'], + 'item_costcredit' => $_GET['item_costcredit'] + )); + + if(!empty($_GET['tradeaid'])) { + convertunusedattach($_GET['tradeaid'], $this->thread['tid'], $this->pid); + } + } + + if(!$this->forum['allowfeed'] || !$_GET['addfeed']) { + $this->after_replyfeed(); + } + } + + public function before_replyfeed() { + if($this->forum['allowfeed'] && !$this->param['isanonymous']) { + if($this->param['special'] == 2 && !empty($_GET['trade'])) { + $creditstransextra = $this->setting['creditstransextra']; + $extcredits = $this->setting['extcredits']; + $this->feed['icon'] = 'goods'; + $this->feed['title_template'] = 'feed_thread_goods_title'; + if($_GET['item_price'] > 0) { + if($creditstransextra[5] != -1 && $_GET['item_credit']) { + $this->feed['body_template'] = 'feed_thread_goods_message_1'; + } else { + $this->feed['body_template'] = 'feed_thread_goods_message_2'; + } + } else { + $this->feed['body_template'] = 'feed_thread_goods_message_3'; + } + $this->feed['body_data'] = array( + 'itemname'=> "thread['tid']."&pid=".$this->pid."\">".dhtmlspecialchars($_GET['item_name'])."", + 'itemprice'=> $_GET['item_price'], + 'itemcredit'=> $_GET['item_credit'], + 'creditunit'=> $extcredits[$creditstransextra[5]]['unit'].$extcredits[$creditstransextra[5]]['title'], + ); + if($_GET['tradeaid']) { + $this->feed['images'] = array(getforumimg($_GET['tradeaid'])); + $this->feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid=".$this->thread['tid']."&pid=".$this->pid); + } + } + } + } + + public function after_replyfeed() { + global $extra; + if($this->param['special'] == 2 && $this->group['allowposttrade'] && $this->thread['authorid'] == $this->member['uid']) { + if(!empty($_GET['continueadd'])) { + dheader("location: forum.php?mod=post&action=reply&fid=".$this->forum['fid']."&firstpid=".$this->pid."&tid=".$this->thread['tid']."&addtrade=yes"); + } else { + if($this->param['modnewreplies']) { + $url = "forum.php?mod=viewthread&tid=".$this->thread['tid']; + } else { + $url = "forum.php?mod=viewthread&tid=".$this->thread['tid']."&pid=".$this->pid."&page=".$this->param['page']."&extra=".$extra."#pid".$this->pid; + } + return $this->showmessage('trade_add_succeed', $url, $this->param['showmsgparam']); + } + } + } + + public function before_editpost($parameters) { + global $closed; + if($parameters['special'] == 2 && $this->group['allowposttrade']) { + + if($trade = C::t('forum_trade')->fetch_goods($this->thread['tid'], $this->post['pid'])) { + $seller = empty($_GET['paymethod']) && $_GET['seller'] ? censor(dhtmlspecialchars(trim($_GET['seller']))) : ''; + $item_name = censor(dhtmlspecialchars(trim($_GET['item_name']))); + $item_price = floatval($_GET['item_price']); + $item_credit = intval($_GET['item_credit']); + $item_locus = censor(dhtmlspecialchars(trim($_GET['item_locus']))); + $item_number = intval($_GET['item_number']); + $item_quality = intval($_GET['item_quality']); + $item_transport = intval($_GET['item_transport']); + $postage_mail = intval($_GET['postage_mail']); + $postage_express = intval(trim($_GET['postage_express'])); + $postage_ems = intval($_GET['postage_ems']); + $item_type = intval($_GET['item_type']); + $item_costprice = floatval($_GET['item_costprice']); + + if(!trim($item_name)) { + showmessage('trade_please_name'); + } elseif($this->group['maxtradeprice'] && $item_price > 0 && ($this->group['mintradeprice'] > $item_price || $this->group['maxtradeprice'] < $item_price)) { + showmessage('trade_price_between', '', array('mintradeprice' => $this->group['mintradeprice'], 'maxtradeprice' => $this->group['maxtradeprice'])); + } elseif($this->group['maxtradeprice'] && $item_credit > 0 && ($this->group['mintradeprice'] > $item_credit || $this->group['maxtradeprice'] < $item_credit)) { + showmessage('trade_credit_between', '', array('mintradeprice' => $this->group['mintradeprice'], 'maxtradeprice' => $this->group['maxtradeprice'])); + } elseif(!$this->group['maxtradeprice'] && $item_price > 0 && $this->group['mintradeprice'] > $item_price) { + showmessage('trade_price_more_than', '', array('mintradeprice' => $this->group['mintradeprice'])); + } elseif(!$this->group['maxtradeprice'] && $item_credit > 0 && $this->group['mintradeprice'] > $item_credit) { + showmessage('trade_credit_more_than', '', array('mintradeprice' => $this->group['mintradeprice'])); + } elseif($item_price <= 0 && $item_credit <= 0) { + showmessage('trade_pricecredit_need'); + } elseif($item_number < 1) { + showmessage('tread_please_number'); + } + + if($trade['aid'] && $_GET['tradeaid'] && $trade['aid'] != $_GET['tradeaid']) { + $attach = C::t('forum_attachment_n')->fetch_attachment('tid:'.$this->thread['tid'], $trade['aid']); + C::t('forum_attachment')->delete($trade['aid']); + C::t('forum_attachment_n')->delete_attachment('tid:'.$this->thread['tid'], $trade['aid']); + dunlink($attach); + $this->param['threadimageaid'] = $_GET['tradeaid']; + convertunusedattach($_GET['tradeaid'], $this->thread['tid'], $this->post['pid']); + } + + $expiration = $_GET['item_expiration'] ? @strtotime($_GET['item_expiration']) : 0; + $closed = $expiration > 0 && @strtotime($_GET['item_expiration']) < TIMESTAMP ? 1 : $closed; + + switch($_GET['transport']) { + case 'seller':$item_transport = 1;break; + case 'buyer':$item_transport = 2;break; + case 'virtual':$item_transport = 3;break; + case 'logistics':$item_transport = 4;break; + } + if(!$item_price || $item_price <= 0) { + $item_price = $postage_mail = $postage_express = $postage_ems = ''; + } + + $data = array('aid' => $_GET['tradeaid'], 'account' => $seller, 'tenpayaccount' => $_GET['tenpay_account'], 'subject' => $item_name, 'price' => $item_price, 'amount' => $item_number, 'quality' => $item_quality, 'locus' => $item_locus, 'transport' => $item_transport, 'ordinaryfee' => $postage_mail, 'expressfee' => $postage_express, 'emsfee' => $postage_ems, 'itemtype' => $item_type, 'expiration' => $expiration, 'closed' => $closed, 'costprice' => $item_costprice, 'credit' => $item_credit, 'costcredit' => $_GET['item_costcredit']); + C::t('forum_trade')->update_trade($this->thread['tid'], $this->post['pid'], $data); + if(!empty($_GET['infloat'])) { + $viewpid = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid']); + $viewpid = $viewpid['pid']; + $this->param['redirecturl'] = "forum.php?mod=viewthread&tid=".$this->thread['tid']."&viewpid=$viewpid#pid$viewpid"; + } else { + $this->param['redirecturl'] = "forum.php?mod=viewthread&do=tradeinfo&tid=".$this->thread['tid']."&pid=".$this->post['pid']; + } + } + + } + } + + public function after_deletepost() { + if($this->thread['special'] == 2) { + C::t('forum_trade')->delete_by_id_idtype($this->post['pid'], 'pid'); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/extend/index.htm b/source/class/extend/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/filesock/filesock_base.php b/source/class/filesock/filesock_base.php new file mode 100644 index 0000000..1b07197 --- /dev/null +++ b/source/class/filesock/filesock_base.php @@ -0,0 +1,267 @@ +verifypeer = $_G['config']['security']['fsockopensafe']['verifypeer']; + if(!empty($param)) { + $this->set($param); + } + } + + private function _query_safecheck($tmp) { + global $_G; + $this->primaryip = ''; + if(!$tmp || empty($tmp['host'])) return false; + $isip = false; + if(filter_var(str_replace(array('[',']'), '', $tmp['host']), FILTER_VALIDATE_IP)) { + $isip = true; + } + if(isset($tmp['user']) || isset($tmp['pass'])) return false; + if(!$isip && strpbrk($tmp['host'], ':#?[]') !== false) return false; + if($this->ip) { + if(!(filter_var($this->ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)) { + return false; + } elseif(filter_var($this->ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) { + $this->primaryip = '['.$this->ip.']'; + } else { + $this->primaryip = $this->ip; + } + } elseif($isip) { + if(!(filter_var(str_replace(array('[',']'), '', $tmp['host']), FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)) { + return false; + } else { + $this->primaryip = $tmp['host']; + } + } + if(!in_array(strtolower($tmp['scheme']), array('http', 'https'))) { + return false; + } + $config = $_G['config']['security']['fsockopensafe']; + + if(!empty($config['port']) && isset($tmp['port'])) { + if(isset($_SERVER['SERVER_PORT']) && !in_array($_SERVER['SERVER_PORT'], $config['port'])) { + $config['port'][] = $_SERVER['SERVER_PORT']; + } + if(!in_array($tmp['port'], $config['port'])) { + return false; + } + } + + if(!isset($tmp['port'])) { + $tmp['port'] = strtolower($tmp['scheme']) == 'https' ? 443 : 80; + } + if($this->primaryip) { + return $tmp; + } + $this->_dns_query($tmp['host']); + if(!$this->primaryip) return false; + if(!$this->allowmultiip) { + $this->_connectivity_check($tmp['port']); + } + + return $tmp; + } + private function _parse_url() { + $tmp = parse_url($this->url); + if(!$this->unsafe) { + $tmp = $this->_query_safecheck($tmp); + if($tmp === false) { + $this->safequery = false; + $this->scheme = ''; + $this->host = ''; + $this->path = '/'; + $this->port = '80'; + return; + } + } elseif($this->ip) { + if(filter_var($this->ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) { + $this->primaryip = '['.$this->ip.']'; + } else { + $this->primaryip = $this->ip; + } + } + $this->scheme = $tmp['scheme']; + $this->host = $tmp['host']; + $this->path = !empty($tmp['path']) ? $tmp['path'].(empty($tmp['query']) ? '' : '?'.$tmp['query']) : '/'; + $this->port = empty($tmp['port']) ? ($this->scheme == 'https' ? '443' : '80') : $tmp['port']; + } + private function _dns_query($host) { + global $_G; + if(!$host) { + return; + } + $config = $_G['config']['security']['fsockopensafe']; + $dnsresult = [[],[]]; + $recordtype = 0; + $ipversion = is_array($config['ipversion']) ? $config['ipversion'] : array('ipv6', 'ipv4'); + if(in_array('ipv4', $ipversion)) { + $recordtype += DNS_A; + } + if(in_array('ipv6', $ipversion)) { + $recordtype += DNS_AAAA; + } + $dnsq = dns_get_record($host, $recordtype); + foreach($dnsq as $v) { + if($v['type'] == 'A' && filter_var($v['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) { + $dnsresult[0][] = $v['ip']; + } elseif($v['type'] == 'AAAA' && filter_var($v['ipv6'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) { + $dnsresult[1][] = $v['ipv6']; + } + } + $this->iplist = $dnsresult; + $this->primaryip = ''; + if(!empty($dnsresult[0])) { + $this->primaryip = $dnsresult[0][0]; + } elseif(!empty($dnsresult[1])) { + $this->primaryip = '['.$dnsresult[1][0].']'; + } + } + private function _connectivity_check($port) { + foreach($this->iplist[1] as $v) { + if($this->_ipcheck('['.$v.']', $port)) { + $this->primaryip = '['.$v.']'; + return; + } + } + foreach($this->iplist[0] as $v) { + if($this->_ipcheck($v, $port)) { + $this->primaryip = $v; + return; + } + } + } + private function _ipcheck($ip, $port) { + $errstr = ''; + $ch = fsocketopen($ip, $port, $errno, $errstr, 0.6); + if(!$ch) { + return false; + } else { + fclose($ch); + return true; + } + } + private function _format_postkey($post, &$result, $key = '') { + foreach($post as $k => $v) { + $_k = $key ? $key.'['.$k.']' : $k; + if(is_array($v)) { + $this->_format_postkey($v, $result, $_k); + } else { + $result[$_k] = $v; + } + } + } + private function _format_encodetype() { + if($this->encodetype === 'URLENCODE') { + $this->encodetype = 'application/x-www-form-urlencoded'; + } elseif($this->encodetype === 'FORMDATA') { + $this->encodetype = 'multipart/form-data'; + } elseif($this->encodetype === 'JSON') { + $this->encodetype = 'application/json'; + } + } + private function _detect_method() { + if($this->post || $this->files) { + $this->method = 'POST'; + } else { + $this->method = 'GET'; + } + } + public function set($param) { + if(is_string($param)) { + $param = array('url' => $param); + } + foreach($param as $key => $value) { + if(property_exists($this, $key)) { + $this->$key = $value; + } + } + } + public function request($param = array()) { + if(!empty($param)) { + $this->set($param); + } + $this->_parse_url(); + $this->_format_encodetype(); + if(!$this->useragent) { + $this->useragent = $_SERVER['HTTP_USER_AGENT']; + } + if(!$this->method) { + $this->_detect_method(); + } + if($this->post) { + if(!is_array($this->post)) { + parse_str($this->post, $this->post); + } + $this->_format_postkey($this->post, $postnew); + $this->post = $postnew; + } + } + public function get($param = array()) { + $this->method = 'GET'; + return $this->request($param); + } + public function post($param = array()) { + $this->method = 'POST'; + return $this->request($param); + } + public function head($param = array()) { + $this->method = 'HEAD'; + return $this->request($param); + } + public function patch($param = array()) { + $this->method = 'PATCH'; + return $this->request($param); + } + public function put($param = array()) { + $this->method = 'PUT'; + return $this->request($param); + } + public function delete($param = array()) { + $this->method = 'DELETE'; + return $this->request($param); + } +} \ No newline at end of file diff --git a/source/class/filesock/filesock_curl.php b/source/class/filesock/filesock_curl.php new file mode 100644 index 0000000..c86a98b --- /dev/null +++ b/source/class/filesock/filesock_curl.php @@ -0,0 +1,128 @@ +=')) { + $this->allowmultiip = true; + } + } + public function request($param = array()) { + parent::request($param); + if(!$this->safequery) { + return ''; + } + $ch = curl_init(); + $headerlist = $httpheader = array(); + if($this->primaryip) { + $headerlist['Host'] = $this->host; + } + $headerlist['User-Agent'] = $this->useragent; + if($this->primaryip) { + if($this->allowmultiip && $this->iplist) { + $iplist = array(); + foreach($this->iplist[1] as $v) { + $iplist[] = '['.$v.']'; + } + foreach($this->iplist[0] as $v) { + $iplist[] = $v; + } + curl_setopt($ch, CURLOPT_RESOLVE, array($this->host.':'.$this->port.':'.implode(',', $iplist))); + } else { + curl_setopt($ch, CURLOPT_RESOLVE, array($this->host.':'.$this->port.':'.$this->primaryip)); + } + } + curl_setopt($ch, CURLOPT_URL, $this->scheme.'://'.$this->host.($this->port ? ':'.$this->port : '').$this->path); + if($this->scheme == 'https') { + if($this->verifypeer) { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + if(is_string($this->verifypeer)) { + curl_setopt($ch, CURLOPT_CAINFO, $this->verifypeer); + } + } else { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + } + } + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HEADER, 1); + curl_setopt($ch, CURLOPT_FAILONERROR, $this->failonerror); + $usetmpfile = false; + if($this->method == 'POST') { + curl_setopt($ch, CURLOPT_POST, 1); + if($this->encodetype == 'application/x-www-form-urlencoded') { + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($this->post)); + } elseif($this->encodetype == 'multipart/form-data') { + foreach($this->post as $k => $v) { + if(isset($this->files[$k])) { + $usetmpfile = true; + $tmpnam = tempnam(DISCUZ_ROOT.'./data/attachment/temp', 'cU'); + file_put_contents($tmpnam, $v); + $this->post[$k] = curl_file_create($tmpnam, 'application/octet-stream', $this->files[$k]); + } + } + foreach($this->files as $k => $file) { + if(!isset($this->post[$k]) && file_exists($file)) { + $this->post[$k] = curl_file_create($file); + } + } + curl_setopt($ch, CURLOPT_POSTFIELDS, $this->post); + } else { + $headerlist['Content-Type'] = $this->encodetype; + curl_setopt($ch, CURLOPT_POSTFIELDS, $this->rawdata); + } + } elseif(!in_array($this->method, array('GET', 'HEAD')) && $this->rawdata) { + $headerlist['Content-Type'] = $this->encodetype; + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->method); + curl_setopt($ch, CURLOPT_POSTFIELDS, $this->rawdata); + } elseif($this->method != 'GET') { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->method); + } + if($this->header) { + foreach($this->header as $k => $v) { + $headerlist[$k] = $v; + } + } + foreach($headerlist as $k => $v) { + $httpheader[] = $k.': '.$v; + } + curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader); + if($this->cookie) { + curl_setopt($ch, CURLOPT_COOKIE, $this->cookie); + } + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->conntimeout); + curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); + $data = curl_exec($ch); + $this->curlstatus = curl_getinfo($ch); + $this->errno = curl_errno($ch); + $this->errstr = curl_error($ch); + curl_close($ch); + if($usetmpfile && $dh = opendir(DISCUZ_ROOT.'./data/attachment/temp')) { + while(($fil = readdir($dh)) !== false) { + if(substr($fil, 0, 2) == 'cU') { + unlink(DISCUZ_ROOT.'./data/attachment/temp/'.$fil); + } + } + closedir($dh); + } + $GLOBALS['filesockheader'] = $this->filesockheader = substr($data, 0, $this->curlstatus['header_size']); + $data = substr($data, $this->curlstatus['header_size'] + $this->position); + $this->filesockbody = !$this->limit ? $data : substr($data, 0, $this->limit); + if(!$this->returnbody || $this->errno) { + return; + } else { + return $this->filesockbody; + } + } + +} \ No newline at end of file diff --git a/source/class/filesock/filesock_stream.php b/source/class/filesock/filesock_stream.php new file mode 100644 index 0000000..283e460 --- /dev/null +++ b/source/class/filesock/filesock_stream.php @@ -0,0 +1,183 @@ +safequery) { + return ''; + } + $boundary = $this->encodetype == 'application/x-www-form-urlencoded' ? '' : '----WebKitFormBoundary'.random(16); + $header = ''; + $headerlist = array(); + $headerlist['Accept'] = '*/*'; + $headerlist['Accept-Language'] = 'zh-CN'; + $headerlist['User-Agent'] = $this->useragent; + $headerlist['Host'] = $this->host.':'.$this->port; + $headerlist['Connection'] = 'Close'; + if($this->method == 'POST') { + if($this->encodetype == 'application/x-www-form-urlencoded') { + $data = http_build_query($this->post); + } elseif($this->encodetype == 'multipart/form-data') { + $data = ''; + foreach($this->post as $k => $v) { + $data .= "--$boundary\r\n"; + $data .= 'Content-Disposition: form-data; name="'.$k.'"'.(isset($this->files[$k]) ? '; filename="'.basename($this->files[$k])."\"\r\n".'Content-Type: application/octet-stream' : '')."\r\n\r\n"; + $data .= $v."\r\n"; + } + foreach($this->files as $k => $file) { + if(!isset($this->post[$k]) && file_exists($file)) { + if($fp = @fopen($file, 'r')) { + $v = fread($fp, filesize($file)); + fclose($fp); + $data .= "--$boundary\r\n"; + $data .= 'Content-Disposition: form-data; name="'.$k.'"; filename="'.basename($file)."\"\r\n".'Content-Type: application/octet-stream'."\r\n\r\n"; + $data .= $v."\r\n"; + } + } + } + $data .= "--$boundary--\r\n"; + } else { + $data = $this->rawdata; + } + if($this->encodetype == 'multipart/form-data') { + $headerlist['Content-Type'] = 'multipart/form-data; boundary='.$boundary; + } else { + $headerlist['Content-Type'] = $this->encodetype; + } + $headerlist['Content-Length'] = strlen($data); + $headerlist['Cache-Control'] = 'no-cache'; + } elseif(!in_array($this->method, array('GET', 'HEAD')) && $this->rawdata) { + $data = $this->rawdata; + $headerlist['Content-Type'] = $this->encodetype; + $headerlist['Content-Length'] = strlen($data); + $headerlist['Cache-Control'] = 'no-cache'; + } + $out = $this->method.' '.$this->path." HTTP/1.0\r\n"; + if($this->header) { + foreach($this->header as $k => $v) { + $headerlist[$k] = $v; + } + } + if($this->cookie) { + $headerlist['Cookie'] = $this->cookie; + } + $header = $this->_build_header($headerlist); + $out .= $header; + if(isset($data) && $data) { + $out .= $data; + } + + $fpflag = 0; + $context = array(); + if($this->scheme == 'https') { + $context['ssl'] = array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'peer_name' => $this->host, + ); + if($this->verifypeer) { + $context['ssl']['verify_peer'] = true; + $context['ssl']['verify_peer_name'] = true; + $context['ssl']['allow_self_signed'] = false; + if(is_string($this->verifypeer)) { + $context['ssl']['cafile'] = $this->verifypeer; + } + } + } + if(ini_get('allow_url_fopen')) { + $context['http'] = array( + 'method' => $this->method, + 'header' => $header, + 'timeout' => $this->conntimeout, + 'ignore_errors' => !$this->failonerror, + ); + if(isset($data)) { + $context['http']['content'] = $data; + } + $context = stream_context_create($context); + $errno = 0; + $errstr = ''; + set_error_handler(function($eno, $est) use (&$errno, &$errstr) { + $errno = $eno; + $errstr = $est; + return true; + }); + $fp = @fopen($this->scheme.'://'.($this->primaryip ? $this->primaryip : $this->host).':'.$this->port.$this->path, 'b', false, $context); + $fpflag = 1; + restore_error_handler(); + } elseif(function_exists('stream_socket_client')) { + $context = stream_context_create($context); + $fp = @stream_socket_client(($this->scheme == 'https' ? 'ssl://' : '').($this->primaryip ? $this->primaryip : $this->host).':'.$this->port, $errno, $errstr, $this->conntimeout, STREAM_CLIENT_CONNECT, $context); + } else { + $fp = @fsocketopen(($this->scheme == 'https' ? 'ssl://' : '').($this->scheme == 'https' ? $this->host : ($this->ip ? $this->ip : $this->host)), $this->port, $errno, $errstr, $this->conntimeout); + } + + if(!$fp) { + $this->errno = $errno; + $this->errstr = $errstr; + return; + } else { + stream_set_blocking($fp, $this->block); + stream_set_timeout($fp, $this->timeout); + if(!$fpflag) { + @fwrite($fp, $out); + } + $status = stream_get_meta_data($fp); + if(!$status['timed_out']) { + $headers = ''; + if($fpflag) { + $headers = implode("\r\n", $http_response_header)."\r\n\r\n"; + } else { + while(!feof($fp) && !$fpflag) { + $header = @fgets($fp); + $headers .= $header; + if($this->failonerror && $header && substr($header, 0, 6) == 'HTTP/1' && intval(substr($header, 9, 3)) > 400) { + $this->errno = 2; + $this->errstr = 'Failed to open stream: HTTP request failed! '.$header; + return; + } + if($header && ($header == "\r\n" || $header == "\n")) { + break; + } + } + } + $GLOBALS['filesockheader'] = $this->filesockheader = $headers; + + if($this->position) { + for($i=0; $i<$this->position; $i++) { + fgetc($fp); + } + } + + if($this->limit) { + $return = stream_get_contents($fp, $this->limit); + } else { + $return = stream_get_contents($fp); + } + } + @fclose($fp); + $this->filesockbody = $return; + if($this->returnbody) { + return $return; + } else { + return; + } + } + } + private function _build_header($param) { + $output = ''; + foreach($param as $k => $v) { + $output .= $k.': '.$v."\r\n"; + } + return $output."\r\n"; + } +} \ No newline at end of file diff --git a/source/class/filesock/index.htm b/source/class/filesock/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/forum/forum_upload.php b/source/class/forum/forum_upload.php new file mode 100644 index 0000000..83e5349 --- /dev/null +++ b/source/class/forum/forum_upload.php @@ -0,0 +1,185 @@ +uid = intval($_GET['uid']); + $swfhash = md5(substr(md5($_G['config']['security']['authkey']), 8).$this->uid); + $this->aid = 0; + $this->getaid = $getaid; + $this->simple = !empty($_GET['simple']) ? $_GET['simple'] : 0; + + if($_GET['hash'] != $swfhash) { + return $this->uploadmsg(10); + } + + + $upload = new discuz_upload(); + $upload->init($_FILES['Filedata'], 'forum'); + $this->attach = &$upload->attach; + + if($upload->error()) { + return $this->uploadmsg(2); + } + + $allowupload = ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) ? (!$_G['group']['maxattachnum'] || $_G['group']['maxattachnum'] && $_G['group']['maxattachnum'] > getuserprofile('todayattachs')) : false; + if(!$allowupload) { + return $this->uploadmsg(6); + } + + if($_G['group']['attachextensions'] && (!preg_match("/(^|\s|,)".preg_quote($upload->attach['ext'], '/')."($|\s|,)/i", $_G['group']['attachextensions']) || !$upload->attach['ext'])) { + return $this->uploadmsg(1); + } + + if(empty($upload->attach['size'])) { + return $this->uploadmsg(2); + } + + if($_G['group']['maxattachsize'] && $upload->attach['size'] > $_G['group']['maxattachsize']) { + $this->error_sizelimit = $_G['group']['maxattachsize']; + return $this->uploadmsg(3); + } + + loadcache('attachtype'); + if($_G['fid'] && isset($_G['cache']['attachtype'][$_G['fid']][$upload->attach['ext']])) { + $maxsize = $_G['cache']['attachtype'][$_G['fid']][$upload->attach['ext']]; + } elseif(isset($_G['cache']['attachtype'][0][$upload->attach['ext']])) { + $maxsize = $_G['cache']['attachtype'][0][$upload->attach['ext']]; + } + if(isset($maxsize)) { + if(!$maxsize) { + $this->error_sizelimit = 'ban'; + return $this->uploadmsg(4); + } elseif($upload->attach['size'] > $maxsize) { + $this->error_sizelimit = $maxsize; + return $this->uploadmsg(5); + } + } + + if($upload->attach['size'] && $_G['group']['maxsizeperday']) { + $todaysize = getuserprofile('todayattachsize') + $upload->attach['size']; + if($todaysize >= $_G['group']['maxsizeperday']) { + $this->error_sizelimit = 'perday|'.$_G['group']['maxsizeperday']; + return $this->uploadmsg(11); + } + } + + $filename = censor($upload->attach['name'], NULL, TRUE); + if(is_array($filename)) { + return $this->uploadmsg(12); + } + + if(isset($_GET['type']) && $_GET['type'] == 'image' && !$upload->attach['isimage']) { + return $this->uploadmsg(7); + } + + if($upload->attach['isimage']) { + $imageinfo = @getimagesize($upload->attach['tmp_name']); + list($width, $height, $type) = !empty($imageinfo) ? $imageinfo : array(0, 0, 0); + $size = $width * $height; + if((!getglobal('setting/imagelib') && $size > (getglobal('setting/gdlimit') ? getglobal('setting/gdlimit') : 16777216)) || $size < 16 ) { + return $this->uploadmsg(13); + } + if(!in_array($type, array(1, 2, 3, 6, 13, 18)) || ($upload->attach['ext'] == 'swf' && $type != 4 && $type != 13)) { + return $this->uploadmsg(7); + } + } + + $upload->save(); + if($upload->error() == -103) { + return $this->uploadmsg(8); + } elseif($upload->error()) { + return $this->uploadmsg(9); + } + + updatemembercount($_G['uid'], array('todayattachs' => 1, 'todayattachsize' => $upload->attach['size'])); + + $thumb = $remote = $width = 0; + if($upload->attach['isimage']) { + if($_G['setting']['showexif']) { + require_once libfile('function/attachment'); + $exif = getattachexif(0, $upload->attach['target']); + } + if($_G['setting']['thumbsource'] || $_G['setting']['thumbstatus']) { + require_once libfile('class/image'); + $image = new image; + } + if($_G['setting']['thumbsource'] && $_G['setting']['sourcewidth'] && $_G['setting']['sourceheight']) { + $thumb = $image->Thumb($upload->attach['target'], '', $_G['setting']['sourcewidth'], $_G['setting']['sourceheight'], 1, 1) ? 1 : 0; + $width = $image->imginfo['width']; + $height = $image->imginfo['height']; + $upload->attach['size'] = $image->imginfo['size']; + } + if($_G['setting']['thumbstatus']) { + $thumb = $image->Thumb($upload->attach['target'], '', $_G['setting']['thumbwidth'], $_G['setting']['thumbheight'], $_G['setting']['thumbstatus'], 0) ? 1 : 0; + $width = $image->imginfo['width']; + $height = $image->imginfo['height']; + } + if($_G['setting']['thumbsource'] || !$_G['setting']['thumbstatus']) { + list($width, $height) = @getimagesize($upload->attach['target']); + } + } + if($_GET['type'] != 'image' && $upload->attach['isimage']) { + $upload->attach['isimage'] = -1; + } + $this->aid = $aid = getattachnewaid($this->uid); + $insert = array( + 'aid' => $aid, + 'dateline' => $_G['timestamp'], + 'filename' => $filename, + 'filesize' => $upload->attach['size'], + 'attachment' => $upload->attach['attachment'], + 'isimage' => $upload->attach['isimage'], + 'uid' => $this->uid, + 'thumb' => $thumb, + 'remote' => $remote, + 'width' => $width, + 'height' => $height + ); + C::t('forum_attachment_unused')->insert($insert); + if($upload->attach['isimage'] && $_G['setting']['showexif']) { + C::t('forum_attachment_exif')->insert_exif($aid, $exif); + } + return $this->uploadmsg(0); + } + + function uploadmsg($statusid) { + global $_G; + $this->error_sizelimit = !empty($this->error_sizelimit) ? $this->error_sizelimit : 0; + if($this->getaid) { + $this->getaid = $statusid ? -$statusid : $this->aid; + return; + } + if($this->simple == 1) { + echo 'DISCUZUPLOAD|'.$statusid.'|'.$this->aid.'|'.$this->attach['isimage'].'|'.$this->error_sizelimit; + } elseif($this->simple == 2) { + echo 'DISCUZUPLOAD|'.($_GET['type'] == 'image' ? '1' : '0').'|'.$statusid.'|'.$this->aid.'|'.$this->attach['isimage'].'|'.($this->attach['isimage'] ? $this->attach['attachment'] : '').'|'.$this->attach['name'].'|'.$this->error_sizelimit; + } else { + echo $statusid ? -$statusid : $this->aid; + } + exit; + } +} + +?> \ No newline at end of file diff --git a/source/class/forum/index.htm b/source/class/forum/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/helper/helper_access.php b/source/class/helper/helper_access.php new file mode 100644 index 0000000..150ecae --- /dev/null +++ b/source/class/helper/helper_access.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/source/class/helper/helper_antitheft.php b/source/class/helper/helper_antitheft.php new file mode 100644 index 0000000..db143d6 --- /dev/null +++ b/source/class/helper/helper_antitheft.php @@ -0,0 +1,178 @@ +fetch($_G['clientip']))) { + C::t('common_visit')->insert(array( + 'ip' => $_G['clientip'], + 'view' => 1, + )); + return true; + } elseif($log['view'] >= $_G['setting']['antitheft']['max']) { + return false; + } else { + C::t('common_visit')->inc($_G['clientip']); + return true; + } + } + + protected static function make_content($id, $idtype, $dsign) { + $url = ''; + $urls = parse_url($_SERVER['REQUEST_URI']); + $addstr = $urls['query'] ? $urls['query'].'&' : ''; + $url = $urls['path'].'?'.$addstr.'_dsign='.$dsign.($urls['fragment'] ? '#'.$urls['fragment'] : ''); + + return self::make_js($url); + } + + protected static function make_js($url){ + $js = ''; + return $js; + } + +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_attach.php b/source/class/helper/helper_attach.php new file mode 100644 index 0000000..4929395 --- /dev/null +++ b/source/class/helper/helper_attach.php @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/source/class/helper/helper_dbtool.php b/source/class/helper/helper_dbtool.php new file mode 100644 index 0000000..75413f6 --- /dev/null +++ b/source/class/helper/helper_dbtool.php @@ -0,0 +1,66 @@ +version(); + } + + public static function dbsize() { + $dbsize = 0; + $query = DB::query("SHOW TABLE STATUS LIKE '".getglobal('config/db/1/tablepre')."%'", 'SILENT'); + while($table = DB::fetch($query)) { + $dbsize += $table['Data_length'] + $table['Index_length']; + } + return $dbsize; + } + + public static function gettablestatus($tablename, $formatsize = true) { + $status = DB::fetch_first("SHOW TABLE STATUS LIKE '".str_replace('_', '\_', $tablename)."'"); + + if($formatsize) { + $status['Data_length'] = sizecount($status['Data_length']); + $status['Index_length'] = sizecount($status['Index_length']); + } + + return $status; + } + + public static function showtablecloumn($tablename) { + $data = array(); + $db = &DB::object(); + $query = $db->query("SHOW FULL COLUMNS FROM ".DB::table($tablename), 'SILENT'); + while($field = @DB::fetch($query)) { + $data[$field['Field']] = $field; + } + return $data; + } + + public static function isexisttable($tablename) { + $tablearr = array(); + $query = DB::query('SHOW TABLES', 'SILENT'); + while($table = DB::fetch($query)) { + foreach($table as $value) { + $tablearr[] = $value; + } + } + if(in_array(DB::table($tablename), $tablearr)) { + return true; + } else { + return false; + } + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_form.php b/source/class/helper/helper_form.php new file mode 100644 index 0000000..e27f2bb --- /dev/null +++ b/source/class/helper/helper_form.php @@ -0,0 +1,137 @@ +check($message, $modword); + if(($censor->modbanned() && empty($_G['group']['ignorecensor'])) || (($modasban && !empty($_G['setting']['modasban'])) && $censor->modmoderated() && empty($_G['group']['ignorecensor']))) { + $wordbanned = implode(', ', $censor->words_found); + if($return) { + return array('message' => lang('message', 'word_banned', array('wordbanned' => $wordbanned))); + } + if(!defined('IN_ADMINCP')) { + showmessage('word_banned', '', array('wordbanned' => $wordbanned)); + } else { + cpmsg(lang('message', 'word_banned'), '', 'error', array('wordbanned' => $wordbanned)); + } + } + if($_G['group']['allowposturl'] == 0) { + $urllist = self::get_url_list($message); + if(is_array($urllist[1])) { + foreach($urllist[1] as $key => $val) { + if(!$val = trim($val)) continue; + if(!iswhitelist($val)) { + if($return) { + return array('message' => 'post_url_nopermission'); + } + showmessage('post_url_nopermission'); + } + } + } + } elseif($_G['group']['allowposturl'] == 2) { + $message = preg_replace("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\r\n\[\"']+?))?\](.+?)\[\/url\]/is", '\\5', $message); + } + return $message; + } + + public static function censormod($message) { + global $_G; + if($_G['group']['ignorecensor']) { + return false; + } + $modposturl = false; + if($_G['group']['allowposturl'] == 1) { + $urllist = self::get_url_list($message); + if(is_array($urllist[1])) foreach($urllist[1] as $key => $val) { + if(!$val = trim($val)) continue; + if(!iswhitelist($val)) { + $modposturl = true; + } + } + } + if($modposturl) { + return true; + } + + $censor = discuz_censor::instance(); + $censor->check($message); + return $censor->modmoderated(); + } + + public static function get_url_list($message) { + $return = array(); + + (strpos($message, '[/img]') || strpos($message, '[/flash]')) && $message = preg_replace("/\[img[^\]]*\]\s*([^\[\<\r\n]+?)\s*\[\/img\]|\[flash[^\]]*\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", '', $message); + if(preg_match_all("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)[^ \[\]\"']+/i", $message, $urllist)) { + foreach($urllist[0] as $key => $val) { + $val = trim($val); + $return[0][$key] = $val; + if(!preg_match('/^https?:\/\//is', $val)) $val = 'http://'.$val; + $tmp = parse_url($val); + $return[1][$key] = $tmp['host']; + if($tmp['port']){ + $return[1][$key] .= ":{$tmp['port']}"; + } + } + } + return $return; + } + + public static function updatemoderate($idtype, $ids, $status = 0) { + $ids = is_array($ids) ? $ids : array($ids); + if(!$ids) { + return; + } + if(!$status) { + foreach($ids as $id) { + C::t('common_moderate')->insert_moderate($idtype, array( + 'id' => $id, + 'status' => 0, + 'dateline' => TIMESTAMP, + ), false, true); + } + } elseif($status == 1) { + C::t('common_moderate')->update_moderate($ids, $idtype, array('status' => 1)); + } elseif($status == 2) { + C::t('common_moderate')->delete_moderate($ids, $idtype); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_invite.php b/source/class/helper/helper_invite.php new file mode 100644 index 0000000..31730ac --- /dev/null +++ b/source/class/helper/helper_invite.php @@ -0,0 +1,21 @@ +fetch($uid); + return substr(md5(md5($user['password']).'|'.$uid), 8, 16); + } + +} \ No newline at end of file diff --git a/source/class/helper/helper_json.php b/source/class/helper/helper_json.php new file mode 100644 index 0000000..89c6100 --- /dev/null +++ b/source/class/helper/helper_json.php @@ -0,0 +1,53 @@ + $value) { + if($count !== NULL && (gettype($key) !== 'integer' || $count++ !== $key)) { + $count = NULL; + } + $one = self::encode($value); + $indexed[] = $one; + $associative[] = self::encode($key) . ':' . $one; + } + if ($count !== NULL) { + return '[' . implode(',', $indexed) . ']'; + } else { + return '{' . implode(',', $associative) . '}'; + } + default: + return ''; // Not supported + } + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_log.php b/source/class/helper/helper_log.php new file mode 100644 index 0000000..5e2cc45 --- /dev/null +++ b/source/class/helper/helper_log.php @@ -0,0 +1,87 @@ + 2048000) { + $dir = opendir($logdir); + $length = strlen($file); + $maxid = $id = 0; + while($entry = readdir($dir)) { + if(strpos($entry, $yearmonth.'_'.$file) !== false) { + $id = intval(substr($entry, $length + 8, -4)); + $id > $maxid && $maxid = $id; + } + } + closedir($dir); + + $logfilebak = $logdir.$yearmonth.'_'.$file.'_'.($maxid + 1).'.php'; + @rename($logfile, $logfilebak); + } + $fp = fopen($logfile, 'a'); + if($fp) { + if(!is_array($log)) { + $log = array($log); + } + foreach($log as $tmp) { + fwrite($fp, "\t".str_replace(array(''), '', $tmp)."\n"); + } + fflush($fp); + fclose($fp); + } else { + fclose($fp); + } + } + + + public static function useractionlog($uid, $action) { + $uid = intval($uid); + if(empty($uid) || empty($action)) { + return false; + } + $action = getuseraction($action); + C::t('common_member_action_log')->insert(array('uid' => $uid, 'action' => $action, 'dateline' => TIMESTAMP)); + return true; + } + + public static function getuseraction($var) { + $value = false; + $ops = array('tid', 'pid', 'blogid', 'picid', 'doid', 'sid', 'aid', 'uid_cid', 'blogid_cid', 'sid_cid', 'picid_cid', 'aid_cid', 'topicid_cid', 'pmid'); + if(is_numeric($var)) { + $value = isset($ops[$var]) ? $ops[$var] : false; + } else { + $value = array_search($var, $ops); + } + return $value; + } + +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_makehtml.php b/source/class/helper/helper_makehtml.php new file mode 100644 index 0000000..eca1b93 --- /dev/null +++ b/source/class/helper/helper_makehtml.php @@ -0,0 +1,163 @@ +'; + $code = ob_get_clean().$cend; + $code = preg_replace('/language\s*=[\s|\'|\"]*php/is', '_', $code); + $code = str_replace(array(''), array('<?', '?>'), $code); + if(file_put_contents($filepath, $code) !== false) { + $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start(); + if(self::$callback && is_callable(self::$callback)) { + call_user_func(self::$callback); + self::$callback = self::$callbackdata = null; + } + self::$returndata['status'] = 'html_ok'; + if(isset(self::$viewurl)) { + self::$returndata['path'] = self::$viewurl; + } else { + self::$returndata['path'] = self::$htmlfilename.'.'.$_G['setting']['makehtml']['extendname']; + } + showmessage('do_success', null, self::$returndata); + } + } + } + + public static function portal_index() { + global $_G; + if(!empty($_G['setting']['makehtml']['flag'])) { + $_G['dynamicurl'] = 'portal.php'; + self::$htmlfilename = $_G['setting']['makehtml']['indexname'] ? $_G['setting']['makehtml']['indexname'] : 'index'; + } + } + + public static function portal_list($cat) { + global $_G; + if(!empty($_G['setting']['makehtml']['flag']) && $cat['fullfoldername']) { + $_G['dynamicurl'] = 'portal.php?mod=list&catid='.$cat['catid']; + self::$htmlfilename = $cat['fullfoldername'].'/index'; + } else if(!empty($_G['setting']['makehtml']['flag']) && !$cat['fullfoldername']) { + showmessage('portal_category_has_no_folder_name'); + } + } + public static function portal_article($cat, $article, $page) { + global $_G; + if(!empty($_G['setting']['makehtml']['flag']) && $cat['fullfoldername']) { + $_G['dynamicurl'] = 'portal.php?mod=view&aid='.$article['aid']; + self::$callbackdata['data'] = array(); + if(!$article['htmlmade']) { + self::$callbackdata['data']['htmlmade'] = 1; + } + if(!$article['htmlname']) { + self::$callbackdata['data']['htmlname'] = $article['htmlname'] = str_pad($article['aid'], 8, '0', STR_PAD_LEFT); + } + + $htmldir = self::fetch_dir($cat['fullfoldername'], $article['timestamp']); + if($article['htmldir'] != $htmldir) { + self::$callbackdata['data']['htmldir'] = $htmldir; + } + if($article['contents'] > 1 && $page > 1) { + $article['htmlname'] = $article['htmlname'].$page; + } + if($article['contents'] > $page) { + self::$returndata['nexturl'] = "portal.php?mod=view&aid={$article['aid']}&page=".(++$page);//'url' + self::$returndata['current'] = $page;//'cur' + self::$returndata['count'] = $article['contents'];//'count' + } + + if(!empty($cat['topid'])) { + $caturl = $_G['cache']['portalcategory'][$cat['topid']]['domain'] ? $_G['cache']['portalcategory'][$cat['topid']]['caturl'] : ''; + self::$viewurl = $caturl.$article['htmldir'].$article['htmlname'].'.'.$_G['setting']['makehtml']['extendname']; + } + + self::$htmlfilename = $htmldir.$article['htmlname']; + if(self::$callbackdata['data']) { + self::$callback = array(get_class(), 'portal_article_success'); + self::$callbackdata['id'] = $article['aid']; + } + if($article['allowcomment']) { + $_G['htmlcheckupdate'] = '1'; + } + } else if(!empty($_G['setting']['makehtml']['flag']) && !$cat['fullfoldername']) { + showmessage('portal_category_has_no_folder_name'); + } + } + + public static function fetch_dir($folder, $time) { + global $_G; + $formatarr = array('/Ym/', '/Ym/d/', '/Y/m/', '/Y/m/d/'); + $htmldirformat = isset($formatarr[$_G['setting']['makehtml']['htmldirformat']]) ? $formatarr[$_G['setting']['makehtml']['htmldirformat']] : $formatarr[0]; + $htmldir = $folder.dgmdate($time, $htmldirformat); + if(!empty($_G['setting']['makehtml']['articlehtmldir'])) { + $htmldir = $_G['setting']['makehtml']['articlehtmldir'].'/'.$htmldir; + } + return $htmldir; + } + + public static function portal_article_success(){ + if(!empty(self::$callbackdata['data'])) { + C::t('portal_article_title')->update(self::$callbackdata['id'], self::$callbackdata['data']); + } + + } + + public static function portal_topic($topic) { + global $_G; + if(!empty($_G['setting']['makehtml']['flag']) && !empty($_G['setting']['makehtml']['topichtmldir']) && $topic['name']) { + $_G['dynamicurl'] = 'portal.php?mod=topic&topicid='.$topic['topicid']; + self::$callbackdata['data'] = array(); + if(!$topic['htmlmade']) { + self::$callbackdata['data']['htmlmade'] = 1; + } + + if($topic['htmldir'] != $_G['setting']['makehtml']['topichtmldir']) { + self::$callbackdata['data']['htmldir'] = $_G['setting']['makehtml']['topichtmldir']; + } + self::$htmlfilename = $_G['setting']['makehtml']['topichtmldir'].'/'.$topic['name']; + if(self::$callbackdata['data']) { + self::$callback = array(get_class(), 'portal_topic_success'); + self::$callbackdata['id'] = $topic['topicid']; + } + if($topic['allowcomment']) { + $_G['htmlcheckupdate'] = '1'; + } + } + } + + + public static function portal_topic_success(){ + if(!empty(self::$callbackdata['data'])) { + C::t('portal_topic')->update(self::$callbackdata['id'], self::$callbackdata['data']); + } + + } + +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_mobile.php b/source/class/helper/helper_mobile.php new file mode 100644 index 0000000..de28a14 --- /dev/null +++ b/source/class/helper/helper_mobile.php @@ -0,0 +1,102 @@ + constant('TPL_DEFAULT_FILE'))); + } else { + showmessage('not_in_mobile'); + } + exit; + } + } + + public static function mobileoutput_callback_mobilereplace_12($matches) { + return self::mobilereplace($matches[1], $matches[2]); + } + + public static function mobilereplace($file, $replace) { + if(strpos($replace, 'mobile=') === false) { + if(strpos($replace, '?') === false) { + $replace = 'href="'.$file.$replace.'?mobile='.IN_MOBILE.'"'; + } else { + $replace = 'href="'.$file.$replace.'&mobile='.IN_MOBILE.'"'; + } + return $replace; + } else { + return 'href="'.$file.$replace.'"'; + } + } + + private static function mobilereplace_rewrite($content) { + global $_G; + + if(defined('IN_MODCP') || defined('IN_ADMINCP') || !defined('IN_MOBILE') || constant('IN_MOBILE') !== '2') { + return $content; + } + if(!empty($_G['setting']['output']['str']['search'])) { + if(empty($_G['setting']['domain']['app']['default'])) { + $_G['setting']['output']['str']['replace'] = str_replace('{CURHOST}', $_G['siteurl'], $_G['setting']['output']['str']['replace']); + } + $content = str_replace($_G['setting']['output']['str']['search'], $_G['setting']['output']['str']['replace'], $content); + } + if(!empty($_G['setting']['output']['preg']['search']) && (empty($_G['setting']['rewriteguest']) || empty($_G['uid'])) && !empty($_G['setting']['rewritemobile'])) { + if(empty($_G['setting']['domain']['app']['default'])) { + $_G['setting']['output']['preg']['search'] = str_replace('\{CURHOST\}', preg_quote($_G['siteurl'], '/'), $_G['setting']['output']['preg']['search']); + $_G['setting']['output']['preg']['replace'] = str_replace('{CURHOST}', $_G['siteurl'], $_G['setting']['output']['preg']['replace']); + } + + foreach($_G['setting']['output']['preg']['search'] as $key => $value) { + $content = preg_replace_callback( + $value, + function ($matches) use ($_G, $key) { + return eval('return ' . $_G['setting']['output']['preg']['replace'][$key] . ';'); + }, + $content + ); + } + } + + return $content; + } + +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_notification.php b/source/class/helper/helper_notification.php new file mode 100644 index 0000000..6206fd1 --- /dev/null +++ b/source/class/helper/helper_notification.php @@ -0,0 +1,203 @@ + $val) { + if(in_array($type, $val)) { + switch ($key) { + case 'mypost' : $category = 1; break; + case 'interactive' : $category = 2; break; + case 'system' : $category = 3; break; + case 'manage' : $category = 4; break; + default : $category = 0; + } + $categoryname = $key; + break; + } + } + } + } else { + switch ($category) { + case 1 : $categoryname = 'mypost'; break; + case 2 : $categoryname = 'interactive'; break; + case 3 : $categoryname = 'system'; break; + case 4 : $categoryname = 'manage'; break; + case 5 : $categoryname = 'follow'; break; + case 6 : $categoryname = 'follower'; break; + default : $categoryname = 'app'; + } + } + if($category == 0) { + $categoryname = 'app'; + } elseif($category == 1 || $category == 2) { + $categoryname = $type; + } + $notevars['actor'] = "".$_G['member']['username'].""; + + $vars = explode(':', $note); + if(count($vars) == 2) { + $notestring = lang('plugin/'.$vars[0], $vars[1], $notevars); + } else { + $notestring = lang('notification', $note, $notevars); + } + + $oldnote = array(); + if($notevars['from_id'] && $notevars['from_idtype']) { + $oldnote = C::t('home_notification')->fetch_by_fromid_uid($notevars['from_id'], $notevars['from_idtype'], $touid); + } + if(empty($oldnote['from_num'])) $oldnote['from_num'] = 0; + $notevars['from_num'] = $notevars['from_num'] ? $notevars['from_num'] : 1; + $setarr = array( + 'uid' => $touid, + 'type' => $type, + 'new' => 1, + 'authorid' => $_G['uid'], + 'author' => $_G['username'], + 'note' => $notestring, + 'dateline' => $_G['timestamp'], + 'from_id' => $notevars['from_id'], + 'from_idtype' => $notevars['from_idtype'], + 'from_num' => ($oldnote['from_num']+$notevars['from_num']), + 'category' => $category + ); + if($system) { + $setarr['authorid'] = 0; + $setarr['author'] = ''; + } + $pkId = 0; + if($oldnote['id']) { + C::t('home_notification')->update($oldnote['id'], $setarr); + $pkId = $oldnote['id']; + } else { + $oldnote['new'] = 0; + $pkId = C::t('home_notification')->insert($setarr, true); + } + $banType = array('task'); + + if(empty($oldnote['new'])) { + C::t('common_member')->increase($touid, array('newprompt' => 1)); + $newprompt = C::t('common_member_newprompt')->fetch($touid); + if($newprompt) { + $newprompt['data'] = dunserialize($newprompt['data']); + if(!empty($newprompt['data'][$categoryname])) { + $newprompt['data'][$categoryname] = intval($newprompt['data'][$categoryname]) + 1; + } else { + $newprompt['data'][$categoryname] = 1; + } + C::t('common_member_newprompt')->update($touid, array('data' => serialize($newprompt['data']))); + } else { + C::t('common_member_newprompt')->insert_newprompt($touid, array($categoryname => 1)); + } + require_once libfile('function/mail'); + $mail_subject = lang('notification', 'mail_to_user'); + sendmail_touser($touid, $mail_subject, $notestring, $type); + } + + if(!$system && $_G['uid'] && $touid != $_G['uid']) { + C::t('home_friend')->update_num_by_uid_fuid(1, $_G['uid'], $touid); + } + } + + public static function manage_addnotify($type, $from_num = 0, $langvar = array()) { + global $_G; + $notifyusers = dunserialize($_G['setting']['notifyusers']); + $notifytypes = explode(',', $_G['setting']['adminnotifytypes']); + $notifytypes = array_flip($notifytypes); + $notearr = array('from_id' => 1,'from_idtype' => $type, 'from_num' => $from_num); + if($langvar) { + $langkey = $langvar['langkey']; + $notearr = array_merge($notearr, $langvar); + } else { + $langkey = 'manage_'.$type; + } + foreach($notifyusers as $uid => $user) { + if($user['types'][$notifytypes[$type]]) { + helper_notification::notification_add($uid, $type, $langkey, $notearr, 1, 4); + } + } + } + + public static function get_categorynum($newprompt_data) { + global $_G; + $categorynum = array(); + if(empty($newprompt_data) || !is_array($newprompt_data)) { + return array(); + } + foreach($newprompt_data as $key => $val) { + if(in_array($key, array('follow', 'follower'))) { + continue; + } + if(in_array($key, $_G['notice_structure']['mypost'])) { + $categorynum['mypost'] += $val; + } elseif(in_array($key, $_G['notice_structure']['interactive'])) { + $categorynum['interactive'] += $val; + }else{ + $categorynum[$key] = $val; + } + } + return $categorynum; + } + + public static function update_newprompt($uid, $type) { + global $_G; + if($_G['member']['newprompt_num']) { + $tmpprompt = $_G['member']['newprompt_num']; + $num = 0; + $updateprompt = 0; + if(!$type) { + $tmpprompt = []; + } elseif(!empty($tmpprompt[$type])) { + unset($tmpprompt[$type]); + $updateprompt = true; + } + foreach($tmpprompt as $key => $val) { + $num += $val; + } + if($num) { + if($updateprompt) { + C::t('common_member_newprompt')->update($uid, array('data' => serialize($tmpprompt))); + C::t('common_member')->update($uid, array('newprompt'=>$num)); + } + } else { + C::t('common_member_newprompt')->delete($_G['uid']); + C::t('common_member')->update($_G['uid'], array('newprompt'=>0)); + } + } + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_output.php b/source/class/helper/helper_output.php new file mode 100644 index 0000000..1de27eb --- /dev/null +++ b/source/class/helper/helper_output.php @@ -0,0 +1,45 @@ +'."\r\n", ''; + exit(); + } + + public static function json($data) { + self::_header('application/json'); + echo helper_json::encode($data); + exit(); + } + + public static function html($s) { + self::_header('text/html'); + echo $s; + exit(); + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_page.php b/source/class/helper/helper_page.php new file mode 100644 index 0000000..f86fce7 --- /dev/null +++ b/source/class/helper/helper_page.php @@ -0,0 +1,168 @@ + 0 ? $page : 4 ; + } else { + $dot = '...'; + } + $multipage = ''; + if($jsfunc === FALSE) { + $mpurl .= strpos($mpurl, '?') !== FALSE ? '&' : '?'; + } + + $realpages = 1; + $_G['page_next'] = 0; + $page -= strlen($curpage) - 1; + if($page <= 0) { + $page = 1; + } + if($num > $perpage) { + + $offset = floor($page * 0.5); + + $realpages = @ceil($num / $perpage); + $curpage = $curpage > $realpages ? $realpages : $curpage; + $pages = $maxpages && $maxpages < $realpages ? $maxpages : $realpages; + + if($page > $pages) { + $from = 1; + $to = $pages; + } else { + $from = $curpage - $offset; + $to = $from + $page - 1; + if($from < 1) { + $to = $curpage + 1 - $from; + $from = 1; + if($to - $from < $page) { + $to = $page; + } + } elseif($to > $pages) { + $from = $pages - $page + 1; + $to = $pages; + } + } + $_G['page_next'] = $to; + $multipage = ($curpage - $offset > 1 && $pages > $page ? '1 '.$dot.'' : ''). + ($curpage > 1 && !$simple ? '' : ''); + for($i = $from; $i <= $to; $i++) { + $multipage .= $i == $curpage ? ''.$i.'' : + ''.$i.''; + } + + $wml = defined('IN_MOBILE') && IN_MOBILE == 3; + $jsurl = ''; + if(($showpagejump || $showkbd) && !$simple && !$ajaxtarget && !$wml) { + $jsurl = $mpurl.(strpos($mpurl, '{page}') !== false ? '\'.replace(\'{page}\', this.value == 1 ? \'\' : this.value)': $pagevar.'\'+this.value;').'; doane(event);'; + } + + $multipage .= ($to < $pages ? ''.$dot.' '.$pages.'' : ''). + ($showpagejump && !$simple && !$ajaxtarget && !$wml ? '' : ''). + ($curpage < $pages && !$simple ? ''.$lang['next'].'' : ''). + ($showkbd && !$simple && $pages > $page && !$ajaxtarget && !$wml ? '' : ''); + + if(defined('IN_MOBILE') && !defined('TPL_DEFAULT') && $multipage) { + $multipage_url = ''; + parse_str(preg_replace('#^\w+\.php\?#i', '', str_replace('&', '&', $mpurl)), $query); + if(!empty($query['mod']) && $query['mod'] == 'viewthread' && !empty($query['tid']) && $query['tid'] == $_G['tid']) { + $multipage_url = rewriteoutput('forum_viewthread', 1, $_G['siteurl'], $_G['tid'], '{page}', '', ''); + } elseif(!empty($query['mod']) && $query['mod'] == 'forumdisplay' && !empty($query['fid']) && $query['fid'] == $_G['fid']) { + $multipage_url = rewriteoutput('forum_forumdisplay', 1, $_G['siteurl'], $_G['fid'], '{page}', '', ''); + } else { + $multipage_url = self::mpurl($mpurl, $pagevar, '{page}'); + $multipage_url = (stripos($multipage_url, $_G['siteurl']) === false && !preg_match('/^https?:\/\//is', $multipage_url) ? $_G['siteurl'] : '').$multipage_url; + } + if(!empty($multipage_url)) { + $multipage .= ''; + } + } + $multipage = $multipage ? '
    '.($shownum && !$simple ? ' '.$num.' ' : '').$multipage.'
    ' : ''; + } + $maxpage = $realpages; + return $multipage; + } + + public static function mpurl($mpurl, $pagevar, $page) { + if(strpos($mpurl, '{page}') !== false) { + return trim(str_replace('{page}', ($page == 1 ? '' : $page), $mpurl), '?'); + } else { + $separator = ''; + if($pagevar[0] !== '&' && $pagevar[0] !== '?') { + if(strpos($mpurl, '?') !== FALSE) { + $separator = ''; + } else { + $separator = '?'; + } + } + return $mpurl.$separator.$pagevar.$page; + } + } + + public static function simplepage($num, $perpage, $curpage, $mpurl) { + $return = ''; + $lang['next'] = lang('core', 'nextpage'); + $lang['prev'] = lang('core', 'prevpage'); + $next = $num == $perpage ? ''.$lang['next'].'' : ''; + $prev = $curpage > 1 ? ''.$lang['prev'].'' : ''; + if($next || $prev) { + $return = '
    '.$prev.$next.'
    '; + } + return $return; + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_pm.php b/source/class/helper/helper_pm.php new file mode 100644 index 0000000..715175b --- /dev/null +++ b/source/class/helper/helper_pm.php @@ -0,0 +1,48 @@ +count_day_hours(getuseraction('pmid'), $fromid); + if($sendpmmaxnum && $currentnum >= $sendpmmaxnum) { + return -16; + } + } + + loaducenter(); + $return = uc_pm_send($fromid, $toid, addslashes($subject), addslashes($message), 1, $replypmid, $isusername, $type); + if($return > 0 && $fromid) { + foreach(explode(',', $fromid) as $v) { + useractionlog($v, 'pmid'); + } + } + + return $return; + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_seccheck.php b/source/class/helper/helper_seccheck.php new file mode 100644 index 0000000..2daad9d --- /dev/null +++ b/source/class/helper/helper_seccheck.php @@ -0,0 +1,352 @@ +fetch($ssid); + if(!$seccheck) { + return false; + } + if(TIMESTAMP - $seccheck['dateline'] > 600 || $seccheck['verified'] > 4) { + C::t('common_seccheck')->delete_expiration($ssid); + return false; + } + return $seccheck; + } + + private static function _create($type, $code = '') { + global $_G; + $secappend = ''; + if(!defined('IN_MOBILE')) { + if(isset($_GET['idhash']) && $_GET['idhash']) { + $secappend = $_GET['idhash']; + } elseif($type == 'code') { + if(isset($_GET['seccodehash']) && $_GET['seccodehash']) { + $secappend = $_GET['seccodehash']; + } + } elseif($type == 'qaa') { + if(isset($_GET['secqaahash']) && $_GET['secqaahash']) { + $secappend = $_GET['secqaahash']; + } + } + } + $ssid = C::t('common_seccheck')->insert(array( + 'dateline' => TIMESTAMP, + 'code' => $code, + 'succeed' => 0, + 'verified' => 0, + ), true); + dsetcookie('sec'.$type.$secappend, $ssid.'.'.substr(md5($ssid.$_G['uid'].$_G['authkey']), 8, 18)); + } + + public static function make_seccode($seccode = ''){ + global $_G; + if(!$seccode) { + $seccode = random(6, 1); + $seccodeunits = ''; + if($_G['setting']['seccodedata']['type'] == 1) { + $lang = lang('seccode'); + $len = strtoupper(CHARSET) == 'GBK' ? 2 : 3; + $code = array(substr($seccode, 0, 3), substr($seccode, 3, 3)); + $seccode = ''; + for($i = 0; $i < 2; $i++) { + $seccode .= substr($lang['chn'], $code[$i] * $len, $len); + } + } elseif($_G['setting']['seccodedata']['type'] == 3) { + $s = sprintf('%04s', base_convert($seccode, 10, 20)); + $seccodeunits = 'CEFHKLMNOPQRSTUVWXYZ'; + } else { + $s = sprintf('%04s', base_convert($seccode, 10, 24)); + $seccodeunits = 'BCEFGHJKMPQRTVWXY2346789'; + } + if($seccodeunits) { + $seccode = ''; + for($i = 0; $i < 4; $i++) { + $unit = ord($s[$i]); + $seccode .= ($unit >= 0x30 && $unit <= 0x39) ? $seccodeunits[$unit - 0x30] : $seccodeunits[$unit - 0x57]; + } + } + } + self::_create('code', $seccode); + return $seccode; + } + + public static function make_secqaa() { + global $_G; + loadcache('secqaa'); + $secqaakey = max(1, random(1, 1)); + if($_G['cache']['secqaa'][$secqaakey]['type']) { + $etype = explode(':', $_G['cache']['secqaa'][$secqaakey]['question']); + if(count($etype) > 1) { + if(!preg_match('/^\w+$/', $etype[0]) || !preg_match('/^\w+$/', $etype[1])) { + return; + } + $qaafile = DISCUZ_ROOT.'./source/plugin/'.$etype[0].'/secqaa/secqaa_'.$etype[1].'.php'; + $class = $etype[1]; + } else { + if(!preg_match('/^\w+$/', $_G['cache']['secqaa'][$secqaakey]['question'])) { + return; + } + $qaafile = libfile('secqaa/'.$_G['cache']['secqaa'][$secqaakey]['question'], 'class'); + $class = $_G['cache']['secqaa'][$secqaakey]['question']; + } + if(file_exists($qaafile)) { + @include_once $qaafile; + $class = 'secqaa_'.$class; + if(class_exists($class)) { + $qaa = new $class(); + if(method_exists($qaa, 'make')) { + $_G['cache']['secqaa'][$secqaakey]['answer'] = md5($qaa->make($_G['cache']['secqaa'][$secqaakey]['question'])); + } + } + } + } + self::_create('qaa', substr($_G['cache']['secqaa'][$secqaakey]['answer'], 0, 6)); + return $_G['cache']['secqaa'][$secqaakey]['question']; + } + + public static function check_seccode($value, $idhash, $fromjs = 0, $modid = '', $verifyonly = false) { + global $_G; + if(!$_G['setting']['seccodestatus']) { + return true; + } + $seccheck = self::_check('code'); + if(!$seccheck) { + return false; + } + $ssid = $seccheck['ssid']; + if(!is_numeric($_G['setting']['seccodedata']['type'])) { + $etype = explode(':', $_G['setting']['seccodedata']['type']); + if(count($etype) > 1) { + if(!preg_match('/^\w+$/', $etype[0]) || !preg_match('/^\w+$/', $etype[1])) { + return false; + } + $codefile = DISCUZ_ROOT.'./source/plugin/'.$etype[0].'/seccode/seccode_'.$etype[1].'.php'; + $class = $etype[1]; + } else { + if(!preg_match('/^\w+$/', $_G['setting']['seccodedata']['type'])) { + return false; + } + $codefile = libfile('seccode/'.$_G['setting']['seccodedata']['type'], 'class'); + $class = $_G['setting']['seccodedata']['type']; + } + if(file_exists($codefile)) { + @include_once $codefile; + $class = 'seccode_'.$class; + if(class_exists($class)) { + $code = new $class(); + if(method_exists($code, 'check')) { + $return = $code->check($value, $idhash, $seccheck, $fromjs, $modid, $verifyonly); + } + } + } else { + $return = false; + } + } else { + $return = $seccheck['code'] == strtoupper($value); + } + if($return) { + C::t('common_seccheck')->update_succeed($ssid); + } else { + C::t('common_seccheck')->update_verified($ssid); + } + if(!$verifyonly) { + C::t('common_seccheck')->delete($ssid); + } + return $return; + } + + public static function check_secqaa($value, $idhash, $verifyonly = false) { + global $_G; + if(!$_G['setting']['secqaa']) { + return true; + } + $seccheck = self::_check('qaa'); + if(!$seccheck) { + return false; + } + $ssid = $seccheck['ssid']; + $return = $seccheck['code'] == substr(md5($value), 0, 6); + if($return) { + C::t('common_seccheck')->update_succeed($ssid); + } else { + C::t('common_seccheck')->update_verified($ssid); + } + if(!$verifyonly) { + C::t('common_seccheck')->delete($ssid); + } + return $return; + } + + public static function rule_register() { + global $_G; + $seccheckrule = & $_G['setting']['seccodedata']['rule']['register']; + if($seccheckrule['allow'] == 1) { + $seccode = true; + } elseif($seccheckrule['allow'] == 2) { + if($seccheckrule['numlimit'] > 0) { + loadcache('seccodedata', true); + if($_G['cache']['seccodedata']['register']['show']) { + $seccode = true; + } else { + $regnumber = C::t('common_member')->count_by_regdate(TIMESTAMP - $seccheckrule['timelimit']); + if($regnumber >= $seccheckrule['numlimit']) { + $seccode = true; + $_G['cache']['seccodedata']['register']['show'] = 1; + savecache('seccodedata', $_G['cache']['seccodedata']); + } + } + } + } else { + $seccode = false; + } + return array( + $seccode, + $_G['setting']['secqaa']['status'] & 1 + ); + } + + public static function rule_login() { + global $_G; + $seccheckrule = & $_G['setting']['seccodedata']['rule']['login']; + if($seccheckrule['allow'] == 1) { + $seccode = true; + } elseif($seccheckrule['allow'] == 2) { + $seccode = false; + } else { + $seccode = false; + } + return array($seccode, $_G['setting']['secqaa']['status'] & 8); + } + + public static function rule_post($action) { + global $_G; + $seccheckrule = & $_G['setting']['seccodedata']['rule']['post']; + if($seccheckrule['allow'] == 1) { + $seccode = !$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']; + } elseif($seccheckrule['allow'] == 2) { + if(C::t('common_member_secwhite')->check($_G['uid'])) { + $seccode = false; + } else { + $seccode = getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']; + if(!$seccode && $seccheckrule['numlimit']) { + $count = C::t('forum_post')->count_by_search('pid:0', null, null, null, null, $_G['uid'], null, TIMESTAMP - $seccheckrule['timelimit']); + $seccode = $seccheckrule['numlimit'] <= $count; + } + if($action == 'newthread' && !$seccode && !empty($_POST) && $seccheckrule['nplimit']) { + if(!$_G['cookie']['st_t']) { + $seccode = true; + } else { + list($uid, $t, $hash) = explode('|', $_G['cookie']['st_t']); + list($t, $m) = explode(',', $t); + if(md5($uid.'|'.$t.$_G['config']['security']['authkey']) == $hash && !$m) { + if(TIMESTAMP - $t <= $seccheckrule['nplimit']) { + $seccode = true; + } else { + $seccode = false; + } + } else { + $seccode = true; + } + } + } + if($action == 'reply' && !$seccode && !empty($_POST) && $seccheckrule['vplimit']) { + if(!$_G['cookie']['st_p']) { + $seccode = true; + } else { + list($uid, $t, $hash) = explode('|', $_G['cookie']['st_p']); + list($t, $m) = explode(',', $t); + if(md5($uid.'|'.$t.$_G['config']['security']['authkey']) == $hash && !$m) { + if(TIMESTAMP - $t <= $seccheckrule['vplimit']) { + $seccode = true; + } else { + $seccode = false; + } + } else { + $seccode = true; + } + } + } + } + } else { + $seccode = false; + } + return array( + $seccode, + $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']) + ); + } + + public static function rule_publish($rule) { + global $_G; + $seccheckrule = & $_G['setting']['seccodedata']['rule']['post']; + return array( + $seccheckrule['allow'] && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']), + $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']) + ); + } + + public static function rule_password($rule) { + global $_G; + $seccheckrule = & $_G['setting']['seccodedata']['rule']['password']; + return array( + $seccheckrule['allow'] && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']), + $_G['setting']['secqaa']['status'] & 4 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']) + ); + } + + public static function rule_card() { + global $_G; + $seccheckrule = & $_G['setting']['seccodedata']['rule']['card']; + return array($seccheckrule['allow'], $_G['setting']['secqaa']['status'] & 16); + } + + public static function seccheck($rule, $param = array()) { + global $_G; + if($_G['uid'] && !checkperm('seccode')) { + return array(); + } + if(method_exists('helper_seccheck', 'rule_'.$rule)) { + $return = call_user_func(array('helper_seccheck', 'rule_'.$rule), $param); + return $return; + } else { + return array(); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_seo.php b/source/class/helper/helper_seo.php new file mode 100644 index 0000000..2f0c292 --- /dev/null +++ b/source/class/helper/helper_seo.php @@ -0,0 +1,122 @@ + 1 ? lang('core', 'page', array('page' => $data['page'])) : ''; + } + $replaces[] = $data[$var] ? strip_tags($data[$var]) : ''; + } + if($titletext) { + $seotitle = helper_seo::strreplace_strip_split($searchs, $replaces, $titletext); + } + if($descriptiontext) { + $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext); + } + if($keywordstext) { + $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext); + } + } + return array($seotitle, $seodescription, $seokeywords); + } + + + public static function strreplace_strip_split($searchs, $replaces, $str) { + $searchspace = array('(((\s)*\-(\s)*)+)', '(((\s)*\,(\s)*)+)', '(((\s)*\|(\s)*)+)', '(((\s)*\t(\s)*)+)', '(((\s)*_(\s)*)+)'); + $replacespace = array('$3-$3', '$3,$3', '$3|$3', '$3 $3', '$3_$3'); + return trim(preg_replace($searchspace, $replacespace, str_replace($searchs, $replaces, $str)), ' ,-|_'); + } + + public static function get_title_page($navtitle, $page){ + if($page > 1) { + $navtitle .= ' - '.lang('core', 'page', array('page' => $page)); + } + return $navtitle; + } + + public static function get_related_link($extent) { + global $_G; + loadcache('relatedlink'); + $allextent = array('article' => 0, 'forum' => 1, 'group' => 2, 'blog' => 3); + $links = array(); + if($_G['cache']['relatedlink'] && isset($allextent[$extent])) { + foreach($_G['cache']['relatedlink'] as $link) { + $link['extent'] = sprintf('%04b', $link['extent']); + if($link['extent'][$allextent[$extent]] && $link['name'] && $link['url']) { + $links[] = daddslashes($link); + } + } + } + rsort($links); + return $links; + } + + public static function parse_related_link($content, $extent) { + global $_G; + loadcache('relatedlink'); + $allextent = array('article' => 0, 'forum' => 1, 'group' => 2, 'blog' => 3); + if($_G['cache']['relatedlink'] && isset($allextent[$extent])) { + $searcharray = $replacearray = $sortarray = $_G['trunsform_tmp'] = array(); + foreach($_G['cache']['relatedlink'] as $link) { + $link['extent'] = sprintf('%04b', $link['extent']); + if($link['extent'][$allextent[$extent]] && $link['name'] && $link['url']) { + $sortarray[$link['name']] = strlen($link['name']); + $searcharray[$link['name']] = '/('.preg_quote($link['name']).')/i'; + $replacearray[$link['name']] = self::base64_transform('encode', '', "{$link['name']}", ''); + } + } + if($searcharray && $replacearray) { + array_multisort($sortarray,SORT_DESC,$searcharray,SORT_DESC,$replacearray); + $content = preg_replace_callback("/(.*?<\/script>)|(.*?<\/a>)|()|(\[attach\](\d+)\[\/attach\])/is", array(__CLASS__, 'parse_related_link_callback_base64_transform_1234'), $content); + $content = preg_replace($searcharray, $replacearray, $content, 1); + $content = preg_replace_callback("/(.*?)<\/relatedlink>/is", array(__CLASS__, 'parse_related_link_callback_base64_transform_1'), $content); + } + } + return $content; + } + + static public function parse_related_link_callback_base64_transform_1234($matches) { + return self::base64_transform('encode', '', $matches[1].$matches[2].$matches[3].$matches[4], ''); + } + + static function parse_related_link_callback_base64_transform_1($matches) { + return self::base64_transform('decode', '', $matches[1], ''); + } + + public static function base64_transform($type, $prefix, $string, $suffix) { + global $_G; + if($type == 'encode') { + $_G['trunsform_tmp'][] = base64_encode(str_replace("\\\"", "\"", $string)); + return $prefix.(count($_G['trunsform_tmp']) - 1).$suffix; + } elseif($type == 'decode') { + return $prefix.base64_decode($_G['trunsform_tmp'][$string]).$suffix; + } + } +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_sysmessage.php b/source/class/helper/helper_sysmessage.php new file mode 100644 index 0000000..5dbd093 --- /dev/null +++ b/source/class/helper/helper_sysmessage.php @@ -0,0 +1,66 @@ + + + + + + +$title + + + + + + + + + + + + + +
    + + + + +
    + $title +

    $message

    +

    +
    +
    + + +EOT; + die(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/helper/helper_util.php b/source/class/helper/helper_util.php new file mode 100644 index 0000000..cba3213 --- /dev/null +++ b/source/class/helper/helper_util.php @@ -0,0 +1,124 @@ +': + return $v1 > $v2; + break; + case '<': + return $v1 < $v2; + break; + case '<>': + return $v1 <> $v2; + break; + case '!=': + return $v1 != $v2; + break; + case '<=': + return $v1 <= $v2; + break; + case '>=': + return $v1 >= $v2; + break; + case '*': + return $v1 * $v2; + break; + case '/': + return $v1 / $v2; + break; + case '%': + return $v1 % $v2; + break; + case 'or': + return $v1 or $v2; + break; + case '<<': + return $v1 << $v2; + break; + case '>>': + return $v1 >> $v2; + break; + default: + return null; + } + } + + public static function single_compute($v, $glue = '+') { + switch ($glue) { + case '!': + return ! $v; + break; + case '-': + return - $v; + break; + case '~': + return ~ $v; + break; + default: + return null; + break; + } + } + public static function check_glue($glue = '=') { + return in_array($glue, array('=', '<', '<=', '>', '>=', '!=', '+', '-', '|', '&', '<>')) ? $glue : '='; + } + +} + +?> \ No newline at end of file diff --git a/source/class/helper/index.htm b/source/class/helper/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/index.htm b/source/class/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/class/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/class/ip/index.htm b/source/class/ip/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/ip/ip_getter_dnslist.php b/source/class/ip/ip_getter_dnslist.php new file mode 100644 index 0000000..58d5fed --- /dev/null +++ b/source/class/ip/ip_getter_dnslist.php @@ -0,0 +1,39 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/source/class/ip/ip_getter_header.php b/source/class/ip/ip_getter_header.php new file mode 100644 index 0000000..5372405 --- /dev/null +++ b/source/class/ip/ip_getter_header.php @@ -0,0 +1,34 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/source/class/ip/ip_getter_iplist.php b/source/class/ip/ip_getter_iplist.php new file mode 100644 index 0000000..6bd9d72 --- /dev/null +++ b/source/class/ip/ip_getter_iplist.php @@ -0,0 +1,39 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/source/class/ip/ip_tiny.php b/source/class/ip/ip_tiny.php new file mode 100644 index 0000000..fdd28b8 --- /dev/null +++ b/source/class/ip/ip_tiny.php @@ -0,0 +1,83 @@ +fp === NULL && $this->fp = fopen($ipdatafile, 'rb')) { + $this->offset = unpack('Nlen', fread($this->fp, 4)); + $this->index = fread($this->fp, $this->offset['len'] - 4); + } + if($this->fp === FALSE) { + throw new ip_tiny_init_exception(); + } + + $this->length = $this->offset['len'] - 1028; + } + + function __destruct() { + if ($this->fp) { + @fclose($this->fp); + } + } + + public static function getInstance() { + if (!self::$instance) { + try { + self::$instance = new ip_tiny(); + } catch (Exception $e) { + return NULL; + } + } + return self::$instance; + } + + public function convert($ip) { + + $ipdot = explode('.', $ip); + $ip = pack('N', ip2long($ip)); + + $ipdot[0] = (int)$ipdot[0]; + $ipdot[1] = (int)$ipdot[1]; + + + $start = @unpack('Vlen', $this->index[$ipdot[0] * 4] . $this->index[$ipdot[0] * 4 + 1] . $this->index[$ipdot[0] * 4 + 2] . $this->index[$ipdot[0] * 4 + 3]); + + for ($start = $start['len'] * 8 + 1024; $start < $this->length; $start += 8) { + + if ($this->index[$start] . $this->index[$start + 1] . $this->index[$start + 2] . $this->index[$start + 3] >= $ip) { + $index_offset = @unpack('Vlen', $this->index[$start + 4] . $this->index[$start + 5] . $this->index[$start + 6] . "\x0"); + $index_length = @unpack('Clen', $this->index[$start + 7]); + break; + } + } + + @fseek($this->fp, $this->offset['len'] + $index_offset['len'] - 1024); + if($index_length['len']) { + return '- '.@fread($this->fp, $index_length['len']); + } else { + return '- Unknown'; + } + } + +} +?> \ No newline at end of file diff --git a/source/class/ip/ip_v6wry.php b/source/class/ip/ip_v6wry.php new file mode 100644 index 0000000..03b2f40 --- /dev/null +++ b/source/class/ip/ip_v6wry.php @@ -0,0 +1,123 @@ +ipdb = fopen($ipdatafile,'rb'); + if (!$this->ipdb) { + throw new ip_v6wry_init_exception(); + } + $this->firstIndex = unpack('V',$this->reader(16,8))[1]; + $this->indexCount = unpack('V',$this->reader(8,8))[1]; + $this->offlen = ord($this->reader(6,1)); + } + public function __destruct() { + if($this->ipdb) { + @fclose($this->ipdb); + } + } + public static function getInstance() { + if (!self::$instance) { + try { + self::$instance = new ip_v6wry(); + } catch (Exception $e) { + return null; + } + } + return self::$instance; + } + public function getstring($offset) { + fseek($this->ipdb,$offset); + $flag = 1; + $return = ''; + while($flag) { + $i = fread($this->ipdb,1); + if($i === "\0") { + $flag = 0; + } else { + $return .= $i; + } + } + return $return; + } + public function getareaaddr($offset) { + $byte = ord($this->reader($offset,1)); + if($byte == 1 || $byte == 2) { + $p = unpack('V',str_pad($this->reader($offset + 1,$this->offlen),4,"\0"))[1]; + return $this->getareaaddr($p); + } else { + return $this->getstring($offset); + } + } + public function getaddr($offset) { + $byte = ord($this->reader($offset,1)); + if($byte == 1) { + return $this->getaddr(unpack('V',str_pad($this->reader($offset + 1,$this->offlen),4,"\0"))[1]); + } else { + $carea = $this->getareaaddr($offset); + if($byte == 2) { + $offset += 1 + $this->offlen; + } else { + $offset += strlen($carea) + 1; + } + $aarea = $this->getareaaddr($offset); + return [$carea,$aarea]; + } + } + public function ipcomp($ip1,$ip2) { + $ip1a = unpack('v',substr($ip1,-2))[1]; + $ip2a = unpack('v',substr($ip2,-2))[1]; + if($ip1a == $ip2a) { + if(strlen($ip1)<=2) { + return 0; + } else { + return $this->ipcomp(substr($ip1,0,-2),substr($ip2,0,-2)); + } + } elseif($ip1a > $ip2a) { + return 1; + } else { + return -1; + } + } + public function reader($offset,$length) { + fseek($this->ipdb,$offset); + return fread($this->ipdb,$length); + } + public function finder($ip,$l,$r) { + if($r-$l<=1) { + return $l; + } + $m = intval(($l + $r)/2); + $o = $this->firstIndex + $m * (8 + $this->offlen); + $new_ip = $this->reader($o,8); + if($this->ipcomp($new_ip,$ip)>0) { + return $this->finder($ip,$l,$m); + } else { + return $this->finder($ip,$m,$r); + } + } + public function getipaddr($ip) { + $ipbinary = inet_pton($ip); + if($ipbinary == false) { + return '- Unknown'; + } + $iprev = strrev($ipbinary); + $i = $this->finder($iprev,0,$this->indexCount); + $o = $this->firstIndex + $i * (8 + $this->offlen); + $output = $this->getaddr(unpack('L',str_pad($this->reader($o + 8,$this->offlen),4,"\0"))[1]); + return $output; + } + public function convert($ip) { + return '- '.diconv(implode(' ',$this->getipaddr($ip)),'utf-8'); + } +} +?> \ No newline at end of file diff --git a/source/class/ip/ip_wry.php b/source/class/ip/ip_wry.php new file mode 100644 index 0000000..5d08a68 --- /dev/null +++ b/source/class/ip/ip_wry.php @@ -0,0 +1,171 @@ +fp = fopen($ipdatafile, 'rb'); + if (!$this->fp) { + throw new ip_wry_init_exception(); + } + if(!($DataBegin = fread($this->fp, 4)) || !($DataEnd = fread($this->fp, 4)) ) throw new ip_wry_init_exception(); + $this->ipbegin = implode('', unpack('L', $DataBegin)); + if($this->ipbegin < 0) $this->ipbegin += pow(2, 32); + $ipend = implode('', unpack('L', $DataEnd)); + if($ipend < 0) $ipend += pow(2, 32); + $this->ipAllNum = ($ipend - $this->ipbegin) / 7 + 1; + } + + function __destruct() { + if ($this->fp) { + @fclose($this->fp); + } + } + + public static function getInstance() { + if (!self::$instance) { + try { + self::$instance = new ip_wry(); + } catch (Exception $e) { + return null; + } + } + return self::$instance; + } + + public function convert($ip) { + $ip = explode('.', $ip); + $ipNum = $ip[0] * 16777216 + $ip[1] * 65536 + $ip[2] * 256 + $ip[3]; + + $BeginNum = $ip2num = $ip1num = 0; + $ipAddr1 = $ipAddr2 = ''; + $EndNum = $this->ipAllNum; + + while($ip1num > $ipNum || $ip2num < $ipNum) { + $Middle= intval(($EndNum + $BeginNum) / 2); + + fseek($this->fp, $this->ipbegin + 7 * $Middle); + $ipData1 = fread($this->fp, 4); + if(strlen($ipData1) < 4) { + return '- System Error'; + } + $ip1num = implode('', unpack('L', $ipData1)); + if($ip1num < 0) $ip1num += pow(2, 32); + + if($ip1num > $ipNum) { + $EndNum = $Middle; + continue; + } + + $DataSeek = fread($this->fp, 3); + if(strlen($DataSeek) < 3) { + return '- System Error'; + } + $DataSeek = implode('', unpack('L', $DataSeek.chr(0))); + fseek($this->fp, $DataSeek); + $ipData2 = fread($this->fp, 4); + if(strlen($ipData2) < 4) { + return '- System Error'; + } + $ip2num = implode('', unpack('L', $ipData2)); + if($ip2num < 0) $ip2num += pow(2, 32); + + if($ip2num < $ipNum) { + if($Middle == $BeginNum) { + return '- Unknown'; + } + $BeginNum = $Middle; + } + } + + $ipFlag = fread($this->fp, 1); + if($ipFlag == chr(1)) { + $ipSeek = fread($this->fp, 3); + if(strlen($ipSeek) < 3) { + return '- System Error'; + } + $ipSeek = implode('', unpack('L', $ipSeek.chr(0))); + fseek($this->fp, $ipSeek); + $ipFlag = fread($this->fp, 1); + } + + if($ipFlag == chr(2)) { + $AddrSeek = fread($this->fp, 3); + if(strlen($AddrSeek) < 3) { + return '- System Error'; + } + $ipFlag = fread($this->fp, 1); + if($ipFlag == chr(2)) { + $AddrSeek2 = fread($this->fp, 3); + if(strlen($AddrSeek2) < 3) { + return '- System Error'; + } + $AddrSeek2 = implode('', unpack('L', $AddrSeek2.chr(0))); + fseek($this->fp, $AddrSeek2); + } else { + fseek($this->fp, -1, SEEK_CUR); + } + + while(($char = fread($this->fp, 1)) != chr(0)) + $ipAddr2 .= $char; + + $AddrSeek = implode('', unpack('L', $AddrSeek.chr(0))); + fseek($this->fp, $AddrSeek); + + while(($char = fread($this->fp, 1)) != chr(0)) + $ipAddr1 .= $char; + } else { + fseek($this->fp, -1, SEEK_CUR); + while(($char = fread($this->fp, 1)) != chr(0)) + $ipAddr1 .= $char; + + $ipFlag = fread($this->fp, 1); + if($ipFlag == chr(2)) { + $AddrSeek2 = fread($this->fp, 3); + if(strlen($AddrSeek2) < 3) { + return '- System Error'; + } + $AddrSeek2 = implode('', unpack('L', $AddrSeek2.chr(0))); + fseek($this->fp, $AddrSeek2); + } else { + fseek($this->fp, -1, SEEK_CUR); + } + while(($char = fread($this->fp, 1)) != chr(0)) + $ipAddr2 .= $char; + } + + if(preg_match('/http/i', $ipAddr2)) { + $ipAddr2 = ''; + } + $ipaddr = "$ipAddr1 $ipAddr2"; + $ipaddr = preg_replace('/CZ88\.NET/is', '', $ipaddr); + $ipaddr = preg_replace('/^\s*/is', '', $ipaddr); + $ipaddr = preg_replace('/\s*$/is', '', $ipaddr); + if(preg_match('/http/i', $ipaddr) || $ipaddr == '') { + $ipaddr = '- Unknown'; + } + + return '- '.diconv($ipaddr, 'GBK'); + } + +} +?> \ No newline at end of file diff --git a/source/class/lib/index.htm b/source/class/lib/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/lib/lib_tree.php b/source/class/lib/lib_tree.php new file mode 100644 index 0000000..3a0b48d --- /dev/null +++ b/source/class/lib/lib_tree.php @@ -0,0 +1,93 @@ + array()); + public $layer = array(-1 => -1); + public $parent = array(); + public $countid = 0; + + public function __construct() { + } + + public function setNode($id, $parent, $value) { + + $parent = $parent ? $parent : 0; + + $this->data[$id] = $value; + $this->child[$parent][] = $id; + $this->parent[$id] = $parent; + + if (!isset($this->layer[$parent])) { + $this->layer[$id] = 0; + } else { + $this->layer[$id] = $this->layer[$parent] + 1; + } + } + + public function getList(&$tree, $root= 0) { + foreach ($this->child[$root] as $key => $id) { + $tree[] = $id; + if ($this->child[$id]) + $this->getList($tree, $id); + } + } + + public function getValue($id) { + return $this->data[$id]; + } + + public function reSetLayer($id) { + if ($this->parent[$id]) { + $this->layer[$this->countid] = $this->layer[$this->countid] + 1; + $this->reSetLayer($this->parent[$id]); + } + } + + public function getLayer($id, $space = false) { + $this->layer[$id] = 0; + $this->countid = $id; + $this->reSetLayer($id); + return $space ? str_repeat($space, $this->layer[$id]) : $this->layer[$id]; + } + + public function getParent($id) { + return $this->parent[$id]; + } + + public function getParents($id) { + while ($this->parent[$id] != -1) { + $id = $parent[$this->layer[$id]] = $this->parent[$id]; + } + + ksort($parent); + reset($parent); + + return $parent; + } + + public function getChild($id) { + return $this->child[$id]; + } + + public function getChilds($id = 0) { + $child = array(); + $this->getList($child, $id); + + return $child; + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/index.htm b/source/class/magic/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/magic/magic_anonymouspost.php b/source/class/magic/magic_anonymouspost.php new file mode 100644 index 0000000..0c92cd9 --- /dev/null +++ b/source/class/magic/magic_anonymouspost.php @@ -0,0 +1,147 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'fids' => array( + 'title' => 'anonymouspost_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + } + + function usesubmit() { + global $_G; + $id = intval($_GET['id']); + if(empty($id)) { + showmessage(lang('magic/anonymouspost', 'anonymouspost_info_nonexistence')); + } + $idtype = !empty($_GET['idtype']) ? dhtmlspecialchars($_GET['idtype']) : ''; + if(!in_array($idtype, array('pid', 'cid'))) { + showmessage(lang('magic/anonymouspost', 'anonymouspost_use_error')); + } + if($idtype == 'pid') { + $_G['tid'] = $_GET['ptid']; + $post = getpostinfo($id, 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid', 'p.author', 'p.dateline', 'p.anonymous')); + $this->_check($post); + + if($post['authorid'] != $_G['uid']) { + showmessage('magics_operation_nopermission'); + } + + $thread = getpostinfo($post['tid'], 'tid', array('tid', 'subject', 'author', 'replies', 'lastposter')); + if($post['first']) { + $author = ''; + $lastposter = $thread['replies'] > 0 ? $thread['lastposter'] : ''; + } else { + $author = $thread['author']; + $lastposter = ''; + } + C::t('forum_post')->update_post('tid:'.$post['tid'], $id, array('anonymous' => 1)); + $query = C::t('forum_forum')->fetch($post['fid']); + $forum['lastpost'] = explode("\t", $query['lastpost']); + if($post['dateline'] == $forum['lastpost'][2] && ($post['author'] == $forum['lastpost'][3] || ($forum['lastpost'][3] == '' && $post['anonymous']))) { + $subject = cutstr($thread['subject'], 80); + $lastpost = "{$thread['tid']}\t{$subject}\t{$_G['timestamp']}\t$lastposter"; + C::t('forum_forum')->update($post['fid'], array('lastpost' => $lastpost)); + } + C::t('forum_thread')->update($post['tid'], array('author' => $author, 'lastposter' => $lastposter)); + } elseif($idtype == 'cid') { + $value = C::t('home_comment')->fetch_comment($id, intval($_G['uid'])); + if(empty($value)) { + showmessage(lang('magic/anonymouspost', 'anonymouspost_use_error')); + } elseif($value['author'] == '') { + showmessage(lang('magic/anonymouspost', 'anonymouspost_once_limit')); + } + C::t('home_comment')->update_comment($id, array('author'=>''), $_G['uid']); + } + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, $idtype, $id); + + showmessage(lang('magic/anonymouspost', 'anonymouspost_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $id = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + $idtype = !empty($_GET['idtype']) ? dhtmlspecialchars($_GET['idtype']) : ''; + if($idtype == 'pid') { + list($id, $_G['tid']) = explode(':', $id); + if($id && $_G['tid']) { + $post = getpostinfo($id, 'pid', array('p.fid', 'p.authorid')); + $this->_check($post); + } + } + magicshowtype('top'); + magicshowtips(lang('magic/anonymouspost', 'anonymouspost_desc')); + magicshowtips(lang('magic/anonymouspost', 'anonymouspost_num', array('magicnum' => $this->magic['num']))); + magicshowsetting('', 'id', $id, 'hidden'); + magicshowsetting('', 'idtype', $idtype, 'hidden'); + if($idtype == 'pid') { + magicshowsetting('', 'ptid', $_G['tid'], 'hidden'); + } + magicshowtype('bottom'); + } + + function buy() { + global $_G; + $id = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + $idtype = !empty($_GET['idtype']) ? dhtmlspecialchars($_GET['idtype']) : ''; + if(!empty($id) && $idtype == 'pid') { + list($id, $_G['tid']) = explode(':', $id); + $post = getpostinfo(intval($id), 'pid', array('p.fid', 'p.authorid')); + $this->_check($post); + } + } + + function _check($post) { + global $_G; + if(!checkmagicperm($this->parameters['forum'], $post['fid'])) { + showmessage(lang('magic/anonymouspost', 'anonymouspost_info_noperm')); + } + if($post['authorid'] != $_G['uid']) { + showmessage(lang('magic/anonymouspost', 'anonymouspost_info_user_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_attachsize.php b/source/class/magic/magic_attachsize.php new file mode 100644 index 0000000..97a13d2 --- /dev/null +++ b/source/class/magic/magic_attachsize.php @@ -0,0 +1,65 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + $settings = array( + 'addsize' => array( + 'title' => 'attachsize_addsize', + 'type' => 'select', + 'value' => array( + array('5', '5M'), + array('10', '10M'), + array('20', '20M'), + array('50', '50M'), + array('100', '100M'), + ), + 'default' => '10' + ), + ); + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + $magicnew['addsize'] = in_array($parameters['addsize'], array(5,10,20,50,100)) ? intval($parameters['addsize']) : '10'; + } + + function usesubmit() { + global $_G; + + $addsize = !empty($this->parameters['addsize']) ? intval($this->parameters['addsize']) : 10; + C::t('common_member_field_home')->increase($_G['uid'], array('addsize' => $addsize)); + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']); + showmessage('magics_attachsize_message', '', array('num'=>intval($this->parameters['addsize'])), array('alert' => 'right', 'showdialog' => 1)); + } + + function show() { + magicshowtips(lang('magic/attachsize', 'attachsize_info', array('num'=>intval($this->parameters['addsize'])))); + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_bump.php b/source/class/magic/magic_bump.php new file mode 100644 index 0000000..af65817 --- /dev/null +++ b/source/class/magic/magic_bump.php @@ -0,0 +1,99 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'fids' => array( + 'title' => 'bump_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + } + + function usesubmit() { + global $_G; + if(empty($_GET['tid'])) { + showmessage(lang('magic/bump', 'bump_info_nonexistence')); + } + + $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject')); + $this->_check($thread['fid']); + + C::t('forum_thread')->update($_GET['tid'], array('moderated' => 1, 'lastpost' => TIMESTAMP)); + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_GET['tid']); + updatemagicthreadlog($_GET['tid'], $this->magic['magicid'], 'BMP'); + + if($thread['authorid'] != $_G['uid']) { + notification_add($thread['authorid'], 'magic', lang('magic/bump', 'bump_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); + } + + showmessage(lang('magic/bump', 'bump_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $tid = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + if($tid) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid')); + $this->_check($thread['fid']); + } + magicshowtype('top'); + magicshowsetting(lang('magic/bump', 'bump_info'), 'tid', $tid, 'text'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid')); + $this->_check($thread['fid']); + } + } + + function _check($fid) { + if(!checkmagicperm($this->parameters['forum'], $fid)) { + showmessage(lang('magic/bump', 'bump_info_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_call.php b/source/class/magic/magic_call.php new file mode 100644 index 0000000..adde043 --- /dev/null +++ b/source/class/magic/magic_call.php @@ -0,0 +1,86 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) {} + + function setsetting(&$magicnew, &$parameters) {} + + function usesubmit() { + global $_G; + + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + $blog = magic_check_idtype($id, $idtype); + + $num = 10; + $list = $ids = $note_inserts = array(); + $fusername = dimplode($_POST['fusername']); + if($fusername) { + $query = C::t('home_friend')->fetch_all_by_uid_username($_G['uid'], $_POST['fusername'], 0, $num); + $note = lang('spacecp', 'magic_call', array('url'=>"home.php?mod=space&uid={$_G['uid']}&do=blog&id=$id")); + foreach($query as $value) { + $ids[] = $value['fuid']; + $value['avatar'] = str_replace("'", "\'", avatar($value['fuid'],'small')); + $list[] = $value; + $note_inserts[] = array( + 'uid' => $value['fuid'], + 'type' => "magic", + 'new' => 1, + 'authorid' => $_G['uid'], + 'author' => $_G['username'], + 'note' => $note, + 'category' => 3, + 'dateline' => $_G['timestamp'] + ); + } + } + if(empty($ids)) { + showmessage('magicuse_has_no_valid_friend'); + } + foreach($note_inserts as $note_insert) { + C::t('home_notification')->insert($note_insert); + } + + C::t('common_member')->increase($ids, array('newprompt' => 1)); + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id); + + $op = 'show'; + include template('home/magic_call'); + } + + function show() { + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + magic_check_idtype($id, $idtype); + magicshowtips(lang('magic/call', 'call_info')); + $op = 'use'; + include template('home/magic_call'); + } +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_checkonline.php b/source/class/magic/magic_checkonline.php new file mode 100644 index 0000000..079d685 --- /dev/null +++ b/source/class/magic/magic_checkonline.php @@ -0,0 +1,91 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + } + + function setsetting(&$magicnew, &$parameters) { + } + + function usesubmit() { + global $_G; + if(empty($_GET['username'])) { + showmessage(lang('magic/checkonline', 'checkonline_info_nonexistence')); + } + + $member = getuserinfo($_GET['username']); + $this->_check($member['groupid']); + + $online = C::app()->session->fetch_by_uid($member['uid']); + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'uid', $member['uid']); + + if($member['uid'] != $_G['uid']) { + notification_add($member['uid'], 'magic', lang('magic/checkonline', 'checkonline_notification'), array('magicname' => $this->magic['name']), 1); + } + + if($online) { + $time = dgmdate($online['lastactivity'], 'u'); + if($online['invisible']) { + showmessage(lang('magic/checkonline', 'checkonline_hidden_message'), '', array('username' => $_GET['username'], 'time' => $time), array('alert' => 'info', 'showdialog' => 1)); + } else { + showmessage(lang('magic/checkonline', 'checkonline_online_message'), '', array('username' => $_GET['username'], 'time' => $time), array('alert' => 'info', 'showdialog' => 1)); + } + } else { + showmessage(lang('magic/checkonline', 'checkonline_offline_message'), '', array('username' => $_GET['username']), array('alert' => 'info', 'showdialog' => 1)); + } + } + + function show() { + global $_G; + $user = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + if($user) { + $member = getuserinfo($user); + $this->_check($member['groupid']); + } + magicshowtype('top'); + magicshowsetting(lang('magic/checkonline', 'checkonline_targetuser'), 'username', $user, 'text'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + $member = getuserinfo($_GET['id']); + $this->_check($member['groupid']); + } + } + + function _check($groupid) { + if(!checkmagicperm($this->parameters['targetgroups'], $groupid)) { + showmessage(lang('magic/checkonline', 'checkonline_info_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_chgusername.php b/source/class/magic/magic_chgusername.php new file mode 100644 index 0000000..762f655 --- /dev/null +++ b/source/class/magic/magic_chgusername.php @@ -0,0 +1,74 @@ +Discuz! Community Team'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + } + + function setsetting(&$magicnew, &$parameters) { + } + + function usesubmit() { + global $_G; + if(empty($_GET['newusername'])) { + showmessage(lang('magic/chgusername', 'chgusername_info_nonexistence')); + } + + $censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($_G['settting']['censoruser'] = trim($_G['settting']['censoruser'])), '/')).')$/i'; + + if($_G['settting']['censoruser'] && @preg_match($censorexp, $_GET['newusername'])) { + showmessage(lang('magic/chgusername', 'chgusername_name_badword')); + } + + loaducenter(); + $ucresult = uc_user_chgusername($_G['uid'], addslashes(trim($_GET['newusername']))); + + if($ucresult < 0) { + if($ucresult == -1) { + showmessage(lang('magic/chgusername', 'chgusername_check_failed')); + } elseif($ucresult == -2) { + showmessage(lang('magic/chgusername', 'chgusername_name_badword')); + } elseif($ucresult == -3) { + showmessage(lang('magic/chgusername', 'chgusername_name_exists')); + } else { + showmessage(lang('magic/chgusername', 'chgusername_change_failed')); + } + } + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'uid', $_G['uid']); + + showmessage(lang('magic/chgusername', 'chgusername_change_success'), '', '', array('alert' => 'info', 'showdialog' => 1)); + } + + function show() { + magicshowtype('top'); + magicshowsetting(lang('magic/chgusername', 'chgusername_newusername'), 'newusername', '', 'text'); + magicshowtype('bottom'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_close.php b/source/class/magic/magic_close.php new file mode 100644 index 0000000..2591d7e --- /dev/null +++ b/source/class/magic/magic_close.php @@ -0,0 +1,116 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'expiration' => array( + 'title' => 'close_expiration', + 'type' => 'text', + 'value' => '', + 'default' => 24, + ), + 'fids' => array( + 'title' => 'close_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + $magicnew['expiration'] = intval($parameters['expiration']); + } + + function usesubmit() { + global $_G; + if(empty($_GET['tid'])) { + showmessage(lang('magic/close', 'close_info_nonexistence')); + } + + $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject')); + $this->_check($thread); + magicthreadmod($_GET['tid']); + + C::t('forum_thread')->update($_GET['tid'], array('closed' => 1, 'moderated' => 1)); + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; + $expiration = TIMESTAMP + $this->parameters['expiration'] * 3600; + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_GET['tid']); + updatemagicthreadlog($_GET['tid'], $this->magic['magicid'], $expiration > 0 ? 'ECL' : 'CLS', $expiration); + + if($thread['authorid'] != $_G['uid']) { + notification_add($thread['authorid'], 'magic', lang('magic/close', 'close_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); + } + + showmessage(lang('magic/close', 'close_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $tid = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + if($tid) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid', 'authorid')); + $this->_check($thread); + } + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; + magicshowtype('top'); + magicshowsetting(lang('magic/close', 'close_info', array('expiration' => $this->parameters['expiration'])), 'tid', $tid, 'text'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid', 'authorid')); + $this->_check($thread); + } + } + + function _check($thread) { + if(!checkmagicperm($this->parameters['forum'], $thread['fid'])) { + showmessage(lang('magic/close', 'close_info_noperm')); + } + $member = getuserbyuid($thread['authorid']); + if(!checkmagicperm($this->parameters['targetgroups'], $member['groupid'])) { + showmessage(lang('magic/close', 'close_info_user_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_detector.php b/source/class/magic/magic_detector.php new file mode 100644 index 0000000..0304aab --- /dev/null +++ b/source/class/magic/magic_detector.php @@ -0,0 +1,90 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + $settings = array( + 'num' => array( + 'title' => 'detector_num', + 'type' => 'select', + 'value' => array( + array('5', '5'), + array('10', '10'), + array('20', '20'), + ), + 'default' => '10' + ), + ); + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + $magicnew['num'] = in_array($parameters['num'], array(5,10,20,50)) ? intval($parameters['num']) : '10'; + } + + function usesubmit() { + global $_G; + + $list = $uids = array(); + $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10; + $limit = $num + 20; + $giftMagicID = C::t('common_magic')->fetch_by_identifier('gift'); + $mid = $giftMagicID['available'] ? intval($giftMagicID['magicid']) : 0; + if($mid) { + foreach(C::t('common_magiclog')->fetch_all_by_magicid_action_uid($mid, 2, $_G['uid'], 0, $limit) as $value) { + $uids[] = intval($value['uid']); + } + } + if($uids) { + $counter = 0; + $members = C::t('common_member')->fetch_all($uids); + foreach(C::t('common_member_field_home')->fetch_all($uids) as $uid => $value) { + $value = array_merge($members[$uid], $value); + $info = !empty($value['magicgift']) ? dunserialize($value['magicgift']) : array(); + if(!empty($info['left']) && (empty($info['receiver']) || !in_array($_G['uid'], $info['receiver']))) { + $value['avatar'] = addcslashes(avatar($uid, 'small'), "'"); + $list[$uid] = $value; + $counter++; + if($counter>=$num) { + break; + } + } + } + } + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']); + + $op = 'show'; + include template('home/magic_detector'); + } + + function show() { + global $_G; + $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10; + magicshowtips(lang('magic/detector', 'detector_info', array('num'=>$num))); + } +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_doodle.php b/source/class/magic/magic_doodle.php new file mode 100644 index 0000000..976ea73 --- /dev/null +++ b/source/class/magic/magic_doodle.php @@ -0,0 +1,52 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) {} + + function setsetting(&$magicnew, &$parameters) {} + + function usesubmit() { + global $_G; + + $config = urlencode(getsiteurl().'home.php?mod=misc&ac=swfupload&op=config&doodle=1'); + include template('home/magic_doodle'); + } + + function show() { + global $_G; + magicshowtips(lang('magic/doodle', 'doodle_info')); + echo ' +

    + + + +

    +'; + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_downdateline.php b/source/class/magic/magic_downdateline.php new file mode 100644 index 0000000..fc5693d --- /dev/null +++ b/source/class/magic/magic_downdateline.php @@ -0,0 +1,65 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) {} + + function setsetting(&$magicnew, &$parameters) {} + + function usesubmit() { + global $_G; + + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + $blog = magic_check_idtype($id, $idtype); + + $newdateline = strtotime($_POST['newdateline']); + if(!$_POST['newdateline'] || $newdateline < strtotime('1970-1-1') || $newdateline > $blog['dateline']) { + showmessage('magicuse_bad_dateline'); + } + + $tablename = gettablebyidtype($idtype); + C::t($tablename)->update_dateline_by_id_idtype_uid($id, $idtype, $newdateline, $_G['uid']); + + C::t('home_feed')->update_feed($id, array('dateline'=>$newdateline), $idtype, $_G['uid']); + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id); + showmessage('magics_use_success', '', array('magicname'=>$_G['setting']['magics']['downdateline']), array('alert' => 'right', 'showdialog' => 1)); + } + + function show() { + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + $blog = magic_check_idtype($id, $idtype); + magicshowtips(lang('magic/downdateline', 'downdateline_info')); + $time = dgmdate($blog['dateline'], 'Y-m-d H:i'); + $op='use'; + include template('home/magic_downdateline'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_flicker.php b/source/class/magic/magic_flicker.php new file mode 100644 index 0000000..cc9e194 --- /dev/null +++ b/source/class/magic/magic_flicker.php @@ -0,0 +1,44 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) {} + + function setsetting(&$magicnew, &$parameters) {} + + function usesubmit() { + global $_G; + + C::t('home_comment')->update_comment($_GET['id'], array('magicflicker' => 1), $_G['uid']); + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0'); + showmessage(lang('magic/flicker', 'flicker_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'closetime' => true, 'locationtime' => true)); + } + + function show() { + global $_G; + magicshowtips(lang('magic/flicker', 'flicker_info')); + } +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_friendnum.php b/source/class/magic/magic_friendnum.php new file mode 100644 index 0000000..8c85817 --- /dev/null +++ b/source/class/magic/magic_friendnum.php @@ -0,0 +1,65 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + $settings = array( + 'addnum' => array( + 'title' => 'friendnum_addnum', + 'type' => 'select', + 'value' => array( + array('5', '5'), + array('10', '10'), + array('20', '20'), + array('50', '50'), + ), + 'default' => '10' + ), + ); + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + $magicnew['addnum'] = in_array($parameters['addnum'], array(5,10,20,50)) ? intval($parameters['addnum']) : '10'; + } + + function usesubmit() { + global $_G; + + $addnum = !empty($this->parameters['addnum']) ? intval($this->parameters['addnum']) : 10; + C::t('common_member_field_home')->increase($_G['uid'], array('addfriend' => $addnum)); + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']); + showmessage('magics_friendadd_message', '', array('num'=>intval($this->parameters['addnum'])), array('alert' => 'right', 'showdialog' => 1)); + } + + function show() { + $addnum = !empty($this->parameters['addnum']) ? intval($this->parameters['addnum']) : 10; + magicshowtips(lang('magic/friendnum', 'friendnum_info', array('num'=>$addnum))); + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_gift.php b/source/class/magic/magic_gift.php new file mode 100644 index 0000000..392e1b1 --- /dev/null +++ b/source/class/magic/magic_gift.php @@ -0,0 +1,86 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + $settings = array(); + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + } + + function usesubmit() { + global $_G; + + $info = array( + 'credits' => intval($_POST['credits']), + 'percredit' => intval($_POST['percredit']), + 'credittype' => $_GET['credittype'], + 'left' => intval($_POST['credits']), + 'magicid' => intval($this->magic['magicid']), + 'receiver' => array() + ); + if($info['credits'] < 1) { + showmessage(lang('magic/gift', 'gift_bad_credits_input')); + } + if($info['percredit'] < 1 || $info['percredit'] > $info['credits']) { + showmessage(lang('magic/gift', 'gift_bad_percredit_input')); + } + $member = array(); + if(preg_match('/^extcredits[1-8]$/', $info['credittype'])) { + $member = C::t('common_member_count')->fetch($_G['uid']); + if($member[$info['credittype']] < $info['credits']) { + showmessage(lang('magic/gift', 'gift_credits_out_of_own')); + } + $extcredits = str_replace('extcredits', '', $info['credittype']); + updatemembercount($_G['uid'], array($extcredits => -$info['credits']), 1, 'BGC', $this->magic['magicid']); + } else { + showmessage(lang('magic/gift', 'gift_bad_credittype_input')); + } + + C::t('common_member_field_home')->update($_G['uid'], array('magicgift' => serialize($info))); + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']); + + showmessage(lang('magic/gift', 'gift_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10; + magicshowtips(lang('magic/gift', 'gift_info', array('num'=>$num))); + + $extcredits = array(); + foreach($_G['setting']['extcredits'] as $id => $credit) { + $extcredits['extcredits'.$id] = $credit['title']; + } + + $op = 'show'; + include template('home/magic_gift'); + } +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_highlight.php b/source/class/magic/magic_highlight.php new file mode 100644 index 0000000..dccc628 --- /dev/null +++ b/source/class/magic/magic_highlight.php @@ -0,0 +1,160 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + var $idtypearray = array('blogid', 'tid'); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'expiration' => array( + 'title' => 'highlight_expiration', + 'type' => 'text', + 'value' => '', + 'default' => 24, + ), + 'fids' => array( + 'title' => 'highlight_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + $magicnew['expiration'] = intval($parameters['expiration']); + } + + function usesubmit() { + global $_G; + $idtype = !empty($_GET['idtype']) ? $_GET['idtype'] : ''; + if(!in_array($idtype, $this->idtypearray)) { + showmessage(lang('magic/highlight', 'highlight_info_notype'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => true)); + } + if(empty($_GET['id'])) { + showmessage(lang('magic/highlight', 'highlight_info_nonexistence_'.$idtype)); + } + + if($idtype == 'tid') { + $info = getpostinfo($_GET['id'], $idtype, array('fid', 'authorid', 'subject')); + $this->_check($info['fid']); + magicthreadmod($_GET['id']); + C::t('forum_thread')->update($_GET['id'], array('highlight' => $_GET['highlight_color'], 'moderated' => 1)); + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; + $expiration = TIMESTAMP + $this->parameters['expiration'] * 3600; + updatemagicthreadlog($_GET['id'], $this->magic['magicid'], $expiration > 0 ? 'EHL' : 'HLT', $expiration); + if($info['authorid'] != $_G['uid']) { + notification_add($info['authorid'], 'magic', lang('magic/highlight', 'highlight_notification'), array('tid' => $_GET['id'], 'subject' => $info['subject'], 'magicname' => $this->magic['name'])); + } + } elseif($idtype == 'blogid') { + $info = getpostinfo($_GET['id'], $idtype, array('uid', 'subject')); + C::t('home_blogfield')->update($_GET['id'], array('magiccolor' => $_GET['highlight_color'])); + if($info['uid'] != $_G['uid']) { + notification_add($info['uid'], 'magic', lang('magic/highlight', 'highlight_notification_blogid'), array('blogid' => $_GET['id'], 'subject' => $info['subject'], 'magicname' => $this->magic['name'])); + } + } + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, $idtype, $_GET['id']); + + showmessage(lang('magic/highlight', 'highlight_succeed_'.$idtype), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $id = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + $idtype = !empty($_GET['idtype']) ? $_GET['idtype'] : ''; + if(!in_array($idtype, $this->idtypearray)) { + showmessage(lang('magic/highlight', 'highlight_info_notype'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => true)); + } + if($id) { + $info = getpostinfo($_GET['id'], $idtype); + if($idtype == 'tid') { + $this->_check($info['fid']); + $this->parameters['expiration'] = $this->parameters['expiration'] && $idtype == 'tid' ? intval($this->parameters['expiration']) : 24; + } + } + magicshowtype('top'); + $lang = lang('magic/highlight'); + magicshowsetting(lang('magic/highlight', 'highlight_info_'.$idtype, array('expiration' => $this->parameters['expiration'])), 'id', $id, 'hidden'); +echo <<{$lang['highlight_color']}

    +
    + + + + ^ +
    + +EOF; + magicshowtype('bottom'); + } + + function buy() { + global $_G; + $idtype = !empty($_GET['idtype']) ? $_GET['idtype'] : ''; + if(!empty($_GET['id'])) { + $info = getpostinfo($_GET['id'], $idtype); + if($idtype == 'tid') { + $this->_check($info['fid']); + } + } + } + + function _check($fid) { + if(!checkmagicperm($this->parameters['forum'], $fid)) { + showmessage(lang('magic/highlight', 'highlight_info_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_hot.php b/source/class/magic/magic_hot.php new file mode 100644 index 0000000..3dfcfe1 --- /dev/null +++ b/source/class/magic/magic_hot.php @@ -0,0 +1,72 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) {} + + function setsetting(&$magicnew, &$parameters) {} + + function usesubmit() { + global $_G; + + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + $blog = magic_check_idtype($id, $idtype); + + if(C::t('common_magiclog')->count_by_action_uid_targetid_idtype_magicid(2, $_G['uid'], $id, $idtype, $this->magic['magicid'])) { + showmessage('magicuse_object_once_limit'); + } + + $num = !empty($_G['setting']['feedhotmin']) ? intval($_G['setting']['feedhotmin']) : 3; + C::t('home_feed')->update_hot_by_id($id, $idtype, $_G['uid'], $num); + C::t('home_blog')->increase($id, $_G['uid'], array('hot' => $num)); + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id); + showmessage('magics_use_success', '', array('magicname'=>$_G['setting']['magics']['hot']), array('alert' => 'right', 'showdialog' => 1)); + } + + function show() { + global $_G; + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + $blog = magic_check_idtype($id, $idtype); + if(C::t('common_magiclog')->count_by_action_uid_targetid_idtype_magicid(2, $_G['uid'], $id, $idtype, $this->magic['magicid'])) { + showmessage('magicuse_object_once_limit'); + } + + $num = !empty($_G['setting']['feedhotmin']) ? intval($_G['setting']['feedhotmin']) : 3; + magicshowtips(lang('magic/hot', 'hot_info', array('num'=>$num))); + echo << + + +

    +HTML; + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_jack.php b/source/class/magic/magic_jack.php new file mode 100644 index 0000000..75ea198 --- /dev/null +++ b/source/class/magic/magic_jack.php @@ -0,0 +1,116 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'expiration' => array( + 'title' => 'jack_expiration', + 'type' => 'text', + 'value' => '', + 'default' => 1, + ), + 'fids' => array( + 'title' => 'jack_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + $magicnew['expiration'] = intval($parameters['expiration']); + } + + function usesubmit() { + global $_G; + if(empty($_GET['tid'])) { + showmessage(lang('magic/jack', 'jack_info_nonexistence')); + } + + $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject', 'lastpost')); + $this->_check($thread['fid']); + magicthreadmod($_GET['tid']); + + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 1; + $magicnum = abs(intval($_GET['magicnum'])); + if(empty($magicnum) || $magicnum > $this->magic['num']) { + showmessage(lang('magic/jack', 'jack_num_not_enough')); + } + $expiration = ($thread['lastpost'] > TIMESTAMP ? $thread['lastpost'] : TIMESTAMP) + $this->parameters['expiration'] * $magicnum * 3600; + C::t('forum_thread')->update($_GET['tid'], array('lastpost' => $expiration)); + usemagic($this->magic['magicid'], $this->magic['num'], $magicnum); + updatemagiclog($this->magic['magicid'], '2', $magicnum, '0', 0, 'tid', $_GET['tid']); + + if($thread['authorid'] != $_G['uid']) { + notification_add($thread['authorid'], 'magic', lang('magic/jack', 'jack_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); + } + showmessage(lang('magic/jack', 'jack_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $tid = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + if($tid) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid')); + $this->_check($thread['fid']); + } + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 1; + magicshowtype('top'); + magicshowtips(lang('magic/jack', 'jack_info', array('expiration' => $this->parameters['expiration'], 'magicnum' => $this->magic['num']))); + magicshowsetting(lang('magic/jack', 'jack_num'), 'magicnum', '1', 'text'); + magicshowsetting('', 'tid', $tid, 'hidden'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid')); + $this->_check($thread['fid']); + } + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 1; + magicshowtips(lang('magic/jack', 'jack_info', array('expiration' => $this->parameters['expiration']))); + } + + function _check($fid) { + if(!checkmagicperm($this->parameters['forum'], $fid)) { + showmessage(lang('magic/jack', 'jack_info_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_money.php b/source/class/magic/magic_money.php new file mode 100644 index 0000000..5aae8cd --- /dev/null +++ b/source/class/magic/magic_money.php @@ -0,0 +1,51 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + } + + function setsetting(&$magicnew, &$parameters) { + } + + function usesubmit() { + global $_G; + $getmoney = rand(1, intval($this->magic['price'] * 1.5)); + updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][3] => $getmoney), 1, 'MRC', $this->magic['magicid']); + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'uid', $_G['uid']); + showmessage('magics_credit_message', '', array('credit' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][3]]['title'].' '.$getmoney.' '.$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][3]]['unit']), array('alert' => 'right', 'showdialog' => 1)); + } + + function show() { + magicshowtips(lang('magic/money', 'money_info')); + } + + function buy() { + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_namepost.php b/source/class/magic/magic_namepost.php new file mode 100644 index 0000000..b7aa6d7 --- /dev/null +++ b/source/class/magic/magic_namepost.php @@ -0,0 +1,133 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'fids' => array( + 'title' => 'namepost_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + } + + function usesubmit() { + global $_G; + $id = intval($_GET['id']); + if(empty($id)) { + showmessage(lang('magic/namepost', 'namepost_info_nonexistence')); + } + $idtype = !empty($_GET['idtype']) ? dhtmlspecialchars($_GET['idtype']) : ''; + if(!in_array($idtype, array('pid', 'cid'))) { + showmessage(lang('magic/namepost', 'namepost_use_error')); + } + if($idtype == 'pid') { + $_G['tid'] = intval($_GET['ptid']); + $post = getpostinfo($id, 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid', 'p.dateline', 'p.anonymous')); + $this->_check($post); + $authorid = $post['authorid']; + $author = $post['anonymous'] ? '' : 1; + } elseif($idtype == 'cid') { + $comment = C::t('home_comment')->fetch_comment($id); + $authorid = $comment['authorid']; + $author = $comment['author']; + } + if($author) { + showmessage('magicuse_bad_object'); + } + $member = getuserbyuid($authorid); + if(!checkmagicperm($this->parameters['targetgroups'], $member['groupid'])) { + showmessage(lang('magic/namepost', 'namepost_info_user_noperm')); + } + $author = daddslashes($member['username']); + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, $idtype, $id); + showmessage(lang('magic/namepost', 'magic_namepost_succeed'),'javascript:;', array('uid' => $authorid, 'username' => $author, 'avatar' => 1), array('alert' => 'right')); + } + + function show() { + global $_G; + $id = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + $idtype = !empty($_GET['idtype']) ? dhtmlspecialchars($_GET['idtype']) : ''; + if($idtype == 'pid') { + list($id, $_G['tid']) = explode(':', $id); + if($id && $_G['tid']) { + $post = getpostinfo($id, 'pid', array('p.fid', 'p.authorid')); + $this->_check($post); + } + } + + magicshowtype('top'); + magicshowtips(lang('magic/namepost', 'namepost_desc')); + magicshowtips(lang('magic/namepost', 'namepost_num', array('magicnum' => $this->magic['num']))); + magicshowsetting('', 'id', $id, 'hidden'); + magicshowsetting('', 'idtype', $idtype, 'hidden'); + if($idtype == 'pid') { + magicshowsetting('', 'ptid', $_G['tid'], 'hidden'); + } + magicshowtype('bottom'); + } + + function buy() { + global $_G; + $id = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + $idtype = !empty($_GET['idtype']) ? dhtmlspecialchars($_GET['idtype']) : ''; + if(!empty($id) && $_GET['idtype'] == 'pid') { + list($id, $_G['tid']) = explode(':', $id); + $post = getpostinfo(intval($id), 'pid', array('p.fid', 'p.authorid')); + $this->_check($post); + } + } + + function _check($post) { + global $_G; + if(!checkmagicperm($this->parameters['forum'], $post['fid'])) { + showmessage(lang('magic/namepost', 'namepost_info_noperm')); + } + $member = getuserbyuid($post['authorid']); + if(!checkmagicperm($this->parameters['targetgroups'], $member['groupid'])) { + showmessage(lang('magic/namepost', 'namepost_info_user_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_open.php b/source/class/magic/magic_open.php new file mode 100644 index 0000000..d477e9d --- /dev/null +++ b/source/class/magic/magic_open.php @@ -0,0 +1,107 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'fids' => array( + 'title' => 'open_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + $magicnew['expiration'] = intval($parameters['expiration']); + } + + function usesubmit() { + global $_G; + if(empty($_GET['tid'])) { + showmessage(lang('magic/open', 'open_info_nonexistence')); + } + + $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject')); + $this->_check($thread); + magicthreadmod($_GET['tid']); + + C::t('forum_thread')->update($_GET['tid'], array('closed' => 0, 'moderated' => 1)); + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_GET['tid']); + updatemagicthreadlog($_GET['tid'], $this->magic['magicid'], 'OPN'); + + if($thread['authorid'] != $_G['uid']) { + notification_add($thread['authorid'], 'magic', lang('magic/open', 'open_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); + } + + showmessage(lang('magic/open', 'open_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $tid = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + if($tid) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid', 'authorid')); + $this->_check($thread); + } + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; + magicshowtype('top'); + magicshowsetting(lang('magic/open', 'open_info', array('expiration' => $this->parameters['expiration'])), 'tid', $tid, 'text'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid', 'authorid')); + $this->_check($thread); + } + } + + function _check($thread) { + if(!checkmagicperm($this->parameters['forum'], $thread['fid'])) { + showmessage(lang('magic/open', 'open_info_noperm')); + } + $member = getuserbyuid($thread['authorid']); + if(!checkmagicperm($this->parameters['targetgroups'], $member['groupid'])) { + showmessage(lang('magic/open', 'open_info_user_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_repent.php b/source/class/magic/magic_repent.php new file mode 100644 index 0000000..8f46094 --- /dev/null +++ b/source/class/magic/magic_repent.php @@ -0,0 +1,127 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'fids' => array( + 'title' => 'repent_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + } + + function usesubmit() { + global $_G; + if(empty($_GET['pid'])) { + showmessage(lang('magic/repent', 'repent_info_nonexistence')); + } + $_G['tid'] = $_GET['ptid']; + + $post = getpostinfo($_GET['pid'], 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid', 'p.replycredit', 't.status as thread_status')); + $this->_check($post); + + require_once libfile('function/post'); + require_once libfile('function/delete'); + if($post['first']) { + if($have_replycredit = C::t('forum_replycredit')->fetch($post['tid'])) { + $thread = C::t('forum_thread')->fetch_thread($post['tid']); + if($thread['replycredit']) { + updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => -$thread['replycredit'])); + } + C::t('forum_replycredit')->delete($post['tid']); + C::t('common_credit_log')->delete_by_operation_relatedid(array('RCT', 'RCA', 'RCB'), $post['tid']); + } + + deletethread(array($post['tid'])); + updateforumcount($post['fid']); + } else { + if($post['replycredit'] > 0) { + updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => -$post['replycredit'])); + C::t('common_credit_log')->delete_by_uid_operation_relatedid($post['authorid'], 'RCA', $post['tid']); + } + deletepost(array($_GET['pid'])); + updatethreadcount($post['tid']); + } + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['tid']); + + showmessage(lang('magic/repent', 'repent_succeed'), $post['first'] ? 'forum.php?mod=forumdisplay&fid='.$post['fid'] : dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $pid = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + list($pid, $_G['tid']) = explode(':', $pid); + if($_G['tid']) { + $post = getpostinfo($_GET['id'], 'pid', array('p.fid', 'p.authorid', 't.status as thread_status')); + $this->_check($post); + } + magicshowtype('top'); + magicshowsetting(lang('magic/repent', 'repent_info'), 'pid', $pid, 'text'); + magicshowsetting('', 'ptid', $_G['tid'], 'hidden'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + list($_GET['id'], $_G['tid']) = explode(':', $_GET['id']); + $post = getpostinfo($_GET['id'], 'pid', array('p.fid', 'p.authorid')); + $this->_check($post); + } + } + + function _check($post) { + global $_G; + if(!checkmagicperm($this->parameters['forum'], $post['fid'])) { + showmessage(lang('magic/repent', 'repent_info_noperm')); + } + if($post['authorid'] != $_G['uid']) { + showmessage(lang('magic/repent', 'repent_info_user_noperm')); + } + if(getstatus($post['status'], 3)) { + showmessage(lang('magic/repent', 'repent_do_not_rushreply')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_showip.php b/source/class/magic/magic_showip.php new file mode 100644 index 0000000..cd92ddf --- /dev/null +++ b/source/class/magic/magic_showip.php @@ -0,0 +1,88 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + } + + function setsetting(&$magicnew, &$parameters) { + } + + function usesubmit() { + global $_G; + if(empty($_GET['username'])) { + showmessage(lang('magic/showip', 'showip_info_nonexistence')); + } + + $member = getuserinfo($_GET['username']); + $this->_check($member['groupid']); + + $memberstatus = C::t('common_member_status')->fetch($member['uid']); + $ip = $memberstatus['lastip']; + unset($memberstatus); + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'uid', $member['uid']); + + if($member['uid'] != $_G['uid']) { + notification_add($member['uid'], 'magic', lang('magic/showip', 'showip_notification'), array('magicname' => $this->magic['name']), 1); + } + + showmessage(lang('magic/showip', 'showip_ip_message'), '', array('username' => $_GET['username'], 'ip' => $ip), array('alert' => 'info', 'showdialog' => 1)); + } + + function show() { + global $_G; + $user = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + if($user) { + $member = getuserinfo($user); + $this->_check($member['groupid']); + } + magicshowtype('top'); + magicshowsetting(lang('magic/showip', 'showip_targetuser'), 'username', $user, 'text'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + $member = getuserinfo($_GET['id']); + if($_G['group']['allowviewip']) { + $_GET['username'] = $member['username']; + $this->usesubmit(); + } else { + $this->_check($member['groupid']); + } + } + } + + function _check($groupid) { + if(!checkmagicperm($this->parameters['targetgroups'], $groupid)) { + showmessage(lang('magic/showip', 'showip_info_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_stick.php b/source/class/magic/magic_stick.php new file mode 100644 index 0000000..290693a --- /dev/null +++ b/source/class/magic/magic_stick.php @@ -0,0 +1,111 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + global $_G; + $settings = array( + 'expiration' => array( + 'title' => 'stick_expiration', + 'type' => 'text', + 'value' => '', + 'default' => 24, + ), + 'fids' => array( + 'title' => 'stick_forum', + 'type' => 'mselect', + 'value' => array(), + ), + ); + loadcache('forums'); + $settings['fids']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); + } + $magic['fids'] = explode("\t", $magic['forum']); + + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + global $_G; + $magicnew['forum'] = is_array($parameters['fids']) && !empty($parameters['fids']) ? implode("\t",$parameters['fids']) : ''; + $magicnew['expiration'] = intval($parameters['expiration']); + } + + function usesubmit() { + global $_G; + if(empty($_GET['tid'])) { + showmessage(lang('magic/stick', 'stick_info_nonexistence')); + } + + $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject')); + $this->_check($thread['fid']); + magicthreadmod($_GET['tid']); + + C::t('forum_thread')->update($_GET['tid'], array('displayorder' => 1, 'moderated' => 1)); + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; + $expiration = TIMESTAMP + $this->parameters['expiration'] * 3600; + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_GET['tid']); + updatemagicthreadlog($_GET['tid'], $this->magic['magicid'], $expiration > 0 ? 'EST' : 'STK', $expiration); + + if($thread['authorid'] != $_G['uid']) { + notification_add($thread['authorid'], 'magic', lang('magic/stick', 'stick_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); + } + + showmessage(lang('magic/stick', 'stick_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + global $_G; + $tid = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : ''; + if($tid) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid')); + $this->_check($thread['fid']); + } + $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; + magicshowtype('top'); + magicshowsetting(lang('magic/stick', 'stick_info', array('expiration' => $this->parameters['expiration'])), 'tid', $tid, 'text'); + magicshowtype('bottom'); + } + + function buy() { + global $_G; + if(!empty($_GET['id'])) { + $thread = getpostinfo($_GET['id'], 'tid', array('fid')); + $this->_check($thread['fid']); + } + } + + function _check($fid) { + if(!checkmagicperm($this->parameters['forum'], $fid)) { + showmessage(lang('magic/stick', 'stick_info_noperm')); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_thunder.php b/source/class/magic/magic_thunder.php new file mode 100644 index 0000000..3dcabce --- /dev/null +++ b/source/class/magic/magic_thunder.php @@ -0,0 +1,60 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) {} + + function setsetting(&$magicnew, &$parameters) {} + + function usesubmit() { + global $_G; + + $uid = $_G['uid']; + $_G['uid'] = 0; + $avatar = avatar($uid, 'middle',true); + include_once libfile('function/feed'); + feed_add( + 'thunder', 'magicuse_thunder_announce_title', + array( + 'uid' => $uid, + 'username' => "{$_G['username']}"), + 'magicuse_thunder_announce_body', + array( + 'uid' => $uid, + 'magic_thunder' =>1), '', array($avatar), array("home.php?mod=space&uid=$uid") + ); + $_G['uid'] = $uid; + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']); + showmessage('magics_thunder_message', 'home.php?mod=space&do=home&view=all', array('magicname'=>$_G['setting']['magics']['thunder']), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); + } + + function show() { + magicshowtips(lang('magic/thunder', 'thunder_info')); + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_updateline.php b/source/class/magic/magic_updateline.php new file mode 100644 index 0000000..c2a3c81 --- /dev/null +++ b/source/class/magic/magic_updateline.php @@ -0,0 +1,61 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) {} + + function setsetting(&$magicnew, &$parameters) {} + + function usesubmit() { + global $_G; + + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + + magic_check_idtype($id, $idtype); + + $tablename = gettablebyidtype($idtype); + C::t($tablename)->update_dateline_by_id_idtype_uid($id, $idtype, $_G['timestamp'], $_G['uid']); + + C::t('home_feed')->update_feed($id, array('dateline'=>$_G['timestamp']), $idtype, $_G['uid']); + + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id); + showmessage('magics_use_success', '', array('magicname'=>$_G['setting']['magics']['updateline']), array('alert' => 'right', 'showdialog' => 1)); + } + + function show() { + global $_G; + $id = intval($_GET['id']); + $idtype = $_GET['idtype']; + + magic_check_idtype($id, $idtype); + magicshowtips(lang('magic/updateline', 'updateline_info')); + echo '

    '; + } + +} + +?> \ No newline at end of file diff --git a/source/class/magic/magic_visit.php b/source/class/magic/magic_visit.php new file mode 100644 index 0000000..dc6574a --- /dev/null +++ b/source/class/magic/magic_visit.php @@ -0,0 +1,170 @@ +Discuz!'; + var $magic = array(); + var $parameters = array(); + + function getsetting(&$magic) { + $settings = array( + 'num' => array( + 'title' => 'visit_num', + 'type' => 'select', + 'value' => array( + array('5', '5'), + array('10', '10'), + array('20', '20'), + ), + 'default' => '10' + ), + ); + return $settings; + } + + function setsetting(&$magicnew, &$parameters) { + $magicnew['num'] = in_array($parameters['num'], array(5,10,20,50)) ? intval($parameters['num']) : '10'; + } + + function usesubmit() { + global $_G; + + $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10; + $friends = $uids = $fids = array(); + $query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, 500); + foreach($query as $value) { + $value['username'] = $value['fusername']; + $value['uid'] = $value['fuid']; + $uids[] = intval($value['fuid']); + $friends[$value['fuid']] = $value; + } + $count = count($uids); + if(!$count) { + showmessage('magicuse_has_no_valid_friend'); + } elseif($count == 1) { + $fids = array($uids[0]); + } else { + $keys = array_rand($uids, min($num, $count)); + $fids = array(); + foreach ($keys as $key) { + $fids[] = $uids[$key]; + } + } + $users = array(); + foreach($fids as $uid) { + $value = $friends[$uid]; + $value['avatar'] = str_replace("'", "\'", avatar($value['uid'], 'small')); + $users[$uid] = $value; + } + + $inserts = array(); + if($_POST['visitway'] == 'poke') { + $note = ''; + $icon = intval($_POST['visitpoke']); + foreach ($fids as $fid) { + $insertdata = array( + 'uid' => $fid, + 'fromuid' => $_G['uid'], + 'fromusername' => $_G['username'], + 'note' => $note, + 'dateline' => $_G['timestamp'], + 'iconid' => $icon + ); + C::t('home_poke')->insert($insertdata, false, true); + } + $repokeids = array(); + foreach(C::t('home_poke')->fetch_all_by_uid_fromuid($_G['uid'], $fids) as $value) { + $repokeids[] = $value['uid']; + } + $ids = array_diff($fids, $repokeids); + if($ids) { + require_once libfile('function/spacecp'); + $pokemsg = makepokeaction($icon); + $pokenote = array( + 'fromurl' => 'home.php?mod=space&uid='.$_G['uid'], + 'fromusername' => $_G['username'], + 'fromuid' => $_G['uid'], + 'from_id' => $_G['uid'], + 'from_idtype' => 'pokequery', + 'pokemsg' => $pokemsg + ); + foreach($ids as $puid) { + notification_add($puid, 'poke', 'poke_request', $pokenote); + } + } + } elseif($_POST['visitway'] == 'comment') { + $message = getstr($_POST['visitmsg'], 255); + $ip = $_G['clientip']; + $note_inserts = array(); + foreach ($fids as $fid) { + $actor = "{$_G['username']}"; + $inserts[] = array( + 'uid' => $fid, + 'id' => $fid, + 'idtype'=> 'uid', + 'authorid' => $_G['uid'], + 'author' => $_G['username'], + 'ip' => $ip, + 'port' => $_G['remoteport'], + 'dateline' => $_G['timestamp'], + 'message' => $message + ); + $note = lang('spacecp', 'magic_note_wall', array('actor' => $actor, 'url'=>"home.php?mod=space&uid=$fid&do=wall")); + $note_inserts[] = array( + 'uid' => $fid, + 'type' => 'comment', + 'new' => 1, + 'authorid' => $_G['uid'], + 'author' => $_G['username'], + 'note' => $note, + 'dateline' => $_G['timestamp'] + ); + } + foreach($inserts as $insert) { + C::t('home_comment')->insert($insert); + } + foreach($note_inserts as $note_insert) { + C::t('home_notification')->insert($note_insert); + } + C::t('common_member')->increase($fids, array('newprompt' => 1)); + } else { + foreach ($fids as $fid) { + C::t('home_visitor')->insert(array('uid'=>$fid, 'vuid'=>$_G['uid'], 'vusername'=>$_G['username'], 'dateline'=>$_G['timestamp']), false, true); + } + } + usemagic($this->magic['magicid'], $this->magic['num']); + updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']); + + $op = 'show'; + include template('home/magic_visit'); + } + + function show() { + global $_G; + $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10; + magicshowtips(lang('magic/visit', 'visit_info', array('num'=>$num))); + $op = 'use'; + include template('home/magic_visit'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/memory/index.htm b/source/class/memory/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/memory/memory_common_session.php b/source/class/memory/memory_common_session.php new file mode 100644 index 0000000..32c0de3 --- /dev/null +++ b/source/class/memory/memory_common_session.php @@ -0,0 +1,465 @@ +_pre_cache_key = 'common_session_'; + } + + public function fetch($sid, $ip = false, $uid = false) { + if(empty($sid)) { + return array(); + } + $session = $this->get_data_by_pk($sid); + if($session && $ip !== false && $ip != "{$session['ip']}") { + $session = array(); + } + if($session && $uid !== false && $uid != $session['uid']) { + $session = array(); + } + return $session; + } + + public function fetch_member($ismember = 0, $invisible = 0, $start = 0, $limit = 0) { + if ($ismember < 1 || $ismember > 2) $ismember = 0; // $ismember只有0, 1, 2是合法值 + if ($invisible < 1 || $invisible > 2) $invisible = 0; // invisible只有0, 1, 2是合法值 + + list($ss, $ee) = $this->get_start_and_end($start, $limit); + ($invisible == 2) ? $inv_idx = 0 : $inv_idx = 1; // $invisible == 2,相当于sql条件 invisible = 0 + ($ismember == 2) ? $uid_idx = 0 : $uid_idx = 1; // $ismember == 2,相当于sql条件 uid = 0 + + if ($ismember == 0 && $invisible == 0) { + $script = <<_pre_cache_key); + } elseif ($ismember == 0) { + $script = <<_pre_cache_key); + } elseif ($invisible == 0) { + $script = <<_pre_cache_key); + } else { + global $_G; + $temp_uniq = substr(md5(substr(TIMESTAMP, 0, -3).substr($_G['config']['security']['authkey'], 3, -3)), 1, 8); + $script = <<_pre_cache_key); + } + return $this->array_from_memory_result($data); + } + + public function count_invisible($type = 1) { + return memory('zcard', 'idx_invisible_' . $type, $this->_pre_cache_key); + } + + public function count($type = 0) { + switch ($type) { + case 1: + return memory('zcard', 'idx_uid_group_1', $this->_pre_cache_key); + case 2: + return memory('zcard', 'idx_uid_group_0', $this->_pre_cache_key); + default: + return memory('zcard', 'idx_lastactivity', $this->_pre_cache_key); + } + } + + public function delete_by_session($session, $onlinehold, $guestspan) { + if(empty($session) || !is_array($session)) return; + $onlinehold = time() - $onlinehold; + $guestspan = time() - $guestspan; + + global $_G; + $temp_uniq = substr(md5(substr(TIMESTAMP, 0, -3).substr($_G['config']['security']['authkey'], 3, -3)), 1, 8); + $script = << 0) then + redis.call("del", prefix..sid) + rs[#rs + 1] = bysid + end + + -- lastactivity < onlinehold + local byonlinehold = redis.call("ZRANGEBYSCORE", prefix.."idx_lastactivity", 0, onlinehold + 1); + for _, sid in ipairs(byonlinehold) do + local data = getdata(prefix..sid); + if (#data > 0) then + redis.call("del", prefix..sid) + rs[#rs + 1] = data + end + end + + -- uid = 0 and ip = userip + local out_hash = prefix..'uid0_ip_'..out_surfix + redis.call("ZINTERSTORE", out_hash, 2, prefix.."idx_uid_group_0", prefix.."idx_ip_"..userip, 'AGGREGATE', 'MIN') + -- and lastactivity > guestspan + local byguestspan = redis.call("ZRANGEBYSCORE", out_hash, guestspan + 1, '+inf') + for _, sid in ipairs(byguestspan) do + local data = getdata(prefix..sid); + if ((#data > 0)) then + redis.call("del", prefix..sid) + rs[#rs + 1] = data + end + end + redis.call("DEL", out_hash) + + local byuid = redis.call("SMEMBERS", prefix.."idx_uid_"..uid); + for _, sid in ipairs(byuid) do + local data = getdata(prefix..sid); + if (#data > 0) then + redis.call("del", prefix..sid) + rs[#rs + 1] = data + end + end + + for _, row in ipairs(rs) do + redis.call("ZREM", prefix.."idx_ip_"..row[2], row[1]) + redis.call("ZREM", prefix.."idx_invisible_"..row[4], row[1]) + redis.call("ZREM", prefix.."idx_fid_"..row[5], row[1]) + if (row[3] == '0') then + redis.call("ZREM", prefix.."idx_uid_group_0", row[1]) + else + redis.call("ZREM", prefix.."idx_uid_group_1", row[1]) + end + redis.call("ZREM", prefix.."idx_lastactivity", row[1]) + redis.call("SREM", prefix.."idx_uid_"..row[3], row[1]) + end + + return #rs +LUA; + memory('eval', $script, array($session['sid'], $onlinehold, $guestspan, $session['ip'], $session['uid'] ? $session['uid'] : -1, $temp_uniq), "delete_by_session", $this->_pre_cache_key); + } + + public function fetch_by_uid($uid) { + if(empty($uid)) { + return false; + } + + $sids = memory('smembers', 'idx_uid_' . $uid, $this->_pre_cache_key); + foreach ($sids as $sid) { + return $this->get_data_by_pk($sid); + } + return false; + } + + public function fetch_all_by_uid($uids, $start = 0, $limit = 0) { + if(empty($uids)) { + return array(); + } + + if (!is_array($uids)) { + $uids = array($uids); + } + + $script = <<= start) then + local row = redis.call("hmget", prefix..key, "sid", "ip", "uid", "username", "groupid", "invisible", "action", "lastactivity", "lastolupdate", "fid", "tid") + rs[#rs + 1] = row + if (#rs >= limit) then + return rs + end + end + sid_index = sid_index + 1 + end + argv_index = argv_index + 1 + end + return rs +LUA; + list($ss, $ee) = $this->get_start_and_end($start, $limit); + $data = memory('eval', $script, array_merge(array($ss, $ee), $uids), "fetch_all_by_uid", $this->_pre_cache_key); + return $this->array_from_memory_result($data); + } + + public function update_by_uid($uid, $data) { + if(!($uid = dintval($uid)) || empty($data) || !is_array($data)) { + return 0; + } + + $script = <<_pre_cache_key); + $items = $this->array_from_memory_result($r); + + memory('pipeline'); + foreach ($items as $olditem) { + $sid = $olditem['sid']; + $data['sid'] = $sid; // $data中可能没有sid + memory('hmset', $sid, $data, 0, $this->_pre_cache_key); + $this->update_memory_index($sid, $data, $olditem); + } + memory('commit'); + } + + public function update_max_rows($max_rows) { + return TRUE; + } + + public function clear() { + return TRUE; + } + + public function count_by_fid($fid) { + $fid = dintval($fid); + if (!$fid) return 0; + global $_G; + $temp_uniq = substr(md5(substr(TIMESTAMP, 0, -3).substr($_G['config']['security']['authkey'], 3, -3)), 1, 8); + $script = << 0 and fid=fid and invisible = 0 + redis.call("ZINTERSTORE", out_hash, 3, prefix.."idx_uid_group_1", prefix.."idx_fid_"..fid, prefix.."idx_invisible_0", 'AGGREGATE', 'MIN') + local rs = redis.call("ZCARD", out_hash) + redis.call("DEL", out_hash) + return rs +LUA; + $data = memory('eval', $script, array($fid, $temp_uniq), "count_by_fid", $this->_pre_cache_key); + return $data; + } + + public function fetch_all_by_fid($fid, $limit = 12) { + $fid = dintval($fid); + if (!$fid) return array(); + + global $_G; + $temp_uniq = substr(md5(substr(TIMESTAMP, 0, -3).substr($_G['config']['security']['authkey'], 3, -3)), 1, 8); + $script = << 0 and fid=fid and invisible = 0 + redis.call("ZINTERSTORE", out_hash, 3, prefix.."idx_uid_group_1", prefix.."idx_fid_"..fid, prefix.."idx_invisible_0", 'AGGREGATE', 'MIN') + + local keys = redis.call("ZREVRANGE", out_hash, 0, limit - 1) + redis.call("DEL", out_hash) + local rs = {} + for _, key in ipairs(keys) do + local row = redis.call("hmget", prefix..key, "uid", "groupid", "username", "invisible", "lastactivity") + rs[#rs + 1] = row + end + return rs +LUA; + $data = memory('eval', $script, array($fid, $limit, $temp_uniq), "fetch_all_by_fid", $this->_pre_cache_key); + $result = array(); + foreach ($data as $row) { + $item = array(); + $item['uid'] = $row[0]; + $item['groupid'] = $row[1]; + $item['username'] = $row[2]; + $item['invisible'] = $row[3]; + $item['lastactivity'] = $row[4]; + $result[] = $item; + } + return $result; + } + + public function count_by_ip($ip) { + if (empty($ip)) return 0; + return memory('zcard', 'idx_ip_' . $ip, $this->_pre_cache_key); + } + + public function fetch_all_by_ip($ip, $start = 0, $limit = 0) { + if (empty($ip)) return array(); + + list($ss, $ee) = $this->get_start_and_end($start, $limit); + $script = <<_pre_cache_key); + return $this->array_from_memory_result($data); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + $id = $data['sid']; + memory('pipeline'); + memory('hmset', $id, $data, 0, $this->_pre_cache_key); + $this->update_memory_index($id, $data); + memory('commit'); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + $olddata = $this->get_data_by_pk($val); + memory('pipeline'); + memory('hmset', $val, $data, 0, $this->_pre_cache_key); + $this->update_memory_index($val, $data, $olddata); + memory('commit'); + } + + private function update_memory_index($sid, $newdata, $olddata = array()) { + if (!empty($olddata) && !isset($olddata['lastactivity'])) { + return; + } + if (!empty($olddata) && !isset($newdata['lastactivity'])) { + $newdata['lastactivity'] = $olddata['lastactivity']; + } + foreach ($newdata as $col => $value) { + if (!in_array($col, array("ip", "uid", "fid", "lastactivity", "invisible"))) continue; + if (isset($olddata[$col])) { + if ($olddata[$col] === $value && $olddata['lastactivity'] === $newdata['lastactivity']) { + continue; + } + switch ($col) { + case 'ip': + memory('zrem', "idx_ip_" . $olddata[$col], $sid, 0, $this->_pre_cache_key); + break; + case 'lastactivity': + memory('zrem', 'idx_lastactivity', $sid, 0, $this->_pre_cache_key); + break; + case 'fid': + memory('zrem', "idx_fid_" . $olddata[$col], $sid, 0, $this->_pre_cache_key); + break; + case 'invisible': + memory('zrem', "idx_invisible_" . $olddata[$col], $sid, 0, $this->_pre_cache_key); + break; + case 'uid': + memory('zrem', "idx_uid_group_" . ($olddata[$col] == 0 ? '0' : '1'), $sid, 0, $this->_pre_cache_key); + memory('srem', "idx_uid_" . $olddata[$col], $sid, 0, $this->_pre_cache_key); + break; + default: + continue 2; + } + } + switch ($col) { + case 'ip': + case 'fid': + case 'invisible': + memory('zadd', 'idx_' . $col . "_" . $value, $sid, $newdata['lastactivity'], $this->_pre_cache_key); + break; + case 'lastactivity': + memory('zadd', 'idx_lastactivity', $sid, $newdata['lastactivity'], $this->_pre_cache_key); + break; + case 'uid': + memory('zadd', "idx_uid_group_" . ($value == 0 ? '0' : '1'), $sid, $newdata['lastactivity'], $this->_pre_cache_key); + memory('sadd', 'idx_uid_' . $value, $sid, 0, $this->_pre_cache_key); + break; + default: + continue 2; + } + } + } + + private function array_from_memory_result($data) { + $result = array(); + foreach ($data as $row) { + $item = array(); + $item['sid'] = $row[0]; + $item['ip'] = $row[1]; + $item['uid'] = $row[2]; + $item['username'] = $row[3]; + $item['groupid'] = $row[4]; + $item['invisible'] = $row[5]; + $item['action'] = $row[6]; + $item['lastactivity'] = $row[7]; + $item['lastolupdate'] = $row[8]; + $item['fid'] = $row[9]; + $item['tid'] = $row[10]; + $result[] = $item; + } + return $result; + } + + private function get_data_by_pk($sid) { + $data = memory('hgetall', $sid, $this->_pre_cache_key); + return $data; + } + + private function get_start_and_end($start, $limit) { + $limit = intval($limit > 0 ? $limit : 0); + $start = intval($start > 0 ? $start : 0); + if ($start > 0 && $limit > 0) { + return array($start, $start + $limit - 1); + } elseif ($limit > 0) { + return array(0, $limit - 1); + } elseif ($start > 0) { + return array(0, $start - 1); + } else { + return array(0, -1); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/memory/memory_driver_apc.php b/source/class/memory/memory_driver_apc.php new file mode 100644 index 0000000..c696bed --- /dev/null +++ b/source/class/memory/memory_driver_apc.php @@ -0,0 +1,50 @@ +enable = $this->env(); + } + + public function get($key) { + return apc_fetch($key); + } + + public function set($key, $value, $ttl = 0) { + return apc_store($key, $value, $ttl); + } + + public function rm($key) { + return apc_delete($key); + } + + public function clear() { + return apc_clear_cache('user'); + } + + public function inc($key, $step = 1) { + return apc_inc($key, $step) !== false ? apc_fetch($key) : false; + } + + public function dec($key, $step = 1) { + return apc_dec($key, $step) !== false ? apc_fetch($key) : false; + } + +} \ No newline at end of file diff --git a/source/class/memory/memory_driver_apcu.php b/source/class/memory/memory_driver_apcu.php new file mode 100644 index 0000000..42015b0 --- /dev/null +++ b/source/class/memory/memory_driver_apcu.php @@ -0,0 +1,50 @@ +enable = $this->env(); + } + + public function get($key) { + return apcu_fetch($key); + } + + public function set($key, $value, $ttl = 0) { + return apcu_store($key, $value, $ttl); + } + + public function rm($key) { + return apcu_delete($key); + } + + public function clear() { + return apcu_clear_cache(); + } + + public function inc($key, $step = 1) { + return apcu_inc($key, $step) !== false ? apcu_fetch($key) : false; + } + + public function dec($key, $step = 1) { + return apcu_dec($key, $step) !== false ? apcu_fetch($key) : false; + } + +} \ No newline at end of file diff --git a/source/class/memory/memory_driver_eaccelerator.php b/source/class/memory/memory_driver_eaccelerator.php new file mode 100644 index 0000000..850954a --- /dev/null +++ b/source/class/memory/memory_driver_eaccelerator.php @@ -0,0 +1,44 @@ +enable = $this->env(); + } + + public function get($key) { + return eaccelerator_get($key); + } + + public function set($key, $value, $ttl = 0) { + return eaccelerator_put($key, $value, $ttl); + } + + public function rm($key) { + return eaccelerator_rm($key); + } + + public function clear() { + return @eaccelerator_clear(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/memory/memory_driver_file.php b/source/class/memory/memory_driver_file.php new file mode 100644 index 0000000..da69ca5 --- /dev/null +++ b/source/class/memory/memory_driver_file.php @@ -0,0 +1,112 @@ +path = $config['server'].'/'; + if($config['server']) { + $this->enable = is_dir(DISCUZ_ROOT.$this->path); + if(!$this->enable) { + dmkdir(DISCUZ_ROOT.$this->path); + $this->enable = is_dir(DISCUZ_ROOT.$this->path); + } + } else { + $this->enable = false; + } + } + + private function cachefile($key) { + return str_replace('_', '/', $key).'/'.$key; + } + + public function get($key) { + $file = DISCUZ_ROOT.$this->path.$this->cachefile($key).'.php'; + if(!file_exists($file)) { + return false; + } + $data = null; + @include $file; + if($data !== null) { + if($data['exp'] && $data['exp'] < TIMESTAMP) { + return false; + } else { + return $data['data']; + } + } else { + return false; + } + } + + public function set($key, $value, $ttl = 0) { + $file = DISCUZ_ROOT.$this->path.$this->cachefile($key).'.php'; + dmkdir(dirname($file)); + $data = array( + 'exp' => $ttl ? TIMESTAMP + $ttl : 0, + 'data' => $value, + ); + return file_put_contents($file, "path.$this->cachefile($key).'.php'); + } + + private function dir_clear($dir) { + if($directory = @dir($dir)) { + while($entry = $directory->read()) { + $filename = $dir.'/'.$entry; + if($entry != '.' && $entry != '..') { + if(is_file($filename)) { + @unlink($filename); + } else { + $this->dir_clear($filename); + @rmdir($filename); + } + } + } + $directory->close(); + } + } + + public function clear() { + return $this->dir_clear(DISCUZ_ROOT.$this->path); + } + + public function inc($key, $step = 1) { + $old = $this->get($key); + if (!$old) { + return false; + } + return $this->set($key, $old + $step); + } + + public function dec($key, $step = 1) { + $old = $this->get($key); + if (!$old) { + return false; + } + return $this->set($key, $old - $step); + } + + public function exists($key) { + return $this->get($key) !== false; + } +} \ No newline at end of file diff --git a/source/class/memory/memory_driver_memcache.php b/source/class/memory/memory_driver_memcache.php new file mode 100644 index 0000000..ff3ca84 --- /dev/null +++ b/source/class/memory/memory_driver_memcache.php @@ -0,0 +1,83 @@ +env()) { + $this->enable = false; + return; + } + if (!empty($config['server'])) { + $this->obj = new Memcache; + if ($config['pconnect']) { + $connect = @$this->obj->pconnect($config['server'], $config['port']); + } else { + $connect = @$this->obj->connect($config['server'], $config['port']); + } + $this->enable = $connect ? true : false; + } + } + + public function get($key) { + return $this->obj->get($key); + } + + public function getMulti($keys) { + return $this->obj->get($keys); + } + + public function set($key, $value, $ttl = 0) { + return $this->obj->set($key, $value, 0, $ttl); + } + + public function add($key, $value, $ttl = 0) { + return $this->obj->add($key, $value, 0, $ttl); + } + + public function rm($key) { + return $this->obj->delete($key); + } + + public function clear() { + return $this->obj->flush(); + } + + public function inc($key, $step = 1) { + if (!$this->obj->increment($key, $step)) { + $this->set($key, $step); + } + } + + public function incex($key, $step = 1) { + return $this->obj->increment($key, $step); + } + + public function dec($key, $step = 1) { + return $this->obj->decrement($key, $step); + } + + public function exists($key) { + return $this->obj->get($key) !== FALSE; + } + +} + +?> \ No newline at end of file diff --git a/source/class/memory/memory_driver_memcached.php b/source/class/memory/memory_driver_memcached.php new file mode 100644 index 0000000..9861e4f --- /dev/null +++ b/source/class/memory/memory_driver_memcached.php @@ -0,0 +1,81 @@ +env()) { + $this->enable = false; + return; + } + if(!empty($config['server'])) { + $this->obj = new Memcached; + $this->obj->setOption(Memcached::OPT_BINARY_PROTOCOL, true); + $this->obj->setOption(Memcached::OPT_TCP_NODELAY, true); + $this->obj->addServer($config['server'], $config['port']); + $connect=$this->obj->set('connect', '1'); + $this->enable = $connect ? true : false; + } + } + + public function get($key) { + return $this->obj->get($key); + } + + public function getMulti($keys) { + return $this->obj->getMulti($keys); + } + + public function set($key, $value, $ttl = 0) { + return $this->obj->set($key, $value, $ttl); + } + + public function add($key, $value, $ttl = 0) { + return $this->obj->add($key, $value, $ttl); + } + + public function rm($key) { + return $this->obj->delete($key); + } + + public function clear() { + return $this->obj->flush(); + } + + public function inc($key, $step = 1) { + return $this->obj->increment($key, $step, $step); + } + + public function incex($key, $step = 1) { + return $this->obj->increment($key, $step); + } + + public function dec($key, $step = 1) { + return $this->obj->decrement($key, $step); + } + + public function exists($key) { + $this->obj->get($key); + return \Memcached::RES_NOTFOUND !== $this->obj->getResultCode(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/memory/memory_driver_redis.php b/source/class/memory/memory_driver_redis.php new file mode 100644 index 0000000..ba4cd5a --- /dev/null +++ b/source/class/memory/memory_driver_redis.php @@ -0,0 +1,293 @@ +env()) { + $this->enable = false; + return; + } + + if (!empty($config['server'])) { + try { + $this->obj = new Redis(); + if ($config['pconnect']) { + $connect = @$this->obj->pconnect($config['server'], $config['port']); + } else { + $connect = @$this->obj->connect($config['server'], $config['port']); + } + } catch (RedisException $e) { + + } + $this->enable = $connect ? true : false; + if ($this->enable) { + if ($config['requirepass']) { + $this->obj->auth($config['requirepass']); + } + @$this->obj->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE); + $this->select(isset($config['db']) ? $config['db'] : 0); + } + } + } + + function feature($feature) { + switch ($feature) { + case 'set': + case 'hash': + case 'sortedset': + case 'pipeline': + return true; + case 'eval': + $ret = $this->obj->eval("return 1"); + return ($ret === 1); + case 'cluster': + $ret = $this->obj->info("cluster"); + return ($ret['cluster_enabled'] === 1); + default: + return false; + } + } + + public static function &instance() { + static $object; + if (empty($object)) { + $object = new memory_driver_redis(); + $object->init(getglobal('config/memory/redis')); + } + return $object; + } + + function get($key) { + if (is_array($key)) { + return $this->getMulti($key); + } + return $this->_try_deserialize($this->obj->get($key)); + } + + function getMulti($keys) { + $result = $this->obj->mGet($keys); + $newresult = array(); + $index = 0; + foreach ($keys as $key) { + if ($result[$index] !== false) { + $newresult[$key] = $this->_try_deserialize($result[$index]); + } + $index++; + } + unset($result); + return $newresult; + } + + function select($db = 0) { + return $this->obj->select($db); + } + + function set($key, $value, $ttl = 0) { + if (is_array($value)) { + $value = serialize($value); + } + if ($ttl) { + return $this->obj->setex($key, $ttl, $value); + } else { + return $this->obj->set($key, $value); + } + } + + function add($key, $value, $ttl = 0) { + if ($ttl > 0) return $this->obj->set($key, $value, array('nx', 'ex' => $ttl)); + return $this->obj->setnx($key, $value); + } + + function rm($key) { + return $this->obj->del($key); + } + + function setMulti($arr, $ttl = 0) { + if (!is_array($arr)) { + return FALSE; + } + foreach ($arr as $key => $v) { + $this->set($key, $v, $ttl); + } + return TRUE; + } + + function inc($key, $step = 1) { + return $this->obj->incr($key, $step); + } + + function incex($key, $step = 1) { + $script = "if redis.call('exists', ARGV[1]) == 1 then return redis.call('incrby', ARGV[1], ARGV[2]) end"; + return $this->evalscript($script, array($key, $step)); + } + + function dec($key, $step = 1) { + return $this->obj->decr($key, $step); + } + + function getSet($key, $value) { + return $this->obj->getSet($key, $value); + } + + function sadd($key, $value) { + return $this->obj->sAdd($key, $value); + } + + function srem($key, $value) { + return $this->obj->sRem($key, $value); + } + + function smembers($key) { + return $this->obj->sMembers($key); + } + + function sismember($key, $member) { + return $this->obj->sIsMember($key, $member); + } + + function keys($key) { + return $this->obj->keys($key); + } + + function expire($key, $second) { + return $this->obj->expire($key, $second); + } + + function scard($key) { + return $this->obj->sCard($key); + } + + function hSet($key, $field, $value) { + return $this->obj->hSet($key, $field, $value); + } + + function hmset($key, $value) { + return $this->obj->hMSet($key, $value); + } + + function hDel($key, $field) { + return $this->obj->hDel($key, $field); + } + + function hLen($key) { + return $this->obj->hLen($key); + } + + function hVals($key) { + return $this->obj->hVals($key); + } + + function hIncrBy($key, $field, $incr) { + return $this->obj->hIncrBy($key, $field, $incr); + } + + function hgetall($key) { + return $this->obj->hGetAll($key); + } + + function hget($key, $field) { + return $this->obj->hGet($key, $field); + } + + function hexists($key, $field) { + return $this->obj->hExists($key, $field); + } + + function evalscript($script, $argv) { + return $this->obj->eval($script, $argv); + } + + function evalsha($sha, $argv) { + return $this->obj->evalSha($sha, $argv); + } + + function loadscript($script) { + return $this->obj->script('load', $script); + } + + function scriptexists($sha) { + $r = $this->obj->script('exists', $sha); + return $r[0]; + } + + function zadd($key, $member, $score) { + return $this->obj->zAdd($key, $score, $member); + } + + function zrem($key, $member) { + return $this->obj->zRem($key, $member); + } + + function zscore($key, $member) { + return $this->obj->zScore($key, $member); + } + + function zcard($key) { + return $this->obj->zCard($key); + } + + function zrevrange($key, $start, $end, $withscore = false) { + return $this->obj->zRevRange($key, $start, $end, $withscore); + } + + function zincrby($key, $member, $value) { + return $this->obj->zIncrBy($key, $value, $member); + } + + function sort($key, $opt) { + return $this->obj->sort($key, $opt); + } + + function exists($key) { + return $this->obj->exists($key); + } + + function clear() { + return $this->obj->flushDb(); + } + + function pipeline() { + return $this->obj->multi(Redis::PIPELINE); + } + + function commit() { + return $this->obj->exec(); + } + + function discard() { + return $this->obj->discard(); + } + + private function _try_deserialize($data) { + try { + $ret = dunserialize($data); + if ($ret === FALSE) { + return $data; + } + return $ret; + } catch (Exception $e) { + } + return $data; + } + +} + +?> \ No newline at end of file diff --git a/source/class/memory/memory_driver_wincache.php b/source/class/memory/memory_driver_wincache.php new file mode 100644 index 0000000..1e74cc5 --- /dev/null +++ b/source/class/memory/memory_driver_wincache.php @@ -0,0 +1,54 @@ +enable = $this->env(); + } + + public function get($key) { + return wincache_ucache_get($key); + } + + public function getMulti($keys) { + return wincache_ucache_get($keys); + } + + public function set($key, $value, $ttl = 0) { + return wincache_ucache_set($key, $value, $ttl); + } + + public function rm($key) { + return wincache_ucache_delete($key); + } + + public function clear() { + return wincache_ucache_clear(); + } + + public function inc($key, $step = 1) { + return wincache_ucache_inc($key, $step); + } + + public function dec($key, $step = 1) { + return wincache_ucache_dec($key, $step); + } + +} \ No newline at end of file diff --git a/source/class/memory/memory_driver_xcache.php b/source/class/memory/memory_driver_xcache.php new file mode 100644 index 0000000..f1e77bd --- /dev/null +++ b/source/class/memory/memory_driver_xcache.php @@ -0,0 +1,50 @@ +enable = $this->env(); + } + + public function get($key) { + return xcache_get($key); + } + + public function set($key, $value, $ttl = 0) { + return xcache_set($key, $value, $ttl); + } + + public function rm($key) { + return xcache_unset($key); + } + + public function clear() { + return xcache_clear_cache(XC_TYPE_VAR, 0); + } + + public function inc($key, $step = 1) { + return xcache_inc($key, $step); + } + + public function dec($key, $step = 1) { + return xcache_dec($key, $step); + } + +} \ No newline at end of file diff --git a/source/class/memory/memory_driver_yac.php b/source/class/memory/memory_driver_yac.php new file mode 100644 index 0000000..f6b77fa --- /dev/null +++ b/source/class/memory/memory_driver_yac.php @@ -0,0 +1,72 @@ +enable = $this->env(); + if ($this->enable) { + $this->object = new yac(); + } + } + + public function get($key) { + return $this->object->get($key); + } + + public function getMulti($keys) { + $result = $this->object->get($keys); + foreach ($result as $key => $value) { + if ($value === false) { + unset($result[$key]); + } + } + return $result; + } + + public function set($key, $value, $ttl = 0) { + return $this->object->set($key, $value, $ttl); + } + + public function rm($key) { + return $this->object->delete($key); + } + + public function clear() { + return $this->object->flush(); + } + + public function inc($key, $step = 1) { + $old = $this->get($key); + if (!$old) { + return false; + } + return $this->set($key, $old + $step); + } + + public function dec($key, $step = 1) { + $old = $this->get($key); + if (!$old) { + return false; + } + return $this->set($key, $old - $step); + } + +} \ No newline at end of file diff --git a/source/class/memory/memory_setting_array.php b/source/class/memory/memory_setting_array.php new file mode 100644 index 0000000..76fae7f --- /dev/null +++ b/source/class/memory/memory_setting_array.php @@ -0,0 +1,139 @@ + array( + 'memory', 'ipaccess', 'mobile', 'domain', 'timeoffset', 'dateformat', 'timeformat', 'bbclosed', + 'topicperpage', 'postperpage', 'nocacheheaders', 'seokeywords', 'seodescription', 'forumpicstyle', + 'rssstatus', 'plugins', 'hookscript', 'pluginhooks', 'bbname', 'seotitle', 'indexhot', 'collectionstatus', + 'grid', 'dateconvert', 'moddisplay', 'whosonlinestatus', 'oltimespan', 'maxonlinelist', 'seohead', + 'version', 'showusercard', 'disallowfloat', 'creditnotice', 'creditnames', 'jspath', 'csspath', + 'portalstatus', 'navs', 'groupstatus', 'feedstatus', 'archiver', 'switchwidthauto', 'shortcut', 'topnavs', + 'mynavs', 'showfjump', 'advtype', 'navmns', 'navdms', 'navmn', 'navlogos', 'avatarmethod', 'ucenterurl', + 'connect', 'taskstatus', 'menunavs', 'subnavs', 'search', 'blogstatus', 'albumstatus', 'srchhotkeywords', + 'forumallowside', 'focus', 'site_qq', 'footernavs', 'siteurl', 'sitename', 'icp', 'statcode', 'debug', + 'boardlicensed', 'followstatus', 'disableipnotice', 'rewritestatus', 'ftp', 'visitbanperiods', 'dynavt', + 'cacheindexlife', 'whosonline_contract', 'regname', 'reglinkname', 'autoidselect', 'avatarurl', 'avatarpath', + 'uidlogin', 'secmobilelogin', 'forumstatus', 'friendstatus', 'guidestatus', 'favoritestatus', 'mps', 'mpsid' + ), + 'forumdisplay_fields' => array( + 'group_admingroupids', 'followforumid', 'targetblank', 'allowmoderatingthread', 'threadmaxpages', + 'globalstick', 'recommendthread', 'heatthread', 'verify', 'visitedforums', 'fastpost', 'seccodedata', + 'secqaa', 'creditstransextra', 'extcredits', 'threadplugins', 'leftsidewidth', 'forumseparator', + 'forumdisplaythreadpreview', 'closeforumorderby', 'minpostsize', 'maxpostsize', 'fastsmilies', 'smcols', + 'allowreplybg', 'newbiespan', 'minpostsize_mobile', 'minsubjectsize', 'maxsubjectsize', + ), + 'viewthread_fields' => array( + 'optimizeviews', 'antitheft', 'cachethreadlife', 'close_leftinfo', 'close_leftinfo_userctrl', + 'creditspolicy', 'modratelimit', 'showsettings', 'preventrefresh', 'infosidestatus', + 'threadhotreplies', 'nofilteredpost', 'threadblacklist', 'threadguestlite', 'threadfilternum', + 'ratelogrecord', 'commentnumber', 'sigviewcond', 'lazyload', 'allowattachurl', 'relatedlinkstatus', + 'numbercard', 'repliesrank', 'vtonlinestatus', 'alloweditpost', 'zoomstatus', 'imagemaxwidth', + 'bannedmessages', 'authoronleft', 'profilenode', 'magicstatus', 'starthreshold', 'allowfastreply', + 'sharestatus', 'globalsightml', 'need_avatar', 'need_secmobile', 'need_email', 'need_friendnum' + ) + ); + + public function __construct() + { + $this->can_lazy = C::memory()->goteval && C::memory()->gothash; + if (!$this->can_lazy) { + $this->array = memory('get', self::SETTING_KEY); + foreach ($this->array as $key => $value) { + if ($value !== null && $value !== '') { + $unserializedValue = dunserialize($value); + if ($unserializedValue !== false) { + $this->array[$key] = $unserializedValue; + } + } + } + } + } + + public function offsetExists($index) + { + if (!array_key_exists($index, $this->array)) { + return memory('hexists', self::SETTING_KEY, $index); + } + return true; + } + + public function &offsetGet($index) + { + $val = $this->array[$index]; + if ($val === null && $this->can_lazy) { + foreach (self::FIELDS_GROUPS as $group => $fields) { + if (in_array($index, $fields)) { + $this->_load_fields($fields, 'setting_' . $group); + $val = $this->array[$index]; + break; + } + } + if ($val === null) { + $data = memory('hget', self::SETTING_KEY, $index); + $val = dunserialize($data); + $this->offsetSet($index, $val); + } + } + $ret = & $this->array[$index]; + return $ret; + } + + public function offsetSet($index, $newval) + { + if ($newval === null || $newval === false) $newval = Array(); + $this->array[$index] = $newval; + } + + public function offsetUnset($index) + { + unset($this->array[$index]); + } + + public static function save($data) + { + $can_lazy = C::memory()->goteval && C::memory()->gothash; + if ($can_lazy) { + $newdata = array(); + foreach ($data as $key => $value) { + $newdata[$key] = serialize($value); + } + memory('hmset', self::SETTING_KEY, $newdata); + } else { + memory('set', self::SETTING_KEY, $data);//memcached不支持key为array + } + } + + private function _load_fields($fields, $shakey) + { + $data = memory('eval', false, array(), $shakey); + if (!$data) { + $array_def = "local fields = {" . array_reduce($fields, function($carry, $item) { + return $carry . '"' . $item . '",'; + }) . "} "; + $script = << $field) { + $this->offsetSet($field, dunserialize($data[$index])); + } + } + +} \ No newline at end of file diff --git a/source/class/model/index.htm b/source/class/model/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/model/model_forum_post.php b/source/class/model/model_forum_post.php new file mode 100644 index 0000000..85d2d65 --- /dev/null +++ b/source/class/model/model_forum_post.php @@ -0,0 +1,626 @@ +post = get_post_by_tid_pid($tid, $pid); + } + } + $this->forum = &$this->app->var['forum']; + $this->thread = &$this->app->var['thread']; + $this->group = &$this->app->var['group']; + } + + protected function _init_parameters($parameters) { + $varname = array( + 'member', 'group', 'forum', 'thread', 'extramessage', 'special',//'nauthorid' 'modnewreplies' 'tid' + 'message','clientip', 'invisible', 'isanonymous', 'usesig', + 'htmlon', 'bbcodeoff', 'smileyoff', 'parseurloff', 'pstatus', + 'noticetrimstr', 'noticeauthor', 'from', 'sechash', 'geoloc', + 'timestamp', + + 'subject', 'special', 'sortid', 'typeid', 'isanonymous', 'cronpublish', 'cronpublishdate', 'save', + 'readperm', 'price', 'ordertype', 'hiddenreplies', 'allownoticeauthor', 'audit', 'tags', 'bbcodeoff', 'imgcontent', 'imgcontentwidth', + 'smileyoff', 'parseurloff', 'usesig', 'htmlon', 'extramessage', + + ); + foreach($varname as $name) { + if(!isset($this->param[$name]) && isset($parameters[$name])) { + $this->param[$name] = $parameters[$name]; + } + } + + } + + public function newreply($parameters) { + + $this->_init_parameters($parameters); + + if($this->thread['closed'] && !$this->forum['ismoderator'] && !$this->thread['isgroup']) { + return $this->showmessage('post_thread_closed'); + } elseif(!$this->thread['isgroup'] && $post_autoclose = checkautoclose($this->thread)) { + return $this->showmessage($post_autoclose, '', array('autoclose' => $this->forum['autoclose'])); + } if(trim($this->param['subject']) == '' && trim($this->param['message']) == '' && $this->thread['special'] != 2) { + return $this->showmessage('post_sm_isnull'); + } elseif($post_invalid = checkpost($this->param['subject'], $this->param['message'], $this->param['special'] == 2 && $this->group['allowposttrade'])) { + return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize'])); + } elseif(checkflood()) { + return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl'])); + } elseif(checkmaxperhour('pid')) { + return $this->showmessage('post_flood_ctrl_posts_per_hour', '', array('posts_per_hour' => $this->group['maxpostsperhour'])); + } elseif($this->thread['displayorder'] == -4 && !$this->group['allowsavereply']) { + return $this->showmessage('post_not_allow_reply_save'); + } + + + $heatthreadset = update_threadpartake($this->thread['tid'], true); + + + $bbcodeoff = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff'])); + $smileyoff = checksmilies($this->param['message'], !empty($this->param['smileyoff'])); + $parseurloff = !empty($this->param['parseurloff']); + $htmlon = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0; + $usesig = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0; + + $this->param['isanonymous'] = $this->group['allowanonymous'] && !empty($this->param['isanonymous'])? 1 : 0; + $author = empty($this->param['isanonymous']) ? $this->member['username'] : ''; + + list(, $this->param['modnewreplies']) = threadmodstatus($this->param['subject']."\t".$this->param['message'].$this->param['extramessage']); + + if($this->thread['displayorder'] == -4) { + $this->param['modnewreplies'] = 0; + } + $pinvisible = $this->param['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0); + $this->param['message'] = preg_replace('/\[attachimg\](\d+)\[\/attachimg\]/is', '[attach]\1[/attach]', $this->param['message']); + + + if(!empty($this->param['noticetrimstr'])) { + $this->param['message'] = $this->param['noticetrimstr']."\n\n".$this->param['message']; + $bbcodeoff = false; + } + + $status = (defined('IN_MOBILE') ? 8 : 0); + + if($this->param['modstatus']) { + foreach($this->param['modstatus'] as $modbit => $modvalue) { + $status = setstatus($modbit, $modvalue, $status); + } + } + + $this->pid = insertpost(array( + 'fid' => $this->forum['fid'], + 'tid' => $this->thread['tid'], + 'first' => '0', + 'author' => $this->member['username'], + 'authorid' => $this->member['uid'], + 'subject' => $this->param['subject'], + 'dateline' => $this->param['timestamp'] ? $this->param['timestamp'] : getglobal('timestamp'), + 'message' => $this->param['message'], + 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), + 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), + 'invisible' => $pinvisible, + 'anonymous' => $this->param['isanonymous'], + 'usesig' => $usesig, + 'htmlon' => $htmlon, + 'bbcodeoff' => $bbcodeoff, + 'smileyoff' => $smileyoff, + 'parseurloff' => $parseurloff, + 'attachment' => '0', + 'status' => $status, + )); + + + $this->param['updatethreaddata'] = $heatthreadset ? $heatthreadset : array(); + $this->param['maxposition'] = C::t('forum_post')->fetch_maxposition_by_tid($this->thread['posttableid'], $this->thread['tid']); + $this->param['updatethreaddata'][] = DB::field('maxposition', $this->param['maxposition']); + + + useractionlog($this->member['uid'], 'pid'); + + if($this->param['geoloc'] && defined('IN_MOBILE') && constant('IN_MOBILE') == 2) { + list($mapx, $mapy, $location) = explode('|', $this->param['geoloc']); + if($mapx && $mapy && $location) { + C::t('forum_post_location')->insert(array( + 'pid' => $this->pid, + 'tid' => $this->thread['tid'], + 'uid' => $this->member['uid'], + 'mapx' => $mapx, + 'mapy' => $mapy, + 'location' => $location, + )); + } + } + + $nauthorid = 0; + if(!empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) { + list($ac, $nauthorid) = explode('|', authcode($this->param['noticeauthor'], 'DECODE')); + if($nauthorid != $this->member['uid']) { + if($ac == 'q') { + notification_add($nauthorid, 'post', 'reppost_noticeauthor', array( + 'tid' => $this->thread['tid'], + 'subject' => $this->thread['subject'], + 'fid' => $this->forum['fid'], + 'pid' => $this->pid, + 'from_id' => $this->pid, + 'from_idtype' => 'quote', + )); + } elseif($ac == 'r') { + notification_add($nauthorid, 'post', 'reppost_noticeauthor', array( + 'tid' => $this->thread['tid'], + 'subject' => $this->thread['subject'], + 'fid' => $this->forum['fid'], + 'pid' => $this->pid, + 'from_id' => $this->thread['tid'], + 'from_idtype' => 'post', + )); + } + } + + } + + if($this->thread['authorid'] != $this->member['uid'] && getstatus($this->thread['status'], 6) && empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) { + $thapost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid'], 0); + notification_add($thapost['authorid'], 'post', 'reppost_noticeauthor', array( + 'tid' => $this->thread['tid'], + 'subject' => $this->thread['subject'], + 'fid' => $this->forum['fid'], + 'pid' => $this->pid, + 'from_id' => $this->thread['tid'], + 'from_idtype' => 'post', + )); + } + + + $this->forum['threadcaches'] && deletethreadcaches($this->thread['tid']); + + include_once libfile('function/stat'); + updatestat($this->thread['isgroup'] ? 'grouppost' : 'post'); + + + $this->param['showmsgparam']['fid'] = $this->forum['fid']; + $this->param['showmsgparam']['tid'] = $this->thread['tid']; + $this->param['showmsgparam']['pid'] = $this->pid; + $this->param['showmsgparam']['from'] = $this->param['from']; + $this->param['showmsgparam']['sechash'] = !empty($this->param['sechash']) ? $this->param['sechash'] : ''; + + + dsetcookie('clearUserdata', 'forum'); + + if($this->param['modnewreplies']) { + updatemoderate('pid', $this->pid); + $this->param['showmsgparam']['reply_mod'] = 1; + if($this->param['updatethreaddata']) { + C::t('forum_thread')->update($this->thread['tid'], $this->param['updatethreaddata'], false, false, 0, true); + } + C::t('forum_forum')->update_forum_counter($this->forum['fid'], 0, 0, 1, 1); + + + manage_addnotify('verifypost'); + + + return 'post_reply_mod_succeed'; + + } else { + + $fieldarr = array( + 'lastposter' => array($author), + 'replies' => 1 + ); + if($this->thread['lastpost'] < getglobal('timestamp')) { + $fieldarr['lastpost'] = array(getglobal('timestamp')); + } + $row = C::t('forum_threadaddviews')->fetch($this->thread['tid']); + if(!empty($row)) { + C::t('forum_threadaddviews')->update($this->thread['tid'], array('addviews' => 0)); + $fieldarr['views'] = $row['addviews']; + } + $this->param['updatethreaddata'] = array_merge($this->param['updatethreaddata'], C::t('forum_thread')->increase($this->thread['tid'], $fieldarr, false, 0, true)); + if($this->thread['displayorder'] != -4) { + updatepostcredits('+', $this->member['uid'], 'reply', $this->forum['fid']); + if($this->forum['status'] == 3) { + if($this->forum['closed'] > 1) { + C::t('forum_thread')->increase($this->forum['closed'], $fieldarr, true); + } + C::t('forum_groupuser')->update_counter_for_user($this->member['uid'], $this->forum['fid'], 0, 1); + C::t('forum_forumfield')->update($this->forum['fid'], array('lastupdate' => TIMESTAMP)); + require_once libfile('function/grouplog'); + updategroupcreditlog($this->forum['fid'], $this->member['uid']); + } + + $subject = cutstr($this->thread['subject'], 80); + $lastpost = $this->thread['tid']."\t".$subject."\t".getglobal('timestamp')."\t".$author; + C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost)); + C::t('forum_forum')->update_forum_counter($this->forum['fid'], 0, 1, 1); + if($this->forum['type'] == 'sub') { + C::t('forum_forum')->update($this->forum['fup'], array('lastpost' => $lastpost)); + } + } + + + $this->param['page'] = getstatus($this->thread['status'], 4) ? 1 : @ceil(($this->thread['special'] ? $this->thread['replies'] + 1 : $this->thread['replies'] + 2) / getglobal('ppp')); + + if($this->param['updatethreaddata']) { + C::t('forum_thread')->update($this->thread['tid'], $this->param['updatethreaddata'], false, false, 0, true); + } + + + + + return 'post_reply_succeed'; + } + } + + public function replyfeed() { + if(!$this->feed) { + if($this->forum['allowfeed'] && !$this->param['isanonymous']) { + if($this->thread['authorid'] != $this->member['uid']) { + $post_url = "forum.php?mod=redirect&goto=findpost&pid=".$this->pid."&ptid=".$this->thread['tid']; + + $this->feed['icon'] = 'post'; + $this->feed['title_template'] = !empty($this->thread['author']) ? 'feed_reply_title' : 'feed_reply_title_anonymous'; + $this->feed['title_data'] = array( + 'subject' => "".$this->thread['subject']."", + 'author' => "thread['authorid']."\">".$this->thread['author']."" + ); + $forum_attachexist = getglobal('forum_attachexist'); + if(!empty($forum_attachexist)) { + $imgattach = C::t('forum_attachment_n')->fetch_max_image('tid:'.$this->thread['tid'], 'pid', $this->pid); + $firstaid = $imgattach['aid']; + unset($imgattach); + if($firstaid) { + $this->feed['images'] = array(getforumimg($firstaid)); + $this->feed['image_links'] = array($post_url); + } + } + } + } + } + + $this->feed['title_data']['hash_data'] = "tid".$this->thread['tid']; + $this->feed['id'] = $this->pid; + $this->feed['idtype'] = 'pid'; + if($this->feed['icon']) { + postfeed($this->feed); + } + } + + public function thread($name = null, $val = null) { + if(isset($val)) { + return $this->setvar($this->thread, $name, $val); + } else { + return $this->getvar($this->thread, $name); + } + } + + public function forum($name = null, $val = null) { + if(isset($val)) { + return $this->setvar($this->forum, $name, $val); + } else { + return $this->getvar($this->forum, $name); + } + } + + public function editpost($parameters) { + + $this->_init_parameters($parameters); + $isfirstpost = $this->post['first'] ? 1 : 0; + $isorigauthor = $this->member['uid'] && $this->member['uid'] == $this->post['authorid']; + $this->param['audit'] = $this->post['invisible'] == -2 || $this->thread['displayorder'] == -2 ? $this->param['audit'] : 0; + + list($this->param['modnewthreads'], $this->param['modnewreplies']) = threadmodstatus($this->param['subject']."\t".$this->param['message'].$this->param['extramessage']); + + if($post_invalid = checkpost($this->param['subject'], $this->param['message'], $isfirstpost && ($this->param['special'] || $this->param['sortid']))) { + showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize'])); + } + if(!$isorigauthor && !$this->group['allowanonymous']) { + if($this->post['anonymous'] && !$this->param['isanonymous']) { + $this->param['isanonymous'] = 0; + $this->param['threadupdatearr']['author'] = $this->post['author']; + $anonymousadd = 0; + } else { + $this->param['isanonymous'] = $this->post['anonymous']; + $anonymousadd = ''; + } + } else { + $this->param['threadupdatearr']['author'] = $this->param['isanonymous'] ? '' : $this->post['author']; + $anonymousadd = $this->param['isanonymous']; + } + + if($isfirstpost) { + if(trim($this->param['subject']) == '' && $this->thread['special'] != 2) { + showmessage('post_sm_isnull'); + } + + if(!$this->param['sortid'] && !$this->thread['special'] && trim($this->param['message']) == '') { + showmessage('post_sm_isnull'); + } + + + $publishdate = null; + if ($this->group['allowsetpublishdate'] && $this->thread['displayorder'] == -4) { + $cron_publish_ids = $this->cache('cronpublish'); + if (!$this->param['cronpublish'] && in_array($this->thread['tid'], $cron_publish_ids) || $this->param['modnewthreads']) { + $this->param['threadupdatearr']['dateline'] = $publishdate = TIMESTAMP; + unset($cron_publish_ids[$this->thread['tid']]); + savecache('cronpublish', $cron_publish_ids); + } elseif ($this->param['cronpublish'] && $this->param['cronpublishdate']) { + $this->param['threadupdatearr']['dateline'] = $publishdate = strtotime($this->param['cronpublishdate']); + $this->param['save'] = 1; + if (!in_array($this->thread['tid'], $cron_publish_ids)) { + $cron_publish_ids[$this->thread['tid']] = $this->thread['tid']; + savecache('cronpublish', $cron_publish_ids); + } + } + } + + + + $this->param['readperm'] = $this->group['allowsetreadperm'] ? intval($this->param['readperm']) : ($isorigauthor ? $this->thread['readperm'] : 'ignore'); + if($this->thread['special'] != 3) { + $this->param['price'] = intval($this->param['price']); + $this->param['price'] = $this->thread['price'] < 0 && !$this->thread['special'] + ?($isorigauthor || !$this->param['price'] ? -1 : $this->param['price']) + :($this->group['maxprice'] ? ($this->param['price'] <= $this->group['maxprice'] ? ($this->param['price'] > 0 ? $this->param['price'] : 0) : $this->group['maxprice']) : ($isorigauthor ? $this->param['price'] : $this->thread['price'])); + + if($this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) { + return $this->showmessage('post_net_price_iszero'); + } + } + + $this->thread['status'] = setstatus(4, $this->param['ordertype'], $this->thread['status']); + $this->thread['status'] = setstatus(15, $this->param['imgcontent'], $this->thread['status']); + if($this->param['imgcontent']) { + stringtopic($this->param['message'], $this->post['tid'], true, $this->param['imgcontentwidth']); + } + + $this->thread['status'] = setstatus(2, $this->param['hiddenreplies'], $this->thread['status']); + + $this->thread['status'] = setstatus(6, $this->param['allownoticeauthor'] ? 1 : 0, $this->thread['status']); + + $displayorder = (empty($this->param['save']) || $this->thread['displayorder'] != -4 ) ? ($this->thread['displayorder'] == -4 ? -4 : $this->thread['displayorder']) : -4; + $this->param['typeid'] = isset($this->param['typeid']) && isset($this->forum['threadtypes']['types'][$this->param['typeid']]) && (!$this->forum['threadtypes']['moderators'][$this->param['typeid']] || $this->forum['ismoderator']) ? $this->param['typeid'] : 0; + $this->param['sortid'] = $this->param['special'] || !$this->forum['threadsorts']['types'][$this->param['sortid']] ? 0 : $this->param['sortid']; + + + $this->param['threadupdatearr']['typeid'] = $this->param['typeid']; + $this->param['threadupdatearr']['sortid'] = $this->param['sortid']; + $this->param['threadupdatearr']['subject'] = $this->param['subject']; + if($this->param['readperm'] !== 'ignore') { + $this->param['threadupdatearr']['readperm'] = $this->param['readperm']; + } + $this->param['threadupdatearr']['price'] = $this->param['price']; + $this->param['threadupdatearr']['status'] = $this->thread['status']; + if(getglobal('forum_auditstatuson') && $this->param['audit'] == 1) { + $this->param['threadupdatearr']['displayorder'] = 0; + $this->param['threadupdatearr']['moderated'] = 1; + } else { + $this->param['threadupdatearr']['displayorder'] = $displayorder; + } + C::t('forum_thread')->update($this->thread['tid'], $this->param['threadupdatearr'], true); + + if($this->thread['tid'] > 1) { + if($this->thread['closed'] > 1) { + C::t('forum_thread')->update($this->thread['closed'], array('subject' => $this->param['subject']), true); + } elseif(empty($this->thread['isgroup'])) { + $threadclosed = C::t('forum_threadclosed')->fetch($this->thread['tid']); + if($threadclosed['redirect']) { + C::t('forum_thread')->update($threadclosed['redirect'], array('subject' => $this->param['subject']), true); + } + } + } + $class_tag = new tag(); + $tagstr = $class_tag->update_field($this->param['tags'], $this->thread['tid'], 'tid', $this->thread); + + } else { + if($this->param['subject'] == '' && $this->param['message'] == '' && $this->thread['special'] != 2) { + showmessage('post_sm_isnull'); + } + } + + + $this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0; + + if($this->setting['editedby'] && (TIMESTAMP - $this->post['dateline']) > 60 && $this->member['adminid'] != 1) { + $editor = $this->param['isanonymous'] && $isorigauthor ? lang('forum/misc', 'anonymous') : $this->member['username']; + $edittime = dgmdate(TIMESTAMP); + $this->param['message'] = lang('forum/misc', $this->param['htmlon'] ? 'post_edithtml' : (!$this->forum['allowbbcode'] || $this->param['bbcodeoff'] ? 'post_editnobbcode' : 'post_edit'), array('editor' => $editor, 'edittime' => $edittime)) . $this->param['message']; + } + + + $this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff'])); + $this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff'])); + $tagoff = $isfirstpost ? !empty($tagoff) : 0; + + + if(getglobal('forum_auditstatuson') && $this->param['audit'] == 1) { + if(getstatus($this->post['status'], 3) == 0) { + C::t('forum_post')->update_post($this->thread['posttableid'], $this->post['pid'], array('status' => 4), false, false, null, -2, null, 0); + updatepostcredits('+', $this->post['authorid'], ($isfirstpost ? 'post' : 'reply'), $this->forum['fid']); + } + if(!$isfirstpost) { + C::t('forum_thread')->increase($this->thread['tid'], array('replies' => 1)); + } + updatemodworks('MOD', 1); + updatemodlog($this->thread['tid'], 'MOD'); + } + + $displayorder = $pinvisible = 0; + if($isfirstpost) { + $displayorder = $this->param['modnewthreads'] ? -2 : $this->thread['displayorder']; + $pinvisible = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3); + } else { + $pinvisible = $this->param['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0); + } + + $this->param['message'] = preg_replace('/\[attachimg\](\d+)\[\/attachimg\]/is', '[attach]\1[/attach]', $this->param['message']); + $this->param['parseurloff'] = !empty($this->param['parseurloff']); + $setarr = array( + 'message' => $this->param['message'], + 'usesig' => $this->param['usesig'], + 'htmlon' => $this->param['htmlon'], + 'bbcodeoff' => $this->param['bbcodeoff'], + 'parseurloff' => $this->param['parseurloff'], + 'smileyoff' => $this->param['smileyoff'], + 'subject' => $this->param['subject'], + 'tags' => $tagstr, + 'port'=>getglobal('remoteport') + ); + + $setarr['status'] = $this->post['status']; + if($this->param['modstatus']) { + foreach($this->param['modstatus'] as $modbit => $modvalue) { + $setarr['status'] = setstatus($modbit, $modvalue, $setarr['status']); + } + } + + if($anonymousadd !== '') { + $setarr['anonymous'] = $anonymousadd; + } + if($publishdate) { + $setarr['dateline'] = $publishdate; + } + if(getglobal('forum_auditstatuson') && $this->param['audit'] == 1) { + $setarr['invisible'] = 0; + } else { + $setarr['invisible'] = $pinvisible; + } + C::t('forum_post')->update_post('tid:'.$this->thread['tid'], $this->post['pid'], $setarr); + + + + $this->forum['lastpost'] = explode("\t", $this->forum['lastpost']); + + if($this->post['dateline'] == $this->forum['lastpost'][2] && ($this->post['author'] == $this->forum['lastpost'][3] || ($this->forum['lastpost'][3] == '' && $this->post['anonymous']))) { + $subject = $isfirstpost ? cutstr($this->param['subject'], 80) : cutstr($this->thread['subject'], 80); + $lastpost = $this->thread['tid']."\t".$subject."\t".$this->post['dateline']."\t".($this->param['isanonymous'] ? '' : $this->post['author']); + C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost)); + + } + + if(!getglobal('forum_auditstatuson') || $this->param['audit'] != 1) { + if($isfirstpost && $this->param['modnewthreads']) { + C::t('forum_thread')->update($this->thread['tid'], array('displayorder' => -2)); + manage_addnotify('verifythread'); + } elseif(!$isfirstpost && $this->param['modnewreplies']) { + C::t('forum_thread')->increase($this->thread['tid'], array('replies' => -1)); + manage_addnotify('verifypost'); + } + if($this->param['modnewreplies'] || $this->param['modnewthreads']) { + C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1')); + } + } + + + if($this->thread['lastpost'] == $this->post['dateline'] && ((!$this->post['anonymous'] && $this->thread['lastposter'] == $this->post['author']) || ($this->post['anonymous'] && $this->thread['lastposter'] == '')) && $this->post['anonymous'] != $this->param['isanonymous']) { + C::t('forum_thread')->update($this->thread['tid'], array('lastposter' => $this->param['isanonymous'] ? '' : $this->post['author']), true); + } + + if(!$isorigauthor) { + updatemodworks('EDT', 1); + require_once libfile('function/misc'); + modlog($this->thread, 'EDT'); + } + + if($isfirstpost && $this->thread['displayorder'] == -4 && empty($this->param['save'])) { + threadpubsave($this->thread['tid']); + } + } + + public function deletepost($parameters) { + + $this->_init_parameters($parameters); + if(!$this->setting['editperdel']) { + return $this->showmessage('post_edit_thread_ban_del', NULL); + } + + $isfirstpost = $this->post['first'] ? 1 : 0; + + if($isfirstpost && $this->thread['replies'] > 0) { + return $this->showmessage(($this->thread['special'] == 3 ? 'post_edit_reward_already_reply' : 'post_edit_thread_already_reply'), NULL); + } + + + if($this->thread['displayorder'] >= 0) { + updatepostcredits('-', $this->post['authorid'], ($isfirstpost ? 'post' : 'reply'), $this->forum['fid']); + } + + + if(!$this->param['handlereplycredit']) { + if(!$isfirstpost && !$this->param['isanonymous']) { + $postreplycredit = C::t('forum_post')->fetch_post('tid:'.$this->thread['tid'], $this->post['pid']); + $postreplycredit = $postreplycredit['replycredit']; + if($postreplycredit) { + C::t('forum_post')->update_post('tid:'.$this->thread['tid'], $this->post['pid'], array('replycredit' => 0)); + updatemembercount($this->post['authorid'], array($replycredit_rule['extcreditstype'] => '-'.$postreplycredit)); + } + } + } + + + C::t('forum_post')->delete_post('tid:'.$this->thread['tid'], $this->post['pid']); + + + $forumcounter = array(); + if($isfirstpost) { + $forumcounter['threads'] = $forumcounter['posts'] = -1; + $tablearray = array('forum_relatedthread', 'forum_debate', 'forum_debatepost', 'forum_polloption', 'forum_poll'); + foreach ($tablearray as $table) { + C::t($table)->delete_by_tid($this->thread['tid']); + } + C::t('forum_thread')->delete_by_tid($this->thread['tid']); + C::t('common_moderate')->delete_moderate($this->thread['tid'], 'tid'); + C::t('forum_threadmod')->delete_by_tid($this->thread['tid']); + if($this->setting['globalstick'] && in_array($this->thread['displayorder'], array(2, 3))) { + require_once libfile('function/cache'); + updatecache('globalstick'); + } + } else { + $forumcounter['posts'] = -1; + $lastpost = C::t('forum_post')->fetch_visiblepost_by_tid('tid:'.$this->thread['tid'], $this->thread['tid'], 0, 1); + $lastpost['author'] = !$lastpost['anonymous'] ? addslashes($lastpost['author']) : ''; + + $this->param['updatefieldarr']['replies'] = -1; + $this->param['updatefieldarr']['lastposter'] = array($lastpost['author']); + $this->param['updatefieldarr']['lastpost'] = array($lastpost['dateline']); + + C::t('forum_thread')->increase($this->thread['tid'], $this->param['updatefieldarr']); + } + + $this->forum['lastpost'] = explode("\t", $this->forum['lastpost']); + if($this->post['dateline'] == $this->forum['lastpost'][2] && ($this->post['author'] == $this->forum['lastpost'][3] || ($this->forum['lastpost'][3] == '' && $this->post['anonymous']))) { + $lastthread = C::t('forum_thread')->fetch_by_fid_displayorder($this->forum['fid']); + C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => "{$lastthread['tid']}\t{$lastthread['subject']}\t{$lastthread['lastpost']}\t{$lastthread['lastposter']}")); + } + C::t('forum_forum')->update_forum_counter($this->forum['fid'], $forumcounter['threads'], $forumcounter['posts']); + + } + +} +?> \ No newline at end of file diff --git a/source/class/model/model_forum_thread.php b/source/class/model/model_forum_thread.php new file mode 100644 index 0000000..645a51a --- /dev/null +++ b/source/class/model/model_forum_thread.php @@ -0,0 +1,351 @@ +forum = &$this->app->var['forum']; + } + + public function newthread($parameters) { + + require_once libfile('function/post'); + $this->tid = $this->pid = 0; + $this->_init_parameters($parameters); + + if(!empty($this->param['save']) && !$this->group['allowsave']) { + return $this->showmessage('post_not_allow_save'); + } + + if(trim($this->param['subject']) == '') { + return $this->showmessage('post_sm_isnull'); + } + + if(!$this->param['sortid'] && !$this->param['special'] && trim($this->param['message']) == '') { + return $this->showmessage('post_sm_isnull'); + } + list($this->param['modnewthreads'], $this->param['modnewreplies']) = threadmodstatus($this->param['subject']."\t".$this->param['message'].$this->param['extramessage']); + + if(($post_invalid = checkpost($this->param['subject'], $this->param['message'], ($this->param['special'] || $this->param['sortid'])))) { + return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize'])); + } + + if(checkflood()) { + return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl'])); + } elseif(checkmaxperhour('tid')) { + return $this->showmessage('thread_flood_ctrl_threads_per_hour', '', array('threads_per_hour' => $this->group['maxthreadsperhour'])); + } + $this->param['save'] = $this->member['uid'] ? $this->param['save'] : 0; + + $this->param['typeid'] = isset($this->param['typeid']) && isset($this->forum['threadtypes']['types'][$this->param['typeid']]) && (!$this->forum['threadtypes']['moderators'][$this->param['typeid']] || $this->forum['ismoderator']) ? $this->param['typeid'] : 0; + + $this->param['displayorder'] = $this->param['modnewthreads'] ? -2 : (($this->forum['ismoderator'] && $this->group['allowstickthread'] && !empty($this->param['sticktopic'])) ? 1 : (empty($this->param['save']) ? 0 : -4)); + if($this->param['displayorder'] == -2) { + C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1')); + } elseif($this->param['displayorder'] == -4 && !empty($this->group['allowsavenum']) && C::t('forum_thread')->count_by_authorid_displayorder($this->member['uid'], -4) >= intval($this->group['allowsavenum'])) { + return $this->showmessage('post_max_save'); + } + + $this->param['digest'] = $this->forum['ismoderator'] && $this->group['allowdigestthread'] && !empty($this->param['digest']) ? 1 : 0; + $this->param['readperm'] = $this->group['allowsetreadperm'] ? $this->param['readperm'] : 0; + $this->param['isanonymous'] = $this->group['allowanonymous'] && $this->param['isanonymous'] ? 1 : 0; + $this->param['price'] = intval($this->param['price']); + if(!$this->param['special']) { + $this->param['price'] = $this->group['maxprice'] ? ($this->param['price'] <= $this->group['maxprice'] ? $this->param['price'] : $this->group['maxprice']) : 0; + } + + if(!$this->param['typeid'] && !empty($this->forum['threadtypes']['required']) && !$this->param['special']) { + return $this->showmessage('post_type_isnull'); + } + + if(!$this->param['sortid'] && !empty($this->forum['threadsorts']['required']) && !$this->param['special']) { + return $this->showmessage('post_sort_isnull'); + } + + if(!$this->param['special'] && $this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) { + return $this->showmessage('post_net_price_iszero'); + } + + + $this->param['sortid'] = $this->param['special'] || !$this->forum['threadsorts']['types'][$this->param['sortid']] ? 0 : $this->param['sortid']; + $this->param['typeexpiration'] = intval($this->param['typeexpiration']); + + if(!empty($this->forum['threadsorts']['expiration'][$this->param['typeid']]) && !$this->param['typeexpiration']) { + return $this->showmessage('threadtype_expiration_invalid'); + } + + $author = !$this->param['isanonymous'] ? $this->member['username'] : ''; + + $this->param['moderated'] = $this->param['digest'] || $this->param['displayorder'] > 0 ? 1 : 0; + + + $this->param['ordertype'] && $this->param['tstatus'] = setstatus(4, 1, $this->param['tstatus']); + + $this->param['imgcontent'] && $this->param['tstatus'] = setstatus(15, $this->param['imgcontent'], $this->param['tstatus']); + + $this->param['hiddenreplies'] && $this->param['tstatus'] = setstatus(2, 1, $this->param['tstatus']); + + + $this->param['allownoticeauthor'] && $this->param['tstatus'] = setstatus(6, 1, $this->param['tstatus']); + $this->param['isgroup'] = $this->forum['status'] == 3 ? 1 : 0; + + $this->param['publishdate'] = !$this->param['modnewthreads'] ? $this->param['publishdate'] : TIMESTAMP; + + $newthread = array( + 'fid' => $this->forum['fid'], + 'posttableid' => 0, + 'readperm' => $this->param['readperm'], + 'price' => $this->param['price'], + 'typeid' => $this->param['typeid'], + 'sortid' => $this->param['sortid'], + 'author' => $author, + 'authorid' => $this->member['uid'], + 'subject' => $this->param['subject'], + 'dateline' => $this->param['publishdate'], + 'lastpost' => $this->param['publishdate'], + 'lastposter' => $author, + 'displayorder' => $this->param['displayorder'], + 'digest' => $this->param['digest'], + 'special' => $this->param['special'], + 'attachment' => 0, + 'moderated' => $this->param['moderated'], + 'status' => $this->param['tstatus'], + 'isgroup' => $this->param['isgroup'], + 'replycredit' => $this->param['replycredit'], + 'closed' => $this->param['closed'] ? 1 : 0 + ); + $this->tid = C::t('forum_thread')->insert($newthread, true); + C::t('forum_newthread')->insert(array( + 'tid' => $this->tid, + 'fid' => $this->forum['fid'], + 'dateline' => $this->param['publishdate'], + )); + C::t('forum_sofa')->insert(array('tid' => $this->tid,'fid' => $this->forum['fid'])); + useractionlog($this->member['uid'], 'tid'); + + if(!getuserprofile('threads') && $this->setting['newbie']) { + C::t('forum_thread')->update($this->tid, array('icon' => $this->setting['newbie'])); + } + if ($this->param['publishdate'] != TIMESTAMP) { + $cron_publish_ids = $this->cache('cronpublish'); + $cron_publish_ids[$this->tid] = $this->tid; + savecache('cronpublish', $cron_publish_ids); + } + + if(!$this->param['isanonymous']) { + C::t('common_member_field_home')->update($this->member['uid'], array('recentnote'=>$this->param['subject'])); + } + + if($this->param['moderated']) { + if($this->param['displayorder'] > 0) { + updatemodlog($this->tid, 'STK'); + updatemodworks('STK', 1); + } + if($this->param['digest']) { + updatemodlog($this->tid, 'DIG'); + updatemodworks('DIG', 1); + } + } + + $this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff'])); + $this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff'])); + $this->param['parseurloff'] = !empty($this->param['parseurloff']); + $this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0; + $this->param['usesig'] = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0; + $class_tag = new tag(); + $this->param['tagstr'] = $class_tag->add_tag($this->param['tags'], $this->tid, 'tid'); + + + $this->param['pinvisible'] = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3); + $this->param['message'] = preg_replace('/\[attachimg\](\d+)\[\/attachimg\]/is', '[attach]\1[/attach]', $this->param['message']); + + $this->param['pstatus'] = intval($this->param['pstatus']); + defined('IN_MOBILE') && $this->param['pstatus'] = setstatus(4, 1, $this->param['pstatus']); + + if($this->param['imgcontent']) { + stringtopic($this->param['message'], $this->tid, true, $this->param['imgcontentwidth']); + } + $this->pid = insertpost(array( + 'fid' => $this->forum['fid'], + 'tid' => $this->tid, + 'first' => '1', + 'author' => $this->member['username'], + 'authorid' => $this->member['uid'], + 'subject' => $this->param['subject'], + 'dateline' => $this->param['publishdate'], + 'message' => $this->param['message'], + 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), + 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), + 'invisible' => $this->param['pinvisible'], + 'anonymous' => $this->param['isanonymous'], + 'usesig' => $this->param['usesig'], + 'htmlon' => $this->param['htmlon'], + 'bbcodeoff' => $this->param['bbcodeoff'], + 'smileyoff' => $this->param['smileyoff'], + 'parseurloff' => $this->param['parseurloff'], + 'attachment' => '0', + 'tags' => $this->param['tagstr'], + 'replycredit' => 0, + 'status' => $this->param['pstatus'] + )); + + $statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread'); + include_once libfile('function/stat'); + updatestat($this->param['isgroup'] ? 'groupthread' : $statarr[$this->param['special']]); + + + if($this->param['geoloc'] && defined('IN_MOBILE') && constant('IN_MOBILE') == 2) { + list($mapx, $mapy, $location) = explode('|', $this->param['geoloc']); + if($mapx && $mapy && $location) { + C::t('forum_post_location')->insert(array( + 'pid' => $this->pid, + 'tid' => $this->tid, + 'uid' => $this->member['uid'], + 'mapx' => $mapx, + 'mapy' => $mapy, + 'location' => $location, + )); + } + } + + if($this->param['modnewthreads']) { + updatemoderate('tid', $this->tid); + C::t('forum_forum')->update_forum_counter($this->forum['fid'], 0, 0, 1); + manage_addnotify('verifythread'); + return 'post_newthread_mod_succeed'; + } else { + + if($this->param['displayorder'] != -4) { + if($this->param['digest']) { + updatepostcredits('+', $this->member['uid'], 'digest', $this->forum['fid']); + } + updatepostcredits('+', $this->member['uid'], 'post', $this->forum['fid']); + if($this->param['isgroup']) { + C::t('forum_groupuser')->update_counter_for_user($this->member['uid'], $this->forum['fid'], 1); + } + + $subject = str_replace("\t", ' ', $this->param['subject']); + $subject = cutstr($subject, 80); + $lastpost = "$this->tid\t".$subject."\t".TIMESTAMP."\t$author"; + C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost)); + C::t('forum_forum')->update_forum_counter($this->forum['fid'], 1, 1, 1); + if($this->forum['type'] == 'sub') { + C::t('forum_forum')->update($this->forum['fup'], array('lastpost' => $lastpost)); + } + } + + if($this->param['isgroup']) { + C::t('forum_forumfield')->update($this->forum['fid'], array('lastupdate' => TIMESTAMP)); + require_once libfile('function/grouplog'); + updategroupcreditlog($this->forum['fid'], $this->member['uid']); + } + + return 'post_newthread_succeed'; + + } + + } + + public function feed() { + if($this->forum('allowfeed') && !$this->param['isanonymous']) { + if(empty($this->feed)) { + $this->feed = array( + 'icon' => '', + 'title_template' => '', + 'title_data' => array(), + 'body_template' => '', + 'body_data' => array(), + 'title_data' => array(), + 'images' => array() + ); + + $message = !$this->param['price'] && !$this->param['readperm'] ? $this->param['message'] : ''; + $message = messagesafeclear($message); + $this->feed['icon'] = 'thread'; + $this->feed['title_template'] = 'feed_thread_title'; + $this->feed['body_template'] = 'feed_thread_message'; + $this->feed['body_data'] = array( + 'subject' => "tid}\">{$this->param['subject']}", + 'message' => threadmessagecutstr($this->param, $message, 150) + ); + if(getglobal('forum_attachexist')) {// $firstaid = DB::result_first("SELECT aid FROM ".DB::table(getattachtablebytid($tid))." WHERE pid='$pid' AND dateline>'0' AND isimage='1' ORDER BY dateline LIMIT 1"); + $imgattach = C::t('forum_attachment_n')->fetch_max_image('tid:'.$this->tid, 'pid', $this->pid); + $firstaid = $imgattach['aid']; + unset($imgattach); + if($firstaid) { + $this->feed['images'] = array(getforumimg($firstaid)); + $this->feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$this->tid}&pid={$this->pid}"); + } + } + + } + + + $this->feed['title_data']['hash_data'] = 'tid'.$this->tid; + $this->feed['id'] = $this->tid; + $this->feed['idtype'] = 'tid'; + if($this->feed['icon']) { + postfeed($this->feed); + } + } + } + protected function _init_parameters($parameters){ + + $varname = array( + 'member', 'group', 'forum', 'extramessage', + 'subject', 'sticktopic', 'save', 'ordertype', 'hiddenreplies', + 'allownoticeauthor', 'readperm', 'price', 'typeid', 'sortid', + 'publishdate', 'digest', 'moderated', 'tstatus', 'isgroup', 'imgcontent', 'imgcontentwidth', + 'replycredit', 'closed', 'special', 'tags', + 'message','clientip', 'invisible', 'isanonymous', 'usesig', + 'htmlon', 'bbcodeoff', 'smileyoff', 'parseurloff', 'pstatus', 'geoloc', + ); + foreach($varname as $name) { + if(!isset($this->param[$name])) { + $this->param[$name] = isset($parameters[$name]) ? $parameters[$name] : NULL; + } + } + + } + + + public function forum($name = null, $val = null) { + if(isset($val)) { + return $this->setvar($this->forum, $name, $val); + } else { + return $this->getvar($this->forum, $name); + } + } + + +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/index.htm b/source/class/optimizer/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/class/optimizer/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/class/optimizer/optimizer_aggid.php b/source/class/optimizer/optimizer_aggid.php new file mode 100644 index 0000000..ac6b658 --- /dev/null +++ b/source/class/optimizer/optimizer_aggid.php @@ -0,0 +1,43 @@ +fetch_all(array(1, 2, 3)); + foreach($aggid as $group) { + if($group['forcelogin'] != 1) { + $flag = false; + break; + } + } + if(!$flag) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_aggid_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_aggid_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=accountguard'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_attachexpire.php b/source/class/optimizer/optimizer_attachexpire.php new file mode 100644 index 0000000..0d6ac99 --- /dev/null +++ b/source/class/optimizer/optimizer_attachexpire.php @@ -0,0 +1,37 @@ +fetch_setting('attachexpire'); + $remoteftp = C::t('common_setting')->fetch_setting('ftp', true); + if(!$attachexpire || ($remoteftp['on'] == 1 && !$remoteftp['hideurl'])) { + $return = array('status' => 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_attachexpire_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_attachexpire_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=attach'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_attachrefcheck.php b/source/class/optimizer/optimizer_attachrefcheck.php new file mode 100644 index 0000000..546fa1a --- /dev/null +++ b/source/class/optimizer/optimizer_attachrefcheck.php @@ -0,0 +1,36 @@ +fetch_setting('attachrefcheck'); + if(!$attachrefcheck) { + $return = array('status' => 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_attachrefcheck_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_attachrefcheck_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=attach'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_dbbackup.php b/source/class/optimizer/optimizer_dbbackup.php new file mode 100644 index 0000000..eb1c1f7 --- /dev/null +++ b/source/class/optimizer/optimizer_dbbackup.php @@ -0,0 +1,40 @@ +fetch('db_export'); + $dateline = dunserialize($dateline['cachevalue']); + $dateline = $dateline['dateline']; + if(($_G['timestamp'] - $dateline) > 86400 * 90) { + $return = array('status' => 1, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_dbbackup_advice')); + } else { + $return = array('status' => 0, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_dbbackup_lastback').dgmdate($dateline)); + } + return $return; + } + + public function optimizer() { + global $_G; + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=db&operation=export'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_dbbackup_clean.php b/source/class/optimizer/optimizer_dbbackup_clean.php new file mode 100644 index 0000000..05e06ff --- /dev/null +++ b/source/class/optimizer/optimizer_dbbackup_clean.php @@ -0,0 +1,96 @@ +check_exportfile($exportlog, $exportziplog, $exportsize, $filecount); + if(!$filecount) { + $return = array('status' => 0, 'type' => 'none', 'lang' => lang('optimizer', 'optimizer_dbbackup_clean_safe')); + } else { + $return = array('status' => 1, 'type' => 'notice', 'lang' => lang('optimizer', 'optimizer_dbbackup_clean_delete', array('filecount' => $filecount))); + } + return $return; + } + + function get_backup_dir() { + + $backupdirs = array(); + $dir = dir(DISCUZ_ROOT.'./data'); + while(($file = $dir->read()) !== FALSE) { + if(filetype(DISCUZ_ROOT.'./data/'.$file) == 'dir' && preg_match('/^backup_\w+/', $file)) { + $backupdirs[] = $file; + } + } + $dir->close(); + return $backupdirs; + } + + function check_exportfile(&$exportlog, &$exportziplog, &$exportsize, &$filecount) { + + $backupdirs = $this->get_backup_dir(); + if(empty($backupdirs)) { + return; + } + + $filecount = 0; + foreach($backupdirs as $backupdir) { + $dir = dir(DISCUZ_ROOT.'./data/'.$backupdir); + while($entry = $dir->read()) { + $entry = DISCUZ_ROOT.'./data/'.$backupdir.'/'.$entry; + if(is_file($entry)) { + if(preg_match("/\.sql$/i", $entry)) { + $filesize = filesize($entry); + $fp = fopen($entry, 'rb'); + $identify = explode(',', base64_decode(preg_replace("/^# Identify:\s*(\w+).*/s", "\\1", fgets($fp, 256)))); + fclose($fp); + $key = preg_replace('/^(.+?)(\-\d+)\.sql$/i', '\\1', basename($entry)); + $exportlog[$key][$identify[4]] = array( + 'version' => $identify[1], + 'type' => $identify[2], + 'method' => $identify[3], + 'volume' => $identify[4], + 'tablepre' => $identify[5], + 'dbcharset' => $identify[6], + 'filename' => str_replace(DISCUZ_ROOT, '', $entry), + 'dateline' => filemtime($entry), + 'size' => $filesize + ); + $filecount++; + $exportsize[$key] += $filesize; + } elseif(preg_match("/\.zip$/i", $entry)) { + $key = preg_replace('/^(.+?)(\-\d+)\.zip$/i', '\\1', basename($entry)); + $filesize = filesize($entry); + $exportziplog[$key][] = array( + 'type' => 'zip', + 'filename' => str_replace(DISCUZ_ROOT, '', $entry), + 'size' => $filesize, + 'dateline' => filemtime($entry) + ); + $filecount++; + } + } + } + $dir->close(); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_dbbackup_visit.php b/source/class/optimizer/optimizer_dbbackup_visit.php new file mode 100644 index 0000000..7c2b477 --- /dev/null +++ b/source/class/optimizer/optimizer_dbbackup_visit.php @@ -0,0 +1,102 @@ +check_exportfile($exportlog, $exportziplog, $exportsize, $filecount); + if(!$filecount) { + $return = array('status' => 0, 'type' => 'none', 'lang' => lang('optimizer', 'optimizer_dbbackup_visit_safe')); + } else { + $return = array('status' => 1, 'type' => 'notice', 'lang' => lang('optimizer', 'optimizer_dbbackup_visit_delete', array('filecount' => $filecount))); + } + return $return; + } + + function get_backup_dir() { + + $backupdirs = array(); + $dir = dir(DISCUZ_ROOT.'./data'); + while(($file = $dir->read()) !== FALSE) { + if(filetype(DISCUZ_ROOT.'./data/'.$file) == 'dir' && preg_match('/^backup_\w+/', $file)) { + $backupdirs[] = $file; + } + } + $dir->close(); + return $backupdirs; + } + + function check_exportfile(&$exportlog, &$exportziplog, &$exportsize, &$filecount) { + + $backupdirs = $this->get_backup_dir(); + if(empty($backupdirs)) { + return; + } + + $filecount = 0; + foreach($backupdirs as $backupdir) { + $dir = dir(DISCUZ_ROOT.'./data/'.$backupdir); + while($entry = $dir->read()) { + $entry = DISCUZ_ROOT.'./data/'.$backupdir.'/'.$entry; + if(is_file($entry)) { + if(preg_match("/\.sql$/i", $entry)) { + $filesize = filesize($entry); + $fp = fopen($entry, 'rb'); + $identify = explode(',', base64_decode(preg_replace("/^# Identify:\s*(\w+).*/s", "\\1", fgets($fp, 256)))); + fclose($fp); + $key = preg_replace('/^(.+?)(\-\d+)\.sql$/i', '\\1', basename($entry)); + $exportlog[$key][$identify[4]] = array( + 'version' => $identify[1], + 'type' => $identify[2], + 'method' => $identify[3], + 'volume' => $identify[4], + 'tablepre' => $identify[5], + 'dbcharset' => $identify[6], + 'filename' => str_replace(DISCUZ_ROOT, '', $entry), + 'dateline' => filemtime($entry), + 'size' => $filesize + ); + $testurl = str_replace(DISCUZ_ROOT.'./data/', getglobal('siteurl').'data/', $entry); + $content = dfsockopen($testurl); + if(!empty($content)) { + $filecount++; + $exportsize[$key] += $filesize; + } + } elseif(preg_match("/\.zip$/i", $entry)) { + $key = preg_replace('/^(.+?)(\-\d+)\.zip$/i', '\\1', basename($entry)); + $filesize = filesize($entry); + $exportziplog[$key][] = array( + 'type' => 'zip', + 'filename' => str_replace(DISCUZ_ROOT, '', $entry), + 'size' => $filesize, + 'dateline' => filemtime($entry) + ); + $testurl = str_replace(DISCUZ_ROOT.'./data/', getglobal('siteurl').'data/', $entry); + $content = dfsockopen($testurl); + if(!empty($content)) { + $filecount++; + } + } + } + } + $dir->close(); + } + } +} \ No newline at end of file diff --git a/source/class/optimizer/optimizer_dos8p3.php b/source/class/optimizer/optimizer_dos8p3.php new file mode 100644 index 0000000..b5c092a --- /dev/null +++ b/source/class/optimizer/optimizer_dos8p3.php @@ -0,0 +1,43 @@ + 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_dos8p3_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_dos8p3_no_need')); + } + return $return; + } + + public function optimizer() { + cpmsg('optimizer_dos8p3_optimizer', '', 'error'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_editperdel.php b/source/class/optimizer/optimizer_editperdel.php new file mode 100644 index 0000000..cb63722 --- /dev/null +++ b/source/class/optimizer/optimizer_editperdel.php @@ -0,0 +1,36 @@ +fetch_setting('editperdel'); + if($editperdel) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_editperdel_no_need')); + } else { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_editperdel_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=permissions'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_emailregister.php b/source/class/optimizer/optimizer_emailregister.php new file mode 100644 index 0000000..e46c223 --- /dev/null +++ b/source/class/optimizer/optimizer_emailregister.php @@ -0,0 +1,41 @@ +fetch_setting('sendregisterurl'); + if($sendregister) { + $return = array('status' => 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_emailregister_normal'), 'extraurl' => '&checkemail=1'); + } else { + $return = array('status' => 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_emailregister_tip')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + if($_GET['checkemail']) { + $url = '?action=setting&operation=mail'; + } else { + $url = '?action=setting&operation=access'; + } + dheader('Location: '.$_G['siteurl'].$adminfile.$url); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_filecheck.php b/source/class/optimizer/optimizer_filecheck.php new file mode 100644 index 0000000..992ddb4 --- /dev/null +++ b/source/class/optimizer/optimizer_filecheck.php @@ -0,0 +1,40 @@ +fetch('checktools_filecheck'); + $dateline = dunserialize($dateline['cachevalue']); + $dateline = $dateline['dateline']; + if(($_G['timestamp'] - $dateline) > 86400 * 90) { + $return = array('status' => 1, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_filecheck_advice')); + } else { + $return = array('status' => 0, 'type' => 'none', 'lang' => lang('optimizer', 'optimizer_filecheck_lastcheck').dgmdate($dateline)); + } + return $return; + } + + public function optimizer() { + global $_G; + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=checktools&operation=filecheck'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_filesafe.php b/source/class/optimizer/optimizer_filesafe.php new file mode 100644 index 0000000..03b5916 --- /dev/null +++ b/source/class/optimizer/optimizer_filesafe.php @@ -0,0 +1,46 @@ + 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_filesafe_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_filesafe_no_need')); + } + return $return; + } + + public function optimizer() { + @unlink(DISCUZ_ROOT.'/install/index.php'); + @unlink(DISCUZ_ROOT.'/uc_server/install/index.php'); + @unlink(DISCUZ_ROOT.'/ucenter/install/index.php'); + @unlink(DISCUZ_ROOT.'/data/restore.php'); + if(strcmp(ADMINSCRIPT, 'admin.php') !== 0 && file_exists(DISCUZ_ROOT.'/admin.php')) { + @unlink(DISCUZ_ROOT.'/admin.php'); + } + cpmsg('optimizer_filesafe_optimizer', '', 'error'); + } +} \ No newline at end of file diff --git a/source/class/optimizer/optimizer_forumstatus.php b/source/class/optimizer/optimizer_forumstatus.php new file mode 100644 index 0000000..4e60c14 --- /dev/null +++ b/source/class/optimizer/optimizer_forumstatus.php @@ -0,0 +1,67 @@ +fetch_all_by_status(0, 0); + if(empty($forumlist)) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_forumstatus_no_need')); + } else { + $fids = array(); + foreach($forumlist as $forum) { + $fids[] = $forum['fid']; + } + $forumfieldlist = C::t('forum_forumfield')->fetch_all_by_fid($fids); + $forumdesc = ''; + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + $k = 1; + foreach($forumlist as $forum) { + if(!$forumfieldlist[$forum['fid']]['password'] || !$forumfieldlist[$forum['fid']]['formulaperm']) { + $forumdesc .= '

    2 ? 'style="display:none;"' : '').'>'.$forum['name'].'

    '; + } + if($k == 3) { + $forumdesc .= '

    '.lang('admincp', 'more').'

    '; + } + $k++; + } + $extraurl = ''; + if(count($forumlist) == 1) { + $extraurl = '&optimizefid='.$forum['fid']; + $forumdesc = ''; + } + if(!$forumdesc) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_forumstatus_no_need')); + } else { + $return = array('status' => 1, 'type' =>'view', 'lang' => lang('optimizer', 'optimizer_forumstatus_need', array('forumdesc' => $forumdesc)), 'extraurl' => $extraurl); + } + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + if($_GET['optimizefid']) { + $url = '?action=forums&operation=edit&fid='.dintval($_GET['optimizefid']); + } else { + $url = '?action=forums'; + } + dheader('Location: '.$_G['siteurl'].$adminfile.$url); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_httphost.php b/source/class/optimizer/optimizer_httphost.php new file mode 100644 index 0000000..a42f400 --- /dev/null +++ b/source/class/optimizer/optimizer_httphost.php @@ -0,0 +1,44 @@ + 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_httphost_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_httphost_no_need')); + } + return $return; + } + + public function optimizer() { + cpmsg('optimizer_httphost_optimizer', '', 'error'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_inviteregister.php b/source/class/optimizer/optimizer_inviteregister.php new file mode 100644 index 0000000..d625bb4 --- /dev/null +++ b/source/class/optimizer/optimizer_inviteregister.php @@ -0,0 +1,41 @@ +fetch_setting('regstatus'); + if($regstatus >= 2) { + $inviteconfig = C::t('common_setting')->fetch_setting('inviteconfig', true); + if(!$inviteconfig['inviteareawhite']) { + $return = array('status' => 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_inviteregister_tip')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_iniviteregister_normal')); + } + } else { + $return = array('status' => 2, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_iniviteregister_normal')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=access'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_ipregctrl.php b/source/class/optimizer/optimizer_ipregctrl.php new file mode 100644 index 0000000..de493ab --- /dev/null +++ b/source/class/optimizer/optimizer_ipregctrl.php @@ -0,0 +1,36 @@ +fetch_setting('ipregctrl'); + if($ipregctrl) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_ipregctrl_no_need')); + } else { + $return = array('status' => 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_ipregctrl_tip')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=access'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_log.php b/source/class/optimizer/optimizer_log.php new file mode 100644 index 0000000..f3611c2 --- /dev/null +++ b/source/class/optimizer/optimizer_log.php @@ -0,0 +1,87 @@ +table = array( + 'common_magiclog' => + array( 'tablename' => 'common_magiclog', + 'splitvalue' => $_G['timestamp'] - '365', + 'splitfield' => 'dateline', + 'splitglue' => '<', + ), + 'common_card_log' => + array('tablename' => 'common_card_log', + 'splitvalue' => $_G['timestamp'] - '86400 * 365', + 'splitfield' => 'dateline', + 'splitglue' => '<', + ), + ); + } + + public function mergetable($tablename) { + return C::t($tablename)->merge_table(); + } + + public function check() { + $count = 0; + foreach($this->table as $table) { + $wheresql = $table['splitfield'].$table['splitglue'].$table['splitvalue']; + if(C::t($table['tablename'])->split_check($wheresql)) { + $count++; + } + } + if($count) { + return array('status' => '1','type' => 'view', 'lang' => lang('optimizer', 'optimizer_log_clean', array('count' => $count))); + } else { + return array('status' => '0', 'type' => 'view', 'lang' => lang('optimizer', 'optimizer_log_not_found')); + } + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=optimizer&operation=log_optimizer&type=optimizer_log'); + } + + public function get_option() { + $return = array(); + foreach($this->table as $table) { + $wheresql = $table['splitfield'].$table['splitglue'].$table['splitvalue']; + if(C::t($table['tablename'])->split_check($wheresql)) { + $status = C::t($table['tablename'])->tablestatus; + $return[] = array( + 'tablename' => $table['tablename'], + 'name' => $status['Name'], + 'rows' => $status['Rows'], + 'moverows' => $status['Move_rows'], + 'data_length' => $status['Data_length'], + 'index_length' => $status['Index_length'], + 'create_time' => $status['Create_time'], + ); + } + } + return $return; + } + + public function option_optimizer($tablename) { + $table = $this->table[$tablename]; + $wheresql = $table['splitfield'].$table['splitglue'].$table['splitvalue']; + return C::t($tablename)->split_table($wheresql); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_loginoutofdate.php b/source/class/optimizer/optimizer_loginoutofdate.php new file mode 100644 index 0000000..7da173d --- /dev/null +++ b/source/class/optimizer/optimizer_loginoutofdate.php @@ -0,0 +1,36 @@ +fetch_setting('accountguard', true); + if(!$accountguard['loginoutofdate']) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_loginoutofdate_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_loginoutofdate_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=accountguard'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_loginpwcheck.php b/source/class/optimizer/optimizer_loginpwcheck.php new file mode 100644 index 0000000..3b2da70 --- /dev/null +++ b/source/class/optimizer/optimizer_loginpwcheck.php @@ -0,0 +1,36 @@ +fetch_setting('accountguard', true); + if(!$accountguard['loginpwcheck']) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_loginpwcheck_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_loginpwcheck_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=accountguard'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_newbiespan.php b/source/class/optimizer/optimizer_newbiespan.php new file mode 100644 index 0000000..593f5cb --- /dev/null +++ b/source/class/optimizer/optimizer_newbiespan.php @@ -0,0 +1,36 @@ +fetch_setting('newbiespan'); + if($newbiespan) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_newbiespan_no_need')); + } else { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_newbiespan_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=access'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_plugin.php b/source/class/optimizer/optimizer_plugin.php new file mode 100644 index 0000000..b4bfcb1 --- /dev/null +++ b/source/class/optimizer/optimizer_plugin.php @@ -0,0 +1,55 @@ +fetch_all_data(); + $addonids = array(); + foreach($pluginarray as $row) { + if(ispluginkey($row['identifier'])) { + $addonids[] = $row['identifier'].'.plugin'; + } + } + $checkresult = dunserialize(cloudaddons_upgradecheck($addonids)); + savecache('addoncheck_plugin', $checkresult); + $newversion = 0; + foreach($checkresult as $value) { + list(, $newver) = explode(':', $value); + if($newver) { + $newversion++; + } + } + + if($newversion) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_plugin_new_plugin', array('newversion' => $newversion))); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_plugin_no_upgrade')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.getglobal('siteurl').$adminfile.'?action=plugins'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_post.php b/source/class/optimizer/optimizer_post.php new file mode 100644 index 0000000..dbd7ec6 --- /dev/null +++ b/source/class/optimizer/optimizer_post.php @@ -0,0 +1,49 @@ + 400 * 1048576) { + $count++; + } + } + } + if($count) { + $return = array('status' => '1','type' => 'header', 'lang' => lang('optimizer', 'optimizer_post_need_split', array('count' => $count))); + } else { + $return = array('status' => '0', 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_post_not_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=postsplit'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_postqqonly.php b/source/class/optimizer/optimizer_postqqonly.php new file mode 100644 index 0000000..ca5a55c --- /dev/null +++ b/source/class/optimizer/optimizer_postqqonly.php @@ -0,0 +1,36 @@ +fetch_setting('accountguard', true); + if(!$accountguard['postqqonly']) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_postqqonly_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_postqqonly_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=accountguard'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_pwlength.php b/source/class/optimizer/optimizer_pwlength.php new file mode 100644 index 0000000..a798398 --- /dev/null +++ b/source/class/optimizer/optimizer_pwlength.php @@ -0,0 +1,36 @@ +fetch_setting('pwlength'); + if($pwlength < 6) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_pwlength_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_pwlength_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=access'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_recyclebin.php b/source/class/optimizer/optimizer_recyclebin.php new file mode 100644 index 0000000..69bf283 --- /dev/null +++ b/source/class/optimizer/optimizer_recyclebin.php @@ -0,0 +1,56 @@ +fetch_all_by_recyclebin(); + if(empty($forumlist)) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_recyclebin_no_need')); + } else { + $forumdesc = ''; + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + $k = 1; + foreach($forumlist as $forum) { + $forumdesc .= '

    2 ? 'style="display:none;"' : '').'>'.$forum['name'].'

    '; + if($k == 3) { + $forumdesc .= '

    '.lang('admincp', 'more').'

    '; + } + $k++; + } + $extraurl = ''; + if(count($forumlist) == 1) { + $extraurl = '&optimizefid='.$forum['fid']; + $forumdesc = ''; + } + $return = array('status' => 1, 'type' =>'view', 'lang' => lang('optimizer', 'optimizer_recyclebin_need', array('forumdesc' => $forumdesc)), 'extraurl' => $extraurl); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + if($_GET['optimizefid']) { + $url = '?action=forums&operation=edit&fid='.dintval($_GET['optimizefid']); + } else { + $url = '?action=forums'; + } + dheader('Location: '.$_G['siteurl'].$adminfile.$url); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_regmaildomain.php b/source/class/optimizer/optimizer_regmaildomain.php new file mode 100644 index 0000000..ca7d5f9 --- /dev/null +++ b/source/class/optimizer/optimizer_regmaildomain.php @@ -0,0 +1,37 @@ +fetch_setting('regmaildomain'); + $maildomainlist = C::t('common_setting')->fetch_setting('maildomainlist'); + if($regmaildomain == 2 && !$maildomainlist) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_regmaildomain_need')); + } else { + $return = array('status' => 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_regmaildomain_tip')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=access'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_remote.php b/source/class/optimizer/optimizer_remote.php new file mode 100644 index 0000000..d5c6473 --- /dev/null +++ b/source/class/optimizer/optimizer_remote.php @@ -0,0 +1,33 @@ + 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_remote_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_remote_no_need')); + } + return $return; + } + + public function optimizer() { + cpmsg('optimizer_remote_optimizer', '', 'error'); + } +} \ No newline at end of file diff --git a/source/class/optimizer/optimizer_security_daily.php b/source/class/optimizer/optimizer_security_daily.php new file mode 100644 index 0000000..13fefd0 --- /dev/null +++ b/source/class/optimizer/optimizer_security_daily.php @@ -0,0 +1,43 @@ + 2, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_security_daily_need')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_security_daily_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=misc&operation=cron'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_seo.php b/source/class/optimizer/optimizer_seo.php new file mode 100644 index 0000000..b583f28 --- /dev/null +++ b/source/class/optimizer/optimizer_seo.php @@ -0,0 +1,39 @@ +fetch_setting('seotitle', true); + $seokeywords = C::t('common_setting')->fetch_setting('seokeywords', true); + $seodescription = C::t('common_setting')->fetch_setting('seodescription', true); + $rewritestatus = C::t('common_setting')->fetch_setting('rewritestatus', true); + if(!$seotitle || !$seokeywords || !$seodescription || !$rewritestatus) { + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_seo_advice')); + } else { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_seo_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=setting&operation=seo'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_setting.php b/source/class/optimizer/optimizer_setting.php new file mode 100644 index 0000000..44119d7 --- /dev/null +++ b/source/class/optimizer/optimizer_setting.php @@ -0,0 +1,144 @@ +setting = array( + 'cacheindexlife' => array( + 'initvalue' => '0', + 'optimizedvalue' => '900', + 'title' => $lang['optimizer_setting_cache_index'], + 'description' => $lang['optimizer_setting_cache_index_desc'], + 'optimizerdesc' => $lang['optimizer_setting_cache_optimize_desc'], + ), + 'cachethreadlife' => array( + 'initvalue' => '0', + 'optimizedvalue' => '900', + 'title' => $lang['optimizer_setting_cache_post'], + 'description' => $lang['optimizer_setting_cache_post_desc'], + 'optimizerdesc'=> $lang['optimizer_setting_cache_post_optimize_desc'], + ), + 'optimizeviews' => array( + 'initvalue' => '0', + 'optimizedvalue' => '1', + 'title' => $lang['optimizer_setting_optimizeviews'], + 'description' => $lang['optimizer_setting_optimizeviews_desc'], + 'optimizerdesc' => $lang['optimizer_setting_optimizeviews_optimize_desc'], + ), + 'delayviewcount' => array( + 'initvalue' => '0', + 'optimizedvalue' => '1', + 'title' => $lang['optimizer_setting_delayviewcount'], + 'description' => $lang['optimizer_setting_delayviewcount_desc'], + 'optimizerdesc' => $lang['optimizer_setting_delayviewcount_optimize_desc'], + ), + 'preventrefresh' => array( + 'initvalue' => '0', + 'optimizedvalue' => '1', + 'title' => $lang['optimizer_setting_preventrefresh'], + 'description' => $lang['optimizer_setting_preventrefresh_desc'], + 'optimizerdesc' => $lang['optimizer_setting_preventrefresh_optimize_desc'], + ), + 'nocacheheaders' => array( + 'initvalue' => '1', + 'optimizedvalue' => '0', + 'title' => $lang['optimizer_setting_nocacheheaders'], + 'description' => $lang['optimizer_setting_nocacheheaders_desc'], + 'optimizerdesc' => $lang['optimizer_setting_nocacheheaders_optimize_desc'], + ), + 'jspath' => array( + 'initvalue' => 'static/js/', + 'optimizedvalue' => 'data/cache/', + 'title' => $lang['optimizer_setting_jspath'], + 'description' => $lang['optimizer_setting_jspath_desc'], + 'optimizerdesc' => $lang['optimizer_setting_jspath_optimize_desc'], + ), + 'lazyload' => array( + 'initvalue' => '0', + 'optimizedvalue' => '1', + 'title' => $lang['optimizer_setting_lazyload'], + 'description' => $lang['optimizer_setting_lazyload_desc'], + 'optimizerdesc' => $lang['optimizer_setting_lazyload_optimize_desc'], + ), + 'sessionclose' => array( + 'initvalue' => '0', + 'optimizedvalue' => '1', + 'title' => $lang['optimizer_setting_sessionclose'], + 'description' => $lang['optimizer_setting_sessionclose_desc'], + 'optimizerdesc' => $lang['optimizer_setting_sessionclose_optimize_desc'], + ), + 'rewriteguest' => array( + 'initvalue' => 0, + 'optimizedvalue' => '1', + 'title' => $lang['optimizer_setting_rewriteguest'], + 'description' => $lang['optimizer_setting_rewriteguest_desc'], + 'optimizerdesc' => $lang['optimizer_setting_rewriteguest_optimize_desc'], + ), + ); + } + + public function check() { + $count = 0; + $options = $this->get_option(); + foreach($options as $option) { + if($option[4] == '1') { + $count++; + } + } + if($count) { + $return = array('status' => 1, 'type' => 'view', 'lang' => lang('optimizer', 'optimizer_setting_need_optimizer', array('count' => $count))); + } else { + $return = array('status' => 0, 'type' => 'view', 'lang' => lang('optimizer', 'optimizer_setting_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=optimizer&operation=setting_optimizer&type=optimizer_setting&anchor=performance'); + } + + public function option_optimizer($options) { + $update = array(); + foreach($options as $option) { + if(isset($this->setting[$option])) { + $update[$option] = $this->setting[$option]['optimizedvalue']; + } + } + if($update) { + C::t('common_setting')->update_batch($update); + updatecache('setting'); + } + return true; + } + + public function get_option() { + $return = array(); + $settings = C::t('common_setting')->fetch_all_setting(array_keys($this->setting)); + foreach($this->setting as $k => $setting) { + if($settings[$k] == $setting['initvalue']) { + $return[] = array($k, $setting['title'], $setting['description'], $setting['optimizerdesc'], '1'); + } else { + $return[] = array($k, $setting['title'], $setting['description'], $setting['optimizerdesc'], '0'); + } + } + return $return; + } + +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_thread.php b/source/class/optimizer/optimizer_thread.php new file mode 100644 index 0000000..5ee9d52 --- /dev/null +++ b/source/class/optimizer/optimizer_thread.php @@ -0,0 +1,37 @@ + 400 * 1048576) { + $return = array('status' => '1','type' => 'header', 'lang' => lang('optimizer', 'optimizer_thread_need_optimizer')); + } else { + $return = array('status' => '0', 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_thread_no_need')); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=threadsplit&operation=manage'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_usergroup4.php b/source/class/optimizer/optimizer_usergroup4.php new file mode 100644 index 0000000..2c23b4e --- /dev/null +++ b/source/class/optimizer/optimizer_usergroup4.php @@ -0,0 +1,53 @@ +fetch(4); + $usergroupfield = C::t('common_usergroup_field')->fetch(4); + if(!$usergroup['allowsendpm'] && !$usergroupfiled['allowposturl'] && !$usergroupfield['allowgroupposturl'] && !$usergroupfield['allowpost'] && !$usergroupfield['allowreply'] && !$usergroupfiled['allowdirectpost'] && !$usergroupfield['allowgroupdirectpost']) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_usergroup4_no_need')); + } else { + $option = array( + 'allowsendpm' => lang('optimizer', 'optimizer_usergroup_need_allowsendpm'), + 'allowposturl' => lang('optimizer', 'optimizer_usergroup_need_allowposturl'), + 'allowgroupposturl' => lang('optimizer', 'optimizer_usergroup_need_allowgroupposturl'), + 'allowpost' => lang('optimizer', 'optimizer_usergroup_need_allowpost'), + 'allowreply' => lang('optimizer', 'optimizer_usergroup_need_allowreply'), + 'allowdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowdirectpost'), + 'allowgroupdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowgroupdirectpost'), + ); + $usergroup = array_merge((array)$usergroup, (array)$usergroupfield); + $desc = array(); + foreach($option as $key => $value) { + if($usergroup[$key]) { + $desc[] = $value; + } + } + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_usergroup4_need', array('desc' => implode(',', $desc)))); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=usergroups&operation=edit&id=4'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_usergroup5.php b/source/class/optimizer/optimizer_usergroup5.php new file mode 100644 index 0000000..8d221e8 --- /dev/null +++ b/source/class/optimizer/optimizer_usergroup5.php @@ -0,0 +1,53 @@ +fetch(5); + $usergroupfield = C::t('common_usergroup_field')->fetch(5); + if(!$usergroup['allowsendpm'] && !$usergroupfiled['allowposturl'] && !$usergroupfield['allowgroupposturl'] && !$usergroupfield['allowpost'] && !$usergroupfield['allowreply'] && !$usergroupfiled['allowdirectpost'] && !$usergroupfield['allowgroupdirectpost']) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_usergroup5_no_need')); + } else { + $option = array( + 'allowsendpm' => lang('optimizer', 'optimizer_usergroup_need_allowsendpm'), + 'allowposturl' => lang('optimizer', 'optimizer_usergroup_need_allowposturl'), + 'allowgroupposturl' => lang('optimizer', 'optimizer_usergroup_need_allowgroupposturl'), + 'allowpost' => lang('optimizer', 'optimizer_usergroup_need_allowpost'), + 'allowreply' => lang('optimizer', 'optimizer_usergroup_need_allowreply'), + 'allowdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowdirectpost'), + 'allowgroupdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowgroupdirectpost'), + ); + $usergroup = array_merge((array)$usergroup, (array)$usergroupfield); + $desc = array(); + foreach($option as $key => $value) { + if($usergroup[$key]) { + $desc[] = $value; + } + } + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_usergroup5_need', array('desc' => implode(',', $desc)))); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=usergroups&operation=edit&id=5'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_usergroup6.php b/source/class/optimizer/optimizer_usergroup6.php new file mode 100644 index 0000000..1f2b4f4 --- /dev/null +++ b/source/class/optimizer/optimizer_usergroup6.php @@ -0,0 +1,53 @@ +fetch(6); + $usergroupfield = C::t('common_usergroup_field')->fetch(6); + if(!$usergroup['allowsendpm'] && !$usergroupfiled['allowposturl'] && !$usergroupfield['allowgroupposturl'] && !$usergroupfield['allowpost'] && !$usergroupfield['allowreply'] && !$usergroupfiled['allowdirectpost'] && !$usergroupfield['allowgroupdirectpost']) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_usergroup6_no_need')); + } else { + $option = array( + 'allowsendpm' => lang('optimizer', 'optimizer_usergroup_need_allowsendpm'), + 'allowposturl' => lang('optimizer', 'optimizer_usergroup_need_allowposturl'), + 'allowgroupposturl' => lang('optimizer', 'optimizer_usergroup_need_allowgroupposturl'), + 'allowpost' => lang('optimizer', 'optimizer_usergroup_need_allowpost'), + 'allowreply' => lang('optimizer', 'optimizer_usergroup_need_allowreply'), + 'allowdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowdirectpost'), + 'allowgroupdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowgroupdirectpost'), + ); + $usergroup = array_merge((array)$usergroup, (array)$usergroupfield); + $desc = array(); + foreach($option as $key => $value) { + if($usergroup[$key]) { + $desc[] = $value; + } + } + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_usergroup6_need', array('desc' => implode(',', $desc)))); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=usergroups&operation=edit&id=6'); + } +} + +?> \ No newline at end of file diff --git a/source/class/optimizer/optimizer_usergroup9.php b/source/class/optimizer/optimizer_usergroup9.php new file mode 100644 index 0000000..31a3add --- /dev/null +++ b/source/class/optimizer/optimizer_usergroup9.php @@ -0,0 +1,53 @@ +fetch(9); + $usergroupfield = C::t('common_usergroup_field')->fetch(9); + if(!$usergroup['allowsendpm'] && !$usergroupfiled['allowposturl'] && !$usergroupfield['allowgroupposturl'] && !$usergroupfield['allowpost'] && !$usergroupfield['allowreply'] && !$usergroupfiled['allowdirectpost'] && !$usergroupfield['allowgroupdirectpost']) { + $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_usergroup9_no_need')); + } else { + $option = array( + 'allowsendpm' => lang('optimizer', 'optimizer_usergroup_need_allowsendpm'), + 'allowposturl' => lang('optimizer', 'optimizer_usergroup_need_allowposturl'), + 'allowgroupposturl' => lang('optimizer', 'optimizer_usergroup_need_allowgroupposturl'), + 'allowpost' => lang('optimizer', 'optimizer_usergroup_need_allowpost'), + 'allowreply' => lang('optimizer', 'optimizer_usergroup_need_allowreply'), + 'allowdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowdirectpost'), + 'allowgroupdirectpost' => lang('optimizer', 'optimizer_usergroup_need_allowgroupdirectpost'), + ); + $usergroup = array_merge((array)$usergroup, (array)$usergroupfield); + $desc = array(); + foreach($option as $key => $value) { + if($usergroup[$key]) { + $desc[] = $value; + } + } + $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_usergroup9_need', array('desc' => implode(',', $desc)))); + } + return $return; + } + + public function optimizer() { + $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; + dheader('Location: '.$_G['siteurl'].$adminfile.'?action=usergroups&operation=edit&id=9'); + } +} + +?> \ No newline at end of file diff --git a/source/class/payment/index.htm b/source/class/payment/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/payment/payment_credit.php b/source/class/payment/payment_credit.php new file mode 100644 index 0000000..7a9015a --- /dev/null +++ b/source/class/payment/payment_credit.php @@ -0,0 +1,42 @@ +insert(array( + 'orderid' => $order['out_biz_no'], + 'status' => '2', + 'buyer' => $order['id'], + 'admin' => 0, + 'uid' => $order['uid'], + 'amount' => $data['value'], + 'price' => $order['amount'] / 100, + 'submitdate' => $_G['timestamp'], + 'email' => $_G['member']['email'], + 'confirmdate' => $order['payment_time'], + 'ip' => $data['ip'], + 'port' => $data['port'] + )); + updatemembercount($order['uid'], array('extcredits' . $data['index'] => $data['value']), 1, 'AFD', $order['uid']); + C::t('forum_order')->delete_by_submitdate($_G['timestamp'] - 60 * 86400); + + $extcredits = $_G['setting']['extcredits'][$data['index']]; + notification_add($order['uid'], 'credit', 'addfunds', array('orderid' => $order['out_biz_no'], 'price' => $order['amount'] / 100, 'value' => trim($extcredits['title'] . ' ' . $data['value'] . ' ' . $extcredits['unit'])), 1); + } + +} + +?> \ No newline at end of file diff --git a/source/class/payment/payment_invite.php b/source/class/payment/payment_invite.php new file mode 100644 index 0000000..d1f11e2 --- /dev/null +++ b/source/class/payment/payment_invite.php @@ -0,0 +1,68 @@ +insert(array( + 'orderid' => $order['out_biz_no'], + 'status' => '2', + 'buyer' => $order['id'], + 'uid' => 0, + 'admin' => 0, + 'amount' => $data['num'], + 'price' => $order['amount'] / 100, + 'submitdate' => $_G['timestamp'], + 'email' => $data['email'], + 'confirmdate' => $order['payment_time'], + 'ip' => $data['ip'], + 'port' => $data['port'], + )); + + $codes = $codetext = array(); + $dateline = TIMESTAMP; + for($i=0; $i<$data['num']; $i++) { + $code = strtolower(random(6)); + $codetext[] = $code; + $codes[] = "('0', '$code', '$dateline', '".($_G['group']['maxinviteday']?($_G['timestamp']+$_G['group']['maxinviteday']*24*3600):$_G['timestamp']+86400*10)."', '{$data['email']}', '{$data['ip']}', '{$order['out_biz_no']}')"; + $invitedata = array( + 'uid' => 0, + 'code' => $code, + 'dateline' => $dateline, + 'endtime' => $_G['group']['maxinviteday'] ? ($_G['timestamp']+$_G['group']['maxinviteday']*24*3600) : $_G['timestamp']+86400*10, + 'email' => $data['email'], + 'inviteip' => $data['ip'], + 'orderid' => $order['out_biz_no'] + ); + C::t('common_invite')->insert($invitedata); + } + + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + $add_member_subject = $_G['setting']['bbname'].' - '.lang('forum/misc', 'invite_payment'); + $add_member_message = lang('email', 'invite_payment_email_message', array( + 'orderid' => $order['out_biz_no'], + 'codetext' => implode('
    ', $codetext), + 'siteurl' => $_G['siteurl'], + 'bbname' => $_G['setting']['bbname'], + )); + if(!sendmail($data['email'], $add_member_subject, $add_member_message)) { + runlog('sendmail', "{$data['email']} sendmail failed."); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/seccode/index.htm b/source/class/seccode/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/class/seccode/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/class/secqaa/index.htm b/source/class/secqaa/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/class/secqaa/secqaa_calc.php b/source/class/secqaa/secqaa_calc.php new file mode 100644 index 0000000..e5b9327 --- /dev/null +++ b/source/class/secqaa/secqaa_calc.php @@ -0,0 +1,37 @@ +Discuz!'; + var $customname = ''; + + function make(&$question) { + $a = rand(1, 90); + $b = rand(1, 10); + if(rand(0, 1)) { + $question = $a.' + '.$b.' = ?'; + $answer = $a + $b; + } else { + $question = $a.' - '.$b.' = ?'; + $answer = $a - $b; + } + return $answer; + } + +} + +?> \ No newline at end of file diff --git a/source/class/secqaa/secqaa_calcmad.php b/source/class/secqaa/secqaa_calcmad.php new file mode 100644 index 0000000..4444f35 --- /dev/null +++ b/source/class/secqaa/secqaa_calcmad.php @@ -0,0 +1,35 @@ +_table = 'common_admincp_cmenu'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND sort=1', array($this->_table, $uid)); + } + + public function fetch_all_by_uid($uid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND sort=1 ORDER BY displayorder, dateline DESC, clicks DESC '.DB::limit($start, $limit), + array($this->_table, $uid)); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_cmenu($val, $unbuffered); + } + } + + public function delete_cmenu($id, $uid = 0) { + if(empty($id)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('id', $id).' %i', array($this->_table, ($uid ? ' AND '.DB::field('uid', $uid) : ''))); + } + + public function fetch_id_by_uid_sort_url($uid, $sort, $url) { + return DB::result_first('SELECT id FROM %t WHERE uid=%d AND sort=%d AND url=%s', array($this->_table, $uid, $sort, $url)); + } + + public function increase_clicks($id) { + return DB::query('UPDATE %t SET clicks=clicks+1 WHERE id=%d', array($this->_table, $id)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_admincp_group.php b/source/class/table/table_common_admincp_group.php new file mode 100644 index 0000000..3037420 --- /dev/null +++ b/source/class/table/table_common_admincp_group.php @@ -0,0 +1,29 @@ +_table = 'common_admincp_group'; + $this->_pk = 'cpgroupid'; + + parent::__construct(); + } + + public function fetch_by_cpgroupname($name) { + return $name ? DB::fetch_first('SELECT * FROM %t WHERE cpgroupname=%s', array($this->_table, $name)) : null; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_admincp_member.php b/source/class/table/table_common_admincp_member.php new file mode 100644 index 0000000..91d4c72 --- /dev/null +++ b/source/class/table/table_common_admincp_member.php @@ -0,0 +1,44 @@ +_table = 'common_admincp_member'; + $this->_pk = 'uid'; + + parent::__construct(); + } + + public function update_cpgroupid_by_cpgroupid($val, $data) { + if(!is_array($data)) { + return null; + } + return DB::update('common_admincp_member', $data, DB::field('cpgroupid', $val)); + } + + public function count_by_uid($uid) { + return DB::result_first("SELECT count(*) FROM %t WHERE uid=%d", array($this->_table, $uid)); + } + + public function fetch_all_uid_by_gid_perm($gid, $perm) { + return DB::fetch_all("SELECT uid FROM %t am LEFT JOIN %t ap ON am.cpgroupid=ap.cpgroupid WHERE am.cpgroupid=%d OR ap.perm=%s", array($this->_table, 'common_admincp_perm', $gid, $perm)); + } + + public function fetch_perm_by_uid_perm($uid, $perm) { + return DB::result_first("SELECT ap.perm FROM %t am LEFT JOIN %t ap ON ap.cpgroupid=am.cpgroupid WHERE am.uid=%d AND ap.perm=%s", array($this->_table, 'common_admincp_perm', $uid, $perm)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_admincp_perm.php b/source/class/table/table_common_admincp_perm.php new file mode 100644 index 0000000..b152093 --- /dev/null +++ b/source/class/table/table_common_admincp_perm.php @@ -0,0 +1,37 @@ +_table = 'common_admincp_perm'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_cpgroupid($cpgroupid) { + return $cpgroupid ? DB::fetch_all('SELECT * FROM %t WHERE cpgroupid=%d', array($this->_table, $cpgroupid)) : array(); + } + + public function delete_by_cpgroupid_perm($cpgroupid, $perm = null) { + return $cpgroupid ? DB::delete($this->_table, DB::field('cpgroupid', $cpgroupid).($perm ? ' AND '.DB::field('perm', $perm) : '')) : false; + } + + public function fetch_all_by_perm($perm) { + return $perm ? DB::fetch_all('SELECT * FROM %t WHERE `perm`=%s', array($this->_table, $perm), 'cpgroupid') : array(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_admincp_session.php b/source/class/table/table_common_admincp_session.php new file mode 100644 index 0000000..c9a6e81 --- /dev/null +++ b/source/class/table/table_common_admincp_session.php @@ -0,0 +1,73 @@ +_table = 'common_admincp_session'; + $this->_pk = 'uid'; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_session($id, $force_from_db); + } + } + + public function delete($val, $unbuffered = false, $null = 3600) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_session($val, $unbuffered, $null); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_session($val, $data, $unbuffered); + } + } + + public function fetch_session($uid, $panel) { + $sql = 'SELECT * FROM %t WHERE uid=%d AND panel=%d'; + return DB::fetch_first($sql, array($this->_table, $uid, $panel)); + } + + public function fetch_all_by_panel($panel) { + return DB::fetch_all('SELECT * FROM %t WHERE panel=%d', array($this->_table, $panel), 'uid'); + } + + public function delete_session($uid, $panel, $ttl = 3600) { + $sql = 'DELETE FROM %t WHERE (uid=%d AND panel=%d) OR dateline<%d'; + DB::query($sql, array($this->_table, $uid, $panel, TIMESTAMP-intval($ttl))); + } + + public function update_session($uid, $panel, $data) { + if(!empty($data) && is_array($data)) { + DB::update($this->_table, $data, array('uid'=>$uid, 'panel'=>$panel)); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_admingroup.php b/source/class/table/table_common_admingroup.php new file mode 100644 index 0000000..74c2c8f --- /dev/null +++ b/source/class/table/table_common_admingroup.php @@ -0,0 +1,38 @@ +_table = 'common_admingroup'; + $this->_pk = 'admingid'; + + parent::__construct(); + } + + public function fetch_all_merge_usergroup($gids = array()) { + $admingroups = empty($gids) ? $this->range() : $this->fetch_all($gids); + $data = array(); + foreach(C::t('common_usergroup')->fetch_all_usergroup(array_keys($admingroups)) as $gid=>$value) { + $data[$gid] = array_merge($admingroups[$gid], $value); + } + return $data; + } + + public function fetch_all_order() { + return DB::fetch_all("SELECT u.radminid, u.groupid, u.grouptitle FROM ".DB::table('common_admingroup')." a LEFT JOIN ".DB::table('common_usergroup')." u ON u.groupid=a.admingid ORDER BY u.radminid, a.admingid"); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_adminnote.php b/source/class/table/table_common_adminnote.php new file mode 100644 index 0000000..a59a198 --- /dev/null +++ b/source/class/table/table_common_adminnote.php @@ -0,0 +1,57 @@ +_table = 'common_adminnote'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + $unbuffered = $unbuffered === false ? '' : $unbuffered; + return $this->delete_note($val, $unbuffered); + } + } + + public function delete_note($id, $admin = '') { + if(empty($id)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('id', $id).' %i', array($this->_table, ($admin ? ' AND '.DB::field('admin', $admin) : ''))); + } + + public function fetch_all_by_access($access) { + if(!is_numeric($access) && !is_array($access)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('access', $access).' ORDER BY dateline DESC', array($this->_table)); + } + + public function count_by_access($access) { + if(!is_numeric($access) && !is_array($access)) { + return 0; + } + return DB::result_first('SELECT COUNT(*) FROM %t WHERE '.DB::field('access', $access), array($this->_table)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_advertisement.php b/source/class/table/table_common_advertisement.php new file mode 100644 index 0000000..b1bd2c9 --- /dev/null +++ b/source/class/table/table_common_advertisement.php @@ -0,0 +1,72 @@ +_table = 'common_advertisement'; + $this->_pk = 'advid'; + + parent::__construct(); + } + + public function fetch_all_type() { + return DB::fetch_all("SELECT type, COUNT(type) AS count FROM %t GROUP BY type", array($this->_table)); + } + + public function fetch_all_by_type($type) { + return DB::fetch_all("SELECT * FROM %t WHERE type=%s", array($this->_table, $type)); + } + + public function fetch_all_old() { + return DB::fetch_all("SELECT * FROM %t WHERE available>0 AND starttime<=%d ORDER BY displayorder", array($this->_table, TIMESTAMP)); + } + + public function close_endtime() { + $return = DB::result_first("SELECT COUNT(*) FROM %t WHERE endtime>0 AND endtime<='".TIMESTAMP."'", array($this->_table)); + DB::update($this->_table, array('available' => 0), "endtime>0 AND endtime<='".TIMESTAMP."'", 'UNBUFFERED'); + return $return; + } + + public function fetch_all_endtime($endtime) { + return DB::fetch_all("SELECT * FROM %t WHERE endtime=%s", array($this->_table, $endtime)); + } + + private function _search_conditions($title, $starttime, $endtime, $type, $target) { + $conditions = ''; + $conditions .= $title ? " AND ".DB::field('title', '%'.$title.'%', 'like') : ''; + $conditions .= $starttime > 0 ? " AND starttime>='".(TIMESTAMP - intval($starttime))."'" : ($starttime == -1 ? " AND starttime='0'" : ''); + $conditions .= $endtime > 0 ? " AND endtime>0 AND endtime<'".(TIMESTAMP + intval($endtime))."'" : ($endtime == -1 ? " AND endtime='0'" : ''); + $conditions .= $type ? " AND ".DB::field('type', $type) : ''; + $conditions .= $target ? " AND ".DB::field('targets', '%'.$target.'%', 'like') : ''; + return $conditions; + } + + public function fetch_all_search($title, $starttime, $endtime, $type, $target, $orderby, $start_limit, $advppp) { + $conditions = $this->_search_conditions($title, $starttime, $endtime, $type, $target); + $order_by = $orderby == 'starttime' ? 'starttime' : ($orderby == 'type' ? 'type' : ($orderby == 'displayorder' ? 'displayorder' : 'advid DESC')); + $start_limit = intval($start_limit); + $advppp = intval($advppp); + + return DB::fetch_all("SELECT * FROM ".DB::table('common_advertisement')." WHERE 1 $conditions ORDER BY available DESC, $order_by LIMIT $start_limit, $advppp"); + } + + public function count_search($title, $starttime, $endtime, $type, $target) { + $conditions = $this->_search_conditions($title, $starttime, $endtime, $type, $target); + return DB::result_first("SELECT COUNT(*) FROM ".DB::table('common_advertisement')." WHERE 1 $conditions"); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_advertisement_custom.php b/source/class/table/table_common_advertisement_custom.php new file mode 100644 index 0000000..8c8eed0 --- /dev/null +++ b/source/class/table/table_common_advertisement_custom.php @@ -0,0 +1,38 @@ +_table = 'common_advertisement_custom'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all_data() { + return DB::fetch_all("SELECT * FROM %t ORDER BY id", array($this->_table)); + } + + public function fetch_by_name($name) { + return DB::fetch_first("SELECT * FROM %t WHERE name=%s", array($this->_table, $name)); + } + + public function get_id_by_name($name) { + $result = $this->fetch_by_name($name); + return $result['id']; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_banned.php b/source/class/table/table_common_banned.php new file mode 100644 index 0000000..f178c42 --- /dev/null +++ b/source/class/table/table_common_banned.php @@ -0,0 +1,99 @@ +_table = 'common_banned'; + $this->_pk = 'id'; + + $this->_pre_cache_key = 'common_banned_'; + $this->_cache_ttl = 600; + + parent::__construct(); + + $this->_allowmem = $this->_allowmem && C::memory()->gotsortedset; + } + + public function fetch_by_ip($ip) { + return DB::fetch_first('SELECT * FROM %t WHERE ip=%s', array($this->_table, $ip)); + } + + public function fetch_all_order_dateline() { + return DB::fetch_all('SELECT * FROM %t ORDER BY dateline DESC', array($this->_table)); + } + + public function fetch_all($ids = array(), $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_banned(); + } + } + + public function fetch_all_banned() { + return DB::fetch_all('SELECT * FROM %t', array($this->_table)); + } + + public function delete_by_id($ids, $adminid, $adminname) { + $ids = array_map('intval', (array)$ids); + if($ids) { + if ($this->_allowmem) memory('rm', 'index', $this->_pre_cache_key); + return DB::query('DELETE FROM %t WHERE id IN(%n) AND (1=%d OR `admin`=%s)', array($this->_table, $ids, $adminid, $adminname)); + } + return 0; + } + + public function update_expiration_by_id($id, $expiration, $isadmin, $admin) { + if ($this->_allowmem) memory('rm', 'index', $this->_pre_cache_key); + return DB::query('UPDATE %t SET expiration=%d WHERE id=%d AND (1=%d OR `admin`=%s)', array($this->_table, $expiration, $id, $isadmin, $admin)); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + $cmd = $replace ? 'REPLACE INTO' : 'INSERT INTO'; + if (substr($data['lowerip'], 0, 2) !== '0x') $data['lowerip'] = '0x' . $data['lowerip']; + if (substr($data['upperip'], 0, 2) !== '0x') $data['upperip'] = '0x' . $data['upperip']; + if ($this->_allowmem) memory('rm', 'index', $this->_pre_cache_key); + return DB::query( + $cmd . ' %t SET `ip`=%s, `lowerip`=%i, `upperip`=%i, `admin`=%s, `dateline`=%d, `expiration`=%d', + array($this->_table, $data['ip'], $data['lowerip'], $data['upperip'], $data['admin'], $data['dateline'], $data['expiration']), + $silent, !$return_insert_id + ); + } + + public function check_banned($time_to_check, $ip) { + $iphex = ip::ip_to_hex_str($ip); + $banned = true; + if ($this->_allowmem) $banned = memory('zscore', 'index', $iphex, 0, $this->_pre_cache_key); + if ($banned === false || !$this->_allowmem) { + $iphex_val = '0x' . $iphex; + $ret = DB::result_first( + "SELECT id from %t WHERE expiration > %d AND lowerip <= %i AND upperip >= %i", + array($this->_table, $time_to_check, $iphex_val, $iphex_val) + ); + if ($ret) { + if ($this->_allowmem) memory('zadd', 'index', $iphex, 1, $this->_pre_cache_key); + return true; + } + if ($this->_allowmem) memory('zadd', 'index', $iphex, 0, $this->_pre_cache_key); + return false; + } + + return $banned === 1; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block.php b/source/class/table/table_common_block.php new file mode 100644 index 0000000..5e7a9b9 --- /dev/null +++ b/source/class/table/table_common_block.php @@ -0,0 +1,124 @@ +_table = 'common_block'; + $this->_pk = 'bid'; + + parent::__construct(); + $this->_allowmem = null; + $this->cache_ttl = $this->_cache_ttl = getglobal('setting/memory/diyblock'); + $this->allowmem = $this->_cache_ttl !== null && memory('check'); + + } + + public function fetch($bid, $force_from_db = false) { + if(($block = parent::fetch(dintval($bid), $force_from_db))) { + $block['param'] = $block['param'] ? dunserialize($block['param']) : array(); + } + return $block; + } + + public function count_by_admincpwhere($wheresql) { + $wheresql = $wheresql ? ' WHERE '.(string)$wheresql : ''; + return DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).' b LEFT JOIN '.DB::table('common_template_block').' tb ON tb.bid=b.bid'.$wheresql); + } + + public function fetch_all_by_admincpwhere($wheresql, $ordersql, $start, $limit) { + $wheresql = $wheresql ? ' WHERE '.(string)$wheresql : ''; + return DB::fetch_all('SELECT b.*, tb.targettplname FROM '.DB::table($this->_table).' b LEFT JOIN '.DB::table('common_template_block').' tb ON tb.bid=b.bid'.$wheresql.' '.(string)$ordersql.DB::limit($start, $limit), null, $this->_pk ? $this->_pk : ''); + } + + public function update_by_styleid($styleid, $data) { + return ($styleid = dintval($styleid, true)) && !empty($data) && is_array($data) ? DB::update($this->_table, $data, DB::field('styleid', $styleid)) : false; + } + + public function fetch_by_styleid($styleid) { + return ($styleid = dintval($styleid, true)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('styleid', $styleid).' LIMIT 1') : array(); + } + + public function fetch_all_bid_by_blocktype($blocktype, $limit = 1000) { + $data = array(); + if ($blocktype !== null && ($data = DB::fetch_all('SELECT bid FROM '.DB::table($this->_table).' WHERE '.DB::field('blocktype', $blocktype).' ORDER BY bid DESC'.DB::limit($limit), null, $this->_pk))) { + $data = array_keys($data); + } + return $data; + } + + public function update_dateline_to_expired($bids, $timestamp) { + return ($bids = dintval($bids, true)) && ($timestamp = dintval($timestamp)) ? DB::query('UPDATE '.DB::table($this->_table).' SET `dateline`='.$timestamp.'-cachetime WHERE bid IN ('.dimplode($bids).') AND cachetime>0') : false; + } + + public function fetch_all_recommended_block($id, $idtype, $wherearr = array(), $leftjoin = '', $fields = '') { + $data = array(); + if(($id = dintval($id)) && $idtype) { + $where = $wherearr ? ' AND '.implode(' AND ', $wherearr) : ''; + $data = DB::fetch_all("SELECT bi.dataid,bi.uid,bi.username,bi.dateline,bi.isverified,bi.verifiedtime,b.bid,b.blockclass,b.name,b.script$fields FROM ".DB::table('common_block').' b + LEFT JOIN '.DB::table('common_block_item_data')." bi ON b.bid=bi.bid $leftjoin WHERE bi.id='$id' AND bi.idtype='$idtype'$where ORDER BY b.bid DESC", null, 'bid'); + } + return $data; + } + + + public function count_by_where($wheresql, $leftjoin = '') { + return DB::result_first("SELECT COUNT(*) FROM ".DB::table($this->_table).' b'." $leftjoin $wheresql"); + } + + public function fetch_all_by_where($wheresql, $start = 0, $limit = 0, $leftjoin = '', $fields = '') { + return DB::fetch_all("SELECT b.bid,b.blockclass,b.name,b.script,b.param$fields FROM ".DB::table($this->_table).' b'." $leftjoin $wheresql ORDER BY b.bid DESC ".DB::limit($start, $limit)); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if(($val = dintval($val, true)) && $data && is_array($data)) { + $ret = parent::update($val, $data, $unbuffered, $low_priority); + $this->clear_cache($val); + return $ret; + } + return false; + } + + public function delete($val, $unbuffered = false) { + if(($val = dintval($val, true))) { + $ret = parent::delete($val, $unbuffered); + $this->clear_cache($val); + return $ret; + } + return false; + } + + public function clear_cache($ids, $pre_cache_key = null) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::clear_cache($ids, $pre_cache_key); + } else { + return $this->clear_blockcache($ids); + } + } + + public function clear_blockcache($bids) { + if($this->allowmem) { + memory('rm', $bids,'blockcache_'); + memory('rm', $bids, 'blockcache_htm_'); + memory('rm', $bids, 'blockcache_js_'); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block_favorite.php b/source/class/table/table_common_block_favorite.php new file mode 100644 index 0000000..ac9117e --- /dev/null +++ b/source/class/table/table_common_block_favorite.php @@ -0,0 +1,41 @@ +_table = 'common_block_favorite'; + $this->_pk = 'favid'; + + parent::__construct(); + } + + public function delete_by_uid_bid($uid, $bid) { + return ($uid = dintval($uid)) && ($bid = dintval($bid)) ? DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('bid', $bid)) : false; + } + + public function delete_by_bid($bid) { + return ($bid = dintval($bid)) ? DB::delete($this->_table, DB::field('bid', $bid)) : false; + } + + public function count_by_uid_bid($uid, $bid){ + return ($uid = dintval($uid)) && ($bid = dintval($bid)) ? DB::result_first('SELECT count(*) FROM %t WHERE uid=%d AND bid=%d', array($this->_table, $uid, $bid)) : false; + } + + public function fetch_all_by_uid($uid) { + return ($uid = dintval($uid)) ? DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC', array($this->_table, $uid), 'bid') : array(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block_item.php b/source/class/table/table_common_block_item.php new file mode 100644 index 0000000..33edec9 --- /dev/null +++ b/source/class/table/table_common_block_item.php @@ -0,0 +1,61 @@ +_table = 'common_block_item'; + $this->_pk = 'itemid'; + + parent::__construct(); + } + + public function delete_by_bid($bid) { + if(($bid = dintval($bid, true))) { + return DB::delete($this->_table, DB::field('bid', $bid)); + } + return false; + } + + public function delete_by_bid_displayorder($bid, $displayorder) { + return ($bid = dintval($bid)) ? DB::delete($this->_table, DB::field('bid', $bid).' AND '.DB::field('displayorder', dintval($displayorder))) : false; + } + + public function fetch_all_by_bid($bids, $sort = false) { + return ($bids = dintval($bids, true)) ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('bid', $bids).($sort ? ' ORDER BY displayorder, itemtype DESC' : ''), null, $this->_pk) : array(); + } + + public function delete_by_itemid_bid($itemid, $bid) { + return ($itemid = dintval($itemid, true)) && ($bid = dintval($bid)) ? DB::delete($this->_table, DB::field('itemid', $itemid).' AND '.DB::field('bid', $bid)) : false; + } + + public function insert_batch($bid, $itemlist) { + $inserts = array(); + if(($bid = dintval($bid))) { + foreach($itemlist as $value) { + if($value) { + $value = daddslashes($value); + $inserts[] = "('{$value['itemid']}', '$bid', '{$value['itemtype']}', '{$value['id']}', '{$value['idtype']}', '{$value['title']}', + '{$value['url']}', '{$value['pic']}', '{$value['picflag']}', '{$value['makethumb']}', '{$value['thumbpath']}', '{$value['summary']}', + '{$value['showstyle']}', '{$value['related']}', '{$value['fields']}', '{$value['displayorder']}', '{$value['startdate']}', '{$value['enddate']}')"; + } + } + } + if($inserts) { + DB::query('REPLACE INTO '.DB::table($this->_table).'(itemid, bid, itemtype, id, idtype, title, url, pic, picflag, makethumb, thumbpath, summary, showstyle, related, `fields`, displayorder, startdate, enddate) VALUES '.implode(',', $inserts)); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block_item_data.php b/source/class/table/table_common_block_item_data.php new file mode 100644 index 0000000..53d1ce2 --- /dev/null +++ b/source/class/table/table_common_block_item_data.php @@ -0,0 +1,70 @@ +_table = 'common_block_item_data'; + $this->_pk = 'dataid'; + + parent::__construct(); + } + + public function fetch_all_by_bid($bid, $isverified = 1, $start = 0, $limit = 0, $bannedids = array(), $format = true) { + $data = array(); + if(($bid = dintval($bid, true))) { + $addsql = $bannedids = dintval($bannedids, true) ? ' AND id NOT IN ('.dimplode($bannedids).')' : ''; + $query = DB::query('SELECT * FROM %t WHERE '.DB::field('bid', $bid).' AND isverified=%d'.$addsql.' ORDER BY stickgrade DESC, displayorder DESC, verifiedtime DESC, dataid DESC '.DB::limit($start, $limit), array($this->_table, $isverified)); + while($value = DB::fetch($query)) { + if($format) { + $value['fields'] = dunserialize($value['fields']); + $value['fields']['timestamp'] = $value['fields']['dateline']; + $value['fields']['dateline'] = dgmdate($value['fields']['dateline']); + $value['pic'] = $value['pic'] !== STATICURL.'image/common/nophoto.gif' ? $value['pic'] : ''; + if($value['pic'] && $value['picflag'] == '1') { + $value['pic'] = getglobal('setting/attachurl').$value['pic']; + } elseif ($value['picflag'] == '2') { + $value['pic'] = getglobal('setting/ftp/attachurl').$value['pic']; + } + $value['dateline'] = dgmdate($value['dateline'], 'u'); + $value['verifiedtime'] = dgmdate($value['verifiedtime'], 'u'); + } + $data[$value['id']] = $value; + } + } + return $data; + } + + public function count_by_bid($bid, $isverified = 1) { + return ($bid = dintval($bid, true)) ? DB::result_first('SELECT COUNT(*) FROM %t WHERE '.DB::field('bid', $bid).' AND isverified=%d', array($this->_table, $isverified)) : 0; + } + + public function delete_by_bid($bid) { + if(($bid = dintval($bid, true))) { + DB::delete($this->_table, DB::field('bid', $bid)); + } + } + + public function delete_by_dataid_bid($dataids, $bid) { + if(($dataids = dintval($dataids, true)) && ($dataids = DB::fetch_all('SELECT dataid FROM %t WHERE dataid IN (%n) AND bid=%d', array($this->_table, $dataids, $bid), $this->_pk))) { + $this->delete(array_keys($dataids)); + } + } + + public function fetch_by_bid_id_idtype($bid, $id, $idtype) { + return $bid && $id && $idtype ? DB::fetch_first('SELECT * FROM %t WHERE bid=%d AND id=%d AND idtype=%s', array($this->_table, $bid, $id, $idtype)) : array(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block_permission.php b/source/class/table/table_common_block_permission.php new file mode 100644 index 0000000..d56da52 --- /dev/null +++ b/source/class/table/table_common_block_permission.php @@ -0,0 +1,144 @@ +_table = 'common_block_permission'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? 0 : $force_from_db; + return $this->fetch_by_bid_uid($id, $force_from_db); + } + } + + public function fetch_by_bid_uid($bid, $uid){ + return ($bid = dintval($bid)) && ($uid = dintval($uid)) ? DB::fetch_first('SELECT * FROM %t WHERE bid=%d AND uid=%d', array($this->_table, $bid, $uid)) : array(); + } + + public function fetch_all_by_bid($bid, $uid = 0) { + return ($bid = dintval($bid, true)) ? DB::fetch_all('SELECT * FROM %t WHERE bid=%d'.($uid ? ' AND '.DB::field('uid', $uid) : '').' ORDER BY inheritedtplname', array($this->_table, $bid), 'uid') : array(); + } + + + public function fetch_all_by_uid($uids, $flag = true, $sort = 'ASC', $start = 0, $limit = 0) { + $wherearr = array(); + $sort = $sort === 'ASC' ? 'ASC' : 'DESC'; + if(($uids = dintval($uids))) { + $wherearr[] = DB::field('uid', $uids); + } + if(!$flag) { + $wherearr[] = 'inheritedtplname = \'\''; + } + $where = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).$where.' ORDER BY uid '.$sort.', inheritedtplname'.DB::limit($start, $limit), NULL, ($uids && !is_array($uids)) ? 'bid' : ''); + } + + public function count_by_uids($uids, $flag) { + $wherearr = array(); + if(($uids = dintval($uids, true))) { + $wherearr[] = DB::field('uid', $uids); + } + if(!$flag) { + $wherearr[] = 'inheritedtplname = \'\''; + } + $where = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).$where); + } + + public function fetch_permission_by_uid($uids) { + return ($uids = dintval($uids, true)) ? DB::fetch_all('SELECT uid, sum(allowmanage) as allowmanage, sum(allowrecommend) as allowrecommend, sum(needverify) as needverify FROM '.DB::table($this->_table)." WHERE ".DB::field('uid', $uids)." GROUP BY uid", null, 'uid') : array(); + } + + public function delete_by_bid_uid_inheritedtplname($bid = false, $uids = false, $inheritedtplname = false) { + $wherearr = array(); + if(($bid = dintval($bid, true))) { + $wherearr[] = DB::field('bid', $bid); + } + if(($uids = dintval($uids, true))) { + $wherearr[] = DB::field('uid', $uids); + } + if($inheritedtplname === true) { + $wherearr[] = "inheritedtplname!=''"; + } elseif($inheritedtplname !== false && is_string($inheritedtplname)) { + $wherearr[] = DB::field('inheritedtplname', $inheritedtplname); + } + return $wherearr ? DB::delete($this->_table, implode(' AND ', $wherearr)) : false; + } + + + public function insert_batch($users, $bids, $tplname = '') { + $blockperms = array(); + if(!empty($users) && $bids = dintval($bids, true)){ + + $uids = $notinherit = array(); + foreach($users as &$user) { + if(($user['uid'] = dintval($user['uid']))) { + $uids[] = $user['uid']; + } + } + if(!empty($uids)) { + foreach($this->fetch_all_by_uid($uids, false) as $value) { + if(in_array($value['bid'], $bids)) { + $notinherit[$value['bid']][$value['uid']] = true; + } + } + } + foreach($users as $user) { + if($user['uid']) { + $tplname = !empty($user['inheritedtplname']) ? $user['inheritedtplname'] : $tplname; + foreach ($bids as $bid) { + if(empty($notinherit[$bid][$user['uid']])) { + $blockperms[] = "('$bid','{$user['uid']}','{$user['allowmanage']}','{$user['allowrecommend']}','{$user['needverify']}','$tplname')"; + } + } + } + } + if($blockperms) { + DB::query('REPLACE INTO '.DB::table($this->_table).' (bid,uid,allowmanage,allowrecommend,needverify,inheritedtplname) VALUES '.implode(',', $blockperms)); + return $uids; + } else { + return FALSE; + } + } + return false; + } + + public function insert_by_bid($bid, $users) { + $sqlarr = $uids = array(); + $bid = intval($bid); + if(!empty($bid) && !empty($users)) { + foreach ($users as $v) { + if(($v['uid'] = dintval($v['uid']))) { + $sqlarr[] = "('$bid','{$v['uid']}','{$v['allowmanage']}','{$v['allowrecommend']}','{$v['needverify']}','')"; + $uids[] = $v['uid']; + } + } + if(!empty($sqlarr)) { + DB::query('REPLACE INTO '.DB::table($this->_table).' (bid,uid,allowmanage,allowrecommend,needverify,inheritedtplname) VALUES '.implode(',', $sqlarr)); + } + } + return $uids; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block_pic.php b/source/class/table/table_common_block_pic.php new file mode 100644 index 0000000..2ff4bd9 --- /dev/null +++ b/source/class/table/table_common_block_pic.php @@ -0,0 +1,46 @@ +_table = 'common_block_pic'; + $this->_pk = 'picid'; + + parent::__construct(); + } + + public function fetch_all_by_bid_itemid($bid, $itemid = array()) { + return $bid ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('bid', $bid).($itemid ? ' AND '.DB::field('itemid', $itemid) : '')) : array(); + } + + public function insert_by_bid($bid, $data) { + if($bid && $data && is_array($data)) { + $data = daddslashes($data); + $str = array(); + foreach($data as $value) { + $str[] = "('{$value['bid']}', '{$value['pic']}', '{$value['picflag']}', '{$value['type']}')"; + } + if($str) { + DB::query('INSERT INTO '.DB::table($this->_table).' (bid, pic, picflag, `type`) VALUES '.implode(',', $str)); + } + } + } + + public function count_by_bid_pic($bid, $pic) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE bid=%d AND pic=%s', array($this->_table, $bid, $pic)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block_style.php b/source/class/table/table_common_block_style.php new file mode 100644 index 0000000..3ade21c --- /dev/null +++ b/source/class/table/table_common_block_style.php @@ -0,0 +1,77 @@ +_table = 'common_block_style'; + $this->_pk = 'styleid'; + + parent::__construct(); + } + + public function fetch_all_by_blockclass($blockclass) { + return $blockclass ? DB::fetch_all('SELECT * FROM %t WHERE blockclass=%s', array($this->_table, $blockclass), $this->_pk) : array(); + } + + public function fetch_all_by_hash($hash) { + return $hash ? DB::fetch_all('SELECT * FROM %t WHERE `hash` IN (%n)', array($this->_table, $hash), $this->_pk) : array(); + } + + public function count_by_where($wheresql) { + $wheresql = $wheresql ? ' WHERE '.(string)$wheresql : ''; + return DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).$wheresql); + } + + public function fetch_all_by_where($wheresql, $ordersql, $start, $limit) { + $wheresql = $wheresql ? ' WHERE '.(string)$wheresql : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).$wheresql.' '.(string)$ordersql.DB::limit($start, $limit), null, $this->_pk ? $this->_pk : ''); + } + + public function insert_batch($styles) { + $inserts = array(); + foreach($styles as $value) { + if(!empty($value['blockclass'])) { + $value = daddslashes($value); + $inserts[] = "('{$value['blockclass']}', '{$value['name']}', '{$value['template']}', '{$value['hash']}', '{$value['getpic']}', '{$value['getsummary']}', '{$value['settarget']}', '{$value['fields']}', '{$value['moreurl']}')"; + } + } + if(!empty($inserts)) { + DB::query('INSERT INTO '.DB::table($this->_table)."(`blockclass`, `name`, `template`, `hash`, `getpic`, `getsummary`, `settarget`, `fields`, `moreurl`) VALUES ".implode(',',$inserts)); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if(($val = dintval($val, true)) && $data && is_array($data)) { + $this->_pre_cache_key = 'blockstylecache_'; + $this->_cache_ttl = getglobal('setting/memory/diyblock'); + $this->_allowmem = getglobal('setting/memory/diyblock') && memory('check'); + $this->clear_cache($val); + return parent::update($val, $data, $unbuffered, $low_priority); + } + return false; + } + + public function delete($val, $unbuffered = false) { + if(($val = dintval($val, true))) { + $this->_pre_cache_key = 'blockstylecache_'; + $this->_cache_ttl = getglobal('setting/memory/diyblock'); + $this->_allowmem = getglobal('setting/memory/diyblock') && memory('check'); + return parent::delete($val, $unbuffered); + } + return false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_block_xml.php b/source/class/table/table_common_block_xml.php new file mode 100644 index 0000000..0ac44b3 --- /dev/null +++ b/source/class/table/table_common_block_xml.php @@ -0,0 +1,26 @@ +_table = 'common_block_xml'; + $this->_pk = 'id'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_cache.php b/source/class/table/table_common_cache.php new file mode 100644 index 0000000..0c5cfd4 --- /dev/null +++ b/source/class/table/table_common_cache.php @@ -0,0 +1,26 @@ +_table = 'common_cache'; + $this->_pk = 'cachekey'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_card.php b/source/class/table/table_common_card.php new file mode 100644 index 0000000..ee3e31d --- /dev/null +++ b/source/class/table/table_common_card.php @@ -0,0 +1,51 @@ +_table = 'common_card'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function update_by_typeid($typeid, $data) { + if(($typeid = dintval($typeid, true)) && !empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('typeid', $typeid)); + } + return false; + } + + public function count_by_where($where) { + return ($where = (string)$where) ? DB::result_first('SELECT COUNT(*) FROM '.DB::table('common_card').' WHERE '.$where) : 0; + } + + public function fetch_all_by_where($where, $start = 0, $limit = 0) { + $where = $where ? ' WHERE '.(string)$where : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).$where.' ORDER BY dateline DESC'.DB::limit($start, $limit)); + } + + public function update_to_overdue($timestamp) { + return ($timestamp = dintval($timestamp)) ? DB::query('UPDATE '.DB::table('common_card')." SET status = 9 WHERE status = '1' AND cleardateline <= '$timestamp'") : false; + } + + public function update_to_used($id) { + global $_G; + return DB::query('UPDATE '.DB::table('common_card')." SET status = '2', uid = '".$_G['uid']."', useddateline = '".$_G['timestamp']."' WHERE id = '".daddslashes($id)."' AND status = '1'"); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_card_log.php b/source/class/table/table_common_card_log.php new file mode 100644 index 0000000..4aa134b --- /dev/null +++ b/source/class/table/table_common_card_log.php @@ -0,0 +1,37 @@ +_table = 'common_card_log'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_by_operation($operation) { + return DB::fetch_first('SELECT * FROM %t WHERE operation=%d ORDER BY dateline DESC LIMIT 1', array($this->_table, $operation)); + } + + public function fetch_all_by_operation($operation, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE operation=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $operation)); + } + + public function count_by_operation($operation) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE operation=%d', array($this->_table, $operation)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_card_type.php b/source/class/table/table_common_card_type.php new file mode 100644 index 0000000..243c6b1 --- /dev/null +++ b/source/class/table/table_common_card_type.php @@ -0,0 +1,26 @@ +_table = 'common_card_type'; + $this->_pk = 'id'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_credit_log.php b/source/class/table/table_common_credit_log.php new file mode 100644 index 0000000..3d72603 --- /dev/null +++ b/source/class/table/table_common_credit_log.php @@ -0,0 +1,197 @@ +_table = 'common_credit_log'; + $this->_pk = 'logid'; + + parent::__construct(); + } + public function fetch_by_operation_relatedid($operation, $relatedid) { + $relatedid = dintval($relatedid, true); + $parameter = array($this->_table, $operation, $relatedid); + $wherearr = array(); + $wherearr[] = is_array($operation) && $operation ? 'operation IN(%n)' : 'operation=%s'; + $wherearr[] = is_array($relatedid) && $relatedid ? 'relatedid IN(%n)' : 'relatedid=%d'; + return DB::fetch_all('SELECT * FROM %t WHERE '.implode(' AND ', $wherearr), $parameter); + } + public function fetch_all_by_operation($operation, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE operation=%s ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $operation)); + } + public function fetch_all_by_uid_operation_relatedid($uid, $operation, $relatedid) { + $parameter = array($this->_table); + $wherearr = array(); + if($uid) { + $uid = dintval($uid, true); + $wherearr[] = is_array($uid) && $uid ? 'uid IN(%n)' : 'uid=%d'; + $parameter[] = $uid; + } + $relatedid = dintval($relatedid, true); + $wherearr[] = is_array($operation) && $operation ? 'operation IN(%n)' : 'operation=%s'; + $wherearr[] = is_array($relatedid) && $relatedid ? 'relatedid IN(%n)' : 'relatedid=%d'; + $parameter[] = $operation; + $parameter[] = $relatedid; + return DB::fetch_all('SELECT * FROM %t WHERE '.implode(' AND ', $wherearr).' ORDER BY dateline', $parameter); + } + public function fetch_all_by_uid($uid, $start = 0, $limit = 0) { + $array = DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $uid), 'logid'); + if(!$array) { + return array(); + } + $fieldids = array(); + foreach($array as $key => $value) { + if(!in_array($value['operation'], lang('spacecp', 'logs_credit_update_INDEX'))) { + $fieldids[] = $key; + } + } + if($fieldids) { + $arrayfield = DB::fetch_all('SELECT * FROM %t WHERE logid IN(%n)', array('common_credit_log_field', $fieldids), 'logid'); + foreach($arrayfield as $key => $value) { + $array[$key] += $value; + } + } + return $array; + } + public function fetch_all_by_search($uid, $optype, $begintime = 0, $endtime = 0, $exttype = 0, $income = 0, $extcredits = array(), $start = 0, $limit = 0, $relatedid = 0) { + $condition = $this->make_query_condition($uid, $optype, $begintime, $endtime, $exttype, $income, $extcredits, $relatedid); + $array = DB::fetch_all('SELECT * FROM %t '.$condition[0].' ORDER BY dateline DESC '.DB::limit($start, $limit), $condition[1], 'logid'); + if(!$array) { + return array(); + } + $fieldids = array(); + foreach($array as $key => $value) { + if(!in_array($value['operation'], lang('spacecp', 'logs_credit_update_INDEX'))) { + $fieldids[] = $key; + } + } + if($fieldids) { + $arrayfield = DB::fetch_all('SELECT * FROM %t WHERE logid IN(%n)', array('common_credit_log_field', $fieldids), 'logid'); + foreach($arrayfield as $key => $value) { + $array[$key] += $value; + } + } + return $array; + } + public function delete_by_operation_relatedid($operation, $relatedid) { + $relatedid = dintval($relatedid, true); + if($operation && $relatedid) { + return DB::delete($this->_table, DB::field('operation', $operation).' AND '.DB::field('relatedid', $relatedid)); + } + return 0; + } + + public function delete_by_uid_operation_relatedid($uid, $operation, $relatedid) { + $relatedid = dintval($relatedid, true); + $uid = dintval($uid, true); + if($relatedid && $uid && $operation) { + return DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('operation', $operation).' AND '.DB::field('relatedid', $relatedid)); + } + return 0; + } + public function update_by_uid_operation_relatedid($uid, $operation, $relatedid, $data) { + $relatedid = dintval($relatedid, true); + $uid = dintval($uid, true); + if(!empty($data) && is_array($data) && $relatedid && $uid && $operation) { + return DB::update($this->_table, $data, DB::field('uid', $uid).' AND '.DB::field('operation', $operation).' AND '.DB::field('relatedid', $relatedid)); + } + return 0; + } + public function count_by_uid_operation_relatedid($uid, $operation, $relatedid) { + $relatedid = dintval($relatedid, true); + $uid = dintval($uid, true); + if($relatedid && $uid && $operation) { + $wherearr = array(); + $wherearr[] = is_array($uid) && $uid ? 'uid IN(%n)' : 'uid=%d'; + $wherearr[] = is_array($operation) && $operation ? 'operation IN(%n)' : 'operation=%s'; + $wherearr[] = is_array($relatedid) && $relatedid ? 'relatedid IN(%n)' : 'relatedid=%d'; + return DB::result_first('SELECT COUNT(*) FROM %t WHERE '.implode(' AND ', $wherearr), array($this->_table, $uid, $operation, $relatedid)); + } + return 0; + } + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + public function count_by_operation($operation) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE operation=%s', array($this->_table, $operation)); + } + public function count_stc_by_relatedid($relatedid, $creditid, $operation = 'STC') { + $creditid = intval($creditid); + if($creditid) { + return DB::fetch_first("SELECT COUNT(*) AS payers, SUM(extcredits%d) AS income FROM %t WHERE relatedid=%d AND operation=%s", array($creditid, $this->_table, $relatedid, $operation)); + } + return 0; + } + public function count_credit_by_uid_operation_relatedid($uid, $operation, $relatedid, $creditid) { + $creditid = intval($creditid); + if($creditid) { + $relatedid = dintval($relatedid, true); + $uid = dintval($uid, true); + $wherearr = array(); + $wherearr[] = is_array($uid) && $uid ? 'uid IN(%n)' : 'uid=%d'; + $wherearr[] = is_array($operation) && $operation ? 'operation IN(%n)' : 'operation=%s'; + $wherearr[] = is_array($relatedid) && $relatedid ? 'relatedid IN(%n)' : 'relatedid=%d'; + return DB::result_first('SELECT SUM(extcredits%d) AS credit FROM %t WHERE '.implode(' AND ', $wherearr), array($creditid, $this->_table, $uid, $operation, $relatedid)); + } + return 0; + } + public function count_by_search($uid, $optype, $begintime = 0, $endtime = 0, $exttype = 0, $income = 0, $extcredits = array(), $relatedid = 0) { + $condition = $this->make_query_condition($uid, $optype, $begintime, $endtime, $exttype, $income, $extcredits, $relatedid); + return DB::result_first('SELECT COUNT(*) FROM %t '.$condition[0], $condition[1]); + } + private function make_query_condition($uid, $optype, $begintime = 0, $endtime = 0, $exttype = 0, $income = 0, $extcredits = array(), $relatedid = 0) { + $wherearr = array(); + $parameter = array($this->_table); + if($uid) { + $uid = dintval($uid, true); + $wherearr[] = is_array($uid) && $uid ? 'uid IN(%n)' : 'uid=%d'; + $parameter[] = $uid; + } + if($optype) { + $wherearr[] = is_array($optype) && $optype ? 'operation IN(%n)' : 'operation=%s'; + $parameter[] = $optype != -1 ? $optype : ''; + } + if($relatedid) { + $relatedid = dintval($relatedid, true); + $wherearr[] = is_array($relatedid) && $relatedid ? 'relatedid IN(%n)' : 'relatedid=%d'; + $parameter[] = $relatedid; + } + if($begintime) { + $wherearr[] = 'dateline>%d'; + $parameter[] = $begintime; + } + if($endtime) { + $wherearr[] = 'dateline<%d'; + $parameter[] = $endtime; + } + if($exttype && $extcredits[$exttype]) { + $wherearr[] = "extcredits{$exttype}!=0"; + } + if($income && $extcredits) { + $incomestr = $income < 0 ? '<' : '>'; + $incomearr = array(); + foreach(array_keys($extcredits) as $id) { + $incomearr[] = 'extcredits'.$id.$incomestr.'0'; + } + if($incomearr) { + $wherearr[] = '('.implode(' OR ', $incomearr).')'; + } + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_credit_log_field.php b/source/class/table/table_common_credit_log_field.php new file mode 100644 index 0000000..e23e1b6 --- /dev/null +++ b/source/class/table/table_common_credit_log_field.php @@ -0,0 +1,25 @@ +_table = 'common_credit_log_field'; + $this->_pk = ''; + + parent::__construct(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_credit_rule.php b/source/class/table/table_common_credit_rule.php new file mode 100644 index 0000000..cbe0451 --- /dev/null +++ b/source/class/table/table_common_credit_rule.php @@ -0,0 +1,49 @@ +_table = 'common_credit_rule'; + $this->_pk = 'rid'; + + parent::__construct(); + } + + public function fetch_all_by_rid($rid = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($rid) { + $rid = dintval($rid, true); + $parameter[] = $rid; + $wherearr[] = is_array($rid) ? 'rid IN(%n)' : 'rid=%d'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY rid DESC", $parameter, $this->_pk); + } + + public function fetch_all_rule() { + return DB::fetch_all('SELECT * FROM %t ORDER BY rid DESC', array($this->_table)); + } + + public function fetch_all_by_action($action) { + if(!empty($action)) { + return DB::fetch_all('SELECT * FROM %t WHERE action IN(%n)', array($this->_table, $action), $this->_pk); + } + return array(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_credit_rule_log.php b/source/class/table/table_common_credit_rule_log.php new file mode 100644 index 0000000..8b25eef --- /dev/null +++ b/source/class/table/table_common_credit_rule_log.php @@ -0,0 +1,83 @@ +_table = 'common_credit_rule_log'; + $this->_pk = 'clid'; + + parent::__construct(); + } + + public function increase($clid, $logarr) { + if($clid && !empty($logarr) && is_array($logarr)) { + return DB::query('UPDATE %t SET %i WHERE clid=%d', array($this->_table, implode(',', $logarr), $clid)); + } + return 0; + } + + public function fetch_ids_by_rid_fid($rid, $fid) { + $lids = array(); + if($rid && $fid) { + $query = DB::query('SELECT clid FROM %t WHERE rid=%d AND fid=%d', array($this->_table, $rid, $fid)); + while($value = DB::fetch($query)) { + $lids[$value['clid']] = $value['clid']; + } + } + return $lids; + } + + public function fetch_rule_log($rid, $uid, $fid = 0){ + $log = array(); + if($rid && $uid) { + $sql = ''; + $para = array($this->_table, $uid, $rid); + if($fid) { + $sql = ' AND fid=%d'; + $para[] = $fid; + } + $log = DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND rid=%d'.$sql, $para); + } + return $log; + } + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + + public function fetch_all_by_uid($uid, $start = 0, $limit = 0) { + $data = array(); + + $query = DB::query("SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC ".DB::limit($start, $limit), array($this->_table, $uid)); + while($value = DB::fetch($query)) { + $data[$value['clid']] = $value; + $this->_rids[$value['rid']] = $value['rid']; + } + return $data; + } + + public function delete_by_uid($uids) { + $uids = dintval((array)$uids, true); + if(!empty($uids)) { + return DB::delete($this->_table, DB::field('uid', $uids)); + } + return 0; + } + public function get_rids() { + return $this->_rids; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_credit_rule_log_field.php b/source/class/table/table_common_credit_rule_log_field.php new file mode 100644 index 0000000..261767e --- /dev/null +++ b/source/class/table/table_common_credit_rule_log_field.php @@ -0,0 +1,66 @@ +_table = 'common_credit_rule_log_field'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete_clid($val) { + DB::delete($this->_table, DB::field('clid', $val)); + } + + public function delete_by_uid($uids) { + return DB::delete($this->_table, DB::field('uid', $uids)); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_field($val, $data, $unbuffered); + } + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_field($id, $force_from_db); + } + } + + public function update_field($uid, $clid, $data) { + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, array('uid'=>$uid, 'clid'=>$clid)); + } + return 0; + } + + public function fetch_field($uid, $clid) { + $logarr = array(); + if($uid && $clid) { + $logarr = DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND clid=%d', array($this->_table, $uid, $clid)); + } + return !empty($logarr) ? $logarr : array(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_cron.php b/source/class/table/table_common_cron.php new file mode 100644 index 0000000..fa80f31 --- /dev/null +++ b/source/class/table/table_common_cron.php @@ -0,0 +1,40 @@ +_table = 'common_cron'; + $this->_pk = 'cronid'; + + parent::__construct(); + } + + public function fetch_nextrun($timestamp) { + $timestamp = intval($timestamp); + return DB::fetch_first('SELECT * FROM '.DB::table($this->_table)." WHERE available>'0' AND nextrun<='$timestamp' ORDER BY nextrun LIMIT 1"); + } + + public function fetch_nextcron() { + return DB::fetch_first('SELECT * FROM '.DB::table($this->_table)." WHERE available>'0' ORDER BY nextrun LIMIT 1"); + } + + public function get_cronid_by_filename($filename) { + return DB::result_first('SELECT cronid FROM '.DB::table($this->_table)." WHERE filename='$filename'"); + } + + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_district.php b/source/class/table/table_common_district.php new file mode 100644 index 0000000..16c7476 --- /dev/null +++ b/source/class/table/table_common_district.php @@ -0,0 +1,42 @@ +_table = 'common_district'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all_by_upid($upid, $order = null, $sort = 'DESC') { + $upid = is_array($upid) ? array_map('intval', (array)$upid) : dintval($upid); + if($upid !== null) { + $ordersql = $order !== null && !empty($order) ? ' ORDER BY '.DB::order($order, $sort) : ''; + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('upid', $upid)." $ordersql", array($this->_table), $this->_pk); + } + return array(); + } + + public function fetch_all_by_name($name) { + if(!empty($name)) { + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('name', $name), array($this->_table)); + } + return array(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_diy_data.php b/source/class/table/table_common_diy_data.php new file mode 100644 index 0000000..e163bf8 --- /dev/null +++ b/source/class/table/table_common_diy_data.php @@ -0,0 +1,97 @@ +_table = 'common_diy_data'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_diy($id, $force_from_db); + } + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_diy($val, $unbuffered); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_diy($val, $data, $unbuffered); + } + } + + public function fetch_all($ids, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? null : $force_from_db; + return $this->fetch_all_diy($ids, $force_from_db); + } + } + + public function fetch_diy($targettplname, $tpldirectory) { + return !empty($targettplname) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('targettplname', $targettplname).' AND '.DB::field('tpldirectory', $tpldirectory)) : array(); + } + + public function delete_diy($targettplname, $tpldirectory = null) { + foreach($this->fetch_all_diy($targettplname, $tpldirectory) as $value) { + $file = ($value['tpldirectory'] ? $value['tpldirectory'].'/' : '').$value['targettplname']; + @unlink(DISCUZ_ROOT.'./data/diy/'.$file.'.htm'); + @unlink(DISCUZ_ROOT.'./data/diy/'.$file.'.htm.bak'); + @unlink(DISCUZ_ROOT.'./data/diy/'.$file.'_diy_preview.htm'); + } + return DB::delete($this->_table, DB::field('targettplname', $targettplname).($tpldirectory !== null ? ' AND '.DB::field('tpldirectory', $tpldirectory) : '')); + } + + public function update_diy($targettplname, $tpldirectory, $data) { + if(!empty($targettplname) && !empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('targettplname', $targettplname).' AND '.DB::field('tpldirectory', $tpldirectory)); + } + return false; + } + + public function fetch_all_diy($targettplname, $tpldirectory = null) { + return !empty($targettplname) ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('targettplname', $targettplname).($tpldirectory !== null ? ' AND '.DB::field('tpldirectory', $tpldirectory) : '')) : array(); + } + + public function count_by_where($wheresql) { + $wheresql = $wheresql ? ' WHERE '.$wheresql : ''; + return DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).$wheresql); + } + + public function fetch_all_by_where($wheresql, $ordersql, $start, $limit) { + $wheresql = $wheresql ? ' WHERE '.$wheresql : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).$wheresql.' '.$ordersql.DB::limit($start, $limit), null, $this->_pk ? $this->_pk : ''); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_domain.php b/source/class/table/table_common_domain.php new file mode 100644 index 0000000..ea9ff7f --- /dev/null +++ b/source/class/table/table_common_domain.php @@ -0,0 +1,56 @@ +_table = 'common_domain'; + $this->_pk = ''; + + parent::__construct(); + } + + public function update_by_idtype($idtype, $data) { + if($idtype && !empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('idtype', $idtype)); + } + return 0; + } + + public function fetch_all_by_idtype($idtype) { + if(!empty($idtype)) { + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('idtype', $idtype), array($this->_table)); + } + return array(); + } + public function fetch_by_domain_domainroot($domain, $droot) { + return DB::fetch_first('SELECT * FROM %t WHERE domain=%s AND domainroot=%s', array($this->_table, $domain, $droot)); + } + + public function delete_by_id_idtype($id, $idtype) { + $parameter = array($this->_table, $id, $idtype); + $wherearr = array(); + $wherearr[] = is_array($id) ? 'id IN(%n)' : 'id=%d'; + $wherearr[] = is_array($idtype) ? 'idtype IN(%n)' : 'idtype=%s'; + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::query("DELETE FROM %t $wheresql", $parameter); + } + + public function count_by_domain_domainroot($domain, $droot) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE domain=%s AND domainroot=%s', array($this->_table, $domain, $droot)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_failedip.php b/source/class/table/table_common_failedip.php new file mode 100644 index 0000000..8669a81 --- /dev/null +++ b/source/class/table/table_common_failedip.php @@ -0,0 +1,39 @@ +_table = 'common_failedip'; + $this->_pk = ''; + + parent::__construct(); + } + + public function get_ip_count($ip, $time) { + return DB::result_first("SELECT SUM(`count`) FROM %t WHERE ip=%s AND lastupdate>%d", array($this->_table, $ip, $time)); + } + + public function insert_ip($ip) { + if(DB::result_first("SELECT COUNT(*) FROM %t WHERE ip=%s AND lastupdate=%d", array($this->_table, $ip, TIMESTAMP))) { + DB::query("UPDATE %t SET `count`=`count`+1 WHERE ip=%s AND lastupdate=%d", array($this->_table, $ip, TIMESTAMP)); + } else { + DB::query("INSERT INTO %t VALUES (%s, %d, 1)", array($this->_table, $ip, TIMESTAMP)); + } + DB::query("DELETE FROM %t WHERE lastupdate<%d", array($this->_table, TIMESTAMP - 3600)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_failedlogin.php b/source/class/table/table_common_failedlogin.php new file mode 100644 index 0000000..879bd08 --- /dev/null +++ b/source/class/table/table_common_failedlogin.php @@ -0,0 +1,41 @@ +_table = 'common_failedlogin'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_username($ip, $username) { + return DB::fetch_first("SELECT * FROM %t WHERE ip=%s AND username=%s", array($this->_table, $ip, $username)); + } + public function fetch_ip($ip) { + return DB::fetch_first("SELECT * FROM %t WHERE ip=%s", array($this->_table, $ip)); + } + + public function delete_old($time) { + DB::query("DELETE FROM %t WHERE lastupdate<%d", array($this->_table, TIMESTAMP - intval($time)), 'UNBUFFERED'); + } + + public function update_failed($ip) { + DB::query("UPDATE %t SET count=count+1, lastupdate=%d WHERE ip=%s", array($this->_table, TIMESTAMP, $ip)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_friendlink.php b/source/class/table/table_common_friendlink.php new file mode 100644 index 0000000..8f36d23 --- /dev/null +++ b/source/class/table/table_common_friendlink.php @@ -0,0 +1,36 @@ +_table = 'common_friendlink'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all_by_displayorder($type = '') + { + $args = array($this->_table); + if($type) { + $sql = 'WHERE (`type` & %s > 0)'; + $args[] = $type; + } + return DB::fetch_all("SELECT * FROM %t $sql ORDER BY displayorder", $args, $this->_pk); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_grouppm.php b/source/class/table/table_common_grouppm.php new file mode 100644 index 0000000..0f4331b --- /dev/null +++ b/source/class/table/table_common_grouppm.php @@ -0,0 +1,58 @@ +_table = 'common_grouppm'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all_by_id_authorid($id = 0, $authorid = 0) { + $wherearr = $data = array(); + $parameter = array($this->_table); + if($id) { + $id = is_array($id) ? array_map('intval', (array)$id) : dintval($id); + $wherearr[] = is_array($id) ? 'id IN(%n)' : 'id=%d'; + $parameter[] = $id; + } + if($authorid) { + $authorid = dintval($authorid); + $wherearr[] = 'authorid=%d'; + $parameter[] = $authorid; + } + $wheresql = !empty($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + $query = DB::query("SELECT * FROM %t $wheresql ORDER BY id DESC", $parameter); + while($row = DB::fetch($query)) { + $data[$row['id']] = $row; + $this->_uids[$row['authorid']] = $row['authorid']; + } + return $data; + } + + public function count_by_id_authorid($id, $authorid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE id=%d AND authorid=%d', array($this->_table, $id, $authorid)); + } + + public function get_uids() { + return $this->_uids; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_invite.php b/source/class/table/table_common_invite.php new file mode 100644 index 0000000..b033479 --- /dev/null +++ b/source/class/table/table_common_invite.php @@ -0,0 +1,114 @@ +_table = 'common_invite'; + $this->_pk = 'id'; + + parent::__construct(); + } + public function fetch_by_id_uid($id, $uid) { + return DB::fetch_first('SELECT * FROM %t WHERE id=%d AND uid=%d', array($this->_table, $id, $uid)); + } + public function fetch_by_code($code) { + return DB::fetch_first('SELECT * FROM %t WHERE code=%s', array($this->_table, $code)); + } + public function fetch_all_by_uid($uid) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC', array($this->_table, $uid), $this->_pk); + } + public function fetch_all_invitenum_group_by_uid($dateline = 0, $start = 0, $limit = 0) { + $sql = ''; + $parameter = array($this->_table); + if($dateline) { + $sql = ' AND dateline>%d'; + $parameter[] = $dateline; + } + return DB::fetch_all("SELECT count(*) AS invitenum ,uid FROM %t WHERE status=2 $sql GROUP BY uid ORDER BY invitenum DESC ".DB::limit($start, $limit), $parameter); + } + public function fetch_all_orderid($orderid) { + return DB::fetch_all('SELECT * FROM %t WHERE orderid=%s', array($this->_table, $orderid)); + } + public function fetch_all_by_search($uid = 0, $fuid = 0, $fusername = '', $buydatestart = 0, $buydateend = 0, $inviteip = '', $code = '', $start = 0, $limit = 0) { + $condition = $this->make_query_condition($uid, $fuid, $fusername, $buydatestart, $buydateend, $inviteip, $code); + $data = array(); + $query = DB::query("SELECT * FROM %t $condition[0] ORDER BY id DESC ".DB::limit($start, $limit), $condition[1]); + while($value = DB::fetch($query)) { + $this->_uids[$value['uid']] = $value['uid']; + $data[] = $value; + } + return $data; + } + public function count_by_uid_fuid($uid, $fuid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND fuid=%d', array($this->_table, $uid, $fuid)); + } + public function count_by_uid_dateline($uid, $dateline) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND dateline>%d', array($this->_table, $uid, $dateline)); + } + public function count_by_search($uid = 0, $fuid = 0, $fusername = '', $buydatestart = 0, $buydateend = 0, $inviteip = '', $code = '') { + $condition = $this->make_query_condition($uid, $fuid, $fusername, $buydatestart, $buydateend, $inviteip, $code); + return DB::result_first('SELECT COUNT(*) FROM %t '.$condition[0], $condition[1]); + } + public function delete_by_uid_or_fuid($uids) { + $uids = dintval($uids, true); + if(!$uids) { + return null; + } + DB::delete($this->_table, DB::field('uid', $uids).' OR '.DB::field('fuid', $uids)); + } + public function get_uids() { + return $this->_uids; + } + + private function make_query_condition($uid = 0, $fuid = 0, $fusername = '', $buydatestart = 0, $buydateend = 0, $inviteip = '', $code = '') { + $parameter = array($this->_table); + $wherearr = array(); + if(!empty($uid)) { + $parameter[] = $uid; + $wherearr[] = 'uid=%d'; + } + if(!empty($fuid)) { + $parameter[] = $fuid; + $wherearr[] = 'fuid=%d'; + } + if(!empty($fusername)) { + $parameter[] = $fusername; + $wherearr[] = "fusername=%s"; + } + if(!empty($code)) { + $parameter[] = $code; + $wherearr[] = 'code=%s'; + } + if($buydatestart) { + $parameter[] = $buydatestart; + $wherearr[] = "dateline>%d"; + } + if($buydateend) { + $parameter[] = $buydateend; + $wherearr[] = 'dateline<%d'; + } + if(!empty($inviteip)) { + $parameter[] = '%'.$inviteip.'%'; + $wherearr[] = "inviteip LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + } + + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_magic.php b/source/class/table/table_common_magic.php new file mode 100644 index 0000000..3b1467f --- /dev/null +++ b/source/class/table/table_common_magic.php @@ -0,0 +1,67 @@ +_table = 'common_magic'; + $this->_pk = 'magicid'; + + parent::__construct(); + } + + public function fetch_all_data($available = false) { + $available = $available !== false ? ' WHERE available='.intval($available) : ''; + return DB::fetch_all('SELECT * FROM %t %i ORDER BY displayorder', array($this->_table, $available)); + } + + public function check_identifier($identifier, $magicid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE identifier=%s AND magicid!=%d", array($this->_table, $identifier, $magicid)); + } + + public function count_page($operation) { + $salevolume = $operation == 'index' ? '' : 'AND salevolume>0'; + return DB::result_first('SELECT COUNT(*) FROM %t WHERE available=1 %i', array($this->_table, $salevolume)); + } + + public function fetch_all_page($operation, $start, $limit) { + if($operation == 'index') { + $salevolume = ''; + $orderby = "displayorder, magicid"; + } else { + $salevolume = 'AND salevolume>0'; + $orderby = "salevolume DESC, magicid"; + } + return DB::fetch_all('SELECT * FROM %t WHERE available=1 %i ORDER BY %i LIMIT %d,%d', array($this->_table, $salevolume, $orderby, $start, $limit)); + } + + public function fetch_all_name_by_available($available = 1) { + return DB::fetch_all('SELECT magicid, name FROM %t WHERE available=%d ORDER BY displayorder', array($this->_table, $available), $this->_pk); + } + + public function fetch_by_identifier($identifier) { + return DB::fetch_first('SELECT * FROM %t WHERE identifier=%s', array($this->_table, $identifier)); + } + + public function update_salevolume($magicid, $number) { + DB::query("UPDATE %t SET num=num+('-%d'), salevolume=salevolume+'%d' WHERE magicid=%d", array($this->_table, $number, $number, $magicid)); + } + + public function fetch_member_magic($uid, $identifier) { + return DB::fetch_first('SELECT mm.* FROM %t cm INNER JOIN %t mm ON mm.uid=%d AND mm.magicid=cm.magicid WHERE cm.identifier=%s', array($this->_table, 'common_member_magic', $uid, $identifier)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_magiclog.php b/source/class/table/table_common_magiclog.php new file mode 100644 index 0000000..c8f5adb --- /dev/null +++ b/source/class/table/table_common_magiclog.php @@ -0,0 +1,89 @@ +_table = 'common_magiclog'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_all_by_magicid_action($magicid, $action, $start = 0, $limit = 0) { + $sql = array(); + if($magicid) { + $magicid = dintval($magicid, true); + $sql[] = DB::field('magicid', $magicid); + } + if($action) { + $sql[] = DB::field('action', $action); + } + $wheresql = ($sql ? 'WHERE ' : '').implode(' AND ', $sql); + return DB::fetch_all('SELECT * FROM %t %i ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $wheresql)); + } + public function fetch_all_by_magicid_action_uid($mid, $action, $uid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE magicid=%d AND action=%d AND uid!=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $mid, $action, $uid)); + } + public function fetch_all_by_uid_action($uid, $action, $start, $limit, $order = 'DESC') { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND action=%d '.($order ? 'ORDER BY '.DB::order('dateline', $order) : '').' '.($limit ? DB::limit($start, $limit) : ''), array($this->_table, $uid, $action)); + } + public function fetch_all_by_targetuid_action($uid, $action, $start, $limit, $order = 'DESC') { + return DB::fetch_all('SELECT * FROM %t WHERE targetuid=%d AND action=%d '.($order ? 'ORDER BY '.DB::order('dateline', $order) : '').' '.($limit ? DB::limit($start, $limit) : ''), array($this->_table, $uid, $action)); + } + public function count_by_targetuid_action($uid, $action) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE targetuid=%d AND action=%d', array($this->_table, $uid, $action)); + } + public function count_by_magicid_action($magicid, $action) { + $sql = array(); + if($magicid) { + $magicid = dintval($magicid, true); + $sql[] = DB::field('magicid', $magicid); + } + if($action) { + $sql[] = DB::field('action', $action); + } + $wheresql = ($sql ? 'WHERE ' : '').implode(' AND ', $sql); + return DB::result_first('SELECT COUNT(*) FROM %t %i', array($this->_table, $wheresql)); + } + public function count_by_action_uid_targetid_idtype_magicid($action, $uid, $targetid, $idtype, $magicid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE action=%d AND uid=%d AND targetid=%d AND idtype=%d AND magicid=%d', array($this->_table, $action, $uid, $targetid, $idtype, $magicid)); + } + public function count_by_uid_magicid_action_dateline($uid, $magicid, $action, $dateline) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND magicid=%d AND action=%d AND dateline>%d', array($this->_table, $uid, $magicid, $action, $dateline)); + } + public function count_by_uid_action($uid, $action) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND action=%d', array($this->_table, $uid, $action)); + } + public function count_by_action_uid_dateline($action, $uid, $dateline, $maxdateline = 0) { + $wherearr = array(); + $wherearr[] = 'action=%d'; + $wherearr[] = 'uid=%d'; + $wherearr[] = $maxdateline ? 'dateline BETWEEN %d AND %d' : 'dateline>%d'; + $parameter = array($this->_table, $action, $uid, $dateline); + if($maxdateline) { + $parameter[] = $maxdateline; + } + return DB::result_first('SELECT COUNT(*) FROM %t WHERE '.implode(' AND ', $wherearr), $parameter); + } + public function delete_by_magicid($ids) { + $ids = dintval($ids, true); + if($ids) { + return DB::delete($this->_table, DB::field('magicid', $ids)); + } + return 0; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_mailcron.php b/source/class/table/table_common_mailcron.php new file mode 100644 index 0000000..db7ca2e --- /dev/null +++ b/source/class/table/table_common_mailcron.php @@ -0,0 +1,45 @@ +_table = 'common_mailcron'; + $this->_pk = 'cid'; + + parent::__construct(); + } + + public function delete_by_touid($touids) { + if(empty($touids)) { + return false; + } + return DB::query('DELETE FROM mc, mq USING %t AS mc, %t AS mq WHERE mc.'.DB::field('touid', $touids).' AND mc.cid=mq.cid', + array($this->_table, 'common_mailqueue'), false, true); + } + + public function fetch_all_by_email($email, $start, $limit) { + return DB::fetch_all('SELECT * FROM %t WHERE email=%s '.DB::limit($start, $limit), array($this->_table, $email)); + } + + public function fetch_all_by_touid($touid, $start, $limit) { + return DB::fetch_all('SELECT * FROM %t WHERE touid=%d '.DB::limit($start, $limit), array($this->_table, $touid)); + } + + public function fetch_all_by_sendtime($sendtime, $start, $limit) { + return DB::fetch_all('SELECT * FROM %t WHERE sendtime<=%d ORDER BY sendtime '.DB::limit($start, $limit), array($this->_table, $sendtime)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_mailqueue.php b/source/class/table/table_common_mailqueue.php new file mode 100644 index 0000000..597555b --- /dev/null +++ b/source/class/table/table_common_mailqueue.php @@ -0,0 +1,39 @@ +_table = 'common_mailqueue'; + $this->_pk = 'qid'; + + parent::__construct(); + } + + public function fetch_all_by_cid($cids) { + if(empty($cids)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('cid', $cids), array($this->_table)); + } + + public function delete_by_cid($cids) { + if(empty($cids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('cid', $cids), array($this->_table)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member.php b/source/class/table/table_common_member.php new file mode 100644 index 0000000..c5ed3d1 --- /dev/null +++ b/source/class/table/table_common_member.php @@ -0,0 +1,536 @@ +_table = 'common_member'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_'; + + parent::__construct(); + } + + public function update_credits($uid, $credits) { + if($uid) { + $data = array('credits'=>intval($credits)); + DB::update($this->_table, $data, array('uid' => intval($uid)), 'UNBUFFERED'); + $this->update_cache($uid, $data); + } + } + + public function update_by_groupid($groupid, $data) { + $uids = array(); + $groupid = dintval($groupid, true); + if($groupid && $this->_allowmem) { + $uids = array_keys($this->fetch_all_by_groupid($groupid)); + } + if($groupid && !empty($data) && is_array($data)) { + DB::update($this->_table, $data, DB::field('groupid', $groupid), 'UNBUFFERED'); + } + if($uids) { + $this->update_cache($uids, $data); + } + } + + public function increase($uids, $setarr) { + $uids = dintval((array)$uids, true); + $sql = array(); + $allowkey = array('credits', 'newpm', 'newprompt'); + foreach($setarr as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + if(!empty($sql)){ + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE uid IN (".dimplode($uids).")", 'UNBUFFERED'); + $this->increase_cache($uids, $setarr); + } + } + + public function fetch_by_username($username, $fetch_archive = 0) { + $user = array(); + if($username) { + $user = DB::fetch_first('SELECT * FROM %t WHERE username=%s', array($this->_table, $username)); + if(isset($this->membersplit) && $fetch_archive && empty($user)) { + $user = C::t($this->_table.'_archive')->fetch_by_username($username, 0); + } + } + return $user; + } + + public function fetch_all_by_username($usernames, $fetch_archive = 1) { + $users = array(); + if(!empty($usernames)) { + $users = DB::fetch_all('SELECT * FROM %t WHERE username IN (%n)', array($this->_table, (array)$usernames), 'username'); + if(isset($this->membersplit) && $fetch_archive && count($usernames) !== count($users)) { + $users += C::t($this->_table.'_archive')->fetch_all_by_username($usernames, 0); + } + } + return $users; + } + + public function fetch_uid_by_username($username, $fetch_archive = 0) { + $uid = 0; + if($username) { + $uid = DB::result_first('SELECT uid FROM %t WHERE username=%s', array($this->_table, $username)); + if(isset($this->membersplit) && $fetch_archive && empty($uid)) { + $uid = C::t($this->_table.'_archive')->fetch_uid_by_username($username, 0); + } + } + return $uid; + } + + public function fetch_all_uid_by_username($usernames, $fetch_archive = 1) { + $uids = array(); + if($usernames) { + foreach($this->fetch_all_by_username($usernames, $fetch_archive) as $username => $value) { + $uids[$username] = $value['uid']; + } + } + return $uids; + } + + public function fetch_all_by_adminid($adminids, $fetch_archive = 1) { + $users = array(); + $adminids = dintval((array)$adminids, true); + if($adminids) { + $users = DB::fetch_all('SELECT * FROM %t WHERE adminid IN (%n) ORDER BY adminid, uid', array($this->_table, (array)$adminids), $this->_pk); + if(isset($this->membersplit) && $fetch_archive) { + $users += C::t($this->_table.'_archive')->fetch_all_by_adminid($adminids, 0); + } + } + return $users; + } + + public function fetch_all_username_by_uid($uids) { + $users = array(); + if(($uids = dintval($uids, true))) { + foreach($this->fetch_all($uids) as $uid => $value) { + $users[$uid] = $value['username']; + } + } + return $users; + } + + public function count_by_groupid($groupid) { + return $groupid ? DB::result_first('SELECT COUNT(*) FROM %t WHERE '.DB::field('groupid', $groupid), array($this->_table)) : 0; + } + + public function fetch_all_by_groupid($groupid, $start = 0, $limit = 0) { + $users = array(); + if(($groupid = dintval($groupid, true))) { + $users = DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('groupid', $groupid).' '.DB::limit($start, $limit), null, 'uid'); + } + return $users; + } + + public function fetch_all_groupid() { + return DB::fetch_all('SELECT DISTINCT(groupid) FROM '.DB::table($this->_table), null, 'groupid'); + } + + public function fetch_all_by_allowadmincp($val, $glue = '=') { + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('allowadmincp', intval($val), $glue), NULL, 'uid'); + } + + public function update_admincp_manage($uids) { + if(($uids = dintval($uids, true))) { + $data = DB::query('UPDATE '.DB::table($this->_table).' SET allowadmincp=allowadmincp | 1 WHERE uid IN ('.dimplode($uids).')'); + $this->reset_cache($uids); + return $data; + } + return false; + } + + public function clean_admincp_manage($uids) { + if(($uids = dintval($uids, true))) { + $data = DB::query('UPDATE '.DB::table($this->_table).' SET allowadmincp=allowadmincp & 0xFE WHERE uid IN ('.dimplode($uids).')'); + $this->reset_cache($uids); + return $data; + } + return false; + } + + public function fetch_all_ban_by_groupexpiry($timestamp) { + return ($timestamp = intval($timestamp)) ? DB::fetch_all("SELECT uid, groupid, credits FROM ".DB::table($this->_table)." WHERE groupid IN ('4', '5') AND groupexpiry>'0' AND groupexpiry<'$timestamp'", array(), 'uid') : array(); + } + + public function count($fetch_archive = 1) { + $count = DB::result_first('SELECT COUNT(*) FROM %t', array($this->_table)); + if(isset($this->membersplit) && $fetch_archive) { + $count += C::t($this->_table.'_archive')->count(0); + } + $count += intval(DB::result_first('SELECT COUNT(*) FROM '.DB::table('common_connect_guest'), null, true)); + return $count; + } + + public function fetch_by_email($email, $fetch_archive = 0) { + $user = array(); + if($email) { + $user = DB::fetch_first('SELECT * FROM %t WHERE email=%s', array($this->_table, $email)); + if(isset($this->membersplit) && $fetch_archive && empty($user)) { + $user = C::t($this->_table.'_archive')->fetch_by_email($email, 0); + } + } + return $user; + } + + public function fetch_all_by_email($emails, $fetch_archive = 1) { + $users = array(); + if(!empty($emails)) { + $users = DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('email', $emails)), 'email'); + if(isset($this->membersplit) && $fetch_archive && count($emails) !== count($users)) { + $users += C::t($this->_table.'_archive')->fetch_all_by_email($emails, 0); + } + } + return $users; + } + + public function count_by_email($email, $fetch_archive = 0) { + $count = 0; + if($email) { + $count = DB::result_first('SELECT COUNT(*) FROM %t WHERE email=%s', array($this->_table, $email)); + if(isset($this->membersplit) && $fetch_archive) { + $count += C::t($this->_table.'_archive')->count_by_email($email, 0); + } + } + return $count; + } + + public function fetch_all_by_like_username($username, $start = 0, $limit = 0) { + $data = array(); + if($username) { + $data = DB::fetch_all('SELECT * FROM %t WHERE username LIKE %s'.DB::limit($start, $limit), array($this->_table, stripsearchkey($username).'%'), 'uid'); + } + return $data; + } + + public function count_by_like_username($username) { + return !empty($username) ? DB::result_first('SELECT COUNT(*) FROM %t WHERE username LIKE %s', array($this->_table, stripsearchkey($username).'%')) : 0; + } + + + public function fetch_runtime() { + return DB::result_first("SELECT (MAX(regdate)-MIN(regdate))/86400 AS runtime FROM ".DB::table($this->_table)); + } + + public function count_admins() { + return DB::result_first("SELECT COUNT(*) FROM ".DB::table($this->_table)." WHERE adminid<>'0' AND adminid<>'-1'"); + } + + public function count_by_regdate($timestamp) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE regdate>%d', array($this->_table, $timestamp)); + } + + public function fetch_all_stat_memberlist($username, $orderby = '', $sort = '', $start = 0, $limit = 0) { + $orderby = in_array($orderby, array('uid','credits','regdate', 'gender','username','posts','lastvisit'), true) ? $orderby : 'uid'; + $sql = ''; + + $sql = !empty($username) ? " WHERE username LIKE '".addslashes(stripsearchkey($username))."%'" : ''; + + $memberlist = array(); + $query = DB::query("SELECT m.uid, m.username, mp.gender, m.email, m.regdate, ms.lastvisit, mc.posts, m.credits + FROM ".DB::table($this->_table)." m + LEFT JOIN ".DB::table('common_member_profile')." mp ON mp.uid=m.uid + LEFT JOIN ".DB::table('common_member_status')." ms ON ms.uid=m.uid + LEFT JOIN ".DB::table('common_member_count')." mc ON mc.uid=m.uid + $sql ORDER BY ".DB::order($orderby, $sort).DB::limit($start, $limit)); + while($member = DB::fetch($query)) { + $member['usernameenc'] = rawurlencode($member['username']); + $member['regdate'] = dgmdate($member['regdate']); + $member['lastvisit'] = dgmdate($member['lastvisit']); + $memberlist[$member['uid']] = $member; + } + return $memberlist; + } + + public function delete_no_validate($uids) { + if(($uids = dintval($uids, true))) { + $delnum = $this->delete($uids); + C::t('common_member_field_forum')->delete($uids); + C::t('common_member_field_home')->delete($uids); + C::t('common_member_status')->delete($uids); + C::t('common_member_count')->delete($uids); + C::t('common_member_profile')->delete($uids); + C::t('common_member_validate')->delete($uids); + return $delnum; + } + return false; + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false, $null1 = null, $null2 = null, $null3 = null, $null4 = 0, $null5 = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + if ($return_insert_id === false || $replace === false || $silent === false || $null1 === null || $null2 === null || $null3 === null) { + throw new Exception("Invalid Use C:t('common_member')->insert Function."); + } + return $this->insert_user($data, $return_insert_id, $replace, $silent, $null1, $null2, $null3, $null4, $null5); + } + } + + public function insert_user($uid, $username, $password, $email, $ip, $groupid, $extdata, $adminid = 0, $port = 0) { + if(($uid = dintval($uid))) { + $credits = isset($extdata['credits']) ? $extdata['credits'] : array(); + $profile = isset($extdata['profile']) ? $extdata['profile'] : array(); + $profile['uid'] = $uid; + $base = array( + 'uid' => $uid, + 'username' => (string)$username, + 'password' => (string)$password, + 'email' => (string)$email, + 'adminid' => intval($adminid), + 'groupid' => intval($groupid), + 'regdate' => TIMESTAMP, + 'emailstatus' => intval($extdata['emailstatus']), + 'credits' => dintval($credits[0]), + 'timeoffset' => 9999 + ); + $status = array( + 'uid' => $uid, + 'regip' => (string)$ip, + 'lastip' => (string)$ip, + 'port' => (string)$port, + 'regport' => (string)$port, + 'lastvisit' => TIMESTAMP, + 'lastactivity' => TIMESTAMP, + 'lastpost' => 0, + 'lastsendmail' => 0 + ); + $count = array( + 'uid' => $uid, + 'extcredits1' => dintval($credits[1]), + 'extcredits2' => dintval($credits[2]), + 'extcredits3' => dintval($credits[3]), + 'extcredits4' => dintval($credits[4]), + 'extcredits5' => dintval($credits[5]), + 'extcredits6' => dintval($credits[6]), + 'extcredits7' => dintval($credits[7]), + 'extcredits8' => dintval($credits[8]) + ); + $ext = array('uid' => $uid); + parent::insert($base, false, true); + C::t('common_member_status')->insert($status, false, true); + C::t('common_member_count')->insert($count, false, true); + C::t('common_member_profile')->insert($profile, false, true); + C::t('common_member_field_forum')->insert($ext, false, true); + C::t('common_member_field_home')->insert($ext, false, true); + } + } + + public function delete($val, $unbuffered = false, $fetch_archive = 0) { + $ret = false; + if(($val = dintval($val, true))) { + $ret = parent::delete($val, $unbuffered, $fetch_archive); + if($this->_allowmem) { + $data = ($data = memory('get', 'deleteuids')) === false ? array() : $data; + foreach((array)$val as $uid) { + $data[$uid] = $uid; + } + memory('set', 'deleteuids', $data, 86400*2); + } + } + return $ret; + } + + public function count_zombie() { + $dateline = TIMESTAMP - 31536000;//60*60*24*365 + return DB::result_first('SELECT count(*) FROM %t mc, %t ms WHERE mc.posts<5 AND ms.lastvisit<%d AND ms.uid=mc.uid', array('common_member_count', 'common_member_status', $dateline)); + } + + public function split($splitnum, $iscron = false) { + loadcache('membersplitdata'); + @set_time_limit(0); + discuz_database_safecheck::setconfigstatus(0); + $dateline = TIMESTAMP - 31536000;//60*60*24*365 + $temptablename = DB::table('common_member_temp___'); + if(!DB::fetch_first("SHOW TABLES LIKE '$temptablename'")) { + $engine = strtolower(getglobal("config/db/common/engine")) !== 'innodb' ? 'MyISAM' : 'InnoDB'; + DB::query("CREATE TABLE $temptablename (`uid` int(10) NOT NULL DEFAULT 0,PRIMARY KEY (`uid`)) ENGINE=" . $engine . ";"); + } + $splitnum = max(0, intval($splitnum)); + if(!DB::result_first('SELECT COUNT(*) FROM '.$temptablename)) { + DB::query('INSERT INTO '.$temptablename.' (`uid`) SELECT ms.uid AS uid FROM %t mc, %t ms WHERE mc.posts<5 AND ms.lastvisit<%d AND mc.uid=ms.uid ORDER BY ms.uid DESC LIMIT %d', array('common_member_count', 'common_member_status', $dateline, $splitnum)); + } + + if(DB::result_first('SELECT COUNT(*) FROM '.$temptablename) > 1) { + + + if(!$iscron && getglobal('setting/memberspliting') === null) { + $this->switch_keys('disable'); + } + $uidlist = DB::fetch_all('SELECT uid FROM '.$temptablename.' ORDER BY uid DESC', null, 'uid'); + unset($uidlist[key($uidlist)]); + $uids = dimplode(array_keys($uidlist)); + $movesql = 'REPLACE INTO %t SELECT * FROM %t WHERE uid IN ('.$uids.')'; + $deletesql = 'DELETE FROM %t WHERE uid IN ('.$uids.')'; + if(DB::query($movesql, array('common_member_archive', 'common_member'), false, true)) { + DB::query($deletesql, array('common_member'), false, true); + } + if(DB::query($movesql, array('common_member_profile_archive', 'common_member_profile'), false, true)) { + DB::query($deletesql, array('common_member_profile'), false, true); + } + if(DB::query($movesql, array('common_member_field_forum_archive', 'common_member_field_forum'), false, true)) { + DB::query($deletesql, array('common_member_field_forum'), false, true); + } + if(DB::query($movesql, array('common_member_field_home_archive', 'common_member_field_home'), false, true)) { + DB::query($deletesql, array('common_member_field_home'), false, true); + } + if(DB::query($movesql, array('common_member_status_archive', 'common_member_status'), false, true)) { + DB::query($deletesql, array('common_member_status'), false, true); + } + if(DB::query($movesql, array('common_member_count_archive', 'common_member_count'), false, true)) { + DB::query($deletesql, array('common_member_count'), false, true); + } + + DB::query('DROP TABLE '.$temptablename); + $membersplitdata = getglobal('cache/membersplitdata'); + $zombiecount = $membersplitdata['zombiecount'] - $splitnum; + if($zombiecount < 0) { + $zombiecount = 0; + } + savecache('membersplitdata', array('membercount' => $membersplitdata['membercount'], 'zombiecount' => $zombiecount, 'dateline' => TIMESTAMP)); + C::t('common_setting')->delete('memberspliting'); + return true; + } else { + DB::query('DROP TABLE '.$temptablename); + if(!$iscron) { + $this->switch_keys('enable'); + C::t('common_member_profile')->optimize(); + C::t('common_member_field_forum')->optimize(); + C::t('common_member_field_home')->optimize(); + } + return false; + } + } + + public function switch_keys($type) { + if($type === 'disable') { + $type = 'DISABLE'; + C::t('common_setting')->update_batch(array('memberspliting'=>1, 'membersplit'=>1)); + } else { + $type = 'ENABLE'; + C::t('common_setting')->delete('memberspliting'); + } + + require_once libfile('function/cache'); + updatecache('setting'); + } + + public function count_by_credits($credits) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE credits>%d', array($this->_table, $credits)); + } + + public function fetch_all_for_spacecp_search($wherearr, $fromarr, $start = 0, $limit = 100) { + if(!$start && !$limit) { + $start = 100; + } + if(!$wherearr) { + $wherearr[] = '1'; + } + if(!$fromarr) { + $fromarr[] = DB::table($this->_table); + } + return DB::fetch_all("SELECT s.* FROM ".implode(',', $fromarr)." WHERE ".implode(' AND ', $wherearr).DB::limit($start, $limit)); + } + + public function fetch_all_girls_for_ranklist($offset = 0, $limit = 20, $orderby = 'ORDER BY s.unitprice DESC, s.credit DESC') { + $members = array(); + $query = DB::query("SELECT m.uid, m.username, mc.*, mp.gender + FROM ".DB::table('common_member')." m + LEFT JOIN ".DB::table('home_show')." s ON s.uid=m.uid + LEFT JOIN ".DB::table('common_member_profile')." mp ON mp.uid=m.uid + LEFT JOIN ".DB::table('common_member_count')." mc ON mc.uid=m.uid + WHERE mp.gender='2' + ORDER BY $orderby + LIMIT $offset, $limit"); + while($member = DB::fetch($query)) { + $member['avatar'] = avatar($member['uid'], 'small'); + $members[] = $member; + } + return $members; + } + + + public function fetch_all_order_by_credit_for_ranklist($num, $orderby) { + $data = array(); + if(!($num = intval($num))) { + return $data; + } + if($orderby === 'all') { + $sql = "SELECT m.uid,m.username,m.groupid,m.credits,field.spacenote FROM ".DB::table('common_member')." m + LEFT JOIN ".DB::table('common_member_field_home')." field ON field.uid=m.uid + ORDER BY m.credits DESC LIMIT 0, $num"; + } else { + $orderby = intval($orderby); + $orderby = in_array($orderby, array(1, 2, 3, 4, 5, 6, 7, 8)) ? $orderby : 1; + $sql = "SELECT m.uid,m.username,m.groupid, mc.extcredits$orderby AS extcredits + FROM ".DB::table('common_member')." m + LEFT JOIN ".DB::table('common_member_count')." mc ON mc.uid=m.uid WHERE mc.extcredits$orderby>0 + ORDER BY extcredits$orderby DESC LIMIT 0, $num"; + } + + $query = DB::query($sql); + while($result = DB::fetch($query)) { + $data[] = $result; + } + + return $data; + + } + + public function fetch_all_order_by_friendnum_for_ranklist($num) { + + $num = intval($num); + $num = $num ? $num : 20; + $data = $users = $oldorder = array(); + $query = DB::query('SELECT uid, friends FROM '.DB::table('common_member_count').' WHERE friends>0 ORDER BY friends DESC LIMIT '.$num); + while($user = DB::fetch($query)) { + $users[$user['uid']] = $user; + $oldorder[] = $user['uid']; + } + $uids = array_keys($users); + if($uids) { + $query = DB::query('SELECT m.uid, m.username, m.groupid, field.spacenote + FROM '.DB::table('common_member')." m + LEFT JOIN ".DB::table('common_member_field_home')." field ON m.uid=field.uid + WHERE m.uid IN (".dimplode($uids).")"); + while($value = DB::fetch($query)) { + $users[$value['uid']] = array_merge($users[$value['uid']], $value); + } + + foreach($oldorder as $uid) { + $data[] = $users[$uid]; + } + + } + return $data; + + } + + public function max_uid() { + return DB::result_first('SELECT MAX(uid) FROM %t', array($this->_table)); + } + + public function range_by_uid($from, $limit) { + return DB::fetch_all('SELECT * FROM %t WHERE uid >= %d ORDER BY uid LIMIT %d', array($this->_table, $from, $limit), $this->_pk); + } + + public function update_groupid_by_groupid($source, $target) { + return DB::query('UPDATE %t SET groupid=%d WHERE adminid <= 0 AND groupid=%d', array($this->_table, $target, $source)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_action_log.php b/source/class/table/table_common_member_action_log.php new file mode 100644 index 0000000..706cbf3 --- /dev/null +++ b/source/class/table/table_common_member_action_log.php @@ -0,0 +1,41 @@ +_table = 'common_member_action_log'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function delete_by_dateline($timestamp) { + DB::delete($this->_table, 'dateline < '.dintval($timestamp)); + } + + public function count_day_hours($action, $uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE dateline>%d AND action=%d AND uid=%d', array($this->_table, TIMESTAMP - 86400, $action, $uid)); + } + + public function count_per_hour($uid, $type) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE dateline>%d AND `action`=%d AND uid=%d', array($this->_table, TIMESTAMP - 3600, getuseraction($type), $uid)); + } + + public function delete_by_uid($uids) { + DB::delete($this->_table, 'uid IN ('.dimplode($uids).')'); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_archive.php b/source/class/table/table_common_member_archive.php new file mode 100644 index 0000000..085cce6 --- /dev/null +++ b/source/class/table/table_common_member_archive.php @@ -0,0 +1,242 @@ +_table = 'common_member_archive'; + $this->_pk = 'uid'; + } + + public function fetch($id, $force_from_db = true, $fetch_archive = 1){ + $data = array(); + if(isset($this->membersplit) && ($id = dintval($id)) && ($data = DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)))) { + $data['_inarchive'] = true; + } + return $data; + } + + public function fetch_by_username($username, $fetch_archive = 1) { + $user = array(); + if(isset($this->membersplit) && $username && ($user = DB::fetch_first('SELECT * FROM %t WHERE username=%s', array($this->_table, $username)))) { + $user['_inarchive'] = true; + } + return $user; + } + + public function fetch_uid_by_username($username, $fetch_archive = 1) { + $uid = 0; + if(isset($this->membersplit) && $username) { + $uid = DB::result_first('SELECT uid FROM %t WHERE username=%s', array($this->_table, $username)); + } + return $uid; + } + + public function count($fetch_archive = 1) { + return isset($this->membersplit) ? DB::result_first('SELECT COUNT(*) FROM %t', array($this->_table)) : 0; + } + + public function fetch_by_email($email, $fetch_archive = 1) { + $user = array(); + if(isset($this->membersplit) && $email && ($user = DB::fetch_first('SELECT * FROM %t WHERE email=%s', array($this->_table, $email)))) { + $user['_inarchive'] = true; + } + return $user; + } + + + public function count_by_email($email, $fetch_archive = 1) { + $count = 0; + if(isset($this->membersplit) && $email) { + $count = DB::result_first('SELECT COUNT(*) FROM %t WHERE email=%s', array($this->_table, $email)); + } + return $count; + } + + public function fetch_all($ids, $force_from_db = false, $fetch_archive = 1) { + $data = array(); + if(isset($this->membersplit) && ($ids = dintval($ids, true))) { + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids)); + while($value = DB::fetch($query)) { + $value['_inarchive'] = true; + $data[$value[$this->_pk]] = $value; + } + } + return $data; + } + + public function move_to_master($uid){ + if(isset($this->membersplit) && ($uid = intval($uid)) && ($member = $this->fetch($uid))) { + unset($member['_inarchive']); + DB::insert('common_member',$member); + C::t('common_member_count')->insert(C::t('common_member_count_archive')->fetch($uid)); + C::t('common_member_status')->insert(C::t('common_member_status_archive')->fetch_status($uid)); + C::t('common_member_profile')->insert(C::t('common_member_profile_archive')->fetch_profile($uid)); + C::t('common_member_field_home')->insert(C::t('common_member_field_home_archive')->fetch($uid)); + C::t('common_member_field_forum')->insert(C::t('common_member_field_forum_archive')->fetch($uid)); + $this->delete($uid); + C::t('common_member_count_archive')->delete($uid); + C::t('common_member_status_archive')->delete_status($uid); + C::t('common_member_profile_archive')->delete_profile($uid); + C::t('common_member_field_home_archive')->delete($uid); + C::t('common_member_field_forum_archive')->delete($uid); + } + } + + public function delete($val, $unbuffered = false, $fetch_archive = 1) { + return isset($this->membersplit) && ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + } + + public function check_table() { + if(DB::fetch_first("SHOW TABLES LIKE '".DB::table('common_member_archive')."'")){ + return false; + } else { + $mastertables = array('common_member', 'common_member_count', 'common_member_status', 'common_member_profile', 'common_member_field_home', 'common_member_field_forum'); + foreach($mastertables as $tablename) { + $createtable = DB::fetch_first('SHOW CREATE TABLE '.DB::table($tablename)); + DB::query(str_replace(DB::table($tablename), DB::table("{$tablename}_archive"), $createtable['Create Table'])); + } + return true; + } + } + + public function rebuild_table($step) { + $mastertables = array('common_member', 'common_member_count', 'common_member_status', 'common_member_profile', 'common_member_field_home', 'common_member_field_forum'); + + if(!isset($mastertables[$step])) { + return false; + } + $updates = array(); + $mastertable = DB::table($mastertables[$step]); + $archivetable = DB::table($mastertables[$step].'_archive'); + + $mastercols = DB::fetch_all('SHOW COLUMNS FROM '.$mastertable, null, 'Field'); + $archivecols = DB::fetch_all('SHOW COLUMNS FROM '.$archivetable, null, 'Field'); + foreach(array_diff(array_keys($archivecols), array_keys($mastercols)) as $field) { + $updates[] = "DROP `$field`"; + } + + $createtable = DB::fetch_first('SHOW CREATE TABLE '.$mastertable); + $mastercols = $this->getcolumn($createtable['Create Table']); + + $archivecreatetable = DB::fetch_first('SHOW CREATE TABLE '.$archivetable); + $oldcols = $this->getcolumn($archivecreatetable['Create Table']); + + $indexmastercols =array_keys($mastercols); + foreach ($mastercols as $key => $value) { + if($key == 'PRIMARY') { + if($value != $oldcols[$key]) { + if(!empty($oldcols[$key])) { + $usql = "RENAME TABLE ".$archivetable." TO ".$archivetable.'_bak'; + if(!DB::query($usql, 'SILENT')) { + return $mastertable; + } + } + $updates[] = "ADD PRIMARY KEY $value"; + } + } elseif ($key == 'KEY') { + foreach ($value as $subkey => $subvalue) { + if(!empty($oldcols['KEY'][$subkey])) { + if($subvalue != $oldcols['KEY'][$subkey]) { + $updates[] = "DROP INDEX `$subkey`"; + $updates[] = "ADD INDEX `$subkey` $subvalue"; + } + } else { + $updates[] = "ADD INDEX `$subkey` $subvalue"; + } + } + } elseif ($key == 'UNIQUE') { + foreach ($value as $subkey => $subvalue) { + if(!empty($oldcols['UNIQUE'][$subkey])) { + if($subvalue != $oldcols['UNIQUE'][$subkey]) { + $updates[] = "DROP INDEX `$subkey`"; + $updates[] = "ADD UNIQUE INDEX `$subkey` $subvalue"; + } + } else { + $usql = "ALTER TABLE ".$archivetable." DROP INDEX `$subkey`"; + DB::query($usql, 'SILENT'); + $updates[] = "ADD UNIQUE INDEX `$subkey` $subvalue"; + } + } + } else { + if(!empty($oldcols[$key])) { + if(strtolower($value) != strtolower($oldcols[$key])) { + $updates[] = "CHANGE `$key` `$key` $value"; + } + } else { + $i = array_search($key, $indexmastercols); + $fieldposition = $i > 0 ? 'AFTER '.$indexmastercols[$i-1] : 'FIRST'; + $updates[] = "ADD `$key` $value $fieldposition"; + } + } + } + + $ret = true; + if(!empty($updates)) { + if(!DB::query("ALTER TABLE ".$archivetable." ".implode(', ', $updates), 'SILENT')) { + $ret = $mastertable; + } else { + } + } + return $ret; + } + + private function getcolumn($creatsql) { + + $creatsql = preg_replace("/ COMMENT '.*?'/i", '', $creatsql); + $matchs = array(); + preg_match("/\((.+)\)\s*(ENGINE|TYPE)\s*\=/is", $creatsql, $matchs); + + $cols = explode("\n", $matchs[1]); + $newcols = array(); + foreach ($cols as $value) { + $value = trim($value); + if(empty($value)) continue; + $value = $this->remakesql($value); + if(substr($value, -1) == ',') $value = substr($value, 0, -1); + + $vs = explode(' ', $value); + $cname = $vs[0]; + + if($cname == 'KEY' || $cname == 'INDEX' || $cname == 'UNIQUE') { + + $name_length = strlen($cname); + if($cname == 'UNIQUE') $name_length = $name_length + 4; + + $subvalue = trim(substr($value, $name_length)); + $subvs = explode(' ', $subvalue); + $subcname = $subvs[0]; + $newcols[$cname][$subcname] = trim(substr($value, ($name_length+2+strlen($subcname)))); + + } elseif($cname == 'PRIMARY') { + + $newcols[$cname] = trim(substr($value, 11)); + + } else { + + $newcols[$cname] = trim(substr($value, strlen($cname))); + } + } + return $newcols; + } + + private function remakesql($value) { + $value = trim(preg_replace("/\s+/", ' ', $value)); + $value = str_replace(array('`',', ', ' ,', '( ' ,' )', 'mediumtext'), array('', ',', ',','(',')','text'), $value); + return $value; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_count.php b/source/class/table/table_common_member_count.php new file mode 100644 index 0000000..b737c6f --- /dev/null +++ b/source/class/table/table_common_member_count.php @@ -0,0 +1,108 @@ +_table = 'common_member_count'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_count_'; + + parent::__construct(); + } + + public function increase($uids, $creditarr) { + $uids = dintval((array)$uids, true); + $sql = array(); + $allowkey = array('extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8', + 'friends', 'posts', 'threads', 'oltime', 'digestposts', 'doings', 'blogs', 'albums', 'sharings', 'attachsize', 'views', + 'todayattachs', 'todayattachsize', 'follower', 'following', 'newfollower', 'feeds', 'blacklist'); + foreach($creditarr as $key => $value) { + if(($value = intval($value)) && $value && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + if(!empty($sql)){ + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE uid IN (".dimplode($uids).")", 'UNBUFFERED'); + $this->increase_cache($uids, $creditarr); + } + } + + public function clear_extcredits($uids, $extcredits) { + $uids = dintval((array)$uids, true); + $sql = $data = array(); + $allowkey = array('extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8'); + foreach($extcredits as $value) { + if(in_array($value, $allowkey, true)) { + $sql[] = "`$value`='0'"; + $data[$value] = 0; + } + } + if(!empty($sql)) { + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE uid IN (".dimplode($uids).")", 'UNBUFFERED'); + $this->update_batch_cache($uids, $data); + } + } + + public function count_by_posts($num) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE posts=%d', array($this->_table, $num)); + } + + public function range_by_field($start = 0, $limit = 0, $orderby = '', $sort = '') { + $orderby = in_array($orderby, array( + 'extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8', + 'friends', 'posts', 'threads', 'oltime', 'digestposts', 'doings', 'blogs', 'albums', 'sharings', 'attachsize', 'views', + 'todayattachs', 'todayattachsize', 'follower', 'following', 'newfollower', 'feeds', 'blacklist'), true) ? $orderby : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).($orderby ? ' ORDER BY '.DB::order($orderby, $sort) : '').DB::limit($start, $limit), null, $this->_pk); + } + + public function clear_digestposts() { + $uids = array(); + if($this->_allowmem) { + $uids = DB::fetch_all('SELECT uid FROM '.DB::table($this->_table).' WHERE digestposts<>0', null, $this->_pk); + } + $data = DB::query("UPDATE ".DB::table($this->_table)." SET digestposts=0", 'UNBUFFERED'); + if(!empty($uids)) { + $this->update_batch_cache(array_keys($uids), array('digestposts' => 0)); + } + return $data; + } + + public function clear_today_data() { + $uids = array(); + if($this->_allowmem) { + $uids = DB::fetch_all('SELECT uid FROM '.DB::table($this->_table).' WHERE todayattachs<>0 OR todayattachsize<>0', null, $this->_pk); + } + $data = DB::query("UPDATE ".DB::table($this->_table)." SET todayattachs='0',todayattachsize='0'", 'UNBUFFERED'); + if(!empty($uids)) { + $this->update_batch_cache(array_keys($uids), array('todayattachs' => 0, 'todayattachsize' => 0)); + } + return $data; + } + + public function count_by_extcredits($extcredits, $credits) { + $count = 0; + if(in_array($extcredits, array(1,2,3,4,5,6,7,8))) { + $count = DB::result_first('SELECT COUNT(*) FROM %t WHERE extcredits'.$extcredits.'>%d', array($this->_table, $credits)); + } + return $count; + } + + + public function count_by_friends($friends) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE friends>%d', array($this->_table, $friends)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_count_archive.php b/source/class/table/table_common_member_count_archive.php new file mode 100644 index 0000000..cb4def5 --- /dev/null +++ b/source/class/table/table_common_member_count_archive.php @@ -0,0 +1,43 @@ +_table = 'common_member_count_archive'; + $this->_pk = 'uid'; + } + + public function fetch($id, $force_from_db = true, $fetch_archive = 1){ + return ($id = dintval($id)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)) : array(); + } + + public function fetch_all($ids, $force_from_db = true, $fetch_archive = 1) { + $data = array(); + if(($ids = dintval($ids, true))) { + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids)); + while($value = DB::fetch($query)) { + $data[$value[$this->_pk]] = $value; + } + } + return $data; + } + + public function delete($val, $unbuffered = false, $fetch_archive = 1) { + return ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_crime.php b/source/class/table/table_common_member_crime.php new file mode 100644 index 0000000..f1c684c --- /dev/null +++ b/source/class/table/table_common_member_crime.php @@ -0,0 +1,60 @@ +_table = 'common_member_crime'; + $this->_pk = 'cid'; + + parent::__construct(); + } + + public function fetch_all_by_uid($uid) { + return $uid ? DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC', array($this->_table, $uid), $this->_pk) : array(); + } + + public function count_by_uid_action($uid, $action) { + return $uid ? DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND action=%d', array($this->_table, $uid, $action)) : 0; + } + + public function count_by_where($where) { + return $where ? DB::result_first('SELECT COUNT(*) FROM %t %i ', array($this->_table, $where)) : $this->count(); + } + + public function fetch_all_by_where($where, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t %i ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $where)); + } + + public function fetch_all_by_uid_action($uid, $action) { + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('uid', $uid).' AND '.DB::field('action', $action).' ORDER BY dateline', array($this->_table)); + } + + public function fetch_all_by_cid($cid, $action, $limit) { + if(!$cid) { + return DB::fetch_all('SELECT * FROM %t '.($action ? 'WHERE '.DB::field('action', $action) : '').' ORDER BY cid DESC '.DB::limit($limit), array($this->_table), $this->_pk); + } else { + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('cid', $cid, '<').($action ? ' AND '.DB::field('action', $action) : '').' ORDER BY cid DESC '.DB::limit($limit), array($this->_table), $this->_pk); + } + } + + public function delete_by_uid($uids) { + if(!$uids){ + return null; + } + DB::delete($this->_table, DB::field('uid', $uids)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_field_forum.php b/source/class/table/table_common_member_field_forum.php new file mode 100644 index 0000000..a5fa35c --- /dev/null +++ b/source/class/table/table_common_member_field_forum.php @@ -0,0 +1,27 @@ +_table = 'common_member_field_forum'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_field_forum_'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_field_forum_archive.php b/source/class/table/table_common_member_field_forum_archive.php new file mode 100644 index 0000000..ab9b6c8 --- /dev/null +++ b/source/class/table/table_common_member_field_forum_archive.php @@ -0,0 +1,43 @@ +_table = 'common_member_field_forum_archive'; + $this->_pk = 'uid'; + } + + public function fetch($id, $force_from_db = true, $fetch_archive = 1){ + return ($id = dintval($id)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)) : array(); + } + + public function fetch_all($ids, $force_from_db = true, $fetch_archive = 1) { + $data = array(); + if(($ids = dintval($ids, true))) { + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids)); + while($value = DB::fetch($query)) { + $data[$value[$this->_pk]] = $value; + } + } + return $data; + } + + public function delete($val, $unbuffered = false, $fetch_archive = 1) { + return ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_field_home.php b/source/class/table/table_common_member_field_home.php new file mode 100644 index 0000000..cf37a68 --- /dev/null +++ b/source/class/table/table_common_member_field_home.php @@ -0,0 +1,41 @@ +_table = 'common_member_field_home'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_field_home_'; + + parent::__construct(); + } + + public function increase($uids, $creditarr) { + $uids = array_map('intval', (array)$uids); + $sql = array(); + $allowkey = array('addsize', 'addfriend'); + foreach($creditarr as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + if(!empty($sql)){ + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE uid IN (".dimplode($uids).")", 'UNBUFFERED'); + $this->increase_cache($uids, $creditarr); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_field_home_archive.php b/source/class/table/table_common_member_field_home_archive.php new file mode 100644 index 0000000..2b4d842 --- /dev/null +++ b/source/class/table/table_common_member_field_home_archive.php @@ -0,0 +1,43 @@ +_table = 'common_member_field_home_archive'; + $this->_pk = 'uid'; + } + + public function fetch($id, $force_from_db = true, $fetch_archive = 1){ + return ($id = dintval($id)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)) : array(); + } + + public function fetch_all($ids, $force_from_db = true, $fetch_archive = 1) { + $data = array(); + if(($ids = dintval($ids, true))) { + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids)); + while($value = DB::fetch($query)) { + $data[$value[$this->_pk]] = $value; + } + } + return $data; + } + + public function delete($val, $unbuffered = false, $fetch_archive = 1) { + return ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_forum_buylog.php b/source/class/table/table_common_member_forum_buylog.php new file mode 100644 index 0000000..80e94a7 --- /dev/null +++ b/source/class/table/table_common_member_forum_buylog.php @@ -0,0 +1,52 @@ +_table = 'common_member_forum_buylog'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member'; + $this->_allowmem = memory('check'); + $this->_cache_ttl = 86400; + + parent::__construct(); + } + + public function get_credits($uid, $fid) { + $credits = $this->fetch_cache($uid.'_'.$fid, 'common_member_forum_buylog_'); + if(!$credits) { + $credits = DB::result_first('SELECT credits FROM %t WHERE uid=%d AND fid=%d', array($this->_table, $uid, $fid)); + $this->store_cache($uid.'_'.$fid, $credits, $this->_cache_ttl, 'common_member_forum_buylog_'); + return $credits; + } else { + return $credits; + } + } + + public function update_credits($uid, $fid, $credits) { + C::t('common_member_forum_buylog')->insert(array('uid' => $uid, 'fid' => $fid, 'credits' => $credits), false, true); + $this->store_cache($uid.'_'.$fid, $credits, $this->_cache_ttl, 'common_member_forum_buylog_'); + } + + public function delete_by_uid($uids) { + DB::delete($this->_table, DB::field('uid', $uids)); + } + + public function delete_by_fid($fids) { + DB::delete($this->_table, DB::field('fid', $fids)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_grouppm.php b/source/class/table/table_common_member_grouppm.php new file mode 100644 index 0000000..3c09dc2 --- /dev/null +++ b/source/class/table/table_common_member_grouppm.php @@ -0,0 +1,71 @@ +_table = 'common_member_grouppm'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete_by_gpmid($gpmid) { + return ($gpmid = dintval($gpmid))? DB::delete('common_member_grouppm', 'gpmid='.$gpmid) : false; + } + + public function count_by_gpmid($gpmid, $type) { + return $gpmid ? DB::result_first('SELECT COUNT(*) FROM %t WHERE gpmid=%d AND dateline'.($type ? '>' : '=').'0', array($this->_table, $gpmid)) : 0; + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_gpm($id, $force_from_db); + } + } + + public function fetch_gpm($uid, $gpmid) { + return $uid && $gpmid ? DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND gpmid=%d', array($this->_table, $uid, $gpmid)) : ''; + } + + public function fetch_all_by_gpmid($gpmid, $type, $start = 0, $limit = 0) { + return $gpmid ? DB::fetch_all('SELECT * FROM %t WHERE gpmid=%d AND dateline'.($type ? '>' : '=').'0'.DB::limit($start, $limit), array($this->_table, $gpmid), 'uid') : array(); + } + + public function fetch_all_by_uid($uid, $type) { + return $uid ? DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND `status`'.($type ? '>=' : '=').'0', array($this->_table, $uid), 'gpmid') : array(); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_gpm($val, $data, $unbuffered); + } + } + + public function update_gpm($uid, $gpmid, $data) { + return ($uid = dintval($uid)) && ($gpmid = dintval($gpmid, true)) && $data && is_array($data) ? DB::update($this->_table, $data, DB::field('gpmid', $gpmid).' AND '.DB::field('uid', $uid)) : false; + } + + public function update_to_read_by_unread($uid, $gpmid) { + return ($uid = dintval($uid)) && ($gpmid = dintval($gpmid, true)) ? DB::update($this->_table, array('status' => 1), DB::field('gpmid', $gpmid).' AND '.DB::field('uid', $uid).' AND status=0') : false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_magic.php b/source/class/table/table_common_member_magic.php new file mode 100644 index 0000000..5bd5ea6 --- /dev/null +++ b/source/class/table/table_common_member_magic.php @@ -0,0 +1,159 @@ +_table = 'common_member_magic'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete($val = null, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + $unbuffered = $unbuffered === false ? null : $unbuffered; + return $this->delete_magic($val, $unbuffered); + } + } + + public function delete_magic($uid = null, $magicid = null) { + $para = array(); + if($uid) { + $para[] = DB::field('uid', $uid); + } + if($magicid) { + $para[] = DB::field('magicid', $magicid); + } + if(!($where = $para ? implode(' AND ', $para) : '')) { + return null; + } + return DB::delete($this->_table, $where); + } + + public function fetch_all($ids, $force_from_db = false, $null1 = 0, $null2 = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? '' : $force_from_db; + return $this->fetch_all_magic($ids, $force_from_db, $null1, $null2); + } + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_magic($id, $force_from_db); + } + } + + public function count($null1 = null, $null2 = null) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::count(); + } else { + if ($null1 === null || $null2 === null) { + throw new Exception("Invalid Use C:t('common_member_magic')->count Function."); + } + return $this->count_magic($null1, $null2); + } + } + + public function fetch_all_magic($uid, $magicid = '', $start = 0, $limit = 0) { + $para = array(); + if($uid) { + $para[] = DB::field('uid', $uid); + } + if($magicid) { + $para[] = DB::field('magicid', $magicid); + } + if($limit) { + $sql = DB::limit($start, $limit); + } + if(!count($para)) { + return null; + } + $para = implode(' AND ', $para); + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $para.$sql)); + } + + public function fetch_magic($uid, $magicid) { + $para = array(); + if($uid) { + $para[] = DB::field('uid', $uid); + } + if($magicid) { + $para[] = DB::field('magicid', $magicid); + } + if(!count($para)) { + return null; + } + $sql = implode(' AND ', $para); + return DB::fetch_first('SELECT * FROM %t WHERE %i', array($this->_table, $sql)); + } + + public function count_magic($uid, $magicid) { + $para = array(); + if($uid) { + $para[] = DB::field('uid', $uid); + } + if($magicid) { + $para[] = DB::field('magicid', $magicid); + } + if(!count($para)) { + return null; + } + $sql = implode(' AND ', $para); + return (int) DB::result_first('SELECT count(*) FROM %t WHERE %i', array($this->_table, $sql)); + } + + public function increase($uid, $magicid, $setarr, $slient = false, $unbuffered = false) { + $para = array(); + $setsql = array(); + $allowkey = array('num'); + foreach($setarr as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $setsql[] = "`$key`=`$key`+'$value'"; + } + } + if($uid) { + $para[] = DB::field('uid', $uid); + } + if($magicid) { + $para[] = DB::field('magicid', $magicid); + } + if(!count($para) || !count($setsql)) { + return null; + } + $sql = implode(' AND ', $para); + return DB::query('UPDATE %t SET %i WHERE %i', array($this->_table, implode(',', $setsql), $sql), $slient, $unbuffered); + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t mm, %t m WHERE mm.uid=%d AND mm.magicid=m.magicid', array($this->_table, 'common_magic', $uid)); + } + + public function fetch_magicid_by_identifier($uid, $identifier) { + return DB::result_first('SELECT m.magicid FROM %t mm,%t m WHERE mm.uid=%d AND m.identifier=%s AND mm.magicid=m.magicid', array($this->_table, 'common_magic', $uid, $identifier)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_medal.php b/source/class/table/table_common_member_medal.php new file mode 100644 index 0000000..8bb10b1 --- /dev/null +++ b/source/class/table/table_common_member_medal.php @@ -0,0 +1,37 @@ +_table = 'common_member_medal'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_uid($uid) { + return !empty($uid) ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('uid', $uid), '', 'medalid') : array(); + } + + public function delete_by_uid_medalid($uid, $medalid) { + return !empty($uid) && !empty($medalid) ? DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('medalid', $medalid)) : false; + } + + public function count_by_uid_medalid($uid, $medalid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND medalid=%d', array($this->_table, $uid, $medalid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_newprompt.php b/source/class/table/table_common_member_newprompt.php new file mode 100644 index 0000000..282adec --- /dev/null +++ b/source/class/table/table_common_member_newprompt.php @@ -0,0 +1,43 @@ +_table = 'common_member_newprompt'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_newprompt_'; + $this->_cache_ttl = 60; + + parent::__construct(); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + return $this->insert_newprompt($data, $return_insert_id); + } + } + + public function insert_newprompt($uid, $data) { + if(empty($uid) || empty($data)) { + return false; + } + DB::insert($this->_table, array('uid' => intval($uid), 'data' => serialize($data))); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_profile.php b/source/class/table/table_common_member_profile.php new file mode 100644 index 0000000..45f0435 --- /dev/null +++ b/source/class/table/table_common_member_profile.php @@ -0,0 +1,100 @@ +_table = 'common_member_profile'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_profile_'; + $this->_fields = array('uid', 'realname', 'gender', 'birthyear', 'birthmonth', 'birthday', 'constellation', + 'zodiac', 'telephone', 'mobile', 'idcardtype', 'idcard', 'address', 'zipcode', 'nationality', 'birthcountry', 'birthprovince', 'birthcity', 'birthdist', + 'birthcommunity', 'residecountry', 'resideprovince', 'residecity', 'residedist', 'residecommunity', 'residesuite', 'graduateschool', 'education', 'company', + 'occupation', 'position', 'revenue', 'affectivestatus', 'lookingfor', 'bloodtype', 'height', 'weight', 'alipay', 'icq', 'qq', + 'yahoo', 'msn', 'taobao', 'site', 'bio', 'interest', 'field1', 'field2', 'field3', 'field4', 'field5', 'field6', 'field7', 'field8'); + + parent::__construct(); + } + + public function fetch_all($uids, $force_from_db = false, $fetch_archive = 1) { + $data = array(); + if(!empty($uids)) { + if($force_from_db || ($data = $this->fetch_cache($uids)) === false || count($uids) != count($data)) { + if(is_array($data) && !empty($data)) { + $uids = array_diff($uids, array_keys($data)); + } + if($data === false) $data =array(); + if(!empty($uids)) { + $query = DB::query('SELECT '.implode(',', $this->_fields).' FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $uids)); + while($value = DB::fetch($query)) { + $data[$value[$this->_pk]] = $value; + $this->store_cache($value[$this->_pk], $value); + } + } + } + if(isset($this->membersplit) && $fetch_archive && count($data) != count($uids)) { + $data = $data + C::t($this->_table.'_archive')->fetch_all(array_diff($uids, array_keys($data)), null, 0); + } + + } + return $data; + } + + public function count_by_field($field, $val) { + $count = 0; + if(in_array($field, $this->_fields, true)) { + $count = DB::result_first('SELECT COUNT(*) as cnt FROM '.DB::table('common_member_profile').' WHERE '.DB::field($field, $val)); + } + return $count; + } + + public function fetch_all_field_value($field) { + return in_array($field, $this->_fields, true) ? DB::fetch_all('SELECT DISTINCT(`'.$field.'`) FROM '.DB::table($this->_table), null, $field) : array(); + } + + public function fetch_all_will_birthday_by_uid($uids) { + $birthlist = array(); + if(!empty($uids)) { + $uids = explode(',', (string)$uids); + $uids = dimplode(dintval($uids, true)); + list($s_month, $s_day) = explode('-', dgmdate(TIMESTAMP-3600*24*3, 'n-j')); + list($n_month, $n_day) = explode('-', dgmdate(TIMESTAMP, 'n-j')); + list($e_month, $e_day) = explode('-', dgmdate(TIMESTAMP+3600*24*7, 'n-j')); + if($e_month == $s_month) { + $wheresql = "sf.birthmonth='$s_month' AND sf.birthday>='$s_day' AND sf.birthday<='$e_day'"; + } else { + $wheresql = "(sf.birthmonth='$s_month' AND sf.birthday>='$s_day') OR (sf.birthmonth='$e_month' AND sf.birthday<='$e_day' AND sf.birthday>'0')"; + } + + $query = DB::query("SELECT sf.uid,sf.birthyear,sf.birthmonth,sf.birthday,s.username + FROM ".DB::table('common_member_profile')." sf + LEFT JOIN ".DB::table('common_member')." s USING(uid) + WHERE (sf.uid IN ($uids)) AND ($wheresql)"); + while ($value = DB::fetch($query)) { + $value['istoday'] = 0; + if($value['birthmonth'] == $n_month && $value['birthday'] == $n_day) { + $value['istoday'] = 1; + } + $key = sprintf("%02d", $value['birthmonth']).sprintf("%02d", $value['birthday']); + $birthlist[$key][] = $value; + ksort($birthlist); + } + } + return $birthlist; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_profile_archive.php b/source/class/table/table_common_member_profile_archive.php new file mode 100644 index 0000000..69f7b45 --- /dev/null +++ b/source/class/table/table_common_member_profile_archive.php @@ -0,0 +1,72 @@ +_table = 'common_member_profile_archive'; + $this->_pk = 'uid'; + } + + public function fetch($id, $force_from_db = false, $fetch_archive = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db, $fetch_archive); + } else { + return $this->fetch_profile($id); + } + } + + public function fetch_all($ids, $force_from_db = false, $fetch_archive = 1) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db, $fetch_archive); + } else { + return $this->fetch_all_profile($ids); + } + } + + public function delete($val, $unbuffered = false, $fetch_archive = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered, $fetch_archive); + } else { + return $this->delete_profile($val, $unbuffered); + } + } + + public function fetch_profile($id) { + return ($id = dintval($id)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)) : array(); + } + + public function fetch_all_profile($ids) { + $data = array(); + if(($ids = dintval($ids, true))) { + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids)); + while($value = DB::fetch($query)) { + $data[$value[$this->_pk]] = $value; + } + } + return $data; + } + + public function delete_profile($val, $unbuffered = false) { + return ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_profile_history.php b/source/class/table/table_common_member_profile_history.php new file mode 100644 index 0000000..6274038 --- /dev/null +++ b/source/class/table/table_common_member_profile_history.php @@ -0,0 +1,27 @@ +_table = 'common_member_profile_history'; + $this->_pk = 'hid'; + + parent::__construct(); + } + + public function fetch_all_by_uid($uid) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline', array($this->_table, $uid), $this->_pk); + } +} \ No newline at end of file diff --git a/source/class/table/table_common_member_profile_setting.php b/source/class/table/table_common_member_profile_setting.php new file mode 100644 index 0000000..94572fe --- /dev/null +++ b/source/class/table/table_common_member_profile_setting.php @@ -0,0 +1,64 @@ +_table = 'common_member_profile_setting'; + $this->_pk = 'fieldid'; + + parent::__construct(); + } + + public function range($start = 0, $limit = 0, $sort = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::range($start, $limit, $sort); + } else { + return $this->range_setting($start, $limit); + } + } + + public function range_setting($start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' ORDER BY available DESC, displayorder'.DB::limit($start, $limit), null, $this->_pk); + } + public function fetch_all_by_available_unchangeable($available, $unchangeable) { + return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND unchangeable=%d ORDER BY displayorder', array($this->_table, $available, $unchangeable), $this->_pk); + } + + public function fetch_all_by_available($available) { + return DB::fetch_all('SELECT * FROM %t WHERE available=%d ORDER BY displayorder', array($this->_table, $available), $this->_pk); + } + + public function fetch_all_by_available_formtype($available, $formtype) { + return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND formtype=%s', array($this->_table, $available, $formtype), $this->_pk); + } + + public function fetch_all_by_available_required($available, $required) { + return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND required=%d', array($this->_table, $available, $required), $this->_pk); + } + + public function fetch_all_by_available_showinregister($available, $showinregister) { + return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND showinregister=%d', array($this->_table, $available, $showinregister), $this->_pk); + } + public function fetch_all_by_available_showinthread($available, $showinthread) { + return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND showinthread=%d', array($this->_table, $available, $showinthread), $this->_pk); + } + + public function clear_showinthread() { + DB::update($this->_table, array('showinthread' => 0)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_security.php b/source/class/table/table_common_member_security.php new file mode 100644 index 0000000..e71e426 --- /dev/null +++ b/source/class/table/table_common_member_security.php @@ -0,0 +1,26 @@ +_table = 'common_member_security'; + $this->_pk = 'securityid'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_secwhite.php b/source/class/table/table_common_member_secwhite.php new file mode 100644 index 0000000..6cdabb1 --- /dev/null +++ b/source/class/table/table_common_member_secwhite.php @@ -0,0 +1,46 @@ +_table = 'common_member_secwhite'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_secwhite_'; + $this->_cache_ttl = 86400; + + parent::__construct(); + } + + public function check($uid) { + if ($this->_allowmem) { + return $this->fetch_cache($uid); + } else { + DB::delete($this->_table, "dateline<".(TIMESTAMP-86400)); + return DB::result_first("SELECT COUNT(*) FROM %t WHERE uid=%d", array($this->_table, $uid)); + } + } + + public function add($uid) { + if ($this->_allowmem) { + $this->store_cache($uid, 1); + } else { + DB::insert($this->_table, array('uid' => $uid, 'dateline' => TIMESTAMP), false, true); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_stat_field.php b/source/class/table/table_common_member_stat_field.php new file mode 100644 index 0000000..80a156f --- /dev/null +++ b/source/class/table/table_common_member_stat_field.php @@ -0,0 +1,45 @@ +_table = 'common_member_stat_field'; + $this->_pk = 'optionid'; + + parent::__construct(); + } + + public function count_by_fieldid($fieldid) { + return $fieldid ? DB::result_first('SELECT COUNT(*) FROM %t WHERE fieldid=%s', array($this->_table, $fieldid)) : 0; + } + + public function fetch_all_by_fieldid($fieldid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE fieldid=%s'.DB::limit($start, $limit), array($this->_table, $fieldid)); + } + + public function insert_batch($inserts) { + $sql = array(); + foreach($inserts as $value) { + if($value['fieldid']) { + $sql[] = "('{$value['fieldid']}', '".addslashes($value['fieldvalue'])."')"; + } + } + if($sql) { + DB::query('INSERT INTO '.DB::table($this->_table)."(fieldid, fieldvalue) VALUES ".implode(', ', $sql)); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_status.php b/source/class/table/table_common_member_status.php new file mode 100644 index 0000000..f301dcf --- /dev/null +++ b/source/class/table/table_common_member_status.php @@ -0,0 +1,109 @@ +_table = 'common_member_status'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_status_'; + + parent::__construct(); + } + + public function increase($uids, $setarr) { + $uids = array_map('intval', (array)$uids); + $sql = array(); + $allowkey = array('buyercredit', 'sellercredit', 'favtimes', 'sharetimes'); + foreach($setarr as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + if(!empty($sql)){ + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE uid IN (".dimplode($uids).")", 'UNBUFFERED'); + $this->increase_cache($uids, $setarr); + } + } + + public function count_by_ip($ips) { + return !empty($ips) ? DB::result_first('SELECT COUNT(*) FROM %t WHERE regip IN(%n) OR lastip IN (%n)', array($this->_table, $ips, $ips)) : 0; + } + + public function fetch_all_by_ip($ips, $start, $limit) { + $data = array(); + if(!empty($ips) && $limit) { + $data = DB::fetch_all('SELECT * FROM %t WHERE regip IN(%n) OR lastip IN (%n) LIMIT %d, %d', array($this->_table, $ips, $ips, $start, $limit), 'uid'); + } + return $data; + } + + public function fetch_all_orderby_lastpost($uids, $start, $limit) { + $uids = dintval($uids, true); + if($uids) { + return DB::fetch_all('SELECT * FROM %t WHERE uid IN(%n) ORDER BY lastpost DESC '.DB::limit($start, $limit), array($this->_table, $uids), $this->_pk); + } + return array(); + } + + public function count_by_lastactivity_invisible($timestamp, $invisible = 0) { + $addsql = ''; + if($invisible === 1) { + $addsql = ' AND invisible = 1'; + } elseif($invisible === 2) { + $addsql = ' AND invisible = 0'; + } + return $timestamp ? DB::result_first('SELECT COUNT(*) FROM %t WHERE lastactivity >= %d'.$addsql, array($this->_table, $timestamp)) : 0; + } + + + public function fetch_all_by_lastactivity_invisible($timestamp, $invisible = 0, $start = 0, $limit = 0) { + $data = array(); + if($timestamp) { + $addsql = ''; + if($invisible === 1) { + $addsql = ' AND invisible = 1'; + } elseif($invisible === 2) { + $addsql = ' AND invisible = 0'; + } + $data = DB::fetch_all('SELECT * FROM %t WHERE lastactivity >= %d'.$addsql.' ORDER BY lastactivity DESC'.DB::limit($start, $limit), array($this->_table, $timestamp), $this->_pk); + } + return $data; + } + + public function fetch_all_onlines($uids, $lastactivity, $start = 0, $limit = 0) { + $data = array(); + $uids = dintval($uids, true); + if(!empty($uids)) { + $ppp = ($ppp = getglobal('ppp')) ? $ppp + 30 : 100; + if(count($uids) > $ppp) { + $uids = array_slice($uids, 0, $ppp); + } + $length = $limit ? $limit : $start; + $i = 0; + foreach($this->fetch_all($uids) as $uid => $member) { + if($member['lastactivity'] >= $lastactivity) { + $data[$uid] = $member; + if($length && $i >= $length) { + break; + } + $i++; + } + } + } + return $data; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_status_archive.php b/source/class/table/table_common_member_status_archive.php new file mode 100644 index 0000000..1deffa3 --- /dev/null +++ b/source/class/table/table_common_member_status_archive.php @@ -0,0 +1,71 @@ +_table = 'common_member_status_archive'; + $this->_pk = 'uid'; + + } + + public function fetch($id, $force_from_db = false, $fetch_archive = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db, $fetch_archive); + } else { + return $this->fetch_status($id); + } + } + + public function fetch_all($ids, $force_from_db = false, $fetch_archive = 1) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db, $fetch_archive); + } else { + return $this->fetch_all_status($ids); + } + } + + public function delete($val, $unbuffered = false, $fetch_archive = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered, $fetch_archive); + } else { + return $this->delete_status($val, $unbuffered); + } + } + + public function fetch_status($id){ + return ($id = dintval($id)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)) : array(); + } + + public function fetch_all_status($ids) { + $data = array(); + if(($ids = dintval($ids, true))) { + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids)); + while($value = DB::fetch($query)) { + $data[$value[$this->_pk]] = $value; + } + } + return $data; + } + + public function delete_status($val, $unbuffered = false) { + return ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_validate.php b/source/class/table/table_common_member_validate.php new file mode 100644 index 0000000..8966c21 --- /dev/null +++ b/source/class/table/table_common_member_validate.php @@ -0,0 +1,59 @@ +_table = 'common_member_validate'; + $this->_pk = 'uid'; + + parent::__construct(); + } + + public function fetch_all_validate_uid($submittimes = '', $regdate = '', $moddate = '', $regip = '') { + $sql = 'm.groupid=8'; + $sql .= $submittimes ? ' AND v.submittimes>'.intval($submittimes) : ''; + $sql .= $regdate ? ' AND m.regdate<'.(TIMESTAMP - intval($regdate) * 86400) : ''; + $sql .= $moddate ? ' AND v.moddate<'.(TIMESTAMP - intval($moddate) * 86400) : ''; + $sql .= ($regip = stripsearchkey(addslashes((string)$regip))) ? " AND m.regip LIKE '".$regip."%'" : ''; + return DB::fetch_all("SELECT v.uid FROM ".DB::table('common_member_validate')." v, ".DB::table('common_member')." m + WHERE $sql AND m.uid=v.uid", null, 'uid'); + } + + public function fetch_all_invalidate($start, $limit) { + return DB::fetch_all('SELECT mvi.field, v.message, v.submittimes, v.submitdate, v.moddate, v.admin, v.remark, v.uid as vuid + FROM '.DB::table('common_member_validate').' v + LEFT JOIN '.DB::table('common_member_verify_info').' mvi ON mvi.uid=v.uid AND mvi.verifytype=0 + WHERE v.status=0 ORDER BY v.submitdate DESC '.DB::limit($start, $limit), '', 'vuid'); + } + + public function count_by_status($status) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE status=%d', array($this->_table, $status)); + } + + public function fetch_all_status_by_count() { + $count = array(); + $query = DB::query("SELECT status, COUNT(*) AS count FROM ".DB::table('common_member_validate')." GROUP BY status"); + while($num = DB::fetch($query)) { + $count[$num['status']] = $num['count']; + } + return $count; + } + + public function fetch_all_by_status($status, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE status=%d ORDER BY submitdate DESC'.DB::limit($start, $limit), array($this->_table, $status), $this->_pk); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_verify.php b/source/class/table/table_common_member_verify.php new file mode 100644 index 0000000..4cfe932 --- /dev/null +++ b/source/class/table/table_common_member_verify.php @@ -0,0 +1,79 @@ +_table = 'common_member_verify'; + $this->_pk = 'uid'; + $this->_pre_cache_key = 'common_member_verify_'; + + parent::__construct(); + } + + public function fetch_all_by_vid($vid, $flag, $uids = array()) { + $parameter = array($this->_table); + if($vid > 0 && $vid < 8) { + $wherearr = array(); + if($uids) { + $wherearr[] = is_array($uids) ? 'uid IN(%n)' : 'uid=%d'; + $parameter[] = $uids; + } + $parameter[] = $flag; + $wherearr[] = "verify{$vid}=%d"; + return DB::fetch_all("SELECT * FROM %t WHERE ".implode(' AND ', $wherearr), $parameter, $this->_pk); + } else { + return array(); + } + } + public function fetch_all_search($uid, $vid, $username = '', $order = 'dateline', $start = 0, $limit = 0, $sort = 'DESC') { + $condition = $this->search_condition($uid, $vid, $username); + $ordersql = !empty($order) ? ' ORDER BY '.$order.' '.$sort : ''; + return DB::fetch_all("SELECT * FROM %t v, %t m $condition[0] $ordersql ".DB::limit($start, $limit), $condition[1], $this->_pk); + + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + + public function count_by_search($uid, $vid, $username = '') { + $condition = $this->search_condition($uid, $vid, $username); + return DB::result_first('SELECT COUNT(*) FROM %t v, %t m '.$condition[0], $condition[1]); + } + + public function search_condition($uid, $vid, $username) { + $parameter = array($this->_table, 'common_member'); + $wherearr = array(); + if($uid) { + $parameter[] = $uid; + $wherearr[] = 'v.uid=%d'; + } + if($vid > 0 && $vid < 8) { + $parameter[] = $vid; + $wherearr[] = 'v.verify%d=1'; + } + if(!empty($username)) { + $parameter[] = '%'.$username.'%'; + $wherearr[] = "m.username LIKE %s"; + } + $wherearr[] = "v.uid=m.uid"; + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_member_verify_info.php b/source/class/table/table_common_member_verify_info.php new file mode 100644 index 0000000..909cf42 --- /dev/null +++ b/source/class/table/table_common_member_verify_info.php @@ -0,0 +1,87 @@ +_table = 'common_member_verify_info'; + $this->_pk = 'vid'; + + parent::__construct(); + } + public function fetch_by_uid_verifytype($uid, $verifytype) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND verifytype=%d', array($this->_table, $uid, $verifytype)); + } + public function fetch_all_search($uid, $vid, $flag = null, $username = '', $starttime = 0, $endtime = 0, $order = 'dateline', $start = 0, $limit = 0, $sort = 'DESC') { + $condition = $this->search_condition($uid, $vid, $flag, $username, $starttime, $endtime); + $ordersql = !empty($order) ? ' ORDER BY '.DB::order($order, $sort) : ''; + return DB::fetch_all("SELECT * FROM %t $condition[0] $ordersql ".DB::limit($start, $limit), $condition[1], $this->_pk); + } + public function group_by_verifytype_count() { + return DB::fetch_all('SELECT verifytype, COUNT(*) AS num FROM %t WHERE flag=0 GROUP BY verifytype', array($this->_table)); + } + + public function delete_by_uid($uid, $verifytype = null) { + if($uid) { + $addsql = ''; + if($verifytype !== null) { + $verifytype = dintval($verifytype, is_array($verifytype) ? true : false); + $addsql = ' AND '.DB::field('verifytype', $verifytype); + } + return DB::query('DELETE FROM %t WHERE '.(is_array($uid) ? 'uid IN(%n)' : 'uid=%d').$addsql, array($this->_table, $uid)); + } + return false; + } + + public function count_by_search($uid, $vid, $flag = null, $username = '', $starttime = 0, $endtime = 0) { + $condition = $this->search_condition($uid, $vid, $flag, $username, $starttime, $endtime); + return DB::result_first('SELECT COUNT(*) FROM %t '.$condition[0], $condition[1]); + } + + public function search_condition($uid, $vid, $flag, $username, $starttime, $endtime) { + $parameter = array($this->_table); + $wherearr = array(); + if($uid) { + $parameter[] = $uid; + $wherearr[] = 'uid=%d'; + } + if($vid >= 0 && $vid < 8) { + $parameter[] = $vid; + $wherearr[] = 'verifytype=%d'; + } + if($flag !== null) { + $parameter[] = $flag; + $wherearr[] = 'flag=%d'; + } + if($starttime){ + $parameter[] = $starttime; + $wherearr[] = 'dateline>=%d'; + } + if($endtime){ + $parameter[] = $endtime; + $wherearr[] = 'dateline<=%d'; + } + if(!empty($username)) { + $parameter[] = '%'.$username.'%'; + $wherearr[] = "username LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + + } + + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_moderate.php b/source/class/table/table_common_moderate.php new file mode 100644 index 0000000..f96b1d1 --- /dev/null +++ b/source/class/table/table_common_moderate.php @@ -0,0 +1,541 @@ +_table = ''; + $this->_pk = ''; + $this->_tables = array( + 'tid' => 'forum_thread_moderate', + 'pid' => 'forum_post_moderate', + 'blogid' => 'home_blog_moderate', + 'picid' => 'home_pic_moderate', + 'doid' => 'home_doing_moderate', + 'sid' => 'home_share_moderate', + 'aid' => 'portal_article_moderate', + 'aid_cid' => 'portal_comment_moderate', + 'topicid_cid' => 'portal_comment_moderate', + 'uid_cid' => 'home_comment_moderate', + 'blogid_cid' => 'home_comment_moderate', + 'sid_cid' => 'home_comment_moderate', + 'picid_cid' => 'home_comment_moderate', + ); + + parent::__construct(); + } + + private function _get_table($idtype) { + return $this->_tables[$idtype]; + } + + private function _is_comment_table($idtype) { + return in_array($this->_get_table($idtype), array('portal_comment_moderate', 'home_comment_moderate')); + } + + public function count_by_idtype($idtype, $status = 0, $dateline = 0) { + return $this->query_data(1, $idtype, $status, $dateline); + } + + public function fetch_all_by_idtype($idtype, $status = 0, $dateline = 0) { + return $this->query_data(0, $idtype, $status, $dateline); + } + + private function query_data($type, $idtype, $status = 0, $dateline = 0) { + if(!isset($this->_tables[$idtype])) { + return $type ? 0 : array(); + } + $parameter = array($this->_get_table($idtype), $this->_is_comment_table($idtype) ? "idtype='$idtype' AND" : '', $status); + $othersql = ''; + if($dateline) { + $othersql = " AND dateline>=%d"; + $parameter[] = $dateline; + } + + if($type) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE %i `status`=%d $othersql ORDER BY dateline DESC", $parameter); + } else { + return DB::fetch_all("SELECT * FROM %t WHERE %i `status`=%d $othersql ORDER BY dateline DESC", $parameter, 'id'); + } + } + public function fetch_all_for_article($status, $catid = 0, $username = '', $dateline = 'all', $count = 0, $start = 0, $limit = 0) { + $sqlwhere = ''; + $status = dintval($status); + if(($catid = dintval($catid))) { + $sqlwhere .= " AND a.catid='$catid'"; + } + if(!empty($username)) { + $sqlwhere .= " AND a.username='".addslashes($username)."'"; + } + if($dateline != 'all') { + $sqlwhere .= " AND a.dateline>'".(TIMESTAMP - dintval($dateline))."'"; + } + if($count) { + return DB::result_first("SELECT COUNT(*) + FROM ".DB::table('portal_article_moderate')." m + LEFT JOIN ".DB::table('portal_article_title')." a ON a.aid=m.id + WHERE m.status='$status' $sqlwhere"); + } + return DB::fetch_all("SELECT a.aid, a.catid, a.uid, a.username, a.title, a.summary, a.dateline, cat.catname + FROM ".DB::table('portal_article_moderate')." m + LEFT JOIN ".DB::table('portal_article_title')." a ON a.aid=m.id + LEFT JOIN ".DB::table('portal_category')." cat ON cat.catid=a.catid + WHERE m.status='$status' $sqlwhere + ORDER BY m.dateline DESC".DB::limit($start, $limit)); + } + + public function fetch_all_for_portalcomment($idtype, $tablename, $status, $catid = 0, $username = '', $dateline = 'all', $count = 0, $keyword = '', $start = 0, $limit = 0) { + if(!isset($this->_tables[$idtype.'_cid'])) { + return $count ? 0 : array(); + } + if(!empty($catid)) { + $sqlwhere .= " AND a.catid='$catid'"; + } + if(!empty($username)) { + $sqlwhere .= " AND a.username='$username'"; + } + if($dateline != 'all') { + $sqlwhere .= " AND a.dateline>'".(TIMESTAMP - $dateline)."'"; + } + if(!empty($keyword)) { + $sqlwhere .= " AND c.message LIKE '%$keyword%'"; + } + $sqlwhere .= "AND c.idtype='$idtype'"; + if($count) { + return DB::result_first("SELECT COUNT(*) + FROM ".DB::table($this->_get_table($idtype.'_cid'))." m + LEFT JOIN ".DB::table('portal_comment')." c ON c.cid=m.id + LEFT JOIN ".DB::table($tablename)." a ON a.$idtype=c.id + WHERE m.".DB::field('idtype', $idtype.'_cid')." AND m.status='$status' $sqlwhere"); + } + return DB::fetch_all("SELECT c.cid, c.uid, c.username, c.id, c.postip, c.dateline, c.message, a.title + FROM ".DB::table($this->_get_table($idtype.'_cid'))." m + LEFT JOIN ".DB::table('portal_comment')." c ON c.cid=m.id + LEFT JOIN ".DB::table($tablename)." a ON a.$idtype=c.id + WHERE m.".DB::field('idtype', $idtype.'_cid')." AND m.status='$status' $sqlwhere + ORDER BY m.dateline DESC".DB::limit($start, $limit)); + } + + public function count_group_idtype_by_status($status) { + $return = array(); + foreach($this->_tables as $idtype => $table) { + if($this->_is_comment_table($idtype)) { + $return[] = array('idtype' => $idtype, 'count' => DB::result_first('SELECT COUNT(*) FROM %t WHERE idtype=%s AND status=%d', array($table, $idtype, $status))); + } else { + $return[] = array('idtype' => $idtype, 'count' => DB::result_first('SELECT COUNT(*) FROM %t WHERE status=%d', array($table, $status))); + } + } + return $return; + } + + public function delete($val, $unbuffered = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_moderate($val, $unbuffered, $null); + } + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + return $this->insert_moderate($data, $return_insert_id, $replace, $silent, $null); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_moderate($val, $data, $unbuffered, $low_priority, $null); + } + } + + public function delete_moderate($id, $idtype, $unbuffered = false) { + if(!isset($this->_tables[$idtype])) { + return false; + } + $table = $this->_get_table($idtype); + $wheresql = array(); + $id && $wheresql[] = DB::field('id', $id); + $this->_is_comment_table($idtype) && $wheresql[] = DB::field('idtype', $idtype); + return DB::delete($table, implode(' AND ', $wheresql), 0, $unbuffered); + } + + public function insert_moderate($idtype, $data, $return_insert_id = false, $replace = false, $silent = false) { + if(!isset($this->_tables[$idtype]) || empty($data)) { + return false; + } + $table = $this->_get_table($idtype); + $this->_is_comment_table($idtype) && $data['idtype'] = $idtype; + return DB::insert($table, $data, $return_insert_id, $replace, $silent); + } + + public function update_moderate($id, $idtype, $data, $unbuffered = false, $low_priority = false) { + if(!isset($this->_tables[$idtype]) || empty($data)) { + return false; + } + $table = $this->_get_table($idtype); + $wheresql = array(); + $id && $wheresql[] = DB::field('id', $id); + $this->_is_comment_table($idtype) && $wheresql[] = DB::field('idtype', $idtype); + return DB::update($table, $data, implode(' AND ', $wheresql), $unbuffered, $low_priority); + } + + public function count_by_idtype_status_fid($idtype, $status, $fids) { + if($idtype == 'tid') { + $innertable = 'forum_thread'; + } elseif($idtype == 'pid') { + $innertable = 'forum_post'; + } else { + return 0; + } + return DB::result_first('SELECT COUNT(*) FROM %t m INNER JOIN %t t ON m.id=t.%i AND t.'.DB::field('fid', $fids).' WHERE m.status=%d', + array($this->_get_table($idtype), $innertable, $idtype, $status)); + } + + public function count_by_search_for_post($posttable, $status = null, $first = null, $fids = null, $author = null, $dateline = null, $subject = null) { + $wheresql = array(); + if($status !== null) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($first !== null) { + $wheresql[] = 'p.'.DB::field('first', $first); + } + if($fids) { + $wheresql[] = 'p.'.DB::field('fid', $fids); + } + if($author) { + $wheresql[] = 'p.'.DB::field('author', $author); + } + if($dateline) { + $wheresql[] = 'p.'.DB::field('dateline', $dateline, '>'); + } + if($subject) { + $wheresql[] = 'p.'.DB::field('message', '%'.$subject.'%', 'like'); + } + + return DB::result_first('SELECT COUNT(*) FROM %t m LEFT JOIN %t p ON p.pid=m.id WHERE %i', + array($this->_get_table('pid'), $posttable, implode(' AND ', $wheresql))); + } + + public function fetch_all_by_search_for_post($posttable, $status = null, $first = null, $fids = null, $author = null, $dateline = null, $subject = null, $start = 0, $limit = 0) { + $wheresql = array(); + if($status !== null) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($first !== null) { + $wheresql[] = 'p.'.DB::field('first', $first); + } + if($fids) { + $wheresql[] = 'p.'.DB::field('fid', $fids); + } + if($author) { + $wheresql[] = 'p.'.DB::field('author', $author); + } + if($dateline) { + $wheresql[] = 'p.'.DB::field('dateline', $dateline, '>'); + } + if($subject) { + $wheresql[] = 'p.'.DB::field('message', '%'.$subject.'%', 'like'); + } + return DB::fetch_all('SELECT p.pid, p.fid, p.tid, + p.author, p.authorid, p.subject, p.dateline, p.message, p.useip, p.attachment, p.htmlon, p.smileyoff, p.bbcodeoff, p.status + FROM %t m + LEFT JOIN %t p on p.pid=m.id + WHERE %i + ORDER BY m.dateline DESC '.DB::limit($start, $limit), + array($this->_get_table('pid'), $posttable, implode(' AND ', $wheresql))); + } + + public function count_by_seach_for_thread($status = null, $fids = null) { + $wheresql = array(); + if($status !== null) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($fids) { + $wheresql[] = 't.'.DB::field('fid', $fids); + } + return DB::result_first('SELECT COUNT(*) FROM %t m LEFT JOIN %t t ON t.tid=m.id WHERE %i', + array($this->_get_table('tid'), 'forum_thread', implode(' AND ', $wheresql))); + } + + public function fetch_all_by_search_for_thread($status = null, $fids = null, $start = 0, $limit = 0) { + $wheresql = array(); + if($status !== null) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($fids) { + $wheresql[] = 't.'.DB::field('fid', $fids); + } + return DB::fetch_all('SELECT t.tid, t.fid, t.posttableid, t.author, t.sortid, t.authorid, t.subject as tsubject, t.dateline, t.attachment + FROM %t m + LEFT JOIN %t t ON t.tid=m.id + WHERE %i + ORDER BY m.dateline DESC '.DB::limit($start, $limit), + array($this->_get_table('tid'), 'forum_thread', implode(' AND ', $wheresql))); + } + + public function count_by_search_for_blog($status = null, $username = null, $dateline = null, $subject = null) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 'b.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 'b.'.DB::field('dateline', $dateline, '>'); + } + if($subject) { + $wheresql[] = 'b.'.DB::field('subject', '%'.$subject.'%', 'like'); + } + return DB::result_first('SELECT COUNT(*) + FROM %t m + LEFT JOIN %t b ON b.blogid=m.id + LEFT JOIN %t bf ON bf.blogid=b.blogid + LEFT JOIN %t c ON b.classid=c.classid + WHERE %i', + array($this->_get_table('blogid'), 'home_blog', 'home_blogfield', 'home_class', implode(' AND ', $wheresql))); + } + + public function fetch_all_by_search_for_blog($status = null, $username = null, $dateline = null, $subject = null, $start = 0, $limit = 0) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 'b.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 'b.'.DB::field('dateline', $dateline, '>'); + } + if($subject) { + $wheresql[] = 'b.'.DB::field('subject', '%'.$subject.'%', 'like'); + } + return DB::fetch_all('SELECT b.blogid, b.uid, b.username, b.classid, b.subject, b.dateline, bf.message, bf.postip, c.classname + FROM %t m + LEFT JOIN %t b ON b.blogid=m.id + LEFT JOIN %t bf ON bf.blogid=b.blogid + LEFT JOIN %t c ON b.classid=c.classid + WHERE %i + ORDER BY m.dateline DESC '.DB::limit($start, $limit), + array($this->_get_table('blogid'), 'home_blog', 'home_blogfield', 'home_class', implode(' AND ', $wheresql))); + } + + public function count_by_search_for_commnet($idtype = null, $status = null, $author = null, $dateline = null, $message = null) { + $wheresql = array(); + if($idtype) { + $table = $this->_get_table($idtype.'_cid'); + $wheresql[] = 'm.'.DB::field('idtype', $idtype.'_cid'); + } else { + $table = 'home_comment_moderate'; + } + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($author) { + $wheresql[] = 'c.'.DB::field('author', $author); + } + if($dateline) { + $wheresql[] = 'c.'.DB::field('dateline', $dateline, '>'); + } + if($message) { + $message = str_replace(array('_', '%'), array('\_', '\%'), $message); + $wheresql[] = 'c.'.DB::field('message', '%'.$message.'%', 'like'); + } + return DB::result_first('SELECT COUNT(*) FROM %t m LEFT JOIN %t c ON c.cid=m.id WHERE %i', + array($table, 'home_comment', implode(' AND ', $wheresql))); + } + + public function fetch_all_by_search_for_comment($idtype = null, $status = null, $author = null, $dateline = null, $message = null, $start = 0, $limit = 0) { + $wheresql = array(); + if($idtype) { + $table = $this->_get_table($idtype.'_cid'); + $wheresql[] = 'm.'.DB::field('idtype', $idtype.'_cid'); + } else { + $table = 'home_comment_moderate'; + } + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($author) { + $wheresql[] = 'c.'.DB::field('author', $author); + } + if($dateline) { + $wheresql[] = 'c.'.DB::field('dateline', $dateline, '>'); + } + if($message) { + $message = str_replace(array('_', '%'), array('\_', '\%'), $message); + $wheresql[] = 'c.'.DB::field('message', '%'.$message.'%', 'like'); + } + return DB::fetch_all('SELECT c.cid, c.uid, c.id, c.idtype, c.authorid, c.author, c.message, c.dateline, c.ip + FROM %t m + LEFT JOIN %t c ON c.cid=m.id + WHERE %i + ORDER BY c.dateline DESC '.DB::limit($start, $limit), + array($table, 'home_comment', implode(' AND ', $wheresql))); + } + + public function count_by_search_for_doing($status = null, $username = null, $dateline = null, $message = null) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 'd.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 'd.'.DB::field('dateline', $dateline, '>'); + } + if($message) { + $message = str_replace(array('_', '%'), array('\_', '\%'), $message); + $wheresql[] = 'd.'.DB::field('message', '%'.$message.'%', 'like'); + } + return DB::result_first('SELECT COUNT(*) + FROM %t m + LEFT JOIN %t d ON d.doid=m.id + WHERE %i', + array($this->_get_table('doid'), 'home_doing', implode(' AND ', $wheresql))); + } + + public function fetch_all_by_search_for_doing($status = null, $username = null, $dateline = null, $message = null, $start = 0, $limit = 0) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 'd.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 'd.'.DB::field('dateline', $dateline, '>'); + } + if($message) { + $message = str_replace(array('_', '%'), array('\_', '\%'), $message); + $wheresql[] = 'd.'.DB::field('message', '%'.$message.'%', 'like'); + } + return DB::fetch_all('SELECT d.doid, d.uid, d.username, d.dateline, d.message, d.ip + FROM %t m + LEFT JOIN %t d ON d.doid=m.id + WHERE %i + ORDER BY m.dateline DESC '.DB::limit($start, $limit), + array($this->_get_table('doid'), 'home_doing', implode(' AND ', $wheresql))); + } + + public function count_by_search_for_pic($status = null, $username = null, $dateline = null, $title = null) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 'p.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 'p.'.DB::field('dateline', $dateline, '>'); + } + if($title) { + $wheresql[] = 'p.'.DB::field('title', '%'.$title.'%', 'like'); + } + return DB::result_first('SELECT COUNT(*) + FROM %t m + LEFT JOIN %t p ON p.picid=m.id + WHERE %i', + array($this->_get_table('picid'), 'home_pic', implode(' AND ', $wheresql))); + } + + public function fetch_all_by_search_for_pic($status = null, $username = null, $dateline = null, $title = null, $start = 0, $limit = 0) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 'p.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 'p.'.DB::field('dateline', $dateline, '>'); + } + if($title) { + $wheresql[] = 'p.'.DB::field('title', '%'.$title.'%', 'like'); + } + return DB::fetch_all('SELECT p.picid, p.albumid, p.uid, p.username, p.title, p.dateline, p.filepath, p.thumb, p.remote, p.postip, a.albumname + FROM %t m + LEFT JOIN %t p ON p.picid=m.id + LEFT JOIN %t a ON p.albumid=a.albumid + WHERE %i + ORDER BY m.dateline DESC '.DB::limit($start, $limit), + array($this->_get_table('picid'), 'home_pic', 'home_album', implode(' AND ', $wheresql))); + } + + public function delete_by_status_idtype($status, $idtype) { + if(!isset($this->_tables[$idtype])) { + return false; + } + $table = $this->_get_table($idtype); + $idtype = $table == 'home_comment_moderate' ? DB::field('idtype', $idtype).' AND' : ''; + return DB::query('DELETE FROM %t WHERE %i status=%d', array($table, $idtype, $status)); + } + + public function count_by_search_for_share($status = null, $username = null, $dateline = null, $body_general = null) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 's.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 's.'.DB::field('dateline', $dateline, '>'); + } + if($body_general) { + $body_general = str_replace(array('%', '_'), array('\%', '\_'), $body_general); + $wheresql[] = 's.'.DB::field('body_general', '%'.$body_general.'%', 'like'); + } + return DB::result_first('SELECT COUNT(*) + FROM %t m + LEFT JOIN %t s ON s.sid=m.id + WHERE %i', + array($this->_get_table('sid'), 'home_share', implode(' AND ', $wheresql))); + } + + public function fetch_all_by_search_for_share($status = null, $username = null, $dateline = null, $body_general = null, $start = 0, $limit = 0) { + $wheresql = array(); + if($status !== null && !(is_array($status) && empty($status))) { + $wheresql[] = 'm.'.DB::field('status', $status); + } + if($username) { + $wheresql[] = 's.'.DB::field('username', $username); + } + if($dateline) { + $wheresql[] = 's.'.DB::field('dateline', $dateline, '>'); + } + if($body_general) { + $wheresql[] = 's.'.DB::field('body_general', '%'.$body_general.'%', 'like'); + } + return DB::fetch_all('SELECT s.sid, s.type, s.uid, s.username, s.dateline, s.body_general, s.itemid, s.fromuid + FROM %t m + LEFT JOIN %t s ON s.sid=m.id + WHERE %i + ORDER BY m.dateline DESC '.DB::limit($start, $limit), + array($this->_get_table('sid'), 'home_share', implode(' AND ', $wheresql))); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_mytask.php b/source/class/table/table_common_mytask.php new file mode 100644 index 0000000..683f431 --- /dev/null +++ b/source/class/table/table_common_mytask.php @@ -0,0 +1,109 @@ +_table = 'common_mytask'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_mytask($val, $unbuffered); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_mytask($val, $data, $unbuffered); + } + } + + public function count($null1 = null, $null2 = false, $null3 = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::count(); + } else { + return $this->count_mytask($null1, $null2, $null3); + } + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_mytask($id, $force_from_db); + } + } + + public function delete_mytask($uid, $taskid) { + $condition = array(); + if($uid) { + $condition[] = DB::field('uid', $uid); + } + if($taskid) { + $condition[] = DB::field('taskid', $taskid); + } + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function update_mytask($uid, $taskid, $data) { + if(!$data || !is_array($data)) { + return; + } + $condition = array(); + if($uid) { + $condition[] = DB::field('uid', $uid); + } + if($taskid) { + $condition[] = DB::field('taskid', $taskid); + } + DB::update($this->_table, $data, implode(' AND ', $condition)); + } + + public function count_mytask($uid, $taskid = false, $status = false) { + $taskid = $taskid !== false ? 'AND taskid='.intval($taskid) : ''; + $status = $status !== false ? 'AND status='.intval($status) : ''; + return DB::result_first("SELECT COUNT(*) FROM %t WHERE uid=%d %i %i", array($this->_table, $uid, $taskid, $status)); + } + + public function delete_exceed($exceedtime) { + DB::query("DELETE FROM %t WHERE status='-1' AND dateline<%d", array($this->_table, TIMESTAMP - intval($exceedtime)), false, true); + } + + public function fetch_all_by_taskid($taskid, $limit) { + return DB::fetch_all("SELECT * FROM %t WHERE taskid=%d ORDER BY dateline DESC LIMIT 0, %d", array($this->_table, $taskid, $limit)); + } + + public function fetch_mytask($uid, $taskid) { + return DB::fetch_first("SELECT * FROM %t WHERE uid=%d AND taskid=%d", array($this->_table, $uid, $taskid)); + } + + public function update_to_success($uid, $taskid, $timestamp) { + return DB::query('UPDATE '.DB::table($this->_table)." SET status = '1', csc = '100', dateline = '".intval($timestamp)."' WHERE taskid = '".intval($taskid)."' AND uid = '".intval($uid)."' AND status != '1'"); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_nav.php b/source/class/table/table_common_nav.php new file mode 100644 index 0000000..6ad93c7 --- /dev/null +++ b/source/class/table/table_common_nav.php @@ -0,0 +1,135 @@ +_table = 'common_nav'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_by_id_navtype($id, $navtype) { + return DB::fetch_first('SELECT * FROM %t WHERE id=%d AND navtype=%d', array($this->_table, $id, $navtype)); + } + + public function fetch_by_type_identifier($type, $identifier) { + return DB::fetch_first('SELECT * FROM %t WHERE type=%d AND identifier=%s', array($this->_table, $type, $identifier)); + } + + public function fetch_all_by_navtype($navtype = null) { + $parameter = array($this->_table); + $wheresql = ''; + if($navtype !== null) { + $parameter[] = $navtype; + $wheresql = ' WHERE navtype=%d'; + } + return DB::fetch_all('SELECT * FROM %t '.$wheresql.' ORDER BY available DESC, displayorder', $parameter, $this->_pk); + } + + public function fetch_all_by_navtype_parentid($navtype, $parentid) { + return DB::fetch_all('SELECT * FROM %t WHERE navtype=%d AND parentid=%d ORDER BY displayorder', array($this->_table, $navtype, $parentid), $this->_pk); + } + public function fetch_all_by_navtype_type($navtype, $type) { + return DB::fetch_all('SELECT * FROM %t WHERE navtype=%d AND type=%d', array($this->_table, $navtype, $type), $this->_pk); + } + public function fetch_all_mainnav() { + return DB::fetch_all('SELECT * FROM %t WHERE navtype=0 AND (available=1 OR type=0) AND parentid=0 ORDER BY displayorder', array($this->_table), $this->_pk); + } + public function fetch_all_subnav($parentid) { + return DB::fetch_all('SELECT * FROM %t WHERE navtype=0 AND parentid=%d AND available=1 ORDER BY displayorder', array($this->_table, $parentid), $this->_pk); + } + public function fetch_all_by_navtype_type_identifier($navtype, $type, $identifier) { + $navtype = dintval($navtype, true); + $type = dintval($type, true); + if($navtype && $type) { + $wherearr[] = DB::field('navtype', $navtype); + $wherearr[] = DB::field('type', $type); + $wherearr[] = DB::field('identifier', $identifier); + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, implode(' AND ', $wherearr)), 'identifier'); + } + return array(); + } + + public function update_by_identifier($identifier, $data) { + if(is_array($identifier) && empty($identifier)) { + return 0; + } + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('identifier', $identifier)); + } + return 0; + } + + public function update_by_navtype_type_identifier($navtype, $type, $identifier, $data) { + if(!empty($data) && is_array($data)) { + $navtype = dintval($navtype, true); + $type = dintval($type, true); + if(is_array($navtype) && empty($navtype) || is_array($type) && empty($type) || is_array($identifier) && empty($identifier)) { + return 0; + } + $wherearr[] = DB::field('navtype', $navtype); + $wherearr[] = DB::field('type', $type); + $wherearr[] = DB::field('identifier', $identifier); + return DB::update($this->_table, $data, implode(' AND ', $wherearr)); + } + return 0; + } + public function update_by_type_identifier($type, $identifier, $data) { + $type = dintval($type, is_array($type) ? true : false); + if(is_array($identifier) && empty($identifier)) { + return 0; + } + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('type', $type).' AND '.DB::field('identifier', $identifier)); + } + return 0; + } + + public function delete_by_navtype_id($navtype, $ids) { + $ids = dintval($ids, is_array($ids) ? true : false); + $navtype = dintval($navtype, is_array($navtype) ? true : false); + if($ids) { + return DB::delete($this->_table, DB::field('id', $ids).' AND '.DB::field('navtype', $navtype)); + } + return 0; + } + public function delete_by_navtype_parentid($navtype, $parentid) { + $navtype = dintval($navtype, is_array($navtype) ? true : false); + $parentid = dintval($parentid, is_array($parentid) ? true : false); + return DB::delete($this->_table, DB::field('navtype', $navtype).' AND '.DB::field('parentid', $parentid)); + } + + public function delete_by_type_identifier($type, $identifier) { + if(is_array($identifier) && empty($identifier)) { + return 0; + } + $type = dintval($type, is_array($type) ? true : false); + return DB::delete($this->_table, DB::field('type', $type).' AND '.DB::field('identifier', $identifier)); + } + public function delete_by_parentid($id) { + $id = dintval($id, is_array($id) ? true : false); + if($id) { + return DB::delete($this->_table, DB::field('parentid', $id)); + } + return 0; + } + public function count_by_navtype_type_identifier($navtype, $type, $identifier) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE navtype=%d AND type=%d AND identifier=%s', array($this->_table, $navtype, $type, $identifier)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_onlinetime.php b/source/class/table/table_common_onlinetime.php new file mode 100644 index 0000000..2bd13f9 --- /dev/null +++ b/source/class/table/table_common_onlinetime.php @@ -0,0 +1,44 @@ +_table = 'common_onlinetime'; + $this->_pk = 'uid'; + + parent::__construct(); + } + + public function update_onlinetime($uid, $total, $thismonth, $lastupdate) { + if(($uid = intval($uid))) { + DB::query("UPDATE ".DB::table('common_onlinetime')." + SET total=total+'$total', thismonth=thismonth+'$thismonth', lastupdate='".$lastupdate."' WHERE ".DB::field($this->_pk, $uid)); + return DB::affected_rows(); + } + return false; + } + + public function range_by_field($start = 0, $limit = 0, $orderby = '', $sort = '') { + $orderby = in_array($orderby, array('thismonth', 'total', 'lastupdate'), true) ? $orderby : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).($orderby ? ' WHERE '.$orderby.' >0 ORDER BY '.DB::order($orderby, $sort) : '').' '.DB::limit($start, $limit), null, $this->_pk); + } + + public function update_thismonth() { + return DB::update($this->_table, array('thismonth'=>0)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_optimizer.php b/source/class/table/table_common_optimizer.php new file mode 100644 index 0000000..81cb29b --- /dev/null +++ b/source/class/table/table_common_optimizer.php @@ -0,0 +1,52 @@ +_table = 'common_optimizer'; + $this->_pk = 'k'; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_optimizer($id, $force_from_db); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_optimizer($val, $data); + } + } + + public function fetch_optimizer($skey, $auto_unserialize = false) { + $data = DB::result_first('SELECT v FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $skey)); + return $auto_unserialize ? (array)dunserialize($data) : $data; + } + + public function update_optimizer($skey, $svalue){ + return DB::insert($this->_table, array($this->_pk => $skey, 'v' => is_array($svalue) ? serialize($svalue) : $svalue), false, true); + } + +} +?> \ No newline at end of file diff --git a/source/class/table/table_common_patch.php b/source/class/table/table_common_patch.php new file mode 100644 index 0000000..5e777e7 --- /dev/null +++ b/source/class/table/table_common_patch.php @@ -0,0 +1,54 @@ +_table = 'common_patch'; + $this->_pk = 'serial'; + + parent::__construct(); + } + + public function fetch_all($ids = array(), $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_patch(); + } + } + + public function fetch_all_patch() { + return DB::fetch_all("SELECT * FROM ".DB::table($this->_table)); + } + + public function fetch_max_serial() { + return DB::result_first("SELECT serial FROM ".DB::table($this->_table)." ORDER BY serial DESC LIMIT 1"); + } + + public function update_status_by_serial($status, $serial, $condition = '') { + return DB::query("UPDATE ".DB::table($this->_table)." SET ".DB::field('status', $status)." WHERE ".DB::field('serial', $serial, $condition)); + } + + public function fetch_needfix_patch($serials) { + return DB::fetch_all("SELECT * FROM ".DB::table($this->_table)." WHERE ".DB::field('serial', $serials)." AND status<=0"); + } + + public function fetch_patch_by_status($status) { + return DB::fetch_all("SELECT * FROM ".DB::table($this->_table)." WHERE ".DB::field('status', $status)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_payment_order.php b/source/class/table/table_common_payment_order.php new file mode 100644 index 0000000..d98c689 --- /dev/null +++ b/source/class/table/table_common_payment_order.php @@ -0,0 +1,96 @@ +_table = 'common_payment_order'; + $this->_pk = 'id'; + parent::__construct(); + } + + public function update_order_finish($id, $trade_no, $payment_time, $channel) { + DB::query("UPDATE %t SET `trade_no` = %s,`payment_time` = %d, `channel` = %s, `status` = %d WHERE `id` = %d AND `status` = 0", array($this->_table, $trade_no, $payment_time, $channel, 1, $id)); + return DB::affected_rows(); + } + + public function count_by_search($uid, $optype, $begintime, $endtime, $out_biz_no = '', $channel = '', $status = '') { + $condition = $this->make_query_condition($uid, $optype, $begintime, $endtime, $out_biz_no, $channel, $status); + return DB::result_first('SELECT COUNT(*) FROM %t ' . $condition[0], $condition[1]); + } + + public function fetch_by_biz_no($out_biz_no) { + return DB::fetch_first("SELECT * FROM %t WHERE out_biz_no = %s", array($this->_table, $out_biz_no)); + } + + public function fetch_type_all($uid = 0) { + $wherestr = ''; + if($uid) { + $wherestr = 'WHERE `uid` = ' . intval($uid); + } + $query = DB::query("SELECT `type`, `type_name` FROM %t $wherestr GROUP BY `type`", array($this->_table)); + $result = array(); + while($item = DB::fetch($query)) { + $result[$item['type']] = $item['type_name']; + } + return $result; + } + + public function fetch_all_by_search($uid, $optype, $begintime = 0, $endtime = 0, $out_biz_no = '', $channel = '', $status = '', $start = 0, $limit = 0) { + $condition = $this->make_query_condition($uid, $optype, $begintime, $endtime, $out_biz_no, $channel, $status); + return DB::fetch_all('SELECT * FROM %t ' . $condition[0] . ' ORDER BY id DESC ' . DB::limit($start, $limit), $condition[1], 'id'); + } + + private function make_query_condition($uid, $optype, $begintime = 0, $endtime = 0, $out_biz_no = '', $channel = '', $status = '') { + $wherearr = array(); + $parameter = array($this->_table); + if($out_biz_no) { + $wherearr[] = 'out_biz_no = %s'; + $parameter[] = $out_biz_no; + } + if($uid) { + $uid = dintval($uid, true); + $wherearr[] = is_array($uid) && $uid ? 'uid IN (%n)' : 'uid = %d'; + $parameter[] = $uid; + } + if($optype) { + $wherearr[] = is_array($optype) && $optype ? '`type` IN (%n)' : '`type` = %s'; + $parameter[] = $optype != -1 ? $optype : ''; + } + if($channel) { + $wherearr[] = 'channel = %s'; + $parameter[] = $channel; + } + if($status !== '') { + if($status == 2) { + $wherearr[] = '`status` = 0 AND `expire_time` < %d'; + $parameter[] = time(); + } else { + $wherearr[] = '`status` = %d'; + $parameter[] = $status; + } + } + if($begintime) { + $wherearr[] = 'dateline > %d'; + $parameter[] = dmktime($begintime); + } + if($endtime) { + $wherearr[] = 'dateline < %d'; + $parameter[] = dmktime($endtime); + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE ' . implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_payment_refund.php b/source/class/table/table_common_payment_refund.php new file mode 100644 index 0000000..07882c6 --- /dev/null +++ b/source/class/table/table_common_payment_refund.php @@ -0,0 +1,35 @@ +_table = 'common_payment_refund'; + $this->_pk = 'id'; + parent::__construct(); + } + + public function fetch_by_no($refund_no) { + return DB::fetch_first("SELECT * FROM %t WHERE out_biz_no = %s", array($this->_table, $refund_no)); + } + + public function update_refund_by_no($refund_no, $data) { + DB::update($this->_table, $data, DB::field('out_biz_no', $refund_no)); + } + + public function sum_by_orders($ids) { + return DB::fetch_all("SELECT `order_id`, sum(`amount`) as `amount` FROM %t WHERE `order_id` in (%n) AND `status` = 2 GROUP BY `order_id`", array($this->_table, $ids), 'order_id'); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_payment_transfer.php b/source/class/table/table_common_payment_transfer.php new file mode 100644 index 0000000..ffe940d --- /dev/null +++ b/source/class/table/table_common_payment_transfer.php @@ -0,0 +1,73 @@ +_table = 'common_payment_transfer'; + $this->_pk = 'id'; + parent::__construct(); + } + + public function fetch_by_no($transfer_no) { + return DB::fetch_first("SELECT * FROM %t WHERE out_biz_no = %s", array($this->_table, $transfer_no)); + } + + public function update_transfer_by_no($transfer_no, $data) { + DB::update($this->_table, $data, DB::field('out_biz_no', $transfer_no)); + } + + public function count_by_search($uid, $begintime, $endtime, $out_biz_no = '', $channel = '', $status = '') { + $condition = $this->make_query_condition($uid, $begintime, $endtime, $out_biz_no, $channel, $status); + return DB::result_first('SELECT COUNT(*) FROM %t ' . $condition[0], $condition[1]); + } + + public function fetch_all_by_search($uid, $begintime = 0, $endtime = 0, $out_biz_no = '', $channel = '', $status = '', $start = 0, $limit = 0) { + $condition = $this->make_query_condition($uid, $begintime, $endtime); + return DB::fetch_all('SELECT * FROM %t ' . $condition[0] . ' ORDER BY id DESC ' . DB::limit($start, $limit), $condition[1], 'id'); + } + + private function make_query_condition($uid, $begintime = 0, $endtime = 0, $out_biz_no = '', $channel = '', $status = '') { + $wherearr = array(); + $parameter = array($this->_table); + if($out_biz_no) { + $wherearr[] = 'out_biz_no = %s'; + $parameter[] = $out_biz_no; + } + if($uid) { + $uid = dintval($uid, true); + $wherearr[] = is_array($uid) && $uid ? 'uid IN (%n)' : 'uid = %d'; + $parameter[] = $uid; + } + if($channel) { + $wherearr[] = 'channel = %s'; + $parameter[] = $channel; + } + if($status !== '') { + $wherearr[] = 'status = %d'; + $parameter[] = $status; + } + if($begintime) { + $wherearr[] = 'dateline > %d'; + $parameter[] = dmktime($begintime); + } + if($endtime) { + $wherearr[] = 'dateline < %d'; + $parameter[] = dmktime($endtime); + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE ' . implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_plugin.php b/source/class/table/table_common_plugin.php new file mode 100644 index 0000000..74e346e --- /dev/null +++ b/source/class/table/table_common_plugin.php @@ -0,0 +1,58 @@ +_table = 'common_plugin'; + $this->_pk = 'pluginid'; + + parent::__construct(); + } + + public function fetch_by_identifier($identifier) { + return DB::fetch_first('SELECT * FROM %t WHERE identifier=%s', array($this->_table, $identifier)); + } + + public function fetch_all_identifier($identifier) { + return DB::fetch_all('SELECT * FROM %t WHERE identifier IN (%n)', array($this->_table, $identifier), 'identifier'); + } + + public function fetch_all_data($available = false) { + $available = $available !== false ? 'WHERE available='.intval($available) : ''; + return DB::fetch_all('SELECT * FROM %t %i ORDER BY available DESC, pluginid DESC', array($this->_table, $available)); + } + + public function fetch_all_by_identifier($identifier) { + if(!$identifier) { + return; + } + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('identifier', $identifier))); + } + + public function fetch_by_pluginvarid($pluginid, $pluginvarid) { + return DB::fetch_first("SELECT * FROM %t p, %t pv WHERE p.pluginid=%d AND pv.pluginid=p.pluginid AND pv.pluginvarid=%d", + array($this->_table, 'common_pluginvar', $pluginid, $pluginvarid)); + } + + public function delete_by_identifier($identifier) { + if(!$identifier) { + return; + } + DB::delete('common_plugin', DB::field('identifier', $identifier)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_pluginvar.php b/source/class/table/table_common_pluginvar.php new file mode 100644 index 0000000..2bdccc6 --- /dev/null +++ b/source/class/table/table_common_pluginvar.php @@ -0,0 +1,65 @@ +_table = 'common_pluginvar'; + $this->_pk = 'pluginvarid'; + + parent::__construct(); + } + + public function fetch_all_by_pluginid($pluginid) { + return DB::fetch_all("SELECT * FROM %t WHERE pluginid=%d ORDER BY displayorder", array($this->_table, $pluginid)); + } + public function count_by_pluginid($pluginid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE pluginid=%d %i", array($this->_table, $pluginid, "AND (`type` NOT LIKE 'forum\_%' AND `type` NOT LIKE 'group\_%')")); + } + + public function update_by_variable($pluginid, $variable, $data) { + if(!$pluginid || !$variable || !$data || !is_array($data)) { + return; + } + DB::update($this->_table, $data, DB::field('pluginid', $pluginid).' AND '.DB::field('variable', $variable)); + } + + public function update_by_pluginvarid($pluginid, $pluginvarid, $data) { + if(!$pluginid || !$pluginvarid || !$data || !is_array($data)) { + return; + } + DB::update($this->_table, $data, DB::field('pluginid', $pluginid).' AND '.DB::field('pluginvarid', $pluginvarid)); + } + + public function check_variable($pluginid, $variable) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE pluginid=%d AND variable=%s", array($this->_table, $pluginid, $variable)); + } + + public function delete_by_pluginid($pluginid) { + if(!$pluginid) { + return; + } + DB::delete($this->_table, DB::field('pluginid', $pluginid)); + } + + public function delete_by_variable($pluginid, $variable) { + if(!$pluginid || !$variable) { + return; + } + DB::delete($this->_table, DB::field('pluginid', $pluginid).' AND '.DB::field('variable', $variable)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_process.php b/source/class/table/table_common_process.php new file mode 100644 index 0000000..3cecda7 --- /dev/null +++ b/source/class/table/table_common_process.php @@ -0,0 +1,30 @@ +_table = 'common_process'; + $this->_pk = 'processid'; + + parent::__construct(); + } + + public function delete_process($name, $time) { + $name = addslashes($name); + return DB::delete('common_process', "processid='$name' OR expiry<".intval($time)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_regip.php b/source/class/table/table_common_regip.php new file mode 100644 index 0000000..1a5ba13 --- /dev/null +++ b/source/class/table/table_common_regip.php @@ -0,0 +1,45 @@ +_table = 'common_regip'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_by_ip_dateline($clientip, $dateline) { + return DB::fetch_first('SELECT count FROM %t WHERE ip=%s AND count>0 AND dateline>%d', array($this->_table, $clientip, $dateline)); + } + + public function count_by_ip_dateline($ctrlip, $dateline) { + if(!empty($ctrlip)) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE '.DB::field('ip', $ctrlip, 'like').' AND count=-1 AND dateline>%d LIMIT 1', array($this->_table, $dateline)); + } + return 0; + } + + public function update_count_by_ip($clientip) { + return DB::query('UPDATE %t SET count=count+1 WHERE ip=%s AND count>0', array($this->_table, $clientip)); + } + + public function delete_by_dateline($dateline) { + return DB::query('DELETE FROM %t WHERE dateline<=%d', array($this->_table, $dateline), false, true); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_relatedlink.php b/source/class/table/table_common_relatedlink.php new file mode 100644 index 0000000..c9b3665 --- /dev/null +++ b/source/class/table/table_common_relatedlink.php @@ -0,0 +1,26 @@ +_table = 'common_relatedlink'; + $this->_pk = 'id'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_report.php b/source/class/table/table_common_report.php new file mode 100644 index 0000000..f8269fc --- /dev/null +++ b/source/class/table/table_common_report.php @@ -0,0 +1,57 @@ +_table = 'common_report'; + $this->_pk = 'id'; + + parent::__construct(); + } + public function fetch_count($operated = 0, $id = 0, $fid = 0) { + $where = empty($operated) ? 'opuid=0' : 'opuid>0'; + $idsql = $id ? DB::field('id', $id).' AND ' : ''; + $fidsql = $fid ? ' AND '.DB::field('fid', $fid) : ''; + return DB::result_first('SELECT count(*) FROM '.DB::table('common_report').' WHERE '.$idsql.$where.$fidsql); + } + + public function fetch_all($ids = null, $force_from_db = false, $null1 = 0, $null2 = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + $ids = $ids === null ? 0 : $ids; + $force_from_db = $force_from_db === false ? 100 : $force_from_db; + return $this->fetch_all_report($ids, $force_from_db, $null1, $null2); + } + } + + public function fetch_all_report($start = 0, $limit = 100, $operated = 0, $fid = 0) { + $where = empty($operated) ? 'opuid=0' : 'opuid>0'; + $order = empty($operated) ? 'num' : 'optime'; + $fidsql = $fid ? ' AND '.DB::field('fid', $fid) : ''; + return DB::fetch_all("SELECT * FROM %t WHERE $where.$fidsql ORDER BY $order DESC, dateline DESC LIMIT %d, %d", array($this->_table, $start, $limit)); + } + + public function fetch_by_urlkey($urlkey) { + return DB::result_first("SELECT id FROM %t WHERE urlkey=%s AND opuid='0'", array($this->_table, $urlkey)); + } + + public function update_num($id, $message) { + DB::query("UPDATE %t SET message=CONCAT_WS('
    ', message, %s), num=num+1 WHERE id=%d", array($this->_table, $message, $id)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_searchindex.php b/source/class/table/table_common_searchindex.php new file mode 100644 index 0000000..0e4f212 --- /dev/null +++ b/source/class/table/table_common_searchindex.php @@ -0,0 +1,53 @@ +_table = 'common_searchindex'; + $this->_pk = 'searchid'; + + parent::__construct(); + } + + public function fetch_by_searchid_srchmod($searchid, $srchmod) { + return DB::fetch_first('SELECT * FROM %t WHERE searchid=%d AND srchmod=%d', array($this->_table, $searchid, $srchmod)); + } + + public function count_by_dateline($timestamp, $srchmod = '') { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE '.($srchmod ? 'srchmod='.dintval($srchmod).' AND ' : '').'dateline>%d-60', array($this->_table, $timestamp)); + } + + public function fetch_all_search($searchctrl, $useip, $uid, $timestamp, $searchstring, $srchmod = '') { + if(!$searchctrl || !$timestamp) { + return null; + } + $timestamp = dintval($timestamp); + $uid = dintval($uid); + $srchmod = dintval($srchmod); + $useip = daddslashes($useip); + $searchctrl = dintval($searchctrl); + $searchstring = daddslashes($searchstring); + + return DB::fetch_all("SELECT searchid, dateline, + ('".$searchctrl."'<>'0' AND ".(empty($uid) ? "useip='$useip'" : "uid='$uid'")." AND $timestamp-dateline<'".$searchctrl."') AS flood, + (searchstring='$searchstring' AND expiration>'$timestamp') AS indexvalid + FROM ".DB::table($this->_table)." + WHERE ".($srchmod ? "srchmod='$srchmod' AND " : '')."('".$searchctrl."'<>'0' AND ".(empty($uid) ? "useip='$useip'" : "uid='$uid'")." AND $timestamp-dateline<".$searchctrl.") OR (searchstring='$searchstring' AND expiration>'$timestamp') + ORDER BY flood"); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_seccheck.php b/source/class/table/table_common_seccheck.php new file mode 100644 index 0000000..a697670 --- /dev/null +++ b/source/class/table/table_common_seccheck.php @@ -0,0 +1,115 @@ +_table = 'common_seccheck'; + $this->_pk = 'ssid'; + + $this->_pre_cache_key = 'common_seccheck_'; + $this->_cache_ttl = 600; + + parent::__construct(); + } + + public function delete_expiration($ssid = 0) { + if ($this->_allowmem) { + if ($ssid) { + $ssid = dintval($ssid); + memory('rm', $ssid . "_verified", $this->_pre_cache_key); + memory('rm', $ssid . "_succeed", $this->_pre_cache_key); + memory('rm', $ssid . "_code", $this->_pre_cache_key); + memory('rm', $ssid . "_dateline", $this->_pre_cache_key); + } + } else { + if($ssid) { + $ssid = dintval($ssid); + DB::delete($this->_table, "ssid='$ssid'"); + } + DB::delete($this->_table, TIMESTAMP."-dateline>600"); + DB::delete($this->_table, "verified>4"); + DB::delete($this->_table, "succeed>1"); + } + } + + public function update_verified($ssid) { + if ($this->_allowmem) { + memory('inc', $ssid . "_verified", 1, 0, $this->_pre_cache_key); + } else { + DB::query("UPDATE %t SET verified=verified+1 WHERE ssid=%d", array($this->_table, $ssid)); + } + } + + public function update_succeed($ssid) { + if (!$this->_allowmem) { + return DB::query("UPDATE %t SET verified=verified+1,succeed=succeed+1 WHERE ssid=%d", array($this->_table, $ssid)); + } + memory('inc', $ssid . "_verified", 1, 0, $this->_pre_cache_key); + memory('inc', $ssid . "_succeed", 1, 0, $this->_pre_cache_key); + return 1; // simulate 1 row changed + } + + public function truncate() { + if ($this->_allowmem) { + } else { + DB::query("TRUNCATE %t", array($this->_table)); + } + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (!$this->_allowmem) { + return parent::insert($data, $return_insert_id, $replace, $silent); + } + + $ssid = memory("inc", 'pk', 1, 0, $this->_pre_cache_key); + foreach ($data as $key => $value) { + memory('set', $ssid . "_" . $key, $value, $this->_cache_ttl, $this->_pre_cache_key); + } + if ($return_insert_id) { + return $ssid; + } + return TRUE; + } + + public function fetch($id, $force_from_db = false) { + if (!$this->_allowmem) { + return parent::fetch($id, $force_from_db); + } + + $data = array(); + $data['ssid'] = $id; + $data['code'] = memory('get', $id . "_code", $this->_pre_cache_key); + $data['dateline'] = memory('get', $id . "_dateline", $this->_pre_cache_key); + $data['succeed'] = memory('get', $id . "_succeed", $this->_pre_cache_key); + $data['verified'] = memory('get', $id . "_verified", $this->_pre_cache_key); + return $data; + } + + public function delete($ssid, $force_from_db = false) { + if (!$this->_allowmem || $force_from_db) { + return parent::delete($ssid, $force_from_db); + } + $ssid = dintval($ssid); + memory('rm', $ssid . "_verified", $this->_pre_cache_key); + memory('rm', $ssid . "_succeed", $this->_pre_cache_key); + memory('rm', $ssid . "_code", $this->_pre_cache_key); + memory('rm', $ssid . "_dateline", $this->_pre_cache_key); + return true; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_secquestion.php b/source/class/table/table_common_secquestion.php new file mode 100644 index 0000000..366994d --- /dev/null +++ b/source/class/table/table_common_secquestion.php @@ -0,0 +1,45 @@ +_table = 'common_secquestion'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all($ids = null, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + $ids = $ids === null ? 0 : $ids; + $force_from_db = $force_from_db === false ? 0 : $force_from_db; + return $this->fetch_all_secquestion($ids, $force_from_db); + } + } + + public function fetch_all_secquestion($start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t'.DB::limit($start, $limit), array($this->_table)); + } + + public function delete_by_type($type) { + DB::query('DELETE FROM %t WHERE type=%d', array($this->_table, $type)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_session.php b/source/class/table/table_common_session.php new file mode 100644 index 0000000..5dec874 --- /dev/null +++ b/source/class/table/table_common_session.php @@ -0,0 +1,140 @@ +_table = 'common_session'; + $this->_pk = 'sid'; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_session($id, $force_from_db, $null); + } + } + + public function fetch_session($sid, $ip = false, $uid = false) { + if(empty($sid)) { + return array(); + } + $this->checkpk(); + $session = parent::fetch($sid); + if($session && $ip !== false && $ip != "{$session['ip']}") { + $session = array(); + } + if($session && $uid !== false && $uid != $session['uid']) { + $session = array(); + } + return $session; + } + + public function fetch_member($ismember = 0, $invisible = 0, $start = 0, $limit = 0) { + $sql = array(); + if($ismember === 1) { + $sql[] = 'uid > 0'; + } elseif($ismember === 2) { + $sql[] = 'uid = 0'; + } + if($invisible === 1) { + $sql[] = 'invisible = 1'; + } elseif($invisible === 2) { + $sql[] = 'invisible = 0'; + } + $wheresql = !empty($sql) && is_array($sql) ? ' WHERE '.implode(' AND ', $sql) : ''; + $sql = 'SELECT * FROM %t '.$wheresql.' ORDER BY lastactivity DESC'.DB::limit($start, $limit); + return DB::fetch_all($sql, array($this->_table), $this->_pk); + } + + public function count_invisible($type = 1) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE invisible=%d', array($this->_table, $type)); + } + + public function count($type = 0) { + $condition = $type == 1 ? ' WHERE uid>0 ' : ($type == 2 ? ' WHERE uid=0 ' : ''); + return DB::result_first("SELECT count(*) FROM ".DB::table($this->_table).$condition); + + } + + public function delete_by_session($session, $onlinehold, $guestspan) { + if(empty($session) || !is_array($session)) return; + $onlinehold = time() - $onlinehold; + $guestspan = time() - $guestspan; + + $session = daddslashes($session); + $condition = " sid='{$session['sid']}' "; + $condition .= " OR lastactivity<$onlinehold "; + $condition .= " OR (uid='0' AND ".DB::field('ip', $session['ip'])." AND lastactivity>$guestspan) "; + $condition .= $session['uid'] ? " OR (uid='{$session['uid']}') " : ''; + DB::delete('common_session', $condition); + } + + public function fetch_by_uid($uid) { + return !empty($uid) ? DB::fetch_first('SELECT * FROM %t WHERE uid=%d', array($this->_table, $uid)) : false; + } + + public function fetch_all_by_uid($uids, $start = 0, $limit = 0) { + $data = array(); + if(!empty($uids)) { + $data = DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('uid', $uids).DB::limit($start, $limit), array($this->_table), null, 'uid'); + } + return $data; + } + + public function update_max_rows($max_rows) { + return DB::query('ALTER TABLE '.DB::table('common_session').' MAX_ROWS='.dintval($max_rows)); + } + + public function clear() { + return DB::query('DELETE FROM '.DB::table('common_session')); + } + + public function count_by_fid($fid) { + return ($fid = dintval($fid)) ? DB::result_first('SELECT COUNT(*) FROM '.DB::table('common_session')." WHERE uid>'0' AND fid='$fid' AND invisible='0'") : 0; + } + + public function fetch_all_by_fid($fid, $limit = 12) { + return ($fid = dintval($fid)) ? DB::fetch_all('SELECT uid, groupid, username, invisible, lastactivity FROM '.DB::table('common_session')." WHERE uid>'0' AND fid='$fid' AND invisible='0' ORDER BY lastactivity DESC".DB::limit($limit)) : array(); + } + + public function update_by_uid($uid, $data){ + if(($uid = dintval($uid)) && !empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('uid', $uid)); + } + return 0; + } + + public function count_by_ip($ip) { + $count = 0; + if(!empty($ip)) { + $count = DB::result_first('SELECT COUNT(*) FROM '.DB::table('common_session')." WHERE ".DB::field('ip', $ip)); + } + return $count; + } + + public function fetch_all_by_ip($ip, $start = 0, $limit = 0) { + $data = array(); + if(!empty($ip)) { + $data = DB::fetch_all('SELECT * FROM %t WHERE ip=%s ORDER BY lastactivity DESC'.DB::limit($start, $limit), array($this->_table, $ip), null); + } + return $data; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_setting.php b/source/class/table/table_common_setting.php new file mode 100644 index 0000000..f5a8a65 --- /dev/null +++ b/source/class/table/table_common_setting.php @@ -0,0 +1,105 @@ +_table = 'common_setting'; + $this->_pk = 'skey'; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_setting($id, $force_from_db); + } + } + + public function fetch_all($ids, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_setting($ids, $force_from_db); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_setting($val, $data); + } + } + + public function fetch_setting($skey, $auto_unserialize = false) { + $data = DB::result_first('SELECT svalue FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $skey)); + return $auto_unserialize ? (array)dunserialize($data) : $data; + } + + public function fetch_all_setting($skeys = array(), $auto_unserialize = false){ + $data = array(); + $where = !empty($skeys) ? ' WHERE '.DB::field($this->_pk, $skeys) : ''; + $query = DB::query('SELECT * FROM '.DB::table($this->_table).$where); + while($value = DB::fetch($query)) { + $data[$value['skey']] = $auto_unserialize ? (array)dunserialize($value['svalue']) : $value['svalue']; + } + return $data; + } + + public function update_setting($skey, $svalue){ + return DB::insert($this->_table, array($this->_pk => $skey, 'svalue' => is_array($svalue) ? serialize($svalue) : $svalue), false, true); + } + + public function update_batch($array) { + $settings = array(); + foreach($array as $key => $value) { + $key = addslashes($key); + $value = addslashes(is_array($value) ? serialize($value) : $value); + $settings[] = "('$key', '$value')"; + } + if($settings) { + return DB::query("REPLACE INTO ".DB::table('common_setting')." (`skey`, `svalue`) VALUES ".implode(',', $settings)); + } + return false; + } + + public function skey_exists($skey) { + return DB::result_first('SELECT skey FROM %t WHERE skey=%s LIMIT 1', array($this->_table, $skey)) ? true : false; + } + + public function fetch_all_not_key($skey) { + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE skey NOT IN('.dimplode($skey).')'); + } + + public function fetch_all_table_status() { + return DB::fetch_all('SHOW TABLE STATUS'); + } + + public function get_tablepre() { + return DB::object()->tablepre; + } + + public function update_count($skey, $num) { + return DB::query("UPDATE %t SET svalue = svalue + %d WHERE skey = %s", array($this->_table, $num, $skey), false, true); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_smiley.php b/source/class/table/table_common_smiley.php new file mode 100644 index 0000000..09f6452 --- /dev/null +++ b/source/class/table/table_common_smiley.php @@ -0,0 +1,111 @@ +_table = 'common_smiley'; + $this->_pk = 'id'; + + parent::__construct(); + } + public function fetch_all_by_type($type) { + $type = $this->checktype($type); + if(empty($type)) { + return array(); + } + $typesql = is_array($type) ? 'type IN(%n)' : 'type=%s'; + return DB::fetch_all("SELECT * FROM %t WHERE $typesql ORDER BY displayorder", array($this->_table, $type), $this->_pk); + } + + public function fetch_all_by_typeid_type($typeid, $type, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE typeid=%d AND type=%s ORDER BY displayorder '.DB::limit($start, $limit), array($this->_table, $typeid, $type), $this->_pk); + } + public function fetch_all_by_type_code_typeid($type, $typeid) { + return DB::fetch_all("SELECT * FROM %t WHERE type=%s AND code<>'' AND typeid=%d ORDER BY displayorder ", array($this->_table, $type, $typeid), $this->_pk); + } + public function fetch_all_cache() { + return DB::fetch_all("SELECT s.id, s.code, s.url, t.typeid FROM %t s INNER JOIN %t t ON t.typeid=s.typeid WHERE s.type='smiley' AND s.code<>'' AND t.available='1' ORDER BY LENGTH(s.code) DESC", array($this->_table, 'forum_imagetype')); + + } + public function fetch_by_id_type($id, $type) { + return DB::fetch_first('SELECT * FROM %t WHERE id=%d AND type=%s', array($this->_table, $id, $type), $this->_pk); + } + public function update_by_type($type, $data) { + if(!empty($data) && is_array($data) && in_array($type, $this->allowtype)) { + return DB::update($this->_table, $data, DB::field('type', $type)); + } + return 0; + } + public function update_by_id_type($id, $type, $data) { + $id = dintval($id, true); + if(!empty($data) && is_array($data) && $id && in_array($type, $this->allowtype)) { + return DB::update($this->_table, $data, DB::field('id', $id).' AND '.DB::field('type', $type)); + } + return 0; + } + public function update_code_by_typeid($typeid) { + $typeid = dintval($typeid, true); + if(empty($typeid)) { + return 0; + } + $typeidsql = is_array($typeid) ? 'typeid IN(%n)' : 'typeid=%d'; + return DB::query("UPDATE %t SET code=CONCAT('{:', typeid, '_', id, ':}') WHERE $typeidsql", array($this->_table, $typeid)); + } + public function update_code_by_id($ids) { + $ids = dintval($ids, true); + if(empty($ids)) { + return 0; + } + $idssql = is_array($ids) ? 'id IN(%n)' : 'id=%d'; + return DB::query("UPDATE %t SET code=CONCAT('{:', typeid, '_', id, ':}') WHERE $idssql", array($this->_table, $ids)); + } + public function count_by_type($type) { + $type = $this->checktype($type); + if(empty($type)) { + return 0; + } + return DB::result_first('SELECT COUNT(*) FROM %t WHERE type IN(%n)', array($this->_table, $type)); + } + public function count_by_typeid($typeid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE typeid=%d', array($this->_table, $typeid)); + } + public function count_by_type_typeid($type, $typeid) { + $typeid = dintval($typeid, true); + if(!empty($typeid) && in_array($type, $this->allowtype)) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE type=%s AND typeid IN(%n)', array($this->_table, $type, $typeid)); + } + return 0; + } + public function count_by_type_code_typeid($type, $typeid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE type=%s AND code<>'' AND typeid=%d", array($this->_table, $type, $typeid)); + } + + private function checktype($type) { + if(is_array($type)) { + foreach($type as $key => $val) { + if(!in_array($val, $this->allowtype)) { + unset($type[$key]); + } + } + } else { + $type = in_array($type, $this->allowtype) ? $type : ''; + } + return $type; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_smsgw.php b/source/class/table/table_common_smsgw.php new file mode 100644 index 0000000..06d5e6e --- /dev/null +++ b/source/class/table/table_common_smsgw.php @@ -0,0 +1,34 @@ +_table = 'common_smsgw'; + $this->_pk = 'smsgwid'; + + parent::__construct(); + } + + public function fetch_all_gw_order_id() { + return DB::fetch_all("SELECT * FROM %t ORDER BY `order`, $this->_pk", array($this->_table)); + } + + public function fetch_all_gw_avaliable() { + return DB::fetch_all("SELECT * FROM %t WHERE available > %d ORDER BY `order`, $this->_pk", array($this->_table, 0)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_smslog.php b/source/class/table/table_common_smslog.php new file mode 100644 index 0000000..d07055f --- /dev/null +++ b/source/class/table/table_common_smslog.php @@ -0,0 +1,66 @@ +_table = 'common_smslog'; + $this->_pk = 'smslogid'; + + parent::__construct(); + } + + public function get_lastsms_by_uumm($uid, $svctype, $secmobicc, $secmobile) { + return DB::fetch_first("SELECT * FROM %t WHERE uid = %d AND svctype = %d AND secmobicc = %d AND secmobile = %d ORDER BY dateline DESC", array($this->_table, $uid, $svctype, $secmobicc, $secmobile)); + } + + public function get_sms_by_ut($uid, $time) { + $dateline = time() - $time; + return DB::fetch_all("SELECT dateline FROM %t WHERE uid = %d AND dateline > %d", array($this->_table, $uid, $dateline)); + } + + public function get_sms_by_mmt($secmobicc, $secmobile, $time) { + $dateline = time() - $time; + return DB::fetch_all("SELECT dateline FROM %t WHERE secmobicc = %d AND secmobile = %d AND dateline > %d", array($this->_table, $secmobicc, $secmobile, $dateline)); + } + + public function count_sms_by_milions_mmt($secmobicc, $secmobile, $time) { + $dateline = time() - $time; + $secmobile = substr($secmobile, 0, -4); + return DB::result_first("SELECT COUNT(*) FROM %t WHERE secmobicc = %d AND secmobile LIKE %d AND dateline > %d", array($this->_table, $secmobicc, $secmobile, $dateline)); + } + + public function count_sms_by_time($time) { + $dateline = time() - $time; + return DB::result_first("SELECT COUNT(*) FROM %t WHERE dateline > %d", array($this->_table, $dateline)); + } + + public function fetch_all_by_dateline($dateline, $glue = '>=') { + $glue = helper_util::check_glue($glue); + return DB::fetch_all("SELECT * FROM %t WHERE dateline{$glue}%d ORDER BY dateline", array($this->_table, $dateline), $this->_pk); + } + + public function insert_archiver($data) { + if(!empty($data) && is_array($data)) { + return DB::insert($this->_archiver_table, $data, false, true); + } + return 0; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_sphinxcounter.php b/source/class/table/table_common_sphinxcounter.php new file mode 100644 index 0000000..436be20 --- /dev/null +++ b/source/class/table/table_common_sphinxcounter.php @@ -0,0 +1,26 @@ +_table = 'common_sphinxcounter'; + $this->_pk = 'indexid'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_stat.php b/source/class/table/table_common_stat.php new file mode 100644 index 0000000..dd563dc --- /dev/null +++ b/source/class/table/table_common_stat.php @@ -0,0 +1,80 @@ +_table = 'common_stat'; + $this->_pk = 'daytime'; + + parent::__construct(); + } + + public function updatestat($uid, $type, $primary = 0, $num = 1) { + $nowdaytime = dgmdate(TIMESTAMP, 'Ymd'); + $type = addslashes($type); + if($primary) { + $setarr = array( + 'uid' => intval($uid), + 'daytime' => $nowdaytime, + 'type' => $type + ); + if(C::t('common_statuser')->check_exists($uid, $nowdaytime, $type)) { + return false; + } else { + C::t('common_statuser')->insert($setarr); + } + } + $num = abs(intval($num)); + if(DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table)." WHERE `daytime` = '$nowdaytime'")){ + DB::query('UPDATE '.DB::table($this->_table)." SET `$type`=`$type`+$num WHERE `daytime` = '$nowdaytime'"); + } else { + DB::query("INSERT INTO ".DB::table($this->_table)." (`daytime`, `$type`) VALUES ('$nowdaytime', '$num') ON DUPLICATE KEY UPDATE `$type` = `$type` + '$num'"); + C::t('common_statuser')->clear_by_daytime($nowdaytime); + } + } + + public function fetch_post_avg() { + return DB::result_first("SELECT AVG(post) FROM ".DB::table($this->_table)); + } + + public function fetch_all($ids, $force_from_db = false, $null = '*') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_stat($ids, $force_from_db, $null); + } + } + + public function fetch_all_stat($begin, $end, $field = '*') { + $data = array(); + $query = DB::query('SELECT %i FROM %t WHERE daytime>=%d AND daytime<=%d ORDER BY daytime', array($field, $this->_table, $begin, $end)); + while($value = DB::fetch($query)) { + $data[$value['daytime']] = $value; + } + return $data; + } + public function fetch_all_by_daytime($daytime, $start = 0, $limit = 0, $sort = 'ASC') { + $wheresql = ''; + $parameter = array($this->_table); + if($daytime) { + $wheresql = 'WHERE daytime>=%d'; + $parameter[] = $daytime; + } + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY daytime $sort".DB::limit($start, $limit), $parameter); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_statuser.php b/source/class/table/table_common_statuser.php new file mode 100644 index 0000000..3b94bb0 --- /dev/null +++ b/source/class/table/table_common_statuser.php @@ -0,0 +1,44 @@ +_table = 'common_statuser'; + $this->_pk = ''; + + parent::__construct(); + } + + public function check_exists($uid, $daytime, $type) { + + $setarr = array( + 'uid' => intval($uid), + 'daytime' => intval($daytime), + 'type' => $type + ); + if(DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).' WHERE '.DB::implode_field_value($setarr, ' AND '))) { + return true; + } else { + return false; + } + } + + public function clear_by_daytime($daytime) { + $daytime = intval($daytime); + DB::delete('common_statuser', "`daytime` != '$daytime'"); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_style.php b/source/class/table/table_common_style.php new file mode 100644 index 0000000..6ebfd50 --- /dev/null +++ b/source/class/table/table_common_style.php @@ -0,0 +1,52 @@ +_table = 'common_style'; + $this->_pk = 'styleid'; + + parent::__construct(); + } + + public function fetch_all_data($withtemplate = false, $available = false) { + if($withtemplate) { + $available = $available !== false ? 'WHERE s.available='.intval($available) : ''; + return DB::fetch_all('SELECT s.*, t.name AS tplname, t.directory, t.copyright FROM %t s LEFT JOIN %t t ON t.templateid=s.templateid %i ORDER BY s.styleid ASC', array($this->_table, 'common_template', $available)); + } else { + $available = $available !== false ? 'WHERE available='.intval($available) : ''; + return DB::fetch_all('SELECT * FROM %t %i', array($this->_table, $available)); + } + } + + public function fetch_by_styleid($styleid) { + return DB::fetch_first("SELECT s.*, t.name AS tplname, t.directory, t.copyright FROM %t s LEFT JOIN %t t ON s.templateid=t.templateid WHERE s.styleid=%d", array($this->_table, 'common_template', $styleid)); + } + + public function check_stylename($stylename) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE name=%s", array($this->_table, $stylename)); + } + + public function fetch_by_stylename_templateid($stylename, $templateid = 0) { + if($templateid) { + return DB::fetch_first("SELECT * FROM %t WHERE name=%s AND templateid=%d ORDER BY styleid ASC LIMIT 1", array($this->_table, $stylename, $templateid)); + }else{ + return DB::fetch_first("SELECT * FROM %t WHERE name=%s ORDER BY styleid ASC LIMIT 1", array($this->_table, $stylename)); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_stylevar.php b/source/class/table/table_common_stylevar.php new file mode 100644 index 0000000..dfbe892 --- /dev/null +++ b/source/class/table/table_common_stylevar.php @@ -0,0 +1,52 @@ +_table = 'common_stylevar'; + $this->_pk = 'stylevarid'; + + parent::__construct(); + } + + public function fetch_all_by_styleid($styleid, $available = false) { + if($available !== false) { + return DB::fetch_all("SELECT sv.* FROM %t sv INNER JOIN %t s ON s.styleid = sv.styleid AND (s.available=%d OR s.styleid=%d)", array($this->_table, 'common_style', $available, $styleid)); + } else { + return DB::fetch_all("SELECT * FROM %t WHERE styleid=%d", array($this->_table, $styleid)); + } + } + + public function check_duplicate($styleid, $variable) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE styleid=%d AND variable=%s", array($this->_table, $styleid, $variable)); + } + + public function update_substitute_by_styleid($substitute, $id, $stylevarids = array()) { + if(!is_string($substitute) || !$id) { + return; + } + DB::update($this->_table, array('substitute' => $substitute), ($stylevarids ? DB::field('stylevarid', $stylevarids).' AND ' : '').DB::field('styleid', $id)); + } + + public function delete_by_styleid($id, $stylevarids = array()) { + if(!$id) { + return; + } + DB::delete($this->_table,($stylevarids ? DB::field('stylevarid', $stylevarids).' AND ' : '').DB::field('styleid', $id)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_syscache.php b/source/class/table/table_common_syscache.php new file mode 100644 index 0000000..c2b9894 --- /dev/null +++ b/source/class/table/table_common_syscache.php @@ -0,0 +1,184 @@ +_table = 'common_syscache'; + $this->_pk = 'cname'; + $this->_pre_cache_key = ''; + $this->_isfilecache = getglobal('config/cache/type') == 'file'; + $this->_allowmem = memory('check'); + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_syscache($id); + } + } + + public function fetch_all($ids, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_syscache($ids); + } + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + return $this->insert_syscache($data, $return_insert_id); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_syscache($val, $data); + } + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_syscache($val); + } + } + + public function fetch_syscache($cachename) { + $data = $this->fetch_all_syscache(array($cachename)); + return isset($data[$cachename]) ? $data[$cachename] : false; + } + + public function fetch_all_syscache($cachenames) { + $data = array(); + $cachenames = is_array($cachenames) ? $cachenames : array($cachenames); + if ($this->_allowmem) { + if (($index = array_search('setting', $cachenames)) !== FALSE) { + if (memory('exists', 'setting')) { + unset($cachenames[$index]); + $settings = new memory_setting_array(); + } + } + + $data = memory('get', $cachenames); + if (isset($settings)) { + $data['setting'] = $settings; + } + $newarray = $data !== false ? array_diff($cachenames, array_keys($data)) : $cachenames; + if (empty($newarray)) { + return $data; + } else { + $cachenames = $newarray; + } + } + + if($this->_isfilecache) { + $lostcaches = array(); + foreach($cachenames as $cachename) { + if(!@include_once(DISCUZ_ROOT.'./data/cache/cache_'.$cachename.'.php')) { + $lostcaches[] = $cachename; + } elseif($this->_allowmem) { + $cachename === 'setting' ? memory_setting_array::save($data[$cachename]) : memory('set', $cachename, $data[$cachename]); + } + } + if(!$lostcaches) { + return $data; + } + $cachenames = $lostcaches; + unset($lostcaches); + } + + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('cname', $cachenames)); + while($syscache = DB::fetch($query)) { + $data[$syscache['cname']] = $syscache['ctype'] ? dunserialize($syscache['data']) : $syscache['data']; + if ($this->_allowmem) { + if ($syscache['cname'] === 'setting') { + memory_setting_array::save($data[$syscache['cname']]); + } else { + memory('set', $syscache['cname'], $data[$syscache['cname']]); + } + } + if($this->_isfilecache) { + $cachedata = '$data[\''.$syscache['cname'].'\'] = '.var_export($data[$syscache['cname']], true).";\n\n"; + $cachedata_save = ""; + $fp = fopen(DISCUZ_ROOT.'./data/cache/cache_'.$syscache['cname'].'.php', 'cb'); + if(!($fp && flock($fp, LOCK_EX) && ftruncate($fp, 0) && fwrite($fp, $cachedata_save) && fflush($fp) && flock($fp, LOCK_UN) && fclose($fp))) { + flock($fp, LOCK_UN); + fclose($fp); + unlink(DISCUZ_ROOT.'./data/cache/cache_'.$syscache['cname'].'.php'); + } + } + } + + foreach($cachenames as $name) { + if(!isset($data[$name]) || $data[$name] === null) { + $data[$name] = null; + $this->_allowmem && (memory('set', $name, array())); + } + } + + return $data; + } + + public function insert_syscache($cachename, $data) { + + parent::insert(array( + 'cname' => $cachename, + 'ctype' => is_array($data) ? 1 : 0, + 'dateline' => TIMESTAMP, + 'data' => is_array($data) ? serialize($data) : $data, + ), false, true); + + if ($this->_allowmem && memory('exists', $cachename) !== false) { + if ($cachename === 'setting') { + memory_setting_array::save($data); + } else { + memory('set', $cachename, $data); + } + } + $this->_isfilecache && @unlink(DISCUZ_ROOT.'./data/cache/cache_'.$cachename.'.php'); + } + + public function update_syscache($cachename, $data) { + $this->insert_syscache($cachename, $data); + } + + public function delete_syscache($cachenames) { + parent::delete($cachenames); + if($this->_allowmem || $this->_isfilecache) { + foreach((array)$cachenames as $cachename) { + $this->_allowmem && memory('rm', $cachename); + $this->_isfilecache && @unlink(DISCUZ_ROOT.'./data/cache/cache_'.$cachename.'.php'); + } + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_tag.php b/source/class/table/table_common_tag.php new file mode 100644 index 0000000..05a3451 --- /dev/null +++ b/source/class/table/table_common_tag.php @@ -0,0 +1,99 @@ +_table = 'common_tag'; + $this->_pk = 'tagid'; + + parent::__construct(); + } + + public function fetch_all_by_status($status = NUll, $tagname = '', $startlimit = 0, $count = 0, $returncount = 0, $order = '') { + if($status === NULL) { + $statussql = 'status<>3'; + } else { + $statussql = 'status='.intval($status); + } + $data = array($this->_table); + if($tagname) { + $namesql = " AND tagname LIKE %s"; + $data[] = '%'.$tagname.'%'; + } + if($returncount) { + return DB::result_first("SELECT count(*) FROM %t WHERE $statussql $namesql", $data); + } + return DB::fetch_all("SELECT * FROM %t WHERE $statussql $namesql ORDER BY ".DB::order('tagid', $order)." ".DB::limit($startlimit, $count), $data); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + $return_insert_id = $return_insert_id === false ? 0 : $return_insert_id; + return $this->insert_tag($data, $return_insert_id); + } + } + + public function insert_tag($tagname, $status = 0) { + DB::query('INSERT INTO %t (tagname, status) VALUES (%s, %d)', array($this->_table, $tagname, $status)); + return DB::insert_id(); + } + + public function get_byids($ids) { + if(empty($ids)) { + return array(); + } + if(!is_array($ids)) { + $ids = array($ids); + } + return DB::fetch_all('SELECT * FROM %t WHERE tagid IN (%n)', array($this->_table, $ids), 'tagid'); + } + public function get_bytagname($tagname, $type) { + if(empty($tagname)) { + return array(); + } + $statussql = $type != 'uid' ? ' AND status<\'3\'' : ' AND status=\'3\''; + return DB::fetch_first('SELECT * FROM %t WHERE tagname=%s '.$statussql, array($this->_table, $tagname)); + } + + public function fetch_info($tagid, $tagname = '') { + if(empty($tagid) && empty($tagname)) { + return array(); + } + $addsql = $sqlglue = ''; + if($tagid) { + $addsql = " tagid=".intval($tagid); + $sqlglue = ' AND '; + } + if($tagname) { + $addsql .= $sqlglue.' '.DB::field('tagname', $tagname); + } + return DB::fetch_first("SELECT tagid,tagname,status FROM ".DB::table('common_tag')." WHERE $addsql"); + } + + public function delete_byids($ids) { + if(empty($ids)) { + return false; + } + if(!is_array($ids)) { + $ids = array($ids); + } + return DB::query('DELETE FROM %t WHERE tagid IN (%n)', array($this->_table, $ids)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_tagitem.php b/source/class/table/table_common_tagitem.php new file mode 100644 index 0000000..535e9b3 --- /dev/null +++ b/source/class/table/table_common_tagitem.php @@ -0,0 +1,104 @@ +_table = 'common_tagitem'; + $this->_pk = ''; + + parent::__construct(); + } + + public function replace($tagid, $itemid, $idtype) { + return DB::query('REPLACE INTO %t (tagid, itemid, idtype) VALUES (%d, %d, %s)', array($this->_table, $tagid, $itemid, $idtype)); + } + + public function select($tagid = 0, $itemid = 0, $idtype = '', $orderfield = '', $ordertype = 'DESC', $limit = 0, $count = 0, $itemidglue = '=', $returnnum = 0) { + $data = $this->make_where($tagid, $itemid, $idtype, $itemidglue); + $ordersql = $limitsql = ''; + if($orderfield) { + $ordersql = ' ORDER BY '.DB::order($orderfield, $ordertype); + } + if($limit || $count) { + $limitsql = DB::limit($limit, $count); + } + if($data) { + if($returnnum) { + return DB::result_first('SELECT count(*) FROM %t WHERE '.$data['where'], $data['data']); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.$data['where'].$ordersql.$limitsql, $data['data']); + } else { + return false; + } + } + + public function delete($val, $unbuffered = false, $null = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + $unbuffered = $unbuffered === false ? 0 : $unbuffered; + return $this->delete_tagitem($val, $unbuffered, $null); + } + } + + public function delete_tagitem($tagid = 0, $itemid = 0, $idtype = '') { + $data = $this->make_where($tagid, $itemid, $idtype); + if($data) { + return DB::query('DELETE FROM %t WHERE '.$data['where'], $data['data']); + } else { + return false; + } + } + + private function make_where($tagid = 0, $itemid = 0, $idtype = '', $itemidglue = '=') { + $wheresql = ' 1'; + $data = array(); + $data['data'][] = $this->_table; + if($tagid) { + $wheresql .= !is_array($tagid) ? " AND tagid=%d" : " AND tagid IN (%n)"; + $data['data'][] = $tagid; + } + if($itemid) { + $wheresql .= !is_array($itemid) ? " AND ".DB::field('itemid', $itemid, $itemidglue) : " AND ".DB::field('itemid', $itemid); + } + if($idtype) { + $wheresql .= " AND idtype=%s"; + $data['data'][] = $idtype; + } + if($wheresql == ' 1') { + return false; + } + $data['where'] = $wheresql; + return $data; + } + + public function unique($tagid, $itemid, $idtype) { + DB::query('DELETE FROM %t WHERE tagid<>%d AND itemid=%d AND idtype=%s', array($this->_table, $tagid, $itemid, $idtype)); + } + + public function merge_by_tagids($newid, $tagidarray) { + if(!is_array($tagidarray)) { + $tagidarray = array($tagidarray); + } + DB::query('UPDATE %t SET tagid=%d WHERE tagid IN (%n)', array($this->_table, $newid, $tagidarray)); + } + + public function count_by_tagid($tagid) { + return DB::result_first("SELECT count(*) FROM ".DB::table('common_tagitem')." WHERE tagid='".intval($tagid)."'"); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_task.php b/source/class/table/table_common_task.php new file mode 100644 index 0000000..c65f524 --- /dev/null +++ b/source/class/table/table_common_task.php @@ -0,0 +1,100 @@ +_table = 'common_task'; + $this->_pk = 'taskid'; + + parent::__construct(); + } + + public function fetch_all_by_available($available) { + return DB::fetch_all("SELECT * FROM %t WHERE available=%d", array($this->_table, $available), $this->_pk); + } + + public function fetch_all_data() { + return DB::fetch_all("SELECT * FROM %t ORDER BY displayorder, taskid DESC", array($this->_table)); + } + + public function count_by_scriptname($scriptname) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE scriptname=%s", array($this->_table, $scriptname)); + } + + public function fetch_all_by_scriptname($scriptname) { + return DB::fetch_all("SELECT * FROM %t WHERE scriptname=%s", array($this->_table, $scriptname)); + } + + public function update_by_scriptname($scriptname, $data) { + if(!$data || !is_array($data)) { + return; + } + DB::update($this->_table, $data, DB::field('scriptname', $scriptname)); + } + + public function update_applicants($taskid, $v) { + DB::query("UPDATE %t SET applicants=applicants+%s WHERE taskid=%d", array($this->_table, $v, $taskid)); + } + + public function update_achievers($taskid, $v) { + return DB::query("UPDATE %t SET achievers=achievers+%s WHERE taskid=%d", array($this->_table, $v, $taskid)); + } + + public function update_available($available = 2) { + if($available == 2) { + DB::query("UPDATE %t SET available='2' WHERE available='1' AND starttime<=%d AND (endtime='0' OR endtime>%d)", array($this->_table, TIMESTAMP, TIMESTAMP), false, true); + } else { + DB::query("UPDATE %t SET available='1' WHERE available='2' AND (starttime>%d || (endtime<=%d && endtime>'0'))", array($this->_table, TIMESTAMP, TIMESTAMP), false, true); + } + } + + public function fetch_next_starttime() { + return DB::result_first("SELECT starttime FROM %t WHERE available='1' AND starttime>'0' AND (endtime='0' OR endtime>%d) ORDER BY starttime ASC", array($this->_table, TIMESTAMP, TIMESTAMP)); + } + + public function fetch_next_endtime() { + return DB::result_first("SELECT endtime FROM %t WHERE available='2' AND endtime>'0' ORDER BY endtime ASC", array($this->_table)); + } + + public function fetch_all_by_status($uid, $status) { + switch($status) { + case 'doing': + $status = "mt.status='0'"; + break; + case 'done': + $status = "mt.status='1'"; + break; + case 'failed': + $status = "mt.status='-1'"; + break; + case 'canapply': + case 'new': + default: + $status = "'".TIMESTAMP."' > starttime AND (endtime=0 OR endtime>'".TIMESTAMP."') AND (mt.taskid IS NULL OR (ABS(mt.status)='1' AND t.period>0))"; + break; + } + return DB::fetch_all("SELECT t.*, mt.csc, mt.dateline FROM %t t + LEFT JOIN %t mt ON mt.taskid=t.taskid AND mt.uid=%d + WHERE %i AND t.available='2' ORDER BY t.displayorder, t.taskid DESC", array($this->_table, 'common_mytask', $uid, $status)); + } + + public function fetch_by_uid($uid, $taskid) { + return DB::fetch_first("SELECT t.*, mt.dateline, mt.dateline AS applytime, mt.status, mt.csc FROM %t t LEFT JOIN %t mt ON mt.uid=%d AND mt.taskid=t.taskid + WHERE t.taskid=%d AND t.available='2'", array($this->_table, 'common_mytask', $uid, $taskid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_taskvar.php b/source/class/table/table_common_taskvar.php new file mode 100644 index 0000000..a8f2f1d --- /dev/null +++ b/source/class/table/table_common_taskvar.php @@ -0,0 +1,53 @@ +_table = 'common_taskvar'; + $this->_pk = 'taskvarid'; + + parent::__construct(); + } + + public function fetch_all_by_taskid($taskid, $variable = '') { + if(!$taskid) { + return; + } + $variable = $variable ? ' AND '.($variable !== 'IS NOT NULL' ? DB::field('variable', $variable) : 'variable IS NOT NULL') : ''; + return DB::fetch_all("SELECT * FROM %t WHERE %i%i", array($this->_table, DB::field('taskid', $taskid), $variable)); + } + + public function get_value_by_taskid($taskid, $variable) { + $result = $this->fetch_all_by_taskid($taskid, $variable); + return $result[0]['value']; + } + + public function update_by_taskid($taskid, $variable, $val) { + if(!$val || !is_array($val)) { + return; + } + return DB::update($this->_table, $val, array('taskid' => $taskid, 'variable' => $variable), 'UNBUFFERED'); + } + + public function delete_by_taskid($taskid) { + if(!$taskid) { + return; + } + return DB::delete($this->_table, DB::field('taskid', $taskid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_template.php b/source/class/table/table_common_template.php new file mode 100644 index 0000000..e3fa7c2 --- /dev/null +++ b/source/class/table/table_common_template.php @@ -0,0 +1,58 @@ +_table = 'common_template'; + $this->_pk = 'templateid'; + + parent::__construct(); + } + + public function fetch_all_data() { + return DB::fetch_all('SELECT * FROM %t', array($this->_table)); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_tpl($val); + } + } + + public function delete_tpl($val) { + if(!$val) { + return; + } + DB::query("DELETE FROM %t WHERE %i AND templateid<>1", array($this->_table, DB::field('templateid', $val))); + } + + public function get_templateid($name) { + return DB::result_first("SELECT templateid FROM %t WHERE name=%s", array($this->_table, $name)); + } + + public function get_templateid_by_directory($directory) { + return DB::result_first("SELECT templateid FROM %t WHERE directory=%s", array($this->_table, $directory)); + } + + public function fetch_by_templateid($templateid) { + return DB::fetch_first("SELECT * FROM %t WHERE templateid=%s", array($this->_table, $templateid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_template_block.php b/source/class/table/table_common_template_block.php new file mode 100644 index 0000000..68acf59 --- /dev/null +++ b/source/class/table/table_common_template_block.php @@ -0,0 +1,70 @@ +_table = 'common_template_block'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete_by_targettplname($tpl, $tpldirectory = NULL) { + $add = $tpldirectory !== NULL ? ' AND '.DB::field('tpldirectory', $tpldirectory) : ''; + return $tpl ? DB::delete($this->_table, DB::field('targettplname', $tpl).$add) : false; + } + + public function fetch_targettplname_by_bid($bid) { + return ($bid = dintval($bid)) ? DB::result_first('SELECT targettplname FROM %t WHERE bid=%d', array($this->_table, $bid)) : ''; + } + + public function fetch_all_bid_by_targettplname_notinherited($tpl, $notinherited) { + $bids = array(); + if($tpl) { + $query = DB::query('SELECT tb.bid FROM %t tb LEFT JOIN %t b ON b.bid=tb.bid WHERE '.DB::field('targettplname', $tpl).' AND b.notinherited=%d', array($this->_table, 'common_block', $notinherited)); + while($value = DB::fetch($query)) { + $bids[$value['bid']] = $value['bid']; + } + } + return $bids; + } + + public function fetch_by_bid($bid) { + return ($bid = dintval($bid)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('bid', $bid)) : array(); + } + + public function fetch_all_by_bid($bids) { + return ($bids = dintval($bids, true)) ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('bid', $bids), null, 'bid') : array(); + } + + public function fetch_all_by_targettplname($targettplname, $tpldirectory = NULL) { + $add = ($tpldirectory !== NULL) ? ' AND '.DB::field('tpldirectory', $tpldirectory) : ''; + return DB::fetch_all('SELECT * FROM %t WHERE targettplname=%s'.$add, array($this->_table, $targettplname), 'bid'); + } + + public function insert_batch($targettplname, $tpldirectory, $bids) { + if($targettplname && ($bids = dintval($bids, true))) { + $values = array(); + foreach ($bids as $bid) { + if($bid) { + $values[] = "('$targettplname','$tpldirectory', '$bid')"; + } + } + DB::query("INSERT INTO ".DB::table($this->_table)." (targettplname, tpldirectory, bid) VALUES ".implode(',', $values)); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_template_permission.php b/source/class/table/table_common_template_permission.php new file mode 100644 index 0000000..9c4f504 --- /dev/null +++ b/source/class/table/table_common_template_permission.php @@ -0,0 +1,92 @@ +_table = 'common_template_permission'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_targettplname($targettplname) { + return DB::fetch_all('SELECT * FROM %t WHERE targettplname=%s ORDER BY inheritedtplname', array($this->_table, $targettplname), 'uid'); + } + + public function fetch_all_by_uid($uids, $flag = true, $sort = 'ASC', $start = 0, $limit = 0) { + $wherearr = array(); + $sort = $sort === 'ASC' ? 'ASC' : 'DESC'; + if(($uids = dintval($uids, true))) { + $wherearr[] = DB::field('uid', $uids); + } + if(!$flag) { + $wherearr[] = 'inheritedtplname = \'\''; + } + $where = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).$where.' ORDER BY uid '.$sort.', inheritedtplname'.DB::limit($start, $limit), NULL, 'targettplname'); + } + + public function count_by_uids($uids, $flag) { + $wherearr = array(); + if(($uids = dintval($uids, true))) { + $wherearr[] = DB::field('uid', $uids); + } + if(!$flag) { + $wherearr[] = 'inheritedtplname = \'\''; + } + $where = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).$where); + } + + public function delete_by_targettplname_uid_inheritedtplname($targettplname = false, $uids = false, $inheritedtplname = false) { + $wherearr = array(); + if($targettplname) { + $wherearr[] = DB::field('targettplname', $targettplname); + } + if(($uids = dintval($uids, true))) { + $wherearr[] = DB::field('uid', $uids); + } + if($inheritedtplname === true) { + $wherearr[] = "inheritedtplname!=''"; + } elseif($inheritedtplname !== false && is_string($inheritedtplname)) { + $wherearr[] = DB::field('inheritedtplname', $inheritedtplname); + } + return $wherearr ? DB::delete($this->_table, implode(' AND ', $wherearr)) : false; + } + + + public function insert_batch($users, $templates, $uptplname = '') { + $blockperms = array(); + if(!empty($users) && !empty($templates)){ + if(!is_array($templates)) { + $templates = array($templates); + } + foreach($users as $user) { + $inheritedtplname = $uptplname ? $uptplname : ''; + foreach ($templates as $tpl) { + if($tpl) { + $blockperms[] = "('$tpl','{$user['uid']}','{$user['allowmanage']}','{$user['allowrecommend']}','{$user['needverify']}','$inheritedtplname')"; + $inheritedtplname = empty($inheritedtplname) ? $tpl : $inheritedtplname; + } + } + } + if($blockperms) { + DB::query('REPLACE INTO '.DB::table($this->_table).' (targettplname,uid,allowmanage,allowrecommend,needverify,inheritedtplname) VALUES '.implode(',', $blockperms)); + } + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_uin_black.php b/source/class/table/table_common_uin_black.php new file mode 100644 index 0000000..f1db1fd --- /dev/null +++ b/source/class/table/table_common_uin_black.php @@ -0,0 +1,40 @@ +_table = 'common_uin_black'; + $this->_pk = 'uin'; + + parent::__construct(); + } + + public function fetch_by_uid($uid) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + public function fetch_all_by_uin($ids = null) { + $parameter = array($this->_table); + $wherearr = array(); + if($ids !== null) { + $parameter[] = $ids; + $wherearr[] = is_array($ids) ? 'uin IN(%n)' : 'uin=%d'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql ", $parameter, $this->_pk, true); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_usergroup.php b/source/class/table/table_common_usergroup.php new file mode 100644 index 0000000..e11eac5 --- /dev/null +++ b/source/class/table/table_common_usergroup.php @@ -0,0 +1,169 @@ +_table = 'common_usergroup'; + $this->_pk = 'groupid'; + + parent::__construct(); + } + + public function fetch_by_credits($credits, $type = 'member') { + if(is_array($credits)) { + $creditsf = intval($credits[0]); + $creditse = intval($credits[1]); + } else { + $creditsf = $creditse = intval($credits); + } + return DB::fetch_first('SELECT grouptitle, groupid FROM %t WHERE '.($type ? DB::field('type', $type).' AND ' : '').'%d>=creditshigher AND %d_table, $creditsf, $creditse)); + } + + public function fetch_all_by_type($type = '', $radminid = null, $allfields = false) { + $parameter = array($this->_table); + $wherearr = array(); + if(!empty($type)) { + $parameter[] = $type; + $wherearr[] = is_array($type) ? 'type IN(%n)' : 'type=%s'; + } + if($radminid !== null) { + $parameter[] = $radminid; + $wherearr[] = 'radminid=%d'; + } + $wheresql = !empty($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all('SELECT '.($allfields ? '*' : 'groupid, grouptitle').' FROM %t '.$wheresql, $parameter, $this->_pk); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + $unbuffered = $unbuffered === false ? '' : $unbuffered; + return $this->update_usergroup($val, $data, $unbuffered); + } + } + + public function update_usergroup($id, $data, $type = '') { + if(!is_array($data) || !$data || !is_array($data) || !$id) { + return null; + } + $condition = DB::field('groupid', $id); + if($type) { + $condition .= ' AND '.DB::field('type', $type); + } + return DB::update($this->_table, $data, $condition); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + $unbuffered = $unbuffered === false ? '' : $unbuffered; + return $this->delete_usergroup($val, $unbuffered); + } + } + + public function delete_usergroup($id, $type = '') { + if(!$id) { + return null; + } + $condition = DB::field('groupid', $id); + if($type) { + $condition .= ' AND '.DB::field('type', $type); + } + return DB::delete($this->_table, $condition); + } + + + public function fetch_all_by_groupid($gid) { + if(!$gid) { + return null; + } + return DB::fetch_all('SELECT groupid FROM %t WHERE groupid IN (%n) AND type=\'special\' AND radminid>0', array($this->_table, $gid), $this->_pk); + } + + public function fetch_all_by_not_groupid($gid) { + return DB::fetch_all('SELECT groupid, type, grouptitle, creditshigher, radminid FROM %t WHERE type=\'member\' AND creditshigher=\'0\' OR (groupid NOT IN (%n) AND radminid<>\'1\' AND type<>\'member\') ORDER BY (creditshigher<>\'0\' || creditslower<>\'0\'), creditslower, groupid', array($this->_table, $gid), $this->_pk); + } + + public function fetch_all_not($gid, $creditnotzero = false) { + return DB::fetch_all('SELECT groupid, radminid, type, grouptitle, creditshigher, creditslower FROM %t WHERE groupid NOT IN (%n) ORDER BY '.($creditnotzero ? "(creditshigher<>'0' || creditslower<>'0'), " : '').'creditshigher, groupid', array($this->_table, $gid), $this->_pk); + } + + public function fetch_new_groupid($fetch = false) { + $sql = 'SELECT groupid, grouptitle FROM '.DB::table($this->_table)." WHERE type='member' AND creditslower>'0' ORDER BY creditslower LIMIT 1"; + if($fetch) { + return DB::fetch_first($sql); + } else { + return DB::result_first($sql); + } + } + + public function fetch_all($ids, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_usergroup($ids); + } + } + + public function fetch_all_usergroup($ids) { + if(!$ids) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('groupid', $ids).' ORDER BY type, radminid, creditshigher', array($this->_table), $this->_pk); + } + + public function fetch_all_switchable($ids) { + if(!$ids) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE (type=\'special\' AND `system`<>\'private\' AND radminid=\'0\') OR groupid IN (%n) ORDER BY type, `system`', array($this->_table, $ids), $this->_pk); + } + + public function range_orderby_credit() { + return DB::fetch_all('SELECT * FROM %t ORDER BY (creditshigher<>\'0\' || creditslower<>\'0\'), creditslower, groupid', array($this->_table), $this->_pk); + } + + public function range_orderby_creditshigher() { + return DB::fetch_all('SELECT * FROM %t ORDER BY creditshigher', array($this->_table), $this->_pk); + } + + public function fetch_all_by_radminid($radminid, $glue = '>', $orderby = 'type'){ + $ordersql = ''; + if($ordersql = DB::order($orderby, 'DESC')) { + $ordersql = ' ORDER BY '.$ordersql; + } + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('radminid', dintval($radminid, true), $glue) . $ordersql), 'groupid'); + } + + public function fetch_table_struct($result = 'FIELD') { + $datas = array(); + $query = DB::query('DESCRIBE %t', array($this->_table)); + while($data = DB::fetch($query)) { + $datas[$data['Field']] = $result == 'FIELD' ? $data['Field'] : $data; + } + return $datas; + } + + public function buyusergroup_exists() { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE type='special' and `system`>0", array($this->_table)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_usergroup_field.php b/source/class/table/table_common_usergroup_field.php new file mode 100644 index 0000000..2e05cb9 --- /dev/null +++ b/source/class/table/table_common_usergroup_field.php @@ -0,0 +1,62 @@ +_table = 'common_usergroup_field'; + $this->_pk = 'groupid'; + + parent::__construct(); + } + + public function fetch_readaccess_by_readaccess($readaccess) { + return DB::fetch_all('SELECT groupid,readaccess FROM %t WHERE readaccess>%d ORDER BY readaccess', array($this->_table, $readaccess), $this->_pk); + } + + public function fetch_all_fields($gid, $fields) { + if(!is_array($fields) || !$fields) { + return null; + } + foreach($fields as &$field) { + $field = DB::quote_field($field); + } + $fieldssql = implode(',', $fields); + return DB::fetch_all('SELECT %i FROM %t %i', array($fieldssql, $this->_table, ($gid ? 'WHERE '.DB::field('groupid', $gid) : '')), $this->_pk); + } + + public function count_by_field($field, $val, $glue = '=') { + $allowedfield = array('allowposttrade'); + if(!in_array($field, $allowedfield)) { + return null; + } + return DB::result_first('SELECT count(*) FROM %t WHERE %i', array($this->_table, DB::field($field, $val, $glue))); + } + + public function fetch_table_struct($result = 'FIELD') { + $datas = array(); + $query = DB::query('DESCRIBE %t', array($this->_table)); + while($data = DB::fetch($query)) { + $datas[$data['Field']] = $result == 'FIELD' ? $data['Field'] : $data; + } + return $datas; + } + + public function update_allowsearch() { + return DB::query('UPDATE %t SET allowsearch = allowsearch | 2 WHERE groupid < 20 AND groupid NOT IN (5, 6)', array($this->_table)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_visit.php b/source/class/table/table_common_visit.php new file mode 100644 index 0000000..cdb58cb --- /dev/null +++ b/source/class/table/table_common_visit.php @@ -0,0 +1,114 @@ +_table = 'common_visit'; + $this->_pk = 'ip'; + + $this->_pre_cache_key = 'common_visit_'; + $this->_cache_ttl = -1; + + parent::__construct(); + $this->_allowmem = $this->_allowmem && C::memory()->gotsortedset; + } + + public function inc($ip, $viewadd = 1) { + if (!$this->_allowmem) { + return DB::query('UPDATE %t SET view=view+(%d) WHERE `ip`=%s', array($this->_table, $viewadd, $ip)); + } + return memory('zincrby', 'idx_ip_view', $ip, $viewadd, $this->_pre_cache_key); + } + + public function range($start = 0, $limit = 0, $sort = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::range($start, $limit, $sort); + } else { + return $this->range_visit($start, $limit); + } + } + + public function range_visit($start = 0, $limit = 0) { + if (!$this->_allowmem) { + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' ORDER BY view DESC'.DB::limit($start, $limit), $this->_pk); + } + list($ss, $ee) = $this->get_start_and_end($start, $limit); + $rs = memory('zrevrangewithscore', 'idx_ip_view', $ss, $ee, $this->_pre_cache_key); + $result = array(); + foreach ($rs as $ip => $view) { + $result[] = array( + 'ip' => $ip, + 'view' => $view + ); + } + return $result; + } + + public function delete($val, $unbuffered = false) { + if (!$this->_allowmem) { + return parent::delete($val, $unbuffered); + } + if (!is_array($val)) $val = array($val); + foreach ($val as $ip) { + memory('zrem', 'idx_ip_view', $ip, 0, $this->_pre_cache_key); + } + return TRUE; + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (!$this->_allowmem) { + return parent::insert($data, $return_insert_id, $replace, $silent); + } + return memory('zadd', 'idx_ip_view', $data['ip'], $data['view'], $this->_pre_cache_key); + } + + public function fetch($id, $force_from_db = false) { + if (!$this->_allowmem) { + return parent::fetch($id, $force_from_db); + } + $rs = memory('zscore', 'idx_ip_view', $id, 0, $this->_pre_cache_key); + if ($rs) { + return array( + 'ip' => $id, + 'view' => $rs + ); + } + return FALSE; + } + + public function count() { + if (!$this->_allowmem) { + return parent::count(); + } + return memory('zcard', 'idx_ip_view', $this->_pre_cache_key); + } + + private function get_start_and_end($start, $limit) { + $limit = intval($limit > 0 ? $limit : 0); + $start = intval($start > 0 ? $start : 0); + if ($start > 0 && $limit > 0) { + return array($start, $start + $limit - 1); + } elseif ($limit > 0) { + return array(0, $limit - 1); + } elseif ($start > 0) { + return array(0, $start - 1); + } else { + return array(0, -1); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_word.php b/source/class/table/table_common_word.php new file mode 100644 index 0000000..7913e12 --- /dev/null +++ b/source/class/table/table_common_word.php @@ -0,0 +1,91 @@ +_table = 'common_word'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_by_find($find) { + return DB::fetch_first("SELECT * FROM %t WHERE find=%s", array($this->_table, $find)); + } + public function fetch_all_order_type_find() { + return DB::fetch_all('SELECT * FROM %t ORDER BY type ASC, find ASC', array($this->_table), $this->_pk); + } + + public function fetch_all($ids = array(), $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_word(); + } + } + + public function fetch_all_word() { + return DB::fetch_all('SELECT * FROM %t', array($this->_table), $this->_pk); + } + + public function fetch_all_by_type_find($type = null, $find = null , $start = 0, $limit = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($type !== null) { + $parameter[] = $type; + $wherearr[] = "`type`=%d"; + } + if($find !== null) { + $parameter[] = '%'.addslashes(stripsearchkey($find)).'%'; + $wherearr[] = "`find` LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY find ASC".DB::limit($start, $limit), $parameter); + } + + + public function update_by_type($types, $data) { + if(!empty($types) && !empty($data) && is_array($data)) { + $types = array_map('intval', (array)$types); + return DB::update($this->_table, $data, "type IN (".dimplode($types).")"); + } + return 0; + } + public function update_by_find($find, $data) { + if(!empty($find) && !empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('find', $find)); + } + return 0; + } + + public function count_by_type_find($type = null, $find = null) { + $parameter = array($this->_table); + $wherearr = array(); + if($type !== null) { + $parameter[] = $type; + $wherearr[] = "`type`=%d"; + } + if($find !== null) { + $parameter[] = '%'.addslashes(stripsearchkey($find)).'%'; + $wherearr[] = "`find` LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first("SELECT COUNT(*) FROM %t $wheresql", $parameter); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_common_word_type.php b/source/class/table/table_common_word_type.php new file mode 100644 index 0000000..f9890cd --- /dev/null +++ b/source/class/table/table_common_word_type.php @@ -0,0 +1,46 @@ +_table = 'common_word_type'; + $this->_pk = 'id'; + + parent::__construct(); + } + public function fetch_by_typename($typename) { + $data = array(); + if(!empty($typename)) { + $data = DB::fetch_first('SELECT * FROM %t WHERE typename=%s', array($this->_table, $typename), $this->_pk); + } + return $data; + } + + public function fetch_all($ids = array(), $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_word_type(); + } + } + + public function fetch_all_word_type() { + return DB::fetch_all('SELECT * FROM %t', array($this->_table), $this->_pk); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_access.php b/source/class/table/table_forum_access.php new file mode 100644 index 0000000..e4a7020 --- /dev/null +++ b/source/class/table/table_forum_access.php @@ -0,0 +1,71 @@ +_table = 'forum_access'; + $this->_pk = ''; + + parent::__construct(); + } + + + public function fetch_all_by_fid_uid($fid = 0, $uid = 0, $count = 0, $start = 0, $limit = 0) { + $uid = intval($uid); + $sql = $uid ? ' uid='.$uid : ''; + $sql .= $fid ? ($sql ? ' AND ' : '').DB::field('fid', $fid) : ''; + if(empty($sql)) { + return false; + } + if($count) { + return DB::result_first('SELECT count(*) FROM %t WHERE '.$sql, array($this->_table)); + } + if($limit) { + $sql .= " LIMIT $start, $limit"; + } + return DB::fetch_all('SELECT * FROM %t WHERE '.$sql, array($this->_table)); + } + + public function fetch_all_by_uid($uid) { + $data = array(); + if($uid) { + $data = DB::fetch_all('SELECT * FROM %t WHERE uid=%d', array($this->_table, $uid), 'fid'); + } + return $data; + } + + public function count_by_uid($uid) { + return $uid ? DB::result_first('SELECT count(*) FROM %t WHERE uid=%d', array($this->_table, $uid)) : 0; + } + + public function delete_by_fid($fid, $uid = 0) { + $uid = intval($uid); + $uidsql = $uid ? ' uid='.$uid.' AND ' : ''; + DB::query("DELETE FROM %t WHERE $uidsql fid=%d", array($this->_table, $fid)); + } + + public function update_for_uid($uid, $fid, $data) { + if(empty($uid) || empty($fid) || empty($data) || !is_array($data)) { + return false; + } + DB::update($this->_table, $data, DB::field('uid', $uid).' AND '.DB::field('fid', $fid)); + } + + public function delete_by_uid($uid) { + return $uid ? DB::delete($this->_table, DB::field('uid', $uid)) : false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_activity.php b/source/class/table/table_forum_activity.php new file mode 100644 index 0000000..de26c9f --- /dev/null +++ b/source/class/table/table_forum_activity.php @@ -0,0 +1,72 @@ +_table = 'forum_activity'; + $this->_pk = 'tid'; + + parent::__construct(); + } + + public function fetch_all_for_search($view, $order, $searchkey, $type, $frienduid, $spaceuid, $minhot, $count = 0, $start = 0, $limit = 0) { + $today = strtotime(dgmdate(TIMESTAMP, 'Y-m-d')); + $wheresql = '1'; + $threadsql = $ordersql = $apply_sql = ''; + if($view == 'all') { + if($order == 'hot') { + $threadsql .= " t.special='4' AND t.replies>='$minhot'"; + $apply_sql = "INNER JOIN ".DB::table('forum_thread')." t ON t.special='4' AND t.tid = a.tid AND t.replies>='$minhot' AND t.displayorder>'-1'"; + } + } elseif($view == 'me') { + $type = in_array($type, array('orig', 'apply')) ? $type : 'orig'; + if($type == 'apply') { + $wheresql = "1"; + $apply_sql = "INNER JOIN ".DB::table('forum_activityapply')." apply ON apply.uid = '$spaceuid' AND apply.tid = a.tid"; + } else { + $wheresql = "a.uid = '$spaceuid'"; + } + $ordersql = 'DESC'; + } else { + if($frienduid) { + $wheresql = "a.".DB::field('uid', $frienduid); + } + $ordersql = 'DESC'; + } + if($view != 'all') { + } elseif(empty($order)) { + $ordersql = 'DESC'; + } + if($searchkey) { + $threadsql .= " AND t.subject LIKE ".DB::quote('%'.addslashes($searchkey).'%'); + } + if($count) { + return DB::result(DB::query("SELECT COUNT(*) FROM ".DB::table('forum_activity')." a $apply_sql WHERE $wheresql"),0); + } + if($view == 'all' && $order == 'hot') { + $apply_sql = ''; + } + $threadsql = empty($threadsql) ? '' : $threadsql.' AND '; + return DB::fetch_all("SELECT a.*, t.* FROM ".DB::table('forum_activity')." a $apply_sql + INNER JOIN ".DB::table('forum_thread')." t ON $threadsql t.tid=a.tid + WHERE t.displayorder>'-1' AND $wheresql + ORDER BY a.starttimefrom $ordersql ".DB::limit($start, $limit)); + } + public function delete_by_tid($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_activityapply.php b/source/class/table/table_forum_activityapply.php new file mode 100644 index 0000000..08861f1 --- /dev/null +++ b/source/class/table/table_forum_activityapply.php @@ -0,0 +1,53 @@ +_table = 'forum_activityapply'; + $this->_pk = 'applyid'; + + parent::__construct(); + } + public function fetch_info_for_user($uid, $tid) { + return DB::fetch_first("SELECT * FROM %t WHERE tid=%d AND uid=%d", array($this->_table, $tid, $uid)); + } + public function delete_for_user($uid, $tid) { + DB::query("DELETE FROM %t WHERE tid=%d AND uid=%d", array($this->_table, $tid, $uid)); + } + public function delete_by_tid($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } + public function delete_for_thread($tid, $applyids = array()) { + if($applyids) { + $pksql = " AND ".DB::field('applyid', $applyids); + } + DB::query("DELETE FROM %t WHERE tid=%d $pksql", array($this->_table, $tid)); + } + public function fetch_count_for_thread($tid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE tid=%d AND verified='1'", array($this->_table, $tid)); + } + public function fetch_all_for_thread($tid, $start = 0, $limit = 100, $uid = 0, $master = 0) { + $verifiedsql = empty($master) ? ' AND verified=1' : ''; + if(intval($uid)) { + $verifiedsql .= ' AND uid='.intval($uid); + } + return DB::fetch_all("SELECT * FROM %t WHERE tid=%d $verifiedsql ORDER BY dateline DESC".DB::limit($start, $limit), array($this->_table, $tid)); + } + public function update_verified_for_thread($verified, $tid, $applyid) { + DB::query("UPDATE %t SET verified=%d WHERE tid=%d AND applyid IN (%n)", array($this->_table, $verified, $tid, $applyid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_announcement.php b/source/class/table/table_forum_announcement.php new file mode 100644 index 0000000..133d7d8 --- /dev/null +++ b/source/class/table/table_forum_announcement.php @@ -0,0 +1,75 @@ +_table = 'forum_announcement'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all_by_date($timestamp, $type = 2) { + return DB::fetch_all('SELECT * FROM %t WHERE type!=%d AND starttime<=%d AND (endtime=0 OR endtime>%d) ORDER BY displayorder, starttime DESC, id DESC', array($this->_table, $type, $timestamp, $timestamp), $this->_pk); + } + + public function fetch_all_by_displayorder() { + return DB::fetch_all('SELECT * FROM %t ORDER BY displayorder, starttime DESC, id DESC', array($this->_table), $this->_pk); + } + + public function fetch_by_displayorder($timestamp) { + return DB::fetch_first('SELECT * FROM %t WHERE type!=2 AND `groups` = \'\' AND starttime<=%d AND (endtime>=%d OR endtime=0) ORDER BY displayorder, starttime DESC, id DESC LIMIT 1', array($this->_table, $timestamp, $timestamp)); + } + + public function fetch_all_by_time($time, $type, $bannedids, $startrow, $items) { + $type = dintval($type, true); + $sql = ' AND '.DB::field('type', $type); + if($bannedids) { + $bannedids = dintval($bannedids, true); + $sql .= ' AND '.DB::field('id', $bannedids, 'notin'); + } + return DB::fetch_all('SELECT * FROM %t WHERE starttime <= %d AND (endtime = \'\' || endtime >= %d) %i ORDER BY displayorder DESC LIMIT %d, %d', array($this->_table, $time, $time, $sql, $startrow, $items), $this->_pk); + } + + public function fetch_by_id_username($id, $username, $adminid = 1) { + return DB::fetch_first('SELECT * FROM %t WHERE id=%d AND (%d=1 OR author=%s)', array($this->_table, $id, $adminid, $username)); + } + + public function delete_by_id_username($ids, $username, $adminid = 1) { + if(($ids = dintval((array)$ids, true))) { + DB::query('DELETE FROM %t WHERE id IN(%n) AND (%d=1 OR author=%s)', array($this->_table, $ids, $adminid, $username), false, true); + } + } + + public function update_displayorder_by_id_username($id, $displayorder, $username, $adminid = 1) { + if(($id = dintval((array)$id, true))) { + DB::query('UPDATE %t SET displayorder=%d WHERE id IN(%n) AND (%d=1 OR author=%s)', array($this->_table, $displayorder, $id, $adminid, $username), false, true); + } + } + + public function update_by_id_username($id, $data, $username, $adminid = 1) { + if(($id = dintval($id, true)) && $data && is_array($data)) { + $adminid = dintval($adminid); + DB::update($this->_table, $data, DB::field($this->_pk, $id)." AND ('{$adminid}'=1 OR ".DB::field('author', $username).')', true); + } + } + + public function delete_all_by_endtime($timestamp) { + DB::query("DELETE FROM %t WHERE endtime<%d AND endtime<>'0'", array($this->_table, $timestamp)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_attachment.php b/source/class/table/table_forum_attachment.php new file mode 100644 index 0000000..2f020c7 --- /dev/null +++ b/source/class/table/table_forum_attachment.php @@ -0,0 +1,138 @@ +_table = 'forum_attachment'; + $this->_pk = 'aid'; + $this->_pre_cache_key = 'forum_attachment_'; + $this->_cache_ttl = 0; + + parent::__construct(); + } + + public function update_download($aid, $count = 1) { + $this->clear_cache($aid); + return DB::query("UPDATE %t SET downloads=downloads+%d WHERE aid IN (%n)", array($this->_table, $count, (array)$aid), false, true); + } + + public function fetch_all_by_id($idtype, $ids, $orderby = '') { + $attachments = array(); + if($orderby) { + $orderby = 'ORDER BY '.DB::order($orderby, 'DESC'); + } + if(in_array($idtype, array('aid', 'tid', 'pid', 'uid')) && $ids) { + $query = DB::query("SELECT * FROM %t WHERE %i IN (%n) %i", array($this->_table, $idtype, (array)$ids, $orderby)); + while($value = DB::fetch($query)) { + $attachments[$value['aid']] = $value; + $this->_tableids[$value['tableid']][] = $value['aid']; + } + } + return $attachments; + } + + public function delete_by_id($idtype, $ids) { + if(in_array($idtype, array('aid', 'tid', 'pid', 'uid')) && $ids) { + DB::query('DELETE FROM %t WHERE %i IN (%n)', array($this->_table, $idtype, (array)$ids), false, true); + } + } + + public function update_by_id($idtype, $ids, $newtid) { + if(in_array($idtype, array('tid', 'pid')) && $ids) { + DB::query("UPDATE %t SET tid=%d,tableid=%d WHERE %i IN (%n)", array($this->_table, $newtid, getattachtableid($newtid), $idtype, (array)$ids), false, true); + } + } + + public function count_by_tid($tid) { + return $tid ? DB::result_first("SELECT COUNT(*) FROM %t WHERE tid=%d", array($this->_table, $tid)) : 0; + } + + public function fetch_by_aid_uid($aid, $uid) { + $query = DB::query("SELECT * FROM %t WHERE aid=%d AND uid=%d", array($this->_table, $aid, $uid)); + return DB::fetch($query); + } + + public function fetch_all_unused_attachment($uid, $aids = null, $posttime = null) { + $parameter = array($this->_table); + $wherearr = array(); + if($aids !== null) { + $parameter[] = $aids; + $wherearr[] = is_array($aids) ? 'a.aid IN(%n)' : 'a.aid=%d'; + } + $parameter[] = $uid; + $wherearr[] = 'af.uid=%d'; + $wherearr[] = 'a.tid=0'; + + if($posttime !== null) { + $parameter[] = $posttime; + $wherearr[] = "af.dateline>%d"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT a.*, af.* FROM %t a INNER JOIN ".DB::table('forum_attachment_unused')." af USING(aid) $wheresql ORDER BY a.aid DESC", $parameter); + } + + public function get_tableids() { + return $this->_tableids; + } + + public function fetch_all_for_manage($tableid, $inforum = '', $authorid = 0, $filename = '', $keyword = '', $sizeless = 0, $sizemore = 0, $dlcountless = 0, $dlcountmore = 0, $daysold = 0, $count = 0, $start = 0, $limit = 0) { + $sql = "1"; + if(!is_numeric($tableid) || $tableid < 0 || $tableid > 9) { + return; + } + if($inforum) { + $sql .= is_numeric($inforum) ? " AND t.fid=".DB::quote($inforum) : ''; + $sql .= $inforum == 'isgroup' ? ' AND t.isgroup=\'1\'' : ' AND t.isgroup=\'0\''; + } + if($authorid) { + $sql .= " AND a.uid=".DB::quote($authorid); + } + if($filename) { + $sql .= " AND a.filename LIKE ".DB::quote('%'.$filename.'%'); + } + if($keyword) { + $sqlkeywords = $or = ''; + foreach(explode(',', str_replace(' ', '', $keyword)) as $keyword) { + $sqlkeywords .= " $or a.description LIKE ".DB::quote('%'.$keyword.'%'); + $or = 'OR'; + } + $sql .= " AND ($sqlkeywords)"; + } + $sql .= $sizeless ? " AND a.filesize>'$sizeless'" : ''; + $sql .= $sizemore ? " AND a.filesize<'$sizemore' " : ''; + $sql .= $dlcountless ? " AND ai.downloads>'$dlcountless'" : ''; + $sql .= $dlcountmore ? " AND ai.downloads<'$dlcountmore'" : ''; + $sql .= $daysold ? " AND a.dateline<'".(TIMESTAMP - intval($daysold) * 86400)."'" : ''; + if($count) { + return DB::result_first("SELECT COUNT(*) + FROM ". DB::table('forum_attachment_'.$tableid)." a + INNER JOIN ".DB::table('forum_attachment')." ai USING(aid) + INNER JOIN ".DB::table('forum_thread')." t + INNER JOIN ".DB::table('forum_forum')." f + WHERE t.tid=a.tid AND f.fid=t.fid AND t.displayorder>='0' AND $sql"); + } + return DB::fetch_all("SELECT a.*, ai.downloads, t.fid, t.tid, t.subject, f.name AS fname + FROM ". DB::table('forum_attachment_'.$tableid)." a + INNER JOIN ".DB::table('forum_attachment')." ai USING(aid) + INNER JOIN ".DB::table('forum_thread')." t + INNER JOIN ".DB::table('forum_forum')." f + WHERE t.tid=a.tid AND f.fid=t.fid AND t.displayorder>='0' AND $sql ORDER BY a.aid DESC ".DB::limit($start, $limit)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_attachment_exif.php b/source/class/table/table_forum_attachment_exif.php new file mode 100644 index 0000000..037f6ab --- /dev/null +++ b/source/class/table/table_forum_attachment_exif.php @@ -0,0 +1,40 @@ +_table = 'forum_attachment_exif'; + $this->_pk = 'aid'; + + parent::__construct(); + } + + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + return $this->insert_exif($data, $return_insert_id); + } + } + + public function insert_exif($aid, $exif) { + DB::insert($this->_table, array('aid' => $aid, 'exif' => $exif), false, true, true); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_attachment_n.php b/source/class/table/table_forum_attachment_n.php new file mode 100644 index 0000000..bd101a6 --- /dev/null +++ b/source/class/table/table_forum_attachment_n.php @@ -0,0 +1,189 @@ +_table = ''; + $this->_pk = 'aid'; + + parent::__construct(); + } + + private function _get_table($tableid) { + if(!is_numeric($tableid)) { + list($idtype, $id) = explode(':', $tableid); + if($idtype == 'aid') { + $aid = dintval($id); + $tableid = DB::result_first("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE aid='$aid'"); + } elseif($idtype == 'tid') { + $tid = (string)$id; + $tableid = dintval($tid[strlen($tid)-1]); + } elseif($idtype == 'pid') { + $pid = dintval($id); + $tableid = DB::result_first("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE pid='$pid' LIMIT 1"); + $tableid = $tableid >= 0 && $tableid < 10 ? intval($tableid) : 127; + } + } + if($tableid >= 0 && $tableid < 10) { + return 'forum_attachment_'.intval($tableid); + } elseif($tableid == 127) { + return 'forum_attachment_unused'; + } else { + throw new DbException('Table forum_attachment_'.$this->_table.' has not exists'); + } + } + + private function _check_id($idtype, $ids) { + if($idtype == 'pid' && $this->_table == 'forum_attachment_unused') { + return false; + } + if(in_array($idtype, array('aid', 'tid', 'pid', 'uid')) && !empty($ids)) { + return true; + } else { + return false; + } + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->delete_attachment($val, $unbuffered); + } + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->update_attachment($val, $data, $unbuffered); + } + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->insert_attachment($data, $return_insert_id, $replace, $silent, $null); + } + } + + public function fetch($id, $force_from_db = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->fetch_attachment($id, $force_from_db, $null); + } + } + + public function fetch_all($ids, $force_from_db = false, $null1 = false , $null2 = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->fetch_all_attachment($ids, $force_from_db, $null1, $null2); + } + } + + public function delete_attachment($tableid, $val){ + return DB::delete($this->_get_table($tableid), DB::field($this->_pk, $val)); + } + + public function delete_by_id($tableid, $idtype, $id){ + return $this->_check_id($idtype, $id) ? DB::delete($this->_get_table($tableid), DB::field($idtype, $id)) : false; + } + + public function update_attachment($tableid, $val, $data) { + if(!$data) { + return; + } + return DB::update($this->_get_table($tableid), $data, DB::field($this->_pk, $val)); + } + + public function insert_attachment($tableid, $data, $return_insert_id = false, $replace = false, $silent = false) { + if(!$data) { + return; + } + return DB::insert($this->_get_table($tableid), $data, $return_insert_id, $replace, $silent); + } + + public function fetch_attachment($tableid, $aid, $isimage = false){ + $isimage = $isimage === false ? '' : ' AND '.DB::field('isimage', $isimage); + return !empty($aid) ? DB::fetch_first('SELECT * FROM %t WHERE %i %i', array($this->_get_table($tableid), DB::field($this->_pk, $aid), $isimage)) : array(); + } + + public function fetch_max_image($tableid, $idtype, $id){ + return $this->_check_id($idtype, $id) ? DB::fetch_first('SELECT * FROM %t WHERE %i AND isimage IN (1, -1) ORDER BY width DESC LIMIT 1', array($this->_get_table($tableid), DB::field($idtype, $id))) : array(); + } + + public function count_by_id($tableid, $idtype, $id){ + return $this->_check_id($idtype, $id) ? DB::result_first('SELECT COUNT(*) FROM %t WHERE %i', array($this->_get_table($tableid), DB::field($idtype, $id))) : 0; + } + + public function count_image_by_id($tableid, $idtype, $id){ + return $this->_check_id($idtype, $id) ? DB::result_first('SELECT COUNT(*) FROM %t WHERE %i AND isimage IN (1, -1)', array($this->_get_table($tableid), DB::field($idtype, $id))) : 0; + } + + public function fetch_all_attachment($tableid, $aids, $remote = false, $isimage = false){ + $remote = $remote === false ? '' : ' AND '.DB::field('remote', $remote); + $isimage = $isimage === false ? '' : ' AND '.DB::field('isimage', $isimage); + return !empty($aids) ? DB::fetch_all('SELECT * FROM %t WHERE %i %i %i', array($this->_get_table($tableid), DB::field($this->_pk, $aids), $remote, $isimage)) : array(); + } + + public function fetch_all_by_id($tableid, $idtype, $ids, $orderby = '', $isimage = false, $isprice = false, $remote = false, $limit = false) { + if($this->_check_id($idtype, $ids)) { + $attachments = array(); + if($orderby) { + $orderby = 'ORDER BY '.$orderby; + } + $isimage = $isimage === false ? '' : ' AND '.DB::field('isimage', $isimage); + $isprice = $isprice === false ? '' : ' AND '.DB::field('price', 0, '>'); + $remote = $remote === false ? '' : ' AND '.DB::field('remote', $remote); + $limit = $limit < 1 ? '' : DB::limit(0, $limit); + $query = DB::query("SELECT * FROM %t WHERE %i %i %i %i %i %i", array($this->_get_table($tableid), DB::field($idtype, $ids), $isimage, $isprice, $remote, $orderby, $limit)); + while($value = DB::fetch($query)) { + $attachments[$value['aid']] = $value; + } + return $attachments; + } else { + return array(); + } + } + + public function reset_picid($tableid, $newids) { + if($newids) { + DB::query("UPDATE %t SET picid='0' WHERE picid IN (%n)", array($this->_get_table($tableid), (array)$newids), false, true); + } + } + + public function fetch_by_aid_uid($tableid, $aid, $uid) { + $query = DB::query("SELECT * FROM %t WHERE aid=%d AND uid=%d", array($this->_get_table($tableid), $aid, $uid)); + return DB::fetch($query); + } + + public function fetch_all_by_pid_width($tableid, $pids, $width) { + return DB::fetch_all("SELECT * FROM %t WHERE %i AND isimage IN ('1', '-1') AND width>=%d", array($this->_get_table($tableid), DB::field('pid', $pids), $width)); + } + + public function get_total_filesize() { + $attachsize = 0; + for($i = 0;$i < 10;$i++) { + $attachsize += DB::result_first("SELECT SUM(filesize) FROM ".DB::table('forum_attachment_'.$i)); + } + return $attachsize; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_attachment_unused.php b/source/class/table/table_forum_attachment_unused.php new file mode 100644 index 0000000..a246561 --- /dev/null +++ b/source/class/table/table_forum_attachment_unused.php @@ -0,0 +1,40 @@ +_table = 'forum_attachment_unused'; + $this->_pk = 'aid'; + + parent::__construct(); + } + + public function clear() { + require_once libfile('function/forum'); + $delaids = array(); + $query = DB::query("SELECT aid, attachment, thumb FROM %t WHERE %i", array($this->_table, DB::field('dateline', TIMESTAMP - 86400))); + while($attach = DB::fetch($query)) { + dunlink($attach); + $delaids[] = $attach['aid']; + } + if($delaids) { + DB::query("DELETE FROM %t WHERE %i", array('forum_attachment', DB::field('aid', $delaids)), false, true); + DB::query("DELETE FROM %t WHERE %i", array($this->_table, DB::field('dateline', TIMESTAMP - 86400)), false, true); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_attachtype.php b/source/class/table/table_forum_attachtype.php new file mode 100644 index 0000000..1f0ff1d --- /dev/null +++ b/source/class/table/table_forum_attachtype.php @@ -0,0 +1,56 @@ +_table = 'forum_attachtype'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all_data() { + return DB::fetch_all('SELECT * FROM %t', array($this->_table), $this->_pk); + } + + public function fetch_all_by_fid($fid) { + return DB::fetch_all('SELECT * FROM %t WHERE fid=%d', array($this->_table, $fid), $this->_pk); + } + + public function delete_by_id_fid($id, $fid) { + $id = dintval($id, is_array($id) ? true : false); + $fid = dintval($fid, is_array($fid) ? true : false); + if(is_array($id) && empty($id) || is_array($fid) && empty($fid)) { + return 0; + } + return DB::delete($this->_table, DB::field('id', $id).' AND '.DB::field('fid', $fid)); + } + + public function count_by_extension_fid($extension, $fid = null) { + $parameter = array($this->_table); + $wherearr = array(); + if($fid !== null) { + $wherearr[] = 'fid=%d'; + $parameter[] = $fid; + } + $parameter[] = $extension; + $wherearr[] = 'extension=%s'; + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first('SELECT COUNT(*) FROM %t'.$wheresql, $parameter); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_bbcode.php b/source/class/table/table_forum_bbcode.php new file mode 100644 index 0000000..e592055 --- /dev/null +++ b/source/class/table/table_forum_bbcode.php @@ -0,0 +1,39 @@ +_table = 'forum_bbcode'; + $this->_pk = 'id'; + + parent::__construct(); + } + public function fetch_all_by_available_icon($available = null, $haveicon = false, $glue = '=', $order = 'displayorder', $sort = 'ASC') { + $parameter = array($this->_table); + if($available !== null) { + $parameter[] = $available; + $glue = helper_util::check_glue($glue); + $wherearr[] = "available{$glue}%d"; + } + if($haveicon) { + $wherearr[] = "icon!=''"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + $ordersql = !empty($order) ? ' ORDER BY '.DB::order($order, $sort) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql $ordersql", $parameter, $this->_pk); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_collection.php b/source/class/table/table_forum_collection.php new file mode 100644 index 0000000..4fba6ff --- /dev/null +++ b/source/class/table/table_forum_collection.php @@ -0,0 +1,176 @@ +_table = 'forum_collection'; + $this->_pk = 'ctid'; + $this->_pre_cache_key = 'forum_collection_'; + + parent::__construct(); + } + + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid), $this->_pk); + } + + public function fetch_all_by_uid($uid, $start = 0, $limit = 0, $exceptctid = null) { + if($exceptctid) { + $sql = ' AND ctid!='.intval($exceptctid); + } else { + $sql = ''; + } + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d %i'.DB::limit($start, $limit), array($this->_table, $uid, $sql), $this->_pk); + } + + public function range($start = 0, $limit = 0, $sort = '', $null = true) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::range($start, $limit, $sort); + } else { + $sort = $sort === '' ? 0 : $sort; + return $this->range_collection($start, $limit, $sort, $null); + } + } + + public function range_collection($start = 0, $limit = 0, $reqthread = 0, $pK = true) { + return DB::fetch_all('SELECT * FROM %t WHERE threadnum>=%d ORDER BY lastupdate DESC '.DB::limit($start, $limit), array($this->_table, $reqthread), $pK ? $this->_pk : ''); + } + + public function fetch_all($ctid = '', $orderby = '', $ordersc = '', $start = 0, $limit = 0, $title = '', $cachetid = '') { + if($this->_allowmem && $cachetid) { + $data = $this->fetch_cache($cachetid, $this->_pre_cache_key.'tid_'); + if($data) { + return $data; + } + } + $sql = ''; + if($ctid) { + $sql .= 'WHERE '.DB::field('ctid', $ctid); + } + if($title && str_replace('%', '', $title)) { + $sql .= ($sql ? ' AND ' : 'WHERE ').DB::field('name', '%'.$title.'%', 'like'); + } + $sql .= ($orderby = DB::order($orderby, $ordersc)) ? ' ORDER BY '.$orderby : ''; + $sql .= ' '.DB::limit($start, $limit); + if(!$sql) { + return null; + } + $data = DB::fetch_all('SELECT * FROM %t %i', array($this->_table, $sql), $this->_pk); + if($this->_allowmem && $cachetid) { + $this->store_cache($cachetid, $data, $this->_cache_ttl, $this->_pre_cache_key.'tid_'); + } + return $data; + } + + public function count_by_title($title) { + if(!$title || !str_replace('%', '', $title)) { + return null; + } + $sql = DB::field('name', '%'.$title.'%', 'like'); + return DB::result_first('SELECT count(*) FROM %t WHERE %i', array($this->_table, $sql)); + } + + public function count_all_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + + public function update_by_ctid($ctid, $incthreadnum = 0, $incfollownum = 0, $inccommentnum = 0, $lastupdate = 0, $incratenum = 0, $totalratenum = 0, $lastpost = array()) { + if(!$ctid) { + return false; + } + $sql = array(); + $para = array($this->_table); + if($incthreadnum) { + $sql[] = 'threadnum=threadnum+\'%d\''; + $para[] = $incthreadnum; + } + if($incfollownum) { + $sql[] = 'follownum=follownum+\'%d\''; + $para[] = $incfollownum; + } + if($inccommentnum) { + $sql[] = 'commentnum=commentnum+\'%d\''; + $para[] = $inccommentnum; + } + if($lastupdate != 0) { + $sql[] = 'lastupdate=%d'; + $para[] = $lastupdate; + } + if($incratenum > 0) { + if($totalratenum > 0) { + $sql[] = 'rate=((rate*ratenum)+\'%d\')/(ratenum+1),ratenum=ratenum+1'; + } else { + $sql[] = 'ratenum=ratenum+1,rate=%d'; + } + $para[] = $incratenum; + } + if(is_array($lastpost) && count($lastpost) == 4) { + $sql[] = 'lastpost=%d,lastsubject=%s,lastposttime=%d,lastposter=%s'; + $para = array_merge($para, array($lastpost['lastpost'], $lastpost['lastsubject'], $lastpost['lastposttime'], $lastpost['lastposter'])); + } + if(!count($sql)) { + return null; + } + + $sqlupdate = implode(',', $sql); + + $result = DB::query('UPDATE %t SET '.$sqlupdate.' WHERE '.DB::field($this->_pk, $ctid), $para, false, true); + return $result; + } + + public function fetch_all_for_search($name, $ctid, $username, $uid, $start = 0, $limit = 20) { + + $where = '1'; + $where .= $name ? ' AND '.DB::field('name', '%'.stripsearchkey($name).'%', 'like') : ''; + $where .= $ctid ? ' AND '.DB::field('ctid', $ctid) : ''; + $where .= $username ? ' AND '.DB::field('username', '%'.stripsearchkey($username).'%', 'like') : ''; + $where .= $uid ? ' AND '.DB::field('uid', $uid) : ''; + + if($start == -1) { + return DB::result_first("SELECT count(*) FROM %t WHERE %i", array($this->_table, $where)); + } + return DB::fetch_all("SELECT * FROM %t WHERE %i ORDER BY dateline DESC %i", array($this->_table, $where, DB::limit($start, $limit))); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if(!empty($data) && is_array($data) && $val) { + $this->checkpk(); + return DB::update($this->_table, $data, DB::field($this->_pk, $val), $unbuffered, $low_priority); + } + return !$unbuffered ? 0 : false; + } + + public function fetch_ctid_by_searchkey($searchkey, $limit) { + return DB::fetch_all('SELECT ctid FROM %t WHERE 1 %i ORDER BY ctid DESC %i', array($this->_table, $searchkey, DB::limit(0, $limit))); + } + + public function delete($val, $unbuffered = false) { + if(!$val) { + return false; + } + $this->checkpk(); + $ret = DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered); + return $ret; + } + + public function fetch($id, $force_from_db = true){ + return parent::fetch($id, true); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_collectioncomment.php b/source/class/table/table_forum_collectioncomment.php new file mode 100644 index 0000000..21e9e93 --- /dev/null +++ b/source/class/table/table_forum_collectioncomment.php @@ -0,0 +1,83 @@ +_table = 'forum_collectioncomment'; + $this->_pk = 'cid'; + + parent::__construct(); + } + + public function delete_by_ctid($ctid) { + if(!$ctid) { + return false; + } + return DB::delete($this->_table, DB::field('ctid', $ctid)); + } + + public function delete_by_cid_ctid($cids, $ctid = 0) { + if(!$cids) { + return false; + } + if($ctid != 0) { + $ctidsql = ' AND ctid=\''.dintval($ctid).'\''; + } + return DB::query("DELETE FROM %t WHERE cid IN (%n) $ctidsql", array($this->_table, $cids)); + } + + public function delete_by_uid($uid) { + if(!$uid) { + return false; + } + return DB::query("DELETE FROM %t WHERE %i", array($this->_table, DB::field('uid', $uid))); + } + + public function fetch_all_by_ctid($ctid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE ctid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $ctid), $this->_pk); + } + + public function fetch_all_by_uid($uid) { + if(!$uid) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('uid', $uid)), $this->_pk); + } + + public function fetch_rate_by_ctid_uid($ctid, $uid) { + return DB::result_first('SELECT rate FROM %t WHERE ctid=%d AND uid=%d AND rate!=0', array($this->_table, $ctid, $uid), $this->_pk); + } + + public function fetch_all_for_search($cid, $ctid, $username, $uid, $useip, $rate, $message, $starttime, $endtime, $start = 0, $limit = 20) { + $where = '1'; + + $where .= $cid ? ' AND '.DB::field('cid', $cid) : ''; + $where .= $ctid ? ' AND '.DB::field('ctid', $ctid) : ''; + $where .= $username ? ' AND '.DB::field('username', '%'.stripsearchkey($username).'%', 'like') : ''; + $where .= $uid ? ' AND '.DB::field('uid', $uid) : ''; + $where .= $useip ? ' AND '.DB::field('useip', stripsearchkey($useip).'%', 'like') : ''; + $where .= $rate ? ' AND '.DB::field('rate', $rate, '>') : ''; + $where .= $message ? ' AND '.DB::field('message', '%'.stripsearchkey($message).'%', 'like') : ''; + $where .= $starttime != '' ? ' AND '.DB::field('dateline', $starttime, '>') : ''; + $where .= $endtime != '' ? ' AND '.DB::field('dateline', $endtime, '<') : ''; + + if($start == -1) { + return DB::result_first("SELECT count(*) FROM %t WHERE %i", array($this->_table, $where)); + } + return DB::fetch_all("SELECT * FROM %t WHERE %i ORDER BY dateline DESC %i", array($this->_table, $where, DB::limit($start, $limit))); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_collectionfollow.php b/source/class/table/table_forum_collectionfollow.php new file mode 100644 index 0000000..5e25adf --- /dev/null +++ b/source/class/table/table_forum_collectionfollow.php @@ -0,0 +1,101 @@ +_table = 'forum_collectionfollow'; + $this->_pk = 'ctid'; + + parent::__construct(); + } + + public function fetch_all($ids, $force_from_db = false, $null1 = 0, $null2 = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_collectionfollow($ids, $force_from_db, $null1, $null2); + } + } + + public function fetch_all_collectionfollow($ctid, $order = false, $start = 0, $limit = 0) { + if(!$ctid) { + return null; + } + $sql = DB::field('ctid', $ctid); + if($order) { + $sql .= ' ORDER BY '.DB::order('dateline', 'DESC'); + } + if($limit) { + $sql .= DB::limit($start, $limit); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.$sql, array($this->_table)); + } + + public function fetch_all_by_uid($uid) { + if(!$uid) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('uid', $uid)), $this->_pk); + } + + public function fetch_by_ctid_uid($ctid, $uid) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND ctid=%d', array($this->_table, $uid, $ctid)); + } + + public function delete_by_ctid($ctid) { + if(!$ctid) { + return false; + } + return DB::delete($this->_table, DB::field('ctid', $ctid)); + } + + public function delete_by_ctid_uid($ctid, $uid) { + return DB::query("DELETE FROM %t WHERE uid=%d AND ctid=%d", array($this->_table, $uid, $ctid)); + } + + public function delete_by_uid($uid) { + if(!$uid) { + return false; + } + return DB::query("DELETE FROM %t WHERE %i", array($this->_table, DB::field('uid', $uid))); + } + + public function count_by_ctid_uid($uid, $ctid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND ctid=%d', array($this->_table, $uid, $ctid), $this->_pk); + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_collectionfollow($val, $data, $unbuffered, $low_priority, $null); + } + } + + public function update_collectionfollow($ctid, $uid, $data, $unbuffered = false, $low_priority = false) { + if(!empty($data) && is_array($data) && $ctid && $uid) { + return DB::update($this->_table, $data, DB::field('ctid', $ctid).' AND '.DB::field('uid', $uid), $unbuffered, $low_priority); + } + return !$unbuffered ? 0 : false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_collectioninvite.php b/source/class/table/table_forum_collectioninvite.php new file mode 100644 index 0000000..d0cb32c --- /dev/null +++ b/source/class/table/table_forum_collectioninvite.php @@ -0,0 +1,59 @@ +_table = 'forum_collectioninvite'; + $this->_pk = ''; + + parent::__construct(); + } + + + public function fetch_by_ctid_uid($ctid, $uid) { + return DB::fetch_first('SELECT * FROM %t WHERE ctid=%d AND uid=%d', array($this->_table, $ctid, $uid)); + } + + public function delete_by_ctid_uid($ctid, $uid) { + $condition = array(); + + if($ctid) { + $condition[] = DB::field('ctid', $ctid); + } + + if($uid) { + $condition[] = DB::field('uid', $uid); + } + + if(!count($condition)) { + return false; + } + + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function delete_by_ctid($ctid) { + return DB::delete($this->_table, DB::field('ctid', $ctid)); + } + + public function delete_by_dateline($dateline) { + if(!is_numeric($dateline)) { + return false; + } + return DB::delete($this->_table, DB::field('dateline', $dateline, '<=')); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_collectionrelated.php b/source/class/table/table_forum_collectionrelated.php new file mode 100644 index 0000000..686b1ed --- /dev/null +++ b/source/class/table/table_forum_collectionrelated.php @@ -0,0 +1,42 @@ +_table = 'forum_collectionrelated'; + $this->_pk = 'tid'; + $this->_pre_cache_key = 'forum_collectionrelated_'; + + parent::__construct(); + } + + public function update_collection_by_ctid_tid($ctid, $tid, $replace = false) { + if($replace === false) { + $ctid .= "\t"; + $collection = 'CONCAT(collection, %s)'; + } else { + $collection = '%s'; + } + + $result = DB::query('UPDATE %t SET collection='.$collection.' WHERE tid=%d', array($this->_table, $ctid, $tid)); + if($this->_allowmem) { + $this->clear_cache($tid); + $this->clear_cache($tid, 'forum_collection_tid_'); + } + return $result; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_collectionteamworker.php b/source/class/table/table_forum_collectionteamworker.php new file mode 100644 index 0000000..398944f --- /dev/null +++ b/source/class/table/table_forum_collectionteamworker.php @@ -0,0 +1,92 @@ +_table = 'forum_collectionteamworker'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete_by_ctid($ctid) { + if(!$ctid) { + return false; + } + return DB::delete($this->_table, DB::field('ctid', $ctid)); + } + + public function delete_by_ctid_uid($ctid, $uid) { + if(!$ctid && !$uid) { + return false; + } + + $condition = array(); + + if($ctid) { + $condition[] = DB::field('ctid', $ctid); + } + + if($uid) { + $condition[] = DB::field('uid', $uid); + } + + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function delete_by_uid($uid) { + if(!$uid) { + return false; + } + return DB::query("DELETE FROM %t WHERE %i", array($this->_table, DB::field('uid', $uid))); + } + + public function fetch_all_by_ctid($ctid) { + return DB::fetch_all("SELECT * FROM %t WHERE ctid=%d", array($this->_table, $ctid), 'uid'); + } + + public function count_by_ctid($ctid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE ctid=%d", array($this->_table, $ctid)); + } + + public function fetch_all_by_uid($uid) { + return DB::fetch_all("SELECT * FROM %t WHERE uid=%d", array($this->_table, $uid), 'ctid'); + } + + public function update_by_ctid($ctid, $title) { + if(!$ctid || is_array($title)) { + return false; + } + return DB::update($this->_table, array('name'=>$title), DB::field('ctid', $ctid)); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_teamworker($val, $data, $unbuffered, $low_priority, $null); + } + } + + public function update_teamworker($ctid, $uid, $data, $unbuffered = false, $low_priority = false) { + if(!empty($data) && is_array($data) && $ctid && $uid) { + return DB::update($this->_table, $data, DB::field('ctid', $ctid).' AND '.DB::field('uid', $uid), $unbuffered, $low_priority); + } + return !$unbuffered ? 0 : false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_collectionthread.php b/source/class/table/table_forum_collectionthread.php new file mode 100644 index 0000000..de9299e --- /dev/null +++ b/source/class/table/table_forum_collectionthread.php @@ -0,0 +1,83 @@ +_table = 'forum_collectionthread'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_ctid($ctid, $start = 0, $limit = 0, $distinct = 0) { + if(!$ctid) { + return null; + } + if($distinct == 1) { + $sql = " GROUP BY tid"; + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('ctid', $ctid).$sql.' ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table), 'tid'); + } + + public function fetch_by_ctid_dateline($ctid) { + $data = $this->fetch_all_by_ctid($ctid, 0, 1); + return $data ? current($data) : null; + } + + public function fetch_all_by_tids($tids) { + if(!$tids) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('tid', $tids), array($this->_table), 'ctid'); + } + + public function fetch_by_ctid_tid($ctid, $tid) { + return DB::fetch_first('SELECT * FROM %t WHERE ctid=%d AND tid=%d', array($this->_table, $ctid, $tid)); + } + + public function fetch_all_by_ctid_tid($ctid, $tids) { + if(!$ctid || !$tids) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE ctid=%d AND tid IN(%n)', array($this->_table, $ctid, $tids), 'tid'); + } + + public function delete_by_ctid($ctid) { + if(!$ctid) { + return false; + } + return DB::delete($this->_table, DB::field('ctid', $ctid)); + } + + public function delete_by_ctid_tid($ctid, $tid) { + if(!$ctid && !$tid) { + return false; + } + + $condition = array(); + + if($ctid) { + $condition[] = DB::field('ctid', $ctid); + } + + if($tid) { + $condition[] = DB::field('tid', $tid); + } + + return DB::delete($this->_table, implode(' AND ', $condition), 0, false); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_creditslog.php b/source/class/table/table_forum_creditslog.php new file mode 100644 index 0000000..9ed2bd5 --- /dev/null +++ b/source/class/table/table_forum_creditslog.php @@ -0,0 +1,26 @@ +_table = 'forum_creditslog'; + $this->_pk = ''; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_debate.php b/source/class/table/table_forum_debate.php new file mode 100644 index 0000000..f7e745e --- /dev/null +++ b/source/class/table/table_forum_debate.php @@ -0,0 +1,56 @@ +_table = 'forum_debate'; + $this->_pk = 'tid'; + + parent::__construct(); + } + + public function update_voters($tid, $uid, $stand) { + if($stand == 1) { + DB::query("UPDATE %t SET affirmvotes=affirmvotes+1, affirmvoterids=CONCAT(affirmvoterids, '%d\t') WHERE tid=%d", array($this->_table, $uid, $tid)); + } elseif($stand == 2) { + DB::query("UPDATE %t SET negavotes=negavotes+1, negavoterids=CONCAT(negavoterids, '%d\t') WHERE tid=%d", array($this->_table, $uid, $tid)); + } + } + + public function update_debaters($tid, $stand) { + if($stand == 1) { + DB::query("UPDATE %t SET affirmdebaters=affirmdebaters+1 WHERE tid=%d", array($this->_table, $tid)); + } elseif($stand == 2) { + DB::query("UPDATE %t SET negadebaters=negadebaters+1 WHERE tid=%d", array($this->_table, $tid)); + } + } + + public function update_replies($tid, $stand) { + if($stand == 1) { + DB::query("UPDATE %t SET affirmreplies=affirmreplies+1 WHERE tid=%d", array($this->_table, $tid)); + } elseif($stand == 2) { + DB::query("UPDATE %t SET negareplies=negareplies+1 WHERE tid=%d", array($this->_table, $tid)); + } + } + public function delete_by_tid($tids) { + if(!$tids) { + return; + } + return DB::delete($this->_table, DB::field('tid', $tids)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_debatepost.php b/source/class/table/table_forum_debatepost.php new file mode 100644 index 0000000..69c45d6 --- /dev/null +++ b/source/class/table/table_forum_debatepost.php @@ -0,0 +1,60 @@ +_table = 'forum_debatepost'; + $this->_pk = 'pid'; + + parent::__construct(); + } + + public function update_voters($pid, $uid) { + DB::query("UPDATE %t SET voters=voters+1, voterids=CONCAT(voterids, '%d\t') WHERE pid=%d", array($this->_table, $uid, $pid)); + } + + public function fetch_all_voters($tid, $number) { + return DB::fetch_all("SELECT SUM(voters) as voters, stand, uid FROM %t WHERE tid=%d AND stand>'0' GROUP BY uid ORDER BY voters DESC LIMIT %d", array($this->_table, $tid, $number)); + } + + public function get_stand_by_bestuid($tid, $bestuid, $excludeuids) { + if(!$excludeuids) { + return; + } + return DB::result_first("SELECT stand FROM %t WHERE tid=%d AND uid=%d AND stand>'0' AND %i LIMIT 1", array($this->_table, $tid, $bestuid, DB::field('uid', $excludeuids,'notin'))); + } + + public function get_numbers_by_bestuid($tid, $bestuid) { + $return = DB::fetch_first("SELECT SUM(voters) AS voters, COUNT(*) AS replies FROM %t WHERE tid=%d AND uid=%d", array($this->_table, $tid, $bestuid)); + return array($return['voters'], $return['replies']); + } + + public function count_by_tid_stand($tid, $stand) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE tid=%d AND stand=%d", array($this->_table, $tid, $stand)); + } + + public function get_firststand($tid, $uid) { + return DB::result_first("SELECT stand FROM %t WHERE tid=%d AND uid=%d AND stand>'0' ORDER BY dateline LIMIT 1", array($this->_table, $tid, $uid)); + } + public function delete_by_tid($tids) { + if(!$tids) { + return; + } + return DB::delete($this->_table, DB::field('tid', $tids)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_faq.php b/source/class/table/table_forum_faq.php new file mode 100644 index 0000000..10da0de --- /dev/null +++ b/source/class/table/table_forum_faq.php @@ -0,0 +1,45 @@ +_table = 'forum_faq'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all_by_fpid($fpid = '', $srchkw = '') { + $sql = array(); + if($fpid !== '' && $fpid) { + $sql[] = DB::field('fpid', $fpid); + } + if($srchkw) { + $sql[] = DB::field('title', '%'.$srchkw.'%', 'like').' OR '.DB::field('message', '%'.$srchkw.'%', 'like'); + } + $sql = implode(' AND ', $sql); + if($sql) { + $sql = 'WHERE '.$sql; + } + return DB::fetch_all("SELECT * FROM %t %i ORDER BY displayorder", array($this->_table, $sql)); + } + + public function check_identifier($identifier, $id) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE identifier=%s AND id!=%s", array($this->_table, $identifier, $id)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_filter_post.php b/source/class/table/table_forum_filter_post.php new file mode 100644 index 0000000..3f9c157 --- /dev/null +++ b/source/class/table/table_forum_filter_post.php @@ -0,0 +1,55 @@ +_table = 'forum_filter_post'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_tid_pids($tid, $pid) { + return DB::fetch_all('SELECT * FROM %t WHERE tid=%d AND pid IN(%n)', array($this->_table, $tid, $pid), 'pid'); + } + + public function fetch_all_by_tid_postlength_limit($tid, $limit = 10) { + if($limit <= 0) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE tid=%d ORDER BY postlength DESC LIMIT %d', array($this->_table, $tid, $limit), 'pid'); + } + + public function delete_by_tid_pid($tid, $pid) { + if(empty($tid) || empty($pid)) { + return false; + } + return DB::query('DELETE FROM %t WHERE tid=%d AND pid=%d', array($this->_table, $tid, $pid)); + } + + public function delete_by_tid($tid) { + if(empty($tid)) { + return false; + } + return DB::query('DELETE FROM %t WHERE tid IN (%n)', array($this->_table, $tid)); + } + + public function delete_by_pid($pids) { + if(empty($pids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('pid', $pids), array($this->_table)); + } +} +?> \ No newline at end of file diff --git a/source/class/table/table_forum_forum.php b/source/class/table/table_forum_forum.php new file mode 100644 index 0000000..55d6a72 --- /dev/null +++ b/source/class/table/table_forum_forum.php @@ -0,0 +1,338 @@ +_table = 'forum_forum'; + $this->_pk = 'fid'; + $this->_pre_cache_key = 'forum_forum_'; + + parent::__construct(); + } + + public function fetch_all_by_status($status, $orderby = 1) { + $status = $status ? 1 : 0; + $ordersql = $orderby ? 'ORDER BY t.type, t.displayorder' : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table)." t WHERE t.status='$status' $ordersql"); + } + public function fetch_all_fids($allstatus = 0, $type = '', $fup = '', $start = 0, $limit = 0, $count = 0) { + $typesql = empty($type) ? "type<>'group'" : DB::field('type', $type); + $statussql = empty($allstatus) ? ' AND status<>3' : ''; + $fupsql = empty($fup) ? '' : ' AND '.DB::field('fup', $fup); + $limitsql = empty($limit) ? '' : ' LIMIT '.$start.', '.$limit; + if($count) { + return DB::result_first("SELECT count(*) FROM ".DB::table($this->_table)." WHERE $typesql $statussql $fupsql"); + } + return DB::fetch_all("SELECT * FROM ".DB::table($this->_table)." WHERE $typesql $statussql $fupsql $limitsql"); + } + public function fetch_info_by_fid($fid) { + $cache_name = $fid . "_with_fields"; + if(($data = $this->fetch_cache($cache_name)) === false) { + $data = DB::fetch_first("SELECT ff.*, f.* FROM %t f LEFT JOIN %t ff ON ff.fid=f.fid WHERE f.fid=%d", array($this->_table, 'forum_forumfield', $fid)); + $this->store_cache($cache_name, $data); + } + return $data; + } + public function fetch_all_name_by_fid($fids) { + if(empty($fids)) { + return array(); + } + return DB::fetch_all('SELECT fid, name FROM '.DB::table($this->_table)." WHERE ".DB::field('fid', $fids), array(), 'fid'); + } + public function fetch_all_info_by_fids($fids, $status = 0, $limit = 0, $fup = 0, $displayorder = 0, $onlyforum = 0, $noredirect = 0, $type = '', $start = 0) { + $sql = $fids ? "f.".DB::field('fid', $fids) : ''; + $sql .= empty($fup) ? '' : ($sql ? ' AND ' : '').'f.'.DB::field('fup', $fup); + if(!strcmp($status, 'available')) { + $sql .= ($sql ? ' AND ' : '')." f.status>'0'"; + } elseif($status) { + $sql .= $status ? ($sql ? ' AND ' : '')." f.".DB::field('status', $status) : ''; + } + $sql .= $onlyforum ? ($sql ? ' AND ' : '').'f.type<>\'group\'' : ''; + $sql .= $type ? ($sql ? ' AND ' : '').'f.'.DB::field('type', $type) : ''; + $sql .= $noredirect ? ($sql ? ' AND ' : '').'ff.redirect=\'\'' : ''; + $ordersql = $displayorder ? ' ORDER BY f.displayorder' : ''; + $limitsql = $limit ? DB::limit($start, $limit) : ''; + if(!$sql) { + return array(); + } + return DB::fetch_all("SELECT ff.*, f.* FROM %t f LEFT JOIN %t ff USING (fid) WHERE $sql $ordersql $limitsql", array($this->_table, 'forum_forumfield'), 'fid'); + } + public function fetch_all_default_recommend($num = 10) { + return DB::fetch_all("SELECT f.fid, f.name, ff.description, ff.icon FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff USING(fid) WHERE f.status='3' AND f.type='sub' ORDER BY f.commoncredits desc ".DB::limit($num)); + } + public function fetch_all_group_type($alltypeorder = 0) { + $ordersql = empty($alltypeorder) ? 'f.type, ' : "f.type<>'group', "; + return DB::fetch_all("SELECT f.fid, f.type, f.status, f.name, f.fup, f.displayorder, f.forumcolumns, f.inheritedmod, ff.moderators, ff.password, ff.redirect, ff.groupnum FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff USING(fid) WHERE f.status='3' AND f.type IN('group', 'forum') ORDER BY $ordersql f.displayorder"); + } + public function fetch_all_recommend_by_fid($fid) { + return DB::fetch_all("SELECT ff.*, f.* FROM %t f LEFT JOIN %t ff ON ff.fid=f.fid WHERE f.recommend=%d", array($this->_table, 'forum_forumfield', $fid)); + } + public function fetch_all_info_by_ignore_fid($fid) { + if(!intval($fid)) { + return array(); + } + return DB::fetch_all("SELECT fid, type, name, fup FROM ".DB::table($this->_table)." WHERE ".DB::field('fid', $fid, '<>')." AND type<>'sub' AND status<>'3' ORDER BY displayorder"); + } + public function fetch_all_forum($status = 0) { + $statusql = intval($status) ? 'f.'.DB::field('status', $status) : 'f.status<>\'3\''; + return DB::fetch_all("SELECT ff.*, f.*, a.uid FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff ON ff.fid=f.fid LEFT JOIN ".DB::table('forum_access')." a ON a.fid=f.fid AND a.allowview>'0' WHERE $statusql ORDER BY f.type, f.displayorder"); + } + public function fetch_all_subforum_by_fup($fups) { + return DB::fetch_all("SELECT fid, fup, name, threads, posts, todayposts, domain FROM %t WHERE status='1' AND fup IN (%n) AND type='sub' ORDER BY displayorder", array($this->_table, $fups)); + } + public function fetch_all_forum_ignore_access() { + return DB::fetch_all("SELECT ff.*, f.* FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff ON ff.fid=f.fid WHERE status <3 ORDER BY f.fid"); + } + public function fetch_all_forum_for_sub_order() { + return DB::fetch_all("SELECT ff.*, f.fid, f.type, f.status, f.name, f.fup, f.displayorder, f.inheritedmod FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff USING(fid) WHERE f.status<>'3' ORDER BY f.type<>'group', f.displayorder"); + } + public function fetch_all_valid_forum() { + return DB::fetch_all("SELECT * FROM ".DB::table($this->_table)." WHERE status='1' AND type IN ('forum', 'sub') ORDER BY type"); + } + public function fetch_all_valid_fieldinfo() { + return DB::fetch_all("SELECT ff.* FROM ".DB::table($this->_table)." f INNER JOIN ".DB::table('forum_forumfield')." ff USING(fid) WHERE f.status='1'"); + } + public function fetch_threadcacheon_num() { + return DB::result_first("SELECT COUNT(*) FROM ".DB::table($this->_table)." WHERE status='1' AND threadcaches>0"); + } + public function fetch_all_by_recyclebin($recyclebin = 0) { + return DB::fetch_all('SELECT fid, name FROM %t WHERE status<3 AND type IN (\'forum\', \'sub\') AND recyclebin=%d', array($this->_table, $recyclebin)); + } + public function update($val, $data, $unbuffered = false, $low_priority = false) { + $this->clear_cache(array($val, $val."_with_fields")); + return parent::update($val, $data, $unbuffered, $low_priority); + } + public function update_threadcaches($threadcache, $fids) { + if(empty($fids)) { + return false; + } + $sqladd = in_array('all', $fids) ? '' : ' WHERE '.DB::field('fid', $fids); + DB::query("UPDATE ".DB::table($this->_table)." SET threadcaches='".intval($threadcache)."'$sqladd"); + } + public function update_styleid($ids) { + DB::query("UPDATE ".DB::table($this->_table)." SET styleid='0' WHERE styleid IN(%n)",array($ids)); + } + public function fetch_forum_num($type = '', $fup = '') { + $fupsql = $fup ? DB::field('fup', $fup).' AND ' : ''; + $addwhere = $type == 'group' ? "`status`='3'" : "`status`<>3"; + return DB::result_first("SELECT COUNT(*) FROM ".DB::table($this->_table)." WHERE $fupsql $addwhere"); + } + public function check_forum_exists($fids, $issub = 1) { + if(empty($fids)) { + return false; + } + $typesql = $issub ? " AND type<>'group'" : ''; + return DB::result_first("SELECT COUNT(*) FROM ".DB::table($this->_table)." WHERE %i".$typesql, array(DB::field('fid', $fids))); + } + public function fetch_sum_todaypost() { + return DB::result_first("SELECT sum(todayposts) FROM ".DB::table($this->_table)); + } + public function fetch_group_counter() { + return DB::fetch_first("SELECT SUM(todayposts) AS todayposts, COUNT(fid) AS groupnum FROM ".DB::table($this->_table)." WHERE status='3' AND type='sub'"); + } + public function fetch_all_sub_group_by_fup($fups, $limit = 20) { + return DB::fetch_all("SELECT fid, fup, name FROM %t WHERE fup IN(%n) AND type='sub' AND level>'-1' ORDER BY commoncredits DESC LIMIT %d", array($this->_table, $fups, $limit), $this->_pk); + } + public function fetch_all_for_threadsorts() { + return DB::fetch_all("SELECT f.fid, f.name, ff.threadsorts FROM ".DB::table($this->_table)." f , ".DB::table('forum_forumfield')." ff WHERE ff.threadsorts<>'' AND f.fid=ff.fid"); + } + + public function fetch_all_for_search($conditions, $start = 0, $limit = 20) { + if(empty($conditions)) { + return array(); + } + if($start == -1) { + return DB::result_first("SELECT count(*) FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff ON f.fid=ff.fid + WHERE status='3' AND type='sub' AND %i", array($conditions)); + } + return DB::fetch_all("SELECT f.fid, f.fup, f.type, f.name, f.posts, f.threads, ff.membernum, ff.lastupdate, ff.dateline, ff.foundername, ff.founderuid FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff ON f.fid=ff.fid + WHERE status='3' AND type='sub' AND %i ".DB::limit($start, $limit), array($conditions)); + } + public function clear_todayposts() { + DB::query("UPDATE ".DB::table($this->_table)." SET todayposts='0'"); + } + public function clear_forum_counter_for_group() { + DB::query("UPDATE ".DB::table($this->_table)." SET threads='0', posts='0' WHERE type='group'"); + } + public function update_forum_counter($fid, $threads = 0, $posts = 0, $todayposts = 0, $modwork = 0, $favtimes = 0) { + if(!dintval($fid)) { + return false; + } + $addsql = array(); + if($threads) { + $addsql[] = "threads=threads+'".intval($threads)."'"; + } + if($posts) { + $addsql[] = "posts=posts+'".intval($posts)."'"; + } + if($todayposts) { + $addsql[] = "todayposts=todayposts+'".intval($todayposts)."'"; + } + if($modwork) { + $addsql[] = "modworks='1'"; + } + if($favtimes) { + $addsql[] = "favtimes=favtimes+'".intval($favtimes)."'"; + } + if($addsql) { + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(', ', $addsql)." WHERE ".DB::field('fid', $fid), 'UNBUFFERED'); + } + } + public function update_commoncredits($fid) { + if(!intval($fid)) { + return false; + } + DB::query("UPDATE ".DB::table($this->_table)." SET commoncredits=commoncredits+1 WHERE ".DB::field('fid', $fid)); + } + + public function update_oldrank_and_yesterdayposts() { + DB::query("UPDATE ".DB::table($this->_table).' SET oldrank=`rank`,yesterdayposts=todayposts'); + } + public function update_group_level($levelid, $fid) { + if(!intval($levelid) || !intval($fid)) { + return false; + } + DB::query("UPDATE ".DB::table($this->_table)." SET level=%d WHERE fid=%d", array($levelid, $fid)); + } + public function fetch_all_fid_for_group($start, $limit, $issub = 0, $conditions = '') { + if(!empty($conditions) && !is_string($conditions)) { + return array(); + } + $typesql = $issub ? 'type=\'sub\'' : 'type<>\'sub\''; + return DB::fetch_all("SELECT fid FROM ".DB::table($this->_table)." WHERE status='3' AND $typesql %i ".DB::limit($start, $limit), array($conditions)); + } + public function fetch_groupnum_by_fup($fup) { + if(!intval($fup)) { + return false; + } + return DB::result_first("SELECT COUNT(*) as num FROM ".DB::table($this->_table)." WHERE fup=%d AND type='sub' GROUP BY fup", array($fup)); + } + public function fetch_all_group_for_ranking() { + return DB::fetch_all("SELECT fid FROM ".DB::table($this->_table)." WHERE type='sub' AND status='3' ORDER BY commoncredits DESC LIMIT 0, 1000"); + } + public function fetch_all_for_ranklist($status, $type, $orderfield, $start = 0, $limit = 0, $ignorefids = array()) { + if(empty($orderfield)) { + return array(); + } + $typesql = $type ? ' AND f.'.DB::field('type', $type) : ' AND f.type<>\'group\''; + $ignoresql = $ignorefids ? ' AND f.fid NOT IN('.dimplode($ignorefids).')' : ''; + $fields = $jointable = ''; + if($orderfield == 'membernum') { + $fields = ', ff.membernum'; + $jointable = ' LEFT JOIN '.DB::table('forum_forumfield').' ff ON ff.fid=f.fid'; + $orderfield = 'ff.'.$orderfield; + } + return DB::fetch_all("SELECT f.* $fields FROM %t f $jointable WHERE f.status=%d $typesql $ignoresql ORDER BY %i DESC ".DB::limit($start, $limit), array($this->_table, $status, $orderfield)); + } + public function fetch_fid_by_name($name) { + return DB::result_first("SELECT fid FROM %t WHERE name=%s", array($this->_table, $name)); + } + public function insert_group($fup, $type, $name, $status, $level) { + DB::query("INSERT INTO %t (fup, type, name, status, level) VALUES (%d, %s, %s, %d, %d)", array($this->_table, $fup, $type, $name, $status, $level)); + return DB::insert_id(); + } + public function fetch_all_by_fid($fids) { + return DB::fetch_all("SELECT * FROM %t WHERE fid IN(%n)", array($this->_table, (array)$fids), $this->_pk); + } + public function delete_by_fid($fids) { + if(empty($fids)) { + return false; + } + DB::query("DELETE FROM ".DB::table($this->_table)." WHERE %i", array(DB::field('fid', $fids))); + DB::query("DELETE FROM ".DB::table('forum_forumfield')." WHERE %i", array(DB::field('fid', $fids))); + } + public function update_fup_by_fup($sourcefup, $targetfup) { + DB::query("UPDATE ".DB::table($this->_table)." SET fup=%d WHERE fup=%s", array($targetfup, $sourcefup)); + } + public function validate_level_for_group($fids) { + if(empty($fids)) { + return false; + } + DB::query("UPDATE ".DB::table($this->_table)." SET level='0' WHERE %i", array(DB::field('fid', $fids))); + } + public function validate_level_num() { + return DB::result_first("SELECT count(*) FROM ".DB::table($this->_table)." WHERE status='3' AND level='-1'"); + } + public function fetch_all_validate($start, $limit) { + return DB::fetch_all("SELECT f.*, ff.dateline, ff.founderuid, ff.foundername, ff.description FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff ON ff.fid=f.fid WHERE status='3' AND level='-1' ORDER BY f.fid DESC LIMIT ".intval($start).', '.intval($limit)); + } + public function update_archive($fids) { + return DB::update('forum_forum', array('archive' => '0'), "fid NOT IN (".dimplode($fids).")"); + } + public function fetch_all_for_grouplist($orderby = 'displayorder', $fieldarray = array(), $num = 1, $fids = array(), $sort = 0, $getcount = 0) { + if($fieldarray && is_array($fieldarray)) { + $fieldadd = ''; + foreach($fieldarray as $field) { + $fieldadd .= $field.', '; + } + } else { + $fieldadd = 'ff.*, '; + } + $start = 0; + if(is_array($num)) { + list($start, $snum) = $num; + } else { + $snum = $num; + } + $orderbyarray = array('displayorder' => 'f.displayorder DESC', 'dateline' => 'ff.dateline DESC', 'lastupdate' => 'ff.lastupdate DESC', 'membernum' => 'ff.membernum DESC', 'thread' => 'f.threads DESC', 'activity' => 'f.commoncredits DESC'); + $useindex = $orderby == 'displayorder' ? 'USE INDEX(fup_type)' : ''; + $orderby = !empty($orderby) && $orderbyarray[$orderby] ? "ORDER BY ".$orderbyarray[$orderby].', f.fid DESC' : 'ORDER BY f.fid DESC'; + $limitsql = $num ? "LIMIT $start, $snum " : ''; + $field = $sort ? 'fup' : 'fid'; + $fids = $fids && is_array($fids) ? 'f.'.$field.' IN ('.dimplode($fids).')' : ''; + if(empty($fids)) { + $levelsql = " AND f.level>'-1'"; + } + + $fieldsql = $fieldadd.' f.fid, f.name, f.threads, f.posts, f.todayposts, f.level as flevel '; + if($getcount) { + return DB::result_first("SELECT count(*) FROM ".DB::table($this->_table)." f $useindex WHERE".($fids ? " $fids AND " : '')." f.type='sub' AND f.status=3 $levelsql"); + } + return DB::fetch_all("SELECT $fieldsql FROM ".DB::table($this->_table)." f $useindex LEFT JOIN ".DB::table("forum_forumfield")." ff ON ff.fid=f.fid WHERE".($fids ? " $fids AND " : '')." f.type='sub' AND f.status=3 $levelsql $orderby $limitsql"); + } + + function fetch_table_struct($tablename, $result = 'FIELD') { + if(empty($tablename)) { + return array(); + } + $datas = array(); + $query = DB::query("DESCRIBE ".DB::table($tablename)); + while($data = DB::fetch($query)) { + $datas[$data['Field']] = $result == 'FIELD' ? $data['Field'] : $data; + } + return $datas; + } + + function get_forum_by_fid($fid, $field = '', $table = 'forum') { + static $forumlist = array('forum' => array(), 'forumfield' => array()); + $table = $table != 'forum' ? 'forumfield' : 'forum'; + $return = array(); + if(!array_key_exists($fid, $forumlist[$table])) { + $forumlist[$table][$fid] = DB::fetch_first("SELECT * FROM ".DB::table('forum_'.$table)." WHERE fid=%d", array($fid)); + if(!is_array($forumlist[$table][$fid])) { + $forumlist[$table][$fid] = array(); + } + } + + if(!empty($field)) { + $return = isset($forumlist[$table][$fid][$field]) ? $forumlist[$table][$fid][$field] : null; + } else { + $return = $forumlist[$table][$fid]; + } + return $return; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_forum_threadtable.php b/source/class/table/table_forum_forum_threadtable.php new file mode 100644 index 0000000..582c40c --- /dev/null +++ b/source/class/table/table_forum_forum_threadtable.php @@ -0,0 +1,79 @@ +_table = 'forum_forum_threadtable'; + $this->_pk = ''; + + parent::__construct(); + } + + public function count_by_fid($fids) { + if(empty($fids)) { + return 0; + } + return DB::result_first('SELECT COUNT(*) FROM %t WHERE '.DB::field('fid', $fids), array($this->_table)); + } + + public function fetch_all_by_fid($fids) { + if(empty($fids)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('fid', $fids), array($this->_table)); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_threadtable($val, $data, $unbuffered, $low_priority, $null); + } + } + + public function update_threadtable($fid, $threadtableid, $data, $unbuffered = false, $low_priority = false) { + if(empty($data)) { + return false; + } + return DB::update($this->_table, $data, array('fid' => $fid, 'threadtableid' => $threadtableid), $unbuffered, $low_priority); + } + + public function update_by_threadtableid($threadtableid, $data, $unbuffered = false, $low_priority = false) { + if(empty($data)) { + return false; + } + return DB::update($this->_table, $data, DB::field('threadtableid', $threadtableid), $unbuffered, $low_priority); + } + + public function delete($val, $unbuffered = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_threadtable($val, $unbuffered, $null); + } + } + + public function delete_threadtable($fid, $threadtableid, $unbuffered = false) { + return DB::delete($this->_table, array('fid' => dintval($fid), 'threadtableid' => dintval($threadtableid)), null, $unbuffered); + } + + public function delete_none_threads() { + return DB::delete($this->_table, "threads='0'"); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_forumfield.php b/source/class/table/table_forum_forumfield.php new file mode 100644 index 0000000..75044c3 --- /dev/null +++ b/source/class/table/table_forum_forumfield.php @@ -0,0 +1,75 @@ +_table = 'forum_forumfield'; + $this->_pk = 'fid'; + + parent::__construct(); + } + public function fetch_all_by_fid($fids) { + $fids = array_map('intval', (array)$fids); + if(!empty($fids)) { + return DB::fetch_all("SELECT * FROM %t WHERE fid IN(%n)", array($this->_table, $fids), $this->_pk); + } else { + return array(); + } + } + public function fetch_all_field_perm() { + return DB::fetch_all("SELECT fid, viewperm, postperm, replyperm, getattachperm, postattachperm, postimageperm FROM ".DB::table($this->_table)." WHERE founderuid=0"); + } + public function fetch_groupnum_by_founderuid($uid) { + if(empty($uid)) { + return false; + } + return DB::result_first("SELECT COUNT(*) FROM ".DB::table($this->_table)." WHERE founderuid=%d", array($uid)); + } + public function update($val, $data, $unbuffered = false, $low_priority = false) { + C::t('forum_forum')->clear_cache(array($val, $val."_with_fields")); + return parent::update($val, $data, $unbuffered, $low_priority); + } + public function update_groupnum($fid, $num) { + if(!intval($fid) || !intval($num)) { + return false; + } + DB::query("UPDATE %t SET ".DB::field('groupnum', $num, '+')." WHERE fid=%d", array('forum_forumfield', $fid)); + } + public function update_membernum($fid, $num = 1) { + if(!intval($fid) || !intval($num)) { + return false; + } + DB::query("UPDATE %t SET ".DB::field('membernum', $num, '+')." WHERE fid=%d", array('forum_forumfield', $fid)); + } + public function fetch_info_for_attach($fid, $uid) { + return DB::fetch_first("SELECT f.fid, f.viewperm, f.getattachperm, a.allowgetattach, a.allowgetimage FROM %t f LEFT JOIN %t a ON a.uid=%d AND a.fid=f.fid WHERE f.fid=%d", array('forum_forumfield', 'forum_access', $uid, $fid)); + } + public function check_moderator_for_uid($fid, $uid, $accessmasks = 0) { + if(!intval($fid) || !intval($uid)) { + return false; + } + if($accessmasks) { + $accessadd1 = ', a.allowview, a.allowpost, a.allowreply, a.allowgetattach, a.allowgetimage, a.allowpostattach'; + $accessadd2 = "LEFT JOIN ".DB::table('forum_access')." a ON a.".DB::field('uid', $uid)." AND a.".DB::field('fid', $fid); + } + return DB::fetch_first("SELECT ff.postperm, m.uid AS istargetmod $accessadd1 + FROM ".DB::table($this->_table)." ff + $accessadd2 + LEFT JOIN ".DB::table('forum_moderator')." m ON m.fid=%d AND m.uid=%d + WHERE ff.fid=%d", array($fid, $uid, $fid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_forumrecommend.php b/source/class/table/table_forum_forumrecommend.php new file mode 100644 index 0000000..9a80198 --- /dev/null +++ b/source/class/table/table_forum_forumrecommend.php @@ -0,0 +1,56 @@ +_table = 'forum_forumrecommend'; + $this->_pk = 'tid'; + + parent::__construct(); + } + + public function delete_by_fid($fids, $moderatorid = false) { + if(!$fids) { + return; + } + $moderatorid = $moderatorid !== false ? ' AND moderatorid='.intval($moderatorid) : ''; + DB::query("DELETE FROM %t WHERE %i %i", array($this->_table, DB::field('fid', $fids), $moderatorid)); + } + + public function delete_by_tid($tids) { + if(!$fids) { + return; + } + return DB::delete($this->_table, DB::field('tid', $tids)); + } + + public function delete_old() { + DB::query("DELETE FROM %t WHERE expiration>0 AND expiration<%d", array($this->_table, TIMESTAMP), false, true); + } + + public function fetch_all_by_fid($fid, $position = false, $moderatorid = false, $start = 0, $limit = 0) { + $position = $position ? ' AND '.DB::field('position', array(0, $position)) : ''; + $moderatorid = $moderatorid ? ' AND '.DB::field('moderatorid', array(0, $moderatorid)) : ''; + $limit = $start && $limit ? ' LIMIT '.intval($start).', '.intval($limit) : ''; + return DB::fetch_all('SELECT * FROM %t WHERE fid=%d %i %i ORDER BY displayorder %i', array($this->_table, $fid, $position, $moderatorid, $limit)); + } + + public function count_by_fid($fid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE fid=%d", array($this->_table, $fid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_groupcreditslog.php b/source/class/table/table_forum_groupcreditslog.php new file mode 100644 index 0000000..da8b691 --- /dev/null +++ b/source/class/table/table_forum_groupcreditslog.php @@ -0,0 +1,34 @@ +_table = 'forum_groupcreditslog'; + $this->_pk = ''; + + parent::__construct(); + } + public function check_logdate($fid, $uid, $logdate) { + return DB::result_first("SELECT logdate FROM %t WHERE fid=%d AND uid=%d AND logdate=%s", array($this->_table, $fid, $uid, $logdate)); + } + public function delete_by_fid($fid) { + if(empty($fid)) { + return false; + } + DB::query("DELETE FROM ".DB::table('forum_groupcreditslog')." WHERE ".DB::field('fid', $fid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_groupfield.php b/source/class/table/table_forum_groupfield.php new file mode 100644 index 0000000..14bf7d4 --- /dev/null +++ b/source/class/table/table_forum_groupfield.php @@ -0,0 +1,39 @@ +_table = 'forum_groupfield'; + $this->_pk = 'fid'; + + parent::__construct(); + } + public function truncate() { + DB::query("TRUNCATE ".DB::table('forum_groupfield')); + } + public function delete_by_type($types, $fid = 0) { + if(empty($types)) { + return false; + } + $addfid = $fid ? " AND fid='".intval($fid)."'" : ''; + DB::query("DELETE FROM ".DB::table('forum_groupfield')." WHERE ".DB::field('type', $types).$addfid); + } + public function fetch_all_group_cache($fid, $types = array(), $privacy = 0) { + $typeadd = $types && is_array($types) ? "AND ".DB::field('type', $types) : ''; + return DB::fetch_all("SELECT fid, dateline, type, data FROM ".DB::table('forum_groupfield')." WHERE fid=%d AND privacy=%d $typeadd", array($fid, $privacy)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_groupinvite.php b/source/class/table/table_forum_groupinvite.php new file mode 100644 index 0000000..4260511 --- /dev/null +++ b/source/class/table/table_forum_groupinvite.php @@ -0,0 +1,40 @@ +_table = 'forum_groupinvite'; + $this->_pk = 'fid'; + + parent::__construct(); + } + public function fetch_uid_by_inviteuid($fid, $inviteuid) { + return DB::result_first("SELECT uid FROM %t WHERE fid=%d AND inviteuid=%d", array($this->_table, $fid, $inviteuid)); + } + public function fetch_all_inviteuid($fid, $inviteuids, $uid) { + if(empty($fid) || empty($uid) || empty($inviteuids)) { + return array(); + } + return DB::fetch_all("SELECT inviteuid FROM %t WHERE fid=%d AND ".DB::field('inviteuid', $inviteuids)." AND uid=%d", array($this->_table, $fid, $uid)); + } + public function delete_by_inviteuid($fid, $inviteuid) { + DB::query("DELETE FROM %t WHERE fid=%d AND inviteuid=%d", array($this->_table, $fid, $inviteuid)); + } + public function affected_rows() { + return DB::affected_rows(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_grouplevel.php b/source/class/table/table_forum_grouplevel.php new file mode 100644 index 0000000..ae333e9 --- /dev/null +++ b/source/class/table/table_forum_grouplevel.php @@ -0,0 +1,34 @@ +_table = 'forum_grouplevel'; + $this->_pk = 'levelid'; + + parent::__construct(); + } + public function fetch_all_creditslower_order() { + return DB::fetch_all("SELECT * FROM ".DB::table('forum_grouplevel')." WHERE 1 ORDER BY creditslower"); + } + public function fetch_count() { + return DB::result_first("SELECT count(*) FROM ".DB::table('forum_grouplevel')); + } + public function fetch_by_credits($credits = 0) { + return DB::fetch_first("SELECT * FROM %t WHERE creditshigher<=%d AND %d_table, $credits, $credits)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_groupuser.php b/source/class/table/table_forum_groupuser.php new file mode 100644 index 0000000..866a768 --- /dev/null +++ b/source/class/table/table_forum_groupuser.php @@ -0,0 +1,176 @@ +_table = 'forum_groupuser'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_all_fid_by_uids($uids) { + if(empty($uids)) { + return array(); + } + $data = array(); + $query = DB::query("SELECT fid FROM %t WHERE %i AND level>0 ORDER BY lastupdate DESC", array($this->_table, DB::field('uid', $uids))); + while($row = DB::fetch($query)) { + $data[] = $row['fid']; + } + return $data; + } + public function fetch_userinfo($uid, $fid) { + if(empty($uid) || empty($fid)) { + return array(); + } + return DB::fetch_first("SELECT * FROM %t WHERE fid=%d AND uid=%d", array($this->_table, $fid, $uid)); + } + public function fetch_all_userinfo($uids, $fid) { + if(empty($uids) || empty($fid)) { + return array(); + } + return DB::fetch_all("SELECT * FROM %t WHERE fid=%d AND ".DB::field('uid', $uids), array($this->_table, $fid)); + } + public function fetch_all_by_fid($fid, $level = 0) { + if(empty($fid)) { + return array(); + } + $levelsql = ' AND level>0'; + if($level == 1) { + $levelsql = ' AND level=0'; + } elseif($level == -1) { + $levelsql = ''; + } + return DB::fetch_all("SELECT * FROM %t WHERE fid=%d".$levelsql, array($this->_table, $fid)); + } + public function fetch_count_by_fid($fid, $level = 0) { + $levelsql = ' AND level>0'; + if($level == 1) { + $levelsql = ' AND level=0'; + } elseif($level == -1) { + $levelsql = ''; + } + return DB::result_first("SELECT COUNT(*) FROM %t WHERE fid=%d".$levelsql, array($this->_table, $fid)); + } + public function insert($data, $return_insert_id = false, $replace = false, $silent = false, $null1 = 0, $null2 = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + return $this->insert_groupuser($data, $return_insert_id, $replace, $silent, $null1, $null2); + } + } + public function insert_groupuser($fid, $uid, $username, $level, $joindateline, $lastupdate = 0) { + DB::query("INSERT INTO %t (fid, uid, username, level, joindateline, lastupdate) VALUES (%d,%d,%s,%d,%d,%d)", array($this->_table, $fid, $uid, addslashes($username), $level, $joindateline, $lastupdate)); + } + public function update_counter_for_user($uid, $fid, $threads = 0, $replies = 0) { + if(empty($uid) || empty($fid)) { + return array(); + } + $sql = $threads ? 'threads=threads+1' : ''; + if($replies) { + $sql = ($sql ? ', ' : '').'replies=replies+1'; + } + if(empty($sql)) { + return false; + } + DB::query("UPDATE ".DB::table('forum_groupuser')." SET $sql, lastupdate='".TIMESTAMP."' WHERE fid=%d AND uid=%d", array($fid, $uid)); + } + public function delete_by_fid($fids, $uid = 0) { + if(empty($fids)) { + return false; + } + if($uid) { + $sqladd = ' AND '.DB::field('uid', $uid); + } + DB::query("DELETE FROM ".DB::table('forum_groupuser')." WHERE %i ".$sqladd, array(DB::field('fid', $fids))); + } + public function update_for_user($uid, $fid, $threads = null, $replies = null, $level = null) { + if(empty($uid) || empty($fid)) { + return array(); + } + $sqladd = $threads !== null ? 'threads='.intval($threads) : ''; + if($replies !== null) { + $sqladd .= ($sqladd ? ', ' : '').'replies='.intval($replies); + } + if($level !== null) { + $sqladd .= ($sqladd ? ', ' : '').'level='.intval($level); + } + DB::query("UPDATE %t SET $sqladd WHERE fid=%d AND ".DB::field('uid', $uid), array($this->_table, $fid)); + } + + public function groupuserlist($fid, $orderby = '', $num = 0, $start = 0, $addwhere = '', $fieldarray = array(), $onlinemember = array()) { + $fid = intval($fid); + if($fieldarray && is_array($fieldarray)) { + $fieldadd = 'uid'; + foreach($fieldarray as $field) { + $fieldadd .= ' ,'.$field; + } + } else { + $fieldadd = '*'; + } + + $sqladd = $levelwhere = ''; + if($addwhere) { + if(is_array($addwhere)) { + foreach($addwhere as $field => $value) { + if(is_array($value)) { + $levelwhere = "AND level>'0' "; + $sqladd .= "AND $field IN (".dimplode($value).") "; + } else { + $sqladd .= is_numeric($field) ? "AND $value " : "AND $field='$value' "; + } + } + if(!empty($addwhere['level'])) $levelwhere = ''; + } else { + $sqladd = $addwhere; + } + } + + $orderbyarray = array('level_join' => 'level ASC, joindateline ASC', 'joindateline' => 'joindateline DESC', 'lastupdate' => 'lastupdate DESC', 'threads' => 'threads DESC', 'replies' => 'replies DESC'); + $orderby = !empty($orderbyarray[$orderby]) ? "ORDER BY $orderbyarray[$orderby]" : ''; + $limitsql = $num ? DB::limit($start, $num) : ''; + + $groupuserlist = array(); + $query = DB::query("SELECT $fieldadd FROM ".DB::table('forum_groupuser')." WHERE fid=%d $levelwhere %i $orderby $limitsql", array($fid,$sqladd)); + while($groupuser = DB::fetch($query)) { + $groupuserlist[$groupuser['uid']] = $groupuser; + $groupuserlist[$groupuser['uid']]['online'] = !empty($onlinemember) && is_array($onlinemember) && !empty($onlinemember[$groupuser['uid']]) ? 1 : 0; + } + + return $groupuserlist; + } + public function fetch_all_group_for_user($uid, $count = 0, $ismanager = 0, $start = 0, $num = 0) { + $uid = intval($uid); + if(empty($uid)) { + return array(); + } + if(empty($ismanager)) { + $levelsql = ''; + } elseif($ismanager == 1) { + $levelsql = ' AND level IN(1,2)'; + } elseif($ismanager == 2) { + $levelsql = ' AND level IN(3,4)'; + } + if($count == 1) { + return DB::result_first("SELECT count(*) FROM ".DB::table('forum_groupuser')." WHERE uid='$uid' $levelsql"); + } + empty($start) && $start = 0; + empty($num) && $num = 100; + return DB::fetch_all("SELECT fid, level FROM ".DB::table('forum_groupuser')." WHERE uid='$uid' $levelsql ORDER BY lastupdate DESC ".DB::limit($start, $num)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_hotreply_member.php b/source/class/table/table_forum_hotreply_member.php new file mode 100644 index 0000000..6fd8943 --- /dev/null +++ b/source/class/table/table_forum_hotreply_member.php @@ -0,0 +1,45 @@ + +_table = 'forum_hotreply_member'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_member($id, $force_from_db); + } + } + + public function fetch_member($pid, $uid) { + return DB::fetch_first('SELECT * FROM %t WHERE pid=%d AND uid=%d', array($this->_table, $pid, $uid)); + } + + public function delete_by_tid($tid) { + if(empty($tid)) { + return false; + } + return DB::query('DELETE FROM %t WHERE tid IN (%n)', array($this->_table, $tid)); + } + + public function delete_by_pid($pids) { + if(empty($pids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('pid', $pids), array($this->_table)); + } +} +?> \ No newline at end of file diff --git a/source/class/table/table_forum_hotreply_number.php b/source/class/table/table_forum_hotreply_number.php new file mode 100644 index 0000000..9ff1000 --- /dev/null +++ b/source/class/table/table_forum_hotreply_number.php @@ -0,0 +1,54 @@ +_table = 'forum_hotreply_number'; + $this->_pk = 'pid'; + + parent::__construct(); + } + + public function fetch_all_by_pids($pids) { + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('pid', $pids), array($this->_table), 'pid'); + } + + public function fetch_all_by_tid_total($tid, $limit = 5) { + return DB::fetch_all('SELECT * FROM %t WHERE tid=%d ORDER BY total DESC LIMIT %d', array($this->_table, $tid, $limit), 'pid'); + } + + public function fetch_by_pid($pid) { + return DB::fetch_first('SELECT * FROM %t WHERE pid=%d', array($this->_table, $pid)); + } + + public function update_num($pid, $typeid) { + $typename = $typeid == 1 ? 'support' : 'against'; + return DB::query('UPDATE %t SET '.$typename.'='.$typename.'+1, total=total+1 WHERE pid=%d', array($this->_table, $pid)); + } + + public function delete_by_tid($tid) { + if(empty($tid)) { + return false; + } + return DB::query('DELETE FROM %t WHERE tid IN (%n)', array($this->_table, $tid)); + } + + public function delete_by_pid($pids) { + if(empty($pids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('pid', $pids), array($this->_table)); + } +} +?> \ No newline at end of file diff --git a/source/class/table/table_forum_imagetype.php b/source/class/table/table_forum_imagetype.php new file mode 100644 index 0000000..1b4dd8c --- /dev/null +++ b/source/class/table/table_forum_imagetype.php @@ -0,0 +1,39 @@ +_table = 'forum_imagetype'; + $this->_pk = 'typeid'; + + parent::__construct(); + } + + public function fetch_all_by_type($type, $available = null) { + $available = $available !== null ? ($available ? ' AND available=1' : ' AND available=0') : ''; + return DB::fetch_all("SELECT * FROM %t WHERE type=%s %i ORDER BY displayorder", array($this->_table, $type, $available)); + } + + public function fetch_all_available() { + return DB::fetch_all("SELECT * FROM %t WHERE available=1", array($this->_table)); + } + + public function count_by_name($type, $name) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE type=%s AND name=%s", array($this->_table, $type, $name)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_medal.php b/source/class/table/table_forum_medal.php new file mode 100644 index 0000000..378bbf2 --- /dev/null +++ b/source/class/table/table_forum_medal.php @@ -0,0 +1,53 @@ +_table = 'forum_medal'; + $this->_pk = 'medalid'; + + parent::__construct(); + } + + public function fetch_all_data($available = false, $start = 0, $limit = 0) { + $available = $available !== false ? ' WHERE available='.intval($available) : ''; + return DB::fetch_all('SELECT * FROM %t %i ORDER BY displayorder, medalid'.DB::limit($start, $limit), array($this->_table, $available)); + } + public function fetch_all_name_by_available($available = 1) { + $data = array(); + foreach($this->fetch_all_data($available) as $value) { + $data[$value['medalid']] = array('medalid' => $value['medalid'], 'name' => $value['name']); + } + return $data; + } + + public function count_by_available($available = 1) { + $available = $available !== false ? ' WHERE available='.intval($available) : ''; + return DB::result_first('SELECT COUNT(*) FROM %t %i', array($this->_table, $available)); + } + + + public function fetch_all_by_id($id) { + if(!$id) { + return; + } + return DB::fetch_all("SELECT * FROM %t WHERE %i ORDER BY displayorder, medalid", array($this->_table, DB::field('medalid', $id))); + } + + + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_medallog.php b/source/class/table/table_forum_medallog.php new file mode 100644 index 0000000..a117f37 --- /dev/null +++ b/source/class/table/table_forum_medallog.php @@ -0,0 +1,90 @@ +_table = 'forum_medallog'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function count_by_type($type) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE type=%d", array($this->_table, $type)); + } + + public function count_by_uid($uid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE uid=%d", array($this->_table, $uid)); + } + + public function fetch_all_by_type($type) { + return DB::fetch_all("SELECT * FROM %t WHERE type=%d ORDER BY dateline", array($this->_table, $type), $this->_pk); + } + + public function fetch_all_lastmedal($limit) { + return DB::fetch_all("SELECT * FROM %t WHERE type<'2' ORDER BY dateline DESC LIMIT %d", array($this->_table, $limit), $this->_pk); + } + + public function fetch_all_by_expiration($expiration) { + return DB::fetch_all("SELECT * FROM %t WHERE status=1 AND expiration>0 AND expiration<%d", array($this->_table, $expiration)); + } + + public function fetch_all_by_uid($uid, $start, $limit) { + return DB::fetch_all("SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC LIMIT %d,%d", array($this->_table, $uid, $start, $limit)); + } + + public function update_type_by_uid_medalid($type, $uid, $medalid) { + $type = intval($type); + if(!$uid || !$medalid) { + return; + } + DB::update($this->_table, array('type' => $type), DB::field('uid', $uid).' AND '.DB::field('medalid', $medalid)); + } + + public function fetch_all_by_type_medalid($type, $medalid, $start_limit, $lpp) { + $where = array(); + if($type !== '') { + $where[] = DB::field('type', $type); + } + if($medalid !== '') { + $where[] = DB::field('medalid', $medalid); + } + $where = $where ? 'WHERE '.implode(' AND ', $where) : ''; + $start_limit = intval($start_limit); + $lpp = intval($lpp); + + return DB::fetch_all("SELECT * FROM ".DB::table('forum_medallog')." $where ORDER BY dateline DESC LIMIT $start_limit, $lpp"); + } + + public function count_by_type_medalid($type, $medalid) { + $where = array(); + if($type !== '') { + $where[] = DB::field('type', $type); + } + if($medalid !== '') { + $where[] = DB::field('medalid', $medalid); + } + $where = $where ? 'WHERE '.implode(' AND ', $where) : ''; + + return DB::result_first("SELECT COUNT(*) FROM ".DB::table('forum_medallog')." $where"); + } + + public function count_by_verify_medalid($uid, $medalid) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE uid=%d AND medalid=%d AND type=2", array($this->_table, $uid, $medalid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_memberrecommend.php b/source/class/table/table_forum_memberrecommend.php new file mode 100644 index 0000000..ca6edd7 --- /dev/null +++ b/source/class/table/table_forum_memberrecommend.php @@ -0,0 +1,34 @@ +_table = 'forum_memberrecommend'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_by_recommenduid_tid($uid, $tid) { + return DB::fetch_first('SELECT * FROM %t WHERE recommenduid=%d AND tid=%d', array($this->_table, $uid, $tid)); + } + + public function count_by_recommenduid_dateline($uid, $dateline) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE recommenduid=%d AND dateline>%d',array($this->_table, $uid, $dateline)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_moderator.php b/source/class/table/table_forum_moderator.php new file mode 100644 index 0000000..e51510d --- /dev/null +++ b/source/class/table/table_forum_moderator.php @@ -0,0 +1,106 @@ +_table = 'forum_moderator'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_fid($fid, $order = true) { + return DB::fetch_all('SELECT * FROM %t WHERE fid=%d'.($order ? ' ORDER BY inherited, displayorder' : ''), array($this->_table, $fid), 'uid'); + } + + public function fetch_all_by_fid_inherited($fid, $inherited = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE fid=%d AND inherited=%d', array($this->_table, $fid, $inherited), 'uid'); + } + + public function fetch_all_by_uid($uid) { + if(!$uid) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('uid', $uid)), 'fid'); + } + + public function fetch_all_by_uid_forum($uid) { + return DB::fetch_all('SELECT m.fid, f.name, f.recyclebin + FROM %t m, %t f + WHERE m.uid=%d AND f.fid=m.fid AND f.status=\'1\' AND f.type<>\'group\'', array($this->_table, 'forum_forum', $uid)); + } + + public function fetch_uid_by_fid_uid($fid, $uid) { + return DB::result_first('SELECT uid FROM %t WHERE fid=%d AND uid=%d', array($this->_table, $fid, $uid)); + } + + public function fetch_uid_by_tid($tid, $uid, $archiveid) { + $archiveid = dintval($archiveid); + $threadtable = $archiveid ? "forum_thread_{$archiveid}" : 'forum_thread'; + return DB::result_first('SELECT uid FROM %t m INNER JOIN %t t ON t.tid=%d AND t.fid=m.fid WHERE m.uid=%d', array($this->_table, $threadtable, $tid, $uid)); + } + + public function count_by_uid($uid) { + if(!$uid) { + return null; + } + return DB::result_first('SELECT count(*) FROM %t WHERE %i', array($this->_table, DB::field('uid', $uid))); + } + + public function fetch_all_no_inherited_by_fid($fid) { + return DB::fetch_all('SELECT * FROM %t WHERE fid=%d AND inherited=0 ORDER BY displayorder', array($this->_table, $fid), 'uid'); + } + + public function fetch_all_no_inherited() { + return DB::fetch_all('SELECT * FROM %t WHERE inherited=0 ORDER BY displayorder', array($this->_table)); + } + + public function update_by_fid_uid($fid, $uid, $data) { + if(!$fid || !$uid || !$data || !is_array($data)) { + return null; + } + return DB::update($this->_table, $data, array('fid' => $fid, 'uid' => $uid)); + } + public function delete_by_uid($uid) { + return $uid ? DB::delete($this->_table, DB::field('uid', $uid)) : false; + } + + public function delete_by_fid($fid) { + return $fid ? DB::delete($this->_table, DB::field('fid', $fid)) : false; + } + + public function delete_by_fid_inherited($fid, $inherited) { + return $fid ? DB::delete($this->_table, DB::field('fid', $fid).' AND '.DB::field('inherited', $inherited)) : false; + } + + public function delete_by_uid_fid_inherited($uid, $fid, $fidarray) { + if(!$fid || !$uid) { + return null; + } + $fid = dintval($fid); + $uid = dintval($uid); + $fidarray = array_map('addslashes', $fidarray); + return DB::delete($this->_table, "uid='$uid' AND ((fid='$fid' AND inherited='0') OR (fid IN (".dimplode($fidarray).") AND inherited='1'))"); + } + + public function delete_by_uid_fid($uid, $fid) { + if(!$fid || !$uid) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('fid', $fid).' AND '.DB::field('inherited', 1)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_modwork.php b/source/class/table/table_forum_modwork.php new file mode 100644 index 0000000..9e310fa --- /dev/null +++ b/source/class/table/table_forum_modwork.php @@ -0,0 +1,52 @@ +_table = 'forum_modwork'; + $this->_pk = ''; + + parent::__construct(); + } + + public function increase_count_posts_by_uid_modaction_dateline($count, $posts, $uid, $modaction, $dateline) { + return DB::query('UPDATE %t SET count=count+\'%d\', posts=posts+\'%d\' WHERE uid=%d AND modaction=%s AND dateline=%s', + array($this->_table, $count, $posts, $uid, $modaction, $dateline)); + } + + public function fetch_all_user_count_by_dateline($dateline) { + return DB::fetch_all('SELECT uid, SUM(count) AS actioncount FROM %t WHERE dateline>=%s GROUP BY uid', array($this->_table, $dateline)); + } + + public function fetch_all_by_uid_dateline($uid, $starttime, $endtime) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND dateline>=%s AND dateline<%s', array($this->_table, $uid, $starttime, $endtime)); + } + + public function fetch_all_user_count_posts_by_uid_dateline($uids, $starttime, $endtime) { + if(empty($uids)) { + return array(); + } + return DB::fetch_all('SELECT uid, modaction, SUM(count) AS count, SUM(posts) AS posts + FROM %t + WHERE '.DB::field('uid', $uids).' AND dateline>=%s AND dateline<%s GROUP BY uid, modaction', + array($this->_table, $starttime, $endtime)); + } + + public function delete_by_dateline($dateline) { + return DB::query('DELETE FROM %t WHERE dateline<%s', array($this->_table, $dateline)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_newthread.php b/source/class/table/table_forum_newthread.php new file mode 100644 index 0000000..4fdc6bf --- /dev/null +++ b/source/class/table/table_forum_newthread.php @@ -0,0 +1,42 @@ +_table = 'forum_newthread'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_all_by_fids($fids, $start = 0, $limit = 20) { + if(empty($fids)) { + return array(); + } + return DB::fetch_all("SELECT * FROM %t WHERE %i ORDER BY dateline DESC %i", array($this->_table, DB::field('fid', $fids), DB::limit($start, $limit)), 'tid'); + } + public function delete_by_fids($fids) { + return DB::delete($this->_table, DB::field('fid', $fids)); + } + + public function delete_by_tids($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } + + public function delete_by_dateline($timestamp) { + return DB::delete($this->_table, DB::field('dateline', $timestamp, '<')); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_onlinelist.php b/source/class/table/table_forum_onlinelist.php new file mode 100644 index 0000000..910eadd --- /dev/null +++ b/source/class/table/table_forum_onlinelist.php @@ -0,0 +1,47 @@ +_table = 'forum_onlinelist'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_all_order_by_displayorder() { + return DB::fetch_all('SELECT * FROM %t ORDER BY displayorder', array($this->_table)); + } + public function delete_all() { + DB::query('DELETE FROM %t', array($this->_table)); + } + + public function delete_by_groupid($groupid) { + $groupid = is_array($groupid) ? array_map('intval', (array)$groupid) : dintval($groupid); + if($groupid) { + return DB::delete($this->_table, DB::field('groupid', $groupid)); + } + return 0; + } + + public function update_by_groupid($groupid, $data) { + $groupid = is_array($groupid) ? array_map('intval', (array)$groupid) : dintval($groupid); + if($groupid && $data && is_array($data)) { + return DB::update($this->_table, $data, DB::field('groupid', $groupid)); + } + return 0; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_optionvalue.php b/source/class/table/table_forum_optionvalue.php new file mode 100644 index 0000000..98545c1 --- /dev/null +++ b/source/class/table/table_forum_optionvalue.php @@ -0,0 +1,161 @@ +_table = ''; + $this->_pk = ''; + + parent::__construct(); + } + + public function create($sortid, $fields, $dbcharset) { + if(!$sortid || !$fields || !$dbcharset) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + $query = DB::query("SHOW TABLES LIKE '%t'", array($this->_table)); + if(DB::num_rows($query) != 1) { + $engine = strtolower(getglobal("config/db/common/engine")) !== 'innodb' ? 'MyISAM' : 'InnoDB'; + $create_table_sql = "CREATE TABLE ".DB::table($this->_table)." ($fields) ENGINE=" . $engine . ";"; + $db = DB::object(); + $create_table_sql = $this->syntablestruct($create_table_sql, true, $dbcharset); + DB::query($create_table_sql); + } + } + + public function truncate($null = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->truncate_by_sortid($null); + } + } + + public function truncate_by_sortid($sortid) { + if(!$sortid) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + DB::query("TRUNCATE %t", array($this->_table)); + } + + public function showcolumns($sortid) { + if(!$sortid) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + $db = DB::object(); + $query = DB::query("SHOW FULL COLUMNS FROM %t", array($this->_table), true); + $tables = array(); + while($field = @DB::fetch($query)) { + $tables[$field['Field']] = 1; + } + return $tables; + } + + public function alter($sortid, $sql) { + if(!$sortid) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + DB::query("ALTER TABLE %t %i", array($this->_table, $sql)); + } + + public function drop($sortid) { + if(!$sortid) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + DB::query("DROP TABLE IF EXISTS %t", array($this->_table)); + } + + public function syntablestruct($sql, $version, $dbcharset) { + + if(strpos(trim(substr($sql, 0, 18)), 'CREATE TABLE') === FALSE) { + return $sql; + } + + $sqlversion = strpos($sql, 'ENGINE=') === FALSE ? FALSE : TRUE; + + if($sqlversion === $version) { + + return $sqlversion && $dbcharset ? preg_replace(array('/ character set \w+/i', '/ collate \w+/i', "/DEFAULT CHARSET=\w+/is"), array('', '', "DEFAULT CHARSET=$dbcharset"), $sql) : $sql; + } + + if($version) { + return preg_replace(array('/TYPE=HEAP/i', '/TYPE=(\w+)/is'), array("ENGINE=MEMORY DEFAULT CHARSET=$dbcharset", "ENGINE=\\1 DEFAULT CHARSET=$dbcharset"), $sql); + + } else { + return preg_replace(array('/character set \w+/i', '/collate \w+/i', '/ENGINE=MEMORY/i', '/\s*DEFAULT CHARSET=\w+/is', '/\s*COLLATE=\w+/is', '/ENGINE=(\w+)(.*)/is'), array('', '', 'ENGINE=HEAP', '', '', 'TYPE=\\1\\2'), $sql); + } + } + + public function fetch_all_tid($sortid, $where) { + if(!$sortid) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + $query = DB::query("SELECT tid FROM %t %i", array($this->_table, $where), true); + $return = array(); + while($thread = DB::fetch($query)) { + $return[] = $thread['tid']; + } + return $return; + } + + public function update($sortid, $tid, $fid = null, $fields = null) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->update_optionvalue($sortid, $tid, $fid, $fields); + } + } + + public function update_optionvalue($sortid, $tid, $fid, $fields) { + if(!$sortid || !$fields) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + DB::query("UPDATE %t SET %i WHERE tid=%d AND fid=%d", array($this->_table, $fields, $tid, $fid)); + } + + public function insert($sortid, $fields = null, $replace = false, $null = null) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->insert_optionvalue($sortid, $fields, $replace); + } + } + + public function insert_optionvalue($sortid, $fields, $replace = false) { + if(!$sortid || !$fields) { + return; + } + $sortid = intval($sortid); + $this->_table = 'forum_optionvalue'.$sortid; + DB::query("%i INTO %t %i", array(!$replace ? 'INSERT' : 'REPLACE', $this->_table, $fields)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_order.php b/source/class/table/table_forum_order.php new file mode 100644 index 0000000..1e852f6 --- /dev/null +++ b/source/class/table/table_forum_order.php @@ -0,0 +1,86 @@ +_table = 'forum_order'; + $this->_pk = 'orderid'; + + parent::__construct(); + } + + public function count_by_search($uid = null, $status = null, $orderid = null, $email = null, $username = null, $buyer = null, $admin = null, $submit_starttime = null, $submit_endtime = null, $confirm_starttime = null, $confirm_endtime = null) { + $sql = ''; + $sql .= $uid !== null ? ' AND o.'.DB::field('uid', dintval($uid)) : ''; + $sql .= $status ? ' AND o.'.DB::field('status', $status) : ''; + $sql .= $orderid ? ' AND o.'.DB::field('orderid', $orderid) : ''; + $sql .= $email ? ' AND o.'.DB::field('email', $email) : ''; + $sql .= $username ? ' AND m.'.DB::field('username', $username) : ''; + $sql .= $buyer ? ' AND o.'.DB::field('buyer', $buyer) : ''; + $sql .= $admin ? ' AND o.'.DB::field('admin', $admin) : ''; + $sql .= $submit_starttime ? ' AND o.'.DB::field('submitdate', $submit_starttime, '>=') : ''; + $sql .= $submit_endtime ? ' AND o.'.DB::field('submitdate', $submit_endtime, '<') : ''; + $sql .= $confirm_starttime ? ' AND o.'.DB::field('confirmdate', $confirm_starttime, '>=') : ''; + $sql .= $confirm_endtime ? ' AND o.'.DB::field('confirmdate', $confirm_endtime, '<') : ''; + return DB::result_first('SELECT COUNT(*) FROM %t o'.(($uid !== 0) ? ', '.DB::table('common_member').' m WHERE o.uid=m.uid' : ' WHERE 1 ').' %i', array($this->_table, $sql)); + } + + public function fetch_all_by_search($uid = null, $status = null, $orderid = null, $email = null, $username = null, $buyer = null, $admin = null, $submit_starttime = null, $submit_endtime = null, $confirm_starttime = null, $confirm_endtime = null, $start = null, $limit = null) { + $sql = ''; + $sql .= $uid !== null ? ' AND o.'.DB::field('uid', dintval($uid)) : ''; + $sql .= $status ? ' AND o.'.DB::field('status', $status) : ''; + $sql .= $orderid ? ' AND o.'.DB::field('orderid', $orderid) : ''; + $sql .= $email ? ' AND o.'.DB::field('email', $email) : ''; + $sql .= $username ? ' AND m.'.DB::field('username', $username) : ''; + $sql .= $buyer ? ' AND o.'.DB::field('buyer', $buyer) : ''; + $sql .= $admin ? ' AND o.'.DB::field('admin', $admin) : ''; + $sql .= $submit_starttime ? ' AND o.'.DB::field('submitdate', $submit_starttime, '>=') : ''; + $sql .= $submit_endtime ? ' AND o.'.DB::field('submitdate', $submit_endtime, '<') : ''; + $sql .= $confirm_starttime ? ' AND o.'.DB::field('confirmdate', $confirm_starttime, '>=') : ''; + $sql .= $confirm_endtime ? ' AND o.'.DB::field('confirmdate', $confirm_endtime, '<') : ''; + return DB::fetch_all('SELECT o.*'.(($uid !== 0) ? ', m.username' : '').' FROM %t o'.(($uid !== 0) ? ', '.DB::table('common_member').' m WHERE o.uid=m.uid' : ' WHERE 1 ').' %i ORDER BY o.submitdate DESC '.DB::limit($start, $limit), array($this->_table, $sql)); + } + + public function fetch_all($ids, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? '' : $force_from_db; + return $this->fetch_all_order($ids, $force_from_db); + } + } + + public function fetch_all_order($orderid, $status = '') { + if(empty($orderid)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('orderid', $orderid).' %i', array($this->_table, ($status ? ' AND '.DB::field('status', $status) : ''))); + } + + public function delete_by_submitdate($submitdate) { + return DB::query('DELETE FROM %t WHERE submitdate<%d', array($this->_table, $submitdate)); + } + + public function sum_amount_by_uid_submitdate_status($uid, $submitdate, $status) { + if(empty($status)) { + return 0; + } + return DB::result_first('SELECT SUM(amount) FROM %t WHERE uid=%d AND submitdate>=%d AND '.DB::field('status', $status), array($this->_table, $uid, $submitdate)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_poll.php b/source/class/table/table_forum_poll.php new file mode 100644 index 0000000..c0815cf --- /dev/null +++ b/source/class/table/table_forum_poll.php @@ -0,0 +1,31 @@ +_table = 'forum_poll'; + $this->_pk = 'tid'; + + parent::__construct(); + } + public function update_vote($tid, $num = 1) { + DB::query('UPDATE %t SET voters=voters+\'%d\' WHERE tid=%d', array($this->_table, $num, $tid), false, true); + } + public function delete_by_tid($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_polloption.php b/source/class/table/table_forum_polloption.php new file mode 100644 index 0000000..144612c --- /dev/null +++ b/source/class/table/table_forum_polloption.php @@ -0,0 +1,63 @@ +_table = 'forum_polloption'; + $this->_pk = 'polloptionid'; + + parent::__construct(); + } + public function update_vote($polloptionids, $voterids, $num = 1) { + DB::query('UPDATE %t SET votes=votes+\'%d\', voterids=CONCAT(voterids,%s) WHERE polloptionid IN (%n)', array($this->_table, $num, $voterids, $polloptionids), false, true); + } + public function fetch_all_by_tid($tids, $displayorder = 0, $limit = 0) { + $sqladd = ''; + if($displayorder) { + $sqladd = ' ORDER BY displayorder'; + } + if($limit) { + $sqladd .= ' LIMIT '.intval($limit); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('tid', $tids).$sqladd, array($this->_table)); + } + public function delete_safe_tid($tid, $polloptionid = 0) { + $sqladd = ''; + if($polloptionid) { + $sqladd = DB::field('polloptionid', intval($polloptionid)).' AND '; + } + DB::query("DELETE FROM %t WHERE $sqladd tid=%d", array($this->_table, $tid)); + } + + public function delete_by_tid($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } + + public function update_safe_tid($polloptionid, $tid, $displayorder, $polloption = '') { + $param = array($this->_table, $displayorder); + if($polloption) { + $sqladd = ', polloption=%s'; + $param[] = $polloption; + } + $param[] = $polloptionid; + $param[] = $tid; + DB::query('UPDATE %t SET displayorder=%d'.$sqladd.' WHERE polloptionid=%d AND tid=%d', $param); + } + public function fetch_count_by_tid($tid) { + return DB::fetch_first('SELECT MAX(votes) AS max, SUM(votes) AS total FROM %t WHERE tid=%d', array($this->_table, $tid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_polloption_image.php b/source/class/table/table_forum_polloption_image.php new file mode 100644 index 0000000..35e631f --- /dev/null +++ b/source/class/table/table_forum_polloption_image.php @@ -0,0 +1,45 @@ +_table = 'forum_polloption_image'; + $this->_pk = 'aid'; + parent::__construct(); + } + public function fetch_all_by_tid($tids) { + return DB::fetch_all('SELECT * FROM %t WHERE tid'.(is_array($tids) ? ' IN(%n)' : '=%d'), array($this->_table, $tids), 'poid'); + } + public function count_by_aid_uid($aid, $uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE aid=%d AND uid=%d', array($this->_table, $aid, $uid)); + } + public function delete_by_tid($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } + + public function clear() { + require_once libfile('function/forum'); + $deltids = array(); + $query = DB::query("SELECT tid, attachment, thumb FROM %t WHERE tid=0 AND dateline<=%d", array($this->_table, TIMESTAMP - 86400)); + while($attach = DB::fetch($query)) { + dunlink($attach); + $deltids[] = $attach['tid']; + } + if($deltids) { + $this->delete_by_tid($deltids); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_pollvoter.php b/source/class/table/table_forum_pollvoter.php new file mode 100644 index 0000000..201b53c --- /dev/null +++ b/source/class/table/table_forum_pollvoter.php @@ -0,0 +1,32 @@ +_table = 'forum_pollvoter'; + $this->_pk = ''; + + parent::__construct(); + } + public function delete_by_tid($tids) { + if(!$tids) { + return; + } + return DB::delete($this->_table, DB::field('tid', $tids)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_post.php b/source/class/table/table_forum_post.php new file mode 100644 index 0000000..9d7d7a9 --- /dev/null +++ b/source/class/table/table_forum_post.php @@ -0,0 +1,991 @@ +_table = 'forum_post'; + $this->_pk = 'pid'; + parent::__construct(); + } + + public static function get_tablename($tableid, $primary = 0) { + list($type, $tid) = explode(':', $tableid.':'); + if(!isset(self::$_tableid_tablename[$tableid])) { + if($type == 'tid') { + self::$_tableid_tablename[$tableid] = self::getposttablebytid($tid, $primary); + } else { + self::$_tableid_tablename[$tableid] = self::getposttable($type); + } + } + return self::$_tableid_tablename[$tableid]; + } + + public function count_author_by_tid($tid) { + return DB::result_first('SELECT count(DISTINCT authorid) FROM %t WHERE tid=%d', array(self::get_tablename('tid:'.$tid), $tid)); + } + + public function count_by_tid_dateline($tableid, $tid, $dateline) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d AND invisible=0 AND dateline<=%d', + array(self::get_tablename($tableid), $tid, $dateline)); + } + + public function fetch_maxposition_by_tid($tableid, $tid) { + return DB::result_first('SELECT position FROM %t WHERE tid=%d ORDER BY position DESC LIMIT 1', + array(self::get_tablename($tableid), $tid)); + } + public function fetch_all_by_tid_range_position($tableid, $tid, $start, $end, $maxposition, $ordertype = 0) { + $storeflag = false; + if($this->_allowmem) { + if($ordertype != 1 && $start == 1 && $maxposition > ($end - $start)) { + $data = $this->fetch_cache($tid, $this->_pre_cache_key.'tid_'); + if($data && count($data) == ($end - $start)) { + $delauthorid = $this->fetch_cache('delauthorid'); + $updatefid = $this->fetch_cache('updatefid'); + $delpid = $this->fetch_cache('delpid'); + foreach($data as $k => $post) { + if(in_array($post['pid'], $delpid) || $post['invisible'] < 0 || in_array($post['authorid'], $delauthorid)) { + $data[$k]['invisible'] = 0; + $data[$k]['authorid'] = 0; + $data[$k]['useip'] = ''; + $data[$k]['dateline'] = 0; + $data[$k]['pid'] = 0; + $data[$k]['message'] = lang('forum/misc', 'post_deleted'); + } + if(isset($updatefid[$post['fid']]) && $updatefid[$post['fid']]['dateline'] > $post['dateline']) { + $data[$k]['fid'] = $updatefid[$post['fid']]['fid']; + } + } + return $data; + } + $storeflag = true; + } + } + $data = DB::fetch_all('SELECT * FROM %t WHERE tid=%d AND position>=%d AND position<%d ORDER BY position'.($ordertype == 1 ? ' DESC' : ''), array(self::get_tablename($tableid), $tid, $start, $end), 'pid'); + if($storeflag) { + $this->store_cache($tid, $data, $this->_cache_ttl, $this->_pre_cache_key.'tid_'); + } + return $data; + } + public function fetch_all_by_tid_position($tableid, $tid, $position) { + return DB::fetch_all('SELECT * FROM %t WHERE tid=%d AND '.DB::field('position', $position), array(self::get_tablename($tableid), $tid)); + } + public function count_by_tid_invisible_authorid($tid, $authorid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d AND invisible=0 AND authorid=%d', + array(self::get_tablename('tid:'.$tid), $tid, $authorid)); + } + + public function count_visiblepost_by_tid($tid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d AND invisible=0', array(self::get_tablename('tid:'.$tid), $tid)); + } + + public function count_by_tid_pid($tid, $pid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d AND pid<%d', array(self::get_tablename('tid:'.$tid), $tid, $pid)); + } + + public function count_by_tid_authorid($tid, $authorid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d AND first=0 AND authorid=%d', array(self::get_tablename('tid:'.$tid), $tid, $authorid)); + } + + public function count_by_authorid($tableid, $authorid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE authorid=%d AND invisible=0', array(self::get_tablename($tableid), $authorid)); + } + + public function count_group_authorid_by_fid($tableid, $fid) { + return DB::fetch_all('SELECT COUNT(*) as num, authorid FROM %t WHERE fid=%d AND first=0 GROUP BY authorid', array(self::get_tablename($tableid), $fid)); + } + + public function count_by_first($tableid, $first) { + return DB::result_first('SELECT count(*) FROM %t WHERE %i', array(self::get_tablename($tableid), DB::field('first', $first))); + } + + public function count_by_invisible($tableid, $invisible) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE %i', array(self::get_tablename($tableid), DB::field('invisible', $invisible))); + } + + public function count_table($tableid) { + return DB::result_first('SELECT COUNT(*) FROM %t', array(self::get_tablename($tableid))); + } + + public function count_by_fid_invisible($tableid, $fid, $invisible) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE fid=%d AND invisible=%d', array(self::get_tablename($tableid), $fid, $invisible)); + } + + public function count_by_dateline($tableid, $dateline) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE dateline>=%d AND invisible=0', array(self::get_tablename($tableid), $dateline)); + } + + public function fetch($id, $force_from_db = false, $null = true) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->fetch_post($id, $force_from_db, $null); + } + } + + public function fetch_post($tableid, $pid, $outmsg = true) { + $post = DB::fetch_first('SELECT * FROM %t WHERE pid=%d', array(self::get_tablename($tableid), $pid)); + if(!$outmsg) { + unset($post['message']); + } + return $post; + } + + public function fetch_visiblepost_by_tid($tableid, $tid, $start = 0, $order = 0) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d AND invisible=0 ORDER BY dateline '. ($order ? 'DESC' : '').' '. DB::limit($start, 1), + array(self::get_tablename($tableid), $tid)); + } + + public function fetch_threadpost_by_tid_invisible($tid, $invisible = null) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d AND first=1'.($invisible !== null ? ' AND '.DB::field('invisible', $invisible) : ''), + array(self::get_tablename('tid:'.$tid), $tid)); + } + + public function fetch_pid_by_tid_authorid($tid, $authorid) { + return DB::result_first('SELECT pid FROM %t WHERE tid=%d AND authorid=%d LIMIT 1', array(self::get_tablename('tid:'.$tid), $tid, $authorid)); + } + + public function fetch_all_pid_by_tid($tid, $invisible = null) { + return DB::fetch_all('SELECT pid FROM %t WHERE tid=%d'.($invisible !== null ? ' AND '.DB::field('invisible', $invisible) : ''), array(self::get_tablename('tid:'.$tid), $tid), $this->_pk); + } + + public function fetch_pid_by_tid_clientip($tid, $clientip) { + return DB::result_first('SELECT pid FROM %t WHERE tid=%d AND authorid=0 AND useip=%s LIMIT 1', array(self::get_tablename('tid:'.$tid), $tid, $clientip)); + } + + public function fetch_attachment_by_tid($tid) { + return DB::result_first('SELECT attachment FROM %t WHERE tid=%d AND invisible=0 AND attachment>0 LIMIT 1', array(self::get_tablename('tid:'.$tid), $tid)); + } + + public function fetch_maxid($tableid) { + return DB::result_first('SELECT MAX(pid) FROM %t', array(self::get_tablename($tableid))); + } + + public function fetch_posts($tableid) { + return DB::fetch_first('SELECT COUNT(*) AS posts, (MAX(dateline)-MIN(dateline))/86400 AS runtime FROM %t', array(self::get_tablename($tableid))); + } + + public function fetch_by_pid_condition($tableid, $pid, $addcondiction = '', $fields = '*') { + return DB::fetch_first('SELECT %i FROM %t WHERE pid=%d %i LIMIT 1', + array($fields, self::get_tablename($tableid), $pid, $addcondiction)); + } + + public function fetch_all($ids, $force_from_db = false, $null = true) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->fetch_all_post($ids, $force_from_db, $null); + } + } + + public function fetch_all_post($tableid, $pids, $outmsg = true) { + $postlist = array(); + if($pids) { + $query = DB::query('SELECT * FROM %t WHERE %i', array(self::get_tablename($tableid), DB::field($this->_pk, $pids))); + while($post = DB::fetch($query)) { + if(!$outmsg) { + unset($post['message']); + } + $postlist[$post[$this->_pk]] = $post; + } + } + return $postlist; + } + + public function fetch_all_tradepost_viewthread_by_tid($tid, $visibleallflag, $authorid, $pids, $forum_pagebydesc, $ordertype, $start, $limit) { + if(empty($pids)) { + return array(); + } + $data = array(); + $parameter = $this->handle_viewthread_parameter($visibleallflag, $authorid, $forum_pagebydesc, $ordertype); + $query = DB::query('SELECT * FROM %t WHERE tid=%d'. + ($parameter['invisible'] ? ' AND '.$parameter['invisible'] : '').($parameter['authorid'] ? ' AND '.$parameter['authorid'] : ''). + ' AND pid NOT IN ('.dimplode($pids).')'. + ' '.$parameter['orderby']. + ' '.DB::limit($start, $limit), + array(self::get_tablename('tid:'.$tid), $tid)); + while($post = DB::fetch($query)) { + $data[$post['pid']] = $post; + } + return $data; + } + + public function fetch_all_debatepost_viewthread_by_tid($tid, $visibleallflag, $authorid, $stand, $forum_pagebydesc, $ordertype, $start, $limit) { + $data = array(); + $parameter = $this->handle_viewthread_parameter($visibleallflag, $authorid, $forum_pagebydesc, $ordertype, 'p.'); + $query = DB::query("SELECT dp.*, p.* FROM %t p LEFT JOIN %t dp ON p.pid=dp.pid WHERE p.tid=%d". + ($parameter['invisible'] ? ' AND '.$parameter['invisible'] : '').($parameter['authorid'] ? ' AND '.$parameter['authorid'] : ''). + (isset($stand) ? ($stand ? ' AND (dp.stand='.intval($stand).' OR p.first=1)' : ' AND (dp.stand=0 OR dp.stand IS NULL OR p.first=1)') : ''). + ' '.$parameter['orderby']. + ' '.DB::limit($start, $limit), + array(self::get_tablename('tid:'.$tid), 'forum_debatepost', $tid)); + while($post = DB::fetch($query)) { + $data[$post['pid']] = $post; + } + return $data; + } + + public function fetch_all_common_viewthread_by_tid($tid, $visibleallflag, $authorid, $forum_pagebydesc, $ordertype, $count, $start, $limit) { + $data = array(); + $storeflag = false; + if($this->_allowmem) { + if($ordertype != 1 && !$forum_pagebydesc && !$start && $count > $limit) { + $data = $this->fetch_cache($tid, $this->_pre_cache_key.'tid_'); + if($data && count($data) == $limit) { + $delauthorid = $this->fetch_cache('delauthorid'); + $updatefid = $this->fetch_cache('updatefid'); + $delpid = $this->fetch_cache('delpid'); + foreach($data as $k => $post) { + if(in_array($post['pid'], $delpid) || $post['invisible'] < 0 || in_array($post['authorid'], $delauthorid)) { + $data[$k]['invisible'] = 0; + $data[$k]['authorid'] = 0; + $data[$k]['useip'] = ''; + $data[$k]['dateline'] = 0; + $data[$k]['pid'] = 0; + $data[$k]['message'] =lang('forum/misc', 'post_deleted'); + } + if(isset($updatefid[$post['fid']]) && $updatefid[$post['fid']]['dateline'] > $post['dateline']) { + $data[$k]['fid'] = $updatefid[$post['fid']]['fid']; + } + } + return $data; + } + $storeflag = true; + } + } + $parameter = $this->handle_viewthread_parameter($visibleallflag, $authorid, $forum_pagebydesc, $ordertype); + $query = DB::query('SELECT * FROM %t WHERE tid=%d'. + ($parameter['invisible'] ? ' AND '.$parameter['invisible'] : '').($parameter['authorid'] ? ' AND '.$parameter['authorid'] : ''). + ' '.$parameter['orderby']. + ' '.DB::limit($start, $limit), + array(self::get_tablename('tid:'.$tid), $tid)); + while($post = DB::fetch($query)) { + $data[$post['pid']] = $post; + } + if($storeflag) { + $this->store_cache($tid, $data, $this->_cache_ttl, $this->_pre_cache_key.'tid_'); + } + return $data; + } + + private function handle_viewthread_parameter($visibleallflag, $authorid, $forum_pagebydesc, $ordertype, $alias = '') { + $return = array(); + if(!$visibleallflag) { + $return['invisible'] = $alias.DB::field('invisible', 0); + } + if($authorid) { + $return['authorid'] = $alias.DB::field('authorid', $authorid); + } + if($forum_pagebydesc) { + if($ordertype != 1) { + $return['orderby'] = 'ORDER BY '.$alias.'dateline DESC'; + } else { + $return['orderby'] = 'ORDER BY '.$alias.'dateline ASC'; + } + } else { + if($ordertype != 1) { + $return['orderby'] = 'ORDER BY '.$alias.'dateline'; + } else { + $return['orderby'] = 'ORDER BY '.$alias.'dateline DESC'; + } + } + return $return; + } + + public function fetch_all_by_authorid($tableid, $authorid, $outmsg = true, $order = '', $start = 0, $limit = 0, $first = null, $invisible = null, $fid = null, $filterfid = null) { + $postlist = $sql = array(); + if($first !== null && $invisible !== null) { + if($first == 1) { + $sql[] = DB::field('invisible', $invisible); + $sql[] = DB::field('first', 1); + } else { + $sql[] = DB::field('invisible', $invisible); + $sql[] = DB::field('first', 0); + } + } elseif($invisible !== null) { + $sql[] = DB::field('invisible', $invisible); + } elseif($first !== null) { + $sql[] = DB::field('first', $first); + } + if($fid !== null) { + $sql[] = DB::field('fid', $fid); + } + if($filterfid !== null) { + $filterfid = dintval($filterfid, true); + $sql[] = DB::field('fid', $filterfid, is_array($filterfid) ? 'notin' : '<>'); + } + $query = DB::query('SELECT * FROM %t WHERE '.DB::field('authorid', $authorid).' %i '.($order ? 'ORDER BY dateline '.$order : '').' '.DB::limit($start, $limit), + array(self::get_tablename($tableid), ($sql ? 'AND '.implode(' AND ', $sql) : ''))); + while($post = DB::fetch($query)) { + if(!$outmsg) { + unset($post['message']); + } + $postlist[$post[$this->_pk]] = $post; + } + return $postlist; + } + + public function fetch_all_tid_by_first($tableid, $first, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT tid FROM %t WHERE first=%d '.DB::limit($start, $limit), array(self::get_tablename($tableid), $first)); + } + + public function fetch_all_by_tid($tableid, $tids, $outmsg = true, $order = '', $start = 0, $limit = 0, $first = null, $invisible = null, $authorid = null, $fid = null) { + $postlist = $sql = array(); + if($first !== null && $invisible !== null) { + if($first == 1) { + $sql[] = DB::field('first', 1); + $sql[] = DB::field('invisible', $invisible); + } else { + $sql[] = DB::field('invisible', $invisible); + $sql[] = DB::field('first', 0); + } + } elseif($first !== null) { + $sql[] = DB::field('first', $first); + } elseif($invisible !== null) { + $sql[] = DB::field('invisible', $invisible); + } + if($authorid !== null) { + $sql[] = DB::field('authorid', $authorid); + } + if($fid !== null) { + $sql[] = DB::field('fid', $fid); + } + $query = DB::query('SELECT * FROM %t WHERE '.DB::field('tid', $tids).' %i '.($order ? 'ORDER BY dateline '.$order : '').' '.DB::limit($start, $limit), + array(self::get_tablename($tableid), ($sql ? 'AND '.implode(' AND ', $sql) : ''))); + while($post = DB::fetch($query)) { + if(!$outmsg) { + unset($post['message']); + } + $postlist[$post[$this->_pk]] = $post; + } + return $postlist; + } + + public function fetch_all_pid_by_tid_lastpid($tid, $lastpid, $round) { + return DB::fetch_all("SELECT pid FROM %t WHERE tid=%d AND pid>%d ORDER BY pid ASC %i", + array(self::get_tablename('tid:'.$tid), $tid, $lastpid, DB::limit(0, $round))); + } + + public function fetch_all_by_fid($tableid, $fid, $outmsg = true, $order = '', $start = 0, $limit = 0, $first = null, $invisible = null) { + $postlist = $sql = array(); + if($first !== null && $invisible !== null) { + if($first == 1) { + $sql[] = DB::field('first', 1); + $sql[] = DB::field('invisible', $invisible); + } else { + $sql[] = DB::field('invisible', $invisible); + $sql[] = DB::field('first', 0); + } + } elseif($first !== null) { + $sql[] = DB::field('first', $first); + } elseif($invisible !== null) { + $sql[] = DB::field('invisible', $invisible); + } + $query = DB::query('SELECT * FROM %t WHERE '.DB::field('fid', $fid).' %i '.($order ? 'ORDER BY dateline '.$order : '').' '.DB::limit($start, $limit), + array(self::get_tablename($tableid), ($sql ? 'AND '.implode(' AND ', $sql) : ''))); + while($post = DB::fetch($query)) { + if(!$outmsg) { + unset($post['message']); + } + $postlist[$post[$this->_pk]] = $post; + } + return $postlist; + } + + public function fetch_all_by_pid($tableid, $pids, $outmsg = true, $order = '', $start = 0, $limit = 0, $fid = null, $invisible = null) { + $postlist = $sql = array(); + if($fid !== null) { + $sql[] = DB::field('fid', $fid); + } + if($invisible !== null) { + $sql[] = DB::field('invisible', $invisible); + } + $query = DB::query('SELECT * FROM %t WHERE '.DB::field('pid', $pids).' %i '.($order ? 'ORDER BY dateline '.$order : '').' '.DB::limit($start, $limit), + array(self::get_tablename($tableid), ($sql ? 'AND '.implode(' AND ', $sql) : ''))); + while($post = DB::fetch($query)) { + if(!$outmsg) { + unset($post['message']); + } + $postlist[$post[$this->_pk]] = $post; + } + return $postlist; + } + + public function fetch_all_debatepost_by_tid_stand($tid, $stand, $start, $limit) { + return DB::fetch_all(' + SELECT author, authorid + FROM %t p, %t dp + WHERE p.tid=%d AND p.anonymous=0 AND p.invisible=0 AND dp.stand=%d AND p.pid=dp.pid + ORDER BY p.dateline DESC %i', + array(self::get_tablename('tid:'.$tid), 'forum_debatepost', $tid, $stand, DB::limit($start, $limit))); + } + + public function fetch_all_visiblepost_by_tid_groupby_authorid($tableid, $tid) { + return DB::fetch_all('SELECT pid, tid, authorid, subject, dateline FROM %t WHERE tid=%d AND invisible=0 GROUP BY authorid ORDER BY dateline', + array(self::get_tablename($tableid), $tid)); + } + + public function fetch_all_visiblepost_by_tid($tableid, $tid) { + return DB::fetch_all('SELECT * FROM %t WHERE tid=%d AND invisible=0', array(self::get_tablename($tableid), $tid)); + } + + public function fetch_all_pid_by_invisible_dateline($tableid, $invisible, $dateline, $start, $limit) { + return DB::fetch_all('SELECT pid FROM %t WHERE invisible=%d AND dateline<%d %i', array(self::get_tablename($tableid), $invisible, $dateline, DB::limit($start, $limit))); + } + + public function fetch_all_top_post_author($tableid, $timelimit, $num) { + return DB::fetch_all('SELECT DISTINCT(author) AS username, authorid AS uid, COUNT(pid) AS posts + FROM %t + WHERE dateline>=%d AND invisible=0 AND authorid>0 + GROUP BY author + ORDER BY posts DESC %i', + array(self::get_tablename($tableid), $timelimit, DB::limit(0, $num))); + } + + public function fetch_all_author_posts_by_dateline($tableid, $authorid, $dateline) { + return DB::fetch_all('SELECT authorid, COUNT(*) AS posts FROM %t + WHERE dateline>=%d AND %i AND invisible=0 GROUP BY authorid', array(self::get_tablename($tableid), $dateline, DB::field('authorid', $authorid))); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false, $null1 = false, $null2 = null, $null3 = null, $null4 = null, $null5 = null) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->update_post($val, $data, $unbuffered, $low_priority, $null1, $null2, $null3, $null4, $null5); + } + } + + public function update_post($tableid, $pid, $data, $unbuffered = false, $low_priority = false, $first = null, $invisible = null, $fid = null, $status = null) { + $where = array(); + $where[] = DB::field('pid', $pid); + if($first !== null) { + $where[] = DB::field('first', $first); + } + if($invisible !== null) { + $where[] = DB::field('invisible', $invisible); + } + if($status !== null) { + $where[] = DB::field('status', $status); + } + if($fid !== null) { + $where[] = DB::field('fid', $fid); + } + $return = DB::update(self::get_tablename($tableid), $data, implode(' AND ', $where), $unbuffered, $low_priority); + if($return && $this->_allowmem) { + $this->update_cache($tableid, $pid, 'pid', $data, array('invisible' => $invisible, 'first' => $first, 'fid' => $fid, 'status' => $status)); + } + return $return; + } + + public function update_by_tid($tableid, $tid, $data, $unbuffered = false, $low_priority = false, $first = null, $invisible = null, $status = null) { + $where = array(); + $where[] = DB::field('tid', $tid); + if($first !== null) { + $where[] = DB::field('first', $first); + } + if($invisible !== null) { + $where[] = DB::field('invisible', $invisible); + } + if($status !== null) { + $where[] = DB::field('status', $status); + } + $return = DB::update(self::get_tablename($tableid), $data, implode(' AND ', $where), $unbuffered, $low_priority); + if($return && $this->_allowmem) { + $this->update_cache(0, $tid, 'tid', $data, array('first' => $first, 'invisible' => $invisible, 'status' => $status)); + } + return $return; + } + + public function update_fid_by_fid($tableid, $fid, $newfid, $unbuffered = false, $low_priority = false) { + $where = array(); + $where[] = DB::field('fid', $fid); + $return = DB::update(self::get_tablename($tableid), array('fid' => $newfid), implode(' AND ', $where), $unbuffered, $low_priority); + if($return && $this->_allowmem) { + $updatefid = $this->fetch_cache('updatefid'); + $updatefid[$fid] = array('fid' => $newfid, 'dateline' => TIMESTAMP); + $this->store_cache('updatefid', $updatefid); + } + return $return; + } + + public function update_cache($val, $data, $unbuffered = false, $low_priority = false, $null1 = array(), $null2 = 'merge') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->update_cache_post($val, $data, $unbuffered, $low_priority, $null1, $null2); + } + } + + public function update_cache_post($tableid, $id, $idtype, $data, $condition = array(), $glue = 'merge') { + if(!$this->_allowmem) return; + + if($idtype == 'tid') { + $memorydata = $this->fetch_cache($id, $this->_pre_cache_key.'tid_'); + if(!$memorydata) { + return; + } + if(!is_array($id)) { + $memorydata = array($id => $memorydata); + $id = (array)$id; + } + foreach($id as $v) { + if(!$memorydata[$v]) { + continue; + } + foreach($memorydata[$v] as $pid => $post) { + $updateflag = true; + if($condition) { + foreach($condition as $ck => $cv) { + if($cv !== null && !in_array($post[$ck], (array)$cv)) { + $updateflag = false; + break; + } + } + } + if($updateflag) { + if($glue == 'merge') { + $memorydata[$v][$pid] = array_merge($post, $data); + } else { + foreach($data as $dk => $dv) { + $memorydata[$v][$pid][$dk] = helper_util::compute($memorydata[$v][$pid][$dk], $dv, $glue); + } + } + } + } + $this->store_cache($v, $memorydata[$v], $this->_cache_ttl, $this->_pre_cache_key.'tid_'); + } + } elseif($idtype == 'pid') { + $memorytid = array(); + $query = DB::query('SELECT pid, tid FROM %t WHERE '.DB::field('pid', $id), array(self::get_tablename($tableid))); + while($post = DB::fetch($query)) { + $memorytid[$post['pid']] = $post['tid']; + } + $memorydata = $this->fetch_cache($memorytid, $this->_pre_cache_key.'tid_'); + if(!$memorydata) { + return; + } + if(!is_array($id)) { + $id = (array)$id; + } + foreach($id as $v) { + if($memorydata[$memorytid[$v]][$v]) { + $updateflag = true; + if($condition) { + foreach($condition as $ck => $cv) { + if($cv !== null && !in_array($memorydata[$memorytid[$v]][$v][$ck], (array)$cv)) { + $updateflag = false; + break; + } + } + } + if($updateflag) { + if($glue == 'merge') { + $memorydata[$memorytid[$v]][$v] = array_merge($memorydata[$memorytid[$v]][$v], $data); + } else { + foreach($data as $dk => $dv) { + $memorydata[$memorytid[$v]][$v][$dk] = helper_util::compute($memorydata[$memorytid[$v]][$v][$dk], $dv, $glue); + } + } + } + } + } + foreach($memorydata as $tid => $postlist) { + $this->store_cache($tid, $postlist, $this->_cache_ttl, $this->_pre_cache_key.'tid_'); + } + } elseif($idtype == 'fid') { + + } + } + + public function concat_threadtags_by_tid($tid, $tags) { + $return = DB::query('UPDATE %t SET tags=concat(tags, %s) WHERE tid=%d AND first=1', array(self::get_tablename('tid:'.$tid), $tags, $tid)); + if($return && $this->_allowmem) { + $this->update_cache(0, $tid, 'tid', array('tags' => $tags), array('first' => 1), '.'); + } + return $return; + } + + + public function increase_rate_by_pid($tableid, $pid, $rate, $ratetimes) { + $return = DB::query('UPDATE %t SET rate=rate+\'%d\', ratetimes=ratetimes+\'%d\' WHERE pid=%d', + array(self::get_tablename($tableid), $rate, $ratetimes, $pid)); + if($return && $this->_allowmem) { + $this->update_cache($tableid, $pid, 'pid', array('rate' => $rate, 'ratetimes' => $ratetimes), array(), '+'); + } + return $return; + } + public function increase_position_by_tid($tableid, $tid, $position) { + $return = DB::query('UPDATE %t SET position=position+\'%d\' WHERE '.DB::field('tid', $tid), + array(self::get_tablename($tableid), $position)); + return $return; + } + + public function increase_status_by_pid($tableid, $pid, $status, $glue, $unbuffered = false) { + $return = DB::query('UPDATE %t SET %i WHERE %i', array(self::get_tablename($tableid), DB::field('status', $status, $glue), DB::field('pid', $pid)), $unbuffered); + if($return && $this->_allowmem) { + $this->update_cache($tableid, $pid, 'pid', array('status' => $status), array(), $glue); + } + return $return; + } + + + private function _insert_use_db($tableid, $data, $return_insert_id = false, $replace = false, $silent = false) { + $tablename = self::get_tablename($tableid); + foreach (range(1, 5) as $try_count) { + try { + $data['position'] = $this->_next_pos_from_db($tablename, $data['tid']); + $ret = DB::insert($tablename, $data, $return_insert_id, $replace, $silent); + return $ret; + } catch (Exception $e) { + if ($try_count >= 2) usleep(mt_rand(2, 6) * 10000); + if ($try_count >= 3 && $try_count <= 4) usleep(mt_rand(4, 6) * 10000); + if ($try_count === 5) throw $e; + } + } + } + + private function _next_pos_from_db($tablename, $tid) { + return DB::result_first("SELECT IFNULL(MAX(position), 0) + 1 FROM " . DB::table($tablename) . " WHERE tid = " . $tid); + } + + private function _next_pos_from_memory($key) { + return memory('incex', $key, 1, 0, ""); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->insert_post($data, $return_insert_id, $replace, $silent, $null); + } + } + + public function insert_post($tableid, $data, $return_insert_id = false, $replace = false, $silent = false) { + if (strtolower(getglobal("config/db/common/engine")) !== 'innodb') { + return DB::insert(self::get_tablename($tableid), $data, $return_insert_id, $replace, $silent); + } + $tablename = self::get_tablename($tableid); + + $mc = strtolower(memory('check')); + if ($mc !== 'memcache' && $mc !== 'redis' && $mc !== 'memcached') { + return $this->_insert_use_db($tableid, $data, $return_insert_id, $replace, $silent); + } + + $memory_position_key = "forum_post_position_" . $data['tid']; + $next_pos = $this->_next_pos_from_memory($memory_position_key); + + if (!$next_pos) { + $next_pos = $this->_next_pos_from_db($tablename, $data['tid']); + if (!memory('add', $memory_position_key, $next_pos, 259200 /* 3天 */)) { + $next_pos = $this->_next_pos_from_memory($memory_position_key); + if (!$next_pos) { + memory('rm', $memory_position_key); + return $this->_insert_use_db($tableid, $data, $return_insert_id, $replace, $silent); + } + } + } + foreach (range(1, 3) as $try_count) { + $data['position'] = $next_pos; + try { + $ret = DB::insert($tablename, $data, $return_insert_id, $replace, $silent); + return $ret; + } catch (Exception $e) { + $next_pos = $this->_next_pos_from_memory($memory_position_key); + if (!$next_pos || $try_count === 3) { + memory('rm', $memory_position_key); + return $this->_insert_use_db($tableid, $data, $return_insert_id, $replace, $silent); + } + } + } + } + + public function delete($val, $unbuffered = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception("UnsupportedOperationException"); + } else { + return $this->delete_post($val, $unbuffered, $null); + } + } + + public function delete_post($tableid, $pid, $unbuffered = false) { + $return = DB::delete(self::get_tablename($tableid), DB::field($this->_pk, $pid), 0, $unbuffered); + if($return && $this->_allowmem) { + $delpid = $this->fetch_cache('delpid'); + $this->store_cache('delpid', array_merge((array)$pid, (array)$delpid)); + } + return $return; + } + + public function delete_by_tid($tableid, $tids, $unbuffered = false) { + $return = DB::delete(self::get_tablename($tableid), DB::field('tid', $tids), 0, $unbuffered); + if($return && $this->_allowmem) { + $this->clear_cache($tids, $this->_pre_cache_key.'tid_'); + } + return $return; + } + + public function delete_by_authorid($tableid, $authorids, $unbuffered = false) { + $return = DB::delete(self::get_tablename($tableid), DB::field('authorid', $authorids), 0, $unbuffered); + if($return && $this->_allowmem) { + $delauthorid = $this->fetch_cache('delauthorid'); + $this->store_cache('delauthorid', array_merge((array)$authorids, (array)$delauthorid)); + } + return $return; + } + + public function delete_by_fid($tableid, $fids, $unbuffered = false) { + return DB::delete(self::get_tablename($tableid), DB::field('fid', $fids), 0, $unbuffered); + } + + public function show_table() { + return DB::fetch_all("SHOW TABLES LIKE '".DB::table('forum_post')."\_%'"); + } + + public function show_table_by_tableid($tableid) { + return DB::fetch_first('SHOW CREATE TABLE %t', array(self::get_tablename($tableid))); + } + + public function drop_table($tableid) { + return ($tableid = dintval($tableid)) ? DB::query('DROP TABLE %t', array(self::get_tablename($tableid))) : false; + } + + public function optimize_table($tableid) { + return DB::query('OPTIMIZE TABLE %t', array(self::get_tablename($tableid)), true); + } + + public function move_table($tableid, $fieldstr, $fromtable, $tid) { + $tidsql = is_array($tid) ? 'tid IN(%n)' : 'tid=%d'; + return DB::query("INSERT INTO %t ($fieldstr) SELECT $fieldstr FROM $fromtable WHERE $tidsql", array(self::get_tablename($tableid), $tid), true); + } + + public function count_by_search($tableid, $tid = null, $keywords = null, $invisible =null, $fid = null, $authorid = null, $author = null, $starttime = null, $endtime = null, $useip = null, $first = null) { + $sql = ''; + $sql .= $tid ? ' AND '.DB::field('tid', $tid) : ''; + $sql .= $authorid !== null ? ' AND '.DB::field('authorid', $authorid) : ''; + $sql .= $invisible !== null ? ' AND '.DB::field('invisible', $invisible) : ''; + $sql .= $first !== null ? ' AND '.DB::field('first', $first) : ''; + $sql .= $fid ? ' AND '.DB::field('fid', $fid) : ''; + $sql .= $author ? ' AND '.DB::field('author', $author) : ''; + $sql .= $starttime ? ' AND '.DB::field('dateline', $starttime, '>=') : ''; + $sql .= $endtime ? ' AND '.DB::field('dateline', $endtime, '<') : ''; + $sql .= $useip ? ' AND '.DB::field('useip', $useip, 'like') : ''; + if(trim($keywords)) { + $sqlkeywords = $or = ''; + foreach(explode(',', str_replace(' ', '', $keywords)) as $keyword) { + $keyword = addslashes($keyword); + $sqlkeywords .= " $or message LIKE '%$keyword%'"; + $or = 'OR'; + } + $sql .= " AND ($sqlkeywords)"; + } + if($sql) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE 1 %i', array(self::get_tablename($tableid), $sql)); + } else { + return 0; + } + } + + public function fetch_all_by_search($tableid, $tid = null, $keywords = null, $invisible = null, $fid = null, $authorid = null, $author = null, $starttime = null, $endtime = null, $useip = null, $first = null, $start = null, $limit = null) { + $sql = ''; + $sql .= $tid ? ' AND '.DB::field('tid', $tid) : ''; + $sql .= $authorid ? ' AND '.DB::field('authorid', $authorid) : ''; + $sql .= $invisible !== null ? ' AND '.DB::field('invisible', $invisible) : ''; + $sql .= $first !== null ? ' AND '.DB::field('first', $first) : ''; + $sql .= $fid ? ' AND '.DB::field('fid', $fid) : ''; + $sql .= $author ? ' AND '.DB::field('author', $author) : ''; + $sql .= $starttime ? ' AND '.DB::field('dateline', $starttime, '>=') : ''; + $sql .= $endtime ? ' AND '.DB::field('dateline', $endtime, '<') : ''; + $sql .= $useip ? ' AND '.DB::field('useip', $useip, 'like') : ''; + if(trim($keywords)) { + $sqlkeywords = $or = ''; + foreach(explode(',', str_replace(' ', '', $keywords)) as $keyword) { + $keyword = addslashes($keyword); + $sqlkeywords .= " $or message LIKE '%$keyword%'"; + $or = 'OR'; + } + $sql .= " AND ($sqlkeywords)"; + } + if($sql) { + return DB::fetch_all('SELECT * FROM %t WHERE 1 %i ORDER BY dateline DESC %i', array(self::get_tablename($tableid), $sql, DB::limit($start, $limit))); + } else { + return array(); + } + } + + public function count_prune_by_search($tableid, $isgroup = null, $keywords = null, $message_length = null, $fid = null, $authorid = null, $starttime = null, $endtime = null, $useip = null) { + $sql = ''; + $sql .= $fid ? ' AND p.'.DB::field('fid', $fid) : ''; + $sql .= $isgroup ? ' AND t.'.DB::field('isgroup', $isgroup) : ''; + $sql .= $authorid !== null ? ' AND p.'.DB::field('authorid', $authorid) : ''; + $sql .= $starttime ? ' AND p.'.DB::field('dateline', $starttime, '>=') : ''; + $sql .= $endtime ? ' AND p.'.DB::field('dateline', $endtime, '<') : ''; + $sql .= $useip ? ' AND p.'.DB::field('useip', $useip, 'like') : ''; + $sql .= $message_length !== null ? ' AND LENGTH(p.message) < '.intval($message_length) : ''; + if(trim($keywords)) { + $sqlkeywords = ''; + $or = ''; + $keywords = explode(',', str_replace(' ', '', $keywords)); + for($i = 0; $i < count($keywords); $i++) { + if(preg_match("/\{(\d+)\}/", $keywords[$i])) { + $keywords[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($keywords[$i], '/')); + $sqlkeywords .= " $or p.subject REGEXP '".$keywords[$i]."' OR p.message REGEXP '".addslashes(stripsearchkey($keywords[$i]))."'"; + } else { + $keywords[$i] = addslashes($keywords[$i]); + $sqlkeywords .= " $or p.subject LIKE '%".$keywords[$i]."%' OR p.message LIKE '%".$keywords[$i]."%'"; + } + $or = 'OR'; + } + $sql .= " AND ($sqlkeywords)"; + } + if($sql) { + if($isgroup) { + return DB::result_first('SELECT COUNT(*) + FROM %t p LEFT JOIN %t t USING(tid) + WHERE 1 %i', array(self::get_tablename($tableid), 'forum_thread', $sql)); + } else { + return DB::result_first('SELECT COUNT(*) + FROM %t p + WHERE 1 %i', array(self::get_tablename($tableid), $sql)); + } + } else { + return 0; + } + } + + public function fetch_all_new_post_by_pid($pid, $start = 0, $limit = 0, $tableid = 0, $glue = '>', $sort = 'ASC') { + return $limit ? DB::fetch_all('SELECT * FROM '.DB::table($this->get_tablename($tableid)). + ' WHERE '.DB::field('pid', $pid, $glue). + ' ORDER BY '.DB::order('pid', $sort). + DB::limit($start, $limit), $this->_pk) : array(); + } + public function fetch_all_prune_by_search($tableid, $isgroup = null, $keywords = null, $message_length = null, $fid = null, $authorid = null, $starttime = null, $endtime = null, $useip = null, $outmsg = true, $start = null, $limit = null) { + $sql = ''; + $sql .= $fid ? ' AND p.'.DB::field('fid', $fid) : ''; + $sql .= $isgroup ? ' AND t.'.DB::field('isgroup', $isgroup) : ''; + $sql .= $authorid !== null ? ' AND p.'.DB::field('authorid', $authorid) : ''; + $sql .= $starttime ? ' AND p.'.DB::field('dateline', $starttime, '>=') : ''; + $sql .= $endtime ? ' AND p.'.DB::field('dateline', $endtime, '<') : ''; + $sql .= $useip ? ' AND p.'.DB::field('useip', $useip, 'like') : ''; + $sql .= $message_length !== null ? ' AND LENGTH(p.message) < '.intval($message_length) : ''; + $postlist = array(); + if(trim($keywords)) { + $sqlkeywords = ''; + $or = ''; + $keywords = explode(',', str_replace(' ', '', $keywords)); + for($i = 0; $i < count($keywords); $i++) { + if(preg_match("/\{(\d+)\}/", $keywords[$i])) { + $keywords[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($keywords[$i], '/')); + $sqlkeywords .= " $or p.subject REGEXP '".$keywords[$i]."' OR p.message REGEXP '".addslashes(stripsearchkey($keywords[$i]))."'"; + } else { + $keywords[$i] = addslashes($keywords[$i]); + $sqlkeywords .= " $or p.subject LIKE '%".$keywords[$i]."%' OR p.message LIKE '%".$keywords[$i]."%'"; + } + $or = 'OR'; + } + $sql .= " AND ($sqlkeywords)"; + } + if($sql) { + if($isgroup) { + $query = DB::query('SELECT p.*, t.* + FROM %t p LEFT JOIN %t t USING(tid) + WHERE 1 %i %i', array(self::get_tablename($tableid), 'forum_thread', $sql, DB::limit($start, $limit))); + } else { + $query = DB::query('SELECT * + FROM %t p + WHERE 1 %i %i', array(self::get_tablename($tableid), $sql, DB::limit($start, $limit))); + } + while($post = DB::fetch($query)) { + if(!$outmsg) { + unset($post['message']); + } + $postlist[$post[$this->_pk]] = $post; + } + } + return $postlist; + } + + + public static function getposttablebytid($tids, $primary = 0) { + + $isstring = false; + if(!is_array($tids)) { + $thread = getglobal('thread'); + if(!empty($thread) && isset($thread['posttableid']) && $tids == $thread['tid']) { + return 'forum_post'.(empty($thread['posttableid']) ? '' : '_'.$thread['posttableid']); + } + $tids = array(intval($tids)); + $isstring = true; + } + $tids = array_unique($tids); + $tids = array_flip($tids); + if(!$primary) { + loadcache('threadtableids'); + $threadtableids = getglobal('threadtableids', 'cache'); + empty($threadtableids) && $threadtableids = array(); + if(!in_array(0, $threadtableids)) { + $threadtableids = array_merge(array(0), $threadtableids); + } + } else { + $threadtableids = array(0); + } + $tables = array(); + $posttable = ''; + foreach($threadtableids as $tableid) { + $threadtable = $tableid ? "forum_thread_$tableid" : 'forum_thread'; + $query = DB::query("SELECT tid, posttableid FROM ".DB::table($threadtable)." WHERE tid IN(".dimplode(array_keys($tids)).")"); + while ($value = DB::fetch($query)) { + $posttable = 'forum_post'.($value['posttableid'] ? "_{$value['posttableid']}" : ''); + $tables[$posttable][$value['tid']] = $value['tid']; + unset($tids[$value['tid']]); + } + if(!count($tids)) { + break; + } + } + if(empty($posttable)) { + $posttable = 'forum_post'; + $tables[$posttable] = array_flip($tids); + } + return $isstring ? $posttable : $tables; + } + public function show_table_columns($table) { + $data = array(); + $db = &DB::object(); + $query = $db->query("SHOW FULL COLUMNS FROM ".DB::table($table), 'SILENT'); + while($field = @DB::fetch($query)) { + $data[$field['Field']] = $field; + } + return $data; + } + + public static function getposttable($tableid = 0, $prefix = false) { + global $_G; + $tableid = intval($tableid); + if($tableid) { + loadcache('posttableids'); + $tableid = $_G['cache']['posttableids'] && in_array($tableid, $_G['cache']['posttableids']) ? $tableid : 0; + $tablename = 'forum_post'.($tableid ? "_$tableid" : ''); + } else { + $tablename = 'forum_post'; + } + if($prefix) { + $tablename = DB::table($tablename); + } + return $tablename; + } + +} +?> \ No newline at end of file diff --git a/source/class/table/table_forum_post_location.php b/source/class/table/table_forum_post_location.php new file mode 100644 index 0000000..5ff40ea --- /dev/null +++ b/source/class/table/table_forum_post_location.php @@ -0,0 +1,35 @@ +_table = 'forum_post_location'; + $this->_pk = 'pid'; + $this->_pre_cache_key = 'forum_post_location_'; + $this->_cache_ttl = 0; + + parent::__construct(); + } + + public function delete_by_uid($uid) { + return $uid ? DB::delete($this->_table, DB::field('uid', $uid)) : false; + } + + public function delete_by_tid($tid) { + return $tid ? DB::delete($this->_table, DB::field('tid', $tid)) : false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_post_tableid.php b/source/class/table/table_forum_post_tableid.php new file mode 100644 index 0000000..5e7c492 --- /dev/null +++ b/source/class/table/table_forum_post_tableid.php @@ -0,0 +1,37 @@ +_table = 'forum_post_tableid'; + $this->_pk = 'pid'; + + parent::__construct(); + } + + public function alter_auto_increment($auto_increment) { + return DB::query("ALTER TABLE %t AUTO_INCREMENT=%d", array($this->_table, $auto_increment)); + } + + public function delete_by_lesspid($pid) { + return DB::query("DELETE FROM %t WHERE pid<%d", array($this->_table, $pid)); + } + + public function fetch_max_id() { + return DB::result_first('SELECT MAX(pid) FROM '.DB::table($this->_table)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_postcache.php b/source/class/table/table_forum_postcache.php new file mode 100644 index 0000000..2a719db --- /dev/null +++ b/source/class/table/table_forum_postcache.php @@ -0,0 +1,30 @@ +_table = 'forum_postcache'; + $this->_pk = 'pid'; + $this->_pre_cache_key = 'forum_postcache_'; + + parent::__construct(); + } + + public function delete_by_dateline($dateline) { + return DB::delete($this->_table, DB::field('dateline', $dateline, '<')); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_postcomment.php b/source/class/table/table_forum_postcomment.php new file mode 100644 index 0000000..b846990 --- /dev/null +++ b/source/class/table/table_forum_postcomment.php @@ -0,0 +1,179 @@ +_table = 'forum_postcomment'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function count_by_authorid($authorid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE authorid=%d', array($this->_table, $authorid)); + } + + public function count_by_pid($pid, $authorid = null, $score = null) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE pid=%d '.($authorid ? ' AND '.DB::field('authorid', $authorid) : null).($score ? ' AND '.DB::field('score', $score) : null), array($this->_table, $pid, $authorid, $score)); + } + + public function count_by_tid($tid, $authorid = null, $score = null) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d '.($authorid ? ' AND '.DB::field('authorid', $authorid) : null).($score ? ' AND '.DB::field('score', $score) : null), array($this->_table, $tid, $authorid, $score)); + } + + public function count_by_search($tid = null, $pid = null, $authorid = null, $starttime = null, $endtime = null, $ip = null, $message = null) { + $sql = ''; + $tid && $sql .= ' AND '.DB::field('tid', $tid); + $pid && $sql .= ' AND '.DB::field('pid', $pid); + $authorid && $sql .= ' AND '.DB::field('authorid', $authorid); + $starttime && $sql .= ' AND '.DB::field('dateline', $starttime, '>='); + $endtime && $sql .= ' AND '.DB::field('dateline', $endtime, '<'); + $ip && $sql .= ' AND '.DB::field('useip', str_replace('*', '%', $ip), 'like'); + if($message) { + $sqlmessage = ''; + $or = ''; + $message = explode(',', str_replace(' ', '', $message)); + + for($i = 0; $i < count($message); $i++) { + if(preg_match("/\{(\d+)\}/", $message[$i])) { + $message[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($message[$i], '/')); + $sqlmessage .= " $or comment REGEXP '".$message[$i]."'"; + } else { + $sqlmessage .= " $or ".DB::field('comment', '%'.$message[$i].'%', 'like'); + } + $or = 'OR'; + } + $sql .= " AND ($sqlmessage)"; + } + return DB::result_first('SELECT COUNT(*) FROM %t WHERE authorid>-1 %i', array($this->_table, $sql)); + } + + public function fetch_all_by_search($tid = null, $pid = null, $authorid = null, $starttime = null, $endtime = null, $ip = null, $message = null, $start = null, $limit = null) { + $sql = ''; + $tid && $sql .= ' AND '.DB::field('tid', $tid); + $pid && $sql .= ' AND '.DB::field('pid', $pid); + $authorid && $sql .= ' AND '.DB::field('authorid', $authorid); + $starttime && $sql .= ' AND '.DB::field('dateline', $starttime, '>='); + $endtime && $sql .= ' AND '.DB::field('dateline', $endtime, '<'); + $ip && $sql .= ' AND '.DB::field('useip', str_replace('*', '%', $ip), 'like'); + if($message) { + $sqlmessage = ''; + $or = ''; + $message = explode(',', str_replace(' ', '', $message)); + + for($i = 0; $i < count($message); $i++) { + if(preg_match("/\{(\d+)\}/", $message[$i])) { + $message[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($message[$i], '/')); + $sqlmessage .= " $or comment REGEXP '".$message[$i]."'"; + } else { + $sqlmessage .= " $or ".DB::field('comment', '%'.$message[$i].'%', 'like'); + } + $or = 'OR'; + } + $sql .= " AND ($sqlmessage)"; + } + return DB::fetch_all('SELECT * FROM %t WHERE authorid>-1 %i ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $sql)); + } + + public function fetch_all_by_authorid($authorid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE authorid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $authorid)); + } + + public function fetch_all_by_pid($pids) { + if(empty($pids)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('pid', $pids).' ORDER BY dateline DESC', array($this->_table)); + } + + public function fetch_all_by_pid_score($pid, $score) { + return DB::fetch_all('SELECT * FROM %t WHERE pid=%d AND score=%d', array($this->_table, $pid, $score)); + } + + public function fetch_standpoint_by_pid($pid) { + return DB::fetch_first('SELECT * FROM %t WHERE pid=%d AND authorid=-1', array($this->_table, $pid)); + } + + public function update_by_pid($pids, $data, $unbuffered = false, $low_priority = false, $authorid = null) { + if(empty($data)) { + return false; + } + $where = array(); + $where[] = DB::field('pid', $pids); + $authorid !== null && $where[] = DB::field('authorid', $authorid); + return DB::update($this->_table, $data, implode(' AND ', $where), $unbuffered, $low_priority); + } + + public function delete_by_authorid($authorids, $unbuffered = false, $rpid = false) { + if(empty($authorids)) { + return false; + } + $where = array(); + $where[] = DB::field('authorid', $authorids); + $rpid && $where[] = DB::field('rpid', 0, '>'); + return DB::delete($this->_table, implode(' AND ', $where), null, $unbuffered); + } + + public function delete_by_tid($tids, $unbuffered = false, $authorids = null) { + $where = array(); + $where[] = DB::field('tid', $tids); + $authorids !== null && !(is_array($authorids) && empty($authorids)) && $where[] = DB::field('authorid', $authorids); + return DB::delete($this->_table, implode(' AND ', $where), null, $unbuffered); + } + + public function delete_by_pid($pids, $unbuffered = false, $authorid = null) { + $where = array(); + $where[] = DB::field('pid', $pids); + $authorid !== null && !(is_array($authorid) && empty($authorid)) && $where[] = DB::field('authorid', $authorid); + return DB::delete($this->_table, implode(' AND ', $where), null, $unbuffered); + } + + public function delete_by_rpid($rpids, $unbuffered = false) { + if(empty($rpids)) { + return false; + } + return DB::delete($this->_table, DB::field('rpid', $rpids), null, $unbuffered); + } + public function fetch_postcomment_by_pid($pids, $postcache, $commentcount, $totalcomment, $commentnumber) { + $query = DB::query("SELECT * FROM ".DB::table('forum_postcomment')." WHERE pid IN (".dimplode($pids).') ORDER BY dateline DESC'); + $commentcount = $comments = array(); + while($comment = DB::fetch($query)) { + if($comment['authorid'] > '-1') { + $commentcount[$comment['pid']]++; + } + if((!is_array($comments[$comment['pid']]) || count($comments[$comment['pid']]) < $commentnumber) && $comment['authorid'] > '-1') { + $comment['avatar'] = avatar($comment['authorid'], 'small'); + $comment['comment'] = str_replace(array('[b]', '[/b]', '[/color]'), array('', '', '
    '), preg_replace("/\[color=([#\w]+?)\]/i", "", $comment['comment'])); + $comments[$comment['pid']][] = $comment; + } + if($comment['authorid'] == '-1') { + $this->cic_for_fetch_postcomment_by_pid = 0; + $totalcomment[$comment['pid']] = preg_replace_callback('/([\.\d]+)<\/i>/', array($this, 'fetch_postcomment_by_pid_callback_1'), $comment['comment']); + } + $postcache[$comment['pid']]['comment']['count'] = $commentcount[$comment['pid']]; + $postcache[$comment['pid']]['comment']['data'] = $comments[$comment['pid']]; + $postcache[$comment['pid']]['comment']['totalcomment'] = $totalcomment[$comment['pid']]; + } + return array($comments, $postcache, $commentcount, $totalcomment); + } + + public function fetch_postcomment_by_pid_callback_1($matches) { + return ''.sprintf('%1.1f', $matches[1]).''.str_repeat('',intval($matches[1])).str_repeat('',(5-intval($matches[1]))).($this->cic_for_fetch_postcomment_by_pid++ % 2 ? '
    ' : ''); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_poststick.php b/source/class/table/table_forum_poststick.php new file mode 100644 index 0000000..673943a --- /dev/null +++ b/source/class/table/table_forum_poststick.php @@ -0,0 +1,65 @@ +_table = 'forum_poststick'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_tid($tid) { + return DB::fetch_all('SELECT * FROM %t WHERE tid=%d ORDER BY dateline DESC', array($this->_table, $tid), 'pid'); + } + + + public function count_by_pid($pid) { + return DB::result_first('SELECT count(*) FROM %t WHERE pid=%d ', array($this->_table, $pid)); + } + + public function delete_by_pid($pids) { + if(empty($pids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('pid', $pids), array($this->_table)); + } + + public function delete_by_tid($tids) { + if(empty($tids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('tid', $tids), array($this->_table)); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_stick($val, $unbuffered); + } + } + + public function delete_stick($tid, $pid) { + return DB::query('DELETE FROM %t WHERE tid=%d AND pid=%d', array($this->_table, $tid, $pid)); + } + + public function count_by_tid($tid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d', array($this->_table, $tid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_promotion.php b/source/class/table/table_forum_promotion.php new file mode 100644 index 0000000..0086183 --- /dev/null +++ b/source/class/table/table_forum_promotion.php @@ -0,0 +1,42 @@ +_table = 'forum_promotion'; + $this->_pk = 'ip'; + + parent::__construct(); + } + + public function count_by_uid($uid) { + $uid = dintval($uid, is_array($uid) ? true : false); + if(!empty($uid)) { + $parameter = array($this->_table, $uid); + $where = is_array($uid) ? 'uid IN(%n)' : 'uid=%d'; + return DB::result_first("SELECT COUNT(*) FROM %t WHERE $where", $parameter); + } + return 0; + } + public function delete_by_uid($uid) { + return $uid ? DB::delete($this->_table, DB::field('uid', $uid)) : false; + } + public function delete_all() { + return DB::query("DELETE FROM %t", array($this->_table)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_ratelog.php b/source/class/table/table_forum_ratelog.php new file mode 100644 index 0000000..dc349ba --- /dev/null +++ b/source/class/table/table_forum_ratelog.php @@ -0,0 +1,91 @@ +_table = 'forum_ratelog'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_by_uid_pid($uid, $pid) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND pid=%d LIMIT 1', array($this->_table, $uid, $pid)); + } + public function fetch_all_by_pid($pid, $sort = 'DESC') { + if(is_array($pid)) { + $pid = array_map('intval', (array)$pid); + } + $wheresql = is_array($pid) ? 'pid IN(%n)' : 'pid=%d'; + return DB::fetch_all("SELECT * FROM %t WHERE $wheresql ORDER BY dateline $sort", array($this->_table, $pid)); + } + + public function fetch_all_sum_score($uid, $dateline) { + return DB::fetch_all('SELECT extcredits, SUM(ABS(score)) AS todayrate FROM %t WHERE uid=%d AND dateline>=%d GROUP BY extcredits', array($this->_table, $uid, $dateline)); + } + + public function count_by_uid_pid($uid, $pid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND pid=%d LIMIT 1', array($this->_table, $uid, $pid)); + } + + public function delete_by_pid_uid_extcredits_dateline($pid = null, $uid = null, $extcredits = null, $dateline = null) { + $parameter = array($this->_table); + $wherearr = array(); + if($pid !== null) { + $parameter[] = $pid; + $wherearr[] = "pid=%d"; + } + if($uid !== null) { + $parameter[] = $uid; + $wherearr[] = "uid=%d"; + } + if($extcredits !== null) { + $parameter[] = $extcredits; + $wherearr[] = "extcredits=%d"; + } + if($dateline !== null) { + $parameter[] = $dateline; + $wherearr[] = "dateline=%d"; + } + if(!empty($wherearr)) { + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::query("DELETE FROM %t $wheresql", $parameter, true, true); + } + return false; + } + + public function fetch_postrate_by_pid($pids, $postlist, $postcache, $ratelogrecord) { + $pids = array_map('intval', (array)$pids); + $query = DB::query("SELECT * FROM ".DB::table('forum_ratelog')." WHERE pid IN (".dimplode($pids).") ORDER BY dateline DESC"); + $ratelogs = array(); + while($ratelog = DB::fetch($query)) { + if(!is_array($postlist[$ratelog['pid']]['ratelog']) || count($postlist[$ratelog['pid']]['ratelog']) < $ratelogrecord) { + $ratelogs[$ratelog['pid']][$ratelog['uid']]['username'] = $ratelog['username']; + $ratelogs[$ratelog['pid']][$ratelog['uid']]['score'][$ratelog['extcredits']] += $ratelog['score']; + empty($ratelogs[$ratelog['pid']][$ratelog['uid']]['reason']) && $ratelogs[$ratelog['pid']][$ratelog['uid']]['reason'] = dhtmlspecialchars($ratelog['reason']); + $postlist[$ratelog['pid']]['ratelog'][$ratelog['uid']] = $ratelogs[$ratelog['pid']][$ratelog['uid']]; + } + $postcache[$ratelog['pid']]['rate']['ratelogs'] = $postlist[$ratelog['pid']]['ratelog']; + $postcache[$ratelog['pid']]['rate']['extcredits'][$ratelog['extcredits']] = $postlist[$ratelog['pid']]['ratelogextcredits'][$ratelog['extcredits']] += $ratelog['score']; + if(!$postlist[$ratelog['pid']]['totalrate'] || !in_array($ratelog['uid'], $postlist[$ratelog['pid']]['totalrate'])) { + $postlist[$ratelog['pid']]['totalrate'][] = $ratelog['uid']; + } + $postcache[$ratelog['pid']]['rate']['totalrate'] = $postlist[$ratelog['pid']]['totalrate']; + } + return array($ratelogs, $postlist, $postcache); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_relatedthread.php b/source/class/table/table_forum_relatedthread.php new file mode 100644 index 0000000..012baa3 --- /dev/null +++ b/source/class/table/table_forum_relatedthread.php @@ -0,0 +1,29 @@ +_table = 'forum_relatedthread'; + $this->_pk = 'tid'; + + parent::__construct(); + } + public function delete_by_tid($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_replycredit.php b/source/class/table/table_forum_replycredit.php new file mode 100644 index 0000000..0d933c7 --- /dev/null +++ b/source/class/table/table_forum_replycredit.php @@ -0,0 +1,26 @@ +_table = 'forum_replycredit'; + $this->_pk = 'tid'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_rsscache.php b/source/class/table/table_forum_rsscache.php new file mode 100644 index 0000000..93ed435 --- /dev/null +++ b/source/class/table/table_forum_rsscache.php @@ -0,0 +1,38 @@ +_table = 'forum_rsscache'; + $this->_pk = 'tid'; + + parent::__construct(); + } + + public function fetch_all_by_fid($fid, $limit = 20) { + return $fid ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('fid', $fid).' ORDER BY dateline DESC LIMIT '.$limit, null, 'tid') : array(); + } + + public function fetch_all_by_guidetype($type, $limit = 20) { + return DB::fetch_all('SELECT * FROM %t WHERE guidetype=%s ORDER BY dateline DESC LIMIT %d', array($this->_table, $type, $limit)); + } + + public function delete_by_guidetype($type){ + DB::query('DELETE FROM %t WHERE guidetype=%s', array($this->_table, $type)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_sofa.php b/source/class/table/table_forum_sofa.php new file mode 100644 index 0000000..0bf0296 --- /dev/null +++ b/source/class/table/table_forum_sofa.php @@ -0,0 +1,43 @@ +_table = 'forum_sofa'; + $this->_pk = 'tid'; + + parent::__construct(); + } + + public function range($start = 0, $limit = 0, $sort = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::range($start, $limit, $sort); + } else { + return $this->range_sofa($start, $limit); + } + } + + public function range_sofa($start = 0, $limit = 20) { + return DB::fetch_all('SELECT * FROM %t ORDER BY tid DESC %i', array($this->_table, DB::limit($start, $limit)), $this->_pk); + } + + public function fetch_all_by_fid($fid, $start = 0, $limit = 20) { + return DB::fetch_all('SELECT * FROM %t WHERE fid IN(%n) ORDER BY tid DESC %i', array($this->_table, $fid, DB::limit($start, $limit)), $this->_pk); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_spacecache.php b/source/class/table/table_forum_spacecache.php new file mode 100644 index 0000000..471d2cf --- /dev/null +++ b/source/class/table/table_forum_spacecache.php @@ -0,0 +1,68 @@ +_table = 'forum_spacecache'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_spacecache($id, $force_from_db); + } + } + + public function fetch_all($ids, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_spacecache($ids, $force_from_db); + } + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_spacecache($val, $unbuffered); + } + } + + public function fetch_spacecache($uid, $variable) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND variable=%s', array($this->_table, $uid, $variable)); + } + + public function fetch_all_spacecache($uids, $variables) { + if(empty($uids) || empty($variables)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('uid', $uids).' AND '.DB::field('variable', $variables), array($this->_table)); + } + + public function delete_spacecache($uid, $variable) { + return DB::query('DELETE FROM %t WHERE uid=%d AND variable=%s', array($this->_table, $uid, $variable)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_statlog.php b/source/class/table/table_forum_statlog.php new file mode 100644 index 0000000..1d6a7bc --- /dev/null +++ b/source/class/table/table_forum_statlog.php @@ -0,0 +1,47 @@ +_table = 'forum_statlog'; + $this->_pk = 'logdate'; + + parent::__construct(); + } + + public function fetch_all_by_logdate($start, $end, $fid) { + return DB::fetch_all('SELECT * FROM %t WHERE logdate>=%s AND logdate<=%s AND type=1 AND fid=%d ORDER BY logdate ASC', array($this->_table, $start, $end, $fid)); + } + + public function fetch_all_rank_by_logdate($date) { + return DB::fetch_all('SELECT * FROM %t WHERE logdate=%s AND type=1 ORDER BY value DESC', array($this->_table, $date)); + } + + public function fetch_all_by_fid_type($fid, $type=1) { + return DB::fetch_all("SELECT * FROM %t WHERE fid=%d AND type=%d", array($this->_table, $fid, $type)); + } + + public function fetch_min_logdate_by_fid($fid) { + return DB::result_first("SELECT MIN(logdate) FROM %t WHERE fid=%d", array($this->_table, $fid)); + } + + public function insert_stat_log($date) { + return DB::query("REPLACE INTO %t (logdate, fid, `type`, `value`) SELECT %s, fid, 1, todayposts FROM %t WHERE `type` IN ('forum', 'sub') AND `status`<>'3'", array($this->_table, $date, 'forum_forum')); + } + + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_thread.php b/source/class/table/table_forum_thread.php new file mode 100644 index 0000000..f815eae --- /dev/null +++ b/source/class/table/table_forum_thread.php @@ -0,0 +1,1278 @@ +_table = 'forum_thread'; + $this->_pk = 'tid'; + $this->_pre_cache_key = 'forum_thread_'; + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('UnsupportedOperationException'); + } else { + $force_from_db = $force_from_db === false ? 0 : $force_from_db; + return $this->fetch_thread($id, $force_from_db); + } + } + + public function fetch_thread($tid, $tableid = 0) { + $tid = intval($tid); + $data = array(); + if($tid && ($data = $this->fetch_cache($tid)) === false) { + $parameter = array($this->get_table_name($tableid), $tid); + $data = DB::fetch_first("SELECT * FROM %t WHERE tid=%d", $parameter); + if(!empty($data)) $this->store_cache($tid, $data, $this->_cache_ttl); + } + return $data; + } + + public function fetch_by_tid_displayorder($tid, $displayorder = null, $glue = '>=', $authorid = null, $tableid = 0) { + $data = $this->fetch_thread($tid, $tableid); + if(!empty($data)) { + if(($displayorder !== null && !($this->compare_number($data['displayorder'], $displayorder, $glue))) || ($authorid !== null && $data['authorid'] != $authorid)) { + $data = array(); + } + } + return $data; + } + + public function fetch_by_fid_displayorder($fid, $displayorder = 0, $glue = '>=', $order = 'lastpost', $sort = 'DESC') { + $fid = intval($fid); + if(!empty($fid)) { + $parameter = array($this->get_table_name(), $fid, $displayorder); + $glue = helper_util::check_glue($glue); + $ordersql = !empty($order) ? ' ORDER BY '.DB::order($order, $sort) : ''; + return DB::fetch_first("SELECT * FROM %t WHERE fid=%d AND displayorder{$glue}%d $ordersql ".DB::limit(0, 1), $parameter); + } + return array(); + } + public function fetch_next_tid_by_fid_lastpost($fid, $lastpost, $glue = '>', $sort = 'DESC', $tableid = 0) { + $glue = helper_util::check_glue($glue); + return DB::result_first("SELECT tid FROM %t WHERE fid=%d AND displayorder>=0 AND closed=0 AND lastpost{$glue}%d ORDER BY ".DB::order('lastpost', $sort).DB::limit(1), array($this->get_table_name($tableid), $fid, $lastpost)); + } + public function fetch_by_tid_fid_displayorder($tid, $fid, $displayorder = null, $tableid = 0, $glue = '>=') { + if($tid) { + $data = $this->fetch_thread($tid, $tableid); + if(!empty($data)) { + if(($data['fid'] != $fid) || ($displayorder !== null && !($this->compare_number($data['displayorder'], $displayorder, $glue)))) { + $data = array(); + } + } + return $data; + } + return array(); + } + public function fetch_thread_table_ids() { + $threadtableids = array('0' => 0); + $db = DB::object(); + $query = $db->query("SHOW TABLES LIKE '".str_replace('_', '\_', DB::table('forum_thread').'_%')."'"); + while($table = $db->fetch_array($query, constant('MYSQLI_NUM'))) { + $tablename = $table[0]; + $tableid = intval(substr($tablename, strrpos($tablename, '_') + 1)); + if(empty($tableid)) { + continue; + } + $threadtableids[$tableid] = $tableid; + } + return $threadtableids; + } + + public function fetch_all_by_digest_displayorder($digest, $digestglue = '=', $displayorder = 0, $glue = '>=', $start = 0, $limit = 0, $tableid = 0) { + $parameter = array($this->get_table_name($tableid), $digest, $displayorder); + $digestglue = helper_util::check_glue($digestglue); + $glue = helper_util::check_glue($glue); + return DB::fetch_all("SELECT * FROM %t WHERE digest{$digestglue}%d AND displayorder{$glue}%d".DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function fetch_all_by_fid_typeid_displayorder($fid, $typeid = null, $displayorder = null, $glue = '=', $start = 0, $limit = 0) { + + $parameter = array($this->get_table_name(), $fid); + $wherearr = array(); + $wherearr[] = is_array($fid) ? 'fid IN(%n)' : 'fid=%d'; + + if($typeid) { + $parameter[] = $typeid; + $wherearr[] = "typeid=%d"; + } + if($displayorder !== null) { + $parameter[] = $displayorder; + $glue = helper_util::check_glue($glue); + $wherearr[] = "displayorder{$glue}%d"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY lastpost DESC ".DB::limit($start, $limit), $parameter, $this->_pk); + } + public function fetch_all_by_fid_lastpost($fid, $lstart = 0, $lend = 0, $tableid = 0) { + $parameter = array($this->get_table_name($tableid), $fid); + $wherearr = array(); + $wherearr[] = is_array($fid) ? 'fid IN(%n)' : 'fid=%d'; + $wherearr[] = 'displayorder=0'; + if($lstart) { + $wherearr[] = 'lastpost>%d'; + $parameter[] = $lstart; + } + if($lend) { + $wherearr[] = 'lastpost<%d'; + $parameter[] = $lend; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY lastpost DESC ".DB::limit(0, 100), $parameter, $this->_pk); + } + + public function fetch_all_by_authorid_displayorder($authorid, $displayorder = null, $dglue = '=', $closed = null, $subject = '', $start = 0, $limit = 0, $replies = null, $fid = null, $rglue = '>=', $tableid = 0) { + + $parameter = array($this->get_table_name($tableid)); + $wherearr = array(); + if(!empty($authorid)) { + $authorid = dintval($authorid, true); + $parameter[] = $authorid; + $wherearr[] = is_array($authorid) && $authorid ? 'authorid IN(%n)' : 'authorid=%d'; + } + if($fid !== null) { + $fid = dintval($fid, true); + $parameter[] = $fid; + $wherearr[] = is_array($fid) && $fid ? 'fid IN(%n)' : 'fid=%d'; + } + if(getglobal('setting/followforumid')) { + $parameter[] = getglobal('setting/followforumid'); + $wherearr[] = 'fid<>%d'; + } + if($displayorder !== null) { + $parameter[] = $displayorder; + $dglue = helper_util::check_glue($dglue); + $wherearr[] = "displayorder{$dglue}%d"; + } + if($closed !== null) { + $parameter[] = $closed; + $wherearr[] = "closed=%d"; + } + if($replies !== null) { + $parameter[] = $replies; + $rglue = helper_util::check_glue($rglue); + $wherearr[] = "replies{$rglue}%d"; + } + if(!empty($subject)) { + $parameter[] = '%'.$subject.'%'; + $wherearr[] = "subject LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function fetch_all_by_tid($tids, $start = 0, $limit = 0, $tableid = 0) { + $data = array(); + if(($data = $this->fetch_cache($tids)) === false || count($tids) != count($data)) { + if(is_array($data) && !empty($data)) { + $tids = array_diff($tids, array_keys($data)); + } + if($data === false) $data = array(); + if(!empty($tids)) { + $parameter = array($this->get_table_name($tableid), $tids); + $query = DB::query("SELECT * FROM %t WHERE tid IN(%n)".DB::limit($start, $limit), $parameter); + while($value = DB::fetch($query)) { + $data[$value['tid']] = $value; + $this->store_cache($value['tid'], $value, $this->_cache_ttl); + } + } + } + return $data; + } + + public function fetch_all_by_tid_displayorder($tids, $displayorder = null, $glue = '>=', $fids = array(), $closed = null) { + $data = array(); + if(!empty($tids)) { + $data = $this->fetch_all_by_tid((array)$tids); + $fids = $fids && !is_array($fids) ? array($fids) : $fids; + foreach($data as $tid => $value) { + if($displayorder !== null && !(helper_util::compute($value['displayorder'], $displayorder, $glue))) { + unset($data[$tid]); + } elseif(!empty($fids) && !in_array($value['fid'], $fids)) { + unset($data[$tid]); + } elseif($closed !== null && $value['closed'] != $closed) { + unset($data[$tid]); + } + } + } + return $data; + } + + public function fetch_all_by_tid_fid_displayorder($tids, $fids = null, $displayorder = null, $order = 'dateline', $start = 0, $limit = 0, $glue = '>=', $sort = 'DESC', $tableid = 0) { + $parameter = array($this->get_table_name($tableid)); + $wherearr = array(); + if(!empty($tids)) { + $tids = dintval($tids, true); + $parameter[] = $tids; + $wherearr[] = is_array($tids) && $tids ? 'tid IN(%n)' : 'tid=%d'; + } + if(!empty($fids)) { + $fids = dintval($fids, true); + $parameter[] = $fids; + $wherearr[] = is_array($fids) && $fids ? 'fid IN(%n)' : 'fid=%d'; + } + + if($displayorder !== null) { + $parameter[] = $displayorder; + $glue = helper_util::check_glue($glue); + $wherearr[] = "displayorder{$glue}%d"; + } + if($order) { + $order = 'ORDER BY '.DB::order($order, $sort); + } + if(!empty($wherearr)) { + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql $order ".DB::limit($start, $limit), $parameter, $this->_pk); + } else { + return array(); + } + } + + public function fetch_all_by_tid_or_fid($fid, $tids = array()) { + $parameter = array($this->get_table_name(), $fid); + $forumstickytids = ''; + if(!empty($tids)) { + $tids = dintval($tids, true); + $parameter[] = $tids; + $forumstickytids = ' OR '.(is_array($tids) && $tids ? 'tid IN(%n)' : 'tid=%d'); + } + return DB::fetch_all("SELECT * FROM %t WHERE fid=%d AND displayorder=1 $forumstickytids ORDER BY lastpost DESC", $parameter); + } + + public function fetch_all_by_displayorder($displayorder = 0, $glue = '>=', $start = 0, $limit = 0, $tableid = 0) { + $glue = helper_util::check_glue($glue); + $displayorder = dintval($displayorder, true); + return DB::fetch_all('SELECT * FROM %t WHERE %i '.DB::limit($start, $limit), array($this->get_table_name($tableid), DB::field('displayorder', $displayorder, $glue))); + } + + public function fetch_all_by_authorid($authorid, $start = 0, $limit = 0, $tableid = 0) { + $authorid = dintval($authorid, true); + return DB::fetch_all("SELECT * FROM %t WHERE %i ORDER BY dateline DESC ".DB::limit($start, $limit), array($this->get_table_name($tableid), DB::field('authorid', $authorid)), $this->_pk); + } + + public function fetch_all_by_dateline($starttime, $start = 0, $limit = 0, $order = 'dateline', $sort = 'DESC') { + if($starttime) { + $orderby = ''; + if(!empty($order)) { + $orderby = "ORDER BY ".DB::order($order, $sort); + } + $parameter = array($this->get_table_name(), $starttime); + return DB::fetch_all("SELECT * FROM %t WHERE dateline>=%d AND displayorder>'-1' $orderby ".DB::limit($start, $limit), $parameter, $this->_pk); + } + return array(); + } + + public function fetch_all_by_fid_displayorder($fids, $displayorder = null, $dateline = null, $recommends = null, $start = 0, $limit = 0, $order = 'dateline', $sort = 'DESC', $dglue = '>=') { + $parameter = array($this->get_table_name()); + $wherearr = array(); + $fids = dintval($fids, true); + if(!empty($fids)) { + $parameter[] = $fids; + $wherearr[] = is_array($fids) && $fids ? 'fid IN(%n)' : 'fid=%d'; + } + if($displayorder !== null) { + $parameter[] = $displayorder; + $dglue = helper_util::check_glue($dglue); + $wherearr[] = "displayorder{$dglue}%d"; + } + if($dateline !== null) { + $parameter[] = $dateline; + $wherearr[] = "dateline>=%d"; + } + if($recommends !== null) { + $parameter[] = $recommends; + $wherearr[] = "recommends>%d"; + } + $ordersql = !empty($order) ? ' ORDER BY '.DB::order($order, $sort) : ''; + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql $ordersql ".DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function fetch_all_new_thread_by_tid($tid = 0, $start = 0, $limit = 0, $tableid = 0, $glue = '>', $sort = 'ASC') { + $glue = helper_util::check_glue($glue); + return DB::fetch_all("SELECT * FROM %t WHERE tid{$glue}%d ORDER BY ".DB::order('tid', $sort).DB::limit($start, $limit), array($this->get_table_name($tableid), $tid), $this->_pk); + } + public function fetch_all_group_thread_by_fid_displayorder($fids, $displayorder = null, $dateline = null, $lastpost = null, $digest = null, $order = 'dateline', $start = 0, $limit = 0, $dglue = '>=') { + $fids = dintval($fids, true); + $parameter = array($this->get_table_name(), $fids); + $wherearr = array(); + $wherearr[] = is_array($fids) && $fids ? 'fid IN(%n)' : 'fid=%d'; + if($displayorder !== null) { + $parameter[] = $displayorder; + $dglue = helper_util::check_glue($dglue); + $wherearr[] = "displayorder{$dglue}%d"; + } + if($dateline !== null) { + $parameter[] = $dateline; + $wherearr[] = "dateline>=%d"; + } + if($lastpost !== null) { + $parameter[] = $lastpost; + $wherearr[] = "lastpost>=%d"; + } + if($digest !== null) { + $parameter[] = $digest; + $wherearr[] = "$digest>%d"; + } + $ordersql = !empty($order) ? 'ORDER BY'.DB::order($order, 'DESC') : ''; + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql $ordersql ".DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function fetch_all_by_fid_authorid_displayorder($fids, $authorid, $displayorder = null, $lastpost = 0, $start = 0, $limit = 0) { + $parameter = array($this->get_table_name()); + $wherearr = array(); + if($authorid) { + $authorid = dintval($authorid, true); + $parameter[] = $authorid; + $wherearr[] = is_array($authorid) ? 'authorid IN(%n)' : 'authorid=%d'; + } + $fids = dintval($fids, true); + $parameter[] = $fids; + $wherearr[] = is_array($fids) ? 'fid IN(%n)' : 'fid=%d'; + if($displayorder !== null) { + $parameter[] = $displayorder; + $wherearr[] = "displayorder=%d"; + } + if($lastpost) { + $parameter[] = $lastpost; + $wherearr[] = "lastpost>%d"; + } + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY lastpost DESC ".DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function fetch_all_by_tid_fid($tids, $fids = array(), $isgroup = -1, $author = '', $subject = '', $start = 0, $limit = 0) { + $data = array(); + $condition = $this->make_query_condition($tids, $fids, $isgroup, $author, $subject); + $query = DB::query("SELECT * FROM %t $condition[0]".DB::limit($start, $limit), $condition[1]); + while($value = DB::fetch($query)) { + $data[$value['tid']] = $value; + $this->_posttableid[$value['posttableid']][] = $value['tid']; + } + return $data; + } + + public function fetch_all_by_fid($fids, $start = 0, $limit = 0, $tableid = 0) { + $fids = dintval($fids, true); + if($fids) { + return DB::fetch_all("SELECT * FROM %t WHERE fid IN(%n) ".DB::limit($start, $limit), array($this->get_table_name($tableid), (array)$fids)); + } + return array(); + } + + public function fetch_all_by_replies($number, $start = 0, $limit = 0, $glue = '>', $tableid = 0) { + $number = dintval($number); + if($number) { + $glue = helper_util::check_glue($glue); + return DB::fetch_all("SELECT * FROM %t WHERE replies{$glue}%d ".DB::limit($start, $limit), array($this->get_table_name($tableid), $number)); + } + return array(); + } + + public function fetch_all_rank_thread($dateline, $notfid, $order = 'dateline', $start = 0, $limit = 0) { + $parameter = array($this->get_table_name()); + $data = $fids = $wherearr = array(); + if($dateline) { + $parameter[] = $dateline; + $wherearr[] = 'dateline>%d'; + } + $wherearr[] = 'displayorder>=0'; + if($notfid) { + $parameter[] = $notfid; + $wherearr[] = 'fid NOT IN(%n)'; + } + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + $ordersql = !empty($order) ? ' ORDER BY '.DB::order($order, 'DESC') : ''; + $query = DB::query("SELECT tid, fid, author, authorid, subject, dateline, views, replies, favtimes, sharetimes, heats FROM %t $wheresql $ordersql ".DB::limit($start, $limit), $parameter); + while($value = DB::fetch($query)) { + $data[$value['tid']] = $value; + $fids[$value['fid']][$value['tid']] = $value['tid']; + } + if(!empty($fids)) { + foreach(C::t('forum_forum')->fetch_all_name_by_fid(array_keys($fids)) as $value) { + foreach($fids[$value['fid']] as $tid) { + $data[$tid]['forum'] = $value['name']; + } + } + } + return $data; + } + public function fetch_all_rank_poll($dateline, $notfid, $order = 'dateline', $start = 0, $limit = 0) { + $parameter = array($this->get_table_name(), 'forum_poll'); + $wherearr = array('t.special=1'); + if($dateline) { + $parameter[] = $dateline; + $wherearr[] = 't.dateline>%d'; + } + $wherearr[] = 't.displayorder>=0'; + if($notfid) { + $parameter[] = $notfid; + $wherearr[] = 't.fid NOT IN(%n)'; + } + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + $ordersql = !empty($order) ? ' ORDER BY '.DB::order($order, 'DESC') : ''; + return DB::fetch_all("SELECT t.tid, t.fid, t.author, t.authorid, t.subject, t.dateline, t.favtimes, t.sharetimes, t.heats, p.pollpreview, p.voters FROM %t t LEFT JOIN %t p ON p.tid=t.tid $wheresql $ordersql ".DB::limit($start, $limit), $parameter, $this->_pk); + } + public function fetch_all_rank_activity($dateline, $notfid, $order = 'dateline', $start = 0, $limit = 0) { + $parameter = array($this->get_table_name(), 'forum_activity'); + $wherearr = array('t.special=4', 't.isgroup=0', 't.closed=0'); + if($dateline) { + $parameter[] = $dateline; + $wherearr[] = 't.dateline>%d'; + } + $wherearr[] = 't.displayorder>=0'; + if($notfid) { + $parameter[] = $notfid; + $wherearr[] = 't.fid NOT IN(%n)'; + } + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + $ordersql = !empty($order) ? ' ORDER BY '.DB::order($order, 'DESC') : ''; + return DB::fetch_all("SELECT t.tid, t.subject, t.views, t.author, t.authorid, t.replies, t.heats, t.sharetimes, t.favtimes, act.aid, act.starttimefrom, act.starttimeto, act.place, act.class, act.applynumber, act.expiration FROM %t t LEFT JOIN %t act ON act.tid=t.tid $wheresql $ordersql ".DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function fetch_all_by_recyclebine($fid = 0, $isgroup = 0, $author = array(), $username = array(), $pstarttime = 0, $pendtime = 0, $mstarttime = 0, $mendtime = 0, $keywords = '', $start = 0, $limit = 0) { + $sql = $this->recyclebine_where($fid, $isgroup, $author, $username, $pstarttime, $pendtime, $mstarttime, $mendtime, $keywords); + return DB::fetch_all('SELECT f.name AS forumname, f.allowsmilies, f.allowhtml, f.allowbbcode, f.allowimgcode, + t.tid, t.fid, t.authorid, t.author, t.subject, t.views, t.replies, t.dateline, t.posttableid, + tm.uid AS moduid, tm.username AS modusername, tm.dateline AS moddateline, tm.action AS modaction, tm.reason + FROM '.DB::table('forum_thread').' t LEFT JOIN '.DB::table('forum_threadmod').' tm ON tm.tid=t.tid + LEFT JOIN '.DB::table('forum_forum').' f ON f.fid=t.fid '.$sql[0].' ORDER BY t.dateline DESC '.DB::limit($start, $limit), $sql[1]); + } + + public function fetch_all_recyclebin_by_dateline($dateline, $start = 0, $limit = 0) { + return DB::fetch_all("SELECT tid FROM %t WHERE displayorder=-1 AND dateline<%d".DB::limit($start, $limit), array($this->_table, $dateline)); + } + + public function fetch_all_moderate($fid = 0, $displayorder = null, $isgroup = null, $dateline = null, $author = null, $subject = null) { + $parameter = $this->make_query_condition(null, $fid, $isgroup, $author, $subject, $displayorder, $dateline); + return DB::fetch_all('SELECT * FROM %t '.$parameter[0], $parameter[1], $this->_pk); + } + + public function fetch_all_movedthread($start = 0, $limit = 0) { + return DB::fetch_all('SELECT t1.tid, t2.tid AS threadexists, f.status, t1.isgroup FROM %t t1 + LEFT JOIN %t t2 ON t2.tid=t1.closed AND t2.displayorder>=0 LEFT JOIN %t f ON f.fid=t1.fid + WHERE t1.closed>1'.DB::limit($start, $limit), array($this->get_table_name(), $this->get_table_name(), 'forum_forum')); + } + + public function fetch_all_by_fid_cover_lastpost($fid, $cover = null, $starttime = 0, $endtime = 0, $start = 0, $limit = 0) { + $parameter = array($this->get_table_name(), $fid); + $wherearr = array('fid=%d', 'displayorder>=0'); + if($cover !== null) { + $wherearr[] = 'cover=%d'; + $parameter[] = $cover; + } + if($starttime) { + $wherearr[] = 'lastpost>%d'; + $parameter[] = $starttime; + } + if($endtime) { + $wherearr[] = 'lastpost<%d'; + $parameter[] = $endtime; + } + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + return DB::fetch_all('SELECT * FROM %t '.$wheresql.DB::limit($start, $limit), $parameter, $this->_pk); + } + public function fetch_all_by_posttableid_displayorder($tableid = 0, $posttableid = 0, $displayorder = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE posttableid=%d AND displayorder>=%d ORDER BY lastpost'.DB::limit(1000), array($this->get_table_name($tableid), $posttableid, $displayorder), $this->_pk); + } + + public function fetch_all_search($conditions, $tableid = 0, $start = 0, $limit = 0, $order = '', $sort = 'DESC', $forceindex='') { + $ordersql = ''; + if(!empty($order)) { + $ordersql = " ORDER BY $order $sort "; + } + $data = array(); + $tlkey = !empty($conditions['inforum']) && !is_array($conditions['inforum']) ? $conditions['inforum'] : ''; + $firstpage = false; + $defult = count($conditions) < 5 ? true : false; + if(count($conditions) < 5) { + foreach(array_keys($conditions) as $key) { + if(!in_array($key, array('inforum', 'sticky', 'displayorder', 'intids'))) { + $defult = false; + break; + } + } + } + if(!defined('IN_MOBILE') && $defult && $conditions['sticky'] == 4 && $start == 0 && $limit && strtolower(preg_replace("/\s?/is", '', $order)) == 'displayorderdesc,lastpostdesc' && empty($sort)) { + foreach($conditions['displayorder'] as $id) { + if($id < 2) { + $firstpage = true; + if($id < 0) { + $firstpage = false; + break; + } + } + } + if(!$tableid && $firstpage && !empty($tlkey) && ($ttl = getglobal('setting/memory/forum_thread_forumdisplay')) !== null && ($data = $this->fetch_cache($tlkey, 'forumdisplay_')) !== false) { + $delusers = $this->fetch_cache('deleteuids', ''); + if(!empty($delusers)) { + foreach($data as $tid => $value) { + if(isset($delusers[$value['authorid']])) { + $data = array(); + } + } + } + if($data) { + return $data; + } + } + } + $data = DB::fetch_all("SELECT * FROM ".DB::table($this->get_table_name($tableid))." $forceindex".$this->search_condition($conditions)." $ordersql ".DB::limit($start, $limit)); + if(!defined('IN_MOBILE') && !$tableid && $firstpage && !empty($tlkey) && ($ttl = getglobal('setting/memory/forum_thread_forumdisplay')) !== null) { + $this->store_cache($tlkey, $data, $ttl, 'forumdisplay_'); + } + return $data; + } + + public function fetch_all_by_special($special, $authorid = 0, $replies = 0, $displayorder = null, $subject = '', $join = 0, $start = 0, $limit = 0, $order = 'dateline', $sort = 'DESC') { + $condition = $this->make_special_condition($special, $authorid, $replies, $displayorder, $subject, $join, 0); + $ordersql = !empty($order) ? ' ORDER BY t.'.DB::order($order, $sort) : ''; + return DB::fetch_all("SELECT t.* FROM %t t {$condition['jointable']} ".$condition['where'].$ordersql.DB::limit($start, $limit), $condition['parameter'], $this->_pk); + } + public function fetch_all_heats() { + $heatdateline = getglobal('timestamp') - 86400 * getglobal('setting/indexhot/days'); + $addtablesql = $addsql = ''; + if(!helper_access::check_module('group')) { + $addtablesql = " LEFT JOIN ".DB::table('forum_forum')." f ON f.fid = t.fid "; + $addsql = " AND f.status IN ('0', '1') "; + } + return DB::fetch_all("SELECT t.tid,t.posttableid,t.views,t.dateline,t.replies,t.author,t.authorid,t.subject,t.price + FROM ".DB::table('forum_thread')." t $addtablesql + WHERE t.dateline>'$heatdateline' AND t.heats>'0' AND t.displayorder>='0' $addsql ORDER BY t.heats DESC LIMIT ".(getglobal('setting/indexhot/limit') * 2)); + + } + + private function make_query_condition($tids, $fids = array(), $isgroup = -1, $author = '', $subject = '', $displayorder = null, $dateline = null) { + $parameter = array($this->get_table_name()); + $wherearr = array(); + if(!empty($tids)) { + $tids = dintval($tids, true); + $parameter[] = $tids; + $wherearr[] = is_array($tids) ? 'tid IN(%n)' : 'tid=%d'; + } + if(!empty($fids)) { + $fids = dintval($fids, true); + $parameter[] = $fids; + $wherearr[] = is_array($fids) ? 'fid IN(%n)' : 'fid=%d'; + } + if(in_array($isgroup, array(0, 1))) { + $parameter[] = $isgroup; + $wherearr[] = "isgroup=%d"; + } + if(!empty($author)) { + $parameter[] = $author; + $wherearr[] = "author=%s"; + } + if($displayorder !== null) { + $parameter[] = $displayorder; + $wherearr[] = 'displayorder=%d'; + } + if($dateline !== null) { + $parameter[] = getglobal('timestamp') - $dateline; + $wherearr[] = 'dateline>=%d'; + } + if(!empty($subject)) { + $parameter[] = '%'.$subject.'%'; + $wherearr[] = "subject LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + } + + + public function count_by_special($special, $authorid = 0, $replies = 0, $displayorder = null, $subject = '', $join = 0) { + $condition = $this->make_special_condition($special, $authorid, $replies, $displayorder, $subject, $join, 0); + return DB::result_first("SELECT COUNT(*) FROM %t t {$condition['jointable']} ".$condition['where'], $condition['parameter']); + } + private function make_special_condition($special, $authorid = 0, $replies = 0, $displayorder = null, $subject = '', $join = 0, $tableid = 0) { + $wherearr = $condition = array(); + $parameter = array($this->get_table_name($tableid)); + if($authorid && !$join) { + $authorid = dintval($authorid, true); + $parameter[] = $authorid; + $wherearr[] = is_array($authorid) && $authorid ? 't.authorid IN(%n)' : 't.authorid=%d'; + } + $parameter[] = $special; + $wherearr[] = 't.special=%d'; + if($replies) { + $parameter[] = $replies; + $wherearr[] = 't.replies>=%d'; + } + if($displayorder !== null) { + $parameter[] = $displayorder; + $wherearr[] = 't.displayorder>=%d'; + } + if(!empty($subject)) { + $parameter[] = '%'.$subject.'%'; + $wherearr[] = "subject LIKE %s"; + } + if($join) { + if($special == 1) { + $parameter[] = $authorid; + $wherearr[] = 'p.uid=%d'; + $wherearr[] = 'p.tid = t.tid'; + $condition['jointable'] = ', '.DB::table('forum_pollvoter').' p '; + } elseif($special == 5) { + $parameter[] = $authorid; + $wherearr[] = 'p.authorid=%d'; + $wherearr[] = 'p.first=0'; + $wherearr[] = 'p.tid = t.tid'; + $posttable = getposttable(); + $condition['jointable'] = ', '.DB::table($posttable).' p '; + } + } + $condition['parameter'] = $parameter; + $condition['where'] = ' WHERE '.implode(' AND ', $wherearr); + return $condition; + } + public function count_search($conditions, $tableid = 0, $prefix = false) { + $prefix = $prefix ? '' : 't'; + return DB::result_first("SELECT COUNT(*) FROM %t $prefix %i", array($this->get_table_name($tableid), $this->search_condition($conditions, $prefix))); + } + + public function search_condition($conditions, $prefix = false) { + $this->_urlparam = $wherearr = array(); + if($prefix) { + $prefix = 't.'; + } + if(!empty($conditions['sourcetableid'])) { + $this->_urlparam[] = "sourcetableid={$conditions['sourcetableid']}"; + } + if($conditions['inforum'] != '' && $conditions['inforum'] != 'all') { + $wherearr[] = $prefix.DB::field('fid', $conditions['inforum']); + $this->_urlparam[] = "inforum={$conditions['inforum']}"; + } + if(!empty($conditions['intids'])) { + $wherearr[] = $prefix.DB::field('tid', $conditions['intids']); + $this->_urlparam[] = "intids={$conditions['intids']}"; + } + if(!empty($conditions['tidmin'])) { + $wherearr[] = $prefix.DB::field('tid', $conditions['tidmin'], '>='); + $this->_urlparam[] = "tidmin={$conditions['tidmin']}"; + } + + if(!empty($conditions['tidmax'])) { + $wherearr[] = $prefix.DB::field('tid', $conditions['tidmax'], '<='); + $this->_urlparam[] = "tidmax={$conditions['tidmax']}"; + } + if(isset($conditions['sticky'])) { + if($conditions['sticky'] == 1) { + $wherearr[] = $prefix.DB::field('displayorder', 0, '>'); + $this->_urlparam[] = "sticky=1"; + } elseif($conditions['sticky'] == 2) { + $wherearr[] = $prefix.DB::field('displayorder', 0); + $this->_urlparam[] = "sticky=2"; + } elseif($conditions['sticky'] == 3) { + $wherearr[] = $prefix.DB::field('displayorder', -1); + $this->_urlparam[] = "sticky=3"; + } elseif($conditions['sticky'] == 4) { + $wherearr[] = $prefix.DB::field('displayorder', $conditions['displayorder']); + $this->_urlparam[] = "sticky=4"; + } else { + $wherearr[] = $prefix.DB::field('displayorder', 0, '>='); + $this->_urlparam[] = "sticky=0"; + } + } + + if(!empty($conditions['noreplydays'])) { + $conditions['noreplydays'] = intval($conditions['noreplydays']); + $lastpost = getglobal('timestamp') - $conditions['noreplydays'] * 86400; + $wherearr[] = $prefix.DB::field('lastpost', $lastpost, '<'); + $this->_urlparam[] = "noreplydays={$conditions['noreplydays']}"; + } + if(!empty($conditions['lastpostless'])) { + $wherearr[] = $prefix.DB::field('lastpost', $conditions['lastpostless'], '<='); + $this->_urlparam[] = "lastpostless={$conditions['lastpostless']}"; + } + if(!empty($conditions['lastpostmore'])) { + $wherearr[] = $prefix.DB::field('lastpost', $conditions['lastpostmore'], '>='); + $this->_urlparam[] = "lastpostmore={$conditions['lastpostmore']}"; + } + + if(!empty($conditions['intype']) && $conditions['intype'] != 'all') { + $wherearr[] = $prefix.DB::field('typeid', $conditions['intype']); + $this->_urlparam[] = "intype={$conditions['intype']}"; + } + if(!empty($conditions['insort']) && $conditions['insort'] != 'all') { + $wherearr[] = $prefix.DB::field('sortid', $conditions['insort']); + $this->_urlparam[] = "insort={$conditions['insort']}"; + } + if(isset($conditions['viewsless']) && $conditions['viewsless'] !== '') { + $wherearr[] = $prefix.DB::field('views', $conditions['viewsless'], '<='); + $this->_urlparam[] = "viewsless={$conditions['viewsless']}"; + } + if(isset($conditions['viewsmore']) && $conditions['viewsmore'] !== '') { + $wherearr[] = $prefix.DB::field('views', $conditions['viewsmore'], '>='); + $this->_urlparam[] = "viewsmore={$conditions['viewsmore']}"; + } + + if(isset($conditions['repliesless']) && $conditions['repliesless'] !== '') { + $wherearr[] = $prefix.DB::field('replies', $conditions['repliesless'], '<='); + $this->_urlparam[] = "repliesless={$conditions['repliesless']}"; + } + if(isset($conditions['repliesmore']) && $conditions['repliesmore'] !== '') { + $wherearr[] = $prefix.DB::field('replies', $conditions['repliesmore'], '>='); + $this->_urlparam[] = "repliesmore={$conditions['repliesmore']}"; + } + if(isset($conditions['readpermmore']) && $conditions['readpermmore'] !== '') { + $wherearr[] = $prefix.DB::field('readperm', $conditions['readpermmore'], '>'); + $this->_urlparam[] = "readpermmore={$conditions['readpermmore']}"; + } + if(isset($conditions['pricesless']) && $conditions['pricesless'] !== '') { + $wherearr[] = $prefix.DB::field('price', $conditions['pricesless'], '<'); + $this->_urlparam[] = "pricemore={$conditions['pricesless']}"; + } + if(isset($conditions['pricemore']) && $conditions['pricemore'] !== '') { + $wherearr[] = $prefix.DB::field('price', $conditions['pricemore'], '>'); + $this->_urlparam[] = "pricemore={$conditions['pricemore']}"; + } + if(!empty($conditions['beforedays'])) { + $dateline = getglobal('timestamp') - $conditions['beforedays']*86400; + $wherearr[] = $prefix.DB::field('dateline', $dateline, '<'); + $this->_urlparam[] = "beforedays={$conditions['beforedays']}"; + } + + if(!empty($conditions['starttime'])) { + $starttime = strtotime($conditions['starttime']); + $wherearr[] = $prefix.DB::field('dateline', $starttime, '>'); + $this->_urlparam[] = "starttime={$conditions['starttime']}"; + } + if(!empty($conditions['endtime'])) { + $endtime = strtotime($conditions['endtime']); + $wherearr[] = $prefix.DB::field('dateline', $endtime, '<='); + $this->_urlparam[] = "endtime={$conditions['endtime']}"; + } + $conditions['users'] = trim(isset($conditions['users']) ? $conditions['users'] : ''); + if(!empty($conditions['users'])) { + $wherearr[] = $prefix.DB::field('author', explode(' ', trim($conditions['users']))); + $this->_urlparam[] = "users={$conditions['users']}"; + } + + if(!isset($conditions['digest'])) { + } elseif($conditions['digest'] == 1) { + $wherearr[] = $prefix.DB::field('digest', 0, '>'); + $this->_urlparam[] = "digest=1"; + } elseif($conditions['digest'] == 2) { + $wherearr[] = $prefix.DB::field('digest', 0); + $this->_urlparam[] = "digest=2"; + } elseif(is_array($conditions['digest'])) { + $wherearr[] = $prefix.DB::field('digest', $conditions['digest']); + $this->_urlparam[] = "digest=".implode(',', $conditions['digest']); + } + if(!empty($conditions['recommends'])) { + $wherearr[] = $prefix.DB::field('recommends', $conditions['recommends'], '>'); + $this->_urlparam[] = "recommends=".$conditions['recommends']; + } + if(!empty($conditions['authorid'])) { + $wherearr[] = $prefix.DB::field('authorid', $conditions['authorid']); + $this->_urlparam[] = "authorid=".$conditions['authorid']; + } + if(!isset($conditions['attach'])) { + } elseif($conditions['attach'] == 1) { + $wherearr[] = $prefix.DB::field('attachment', 0, '>'); + $this->_urlparam[] = "attach=1"; + } elseif($conditions['attach'] == 2) { + $wherearr[] = $prefix.DB::field('attachment', 0); + $this->_urlparam[] = "attach=2"; + } + if(!isset($conditions['rate'])){ + } elseif($conditions['rate'] == 1) { + $wherearr[] = $prefix.DB::field('rate', 0, '>'); + $this->_urlparam[] = "rate=1"; + } elseif($conditions['rate'] == 2) { + $wherearr[] = $prefix.DB::field('rate', 0); + $this->_urlparam[] = "rate=2"; + } + if(!isset($conditions['highlight'])) { + } elseif($conditions['highlight'] == 1) { + $wherearr[] = $prefix.DB::field('highlight', 0, '>'); + $this->_urlparam[] = "highlight=1"; + } elseif($conditions['highlight'] == 2) { + $wherearr[] = $prefix.DB::field('highlight', 0); + $this->_urlparam[] = "highlight=2"; + } + if(isset($conditions['hidden']) && $conditions['hidden'] == 1) { + $wherearr[] = $prefix.DB::field('hidden', 0, '>'); + $this->_urlparam[] = "hidden=1"; + } + if(!empty($conditions['special'])) { + $this->_urlparam[] = "special={$conditions['special']}"; + if($conditions['specialthread'] == 1) { + $wherearr[] = $prefix.DB::field('special', $conditions['special']); + $this->_urlparam[] = "specialthread=1"; + } elseif($conditions['specialthread'] == 2) { + $wherearr[] = $prefix.DB::field('special', $conditions['special'], 'notin'); + $this->_urlparam[] = "specialthread=2"; + } + } + if(isset($conditions['isgroup']) && in_array($conditions['isgroup'], array(0, 1))) { + $wherearr[] = $prefix.DB::field('isgroup', $conditions['isgroup']); + } + + if(!empty($conditions['keywords']) && trim($conditions['keywords'])) { + $sqlkeywords = ''; + $or = ''; + $keywords = explode(',', str_replace(' ', '', $conditions['keywords'])); + for($i = 0; $i < count($keywords); $i++) { + $sqlkeywords .= " $or ".$prefix.DB::field('subject', '%'.$keywords[$i].'%', 'like'); + $or = 'OR'; + } + $wherearr[] = "($sqlkeywords)"; + $this->_urlparam[] = "keywords={$conditions['keywords']}"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return $wheresql; + } + + public function get_posttableid() { + return $this->_posttableid; + } + public function get_url_param() { + return $this->_urlparam; + } + + public function update_displayorder_by_tid_displayorder($tids, $olddisplayorder, $newdisplayorder) { + $tids = dintval((array)$tids, true); + if($tids) { + return DB::query('UPDATE %t SET displayorder=%d WHERE tid IN (%n) AND displayorder=%d', array($this->get_table_name(), $newdisplayorder, $tids, $olddisplayorder)); + } + return 0; + } + + public function update($tid, $data, $unbuffered = false, $low_priority = false, $tableid = 0, $realdata = false) { + $tid = dintval($tid, true); + if($data && is_array($data) && $tid) { + if(!$realdata) { + $num = DB::update($this->get_table_name($tableid), $data, DB::field('tid', $tid), $unbuffered, $low_priority); + $this->update_batch_cache((array)$tid, $data); + } else { + $num = DB::query('UPDATE '.DB::table($this->get_table_name($tableid))." SET ".implode(',', $data)." WHERE ".DB::field('tid', $tid), 'UNBUFFERED'); + $this->clear_cache($tid); + } + return $num; + } + return !$unbuffered ? 0 : false; + } + + public function update_by_fid($fid, $data, $tableid = 0) { + $fid = dintval($fid, true); + if($data && is_array($data) && $fid) { + return DB::update($this->get_table_name($tableid), $data, DB::field('fid', $fid)); + } + return array(); + } + public function update_by_tid_displayorder($tid, $displayorder, $data, $fid = 0, $tableid = 0) { + $condition = array(); + $tid = dintval($tid, true); + $condition[] = DB::field('tid', $tid); + if($fid) { + $fid = dintval($fid, true); + $condition[] = DB::field('fid', $fid); + } + $condition[] = DB::field('displayorder', $displayorder); + if($data && is_array($data) && $tid) { + return DB::update($this->get_table_name($tableid), $data, implode(' AND ', $condition)); + } + return 0; + } + public function update_by_closed($tids, $data, $tableid = 0) { + $tids = dintval($tids, true); + if(!empty($data) && is_array($data)) { + $num = DB::update($this->get_table_name($tableid), $data, DB::field('closed', $tids), true); + if($num) { + foreach((array)$tids as $tid) { + $this->update_cache($tid, $data, $this->_cache_ttl); + } + } + return $num; + } + return 0; + } + + public function update_status_by_tid($tids, $value, $glue = '|') { + $tids = dintval($tids, true); + if($tids) { + $this->clear_cache((array)$tids); + $glue = helper_util::check_glue($glue); + return DB::query("UPDATE %t SET status=status{$glue}%s WHERE tid IN(%n)", array($this->get_table_name(), $value, (array)$tids)); + } + return 0; + } + + public function update_sortid_by_sortid($sortid, $oldsortid) { + $sortid = dintval($sortid); + $oldsortid = dintval($oldsortid, true); + if($oldsortid) { + return DB::query("UPDATE %t SET sortid=%d WHERE sortid IN (%n)", array($this->get_table_name(), $sortid, $oldsortid)); + } + return 0; + } + + public function increase($tids, $fieldarr, $low_priority = false, $tableid = 0, $getsetarr = false) { + $tids = dintval((array)$tids, true); + $sql = array(); + $num = 0; + $allowkey = array('views', 'replies', 'recommends', 'recommend_add', 'recommend_sub', 'favtimes', 'sharetimes', 'moderated', 'heats', 'lastposter', 'lastpost', 'attachment'); + foreach($fieldarr as $key => $value) { + if(in_array($key, $allowkey)) { + if(is_array($value)) { + $sql[] = DB::field($key, $value[0]); + } else { + $value = dintval($value); + $sql[] = "`$key`=`$key`+'$value'"; + } + } else { + unset($fieldarr[$key]); + } + } + if($getsetarr) { + return $sql; + } + if(!empty($sql)){ + $cmd = "UPDATE " . ($low_priority ? 'LOW_PRIORITY ' : ''); + $num = DB::query($cmd.DB::table($this->get_table_name($tableid))." SET ".implode(',', $sql)." WHERE tid IN (".dimplode($tids).")", 'UNBUFFERED'); + $this->increase_cache($tids, $fieldarr); + } + return $num; + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if($data && is_array($data)) { + $this->clear_cache($data['fid'], 'forumdisplay_'); + return DB::insert($this->_table, $data, $return_insert_id, $replace, $silent); + } + return 0; + } + + public function insert_thread_copy_by_tid($tids, $origin = 0, $target = 0) { + $tids = dintval($tids, true); + if($tids) { + $wheresql = is_array($tids) && $tids ? 'tid IN(%n)' : 'tid=%d'; + DB::query("INSERT INTO %t SELECT * FROM %t WHERE $wheresql", array($this->get_table_name($target), $this->get_table_name($origin), $tids)); + } + } + + public function count_by_authorid($authorid, $tableid = 0) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE authorid=%d", array($this->get_table_name($tableid), $authorid)); + } + + public function count_by_authorid_displayorder($authorid, $displayorder, $tableid = 0) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE authorid=%d AND displayorder=%d", array($this->get_table_name($tableid), $authorid, $displayorder)); + } + + public function count_by_fid($fid, $tableid = 0) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE fid=%d", array($this->get_table_name($tableid), $fid)); + } + + public function count_by_displayorder($displayorder) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE displayorder=%d", array($this->get_table_name(), $displayorder)); + } + + public function count_by_replies($number, $glue = '>') { + $glue = helper_util::check_glue($glue); + return DB::result_first("SELECT COUNT(*) FROM %t WHERE replies{$glue}%d", array($this->get_table_name(), $number)); + } + + public function count_by_fid_typeid_displayorder($fid, $typeid = null, $displayorder = null, $glue = '=') { + + $parameter = array($this->get_table_name(), $fid); + $wherearr = array(); + $fid = dintval($fid, true); + $wherearr[] = is_array($fid) ? 'fid IN(%n)' : 'fid=%d'; + + if($typeid) { + $parameter[] = $typeid; + $wherearr[] = "typeid=%d"; + } + if($displayorder !== null) { + $parameter[] = $displayorder; + $glue = helper_util::check_glue($glue); + $wherearr[] = "displayorder{$glue}%d"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first("SELECT COUNT(*) FROM %t $wheresql", $parameter); + } + public function count_posts_by_fid($fid, $forcetableid = null) { + $data = array('threads' => 0, 'posts' => 0); + loadcache('threadtableids'); + $threadtableids = array(0); + $tableids = getglobal('cache/threadtableids'); + if(!empty($tableids)) { + if($forcetableid === null || ($forcetableid > 0 && !in_array($forcetableid, $tableids))) { + $threadtableids = array_merge($threadtableids, $tableids); + } else { + $threadtableids = array(intval($forcetableid)); + } + } + $threadtableids = array_unique($threadtableids); + foreach($threadtableids as $tableid) { + $value = DB::fetch_first('SELECT COUNT(*) AS threads, SUM(replies)+COUNT(*) AS posts FROM %t WHERE fid=%d AND displayorder>=0', array($this->get_table_name($tableid), $fid)); + $data['threads'] += intval($value['threads']); + $data['posts'] += intval($value['posts']); + } + return $data; + } + public function count_by_fid_displayorder_authorid($fid, $displayorder, $authorid, $tableid=0) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE fid=%d AND displayorder=%d AND authorid=%d", array($this->get_table_name($tableid), $fid, $displayorder, $authorid)); + } + public function count_all_thread() { + $count = 0; + $settings = C::t('common_setting')->fetch_all_setting('threadtableids', true); + if(empty($settings['threadtableids']) || !is_array($settings['threadtableids'])) { + $settings['threadtableids'] = array(0); + } + foreach($settings['threadtableids'] as $tableid) { + $count += $this->count_by_tableid($tableid); + } + return $count; + } + public function count_by_posttableid_displayorder($tableid = 0, $posttableid = 0, $displayorder = 0) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE posttableid=%d AND displayorder=%d', array($this->get_table_name($tableid), $posttableid, $displayorder)); + } + + public function count_by_tableid($tableid) { + return DB::result_first("SELECT COUNT(*) FROM %t", array($this->get_table_name($tableid))); + } + + public function count_by_tid_fid($tids, $fids = array(), $isgroup = -1, $author = '', $subject = '') { + $condition = $this->make_query_condition($tids, $fids, $isgroup, $author, $subject); + return DB::result_first("SELECT COUNT(*) FROM %t $condition[0]", $condition[1]); + } + + + public function count_group_thread_by_fid($fid) { + return DB::fetch_all('SELECT COUNT(*) AS num, authorid FROM %t WHERE fid=%d GROUP BY authorid', array($this->get_table_name(), $fid)); + } + public function count_group_by_fid($tableid = 0) { + return DB::fetch_all('SELECT fid, COUNT(*) AS threads, SUM(replies)+COUNT(*) AS posts FROM %t GROUP BY fid', array($this->get_table_name($tableid))); + } + + public function count_special_group_by_special() { + return DB::fetch_all('SELECT special, count(*) AS spcount FROM %t GROUP BY special', array($this->get_table_name())); + } + + public function count_by_recyclebine($fid = 0, $isgroup = 0, $author = array(), $username = array(), $pstarttime = 0, $pendtime = 0, $mstarttime = 0, $mendtime = 0, $keywords = '') { + $sql = $this->recyclebine_where($fid, $isgroup, $author, $username, $pstarttime, $pendtime, $mstarttime, $mendtime, $keywords); + return DB::result_first('SELECT COUNT(*) FROM '.DB::table('forum_thread').' t LEFT JOIN '.DB::table('forum_threadmod').' tm ON tm.tid=t.tid '.$sql[0], $sql[1]); + } + + public function delete_by_tid($tids, $unbuffered = false, $tableid = 0, $limit = 0) { + $tids = dintval($tids, true); + if($tids) { + $this->clear_cache($tids); + C::t('forum_newthread')->delete_by_tids($tids); + return DB::delete($this->get_table_name($tableid), DB::field('tid', $tids), $limit, $unbuffered); + } + return !$unbuffered ? 0 : false; + } + public function delete($tids, $unbuffered = false, $tableid = 0, $limit = 0) { + return $this->delete_by_tid($tids, $unbuffered, $tableid, $limit); + } + public function delete_by_fid($fid, $unbuffered = false, $tableid = 0, $limit = 0) { + $fid = dintval($fid, true); + if($fid) { + foreach((array)$fid as $delfid) { + $this->clear_cache($delfid, 'forumdisplay_'); + } + C::t('forum_newthread')->delete_by_tids($fid); + return DB::delete($this->get_table_name($tableid), DB::field('fid', $fid), $limit, $unbuffered); + } + return 0; + } + public function get_table_name($tableid = 0){ + $tableid = intval($tableid); + return $tableid ? "forum_thread_$tableid" : 'forum_thread'; + } + public function fetch_all_for_guide($type, $limittid, $tids = array(), $heatslimit = 3, $dateline = 0, $start = 0, $limit = 600, $fids = 0) { + switch ($type) { + case 'hot' : + $addsql = ' AND heats>='.intval($heatslimit); + break; + case 'digest' : + $addsql = ' AND digest>0'; + break; + default : + $addsql = ''; + } + if(getglobal('setting/followforumid')) { + $addsql .= ' AND '.DB::field('fid', getglobal('setting/followforumid'), '<>'); + } + $tidsql = ''; + if($tids) { + $tids = dintval($tids, true); + $tidsql = DB::field('tid', $tids); + } else { + $limittid = intval($limittid); + $tidsql = 'tid>'.$limittid; + $fids = dintval($fids, true); + if($fids) { + $tidsql .= is_array($fids) && $fids ? ' AND fid IN('.dimplode($fids).')' : ' AND fid='.$fids; + } + if($dateline) { + $addsql .= ' AND dateline > '.intval($dateline); + } + if($type == 'newthread') { + $orderby = 'tid'; + } elseif($type == 'reply') { + $orderby = 'lastpost'; + $addsql .= ' AND replies > 0'; + } else { + $orderby = 'lastpost'; + } + $addsql .= ' AND displayorder>=0 ORDER BY '.$orderby.' DESC '.DB::limit($start, $limit); + + } + return DB::fetch_all("SELECT * FROM ".DB::table('forum_thread')." WHERE ".$tidsql.$addsql); + } + public function fetch_max_tid() { + return DB::result_first("SELECT MAX(tid) as maxtid FROM ".DB::table('forum_thread')); + } + public function move_thread_by_tid($tids, $source, $target) { + $source = intval($source); + $target = intval($target); + if($source != $target) { + DB::query('REPLACE INTO %t SELECT * FROM %t WHERE tid IN (%n)', array($this->get_table_name($target), $this->get_table_name($source), $tids)); + if(!$source) { + C::t('forum_threadhidelog')->delete_by_tid($tids); + } + return DB::delete($this->get_table_name($source), DB::field('tid', $tids)); + } else { + return false; + } + } + + function gettablestatus($tableid = 0) { + $table_info = DB::fetch_first("SHOW TABLE STATUS LIKE '".str_replace('_', '\_', DB::table($this->get_table_name($tableid)))."'"); + $table_info['Data_length'] = $table_info['Data_length'] / 1024 / 1024; + $nums = intval(log($table_info['Data_length']) / log(10)); + $digits = 0; + if($nums <= 3) { + $digits = 3 - $nums; + } + $table_info['Data_length'] = number_format($table_info['Data_length'], $digits).' MB'; + + $table_info['Index_length'] = $table_info['Index_length'] / 1024 / 1024; + $nums = intval(log($table_info['Index_length']) / log(10)); + $digits = 0; + if($nums <= 3) { + $digits = 3 - $nums; + } + $table_info['Index_length'] = number_format($table_info['Index_length'], $digits).' MB'; + return $table_info; + } + + private function recyclebine_where($fid = 0, $isgroup = 0, $authors = array(), $username = array(), $pstarttime = 0, $pendtime = 0, $mstarttime = 0, $mendtime = 0, $keywords = '') { + $parameter = array(); + $wherearr = array('t.displayorder=-1', 'tm.action=\'DEL\''); + if($fid) { + $fid = dintval($fid, true); + $parameter[] = $fid; + $wherearr[] = is_array($fid) ? 't.fid IN(%n)' : 't.fid=%d'; + } + if($isgroup) { + $wherearr[] = 't.isgroup=1'; + } + if(!empty($authors)) { + $parameter[] = $authors; + $wherearr[] = is_array($authors) && $authors ? 't.author IN(%n)' : 't.author=%s'; + } + if(!empty($username)) { + $parameter[] = $username; + $wherearr[] = is_array($username) && $username ? 'tm.username IN(%n)' : 'tm.username=%s'; + } + if($pstarttime) { + $parameter[] = $pstarttime; + $wherearr[] = 't.dateline>=%d'; + } + if($pendtime) { + $parameter[] = $pendtime; + $wherearr[] = 't.dateline<%d'; + } + if($mstarttime) { + $parameter[] = $mstarttime; + $wherearr[] = 'tm.dateline>=%d'; + } + if($mendtime) { + $parameter[] = $mendtime; + $wherearr[] = 'tm.dateline<%d'; + } + if($keywords) { + $keysql = array(); + foreach(explode(',', str_replace(' ', '', $keywords)) as $keyword) { + $parameter[] = '%'.$keyword.'%'; + $keysql[] = "t.subject LIKE %s"; + } + if($keysql) { + $wherearr[] = '('.implode(' OR ', $keysql).')'; + } + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return array($wheresql, $parameter); + } + public function create_table($maxtableid) { + if($maxtableid) { + DB::query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT'); + $db = &DB::object(); + $query = DB::query("SHOW CREATE TABLE %t", array($this->get_table_name())); + $create = $db->fetch_row($query); + $createsql = $create[1]; + $createsql = str_replace(DB::table($this->get_table_name()), DB::table($this->get_table_name($maxtableid)), $createsql); + DB::query($createsql); + + return true; + } else { + return false; + } + } + public function drop_table($tableid) { + $tableid = intval($tableid); + if($tableid) { + DB::query("DROP TABLE %t", array($this->get_table_name($tableid)), true); + return true; + } else { + return false; + } + } + private function compare_number($firstnum, $secondnum, $glue = '>=') { + switch($glue) { + case '==': + case '=': + return $firstnum == $secondnum; + break; + case '>': + return $firstnum > $secondnum; + break; + case '<': + return $firstnum < $secondnum; + break; + case '<>': + return $firstnum <> $secondnum; + break; + case '<=': + return $firstnum <= $secondnum; + break; + case '>=': + return $firstnum >= $secondnum; + break; + } + return false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadaddviews.php b/source/class/table/table_forum_threadaddviews.php new file mode 100644 index 0000000..a90e8e5 --- /dev/null +++ b/source/class/table/table_forum_threadaddviews.php @@ -0,0 +1,32 @@ +_table = 'forum_threadaddviews'; + $this->_pk = 'tid'; + $this->_pre_cache_key = 'forum_threadaddviews_'; + $this->_cache_ttl = 0; + parent::__construct(); + } + + public function update_by_tid($tid) { + $ret = DB::query('UPDATE %t SET `addviews`=`addviews`+1 WHERE tid=%d', array($this->_table, $tid)); + $this->increase_cache(array($tid), array('addviews' => 1)); + return $ret; + } + public function fetch_all_order_by_tid($start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t ORDER BY tid'.DB::limit($start, $limit), array($this->_table), $this->_pk); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadcalendar.php b/source/class/table/table_forum_threadcalendar.php new file mode 100644 index 0000000..aacdd46 --- /dev/null +++ b/source/class/table/table_forum_threadcalendar.php @@ -0,0 +1,87 @@ +_table = 'forum_threadcalendar'; + $this->_pk = 'cid'; + + parent::__construct(); + } + + public function fetch_by_fid_dateline($fid, $dateline = 0, $order = 'dateline', $sort = 'DESC') { + $parameter = array($this->_table); + $wherearr = array(); + $wheresql = ''; + if($fid) { + $wherearr[] = 'fid=%d'; + $parameter[] = $fid; + } + if($dateline) { + $wherearr[] = 'dateline=%d'; + $parameter[] = $dateline; + } + if($wherearr) { + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + } + return DB::fetch_first('SELECT * FROM %t '.$wheresql.' ORDER BY '.DB::order($order, $sort), $parameter, $this->_pk); + } + + public function fetch_all_by_dateline($dateline) { + $dateline = dintval($dateline); + if($dateline) { + return DB::fetch_all('SELECT * FROM %t WHERE dateline=%d', array($this->_table, $dateline), 'fid'); + } else { + return array(); + } + } + + public function fetch_all_by_fid_dateline($fids, $dateline = 0) { + $parameter = array($this->_table); + $wherearr = array(); + $wheresql = ''; + $fids = dintval($fids, true); + if($fids) { + $wherearr[] = is_array($fids) ? 'fid IN(%n)' : 'fid=%d'; + $parameter[] = $fids; + } + $dateline = dintval($dateline); + if($dateline) { + $wherearr[] = 'dateline=%d'; + $parameter[] = $dateline; + } + if($wherearr) { + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + } + return DB::fetch_all('SELECT * FROM %t '.$wheresql, $parameter, 'fid'); + } + + public function insert_multiterm($dataarr) { + $allkey = array('fid', 'dateline', 'hotnum'); + $sql = array(); + foreach($dataarr as $key => $value) { + if(is_array($value)) { + $fid = dintval($value['fid']); + $dateline = dintval($value['dateline']); + $hotnum = dintval($value['hotnum']); + $sql[] = "($fid, $dateline, $hotnum)"; + } + } + if($sql) { + return DB::query('INSERT INTO '.DB::table($this->_table)." (`fid`, `dateline`, `hotnum`) VALUES ".implode(',', $sql), true); + } + return false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadclass.php b/source/class/table/table_forum_threadclass.php new file mode 100644 index 0000000..967cbdf --- /dev/null +++ b/source/class/table/table_forum_threadclass.php @@ -0,0 +1,96 @@ +_table = 'forum_threadclass'; + $this->_pk = 'typeid'; + + parent::__construct(); + } + public function fetch_by_fid_name($fid, $name) { + return DB::fetch_first('SELECT * FROM %t WHERE fid=%d AND name=%s', array($this->_table, $fid, $name)); + } + public function fetch_all_by_typeid($typeids) { + $typeids = dintval($typeids, is_array($typeids) ? true : false); + if($typeids) { + return DB::fetch_all('SELECT * FROM %t WHERE typeid IN(%n) ORDER BY displayorder', array($this->_table, $typeids), $this->_pk); + } + return array(); + } + public function fetch_all_by_fid($fid) { + return DB::fetch_all('SELECT * FROM %t WHERE fid=%d ORDER BY displayorder', array($this->_table, $fid), $this->_pk); + } + public function fetch_all_by_typeid_fid($typeid, $fid) { + $typeid = dintval($typeid, is_array($typeid) ? true : false); + $fid = dintval($fid, is_array($fid) ? true : false); + $parameter = array($this->_table, $typeid, $fid); + $wheresql = is_array($typeid) && $typeid ? 'typeid IN(%n)' : 'typeid=%d'; + $wheresql .= ' AND '.(is_array($fid) && $fid ? 'fid IN(%n)' : 'fid=%d'); + return DB::fetch_all('SELECT * FROM %t WHERE '.$wheresql, $parameter, $this->_pk); + } + public function update_by_fid($fid, $data) { + $fid = dintval($fid, is_array($fid) ? true : false); + if(is_array($fid) && empty($fid)) { + return 0; + } + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('fid', $fid)); + } + return 0; + } + public function update_by_typeid($typeid, $data) { + $typeid = dintval($typeid, is_array($typeid) ? true : false); + if(is_array($typeid) && empty($typeid)) { + return 0; + } + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('typeid', $typeid)); + } + return 0; + } + public function update_by_typeid_fid($typeid, $fid, $data) { + $typeid = dintval($typeid, is_array($typeid) ? true : false); + $fid = dintval($fid, is_array($fid) ? true : false); + if(empty($typeid) || empty($fid)) { + return 0; + } + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('typeid', $typeid).' AND '.DB::field('fid', $fid)); + } + return 0; + } + public function delete_by_typeid($typeid) { + $typeid = dintval($typeid, is_array($typeid) ? true : false); + if(empty($typeid)) { + return 0; + } + return DB::delete($this->_table, DB::field('typeid', $typeid)); + } + public function delete_by_typeid_fid($typeid, $fid) { + $typeid = dintval($typeid, is_array($typeid) ? true : false); + $fid = dintval($fid, is_array($fid) ? true : false); + if(empty($typeid) || empty($fid)) { + return 0; + } + return DB::delete($this->_table, DB::field('typeid', $typeid).' AND '.DB::field('fid', $fid)); + } + public function count_by_fid($fid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE fid=%d', array($this->_table, $fid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadclosed.php b/source/class/table/table_forum_threadclosed.php new file mode 100644 index 0000000..d50f74a --- /dev/null +++ b/source/class/table/table_forum_threadclosed.php @@ -0,0 +1,21 @@ +_table = 'forum_threadclosed'; + $this->_pk = 'tid'; + parent::__construct(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threaddisablepos.php b/source/class/table/table_forum_threaddisablepos.php new file mode 100644 index 0000000..472d5c4 --- /dev/null +++ b/source/class/table/table_forum_threaddisablepos.php @@ -0,0 +1,49 @@ +_table = 'forum_threaddisablepos'; + $this->_pk = 'tid'; + $this->_pre_cache_key = 'forum_threaddisablepos_'; + $this->_cache_ttl = 0; + parent::__construct(); + + $this->enable_set = $this->_allowmem && C::memory()->gotset; + } + + public function truncate() { + if (!$this->enable_set) { + DB::query("TRUNCATE ".DB::table('forum_threaddisablepos')); + } + return memory('rm', 'idx_threaddisablepos', $this->_pre_cache_key); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (!$this->enable_set) { + return parent::insert($data, $return_insert_id, $replace, $silent); + } + return memory('sadd', 'idx_threaddisablepos', $data['tid'], 0, $this->_pre_cache_key); + } + + public function fetch($id, $force_from_db = false) { + if (!$this->enable_set) { + return parent::fetch($id, $force_from_db); + } + return memory('sismember', 'idx_threaddisablepos', $id, 0, $this->_pre_cache_key); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadhidelog.php b/source/class/table/table_forum_threadhidelog.php new file mode 100644 index 0000000..a477f66 --- /dev/null +++ b/source/class/table/table_forum_threadhidelog.php @@ -0,0 +1,57 @@ +_table = 'forum_threadhidelog'; + $this->_pk = ''; + + parent::__construct(); + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::insert($data, $return_insert_id, $replace, $silent); + } else { + return $this->insert_hidelog($data, $return_insert_id); + } + } + + public function insert_hidelog($tid, $uid) { + if(!DB::fetch_first('SELECT * FROM %t WHERE tid=%d AND uid=%d', array($this->_table, $tid, $uid))) { + DB::insert($this->_table, array('tid' => $tid, 'uid' => $uid)); + DB::query("UPDATE %t SET hidden=hidden+1 WHERE tid=%d", array('forum_thread', $tid)); + } + } + + public function resetshow($tid) { + $this->delete_by_tid($tid); + DB::update('forum_thread', array('hidden' => 0), DB::field('tid', $tid)); + } + + + public function delete_by_uid($uid) { + return $uid ? DB::delete($this->_table, DB::field('uid', $uid)) : false; + } + + public function delete_by_tid($tid) { + DB::query("UPDATE %t SET hidden=0 WHERE tid IN (%n)", array('forum_thread', $tid)); + return $tid ? DB::delete($this->_table, DB::field('tid', $tid)) : false; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadhot.php b/source/class/table/table_forum_threadhot.php new file mode 100644 index 0000000..dccbc8d --- /dev/null +++ b/source/class/table/table_forum_threadhot.php @@ -0,0 +1,50 @@ +_table = 'forum_threadhot'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_tid_by_cid($cid) { + $tids = array(); + $cid = intval($cid); + if($cid) { + foreach(DB::fetch_all('SELECT * FROM %t WHERE cid=%d', array($this->_table, $cid)) as $value) { + $tids[$value['tid']] = $value['tid']; + } + } + return $tids; + } + + public function insert_multiterm($dataarr) { + $allkey = array('cid', 'fid', 'tid'); + $sql = array(); + foreach($dataarr as $key => $value) { + if($value['cid'] && $value['fid'] && $value['tid']) { + $cid = dintval($value['cid']); + $fid = dintval($value['fid']); + $tid = dintval($value['tid']); + $sql[] = "($cid, $fid, $tid)"; + } + } + if($sql) { + return DB::query('REPLACE INTO '.DB::table($this->_table)." (`cid`, `fid`, `tid`) VALUES ".implode(',', $sql), true); + } + return false; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadimage.php b/source/class/table/table_forum_threadimage.php new file mode 100644 index 0000000..e9f4bfe --- /dev/null +++ b/source/class/table/table_forum_threadimage.php @@ -0,0 +1,52 @@ +_table = 'forum_threadimage'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_threadimage($val); + } + } + + public function delete_threadimage($tid) { + return ($tid = dintval($tid)) ? DB::delete('forum_threadimage', "tid='$tid'") : false; + } + public function delete_by_tid($tids) { + return !empty($tids) ? DB::delete($this->_table, DB::field('tid', $tids)) : false; + } + public function fetch_all_order_by_tid($start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t ORDER BY tid DESC '.DB::limit($start, $limit), array($this->_table), 'tid'); + } + public function fetch_all_order_by_tid_for_guide($start = 0, $limit = 0, $fids = 0) { + $tidsql = ''; + $fids = dintval($fids, true); + if($fids) { + $tidsql = is_array($fids) && $fids ? ' AND t.fid IN('.dimplode($fids).')' : ' AND t.fid='.$fids; + } + return DB::fetch_all('SELECT i.* FROM %t i LEFT JOIN %t t ON i.tid = t.tid WHERE 1 %i ORDER BY i.tid DESC '.DB::limit($start, $limit), array($this->_table, 'forum_thread', $tidsql), 'tid'); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadmod.php b/source/class/table/table_forum_threadmod.php new file mode 100644 index 0000000..5abad9d --- /dev/null +++ b/source/class/table/table_forum_threadmod.php @@ -0,0 +1,77 @@ +_table = 'forum_threadmod'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_by_tid($tid) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d ORDER BY dateline DESC LIMIT 1', array($this->_table, $tid)); + } + public function fetch_by_tid_action_status($tid, $action, $status = 1) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d AND action=%s AND status=%d ORDER BY dateline DESC LIMIT 1', array($this->_table, $tid, $action, $status)); + } + public function fetch_by_tid_magicid($tid, $magicid = 0) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d AND magicid=%d', array($this->_table, $tid, $magicid)); + } + public function fetch_all_by_tid_magicid($tid, $magicid = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE tid=%d AND magicid=%d', array($this->_table, $tid, $magicid)); + } + public function fetch_all_by_tid($tid, $action = '', $start = 0, $limit = 0) { + $tid = dintval($tid, true); + $parameter = array($this->_table, $tid); + $wherearr = array(); + $wherearr[] = is_array($tid) && $tid ? 'tid IN(%n)' : 'tid=%d'; + if($action) { + $parameter[] = $action; + $wherearr[] = is_array($action) && $action ? 'action IN(%n)' : 'action=%s'; + } + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter); + } + public function fetch_all_by_expiration_status($expiration, $status=1) { + return DB::fetch_all('SELECT * FROM %t WHERE expiration>0 AND expiration<%d AND status=%d', array($this->_table, $expiration, $status)); + } + public function fetch_all_recyclebin_by_dateline($dateline, $start = 0, $limit = 0) { + return DB::fetch_all("SELECT tm.tid FROM %t tm, %t t WHERE tm.action='DEL' AND tm.dateline<%d AND t.tid=tm.tid AND t.displayorder=-1".DB::limit($start, $limit), array($this->_table, 'forum_thread', $dateline)); + } + public function count_by_tid_magicid($tid, $magicid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d AND magicid=%d', array($this->_table, $tid, $magicid)); + } + public function delete_by_dateline($dateline) { + $dateline = dintval($dateline); + return DB::delete($this->_table, DB::field('tid', 0, '>').' AND '.DB::field('dateline', $dateline, '<')); + } + public function update_by_tid_action($tids, $action, $data) { + $tids = dintval($tids, true); + if(!empty($data) && is_array($data) && $tids) { + return DB::update($this->_table, $data, DB::field('tid', $tids).' AND '.DB::field('action', $action)); + } + return 0; + } + public function delete_by_tid($tids) { + $tids = dintval($tids, true); + if($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } + return 0; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadpartake.php b/source/class/table/table_forum_threadpartake.php new file mode 100644 index 0000000..4e96caa --- /dev/null +++ b/source/class/table/table_forum_threadpartake.php @@ -0,0 +1,52 @@ +_table = 'forum_threadpartake'; + $this->_pk = ''; + + parent::__construct(); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + return $this->delete_threadpartake($val); + } + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_threadpartake($id, $force_from_db); + } + } + + public function delete_threadpartake($dateline) { + return DB::query('DELETE FROM %t WHERE dateline<%d', array($this->_table, $dateline), false, true); + } + + public function fetch_threadpartake($tid, $uid) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d AND uid=%d', array($this->_table, $tid, $uid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadpreview.php b/source/class/table/table_forum_threadpreview.php new file mode 100644 index 0000000..2c34c6b --- /dev/null +++ b/source/class/table/table_forum_threadpreview.php @@ -0,0 +1,31 @@ +_table = 'forum_threadpreview'; + $this->_pk = 'tid'; + + parent::__construct(); + } + public function count_by_tid($tid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d', array($this->_table, $tid)); + } + public function update_relay_by_tid($tid, $value) { + return DB::query('UPDATE %t SET relay=relay+\'%d\' WHERE tid=%d', array($this->_table, $value, $tid)); + } + public function delete_by_tid($tids) { + return DB::delete($this->_table, DB::field('tid', $tids)); + } +} +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadprofile.php b/source/class/table/table_forum_threadprofile.php new file mode 100644 index 0000000..19695fc --- /dev/null +++ b/source/class/table/table_forum_threadprofile.php @@ -0,0 +1,44 @@ +_table = 'forum_threadprofile'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function fetch_all($ids = null, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_threadprofile(); + } + } + + public function fetch_all_threadprofile() { + return DB::fetch_all('SELECT * FROM %t', array($this->table), $this->_pk); + } + + public function reset_default($tpid) { + DB::query("UPDATE %t SET `global`=0", array($this->table)); + DB::query("UPDATE %t SET `global`=1 WHERE id=%d", array($this->table, $tpid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadprofile_group.php b/source/class/table/table_forum_threadprofile_group.php new file mode 100644 index 0000000..54101a4 --- /dev/null +++ b/source/class/table/table_forum_threadprofile_group.php @@ -0,0 +1,43 @@ +_table = 'forum_threadprofile_group'; + $this->_pk = 'gid'; + + parent::__construct(); + } + + public function fetch_all($ids = null, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_threadprofile(); + } + } + + public function fetch_all_threadprofile() { + return DB::fetch_all('SELECT * FROM %t', array($this->table), $this->_pk); + } + + public function delete_by_tpid($tpid) { + DB::delete($this->table, "tpid='$tpid'"); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadrush.php b/source/class/table/table_forum_threadrush.php new file mode 100644 index 0000000..25db509 --- /dev/null +++ b/source/class/table/table_forum_threadrush.php @@ -0,0 +1,27 @@ +_table = 'forum_threadrush'; + $this->_pk = 'tid'; + $this->_pre_cache_key = 'forum_threadrush_'; + $this->_cache_ttl = 0; + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_threadtype.php b/source/class/table/table_forum_threadtype.php new file mode 100644 index 0000000..7c29217 --- /dev/null +++ b/source/class/table/table_forum_threadtype.php @@ -0,0 +1,43 @@ +_table = 'forum_threadtype'; + $this->_pk = 'typeid'; + + parent::__construct(); + } + + public function fetch_all_for_cache() { + return DB::fetch_all("SELECT t.typeid AS sortid, tt.optionid, tt.title, tt.type, tt.unit, tt.rules, tt.identifier, tt.description, tt.permprompt, tv.required, tv.unchangeable, tv.search, tv.subjectshow, tt.expiration, tt.protect + FROM ".DB::table('forum_threadtype')." t + LEFT JOIN ".DB::table('forum_typevar')." tv ON t.typeid=tv.sortid + LEFT JOIN ".DB::table('forum_typeoption')." tt ON tv.optionid=tt.optionid + WHERE t.special='1' AND tv.available='1' + ORDER BY tv.displayorder"); + } + public function fetch_all_for_order($typeid = array()) { + if(!empty($typeid)) { + $where = ' WHERE '.DB::field('typeid', $typeid); + } + return DB::fetch_all("SELECT * FROM ".DB::table('forum_threadtype')." $where ORDER BY displayorder"); + } + public function checkname($name) { + return DB::result_first("SELECT typeid FROM %t WHERE name=%s", array($this->_table, $name)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_trade.php b/source/class/table/table_forum_trade.php new file mode 100644 index 0000000..e6b4f0f --- /dev/null +++ b/source/class/table/table_forum_trade.php @@ -0,0 +1,107 @@ +_table = 'forum_trade'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_all_thread_goods($tid, $pid = 0) { + $pidsql = $pid ? ' AND '.DB::field('pid', $pid) : ''; + return DB::fetch_all("SELECT * FROM %t WHERE tid=%d $pidsql ORDER BY displayorder", array($this->_table, $tid)); + } + public function fetch_counter_thread_goods($tid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d', array($this->_table, $tid)); + } + public function fetch_all_for_seller($sellerid, $limit = 10, $tid = 0) { + $tidsql = $tid ? ' AND '.DB::field('tid', $tid) : ''; + return DB::fetch_all("SELECT * FROM %t WHERE sellerid=%d $tidsql ORDER BY displayorder DESC LIMIT %d", array($this->_table, $sellerid, $limit)); + } + public function fetch_first_goods($tid) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d ORDER BY displayorder DESC LIMIT 1', array($this->_table, $tid)); + } + public function fetch_goods($tid, $pid, $orderby = '', $ascdesc = 'asc', $start = 0, $limit = 0) { + if(empty($pid)) { + return array(); + } + if($tid) { + $tidsql = DB::field('tid', $tid).' AND '; + } + if($orderby) { + $ordersql = " ORDER BY ".DB::order($orderby, $ascdesc); + } + return DB::fetch_first("SELECT * FROM %t WHERE $tidsql ".DB::field('pid', $pid).$ordersql.DB::limit($start, $limit), array($this->_table)); + } + public function fetch_all_statvars($fieldname, $limit = 10) { + if(empty($fieldname)) { + return array(); + } + return DB::fetch_all("SELECT subject, tid, pid, seller, sellerid, SUM(%s) as %s + FROM ".DB::table('forum_trade')." + WHERE %s>0 + GROUP BY sellerid + ORDER BY %s DESC ".DB::limit($limit), array($fieldname, $fieldname, $fieldname)); + } + public function update_closed($expiration) { + DB::query("UPDATE %t SET closed='1' WHERE expiration>0 AND expiration<%d", array($this->_table, $expiration)); + } + public function check_goods($pid) { + return DB::result_first('SELECT count(*) FROM %t WHERE pid=%d', array($this->_table, $pid)); + } + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_trade($val, $data, $unbuffered); + } + } + public function update_trade($tid, $pid, $data) { + if(empty($data) || !is_array($data)) { + return false; + } + DB::update('forum_trade', $data, array('tid' => $tid, 'pid' => $pid)); + } + public function update_counter($tid, $pid, $items, $price, $credit, $amount = 0) { + DB::query('UPDATE %t SET totalitems=totalitems+\'%d\', tradesum=tradesum+\'%d\', credittradesum=credittradesum+\'%d\', amount=amount+\'%d\' WHERE tid=%d AND pid=%d', array($this->_table, $items, $price, $credit, $amount, $tid, $pid)); + } + public function delete_by_id_idtype($ids, $idtype) { + if(empty($ids) || empty($idtype)) { + return false; + } + DB::delete($this->_table, DB::field($idtype, $ids)); + } + public function fetch_all_for_search($digestltd, $fids, $topltd, $sqlsrch, $start = 0, $limit = 0) { + return DB::fetch_all("SELECT tr.tid, tr.pid, t.closed FROM ".DB::table('forum_trade')." tr INNER JOIN ".DB::table('forum_thread')." t ON tr.tid=t.tid AND $digestltd t.".DB::field('fid', $fids)." $topltd WHERE$sqlsrch ORDER BY tr.pid DESC".DB::limit($start, $limit)); + } + public function fetch_all_for_space($wheresql, $ordersql, $count = 0, $start = 0, $limit = 0) { + if(empty($wheresql)) { + return array(); + } + if($count) { + return DB::result_first("SELECT COUNT(*) FROM ".DB::table('forum_trade')." t WHERE $wheresql"); + } + if($ordersql && is_string($ordersql)) { + $ordersql = ' ORDER BY '.$ordersql; + } + return DB::fetch_all("SELECT t.* FROM ".DB::table('forum_trade')." t + INNER JOIN ".DB::table('forum_thread')." th ON t.tid=th.tid AND th.displayorder>='0' + WHERE $wheresql $ordersql ".DB::limit($start, $limit)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_tradecomment.php b/source/class/table/table_forum_tradecomment.php new file mode 100644 index 0000000..fa5da07 --- /dev/null +++ b/source/class/table/table_forum_tradecomment.php @@ -0,0 +1,55 @@ +_table = 'forum_tradecomment'; + $this->_pk = 'id'; + + parent::__construct(); + } + + function fetch_all_by_rateeid($rateeid, $type, $dateline = 0) { + $dateline = $dateline ? 'AND dateline>='.intval($dateline) : ''; + return DB::fetch_all("SELECT * FROM %t WHERE rateeid=%d AND type=%d %i", array($this->_table, $rateeid, $type, $dateline)); + } + + function fetch_all_list($from, $uid, $dateline, $score, $start) { + $sql = $from == 'myself' ? "tc.raterid='".intval($uid)."'" : "tc.rateeid='".intval($uid)."'"; + $sql .= $from == 'buyer' ? ' AND tc.type=0' : ($from == 'seller' ? ' AND tc.type=1' : ''); + $dateline = $dateline !== false ? ' AND tc.dateline>='.intval($dateline) : ''; + $score = $score !== false ? ' AND tc.score='.intval($score) : ''; + + return DB::fetch_all("SELECT tc.*, tl.subject, tl.price, tl.credit FROM %t tc LEFT JOIN %t tl USING(orderid) WHERE %i %i %i ORDER BY tc.dateline DESC LIMIT %d, 10", + array($this->_table, 'forum_tradelog', $sql, $dateline, $score, $start)); + } + + function count_list($from, $uid, $dateline, $score) { + $sql = $from == 'myself' ? "tc.raterid='".intval($uid)."'" : "tc.rateeid='".intval($uid)."'"; + $sql .= $from == 'buyer' ? ' AND tc.type=0' : ($from == 'seller' ? ' AND tc.type=1' : ''); + $dateline = $dateline !== false ? ' AND tc.dateline>='.intval($dateline) : ''; + $score = $score !== false ? ' AND tc.score='.intval($score) : ''; + + return DB::result_first("SELECT COUNT(*) FROM %t tc WHERE %i %i %i", array($this->_table, $sql, $dateline, $score)); + } + + function get_month_score($uid, $type, $rateeid) { + $monthfirstday = mktime(0, 0, 0, date('m', TIMESTAMP), 1, date('Y', TIMESTAMP)); + return DB::result_first("SELECT COUNT(score) FROM %t WHERE raterid=%d AND type=%d AND dateline>=%d AND rateeid=%d", array($this->_table, $uid, $type, $monthfirstday, $rateeid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_tradelog.php b/source/class/table/table_forum_tradelog.php new file mode 100644 index 0000000..11a9d99 --- /dev/null +++ b/source/class/table/table_forum_tradelog.php @@ -0,0 +1,88 @@ +_table = 'forum_tradelog'; + $this->_pk = 'orderid'; + + parent::__construct(); + } + + public function count_by_status($status) { + $status = $status >= 0 ? 'WHERE status='.intval($status) : ''; + return DB::fetch_first("SELECT COUNT(*) AS num, SUM(price) AS pricesum, SUM(credit) AS creditsum, SUM(tax) AS taxsum FROM %t %i", array($this->_table, $status)); + } + + public function fetch_all_by_status($status, $start, $limit) { + $status = $status >= 0 ? 'WHERE status='.intval($status) : ''; + return DB::fetch_all("SELECT * FROM %t %i ORDER BY lastupdate DESC LIMIT %d, %d", array($this->_table, $status, $start, $limit)); + } + + public function clear_failure($days) { + DB::query("DELETE FROM %t WHERE buyerid>0 AND status=0 AND lastupdate<%d", array($this->_table, TIMESTAMP - intval($days) * 86400)); + } + + public function expiration_payed($days) { + $expiration = TIMESTAMP - intval($days) * 86400; + $logs = DB::fetch_all("SELECT * FROM %t WHERE buyerid>0 AND status=4 AND lastupdate<%d", array($this->_table, $expiration)); + $members = array(); + foreach($logs as $log) { + $members[$log['buyerid']]['extcredits'.$log['basecredit']] += $log['credit']; + } + foreach($members as $uid => $data) { + updatemembercount($uid, $data); + } + DB::query("DELETE FROM %t WHERE buyerid>0 AND status=4 AND lastupdate<%d", array($this->_table, $expiration)); + } + + public function expiration_finished($days) { + $expiration = TIMESTAMP - intval($days) * 86400; + $logs = DB::fetch_all("SELECT * FROM %t WHERE sellerid>0 AND status=5 AND lastupdate<%d", array($this->_table, $expiration)); + $members = array(); + foreach($logs as $log) { + $members[$log['sellerid']]['extcredits'.$log['basecredit']] += $log['credit']; + } + foreach($members as $uid => $data) { + updatemembercount($uid, $data); + } + DB::query("DELETE FROM %t WHERE sellerid>0 AND status=5 AND lastupdate<%d", array($this->_table, $expiration)); + } + + public function fetch_last($uid) { + return DB::fetch_first("SELECT * FROM %t WHERE buyerid=%d AND status!=0 AND buyername!='' ORDER BY lastupdate DESC LIMIT 1", array($this->_table, $uid)); + } + + public function fetch_all_log($viewtype, $uid, $tid, $pid, $ratestatus, $typestatus, $start, $limit) { + $sql = ($tid ? 'tl.tid=\''.dintval($tid).'\' AND '.($pid ? 'tl.pid=\''.dintval($pid).'\' AND ' : '') : ''). + ('tl.'.($viewtype == 'sell' ? 'sellerid' : 'buyerid').'='.intval($uid)).' '. + ($ratestatus = $ratestatus ? 'AND (tl.ratestatus=0 OR tl.ratestatus='.intval($ratestatus).')' : ''). + ($typestatus = $typestatus ? 'AND tl.status IN ('.dimplode($typestatus).')' : ''); + return DB::fetch_all("SELECT tl.*, tr.aid, t.subject AS threadsubject FROM %t tl, %t t, %t tr WHERE %i + AND tl.tid=t.tid AND tr.pid=tl.pid AND tr.tid=tl.tid ORDER BY tl.lastupdate DESC LIMIT %d, %d", + array($this->_table, 'forum_thread', 'forum_trade', $sql, $start, $limit)); + } + + public function count_log($viewtype, $uid, $tid, $pid, $ratestatus, $typestatus) { + $sql = ($tid ? 'tl.tid=\''.dintval($tid).'\' AND '.($pid ? 'tl.pid=\''.dintval($pid).'\' AND ' : '') : ''). + ('tl.'.($viewtype == 'sell' ? 'sellerid' : 'buyerid').'='.intval($uid)).' '. + ($ratestatus = $ratestatus ? 'AND (tl.ratestatus=0 OR tl.ratestatus='.intval($ratestatus).')' : ''). + ($typestatus = $typestatus ? 'AND tl.status IN ('.dimplode($typestatus).')' : ''); + return DB::result_first("SELECT COUNT(*) FROM %t tl WHERE %i", array($this->_table,$sql)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_typeoption.php b/source/class/table/table_forum_typeoption.php new file mode 100644 index 0000000..d0490ee --- /dev/null +++ b/source/class/table/table_forum_typeoption.php @@ -0,0 +1,34 @@ +_table = 'forum_typeoption'; + $this->_pk = 'optionid'; + + parent::__construct(); + } + + public function fetch_all_by_classid($classid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE classid=%d ORDER BY displayorder '.DB::limit($start, $limit), array($this->_table, $classid)); + } + + public function fetch_all_by_identifier($identifier, $start = 0, $limit = 0, $not_optionid = null) { + return DB::fetch_all('SELECT * FROM %t WHERE identifier=%s '.($not_optionid ? ' AND '.DB::field('optionid', $not_optionid, '<>').' ' : '').DB::limit($start, $limit), array($this->_table, $identifier)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_typeoptionvar.php b/source/class/table/table_forum_typeoptionvar.php new file mode 100644 index 0000000..49704ae --- /dev/null +++ b/source/class/table/table_forum_typeoptionvar.php @@ -0,0 +1,75 @@ +_table = 'forum_typeoptionvar'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_tid_optionid($tids, $optionids = null) { + if(empty($tids)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('tid', $tids).($optionids ? ' AND '.DB::field('optionid', $optionids) : ''), array($this->_table)); + } + + public function fetch_all_by_search($sortids = null, $fids = null, $tids = null, $optionids = null) { + $sql = array(); + $sortids && $sql[] = DB::field('sortid', $sortids); + $fids && $sql[] = DB::field('fid', $fids); + $tids && $sql[] = DB::field('tid', $tids); + $optionids && $sql[] = DB::field('optionid', $optionids); + if($sql) { + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, implode(' AND ', $sql))); + } else { + return array(); + } + } + + public function update_by_tid($tid, $data, $unbuffered = false, $low_priority = false, $optionid = null, $sortid = null) { + if(empty($data)) { + return false; + } + $where = array(); + $where[] = DB::field('tid', $tid); + if($optionid !== null) { + $where[] = DB::field('optionid', $optionid); + } + if($sortid !== null) { + $where[] = DB::field('sortid', $sortid); + } + return DB::update($this->_table, $data, implode(' AND ', $where), $unbuffered, $low_priority); + } + + public function delete_by_sortid($sortids) { + if(empty($sortids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('sortid', $sortids), array($this->_table)); + } + + public function delete_by_tid($tids) { + if(empty($tids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('tid', $tids), array($this->_table), false, true); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_typevar.php b/source/class/table/table_forum_typevar.php new file mode 100644 index 0000000..3ef6ff6 --- /dev/null +++ b/source/class/table/table_forum_typevar.php @@ -0,0 +1,85 @@ +_table = 'forum_typevar'; + $this->_pk = ''; + + parent::__construct(); + } + + public function count_by_search($search) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE search>%d', array($this->_table, $search)); + } + + public function fetch_all_by_search_optiontype($search, $optiontypes) { + if(empty($optiontypes)) { + return array(); + } + return DB::fetch_all('SELECT p.*, v.* FROM %t v LEFT JOIN %t p ON p.optionid=v.optionid WHERE search=%d OR p.'.DB::field('type', $optiontypes), + array($this->_table, 'forum_typeoption', $search)); + } + + public function fetch_all_by_sortid($sortid, $order = '') { + return DB::fetch_all('SELECT * FROM %t WHERE sortid=%d '.($order ? 'ORDER BY '.DB::order('displayorder', $order) : ''), array($this->_table, $sortid), 'optionid'); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false, $null = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + return $this->update_typevar($val, $data, $unbuffered, $low_priority, $null); + } + } + + public function update_typevar($sortid, $optionid, $data, $unbuffered = false, $low_priority = false) { + if(empty($data)) { + return false; + } + return DB::update($this->_table, $data, array('sortid' => $sortid, 'optionid' => $optionid), $unbuffered, $low_priority); + } + + public function update_by_search($search, $data, $unbuffered = false, $low_priority = false) { + if(empty($data)) { + return false; + } + return DB::update($this->_table, $data, array('search' => $search), $unbuffered, $low_priority); + } + + public function delete($val = null, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + $unbuffered = $unbuffered === false ? null : $unbuffered; + return $this->delete_typevar($val, $unbuffered); + } + } + + public function delete_typevar($sortids = null, $optionids = null) { + $where = array(); + $sortids && $where[] = DB::field('sortid', $sortids); + $optionids && $where[] = DB::field('optionid', $optionids); + if($where) { + return DB::query('DELETE FROM %t WHERE '.implode(' AND ', $where), array($this->_table)); + } else { + return false; + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_forum_warning.php b/source/class/table/table_forum_warning.php new file mode 100644 index 0000000..29db775 --- /dev/null +++ b/source/class/table/table_forum_warning.php @@ -0,0 +1,49 @@ +_table = 'forum_warning'; + $this->_pk = 'wid'; + + parent::__construct(); + } + + public function count_by_author($authors = null) { + return DB::result_first('SELECT COUNT(*) FROM %t '.($authors ? 'WHERE '.DB::field('author', $authors) : ''), array($this->_table)); + } + + public function count_by_authorid_dateline($authorid, $dateline = null) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE authorid=%d '.($dateline ? ' AND '.DB::field('dateline', dintval($dateline), '>=') : ''), array($this->_table, $authorid)); + } + + public function fetch_all_by_author($authors, $start, $limit) { + return DB::fetch_all('SELECT * FROM %t '.($authors ? 'WHERE '.DB::field('author', $authors) : '').' ORDER BY wid DESC '.DB::limit($start, $limit), array($this->_table)); + } + + public function fetch_all_by_authorid($authorid) { + return DB::fetch_all('SELECT * FROM %t WHERE authorid=%d', array($this->_table, $authorid)); + } + + public function delete_by_pid($pids) { + if(empty($pids)) { + return false; + } + return DB::query('DELETE FROM %t WHERE '.DB::field('pid', $pids), array($this->_table), false, true); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_album.php b/source/class/table/table_home_album.php new file mode 100644 index 0000000..2a332e8 --- /dev/null +++ b/source/class/table/table_home_album.php @@ -0,0 +1,233 @@ +_table = 'home_album'; + $this->_pk = 'albumid'; + + parent::__construct(); + } + + public function count_by_catid($catid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE catid = %d', array($this->_table, $catid)); + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid = %d', array($this->_table, $uid)); + } + + public function update_num_by_albumid($albumid, $inc, $field = 'picnum', $uid = '') { + if(!in_array($field, array('picnum', 'favtimes', 'sharetimes'))) { + return null; + } + $parameter = array($this->_table, $inc, $albumid); + if($uid) { + $parameter[] = $uid; + $uidsql = ' AND uid = %d'; + } + return DB::query('UPDATE %t SET '.$field.'='.$field.'+\'%d\' WHERE albumid=%d '.$uidsql, $parameter); + } + + public function delete_by_uid($uid) { + if(!$uid) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uid)); + } + + public function update_by_catid($catid, $data) { + if(!is_array($data) || empty($data)) { + return null; + } + return DB::update($this->_table, $data, DB::field('catid', $catid)); + } + + public function fetch_uid_by_username($users) { + if(!$users) { + return null; + } + return DB::fetch_all('SELECT uid FROM %t WHERE username IN (%n)', array($this->_table, $users), 'uid'); + } + + public function fetch_albumid_by_albumname_uid($albumname, $uid) { + return DB::result_first('SELECT albumid FROM %t WHERE albumname=%s AND uid=%d', array($this->_table, $albumname, $uid)); + } + + public function fetch_albumid_by_searchkey($searchkey, $limit) { + return DB::fetch_all('SELECT albumid FROM %t WHERE 1 %i ORDER BY albumid DESC %i', array($this->_table, $searchkey, DB::limit(0, $limit))); + } + + public function fetch_uid_by_uid($uid) { + if(!is_array($uid)) { + $uid = explode(',', $uid); + } + if(!$uid) { + return null; + } + return DB::fetch_all('SELECT uid FROM %t WHERE uid IN (%n)', array($this->_table, $uid), 'uid'); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? '' : $force_from_db; + return $this->fetch_album($id, $force_from_db); + } + } + + public function fetch_all($ids, $force_from_db = false, $null1 = 0, $null2 = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_album($ids, $force_from_db, $null1, $null2); + } + } + + public function fetch_album($albumid, $uid = '') { + $data = $this->fetch_all_by_uid($uid, false, 0, 0, $albumid); + return $data[0]; + } + + public function fetch_all_album($albumids, $order = false, $start = 0, $limit = 0) { + return $this->fetch_all_by_uid('', $order, $start, $limit, $albumids); + } + + public function fetch_all_by_uid($uid, $order = false, $start = 0, $limit = 0, $albumid = '') { + $parameter = array($this->_table); + $wherearr = array(); + if($albumid) { + $wherearr[] = DB::field('albumid', $albumid); + } + if($uid) { + $wherearr[] = DB::field('uid', $uid); + } + if(is_string($order) && $order = DB::order($order, 'DESC')) { + $ordersql = ' ORDER BY '.$order; + } + if($limit) { + $parameter[] = DB::limit($start, $limit); + $ordersql .= ' %i'; + } + + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + if(empty($wheresql)) { + return null; + } + + return DB::fetch_all('SELECT * FROM %t '.$wheresql.$ordersql, $parameter); + } + + public function fetch_all_by_block($aids, $bannedids, $uids, $catid, $startrow, $items, $orderby) { + $wheres = array(); + if($aids) { + $wheres[] = DB::field('albumid', $aids, 'in'); + } + if($bannedids) { + $wheres[] = DB::field('albumid', $bannedids, 'notin'); + } + if($uids) { + $wheres[] = DB::field('uid', $uids, 'in'); + } + if($catid && !in_array('0', $catid)) { + $wheres[] = DB::field('catid', $catid, 'in'); + } + $wheres[] = "friend = '0'"; + $wheresql = $wheres ? implode(' AND ', $wheres) : '1'; + + if(!in_array($orderby, array('dateline', 'picnum', 'updatetime'))) { + $orderby = 'dateline'; + } + + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.$wheresql.' ORDER BY '.DB::order($orderby, 'DESC').DB::limit($startrow, $items)); + } + + public function fetch_all_by_search($fetchtype, $uids, $albumname, $searchname, $catid, $starttime, $endtime, $albumids, $friend = '', $orderfield = '', $ordersort = 'DESC', $start = 0, $limit = 0, $findex = '') { + $parameter = array($this->_table); + $wherearr = array(); + if(is_array($uids) && count($uids)) { + $parameter[] = $uids; + $wherearr[] = 'uid IN(%n)'; + } + + if($albumname) { + if($searchname == false) { + $parameter[] = $albumname; + $wherearr[] = 'albumname=%s'; + } else { + $parameter[] = '%'.$albumname.'%'; + $wherearr[] = 'albumname LIKE %s'; + } + } + + if($catid) { + $parameter[] = $catid; + $wherearr[] = 'catid=%d'; + } + + if($starttime) { + $parameter[] = is_numeric($starttime) ? $starttime : strtotime($starttime); + $wherearr[] = 'dateline>%d'; + } + + if($endtime) { + $parameter[] = is_numeric($endtime) ? $endtime : strtotime($endtime); + $wherearr[] = 'dateline<%d'; + } + + if(is_numeric($friend)) { + $parameter[] = $friend; + $wherearr[] = 'friend=%d'; + } + + if(is_array($albumids) && count($albumids)) { + $parameter[] = $albumids; + $wherearr[] = 'albumid IN(%n)'; + } + + if($fetchtype == 3) { + $selectfield = "count(*)"; + } elseif ($fetchtype == 2) { + $selectfield = "albumid"; + } else { + $selectfield = "*"; + if(is_string($orderfield) && $order = DB::order($orderfield, $ordersort)) { + $ordersql = 'ORDER BY '.$order; + } + if($limit) { + $parameter[] = DB::limit($start, $limit); + $ordersql .= ' %i'; + } + } + + if($findex) { + $findex = 'USE INDEX(updatetime)'; + } + + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + if($fetchtype == 3) { + return DB::result_first("SELECT $selectfield FROM %t $wheresql", $parameter); + } else { + return DB::fetch_all("SELECT $selectfield FROM %t {$findex} $wheresql $ordersql", $parameter); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_album_category.php b/source/class/table/table_home_album_category.php new file mode 100644 index 0000000..dca757f --- /dev/null +++ b/source/class/table/table_home_album_category.php @@ -0,0 +1,51 @@ +_table = 'home_album_category'; + $this->_pk = 'catid'; + + parent::__construct(); + } + + public function fetch_all_by_displayorder() { + return DB::fetch_all('SELECT * FROM %t ORDER BY displayorder', array($this->_table), $this->_pk); + } + + public function fetch_all_numkey($numkey) { + $allow_numkey = array('portal', 'articles', 'num'); + if(!in_array($numkey, $allow_numkey)) { + return null; + } + return DB::fetch_all("SELECT catid, $numkey FROM %t", array($this->_table), $this->_pk); + } + + public function update_num_by_catid($num, $catid, $numlimit = false) { + $args = array($this->_table, $num, $catid); + if($numlimit !== false) { + $sql = ' AND num>0'; + $args[] = $numlimit; + } + return DB::query("UPDATE %t SET num=num+'%d' WHERE catid=%d {$sql}", $args); + } + + public function fetch_catname_by_catid($catid) { + return DB::result_first('SELECT catname FROM %t WHERE catid=%d', array($this->_table, $catid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_blacklist.php b/source/class/table/table_home_blacklist.php new file mode 100644 index 0000000..f9e2954 --- /dev/null +++ b/source/class/table/table_home_blacklist.php @@ -0,0 +1,58 @@ +_table = 'home_blacklist'; + $this->_pk = ''; + + parent::__construct(); + } + + public function count_by_uid_buid($uid, $buid = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($uid) { + $parameter[] = $uid; + $wherearr[] = 'uid=%d'; + } + if($buid) { + $parameter[] = $buid; + $wherearr[] = "buid=%d"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first("SELECT COUNT(*) FROM %t $wheresql", $parameter); + } + + public function fetch_all_by_uid($uid, $start = 0, $limit = 0) { + $data = array(); + $query = DB::query('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $uid)); + while($value = DB::fetch($query)) { + $data[$value['buid']] = $value; + } + return $data; + } + + public function fetch_all_by_uid_buid($uid, $buids) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND buid IN(%n)', array($this->_table, $uid, $buids), 'buid'); + } + + public function delete_by_uid_buid($uid, $buid) { + return DB::query('DELETE FROM %t WHERE uid=%d AND buid=%d', array($this->_table, $uid, $buid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_blog.php b/source/class/table/table_home_blog.php new file mode 100644 index 0000000..8af2cec --- /dev/null +++ b/source/class/table/table_home_blog.php @@ -0,0 +1,324 @@ +_table = 'home_blog'; + $this->_pk = 'blogid'; + + parent::__construct(); + } + + public function fetch_by_id_idtype($id) { + if(!$id) { + return null; + } + return DB::fetch_first('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('blogid', $id))); + } + public function update_dateline_by_id_idtype_uid($id, $idtype, $dateline, $uid) { + return DB::update($this->_table, array('dateline' => $dateline), DB::field($idtype, $id).' AND '.DB::field('uid', $uid)); + } + + public function range($start = 0, $limit = 0, $sort = '', $null1 = 'dateline', $null2 = null, $null3 = null, $null4 = null, $null5 = null) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::range($start, $limit, $sort); + } else { + $sort = $sort === '' ? 'DESC' : $sort; + return $this->range_blog($start, $limit, $sort, $null1, $null2, $null3, $null4, $null5); + } + } + + public function range_blog($start = 0, $limit = 0, $ordersc = 'DESC', $orderby = 'dateline', $friend = null, $status = null, $uid = null, $dateline = null) { + $wheresql = '1'; + $wheresql .= ($friend !== null) ? ' AND '.DB::field('friend', $friend) : ''; + $wheresql .= $uid ? ' AND '.DB::field('uid', $uid) : ''; + $wheresql .= $status ? ' AND '.DB::field('status', $status) : ''; + $wheresql .= $dateline ? ' AND '.DB::field('dateline', $dateline, '>=') : ''; + if(in_array($orderby, array('hot', 'dateline'))) { + $wheresql .= ' ORDER BY '.DB::order($orderby, $ordersc); + } + $wheresql .= ' '.DB::limit($start, $limit); + + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $wheresql), $this->_pk); + } + + public function fetch_all($ids, $force_from_db = false, $null1 = '', $null2 = 0, $null3 = 0) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? '' : $force_from_db; + return $this->fetch_all_blog($ids, $force_from_db, $null1, $null2, $null3); + } + } + + public function fetch_all_blog($blogid, $orderby = '', $ordersc = '', $start = 0, $limit = 0) { + if(!$blogid) { + return null; + } + + $wheresql = DB::field('blogid', $blogid); + + if($orderby = DB::order($orderby, $ordersc)) { + $wheresql .= ' ORDER BY '.$orderby; + } + if($limit = DB::limit($start, $limit)) { + $wheresql .= ' '.$limit; + } + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $wheresql), $this->_pk); + } + + public function increase($blogid, $uid, $setarr) { + $sql = array(); + $allowkey = array('hot', 'viewnum', 'replynum', 'favtimes', 'sharetimes'); + foreach($setarr as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + $wheresql = DB::field('blogid', $blogid); + if($uid) { + $wheresql .= ' AND '.DB::field('uid', $uid); + } + if(!empty($sql)){ + return DB::query('UPDATE %t SET %i WHERE %i', array($this->_table, implode(',', $sql), $wheresql)); + } + } + + public function update_click($blogid, $clickid, $incclick) { + $clickid = intval($clickid); + if($clickid < 1 || $clickid > 8) { + return null; + } + return DB::query('UPDATE %t SET click'.$clickid.' = click'.$clickid.'+\'%d\' WHERE blogid = %d', array($this->_table, $incclick, $blogid)); + } + + public function update_classid_by_classid($classid, $newclassid) { + return DB::query('UPDATE %t SET classid = %d WHERE classid = %d', array($this->_table, $newclassid, $classid)); + } + + public function fetch_blogid_by_subject($keyword, $limit) { + $field = "subject LIKE '%{text}%'"; + if(preg_match("(AND|\+|&|\s)", $keyword) && !preg_match("(OR|\|)", $keyword)) { + $andor = ' AND '; + $keywordsrch = '1'; + $keyword = preg_replace("/( AND |&| )/is", "+", $keyword); + } else { + $andor = ' OR '; + $keywordsrch = '0'; + $keyword = preg_replace("/( OR |\|)/is", "+", $keyword); + } + $keyword = str_replace('*', '%', addcslashes(daddslashes($keyword), '%_')); + foreach(explode('+', $keyword) as $text) { + $text = trim($text); + if($text) { + $keywordsrch .= $andor; + $keywordsrch .= str_replace('{text}', $text, $field); + } + } + $wheresql = " ($keywordsrch)"; + + if($limit) { + $wheresql .= ' ORDER BY blogid DESC '.DB::limit(0, $limit); + } + + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $wheresql), $this->_pk); + } + + public function fetch_blogid_by_uid($uid, $start = 0, $limit = 0) { + if(!$uid) { + return null; + } + return DB::fetch_all('SELECT blogid FROM %t WHERE uid IN (%n) %i', array($this->_table, $uid, DB::limit($start, $limit)), $this->_pk); + } + + public function fetch_all_by_uid($uid, $orderby = 'dateline', $start = 0, $limit = 0) { + if(!$uid) { + return null; + } + if($orderby = DB::order($orderby, 'DESC')) { + $order = 'ORDER BY '.$orderby; + } + return DB::fetch_all('SELECT * FROM %t WHERE uid IN (%n) %i', array($this->_table, $uid, $order.' '.DB::limit($start, $limit)), $this->_pk); + } + + public function fetch_all_by_hot($hot, $orderby = 'dateline', $start = 0, $limit = 0) { + if(!$uid) { + return null; + } + if($orderby = DB::order($orderby, 'DESC')) { + $order = 'ORDER BY '.$orderby; + } + return DB::fetch_all('SELECT * FROM %t WHERE hot>=%d %i', array($this->_table, $hot, $order.' '.DB::limit($start, $limit)), $this->_pk); + } + + public function count_by_catid($catid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE catid = %d', array($this->_table, $catid)); + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid = %d', array($this->_table, $uid)); + } + + public function delete_by_catid($catid) { + if(!$catid) { + return null; + } + return DB::delete($this->_table, DB::field('catid', $catid)); + } + + public function delete_by_uid($uids) { + if(!$uids) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uids)); + } + + public function update_by_catid($catid, $data) { + if(empty($data) || !is_array($data) || !$catid) { + return null; + } + return DB::update($this->_table, $data, DB::field('catid', $catid)); + } + + public function count_uid_by_blogid($blogid) { + if(!is_array($blogid) || !$blogid) { + return null; + } + return DB::fetch_all('SELECT uid, COUNT(blogid) AS count FROM %t WHERE blogid IN (%n) GROUP BY uid', array($this->_table, $blogid)); + } + + public function count_all_by_search($blogid = null, $uids = null, $starttime = null, $endtime = null, $hot1 = null, $hot2 = null, $viewnum1 = null, $viewnum2 = null, $replynum1 = null, $replynum2 = null, $friend = null, $ip = null, $keywords = null, $lengthlimit = null, $classid = null, $catid = null, $subject = null, $countwithoutjoin = false, $status = null) { + return $this->fetch_all_by_search(3, $blogid, $uids, $starttime, $endtime, $hot1, $hot2, $viewnum1, $viewnum2, $replynum1, $replynum2, $friend, $ip, $keywords, $lengthlimit, null, null, 0, 0, $classid, $catid, $subject, null, $countwithoutjoin, $status); + } + + public function fetch_all_by_search($fetchtype = 1, $blogid = null, $uids = null, $starttime = null, $endtime = null, $hot1 = null, $hot2 = null, $viewnum1 = null, $viewnum2 = null, $replynum1 = null, $replynum2 = null, $friend = null, $ip = null, $keywords = null, $lengthlimit = null, $orderby = null, $ordersc = null, $start = 0, $limit = 0, $classid = null, $catid = null, $subject = null, $findex = null, $countwithoutjoin = false, $status = null) { + $sql = ''; + $sql .= $blogid ? ' AND b.'.DB::field('blogid', $blogid) : ''; + $sql .= is_array($uids) && count($uids) > 0 ? ' AND b.'.DB::field('uid', $uids) : ''; + $sql .= $starttime ? ' AND b.'.DB::field('dateline', $starttime, '>') : ''; + $sql .= $endtime ? ' AND b.'.DB::field('dateline', $endtime, '<') : ''; + $sql .= $hot1 ? ' AND b.'.DB::field('hot', $hot1, '>=') : ''; + $sql .= $hot2 ? ' AND b.'.DB::field('hot', $hot2, '<=') : ''; + + $sql .= $viewnum1 ? ' AND b.'.DB::field('viewnum', $viewnum1, '>=') : ''; + $sql .= $viewnum2 ? ' AND b.'.DB::field('viewnum', $viewnum1, '<=') : ''; + $sql .= $replynum1 ? ' AND b.'.DB::field('replynum', $replynum1, '>=') : ''; + $sql .= $replynum2 ? ' AND b.'.DB::field('replynum', $replynum2, '<=') : ''; + $sql .= $classid ? ' AND b.'.DB::field('classid', $classid) : ''; + $sql .= $friend ? ' AND b.'.DB::field('friend', $friend) : ''; + $sql .= !is_null($status) ? ' AND b.'.DB::field('status', $status) : ''; + + $ip = str_replace('*', '', $ip); + if($fetchtype == 1) { + $sql .= $ip ? ' AND bf.'.DB::field('postip', "%$ip%", 'like') : ''; + } + + $orderby = $orderby ? $orderby : 'dateline'; + $ordersc = $ordersc ? $ordersc : 'DESC'; + + if($fetchtype == 1 && $keywords != '' && !is_array($keywords)) { + $sqlkeywords = ''; + $or = ''; + $keywords = explode(',', str_replace(' ', '', $keywords)); + + for($i = 0; $i < count($keywords); $i++) { + $keywords[$i] = daddslashes($keywords[$i]); + if(preg_match("/\{(\d+)\}/", $keywords[$i])) { + $keywords[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($keywords[$i], '/')); + $sqlkeywords .= " $or b.subject REGEXP '".$keywords[$i]."' OR bf.message REGEXP '".addslashes(stripsearchkey($keywords[$i]))."'"; + } else { + $sqlkeywords .= " $or b.subject LIKE '%".$keywords[$i]."%' OR bf.message LIKE '%".$keywords[$i]."%'"; + } + $or = 'OR'; + } + if($sqlkeywords) { + $sql .= " AND ($sqlkeywords)"; + } + } + + $sql .= $subject ? ' AND b.'.DB::field('subject', "%$subject%", 'like') : ''; + $sql .= $catid ? ' AND b.'.DB::field('catid', $catid) : ''; + if($fetchtype == 1) { + $sql .= $lengthlimit ? ' AND LENGTH(bf.message) > '.intval($lengthlimit) : ''; + } + + + if($fetchtype == 3) { + $selectfield = 'count(*)'; + } elseif ($fetchtype == 2) { + $selectfield = 'b.blogid'; + } else { + $selectfield = 'bf.*,b.*'; + } + + if($findex) { + $findex = 'USE INDEX(dateline)'; + } else { + $findex = ''; + } + + if($fetchtype == 3) { + return DB::result_first("SELECT $selectfield FROM %t b ".(($countwithoutjoin === false) ? 'LEFT JOIN %t bf USING(blogid) ' : ''). + "WHERE 1 %i", ($countwithoutjoin === false) ? array($this->_table, 'home_blogfield', $sql) : array($this->_table, $sql)); + } else { + if($order = DB::order($orderby, $ordersc)) { + $order = 'ORDER BY b.'.$order; + } else { + $order = ''; + } + return DB::fetch_all("SELECT $selectfield FROM %t b {$findex} LEFT JOIN %t bf USING(blogid) " . + "WHERE 1 %i", array($this->_table, 'home_blogfield', $sql.' '.$order.' '.DB::limit($start, $limit))); + } + + } + + public function fetch_all_by_block($blogids = null, $bannedids = null, $uids = null, $catid = null, $hours = null, $getpic = null, $getsummary = null, $picrequired = null, $orderby = 'dateline', $start = 0, $limit = 0) { + $wheres = array(); + if($blogids) { + $wheres[] = 'b.'.DB::field('blogid', $blogids); + } + if($bannedids) { + $val = implode(',', DB::quote($bannedids)); + $wheres[] = 'b.blogid NOT IN ('.$val.')'; + } + if($uids) { + $wheres[] = 'b.'.DB::field('uid', $uids); + } + if($catid && !in_array('0', $catid)) { + $wheres[] = 'b.'.DB::field('catid', $catid); + } + if($hours) { + $timestamp = TIMESTAMP - 3600 * $hours; + $wheres[] = 'b.'.DB::field('dateline', $timestamp, '>=') ; + } + $tablesql = $fieldsql = ''; + if($getpic || $getsummary || $picrequired) { + if($picrequired) { + $wheres[] = "bf.pic != ''"; + } + $tablesql = ' LEFT JOIN '.DB::table('home_blogfield')." bf ON b.blogid = bf.blogid"; + $fieldsql = ', bf.pic, b.picflag, bf.message'; + } + $wheres[] = "b.friend = '0'"; + $wheres[] = "b.status='0'"; + $wheresql = $wheres ? implode(' AND ', $wheres) : '1'; + + return DB::fetch_all('SELECT b.* %i FROM %t b %i WHERE %i', array($fieldsql, $this->_table, $tablesql, $wheresql.' ORDER BY b.'.DB::order($orderby, 'DESC').' '.DB::limit($start, $limit))); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_blog_category.php b/source/class/table/table_home_blog_category.php new file mode 100644 index 0000000..3ce2467 --- /dev/null +++ b/source/class/table/table_home_blog_category.php @@ -0,0 +1,51 @@ +_table = 'home_blog_category'; + $this->_pk = 'catid'; + + parent::__construct(); + } + + public function fetch_all_by_displayorder() { + return DB::fetch_all("SELECT * FROM %t ORDER BY displayorder", array($this->_table), $this->_pk); + } + + public function fetch_all_numkey($numkey) { + $allow_numkey = array('portal', 'articles', 'num'); + if(!in_array($numkey, $allow_numkey)) { + return null; + } + return DB::fetch_all("SELECT catid, $numkey FROM %t", array($this->_table), $this->_pk); + } + + public function update_num_by_catid($num, $catid, $numplus = true, $numlimit = false) { + $args = array($this->_table, $num, $catid); + if($numlimit !== false) { + $sql = ' AND num>0'; + $args[] = $numlimit; + } + return DB::query("UPDATE %t SET num=".(($numplus) ? 'num+' : '')."%d WHERE catid=%d {$sql}", $args); + } + + public function fetch_catname_by_catid($catid) { + return DB::result_first("SELECT catname FROM %t WHERE catid=%d", array($this->_table, $catid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_blogfield.php b/source/class/table/table_home_blogfield.php new file mode 100644 index 0000000..9bd3641 --- /dev/null +++ b/source/class/table/table_home_blogfield.php @@ -0,0 +1,41 @@ +_table = 'home_blogfield'; + $this->_pk = 'blogid'; + + parent::__construct(); + } + + public function delete_by_uid($uids) { + if(!$uids) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uids)); + } + + public function fetch_targetids_by_blogid($blogid) { + return DB::fetch_first('SELECT target_ids, hotuser FROM %t WHERE blogid = %d', array($this->_table, $blogid)); + } + + public function fetch_tag_by_blogid($blogid) { + return DB::result_first('SELECT tag FROM %t WHERE blogid = %d', array($this->_table, $blogid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_class.php b/source/class/table/table_home_class.php new file mode 100644 index 0000000..7f43356 --- /dev/null +++ b/source/class/table/table_home_class.php @@ -0,0 +1,40 @@ +_table = 'home_class'; + $this->_pk = 'classid'; + + parent::__construct(); + } + + public function fetch_all_by_uid($uid) { + return DB::fetch_all('SELECT * FROM %t WHERE uid = %d', array($this->_table, $uid), $this->_pk); + } + + public function fetch_classid_by_uid_classname($uid, $classname) { + return DB::result_first('SELECT classid FROM %t WHERE uid = %d AND classname = %s', array($this->_table, $uid, $classname)); + } + + public function delete_by_uid($uids) { + if(!$uids) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uids)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_click.php b/source/class/table/table_home_click.php new file mode 100644 index 0000000..a3f0105 --- /dev/null +++ b/source/class/table/table_home_click.php @@ -0,0 +1,34 @@ +_table = 'home_click'; + $this->_pk = 'clickid'; + + parent::__construct(); + } + + public function fetch_all_by_idtype($idtype) { + return DB::fetch_all('SELECT * FROM %t WHERE idtype=%s ORDER BY displayorder DESC', array($this->_table, $idtype), $this->_pk); + } + + public function fetch_all_by_available($available = 1) { + return DB::fetch_all('SELECT * FROM %t WHERE available=%d ORDER BY displayorder DESC', array($this->_table, $available), $this->_pk); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_clickuser.php b/source/class/table/table_home_clickuser.php new file mode 100644 index 0000000..7d40f56 --- /dev/null +++ b/source/class/table/table_home_clickuser.php @@ -0,0 +1,65 @@ +_table = 'home_clickuser'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_id_idtype($id, $idtype, $start = 0, $limit = 0) { + $id = dintval($id, is_array($id) ? true : false); + $parameter = array($this->_table, $id, $idtype); + $wherearr = array(); + $wherearr[] = is_array($id) ? 'id IN(%n)' : 'id=%d'; + $wherearr[] = 'idtype=%s'; + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter); + } + + public function delete_by_id_idtype($id, $idtype) { + $id = dintval($id, is_array($id) ? true : false); + $parameter = array($this->_table, $id, $idtype); + $wherearr = array(); + $wherearr[] = is_array($id) ? 'id IN(%n)' : 'id=%d'; + $wherearr[] = 'idtype=%s'; + $wheresql = ' WHERE '.implode(' AND ', $wherearr); + return DB::query('DELETE FROM %t '.$wheresql, $parameter); + } + + public function delete_by_dateline($dateline) { + return DB::query('DELETE FROM %t WHERE dateline<%d', array($this->_table, $dateline)); + } + public function delete_by_uid($uids) { + $uids = dintval($uids, is_array($uids) ? true : false); + if($uids) { + return DB::delete($this->_table, DB::field('uid', $uids)); + } + return 0; + } + + public function count_by_uid_id_idtype($uid, $id, $idtype) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND id=%d AND idtype=%s', array($this->_table, $uid, $id, $idtype)); + } + + public function count_by_id_idtype($id, $idtype) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE id=%d AND idtype=%s', array($this->_table, $id, $idtype)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_comment.php b/source/class/table/table_home_comment.php new file mode 100644 index 0000000..c1e2a07 --- /dev/null +++ b/source/class/table/table_home_comment.php @@ -0,0 +1,232 @@ +_table = 'home_comment'; + $this->_pk = 'cid'; + + parent::__construct(); + } + + public function fetch_all_by_uid($uids, $start = 0, $limit = 5) { + if(!$uids) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE uid IN (%n) OR authorid IN (%n) OR (id IN (%n) AND idtype=%s) %i', array($this->_table, $uids, $uids, $uids, 'uid', DB::limit($start, $limit))); + } + + public function delete_by_uid_idtype($uid) { + if(!$uid){ + return null; + } + DB::delete($this->_table, DB::field('uid', $uid).' OR '.DB::field('authorid', $uid).' OR ('.DB::field('id', $uid).' AND idtype=\'uid\')'); + } + + public function delete_by_uid($uids) { + if(!$uids){ + return null; + } + DB::delete($this->_table, DB::field('uid', $uids).' OR ('.DB::field('id', $uids).' AND idtype=\'uid\')'); + } + + public function delete($val, $unbuffered = false, $null = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + $unbuffered = $unbuffered === false ? '' : $unbuffered; + return $this->delete_comment($val, $unbuffered, $null); + } + } + + public function delete_comment($cid = '', $id = '', $idtype = '') { + $condition = array(); + + if($cid) { + $condition[] = DB::field('cid', $cid); + } + + if($id) { + $condition[] = DB::field('id', $id); + $condition[] = DB::field('idtype', $idtype); + } + + if(!count($condition)) { + return null; + } + + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + $unbuffered = $unbuffered === false ? '' : $unbuffered; + return $this->update_comment($val, $data, $unbuffered); + } + } + + public function update_comment($cids, $data, $authorid = '') { + $condition = array(); + if($cids) { + $condition[] = DB::field('cid', $cids); + } + if($authorid) { + $condition[] = DB::field('authorid', $authorid); + } + + if(empty($data) || !is_array($data) || !count($condition)) { + return null; + } + + return DB::update($this->_table, $data, implode(' AND ', $condition)); + } + + public function count_by_id_idtype($id, $idtype, $cid = '') { + if($cid) { + $cidsql = DB::field('cid', $cid). ' AND '; + } + return DB::result_first('SELECT COUNT(*) FROM %t WHERE '.$cidsql.' id=%d AND idtype=%s', array($this->_table, $id, $idtype)); + } + + public function fetch_all_by_id_idtype($id, $idtype, $start, $limit, $cid = '', $order = '') { + if($cid) { + $cidsql = DB::field('cid', $cid). ' AND '; + } + return DB::fetch_all('SELECT * FROM %t WHERE '.$cidsql.' id=%d AND idtype=%s ORDER BY '.DB::order('dateline', $order).' %i', array($this->_table, $id, $idtype, DB::limit($start, $limit))); + } + + public function fetch_latest_by_authorid($uid, $cid) { + if($cid) { + $cidsql = DB::field('cid', $cid). ' AND '; + } + return DB::fetch_first('SELECT * FROM %t WHERE '.$cidsql.' authorid=%d ORDER BY dateline DESC LIMIT 0,1', array($this->_table, $uid)); + } + + public function fetch_by_id_idtype($id, $idtype, $cid = '') { + if($cid) { + $cidsql = DB::field('cid', $cid). ' AND '; + } + return DB::fetch_first('SELECT * FROM %t WHERE '.$cidsql.' id=%d AND idtype=%s', array($this->_table, $id, $idtype)); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? '' : $force_from_db; + return $this->fetch_comment($id, $force_from_db); + } + } + + public function fetch_comment($cid, $authorid = '') { + if(!$cid) { + return null; + } + $wherearr = array(); + $wherearr[] = DB::field('cid', $cid); + if($authorid) { + $wherearr[] = DB::field('authorid', $authorid); + } + + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + return DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' '.$wheresql); + } + + public function fetch_all_by_status($status = 0, $start = 0, $limit = 1000) { + return DB::fetch_all('SELECT * FROM %t WHERE `status` = %d ORDER BY ' . $this->_pk . ' ' . DB::limit($start, $limit), array($this->_table, $status)); + } + + public function fetch_all_search($fetchtype, $ids, $authorid, $uids, $useip, $keywords, $idtype, $starttime, $endtime, $start = 0, $limit = 0, $basickeywords = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($ids) { + $parameter[] = $ids; + $wherearr[] = 'id IN(%n)'; + } + if(is_array($authorid) && count($authorid)) { + $parameter[] = $authorid; + $wherearr[] = 'authorid IN(%n)'; + } + if($idtype) { + $parameter[] = $idtype; + $wherearr[] = 'idtype=%s'; + } + if($starttime) { + $parameter[] = is_numeric($starttime) ? $starttime : strtotime($starttime); + $wherearr[] = 'dateline>%d'; + } + if($endtime) { + $parameter[] = is_numeric($endtime) ? $endtime : strtotime($endtime); + $wherearr[] = 'dateline<%d'; + } + if($uids) { + $parameter[] = $uids; + $wherearr[] = 'uid IN(%n)'; + } + if($keywords) { + if(!$basickeywords) { + $sqlkeywords = ''; + $or = ''; + $keywords = explode(',', str_replace(' ', '', $keywords)); + + for($i = 0; $i < count($keywords); $i++) { + if(preg_match("/\{(\d+)\}/", $keywords[$i])) { + $keywords[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($keywords[$i], '/')); + $sqlkeywords .= " $or message REGEXP '".addslashes(stripsearchkey($keywords[$i]))."'"; + } else { + $sqlkeywords .= " $or message LIKE '%".addslashes(stripsearchkey($keywords[$i]))."%'"; + } + $or = 'OR'; + } + $parameter[] = $sqlkeywords; + $wherearr[] = '%i'; + } else { + $parameter[] = '%'.$basickeywords.'%'; + $wherearr[] = 'message LIKE %s'; + } + } + if($useip) { + $parameter[] = str_replace('*', '%', $useip); + $wherearr[] = 'ip LIKE %s'; + } + if($fetchtype == 3) { + $selectfield = "count(*)"; + } elseif ($fetchtype == 2) { + $selectfield = "cid"; + } else { + $selectfield = "*"; + $parameter[] = DB::limit($start, $limit); + $ordersql = ' ORDER BY dateline DESC %i'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + if(empty($wheresql)) { + return null; + } + if($fetchtype == 3) { + return DB::result_first("SELECT $selectfield FROM %t $wheresql", $parameter); + } else { + return DB::fetch_all("SELECT $selectfield FROM %t $wheresql $ordersql", $parameter); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_docomment.php b/source/class/table/table_home_docomment.php new file mode 100644 index 0000000..8b1a8be --- /dev/null +++ b/source/class/table/table_home_docomment.php @@ -0,0 +1,44 @@ +_table = 'home_docomment'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function delete_by_doid_uid($doids = null, $uids = null) { + $sql = array(); + $doids && $sql[] = DB::field('doid', $doids); + $uids && $sql[] = DB::field('uid', $uids); + if($sql) { + return DB::query('DELETE FROM %t WHERE %i', array($this->_table, implode(' OR ', $sql))); + } else { + return false; + } + } + + public function fetch_all_by_doid($doids) { + if(empty($doids)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('doid', $doids).' ORDER BY dateline', array($this->_table)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_doing.php b/source/class/table/table_home_doing.php new file mode 100644 index 0000000..21d9804 --- /dev/null +++ b/source/class/table/table_home_doing.php @@ -0,0 +1,143 @@ +_table = 'home_doing'; + $this->_pk = 'doid'; + + parent::__construct(); + } + + public function update_replynum_by_doid($inc_replynum, $doid) { + return DB::query('UPDATE %t SET replynum=replynum+\'%d\' WHERE doid=%d', array($this->_table, $inc_replynum, $doid)); + } + + public function delete_by_uid($uid) { + if(!$uid) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uid)); + } + + public function fetch_all_by_uid_doid($uids, $bannedids = '', $paramorderby = '', $startrow = 0, $items = 0, $status = true, $allfileds = false) { + $parameter = array($this->_table); + $orderby = $paramorderby && in_array($paramorderby, array('dateline', 'replynum')) ? 'ORDER BY '.DB::order($paramorderby, 'DESC') : 'ORDER BY '.DB::order('dateline', 'DESC'); + + $wheres = array(); + if($uids) { + $parameter[] = $uids; + $wheres[] = 'uid IN (%n)'; + } + if($bannedids) { + $parameter[] = $bannedids; + $wheres[] = 'doid NOT IN (%n)'; + } + if($status) { + $wheres[] = ' status = 0'; + } + + $wheresql = !empty($wheres) && is_array($wheres) ? ' WHERE '.implode(' AND ', $wheres) : ''; + + if(empty($wheresql)) { + return null; + } + return DB::fetch_all('SELECT '.($allfileds ? '*' : 'doid').' FROM %t '.$wheresql.' '.$orderby.DB::limit($startrow, $items), $parameter); + } + + public function fetch_all_by_status($status = 0, $start = 0, $limit = 1000) { + return DB::fetch_all('SELECT * FROM %t WHERE `status` = %d ORDER BY ' . $this->_pk . ' ' . DB::limit($start, $limit), array($this->_table, $status)); + } + + public function fetch_all_search($start, $limit, $fetchtype, $uids, $useip, $keywords, $lengthlimit, $starttime, $endtime, $basickeywords = 0, $doid = '', $findex = '') { + $parameter = array($this->_table); + $wherearr = array(); + if($doid) { + $parameter[] = (array)$doid; + $wherearr[] = 'doid IN(%n)'; + } + if(is_array($uids) && count($uids)) { + $parameter[] = $uids; + $wherearr[] = 'uid IN(%n)'; + } + if($useip) { + $parameter[] = str_replace('*', '%', $useip); + $wherearr[] = 'ip LIKE %s'; + } + if($keywords) { + if(!$basickeywords) { + $sqlkeywords = ''; + $or = ''; + $keywords = explode(',', str_replace(' ', '', $keywords)); + + for($i = 0; $i < count($keywords); $i++) { + $keywords[$i] = addslashes(stripsearchkey($keywords[$i])); + if(preg_match("/\{(\d+)\}/", $keywords[$i])) { + $keywords[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($keywords[$i], '/')); + $sqlkeywords .= " $or message REGEXP '".addslashes(stripsearchkey($keywords[$i]))."'"; + } else { + $sqlkeywords .= " $or message LIKE '%".$keywords[$i]."%'"; + } + $or = 'OR'; + } + $parameter[] = $sqlkeywords; + $wherearr[] = '%i'; + } else { + $parameter[] = '%'.$basickeywords.'%'; + $wherearr[] = 'message LIKE %s'; + } + } + + if($lengthlimit) { + $parameter[] = intval($lengthlimit); + $wherearr[] = 'LENGTH(message) < %d'; + } + + if($starttime) { + $parameter[] = is_numeric($starttime) ? $starttime : strtotime($starttime); + $wherearr[] = 'dateline>%d'; + } + + if($endtime) { + $parameter[] = is_numeric($endtime) ? $endtime : strtotime($endtime); + $wherearr[] = 'dateline<%d'; + } + + if($fetchtype == 3) { + $selectfield = "count(*)"; + } elseif ($fetchtype == 2) { + $selectfield = "doid"; + } else { + $selectfield = "*"; + $parameter[] = DB::limit($start, $limit); + $ordersql = ' ORDER BY dateline DESC %i'; + } + + if($findex) { + $findex = 'USE INDEX(dateline)'; + } + + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + if($fetchtype == 3) { + return DB::result_first("SELECT $selectfield FROM %t $wheresql", $parameter); + } else { + return DB::fetch_all("SELECT $selectfield FROM %t {$findex} $wheresql $ordersql", $parameter); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_favorite.php b/source/class/table/table_home_favorite.php new file mode 100644 index 0000000..d5803be --- /dev/null +++ b/source/class/table/table_home_favorite.php @@ -0,0 +1,87 @@ +_table = 'home_favorite'; + $this->_pk = 'favid'; + + parent::__construct(); + } + + public function fetch_all_by_uid_idtype($uid, $idtype, $favid = 0, $start = 0, $limit = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($favid) { + $parameter[] = dintval($favid, is_array($favid) ? true : false); + $wherearr[] = is_array($favid) ? 'favid IN(%n)' : 'favid=%d'; + } + $parameter[] = $uid; + $wherearr[] = "uid=%d"; + if(!empty($idtype)) { + $parameter[] = $idtype; + $wherearr[] = "idtype=%s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function count_by_uid_idtype($uid, $idtype, $favid = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($favid) { + $parameter[] = dintval($favid, is_array($favid) ? true : false); + $wherearr[] = is_array($favid) ? 'favid IN(%n)' : 'favid=%d'; + } + $parameter[] = $uid; + $wherearr[] = "uid=%d"; + if(!empty($idtype)) { + $parameter[] = $idtype; + $wherearr[] = "idtype=%s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first("SELECT COUNT(*) FROM %t $wheresql ", $parameter); + } + + public function fetch_by_id_idtype($id, $idtype, $uid = 0) { + if($uid) { + $uidsql = ' AND '.DB::field('uid', $uid); + } + return DB::fetch_first("SELECT * FROM %t WHERE id=%d AND idtype=%s $uidsql", array($this->_table, $id, $idtype)); + } + + public function count_by_id_idtype($id, $idtype) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE id=%d AND idtype=%s", array($this->_table, $id, $idtype)); + } + + public function delete_by_id_idtype($id, $idtype) { + return DB::delete($this->_table, DB::field('id', $id) .' AND '.DB::field('idtype', $idtype)); + } + + public function delete($val, $unbuffered = false, $uid = 0) { + $val = dintval($val, is_array($val) ? true : false); + if($val) { + if($uid) { + $uid = dintval($uid, is_array($uid) ? true : false); + } + return DB::delete($this->_table, DB::field($this->_pk, $val).($uid ? ' AND '.DB::field('uid', $uid) : ''), null, $unbuffered); + } + return !$unbuffered ? 0 : false; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_feed.php b/source/class/table/table_home_feed.php new file mode 100644 index 0000000..5b734f2 --- /dev/null +++ b/source/class/table/table_home_feed.php @@ -0,0 +1,276 @@ +_table = 'home_feed'; + $this->_pk = 'feedid'; + + parent::__construct(); + } + + public function optimize_table() { + return DB::query("OPTIMIZE TABLE %t", array($this->_table), true); + } + + public function fetch($id, $force_from_db = false, $null1 = '', $null2 = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + $force_from_db = $force_from_db === false ? '' : $force_from_db; + return $this->fetch_feed($id, $force_from_db, $null1, $null2); + } + } + + public function fetch_feed($id, $idtype = '', $uid = '', $feedid = '') { + $wherearr = array(); + if($feedid) { + $wherearr[] = DB::field('feedid', $feedid); + } + if($id) { + $wherearr[] = DB::field('id', $id); + $wherearr[] = DB::field('idtype', $idtype); + } + if($uid) { + $wherearr[] = DB::field('uid', $uid); + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + if(empty($wheresql)) { + return null; + } + + return DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' '.$wheresql); + } + + public function fetch_all_by_uid_dateline($uids, $findex = true, $start = 0, $limit = 5) { + if(!($uids = dintval($uids, true))) { + return null; + } + return DB::fetch_all('SELECT * FROM %t '.(($findex) ? 'USE INDEX(dateline)' : '').' WHERE uid IN (%n) ORDER BY dateline desc %i', array($this->_table, $uids, DB::limit($start, $limit))); + } + + public function fetch_all_by_hot($hotstarttime) { + return DB::fetch_all('SELECT * FROM %t USE INDEX(hot) WHERE dateline>=%d ORDER BY hot DESC LIMIT 0,10', array($this->_table, $hotstarttime)); + } + + public function update($val, $data, $unbuffered = false, $low_priority = false, $null = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::update($val, $data, $unbuffered, $low_priority); + } else { + $unbuffered = $unbuffered === false ? '' : $unbuffered; + $low_priority = $low_priority === false ? '' : $low_priority; + return $this->update_feed($val, $data, $unbuffered, $low_priority, $null); + } + } + + public function update_feed($id, $data, $idtype = '', $uid = '', $feedid = '') { + $condition = array(); + if($feedid) { + $condition[] = DB::field('feedid', $feedid); + } + if($id) { + $condition[] = DB::field('id', $id); + $condition[] = DB::field('idtype', $idtype); + } + if($uid) { + $condition[] = DB::field('uid', $uid); + } + + if(empty($data) || !is_array($data) || !count($condition)) { + return null; + } + DB::update($this->_table, $data, implode(' AND ', $condition)); + } + + public function update_hot_by_id($id, $idtype, $uid, $inchot) { + DB::query('UPDATE %t SET hot = hot+\'%d\' WHERE id = %d AND idtype = %s AND uid = %d', array($this->_table, $inchot, $id, $idtype, $uid)); + } + + public function update_hot_by_feedid($feedid, $inchot) { + DB::query('UPDATE %t SET hot = hot+\'%d\' WHERE feedid = %d', array($this->_table, $inchot, $feedid)); + } + + public function delete_by_dateline($dateline, $hot = 0) { + if(!is_numeric($dateline) || !is_numeric($hot)) { + return false; + } + $condition = array(); + + $condition[] = DB::field('dateline', $dateline, '<'); + $condition[] = DB::field('hot', $hot); + + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function delete_by_id_idtype($ids, $idtype) { + if(!$ids || !$idtype) { + return null; + } + $condition = array(); + + $condition[] = DB::field('id', $ids); + $condition[] = DB::field('idtype', $idtype); + + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function delete_by_uid_idtype($uid, $idtype) { + if(!$uid || !$idtype) { + return null; + } + $condition = array(); + $condition[] = DB::field('uid', $uid); + $condition[] = DB::field('idtype', $idtype); + + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function delete_by_icon($icon) { + if(!$icon) { + return null; + } + DB::delete($this->_table, DB::field('icon', $icon)); + } + + public function delete($val, $unbuffered = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::delete($val, $unbuffered); + } else { + $unbuffered = $unbuffered === false ? '' : $unbuffered; + return $this->delete_feed($val, $unbuffered); + } + } + + public function delete_feed($feedid, $uid = '') { + $condition = array(); + + if($feedid) { + $condition[] = DB::field('feedid', $feedid); + } + + if($uid) { + $condition[] = DB::field('uid', $uid); + } + + if(!count($condition)) { + return null; + } + + DB::delete($this->_table, implode(' AND ', $condition)); + } + + public function delete_by_uid($uids) { + if(!$uids) { + return null; + } + DB::delete($this->_table, DB::field('uid', $uids).' OR ('.DB::field('id', $uids).' AND idtype=\'uid\')'); + } + + public function fetch_uid_by_username($users) { + if(!$users) { + return null; + } + return DB::fetch_all('SELECT uid FROM %t WHERE username IN (%n)', array($this->_table, $users), 'uid'); + } + + public function fetch_icon_by_icon($icon) { + return DB::fetch_first('SELECT icon FROM %t WHERE icon=%s', array($this->_table, $icon)); + } + + public function fetch_feedid_by_hashdata($uid, $hash_data) { + return DB::fetch_first('SELECT feedid FROM %t WHERE uid=%d AND hash_data=%s LIMIT 0,1', array($this->_table, $uid, $hash_data)); + } + + public function fetch_feedid_by_feedid($feedid) { + if(!$feedid) { + return null; + } + return DB::fetch_all('SELECT feedid FROM %t WHERE feedid IN (%n)', array($this->_table, $feedid), 'feedid'); + } + + public function fetch_uid_by_uid($uid) { + if(!$uid) { + return null; + } + return DB::fetch_all('SELECT uid FROM %t WHERE uid IN (%n)', array($this->_table, $uid), 'uid'); + } + + public function fetch_all_by_search($fetchtype, $uids, $icon, $starttime, $endtime, $feedids, $hot1, $hot2, $start = 0, $limit = 0, $findex = '') { + $parameter = array($this->_table); + $wherearr = array(); + if(is_array($uids) && count($uids)) { + $parameter[] = $uids; + $wherearr[] = 'uid IN(%n)'; + } + + if($icon) { + $parameter[] = $icon; + $wherearr[] = 'icon=%s'; + } + + if($starttime) { + $parameter[] = is_numeric($starttime) ? $starttime : strtotime($starttime); + $wherearr[] = 'dateline>%d'; + } + + if($endtime) { + $parameter[] = is_numeric($endtime) ? $endtime : strtotime($endtime); + $wherearr[] = 'dateline<%d'; + } + + if(is_array($feedids) && count($feedids)) { + $parameter[] = $feedids; + $wherearr[] = 'feedid IN(%n)'; + } + + if($hot1) { + $parameter[] = $hot1; + $wherearr[] = 'hot>=%d'; + } + + if($hot2) { + $parameter[] = $hot2; + $wherearr[] = 'hot<=%d'; + } + + if($fetchtype == 3) { + $selectfield = "count(*)"; + } elseif ($fetchtype == 2) { + $selectfield = "feedid"; + } else { + $selectfield = "*"; + $parameter[] = DB::limit($start, $limit); + $ordersql = ' ORDER BY dateline DESC %i'; + } + + if($findex) { + $findex = 'USE INDEX(dateline)'; + } + + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + if($fetchtype == 3) { + return DB::result_first("SELECT $selectfield FROM %t $wheresql", $parameter); + } else { + return DB::fetch_all("SELECT $selectfield FROM %t {$findex} $wheresql $ordersql", $parameter); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_follow.php b/source/class/table/table_home_follow.php new file mode 100644 index 0000000..74560fc --- /dev/null +++ b/source/class/table/table_home_follow.php @@ -0,0 +1,152 @@ +_table = 'home_follow'; + $this->_pk = ''; + $this->_pre_cache_key = 'home_follow_'; + + parent::__construct(); + } + + public function fetch_all_following_by_uid($uid, $status = 0, $start = 0, $limit = 0) { + $data = array(); + $wherearr = array(); + $force = !$start && !$limit && !$status ? false : true; + if((!$force && ($data = $this->fetch_cache($uid)) === false) || $force) { + $parameter = array($this->_table, $uid); + $wherearr[] = 'uid=%d'; + if($status) { + $wherearr[] = "status=%d"; + } else { + $wherearr[] = "status!=%d"; + $status = -1; + } + $parameter[] = $status; + $wheresql = !empty($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + $data = DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter, 'followuid'); + if(!$force) { + $this->store_cache($uid, $data, $this->_cache_ttl); + } + } + return $data; + } + + public function fetch_all_follower_by_uid($uids, $start = 0, $limit = 0) { + $uids = dintval($uids, true); + if($uids) { + $parameter = array($this->_table, $uids); + $fsql = is_array($uids) && $uids ? 'followuid IN(%n)' : 'followuid=%d'; + return DB::fetch_all("SELECT * FROM %t WHERE $fsql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter, 'uid'); + } + return array(); + } + + public function fetch_all_by_uid_followuid($uid, $followuids) { + $followuids = dintval($followuids, true); + if($followuids) { + return DB::fetch_all("SELECT * FROM %t WHERE uid=%d AND followuid IN(%n)", array($this->_table, $uid, $followuids), 'followuid'); + } + return array(); + } + public function fetch_status_by_uid_followuid($uid, $followuid) { + return DB::fetch_all('SELECT * FROM %t WHERE (uid=%d AND followuid=%d) OR (uid=%d AND followuid=%d)', array($this->_table, $uid, $followuid, $followuid, $uid), 'uid'); + } + + public function fetch_all_by_uid_fusername($uid, $users) { + if(empty($uid) || empty($users)) { + return array(); + } + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND fusername IN(%n)', array($this->_table, $uid, $users)); + } + + public function fetch_all_by_uid_username($uid, $username = '', $start = 0, $limit = 0) { + $parameter = array($this->_table, $uid); + $wherearr = array('uid=%d'); + if(!empty($username)) { + $parameter[] = $username.'%'; + $wherearr[] = "fusername LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all("SELECT * FROM %t $wheresql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter); + } + + public function count_follow_user($uid, $type = 0, $dateline = 0) { + $count = 0; + $parameter = array($this->_table, $uid); + $wherearr = array(); + $field = $type ? 'followuid' : 'uid'; + $wherearr[] = "$field=%d"; + $parameter[] = $uid; + + if($dateline) { + $wherearr[] = "dateline >%d"; + $parameter[] = $dateline; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + $count = DB::result_first("SELECT COUNT(*) FROM %t $wheresql", $parameter); + return $count; + } + + public function count_by_uid_username($uid, $username = '') { + $parameter = array($this->_table, $uid); + $wherearr = array('uid=%d'); + if(!empty($username)) { + $parameter[] = $username.'%'; + $wherearr[] = "fusername LIKE %s"; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + $count = DB::result_first("SELECT COUNT(*) FROM %t $wheresql", $parameter); + return $count; + } + + public function insert($data, $return_insert_id = false, $replace = false, $silent = false) { + if($data && is_array($data)) { + $this->clear_cache($data['uid']); + return DB::insert($this->_table, $data, $return_insert_id, $replace, $silent); + } + return 0; + } + + public function fetch_by_uid_followuid($uid, $followuid) { + return DB::fetch_first("SELECT * FROM %t WHERE uid=%d AND followuid=%d", array($this->_table, $uid, $followuid)); + } + public function update_by_uid_followuid($uid, $followuid, $data) { + $uid = dintval($uid, true); + $followuid = dintval($followuid, true); + if(!empty($data) && is_array($data) && $uid && $followuid) { + $this->clear_cache($uid); + return DB::update($this->_table, $data, DB::field('uid', $uid).' AND '.DB::field('followuid', $followuid)); + } + return 0; + } + + public function delete_by_uid_followuid($uid, $followuid) { + $this->clear_cache($uid); + return DB::query('DELETE FROM %t WHERE uid=%d AND followuid=%d', array($this->_table, $uid, $followuid)); + } + + public function delete_by_uid($uids) { + return DB::delete($this->_table, DB::field('uid', $uids)); + } + + public function delete_by_followuid($uids) { + return DB::delete($this->_table, DB::field('followuid', $uids)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_follow_feed.php b/source/class/table/table_home_follow_feed.php new file mode 100644 index 0000000..6acca6b --- /dev/null +++ b/source/class/table/table_home_follow_feed.php @@ -0,0 +1,133 @@ +_table = 'home_follow_feed'; + $this->_pk = 'feedid'; + + parent::__construct(); + } + + public function fetch_all_by_uid($uids = 0, $archiver = false, $start = 0, $limit = 0) { + + $data = array(); + $parameter = array($archiver ? $this->_archiver_table : $this->_table); + $wherearr = array(); + if(!empty($uids)) { + $uids = dintval($uids, true); + $wherearr[] = is_array($uids) && $uids ? 'uid IN(%n)' : 'uid=%d'; + $parameter[] = $uids; + } + $wheresql = !empty($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + $query = DB::query("SELECT * FROM %t $wheresql ORDER BY dateline DESC ".DB::limit($start, $limit), $parameter); + while($row = DB::fetch($query)) { + $data[$row['feedid']] = $row; + $this->_tids[$row['tid']] = $row['tid']; + } + + return $data; + } + + public function fetch_all_by_dateline($dateline, $glue = '>=') { + $glue = helper_util::check_glue($glue); + return DB::fetch_all("SELECT * FROM %t WHERE dateline{$glue}%d ORDER BY dateline", array($this->_table, $dateline), $this->_pk); + } + + public function fetch_by_feedid($feedid, $archiver = false) { + return DB::fetch_first("SELECT * FROM %t WHERE feedid=%d", array($archiver ? $this->_archiver_table : $this->_table, $feedid)); + } + + public function count_by_uid_tid($uid, $tid, $archiver = false) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND tid=%d', array($archiver ? $this->_archiver_table : $this->_table, $uid, $tid)); + } + + public function count_by_uid_dateline($uids = array(), $dateline = 0, $archiver = 0) { + $count = 0; + $parameter = array($archiver ? $this->_archiver_table : $this->_table); + $wherearr = array(); + if(!empty($uids)) { + $uids = dintval($uids, true); + $wherearr[] = is_array($uids) && $uids ? 'uid IN(%n)' : 'uid=%d'; + $parameter[] = $uids; + } + if($dateline) { + $wherearr[] = "dateline>%d"; + $parameter[] = $dateline; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + $count = DB::result_first("SELECT COUNT(*) FROM %t $wheresql", $parameter); + return $count; + } + + public function insert_archiver($data) { + if(!empty($data) && is_array($data)) { + return DB::insert($this->_archiver_table, $data, false, true); + } + return 0; + } + + public function delete_by_feedid($feedid, $archiver = false) { + $feedid = dintval($feedid, true); + if($feedid) { + return DB::delete($archiver ? $this->_archiver_table : $this->_table, DB::field('feedid', $feedid)); + } + return 0; + } + + public function delete_by_uid($uids) { + $uids = dintval($uids, true); + $delnum = 0; + if($uids) { + $delnum = DB::delete($this->_table, DB::field('uid', $uids)); + $delnum += DB::delete($this->_archiver_table, DB::field('uid', $uids)); + } + return $delnum; + } + + public function delete_by_uid_tid($uid, $tid) { //delete feed while deleting thread + $condition = array(); + $delnum = 0; + if($uid && $tid) { + $condition = array(); + + $condition[] = DB::field('uid', $uid); + $condition[] = DB::field('tid', $tid); + + $delnum = DB::delete($this->_table, implode(' AND ', $condition)); + } + return $delnum; + } + + public function get_ids() { + return $this->_ids; + } + + public function get_tids() { + return $this->_tids; + } + + public function get_cids() { + return $this->_cids; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_friend.php b/source/class/table/table_home_friend.php new file mode 100644 index 0000000..776b620 --- /dev/null +++ b/source/class/table/table_home_friend.php @@ -0,0 +1,141 @@ +_table = 'home_friend'; + $this->_pk = 'uid'; + + parent::__construct(); + } + + public function fetch_all_by_uid_username($uid, $username, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND fusername IN (%n) %i', array($this->_table, $uid, $username, DB::limit($start, $limit))); + } + + public function fetch_all_by_uid_fuid($uid, $fuid) { + if(!$uid || !$fuid) { + return null; + } + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND fuid IN (%n)', array($this->_table, $uid, $fuid)); + } + + public function fetch_all_by_uid_gid($uid, $gid, $start = 0, $limit = 100, $order = true) { + $parameter = array($this->_table, $uid, $gid); + + if($order) { + $limitsql = ' ORDER BY num DESC, dateline DESC'; + } + if($limit) { + $parameter[] = DB::limit($start, $limit); + $limitsql .= ' %i'; + } + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d AND gid=%d'.$limitsql, $parameter); + } + + public function fetch_all_by_uid_common($uid, $fuid) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d OR uid=%d', array($this->_table, $uid, $fuid)); + } + + public function fetch_all_by_uid($uid, $start = 0, $limit = 0, $order = false) { + return $this->fetch_all_search($uid, '', '', false, $start, $limit, $order); + } + + public function fetch_all_search($uid, $gid, $searchkey, $count = false, $start = 0, $limit = 0, $order = false) { + $parameter = array($this->_table); + $wherearr = array(); + $parameter[] = $uid; + $wherearr[] = is_array($uid) ? 'uid IN(%n)' : 'uid=%d'; + + if(is_numeric($gid) && $gid > -1) { + $parameter[] = $gid; + $wherearr[] = 'gid=%d'; + } + + if($searchkey) { + $field = "fusername LIKE '{text}%'"; + $keyword = $searchkey; + if(preg_match("(AND|\+|&|\s)", $keyword) && !preg_match("(OR|\|)", $keyword)) { + $andor = ' AND '; + $keywordsrch = '1'; + $keyword = preg_replace("/( AND |&| )/is", "+", $keyword); + } else { + $andor = ' OR '; + $keywordsrch = '0'; + $keyword = preg_replace("/( OR |\|)/is", "+", $keyword); + } + $keyword = str_replace('*', '%', addcslashes(daddslashes($keyword), '%_')); + foreach(explode('+', $keyword) as $text) { + $text = trim($text); + if($text) { + $keywordsrch .= $andor; + $keywordsrch .= str_replace('{text}', $text, $field); + } + } + $parameter[] = " ($keywordsrch)"; + $wherearr[] = '%i'; + } + + if(!$count) { + $limitsql = ''; + if($order) { + $limitsql = ' ORDER BY num DESC, dateline DESC'; + } + if($limit) { + $parameter[] = DB::limit($start, $limit); + $limitsql .= ' %i'; + } + } + + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + if($count) { + return DB::result_first('SELECT COUNT(*) FROM %t '.$wheresql, $parameter); + } else { + return DB::fetch_all('SELECT * FROM %t '.$wheresql.$limitsql, $parameter); + } + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + + public function delete_by_uid_fuid($uids) { + if(!$uids) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uids).' OR '.DB::field('fuid', $uids)); + } + + public function delete_by_uid_fuid_dual($uids, $touid) { + if(!$uids || !$touid) { + return null; + } + return DB::delete($this->_table, '('.DB::field('uid', $uids).' AND '.DB::field('fuid', $touid).') OR ('.DB::field('fuid', $uids).' AND '.DB::field('uid', $touid).')'); + } + + public function update_num_by_uid_fuid($incnum, $uid, $fuid) { + return DB::query('UPDATE %t SET num=num+\'%d\' WHERE uid=%d AND fuid=%d', array($this->_table, $incnum, $uid, $fuid)); + } + + public function update_by_uid_fuid($uid, $fuid, $data) { + if(!$uid || !$fuid || empty($data) || !is_array($data)) { + return null; + } + return DB::update($this->_table, $data, DB::field('uid', $uid).' AND '.DB::field('fuid', $fuid)); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_friend_request.php b/source/class/table/table_home_friend_request.php new file mode 100644 index 0000000..102df87 --- /dev/null +++ b/source/class/table/table_home_friend_request.php @@ -0,0 +1,63 @@ +_table = 'home_friend_request'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_by_uid($uid) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d LIMIT 0,1', array($this->_table, $uid)); + } + public function fetch_by_uid_fuid($uid, $fuid) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND fuid=%d', array($this->_table, $uid, $fuid)); + } + public function fetch_all_by_uid($uid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $uid)); + } + public function delete_by_uid_or_fuid($uids) { + $uids = dintval($uids, true); + if($uids) { + return DB::delete($this->_table, DB::field('uid', $uids).' OR '.DB::field('fuid', $uids)); + } + return 0; + } + public function delete_by_uid($uids) { + $uids = dintval($uids, true); + if($uids) { + return DB::delete($this->_table, DB::field('uid', $uids)); + } + return 0; + } + public function delete_by_uid_fuid($uid, $fuid) { + $uid = dintval($uid, true); + $fuid = dintval($fuid, true); + if($uid) { + return DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('fuid', $fuid)); + } + return 0; + } + public function count_by_uid_fuid($uid, $fuid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND fuid=%d', array($this->_table, $uid, $fuid)); + } + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_friendlog.php b/source/class/table/table_home_friendlog.php new file mode 100644 index 0000000..c6b4170 --- /dev/null +++ b/source/class/table/table_home_friendlog.php @@ -0,0 +1,32 @@ +_table = 'home_friendlog'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_all_order_by_dateline($start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t ORDER BY dateline'.DB::limit($start, $limit), array($this->_table)); + } + public function delete_by_uid_fuid($uid, $fuid) { + return DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('fuid', $fuid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_notification.php b/source/class/table/table_home_notification.php new file mode 100644 index 0000000..ff80f8b --- /dev/null +++ b/source/class/table/table_home_notification.php @@ -0,0 +1,125 @@ +_table = 'home_notification'; + $this->_pk = 'id'; + + parent::__construct(); + } + + public function delete_clear($new, $days) { + $days = TIMESTAMP - intval($days) * 86400; + DB::query("DELETE FROM %t WHERE new=%d AND dateline<%d", array($this->_table, $new, $days)); + } + public function delete_by_type($type, $uid = 0) { + if(!$type) { + return; + } + $uid = $uid ? ' AND '.DB::field('uid', $uid) : ''; + return DB::query("DELETE FROM %t WHERE type=%s %i", array($this->_table, $type, $uid)); + } + + public function optimize() { + DB::query("OPTIMIZE TABLE %t", array($this->_table), true); + } + + public function fetch_by_fromid_uid($id, $idtype, $uid) { + return DB::fetch_first("SELECT * FROM %t WHERE from_id=%d AND from_idtype=%s AND uid=%d", array($this->_table, $id, $idtype, $uid)); + } + + public function delete_by_id_uid($id, $uid) { + DB::query("DELETE FROM %t WHERE id=%d AND uid=%d", array($this->_table, $id, $uid)); + } + + public function delete_by_uid($uid) { + DB::query("DELETE FROM %t WHERE uid IN (%n) OR authorid IN (%n)", array($this->_table, $uid, $uid)); + } + + public function delete_by_uid_type_authorid($uid, $type, $authorid) { + return DB::query('DELETE FROM %t WHERE uid=%d AND type=%s AND authorid=%d', array($this->_table, $uid, $type, $authorid)); + } + + public function fetch_all_by_authorid_fromid($authorid, $fromid, $type) { + return DB::fetch_all("SELECT * FROM %t WHERE authorid=%d AND from_id=%d AND type=%s", array($this->_table, $authorid, $fromid, $type)); + } + + public function ignore($uid, $type = '', $category = '', $new = true, $from_num = true) { + $uid = intval($uid); + $update = array(); + if($new) { + $update['new'] = 0; + } + if($from_num) { + $update['from_num'] = 0; + } + $where = array('uid' => $uid, 'new' => 1); + if($type) { + $where['type'] = $type; + } + if($category !== '') { + switch ($category) { + case 'mypost' : $category = 1; break; + case 'interactive' : $category = 2; break; + case 'system' : $category = 3; break; + case 'manage' : $category = 4; break; + default : $category = 0; + } + $where['category'] = $category; + } + if($update) { + DB::update($this->_table, $update, $where); + } + } + + public function count_by_uid($uid, $new, $type = '', $category = '') { + $new = intval($new); + $type = $type ? ' AND '.DB::field('type', $type) : ''; + if($category !== '') { + switch ($category) { + case 'mypost' : $category = 1; break; + case 'interactive' : $category = 2; break; + case 'system' : $category = 3; break; + case 'manage' : $category = 4; break; + default : $category = 0; + } + $category = ' AND '.DB::field('category', $category); + } + $new = $new != '-1' ? ' AND '.DB::field('new', $new) : ''; + return DB::result_first("SELECT COUNT(*) FROM %t WHERE uid=%d %i %i %i", array($this->_table, $uid, $new, $category, $type)); + } + + public function fetch_all_by_uid($uid, $new, $type = 0, $start = 0, $perpage = 0, $category = '') { + $new = intval($new); + $type = $type ? ' AND '.DB::field('type', $type) : ''; + if($category !== '') { + switch ($category) { + case 'mypost' : $category = 1; break; + case 'interactive' : $category = 2; break; + case 'system' : $category = 3; break; + case 'manage' : $category = 4; break; + case 'follow' : $category = 5; break; + case 'follower' : $category = 6; break; + default : $category = 0; + } + $category = ' AND '.DB::field('category', $category); + } + $new = $new != '-1' ? ' AND '.DB::field('new', $new) : ''; + return DB::fetch_all("SELECT * FROM %t WHERE uid=%d %i %i %i ORDER BY dateline DESC %i", array($this->_table, $uid, $new, $category, $type, DB::limit($start, $perpage))); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_pic.php b/source/class/table/table_home_pic.php new file mode 100644 index 0000000..e300100 --- /dev/null +++ b/source/class/table/table_home_pic.php @@ -0,0 +1,112 @@ +_table = 'home_pic'; + $this->_pk = 'picid'; + + parent::__construct(); + } + + public function update_click($picid, $clickid, $incclick) { + $clickid = intval($clickid); + if($clickid < 1 || $clickid > 8 || empty($picid) || empty($incclick)) { + return false; + } + return DB::query('UPDATE %t SET click'.$clickid.' = click'.$clickid.'+\'%d\' WHERE picid = %d', array($this->_table, $incclick, $picid)); + } + public function update_hot($picid, $num = 1) { + return DB::query('UPDATE %t SET hot=hot+\'%d\' WHERE picid=%d', array($this->_table, $num, $picid)); + } + public function update_sharetimes($picid, $num = 1) { + return DB::query('UPDATE %t SET sharetimes=sharetimes+\'%d\' WHERE picid=%d', array($this->_table, $num, $picid)); + } + public function fetch_all_by_uid($uids, $start = 0, $limit = 0, $picids = 0) { + if(empty($uids)) { + return array(); + } + $picidsql = $picids ? DB::field('picid', $picids).' AND ' : ''; + return DB::fetch_all("SELECT * FROM %t WHERE $picidsql ".DB::field('uid', $uids).DB::limit($start, $limit), array($this->_table)); + } + public function update_for_uid($uids, $picids, $data) { + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('picid', $picids).' AND '.DB::field('uid', $uids)); + } + return 0; + } + public function fetch_all_by_albumid($albumids, $start = 0, $limit = 0, $picids = 0, $orderbypicid = 0, $orderbydateline = 0, $uid = 0, $count = false) { + $albumids = $albumids < 0 ? 0 : $albumids; + $picidsql = $picids ? DB::field('picid', $picids).' AND ' : ''; + if($orderbypicid) { + $ordersql = 'ORDER BY picid DESC '; + } elseif($orderbydateline) { + $ordersql = 'ORDER BY dateline DESC '; + } + $uidsql = $uid ? ' AND '.DB::field('uid', $uid) : ''; + if ($count) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE $picidsql ".DB::field('albumid', $albumids)." $uidsql", array($this->_table)); + } else { + return DB::fetch_all("SELECT * FROM %t WHERE $picidsql ".DB::field('albumid', $albumids)." $uidsql $ordersql".DB::limit($start, $limit), array($this->_table)); + } + } + public function update_for_albumid($albumid, $data) { + if(!empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('albumid', $albumid)); + } + return 0; + } + public function delete_by_uid($uids) { + return DB::query("DELETE FROM %t WHERE ".DB::field('uid', $uids), array($this->_table)); + } + public function delete_by_albumid($albumids) { + return DB::query("DELETE FROM %t WHERE ".DB::field('albumid', $albumids), array($this->_table)); + } + public function fetch_all_by_sql($where = '1', $orderby = '', $start = 0, $limit = 0, $count = 0, $joinalbum = 1) { + if(!$where) { + $where = '1'; + } + if($count) { + return DB::result_first("SELECT count(*) FROM ".DB::table($this->_table)." p WHERE %i", array($where)); + } + return DB::fetch_all("SELECT ".($joinalbum ? 'a.*, ' : '')."p.* FROM ".DB::table($this->_table)." p ".($joinalbum ? "LEFT JOIN ".DB::table('home_album')." a USING(albumid)" : '')." WHERE %i ".($orderby ? "ORDER BY $orderby " : '').DB::limit($start, $limit), array($where)); + } + public function fetch_albumpic($albumid, $uid) { + return DB::fetch_first("SELECT filepath, thumb FROM %t WHERE albumid=%d AND uid=%d ORDER BY thumb DESC, dateline DESC LIMIT 0,1", array($this->_table, $albumid, $uid)); + } + public function check_albumpic($albumid, $status = NULL, $uid = 0) { + $sql = is_numeric($albumid) ? DB::field('albumid', $albumid) : ''; + $sql .= $uid ? ($sql ? ' AND ' : '').DB::field('uid', $uid) : ''; + $sql .= $status === NULL ? '' : ($sql ? ' AND ' : '').DB::field('status', $status); + return DB::result_first("SELECT COUNT(*) FROM %t WHERE $sql", array($this->_table)); + } + public function count_size_by_uid($uid) { + return DB::result_first("SELECT SUM(size) FROM %t WHERE uid=%d", array($this->_table, $uid)); + } + public function fetch_by_id_idtype($id) { + if(!$id) { + return false; + } + return DB::fetch_first('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('picid', $id))); + } + public function update_dateline_by_id_idtype_uid($id, $idtype, $dateline, $uid) { + if(empty($id) || empty($idtype) || empty($dateline) || empty($uid)) { + return false; + } + return DB::update($this->_table, array('dateline' => intval($dateline)), array($idtype => intval($id), 'uid' => intval($uid))); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_picfield.php b/source/class/table/table_home_picfield.php new file mode 100644 index 0000000..1add9db --- /dev/null +++ b/source/class/table/table_home_picfield.php @@ -0,0 +1,26 @@ +_table = 'home_picfield'; + $this->_pk = 'picid'; + + parent::__construct(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_poke.php b/source/class/table/table_home_poke.php new file mode 100644 index 0000000..44abb05 --- /dev/null +++ b/source/class/table/table_home_poke.php @@ -0,0 +1,67 @@ +_table = 'home_poke'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_all_by_uid_fromuid($uid, $fromuid) { + $uid = dintval($uid, is_array($uid) ? true : false); + $fromuid = dintval($fromuid, is_array($fromuid) ? true : false); + $wherearr = array(); + $wherearr[] = is_array($uid) && $uid ? 'uid IN(%n)' : 'uid=%d'; + $wherearr[] = is_array($fromuid) && $fromuid ? 'fromuid IN(%n)' : 'fromuid=%d'; + + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + return DB::fetch_all('SELECT * FROM %t '.$wheresql, array($this->_table, $uid, $fromuid)); + } + + public function fetch_all_by_uid($uid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $uid)); + } + + public function delete_by_uid_or_fromuid($uids) { + $uids = dintval($uids, is_array($uids) ? true : false); + if($uids) { + return DB::delete($this->_table, DB::field('uid', $uids).' OR '.DB::field('fromuid', $uids)); + } + return 0; + } + + public function delete_by_uid_fromuid($uids, $fromuid = 0) { + $uids = dintval($uids, is_array($uids) ? true : false); + $parameter = array($this->_table, $uids); + $wherearr = array(); + $wherearr[] = is_array($uids) && $uids ? 'uid IN(%n)' : 'uid=%d'; + if($fromuid) { + $fromuid = dintval($fromuid, is_array($fromuid) ? true : false); + $wherearr[] = is_array($fromuid) && $fromuid ? 'fromuid IN(%n)' : 'fromuid=%d'; + $parameter[] = $fromuid; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::query('DELETE FROM %t '.$wheresql, $parameter); + } + + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_pokearchive.php b/source/class/table/table_home_pokearchive.php new file mode 100644 index 0000000..c4d134b --- /dev/null +++ b/source/class/table/table_home_pokearchive.php @@ -0,0 +1,40 @@ +_table = 'home_pokearchive'; + $this->_pk = 'pid'; + + parent::__construct(); + } + + public function delete_by_uid_or_fromuid($uids) { + $uids = dintval($uids, is_array($uids) ? true : false); + if($uids) { + return DB::delete($this->_table, DB::field('uid', $uids).' OR '.DB::field('fromuid', $uids)); + } + return 0; + } + public function fetch_all_by_pokeuid($pokeuid) { + return DB::fetch_all('SELECT * FROM %t WHERE pokeuid=%d ORDER BY dateline', array($this->_table, $pokeuid)); + } + public function delete_by_dateline($dateline) { + DB::query('DELETE FROM %t WHERE dateline<%d', array($this->_table, $dateline)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_share.php b/source/class/table/table_home_share.php new file mode 100644 index 0000000..215a1f1 --- /dev/null +++ b/source/class/table/table_home_share.php @@ -0,0 +1,216 @@ +_table = 'home_share'; + $this->_pk = 'sid'; + + parent::__construct(); + } + + public function fetch_by_id_idtype($id) { + if(!$id) { + return null; + } + return DB::fetch_first('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('sid', $id))); + } + public function update_dateline_by_id_idtype_uid($id, $idtype, $dateline, $uid) { + $uid = dintval($uid); + if(empty($idtype) || empty($id) || empty($uid)) { + return 0; + } + return DB::update($this->_table, array('dateline' => $dateline), DB::field($idtype, $id).' AND '.DB::field('uid', $uid)); + } + public function fetch_by_type($type) { + return DB::fetch_first('SELECT * FROM %t WHERE type=%s', array($this->_table, $type)); + } + + public function fetch_by_sid_uid($sid, $uid) { + return DB::fetch_first('SELECT * FROM %t WHERE sid=%d AND uid=%d', array($this->_table, $sid, $uid)); + } + public function fetch_all_by_uid($uids, $start = 0, $limit = 0) { + $uids = dintval($uids); + if($uids) { + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('uid', $uids).' ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table), $this->_pk); + } + return array(); + } + + public function fetch_all_by_sid_uid_type($sid = 0, $uids = 0, $type = '', $start = 0, $limit = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($sid) { + $parameter[] = $sid; + $wherearr[] = 'sid=%d'; + } + if(!empty($uids)) { + $uids = dintval($uids, true); + $parameter[] = $uids; + $wherearr[] = is_array($uids) ? 'uid IN(%n)' : 'uid=%d'; + } + if(!empty($type)) { + $parameter[] = $type; + $wherearr[] = 'type=%s'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + return DB::fetch_all('SELECT * FROM %t '.$wheresql.' ORDER BY dateline DESC '.DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function fetch_all_by_username($users) { + if(!empty($users)) { + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('username', $users), array($this->_table), $this->_pk); + } + return array(); + } + + public function fetch_all_by_status($status = 0, $start = 0, $limit = 1000) { + return DB::fetch_all('SELECT * FROM %t WHERE `status` = %d ORDER BY ' . $this->_pk . ' ' . DB::limit($start, $limit), array($this->_table, $status)); + } + + public function fetch_all_search($sid = 0, $uids = 0, $type = '', $starttime = 0, $endtime = 0, $starthot = 0, $endhot = 0, $start = 0, $limit = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($sid) { + $sid = dintval($sid, true); + $parameter[] = $sid; + $wherearr[] = is_array($sid) ? 'sid IN(%n)' : 'sid=%d'; + } + if($uids) { + $uids = dintval($uids, true); + $parameter[] = $uids; + $wherearr[] = is_array($uids) ? 'uid IN(%n)' : 'uid=%d'; + } + if(!empty($type)) { + $parameter[] = $type; + $wherearr[] = 'type=%s'; + } + if($starttime) { + $parameter[] = $starttime; + $wherearr[] = 'dateline>=%d'; + } + if($endtime) { + $parameter[] = $endtime; + $wherearr[] = 'dateline<=%d'; + } + if($starthot) { + $parameter[] = $starthot; + $wherearr[] = 'hot>=%d'; + } + if($endhot) { + $parameter[] = $endhot; + $wherearr[] = 'hot<=%d'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all('SELECT * FROM %t '.$wheresql.' ORDER BY dateline DESC '.DB::limit($start, $limit), $parameter, $this->_pk); + } + + public function count_by_type($type) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE type=%s', array($this->_table, $type)); + } + + public function count_by_uid_itemid_type($uid = null, $itemid = null, $type = null) { + $parameter = array($this->_table); + $wherearr = array(); + if($uid !== null) { + $parameter[] = $uid; + $wherearr[] = 'uid=%d'; + } + if($itemid !== null) { + $parameter[] = $itemid; + $wherearr[] = 'itemid=%d'; + } + if($type !== null) { + $parameter[] = $type; + $wherearr[] = 'type=%s'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first('SELECT COUNT(*) FROM %t '.$wheresql, $parameter); + } + + public function count_by_sid_uid_type($sid = 0, $uids = 0, $type = '') { + $parameter = array($this->_table); + $wherearr = array(); + if($sid) { + $parameter[] = $sid; + $wherearr[] = 'sid=%d'; + } + if(!empty($uids)) { + $uids = dintval($uids, true); + $parameter[] = $uids; + $wherearr[] = is_array($uids) ? 'uid IN(%n)' : 'uid=%d'; + } + if(!empty($type)) { + $parameter[] = $type; + $wherearr[] = 'type=%s'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + return DB::result_first('SELECT COUNT(*) FROM %t '.$wheresql, $parameter); + } + + public function count_by_search($sid = 0, $uids = 0, $type = '', $starttime = 0, $endtime = 0, $starthot = 0, $endhot = 0) { + $parameter = array($this->_table); + $wherearr = array(); + if($sid) { + $sid = dintval($sid, true); + $parameter[] = $sid; + $wherearr[] = is_array($sid) ? 'sid IN(%n)' : 'sid=%d'; + } + if($uids) { + $uids = dintval($uids, true); + $parameter[] = $uids; + $wherearr[] = is_array($uids) ? 'uid IN(%n)' : 'uid=%d'; + } + if(!empty($type)) { + $parameter[] = $type; + $wherearr[] = 'type=%s'; + } + if($starttime) { + $parameter[] = $starttime; + $wherearr[] = 'dateline>=%d'; + } + if($endtime) { + $parameter[] = $endtime; + $wherearr[] = 'dateline<=%d'; + } + if($starthot) { + $parameter[] = $starthot; + $wherearr[] = 'hot>=%d'; + } + if($endhot) { + $parameter[] = $endhot; + $wherearr[] = 'hot<=%d'; + } + $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first('SELECT COUNT(*) FROM %t '.$wheresql, $parameter); + } + + public function delete_by_uid($uids) { + $uids = dintval($uids, true); + if($uids) { + return DB::query('DELETE FROM %t WHERE '.DB::field('uid', $uids), array($this->_table)); + } + return 0; + } + + public function update_hot_by_sid($sid, $hotuser) { + return DB::query('UPDATE %t SET hot=hot+1, hotuser=%s WHERE sid=%d', array($this->_table, $hotuser, $sid)); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_show.php b/source/class/table/table_home_show.php new file mode 100644 index 0000000..e8d3c13 --- /dev/null +++ b/source/class/table/table_home_show.php @@ -0,0 +1,77 @@ +_table = 'home_show'; + $this->_pk = 'uid'; + + parent::__construct(); + } + + public function count_by_credit($unitprice = false) { + $args = array($this->_table); + if($unitprice !== false) { + $sql = 'AND unitprice>=%d'; + $args[] = $unitprice; + } + return DB::result_first("SELECT COUNT(*) FROM %t WHERE credit>0 {$sql}", $args); + } + + public function fetch_by_uid_credit($uid) { + return DB::fetch_first('SELECT unitprice, credit FROM %t WHERE uid=%d AND credit>0', array($this->_table, $uid)); + } + + public function fetch_all_by_unitprice($start, $perpage, $selectall = false) { + $selectfields = $selectall ? '*' : 'uid, username, unitprice, credit AS show_credit, note AS show_note'; + return DB::fetch_all("SELECT {$selectfields} FROM %t ORDER BY unitprice DESC, credit DESC %i", array($this->_table, DB::limit($start, $perpage))); + } + + public function fetch_all_by_credit($start, $perpage) { + return DB::fetch_all('SELECT * FROM %t ORDER BY credit DESC %i', array($this->_table, DB::limit($start, $perpage))); + } + + public function delete_by_credit($credit = 1) { + return DB::query('DELETE FROM %t WHERE %i', array($this->_table, DB::field('credit', intval($credit), '<'))); + } + public function delete_by_uid($uids) { + if(!$uids) { + return null; + } + return DB::delete($this->_table, DB::field('uid', $uids)); + } + + public function update_credit_by_uid($uid, $inc_credit, $limit_credit = true, $unitprice = false, $note = false) { + $args = array($this->_table, $inc_credit); + + if($limit_credit === true) { + $sql = ' AND credit>0'; + } + if($unitprice !== false) { + $args[] = $unitprice; + $set_sql = ', unitprice=%d'; + } + + if($note !== false) { + $args[] = $note; + $set_sql .= ', note=%s'; + } + $args[] = $uid; + return DB::query("UPDATE %t SET credit=credit+'%d' {$set_sql} WHERE uid=%d {$sql}", $args); + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_specialuser.php b/source/class/table/table_home_specialuser.php new file mode 100644 index 0000000..6b9f593 --- /dev/null +++ b/source/class/table/table_home_specialuser.php @@ -0,0 +1,49 @@ +_table = 'home_specialuser'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_status($status, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE status=%d ORDER BY displayorder'.DB::limit($start, $limit), array($this->_table, $status), 'uid'); + } + + public function count_by_status($status, $username = '') { + $addsql = $username ? " AND username='".addslashes($username)."' " : ''; + return DB::result_first('SELECT COUNT(*) FROM %t WHERE status=%d'.$addsql, array($this->_table, $status)); + } + + public function update_by_uid_status($uid, $status, $data) { + if(!empty($data) && is_array($data) && ($uid = dintval($uid))) { + return DB::update($this->_table, $data, array('uid' => $uid, 'status' => dintval($status))); + } + return 0; + } + + public function delete_by_uid_status($uid, $status) { + return ($uid = dintval($uid, true)) ? DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('status', dintval($status))) : false; + } + + public function fetch_by_uid_status($uid, $status) { + return ($uid = dintval($uid, true)) ? DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND status=%d', array($this->_table, $uid, $status)) : array(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_home_visitor.php b/source/class/table/table_home_visitor.php new file mode 100644 index 0000000..c5ddf71 --- /dev/null +++ b/source/class/table/table_home_visitor.php @@ -0,0 +1,66 @@ +_table = 'home_visitor'; + $this->_pk = ''; + + parent::__construct(); + } + public function fetch_by_uid_vuid($uid, $vuid) { + return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND vuid=%d', array($this->_table, $uid, $vuid)); + } + public function fetch_all_by_uid($uid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE uid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $uid)); + } + public function fetch_all_by_vuid($uid, $start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM %t WHERE vuid=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $uid)); + } + public function update_by_uid_vuid($uid, $vuid, $data) { + $uid = dintval($uid, true); + $vuid = dintval($vuid, true); + if($uid && !empty($data) && is_array($data)) { + return DB::update($this->_table, $data, DB::field('uid', $uid).' AND '.DB::field('vuid', $vuid)); + } + return 0; + } + public function delete_by_uid_or_vuid($uids) { + $uids = dintval($uids, true); + if($uids) { + return DB::delete($this->_table, DB::field('uid', $uids).' OR '.DB::field('vuid', $uids)); + } + return 0; + } + public function delete_by_uid_vuid($uid, $vuid) { + $uid = dintval($uid); + $vuid = dintval($vuid); + return DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('vuid', $vuid)); + } + public function delete_by_dateline($dateline) { + $dateline = dintval($dateline); + return DB::delete($this->_table, DB::field('dateline', $dateline, '<')); + } + public function count_by_uid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table,$uid)); + } + public function count_by_vuid($uid) { + return DB::result_first('SELECT COUNT(*) FROM %t WHERE vuid=%d', array($this->_table,$uid)); + } + + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_article_content.php b/source/class/table/table_portal_article_content.php new file mode 100644 index 0000000..cbacbf4 --- /dev/null +++ b/source/class/table/table_portal_article_content.php @@ -0,0 +1,72 @@ +_table = 'portal_article_content'; + $this->_pk = 'cid'; + + parent::__construct(); + } + + public function update_by_aid($aid, $data) { + if(($aid = dintval($aid)) && !empty($data) && is_array($data)) { + return DB::update($this->_table, $data, array('aid' => $aid)); + } + return 0; + } + public function fetch_by_aid_page($aid, $page = 1) { + if(($page = dintval($page))<1) $page = 1; + return $aid ? DB::fetch_first('SELECT * FROM %t WHERE aid=%d ORDER BY pageorder'.DB::LIMIT($page-1, 1), array($this->_table, $aid)) : false; + } + + public function fetch_all($ids, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch_all($ids, $force_from_db); + } else { + return $this->fetch_all_by_aid($ids); + } + } + + public function fetch_all_by_aid($aid) { + return $aid ? DB::fetch_all('SELECT * FROM %t WHERE aid=%d ORDER BY pageorder', array($this->_table, $aid)) : array(); + } + + public function fetch_max_pageorder_by_aid($aid) { + return $aid ? DB::result_first('SELECT MAX(pageorder) FROM %t WHERE aid=%d', array($this->_table, $aid)) : 0; + } + + public function insert_batch($inserts) { + $sql = array(); + foreach($inserts as $value) { + $value['aid'] = dintval($value['aid']); + $sql[] = "('{$value['aid']}', '".addslashes($value['content'])."', '{$value['pageorder']}', '{$value['dateline']}', '{$value['id']}', '{$value['idtype']}')"; + } + if($sql) { + DB::query('INSERT INTO '.DB::table($this->_table)."(`aid`, `content`, `pageorder`, `dateline`, `id`, `idtype`) VALUES ".implode(', ', $sql)); + } + } + + public function count_by_aid($aid) { + return $aid ? DB::result_first('SELECT COUNT(*) FROM %t WHERE aid=%d', array($this->_table, $aid)) : 0; + } + + public function delete_by_aid($aid) { + return dintval($aid, true) ? DB::delete($this->_table, DB::field('aid', $aid)) : 0; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_article_count.php b/source/class/table/table_portal_article_count.php new file mode 100644 index 0000000..7e49242 --- /dev/null +++ b/source/class/table/table_portal_article_count.php @@ -0,0 +1,47 @@ +_table = 'portal_article_count'; + $this->_pk = 'aid'; + + parent::__construct(); + } + + public function increase($ids, $data) { + $ids = array_map('intval', (array)$ids); + $sql = array(); + $allowkey = array('commentnum', 'viewnum', 'favtimes', 'sharetimes'); + foreach($data as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + if(!empty($sql)){ + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE aid IN (".dimplode($ids).")", 'UNBUFFERED'); + } + } + + public function fetch_all_hotarticle($wheresql, $dateline) { + if(!empty($wheresql) && ($wheresql = (string)$wheresql) && $dateline = dintval($dateline)) { + return DB::fetch_all("SELECT at.* FROM ".DB::table($this->_table)." ac, ".DB::table('portal_article_title')." at WHERE $wheresql AND at.dateline>'$dateline' AND ac.aid=at.aid ORDER BY ac.viewnum DESC LIMIT 10"); + } else { + return array(); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_article_related.php b/source/class/table/table_portal_article_related.php new file mode 100644 index 0000000..386cbe8 --- /dev/null +++ b/source/class/table/table_portal_article_related.php @@ -0,0 +1,51 @@ +_table = 'portal_article_related'; + $this->_pk = 'aid'; + + parent::__construct(); + } + + public function delete_by_aid_raid($aid, $raid = null) { + return ($aid = dintval($aid, true)) ? DB::delete($this->_table, DB::field('aid', $aid).($raid = dintval($raid) ? ' OR '.DB::field('raid', $raid) : '')) : false; + } + + public function insert_batch($aid, $list) { + $replaces = array(); + if(($aid = dintval($aid))) { + $displayorder = 0; + unset($list[$aid]); + foreach($list as $value) { + if(($value['aid'] = dintval($value['aid']))) { + $replaces[] = "('$aid', '{$value['aid']}', '$displayorder')"; + $replaces[] = "('{$value['aid']}', '$aid', '0')"; + $displayorder++; + } + } + } + if($replaces) { + DB::query('REPLACE INTO '.DB::table($this->_table).' (aid,raid,displayorder) VALUES '.implode(',', $replaces)); + } + } + + public function fetch_all_by_aid($aid) { + return ($aid = dintval($aid)) ? DB::fetch_all('SELECT * FROM %t WHERE aid=%d ORDER BY displayorder', array($this->_table, $aid), 'raid') : array(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_article_title.php b/source/class/table/table_portal_article_title.php new file mode 100644 index 0000000..8179ac2 --- /dev/null +++ b/source/class/table/table_portal_article_title.php @@ -0,0 +1,148 @@ +_table = 'portal_article_title'; + $this->_pk = 'aid'; + + parent::__construct(); + } + + + public function update_click($cid, $clickid, $incclick) { + $clickid = intval($clickid); + if($clickid < 1 || $clickid > 8 || empty($cid) || empty($incclick)) { + return false; + } + return DB::query('UPDATE %t SET click'.$clickid.' = click'.$clickid.'+\'%d\' WHERE aid = %d', array($this->_table, $incclick, $cid)); + } + public function fetch_count_for_cat($catid) { + if(empty($catid)) { + return 0; + } + return DB::result_first('SELECT COUNT(*) FROM %t WHERE catid=%d', array($this->_table, $catid)); + } + public function fetch_count_for_idtype($id, $idtype) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE id=%d AND idtype=%s", array($this->_table, $id, $idtype)); + } + public function fetch_all_for_cat($catid, $status = null, $orderaid = 0, $start = 0, $limit = 0) { + if(empty($catid)) { + return array(); + } + $statussql = $status !== null ? ' AND '.DB::field('status', $status) : ''; + $orderaidsql = $orderaid ? ' ORDER BY aid DESC' : ''; + return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('catid', $catid).$statussql.$orderaidsql.DB::limit($start, $limit), array($this->_table)); + } + public function update_for_cat($catid, $data) { + if(empty($catid) || empty($data)) { + return false; + } + return DB::update($this->_table, $data, DB::field('catid', $catid)); + } + + public function range($start = 0, $limit = 0, $sort = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::range($start, $limit, $sort); + } else { + return $this->range_title($start, $limit); + } + } + + public function range_title($start = 0, $limit = 0) { + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' ORDER BY dateline DESC'.DB::limit($start, $limit)); + } + public function fetch_all_by_sql($where, $order = '', $start = 0, $limit = 0, $count = 0, $alias = '') { + $where = $where && !is_array($where) ? " WHERE $where" : ''; + if(is_array($order)) { + $order = ''; + } + if($count) { + return DB::result_first('SELECT count(*) FROM '.DB::table($this->_table).' %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order)); + } + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order)); + } + public function fetch_all_by_title($idtype, $subject) { + $parameter = array($this->_table); + $or = $wheresql = ''; + $subject = explode(',', str_replace(' ', '', $subject)); + if(empty($subject)) { + return array(); + } + for($i = 0; $i < count($subject); $i++) { + if(preg_match("/\{(\d+)\}/", $subject[$i])) { + $subject[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($subject[$i], '/')); + $wheresql .= " $or title REGEXP %s"; + $parameter[] = $subject[$i]; + } else { + $wheresql .= " $or title LIKE %s"; + $parameter[] = '%'.$subject[$i].'%'; + } + $or = 'OR'; + } + return DB::fetch_all("SELECT $idtype FROM %t WHERE $wheresql", $parameter); + } + public function fetch_all_for_search($aids, $orderby = '', $ascdesc = '', $start = 0, $limit = 0) { + return DB::fetch_all("SELECT at.*,ac.viewnum, ac.commentnum FROM ".DB::table($this->_table)." at LEFT JOIN ".DB::table('portal_article_count')." ac ON at.aid=ac.aid WHERE at.".DB::field('aid', $aids).($orderby ? " ORDER BY ".DB::order($orderby, $ascdesc) : ' ').DB::limit($start, $limit)); + } + + + public function repair_htmlmade($ids) { + if(($ids = dintval($ids, true))) { + return DB::update($this->_table, array('htmlmade' => 0), DB::field($this->_pk, $ids)); + } + return false; + } + + public function fetch_all_aid_by_dateline($dateline, $catids = array(), $startid = 0, $endid = 0) { + $data = array(); + $where = array(); + if($startid) { + $where[] = DB::field('aid', intval($startid), '>='); + } + if($endid) { + $where[] = DB::field('aid', intval($endid), '<='); + } + if($catids) { + $where[] = DB::field('catid', dintval($catids, true)); + } + if($dateline) { + $where[] = DB::field('dateline', intval($dateline), '>='); + } + if($where) { + $data = DB::fetch_all('SELECT aid FROM '.DB::table($this->_table).' WHERE '. implode(' AND ', $where).' LIMIT 200000', NULL, $this->_pk); + } + return $data; + } + + public function fetch_preaid_by_catid_aid($catid, $aid) { + $ret = 0; + if(($catid = intval($catid)) && ($aid = intval($aid))) { + $ret = DB::result_first('SELECT aid FROM %t WHERE catid=%d AND aid<%d ORDER BY aid DESC LIMIT 1', array($this->_table, $catid, $aid)); + } + return $ret; + } + + public function fetch_nextaid_by_catid_aid($catid, $aid) { + $ret = 0; + if(($catid = intval($catid)) && ($aid = intval($aid))) { + $ret = DB::result_first('SELECT aid FROM %t WHERE catid=%d AND aid>%d ORDER BY aid ASC LIMIT 1', array($this->_table, $catid, $aid)); + } + return $ret; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_article_trash.php b/source/class/table/table_portal_article_trash.php new file mode 100644 index 0000000..590e929 --- /dev/null +++ b/source/class/table/table_portal_article_trash.php @@ -0,0 +1,37 @@ +_table = 'portal_article_trash'; + $this->_pk = 'aid'; + + parent::__construct(); + } + + public function insert_batch($inserts) { + $sql = array(); + foreach($inserts as $value) { + if(($value['aid'] = dintval($value['aid']))) { + $sql[] = "('{$value['aid']}', '".addslashes($value['content'])."')"; + } + } + if($sql) { + DB::query('INSERT INTO '.DB::table($this->_table)."(`aid`, `content`) VALUES ".implode(', ', $sql)); + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_attachment.php b/source/class/table/table_portal_attachment.php new file mode 100644 index 0000000..0258ef4 --- /dev/null +++ b/source/class/table/table_portal_attachment.php @@ -0,0 +1,39 @@ +_table = 'portal_attachment'; + $this->_pk = 'attachid'; + + parent::__construct(); + } + + public function fetch_all_by_aid($aid) { + return ($aid = dintval($aid, true)) ? DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('aid', $aid).' ORDER BY attachid DESC', array($this->_table), $this->_pk) : array(); + } + + public function fetch_by_aid_image($aid) { + return $aid ? DB::fetch_first('SELECT * FROM %t WHERE aid=%d AND isimage=1', array($this->_table, $aid)) : array(); + } + + public function update_to_used($newaids, $aid) { + $aid = dintval($aid); + return ($newaids = dintval($newaids, true)) ? DB::update($this->_table, array('aid'=>$aid), DB::field('attachid', $newaids).' AND aid=0') : false; + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_category.php b/source/class/table/table_portal_category.php new file mode 100644 index 0000000..4d048b9 --- /dev/null +++ b/source/class/table/table_portal_category.php @@ -0,0 +1,66 @@ +_table = 'portal_category'; + $this->_pk = 'catid'; + + parent::__construct(); + } + + public function fetch_all_numkey($numkey) { + $allow_numkey = array('portal', 'articles', 'num'); + if(!in_array($numkey, $allow_numkey)) { + return null; + } + return DB::fetch_all("SELECT catid, $numkey FROM %t", array($this->_table), $this->_pk); + } + + public function increase($catids, $data) { + $catids = array_map('intval', (array)$catids); + $sql = array(); + $allowkey = array('articles'); + foreach($data as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + if(!empty($sql)){ + DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE catid IN (".dimplode($catids).")", 'UNBUFFERED'); + } + } + + public function range($start = 0, $limit = 0, $sort = '') { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::range($start, $limit, $sort); + } else { + return $this->range_category($start, $limit); + } + } + + public function range_category($start = 0, $limit = 0) { + $data = array(); + $query = DB::query('SELECT * FROM '.DB::table($this->_table).' ORDER BY displayorder,catid'.DB::limit($start, $limit)); + while($value = DB::fetch($query)) { + $value['catname'] = dhtmlspecialchars($value['catname']); + $data[$value['catid']] = $value; + } + return $data; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_category_permission.php b/source/class/table/table_portal_category_permission.php new file mode 100644 index 0000000..deadc9e --- /dev/null +++ b/source/class/table/table_portal_category_permission.php @@ -0,0 +1,105 @@ +_table = 'portal_category_permission'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch($id, $force_from_db = false) { + if (defined('DISCUZ_DEPRECATED')) { + throw new Exception('NotImplementedException'); + return parent::fetch($id, $force_from_db); + } else { + return $this->fetch_permission($id, $force_from_db); + } + } + + public function fetch_permission($catid, $uid){ + return ($catid = dintval($catid)) && ($uid = dintval($uid)) ? DB::fetch_first('SELECT * FROM %t WHERE catid=%d AND uid=%d', array($this->_table, $catid, $uid)) : array(); + } + + public function fetch_all_by_catid($catid, $uid = 0) { + return ($catid = dintval($catid)) ? DB::fetch_all('SELECT * FROM %t WHERE catid=%d'.($uid ? ' AND '.DB::field('uid', $uid) : ''), array($this->_table, $catid), 'uid') :array(); + } + + public function fetch_all_by_uid($uids, $flag = true, $sort = 'ASC', $start = 0, $limit = 0) { + $wherearr = array(); + $sort = $sort === 'ASC' ? 'ASC' : 'DESC'; + if(($uids = dintval($uids, true))) { + $wherearr[] = DB::field('uid', $uids); + } + if(!$flag) { + $wherearr[] = 'inheritedcatid = \'\''; + } + $where = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).$where.' ORDER BY uid '.$sort.', inheritedcatid'.DB::limit($start, $limit), NULL, 'catid'); + } + + public function count_by_uids($uids, $flag) { + $wherearr = array(); + if(($uids = dintval($uids))) { + $wherearr[] = DB::field('uid', $uids); + } + if(!$flag) { + $wherearr[] = 'inheritedcatid = \'\''; + } + $where = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + return DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).$where); + } + + public function fetch_permission_by_uid($uids) { + return ($uids = dintval($uids, true)) ? DB::fetch_all('SELECT uid, sum(allowpublish) as allowpublish, sum(allowmanage) as allowmanage FROM '.DB::table($this->_table)." WHERE uid IN (".dimplode($uids).") GROUP BY uid", null, 'uid') : array(); + } + + public function delete_by_catid_uid_inheritedcatid($catid = false, $uids = false, $inheritedcatid = false) { + $wherearr = array(); + if(($catid = dintval($catid, true))) { + $wherearr[] = DB::field('catid', $catid); + } + if(($uids = dintval($uids, true))) { + $wherearr[] = DB::field('uid', $uids); + } + if($inheritedcatid === true) { + $wherearr[] = "inheritedcatid>'0'"; + } elseif($inheritedcatid !== false && ($inheritedcatid = dintval($inheritedcatid, true))) { + $wherearr[] = DB::field('inheritedcatid', $inheritedcatid); + } + return $wherearr ? DB::delete($this->_table, implode(' AND ', $wherearr)) : false; + } + + public function insert_batch($users, $catids, $upid = 0) { + $perms = array(); + if(!empty($users) && ($catids = dintval((array)$catids, true))) { + foreach($users as $user) { + $inheritedcatid = !empty($user['inheritedcatid']) ? $user['inheritedcatid'] : ($upid ? $upid : 0); + foreach ($catids as $catid) { + if($catid) { + $perms[] = "('$catid','{$user['uid']}','{$user['allowpublish']}','{$user['allowmanage']}','$inheritedcatid')"; + $inheritedcatid = empty($inheritedcatid) ? $catid : $inheritedcatid; + } + } + } + if($perms) { + DB::query('REPLACE INTO '.DB::table($this->_table).' (catid,uid,allowpublish,allowmanage,inheritedcatid) VALUES '.implode(',', $perms)); + } + } + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_comment.php b/source/class/table/table_portal_comment.php new file mode 100644 index 0000000..0c755ba --- /dev/null +++ b/source/class/table/table_portal_comment.php @@ -0,0 +1,108 @@ +_table = 'portal_comment'; + $this->_pk = 'cid'; + + parent::__construct(); + } + + public function fetch_all_by_id_idtype($id, $idtype = '', $orderby = '', $ordersc = 'DESC', $start = 0, $limit = 0) { + if(!$id) { + return null; + } + $sql = array(DB::field('id', $id)); + if($idtype) { + $sql[] = DB::field('idtype', $idtype); + } + $wheresql = implode(' AND ', $sql); + if($orderby = DB::order($orderby, $ordersc)) { + $wheresql .= ' ORDER BY '.$orderby; + } + if($limit) { + $wheresql .= DB::limit($start, $limit); + } + return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $wheresql)); + } + + public function count_by_id_idtype($id, $idtype) { + if(!$id || !$idtype) { + return null; + } + $sql = DB::field('id', $id).' AND '.DB::field('idtype', $idtype); + return DB::result_first('SELECT count(*) FROM %t WHERE %i', array($this->_table, $sql)); + } + + public function delete_by_id_idtype($id, $idtype) { + if(!$id) { + return null; + } + $para = DB::field('id', $id); + if($idtype) { + $para .= ' AND '.DB::field('idtype', $idtype); + } + return DB::delete($this->_table, $para); + } + + public function count_all_by_search($aid, $authorid, $starttime, $endtime, $idtype, $message) { + return $this->fetch_all_by_search($aid, $authorid, $starttime, $endtime, $idtype, $message, 0, 0, 2); + } + + public function fetch_all_by_idtype_status($idtype = 'aid', $status = 0, $start = 0, $limit = 1000) { + $idtype = in_array($idtype, array('aid', 'topicid')) ? $idtype : 'aid'; + return DB::fetch_all('SELECT * FROM %t WHERE `idtype` = %s AND `status` = %d ORDER BY ' . $this->_pk . ' ' . DB::limit($start, $limit), array($this->_table, $idtype, $status)); + } + + public function fetch_all_by_search($aid, $authorid, $starttime, $endtime, $idtype, $message, $start = 0, $limit = 0, $type = 1) { + $idtype = in_array($idtype, array('aid', 'topicid')) ? $idtype : 'aid'; + $tablename = $idtype == 'aid' ? 'portal_article_title' : 'portal_topic'; + + $sql = ''; + $sql .= $aid ? ' AND c.'.DB::field('id', $aid) : ''; + $sql .= $authorid ? ' AND c.'.DB::field('uid', $authorid) : ''; + $sql .= $starttime ? ' AND c.'.DB::field('dateline', $starttime, '>') : ''; + $sql .= $endtime ? ' AND c.'.DB::field('dateline', $endtime, '<') : ''; + + if($message != '') { + $sqlmessage = ''; + $or = ''; + $message = daddslashes($message); + $message = explode(',', str_replace(' ', '', $message)); + + for($i = 0; $i < count($message); $i++) { + if(preg_match("/\{(\d+)\}/", $message[$i])) { + $message[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($message[$i], '/')); + $sqlmessage .= " $or c.message REGEXP '".$message[$i]."'"; + } else { + $sqlmessage .= " $or c.message LIKE '%".$message[$i]."%'"; + } + $or = 'OR'; + } + if($sqlmessage) { + $sql .= " AND ($sqlmessage)"; + } + } + if($type == 2) { + return DB::result_first('SELECT count(*) FROM %t c WHERE 1 %i', array($this->_table, $sql)); + } else { + return DB::fetch_all('SELECT c.*, a.title FROM %t c LEFT JOIN %t a ON a.`'.$idtype.'`=c.id WHERE 1 %i ORDER BY c.dateline DESC %i', array($this->_table, $tablename, $sql, DB::limit($start, $limit))); + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_rsscache.php b/source/class/table/table_portal_rsscache.php new file mode 100644 index 0000000..ea2d3a0 --- /dev/null +++ b/source/class/table/table_portal_rsscache.php @@ -0,0 +1,29 @@ +_table = 'portal_rsscache'; + $this->_pk = 'aid'; + + parent::__construct(); + } + + public function fetch_all_by_catid($catid, $limit = 20) { + return $catid ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('catid', $catid).' ORDER BY dateline DESC LIMIT '.dintval($limit), null, 'aid') : array(); + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_topic.php b/source/class/table/table_portal_topic.php new file mode 100644 index 0000000..4d65ca3 --- /dev/null +++ b/source/class/table/table_portal_topic.php @@ -0,0 +1,94 @@ +_table = 'portal_topic'; + $this->_pk = 'topicid'; + + parent::__construct(); + } + + public function count_by_search_where($wherearr) { + $wheresql = empty($wherearr) ? '' : implode(' AND ', $wherearr); + return DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).($wheresql ? ' WHERE '.$wheresql : '')); + } + + public function fetch_all_by_search_where($wherearr, $ordersql, $start, $limit) { + $wheresql = empty($wherearr) ? '' : implode(' AND ', $wherearr); + return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).($wheresql ? ' WHERE '.$wheresql : '').' '.$ordersql.DB::limit($start, $limit), null, 'topicid'); + } + + public function fetch_by_name($name) { + return $name ? DB::fetch_first('SELECT * FROM %t WHERE name=%s LIMIT 1', array($this->_table, $name)) : false; + } + + public function increase($ids, $data) { + $ids = array_map('intval', (array)$ids); + $sql = array(); + $allowkey = array('commentnum', 'viewnum'); + foreach($data as $key => $value) { + if(($value = intval($value)) && in_array($key, $allowkey)) { + $sql[] = "`$key`=`$key`+'$value'"; + } + } + if(!empty($sql)){ + DB::query('UPDATE '.DB::table($this->_table).' SET '.implode(',', $sql).' WHERE topicid IN ('.dimplode($ids).')', 'UNBUFFERED'); + } + } + public function fetch_all_by_title($idtype, $subject) { + if(empty($idtype) || !is_string($idtype) || empty($subject)) { + return array(); + } + $parameter = array($this->_table); + $or = $wheresql = ''; + $subject = explode(',', str_replace(' ', '', $subject)); + for($i = 0; $i < count($subject); $i++) { + if(preg_match("/\{(\d+)\}/", $subject[$i])) { + $subject[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($subject[$i], '/')); + $wheresql .= " $or title REGEXP %s"; + $parameter[] = $subject[$i]; + } else { + $wheresql .= " $or title LIKE %s"; + $parameter[] = '%'.$subject[$i].'%'; + } + $or = 'OR'; + } + return DB::fetch_all("SELECT $idtype FROM %t WHERE $wheresql", $parameter); + } + + public function repair_htmlmade($ids) { + if(($ids = dintval($ids, true))) { + return DB::update($this->_table, array('htmlmade' => 0), DB::field($this->_pk, $ids)); + } + return false; + } + + public function fetch_all_topicid_by_dateline($dateline) { + $data = array(); + $where = array(); + + if($dateline) { + $where[] = DB::field('dateline', intval($dateline), '>='); + } + $where[] = "closed='0'"; + if($where) { + $data = DB::fetch_all('SELECT topicid FROM '.DB::table($this->_table).' WHERE '. implode(' AND ', $where).' LIMIT 20000', NULL, $this->_pk); + } + return $data; + } +} + +?> \ No newline at end of file diff --git a/source/class/table/table_portal_topic_pic.php b/source/class/table/table_portal_topic_pic.php new file mode 100644 index 0000000..9eeb2f4 --- /dev/null +++ b/source/class/table/table_portal_topic_pic.php @@ -0,0 +1,34 @@ +_table = 'portal_topic_pic'; + $this->_pk = 'picid'; + + parent::__construct(); + } + + public function count_by_topicid($topicid) { + return $topicid ? DB::result_first('SELECT COUNT(*) FROM %t WHERE topicid=%d', array($this->_table, $topicid)) : 0; + } + + public function fetch_all_by_topicid($topicid, $start = 0, $limit = 0) { + return $topicid ? DB::fetch_all('SELECT * FROM %t WHERE topicid=%d ORDER BY picid DESC'.DB::limit($start, $limit), array($this->_table, $topicid)) : array(); + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/index.htm b/source/class/task/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/class/task/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/class/task/task_avatar.php b/source/class/task/task_avatar.php new file mode 100644 index 0000000..a4282fe --- /dev/null +++ b/source/class/task/task_avatar.php @@ -0,0 +1,41 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array(); + + function csc($task = array()) { + global $_G; + + if(!empty($_G['member']['avatarstatus'])) { + return true; + } else { + return array('csc' => 0, 'remaintime' => 0); + } + } + + function view() { + return lang('task/avatar', 'avatar_view'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_blog.php b/source/class/task/task_blog.php new file mode 100644 index 0000000..56ff5e1 --- /dev/null +++ b/source/class/task/task_blog.php @@ -0,0 +1,40 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array(); + + function csc($task = array()) { + global $_G; + + if(C::t('home_blog')->count_by_uid($_G['uid'])) { + return true; + } + return array('csc' => 0, 'remaintime' => 0); + } + + function view() { + return lang('task/blog', 'blog_view'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_connect_bind.php b/source/class/task/task_connect_bind.php new file mode 100644 index 0000000..c1091bb --- /dev/null +++ b/source/class/task/task_connect_bind.php @@ -0,0 +1,40 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array(); + + function csc($task = array()) { + global $_G; + + if($_G['member']['conisbind']) { + return true; + } + return array('csc' => 0, 'remaintime' => 0); + } + + function view() { + return lang('task/connect_bind', 'connect_bind_view'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_email.php b/source/class/task/task_email.php new file mode 100644 index 0000000..4952e30 --- /dev/null +++ b/source/class/task/task_email.php @@ -0,0 +1,40 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array(); + + function csc($task = array()) { + global $_G; + + if($_G['member']['emailstatus']) { + return true; + } + return array('csc' => 0, 'remaintime' => 0); + } + + function view() { + return lang('task/email', 'email_view'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_friend.php b/source/class/task/task_friend.php new file mode 100644 index 0000000..93e16c7 --- /dev/null +++ b/source/class/task/task_friend.php @@ -0,0 +1,40 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array(); + + function csc($task = array()) { + global $_G; + + if(getuserprofile('friends') >= 5) { + return true; + } + return array('csc' => 0, 'remaintime' => 0); + } + + function view() { + return lang('task/friend', 'friend_view'); + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_gift.php b/source/class/task/task_gift.php new file mode 100644 index 0000000..4ddd1b3 --- /dev/null +++ b/source/class/task/task_gift.php @@ -0,0 +1,36 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array(); + + function preprocess($task) { + dheader("Location: home.php?mod=task&do=draw&id={$task['taskid']}"); + } + + function csc($task = array()) { + return true; + } + +} + + +?> \ No newline at end of file diff --git a/source/class/task/task_member.php b/source/class/task/task_member.php new file mode 100644 index 0000000..290d145 --- /dev/null +++ b/source/class/task/task_member.php @@ -0,0 +1,113 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array( + 'act' => array( + 'title' => 'member_complete_var_act', + 'type' => 'mradio', + 'value' => array( + array('favorite', 'member_complete_var_act_favorite'), + array('magic', 'member_complete_var_act_magic'), + ), + 'default' => 'favorite', + 'sort' => 'complete', + ), + 'num' => array( + 'title' => 'member_complete_var_num', + 'type' => 'text', + 'value' => '', + 'sort' => 'complete', + ), + 'time' => array( + 'title' => 'member_complete_var_time', + 'type' => 'text', + 'value' => '', + 'sort' => 'complete', + ) + ); + + function preprocess($task) { + global $_G; + + $act = C::t('common_taskvar')->get_value_by_taskid($task['taskid'], 'act'); + if($act == 'favorite') { + $value = C::t('home_favorite')->count_by_uid_idtype($_G['uid'], 'tid'); + C::t('forum_spacecache')->insert(array( + 'uid' => $_G['uid'], + 'variable' => 'favorite'.$task['taskid'], + 'value' => $value, + 'expiration' => $_G['timestamp'], + ), false, true); + } + } + + function csc($task = array()) { + global $_G; + + $taskvars = array('num' => 0); + $num = 0; + foreach(C::t('common_taskvar')->fetch_all_by_taskid($task['taskid']) as $taskvar) { + if($taskvar['value']) { + $taskvars[$taskvar['variable']] = $taskvar['value']; + } + } + + $taskvars['time'] = floatval($taskvars['time']); + if($taskvars['act'] == 'favorite') { + $favorite = C::t('forum_spacecache')->fetch_spacecache($_G['uid'], 'favorite'.$task['taskid']); + $favorite = $favorite['value']; + $num = C::t('home_favorite')->count_by_uid_idtype($_G['uid'], 'tid') - $favorite; + } elseif($taskvars['act'] == 'magic') { + $maxtime = $taskvars['time'] ? $task['applytime']+3600*$taskvars['time'] : 0; + $num = C::t('common_magiclog')->count_by_action_uid_dateline(2, $_G['uid'], $task['applytime'], $maxtime); + } + + if($num && $num >= $taskvars['num']) { + if($taskvars['act'] == 'favorite') { + C::t('forum_spacecache')->delete_spacecache($_G['uid'], $taskvars['act'].$task['taskid']); + } + return TRUE; + } elseif($taskvars['time'] && TIMESTAMP >= $task['applytime'] + 3600 * $taskvars['time'] && (!$num || $num < $taskvars['num'])) { + return FALSE; + } else { + return array('csc' => $num > 0 && $taskvars['num'] ? sprintf("%01.2f", $num / $taskvars['num'] * 100) : 0, 'remaintime' => $taskvars['time'] ? $task['applytime'] + $taskvars['time'] * 3600 - TIMESTAMP : 0); + } + } + + function view($task, $taskvars) { + $return = lang('task/member', 'task_complete_time_start'); + if($taskvars['complete']['time']) { + $return .= lang('task/member', 'task_complete_time_limit', array('value' => $taskvars['complete']['time']['value'])); + } + $taskvars['complete']['num']['value'] = intval($taskvars['complete']['num']['value']); + if($taskvars['complete']['act']['value'] == 'favorite') { + $return .= lang('task/member', 'task_complete_act_favorite', array('value' => $taskvars['complete']['num']['value'])); + } else { + $return .= lang('task/member', 'task_complete_act_magic', array('value' => $taskvars['complete']['num']['value'])); + } + return $return; + } + +} + + +?> \ No newline at end of file diff --git a/source/class/task/task_post.php b/source/class/task/task_post.php new file mode 100644 index 0000000..74c9007 --- /dev/null +++ b/source/class/task/task_post.php @@ -0,0 +1,159 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array( + 'act' => array( + 'title' => 'post_complete_var_act', + 'type' => 'mradio', + 'value' => array( + array('newthread', 'post_complete_var_act_newthread'), + array('newreply', 'post_complete_var_act_newreply'), + array('newpost', 'post_complete_var_act_newpost'), + ), + 'default' => 'newthread', + 'sort' => 'complete', + ), + 'forumid' => array( + 'title' => 'post_complate_var_forumid', + 'type' => 'select', + 'value' => array(), + 'sort' => 'complete', + ), + 'threadid' => array( + 'title' => 'post_complate_var_threadid', + 'type' => 'text', + 'value' => '', + 'sort' => 'complete', + ), + 'num' => array( + 'title' => 'post_complete_var_num', + 'type' => 'text', + 'value' => '', + 'sort' => 'complete', + ), + 'time' => array( + 'title' => 'post_complete_var_time', + 'type' => 'text', + 'value' => '', + 'sort' => 'complete', + ) + ); + + function __construct() { + global $_G; + loadcache('forums'); + $this->conditions['forumid']['value'][] = array(0, ' '); + if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + $this->conditions['forumid']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name'], $forum['type'] == 'group' ? 1 : 0); + } + } + + function csc($task = array()) { + global $_G; + + $taskvars = array('num' => 0); + foreach(C::t('common_taskvar')->fetch_all_by_taskid($task['taskid']) as $taskvar) { + if($taskvar['value']) { + $taskvars[$taskvar['variable']] = $taskvar['value']; + } + } + $taskvars['num'] = $taskvars['num'] ? $taskvars['num'] : 1; + + $tbladd = $sqladd = ''; + if($taskvars['act'] == 'newreply' && $taskvars['threadid']) { + $threadid = $taskvars['threadid']; + } else { + if($taskvars['forumid']) { + $forumid = $taskvars['forumid']; + } + if($taskvars['author']) { + return TRUE; + } + } + if($taskvars['act']) { + if($taskvars['act'] == 'newthread') { + $first = '1'; + } elseif($taskvars['act'] == 'newreply') { + $first = '0'; + } + } + + $starttime = $task['applytime']; + if($taskvars['time'] = floatval($taskvars['time'])) { + $endtime = $task['applytime'] + 3600 * $taskvars['time']; + } + + $num = C::t('forum_post')->count_by_search(0, $threadid, null, 0, $forumid, $_G['uid'], null, $starttime, $endtime, null, $first); + + if($num && $num >= $taskvars['num']) { + return TRUE; + } elseif($taskvars['time'] && TIMESTAMP >= $task['applytime'] + 3600 * $taskvars['time'] && (!$num || $num < $taskvars['num'])) { + return FALSE; + } else { + return array('csc' => $num > 0 && $taskvars['num'] ? sprintf("%01.2f", $num / $taskvars['num'] * 100) : 0, 'remaintime' => $taskvars['time'] ? $task['applytime'] + $taskvars['time'] * 3600 - TIMESTAMP : 0); + } + } + + function view($task, $taskvars) { + global $_G; + $return = $value = ''; + if(!empty($taskvars['complete']['forumid'])) { + $value = intval($taskvars['complete']['forumid']['value']); + loadcache('forums'); + $value = ''.$_G['cache']['forums'][$value]['name'].''; + } elseif(!empty($taskvars['complete']['threadid'])) { + $value = intval($taskvars['complete']['threadid']['value']); + $thread = C::t('forum_thread')->fetch_thread($value); + $value = ''.($thread['subject'] ? $thread['subject'] : 'TID '.$value).''; + } elseif(!empty($taskvars['complete']['author'])) { + $value = $taskvars['complete']['author']['value']; + $authorid = C::t('common_member')->fetch_uid_by_username($value); + $value = ''.$value.''; + } + $taskvars['complete']['num']['value'] = intval($taskvars['complete']['num']['value']); + $taskvars['complete']['num']['value'] = $taskvars['complete']['num']['value'] ? $taskvars['complete']['num']['value'] : 1; + if($taskvars['complete']['act']['value'] == 'newreply') { + if($taskvars['complete']['threadid']) { + $return .= lang('task/post', 'task_complete_act_newreply_thread', array('value' => $value, 'num' => $taskvars['complete']['num']['value'])); + } else { + $return .= lang('task/post', 'task_complete_act_newreply_author', array('value' => $value, 'num' => $taskvars['complete']['num']['value'])); + } + } else { + if($taskvars['complete']['forumid']) { + $return .= lang('task/post', 'task_complete_forumid', array('value' => $value)); + } + if($taskvars['complete']['act']['value'] == 'newthread') { + $return .= lang('task/post', 'task_complete_act_newthread', array('num' => $taskvars['complete']['num']['value'])); + } else { + $return .= lang('task/post', 'task_complete_act_newpost', array('num' => $taskvars['complete']['num']['value'])); + } + } + return $return; + } + + function sufprocess($task) { + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_profile.php b/source/class/task/task_profile.php new file mode 100644 index 0000000..d72eae9 --- /dev/null +++ b/source/class/task/task_profile.php @@ -0,0 +1,69 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array(); + + function csc($task = array()) { + global $_G; + + $data = $this->checkfield(); + if(!$data[0]) { + return true; + } + return array('csc' => $data[1], 'remaintime' => 0); + } + + function view() { + $data = $this->checkfield(); + return lang('task/profile', 'profile_view', array('profiles' => implode(', ', $data[0]))); + } + + function checkfield() { + global $_G; + + $fields = array('realname', 'gender', 'birthyear', 'birthmonth', 'birthday', 'bloodtype', 'affectivestatus', 'birthcountry', 'birthprovince', 'birthcity', 'residecountry', 'resideprovince', 'residecity'); + loadcache('profilesetting'); + $fieldsnew = array(); + foreach($fields as $v) { + if(isset($_G['cache']['profilesetting'][$v])) { + $fieldsnew[$v] = $_G['cache']['profilesetting'][$v]['title']; + } + } + if($fieldsnew) { + space_merge($_G['member'], 'profile'); + $none = array(); + foreach($_G['member'] as $k => $v) { + if(in_array($k, $fields, true) && !trim($v) && !empty($fieldsnew[$k])) { + $none[] = $fieldsnew[$k]; + } + } + $all = count($fields); + $csc = intval(($all - count($none)) / $all * 100); + return array($none, $csc); + } else { + return true; + } + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_promotion.php b/source/class/task/task_promotion.php new file mode 100644 index 0000000..d2b8a7d --- /dev/null +++ b/source/class/task/task_promotion.php @@ -0,0 +1,67 @@ +Discuz!'; + var $icon = ''; + var $period = ''; + var $periodtype = 0; + var $conditions = array( + 'num' => array( + 'title' => 'promotion_complete_var_iplimit', + 'type' => 'text', + 'value' => '', + 'default' => 100, + 'sort' => 'complete', + ), + ); + + function preprocess($task) { + global $_G; + + $promotions = C::t('forum_promotion')->count_by_uid($_G['uid']); + C::t('forum_spacecache')->insert(array( + 'uid' => $_G['uid'], + 'variable' => 'promotion'.$task['taskid'], + 'value' => $promotions, + 'expiration' => $_G['timestamp'], + ), false, true); + } + + function csc($task = array()) { + global $_G; + + $promotion = C::t('forum_spacecache')->fetch_spacecache($_G['uid'], 'promotion'.$task['taskid']); + $promotion = $promotion['value']; + $num = C::t('forum_promotion')->count_by_uid($_G['uid']) - $promotion; + $numlimit = C::t('common_taskvar')->get_value_by_taskid($task['taskid'], 'num'); + if($num && $num >= $numlimit) { + return TRUE; + } else { + return array('csc' => $num > 0 && $numlimit ? sprintf("%01.2f", $num / $numlimit * 100) : 0, 'remaintime' => 0); + } + } + + function sufprocess($task) { + global $_G; + + C::t('forum_spacecache')->delete_spacecache($_G['uid'], 'promotion'.$task['taskid']); + } + +} + +?> \ No newline at end of file diff --git a/source/class/task/task_secmobile.php b/source/class/task/task_secmobile.php new file mode 100644 index 0000000..d405f18 --- /dev/null +++ b/source/class/task/task_secmobile.php @@ -0,0 +1,38 @@ + 0, 'remaintime' => 0); + } + + function view() { + return lang('task/secmobile', 'secmobile_view'); + } + +} \ No newline at end of file diff --git a/source/discuz_version.php b/source/discuz_version.php new file mode 100644 index 0000000..75a11e1 --- /dev/null +++ b/source/discuz_version.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/source/function/cache/cache_admingroups.php b/source/function/cache/cache_admingroups.php new file mode 100644 index 0000000..99602cf --- /dev/null +++ b/source/function/cache/cache_admingroups.php @@ -0,0 +1,20 @@ +range() as $data) { + savecache('admingroup_'.$data['admingid'], $data); + } +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_advs.php b/source/function/cache/cache_advs.php new file mode 100644 index 0000000..9273ebb --- /dev/null +++ b/source/function/cache/cache_advs.php @@ -0,0 +1,65 @@ +fetch_all_old() as $adv) { + foreach(explode("\t", $adv['targets']) as $target) { + $data['code'][$target][$adv['type']][$adv['advid']] = $adv['code']; + } + $etype = explode(':', $adv['type']); + if(count($etype) > 1) { + $advtype_class = DISCUZ_ROOT.'./source/plugin/'.$etype[0].'/adv/adv_'.$etype[1].'.php'; + if(!file_exists($advtype_class) || !in_array($etype[0], $_G['setting']['plugins']['available'])) { + continue; + } + require_once $advtype_class; + $advclass = 'adv_'.$etype[1]; + } else { + $advtype_class = libfile('adv/'.$adv['type'], 'class'); + if(!file_exists($advtype_class)) { + continue; + } + require_once $advtype_class; + $advclass = 'adv_'.$adv['type']; + } + $advclass = new $advclass; + $adv['parameters'] = dunserialize($adv['parameters']); + unset($adv['parameters']['style'], $adv['parameters']['html'], $adv['parameters']['displayorder']); + $data['parameters'][$adv['type']][$adv['advid']] = $adv['parameters']; + if($adv['parameters']['extra']) { + $data['parameters'][$adv['type']][$adv['advid']] = array_merge($data['parameters'][$adv['type']][$adv['advid']], $adv['parameters']['extra']); + unset($data['parameters'][$adv['type']][$adv['advid']]['extra']); + } + $advlist[] = $adv; + $data['evalcode'][$adv['type']] = $advclass->evalcode($adv); + } + updateadvtype(); + + savecache('advs', $data); +} + +function updateadvtype() { + global $_G; + + $advtype = array(); + foreach(C::t('common_advertisement')->fetch_all_old() as $row) { + $advtype[$row['type']] = 1; + } + $_G['setting']['advtype'] = $advtype = array_keys($advtype); + C::t('common_setting')->update_setting('advtype', $advtype); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_albumcategory.php b/source/function/cache/cache_albumcategory.php new file mode 100644 index 0000000..06c3107 --- /dev/null +++ b/source/function/cache/cache_albumcategory.php @@ -0,0 +1,37 @@ +fetch_all_by_displayorder(); + + foreach ($query as $value) { + $value['catname'] = dhtmlspecialchars($value['catname']); + $data[$value['catid']] = $value; + } + foreach($data as $key=>$value) { + $upid = $value['upid']; + $data[$key]['level'] = 0; + if($upid && isset($data[$upid])) { + $data[$upid]['children'][] = $key; + while($upid && isset($data[$upid])) { + $data[$key]['level'] += 1; + $upid = $data[$upid]['upid']; + } + } + } + + savecache('albumcategory', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_announcements.php b/source/function/cache/cache_announcements.php new file mode 100644 index 0000000..cb72df9 --- /dev/null +++ b/source/function/cache/cache_announcements.php @@ -0,0 +1,31 @@ +fetch_all_by_date(TIMESTAMP); + + foreach ($datarow as $data) { + if($datarow['type'] == 2) { + $datarow['pmid'] = $datarow['id']; + unset($datarow['id']); + unset($datarow['message']); + $datarow['subject'] = cutstr($datarow['subject'], 60); + } + $datarow['groups'] = empty($datarow['groups']) ? array() : explode(',', $datarow['groups']); + $data[] = $datarow; + } + + savecache('announcements', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_announcements_forum.php b/source/function/cache/cache_announcements_forum.php new file mode 100644 index 0000000..4a62544 --- /dev/null +++ b/source/function/cache/cache_announcements_forum.php @@ -0,0 +1,31 @@ +fetch_by_displayorder(TIMESTAMP); + if($data) { + $uid = C::t('common_member')->fetch_uid_by_username($data['author']); + $data['authorid'] = $uid; + $data['authorid'] = intval($data['authorid']); + if(empty($data['type'])) { + unset($data['message']); + } + } else { + $data = array(); + } + savecache('announcements_forum', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_antitheft.php b/source/function/cache/cache_antitheft.php new file mode 100644 index 0000000..c286c48 --- /dev/null +++ b/source/function/cache/cache_antitheft.php @@ -0,0 +1,19 @@ +fetch_setting('antitheftsetting', true); + savecache('antitheft', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_attachtype.php b/source/function/cache/cache_attachtype.php new file mode 100644 index 0000000..9588551 --- /dev/null +++ b/source/function/cache/cache_attachtype.php @@ -0,0 +1,24 @@ +fetch_all_data(); + $data = array(); + foreach($attachtypes as $row) { + $data[$row['fid']][strtolower($row['extension'])] = $row['maxsize']; + } + + savecache('attachtype', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_bbcodes.php b/source/function/cache/cache_bbcodes.php new file mode 100644 index 0000000..b22c48b --- /dev/null +++ b/source/function/cache/cache_bbcodes.php @@ -0,0 +1,61 @@ + "/\[{bbtag}\](.*?)\[\/{bbtag}\]/is", + 2 => "/\[{bbtag}=(['\"]?)(.+?)(['\"]?)\](.*?)\[\/{bbtag}\]/is", + 3 => "/\[{bbtag}=(['\"]?)(.+?)(['\"]?),(['\"]?)(.+?)(['\"]?)\](.*?)\[\/{bbtag}\]/is" + ); + + foreach(C::t('forum_bbcode')->fetch_all_by_available_icon(0, false, '>') as $bbcode) { + $bbcode['perm'] = explode("\t", $bbcode['perm']); + if(in_array('', $bbcode['perm']) || !$bbcode['perm']) { + continue; + } + $search = str_replace('{bbtag}', $bbcode['tag'], $regexp[$bbcode['params']]); + $bbcode['replacement'] = preg_replace("/([\r\n])/", '', $bbcode['replacement']); + switch($bbcode['params']) { + case 2: + $bbcode['replacement'] = str_replace('{1}', '\\2', $bbcode['replacement']); + $bbcode['replacement'] = str_replace('{2}', '\\4', $bbcode['replacement']); + break; + case 3: + $bbcode['replacement'] = str_replace('{1}', '\\2', $bbcode['replacement']); + $bbcode['replacement'] = str_replace('{2}', '\\5', $bbcode['replacement']); + $bbcode['replacement'] = str_replace('{3}', '\\7', $bbcode['replacement']); + break; + default: + $bbcode['replacement'] = str_replace('{1}', '\\1', $bbcode['replacement']); + break; + } + if(preg_match("/\{(RANDOM|MD5)\}/", $bbcode['replacement'])) { + $replace = str_replace('{RANDOM}', '', str_replace('{MD5}', '', $bbcode['replacement'])); + } else { + $replace = $bbcode['replacement']; + } + + foreach($bbcode['perm'] as $groupid) { + for($i = 0; $i < $bbcode['nest']; $i++) { + $data[$groupid]['searcharray'][] = $search; + $data[$groupid]['replacearray'][] = $replace; + } + } + } + + savecache('bbcodes', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_bbcodes_display.php b/source/function/cache/cache_bbcodes_display.php new file mode 100644 index 0000000..e266851 --- /dev/null +++ b/source/function/cache/cache_bbcodes_display.php @@ -0,0 +1,37 @@ +fetch_all_by_available_icon(2, true) as $bbcode) { + $bbcode['perm'] = explode("\t", $bbcode['perm']); + if(in_array('', $bbcode['perm']) || !$bbcode['perm']) { + continue; + } + $i++; + $tag = $bbcode['tag']; + $bbcode['i'] = $i; + $bbcode['icon'] = preg_match('/^https?:\/\//is', $bbcode['icon']) ? $bbcode['icon'] : STATICURL.'image/common/'.$bbcode['icon']; + $bbcode['explanation'] = dhtmlspecialchars(trim($bbcode['explanation'])); + $bbcode['prompt'] = addcslashes($bbcode['prompt'], '\\\''); + unset($bbcode['tag']); + foreach($bbcode['perm'] as $groupid) { + $data[$groupid][$tag] = $bbcode; + } + } + + savecache('bbcodes_display', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_blogcategory.php b/source/function/cache/cache_blogcategory.php new file mode 100644 index 0000000..e37d58a --- /dev/null +++ b/source/function/cache/cache_blogcategory.php @@ -0,0 +1,37 @@ +fetch_all_by_displayorder(); + + foreach ($query as $value) { + $value['catname'] = dhtmlspecialchars($value['catname']); + $data[$value['catid']] = $value; + } + foreach($data as $key => $value) { + $upid = $value['upid']; + $data[$key]['level'] = 0; + if($upid && isset($data[$upid])) { + $data[$upid]['children'][] = $key; + while($upid && isset($data[$upid])) { + $data[$key]['level'] += 1; + $upid = $data[$upid]['upid']; + } + } + } + + savecache('blogcategory', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_censor.php b/source/function/cache/cache_censor.php new file mode 100644 index 0000000..0f142e0 --- /dev/null +++ b/source/function/cache/cache_censor.php @@ -0,0 +1,80 @@ + array(), 'banned' => array(), 'mod' => array()); + + foreach(C::t('common_word')->fetch_all_word() as $censor) { + if(preg_match('/^\/(.+?)\/$/', $censor['find'], $a)) { + switch($censor['replacement']) { + case '{BANNED}': + $data['banned'][] = $censor['find']; + break; + case '{MOD}': + $data['mod'][] = $censor['find']; + break; + default: + $data['filter']['find'][] = $censor['find']; + $data['filter']['replace'][] = preg_replace("/\((\d+)\)/", "\\\\1", $censor['replacement']); + break; + } + } else { + $censor['find'] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($censor['find'], '/')); + switch($censor['replacement']) { + case '{BANNED}': + $banned[] = $censor['find']; + $bannednum ++; + if($bannednum == 1000) { + $data['banned'][] = '/('.implode('|', $banned).')/i'; + $banned = array(); + $bannednum = 0; + } + break; + case '{MOD}': + $mod[] = $censor['find']; + $modnum ++; + if($modnum == 1000) { + $data['mod'][] = '/('.implode('|', $mod).')/i'; + $mod = array(); + $modnum = 0; + } + break; + default: + $data['filter']['find'][] = '/'.$censor['find'].'/i'; + $data['filter']['replace'][] = $censor['replacement']; + break; + } + } + } + + if($banned) { + $data['banned'][] = '/('.implode('|', $banned).')/i'; + } + if($mod) { + $data['mod'][] = '/('.implode('|', $mod).')/i'; + } + + if(!empty($data['filter'])) { + $temp = str_repeat('o', 7); $l = strlen($temp); + $data['filter']['find'][] = str_rot13('/1q9q78n7p473'.'o3q1925oo7p'.'5o6sss2sr/v'); + $data['filter']['replace'][] = str_rot13(str_replace($l, ' ', '****7JR7JVYY7JVA7'. + 'GUR7SHGHER7****\aCbjrerq7ol7Pebffqnl7Qvfphm!7Obneq7I')).$l; + } + + savecache('censor', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_click.php b/source/function/cache/cache_click.php new file mode 100644 index 0000000..b3bd4b6 --- /dev/null +++ b/source/function/cache/cache_click.php @@ -0,0 +1,27 @@ +fetch_all_by_available() as $value) { + $value['icon'] = preg_match('/^https?:\/\//is', $value['icon']) ? $value['icon'] : STATICURL . 'image/click/' . $value['icon']; + if(!isset($data[$value['idtype']]) || count($data[$value['idtype']]) < 8) { + $keys[$value['idtype']] = $keys[$value['idtype']] ? ++$keys[$value['idtype']] : 1; + $data[$value['idtype']][$keys[$value['idtype']]] = $value; + } + } + + savecache('click', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_connect_blacklist.php b/source/function/cache/cache_connect_blacklist.php new file mode 100644 index 0000000..c188112 --- /dev/null +++ b/source/function/cache/cache_connect_blacklist.php @@ -0,0 +1,25 @@ +fetch_all_by_uin() as $blacklist) { + $data[] = $blacklist['uin']; + } + + savecache('connect_blacklist', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_creditrule.php b/source/function/cache/cache_creditrule.php new file mode 100644 index 0000000..b34038a --- /dev/null +++ b/source/function/cache/cache_creditrule.php @@ -0,0 +1,25 @@ +fetch_all_rule() as $rule) { + $rule['rulenameuni'] = urlencode(diconv($rule['rulename'], CHARSET, 'UTF-8', true)); + $data[$rule['action']] = $rule; + } + + savecache('creditrule', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_custominfo.php b/source/function/cache/cache_custominfo.php new file mode 100644 index 0000000..d5f00a5 --- /dev/null +++ b/source/function/cache/cache_custominfo.php @@ -0,0 +1,61 @@ +fetch_all_setting(array('extcredits', 'customauthorinfo', 'postno', 'postnocustom')); + $data['customauthorinfo'] = dunserialize($data['customauthorinfo']); + $data['customauthorinfo'] = $data['customauthorinfo'][0]; + $data['fieldsadd'] = ''; + $data['extcredits'] = dunserialize($data['extcredits']); + $order = array(); + if($data['customauthorinfo']) { + foreach($data['customauthorinfo'] as $k => $v) { + if($v['left']) { + $order['left'][$k] = $v['order']; + } + if($v['menu']) { + $order['menu'][$k] = $v['order']; + } + } + if(!empty($order['left'])) { + asort($order['left']); + } + if(!empty($order['menu'])) { + asort($order['menu']); + } + } + $data['setting'] = $order; + + $profile = array(); + foreach(C::t('common_member_profile_setting')->fetch_all_by_available_showinthread(1, 1) as $field) { + $data['fieldsadd'] .= ', mp.'.$field['fieldid'].' AS '.$field['fieldid']; + $profile['field_'.$field['fieldid']] = array($field['title'], $field['fieldid']); + } + $data['profile'] = $profile; + + $postnocustomnew[0] = $data['postno'] != '' ? (preg_match("/^[\x01-\x7f]+$/", $data['postno']) ? ''.$data['postno'].'' : $data['postno']) : '#'; + $data['postnocustom'] = dunserialize($data['postnocustom']); + if(is_array($data['postnocustom'])) { + foreach($data['postnocustom'] as $key => $value) { + $value = trim($value); + $postnocustomnew[$key + 1] = preg_match("/^[\x01-\x7f]+$/", $value) ? ''.$value.'' : $value; + } + } + unset($data['customauthorinfo'], $data['postno'], $data['postnocustom'], $data['extcredits']); + $data['postno'] = $postnocustomnew; + + savecache('custominfo', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_diytemplatename.php b/source/function/cache/cache_diytemplatename.php new file mode 100644 index 0000000..07a8140 --- /dev/null +++ b/source/function/cache/cache_diytemplatename.php @@ -0,0 +1,46 @@ +range() as $datarow) { + $datarow['name'] = $datarow['name'] ? $datarow['name'] : lang('portalcp', $datarow['targettplname'], '', ''); + if(empty($datarow['name'])) { + $lostname[$datarow['targettplname']] = $datarow['targettplname']; + $datarow['name'] = $nullname; + } + $data[$datarow['targettplname']] = dhtmlspecialchars($datarow['name']); + $curscript = substr($datarow['targettplname'], 0, strpos($datarow['targettplname'], '/')); + if(in_array($curscript, $apps)) { + $scriptarr[$curscript][$datarow['targettplname']] = true; + } + } + if($lostname) { + require_once libfile('function/portalcp'); + foreach(getdiytplnames($lostname) as $pre => $datas) { + foreach($datas as $id => $name) { + $data[$pre.$id] = $name; + } + } + } + savecache('diytemplatename', $data); + foreach($scriptarr as $curscript => $value) { + savecache('diytemplatename'.$curscript, $value); + } +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_domainwhitelist.php b/source/function/cache/cache_domainwhitelist.php new file mode 100644 index 0000000..cf7058b --- /dev/null +++ b/source/function/cache/cache_domainwhitelist.php @@ -0,0 +1,21 @@ +fetch_setting('domainwhitelist'); + $data = $data ? explode("\r\n", $data) : array(); + savecache('domainwhitelist', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_fields_connect_register.php b/source/function/cache/cache_fields_connect_register.php new file mode 100644 index 0000000..fd54e5e --- /dev/null +++ b/source/function/cache/cache_fields_connect_register.php @@ -0,0 +1,48 @@ +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); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_fields_optional.php b/source/function/cache/cache_fields_optional.php new file mode 100644 index 0000000..46f42b4 --- /dev/null +++ b/source/function/cache/cache_fields_optional.php @@ -0,0 +1,34 @@ +fetch_all_by_available_required(1, 0) 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']); + } + $data['field_'.$field['fieldid']] = $field; + } + + savecache('fields_optional', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_fields_register.php b/source/function/cache/cache_fields_register.php new file mode 100644 index 0000000..b0fa62a --- /dev/null +++ b/source/function/cache/cache_fields_register.php @@ -0,0 +1,34 @@ +fetch_all_by_available_showinregister(1, 1) 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']); + } + $data['field_'.$field['fieldid']] = $field; + } + + savecache('fields_register', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_fields_required.php b/source/function/cache/cache_fields_required.php new file mode 100644 index 0000000..7a9c833 --- /dev/null +++ b/source/function/cache/cache_fields_required.php @@ -0,0 +1,34 @@ +fetch_all_by_available_required(1, 1) 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']); + } + $data['field_'.$field['fieldid']] = $field; + } + + savecache('fields_required', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_focus.php b/source/function/cache/cache_focus.php new file mode 100644 index 0000000..a584c6c --- /dev/null +++ b/source/function/cache/cache_focus.php @@ -0,0 +1,30 @@ +fetch_setting('focus', true); + $data['title'] = $focus['title']; + $data['cookie'] = intval($focus['cookie']); + $data['data'] = array(); + if(is_array($focus['data'])) foreach($focus['data'] as $k => $v) { + if($v['available']) { + $data['data'][$k] = $v; + } + } + + savecache('focus', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_forumlinks.php b/source/function/cache/cache_forumlinks.php new file mode 100644 index 0000000..5e21d71 --- /dev/null +++ b/source/function/cache/cache_forumlinks.php @@ -0,0 +1,43 @@ +fetch_all_by_displayorder(); + + if($_G['setting']['forumlinkstatus']) { + $tightlink_content = $tightlink_text = $tightlink_logo = $comma = ''; + foreach ($query as $flink) { + if($flink['description']) { + if($flink['logo']) { + $tightlink_content .= ''; + } else { + $tightlink_content .= '
  • '.$flink['name'].'

    '.$flink['description'].'

  • '; + } + } else { + if($flink['logo']) { + $tightlink_logo .= ''.strip_tags($flink['name']).' '; + } else { + $tightlink_text .= '
  • '.$flink['name'].'
  • '; + } + } + } + $data = array($tightlink_content, $tightlink_logo, $tightlink_text); + } + + savecache('forumlinks', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_forumrecommend.php b/source/function/cache/cache_forumrecommend.php new file mode 100644 index 0000000..bb84f12 --- /dev/null +++ b/source/function/cache/cache_forumrecommend.php @@ -0,0 +1,43 @@ +fetch_all_fids(); + foreach($fids as $row) { + require_once libfile('function/group'); + $recommendlist = C::t('forum_forum')->fetch_all_recommend_by_fid($row['fid']); + foreach($recommendlist as $info) { + $group = array('fid' => $info['fid'], 'name' => $info['name'], 'threads' => $info['threads'], 'lastpost' => $info['lastpost'], 'icon' => $info['icon'], 'membernum' => $info['membernum'], 'description' => $info['description']); + $group['icon'] = get_groupimg($group['icon'], 'icon'); + $lastpost = array(0, 0, '', ''); + $group['lastpost'] = is_string($group['lastpost']) ? explode("\t", $group['lastpost']) : $group['lastpost']; + $group['lastpost'] =count($group['lastpost']) != 4 ? $lastpost : $group['lastpost']; + list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost['author']) = $group['lastpost']; + if($lastpost['tid']) { + $lastpost['dateline'] = dgmdate($lastpost['dateline'], 'Y-m-d H:i:s'); + if($lastpost['author']) { + $lastpost['encode_author'] = rawurlencode($lastpost['author']); + } + $group['lastpost'] = $lastpost; + } else { + $group['lastpost'] = ''; + } + $data[$row['fid']][] = $group; + } + } + + savecache('forumrecommend', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_forums.php b/source/function/cache/cache_forums.php new file mode 100644 index 0000000..993c68a --- /dev/null +++ b/source/function/cache/cache_forums.php @@ -0,0 +1,87 @@ +fetch_all_forum(); + $pluginvalue = $forumlist = array(); + $pluginvalue = pluginsettingvalue('forums'); + + $forumnoperms = array(); + foreach($forums as $val) { + $forum = array('fid' => $val['fid'], 'type' => $val['type'], 'name' => $val['name'], 'fup' => $val['fup'], 'simple' => $val['simple'], 'status' => $val['status'], 'allowpostspecial' => $val['allowpostspecial'], 'viewperm' => $val['viewperm'], 'formulaperm' => $val['formulaperm'], 'havepassword' => $val['password'], 'postperm' => $val['postperm'], 'replyperm' => $val['replyperm'], 'getattachperm' => $val['getattachperm'], 'postattachperm' => $val['postattachperm'], 'extra' => $val['extra'], 'commentitem' => $val['commentitem'], 'uid' => $val['uid'], 'archive' => $val['archive'], 'domain' => $val['domain']); + $forum['orderby'] = bindec((($forum['simple'] & 128) ? 1 : 0).(($forum['simple'] & 64) ? 1 : 0)); + $forum['ascdesc'] = ($forum['simple'] & 32) ? 'ASC' : 'DESC'; + $forum['extra'] = dunserialize($forum['extra']); + if(!is_array($forum['extra'])) { + $forum['extra'] = array(); + } + + if(!isset($forumlist[$forum['fid']])) { + if($forum['uid']) { + $forum['users'] = "\t{$forum['uid']}\t"; + } + unset($forum['uid']); + if($forum['fup']) { + $forumlist[$forum['fup']]['count']++; + } + $forumlist[$forum['fid']] = $forum; + } elseif($forum['uid']) { + if(!$forumlist[$forum['fid']]['users']) { + $forumlist[$forum['fid']]['users'] = "\t"; + } + $forumlist[$forum['fid']]['users'] .= "{$forum['uid']}\t"; + } + } + + $data = array(); + if(!empty($forumlist)) { + foreach($forumlist as $fid1 => $forum1) { + if(($forum1['type'] == 'group' && $forum1['count'])) { + $data[$fid1] = formatforumdata($forum1, $pluginvalue); + unset($data[$fid1]['users'], $data[$fid1]['allowpostspecial'], $data[$fid1]['commentitem']); + foreach($forumlist as $fid2 => $forum2) { + if($forum2['fup'] == $fid1 && $forum2['type'] == 'forum') { + $data[$fid2] = formatforumdata($forum2, $pluginvalue); + foreach($forumlist as $fid3 => $forum3) { + if($forum3['fup'] == $fid2 && $forum3['type'] == 'sub') { + $data[$fid3] = formatforumdata($forum3, $pluginvalue); + } + } + } + } + } + } + } + savecache('forums', $data); +} + +function formatforumdata($forum, &$pluginvalue) { + static $keys = array('fid', 'type', 'name', 'fup', 'viewperm', 'postperm', 'orderby', 'ascdesc', 'users', 'status', + 'extra', 'plugin', 'allowpostspecial', 'commentitem', 'archive', 'domain', 'havepassword'); + static $orders = array('lastpost', 'dateline', 'replies', 'views'); + + $data = array(); + foreach ($keys as $key) { + switch ($key) { + case 'orderby': $data[$key] = $orders[$forum['orderby']]; break; + case 'plugin': $data[$key] = $pluginvalue[$forum['fid']]; break; + case 'havepassword': $data[$key] = $forum[$key] ? 1 : 0; break; + case 'allowpostspecial': $data[$key] = sprintf('%06b', $forum['allowpostspecial']); break; + default: $data[$key] = $forum[$key]; + } + } + return $data; +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_forumstick.php b/source/function/cache/cache_forumstick.php new file mode 100644 index 0000000..b52907c --- /dev/null +++ b/source/function/cache/cache_forumstick.php @@ -0,0 +1,32 @@ +fetch_setting('forumstickthreads', true); + $forumstickcached = array(); + if($forumstickthreads) { + foreach($forumstickthreads as $forumstickthread) { + foreach($forumstickthread['forums'] as $fid) { + $forumstickcached[$fid][] = $forumstickthread['tid']; + } + } + $data = $forumstickcached; + } else { + $data = array(); + } + + savecache('forumstick', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_founder.php b/source/function/cache/cache_founder.php new file mode 100644 index 0000000..3cc2da1 --- /dev/null +++ b/source/function/cache/cache_founder.php @@ -0,0 +1,53 @@ +fetch_all($fuid, false, 0); + } + if($fuser) { + $allowadmincp = $allowadmincp + C::t('common_member')->fetch_all_by_username($fuser); + } + } + $allowadmincp = $allowadmincp + C::t('common_admincp_member')->range(); + + $allallowadmincp = C::t('common_member')->fetch_all_by_allowadmincp('0', '>') + C::t('common_member')->fetch_all(array_keys($allowadmincp), false, 0); + foreach($allallowadmincp as $uid => $user) { + if(isset($allowadmincp[$uid]) && !getstatus($user['allowadmincp'], 1)) { + $status1[$uid] = $uid; + } elseif(!isset($allowadmincp[$uid]) && getstatus($user['allowadmincp'], 1)) { + $status0[$uid] = $uid; + } + } + if(!empty($status0)) { + C::t('common_member')->clean_admincp_manage($status0); + } + if(!empty($status1)) { + C::t('common_member')->update_admincp_manage($status1); + } + +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_globalstick.php b/source/function/cache/cache_globalstick.php new file mode 100644 index 0000000..725e991 --- /dev/null +++ b/source/function/cache/cache_globalstick.php @@ -0,0 +1,54 @@ +fetch_all_valid_forum(); + $fuparray = $threadarray = array(); + foreach($query as $forum) { + switch($forum['type']) { + case 'forum': + $fuparray[$forum['fid']] = $forum['fup']; + break; + case 'sub': + $fuparray[$forum['fid']] = $fuparray[$forum['fup']]; + break; + } + } + foreach(C::t('forum_thread')->fetch_all_by_displayorder(array(2, 3)) as $thread) { + switch($thread['displayorder']) { + case 2: + $threadarray[$fuparray[$thread['fid']]][] = $thread['tid']; + break; + case 3: + $threadarray['global'][] = $thread['tid']; + break; + } + } + foreach(array_unique($fuparray) as $gid) { + if(!empty($threadarray[$gid])) { + $data['categories'][$gid] = array( + 'tids' => dimplode($threadarray[$gid]), + 'count' => intval(is_array($threadarray[$gid]) ? count($threadarray[$gid]) : 0) + ); + } + } + $data['global'] = array( + 'tids' => empty($threadarray['global']) ? '' : dimplode($threadarray['global']), + 'count' => intval(is_array($threadarray['global']) ? count($threadarray['global']) : 0) + ); + + savecache('globalstick', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_groupicon.php b/source/function/cache/cache_groupicon.php new file mode 100644 index 0000000..4bfc4f8 --- /dev/null +++ b/source/function/cache/cache_groupicon.php @@ -0,0 +1,25 @@ +fetch_all_order_by_displayorder() as $list) { + if($list['url']) { + $data[$list['groupid']] = preg_match('/^https?:\/\//is', $list['url']) ? $list['url'] : STATICURL.'image/common/'.$list['url']; + } + } + + savecache('groupicon', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_grouplevels.php b/source/function/cache/cache_grouplevels.php new file mode 100644 index 0000000..38e580c --- /dev/null +++ b/source/function/cache/cache_grouplevels.php @@ -0,0 +1,27 @@ +range(); + foreach($query as $level) { + $level['creditspolicy'] = dunserialize($level['creditspolicy']); + $level['postpolicy'] = dunserialize($level['postpolicy']); + $level['specialswitch'] = dunserialize($level['specialswitch']); + $data[$level['levelid']] = $level; + } + + savecache('grouplevels', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_groupreadaccess.php b/source/function/cache/cache_groupreadaccess.php new file mode 100644 index 0000000..83103ae --- /dev/null +++ b/source/function/cache/cache_groupreadaccess.php @@ -0,0 +1,30 @@ +fetch_readaccess_by_readaccess(0); + $ug_data = C::t('common_usergroup')->fetch_all_usergroup(array_keys($gf_data)); + + foreach($gf_data as $key => $datarow) { + if(!$ug_data[$key]['groupid']) { + continue; + } + $datarow['grouptitle'] = $ug_data[$key]['grouptitle']; + $data[] = $datarow; + } + + savecache('groupreadaccess', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_grouptype.php b/source/function/cache/cache_grouptype.php new file mode 100644 index 0000000..bf5c5b3 --- /dev/null +++ b/source/function/cache/cache_grouptype.php @@ -0,0 +1,32 @@ +fetch_all_group_type(1); + $data['second'] = $data['first'] = array(); + foreach($query as $group) { + if($group['type'] == 'forum') { + $data['second'][$group['fid']] = $group; + } else { + $data['first'][$group['fid']] = $group; + } + } + foreach($data['second'] as $fid => $secondgroup) { + $data['first'][$secondgroup['fup']]['groupnum'] += $secondgroup['groupnum']; + $data['first'][$secondgroup['fup']]['secondlist'][] = $secondgroup['fid']; + } + savecache('grouptype', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_heats.php b/source/function/cache/cache_heats.php new file mode 100644 index 0000000..22f5eca --- /dev/null +++ b/source/function/cache/cache_heats.php @@ -0,0 +1,58 @@ + 1, + 'limit' => intval($_G['setting']['indexhot']['limit'] ? $_G['setting']['indexhot']['limit'] : 10), + 'days' => intval($_G['setting']['indexhot']['days'] ? $_G['setting']['indexhot']['days'] : 7), + 'expiration' => intval($_G['setting']['indexhot']['expiration'] ? $_G['setting']['indexhot']['expiration'] : 900), + 'messagecut' => intval($_G['setting']['indexhot']['messagecut'] ? $_G['setting']['indexhot']['messagecut'] : 200) + ); + + + $messageitems = 2; + $limit = $_G['setting']['indexhot']['limit']; + foreach(C::t('forum_thread')->fetch_all_heats() as $heat) { + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($heat['tid']); + $heat = array_merge($heat, (array)$post); + if($limit == 0) { + break; + } + if($messageitems > 0) { + $heat['message'] = threadmessagecutstr($heat, $heat['message'], $_G['setting']['indexhot']['messagecut']); + $data['message'][$heat['tid']] = $heat; + } else { + unset($heat['message']); + $data['subject'][$heat['tid']] = $heat; + } + $messageitems--; + $limit--; + } + $data['expiration'] = TIMESTAMP + $_G['setting']['indexhot']['expiration']; + } + + savecache('heats', $data); + discuz_process::unlock('update_heats_list'); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_ipctrl.php b/source/function/cache/cache_ipctrl.php new file mode 100644 index 0000000..582112b --- /dev/null +++ b/source/function/cache/cache_ipctrl.php @@ -0,0 +1,19 @@ +fetch_all_setting(array('ipregctrl', 'ipverifywhite')); + savecache('ipctrl', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_magics.php b/source/function/cache/cache_magics.php new file mode 100644 index 0000000..7bb8b48 --- /dev/null +++ b/source/function/cache/cache_magics.php @@ -0,0 +1,23 @@ +fetch_all_data(1) as $magic) { + $data[$magic['magicid']] = $magic; + } + + savecache('magics', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_medals.php b/source/function/cache/cache_medals.php new file mode 100644 index 0000000..9e328ad --- /dev/null +++ b/source/function/cache/cache_medals.php @@ -0,0 +1,24 @@ +fetch_all_data(1) as $medal) { + $medal['image'] = preg_match('/^https?:\/\//is', $medal['image']) ? $medal['image'] : STATICURL.'image/common/'.$medal['image']; + $data[$medal['medalid']] = array('name' => $medal['name'], 'image' => $medal['image'], 'description' => dhtmlspecialchars($medal['description'])); + } + + savecache('medals', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_modreasons.php b/source/function/cache/cache_modreasons.php new file mode 100644 index 0000000..49a2cc5 --- /dev/null +++ b/source/function/cache/cache_modreasons.php @@ -0,0 +1,23 @@ +fetch_all_setting(array('modreasons', 'userreasons')); + foreach($settings as $key => $data) { + $data = str_replace(array("\r\n", "\r"), array("\n", "\n"), $data); + $data = explode("\n", trim($data)); + savecache($key, $data); + } +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_onlinelist.php b/source/function/cache/cache_onlinelist.php new file mode 100644 index 0000000..8881add --- /dev/null +++ b/source/function/cache/cache_onlinelist.php @@ -0,0 +1,29 @@ +fetch_all_order_by_displayorder() as $list) { + $url = preg_match('/^https?:\/\//is', $list['url']) ? $list['url'] : STATICURL.'image/common/'.$list['url']; + $data[$list['groupid']] = $url; + $data['legend'] .= !empty($url) ? " {$list['title']}       " : ''; + if($list['groupid'] == 7) { + $data['guest'] = $list['title']; + } + } + + savecache('onlinelist', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_plugin.php b/source/function/cache/cache_plugin.php new file mode 100644 index 0000000..6701ad8 --- /dev/null +++ b/source/function/cache/cache_plugin.php @@ -0,0 +1,63 @@ +fetch_all_data(1) as $plugin) { + $dir = substr($plugin['directory'], 0, -1); + $plugin['modules'] = dunserialize($plugin['modules']); + if($plugin['modules']['extra']['langexists']) { + $file = DISCUZ_ROOT.'./source/plugin/'.$dir.'/discuz_plugin_'.$dir.($plugin['modules']['extra']['installtype'] ? '_'.$plugin['modules']['extra']['installtype'] : '').'.xml'; + if(file_exists($file)) { + require_once libfile('function/plugin'); + require_once libfile('function/admincp'); + $importtxt = @implode('', file($file)); + $pluginarray = getimportdata('Discuz! Plugin', 0, 1); + if($pluginarray) { + updatepluginlanguage($pluginarray); + } + } + } + + foreach(C::t('common_pluginvar')->fetch_all_by_pluginid($plugin['pluginid']) as $var) { + $data[$plugin['identifier']][$var['variable']] = $var['value']; + if(in_array(substr($var['type'], 0, 6), array('group_', 'forum_'))) { + $stype = substr($var['type'], 0, 5).'s'; + $type = substr($var['type'], 6); + if($type == 'select') { + foreach(explode("\n", $var['extra']) as $key => $option) { + $option = trim($option); + if(strpos($option, '=') === FALSE) { + $key = $option; + } else { + $item = explode('=', $option); + $key = trim($item[0]); + $option = trim($item[1]); + } + $var['select'][] = array($key, $option); + } + } + $pluginsetting[$stype][$plugin['identifier']]['name'] = $plugin['name']; + $pluginsetting[$stype][$plugin['identifier']]['setting'][$var['pluginvarid']] = array('title' => $var['title'], 'description' => $var['description'], 'type' => $type, 'select' => $var['select']); + } + } + } + + + writetocache('pluginsetting', getcachevars(array('pluginsetting' => $pluginsetting))); + + savecache('plugin', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_portalcategory.php b/source/function/cache/cache_portalcategory.php new file mode 100644 index 0000000..537d9cd --- /dev/null +++ b/source/function/cache/cache_portalcategory.php @@ -0,0 +1,92 @@ +range_category(); + foreach($data as $key => $value) { + $upid = $value['upid']; + $data[$key]['level'] = 0; + if($upid && isset($data[$upid])) { + $data[$upid]['children'][] = $key; + while($upid && isset($data[$upid])) { + $data[$key]['level'] += 1; + $upid = $data[$upid]['upid']; + } + } + } + $domain = $_G['setting']['domain']; + $channelrootdomain = !empty($domain['root']) && !empty($domain['root']['channel']) ? $domain['root']['channel'] : ''; + $portaldomain = ''; + if(!empty($domain['app']['portal'])) { + $portaldomain = $_G['scheme'].'://'.$domain['app']['portal'].$_G['siteroot']; + } elseif(!empty($domain['app']['default'])) { + $portaldomain = $_G['scheme'].'://'.$domain['app']['default'].$_G['siteroot']; + } else { + $portaldomain = $_G['siteurl']; + } + foreach($data as $key => &$value){ + $url = $topid = ''; + $foldername = $value['foldername']; + if($value['level']) { + $topid = $key; + $foldername = ''; + while($data[$topid]['upid']) { + if($data[$topid]['foldername'] && $data[$key]['foldername']) { + $foldername = $data[$topid]['foldername'].'/'.$foldername; + } + $topid = $data[$topid]['upid']; + } + if($foldername) $foldername = $data[$topid]['foldername'].'/'.$foldername; + } else { + $topid = $key; + } + $value['topid'] = $topid; + + if($channelrootdomain && $data[$topid]['domain']){ + $url = $_G['scheme'].'://'.$data[$topid]['domain'].'.'.$channelrootdomain.'/'; + if($foldername) { + + if(!empty($value['upid'])) { + $url .= $foldername; + } + } else { + $url = $portaldomain.'portal.php?mod=list&catid='.$key; + } + } elseif ($foldername) { + $url = $portaldomain.$foldername; + if(substr($url, -1, 1) != '/') $url.= '/'; + } else { + $url = $portaldomain.'portal.php?mod=list&catid='.$key; + } + $value['caturl'] = $url; + + $value['fullfoldername'] = trim($foldername, '/'); + + if($value['shownav']) { + $rs = C::t('common_nav')->update_by_type_identifier(4, $key, array('url' => addslashes($url), 'name' =>$value['catname'])); + } + } + + savecache('portalcategory', $data); + + if(!function_exists('get_cachedata_mainnav')) { + include_once libfile('cache/setting','function'); + } + $data = $_G['setting']; + list($data['navs'], $data['subnavs'], $data['menunavs'], $data['navmns'], $data['navmn'], $data['navdms']) = get_cachedata_mainnav(); + savecache('setting', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_postimg.php b/source/function/cache/cache_postimg.php new file mode 100644 index 0000000..64bb793 --- /dev/null +++ b/source/function/cache/cache_postimg.php @@ -0,0 +1,40 @@ +read()) { + if(in_array(strtolower(fileext($entry)), $imgextarray) && preg_match("/^[\w\-\.\[\]\(\)\<\> &]+$/", substr($entry, 0, strrpos($entry, '.'))) && strlen($entry) < 30 && is_file($pdir.'/'.$entry)) { + $postimg[$perdir][] = array('url' => $entry); + $postimgjs .= ($count ? ',' : '').'"'.$entry.'"'; + $count++; + } + } + $postimgjs .='];'; + $postimgdir->close(); + } + savecache('postimg', $postimg); + $cachedir = DISCUZ_ROOT.'./data/cache/'; + if(file_put_contents($cachedir.'common_postimg.js', $postimgjs, LOCK_EX) === false) { + exit('Can not write to cache files, please check directory ./data/ and ./data/cache/ .'); + } +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_profilesetting.php b/source/function/cache/cache_profilesetting.php new file mode 100644 index 0000000..0e3f7f6 --- /dev/null +++ b/source/function/cache/cache_profilesetting.php @@ -0,0 +1,20 @@ +fetch_all_by_available(1); + + savecache('profilesetting', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_relatedlink.php b/source/function/cache/cache_relatedlink.php new file mode 100644 index 0000000..af8f907 --- /dev/null +++ b/source/function/cache/cache_relatedlink.php @@ -0,0 +1,28 @@ +range(); + foreach($query as $link) { + if(!preg_match('/^https?:\/\//is', $link['url'])) { + $link['url'] = 'http://'.$link['url']; + } + $data[] = $link; + } + savecache('relatedlink', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_secqaa.php b/source/function/cache/cache_secqaa.php new file mode 100644 index 0000000..1fbdb71 --- /dev/null +++ b/source/function/cache/cache_secqaa.php @@ -0,0 +1,35 @@ +count(); + + $start_limit = $secqaanum <= 10 ? 0 : mt_rand(0, $secqaanum - 10); + $i = 1; + foreach(C::t('common_secquestion')->fetch_all_secquestion($start_limit, 10) as $secqaa) { + if(!$secqaa['type']) { + $secqaa['answer'] = md5($secqaa['answer']); + } + $data[$i] = $secqaa; + $i++; + } + if(!empty($data)) { + while(($secqaas = count($data)) < 9) { + $data[$secqaas + 1] = $data[array_rand($data)]; + } + } + savecache('secqaa', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_setting.php b/source/function/cache/cache_setting.php new file mode 100644 index 0000000..95266a2 --- /dev/null +++ b/source/function/cache/cache_setting.php @@ -0,0 +1,1170 @@ +fetch_all_not_key($skipkeys) as $setting) { + if($setting['skey'] == 'extcredits') { + if(is_array($setting['svalue'] = dunserialize($setting['svalue']))) { + foreach($setting['svalue'] as $key => $value) { + if($value['available']) { + unset($setting['svalue'][$key]['available']); + } else { + unset($setting['svalue'][$key]); + } + } + } + } elseif($setting['skey'] == 'creditsformula') { + if(!checkformulacredits($setting['svalue'])) { + $setting['svalue'] = '$member[\'extcredits1\']'; + } else { + $setting['svalue'] = preg_replace("/(friends|doings|blogs|albums|polls|sharings|digestposts|posts|threads|oltime|extcredits[1-8])/", "\$member['\\1']", $setting['svalue']); + } + } elseif($setting['skey'] == 'maxsmilies') { + $setting['svalue'] = $setting['svalue'] <= 0 ? -1 : $setting['svalue']; + } elseif($setting['skey'] == 'threadsticky') { + $setting['svalue'] = explode(',', $setting['svalue']); + } elseif($setting['skey'] == 'attachdir') { + $setting['svalue'] = preg_replace("/\.asp|\\0/i", '0', $setting['svalue']); + $setting['svalue'] = str_replace('\\', '/', substr($setting['svalue'], 0, 2) == './' ? DISCUZ_ROOT.$setting['svalue'] : $setting['svalue']); + $setting['svalue'] .= substr($setting['svalue'], -1, 1) != '/' ? '/' : ''; + } elseif($setting['skey'] == 'attachurl') { + $setting['svalue'] .= substr($setting['svalue'], -1, 1) != '/' ? '/' : ''; + } elseif($setting['skey'] == 'onlinehold') { + $setting['svalue'] = $setting['svalue'] * 60; + } elseif(in_array($setting['skey'], $serialized)) { + $setting['svalue'] = @dunserialize($setting['svalue'], $setting['skey']); + if($setting['skey'] == 'search') { + foreach($setting['svalue'] as $key => $val) { + foreach($val as $k => $v) { + $setting['svalue'][$key][$k] = max(0, intval($v)); + } + } + } elseif($setting['skey'] == 'ftp') { + $setting['svalue']['attachurl'] .= substr($setting['svalue']['attachurl'], -1, 1) != '/' ? '/' : ''; + } elseif($setting['skey'] == 'inviteconfig') { + $setting['svalue']['invitecodeprompt'] = stripslashes($setting['svalue']['invitecodeprompt']); + } elseif($setting['skey'] == 'profilegroup') { + $profile_settings = C::t('common_member_profile_setting')->fetch_all_by_available(1); + foreach($setting['svalue'] as $key => $val) { + $temp = array(); + if (!empty($val['field']) && is_array($val['field'])) { + foreach($profile_settings as $pval) { + if(in_array($pval['fieldid'], $val['field'])) { + $temp[$pval['fieldid']] = $pval['fieldid']; + } + } + foreach($val['field'] as $fieldid) { + if(!in_array($fieldid, $temp)) { + $temp[$fieldid] = $fieldid; + } + } + } + $setting['svalue'][$key]['field'] = $temp; + } + C::t('common_setting')->update_setting('profilegroup', $setting['svalue']); + } + } + $_G['setting'][$setting['skey']] = $data[$setting['skey']] = $setting['svalue']; + } + + $usergroup = C::t('common_usergroup')->fetch_by_credits($data['initcredits'], ''); + $data['newusergroupid'] = $usergroup['groupid']; + $data['buyusergroupexists'] = C::t('common_usergroup')->buyusergroup_exists(); + + if($data['srchhotkeywords']) { + $data['srchhotkeywords'] = explode("\n", str_replace("\r",'',$data['srchhotkeywords'])); + $data['srchhotkeywords'] = array_filter($data['srchhotkeywords']); + } + + if($data['search']) { + $searchstatus = 0; + foreach($data['search'] as $item) { + if($item['status']) { + $searchstatus = 1; + break; + } + } + if(!$searchstatus) { + $data['search'] = array(); + } + } + + $data['creditspolicy'] = array_merge($data['creditspolicy'], get_cachedata_setting_creditspolicy()); + + if($data['heatthread']['iconlevels']) { + $data['heatthread']['iconlevels'] = explode(',', $data['heatthread']['iconlevels']); + arsort($data['heatthread']['iconlevels']); + } else { + $data['heatthread']['iconlevels'] = array(); + } + if($data['verify']) { + foreach($data['verify'] as $key => $value) { + if($value['available']) { + if(!empty($value['unverifyicon'])) { + $icourl = parse_url($value['unverifyicon']); + if(!$icourl['host'] && !file_exists($value['unverifyicon'])) { + $data['verify'][$key]['unverifyicon'] = $data['attachurl'].'common/'.$value['unverifyicon']; + } + } + if(!empty($value['icon'])) { + $icourl = parse_url($value['icon']); + if(!$icourl['host'] && !file_exists($value['icon'])) { + $data['verify'][$key]['icon'] = $data['attachurl'].'common/'.$value['icon']; + } + } + } + } + } + + if($data['recommendthread']['status']) { + if($data['recommendthread']['iconlevels']) { + $data['recommendthread']['iconlevels'] = explode(',', $data['recommendthread']['iconlevels']); + arsort($data['recommendthread']['iconlevels']); + } else { + $data['recommendthread']['iconlevels'] = array(); + } + } else { + $data['recommendthread'] = array('allow' => 0); + } + + if($data['commentnumber'] && !$data['allowpostcomment']) { + $data['commentnumber'] = 0; + } + + if(!empty($data['ftp'])) { + if(!empty($data['ftp']['allowedexts'])) { + $data['ftp']['allowedexts'] = str_replace(array("\r\n", "\r"), array("\n", "\n"), $data['ftp']['allowedexts']); + $data['ftp']['allowedexts'] = explode("\n", strtolower($data['ftp']['allowedexts'])); + array_walk($data['ftp']['allowedexts'], 'trim'); + } + if(!empty($data['ftp']['disallowedexts'])) { + $data['ftp']['disallowedexts'] = str_replace(array("\r\n", "\r"), array("\n", "\n"), $data['ftp']['disallowedexts']); + $data['ftp']['disallowedexts'] = explode("\n", strtolower($data['ftp']['disallowedexts'])); + array_walk($data['ftp']['disallowedexts'], 'trim'); + } + $data['ftp']['connid'] = 0; + } + + if(!empty($data['forumkeys'])) { + $data['forumfids'] = array_flip($data['forumkeys']); + } else { + $data['forumfids'] = array(); + } + + $data['commentitem'] = explode("\t", $data['commentitem']); + $commentitem = array(); + foreach($data['commentitem'] as $k => $v) { + $tmp = explode(chr(0).chr(0).chr(0), $v); + if(count($tmp) > 1) { + $commentitem[$tmp[0]] = $tmp[1]; + } else { + $commentitem[$k] = $v; + } + } + $data['commentitem'] = $commentitem; + + if($data['allowviewuserthread']['allow']) { + $data['allowviewuserthread'] = is_array($data['allowviewuserthread']['fids']) && $data['allowviewuserthread']['fids'] && !in_array('', $data['allowviewuserthread']['fids']) ? dimplode($data['allowviewuserthread']['fids']) : ''; + } else { + $data['allowviewuserthread'] = -1; + } + + include_once DISCUZ_ROOT.'./source/discuz_version.php'; + $_G['setting']['version'] = $data['version'] = DISCUZ_VERSION; + + $data['sitemessage']['time'] = !empty($data['sitemessage']['time']) ? $data['sitemessage']['time'] * 1000 : 0; + foreach (array('register', 'login', 'newthread', 'reply') as $type) { + $data['sitemessage'][$type] = !empty($data['sitemessage'][$type]) ? explode("\n", $data['sitemessage'][$type]) : array(); + } + + $data['cachethreadon'] = C::t('forum_forum')->fetch_threadcacheon_num() ? 1 : 0; + $data['disallowfloat'] = is_array($data['disallowfloat']) ? implode('|', $data['disallowfloat']) : ''; + + if(!$data['imagelib']) unset($data['imageimpath']); + + if(is_array($data['relatedtag']['order'])) { + asort($data['relatedtag']['order']); + $relatedtag = array(); + foreach($data['relatedtag']['order'] AS $k => $v) { + $relatedtag['status'][$k] = $data['relatedtag']['status'][$k]; + $relatedtag['name'][$k] = $data['relatedtag']['name'][$k]; + $relatedtag['limit'][$k] = $data['relatedtag']['limit'][$k]; + $relatedtag['template'][$k] = $data['relatedtag']['template'][$k]; + } + $data['relatedtag'] = $relatedtag; + + foreach((array)$data['relatedtag']['status'] AS $appid => $status) { + if(!$status) { + unset($data['relatedtag']['limit'][$appid]); + } + } + unset($data['relatedtag']['status'], $data['relatedtag']['order'], $relatedtag); + } + + $data['domain']['defaultindex'] = isset($data['defaultindex']) && $data['defaultindex'] != '#' ? $data['defaultindex'] : ''; + $data['domain']['holddomain'] = isset($data['holddomain']) ? $data['holddomain'] : ''; + $data['domain']['list'] = array(); + foreach(C::t('common_domain')->fetch_all_by_idtype(array('subarea', 'forum', 'topic', 'channel', 'plugin')) as $value) { + if($value['idtype'] == 'plugin') { + $plugin = C::t('common_plugin')->fetch($value['id']); + if(!$plugin || !$plugin['available']) { + continue; + } + $value['id'] = $plugin['identifier']; + } + $data['domain']['list'][$value['domain'].'.'.$value['domainroot']] = array('id' => $value['id'], 'idtype' => $value['idtype']); + } + writetocache('domain', getcachevars(array('domain' => $data['domain']))); + + $data['seccodedata'] = is_array($data['seccodedata']) ? $data['seccodedata'] : array(); + if($data['seccodedata']['type'] == 2) { + if(extension_loaded('ming')) { + unset($data['seccodedata']['background'], $data['seccodedata']['adulterate'], + $data['seccodedata']['ttf'], $data['seccodedata']['angle'], + $data['seccodedata']['color'], $data['seccodedata']['size'], + $data['seccodedata']['animator']); + } else { + $data['seccodedata']['animator'] = 0; + } + } elseif($data['seccodedata']['type'] == 99) { + $data['seccodedata']['width'] = 32; + $data['seccodedata']['height'] = 24; + } + + $data['watermarktype'] = !empty($data['watermarktype']) ? dunserialize($data['watermarktype']) : array(); + $data['watermarktext'] = !empty($data['watermarktext']) ? dunserialize($data['watermarktext']) : array(); + foreach($data['watermarktype'] as $k => $v) { + if($data['watermarktype'][$k] == 'text' && $data['watermarktext']['text'][$k]) { + if($data['watermarktext']['text'][$k] && strtoupper(CHARSET) != 'UTF-8') { + $data['watermarktext']['text'][$k] = diconv($data['watermarktext']['text'][$k], CHARSET, 'UTF-8', true); + } + $data['watermarktext']['text'][$k] = bin2hex($data['watermarktext']['text'][$k]); + if(file_exists('static/image/seccode/font/en/'.$data['watermarktext']['fontpath'][$k])) { + $data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/en/'.$data['watermarktext']['fontpath'][$k]; + } elseif(file_exists('static/image/seccode/font/ch/'.$data['watermarktext']['fontpath'][$k])) { + $data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/ch/'.$data['watermarktext']['fontpath'][$k]; + } else { + $data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/'.$data['watermarktext']['fontpath'][$k]; + } + $data['watermarktext']['color'][$k] = preg_replace_callback('/#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/', 'build_cache_setting_callback_hexdec_123', $data['watermarktext']['color'][$k]); + $data['watermarktext']['shadowcolor'][$k] = preg_replace_callback('/#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/', 'build_cache_setting_callback_hexdec_123', $data['watermarktext']['shadowcolor'][$k]); + } else { + $data['watermarktext']['text'][$k] = ''; + $data['watermarktext']['fontpath'][$k] = ''; + $data['watermarktext']['color'][$k] = ''; + $data['watermarktext']['shadowcolor'][$k] = ''; + } + } + + $data['styles'] = array(); + foreach(C::t('common_style')->fetch_all_data(false, 1) as $style) { + $data['styles'][$style['styleid']] = dhtmlspecialchars($style['name']); + } + + $exchcredits = array(); + $allowexchangein = $allowexchangeout = FALSE; + foreach((array)$data['extcredits'] as $id => $credit) { + $data['extcredits'][$id]['img'] = $credit['img'] ? '' : ''; + if(!empty($credit['ratio'])) { + $exchcredits[$id] = $credit; + $credit['allowexchangein'] && $allowexchangein = TRUE; + $credit['allowexchangeout'] && $allowexchangeout = TRUE; + } + $data['creditnotice'] && $data['creditnames'][] = str_replace("'", "\'", dhtmlspecialchars($id.'|'.$credit['title'].'|'.$credit['unit'])); + } + $data['creditnames'] = $data['creditnotice'] ? @implode(',', $data['creditnames']) : ''; + + $creditstranssi = explode(',', $data['creditstrans']); + $data['creditstrans'] = $creditstranssi[0]; + unset($creditstranssi[0]); + $data['creditstransextra'] = $creditstranssi; + for($i = 1; $i < 13; $i++) { + $data['creditstransextra'][$i] = $data['creditstrans'] ? (!$data['creditstransextra'][$i] ? $data['creditstrans'] : $data['creditstransextra'][$i]) : 0; + } + $data['exchangestatus'] = $allowexchangein && $allowexchangeout; + $data['transferstatus'] = isset($data['extcredits'][$data['creditstrans']]); + + list($data['zoomstatus'], $data['imagemaxwidth']) = explode("\t", $data['zoomstatus']); + $data['imagemaxwidth'] = intval($data['imagemaxwidth']); + + require_once DISCUZ_ROOT.'./config/config_ucenter.php'; + $data['ucenterurl'] = UC_STANDALONE ? '.' : UC_API; + $data['avatarurl'] = empty(UC_AVTURL) ? $data['ucenterurl'].'/data/avatar' : UC_AVTURL; + $data['avatarpath'] = UC_STANDALONE ? (UC_AVTPATH ? substr(realpath(DISCUZ_ROOT.str_replace('..', '', UC_AVTPATH)), strlen(DISCUZ_ROOT)).'/' : 'data/avatar/') : ''; + + foreach(C::t('common_magic')->fetch_all_data(1) as $magic) { + $magic['identifier'] = str_replace(':', '_', $magic['identifier']); + $data['magics'][$magic['identifier']] = $magic['name']; + } + + $data['tradeopen'] = C::t('common_usergroup_field')->count_by_field('allowposttrade', 1) ? 1 : 0; + + $focus = array(); + if($data['focus']['data']) { + foreach($data['focus']['data'] as $k => $v) { + if($v['available'] && $v['position']) { + foreach($v['position'] as $position) { + $focus[$position][$k] = $k; + } + } + } + } + $data['focus'] = $focus; + + list($data['plugins'], $data['pluginlinks'], $data['hookscript'], $data['hookscriptmobile'], $data['threadplugins'], $data['specialicon']) = get_cachedata_setting_plugin(); + + if(empty($data['defaultindex'])) $data['defaultindex'] = ''; + list($data['navs'], $data['subnavs'], $data['menunavs'], $data['navmns'], $data['navmn'], $data['navdms'], $data['navlogos']) = get_cachedata_mainnav(); + + $data['footernavs'] = get_cachedata_footernav(); + $data['spacenavs'] = get_cachedata_spacenavs(); + $data['mynavs'] = get_cachedata_mynavs(); + $data['topnavs'] = get_cachedata_topnav(); + $data['profilenode'] = get_cachedata_threadprofile(); + $data['mfindnavs'] = get_cachedata_mfindnav(); + + require_once DISCUZ_ROOT.'./uc_client/client.php'; + $ucapparray = uc_app_ls(); + $data['allowsynlogin'] = isset($ucapparray[UC_APPID]['synlogin']) ? $ucapparray[UC_APPID]['synlogin'] : 1; + $appnamearray = array('UCHOME','XSPACE','DISCUZ','SUPESITE','SUPEV','ECSHOP','ECMALL','OTHER'); + $data['ucapp'] = $data['ucappopen'] = array(); + $data['uchomeurl'] = ''; + $data['discuzurl'] = $_G['siteurl']; + $appsynlogins = 0; + foreach($ucapparray as $apparray) { + if($apparray['appid'] != UC_APPID) { + if(!empty($apparray['synlogin'])) { + $appsynlogins = 1; + } + if($data['uc']['navlist'][$apparray['appid']] && $data['uc']['navopen']) { + $data['ucapp'][$apparray['appid']]['name'] = $apparray['name']; + $data['ucapp'][$apparray['appid']]['url'] = $apparray['url']; + } + } else { + $data['discuzurl'] = $apparray['url']; + } + if(!empty($apparray['viewprourl'])) { + $data['ucapp'][$apparray['appid']]['viewprourl'] = $apparray['url'].$apparray['viewprourl']; + } + foreach($appnamearray as $name) { + if($apparray['type'] == $name && $apparray['appid'] != UC_APPID) { + $data['ucappopen'][$name] = 1; + if($name == 'UCHOME') { + $data['uchomeurl'] = $apparray['url']; + } elseif($name == 'XSPACE') { + $data['xspaceurl'] = $apparray['url']; + } + } + } + } + $data['allowsynlogin'] = $data['allowsynlogin'] && $appsynlogins ? 1 : 0; + $data['homeshow'] = $data['uchomeurl'] && $data['uchome']['homeshow'] ? $data['uchome']['homeshow'] : '0'; + + unset($data['allowthreadplugin']); + if($data['jspath'] == 'data/cache/') { + writetojscache(); + } elseif(!$data['jspath']) { + $data['jspath'] = 'static/js/'; + } + + if(!$data['csspathv']) { + $data['csspathv'] = 'data/cache/'; + } + $data['csspath'] = $data['csspathv'].'style_'; + + if($data['cacheindexlife']) { + $cachedir = DISCUZ_ROOT.'./'.$data['cachethreaddir']; + $tidmd5 = substr(md5(0), 3); + @unlink($cachedir.'/'.$tidmd5[0].'/'.$tidmd5[1].'/'.$tidmd5[2].'/0.htm'); + } + + $reginputbwords = array('username', 'password', 'password2', 'email'); + if(in_array($data['reginput']['username'], $reginputbwords) || !preg_match('/^[A-z]\w+?$/', $data['reginput']['username'])) { + $data['reginput']['username'] = random(6); + } + if(in_array($data['reginput']['password'], $reginputbwords) || !preg_match('/^[A-z]\w+?$/', $data['reginput']['password'])) { + $data['reginput']['password'] = random(6); + } + if(in_array($data['reginput']['password2'], $reginputbwords) || !preg_match('/^[A-z]\w+?$/', $data['reginput']['password2'])) { + $data['reginput']['password2'] = random(6); + } + if(in_array($data['reginput']['email'], $reginputbwords) || !preg_match('/^[A-z]\w+?$/', $data['reginput']['email'])) { + $data['reginput']['email'] = random(6); + } + + $defaultcurhost = empty($_G['setting']['domain']['app']['default']) ? '{CURHOST}' : $_G['setting']['domain']['app']['default']; + $output = array('str'=>array(), 'preg' => array()); //str为二级域名的查找和替换,preg为rewrite和默认域名的查找和替换 + $_G['domain'] = array(); + if(is_array($_G['setting']['domain']['app'])) { + $apps = $_G['setting']['domain']['app']; + $repflag = $apps['portal'] || $apps['forum'] || $apps['group'] || $apps['home'] || $apps['default']; + foreach($apps as $app => $domain) { + if(in_array($app, array('default', 'mobile'))) { + continue; + } + $appphp = "{$app}.php"; + if(!$domain) { + $domain = $defaultcurhost; + } + if($domain != '{CURHOST}') { + $domain = $_G['scheme'].'://'.$domain.$_G['siteport'].'/'; + } + if($repflag) { + $output['str']['search'][$app] = " $nav) { + foreach ($output['preg']['search'] as $key => $value) { + $data['footernavs'][$id]['code'] = preg_replace_callback( + $value, + function ($matches) use ($output, $key) { + return eval('return ' . $output['preg']['replace'][$key] . ';'); + }, + $nav['code'] + ); + } + } + foreach($data['spacenavs'] as $id => $nav) { + foreach ($output['preg']['search'] as $key => $value) { + $data['spacenavs'][$id]['code'] = preg_replace_callback( + $value, + function ($matches) use ($output, $key) { + return eval('return ' . $output['preg']['replace'][$key] . ';'); + }, + $nav['code'] + ); + } + } + foreach($data['mynavs'] as $id => $nav) { + foreach ($output['preg']['search'] as $key => $value) { + $data['mynavs'][$id]['code'] = preg_replace_callback( + $value, + function ($matches) use ($output, $key) { + return eval('return ' . $output['preg']['replace'][$key] . ';'); + }, + $nav['code'] + ); + } + } + foreach($data['topnavs'] as $id => $nav) { + foreach ($output['preg']['search'] as $key => $value) { + $data['topnavs'][$id]['code'] = preg_replace_callback( + $value, + function ($matches) use ($output, $key) { + return eval('return ' . $output['preg']['replace'][$key] . ';'); + }, + $nav['code'] + ); + } + } + foreach($data['plugins']['jsmenu'] as $id => $nav) { + foreach ($output['preg']['search'] as $key => $value) { + $data['plugins']['jsmenu'][$id]['url'] = preg_replace_callback( + $value, + function ($matches) use ($output, $key) { + return eval('return ' . $output['preg']['replace'][$key] . ';'); + }, + $nav['url'] + ); + } + } + } + } + $data['output'] = $output; + $data['connect'] = in_array('qqconnect', $data['plugins']['available']) ? $data['connect'] : array(); + + $data['parseflv'] = get_cachedata_discuzcode_parseflv(); + + $data['mpsid'] = preg_replace('/[^0-9]+/', '', $data['mps']); + + $data['securesiteurl'] = $_G['siteurl']; + + $data['maxsubjectsize'] = empty($data['maxsubjectsize']) ? 80 : $data['maxsubjectsize']; + + $data['minsubjectsize'] = empty($data['minsubjectsize']) ? 1 : $data['minsubjectsize']; + + if($data['membersplit']) { + C::t('common_member_archive')->check_table(); + } + + savecache('setting', $data); + $_G['setting'] = $data; +} + +function build_cache_setting_callback_hexdec_123($matches) { + return hexdec($matches[1]).','.hexdec($matches[2]).','.hexdec($matches[3]); +} + +function get_cachedata_setting_creditspolicy() { + $data = array(); + foreach(C::t('common_credit_rule')->fetch_all_by_action(array('promotion_visit', 'promotion_register')) as $creditrule) { + $ruleexist = false; + for($i = 1; $i <= 8; $i++) { + if($creditrule['extcredits'.$i]) { + $ruleexist = true; + } + } + $data[$creditrule['action']] = $ruleexist; + } + return $data; +} + +function get_cachedata_setting_plugin($method = '') { + global $_G; + require_once libfile('function/admincp'); + $hookfuncs = array('common', 'discuzcode', 'template', 'deletemember', 'deletethread', 'deletepost', 'avatar', 'savebanlog', 'cacheuserstats', 'undeletethreads', 'recyclebinpostundelete', 'threadpubsave', 'profile_node'); + $data = $adminmenu = array(); + $data['plugins'] = $data['pluginlinks'] = $data['hookscript'] = $data['hookscriptmobile'] = $data['threadplugins'] = $data['specialicon'] = array(); + $data['plugins']['func'] = $data['plugins']['available'] = array(); + foreach(C::t('common_plugin')->fetch_all_data() as $plugin) { + $available = !$method && $plugin['available'] || $method && ($plugin['available'] || $method == $plugin['identifier']); + $addadminmenu = $plugin['available'] && C::t('common_pluginvar')->count_by_pluginid($plugin['pluginid']) ? TRUE : FALSE; + $plugin['modules'] = dunserialize($plugin['modules']); + if($available) { + $data['plugins']['available'][] = $plugin['identifier']; + $data['plugins']['version'][$plugin['identifier']] = $plugin['version']; + } + $plugin['directory'] = $plugin['directory'].((!empty($plugin['directory']) && substr($plugin['directory'], -1) != '/') ? '/' : ''); + if(!isplugindir($plugin['directory'])) { + if(ispluginkey($plugin['identifier'])) { + $plugin['directory'] = $plugin['identifier'].'/'; + C::t('common_plugin')->update($plugin['pluginid'], array('directory' => $plugin['directory'])); + } else { + continue; + } + } + if(is_array($plugin['modules'])) { + unset($plugin['modules']['extra']); + foreach($plugin['modules'] as $k => $module) { + if($available && isset($module['name'])) { + $module['displayorder'] = $plugin['modules']['system'] ? ($module['displayorder'] < 1000 ? (int)$module['displayorder'] : 999) : (int)$module['displayorder'] + 1000; + $k = ''; + switch($module['type']) { + case 1: + $navtype = 0; + case 23: + if($module['type'] == 23) $navtype = 1; + case 24: + if($module['type'] == 24) $navtype = 2; + case 25: + if($module['type'] == 25) $navtype = 3; + case 30: + if($module['type'] == 30) $navtype = 5; + case 27: + if($module['type'] == 27) $navtype = 4; + $module['url'] = $module['url'] ? $module['url'] : 'plugin.php?id='.$plugin['identifier'].':'.$module['name']; + if(!(C::t('common_nav')->count_by_navtype_type_identifier($navtype, 3, $plugin['identifier']))) { + C::t('common_nav')->insert(array( + 'name' => $module['menu'], + 'title' => $module['navtitle'], + 'url' => $module['url'], + 'type' => 3, + 'identifier' => $plugin['identifier'], + 'navtype' => $navtype, + 'available' => 1, + 'icon' => $module['navicon'], + 'subname' => $module['navsubname'], + 'suburl' => $module['navsuburl'], + )); + } + break; + case 5: + $k = 'jsmenu'; + $module['url'] = $module['url'] ? $module['url'] : 'plugin.php?id='.$plugin['identifier'].':'.$module['name']; + list($module['menu'], $module['title']) = explode('/', $module['menu']); + $module['menu'] = $module['type'] == 1 ? ($module['menu'].($module['title'] ? ''.$module['title'].'' : '')) : $module['menu']; + $data['plugins'][$k][] = array('displayorder' => $module['displayorder'], 'adminid' => $module['adminid'], 'url' => "$module[menu]"); + break; + case 14: + $k = 'faq'; + case 15: + $k = !$k ? 'modcp_base' : $k; + case 16: + $k = !$k ? 'modcp_tools' : $k; + case 7: + $k = !$k ? 'spacecp' : $k; + case 17: + $k = !$k ? 'spacecp_profile' : $k; + case 19: + $k = !$k ? 'spacecp_credit' : $k; + case 21: + $k = !$k ? 'portalcp' : $k; + case 26: + $k = !$k ? 'space_thread' : $k; + $data['plugins'][$k][$plugin['identifier'].':'.$module['name']] = array('displayorder' => $module['displayorder'], 'adminid' => $module['adminid'], 'name' => $module['menu'], 'url' => $module['url'], 'directory' => $plugin['directory']); + break; + case 3: + $addadminmenu = TRUE; + break; + case 4: + $data['plugins']['include'][$plugin['identifier']] = array('displayorder' => $module['displayorder'], 'adminid' => $module['adminid'], 'script' => $plugin['directory'].$module['name']); + break; + case 11: + $k = 'hookscript'; + case 28: + $k = !$k ? 'hookscriptmobile' : $k; + $script = $plugin['directory'].$module['name']; + @include_once DISCUZ_ROOT.'./source/plugin/'.$script.'.class.php'; + $classes = get_declared_classes(); + $classnames = array(); + $namekey = ($k == 'hookscriptmobile' ? 'mobile' : '').'plugin_'.$plugin['identifier']; + $cnlen = strlen($namekey); + foreach($classes as $classname) { + if(substr($classname, 0, $cnlen) == $namekey) { + $hscript = substr($classname, $cnlen + 1); + $classnames[$hscript ? $hscript : 'global'] = $classname; + } + } + foreach($classnames as $hscript => $classname) { + $hookmethods = get_class_methods($classname); + foreach($hookmethods as $funcname) { + if($hscript == 'global' && in_array($funcname, $hookfuncs)) { + $data['plugins']['func'][$k][$funcname] = true; + if($funcname == 'profile_node') { + $data['plugins']['profile_node'][$plugin['identifier']] = $script; + } + } + $v = explode('_', $funcname); + $curscript = $v[0]; + if(!$curscript || $classname == $funcname) { + continue; + } + if($hscript == 'home' && in_array($curscript, array('space', 'spacecp'))) { + $curscript .= '_'.$v[1]; + } + if(strpos($funcname, '__') !== false) { + $curscript = current(explode('__', $funcname)); + } + if(!is_array($data[$k][$hscript][$curscript]['module']) || !in_array($script, $data[$k][$hscript][$curscript]['module'])) { + $data[$k][$hscript][$curscript]['module'][$plugin['identifier']] = $script; + $data[$k][$hscript][$curscript]['adminid'][$plugin['identifier']] = $module['adminid']; + } + if(preg_match('/\_output$/', $funcname)) { + $varname = preg_replace('/\_output$/', '', $funcname); + $data[$k][$hscript][$curscript]['outputfuncs'][$varname][] = array('displayorder' => $module['displayorder'], 'func' => array($plugin['identifier'], $funcname)); + } elseif(preg_match('/\_message$/', $funcname)) { + $varname = preg_replace('/\_message$/', '', $funcname); + $data[$k][$hscript][$curscript]['messagefuncs'][$varname][] = array('displayorder' => $module['displayorder'], 'func' => array($plugin['identifier'], $funcname)); + } else { + $data[$k][$hscript][$curscript]['funcs'][$funcname][] = array('displayorder' => $module['displayorder'], 'func' => array($plugin['identifier'], $funcname)); + } + } + } + break; + case 12: + $script = $plugin['directory'].$module['name']; + @include_once DISCUZ_ROOT.'./source/plugin/'.$script.'.class.php'; + if(class_exists('threadplugin_'.$plugin['identifier'])) { + $classname = 'threadplugin_'.$plugin['identifier']; + $hookclass = new $classname; + if($hookclass->name) { + $data['threadplugins'][$plugin['identifier']]['name'] = $hookclass->name; + $data['threadplugins'][$plugin['identifier']]['icon'] = $hookclass->iconfile; + $data['threadplugins'][$plugin['identifier']]['module'] = $script; + } + } + break; + } + } + } + } + if($addadminmenu) { + $adminmenu[$plugin['modules']['system'] ? 0 : 1][] = array('url' => "plugins&operation=config&do={$plugin['pluginid']}", 'action' => 'plugins_config_'.$plugin['pluginid'], 'name' => $plugin['name']); + } + } + if(!$method) { + $_G['setting']['plugins']['available'] = $data['plugins']['available']; + if($adminmenu[0]) { + $adminmenu[0] = array_merge( + array(array('name' => 'plugins_system', 'sub' => 1)), + $adminmenu[0], + array(array('name' => 'plugins_system', 'sub' => 2)) + ); + } + savecache('adminmenu', array_merge((array)$adminmenu[0], (array)$adminmenu[1])); + } + + + + $data['pluginhooks'] = array(); + foreach(array('hookscript', 'hookscriptmobile') as $hooktype) { + foreach($data[$hooktype] as $hscript => $hookscript) { + foreach($hookscript as $curscript => $scriptdata) { + if(is_array($scriptdata['funcs'])) { + foreach($scriptdata['funcs'] as $funcname => $funcs) { + usort($funcs, 'pluginmodulecmp'); + $tmp = array(); + foreach($funcs as $k => $v) { + $tmp[$k] = $v['func']; + } + $data[$hooktype][$hscript][$curscript]['funcs'][$funcname] = $tmp; + } + } + if(is_array($scriptdata['outputfuncs'])) { + foreach($scriptdata['outputfuncs'] as $funcname => $funcs) { + usort($funcs, 'pluginmodulecmp'); + $tmp = array(); + foreach($funcs as $k => $v) { + $tmp[$k] = $v['func']; + } + $data[$hooktype][$hscript][$curscript]['outputfuncs'][$funcname] = $tmp; + } + } + if(is_array($scriptdata['messagefuncs'])) { + foreach($scriptdata['messagefuncs'] as $funcname => $funcs) { + usort($funcs, 'pluginmodulecmp'); + $tmp = array(); + foreach($funcs as $k => $v) { + $tmp[$k] = $v['func']; + } + $data[$hooktype][$hscript][$curscript]['messagefuncs'][$funcname] = $tmp; + } + } + } + } + } + + foreach(array('links', 'spacecp', 'include', 'jsmenu', 'space', 'spacecp', 'spacecp_profile', 'spacecp_credit', 'faq', 'modcp_base', 'modcp_member', 'modcp_forum') as $pluginkey) { + if(is_array($data['plugins'][$pluginkey])) { + if(in_array($pluginkey, array('space', 'spacecp', 'spacecp_profile', 'spacecp_credit', 'faq', 'modcp_base', 'modcp_tools'))) { + uasort($data['plugins'][$pluginkey], 'pluginmodulecmp'); + } else { + usort($data['plugins'][$pluginkey], 'pluginmodulecmp'); + } + } + } + + return array($data['plugins'], $data['pluginlinks'], $data['hookscript'], $data['hookscriptmobile'], $data['threadplugins'], $data['specialicon']); + +} + +function get_cachedata_mainnav() { + global $_G; + + $data['navs'] = $data['subnavs'] = $data['menunavs'] = $data['navmns'] = $data['navmn'] = $data['navdms'] = $navids = array(); + foreach(C::t('common_nav')->fetch_all_mainnav() as $nav) { + if($nav['available'] < 0) { + continue; + } + $id = $nav['type'] == 0 ? $nav['identifier'] : 100 + $nav['id']; + if($nav['identifier'] == 1 && $nav['type'] == 0 && !helper_access::check_module('portal')) { + $nav['available'] = 0; + } + if($nav['identifier'] == 3 && $nav['type'] == 0 && !helper_access::check_module('group')) { + $nav['available'] = 0; + } + if($nav['identifier'] == 4 && $nav['type'] == 0 && !helper_access::check_module('feed')) { + $nav['available'] = 0; + } + if($nav['type'] == 3) { + if(!in_array($nav['identifier'], $_G['setting']['plugins']['available'])) { + continue; + } + } + if($nav['identifier'] == 8 && $nav['type'] == 0 && !helper_access::check_module('ranklist')) { + $nav['available'] = 0; + } + $nav['style'] = parsehighlight($nav['highlight']); + $data['navs'][$id]['navname'] = $nav['name']; + $data['navs'][$id]['filename'] = $nav['url']; + $data['navs'][$id]['available'] = $nav['available']; + $nav['name'] = $nav['name'].($nav['title'] ? ''.$nav['title'].'' : ''); + $subnavs = ''; + foreach(C::t('common_nav')->fetch_all_subnav($nav['id']) as $subnav) { + $item = "{$subnav['name']}"; + $liparam = !$nav['subtype'] || !$nav['subcols'] ? '' : ' style="width:'.sprintf('%1.1f', (1 / $nav['subcols']) * 100).'%"'; + $subnavs .= ''.$item.''; + } + list($navid) = explode('.', basename($nav['url'])); + if($nav['type'] || $navid == 'misc' || $nav['identifier'] == 6) { + if($nav['type'] == 4) { + $navid = 'P'.$nav['identifier']; + } elseif($nav['type'] == 5) { + $navid = 'F'.$nav['identifier']; + } else { + $navid = 'N'.substr(md5(($nav['url'] != '#' ? $nav['url'] : $nav['name'])), 0, 4); + } + } + $navid = 'mn_'.$navid; + if(in_array($navid, $navids)) { + $navid .= '_'.$nav['identifier']; + } + $navids[] = $navid; + $onmouseover = ''; + if($subnavs) { + if($nav['subtype']) { + $onmouseover = 'navShow(\''.substr($navid, 3).'\')'; + $data['subnavs'][$navid] = $subnavs; + } else { + $onmouseover = 'showMenu({\'ctrlid\':this.id,\'ctrlclass\':\'hover\',\'duration\':2})'; + $data['menunavs'][] = ''; + } + } + if($nav['identifier'] == 6 && $nav['type'] == 0) { + if(!empty($_G['setting']['plugins']['jsmenu'])) { + $onmouseover .= "showMenu({'ctrlid':this.id,'ctrlclass':'hover','menuid':'plugin_menu'})"; + } else { + $data['navs'][$id]['available'] = 0; + continue; + } + } + if($nav['identifier'] == 5 && $nav['type'] == 0) { + $onmouseover = 'delayShow(this, function () {showMenu({\'ctrlid\':\'mn_userapp\',\'pos\':\'43!\',\'ctrlclass\':\'a\',\'duration\':2});showUserApp();})'; + $data['menunavs'][] = ''; + $data['subnavs'][$navid] = ''; + } + + if($nav['logo']) { + $navlogo = str_replace('{STATICURL}', STATICURL, $nav['logo']); + if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navlogo) && !(($valueparse = parse_url($navlogo)) && isset($valueparse['host']))) { + $navlogo = $_G['setting']['attachurl'].'common/'.$nav['logo']; + } + $data['navlogos'][$navid] = ''.$_G['setting']['bbname'].''; + } + + $purl = parse_url($nav['url']); + $getvars = array(); + if($purl['query']) { + parse_str($purl['query'], $getvars); + $data['navmns'][$purl['path']][] = array($getvars, $navid); + } elseif($purl['host']) { + $data['navdms'][strtolower($purl['host'].$purl['path'])] = $navid; + } elseif($purl['path']) { + $data['navmn'][$purl['path']] = $navid; + } + if($nav['type'] == 0) { + $domainkey = substr($purl['path'], 0, -strlen(strrchr($purl['path'], '.'))); + if(!empty($_G['setting']['domain']['app'][$domainkey]) && !in_array(strtolower($nav['title']), array('follow', 'guide', 'collection', 'blog', 'album', 'favorite', 'friend', 'share', 'doing'))) { + $nav['url'] = $_G['scheme'].'://'.$_G['setting']['domain']['app'][$domainkey]; + } + } + + $data['navs'][$id]['navid'] = $navid; + $data['navs'][$id]['level'] = $nav['level']; + $data['navs'][$id]['nav'] = "id=\"$navid\" ".($onmouseover ? 'onmouseover="'.$onmouseover.'"' : '').">$nav[name]".($nav['identifier'] == 5 && $nav['type'] == 0 ? '' : '')."fetch_all_by_navtype(1) as $nav) { + $nav['extra'] = ''; + if(!$nav['type']) { + if($nav['identifier'] == 'report') { + $nav['url'] = 'javascript:;'; + $nav['extra'] = ' onclick="showWindow(\'miscreport\', \'misc.php?mod=report&url=\'+REPORTURL);return false;"'; + } elseif($nav['identifier'] == 'archiver') { + if(!$_G['setting']['archiver']) { + continue; + } else { + $domain = $_G['setting']['domain']['app']['forum'] ? $_G['setting']['domain']['app']['forum'] : ($_G['setting']['domain']['app']['default'] ? $_G['setting']['domain']['app']['default'] : ''); + $nav['url'] = ($domain ? $_G['scheme'].'://'.$domain.'/' : '').$nav['url']; + } + } + } + $nav['code'] = ''.$nav['name'].''; + $id = $nav['type'] == 0 ? $nav['identifier'] : 100 + $nav['id']; + $data['footernavs'][$id] = array('available' => $nav['available'], 'navname' => $nav['name'], 'code' => $nav['code'], 'type' => $nav['type'], 'level' => $nav['level'], 'id' => $nav['identifier']); + } + return $data['footernavs']; +} + +function get_cachedata_mfindnav() { + global $_G; + + $data['mfindnavs'] = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype(5) as $nav) { + $nav['extra'] = ''; + $id = $nav['type'] == 0 ? $nav['identifier'] : 100 + $nav['id']; + $data['mfindnavs'][$id] = array('available' => $nav['available'], 'navname' => $nav['name'], 'url' => $nav['url'], 'name' => $nav['name'], 'type' => $nav['type'], 'level' => $nav['level'], 'id' => $nav['identifier']); + } + return $data['mfindnavs']; +} + +function get_cachedata_spacenavs() { + global $_G; + $data['spacenavs'] = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype(2) as $nav) { + if($nav['available'] < 0) { + continue; + } + if($nav['icon']) { + $navicon = str_replace('{STATICURL}', STATICURL, $nav['icon']); + if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navicon) && !(($valueparse = parse_url($navicon)) && isset($valueparse['host']))) { + $navicon = $_G['setting']['attachurl'].'common/'.$nav['icon'].'?'.random(6); + } + $nav['icon'] = ''; + } + $nav['allowsubnew'] = 1; + if(!$nav['subname'] || !$nav['suburl'] || substr($nav['subname'], 0, 1) == "\t") { + $nav['allowsubnew'] = 0; + $nav['subname'] = substr($nav['subname'], 1); + } + $nav['extra'] = ''; + if(!$nav['type'] && ($nav['identifier'] == 'magic' && !$_G['setting']['magicstatus'] || $nav['identifier'] == 'medal' && !$_G['setting']['medalstatus'])) { + continue; + } + if(!$nav['type'] && $nav['allowsubnew']) { + if($nav['identifier'] == 'share') { + $nav['extra'] = ' onclick="showWindow(\'share\', this.href, \'get\', 0);return false;"'; + } elseif($nav['identifier'] == 'thread') { + $nav['extra'] = ' onclick="showWindow(\'nav\', this.href);return false;"'; + } elseif($nav['identifier'] == 'thread') { + $nav['extra'] = ' onclick="showWindow(\'nav\', this.href);return false;"'; + } elseif($nav['identifier'] == 'activity') { + if($_G['setting']['activityforumid']) { + $nav['suburl'] = 'forum.php?mod=post&action=newthread&fid='.$_G['setting']['activityforumid'].'&special=4'; + } else { + $nav['extra'] = ' onclick="showWindow(\'nav\', this.href);return false;"'; + } + } elseif($nav['identifier'] == 'poll') { + if($_G['setting']['pollforumid']) { + $nav['suburl'] = 'forum.php?mod=post&action=newthread&fid='.$_G['setting']['pollforumid'].'&special=1'; + } else { + $nav['extra'] = ' onclick="showWindow(\'nav\', this.href);return false;"'; + } + } elseif($nav['identifier'] == 'reward') { + if($_G['setting']['rewardforumid']) { + $nav['suburl'] = 'forum.php?mod=post&action=newthread&fid='.$_G['setting']['rewardforumid'].'&special=3'; + } else { + $nav['extra'] = ' onclick="showWindow(\'nav\', this.href);return false;"'; + } + } elseif($nav['identifier'] == 'debate') { + if($_G['setting']['debateforumid']) { + $nav['suburl'] = 'forum.php?mod=post&action=newthread&fid='.$_G['setting']['debateforumid'].'&special=5'; + } else { + $nav['extra'] = ' onclick="showWindow(\'nav\', this.href);return false;"'; + } + } elseif($nav['identifier'] == 'trade') { + if($_G['setting']['tradeforumid']) { + $nav['suburl'] = 'forum.php?mod=post&action=newthread&fid='.$_G['setting']['tradeforumid'].'&special=2'; + } else { + $nav['extra'] = ' onclick="showWindow(\'nav\', this.href);return false;"'; + } + } elseif($nav['identifier'] == 'credit') { + $nav['allowsubnew'] = $_G['setting']['ec_ratio'] && payment::enable(); + } + } + $nav['subcode'] = $nav['allowsubnew'] ? ''.$nav['subname'].'' : ''; + if($nav['name'] != '{hr}') { + $nav['code'] = '
  • '.$nav['subcode'].''.$nav['icon'].$nav['name'].'
  • '; + } else { + $nav['code'] = '
      '; + } + $id = $nav['type'] == 0 ? $nav['identifier'] : 100 + $nav['id']; + $data['spacenavs'][$id] = array('available' => $nav['available'], 'navname' => $nav['name'], 'code' => $nav['code'], 'level' => $nav['level']); + } + return $data['spacenavs']; +} + +function get_cachedata_mynavs() { + global $_G; + + $data['mynavs'] = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype(3) as $nav) { + if($nav['available'] < 0) { + continue; + } + if($nav['icon']) { + $navicon = str_replace('{STATICURL}', STATICURL, $nav['icon']); + if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navicon) && !(($valueparse = parse_url($navicon)) && isset($valueparse['host']))) { + $navicon = $_G['setting']['attachurl'].'common/'.$nav['icon'].'?'.random(6); + } + $navicon = preg_match('/^(https?:)?\/\//i', $navicon) ? $navicon : $_G['siteurl'].$navicon; + $nav['icon'] = ' style="background-image:url('.$navicon.') !important"'; + } + $nav['code'] = ''.$nav['name'].''; + $id = $nav['type'] == 0 ? $nav['identifier'] : 100 + $nav['id']; + $data['mynavs'][$id] = array('available' => $nav['available'], 'navname' => $nav['name'], 'code' => $nav['code'], 'level' => $nav['level']); + } + return $data['mynavs']; +} + +function get_cachedata_topnav() { + global $_G; + + $data['topnavs'] = array(); + foreach(C::t('common_nav')->fetch_all_by_navtype(4) as $nav) { + $nav['extra'] = ''; + if(!$nav['type']) { + if($nav['identifier'] == 'sethomepage') { + $nav['url'] = 'javascript:;'; + $nav['extra'] = ' onclick="setHomepage(\''.$_G['siteurl'].'\');"'; + } elseif($nav['identifier'] == 'setfavorite') { + $nav['url'] = $_G['siteurl']; + $nav['extra'] = ' onclick="addFavorite(this.href, \''.addslashes($_G['setting']['bbname']).'\');return false;"'; + } + } + $nav['code'] = ''.$nav['name'].''; + $id = $nav['type'] == 0 ? $nav['identifier'] : 100 + $nav['id']; + $data['topnavs'][$nav['subtype']][$id] = array('available' => $nav['available'], 'navname' => $nav['name'], 'code' => $nav['code'], 'type' => $nav['type'], 'level' => $nav['level'], 'id' => $nav['identifier']); + } + return $data['topnavs']; +} + +function get_cachedata_threadprofile() { + global $_G; + if(!helper_dbtool::isexisttable('forum_threadprofile')) { + return; + } + $threadprofiles = C::t('forum_threadprofile')->fetch_all_threadprofile(); + $threadprofile_group = C::t('forum_threadprofile_group')->fetch_all_threadprofile(); + $data = array(); + foreach($threadprofiles as $id => $threadprofile) { + if($threadprofile['global']) { + $data['template'][0] = dunserialize($threadprofile['template']); + } + } + foreach($threadprofile_group as $group) { + if($threadprofiles[$group['tpid']]) { + $id = $threadprofiles[$group['tpid']]['global'] ? 0 : $group['tpid']; + if(!isset($data['template'][$id])) { + $data['template'][$id] = dunserialize($threadprofiles[$group['tpid']]['template']); + } + if($id) { + $data['groupid'][$group['gid']] = $id; + } + } + } + foreach($data['template'] as $id => $template) { + foreach($template as $type => $row) { + $data['template'][$id][$type] = preg_replace_callback( + '/\{([\w:]+)(=([^}]+?))?\}(([^}]+?)\{\*\}([^}]+?)\{\/\\1\})?/s', + function ($matches) use ($id, $type) { + return get_cachedata_threadprofile_nodeparse(intval($id), ''.addslashes($type).'', $matches[1], $matches[5], $matches[6], $matches[3]); + }, + $template[$type] + ); + } + } + $data['code'] = $_G['cachedata_threadprofile_code']; + return $data; +} + +function get_cachedata_threadprofile_nodeparse($id, $type, $name, $s, $e, $extra) { + $s = stripslashes($s); + $e = stripslashes($e); + $extra = stripslashes($extra); + global $_G; + $hash = random(8); + $_G['cachedata_threadprofile_code'][$id][$type]['{'.$hash.'}'] = array($name, $s, $e, $extra); + return '{'.$hash.'}'; +} + +function get_cachedata_discuzcode_parseflv() { + $mediadir = DISCUZ_ROOT.'./source/function/media'; + $parseflv = array(); + if(file_exists($mediadir)) { + $mediadirhandle = dir($mediadir); + while($entry = $mediadirhandle->read()) { + if(!in_array($entry, array('.', '..')) && preg_match("/^media\_([\_\w]+)\.php$/", $entry, $entryr) && substr($entry, -4) == '.php' && is_file($mediadir.'/'.$entry)) { + $checkurl = array(); + @include_once libfile('media/'.$entryr[1], 'function'); + $parseflv[$entryr[1]] = $checkurl; + } + } + } + return $parseflv; +} + +function writetojscache() { + $dir = DISCUZ_ROOT.'static/js/'; + $dh = opendir($dir); + $remove = array( + array( + '/(^|\r|\n)\/\*.+?\*\/(\r|\n)/is', + "/([^\\\:]{1})\/\/.+?(\r|\n)/", + '/\/\/note.+?(\r|\n)/i', + '/\/\/debug.+?(\r|\n)/i', + '/(^|\r|\n)(\s|\t)+/', + '/(\r|\n)/', + ), array( + '', + '\1', + '', + '', + '', + '', + )); + while(($entry = readdir($dh)) !== false) { + if(fileext($entry) == 'js' && filesize($dir.$entry)) { + $jsfile = $dir.$entry; + $fp = fopen($jsfile, 'r'); + $jsdata = fread($fp, filesize($jsfile)); + fclose($fp); + $jsdata = preg_replace($remove[0], $remove[1], $jsdata); + if(file_put_contents(DISCUZ_ROOT.'./data/cache/'.$entry, $jsdata, LOCK_EX) === false) { + exit('Can not write to cache files, please check directory ./data/ and ./data/cache/ .'); + } + } + } +} + +function pluginmodulecmp($a, $b) { + return $a['displayorder'] > $b['displayorder'] ? 1 : -1; +} + +function parsehighlight($highlight) { + if($highlight) { + $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray'); + $string = sprintf('%02d', $highlight); + $stylestr = sprintf('%03b', $string[0]); + + $style = ' style="'; + $style .= $stylestr[0] ? 'font-weight: bold;' : ''; + $style .= $stylestr[1] ? 'font-style: italic;' : ''; + $style .= $stylestr[2] ? 'text-decoration: underline;' : ''; + $style .= $string[1] ? 'color: '.$colorarray[$string[1]] : ''; + $style .= '"'; + } else { + $style = ''; + } + return $style; +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_smileycodes.php b/source/function/cache/cache_smileycodes.php new file mode 100644 index 0000000..4197405 --- /dev/null +++ b/source/function/cache/cache_smileycodes.php @@ -0,0 +1,27 @@ +fetch_all_by_type('smiley', 1) as $type) { + foreach(C::t('common_smiley')->fetch_all_by_type_code_typeid('smiley', $type['typeid']) as $smiley) { + if($size = @getimagesize('./static/image/smiley/'.$type['directory'].'/'.$smiley['url'])) { + $data[$smiley['id']] = $smiley['code']; + } + } + } + + savecache('smileycodes', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_smileytypes.php b/source/function/cache/cache_smileytypes.php new file mode 100644 index 0000000..0ef595f --- /dev/null +++ b/source/function/cache/cache_smileytypes.php @@ -0,0 +1,27 @@ +fetch_all_by_type('smiley', 1) as $type) { + $typeid = $type['typeid']; + unset($type['typeid']); + if(C::t('common_smiley')->count_by_type_code_typeid('smiley', $typeid)) { + $data[$typeid] = $type; + } + } + + savecache('smileytypes', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_smilies.php b/source/function/cache/cache_smilies.php new file mode 100644 index 0000000..59bdf4d --- /dev/null +++ b/source/function/cache/cache_smilies.php @@ -0,0 +1,27 @@ + array(), 'replacearray' => array(), 'typearray' => array()); + foreach(C::t('common_smiley')->fetch_all_cache() as $smiley) { + $data['searcharray'][$smiley['id']] = '/'.preg_quote(dhtmlspecialchars($smiley['code']), '/').'/'; + $data['replacearray'][$smiley['id']] = $smiley['url']; + $data['typearray'][$smiley['id']] = $smiley['typeid']; + } + + savecache('smilies', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_smilies_js.php b/source/function/cache/cache_smilies_js.php new file mode 100644 index 0000000..0861020 --- /dev/null +++ b/source/function/cache/cache_smilies_js.php @@ -0,0 +1,62 @@ +fetch_setting('fastsmiley', true); + $return_type = 'var smilies_type = new Array();'; + $return_array = 'var smilies_array = new Array();var smilies_fast = new Array();'; + $spp = $_G['setting']['smcols'] * $_G['setting']['smrows']; + $fpre = ''; + foreach(C::t('forum_imagetype')->fetch_all_by_type('smiley', 1) as $type) { + $return_data = array(); + $return_datakey = ''; + $i = 0;$j = 1;$pre = ''; + $return_type .= 'smilies_type[\'_'.$type['typeid'].'\'] = [\''.str_replace('\'', '\\\'', $type['name']).'\', \''.str_replace('\'', '\\\'', $type['directory']).'\'];'; + $return_datakey .= 'smilies_array['.$type['typeid'].'] = new Array();'; + foreach(C::t('common_smiley')->fetch_all_by_type_code_typeid('smiley', $type['typeid']) as $smiley) { + if($i >= $spp) { + $return_data[$j] = 'smilies_array['.$type['typeid'].']['.$j.'] = ['.$return_data[$j].'];'; + $j++;$i = 0;$pre = ''; + } + if($size = @getimagesize(DISCUZ_ROOT.'./static/image/smiley/'.$type['directory'].'/'.$smiley['url'])) { + $smiley['code'] = str_replace('\'', '\\\'', $smiley['code']); + $smileyid = $smiley['id']; + $s = smthumb($size, $_G['setting']['smthumb']); + $smiley['w'] = $s['w']; + $smiley['h'] = $s['h']; + $l = smthumb($size); + $smiley['lw'] = $l['w']; + unset($smiley['id'], $smiley['directory']); + $return_data[$j] .= $pre.'[\''.$smileyid.'\', \''.$smiley['code'].'\',\''.str_replace('\'', '\\\'', $smiley['url']).'\',\''.$smiley['w'].'\',\''.$smiley['h'].'\',\''.$smiley['lw'].'\']'; + if(is_array($fastsmiley[$type['typeid']]) && in_array($smileyid, $fastsmiley[$type['typeid']])) { + $return_fast .= $fpre.'[\''.$type['typeid'].'\',\''.$j.'\',\''.$i.'\']'; + $fpre = ','; + } + $pre = ','; + } + $i++; + } + $return_data[$j] = 'smilies_array['.$type['typeid'].']['.$j.'] = ['.$return_data[$j].'];'; + $return_array .= $return_datakey.implode('', $return_data); + } + $cachedir = DISCUZ_ROOT.'./data/cache/'; + $common_smilies_var_js = 'var smthumb = \''.$_G['setting']['smthumb'].'\';'.$return_type.$return_array.'var smilies_fast=['.$return_fast.'];'; + if(file_put_contents($cachedir.'common_smilies_var.js', $common_smilies_var_js, LOCK_EX) === false) { + exit('Can not write to cache files, please check directory ./data/ and ./data/cache/ .'); + } + +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_split.php b/source/function/cache/cache_split.php new file mode 100644 index 0000000..bf81e7f --- /dev/null +++ b/source/function/cache/cache_split.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/source/function/cache/cache_stamps.php b/source/function/cache/cache_stamps.php new file mode 100644 index 0000000..4d36241 --- /dev/null +++ b/source/function/cache/cache_stamps.php @@ -0,0 +1,50 @@ +fetch_all_by_type(array('stamp','stamplist')) as $stamp) { + if(isset($fillarray[$stamp['displayorder']])) { + unset($fillarray[$stamp['displayorder']]); + } else { + $repeats[] = $stamp['id']; + } + $count++; + } + foreach($repeats as $id) { + reset($fillarray); + $displayorder = current($fillarray); + unset($fillarray[$displayorder]); + C::t('common_smiley')->update($id, array('displayorder'=>$displayorder)); + } + foreach(C::t('common_smiley')->fetch_all_by_type('stamplist') as $stamp) { + if($stamp['typeid'] < 1) { + continue; + } + $row = C::t('common_smiley')->fetch_by_id_type($stamp['typeid'], 'stamp'); + $stampicon[$row['displayorder']] = $stamp['displayorder']; + } + foreach(C::t('common_smiley')->fetch_all_by_type(array('stamp','stamplist')) as $stamp) { + $icon = $stamp['type'] == 'stamp' ? (isset($stampicon[$stamp['displayorder']]) ? $stampicon[$stamp['displayorder']] : 0) : + ($stamp['type'] == 'stamplist' && !in_array($stamp['displayorder'], $stampicon) ? 1 : 0); + $data[$stamp['displayorder']] = array('url' => $stamp['url'], 'text' => $stamp['code'], 'type' => $stamp['type'], 'icon' => $icon); + } + + savecache('stamps', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_stamptypeid.php b/source/function/cache/cache_stamptypeid.php new file mode 100644 index 0000000..a222dcb --- /dev/null +++ b/source/function/cache/cache_stamptypeid.php @@ -0,0 +1,27 @@ +fetch_all_by_type('stamp') as $stamp) { + if($stamp['typeid'] < 0) { + continue; + } + $data[$stamp['typeid']] = $stamp['displayorder']; + } + + savecache('stamptypeid', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_styles.php b/source/function/cache/cache_styles.php new file mode 100644 index 0000000..4b888d8 --- /dev/null +++ b/source/function/cache/cache_styles.php @@ -0,0 +1,153 @@ +range() as $var) { + $stylevars[$var['styleid']][$var['variable']] = $var['substitute']; + } + foreach(C::t('common_style')->fetch_all_data(true) as $data) { + $data['tpldir'] = $data['directory']; + $data = array_merge($data, (array)$stylevars[$data['styleid']]); + $datanew = array(); + $data['imgdir'] = $data['imgdir'] ? $data['imgdir'] : STATICURL.'image/common'; + $data['styleimgdir'] = $data['styleimgdir'] ? $data['styleimgdir'] : $data['imgdir']; + foreach($data as $k => $v) { + if(substr($k, -7, 7) == 'bgcolor') { + $newkey = substr($k, 0, -7).'bgcode'; + $datanew[$newkey] = setcssbackground($data, $k); + } + } + $data = array_merge($data, $datanew); + if(strstr($data['boardimg'], ',')) { + $flash = explode(",", $data['boardimg']); + $flash[0] = trim($flash[0]); + $flash[0] = preg_match('/^(https?:)?\/\//i', $flash[0]) ? $flash[0] : $data['styleimgdir'].'/'.$flash[0]; + $data['boardlogo'] = ""; + } else { + $data['boardimg'] = empty($data['boardimg']) ? $data['imgdir'].'/logo.svg' : (preg_match('/^(https?:)?\/\//i', $data['boardimg']) || file_exists(DISCUZ_ROOT.$data['boardimg']) ? '' : (file_exists(DISCUZ_ROOT.$data['styleimgdir'].'/'.$data['boardimg']) ? $data['styleimgdir'].'/' : $data['imgdir'].'/')).$data['boardimg']; + $data['boardlogo'] = "\"".$_G['setting']['bbname']."\""; + } + $data['searchimg'] = empty($data['searchimg']) ? $data['imgdir'].'/logo_sc.svg' : (preg_match('/^(https?:)?\/\//i', $data['searchimg']) || file_exists(DISCUZ_ROOT.$data['searchimg']) ? '' : (file_exists(DISCUZ_ROOT.$data['styleimgdir'].'/'.$data['searchimg']) ? $data['styleimgdir'].'/' : $data['imgdir'].'/')).$data['searchimg']; + $data['searchlogo'] = "\"".$_G['setting']['bbname']."\""; + $data['touchimg'] = empty($data['touchimg']) ? $data['imgdir'].'/logo_m.svg' : (preg_match('/^(https?:)?\/\//i', $data['touchimg']) || file_exists(DISCUZ_ROOT.$data['touchimg']) ? '' : (file_exists(DISCUZ_ROOT.$data['styleimgdir'].'/'.$data['touchimg']) ? $data['styleimgdir'].'/' : $data['imgdir'].'/')).$data['touchimg']; + $data['touchlogo'] = "\"".$_G['setting']['bbname']."\""; + $data['bold'] = $data['nobold'] ? 'normal' : 'bold'; + $contentwidthint = intval($data['contentwidth']); + $contentwidthint = $contentwidthint ? $contentwidthint : 600; + if($data['extstyle']) { + list($data['extstyle'], $data['defaultextstyle']) = explode('|', $data['extstyle']); + $extstyle = explode("\t", $data['extstyle']); + $data['extstyle'] = array(); + foreach($extstyle as $dir) { + if(file_exists($extstylefile = DISCUZ_ROOT.$data['tpldir'].'/style/'.$dir.'/style.css')) { + if($data['defaultextstyle'] == $dir) { + $data['defaultextstyle'] = $data['tpldir'].'/style/'.$dir; + } + $content = file_get_contents($extstylefile); + if(preg_match('/\[name\](.+?)\[\/name\]/i', $content, $r1) && preg_match('/\[iconbgcolor](.+?)\[\/iconbgcolor]/i', $content, $r2)) { + $data['extstyle'][] = array($data['tpldir'].'/style/'.$dir, $r1[1], $r2[1]); + } + } + } + } + $data['verhash'] = random(3); + $styledata[] = $data; + } + foreach($styledata as $data) { + savecache('style_'.$data['styleid'], $data); + if($defaultstyleid == $data['styleid']) { + savecache('style_default', $data); + } + writetocsscache($data); + } + +} + +function setcssbackground(&$data, $code) { + $codes = explode(' ', $data[$code]); + $css = $codevalue = ''; + for($i = 0; $i < count($codes); $i++) { + if($i < 2) { + if($codes[$i] != '') { + if($codes[$i][0] == '#') { + $css .= strtoupper($codes[$i]).' '; + $codevalue = strtoupper($codes[$i]); + } elseif(preg_match('/^(https?:)?\/\//i', $codes[$i])) { + $css .= 'url("'.$codes[$i].'") '; + } else { + $css .= 'url("'.$data['styleimgdir'].'/'.$codes[$i].'") '; + } + } + } else { + $css .= $codes[$i].' '; + } + } + $data[$code] = $codevalue; + $css = trim($css); + return $css ? 'background: '.$css : ''; +} + +function writetocsscache($data) { + global $_G; + $dir = DISCUZ_ROOT.'./template/default/common/'; + $dh = opendir($dir); + $data['staticurl'] = STATICURL; + while(($entry = readdir($dh)) !== false) { + if(fileext($entry) == 'css') { + $cssfile = DISCUZ_ROOT.'./'.$data['tpldir'].'/common/'.$entry; + !file_exists($cssfile) && $cssfile = $dir.$entry; + $cssdata = @implode('', file($cssfile)); + if(file_exists($cssfile = DISCUZ_ROOT.'./'.$data['tpldir'].'/common/extend_'.$entry)) { + $cssdata .= @implode('', file($cssfile)); + } + if(is_array($_G['setting']['plugins']['available']) && $_G['setting']['plugins']['available']) { + foreach($_G['setting']['plugins']['available'] as $plugin) { + if(file_exists($cssfile = DISCUZ_ROOT.'./source/plugin/'.$plugin.'/template/extend_'.$entry)) { + $cssdata .= @implode('', file($cssfile)); + } + } + } + + writetocsscache_callback_1($data, 1); + + $cssdata = preg_replace_callback("/\{([A-Z0-9]+)\}/", 'writetocsscache_callback_1', $cssdata); + $cssdata = preg_replace("/<\?.+?\?>\s*/", '', $cssdata); + $cssdata = !preg_match('/^(https?:)?\/\//i', $data['styleimgdir']) ? preg_replace("/url\(([\"'])?".preg_quote($data['styleimgdir'], '/')."/i", "url(\\1{$_G['siteurl']}{$data['styleimgdir']}", $cssdata) : $cssdata; + $cssdata = !preg_match('/^(https?:)?\/\//i', $data['imgdir']) ? preg_replace("/url\(([\"'])?".preg_quote($data['imgdir'], '/')."/i", "url(\\1{$_G['siteurl']}{$data['imgdir']}", $cssdata) : $cssdata; + $cssdata = !preg_match('/^(https?:)?\/\//i', $data['staticurl']) ? preg_replace("/url\(([\"'])?".preg_quote($data['staticurl'], '/')."/i", "url(\\1{$_G['siteurl']}{$data['staticurl']}", $cssdata) : $cssdata; + if($entry == 'module.css') { + $cssdata = preg_replace('/\/\*\*\s*(.+?)\s*\*\*\//', '[\\1]', $cssdata); + } + $cssdata = preg_replace(array('/\s*([,;:\{\}])\s*/', '/[\t\n\r]/', '/\/\*.+?\*\//'), array('\\1', '',''), $cssdata); + if(file_put_contents(DISCUZ_ROOT.'./data/cache/style_'.$data['styleid'].'_'.$entry, $cssdata, LOCK_EX) === false) { + exit('Can not write to cache files, please check directory ./data/ and ./data/cache/ .'); + } + } + } +} + +function writetocsscache_callback_1($matches, $action = 0) { + static $data = array(); + + if($action == 1) { + $data = $matches; + } else { + return $data[strtolower($matches[1])]; + } +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_threadsorts.php b/source/function/cache/cache_threadsorts.php new file mode 100644 index 0000000..0e94e13 --- /dev/null +++ b/source/function/cache/cache_threadsorts.php @@ -0,0 +1,102 @@ +fetch_all_for_cache(); + foreach($query as $data) { + $data['rules'] = dunserialize($data['rules']); + $sortid = $data['sortid']; + $optionid = $data['optionid']; + $sortlist[$sortid][$optionid] = array( + 'title' => dhtmlspecialchars($data['title']), + 'type' => dhtmlspecialchars($data['type']), + 'unit' => dhtmlspecialchars($data['unit']), + 'identifier' => dhtmlspecialchars($data['identifier']), + 'description' => dhtmlspecialchars($data['description']), + 'permprompt' => $data['permprompt'], + 'required' => intval($data['required']), + 'unchangeable' => intval($data['unchangeable']), + 'search' => intval($data['search']), + 'subjectshow' => intval($data['subjectshow']), + 'expiration' => intval($data['expiration']), + 'protect' => dunserialize($data['protect']), + ); + + if(in_array($data['type'], array('select', 'checkbox', 'radio'))) { + if($data['rules']['choices']) { + $choices = array(); + foreach(explode("\n", $data['rules']['choices']) as $item) { + list($index, $choice) = explode('=', $item); + $choices[trim($index)] = trim($choice); + } + $sortlist[$sortid][$optionid]['choices'] = $choices; + } else { + $sortlist[$sortid][$optionid]['choices'] = array(); + } + if($data['type'] == 'select') { + $sortlist[$sortid][$optionid]['inputsize'] = $data['rules']['inputsize'] ? intval($data['rules']['inputsize']) : 108; + } + } elseif(in_array($data['type'], array('text', 'textarea', 'calendar'))) { + $sortlist[$sortid][$optionid]['maxlength'] = intval($data['rules']['maxlength']); + if($data['type'] == 'textarea') { + $sortlist[$sortid][$optionid]['rowsize'] = $data['rules']['rowsize'] ? intval($data['rules']['rowsize']) : 5; + $sortlist[$sortid][$optionid]['colsize'] = $data['rules']['colsize'] ? intval($data['rules']['colsize']) : 50; + } else { + $sortlist[$sortid][$optionid]['inputsize'] = $data['rules']['inputsize'] ? intval($data['rules']['inputsize']) : ''; + } + if(in_array($data['type'], array('text', 'textarea'))) { + $sortlist[$sortid][$optionid]['defaultvalue'] = $data['rules']['defaultvalue']; + } + if($data['type'] == 'text') { + $sortlist[$sortid][$optionid]['profile'] = $data['rules']['profile']; + } + } elseif($data['type'] == 'image') { + $sortlist[$sortid][$optionid]['maxwidth'] = intval($data['rules']['maxwidth']); + $sortlist[$sortid][$optionid]['maxheight'] = intval($data['rules']['maxheight']); + $sortlist[$sortid][$optionid]['inputsize'] = $data['rules']['inputsize'] ? intval($data['rules']['inputsize']) : ''; + } elseif(in_array($data['type'], array('number', 'range'))) { + $sortlist[$sortid][$optionid]['inputsize'] = $data['rules']['inputsize'] ? intval($data['rules']['inputsize']) : ''; + $sortlist[$sortid][$optionid]['maxnum'] = intval($data['rules']['maxnum']); + $sortlist[$sortid][$optionid]['minnum'] = intval($data['rules']['minnum']); + if($data['rules']['searchtxt']) { + $sortlist[$sortid][$optionid]['searchtxt'] = explode(',', $data['rules']['searchtxt']); + } + if($data['type'] == 'number') { + $sortlist[$sortid][$optionid]['defaultvalue'] = $data['rules']['defaultvalue']; + } + } + } + $query = C::t('forum_threadtype')->range(); + foreach($query as $data) { + $templatedata[$data['typeid']] = addcslashes($data['template'], '",\\'); + $stemplatedata[$data['typeid']] = addcslashes($data['stemplate'], '",\\'); + $ptemplatedata[$data['typeid']] = addcslashes($data['ptemplate'], '",\\'); + $btemplatedata[$data['typeid']] = addcslashes($data['btemplate'], '",\\'); + } + + $data['sortoption'] = $data['template'] = array(); + + foreach($sortlist as $sortid => $option) { + $template['viewthread'] = $templatedata[$sortid]; + $template['subject'] = $stemplatedata[$sortid]; + $template['post'] = $ptemplatedata[$sortid]; + $template['block'] = $btemplatedata[$sortid]; + + savecache('threadsort_option_'.$sortid, $option); + savecache('threadsort_template_'.$sortid, $template); + } + +} + +?> \ No newline at end of file diff --git a/source/function/cache/cache_updatediytemplate.php b/source/function/cache/cache_updatediytemplate.php new file mode 100644 index 0000000..a71d4f5 --- /dev/null +++ b/source/function/cache/cache_updatediytemplate.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/source/function/cache/cache_usergroups.php b/source/function/cache/cache_usergroups.php new file mode 100644 index 0000000..ce742da --- /dev/null +++ b/source/function/cache/cache_usergroups.php @@ -0,0 +1,81 @@ +fetch_all_fields(null, array('groupid', 'readaccess', 'allowgetattach', 'allowgetimage', 'allowmediacode', 'maxsigsize', 'allowbegincode')); + + foreach(C::t('common_usergroup')->range_orderby_creditshigher() as $key=>$value) { + $group = array_merge(array('groupid' => $value['groupid'], 'type' => $value['type'], 'grouptitle' => $value['grouptitle'], 'creditshigher' => $value['creditshigher'], 'creditslower' => $value['creditslower'], 'stars' => $value['stars'], 'color' => $value['color'], 'icon' => $value['icon'], 'system' => $value['system']), $data_uf[$key]); + if($group['type'] == 'special') { + if($group['system'] != 'private') { + list($dailyprice) = explode("\t", $group['system']); + $group['pubtype'] = $dailyprice > 0 ? 'buy' : 'free'; + } + } + unset($group['system']); + $groupid = $group['groupid']; + $group['grouptitle'] = $group['color'] ? ''.$group['grouptitle'].'' : $group['grouptitle']; + if($_G['setting']['userstatusby'] == 1) { + $group['userstatusby'] = 1; + } elseif($_G['setting']['userstatusby'] == 2) { + if($group['type'] != 'member') { + $group['userstatusby'] = 1; + } else { + $group['userstatusby'] = 2; + } + } + if($group['type'] != 'member') { + unset($group['creditshigher'], $group['creditslower']); + } + unset($group['groupid']); + $data[$groupid] = $group; + } + savecache('usergroups', $data); + + build_cache_usergroups_single(); + + foreach(C::t('common_admingroup')->range() as $data) { + savecache('admingroup_'.$data['admingid'], $data); + } +} + +function build_cache_usergroups_single() { + $pluginvalue = pluginsettingvalue('groups'); + $allowthreadplugin = C::t('common_setting')->fetch_setting('allowthreadplugin', true); + + $data_uf = C::t('common_usergroup_field')->range(); + $data_ag = C::t('common_admingroup')->range(); + foreach(C::t('common_usergroup')->range() as $gid => $data) { + $data = array_merge($data, (array)$data_uf[$gid], (array)$data_ag[$gid]); + $ratearray = array(); + if($data['raterange']) { + foreach(explode("\n", $data['raterange']) as $rating) { + $rating = explode("\t", $rating); + $ratearray[$rating[0]] = array('isself' => $rating[1], 'min' => $rating[2], 'max' => $rating[3], 'mrpd' => $rating[4]); + } + } + $data['raterange'] = $ratearray; + $data['grouptitle'] = $data['color'] ? ''.$data['grouptitle'].'' : $data['grouptitle']; + $data['grouptype'] = $data['type']; + $data['grouppublic'] = $data['system'] != 'private'; + $data['groupcreditshigher'] = $data['creditshigher']; + $data['groupcreditslower'] = $data['creditslower']; + $data['maxspacesize'] = intval($data['maxspacesize']) * 1024 * 1024; + $data['allowthreadplugin'] = !empty($allowthreadplugin[$data['groupid']]) ? $allowthreadplugin[$data['groupid']] : array(); + $data['plugin'] = $pluginvalue[$data['groupid']]; + unset($data['type'], $data['system'], $data['creditshigher'], $data['creditslower'], $data['groupavatar'], $data['admingid']); + savecache('usergroup_'.$data['groupid'], $data); + } +} \ No newline at end of file diff --git a/source/function/cache/cache_userstats.php b/source/function/cache/cache_userstats.php new file mode 100644 index 0000000..c8631f1 --- /dev/null +++ b/source/function/cache/cache_userstats.php @@ -0,0 +1,28 @@ +count(); + $member = C::t('common_member')->range(0, 1, 'DESC'); + $member = current($member); + $newsetuser = $member['username']; + $data = array('totalmembers' => $totalmembers, 'newsetuser' => $newsetuser); + if($_G['setting']['plugins']['func'][HOOKTYPE]['cacheuserstats']) { + $_G['userstatdata'] = & $data; + hookscript('cacheuserstats', 'global', 'funcs', array(), 'cacheuserstats'); + } + savecache('userstats', $data); +} + +?> \ No newline at end of file diff --git a/source/function/cache/index.htm b/source/function/cache/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/function/function_admincp.php b/source/function/function_admincp.php new file mode 100644 index 0000000..0f15fed --- /dev/null +++ b/source/function/function_admincp.php @@ -0,0 +1,1502 @@ + $b['filemtime']) ? 1 : -1; +} + +function checkpermission($action, $break = 1) { + global $_G; + if(!isset($_G['config']['admincp'])) { + cpmsg('action_access_noexists', '', 'error'); + } elseif($break && !$_G['config']['admincp'][$action]) { + cpmsg('action_noaccess_config', '', 'error'); + } else { + return $_G['config']['admincp'][$action]; + } +} + +function upgradeinformation($status = 0) { + global $_G, $upgrade_step; + + if(empty($upgrade_step)) { + return ''; + } + + $update = array(); + $siteuniqueid = C::t('common_setting')->fetch_setting('siteuniqueid'); + + $update['uniqueid'] = $siteuniqueid; + $update['curversion'] = $upgrade_step['curversion']; + $update['currelease'] = $upgrade_step['currelease']; + $update['upgradeversion'] = $upgrade_step['version']; + $update['upgraderelease'] = $upgrade_step['release']; + $update['step'] = $upgrade_step['step'] == 'dbupdate' ? 4 : $upgrade_step['step']; + $update['status'] = $status; + + $data = ''; + foreach($update as $key => $value) { + $data .= $key.'='.rawurlencode($value).'&'; + } + + $upgradeurl = 'ht'.'tp:/'.'/cus'.'tome'.'r.disc'.'uz.n'.'et/upg'.'rade'.'.p'.'hp?'.'os=dx&update='.rawurlencode(base64_encode($data)).'×tamp='.TIMESTAMP; + return ''; +} + +function isfounder($user = '') { + $user = empty($user) ? getglobal('member') : $user; + return $GLOBALS['admincp']->checkfounder($user); +} + + +function cplang($name, $replace = array(), $output = false) { + global $_G; + $ret = ''; + + if(!isset($_G['lang']['admincp'])) { + lang('admincp'); + } + if(!isset($_G['lang']['admincp_menu'])) { + lang('admincp_menu'); + } + if(!isset($_G['lang']['admincp_msg'])) { + lang('admincp_msg'); + } + + if(isset($_G['lang']['admincp'][$name])) { + $ret = $_G['lang']['admincp'][$name]; + } elseif(isset($_G['lang']['admincp_menu'][$name])) { + $ret = $_G['lang']['admincp_menu'][$name]; + } elseif(isset($_G['lang']['admincp_msg'][$name])) { + $ret = $_G['lang']['admincp_msg'][$name]; + } + $ret = $ret ? $ret : ($replace === false ? '' : $name); + if($replace && is_array($replace)) { + $s = $r = array(); + foreach($replace as $k => $v) { + $s[] = '{'.$k.'}'; + $r[] = $v; + } + $ret = str_replace($s, $r, $ret); + } + $output && print($ret); + return $ret; +} + +function admincustom($title, $url, $sort = 0) { + global $_G; + $url = ADMINSCRIPT.'?'.$url; + $id = C::t('common_admincp_cmenu')->fetch_id_by_uid_sort_url($_G['uid'], $sort, $url); + if($id) { + C::t('common_admincp_cmenu')->update($id, array('title' => $title, 'dateline' => $_G['timestamp'])); + C::t('common_admincp_cmenu')->increase_clicks($id); + } else { + $id = C::t('common_admincp_cmenu')->insert(array( + 'title' => $title, + 'url' => $url, + 'sort' => $sort, + 'uid' => $_G['uid'], + 'dateline' => $_G['timestamp'], + ), true); + } + return $id; +} + +function cpurl($type = 'parameter', $filters = array('sid', 'frames')) { + parse_str($_SERVER['QUERY_STRING'], $getarray); + $extra = $and = ''; + foreach($getarray as $key => $value) { + if(!in_array($key, $filters)) { + $extra .= $and.$key.($type == 'parameter' ? '%3D' : '=').rawurlencode((string)$value); + $and = $type == 'parameter' ? '%26' : '&'; + } + } + return $extra; +} + + +function showheader($key, $url) { + if(!preg_match('/^https?:\/\//is', $url)) { + list($action, $operation, $do) = explode('_', $url.'___'); + $url = ADMINSCRIPT.'?action='.$action.($operation ? '&operation='.$operation.($do ? '&do='.$do : '') : ''); + } + $menuname = cplang('header_'.$key) != 'header_'.$key ? cplang('header_'.$key) : $key; + echo '
    • '; +} + + +function showleftheader($key) { + $menuname = cplang('header_'.$key) != 'header_'.$key ? cplang('header_'.$key) : $key; + echo ''.$menuname.''; +} + +function shownav($header = '', $menu = '', $nav = '') { + global $action, $operation; + + $title = 'cplog_'.$action.($operation ? '_'.$operation : ''); + if(in_array($action, array('home', 'custommenu'))) { + $customtitle = ''; + } elseif(cplang($title, false)) { + $customtitle = $title; + } elseif(cplang('nav_'.($header ? $header : 'index'), false)) { + $customtitle = 'nav_'.$header; + } else { + $customtitle = rawurlencode($nav ? $nav : ($menu ? $menu : '')); + } + $title = cplang('header_'.($header ? $header : 'index')).($menu ? ' » '.cplang($menu) : '').($nav ? ' » '.cplang($nav) : ''); + $ctitle = cplang('header_'.($header ? $header : 'index')); + if($menu) { + $ctitle = cplang($menu); + } + if($nav) { + $ctitle = cplang($nav); + } + $addtomenu = "  [+]"; + $dtitle = str_replace("'", "\'", cplang('admincp_title').' - '.str_replace(' » ', ' - ', $title)); + echo ''; +} + +function showmenu($key, $menus, $return = 0) { + global $_G; + $body = ''; + $topMenu_now = false; + $action_now = isset($_GET['action']) ? $_GET['action'] : ''; + $operation_now = isset($_GET['operation']) ? $_GET['operation'] : ''; + $do_now = isset($_GET['do']) ? $_GET['do'] : ''; + $menu_now = $action_now.($operation_now ? '_'.$operation_now : '').($do_now ? '_'.$do_now : ''); + if(is_array($menus)) { + foreach($menus as $menu) { + if($menu[0] && $menu[1]) { + if(strpos($menu[1], 'plugins&operation=config') === false && substr($menu[1], 0, 4) != 'http'){ + list($action, $operation, $do) = explode('_', $menu[1]); + $active = ''; + if($menu[1] == $menu_now) { + $topMenu_now = true; + $active = 'class="active" '; + } + $menu[1] = $action.($operation ? '&operation='.$operation.($do ? '&do='.$do : '') : ''); + } + $body .= '
    • '.cplang($menu[0]).'
    • '; + } elseif($menu[0] && $menu[2]) { + if($menu[2] == 1) { + $id = 'M'.substr(md5($menu[0]), 0, 8); + $hide = false; + if(!empty($_G['cookie']['cpmenu_'.$id])) { + $hide = true; + } + $body .= '
    • '.$menu[0].'
        '; + } + if($menu[2] == 2) { + $body .= '
    • '; + } + } + } + } + if(!$return) { + echo ''; + } else { + return $body; + } +} + +function updatemenu($key) { + @include DISCUZ_ROOT.'./source/admincp/admincp_menu.php'; + $s = showmenu($key, $menu[$key], 1); + echo ''; +} + +function cpmsg_error($message, $url = '', $extra = '', $halt = TRUE) { + return cpmsg($message, $url, 'error', array(), $extra, $halt); +} + +function cpmsg($message, $url = '', $type = '', $values = array(), $extra = '', $halt = TRUE, $cancelurl = '') { + global $_G; + $vars = explode(':', $message); + $values = is_array($values) ? $values : (array)$values; + $values['ADMINSCRIPT'] = ADMINSCRIPT; + if(count($vars) == 2) { + $message = lang('plugin/'.$vars[0], $vars[1], $values); + } else { + $message = cplang($message, $values); + } + switch($type) { + case 'download': + case 'succeed': $classname = 'infotitle2';break; + case 'error': $classname = 'infotitle3';break; + case 'loadingform': case 'loading': $classname = 'infotitle1';break; + default: $classname = 'marginbot normal';break; + } + if($url) { + $url = preg_match('/^https?:\/\//is', $url) ? $url : ADMINSCRIPT.'?'.$url; + } + $message = "

      $message

      "; + $url .= $url && !empty($_GET['scrolltop']) ? '&scrolltop='.intval($_GET['scrolltop']) : ''; + + if($type == 'form') { + $message = "
      ". + "
      $message$extra
      ". + "

        \n". + ($cancelurl ? "" : + ""). + "


      "; + } elseif($type == 'loadingform') { + $message = "

      $message$extra
      ". + '

      '.cplang('message_redirect').'


      '; + } else { + $message .= $extra.($type == 'loading' ? '' : ''); + if($url) { + if($type == 'button') { + $message = "
      $message

      "; + } else { + $message .= '

      '.cplang($type == 'download' ? 'message_download' : 'message_redirect').'

      '; + $timeout = $type != 'loading' ? 3000 : 1000; + $message .= ""; + } + } elseif($type != 'succeed') { + $message .= '

      '. + "". + '

      '; + } + } + + if($halt) { + echo '

      '.cplang('discuz_message').'

      '.$message.'
      '; + exit(); + } else { + echo '
      '.$message.'
      '; + } +} + +function cpheader() { + global $_G; + + if(!defined('DISCUZ_CP_HEADER_OUTPUT')) { + define('DISCUZ_CP_HEADER_OUTPUT', true); + } else { + return true; + } + $IMGDIR = $_G['style']['imgdir']; + $STYLEID = $_G['setting']['styleid']; + $VERHASH = $_G['style']['verhash']; + $frame = getgpc('frame') != 'no' ? 1 : 0; + $charset = CHARSET; + $staticurl = STATICURL; + $basescript = ADMINSCRIPT; + echo << + + + + + + + + + + + + + + + +
      +
      +EOT; + + if(empty($_G['inajax'])) { + register_shutdown_function('cpfooter'); + } +} + +function showsubmenu($title, $menus = array(), $right = '', $replace = array()) { + $s = '

      '.cplang($title, $replace).'

      '.$right.'
      '; + if(empty($menus)) { + $s .= '
      '; + } elseif(is_array($menus)) { + $s .= '
      '; + } + echo !empty($menus) ? '
      '.$s.'
      ' : $s; + echo '
    '; +} + +function showsubmenusteps($title, $menus = array(), $mleft = array(), $mright = array()) { + $s = '
    '.($title ? '

    '.cplang($title).'

    ' : ''); + if(is_array($mleft) && !empty($mleft)) { + $s .= ''; + } + if(is_array($menus) && !empty($menus)) { + $s .= '
      '; + $i = 0; + $ic = 1; + foreach($menus as $menu) { + $i++; + $s .= ''.$i.''.cplang($menu[0]).''; + if($menu[1]) $ic = 0; + } + $s .= '
    '; + } + if(is_array($mright) && !empty($mright)) { + $s .= ''; + } + $s .= '
    '; + echo $s; + if (!empty($title)) { + echo '
    '; + } +} + +function showsubmenuanchors($title, $menus = array(), $right = '') { + if(!$title || !$menus || !is_array($menus)) { + return; + } + echo <<var currentAnchor = '{$GLOBALS['anchor']}'; +EOT; + $s = '

    '.cplang($title).'

    '.$right.'
    '; + $s .= ''; + $s .= '
    '; + echo !empty($menus) ? '
    '.$s.'
    ' : $s; + echo '
    '; +} + +function showtips($tips, $id = 'tips', $display = TRUE, $title = '') { + $tips = cplang($tips); + $tips = preg_replace('#\s*
  • #i', '
  • ', $tips); + $tmp = explode('
  • ', substr($tips, 4, -5)); + if(count($tmp) > 4) { + $tips = '
  • '.$tmp[0].'
  • '.$tmp[1].'
  • '.cplang('tips_all').'...
  • '; + foreach($tmp AS $k => $v) { + if($k > 1) { + $tips .= '
  • '.$v.'
  • '; + } + } + } + unset($tmp); + $title = $title ? $title : 'tips'; + showtableheader($title, '', 'id="'.$id.'"'.(!$display ? ' style="display: none;"' : ''), 0); + showtablerow('', 'class="tipsblock" s="1"', '
      '.$tips.'
    '); + showtablefooter(); +} + +function showformheader($action, $extra = '', $name = 'cpform', $method = 'post') { + global $_G; + $anchor = isset($_GET['anchor']) ? dhtmlspecialchars($_GET['anchor']) : ''; + echo '
    '. + ''. + ''. + ''; +} + +function showhiddenfields($hiddenfields = array()) { + if(is_array($hiddenfields)) { + foreach($hiddenfields as $key => $val) { + $val = is_string($val) ? dhtmlspecialchars($val) : $val; + echo "\n"; + } + } +} + +function showtableheader($title = '', $classname = '', $extra = '', $titlespan = 15) { + global $_G; + $classname = str_replace(array('nobottom', 'notop'), array('nobottom nobdb', 'nobdt'), $classname); + if(isset($_G['showsetting_multi'])) { + if($_G['showsetting_multi'] == 0) { + $extra .= ' style="width:'.($_G['showsetting_multicount'] * 270 + 60).'px"'; + } else { + return; + } + } + echo "\n".''; + if($title) { + $span = $titlespan ? 'colspan="'.$titlespan.'"' : ''; + echo "\n".''; + showmultititle(1); + } +} + +function showboxheader($title = '', $classname = '', $extra = '', $nobody = 0) { + global $_G; + $classname = str_replace(array('nobottom', 'notop'), array('nobottom nobdb', 'nobdt'), $classname); + echo "\n".'
    '; + if($title) { + echo "\n".'
    '.cplang($title).'
    '; + showmultititle(1); + } + if(!$nobody) { + echo "\n".'
    '; + } +} + +function showmultititle($nofloat = 0) { + global $_G; + if(isset($_G['showtableheader_multi']) && $_G['showsetting_multi'] == 0) { + $i = 0; + $rows = ''; + foreach($_G['showtableheader_multi'] as $row) { + $i++; + $rows .= '
    '.$row.'
    '; + } + if($nofloat) { + echo '
    '; + } else { + echo ''; + echo ''; + } + } +} + +function showtagheader($tagname, $id, $display = FALSE, $classname = '') { + global $_G; + if(!empty($_G['showsetting_multi'])) { + return; + } + echo '<'.$tagname.(!isset($_G['showsetting_multi']) && $classname ? " class=\"$classname\"" : '').' id="'.$id.'"'.($display ? '' : ' style="display: none"').'>'; +} + +function showtitle($title, $extra = '', $multi = 1) { + global $_G; + if(!empty($_G['showsetting_multi'])) { + return; + } + echo "\n".''; + if($multi) { + showmultititle(1); + } +} + +function showboxtitle($title, $extra = '', $multi = 1) { + global $_G; + if(!empty($_G['showsetting_multi'])) { + return; + } + echo "\n".'
    '.cplang($title).'
    '; +} + +function showsubtitle($title = array(), $rowclass='header', $tdstyle=array()) { + if(is_array($title)) { + $subtitle = "\n"; + foreach($title as $k => $v) { + if($v !== NULL) { + $subtitle .= ''.cplang($v).''; + } + } + $subtitle .= ''; + echo $subtitle; + } +} + +function showtablerow($trstyle = '', $tdstyle = array(), $tdtext = array(), $return = FALSE) { + $rowswapclass = ''; + if(!preg_match('/class\s*=\s*[\'"]([^\'"<>]+)[\'"]/i', $trstyle, $matches)) { + $rowswapclass = is_array($tdtext) && count($tdtext) > 2 ? ' class="hover"' : ''; + } else { + if(is_array($tdtext) && count($tdtext) > 2) { + $rowswapclass = " class=\"{$matches[1]} hover\""; + $trstyle = preg_replace('/class\s*=\s*[\'"]([^\'"<>]+)[\'"]/i', '', $trstyle); + } + } + $cells = "\n".''; + if(isset($tdtext)) { + if(is_array($tdtext)) { + foreach($tdtext as $key => $td) { + $cells .= ''.$td.''; + } + } else { + $cells .= ''.$tdtext.''; + } + } + $cells .= ''; + if($return) { + return $cells; + } + echo $cells; +} + +function showboxrow($trstyle = '', $tdstyle = array(), $tdtext = array(), $return = FALSE) { + $rowswapclass = ''; + if(preg_match('/class\s*=\s*[\'"]([^\'"<>]+)[\'"]/i', $trstyle, $matches)) { + $rowswapclass = $matches[1]; + $trstyle = preg_replace('/class\s*=\s*[\'"]([^\'"<>]+)[\'"]/i', '', $trstyle); + } + if(is_array($tdtext) && count($tdtext) > 2) { + $rowswapclass .= ' hover'; + } + $rowswapclass = ' class="drow'.($rowswapclass?(' '.$rowswapclass):'').'"'; + $cells = "\n".''; + if(isset($tdtext)) { + if(is_array($tdtext)) { + foreach($tdtext as $key => $td) { + $cells .= ''.$td.''; + } + } else { + $cells .= ''.$tdtext.''; + } + } + $cells .= ''; + if($return) { + return $cells; + } + echo $cells; +} +function showboxbody($class = '', $text = '', $extra = '') { + echo '
    '.$text.'
    '; +} + +function showsetting($setname, $varname, $value, $type = 'radio', $disabled = '', $hidden = 0, $comment = '', $extra = '', $setid = '', $nofaq = false, $inbox = 0) { + + global $_G; + $s = "\n"; + $check = array(); + $noborder = false; + if(is_array($disabled)) { + $hidden = $disabled['hidden']; + $comment = $disabled['comment']; + $extra = $disabled['extra']; + $setid = $disabled['setid']; + $nofaq = $disabled['nofaq']; + $inbox = $disabled['inbox']; + $disabled = $disabled['disabled']; + } + if(substr($disabled, 0, 8) == 'noborder') { + $disabled = trim(substr($disabled, 8)); + $noborder = 'class="noborder" '; + } + $check['disabled'] = $disabled ? ($disabled == 'readonly' ? ' readonly' : ' disabled') : ''; + $check['disabledaltstyle'] = $disabled ? ', 1' : ''; + + $nocomment = false; + + if(isset($_G['showsetting_multi'])) { + $hidden = 0; + if(is_array($varname)) { + $varnameid = '_'.str_replace(array('[', ']'), '_', $varname[0]).'|'.$_G['showsetting_multi']; + $varname[0] = preg_replace('/\w+new/', 'multinew['.$_G['showsetting_multi'].'][\\0]', $varname[0]); + } else { + $varnameid = '_'.str_replace(array('[', ']'), '_', $varname).'|'.$_G['showsetting_multi']; + $varname = preg_replace('/\w+new/', 'multinew['.$_G['showsetting_multi'].'][\\0]', $varname); + } + } else { + $varnameid = ''; + } + + if($type == 'radio') { + $value ? $check['true'] = "checked" : $check['false'] = "checked"; + $value ? $check['false'] = '' : $check['true'] = ''; + $check['hidden1'] = $hidden ? ' onclick="$(\'hidden_'.$setname.'\').style.display = \'\';"' : ''; + $check['hidden0'] = $hidden ? ' onclick="$(\'hidden_'.$setname.'\').style.display = \'none\';"' : ''; + $onclick = $disabled && $disabled == 'readonly' ? ' onclick="return false"' : ($extra ? $extra : ''); + $s .= '
      '. + ' '.cplang('yes').''. + ' '.cplang('no').''. + '
    '; + } elseif($type == 'text' || $type == 'password' || $type == 'number') { + $s .= ''; + } elseif($type == 'htmltext') { + $id .= 'html'.random(2); + $s .= '
    '.$value.'
    '; + } elseif($type == 'file') { + $s .= ''; + } elseif($type == 'filetext') { + $defaulttype = $value ? 1 : 0; + $id = 'file'.random(2); + $s .= ''. + '
    '. + ''.cplang('switch_upload').' '. + ''.cplang('switch_url').''; + } elseif($type == 'textarea') { + $readonly = $disabled ? 'readonly' : ''; + $s .= ""; + } elseif($type == 'select') { + $s .= ''; + } elseif($type == 'mradio' || $type == 'mradio2') { + $nocomment = $type == 'mradio2' && !isset($_G['showsetting_multi']) ? true : false; + $addstyle = $nocomment ? ' style="float: left; width: 18%"' : ''; + $ulstyle = $nocomment ? ' style="width: 900px"' : ''; + if(is_array($varname)) { + $radiocheck = array($value => ' checked'); + $s .= ''; + foreach($varname[1] as $varary) { + if(is_array($varary) && !empty($varary)) { + if(!array_key_exists(0, $varary)) { + $varary = array_values($varary); + } + $onclick = ''; + if(!isset($_G['showsetting_multi']) && !empty($varary[2])) { + foreach($varary[2] as $ctrlid => $display) { + $onclick .= '$(\''.$ctrlid.'\').style.display = \''.$display.'\';'; + } + } + $onclick && $onclick = ' onclick="'.$onclick.'"'; + $s .= ' '.$varary[1].''; + } + } + $s .= ''; + } + } elseif($type == 'mcheckbox' || $type == 'mcheckbox2') { + $nocomment = $type != 'mcheckbox2' && count($varname[1]) > 3 && !isset($_G['showsetting_multi']) ? true : false; + $addstyle = $nocomment ? ' style="float: left;'.(empty($_G['showsetting_multirow']) ? ' width: 18%;overflow: hidden;' : '').'"' : ''; + $ulstyle = $nocomment && empty($_G['showsetting_multirow']) ? ' style="width: 900px"' : ''; + $s .= '
      '; + foreach($varname[1] as $varary) { + if(is_array($varary) && !empty($varary)) { + if(!array_key_exists(0, $varary)) { + $varary = array_values($varary); + } + $onclick = !isset($_G['showsetting_multi']) && !empty($varary[2]) ? ' onclick="$(\''.$varary[2].'\').style.display = $(\''.$varary[2].'\').style.display == \'none\' ? \'\' : \'none\';"' : ''; + $checked = is_array($value) && in_array($varary[0], $value) ? ' checked' : ''; + $s .= ' '.$varary[1].''; + } + } + $s .= '
    '; + } elseif($type == 'binmcheckbox') { + $checkboxs = count($varname[1]); + $value = sprintf('%0'.$checkboxs.'b', $value);$i = 1; + $s .= '
      '; + foreach($varname[1] as $key => $var) { + if($var !== false) { + $s .= ' '.$var.''; + } + $i++; + } + $s .= '
    '; + } elseif($type == 'omcheckbox') { + $nocomment = count($varname[1]) > 3 ? true : false; + $addstyle = $nocomment ? 'style="float: left; width: 18%"' : ''; + $ulstyle = $nocomment ? 'style="width: 900px"' : ''; + $s .= '
      '; + foreach($varname[1] as $varary) { + if(is_array($varary) && !empty($varary)) { + $checked = is_array($value) && $value[$varary[0]] ? ' checked' : ''; + $s .= ' '.$varary[1].''; + } + } + $s .= '
    '; + } elseif($type == 'mselect') { + $s .= ''; + } elseif($type == 'color') { + global $stylestuff; + $preview_varname = str_replace('[', '_', str_replace(']', '', $varname)); + $code = explode(' ', $value); + $css = ''; + for($i = 0; $i <= 1; $i++) { + if($code[$i] != '') { + if($code[$i][0] == '#') { + $css .= strtoupper($code[$i]).' '; + } elseif(preg_match('/^(https?:)?\/\//i', $code[$i])) { + $css .= 'url(\''.$code[$i].'\') '; + } else { + $css .= 'url(\''.$stylestuff['imgdir']['subst'].'/'.$code[$i].'\') '; + } + } + } + $background = trim($css); + $colorid = ++$GLOBALS['coloridcount']; + $s .= "\n". + "\n$extra"; + } elseif($type == 'calendar') { + $s .= "\n"; + } elseif(in_array($type, array('multiply', 'range', 'daterange'))) { + $onclick = $type == 'daterange' ? ' onclick="showcalendar(event, this)"' : ''; + if(isset($_G['showsetting_multi'])) { + $varname[1] = preg_replace('/\w+new/', 'multinew['.$_G['showsetting_multi'].'][\\0]', $varname[1]); + } + $s .= "".($type == 'multiply' ? ' X ' : ' -- ').""; + } else { + $s .= $type; + } + $name = cplang($setname); + $name .= $name && substr($name, -1) != ':' ? ':' : ''; + $name = $disabled ? ''.$name.'' : $name; + $setid = !$setid ? substr(md5($setname), 0, 4) : $setid; + $setid = isset($_G['showsetting_multi']) ? 'S'.$setid : $setid; + if(!empty($_G['showsetting_multirow'])) { + if(empty($_G['showsetting_multirow_n'])) { + echo '
    '; + } + echo ''; + $_G['showsetting_multirow_n']++; + if($_G['showsetting_multirow_n'] == 2) { + echo ''; + $_G['showsetting_multirow_n'] = 0; + } + return; + } + if(!isset($_G['showsetting_multi'])) { + if($inbox) { + echo '
    '.$name.'
    '; + } else { + showtablerow('', 'colspan="2" class="td27" s="1"', $name); + } + } else { + if(empty($_G['showsetting_multijs'])) { + $_G['setting_JS'] .= 'var ss = new Array();'; + $_G['showsetting_multijs'] = 1; + } + if($_G['showsetting_multi'] == 0) { + showtablerow('', array('class="td27"'), array('
    ')); + $_G['setting_JS'] .= 'ss[\'D'.$setid.'\'] = new Array();'; + } + $name = preg_replace("/\r\n|\n|\r/", '\n', addcslashes($name, "'\\")); + $_G['setting_JS'] .= 'ss[\'D'.$setid.'\'] += \'
    '.$name.'
    \';'; + } + if(!$nocomment && ($type != 'omcheckbox' || $varname[2] != 'isfloat')) { + if(!isset($_G['showsetting_multi'])) { + if($inbox) { + echo '
    '.$s.'
    '.($comment ? $comment : cplang($setname.'_comment', false)).($type == 'textarea' ? '
    '.cplang('tips_textarea') : ''). + ($disabled ? '
    '.cplang($setname.'_disabled', false).'' : NULL).'
    '; + } else { + showtablerow('class="noborder" onmouseover="setfaq(this, \'faq'.$setid.'\')"', array('class="vtop rowform"', 'class="vtop tips2" s="1"'), array( + $s, + ($comment ? $comment : cplang($setname.'_comment', false)).($type == 'textarea' ? '
    '.cplang('tips_textarea') : ''). + ($disabled ? '
    '.cplang($setname.'_disabled', false).'' : NULL) + )); + } + } else { + if($_G['showsetting_multi'] == 0) { + showtablerow('class="noborder"', array('class="vtop rowform" style="width:auto"'), array( + '
    ' + )); + $_G['setting_JS'] .= 'ss[\''.$setid.'\'] = new Array();'; + } + $s = preg_replace("/\r\n|\n|\r/", '\n', addcslashes($s, "'\\")); + $_G['setting_JS'] .= 'ss[\''.$setid.'\'] += \'
    '.$s.'
    \';'; + } + } else { + showtablerow('class="noborder" onmouseover="setfaq(this, \'faq'.$setid.'\')"', array('colspan="2" class="vtop rowform"'), array($s)); + } + + if($hidden) { + showtagheader('tbody', 'hidden_'.$setname, $value, 'sub'); + } + +} + +function showmulti() { + global $_G; + $_G['setting_JS'] .= <<'; + if(is_array($items)) { + foreach($items as $value => $item) { + $list .= ' '.$item.''; + } + } + $list .= ''; + return $list; +} + +function mcheckbox($name, $items = array(), $checked = array()) { + $list = '
      '; + if(is_array($items)) { + foreach($items as $value => $item) { + $list .= ' '.$item.''; + } + } + $list .= '
    '; + return $list; +} + +function showsubmit($name = '', $value = 'submit', $before = '', $after = '', $floatright = '', $entersubmit = true) { + global $_G; + if(!empty($_G['showsetting_multi'])) { + return; + } + $str = '
    '; + $str .= $name && in_array($before, array('del', 'select_all', 'td')) ? '' : ''; + $str .= ''; + $str .= ''; + echo $str.($name && $entersubmit ? '' : ''); +} + +function showtagfooter($tagname) { + global $_G; + if(!empty($_G['showsetting_multi'])) { + return; + } + echo ''; +} + +function showtablefooter() { + global $_G; + if(!empty($_G['showsetting_multi'])) { + return; + } + echo '
    '.cplang($title).'
    '.$rows.'
    '.cplang($title).'

    '.$name.'

    '.$s.'
    '.($before != 'td' ? '' : '').''; + $str .= $floatright ? '
    '.$floatright.'
    ' : ''; + $str .= '
    '; + $str .= $before && !in_array($before, array('del', 'select_all', 'td')) ? $before.'  ' : ''; + $str .= $name ? '' : ''; + $after = $after == 'more_options' ? '' : $after; + $str = $after ? $str.(($before && $before != 'del') || $name ? '  ' : '').$after : $str; + $str .= '
    '."\n"; +} + +function showboxfooter($nobody = 0) { + global $_G; + if(!empty($_G['showsetting_multi'])) { + return; + } + echo $nobody ? '
    '."\n" : '
    '."\n"; +} + +function showformfooter() { + global $_G; + if(!empty($_G['setting_JS'])) { + echo ''; + } + + updatesession(); + + echo ''."\n"; + if($scrolltop = intval(getgpc('scrolltop'))) { + echo ''; + } +} + +function cpfooter() { + global $_G, $admincp; + if(defined('FOOTERDISABLED')) { + exit; + } + + require_once DISCUZ_ROOT.'./source/discuz_version.php'; + $version = DISCUZ_VERSION; + $charset = CHARSET; + + echo "\n
    "; + if(!empty($_GET['highlight'])) { + $kws = explode(' ', $_GET['highlight']); + echo ''; + } + + if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG && @include(libfile('function/debug'))) { + function_exists('debugmessage') && debugmessage(); + } + + echo "\n\n"; + +} + +if(!function_exists('ajaxshowheader')) { + function ajaxshowheader() { + global $_G; + ob_end_clean(); + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + header("Content-type: application/xml"); + echo "\n'; + exit(); + } +} + +function showimportdata() { + showsetting('import_type', array('importtype', array( + array('file', cplang('import_type_file'), array('importfile' => '', 'importtxt' => 'none')), + array('txt', cplang('import_type_txt'), array('importfile' => 'none', 'importtxt' => '')) + )), 'file', 'mradio'); + showtagheader('tbody', 'importfile', TRUE); + showsetting('import_file', 'importfile', '', 'file'); + showtagfooter('tbody'); + showtagheader('tbody', 'importtxt'); + showsetting('import_txt', 'importtxt', '', 'textarea'); + showtagfooter('tbody'); +} + +function getimportdata($name = '', $addslashes = 0, $ignoreerror = 0) { + global $_G; + if($_GET['importtype'] == 'file') { + $data = @implode('', file($_FILES['importfile']['tmp_name'])); + @unlink($_FILES['importfile']['tmp_name']); + } else { + if(!empty($_GET['importtxt'])) { + $data = $_GET['importtxt']; + } else { + $data = $GLOBALS['importtxt']; + } + } + require_once libfile('class/xml'); + $xmldata = xml2array($data); + if(!is_array($xmldata) || !$xmldata) { + if(!$ignoreerror) { + cpmsg(cplang('import_data_invalid').cplang($data), '', 'error'); + } else { + return array(); + } + } else { + if($name && $name != $xmldata['Title']) { + if(!$ignoreerror) { + cpmsg(cplang('import_data_typeinvalid').cplang($data), '', 'error'); + } else { + return array(); + } + } + $data = exportarray($xmldata['Data'], 0); + } + if($addslashes) { + $data = daddslashes($data, 1); + } + return $data; +} + +function exportdata($name, $filename, $data) { + global $_G; + require_once libfile('class/xml'); + $root = array( + 'Title' => $name, + 'Version' => $_G['setting']['version'], + 'Time' => dgmdate(TIMESTAMP, 'Y-m-d H:i'), + 'From' => $_G['setting']['bbname'].' ('.$_G['siteurl'].')', + 'Data' => exportarray($data, 1) + ); + $filename = strtolower(str_replace(array('!', ' '), array('', '_'), $name)).'_'.$filename.'.xml'; + $plugin_export = array2xml($root, 1); + ob_end_clean(); + dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); + dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + dheader('Cache-Control: no-cache, must-revalidate'); + dheader('Pragma: no-cache'); + dheader('Content-Encoding: none'); + dheader('Content-Length: '.strlen($plugin_export)); + dheader('Content-Disposition: attachment; filename='.$filename); + dheader('Content-Type: text/xml'); + echo $plugin_export; + define('FOOTERDISABLED' , 1); + exit(); +} + +function exportarray($array, $method) { + $tmp = $array; + if($method) { + foreach($array as $k => $v) { + if(is_array($v)) { + $tmp[$k] = exportarray($v, 1); + } else { + $uv = dunserialize($v); + if($uv && is_array($uv)) { + $tmp['__'.$k] = exportarray($uv, 1); + unset($tmp[$k]); + } else { + $tmp[$k] = $v; + } + } + } + } else { + foreach($array as $k => $v) { + if(is_array($v)) { + if(substr($k, 0, 2) == '__') { + $tmp[substr($k, 2)] = serialize(exportarray($v, 0)); + unset($tmp[$k]); + } else { + $tmp[$k] = exportarray($v, 0); + } + } else { + $tmp[$k] = $v; + } + } + } + return $tmp; +} + +function getwheres($intkeys, $strkeys, $randkeys, $likekeys, $pre='') { + + $wherearr = array(); + $urls = array(); + + foreach ($intkeys as $var) { + $value = isset($_GET[$var])?$_GET[$var]:''; + if(strlen($value)) { + $urls[] = "$var=$value"; + $var = addslashes($var); + $wherearr[] = "{$pre}{$var}='".intval($value)."'"; + } + } + + foreach ($strkeys as $var) { + $value = isset($_GET[$var])?trim($_GET[$var]):''; + if(strlen($value)) { + $urls[] = "$var=".rawurlencode($value); + $var = addslashes($var); + $value = addslashes($value); + $wherearr[] = "{$pre}{$var}='$value'"; + } + } + + foreach ($randkeys as $vars) { + $value1 = isset($_GET[$vars[1].'1'])?$vars[0]($_GET[$vars[1].'1']):''; + $value2 = isset($_GET[$vars[1].'2'])?$vars[0]($_GET[$vars[1].'2']):''; + if($value1) { + $urls[] = "{$vars[1]}1=".rawurlencode($_GET[$vars[1].'1']); + $vars[1] = addslashes($vars[1]); + $value1 = addslashes($value1); + $wherearr[] = "{$pre}{$vars[1]}>='$value1'"; + } + if($value2) { + $wherearr[] = "{$pre}{$vars[1]}<='$value2'"; + $vars[2] = addslashes($vars[2]); + $value2 = addslashes($value2); + $urls[] = "{$vars[1]}2=".rawurlencode($_GET[$vars[1].'2']); + } + } + + foreach ($likekeys as $var) { + $value = isset($_GET[$var])?stripsearchkey($_GET[$var]):''; + if(strlen($value)>1) { + $urls[] = "$var=".rawurlencode($_GET[$var]); + $var = addslashes($var); + $value = addslashes($value); + $wherearr[] = "{$pre}{$var} LIKE BINARY '%$value%'"; + } + } + + return array('wherearr'=>$wherearr, 'urls'=>$urls); +} + +function getorders($alloworders, $default, $pre='') { + $orders = array('sql'=>'', 'urls'=>array()); + if(empty($_GET['orderby']) || !in_array($_GET['orderby'], $alloworders)) { + $_GET['orderby'] = $default; + if(empty($_GET['ordersc'])) $_GET['ordersc'] = 'desc'; + } + + $orders['sql'] = " ORDER BY {$pre}{$_GET['orderby']} "; + $orders['urls'][] = "orderby={$_GET['orderby']}"; + + if(!empty($_GET['ordersc']) && $_GET['ordersc'] == 'desc') { + $orders['urls'][] = 'ordersc=desc'; + $orders['sql'] .= ' DESC '; + } else { + $orders['urls'][] = 'ordersc=asc'; + } + return $orders; +} + + +function blog_replynum_stat($start, $perpage) { + global $_G; + + $next = false; + $updates = array(); + $query = C::t('home_blog')->range_blog($start, $perpage); + foreach($query as $value) { + $next = true; + $count = C::t('home_comment')->count_by_id_idtype($value['blogid'], 'blogid'); + if($count != $value['replynum']) { + $updates[$value['blogid']] = $count; + } + } + if(empty($updates)) return $next; + + $nums = renum($updates); + foreach ($nums[0] as $count) { + C::t('home_blog')->update($nums[1][$count], array('replynum' => $count)); + } + return $next; +} + +function space_friendnum_stat($start, $perpage) { + global $_G; + + $next = false; + $updates = array(); + foreach(C::t('common_member_count')->range($start,$perpage) as $uid => $value) { + $next = true; + $count = C::t('home_friend')->count_by_uid($value['uid']); + if($count != $value['friends']) { + $updates[$value['uid']] = $count; + } + } + if(empty($updates)) return $next; + + $nums = renum($updates); + foreach ($nums[0] as $count) { + C::t('common_member_count')->update($nums[1][$count], array('friends' => $count)); + } + return $next; +} + +function album_picnum_stat($start, $perpage) { + global $_G; + + $next = false; + $updates = array(); + $query = C::t('home_album')->range($start, $perpage); + foreach($query as $value) { + $next = true; + $count = C::t('home_pic')->check_albumpic($value['albumid']); + if($count != $value['picnum']) { + $updates[$value['albumid']] = $count; + } + } + if(empty($updates)) return $next; + + $nums = renum($updates); + foreach ($nums[0] as $count) { + C::t('home_album')->update($nums[1][$count], array('picnum' => $count)); + } + return $next; +} + +function get_custommenu() { + global $_G; + $custommenu = array(); + foreach(C::t('common_admincp_cmenu')->fetch_all_by_uid($_G['uid']) as $custom) { + $custom['url'] = substr(rawurldecode($custom['url']), strlen(ADMINSCRIPT) + 8); + $custommenu[] = array($custom['title'], $custom['url']); + } + return $custommenu; +} + +function get_pluginsetting($type) { + $pluginsetting = $pluginvalue = array(); + @include_once DISCUZ_ROOT.'./data/sysdata/cache_pluginsetting.php'; + $pluginsetting = isset($pluginsetting[$type]) ? $pluginsetting[$type] : array(); + + $varids = array(); + foreach($pluginsetting as $v) { + foreach($v['setting'] as $varid => $var) { + $varids[] = $varid; + } + } + if($varids) { + foreach(C::t('common_pluginvar')->fetch_all($varids) as $plugin) { + $values = (array)dunserialize($plugin['value']); + foreach($values as $id => $value) { + $pluginvalue[$id][$plugin['pluginvarid']] = $value; + } + } + } + + return array($pluginsetting, $pluginvalue); +} + +function set_pluginsetting($pluginvars) { + foreach($pluginvars as $varid => $value) { + $pluginvar = C::t('common_pluginvar')->fetch($varid); + $valuenew = dunserialize($pluginvar['value']); + $valuenew = is_array($valuenew) ? $valuenew : array(); + foreach($value as $k => $v) { + $valuenew[$k] = $v; + } + C::t('common_pluginvar')->update($varid, array('value' => serialize($valuenew))); + } + updatecache('plugin'); +} + +function checkformulaperm($formula) { + $formula = preg_replace('/(\{([0-9a-fA-F\.\-\:\/]+?)\})/', "'\\1'", $formula); + return checkformulasyntax( + $formula, + array('+', '-', '*', '/', '<', '<=', '==', '>=', '>', '!=', 'and', 'or'), + array('regdate', 'regday', 'regip', 'lastip', 'buyercredit', 'sellercredit', 'digestposts', 'posts', 'threads', 'oltime', 'extcredits[1-8]', 'field[\d]+'), + '\'\{[0-9a-fA-F\.\-\:\/]+\}\'' + ); +} + +function getposttableselect_admin() { + global $_G; + + loadcache('posttable_info'); + if(!empty($_G['cache']['posttable_info']) && is_array($_G['cache']['posttable_info'])) { + $posttableselect = ''; + } else { + $posttableselect = ''; + } + return $posttableselect; +} + +function rewritedata($alldata = 1) { + global $_G; + $data = array(); + if(!$alldata) { + if(is_array($_G['setting']['rewritestatus']) && in_array('portal_topic', $_G['setting']['rewritestatus'])) { + $data['search']['portal_topic'] = "/".$_G['domain']['pregxprw']['portal']."\?mod\=topic&(amp;)?topic\=([^#]+?)?\"([^\>]*)\>/"; + $data['replace']['portal_topic'] = 'rewriteoutput(\'portal_topic\', 0, $matches[1], $matches[3], $matches[4])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('portal_article', $_G['setting']['rewritestatus'])) { + $data['search']['portal_article'] = "/".$_G['domain']['pregxprw']['portal']."\?mod\=view&(amp;)?aid\=(\d+)(&page\=(\d+))?\"([^\>]*)\>/"; + $data['replace']['portal_article'] = 'rewriteoutput(\'portal_article\', 0, $matches[1], $matches[3], $matches[5], $matches[6])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('forum_forumdisplay', $_G['setting']['rewritestatus'])) { + $data['search']['forum_forumdisplay'] = "/".$_G['domain']['pregxprw']['forum']."\?mod\=forumdisplay&(amp;)?fid\=(\w+)(&page\=(\d+))?\"([^\>]*)\>/"; + $data['replace']['forum_forumdisplay'] = 'rewriteoutput(\'forum_forumdisplay\', 0, $matches[1], $matches[3], $matches[5], $matches[6])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $data['search']['forum_viewthread'] = "/".$_G['domain']['pregxprw']['forum']."\?mod\=viewthread&(amp;)?tid\=(\d+)(&extra\=(page\%3D(\d+))?)?(&page\=(\d+))?\"([^\>]*)\>/"; + $data['replace']['forum_viewthread'] = 'rewriteoutput(\'forum_viewthread\', 0, $matches[1], $matches[3], $matches[8], $matches[6], $matches[9])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('group_group', $_G['setting']['rewritestatus'])) { + $data['search']['group_group'] = "/".$_G['domain']['pregxprw']['forum']."\?mod\=group&(amp;)?fid\=(\d+)(&page\=(\d+))?\"([^\>]*)\>/"; + $data['replace']['group_group'] = 'rewriteoutput(\'group_group\', 0, $matches[1], $matches[3], $matches[5], $matches[6])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('home_space', $_G['setting']['rewritestatus'])) { + $data['search']['home_space'] = "/".$_G['domain']['pregxprw']['home']."\?mod=space&(amp;)?(uid\=(\d+)|username\=([^&]+?))\"([^\>]*)\>/"; + $data['replace']['home_space'] = 'rewriteoutput(\'home_space\', 0, $matches[1], $matches[4], $matches[5], $matches[6])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('home_blog', $_G['setting']['rewritestatus'])) { + $data['search']['home_blog'] = "/".$_G['domain']['pregxprw']['home']."\?mod=space&(amp;)?uid\=(\d+)&(amp;)?do=blog&(amp;)?id=(\d+)\"([^\>]*)\>/"; + $data['replace']['home_blog'] = 'rewriteoutput(\'home_blog\', 0, $matches[1], $matches[3], $matches[6], $matches[7])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('forum_archiver', $_G['setting']['rewritestatus'])) { + $data['search']['forum_archiver'] = "/]*)\>/"; + $data['replace']['forum_archiver'] = 'rewriteoutput(\'forum_archiver\', 0, $matches[1], $matches[2], $matches[4], $matches[5])'; + } + + if(is_array($_G['setting']['rewritestatus']) && in_array('plugin', $_G['setting']['rewritestatus'])) { + $data['search']['plugin'] = "/]*)\>/"; + $data['replace']['plugin'] = 'rewriteoutput(\'plugin\', 0, $matches[1], $matches[2], $matches[3], $matches[4], $matches[5])'; + } + } else { + $data['rulesearch']['portal_topic'] = 'topic-{name}.html'; + $data['rulereplace']['portal_topic'] = 'portal.php?mod=topic&topic={name}'; + $data['rulevars']['portal_topic']['{name}'] = '(.+)'; + + $data['rulesearch']['portal_article'] = 'article-{id}-{page}.html'; + $data['rulereplace']['portal_article'] = 'portal.php?mod=view&aid={id}&page={page}'; + $data['rulevars']['portal_article']['{id}'] = '([0-9]+)'; + $data['rulevars']['portal_article']['{page}'] = '([0-9]+)'; + + $data['rulesearch']['forum_forumdisplay'] = 'forum-{fid}-{page}.html'; + $data['rulereplace']['forum_forumdisplay'] = 'forum.php?mod=forumdisplay&fid={fid}&page={page}'; + $data['rulevars']['forum_forumdisplay']['{fid}'] = '(\w+)'; + $data['rulevars']['forum_forumdisplay']['{page}'] = '([0-9]+)'; + + $data['rulesearch']['forum_viewthread'] = 'thread-{tid}-{page}-{prevpage}.html'; + $data['rulereplace']['forum_viewthread'] = 'forum.php?mod=viewthread&tid={tid}&extra=page\%3D{prevpage}&page={page}'; + $data['rulevars']['forum_viewthread']['{tid}'] = '([0-9]+)'; + $data['rulevars']['forum_viewthread']['{page}'] = '([0-9]+)'; + $data['rulevars']['forum_viewthread']['{prevpage}'] = '([0-9]+)'; + + $data['rulesearch']['group_group'] = 'group-{fid}-{page}.html'; + $data['rulereplace']['group_group'] = 'forum.php?mod=group&fid={fid}&page={page}'; + $data['rulevars']['group_group']['{fid}'] = '([0-9]+)'; + $data['rulevars']['group_group']['{page}'] = '([0-9]+)'; + + $data['rulesearch']['home_space'] = 'space-{user}-{value}.html'; + $data['rulereplace']['home_space'] = 'home.php?mod=space&{user}={value}'; + $data['rulevars']['home_space']['{user}'] = '(username|uid)'; + $data['rulevars']['home_space']['{value}'] = '(.+)'; + + $data['rulesearch']['home_blog'] = 'blog-{uid}-{blogid}.html'; + $data['rulereplace']['home_blog'] = 'home.php?mod=space&uid={uid}&do=blog&id={blogid}'; + $data['rulevars']['home_blog']['{uid}'] = '([0-9]+)'; + $data['rulevars']['home_blog']['{blogid}'] = '([0-9]+)'; + + $data['rulesearch']['forum_archiver'] = '{action}-{value}.html'; + $data['rulereplace']['forum_archiver'] = 'index.php?action={action}&value={value}'; + $data['rulevars']['forum_archiver']['{action}'] = '(fid|tid)'; + $data['rulevars']['forum_archiver']['{value}'] = '([0-9]+)'; + + $data['rulesearch']['plugin'] = '{pluginid}-{module}.html'; + $data['rulereplace']['plugin'] = 'plugin.php?id={pluginid}:{module}'; + $data['rulevars']['plugin']['{pluginid}'] = '([a-z]+[a-z0-9_]*)'; + $data['rulevars']['plugin']['{module}'] = '([a-z0-9_\-]+)'; + } + return $data; +} + +function siteftp_form($action) { + showformheader($action); + showtableheader('cloudaddons_ftp_setting'); + showsetting('setting_attach_remote_enabled_ssl', 'siteftp[ssl]', '', 'radio'); + showsetting('setting_attach_remote_ftp_host', 'siteftp[host]', '', 'text'); + showsetting('setting_attach_remote_ftp_port', 'siteftp[port]', '21', 'text'); + showsetting('setting_attach_remote_ftp_user', 'siteftp[username]', '', 'text'); + showsetting('setting_attach_remote_ftp_pass', 'siteftp[password]', '', 'text'); + showsetting('setting_attach_remote_ftp_pasv', 'siteftp[pasv]', 0, 'radio'); + showsetting('setting_attach_ftp_dir', 'siteftp[attachdir]', '', 'text'); + showsubmit('settingsubmit'); + showtablefooter(); + showformfooter(); +} + +function siteftp_check($siteftp, $dir) { + global $_G; + $siteftp['on'] = 1; + $siteftp['password'] = authcode($siteftp['password'], 'ENCODE', md5($_G['config']['security']['authkey'])); + $ftp = & discuz_ftp::instance($siteftp); + $ftp->connect(); + $ftp->upload(DISCUZ_ROOT.'./source/discuz_version.php', $dir.'/discuz_version.php'); + if($ftp->error()) { + cpmsg('setting_ftp_remote_'.$ftp->error(), '', 'error'); + } + if(!file_exists(DISCUZ_ROOT.'./'.$dir.'/discuz_version.php')) { + cpmsg('cloudaddons_ftp_path_error', '', 'error'); + } + $ftp->ftp_delete($typedir.'/discuz_version.php'); + $_G['siteftp'] = $ftp; +} + +function siteftp_upload($readfile, $writefile) { + global $_G; + if(!isset($_G['siteftp'])) { + return; + } + $_G['siteftp']->upload($readfile, $writefile); + if($_G['siteftp']->error()) { + cpmsg('setting_ftp_remote_'.$_G['siteftp']->error(), '', 'error'); + } +} + +?> \ No newline at end of file diff --git a/source/function/function_attachment.php b/source/function/function_attachment.php new file mode 100644 index 0000000..a6c1388 --- /dev/null +++ b/source/function/function_attachment.php @@ -0,0 +1,243 @@ + 'unknown.gif', + 2 => 'binary.gif', + 3 => 'zip.gif', + 4 => 'rar.gif', + 5 => 'msoffice.gif', + 6 => 'text.gif', + 7 => 'html.gif', + 8 => 'real.gif', + 9 => 'av.gif', + 10 => 'flash.gif', + 11 => 'image.gif', + 12 => 'pdf.gif', + 13 => 'torrent.gif' + ); + + if(is_numeric($type)) { + $typeid = $type; + } else { + if(preg_match("/bittorrent|^torrent\t/", $type)) { + $typeid = 13; + } elseif(preg_match("/pdf|^pdf\t/", $type)) { + $typeid = 12; + } elseif(preg_match("/image|^(jpg|gif|png|bmp|webp)\t/", $type)) { + $typeid = 11; + } elseif(preg_match("/flash|^(swf|fla|flv|swi)\t/", $type)) { + $typeid = 10; + } elseif(preg_match("/audio|video|^(wav|mid|mp3|m3u|wma|asf|asx|vqf|mpg|mpeg|avi|wmv|mov|mp4|m4a|m4v|3gp|ogv|ogg|webm|weba|aac|flac)\t/", $type)) { + $typeid = 9; + } elseif(preg_match("/real|^(ra|rm|rv)\t/", $type)) { + $typeid = 8; + } elseif(preg_match("/htm|^(php|js|pl|cgi|asp)\t/", $type)) { + $typeid = 7; + } elseif(preg_match("/text|^(txt|rtf|wri|chm)\t/", $type)) { + $typeid = 6; + } elseif(preg_match("/word|excel|powerpoint|^(doc|xls|ppt|docx|xlsx|pptx)\t/", $type)) { + $typeid = 5; + } elseif(preg_match("/^rar\t/", $type)) { + $typeid = 4; + } elseif(preg_match("/compressed|^(zip|arj|arc|cab|lzh|lha|tar|gz|7z|xz|bz2)\t/", $type)) { + $typeid = 3; + } elseif(preg_match("/octet-stream|^(exe|com|bat|dll)\t/", $type)) { + $typeid = 2; + } elseif($type) { + $typeid = 1; + } else { + $typeid = 0; + } + } + if($returnval == 'html') { + return ''; + } elseif($returnval == 'id') { + return $typeid; + } +} + +function parseattach($attachpids, $attachtags, &$postlist, $skipaids = array()) { + global $_G, $aimgs, $firstimgs; + if(!$attachpids) { + return; + } + $attachpids = is_array($attachpids) ? $attachpids : array($attachpids); + $attachexists = FALSE; + $skipattachcode = $aids = $payaids = $findattach = array(); + foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$_G['tid'], 'pid', $attachpids) as $attach) { + $attachexists = TRUE; + if($skipaids && in_array($attach['aid'], $skipaids)) { + $skipattachcode[$attach['pid']][] = "/\[attach\]{$attach['aid']}\[\/attach\]/i"; + continue; + } + $attached = 0; + $extension = strtolower(fileext($attach['filename'])); + $attach['ext'] = $extension; + $attach['imgalt'] = $attach['isimage'] ? strip_tags(str_replace('"', '', $attach['description'] ? $attach['description'] : $attach['filename'])) : ''; + $attach['attachicon'] = attachtype($extension."\t".$attach['filetype']); + $attach['attachsize'] = sizecount($attach['filesize']); + if($attach['isimage'] && !$_G['setting']['attachimgpost']) { + $attach['isimage'] = 0; + } + $attach['attachimg'] = $attach['isimage'] && (!$attach['readperm'] || $_G['group']['readaccess'] >= $attach['readperm']) ? 1 : 0; + if($attach['attachimg']) { + $aimgs[$attach['pid']][] = $attach['aid']; + } + if($attach['price']) { + if($_G['setting']['maxchargespan'] && TIMESTAMP - $attach['dateline'] >= $_G['setting']['maxchargespan'] * 3600) { + C::t('forum_attachment_n')->update_attachment('tid:'.$_G['tid'], $attach['aid'], array('price' => 0)); + $attach['price'] = 0; + } elseif(!$_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']) { + $payaids[$attach['aid']] = $attach['pid']; + } + } + $attach['payed'] = $_G['forum_attachmentdown'] || $_G['uid'] == $attach['uid'] ? 1 : 0; + $attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'; + $attach['dbdateline'] = $attach['dateline']; + $attach['dateline'] = dgmdate($attach['dateline'], 'u'); + $hideattachs = $_G['adminid'] != 1 && $_G['setting']['bannedmessages'] & 1 && (($postlist[$attach['pid']]['authorid'] && !$postlist[$attach['pid']]['username']) + || ($postlist[$attach['pid']]['groupid'] == 4 || $postlist[$attach['pid']]['groupid'] == 5) || $postlist[$attach['pid']]['status'] == -1 || $postlist[$attach['pid']]['memberstatus']) + || $_G['adminid'] != 1 && $postlist[$attach['pid']]['status'] & 1 || $postlist[$attach['pid']]['first'] && $_G['forum_threadpay']; + if(!$hideattachs) { + if(defined('IN_MOBILE_API')) { + $attach['aidencode'] = packaids($attach); + } + $postlist[$attach['pid']]['attachments'][$attach['aid']] = $attach; + } + if(!defined('IN_MOBILE_API') && !empty($attachtags[$attach['pid']]) && is_array($attachtags[$attach['pid']]) && in_array($attach['aid'], $attachtags[$attach['pid']])) { + $findattach[$attach['pid']][$attach['aid']] = "/\[attach\]{$attach['aid']}\[\/attach\]/i"; + $attached = 1; + } + + if(!$attached) { + if($attach['isimage']) { + if(!$hideattachs) { + $postlist[$attach['pid']]['imagelist'][] = $attach['aid']; + $postlist[$attach['pid']]['imagelistcount']++; + } + if($postlist[$attach['pid']]['first']) { + $firstimgs[] = $attach['aid']; + } + } else { + if(!$hideattachs && (!$_G['forum_skipaidlist'] || !in_array($attach['aid'], $_G['forum_skipaidlist']))) { + $postlist[$attach['pid']]['attachlist'][] = $attach['aid']; + } + } + } + $aids[] = $attach['aid']; + } + if($aids) { + $attachs = C::t('forum_attachment')->fetch_all($aids); + foreach($attachs as $aid => $attach) { + if($postlist[$attach['pid']]) { + $postlist[$attach['pid']]['attachments'][$attach['aid']]['downloads'] = $attach['downloads']; + } + } + } + if($payaids) { + foreach(C::t('common_credit_log')->fetch_all_by_uid_operation_relatedid($_G['uid'], 'BAC', array_keys($payaids)) as $creditlog) { + $postlist[$payaids[$creditlog['relatedid']]]['attachments'][$creditlog['relatedid']]['payed'] = 1; + } + } + if(!empty($skipattachcode)) { + foreach($skipattachcode as $pid => $findskipattach) { + foreach($findskipattach as $findskip) { + $postlist[$pid]['message'] = preg_replace($findskip, '', $postlist[$pid]['message']); + } + } + } + + if($attachexists) { + foreach($attachtags as $pid => $aids) { + if($findattach[$pid]) { + foreach($findattach[$pid] as $aid => $find) { + $postlist[$pid]['message'] = preg_replace($find, attachinpost($postlist[$pid]['attachments'][$aid], $postlist[$pid]), $postlist[$pid]['message'], 1); + $postlist[$pid]['message'] = preg_replace($find, '', $postlist[$pid]['message']); + } + } + } + } else { + loadcache('posttableids'); + $posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0'); + foreach($posttableids as $id) { + C::t('forum_post')->update_post($id, $attachpids, array('attachment' => '0'), true); + } + } +} + +function attachwidth($width) { + global $_G; + if($_G['setting']['imagemaxwidth'] && $width) { + return 'class="zoom" onclick="zoom(this, this.src, 0, 0, '.($_G['setting']['showexif'] ? 1 : 0).')" width="'.($width > $_G['setting']['imagemaxwidth'] ? $_G['setting']['imagemaxwidth'] : $width).'"'; + } else { + return 'thumbImg="1"'; + } +} + +function packaids($attach) { + global $_G; + return aidencode($attach['aid'], 0, $_G['tid']); +} + +function showattach($post, $type = 0) { + $type = !$type ? 'attachlist' : 'imagelist'; + $return = ''; + if(!empty($post[$type]) && is_array($post[$type])) { + foreach($post[$type] as $aid) { + if(!empty($post['attachments'][$aid])) { + $return .= $type($post['attachments'][$aid], $post['first']); + } + } + } + return $return; +} + +function getattachexif($aid, $path = '') { + global $_G; + $return = $filename = ''; + if(!$path) { + if($attach = C::t('forum_attachment_n')->fetch_attachment('aid:'.$aid, $aid, array(1, -1))) { + if($attach['remote']) { + $filename = $_G['setting']['ftp']['attachurl'].'forum/'.$attach['attachment']; + } else { + $filename = $_G['setting']['attachdir'].'forum/'.$attach['attachment']; + } + } + } else { + $filename = $path; + } + if($filename) { + require_once libfile('function/exif'); + $exif = getexif($filename); + $keys = array( + exif_lang('Model'), + exif_lang('ShutterSpeedValue'), + exif_lang('ApertureValue'), + exif_lang('FocalLength'), + exif_lang('ExposureTime'), + exif_lang('DateTimeOriginal'), + exif_lang('ISOSpeedRatings'), + ); + foreach($exif as $key => $value) { + if(in_array($key, $keys)) { + $return .= "$key : $value
    "; + } + } + } + return $return; +} + +?> \ No newline at end of file diff --git a/source/function/function_block.php b/source/function/function_block.php new file mode 100644 index 0000000..852ea36 --- /dev/null +++ b/source/function/function_block.php @@ -0,0 +1,1179 @@ +allowmem) { + if(($cachedata = memory('get', $bids, 'blockcache_')) !== false) { + foreach ($cachedata as $bid => $block) { + $_G['block'][$bid] = $block; + if($block['styleid']) { + $styleids[$block['styleid']] = $block['styleid']; + } + } + if($styleids) { + block_getstyle($styleids); + } + if(!($bids = array_diff($bids, array_keys($cachedata)))) { + return true; + } + } + } + + $items = $prelist = array(); + foreach(C::t('common_block_item')->fetch_all_by_bid($bids) as $item) { + if($item['itemtype'] == '1' && $item['enddate'] && $item['enddate'] < TIMESTAMP) { + continue; + } elseif($item['itemtype'] == '1' && (!$item['startdate'] || $item['startdate'] <= TIMESTAMP)) { + if (!empty($items[$item['bid']][$item['displayorder']])) { + $prelist[$item['bid']] = array(); + } + $prelist[$item['bid']][$item['displayorder']] = $item; + } + $items[$item['bid']][$item['displayorder']] = $item; + } + foreach(C::t('common_block')->fetch_all($bids) as $bid => $block) { + if(!empty($block['styleid']) && $block['styleid'] > 0) { + $styleids[] = intval($block['styleid']); + } + if(!empty($items[$bid])) { + ksort($items[$bid]); + $newitem = array(); + if(!empty($prelist[$bid])) { + $countpre = 0; + foreach($items[$bid] as $position => $item) { + if(empty($prelist[$bid][$position])) { + if(isset($items[$bid][$position+$countpre])) { + $newitem[$position+$countpre] = $item; + } + } else { + if ($item['itemtype']=='1') { + if ($prelist[$bid][$position]['startdate'] >= $item['startdate']) { + $newitem[$position] = $prelist[$bid][$position]; + } else { + $newitem[$position] = $item; + } + } else { + $newitem[$position] = $prelist[$bid][$position]; + $countpre++; + if(isset($items[$bid][$position+$countpre])) { + $newitem[$position+$countpre] = $item; + } + } + } + } + ksort($newitem); + } + $block['itemlist'] = empty($newitem) ? $items[$bid] : $newitem; + } + $block['param'] = $block['param'] ? dunserialize($block['param']) : array(); + $_G['block'][$bid] = $block; + + if(C::t('common_block')->allowmem) { + memory('set', 'blockcache_'.$bid, $_G['block'][$bid], C::t('common_block')->cache_ttl); + } + + } + } + if($styleids) { + block_getstyle($styleids); + } +} + +function block_display_batch($bid) { + echo block_fetch_content($bid); +} + +function block_fetch_content($bid, $isjscall=false, $forceupdate=false) { + global $_G; + static $allowmem = null, $cachettl = null; + if($allowmem === null) { + $allowmem = ($cachettl = getglobal('setting/memory/diyblockoutput')) !== null && memory('check'); + } + + $str = ''; + $block = empty($_G['block'][$bid])?array():$_G['block'][$bid]; + if(!$block) { + return; + } + + if(substr($block['blockclass'], -5) == '_real') { + $block = empty($_G['block'][$bid]) ? array() : $_G['block'][$bid]; + if($block) { + $obj = block_script($block['blockclass'], $block['script']); + if(is_object($obj)) { + $return = $obj->getdata(array(), $block['param']); + $block['summary'] = &$return['html']; + $allowmem = false; + } + } + } elseif($forceupdate) { + block_updatecache($bid, true); + $block = $_G['block'][$bid]; + } elseif($block['cachetime'] > 0 && $_G['timestamp'] - $block['dateline'] > $block['cachetime']) { + + $block['cachetimerange'] = empty($block['cachetimerange']) ? (isset($_G['setting']['blockcachetimerange']) ? $_G['setting']['blockcachetimerange'] : '') : $block['cachetimerange']; + $inrange = empty($block['cachetimerange']) ? true : false; + if(!$inrange) { + $block['cachetimerange'] = explode(',', $block['cachetimerange']); + $hour = date('G', TIMESTAMP); + if($block['cachetimerange'][0] <= $block['cachetimerange'][1]) { + $inrange = $block['cachetimerange'][0] <= $hour && $block['cachetimerange'][1] >= $hour; + } else { + $inrange = !($block['cachetimerange'][1] < $hour && $block['cachetimerange'][0] > $hour); + } + } + + if($isjscall || $block['punctualupdate']) { + block_updatecache($bid, true); + $block = $_G['block'][$bid]; + } elseif((empty($_G['blockupdate']) || $block['dateline'] < $_G['blockupdate']['dateline']) && $inrange) { + $_G['blockupdate'] = array('bid'=>$bid, 'dateline'=>$block['dateline']); + } + } + + $hidediv = $isjscall || $block['blocktype']; + + $_cache_key = 'blockcache_'.($isjscall ? 'js' : 'htm').'_'.$bid; + if($allowmem && empty($block['hidedisplay']) && empty($block['nocache']) && ($str = memory('get', $_cache_key)) !== false) { + + } else { + + if($hidediv) { + if($block['summary']) $str .= $block['summary']; + $str .= block_template($bid); + } else { + if($block['title']) $str .= $block['title']; + $str .= '
    '; + if($block['summary']) { + $str .= "
    {$block['summary']}
    "; + } + $str .= block_template($bid); + $str .= '
    '; + } + + if($allowmem && empty($block['hidedisplay']) && empty($block['nocache'])) { + memory('set', $_cache_key, $str, C::t('common_block')->cache_ttl); + } + } + + if(!$hidediv) { + $classname = !empty($block['classname']) ? $block['classname'].' ' : ''; + $div = "
    "; + if(($_GET['diy'] === 'yes' || $_GET['inajax']) && check_diy_perm()) { + $div .= "
    {$block['name']} (ID:$bid)
    "; + } + $str = $div.$str."
    "; + } + if($block['blockclass'] == 'html_html' && $block['script'] == 'search') $str = strtr($str, array('{FORMHASH}'=>FORMHASH)); + return !empty($block['hidedisplay']) ? '' : $str; +} + +function block_updatecache($bid, $forceupdate=false) { + global $_G; + if((isset($_G['block'][$bid]['cachetime']) && $_G['block'][$bid]['cachetime'] < 0) || !$forceupdate && discuz_process::islocked('block_update_cache', 5)) { + return false; + } + C::t('common_block')->clear_blockcache($bid); + $block = empty($_G['block'][$bid])?array():$_G['block'][$bid]; + if(!$block) { + return false; + } + $obj = block_script($block['blockclass'], $block['script']); + if(is_object($obj)) { + C::t('common_block')->update($bid, array('dateline'=>TIMESTAMP)); + $_G['block'][$bid]['dateline'] = TIMESTAMP; + $theclass = block_getclass($block['blockclass']); + $thestyle = !empty($block['styleid']) ? block_getstyle($block['styleid']) : dunserialize($block['blockstyle']); + + if(in_array($block['blockclass'], array('forum_thread', 'group_thread', 'space_blog', 'space_pic', 'portal_article'))) { + $datalist = array(); + $mapping = array('forum_thread'=>'tid', 'group_thread'=>'tid', 'space_blog'=>'blogid', 'space_blog'=>'picid', 'portal_article'=>'aid'); + $idtype = $mapping[$block['blockclass']]; + $bannedids = !empty($block['param']['bannedids']) ? explode(',', $block['param']['bannedids']) : array(); + $bannedsql = $bannedids ? ' AND id NOT IN ('.dimplode($bannedids).')' : ''; + $shownum = intval($block['shownum']); + $titlelength = !empty($block['param']['titlelength']) ? intval($block['param']['titlelength']) : 40; + $summarylength = !empty($block['param']['summarylength']) ? intval($block['param']['summarylength']) : 80; + foreach(C::t('common_block_item_data')->fetch_all_by_bid($bid, 1, 0, $shownum * 2, $bannedids, false) as $value) { + $value['title'] = cutstr($value['title'], $titlelength, ''); + $value['summary'] = cutstr($value['summary'], $summarylength, ''); + $value['itemtype'] = '3'; + $datalist[] = $value; + $bannedids[] = intval($value['id']); + } + $leftnum = $block['shownum'] - count($datalist); + if($leftnum > 0 && empty($block['isblank'])) { + if($leftnum != $block['param']['items']) { + $block['param']['items'] = $leftnum; + $block['param']['bannedids'] = implode(',',$bannedids); + } + $return = $obj->getdata($thestyle, $block['param']); + $return['data'] = array_merge($datalist, (array)$return['data']); + } else { + $return['data'] = $datalist; + } + } else { + $return = $obj->getdata($thestyle, $block['param']); + } + + if($return['data'] === null) { + $_G['block'][$block['bid']]['summary'] = $return['html']; + C::t('common_block')->update($bid, array('summary'=>$return['html'])); + } else { + $_G['block'][$block['bid']]['itemlist'] = block_updateitem($bid, $return['data']); + } + } else { + C::t('common_block')->update($bid, array('dateline'=>TIMESTAMP+999999, 'cachetime'=>0)); + $_G['block'][$bid]['dateline'] = TIMESTAMP+999999; + } + if(C::t('common_block')->allowmem) { + memory('set', 'blockcache_'.$bid, $_G['block'][$bid], C::t('common_block')->cache_ttl); + $styleid = $_G['block'][$bid]['styleid']; + if($styleid && $_G['blockstyle_'.$styleid]) { + memory('set', 'blockstylecache_'.$styleid, $_G['blockstyle_'.$styleid], C::t('common_block')->cache_ttl); + } + } + discuz_process::unlock('block_update_cache'); +} + +function block_template($bid) { + global $_G; + + $block = empty($_G['block'][$bid]) ? array() : $_G['block'][$bid]; + + $theclass = block_getclass($block['blockclass'], false); + $thestyle = !empty($block['styleid']) ? block_getstyle($block['styleid']) : dunserialize($block['blockstyle']); + if(empty($block) || empty($theclass) || empty($thestyle)) { + return false; + } + $template = block_build_template($thestyle['template']); + if(!empty($block['itemlist'])) { + if($thestyle['moreurl']) { + $template = str_replace('{moreurl}', 'portal.php?mod=block&bid='.$bid, $template); + } + $fields = array('picwidth'=>array(), 'picheight'=>array(), 'target'=>array(), 'currentorder'=>array()); + if($block['hidedisplay']) { + $fields = array_merge($fields, $theclass['fields']); + } else { + $thestyle['fields'] = !empty($thestyle['fields']) && is_array($thestyle['fields']) ? $thestyle['fields'] : block_parse_fields($template); + foreach($thestyle['fields'] as $k) { + if(isset($theclass['fields'][$k])) { + $fields[$k] = $theclass['fields'][$k]; + } + } + } + + $order = 0; + $dynamicparts = array(); + foreach($block['itemlist'] as $position=>$blockitem) { + $blockitem = is_array($blockitem) ? $blockitem : array(); + $itemid = $blockitem['itemid']; + $order++; + + $rkey = $rpattern = $rvalue = $rtpl = array(); + $rkeyplug = false; + if(isset($thestyle['template']['index']) && is_array($thestyle['template']['index']) && isset($thestyle['template']['index'][$order])) { + $rkey[] = 'index_'.$order; + $rpattern[] = '/\s*\[index='.$order.'\](.*?)\[\/index\]\s*/is'; + $rvalue[] = ''; + $rtpl[] = $thestyle['template']['index'][$order]; + } + if(empty($rkey)) { + $rkey[] = 'loop'; + $rpattern[] = '/\s*\[loop\](.*?)\[\/loop\]\s*/is'; + $rvalue[] = isset($dynamicparts['loop']) ? $dynamicparts['loop'][1] : ''; + if(is_array($thestyle['template']['order']) && isset($thestyle['template']['order'][$order])) { + $rtpl[] = $thestyle['template']['order'][$order]; + } elseif(is_array($thestyle['template']['order']) && isset($thestyle['template']['order']['odd']) && ($order % 2 == 1)) { + $rtpl[] = $thestyle['template']['order']['odd']; + } elseif(is_array($thestyle['template']['order']) && isset($thestyle['template']['order']['even']) && ($order % 2 == 0)) { + $rtpl[] = $thestyle['template']['order']['even']; + } else { + $rtpl[] = $thestyle['template']['loop']; + } + } + if(!empty($thestyle['template']['indexplus'])) { + foreach($thestyle['template']['indexplus'] as $k=>$v) { + if(isset($v[$order])) { + $rkey[] = 'index'.$k.'='.$order; + $rkeyplug = true; + $rpattern[] = '/\[index'.$k.'='.$order.'\](.*?)\[\/index'.$k.'\]/is'; + $rvalue[] = ''; + $rtpl[] = $v[$order]; + } + } + } + if(empty($rkeyplug)) { + if(!empty($thestyle['template']['loopplus'])) { + foreach($thestyle['template']['loopplus'] as $k=>$v) { + $rkey[] = 'loop'.$k; + $rpattern[] = '/\s*\[loop'.$k.'\](.*?)\[\/loop'.$k.'\]\s*/is'; + $rvalue[] = isset($dynamicparts['loop'.$k]) ? $dynamicparts['loop'.$k][1] : ''; + if(is_array($thestyle['template']['orderplus'][$k]) && isset($thestyle['template']['orderplus'][$k][$order])) { + $rtpl[] = $thestyle['template']['orderplus'][$k][$order]; + } elseif(is_array($thestyle['template']['orderplus'][$k]) && isset($thestyle['template']['orderplus'][$k]['odd']) && ($order % 2 == 1)) { + $rtpl[] = $thestyle['template']['orderplus'][$k]['odd']; + } elseif(is_array($thestyle['template']['orderplus'][$k]) && isset($thestyle['template']['orderplus'][$k]['even']) && ($order % 2 == 0)) { + $rtpl[] = $thestyle['template']['orderplus'][$k]['even']; + } else { + $rtpl[] = $thestyle['template']['loopplus'][$k]; + } + } + } + } + $blockitem['fields'] = is_array($blockitem['fields']) ? $blockitem['fields'] : dunserialize($blockitem['fields']); + $blockitem['fields'] = is_array($blockitem['fields']) ? $blockitem['fields'] : array(); + if(!empty($blockitem['showstyle'])) { + $blockitem['fields']['showstyle'] = dunserialize($blockitem['showstyle']); + } + $blockitem = $blockitem['fields'] + $blockitem; + + $blockitem['picwidth'] = !empty($block['picwidth']) ? intval($block['picwidth']) : 'auto'; + $blockitem['picheight'] = !empty($block['picheight']) ? intval($block['picheight']) : 'auto'; + $blockitem['target'] = !empty($block['target']) ? ' target="_'.$block['target'].'"' : ''; + $blockitem['currentorder'] = $order; + $blockitem['parity'] = $order % 2; + + $searcharr = $replacearr = array(); + $searcharr[] = '{parity}'; + $replacearr[] = $blockitem['parity']; + foreach($fields as $key=>$field) { + $replacevalue = $blockitem[$key]; + $field['datatype'] = !empty($field['datatype']) ? $field['datatype'] : ''; + if($field['datatype'] == 'int') {// int + $replacevalue = intval($replacevalue); + } elseif($field['datatype'] == 'string') { + $replacevalue = preg_quote($replacevalue); + } elseif($field['datatype'] == 'date') { + $replacevalue = dgmdate($replacevalue, $block['dateuformat'] ? 'u' : $block['dateformat'], '9999', $block['dateuformat'] ? $block['dateformat'] : ''); + } elseif($field['datatype'] == 'title') {//title + $searcharr[] = '{title-title}'; + $replacearr[] = preg_quote(!empty($blockitem['fields']['fulltitle']) ? $blockitem['fields']['fulltitle'] : dhtmlspecialchars($replacevalue)); + $searcharr[] = '{alt-title}'; + $replacearr[] = preg_quote(!empty($blockitem['fields']['fulltitle']) ? $blockitem['fields']['fulltitle'] : dhtmlspecialchars($replacevalue)); + $replacevalue = preg_quote($replacevalue); + if($blockitem['showstyle'] && ($style = block_showstyle($blockitem['showstyle'], 'title'))) { + $replacevalue = ''.$replacevalue.''; + } + } elseif($field['datatype'] == 'summary') {//summary + $replacevalue = preg_quote($replacevalue); + if($blockitem['showstyle'] && ($style = block_showstyle($blockitem['showstyle'], 'summary'))) { + $replacevalue = ''.$replacevalue.''; + } + } elseif($field['datatype'] == 'pic') { + if($blockitem['picflag'] == '1') { + if(!$_G['setting']['ftp']['on'] || file_exists($_G['setting']['attachdir'].$replacevalue)) { + $replacevalue = $_G['setting']['attachurl'].$replacevalue; + } else { + $replacevalue = (preg_match('/^https?:\/\//is', $replacevalue) ? '' : $_G['setting']['ftp']['attachurl']).$replacevalue; + } + } elseif ($blockitem['picflag'] == '2') { + $replacevalue = (preg_match('/^https?:\/\//is', $replacevalue) ? '' : $_G['setting']['ftp']['attachurl']).$replacevalue; + } + if($blockitem['picflag'] && $block['picwidth'] && $block['picheight'] && $block['picwidth'] != 'auto' && $block['picheight'] != 'auto') { + if($blockitem['makethumb'] == 1) { + if($blockitem['picflag'] == '1') { + if(!$_G['setting']['ftp']['on'] || file_exists($_G['setting']['attachdir'].$blockitem['thumbpath'])) { + $replacevalue = $_G['setting']['attachurl'].$blockitem['thumbpath']; + } else { + $replacevalue = (preg_match('/^https?:\/\//is', $blockitem['thumbpath']) ? '' : $_G['setting']['ftp']['attachurl']).$blockitem['thumbpath']; + } + } elseif ($blockitem['picflag'] == '2') { + $replacevalue = (preg_match('/^https?:\/\//is', $blockitem['thumbpath']) ? '' : $_G['setting']['ftp']['attachurl']).$blockitem['thumbpath']; + } + } elseif(!$_G['block_makethumb'] && !$blockitem['makethumb']) { + C::t('common_block_item')->update($itemid, array('makethumb'=>2)); + require_once libfile('class/image'); + $image = new image(); + $thumbpath = block_thumbpath($block, $blockitem); + if($_G['setting']['ftp']['on'] && !empty($_G['setting']['ftp']['host'])) { + $ftp = & discuz_ftp::instance(); + $ftp->connect(); + if($ftp->connectid && $ftp->ftp_size($thumbpath) > 0) { + $picflag = 1; //common_block_pic表中的picflag标识(0本地,1远程) + $_G['block_makethumb'] = true; + @unlink($_G['setting']['attachdir'].'./'.$thumbpath); + C::t('common_block_item')->update($itemid, array('picflag' => 2)); + $replacevalue = (preg_match('/^https?:\/\//is', $thumbpath) ? '' : $_G['setting']['ftp']['attachurl']).$thumbpath; + } else { + $image->Thumb($replacevalue, $thumbpath, $block['picwidth'], $block['picheight'], 2); + if(file_exists($_G['setting']['attachdir'].'./'.$thumbpath)) { + if(ftpperm(fileext($thumbpath), filesize($_G['setting']['attachdir'].'./'.$thumbpath)) && $ftp->upload($_G['setting']['attachdir'].'/'.$thumbpath, $thumbpath)) { + $picflag = 1; //common_block_pic表中的picflag标识(0本地,1远程) + $_G['block_makethumb'] = true; + @unlink($_G['setting']['attachdir'].'./'.$thumbpath); + C::t('common_block_item')->update($itemid, array('picflag' => 2)); + $replacevalue = (preg_match('/^https?:\/\//is', $thumbpath) ? '' : $_G['setting']['ftp']['attachurl']).$thumbpath; + } else { + $picflag = 0; //common_block_pic表中的picflag标识(0本地,1远程) + $_G['block_makethumb'] = true; + } + } + } + } elseif(file_exists($_G['setting']['attachdir'].'./'.$thumbpath) || ($return = $image->Thumb($replacevalue, $thumbpath, $block['picwidth'], $block['picheight'], 2))) { + $picflag = 0; //common_block_pic表中的picflag标识(0本地,1远程) + $_G['block_makethumb'] = true; + } + if($_G['block_makethumb']) { + C::t('common_block_item')->update($itemid, array('makethumb'=>1, 'thumbpath' => $thumbpath)); + C::t('common_block')->clear_blockcache($block['bid']); + $thumbdata = array('bid' => $block['bid'], 'itemid' => $itemid, 'pic' => $thumbpath, 'picflag' => $picflag, 'type' => '0'); + C::t('common_block_pic')->insert($thumbdata); + } + } + } + } + $searcharr[] = '{'.$key.'}'; + $replacearr[] = $replacevalue; + + if($block['hidedisplay']) { + if(strpos($replacevalue, "\\") !== false) { + $replacevalue = str_replace( + array('\.', '\\\\', '\+', '\*', '\?', '\[', '\^', '\]', '\$', '\(', '\)', '\{', '\}', '\=', '\!', '\<', '\>', '\|', '\:', '\-'), + array('.', '\\', '+', '*', '?', '[', '^', ']', '$', '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', '-'), $replacevalue); + } + $_G['block_'.$bid][$order-1][$key] = $replacevalue; + } + } + foreach($rtpl as $k=>$str_template) { + if($str_template) { + $str_template = preg_replace('/title=[\'"]{title}[\'"]/', 'title="{title-title}"', $str_template); + $str_template = preg_replace('/alt=[\'"]{title}[\'"]/', 'alt="{alt-title}"', $str_template); + $rvalue[$k] .= str_replace($searcharr, $replacearr, $str_template); + $dynamicparts[$rkey[$k]] = array($rpattern[$k], $rvalue[$k]); + } + } + }// foreach($block['itemlist'] as $itemid=>$blockitem) { + + foreach($dynamicparts as $value) { + $template = preg_replace($value[0], $value[1], $template); + } + $template = str_replace('\\', '\', stripslashes($template)); + } + $template = preg_replace('/\s*\[(order\d*)=\w+\](.*?)\[\/\\1\]\s*/is', '', $template); + $template = preg_replace('/\s*\[(index\d*)=\w+\](.*?)\[\/\\1\]\s*/is', '', $template); + $template = preg_replace('/\s*\[(loop\d{0,1})\](.*?)\[\/\\1\]\s*/is', '', $template); + return $template; +} + +function block_showstyle($showstyle, $key) { + $style = ''; + if(!empty($showstyle["{$key}_b"])) { + $style .= 'font-weight: 900;'; + } + if(!empty($showstyle["{$key}_i"])) { + $style .= 'font-style: italic;'; + } + if(!empty($showstyle["{$key}_u"])) { + $style .= 'text-decoration: underline;'; + } + if(!empty($showstyle["{$key}_c"])) { + $style .= 'color: '.$showstyle["{$key}_c"].';'; + } + return $style; +} + + +function block_setting($blockclass, $script, $values = array()) { + global $_G; + + $return = array(); + $obj = block_script($blockclass, $script); + if(!is_object($obj)) return $return; + return block_makeform($obj->getsetting(), $values); +} + +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 .= ''. + ''; + } elseif($type == 'text' || $type == 'password' || $type == 'number') { + $s .= ''; + } elseif($type == 'textarea') { + $s .= ''; + } elseif($type == 'mtextarea') { + $s .= ''; + } elseif($type == 'select') { + $s .= ''; + } elseif($type == 'mradio') { + if(is_array($varname)) { + $radiocheck = array($value => ' checked'); + $s .= ''; + foreach($varname[1] as $varary) { + if(is_array($varary) && !empty($varary)) { + $s .= ''; + } + } + $s .= ''; + } + } elseif($type == 'mcheckbox') { + $s .= '
      '; + foreach($varname[1] as $varary) { + if(is_array($varary) && !empty($varary)) { + $checked = is_array($value) && in_array($varary[0], $value) ? ' checked' : ''; + $s .= ''; + } + } + $s .= '
    '; + } elseif($type == 'mselect') { + $s .= ''; + } elseif($type == 'calendar') { + if(! $calendar_loaded) { + $s .= ""; + $calendar_loaded = true; + } + $s .= ''; + } 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].' '; + } + } + $containertype = strpos($setting['title'], 'birthcity') !== false ? 'birth' : 'reside'; + $containerid = 'randomid_'.(++$randomid); + if($districthtml) { + $s .= $districthtml; + $s .= '  
    '.lang('spacecp', 'profile_edit').''; + $s .= '

    '; + } else { + $s .= "
    ".showdistrict($vals, $elems, $containerid, null, $containertype).'
    '; + } + } elseif($type == 'file') { + $s .= ''; + } elseif($type == 'mfile') { + $s .= ''; + $s .= '
    '; + $s .= ''; + $s .= ''; + } else { + $s .= $type; + } + $return[] = array('title' => $setname, 'html' => $s, 'comment'=>$comment); + } + return $return; +} +function block_updateitem($bid, $items=array()) { + global $_G; + $block = $_G['block'][$bid]; + if(!$block) { + if(!($block = C::t('common_block')->fetch($bid))) { + return false; + } + $_G['block'][$bid] = $block; + } + $block['shownum'] = max($block['shownum'], 1); + $showlist = array(); + $archivelist = array(); + $prelist = array(); + $oldvalue = $fixedvalue = $fixedkeys = array(); + foreach(C::t('common_block_item')->fetch_all_by_bid($bid, true) as $value) { + $key = $value['idtype'].'_'.$value['id']; + if($value['itemtype'] == '1') { + $fixedvalue[$value['displayorder']][] = $value; + $fixedkeys[$key] = 1; + continue; + } elseif(!isset($oldvalue[$key])) { + $oldvalue[$key] = $value; + } else { + $archivelist[$value['itemid']] = 1; + } + } + + $processkeys = array(); + $itemcount = count($items); + for($k = 0; $k < $itemcount; $k++) { + $v = $items[$k]; + $key = $v['idtype'].'_'.$v['id']; + if(isset($fixedkeys[$key])) { + $items[$k] = null; + } elseif(isset($oldvalue[$key]) && !isset($processkeys[$key])) { + if($oldvalue[$key]['itemtype'] == '2') { + $items[$k] = $oldvalue[$key]; + } else { + $items[$k]['itemid'] = $oldvalue[$key]['itemid']; + } + unset($oldvalue[$key]); + $processkeys[$key] = 1; + } elseif(isset($processkeys[$key])) { + unset($items[$k]); + } + } + + $items = array_filter($items); + + foreach($oldvalue as $value) { + $archivelist[$value['itemid']] = 1; + } + for($i = 1; $i <= $block['shownum']; $i++) { + $jump = false; + if(isset($fixedvalue[$i])) { + foreach($fixedvalue[$i] as $value) { + if($value['startdate'] > TIMESTAMP) { + $prelist[] = $value; + } elseif((!$value['startdate'] || $value['startdate'] <= TIMESTAMP) + && (!$value['enddate'] || $value['enddate'] > TIMESTAMP)) { + $showlist[] = $value; + $jump = true; + } else { + $archivelist[$value['itemid']] = 1; + } + } + } + if(!$jump) { + $curitem = array(); + if(!($curitem = array_shift($items))) { + break; + } + $curitem['displayorder'] = $i; + + $curitem['makethumb'] = 0; + if($block['picwidth'] && $block['picheight'] && $curitem['picflag']) { //picflag=0为url地址 + $thumbpath = empty($curitem['thumbpath']) ? block_thumbpath($block, $curitem) : $curitem['thumbpath']; + if($_G['setting']['ftp']['on'] && !empty($_G['setting']['ftp']['host'])) { + if(empty($ftp)) { + $ftp = & discuz_ftp::instance(); + $ftp->connect(); + } + if($ftp->ftp_size($thumbpath) > 0) { + $curitem['makethumb'] = 1; + $curitem['picflag'] = 2; + } + } else if(file_exists($_G['setting']['attachdir'].$thumbpath)) { + $curitem['makethumb'] = 1; + $curitem['picflag'] = 1; + } + $curitem['thumbpath'] = $thumbpath; + } + if(is_array($curitem['fields'])) { + $curitem['fields'] = serialize($curitem['fields']); + } + + $showlist[] = $curitem; + } + } + foreach($items as $value) { + if(!empty($value['itemid'])) { + $archivelist[$value['itemid']] = 1; + } + } + if($archivelist) { + $delids = array_keys($archivelist); + C::t('common_block_item')->delete_by_itemid_bid($delids, $bid); + block_delete_pic($bid, $delids); + } + $inserts = $itemlist = array(); + $itemlist = array_merge($showlist, $prelist); + C::t('common_block_item')->insert_batch($bid, $itemlist); + + $showlist = array_filter($showlist); + return $showlist; +} + +function block_thumbpath($block, $item) { + global $_G; + $hash = md5($item['pic'].'-'.$item['picflag'].':'.$block['picwidth'].'|'.$block['picheight']); + return 'block/'.substr($hash, 0, 2).'/'.$hash.'.jpg'; +} + +function block_getclass($classname, $getstyle=false) { + global $_G; + if(!isset($_G['cache']['blockclass']) || !isset($_G['cache']['blockindex'])) { + loadcache(array('blockclass', 'blockindex')); + } + $theclass = array(); + if(isset($_G['cache']['blockindex']['class'][$classname])) { + $c1 = $_G['cache']['blockindex']['class'][$classname]; + } else { + list($c1, $c2) = explode('_', $classname); + } + if($c1 && is_array($_G['cache']['blockclass']) && isset($_G['cache']['blockclass'][$c1]['subs'][$classname])) { + $theclass = $_G['cache']['blockclass'][$c1]['subs'][$classname]; + if($getstyle && !isset($theclass['style'])) { + foreach(C::t('common_block_style')->fetch_all_by_blockclass($classname) as $value) { + $value['template'] = !empty($value['template']) ? (array)(dunserialize($value['template'])) : array(); + $value['fields'] = !empty($value['fields']) ? (array)(dunserialize($value['fields'])) : array(); + $key = 'blockstyle_'.$value['styleid']; + $_G[$key] = $value; + $theclass['style'][$value['styleid']] = $value; + } + $_G['cache']['blockclass'][$c1]['subs'][$classname] = $theclass; + } + } + return $theclass; +} + +function block_getdiyurl($tplname, $diymod = false) { + $mod = $id = $script = $url = ''; + $flag = 0; + if (empty ($tplname)) { + $flag = 2; + } else { + list($script,$tpl) = explode('/',$tplname); + if (!empty($tpl)) { + $arr = array(); + preg_match_all('/(.*)\_(\d{1,9})/', $tpl,$arr); + $mod = empty($arr[1][0]) ? $tpl : $arr[1][0]; + $id = max(intval($arr[2][0]),0); + if($script == 'ranklist') { + $script = 'misc'; + $mod = 'ranklist&type='.$mod; + } else { + switch ($mod) { + case 'index' : + $mod = 'index'; + break; + case 'discuz' : + $flag = 0; + if($id){ + $mod = 'index&gid='.$id; + } else { + $mod = 'index'; + } + break; + case 'space_home' : + $mod = 'space'; + break; + case 'forumdisplay' : + $flag = $id ? 0 : 1; + $mod .= '&fid='.$id; + break; + case 'viewthread' : + $flag = $id ? 0 : 1; + $mod = 'forumdisplay&fid='.$id; + break; + case 'list' : + $flag = $id ? 0 : 1; + $mod .= '&catid='.$id; + break; + case 'portal_topic_content' : + $flag = $id ? 0 : 1; + $mod = 'topic&topicid='.$id; + break; + case 'view' : + $flag = $id ? 0 : 1; + $mod .= '&aid='.$id; + break; + default : + break; + } + } + } + $url = empty($mod) || $flag == '1' ? '' : $script.'.php?mod='.$mod.($diymod?'&diy=yes':''); + } + return array('url'=>$url,'flag'=>$flag); +} + +function block_clear() { + $uselessbids = $usingbids = $bids = array(); + $bids = C::t('common_block')->fetch_all_bid_by_blocktype(0,1000); + $usingbids = array_keys(C::t('common_template_block')->fetch_all_by_bid($bids)); + $uselessbids = array_diff($bids, $usingbids); + if (!empty($uselessbids)) { + C::t('common_block_item')->delete_by_bid($uselessbids); + C::t('common_block_item_data')->delete_by_bid($uselessbids); + C::t('common_block_favorite')->delete_by_bid($uselessbids); + C::t('common_block_permission')->delete_by_bid_uid_inheritedtplname($uselessbids); + C::t('common_block')->delete($uselessbids); + C::t('common_block')->optimize(); + C::t('common_block_item')->optimize(); + block_delete_pic($uselessbids); + } +} + +function block_getstyle($styleids = array()) { + global $_G; + static $allowmem = null, $cachettl =null; + if($allowmem === null) { + $allowmem = ($cachettl = getglobal('setting/memory/diyblock')) !== null && memory('check'); + } + + $pre = 'blockstyle_'; + if(($ret = $styleids && !is_array($styleids) ? $styleids : false)) { + if($_G[$pre.$ret]) { + return $_G[$pre.$ret]; + } else { + $styleids = (array)$styleids; + } + } + $cacheprekey = 'blockstylecache_'; + $styleids = array_map('intval', $styleids); + $styleids = array_unique($styleids); + + if($styleids) { + if($allowmem) { + if(($cachedata = memory('get', $styleids, $cacheprekey)) !== false) { + foreach ($cachedata as $styleid => $style) { + $_G[$pre.$styleid] = $style; + } + if(!($styleids = array_diff($styleids, array_keys($cachedata)))) { + return $ret ? $_G[$pre.$ret] : true; + } + } + } + + if($styleids) { + foreach(C::t('common_block_style')->fetch_all($styleids) as $styleid => $value) { + $value['template'] = !empty($value['template']) ? (array)(dunserialize($value['template'])) : array(); + $value['fields'] = !empty($value['fields']) ? (array)(dunserialize($value['fields'])) : array(); + $_G[$pre.$styleid] = $value; + if($allowmem) { + memory('set', $cacheprekey.$styleid, $_G[$pre.$styleid], $cachettl); + } + } + } + return $ret ? $_G[$pre.$ret] : true; + } + return array(); +} + +function blockclass_cache() { + global $_G; + $data = $dirs = $styles = $dataconvert = $dataindex = array(); + $dir = DISCUZ_ROOT.'/source/class/block/'; + $dh = opendir($dir); + while(($filename=readdir($dh))) { + if(is_dir($dir.$filename) && substr($filename,0,1) != '.') { + $dirs[$filename] = $dir.$filename.'/'; + } + } + ksort($dirs); + if(!empty($_G['setting']['plugins']['available'])) { + foreach($_G['setting']['plugins']['available'] as $key) { + $dir = './source/plugin/'.$key.'/block'; + if(!file_exists($dir) || !file_exists($dir.'/blockclass.php')) { + continue; + } + $dirs[$key] = $dir.'/'; + } + } + foreach($dirs as $name=>$dir) { + $blockclass = $blockconvert = array(); + if(file_exists($dir.'blockclass.php')) { + include_once($dir.'blockclass.php'); + } + if(empty($blockclass['name'])) { + $blockclass['name'] = $name; + } else { + $blockclass['name'] = dhtmlspecialchars($blockclass['name']); + } + $blockclass['subs'] = array(); + + $dh = opendir($dir); + while(($filename = readdir($dh))) { + $match = $infos = $oneinfo = $fieldsconvert = array(); + $scriptname = $scriptclass = ''; + if(preg_match('/^(block_[\w]+)\.php$/i', $filename, $match)) { + $scriptclass = $match[1]; + $scriptname = preg_replace('/^block_/i', '', $scriptclass); + include_once $dir.$filename; + if(class_exists($scriptclass, false)) { + $obj = new $scriptclass(); + if(method_exists($obj, 'name') && method_exists($obj, 'blockclass') && method_exists($obj, 'fields') + && method_exists($obj, 'getsetting') && method_exists($obj, 'getdata')) { + if($scriptclass == 'block_xml') { + foreach($obj->blockdata as $one) { + $oneinfo['name'] = dhtmlspecialchars($one['data']['name']); + $oneinfo['blockclass'] = array($one['id'], $oneinfo['name']); + $oneinfo['fields'] = dhtmlspecialchars($one['data']['fields']); + + foreach($one['data']['style'] as $value) { + $arr = array( + 'blockclass'=>'xml_'.$one['id'], + 'name' => dhtmlspecialchars($value['name']), + ); + block_parse_template($value['template'], $arr); + $styles[$arr['hash']] = $arr; + } + $infos[] = $oneinfo; + } + } else { + $oneinfo['name'] = $obj->name(); + $oneinfo['blockclass'] = $obj->blockclass(); + $oneinfo['fields'] = $obj->fields(); + $infos[] = $oneinfo; + } + } + if(method_exists($obj, 'fieldsconvert')) { + $fieldsconvert = $obj->fieldsconvert(); + } + } + } + $pathindex = md5($dir); + $dataindex['path'][$pathindex] = $dir; + foreach($infos as $info) { + if($info['name'] && is_array($info['blockclass']) && $info['blockclass'][0] && $info['blockclass'][1]) { + list($key, $title) = $info['blockclass']; + $key = $name.'_'.$key; + if(!isset($blockclass['subs'][$key])) { + $blockclass['subs'][$key] = array( + 'name' => $title, + 'fields' => $info['fields'], + 'script' => array() + ); + } + $dataindex['class'][$key] = $name; + $blockclass['subs'][$key]['script'][$scriptname] = $info['name']; + if(!isset($blockconvert[$key]) && !empty($fieldsconvert)) { + $blockconvert[$key] = $fieldsconvert; + } + $dataindex['sub'][$key.'.'.$scriptname] = $pathindex; + } + } + } + + if($blockclass['subs']) { + $data[$name] = $blockclass; + + $blockstyle = array(); + if(file_exists($dir.'blockstyle.php')) { + include_once($dir.'blockstyle.php'); + } + if($blockstyle) { + foreach($blockstyle as $value) { + $arr = array( + 'blockclass'=>$name.'_'.$value['blockclass'], + 'name' => $value['name'] + ); + block_parse_template($value['template'], $arr); + $styles[$arr['hash']] = $arr; + } + } + } + + if(!empty($blockconvert)) { + $dataconvert[$name] = $blockconvert; + } + + } + + if($styles) { + $hashes = array_keys($styles); + foreach(C::t('common_block_style')->fetch_all_by_hash($hashes) as $value) { + unset($styles[$value['hash']]); + } + if($styles) { + C::t('common_block_style')->insert_batch($styles); + } + } + savecache('blockclass', $data); + savecache('blockconvert', $dataconvert); + savecache('blockindex', $dataindex); +} + +function block_parse_template($str_template, &$arr) { + + $arr['makethumb'] = strexists($str_template, '{picwidth}') ? 1 : 0; + $arr['getpic'] = strexists($str_template, '{pic}') ? 1 : 0; + $arr['getsummary'] = strexists($str_template, '{summary}') ? 1 : 0; + $arr['settarget'] = strexists($str_template, '{target}') ? 1 : 0; + $arr['moreurl'] = strexists($str_template, '{moreurl}') ? 1 : 0; + $fields = block_parse_fields($str_template); + $arr['fields'] = serialize($fields); + + $template = array(); + $template['raw'] = $str_template; + $template['header'] = $template['footer'] = ''; + $template['loop'] = $template['loopplus'] = $template['order'] = $template['orderplus'] = $template['index'] = $template['indexplus'] = array(); + + $match = array(); + if(preg_match('/\[loop\](.*?)\[\/loop]/is', $str_template, $match)) { + $template['loop'] = trim($match[1]); + } + $match = array(); + if(preg_match_all('/\[(loop\d)\](.*?)\[\/\\1]/is', $str_template, $match)) { + foreach($match[1] as $key=>$value) { + $content = trim($match[2][$key]); + $k = intval(str_replace('loop', '', $value)); + $template['loopplus'][$k] = $content; + } + } + $match = array(); + if(preg_match_all('/\[order=(\d+|odd|even)\](.*?)\[\/order]/is', $str_template, $match)) { + foreach($match[1] as $key => $order) { + $template['order'][$order] = trim($match[2][$key]); + } + } + $match = array(); + if(preg_match_all('/\[(order\d+)=(\d+|odd|even)\](.*?)\[\/\\1]/is', $str_template, $match)) { + foreach($match[1] as $key=>$value) { + $content = trim($match[3][$key]); + $order = $match[2][$key]; + $k = intval(str_replace('order', '', $value)); + $template['orderplus'][$k][$order] = $content; + } + } + $match = array(); + if(preg_match_all('/\[index=(\d+)\](.*?)\[\/index]/is', $str_template, $match)) { + foreach($match[1] as $key=>$order) { + $template['index'][$order] = trim($match[2][$key]); + } + } + $match = array(); + if(preg_match_all('/\[(index\d+)=(\d+)\](.*?)\[\/\\1]/is', $str_template, $match)) { + foreach($match[1] as $key=>$value) { + $content = trim($match[3][$key]); + $order = intval($match[2][$key]); + $k = intval(str_replace('index', '', $value)); + $template['indexplus'][$k][$order] = $content; + } + } + $arr['template'] = serialize($template); + $arr['hash'] = substr(md5($arr['blockclass'].'|'.$arr['template']), 8, 8); +} + +function block_parse_fields($template) { + $fields = array(); + if(preg_match_all('/\{(\w+)\}/', $template, $matches)) { + foreach($matches[1] as $fieldname) { + $fields[] = $fieldname; + } + $fields = array_unique($fields); + $fields = array_diff($fields, array('picwidth', 'picheight', 'target', '')); + $fields = array_values($fields); + } + return $fields; +} + +function block_build_template($template) { + if(! is_array($template)) { + return $template; + } + if(!empty($template['raw'])) { + return $template['raw']; + } + $str_template = $template['header']; + if($template['loop']) { + $str_template .= "\n[loop]\n{$template['loop']}\n[/loop]"; + } + if(!empty($template['order']) && is_array($template['order'])) { + foreach($template['order'] as $key=>$value) { + $str_template .= "\n[order={$key}]\n{$value}\n[/order]"; + } + } + $str_template .= $template['footer']; + return $str_template; +} + +function block_isrecommendable($block) { + return !empty($block) && in_array($block['blockclass'], array('forum_thread', 'group_thread', 'portal_article', 'space_pic', 'space_blog')) ? true : false; +} + +function block_delete_pic($bid, $itemid = array()) { + global $_G; + if(!empty($bid)) { + $picids = array(); + foreach(C::t('common_block_pic')->fetch_all_by_bid_itemid($bid, $itemid) as $value) { + $picids[$value['picid']] = $value['picid']; + if($value['picflag']) { + ftpcmd('delete', $value['pic']); + } else { + @unlink($_G['setting']['attachdir'].'/'.$value['pic']); + } + } + if(!empty($picids)) { + C::t('common_block_pic')->delete($picids); + } + } +} + +function update_template_block($targettplname, $tpldirectory, $blocks) { + if(!empty($targettplname)) { + if(empty($blocks)) { + C::t('common_template_block')->delete_by_targettplname($targettplname, $tpldirectory); + } else { + $oldbids = array(); + $oldbids = array_keys(C::t('common_template_block')->fetch_all_by_targettplname($targettplname, $tpldirectory)); + $newaddbids = array_diff($blocks, $oldbids); + C::t('common_template_block')->delete_by_targettplname($targettplname, $tpldirectory); + if($tpldirectory === './template/default') { + C::t('common_template_block')->delete_by_targettplname($targettplname, ''); + } + $blocks = array_unique($blocks); + C::t('common_template_block')->insert_batch($targettplname, $tpldirectory, $blocks); + if(!empty($newaddbids)) { + require_once libfile('class/blockpermission'); + $tplpermission = & template_permission::instance(); + $tplpermission->add_blocks($targettplname, $newaddbids); + } + } + } +} +?> \ No newline at end of file diff --git a/source/function/function_blog.php b/source/function/function_blog.php new file mode 100644 index 0000000..115c925 --- /dev/null +++ b/source/function/function_blog.php @@ -0,0 +1,341 @@ +'; + } else { + $return = ''; + } + return $return; +} +function blog_post($POST, $olds=array()) { + global $_G, $space; + + $isself = 1; + if(!empty($olds['uid']) && $olds['uid'] != $_G['uid']) { + $isself = 0; + $__G = $_G; + $_G['uid'] = $olds['uid']; + $_G['username'] = addslashes($olds['username']); + } + + $POST['subject'] = empty($_GET['subject']) ? '' : (dstrlen($_GET['subject']) > $_G['setting']['maxsubjectsize'] ? getstr($_GET['subject'], $_G['setting']['maxsubjectsize']) : $_GET['subject']); + $POST['subject'] = censor($POST['subject'], NULL, FALSE, FALSE); + if(strlen($POST['subject'])<1) $POST['subject'] = dgmdate($_G['timestamp'], 'Y-m-d'); + $POST['friend'] = intval($POST['friend']); + + $POST['target_ids'] = ''; + if($POST['friend'] == 2) { + $uids = array(); + $names = empty($_POST['target_names'])?array():explode(',', preg_replace("/(\s+)/s", ',', $_POST['target_names'])); + if($names) { + $uids = C::t('common_member')->fetch_all_uid_by_username($names); + } + if(empty($uids)) { + $POST['friend'] = 3; + } else { + $POST['target_ids'] = implode(',', $uids); + } + } elseif($POST['friend'] == 4) { + $POST['password'] = trim($POST['password']); + if($POST['password'] == '') $POST['friend'] = 0; + } + if($POST['friend'] !== 2) { + $POST['target_ids'] = ''; + } + if($POST['friend'] !== 4) { + $POST['password'] = ''; + } + + $POST['tag'] = dhtmlspecialchars(trim($POST['tag'])); + $POST['tag'] = getstr($POST['tag'], 500); + $POST['tag'] = censor($POST['tag']); + + if($POST['plaintext'] == true){ + $POST['message'] = nl2br($POST['message']); + } + $POST['message'] = preg_replace("/\\<\/div\>/i", '', $POST['message']); + $POST['message'] = checkhtml($POST['message']); + $POST['message'] = getstr($POST['message'], 0, 0, 0, 0, 1); + $POST['message'] = censor($POST['message'], NULL, FALSE, FALSE); + $POST['message'] = preg_replace_callback("//is", 'blog_post_callback_blog_check_url_1', $POST['message']); + + $message = $POST['message']; + if(censormod($message) || censormod($POST['subject']) || $_G['group']['allowblogmod']) { + $blog_status = 1; + } else { + $blog_status = 0; + } + + if(empty($olds['classid']) || $POST['classid'] != $olds['classid']) { + if(!empty($POST['classid']) && substr($POST['classid'], 0, 4) == 'new:') { + $classname = dhtmlspecialchars(trim(substr($POST['classid'], 4))); + $classname = getstr($classname); + $classname = censor($classname); + if(empty($classname)) { + $classid = 0; + } else { + $classid = C::t('home_class')->fetch_classid_by_uid_classname($_G['uid'], $classname); + if(empty($classid)) { + $setarr = array( + 'classname' => $classname, + 'uid' => $_G['uid'], + 'dateline' => $_G['timestamp'] + ); + $classid = C::t('home_class')->insert($setarr, true); + } + } + } else { + $classid = intval($POST['classid']); + + } + } else { + $classid = $olds['classid']; + } + if($classid && empty($classname)) { + $query = C::t('home_class')->fetch($classid); + $classname = ($query['uid'] == $_G['uid']) ? $query['classname'] : ''; + if(empty($classname)) $classid = 0; + } + + $blogarr = array( + 'subject' => $POST['subject'], + 'classid' => $classid, + 'friend' => $POST['friend'], + 'password' => $POST['password'], + 'noreply' => empty($POST['noreply'])?0:1, + 'catid' => intval($POST['catid']), + 'status' => $blog_status, + ); + + $titlepic = ''; + + $uploads = array(); + if(!empty($POST['picids'])) { + $picids = array_keys($POST['picids']); + $query = C::t('home_pic')->fetch_all_by_uid($_G['uid'], 0, 0, $picids); + foreach($query as $value) { + if(empty($titlepic) && $value['thumb']) { + $titlepic = getimgthumbname($value['filepath']); + $blogarr['picflag'] = $value['remote']?2:1; + } + $picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0); + $uploads[md5($picurl)] = $value; + } + if(empty($titlepic) && $value) { + $titlepic = $value['filepath']; + $blogarr['picflag'] = $value['remote']?2:1; + } + } + + if($uploads) { + $albumid = 0; + if($POST['savealbumid'] < 0 && !empty($POST['newalbum'])) { + $albumname = addslashes(dhtmlspecialchars(trim($POST['newalbum']))); + if(empty($albumname)) $albumname = dgmdate($_G['timestamp'],'Ymd'); + $albumarr = array('albumname' => $albumname); + $albumid = album_creat($albumarr); + } else { + $albumid = $POST['savealbumid'] < 0 ? 0 : intval($POST['savealbumid']); + $albuminfo = C::t('home_album')->fetch_album($albumid, $_G['uid']); + if(empty($albuminfo)) { + $albumid = 0; + } + } + if($albumid) { + C::t('home_pic')->update_for_uid($_G['uid'], $picids, array('albumid' => $albumid)); + album_update_pic($albumid); + } + preg_match_all("/\s*\\s*/is", $message, $mathes); + if(!empty($mathes[1])) { + foreach ($mathes[1] as $key => $value) { + $urlmd5 = md5($value); + if(!empty($uploads[$urlmd5])) { + unset($uploads[$urlmd5]); + } + } + } + foreach ($uploads as $value) { + $picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0); + $message .= "

    {$value['title']}

    "; + } + } + + $ckmessage = preg_replace("/(\|\<\/div\>|\s|\ \;|\|\|\<\/p\>)+/is", '', $message); + if(empty($ckmessage)) { + return false; + } + + + if(checkperm('manageblog')) { + $blogarr['hot'] = intval($POST['hot']); + } + + if($olds['blogid']) { + + if($blogarr['catid'] != $olds['catid']) { + if($olds['catid']) { + C::t('home_blog_category')->update_num_by_catid(-1, $olds['catid'], true, true); + } + if($blogarr['catid']) { + C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']); + } + } + + $blogid = $olds['blogid']; + C::t('home_blog')->update($blogid, $blogarr); + + $fuids = array(); + + $blogarr['uid'] = $olds['uid']; + $blogarr['username'] = $olds['username']; + } else { + + if($blogarr['catid']) { + C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']); + } + + $blogarr['uid'] = $_G['uid']; + $blogarr['username'] = $_G['username']; + $blogarr['dateline'] = empty($POST['dateline'])?$_G['timestamp']:$POST['dateline']; + $blogid = C::t('home_blog')->insert($blogarr, true); + + C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp'])); + C::t('common_member_field_home')->update($_G['uid'], array('recentnote'=>$POST['subject'])); + } + + $blogarr['blogid'] = $blogid; + $class_tag = new tag(); + $POST['tag'] = $olds ? $class_tag->update_field($POST['tag'], $blogid, 'blogid') : $class_tag->add_tag($POST['tag'], $blogid, 'blogid'); + $fieldarr = array( + 'message' => $message, + 'postip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'target_ids' => $POST['target_ids'], + 'tag' => $POST['tag'] + ); + + if(!empty($titlepic)) { + $fieldarr['pic'] = $titlepic; + } + + if($olds) { + C::t('home_blogfield')->update($blogid, $fieldarr); + } else { + $fieldarr['blogid'] = $blogid; + $fieldarr['uid'] = $blogarr['uid']; + C::t('home_blogfield')->insert($fieldarr); + } + + if($isself && !$olds && $blog_status == 0) { + updatecreditbyaction('publishblog', 0, array('blogs' => 1)); + + include_once libfile('function/stat'); + updatestat('blog'); + } + + if($olds['blogid'] && $blog_status == 1) { + updatecreditbyaction('publishblog', 0, array('blogs' => -1), '', -1); + include_once libfile('function/stat'); + updatestat('blog'); + } + + if($POST['makefeed'] && $blog_status == 0) { + include_once libfile('function/feed'); + feed_publish($blogid, 'blogid', $olds?0:1); + } + + if(!empty($__G)) $_G = $__G; + if($blog_status == 1) { + updatemoderate('blogid', $blogid); + manage_addnotify('verifyblog'); + } + return $blogarr; +} + +function blog_post_callback_blog_check_url_1($matches) { + return blog_check_url($matches[1]); +} + +function checkhtml($html) { + if(!checkperm('allowhtml')) { + + preg_match_all("/\<([^\<]+)\>/is", $html, $ms); + + $searchs[] = '<'; + $replaces[] = '<'; + $searchs[] = '>'; + $replaces[] = '>'; + + if($ms[1]) { + $allowtags = 'img|a|font|div|table|tbody|caption|tr|td|th|br|p|b|strong|i|u|em|span|ol|ul|li|blockquote'; + $ms[1] = array_unique($ms[1]); + foreach ($ms[1] as $value) { + $searchs[] = "<".$value.">"; + + $value = str_replace('&', '_uch_tmp_str_', $value); + $value = dhtmlspecialchars($value); + $value = str_replace('_uch_tmp_str_', '&', $value); + + $value = str_replace(array('\\','/*'), array('.','/.'), $value); + $skipkeys = array('onabort','onactivate','onafterprint','onafterupdate','onbeforeactivate','onbeforecopy','onbeforecut','onbeforedeactivate', + 'onbeforeeditfocus','onbeforepaste','onbeforeprint','onbeforeunload','onbeforeupdate','onblur','onbounce','oncellchange','onchange', + 'onclick','oncontextmenu','oncontrolselect','oncopy','oncut','ondataavailable','ondatasetchanged','ondatasetcomplete','ondblclick', + 'ondeactivate','ondrag','ondragend','ondragenter','ondragleave','ondragover','ondragstart','ondrop','onerror','onerrorupdate', + 'onfilterchange','onfinish','onfocus','onfocusin','onfocusout','onhelp','onkeydown','onkeypress','onkeyup','onlayoutcomplete', + 'onload','onlosecapture','onmousedown','onmouseenter','onmouseleave','onmousemove','onmouseout','onmouseover','onmouseup','onmousewheel', + 'onmove','onmoveend','onmovestart','onpaste','onpropertychange','onreadystatechange','onreset','onresize','onresizeend','onresizestart', + 'onrowenter','onrowexit','onrowsdelete','onrowsinserted','onscroll','onselect','onselectionchange','onselectstart','onstart','onstop', + 'onsubmit','onunload','javascript','script','eval','behaviour','expression','style','class'); + $skipstr = implode('|', $skipkeys); + $value = preg_replace(array("/($skipstr)/i"), '.', $value); + if(!preg_match("/^[\/|\s]?($allowtags)(\s+|$)/is", $value)) { + $value = ''; + } + $replaces[] = empty($value)?'':"<".str_replace('"', '"', $value).">"; + } + } + $html = str_replace($searchs, $replaces, $html); + } + + return $html; +} + +function blog_bbcode($message) { + require_once libfile('function/discuzcode'); + $message = preg_replace_callback("/\[media=([\w%,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/i", 'discuzcode_callback_parsemedia_12', $message); + $message = preg_replace_callback("/\[flash\=?(media|real|mp3)*\](.+?)\[\/flash\]/i", 'blog_bbcode_callback_blog_flash_21', $message); + return $message; +} + +function blog_bbcode_callback_blog_flash_21($matches) { + return blog_flash($matches[2], $matches[1]); +} + +function blog_flash($url, $type='') { + $width = '520'; + $height = '390'; + preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)[^\[\"']+/i", $url, $matches); + $url = $matches[0]; + require_once libfile('function/discuzcode'); + if($flv = parseflv($url, $width, $height)) { + return $flv; + } + $type = fileext($url); + $randomid = random(3); + return '
    '; +} +?> \ No newline at end of file diff --git a/source/function/function_cache.php b/source/function/function_cache.php new file mode 100644 index 0000000..88d3092 --- /dev/null +++ b/source/function/function_cache.php @@ -0,0 +1,174 @@ +read()) { + if(!in_array($entry, array('.', '..')) && preg_match("/^cache\_([\_\w]+)\.php$/", $entry, $entryr) && $entryr[1] != 'setting' && substr($entry, -4) == '.php' && is_file($cachedir.'/'.$entry)) { + @include_once libfile('cache/'.$entryr[1], 'function'); + call_user_func('build_cache_'.$entryr[1]); + } + } + foreach(C::t('common_plugin')->fetch_all_data(1) as $plugin) { + $dir = substr($plugin['directory'], 0, -1); + $cachedir = DISCUZ_ROOT.'./source/plugin/'.$dir.'/cache'; + if(file_exists($cachedir)) { + $cachedirhandle = dir($cachedir); + while($entry = $cachedirhandle->read()) { + if(!in_array($entry, array('.', '..')) && preg_match("/^cache\_([\_\w]+)\.php$/", $entry, $entryr) && substr($entry, -4) == '.php' && is_file($cachedir.'/'.$entry)) { + @include_once libfile('cache/'.$entryr[1], 'plugin/'.$dir); + call_user_func('build_cache_plugin_'.$entryr[1]); + } + } + } + } + } else { + foreach($updatelist as $entry) { + $entrys = explode(':', $entry); + if(count($entrys) == 1) { + @include_once libfile('cache/'.$entry, 'function'); + call_user_func('build_cache_'.$entry); + } else { + @include_once libfile('cache/'.$entrys[1], 'plugin/'.$entrys[0]); + call_user_func('build_cache_plugin_'.$entrys[1]); + } + } + } + +} + +function writetocache($script, $cachedata, $prefix = 'cache_') { + global $_G; + + $dir = DISCUZ_ROOT.'./data/sysdata/'; + if(!is_dir($dir)) { + dmkdir($dir, 0777); + } + + $s = ""; + + $fp = fopen("$dir$prefix$script.php", 'cb'); + if(!($fp && flock($fp, LOCK_EX) && ftruncate($fp, 0) && fwrite($fp, $s) && fflush($fp) && flock($fp, LOCK_UN) && fclose($fp))) { + flock($fp, LOCK_UN); + fclose($fp); + unlink("$dir$prefix$script.php"); + exit('Can not write to cache files, please check directory ./data/ and ./data/sysdata/ .'); + } +} + + +function getcachevars($data, $type = 'VAR') { + $evaluate = ''; + foreach($data as $key => $val) { + if(!preg_match("/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/", $key)) { + continue; + } + if(is_array($val)) { + $evaluate .= "\$$key = ".arrayeval($val).";\n"; + } else { + $val = addcslashes($val, '\'\\'); + $evaluate .= $type == 'VAR' ? "\$$key = '$val';\n" : "define('".strtoupper($key)."', '$val');\n"; + } + } + return $evaluate; +} + +function smthumb($size, $smthumb = 50) { + if($size[0] <= $smthumb && $size[1] <= $smthumb) { + return array('w' => $size[0], 'h' => $size[1]); + } + $sm = array(); + $x_ratio = $smthumb / $size[0]; + $y_ratio = $smthumb / $size[1]; + if(($x_ratio * $size[1]) < $smthumb) { + $sm['h'] = ceil($x_ratio * $size[1]); + $sm['w'] = $smthumb; + } else { + $sm['w'] = ceil($y_ratio * $size[0]); + $sm['h'] = $smthumb; + } + return $sm; +} + +function arrayeval($array, $level = 0) { + if(!is_array($array)) { + return "'".$array."'"; + } + if(is_array($array) && function_exists('var_export')) { + return var_export($array, true); + } + + $space = ''; + for($i = 0; $i <= $level; $i++) { + $space .= "\t"; + } + $evaluate = "Array\n$space(\n"; + $comma = $space; + if(is_array($array)) { + foreach($array as $key => $val) { + $key = is_string($key) ? '\''.addcslashes($key, '\'\\').'\'' : $key; + $val = !is_array($val) && (!preg_match("/^\-?[1-9]\d*$/", $val) || strlen($val) > 12) ? '\''.addcslashes($val, '\'\\').'\'' : $val; + if(is_array($val)) { + $evaluate .= "$comma$key => ".arrayeval($val, $level + 1); + } else { + $evaluate .= "$comma$key => $val"; + } + $comma = ",\n$space"; + } + } + $evaluate .= "\n$space)"; + return $evaluate; +} + +function pluginsettingvalue($type) { + $pluginsetting = $pluginvalue = array(); + @include DISCUZ_ROOT.'./data/sysdata/cache_pluginsetting.php'; + $pluginsetting = isset($pluginsetting[$type]) ? $pluginsetting[$type] : array(); + + $varids = $pluginids = array(); + foreach($pluginsetting as $pluginid => $v) { + foreach($v['setting'] as $varid => $var) { + $varids[] = $varid; + $pluginids[$varid] = $pluginid; + } + } + if($varids) { + foreach(C::t('common_pluginvar')->fetch_all($varids) as $plugin) { + $values = (array)dunserialize($plugin['value']); + foreach($values as $id => $value) { + $pluginvalue[$id][$pluginids[$plugin['pluginvarid']]][$plugin['variable']] = $value; + } + } + } + + return $pluginvalue; +} + +function cleartemplatecache() { + $tpl = dir(DISCUZ_ROOT.'./data/template'); + while($entry = $tpl->read()) { + if(preg_match("/\.tpl\.php$/", $entry)) { + @unlink(DISCUZ_ROOT.'./data/template/'.$entry); + } + } + $tpl->close(); +} + +?> \ No newline at end of file diff --git a/source/function/function_cloudaddons.php b/source/function/function_cloudaddons.php new file mode 100644 index 0000000..50a25eb --- /dev/null +++ b/source/function/function_cloudaddons.php @@ -0,0 +1,447 @@ + 'https://addon.dismall.com', + 'download_url' => 'https://addon.dismall.com/index.php', + 'download_ip' => '', + 'check_url' => 'https://addon1.dismall.com/md5/', + 'check_ip' => '', + ); + +define('CLOUDADDONS_WEBSITE_URL', $addon['website_url']); +define('CLOUDADDONS_DOWNLOAD_URL', $addon['download_url']); +define('CLOUDADDONS_DOWNLOAD_IP', $addon['download_ip']); +define('CLOUDADDONS_CHECK_URL', $addon['check_url']); +define('CLOUDADDONS_CHECK_IP', $addon['check_ip']); + +function cloudaddons_md5($file) { + return dfsockopen(CLOUDADDONS_CHECK_URL.$file, 0, '', '', false, CLOUDADDONS_CHECK_IP, 999); +} + +function cloudaddons_getuniqueid() { + global $_G; + if(CLOUDADDONS_WEBSITE_URL == 'https://addon.dismall.com') { + return $_G['setting']['siteuniqueid'] ? $_G['setting']['siteuniqueid'] : C::t('common_setting')->fetch_setting('siteuniqueid'); + } else { + if(!$_G['setting']['addon_uniqueid']) { + $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; + $addonuniqueid = $chars[date('y')%60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($_G['clientip'].TIMESTAMP), 0, 4).random(6); + C::t('common_setting')->update_setting('addon_uniqueid', $addonuniqueid); + require_once libfile('function/cache'); + updatecache('setting'); + } + return $_G['setting']['addon_uniqueid']; + } +} +function cloudaddons_url($extra) { + global $_G; + + require_once DISCUZ_ROOT.'./source/discuz_version.php'; + $data = 'siteuniqueid='.rawurlencode(cloudaddons_getuniqueid()).'&siteurl='.rawurlencode($_G['siteurl']).'&sitever='.DISCUZ_VERSION.'/'.DISCUZ_RELEASE.'&sitecharset='.CHARSET.'&mysiteid='.$_G['setting']['my_siteid'].'&addonversion=1&dlip='.CLOUDADDONS_DOWNLOAD_IP.'&os='.PHP_OS .'&php='.PHP_VERSION.'&web='.$_SERVER['SERVER_SOFTWARE'].'&db='.helper_dbtool::dbversion().'&lang='.currentlang(); + $param = 'data='.rawurlencode(base64_encode($data)); + $param .= '&md5hash='.substr(md5($data.TIMESTAMP), 8, 8).'×tamp='.TIMESTAMP; + return CLOUDADDONS_DOWNLOAD_URL.'?'.$param.$extra; +} + +function cloudaddons_check() { + if(!function_exists('gzuncompress')) { + cpmsg('cloudaddons_check_gzuncompress_error', '', 'error'); + } + + if(!function_exists('curl_init') || !function_exists('curl_exec')) { + cpmsg('cloudaddons_check_curl_error', '', 'error'); + } + + foreach(array('download', 'addonmd5') as $path) { + $tmpdir = DISCUZ_ROOT.'./data/'.$path.'/'.random(5); + $tmpfile = $tmpdir.'/index.html'; + dmkdir($tmpdir, 0777); + if(!is_dir($tmpdir) || !file_exists($tmpfile)) { + cpmsg('cloudaddons_check_write_error', '', 'error'); + } + @unlink($tmpfile); + @rmdir($tmpdir); + if(is_dir($tmpdir) || file_exists($tmpfile)) { + cpmsg('cloudaddons_check_write_error', '', 'error'); + } + } +} + +function cloudaddons_open($extra, $post = '', $timeout = 15) { + return dfsockopen(cloudaddons_url('&from=s').$extra, 0, $post, '', false, CLOUDADDONS_DOWNLOAD_IP, $timeout); +} + +function cloudaddons_pluginlogo_url($id, $type = 'plugin') { + return CLOUDADDONS_WEBSITE_URL.'?_'.$id.'&type='.$type; +} + +function cloudaddons_installlog($addonid) { + $array = cloudaddons_getmd5($addonid); + if($array['RevisionID']) { + cloudaddons_open('&mod=app&ac=installlog&rid='.$array['RevisionID']); + } +} + +function cloudaddons_downloadlog($addonid) { + $array = cloudaddons_getmd5($addonid); + if($array['RevisionID']) { + cloudaddons_open('&mod=app&ac=downloadlog&rid='.$array['RevisionID']); + } +} + +function cloudaddons_faillog($rid, $type) { + $rid = intval($rid); + $type = intval($type); + cloudaddons_open('&mod=app&ac=faillog&rid='.$rid.'&type='.$type.'&serverinfo='.urlencode($_SERVER['SERVER_SOFTWARE'])); +} + +function cloudaddons_removelog($rid) { + global $_G; + cloudaddons_open('&mod=app&ac=removelog&rid='.$rid); +} + +function cloudaddons_validator($addonid) { + $array = cloudaddons_getmd5($addonid); + if(cloudaddons_open('&mod=app&ac=validator&ver=2&addonid='.$addonid.($array !== false ? '&rid='.$array['RevisionID'].'&sn='.$array['SN'].'&rd='.$array['RevisionDateline'] : '')) === '0') { + cpmsg('cloudaddons_genuine_message', '', 'error', array('addonid' => $addonid)); + } +} + +function cloudaddons_upgradecheck($addonids) { + $post = array(); + foreach($addonids as $addonid) { + $array = cloudaddons_getmd5($addonid); + if($array) { + $post[] = 'rid['.$addonid.']='.$array['RevisionID'].'&sn['.$addonid.']='.$array['SN'].'&rd['.$addonid.']='.$array['RevisionDateline']; + } else { + $post[] = 'rid['.$addonid.']=&sn['.$addonid.']=&rd['.$addonid.']='; + } + } + return cloudaddons_open('&mod=app&ac=validator&ver=2', implode('&', $post), 15); +} + +function cloudaddons_recommendaddon($addonids) { + $post = array(); + foreach($addonids as $addonid) { + $array = cloudaddons_getmd5($addonid); + if($array) { + $post[] = 'rid['.$addonid.']='.$array['RevisionID'].'&sn['.$addonid.']='.$array['SN'].'&rd['.$addonid.']='.$array['RevisionDateline']; + } else { + $post[] = 'rid['.$addonid.']=&sn['.$addonid.']=&rd['.$addonid.']='; + } + } + return cloudaddons_open('&mod=app&ac=newaddon&ver=2', implode('&', $post), 15); +} + +function cloudaddons_getmd5($md5file) { + $array = array(); + if(preg_match('/^[a-z0-9_\.]+$/i', $md5file) && file_exists(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml')) { + require_once libfile('class/xml'); + $xml = implode('', @file(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml')); + $array = xml2array($xml); + } else { + return false; + } + return $array; +} + +function cloudaddons_uninstall($md5file, $dir) { + $array = cloudaddons_getmd5($md5file); + if($array === false) { + return; + } + if(!empty($array['RevisionID'])) { + cloudaddons_removelog($array['RevisionID']); + } + @unlink(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml'); + cloudaddons_cleardir($dir); +} + +function cloudaddons_savemd5($md5file, $end, $md5) { + global $_G; + parse_str($end, $r); + require_once libfile('class/xml'); + $data = $array = array(); + if(file_exists(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml')) { + $xml = implode('', @file(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml')); + $array = xml2array($xml); + } + if(!empty($array['RevisionID'])) { + foreach(explode(',', $array['RevisionID']) as $i => $rid) { + $sns = explode(',', $array['SN']); + $datalines = explode(',', $array['RevisionDateline']); + $data[$rid]['SN'] = $sns[$i]; + $data[$rid]['RevisionDateline'] = $datalines[$i]; + } + } + $data[$r['RevisionID']]['SN'] = $r['SN']; + $data[$r['RevisionID']]['RevisionDateline'] = $r['RevisionDateline']; + $array['Title'] = 'Discuz! Addon MD5'; + $array['ID'] = $r['ID']; + $array['RevisionDateline'] = $array['SN'] = $array['RevisionID'] = array(); + foreach($data as $rid => $tmp) { + $array['RevisionID'][] = $rid; + $array['SN'][] = $tmp['SN']; + $array['RevisionDateline'][] = $tmp['RevisionDateline']; + } + $array['RevisionID'] = implode(',', $array['RevisionID']); + $array['SN'] = implode(',', $array['SN']); + $array['RevisionDateline'] = implode(',', $array['RevisionDateline']); + $array['Data'] = $array['Data'] ? array_merge($array['Data'], $md5) : $md5; + if(!isset($_G['siteftp'])) { + dmkdir(DISCUZ_ROOT.'./data/addonmd5/', 0777, false); + file_put_contents(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml', array2xml($array)); + } else { + $localfile = DISCUZ_ROOT.'./data/'.random(5); + file_put_contents($localfile, array2xml($array)); + dmkdir(DISCUZ_ROOT.'./data/addonmd5/', 0777, false); + siteftp_upload($localfile, 'data/addonmd5/'.$md5file.'.xml'); + @unlink($localfile); + } +} + +function cloudaddons_comparetree($new, $old, $basedir, $md5file = '', $first = 0) { + global $_G; + if($first && file_exists(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml')) { + require_once libfile('class/xml'); + $xml = implode('', @file(DISCUZ_ROOT.'./data/addonmd5/'.$md5file.'.xml')); + $array = xml2array($xml); + $_G['treeop']['md5old'] = $array['Data']; + } + + $dh = opendir($new); + while(($file = readdir($dh)) !== false) { + if($file != '.' && $file != '..') { + $newfile = $new.'/'.$file; + $oldfile = $old.'/'.$file; + if(is_file($newfile)) { + $oldfile = preg_replace('/\._addons_$/', '', $oldfile); + $md5key = str_replace($basedir, '', preg_replace('/\._addons_$/', '', $newfile)); + $newmd5 = md5_file($newfile); + $oldmd5 = file_exists($oldfile) ? md5_file($oldfile) : ''; + if(isset($_G['treeop']['md5old'][$md5key]) && $_G['treeop']['md5old'][$md5key] != $oldmd5 && $oldmd5) { + $_G['treeop']['oldchange'][] = $md5key; + } + if($newmd5 != $oldmd5) { + $_G['treeop']['copy'][] = $newfile; + } + $_G['treeop']['md5'][$md5key] = $newmd5; + } else { + cloudaddons_comparetree($newfile, $oldfile, $basedir); + } + } + } +} + +function cloudaddons_copytree($from, $to) { + global $_G; + $dh = opendir($from); + while(($file = readdir($dh)) !== false) { + if($file != '.' && $file != '..') { + $readfile = $from.'/'.$file; + $writefile = $to.'/'.$file; + if(is_file($readfile)) { + if(!is_array($_G['treeop']['copy']) || !in_array($readfile, $_G['treeop']['copy'])) { + continue; + } + if(!isset($_G['siteftp'])) { + $content = false; + if($fp = @fopen($readfile, 'r')) { + $startTime = microtime(); + do { + $canRead = flock($fp, LOCK_SH); + if(!$canRead) { + usleep(round(rand(0, 100) * 1000)); + } + } while ((!$canRead) && ((microtime() - $startTime) < 1000)); + + if(!$canRead) { + cpmsg('cloudaddons_file_read_error', '', 'error'); + } + if(filesize($readfile) == 0) { + $content = ''; + } else { + $content = fread($fp, filesize($readfile)); + flock($fp, LOCK_UN); + fclose($fp); + } + } + if($content === false) { + cpmsg('cloudaddons_file_read_error', '', 'error'); + } + dmkdir(dirname($writefile), 0777, false); + $writefile = preg_replace('/\._addons_$/', '', $writefile); + if($fp = fopen($writefile, 'w')) { + $startTime = microtime(); + do { + $canWrite = flock($fp, LOCK_EX); + if(!$canWrite) { + usleep(round(rand(0, 100) * 1000)); + } + } while ((!$canWrite) && ((microtime() - $startTime) < 1000)); + + if(!$canWrite) { + cpmsg('cloudaddons_file_write_error', '', 'error'); + } + fwrite($fp, $content); + flock($fp, LOCK_UN); + fclose($fp); + } + if(!$canWrite) { + cpmsg('cloudaddons_file_write_error', '', 'error'); + } + } else { + $writefile = preg_replace('/\._addons_$/', '', $writefile); + siteftp_upload($readfile, preg_replace('/^'.preg_quote(DISCUZ_ROOT).'/', '', $writefile)); + } + if(md5_file($readfile) != md5_file($writefile)) { + cpmsg('cloudaddons_file_write_error', '', 'error'); + } + } else { + cloudaddons_copytree($readfile, $writefile); + } + + } + } +} + +function cloudaddons_deltree($dir) { + if($directory = @dir($dir)) { + while($entry = $directory->read()) { + if($entry == '.' || $entry == '..') { + continue; + } + $filename = $dir.'/'.$entry; + if(is_file($filename)) { + @unlink($filename); + } else { + cloudaddons_deltree($filename); + } + } + $directory->close(); + @rmdir($dir); + } +} + +function cloudaddons_cleardir($dir) { + if(is_dir($dir)) { + cloudaddons_deltree($dir); + } +} + +function cloudaddons_dirwriteable($basedir, $dir, $sourcedir) { + $checkdirs = array($dir); + cloudaddons_getsubdirs($sourcedir, $dir, $checkdirs); + $return = array(); + foreach($checkdirs as $k => $dir) { + $writeable = false; + $checkdir = $basedir.'/'.$dir; + if(!is_dir($checkdir)) { + @mkdir($checkdir, 0777); + } + if(is_dir($checkdir)) { + $fp = fopen($checkdir.'/test.txt', 'w'); + if($fp) { + fclose($fp); + unlink($checkdir.'/test.txt'); + $writeable = true; + } else { + $writeable = false; + } + } + if(!$writeable && $dir) { + $return[] = $dir; + } + } + return $return; +} + +function cloudaddons_getsubdirs($dir, $root, &$return) { + static $prefix = false; + if($prefix === false) { + $prefix = strlen($dir) + 1; + } + $dh = opendir($dir); + while(($file = readdir($dh)) !== false) { + if($file != '.' && $file != '..') { + $readfile = $dir.'/'.$file; + if(is_dir($readfile)) { + $return[] = $root.'/'.substr($readfile, $prefix); + cloudaddons_getsubdirs($readfile, $root, $return); + } + } + } +} + +function cloudaddons_http_build_query($formdata, $numeric_prefix = null, $key = null) { + $res = array(); + foreach((array) $formdata as $k => $v) { + $tmp_key = urlencode(is_int($k) ? $numeric_prefix . $k : $k); + if ($key) { + $tmp_key = $key.'['.$tmp_key.']'; + } + if (is_array($v) || is_object($v)) { + $res[] = cloudaddons_http_build_query($v, null, $tmp_key); + } else { + $res[] = $tmp_key.'='.urlencode($v); + } + } + return implode('&', $res); +} + +function cloudaddons_clear($type, $id) { + global $_G; + if(isset($_G['config']['plugindeveloper']) && $_G['config']['plugindeveloper'] > 0) { + return; + } + $dirs = array('plugin' => array('plugin', './source/plugin/'), 'template' => array('style', './template/')); + if($dirs[$type] && cloudaddons_getmd5($id.'.'.$type)) { + $entrydir = DISCUZ_ROOT.$dirs[$type][1].$id; + $d = dir($entrydir); + $filedeleted = false; + while($f = $d->read()) { + if(preg_match('/^discuz\_'.$dirs[$type][0].'\_'.$id.'(\_\w+)?\.xml$/', $f)) { + if($type == 'plugin' && !$filedeleted) { + $pluginarray = getimportdata('Discuz! Plugin'); + if($pluginarray['installfile']) { + @unlink($entrydir.'/'.$pluginarray['installfile']); + } + if($pluginarray['upgradefile']) { + @unlink($entrydir.'/'.$pluginarray['upgradefile']); + } + $filedeleted = true; + } + @unlink($entrydir.'/'.$f); + } + } + } +} + +function versioncompatible($versions) { + global $_G; + list($currentversion) = explode(' ', trim(strip_tags($_G['setting']['version']))); + $versions = strip_tags($versions); + foreach(explode(',', $versions) as $version) { + list($version) = explode(' ', trim($version)); + if($version && ($currentversion === $version)) { + return true; + } + } + return false; +} + +?> \ No newline at end of file diff --git a/source/function/function_collection.php b/source/function/function_collection.php new file mode 100644 index 0000000..31d7d13 --- /dev/null +++ b/source/function/function_collection.php @@ -0,0 +1,164 @@ +fetch_all_by_uid($uid); + $collectionteamworker = C::t('forum_collectionteamworker')->fetch_all_by_uid($uid); + return $collections + $collectionteamworker; +} + +function getHotCollection($number = 500, $pK = true) { + $collection = array(); + if($number > 0) { + $collection = C::t('forum_collection')->range_collection(0, $number, 10, $pK); + if(!$collection || count($collection) < $number) { + $collection += C::t('forum_collection')->range_collection(0, $number, null, $pK); + } + } + return $collection; +} + +function checkcollectionperm($collection, $uid, $allowteamworker = false) { + global $_G; + if($_G['group']['allowmanagecollection'] == 1) { + return true; + } + if($collection['uid'] == $uid) { + return true; + } + if($allowteamworker) { + $collectionteamworker = C::t('forum_collectionteamworker')->fetch_all_by_ctid($collection['ctid']); + $collectionteamworker = array_keys($collectionteamworker); + + if(in_array($uid, $collectionteamworker)) { + return true; + } + } + return false; +} + +function processCollectionData($collection, $tf = array(), $orderby = '') { + if(count($collection) <= 0) { + return array(); + } + require_once libfile('function/discuzcode'); + + foreach($collection as $ctid=>&$curvalue) { + $curvalue['updated'] = ($curvalue['lastupdate'] > $tf[$ctid]['lastvisit']) ? 1 : 0; + $curvalue['tflastvisit'] = $tf[$ctid]['lastvisit']; + $curvalue['lastupdate'] = dgmdate($curvalue['lastupdate']); + $curvalue['dateline'] = dgmdate($curvalue['dateline']); + $curvalue['lastposttime'] = dgmdate($curvalue['lastposttime']); + $curvalue['avgrate'] = number_format($curvalue['rate'], 1); + $curvalue['star'] = imgdisplayrate($curvalue['rate']); + $curvalue['lastposterhtml'] = rawurlencode($curvalue['lastposter']); + $curvalue['shortdesc'] = cutstr(strip_tags(discuzcode($curvalue['desc'])), 50); + + $curvalue['arraykeyword'] = parse_keyword($curvalue['keyword'], false, false); + if($curvalue['arraykeyword']) { + foreach ($curvalue['arraykeyword'] as $kid=>$s_keyword) { + $curvalue['urlkeyword'][$kid] = rawurlencode($s_keyword); + } + } + + if($orderby == 'commentnum') { + $curvalue['displaynum'] = $curvalue['commentnum']; + } elseif($orderby == 'follownum') { + $curvalue['displaynum'] = $curvalue['follownum']; + } else { + $curvalue['displaynum'] = $curvalue['threadnum']; + } + } + return $collection; +} + +function collectionThread(&$threadlist, $foruminfo = false, $lastvisit = null, &$collectiontids = null) { + global $todaytime; + + if($foruminfo) { + foreach ($threadlist as $thread) { + $fids[$thread['fid']] = $thread['fid']; + } + $foruminfo = C::t('forum_forum')->fetch_all($fids); + } + + foreach($threadlist as $curtid=>&$curvalue) { + if($lastvisit) { + $curvalue['reason'] = &$collectiontids[$curtid]['reason']; + $curvalue['updatedthread'] = $lastvisit !== null && $lastvisit < $curvalue['dateline'] ? 1 : 0; + } + if($foruminfo) { + $curvalue['forumname'] = $foruminfo[$curvalue['fid']]['name']; + } + $curvalue['istoday'] = $curvalue['dateline'] > $todaytime ? 1 : 0; + $curvalue['dbdateline'] = $curvalue['dateline']; + $curvalue['htmlsubject'] = dhtmlspecialchars($curvalue['subject']); + $curvalue['cutsubject'] = $curvalue['subject']; + $curvalue['dateline'] = dgmdate($curvalue['dateline'], 'u', '9999', getglobal('setting/dateformat')); + $curvalue['dblastpost'] = $curvalue['lastpost']; + $curvalue['lastpost'] = dgmdate($curvalue['lastpost'], 'u'); + $curvalue['lastposterenc'] = rawurlencode($curvalue['lastposter']); + } + if($collectiontids) { + foreach($collectiontids as $curkey=>&$curthread) { + if(!$threadlist[$curthread['tid']]) { + unset($collectiontids[$curkey]); + } else { + $curthread = $threadlist[$curthread['tid']] + $curthread; + } + } + } +} + +function imgdisplayrate($rate) { + $roundscore = floor($rate); + return $roundscore; +} + +function parse_keyword($keywords, $string = false, $filter = true) { + if($keywords == '') { + return $string === true ? '' : array(); + } + + $return = array(); + + if($filter === true) { + $keywords = str_replace(array(chr(0xa3).chr(0xac), chr(0xa1).chr(0x41), chr(0xef).chr(0xbc).chr(0x8c)), ',', censor($keywords)); + } + + if(strexists($keywords, ',')) { + $tagarray = array_unique(explode(',', $keywords)); + } else { + $langcore = lang('core'); + $keywords = str_replace($langcore['fullblankspace'], ' ', $keywords); + $tagarray = array_unique(explode(' ', $keywords)); + } + $tagcount = 0; + foreach($tagarray as $tagname) { + $tagname = trim($tagname); + if(preg_match('/^([\x7f-\xff_-]|\w|\s){3,20}$/', $tagname)) { + $tagcount++; + $return[] = $tagname; + if($tagcount > 4) { + unset($tagarray); + break; + } + } + } + if($string === true) { + $return = implode(',', $return); + } + return $return; +} + +?> \ No newline at end of file diff --git a/source/function/function_comment.php b/source/function/function_comment.php new file mode 100644 index 0000000..19e9588 --- /dev/null +++ b/source/function/function_comment.php @@ -0,0 +1,329 @@ +fetch_by_id_idtype($id, $idtype, $cid); + if($comment && $comment['authorid'] != $_G['uid']) { + $comment['message'] = preg_replace("/\
    \.*?\<\/blockquote\>\<\/div\>/is", '', $comment['message']); + $comment['message'] = $bbcode->html2bbcode($comment['message']); + $message = ("
    ".$comment['author'].": ".getstr($comment['message'], 150, 0, 0, 2, 1).'
    ').$message; + if($comment['idtype'] == 'uid') { + $id = $comment['authorid']; + } + } else { + $comment = array(); + } + } + + $hotarr = array(); + $stattype = ''; + $tospace = $pic = $blog = $album = $share = $poll = array(); + + switch($idtype) { + case 'uid': + $tospace = getuserbyuid($id); + $stattype = 'wall'; + break; + case 'picid': + $pic = C::t('home_pic')->fetch($id); + if(empty($pic)) { + showmessage('view_images_do_not_exist'); + } + $picfield = C::t('home_picfield')->fetch($id); + $pic['hotuser'] = $picfield['hotuser']; + $tospace = getuserbyuid($pic['uid']); + + $album = array(); + if($pic['albumid']) { + $album = C::t('home_album')->fetch_album($pic['albumid']); + if(!$album['albumid']) { + C::t('home_pic')->update_for_albumid($pic['albumid'], array('albumid' => 0)); + } + } + + if(!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) { + showmessage('no_privilege_ckfriend_pic'); + } elseif(!$tospace['self'] && $album['friend'] == 4) { + $cookiename = "view_pwd_album_{$album['albumid']}"; + $cookievalue = empty($_G['cookie'][$cookiename])?'':$_G['cookie'][$cookiename]; + if($cookievalue != md5(md5($album['password']))) { + showmessage('no_privilege_ckpassword_pic'); + } + } + + $hotarr = array('picid', $pic['picid'], $pic['hotuser']); + $stattype = 'piccomment'; + break; + case 'blogid': + $blog = array_merge( + C::t('home_blog')->fetch($id), + C::t('home_blogfield')->fetch_targetids_by_blogid($id) + ); + if(empty($blog)) { + showmessage('view_to_info_did_not_exist'); + } + + $tospace = getuserbyuid($blog['uid']); + + if(!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids'])) { + showmessage('no_privilege_ckfriend_blog'); + } elseif(!$tospace['self'] && $blog['friend'] == 4) { + $cookiename = "view_pwd_blog_{$blog['blogid']}"; + $cookievalue = empty($_G['cookie'][$cookiename])?'':$_G['cookie'][$cookiename]; + if($cookievalue != md5(md5($blog['password']))) { + showmessage('no_privilege_ckpassword_blog'); + } + } + + if(!empty($blog['noreply'])) { + showmessage('do_not_accept_comments'); + } + if($blog['target_ids']) { + $blog['target_ids'] .= ",{$blog['uid']}"; + } + + $hotarr = array('blogid', $blog['blogid'], $blog['hotuser']); + $stattype = 'blogcomment'; + break; + case 'sid': + $share = C::t('home_share')->fetch($id); + if(empty($share)) { + showmessage('sharing_does_not_exist'); + } + + $tospace = getuserbyuid($share['uid']); + + $hotarr = array('sid', $share['sid'], $share['hotuser']); + $stattype = 'sharecomment'; + break; + default: + showmessage('non_normal_operation'); + break; + } + if(empty($tospace)) { + showmessage('space_does_not_exist', '', array(), array('return' => true)); + } + + if(isblacklist($tospace['uid'])) { + showmessage('is_blacklist'); + } + + if($hotarr && $tospace['uid'] != $_G['uid']) { + hot_update($hotarr[0], $hotarr[1], $hotarr[2]); + } + + $fs = array(); + $fs['icon'] = 'comment'; + $fs['target_ids'] = ''; + $fs['friend'] = ''; + $fs['body_template'] = ''; + $fs['body_data'] = array(); + $fs['body_general'] = ''; + $fs['images'] = array(); + $fs['image_links'] = array(); + + switch ($idtype) { + case 'uid': + $fs['icon'] = 'wall'; + $fs['title_template'] = 'feed_comment_space'; + $fs['title_data'] = array('touser'=>"{$tospace['username']}"); + break; + case 'picid': + $fs['title_template'] = 'feed_comment_image'; + $fs['title_data'] = array('touser'=>"".$tospace['username'].""); + $fs['body_template'] = '{pic_title}'; + $fs['body_data'] = array('pic_title'=>$pic['title']); + $fs['body_general'] = $summay; + $fs['images'] = array(pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote'])); + $fs['image_links'] = array("home.php?mod=space&uid={$tospace['uid']}&do=album&picid={$pic['picid']}"); + $fs['target_ids'] = $album['target_ids']; + $fs['friend'] = $album['friend']; + break; + case 'blogid': + C::t('home_blog')->increase($id, 0, array('replynum'=>1)); + $fs['title_template'] = 'feed_comment_blog'; + $fs['title_data'] = array('touser'=>"".$tospace['username']."", 'blog'=>"{$blog['subject']}"); + $fs['target_ids'] = $blog['target_ids']; + $fs['friend'] = $blog['friend']; + break; + case 'sid': + $fs['title_template'] = 'feed_comment_share'; + $fs['title_data'] = array('touser'=>"".$tospace['username']."", 'share'=>"".str_replace(lang('spacecp', 'share_action'), '', $share['title_template']).""); + break; + } + + $message = censor($message, NULL, FALSE, FALSE); + if(censormod($message) || $_G['group']['allowcommentmod']) { + $comment_status = 1; + } else { + $comment_status = 0; + } + + $setarr = array( + 'uid' => $tospace['uid'], + 'id' => $id, + 'idtype' => $idtype, + 'authorid' => $_G['uid'], + 'author' => $_G['username'], + 'dateline' => $_G['timestamp'], + 'message' => $message, + 'ip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'status' => $comment_status, + ); + $cid = C::t('home_comment')->insert($setarr, true); + + $action = 'comment'; + $becomment = 'getcomment'; + $note = $q_note = ''; + $note_values = $q_values = array(); + + switch ($idtype) { + case 'uid': + $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=wall&cid=$cid"; + + $note_type = 'wall'; + $note = 'wall'; + $note_values = array('url'=>$n_url); + $q_note = 'wall_reply'; + $q_values = array('url'=>$n_url); + + if($comment) { + $msg = 'note_wall_reply_success'; + $magvalues = array('username' => $tospace['username']); + $becomment = ''; + } else { + $msg = 'do_success'; + $magvalues = array(); + $becomment = 'getguestbook'; + } + + $action = 'guestbook'; + break; + case 'picid': + $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=album&picid=$id&cid=$cid"; + + $note_type = 'comment'; + $note = 'pic_comment'; + $note_values = array('url'=>$n_url); + $q_note = 'pic_comment_reply'; + $q_values = array('url'=>$n_url); + + $msg = 'do_success'; + $magvalues = array(); + + break; + case 'blogid': + $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=blog&id=$id&cid=$cid"; + + $note_type = 'comment'; + $note = 'blog_comment'; + $note_values = array('url'=>$n_url, 'subject'=>$blog['subject']); + $q_note = 'blog_comment_reply'; + $q_values = array('url'=>$n_url); + + $msg = 'do_success'; + $magvalues = array(); + + break; + case 'sid': + $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=share&id=$id&cid=$cid"; + + $note_type = 'comment'; + $note = 'share_comment'; + $note_values = array('url'=>$n_url); + $q_note = 'share_comment_reply'; + $q_values = array('url'=>$n_url); + + $msg = 'do_success'; + $magvalues = array(); + + break; + } + + if(empty($comment)) { + + if($tospace['uid'] != $_G['uid']) { + if(ckprivacy('comment', 'feed')) { + require_once libfile('function/feed'); + $fs['title_data']['hash_data'] = "{$idtype}{$id}"; + feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'],$fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']); + } + + $note_values['from_id'] = $id; + $note_values['from_idtype'] = $idtype; + $note_values['url'] .= "&goto=new#comment_{$cid}_li"; + + notification_add($tospace['uid'], $note_type, $note, $note_values); + } + + } elseif($comment['authorid'] != $_G['uid']) { + notification_add($comment['authorid'], $note_type, $q_note, $q_values); + } + + if($comment_status == 1) { + updatemoderate($idtype.'_cid', $cid); + manage_addnotify('verifycommontes'); + } + if($stattype) { + include_once libfile('function/stat'); + updatestat($stattype); + } + if($tospace['uid'] != $_G['uid']) { + $needle = $id; + if($idtype != 'uid') { + $needle = $idtype.$id; + } else { + $needle = $tospace['uid']; + } + updatecreditbyaction($action, 0, array(), $needle); + if($becomment) { + if($idtype == 'uid') { + $needle = $_G['uid']; + } + updatecreditbyaction($becomment, $tospace['uid'], array(), $needle); + } + } + + C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED'); + $magvalues['cid'] = $cid; + + return array('cid' => $cid, 'msg' => $msg, 'magvalues' => $magvalues); +} + +?> \ No newline at end of file diff --git a/source/function/function_core.php b/source/function/function_core.php new file mode 100644 index 0000000..7c868f6 --- /dev/null +++ b/source/function/function_core.php @@ -0,0 +1,2345 @@ +session->updatesession(); +} + +function setglobal($key , $value, $group = null) { + global $_G; + $key = explode('/', $group === null ? $key : $group.'/'.$key); + $p = &$_G; + foreach ($key as $k) { + if(!isset($p[$k]) || !is_array($p[$k])) { + $p[$k] = array(); + } + $p = &$p[$k]; + } + $p = $value; + return true; +} + +function getglobal($key, $group = null) { + global $_G; + $key = explode('/', $group === null ? $key : $group.'/'.$key); + $v = &$_G; + foreach ($key as $k) { + if (!isset($v[$k])) { + return null; + } + $v = &$v[$k]; + } + return $v; +} + +function getgpc($k, $type='GP') { + $type = strtoupper($type); + switch($type) { + case 'G': $var = &$_GET; break; + case 'P': $var = &$_POST; break; + case 'C': $var = &$_COOKIE; break; + default: + if(isset($_GET[$k])) { + $var = &$_GET; + } else { + $var = &$_POST; + } + break; + } + + return isset($var[$k]) ? $var[$k] : NULL; + +} + +function dget($k) { + return isset($_GET[$k]) ? $_GET[$k] : null; +} + +function dpost($k) { + return isset($_POST[$k]) ? $_POST[$k] : null; +} + +function getuserbyuid($uid, $fetch_archive = 0) { + static $users = array(); + if(empty($users[$uid])) { + $users[$uid] = C::t('common_member'.($fetch_archive === 2 ? '_archive' : ''))->fetch($uid); + if($fetch_archive === 1 && empty($users[$uid])) { + $users[$uid] = C::t('common_member_archive')->fetch($uid); + } + } + if(!isset($users[$uid]['self']) && $uid == getglobal('uid') && getglobal('uid')) { + $users[$uid]['self'] = 1; + } + return $users[$uid]; +} + +function getuserprofile($field) { + global $_G; + if(isset($_G['member'][$field])) { + return $_G['member'][$field]; + } + static $tablefields = array( + 'count' => array('extcredits1','extcredits2','extcredits3','extcredits4','extcredits5','extcredits6','extcredits7','extcredits8','friends','posts','threads','digestposts','doings','blogs','albums','sharings','attachsize','views','oltime','todayattachs','todayattachsize', 'follower', 'following', 'newfollower', 'blacklist'), + 'status' => array('regip','lastip','lastvisit','lastactivity','lastpost','lastsendmail','invisible','buyercredit','sellercredit','favtimes','sharetimes','profileprogress'), + 'field_forum' => array('publishfeed','customshow','customstatus','medals','sightml','groupterms','authstr','groups','attentiongroup'), + 'field_home' => array('spacename','spacedescription','domain','addsize','addfriend','menunum','theme','spacecss','blockposition','recentnote','spacenote','privacy','feedfriend','acceptemail','magicgift','stickblogs'), + 'profile' => array('realname','gender','birthyear','birthmonth','birthday','constellation','zodiac','telephone','mobile','idcardtype','idcard','address','zipcode','nationality','birthcountry','birthprovince','birthcity','residecountry','resideprovince','residecity','residedist','residecommunity','residesuite','graduateschool','company','education','occupation','position','revenue','affectivestatus','lookingfor','bloodtype','height','weight','alipay','icq','qq','yahoo','msn','taobao','site','bio','interest','field1','field2','field3','field4','field5','field6','field7','field8'), + 'verify' => array('verify1', 'verify2', 'verify3', 'verify4', 'verify5', 'verify6'), + ); + $profiletable = ''; + foreach($tablefields as $table => $fields) { + if(in_array($field, $fields)) { + $profiletable = $table; + break; + } + } + if($profiletable) { + + if(is_array($_G['member']) && $_G['member']['uid']) { + space_merge($_G['member'], $profiletable); + } else { + foreach($tablefields[$profiletable] as $k) { + $_G['member'][$k] = ''; + } + } + return $_G['member'][$field]; + } + return null; +} + +function daddslashes($string, $force = 1) { + if(is_array($string)) { + $keys = array_keys($string); + foreach($keys as $key) { + $val = $string[$key]; + unset($string[$key]); + $string[addslashes($key)] = daddslashes($val, $force); + } + } else { + $string = addslashes($string); + } + return $string; +} + +function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + $ckey_length = 4; + $key = md5($key != '' ? $key : getglobal('authkey')); + $keya = md5(substr($key, 0, 16)); + $keyb = md5(substr($key, 16, 16)); + $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; + + $cryptkey = $keya.md5($keya.$keyc); + $key_length = strlen($cryptkey); + + $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; + $string_length = strlen($string); + + $result = ''; + $box = range(0, 255); + + $rndkey = array(); + for($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($cryptkey[$i % $key_length]); + } + + for($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + + for($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); + } + + if($operation == 'DECODE') { + if(((int)substr($result, 0, 10) == 0 || (int)substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26).$keyb), 0, 16)) { + return substr($result, 26); + } else { + return ''; + } + } else { + return $keyc.str_replace('=', '', base64_encode($result)); + } + +} + +function fsocketopen($hostname, $port = 80, &$errno = null, &$errstr = null, $timeout = 15) { + $fp = ''; + if(function_exists('fsockopen')) { + $fp = @fsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('pfsockopen')) { + $fp = @pfsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('stream_socket_client')) { + $fp = @stream_socket_client($hostname.':'.$port, $errno, $errstr, $timeout); + } + return $fp; +} + +function dfsockopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE, $position = 0, $files = array()) { + require_once libfile('function/filesock'); + return _dfsockopen($url, $limit, $post, $cookie, $bysocket, $ip, $timeout, $block, $encodetype, $allowcurl, $position, $files); +} + +function dhtmlspecialchars($string, $flags = null) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = dhtmlspecialchars($val, $flags); + } + } else { + if($flags === null) { + $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); + } else { + if(PHP_VERSION < '5.4.0') { + $string = htmlspecialchars($string, $flags); + } else { + if(strtolower(CHARSET) == 'utf-8') { + $charset = 'UTF-8'; + } else { + $charset = 'ISO-8859-1'; + } + $string = htmlspecialchars($string, $flags, $charset); + } + } + } + return $string; +} + +function dexit($message = '') { + echo $message; + output(); + exit(); +} + +function dheader($string, $replace = true, $http_response_code = 0) { + $islocation = substr(strtolower(trim($string)), 0, 8) == 'location'; + if(defined('IN_MOBILE') && strpos($string, 'mobile') === false && $islocation) { + if (strpos($string, '?') === false) { + $string = $string.'?mobile='.IN_MOBILE; + } else { + if(strpos($string, '#') === false) { + $string = $string.'&mobile='.IN_MOBILE; + } else { + $str_arr = explode('#', $string); + $str_arr[0] = $str_arr[0].'&mobile='.IN_MOBILE; + $string = implode('#', $str_arr); + } + } + } + $string = str_replace(array("\r", "\n"), array('', ''), $string); + if(empty($http_response_code) || PHP_VERSION < '4.3' ) { + @header($string, $replace); + } else { + @header($string, $replace, $http_response_code); + } + if($islocation) { + exit(); + } +} + +function dsetcookie($var, $value = '', $life = 0, $prefix = 1, $httponly = false) { + + global $_G; + + $config = $_G['config']['cookie']; + + $_G['cookie'][$var] = $value; + $var = ($prefix ? $config['cookiepre'] : '').$var; + $_COOKIE[$var] = $value; + + if($value === '' || $life < 0) { + $value = ''; + $life = -1; + } + + if(defined('IN_MOBILE')) { + $httponly = false; + } + + $life = $life > 0 ? getglobal('timestamp') + $life : ($life < 0 ? getglobal('timestamp') - 31536000 : 0); + $path = $httponly && PHP_VERSION < '5.2.0' ? $config['cookiepath'].'; HttpOnly' : $config['cookiepath']; + + $secure = $_G['isHTTPS']; + if(PHP_VERSION < '5.2.0') { + setcookie($var, $value, $life, $path, $config['cookiedomain'], $secure); + } else { + setcookie($var, $value, $life, $path, $config['cookiedomain'], $secure, $httponly); + } +} + +function getcookie($key) { + global $_G; + return isset($_G['cookie'][$key]) ? $_G['cookie'][$key] : ''; +} + +function fileext($filename) { + return addslashes(strtolower(substr(strrchr($filename, '.'), 1, 10))); +} + +function formhash($specialadd = '') { + global $_G; + $hashadd = defined('IN_ADMINCP') ? 'Only For Discuz! Admin Control Panel' : ''; + return substr(md5(substr($_G['timestamp'], 0, -7).$_G['username'].$_G['uid'].$_G['authkey'].$hashadd.$specialadd), 8, 8); +} + +function checkrobot($useragent = '') { + static $kw_spiders = array('bot', 'crawl', 'spider' ,'slurp', 'sohu-search', 'lycos', 'robozilla'); + static $kw_browsers = array('msie', 'netscape', 'opera', 'konqueror', 'mozilla'); + + $useragent = strtolower(empty($useragent) ? $_SERVER['HTTP_USER_AGENT'] : $useragent); + if(dstrpos($useragent, $kw_spiders)) return true; + if(strpos($useragent, 'http://') === false && dstrpos($useragent, $kw_browsers)) return false; + return false; +} +function checkmobile() { + global $_G; + $mobile = array(); + static $touchbrowser_list =array('iphone', 'android', 'phone', 'mobile', 'wap', 'netfront', 'java', 'opera mobi', 'opera mini', + 'ucweb', 'windows ce', 'symbian', 'series', 'webos', 'sony', 'blackberry', 'dopod', 'nokia', 'samsung', + 'palmsource', 'xda', 'pieplus', 'meizu', 'midp', 'cldc', 'motorola', 'foma', 'docomo', 'up.browser', + 'up.link', 'blazer', 'helio', 'hosin', 'huawei', 'novarra', 'coolpad', 'webos', 'techfaith', 'palmsource', + 'alcatel', 'amoi', 'ktouch', 'nexian', 'ericsson', 'philips', 'sagem', 'wellcom', 'bunjalloo', 'maui', 'smartphone', + 'iemobile', 'spice', 'bird', 'zte-', 'longcos', 'pantech', 'gionee', 'portalmmm', 'jig browser', 'hiptop', + 'benq', 'haier', '^lct', '320x320', '240x320', '176x220', 'windows phone'); + static $wmlbrowser_list = array('cect', 'compal', 'ctl', 'lg', 'nec', 'tcl', 'alcatel', 'ericsson', 'bird', 'daxian', 'dbtel', 'eastcom', + 'pantech', 'dopod', 'philips', 'haier', 'konka', 'kejian', 'lenovo', 'benq', 'mot', 'soutec', 'nokia', 'sagem', 'sgh', + 'sed', 'capitel', 'panasonic', 'sonyericsson', 'sharp', 'amoi', 'panda', 'zte'); + + static $pad_list = array('ipad'); + + $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); + + if(dstrpos($useragent, $pad_list)) { + return false; + } + if(($v = dstrpos($useragent, $touchbrowser_list, true))){ + $_G['mobile'] = $v; + return '2'; + } + if(($v = dstrpos($useragent, $wmlbrowser_list))) { + $_G['mobile'] = $v; + return '3'; //wml版 + } + $brower = array('mozilla', 'chrome', 'safari', 'opera', 'm3gate', 'winwap', 'openwave'); + if(dstrpos($useragent, $brower)) return false; + + $_G['mobile'] = 'unknown'; + if(isset($_G['mobiletpl'][$_GET['mobile']])) { + return true; + } else { + return false; + } +} + +function dstrpos($string, $arr, $returnvalue = false) { + if(empty($string)) return false; + foreach((array)$arr as $v) { + if(strpos($string, $v) !== false) { + $return = $returnvalue ? $v : true; + return $return; + } + } + return false; +} + +function isemail($email) { + return strlen($email) > 6 && strlen($email) <= 255 && preg_match("/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/", $email); +} + +function quescrypt($questionid, $answer) { + return $questionid > 0 && $answer != '' ? substr(md5($answer.md5($questionid)), 16, 8) : ''; +} + +function random($length, $numeric = 0) { + $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35); + $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed)); + if($numeric) { + $hash = ''; + } else { + $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64); + $length--; + } + $max = strlen($seed) - 1; + for($i = 0; $i < $length; $i++) { + $hash .= $seed[mt_rand(0, $max)]; + } + return $hash; +} + +function secrandom($length, $numeric = 0, $strong = false) { + $chars = $numeric ? array('A','B','+','/','=') : array('+','/','='); + $num_find = str_split('CDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'); + $num_repl = str_split('01234567890123456789012345678901234567890123456789'); + $isstrong = false; + if(function_exists('random_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + return random_bytes($length); + }; + } elseif(extension_loaded('mcrypt') && function_exists('mcrypt_create_iv')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + if ($rand !== false && strlen($rand) === $length) { + return $rand; + } else { + return false; + } + }; + } elseif(extension_loaded('openssl') && function_exists('openssl_random_pseudo_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = openssl_random_pseudo_bytes($length, $secure); + if($secure === true) { + return $rand; + } else { + return false; + } + }; + } + if(!$isstrong) { + return $strong ? false : random($length, $numeric); + } + $retry_times = 0; + $return = ''; + while($retry_times < 128) { + $getlen = $length - strlen($return); // 33% extra bytes + $bytes = $random_bytes(max($getlen, 12)); + if($bytes === false) { + return false; + } + $bytes = str_replace($chars, '', base64_encode($bytes)); + $return .= substr($bytes, 0, $getlen); + if(strlen($return) == $length) { + return $numeric ? str_replace($num_find, $num_repl, $return) : $return; + } + $retry_times++; + } +} + +function strexists($string, $find) { + return !(strpos($string, $find) === FALSE); +} + +function avatar($uid, $size = 'middle', $returnsrc = 0, $real = FALSE, $static = FALSE, $ucenterurl = '', $class = '', $extra = '', $random = 0) { + global $_G; + if(!empty($_G['setting']['plugins']['func'][HOOKTYPE]['avatar']) && !defined('IN_ADMINCP')) { + $_G['hookavatar'] = ''; + $param = func_get_args(); + hookscript('avatar', 'global', 'funcs', array('param' => $param), 'avatar'); + if($_G['hookavatar']) { + return $_G['hookavatar']; + } + } + if(is_array($returnsrc)) { + isset($returnsrc['random']) && $random = $returnsrc['random']; + isset($returnsrc['extra']) && $extra = $returnsrc['extra']; + isset($returnsrc['class']) && $class = $returnsrc['class']; + isset($returnsrc['ucenterurl']) && $ucenterurl = $returnsrc['ucenterurl']; + isset($returnsrc['static']) && $static = $returnsrc['static']; + isset($returnsrc['real']) && $real = $returnsrc['real']; + $returnsrc = isset($returnsrc['returnsrc']) ? $returnsrc['returnsrc'] : 0; + } + static $staticavatar; + if($staticavatar === null) { + $staticavatar = $_G['setting']['avatarmethod']; + } + static $avtstatus; + if($avtstatus === null) { + $avtstatus = array(); + } + $dynavt = intval($_G['setting']['dynavt']); + + $ucenterurl = empty($ucenterurl) ? $_G['setting']['ucenterurl'] : $ucenterurl; + $avatarurl = empty($_G['setting']['avatarurl']) ? $ucenterurl.'/data/avatar' : $_G['setting']['avatarurl']; + $size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle'; + $uid = abs(intval($uid)); + $rawuid = $uid; + $class = trim($class.' user_avatar'); + if(!$staticavatar && !$static && $ucenterurl != '.') { + if($avatarurl != $ucenterurl.'/data/avatar') { + $ucenterurl = $avatarurl; + } + $trandom = ''; + if($random == 1) { + $trandom = '&random=1'; + } elseif($dynavt == 2 || ($dynavt == 1 && $uid == $_G['uid']) || $random == 2) { + $trandom = '&ts=1'; + } + return $returnsrc ? $ucenterurl.'/avatar.php?uid='.$uid.'&size='.$size.($real ? '&type=real' : '').$trandom : ''; + } else { + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + $filepath = $dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).($real ? '_real' : '').'_avatar_'.$size.'.jpg'; + $file = $avatarurl.'/'.$filepath; + $noavt = $avatarurl.'/noavatar.svg'; + $trandom = ''; + $avtexist = -1; + if(!$staticavatar && !$static) { + $avatar_file = DISCUZ_ROOT.$_G['setting']['avatarpath'].$filepath; + if(isset($avtstatus[$rawuid])) { + $avtexist = $avtstatus[$rawuid][0]; + } else { + $avtexist = file_exists($avatar_file) ? 1 : 0; + $avtstatus[$rawuid][0] = $avtexist; + } + if($avtexist) { + if($dynavt == 2 || ($dynavt == 1 && $rawuid && $rawuid == $_G['uid']) || $random == 2) { + if(empty($avtstatus[$rawuid][1])) { + $avtstatus[$rawuid][1] = filemtime($avatar_file); + } + $trandom = '?ts='.$avtstatus[$rawuid][1]; + } + } else { + $file = $noavt; + } + } + if($random == 1 && $avtexist != 0) { + $trandom = '?random='.rand(1000, 9999); + } + if($trandom) { + $file = $file.$trandom; + } + return $returnsrc ? $file : ''; + } +} + +function lang($file, $langvar = null, $vars = array(), $default = null) { + global $_G; + $fileinput = $file; + $list = explode('/', $file); + $path = $list[0]; + $file = isset($list[1]) ? $list[1] : false; + if(!$file) { + $file = $path; + $path = ''; + } + if(strpos($file, ':') !== false) { + $path = 'plugin'; + list($file) = explode(':', $file); + } + + if($path != 'plugin') { + $key = $path == '' ? $file : $path.'_'.$file; + if(!isset($_G['lang'][$key])) { + $loadfile = DISCUZ_ROOT.'./source/language/'.($path == '' ? '' : $path.'/').'lang_'.$file.'.php'; + if(file_exists($loadfile)) { + include $loadfile; + } + $_G['lang'][$key] = (array)$lang; + } + if(defined('IN_MOBILE') && !defined('TPL_DEFAULT')) { + include DISCUZ_ROOT.'./source/language/touch/lang_template.php'; + $_G['lang'][$key] = array_merge((array)$_G['lang'][$key], (array)$lang); + } + if($file != 'error' && !isset($_G['cache']['pluginlanguage_system'])) { + loadcache('pluginlanguage_system'); + } + if(!isset($_G['hooklang'][$fileinput])) { + if(isset($_G['cache']['pluginlanguage_system'][$fileinput]) && is_array($_G['cache']['pluginlanguage_system'][$fileinput])) { + $_G['lang'][$key] = array_merge((array)$_G['lang'][$key], (array)$_G['cache']['pluginlanguage_system'][$fileinput]); + } + $_G['hooklang'][$fileinput] = true; + } + $returnvalue = &$_G['lang']; + } else { + if(empty($_G['config']['plugindeveloper'])) { + loadcache('pluginlanguage_script'); + } elseif(!isset($_G['cache']['pluginlanguage_script'][$file]) && preg_match("/^[a-z]+[a-z0-9_]*$/i", $file)) { + if(@include(DISCUZ_ROOT.'./data/plugindata/'.$file.'.lang.php')) { + $_G['cache']['pluginlanguage_script'][$file] = $scriptlang[$file]; + } else { + loadcache('pluginlanguage_script'); + } + } + $returnvalue = & $_G['cache']['pluginlanguage_script']; + !is_array($returnvalue) && $returnvalue = array(); + $key = &$file; + } + $return = $langvar !== null ? (isset($returnvalue[$key][$langvar]) ? $returnvalue[$key][$langvar] : null) : (is_array($returnvalue[$key]) ? $returnvalue[$key] : array()); + $return = $return === null ? ($default !== null ? $default : ($path != 'plugin' ? '' : $file . ':') . $langvar) : $return; + $searchs = $replaces = array(); + if($vars && is_array($vars)) { + foreach($vars as $k => $v) { + $searchs[] = '{'.$k.'}'; + $replaces[] = $v; + } + } + if(is_string($return) && strpos($return, '{_G/') !== false) { + preg_match_all('/\{_G\/(.+?)\}/', $return, $gvar); + foreach($gvar[0] as $k => $v) { + $searchs[] = (string)$v; + $replaces[] = getglobal($gvar[1][$k]); + } + } + if($searchs || $replaces) { + $return = str_replace($searchs, $replaces, $return); + } + return $return; +} + +function checktplrefresh($maintpl, $subtpl, $timecompare, $templateid, $cachefile, $tpldir, $file) { + static $tplrefresh, $timestamp, $targettplname; + if($tplrefresh === null) { + $tplrefresh = getglobal('config/output/tplrefresh'); + $timestamp = getglobal('timestamp'); + } + + if(empty($timecompare) || $tplrefresh == 1 || ($tplrefresh > 1 && !($timestamp % $tplrefresh))) { + if(!file_exists(DISCUZ_ROOT.$subtpl)){ + $subtpl = substr($subtpl, 0, -4).'.php'; + } + if(empty($timecompare) || @filemtime(DISCUZ_ROOT.$subtpl) > $timecompare) { + require_once DISCUZ_ROOT.'/source/class/class_template.php'; + $template = new template(); + $template->parse_template($maintpl, $templateid, $tpldir, $file, $cachefile); + if($targettplname === null) { + $targettplname = getglobal('style/tplfile'); + if(!empty($targettplname)) { + include_once libfile('function/block'); + $targettplname = strtr($targettplname, ':', '_'); + update_template_block($targettplname, getglobal('style/tpldirectory'), $template->blocks); + } + $targettplname = true; + } + return TRUE; + } + } + return FALSE; +} + +function template($file, $templateid = 0, $tpldir = '', $gettplfile = 0, $primaltpl='') { + global $_G; + + if(!defined('CURMODULE')) { + define('CURMODULE', ''); + } + if(!defined('HOOKTYPE')) { + define('HOOKTYPE', !defined('IN_MOBILE') ? 'hookscript' : 'hookscriptmobile'); + } + if(!empty($_G['setting']['plugins']['func'][HOOKTYPE]['template'])) { + $param = func_get_args(); + $hookreturn = hookscript('template', 'global', 'funcs', array('param' => $param, 'caller' => 'template'), 'template'); + if($hookreturn) { + return $hookreturn; + } + } + + static $_init_style = false; + if($_init_style === false) { + C::app()->_init_style(); + $_init_style = true; + } + $oldfile = $file; + if(strpos($file, ':') !== false) { + $clonefile = ''; + list($templateid, $file, $clonefile) = explode(':', $file.'::'); + $oldfile = $file; + $file = empty($clonefile) ? $file : $file.'_'.$clonefile; + if($templateid == 'diy') { + $indiy = false; + $_G['style']['tpldirectory'] = $tpldir ? $tpldir : (defined('TPLDIR') ? TPLDIR : ''); + $_G['style']['prefile'] = ''; + $diypath = DISCUZ_ROOT.'./data/diy/'.$_G['style']['tpldirectory'].'/'; //DIY模板文件目录 + $preend = '_diy_preview'; + $_GET['preview'] = !empty($_GET['preview']) ? $_GET['preview'] : ''; + $curtplname = $oldfile; + $basescript = $_G['mod'] == 'viewthread' && !empty($_G['thread']) ? 'forum' : $_G['basescript']; + if(isset($_G['cache']['diytemplatename'.$basescript])) { + $diytemplatename = &$_G['cache']['diytemplatename'.$basescript]; + } else { + if(!isset($_G['cache']['diytemplatename'])) { + loadcache('diytemplatename'); + } + $diytemplatename = &$_G['cache']['diytemplatename']; + } + $tplsavemod = 0; + if(isset($diytemplatename[$file]) && file_exists($diypath.$file.'.htm') && ($tplsavemod = 1) || empty($_G['forum']['styleid']) && ($file = $primaltpl ? $primaltpl : $oldfile) && isset($diytemplatename[$file]) && file_exists($diypath.$file.'.htm')) { + $tpldir = 'data/diy/'.$_G['style']['tpldirectory'].'/'; + !$gettplfile && $_G['style']['tplsavemod'] = $tplsavemod; + $curtplname = $file; + if(isset($_GET['diy']) && $_GET['diy'] == 'yes' || isset($_GET['diy']) && $_GET['preview'] == 'yes') { //DIY模式或预览模式下做以下判断 + $flag = file_exists($diypath.$file.$preend.'.htm'); + if($_GET['preview'] == 'yes') { + $file .= $flag ? $preend : ''; + } else { + $_G['style']['prefile'] = $flag ? 1 : ''; + } + } + $indiy = true; + } else { + $file = $primaltpl ? $primaltpl : $oldfile; + } + $tplrefresh = $_G['config']['output']['tplrefresh']; + if($indiy && ($tplrefresh ==1 || ($tplrefresh > 1 && !($_G['timestamp'] % $tplrefresh))) && filemtime($diypath.$file.'.htm') < filemtime(DISCUZ_ROOT.$_G['style']['tpldirectory'].'/'.($primaltpl ? $primaltpl : $oldfile).'.htm')) { + if (!updatediytemplate($file, $_G['style']['tpldirectory'])) { + unlink($diypath.$file.'.htm'); + $tpldir = ''; + } + } + + if (!$gettplfile && empty($_G['style']['tplfile'])) { + $_G['style']['tplfile'] = empty($clonefile) ? $curtplname : $oldfile.':'.$clonefile; + } + + $_G['style']['prefile'] = !empty($_GET['preview']) && $_GET['preview'] == 'yes' ? '' : $_G['style']['prefile']; + + } else { + $tpldir = './source/plugin/'.$templateid.'/template'; + } + } + + $file .= !empty($_G['inajax']) && ($file == 'common/header' || $file == 'common/footer') ? '_ajax' : ''; + $tpldir = $tpldir ? $tpldir : (defined('TPLDIR') ? TPLDIR : ''); + $templateid = $templateid ? $templateid : (defined('TEMPLATEID') ? TEMPLATEID : ''); + $filebak = $file; + + if((constant('HOOKTYPE') == 'hookscriptmobile' && defined('IN_MOBILE') && !defined('TPL_DEFAULT') && strpos($file, $_G['mobiletpl'][IN_MOBILE].'/') === false || (isset($_G['forcemobilemessage']) && $_G['forcemobilemessage'])) || defined('IN_PREVIEW')) { + if(defined('IN_MOBILE') && constant('IN_MOBILE') == 2) { + $oldfile .= !empty($_G['inajax']) && ($oldfile == 'common/header' || $oldfile == 'common/footer') ? '_ajax' : ''; + } + $file = $_G['mobiletpl'][IN_MOBILE].'/'.$oldfile; + } + + if(!$tpldir) { + $tpldir = './template/default'; + } + $tplfile = $tpldir.'/'.$file.'.htm'; + + $file == 'common/header' && defined('CURMODULE') && CURMODULE && $file = 'common/header_'.$_G['basescript'].'_'.CURMODULE; + + if((constant('HOOKTYPE') == 'hookscriptmobile' && defined('IN_MOBILE') && !defined('TPL_DEFAULT')) || defined('IN_PREVIEW')) { + if(strpos($tpldir, 'plugin')) { + if(!file_exists(DISCUZ_ROOT.$tpldir.'/'.$file.'.htm') && !file_exists(DISCUZ_ROOT.$tpldir.'/'.$file.'.php')) { + $url = $_SERVER['REQUEST_URI'].(strexists($_SERVER['REQUEST_URI'], '?') ? '&' : '?').'mobile=no'; + showmessage('mobile_template_no_found', '', array('url' => $url)); + } else { + $mobiletplfile = $tpldir.'/'.$file.'.htm'; + } + } + empty($mobiletplfile) && $mobiletplfile = $file.'.htm'; + if(strpos($tpldir, 'plugin') && (file_exists(DISCUZ_ROOT.$mobiletplfile) || file_exists(substr(DISCUZ_ROOT.$mobiletplfile, 0, -4).'.php'))) { + $tplfile = $mobiletplfile; + } elseif(!file_exists(DISCUZ_ROOT.TPLDIR.'/'.$mobiletplfile) && !file_exists(substr(DISCUZ_ROOT.TPLDIR.'/'.$mobiletplfile, 0, -4).'.php')) { + if(strpos($file, $_G['mobiletpl'][IN_MOBILE].'/email/') === 0) { + $tplfile = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $tplfile); + $file = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $file); + } + $mobiletplfile = './template/default/'.$file.'.htm'; + if(!file_exists(DISCUZ_ROOT.$mobiletplfile) && !$_G['forcemobilemessage']) { + $tplfile = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $tplfile); + $file = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $file); + define('TPL_DEFAULT', true); + define('TPL_DEFAULT_FILE', $mobiletplfile); + } else { + $tplfile = $mobiletplfile; + } + } else { + $tplfile = TPLDIR.'/'.$mobiletplfile; + } + } + + $cachefile = './data/template/'.(defined('STYLEID') ? STYLEID.'_' : '_').$templateid.'_'.str_replace('/', '_', $file).'.tpl.php'; + if($templateid != 1 && !file_exists(DISCUZ_ROOT.$tplfile) && !file_exists(substr(DISCUZ_ROOT.$tplfile, 0, -4).'.php') + && !file_exists(DISCUZ_ROOT.($tplfile = $tpldir.$filebak.'.htm'))) { + $tplfile = './template/default/'.$filebak.'.htm'; + } + + if($gettplfile) { + return $tplfile; + } + checktplrefresh($tplfile, $tplfile, @filemtime(DISCUZ_ROOT.$cachefile), $templateid, $cachefile, $tpldir, $file); + return DISCUZ_ROOT.$cachefile; +} + +function dsign($str, $length = 16){ + return substr(md5($str.getglobal('config/security/authkey')), 0, ($length ? max(8, $length) : 16)); +} + +function modauthkey($id) { + return md5(getglobal('username').getglobal('uid').getglobal('authkey').substr(TIMESTAMP, 0, -7).$id); +} + +function getcurrentnav() { + global $_G; + if(!empty($_G['mnid'])) { + return $_G['mnid']; + } + $mnid = ''; + $_G['basefilename'] = $_G['basefilename'] == $_G['basescript'] ? $_G['basefilename'] : $_G['basescript'].'.php'; + if(isset($_G['setting']['navmns'][$_G['basefilename']])) { + if($_G['basefilename'] == 'home.php' && $_GET['mod'] == 'space' && (empty($_GET['do']) || in_array($_GET['do'], array('follow', 'view')))) { + $_GET['mod'] = 'follow'; + } + foreach($_G['setting']['navmns'][$_G['basefilename']] as $navmn) { + if($navmn[0] == array_intersect_assoc($navmn[0], $_GET) || (isset($_GET['gid']) && $navmn[0]['mod'] == 'forumdisplay' && $navmn[0]['fid'] == $_GET['gid']) || ($navmn[0]['mod'] == 'space' && $_GET['mod'] == 'spacecp' && ($navmn[0]['do'] == $_GET['ac'] || $navmn[0]['do'] == 'album' && $_GET['ac'] == 'upload'))) { + $mnid = $navmn[1]; + } + } + + } + if(!$mnid && isset($_G['setting']['navdms'])) { + foreach($_G['setting']['navdms'] as $navdm => $navid) { + if(strpos(strtolower($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']), $navdm) !== false && strpos(strtolower($_SERVER['HTTP_HOST']), $navdm) === false) { + $mnid = $navid; + break; + } + } + } + if(!$mnid && isset($_G['setting']['navmn'][$_G['basefilename']])) { + $mnid = $_G['setting']['navmn'][$_G['basefilename']]; + } + return $mnid; +} + +function loaducenter() { + require_once DISCUZ_ROOT.'./config/config_ucenter.php'; + require_once DISCUZ_ROOT.'./uc_client/client.php'; +} + +function loadcache($cachenames, $force = false) { + global $_G; + static $loadedcache = array(); + $cachenames = is_array($cachenames) ? $cachenames : array($cachenames); + $caches = array(); + foreach ($cachenames as $k) { + if(!isset($loadedcache[$k]) || $force) { + $caches[] = $k; + $loadedcache[$k] = true; + } + } + + if(!empty($caches)) { + $cachedata = C::t('common_syscache')->fetch_all_syscache($caches); + foreach($cachedata as $cname => $data) { + if($cname == 'setting') { + $_G['setting'] = $data; + } elseif($cname == 'usergroup_'.$_G['groupid']) { + $_G['cache'][$cname] = $_G['group'] = $data; + } elseif($cname == 'style_default') { + $_G['cache'][$cname] = $_G['style'] = $data; + } elseif($cname == 'grouplevels') { + $_G['grouplevels'] = $data; + } else { + $_G['cache'][$cname] = $data; + } + } + } + return true; +} + +function dgmdate($timestamp, $format = 'dt', $timeoffset = 9999, $uformat = '') { + global $_G; + $format == 'u' && !$_G['setting']['dateconvert'] && $format = 'dt'; + static $dformat, $tformat, $dtformat, $offset, $lang; + if($dformat === null) { + $dformat = getglobal('setting/dateformat'); + $tformat = getglobal('setting/timeformat'); + $dtformat = $dformat.' '.$tformat; + $offset = getglobal('member/timeoffset'); + $sysoffset = getglobal('setting/timeoffset'); + $offset = $offset == 9999 ? ($sysoffset ? $sysoffset : 0) : $offset; + $lang = lang('core', 'date'); + } + $timeoffset = $timeoffset == 9999 ? $offset : $timeoffset; + $timeoffset = intval($timeoffset); + $timestamp += $timeoffset * 3600; + $format = empty($format) || $format == 'dt' ? $dtformat : ($format == 'd' ? $dformat : ($format == 't' ? $tformat : $format)); + if($format == 'u') { + $todaytimestamp = TIMESTAMP - (TIMESTAMP + $timeoffset * 3600) % 86400 + $timeoffset * 3600; + $s = gmdate(!$uformat ? $dtformat : $uformat, $timestamp); + $time = TIMESTAMP + $timeoffset * 3600 - $timestamp; + if($timestamp >= $todaytimestamp) { + if($time > 3600) { + $return = intval($time / 3600).' '.$lang['hour'].$lang['before']; + } elseif($time > 1800) { + $return = $lang['half'].$lang['hour'].$lang['before']; + } elseif($time > 60) { + $return = intval($time / 60).' '.$lang['min'].$lang['before']; + } elseif($time > 0) { + $return = $time.' '.$lang['sec'].$lang['before']; + } elseif($time == 0) { + $return = $lang['now']; + } else { + $return = $s; + } + if($time >=0 && !defined('IN_MOBILE')) { + $return = ''.$return.''; + } + } elseif(($days = intval(($todaytimestamp - $timestamp) / 86400)) >= 0 && $days < 7) { + if($days == 0) { + $return = $lang['yday'].' '.gmdate($tformat, $timestamp); + } elseif($days == 1) { + $return = $lang['byday'].' '.gmdate($tformat, $timestamp); + } else { + $return = ($days + 1).' '.$lang['day'].$lang['before']; + } + if(!defined('IN_MOBILE')) { + $return = ''.$return.''; + } + } else { + $return = $s; + } + return $return; + } else { + return gmdate($format, $timestamp); + } +} + +function dmktime($date) { + if(strpos($date, '-')) { + $time = explode('-', $date); + return mktime(0, 0, 0, intval($time[1]), intval($time[2]), intval($time[0])); + } + return 0; +} + +function dnumber($number) { + return abs((int)$number) > 10000 ? ''.intval($number / 10000).lang('core', '10k').'' : $number; +} + +function savecache($cachename, $data) { + C::t('common_syscache')->insert_syscache($cachename, $data); +} + +function save_syscache($cachename, $data) { + savecache($cachename, $data); +} + +function block_get($parameter) { + include_once libfile('function/block'); + block_get_batch($parameter); +} + +function block_display($bid) { + include_once libfile('function/block'); + block_display_batch($bid); +} + +function dimplode($array) { + if(!empty($array)) { + $array = array_map('addslashes', $array); + return "'".implode("','", is_array($array) ? $array : array($array))."'"; + } else { + return 0; + } +} + +function libfile($libname, $folder = '') { + $libpath = '/source/'.$folder; + if(strstr($libname, '/')) { + list($pre, $name) = explode('/', $libname); + $path = "{$libpath}/{$pre}/{$pre}_{$name}"; + } else { + $path = "{$libpath}/{$libname}"; + } + return preg_match('/^[\w\d\/_]+$/i', $path) ? realpath(DISCUZ_ROOT.$path.'.php') : false; +} + +function dstrlen($str) { + if(strtolower(CHARSET) != 'utf-8') { + return strlen($str); + } + $count = 0; + for($i = 0; $i < strlen($str); $i++){ + $value = ord($str[$i]); + if($value > 127) { + $count++; + if($value >= 192 && $value <= 223) $i++; + elseif($value >= 224 && $value <= 239) $i = $i + 2; + elseif($value >= 240 && $value <= 247) $i = $i + 3; + } + $count++; + } + return $count; +} + +function cutstr($string, $length, $dot = ' ...') { + if(strlen($string) <= $length) { + return $string; + } + + $pre = chr(1); + $end = chr(1); + $string = str_replace(array('&', '"', '<', '>'), array($pre.'&'.$end, $pre.'"'.$end, $pre.'<'.$end, $pre.'>'.$end), $string); + + $strcut = ''; + if(strtolower(CHARSET) == 'utf-8') { + + $n = $tn = $noc = 0; + while($n < strlen($string)) { + + $t = ord($string[$n]); + if($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) { + $tn = 1; $n++; $noc++; + } elseif(194 <= $t && $t <= 223) { + $tn = 2; $n += 2; $noc += 2; + } elseif(224 <= $t && $t <= 239) { + $tn = 3; $n += 3; $noc += 2; + } elseif(240 <= $t && $t <= 247) { + $tn = 4; $n += 4; $noc += 2; + } elseif(248 <= $t && $t <= 251) { + $tn = 5; $n += 5; $noc += 2; + } elseif($t == 252 || $t == 253) { + $tn = 6; $n += 6; $noc += 2; + } else { + $n++; + } + + if($noc >= $length) { + break; + } + + } + if($noc > $length) { + $n -= $tn; + } + + $strcut = substr($string, 0, $n); + + } else { + $_length = $length - 1; + for($i = 0; $i < $length; $i++) { + if(ord($string[$i]) <= 127) { + $strcut .= $string[$i]; + } else if($i < $_length) { + $strcut .= $string[$i].$string[++$i]; + } + } + } + + $strcut = str_replace(array($pre.'&'.$end, $pre.'"'.$end, $pre.'<'.$end, $pre.'>'.$end), array('&', '"', '<', '>'), $strcut); + + $pos = strrpos($strcut, chr(1)); + if($pos !== false) { + $strcut = substr($strcut,0,$pos); + } + return $strcut.$dot; +} + +function dstripslashes($string) { + if(empty($string)) return $string; + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = dstripslashes($val); + } + } else { + $string = stripslashes($string); + } + return $string; +} + +function aidencode($aid, $type = 0, $tid = 0) { + global $_G; + $s = !$type ? $aid.'|'.substr(md5($aid.md5($_G['config']['security']['authkey']).TIMESTAMP.$_G['uid']), 0, 8).'|'.TIMESTAMP.'|'.$_G['uid'].'|'.$tid : $aid.'|'.md5($aid.md5($_G['config']['security']['authkey']).TIMESTAMP).'|'.TIMESTAMP; + return rawurlencode(base64_encode($s)); +} + +function getforumimg($aid, $nocache = 0, $w = 140, $h = 140, $type = '') { + global $_G; + $key = dsign($aid.'|'.$w.'|'.$h); + return 'forum.php?mod=image&aid='.$aid.'&size='.$w.'x'.$h.'&key='.rawurlencode($key).($nocache ? '&nocache=yes' : '').($type ? '&type='.$type : ''); +} + +function rewriteoutput($type, $returntype, $host) { + global $_G; + $fextra = ''; + if($type == 'forum_forumdisplay') { + list(,,, $fid, $page, $extra) = func_get_args(); + $r = array( + '{fid}' => empty($_G['setting']['forumkeys'][$fid]) ? $fid : $_G['setting']['forumkeys'][$fid], + '{page}' => $page ? $page : 1, + ); + } elseif($type == 'forum_viewthread') { + list(,,, $tid, $page, $prevpage, $extra) = func_get_args(); + $r = array( + '{tid}' => $tid, + '{page}' => $page ? $page : 1, + '{prevpage}' => $prevpage && !IS_ROBOT ? $prevpage : 1, + ); + } elseif($type == 'home_space') { + list(,,, $uid, $username, $extra) = func_get_args(); + $_G['setting']['rewritecompatible'] && $username = rawurlencode($username); + $r = array( + '{user}' => $uid ? 'uid' : 'username', + '{value}' => $uid ? $uid : $username, + ); + } elseif($type == 'home_blog') { + list(,,, $uid, $blogid, $extra) = func_get_args(); + $r = array( + '{uid}' => $uid, + '{blogid}' => $blogid, + ); + } elseif($type == 'group_group') { + list(,,, $fid, $page, $extra) = func_get_args(); + $r = array( + '{fid}' => $fid, + '{page}' => $page ? $page : 1, + ); + } elseif($type == 'portal_topic') { + list(,,, $name, $extra) = func_get_args(); + $r = array( + '{name}' => $name, + ); + } elseif($type == 'portal_article') { + list(,,, $id, $page, $extra) = func_get_args(); + $r = array( + '{id}' => $id, + '{page}' => $page ? $page : 1, + ); + } elseif($type == 'forum_archiver') { + list(,, $action, $value, $page, $extra) = func_get_args(); + $host = ''; + $r = array( + '{action}' => $action, + '{value}' => $value, + ); + if($page) { + $fextra = '?page='.$page; + } + } elseif($type == 'plugin') { + list(,, $pluginid, $module,, $param, $extra) = func_get_args(); + $host = ''; + $r = array( + '{pluginid}' => $pluginid, + '{module}' => $module, + ); + if($param) { + $fextra = '?'.$param; + } + } + $href = str_replace(array_keys($r), $r, $_G['setting']['rewriterule'][$type]).$fextra; + if(!$returntype) { + return ''; + } else { + return $host.$href; + } +} + +function mobilereplace($file, $replace) { + return helper_mobile::mobilereplace($file, $replace); +} + +function mobileoutput() { + helper_mobile::mobileoutput(); +} + +function output() { + + global $_G; + + + if(defined('DISCUZ_OUTPUTED')) { + return; + } else { + define('DISCUZ_OUTPUTED', 1); + } + + if(!empty($_G['blockupdate'])) { + block_updatecache($_G['blockupdate']['bid']); + } + + if(defined('IN_MOBILE')) { + mobileoutput(); + } + $havedomain = implode('', $_G['setting']['domain']['app']); + if($_G['setting']['rewritestatus'] || !empty($havedomain)) { + $content = ob_get_contents(); + $content = output_replace($content); + + + ob_end_clean(); + $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start(); + + echo $content; + } + + if(isset($_G['makehtml'])) { + helper_makehtml::make_html(); + } + + if($_G['setting']['ftp']['connid']) { + @ftp_close($_G['setting']['ftp']['connid']); + } + $_G['setting']['ftp'] = array(); + + if(defined('CACHE_FILE') && CACHE_FILE && !defined('CACHE_FORBIDDEN') && !defined('IN_MOBILE') && !IS_ROBOT && !checkmobile()) { + if(diskfreespace(DISCUZ_ROOT.'./'.$_G['setting']['cachethreaddir']) > 1000000) { + $content = empty($content) ? ob_get_contents() : $content; + $temp_md5 = md5(substr($_G['timestamp'], 0, -3).substr($_G['config']['security']['authkey'], 3, -3)); + $temp_formhash = substr($temp_md5, 8, 8); + $content = preg_replace('/(name=[\'|\"]formhash[\'|\"] value=[\'\"]|formhash=)('.constant("FORMHASH").')/ismU', '${1}'.$temp_formhash, $content); + $temp_siteurl = 'siteurl_'.substr($temp_md5, 16, 8); + $content = preg_replace('/("|\')('.preg_quote($_G['siteurl'], '/').')/ismU', '${1}'.$temp_siteurl, $content); + $content = empty($content) ? ob_get_contents() : $content; + file_put_contents(CACHE_FILE, $content, LOCK_EX); + chmod(CACHE_FILE, 0777); + } + } + + if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG && @include(libfile('function/debug'))) { + function_exists('debugmessage') && debugmessage(); + } +} + +function output_replace($content) { + global $_G; + if(defined('IN_MODCP') || defined('IN_ADMINCP')) return $content; + if(!empty($_G['setting']['output']['str']['search'])) { + if(empty($_G['setting']['domain']['app']['default'])) { + $_G['setting']['output']['str']['replace'] = str_replace('{CURHOST}', $_G['siteurl'], $_G['setting']['output']['str']['replace']); + } + $content = str_replace($_G['setting']['output']['str']['search'], $_G['setting']['output']['str']['replace'], $content); + } + if(!empty($_G['setting']['output']['preg']['search']) && (empty($_G['setting']['rewriteguest']) || empty($_G['uid']))) { + if(empty($_G['setting']['domain']['app']['default'])) { + $_G['setting']['output']['preg']['search'] = str_replace('\{CURHOST\}', preg_quote($_G['siteurl'], '/'), $_G['setting']['output']['preg']['search']); + $_G['setting']['output']['preg']['replace'] = str_replace('{CURHOST}', $_G['siteurl'], $_G['setting']['output']['preg']['replace']); + } + + foreach($_G['setting']['output']['preg']['search'] as $key => $value) { + $content = preg_replace_callback( + $value, + function ($matches) use ($_G, $key) { + return eval('return ' . $_G['setting']['output']['preg']['replace'][$key] . ';'); + }, + $content + ); + } + } + + return $content; +} + +function output_ajax() { + global $_G; + $s = ob_get_contents(); + ob_end_clean(); + $s = preg_replace("/([\\x01-\\x08\\x0b-\\x0c\\x0e-\\x1f])+/", ' ', $s); + $s = str_replace(array(chr(0), ']]>'), array(' ', ']]>'), $s); + if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG && @include(libfile('function/debug'))) { + function_exists('debugmessage') && $s .= debugmessage(1); + } + $havedomain = implode('', $_G['setting']['domain']['app']); + if($_G['setting']['rewritestatus'] || !empty($havedomain)) { + $s = output_replace($s); + } + return $s; +} + +function runhooks($scriptextra = '') { + if(!defined('HOOKTYPE')) { + define('HOOKTYPE', !defined('IN_MOBILE') ? 'hookscript' : 'hookscriptmobile'); + } + if(defined('CURMODULE')) { + global $_G; + if($_G['setting']['plugins']['func'][HOOKTYPE]['common']) { + hookscript('common', 'global', 'funcs', array(), 'common'); + } + hookscript(CURMODULE, $_G['basescript'], 'funcs', array(), '', $scriptextra); + } +} + +function hookscript($script, $hscript, $type = 'funcs', $param = array(), $func = '', $scriptextra = '') { + global $_G; + static $pluginclasses = array(); + if($hscript == 'home') { + if($script == 'space') { + $scriptextra = !$scriptextra ? getgpc('do') : $scriptextra; + $script = 'space'.(!empty($scriptextra) ? '_'.$scriptextra : ''); + } elseif($script == 'spacecp') { + $scriptextra = !$scriptextra ? getgpc('ac') : $scriptextra; + $script .= !empty($scriptextra) ? '_'.$scriptextra : ''; + } + } + if(!defined('HOOKTYPE')) { + define('HOOKTYPE', !defined('IN_MOBILE') ? 'hookscript' : 'hookscriptmobile'); + } + if(!isset($_G['setting'][HOOKTYPE][$hscript][$script][$type])) { + return; + } + if(!isset($_G['cache']['plugin'])) { + loadcache('plugin'); + } + foreach((array)$_G['setting'][HOOKTYPE][$hscript][$script]['module'] as $identifier => $include) { + if($_G['pluginrunlist'] && !in_array($identifier, $_G['pluginrunlist'])) { + continue; + } + $hooksadminid[$identifier] = !$_G['setting'][HOOKTYPE][$hscript][$script]['adminid'][$identifier] || ($_G['setting'][HOOKTYPE][$hscript][$script]['adminid'][$identifier] && $_G['adminid'] > 0 && $_G['setting']['hookscript'][$hscript][$script]['adminid'][$identifier] >= $_G['adminid']); + if($hooksadminid[$identifier]) { + @include_once DISCUZ_ROOT.'./source/plugin/'.$include.'.class.php'; + } + } + if(isset($_G['setting'][HOOKTYPE][$hscript][$script][$type]) && is_array($_G['setting'][HOOKTYPE][$hscript][$script][$type])) { + $_G['inhookscript'] = true; + $funcs = !$func ? $_G['setting'][HOOKTYPE][$hscript][$script][$type] : array($func => $_G['setting'][HOOKTYPE][$hscript][$script][$type][$func]); + foreach($funcs as $hookkey => $hookfuncs) { + foreach($hookfuncs as $hookfunc) { + if($hooksadminid[$hookfunc[0]]) { + $classkey = (HOOKTYPE != 'hookscriptmobile' ? '' : 'mobile').'plugin_'.($hookfunc[0].($hscript != 'global' ? '_'.$hscript : '')); + if(!class_exists($classkey, false)) { + continue; + } + if(!isset($pluginclasses[$classkey])) { + $pluginclasses[$classkey] = new $classkey; + } + if(!method_exists($pluginclasses[$classkey], $hookfunc[1])) { + continue; + } + $return = call_user_func(array($pluginclasses[$classkey], $hookfunc[1]), $param); + + if(substr($hookkey, -7) == '_extend' && !empty($_G['setting']['pluginhooks'][$hookkey])) { + continue; + } + + if(is_array($return)) { + if(!isset($_G['setting']['pluginhooks'][$hookkey]) || is_array($_G['setting']['pluginhooks'][$hookkey])) { + foreach($return as $k => $v) { + $_G['setting']['pluginhooks'][$hookkey][$k] .= $v; + } + } else { + foreach($return as $k => $v) { + $_G['setting']['pluginhooks'][$hookkey][$k] = $v; + } + } + } else { + if(!(isset($_G['setting']['pluginhooks'][$hookkey]) && is_array($_G['setting']['pluginhooks'][$hookkey]))) { + if(!isset($_G['setting']['pluginhooks'][$hookkey])) { + $_G['setting']['pluginhooks'][$hookkey] = ''; + } + $_G['setting']['pluginhooks'][$hookkey] .= $return; + } else { + foreach($_G['setting']['pluginhooks'][$hookkey] as $k => $v) { + $_G['setting']['pluginhooks'][$hookkey][$k] .= $return; + } + } + } + } + } + } + } + $_G['inhookscript'] = false; +} + +function hookscriptoutput($tplfile) { + global $_G; + if(!empty($_G['hookscriptoutput'])) { + return; + } + hookscript('global', 'global'); + $_G['hookscriptoutput'] = true; + if(defined('CURMODULE')) { + $param = array('template' => $tplfile, 'message' => getglobal('hookscriptmessage'), 'values' => getglobal('hookscriptvalues')); + hookscript(CURMODULE, $_G['basescript'], 'outputfuncs', $param); + } +} + +function pluginmodule($pluginid, $type) { + global $_G; + $pluginid = $pluginid ? preg_replace("/[^A-Za-z0-9_:]/", '', $pluginid) : ''; + if(!isset($_G['cache']['plugin'])) { + loadcache('plugin'); + } + list($identifier, $module) = explode(':', $pluginid); + if(!is_array($_G['setting']['plugins'][$type]) || !array_key_exists($pluginid, $_G['setting']['plugins'][$type])) { + showmessage('plugin_nonexistence'); + } + if(!empty($_G['setting']['plugins'][$type][$pluginid]['url'])) { + dheader('location: '.$_G['setting']['plugins'][$type][$pluginid]['url']); + } + $directory = $_G['setting']['plugins'][$type][$pluginid]['directory']; + if(empty($identifier) || !preg_match("/^[a-z]+[a-z0-9_]*\/$/i", $directory) || !preg_match("/^[a-z0-9_\-]+$/i", $module)) { + showmessage('undefined_action'); + } + if(@!file_exists(DISCUZ_ROOT.($modfile = './source/plugin/'.$directory.$module.'.inc.php'))) { + showmessage('plugin_module_nonexistence', '', array('mod' => $modfile)); + } + return DISCUZ_ROOT.$modfile; +} +function updatecreditbyaction($action, $uid = 0, $extrasql = array(), $needle = '', $coef = 1, $update = 1, $fid = 0) { + + $credit = credit::instance(); + if($extrasql) { + $credit->extrasql = $extrasql; + } + return $credit->execrule($action, $uid, $needle, $coef, $update, $fid); +} + +function checklowerlimit($action, $uid = 0, $coef = 1, $fid = 0, $returnonly = 0) { + require_once libfile('function/credit'); + return _checklowerlimit($action, $uid, $coef, $fid, $returnonly); +} + +function batchupdatecredit($action, $uids = 0, $extrasql = array(), $coef = 1, $fid = 0) { + + $credit = & credit::instance(); + if($extrasql) { + $credit->extrasql = $extrasql; + } + return $credit->updatecreditbyrule($action, $uids, $coef, $fid); +} + + +function updatemembercount($uids, $dataarr = array(), $checkgroup = true, $operation = '', $relatedid = 0, $ruletxt = '', $customtitle = '', $custommemo = '') { + if(!empty($uids) && (is_array($dataarr) && $dataarr)) { + require_once libfile('function/credit'); + return _updatemembercount($uids, $dataarr, $checkgroup, $operation, $relatedid, $ruletxt, $customtitle, $custommemo); + } + return true; +} + +function checkusergroup($uid = 0) { + $credit = & credit::instance(); + $credit->checkusergroup($uid); +} + +function checkformulasyntax($formula, $operators, $tokens, $values = '', $funcs = array()) { + $var = implode('|', $tokens); + + if(!empty($formula)) { + $formula = preg_replace("/($var)/", "\$\\1", $formula); + return formula_tokenize($formula, $operators, $tokens, $values, $funcs); + } + return true; +} + +function formula_tokenize($formula, $operators, $tokens, $values, $funcs) { + $fexp = token_get_all(' $val) { + if(is_array($val)) { + if(in_array($val[0], array(T_VARIABLE, T_CONSTANT_ENCAPSED_STRING, T_LNUMBER, T_DNUMBER))) { + if(!in_array($prevseg, array(1, 4))) { + return false; + } + $prevseg = 3; + if($val[0] == T_VARIABLE && !preg_match('/^\$('.$tks.')$/', $val[1])) { + return false; + } + if($val[0] == T_CONSTANT_ENCAPSED_STRING && !($values && preg_match('/^'.$values.'$/', $val[1]))) { + return false; + } + } elseif($val[0] == T_STRING && in_array($val[1], $funcs)) { + if(!in_array($prevseg, array(1, 4))) { + return false; + } + $prevseg = 5; + } elseif($val[0] == T_WHITESPACE || ($k == 0 && $val[0] == T_OPEN_TAG)) { + } elseif(in_array($val[1], $op2)) { + if(!in_array($prevseg, array(2, 3))) { + return false; + } + $prevseg = 4; + } else { + return false; + } + } else { + if($val === '(') { + if(!in_array($prevseg, array(1, 4, 5))) { + return false; + } + $prevseg = 1; + $isclose++; + } elseif($val === ')') { + if(!in_array($prevseg, array(2, 3))) { + return false; + } + $prevseg = 2; + $isclose--; + if($isclose < 0) { + return false; + } + } elseif(in_array($val, $op1)) { + if(!in_array($prevseg, array(2, 3)) && $val !== '-') { + return false; + } + $prevseg = 4; + } else { + return false; + } + } + } + return (in_array($prevseg, array(2, 3)) && $isclose === 0); +} + +function checkformulacredits($formula) { + return checkformulasyntax( + $formula, + array('+', '-', '*', '/'), + array('extcredits[1-8]', 'digestposts', 'posts', 'threads', 'oltime', 'friends', 'doings', 'polls', 'blogs', 'albums', 'sharings') + ); +} + +function debug($var = null, $vardump = false) { + echo '
    ';
    +	$vardump = empty($var) ? true : $vardump;
    +	if($vardump) {
    +		var_dump($var);
    +	} else {
    +		print_r($var);
    +	}
    +	exit();
    +}
    +
    +function debuginfo() {
    +	global $_G;
    +	if(getglobal('setting/debug')) {
    +		$_G['debuginfo'] = array(
    +		    'time' => number_format((microtime(true) - $_G['starttime']), 6),
    +		    'queries' => DB::object()->querynum,
    +		    'memory' => ucwords(C::memory()->type)
    +		    );
    +		if(DB::object()->slaveid) {
    +			$_G['debuginfo']['queries'] = 'Total '.DB::object()->querynum.', Slave '.DB::object()->slavequery;
    +		}
    +		return TRUE;
    +	} else {
    +		return FALSE;
    +	}
    +}
    +
    +function getfocus_rand($module) {
    +	global $_G;
    +
    +	if(empty($_G['setting']['focus']) || !array_key_exists($module, $_G['setting']['focus']) || !empty($_G['cookie']['nofocus_'.$module]) || !$_G['setting']['focus'][$module]) {
    +		return null;
    +	}
    +	loadcache('focus');
    +	if(empty($_G['cache']['focus']['data']) || !is_array($_G['cache']['focus']['data'])) {
    +		return null;
    +	}
    +	$focusid = $_G['setting']['focus'][$module][array_rand($_G['setting']['focus'][$module])];
    +	return $focusid;
    +}
    +
    +function check_seccode($value, $idhash, $fromjs = 0, $modid = '', $verifyonly = false) {
    +	return helper_seccheck::check_seccode($value, $idhash, $fromjs, $modid, $verifyonly);
    +}
    +
    +function check_secqaa($value, $idhash, $verifyonly = false) {
    +	return helper_seccheck::check_secqaa($value, $idhash, $verifyonly);
    +}
    +
    +function seccheck($rule, $param = array()) {
    +	return helper_seccheck::seccheck($rule, $param);
    +}
    +
    +function make_seccode($seccode = '') {
    +	return helper_seccheck::make_seccode($seccode);
    +}
    +
    +function make_secqaa() {
    +	return helper_seccheck::make_secqaa();
    +}
    +
    +function adshow($parameter) {
    +	global $_G;
    +	if(getgpc('inajax') || $_G['group']['closead']) {
    +		return;
    +	}
    +	$return = (isset($_G['config']['plugindeveloper']) && $_G['config']['plugindeveloper'] == 2) ? '[ad '.$parameter.']' : '';
    +	$params = explode('/', $parameter);
    +	$customid = 0;
    +	$customc = explode('_', $params[0]);
    +	if($customc[0] == 'custom') {
    +		$params[0] = $customc[0];
    +		$customid = $customc[1];
    +	}
    +	$adcontent = null;
    +	if(empty($_G['setting']['advtype']) || !in_array($params[0], $_G['setting']['advtype'])) {
    +		$adcontent = '';
    +	}
    +	if($adcontent === null) {
    +		loadcache('advs');
    +		$adids = array();
    +		$evalcode = &$_G['cache']['advs']['evalcode'][$params[0]];
    +		$parameters = &$_G['cache']['advs']['parameters'][$params[0]];
    +		$codes = &$_G['cache']['advs']['code'][$_G['basescript']][$params[0]];
    +		if(!empty($codes)) {
    +			foreach($codes as $adid => $code) {
    +				$parameter = &$parameters[$adid];
    +				$checked = true;
    +				@eval($evalcode['check']);
    +				if($checked) {
    +					$adids[] = $adid;
    +				}
    +			}
    +			if(!empty($adids)) {
    +				$adcode = $extra = '';
    +				@eval($evalcode['create']);
    +				if(empty($notag)) {
    +					$adcontent = ''.$adcode.'
    '; + } else { + $adcontent = $adcode; + } + } + } + } + $adfunc = 'ad_'.$params[0]; + $_G['setting']['pluginhooks'][$adfunc] = null; + hookscript('ad', 'global', 'funcs', array('params' => $params, 'content' => $adcontent, 'customid' => $customid), $adfunc); + if(empty($_G['setting']['hookscript']['global']['ad']['funcs'][$adfunc])) { + hookscript('ad', $_G['basescript'], 'funcs', array('params' => $params, 'content' => $adcontent, 'customid' => $customid), $adfunc); + } + return $return.($_G['setting']['pluginhooks'][$adfunc] === null ? $adcontent : $_G['setting']['pluginhooks'][$adfunc]); +} + +function showmessage($message, $url_forward = '', $values = array(), $extraparam = array(), $custom = 0) { + require_once libfile('function/message'); + return dshowmessage($message, $url_forward, $values, $extraparam, $custom); +} + +function submitcheck($var, $allowget = 0, $seccodecheck = 0, $secqaacheck = 0) { + if(!getgpc($var)) { + return FALSE; + } else { + return helper_form::submitcheck($var, $allowget, $seccodecheck, $secqaacheck); + } +} + +function multi($num, $perpage, $curpage, $mpurl, $maxpages = 0, $page = 10, $autogoto = FALSE, $simple = FALSE, $jsfunc = FALSE) { + return $num > $perpage ? helper_page::multi($num, $perpage, $curpage, $mpurl, $maxpages, $page, $autogoto, $simple, $jsfunc) : ''; +} + +function simplepage($num, $perpage, $curpage, $mpurl) { + return helper_page::simplepage($num, $perpage, $curpage, $mpurl); +} + +function censor($message, $modword = NULL, $return = FALSE, $modasban = TRUE) { + return helper_form::censor($message, $modword, $return, $modasban); +} + +function censormod($message) { + return getglobal('group/ignorecensor') || !$message ? false :helper_form::censormod($message); +} + +function space_merge(&$values, $tablename, $isarchive = false) { + global $_G; + + $uid = empty($values['uid'])?$_G['uid']:$values['uid']; + $var = "member_{$uid}_{$tablename}"; + if($uid) { + if(!isset($_G[$var])) { + $ext = $isarchive ? '_archive' : ''; + if(($_G[$var] = C::t('common_member_'.$tablename.$ext)->fetch($uid)) !== false) { + if($tablename == 'field_home') { + $_G['setting']['privacy'] = empty($_G['setting']['privacy']) ? array() : (is_array($_G['setting']['privacy']) ? $_G['setting']['privacy'] : dunserialize($_G['setting']['privacy'])); + $_G[$var]['privacy'] = empty($_G[$var]['privacy']) ? array() : (is_array($_G[$var]['privacy']) ? $_G[$var]['privacy'] : dunserialize($_G[$var]['privacy'])); + foreach (array('feed','view','profile') as $pkey) { + if(empty($_G[$var]['privacy'][$pkey]) && !isset($_G[$var]['privacy'][$pkey])) { + $_G[$var]['privacy'][$pkey] = isset($_G['setting']['privacy'][$pkey]) ? $_G['setting']['privacy'][$pkey] : array(); + } + } + $_G[$var]['acceptemail'] = empty($_G[$var]['acceptemail'])? array() : dunserialize($_G[$var]['acceptemail']); + if(empty($_G[$var]['acceptemail'])) { + $_G[$var]['acceptemail'] = empty($_G['setting']['acceptemail'])?array():dunserialize($_G['setting']['acceptemail']); + } + } + } else { + C::t('common_member_'.$tablename.$ext)->insert(array('uid'=>$uid)); + $_G[$var] = array(); + } + } + $values = array_merge($values, $_G[$var]); + } +} + +function runlog($file, $message, $halt=0) { + helper_log::runlog($file, $message, $halt); +} + +function stripsearchkey($string) { + $string = trim($string); + $string = str_replace('*', '%', addcslashes($string, '%_')); + return $string; +} + +function dmkdir($dir, $mode = 0777, $makeindex = TRUE){ + if(!is_dir($dir)) { + dmkdir(dirname($dir), $mode, $makeindex); + @mkdir($dir, $mode); + if(!empty($makeindex)) { + @touch($dir.'/index.html'); @chmod($dir.'/index.html', 0777); + } + } + return true; +} + +function dreferer($default = '') { + global $_G; + + $default = empty($default) && $_ENV['curapp'] ? $_ENV['curapp'].'.php' : ''; + $_G['referer'] = !empty($_GET['referer']) ? $_GET['referer'] : $_SERVER['HTTP_REFERER']; + $_G['referer'] = substr($_G['referer'], -1) == '?' ? substr($_G['referer'], 0, -1) : $_G['referer']; + + if(strpos($_G['referer'], 'member.php?mod=logging')) { + $_G['referer'] = $default; + } + + $reurl = parse_url($_G['referer']); + $hostwithport = $reurl['host'] . (isset($reurl['port']) ? ':' . $reurl['port'] : ''); + + if(!$reurl || (isset($reurl['scheme']) && !in_array(strtolower($reurl['scheme']), array('http', 'https')))) { + $_G['referer'] = ''; + } + + if(!empty($hostwithport) && !in_array($hostwithport, array($_SERVER['HTTP_HOST'], 'www.'.$_SERVER['HTTP_HOST'])) && !in_array($_SERVER['HTTP_HOST'], array($hostwithport, 'www.'.$hostwithport))) { + if(!in_array($hostwithport, $_G['setting']['domain']['app']) && !isset($_G['setting']['domain']['list'][$hostwithport])) { + $domainroot = substr($hostwithport, strpos($hostwithport, '.')+1); + if(empty($_G['setting']['domain']['root']) || (is_array($_G['setting']['domain']['root']) && !in_array($domainroot, $_G['setting']['domain']['root']))) { + $_G['referer'] = $_G['setting']['domain']['defaultindex'] ? $_G['setting']['domain']['defaultindex'] : 'index.php'; + } + } + } elseif(empty($hostwithport)) { + $_G['referer'] = $_G['siteurl'].'./'.$_G['referer']; + } + + $_G['referer'] = durlencode($_G['referer']); + return $_G['referer']; +} + +function ftpcmd($cmd, $arg1 = '') { + static $ftp; + $ftpconfig = getglobal('setting/ftp'); + if(empty($ftpconfig['on']) || empty($ftpconfig['host'])) { + return $cmd == 'error' ? -101 : 0; + } elseif($ftp == null) { + $ftp = & discuz_ftp::instance(); + } + if(!$ftp->enabled) { + return $ftp->error(); + } elseif($ftp->enabled && !$ftp->connectid) { + $ftp->connect(); + } + switch ($cmd) { + case 'upload' : return $ftp->upload(getglobal('setting/attachdir').'/'.$arg1, $arg1); break; + case 'delete' : return $ftp->ftp_delete($arg1); break; + case 'close' : return $ftp->ftp_close(); break; + case 'error' : return $ftp->error(); break; + case 'object' : return $ftp; break; + default : return false; + } + +} + +function ftpperm($fileext, $filesize) { + global $_G; + $return = false; + if($_G['setting']['ftp']['on']) { + if(((!$_G['setting']['ftp']['allowedexts'] && !$_G['setting']['ftp']['disallowedexts']) || ($_G['setting']['ftp']['allowedexts'] && in_array($fileext, $_G['setting']['ftp']['allowedexts'])) || ($_G['setting']['ftp']['disallowedexts'] && !in_array($fileext, $_G['setting']['ftp']['disallowedexts']) && (!$_G['setting']['ftp']['allowedexts'] || $_G['setting']['ftp']['allowedexts'] && in_array($fileext, $_G['setting']['ftp']['allowedexts'])))) && (!$_G['setting']['ftp']['minsize'] || $filesize >= $_G['setting']['ftp']['minsize'] * 1024)) { + $return = true; + } + } + return $return; +} + +function diconv($str, $in_charset, $out_charset = CHARSET, $ForceTable = FALSE) { + global $_G; + + $in_charset = strtoupper($in_charset); + $out_charset = strtoupper($out_charset); + + if(empty($str) || $in_charset == $out_charset) { + return $str; + } + + $out = ''; + + if(!$ForceTable) { + if(function_exists('iconv')) { + $out = iconv($in_charset, $out_charset.'//IGNORE', $str); + } elseif(function_exists('mb_convert_encoding')) { + $out = mb_convert_encoding($str, $out_charset, $in_charset); + } + } + + if($out == '') { + $chinese = new Chinese($in_charset, $out_charset, true); + $out = $chinese->Convert($str); + } + + return $out; +} + +function widthauto() { + global $_G; + if($_G['disabledwidthauto']) { + return 0; + } + if(!empty($_G['widthauto'])) { + return $_G['widthauto'] > 0 ? 1 : 0; + } + if($_G['setting']['switchwidthauto'] && !empty($_G['cookie']['widthauto'])) { + return $_G['cookie']['widthauto'] > 0 ? 1 : 0; + } else { + return $_G['setting']['allowwidthauto'] ? 0 : 1; + } +} +function renum($array) { + $newnums = $nums = array(); + foreach ($array as $id => $num) { + $newnums[$num][] = $id; + $nums[$num] = $num; + } + return array($nums, $newnums); +} + +function sizecount($size) { + if($size >= 1073741824) { + $size = round($size / 1073741824 * 100) / 100 . ' GB'; + } elseif($size >= 1048576) { + $size = round($size / 1048576 * 100) / 100 . ' MB'; + } elseif($size >= 1024) { + $size = round($size / 1024 * 100) / 100 . ' KB'; + } else { + $size = intval($size) . ' Bytes'; + } + return $size; +} + +function swapclass($class1, $class2 = '') { + static $swapc = null; + $swapc = isset($swapc) && $swapc != $class1 ? $class1 : $class2; + return $swapc; +} + +function writelog($file, $log) { + helper_log::writelog($file, $log); +} + +function getstatus($status, $position) { + $t = (int)$status & pow(2, (int)$position - 1) ? 1 : 0; + return $t; +} + +function setstatus($position, $value, $baseon = null) { + $t = pow(2, $position - 1); + if($value) { + $t = $baseon | $t; + } elseif ($baseon !== null) { + $t = $baseon & ~$t; + } else { + $t = ~$t; + } + return $t & 0xFFFF; +} + +function notification_add($touid, $type, $note, $notevars = array(), $system = 0) { + return helper_notification::notification_add($touid, $type, $note, $notevars, $system); +} + +function manage_addnotify($type, $from_num = 0, $langvar = array()) { + helper_notification::manage_addnotify($type, $from_num, $langvar); +} + +function sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0) { + return helper_pm::sendpm($toid, $subject, $message, $fromid, $replypmid, $isusername, $type); +} + +function g_icon($groupid, $return = 0) { + global $_G; + if(empty($_G['cache']['usergroups'][$groupid]['icon'])) { + $s = ''; + } else { + if(preg_match('/^https?:\/\//is', $_G['cache']['usergroups'][$groupid]['icon'])) { + $s = ''; + } else { + $s = ''; + } + } + if($return) { + return $s; + } else { + echo $s; + } +} +function updatediytemplate($targettplname = '', $tpldirectory = '') { + $r = false; + $alldata = !empty($targettplname) ? array( C::t('common_diy_data')->fetch_diy($targettplname, $tpldirectory)) : C::t('common_diy_data')->range(); + require_once libfile('function/portalcp'); + foreach($alldata as $value) { + $r = save_diy_data($value['tpldirectory'], $value['primaltplname'], $value['targettplname'], dunserialize($value['diycontent'])); + } + return $r; +} + +function getposttablebytid($tids, $primary = 0) { + return table_forum_post::getposttablebytid($tids, $primary); +} + +function getposttable($tableid = 0, $prefix = false) { + return table_forum_post::getposttable($tableid, $prefix); +} + +function memory($cmd, $key='', $value='', $ttl = 0, $prefix = '') { + static $supported_command = array( + 'set', 'add', 'get', 'rm', 'inc', 'dec', 'exists', + 'incex', /* 存在时才inc */ + 'sadd', 'srem', 'scard', 'smembers', 'sismember', + 'hmset', 'hgetall', 'hexists', 'hget', + 'eval', + 'zadd', 'zcard', 'zrem', 'zscore', 'zrevrange', 'zincrby', 'zrevrangewithscore' /* 带score返回 */, + 'pipeline', 'commit', 'discard' + ); + + if($cmd == 'check') { + return C::memory()->enable ? C::memory()->type : ''; + } elseif(C::memory()->enable && in_array($cmd, $supported_command)) { + if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) { + if(is_array($key)) { + foreach($key as $k) { + C::memory()->debug[$cmd][] = ($cmd == 'get' || $cmd == 'rm' || $cmd == 'add' ? $value : '').$prefix.$k; + } + } else { + if ($cmd === 'hget') { + C::memory()->debug[$cmd][] = $prefix . $key . "->" . $value; + } elseif ($cmd === 'eval') { + C::memory()->debug[$cmd][] = $key . "->" . $ttl; + } else { + C::memory()->debug[$cmd][] = ($cmd == 'get' || $cmd == 'rm' || $cmd == 'add' ? $value : '').$prefix.$key; + } + } + } + switch ($cmd) { + case 'set': return C::memory()->set($key, $value, $ttl, $prefix); break; + case 'add': return C::memory()->add($key, $value, $ttl, $prefix); break; + case 'get': return C::memory()->get($key, $value/*prefix*/); break; + case 'rm': return C::memory()->rm($key, $value/*prefix*/); break; + case 'exists': return C::memory()->exists($key, $value/*prefix*/); break; + case 'inc': return C::memory()->inc($key, $value ? $value : 1, $prefix); break; + case 'incex': return C::memory()->incex($key, $value ? $value : 1, $prefix); break; + case 'dec': return C::memory()->dec($key, $value ? $value : 1, $prefix); break; + case 'sadd': return C::memory()->sadd($key, $value, $prefix); break; + case 'srem': return C::memory()->srem($key, $value, $prefix); break; + case 'scard': return C::memory()->scard($key, $value/*prefix*/); break; + case 'smembers': return C::memory()->smembers($key, $value/*prefix*/); break; + case 'sismember': return C::memory()->sismember($key, $value, $prefix); break; + case 'hmset': return C::memory()->hmset($key, $value, $prefix); break; + case 'hgetall': return C::memory()->hgetall($key, $value/*prefix*/); break; + case 'hexists': return C::memory()->hexists($key, $value/*field*/, $prefix); break; + case 'hget': return C::memory()->hget($key, $value/*field*/, $prefix); break; + case 'eval': return C::memory()->evalscript($key/*script*/, $value/*args*/, $ttl/*sha key*/, $prefix); break; + case 'zadd': return C::memory()->zadd($key, $value, $ttl/*score*/, $prefix); break; + case 'zrem': return C::memory()->zrem($key, $value, $prefix); break; + case 'zscore': return C::memory()->zscore($key, $value, $prefix); break; + case 'zcard': return C::memory()->zcard($key, $value/*prefix*/); break; + case 'zrevrange': return C::memory()->zrevrange($key, $value/*start*/, $ttl/*end*/, $prefix); break; + case 'zrevrangewithscore': return C::memory()->zrevrange($key, $value/*start*/, $ttl/*end*/, $prefix, true); break; + case 'zincrby': return C::memory()->zincrby($key, $value/*member*/, $ttl ? $ttl : 1/*to increase*/, $prefix); break; + case 'pipeline': return C::memory()->pipeline(); break; + case 'commit': return C::memory()->commit(); break; + case 'discard': return C::memory()->discard(); break; + } + } + return null; +} + +function ipaccess($ip, $accesslist) { + return ip::checkaccess($ip, $accesslist); +} + +function ipbanned($ip) { + return ip::checkbanned($ip); +} + +function getcount($tablename, $condition) { + if(empty($condition)) { + $where = '1'; + } elseif(is_array($condition)) { + $where = DB::implode_field_value($condition, ' AND '); + } else { + $where = $condition; + } + $ret = intval(DB::result_first("SELECT COUNT(*) AS num FROM ".DB::table($tablename)." WHERE $where")); + return $ret; +} + +function sysmessage($message) { + helper_sysmessage::show($message); +} + +function forumperm($permstr, $groupid = 0) { + global $_G; + $groupidarray = array($_G['groupid']); + if($groupid) { + return preg_match("/(^|\t)(".$groupid.")(\t|$)/", $permstr); + } + $groupterms = dunserialize(getuserprofile('groupterms')); + foreach(explode("\t", $_G['member']['extgroupids']) as $extgroupid) { + if($extgroupid = intval(trim($extgroupid))) { + if($groupterms['ext'][$extgroupid] && $groupterms['ext'][$extgroupid] < TIMESTAMP){ + continue; + } + $groupidarray[] = $extgroupid; + } + } + if($_G['setting']['verify']['enabled']) { + getuserprofile('verify1'); + foreach($_G['setting']['verify'] as $vid => $verify) { + if($verify['available'] && $_G['member']['verify'.$vid] == 1) { + $groupidarray[] = 'v'.$vid; + } + } + } + return preg_match("/(^|\t)(".implode('|', $groupidarray).")(\t|$)/", $permstr); +} + +function checkperm($perm) { + global $_G; + return defined('IN_ADMINCP') ? true : (empty($_G['group'][$perm])?'':$_G['group'][$perm]); +} + +function periodscheck($periods, $showmessage = 1) { + global $_G; + if(($periods == 'postmodperiods' || $periods == 'postbanperiods') && (getglobal('setting/postignorearea') || getglobal('setting/postignoreip'))) { + if($_G['setting']['postignoreip']) { + foreach(explode("\n", $_G['setting']['postignoreip']) as $ctrlip) { + if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) { + return false; + break; + } + } + } + if($_G['setting']['postignorearea']) { + $location = $whitearea = ''; + require_once libfile('function/misc'); + $location = trim(convertip($_G['clientip'])); + if($location) { + $whitearea = preg_quote(trim($_G['setting']['postignorearea']), '/'); + $whitearea = str_replace(array("\\*"), array('.*'), $whitearea); + $whitearea = '.*'.$whitearea.'.*'; + $whitearea = '/^('.str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea).')$/i'; + if(@preg_match($whitearea, $location)) { + return false; + } + } + } + } + if(!$_G['group']['disableperiodctrl'] && $_G['setting'][$periods]) { + $now = dgmdate(TIMESTAMP, 'G.i', $_G['setting']['timeoffset']); + foreach(explode("\r\n", str_replace(':', '.', $_G['setting'][$periods])) as $period) { + list($periodbegin, $periodend) = explode('-', $period); + if(($periodbegin > $periodend && ($now >= $periodbegin || $now < $periodend)) || ($periodbegin < $periodend && $now >= $periodbegin && $now < $periodend)) { + $banperiods = str_replace("\r\n", ', ', $_G['setting'][$periods]); + if($showmessage) { + showmessage('period_nopermission', NULL, array('banperiods' => $banperiods), array('login' => 1)); + } else { + return TRUE; + } + } + } + } + return FALSE; +} + +function cknewuser($return=0) { + global $_G; + + $result = true; + + if(!$_G['uid']) return true; + + if(checkperm('disablepostctrl')) { + return $result; + } + $ckuser = $_G['member']; + + if($_G['setting']['newbiespan'] && $_G['timestamp']-$ckuser['regdate']<$_G['setting']['newbiespan']*60) { + if(empty($return)) showmessage('no_privilege_newbiespan', '', array('newbiespan' => $_G['setting']['newbiespan']), array()); + $result = false; + } + if($_G['setting']['need_avatar'] && empty($ckuser['avatarstatus'])) { + if(empty($return)) showmessage('no_privilege_avatar', '', array(), array()); + $result = false; + } + if($_G['setting']['need_secmobile'] && empty($ckuser['secmobilestatus'])) { + if(empty($return)) showmessage('no_privilege_secmobile', '', array(), array()); + $result = false; + } + if($_G['setting']['need_email'] && empty($ckuser['emailstatus'])) { + if(empty($return)) showmessage('no_privilege_email', '', array(), array()); + $result = false; + } + if($_G['setting']['need_friendnum']) { + space_merge($ckuser, 'count'); + if($ckuser['friends'] < $_G['setting']['need_friendnum']) { + if(empty($return)) showmessage('no_privilege_friendnum', '', array('friendnum' => $_G['setting']['need_friendnum']), array()); + $result = false; + } + } + return $result; +} + +function useractionlog($uid, $action) { + return helper_log::useractionlog($uid, $action); +} + +function getuseraction($var) { + return helper_log::getuseraction($var); +} + +function getuserapp($panel = 0) { + return ''; +} + +function getmyappiconpath($appid, $iconstatus=0) { + return ''; +} + +function getexpiration() { + global $_G; + $date = getdate($_G['timestamp']); + return mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) + 86400; +} + +function return_bytes($val) { + $last = strtolower($val[strlen($val)-1]); + if (!is_numeric($val)) { + $val = substr(trim($val), 0, -1); + } + switch($last) { + case 'g': $val *= 1024; + case 'm': $val *= 1024; + case 'k': $val *= 1024; + } + return $val; +} + +function iswhitelist($host) { + global $_G; + static $iswhitelist = array(); + + if(isset($iswhitelist[$host])) { + return $iswhitelist[$host]; + } + $hostlen = strlen($host); + $iswhitelist[$host] = false; + if(!$_G['cache']['domainwhitelist']) { + loadcache('domainwhitelist'); + } + if(is_array($_G['cache']['domainwhitelist'])) foreach($_G['cache']['domainwhitelist'] as $val) { + $domainlen = strlen($val); + if($domainlen > $hostlen) { + continue; + } + if(substr($host, -$domainlen) == $val) { + $iswhitelist[$host] = true; + break; + } + } + if($iswhitelist[$host] == false) { + $iswhitelist[$host] = $host == $_SERVER['HTTP_HOST']; + } + return $iswhitelist[$host]; +} + +function getattachtablebyaid($aid) { + $attach = C::t('forum_attachment')->fetch($aid); + $tableid = $attach['tableid']; + return 'forum_attachment_'.($tableid >= 0 && $tableid < 10 ? intval($tableid) : 'unused'); +} + +function getattachtableid($tid) { + $tid = (string)$tid; + return intval($tid[strlen($tid)-1]); +} + +function getattachtablebytid($tid) { + return 'forum_attachment_'.getattachtableid($tid); +} + +function getattachtablebypid($pid) { + $tableid = DB::result_first("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE pid='$pid' LIMIT 1"); + return 'forum_attachment_'.($tableid >= 0 && $tableid < 10 ? intval($tableid) : 'unused'); +} + +function getattachnewaid($uid = 0) { + global $_G; + $uid = !$uid ? $_G['uid'] : $uid; + return C::t('forum_attachment')->insert(array('tid' => 0, 'pid' => 0, 'uid' => $uid, 'tableid' => 127), true); +} + +function get_seosetting($page, $data = array(), $defset = array()) { + return helper_seo::get_seosetting($page, $data, $defset); +} + +function getimgthumbname($fileStr, $extend='.thumb.jpg', $holdOldExt=true) { + if(empty($fileStr)) { + return ''; + } + if(!$holdOldExt) { + $fileStr = substr($fileStr, 0, strrpos($fileStr, '.')); + } + $extend = strstr($extend, '.') ? $extend : '.'.$extend; + return $fileStr.$extend; +} + +function updatemoderate($idtype, $ids, $status = 0) { + helper_form::updatemoderate($idtype, $ids, $status); +} + +function userappprompt() { +} + +function dintval($int, $allowarray = false) { + $ret = intval($int); + if($int == '' || $int == $ret || !$allowarray && is_array($int)) return $ret; + if($allowarray && is_array($int)) { + foreach($int as &$v) { + $v = dintval($v, true); + } + return $int; + } elseif($int <= 0xffffffff) { + $l = strlen($int); + $m = substr($int, 0, 1) == '-' ? 1 : 0; + if(($l - $m) === strspn($int,'0987654321', $m)) { + return $int; + } + } + return $ret; +} + + +function makeSearchSignUrl() { + return array(); +} + +function get_related_link($extent) { + return helper_seo::get_related_link($extent); +} + +function parse_related_link($content, $extent) { + return helper_seo::parse_related_link($content, $extent); +} + +function check_diy_perm($topic = array(), $flag = '') { + static $ret = array(); + if(empty($ret)) { + global $_G; + $common = !empty($_G['style']['tplfile']) || getgpc('inajax'); + $blockallow = getstatus(getglobal('member/allowadmincp'), 4) || getstatus(getglobal('member/allowadmincp'), 5) || getstatus(getglobal('member/allowadmincp'), 6); + $ret['data'] = $common && $blockallow; + $ret['layout'] = $common && (!empty($_G['group']['allowdiy']) || ( + CURMODULE === 'topic' && ($_G['group']['allowmanagetopic'] || $_G['group']['allowaddtopic'] && $topic && $topic['uid'] == $_G['uid']) + )); + } + return empty($flag) ? $ret['data'] || $ret['layout'] : $ret[$flag]; +} + +function strhash($string, $operation = 'DECODE', $key = '') { + $key = md5($key != '' ? $key : getglobal('authkey')); + if($operation == 'DECODE') { + $hashcode = gzuncompress(base64_decode($string)); + $string = substr($hashcode, 0, -16); + $hash = substr($hashcode, -16); + unset($hashcode); + } + + $vkey = substr(md5($string.substr($key, 0, 16)), 4, 8).substr(md5($string.substr($key, 16, 16)), 18, 8); + + if($operation == 'DECODE') { + return $hash == $vkey ? $string : ''; + } + + return base64_encode(gzcompress($string.$vkey)); +} + +function dunserialize($data) { + if(is_array($data)) { + $ret = $data; + } elseif(($ret = unserialize($data)) === false) { + $ret = unserialize(stripslashes($data)); + } + return $ret; +} + +function browserversion($type) { + static $return = array(); + static $types = array('ie' => 'msie', 'firefox' => '', 'chrome' => '', 'opera' => '', 'safari' => '', 'mozilla' => '', 'webkit' => '', 'maxthon' => '', 'qq' => 'qqbrowser'); + if(!$return) { + $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); + $other = 1; + foreach($types as $i => $v) { + $v = $v ? $v : $i; + if(strpos($useragent, $v) !== false) { + preg_match('/'.$v.'(\/|\s)([\d\.]+)/i', $useragent, $matches); + $ver = $matches[2]; + $other = $ver !== 0 && $v != 'mozilla' ? 0 : $other; + } else { + $ver = 0; + } + $return[$i] = $ver; + } + $return['other'] = $other; + } + return $return[$type]; +} + +function currentlang() { + $charset = strtoupper(CHARSET); + if($charset == 'GBK') { + return 'SC_GBK'; + } elseif($charset == 'BIG5') { + return 'TC_BIG5'; + } elseif($charset == 'UTF-8') { + global $_G; + if($_G['config']['output']['language'] == 'zh_cn') { + return 'SC_UTF8'; + } elseif ($_G['config']['output']['language'] == 'zh_tw') { + return 'TC_UTF8'; + } + } else { + return ''; + } +} + +function dpreg_replace($pattern, $replacement, $subject, $limit = -1, &$count = null) { + if(PHP_VERSION < '7.0.0') { + return preg_replace($pattern, $replacement, $subject, $limit, $count); + } else { + require_once libfile('function/preg'); + return _dpreg_replace($pattern, $replacement, $subject, $limit, $count); + } +} + +?> \ No newline at end of file diff --git a/source/function/function_credit.php b/source/function/function_credit.php new file mode 100644 index 0000000..a16b28d --- /dev/null +++ b/source/function/function_credit.php @@ -0,0 +1,266 @@ +lowerlimit($action, $uid, $coef, $fid); + if($returnonly) return $limit; + if($limit !== true) { + $GLOBALS['id'] = $limit; + $lowerlimit = is_array($action) && $action['extcredits'.$limit] ? abs($action['extcredits'.$limit]) + $_G['setting']['creditspolicy']['lowerlimit'][$limit] : $_G['setting']['creditspolicy']['lowerlimit'][$limit]; + $rulecredit = array(); + if(!is_array($action)) { + $rule = $credit->getrule($action, $fid); + foreach($_G['setting']['extcredits'] as $extcreditid => $extcredit) { + if($rule['extcredits'.$extcreditid]) { + $rulecredit[] = $extcredit['title'].($rule['extcredits'.$extcreditid] > 0 ? '+'.$rule['extcredits'.$extcreditid] : $rule['extcredits'.$extcreditid]); + } + } + } else { + $rule = array(); + } + $values = array( + 'title' => $_G['setting']['extcredits'][$limit]['title'], + 'lowerlimit' => $lowerlimit, + 'unit' => $_G['setting']['extcredits'][$limit]['unit'], + 'ruletext' => $rule['rulename'], + 'rulecredit' => implode(', ', $rulecredit) + ); + if(!is_array($action)) { + if(!$fid) { + showmessage('credits_policy_lowerlimit', '', $values); + } else { + showmessage('credits_policy_lowerlimit_fid', '', $values); + } + } else { + showmessage('credits_policy_lowerlimit_norule', '', $values); + } + } +} + +function _updatemembercount($uids, $dataarr = array(), $checkgroup = true, $operation = '', $relatedid = 0, $ruletxt = '', $customtitle = '', $custommemo = '') { + if(empty($uids)) return; + if(!is_array($dataarr) || empty($dataarr)) return; + if($operation && $relatedid || $customtitle) { + $writelog = true; + } else { + $writelog = false; + } + $data = $log = array(); + foreach($dataarr as $key => $val) { + if(empty($val)) continue; + $val = intval($val); + $id = intval($key); + $id = !$id && substr($key, 0, -1) == 'extcredits' ? intval(substr($key, -1, 1)) : $id; + if(0 < $id && $id < 9) { + $data['extcredits'.$id] = $val; + if($writelog) { + $log['extcredits'.$id] = $val; + } + } else { + $data[$key] = $val; + } + } + if($writelog) { + credit_log($uids, $operation, $relatedid, $log, $customtitle, $custommemo); + } + if($data) { + include_once libfile('class/credit'); + $credit = & credit::instance(); + $credit->updatemembercount($data, $uids, $checkgroup, $ruletxt); + } +} + +function credit_log($uids, $operation, $relatedid, $data, $customtitle = '', $custommemo = '') { + if((!$operation || empty($relatedid)) && !strlen($customtitle) || empty($uids) || empty($data)) { + return; + } + $log = array( + 'uid' => $uids, + 'operation' => $operation, + 'relatedid' => $relatedid, + 'dateline' => TIMESTAMP, + ); + foreach($data as $k => $v) { + $log[$k] = $v; + } + if(is_array($uids)) { + foreach($uids as $k => $uid) { + $log['uid'] = $uid; + $log['relatedid'] = is_array($relatedid) ? $relatedid[$k] : $relatedid; + $insertid = C::t('common_credit_log')->insert($log, true); + C::t('common_credit_log_field')->insert(array('logid' => $insertid, 'title' => $customtitle, 'text' => $custommemo)); + } + } else { + $insertid = C::t('common_credit_log')->insert($log, true); + C::t('common_credit_log_field')->insert(array('logid' => $insertid, 'title' => $customtitle, 'text' => $custommemo)); + } +} + +function makecreditlog($log, $otherinfo=array()) { + global $_G; + + $log['dateline'] = dgmdate($log['dateline'], 'Y-m-d H:i'); + $log['optype'] = lang('spacecp', 'logs_credit_update_'.$log['operation']); + $log['opinfo'] = ''; + $info = $url = ''; + switch($log['operation']) { + case 'TRC': + $log['opinfo'] = ''.lang('home/template', 'done').(!empty($otherinfo['tasks'][$log['relatedid']]) ? ' '.$otherinfo['tasks'][$log['relatedid']].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'task_credit').''; + break; + case 'RTC': + $log['opinfo'] = ''.lang('forum/template', 'published').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'special_3_credit').''; + break; + case 'RAC': + $log['opinfo'] = ''.lang('home/template', 'security_answer').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'special_3_best_answer').''; + break; + case 'MRC': + $log['opinfo'] = lang('spacecp', 'magic_credit'); + break; + case 'BMC': + $log['opinfo'] = ''.lang('home/template', 'magics_operation_buy').' '.(!empty($_G['cache']['magics'][$log['relatedid']]['name']) ? $_G['cache']['magics'][$log['relatedid']]['name'] : '').' '.lang('home/template', 'magic').''; + break; + case 'BME': + $log['opinfo'] = ''.lang('spacecp', 'buy_medal').''; + break; + case 'BGC': + $log['opinfo'] = lang('spacecp','magic_space_gift'); + break; + case 'RGC': + $log['opinfo'] = lang('spacecp','magic_space_re_gift'); + break; + case 'AGC': + $log['opinfo'] = lang('spacecp', 'magic_space_get_gift'); + break; + case 'TFR': + $log['opinfo'] = ''.lang('home/template', 'to').' '.$otherinfo['users'][$log['relatedid']].' '.lang('spacecp', 'credit_transfer').''; + break; + case 'RCV': + $log['opinfo'] = ''.lang('home/template', 'comefrom').' '.$otherinfo['users'][$log['relatedid']].' '.lang('spacecp', 'credit_transfer_tips').''; + break; + case 'CEC': + $log['opinfo'] = lang('spacecp', 'credit_exchange_tips_1').''.$_G['setting']['extcredits'][$log['minid']]['title'].' '.lang('spacecp', 'credit_exchange_to').' '.$_G['setting']['extcredits'][$log['maxid']]['title'].''; + break; + case 'ECU': + $log['opinfo'] = lang('spacecp', 'credit_exchange_center'); + break; + case 'SAC': + $log['opinfo'] = ''.lang('spacecp', 'attach_sell').' '.$otherinfo['attachs'][$log['relatedid']]['filename'].' '.lang('spacecp', 'attach_sell_tips').''; + break; + case 'BAC': + $log['opinfo'] = ''.lang('spacecp', 'attach_buy').' '.$otherinfo['attachs'][$log['relatedid']]['filename'].' '.lang('spacecp', 'attach_buy_tips').''; + break; + case 'PRC': + $tid = $otherinfo['post'][$log['relatedid']]; + $log['opinfo'] = ''.(!empty($otherinfo['threads'][$tid]['subject']) ? ' '.$otherinfo['threads'][$tid]['subject'].' ' : lang('home/template', 'post')).lang('spacecp', 'grade_credit').''; + break; + case 'RSC': + $tid = $otherinfo['post'][$log['relatedid']]; + $log['opinfo'] = ''.lang('home/template', 'credits_give').(!empty($otherinfo['threads'][$tid]['subject']) ? ' '.$otherinfo['threads'][$tid]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'grade_credit2').''; + break; + case 'STC': + $log['opinfo'] = ''.lang('spacecp', 'attach_sell').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'thread_credit').''; + break; + case 'BTC': + $log['opinfo'] = ''.lang('spacecp', 'attach_buy').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'thread_credit2').''; + break; + case 'AFD': + $log['opinfo'] = lang('spacecp', 'buy_credit'); + break; + case 'UGP': + $log['opinfo'] = lang('spacecp', 'buy_usergroup'); + break; + case 'RPC': + $log['opinfo'] = lang('spacecp', 'report_credit'); + break; + case 'ACC': + $log['opinfo'] = ''.lang('spacecp', 'join').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'activity_credit').''; + break; + case 'RCT': + $log['opinfo'] = ''.lang('spacecp', 'thread_send').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' ' : '').lang('spacecp', 'replycredit').''; + break; + case 'RCA': + $log['opinfo'] = ''.lang('home/template', 'reply').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'add_credit').''; + break; + case 'RCB': + $log['opinfo'] = ''.lang('spacecp', 'recovery').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' ' : lang('spacecp', 'replycredit_post')).lang('spacecp', 'replycredit_thread').''; + break; + case 'CDC': + $log['opinfo'] = lang('spacecp', 'card_credit'); + break; + case 'RKC': + $log['opinfo'] = lang('spacecp', 'ranklist_top'); + break; + case 'RPR': + $log['opinfo'] = lang('spacecp', 'admincp_op_credit'); + break; + case 'RPZ': + $log['opinfo'] = lang('spacecp', 'admincp_op_credit'); + break; + case 'FCP': + $log['opinfo'] = ''.lang('spacecp', 'buy_forum').''; + break; + case 'BGR': + $log['opinfo'] = ''.lang('spacecp', 'buildgroup').''; + break; + default: + $log['opinfo'] = !empty($log['title']) ? $log['title'] : ''; + } + return $log; +} + +function getotherinfo($aids, $pids, $tids, $taskids, $uids) { + global $_G; + + $otherinfo = array('attachs' => array(), 'threads' => array(), 'tasks' => array(), 'users' => array()); + if(!empty($aids)) { + $attachs = C::t('forum_attachment')->fetch_all($aids); + foreach($attachs as $value) { + $value['tableid'] = intval($value['tableid']); + $attachtable[$value['tableid']][] = $value['aid']; + $tids[$value['tid']] = $value['tid']; + } + foreach($attachtable as $id => $value) { + $attachs = C::t('forum_attachment_n')->fetch_all($id, $value); + foreach($attachs as $value) { + $otherinfo['attachs'][$value['aid']] = $value; + } + } + } + if(!empty($pids)) { + foreach(C::t('forum_post')->fetch_all(0, $pids) as $value) { + $tids[$value['tid']] = $value['tid']; + $otherinfo['post'][$value['pid']] = $value['tid']; + } + } + if(!empty($tids)) { + foreach(C::t('forum_thread')->fetch_all_by_tid($tids) as $value) { + $otherinfo['threads'][$value['tid']] = $value; + } + } + if(!empty($taskids)) { + foreach(C::t('common_task')->fetch_all($taskids) as $value) { + $otherinfo['tasks'][$value['taskid']] = $value['name']; + } + } + if(!empty($uids)) { + foreach(C::t('common_member')->fetch_all($uids) as $uid => $value) { + $otherinfo['users'][$uid] = $value['username']; + } + } + return $otherinfo; +} +?> \ No newline at end of file diff --git a/source/function/function_delete.php b/source/function/function_delete.php new file mode 100644 index 0000000..2a7ed8f --- /dev/null +++ b/source/function/function_delete.php @@ -0,0 +1,1069 @@ + $hookparam, 'step' => 'check'), 'deletemember'); + } + if($delpost) { + deleteattach($uids, 'uid'); + deletepost($uids, 'authorid'); + } + + $arruids = $uids; + $uids = dimplode($uids); + $numdeleted = count($arruids); + foreach(array('common_member_field_forum', 'common_member_field_home', 'common_member_count', + 'common_member_profile', 'common_member_status',) as $table) { + C::t($table)->delete($arruids, true, 1); + } + + foreach(array('common_member_verify', 'common_member_validate', 'common_member_magic') as $table) { + C::t($table)->delete($arruids, true); + } + + C::t('forum_access')->delete_by_uid($arruids); + C::t('common_member_verify_info')->delete_by_uid($arruids); + C::t('common_member_action_log')->delete_by_uid($arruids); + C::t('forum_moderator')->delete_by_uid($arruids); + C::t('forum_post_location')->delete_by_uid($arruids); + $doids = array(); + $query = C::t('home_doing')->fetch_all_by_uid_doid($arruids); + foreach($query as $value) { + $doids[$value['doid']] = $value['doid']; + } + + C::t('home_docomment')->delete_by_doid_uid($doids, $arruids); + C::t('common_domain')->delete_by_id_idtype($arruids, 'home'); + C::t('home_feed')->delete_by_uid($arruids); + C::t('home_notification')->delete_by_uid($arruids); + C::t('home_poke')->delete_by_uid_or_fromuid($uids); + C::t('home_comment')->delete_by_uid($arruids); + C::t('home_visitor')->delete_by_uid_or_vuid($uids); + C::t('home_friend')->delete_by_uid_fuid($arruids); + C::t('home_friend_request')->delete_by_uid_or_fuid($arruids); + C::t('common_invite')->delete_by_uid_or_fuid($arruids); + C::t('common_moderate')->delete_moderate($arruids, 'uid_cid'); + C::t('common_member_forum_buylog')->delete_by_uid($arruids); + C::t('forum_threadhidelog')->delete_by_uid($arruids); + C::t('common_member_crime')->delete_by_uid($arruids); + C::t('home_follow')->delete_by_uid($arruids); + C::t('home_follow')->delete_by_followuid($arruids); + C::t('home_follow_feed')->delete_by_uid($arruids); + + foreach(C::t('forum_collectionfollow')->fetch_all_by_uid($arruids) as $follow) { + C::t('forum_collection')->update_by_ctid($follow['ctid'], 0, -1); + } + + foreach(C::t('forum_collectioncomment')->fetch_all_by_uid($arruids) as $comment) { + C::t('forum_collection')->update_by_ctid($comment['ctid'], 0, 0, -1); + } + + $query = C::t('home_pic')->fetch_all_by_uid($uids); + foreach($query as $value) { + $pics[] = $value; + } + deletepicfiles($pics); + + include_once libfile('function/home'); + $query = C::t('home_album')->fetch_all_by_uid($arruids); + foreach($query as $value) { + pic_delete($value['pic'], 'album', 0, ($value['picflag'] == 2 ? 1 : 0)); + } + + C::t('common_mailcron')->delete_by_touid($arruids); + + foreach(array('home_doing', 'home_share', 'home_album', 'common_credit_rule_log', 'common_credit_rule_log_field', + 'home_pic', 'home_blog', 'home_blogfield', 'home_class', 'home_clickuser', + 'home_show', 'forum_collectioncomment', 'forum_collectionfollow', 'forum_collectionteamworker') as $table) { + C::t($table)->delete_by_uid($arruids); + } + C::t('common_member')->delete($arruids, 1, 1); + + if($_G['setting']['plugins']['func'][HOOKTYPE]['deletemember']) { + hookscript('deletemember', 'global', 'funcs', array('param' => $hookparam, 'step' => 'delete'), 'deletemember'); + } + return $numdeleted; +} + +function deletepost($ids, $idtype = 'pid', $credit = false, $posttableid = false, $recycle = false) { + global $_G; + $recycle = $recycle && $idtype == 'pid' ? true : false; + if($_G['setting']['plugins']['func'][HOOKTYPE]['deletepost']) { + $_G['deletepostids'] = & $ids; + $hookparam = func_get_args(); + hookscript('deletepost', 'global', 'funcs', array('param' => $hookparam, 'step' => 'check'), 'deletepost'); + } + if(!$ids || !in_array($idtype, array('authorid', 'tid', 'pid'))) { + return 0; + } + + loadcache('posttableids'); + $posttableids = !empty($_G['cache']['posttableids']) ? ($posttableid !== false && in_array($posttableid, $_G['cache']['posttableids']) ? array($posttableid) : $_G['cache']['posttableids']): array('0'); + + $count = count($ids); + $idsstr = dimplode($ids); + + if($credit) { + $replycredit_list = $tuidarray = $ruidarray = $_G['deleteauthorids'] = array(); + foreach($posttableids as $id) { + $postlist = array(); + if($idtype == 'pid') { + $postlist = C::t('forum_post')->fetch_all_post($id, $ids, false); + } elseif($idtype == 'tid') { + $postlist = C::t('forum_post')->fetch_all_by_tid($id, $ids, false); + } elseif($idtype == 'authorid') { + $postlist = C::t('forum_post')->fetch_all_by_authorid($id, $ids, false); + } + foreach($postlist as $post) { + if($post['invisible'] != -1 && $post['invisible'] != -5) { + if($post['first']) { + $tuidarray[$post['fid']][] = $post['authorid']; + } else { + $ruidarray[$post['fid']][] = $post['authorid']; + if($post['authorid'] > 0 && $post['replycredit'] > 0) { + $replycredit_list[$post['authorid']][$post['tid']] += $post['replycredit']; + } + } + $tids[$post['tid']] = $post['tid']; + $_G['deleteauthorids'][$post['authorid']] = $post['authorid']; + } + } + unset($postlist); + } + + if($tuidarray || $ruidarray) { + require_once libfile('function/post'); + } + if($tuidarray) { + foreach($tuidarray as $fid => $tuids) { + updatepostcredits('-', $tuids, 'post', $fid); + } + } + if($ruidarray) { + foreach($ruidarray as $fid => $ruids) { + updatepostcredits('-', $ruids, 'reply', $fid); + } + } + } + + foreach($posttableids as $id) { + if($recycle) { + C::t('forum_post')->update_post($id, $ids, array('invisible' => -5)); + } else { + if($idtype == 'pid') { + C::t('forum_post')->delete_post($id, $ids); + C::t('forum_postcomment')->delete_by_pid($ids); + C::t('forum_postcomment')->delete_by_rpid($ids); + } elseif($idtype == 'tid') { + C::t('forum_post')->delete_by_tid($id, $ids); + C::t('forum_postcomment')->delete_by_tid($ids); + } elseif($idtype == 'authorid') { + C::t('forum_post')->delete_by_authorid($id, $ids); + C::t('forum_postcomment')->delete_by_authorid($ids); + } + C::t('forum_trade')->delete_by_id_idtype($ids, ($idtype == 'authorid' ? 'sellerid' : $idtype)); + C::t('home_feed')->delete_by_id_idtype($ids, ($idtype == 'authorid' ? 'uid' : $idtype)); + } + } + if(!$recycle && $idtype != 'authorid') { + if($idtype == 'pid') { + C::t('forum_poststick')->delete_by_pid($ids); + } elseif($idtype == 'tid') { + C::t('forum_poststick')->delete_by_tid($ids); + } + + } + if($idtype == 'pid') { + C::t('forum_postcomment')->delete_by_rpid($ids); + C::t('common_moderate')->delete_moderate($ids, 'pid'); + C::t('forum_post_location')->delete($ids); + C::t('forum_filter_post')->delete_by_pid($ids); + C::t('forum_hotreply_number')->delete_by_pid($ids); + C::t('forum_hotreply_member')->delete_by_pid($ids); + } elseif($idtype == 'tid') { + C::t('forum_post_location')->delete_by_tid($ids); + C::t('forum_filter_post')->delete_by_tid($ids); + C::t('forum_hotreply_number')->delete_by_tid($ids); + C::t('forum_hotreply_member')->delete_by_tid($ids); + C::t('forum_sofa')->delete($ids); + } elseif($idtype == 'authorid') { + C::t('forum_post_location')->delete_by_uid($ids); + } + if($replycredit_list) { + foreach(C::t('forum_replycredit')->fetch_all($tids) as $rule) { + $rule['extcreditstype'] = $rule['extcreditstype'] ? $rule['extcreditstype'] : $_G['setting']['creditstransextra'][10] ; + $replycredity_rule[$rule['tid']] = $rule; + } + foreach($replycredit_list AS $uid => $tid_credit) { + foreach($tid_credit AS $tid => $credit) { + $uid_credit[$replycredity_rule[$tid]['extcreditstype']] -= $credit; + } + updatemembercount($uid, $uid_credit, true); + } + } + if(!$recycle) { + deleteattach($ids, $idtype); + } + if($tids) { + foreach($tids as $tid) { + updatethreadcount($tid, 1); + } + } + if($_G['setting']['plugins']['func'][HOOKTYPE]['deletepost']) { + hookscript('deletepost', 'global', 'funcs', array('param' => $hookparam, 'step' => 'delete'), 'deletepost'); + } + return $count; +} + +function deletethreadcover($tids) { + global $_G; + loadcache(array('threadtableids', 'posttableids')); + $threadtableids = !empty($_G['cache']['threadtableids']) ? $_G['cache']['threadtableids'] : array(0); + $deletecover = array(); + foreach($threadtableids as $tableid) { + foreach(C::t('forum_thread')->fetch_all_by_tid($tids, 0, 0, $tableid) as $row) { + if($row['cover']) { + $deletecover[$row['tid']] = $row['cover']; + } + } + } + if($deletecover) { + foreach($deletecover as $tid => $cover) { + $filename = getthreadcover($tid, 0, 1); + $remote = $cover < 0 ? 1 : 0; + dunlink(array('attachment' => $filename, 'remote' => $remote, 'thumb' => 0)); + } + } +} + +function deletethread($tids, $membercount = false, $credit = false, $ponly = false) { + global $_G; + if($_G['setting']['plugins']['func'][HOOKTYPE]['deletethread']) { + $_G['deletethreadtids'] = & $tids; + $hookparam = func_get_args(); + hookscript('deletethread', 'global', 'funcs', array('param' => $hookparam, 'step' => 'check'), 'deletethread'); + } + if(!$tids) { + return 0; + } + + $count = count($tids); + $arrtids = $tids; + $tids = dimplode($tids); + + loadcache(array('threadtableids', 'posttableids')); + $threadtableids = !empty($_G['cache']['threadtableids']) ? $_G['cache']['threadtableids'] : array(); + $posttableids = !empty($_G['cache']['posttableids']) ? $_G['cache']['posttableids'] : array('0'); + if(!in_array(0, $threadtableids)) { + $threadtableids = array_merge(array(0), $threadtableids); + } + + C::t('common_moderate')->delete_moderate($arrtids, 'tid'); + C::t('forum_threadclosed')->delete($arrtids); + C::t('forum_newthread')->delete_by_tids($arrtids); + + $cachefids = $atids = $fids = $postids = $threadtables = $_G['deleteauthorids'] = array(); + foreach($threadtableids as $tableid) { + foreach(C::t('forum_thread')->fetch_all_by_tid($arrtids, 0, 0, $tableid) as $row) { + $atids[] = $row['tid']; + $row['posttableid'] = !empty($row['posttableid']) && in_array($row['posttableid'], $posttableids) ? $row['posttableid'] : '0'; + $postids[$row['posttableid']][$row['tid']] = $row['tid']; + if($tableid) { + $fids[$row['fid']][] = $tableid; + } + $cachefids[$row['fid']] = $row['fid']; + $_G['deleteauthorids'][$row['authorid']] = $row['authorid']; + } + if(!$tableid && !$ponly) { + $threadtables[] = $tableid; + } + } + + if($credit || $membercount) { + $losslessdel = $_G['setting']['losslessdel'] > 0 ? TIMESTAMP - $_G['setting']['losslessdel'] * 86400 : 0; + + $postlist = $uidarray = $tuidarray = $ruidarray = array(); + foreach($postids as $posttableid => $posttabletids) { + foreach(C::t('forum_post')->fetch_all_by_tid($posttableid, $posttabletids, false) as $post) { + if($post['invisible'] != -1 && $post['invisible'] != -5) { + $postlist[] = $post; + } + } + } + foreach(C::t('forum_replycredit')->fetch_all($arrtids) as $rule) { + $rule['extcreditstype'] = $rule['extcreditstype'] ? $rule['extcreditstype'] : $_G['setting']['creditstransextra'][10] ; + $replycredit_rule[$rule['tid']] = $rule; + } + + foreach($postlist as $post) { + if($post['dateline'] < $losslessdel) { + if($membercount) { + if($post['first']) { + updatemembercount($post['authorid'], array('threads' => -1, 'post' => -1), false); + } else { + updatemembercount($post['authorid'], array('posts' => -1), false); + } + } + } else { + if($credit) { + if($post['first']) { + $tuidarray[$post['fid']][] = $post['authorid']; + } else { + $ruidarray[$post['fid']][] = $post['authorid']; + } + } + } + if($credit || $membercount) { + if($post['authorid'] > 0 && $post['replycredit'] > 0) { + if($replycredit_rule[$post['tid']]['extcreditstype']) { + updatemembercount($post['authorid'], array($replycredit_rule[$post['tid']]['extcreditstype'] => (int)('-'.$post['replycredit']))); + } + } + } + if($post['authorid'] > 0 && $post['first']) { + $feed_counts = C::t('home_follow_feed')->delete_by_uid_tid($post['authorid'], $post['tid']); + C::t('common_member_count')->increase($post['authorid'], array('feeds'=>-$feed_counts)); + } + } + + if($credit) { + if($tuidarray || $ruidarray) { + require_once libfile('function/post'); + } + if($tuidarray) { + foreach($tuidarray as $fid => $tuids) { + updatepostcredits('-', $tuids, 'post', $fid); + } + } + if($ruidarray) { + foreach($ruidarray as $fid => $ruids) { + updatepostcredits('-', $ruids, 'reply', $fid); + } + } + $auidarray = $attachtables = array(); + foreach($atids as $tid) { + $attachtables[getattachtableid($tid)][] = $tid; + } + foreach($attachtables as $attachtable => $attachtids) { + foreach(C::t('forum_attachment_n')->fetch_all_by_id($attachtable, 'tid', $attachtids) as $attach) { + if($attach['dateline'] > $losslessdel) { + $auidarray[$attach['uid']] = !empty($auidarray[$attach['uid']]) ? $auidarray[$attach['uid']] + 1 : 1; + } + } + } + if($auidarray) { + $postattachcredits = !empty($_G['forum']['postattachcredits']) ? $_G['forum']['postattachcredits'] : $_G['setting']['creditspolicy']['postattach']; + updateattachcredits('-', $auidarray, $postattachcredits); + } + } + } + + $relatecollection = C::t('forum_collectionthread')->fetch_all_by_tids($arrtids); + if(count($relatecollection) > 0) { + $collectionids = array(); + foreach($relatecollection as $collection) { + $collectionids[] = $collection['ctid']; + } + $collectioninfo = C::t('forum_collection')->fetch_all($collectionids); + foreach($relatecollection as $collection) { + $decthread = C::t('forum_collectionthread')->delete_by_ctid_tid($collection['ctid'], $arrtids); + $lastpost = null; + if(in_array($collectioninfo[$collection['ctid']]['lastpost'], $arrtids) && ($collectioninfo[$collection['ctid']]['threadnum'] - $decthread) > 0) { + $collection_thread = C::t('forum_collectionthread')->fetch_by_ctid_dateline($collection['ctid']); + if($collection_thread) { + $thread = C::t('forum_thread')->fetch_thread($collection_thread['tid']); + $lastpost = array( + 'lastpost' => $thread['tid'], + 'lastsubject' => $thread['subject'], + 'lastposttime' => $thread['dateline'], + 'lastposter' => $thread['authorid'] + ); + } + } + C::t('forum_collection')->update_by_ctid($collection['ctid'], -$decthread, 0, 0, 0, 0, 0, $lastpost); + } + C::t('forum_collectionrelated')->delete($arrtids); + } + if($cachefids) { + C::t('forum_thread')->clear_cache($cachefids, 'forumdisplay_'); + } + if($ponly) { + if($_G['setting']['plugins']['func'][HOOKTYPE]['deletethread']) { + hookscript('deletethread', 'global', 'funcs', array('param' => $hookparam, 'step' => 'delete'), 'deletethread'); + } + C::t('forum_thread')->update($arrtids, array('displayorder'=>-1, 'digest'=>0, 'moderated'=>1)); + foreach($postids as $posttableid=>$oneposttids) { + C::t('forum_post')->update_by_tid($posttableid, $oneposttids, array('invisible' => '-1')); + } + return $count; + } + + C::t('forum_replycredit')->delete($arrtids); + C::t('forum_post_location')->delete_by_tid($arrtids); + C::t('common_credit_log')->delete_by_operation_relatedid(array('RCT', 'RCA', 'RCB'), $arrtids); + C::t('forum_threadhidelog')->delete_by_tid($arrtids); + deletethreadcover($arrtids); + foreach($threadtables as $tableid) { + C::t('forum_thread')->delete_by_tid($arrtids, false, $tableid); + } + + if($atids) { + foreach($postids as $posttableid=>$oneposttids) { + deletepost($oneposttids, 'tid', false, $posttableid); + } + deleteattach($atids, 'tid'); + } + + if($fids) { + loadcache('forums'); + foreach($fids as $fid => $tableids) { + if(empty($_G['cache']['forums'][$fid]['archive'])) { + continue; + } + foreach(C::t('forum_thread')->count_posts_by_fid($fid) as $row) { + C::t('forum_forum_threadtable')->insert(array( + 'fid' => $fid, + 'threadtableid' => $tableid, + 'threads' => $row['threads'], + 'posts' => $row['posts'] + ), false, true); + } + } + } + + foreach(array('forum_forumrecommend', 'forum_polloption', 'forum_poll', 'forum_polloption_image', 'forum_activity', 'forum_activityapply', 'forum_debate', + 'forum_debatepost', 'forum_threadmod', 'forum_relatedthread', + 'forum_pollvoter', 'forum_threadimage', 'forum_threadpreview') as $table) { + C::t($table)->delete_by_tid($arrtids); + } + C::t('forum_typeoptionvar')->delete_by_tid($arrtids); + C::t('forum_poststick')->delete_by_tid($arrtids); + C::t('forum_filter_post')->delete_by_tid($arrtids); + C::t('forum_hotreply_member')->delete_by_tid($arrtids); + C::t('forum_hotreply_number')->delete_by_tid($arrtids); + C::t('home_feed')->delete_by_id_idtype($arrtids, 'tid'); + C::t('common_tagitem')->delete_tagitem(0, $arrtids, 'tid'); + C::t('forum_threadrush')->delete($arrtids); + if($_G['setting']['plugins']['func'][HOOKTYPE]['deletethread']) { + hookscript('deletethread', 'global', 'funcs', array('param' => $hookparam, 'step' => 'delete'), 'deletethread'); + } + return $count; +} + +function deleteattach($ids, $idtype = 'aid') { + global $_G; + if(!$ids || !in_array($idtype, array('authorid', 'uid', 'tid', 'pid'))) { + return; + } + $idtype = $idtype == 'authorid' ? 'uid' : $idtype; + + $pics = $attachtables = array(); + + if($idtype == 'tid') { + $pollImags = C::t('forum_polloption_image')->fetch_all_by_tid($ids); + foreach($pollImags as $image) { + dunlink($image); + } + } + foreach(C::t('forum_attachment')->fetch_all_by_id($idtype, $ids) as $attach) { + $attachtables[$attach['tableid']][] = $attach['aid']; + } + + foreach($attachtables as $attachtable => $aids) { + if($attachtable == 127) { + continue; + } + $attachs = C::t('forum_attachment_n')->fetch_all_attachment($attachtable, $aids); + foreach($attachs as $attach) { + if($attach['picid']) { + $pics[] = $attach['picid']; + } + dunlink($attach); + } + C::t('forum_attachment_exif')->delete($aids); + C::t('forum_attachment_n')->delete_attachment($attachtable, $aids); + } + C::t('forum_attachment')->delete_by_id($idtype, $ids); + if($pics) { + $albumids = array(); + C::t('home_pic')->delete($pics); + $query = C::t('home_pic')->fetch_all($pics); + foreach($query as $album) { + if(!in_array($album['albumid'], $albumids)) { + C::t('home_album')->update($album['albumid'], array('picnum' => C::t('home_pic')->check_albumpic($album['albumid']))); + $albumids[] = $album['albumid']; + } + } + } +} + +function deletecomments($cids) { + global $_G; + + $blognums = $newcids = $dels = $counts = array(); + $allowmanage = checkperm('managecomment'); + + $query = C::t('home_comment')->fetch_all($cids); + $deltypes = array(); + foreach($query as $value) { + if($allowmanage || $value['authorid'] == $_G['uid'] || $value['uid'] == $_G['uid']) { + $dels[] = $value; + $newcids[] = $value['cid']; + $deltypes[] = $value['idtype'].'_cid'; + if($value['authorid'] != $_G['uid'] && $value['uid'] != $_G['uid']) { + $counts[$value['authorid']]['coef'] -= 1; + } + if($value['idtype'] == 'blogid') { + $blognums[$value['id']]++; + } + } + } + + if(empty($dels)) return array(); + + C::t('home_comment')->delete_comment($newcids); + for($i = 0; $i < count($newcids); $i++) { + C::t('common_moderate')->delete_moderate($newcids[$i], $deltypes[$i]); + } + + if($counts) { + foreach ($counts as $uid => $setarr) { + batchupdatecredit('comment', $uid, array(), $setarr['coef']); + } + } + if($blognums) { + $nums = renum($blognums); + foreach ($nums[0] as $num) { + C::t('home_blog')->increase($nums[1][$num], 0, array('replynum' => -$num)); + } + } + return $dels; +} + +function deleteblogs($blogids, $force = false) { + global $_G; + + $blogs = $newblogids = $counts = array(); + $allowmanage = checkperm('manageblog'); + + $query = C::t('home_blog')->fetch_all_blog($blogids); + foreach($query as $value) { + if($allowmanage || $value['uid'] == $_G['uid']) { + $blogs[] = $value; + $newblogids[] = $value['blogid']; + + if($value['status'] == 0) { + if($value['uid'] != $_G['uid']) { + $counts[$value['uid']]['coef'] -= 1; + } + $counts[$value['uid']]['blogs'] -= 1; + } + } + } + if(empty($blogs)) return array(); + + C::t('common_moderate')->delete_moderate($newblogids, 'blogid'); + C::t('common_moderate')->delete_moderate($newblogids, 'blogid_cid'); + + if(getglobal('setting/blogrecyclebin') && !$force) { + C::t('home_blog')->update($newblogids, array('status' => -1)); + return $blogs; + } + C::t('home_blog')->delete($newblogids); + C::t('home_blogfield')->delete($newblogids); + C::t('home_comment')->delete_comment('', $newblogids, 'blogid'); + C::t('home_feed')->delete_by_id_idtype($newblogids, 'blogid'); + C::t('home_clickuser')->delete_by_id_idtype($newblogids, 'blogid'); + + if($counts) { + foreach ($counts as $uid => $setarr) { + batchupdatecredit('publishblog', $uid, array('blogs' => $setarr['blogs']), $setarr['coef']); + } + } + + C::t('common_tagitem')->delete_tagitem(0, $newblogids, 'blogid'); + + return $blogs; +} + +function deletefeeds($feedids) { + global $_G; + + $allowmanage = checkperm('managefeed'); + + $feeds = $newfeedids = array(); + $query = C::t('home_feed')->fetch_all($feedids); + foreach($query as $value) { + if($allowmanage || $value['uid'] == $_G['uid']) { + $newfeedids[] = $value['feedid']; + $feeds[] = $value; + } + } + + if(empty($newfeedids)) return array(); + + C::t('home_feed')->delete_feed($newfeedids); + + return $feeds; +} + +function deleteshares($sids) { + global $_G; + + $allowmanage = checkperm('manageshare'); + + $shares = $newsids = $counts = array(); + foreach(C::t('home_share')->fetch_all($sids) as $value) { + if($allowmanage || $value['uid'] == $_G['uid']) { + $shares[] = $value; + $newsids[] = $value['sid']; + + if($value['uid'] != $_G['uid']) { + $counts[$value['uid']]['coef'] -= 1; + } + $counts[$value['uid']]['sharings'] -= 1; + } + } + if(empty($shares)) return array(); + + C::t('home_share')->delete($newsids); + C::t('home_comment')->delete_comment('', $newsids, 'sid'); + C::t('home_feed')->delete_by_id_idtype($newsids, 'sid'); + C::t('common_moderate')->delete_moderate($newsids, 'sid'); + C::t('common_moderate')->delete_moderate($newsids, 'sid_cid'); + + if($counts) { + foreach ($counts as $uid => $setarr) { + batchupdatecredit('createshare', $uid, array('sharings' => $setarr['sharings']), $setarr['coef']); + } + } + + return $shares; +} + +function deletedoings($ids) { + global $_G; + + $allowmanage = checkperm('managedoing'); + + $doings = $newdoids = $counts = array(); + $query = C::t('home_doing')->fetch_all($ids); + foreach($query as $value) { + if($allowmanage || $value['uid'] == $_G['uid']) { + $doings[] = $value; + $newdoids[] = $value['doid']; + + if($value['uid'] != $_G['uid']) { + $counts[$value['uid']]['coef'] -= 1; + } + $counts[$value['uid']]['doings'] -= 1; + } + } + + if(empty($doings)) return array(); + + C::t('home_doing')->delete($newdoids); + C::t('home_docomment')->delete_by_doid_uid($newdoids); + C::t('home_feed')->delete_by_id_idtype($newdoids, 'doid'); + C::t('common_moderate')->delete_moderate($newdoids, 'doid'); + + if($counts) { + foreach ($counts as $uid => $setarr) { + if ($uid) { + batchupdatecredit('doing', $uid, array('doings' => $setarr['doings']), $setarr['coef']); + $lastdoing = C::t('home_doing')->fetch_all_by_uid_doid($uid, '', 'dateline', 0, 1, true, true); + $setarr = array('recentnote'=>$lastdoing[0]['message'], 'spacenote'=>$lastdoing[0]['message']); + C::t('common_member_field_home')->update($uid, $setarr); + } + } + } + + return $doings; +} + +function deletespace($uid) { + global $_G; + + $allowmanage = checkperm('managedelspace'); + + if($allowmanage) { + C::t('common_member')->update($uid, array('status' => 1)); + return true; + } else { + return false; + } +} + +function deletepics($picids) { + global $_G; + + $albumids = $sizes = $pics = $newids = array(); + $allowmanage = checkperm('managealbum'); + + $haveforumpic = false; + $query = C::t('home_pic')->fetch_all($picids); + foreach($query as $value) { + if($allowmanage || $value['uid'] == $_G['uid']) { + $pics[] = $value; + $newids[] = $value['picid']; + $sizes[$value['uid']] = $sizes[$value['uid']] + $value['size']; + $albumids[$value['albumid']] = $value['albumid']; + if(!$haveforumpic && $value['remote'] > 1) { + $haveforumpic = true; + } + } + } + if(empty($pics)) return array(); + + C::t('home_pic')->delete($newids); + if($haveforumpic) { + for($i = 0;$i < 10;$i++) { + C::t('forum_attachment_n')->reset_picid($i, $newids); + } + } + + C::t('home_comment')->delete_comment('', $newids, 'picid'); + C::t('home_feed')->delete_by_id_idtype($newids, 'picid'); + C::t('home_clickuser')->delete_by_id_idtype($newids, 'picid'); + C::t('common_moderate')->delete_moderate($newids, 'picid'); + C::t('common_moderate')->delete_moderate($newids, 'picid_cid'); + + if($sizes) { + foreach ($sizes as $uid => $setarr) { + $attachsize = intval($sizes[$uid]); + updatemembercount($uid, array('attachsize' => -$attachsize), false); + } + } + + require_once libfile('function/spacecp'); + foreach ($albumids as $albumid) { + if($albumid) { + album_update_pic($albumid); + } + } + + deletepicfiles($pics); + + return $pics; +} + +function deletepicfiles($pics) { + global $_G; + $remotes = array(); + include_once libfile('function/home'); + foreach ($pics as $pic) { + pic_delete($pic['filepath'], 'album', $pic['thumb'], $pic['remote']); + } +} + +function deletealbums($albumids) { + global $_G; + + $sizes = $dels = $newids = $counts = array(); + $allowmanage = checkperm('managealbum'); + + $albums = C::t('home_album')->fetch_all_album($albumids); + foreach($albums as $value) { + if($value['albumid']) { + if($allowmanage || $value['uid'] == $_G['uid']) { + $dels[] = $value; + $newids[] = $value['albumid']; + if(!empty($value['pic'])) { + include_once libfile('function/home'); + pic_delete($value['pic'], 'album', 0, ($value['picflag'] == 2 ? 1 : 0)); + } + } + $counts[$value['uid']]['albums'] -= 1; + } + } + + if(empty($dels)) return array(); + + $pics = $picids = array(); + $query = C::t('home_pic')->fetch_all_by_albumid($newids); + foreach($query as $value) { + $pics[] = $value; + $picids[] = $value['picid']; + $sizes[$value['uid']] = $sizes[$value['uid']] + $value['size']; + } + + if($picids) { + deletepics($picids); + } + C::t('home_album')->delete($newids); + C::t('home_feed')->delete_by_id_idtype($newids, 'albumid'); + if($picids) { + C::t('home_clickuser')->delete_by_id_idtype($picids, 'picid'); + } + + if($sizes) { + foreach ($sizes as $uid => $value) { + $attachsize = intval($sizes[$uid]); + $albumnum = $counts[$uid]['albums'] ? $counts[$uid]['albums'] : 0; + updatemembercount($uid, array('albums' => $albumnum, 'attachsize' => -$attachsize), false); + } + } + return $dels; +} + +function deletetrasharticle($aids) { + global $_G; + + require_once libfile('function/home'); + $articles = $trashid = $pushs = $dels = array(); + foreach(C::t('portal_article_trash')->fetch_all($aids) as $value) { + $dels[$value['aid']] = $value['aid']; + $article = dunserialize($value['content']); + $articles[$article['aid']] = $article; + if(!empty($article['idtype'])) $pushs[$article['idtype']][] = $article['id']; + if($article['pic']) { + pic_delete($article['pic'], 'portal', $article['thumb'], $article['remote']); + } + if($article['htmlmade'] && $article['htmldir'] && $article['htmlname']) { + deletehtml(DISCUZ_ROOT.'/'.$article['htmldir'].$article['htmlname'], $article['contents']); + } + } + + if($dels) { + C::t('portal_article_trash')->delete($dels, 'UNBUFFERED'); + deletearticlepush($pushs); + deletearticlerelated($dels); + } + + return $articles; +} + +function deletearticle($aids, $istrash = true) { + global $_G; + + if(empty($aids)) return false; + $trasharr = $article = $bids = $dels = $attachment = $attachaid = $catids = $pushs = array(); + $query = C::t('portal_article_title')->fetch_all($aids); + foreach($query as $value) { + $catids[] = intval($value['catid']); + $dels[$value['aid']] = $value['aid']; + $article[] = $value; + if(!empty($value['idtype'])) $pushs[$value['idtype']][] = $value['id']; + } + if($dels) { + foreach($article as $key => $value) { + if($istrash) { + $trasharr[] = array('aid' => $value['aid'], 'content'=>serialize($value)); + } else { + if($value['pic']) { + pic_delete($value['pic'], 'portal', $value['thumb'], $value['remote']); + } + if($value['htmlmade'] && $value['htmldir'] && $value['htmlname']) { + deletehtml(DISCUZ_ROOT.'/'.$value['htmldir'].$value['htmlname'], $value['contents']); + } + } + } + if($istrash && $trasharr) { + C::t('portal_article_trash')->insert_batch($trasharr); + } else { + deletearticlepush($pushs); + deletearticlerelated($dels); + } + + C::t('portal_article_title')->delete($dels); + C::t('common_moderate')->delete_moderate($dels, 'aid'); + + $catids = array_unique($catids); + if($catids) { + foreach($catids as $catid) { + $cnt = C::t('portal_article_title')->fetch_count_for_cat($catid); + C::t('portal_category')->update($catid, array('articles'=>dintval($cnt))); + } + } + } + return $article; +} + +function deletearticlepush($pushs) { + if(!empty($pushs) && is_array($pushs)) { + foreach($pushs as $idtype=> $fromids) { + switch ($idtype) { + case 'blogid': + if(!empty($fromids)) C::t('home_blogfield')->update($fromids, array('pushedaid'=>'0')); + break; + case 'tid': + if(!empty($fromids)) C::t('forum_thread')->update($fromids, array('pushedaid'=>'0')); + break; + } + } + } +} + +function deletearticlerelated($dels) { + + C::t('portal_article_count')->delete($dels); + C::t('portal_article_content')->delete_by_aid($dels); + + if($attachment = C::t('portal_attachment')->fetch_all_by_aid($dels)) { + require_once libfile('function/home'); + foreach ($attachment as $value) { + pic_delete($value['attachment'], 'portal', $value['thumb'], $value['remote']); + } + C::t('portal_attachment')->delete(array_keys($attachment)); + } + + C::t('portal_comment')->delete_by_id_idtype($dels, 'aid'); + C::t('common_moderate')->delete_moderate($dels, 'aid_cid'); + + C::t('portal_article_related')->delete_by_aid_raid($dels); + +} + +function deleteportaltopic($dels) { + if(empty($dels)) return false; + $targettplname = array(); + foreach ((array)$dels as $key => $value) { + $targettplname[] = 'portal/portal_topic_content_'.$value; + } + C::t('common_diy_data')->delete($targettplname, null); + + require_once libfile('class/blockpermission'); + $tplpermission = & template_permission::instance(); + $templates = array(); + $tplpermission->delete_allperm_by_tplname($targettplname); + + deletedomain($dels, 'topic'); + C::t('common_template_block')->delete_by_targettplname($targettplname); + + require_once libfile('function/home'); + + $picids = array(); + foreach(C::t('portal_topic')->fetch_all($dels) as $value) { + if($value['picflag'] != '0') pic_delete(str_replace('portal/', '', $value['cover']), 'portal', 0, $value['picflag'] == '2' ? '1' : '0'); + } + + $picids = array(); + foreach(C::t('portal_topic_pic')->fetch_all($dels) as $value) { + $picids[] = $value['picid']; + pic_delete($value['filepath'], 'portal', $value['thumb'], $value['remote']); + } + if (!empty($picids)) { + C::t('portal_topic_pic')->delete($picids, true); + } + + + C::t('portal_topic')->delete($dels); + C::t('portal_comment')->delete_by_id_idtype($dels, 'topicid'); + C::t('common_moderate')->delete_moderate($dels, 'topicid_cid'); + + include_once libfile('function/block'); + block_clear(); + + include_once libfile('function/cache'); + updatecache('diytemplatename'); +} + +function deletedomain($ids, $idtype) { + if($ids && $idtype) { + C::t('common_domain')->delete_by_id_idtype($ids, $idtype); + } +} + +function deletecollection($ctid) { + $tids = array(); + $threadlist = C::t('forum_collectionthread')->fetch_all_by_ctid($ctid); + $tids = array_keys($threadlist); + + deleterelatedtid($tids, $ctid); + + $collectionteamworker = C::t('forum_collectionteamworker')->fetch_all_by_ctid($ctid); + foreach ($collectionteamworker as $worker) { + notification_add($worker['uid'], "system", 'collection_removed', array('ctid'=>$collectiondata['ctid'], 'collectionname'=>$collectiondata['name']), 1); + } + + C::t('forum_collectionthread')->delete_by_ctid($ctid); + C::t('forum_collectionfollow')->delete_by_ctid($ctid); + C::t('forum_collectioncomment')->delete_by_ctid($ctid); + C::t('forum_collectionteamworker')->delete_by_ctid($ctid); + C::t('forum_collectioninvite')->delete_by_ctid($ctid); + C::t('forum_collection')->delete($ctid, true); +} + +function deleterelatedtid($tids, $ctid) { + $loadreleated = C::t('forum_collectionrelated')->fetch_all($tids, true); + foreach($loadreleated as $loadexist) { + if($loadexist['tid']) { + $collectionlist = explode("\t", $loadexist['collection']); + if(count($collectionlist)>0) { + foreach ($collectionlist as $collectionkey=>$collectionvalue) { + if ($collectionvalue == $ctid) { + unset($collectionlist[$collectionkey]); + break; + } + } + } + $newcollection = implode("\t", $collectionlist); + if (trim($newcollection) == '') { + C::t('forum_collectionrelated')->delete($loadexist['tid']); + C::t('forum_thread')->update_status_by_tid($loadexist['tid'], '1111111011111111', '&'); + } else { + C::t('forum_collectionrelated')->update_collection_by_ctid_tid($newcollection, $loadexist['tid'], true); + } + } + } +} + +function deletehtml($htmlname, $count = 1) { + global $_G; + @unlink($htmlname.'.'.$_G['setting']['makehtml']['extendname']); + if($count > 1) { + for($i = 2; $i <= $count; $i++) { + @unlink($htmlname.$i.'.'.$_G['setting']['makehtml']['extendname']); + } + } +} + +function deletememberpost($uids) { + global $_G; + require_once libfile('function/post'); + loadcache('posttableids'); + + foreach($uids as $uid) { + $tidsdelete = array(); + $posttables = empty($_G['cache']['posttableids']) ? array(0) : $_G['cache']['posttableids']; + foreach($posttables as $posttableid) { + $pidsthread = $pidsdelete = array(); + $postlist = C::t('forum_post')->fetch_all_by_authorid($posttableid, $uid, false); + if($postlist) { + foreach($postlist as $post) { + if($post['first']) { + $tidsdelete[] = $post['tid']; + } + $pidsdelete[] = $post['pid']; + $pidsthread[$post['pid']] = $post['tid']; + } + } + deletepost($pidsdelete, 'pid', true, $posttableid, true); + } + unset($postlist); + if($tidsdelete) { + deletethread($tidsdelete, true, true, true); + } + } +} + +?> \ No newline at end of file diff --git a/source/function/function_discuzcode.php b/source/function/function_discuzcode.php new file mode 100644 index 0000000..5e70b43 --- /dev/null +++ b/source/function/function_discuzcode.php @@ -0,0 +1,724 @@ + -1, + 'codecount' => 0, + 'codehtml' => array(), + 'passwordlock' => array(), + 'smiliesreplaced' => 0, + 'seoarray' => array( + 0 => '', + 1 => $_SERVER['HTTP_HOST'], + 2 => $_G['setting']['bbname'], + 3 => str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']), + 4 => $_G['setting']['seokeywords'], + 5 => $_G['setting']['seodescription'] + ) +); + +if(!isset($_G['cache']['bbcodes']) || !is_array($_G['cache']['bbcodes']) || !is_array($_G['cache']['smilies'])) { + loadcache(array('bbcodes', 'smilies', 'smileytypes')); +} + +function creditshide($creditsrequire, $message, $pid, $authorid) { + global $_G; + if($_G['member']['credits'] >= $creditsrequire || $_G['forum']['ismoderator'] || $_G['uid'] && $authorid == $_G['uid']) { + return tpl_hide_credits($creditsrequire, str_replace('\\"', '"', $message)); + } else { + return tpl_hide_credits_hidden($creditsrequire); + } +} + +function expirehide($expiration, $creditsrequire, $message, $dateline) { + $expiration = $expiration ? substr($expiration, 1) : 0; + if($expiration && $dateline && (TIMESTAMP - $dateline) / 86400 > $expiration) { + return str_replace('\\"', '"', $message); + } + return '[hide'.($creditsrequire ? "=$creditsrequire" : '').']'.str_replace('\\"', '"', $message).'[/hide]'; +} + +function codedisp($code) { + global $_G; + $_G['forum_discuzcode']['pcodecount']++; + $code = dhtmlspecialchars(str_replace('\\"', '"', $code)); + $code = str_replace("\n", "
  • ", $code); + $_G['forum_discuzcode']['codehtml'][$_G['forum_discuzcode']['pcodecount']] = tpl_codedisp($code); + $_G['forum_discuzcode']['codecount']++; + return "[\tDISCUZ_CODE_".$_G['forum_discuzcode']['pcodecount']."\t]"; +} + +function karmaimg($rate, $ratetimes) { + $karmaimg = ''; + if($rate && $ratetimes) { + $image = $rate > 0 ? 'agree.gif' : 'disagree.gif'; + for($i = 0; $i < ceil(abs($rate) / $ratetimes); $i++) { + $karmaimg .= ''; + } + } + return $karmaimg; +} + +function discuzcode($message, $smileyoff = false, $bbcodeoff = false, $htmlon = 0, $allowsmilies = 1, $allowbbcode = 1, $allowimgcode = 1, $allowhtml = 0, $jammer = 0, $parsetype = '0', $authorid = '0', $allowmediacode = '0', $pid = 0, $lazyload = 0, $pdateline = 0, $first = 0) { + global $_G; + + static $authorreplyexist; + + if($pid && strpos($message, '[/password]') !== FALSE) { + if($authorid != $_G['uid'] && !$_G['forum']['ismoderator']) { + $message = preg_replace_callback( + "/\s?\[password\](.+?)\[\/password\]\s?/i", + function ($matches) use ($pid) { + return parsepassword($matches[1], intval($pid)); + }, + $message + ); + if($_G['forum_discuzcode']['passwordlock'][$pid]) { + return ''; + } + } else { + $message = preg_replace("/\s?\[password\](.+?)\[\/password\]\s?/i", "", $message); + $_G['forum_discuzcode']['passwordauthor'][$pid] = 1; + } + } + + $message = preg_replace('/\[\tDISCUZ_CODE_\d+\t\]/', '', $message); + if($parsetype != 1 && !$bbcodeoff && $allowbbcode && (strpos($message, '[/code]') || strpos($message, '[/CODE]')) !== FALSE) { + $message = preg_replace_callback("/\s?\[code\](.+?)\[\/code\]\s?/is", 'discuzcode_callback_codedisp_1', $message); + } + + $msglower = strtolower($message); + + $htmlon = $htmlon && $allowhtml ? 1 : 0; + + if(!$htmlon) { + $message = dhtmlspecialchars($message); + } else { + $message = preg_replace("/]*?>(.*?)<\/script>/i", '', $message); + } + + if($_G['setting']['plugins']['func'][HOOKTYPE]['discuzcode']) { + $_G['discuzcodemessage'] = & $message; + $param = func_get_args(); + hookscript('discuzcode', 'global', 'funcs', array('param' => $param, 'caller' => 'discuzcode'), 'discuzcode'); + } + + if(!$smileyoff && $allowsmilies) { + $message = parsesmiles($message); + } + + if($_G['setting']['allowattachurl'] && strpos($msglower, 'attach://') !== FALSE) { + $message = preg_replace_callback("/attach:\/\/(\d+)\.?(\w*)/i", 'discuzcode_callback_parseattachurl_12', $message); + } + + if($allowbbcode) { + if(strpos($msglower, 'ed2k://') !== FALSE) { + $message = preg_replace_callback("/ed2k:\/\/([^\/\s'\"]+)\//", 'discuzcode_callback_parseed2k_1', $message); + } + } + + if(!$bbcodeoff && $allowbbcode) { + if(strpos($msglower, '[/url]') !== FALSE) { + $message = preg_replace_callback("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\r\n\[\"']+?))?\](.+?)\[\/url\]/is", 'discuzcode_callback_parseurl_152', $message); + } + if(strpos($msglower, '[/email]') !== FALSE) { + $message = preg_replace_callback("/\[email(=([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+))?\](.+?)\[\/email\]/is", 'discuzcode_callback_parseemail_14', $message); + } + + $nest = 0; + while(strpos($msglower, '[table') !== FALSE && strpos($msglower, '[/table]') !== FALSE){ + $message = preg_replace_callback("/\[table(?:=(\d{1,4}%?)(?:,([\(\)%,#\w ]+))?)?\]\s*(.+?)\s*\[\/table\]/is", 'discuzcode_callback_parsetable_123', $message); + if(++$nest > 4) break; + } + + $message = str_replace(array( + '[/color]', '[/backcolor]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', '[s]', '[/s]', '[hr]', '[/p]', + '[i=s]', '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', + '[list=A]', "\r\n[*]", '[*]', '[/list]', '[indent]', '[/indent]', '[/float]' + ), array( + '', '', '', '', '
  • ', '', '', '', '', '
    ', '

    ', '', '', + '', '', '', '
      ', '
        ', '
          ', + '
            ', '
          • ', '
          • ', '
          ', '
          ', '
          ', '' + ), preg_replace(array( + "/\[color=([#\w]+?)\]/i", + "/\[color=((rgb|rgba)\([\d\s\.,]+?\))\]/i", + "/\[backcolor=([#\w]+?)\]/i", + "/\[backcolor=((rgb|rgba)\([\d\s\.,]+?\))\]/i", + "/\[size=(\d{1,2}?)\]/i", + "/\[size=(\d{1,2}(\.\d{1,5})?(px|pt)+?)\]/i", + "/\[size=(\d+(\.\d+)?(px|pt)+?)\]/i", + "/\[font=([^\[\<]+?)\]/i", + "/\[align=(left|center|right)\]/i", + "/\[p=(\d{1,2}|null), (\d{1,2}|null), (left|center|right)\]/i", + "/\[float=left\]/i", + "/\[float=right\]/i" + + ), array( + "", + "", + "", + "", + "", + "", + "", + "", + "
          ", + "

          ", + "", + "" + ), $message)); + + if($pid && !defined('IN_MOBILE')) { + $message = preg_replace_callback( + "/\s?\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]\s?/is", + function ($matches) use ($pid) { + return parsepostbg($matches[1], intval($pid)); + }, + $message + ); + } else { + $message = preg_replace("/\s?\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]\s?/is", "", $message); + } + + if($parsetype != 1) { + if(strpos($msglower, '[/quote]') !== FALSE) { + $message = preg_replace("/\s?\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s?/is", tpl_quote(), $message); + } + if(strpos($msglower, '[/free]') !== FALSE) { + $message = preg_replace("/\s*\[free\][\n\r]*(.+?)[\n\r]*\[\/free\]\s*/is", tpl_free(), $message); + } + } + if(!defined('IN_MOBILE') || !in_array(constant('IN_MOBILE'), array('1', '3', '4'))) { + if(strpos($msglower, '[/media]') !== FALSE) { + $message = preg_replace_callback("/\[media=([\w%,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/is", $allowmediacode ? 'discuzcode_callback_parsemedia_12' : 'discuzcode_callback_bbcodeurl_2', $message); + } + if(strpos($msglower, '[/audio]') !== FALSE) { + $message = preg_replace_callback("/\[audio(=1)*\]\s*([^\[\<\r\n]+?)\s*\[\/audio\]/is", $allowmediacode ? 'discuzcode_callback_parseaudio_2' : 'discuzcode_callback_bbcodeurl_2', $message); + } + if(strpos($msglower, '[/flash]') !== FALSE) { + $message = preg_replace_callback("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", $allowmediacode ? 'discuzcode_callback_parseflash_234' : 'discuzcode_callback_bbcodeurl_4', $message); + } + } else { + if(strpos($msglower, '[/media]') !== FALSE) { + $message = preg_replace("/\[media=([\w%,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/is", "[media]\\2[/media]", $message); + } + if(strpos($msglower, '[/audio]') !== FALSE) { + $message = preg_replace("/\[audio(=1)*\]\s*([^\[\<\r\n]+?)\s*\[\/audio\]/is", "[media]\\2[/media]", $message); + } + if(strpos($msglower, '[/flash]') !== FALSE) { + $message = preg_replace("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", "[media]\\4[/media]", $message); + } + } + + if($parsetype != 1 && $allowbbcode < 0 && isset($_G['cache']['bbcodes'][-$allowbbcode])) { + $message = preg_replace($_G['cache']['bbcodes'][-$allowbbcode]['searcharray'], $_G['cache']['bbcodes'][-$allowbbcode]['replacearray'], $message); + } + if($parsetype != 1 && strpos($msglower, '[/hide]') !== FALSE && $pid) { + if($_G['setting']['hideexpiration'] && $pdateline && (TIMESTAMP - $pdateline) / 86400 > $_G['setting']['hideexpiration']) { + $message = preg_replace("/\[hide[=]?(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", "\\3", $message); + $msglower = strtolower($message); + } + if(strpos($msglower, '[hide=d') !== FALSE) { + $message = preg_replace_callback( + "/\[hide=(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", + function ($matches) use ($pdateline) { + return expirehide($matches[1], $matches[2], $matches[3], intval($pdateline)); + }, + $message + ); + $msglower = strtolower($message); + } + if(strpos($msglower, '[hide]') !== FALSE) { + if($authorreplyexist === null) { + if(!$_G['forum']['ismoderator']) { + if($_G['uid']) { + $_post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $pid); + $authorreplyexist = $_post['tid'] == $_G['tid'] ? C::t('forum_post')->fetch_pid_by_tid_authorid($_G['tid'], $_G['uid']) : FALSE; + } + } else { + $authorreplyexist = TRUE; + } + } + if($authorreplyexist) { + $message = preg_replace("/\[hide\]\s*(.*?)\s*\[\/hide\]/is", tpl_hide_reply(), $message); + } else { + $message = preg_replace("/\[hide\](.*?)\[\/hide\]/is", tpl_hide_reply_hidden(), $message); + $message = ''.$message; + } + } + if(strpos($msglower, '[hide=') !== FALSE) { + $message = preg_replace_callback( + "/\[hide=(\d+)\]\s*(.*?)\s*\[\/hide\]/is", + function ($matches) use ($pid, $authorid) { + return creditshide($matches[1], $matches[2], intval($pid), intval($authorid)); + }, + $message + ); + } + } + } + + if(!$bbcodeoff) { + if($parsetype != 1 && strpos($msglower, '[swf]') !== FALSE) { + $message = preg_replace_callback("/\[swf\]\s*([^\[\<\r\n]+?)\s*\[\/swf\]/is", 'discuzcode_callback_bbcodeurl_1', $message); + } + $attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src'; + if(strpos($msglower, '[/img]') !== FALSE) { + $message = preg_replace_callback( + "/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", + function ($matches) use ($allowimgcode, $lazyload, $pid, $allowbbcode) { + if (intval($allowimgcode)) { + return parseimg(0, 0, $matches[1], intval($lazyload), intval($pid), 'onmouseover="img_onmouseoverfunc(this)" '.(intval($lazyload) ? 'lazyloadthumb="1"' : 'onload="thumbImg(this)"')); + } + return (intval($allowbbcode) ? (!defined('IN_MOBILE') ? bbcodeurl($matches[1], '{url}') : bbcodeurl($matches[1], '')) : bbcodeurl($matches[1], '{url}')); + }, + $message + ); + $message = preg_replace_callback( + "/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", + function ($matches) use ($allowimgcode, $lazyload, $pid, $allowbbcode) { + if (intval($allowimgcode)) { + return parseimg($matches[1], $matches[2], $matches[3], intval($lazyload), intval($pid)); + } + return (intval($allowbbcode) ? (!defined('IN_MOBILE') ? bbcodeurl($matches[3], '{url}') : bbcodeurl($matches[3], '')) : bbcodeurl($matches[3], '{url}')); + }, + $message + ); + } + } + + for($i = 0; $i <= $_G['forum_discuzcode']['pcodecount']; $i++) { + $message = str_replace("[\tDISCUZ_CODE_$i\t]", $_G['forum_discuzcode']['codehtml'][$i], $message); + } + + unset($msglower); + + if($jammer) { + $message = preg_replace_callback("/\r\n|\n|\r/", 'discuzcode_callback_jammer', $message); + } + if($first) { + if(helper_access::check_module('group')) { + $message = preg_replace("/\[groupid=(\d+)\](.*)\[\/groupid\]/i", lang('forum/template', 'fromgroup').': \\2', $message); + } else { + $message = preg_replace("/(\[groupid=\d+\].*\[\/groupid\])/i", '', $message); + } + + } + return $htmlon ? $message : nl2br(str_replace(array("\t", ' ', ' '), array('        ', '   ', '  '), $message)); +} + +function discuzcode_callback_codedisp_1($matches) { + return codedisp($matches[1]); +} + +function discuzcode_callback_parseattachurl_12($matches) { + return parseattachurl($matches[1], $matches[2], 1); +} + +function discuzcode_callback_parseed2k_1($matches) { + return parseed2k($matches[1]); +} + +function discuzcode_callback_parseurl_152($matches) { + return parseurl($matches[1], $matches[5], $matches[2]); +} + +function discuzcode_callback_parseemail_14($matches) { + return parseemail($matches[1], $matches[4]); +} + +function discuzcode_callback_parsetable_123($matches) { + return parsetable($matches[1], $matches[2], $matches[3]); +} + +function discuzcode_callback_parsemedia_12($matches) { + return parsemedia($matches[1], $matches[2]); +} + +function discuzcode_callback_bbcodeurl_2($matches) { + return bbcodeurl($matches[2], '{url}'); +} + +function discuzcode_callback_parseaudio_2($matches) { + return parseaudio($matches[2], 400); +} + +function discuzcode_callback_parseflash_234($matches) { + return parseflash($matches[2], $matches[3], $matches[4]); +} + +function discuzcode_callback_bbcodeurl_4($matches) { + return bbcodeurl($matches[4], '{url}'); +} + +function discuzcode_callback_bbcodeurl_1($matches) { + return bbcodeurl($matches[1], ' Flash: {url} '); +} + +function discuzcode_callback_jammer($matches) { + return jammer(); +} + +function parseurl($url, $text, $scheme) { + global $_G; + if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) { + $url = $matches[0]; + $length = 65; + if(strlen($url) > $length) { + $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3)); + } + return ''.$text.''; + } else { + $url = substr($url, 1); + if(substr(strtolower($url), 0, 4) == 'www.') { + $url = 'http://'.$url; + } + $url = !$scheme ? $_G['siteurl'].$url : $url; + return ''.$text.''; + } +} + +function parseflash($w, $h, $url) { + $w = !$w ? 550 : $w; + $h = !$h ? 400 : $h; + $ext = fileext($url) == 'flv' ? 'flv' : 'swf'; + $params = "$ext,$w,$h"; + return parsemedia($params, $url); +} + +function parseed2k($url) { + global $_G; + list(,$type, $name, $size,) = explode('|', $url); + $url = 'ed2k://'.$url.'/'; + $name = addslashes($name); + if($type == 'file') { + $ed2kid = 'ed2k_'.random(3); + return ''.dhtmlspecialchars(urldecode($name)).' ('.sizecount($size).')'; + } else { + return ''.$url.''; + } +} + +function parseattachurl($aid, $ext, $ignoretid = 0) { + global $_G; + require_once libfile('function/attachment'); + $_G['forum_skipaidlist'][] = $aid; + if(!empty($ext)) { + $attach = C::t('forum_attachment_n')->fetch('aid:'.$aid, $aid); + if(!in_array(attachtype(fileext($attach['filename'])."\t", 'id'), array(9, 10))) { + $ext = 0; + } + } + return $_G['siteurl'].'forum.php?mod=attachment&aid='.aidencode($aid, $ext, $ignoretid ? '' : $_G['tid']).($ext ? '&request=yes&_f=.'.$ext : ''); +} + +function parseemail($email, $text) { + $text = str_replace('\"', '"', $text); + if(!$email && preg_match("/\s*([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\s*/i", $text, $matches)) { + $email = trim($matches[0]); + return ''.$email.''; + } else { + return ''.$text.''; + } +} + +function parsetable($width, $bgcolor, $message) { + if(strpos($message, '[/tr]') === FALSE && strpos($message, '[/td]') === FALSE) { + $rows = explode("\n", $message); + $s = !defined('IN_MOBILE') ? '' : '>') : '
          '; + foreach($rows as $row) { + $s .= ''; + } + $s .= '
          '.str_replace(array('\|', '|', '\n'), array('|', '', "\n"), $row).'
          '; + return $s; + } else { + if(!preg_match("/^\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td([=\d,%]+)?\]/", $message) && !preg_match("/^]*?>\s*]*?>/", $message)) { + return str_replace('\\"', '"', preg_replace("/\[tr(?:=([\(\)\s%,#\w]+))?\]|\[td([=\d,%]+)?\]|\[\/td\]|\[\/tr\]/", '', $message)); + } + if(substr($width, -1) == '%') { + $width = substr($width, 0, -1) <= 98 ? intval($width).'%' : '98%'; + } else { + $width = intval($width); + $width = $width ? ($width <= 560 ? $width.'px' : '98%') : ''; + } + $message = preg_replace_callback("/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,4}%?))?\]/i", 'parsetable_callback_parsetrtd_12', $message); + $message = preg_replace_callback("/\[\/td\]\s*\[td(?:=(\d{1,4}%?))?\]/i", 'parsetable_callback_parsetrtd_1', $message); + $message = preg_replace_callback("/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/i", 'parsetable_callback_parsetrtd_1234', $message); + $message = preg_replace_callback("/\[\/td\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/i", 'parsetable_callback_parsetrtd_123', $message); + $message = preg_replace("/\[\/td\]\s*\[\/tr\]\s*/i", '', $message); + return (!defined('IN_MOBILE') ? '' : '>') : '
          '). + str_replace('\\"', '"', $message).'
          '; + } +} + +function parsetable_callback_parsetrtd_12($matches) { + return parsetrtd($matches[1], 0, 0, $matches[2]); +} + +function parsetable_callback_parsetrtd_1($matches) { + return parsetrtd('td', 0, 0, $matches[1]); +} + +function parsetable_callback_parsetrtd_1234($matches) { + return parsetrtd($matches[1], $matches[2], $matches[3], $matches[4]); +} + +function parsetable_callback_parsetrtd_123($matches) { + return parsetrtd('td', $matches[1], $matches[2], $matches[3]); +} + +function parsetrtd($bgcolor, $colspan, $rowspan, $width) { + return ($bgcolor == 'td' ? '' : '').' 1 ? ' colspan="'.$colspan.'"' : '').($rowspan > 1 ? ' rowspan="'.$rowspan.'"' : '').($width && !defined('IN_MOBILE') ? ' width="'.$width.'"' : '').'>'; +} + +function parseaudio($url, $width = 400) { + $url = addslashes($url); + if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://')) && !preg_match('/^static\//', $url) && !preg_match('/^data\//', $url)) { + return dhtmlspecialchars($url); + } + $type = fileext($url); + $randomid = random(3); + return '

          '; +} + +function parsemedia($params, $url) { + $params = explode(',', $params); + + if(preg_match('/^(auto|100%|[0-9]{1,2}%)$/', $params[1], $matches)) { + $width = $matches[1]; + } else { + $width = ($params[1] > 0 && $params[1] < 8192) ? intval($params[1]) : 800; + } + + if(preg_match('/^(auto|100%|[0-9]{1,2}%)$/', $params[2], $matches)) { + $height = $matches[1]; + } else { + $height = ($params[2] > 0 && $params[2] < 4096) ? intval($params[2]) : 600; + } + + $width = defined('IN_MOBILE') ? '100%' : $width; + $height = defined('IN_MOBILE') ? 'auto' : $height; + + $url = addslashes($url); + if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://')) && !preg_match('/^static\//', $url) && !preg_match('/^data\//', $url)) { + return dhtmlspecialchars($url); + } + + if($flv = parseflv($url, $width, $height)) { + return $flv; + } + if(in_array(count($params), array(3, 4))) { + $type = fileext($url); + $url = str_replace(array('<', '>'), '', str_replace('\\"', '\"', $url)); + if(in_array($params[0], array('rtsp', 'mms'))) { + $mediaid = 'media_'.random(3); + return $params[0] == 'rtsp' ? '
          ' : ''; + } + $audio = array('aac', 'flac', 'ogg', 'mp3', 'm4a', 'weba', 'wma', 'mid', 'wav', 'ra', 'ram'); + $video = array('rm', 'rmvb', 'flv', 'swf', 'asf', 'asx', 'wmv', 'avi', 'mpg', 'mpeg', 'mp4', 'm4v', '3gp', 'ogv', 'webm', 'mov'); + if (in_array($type, $audio)) { + return parseaudio($url, $width); + } else if (in_array($type, $video)) { + $randomid = random(3); + return ''; + } else { + return ''.$url.''; + } + } + return; +} + +function bbcodeurl($url, $tags) { + if(!preg_match("/<.+?>/s", $url)) { + if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://')) && !preg_match('/^static\//', $url) && !preg_match('/^data\//', $url)) { + $url = 'http://'.$url; + } + return str_replace(array('submit', 'member.php?mod=logging'), array('', ''), str_replace('{url}', addslashes($url), $tags)); + } else { + return ' '.$url; + } +} + +function jammer() { + $randomstr = ''; + for($i = 0; $i < mt_rand(5, 15); $i++) { + $randomstr .= chr(mt_rand(32, 59)).' '.chr(mt_rand(63, 126)); + } + return mt_rand(0, 1) ? ''.$randomstr.''."\r\n" : + "\r\n".''.$randomstr.''; +} + +function highlightword($text, $words, $prepend) { + $text = str_replace('\"', '"', $text); + foreach($words AS $key => $replaceword) { + $text = str_replace($replaceword, ''.$replaceword.'', $text); + } + return "$prepend$text"; +} + +function parseflv($url, $width = 0, $height = 0) { + global $_G; + $lowerurl = strtolower($url); + $flv = $iframe = $imgurl = ''; + if(empty($_G['setting']['parseflv']) || !is_array($_G['setting']['parseflv'])) { + return FALSE; + } + + foreach($_G['setting']['parseflv'] as $script => $checkurl) { + $check = FALSE; + foreach($checkurl as $row) { + if(strpos($lowerurl, $row) !== FALSE) { + $check = TRUE; + break; + } + } + if($check) { + @include_once libfile('media/'.$script, 'function'); + if(function_exists('media_'.$script)) { + list($flv, $iframe, $url, $imgurl) = call_user_func('media_'.$script, $url, $width, $height); + } + break; + } + } + if($flv || $iframe) { + if(!$width && !$height) { + return array('flv' => $flv, 'iframe' => $iframe, 'imgurl' => $imgurl); + } else { + $width = addslashes($width); + $height = addslashes($height); + $flv = addslashes($flv); + $iframe = addslashes($iframe); + $randomid = 'flv_'.random(3); + $player_iframe = $iframe ? "\"\"" : ''; + $player_flv = $flv ? "AC_FL_RunContent('width', '$width', 'height', '$height', 'allowNetworking', 'internal', 'allowScriptAccess', 'never', 'src', '$flv', 'quality', 'high', 'bgcolor', '#ffffff', 'wmode', 'transparent', 'allowfullscreen', 'true')" : ''; + $player = (!empty($player_iframe) && !empty($player_flv)) ? "detectHtml5Support() ? $player_iframe : $player_flv" : (empty($player_iframe) ? $player_flv : $player_iframe); + return ''; + } + } else { + return FALSE; + } +} + +function parseimg($width, $height, $src, $lazyload, $pid, $extra = '') { + global $_G, $aimgs; + static $styleoutput = null; + if($_G['setting']['domainwhitelist_affectimg']) { + $tmp = parse_url($src); + if(!empty($tmp['host']) && !iswhitelist($tmp['host'])) { + return $src; + } + } + if(strstr($src, 'file:') || substr($src, 1, 1) == ':') { + return $src; + } + if($width > $_G['setting']['imagemaxwidth']) { + $height = intval($_G['setting']['imagemaxwidth'] * $height / $width); + $width = $_G['setting']['imagemaxwidth']; + if(defined('IN_MOBILE')) { + $extra = ''; + } else { + $extra = 'onmouseover="img_onmouseoverfunc(this)" onclick="zoom(this)" style="cursor:pointer"'; + } + } + $attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src'; + $rimg_id = random(5); + $aimgs[$pid][] = $rimg_id; + $guestviewthumb = !empty($_G['setting']['guestviewthumb']['flag']) && empty($_G['uid']); + $img = ''; + if($guestviewthumb) { + if(!isset($styleoutput)) { + $img .= guestviewthumbstyle(); + $styleoutput = true; + } + $img .= ''; + + } else { + if(defined('IN_MOBILE')) { + $img = ' 0 ? ' width="'.$width.'"' : '').($height > 0 ? ' height="'.$height.'"' : '').' src="{url}" border="0" alt="" />'; + } else { + $img = ' 0 ? ' width="'.$width.'"' : '').($height > 0 ? ' height="'.$height.'"' : '').' '.$attrsrc.'="{url}" '.($extra ? $extra.' ' : '').'border="0" alt="" />'; + } + } + $code = bbcodeurl($src, $img); + if($guestviewthumb) { + $code = str_replace('{loginurl}', 'member.php?mod=logging&action=login', $code); + } + return $code; +} + +function parsesmiles(&$message) { + global $_G; + static $enablesmiles; + if($enablesmiles === null) { + $enablesmiles = false; + if(!empty($_G['cache']['smilies']) && is_array($_G['cache']['smilies'])) { + foreach($_G['cache']['smilies']['replacearray'] AS $key => $smiley) { + $_G['cache']['smilies']['replacearray'][$key] = ''; + } + $enablesmiles = true; + } + } + $enablesmiles && $message = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], $message, $_G['setting']['maxsmilies']); + return $message; +} + +function parsepostbg($bgimg, $pid) { + global $_G; + static $postbg; + if($postbg[$pid]) { + return ''; + } + loadcache('postimg'); + foreach($_G['cache']['postimg']['postbg'] as $postbg) { + if($postbg['url'] != $bgimg) { + continue; + } + $bgimg = dhtmlspecialchars(basename($bgimg), ENT_QUOTES); + $postbg[$pid] = true; + $_G['forum_posthtml']['header'][$pid] .= ''; + break; + } + return ''; +} + +function parsepassword($password, $pid) { + global $_G; + static $postpw = array(); + if($postpw[$pid]) { + return ''; + } + $postpw[$pid] = true; + if(empty($_G['cookie']['postpw_'.$pid]) || $_G['cookie']['postpw_'.$pid] != md5($password)) { + $_G['forum_discuzcode']['passwordlock'][$pid] = 1; + } + return ''; +} + +function guestviewthumbstyle() { + static $styleoutput = null; + $return = ''; + if ($styleoutput === null) { + global $_G; + $return = ''; + $styleoutput = true; + } + return $return; +} +?> \ No newline at end of file diff --git a/source/function/function_domain.php b/source/function/function_domain.php new file mode 100644 index 0000000..c9f3b60 --- /dev/null +++ b/source/function/function_domain.php @@ -0,0 +1,69 @@ + $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; +} + +function isholddomain($domain) { + global $_G; + + $domain = strtolower($domain); + $holdmainarr = empty($_G['setting']['holddomain'])?array('www'):explode('|', $_G['setting']['holddomain']); + $ishold = false; + foreach ($holdmainarr as $value) { + if(strpos($value, '*') === false) { + if(strtolower($value) == $domain) { + $ishold = true; + break; + } + } else { + $value = str_replace('*', '.*?', $value); + if(@preg_match("/$value/i", $domain)) { + $ishold = true; + break; + } + } + } + return $ishold; +} + +function existdomain($domain, $domainroot) { + global $_G; + + $exist = false; + if(C::t('common_domain')->count_by_domain_domainroot($domain, $domainroot)) { + $exist = true; + } + return $exist; +} +?> \ No newline at end of file diff --git a/source/function/function_ec_credit.php b/source/function/function_ec_credit.php new file mode 100644 index 0000000..92da50d --- /dev/null +++ b/source/function/function_ec_credit.php @@ -0,0 +1,85 @@ + $all['good'] - $halfyear['good'], + 'soso' => $all['soso'] - $halfyear['soso'], + 'bad' => $all['bad'] - $halfyear['bad'], + 'total' => $all['total'] - $halfyear['total'] + ); + + $data = array('all' => $all, 'before' => $before, 'halfyear' => $halfyear, 'thismonth' => $thismonth, 'thisweek' => $thisweek); + + C::t('forum_spacecache')->insert(array( + 'uid' => $uid, + 'variable' => $type, + 'value' => serialize($data), + 'expiration' => getexpiration(), + ), false, true); + if($return) { + return $data; + } +} + +function countcredit($uid, $type, $days = 0) { + $type = $type == 'sellercredit' ? 1 : 0; + $good = $soso = $bad = 0; + foreach(C::t('forum_tradecomment')->fetch_all_by_rateeid($uid, $type, $days ? TIMESTAMP - $days * 86400 : 0) as $credit) { + if($credit['score'] == 1) { + $good++; + } elseif($credit['score'] == 0) { + $soso++; + } else { + $bad++; + } + } + return array('good' => $good, 'soso' => $soso, 'bad' => $bad, 'total' => $good + $soso + $bad); +} + +function updateusercredit($uid, $type, $level) { + $uid = intval($uid); + if(!$uid || !in_array($type, array('buyercredit', 'sellercredit')) || !in_array($level, array('good', 'soso', 'bad'))) { + return; + } + + if($cache = C::t('forum_spacecache')->fetch_spacecache($uid, $type)) { + $expiration = $cache['expiration']; + $cache = dunserialize($cache['value']); + } else { + $init = array('good' => 0, 'soso' => 0, 'bad' => 0, 'total' => 0); + $cache = array('all' => $init, 'before' => $init, 'halfyear' => $init, 'thismonth' => $init, 'thisweek' => $init); + $expiration = getexpiration(); + } + + foreach(array('all', 'halfyear', 'thismonth', 'thisweek') as $key) { + $cache[$key][$level]++; + $cache[$key]['total']++; + } + + C::t('forum_spacecache')->insert(array( + 'uid' => $uid, + 'variable' => $type, + 'value' => serialize($cache), + 'expiration' => $expiration, + ), false, true); + + $score = $level == 'good' ? 1 : ($level == 'soso' ? 0 : -1); + C::t('common_member_status')->increase($uid, array($type=>$score)); +} + +?> \ No newline at end of file diff --git a/source/function/function_editor.php b/source/function/function_editor.php new file mode 100644 index 0000000..f02e5f3 --- /dev/null +++ b/source/function/function_editor.php @@ -0,0 +1,430 @@ + 'face=', 'size' => 'size=', 'color' => 'color='); + $prependtags = $appendtags = ''; + + foreach($tags as $bbcode => $locate) { + $optionvalue = fetchoptionvalue($locate, $fontoptions); + if($optionvalue) { + $prependtags .= "[$bbcode=$optionvalue]"; + $appendtags = "[/$bbcode]$appendtags"; + } + } + + parsestyle($fontoptions, $prependtags, $appendtags); + + return $prependtags.recursion('font', $text, 'fonttag').$appendtags; +} + +function getoptionvalue($option, $text) { + preg_match("/$option(\s+?)?\=(\s+?)?[\"']?(.+?)([\"']|$|>)/is", $text, $matches); + return isset($matches[3]) ? trim($matches[3]) : ''; +} + +function html2bbcode($text) { + $text = strip_tags($text, ''; + $i++; + + if($i % 4 == 0 && isset($attachs[$i])) { + $html .= ''; + } + } + if(!empty($html)) { + if(($imgpad = $i % 4) > 0) { + $html .= str_repeat('', 4 - $imgpad); + } + + $html = '

          '; + if($attach['isimage']) { + $pic = pic_get($attach['attachment'], $type, $attach['thumb'], $attach['remote'], 0); + $small_pic = $attach['thumb'] ? getimgthumbname($pic) : ''; + $check = $attach['pic'] == $type.'/'.$attach['attachment'] ? 'checked' : $dotype; + $aid = $check ? $attach['aid'] : ''; + + $html .= ''; + $html .= ''; + $html .= ''.lang('portalcp', 'insert_large_image').'|'; + if($small_pic) $html .= ''.lang('portalcp', 'small_image').''; + $html .= ''; + $html .= ''; + if($type == 'portal') { + $html .= '|'.lang('portalcp', 'delete').''; + } + } else { + $html .= '
          '; + $html .= ''.lang('portalcp', 'delete').''; + } + $html .= '
          '.$html.'
          '; + } + return $html; +} + +function getallowcategory($uid){ + global $_G; + $permission = array(); + if (empty($uid)) return $permission; + if(getstatus($_G['member']['allowadmincp'], 2) || getstatus($_G['member']['allowadmincp'], 3)) { + $uid = max(0,intval($uid)); + foreach(C::t('portal_category_permission')->fetch_all_by_uid($uid) as $catid=>$value) { + if ($value['allowpublish'] || $value['allowmanage']) { + $permission[$catid] = $value; + } + } + } + return $permission; +} + +function getpermissioncategory($category, $permission = array()) { + + $cats = array(); + foreach ($permission as $k=>$v) { + $cur = $category[$v]; + + if ($cur['level'] != 0) { + while ($cur['level']) { + $cats[$cur['upid']]['permissionchildren'][$cur['catid']] = $cur['catid']; + $cur = $category[$cur['upid']]; + } + } elseif(empty($cats[$v])) { + $cats[$v] = array(); + } + } + + return $cats; +} + +function getallowdiytemplate($uid){ + if (empty($uid)) return false; + $permission = array(); + $uid = max(0,intval($uid)); + $permission = C::t('common_template_permission')->fetch_all_by_uid($uid); + return $permission; +} + +function getdiytpldir($targettplname) { + global $_G; + $tpldir = $pre = ''; + if (substr($targettplname, 0, 13) === ($pre = 'forum/discuz_')) { + } elseif (substr($targettplname, 0, 19) === ($pre = 'forum/forumdisplay_')) { + } + if($pre) { + $forum = C::t('forum_forum')->fetch(intval(str_replace($pre, '', $targettplname))); + if(!empty($forum['styleid'])) { + $_cname = 'style_'.$forum['styleid']; + loadcache($_cname); + $tpldir = empty($_G['cache'][$_cname]['tpldir']) ? '' : $_G['cache'][$_cname]['tpldir']; + } + } + return $tpldir ? $tpldir : ($_G['cache']['style_default']['tpldir'] ? $_G['cache']['style_default']['tpldir'] : './template/default'); +} + +function save_diy_data($tpldirectory, $primaltplname, $targettplname, $data, $database = false, $optype = '') { + global $_G; + if (empty($data) || !is_array($data)) return false; + checksecurity($data['spacecss']); + if(empty($tpldirectory)) { + $tpldirectory = getdiytpldir($targettplname); + } + $isextphp = false; + $file = $tpldirectory.'/'.$primaltplname.'.htm'; + if (!file_exists($file)) { + $file = $tpldirectory.'/'.$primaltplname.'.php'; + if (!file_exists($file)) { + $file = './template/default/'.$primaltplname.'.htm'; + } else { + $isextphp = true; + } + } + if(!file_exists($file)) return false; + $content = file_get_contents(DISCUZ_ROOT.$file); + if($isextphp) { + $content = substr($content, strpos($content, "\n")); + } + $content = preg_replace("/\<\!\-\-\[name\].+?\[\/name\]\-\-\>\s+/is", '', $content); + $content = preg_replace("/\'; + $html .= '
          '; + } elseif ($flag == 'block') { + $battr = $content['attr']; + $bid = intval(str_replace('portal_block_', '', $battr['name'])); + if (!empty($bid)) { + $html .= ""; + $_G['curtplbid'][$bid] = $bid; + } + } + } + + return $html; +} +function gettitlestyle($title) { + $style = ''; + if (is_array($title['style']) && count($title['style'])) { + foreach ($title['style'] as $k=>$v){ + $style .= trimdxtpllang($k).':'.trimdxtpllang($v).';'; + } + } + $style = $style ? ' style=\''.$style.'\'' : ''; + return $style; +} +function checkhastitle($title) { + if (!is_array($title)) return false; + foreach ($title as $k => $v) { + if (strval($k) == 'className') continue; + if (!empty($v['text'])) return true; + } + return false; +} + +function gettitlehtml($title, $type) { + global $_G; + if (!is_array($title)) return ''; + $html = $one = $style = $color = ''; + foreach ($title as $k => $v) { + if (in_array(strval($k),array('className','style'))) continue; + if (empty($v['src']) && empty($v['text'])) continue; + $v['className'] = trimdxtpllang($v['className']); + $v['font-size'] = intval($v['font-size']); + $v['margin'] = intval($v['margin']); + $v['float'] = trimdxtpllang($v['float']); + $v['color'] = trimdxtpllang($v['color']); + $v['src'] = trimdxtpllang($v['src']); + $v['href'] = trimdxtpllang($v['href']); + $v['text'] = dhtmlspecialchars(str_replace(array('{', '$'), array('{ ', '$ '), $v['text'])); + $one = "' : ''; + if (empty($v['href'])) { + $style = empty($style)&&empty($color) ? '' : ' style="'.$style.$color.'"'; + $one .= $style.">$img{$v['text']}"; + } else { + $style = empty($style) ? '' : ' style="'.$style.'"'; + $colorstyle = empty($color) ? '' : ' style="'.$color.'"'; + $one .= $style.'>'.$img.$v['text'].''; + } + $one .= ''; + + $siteurl = str_replace(array('/','.'),array('\/','\.'),$_G['siteurl']); + $one = preg_replace('/\"'.$siteurl.'(.*?)\"/','"$1"',$one); + + $html = $k === 'first' ? $one.$html : $html.$one; + } + return $html; +} + +function gettheme($type) { + $themes = array(); + $themedirs = dreaddir(DISCUZ_ROOT."/static/$type"); + foreach ($themedirs as $key => $dirname) { + $now_dir = DISCUZ_ROOT."/static/$type/$dirname"; + if(file_exists($now_dir.'/style.css') && file_exists($now_dir.'/preview.jpg')) { + $themes[] = array( + 'dir' => $type.'/'.$dirname, + 'name' => getcssname($type.'/'.$dirname) + ); + } + } + return $themes; +} + +function getcssname($dirname) { + $css = @file_get_contents(DISCUZ_ROOT.'./static/'.$dirname.'/style.css'); + if($css) { + preg_match("/\[name\](.+?)\[\/name\]/i", trim($css), $mathes); + if(!empty($mathes[1])) $name = dhtmlspecialchars($mathes[1]); + } else { + $name = 'No name'; + } + return $name; +} + +function checksecurity($str) { + + $filter = array( + '/\/\*[\n\r]*(.+?)[\n\r]*\*\//is', + '/[^a-z0-9\\\]+/i', + '/important/i', + ); + if(preg_match("/[^a-z0-9:;'\(\)!\.#\-_\s\{\}\/\,\"\?\>\=\?\%]+/i", $str)) { + showmessage('css_contains_elements_of_insecurity'); + } + $str = preg_replace($filter, '', $str); + if(preg_match("/(expression|import|javascript)/i", $str)) { + showmessage('css_contains_elements_of_insecurity'); + } + return true; +} + +function block_export($bids) { + $return = array('block'=>array(), 'style'=>array()); + if(empty($bids)) { + return; + } + $styleids = array(); + foreach(C::t('common_block')->fetch_all($bids) as $value) { + $value['param'] = dunserialize($value['param']); + if(!empty($value['blockstyle'])) $value['blockstyle'] = dunserialize($value['blockstyle']); + + $return['block'][$value['bid']] = $value; + if(!empty($value['styleid'])) $styleids[] = intval($value['styleid']); + } + if($styleids) { + $styleids = array_unique($styleids); + foreach(C::t('common_block_style')->fetch_all($styleids) as $value) { + $value['template'] = dunserialize($value['template']); + if(!empty($value['fields'])) $value['fields'] = dunserialize($value['fields']); + $return['style'][$value['styleid']] = $value; + } + } + return $return ; +} + +function block_import($data) { + global $_G; + if(!is_array($data['block'])) { + return ; + } + $stylemapping = array(); + if($data['style']) { + $hashes = $styles = array(); + foreach($data['style'] as $value) { + $hashes[] = $value['hash']; + $styles[$value['hash']] = $value['styleid']; + } + if(!empty($hashes)) { + foreach(C::t('common_block_style')->fetch_all_by_hash($hashes) as $value) { + $id = $styles[$value['hash']]; + $stylemapping[$id] = intval($value['styleid']); + unset($styles[$value['hash']]); + } + } + foreach($styles as $id) { + $style = $data['style'][$id]; + $style['styleid'] = ''; + if(is_array($style['template'])) { + $style['template'] = serialize($style['template']); + } + if(is_array($style['fields'])) { + $style['fields'] = serialize($style['fields']); + } + $newid = C::t('common_block_style')->insert($style, true); + $stylemapping[$id] = $newid; + } + } + + $blockmapping = array(); + foreach($data['block'] as $block) { + $oid = $block['bid']; + if(!empty($block['styleid'])) { + $block['styleid'] = intval($stylemapping[$block['styleid']]); + } + $block['bid'] = ''; + $block['uid'] = $_G['uid']; + $block['username'] = $_G['username']; + $block['dateline'] = 0; + $block['notinherited'] = 0; + if(is_array($block['param'])) { + $block['param'] = serialize($block['param']); + } + if(is_array($block['blockstyle'])) { + $block['blockstyle'] = serialize($block['blockstyle']); + } + $newid = C::t('common_block')->insert($block, true); + $blockmapping[$oid] = $newid; + } + require_once libfile('function/block'); + blockclass_cache(); + return $blockmapping; +} + +function getobjbyname($name, $data) { + if (!$name || !$data) return false; + + foreach ((array)$data as $id => $content) { + list($type, $curname) = explode('`', $id); + if ($curname == $name) { + return array('type'=>$type,'content'=>$content); + } elseif ($type == 'frame' || $type == 'tab' || $type == 'column') { + $r = getobjbyname($name, $content); + if ($r) return $r; + } + } + return false; +} + +function getframeblock($data) { + global $_G; + + if (!isset($_G['curtplbid'])) $_G['curtplbid'] = array(); + if (!isset($_G['curtplframe'])) $_G['curtplframe'] = array(); + + foreach ((array)$data as $id => $content) { + list($flag, $name) = explode('`', $id); + if ($flag == 'frame' || $flag == 'tab') { + foreach ((array)$content as $colid => $coldata) { + list($colflag, $colname) = explode('`', $colid); + if ($colflag == 'column') { + getframeblock($coldata,$framename); + } + } + $_G['curtplframe'][$name] = array('type'=>$flag,'name'=>$name); + } elseif ($flag == 'block') { + $battr = $content['attr']; + $bid = intval(str_replace('portal_block_', '', $battr['name'])); + if (!empty($bid)) { + $_G['curtplbid'][$bid] = $bid; + } + } + } +} + +function getcssdata($css) { + global $_G; + if (empty($css)) return ''; + $reglist = array(); + foreach ((array)$_G['curtplframe'] as $value) { + $reglist[] = '#'.$value['name'].'.*?\{.*?\}'; + } + foreach ((array)$_G['curtplbid'] as $value) { + $reglist[] = '#portal_block_'.$value.'.*?\{.*?\}'; + } + $reg = implode('|',$reglist); + preg_match_all('/'.$reg.'/',$css,$csslist); + return implode('', $csslist[0]); +} + +function import_diy($file) { + global $_G; + + $css = ''; + $html = array(); + $arr = array(); + + $content = file_get_contents($file); + require_once libfile('class/xml'); + if (empty($content)) return $arr; + if(fileext($file) == 'php') { + $content = preg_replace("/^\<\?php(.+?)\?\>\s+/i", '', $content); + } + $content = preg_replace("/\<\!\-\-\[name\](.+?)\[\/name\]\-\-\>\s+/i", '', $content); + $diycontent = xml2array($content); + $diycontent = is_array($diycontent) ? $diycontent : array(); + + if ($diycontent) { + + foreach ($diycontent['layoutdata'] as $key => $value) { + if (!empty($value)) getframeblock($value); + } + $newframe = array(); + foreach ($_G['curtplframe'] as $value) { + $newframe[] = $value['type'].random(6); + } + + $mapping = array(); + if (!empty($diycontent['blockdata'])) { + $mapping = block_import($diycontent['blockdata']); + unset($diycontent['blockdata']); + } + + $oldbids = $newbids = array(); + if (!empty($mapping)) { + foreach($mapping as $obid=>$nbid) { + $oldbids[] = '#portal_block_'.$obid.' '; + $newbids[] = '#portal_block_'.$nbid.' '; + $oldbids[] = '[portal_block_'.$obid.']'; + $newbids[] = '[portal_block_'.$nbid.']'; + $oldbids[] = '~portal_block_'.$obid.'"'; + $newbids[] = '~portal_block_'.$nbid.'"'; + } + } + + require_once libfile('class/xml'); + $xml = array2xml($diycontent['layoutdata'],true); + $xml = str_replace($oldbids, $newbids, $xml); + $xml = str_replace((array)array_keys($_G['curtplframe']), $newframe, $xml); + $diycontent['layoutdata'] = xml2array($xml); + + $css = str_replace($oldbids, $newbids, $diycontent['spacecss']); + $css = str_replace((array)array_keys($_G['curtplframe']), $newframe, $css); + foreach ($diycontent['layoutdata'] as $key => $value) { + $html[$key] = getframehtml($value); + } + } + if (!empty($html)) { + $xml = array2xml($html, true); + require_once libfile('function/block'); + $mapping = is_array($mapping) ? $mapping : array($mapping); + block_get_batch(implode(',', $mapping)); + foreach ($mapping as $bid) { + $blocktag[] = ''; + $blockcontent[] = block_fetch_content($bid); + } + $xml = str_replace($blocktag,$blockcontent,$xml); + $html = xml2array($xml); + $arr = array('html'=>$html,'css'=>$css,'mapping'=>$mapping); + } + return $arr; +} + +function checkprimaltpl($template) { + global $_G; + $tpldirectory = ''; + if(strpos($template, ':') !== false) { + list($tpldirectory, $template) = explode(':', $template); + } + if(!$template || preg_match("/(\.)(exe|jsp|asp|aspx|cgi|fcgi|pl)(\.|$)/i", $template)) { + return 'diy_template_filename_invalid'; + } + if(strpos($template, '..') !== false || strpos($template, "\0") !== false) { + return 'diy_template_filename_invalid'; + } + $tpldirectoryarr = explode('/', trim($tpldirectory, './')); + if(strpos($tpldirectory, '..') !== false || strpos($tpldirectory, "\0") !== false || ($tpldirectoryarr[0] != 'template' && $tpldirectoryarr[0] != 'source')) { + return 'diy_tpldirectory_invalid'; + } + $primaltplname = (!$tpldirectory ? DISCUZ_ROOT.$_G['cache']['style_default']['tpldir'] : $tpldirectory).'/'.$template.'.htm'; + if (!file_exists($primaltplname)) { + $primaltplname = DISCUZ_ROOT.'./template/default/'.$template.'.htm'; + } + $pathinfos = pathinfo($primaltplname); + if(strtolower($pathinfos['extension']) != 'htm') { + return 'diy_template_extension_invalid'; + } + if (!is_file($primaltplname)) { + return 'diy_template_noexist'; + } + return true; +} + +function article_tagnames() { + global $_G; + if(!isset($_G['article_tagnames'])) { + $_G['article_tagnames'] = array(); + for($i=1; $i<=8; $i++) { + if(isset($_G['setting']['article_tags']) && isset($_G['setting']['article_tags'][$i])) { + $_G['article_tagnames'][$i] = $_G['setting']['article_tags'][$i]; + } else { + $_G['article_tagnames'][$i] = lang('portalcp', 'article_tag').$i; + } + } + } + return $_G['article_tagnames']; +} + +function article_parse_tags($tag) { + $tag = intval($tag); + $article_tags = array(); + for($i=1; $i<=8; $i++) { + $k = pow(2, $i-1); + $article_tags[$i] = ($tag & $k) ? 1 : 0; + } + return $article_tags; +} + +function article_make_tag($tags) { + $tags = (array)$tags; + $tag = 0; + for($i=1; $i<=8; $i++) { + if(!empty($tags[$i])) { + $tag += pow(2, $i-1); + } + } + return $tag; +} + +function category_showselect($type, $name='catid', $shownull=true, $current='') { + global $_G; + if(! in_array($type, array('portal', 'blog', 'album'))) { + return ''; + } + loadcache($type.'category'); + $category = $_G['cache'][$type.'category']; + + $select = defined('IN_MOBILE') ? ""; + if($shownull) { + $select .= ''; + } + foreach ($category as $value) { + if($value['level'] == 0) { + $selected = ($current && $current==$value['catid']) ? 'selected="selected"' : ''; + $select .= ""; + if(!$value['children']) { + continue; + } + foreach ($value['children'] as $catid) { + $selected = ($current && $current==$catid) ? 'selected="selected"' : ''; + $select .= ""; + if($category[$catid]['children']) { + foreach ($category[$catid]['children'] as $catid2) { + $selected = ($current && $current==$catid2) ? 'selected="selected"' : ''; + $select .= ""; + } + } + } + } + } + $select .= ""; + return $select; +} + +function category_get_childids($type, $catid, $depth=3) { + global $_G; + if(! in_array($type, array('portal', 'blog', 'album'))) { + return array(); + } + loadcache($type.'category'); + $category = $_G['cache'][$type.'category']; + $catids = array(); + if(isset($category[$catid]) && !empty($category[$catid]['children']) && $depth) { + $catids = $category[$catid]['children']; + foreach($category[$catid]['children'] as $id) { + $catids = array_merge($catids, category_get_childids($type, $id, $depth-1)); + } + } + return $catids; +} + +function category_get_num($type, $catid) { + global $_G; + if(! in_array($type, array('portal', 'blog', 'album'))) { + return array(); + } + loadcache($type.'category'); + $category = $_G['cache'][$type.'category']; + + $numkey = $type == 'portal' ? 'articles' : 'num'; + if(! isset($_G[$type.'category_nums'])) { + $_G[$type.'category_nums'] = array(); + $tables = array('portal'=>'portal_category', 'blog'=>'home_blog_category', 'album'=>'home_album_category'); + $query = C::t($tables[$type])->fetch_all_numkey($numkey); + foreach ($query as $value) { + $_G[$type.'category_nums'][$value['catid']] = intval($value[$numkey]); + } + } + + $nums = $_G[$type.'category_nums']; + $num = intval($nums[$catid]); + if($category[$catid]['children']) { + foreach($category[$catid]['children'] as $id) { + $num += category_get_num($type, $id); + } + } + return $num; +} + + +function updatetopic($topic = ''){ + global $_G; + + $topicid = empty($topic) ? '' : $topic['topicid']; + include_once libfile('function/home'); + $_POST['title'] = getstr(trim($_POST['title']), 255); + $_POST['name'] = getstr(trim($_POST['name']), 255); + $_POST['domain'] = getstr(trim($_POST['domain']), 255); + if(empty($_POST['title'])) { + return 'topic_title_cannot_be_empty'; + } + if(empty($_POST['name'])) { + $_POST['name'] = $_POST['title']; + } + if(!preg_match('/^[\w\_\.]+$/i', $_POST['name'])) { + return 'topic_created_failed'; + } + if(!$topicid || $_POST['name'] != $topic['name']) { + if(($value = C::t('portal_topic')->fetch_by_name($_POST['name']))) { + return 'topic_name_duplicated'; + } + } + if($topicid && !empty($topic['domain'])) { + require_once libfile('function/delete'); + deletedomain($topicid, 'topic'); + } + if(!empty($_POST['domain'])) { + require_once libfile('function/domain'); + domaincheck($_POST['domain'], $_G['setting']['domain']['root']['topic'], 1); + } + + $setarr = array( + 'title' => $_POST['title'], + 'name' => $_POST['name'], + 'domain' => $_POST['domain'], + 'summary' => getstr($_POST['summary']), + 'keyword' => getstr($_POST['keyword']), + 'useheader' => !empty($_POST['useheader']) ? '1' : '0', + 'usefooter' => !empty($_POST['usefooter']) ? '1' : '0', + 'allowcomment' => !empty($_POST['allowcomment']) ? 1 : 0, + 'closed' => !empty($_POST['closed']) ? 0 : 1, + ); + + if($_POST['deletecover'] && $topic['cover']) { + if($topic['picflag'] != '0') pic_delete(str_replace('portal/', '', $topic['cover']), 'portal', 0, $topic['picflag'] == '2' ? '1' : '0'); + $setarr['cover'] = ''; + } else { + if($_FILES['cover']['tmp_name']) { + if($topic['cover'] && $topic['picflag'] != '0') pic_delete(str_replace('portal/', '', $topic['cover']), 'portal', 0, $topic['picflag'] == '2' ? '1' : '0'); + $pic = pic_upload($_FILES['cover'], 'portal'); + if($pic) { + $setarr['cover'] = 'portal/'.$pic['pic']; + $setarr['picflag'] = $pic['remote'] ? '2' : '1'; + } + } else { + if(!empty($_POST['cover']) && $_POST['cover'] != $topic['cover']) { + if($topic['cover'] && $topic['picflag'] != '0') pic_delete(str_replace('portal/', '', $topic['cover']), 'portal', 0, $topic['picflag'] == '2' ? '1' : '0'); + $setarr['cover'] = $_POST['cover']; + $setarr['picflag'] = '0'; + } + } + } + + + $primaltplname = ''; + if(empty($topicid) || empty($topic['primaltplname']) || ($topic['primaltplname'] && $topic['primaltplname'] != $_POST['primaltplname'])) { + $primaltplname = $_POST['primaltplname']; + if(!isset($_POST['signs'][dsign($primaltplname)])) { + return 'diy_sign_invalid'; + } + $checktpl = checkprimaltpl($primaltplname); + if($checktpl !== true) { + return $checktpl; + } + $setarr['primaltplname'] = $primaltplname; + } + + if($topicid) { + C::t('portal_topic')->update($topicid, $setarr); + C::t('common_diy_data')->update_diy('portal/portal_topic_content_'.$topicid, getdiydirectory($topic['primaltplname']), array('name'=>$setarr['title'])); + } else { + $setarr['uid'] = $_G['uid']; + $setarr['username'] = $_G['username']; + $setarr['dateline'] = $_G['timestamp']; + $setarr['closed'] = '1'; + $topicid = addtopic($setarr); + if(!$topicid) { + return 'topic_created_failed'; + } + + } + + if(!empty($_POST['domain'])) { + C::t('common_domain')->insert(array('domain' => $_POST['domain'], 'domainroot' => $_G['setting']['domain']['root']['topic'], 'id' => $topicid, 'idtype' => 'topic')); + } + + $tpldirectory = ''; + if($primaltplname && (empty($topic['primaltplname']) || $topic['primaltplname'] != $primaltplname)) { + $targettplname = 'portal/portal_topic_content_'.$topicid; + if(strpos($primaltplname, ':') !== false) { + list($tpldirectory, $primaltplname) = explode(':', $primaltplname); + } + C::t('common_diy_data')->update_diy($targettplname, getdiydirectory(isset($topic['primaltplname']) ? $topic['primaltplname'] : ''), array('primaltplname'=>$primaltplname, 'tpldirectory'=>$tpldirectory)); + updatediytemplate($targettplname); + } + + if($primaltplname && empty($topic['primaltplname'])) { + $tpldirectory = ($tpldirectory ? $tpldirectory : $_G['cache']['style_default']['tpldir']); + $content = file_get_contents(DISCUZ_ROOT.$tpldirectory.'/'.$primaltplname.'.htm'); + $tplfile = DISCUZ_ROOT.'./data/diy/'.$tpldirectory.'/portal/portal_topic_content_'.$topicid.'.htm'; + $tplpath = dirname($tplfile); + if (!is_dir($tplpath)) { + dmkdir($tplpath); + } + file_put_contents($tplfile, $content); + } + + include_once libfile('function/cache'); + updatecache(array('diytemplatename', 'setting')); + + return $topicid; +} + +function addtopic($topic) { + global $_G; + $topicid = ''; + if($topic && is_array($topic)) { + $topicid = C::t('portal_topic')->insert($topic, true); + if(!empty($topicid)) { + $diydata = array( + 'targettplname' => 'portal/portal_topic_content_'.$topicid, + 'name' => $topic['title'], + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => TIMESTAMP, + ); + C::t('common_diy_data')->insert($diydata); + } + } + return $topicid; +} + +function getblockperm($bid) { + global $_G; + $perm = array('allowmanage'=>'0','allowrecommend'=>'0','needverify'=>'1'); + $bid = max(0, intval($bid)); + if(!$bid) return $perm; + $allperm = array('allowmanage'=>'1','allowrecommend'=>'1','needverify'=>'0'); + if(checkperm('allowdiy')) { + return $allperm; + } elseif (!getstatus($_G['member']['allowadmincp'], 4) && !getstatus($_G['member']['allowadmincp'], 5) && !getstatus($_G['member']['allowadmincp'], 6) && !checkperm('allowmanagetopic') && !checkperm('allowaddtopic')) { + return $perm; + } + require_once libfile('class/blockpermission'); + $blockpermsission = & block_permission::instance(); + $perm = $blockpermsission->get_perms_by_bid($bid, $_G['uid']); + $perm = $perm ? current($perm) : ''; + if(empty($perm)) { + if(($block = C::t('common_block')->fetch($bid))) { + $block = array_merge($block, C::t('common_template_block')->fetch_by_bid($bid)); + } + if(empty($block['targettplname']) && empty($block['blocktype'])) { + if(($_G['group']['allowmanagetopic'] || ($_G['group']['allowaddtopic'] && $block['uid'] == $_G['uid']))) { + $perm = $allperm; + } + } elseif(substr($block['targettplname'], 0, 28) == 'portal/portal_topic_content_') { + if(!empty($_G['group']['allowmanagetopic'])) { + $perm = $allperm; + } elseif($_G['group']['allowaddtopic']) { + $id = str_replace('portal/portal_topic_content_', '', $block['targettplname']); + $topic = C::t('portal_topic')->fetch(intval($id)); + if($topic['uid'] == $_G['uid']) { + $perm = $allperm; + } + } + } + } + return $perm; +} + +function check_articleperm($catid, $aid = 0, $article = array(), $isverify = false, $return = false) { + global $_G; + + if(empty($catid)) { + if(!$return) { + showmessage('article_category_empty'); + } else { + return 'article_category_empty'; + } + } + + if($_G['group']['allowmanagearticle'] || (empty($aid) && $_G['group']['allowpostarticle'])) { + return true; + } + + $permission = getallowcategory($_G['uid']); + if(isset($permission[$catid])) { + if($permission[$catid]['allowmanage'] || (empty($aid) && $permission[$catid]['allowpublish'])) { + return true; + } + } + if(!$isverify && $aid && !empty($article['uid']) && $article['uid'] == $_G['uid'] && ($article['status'] == 1 && $_G['group']['allowpostarticlemod'] || empty($_G['group']['allowpostarticlemod']))) { + return true; + } + + if(!$return) { + showmessage('article_edit_nopermission'); + } else { + return 'article_edit_nopermission'; + } +} + +function addportalarticlecomment($id, $message, $idtype = 'aid') { + global $_G; + + $id = intval($id); + if(empty($id)) { + return 'comment_comment_noexist'; + } + $message = getstr($message, $_G['group']['allowcommentarticle'], 0, 0, 1, 0); + if(strlen($message) < 2) return 'content_is_too_short'; + + $idtype = in_array($idtype, array('aid' ,'topicid')) ? $idtype : 'aid'; + $tablename = $idtype == 'aid' ? 'portal_article_title' : 'portal_topic'; + $data = C::t($tablename)->fetch($id); + if(empty($data)) { + return 'comment_comment_noexist'; + } + if($data['allowcomment'] != 1) { + return 'comment_comment_notallowed'; + } + + $message = censor($message, NULL, FALSE, FALSE); + if(censormod($message) || $_G['group']['allowcommentarticlemod']) { + $comment_status = 1; + } else { + $comment_status = 0; + } + + $setarr = array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'id' => $id, + 'idtype' => $idtype, + 'postip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'dateline' => $_G['timestamp'], + 'status' => $comment_status, + 'message' => $message + ); + + $pcid = C::t('portal_comment')->insert($setarr, true); + + if($comment_status == 1) { + updatemoderate($idtype.'_cid', $pcid); + $notifykey = $idtype == 'aid' ? 'verifyacommont' : 'verifytopiccommont'; + manage_addnotify($notifykey); + } + $tablename = $idtype == 'aid' ? 'portal_article_count' : 'portal_topic'; + C::t($tablename)->increase($id, array('commentnum' => 1)); + C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED'); + + if($data['uid'] != $_G['uid']) { + updatecreditbyaction('portalcomment', 0, array(), $idtype.$id); + } + return 'do_success'; +} + +function trimdxtpllang($s){ + return str_replace(array('{', '$', '<', '>'), array('{ ', '$ ', '', ''), $s); +} + +function addrelatedarticle($aid, $raids) { + C::t('portal_article_related')->delete_by_aid_raid($aid, $aid); + if($raids) { + $relatedarr = array(); + $relatedarr = array_map('intval', $raids); + $relatedarr = array_unique($relatedarr); + $relatedarr = array_filter($relatedarr); + if($relatedarr) { + $list = C::t('portal_article_title')->fetch_all($relatedarr); + C::t('portal_article_related')->insert_batch($aid, $list); + } + } + return true; +} + + +function getprimaltplname($filename) { + global $_G, $lang; + $tpldirectory = ''; + if(strpos($filename, ':') !== false) { + list($tpldirectory, $filename) = explode(':', $filename); + } + if(empty($tpldirectory)) { + $tpldirectory = ($_G['cache']['style_default']['tpldir'] ? $_G['cache']['style_default']['tpldir'] : './template/default'); + } + if(file_exists(DISCUZ_ROOT.$tpldirectory.'/'.$filename)) { + $file = DISCUZ_ROOT.$tpldirectory.'/'.$filename; + } elseif(file_exists(DISCUZ_ROOT.$tpldirectory.'/'.substr(DISCUZ_ROOT.$filename, 0, -4).'.php')) { + $file = DISCUZ_ROOT.$tpldirectory.'/'.substr($filename, 0, -4).'.php'; + } else { + $file = DISCUZ_ROOT.'./template/default/'.$filename; + } + $name = $tpldirectory.'/'.$filename; + if(file_exists($file)) { + $content = @file_get_contents($file); + if($content) { + preg_match("/\<\!\-\-\[name\](.+?)\[\/name\]\-\-\>/i", trim($content), $mathes); + if(!empty($mathes[1])) { + preg_match("/^\{lang (.+?)\}$/", $mathes[1], $langs); + if(!empty($langs[1])) { + $name = !$lang[$langs[1]] ? $langs[1] : $lang[$langs[1]]; + } else { + $name = dhtmlspecialchars($mathes[1]); + } + } + } + } + return $name; +} + +function getdiydirectory($value) { + $directory = ''; + if($value && strpos($value, ':') !== false) { + list($directory) = explode(':', $value); + } + return $directory; +} +?> \ No newline at end of file diff --git a/source/function/function_post.php b/source/function/function_post.php new file mode 100644 index 0000000..1fae96d --- /dev/null +++ b/source/function/function_post.php @@ -0,0 +1,724 @@ + 0 ? "AND af.dateline>'$posttime'" : ''; + if(!empty($_G['fid']) && $_G['forum']['attachextensions']) { + $allowext = str_replace(' ', '', strtolower($_G['forum']['attachextensions'])); + $allowext = explode(',', $allowext); + } else { + $allowext = ''; + } + foreach(C::t('forum_attachment')->fetch_all_unused_attachment($_G['uid'], empty($aidsnew) ? null : $aidsnew, $posttime > 0 ? $posttime : null) as $attach) { + $attach['filenametitle'] = $attach['filename']; + $attach['ext'] = fileext($attach['filename']); + if($allowext && !in_array($attach['ext'], $allowext)) { + continue; + } + getattach_row($attach, $attachs, $imgattachs); + } + if($pid > 0) { + $attachmentns = C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$_G['tid'], 'pid', $pid); + foreach(C::t('forum_attachment')->fetch_all_by_id('pid', $pid, 'aid') as $attach) { + if(!empty($attachmentns[$attach['aid']])) { + $attach = array_merge($attach, $attachmentns[$attach['aid']]); + } + $attach['filenametitle'] = $attach['filename']; + $attach['ext'] = fileext($attach['filename']); + if($allowext && !in_array($attach['ext'], $allowext)) { + continue; + } + getattach_row($attach, $attachs, $imgattachs); + } + } + return array('attachs' => $attachs, 'imgattachs' => $imgattachs); +} + +function getattach_row($attach, &$attachs, &$imgattachs) { + global $_G; + $attach['filename'] = cutstr($attach['filename'], $_G['setting']['allowattachurl'] ? 25 : 30); + $attach['attachsize'] = sizecount($attach['filesize']); + $attach['dateline'] = dgmdate($attach['dateline']); + $attach['filetype'] = attachtype($attach['ext']."\t".$attach['filetype']); + if($attach['isimage'] < 1) { + if($attach['isimage']) { + $attach['url'] = $attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']; + $attach['width'] = $attach['width'] > 300 ? 300 : $attach['width']; + } + if($attach['pid']) { + $attachs['used'][] = $attach; + } else { + $attachs['unused'][] = $attach; + } + } else { + $attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'/forum'; + $attach['width'] = $attach['width'] > 300 ? 300 : $attach['width']; + if($attach['pid']) { + $imgattachs['used'][] = $attach; + } else { + $imgattachs['unused'][] = $attach; + } + } +} + +function parseattachmedia($attach) { + $attachurl = 'attach://'.$attach['aid'].'.'.$attach['ext']; + switch(strtolower($attach['ext'])) { + case 'mp3': + case 'm4a': + case 'wma': + case 'ra': + case 'ram': + case 'wav': + case 'mid': + case 'ogg': + case 'aac': + case 'flac': + case 'weba': + return '[audio]'.$attachurl.'[/audio]'; + case 'wmv': + case 'rm': + case 'rmvb': + case 'avi': + case 'asf': + case 'asx': + case 'mpg': + case 'mpeg': + case 'mov': + case 'flv': + case 'swf': + case 'mp4': + case 'm4v': + case '3gp': + case 'ogv': + case 'webm': + return '[media='.$attach['ext'].',400,300]'.$attachurl.'[/media]'; + default: + return; + } +} + +function ftpupload($aids, $uid = 0) { + global $_G; + $uid = $uid ? $uid : $_G['uid']; + + if(!$aids || !$_G['setting']['ftp']['on']) { + return; + } + $attachtables = $pics = array(); + foreach(C::t('forum_attachment')->fetch_all($aids) as $attach) { + if($uid != $attach['uid'] && !$_G['forum']['ismoderator']) { + continue; + } + $attachtables[$attach['tableid']][] = $attach['aid']; + } + foreach($attachtables as $attachtable => $aids) { + $remoteaids = array(); + foreach(C::t('forum_attachment_n')->fetch_all_attachment($attachtable, $aids, 0) as $attach) { + if(ftpperm(fileext($attach['filename']), $attach['filesize'])) { + if(ftpcmd('upload', 'forum/'.$attach['attachment']) && (!$attach['thumb'] || ftpcmd('upload', 'forum/'.getimgthumbname($attach['attachment'])))) { + dunlink($attach); + $remoteaids[$attach['aid']] = $attach['aid']; + if($attach['picid']) { + $pics[] = $attach['picid']; + } + } + } + } + + if($remoteaids) { + C::t('forum_attachment_n')->update_attachment($attachtable, $remoteaids, array('remote' => 1)); + } + } + if($pics) { + C::t('home_pic')->update($pics, array('remote' => 3)); + } +} + +function updateattach($modnewthreads, $tid, $pid, $attachnew, $attachupdate = array(), $uid = 0) { + global $_G; + $thread = C::t('forum_thread')->fetch_thread($tid); + $uid = $uid ? $uid : $_G['uid']; + if($attachnew) { + $newaids = array_keys($attachnew); + $newattach = $newattachfile = $albumattach = array(); + foreach(C::t('forum_attachment_unused')->fetch_all($newaids) as $attach) { + if($attach['uid'] != $uid && !$_G['forum']['ismoderator']) { + continue; + } + $attach['uid'] = $uid; + $newattach[$attach['aid']] = daddslashes($attach); + if($attach['isimage']) { + $newattachfile[$attach['aid']] = $attach['attachment']; + } + } + if($_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark']) || !$_G['setting']['thumbdisabledmobile']) { + require_once libfile('class/image'); + $image = new image; + } + if(!empty($_GET['albumaid'])) { + array_unshift($_GET['albumaid'], ''); + $_GET['albumaid'] = array_unique($_GET['albumaid']); + unset($_GET['albumaid'][0]); + foreach($_GET['albumaid'] as $aid) { + if(isset($newattach[$aid])) { + $albumattach[$aid] = $newattach[$aid]; + } + } + if(!empty($_GET['uploadalbum'])) { + $_GET['uploadalbum'] = intval($_GET['uploadalbum']); + $albuminfo = C::t('home_album')->fetch_album($_GET['uploadalbum'], $uid); + if(empty($albuminfo)) { + $_GET['uploadalbum'] = 0; + } + } + } + foreach($attachnew as $aid => $attach) { + $update = array(); + $update['readperm'] = $_G['group']['allowsetattachperm'] ? $attach['readperm'] : 0; + $update['price'] = $_G['group']['maxprice'] ? (intval($attach['price']) <= $_G['group']['maxprice'] ? intval($attach['price']) : $_G['group']['maxprice']) : 0; + $update['tid'] = $tid; + $update['pid'] = $pid; + $update['uid'] = $uid; + $update['description'] = censor(cutstr(dhtmlspecialchars($attach['description']), 100)); + C::t('forum_attachment_n')->update_attachment('tid:'.$tid, $aid, $update); + if(!$newattach[$aid]) { + continue; + } + $update = array_merge($update, $newattach[$aid]); + if(!empty($newattachfile[$aid])) { + if($_G['setting']['thumbstatus'] && $_G['forum']['disablethumb']) { + $update['thumb'] = 0; + @unlink($_G['setting']['attachdir'].'/forum/'.getimgthumbname($newattachfile[$aid])); + if(!empty($albumattach[$aid])) { + $albumattach[$aid]['thumb'] = 0; + } + } elseif(!$_G['setting']['thumbdisabledmobile']) { + $_daid = sprintf("%09d", $aid); + $dir1 = substr($_daid, 0, 3); + $dir2 = substr($_daid, 3, 2); + $dir3 = substr($_daid, 5, 2); + $dw = 320; + $dh = 320; + $thumbfile = 'image/'.$dir1.'/'.$dir2.'/'.$dir3.'/'.substr($_daid, -2).'_'.$dw.'_'.$dh.'.jpg'; + $image->Thumb($_G['setting']['attachdir'].'/forum/'.$newattachfile[$aid], $thumbfile, $dw, $dh, 'fixwr'); + $dw = 720; + $dh = 720; + $thumbfile = 'image/'.$dir1.'/'.$dir2.'/'.$dir3.'/'.substr($_daid, -2).'_'.$dw.'_'.$dh.'.jpg'; + $image->Thumb($_G['setting']['attachdir'].'/forum/'.$newattachfile[$aid], $thumbfile, $dw, $dh, 'fixwr'); + } + if($_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark'])) { + $image->Watermark($_G['setting']['attachdir'].'/forum/'.$newattachfile[$aid], '', 'forum'); + $update['filesize'] = $image->imginfo['size']; + } + } + if(!empty($_GET['albumaid']) && isset($albumattach[$aid])) { + $newalbum = 0; + if(!$_GET['uploadalbum']) { + require_once libfile('function/spacecp'); + $_GET['uploadalbum'] = album_creat(array('albumname' => $_GET['newalbum'])); + $newalbum = 1; + } + $picdata = array( + 'albumid' => $_GET['uploadalbum'], + 'uid' => $uid, + 'username' => $_G['username'], + 'dateline' => $albumattach[$aid]['dateline'], + 'postip' => $_G['clientip'], + 'filename' => censor($albumattach[$aid]['filename']), + 'title' => censor(cutstr(dhtmlspecialchars($attach['description']), 100)), + 'type' => fileext($albumattach[$aid]['attachment']), + 'size' => $albumattach[$aid]['filesize'], + 'filepath' => $albumattach[$aid]['attachment'], + 'thumb' => $albumattach[$aid]['thumb'], + 'remote' => $albumattach[$aid]['remote'] + 2, + ); + + $update['picid'] = C::t('home_pic')->insert($picdata, 1); + + if($newalbum) { + require_once libfile('function/home'); + require_once libfile('function/spacecp'); + album_update_pic($_GET['uploadalbum']); + } + } + C::t('forum_attachment_n')->insert('tid:'.$tid, $update, false, true); + C::t('forum_attachment')->update($aid, array('tid' => $tid, 'pid' => $pid, 'tableid' => getattachtableid($tid))); + C::t('forum_attachment_unused')->delete($aid); + } + + if(!empty($_GET['albumaid'])) { + $albumdata = array( + 'picnum' => C::t('home_pic')->check_albumpic($_GET['uploadalbum']), + 'updatetime' => $_G['timestamp'], + ); + C::t('home_album')->update($_GET['uploadalbum'], $albumdata); + require_once libfile('function/home'); + require_once libfile('function/spacecp'); + album_update_pic($_GET['uploadalbum']); + } + if($newattach) { + ftpupload($newaids, $uid); + } + } + + if(!$modnewthreads && $newattach && $uid == $_G['uid']) { + updatecreditbyaction('postattach', $uid, array(), '', count($newattach), 1, $_G['fid']); + } + + if($attachupdate) { + $attachs = C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$tid, 'aid', array_keys($attachupdate)); + foreach($attachs as $attach) { + if(array_key_exists($attach['aid'], $attachupdate) && $attachupdate[$attach['aid']]) { + dunlink($attach); + } + } + $unusedattachs = C::t('forum_attachment_unused')->fetch_all($attachupdate); + $attachupdate = array_flip($attachupdate); + $unusedaids = array(); + foreach($unusedattachs as $attach) { + if($attach['uid'] != $uid && !$_G['forum']['ismoderator']) { + continue; + } + $unusedaids[] = $attach['aid']; + $update = $attach; + $update['dateline'] = TIMESTAMP; + $update['remote'] = 0; + unset($update['aid']); + if($attach['isimage'] && $_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark'])) { + $image->Watermark($_G['setting']['attachdir'].'/forum/'.$attach['attachment'], '', 'forum'); + $update['filesize'] = $image->imginfo['size']; + } + C::t('forum_attachment_n')->update('tid:'.$tid, $attachupdate[$attach['aid']], $update); + @unlink($_G['setting']['attachdir'].'image/'.$attach['aid'].'_100_100.jpg'); + C::t('forum_attachment_exif')->delete($attachupdate[$attach['aid']]); + C::t('forum_attachment_exif')->update($attach['aid'], array('aid' => $attachupdate[$attach['aid']])); + ftpupload(array($attachupdate[$attach['aid']]), $uid); + } + if($unusedaids) { + C::t('forum_attachment_unused')->delete($unusedaids); + } + } + + $attachcount = C::t('forum_attachment_n')->count_by_id('tid:'.$tid, $pid ? 'pid' : 'tid', $pid ? $pid : $tid); + $attachment = 0; + if($attachcount) { + if(C::t('forum_attachment_n')->count_image_by_id('tid:'.$tid, $pid ? 'pid' : 'tid', $pid ? $pid : $tid)) { + $attachment = 2; + } else { + $attachment = 1; + } + } else { + $attachment = 0; + } + C::t('forum_thread')->update($tid, array('attachment'=>$attachment)); + C::t('forum_post')->update_post('tid:'.$tid, $pid, array('attachment' => $attachment), true); + + if(!$attachment) { + C::t('forum_threadimage')->delete_by_tid($tid); + } + $_G['forum_attachexist'] = $attachment; +} + +function checkflood() { + global $_G; + if(!$_G['group']['disablepostctrl'] && $_G['uid']) { + if($_G['setting']['floodctrl'] && discuz_process::islocked("post_lock_".$_G['uid'], $_G['setting']['floodctrl'])) { + return true; + } + return false; + + + } + return FALSE; +} + +function checkmaxperhour($type) { + global $_G; + $morenumperhour = false; + if(!$_G['group']['disablepostctrl'] && $_G['uid']) { + if($_G['group']['max'.($type == 'pid' ? 'posts' : 'threads').'perhour']) { + $usernum = C::t('common_member_action_log')->count_per_hour($_G['uid'], $type); + $var = $type === 'tid' ? 'maxthreadsperhour' : 'maxpostsperhour'; + $isflood = $usernum && ($usernum >= $_G['group'][$var]); + if($isflood) { + $morenumperhour = true; + } + } + } + return $morenumperhour; +} + +function checkpost($subject, $message, $special = 0) { + global $_G; + if(dstrlen($subject) > 255) { + return 'post_subject_toolong'; + } + if(!$_G['group']['disablepostctrl'] && !$special) { + if($_G['setting']['maxpostsize'] && strlen($message) > $_G['setting']['maxpostsize']) { + return 'post_message_toolong'; + } elseif($_G['setting']['minpostsize']) { + $minpostsize = !defined('IN_MOBILE') || !constant('IN_MOBILE') || !$_G['setting']['minpostsize_mobile'] ? $_G['setting']['minpostsize'] : $_G['setting']['minpostsize_mobile']; + if(strlen(preg_replace("/\[quote\].+?\[\/quote\]/is", '', $message)) < $minpostsize || strlen(preg_replace("/\[postbg\].+?\[\/postbg\]/is", '', $message)) < $minpostsize) { + return 'post_message_tooshort'; + } + } + if($_G['setting']['maxsubjectsize'] && dstrlen($subject) > $_G['setting']['maxsubjectsize']) { + return 'post_subject_toolong'; + } elseif(dstrlen($subject) && $_G['setting']['minsubjectsize'] && dstrlen($subject) < $_G['setting']['minsubjectsize']) { + return 'post_subject_tooshort'; + } + } + return FALSE; +} + +function checkbbcodes($message, $bbcodeoff) { + return !$bbcodeoff && (!strpos($message, '[/') && !strpos($message, '[hr]')) ? -1 : $bbcodeoff; +} + +function checksmilies($message, $smileyoff) { + global $_G; + + if($smileyoff) { + return 1; + } else { + if(!empty($_G['cache']['smileycodes']) && is_array($_G['cache']['smileycodes'])) { + foreach($_G['cache']['smileycodes'] as $id => $code) { + if(strpos($message, $code) !== FALSE) { + return 0; + } + } + } + return -1; + } +} + +function updatepostcredits($operator, $uidarray, $action, $fid = 0) { + global $_G; + $val = $operator == '+' ? 1 : -1; + $extsql = array(); + if(empty($uidarray)) { + return false; + } + $uidarray = (array)$uidarray; + $uidarr = array(); + foreach($uidarray as $uid) { + $uidarr[$uid] = !isset($uidarr[$uid]) ? 1 : $uidarr[$uid]+1; + } + foreach($uidarr as $uid => $coef) { + $opnum = $val*$coef; + if($action == 'reply') { + $extsql = array('posts' => $opnum); + } elseif($action == 'post') { + $extsql = array('threads' => $opnum, 'posts' => $opnum); + } + if($uid == $_G['uid']) { + updatecreditbyaction($action, $uid, $extsql, '', $opnum, 1, $fid); + } elseif(empty($uid)) { + continue; + } else { + batchupdatecredit($action, $uid, $extsql, $opnum, $fid); + } + } + if($operator == '+' && ($action == 'reply' || $action == 'post')) { + C::t('common_member_status')->update(array_keys($uidarr), array('lastpost' => TIMESTAMP), 'UNBUFFERED'); + } +} + +function updateattachcredits($operator, $uidarray) { + global $_G; + foreach($uidarray as $uid => $attachs) { + updatecreditbyaction('postattach', $uid, array(), '', $operator == '-' ? -$attachs : $attachs, 1, $_G['fid']); + } +} + +function updateforumcount($fid) { + + $fidposts = C::t('forum_thread')->count_posts_by_fid($fid); + extract($fidposts); + + $thread = C::t('forum_thread')->fetch_by_fid_displayorder($fid, 0, '='); + + $thread['subject'] = addslashes($thread['subject']); + $thread['lastposter'] = $thread['author'] ? addslashes($thread['lastposter']) : lang('forum/misc', 'anonymous'); + $tid = $thread['closed'] > 1 ? $thread['closed'] : $thread['tid']; + $setarr = array('posts' => $posts, 'threads' => $threads, 'lastpost' => "$tid\t{$thread['subject']}\t{$thread['lastpost']}\t${thread['lastposter']}"); + C::t('forum_forum')->update($fid, $setarr); +} + +function updatethreadcount($tid, $updateattach = 0) { + $replycount = C::t('forum_post')->count_visiblepost_by_tid($tid) - 1; + $lastpost = C::t('forum_post')->fetch_visiblepost_by_tid('tid:'.$tid, $tid, 0, 1); + + $lastpost['author'] = $lastpost['anonymous'] ? lang('forum/misc', 'anonymous') : addslashes($lastpost['author']); + $lastpost['dateline'] = !empty($lastpost['dateline']) ? $lastpost['dateline'] : TIMESTAMP; + + $data = array('replies'=>$replycount, 'lastposter'=>$lastpost['author'], 'lastpost'=>$lastpost['dateline']); + if($updateattach) { + $attach = C::t('forum_post')->fetch_attachment_by_tid($tid); + $data['attachment'] = $attach ? 1 : 0; + } + C::t('forum_thread')->update($tid, $data); +} + +function updatemodlog($tids, $action, $expiration = 0, $iscron = 0, $reason = '', $stamp = 0) { + global $_G; + if(is_array($tids)){ + $tids = implode(',',$tids); + } + $uid = empty($iscron) ? $_G['uid'] : 0; + $username = empty($iscron) ? $_G['member']['username'] : 0; + $expiration = empty($expiration) ? 0 : intval($expiration); + + $data = $comma = ''; + $stampadd = $stampaddvalue = ''; + if($stamp) { + $stampadd = ', stamp'; + $stampaddvalue = ", '$stamp'"; + } + foreach(explode(',', str_replace(array('\'', ' '), array('', ''), $tids)) as $tid) { + if($tid) { + + $data = array( + 'tid' => $tid, + 'uid' => $uid, + 'username' => $username, + 'dateline' => $_G['timestamp'], + 'action' => $action, + 'expiration' => $expiration, + 'status' => 1, + 'reason' => $reason + ); + if($stamp) { + $data['stamp'] = $stamp; + } + C::t('forum_threadmod')->insert($data); + } + } + + +} + +function isopera() { + $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); + if(strpos($useragent, 'opera') !== false) { + preg_match('/opera(\/| )([0-9\.]+)/', $useragent, $regs); + return $regs[2]; + } + return FALSE; +} + +function deletethreadcaches($tids) { + global $_G; + if(!$_G['setting']['cachethreadon']) { + return FALSE; + } + require_once libfile('function/forumlist'); + if(!empty($tids)) { + foreach(explode(',', $tids) as $tid) { + $fileinfo = getcacheinfo($tid); + @unlink($fileinfo['filename']); + } + } + return TRUE; +} + + +function disuploadedfile($file) { + return function_exists('is_uploaded_file') && (is_uploaded_file($file) || is_uploaded_file(str_replace('\\\\', '\\', $file))); +} + +function postfeed($feed) { + global $_G; + if($feed) { + require_once libfile('function/feed'); + feed_add($feed['icon'], $feed['title_template'], $feed['title_data'], $feed['body_template'], $feed['body_data'], '', $feed['images'], $feed['image_links'], '', '', '', 0, $feed['id'], $feed['idtype']); + } +} + +function messagesafeclear($message) { + if(strpos($message, '[/password]') !== FALSE) { + $message = ''; + } + if(strpos($message, '[/postbg]') !== FALSE) { + $message = preg_replace("/\s?\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]\s?/is", '', $message); + } + if(strpos($message, '[/begin]') !== FALSE) { + $message = preg_replace("/\[begin(=\s*([^\[\<\r\n]*?)\s*,(\d*),(\d*),(\d*),(\d*))?\]\s*([^\[\<\r\n]+?)\s*\[\/begin\]/is", '', $message); + } + if(strpos($message, '[page]') !== FALSE) { + $message = preg_replace("/\s?\[page\]\s?/is", '', $message); + } + if(strpos($message, '[/index]') !== FALSE) { + $message = preg_replace("/\s?\[index\](.+?)\[\/index\]\s?/is", '', $message); + } + if(strpos($message, '[/begin]') !== FALSE) { + $message = preg_replace("/\[begin(=\s*([^\[\<\r\n]*?)\s*,(\d*),(\d*),(\d*),(\d*))?\]\s*([^\[\<\r\n]+?)\s*\[\/begin\]/is", '', $message); + } + if(strpos($message, '[/groupid]') !== FALSE) { + $message = preg_replace("/\[groupid=\d+\].*\[\/groupid\]/i", '', $message); + } + $language = lang('forum/misc'); + $message = preg_replace(array($language['post_edithtml_regexp'],$language['post_editnobbcode_regexp'],$language['post_edit_regexp']), '', $message); + return $message; +} + +function messagecutstr($message, $length = 0, $dot = ' ...') { + global $_G; + $str = messagesafeclear($message); + $sppos = strpos($str, chr(0).chr(0).chr(0)); + if($sppos !== false) { + $str = substr($str, 0, $sppos); + } + $language = lang('forum/misc'); + loadcache(array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes', 'domainwhitelist')); + $bbcodes = 'b|i|u|p|color|backcolor|size|font|align|list|indent|float'; + $bbcodesclear = 'email|code|free|table|tr|td|img|swf|flash|attach|media|audio|groupid|payto'.(!empty($_G['cache']['bbcodes_display'][$_G['groupid']]) ? '|'.implode('|', array_keys($_G['cache']['bbcodes_display'][$_G['groupid']])) : ''); + $str = strip_tags(preg_replace(array( + "/\[hide=?\d*\](.*?)\[\/hide\]/is", + "/\[quote](.*?)\[\/quote]/si", + $language['post_edit_regexp'], + "/\[url=?.*?\](.+?)\[\/url\]/si", + "/\[($bbcodesclear)(=.*?)?\].+?\[\/\\1\]/si", + "/\[($bbcodes)(=.*?)?\]/i", + "/\[\/($bbcodes)\]/i", + "/\\\\u/i" + ), array( + $language['post_hidden'], + '', + '', + '\\1', + '', + '', + '', + '%u' + ), $str)); + $str = preg_replace($_G['cache']['smilies']['searcharray'], '', $str); + if($_G['setting']['plugins']['func'][HOOKTYPE]['discuzcode']) { + $_G['discuzcodemessage'] = & $str; + $param = func_get_args(); + hookscript('discuzcode', 'global', 'funcs', array('param' => $param, 'caller' => 'messagecutstr'), 'discuzcode'); + } + if($length) { + $str = cutstr($str, $length, $dot); + } + return trim($str); +} + +function threadmessagecutstr($thread, $str, $length = 0, $dot = ' ...') { + global $_G; + if(!empty($thread)) { + if(!empty($thread['readperm']) && $thread['readperm'] > 0) { + $str = ''; + }elseif(!empty($thread['price']) && $thread['price'] > 0) { + preg_match_all("/\[free\](.+?)\[\/free\]/is", $str, $matches); + $str = ''; + if(!empty($matches[1])) { + foreach($matches[1] as $match) { + $str .= $match.' '; + } + } else { + $language = lang('forum/misc'); + $str = $language['post_sold']; + } + } + } + return messagecutstr($str, $length, $dot); +} + +function setthreadcover($pid, $tid = 0, $aid = 0, $countimg = 0, $imgurl = '') { + global $_G; + $cover = 0; + if(empty($_G['uid']) || !intval($_G['setting']['forumpicstyle']['thumbwidth'])) { + return false; + } + + if(($pid || $aid) && empty($countimg)) { + if(empty($imgurl)) { + if($aid) { + $attachtable = 'aid:'.$aid; + $attach = C::t('forum_attachment_n')->fetch_attachment('aid:'.$aid, $aid, array(1, -1)); + } else { + $attachtable = 'pid:'.$pid; + $attach = C::t('forum_attachment_n')->fetch_max_image('pid:'.$pid, 'pid', $pid); + } + if(!$attach) { + return false; + } + if(empty($_G['forum']['ismoderator']) && $_G['uid'] != $attach['uid']) { + return false; + } + $pid = empty($pid) ? $attach['pid'] : $pid; + $tid = empty($tid) ? $attach['tid'] : $tid; + $picsource = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$attach['attachment']; + } else { + return true; + } + + $basedir = !$_G['setting']['attachdir'] ? (DISCUZ_ROOT.'./data/attachment/') : $_G['setting']['attachdir']; + $coverdir = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'; + dmkdir($basedir.'./forum/'.$coverdir); + + require_once libfile('class/image'); + $image = new image(); + if($image->Thumb($picsource, 'forum/'.$coverdir.$tid.'.jpg', $_G['setting']['forumpicstyle']['thumbwidth'], $_G['setting']['forumpicstyle']['thumbheight'], 2)) { + $remote = ''; + if(ftpperm('jpg', filesize($_G['setting']['attachdir'].'forum/'.$coverdir.$tid.'.jpg'))) { + if(ftpcmd('upload', 'forum/'.$coverdir.$tid.'.jpg')) { + @unlink($_G['setting']['attachdir'].'forum/'.$coverdir.$tid.'.jpg'); + $remote = '-'; + } + } + $cover = C::t('forum_attachment_n')->count_image_by_id($attachtable, 'pid', $pid); + if($imgurl && empty($cover)) { + $cover = 1; + } + $cover = $remote.$cover; + } else { + return false; + } + } + if($countimg) { + if(empty($cover)) { + $thread = C::t('forum_thread')->fetch_thread($tid); + $oldcover = $thread['cover']; + + $cover = C::t('forum_attachment_n')->count_image_by_id('tid:'.$tid, 'pid', $pid); + if($cover) { + $cover = $oldcover < 0 ? '-'.$cover : $cover; + } + } + } + if($cover) { + C::t('forum_thread')->update($tid, array('cover' => $cover)); + return true; + } +} + +?> \ No newline at end of file diff --git a/source/function/function_preg.php b/source/function/function_preg.php new file mode 100644 index 0000000..1af944f --- /dev/null +++ b/source/function/function_preg.php @@ -0,0 +1,120 @@ + 0) { + if(($position_of_eval = strpos($pattern, 'e', $position_of_modifier)) !== false) { + $eval = true; + $pattern = substr($pattern, 0, $position_of_eval).substr($pattern, $position_of_eval + 1); + } + } + + if($eval) { + return preg_replace_callback($pattern, function($matches) use ($replacement) { + $result = ''; + $instance = false; + + for($i = 0, $j = strlen($replacement); $i < $j; $i ++) { + if(($replacement[$i] == '$') || ($replacement[$i] == '\\')) { + if((($i == 0) || ($replacement[$i - 1] != '\\')) && isset($replacement[$i + 1])) { + $get_backref_string = substr($replacement, $i + 1); + + if($get_backref_string[0] == '{') { + $get_backref_result = preg_match('/^\{([0-9]{1,2})}/', $get_backref_string, $get_backref_match); + } else { + $get_backref_result = preg_match('/^([0-9]{1,2})/', $get_backref_string, $get_backref_match); + } + + if($get_backref_result) { + $backref = $get_backref_match[1]; + + if(isset($matches[$backref])) { + $result .= addslashes($matches[$backref]); + } + + $i += strlen($get_backref_match[0]); + + continue; + } else { + if(preg_match('/^this([^a-z0-9_]+)/i', $get_backref_string)) { + $result .= '$_'; + $instance = true; + + continue; + } + } + } + } + + $result .= $replacement[$i]; + } + + if($instance) { + $_this = null; + @$stack = (array) debug_backtrace(); + + if(isset($stack[6]) && isset($stack[6]['object'])) { + if(is_object($stack[6]['object'])) { + $_this = $stack[6]['object']; + } + } + } + + return eval("return {$result};"); + }, $subject, $limit, $count); + } else { + return preg_replace($pattern, $replacement, $subject, $limit, $count); + } +} + +function dpreg_replace_in_subject($pattern, $replacement, $subject, $limit, &$count) { + if(is_array($pattern)) { + if(is_array($replacement)) { + reset($replacement); + } else { + $replacement_value = $replacement; + } + + foreach($pattern as $pattern_value) { + if(is_array($replacement)) { + if(key($replacement) === null) { + $replacement_value = ''; + } else { + $replacement_value = current($replacement); + next($replacement); + } + } + + if(($subject = dpreg_replace_impl($pattern_value, $replacement_value, $subject, $limit, $count)) === null) { + return null; + } + } + + return $subject; + } else { + return dpreg_replace_impl($pattern, $replacement, $subject, $limit, $count); + } +} + +function _dpreg_replace($pattern, $replacement, $subject, $limit = -1, &$count = null) { + if(is_array($replacement) && !is_array($pattern)) + return preg_replace($pattern, $replacement, $subject, $limit, $count); + + if(is_array($subject)) { + $result = array(); + + foreach($subject as $subject_key => $subject_value) { + $result[$subject_key] = dpreg_replace_in_subject($pattern, $replacement, $subject_value, $limit, $count); + } + + return $result; + } else { + return dpreg_replace_in_subject($pattern, $replacement, $subject, $limit, $count); + } +} \ No newline at end of file diff --git a/source/function/function_profile.php b/source/function/function_profile.php new file mode 100644 index 0000000..90b100c --- /dev/null +++ b/source/function/function_profile.php @@ -0,0 +1,475 @@ +fetch_by_uid_verifytype($uid, 0)) { + $fields = dunserialize($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 ''.$space['birthyear'].'-'.$space['birthmonth'].'-'.$space['birthday'].''; + } + $birthyeayhtml = ''; + $nowy = dgmdate($_G['timestamp'], 'Y'); + for ($i=0; $i<100; $i++) { + $they = $nowy - $i; + $selectstr = $they == $space['birthyear']?' selected':''; + $birthyeayhtml .= ""; + } + $birthmonthhtml = ''; + for ($i=1; $i<13; $i++) { + $selectstr = $i == $space['birthmonth']?' selected':''; + $birthmonthhtml .= ""; + } + $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'] % 100 != 0))) { + $days = 29; + } else { + $days = 28; + } + for ($i=1; $i<=$days; $i++) { + $selectstr = $i == $space['birthday']?' selected':''; + $birthdayhtml .= ""; + } + $html = '' + .'  ' + .'' + .'  ' + .''; + + } elseif($fieldid=='gender') { + if($field['unchangeable'] && $space[$fieldid] > 0) { + return ''.lang('space', 'gender_'.intval($space[$fieldid])).''; + } + $selected = array($space[$fieldid]=>' selected="selected"'); + $html = ''; + + } elseif($fieldid=='birthcity') { + if($field['unchangeable'] && !empty($space[$fieldid])) { + return ''.$space['birthcountry'].'-'.$space['birthprovince'].'-'.$space['birthcity'].''; + } + $values = array(0,0,0,0,0); + $elems = array('birthcountry', 'birthprovince', 'birthcity', 'birthdist', 'birthcommunity'); + if(!empty($space['birthcountry'])) { + $html = profile_show('birthcity', $space); + $html .= ' ('.lang('spacecp', 'profile_edit').')'; + $html .= '

          '; + } else { + $html = '

          '.showdistrict($values, $elems, 'birthdistrictbox', 1, 'birth').'

          '; + } + + } elseif($fieldid=='residecity') { + if($field['unchangeable'] && !empty($space[$fieldid])) { + return ''.$space['resideprovince'].'-'.$space['residecity'].''; + } + $values = array(0,0,0,0,0); + $elems = array('residecountry', 'resideprovince', 'residecity', 'residedist', 'residecommunity'); + if(!empty($space['residecountry'])) { + $html = profile_show('residecity', $space); + $html .= ' ('.lang('spacecp', 'profile_edit').')'; + $html .= '

          '; + } else { + $html = '

          '.showdistrict($values, $elems, 'residedistrictbox', 1, 'reside').'

          '; + } + } elseif($fieldid=='qq') { + $html = "

          ".lang('spacecp', 'qq_set_status')."

          "; + } else { + if($field['unchangeable'] && $space[$fieldid]!='') { + if($field['formtype']=='file') { + $imgurl = getglobal('setting/attachurl').'./profile/'.$space[$fieldid]; + return ''; + } else { + return ''.nl2br($space[$fieldid]).''; + } + } + if($field['formtype']=='textarea') { + $html = ""; + } elseif($field['formtype']=='select') { + $field['choices'] = explode("\n", $field['choices']); + $html = "'; + } elseif($field['formtype']=='list') { + $field['choices'] = explode("\n", $field['choices']); + $html = "'; + } elseif($field['formtype']=='checkbox') { + $field['choices'] = explode("\n", $field['choices']); + $space[$fieldid] = explode("\n", $space[$fieldid]); + foreach($field['choices'] as $op) { + $html .= '' + .""; + } + } elseif($field['formtype']=='radio') { + $field['choices'] = explode("\n", $field['choices']); + foreach($field['choices'] as $op) { + $html .= '' + .""; + } + } elseif($field['formtype']=='file') { + $html = ""; + if(!empty($space[$fieldid])) { + $url = getglobal('setting/attachurl').'./profile/'.$space[$fieldid]; + $html .= " 
          "; + } + } else { + $html = ""; + } + } + $html .= !$ignoreshowerror ? "
          " : ''; + if($showstatus) { + $tips = isset($field['description']) ? $field['description'] : ''; + if($space[$fieldid] == '' && !empty($field['unchangeable'])) { + $tips .= (empty($tips) ? '' : ' ').lang('spacecp', 'profile_unchangeable'); + } + if($verifyvalue !== null) { + if($field['formtype'] == 'file') { + $imgurl = getglobal('setting/attachurl').'./profile/'.$verifyvalue; + $verifyvalue = "$imgurl"; + } + $tips .= (empty($tips) ? '' : ' ')."".lang('spacecp', 'profile_is_verifying')." (".lang('spacecp', 'profile_mypost').")" + ."

          ".$verifyvalue."

          "; + } elseif($field['needverify']) { + $tips .= (empty($tips) ? '' : ' ').lang('spacecp', 'profile_need_verifying'); + } + $html .= '

          ' . $tips . '

          '; + } + + return $html; +} + +function profile_check($fieldid, &$value, $space=array()) { + global $_G; + + if(empty($_G['cache']['profilesetting'])) { + loadcache('profilesetting'); + } + if(empty($_G['profilevalidate'])) { + include libfile('spacecp/profilevalidate', 'include'); + $_G['profilevalidate'] = $profilevalidate; + } + + $field = $_G['cache']['profilesetting'][$fieldid]; + if(empty($field) || !$field['available']) { + return false; + } + + if($value=='') { + if($field['required']) { + if(in_array($fieldid, array('birthcountry', 'birthprovince', 'birthcity', 'birthdist', 'birthcommunity', 'residecountry', 'resideprovince', 'residecity', 'residedist', 'residecommunity'))) { + if(substr($fieldid, 0, 5) == 'birth') { + if(!empty($_GET['birthcountry']) || !empty($_GET['birthprovince']) || !empty($_GET['birthcity']) || !empty($_GET['birthdist']) || !empty($_GET['birthcommunity'])) { + return true; + } + } elseif(!empty($_GET['residecountry']) || !empty($_GET['resideprovince']) || !empty($_GET['residecity']) || !empty($_GET['residedist']) || !empty($_GET['residecommunity'])) { + return true; + } + } + return false; + } else { + return true; + } + } + if($field['unchangeable'] && !empty($space[$fieldid])) { + return false; + } + + include_once libfile('function/home'); + if(in_array($fieldid, array('birthday', 'birthmonth', 'birthyear', 'gender'))) { + $value = intval($value); + return true; + } elseif(in_array($fieldid, array('birthcountry', 'birthprovince', 'birthcity', 'birthdist', 'birthcommunity', 'residecountry', 'resideprovince', 'residecity', 'residedist', 'residecommunity'))) { + $value = getstr($value); + return true; + } + + if($field['choices']) { + $field['choices'] = explode("\n", $field['choices']); + } + if($field['formtype'] == 'text' || $field['formtype'] == 'textarea') { + $value = getstr($value); + if($field['size'] && strlen($value) > $field['size']) { + return false; + } else { + $field['validate'] = !empty($field['validate']) ? $field['validate'] : ($_G['profilevalidate'][$fieldid] ? $_G['profilevalidate'][$fieldid] : ''); + if($field['validate'] && !preg_match($field['validate'], $value)) { + return false; + } + } + } elseif($field['formtype'] == 'checkbox' || $field['formtype'] == 'list') { + $arr = array(); + foreach ($value as $op) { + if(in_array($op, $field['choices'])) { + $arr[] = $op; + } + } + $value = implode("\n", $arr); + if($field['size'] && count($arr) > $field['size']) { + return false; + } + } elseif($field['formtype'] == 'radio' || $field['formtype'] == 'select') { + if(!in_array($value, $field['choices'])){ + return false; + } + } + return true; +} + +function profile_show($fieldid, $space=array(), $getalone = false) { + global $_G; + + if(empty($_G['cache']['profilesetting'])) { + loadcache('profilesetting'); + } + if($fieldid == 'qqnumber') { + $_G['cache']['profilesetting'][$fieldid] = $_G['cache']['profilesetting']['qq']; + } + $field = $_G['cache']['profilesetting'][$fieldid]; + if(empty($field) || !$field['available'] || (!$getalone && in_array($fieldid, array('uid', 'birthmonth', 'birthyear', 'birthcountry', 'residecountry')))) { + return false; + } + + if($fieldid=='gender') { + return lang('space', 'gender_'.intval($space['gender'])); + } elseif($fieldid=='birthday' && !$getalone) { + $return = $space['birthyear'] ? $space['birthyear'].' '.lang('space', 'year').' ' : ''; + if($space['birthmonth'] && $space['birthday']) { + $return .= $space['birthmonth'].' '.lang('space', 'month').' '.$space['birthday'].' '.lang('space', 'day'); + } + return $return; + } elseif($fieldid=='birthcity' && !$getalone) { + return $space['birthcountry'] + .(!empty($space['birthprovince']) ? ' '.$space['birthprovince'] : '') + .(!empty($space['birthcity']) ? ' '.$space['birthcity'] : '') + .(!empty($space['birthdist']) ? ' '.$space['birthdist'] : '') + .(!empty($space['birthcommunity']) ? ' '.$space['birthcommunity'] : ''); + } elseif($fieldid=='residecity' && !$getalone) { + return $space['residecountry'] + .(!empty($space['resideprovince']) ? ' '.$space['resideprovince'] : '') + .(!empty($space['residecity']) ? ' '.$space['residecity'] : '') + .(!empty($space['residedist']) ? ' '.$space['residedist'] : '') + .(!empty($space['residecommunity']) ? ' '.$space['residecommunity'] : ''); + } elseif($fieldid == 'site') { + $url = str_replace('"', '\\"', $space[$fieldid]); + return "$url"; + } elseif($fieldid == 'position') { + return nl2br($space['office'] ? : ($space['field_position']?:$space['position'])); + } elseif($fieldid == 'qq') { + return 'QQ'; + } elseif($fieldid == 'qqnumber') { + return $space['qq']; + } else { + return nl2br($space[$fieldid]); + } +} + + +function showdistrict($values, $elems=array(), $container='districtbox', $showlevel=null, $containertype = 'birth') { + $html = ''; + if(!preg_match("/^[A-Za-z0-9_]+$/", $container)) { + return $html; + } + $showlevel = !empty($showlevel) ? intval($showlevel) : count($values); + $showlevel = $showlevel <= 5 ? $showlevel : 5; + $upids = array(0); + for($i=0;$i<$showlevel;$i++) { + if(!empty($values[$i])) { + $upids[] = intval($values[$i]); + } else { + for($j=$i; $j<$showlevel; $j++) { + $values[$j] = ''; + } + break; + } + } + $options = array(0=>array(), 1=>array(), 2=>array(), 3=>array(), 4=>array()); + if($upids && is_array($upids)) { + foreach(C::t('common_district')->fetch_all_by_upid($upids, 'displayorder', 'ASC') as $value) { + if($value['level'] == 0 && ($value['id'] != $values[0] && ($value['usetype'] == 0 || !(($containertype == 'birth' && in_array($value['usetype'], array(1, 3))) || ($containertype != 'birth' && in_array($value['usetype'], array(2, 3))))))) { + continue; + } + $options[$value['level']][] = array($value['id'], $value['name']); + } + } + $names = array('country', 'province', 'city', 'district', 'community'); + for($i=0; $i<4;$i++) { + if(!empty($elems[$i])) { + $elems[$i] = dhtmlspecialchars(preg_replace("/[^\[A-Za-z0-9_\]]/", '', $elems[$i])); + } else { + $elems[$i] = ($containertype == 'birth' ? 'birth' : 'reside').$names[$i]; + } + } + + for($i=0;$i<$showlevel;$i++) { + $level = $i; + if(!empty($options[$level])) { + $jscall = "showdistrict('$container', ['$elems[0]', '$elems[1]', '$elems[2]', '$elems[3]', '$elems[4]'], $showlevel, $level, '$containertype')"; + $html .= ''; + $html .= '  '; + } + } + return $html; +} + +function countprofileprogress($uid = 0) { + global $_G; + + $uid = intval(!$uid ? $_G['uid'] : $uid); + if(($profilegroup = C::t('common_setting')->fetch_setting('profilegroup', true))) { + $fields = array(); + foreach($profilegroup as $type => $value) { + foreach($value['field'] as $key => $field) { + $fields[$key] = $field; + } + } + if(isset($fields['sightml']) && empty($_G['group']['maxsigsize'])) { + unset($fields['sightml']); + } + if(isset($fields['customstatus']) && empty($_G['group']['allowcstatus'])) { + unset($fields['customstatus']); + } + loadcache('profilesetting'); + $allowcstatus = !empty($_G['group']['allowcstatus']) ? true : false; + $complete = 0; + $profile = array_merge(C::t('common_member_profile')->fetch($uid), C::t('common_member_field_forum')->fetch($uid)); + foreach($fields as $key) { + if((!isset($_G['cache']['profilesetting'][$key]) || !$_G['cache']['profilesetting'][$key]['available']) && !in_array($key, array('sightml', 'customstatus'))) { + unset($fields[$key]); + continue; + } + if(in_array($key, array('birthday', 'birthyear', 'birthcountry', 'birthprovince', 'birthcity', 'birthdist', 'birthcommunity', 'residecountry', 'resideprovince', 'residecity', 'residedist', 'residecommunity'))) { + if($key=='birthday') { + if(!empty($profile['birthyear']) || !empty($profile[$key])) { + $complete++; + } + unset($fields['birthyear']); + } elseif($key=='birthcity') { + if(!empty($profile['birthcountry']) || !empty($profile['birthprovince']) || !empty($profile[$key]) || !empty($profile['birthdist']) || !empty($profile['birthcommunity'])) { + $complete++; + } + unset($fields['birthcountry']); + unset($fields['birthprovince']); + unset($fields['birthdist']); + unset($fields['birthcommunity']); + } elseif($key=='residecity') { + if(!empty($profile['residecountry']) || !empty($profile['resideprovince']) || !empty($profile[$key]) || !empty($profile['residedist']) || !empty($profile['residecommunity'])) { + $complete++; + } + unset($fields['residecountry']); + unset($fields['resideprovince']); + unset($fields['residedist']); + unset($fields['residecommunity']); + } + } else if($profile[$key] != '') { + $complete++; + } + } + $progress = empty($fields) ? 0 : floor($complete / count($fields) * 100); + C::t('common_member_status')->update($uid, array('profileprogress' => $progress > 100 ? 100 : $progress), 'UNBUFFERED'); + return $progress; + } +} + +function get_constellation($birthmonth,$birthday) { + $birthmonth = intval($birthmonth); + $birthday = intval($birthday); + $idx = $birthmonth; + if ($birthday <= 22) { + if (1 == $birthmonth) { + $idx = 12; + } else { + $idx = $birthmonth - 1; + } + } + return $idx > 0 && $idx <= 12 ? lang('space', 'constellation_'.$idx) : ''; +} + +function get_zodiac($birthyear) { + $birthyear = intval($birthyear); + $idx = (($birthyear - 1900) % 12) + 1; + return $idx > 0 && $idx <= 12 ? lang('space', 'zodiac_'. $idx) : ''; +} + +function isprofileimage($file) { + return is_file(getglobal('setting/attachdir').'./profile/'.$file) && strpos(realpath(getglobal('setting/attachdir').'./profile/'.$file), realpath(getglobal('setting/attachdir').'./profile/').DIRECTORY_SEPARATOR) === 0 && in_array(fileext($file), array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'webp')); +} +?> \ No newline at end of file diff --git a/source/function/function_search.php b/source/function/function_search.php new file mode 100644 index 0000000..0cb2eb2 --- /dev/null +++ b/source/function/function_search.php @@ -0,0 +1,75 @@ + $replaceword) { + $text = str_replace($replaceword, ''.$replaceword.'', $text); + } + return "$prepend$text"; +} + +function bat_highlight($message, $words, $color = '#ff0000') { + if(!empty($words)) { + $highlightarray = explode(' ', $words); + $sppos = strrpos($message, chr(0).chr(0).chr(0)); + if($sppos !== FALSE) { + $specialextra = substr($message, $sppos + 3); + $message = substr($message, 0, $sppos); + } + bat_highlight_callback_highlight_21($highlightarray, 1); + $message = preg_replace_callback("/(^|>)([^<]+)(?=<|$)/sU", 'bat_highlight_callback_highlight_21', $message); + $message = preg_replace("/(.*)<\/highlight>/siU", "\\1", $message); + if($sppos !== FALSE) { + $message = $message.chr(0).chr(0).chr(0).$specialextra; + } + } + return $message; +} + +function bat_highlight_callback_highlight_21($matches, $action = 0) { + static $highlightarray = array(); + + if($action == 1) { + $highlightarray = $matches; + } else { + return highlight($matches[2], $highlightarray, $matches[1]); + } +} + +?> \ No newline at end of file diff --git a/source/function/function_searchindex.php b/source/function/function_searchindex.php new file mode 100644 index 0000000..915edc3 --- /dev/null +++ b/source/function/function_searchindex.php @@ -0,0 +1,142 @@ + $leftmenu) { + foreach($leftmenu as $item) { + if(!isset($item[2]) && isset($menulang[$item[0]])) { + list($action, $operation, $do) = explode('_', $item[1]); + $indexdata[] = array('index' => array( + $menulang[$item[0]] => 'action='.$action.($operation ? '&operation='.$operation.($do ? '&do='.$do : '') : '') + ), 'text' => array($menulang[$item[0]])); + } + } + } + + $genlangi = '|'.implode('|', array_keys($genlang)).'|'; + + $flag = false; + $dir = opendir(DISCUZ_ROOT.'./source/admincp/'); + while($entry = readdir($dir)) { + if($entry != '.' && $entry != '..' && preg_match('/^admincp\_/', $entry)) { + + $adminfile = DISCUZ_ROOT.'./source/admincp/'.$entry; + $data = file_get_contents($adminfile); + $data = preg_replace('/\/\/.+?\r/', '', $data); + $data = preg_replace_callback( + '/\/\*(.+?)\*\//s', + function ($matches) { + if(!preg_match('/^search/i', $matches[1])) { + return ''; + } else { + return '/*'.$matches[1].'*/'; + } + }, + $data + ); + $isfullindex = preg_match_all('#/\*search=\s*(\{.+?\})\s*\*/(.+?)/\*search\*/#is', $data, $search); + if($isfullindex) { + foreach($search[0] as $k => $item) { + $search[1][$k] = stripslashes($search[1][$k]); + $titles = json_decode($search[1][$k], 1); + $titlesnew = $titletext = array(); + foreach($titles as $title => $url) { + $titlekey = strip_tags(isset($genlang[$title]) ? $genlang[$title] : $title); + $titlesnew[$titlekey] = $url; + if($titlekey[0] != '_') { + $titletext[] = $titlekey; + } + } + $data = $search[2][$k]; + $l = $tm = array(); + preg_match_all("/(showsetting|showtitle|showtableheader|showtips)\('(\w+)'/", $data, $r); + if($r[2]) { + if($titletext) { + $l[] = implode(' » ', $titletext); + } + foreach($r[2] as $i) { + if(in_array($i,$tm)) { + continue; + } + $tm[] = $i; + $l[] = strip_tags($i); + $l[] = strip_tags($genlang[$i]); + $preg = '/\|('.preg_quote($i).'_comment)\|/'; + preg_match_all($preg, $genlangi, $lr); + if($lr[1]) { + foreach($lr[1] as $li) { + $l[] = strip_tags($genlang[$li]); + } + } + } + } + + preg_match_all("/\\\$lang\['(\w+)'\]/", $data, $r); + if($r[1]) { + if(empty($l) && $titletext) { + $l[] = implode(' » ', $titletext); + } + foreach($r[1] as $i) { + if(in_array($i,$tm)) { + continue; + } + $tm[] = $i; + $l[] = strip_tags($i); + $l[] = strip_tags($genlang[$i]); + $preg = '/\|('.preg_quote($i).'_comment)\|/'; + preg_match_all($preg, $genlangi, $lr); + if($lr[1]) { + foreach($lr[1] as $li) { + $l[] = strip_tags($genlang[$li]); + } + } + } + } + if (!empty($l)) { + $indexdata[] = array('index' => $titlesnew, 'text' => $l); + $flag = true; + } + } + } + + } + } + + if($flag) { + $cachedata = '$searchindex = '.var_export($indexdata, 1).';'; + } else { + $cachedata = "lang('admincp_searchindex');\n\$searchindex = & \$_G['lang']['admincp_searchindex'];"; + } + + require_once libfile('function/cache'); + writetocache('searchindex', $cachedata); +} \ No newline at end of file diff --git a/source/function/function_share.php b/source/function/function_share.php new file mode 100644 index 0000000..088b45a --- /dev/null +++ b/source/function/function_share.php @@ -0,0 +1,43 @@ + \ No newline at end of file diff --git a/source/function/function_space.php b/source/function/function_space.php new file mode 100644 index 0000000..fdb2811 --- /dev/null +++ b/source/function/function_space.php @@ -0,0 +1,728 @@ +$field) { + if($_G['setting']['nsprofiles']) { + break; + } + if(!$field['available'] || in_array($fieldid, array('birthcountry', 'birthprovince', 'birthdist', 'birthcommunity', 'residecountry', 'resideprovince', 'residedist', 'residecommunity'))) { + continue; + } + if( + $field['available'] && $field['invisible'] != '1' && strlen($space[$fieldid]) > 0 && + ( + $field['showinthread'] || + $field['showincard'] || + ( + $space['self'] || empty($privacy[$fieldid]) || ($isfriend && $privacy[$fieldid] == 1) + ) + ) + ) { + $val = profile_show($fieldid, $space); + if($val !== false) { + if($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) { + continue; + } + if($field['formtype'] == 'file' && $val) { + $imgurl = getglobal('setting/attachurl').'./profile/'.$val; + $val = ''; + } + if ($val == '') $val = ''; + $html .= '
        • '.$field['title'].''.$val.'
        • '; + } + } + } + $html = $html ? $html : '
        • '.lang('space', 'block_view_profileinfo_noperm').'
        • '; + $html = '
            '.$html.$more.'
          '; + $more = lang('space', 'block_profile_all', array('uid' => $uid)); + $html = $html.$more; + $titlemore = $space['self'] ? lang('space', 'block_profile_edit') : ''; + break; + case 'profile': + $do = $blockname; + $managehtml = ''; + $avatar = empty($parameters['banavatar']) ? 'middle' : $parameters['banavatar']; + $html .= "

          ".avatar($uid,$avatar).'

          '; + + $memberfieldforum = C::t('common_member_field_forum')->fetch($space['uid']); + $space['medals'] = $memberfieldforum['medals']; + unset($memberfieldforum); + $usermedals = $medal_detial = $usermedalmenus = ''; + if($space['medals']) { + loadcache('medals'); + foreach($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) { + list($medalid, $medalexpiration) = explode("|", $medalid); + if(isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) { + $usermedals .= ''.$_G['cache']['medals'][$medalid]['name'].'\' '; + $usermedalmenus .= ' + '; + } + } + if($usermedals) { + $usermedals = '

          '.$usermedals.'

          '.$usermedalmenus; + } + } + $html .= "

          ".$space['username']."

          $usermedals"; + $html .= '
          '; + + $encodeusername = rawurlencode($space['username']); + + if(checkperm('allowbanuser')) { + $managehtml .= '
        • '.lang('home/template', 'member_manage').'
        • '; + } elseif (checkperm('allowedituser')) { + $managehtml .= '
        • '.lang('home/template', 'member_manage').'
        • '; + } + if($_G['adminid'] == 1) { + if(helper_access::check_module('forum')) { + $managehtml .= "
        • ".lang('home/template', 'content_manage')."
        • "; + } else { + $managehtml .= "
        • ".lang('home/template', 'content_manage')."
        • "; + } + } + if(!empty($managehtml)) { + $html .= '
            '.$managehtml.'
          '; + if($_G['adminid'] == 1) { + $html .= ''; + } + } + if($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) { + $info = !empty($space['magicgift']) ? dunserialize($space['magicgift']) : array(); + if($space['self']) { + + } elseif($info) { + if($info['left'] && !in_array($_G['uid'], (array)$info['receiver'])) { + $percredit = min($info['percredit'], $info['left']); + if($info['credittype']=='credits') { + $credittype = lang('core', 'title_credit'); + } else { + $extcredits = str_replace('extcredits', '', $info['credittype']); + $credittype = $_G['setting']['extcredits'][$extcredits]['title']; + } + $html .= '
          '; + $html .= ''; + $html .= 'gift'; + $html .= ''; + $html .= '
          '; + } + } + } + $html = '
          '.$html.'
          '; + break; + case 'statistic': + space_merge($space, 'count'); + $html .= '

          '; + if(empty($parameters['banviews'])) $html .= lang('space', 'space_views', array('views' => $space['views'] ? $space['views'] : '--')); + $html .= '

          '; + $html = '
          '.$html.'
          '; + break; + + case 'doing': + $do = $blockname; + $view = 'me'; + $from = 'space'; + if(ckprivacy('doing', 'view')) { + $dolist = array(); + $query = C::t('home_doing')->fetch_all_by_uid_doid(array($uid), '', 'dateline', 0, $shownum, false, true); + foreach ($query as $value) { + if($value['status'] == 0 || $value['uid'] == $_G['uid']) { + $dolist[] = $value; + } + } + + if ($dolist) { + foreach($dolist as $dv) { + $doid = $dv['doid']; + $_GET['key'] = $key = random(8); + $html .= "
        • "; + $html .= $dv['message']; + $html .= " ".lang('space', 'block_doing_reply').""; + $html .= "
        • "; + } + } else { + $html .= "

          ".lang('space', 'block_doing_no_content').($space['self'] ? lang('space', 'block_doing_no_content_publish', $space) : '')."

          "; + } + } else { + $html .= "

          ".lang('space', 'block_view_noperm')."

          "; + } + $html = '
            '.$html.'
          '; + break; + + case 'stickblog' : + space_merge($space, 'profile'); + $stickblogs = explode(',', $space['stickblogs']); + if(!empty($stickblogs)) { + $bids = array_slice($stickblogs, 0, $shownum); + if(count($bids)) { + if(!isset($parameters['showmessage'])) $parameters['showmessage'] = 150; + $data_blog = C::t('home_blog')->fetch_all_blog($bids); + if($parameters['showmessage'] > 0) { + $data_blogfield = C::t('home_blogfield')->fetch_all($bids); + } + foreach($data_blog as $curblogid => $value) { + $value = array_merge($value, (array)$data_blogfield[$curblogid]); + if(ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + if($value['pic']) $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $parameters['showmessage'], 0, 0, 0, -1); + $html .= lang('space', 'blog_li', array( + 'uid' => $value['uid'], + 'blogid' => $value['blogid'], + 'subject' => $value['subject'], + 'date' => dgmdate($value['dateline'],'Y-m-d'))); + if(!empty($parameters['showmessage'])) { + if ($value['pic']) { + $html .= lang('space', 'blog_li_img', array( + 'uid' => $value['uid'], + 'blogid' => $value['blogid'], + 'src' => $value['pic'])); + } + $html .= "
          {$value['message']}
          "; + } + $html .= lang('space', 'blog_li_ext', array('uid'=>$value['uid'],'blogid'=>$value['blogid'],'viewnum'=>$value['viewnum'],'replynum'=>$value['replynum'])); + $html .= ""; + } else { + $html .= '

          '.lang('space','block_view_noperm').'

          '; + } + } + } + } + $more = $html ? '

          '.lang('space', 'viewmore').'

          ' : ''; + $contentclassname = ' xld'; + $html = $html.$more; + break; + case 'blog': + $do = $blockname; + $view = 'me'; + $from = 'space'; + if(!isset($parameters['showmessage'])) $parameters['showmessage'] = 150; + $data_blog = C::t('home_blog')->fetch_all_by_uid($uid, 'dateline', 0, $shownum); + $blogids = array_keys($data_blog); + $data_blogfield = C::t('home_blogfield')->fetch_all($blogids); + foreach($data_blog as $curblogid => $value) { + $value = array_merge($value, (array)$data_blogfield[$curblogid]); + if(ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + if($value['pic']) $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $parameters['showmessage'], 0, 0, 0, -1); + $html .= lang('space', 'blog_li', array( + 'uid' => $value['uid'], + 'blogid' => $value['blogid'], + 'subject' => $value['subject'], + 'date' => dgmdate($value['dateline'],'Y-m-d'))); + if(!empty($parameters['showmessage'])) { + if ($value['pic']) { + $html .= lang('space', 'blog_li_img', array( + 'uid' => $value['uid'], + 'blogid' => $value['blogid'], + 'src' => $value['pic'])); + } + $html .= "
          {$value['message']}
          "; + } + $html .= lang('space', 'blog_li_ext', array('uid'=>$value['uid'],'blogid'=>$value['blogid'],'viewnum'=>$value['viewnum'],'replynum'=>$value['replynum'])); + $html .= ""; + } else { + $html .= '

          '.lang('space','block_view_noperm').'

          '; + } + } + if($html) { + $more = '

          '.lang('space', 'viewmore').'

          '; + } else { + $html = '

          '.lang('space','block_blog_no_content').($space['self'] ? lang('space', 'block_blog_no_content_publish', $space) : '').'

          '; + $more = ''; + } + $contentclassname = ' xld'; + $html = $html.$more; + break; + case 'album': + $do = $blockname; + $view = 'me'; + $from = 'space'; + if(ckprivacy('album', 'view')) { + $query = C::t('home_album')->fetch_all_by_uid($uid, 'updatetime', 0, $shownum); + foreach($query as $value) { + if(ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + $html .= lang('space', 'album_li', array( + 'albumid' =>$value['albumid'], + 'src' => $value['pic'], + 'albumname' => $value['albumname'], + 'uid' => $value['uid'], + 'picnum' => $value['picnum'], + 'date' => dgmdate($value['updatetime'],'n-j') + )); + } + } + if(!$html) { + $html = '

          '.lang('space','block_album_no_content').($space['self'] ? lang('space', 'block_album_no_content_publish', $space) : '').'

          '; + } + } else { + $html .= '
        • '.lang('space','block_view_noperm').'
        • '; + } + $html = '
            '.$html.'
          '; + break; + + case 'feed': + $do = 'home'; + $view = 'me'; + $from = 'space'; + if(!IS_ROBOT && ckprivacy('feed', 'view')) { + require_once libfile('function/feed'); + $query = C::t('home_feed')->fetch_all_by_uid_dateline($uid, false, 0, $shownum); + foreach($query as $value) { + if(ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + $html .= mkfeedhtml(mkfeed($value)); + } + } + } + $contenttagname = 'ul'; + $contentclassname = ' el'; + $html = !$html ? '

          '.lang('space','block_feed_no_content').'

          ' : $html; + break; + case 'thread': + $do = $blockname; + $view = 'me'; + $from = 'space'; + if ($_G['setting']['allowviewuserthread'] !== -1) { + $fidsql = empty($_G['setting']['allowviewuserthread']) ? '' : " AND fid IN({$_G['setting']['allowviewuserthread']}) "; + $viewfids = str_replace("'", '', $_G['setting']['allowviewuserthread']); + if(!empty($viewfids)) { + $viewfids = explode(',', $viewfids); + } + + foreach(C::t('forum_thread')->fetch_all_by_authorid_displayorder($uid, 0, '>=', null, '', 0, $shownum, null, $viewfids ? $viewfids : null) as $thread) { + if($thread['author']) { + $html .= "
        • {$thread['subject']}
        • "; + } + } + } + $html = !$html ? '

          '.lang('space','block_thread_no_content').($space['self'] ? lang('space', 'block_thread_no_content_publish', $space) : '').'

          ' : '
            '.$html.'
          '; + break; + case 'friend': + $do = $blockname; + $view = 'me'; + $from = 'space'; + require_once libfile('function/friend'); + + $friendlist = array(); + $friendlist = friend_list($uid, $shownum); + + $fuids = array_keys($friendlist); + getonlinemember($fuids); + + foreach ($friendlist as $key => $value) { + $classname = $_G['ols'][$value['fuid']]?'gol':''; + $html .= '
        • '.avatar($value['fuid'],'small').'

          '.$value['fusername'].'

        • '; + } + $html = !$html ? '

          '.lang('space','block_friend_no_content').($space['self'] ? lang('space', 'block_friend_no_content_publish', $space) : '').'

          ' : '
            '.$html.'
          '; + break; + case 'visitor': + if($space['self']) { + $do = 'friend'; + $view = 'visitor'; + } + + $list = $fuids = array(); + foreach(C::t('home_visitor')->fetch_all_by_uid($uid, $shownum) as $value) { + $list[] = $value; + $fuids[] = $value['vuid']; + } + + getonlinemember($fuids); + + foreach($list as $value) { + $html .= "
        • "; + if ($value['vusername'] == '') { + $html .= lang('space', 'visitor_anonymity'); + } else { + $html .= lang('space', 'visitor_list', array( + 'uid' => $value['vuid'], + 'cuid' => $uid, + 'username' => $value['vusername'], + 'class' => ($_G['ols'][$value['vuid']]?'gol':''), + 'self' => $value['vuid'] == $_G['uid'] ? 'god' : '', + 'avatar' => avatar($value['vuid'],'small'))); + } + $html .= "".dgmdate($value['dateline'],'u', '9999', 'Y-m-d').""; + $html .= "
        • "; + } + $html = !$html ? '

          '.lang('space','block_visitor_no_content').($space['self'] ? lang('space', 'block_visitor_no_content_publish', $space) : '').'

          ' : '
            '.$html.'
          '; + break; + case 'share': + $do = $blockname; + $view = 'me'; + $from = 'space'; + if(!IS_ROBOT && ckprivacy('share', 'view')) { + require_once libfile('function/share'); + + foreach(C::t('home_share')->fetch_all_by_uid($uid, 0, $shownum) as $value) { + $value = mkshare($value); + + $html .= '
        • '.$value['title_template'].'('.dgmdate($value['dateline'], 'u').')
          '; + if ($value['image']) { + $html .= ''; + } + $html .= '
          '.$value['body_template'].'
          '; + if ($value['type'] == 'video') { + if(!empty($value['body_data']['imgurl'])) { + $html .= '
          '.lang('space', 'click_play').'
          '; + } else { + $html .= "\"".lang('space',"; + } + }elseif ($value['type'] == 'music') { + $html .= "\"".lang('space',"; + }elseif ($value['type'] == 'flash') { + $html .= "\"".lang('space',"; + } + + if ($value['body_general']) { + $html .= '
          {$value['body_general']}
          "; + } + $html .= '
        • '; + } + $html = !$html ? '

          '.lang('space','block_share_no_content').'

          ' : '
            '.$html.'
          '; + } + break; + case 'wall': + $do = $blockname; + $walllist = array(); + if(ckprivacy('wall', 'view')) { + $query = C::t('home_comment')->fetch_all_by_id_idtype($uid, 'uid', 0, $shownum, '', 'DESC'); + foreach($query as $value) { + $value['message'] = strlen($value['message'])>500? getstr($value['message'], 500, 0, 0, 0, -1).' ...':$value['message']; + if($value['status'] == 0 || $value['authorid'] == $_G['uid']) { + $walllist[] = $value; + } + } + } + + foreach ($walllist as $key => $value) { + $op = ''; + if ($value['author']) { + $author_avatar = ''.avatar($value['authorid'],'small').''; + $author = ''.$value['author'].''; + }else { + $author_avatar = 'hidden'; + $author = $_G['setting']['anonymoustext']; + } + if ($value['authorid']==$_G['uid']) { + $op .= lang('space', 'wall_edit', array('cid'=>$value['cid'])); + } + if ($value['authorid']==$_G['uid'] || $space['self'] || checkperm('managecomment')){ + $op .= lang('space', 'wall_del', array('cid'=>$value['cid'])); + } + if ($value['authorid']!=$_G['uid'] && ($value['idtype'] != 'uid' || $space['self'])) { + $op .= lang('space', 'wall_reply', array('cid'=>$value['cid'])); + } + $moderate_need = $value['status'] == 1 ? lang('template', 'moderate_need') : ''; + $date = dgmdate($value['dateline'], 'u'); + $replacearr = array('author'=>$author, 'author_avatar' => $author_avatar, 'moderated' => $moderate_need, 'cid' => $value['cid'], 'message'=> $value['message'] , 'date' => $date, 'op'=> $op); + + $html .= lang('space', 'wall_li', $replacearr); + } + $html = !empty($walllist) ? $html.lang('space', 'wall_more', array('uid'=>$uid)) : '

          '.lang('space','block_wall_no_content').'

          '; + $html = '
          '.$html.'
          '; + if(helper_access::check_module('wall')) { + $html = lang('space', 'wall_form', array('uid' => $uid, 'FORMHASH'=>FORMHASH)).'
          '.$html; + } + $titlemore = ''.lang('space', 'all').''; + break; + case 'group': + require_once libfile('function/group'); + $grouplist = mygrouplist($uid, 'lastupdate', array('f.name', 'ff.icon'), $shownum); + if(empty($grouplist)) $grouplist = array(); + foreach ($grouplist as $groupid => $group) { + $group['groupid'] = $groupid; + $html .= lang('space', 'group_li',$group); + } + $html = !$html ? '

          '.lang('space','block_group_no_content').($space['self'] ? lang('space', ($_G['group']['allowbuildgroup'] ? 'block_group_no_content_publish' : 'block_group_no_content_join'), $space) : '').'

          ' : '
            '.$html.'
          '; + break; + case 'music': + if(!empty($parameters['mp3list'])) { + $authcode = substr(md5($_G['authkey'].$uid), 6, 16); + $view = ($_G['adminid'] == 1 && $_G['setting']['allowquickviewprofile']) ? '&view=admin' : ''; + $querystring = "home.php?mod=space&uid=$uid&do=index&op=getmusiclist&hash=$authcode$view&t=".TIMESTAMP; + $height = (empty($parameters['config']['height']) && $parameters['config']['height'] !== 0) ? 200 : $parameters['config']['height']; + $html = ""; + } else { + $html = lang('space', 'music_no_content'); + } + $html = '
          '.$html.'
          '; + break; + + case 'block1': + case 'block2': + case 'block3': + case 'block4': + case 'block5': + if($space['self']) { + $_G['space_group'] = $_G['group']; + } elseif(empty($_G['space_group'])) { + $_G['space_group'] = C::t('common_usergroup_field')->fetch($space['groupid']); + } + require_once libfile('function/discuzcode'); + if ($_G['space_group']['allowspacediyimgcode']) { + if (empty($_G['cache']['smilies']['loaded'])) { + loadcache(array('smilies', 'smileytypes')); + foreach($_G['cache']['smilies']['replacearray'] AS $skey => $smiley) { + $_G['cache']['smilies']['replacearray'][$skey] = '[img]'.$_G['siteurl'].'static/image/smiley/'.$_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'].'/'.$smiley.'[/img]'; + } + $_G['cache']['smilies']['loaded'] = 1; + } + $parameters['content'] = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], trim($parameters['content'])); + } + if ($_G['space_group']['allowspacediybbcode'] || $_G['space_group']['allowspacediyimgcode'] || $_G['space_group']['allowspacediyhtml'] ){ + $parameters['content'] = discuzcode($parameters['content'], 1, 0, 1, 0, $_G['space_group']['allowspacediybbcode'], $_G['space_group']['allowspacediyimgcode'], $_G['space_group']['allowspacediyhtml']); + } else { + $parameters['content'] = dhtmlspecialchars($parameters['content']); + } + $parameters['content'] = nl2br($parameters['content']); + if (empty ($parameters['content'])) $parameters['content'] = lang('space',$blockname); + $html .= $parameters['content']; + break; + + default: + return false; + } + + if (isset($parameters['title'])) { + if(empty($parameters['title'])) { + $title = ''; + } else { + $view = $view === false ? '' : '&view='.$view; + $from = $from === false ? '' : '&from='.$from; + $bnamelink = $do ? ''.$parameters['title'].'' : $parameters['title']; + $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore)); + } + } else { + $view = $view === false ? '' : '&view='.$view; + $from = $from === false ? '' : '&from='.$from; + $bnamelink = $do ? ''.getblockdata($blockname).'' : getblockdata($blockname); + $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore)); + } + $html = $title.'<'.$contenttagname.' id="'.$blockname.'_content" class="dxb_bc'.$contentclassname.'">'.$html.''; + + return $html; +} + +function mkfeedhtml($value) { + global $_G; + + $_GET['uid'] = intval($_GET['uid']); + $_GET['view'] = dhtmlspecialchars($_GET['view']); + $html = ''; + $html .= "
        • "; + $html .= "
          "; + $html .= "{$value['title_template']}"; + $html .= "\t".dgmdate($value['dateline'], 'n-j H:i').""; + + $html .= "
          "; + + if ($value['image_1']) { + $html .= "\"\""; + } + if ($value['image_2']) { + $html .= "\"\""; + } + if ($value['image_3']) { + $html .= "\"\""; + } + if ($value['image_4']) { + $html .= "\"\""; + } + + if ($value['body_template']) { + $style = $value['image_3'] ? ' style="clear: both; zoom: 1;"' : ''; + $html .= "
          {$value['body_template']}
          "; + } + + if (!empty($value['body_data']['flashvar'])) { + if(!empty($value['body_data']['imgurl'])) { + $html .= '
          '.lang('space', 'click_play').'
          '; + } else { + $html .= "\"".lang('space',"; + } + }elseif (!empty($value['body_data']['musicvar'])) { + $html .= "\"".lang('space',"; + }elseif (!empty($value['body_data']['flashaddr'])) { + $html .= "\"".lang('space',"; + } + + if ($value['body_general']) { + $classname = $value['image_1'] ? ' z' : ''; + $html .= "
          {$value['body_general']}
          "; + } + $html .= "
          "; + $html .= "
          "; + $html .= "
        • "; + return $html; +} + +function &getlayout($layout='') { + $layoutarr = array( + '1:2:1' => array('300', '600', '300'), + '1:1:2' => array('300', '300', '600'), + '2:1:1' => array('600', '300', '300'), + '2:2' => array('600', '600'), + '1:3' => array('300', '900'), + '3:1' => array('900', '300'), + '1:4' => array('240', '960'), + '4:1' => array('960', '240'), + '2:2:1' => array('480', '480', '240'), + '1:2:2' => array('240', '480', '480'), + '1:1:3' => array('240', '240', '720'), + '1:3:1' => array('240', '720', '240'), + '3:1:1' => array('720', '240', '240'), + '3:2' => array('720', '480'), + '2:3' => array('480', '720') + ); + + if (!empty($layout)) { + $rt = (isset($layoutarr[$layout])) ? $layoutarr[$layout] : false; + } else { + $rt = $layoutarr; + } + + return $rt; +} + +function getblockdata($blockname = '') { + $blockarr = lang('space', 'blockdata'); + $r = empty($blockname) ? $blockarr : (isset($blockarr[$blockname]) ? $blockarr[$blockname] : false); + return $r; +} + +function check_ban_block($blockname, $space) { + global $_G; + $return = true; + loadcache('usergroup_'.$space['groupid']); + if($blockname == 'group' && !helper_access::check_module('group')) { + $return = false; + } elseif($blockname == 'thread' && $_G['setting']['allowviewuserthread'] === -1) { + $return = false; + } + return $return; +} +?> \ No newline at end of file diff --git a/source/function/function_spacecp.php b/source/function/function_spacecp.php new file mode 100644 index 0000000..1dd78b1 --- /dev/null +++ b/source/function/function_spacecp.php @@ -0,0 +1,705 @@ + $albumname); + if($catid) { + $albumarr['catid'] = $catid; + } + $albumid = album_creat($albumarr); + } else { + $albumid = intval($albumid); + if($albumid) { + $value = C::t('home_album')->fetch_all_by_uid($_G['uid'], false, 0, 0, $albumid); + if($value = $value[0]) { + $albumname = addslashes($value['albumname']); + $albumfriend = $value['friend']; + } else { + $albumname = dgmdate($_G['timestamp'],'Ymd'); + $albumarr = array('albumname' => $albumname); + if($catid) { + $albumarr['catid'] = $catid; + } + $albumid = album_creat($albumarr); + } + } + } + return $albumid; +} + +function album_update_pic($albumid, $picid=0) { + global $_G; + + $setarr = array(); + if(!$picid) { + $piccount = C::t('home_pic')->check_albumpic($albumid, 0); + if(empty($piccount) && C::t('home_pic')->check_albumpic($albumid) == 0) { + C::t('home_album')->delete($albumid); + return false; + } else { + $setarr['picnum'] = $piccount; + } + } + $query = C::t('home_pic')->fetch_all_by_albumid($albumid, 0, 1, $picid, 1); + if(!$pic = $query[0]) { + return false; + } + $from = $pic['remote']; + $pic['remote'] = $pic['remote'] > 1 ? $pic['remote'] - 2 : $pic['remote']; + $basedir = !getglobal('setting/attachdir') ? (DISCUZ_ROOT.'./data/attachment/') : getglobal('setting/attachdir'); + $picdir = 'cover/'.substr(md5($albumid), 0, 2).'/'; + dmkdir($basedir.'./album/'.$picdir); + if($pic['remote']) { + $picsource = pic_get($pic['filepath'], $from > 1 ? 'forum' : 'album', $pic['thumb'], $pic['remote'], 0); + } else { + $picsource = $basedir.'./'.($from > 1 ? 'forum' : 'album').'/'.$pic['filepath']; + } + require_once libfile('class/image'); + $image = new image(); + if($image->Thumb($picsource, 'album/'.$picdir.$albumid.'.jpg', 300, 300, 2)) { + $setarr['pic'] = $picdir.$albumid.'.jpg'; + $setarr['picflag'] = 1; + if(ftpperm('jpg', filesize($_G['setting']['attachdir'].'album/'.$picdir.$albumid.'.jpg'))) { + if(ftpcmd('upload', 'album/'.$picdir.$albumid.'.jpg')) { + $setarr['picflag'] = 2; + @unlink($_G['setting']['attachdir'].'album/'.$picdir.$albumid.'.jpg'); + } + } + } else { + if($pic['status'] == 0) { + $setarr['pic'] = $pic['thumb'] ? getimgthumbname($pic['filepath']) : $pic['filepath']; + } + if($from > 1) { + $setarr['picflag'] = $pic['remote'] ? 4:3; + } else { + $setarr['picflag'] = $pic['remote'] ? 2:1; + } + } + $setarr['updatetime'] = $_G['timestamp']; + C::t('home_album')->update($albumid, $setarr); + return true; +} + +function pic_save($FILE, $albumid, $title, $iswatermark = true, $catid = 0) { + global $_G, $space; + + if($albumid<0) $albumid = 0; + + $allowpictype = array('jpg','jpeg','gif','png'); + + $upload = new discuz_upload(); + $upload->init($FILE, 'album'); + + if($upload->error()) { + return lang('spacecp', 'lack_of_access_to_upload_file_size'); + } + + if(!$upload->attach['isimage']) { + return lang('spacecp', 'only_allows_upload_file_types'); + } + $oldgid = $_G['groupid']; + if(empty($space)) { + $_G['member'] = $space = getuserbyuid($_G['uid']); + $_G['username'] = $space['username']; + $_G['groupid'] = $space['groupid']; + } + $_G['member'] = $space; + + loadcache('usergroup_'.$space['groupid'], $oldgid != $_G['groupid'] ? true : false); + $_G['group'] = $_G['cache']['usergroup_'.$space['groupid']]; + + if(!checkperm('allowupload')) { + return lang('spacecp', 'not_allow_upload'); + } + + if(!cknewuser(1)) { + if($_G['setting']['newbiespan'] && $_G['timestamp'] - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60) { + return lang('message', 'no_privilege_newbiespan', array('newbiespan' => $_G['setting']['newbiespan'])); + } + + if($_G['setting']['need_avatar'] && empty($_G['member']['avatarstatus'])) { + return lang('message', 'no_privilege_avatar'); + } + + if($_G['setting']['need_secmobile'] && empty($_G['member']['secmobilestatus'])) { + return lang('message', 'no_privilege_secmobile'); + } + + if($_G['setting']['need_email'] && empty($_G['member']['emailstatus'])) { + return lang('message', 'no_privilege_email'); + } + + if($_G['setting']['need_friendnum']) { + space_merge($_G['member'], 'count'); + if($_G['member']['friends'] < $_G['setting']['need_friendnum']) { + return lang('message', 'no_privilege_friendnum', array('friendnum' => $_G['setting']['need_friendnum'])); + } + } + } + if($_G['group']['maximagesize'] && $upload->attach['size'] > $_G['group']['maximagesize']) { + return lang('spacecp', 'files_can_not_exceed_size', array('extend' => $upload->attach['ext'], 'size' => sizecount($_G['group']['maximagesize']))); + } + + $maxspacesize = checkperm('maxspacesize'); + if($maxspacesize) { + space_merge($space, 'count'); + space_merge($space, 'field_home'); + if($space['attachsize'] + $upload->attach['size'] > $maxspacesize + $space['addsize'] * 1024 * 1024) { + return lang('spacecp', 'inadequate_capacity_space'); + } + } + + $showtip = true; + $albumfriend = 0; + if($albumid) { + $catid = intval($catid); + $albumid = album_creat_by_id($albumid, $catid); + } else { + $albumid = 0; + $showtip = false; + } + + $upload->save(); + if($upload->error()) { + return lang('spacecp', 'mobile_picture_temporary_failure'); + } + if(!$upload->attach['imageinfo'] || !in_array($upload->attach['imageinfo']['2'], array(1,2,3,6))) { + @unlink($upload->attach['target']); + return lang('spacecp', 'only_allows_upload_file_types'); + } + + $new_name = $upload->attach['target']; + + require_once libfile('class/image'); + $image = new image(); + $result = $image->Thumb($new_name, '', 140, 140, 1); + $thumb = empty($result)?0:1; + + if($_G['setting']['maxthumbwidth'] && $_G['setting']['maxthumbheight']) { + if($_G['setting']['maxthumbwidth'] < 300) $_G['setting']['maxthumbwidth'] = 300; + if($_G['setting']['maxthumbheight'] < 300) $_G['setting']['maxthumbheight'] = 300; + $image->Thumb($new_name, '', $_G['setting']['maxthumbwidth'], $_G['setting']['maxthumbheight'], 1, 1); + } + + if ($iswatermark) { + $image->Watermark($new_name, '', 'album'); + } + $pic_remote = 0; + $album_picflag = 1; + + if(ftpperm($upload->attach['ext'], $upload->attach['size'])) { + $ftpresult_thumb = 0; + $ftpresult = ftpcmd('upload', 'album/'.$upload->attach['attachment']); + if($ftpresult) { + @unlink($_G['setting']['attachdir'].'album/'.$upload->attach['attachment']); + if($thumb) { + $thumbpath = getimgthumbname($upload->attach['attachment']); + ftpcmd('upload', 'album/'.$thumbpath); + @unlink($_G['setting']['attachdir'].'album/'.$thumbpath); + } + $pic_remote = 1; + $album_picflag = 2; + } else { + if(getglobal('setting/ftp/mirror')) { + @unlink($upload->attach['target']); + @unlink(getimgthumbname($upload->attach['target'])); + return lang('spacecp', 'ftp_upload_file_size'); + } + } + } + + $title = getstr($title, 200); + $title = censor($title, NULL, TRUE, FALSE); + if(is_array($title)) { + return lang('message', 'word_banned'); + } + if(censormod($title) || $_G['group']['allowuploadmod']) { + $pic_status = 1; + } else { + $pic_status = 0; + } + + $setarr = array( + 'albumid' => $albumid, + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => $_G['timestamp'], + 'filename' => addslashes($upload->attach['name']), + 'postip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'title' => $title, + 'type' => addslashes($upload->attach['ext']), + 'size' => $upload->attach['size'], + 'filepath' => $upload->attach['attachment'], + 'thumb' => $thumb, + 'remote' => $pic_remote, + 'status' => $pic_status, + ); + $setarr['picid'] = C::t('home_pic')->insert($setarr, 1); + + C::t('common_member_count')->increase($_G['uid'], array('attachsize' => $upload->attach['size'])); + + include_once libfile('function/stat'); + if($pic_status) { + updatemoderate('picid', $setarr['picid']); + } + updatestat('pic'); + + return $setarr; +} + +function stream_save($strdata, $albumid = 0, $fileext = 'jpg', $name='', $title='', $delsize=0, $from = false) { + global $_G, $space; + + if($albumid<0) $albumid = 0; + $allowPicType = array('jpg','jpeg','gif','png'); + if(!in_array($fileext, $allowPicType)) { + return -3; + } + $setarr = array(); + + $upload = new discuz_upload(); + + $filepath = $upload->get_target_dir('album').$upload->get_target_filename('album').'.'.$fileext; + $newfilename = $_G['setting']['attachdir'].'./album/'.$filepath; + + if($handle = fopen($newfilename, 'wb')) { + if(fwrite($handle, $strdata) !== FALSE) { + fclose($handle); + + $size = filesize($newfilename); + + if(empty($space)) { + $_G['member'] = $space = getuserbyuid($_G['uid']); + $_G['username'] = $space['username']; + } + $_G['member'] = $space; + loadcache('usergroup_'.$space['groupid']); + $_G['group'] = $_G['cache']['usergroup_'.$space['groupid']]; + + $maxspacesize = checkperm('maxspacesize'); + if($maxspacesize) { + + space_merge($space, 'count'); + space_merge($space, 'field_home'); + + if($space['attachsize'] + $size - $delsize > $maxspacesize + $space['addsize'] * 1024 * 1024) { + @unlink($newfilename); + return -1; + } + } + + if(!$upload->get_image_info($newfilename)) { + @unlink($newfilename); + return -2; + } + + require_once libfile('class/image'); + $image = new image(); + $result = $image->Thumb($newfilename, NULL, 140, 140, 1); + $thumb = empty($result)?0:1; + + $image->Watermark($newfilename); + + $pic_remote = 0; + $album_picflag = 1; + + if(ftpperm($fileext, filesize($_G['setting']['attachdir'].'album/'.$filepath))) { + $ftpresult_thumb = 0; + $ftpresult = ftpcmd('upload', 'album/'.$filepath); + if($ftpresult) { + @unlink($_G['setting']['attachdir'].'album/'.$filepath); + if($thumb) { + $thumbpath = getimgthumbname($filepath); + ftpcmd('upload', 'album/'.$thumbpath); + @unlink($_G['setting']['attachdir'].'album/'.$thumbpath); + } + $pic_remote = 1; + $album_picflag = 2; + } else { + if(getglobal('setting/ftp/mirror')) { + @unlink($newfilename); + @unlink(getimgthumbname($newfilename)); + return -3; + } + } + } + + $filename = $name ? $name : substr(strrchr($filepath, '/'), 1); + $title = getstr($title, 200); + $title = censor($title, NULL, TRUE, FALSE); + if(is_array($title)) { + return lang('message', 'word_banned'); + } + if(censormod($title) || $_G['group']['allowuploadmod']) { + $pic_status = 1; + } else { + $pic_status = 0; + } + + if($albumid) { + $albumid = album_creat_by_id($albumid); + } else { + $albumid = 0; + } + + $setarr = array( + 'albumid' => $albumid, + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => $_G['timestamp'], + 'filename' => $filename, + 'postip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'title' => $title, + 'type' => $fileext, + 'size' => $size, + 'filepath' => $filepath, + 'thumb' => $thumb, + 'remote' => $pic_remote, + 'status' => $pic_status, + ); + $setarr['picid'] = C::t('home_pic')->insert($setarr, 1); + + C::t('common_member_count')->increase($_G['uid'], array('attachsize' => $size)); + + include_once libfile('function/stat'); + updatestat('pic'); + + return $setarr; + } else { + fclose($handle); + } + } + return -3; +} + +function album_creat($arr) { + global $_G; + + $albumid = C::t('home_album')->fetch_albumid_by_albumname_uid($arr['albumname'], $_G['uid']); + if($albumid) { + return $albumid; + } else { + $arr['uid'] = $_G['uid']; + $arr['username'] = $_G['username']; + $arr['dateline'] = $arr['updatetime'] = $_G['timestamp']; + $albumid = C::t('home_album')->insert($arr, TRUE); + + C::t('common_member_count')->increase($_G['uid'], array('albums' => 1)); + if(isset($arr['catid']) && $arr['catid']) { + C::t('home_album_category')->update_num_by_catid('1', $arr['catid']); + } + + return $albumid; + } +} + +function getfilepath($fileext, $mkdir=false) { + global $_G; + + $filepath = "{$_G['uid']}_{$_G['timestamp']}".random(4).".$fileext"; + $name1 = gmdate('Ym'); + $name2 = gmdate('j'); + + if($mkdir) { + $newfilename = $_G['setting']['attachdir'].'./album/'.$name1; + if(!is_dir($newfilename)) { + if(!@mkdir($newfilename)) { + runlog('error', "DIR: $newfilename can not make"); + return $filepath; + } + } + $newfilename .= '/'.$name2; + if(!is_dir($newfilename)) { + if(!@mkdir($newfilename)) { + runlog('error', "DIR: $newfilename can not make"); + return $name1.'/'.$filepath; + } + } + } + return $name1.'/'.$name2.'/'.$filepath; +} + +function getalbumpic($uid, $id) { + global $_G; + + $pic = C::t('home_pic')->fetch_album_pic($id, $uid); + if($pic) { + return $pic['thumb'] ? getimgthumbname($pic['filepath']) : $pic['filepath']; + } else { + return ''; + } +} + +function getclassarr($uid) { + global $_G; + + $classarr = array(); + $query = C::t('home_class')->fetch_all_by_uid($uid); + foreach($query as $value) { + $classarr[$value['classid']] = $value; + } + return $classarr; +} + +function getalbums($uid) { + global $_G; + + $albums = array(); + $query = C::t('home_album')->fetch_all_by_uid($uid, 'albumid'); + foreach($query as $value) { + $albums[$value['albumid']] = $value; + } + return $albums; +} + +function hot_update($idtype, $id, $hotuser) { + global $_G; + + $hotusers = empty($hotuser)?array():explode(',', $hotuser); + if($hotusers && in_array($_G['uid'], $hotusers)) { + return false; + } else { + $hotusers[] = $_G['uid']; + $hotuser = implode(',', $hotusers); + } + $hotuser = daddslashes($hotuser); + $newhot = count($hotusers)+1; + if($newhot == $_G['setting']['feedhotmin']) { + $tablename = gettablebyidtype($idtype); + if($tablename) { + $item = C::t($tablename)->fetch_by_id_idtype($id); + $itemuid = $item['uid']; + updatecreditbyaction('hotinfo', $itemuid); + } + } + + switch ($idtype) { + case 'blogid': + C::t('home_blogfield')->update($id, array('hotuser' => $hotuser)); + C::t('home_blog')->increase($id, 0, array('hot' => 1)); + break; + case 'picid': + C::t('home_picfield')->insert(array('picid' => $id, 'hotuser' => $hotuser), 0, 1); + C::t('home_pic')->update_hot($id); + break; + case 'sid': + C::t('home_share')->update_hot_by_sid($id, $hotuser); + break; + default: + return false; + } + if($feed = C::t('home_feed')->fetch_feed($id, $idtype)) { + if(empty($feed['friend'])) { + C::t('home_feed')->update_hot_by_feedid($feed['feedid'], 1); + } + } elseif($idtype == 'picid') { + require_once libfile('function/feed'); + feed_publish($id, $idtype); + } + + return true; +} + +function gettablebyidtype($idtype) { + $tablename = ''; + if($idtype == 'blogid') { + $tablename = 'home_blog'; + } elseif($idtype == 'picid') { + $tablename = 'home_pic'; + } elseif($idtype == 'sid') { + $tablename = 'home_share'; + } + return $tablename; +} + +function privacy_update() { + global $_G, $space; + + C::t('common_member_field_home')->update($_G['uid'], array('privacy'=>serialize($space['privacy']))); +} + +function ckrealname($return=0) { + global $_G; + + $result = true; + if($_G['adminid'] != 1 && $_G['setting']['verify'][6]['available'] && empty($_G['setting']['verify'][6]['viewrealname'])) { + space_merge($_G['member'], 'profile'); + space_merge($_G['member'], 'verify'); + if(empty($_G['member']['realname']) || !$_G['member']['verify6']) { + if(empty($return)) showmessage('no_privilege_realname', '', array(), array('return' => true)); + $result = false; + } + } + return $result; +} + +function isblacklist($touid) { + global $_G; + + return C::t('home_blacklist')->count_by_uid_buid($touid, $_G['uid']); +} + +function emailcheck_send($uid, $email) { + global $_G; + + if($uid && $email) { + $memberauthstr = C::t('common_member_field_forum')->fetch($uid); + if(!empty($memberauthstr['authstr'])) { + list($dateline) = explode("\t", $memberauthstr['authstr']); + $interval = $_G['setting']['mailinterval'] > 0 ? (int)$_G['setting']['mailinterval'] : 300; + if($dateline && $dateline > TIMESTAMP - $interval) { + return false; + } + } + $timestamp = $_G['timestamp']; + $idstring = substr(md5($email), 0, 6); + C::t('common_member_field_forum')->update($uid, array('authstr' => "$timestamp\t3\t$idstring")); + + $hash = authcode("$uid\t$email\t$timestamp", 'ENCODE', md5(substr(md5($_G['config']['security']['authkey']), 0, 16))); + $verifyurl = $_G['setting']['securesiteurl'].'home.php?mod=misc&ac=emailcheck&hash='.urlencode($hash); + $mailmessage = array( + 'tpl' => 'email_verify', + 'var' => array( + 'username' => $_G['member']['username'], + 'bbname' => $_G['setting']['bbname'], + 'siteurl' => $_G['setting']['securesiteurl'], + 'url' => $verifyurl + ) + ); + + require_once libfile('function/mail'); + if(!sendmail($email, $mailmessage)) { + runlog('sendmail', "$email sendmail failed."); + } + } + return true; +} + +function picurl_get($picurl, $maxlenth='200') { + $picurl = dhtmlspecialchars(trim($picurl)); + if($picurl) { + if(preg_match("/^http\:\/\/.{5,$maxlenth}\.(jpg|gif|png)$/i", $picurl)) return $picurl; + } + return ''; +} + +function avatar_file($uid, $size) { + global $_G; + + $var = "home_avatarfile_{$uid}_{$size}"; + if(empty($_G[$var])) { + $uid = abs(intval($uid)); + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + $_G[$var] = $dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2)."_avatar_$size.jpg"; + } + return $_G[$var]; +} + +function makepokeaction($iconid) { + global $_G; + $icons = array( + 0 => lang('home/template', 'say_hi'), + 1 => 'cyx '.lang('home/template', 'poke_1'), + 2 => 'wgs '.lang('home/template', 'poke_2'), + 3 => 'wx '.lang('home/template', 'poke_3'), + 4 => 'jy '.lang('home/template', 'poke_4'), + 5 => 'pmy '.lang('home/template', 'poke_5'), + 6 => 'yb '.lang('home/template', 'poke_6'), + 7 => 'fw '.lang('home/template', 'poke_7'), + 8 => 'nyy '.lang('home/template', 'poke_8'), + 9 => 'gyq '.lang('home/template', 'poke_9'), + 10 => 'dyx '.lang('home/template', 'poke_10'), + 11 => 'yw '.lang('home/template', 'poke_11'), + 12 => 'ppjb '.lang('home/template', 'poke_12'), + 13 => 'yyk '.lang('home/template', 'poke_13') + ); + return isset($icons[$iconid]) ? $icons[$iconid] : $icons[0]; +} + +function interval_check($type) { + global $_G; + + $waittime = 0; + if(checkperm('disablepostctrl')) { + return $waittime; + } + if($_G['setting']['floodctrl']) { + space_merge($_G['member'], 'status'); + getuserprofile('lastpost'); + $waittime = $_G['setting']['floodctrl'] - ($_G['timestamp'] - $_G['member']['lastpost']); + } + return $waittime; +} + +function geturltitle($link, $charset = '') { + $title = $linkcharset = ''; + $linkstr = gzfile($link); + $linkstr = implode('', $linkstr); + if(!$charset) { + preg_match('/]*charset="?(.*)"/i', $linkstr, $linkcharset); + $charset = strtolower($linkcharset[1]); + } + if(!$charset) { + return $title; + } + if($charset != strtolower(CHARSET)) { + $linkstr = diconv($linkstr, $charset); + } + if(!empty($linkstr) && preg_match('/\(.*)\<\/title\>/i', $linkstr, $title)) { + $tmptitle = explode('_', $title[1]); + if($title[1] == $tmptitle[0]) { + $tmptitle = explode('-', $title[1]); + } + $title = trim($tmptitle[0]); + } + return $title; +} + +function allowverify($vid = 0) { + global $_G; + + if(empty($_G['setting']['verify'])) { + loadcache('setting'); + } + $allow = false; + $vid = 0 < $vid && $vid < 8 ? intval($vid) : 0; + if($vid) { + $setting = $_G['setting']['verify'][$vid]; + if($setting['available'] && (empty($setting['groupid']) || in_array($_G['groupid'], $setting['groupid']))) { + $allow = true; + } + } else { + foreach($_G['setting']['verify'] as $key => $setting) { + if($setting['available'] && (empty($setting['groupid']) || in_array($_G['groupid'], $setting['groupid']))) { + $allow = true; + break; + } + } + } + return $allow; +} +?> \ No newline at end of file diff --git a/source/function/function_stat.php b/source/function/function_stat.php new file mode 100644 index 0000000..e537aa3 --- /dev/null +++ b/source/function/function_stat.php @@ -0,0 +1,21 @@ +updatestat($uid, $type, $primary, $num); +} + +?> \ No newline at end of file diff --git a/source/function/function_threadsort.php b/source/function/function_threadsort.php new file mode 100644 index 0000000..ceca5d4 --- /dev/null +++ b/source/function/function_threadsort.php @@ -0,0 +1,773 @@ +'; + } elseif($option['type'] == 'image') { + $showoption[$option['identifier']]['value'] = ' + '. + ($optionvalue['value']['aid'] ? '' : ''). + ' +
          '; + + if($optionvalue['value']['url']) { + $showoption[$option['identifier']]['value'] .= ''; + } + + $showoption[$option['identifier']]['value'] .= '
          '; + + } else { + $showoption[$option['identifier']]['value'] = ''; + } + } elseif(in_array($option['type'], array('radio', 'checkbox', 'select'))) { + if($option['type'] == 'select') { + if(empty($optionvalue['value'])) { + $showoption[$option['identifier']]['value'] = ''; + } else { + foreach($optionvalue['value'] as $selectedkey => $selectedvalue) { + $showoption[$option['identifier']]['value'] = ''; + } + } + } elseif($option['type'] == 'radio') { + foreach($option['choices'] as $id => $value) { + $showoption[$option['identifier']]['value'] .= ''.$value.''; + } + } elseif($option['type'] == 'checkbox') { + foreach($option['choices'] as $id => $value) { + $showoption[$option['identifier']]['value'] .= ''.$value.''; + } + } + } elseif(in_array($option['type'], array('textarea'))) { + $showoption[$option['identifier']]['value'] = ''; + } + + return $showoption; + +} + +function quicksearch($sortoptionarray) { + global $_G; + + $quicksearch = array(); + if($sortoptionarray) { + foreach($sortoptionarray as $optionid => $option) { + if($option['search']) { + $quicksearch[$optionid]['title'] = $option['title']; + $quicksearch[$optionid]['identifier'] = $option['identifier']; + $quicksearch[$optionid]['unit'] = $option['unit']; + $quicksearch[$optionid]['type'] = $option['type']; + $quicksearch[$optionid]['search'] = $option['search']; + if(in_array($option['type'], array('radio', 'select', 'checkbox'))) { + $quicksearch[$optionid]['choices'] = $option['choices']; + } elseif(!empty($option['searchtxt'])) { + $choices = array(); + $prevs = 'd'; + foreach($option['searchtxt'] as $choice) { + $value = "$prevs|$choice"; + if($choice) { + $quicksearch[$optionid]['choices'][$value] = $prevs == 'd' ? lang('forum/misc', 'lower').$choice.$option['unit'] : $prevs.'-'.$choice.$option['unit']; + $prevs = $choice; + } + $max = $choice; + } + $value = "u|$choice"; + $quicksearch[$optionid]['choices'][$value] .= lang('forum/misc', 'higher').$max.$option['unit']; + } + } + } + } + + return $quicksearch; +} + +function sortsearch($sortid, $sortoptionarray, $searchoption = array(), $selecturladd = array(), $sortfid = 0) { + global $_G; + $sortid = intval($sortid); + $selectsql = ''; + $optionide = $searchsorttids = array(); + + if($selecturladd) { + foreach($sortoptionarray[$sortid] as $optionid => $option) { + if(in_array($option['type'], array('checkbox', 'radio', 'select', 'range'))) { + $optionide[$option['identifier']] = $option['type']; + } + } + + foreach($selecturladd as $fieldname => $value) { + if($optionide[$fieldname] && $value != 'all') { + if($optionide[$fieldname] == 'range') { + $value = explode('|', $value); + if($value[0] == 'd') { + $sql = "$fieldname<".intval($value[1]); + } elseif($value[0] == 'u') { + $sql = "$fieldname>".intval($value[1]); + } else { + $sql = "($fieldname BETWEEN ".intval($value[0])." AND ".intval($value[1]).")"; + } + } elseif($optionide[$fieldname] == 'checkbox') { + $sql = '('.DB::field($fieldname, $value). + ' OR '.DB::field($fieldname, "$value\t%", 'like'). + ' OR '.DB::field($fieldname, "%\t$value", 'like'). + ' OR '.DB::field($fieldname, "%\t$value\t%", 'like').')'; + } elseif($optionide[$fieldname] == 'select') { + $subvalues = $currentchoices = array(); + if(!empty($_G['forum_optionlist'])) { + foreach($_G['forum_optionlist'] as $subkey => $subvalue) { + if($subvalue['identifier'] == $fieldname) { + $currentchoices = $subvalue['choices']; + break; + } + } + } + if(!empty($currentchoices)) { + foreach($currentchoices as $subkey => $subvalue) { + if(preg_match('/^'.$value.'\.'.'/i', $subkey) || preg_match('/^'.$value.'$'.'/i', $subkey)) { + $subvalues[] = $subkey; + } + } + } + $sql = DB::field($fieldname, $subvalues); + } else { + $sql = DB::field($fieldname, $value); + } + $selectsql .= "AND $sql "; + } + } + } + + if(!empty($searchoption) && is_array($searchoption)) { + foreach($searchoption as $optionid => $option) { + $fieldname = $sortoptionarray[$sortid][$optionid]['identifier'] ? $sortoptionarray[$sortid][$optionid]['identifier'] : 1; + if($option['value']) { + if(in_array($option['type'], array('number', 'radio'))) { + $option['value'] = intval($option['value']); + $exp = '='; + if($option['condition']) { + $exp = $option['condition'] == 1 ? '>' : '<'; + } + $sql = DB::field($fieldname, $option['value'], $exp); + } elseif($option['type'] == 'select') { + $subvalues = $currentchoices = array(); + if(!empty($_G['forum_optionlist'])) { + foreach($_G['forum_optionlist'] as $subkey => $subvalue) { + if($subvalue['identifier'] == $fieldname) { + $currentchoices = $subvalue['choices']; + break; + } + } + } + if(!empty($currentchoices)) { + foreach($currentchoices as $subkey => $subvalue) { + if(preg_match('/^'.$option['value'].'/i', $subkey)) { + $subvalues[] = $subkey; + } + } + } + $sql = DB::field($fieldname, $subvalues); + } elseif($option['type'] == 'checkbox') { + $sql = DB::field($fieldname, '%'.implode('%', $option['value']).'%', 'like'); + } elseif($option['type'] == 'range') { + $value = explode('|', $option['value']); + if($value[0] == 'd') { + $sql = "$fieldname<".intval($value[1]); + } elseif($value[0] == 'u') { + $sql = "$fieldname>".intval($value[1]); + } else { + $sql = $value[0] || $value[1] ? "($fieldname BETWEEN ".intval($value[0])." AND ".intval($value[1]).")" : ''; + } + } else { + $sql = DB::field($fieldname, '%'.$option['value'].'%', 'like'); + } + $selectsql .= "AND $sql "; + } + } + } + + $searchsorttids = C::t('forum_optionvalue')->fetch_all_tid($sortid, "WHERE 1 $selectsql ".($sortfid ? "AND fid='$sortfid'" : '')); + + return $searchsorttids; + +} + +function showsorttemplate($sortid, $fid, $sortoptionarray, $templatearray, $threadlist, $threadids = array(), $sortmode = false) { + global $_G; + + $searchtitle = $searchvalue = $searchunit = $stemplate = $searchtids = $sortlistarray = $skipaids = $sortdata = array(); + + $sortthreadlist = array(); + foreach(C::t('forum_typeoptionvar')->fetch_all_by_search($sortid, $fid, $threadids) as $sortthread) { + $optionid = $sortthread['optionid']; + $sortid = $sortthread['sortid']; + $tid = $sortthread['tid']; + $arrayoption = $sortoptionarray[$sortid][$optionid]; + if($sortoptionarray[$sortid][$optionid]['subjectshow']) { + $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['title'] = $arrayoption['title']; + $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['unit'] = $arrayoption['unit']; + if(in_array($arrayoption['type'], array('radio', 'checkbox', 'select'))) { + if($arrayoption['type'] == 'checkbox') { + foreach(explode("\t", $sortthread['value']) as $choiceid) { + $sortthreadlist[$tid][$arrayoption['title']] .= $arrayoption['choices'][$choiceid].' '; + $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['value'] .= $arrayoption['choices'][$choiceid].' '; + } + } elseif($arrayoption['type'] == 'select') { + $sortthreadlist[$tid][$arrayoption['title']] = $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['value'] = $arrayoption['choices'][$sortthread['value']]['content']; + } else { + $sortthreadlist[$tid][$arrayoption['title']] = $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['value'] = $arrayoption['choices'][$sortthread['value']]; + } + } elseif($arrayoption['type'] == 'image') { + $imgoptiondata = dunserialize($sortthread['value']); + if(empty($templatearray[$sortid])) { + $maxwidth = $arrayoption['maxwidth'] ? 'width="'.$arrayoption['maxwidth'].'"' : ''; + $maxheight = $arrayoption['maxheight'] ? 'height="'.$arrayoption['maxheight'].'"' : ''; + $sortthreadlist[$tid][$arrayoption['title']] = $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['value'] = $imgoptiondata['url'] ? "" : ''; + } else { + $sortthread['value'] = ''; + if($imgoptiondata['aid']) { + $sortthread['value'] = getforumimg($imgoptiondata['aid'], 0, 300, 300); + } elseif($imgoptiondata['url']) { + $sortthread['value'] = $imgoptiondata['url']; + } + $sortthreadlist[$tid][$arrayoption['title']] = $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['value'] = $sortthread['value'] ? $sortthread['value'] : STATICURL.'image/common/nophotosmall.gif'; + } + } else { + $sortthreadlist[$tid][$arrayoption['title']] = $_G['optionvaluelist'][$sortid][$tid][$arrayoption['identifier']]['value'] = $sortthread['value'] ? $sortthread['value'] : $arrayoption['defaultvalue']; + } + $sortthreadlist[$tid]['sortid'] = $sortid; + $sortthreadlist[$tid]['expiration'] = $sortthread['expiration'] && $sortthread['expiration'] <= TIMESTAMP ? 1 : 0; + } + } + + if($templatearray && $sortthreadlist) { + foreach($threadlist as $thread) { + $thread['digest'] = $thread['digest'] ? ' ' : ''; + if($thread['highlight']) { + $thread['subject'] = ''.$thread['subject'].''; + } + if($thread['digest']) { + $thread['subject'] .= ' '.$thread['digest']; + } + $sortdata[$thread['tid']]['subject'] = !$sortmode ? ''.$thread['subject'].'' : $thread['subject']; + $sortdata[$thread['tid']]['author'] = ''.$thread['author'].''; + } + + foreach($sortoptionarray as $sortid => $optionarray) { + foreach($optionarray as $option) { + if($option['subjectshow']) { + $searchtitle[$sortid][] = '/{('.$option['identifier'].')}/'; + $searchvalue[$sortid][] = '/\[('.$option['identifier'].')value\]/'; + $searchvalue[$sortid][] = '/{('.$option['identifier'].')_value}/'; + $searchunit[$sortid][] = '/\[('.$option['identifier'].')unit\]/'; + $searchunit[$sortid][] = '/{('.$option['identifier'].')_unit}/'; + } + } + } + + foreach($sortthreadlist as $tid => $option) { + $sortid = $option['sortid']; + $sortexpiration[$sortid][$tid] = $option['expiration']; + $stemplate[$sortid][$tid] = preg_replace( + array("/\{sortname\}/i", "/\{author\}/i", "/\{subject\}/i", "/\[url\](.+?)\[\/url\]/i"), + array( + ''.$_G['forum']['threadsorts']['types'][$sortid].'', + $sortdata[$tid]['author'], + $sortdata[$tid]['subject'], + "\\1" + ), stripslashes($templatearray[$sortid])); + $stemplate[$sortid][$tid] = preg_replace_callback( + $searchtitle[$sortid], + function ($matches) use ($tid, $sortid) { + return showlistoption($matches[1], 'title', intval($tid), intval($sortid)); + }, + $stemplate[$sortid][$tid] + ); + $stemplate[$sortid][$tid] = preg_replace_callback( + $searchvalue[$sortid], + function ($matches) use ($tid, $sortid) { + return showlistoption($matches[1], 'value', intval($tid), intval($sortid)); + }, + $stemplate[$sortid][$tid] + ); + $stemplate[$sortid][$tid] = preg_replace_callback( + $searchunit[$sortid], + function ($matches) use ($tid, $sortid) { + return showlistoption($matches[1], 'unit', intval($tid), intval($sortid)); + }, + $stemplate[$sortid][$tid] + ); + } + } + + $sortlistarray['template'] = $stemplate; + $sortlistarray['expiration'] = $sortexpiration; + + return $sortlistarray; +} + +function showsortmodetemplate($sortid, $fid, $sortoptionarray, $templatearray, $threadlist, $threadids = array(), &$verify = array()) { + global $_G; + $sorttemplate = $replaces = array(); + $sorttemplate['footer'] = $sorttemplate['body'] = $sorttemplate['header'] = ''; + if(strexists($templatearray[$sortid], '[loop]') && strexists($templatearray[$sortid], '[/loop]')) { + preg_match('/^(.+?)\[loop\](.+?)\[\/loop\](.+?)$/s', $templatearray[$sortid], $r); + $sorttemplate['header'] = stripslashes($r[1]); + $templatearray[$sortid] = stripslashes($r[2]); + $sorttemplate['footer'] = stripslashes($r[3]); + } + $rewritespace = is_array($_G['setting']['rewritestatus']) && in_array('home_space', $_G['setting']['rewritestatus']); + $rewriteviewthread = is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus']); + $sortlistarray = showsorttemplate($sortid, $fid, $sortoptionarray, $templatearray, $threadlist, $threadids, true); + foreach($threadlist as $thread) { + foreach($thread as $k => $v) { + $replaces['{'.$k.'}'] = $v; + } + $body = $sortlistarray['template'][$sortid][$thread['tid']]; + $replaces['{author_url}'] = $rewritespace ? rewriteoutput('home_space', 1, '', $thread['authorid']) : 'home.php?mod=space&uid='.$thread['authorid']; + $replaces['{lastposter_url}'] = $rewritespace ? rewriteoutput('home_space', 1, '', '', $thread['lastposter']) : 'home.php?mod=space&username='.$thread['lastposterenc']; + $replaces['{subject_url}'] = $rewriteviewthread ? rewriteoutput('forum_viewthread', 1, '', $thread['tid']) : 'forum.php?mod=viewthread&tid='.$thread['tid']; + $replaces['{lastpost_url}'] = 'forum.php?mod=redirect&tid='.$thread['tid'].'&goto=lastpost#lastpost'; + $replaces['{lastpost_url}'] = 'forum.php?mod=redirect&tid='.$thread['tid'].'&goto=lastpost#lastpost'; + $replaces['{avatar_small}'] = avatar($thread['authorid'], 'small', true); + $replaces['{typename_url}'] = 'forum.php?mod=forumdisplay&fid='.$fid.'&filter=typeid&typeid='.$thread['tid']; + $replaces['{attachment}'] = ($thread['attachment'] == 2 ? '' : + ($thread['attachment'] == 1 ? '' : '')); + $replaces['{author_verify}'] = $verify[$thread['authorid']] ? $verify[$thread['authorid']] : ''; + if($_G['forum']['ismoderator']) { + if($thread['fid'] == $fid && $thread['displayorder'] <= 3 || $_G['adminid'] == 1) { + $replaces['{modcheck}'] = ''; + } else { + $replaces['{modcheck}'] = ''; + } + } else { + $replaces['{modcheck}'] = ''; + } + $body = str_replace(array_keys($replaces), $replaces, $body); + $sorttemplate['body'] .= $body; + } + return $sorttemplate; +} + +function showlistoption($var, $type, $tid, $sortid) { + global $_G; + if($_G['optionvaluelist'][$sortid][$tid][$var][$type]) { + return $_G['optionvaluelist'][$sortid][$tid][$var][$type]; + } else { + return ''; + } +} + +function threadsortshow($sortid, $tid) { + global $_G; + + loadcache(array('threadsort_option_'.$sortid, 'threadsort_template_'.$sortid)); + $sortoptionarray = $_G['cache']['threadsort_option_'.$sortid]; + $templatearray = $_G['cache']['threadsort_template_'.$sortid]; + $threadsortshow = $optiondata = $searchtitle = $searchvalue = $searchunit = $memberinfofield = $_G['forum_option'] = array(); + if($sortoptionarray) { + + foreach(C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tid) as $option) { + $optiondata[$option['optionid']]['value'] = $option['value']; + $optiondata[$option['optionid']]['expiration'] = $option['expiration'] && $option['expiration'] <= TIMESTAMP ? 1 : 0; + $sortdataexpiration = $option['expiration']; + } + + foreach($sortoptionarray as $optionid => $option) { + $_G['forum_option'][$option['identifier']]['title'] = $option['title']; + $_G['forum_option'][$option['identifier']]['unit'] = $option['unit']; + $_G['forum_option'][$option['identifier']]['type'] = $option['type']; + + if(($option['expiration'] && !$optiondata[$optionid]['expiration']) || empty($option['expiration'])) { + if(!protectguard($option['protect'])) { + if($option['type'] == 'checkbox') { + $_G['forum_option'][$option['identifier']]['value'] = ''; + foreach(explode("\t", $optiondata[$optionid]['value']) as $choiceid) { + $_G['forum_option'][$option['identifier']]['value'] .= $option['choices'][$choiceid].' '; + } + } elseif($option['type'] == 'radio') { + $_G['forum_option'][$option['identifier']]['value'] = $option['choices'][$optiondata[$optionid]['value']]; + } elseif($option['type'] == 'select') { + $tmpchoiceid = $tmpidentifiervalue = array(); + foreach(explode('.', $optiondata[$optionid]['value']) as $choiceid) { + $tmpchoiceid[] = $choiceid; + $tmpidentifiervalue[] = $option['choices'][implode('.', $tmpchoiceid)]; + } + $_G['forum_option'][$option['identifier']]['value'] = implode(' » ', $tmpidentifiervalue); + unset($tmpchoiceid, $tmpidentifiervalue); + } elseif($option['type'] == 'image') { + $imgoptiondata = dunserialize($optiondata[$optionid]['value']); + $threadsortshow['sortaids'][] = $imgoptiondata['aid']; + if(empty($templatearray['viewthread'])) { + $maxwidth = $option['maxwidth'] ? 'width="'.$option['maxwidth'].'"' : ''; + $maxheight = $option['maxheight'] ? 'height="'.$option['maxheight'].'"' : ''; + if(!defined('IN_MOBILE')) { + $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? "" : ''; + } else { + $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? "".lang('forum/misc', 'click_view')."" : ''; + } + } else { + $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? $imgoptiondata['url'] : STATICURL.'image/common/nophoto.gif'; + } + } elseif($option['type'] == 'url') { + $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? "".$optiondata[$optionid]['value']."" : ''; + } elseif($option['type'] == 'number') { + $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value']; + } else { + if($option['protect']['status'] && $optiondata[$optionid]['value']) { + $optiondata[$optionid]['value'] = $option['protect']['mode'] == 1 ? '' : (!defined('IN_MOBILE') ? ''.lang('forum/misc', 'click_view').'' : $optiondata[$optionid]['value']); + $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? $optiondata[$optionid]['value'] : $option['defaultvalue']; + } elseif($option['type'] == 'textarea') { + $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] != '' ? nl2br($optiondata[$optionid]['value']) : ''; + } else { + $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] != '' ? $optiondata[$optionid]['value'] : $option['defaultvalue']; + } + } + } else { + if(empty($option['permprompt'])) { + $_G['forum_option'][$option['identifier']]['value'] = lang('forum/misc', 'view_noperm'); + } else { + $_G['forum_option'][$option['identifier']]['value'] = $option['permprompt']; + } + + } + } else { + $_G['forum_option'][$option['identifier']]['value'] = lang('forum/misc', 'has_expired'); + } + } + + $typetemplate = ''; + if($templatearray['viewthread']) { + foreach($sortoptionarray as $option) { + $searchtitle[] = '/{('.$option['identifier'].')}/'; + $searchvalue[] = '/\[('.$option['identifier'].')value\]/'; + $searchvalue[] = '/{('.$option['identifier'].')_value}/'; + $searchunit[] = '/\[('.$option['identifier'].')unit\]/'; + $searchunit[] = '/{('.$option['identifier'].')_unit}/'; + } + + $threadexpiration = $sortdataexpiration ? dgmdate($sortdataexpiration) : lang('forum/misc', 'never_expired'); + $typetemplate = preg_replace(array("/\{expiration\}/i"), array($threadexpiration), stripslashes($templatearray['viewthread'])); + $typetemplate = preg_replace_callback($searchtitle, "threadsortshow_callback_showoption_title1", $typetemplate); + $typetemplate = preg_replace_callback($searchvalue, "threadsortshow_callback_showoption_value1", $typetemplate); + $typetemplate = preg_replace_callback($searchunit, "threadsortshow_callback_showoption_unit1", $typetemplate); + } + } + + $threadsortshow['optionlist'] = !$sortdataexpiration || $sortdataexpiration >= $_G['timestamp'] ? $_G['forum_option'] : 'expire'; + $threadsortshow['typetemplate'] = $typetemplate; + $threadsortshow['expiration'] = dgmdate($sortdataexpiration, 'd'); + + return $threadsortshow; +} + +function threadsortshow_callback_showoption_title1($matches) { + return showoption($matches[1], 'title'); +} + +function threadsortshow_callback_showoption_value1($matches) { + return showoption($matches[1], 'value'); +} + +function threadsortshow_callback_showoption_unit1($matches) { + return showoption($matches[1], 'unit'); +} + +function showoption($var, $type) { + global $_G; + if($_G['forum_option'][$var][$type] != '') { + return $_G['forum_option'][$var][$type]; + } else { + return ''; + } +} + +function protectguard($protect) { + global $_G, $member_verifys; + if(!isset($member_verifys) && $_G['setting']['verify']['enabled']) { + $member_verifys = array(); + getuserprofile('verify1'); + foreach($_G['setting']['verify'] as $vid => $verify) { + if($verify['available'] && $_G['member']['verify'.$vid] == 1) { + $member_verifys[] = $vid; + } + } + } + $verifyflag = 0; + if($_G['setting']['verify']['enabled'] && $protect['verify']) { + if(array_intersect(explode("\t", $protect['verify']), $member_verifys)) { + $verifyflag = 1; + } + } + if(($protect['usergroup'] && strstr("\t".$protect['usergroup']."\t", "\t{$_G['groupid']}\t")) + || (empty($protect['usergroup']) && empty($protect['verify'])) + || $verifyflag + || $_G['forum_thread']['authorid'] == $_G['uid']) { + return false; + } else { + return true; + } +} + +function sortthreadsortselectoption($sortid) { + global $_G; + + if(empty($_G['cache']['threadsort_option_'.$sortid])) { + return false; + } + foreach($_G['cache']['threadsort_option_'.$sortid] as $key => $value) { + if($value['type'] == 'select' && !empty($value['choices'])) { + $newsort = array(); + $level = 0; + + foreach((array)$value['choices'] as $subkey => $subvalue) { + + $newsort[$subkey]['content'] = $subvalue; + $newsort[$subkey]['foptionid'] = trim(substr($subkey, 0, strrpos($subkey, '.'))) ? trim(substr($subkey, 0, strrpos($subkey, '.'))) : '0'; + $newsort[$subkey]['count'] = count(explode('.', $subkey)); + + $subkeyarr = explode('.', $subkey); + if($countsubkeyarr = count($subkeyarr)) { + $tmpkey = ''; + for($i = 0;$i < $countsubkeyarr;$i++) { + $subkeyarr[$i] = trim($subkeyarr[$i]); + + if(isset($newsort[$tmpkey.$subkeyarr[$i]]['level'])) { + if(($countsubkeyarr - $i) > $newsort[$tmpkey.$subkeyarr[$i]]['level']) { + $newsort[$tmpkey.$subkeyarr[$i]]['level'] = $countsubkeyarr - $i; + } + } else { + $newsort[$tmpkey.$subkeyarr[$i]]['level'] = $countsubkeyarr - $i; + } + $tmpkey .= $subkeyarr[$i].'.'; + } + } + $newsort[$subkey]['optionid'] = $subkey; + } + $_G['cache']['threadsort_option_'.$sortid][$key]['choices'] = $newsort; + } + } +} + +function cmpchoicekey($stringa, $stringb) { + $arraya = explode('.', $stringa); + $arrayb = explode('.', $stringb); + $counta = count($arraya); + $countb = count($arrayb); + if($counta == $countb) { + foreach($arraya as $key => $value) { + $valuea = intval(trim($value)); + $valueb = intval(trim($arrayb[$key])); + if($valuea != $valueb) { + return ($valuea < $valueb) ? -1 : 1; + } else { + continue; + } + } + return 0; + } else { + return ($counta < $countb) ? -1 : 1; + } +} + +function threadsort_checkoption($sortid = 0, $unchangeable = 1) { + global $_G; + + $_G['forum_selectsortid'] = $sortid ? intval($sortid) : ''; + loadcache(array('threadsort_option_'.$sortid)); + sortthreadsortselectoption($sortid); + $_G['forum_optionlist'] = $_G['cache']['threadsort_option_'.$sortid]; + $_G['forum_checkoption'] = array(); + if(is_array($_G['forum_optionlist'])) { + foreach($_G['forum_optionlist'] as $optionid => $option) { + $_G['forum_checkoption'][$option['identifier']]['optionid'] = $optionid; + $_G['forum_checkoption'][$option['identifier']]['title'] = $option['title']; + $_G['forum_checkoption'][$option['identifier']]['type'] = $option['type']; + $_G['forum_checkoption'][$option['identifier']]['required'] = $option['required'] ? 1 : 0; + $_G['forum_checkoption'][$option['identifier']]['unchangeable'] = $_GET['action'] == 'edit' && $unchangeable && $option['unchangeable'] ? 1 : 0; + $_G['forum_checkoption'][$option['identifier']]['maxnum'] = $option['maxnum'] ? intval($option['maxnum']) : ''; + $_G['forum_checkoption'][$option['identifier']]['minnum'] = $option['minnum'] ? intval($option['minnum']) : ''; + $_G['forum_checkoption'][$option['identifier']]['maxlength'] = $option['maxlength'] ? intval($option['maxlength']) : ''; + } + } +} + +function threadsort_optiondata($pid, $sortid, $sortoptionarray, $templatearray) { + global $_G; + $_G['forum_optiondata'] = $_G['forum_typetemplate'] = $_G['forum_option'] = $_G['forum_memberinfo'] = $searchcontent = array(); + $id = $_G['tid']; + + if($id) { + foreach(C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($id) as $option) { + $_G['forum_optiondata'][$option['optionid']] = $option['value']; + $_G['forum_optiondata']['expiration'] = $option['expiration']; + } + } + + $_G['forum_optiondata']['expiration'] = $_G['forum_optiondata']['expiration'] ? dgmdate($_G['forum_optiondata']['expiration'], 'd') : ''; + + foreach($sortoptionarray as $optionid => $option) { + if($id) { + $_G['forum_optionlist'][$optionid]['unchangeable'] = $sortoptionarray[$optionid]['unchangeable'] ? 'disabled' : ''; + if($sortoptionarray[$optionid]['type'] == 'radio') { + $_G['forum_optionlist'][$optionid]['value'] = array($_G['forum_optiondata'][$optionid] => 'checked="checked"'); + } elseif($sortoptionarray[$optionid]['type'] == 'select') { + $_G['forum_optionlist'][$optionid]['value'] = $_G['forum_optiondata'][$optionid] ? array($_G['forum_optiondata'][$optionid] => 'selected="selected"') : ''; + } elseif($sortoptionarray[$optionid]['type'] == 'checkbox') { + foreach(explode("\t", $_G['forum_optiondata'][$optionid]) as $value) { + $_G['forum_optionlist'][$optionid]['value'][$value] = array($value => 'checked="checked"'); + } + } elseif($sortoptionarray[$optionid]['type'] == 'image') { + $_G['forum_optionlist'][$optionid]['value'] = dunserialize($_G['forum_optiondata'][$optionid]); + } else { + $_G['forum_optionlist'][$optionid]['value'] = $_G['forum_optiondata'][$optionid]; + } + if(!isset($_G['forum_optiondata'][$optionid])) { + C::t('forum_typeoptionvar')->insert(array( + 'sortid' => $sortid, + 'tid' => $id, + 'fid' => $_G['fid'], + 'optionid' => $optionid, + )); + } + } + + if($templatearray['post']) { + $_G['forum_option'][$option['identifier']]['title'] = $option['title']; + $_G['forum_option'][$option['identifier']]['unit'] = $option['unit']; + $_G['forum_option'][$option['identifier']]['description'] = $option['description']; + $_G['forum_option'][$option['identifier']]['required'] = $option['required'] ? '*' : ''; + $_G['forum_option'][$option['identifier']]['tips'] = ''; + + $showoption = gettypetemplate($option, $_G['forum_optionlist'][$optionid], $optionid); + $_G['forum_option'][$option['identifier']]['value'] = $showoption[$option['identifier']]['value']; + + $searchcontent['title'][] = '/{('.$option['identifier'].')}/'; + $searchcontent['value'][] = '/\[('.$option['identifier'].')value\]/'; + $searchcontent['value'][] = '/{('.$option['identifier'].')_value}/'; + $searchcontent['unit'][] = '/\[('.$option['identifier'].')unit\]/'; + $searchcontent['unit'][] = '/{('.$option['identifier'].')_unit}/'; + $searchcontent['description'][] = '/\[('.$option['identifier'].')description\]/'; + $searchcontent['description'][] = '/{('.$option['identifier'].')_description}/'; + $searchcontent['required'][] = '/\[('.$option['identifier'].')required\]/'; + $searchcontent['required'][] = '/{('.$option['identifier'].')_required}/'; + $searchcontent['tips'][] = '/\[('.$option['identifier'].')tips\]/'; + $searchcontent['tips'][] = '/{('.$option['identifier'].')_tips}/'; + } + } + + if($templatearray['post']) { + $typetemplate = $templatearray['post']; + foreach($searchcontent as $key => $content) { + $typetemplate = preg_replace_callback( + $searchcontent[$key], + function ($matches) use ($key) { + return showoption($matches[1], ''.addslashes($key).''); + }, + stripslashes($typetemplate) + ); + } + $_G['forum_typetemplate'] = $typetemplate; + } +} + +function threadsort_validator($sortoption, $pid) { + global $_G, $var; + $postaction = $_G['tid'] && $pid ? "edit&tid={$_G['tid']}&pid=$pid" : 'newthread'; + $_G['forum_optiondata'] = array(); + foreach($_G['forum_checkoption'] as $var => $option) { + if($_G['forum_checkoption'][$var]['required'] && ($sortoption[$var] === '' && $_G['forum_checkoption'][$var]['type'] != 'number')) { + showmessage('threadtype_required_invalid', "forum.php?mod=post&action=$postaction&fid={$_G['fid']}&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title'])); + } elseif($sortoption[$var] && ($_G['forum_checkoption'][$var]['type'] == 'number' && !is_numeric($sortoption[$var]) || $_G['forum_checkoption'][$var]['type'] == 'email' && !isemail($sortoption[$var]))){ + showmessage('threadtype_format_invalid', "forum.php?mod=post&action=$postaction&fid={$_G['fid']}&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title'])); + } elseif($sortoption[$var] && $_G['forum_checkoption'][$var]['maxlength'] && strlen($sortoption[$var]) > $_G['forum_checkoption'][$var]['maxlength']) { + showmessage('threadtype_toolong_invalid', "forum.php?mod=post&action=$postaction&fid={$_G['fid']}&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title'])); + } elseif($sortoption[$var] && (($_G['forum_checkoption'][$var]['maxnum'] && $sortoption[$var] > $_G['forum_checkoption'][$var]['maxnum']) || ($_G['forum_checkoption'][$var]['minnum'] && $sortoption[$var] < $_G['forum_checkoption'][$var]['minnum']))) { + showmessage('threadtype_num_invalid', "forum.php?mod=post&action=$postaction&fid={$_G['fid']}&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title'])); + } elseif($sortoption[$var] && $_G['forum_checkoption'][$var]['unchangeable'] && ($_G['tid'] && $pid)) { + showmessage('threadtype_unchangeable_invalid', "forum.php?mod=post&action=$postaction&fid={$_G['fid']}&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title'])); + } elseif($sortoption[$var] && ($_G['forum_checkoption'][$var]['type'] == 'select')) { + if($_G['forum_optionlist'][$_G['forum_checkoption'][$var]['optionid']]['choices'][$sortoption[$var]]['level'] != 1) { + showmessage('threadtype_select_invalid', "forum.php?mod=post&action=$postaction&fid={$_G['fid']}&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title'])); + } + } + if($_G['forum_checkoption'][$var]['type'] == 'checkbox') { + $sortoption[$var] = $sortoption[$var] ? implode("\t", $sortoption[$var]) : ''; + } elseif($_G['forum_checkoption'][$var]['type'] == 'url') { + $sortoption[$var] = $sortoption[$var] ? (substr(strtolower($sortoption[$var]), 0, 4) == 'www.' ? 'http://'.$sortoption[$var] : $sortoption[$var]) : ''; + } + + if($_G['forum_checkoption'][$var]['type'] == 'image') { + if($sortoption[$var]['aid']) { + $_GET['attachnew'][$sortoption[$var]['aid']] = $sortoption[$var]; + } + $sortoption[$var] = serialize($sortoption[$var]); + } elseif($_G['forum_checkoption'][$var]['type'] == 'select') { + $sortoption[$var] = censor(trim($sortoption[$var])); + } else { + $sortoption[$var] = dhtmlspecialchars(censor(trim($sortoption[$var]))); + } + $_G['forum_optiondata'][$_G['forum_checkoption'][$var]['optionid']] = $sortoption[$var]; + } + + return $_G['forum_optiondata']; +} + +function getsortedoptionlist() { + global $_G; + + $forum_optionlist = $_G['forum_optionlist']; + foreach($_G['forum_optionlist'] as $key => $value) { + if(is_array($value['choices'])) { + $choicesarr = $value['choices']; + uksort($choicesarr, 'cmpchoicekey'); + $forum_optionlist[$key]['choices'] = $choicesarr; + } + } + $forum_optionlist = optionlistxml($forum_optionlist, 's'); + $forum_optionlist = ''."".''.$forum_optionlist.''; + return $forum_optionlist; +} + +function optionlistxml($input, $pre = '') { + $str = ''; + foreach($input as $key => $value) { + $key = $pre.strval($key); + if(is_array($value)) { + $str .= "<$key>"; + $str .= optionlistxml($value, $pre); + $str .=""; + } else { + if(is_bool($value)) { + $value = ($value == true) ? 'true' : 'false'; + } + $value = str_replace("\r\n", '
          ', $value); + if(dhtmlspecialchars($value) != $value) { + $str .= "<$key>"; + } else { + $str .= "<$key>$value"; + } + } + } + return $str; +} + +?> \ No newline at end of file diff --git a/source/function/function_trade.php b/source/function/function_trade.php new file mode 100644 index 0000000..76e7262 --- /dev/null +++ b/source/function/function_trade.php @@ -0,0 +1,123 @@ + array(4,8), + 1 => array(4,8), + 5 => array(7,10), + 11 => array(10,7), + 12 => array(13) + ); + $tmp = $data[$tradelog['status']]; + } elseif($_G['uid'] == $tradelog['sellerid']) { + $data = array( + 4 => array(5), + 10 => array(12,11), + 13 => array(17) + ); + $tmp = $data[$tradelog['status']]; + } + if($returndlang) { + if(!is_array($tmp)) { + return array(); + } + $language = lang('forum/misc'); + for($i = 0, $count = count($tmp);$i < $count;$i++) { + $return[$tmp[$i]] = lang('forum/misc', 'trade_offline_'.$tmp[$i]); + $trade_message .= isset($language['trade_message_'.$tmp[$i]]) ? lang('forum/misc', 'trade_message_'.$tmp[$i]).'
          ' : ''; + } + return $return; + } else { + return $tmp; + } +} + +function trade_create($trade) { + global $_G; + extract($trade); + $special = 2; + + $expiration = $item_expiration ? strtotime($item_expiration) : 0; + $closed = $expiration > 0 && strtotime($item_expiration) < TIMESTAMP ? 1 : $closed; + $item_price = floatval($item_price); + + switch($transport) { + case 'offline' : $item_transport = 0; break; + case 'seller' : $item_transport = 1; break; + case 'buyer' : $item_transport = 2; break; + case 'virtual' : $item_transport = 3; break; + case 'logistics': $item_transport = 4; break; + } + + $seller = dhtmlspecialchars($seller); + $item_name = dhtmlspecialchars($item_name); + $item_locus = dhtmlspecialchars($item_locus); + $item_number = intval($item_number); + $item_quality = intval($item_quality); + $item_transport = intval($item_transport); + $postage_mail = intval($postage_mail); + $postage_express = intval($postage_express); + $postage_ems = intval($postage_ems); + $item_type = intval($item_type); + $typeid = intval($typeid); + $item_costprice = floatval($item_costprice); + if(!$item_price || $item_price <= 0) { + $item_price = $postage_mail = $postage_express = $postage_ems = ''; + } + + if(empty($pid)) { + $pid = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid); + $pid = $pid['pid']; + } + if(!$item_price && $item_credit) { + $seller = ''; + } + C::t('forum_trade')->insert(array( + 'tid' => $tid, + 'pid' => $pid, + 'typeid' => $typeid, + 'sellerid' => $_G['uid'], + 'seller' => $author, + 'tenpayaccount' => $tenpayaccount, + 'account' => $seller, + 'subject' => $item_name, + 'price' => $item_price, + 'amount' => $item_number, + 'quality' => $item_quality, + 'locus' => $item_locus, + 'transport' => $item_transport, + 'ordinaryfee' => $postage_mail, + 'expressfee' => $postage_express, + 'emsfee' => $postage_ems, + 'itemtype' => $item_type, + 'dateline' => $_G['timestamp'], + 'expiration' => $expiration, + 'lastupdate' => $_G['timestamp'], + 'totalitems' => '0', + 'tradesum' => '0', + 'closed' => $closed, + 'costprice'=>$item_costprice, + 'aid'=>$aid,'credit'=>$item_credit, + 'costcredit'=>$item_costcredit + )); +} + +?> \ No newline at end of file diff --git a/source/function/function_upload.php b/source/function/function_upload.php new file mode 100644 index 0000000..54cd943 --- /dev/null +++ b/source/function/function_upload.php @@ -0,0 +1,137 @@ +fetch_info_by_fid($fid) : $_G['forum']; + $levelinfo = C::t('forum_grouplevel')->fetch($forum['level']); + if($forum['status'] == 3 && $forum['level'] && $postpolicy = $levelinfo['postpolicy']) { + $postpolicy = dunserialize($postpolicy); + $forumattachextensions = $postpolicy['attachextensions']; + } else { + $forumattachextensions = $forum['attachextensions']; + } + } + $extendtype = ''; + + loadcache('attachtype'); + $fid = isset($_G['cache']['attachtype'][$fid]) ? $fid : 0; + $filter = array(); + if(isset($_G['cache']['attachtype'][$fid]) && is_array($_G['cache']['attachtype'][$fid])) { + foreach($_G['cache']['attachtype'][$fid] as $extension => $maxsize) { + if($maxsize == 0) { + $notallow[] = $extension; + } else { + $filter[] = "'$extension':$maxsize"; + } + } + } + if(!empty($filter)) { + $config['filtertype'] = '{'.implode(',', $filter).'}'; + } + $_G['group']['attachextensions'] = !$forumattachextensions ? $_G['group']['attachextensions'] : $forumattachextensions; + + $config['imageexts'] = array('ext' => '', 'depict' => 'Image File'); + $config['attachexts'] = array('ext' => '*.*', 'depict' => 'All Support Formats'); + + if($_G['group']['attachextensions'] !== '') { + $_G['group']['attachextensions'] = str_replace(' ', '', $_G['group']['attachextensions']); + $exts = explode(',', $_G['group']['attachextensions']); + + $imagext = filterexts(array_intersect($imageexts, $exts), $notallow); + $config['imageexts']['ext'] = !empty($imagext) ? '*.'.implode(';*.', $imagext) : ''; + $exts = filterexts($exts, $notallow); + $config['attachexts']['ext'] = !empty($exts) ? '*.'.implode(';*.', $exts) : ''; + } else { + $imageexts = filterexts($imageexts, $notallow); + $config['imageexts']['ext'] = !empty($imageexts) ? '*.'.implode(';*.', $imageexts) : ''; + } + $config['max'] = 0; + if(!empty($_G['group']['maxattachsize'])) { + $config['max'] = intval($_G['group']['maxattachsize']); + } else { + $config['max'] = getmaxupload(); + $unit = strtolower(substr($config['max'], -1, 1)); + $config['max'] = intval($config['max']); + if($unit == 'k') { + $config['max'] = $config['max']*1024; + } elseif($unit == 'm') { + $config['max'] = $config['max']*1024*1024; + } elseif($unit == 'g') { + $config['max'] = $config['max']*1024*1024*1024; + } + } + $config['max'] = $config['max'] / 1024; + + if($limit) { + if($_G['group']['maxattachnum']) { + $todayattachs = getuserprofile('todayattachs'); + $config['maxattachnum'] = (int)$_G['group']['maxattachnum'] - (int)$todayattachs; + $config['maxattachnum'] = $config['maxattachnum'] > 0 ? $config['maxattachnum'] : -1; + $config['limit'] = $config['maxattachnum'] > 0 ? $config['maxattachnum'] : 0; + } + if($_G['group']['maxsizeperday']) { + $todayattachsize = getuserprofile('todayattachsize'); + $config['maxsizeperday'] = (int)$_G['group']['maxsizeperday'] - (int)$todayattachsize; + $config['maxsizeperday'] = $config['maxsizeperday'] > 0 ? $config['maxsizeperday'] : -1; + } + } + return $config; +} +function filterexts($needle, $haystack) { + + foreach($needle as $key => $value) { + if(in_array($value, $haystack)) { + unset($needle[$key]); + } + } + return $needle; +} +function getmaxupload() { + $sizeconv = array('B' => 1, 'KB' => 1024, 'MB' => 1048576, 'GB' => 1073741824); + $sizes = array(); + $sizes[] = ini_get('upload_max_filesize'); + $sizes[] = ini_get('post_max_size'); + $sizes[] = ini_get('memory_limit'); + if(intval($sizes[1]) === 0) { + unset($sizes[1]); + } + if(intval($sizes[2]) === -1) { + unset($sizes[2]); + } + $sizes = preg_replace_callback( + '/^(\-?\d+)([KMG]?)$/i', + function($arg) use ($sizeconv) { + return (intval($arg[1]) * $sizeconv[strtoupper($arg[2]).'B']).'|'.strtoupper($arg[0]); + }, + $sizes + ); + natsort($sizes); + $output = explode('|', current($sizes)); + if(!empty($output[1])) { + return $output[1]; + } else { + return ini_get('upload_max_filesize'); + } +} +?> \ No newline at end of file diff --git a/source/function/index.htm b/source/function/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/function/media/index.htm b/source/function/media/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/function/media/media_56.php b/source/function/media/media_56.php new file mode 100644 index 0000000..9698b06 --- /dev/null +++ b/source/function/media/media_56.php @@ -0,0 +1,24 @@ +(.+?)<\/span>/i", $str, $image)) { + $imgurl = trim($image[1]); + } + } + } + return array($flv, $iframe, $url, $imgurl); +} \ No newline at end of file diff --git a/source/function/media/media_wasu.php b/source/function/media/media_wasu.php new file mode 100644 index 0000000..c5ecafd --- /dev/null +++ b/source/function/media/media_wasu.php @@ -0,0 +1,17 @@ + array('timeout' => 10))); + if(preg_match("/^https?:\/\/v.youku.com\/v_show\/id_([^\/]+)(.html|)/i", $url, $matches)) { + $params = explode('.', $matches[1]); + $flv = 'https://player.youku.com/player.php/sid/'.$params[0].'/v.swf'; + $iframe = 'https://player.youku.com/embed/'.$params[0]; + if(!$width && !$height) { + $api = 'http://v.youku.com/player/getPlayList/VideoIDS/'.$params[0]; + $str = stripslashes(dfsockopen($api)); + if(!empty($str) && preg_match("/\"logo\":\"(.+?)\"/i", $str, $image)) { + $url = substr($image[1], 0, strrpos($image[1], '/')+1); + $filename = substr($image[1], strrpos($image[1], '/')+2); + $imgurl = $url.'0'.$filename; + } + } + } + return array($flv, $iframe, $url, $imgurl); +} \ No newline at end of file diff --git a/source/function/media/media_youtube.php b/source/function/media/media_youtube.php new file mode 100644 index 0000000..095f3d5 --- /dev/null +++ b/source/function/media/media_youtube.php @@ -0,0 +1,23 @@ + true, 'login' => 1)); +} + +$oplist = array('add', 'del', 'pop', 'recommend'); +if(!in_array($op, $oplist)) { + $op = ''; +} + +if(empty($op) || $op == 'add') { + $_GET['handlekey'] = 'addComment'; + if(!$ctid) { + showmessage('undefined_action', NULL); + } + + if(!$_G['group']['allowcommentcollection']) { + showmessage('collection_comment_closed'); + } + + require_once libfile('function/spacecp'); + + + if(!$_G['collection']['ctid']) { + showmessage('collection_permission_deny'); + } + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + + $memberrate = C::t('forum_collectioncomment')->fetch_rate_by_ctid_uid($_G['collection']['ctid'], $_G['uid']); + + if(!trim($_GET['message']) && ((!$memberrate && !$_GET['ratescore']) || $memberrate)) { + showmessage('collection_edit_checkentire'); + } + + if($_G['setting']['maxpostsize'] && strlen($_GET['message']) > $_G['setting']['maxpostsize']) { + showmessage('post_message_toolong', '', array('maxpostsize' => $_G['setting']['maxpostsize'])); + } + + $newcomment = array( + 'ctid' => $_G['collection']['ctid'], + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'message' => dhtmlspecialchars(censor($_GET['message'])), + 'dateline' => $_G['timestamp'], + 'useip' => $_G['clientip'], + 'port' => $_G['remoteport'] + ); + + if(!$memberrate) { + $newcomment['rate'] = $_GET['ratescore']; + } else { + $_GET['ratescore'] = 0; + } + + C::t('forum_collectioncomment')->insert($newcomment); + C::t('forum_collection')->update_by_ctid($_G['collection']['ctid'], 0, 0, 1, 0, $_GET['ratescore'], $_G['collection']['ratenum']); + + if($_G['collection']['uid'] != $_G['uid']) { + notification_add($_G['collection']['uid'], "system", 'collection_becommented', array('from_id'=>$_G['collection']['ctid'], 'from_idtype'=>'collectioncomment', 'ctid'=>$_G['collection']['ctid'], 'collectionname'=>$_G['collection']['name']), 1); + } + + C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED'); + + showmessage('collection_comment_succ', $tid ? 'forum.php?mod=viewthread&tid='.$tid : dreferer()); +} elseif($op == 'del') { + if(!submitcheck('formhash')) { + showmessage('undefined_action', NULL); + } else { + if(!$_G['collection']['ctid'] || !checkcollectionperm($_G['collection'], $_G['uid']) || empty($_GET['delcomment']) || !is_array($_GET['delcomment']) || count($_GET['delcomment']) == 0) { + showmessage('undefined_action', NULL); + } + $delrows = C::t('forum_collectioncomment')->delete_by_cid_ctid($_GET['delcomment'], $_G['collection']['ctid']); + C::t('forum_collection')->update_by_ctid($_G['collection']['ctid'], 0, 0, -$delrows); + + showmessage('collection_comment_remove_succ', 'forum.php?mod=collection&action=view&op=comment&ctid='.$ctid); + } +} elseif($op == 'pop') { + $collectionthread = C::t('forum_collectionthread')->fetch_by_ctid_tid($ctid, $tid); + if(!$collectionthread['ctid']) { + showmessage('collection_permission_deny'); + } + $thread = C::t('forum_thread')->fetch_thread($tid); + + include template('forum/collection_commentpop'); +} elseif($op == 'recommend') { + if(!$_G['collection']['ctid']) { + showmessage('collection_permission_deny'); + } + if(!submitcheck('formhash')) { + include template('forum/collection_recommend'); + } else { + if(!$_GET['threadurl']) { + showmessage('collection_recommend_url', '', array(), array('alert'=> 'error', 'closetime' => true, 'showdialog' => 1)); + } + + $touid = &$_G['collection']['uid']; + $coef = 1; + + $subject = $message = lang('message', 'collection_recommend_message', array('fromuser' => $_G['username'], 'collectioname' => $_G['collection']['name'], 'url' => $_GET['threadurl'])); + if(C::t('home_blacklist')->count_by_uid_buid($touid, $_G['uid'])) { + showmessage('is_blacklist', '', array(), array('return' => true)); + } + if(($value = getuserbyuid($touid))) { + require_once libfile('function/friend'); + $value['onlyacceptfriendpm'] = $value['onlyacceptfriendpm'] ? $value['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2); + if($_G['group']['allowsendallpm'] || $value['onlyacceptfriendpm'] == 2 || ($value['onlyacceptfriendpm'] == 1 && friend_check($touid))) { + $return = sendpm($touid, $subject, $message, '', 0, 0); + } else { + showmessage('message_can_not_send_onlyfriend', '', array(), array('return' => true)); + } + } else { + showmessage('message_bad_touid', '', array(), array('return' => true)); + } + + if($return > 0) { + include_once libfile('function/stat'); + updatestat('sendpm', 0, $coef); + + C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED'); + !($_G['group']['exempt'] & 1) && updatecreditbyaction('sendpm', 0, array(), '', $coef); + showmessage('collection_recommend_succ', '', array(), array('alert'=> 'right', 'closetime' => true, 'showdialog' => 1)); + } + } +} + +?> \ No newline at end of file diff --git a/source/include/collection/collection_edit.php b/source/include/collection/collection_edit.php new file mode 100644 index 0000000..210736c --- /dev/null +++ b/source/include/collection/collection_edit.php @@ -0,0 +1,412 @@ + true, 'login' => 1)); +} + +if(empty($op) || $op == 'add') { + if(!helper_access::check_module('collection')) { + showmessage('quickclear_noperm'); + } + $_GET['handlekey'] = 'createcollection'; + + $navtitle = lang('core', 'title_collection_create'); + + $createdcollectionnum = C::t('forum_collection')->count_by_uid($_G['uid']); + $reamincreatenum = $_G['group']['allowcreatecollection']-$createdcollectionnum; + if(!$_G['group']['allowcreatecollection'] || $reamincreatenum <= 0) { + showmessage('collection_create_exceed_limit'); + } + if(!$_GET['submitcollection']) { + + include template('forum/collection_add'); + + } else { + if(!submitcheck('collectionsubmit')) { + showmessage('undefined_action', NULL); + } + if(!$_GET['title']) { + showmessage('collection_edit_checkentire'); + } + + $newCollectionTitle = censor(dhtmlspecialchars($_GET['title'])); + $newCollectionTitle = cutstr($newCollectionTitle, $titlelimit, ''); + + $newcollection = array( + 'name' => $newCollectionTitle, + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'desc' => dhtmlspecialchars(cutstr(censor($_GET['desc']), $desclimit, '')), + 'dateline' => $_G['timestamp'], + 'lastupdate' => $_G['timestamp'], + 'lastvisit' => $_G['timestamp'], + 'keyword' => parse_keyword($_GET['keyword'], true) + ); + + $newctid = C::t('forum_collection')->insert($newcollection, true); + + if($newctid) { + showmessage('collection_create_succ', 'forum.php?mod=collection&action=view&ctid='.$newctid, array('ctid'=>$newctid, 'title'=>$newCollectionTitle), array('closetime' => '2', 'showmsg' => ($_GET['inajax'] ? '0' : '1'))); + } + } + +} elseif($op == 'edit') { + $navtitle = lang('core', 'title_collection_edit'); + + if(!$ctid) { + showmessage('undefined_action', NULL); + } + + if(!$_G['collection']['ctid'] || !checkcollectionperm($_G['collection'], $_G['uid'])) { + showmessage('collection_permission_deny'); + } + + if(!submitcheck('collectionsubmit')) { + + include template('forum/collection_add'); + + } else { + if(!$_GET['title']) { + showmessage('collection_edit_checkentire'); + } + if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action', NULL); + } + + $newCollectionTitle = censor(dhtmlspecialchars($_GET['title'])); + $newCollectionTitle = cutstr($newCollectionTitle, 30, ''); + + $newcollection = array( + 'name' => $newCollectionTitle, + 'desc' => dhtmlspecialchars(cutstr(censor($_GET['desc']), $desclimit, '')), + 'keyword' => parse_keyword($_GET['keyword'], true) + ); + + C::t('forum_collection')->update($ctid, $newcollection); + + if($_GET['title'] != $_G['collection']['name']) { + C::t('forum_collectionteamworker')->update_by_ctid($ctid, $_GET['title']); + } + + showmessage('collection_edit_succ', 'forum.php?mod=collection&action=view&ctid='.$ctid); + } +} elseif($op == 'remove') { + if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action', NULL); + } + if($_G['collection'] && checkcollectionperm($_G['collection'], $_G['uid'])) { + require_once libfile('function/delete'); + + deletecollection($_G['collection']['ctid']); + + showmessage('collection_delete_succ', 'forum.php?mod=collection&op=my'); + } else { + showmessage('collection_permission_deny'); + } + +} elseif($op == 'addthread') { + if((!$_G['forum_thread'] || !$_G['forum']) && !is_array($_GET['tids'])) { + showmessage('thread_nonexistence'); + } + + if(!is_array($_GET['tids']) && $_G['forum']['disablecollect']) { + showmessage('collection_forum_deny', '', array(), array('showdialog' => 1)); + } + + if(!submitcheck('addthread')) { + $createdcollectionnum = C::t('forum_collection')->count_by_uid($_G['uid']); + $reamincreatenum = $_G['group']['allowcreatecollection']-$createdcollectionnum; + + $collections = getmycollection($_G['uid']); + $tidcollections = array(); + + if(count($collections) > 0) { + $tidrelated = C::t('forum_collectionrelated')->fetch($tid, true); + $tidcollections = explode("\t", $tidrelated['collection']); + } + $allowcollections = array_diff(array_keys($collections), $tidcollections); + if($reamincreatenum <= 0 && count($allowcollections) <= 0) { + showmessage('collection_none_avail_collection', '', array(), array('showdialog' => 1)); + } + + include template('forum/collection_select'); + + } else { + if(!$ctid) { + showmessage('collection_no_selected', '', array(), array('showdialog' => 1)); + } + if(!is_array($_GET['tids'])) { + $tid = $_G['tid']; + $thread[$tid] = &$_G['thread']; + } + $collectiondata = C::t('forum_collection')->fetch_all($ctid); + if(!is_array($collectiondata) || count($collectiondata) < 0) { + showmessage('undefined_action', NULL); + } else { + foreach ($collectiondata as $curcollectiondata) { + if(!$curcollectiondata['ctid']) { + showmessage('collection_permission_deny', '', array(), array('showdialog' => 1)); + } + + if(!checkcollectionperm($curcollectiondata, $_G['uid'], true)) { + showmessage('collection_non_creator', '', array(), array('showdialog' => 1)); + } + + if(!is_array($_GET['tids'])) { + $checkexistctid[$tid] = C::t('forum_collectionthread')->fetch_by_ctid_tid($curcollectiondata['ctid'], $thread[$tid]['tid']); + if($checkexistctid[$tid]['ctid']) { + showmessage('collection_thread_exists', '', array(), array('showdialog' => 1)); + } + + $tids[0] = $tid; + $checkexist[$tid] = C::t('forum_collectionrelated')->fetch($tid, true); + } else { + $thread = C::t('forum_thread')->fetch_all($_GET['tids']); + foreach ($thread as $perthread) { + $fids[$perthread['fid']] = $perthread['fid']; + } + $fids = array_keys($fids); + $foruminfo = C::t('forum_forumfield')->fetch_all($fids); + $tids = array_keys($thread); + $checkexistctid = C::t('forum_collectionthread')->fetch_all_by_ctid_tid($curcollectiondata['ctid'], $tids); + $checkexist = C::t('forum_collectionrelated')->fetch_all($tids, true); + } + + $addsum = 0; + foreach ($tids as $curtid) { + $thread_fid = $thread[$curtid]['fid']; + if(!$checkexistctid[$curtid]['ctid'] && !$foruminfo[$thread_fid]['disablecollect']) { + $newthread = array( + 'ctid' => $curcollectiondata['ctid'], + 'tid' => $thread[$curtid]['tid'], + 'dateline' => $thread[$curtid]['dateline'], + 'reason' => cutstr(censor(dhtmlspecialchars($_GET['reason'])), $reasonlimit, '') + ); + + C::t('forum_collectionthread')->insert($newthread); + } else { + continue; + } + + if(!$checkexist[$curtid]) { + C::t('forum_collectionrelated')->insert(array('tid'=>$curtid, 'collection'=>$curcollectiondata['ctid']."\t")); + $checkexist[$curtid] = 1; + } else { + C::t('forum_collectionrelated')->update_collection_by_ctid_tid($curcollectiondata['ctid'], $curtid); + } + if(!getstatus($thread[$curtid]['status'], 9)) { + C::t('forum_thread')->update_status_by_tid($curtid, '256'); + } + + if($_G['uid'] != $thread[$curtid]['authorid']) { + notification_add($thread[$curtid]['authorid'], "system", 'collection_becollected', array('from_id'=>$_G['collection']['ctid'], 'from_idtype'=>'collectionthread', 'ctid'=>$_G['collection']['ctid'], 'collectionname'=>$_G['collection']['name'], 'tid'=>$curtid, 'threadname'=>$thread[$curtid]['subject']), 1); + } + + $addsum++; + } + + if($addsum > 0) { + $lastpost = array( + 'lastpost' => $thread[$tids[0]]['tid'], + 'lastsubject' => $thread[$tids[0]]['subject'], + 'lastposttime' => $thread[$tids[0]]['dateline'], + 'lastposter' => $thread[$tids[0]]['author'] + ); + C::t('forum_collection')->update_by_ctid($curcollectiondata['ctid'], $addsum, 0, 0, $_G['timestamp'], 0, 0, $lastpost); + } + } + } + + showmessage('collection_collect_succ', dreferer(), array(), array('alert'=> 'right', 'closetime' => true, 'locationtime' => true, 'showdialog' => 1)); + } + +} elseif($op == 'delthread') { + if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action', NULL); + } + if(!$ctid || empty($_GET['delthread']) || !is_array($_GET['delthread']) || count($_GET['delthread']) == 0) { + showmessage('collection_no_thread'); + } + + if(!$_G['collection']['ctid'] || !checkcollectionperm($_G['collection'], $_G['uid'])) { + showmessage('collection_permission_deny'); + } + require_once libfile('function/delete'); + deleterelatedtid($_GET['delthread'], $_G['collection']['ctid']); + $decthread = C::t('forum_collectionthread')->delete_by_ctid_tid($ctid, $_GET['delthread']); + + $lastpost = null; + if(in_array($_G['collection']['lastpost'], $_GET['delthread']) && ($_G['collection']['threadnum'] - $decthread) > 0) { + $collection_thread = C::t('forum_collectionthread')->fetch_by_ctid_dateline($ctid); + if($collection_thread) { + $thread = C::t('forum_thread')->fetch_thread($collection_thread['tid']); + $lastpost = array( + 'lastpost' => $thread['tid'], + 'lastsubject' => $thread['subject'], + 'lastposttime' => $thread['dateline'], + 'lastposter' => $thread['authorid'] + ); + } + } + + C::t('forum_collection')->update_by_ctid($ctid, -$decthread, 0, 0, 0, 0, 0, $lastpost); + + showmessage('collection_remove_thread', 'forum.php?mod=collection&action=view&ctid='.$ctid); +} elseif($op == 'invite') { + if(!$ctid) { + showmessage('undefined_action', NULL); + } + + if(!$_G['collection']['ctid'] || !checkcollectionperm($_G['collection'], $_G['uid'])) { + showmessage('collection_permission_deny'); + } + + $collectionteamworker = C::t('forum_collectionteamworker')->fetch_all_by_ctid($ctid); + + $submitworkers = (!empty($_GET['users']) && is_array($_GET['users'])) ? count($_GET['users']) : 0; + + if((count($collectionteamworker) + $submitworkers) >= $maxteamworkers) { + showmessage('collection_teamworkers_exceed'); + } + + require_once libfile('function/friend'); + + if($_GET['username'] && !$_GET['users']) { + $_GET['users'][] = $_GET['username']; + } + + if(!$_GET['users']) { + + if($_POST['formhash']) { + showmessage('collection_teamworkers_noselect', NULL); + } + + $friends = array(); + if($space['friendnum']) { + $query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, 100, true); + foreach($query as $value) { + $value['uid'] = $value['fuid']; + $value['username'] = daddslashes($value['fusername']); + $friends[] = $value; + } + } + $friendgrouplist = friend_group_list(); + + include template('forum/collection_invite'); + } else { + $invitememberuids = array(); + if(is_array($_GET['users'])) { + $invitememberuids = C::t('common_member')->fetch_all_uid_by_username($_GET['users']); + } + + if(!$invitememberuids) { + showmessage('collection_no_teamworkers'); + } + + if(!friend_check($invitememberuids) || in_array($_G['uid'], $invitememberuids)) { + showmessage('collection_non_friend'); + } + + $collectionteamworker = array_keys($collectionteamworker); + + if(in_array($invitememberuids, $collectionteamworker)) { + showmessage('collection_teamworkers_exists'); + } + + foreach($invitememberuids as $invitememberuid) { + $data = array('ctid'=>$ctid,'uid'=>$invitememberuid,'dateline'=>$_G['timestamp']); + + C::t('forum_collectioninvite')->insert($data, false, true); + + notification_add($invitememberuid, "system", 'invite_collection', array('ctid'=>$_G['collection']['ctid'], 'collectionname'=>$_G['collection']['name'], 'dateline'=>$_G['timestamp']), 1); + } + + showmessage('collection_invite_succ', 'forum.php?mod=collection&action=view&ctid='.$ctid, array(), array('alert'=> 'right', 'closetime' => true, 'showdialog' => 1)); + } +} elseif($op == 'acceptinvite') { + if(!submitcheck('ctid', 1)) { + showmessage('undefined_action', NULL); + } else { + $collectioninvite = C::t('forum_collectioninvite')->fetch_by_ctid_uid($ctid, $_G['uid']); + if(!$collectioninvite['ctid'] || $_GET['dateline'] != $collectioninvite['dateline']) { + showmessage('undefined_action', NULL); + } + + $teamworkernum = C::t('forum_collectionteamworker')->count_by_ctid($ctid); + if($teamworkernum >= $maxteamworkers) { + showmessage('collection_teamworkers_exceed'); + } + + C::t('forum_collectioninvite')->delete_by_ctid_uid($ctid, $_G['uid']); + + $newworker = array( + 'ctid'=>$ctid, + 'uid'=>$_G['uid'], + 'name'=>$_G['collection']['name'], + 'username'=>$_G['username'], + 'lastvisit' => $_G['timestamp'] + ); + + C::t('forum_collectionteamworker')->insert($newworker, false, true); + + showmessage('collection_invite_accept', 'forum.php?mod=collection&action=view&ctid='.$ctid); + } +} elseif($op == 'removeworker') { + if(!submitcheck('ctid', 1)) { + showmessage('undefined_action', NULL); + } else { + if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action', NULL); + } + + if(!$_G['collection']['ctid']) { + showmessage('collection_permission_deny'); + } + if($_GET['uid'] != $_G['uid']) { + if($_G['collection']['uid'] != $_G['uid']) { + showmessage('collection_remove_deny'); + } + $removeuid = $_GET['uid']; + } else { + $removeuid = $_G['uid']; + } + + $collectionteamworker = array_keys(C::t('forum_collectionteamworker')->fetch_all_by_ctid($ctid)); + + if(!in_array($removeuid, $collectionteamworker)) { + showmessage('collection_teamworkers_nonexists'); + } + + C::t('forum_collectionteamworker')->delete_by_ctid_uid($ctid, $removeuid); + + notification_add($removeuid, "system", 'exit_collection', array('ctid'=>$_G['collection']['ctid'], 'collectionname'=>$_G['collection']['name']), 1); + + if($_GET['inajax']) { + showmessage('', dreferer(), array(), array('msgtype' => 3, 'showmsg' => 1)); + } else { + showmessage('collection_teamworkers_exit_succ', 'forum.php?mod=collection&action=view&ctid='.$ctid); + } + } +} + +?> \ No newline at end of file diff --git a/source/include/collection/collection_follow.php b/source/include/collection/collection_follow.php new file mode 100644 index 0000000..537a3ce --- /dev/null +++ b/source/include/collection/collection_follow.php @@ -0,0 +1,59 @@ +count_by_uid($_G['uid']); + if($follownum >= $_G['group']['allowfollowcollection']) { + showmessage('collection_follow_limited', '', array('limit' => $_G['group']['allowfollowcollection']), array('closetime' => '2', 'showmsg' => '1')); + } + + $collectionfollow = C::t('forum_collectionfollow')->fetch_by_ctid_uid($ctid, $_G['uid']); + if(!$collectionfollow['ctid']) { + $data = array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'ctid' => $ctid, + 'dateline' => $_G['timestamp'], + 'lastvisit' => $_G['timestamp'] + ); + + C::t('forum_collectionfollow')->insert($data); + C::t('forum_collection')->update_by_ctid($ctid, 0, 1, 0); + + if($_G['collection']['uid'] != $_G['uid']) { + updatecreditbyaction('followedcollection', $_G['collection']['uid']); + notification_add($_G['collection']['uid'], "system", 'collection_befollowed', array('from_id'=>$_G['collection']['ctid'], 'from_idtype'=>'collectionfollow', 'ctid'=>$_G['collection']['ctid'], 'collectionname'=>$_G['collection']['name']), 1); + } + + showmessage('collection_follow_succ', dreferer(), array('status'=>1), array('closetime' => '2', 'showmsg' => '1')); + } + + +} elseif($op == 'unfo') { + $collectionfollow = C::t('forum_collectionfollow')->fetch_by_ctid_uid($ctid, $_G['uid']); + if($collectionfollow['ctid']) { + C::t('forum_collectionfollow')->delete_by_ctid_uid($ctid, $_G['uid']); + C::t('forum_collection')->update_by_ctid($ctid, 0, -1, 0); + showmessage('collection_unfollow_succ', dreferer(), array('status'=>2), array('closetime' => '2', 'showmsg' => '1')); + } +} + +?> \ No newline at end of file diff --git a/source/include/collection/collection_index.php b/source/include/collection/collection_index.php new file mode 100644 index 0000000..6a6100e --- /dev/null +++ b/source/include/collection/collection_index.php @@ -0,0 +1,104 @@ +count(); + } + + $orderby = (in_array($_GET['order'], $orderbyarr)) ? $_GET['order'] : 'dateline'; + $collectiondata = processCollectionData(C::t('forum_collection')->fetch_all('', $orderby, 'DESC', $start, $cpp, $searchtitle), array(), $orderby); + $htmlsearchtitle = dhtmlspecialchars($searchtitle); + $multipage = multi($count, $cpp, $page, 'forum.php?mod=collection&order='.$orderby.'&op='.$op.(($htmlsearchtitle) ? '&kw='.$htmlsearchtitle : '')); + + include template('forum/collection_all'); +} elseif ($op == 'my') { + $mycollection = C::t('forum_collection')->fetch_all_by_uid($_G['uid']); + $myctid = array_keys($mycollection); + $teamworker = C::t('forum_collectionteamworker')->fetch_all_by_uid($_G['uid']); + $twctid = array_keys($teamworker); + $follow = C::t('forum_collectionfollow')->fetch_all_by_uid($_G['uid']); + if(empty($follow)) { + $follow = array(); + } + $followctid = array_keys($follow); + + if(!$myctid) { + $myctid = array(); + } + if(!$twctid) { + $twctid = array(); + } + if(!$followctid) { + $followctid = array(); + } + + $ctidlist = array_merge($myctid, $twctid, $followctid); + + if(count($ctidlist) > 0) { + $tfcollection = $mycollection + $teamworker + $follow; + $collectiondata = C::t('forum_collection')->fetch_all($ctidlist, 'dateline', 'DESC'); + $collectiondata = processCollectionData($collectiondata, $tfcollection); + } + + include template('forum/collection_mycollection'); +} else { + if(!$tid) { + $collectiondata = array(); + loadcache('collection'); + + if(TIMESTAMP - $_G['cache']['collection']['dateline'] > 300) { + $collection = getHotCollection(500, false); + $collectioncache = array('dateline' => TIMESTAMP, 'data' => $collection); + savecache('collection', $collectioncache); + } else { + $collection = &$_G['cache']['collection']['data']; + } + $count = count($collection); + for($i = $start; $i < $start+$cpp; $i++) { + if(!$collection[$i]) { + continue; + } + $collectiondata[] = $collection[$i]; + } + unset($collection); + $collectiondata = processCollectionData($collectiondata); + } else { + $tidrelate = C::t('forum_collectionrelated')->fetch($tid); + $ctids = explode("\t", $tidrelate['collection'], -1); + $count = count($ctids); + $collectiondata = C::t('forum_collection')->fetch_all($ctids, 'follownum', 'DESC', $start, $cpp); + $collectiondata = processCollectionData($collectiondata); + } + + $multipage = multi($count, $cpp, $page, 'forum.php?mod=collection'.($tid ? '&tid='.$tid : '')); + + include template('forum/collection_index'); +} + + +?> \ No newline at end of file diff --git a/source/include/collection/collection_view.php b/source/include/collection/collection_view.php new file mode 100644 index 0000000..95b1074 --- /dev/null +++ b/source/include/collection/collection_view.php @@ -0,0 +1,125 @@ +fetch_by_ctid_uid($ctid, $_G['uid']); +$collectionteamworker = C::t('forum_collectionteamworker')->fetch_all_by_ctid($_G['collection']['ctid']); + +$_G['collection']['arraykeyword'] = parse_keyword($_G['collection']['keyword'], false, false); +if($_G['collection']['arraykeyword']) { + foreach ($_G['collection']['arraykeyword'] as $kid=>$s_keyword) { + $metakeywords .= ($metakeywords ? ',' : '').$s_keyword; + $_G['collection']['urlkeyword'][$kid] = rawurlencode($s_keyword); + } +} +$metadescription = $_G['collection']['name']; + +if($_G['collection']['ratenum']) { + $star = imgdisplayrate($avgrate); +} + +if(!$op || $op == 'related') { + $isteamworkers = in_array($_G['uid'], array_keys($collectionteamworker)); + + $search_status = FALSE; + require_once libfile('function/friend'); + $friendgrouplist = friend_group_list(); + + if(!$op && $op != 'related') { + if($_G['collection']['uid'] == $_G['uid']) { + $lastvisit = $_G['collection']['lastvisit']; + if($_G['collection']['lastupdate'] >= $lastvisit) { + C::t('forum_collection')->update($ctid, array('lastvisit' => TIMESTAMP), true, true); + } + } elseif($isteamworkers) { + $lastvisit = $collectionteamworker[$_G['uid']]['lastvisit']; + if($_G['collection']['lastupdate'] >= $lastvisit) { + C::t('forum_collectionteamworker')->update_teamworker($ctid, $_G['uid'], array('lastvisit' => TIMESTAMP), true, true); + } + } elseif($collectionfollowdata['ctid']) { + $lastvisit = $collectionfollowdata['lastvisit']; + if($_G['collection']['lastupdate'] >= $lastvisit) { + C::t('forum_collectionfollow')->update_collectionfollow($ctid, $_G['uid'], array('lastvisit' => TIMESTAMP), true, true); + } + } else { + $lastvisit = null; + } + + $collectiontids = C::t('forum_collectionthread')->fetch_all_by_ctid($_G['collection']['ctid'], $start, $tpp); + $tids = array_keys($collectiontids); + $threadlist = C::t('forum_thread')->fetch_all_by_tid($tids); + collectionThread($threadlist, false, $lastvisit, $collectiontids); + + $multipage = multi($_G['collection']['threadnum'], $tpp, $page, "forum.php?mod=collection&action=view&ctid={$_G['collection']['ctid']}"); + + $userCollections = C::t('forum_collection')->fetch_all_by_uid($_G['collection']['uid'], 0, 5, $_G['collection']['ctid']); + } + + if($_G['collection']['commentnum'] > 0) { + $commentlist = C::t('forum_collectioncomment')->fetch_all_by_ctid($_G['collection']['ctid'], 0, 5); + foreach($commentlist as &$curvalue) { + $curvalue['dateline'] = dgmdate($curvalue['dateline'], 'u', '9999', getglobal('setting/dateformat')); + $curvalue['message'] = cutstr($curvalue['message'], 150); + $curvalue['rateimg'] = imgdisplayrate($curvalue['rate']); + } + + $memberrate = C::t('forum_collectioncomment')->fetch_rate_by_ctid_uid($_G['collection']['ctid'], $_G['uid']); + } + $followers = C::t('forum_collectionfollow')->fetch_all_collectionfollow($ctid, true, 0, 6); + + include template('forum/collection_view'); +} elseif($op == 'comment') { + $navtitle = lang('core', 'title_collection_comment_list').' - '.$navtitle; + if($_G['collection']['commentnum'] > 0) { + $start = ($page-1)*$_G['setting']['postperpage']; + + $commentlist = C::t('forum_collectioncomment')->fetch_all_by_ctid($_G['collection']['ctid'], $start, $_G['setting']['postperpage']); + foreach($commentlist as &$curvalue) { + $curvalue['dateline'] = dgmdate($curvalue['dateline'], 'u', '9999', getglobal('setting/dateformat')); + $curvalue['rateimg'] = imgdisplayrate($curvalue['rate']); + } + + $multipage = multi($_G['collection']['commentnum'], $_G['setting']['postperpage'], $page, "forum.php?mod=collection&action=view&op=comment&ctid={$_G['collection']['ctid']}"); + + $memberrate = C::t('forum_collectioncomment')->fetch_rate_by_ctid_uid($_G['collection']['ctid'], $_G['uid']); + } + include template('forum/collection_comment'); +} elseif($op == 'followers') { + $navtitle = lang('core', 'title_collection_followers_list').' - '.$navtitle; + $cmemberperpage = 28; + $start = ($page-1)*$cmemberperpage; + $followers = C::t('forum_collectionfollow')->fetch_all_collectionfollow($ctid, true, $start, $cmemberperpage); + $multipage = multi($_G['collection']['follownum'], $cmemberperpage, $page, "forum.php?mod=collection&action=view&op=followers&ctid={$_G['collection']['ctid']}"); + + include template('forum/collection_followers'); +} +?> \ No newline at end of file diff --git a/source/include/collection/index.htm b/source/include/collection/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/cron/cron_announcement_daily.php b/source/include/cron/cron_announcement_daily.php new file mode 100644 index 0000000..0f8cb5a --- /dev/null +++ b/source/include/cron/cron_announcement_daily.php @@ -0,0 +1,22 @@ +delete_all_by_endtime($_G['timestamp']); + +if($delnum) { + require_once libfile('function/cache'); + updatecache(array('announcements', 'announcements_forum')); +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_cleanfeed.php b/source/include/cron/cron_cleanfeed.php new file mode 100644 index 0000000..bfff452 --- /dev/null +++ b/source/include/cron/cron_cleanfeed.php @@ -0,0 +1,21 @@ +delete_by_dateline($deltime); +C::t('home_feed')->optimize_table(); + +?> \ No newline at end of file diff --git a/source/include/cron/cron_cleannotification.php b/source/include/cron/cron_cleannotification.php new file mode 100644 index 0000000..24b13b0 --- /dev/null +++ b/source/include/cron/cron_cleannotification.php @@ -0,0 +1,22 @@ +delete_clear(0, 2); +C::t('home_notification')->delete_clear(1, 30); + +$deltime = $_G['timestamp'] - 7*3600*24; +C::t('home_pokearchive')->delete_by_dateline($deltime); + +C::t('home_notification')->optimize(); + +?> \ No newline at end of file diff --git a/source/include/cron/cron_cleantrace.php b/source/include/cron/cron_cleantrace.php new file mode 100644 index 0000000..d79a95f --- /dev/null +++ b/source/include/cron/cron_cleantrace.php @@ -0,0 +1,21 @@ +delete_by_dateline($deltime); + +C::t('home_visitor')->delete_by_dateline($deltime); + +?> \ No newline at end of file diff --git a/source/include/cron/cron_cleanup_daily.php b/source/include/cron/cron_cleanup_daily.php new file mode 100644 index 0000000..bbac3b6 --- /dev/null +++ b/source/include/cron/cron_cleanup_daily.php @@ -0,0 +1,146 @@ +close_endtime()) { + updatecache(array('setting', 'advs')); +} +C::t('forum_threaddisablepos')->truncate(); +C::t('common_searchindex')->truncate(); +C::t('forum_threadmod')->delete_by_dateline($_G['timestamp']-31536000); +C::t('forum_forumrecommend')->delete_old(); +C::t('home_visitor')->delete_by_dateline($_G['timestamp']-7776000); +C::t('forum_postcache')->delete_by_dateline(TIMESTAMP-86400); +C::t('forum_newthread')->delete_by_dateline(TIMESTAMP-1296000); +C::t('common_seccheck')->truncate(); + +if($_G['setting']['heatthread']['type'] == 2 && $_G['setting']['heatthread']['period']) { + $partakeperoid = 86400 * $_G['setting']['heatthread']['period']; + C::t('forum_threadpartake')->delete_threadpartake($_G['timestamp'] - $partakeperoid); +} + +C::t('common_member_count')->clear_today_data(); + +C::t('forum_trade')->update_closed($_G['timestamp']); +C::t('forum_tradelog')->clear_failure(7); +C::t('forum_tradelog')->expiration_payed(7); +C::t('forum_tradelog')->expiration_finished(7); + +if($_G['setting']['cachethreadon']) { + removedir($_G['setting']['cachethreaddir'], TRUE); + touch($_G['setting']['cachethreaddir'].'/index.htm'); +} +removedir($_G['setting']['attachdir'].'image', TRUE); +@touch($_G['setting']['attachdir'].'image/index.htm'); + +C::t('forum_attachment_unused')->clear(); + +C::t('forum_polloption_image')->clear(); + +$uids = $members = array(); +$members = C::t('common_member')->fetch_all_ban_by_groupexpiry(TIMESTAMP); +if(($uids = array_keys($members))) { + $setarr = array(); + foreach(C::t('common_member_field_forum')->fetch_all($uids) as $uid => $member) { + $member['groupterms'] = dunserialize($member['groupterms']); + $member['groupid'] = $members[$uid]['groupid']; + $member['credits'] = $members[$uid]['credits']; + + if(!empty($member['groupterms']['main']['groupid'])) { + $groupidnew = $member['groupterms']['main']['groupid']; + $adminidnew = $member['groupterms']['main']['adminid']; + unset($member['groupterms']['main']); + unset($member['groupterms']['ext'][$member['groupid']]); + $setarr['groupexpiry'] = groupexpiry($member['groupterms']); + } else { + $query = C::t('common_usergroup')->fetch_by_credits($member['credits'], 'member'); + $groupidnew = $query['groupid']; + $adminidnew = 0; + } + $setarr['adminid'] = $adminidnew; + $setarr['groupid'] = $groupidnew; + C::t('common_member')->update($uid, $setarr); + C::t('common_member_field_forum')->update($uid, array('groupterms' => ($member['groupterms'] ? serialize($member['groupterms']) : ''))); + } +} + +if(!empty($_G['setting']['advexpiration']['allow'])) { + $endtimenotice = mktime(0, 0, 0, date('m', TIMESTAMP), date('d', TIMESTAMP), date('Y', TIMESTAMP)) + $_G['setting']['advexpiration']['day'] * 86400; + $advs = array(); + foreach(C::t('common_advertisement')->fetch_all_endtime($endtimenotice) as $adv) { + $advs[] = ''.$adv['title'].''; + } + if($advs) { + $users = explode("\n", $_G['setting']['advexpiration']['users']); + $users = array_map('trim', $users); + if($users) { + foreach(C::t('common_member')->fetch_all_by_username($users) as $member) { + $noticelang = array('day' => $_G['setting']['advexpiration']['day'], 'advs' => implode("
          ", $advs), 'from_id' => 0, 'from_idtype' => 'advexpire'); + if(in_array('notice', $_G['setting']['advexpiration']['method'])) { + notification_add($member['uid'], 'system', 'system_adv_expiration', $noticelang, 1); + } + if(in_array('mail', $_G['setting']['advexpiration']['method'])) { + $advexpvar = array( + 'tpl' => 'adv_expiration', + 'var' => $noticelang, + 'svar' => $noticelang, + ); + if(!sendmail("{$member['username']} <{$member['email']}>", $advexpvar)) { + runlog('sendmail', "{$member['email']} sendmail failed."); + } + } + } + } + } +} + + +$count = C::t('common_card')->count_by_where("status = '1' AND cleardateline <= '{$_G['timestamp']}'"); +if($count) { + C::t('common_card')->update_to_overdue($_G['timestamp']); + $card_info = serialize(array('num' => $count)); + $cardlog = array( + 'info' => $card_info, + 'dateline' => $_G['timestamp'], + 'operation' => 9 + ); + C::t('common_card_log')->insert($cardlog); +} + +C::t('common_member_action_log')->delete_by_dateline($_G['timestamp'] - 86400); + +C::t('forum_collectioninvite')->delete_by_dateline($_G['timestamp'] - 86400*7); + +loadcache('seccodedata', true); +$_G['cache']['seccodedata']['register']['show'] = 0; +savecache('seccodedata', $_G['cache']['seccodedata']); + +function removedir($dirname, $keepdir = FALSE) { + $dirname = str_replace(array( "\n", "\r", '..'), array('', '', ''), $dirname); + + if(!is_dir($dirname)) { + return FALSE; + } + $handle = opendir($dirname); + while(($file = readdir($handle)) !== FALSE) { + if($file != '.' && $file != '..') { + $dir = $dirname . DIRECTORY_SEPARATOR . $file; + is_dir($dir) ? removedir($dir) : unlink($dir); + } + } + closedir($handle); + return !$keepdir ? (@rmdir($dirname) ? TRUE : FALSE) : TRUE; +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_cleanup_monthly.php b/source/include/cron/cron_cleanup_monthly.php new file mode 100644 index 0000000..5af5388 --- /dev/null +++ b/source/include/cron/cron_cleanup_monthly.php @@ -0,0 +1,17 @@ +delete_exceed(2592000); + +?> \ No newline at end of file diff --git a/source/include/cron/cron_follow_daily.php b/source/include/cron/cron_follow_daily.php new file mode 100644 index 0000000..1b96379 --- /dev/null +++ b/source/include/cron/cron_follow_daily.php @@ -0,0 +1,20 @@ +fetch_all_by_dateline($removetime, '<=') as $feed) { + C::t('home_follow_feed')->insert_archiver($feed); + C::t('home_follow_feed')->delete($feed['feedid']); +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_magic_daily.php b/source/include/cron/cron_magic_daily.php new file mode 100644 index 0000000..f4e0e83 --- /dev/null +++ b/source/include/cron/cron_magic_daily.php @@ -0,0 +1,41 @@ +fetch_all_data(1) as $magic) { + if($magic['supplytype'] && $magic['supplynum']) { + $magicarray[$magic['magicid']]['supplytype'] = $magic['supplytype']; + $magicarray[$magic['magicid']]['supplynum'] = $magic['supplynum']; + } + } + + list($daynow, $weekdaynow) = explode('-', dgmdate(TIMESTAMP, 'd-w', $_G['setting']['timeoffset'])); + + foreach($magicarray as $id => $magic) { + $autosupply = 0; + if($magic['supplytype'] == 1) { + $autosupply = 1; + } elseif($magic['supplytype'] == 2 && $weekdaynow == 1) { + $autosupply = 1; + } elseif($magic['supplytype'] == 3 && $daynow == 1) { + $autosupply = 1; + } + + if(!empty($autosupply)) { + C::t('common_magic')->update($id, array('num' => $magic['supplynum'])); + } + } +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_medal_daily.php b/source/include/cron/cron_medal_daily.php new file mode 100644 index 0000000..6ab3d1e --- /dev/null +++ b/source/include/cron/cron_medal_daily.php @@ -0,0 +1,42 @@ +fetch_all_by_expiration(TIMESTAMP) as $medalnew) { + $uids[] = $medalnew['uid']; + $medalnews[] = $medalnew; +} + +$membermedals = array(); +foreach(C::t('common_member_field_forum')->fetch_all($uids) as $member) { + $membermedals[$member['uid']] = $member['medals']; +} + +foreach($medalnews as $medalnew) { + $medalnew['medals'] = empty($medalnewarray[$medalnew['uid']]) ? explode("\t", $membermedals[$medalnew['uid']]) : explode("\t", $medalnewarray[$medalnew['uid']]); + + foreach($medalnew['medals'] as $key => $medalnewid) { + list($medalid, $medalexpiration) = explode("|", $medalnewid); + if($medalnew['medalid'] == $medalid) { + unset($medalnew['medals'][$key]); + } + } + + $medalnewarray[$medalnew['uid']] = implode("\t", $medalnew['medals']); + C::t('forum_medallog')->update($medalnew['id'], array('status' => 0)); + C::t('common_member_field_forum')->update($medalnew['uid'], array('medals' => $medalnewarray[$medalnew['uid']]), 'UNBUFFERED'); + C::t('common_member_medal')->delete_by_uid_medalid($medalnew['uid'], $medalnew['medalid']); +} +?> \ No newline at end of file diff --git a/source/include/cron/cron_member_optimize_daily.php b/source/include/cron/cron_member_optimize_daily.php new file mode 100644 index 0000000..3996277 --- /dev/null +++ b/source/include/cron/cron_member_optimize_daily.php @@ -0,0 +1,18 @@ +split(100); +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_onlinetime_monthly.php b/source/include/cron/cron_onlinetime_monthly.php new file mode 100644 index 0000000..227f207 --- /dev/null +++ b/source/include/cron/cron_onlinetime_monthly.php @@ -0,0 +1,16 @@ +update_thismonth(); + +?> \ No newline at end of file diff --git a/source/include/cron/cron_promotion_hourly.php b/source/include/cron/cron_promotion_hourly.php new file mode 100644 index 0000000..55554ce --- /dev/null +++ b/source/include/cron/cron_promotion_hourly.php @@ -0,0 +1,17 @@ +delete_all(); + + +?> \ No newline at end of file diff --git a/source/include/cron/cron_publish_halfhourly.php b/source/include/cron/cron_publish_halfhourly.php new file mode 100644 index 0000000..2ef42bd --- /dev/null +++ b/source/include/cron/cron_publish_halfhourly.php @@ -0,0 +1,52 @@ + 0) { + $threadall = C::t('forum_thread')->fetch_all_by_tid($cron_publish_ids); + + foreach ($cron_publish_ids as $tid) { + if(!$threadall[$tid]) { + unset($cron_publish_ids[$tid]); + $dataChanged = true; + } + } + + foreach ($threadall as $stid=>$sdata) { + if ($sdata['dateline'] <= getglobal('timestamp')) { + threadpubsave($stid, true); + unset($cron_publish_ids[$stid]); + $dataChanged = true; + } + } + + if ($dataChanged === true) { + savecache('cronpublish', $cron_publish_ids); + } +} +if (!is_array($cron_publish_ids)) { + $cron_publish_try = dunserialize($cron_publish_ids); + if (!is_array($cron_publish_try)) { + $cron_publish_try = array(); + } + savecache('cronpublish', $cron_publish_try); +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_secqaa_daily.php b/source/include/cron/cron_secqaa_daily.php new file mode 100644 index 0000000..4b802d1 --- /dev/null +++ b/source/include/cron/cron_secqaa_daily.php @@ -0,0 +1,19 @@ + 0) { + require_once libfile('function/cache'); + updatecache('secqaa'); +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_security_cleanup_lastpost.php b/source/include/cron/cron_security_cleanup_lastpost.php new file mode 100644 index 0000000..6477c77 --- /dev/null +++ b/source/include/cron/cron_security_cleanup_lastpost.php @@ -0,0 +1,22 @@ +fetch_all_fids(); +foreach($queryf as $forum) { + $thread = C::t('forum_thread')->fetch_by_fid_displayorder($forum['fid']); + $thread['shortsubject'] = cutstr($thread['subject'], 80); + $lastpost = "{$thread['tid']}\t{$thread['shortsubject']}\t{$thread['lastpost']}\t{$thread['lastposter']}"; + + C::t('forum_forum')->update($forum['fid'], array('lastpost' => $lastpost)); +} +?> \ No newline at end of file diff --git a/source/include/cron/cron_smslog_daily.php b/source/include/cron/cron_smslog_daily.php new file mode 100644 index 0000000..fa523e3 --- /dev/null +++ b/source/include/cron/cron_smslog_daily.php @@ -0,0 +1,18 @@ +fetch_all_by_dateline($removetime, '<=') as $smslog) { + C::t('common_smslog')->insert_archiver($smslog); + C::t('common_smslog')->delete($smslog['smslogid']); +} \ No newline at end of file diff --git a/source/include/cron/cron_tag_daily.php b/source/include/cron/cron_tag_daily.php new file mode 100644 index 0000000..86efa34 --- /dev/null +++ b/source/include/cron/cron_tag_daily.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/source/include/cron/cron_threadexpiry_hourly.php b/source/include/cron/cron_threadexpiry_hourly.php new file mode 100644 index 0000000..655c42d --- /dev/null +++ b/source/include/cron/cron_threadexpiry_hourly.php @@ -0,0 +1,86 @@ +delete_expiration(); + +$actionarray = array(); +foreach(C::t('forum_threadmod')->fetch_all_by_expiration_status($_G['timestamp']) as $expiry) { + switch($expiry['action']) { + case 'EST': $actionarray['UES'][] = $expiry['tid']; break; + case 'EHL': $actionarray['UEH'][] = $expiry['tid']; break; + case 'ECL': $actionarray['UEC'][] = $expiry['tid']; break; + case 'EOP': $actionarray['UEO'][] = $expiry['tid']; break; + case 'EDI': $actionarray['UED'][] = $expiry['tid']; break; + case 'TOK': $actionarray['UES'][] = $expiry['tid']; break; + case 'CCK': $actionarray['UEH'][] = $expiry['tid']; break; + case 'CLK': $actionarray['UEC'][] = $expiry['tid']; break; + case 'SPA': $actionarray['SPD'][] = $expiry['tid']; break; + } +} + +if($actionarray) { + + foreach($actionarray as $action => $tids) { + + + switch($action) { + + case 'UES': + C::t('forum_thread')->update($actionarray[$action], array('displayorder'=>0), true); + C::t('forum_threadmod')->update_by_tid_action($tids, array('EST', 'TOK'), array('status'=>0)); + require_once libfile('function/cache'); + updatecache('globalstick'); + break; + + case 'UEH': + C::t('forum_thread')->update($actionarray[$action], array('highlight'=>0), true); + C::t('forum_threadmod')->update_by_tid_action($tids, array('EHL', 'CCK'), array('status'=>0)); + break; + + case 'UEC': + case 'UEO': + $closed = $action == 'UEO' ? 1 : 0; + C::t('forum_thread')->update($actionarray[$action], array('closed'=>$closed), true); + C::t('forum_threadmod')->update_by_tid_action($tids, array('EOP', 'ECL', 'CLK'), array('status'=>0)); + break; + + case 'UED': + C::t('forum_threadmod')->update_by_tid_action($tids, array('EDI'), array('status'=>0)); + $digestarray = $authoridarry = array(); + foreach(C::t('forum_thread')->fetch_all_by_tid($actionarray[$action]) as $digest) { + $authoridarry[] = $digest['authorid']; + $digestarray[$digest['digest']][] = $digest['authorid']; + } + foreach($digestarray as $digest => $authorids) { + batchupdatecredit('digest', $authorids, array("digestposts=digestposts+'-1'"), -$digest, $fid = 0); + } + C::t('forum_thread')->update($actionarray[$action], array('digest'=>0), true); + break; + + case 'SPD': + C::t('forum_thread')->update($actionarray[$action], array('stamp'=>-1), true); + C::t('forum_threadmod')->update_by_tid_action($tids, array('SPA'), array('status'=>0)); + break; + + } + } + + require_once libfile('function/post'); + + foreach($actionarray as $action => $tids) { + updatemodlog(implode(',', $tids), $action, 0, 1); + } + +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_todayheats_daily.php b/source/include/cron/cron_todayheats_daily.php new file mode 100644 index 0000000..19e53b1 --- /dev/null +++ b/source/include/cron/cron_todayheats_daily.php @@ -0,0 +1,50 @@ +fetch_all_for_guide('hot', 0, array(), $_G['setting']['heatthread']['guidelimit'], $yesterday, 0, 0) as $thread) { + $data[$thread['tid']] = array( + 'cid' => 0, + 'fid' => $thread['fid'], + 'tid' => $thread['tid'] + ); + $fids[$thread['fid']] = array('fid' => $thread['fid'], 'dateline' => $daystr, 'hotnum' => 0); + $tids[$thread['fid']][$thread['tid']] = $thread['tid']; +} +if($data) { + $cids = C::t('forum_threadcalendar')->fetch_all_by_fid_dateline(array_keys($fids), $daystr); + foreach($cids as $fid => $cinfo) { + $hotnum[$cinfo['cid']] = count($tids[$fid]); + foreach($tids[$fid] as $tid) { + $data[$tid]['cid'] = $cinfo['cid']; + } + unset($fids[$fid]); + } + if($fids) { + C::t('forum_threadcalendar')->insert_multiterm($fids); + foreach(C::t('forum_threadcalendar')->fetch_all_by_fid_dateline(array_keys($fids), $daystr) as $fid => $cinfo) { + $hotnum[$cinfo['cid']] = count($tids[$fid]); + foreach($tids[$fid] as $tid) { + $data[$tid]['cid'] = $cinfo['cid']; + } + } + } + C::t('forum_threadhot')->insert_multiterm($data); + foreach($hotnum as $cid => $num) { + C::t('forum_threadcalendar')->update($cid, array('hotnum' => $num)); + } +} + +?> \ No newline at end of file diff --git a/source/include/cron/cron_todaypost_daily.php b/source/include/cron/cron_todaypost_daily.php new file mode 100644 index 0000000..7f1dcdd --- /dev/null +++ b/source/include/cron/cron_todaypost_daily.php @@ -0,0 +1,34 @@ +fetch_sum_todaypost()); + +C::t('forum_forum')->update_oldrank_and_yesterdayposts(); + +$historypost = C::t('common_setting')->fetch_setting('historyposts'); +$hpostarray = explode("\t", $historypost); +$_G['setting']['historyposts'] = $hpostarray[1] < $yesterdayposts ? "$yesterdayposts\t$yesterdayposts" : "$yesterdayposts\t$hpostarray[1]"; + +C::t('common_setting')->update_setting('historyposts', $_G['setting']['historyposts']); +$date = date('Y-m-d', TIMESTAMP - 86400); + +C::t('forum_statlog')->insert_stat_log($date); +C::t('forum_forum')->clear_todayposts(); +$rank = 1; +foreach(C::t('forum_statlog')->fetch_all_rank_by_logdate($date) as $value) { + C::t('forum_forum')->update($value['fid'], array('rank' => $rank)); + $rank++; +} +savecache('historyposts', $_G['setting']['historyposts']); + +?> \ No newline at end of file diff --git a/source/include/cron/cron_todayviews_daily.php b/source/include/cron/cron_todayviews_daily.php new file mode 100644 index 0000000..65a977c --- /dev/null +++ b/source/include/cron/cron_todayviews_daily.php @@ -0,0 +1,25 @@ +fetch_all_order_by_tid(500) as $tid => $addview) { + $deltids[$tid] = $updateviews[$addview['addviews']][] = $tid; +} +if($deltids) { + C::t('forum_threadaddviews')->delete($deltids); +} +foreach($updateviews as $views => $tids) { + C::t('forum_thread')->increase($tids, array('views' => $views), true); +} + +?> \ No newline at end of file diff --git a/source/include/cron/index.htm b/source/include/cron/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/include/cron/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/include/index.htm b/source/include/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/include/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/include/misc/index.htm b/source/include/misc/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/misc/misc_ajax.php b/source/include/misc/misc_ajax.php new file mode 100644 index 0000000..5a72f38 --- /dev/null +++ b/source/include/misc/misc_ajax.php @@ -0,0 +1,274 @@ + 'album', 'blogid' => 'blog', 'sid' => 'share', 'uid' => 'wall'); + + $cmt = C::t('home_comment')->fetch_comment($cid); + if(empty($cmt['idtype']) || !array_key_exists($cmt['idtype'], $idtype_array)) { + showmessage('no_privilege_comment', '', array(), array('return' => true)); + } else if(!$_G['setting'][$idtype_array[$cmt['idtype']].'status']) { + showmessage($idtype_array[$cmt['idtype']].'_status_off'); + } + + if($cid) { + $ajax_edit = 1; + } else { + $ajax_edit = 0; + } + + $list = array(); + $value = C::t('home_comment')->fetch_latest_by_authorid($_G['uid'], $cid); + $list[] = $value; + + + +} elseif($op == 'getfriendgroup') { + + if (!$_G['setting']['friendstatus']) { + showmessage('friend_status_off'); + } + + $uid = intval($_GET['uid']); + if($_G['uid'] && $uid) { + $space = getuserbyuid($_G['uid']); + $query = C::t('home_friend')->fetch_all_by_uid_fuid($_G['uid'], $uid); + $value = $query[0]; + } + + require_once libfile('function/friend'); + $groups = friend_group_list(); + + if(empty($value['gid'])) $value['gid'] = 0; + $group =$groups[$value['gid']]; + +} elseif($op == 'getfriendname') { + + if (!$_G['setting']['friendstatus']) { + showmessage('friend_status_off'); + } + + $groupname = ''; + $group = intval($_GET['group']); + + if($_G['uid'] && $group) { + require_once libfile('function/friend'); + $groups = friend_group_list(); + $groupname = $groups[$group]; + } + +} elseif($op == 'share') { + + if (!$_G['setting']['sharestatus']) { + showmessage('share_status_off'); + } + + require_once libfile('function/share'); + + $list = array(); + foreach(C::t('home_share')->fetch_all_by_uid($_G['uid'], 0, 1) as $value) { + $value = mkshare($value); + $ajax_edit = 1; + $list[] = $value; + } + +} elseif($op == 'album') { + + if (!$_G['setting']['albumstatus']) { + showmessage('album_status_off'); + } + + $id = empty($_GET['id'])?0:intval($_GET['id']); + + $perpage = 10; + $page = empty($_GET['page'])?1:intval($_GET['page']); + $start = ($page-1)*$perpage; + ckstart($start, $perpage); + + if(empty($_G['uid'])) { + showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1)); + } + + $count = C::t('home_pic')->check_albumpic($id, NULL, $_G['uid']); + $piclist = array(); + $multi = ''; + if($count) { + $query = C::t('home_pic')->fetch_all_by_albumid($id, $start, $perpage, 0, 0, 1, $_G['uid']); + foreach($query as $value) { + $value['bigpic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0); + $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']); + $piclist[] = $value; + } + $multi = multi($count, $perpage, $page, "home.php?mod=misc&ac=ajax&op=album&id=$id"); + } + +} elseif($op == 'docomment') { + + if (!$_G['setting']['doingstatus']) { + showmessage('doing_status_off'); + } + + $doid = intval($_GET['doid']); + $clist = $do = array(); + $icon = $_GET['icon'] == 'plus' ? 'minus' : 'plus'; + if($doid) { + if($value = C::t('home_doing')->fetch($doid)) { + $value['icon'] = 'plus'; + if($value['replynum'] > 0 && ($value['replynum'] < 20 || $doid == $value['doid'])) { + $doids[] = $value['doid']; + $value['icon'] = 'minus'; + } elseif($value['replynum']<1) { + $value['icon'] = 'minus'; + } + $value['id'] = 0; + $value['layer'] = 0; + $clist[] = $value; + } + } + + if($_GET['icon'] == 'plus' && $value['replynum']) { + + $tree = new lib_tree(); + + foreach(C::t('home_docomment')->fetch_all_by_doid($doid) as $value) { + + if(empty($value['upid'])) { + $value['upid'] = "do"; + } + $tree->setNode($value['id'], $value['upid'], $value); + } + + $values = $tree->getChilds("do"); + foreach ($values as $key => $id) { + $one = $tree->getValue($id); + $one['layer'] = $tree->getLayer($id) * 2; + $clist[] = $one; + } + } + +} elseif($op == 'delnotice') { + + if(empty($_G['uid'])) { + showmessage('no_privilege_guest'); + } + $id = intval($_GET['id']); + if($id) { + C::t('home_notification')->delete_by_id_uid($id, $_G['uid']); + } + showmessage('do_success'); + +} elseif($op == 'getreward') { + $reward = ''; + if($_G['cookie']['reward_log']) { + $log = explode(',', $_G['cookie']['reward_log']); + if(count($log) == 2 && $log[1]) { + + loadcache('creditrule'); + $creditlog = C::t('common_credit_rule_log')->fetch($log[1]); + $rule = $_G['cache']['creditrule'][$log[0]]; + $rule['cyclenum'] = $rule['rewardnum']? $rule['rewardnum'] - $creditlog['cyclenum'] : 0; + } + dsetcookie('reward_log', ''); + } + +} elseif($op == 'district') { + $container = $_GET['container']; + $showlevel = intval($_GET['level']); + $showlevel = $showlevel >= 1 && $showlevel <= 5 ? $showlevel : 5; + $values = array(intval($_GET['countryid']), intval($_GET['pid']), intval($_GET['cid']), intval($_GET['did']), intval($_GET['coid'])); + $containertype = in_array($_GET['containertype'], array('birth', 'reside'), true) ? $_GET['containertype'] : 'birth'; + $level = 1; + if($values[0]) { + $level++; + } else if($_G['uid'] && !empty($_GET['showdefault'])) { + + space_merge($_G['member'], 'profile'); + $district = array(); + if($containertype == 'birth') { + if(!empty($_G['member']['birthcountry'])) { + $district[] = $_G['member']['birthcountry']; + if(!empty($_G['member']['birthprovince'])) { + $district[] = $_G['member']['birthprovince']; + } + if(!empty($_G['member']['birthcity'])) { + $district[] = $_G['member']['birthcity']; + } + if(!empty($_G['member']['birthdist'])) { + $district[] = $_G['member']['birthdist']; + } + if(!empty($_G['member']['birthcommunity'])) { + $district[] = $_G['member']['birthcommunity']; + } + } + } else { + if(!empty($_G['member']['residecountry'])) { + $district[] = $_G['member']['residecountry']; + if(!empty($_G['member']['resideprovince'])) { + $district[] = $_G['member']['resideprovince']; + } + if(!empty($_G['member']['residecity'])) { + $district[] = $_G['member']['residecity']; + } + if(!empty($_G['member']['residedist'])) { + $district[] = $_G['member']['residedist']; + } + if(!empty($_G['member']['residecommunity'])) { + $district[] = $_G['member']['residecommunity']; + } + } + } + if(!empty($district)) { + foreach(C::t('common_district')->fetch_all_by_name($district) as $value) { + $key = $value['level']; + $values[$key] = $value['id']; + } + $level++; + } + } + if($values[1]) { + $level++; + } + if($values[2]) { + $level++; + } + if($values[3]) { + $level++; + } + if($values[4]) { + $level++; + } + $showlevel = $level; + $elems = array(); + if($_GET['country']) { + $elems = array($_GET['country'], $_GET['province'], $_GET['city'], $_GET['district'], $_GET['community']); + } + + include_once libfile('function/profile'); + $html = showdistrict($values, $elems, $container, $showlevel, $containertype); +} elseif($_GET['op'] == 'createalbum') { + if (!$_G['setting']['albumstatus']) { + showmessage('album_status_off'); + } + $albumname = 'new:'.$_GET['name']; + require_once libfile('function/spacecp'); + $albumid = album_creat_by_id($albumname, intval($_GET['catid'])); +} + +include template('home/misc_ajax'); + +?> \ No newline at end of file diff --git a/source/include/misc/misc_category.php b/source/include/misc/misc_category.php new file mode 100644 index 0000000..65623e7 --- /dev/null +++ b/source/include/misc/misc_category.php @@ -0,0 +1,91 @@ +fetch_all_info_by_fids($gid); +$query = C::t('forum_forum')->fetch_all_info_by_fids(0, 1, 0, $gid, 1, 0, 0, 'forum'); +if(!empty($_G['member']['accessmasks'])) { + $fids = array_keys($query); + $accesslist = C::t('forum_access')->fetch_all_by_fid_uid($fids, $_G['uid']); + foreach($query as $key => $val) { + $query[$key]['allowview'] = $accesslist[$key]; + } +} +if(empty($gquery) || empty($query)) { + showmessage('forum_nonexistence', NULL); +} +$query = array_merge($gquery, $query); +$fids = array(); +foreach($query as $forum) { + $forum['extra'] = dunserialize($forum['extra']); + if(!is_array($forum['extra'])) { + $forum['extra'] = array(); + } + if($forum['type'] != 'group') { + $threads += $forum['threads']; + $posts += $forum['posts']; + $todayposts += $forum['todayposts']; + if(forum($forum)) { + $forum['orderid'] = isset($catlist[$forum['fup']]['forumscount']) ? $catlist[$forum['fup']]['forumscount'] : 0; + $catlist[$forum['fup']]['forumscount'] = $forum['orderid'] + 1; + $forum['subforums'] = ''; + $forumlist[$forum['fid']] = $forum; + $catlist[$forum['fup']]['forums'][] = $forum['fid']; + $fids[] = $forum['fid']; + } + } else { + $forum['collapseimg'] = 'collapsed_no.gif'; + $forum['collapseicon'] = '_no'; + $collapse['category_'.$forum['fid']] = ''; + + if($forum['moderators']) { + $forum['moderators'] = moddisplay($forum['moderators'], 'flat'); + } + $catlist[$forum['fid']] = $forum; + + $navigation = ' '.$forum['name']; + $navtitle_g = strip_tags($forum['name']); + } +} +if($catlist) { + foreach($catlist as $key => $var) { + $catlist[$key]['forumcolumns'] = $var['catforumcolumns']; + if($var['forumscount'] && $var['catforumcolumns']) { + $catlist[$key]['forumcolwidth'] = (floor(100 / $var['catforumcolumns']) - 0.1).'%'; + $catlist[$key]['endrows'] = ''; + if($colspan = $var['forumscount'] % $var['catforumcolumns']) { + while(($var['catforumcolumns'] - $colspan) > 0) { + $catlist[$key]['endrows'] .= ' '; + $colspan ++; + } + $catlist[$key]['endrows'] .= ''; + } + } + } +} +$query = C::t('forum_forum')->fetch_all_subforum_by_fup($fids); +foreach($query as $forum) { + if($_G['setting']['subforumsindex'] && $forumlist[$forum['fup']]['permission'] == 2) { + $forumurl = !empty($forum['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? $_G['scheme'].'://'.$forum['domain'].'.'.$_G['setting']['domain']['root']['forum'] : 'forum.php?mod=forumdisplay&fid='.$forum['fid']; + $forumlist[$forum['fup']]['subforums'] .= ''.$forum['name'].'  '; + } + $forumlist[$forum['fup']]['threads'] += $forum['threads']; + $forumlist[$forum['fup']]['posts'] += $forum['posts']; + $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts']; + +} + +?> \ No newline at end of file diff --git a/source/include/misc/misc_emailcheck.php b/source/include/misc/misc_emailcheck.php new file mode 100644 index 0000000..9c8e232 --- /dev/null +++ b/source/include/misc/misc_emailcheck.php @@ -0,0 +1,80 @@ + TIMESTAMP - 86400) { + $member = getuserbyuid($uid); + $member = array_merge(C::t('common_member_field_forum')->fetch($uid), $member); + list($dateline, $operation, $idstring) = explode("\t", $member['authstr']); + if($dateline != $time || $operation != 3 || $idstring != substr(md5($email), 0, 6)) { + showmessage('email_check_error', 'index.php'); + } + + $setarr = array('email'=>$email, 'emailstatus'=>'1'); + if($member['freeze'] == 2) { + $setarr['freeze'] = 0; + } + loaducenter(); + $ucresult = uc_user_edit(addslashes($member['username']), '', '', $email, 1); + if($ucresult == -8) { + showmessage('email_check_account_invalid', '', array(), array('return' => true)); + } elseif($ucresult == -4) { + showmessage('profile_email_illegal', '', array(), array('return' => true)); + } elseif($ucresult == -5) { + showmessage('profile_email_domain_illegal', '', array(), array('return' => true)); + } elseif($ucresult == -6) { + showmessage('profile_email_duplicate', '', array(), array('return' => true)); + } + if($_G['setting']['regverify'] == 1 && $member['groupid'] == 8) { + $membergroup = C::t('common_usergroup')->fetch_by_credits($member['credits']); + $setarr['groupid'] = $membergroup['groupid']; + } + $oldemail = $member['email']; + updatecreditbyaction('realemail', $uid); + C::t('common_member')->update($uid, $setarr); + C::t('common_member_field_forum')->update($uid, array('authstr' => '')); + C::t('common_member_validate')->delete($uid); + dsetcookie('newemail', "", -1); + + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + $reset_email_subject = array( + 'tpl' => 'email_reset', + 'var' => array( + 'username' => $member['username'], + 'bbname' => $_G['setting']['bbname'], + 'siteurl' => $_G['setting']['securesiteurl'], + 'datetime' => dgmdate(time(), 'Y-m-d H:i:s'), + 'request_datetime' => dgmdate($time, 'Y-m-d H:i:s'), + 'email' => $email, + 'clientip' => $_G['clientip'] + ) + ); + if(!sendmail("{$member['username']} <$oldemail>", $reset_email_subject)) { + runlog('sendmail', "$oldemail sendmail failed."); + } + + showmessage('email_check_sucess', 'home.php?mod=spacecp&ac=profile&op=password', array('email' => $email)); +} else { + showmessage('email_check_error', 'index.php'); +} + +?> \ No newline at end of file diff --git a/source/include/misc/misc_forumselect.php b/source/include/misc/misc_forumselect.php new file mode 100644 index 0000000..89829b6 --- /dev/null +++ b/source/include/misc/misc_forumselect.php @@ -0,0 +1,86 @@ + $fid) { + if($_G['cache']['forums'][$fid]['type'] == 'sub') { + $commonfids[] = $_G['cache']['forums'][$fid]['fup']; + unset($commonfids[$k]); + } + } + + $commonfids = array_unique($commonfids); + + foreach($commonfids as $fid) { + $fid = intval($fid); + $commonlist .= '
        • '.$_G['cache']['forums'][$fid]['name'].'
        • '; + } +} + +foreach($_G['cache']['forums'] as $forum) { + if(!$forum['status'] || $forum['status'] == 2) { + continue; + } + if($forum['type'] != 'group' && $special !== null) { + $allow = false; + if(!$forum['postperm'] || $forum['postperm'] && forumperm($forum['postperm'])) { + if($special == 1) { + $allow = $_G['group']['allowpostpoll'] && substr($forum['allowpostspecial'], -1, 1); + } elseif($special == 2) { + $allow = $_G['group']['allowposttrade'] && substr($forum['allowpostspecial'], -2, 1); + } elseif($special == 3) { + $allow = $_G['group']['allowpostreward'] && isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]) && substr($forum['allowpostspecial'], -3, 1); + } elseif($special == 4) { + $allow = $_G['group']['allowpostactivity'] && substr($forum['allowpostspecial'], -4, 1); + } elseif($special == 5) { + $allow = $_G['group']['allowpostdebate'] && substr($forum['allowpostspecial'], -5, 1); + } else { + $allow = true; + $special = 0; + } + } + if(!$allow) { + continue; + } + } + if($forum['type'] == 'group') { + $grouplist .= '
        • '.$forum['name'].'
        • '; + $visible[$forum['fid']] = true; + } elseif($forum['type'] == 'forum' && isset($visible[$forum['fup']]) && (!$forum['viewperm'] || ($forum['viewperm'] && forumperm($forum['viewperm'])) || strstr($forum['users'], "\t{$_G['uid']}\t"))) { + $forumlist[$forum['fup']] .= '
        • '.$forum['name'].'
        • '; + $visible[$forum['fid']] = true; + } elseif($forum['type'] == 'sub' && isset($visible[$forum['fup']]) && (!$forum['viewperm'] || ($forum['viewperm'] && forumperm($forum['viewperm'])) || strstr($forum['users'], "\t{$_G['uid']}\t"))) { + $subforumlist[$forum['fup']] .= '
        • '.$forum['name'].'
        • '; + } +} + +include template('forum/post_forumselect'); +exit; + +?> \ No newline at end of file diff --git a/source/include/misc/misc_inputpwd.php b/source/include/misc/misc_inputpwd.php new file mode 100644 index 0000000..829db23 --- /dev/null +++ b/source/include/misc/misc_inputpwd.php @@ -0,0 +1,48 @@ +fetch($blogid); + $itemurl = "home.php?mod=space&uid={$itemarr['uid']}&do=blog&id={$itemarr['blogid']}"; + $cookiename = 'view_pwd_blog_'.$blogid; + } elseif($albumid) { + if (!$_G['setting']['albumstatus']) { + showmessage('album_status_off'); + } + $itemarr = C::t('home_album')->fetch_album($albumid); + $itemurl = "home.php?mod=space&uid={$itemarr['uid']}&do=album&id={$itemarr['albumid']}"; + $cookiename = 'view_pwd_album_'.$albumid; + } + + if(empty($itemarr)) { + showmessage('news_does_not_exist'); + } + + if($itemarr['password'] && $_POST['viewpwd'] == $itemarr['password']) { + dsetcookie($cookiename, md5(md5($itemarr['password']))); + showmessage('proved_to_be_successful', $itemurl, array('succeed'=>1), array('showmsg'=>1, 'timeout'=>1)); + } else { + showmessage('password_is_not_passed', $itemurl, array('succeed'=>0), array('showmsg'=>1)); + } +} + +?> \ No newline at end of file diff --git a/source/include/misc/misc_promotion.php b/source/include/misc/misc_promotion.php new file mode 100644 index 0000000..07f1561 --- /dev/null +++ b/source/include/misc/misc_promotion.php @@ -0,0 +1,48 @@ +fetch($_G['clientip'])) { + C::t('forum_promotion')->insert(array('ip' => $_G['clientip'], 'port' => $_G['remoteport'], 'uid' => $fromuid, 'username' => $fromuser), false, true); + updatecreditbyaction('promotion_visit', $fromuid); + } + } + + if($_G['setting']['creditspolicy']['promotion_register']) { + if(!empty($fromuser) && empty($fromuid)) { + if(empty($_G['cookie']['promotion'])) { + $fromuid = C::t('common_member')->fetch_uid_by_username($fromuser); + } else { + $fromuid = intval($_G['cookie']['promotion']); + } + } + if($fromuid) { + dsetcookie('promotion', ($_G['cookie']['promotion'] = $fromuid), 1800); + } + } + +} + +?> \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_activity.php b/source/include/misc/misc_ranklist_activity.php new file mode 100644 index 0000000..d8063ae --- /dev/null +++ b/source/include/misc/misc_ranklist_activity.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_blog.php b/source/include/misc/misc_ranklist_blog.php new file mode 100644 index 0000000..d53e950 --- /dev/null +++ b/source/include/misc/misc_ranklist_blog.php @@ -0,0 +1,61 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_forum.php b/source/include/misc/misc_ranklist_forum.php new file mode 100644 index 0000000..754a3c7 --- /dev/null +++ b/source/include/misc/misc_ranklist_forum.php @@ -0,0 +1,43 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_group.php b/source/include/misc/misc_ranklist_group.php new file mode 100644 index 0000000..eaaaf2a --- /dev/null +++ b/source/include/misc/misc_ranklist_group.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_index.php b/source/include/misc/misc_ranklist_index.php new file mode 100644 index 0000000..381564e --- /dev/null +++ b/source/include/misc/misc_ranklist_index.php @@ -0,0 +1,130 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_member.php b/source/include/misc/misc_ranklist_member.php new file mode 100644 index 0000000..ff427fe --- /dev/null +++ b/source/include/misc/misc_ranklist_member.php @@ -0,0 +1,261 @@ +count_by_credits($mycredits); + } else { + $now_pos = C::t('common_member_count')->count_by_extcredits($now_choose, $mycredits); + } + $now_pos++; + dsetcookie($cookie_name, $now_pos); + } + } else { + $now_pos = -1; + } + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} elseif ($_GET['view'] == 'friendnum' && helper_access::check_module('friend')) { + + $gettype = 'friend'; + if($_G['uid']) { + $space = $_G['member']; + space_merge($space, 'count'); + $cookie_name = 'space_top_'.$_GET['view'].'_'.$_G['uid']; + if($_G['cookie'][$cookie_name]) { + $now_pos = $_G['cookie'][$cookie_name]; + } else { + $now_pos = C::t('common_member_count')->count_by_friends($space['friends']); + $now_pos++; + dsetcookie($cookie_name, $now_pos); + } + } else { + $now_pos = -1; + } + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} elseif ($_GET['view'] == 'invite') { + + $gettype = 'invite'; + $now_pos = -1; + $inviterank_change = 1; + $now_choose = 'thisweek'; + switch($_GET['orderby']) { + case 'thismonth': + $now_choose = 'thismonth'; + break; + case 'today': + $now_choose = 'today'; + break; + case 'thisweek': + $now_choose = 'thisweek'; + break; + default : + $now_choose = 'all'; + } + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} elseif($_GET['view'] == 'blog' && helper_access::check_module('blog')) { + + $gettype = 'blog'; + $now_pos = -1; + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} elseif($_GET['view'] == 'beauty') { + + $gettype = 'girl'; + $now_pos = -1; + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} elseif($_GET['view'] == 'handsome') { + + $gettype = 'boy'; + $now_pos = -1; + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} elseif($_GET['view'] == 'post' && helper_access::check_module('forum')) { + + $gettype = 'post'; + $postsrank_change = 1; + $now_pos = -1; + $now_choose = 'posts'; + switch($_GET['orderby']) { + case 'digestposts': + $now_choose = 'digestposts'; + break; + case 'thismonth': + $now_choose = 'thismonth'; + break; + case 'today': + $now_choose = 'today'; + break; + } + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} elseif($_GET['view'] == 'onlinetime' && !$_G['setting']['sessionclose']) { + + $gettype = 'onlinetime'; + $onlinetimerank_change = 1; + $now_pos = -1; + $now_choose = 'thismonth'; + switch($_GET['orderby']) { + case 'thismonth': + $now_choose = 'thismonth'; + break; + case 'all': + $now_choose = 'all'; + break; + default : + $_GET['orderby'] = 'thismonth'; + } + + $view = $_GET['view']; + $orderby = $_GET['orderby']; + $list = getranklistdata($type, $view, $orderby); + +} else { + if(!$ranklist_setting['membershow']) { + header('Location: misc.php?mod=ranklist&type=member&view=beauty'); + } + $announcement = $ranklist_setting['membershowannouncement']; + $gettype = 'bid'; + $cachetip = FALSE; + $_GET['view'] = 'show'; + $creditid = 0; + if($_G['setting']['creditstransextra'][6]) { + $creditid = intval($_G['setting']['creditstransextra'][6]); + $creditkey = 'extcredits'.$creditid; + } elseif ($_G['setting']['creditstrans']) { + $creditid = intval($_G['setting']['creditstrans']); + $creditkey = 'extcredits'.$creditid; + } + $extcredits = $_G['setting']['extcredits']; + $count = C::t('home_show')->count_by_credit(); + $space = array(); + if($count) { + $space = $_G['member']; + space_merge($space, 'count'); + $space['credit'] = empty($creditkey) ? 0 : $space[$creditkey]; + + $myshowinfo = C::t('home_show')->fetch_by_uid_credit($space['uid']); //DB::fetch_first("SELECT unitprice, credit FROM ".DB::table('home_show')." WHERE uid='{$space['uid']}' AND credit>0"); + $myallcredit = intval($myshowinfo['credit']); + $space['unitprice'] = intval($myshowinfo['unitprice']); + $now_pos = C::t('home_show')->count_by_credit($space['unitprice']);//DB::result_first("SELECT COUNT(*) FROM ".DB::table('home_show')." WHERE unitprice>='{$space['unitprice']}' AND credit>0"); + + $deluser = false; + $query = C::t('home_show')->fetch_all_by_unitprice($start, $perpage); + foreach ($query as $value) { + if(!$deluser && $value['show_credit'] < 1) { + $deluser = true; + } else { + $list[$value['uid']] = $value; + } + } + if($deluser) { + C::t('home_show')->delete_by_credit(1); + } + $multi = multi($count, $perpage, $page, "misc.php?mod=ranklist&type=member&view={$_GET['view']}"); + } +} + +if($cachetip) { + $lastupdate = $_G['lastupdate']; + $nextupdate = $_G['nextupdate']; +} + +$myfuids =array(); +$query = C::t('home_friend')->fetch_all($_G['uid']); +foreach($query as $value) { + $myfuids[$value['fuid']] = $value['fuid']; +} +$myfuids[$_G['uid']] = $_G['uid']; + +$i = $_GET['page'] ? ($_GET['page']-1)*$perpage+1 : 1; +foreach($list as $key => $value) { + $fuids[] = $value['uid']; + if(isset($value['lastactivity'])) $value['lastactivity'] = dgmdate($value['lastactivity'], 't'); + $value['isfriend'] = empty($myfuids[$value['uid']])?0:1; + $list[$key] = $value; + $list[$key]['rank'] = $i; + $i++; +} + +$ols = array(); +if($fuids) { + foreach(C::app()->session->fetch_all_by_uid($fuids) as $value) { + if(!$value['invisible']) { + $ols[$value['uid']] = $value['lastactivity']; + } elseif ($_GET['view'] == 'online' && $list[$value['uid']]) { + unset($list[$value['uid']]); + } + } +} + +$a_actives = array($_GET['view'] => ' class="a"'); + +$navname = $_G['setting']['navs'][8]['navname']; +$navtitle = lang('ranklist/navtitle', 'ranklist_title_member_'.$gettype).' - '.$navname; +$metakeywords = lang('ranklist/navtitle', 'ranklist_title_member_'.$gettype); +$metadescription = lang('ranklist/navtitle', 'ranklist_title_member_'.$gettype); + +include template('diy:ranklist/member'); + +?> \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_picture.php b/source/include/misc/misc_ranklist_picture.php new file mode 100644 index 0000000..b661691 --- /dev/null +++ b/source/include/misc/misc_ranklist_picture.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_poll.php b/source/include/misc/misc_ranklist_poll.php new file mode 100644 index 0000000..26eccf2 --- /dev/null +++ b/source/include/misc/misc_ranklist_poll.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_ranklist_thread.php b/source/include/misc/misc_ranklist_thread.php new file mode 100644 index 0000000..0d8ff17 --- /dev/null +++ b/source/include/misc/misc_ranklist_thread.php @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/source/include/misc/misc_security.php b/source/include/misc/misc_security.php new file mode 100644 index 0000000..576e6b9 --- /dev/null +++ b/source/include/misc/misc_security.php @@ -0,0 +1,151 @@ +config['security']['attackevasive'])) { + $attackevasive_tmp = explode('|', $this->config['security']['attackevasive']); + $attackevasive = 0; + foreach($attackevasive_tmp AS $key => $value) { + $attackevasive += intval($value); + } + unset($attackevasive_tmp); +} else { + $attackevasive = $this->config['security']['attackevasive']; +} + +$lastrequest = isset($_G['cookie']['lastrequest']) ? authcode($_G['cookie']['lastrequest'], 'DECODE') : ''; + +if($attackevasive & 1 || $attackevasive & 4) { + dsetcookie('lastrequest', authcode(TIMESTAMP, 'ENCODE'), TIMESTAMP + 816400, 1, true); +} + +if($attackevasive & 1) { + if(TIMESTAMP - $lastrequest < 1) { + securitymessage('attackevasive_1_subject', 'attackevasive_1_message'); + } +} + +if(($attackevasive & 2) && ($_SERVER['HTTP_X_FORWARDED_FOR'] || + $_SERVER['HTTP_VIA'] || $_SERVER['HTTP_PROXY_CONNECTION'] || + $_SERVER['HTTP_USER_AGENT_VIA'] || $_SERVER['HTTP_CACHE_INFO'] || + $_SERVER['HTTP_PROXY_CONNECTION'])) { + securitymessage('attackevasive_2_subject', 'attackevasive_2_message', FALSE); +} + +if($attackevasive & 4) { + if(empty($lastrequest) || TIMESTAMP - $lastrequest > 300) { + securitymessage('attackevasive_4_subject', 'attackevasive_4_message'); + } +} + +if($attackevasive & 8) { + list($visitcode, $visitcheck, $visittime) = explode('|', authcode($_G['cookie']['visitcode'], 'DECODE')); + if(!$visitcode || !$visitcheck || !$visittime || TIMESTAMP - $visittime > 60 * 60 * 4 ) { + if(empty($_POST['secqsubmit']) || ($visitcode != md5($_POST['answer']))) { + $answer = 0; + $question = ''; + for ($i = 0; $i< rand(2, 5); $i ++) { + $r = rand(1, 20); + $question .= $question ? ' + '.$r : $r; + $answer += $r; + } + $question .= ' = ?'; + dsetcookie('visitcode', authcode(md5($answer).'|0|'.TIMESTAMP, 'ENCODE'), TIMESTAMP + 816400, 1, true); + securitymessage($question, '', FALSE, TRUE); + } else { + dsetcookie('visitcode', authcode($visitcode.'|1|'.TIMESTAMP, 'ENCODE'), TIMESTAMP + 816400, 1, true); + } + } + +} + +function securitymessage($subject, $message, $reload = TRUE, $form = FALSE) { + global $_G; + + include_once DISCUZ_ROOT.'./source/language/lang_security.php'; + + if(!is_array($lang)) { + $lang = array(); + } + + $subject = isset($lang[$subject]) ? $lang[$subject] : $subject; + $message = isset($lang[$message]) ? $lang[$message] : $message; + + if($_GET['inajax']) { + security_ajaxshowheader(); + echo '
          '.$subject.'

          '.$message.'
          '; + security_ajaxshowfooter(); + } else { + $charset = getglobal('config/output/charset'); + @header('Content-Type: text/html; charset='.$charset); + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''.$subject.''; + echo ''; + echo ''; + if($reload) { + echo ''; + } + if($form) { + echo '
          '; + } + echo ''; + echo ' '; + echo ' '; + echo ' '; + echo '
          '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
          '; + echo '

          '.$subject.'

          '; + echo $message; + echo '

          '; + echo '
          '; + echo '
          '; + if($form) { + echo '
          '; + } + echo ''; + echo ''; + } + exit(); +} + + +function security_ajaxshowheader() { + $charset = getglobal('config/output/charset'); + ob_end_clean(); + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + @header("Content-type: application/xml; charset=".$charset); + echo "\n'; + exit(); +} + +?> \ No newline at end of file diff --git a/source/include/misc/misc_sendmail.php b/source/include/misc/misc_sendmail.php new file mode 100644 index 0000000..f0e65bb --- /dev/null +++ b/source/include/misc/misc_sendmail.php @@ -0,0 +1,72 @@ +fetch_all_by_sendtime($_G['timestamp'], 0, $pernum) as $value) { + if($value['touid']) $touids[$value['touid']] = $value['touid']; + $cids[] = $value['cid']; + $list[$value['cid']] = $value; +} + +if(empty($cids)) exit(); + +foreach(C::t('common_mailqueue')->fetch_all_by_cid($cids) as $value) { + $sublist[$value['cid']][] = $value; +} + +if($touids) { + C::t('common_member_status')->update($touids, array('lastsendmail' => TIMESTAMP), 'UNBUFFERED'); +} + +C::t('common_mailcron')->delete($cids); +C::t('common_mailqueue')->delete_by_cid($cids); + +require_once libfile('function/mail'); + +foreach ($list as $cid => $value) { + $mlist = $sublist[$cid]; + if($value['email'] && $mlist) { + $subject = getstr($mlist[0]['subject'], 80, 0, 0, 0, -1); + $message = ''; + if(count($mlist) == 1) { + $message = '
          '.$mlist[0]['message']; + } else { + foreach ($mlist as $subvalue) { + if($subvalue['message']) { + $message .= "
          {$subvalue['subject']}
          {$subvalue['message']}
          "; + } else { + $message .= $subvalue['subject'].'
          '; + } + } + } + if(!sendmail($value['email'], $subject, $message)) { + runlog('sendmail', "{$value['email']} sendmail failed."); + } + } +} + +?> \ No newline at end of file diff --git a/source/include/misc/misc_stat.php b/source/include/misc/misc_stat.php new file mode 100644 index 0000000..ebaf915 --- /dev/null +++ b/source/include/misc/misc_stat.php @@ -0,0 +1,132 @@ + $endunixstr) { + showmessage('start_time_is_greater_than_end_time', NULL, array(), array('return' => true)); +} else if ($beginunixstr == $endunixstr) { + showmessage('start_time_end_time_is_equal_to', NULL, array(), array('return' => true)); +} +if (!empty($_GET['xml'])) { + $xaxis = ''; + $graph = array(); + $count = 1; + $begin = dgmdate($beginunixstr, 'Ymd'); + $end = dgmdate($endunixstr, 'Ymd'); + $field = '*'; + if (!empty($_GET['merge'])) { + if (empty($_GET['types'])) { + $_GET['types'] = array_merge($cols['login'], $cols['forum'], $cols['tgroup'], $cols['home'], $cols['space']); + } + + if (!array_diff($_GET['types'], array_merge($cols['login'], $cols['forum'], $cols['tgroup'], $cols['home'], $cols['space']))) { + $field = 'daytime,`' . implode('`+`', $_GET['types']) . '` AS statistic'; + } + $type = 'statistic'; + } + foreach (C::t('common_stat')->fetch_all_stat($begin, $end, $field) as $value) { + $xaxis .= "" . substr($value['daytime'], 4, 4) . ""; + if ($type == 'all') { + foreach ($cols as $ck => $cvs) { + if ($ck == 'login') { + $graph['login'] .= "{$value['login']}"; + $graph['register'] .= "{$value['register']}"; + } else { + $num = 0; + foreach ($cvs as $cvk) { + $num = $value[$cvk] + $num; + } + $graph[$ck] .= "" . $num . ""; + } + } + } else { + if (empty($_GET['types']) || !empty($_GET['merge'])) { + $graph[$type] .= "" . $value[$type] . ""; + } else { + foreach ($_GET['types'] as $t) { + $graph[$t] .= "" . $value[$t] . ""; + } + } + } + $count++; + } + $xml = ''; + $xml .= '<' . "?xml version=\"1.0\" encoding=\"utf-8\"?>"; + $xml .= ''; + $xml .= $xaxis; + $xml .= ""; + $count = 0; + foreach ($graph as $key => $value) { + $title = diconv(lang('spacecp', "do_stat_$key"), CHARSET, 'utf-8'); + if ($title == '') { + continue; + } + $xml .= ""; + $xml .= $value; + $xml .= ''; + $count++; + } + $xml .= ''; + + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + @header("Content-type: application/xml; charset=utf-8"); + echo $xml; + exit(); +} + +$actives = array(); + +if($type == 'all') { + $actives[$type] = ' class="a"'; +} else { + $type = ''; +} + +require_once libfile('function/home'); +$siteurl = getsiteurl(); +$types = ''; +$merge = !empty($_GET['merge']) ? '&merge=1' : ''; +if (is_array(getgpc('types'))) { + foreach (getgpc('types') as $value) { + $types .= '&types[]=' . $value; + $actives[$value] = ' class="a"'; + } +} +$statuspara = "misc.php?mod=stat&op=trend&xml=1&type=$type&primarybegin=$primarybegin&primaryend=$primaryend{$types}{$merge}"; + +include template('home/misc_stat'); \ No newline at end of file diff --git a/source/include/misc/misc_swfupload.php b/source/include/misc/misc_swfupload.php new file mode 100644 index 0000000..4d17906 --- /dev/null +++ b/source/include/misc/misc_swfupload.php @@ -0,0 +1,211 @@ + true, 'login' => 1)); +} + +if($op == "finish") { + + $albumid = intval($_GET['albumid']); + + if($albumid > 0) { + album_update_pic($albumid); + } + + $space = getuserbyuid($_G['uid']); + + if(ckprivacy('upload', 'feed')) { + require_once libfile('function/feed'); + feed_publish($albumid, 'albumid'); + } + + exit(); + +} elseif($op == 'config') { + + $hash = md5($_G['uid'].UC_KEY); + $uploadurl = urlencode(getsiteurl().'home.php?mod=misc&ac=swfupload'.($iscamera ? '&op=screen' : ($isdoodle ? '&op=doodle&from=':''))); + if($isupload) { + if(!checkperm('allowupload')) { + $hash = ''; + } + } else { + $filearr = $dirstr = array(); + if($iscamera) { + $directory = dreaddir(DISCUZ_ROOT.'./static/image/foreground'); + foreach($directory as $key => $value) { + $dirstr = DISCUZ_ROOT.'./static/image/foreground/'.$value; + if(is_dir($dirstr)) { + $filearr = dreaddir($dirstr, array('jpg','jpeg','gif','png','webp')); + if(!empty($filearr)) { + if(is_file($dirstr.'/categories.txt')) { + $catfile = @file($dirstr.'/categories.txt'); + $dirarr[$key][0] = trim($catfile[0]); + } else { + $dirarr[$key][0] = trim($value); + } + $dirarr[$key][1] = trim('static/image/foreground/'.$value.'/'); + $dirarr[$key][2] = $filearr; + } + } + } + } elseif($isdoodle) { + $filearr = dreaddir(DISCUZ_ROOT.'./static/image/doodle/big', array('jpg','jpeg','gif','png','webp')); + } + } + $feedurl = urlencode(getsiteurl().'home.php?mod=misc&ac=swfupload&op=finish&random='.random(8).'&albumid='); + $albumurl = urlencode(getsiteurl().'home.php?mod=space&do=album'.($isdoodle ? '&picid=' : '&id=')); + $max = 0; + if(!empty($_G['group']['maximagesize'])) { + $max = intval($_G['group']['maximagesize']); + } else { + require_once libfile('function/upload'); + $max = getmaxupload(); + $unit = strtolower(substr($max, -1, 1)); + if($unit == 'k') { + $max = intval($max)*1024; + } elseif($unit == 'm') { + $max = intval($max)*1024*1024; + } elseif($unit == 'g') { + $max = intval($max)*1024*1024*1024; + } + } + $albums = getalbums($_G['uid']); + loadcache('albumcategory'); + $categorys = $_G['cache']['albumcategory']; + $categorystat = $_G['setting']['albumcategorystat'] && !empty($categorys) ? intval($_G['setting']['albumcategorystat']) : 0; + $categoryrequired = $_G['setting']['albumcategoryrequired'] && !empty($categorys) ? intval($_G['setting']['albumcategoryrequired']) : 0; + +} elseif($op == "screen" || $op == "doodle") { + + if(empty($GLOBALS['HTTP_RAW_POST_DATA'])) { + $GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input"); + } + $status = "failure"; + $dosave = true; + + if($op == "doodle") { + $magic = C::t('common_magic')->fetch_member_magic($_G['uid'], 'doodle'); + if(empty($magic) || $magic['num'] < 1) { + $uploadfiles = -8; + $dosave = false; + } + } + + if($dosave && !empty($GLOBALS['HTTP_RAW_POST_DATA'])) { + $_SERVER['HTTP_ALBUMID'] = addslashes(diconv(urldecode($_SERVER['HTTP_ALBUMID']), 'UTF-8')); + $from = false; + if($op == 'screen') { + $from = 'camera'; + } elseif($_GET['from'] == 'album') { + $from = 'uploadimage'; + } + $_G['setting']['allowwatermark'] = 0; + $uploadfiles = stream_save($GLOBALS['HTTP_RAW_POST_DATA'], $_SERVER['HTTP_ALBUMID'], 'jpg', '', '', 0, $from); + } + + $uploadResponse = true; + $picid = $proid = $albumid = 0; + if($uploadfiles && is_array($uploadfiles)) { + $status = "success"; + $albumid = $uploadfiles['albumid']; + $picid = $uploadfiles['picid']; + if($op == "doodle") { + $fileurl = pic_get($uploadfiles['filepath'], 'album', $uploadfiles['thumb'], $uploadfiles['remote'], 0); + $remote = $uploadfiles['remote'] > 1 ? $uploadfiles['remote'] - 2 : $uploadfiles['remote']; + if(!$remote) { + if(!preg_match("/^http\:\/\//i", $fileurl)) { + $fileurl = getsiteurl().$fileurl; + } + } + require_once libfile('function/magic'); + usemagic($magic['magicid'], $magic['num'], 1); + updatemagiclog($magic['magicid'], '2', '1', '0'); + if($albumid > 0) { + album_update_pic($albumid); + } + } + } else { + switch ($uploadfiles) { + case -1: + $uploadfiles = lang('spacecp', 'inadequate_capacity_space'); + break; + case -2: + $uploadfiles = lang('spacecp', 'only_allows_upload_file_types'); + break; + case -4: + $uploadfiles = lang('spacecp', 'ftp_upload_file_size'); + break; + case -8: + $uploadfiles = lang('spacecp', 'has_not_more_doodle'); + break; + default: + $uploadfiles = lang('spacecp', 'mobile_picture_temporary_failure'); + break; + } + } + +} elseif($_FILES && $_POST) { + + if($_FILES["Filedata"]['error']) { + $uploadfiles = lang('spacecp', 'file_is_too_big'); + } else { + $_FILES["Filedata"]['name'] = addslashes(diconv(urldecode($_FILES["Filedata"]['name']), 'UTF-8')); + $_POST['albumid'] = addslashes(diconv(urldecode($_POST['albumid']), 'UTF-8')); + $catid = $_POST['catid'] ? intval($_POST['catid']) : 0; + $uploadfiles = pic_save($_FILES["Filedata"], $_POST['albumid'], addslashes(diconv(urldecode($_POST['title']), 'UTF-8')), true, $catid); + } + $proid = $_POST['proid']; + $uploadResponse = true; + $albumid = 0; + if($uploadfiles && is_array($uploadfiles)) { + $status = "success"; + $albumid = $uploadfiles['albumid']; + } else { + $status = "failure"; + } +} + +$newalbumname = dgmdate($_G['timestamp'], 'Ymd'); + +include template("home/misc_swfupload"); +$outxml = "\n"; +$outxml .= diconv(ob_get_contents(), $_G['charset'], 'UTF-8'); +obclean(); + +@header("Expires: -1"); +@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); +@header("Pragma: no-cache"); +@header("Content-type: application/xml; charset=utf-8"); +echo $outxml; + +?> \ No newline at end of file diff --git a/source/include/modcp/index.htm b/source/include/modcp/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/modcp/modcp_announcement.php b/source/include/modcp/modcp_announcement.php new file mode 100644 index 0000000..ea8e75e --- /dev/null +++ b/source/include/modcp/modcp_announcement.php @@ -0,0 +1,161 @@ + '', 'message' => '', 'starttime' => '', 'endtime' => ''); +$announce['checked'] = array('selected="selected"', ''); + +switch($op) { + + case 'add': + + $announce['starttime'] = dgmdate(TIMESTAMP, 'd'); + $announce['endtime'] = dgmdate(TIMESTAMP + 86400 * 30, 'd'); + if(submitcheck('submit')) { + $message = is_array($_GET['message']) ? $_GET['message'][$_GET['type']] : ''; + save_announce(0, $_GET['starttime'], $_GET['endtime'], $_GET['subject'], $_GET['type'], $message, 0); + $add_successed = true; + } + break; + + case 'manage': + + $annlist = get_annlist(); + + if(submitcheck('submit')) { + $delids = array(); + if(!empty($_GET['delete']) && is_array($_GET['delete'])) { + foreach($_GET['delete'] as $id) { + $id = intval($id); + if(isset($annlist[$id])) { + unset($annlist[$id]); + $delids[] = $id; + } + } + if($delids) { + C::t('forum_announcement')->delete_by_id_username($delids, $_G['username']); + } + } + + $updateorder = false; + if(!empty($_GET['order']) && is_array($_GET['order'])) { + foreach ($_GET['order'] as $id => $val) { + $val = intval($val); + if(isset($annlist[$id]) && $annlist[$id]['displayorder'] != $val) { + $annlist[$id]['displayorder'] = $val; + C::t('forum_announcement')->update_displayorder_by_id_username($id, $val, $_G['username']); + $updateorder = true; + } + } + } + + if($delids || $updateorder) { + update_announcecache(); + } + } + + break; + + case 'edit': + $id = intval($_GET['id']); + $announce = C::t('forum_announcement')->fetch_by_id_username($id, $_G['username']); + if(!count($announce)) { + showmessage('modcp_ann_nofound'); + } + + if(!submitcheck('submit')) { + $announce['starttime'] = $announce['starttime'] ? dgmdate($announce['starttime'], 'd') : ''; + $announce['endtime'] = $announce['endtime'] ? dgmdate($announce['endtime'], 'd') : ''; + $announce['subject'] = strip_tags($announce['subject']); + $announce['message'] = $announce['type'] != 1 ? dhtmlspecialchars($announce['message']) : $announce['message']; + $announce['checked'] = $announce['type'] != 1 ? array('selected="selected"', '') : array('', 'selected="selected"'); + } else { + $announce['starttime'] = $_GET['starttime']; + $announce['endtime'] = $_GET['endtime']; + $announce['checked'] = $_GET['type'] != 1 ? array('selected="selected"', '') : array('', 'selected="selected"'); + $message = $_GET['message'][$_GET['type']]; + save_announce($id, $_GET['starttime'], $_GET['endtime'], $_GET['subject'], $_GET['type'], $message, $_GET['displayorder']); + $announce['subject'] = dhtmlspecialchars(trim($_GET['subject'])); + if(intval($_GET['type']) == 1) { + list($message) = explode("\n", trim($message)); + $announce['message'] = dhtmlspecialchars($message); + } else { + $announce['message'] = dhtmlspecialchars(trim($message)); + } + $edit_successed = true; + } + + break; + +} + +$annlist = get_annlist(); + +function get_annlist() { + global $_G; + $annlist = C::t('forum_announcement')->fetch_all_by_displayorder(); + foreach ($annlist as $announce) { + $announce['disabled'] = $announce['author'] != $_G['member']['username'] ? 'disabled' : ''; + $announce['starttime'] = $announce['starttime'] ? dgmdate($announce['starttime'], 'd') : '-'; + $announce['endtime'] = $announce['endtime'] ? dgmdate($announce['endtime'], 'd') : '-'; + $annlist[$announce['id']] = $announce; + } + return $annlist; +} + +function update_announcecache() { + require_once libfile('function/cache'); + updatecache(array('announcements', 'announcements_forum')); +} + +function save_announce($id, $starttime, $endtime, $subject, $type, $message, $displayorder = 0) { + global $_G; + + $displayorder = intval($displayorder); + $type = intval($type); + + $starttime = empty($starttime) || strtotime($starttime) < TIMESTAMP ? TIMESTAMP : strtotime($starttime); + $endtime = empty($endtime) ? 0 : (strtotime($endtime) < $starttime ? ($starttime + 86400 * 30) : strtotime($endtime)); + + $subject = dhtmlspecialchars(trim($subject)); + + if($type == 1) { + list($message) = explode("\n", trim($message)); + $message = dhtmlspecialchars($message); + } else { + $type = 0; + $message = trim($message); + } + + if(empty($subject) || empty($message)) { + acpmsg('modcp_ann_empty'); + } elseif($type == 1 && !preg_match('/^https?:\/\//is', $message)) { + acpmsg('modcp_ann_urlerror'); + } else { + $data = array('author'=>$_G['username'], 'subject'=>$subject, 'type'=>$type, 'starttime'=>$starttime, 'endtime'=>$endtime, + 'message'=>$message, 'displayorder'=>$displayorder); + + if(empty($id)) { + C::t('forum_announcement')->insert($data); + } else { + C::t('forum_announcement')->update($id, $data, true); + } + update_announcecache(); + return true; + } +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_forum.php b/source/include/modcp/modcp_forum.php new file mode 100644 index 0000000..b8c8e7f --- /dev/null +++ b/source/include/modcp/modcp_forum.php @@ -0,0 +1,128 @@ +update($_G['fid'], array('rules' => $rulesnew)); + + $_G['forum']['description'] = html2bbcode($descnew); + $_G['forum']['rules'] = html2bbcode($rulesnew); + + } + + } elseif($op == 'recommend') { + + $useradd = 0; + + if($_G['adminid'] == 3) { + $useradd = $_G['uid']; + } + $ordernew = !empty($_GET['ordernew']) && is_array($_GET['ordernew']) ? $_GET['ordernew'] : array(); + + if(submitcheck('editsubmit') && $_G['forum']['modrecommend']['sort'] != 1) { + $threads = array(); + foreach($_GET['order'] as $id => $position) { + $threads[$id]['order'] = $position; + } + foreach($_GET['subject'] as $id => $title) { + $threads[$id]['subject'] = $title; + } + foreach($_GET['expirationrecommend'] as $id => $expiration) { + $expiration = trim($expiration); + if(!empty($expiration)) { + if(!preg_match('/^\d{4}-\d{1,2}-\d{1,2} +\d{1,2}:\d{1,2}$/', $expiration)) { + showmessage('recommend_expiration_invalid'); + } + list($expiration_date, $expiration_time) = explode(' ', $expiration); + list($expiration_year, $expiration_month, $expiration_day) = explode('-', $expiration_date); + list($expiration_hour, $expiration_min) = explode(':', $expiration_time); + $expiration_sec = 0; + + $expiration_timestamp = mktime($expiration_hour, $expiration_min, $expiration_sec, $expiration_month, $expiration_day, $expiration_year); + } else { + $expiration_timestamp = 0; + } + $threads[$id]['expiration'] = $expiration_timestamp; + } + if($_GET['delete']) { + $listupdate = true; + C::t('forum_forumrecommend')->delete($_GET['delete']); + } + if(!empty($_GET['delete']) && is_array($_GET['delete'])) { + foreach($_GET['delete'] as $id) { + $threads[$id]['delete'] = true; + unset($threads[$id]); + } + } + foreach($threads as $id => $item) { + $item['displayorder'] = intval($item['order']); + $item['subject'] = dhtmlspecialchars($item['subject']); + C::t('forum_forumrecommend')->update($id, array( + 'subject' => $item['subject'], + 'displayorder' => $item['displayorder'], + 'expiration' => $item['expiration'] + )); + } + $listupdate = true; + } + + $page = max(1, intval($_G['page'])); + $start_limit = ($page - 1) * $_G['tpp']; + + $threadcount = C::t('forum_forumrecommend')->count_by_fid($_G['fid']); + $multipage = multi($threadcount, $_G['tpp'], $page, "$cpscript?action={$_GET['action']}&fid={$_G['fid']}&page=$page"); + + $threadlist = $moderatormembers = array(); + $moderatorids = array(); + foreach(C::t('forum_forumrecommend')->fetch_all_by_fid($_G['fid'], false, $useradd, $start_limit, $_G['tpp']) as $thread) { + if($thread['moderatorid']) { + $moderatorids[$thread['moderatorid']] = $thread['moderatorid']; + } + $thread['authorlink'] = $thread['authorid'] ? "{$thread['author']}" : 'Guest'; + $thread['expiration'] = $thread['expiration'] ? dgmdate($thread['expiration']) : ''; + $threadlist[] = $thread; + } + if($moderatorids) { + $moderatormembers = C::t('common_member')->fetch_all($moderatorids, false, 0); + } + + } +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_forumaccess.php b/source/include/modcp/modcp_forumaccess.php new file mode 100644 index 0000000..fc4d20a --- /dev/null +++ b/source/include/modcp/modcp_forumaccess.php @@ -0,0 +1,168 @@ +fetch_by_username($new_user); + $uid = $user['uid']; + + if(empty($user)) { + $adderror = 1; + } elseif($user['adminid'] && $_G['adminid'] != 1) { + $adderror = 2; + } else { + + $access = C::t('forum_access')->fetch_all_by_fid_uid($_G['fid'], $uid); + $access = $access[0]; + + if($deleteaccess) { + + if($access && $_G['adminid'] != 1 && inwhitelist($access)) { + $adderror = 3; + } else { + $successed = true; + $access && delete_access($uid, $_G['fid']); + } + + } elseif($new_view || $new_post || $new_reply || $new_getattach || $new_getimage || $new_postattach || $new_postimage) { + + if($new_view == -1) { + $new_view = $new_post = $new_reply = $new_getattach = $new_getimage = $new_postattach = $new_postimage = -1; + } else { + $new_view = 0; + $new_post = $new_post ? -1 : 0; + $new_reply = $new_reply ? -1 : 0; + $new_getattach = $new_getattach ? -1 : 0; + $new_getimage = $new_getimage ? -1 : 0; + $new_postattach = $new_postattach ? -1 : 0; + $new_postimage = $new_postimage ? -1 : 0; + } + + if(empty($access)) { + $successed = true; + $data = array('uid' => $uid, 'fid' => $_G['fid'], 'allowview' => $new_view, 'allowpost' => $new_post, 'allowreply' => $new_reply, + 'allowgetattach' => $new_getattach, 'allowgetimage' => $new_getimage, + 'allowpostattach' => $new_postattach, 'allowpostimage' => $new_postimage, + 'adminuser' => $_G['uid'], 'dateline' => $_G['timestamp']); + C::t('forum_access')->insert($data); + C::t('common_member')->update($uid, array('accessmasks' => 1), 'UNBUFFERED'); + + } elseif($new_view == -1 && $access['allowview'] == 1 && $_G['adminid'] != 1) { + $adderror = 3; + } else { + if($_G['adminid'] > 1) { + $new_view = $access['allowview'] == 1 ? 1 : $new_view; + $new_post = $access['allowpost'] == 1 ? 1 : $new_post; + $new_reply = $access['allowreply'] == 1 ? 1 : $new_reply; + $new_getattach = $access['allowgetattach'] == 1 ? 1 : $new_getattach; + $new_getimage = $access['allowgetimage'] == 1 ? 1 : $new_getimage; + $new_postattach = $access['postattach'] == 1 ? 1 : $new_postattach; + $new_postimage = $access['postimage'] == 1 ? 1 : $new_postimage; + } + $successed = true; + $data = array('allowview' => $new_view, 'allowpost' => $new_post, 'allowreply' => $new_reply, + 'allowgetattach' => $new_getattach, 'allowgetimage' => $new_getimage, + 'allowpostattach' => $new_postattach, 'allowpostimage' => $new_postimage, + 'adminuser' => $_G['uid'], 'dateline' => $_G['timestamp']); + C::t('forum_access')->update_for_uid($uid, $_G['fid'], $data); + C::t('common_member')->update($uid, array('accessmasks' => 1), 'UNBUFFERED'); + + } + } + } + } + + $new_user = $adderror ? $new_user : ''; +} + +$new_user = dhtmlspecialchars($new_user); +$suser = isset($_GET['suser']) ? trim($_GET['suser']) : ''; +if(submitcheck('searchsubmit')) { + if($suser != '') { + $suid = C::t('common_member')->fetch_uid_by_username($suser); + } +} +$suser = dhtmlspecialchars($suser); + +$page = max(1, intval($_G['page'])); +$ppp = 10; +$list = array('pagelink' => '', 'data' => array()); + +if($num = C::t('forum_access')->fetch_all_by_fid_uid($_G['fid'], $suid, 1)) { + + $page = $page > ceil($num / $ppp) ? ceil($num / $ppp) : $page; + $start_limit = ($page - 1) * $ppp; + $list['pagelink'] = multi($num, $ppp, $page, "forum.php?mod=modcp&fid={$_G['fid']}&action={$_GET['action']}"); + + $query = C::t('forum_access')->fetch_all_by_fid_uid($_G['fid'], $suid, 0, $start_limit, $ppp); + $uidarray = array(); + foreach($query as $access) { + $uidarray[$access['uid']] = $access['uid']; + $uidarray[$access['adminuser']] = $access['adminuser']; + $access['allowview'] = accessimg($access['allowview']); + $access['allowpost'] = accessimg($access['allowpost']); + $access['allowreply'] = accessimg($access['allowreply']); + $access['allowpostattach'] = accessimg($access['allowpostattach']); + $access['allowgetattach'] = accessimg($access['allowgetattach']); + $access['allowgetimage'] = accessimg($access['allowgetimage']); + $access['allowpostimage'] = accessimg($access['allowpostimage']); + $access['dateline'] = dgmdate($access['dateline'], 'd'); + $access['forum'] = ''.strip_tags($_G['cache']['forums'][$access['fid']]['name']).''; + $list['data'][] = $access; + } + + $users = array(); + if($uids = dimplode($uidarray)) { + $users = C::t('common_member')->fetch_all_username_by_uid($uidarray); + } +} + +function delete_access($uid, $fid) { + C::t('forum_access')->delete_by_fid($fid, $uid); + $mask = C::t('forum_access')->count_by_uid($uid); + if(!$mask) { + C::t('common_member')->update($uid, array('accessmasks' => ''), 'UNBUFFERED'); + } +} + +function accessimg($access) { + return $access == -1 ? '' : + ($access == 1 ? '' : ''); +} + +function inwhitelist($access) { + $return = false; + foreach (array('allowview', 'allowpost', 'allowreply', 'allowpostattach', 'allowgetattach', 'allowgetimage') as $key) { + if($access[$key] == 1) { + $return = true; + break; + } + } + return $return; +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_home.php b/source/include/modcp/modcp_home.php new file mode 100644 index 0000000..747d50f --- /dev/null +++ b/source/include/modcp/modcp_home.php @@ -0,0 +1,56 @@ + 0 ? intval($_GET['newexpiration']) : 30) * 86400; + $newmessage = nl2br(dhtmlspecialchars(trim($_GET['newmessage']))); + if($newmessage != '') { + C::t('common_adminnote')->insert(array( + 'admin' => $_G['username'], + 'access' => $newaccess, + 'adminid' => $_G['adminid'], + 'dateline' => $_G['timestamp'], + 'expiration' => $newexpiration, + 'message' => $newmessage, + )); + } +} + +if($op == 'delete' && submitcheck('notlistsubmit')) { + if(is_array($_GET['delete']) && $deleteids = dimplode($_GET['delete'])) { + C::t('common_adminnote')->delete_note($_GET['delete'], ($_G['adminid'] == 1 ? '' : $_G['username'])); + } +} + +switch($_G['adminid']) { + case 1: $access = '1,2,3,4,5,6,7'; break; + case 2: $access = '2,3,6,7'; break; + default: $access = '1,3,5,7'; break; +} + +$notelist = array(); +foreach(C::t('common_adminnote')->fetch_all_by_access(explode(',', $access)) as $note) { + if($note['expiration'] < TIMESTAMP) { + C::t('common_adminnote')->delete_note($note['id']); + } else { + $note['expiration'] = ceil(($note['expiration'] - $note['dateline']) / 86400); + $note['dateline'] = dgmdate($note['dateline']); + $note['checkbox'] = ''; + $note['admin'] = ''.$note['admin'].''; + $notelist[] = $note; + } +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_log.php b/source/include/modcp/modcp_log.php new file mode 100644 index 0000000..646ecea --- /dev/null +++ b/source/include/modcp/modcp_log.php @@ -0,0 +1,97 @@ + $value) { + if(strpos($value, $_GET['keyword']) === FALSE) { + unset($logs[$key]); + } + } +} else { + $_GET['keyword'] = ''; +} + +$num = count($logs); +$multipage = multi($num, $lpp, $page, "$cpscript?mod=modcp&action=log&lpp=$lpp&keyword=".rawurlencode($_GET['keyword'])); +$logs = array_slice($logs, $start, $lpp); +$keyword = isset($_GET['keyword']) ? dhtmlspecialchars($_GET['keyword']) : ''; + +$usergroup = array(); + +$filters = ''; + +$loglist = array(); + +foreach($logs as $logrow) { + $log = explode("\t", $logrow); + if(empty($log[1])) { + continue; + } + $log[1] = dgmdate($log[1], 'y-n-j H:i'); + if(strtolower($log[2]) == strtolower($_G['member']['username'])) { + $log[2] = ''.$log[2].''; + } + + $log[5] = trim($log[5]); + $check = 'modcp_logs_action_'.$log[5]; + $log[5] = isset($language[$check]) ? $language[$check] : $log[5]; + + $log[7] = intval($log[7]); + $log[7] = !empty($log[7]) ? ''.strip_tags("{$_G['cache']['forums'][$log[7]]['name']}").'' : ''; + + $log[8] = str_replace(array('GET={};', 'POST={};', 'mod=modcp;', 'action='.$log[5].';', 'diy=;', 'op='.$log[6].';'), '', $log[8]); + $log[8] = cutstr($log['8'], 60); + + $loglist[] = $log; +} + +function get_log_files($logdir='', $action='action') { + $dir = opendir($logdir); + $files = array(); + while($entry = readdir($dir)) { + $files[] = $entry; + } + closedir($dir); + + sort($files); + $logfile = $action; + $logfiles = array(); + foreach($files as $file) { + if(strpos($file, $logfile) !== FALSE) { + $logfiles[] = $file; + } + } + $logfiles = array_slice($logfiles, -2, 2); + return $logfiles; +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_login.php b/source/include/modcp/modcp_login.php new file mode 100644 index 0000000..90c5b3c --- /dev/null +++ b/source/include/modcp/modcp_login.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/source/include/modcp/modcp_member.php b/source/include/modcp/modcp_member.php new file mode 100644 index 0000000..1c1c83a --- /dev/null +++ b/source/include/modcp/modcp_member.php @@ -0,0 +1,303 @@ +insert(array_merge(C::t('common_member_profile')->fetch(intval($member['uid'])), array('dateline' => time()))); + } + C::t('common_member_profile')->update($member['uid'], array('bio' => $biohtmlnew)); + C::t('common_member_field_forum')->update($member['uid'], array('sightml' => $sightmlnew)); + } + acpmsg('members_edit_succeed', "$cpscript?mod=modcp&action={$_GET['action']}&op=$op"); + + } elseif($member) { + + require_once libfile('function/editor'); + $bio = explode("\t\t\t", $member['bio']); + $member['bio'] = html2bbcode($bio[0]); + $member['biotrade'] = !empty($bio[1]) ? html2bbcode($bio[1]) : ''; + $member['signature'] = html2bbcode($member['sightml']); + $username = !empty($_GET['username']) ? $member['username'] : ''; + + } + +} elseif($op == 'ban' && ($_G['group']['allowbanuser'] || $_G['group']['allowbanvisituser'])) { + + $_GET['uid'] = isset($_GET['uid']) ? intval($_GET['uid']) : ''; + $_GET['username'] = isset($_GET['username']) ? trim($_GET['username']) : ''; + $member = loadmember($_GET['uid'], $_GET['username'], $error); + $usernameenc = $member ? rawurlencode($member['username']) : ''; + + include_once libfile('function/member'); + $clist = crime('getactionlist', $member['uid']); + + if(($member['type'] == 'system' && in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || $member['type'] == 'special') { + acpmsg('modcp_member_ban_illegal'); + } + + if($member && submitcheck('bansubmit') && !$error) { + $setarr = array(); + $reason = dhtmlspecialchars(trim($_GET['reason'])); + if(!$reason && ($_G['group']['reasonpm'] == 1 || $_G['group']['reasonpm'] == 3)) { + acpmsg('admin_reason_invalid'); + } + + if($_GET['bannew'] == 4 || $_GET['bannew'] == 5) { + if($_GET['bannew'] == 4 && !$_G['group']['allowbanuser'] || $_GET['bannew'] == 5 && !$_G['group']['allowbanvisituser']) { + acpmsg('admin_nopermission'); + } + $groupidnew = $_GET['bannew']; + $banexpirynew = !empty($_GET['banexpirynew']) ? TIMESTAMP + $_GET['banexpirynew'] * 86400 : 0; + $banexpirynew = $banexpirynew > TIMESTAMP ? $banexpirynew : 0; + if($banexpirynew) { + $member['groupterms'] = $member['groupterms'] && is_array($member['groupterms']) ? $member['groupterms'] : array(); + if($member['groupid'] == 4 || $member['groupid'] == 5) { + $member['groupterms']['main']['time'] = $banexpirynew; + if (empty($member['groupterms']['main']['groupid'])) { + $groupnew = C::t('common_usergroup')->fetch_by_credits($member['credits']); + $member['groupterms']['main']['groupid'] = $groupnew['groupid']; + } + if (!isset($member['groupterms']['main']['adminid'])) { + $member['groupterms']['main']['adminid'] = $member['adminid']; + } + }else{ + $member['groupterms']['main'] = array('time' => $banexpirynew, 'adminid' => $member['adminid'], 'groupid' => $member['groupid']); + } + $member['groupterms']['ext'][$groupidnew] = $banexpirynew; + $setarr['groupexpiry'] = groupexpiry($member['groupterms']); + } else { + $setarr['groupexpiry'] = 0; + } + if(in_array($member['adminid'], array(0, -1))) { + $member_status = C::t('common_member_status')->fetch($member['uid']); + } + $adminidnew = -1; + C::t('forum_postcomment')->delete_by_authorid($member['uid'], false, true); + } elseif($member['groupid'] == 4 || $member['groupid'] == 5) { + if(!empty($member['groupterms']['main']['groupid'])) { + $groupidnew = $member['groupterms']['main']['groupid']; + $adminidnew = $member['groupterms']['main']['adminid']; + unset($member['groupterms']['main']); + unset($member['groupterms']['ext'][$member['groupid']]); + $setarr['groupexpiry'] = groupexpiry($member['groupterms']); + } else { + $usergroup = C::t('common_usergroup')->fetch_by_credits($member['credits']); + $groupidnew = $usergroup['groupid']; + $adminidnew = 0; + } + } else { + $groupidnew = $member['groupid']; + $adminidnew = $member['adminid']; + } + + $setarr['adminid'] = $adminidnew; + $setarr['groupid'] = $groupidnew; + C::t('common_member')->update($member['uid'], $setarr); + + if(DB::affected_rows()) { + savebanlog($member['username'], $member['groupid'], $groupidnew, $banexpirynew, $reason); + } + + C::t('common_member_field_forum')->update($member['uid'], array('groupterms' => serialize($member['groupterms']))); + if($_GET['bannew'] == 4) { + $notearr = array( + 'user' => "{$_G['username']}", + 'day' => $_GET['banexpirynew'], + 'reason' => $reason, + 'from_id' => 0, + 'from_idtype' => 'banspeak' + ); + notification_add($member['uid'], 'system', 'member_ban_speak', $notearr, 1); + } + if($_GET['bannew'] == 5) { + $notearr = array( + 'user' => "{$_G['username']}", + 'day' => $_GET['banexpirynew'], + 'reason' => $reason, + 'from_id' => 0, + 'from_idtype' => 'banvisit' + ); + notification_add($member['uid'], 'system', 'member_ban_visit', $notearr, 1); + } + + if($_GET['bannew'] == 4 || $_GET['bannew'] == 5) { + crime('recordaction', $member['uid'], ($_GET['bannew'] == 4 ? 'crime_banspeak' : 'crime_banvisit'), $reason); + } + + acpmsg('modcp_member_ban_succeed', "$cpscript?mod=modcp&action={$_GET['action']}&op=$op"); + + } + +} elseif($op == 'ipban' && $_G['group']['allowbanip']) { + + if (array_key_exists('security', $_G['config']) && array_key_exists('useipban', $_G['config']['security']) && $_G['config']['security']['useipban'] == 0) { + acpmsg('admin_nopermission'); + } + + require_once libfile('function/misc'); + $iptoban = getgpc('ip') ? dhtmlspecialchars(getgpc('ip')) : ''; + $updatecheck = $addcheck = $deletecheck = $adderror = 0; + + if(submitcheck('ipbansubmit')) { + $_GET['delete'] = isset($_GET['delete']) ? $_GET['delete'] : ''; + if($_GET['delete']) { + $deletecheck = C::t('common_banned')->delete_by_id($_GET['delete'], $_G['adminid'], $_G['username']); + } + if($_GET['ipnew']) { + $addcheck = ipbanadd($_GET['ipnew'], $_GET['validitynew'], $adderror); + if(!$addcheck) { + $iptoban = $_GET['ipnew']; + } + } + + if(!empty($_GET['expirationnew']) && is_array($_GET['expirationnew'])) { + foreach($_GET['expirationnew'] as $id => $expiration) { + if($expiration === intval($expiration)) { + $expiration = $expiration > 1 ? (TIMESTAMP + $expiration * 86400) : TIMESTAMP + 86400; + $updatecheck = C::t('common_banned')->update_expiration_by_id($id, $expiration, $_G['adminid'], $_G['username']); + } + } + } + } + + $iplist = array(); + foreach(C::t('common_banned')->fetch_all_order_dateline() as $banned) { + for($i = 1; $i <= 4; $i++) { + if($banned["ip$i"] == -1) { + $banned["ip$i"] = '*'; + } + } + $banned['disabled'] = $_G['adminid'] != 1 && $banned['admin'] != $_G['member']['username'] ? 'disabled' : ''; + $banned['dateline'] = dgmdate($banned['dateline'], 'd'); + $banned['expiration'] = dgmdate($banned['expiration'], 'd'); + $banned['theip'] = $banned['ip']; + $banned['location'] = convertip($banned['theip']); + $iplist[$banned['id']] = $banned; + } + +} else { + showmessage('undefined_action'); +} + +function loadmember(&$uid, &$username, &$error) { + global $_G; + + $uid = !empty($_GET['uid']) && is_numeric($_GET['uid']) && $_GET['uid'] > 0 ? $_GET['uid'] : ''; + $username = isset($_GET['username']) && $_GET['username'] != '' ? dhtmlspecialchars(trim($_GET['username'])) : ''; + + $member = array(); + + if($uid || $username != '') { + + $member = $uid ? getuserbyuid($uid) : C::t('common_member')->fetch_by_username($username); + if($member) { + $uid = $member['uid']; + $member = array_merge($member, C::t('common_member_field_forum')->fetch($uid), C::t('common_member_profile')->fetch($uid), + C::t('common_usergroup')->fetch($member['groupid']), C::t('common_usergroup_field')->fetch($member['groupid'])); + } + if(!$member) { + $error = 2; + } elseif(($member['grouptype'] == 'system' && in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || in_array($member['adminid'], array(1,2,3))) { + $error = 3; + } else { + $member['groupterms'] = dunserialize($member['groupterms']); + $member['banexpiry'] = !empty($member['groupterms']['main']['time']) && ($member['groupid'] == 4 || $member['groupid'] == 5) ? dgmdate($member['groupterms']['main']['time'], 'Y-n-j') : ''; + $error = 0; + } + + } else { + $error = 1; + } + return $member; +} + +function ipbanadd($ipnew, $validitynew, &$error) { + global $_G; + + if($ipnew != '') { + $ipnew = ip::to_ip($ipnew); + $is_cidr = ip::validate_cidr($ipnew, $ipnew); + if (!ip::validate_ip($ipnew) && !$is_cidr) { + $error = 1; + return FALSE; + } + + if($_G['adminid'] != 1 && $is_cidr) { + $error = 2; + return FALSE; + } + + if(ip::check_ip($_G['clientip'], $ipnew)) { + $error = 3; + return FALSE; + } + + if($banned = C::t('common_banned')->fetch_by_ip($ipnew)) { + $error = 3; + return FALSE; + } + + $expiration = $validitynew > 1 ? (TIMESTAMP + $validitynew * 86400) : TIMESTAMP + 86400; + list($lower, $upper) = ip::calc_cidr_range($ipnew, true); + $data = array( + 'ip' => $ipnew, + 'lowerip' => $lower, + 'upperip' => $upper, + 'admin' => $_G['username'], + 'dateline' => $_G['timestamp'], + 'expiration' => $expiration + ); + C::t('common_banned')->insert($data); + + return TRUE; + + } + + return FALSE; + +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_moderate.php b/source/include/modcp/modcp_moderate.php new file mode 100644 index 0000000..e99bf2d --- /dev/null +++ b/source/include/modcp/modcp_moderate.php @@ -0,0 +1,673 @@ +fetch_all($uids); + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $member) { + if(($member['groupid'] == 8 || (in_array($member['freeze'], array(-1, 2)) && $modact != 'delete')) && $member['status'] == $filter) { + $members[$uid] = array_merge((array)$member_validate[$uid], $member); + } + } + if(($uids = array_keys($members))) { + + $reason = dhtmlspecialchars(trim($_GET['reason'])); + + if($_GET['modact'] == 'delete') { + C::t('common_member')->delete_no_validate($uids); + } + + if($_GET['modact'] == 'validate') { + C::t('common_member')->update($uids, array('adminid' => '0', 'groupid' => $_G['setting']['newusergroupid'], 'freeze' => 0)); + C::t('common_member_validate')->delete($uids); + } + + if($_GET['modact'] == 'ignore') { + C::t('common_member_validate')->update($uids, array('moddate' => $_G['timestamp'], 'admin' => $_G['username'], 'status' => '1', 'remark' => $reason)); + } + + $sendemail = isset($_GET['sendemail']) ? $_GET['sendemail'] : 0; + if($sendemail) { + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + foreach($members as $uid => $member) { + $member['regdate'] = dgmdate($member['regdate']); + $member['submitdate'] = dgmdate($member['submitdate']); + $member['moddate'] = dgmdate(TIMESTAMP); + $member['operation'] = $_GET['modact']; + $member['remark'] = $reason ? $reason : 'N/A'; + $moderate_member_message = array( + 'tpl' => 'moderate_member', + 'var' => array( + 'username' => $member['username'], + 'bbname' => $_G['setting']['bbname'], + 'regdate' => $member['regdate'], + 'submitdate' => $member['submitdate'], + 'submittimes' => $member['submittimes'], + 'message' => $member['message'], + 'modresult' => lang('email', 'moderate_member_'.$member['operation']), + 'moddate' => $member['moddate'], + 'adminusername' => $_G['member']['username'], + 'remark' => $member['remark'], + 'siteurl' => $_G['siteurl'], + ) + ); + if(!sendmail("{$member['username']} <{$member['email']}>", $moderate_member_message)) { + runlog('sendmail', "{$member['email']} sendmail failed."); + } + } + } + } else { + showmessage('modcp_moduser_invalid'); + } + + showmessage('modcp_mod_succeed', "{$cpscript}?mod=modcp&action={$_GET['action']}&op=$op&filter=$filter"); + + } else { + showmessage('modcp_moduser_invalid'); + } + + } else { + $count = C::t('common_member_validate')->fetch_all_status_by_count(); + + $page = max(1, intval($_G['page'])); + $_G['setting']['memberperpage'] = 20; + $start_limit = ($page - 1) * $_G['setting']['memberperpage']; + + $multipage = multi($count[$filter], $_G['setting']['memberperpage'], $page, "{$cpscript}?mod=modcp&action={$_GET['action']}&op=$op&fid={$_G['fid']}&filter=$filter"); + + $vuids = array(); + $memberlist = $member_validate = $common_member = $member_status = array(); + if(($member_validate = C::t('common_member_validate')->fetch_all_by_status($filter, $start_limit, $_G['setting']['memberperpage']))) { + $uids = array_keys($member_validate); + $common_member = C::t('common_member')->fetch_all($uids, false, 0); + $member_status = C::t('common_member_status')->fetch_all($uids, false, 0); + } + foreach($member_validate as $uid => $member) { + $member = array_merge($member, (array)$common_member[$uid], (array)$member_status[$uid]); + if($member['groupid'] != 8 && !in_array($member['freeze'], array(-1, 2))) { + $vuids[] = $member['uid']; + continue; + } + $member['regdate'] = dgmdate($member['regdate']); + $member['submitdate'] = dgmdate($member['submitdate']); + $member['moddate'] = $member['moddate'] ? dgmdate($member['moddate']) : $lang['none']; + $member['message'] = dhtmlspecialchars($member['message']); + $member['admin'] = $member['admin'] ? "{$member['admin']}" : $lang['none']; + $memberlist[] = $member; + } + if($vuids) { + C::t('common_member_validate')->delete($vuids, 'UNBUFFERED'); + } + + return true; + } +} + +if(empty($modforums['fids'])) { + return false; +} elseif($_G['fid'] && ($_G['forum']['type'] == 'group' || !$_G['forum']['ismoderator'])) { + return false; +} else { + $modfids = ""; + if($_G['fid']) { + $modfids = $_G['fid']; + $modfidsadd = "fid='{$_G['fid']}'"; + } elseif($_G['adminid'] == 1) { + $modfidsadd = ""; + } else { + $modfids = $modforums['fids']; + $modfidsadd = "fid in ({$modforums['fids']})"; + } +} + +$updatestat = false; + +$op = !in_array($op , array('replies', 'threads')) ? 'threads' : $op; + +$filter = !empty($_GET['filter']) ? -3 : 0; +$filtercheck = array(0 => '', '-3' => ''); +$filtercheck[$filter] = 'selected="selected"'; + +$pstat = $filter == -3 ? -3 : -2; +$moderatestatus = $filter == -3 ? 1 : 0; + +$tpp = 10; +$page = max(1, intval($_G['page'])); +$start_limit = ($page - 1) * $tpp; + +$postlist = array(); +$posttableselect = ''; + +$modpost = array('validate' => 0, 'delete' => 0, 'ignore' => 0); +$moderation = array('validate' => array(), 'delete' => array(), 'ignore' => array()); + +require_once libfile('function/post'); + +if(submitcheck('dosubmit', 1) || submitcheck('modsubmit')) { + + $list = array(); + if($_GET['moderate'] && is_array($_GET['moderate'])) { + foreach($_GET['moderate'] as $val) { + if(is_numeric($val) && $val) { + $moderation[$modact][] = $val; + } + } + } + + if(submitcheck('modsubmit')) { + + $updatestat = $op == 'replies' ? 1 : 2; + $modpost = array( + 'ignore' => count($moderation['ignore']), + 'delete' => count($moderation['delete']), + 'validate' => count($moderation['validate']) + ); + } elseif(submitcheck('dosubmit', 1)) { + $_GET['handlekey'] = 'mods'; + $list = $moderation[$modact]; + include template('forum/modcp_moderate_float'); + dexit(); + + } +} + +if($op == 'replies') { + $posttableid = intval($_GET['posttableid']); + $posttable = getposttable($posttableid); + + $posttableselect = getposttableselect(); + + if(submitcheck('modsubmit')) { + + $pmlist = array(); + if($ignorepids = dimplode($moderation['ignore'])) { + C::t('forum_post')->update_post($posttableid, $moderation['ignore'], array('invisible' => -3), true, false, 0, -2, ($modfids ? explode(',', $modfids) : null)); + updatemoderate('pid', $moderation['ignore'], 1); + } + + if($deletepids = dimplode($moderation['delete'])) { + $deleteauthorids = array(); + $recyclebinpids = array(); + $pids = array(); + foreach(C::t('forum_post')->fetch_all_post($posttableid, $moderation['delete']) as $post) { + if($post['invisible'] != $pstat || $post['first'] != 0 || ($modfids ? !in_array($post['fid'], explode(',', $modfids)) : 0)) { + continue; + } + if($modforums['recyclebins'][$post['fid']]) { + $recyclebinpids[] = $post['pid']; + } else { + $pids[] = $post['pid']; + } + if($post['authorid'] && $post['authorid'] != $_G['uid']) { + $pmlist[] = array( + 'act' => $_GET['reason'] ? 'modreplies_delete_reason' : 'modreplies_delete', + 'notevar' => array('modusername' => ($_G['setting']['moduser_public'] ? $_G['username'] : ''), 'reason' => dhtmlspecialchars($_GET['reason']), 'post' => messagecutstr($post['message'], 30)), + 'authorid' => $post['authorid'], + ); + } + if($_GET['crimerecord']) { + require_once libfile('function/member'); + crime('recordaction', $post['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => dhtmlspecialchars($_GET['reason']), 'tid' => $post['tid'], 'pid' => $post['pid']))); + } + $deleteauthorids[$post['authorid']] = $post['authorid']; + } + + if($recyclebinpids) { + C::t('forum_post')->update_post($posttableid, $recyclebinpids, array('invisible' => '-5'), true); + } + + if($pids) { + require_once libfile('function/delete'); + deletepost($pids, 'pid', false, $posttableid); + } + + if($_G['group']['allowbanuser'] && ($_GET['banuser'] || $_GET['userdelpost']) && $deleteauthorids) { + $members = C::t('common_member')->fetch_all($deleteauthorids); + $banuins = array(); + foreach($members as $member) { + if(($_G['cache']['usergroups'][$member['groupid']]['type'] == 'system' && + in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || $_G['cache']['usergroups'][$member['groupid']]['type'] == 'special') { + continue; + } + $banuins[$member['uid']] = $member['uid']; + } + + if($banuins) { + if($_GET['banuser']) { + C::t('common_member')->update($banuins, array('groupid' => 4)); + } + + if($_GET['userdelpost']) { + require_once libfile('function/delete'); + deletememberpost($banuins); + } + } + } + + updatemodworks('DLP', count($moderation['delete'])); + updatemoderate('pid', $moderation['delete'], 2); + } + + $repliesmod = 0; + if($validatepids = dimplode($moderation['validate'])) { + + $threads = $lastpost = $attachments = $pidarray = array(); + $postlist = $tids = array(); + foreach(C::t('forum_post')->fetch_all_post($posttableid, $moderation['validate']) as $post) { + if($post['invisible'] != $pstat || $post['first'] != '0' || ($modfids ? !in_array($post['fid'], explode(',', $modfids)) : 0)) { + continue; + } + $tids[$post['tid']] = $post['tid']; + $postlist[] = $post; + } + $threadlist = C::t('forum_thread')->fetch_all($tids); + foreach($postlist as $post) { + $post['lastpost'] = $threadlist[$post['tid']]['lastpost']; + $repliesmod ++; + $pidarray[] = $post['pid']; + if(getstatus($post['status'], 3) == 0) { + updatepostcredits('+', $post['authorid'], 'reply', $post['fid']); + $attachcount = C::t('forum_attachment_n')->count_by_id('tid:'.$post['tid'], 'pid', $post['pid']); + updatecreditbyaction('postattach', $post['authorid'], array(), '', $attachcount, 1, $post['fid']); + } + + $threads[$post['tid']]['posts']++; + + if($post['dateline'] > $post['lastpost'] && $post['dateline'] > $lastpost[$post['tid']]) { + $threads[$post['tid']]['lastpost'] = $post['dateline']; + $threads[$post['tid']]['lastposter'] = $post['anonymous'] && $post['dateline'] != $post['lastpost'] ? '' : addslashes($post['author']); + } + if($threads[$post['tid']]['attachadd'] || $post['attachment']) { + $threads[$post['tid']]['attachment'] = 1; + } + + $pm = 'pm_'.$post['pid']; + if($post['authorid'] && $post['authorid'] != $_G['uid']) { + $pmlist[] = array( + 'act' => 'modreplies_validate', + 'notevar' => array('modusername' => ($_G['setting']['moduser_public'] ? $_G['username'] : ''), 'reason' => dhtmlspecialchars($_GET['reason']), 'pid' => $post['pid'], 'tid' => $post['tid'], 'post' => messagecutstr($post['message'], 30), 'from_id' => 0, 'from_idtype' => 'modreplies'), + 'authorid' => $post['authorid'], + ); + } + } + unset($postlist, $tids, $threadlist); + foreach($threads as $tid => $thread) { + $updatedata = array('replies'=>$thread['posts']); + if(isset($thread['lastpost'])) { + $updatedata['lastpost'] = array($thread['lastpost']); + $updatedata['lastposter'] = array($thread['lastposter']); + } + if(isset($thread['attachment'])) { + $updatedata['attachment'] = $thread['attachment']; + } + C::t('forum_thread')->increase($tid, $updatedata); + } + if($_G['fid']) { + updateforumcount($_G['fid']); + } else { + $fids = array_keys($modforums['list']); + foreach($fids as $f) { + updateforumcount($f); + } + } + + if(!empty($pidarray)) { + $pidarray[] = 0; + $repliesmod = C::t('forum_post')->update_post($posttableid, $pidarray, array('invisible' => '0'), true); + updatemodworks('MOD', $repliesmod); + updatemoderate('pid', $pidarray, 2); + } else { + updatemodworks('MOD', 1); + } + } + + if($pmlist) { + foreach($pmlist as $pm) { + $post = $pm['post']; + $_G['tid'] = intval($pm['tid']); + notification_add($pm['authorid'], 'system', $pm['act'], $pm['notevar'], 1); + } + } + + showmessage('modcp_mod_succeed', "{$cpscript}?mod=modcp&action={$_GET['action']}&op=$op&filter=$filter&fid={$_G['fid']}"); + } + + $attachlist = array(); + + require_once libfile('function/discuzcode'); + require_once libfile('function/attachment'); + + $ppp = 10; + $page = max(1, intval($_G['page'])); + $start_limit = ($page - 1) * $ppp; + + $modcount = C::t('common_moderate')->count_by_search_for_post($posttable, $moderatestatus, 0, ($modfids ? explode(',', $modfids) : null)); + $multipage = multi($modcount, $ppp, $page, "{$cpscript}?mod=modcp&action={$_GET['action']}&op=$op&filter=$filter&fid={$_G['fid']}&showcensor={$_GET['showcensor']}"); + + if($modcount) { + + $attachtablearr = array(); + $_fids = array(); + foreach(C::t('common_moderate')->fetch_all_by_search_for_post($posttable, $moderatestatus, 0, ($modfids ? explode(',', $modfids) : null), null, null, null, $start_limit, $ppp) as $post) { + $_fids[$post['fid']] = $post['fid']; + $_tids[$post['tid']] = $post['tid']; + $post['id'] = $post['pid']; + $post['dateline'] = dgmdate($post['dateline']); + $post['subject'] = $post['subject'] ? ''.$post['subject'].'' : ''; + $post['message'] = nl2br(dhtmlspecialchars($post['message'])); + + if(!empty($_GET['showcensor'])) { + $censor = & discuz_censor::instance(); + $censor->highlight = '#FF0000'; + $censor->check($post['subject']); + $censor->check($post['message']); + $censor_words = $censor->words_found; + if(count($censor_words) > 3) { + $censor_words = array_slice($censor_words, 0, 3); + } + $post['censorwords'] = implode(', ', $censor_words); + } + + if($post['attachment']) { + $attachtable = getattachtableid($post['tid']); + $attachtablearr[$attachtable][$post['pid']] = $post['pid']; + } + $postlist[$post['pid']] = $post; + } + $_threads = $_forums = array(); + if($_fids) { + $_forums = C::t('forum_forum')->fetch_all($_fids); + foreach($postlist as &$_post) { + $_forum = $_forums[$_post['fid']]; + $_arr = array( + 'forumname' => $_forum['name'], + 'allowsmilies' => $_forum['allowsmilies'], + 'allowhtml' => $_forum['allowhtml'], + 'allowbbcode' => $_forum['allowbbcode'], + 'allowimgcode' => $_forum['allowimgcode'], + ); + $_post = array_merge($_post, $_arr); + } + } + if($_tids) { + $_threads = C::t('forum_thread')->fetch_all($_tids); + foreach($postlist as &$_post) { + $_post['tsubject'] = $_threads[$_post['tid']]['subject']; + } + } + + if(!empty($attachtablearr)) { + foreach($attachtablearr as $attachtable => $pids) { + foreach(C::t('forum_attachment_n')->fetch_all_by_id($attachtable, 'pid', $pids) as $attach) { + $_G['setting']['attachurl'] = $attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']; + $attach['url'] = $attach['isimage'] + ? " {$attach['filename']} (".sizecount($attach['filesize']).")

          100) {this.resized=true; this.width=100;}\">" + : "{$attach['filename']} (".sizecount($attach['filesize']).")"; + $postlist[$attach['pid']]['message'] .= "

          File: ".attachtype(fileext($attach['filename'])."\t").$attach['url']; + } + } + } + } + + +} else { + + if(submitcheck('modsubmit')) { + if(!empty($moderation['ignore'])) { + C::t('forum_thread')->update_by_tid_displayorder($moderation['ignore'], -2, array('displayorder'=>-3), ($modfids ? explode(',', $modfids) : null)); + updatemoderate('tid', $moderation['ignore'], 1); + } + $threadsmod = 0; + $pmlist = array(); + $reason = trim($_GET['reason']); + + if(!empty($moderation['delete'])) { + $deleteauthorids = array(); + $deletetids = array(); + $recyclebintids = '0'; + foreach(C::t('forum_thread')->fetch_all_by_tid_displayorder($moderation['delete'], $pstat, '=', ($modfids ? explode(',', $modfids) : null)) as $thread) { + if($modforums['recyclebins'][$thread['fid']]) { + $recyclebintids .= ','.$thread['tid']; + } else { + $deletetids[] = $thread['tid']; + } + + if($thread['authorid'] && $thread['authorid'] != $_G['uid']) { + $pmlist[] = array( + 'act' => $_GET['reason'] ? 'modthreads_delete_reason' : 'modthreads_delete', + 'notevar' => array('reason' => dhtmlspecialchars($_GET['reason']), 'threadsubject' => $thread['subject']), + 'authorid' => $thread['authorid'], + ); + } + + if($_GET['crimerecord']) { + require_once libfile('function/member'); + crime('recordaction', $thread['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => dhtmlspecialchars($_GET['reason']), 'tid' => $thread['tid'], 'pid' => $thread['pid']))); + } + + $deleteauthorids[$thread['authorid']] = $thread['authorid']; + + } + + if($recyclebintids) { + $rows = C::t('forum_thread')->update(explode(',', $recyclebintids), array('displayorder' => -1, 'moderated' => 1)); + updatemodworks('MOD', $rows); + + C::t('forum_post')->update_by_tid(0, explode(',', $recyclebintids), array('invisible' => -1), true); + updatemodlog($recyclebintids, 'DEL'); + } + + require_once libfile('function/delete'); + deletethread($deletetids); + + if($_G['group']['allowbanuser'] && ($_GET['banuser'] || $_GET['userdelpost']) && $deleteauthorids) { + $members = C::t('common_member')->fetch_all($deleteauthorids); + $banuins = array(); + foreach($members as $member) { + if(($_G['cache']['usergroups'][$member['groupid']]['type'] == 'system' && + in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || $_G['cache']['usergroups'][$member['groupid']]['type'] == 'special') { + continue; + } + $banuins[$member['uid']] = $member['uid']; + } + if($banuins) { + if($_GET['banuser']) { + C::t('common_member')->update($banuins, array('groupid' => 4)); + } + + if($_GET['userdelpost']) { + deletememberpost($banuins); + } + } + } + + updatemoderate('tid', $moderation['delete'], 2); + } + + if($validatetids = dimplode($moderation['validate'])) { + + $tids = $moderatedthread = array(); + foreach(C::t('forum_thread')->fetch_all_by_tid_displayorder($moderation['validate'], $pstat, '=', ($modfids ? explode(',', $modfids) : null)) as $thread) { + $tids[] = $thread['tid']; + $poststatus = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']); + $poststatus = $poststatus['status']; + if(getstatus($poststatus, 3) == 0) { + updatepostcredits('+', $thread['authorid'], 'post', $thread['fid']); + $attachcount = C::t('forum_attachment_n')->count_by_id('tid:'.$thread['tid'], 'tid', $thread['tid']); + updatecreditbyaction('postattach', $thread['authorid'], array(), '', $attachcount, 1, $thread['fid']); + } + $validatedthreads[] = $thread; + + if($thread['authorid'] && $thread['authorid'] != $_G['uid']) { + $pmlist[] = array( + 'act' => 'modthreads_validate', + 'notevar' => array('reason' => dhtmlspecialchars($_GET['reason']), 'tid' => $thread['tid'], 'threadsubject' => $thread['subject'], 'from_id' => 0, 'from_idtype' => 'modthreads'), + 'authorid' => $thread['authorid'], + ); + } + } + + if($tids) { + + $tidstr = dimplode($tids); + C::t('forum_post')->update_by_tid(0, $tids, array('invisible' => 0), true, false, 1); + C::t('forum_thread')->update($tids, array('displayorder'=>0, 'moderated'=>1)); + $threadsmod = DB::affected_rows(); + + if($_G['fid']) { + updateforumcount($_G['fid']); + } else { + $fids = array_keys($modforums['list']); + foreach($fids as $f) { + updateforumcount($f); + } + } + updatemodworks('MOD', $threadsmod); + updatemodlog($tidstr, 'MOD'); + updatemoderate('tid', $tids, 2); + + } + } + + if($pmlist) { + foreach($pmlist as $pm) { + $threadsubject = $pm['thread']; + $_G['tid'] = intval($pm['tid']); + notification_add($pm['authorid'], 'system', $pm['act'], $pm['notevar'], 1); + } + } + + showmessage('modcp_mod_succeed', "{$cpscript}?mod=modcp&action={$_GET['action']}&op=$op&filter=$filter&fid={$_G['fid']}"); + + } + + $modcount = C::t('common_moderate')->count_by_seach_for_thread($moderatestatus, ($modfids ? explode(',', $modfids) : null)); + $multipage = multi($modcount, $_G['tpp'], $page, "{$cpscript}?mod=modcp&action={$_GET['action']}&op=$op&filter=$filter&fid={$_G['fid']}&showcensor={$_GET['showcensor']}"); + + if($modcount) { + $posttablearr = array(); + + foreach(C::t('common_moderate')->fetch_all_by_search_for_thread($moderatestatus, ($modfids ? explode(',', $modfids) : null), $start_limit, $_G['tpp']) as $thread) { + + $thread['id'] = $thread['tid']; + + if($thread['authorid'] && $thread['author'] != '') { + $thread['author'] = "{$thread['author']}"; + } elseif($thread['authorid']) { + $thread['author'] = "UID {$thread['uid']}"; + } else { + $thread['author'] = 'guest'; + } + + $thread['dateline'] = dgmdate($thread['dateline']); + $posttable = $thread['posttableid'] ? (string)$thread['posttableid'] : '0'; + $posttablearr[$posttable][$thread['tid']] = $thread['tid']; + $postlist[$thread['tid']] = $thread; + } + + $attachtablearr = array(); + + foreach($posttablearr as $posttable => $tids) { + foreach(C::t('forum_post')->fetch_all_by_tid($posttable, $tids, true, '', 0, 0, 1) as $post) { + $thread = $postlist[$post['tid']] + $post; + $thread['message'] = nl2br(dhtmlspecialchars($thread['message'])); + + if(!empty($_GET['showcensor'])) { + $censor = & discuz_censor::instance(); + $censor->highlight = '#FF0000'; + $censor->check($thread['subject']); + $censor->check($thread['message']); + $censor_words = $censor->words_found; + if(count($censor_words) > 3) { + $censor_words = array_slice($censor_words, 0, 3); + } + $thread['censorwords'] = implode(', ', $censor_words); + } + + if($thread['attachment']) { + $attachtable = getattachtableid($thread['tid']); + $attachtablearr[$attachtable][$thread['tid']] = $thread['tid']; + } else { + $thread['attach'] = ''; + } + + if($thread['sortid']) { + require_once libfile('function/threadsort'); + $threadsortshow = threadsortshow($thread['sortid'], $thread['tid']); + + foreach($threadsortshow['optionlist'] as $option) { + $thread['sortinfo'] .= $option['title'].' '.$option['value']."
          "; + } + } else { + $thread['sortinfo'] = ''; + } + + $postlist[$post['tid']] = $thread; + } + } + + if(!empty($attachtablearr)) { + require_once libfile('function/attachment'); + foreach($attachtablearr as $attachtable => $tids) { + foreach(C::t('forum_attachment_n')->fetch_all_by_id($attachtable, 'tid', $tids) as $attach) { + $tid = $attach['tid']; + $_G['setting']['attachurl'] = $attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']; + $attach['url'] = $attach['isimage'] + ? " {$attach['filename']} (".sizecount($attach['filesize']).")

          100) {this.resized=true; this.width=100;}\">" + : "{$attach['filename']} (".sizecount($attach['filesize']).")"; + $postlist[$tid]['attach'] .= "

          {$lang['attachment']}: ".attachtype(fileext($attach['filename'])."\t").$attach['url']; + } + } + } + } + +} +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_noperm.php b/source/include/modcp/modcp_noperm.php new file mode 100644 index 0000000..18d143d --- /dev/null +++ b/source/include/modcp/modcp_noperm.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/source/include/modcp/modcp_plugin.php b/source/include/modcp/modcp_plugin.php new file mode 100644 index 0000000..be1ff56 --- /dev/null +++ b/source/include/modcp/modcp_plugin.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/source/include/modcp/modcp_recyclebin.php b/source/include/modcp/modcp_recyclebin.php new file mode 100644 index 0000000..0fbaaf9 --- /dev/null +++ b/source/include/modcp/modcp_recyclebin.php @@ -0,0 +1,210 @@ +'', 888=>''); +$threadoptionselect[$threadoption] = 'selected'; + +$postlist = array(); + +$total = $multipage = ''; + +$cachekey = 'srchresult_recycle_thread'.$_G['fid']; +if($_G['fid'] && $_G['forum']['ismoderator'] && !empty($modforums['recyclebins'][$_G['fid']])) { + + $srchupdate = false; + + if(in_array($_G['adminid'], array(1, 2, 3)) && ($op == 'delete' || $op == 'restore') && submitcheck('dosubmit')) { + if(!empty($_GET['moderate'])) { + foreach(C::t('forum_thread')->fetch_all_by_tid_displayorder($_GET['moderate'], -1, '=', $_G['fid']) as $tid) { + $tidarray[] = $tid['tid']; + } + + if($tidarray) { + if($op == 'delete' && $_G['group']['allowclearrecycle']) { + require_once libfile('function/delete'); + deletethread($tidarray); + } + if($op == 'restore') { + require_once libfile('function/post'); + undeletethreads($tidarray); + } + + if($_GET['oldop'] == 'search') { + $srchupdate = true; + } + } + } + + $op = dhtmlspecialchars($_GET['oldop']); + + showmessage('modcp_recyclebin_'.$op.'_succeed', '', array(), array('break' => 1)); + + } + + + + if($op == 'search' && submitcheck('searchsubmit')) { + + $conditions = array(); + + if($threadoption > 0 && $threadoption < 255) { + $conditions['specialthread'] = 1; + $conditions['special'] = $threadoption; + } elseif($threadoption == 999) { + $conditions['digest'] = array(1,2,3); + } elseif($threadoption == 888) { + $conditions['sticky'] = 1; + } + + + $viewsless !== ''? $conditions['viewsless'] = $viewsless : ''; + $viewsmore !== ''? $conditions['viewsmore'] = $viewsmore : ''; + $repliesless !== ''? $conditions['repliesless'] = $repliesless : ''; + $repliesmore !== ''? $conditions['repliesmore'] = $repliesmore : ''; + $noreplydays !== ''? $conditions['noreplydays'] = $noreplydays : ''; + $starttime != '' ? $conditions['starttime'] = $starttime : ''; + $endtime != '' ? $conditions['endtime'] = $endtime : ''; + + if(trim($keywords)) { + $conditions['keywords'] = $keywords; + + } + + if(trim($users)) { + $conditions['users'] = trim($users); + } + + if($_GET['typeid']) { + $conditions['intype'] = $_GET['typeid']; + + } + + if(!empty($conditions)) { + + $tids = $comma = ''; + $count = 0; + $conditions['fid'] = $_G['fid']; + $conditions['sticky'] = 3; + foreach(C::t('forum_thread')->fetch_all_search($conditions, 0, 0, 1000, 'lastpost') as $thread) { + $tids .= $comma.$thread['tid']; + $comma = ','; + $count ++; + } + + $result['tids'] = $tids; + $result['count'] = $count; + $result['fid'] = $_G['fid']; + + $modsession->set($cachekey, $result, true); + + unset($result, $tids); + $page = 1; + + } else { + $op = 'list'; + } + } + + $page = max(1, intval($_G['page'])); + $total = 0; + $query = $multipage = ''; + + if($op == 'list') { + $total = C::t('forum_thread')->count_by_fid_typeid_displayorder($_G['fid'], $_GET['typeid'], -1); + $tpage = ceil($total / $_G['tpp']); + $page = min($tpage, $page); + $multipage = multi($total, $_G['tpp'], $page, "$cpscript?mod=modcp&action=$action&op=$op&fid={$_G['fid']}&do=$do"); + if($total) { + $start = ($page - 1) * $_G['tpp']; + $threads = C::t('forum_thread')->fetch_all_by_fid_typeid_displayorder($_G['fid'], $_GET['typeid'], -1, '=', $start, $_G['tpp']); + } + } + + if($op == 'search') { + + $result = $modsession->get($cachekey); + + if($result) { + + if($srchupdate && $result['count'] && $tidarray) { + $td = explode(',', $result['tids']); + $newtids = $comma = $newcount = ''; + if(is_array($td)) { + foreach ($td as $v) { + $v = intval($v); + if(!in_array($v, $tidarray)) { + $newcount ++; + $newtids .= $comma.$v; + $comma = ','; + } + } + $result['count'] = $newcount; + $result['tids'] = $newtids; + $modsession->set($cachekey, $result, true); + } + } + + $threadoptionselect[$result['threadoption']] = 'selected'; + + $total = $result['count']; + $tpage = ceil($total / $_G['tpp']); + $page = min($tpage, $page); + $multipage = multi($total, $_G['tpp'], $page, "$cpscript?mod=modcp&action=$action&op=$op&fid={$_G['fid']}&do=$do"); + if($total) { + $start = ($page - 1) * $_G['tpp']; + $threads = C::t('forum_thread')->fetch_all_by_tid_fid_displayorder(explode(',', $result['tids']), $_G['fid'], -1, 'lastpost', $start, $_G['tpp']); + } + + } + + } + + $postlist = array(); + if($threads) { + require_once libfile('function/misc'); + foreach($threads as $thread) { + $post = procthread($thread); + $post['modthreadkey'] = modauthkey($post['tid']); + $postlist[$post['tid']] = $post; + } + if($postlist) { + $tids = array_keys($postlist); + foreach(C::t('forum_threadmod')->fetch_all_by_tid($tids) as $row) { + if(empty($postlist[$row['tid']]['reason'])) { + $postlist[$row['tid']]['reason'] = $row['reason']; + } + } + } + } + +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_recyclebinpost.php b/source/include/modcp/modcp_recyclebinpost.php new file mode 100644 index 0000000..62b588d --- /dev/null +++ b/source/include/modcp/modcp_recyclebinpost.php @@ -0,0 +1,165 @@ +fetch_all_post($posttableid, $_GET['moderate'], false) as $post) { + if($post['fid'] != $_G['fid'] || $post['invisible'] != '-5') { + continue; + } + $pidarray[] = $post['pid']; + } + if($pidarray) { + require_once libfile('function/misc'); + if ($op == 'delete' && $_G['group']['allowclearrecycle']){ + recyclebinpostdelete($pidarray, $posttableid); + } + if ($op == 'restore') { + recyclebinpostundelete($pidarray, $posttableid); + } + + if($_GET['oldop'] == 'search') { + $srchupdate = true; + } + } + } + + $op = dhtmlspecialchars($_GET['oldop']); + + showmessage('modcp_recyclebinpost_'.$op.'_succeed', '', array(), array('break' => 1)); + + } + + if($op == 'search' && submitcheck('searchsubmit')) { + + + if($starttime || $endtime || trim($keywords) || trim($users)) { + + $pids = array(); + + foreach(C::t('forum_post')->fetch_all_by_search($posttableid, null, $keywords, -5, null, null, ($users ? explode(',', str_replace(' ', '', trim($users))) : null), strtotime($starttime), strtotime($endtime), null, null, 0, 1000) as $value) { + $postlist[] = $value; + $pids[] = $value['pid']; + } + + $result['pids'] = implode(',', $pids); + $result['count'] = count($pids); + $result['fid'] = $_G['fid']; + $result['posttableid'] = $posttableid; + + $modsession->set($cachekey, $result, true); + + unset($result, $pids); + $page = 1; + + } else { + $op = 'list'; + } + } + + $page = max(1, intval($_G['page'])); + $total = 0; + $query = $multipage = ''; + $fields = 'message, useip, attachment, htmlon, smileyoff, bbcodeoff, pid, tid, fid, author, dateline, subject, authorid, anonymous'; + + if($op == 'list') { + $total = C::t('forum_post')->count_by_fid_invisible($posttableid, $_G['fid'], '-5'); + $tpage = ceil($total / $_G['tpp']); + $page = min($tpage, $page); + $multipage = multi($total, $_G['tpp'], $page, "$cpscript?mod=modcp&action=$action&op=$op&fid={$_G['fid']}&do=$do"); + if($total) { + $start = ($page - 1) * $_G['tpp']; + foreach(C::t('forum_post')->fetch_all_by_fid($posttableid, $_G['fid'], true, 'DESC', $start, $_G['tpp'], null, '-5') as $value) { + $postlist[] = $value; + } + } + } + + if($op == 'search') { + + $result = $modsession->get($cachekey); + + if($result) { + + if($srchupdate && $result['count'] && $pidarray) { + $pd = explode(',', $result['pids']); + $newpids = $comma = $newcount = ''; + if(is_array($pd)) { + foreach ($pd as $v) { + $v = intval($v); + if(!in_array($v, $pidarray)) { + $newcount ++; + $newpids .= $comma.$v; $comma = ','; + } + } + $result['count'] = $newcount; + $result['pids'] = $newpids; + $modsession->set($cachekey, $result, true); + } + } + + $total = $result['count']; + $tpage = ceil($total / $_G['tpp']); + $page = min($tpage, $page); + $multipage = multi($total, $_G['tpp'], $page, "$cpscript?mod=modcp&action=$action&op=$op&fid={$_G['fid']}&do=$do"); + if($total) { + $start = ($page - 1) * $_G['tpp']; + $postlist = C::t('forum_post')->fetch_all_by_pid($posttableid, explode(',', $result['pids']), true, 'DESC', $start, $_G['tpp'], $_G['fid'], -5); + } + + } + + } + + if($postlist) { + require_once libfile('function/misc'); + require_once libfile('function/post'); + require_once libfile('function/discuzcode'); + foreach($postlist as $key => $post) { + $post['modthreadkey'] = modauthkey($post['tid']); + $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], sprintf('%00b', $post['htmlon']), $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'], $_G['forum']['allowhtml']); + $post['message'] = preg_replace('/]*>(.*?)<\/a>/i', '$1', $post['message']); + $post['dateline'] = dgmdate($post['dateline'], 'Y-m-d H:i:s'); + $postlist[$key] = $post; + } + } +} + +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_report.php b/source/include/modcp/modcp_report.php new file mode 100644 index 0000000..e63957a --- /dev/null +++ b/source/include/modcp/modcp_report.php @@ -0,0 +1,68 @@ +fetch_count(0, $reportid)) { + $creditchange = ''; + $uid = $_GET['reportuids'][$reportid]; + if($uid != $_G['uid']) { + $msg = !empty($_GET['msg'][$reportid]) ? '
          '.dhtmlspecialchars($_GET['msg'][$reportid]) : ''; + if(!empty($_GET['creditsvalue'][$reportid])) { + $credittag = $_GET['creditsvalue'][$reportid] > 0 ? '+' : ''; + if($report_reward['max'] < $_GET['creditsvalue'][$reportid] || $_GET['creditsvalue'][$reportid] < $report_reward['min']) { + showmessage('quickclear_noperm', "$cpscript?mod=modcp&action=report&fid={$_G['fid']}"); + } + $creditchange = '
          '.lang('forum/misc', 'report_msg_your').$_G['setting']['extcredits'][$curcredits]['title'].' '.$credittag.$_GET['creditsvalue'][$reportid]; + updatemembercount($uid, array($curcredits => intval($_GET['creditsvalue'][$reportid])), true, 'RPC', $reportid); + } + if($creditchange || $msg) { + notification_add($uid, 'report', 'report_change_credits', array('creditchange' => $creditchange, 'msg' => $msg), 1); + } + } + $opresult = !empty($_GET['creditsvalue'][$reportid])? $curcredits."\t".intval($_GET['creditsvalue'][$reportid]) : 'ignore'; + C::t('common_report')->update($reportid, array('opuid' => $_G['uid'], 'opname' => $_G['username'], 'optime' => TIMESTAMP, 'opresult' => $opresult)); + } + } + showmessage('modcp_report_success', "$cpscript?mod=modcp&action=report&fid={$_G['fid']}&lpp=$lpp"); + } + } + $rewardlist = ''; + $offset = abs(ceil(($report_reward['max'] - $report_reward['min']) / 10)); + if($report_reward['max'] > $report_reward['min']) { + for($vote = $report_reward['max']; $vote >= $report_reward['min']; $vote -= $offset) { + if($vote != 0) { + $rewardlist .= $vote ? '' : ''; + } else { + $rewardlist .= ''; + } + } + } + $reportlist = array(); + $lpp = empty($_GET['lpp']) ? 20 : intval($_GET['lpp']); + $lpp = min(200, max(5, $lpp)); + $page = max(1, intval($_G['page'])); + $start = ($page - 1) * $lpp; + + $reportcount = C::t('common_report')->fetch_count(0, 0, $_G['fid']); + $query = C::t('common_report')->fetch_all_report($start, $lpp, 0, $_G['fid']); + foreach($query as $row) { + $row['dateline'] = dgmdate($row['dateline']); + $reportlist[] = $row; + } + $multipage = multi($reportcount, $lpp, $page, "$cpscript?mod=modcp&action=report&fid={$_G['fid']}&lpp=$lpp"); +} +?> \ No newline at end of file diff --git a/source/include/modcp/modcp_thread.php b/source/include/modcp/modcp_thread.php new file mode 100644 index 0000000..83a5486 --- /dev/null +++ b/source/include/modcp/modcp_thread.php @@ -0,0 +1,377 @@ +'', 888=>''); +$threadoptionselect[getgpc('threadoption')] = 'selected'; + + +if($op == 'thread') { + + $result = array(); + + foreach (array('threadoption', 'viewsless', 'viewsmore', 'repliesless', 'repliesmore', 'noreplydays', 'typeid') as $key) { + $_GET[''.$key] = isset($_GET[''.$key]) && is_numeric($_GET[''.$key]) ? intval($_GET[''.$key]) : ''; + $result[$key] = $_GET[''.$key]; + } + + foreach (array('starttime', 'endtime', 'keywords', 'users') as $key) { + $result[$key] = isset($_GET[''.$key]) ? dhtmlspecialchars($_GET[''.$key]) : ''; + } + + if($_G['fid'] && $_G['forum']['ismoderator']) { + + if($do == 'search' && submitcheck('submit', 1)) { + + $conditions = array(); + if($_GET['threadoption'] > 0 && $_GET['threadoption'] < 255) { + $conditions['specialthread'] = 1; + $conditions['special'] = $_GET['threadoption']; + } elseif($_GET['threadoption'] == 999) { + $conditions['digest'] = array(1,2,3); + } elseif($_GET['threadoption'] == 888) { + $conditions['sticky'] = 1; + } + + + $_GET['viewsless'] !== ''? $conditions['viewsless'] = $_GET['viewsless'] : ''; + $_GET['viewsmore'] !== ''? $conditions['viewsmore'] = $_GET['viewsmore'] : ''; + $_GET['repliesless'] !== ''? $conditions['repliesless'] = $_GET['repliesless'] : ''; + $_GET['repliesmore'] !== ''? $conditions['repliesmore'] = $_GET['repliesmore'] : ''; + $_GET['noreplydays'] !== ''? $conditions['noreplydays'] = $_GET['noreplydays'] : ''; + $_GET['starttime'] != '' ? $conditions['starttime'] = $_GET['starttime'] : ''; + $_GET['endtime'] != '' ? $conditions['endtime'] = $_GET['endtime'] : ''; + + if(trim($_GET['keywords'])) { + + $conditions['keywords'] = $_GET['keywords']; + } + + if(trim($_GET['users'])) { + $conditions['users'] = trim($_GET['users']); + } + + if($_GET['typeid']) { + $conditions['intype'] = $_GET['typeid']; + } + + if(!empty($conditions)) { + $conditions['inforum'] = $_G['fid']; + if(!isset($conditions['sticky'])) $conditions['sticky'] = 0; + $tids = $comma = ''; + $count = 0; + foreach(C::t('forum_thread')->fetch_all_search($conditions, 0, 0, 1000, 'displayorder DESC, lastpost') as $thread) { + $tids .= $comma.$thread['tid']; + $comma = ','; + $count ++; + } + + $result['tids'] = $tids; + $result['count'] = $count; + $result['fid'] = $_G['fid']; + + $modsession->set('srchresult', $result, true); + + unset($result, $tids); + $do = 'list'; + $page = 1; + + } else { + $do = ''; + } + } + + $page = $_G['page']; + $total = 0; + $query = $multipage = ''; + + if(empty($do)) { + + $total = C::t('forum_thread')->count_by_fid_typeid_displayorder($_G['fid'], $_GET['typeid'], 0, '>='); + $tpage = ceil($total / $_G['tpp']); + $page = min($tpage, $page); + $multipage = multi($total, $_G['tpp'], $page, "$cpscript?mod=modcp&action={$_GET['action']}&op=$op&fid={$_G['fid']}&do=$do&posttableid=".(isset($posttableid) ? $posttableid : '')); + if($total) { + $start = ($page - 1) * $_G['tpp']; + $threads = C::t('forum_thread')->fetch_all_by_fid_typeid_displayorder($_G['fid'], $_GET['typeid'], 0, '>=', $start, $_G['tpp']); + } + + } else { + + $result = $modsession->get('srchresult'); + $threadoptionselect[$result['threadoption']] = 'selected'; + + if($result['fid'] == $_G['fid']) { + $total = $result['count']; + $tpage = ceil($total / $_G['tpp']); + $page = min($tpage, $page); + $multipage = multi($total, $_G['tpp'], $page, "$cpscript?mod=modcp&action={$_GET['action']}&op=$op&fid={$_G['fid']}&do=$do&posttableid=$posttableid"); + if($total) { + $start = ($page - 1) * $_G['tpp']; + $threads = C::t('forum_thread')->fetch_all_by_tid_fid_displayorder(explode(',', $result['tids']), null, null, 'lastpost', $start, $_G['tpp']); + } + } + } + + $postlist = array(); + if(!empty($threads)) { + require_once libfile('function/misc'); + foreach($threads as $thread) { + $postlist[] = procthread($thread); + } + } + } + return; +} + + +if($op == 'post') { + + $error = 0; + + $result = array(); + + $_GET['starttime'] = !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", getgpc('starttime')) ? dgmdate(TIMESTAMP - 86400 * ($_G['adminid'] == 2 ? 13 : ($_G['adminid'] == 3 ? 6 : 60)), 'Y-m-d') : getgpc('starttime'); + $_GET['endtime'] = $_G['adminid'] == 3 || !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", getgpc('endtime')) ? dgmdate(TIMESTAMP, 'Y-m-d') : getgpc('endtime'); + + foreach (array('threadoption', 'starttime', 'endtime', 'keywords', 'users', 'useip') as $key) { + $$key = isset($_GET[''.$key]) ? trim($_GET[''.$key]) : ''; + $result[$key] = dhtmlspecialchars($$key); + } + + $threadoptionselect = range(1, 3); + + $posttableid = intval(getgpc('posttableid')); + $posttableselect = getposttableselect(); + + $cachekey = 'srchresult_p_'.$posttableid.'_'.$_G['fid']; + $fidadd = ''; + $fidaddarr = array(); + if($_G['fid'] && !empty($modforums['list'][$_G['fid']])) { + $fidaddarr = array($_G['fid']); + $fidadd = "AND fid='{$_G['fid']}'"; + } else { + if($_G['adminid'] == 1 && $_G['adminid'] == $_G['groupid']) { + $fidadd = ''; + } elseif(!$modforums['fids']) { + $fidaddarr = array(0); + $fidadd = 'AND 0 '; + } else { + $fidaddarr = explode(',', $modforums['fids']); + $fidadd = "AND fid in({$modforums['fids']})"; + } + } + + if($do == 'delete' && submitcheck('deletesubmit')) { + + if(!$_G['group']['allowmassprune']) { + $error = 4; + return; + } + + $pidsdelete = $tidsdelete = array(); + $prune = array('forums' => array(), 'thread' => array()); + + if($pids = dimplode($_GET['delete'])) { + $result = $modsession->get($cachekey); + $result['pids'] = explode(',', $result['pids']); + $keys = array_flip($result['pids']); + foreach(C::t('forum_post')->fetch_all_post($posttableid, $_GET['delete'], false) as $post) { + if($fidaddarr && !in_array($post['fid'], $fidaddarr)) { + continue; + } + $prune['forums'][$post['fid']] = $post['fid']; + $pidsdelete[$post['fid']][$post['pid']] = $post['pid']; + $pids_tids[$post['pid']] = $post['tid']; + if($post['first']) { + $tidsdelete[$post['pid']] = $post['tid']; + } else { + @$prune['thread'][$post['tid']]++; + } + $key = $keys[$post['pid']]; + unset($result['pids'][$key]); + } + $result['count'] = count($result['pids']); + $result['pids'] = implode(',', $result['pids']); + $modsession->set($cachekey, $result, true); + unset($result); + } + + if($pidsdelete) { + require_once libfile('function/post'); + require_once libfile('function/delete'); + $forums = C::t('forum_forum')->fetch_all($prune['forums']); + foreach($pidsdelete as $fid => $pids) { + foreach($pids as $pid) { + if(!$tidsdelete[$pid]) { + $deletedposts = deletepost(array($pid), 'pid', !getgpc('nocredit'), $posttableid, $forums[$fid]['recyclebin']); + updatemodlog($pids_tids[$pid], 'DLP'); + } else { + $deletedthreads = deletethread(array($tidsdelete[$pid]), false, !getgpc('nocredit'), $forums[$fid]['recyclebin']); + updatemodlog($tidsdelete[$pid], 'DEL'); + } + } + } + if(count($prune['thread']) < 50) { + foreach($prune['thread'] as $tid => $decrease) { + updatethreadcount($tid); + } + } else { + $repliesarray = array(); + foreach($prune['thread'] as $tid => $decrease) { + $repliesarray[$decrease][] = $tid; + } + foreach($repliesarray as $decrease => $tidarray) { + C::t('forum_thread')->increase($tidarray, array('replies'=>-$decrease)); + } + } + + foreach(array_unique($prune['forums']) as $id) { + updateforumcount($id); + } + + } + + $do = 'list'; + + showmessage('modcp_thread_delete_succeed', '', array(), array('break' => 1)); + } + + if($do == 'search' && submitcheck('searchsubmit', 1)) { + + if(($starttime == '0' && $endtime == '0') || ($keywords == '' && $useip == '' && $users == '')) { + $error = 1; + return ; + } + + $sql = ''; + + if($threadoption == 1) { + $first = 1; + } elseif($threadoption == 2) { + $first = 0; + } + + if($starttime != '0') { + $starttime = strtotime($starttime); + } + + if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-m-d')) { + if($endtime != '0') { + $endtime = strtotime($endtime); + } + } else { + $endtime = TIMESTAMP; + } + + if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 14) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 7)) { + $error = '2'; + return; + } + + if($users != '') { + $uids = C::t('common_member')->fetch_all_uid_by_username(array_map('trim', explode(',', $users))); + if(!$uids) { + $uids = array(0); + } + } + + if(trim($keywords)) { + foreach(explode(',', str_replace(' ', '', $keywords)) as $value) { + if(strlen($value) <= 3) { + $error = 3; + return; + } + } + } + + $useip = trim($useip); + if($useip != '') { + $useip = str_replace('*', '%', $useip); + } + + if($uids || $keywords || $useip) { + + $pids = array(); + foreach(C::t('forum_post')->fetch_all_by_search($posttableid, null, $keywords, 0, $fidaddarr, $uids, null, $starttime, $endtime, $useip, $first, 0, 1000) as $post) { + $pids[] = $post['pid']; + } + + $result['pids'] = implode(',', $pids); + $result['count'] = count($pids); + $result['fid'] = $_G['fid']; + $result['posttableid'] = $posttableid; + + $modsession->set($cachekey, $result, true); + + unset($result, $pids); + $do = 'list'; + $page = 1; + + } else { + $do = ''; + } + } + + $page = max(1, intval($_G['page'])); + $total = 0; + $query = $multipage = ''; + + if($do == 'list') { + $postarray = array(); + $result = $modsession->get($cachekey); + $threadoptionselect[$result['threadoption']] = 'selected'; + + if($result['fid'] == $_G['fid']) { + $total = $result['count']; + $tpage = ceil($total / $_G['tpp']); + $page = min($tpage, $page); + $multipage = multi($total, $_G['tpp'], $page, "$cpscript?mod=modcp&action={$_GET['action']}&op=$op&fid={$_G['fid']}&do=$do&posttableid=$posttableid"); + if($total && $result['pids']) { + $start = ($page - 1) * $_G['tpp']; + $tids = array(); + $postlist = C::t('forum_post')->fetch_all_by_pid($result['posttableid'], explode(',', $result['pids']), true, 'DESC', $start, $_G['tpp']); + foreach($postlist as $post) { + $tids[$post['tid']] = $post['tid']; + } + $threadlist = C::t('forum_thread')->fetch_all($tids); + foreach($postlist as $post) { + $post['tsubject'] = $threadlist[$post['tid']]['subject']; + $postarray[] = $post; + } + unset($threadlist, $postlist, $tids); + } + } + } + + $postlist = array(); + + if(!empty($postarray)) { + require_once libfile('function/post'); + foreach($postarray as $post) { + $post['dateline'] = dgmdate($post['dateline']); + $post['message'] = messagecutstr($post['message'], 200); + $post['forum'] = $modforums['list'][$post['fid']]; + $post['modthreadkey'] = modauthkey($post['tid']); + $postlist[] = $post; + } + } + +} + +?> \ No newline at end of file diff --git a/source/include/portalcp/index.htm b/source/include/portalcp/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/portalcp/portalcp_article.php b/source/include/portalcp/portalcp_article.php new file mode 100644 index 0000000..317dfb6 --- /dev/null +++ b/source/include/portalcp/portalcp_article.php @@ -0,0 +1,786 @@ +fetch($aid); + if(!$article) { + showmessage('article_not_exist', dreferer()); + } +} + +loadcache('portalcategory'); +$portalcategory = $_G['cache']['portalcategory']; +if($catid && empty($portalcategory[$catid])) { + showmessage('portal_category_not_find', dreferer()); +} +if(empty($article) && $catid && $portalcategory[$catid]['disallowpublish']) { + showmessage('portal_category_disallowpublish', dreferer()); +} + +if(empty($catid) && $article) { + $catid = $article['catid']; +} +$htmlstatus = !empty($_G['setting']['makehtml']['flag']) && $portalcategory[$catid]['fullfoldername']; + +if(submitcheck("articlesubmit", 0, $seccodecheck, $secqaacheck)) { + + if($aid) { + check_articleperm($article['catid'], $aid, $article); + } else { + check_articleperm($catid); + } + + $_POST['title'] = getstr(trim($_POST['title']), $_G['setting']['maxsubjectsize']); + if(strlen($_POST['title']) < 1 || dstrlen($_POST['title']) < $_G['setting']['minsubjectsize']) { + showmessage('title_not_too_little'); + } + $_POST['title'] = censor($_POST['title'], NULL, FALSE, FALSE); + + $_POST['pagetitle'] = getstr(trim($_POST['pagetitle']), 60); + $_POST['pagetitle'] = censor($_POST['pagetitle'], NULL, FALSE, FALSE); + $htmlname = basename(trim($_POST['htmlname'])); + + $highlight_style = $_GET['highlight_style']; + $style = ''; + $style = implode('|',$highlight_style); + if(empty($_POST['summary'])) $_POST['summary'] = preg_replace("/(\s|\##########NextPage(\[title=.*?\])?##########\<\/strong\>)+/", ' ', $_POST['content']); + $summary = portalcp_get_summary($_POST['summary']); + $summary = censor($summary, NULL, FALSE, FALSE); + + $_GET['author'] = dhtmlspecialchars($_GET['author']); + $_GET['url'] = str_replace('&', '&', dhtmlspecialchars($_GET['url'])); + $_GET['from'] = dhtmlspecialchars($_GET['from']); + $_GET['fromurl'] = str_replace('&', '&', dhtmlspecialchars($_GET['fromurl'])); + $_GET['dateline'] = !empty($_GET['dateline']) ? strtotime($_GET['dateline']) : TIMESTAMP; + + if(!preg_match('/^https?:\/\//is', $_GET['url'])) { + $_GET['url'] = ''; + } + + if(!preg_match('/^https?:\/\//is', $_GET['fromurl'])) { + $_GET['fromurl'] = ''; + } + + if(censormod($_POST['title']) || $_G['group']['allowpostarticlemod']) { + $article_status = 1; + } else { + $article_status = 0; + } + + $setarr = array( + 'title' => $_POST['title'], + 'author' => $_GET['author'], + 'from' => $_GET['from'], + 'fromurl' => $_GET['fromurl'], + 'dateline' => intval($_GET['dateline']), + 'url' => $_GET['url'], + 'allowcomment' => !empty($_POST['forbidcomment']) ? '0' : '1', + 'summary' => $summary, + 'catid' => intval($_POST['catid']), + 'tag' => article_make_tag($_POST['tag']), + 'status' => $article_status, + 'highlight' => $style, + 'showinnernav' => empty($_POST['showinnernav']) ? '0' : '1', + ); + + if(empty($setarr['catid'])) { + showmessage('article_choose_system_category'); + } + + if($_GET['conver']) { + $converfiles = dunserialize($_GET['conver']); + $setarr['pic'] = $converfiles['pic']; + $setarr['thumb'] = intval($converfiles['thumb']); + $setarr['remote'] = intval($converfiles['remote']); + } + + $id = 0; + $idtype = ''; + + if(empty($article)) { + $setarr['uid'] = $_G['uid']; + $setarr['username'] = $_G['username']; + $setarr['id'] = intval($_POST['id']); + $setarr['htmlname'] = $htmlname; + $table = ''; + if($setarr['id']) { + if($_POST['idtype']=='blogid') { + $table = 'home_blogfield'; + $setarr['idtype'] = 'blogid'; + $id = $setarr['id']; + $idtype = $setarr['idtype']; + } else { + $table = 'forum_thread'; + $setarr['idtype'] = 'tid'; + + require_once libfile('function/discuzcode'); + $id = C::t('forum_post')->fetch_threadpost_by_tid_invisible($setarr['id']); + $id = $id['pid']; + $idtype = 'pid'; + } + } + $aid = C::t('portal_article_title')->insert($setarr, 1); + if($table) { + if($_POST['idtype']=='blogid') { + C::t('home_blogfield')->update($setarr['id'], array('pushedaid' => $aid)); + } elseif($setarr['idtype']=='tid') { + $modarr = array( + 'tid' => $setarr['id'], + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => TIMESTAMP, + 'action' => 'PTA', + 'status' => '1', + 'stamp' => '', + ); + C::t('forum_threadmod')->insert($modarr); + + C::t('forum_thread')->update($setarr['id'], array('moderated' => 1, 'pushedaid' => $aid)); + } + } + C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED'); + C::t('portal_category')->increase($setarr['catid'], array('articles' => 1)); + C::t('portal_category')->update($setarr['catid'], array('lastpublish' => TIMESTAMP)); + C::t('portal_article_count')->insert(array('aid'=>$aid, 'catid'=>$setarr['catid'], 'viewnum'=>1)); + } else { + if($htmlname && $article['htmlname'] !== $htmlname) { + $setarr['htmlname'] = $htmlname; + $oldarticlename = $article['htmldir'].$article['htmlname']; + unlink($oldarticlename.'.'.$_G['setting']['makehtml']['extendname']); + for($i = 1; $i < $article['contents']; $i++) { + unlink($oldarticlename.$i.'.'.$_G['setting']['makehtml']['extendname']); + } + } + C::t('portal_article_title')->update($aid, $setarr); + } + + $content = getstr($_POST['content'], 0, 0, 0, 0, 1); + $content = censor($content, NULL, FALSE, FALSE); + if(censormod($content) || $_G['group']['allowpostarticlemod']) { + $article_status = 1; + } else { + $article_status = 0; + } + + $regexp = '/(\##########NextPage(\[title=(.*?)\])?##########\<\/strong\>)+/is'; + preg_match_all($regexp, $content ,$arr); + $pagetitle = !empty($arr[3]) ? $arr[3] : array(); + $pagetitle = array_map('trim', $pagetitle); + array_unshift($pagetitle, $_POST['pagetitle']); + $contents = preg_split($regexp, $content); + $cpostcount = count($contents); + + $dbcontents = C::t('portal_article_content')->fetch_all_by_aid($aid); + + $pagecount = $cdbcount = count($dbcontents); + if($cdbcount > $cpostcount) { + $cdelete = array(); + foreach(array_splice($dbcontents, $cpostcount) as $value) { + $cdelete[$value['cid']] = $value['cid']; + } + if(!empty($cdelete)) { + C::t('portal_article_content')->delete($cdelete); + } + $pagecount = $cpostcount; + } + + foreach($dbcontents as $key => $value) { + C::t('portal_article_content')->update($value['cid'], array('title' => $pagetitle[$key], 'content' => $contents[$key], 'pageorder' => $key+1)); + unset($pagetitle[$key], $contents[$key]); + } + + if($cdbcount < $cpostcount) { + foreach($contents as $key => $value) { + C::t('portal_article_content')->insert(array('aid' => $aid, 'id' => $setarr['id'], 'idtype' => $setarr['idtype'], 'title' => $pagetitle[$key], 'content' => $contents[$key], 'pageorder' => $key+1, 'dateline' => TIMESTAMP)); + } + $pagecount = $cpostcount; + } + + $updatearticle = array('contents' => $pagecount); + if($article_status == 1) { + $updatearticle['status'] = 1; + updatemoderate('aid', $aid); + manage_addnotify('verifyarticle'); + } + + $updatearticle = array_merge($updatearticle, portalcp_article_pre_next($catid, $aid)); + C::t('portal_article_title')->update($aid, $updatearticle); + + $newaids = array(); + $_POST['attach_ids'] = explode(',', $_POST['attach_ids']); + foreach ($_POST['attach_ids'] as $newaid) { + $newaid = intval($newaid); + if($newaid) $newaids[$newaid] = $newaid; + } + if($newaids) { + C::t('portal_attachment')->update_to_used($newaids, $aid); + } + + addrelatedarticle($aid, $_POST['raids']); + + if($_GET['from_idtype'] && $_GET['from_id']) { + + $id = intval($_GET['from_id']); + $notify = array(); + switch ($_GET['from_idtype']) { + case 'blogid': + $blog = C::t('home_blog')->fetch($id); + if(!empty($blog)) { + $notify = array( + 'url' => "home.php?mod=space&uid={$blog['uid']}&do=blog&id=$id", + 'subject' => $blog['subject'] + ); + $touid = $blog['uid']; + } + break; + case 'tid': + $thread = C::t('forum_thread')->fetch_thread($id); + if(!empty($thread)) { + $notify = array( + 'url' => "forum.php?mod=viewthread&tid=$id", + 'subject' => $thread['subject'] + ); + $touid = $thread['authorid']; + } + break; + } + if(!empty($notify)) { + $notify['newurl'] = 'portal.php?mod=view&aid='.$aid; + notification_add($touid, 'pusearticle', 'puse_article', $notify, 1); + } + } + + if(trim($_GET['from']) != '') { + $from_cookie = ''; + $from_cookie_array = array(); + $from_cookie = getcookie('from_cookie'); + $from_cookie_array = explode("\t", $from_cookie); + $from_cookie_array[] = $_GET['from']; + $from_cookie_array = array_unique($from_cookie_array); + $from_cookie_array = array_filter($from_cookie_array); + $from_cookie_num = count($from_cookie_array); + $from_cookie_start = $from_cookie_num - 10; + $from_cookie_start = $from_cookie_start > 0 ? $from_cookie_start : 0; + $from_cookie_array = array_slice($from_cookie_array, $from_cookie_start, $from_cookie_num); + $from_cookie = implode("\t", $from_cookie_array); + dsetcookie('from_cookie', $from_cookie); + } + dsetcookie('clearUserdata', 'home'); + $op = 'add_success'; + $article_add_url = 'portal.php?mod=portalcp&ac=article&catid='.$catid; + + + $article = C::t('portal_article_title')->fetch($aid); + $viewarticleurl = $_POST['url'] ? "portal.php?mod=list&catid={$_POST['catid']}" : fetch_article_url($article); + + include_once template("portal/portalcp_article");dexit(); + +} elseif(submitcheck('pushplussubmit')) { + + if($aid) { + check_articleperm($article['catid'], $aid, $article); + } else { + showmessage('no_article_specified_for_pushplus', dreferer()); + } + + $tourl = !empty($_POST['toedit']) ? 'portal.php?mod=portalcp&ac=article&op=edit&aid='.$aid : dreferer(); + $pids = (array)$_POST['pushpluspids']; + $posts = array(); + $tid = intval($_GET['tid']); + if($tid && $pids) { + foreach(C::t('forum_post')->fetch_all_post('tid:'.$tid, $pids) as $value) { + if($value['tid'] != $tid) { + continue; + } + $posts[$value['pid']] = $value; + } + } + if(empty($posts)) { + showmessage('no_posts_for_pushplus', dreferer()); + } + + $pageorder = C::t('portal_article_content')->fetch_max_pageorder_by_aid($aid); + $pageorder = intval($pageorder + 1); + $inserts = array(); + foreach($posts as $post) { + $summary = portalcp_get_postmessage($post); + $summary .= lang('portalcp', 'article_pushplus_info', array('author'=>$post['author'], 'url'=>'forum.php?mod=redirect&goto=findpost&ptid='.$post['tid'].'&pid='.$post['pid'])); + $inserts[] = array('aid'=>$aid, 'content'=>$summary, 'pageorder'=>$pageorder, 'dateline'=>$_G['timestamp'], 'id'=>$post['pid'], 'idtype' =>'pid'); + $pageorder++; + } + C::t('portal_article_content')->insert_batch($inserts); + $pluscount = C::t('portal_article_content')->count_by_aid($aid); + C::t('portal_article_title')->update($aid, array('contents' => $pluscount, 'owncomment' => 1)); + $commentnum = C::t('portal_comment')->count_by_id_idtype($aid, 'aid'); + C::t('portal_article_count')->update($aid, array('commentnum'=>intval($commentnum))); + showmessage('pushplus_do_success', $tourl, array(), array('header'=>1, 'refreshtime'=>0)); + +} elseif(submitcheck('verifysubmit')) { + if($aid) { + check_articleperm($article['catid'], $aid, $article, true); + } else { + showmessage('article_not_exist', dreferer()); + } + if($_POST['status'] == '0') { + C::t('portal_article_title')->update($aid, array('status'=>'0')); + updatemoderate('aid', $aid, 2); + $tourl = dreferer(fetch_article_url($article)); + showmessage('article_passed', $tourl); + + } elseif($_POST['status'] == '2') { + C::t('portal_article_title')->update($aid, array('status'=>'2')); + updatemoderate('aid', $aid, 1); + $tourl = dreferer(fetch_article_url($article)); + showmessage('article_ignored', $tourl); + + } elseif($_POST['status'] == '-1') { + include_once libfile('function/delete'); + deletearticle(array($aid), 0); + updatemoderate('aid', $aid, 2); + + $tourl = dreferer('portal.php?mod=portalcp&catid='.$article['catid']); + showmessage('article_deleted', $tourl); + + } else { + showmessage('select_operation'); + } +} + +if($op == 'delete') { + + if(!$aid) { + showmessage('article_edit_nopermission'); + } + check_articleperm($article['catid'], $aid, $article); + + if(submitcheck('deletesubmit')) { + include_once libfile('function/delete'); + $article = deletearticle(array(intval($_POST['aid'])), intval($_POST['optype'])); + showmessage('article_delete_success', "portal.php?mod=list&catid={$article[0]['catid']}"); + } + +} elseif($op == 'related') { + + $raid = intval($_GET['raid']); + $ra = array(); + if($raid) { + $ra = C::t('portal_article_title')->fetch($raid); + } + +} elseif($op == 'batch') { + + check_articleperm($catid); + + $aids = $_POST['aids']; + $optype = $_POST['optype']; + if(empty($optype) || $optype == 'push') showmessage('article_action_invalid'); + $aids = array_map('intval', $aids); + $aids = array_filter($aids); + if(empty($aids)) showmessage('article_not_choose'); + + if (submitcheck('batchsubmit')) { + if ($optype == 'trash' || $optype == 'delete') { + require_once libfile('function/delete'); + $istrash = $optype == 'trash' ? 1 : 0; + $article = deletearticle($aids, $istrash); + showmessage('article_delete_success', dreferer("portal.php?mod=portalcp&ac=category&catid={$article[0]['catid']}")); + } elseif($optype == 'move') { + if($catid) { + $categoryUpdate = array(); + foreach(C::t('portal_article_title')->fetch_all($aids) as $s_article) { + $categoryUpdate[$s_article['catid']] = $categoryUpdate[$s_article['catid']] ? --$categoryUpdate[$s_article['catid']] : -1; + $categoryUpdate[$catid] = $categoryUpdate[$catid] ? ++$categoryUpdate[$catid] : 1; + } + foreach($categoryUpdate as $scatid=>$scatnum) { + if($scatnum) { + C::t('portal_category')->increase($scatid, array('articles' => $scatnum)); + } + } + C::t('portal_article_title')->update($aids, array('catid'=>$catid)); + showmessage('article_move_success', dreferer("portal.php?mod=portalcp&ac=category&catid=$catid")); + } else { + showmessage('article_move_select_cat', dreferer()); + } + } + + } + +} elseif($op == 'verify') { + if($aid) { + check_articleperm($article['catid'], $aid, $article); + } else { + showmessage('article_not_exist', dreferer()); + } + +} elseif($op == 'pushplus') { + if($aid) { + check_articleperm($article['catid'], $aid, $article); + } else { + showmessage('no_article_specified_for_pushplus', dreferer()); + } + + $pids = (array)$_POST['topiclist']; + $tid = intval($_GET['tid']); + $pushedids = array(); + $pushcount = $pushedcount = 0; + if(!empty($pids)) { + foreach(C::t('portal_article_content')->fetch_all_by_aid($aid) as $value) { + $pushedids[] = intval($value['id']); + $pushedcount++; + } + $pids = array_diff($pids, $pushedids); + } + $pushcount = count($pids); + + if(empty($pids)) { + showmessage($pushedids ? 'all_posts_pushed_already' : 'no_posts_for_pushplus'); + } + +} else if($op == 'checkhtmlname') { + $htmlname = basename(trim($_GET['htmlname'])); + if($htmlstatus) { + $_time = !empty($article) ? $article['dateline'] : TIMESTAMP; + if(file_exists(helper_makehtml::fetch_dir($portalcategory[$catid]['fullfoldername'], $_time).$htmlname.'.'.$_G['setting']['makehtml']['extendname'])) { + showmessage('html_existed'); + } else { + showmessage('html_have_no_exists'); + } + } else { + showmessage('make_html_closed'); + } + +} else { + + if(empty($_G['cache']['portalcategory'])) { + showmessage('portal_has_not_category'); + } + + if(!checkperm('allowmanagearticle') && !checkperm('allowpostarticle')) { + $allowcategorycache = array(); + if($allowcategory = getallowcategory($_G['uid'])) { + foreach($allowcategory as $catid => $category) { + $allowcategorycache[$catid] = $_G['cache']['portalcategory'][$catid]; + } + } + foreach($allowcategorycache as &$_value) { + if($_value['upid'] && !isset($allowcategorycache[$_value['upid']])) { + $_value['level'] = 0; + } + } + $_G['cache']['portalcategory'] = $allowcategorycache; + } + + if(empty($_G['cache']['portalcategory'])) { + showmessage('portal_article_add_nopermission'); + } + + $category = $_G['cache']['portalcategory']; + $cate = $category[$catid]; + $categoryselect = category_showselect('portal', 'catid', true, !empty($article['catid']) ? $article['catid'] : $catid); + + if($aid) { + $catid = intval($article['catid']); + } + + if($aid && $article['highlight']) { + $stylecheck = ''; + $stylecheck = explode('|', $article['highlight']); + } + + $from_cookie_str = ''; + $from_cookie = array(); + $from_cookie_str = stripcslashes(getcookie('from_cookie')); + $from_cookie = explode("\t", $from_cookie_str); + $from_cookie = array_filter($from_cookie); + + if($article) { + + foreach(C::t('portal_article_content')->fetch_all_by_aid($aid) as $key => $value) { + $nextpage = ''; + if($key > 0) { + $pagetitle = $value['title'] ? '[title='.$value['title'].']' : ''; + $nextpage = "\r\n".'##########NextPage'.$pagetitle.'##########'; + } else { + $article_content['title'] = $value['title']; + } + $article_content['content'] .= $nextpage.$value['content']; + } + + $article_content['content'] = dhtmlspecialchars($article_content['content']); + + $article['attach_image'] = $article['attach_file'] = ''; + foreach(C::t('portal_attachment')->fetch_all_by_aid($aid) as $value) { + if($value['isimage']) { + if($article['pic']) { + $value['pic'] = $article['pic']; + } + } else { + } + $attachs[] = $value; + } + if($article['idtype'] == 'tid') { + foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$article['id'], 'tid', $article['id']) as $value) { + if($value['isimage']) { + if($article['pic']) { + $value['pic'] = $article['pic']; + } + $value['attachid'] = $value['aid']; + } else { + } + $value['from'] = 'forum'; + $attachs[] = $value; + } + } + + if($article['pic']) { + $article['conver'] = addslashes(serialize(array('pic'=>$article['pic'], 'thumb'=>$article['thumb'], 'remote'=>$article['remote']))); + } + + $article['related'] = array(); + if(($relateds = C::t('portal_article_related')->fetch_all_by_aid($aid))) { + foreach(C::t('portal_article_title')->fetch_all(array_keys($relateds)) as $raid=>$value) { + $article['related'][$raid] = $value['title']; + } + } + } + + $_GET['from_id'] = empty ($_GET['from_id'])?0:intval($_GET['from_id']); + if($_GET['from_idtype'] != 'blogid') $_GET['from_idtype'] = 'tid'; + + $idtypes = array($_GET['from_idtype'] => ' selected'); + if($_GET['from_idtype'] && $_GET['from_id']) { + + $havepush = C::t('portal_article_title')->fetch_count_for_idtype($_GET['from_id'], $_GET['from_idtype']); + if($havepush) { + if($_GET['from_idtype'] == 'blogid') { + showmessage('article_push_blogid_invalid_repeat', '', array(), array('return'=>true)); + } else { + showmessage('article_push_tid_invalid_repeat', '', array(), array('return'=>true)); + } + } + + switch ($_GET['from_idtype']) { + case 'blogid': + $blog = array_merge( + C::t('home_blog')->fetch($_GET['from_id']), + C::t('home_blogfield')->fetch($_GET['from_id']) + ); + if($blog) { + if($blog['friend']) { + showmessage('article_push_invalid_private'); + } + $article['title'] = getstr($blog['subject'], 0); + $article['summary'] = portalcp_get_summary($blog['message']); + $article['fromurl'] = 'home.php?mod=space&uid='.$blog['uid'].'&do=blog&id='.$blog['blogid']; + $article['author'] = $blog['username']; + $article_content['content'] = dhtmlspecialchars($blog['message']); + } + break; + default: + $posttable = getposttablebytid($_GET['from_id']); + $thread = C::t('forum_thread')->fetch_thread($_GET['from_id']); + $thread = array_merge($thread, C::t('forum_post')->fetch_threadpost_by_tid_invisible($_GET['from_id'])); + if($thread) { + $article['title'] = $thread['subject']; + $thread['message'] = portalcp_get_postmessage($thread, $_GET['getauthorall']); + $article['summary'] = portalcp_get_summary($thread['message']); + $article['fromurl'] = 'forum.php?mod=viewthread&tid='.$thread['tid']; + $article['author'] = $thread['author']; + $article_content['content'] = dhtmlspecialchars($thread['message']); + + $article['attach_image'] = $article['attach_file'] = ''; + foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$thread['tid'], 'pid', $thread['pid'], 'aid DESC') as $attach) { + $attachcode = '[attach]'.$attach['aid'].'[/attach]'; + if(!strexists($article_content['content'], $attachcode)) { + $article_content['content'] .= '

          '.$attachcode; + } + if($attach['isimage']) { + if($article['pic']) { + $attach['pic'] = $article['pic']; + } + } else { + } + $attach['from'] = 'forum'; + $attachs[] = $attach; + } + } + break; + } + } + + if(!empty($article['dateline'])) { + $article['dateline'] = dgmdate($article['dateline']); + } + if(!empty($attachs)) { + $article['attachs'] = get_upload_content($attachs); + } + $article_tags = article_parse_tags($article['tag']); + $tag_names = article_tagnames(); +} +require_once libfile('function/upload'); +$swfconfig = getuploadconfig($_G['uid'], 0, false); +require_once libfile('function/spacecp'); +$albums = getalbums($_G['uid']); +include_once template("portal/portalcp_article"); + +function portalcp_get_summary($message) { + $message = preg_replace(array("/\[attach\].*?\[\/attach\]/", "/\&[a-z]+\;/i", "/\/"), '', $message); + $message = preg_replace("/\[.*?\]/", '', $message); + $message = getstr(strip_tags($message), 200); + return $message; +} + +function portalcp_get_postmessage($post, $getauthorall = '') { + global $_G; + $forum = C::t('forum_forum')->fetch($post['fid']); + require_once libfile('function/discuzcode'); + $language = lang('forum/misc'); + if($forum['type'] == 'sub' && $forum['status'] == 3) { + loadcache('grouplevels'); + $grouplevel = $_G['grouplevels'][$forum['level']]; + $group_postpolicy = $grouplevel['postpolicy']; + if(is_array($group_postpolicy)) { + $forum = array_merge($forum, $group_postpolicy); + } + } + $post['message'] = preg_replace($language['post_edit_regexp'], '', $post['message']); + + $_message = ''; + if($getauthorall) { + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$post['tid'], $post['tid'], true, '', 0, 0, null, null, $post['authorid']) as $value){ + if(!$value['first']) { + $value['message'] = preg_replace("/\s?\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s?/is", '', $value['message']); + $value['message'] = discuzcode($value['message'], $value['smileyoff'], $value['bbcodeoff'], $value['htmlon'] & 1, $forum['allowsmilies'], $forum['allowbbcode'], ($forum['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0), $forum['allowhtml'], 0, 0, $value['authorid'], $forum['allowmediacode'], $value['pid']); + portalcp_parse_postattch($value); + $_message .= '

          '.$value['message']; + } + } + } + + $msglower = strtolower($post['message']); + if(strpos($msglower, '[/media]') !== FALSE) { + $post['message'] = preg_replace_callback("/\[media=([\w%,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/is", 'portalcp_get_postmessage_callback_parsearticlemedia_12', $post['message']); + } + if(strpos($msglower, '[/audio]') !== FALSE) { + $post['message'] = preg_replace_callback("/\[audio(=1)*\]\s*([^\[\<\r\n]+?)\s*\[\/audio\]/is", 'portalcp_get_postmessage_callback_parsearticlemedia_2', $post['message']); + } + if(strpos($msglower, '[/flash]') !== FALSE) { + $post['message'] = preg_replace_callback("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", 'portalcp_get_postmessage_callback_parsearticlemedia_4', $post['message']); + } + + $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $forum['allowsmilies'], $forum['allowbbcode'], ($forum['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0), $forum['allowhtml'], 0, 0, $post['authorid'], $forum['allowmediacode'], $post['pid']); + portalcp_parse_postattch($post); + + if(strpos($post['message'], '[/flash1]') !== FALSE) { + $post['message'] = str_replace('[/flash1]', '[/flash]', $post['message']); + } + return $post['message'].$_message; +} + +function portalcp_get_postmessage_callback_parsearticlemedia_12($matches) { + return parsearticlemedia($matches[1], $matches[2]); +} + +function portalcp_get_postmessage_callback_parsearticlemedia_2($matches) { + return parsearticlemedia('mid,0,0', $matches[2]); +} + +function portalcp_get_postmessage_callback_parsearticlemedia_4($matches) { + return parsearticlemedia('swf,0,0', $matches[4]); +} + +function portalcp_parse_postattch(&$post) { + static $allpostattchs = null; + if($allpostattchs === null) { + $allpostattchs = array(); + foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$post['tid'], 'tid', $post['tid']) as $attch) { + $allpostattchs[$attch['pid']][$attch['aid']] = $attch['aid']; + } + } + $attachs = $allpostattchs[$post['pid']]; + if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $post['message'], $matchaids)) { + $attachs = array_diff($allpostattchs[$post['pid']], $matchaids[1]); + } + if($attachs) { + $add = ''; + foreach($attachs as $attachid) { + $add .= '
          '.'[attach]'.$attachid.'[/attach]'; + } + $post['message'] .= $add; + } +} +function parsearticlemedia($params, $url) { + global $_G; + + $params = explode(',', $params); + + $url = addslashes($url); + if($flv = parseflv($url, 0, 0)) { + $url = $flv['flv']; + $params[0] = 'swf'; + } + if(in_array(count($params), array(3, 4))) { + $type = $params[0]; + $url = str_replace(array('<', '>'), '', str_replace('\\"', '\"', $url)); + switch($type) { + case 'mp3': + case 'wma': + case 'ra': + case 'ram': + case 'wav': + case 'mid': + return '[flash=mp3]'.$url.'[/flash1]'; + case 'rm': + case 'rmvb': + case 'rtsp': + return '[flash=real]'.$url.'[/flash1]'; + case 'swf': + return '[flash]'.$url.'[/flash1]'; + case 'asf': + case 'asx': + case 'wmv': + case 'mms': + case 'avi': + case 'mpg': + case 'mpeg': + case 'mov': + return '[flash=media]'.$url.'[/flash1]'; + default: + return ''.$url.''; + } + } + return; +} + +function portalcp_article_pre_next($catid, $aid) { + $data = array( + 'preaid' => C::t('portal_article_title')->fetch_preaid_by_catid_aid($catid, $aid), + 'nextaid' => C::t('portal_article_title')->fetch_nextaid_by_catid_aid($catid, $aid), + ); + if($data['preaid']) { + C::t('portal_article_title')->update($data['preaid'], array( + 'preaid' => C::t('portal_article_title')->fetch_preaid_by_catid_aid($catid, $data['preaid']), + 'nextaid' => C::t('portal_article_title')->fetch_nextaid_by_catid_aid($catid, $data['preaid']), + ) + ); + } + return $data; +} + +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_block.php b/source/include/portalcp/portalcp_block.php new file mode 100644 index 0000000..0cda1a4 --- /dev/null +++ b/source/include/portalcp/portalcp_block.php @@ -0,0 +1,1064 @@ +fetch($bid))) { + showmessage('block_not_exist'); + } + + $blockstyle = array(); + if(!empty($block['styleid'])) { + $blockstyle = block_getstyle($block['styleid']); + } else { + $blockstyle = dunserialize($block['blockstyle']); + } + $block['moreurl'] = $blockstyle['moreurl'] && in_array($block['blockclass'], array('forum_thread', 'portal_article', 'group_thread'), true) ? 1 : 0; + + $_G['block'][$bid] = $block; + $blockperm = getblockperm($bid); + if($blockperm['allowmanage']) { + $allowmanage = 1; + $allowdata = 1; + } + if ($blockperm['allowrecommend'] && !$blockperm['needverify']) { + $allowdata = 1; + } +} + +if(empty($block['bid'])) { + $bid = 0; +} + +$_GET['classname'] = !empty($_GET['classname']) ? $_GET['classname'] : ($block ? $block['blockclass'] : 'html_html'); +$theclass = block_getclass($_GET['classname'], true); +$theclass['script'] = isset($theclass['script']) ? $theclass['script'] : array(); +if(!empty($_GET['styleid']) && isset($theclass['style'][$_GET['styleid']])) { + $thestyle = $theclass['style'][$_GET['styleid']]; +} elseif(isset($theclass['style'][$block['styleid']])) { + $_GET['styleid'] = intval($block['styleid']); + $thestyle = $theclass['style'][$_GET['styleid']]; +} else { + $_GET['styleid'] = 0; + $thestyle = (array)dunserialize($block['blockstyle']); +} +$_GET['script'] = !empty($_GET['script']) && isset($theclass['script'][$_GET['script']]) + ? $_GET['script'] + : (!empty($block['script']) ? $block['script'] : key($theclass['script'])); + +$blocktype = (!empty($_GET['blocktype']) || !empty($block['blocktype'])) ? 1 : 0; +$isrealtime = substr($_GET['classname'], -5) == '_real'; +$nocachetime = in_array($_GET['script'], array('blank', 'line', 'banner', 'vedio', 'google')) || $isrealtime ? true : false; +$is_htmlblock = ($_GET['classname'] == 'html_html') || $isrealtime ? 1 : 0; +$showhtmltip = false; +if($op == 'data' && $is_htmlblock) { + $op = 'block'; + $showhtmltip = true; +} +$block['blockclass'] = empty($block['blockclass']) ? $_GET['classname'] : $block['blockclass']; +$is_recommendable = block_isrecommendable($block); + +if($op == 'block') { + if($bid && !$allowmanage) { + showmessage('block_edit_nopermission'); + } + if(!$bid) { + list($tpl, $id) = explode(':', $_GET['tpl']); + if(trim($tpl)=='portal/portal_topic_content') { + if(!$_G['group']['allowaddtopic'] && !$_G['group']['allowmanagetopic']) { + showmessage('block_topic_nopermission'); + } + } elseif(!$_G['group']['allowdiy']) { + showmessage('block_add_nopermission'); + } + } + + if(submitcheck('blocksubmit')) { + $_POST['cachetime'] = intval($_POST['cachetime']) * 60; + $_POST['styleid'] = intval($_POST['styleid']); + $_POST['shownum'] = intval($_POST['shownum']); + $_POST['picwidth'] = $_POST['picwidth'] ? intval($_POST['picwidth']) : 0; + $_POST['picheight'] = $_POST['picheight'] ? intval($_POST['picheight']) : 0; + $_POST['script'] = isset($theclass['script'][$_POST['script']]) ? $_POST['script'] : key($theclass['script']); + $_POST['a_target'] = in_array($_POST['a_target'], array('blank', 'top', 'self')) ? $_POST['a_target'] : 'blank'; + $_POST['dateformat'] = in_array($_POST['dateformat'], array('Y-m-d', 'm-d', 'H:i', 'Y-m-d H:i')) ? $_POST['dateformat'] : 'Y-m-d'; + $_POST['isblank'] = intval($_POST['isblank']); + $_POST['cachetimerangestart'] = intval($_POST['cachetimerangestart']); + $_POST['cachetimerangeend'] = intval($_POST['cachetimerangeend']); + $summary = getstr($_POST['summary'], '', 0, 0, 0, 1); + if($summary) { + $tag = block_ckeck_summary($summary); + if($tag != $summary) { + $msg = lang('portalcp', 'block_diy_summary_html_tag').$tag.lang('portalcp', 'block_diy_summary_not_closed'); + showmessage($msg); + } + } + + $_POST['shownum'] = $_POST['shownum'] > 0 ? $_POST['shownum'] : 10; + $_POST['parameter']['items'] = $_POST['shownum']; + $cachetimerange = $_POST['cachetimerangestart'].','.$_POST['cachetimerangeend']; + if(empty($_G['setting']['blockcachetimerange'])) { + $cachetimerange = $cachetimerange == '0,23' ? '' : $cachetimerange; + } else { + $cachetimerange = $cachetimerange == $_G['setting']['blockcachetimerange'] ? '' : $cachetimerange; + } + include_once libfile('function/home'); + $setarr = array( + 'name' => getstr($_POST['name'], 255), + 'summary' => $summary, + 'styleid' => $_POST['styleid'], + 'script' => $_POST['script'], + 'cachetime' => intval($_POST['cachetime']), + 'cachetimerange' => $cachetimerange, + 'punctualupdate' => !empty($_POST['punctualupdate']) ? '1' : '0', + 'shownum' => $_POST['shownum'], + 'picwidth' => $_POST['picwidth'] && $_POST['picwidth'] > 8 && $_POST['picwidth'] < 1960 ? $_POST['picwidth'] : 0, + 'picheight' => $_POST['picheight'] && $_POST['picheight'] > 8 && $_POST['picheight'] < 1960 ? $_POST['picheight'] : 0, + 'target' => $_POST['a_target'], + 'dateuformat' => !empty($_POST['dateuformat']) ? '1' : '0', + 'dateformat' => $_POST['dateformat'], + 'hidedisplay' => $_POST['hidedisplay'] ? '1' : '0', + 'dateline' => TIMESTAMP, + 'isblank' => $_POST['isblank'] + ); + + $picdata = array(); + if(!empty($_FILES)) { + foreach($_FILES as $varname => $file) { + if($file['tmp_name']) { + $result = pic_upload($file, 'portal'); + $pic = 'portal/'.$result['pic']; + $picdata[] = array('bid' => $bid, 'pic' => $pic, 'picflag' =>$result['remote'] , 'type' => '1'); + $pic = $result['remote'] ? $_G['setting']['ftp']['attachurl'].$pic : $_G['setting']['attachurl'].$pic; + $_POST['parameter'][$varname] = $pic; + } + } + } + + if(($block['blockclass'] == 'html_html' || $_GET['classname'] == 'html_html') && $_POST['script'] == 'blank' && isset($_POST['parameter']['content'])) { + $_POST['parameter']['content'] = addslashes($_POST['parameter']['content']); + } + + $parameter = $_POST['parameter']; + if(isset($block['param'])) { + $blockobj = block_script($block['blockclass'], $block['script']); + if($blockobj) { + $_block_setting = $blockobj->getsetting(); + foreach($block['param'] as $_key => $_val) { + if(!isset($parameter[$_key]) && (!isset($_block_setting[$_key]) || (isset($_block_setting[$_key]) && $_block_setting[$_key]['type'] !== 'mcheckbox'))) { + $parameter[$_key] = $_val; + } + } + } else { + $parameter = $parameter + $block['param']; + } + } + $setarr['param'] = serialize($parameter); + + if($bid) { + C::t('common_block')->update($bid, $setarr); + } else { + $setarr['blockclass'] = $_GET['classname']; + $setarr['uid'] = $_G['uid']; + $setarr['username'] = $_G['username']; + $setarr['notinherited'] = 0; + if($blocktype == 1) { + $setarr['blocktype'] = '1'; + } + $bid = C::t('common_block')->insert($setarr, true); + } + + if(!empty($picdata)) { + C::t('common_block_pic')->insert_by_bid($bid, $picdata); + } + + $_G['block'][$bid] = C::t('common_block')->fetch($bid); + block_updatecache($bid, true); + showmessage('do_success', 'portal.php?mod=portalcp&ac=block&op=block&bid='.$bid, array('bid'=>$bid, 'eleid'=> $_GET['eleid'])); + } + + loadcache(array('blockconvert', 'blockindex')); + $block['script'] = isset($block['script']) ? $block['script'] : $_GET['script']; + + if($block['blockclass'] == 'html_html' && $block['script'] == 'blank'){ + $block['param']['content'] = stripslashes($block['param']['content']); + } + + $settings = block_setting($_GET['classname'], $block['script'], $block['param']); + $scriptarr = array($block['script'] => ' selected'); + $stylearr = array($_GET['styleid'] => ' selected'); + + $block = block_checkdefault($block); + $cachetimearr = array($block['cachetime'] =>' selected="selected"'); + $block['cachetime_min'] = intval($block['cachetime'] / 60); + $targetarr[$block['target']] = ' selected'; + $block['cachetimerange'] = empty($block['cachetimerange']) ? (isset($_G['setting']['blockcachetimerange']) ? $_G['setting']['blockcachetimerange'] : '') : $block['cachetimerange']; + $block['cachetimerange'] = empty($block['cachetimerange']) ? array('0', '23') : explode(',', $block['cachetimerange']); + $cachetimerange = range(0, 23); + $dateformats = block_getdateformats($block['dateformat']); + + $block['summary'] = dhtmlspecialchars($block['summary']); + $blockclassname = ''; + $blockclass = $block['blockclass'] ? $block['blockclass'] : $_GET['classname']; + $arr = explode('_', $blockclass); + if(count($arr) >= 2) { + $blockclassname = !empty($_G['cache']['blockclass'][$_G['cache']['blockindex']['class'][$blockclass]]['name']) ? $_G['cache']['blockclass'][$_G['cache']['blockindex']['class'][$blockclass]]['name'] : ''; + } + $blockclassname = empty($blockclassname) ? $blockclass : $blockclassname; + +} elseif($op == 'banids') { + if(!$bid || (!$allowmanage && !$allowdata)) { + showmessage('block_edit_nopermission'); + } + + if(isset($_GET['bannedids']) && $block['param']['bannedids'] != $_GET['bannedids']) { + $arr = explode(',', $_GET['bannedids']); + $arr = array_map('intval', $arr); + $arr = array_filter($arr); + $_GET['bannedids'] = implode(',', $arr); + $block['param']['bannedids'] = $_GET['bannedids']; + C::t('common_block')->update($bid, array('param'=>serialize($block['param']))); + $_G['block'][$bid] = $block; + block_updatecache($bid, true); + } + + showmessage('do_success', 'portal.php?mod=portalcp&ac=block&op=data&bid='.$bid, array('bid'=>$bid, 'eleid'=> $_GET['eleid'])); + +} elseif($op == 'data') { + if(!$bid || (!$allowmanage && !$allowdata)) { + showmessage('block_edit_nopermission'); + } + + if(submitcheck('updatesubmit')) { + if($_POST['displayorder']) { + asort($_POST['displayorder']); + $orders = $ids = array(); + $order = 1; + foreach($_POST['displayorder'] as $k=>$v) { + $k = intval($k); + $ids[] = $k; + $orders[$k] = $order; + $order++; + } + $items = array(); + foreach(C::t('common_block_item')->fetch_all($ids) as $value) { + if($value['bid'] == $bid) { + $items[$value['itemid']] = $value; + } + } + foreach($items as $key=>$value) { + $itemtype = !empty($_POST['locked'][$key]) ? '1' : '0'; + if($orders[$key] != $value['displayorder'] || $itemtype != $value['itemtype']) { + C::t('common_block_item')->update($key, array('displayorder'=>$orders[$key], 'itemtype'=>$itemtype)); + } + } + } + showmessage('do_success', 'portal.php?mod=portalcp&ac=block&op=data&bid='.$bid, array('bid'=>$bid, 'eleid'=> $_GET['eleid'])); + } + + $itemlist = array(); + if($bid) { + $preorders = array(); + foreach(C::t('common_block_item')->fetch_all_by_bid($bid, true) as $value) { + if($value['itemtype']==1 && $value['enddate'] && $value['enddate'] <= TIMESTAMP) { + continue; + } + $value['ispreorder'] = false; + if($value['itemtype']==1) { + if($value['startdate'] > TIMESTAMP) { + $value['ispreorder'] = true; + } else { + $preorders[$value['displayorder']] = $value['itemid']; + } + } + $value['itemtypename'] = lang('portalcp', 'itemtypename'.$value['itemtype']); + $itemlist[$value['itemid']] = $value; + } + if($preorders) { + foreach($itemlist as $key=>$value) { + if(isset($preorders[$value['displayorder']]) && $value['itemid'] != $preorders[$value['displayorder']]) { + unset($itemlist[$key]); + } + } + } + } + + $block['param']['bannedids'] = !empty($block['param']['bannedids']) ? $block['param']['bannedids'] : ''; + +} elseif($op == 'style') { + if(!$bid || !$allowmanage) { + showmessage('block_edit_nopermission'); + } + + if(submitcheck('stylesubmit')) { + $_POST['name'] = trim($_POST['name']); + $arr = array( + 'name' => $_POST['name'], + 'blockclass' => $_GET['classname'], + ); + $_POST['template'] = $_POST['template']; + + include_once libfile('function/block'); + block_parse_template($_POST['template'], $arr); + if(!empty($_POST['name'])) { + $styleid = C::t('common_block_style')->insert($arr, true); + } + $arr['fields'] = dunserialize($arr['fields']); + $arr['template'] = dunserialize($arr['template']); + $arr = serialize($arr); + C::t('common_block')->update($bid, array('blockstyle'=>$arr, 'styleid'=>'0')); + + showmessage('do_success', 'portal.php?mod=portalcp&ac=block&op=style&bid='.$bid, array('bid'=>$bid, 'eleid'=> $_GET['eleid'])); + } + + $template = block_build_template($blockstyle['template']); + + $samplecode = ''; + if($block['hidedisplay']) { + $samplecode = ''; + $samplecode = dhtmlspecialchars($samplecode); + $samplecode = str_replace('\n', '
          ', $samplecode); + } + +} elseif($op == 'itemdata') { + + if(!$bid || (!$allowmanage && !$allowdata)) { + showmessage('block_edit_nopermission'); + } + if(!$is_recommendable) { + showmessage('block_no_recommend_library'); + } + + $theurl = 'portal.php?mod=portalcp&ac=block&op=itemdata'; + $perpage = 20; + $page = max(1,intval($_GET['page'])); + $start = ($page-1)*$perpage; + if($start<0) $start = 0; + + if(submitcheck('deletesubmit')) { + if(!empty($_POST['ids'])) { + C::t('common_block_item_data')->delete_by_dataid_bid($_POST['ids'], $bid); + } + + $displayorder = array_map('intval', $_POST['displayorder']); + foreach($displayorder as $dataid => $displayorder) { + if($displayorder !== intval($_POST['olddisplayorder'][$dataid])) { + C::t('common_block_item_data')->update($dataid, array('displayorder' => $displayorder)); + } + } + showmessage('do_success', "portal.php?mod=portalcp&ac=block&op=itemdata&bid=$bid&page=$page"); + } + + $count = C::t('common_block_item_data')->count_by_bid($bid); + $multi = ''; + $datalist = array(); + if($count) { + $datalist = C::t('common_block_item_data')->fetch_all_by_bid($bid, 1, $start, $perpage); + $multi = multi($count, $perpage, $page, "portal.php?mod=portalcp&ac=block&bid=$bid&op=itemdata"); + } + +} elseif($op == 'setting') { + + if(($bid && !$allowmanage)) { + showmessage('block_edit_nopermission'); + } + + $settings = array(); + if($theclass['script'][$_GET['script']]) { + $settings = block_setting($_GET['classname'], $_GET['script'], $block['param']); + } + + $block['script'] = isset($block['script']) ? $block['script'] : $_GET['script']; + $scriptarr = array($block['script'] => ' selected'); + $stylearr = array($_GET['styleid'] => ' selected'); + + $block = block_checkdefault($block); + $cachetimearr = array($block['cachetime'] =>' selected="selected"'); + $block['cachetime_min'] = intval($block['cachetime'] / 60); + $targetarr[$block['target']] = ' selected'; + +} elseif($op == 'thumbsetting') { + + if(($bid && !$allowmanage)) { + showmessage('block_edit_nopermission'); + } + + $block = block_checkdefault($block); + $cachetimearr = array($block['cachetime'] =>' selected="selected"'); + $block['cachetime_min'] = intval($block['cachetime'] / 60); + $targetarr[$block['target']] = ' selected'; + + $dateformats = block_getdateformats($block['dateformat']); + +} elseif($op == 'remove') { + + if(!$bid || (!$allowmanage && !$allowdata)) { + showmessage('block_edit_nopermission'); + } + + if($_GET['itemid']) { + $_GET['itemid'] = intval($_GET['itemid']); + if(($item = C::t('common_block_item')->fetch($_GET['itemid'])) && $item['bid'] == $bid) { + C::t('common_block_item')->delete($_GET['itemid']); + if($item['itemtype'] != '1') { + block_ban_item($block, $item); + } + block_updatecache($bid, true); + } + } + showmessage('do_success', "portal.php?mod=portalcp&ac=block&op=data&bid=$bid", array('bid'=>$bid)); + +} elseif( in_array($op, array('item', 'additem', 'push', 'recommend', 'verifydata', 'managedata'))) { + + if(!$bid) { + showmessage('block_edit_nopermission'); + } + + $itemid = $_GET['itemid'] ? intval($_GET['itemid']) : 0; + $dataid = $_GET['dataid'] ? intval($_GET['dataid']) : 0; + $_GET['id'] = intval($_GET['id']); + $_GET['idtype'] = preg_replace('/[^\w]/', '', $_GET['idtype']); + + $item = $perm = array(); + if($op == 'item' || $op == 'additem') { + if(!$allowmanage && !$allowdata) { + showmessage('block_edit_nopermission'); + } + if($itemid && ($item = C::t('common_block_item')->fetch($itemid))) { + $item['fields'] = dunserialize($item['fields']); + } + } elseif($op == 'push') { + + $item = get_push_item($block, $thestyle, $_GET['id'], $_GET['idtype']); + if($itemid) { + $item['itemid'] = $itemid; + } + } elseif($op == 'recommend') { + $perm = getblockperm($bid); + if(!$perm['allowmanage'] && !$perm['allowrecommend']) { + showmessage('block_no_right_recommend'); + } + + $isrepeatrecommend = false; + $idtype = $_GET['idtype'] == 'gtid' ? 'tid' : $_GET['idtype']; + if(($item = C::t('common_block_item_data')->fetch_by_bid_id_idtype($bid, $_GET['id'], $idtype))) { + $item['fields'] = dunserialize($item['fields']); + $isrepeatrecommend = true; + + if(!$perm['allowmanage'] && $item['uid'] != $_G['uid']) { + showmessage('data_in_mod_library', null, null, array('striptags' => false)); + } + + } else { + if(in_array($_GET['idtype'],array('tid', 'gtid', 'aid', 'picid', 'blogid'))) { + $_GET['idtype'] = $_GET['idtype'] == 'gtid' ? 'tids' : $_GET['idtype'].'s'; + } + $item = get_push_item($block, $thestyle, $_GET['id'], $_GET['idtype'], $block['blockclass'], $block['script']); + if(empty($item)) showmessage('block_data_type_invalid', null, null, array('msgtype'=>3)); + } + } elseif($op=='verifydata' || $op=='managedata') { + if(!$allowmanage && !$allowdata) { + showmessage('no_right_manage_data'); + } + if($dataid) { + $item = C::t('common_block_item_data')->fetch($dataid); + $item['fields'] = dunserialize($item['fields']); + } + } + + if(!$item && $op != 'additem') { + showmessage('block_edit_nopermission'); + } + + $item['oldpic'] = $item['pic']; + if($item['picflag'] == '1') { + $item['pic'] = $item['pic'] ? $_G['setting']['attachurl'].$item['pic'] : ''; + } elseif($item['picflag'] == '2') { + $item['pic'] = $item['pic'] ? $_G['setting']['ftp']['attachurl'].$item['pic'] : ''; + } + + $item['startdate'] = $item['startdate'] ? dgmdate($item['startdate']) : dgmdate(TIMESTAMP); + $item['enddate'] = $item['enddate'] ? dgmdate($item['enddate']) : ''; + $orders = range(1, $block['shownum']); + $orderarr[$item['displayorder']] = ' selected="selected"'; + $item['showstyle'] = !empty($item['showstyle']) ? (array)(dunserialize($item['showstyle'])) : (!empty($item['fields']['showstyle']) ? $item['fields']['showstyle'] : array()); + $showstylearr = array(); + foreach(array('title_b', 'title_i', 'title_u', 'title_c', 'summary_b', 'summary_i', 'summary_u', 'title_c') as $value) { + if(!empty($item['showstyle'][$value])) { + $showstylearr[$value] = 'class="a"'; + } + } + + $itemfields = $blockitem = $item; + unset($itemfields['fields']); + $item['fields'] = (array)$item['fields']; + foreach($item['fields'] as $key=>$value) { + if($theclass['fields'][$key]) { + switch($theclass['fields'][$key]['datatype']) { + case 'date': + $itemfields[$key] = dgmdate($value, 'Y-m-d H:i:s'); + break; + case 'int': + $itemfields[$key] = intval($value); + break; + case 'string': + $itemfields[$key] = dhtmlspecialchars($value); + break; + default: + $itemfields[$key] = $value; + } + } + } + + $showfields = array(); + if(empty($thestyle['fields'])) { + $template = block_build_template($thestyle['template']); + $thestyle['fields'] = block_parse_fields($template); + C::t('common_block_style')->update(intval($thestyle['styleid']), array('fields'=>serialize($thestyle['fields']))); + } + foreach($thestyle['fields'] as $fieldname) { + $showfields[$fieldname] = "1"; + } + + if(submitcheck('itemsubmit') || submitcheck('recommendsubmit') || submitcheck('verifydatasubmit') || submitcheck('managedatasubmit')) { + $item['bid'] = $block['bid']; + $item['displayorder'] = intval($_POST['displayorder']); + $item['startdate'] = !empty($_POST['startdate']) ? strtotime($_POST['startdate']) : 0; + $item['enddate'] = !empty($_POST['enddate']) ? strtotime($_POST['enddate']) : 0; + $item['itemtype'] = !empty($_POST['locked']) ? '1' : '2'; + $item['title'] = dhtmlspecialchars($_POST['title']); + $item['url'] = $_POST['url']; + $block['param']['summarylength'] = empty($block['param']['summarylength']) ? 80 : $block['param']['summarylength']; + $block['param']['titlelength'] = empty($block['param']['titlelength']) ? 40 : $block['param']['titlelength']; + $item['summary'] = cutstr($_POST['summary'], $block['param']['summarylength'], ''); + if($_FILES['pic']['tmp_name']) { + $result = pic_upload($_FILES['pic'], 'portal'); + $item['pic'] = 'portal/'.$result['pic']; + $item['picflag'] = $result['remote'] ? '2' : '1'; + $item['makethumb'] = 0; + $item['thumbpath'] = ''; + $thumbdata = array('bid' => $block['bid'], 'itemid' => $item['itemid'], 'pic' => $item['pic'], 'picflag' => $result['remote'], 'type' => '1'); + C::t('common_block_pic')->insert($thumbdata); + } elseif($_POST['pic']) { + $pic = dhtmlspecialchars($_POST['pic']); + $urls = parse_url($pic); + if(!empty($urls['scheme']) && !empty($urls['host'])) { + $item['picflag'] = '0'; + $item['thumbpath'] = ''; + } else { + $item['picflag'] = intval($_POST['picflag']); + } + if($item['pic'] != $pic) { + $item['pic'] = $pic; + $item['makethumb'] = 0; + $item['thumbpath'] = block_thumbpath($block, $item); + } + } + unset($item['oldpic']); + $item['showstyle'] = $_POST['showstyle']['title_b'] || $_POST['showstyle']['title_i'] || $_POST['showstyle']['title_u'] || $_POST['showstyle']['title_c'] ? $_POST['showstyle'] : array(); + $item['showstyle'] = empty($item['showstyle']) ? '' : serialize($item['showstyle']); + + foreach($theclass['fields'] as $key=>$value) { + if(!isset($item[$key]) && isset($_POST[$key])) { + if($value['datatype'] == 'int') { + $_POST[$key] = intval($_POST[$key]); + } elseif($value['datatype'] == 'date') { + $_POST[$key] = strtotime($_POST[$key]); + } else { + $_POST[$key] = $_POST[$key]; + } + $item['fields'][$key] = $_POST[$key]; + } + } + if(isset($item['fields']['fulltitle'])) { + $item['fields']['fulltitle'] = $item['title']; + } + $item['fields'] = serialize($item['fields']); + + $item['title'] = cutstr($item['title'], $block['param']['titlelength'], ''); + + if($_POST['icflag']) { + $item['makethumb'] = 1; + $item['thumbpath'] = block_thumbpath($block, $item); + } + if(submitcheck('itemsubmit')) { + + if($op == 'additem' && !$item['id']) { + $item['id'] = ($pushid = intval($_POST['push_id'])) ? $pushid : mt_rand(1,9999); + $item['idtype'] = 'rand'; + } + if($item['startdate'] > $_G['timestamp']) { + C::t('common_block_item')->insert($item, false, true); + } elseif(empty($item['enddate']) || $item['enddate'] > $_G['timestamp']) { + C::t('common_block_item')->delete_by_bid_displayorder($bid, $item['displayorder']); + C::t('common_block_item')->insert($item, false, true); + } else { + C::t('common_block_item')->delete_by_itemid_bid($item['itemid'], $bid); + } + block_updatecache($bid, true); + showmessage('do_success', 'portal.php?mod=portalcp&ac=block&op=data&bid='.$block['bid'], array('bid'=>$bid)); + + } elseif(submitcheck('recommendsubmit')) { + include_once libfile('function/home'); + $thumbpath = $item['thumbpath']; + unset($item['itemid']); + unset($item['thumbpath']); + $item['itemtype'] = '0'; + $item['uid'] = $_G['uid']; + $item['username'] = $_G['username']; + $item['dateline'] = TIMESTAMP; + $item['isverified'] = empty($_POST['needverify']) && ($perm['allowmanage'] || empty($perm['needverify'])) ? '1' : '0'; + $item['verifiedtime'] = TIMESTAMP; + + C::t('common_block_item_data')->insert($item, false, true); + if($_GET['showrecommendtip'] && (in_array($_GET['idtype'], array('tids', 'tid', 'gtid')))) { + $modarr = array( + 'tid' => $item['id'], + 'uid' => $item['uid'], + 'username' => $item['username'], + 'dateline' => TIMESTAMP, + 'action' => 'REB', + 'status' => '1', + 'stamp' => '', + 'reason' => getstr($_GET['recommendto'], 20), + ); + C::t('forum_threadmod')->insert($modarr); + $data = array('moderated' => 1); + loadcache('stamptypeid'); + if(array_key_exists(4, $_G['cache']['stamptypeid'])) { + $data['stamp'] = $_G['cache']['stamptypeid']['4']; + } + C::t('forum_thread')->update($item['id'], $data); + } + if($_POST['icflag'] && !(C::t('common_block_pic')->count_by_bid_pic($block['bid'], $thumbpath))) { + $picflag = 0; //common_block_pic表中的picflag标识(0本地,1远程) + if($_G['setting']['ftp']['on'] && !empty($_G['setting']['ftp']['host'])) { + $ftp = & discuz_ftp::instance(); + $ftp->connect(); + if(($ftp->connectid && $ftp->ftp_size($thumbpath) > 0) || (ftpperm(fileext($thumbpath), filesize($_G['setting']['attachdir'].'./'.$thumbpath)) && $ftp->upload($_G['setting']['attachurl'].'/'.$thumbpath, $thumbpath))) { + $picflag = 1; //common_block_pic表中的picflag标识(0本地,1远程) + @unlink($_G['setting']['attachdir'].'./'.$thumbpath); + } + } + + $thumbdata = array('bid' => $block['bid'], 'itemid' => 0, 'pic' => $thumbpath, 'picflag' => $picflag, 'type' => '0'); + C::t('common_block_pic')->insert($thumbdata); + } + if(!empty($_POST['updateblock'])) { + block_updatecache($bid, true); + } + + if(($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3) || !empty($_GET['sendreasonpm'])) { + $sendreasonpm = 1; + } else { + $sendreasonpm = 0; + } + if($sendreasonpm) { + require_once libfile('function/misc'); + if((in_array($_GET['idtype'], array('tids', 'tid', 'gtid')))) { + $sendreasonpmcontent = C::t('forum_thread')->fetch_thread($item['id']); + sendreasonpm($sendreasonpmcontent, 'recommend_note_post', array( + 'tid' => $item['id'], + 'subject' => $sendreasonpmcontent['subject'], + 'from_id' => 0, + 'from_idtype' => 'recommend' + )); + } + } + + $showrecommendrate = ''; + if($_G['group']['raterange'] && (in_array($_GET['idtype'], array('tids', 'tid', 'gtid')))) { + $showrecommendrate = 1; + } + if($showrecommendrate) { + showmessage('do_success', dreferer('portal.php'), array(), array('showdialog' => true, 'closetime' => 0.01, 'extrajs' => + '')); + } elseif($_GET['showrecommendtip']) { + showmessage('do_success', dreferer('portal.php'), array(), array('showdialog' => true, 'closetime' => true, 'extrajs' => + '')); + } else { + showmessage('do_success', dreferer('portal.php'), array(), array('showdialog' => true, 'closetime' => true)); + } + } elseif(submitcheck('verifydatasubmit')) { + unset($item['thumbpath']); + $item['isverified'] = '1'; + $item['verifiedtime'] = TIMESTAMP; + C::t('common_block_item_data')->update($dataid, $item); + if(!empty($_POST['updateblock'])) { + block_updatecache($bid, true); + } + showmessage('do_success', dreferer('portal.php?mod=portalcp&ac=portalblock&op=verifieddata&searchkey=%23'.$bid)); + } elseif(submitcheck('managedatasubmit')) { + unset($item['thumbpath']); + $item['stickgrade'] = intval($_POST['stickgrade']); + C::t('common_block_item_data')->update($dataid, $item); + showmessage('do_success', dreferer('portal.php?mod=portalcp&ac=block&op=itemdata&bid='.$bid)); + } + } + if(in_array($block['blockclass'], array('forum_thread', 'portal_article', 'group_thread', 'space_blog'), true)) { + $picdatas = array(); + $prefix = ($item['picflag'] == 2 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']); + $itemfields['pics'] = array(); + $first = true; + + if(empty($_GET['idtype'])) { + $_GET['idtype'] = $itemfields['idtype'].'s'; + $_GET['id'] = $itemfields['id']; + } + + if(in_array($_GET['idtype'], array('tids', 'tid'))) { + $prefix .= 'forum/'; + $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_GET['id']); + foreach(C::t('forum_attachment_n')->fetch_all_by_pid_width('pid:'.$firstpost['pid'], $firstpost['pid'], $block['picwidth']) as $pic) { + if($first) { + $first = false; + $itemfields['pics'][0] = ''; + if(strpos($itemfields['oldpic'], 'nophoto.gif') !== false) { + $itemfields['oldpic'] = 'forum/'.$pic['attachment']; + } + } + $thumb = $prefix.($pic['thumb'] ? getimgthumbname($pic['attachment']) : $pic['attachment']); + if('forum/'.$pic['attachment'] == $itemfields['oldpic']) { + $itemfields['pics'][0] = array('big' => $prefix.$pic['attachment'], 'thumb' => $thumb, 'attachment' => 'forum/'.$pic['attachment'], 'first' => 1); + } else { + $itemfields['pics'][] = array('big' => $prefix.$pic['attachment'], 'thumb' => $thumb, 'attachment' => 'forum/'.$pic['attachment'], 'first' => 0); + } + } + if(empty($itemfields['pics'][0])) { + unset($itemfields['pics'][0]); + } + } elseif($_GET['idtype'] == 'aids') { + $prefix .= 'portal/'; + foreach(C::t('portal_attachment')->fetch_all_by_aid($_GET['id']) as $pic) { + if($first) { + $first = false; + $itemfields['pics'][0] = ''; + if(strpos($itemfields['oldpic'], 'nophoto.gif') !== false) { + $itemfields['oldpic'] = 'portal/'.$pic['attachment']; + } + } + $thumb = $prefix.($pic['thumb'] ? getimgthumbname($pic['attachment']) : $pic['attachment']); + if('portal/'.$pic['attachment'] == $itemfields['oldpic']) { + $itemfields['pics'][0] = array('big' => $prefix.$pic['attachment'], 'thumb' => $thumb, 'attachment' => 'portal/'.$pic['attachment'], 'first' => 1); + } else { + $itemfields['pics'][] = array('big' => $prefix.$pic['attachment'], 'thumb' => $thumb, 'attachment' => 'portal/'.$pic['attachment'], 'first' => 0); + } + } + if(empty($itemfields['pics'][0])) { + unset($itemfields['pics'][0]); + } + } elseif($_GET['idtype'] == 'blogids') { + $itemfields['pics'][] = array('big' => $itemfields['pic'], 'thumb' => 1, 'attachment' => $itemfields['oldpic']); + } + + } + +} elseif ($op == 'getblock') { + + if(!$bid || (!$allowmanage && !$allowdata)) { + showmessage('block_edit_nopermission'); + } + + block_get_batch($bid); + if(!empty($_GET['forceupdate'])) block_updatecache($bid, !empty($_GET['forceupdate'])); + if(strexists($block['summary'], 'getstr($_POST['classname'], 100, 0, 0, 0, -1)); + C::t('common_block')->update($bid, $setarr); + } + C::t('common_block')->clear_blockcache($bid); + + showmessage('do_success'); +} elseif ($op == 'saveblocktitle') { + + if(!$bid || !$allowmanage) { + showmessage('block_edit_nopermission'); + } + + if (submitcheck('savetitlesubmit')) { + $_POST['title'] = preg_replace('/\/is', '', $_POST['title']); + $title = $_POST['title']; + $title = preg_replace('/url\([\'"](.*?)[\'"]\)/','url($1)',$title); + + $_G['siteurl'] = str_replace(array('/','.'),array('\/','\.'),$_G['siteurl']); + $title = preg_replace('/\"'.$_G['siteurl'].'(.*?)\"/','"$1"',$title); + + $setarr = array('title'=>$title); + C::t('common_block')->update($bid, $setarr); + } + + C::t('common_block')->clear_blockcache($bid); + + showmessage('do_success'); +} elseif ($op == 'convert') { + + if(!$bid || !$allowmanage) { + showmessage('block_edit_nopermission'); + } + block_convert($bid, $_GET['toblockclass']); +} elseif ($op == 'favorite') { + $perm = getblockperm($bid); + if(!$perm['allowmanage'] && !$perm['allowrecommend']) { + showmessage('block_no_right_recommend'); + } + $favoriteop = ''; + if(!block_check_favorite($_G['uid'], $bid)) { + $setarr = array( + 'uid' => $_G['uid'], + 'bid' => $bid, + ); + block_add_favorite($setarr); + $favoriteop = 'add'; + } else { + block_delete_favorite($_G['uid'], $bid); + $favoriteop = 'del'; + } +} elseif($op == 'delrecommend') { + $perm = getblockperm($bid); + if(!$perm['allowmanage'] && !$perm['allowrecommend']) { + showmessage('block_no_right_recommend'); + } + if(($_GET['dataid'] = dintval($_GET['dataid']))) { + C::t('common_block_item_data')->delete($_GET['dataid']); + block_updatecache($bid, true); + } + showmessage('do_success'); +} elseif($op == 'moreurl') { + if(!$bid || !$allowmanage) { + showmessage('block_edit_nopermission'); + } + + if(submitcheck('moreurlsubmit')) { + $arr = array( + 'perpage' => max(1, intval($_POST['perpage'])), + 'seotitle' => $_POST['seotitle'], + 'seokeywords' => $_POST['seokeywords'], + 'seodescription' => $_POST['seodescription'], + ); + $block['param']['moreurl'] = $arr; + C::t('common_block')->update($bid, array('param' => serialize($block['param']))); + + showmessage('do_success', 'portal.php?mod=portalcp&ac=block&op=moreurl&bid='.$bid, array('bid'=>$bid)); + } + $block['param']['moreurl'] = !empty($block['param']['moreurl']) ? $block['param']['moreurl'] : + array('perpage' => 20, 'seotitle' => $block['name'], 'keywords' => '', 'description' => ''); +} + +include_once template("portal/portalcp_block"); + +function block_checkdefault($block) { + if(empty($block['shownum'])) { + $block['shownum'] = 10; + } + if(!isset($block['cachetime'])) { + $block['cachetime'] = '3600'; + } + if(empty($block['picwidth'])) { + $block['picwidth'] = "200"; + } + if(empty($block['picheight'])) { + $block['picheight'] = "200"; + } + if(empty($block['target'])) { + $block['target'] = "blank"; + } + return $block; +} + +function block_getdateformats($format='') { + $formats = array('Y-m-d', 'm-d', 'H:i', 'Y-m-d H:i'); + $return = array(); + foreach($formats as $value) { + $return[] = array( + 'format' => $value, + 'selected' => $format==$value ? ' selected="selected"' : '', + 'time' => dgmdate(TIMESTAMP, $value) + ); + } + return $return; +} + +function block_ban_item($block, $item) { + global $_G; + $parameters = !empty($block['param']) ? $block['param'] : array(); + $bannedids = !empty($parameters['bannedids']) ? explode(',', $parameters['bannedids']) : array(); + $bannedids[] = intval($item['id']); + $bannedids = array_unique($bannedids); + $parameters['bannedids'] = implode(',', $bannedids); + $_G['block'][$block['bid']]['param'] = $parameters; + $parameters = serialize($parameters); + C::t('common_block')->update($block['bid'], array('param'=>$parameters)); +} + +function get_push_item($block, $blockstyle, $id, $idtype, $blockclass = '', $script = '') { + $item = array(); + $obj = null; + if(empty($blockclass) || empty($script)) { + if($idtype == 'tids') { + $obj = block_script('forum', 'thread'); + } elseif($idtype == 'gtids') { + $obj = block_script('group', 'groupthread'); + } elseif($idtype == 'aids') { + $obj = block_script('portal', 'article'); + } elseif($idtype == 'picids') { + $obj = block_script('space', 'pic'); + } elseif($idtype == 'blogids') { + $obj = block_script('space', 'blog'); + } + } else { + list($blockclass) = explode('_', $blockclass); + $obj = block_script($blockclass, $script); + } + if($obj && is_object($obj)) { + $paramter = array($idtype => intval($id)); + if(isset($block['param']['picrequired'])) { + $paramter['picrequired'] = $block['param']['picrequired']; + } + $return = $obj->getData($blockstyle, $paramter); + if($return['data']) { + $item = array_shift($return['data']); + } + } + return $item; +} + +function block_convert($bid, $toblockclass) { + global $_G; + $bid = intval($bid); + if(empty($bid) || empty($toblockclass)) return false; + if(($block = C::t('common_block')->fetch($bid))) { + loadcache('blockconvert'); + $fromblockclass = $block['blockclass']; + list($bigclass) = explode('_', $fromblockclass); + $convertrule = null; + if(!empty($_G['cache']['blockconvert']) && !empty($_G['cache']['blockconvert'][$bigclass][$fromblockclass][$toblockclass])) { + $convertrule = $_G['cache']['blockconvert'][$bigclass][$fromblockclass][$toblockclass]; + } + if(!empty($convertrule)) { + $blockstyle = array(); + if($block['styleid']) { + if(($blockstyle = C::t('common_block_style')->fetch(intval($block['styleid'])))) { + unset($blockstyle['styleid']); + $blockstyle['fields'] = dunserialize($blockstyle['fields']); + $blockstyle['template'] = dunserialize($blockstyle['template']); + } + } elseif($block['blockstyle']) { + $blockstyle = dunserialize($block['blockstyle']); + } + + if($blockstyle) { + $blockstyle['name'] = ''; + $blockstyle['blockclass'] = $toblockclass; + foreach($blockstyle['fields'] as $key => $value) { + $blockstyle['fields'][$key] = str_replace($convertrule['searchkeys'], $convertrule['replacekeys'], $value); + } + + $fun = function(&$v) { + $v = "{".$v."}"; + }; + array_walk($convertrule['searchkeys'], $fun); + array_walk($convertrule['replacekeys'], $fun); + + foreach($blockstyle['template'] as $key => $value) { + $blockstyle['template'][$key] = str_replace($convertrule['searchkeys'], $convertrule['replacekeys'], $value); + } + unset($block['bid']); + $block['styleid'] = '0'; + $block['script'] = $convertrule['script']; + $block['blockclass'] = $toblockclass; + $block['blockstyle'] = serialize($blockstyle); + $block['param'] = serialize($block['param']); + C::t('common_block')->update($bid, $block); + } + } + + } +} + +function block_check_favorite($uid, $bid){ + $uid = intval($uid); + $bid = intval($bid); + if($uid && $bid) { + return C::t('common_block_favorite')->count_by_uid_bid($uid, $bid); + } else { + return false; + } +} + +function block_add_favorite($setarr){ + $arr = array( + 'uid' => intval($setarr['uid']), + 'bid' => intval($setarr['bid']), + 'dateline' => TIMESTAMP + ); + return C::t('common_block_favorite')->insert($arr, true); +} + +function block_delete_favorite($uid, $bid){ + $uid = intval($uid); + $bid = intval($bid); + if($uid && $bid) { + return C::t('common_block_favorite')->delete_by_uid_bid($uid, $bid); + } else { + return false; + } + +} + +function block_ckeck_summary($summary){ + if($summary) { + $tags = array('div', 'table', 'tbody', 'tr', 'td', 'th'); + foreach($tags as $tag) { + preg_match_all('/(<'.$tag.')|(<\/'.$tag.'>)/i', $summary, $all); + if(!empty($all[1]) && !empty($all[2])) { + $all[1] = array_filter($all[1]); + $all[2] = array_filter($all[2]); + if(count($all[1]) !== count($all[2])) { + return $tag; + } + } + } + } + return $summary; +} +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_category.php b/source/include/portalcp/portalcp_category.php new file mode 100644 index 0000000..80e8d1e --- /dev/null +++ b/source/include/portalcp/portalcp_category.php @@ -0,0 +1,111 @@ +fetch_all_by_sql($wheresql, '', 0, 0, 1); +if($count) { + + $query = C::t('portal_article_title')->fetch_all_by_sql($wheresql, 'ORDER BY dateline DESC', $start, $perpage); + foreach($query as $value) { + if($value['pic']) $value['pic'] = pic_get($value['pic'], 'portal', $value['thumb'], $value['remote']); + $value['dateline'] = dgmdate($value['dateline']); + $value['allowmanage'] = ($allowmanage || !empty($permission[$value['catid']]['allowmanage'])) ? true : false; + $value['allowpublish'] = ($value['allowmanage'] || $allowpost || !empty($permission[$value['catid']]['allowpublish'])) ? true : false; + $value['taghtml'] = ''; + $tags = article_parse_tags($value['tag']); + foreach($tags as $k=>$v) { + if($v) { + $value['taghtml'] .= "[{$article_tags[$k]}] "; + } + } + $style = array(); + if($value['highlight']) { + $style = explode('|', $value['highlight']); + $value['highlight'] = ' style="'; + $value['highlight'] .= $style[0] ? 'color: '.$style[0].';' : ''; + $value['highlight'] .= $style[1] ? 'font-weight: bold;' : ''; + $value['highlight'] .= $style[2] ? 'font-style: italic;' : ''; + $value['highlight'] .= $style[3] ? 'text-decoration: underline;' : ''; + $value['highlight'] .= '"'; + } + $list[] = $value; + } + + $multi = multi($count, $perpage, $page, $theurl); + $categoryselect = category_showselect('portal', 'catid', false, $catid); +} + +include_once template("portal/portalcp_category"); + + +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_comment.php b/source/include/portalcp/portalcp_comment.php new file mode 100644 index 0000000..2ffff36 --- /dev/null +++ b/source/include/portalcp/portalcp_comment.php @@ -0,0 +1,134 @@ +fetch($cid); +} +if($_GET['op'] == 'requote') { + + $aid = $_GET['aid']; + $article = C::t('portal_article_title')->fetch($aid); + + if($article['idtype'] == 'tid') { + $comment = C::t('forum_post')->fetch_post('tid:'.$article['id'], $cid); + $comment['uid'] = $comment['authorid']; + $comment['username'] = $comment['author']; + } elseif($article['idtype'] == 'blogid') { + $comment = C::t('home_comment')->fetch_comment($cid); + $comment['uid'] = $comment['authorid']; + $comment['username'] = $comment['author']; + } else { + $comment = C::t('portal_comment')->fetch($cid); + } + unset($aid, $article); + + if(!empty($comment['message'])) { + + include_once libfile('class/bbcode'); + $bbcode = & bbcode::instance(); + $comment['message'] = $bbcode->html2bbcode($comment['message']); + $comment['message'] = preg_replace("/\[quote\].*?\[\/quote\]/is", '', $comment['message']); + $comment['message'] = getstr($comment['message'], 150, 0, 0, 2, -1); + } + +} elseif($_GET['op'] == 'edit') { + + if(empty($comment)) { + showmessage('comment_edit_noexist'); + } + + if((!$_G['group']['allowmanagearticle'] && $_G['uid'] != $comment['uid'] && $_G['adminid'] != 1 && $_GET['modarticlecommentkey'] != modauthkey($comment['cid'])) || $_G['groupid'] == '7') { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } + + if(submitcheck('editsubmit')) { + $message = getstr($_POST['message'], 0, 0, 0, 2); + if(strlen($message) < 2) showmessage('content_is_too_short'); + $message = censor($message, NULL, FALSE, FALSE); + if(censormod($message) || $_G['group']['allowcommentarticlemod']) { + $comment_status = 1; + } else { + $comment_status = 0; + } + + C::t('portal_comment')->update($comment['cid'], array('message' => $message, 'status' => $comment_status, 'postip' => $_G['clientip'], 'port' => $_G['remoteport'])); + + showmessage('do_success', dreferer()); + } + + include_once libfile('class/bbcode'); + $bbcode = & bbcode::instance(); + $comment['message'] = $bbcode->html2bbcode($comment['message']); + +} elseif($_GET['op'] == 'delete') { + + if(empty($comment)) { + showmessage('comment_delete_noexist'); + } + + if(!$_G['group']['allowmanagearticle'] && $_G['uid'] != $comment['uid']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } + + if(submitcheck('deletesubmit')) { + C::t('portal_comment')->delete($cid); + $idtype = in_array($comment['idtype'], array('aid' ,'topicid')) ? $comment['idtype'] : 'aid'; + $tablename = $idtype == 'aid' ? 'portal_article_count' : 'portal_topic'; + C::t($tablename)->increase($comment['id'], array('commentnum' => -1)); + showmessage('do_success', dreferer()); + } + +} +list($seccodecheck, $secqaacheck) = seccheck('publish'); + +if(submitcheck('commentsubmit', 0, $seccodecheck, $secqaacheck)) { + + if(!checkperm('allowcommentarticle')) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } + + $id = 0; + $idtype = ''; + if(!empty($_POST['aid'])) { + $id = intval($_POST['aid']); + $idtype = 'aid'; + } elseif(!empty($_POST['topicid'])) { + $id = intval($_POST['topicid']); + $idtype = 'topicid'; + } + + + $message = $_POST['message']; + + require_once libfile('function/spacecp'); + + cknewuser(); + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + + $retmessage = addportalarticlecomment($id, $message, $idtype); + if($retmessage == 'do_success') { + showmessage('do_success', $_POST['referer'] ? $_POST['referer'] : "portal.php?mod=comment&id=$id&idtype=$idtype"); + } else { + showmessage($retmessage, dreferer("portal.php?mod=comment&id=$id&idtype=$idtype")); + } +} + +include_once template("portal/portalcp_comment"); + +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_diy.php b/source/include/portalcp/portalcp_diy.php new file mode 100644 index 0000000..6dd7bd8 --- /dev/null +++ b/source/include/portalcp/portalcp_diy.php @@ -0,0 +1,478 @@ +fetch($topicid); + if(empty($topic)) { + topic_upload_error('diy_topic_noexist'); + } + } + topic_checkperm($topic); + + $upload = new discuz_upload(); + + $upload->init($_FILES['attach'], 'portal'); + $attach = $upload->attach; + + if(!$upload->error()) { + $upload->save(); + } + if($upload->error()) { + topic_upload_error($attach, $upload->error()); + } else { + if($attach['isimage']) { + require_once libfile('class/image'); + $image = new image(); + $attach['thumb'] = $image->Thumb($attach['target'], '', '80', '50'); + } + + if(ftpperm($attach['ext'], $attach['size'])) { + if(ftpcmd('upload', 'portal/'.$attach['attachment'])) { + if($attach['thumb']) { + ftpcmd('upload', 'portal/'.getimgthumbname($attach['attachment'])); + } + $attach['remote'] = 1; + } else { + if(getglobal('setting/ftp/mirror')) { + @unlink($attach['target']); + @unlink(getimgthumbname($attach['target'])); + topic_upload_error($attach, 'diy_remote_upload_failed'); + } + } + } + + $setarr = array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'filename' => $attach['name'], + 'filepath' => $attach['attachment'], + 'size' => $attach['size'], + 'thumb' => $attach['thumb'], + 'remote' => $attach['remote'], + 'dateline' => $_G['timestamp'], + 'topicid' => $topicid + ); + $setarr['picid'] = C::t('portal_topic_pic')->insert($setarr, true); + + topic_upload_show($topicid); + } + +} elseif (submitcheck('diysubmit')) { + + require_once libfile('function/portalcp'); + + $tpldirectory = getstr($_POST['tpldirectory'], 80); + $template = getstr($_POST['template'], 50); + if(dsign($tpldirectory.$template) !== $_POST['diysign']) { + showmessage('diy_sign_invalid'); + } + $tpldirectory = ($tpldirectory) ? $tpldirectory : $_G['cache']['style_default']['tpldir']; + $savemod = getstr($_POST['savemod'], 1); + $recover = getstr($_POST['recover'], 1); + $optype = getstr($_POST['optype'],10); + + tpl_checkperm($template); + + list($template, $clonefile) = explode(':', $template); + list($mod,$file) = explode('/', $template); + $targettplname = $template; + + if ($savemod == '1' && !empty($clonefile)) { + $targettplname = $template.'_'.$clonefile; + } + + $istopic = $iscategory = $isarticle = false; + if($template == 'portal/portal_topic_content') { + $template = gettopictplname($clonefile); + $istopic = true; + } elseif ($template == 'portal/list') { + $template = getportalcategorytplname($clonefile); + $iscategory = true; + } elseif ($template == 'portal/view') { + $template = getportalarticletplname($clonefile, $template); + $isarticle = true; + } + + if(($istopic || $iscategory || $isarticle) && strpos($template, ':') !== false) { + list($tpldirectory, $template) = explode(':', $template); + } + + $checktpl = checkprimaltpl($tpldirectory.':'.$template); + if($checktpl !== true) { + showmessage($checktpl); + } + + if($optype == 'canceldiy') { + @unlink(DISCUZ_ROOT.'./data/diy/'.$tpldirectory.'/'.$targettplname.'_diy_preview.htm'); + if($targettplname == $template) @unlink(DISCUZ_ROOT.'./data/diy/'.$tpldirectory.'/'.$targettplname.'_'.$clonefile.'_diy_preview.htm'); + showmessage('do_success'); + } + + if ($recover == '1') { + $file = './data/diy/'.$tpldirectory.'/'.$targettplname.'.htm'; + if (is_file($file.'.bak')) { + copy ($file.'.bak', $file); + } else { + showmessage('diy_backup_noexist'); + } + } else { + $templatedata = array(); + checksecurity($_POST['spacecss']); + $templatedata['spacecss'] = preg_replace("/(\<|\>)/is", '', $_POST['spacecss']); + $style = empty($_POST['style'])?'':preg_replace("/[^0-9a-z]/i", '', $_POST['style']); + if($style) { + $cssfile = DISCUZ_ROOT.'./static/topic/'.$style.'/style.css'; + if(!file_exists($cssfile)) { + showmessage('theme_does_not_exist'); + } else { + $templatedata['style'] = "static/topic/$style/style.css"; + } + } + + $layoutdata = getstr($_POST['layoutdata'],0,0,0,0,1); + require_once libfile('class/xml'); + $templatedata['layoutdata'] = xml2array($layoutdata); + if (empty($templatedata['layoutdata'])) showmessage('diy_data_format_invalid'); + + $r = save_diy_data($tpldirectory, $template, $targettplname, $templatedata, true, $optype); + + include_once libfile('function/cache'); + updatecache('diytemplatename'); + + if ($r && $optype != 'savecache') { + if (!$iscategory && !$istopic && empty($savemod) && !empty($clonefile)) { + $delfile = DISCUZ_ROOT.'./data/diy/'.$tpldirectory.'/'.$template.'_'.$clonefile.'.htm'; + if (file_exists($delfile)) { + unlink($delfile); + @unlink($delfile.'.bak'); + C::t('common_template_block')->delete_by_targettplname("{$template}_{$clonefile}", $tpldirectory); + C::t('common_diy_data')->delete("{$template}_{$clonefile}", $tpldirectory); + include_once libfile('function/cache'); + updatecache('diytemplatename'); + } + } + } + } + + $tourl = empty($_POST['gobackurl']) || strpos($_POST['gobackurl'],'op=add') != false || strpos($_POST['gobackurl'],'&diy=yes') != false ? + str_replace('&diy=yes','',$_SERVER['HTTP_REFERER']) : $_POST['gobackurl']; + + $tourl = preg_replace('/[\?|&]preview=yes/', '', $tourl); + + showmessage('do_success', $tourl,array('rejs'=>$_POST['rejs'])); +} +if($op == 'blockclass') { + + loadcache('blockclass'); +} elseif($op == 'style') { + + if(!$_G['group']['allowmanagetopic'] && !$_G['group']['allowdiy'] && !$_G['group']['allowaddtopic']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } + + $themes = gettheme('topic'); + +} elseif ($op == 'diy' || $op == 'image') { + + $topicid = intval($_GET['topicid']); + $topic = C::t('portal_topic')->fetch($topicid); + topic_checkperm($topic); + + $perpage = 6; + $page = max(1, intval($_GET['page'])); + $start= ($page-1) * $perpage; + + $list = array(); + if ($topicid) { + $count = C::t('portal_topic_pic')->count_by_topicid($topicid); + if (!empty($count)) { + foreach(C::t('portal_topic_pic')->fetch_all_by_topicid($topicid, $start, $perpage) as $value) { + $value['pic'] = pic_get($value['filepath'], 'portal', $value['thumb'], $value['remote']); + $list[] = $value; + } + } + $multi= multi($count, $perpage, $page, "portal.php?mod=portalcp&ac=diy&op=image&topicid=$topicid"); + } + + +} elseif ($op == 'delete') { + + $topicid = intval($_GET['topicid']); + $topic = C::t('portal_topic')->fetch($topicid); + topic_checkperm($topic); + + $picid = intval($_GET['picid']); + +} elseif ($op == 'export') { + if (submitcheck('exportsubmit')) { + $tpl = $_POST['tpl']; + $tpldirectory = $_POST['tpldirectory']; + $frame = $_POST['frame']; + $type = $_POST['type']; + if (!empty($tpl)) { + tpl_checkperm($tpl); + + list($tpl,$id) = explode(':', $tpl); + $tplname = $id ? $tpl.'_'.$id : $tpl; + $diydata = C::t('common_diy_data')->fetch_diy($tplname, $tpldirectory); + if(empty($diydata) && $id) $diydata = C::t('common_diy_data')->fetch_diy($tpl, $tpldirectory); + if ($diydata) { + + $filename = $diydata['targettplname']; + + $diycontent = dunserialize($diydata['diycontent']); + + if (empty($diycontent)) showmessage('diy_no_export_data'); + if ($frame) { + $area = ''; + $filename = $frame; + $framedata = array(); + foreach ($diycontent['layoutdata'] as $key => $value) { + $framedata = getobjbyname($frame, $value); + if ($framedata) { + $area = $key; + getframeblock(array($framedata['type'].'`'.$frame => $framedata['content'])); + break; + } + } + } else { + foreach ($diycontent['layoutdata'] as $key => $value) { + if (!empty($value)) getframeblock($value); + } + } + + $diycontent['blockdata'] = block_export($_G['curtplbid']); + + if ($frame) { + $diycontent['spacecss'] = getcssdata($diycontent['spacecss']); + $diycontent['layoutdata'] = array(); + $area = empty($area) ? 'diy1' : $area; + $diycontent['layoutdata'][$area][$framedata['type'].'`'.$frame] = $framedata['content'] ? $framedata['content'] : array(); + } + + dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); + dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + dheader('Cache-Control: no-cache, must-revalidate'); + dheader('Pragma: no-cache'); + dheader('Content-Encoding: none'); + + if ($type == 'txt') { + $str = serialize($diycontent); + dheader('Content-Length: '.strlen($str)); + dheader('Content-Disposition: attachment; filename='.$filename.'.txt'); + dheader('Content-Type: text/plain'); + } else { + require_once libfile('class/xml'); + $str = array2xml($diycontent, true); + dheader('Content-Length: '.strlen($str)); + dheader('Content-Disposition: attachment; filename='.$filename.'.xml'); + dheader('Content-Type: text/xml'); + } + echo $str; + exit(); + } else { + showmessage('diy_export_no_data','/'); + } + } else { + showmessage('diy_export_tpl_invalid','/'); + } + } + showmessage('diy_operation_invalid','/'); +} elseif ($op == 'import') { + + $tpl = $_POST['tpl'] ? $_POST['tpl'] : $_GET['tpl']; + tpl_checkperm($tpl); + $tpldir = './template/default/portal/diyxml/'; + if ($_G['style']['tpldir'] && preg_match("#^\./template/\w+$#i", $_G['style']['tpldir']) && is_dir(DISCUZ_ROOT.$_G['style']['tpldir'].'/portal/diyxml/')) { + $tpldir = $_G['style']['tpldir'].'/portal/diyxml/'; + } + + if (submitcheck('importsubmit')) { + $isinner = false; + $filename = ''; + if($_POST['importfilename']) { + if (!preg_match("/^\w+$/i", $_POST['importfilename'])) { + showmessage('do_success','portal.php',array('status'=>0)); + } + $filename = DISCUZ_ROOT.$tpldir.$_POST['importfilename'].'.xml'; + if(!file_exists($filename)) { + $filename = DISCUZ_ROOT.$tpldir.$_POST['importfilename'].'.php'; + } + $isinner = true; + } else { + $upload = new discuz_upload(); + + $upload->init($_FILES['importfile'], 'temp'); + $attach = $upload->attach; + + if(!$upload->error()) { + $upload->save(); + } + if($upload->error()) { + showmessage($upload->error(),'portal.php',array('status'=>$upload->error())); + } else { + $filename = $attach['target']; + } + } + if($filename && file_exists($filename)) { + $arr = import_diy($filename); + if(!$isinner) { + @unlink($filename); + } + if (!empty($arr)) { + $search = array('/\'; + exit(); +} + +function topic_upload_show($topicid) { + + echo ''; + exit(); +} + +function tpl_checkperm($tpl) { + global $_G; + list($file,$id) = explode(':', $tpl); + if ($file == 'portal/portal_topic_content') { + $topicid = max(0,intval($id)); + $topic = C::t('portal_topic')->fetch($topicid); + topic_checkperm($topic); + } elseif($file == 'portal/list'){ + $catid = max(0,intval($id)); + $category = $_G['cache']['portalcategory'][$catid]; + category_checkperm($category); + } else { + if(!$_G['group']['allowdiy']) { + showmessage('diy_nopermission'); + } + } +} + +function category_checkperm($category) { + global $_G; + if(empty($category)) { + showmessage('topic_not_exist'); + } + + if($_G['group']['allowdiy']) return true; + + if(!$_G['group']['allowdiy'] && (!$_G['group']['allowaddtopic'] || $_G['uid'] != $topic['uid'])) { + showmessage('topic_edit_nopermission'); + } + +} + +function topic_checkperm($topic) { + global $_G; + if(empty($topic)) { + showmessage('topic_not_exist'); + } + if(!$_G['group']['allowmanagetopic'] && (!$_G['group']['allowaddtopic'] || $_G['uid'] != $topic['uid'])) { + showmessage('topic_edit_nopermission'); + } +} + +function gettopictplname($topicid) { + $topicid = max(0,intval($topicid)); + $topic = C::t('portal_topic')->fetch($topicid); + return !empty($topic) && !empty($topic['primaltplname']) ? $topic['primaltplname'] : getglobal('cache/style_default/tpldir').':portal/portal_topic_content'; +} + +function getportalcategorytplname($catid) { + global $_G; + $catid = max(0,intval($catid)); + $category = $_G['cache']['portalcategory'][$catid]; + return !empty($category) && !empty($category['primaltplname']) ? $category['primaltplname'] : getglobal('cache/style_default/tpldir').':portal/list'; +} + +function getportalarticletplname($catid, $primaltplname = ''){ + if(($catid = intval($catid))) { + if(($category = C::t('portal_category')->fetch($catid))) { + $primaltplname = $category['articleprimaltplname']; + } + if(empty($primaltplname)) { + $primaltplname = getglobal('cache/style_default/tpldir').':portal/view'; + C::t('portal_category')->update($catid, array('articleprimaltplname' => $primaltplname)); + } + } + return $primaltplname; +} + +function getdiyxmlname($filename, $path) { + $content = @file_get_contents($path.$filename); + $name = $filename; + if($content) { + preg_match("/\<\!\-\-\[name\](.+?)\[\/name\]\-\-\>/i", trim($content), $mathes); + if(!empty($mathes[1])) { + preg_match("/^\{lang (.+?)\}$/", $mathes[1], $langs); + if(!empty($langs[1])) { + $name = lang('portalcp', $langs[1]); + } else { + $name = dhtmlspecialchars($mathes[1]); + } + } + } + return $name; +} +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_index.php b/source/include/portalcp/portalcp_index.php new file mode 100644 index 0000000..3cf5397 --- /dev/null +++ b/source/include/portalcp/portalcp_index.php @@ -0,0 +1,140 @@ + $value) { + if ($category[$key]['level'] == 0) { + $categorytree .= showcategoryrow($key, 0); + } + } + +} + +include_once template("portal/portalcp_index"); + + +function showcategoryrow($key, $level = 0, $last = '') { + global $category, $permissioncategory, $permission; + + $value = $category[$key]; + $return = ''; + + $op = $addarticle = $artilcemanage = ''; + $value['articles'] = category_get_num('portal', $key); + if (checkperm('allowmanagearticle') || checkperm('allowmanage') || $permission[$key]['allowmanage']) { + $addarticle .= ''.lang('portalcp', 'article_manage').''; + } + if ((checkperm('allowmanagearticle') || checkperm('allowpostarticle') || $permission[$key]['allowmanage'] || $permission[$key]['allowpublish']) && empty($value['disallowpublish'])) { + $artilcemanage .= ''.lang('portalcp', 'article_publish').''; + } + if($addarticle && $artilcemanage) { + $op = $addarticle.'|'.$artilcemanage; + } else { + $op = $addarticle ? $addarticle : $artilcemanage; + } + if($level == 2) { + $class = $last ? 'lastchildcat' : 'childcat'; + $return = ''.$value['articles'].''.$op.''; + } elseif($level == 1) { + $return = '
          '.$value['catname'].''. + ''.$value['articles'].''.$op.''; + $children = checkperm('allowmanagearticle') ? $category[$key]['children'] : $permissioncategory[$key]['permissionchildren']; + $i = 1; + $l = is_array($children) ? count($children) : 0; + foreach($children as $v){ + $return .= showcategoryrow($v, 2 ,$i++ == $l); + } + } else { + $return = ''.$value['articles'].''.$op.''; + $children = checkperm('allowmanagearticle') ? $category[$key]['children'] : $permissioncategory[$key]['permissionchildren']; + foreach($children as $v){ + $return .= showcategoryrow($v, 1); + } + } + return $return; +} + +function showcategoryrowpush($key, $level = 0, $last = '') { + global $_G, $category, $permissioncategory, $permission; + + $value = $category[$key]; + $return = ''; + + $op = ''; + if (checkperm('allowmanagearticle') || checkperm('allowpostarticle') || $permission[$key]['allowpublish'] || $permission[$key]['allowmanage']) { + if(empty($value['disallowpublish'])){ + $value['pushurl'] = ''.$value['catname'].''; + } else { + $value['pushurl'] = $value['catname']; + } + } + + if($level == 2) { + $class = $last ? 'lastchildcat' : 'childcat'; + $return = ' 
          '.$value['pushurl'].'
          '; + } elseif($level == 1) { + $return = ' 
          '.$value['pushurl'].'
          '; + $children = checkperm('allowmanagearticle') ? $category[$key]['children'] : $permissioncategory[$key]['permissionchildren']; + $i = 1; + $l = is_array($children) ? count($children) : 0; + foreach($children as $v) { + $return .= showcategoryrowpush($v, 2, $i++ == $l); + } + } else { + $children = checkperm('allowmanagearticle') ? $category[$key]['children'] : $permissioncategory[$key]['permissionchildren']; + $childrennum = is_array($children) ? count($children) : 0; + $toggle = $childrennum > 25 ? ' style="display:none"' : ''; + $return = ''.($toggle ? '[+]' : '[-]').'' + .'
          '.$value['pushurl'].'
          + '; + foreach($children as $v) { + $return .= showcategoryrowpush($v, 1, ''); + } + $return .= ''; + } + return $return; +} + +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_plugin.php b/source/include/portalcp/portalcp_plugin.php new file mode 100644 index 0000000..55f6f52 --- /dev/null +++ b/source/include/portalcp/portalcp_plugin.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/source/include/portalcp/portalcp_portalblock.php b/source/include/portalcp/portalcp_portalblock.php new file mode 100644 index 0000000..caebbaf --- /dev/null +++ b/source/include/portalcp/portalcp_portalblock.php @@ -0,0 +1,321 @@ +fetch_all_by_uid($_G['uid']) as $bid => $value) { + if($value['allowmanage'] == 1 || ($value['allowrecommend'] == 1 && $value['needverify'] == 0)) { + $bids[$value['bid']] = intval($value['bid']); + } + } + } + + if(!$allowdiy && empty($bids)) { + showmessage('portal_nopermission', dreferer()); + } + + if(submitcheck('getblocklistsubmit')) { + + $updatebids = $_GET['bids']; + $updatebids = array_map('intval', $updatebids); + $updatebids = array_filter($updatebids); + $updatebids = !$allowdiy ? array_intersect($bids, $updatebids) : $updatebids; + if($updatebids) { + C::t('common_block')->update_dateline_to_expired($updatebids, TIMESTAMP); + } + showmessage('portalcp_block_push_the_update_line', dreferer()); + + } else if (submitcheck('verifydatasubmit')) { + + if(!in_array($_POST['optype'], array('pass', 'delete'))) { + showmessage('select_a_option', dreferer()); + } + $ids = $updatebids = array(); + if($_POST['ids']) { + foreach(C::t('common_block_item_data')->fetch_all($_POST['ids']) as $value) { + if($allowdiy || in_array($value['bid'], $bids)) { + $ids[$value['dataid']] = intval($value['dataid']); + $updatebids[$value['bid']] = $value['bid']; + } + } + } + if(empty($ids)) { + showmessage('select_a_moderate_data', dreferer()); + } + + if($_POST['optype']=='pass') { + C::t('common_block_item_data')->update($ids, array('isverified' => '1', 'verifiedtime' => $_G['timestamp'])); + if($updatebids) { + C::t('common_block')->update_dateline_to_expired($updatebids, TIMESTAMP); + } + } elseif($_POST['optype']=='delete') { + C::t('common_block_item_data')->delete($ids); + } + showmessage('operation_done', dreferer()); + + } else if (submitcheck('verifieddatasubmit')) { + + $ids = array(); + if(!empty($_POST['ids'])) { + foreach(C::t('common_block_item_data')->fetch_all($_POST['ids']) as $value) { + if($allowdiy || in_array($value['bid'], $bids)) { + $ids[$value['dataid']] = intval($value['dataid']); + } + } + } + if($ids) { + C::t('common_block_item_data')->delete($ids); + } + + $displayorder = array_map('intval', $_POST['displayorder']); + foreach($displayorder as $dataid => $displayorder) { + if($displayorder !== intval($_POST['olddisplayorder'][$dataid])) { + C::t('common_block_item_data')->update($dataid, array('displayorder' => $displayorder)); + } + } + showmessage('do_success', dreferer()); + } +} else { + + $perpage = $op == 'recommend' ? 16 : 30; + $page = max(1,intval($_GET['page'])); + $start = ($page-1)*$perpage; + if($start<0) $start = 0; + $theurl = 'portal.php?mod=portalcp&ac=portalblock&op='.$op.'&idtype='.$_GET['idtype'].'&id='.$_GET['id']; + $showfavorite = $page == 1 ? true : false; + + $multi = $fields = $leftjoin = ''; + $blockfavorite = block_get_favorite($_G['uid']); + if($allowdiy) { + $tpls = $_G['cache']['diytemplatename']; + } else { + $tplpermissions = getallowdiytemplate($_G['uid']); + foreach($tplpermissions as $value) { + if($value['allowmanage'] || ($value['allowrecommend'] && empty($value['needverify'])) || ($op=='recommend' && $value['allowrecommend'])) { + $tpls[$value['targettplname']] = isset($_G['cache']['diytemplatename'][$value['targettplname']]) ? $_G['cache']['diytemplatename'][$value['targettplname']] : $value['targettplname']; + } + } + $fields = ',bp.allowmanage,bp.allowrecommend,bp.needverify'; + $leftjoin = ' LEFT JOIN '.DB::table('common_block_permission').' bp ON b.bid=bp.bid'; + $wherearr[] = "bp.uid='{$_G['uid']}'"; + $wherearr[] = "(bp.allowmanage='1' OR (bp.allowrecommend='1'".($op == 'recommend' ? '' : "AND bp.needverify='0'")."))"; + } + + $hasinblocks = array(); + if($op == 'recommend' && in_array($_GET['idtype'], array('tid', 'gtid', 'blogid', 'picid', 'aid'), true) && ($_GET['id'] = dintval($_GET['id']))) { + $hasinblocks = C::t('common_block')->fetch_all_recommended_block($_GET['id'], $_GET['idtype'], $wherearr, $leftjoin, $fields); + } + + if($_GET['searchkey']) { + $_GET['searchkey'] = trim($_GET['searchkey']); + $showfavorite = false; + if (preg_match('/^[#]?(\d+)$/', $_GET['searchkey'],$match)) { + $bid = intval($match[1]); + $wherearr[] = " (b.bid='$bid' OR b.name='$bid')"; + } else { + $wherearr[] = " b.name LIKE '%".stripsearchkey($_GET['searchkey'])."%'"; + $perpage = 10000; + } + $_GET['searchkey'] = dhtmlspecialchars($_GET['searchkey']); + $theurl .= '&searchkey='.$_GET['searchkey']; + } + if($_GET['targettplname']) { + $showfavorite = false; + $targettplname = trim($_GET['targettplname']); + $pagebids = array_keys(C::t('common_template_block')->fetch_all_by_targettplname($targettplname)); + if(!empty($pagebids)) { + $wherearr[] = "b.bid IN (".dimplode($pagebids).")"; + $perpage = 10000; + } else { + $wherearr[] = "b.bid='0'"; + } + $_GET['targettplname'] = dhtmlspecialchars($_GET['targettplname']); + $theurl .= '&targettplname='.$_GET['targettplname']; + } + + if($op == 'recommend') { + + $rewhere = array(); + switch ($_GET['idtype']) { + case 'tid' : + $rewhere[] = "(blockclass='forum_thread' OR blockclass='forum_activity' OR blockclass='forum_trade')"; + break; + case 'gtid' : + $rewhere[] = "(blockclass='group_thread' OR blockclass='group_activity' OR blockclass='group_trade')"; + break; + case 'blogid' : + $rewhere[] = "blockclass ='space_blog'"; + break; + case 'picid' : + $rewhere[] = "blockclass ='space_pic'"; + break; + case 'aid' : + $rewhere[] = "blockclass ='portal_article'"; + break; + } + $wherearr = array_merge($rewhere, $wherearr); + $where = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; + + if(($count = C::t('common_block')->count_by_where($where, $leftjoin))) { + foreach(C::t('common_block')->fetch_all_by_where($where, $start, $perpage, $leftjoin, $fields) as $value) { + $value = formatblockvalue($value); + if(!$value['favorite'] || !$showfavorite) { + $blocks[$value['bid']] = $value; + } + } + if(!empty($blockfavorite) && $showfavorite) { + $blocks = $blockfavorite + $blocks; + } + $theurl = $_G['inajax'] ? $theurl.'&getdata=yes' : $theurl; + if($_G['inajax']) $_GET['ajaxtarget'] = 'itemeditarea'; + $multi = multi($count, $perpage, $page, $theurl); + } + } else { + $where = empty($wherearr) ? '' : ' WHERE '.implode(' AND ', $wherearr); + if(($count = C::t('common_block')->count_by_where($where, $leftjoin))) { + foreach(C::t('common_block')->fetch_all_by_where($where, $initemdata ? 0 : $start, $initemdata ? 0 : $perpage, $leftjoin, $fields) as $value) { + $value = formatblockvalue($value); + if(!$value['favorite'] || !$showfavorite) { + $blocks[$value['bid']] = $value; + } + } + if(!empty($blockfavorite) && $showfavorite) { + $blocks = $blockfavorite + $blocks; + } + $multi = $initemdata ? '' : multi($count, $perpage, $page, $theurl); + } + } + + if($blocks) { + $losttpls = $alldata = array(); + $bids = array_keys($blocks); + if($bids) { + foreach(C::t('common_template_block')->fetch_all_by_bid($bids) as $value) { + $alldata[] = $value; + if(!isset($_G['cache']['diytemplatename'][$value['targettplname']])) { + $losttpls[$value['targettplname']] = $value['targettplname']; + } + } + + if($losttpls) { + $lostnames = getdiytplnames($losttpls); + foreach($lostnames as $pre => $datas) { + foreach($datas as $id => $name) { + $_G['cache']['diytemplatename'][$pre.$id] = $tpls[$pre.$id] = $name; + } + } + } + + foreach($alldata as $value) { + $diyurl = block_getdiyurl($value['targettplname']); + $diyurl = $diyurl['url']; + $tplname = isset($_G['cache']['diytemplatename'][$value['targettplname']]) ? $_G['cache']['diytemplatename'][$value['targettplname']] : $value['targettplname']; + if(!isset($tpls[$value['targettplname']])) { + $tpls[$value['targettplname']] = $tplname; + } + $blocks[$value['bid']]['page'][$value['targettplname']] = $diyurl ? ''.$tplname.'' : $tplname; + } + } + if($initemdata) { + $isverified = $op === 'verifieddata' ? 1 : 0; + $count = C::t('common_block_item_data')->count_by_bid($bids, $isverified); + $blockdata = $count ? C::t('common_block_item_data')->fetch_all_by_bid($bids, $isverified, $start, $perpage) : array(); + $multi = multi($count, $perpage, $page, $theurl); + } + } +} +include_once template("portal/portalcp_portalblock"); + +function formatblockvalue($value) { + global $blockfavorite; + $value['name'] = empty($value['name']) ? '#'.$value['bid'].'' : $value['name']; + $theclass = block_getclass($value['blockclass']); + $value['blockclassname'] = $theclass['name']; + $value['datasrc'] = $theclass['script'][$value['script']]; + $value['isrecommendable'] = block_isrecommendable($value); + $value['perm'] = formatblockpermissoin($value); + $value['favorite'] = isset($blockfavorite[$value['bid']]) ? true : false; + return $value; +} +function formatblockpermissoin($block) { + static $allowdiy = null; + $allowdiy = isset($allowdiy) ? $allowdiy : checkperm('allowdiy');; + $perm = array('allowproperty' => 0, 'allowdata'=> 0); + $bid = !empty($block) ? $block['bid'] : 0; + if(!empty($bid)) { + if($allowdiy) { + $perm = array('allowproperty' => 1, 'allowdata'=> 1); + } else { + if($block['allowmanage']) { + $perm = array('allowproperty' => 1, 'allowdata'=> 1); + } + if ($block['allowrecommend'] && !$block['needverify']) { + $perm['allowdata'] = 1; + } + } + } + return $perm; +} + +function block_get_favorite($uid){ + static $allowdiy = null; + $allowdiy = isset($allowdiy) ? $allowdiy : checkperm('allowdiy'); + $blockfavorite = $permission = array(); + $uid = intval($uid); + if($uid) { + foreach(C::t('common_block_favorite')->fetch_all_by_uid($uid) as $value) { + $blockfavorite[$value['bid']] = $value['bid']; + } + } + if(!empty($blockfavorite)) { + $blocks = C::t('common_block')->fetch_all($blockfavorite); + if(!$allowdiy) { + $permission = C::t('common_block_permission')->fetch_all_by_uid($uid); + } + foreach($blocks as $bid => $value) { + if(!$allowdiy && $permission[$bid]) { + $value = array_merge($value, $permission[$bid]); + } + $value = formatblockvalue($value); + $value['favorite'] = true; + $blockfavorite[$value['bid']] = $value; + } + $blockfavorite = array_filter($blockfavorite, 'is_array'); + } + return $blockfavorite; +} + +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_related.php b/source/include/portalcp/portalcp_related.php new file mode 100644 index 0000000..b807760 --- /dev/null +++ b/source/include/portalcp/portalcp_related.php @@ -0,0 +1,104 @@ +fetch($manualid); + } +} elseif($op == 'get') { + $id = trim($_GET['id']); + $getidarr = explode(',', $id); + $getidarr = array_map('intval', $getidarr); + $getidarr = array_unique($getidarr); + $getidarr = array_filter($getidarr); + if($getidarr) { + $list = array(); + $query = C::t('portal_article_title')->fetch_all($getidarr); + foreach($query as $value) { + $list[$value['aid']] = $value; + } + foreach($getidarr as $getid) { + if($list[$getid]) { + $articlelist[] = $list[$getid]; + } + } + } +} elseif($op == 'search') { + + $catids = array(); + $searchkey = addslashes(stripsearchkey($_GET['searchkey'])); + $searchcate = intval($_GET['searchcate']); + $catids = category_get_childids('portal', $searchcate); + $catids[] = $searchcate; + if($searchkey) { + $wherearr[] = "title LIKE '%$searchkey%'"; + } + $searchkey = dhtmlspecialchars($searchkey); + if($searchcate) { + $wherearr[] = "catid IN (".dimplode($catids).")"; + } + $wheresql = implode(' AND ', $wherearr); + $count = C::t('portal_article_title')->fetch_all_by_sql($wheresql, '', 0, 0, 1); + if($count) { + $query = C::t('portal_article_title')->fetch_all_by_sql($wheresql, 'ORDER BY dateline DESC', 0, 50); + foreach($query as $value) { + $articlelist[] = $value; + } + } + +} elseif($op == 'add') { + $relatedid = trim($_GET['relatedid']); + $relatedarr = explode(',', $relatedid); + $relatedarr = array_map('intval', $relatedarr); + $relatedarr = array_unique($relatedarr); + $relatedarr = array_filter($relatedarr); + if($relatedarr) { + $query = C::t('portal_article_title')->fetch_all($relatedarr); + $list = array(); + foreach($query as $value) { + $list[$value['aid']] = $value; + } + foreach($relatedarr as $relateid) { + if($list[$relateid]) { + $articlelist[] = $list[$relateid]; + } + } + } + + if($_GET['update'] && $aid) { + addrelatedarticle($aid, $relatedarr); + } +} else { + $count = 0; + $query = C::t('portal_article_title')->range_title(0, 50); + foreach($query as $value) { + $articlelist[] = $value; + $count++; + } +} +$category = category_showselect('portal', 'searchcate', false, $_GET['searchcate']); +include_once template("portal/portalcp_related_article"); +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_topic.php b/source/include/portalcp/portalcp_topic.php new file mode 100644 index 0000000..bcc2d5b --- /dev/null +++ b/source/include/portalcp/portalcp_topic.php @@ -0,0 +1,73 @@ +fetch($topicid); + if(empty($topic)) { + showmessage('topic_not_exist'); + } + if($_G['group']['allowmanagetopic'] || ($_G['group']['allowaddtopic'] && $topic['uid'] == $_G['uid'])) { + $allowmanage = 1; + } + $coverpath = $topic['picflag'] == '0' ? $topic['cover'] : ''; + + if($topic['cover']) { + if($topic['picflag'] == '1') { + $topic['cover'] = $_G['setting']['attachurl'].$topic['cover']; + } elseif ($topic['picflag'] == '2') { + $topic['cover'] = $_G['setting']['ftp']['attachurl'].$topic['cover']; + } + } +} + +if(($topicid && !$allowmanage) || (!$topicid && !$allowadd)) { + showmessage('topic_edit_nopermission', dreferer()); +} + +$tpls = array(); + +foreach($alltemplate = C::t('common_template')->range() as $template) { + if(($dir = dir(DISCUZ_ROOT.$template['directory'].'/portal/'))) { + while(false !== ($file = $dir->read())) { + $file = strtolower($file); + if (fileext($file) == 'htm' && substr($file, 0, 13) == 'portal_topic_') { + $tpls[$template['directory'].':portal/'.str_replace('.htm','',$file)] = getprimaltplname($template['directory'].':portal/'.$file); + } + } + } +} + +if (empty($tpls)) showmessage('topic_has_on_template', dreferer()); + +if(submitcheck('editsubmit')) { + include_once libfile('function/portalcp'); + if(is_numeric($topicid = updatetopic($topic))){ + showmessage('do_success', 'portal.php?mod=topic&topicid='.$topicid); + } else { + showmessage($topicid, dreferer()); + } +} + +include_once template("portal/portalcp_topic"); + + +?> \ No newline at end of file diff --git a/source/include/portalcp/portalcp_upload.php b/source/include/portalcp/portalcp_upload.php new file mode 100644 index 0000000..d7a7a72 --- /dev/null +++ b/source/include/portalcp/portalcp_upload.php @@ -0,0 +1,198 @@ +fetch($aid); + if(!$article) { + portal_upload_error(lang('portalcp', 'article_noexist')); + } + if(check_articleperm($catid, $aid, $article, false, true) !== true) { + portal_upload_error(lang('portalcp', 'article_noallowed')); + } +} else { + if(($return = check_articleperm($catid, $aid, null, false, true)) !== true) { + portal_upload_error(lang('portalcp', $return)); + } +} + +if($operation == 'downremotefile') { + $arrayimageurl = $temp = $imagereplace = array(); + $string = $_GET['content']; + $downremotefile = true; + preg_match_all("/\/ismU", $string, $temp, PREG_SET_ORDER); + if(is_array($temp) && !empty($temp)) { + foreach($temp as $tempvalue) { + $tempvalue[2] = str_replace('\"', '', $tempvalue[2]); + if(strlen($tempvalue[2])){ + $arrayimageurl[] = $tempvalue[2]; + } + } + $arrayimageurl = array_unique($arrayimageurl); + if($arrayimageurl) { + foreach($arrayimageurl as $tempvalue) { + $imageurl = $tempvalue; + $imagereplace['oldimageurl'][] = $imageurl; + $attach['ext'] = $upload->fileext($imageurl); + if(!$upload->is_image_ext($attach['ext'])) { + continue; + } + $content = ''; + if(preg_match('/^(http(s?):\/\/|\.)/i', $imageurl)) { + $content = dfsockopen($imageurl); + } elseif(checkperm('allowdownlocalimg')) { + if(preg_match('/^data\/(.*?)\.thumb\.jpg$/i', $imageurl)) { + $content = file_get_contents(substr($imageurl, 0, strrpos($imageurl, '.')-6)); + } elseif(preg_match('/^data\/(.*?)\.(jpg|jpeg|gif|png)$/i', $imageurl)) { + $content = file_get_contents($imageurl); + } + } + if(empty($content)) continue; + $temp = explode('/', $imageurl); + + $attach['name'] = trim($temp[count($temp)-1]); + $attach['thumb'] = ''; + + $attach['isimage'] = $upload -> is_image_ext($attach['ext']); + $attach['extension'] = $upload -> get_target_extension($attach['ext']); + $attach['attachdir'] = $upload -> get_target_dir('portal'); + $attach['attachment'] = $attach['attachdir'] . $upload->get_target_filename('portal').'.'.$attach['extension']; + $attach['target'] = getglobal('setting/attachdir').'./portal/'.$attach['attachment']; + + if(!@$fp = fopen($attach['target'], 'wb')) { + continue; + } else { + flock($fp, 2); + fwrite($fp, $content); + fclose($fp); + } + + if(!$upload->get_image_info($attach['target'])) { + @unlink($attach['target']); + continue; + } + $attach['size'] = filesize($attach['target']); + $attachs[] = daddslashes($attach); + } + } + } +} else { + + $upload->init($_FILES['attach'], 'portal'); + $attach = $upload->attach; + + if(!$upload->error()) { + $upload->save(); + } + if($upload->error()) { + portal_upload_error($upload->error()); + } + $attachs[] = $attach; +} + +if($attachs) { + + foreach($attachs as $attach) { + if($attach['isimage'] && empty($_G['setting']['portalarticleimgthumbclosed'])) { + require_once libfile('class/image'); + $image = new image(); + $thumbimgwidth = $_G['setting']['portalarticleimgthumbwidth'] ? $_G['setting']['portalarticleimgthumbwidth'] : 300; + $thumbimgheight = $_G['setting']['portalarticleimgthumbheight'] ? $_G['setting']['portalarticleimgthumbheight'] : 300; + $attach['thumb'] = $image->Thumb($attach['target'], '', $thumbimgwidth, $thumbimgheight, 2); + $image->Watermark($attach['target'], '', 'portal'); + } + + if(ftpperm($attach['ext'], $attach['size'])) { + if(ftpcmd('upload', 'portal/'.$attach['attachment']) && (!$attach['thumb'] || ftpcmd('upload', 'portal/'.getimgthumbname($attach['attachment'])))) { + @unlink($_G['setting']['attachdir'].'/portal/'.$attach['attachment']); + @unlink($_G['setting']['attachdir'].'/portal/'.getimgthumbname($attach['attachment'])); + $attach['remote'] = 1; + } else { + if(getglobal('setting/ftp/mirror')) { + @unlink($attach['target']); + @unlink(getimgthumbname($attach['target'])); + portal_upload_error(lang('portalcp', 'upload_remote_failed')); + } + } + } + + $setarr = array( + 'uid' => $_G['uid'], + 'filename' => $attach['name'], + 'attachment' => $attach['attachment'], + 'filesize' => $attach['size'], + 'isimage' => $attach['isimage'], + 'thumb' => $attach['thumb'], + 'remote' => $attach['remote'], + 'filetype' => $attach['extension'], + 'dateline' => $_G['timestamp'], + 'aid' => $aid + ); + $setarr['attachid'] = C::t('portal_attachment')->insert($setarr, true); + if($downremotefile) { + $attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'portal/'; + $imagereplace['newimageurl'][] = $attach['url'].$attach['attachment']; + } + portal_upload_show($setarr); + } + if($downremotefile && $imagereplace) { + $string = preg_replace(array("/\<(script|style|iframe)[^\>]*?\>.*?\<\/(\\1)\>/si", "/\]*?\>/si"), '', $string); + $string = str_replace($imagereplace['oldimageurl'], $imagereplace['newimageurl'], $string); + $string = str_replace("\n", '
          ', $string); + $string = str_replace(array("\r", "\n", "\r\n"), '', addcslashes($string, '/"\\\'')); + print << + var f = parent.window.frames["uchome-ifrHtmlEditor"].window.frames["HtmlEditor"]; + f.document.body.innerHTML = '$string'; + +EOF; + } + exit(); +} + + +function portal_upload_error($msg) { + echo ''; + exit(); +} + +function portal_upload_show($attach) { + global $_G; + + $imagehtml = $filehtml = $coverstr =''; + + if($attach['isimage']) { + $imagehtml = get_uploadcontent($attach, 'portal', 'upload'); + $coverstr = addslashes(serialize(array('pic'=>'portal/'.$attach['attachment'], 'thumb'=>$attach['thumb'], 'remote'=>$attach['remote']))); + } else { + $filehtml = get_uploadcontent($attach, 'portal', 'upload'); + } + + echo ''; + echo ''; + +} + +?> \ No newline at end of file diff --git a/source/include/post/index.htm b/source/include/post/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/post/post_albumphoto.php b/source/include/post/post_albumphoto.php new file mode 100644 index 0000000..0cb1f2a --- /dev/null +++ b/source/include/post/post_albumphoto.php @@ -0,0 +1,37 @@ +fetch_all_by_uid($_G['uid'], false, 0, 0, $aid); +$count = $query[0]['picnum']; +$albuminfo = C::t('home_album')->fetch_album($aid, $_G['uid']); +if(empty($albuminfo)) { + showmessage('to_view_the_photo_does_not_exist'); +} +$query = C::t('home_pic')->fetch_all_by_albumid($aid, $start_limit, $perpage, 0, 0, 1); +foreach($query as $value) { + $value['bigpic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0); + $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']); + $value['count'] = $count; + $value['url'] = (preg_match('/^https?:\/\//is', $value['bigpic']) ? '' : $_G['siteurl']) . $value['bigpic']; + $value['thumburl'] = (preg_match('/^https?:\/\//is', $value['pic']) ? '' : $_G['siteurl']) . $value['pic']; + $photolist[] = $value; +} +$_GET['ajaxtarget'] = 'albumphoto'; +$multi = multi($count, $perpage, $page, "forum.php?mod=post&action=albumphoto&aid=$aid"); +include template('forum/ajax_albumlist'); +exit; \ No newline at end of file diff --git a/source/include/post/post_editpost.php b/source/include/post/post_editpost.php new file mode 100644 index 0000000..3ea16cd --- /dev/null +++ b/source/include/post/post_editpost.php @@ -0,0 +1,530 @@ + $_G['group']['grouptitle']), array('login' => 1)); +} + +if($_G['setting']['magicstatus']) { + $magiclog = C::t('forum_threadmod')->fetch_by_tid_magicid($_G['tid'], 10); + $magicid = $magiclog['magicid']; + $_G['group']['allowanonymous'] = $_G['group']['allowanonymous'] || $magicid ? 1 : $_G['group']['allowanonymous']; +} + +$isorigauthor = $_G['uid'] && $_G['uid'] == $orig['authorid']; +$isanonymous = ($_G['group']['allowanonymous'] || $orig['anonymous']) && getgpc('isanonymous') ? 1 : 0; +$audit = $orig['invisible'] == -2 || $thread['displayorder'] == -2 ? $_GET['audit'] : 0; + +if(empty($orig)) { + showmessage('post_nonexistence'); +} elseif((!$_G['forum']['ismoderator'] || !$_G['group']['alloweditpost'] || (in_array($orig['adminid'], array(1, 2, 3)) && $_G['adminid'] > $orig['adminid'])) && !(($_G['forum']['alloweditpost'] || $orig['invisible'] == -3)&& $isorigauthor)) { + showmessage('post_edit_nopermission', NULL); +} elseif($isorigauthor && !$_G['forum']['ismoderator'] && $orig['invisible'] != -3) { + $alloweditpost_status = getstatus($_G['setting']['alloweditpost'], $special + 1); + if(!$alloweditpost_status && $_G['group']['edittimelimit'] && TIMESTAMP - $orig['dateline'] > $_G['group']['edittimelimit'] * 60) { + showmessage('post_edit_timelimit', NULL, array('edittimelimit' => $_G['group']['edittimelimit'])); + } +} + +$thread['pricedisplay'] = $thread['price'] == -1 ? 0 : $thread['price']; + +if($special == 5) { + $debate = array_merge($thread, daddslashes(C::t('forum_debate')->fetch($_G['tid']))); + $firststand = C::t('forum_debatepost')->get_firststand($_G['tid'], $_G['uid']); + + if(!$isfirstpost && $debate['endtime'] && $debate['endtime'] < TIMESTAMP && !$_G['forum']['ismoderator']) { + showmessage('debate_end'); + } + if($isfirstpost && $debate['umpirepoint'] && !$_G['forum']['ismoderator']) { + showmessage('debate_umpire_comment_invalid'); + } +} + +$rushreply = getstatus($thread['status'], 3); + + +if($isfirstpost && $isorigauthor && $_G['group']['allowreplycredit']) { + if($replycredit_rule = C::t('forum_replycredit')->fetch($_G['tid'])) { + if($thread['replycredit']) { + $replycredit_rule['lasttimes'] = $thread['replycredit'] / $replycredit_rule['extcredits']; + } + $replycredit_rule['extcreditstype'] = $replycredit_rule['extcreditstype'] ? $replycredit_rule['extcreditstype'] : $_G['setting']['creditstransextra'][10]; + } +} + +if(!submitcheck('editsubmit')) { + + $thread['hiddenreplies'] = getstatus($thread['status'], 2); + + + $postinfo = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $pid); + if($postinfo['fid'] != $_G['fid'] || $postinfo['tid'] != $_G['tid']) { + $postinfo = array(); + } + + $usesigcheck = $postinfo['usesig'] ? 'checked="checked"' : ''; + $urloffcheck = $postinfo['parseurloff'] ? 'checked="checked"' : ''; + $smileyoffcheck = $postinfo['smileyoff'] == 1 ? 'checked="checked"' : ''; + $codeoffcheck = $postinfo['bbcodeoff'] == 1 ? 'checked="checked"' : ''; + $tagoffcheck = $postinfo['htmlon'] & 2 ? 'checked="checked"' : ''; + $htmloncheck = $postinfo['htmlon'] & 1 ? 'checked="checked"' : ''; + if(!$isfirstpost) { + $_G['group']['allowimgcontent'] = 0; + } + if($isfirstpost && $imgcontentcheck && $_G['group']['allowimgcontent']) { + $editor['editormode'] = 0; + } + if($htmloncheck) { + $editor['editormode'] = 0; + $editor['allowswitcheditor'] = 1; + } + $showthreadsorts = ($thread['sortid'] || !empty($sortid)) && $isfirstpost; + $sortid = empty($sortid) ? $thread['sortid'] : $sortid; + + $poll = $temppoll = array(); + if($isfirstpost) { + if($postinfo['tags']) { + $tagarray_all = $array_temp = $threadtag_array = array(); + $tagarray_all = explode("\t", $postinfo['tags']); + if($tagarray_all) { + foreach($tagarray_all as $var) { + if($var) { + $array_temp = explode(',', $var); + $threadtag_array[] = $array_temp['1']; + } + } + } + $postinfo['tag'] = implode(',', $threadtag_array); + } + $allownoticeauthor = getstatus($thread['status'], 6); + + if($rushreply) { + $postinfo['rush'] = C::t('forum_threadrush')->fetch($_G['tid']); + if($postinfo['rush']['creditlimit'] == -996) { + $postinfo['rush']['creditlimit'] = ''; + } + $postinfo['rush']['stopfloor'] = $postinfo['rush']['stopfloor'] ? $postinfo['rush']['stopfloor'] : ''; + $postinfo['rush']['starttimefrom'] = $postinfo['rush']['starttimefrom'] ? dgmdate($postinfo['rush']['starttimefrom'], 'Y-m-d H:i') : ''; + $postinfo['rush']['starttimeto'] = $postinfo['rush']['starttimeto'] ? dgmdate($postinfo['rush']['starttimeto'], 'Y-m-d H:i') : ''; + } + + if($special == 127) { + $sppos = strpos($postinfo['message'], chr(0).chr(0).chr(0)); + $specialextra = substr($postinfo['message'], $sppos + 3); + if($specialextra && array_key_exists($specialextra, $_G['setting']['threadplugins']) && in_array($specialextra, $_G['forum']['threadplugin']) && in_array($specialextra, $_G['group']['allowthreadplugin'])) { + $postinfo['message'] = substr($postinfo['message'], 0, $sppos); + } else { + showmessage('post_edit_nopermission_threadplign'); + $special = 0; + $specialextra = ''; + } + } + $thread['freecharge'] = $_G['setting']['maxchargespan'] && TIMESTAMP - $thread['dateline'] >= $_G['setting']['maxchargespan'] * 3600 ? 1 : 0; + $freechargehours = !$thread['freecharge'] ? $_G['setting']['maxchargespan'] - intval((TIMESTAMP - $thread['dateline']) / 3600) : 0; + if($thread['special'] == 1 && ($_G['group']['alloweditpoll'] || $thread['authorid'] == $_G['uid'])) { + $pollinfo = C::t('forum_poll')->fetch($_G['tid']); + if($pollinfo['isimage']) { + $pollimages = C::t('forum_polloption_image')->fetch_all_by_tid($_G['tid']); + require_once libfile('function/home'); + } + $query = C::t('forum_polloption')->fetch_all_by_tid($_G['tid']); + foreach($query as $temppoll) { + $poll['multiple'] = $pollinfo['multiple']; + $poll['visible'] = $pollinfo['visible']; + $poll['maxchoices'] = $pollinfo['maxchoices']; + $poll['expiration'] = $pollinfo['expiration']; + $poll['overt'] = $pollinfo['overt']; + $poll['isimage'] = $pollinfo['isimage']; + $poll['polloptionid'][] = $temppoll['polloptionid']; + $poll['displayorder'][] = $temppoll['displayorder']; + $poll['polloption'][] = $temppoll['polloption']; + $attach = array(); + if($pollinfo['isimage'] && $pollimages[$temppoll['polloptionid']]) { + $attach = $pollimages[$temppoll['polloptionid']]; + $attach['small'] = pic_get($attach['attachment'], 'forum', $attach['thumb'], $attach['remote']); + $attach['big'] = pic_get($attach['attachment'], 'forum', 0, $attach['remote']); + $poll['imginfo'][$temppoll['polloptionid']] = $attach; + } + + } + } elseif($thread['special'] == 3) { + $rewardprice = $thread['price']; + } elseif($thread['special'] == 4) { + $activitytypelist = $_G['setting']['activitytype'] ? explode("\n", trim($_G['setting']['activitytype'])) : ''; + $activity = C::t('forum_activity')->fetch($_G['tid']); + $activity['starttimefrom'] = dgmdate($activity['starttimefrom'], 'Y-m-d H:i'); + $activity['starttimeto'] = $activity['starttimeto'] ? dgmdate($activity['starttimeto'], 'Y-m-d H:i') : ''; + $activity['expiration'] = $activity['expiration'] ? dgmdate($activity['expiration'], 'Y-m-d H:i') : ''; + $activity['ufield'] = $activity['ufield'] ? dunserialize($activity['ufield']) : array(); + if($activity['ufield']['extfield']) { + $activity['ufield']['extfield'] = implode("\n", $activity['ufield']['extfield']); + } + } elseif($thread['special'] == 5 ) { + $debate['endtime'] = $debate['endtime'] ? dgmdate($debate['endtime'], 'Y-m-d H:i') : ''; + } + if ($_G['group']['allowsetpublishdate']) { + loadcache('cronpublish'); + $cron_publish_ids = getglobal('cache/cronpublish'); + if (in_array($_G['tid'], (array)$cron_publish_ids)) { + $cronpublish = 1; + $cronpublishdate = dgmdate($thread['dateline'], "dt"); + } + } + } + + if($thread['special'] == 2 && ($thread['authorid'] == $_G['uid'] && $_G['group']['allowposttrade'] || $_G['group']['allowedittrade'])) { + $trade = C::t('forum_trade')->fetch_goods(0, $pid); + if($trade) { + $trade['expiration'] = $trade['expiration'] ? date('Y-m-d', $trade['expiration']) : ''; + $trade['costprice'] = $trade['costprice'] > 0 ? $trade['costprice'] : ''; + $trade['message'] = dhtmlspecialchars($trade['message']); + $expiration_7days = date('Y-m-d', TIMESTAMP + 86400 * 7); + $expiration_14days = date('Y-m-d', TIMESTAMP + 86400 * 14); + $expiration_month = date('Y-m-d', mktime(0, 0, 0, date('m')+1, date('d'), date('Y'))); + $expiration_3months = date('Y-m-d', mktime(0, 0, 0, date('m')+3, date('d'), date('Y'))); + $expiration_halfyear = date('Y-m-d', mktime(0, 0, 0, date('m')+6, date('d'), date('Y'))); + $expiration_year = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y')+1)); + } else { + $special = 0; + $trade = array(); + } + } + + if($isfirstpost && $specialextra) { + @include_once DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['threadplugins'][$specialextra]['module'].'.class.php'; + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'editpost')) { + $threadplughtml = $threadpluginclass->editpost($_G['fid'], $_G['tid']); + } + } + + $postinfo['subject'] = str_replace('"', '"', $postinfo['subject']); + $postinfo['message'] = dhtmlspecialchars($postinfo['message']); + $selectgroupid = 0; + if($postinfo['first'] == 1) { + preg_match("/(\[groupid=(\d+)\].*\[\/groupid\])/i", $postinfo['message'], $matchs); + if($matchs) { + $postinfo['message'] = str_replace($matchs[1], '', $postinfo['message']); + $selectgroupid = $matchs[2]; + } + + if(helper_access::check_module('group')) { + $mygroups = $groupids = array(); + $groupids = C::t('forum_groupuser')->fetch_all_fid_by_uids($_G['uid']); + array_slice($groupids, 0, 20); + $query = C::t('forum_forum')->fetch_all_info_by_fids($groupids); + foreach($query as $group) { + $mygroups[$group['fid']] = $group['name']; + } + } + } + $language = lang('forum/misc'); + $postinfo['message'] = preg_replace($postinfo['htmlon'] ? $language['post_edithtml_regexp'] : (!$_G['forum']['allowbbcode'] || $postinfo['bbcodeoff'] ? $language['post_editnobbcode_regexp'] : $language['post_edit_regexp']), '', $postinfo['message']); + + if($special == 5) { + $standselected = array($firststand => 'selected="selected"'); + } + + if($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) { + $attachlist = getattach($pid); + $attachs = $attachlist['attachs']; + $imgattachs = $attachlist['imgattachs']; + unset($attachlist); + $attachfind = $attachreplace = array(); + if(!empty($attachs['used'])) { + foreach($attachs['used'] as $attach) { + if($attach['isimage']) { + $attachfind[] = "/\[attach\]{$attach['aid']}\[\/attach\]/i"; + $attachreplace[] = '[attachimg]'.$attach['aid'].'[/attachimg]'; + } + } + } + if(!empty($imgattachs['used'])) { + foreach($imgattachs['used'] as $attach) { + $attachfind[] = "/\[attach\]{$attach['aid']}\[\/attach\]/i"; + $attachreplace[] = '[attachimg]'.$attach['aid'].'[/attachimg]'; + } + } + $attachfind && $postinfo['message'] = preg_replace($attachfind, $attachreplace, $postinfo['message']); + } + if($special == 2 && $trade['aid'] && !empty($imgattachs['used']) && is_array($imgattachs['used'])) { + foreach($imgattachs['used'] as $k => $tradeattach) { + if($tradeattach['aid'] == $trade['aid']) { + unset($imgattachs['used'][$k]); + break; + } + } + } + if($special == 4 && $activity['aid'] && !empty($imgattachs['used']) && is_array($imgattachs['used'])) { + foreach($imgattachs['used'] as $k => $activityattach) { + if($activityattach['aid'] == $activity['aid']) { + unset($imgattachs['used'][$k]); + break; + } + } + } + + if($sortid) { + require_once libfile('post/threadsorts', 'include'); + foreach($_G['forum_optionlist'] as $option) { + if($option['type'] == 'image') { + foreach($imgattachs['used'] as $k => $sortattach) { + if($sortattach['aid'] == $option['value']['aid']) { + unset($imgattachs['used'][$k]); + break; + } + } + } + } + } + + $imgattachs['unused'] = !$sortid ? (isset($imgattachs['unused']) ? $imgattachs['unused'] : '') : ''; + + include template('forum/post'); + +} else { + if($_GET['mygroupid']) { + $mygroupid = explode('__', $_GET['mygroupid']); + $mygid = intval($mygroupid[0]); + if($mygid) { + $mygname = $mygroupid[1]; + if(count($mygroupid) > 2) { + unset($mygroupid[0]); + $mygname = implode('__', $mygroupid); + } + $message .= '[groupid='.intval($mygid).']'.$mygname.'[/groupid]'; + } + } + $modpost = C::m('forum_post', $_G['tid'], $pid); + + $modpost->param('redirecturl', "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_GET['page']}&extra=$extra".($vid && $isfirstpost ? "&vid=$vid" : '')."#pid$pid"); + + if(empty($_GET['delete'])) { + + + if($isfirstpost) { + + + if($thread['special'] == 1 && ($_G['group']['alloweditpoll'] || $isorigauthor) && !empty($_GET['polls'])) { + + } elseif($thread['special'] == 3 && $isorigauthor) { + + + } elseif($thread['special'] == 4 && $_G['group']['allowpostactivity']) { + + + } elseif($thread['special'] == 5 && $_G['group']['allowpostdebate']) { + + + } elseif($specialextra) { + + @include_once DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['threadplugins'][$specialextra]['module'].'.class.php'; + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'editpost_submit')) { + $threadpluginclass->editpost_submit($_G['fid'], $_G['tid']); + } + + } + + + + + + + } else { + + + } + + + + + + + + $feed = array(); + if($isfirstpost && $special == 127) { + $message .= chr(0).chr(0).chr(0).$specialextra; + } + + + if($isfirstpost) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_sort', 'method' => 'before_editpost')); + if($thread['special'] == 3) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_reward', 'method' => 'before_editpost')); + } + if($thread['special'] == 1) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_poll', 'method' => 'before_editpost')); + } + if($thread['special'] == 4 && $_G['group']['allowpostactivity']) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_activity', 'method' => 'before_editpost')); + } + if($thread['special'] == 5 && $_G['group']['allowpostdebate']) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_debate', 'method' => 'before_editpost')); + } + if($_G['group']['allowreplycredit']) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_replycredit', 'method' => 'before_editpost')); + } + if($rushreply) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_rushreply', 'method' => 'before_editpost')); + } + $modpost->attach_after_method('editpost', array('class' => 'extend_thread_follow', 'method' => 'after_editpost')); + } + + if($_G['group']['allowat']) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_allowat', 'method' => 'before_editpost')); + $modpost->attach_after_method('editpost', array('class' => 'extend_thread_allowat', 'method' => 'after_editpost')); + } + + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_image', 'method' => 'before_editpost')); + + if($special == '2' && $_G['group']['allowposttrade']) { + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_trade', 'method' => 'before_editpost')); + } + + $modpost->attach_before_method('editpost', array('class' => 'extend_thread_filter', 'method' => 'before_editpost')); + $modpost->attach_after_method('editpost', array('class' => 'extend_thread_filter', 'method' => 'after_editpost')); + + $param = array( + 'subject' => $subject, + 'message' => $message, + 'special' => $special, + 'sortid' => $sortid, + 'typeid' => $typeid, + 'isanonymous' => $isanonymous, + + 'cronpublish' => $_GET['cronpublish'], + 'cronpublishdate' => $_GET['cronpublishdate'], + 'save' => $_GET['save'], + + 'readperm' => $readperm, + 'price' => $_GET['price'], + + 'ordertype' => $_GET['ordertype'], + 'hiddenreplies' => $_GET['hiddenreplies'], + 'allownoticeauthor' => $_GET['allownoticeauthor'], + + 'audit' => $_GET['audit'], + + 'tags' => $_GET['tags'], + + 'bbcodeoff' => $_GET['bbcodeoff'], + 'smileyoff' => $_GET['smileyoff'], + 'parseurloff' => $_GET['parseurloff'], + 'usesig' => $_GET['usesig'], + 'htmlon' => $_GET['htmlon'], + + 'extramessage' => $extramessage, + ); + + if($_G['group']['allowimgcontent']) { + $param['imgcontent'] = $_GET['imgcontent']; + $param['imgcontentwidth'] = $_G['setting']['imgcontentwidth'] ? intval($_G['setting']['imgcontentwidth']) : 100; + } + if($isfirstpost && $isorigauthor && $_G['group']['allowreplycredit']) { + $param['replycredit_rule'] = $replycredit_rule; + } + + $modpost->editpost($param); + + } else { + + + + + + + + + + + if($thread['special'] == 3) { + $modpost->attach_before_method('deletepost', array('class' => 'extend_thread_reward', 'method' => 'before_deletepost')); + } + if($rushreply) { + $modpost->attach_before_method('deletepost', array('class' => 'extend_thread_rushreply', 'method' => 'before_deletepost')); + } + if($thread['replycredit'] && $isfirstpost) { + $modpost->attach_before_method('deletepost', array('class' => 'extend_thread_replycredit', 'method' => 'before_deletepost')); + } + + $modpost->attach_before_method('deletepost', array('class' => 'extend_thread_image', 'method' => 'before_deletepost')); + + if($thread['special'] == 2) { + $modpost->attach_after_method('deletepost', array('class' => 'extend_thread_trade', 'method' => 'after_deletepost')); + } + if($isfirstpost) { + $modpost->attach_after_method('deletepost', array('class' => 'extend_thread_sort', 'method' => 'after_deletepost')); + } + + $modpost->attach_after_method('deletepost', array('class' => 'extend_thread_filter', 'method' => 'after_deletepost')); + + $param = array( + 'special' => $special, + 'isanonymous' => $isanonymous, + ); + + $modpost->deletepost($param); + } + + if($specialextra) { + + @include_once DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['threadplugins'][$specialextra]['module'].'.class.php'; + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'editpost_submit_end')) { + $threadpluginclass->editpost_submit_end($_G['fid'], $_G['tid']); + } + + } + + if($_G['forum']['threadcaches']) { + deletethreadcaches($_G['tid']); + } + + $param = array('fid' => $_G['fid'], 'tid' => $_G['tid'], 'pid' => $pid); + + dsetcookie('clearUserdata', 'forum'); + + if($_G['forum_auditstatuson']) { + if($audit == 1) { + updatemoderate($isfirstpost ? 'tid' : 'pid', $isfirstpost ? $_G['tid'] : $pid, '2'); + showmessage('auditstatuson_succeed', $modpost->param('redirecturl'), $param); + } else { + updatemoderate($isfirstpost ? 'tid' : 'pid', $isfirstpost ? $_G['tid'] : $pid); + showmessage('audit_edit_succeed', '', $param, array('alert' => 'right')); + } + } else { + if(!empty($_GET['delete']) && $isfirstpost) { + showmessage('post_edit_delete_succeed', "forum.php?mod=forumdisplay&fid={$_G['fid']}", $param); + } elseif(!empty($_GET['delete'])) { + showmessage('post_edit_delete_succeed', "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_GET['page']}&extra=$extra".($vid && $isfirstpost ? "&vid=$vid" : ''), $param); + } else { + if($isfirstpost && $modpost->param('modnewthreads')) { + C::t('forum_post')->update_post($thread['posttableid'], $pid, array('status' => 4), false, false, null, -2, null, 0); + updatemoderate('tid', $_G['tid']); + showmessage('edit_newthread_mod_succeed', $modpost->param('redirecturl'), $param); + } elseif(!$isfirstpost && $modpost->param('modnewreplies')) { + C::t('forum_post')->update_post($thread['posttableid'], $pid, array('status' => 4), false, false, null, -2, null, 0); + updatemoderate('pid', $pid); + showmessage('edit_reply_mod_succeed', "forum.php?mod=forumdisplay&fid={$_G['fid']}", $param); + } else { + showmessage('post_edit_succeed', $modpost->param('redirecturl'), $param); + } + } + } + +} + +?> \ No newline at end of file diff --git a/source/include/post/post_newreply.php b/source/include/post/post_newreply.php new file mode 100644 index 0000000..4382713 --- /dev/null +++ b/source/include/post/post_newreply.php @@ -0,0 +1,464 @@ +fetch($_G['tid']))); + $firststand = C::t('forum_debatepost')->get_firststand($_G['tid'], $_G['uid']); + $stand = $firststand ? $firststand : intval($_GET['stand']); + + if($debate['endtime'] && $debate['endtime'] < TIMESTAMP) { + showmessage('debate_end'); + } +} + +if(!$_G['uid'] && !((!$_G['forum']['replyperm'] && $_G['group']['allowreply']) || ($_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm'])))) { + showmessage('replyperm_login_nopermission', NULL, array(), array('login' => 1)); +} elseif(empty($_G['forum']['allowreply'])) { + if(!$_G['forum']['replyperm'] && !$_G['group']['allowreply']) { + showmessage('replyperm_none_nopermission', NULL, array(), array('login' => 1)); + } elseif($_G['forum']['replyperm'] && !forumperm($_G['forum']['replyperm'])) { + showmessagenoperm('replyperm', $_G['forum']['fid']); + } +} elseif($_G['forum']['allowreply'] == -1) { + showmessage('post_forum_newreply_nopermission', NULL); +} + +if(!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_secmobile'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) { + showmessage('replyperm_login_nopermission', NULL, array(), array('login' => 1)); +} + +if(empty($thread)) { + showmessage('thread_nonexistence'); +} elseif($thread['price'] > 0 && $thread['special'] == 0 && !$_G['uid']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); +} elseif($thread['readperm'] && $thread['readperm'] > $_G['group']['readaccess'] && $thread['authorid'] != $_G['uid']){ //readperm verify, thread poster excluded + showmessagenoperm('replyperm', $_G['forum']['fid']); +} + +checklowerlimit('reply', 0, 1, $_G['forum']['fid']); + +if($_G['setting']['commentnumber'] && !empty($_GET['comment'])) { + if(!submitcheck('commentsubmit', 0, $seccodecheck, $secqaacheck)) { + showmessage('submitcheck_error', NULL); + } + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid']); + if(!$post || !($_G['setting']['commentpostself'] || $post['authorid'] != $_G['uid']) || !(($post['first'] && $_G['setting']['commentfirstpost'] && in_array($_G['group']['allowcommentpost'], array(1, 3)) || (!$post['first'] && in_array($_G['group']['allowcommentpost'], array(2, 3)))))) { + showmessage('postcomment_error'); + } + if($thread['closed'] && !$_G['forum']['ismoderator'] && !$thread['isgroup']) { + showmessage('post_thread_closed'); + } elseif(!$thread['isgroup'] && $post_autoclose = checkautoclose($thread)) { + showmessage($post_autoclose, '', array('autoclose' => $_G['forum']['autoclose'])); + } elseif(checkflood()) { + showmessage('post_flood_ctrl', '', array('floodctrl' => $_G['setting']['floodctrl'])); + } elseif(checkmaxperhour('pid')) { + showmessage('post_flood_ctrl_posts_per_hour', '', array('posts_per_hour' => $_G['group']['maxpostsperhour'])); + } + $commentscore = ''; + if(!empty($_GET['commentitem']) && !empty($_G['uid']) && $post['authorid'] != $_G['uid']) { + foreach($_GET['commentitem'] as $itemk => $itemv) { + if($itemv !== '') { + $commentscore .= strip_tags(trim($itemk)).': '.intval($itemv).' '; + } + } + } + $comment = cutstr(($commentscore ? $commentscore.'
          ' : '').censor(trim(dhtmlspecialchars($_GET['message'])), '***'), 200, ' '); + if(!$comment) { + showmessage('post_sm_isnull'); + } + $pcid = C::t('forum_postcomment')->insert(array( + 'tid' => $post['tid'], + 'pid' => $post['pid'], + 'author' => $_G['username'], + 'authorid' => $_G['uid'], + 'dateline' => TIMESTAMP, + 'comment' => $comment, + 'score' => $commentscore ? 1 : 0, + 'useip' => $_G['clientip'], + 'port'=> $_G['remoteport'] + ), true); + C::t('forum_post')->update_post('tid:'.$_G['tid'], $_GET['pid'], array('comment' => 1)); + + $comments = $thread['comments'] ? $thread['comments'] + 1 : C::t('forum_postcomment')->count_by_tid($_G['tid']); + C::t('forum_thread')->update($_G['tid'], array('comments' => $comments)); + !empty($_G['uid']) && $thread['displayorder'] != -4 && updatepostcredits('+', $_G['uid'], 'reply', $_G['fid']); + if(!empty($_G['uid']) && $_G['uid'] != $post['authorid']) { + notification_add($post['authorid'], 'pcomment', 'comment_add', array( + 'tid' => $_G['tid'], + 'pid' => $_GET['pid'], + 'subject' => $thread['subject'], + 'from_id' => $_G['tid'], + 'from_idtype' => 'pcomment', + 'commentmsg' => cutstr(str_replace(array('[b]', '[/b]', '[/color]'), '', preg_replace("/\[color=([#\w]+?)\]/i", "", $comment)), 200) + )); + } + update_threadpartake($post['tid']); + $pcid = C::t('forum_postcomment')->fetch_standpoint_by_pid($_GET['pid']); + $pcid = $pcid['id']; + if(!empty($_G['uid']) && $_GET['commentitem']) { + $totalcomment = array(); + foreach(C::t('forum_postcomment')->fetch_all_by_pid_score($_GET['pid'], 1) as $comment) { + $comment['comment'] = addslashes($comment['comment']); + if(strexists($comment['comment'], '
          ')) { + if(preg_match_all("/([^:]+?):\s(\d+)<\/i>/", $comment['comment'], $a)) { + foreach($a[1] as $k => $itemk) { + $totalcomment[trim($itemk)][] = $a[2][$k]; + } + } + } + } + $totalv = ''; + foreach($totalcomment as $itemk => $itemv) { + $totalv .= strip_tags(trim($itemk)).': '.(floatval(sprintf('%1.1f', array_sum($itemv) / count($itemv)))).' '; + } + + if($pcid) { + C::t('forum_postcomment')->update($pcid, array('comment' => $totalv, 'dateline' => TIMESTAMP + 1)); + } else { + C::t('forum_postcomment')->insert(array( + 'tid' => $post['tid'], + 'pid' => $post['pid'], + 'author' => '', + 'authorid' => '-1', + 'dateline' => TIMESTAMP + 1, + 'comment' => $totalv + )); + } + } + C::t('forum_postcache')->delete($post['pid']); + showmessage('comment_add_succeed', "forum.php?mod=viewthread&tid={$post['tid']}&pid={$post['pid']}&page={$_GET['page']}&extra=$extra#pid{$post['pid']}", array('tid' => $post['tid'], 'pid' => $post['pid'])); +} + +if($special == 127) { + $postinfo = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid']); + $sppos = strrpos($postinfo['message'], chr(0).chr(0).chr(0)); + $specialextra = substr($postinfo['message'], $sppos + 3); +} +if(getstatus($thread['status'], 3)) { + $rushinfo = C::t('forum_threadrush')->fetch($_G['tid']); + if($rushinfo['creditlimit'] != -996) { + $checkcreditsvalue = $_G['setting']['creditstransextra'][11] ? getuserprofile('extcredits'.$_G['setting']['creditstransextra'][11]) : $_G['member']['credits']; + if($checkcreditsvalue < $rushinfo['creditlimit']) { + $creditlimit_title = $_G['setting']['creditstransextra'][11] ? $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][11]]['title'] : lang('forum/misc', 'credit_total'); + showmessage('post_rushreply_creditlimit', '', array('creditlimit_title' => $creditlimit_title, 'creditlimit' => $rushinfo['creditlimit'])); + } + } + +} + +if(!submitcheck('replysubmit', 0, $seccodecheck, $secqaacheck)) { + + $st_p = $_G['uid'].'|'.TIMESTAMP; + dsetcookie('st_p', $st_p.'|'.md5($st_p.$_G['config']['security']['authkey'])); + + if($thread['special'] == 2 && ((!isset($_GET['addtrade']) || $thread['authorid'] != $_G['uid']) && !$tradenum = C::t('forum_trade')->fetch_counter_thread_goods($_G['tid']))) { + showmessage('trade_newreply_nopermission', NULL); + } + + $language = lang('forum/misc'); + $noticeauthor = $noticetrimstr = ''; + if(isset($_GET['repquote']) && $_GET['repquote'] = intval($_GET['repquote'])) { + $thaquote = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['repquote']); + if(!($thaquote && ($thaquote['invisible'] == 0 || $thaquote['authorid'] == $_G['uid'] && $thaquote['invisible'] == -2))) { + $thaquote = array(); + } + if($thaquote['tid'] != $_G['tid']) { + showmessage('reply_quotepost_error', NULL); + } + + if(getstatus($thread['status'], 2) && $thaquote['authorid'] != $_G['uid'] && $_G['uid'] != $thread['authorid'] && $thaquote['first'] != 1 && !$_G['forum']['ismoderator']) { + showmessage('reply_quotepost_error', NULL); + } + + if(!($thread['price'] && !$thread['special'] && $thaquote['first'])) { + $quotefid = $thaquote['fid']; + $message = $thaquote['message']; + + if(strpos($message, '[/password]') !== FALSE) { + $message = ''; + } + + if($_G['setting']['bannedmessages'] && $thaquote['authorid']) { + $author = getuserbyuid($thaquote['authorid']); + if(!$author['groupid'] || $author['groupid'] == 4 || $author['groupid'] == 5) { + $message = $language['post_banned']; + } elseif($thaquote['status'] & 1) { + $message = $language['post_single_banned']; + } + } + + $time = dgmdate($thaquote['dateline']); + $message = messagecutstr($message, 100); + $message = implode("\n", array_slice(explode("\n", $message), 0, 3)); + + $thaquote['useip'] = substr($thaquote['useip'], 0, strrpos($thaquote['useip'], '.')).'.x'; + if($thaquote['author'] && $thaquote['anonymous']) { + $thaquote['author'] = lang('forum/misc', 'anonymoususer'); + } elseif(!$thaquote['author']) { + $thaquote['author'] = lang('forum/misc', 'guestuser').' '.$thaquote['useip']; + } else { + $thaquote['author'] = $thaquote['author']; + } + + $post_reply_quote = lang('forum/misc', 'post_reply_quote', array('author' => $thaquote['author'], 'time' => $time)); + $noticeauthormsg = dhtmlspecialchars($message); + if(!defined('IN_MOBILE')) { + $message = "[quote][size=2][url=forum.php?mod=redirect&goto=findpost&pid={$_GET['repquote']}&ptid={$_G['tid']}][color=#999999]{$post_reply_quote}[/color][/url][/size]\n{$message}[/quote]"; + } else { + $message = "[quote][color=#999999]{$post_reply_quote}[/color]\n[color=#999999]{$message}[/color][/quote]"; + } + $quotemessage = discuzcode($message, 0, 0); + $noticeauthor = dhtmlspecialchars(authcode('q|'.$thaquote['authorid'], 'ENCODE')); + $noticetrimstr = dhtmlspecialchars($message); + $message = ''; + } + $reppid = $_GET['repquote']; + + } elseif(isset($_GET['reppost']) && $_GET['reppost'] = intval($_GET['reppost'])) { + $thapost = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['reppost']); + if(!($thapost && ($thapost['invisible'] == 0 || $thapost['authorid'] == $_G['uid'] && $thapost['invisible'] == -2))) { + $thapost = array(); + } + if($thapost['tid'] != $_G['tid']) { + showmessage('targetpost_donotbelongto_thisthread', NULL); + } + + $thapost['useip'] = substr($thapost['useip'], 0, strrpos($thapost['useip'], '.')).'.x'; + if($thapost['author'] && $thapost['anonymous']) { + $thapost['author'] = '[color=Olive]'.lang('forum/misc', 'anonymoususer').'[/color]'; + } elseif(!$thapost['author']) { + $thapost['author'] = '[color=Olive]'.lang('forum/misc', 'guestuser').'[/color] '.$thapost['useip']; + } else { + $thapost['author'] = '[color=Olive]'.$thapost['author'].'[/color]'; + } + $quotemessage = discuzcode($message, 0, 0); + $noticeauthormsg = dhtmlspecialchars(messagecutstr($thapost['message'], 100)); + $noticeauthor = dhtmlspecialchars(authcode('r|'.$thapost['authorid'], 'ENCODE')); + $noticetrimstr = dhtmlspecialchars($message); + $message = ''; + $reppid = $_GET['reppost']; + } + + if(isset($_GET['addtrade']) && $thread['special'] == 2 && $_G['group']['allowposttrade'] && $thread['authorid'] == $_G['uid']) { + $expiration_7days = date('Y-m-d', TIMESTAMP + 86400 * 7); + $expiration_14days = date('Y-m-d', TIMESTAMP + 86400 * 14); + $trade['expiration'] = $expiration_month = date('Y-m-d', mktime(0, 0, 0, date('m')+1, date('d'), date('Y'))); + $expiration_3months = date('Y-m-d', mktime(0, 0, 0, date('m')+3, date('d'), date('Y'))); + $expiration_halfyear = date('Y-m-d', mktime(0, 0, 0, date('m')+6, date('d'), date('Y'))); + $expiration_year = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y')+1)); + } + + if($thread['replies'] <= $_G['ppp']) { + $postlist = array(); + if($thread['price'] > 0 && $thread['special'] == 0) { + $postlist = C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $_G['tid'], true, 'DESC', 0, 0, 0, 0); + } else { + $postlist = C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $_G['tid'], true, 'DESC', 0, 0, null, 0); + } + if($_G['setting']['bannedmessages']) { + $uids = array(); + foreach($postlist as $post) { + $uids[] = $post['authorid']; + } + $users = C::t('common_member')->fetch_all($uids); + } + foreach($postlist as $k => $post) { + + $post['dateline'] = dgmdate($post['dateline'], 'u'); + + if($_G['setting']['bannedmessages'] && ($post['authorid'] && (empty($post['groupid']) || $post['groupid'] == 4 || $post['groupid'] == 5))) { + $post['message'] = $language['post_banned']; + } elseif($post['status'] & 1) { + $post['message'] = $language['post_single_banned']; + } else { + $post['message'] = preg_replace("/\[hide=?\d*\](.*?)\[\/hide\]/is", "[b]{$language['post_hidden']}[/b]", $post['message']); + $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'], $_G['forum']['allowhtml'], $_G['forum']['jammer']); + } + + if($_G['setting']['bannedmessages']) { + $post['groupid'] = $users[$post['authorid']]['groupid']; + } + + $postlist[$k] = $post; + } + } + unset($uids, $users); + + if($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) { + $attachlist = getattach(0); + $attachs = $attachlist['attachs']; + $imgattachs = $attachlist['imgattachs']; + unset($attachlist); + } + + getgpc('infloat') ? include template('forum/post_infloat') : include template('forum/post'); + +} else { + + $modpost = C::m('forum_post', $_G['tid']); + $bfmethods = $afmethods = array(); + + + $params = array( + 'subject' => $subject, + 'message' => $message, + 'special' => $special, + 'extramessage' => isset($extramessage) ? $extramessage : '', + 'bbcodeoff' => getgpc('bbcodeoff'), + 'smileyoff' => getgpc('smileyoff'), + 'htmlon' => getgpc('htmlon'), + 'parseurloff' => getgpc('parseurloff'), + 'usesig' => getgpc('usesig'), + 'isanonymous' => getgpc('isanonymous'), + 'noticetrimstr' => getgpc('noticetrimstr'), + 'noticeauthor' => getgpc('noticeauthor'), + 'from' => getgpc('from'), + 'sechash' => getgpc('sechash'), + 'geoloc' => diconv(getgpc('geoloc'), 'UTF-8'), + ); + + + if(!empty($_GET['trade']) && $thread['special'] == 2 && $_G['group']['allowposttrade']) { + $bfmethods[] = array('class' => 'extend_thread_trade', 'method' => 'before_newreply'); + } + + + + + $attentionon = empty($_GET['attention_add']) ? 0 : 1; + $attentionoff = empty($attention_remove) ? 0 : 1; + $bfmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'before_newreply'); + if($_G['group']['allowat']) { + $bfmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'before_newreply'); + } + + $bfmethods[] = array('class' => 'extend_thread_comment', 'method' => 'before_newreply'); + $modpost->attach_before_method('newreply', array('class' => 'extend_thread_filter', 'method' => 'before_newreply')); + + + + if($_G['group']['allowat']) { + $afmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'after_newreply'); + } + + + $afmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'after_newreply'); + + + + $afmethods[] = array('class' => 'extend_thread_comment', 'method' => 'after_newreply'); + + + + if(helper_access::check_module('follow') && !empty($_GET['adddynamic'])) { + $afmethods[] = array('class' => 'extend_thread_follow', 'method' => 'after_newreply'); + } + + + if($thread['replycredit'] > 0 && $thread['authorid'] != $_G['uid'] && $_G['uid']) { + $afmethods[] = array('class' => 'extend_thread_replycredit', 'method' => 'after_newreply'); + } + + + if($special == 5) { + $afmethods[] = array('class' => 'extend_thread_debate', 'method' => 'after_newreply'); + } + + + + $afmethods[] = array('class' => 'extend_thread_image', 'method' => 'after_newreply'); + + + + if($special == 2 && $_G['group']['allowposttrade'] && $thread['authorid'] == $_G['uid']) { + $afmethods[] = array('class' => 'extend_thread_trade', 'method' => 'after_newreply'); + } + $afmethods[] = array('class' => 'extend_thread_filter', 'method' => 'after_newreply'); + + + + + + if($_G['forum']['allowfeed']) { + if($special == 2 && !empty($_GET['trade'])) { + $modpost->attach_before_method('replyfeed', array('class' => 'extend_thread_trade', 'method' => 'before_replyfeed')); + $modpost->attach_after_method('replyfeed', array('class' => 'extend_thread_trade', 'method' => 'after_replyfeed')); + } elseif($special == 3 && $thread['authorid'] != $_G['uid']) { + $modpost->attach_before_method('replyfeed', array('class' => 'extend_thread_reward', 'method' => 'before_replyfeed')); + } elseif($special == 5 && $thread['authorid'] != $_G['uid']) { + $modpost->attach_before_method('replyfeed', array('class' => 'extend_thread_debate', 'method' => 'before_replyfeed')); + } + } + + + + + if(!isset($_GET['addfeed'])) { + $space = array(); + space_merge($space, 'field_home'); + $_GET['addfeed'] = isset($space['privacy']['feed']['newreply']) ? $space['privacy']['feed']['newreply'] : null; + } + + $modpost->attach_before_methods('newreply', $bfmethods); + $modpost->attach_after_methods('newreply', $afmethods); + + $return = $modpost->newreply($params); + $pid = $modpost->pid; + + if($specialextra) { + + @include_once DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['threadplugins'][$specialextra]['module'].'.class.php'; + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'newreply_submit_end')) { + $threadpluginclass->newreply_submit_end($_G['fid'], $_G['tid']); + } + + } + + if($modpost->pid && !$modpost->param('modnewreplies')) { + + if(!empty($_GET['addfeed'])) { + $modpost->replyfeed(); + } + } + + + if($modpost->param('modnewreplies')) { + $url = "forum.php?mod=viewthread&tid=".$_G['tid']; + } else { + + $antitheft = ''; + if(!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['thread']) && empty($_G['forum']['noantitheft'])) { + $sign = helper_antitheft::get_sign($_G['tid'], 'tid'); + if($sign) { + $antitheft = '&_dsign='.$sign; + } + } + + $url = "forum.php?mod=viewthread&tid=".$_G['tid']."&pid=".$modpost->pid."&page=".$modpost->param('page')."$antitheft&extra=".$extra."#pid".$modpost->pid; + } + + if(!isset($inspacecpshare)) { + showmessage($return , $url, $modpost->param('showmsgparam')); + } + +} + +?> \ No newline at end of file diff --git a/source/include/post/post_newthread.php b/source/include/post/post_newthread.php new file mode 100644 index 0000000..8992b46 --- /dev/null +++ b/source/include/post/post_newthread.php @@ -0,0 +1,312 @@ + $_G['group']['grouptitle']), array('login' => 1)); +} + +if(getglobal('setting/connect/allow') && $_G['setting']['accountguard']['postqqonly'] && !$_G['member']['conisbind']) { + showmessage('postperm_qqonly_nopermission'); +} + +if(!$_G['uid'] && !((!$_G['forum']['postperm'] && $_G['group']['allowpost']) || ($_G['forum']['postperm'] && forumperm($_G['forum']['postperm'])))) { + if(!defined('IN_MOBILE')) { + showmessage('postperm_login_nopermission', NULL, array(), array('login' => 1)); + } else { + showmessage('postperm_login_nopermission_mobile', NULL, array('referer' => rawurlencode(dreferer())), array('login' => 1)); + } +} elseif(empty($_G['forum']['allowpost'])) { + if(!$_G['forum']['postperm'] && !$_G['group']['allowpost']) { + showmessage('postperm_none_nopermission', NULL, array(), array('login' => 1)); + } elseif($_G['forum']['postperm'] && !forumperm($_G['forum']['postperm'])) { + showmessagenoperm('postperm', $_G['fid'], $_G['forum']['formulaperm']); + } +} elseif($_G['forum']['allowpost'] == -1) { + showmessage('post_forum_newthread_nopermission', NULL); +} + +if(!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_secmobile'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) { + showmessage('postperm_login_nopermission', NULL, array(), array('login' => 1)); +} + +checklowerlimit('post', 0, 1, $_G['forum']['fid']); + +if(!submitcheck('topicsubmit', 0, $seccodecheck, $secqaacheck)) { + + $st_t = $_G['uid'].'|'.TIMESTAMP; + dsetcookie('st_t', $st_t.'|'.md5($st_t.$_G['config']['security']['authkey'])); + + if(helper_access::check_module('group')) { + $mygroups = $groupids = array(); + $groupids = C::t('forum_groupuser')->fetch_all_fid_by_uids($_G['uid']); + array_slice($groupids, 0, 20); + $query = C::t('forum_forum')->fetch_all_info_by_fids($groupids); + foreach($query as $group) { + $mygroups[$group['fid']] = $group['name']; + } + } + + $savethreads = array(); + $savethreadothers = array(); + foreach(C::t('forum_post')->fetch_all_by_authorid(0, $_G['uid'], false, '', 0, 20, 1, -3) as $savethread) { + $savethread['dateline'] = dgmdate($savethread['dateline'], 'u'); + if($_G['fid'] == $savethread['fid']) { + $savethreads[] = $savethread; + } else { + $savethreadothers[] = $savethread; + } + } + $savethreadcount = count($savethreads); + $savethreadothercount = count($savethreadothers); + if($savethreadothercount) { + loadcache('forums'); + } + $savecount = $savethreadcount + $savethreadothercount; + unset($savethread); + + $isfirstpost = 1; + $allownoticeauthor = 1; + $tagoffcheck = ''; + $showthreadsorts = !empty($sortid) || getglobal('forum/threadsorts/required') && empty($special); + if(empty($sortid) && empty($special) && getglobal('forum/threadsorts/required') && $_G['forum']['threadsorts']['types']) { + $tmp = array_keys($_G['forum']['threadsorts']['types']); + $sortid = $tmp[0]; + + require_once libfile('post/threadsorts', 'include'); + } + + if($special == 2 && $_G['group']['allowposttrade']) { + + $expiration_7days = date('Y-m-d', TIMESTAMP + 86400 * 7); + $expiration_14days = date('Y-m-d', TIMESTAMP + 86400 * 14); + $trade['expiration'] = $expiration_month = date('Y-m-d', mktime(0, 0, 0, date('m')+1, date('d'), date('Y'))); + $expiration_3months = date('Y-m-d', mktime(0, 0, 0, date('m')+3, date('d'), date('Y'))); + $expiration_halfyear = date('Y-m-d', mktime(0, 0, 0, date('m')+6, date('d'), date('Y'))); + $expiration_year = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y')+1)); + + } elseif($specialextra) { + + $threadpluginclass = null; + if(isset($_G['setting']['threadplugins'][$specialextra]['module'])) { + $threadpluginfile = DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['threadplugins'][$specialextra]['module'].'.class.php'; + if(file_exists($threadpluginfile)) { + @include_once $threadpluginfile; + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'newthread')) { + $threadplughtml = $threadpluginclass->newthread($_G['fid']); + $pluginlang = lang('plugin/'.$specialextra); + $buttontext = property_exists($threadpluginclass, 'buttontext') ? (isset($pluginlang[$threadpluginclass->buttontext]) ? $pluginlang[$threadpluginclass->buttontext] : $threadpluginclass->buttontext) : ''; + $iconfile = $threadpluginclass->iconfile; + $iconsflip = $_G['cache']['icons'] ? array_flip($_G['cache']['icons']) : array(); + $thread['iconid'] = $iconsflip[$iconfile]; + } + } + } + + if(!is_object($threadpluginclass)) { + $specialextra = ''; + } + } + + if($special == 4) { + $activity = array('starttimeto' => '', 'starttimefrom' => '', 'place' => '', 'class' => '', 'cost' => '', 'number' => '', 'gender' => '', 'expiration' => ''); + $activitytypelist = $_G['setting']['activitytype'] ? explode("\n", trim($_G['setting']['activitytype'])) : ''; + } + + if($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) { + $attachlist = getattach(0); + $attachs = $attachlist['attachs']; + $imgattachs = $attachlist['imgattachs']; + unset($attachlist); + } + + !isset($attachs['unused']) && $attachs['unused'] = array(); + !isset($imgattachs['unused']) && $imgattachs['unused'] = array(); + + getgpc('infloat') ? include template('forum/post_infloat') : include template('forum/post'); + +} else { + if(getgpc('mygroupid')) { + $mygroupid = explode('__', $_GET['mygroupid']); + $mygid = intval($mygroupid[0]); + if($mygid) { + $mygname = $mygroupid[1]; + if(count($mygroupid) > 2) { + unset($mygroupid[0]); + $mygname = implode('__', $mygroupid); + } + $message .= '[groupid='.intval($mygid).']'.$mygname.'[/groupid]'; + C::t('forum_forum')->update_commoncredits(intval($mygroupid[0])); + } + } + $modthread = C::m('forum_thread'); + $bfmethods = $afmethods = array(); + + $params = array( + 'subject' => $subject, + 'message' => $message, + 'typeid' => $typeid, + 'sortid' => $sortid, + 'special' => $special, + ); + + $_GET['save'] = $_G['uid'] ? $_GET['save'] : 0; + + if ($_G['group']['allowsetpublishdate'] && $_GET['cronpublish'] && $_GET['cronpublishdate']) { + $publishdate = strtotime($_GET['cronpublishdate']); + if ($publishdate > $_G['timestamp']) { + $_GET['save'] = 1; + } else { + $publishdate = $_G['timestamp']; + } + } else { + $publishdate = $_G['timestamp']; + } + $params['publishdate'] = $publishdate; + $params['save'] = $_GET['save']; + + $params['sticktopic'] = getgpc('sticktopic'); + + $params['digest'] = getgpc('addtodigest'); + $params['readperm'] = $readperm; + $params['isanonymous'] = getgpc('isanonymous'); + $params['price'] = $_GET['price']; + + + if(in_array($special, array(1, 2, 3, 4, 5))) { + $specials = array( + 1 => 'extend_thread_poll', + 2 => 'extend_thread_trade', + 3 => 'extend_thread_reward', + 4 => 'extend_thread_activity', + 5 => 'extend_thread_debate' + ); + $bfmethods[] = array('class' => $specials[$special], 'method' => 'before_newthread'); + $afmethods[] = array('class' => $specials[$special], 'method' => 'after_newthread'); + + if(!empty($_GET['addfeed'])) { + $modthread->attach_before_method('feed', array('class' => $specials[$special], 'method' => 'before_feed')); + } + } + + if($special == 1) { + + + } elseif($special == 3) { + + + } elseif($special == 4) { + } elseif($special == 5) { + + + } elseif($specialextra) { + + @include_once DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['threadplugins'][$specialextra]['module'].'.class.php'; + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'newthread_submit')) { + $threadpluginclass->newthread_submit($_G['fid']); + } + $special = 127; + $params['special'] = 127; + $params['message'] .= chr(0).chr(0).chr(0).$specialextra; + + } + + $params['typeexpiration'] = getgpc('typeexpiration'); + + + + + + + $params['ordertype'] = getgpc('ordertype'); + + $params['hiddenreplies'] = getgpc('hiddenreplies'); + + $params['allownoticeauthor'] = $_GET['allownoticeauthor']; + $params['tags'] = $_GET['tags']; + $params['bbcodeoff'] = getgpc('bbcodeoff'); + $params['smileyoff'] = getgpc('smileyoff'); + $params['parseurloff'] = getgpc('parseurloff'); + $params['usesig'] = $_GET['usesig']; + $params['htmlon'] = getgpc('htmlon'); + if($_G['group']['allowimgcontent']) { + $params['imgcontent'] = $_GET['imgcontent']; + $params['imgcontentwidth'] = $_G['setting']['imgcontentwidth'] ? intval($_G['setting']['imgcontentwidth']) : 100; + } + + $params['geoloc'] = diconv(getgpc('geoloc'), 'UTF-8'); + + if(getgpc('rushreply')) { + $bfmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'before_newthread'); + $afmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'after_newthread'); + } + + $bfmethods[] = array('class' => 'extend_thread_replycredit', 'method' => 'before_newthread'); + $afmethods[] = array('class' => 'extend_thread_replycredit', 'method' => 'after_newthread'); + + if($sortid) { + $bfmethods[] = array('class' => 'extend_thread_sort', 'method' => 'before_newthread'); + $afmethods[] = array('class' => 'extend_thread_sort', 'method' => 'after_newthread'); + } + $bfmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'before_newthread'); + $afmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'after_newthread'); + $afmethods[] = array('class' => 'extend_thread_image', 'method' => 'after_newthread'); + + if(!empty($_GET['adddynamic'])) { + $afmethods[] = array('class' => 'extend_thread_follow', 'method' => 'after_newthread'); + } + + $modthread->attach_before_methods('newthread', $bfmethods); + $modthread->attach_after_methods('newthread', $afmethods); + + $return = $modthread->newthread($params); + $tid = $modthread->tid; + $pid = $modthread->pid; + + + + + + + + + + dsetcookie('clearUserdata', 'forum'); + if($specialextra) { + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'newthread_submit_end')) { + $threadpluginclass->newthread_submit_end($_G['fid'], $modthread->tid); + } + } + if(!$modthread->param('modnewthreads') && !empty($_GET['addfeed'])) { + $modthread->feed(); + } + + if(!empty($_G['setting']['rewriterule']['forum_viewthread']) && is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $returnurl = rewriteoutput('forum_viewthread', 1, '', $modthread->tid, 1, '', $extra); + } else { + $returnurl = "forum.php?mod=viewthread&tid={$modthread->tid}&extra=$extra"; + } + $values = array('fid' => $modthread->forum('fid'), 'tid' => $modthread->tid, 'pid' => $modthread->pid, 'coverimg' => '', 'sechash' => !empty($_GET['sechash']) ? $_GET['sechash'] : ''); + showmessage($return, $returnurl, array_merge($values, (array)$modthread->param('values')), $modthread->param('param')); + + +} + + +?> \ No newline at end of file diff --git a/source/include/post/post_threadsorts.php b/source/include/post/post_threadsorts.php new file mode 100644 index 0000000..d880f82 --- /dev/null +++ b/source/include/post/post_threadsorts.php @@ -0,0 +1,38 @@ + $val) { + if($val['profile']) { + $sqlarr[] = $val['profile']; + } +} +if($sqlarr) { + $member_profile = array(); + $_member_profile = C::t('common_member_profile')->fetch($_G['uid']); + foreach($sqlarr as $val) { + $member_profile[$val] = $_member_profile[$val]; + } + unset($_member_profile); +} +threadsort_optiondata($pid, $sortid, $_G['cache']['threadsort_option_'.$sortid], $_G['cache']['threadsort_template_'.$sortid]); + + + +?> \ No newline at end of file diff --git a/source/include/space/index.htm b/source/include/space/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/space/space_activity.php b/source/include/space/space_activity.php new file mode 100644 index 0000000..9e7329e --- /dev/null +++ b/source/include/space/space_activity.php @@ -0,0 +1,147 @@ + 'space', + 'uid' => $space['uid'], + 'do' => 'activity', + 'view' => $_GET['view'], + 'order' => $_GET['order'], + 'type' => $_GET['type'], + 'fuid' => $_GET['fuid'], + 'searchkey' => $_GET['searchkey'] +); +$theurl = 'home.php?'.url_implode($gets); +$multi = ''; + +$wheresql = '1'; +$threadsql = $apply_sql = ''; + +$f_index = ''; +$need_count = true; +require_once libfile('function/misc'); +if($_GET['view'] == 'me') { + $viewtype = in_array($_GET['type'], array('orig', 'apply')) ? $_GET['type'] : 'orig'; + $orderactives = array($viewtype => ' class="a"'); +} else { + + space_merge($space, 'field_home'); + + if($space['feedfriend']) { + $fuid_actives = array(); + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid, $space['uid'])) { + $fuid_actives = array($fuid=>' selected'); + $frienduid = $fuid; + } else { + $theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we"; + $frienduid = explode(',', $space['feedfriend']); + } + + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true); + foreach($query as $value) { + $userlist[] = $value; + } + } else { + $need_count = false; + } +} + +$actives = array($_GET['view'] =>' class="a"'); + +if($need_count) { + + if(!empty($_GET['searchkey'])) { + $_GET['searchkey'] = stripsearchkey($_GET['searchkey']); + } + $count = C::t('forum_activity')->fetch_all_for_search($_GET['view'], $_GET['order'], $_GET['searchkey'], $_GET['type'], $frienduid, $space['uid'], $minhot, 1); + if($count) { + $query = C::t('forum_activity')->fetch_all_for_search($_GET['view'], $_GET['order'], $_GET['searchkey'], $_GET['type'], $frienduid, $space['uid'], $minhot, 0, $start, $perpage); + + loadcache('forums'); + $daytids = $tids = array(); + foreach($query as $value) { + if(empty($value['author']) && $value['authorid'] != $_G['uid']) { + $hiddennum++; + continue; + } + $date = dgmdate($value['starttimefrom'], 'Ymd'); + $posttableid = $value['posttableid'] ? $value['posttableid'] : 0; + $tids[$posttableid][$value['tid']] = $value['tid']; + $value['week'] = dgmdate($value['starttimefrom'], 'w'); + $value['month'] = dgmdate($value['starttimefrom'], 'n'.lang('space', 'month')); + $value['day'] = dgmdate($value['starttimefrom'], 'j'); + $value['time'] = dgmdate($value['starttimefrom'], 'Y'.lang('space', 'year').'m'.lang('space', 'month').'d'.lang('space', 'day')); + $value['starttimefrom'] = dgmdate($value['starttimefrom']); + + $daytids[$value['tid']] = $date; + $list[$date][$value['tid']] = procthread($value); + } + if($tids) { + require_once libfile('function/post'); + foreach($tids as $ptid=>$ids) { + foreach(C::t('forum_post')->fetch_all_by_tid($ptid, $ids, true, '', 0, 0, 1) as $value) { + $date = $daytids[$value['tid']]; + $value['message'] = messagecutstr($value['message'], 150); + $list[$date][$value['tid']]['message'] = $value['message']; + } + } + } + + $multi = multi($count, $perpage, $page, $theurl); + } + +} + +if($_G['uid']) { + if($_GET['view'] == 'all') { + $navtitle = lang('core', 'title_view_all').lang('core', 'title_activity'); + } elseif($_GET['view'] == 'me') { + $navtitle = lang('core', 'title_my_activity'); + } else { + $navtitle = lang('core', 'title_friend_activity'); + } +} else { + if($_GET['order'] == 'hot') { + $navtitle = lang('core', 'title_top_activity'); + } else { + $navtitle = lang('core', 'title_newest_activity'); + } +} + +include_once template("diy:home/space_activity"); + +?> \ No newline at end of file diff --git a/source/include/space/space_album.php b/source/include/space/space_album.php new file mode 100644 index 0000000..b98ea6f --- /dev/null +++ b/source/include/space/space_album.php @@ -0,0 +1,459 @@ + 0) { + $album = C::t('home_album')->fetch_album($id, $space['uid']); + if(empty($album)) { + showmessage('to_view_the_photo_does_not_exist'); + } + + ckfriend_album($album); + + + $album['picnum'] = $count = C::t('home_pic')->check_albumpic($id); + + if(empty($count) && !$space['self']) { + C::t('home_album')->delete($id); + showmessage('to_view_the_photo_does_not_exist', "home.php?mod=space&uid={$album['uid']}&do=album&view=me"); + } + + if($album['catid']) { + $album['catname'] = C::t('home_album_category')->fetch_catname_by_catid($album['catid']); + $album['catname'] = dhtmlspecialchars($album['catname']); + } + + } else { + $count = C::t('home_pic')->check_albumpic(0, NULL, $space['uid']); + + $album = array( + 'uid' => $space['uid'], + 'albumid' => -1, + 'albumname' => lang('space', 'default_albumname'), + 'picnum' => $count + ); + } + + $albumlist = array(); + $maxalbum = $nowalbum = $key = 0; + $query = C::t('home_album')->fetch_all_by_uid($space['uid'], 'updatetime', 0, 100); + foreach($query as $value) { + if($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + } elseif ($value['picnum']) { + $value['pic'] = STATICURL.'image/common/nopublish.svg'; + } else { + $value['pic'] = ''; + } + $albumlist[$key][$value['albumid']] = $value; + $key = count($albumlist[$key]) == 5 ? ++$key : $key; + } + $maxalbum = count($albumlist); + + $list = array(); + $pricount = 0; + if($count) { + $query = C::t('home_pic')->fetch_all_by_albumid($id, $start, $perpage, 0, 0, 1, $space['uid']); + foreach($query as $value) { + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']); + $list[] = $value; + } else { + $pricount++; + } + } + } + $multi = multi($count, $perpage, $page, "home.php?mod=space&uid={$album['uid']}&do=$do&id=$id#comment"); + + $actives = array('me' =>' class="a"'); + + $_G['home_css'] = 'album'; + + $diymode = intval($_G['cookie']['home_diymode']); + + $seodata = array('album' => $album['albumname'], 'user' => $album['username'], 'depict' => $album['depict']); + list($navtitle, $metadescription, $metakeywords) = get_seosetting('album', $seodata); + if(empty($navtitle)) { + $navtitle = (empty($album['albumname']) ? '' : $album['albumname'].' - ').lang('space', 'sb_album', array('who' => $album['username'])); + $nobbname = false; + } else { + $nobbname = true; + } + if(empty($metakeywords)) { + $metakeywords = $album['albumname']; + } + if(empty($metadescription)) { + $metadescription = $album['albumname']; + } + + include_once template("diy:home/space_album_view"); + +} elseif ($picid) { + $query = C::t('home_pic')->fetch_all_by_uid($space['uid'], 0, 1, $picid); + $pic = $query[0]; + if(!$pic || ($pic['status'] == 1 && $pic['uid'] != $_G['uid'] && $_G['adminid'] != 1 && $_GET['modpickey'] != modauthkey($pic['picid']))) { + showmessage('view_images_do_not_exist'); + } + + $picid = $pic['picid']; + $theurl = "home.php?mod=space&uid={$pic['uid']}&do=$do&picid=$picid"; + + $album = array(); + if($pic['albumid']) { + $album = C::t('home_album')->fetch_album($pic['albumid']); + if(!$album) { + C::t('home_pic')->update_for_albumid($pic['albumid'], array('albumid' => 0)); + } + } + + if($album) { + ckfriend_album($album); + } else { + $album['picnum'] = C::t('home_pic')->check_albumpic(0, NULL, $pic['uid']); + $album['albumid'] = $pic['albumid'] = '-1'; + } + + $piclist = $list = $keys = array(); + $keycount = 0; + $query = C::t('home_pic')->fetch_all_by_albumid($pic['albumid'], 0, 0, 0, 0, 1, $space['uid']); + foreach($query as $value) { + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $keys[$value['picid']] = $keycount; + $list[$keycount] = $value; + $keycount++; + } + } + + $upid = $nextid = 0; + $nowkey = $keys[$picid]; + $endkey = $keycount - 1; + if($endkey>4) { + $newkeys = array($nowkey-2, $nowkey-1, $nowkey, $nowkey+1, $nowkey+2); + if($newkeys[1] < 0) { + $newkeys[0] = $endkey-1; + $newkeys[1] = $endkey; + } elseif($newkeys[0] < 0) { + $newkeys[0] = $endkey; + } + if($newkeys[3] > $endkey) { + $newkeys[3] = 0; + $newkeys[4] = 1; + } elseif($newkeys[4] > $endkey) { + $newkeys[4] = 0; + } + $upid = $list[$newkeys[1]]['picid']; + $nextid = $list[$newkeys[3]]['picid']; + + foreach ($newkeys as $nkey) { + $piclist[$nkey] = $list[$nkey]; + } + } else { + $newkeys = array($nowkey-1, $nowkey, $nowkey+1); + if($newkeys[0] < 0) { + $newkeys[0] = $endkey; + } + if($newkeys[2] > $endkey) { + $newkeys[2] = 0; + } + $upid = $list[$newkeys[0]]['picid']; + $nextid = $list[$newkeys[2]]['picid']; + + $piclist = $list; + } + foreach ($piclist as $key => $value) { + $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']); + $piclist[$key] = $value; + } + + $pic['pic'] = pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote'], 0); + $pic['size'] = formatsize($pic['size']); + $pic['postip'] = ip::to_display($pic['postip']); + + $exifs = array(); + $allowexif = function_exists('exif_read_data'); + if(isset($_GET['exif']) && $allowexif) { + require_once libfile('function/exif'); + $exifs = getexif($pic['pic']); + } + + $perpage = 20; + $perpage = mob_perpage($perpage); + + $start = ($page-1)*$perpage; + + ckstart($start, $perpage); + + $cid = empty($_GET['cid'])?0:intval($_GET['cid']); + + $siteurl = getsiteurl(); + $list = array(); + $count = C::t('home_comment')->count_by_id_idtype($pic['picid'], 'picid', $cid); + if($count) { + $query = C::t('home_comment')->fetch_all_by_id_idtype($pic['picid'], 'picid', $start, $perpage, $cid); + foreach($query as $value) { + $list[] = $value; + } + } + + $multi = multi($count, $perpage, $page, $theurl); + + if(empty($album['albumname'])) $album['albumname'] = lang('space', 'default_albumname'); + + $pic_url = $pic['pic']; + if(!preg_match("/^(http|https)\:\/\/.+?/i", $pic['pic'])) { + $pic_url = getsiteurl().$pic['pic']; + } + $pic_url2 = rawurlencode($pic['pic']); + + $hash = md5($pic['uid']."\t".$pic['dateline']); + $id = $pic['picid']; + $idtype = 'picid'; + + $maxclicknum = 0; + loadcache('click'); + $clicks = empty($_G['cache']['click']['picid'])?array():$_G['cache']['click']['picid']; + foreach ($clicks as $key => $value) { + $value['clicknum'] = $pic["click{$key}"]; + $value['classid'] = mt_rand(1, 4); + if($value['clicknum'] > $maxclicknum) $maxclicknum = $value['clicknum']; + $clicks[$key] = $value; + } + + $clickuserlist = array(); + foreach(C::t('home_clickuser')->fetch_all_by_id_idtype($id, $idtype, 0, 20) as $value) { + $value['clickname'] = $clicks[$value['clickid']]['name']; + $clickuserlist[] = $value; + } + + $actives = array('me' =>' class="a"'); + + if($album['picnum']) { + $sequence = $nowkey + 1; + } + + $diymode = intval($_G['cookie']['home_diymode']); + + $navtitle = $album['albumname']; + if($pic['title']) { + $navtitle = $pic['title'].' - '.$navtitle; + } + $metakeywords = $pic['title'] ? $pic['title'] : $album['albumname']; + $metadescription = $pic['title'] ? $pic['title'] : $album['albumname']; + + include_once template("diy:home/space_album_pic"); + +} else { + + loadcache('albumcategory'); + $category = $_G['cache']['albumcategory']; + + $perpage = 20; + $perpage = mob_perpage($perpage); + + $start = ($page-1)*$perpage; + + ckstart($start, $perpage); + + $_GET['friend'] = intval($_GET['friend']); + + $default = array(); + $f_index = ''; + $list = array(); + $pricount = 0; + $picmode = 0; + + $_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we'; + $_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline'; + + $gets = array( + 'mod' => 'space', + 'uid' => $space['uid'], + 'do' => 'album', + 'view' => $_GET['view'], + 'catid' => $_GET['catid'], + 'order' => $_GET['order'], + 'fuid' => $_GET['fuid'], + 'searchkey' => $_GET['searchkey'], + 'from' => $_GET['from'] + ); + $theurl = 'home.php?'.url_implode($gets); + $actives = array($_GET['view'] =>' class="a"'); + + $need_count = true; + + if($_GET['view'] == 'all') { + + $wheresql = '1'; + + if($_GET['order'] == 'hot') { + $orderactives = array('hot' => ' class="a"'); + $picmode = 1; + $need_count = false; + + $ordersql = 'p.dateline'; + + $count = C::t('home_pic')->fetch_all_by_sql('p.'.DB::field('hot', $minhot, '>='), '', 0, 0, 1); + if($count) { + $query = C::t('home_pic')->fetch_all_by_sql('p.'.DB::field('hot', $minhot, '>='), 'p.dateline DESC', $start, $perpage); + foreach($query as $value) { + if($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids']) && ($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1)) { + $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']); + $list[] = $value; + } else { + $pricount++; + } + } + } + + } else { + $orderactives = array('dateline' => ' class="a"'); + } + + } elseif($_GET['view'] == 'we') { + + space_merge($space, 'field_home'); + + $uids = array(); + + if($space['feedfriend']) { + + $uids = explode(',', $space['feedfriend']); + $f_index = 'updatetime'; + + $fuid_actives = array(); + + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid)) { + $uids = array($fuid); + $f_index = ''; + $fuid_actives = array($fuid=>' selected'); + } + + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 500, true); + foreach($query as $value) { + $userlist[] = $value; + } + } else { + $need_count = false; + } + + } else { + + if($_GET['from'] == 'space') $diymode = 1; + + $uids = array($space['uid']); + } + + if($need_count) { + + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $sqlSearchKey = $searchkey; + $searchkey = dhtmlspecialchars($searchkey); + } + + $catid = empty($_GET['catid'])?0:intval($_GET['catid']); + + $count = C::t('home_album')->fetch_all_by_search(3, $uids, $sqlSearchKey, true, $catid, 0, 0, ''); + + if($count) { + $query = C::t('home_album')->fetch_all_by_search(1, $uids, $sqlSearchKey, true, $catid, 0, 0, '', '', 'updatetime', 'DESC', $start, $perpage, $f_index); + foreach($query as $value) { + if($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + } elseif ($value['picnum']) { + $value['pic'] = STATICURL.'image/common/nopublish.svg'; + } else { + $value['pic'] = ''; + } + $list[] = $value; + } + } + } + + $multi = multi($count, $perpage, $page, $theurl); + + dsetcookie('home_diymode', $diymode); + + if($_G['uid']) { + if($_GET['view'] == 'all') { + $navtitle = lang('core', 'title_view_all').lang('core', 'title_album'); + } elseif($_GET['view'] == 'me') { + $navtitle = lang('core', 'title_my_album'); + } else { + $navtitle = lang('core', 'title_friend_album'); + } + } else { + if($_GET['order'] == 'hot') { + $navtitle = lang('core', 'title_hot_pic_recommend'); + } else { + $navtitle = lang('core', 'title_newest_update_album'); + } + } + if($space['username']) { + $navtitle = lang('space', 'sb_album', array('who' => $space['username'])); + } + + $metakeywords = $navtitle; + $metadescription = $navtitle; + include_once template("diy:home/space_album_list"); +} + +function ckfriend_album($album) { + global $_G, $space; + + if($_G['adminid'] != 1) { + if(!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) { + if(empty($_G['uid'])) { + showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1)); + } + require_once libfile('function/friend'); + $isfriend = friend_check($album['uid']); + space_merge($space, 'count'); + space_merge($space, 'profile'); + $_G['privacy'] = 1; + require_once libfile('space/profile', 'include'); + include template('home/space_privacy'); + exit(); + } elseif(!$space['self'] && $album['friend'] == 4) { + $cookiename = "view_pwd_album_{$album['albumid']}"; + $cookievalue = empty($_G['cookie'][$cookiename])?'':$_G['cookie'][$cookiename]; + if($cookievalue != md5(md5($album['password']))) { + $invalue = $album; + include template('home/misc_inputpwd'); + exit(); + } + } + } +} + +?> \ No newline at end of file diff --git a/source/include/space/space_blog.php b/source/include/space/space_blog.php new file mode 100644 index 0000000..c3452ab --- /dev/null +++ b/source/include/space/space_blog.php @@ -0,0 +1,380 @@ +fetch($id), + C::t('home_blogfield')->fetch($id) + ); + if($blog['uid'] != $space['uid']) { + $blog = null; + } + if(!(!empty($blog) && ($blog['status'] == 0 || $blog['uid'] == $_G['uid'] || $_G['adminid'] == 1 || $_GET['modblogkey'] == modauthkey($blog['blogid'])))) { + showmessage('view_to_info_did_not_exist'); + } + if(!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids'])) { + require_once libfile('function/friend'); + $isfriend = friend_check($blog['uid']); + space_merge($space, 'count'); + space_merge($space, 'profile'); + $_G['privacy'] = 1; + require_once libfile('space/profile', 'include'); + include template('home/space_privacy'); + exit(); + } elseif(!$space['self'] && $blog['friend'] == 4 && $_G['adminid'] != 1) { + $cookiename = "view_pwd_blog_{$blog['blogid']}"; + $cookievalue = empty($_G['cookie'][$cookiename])?'':$_G['cookie'][$cookiename]; + if($cookievalue != md5(md5($blog['password']))) { + $invalue = $blog; + include template('home/misc_inputpwd'); + exit(); + } + } + + if(!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['blog'])) { + helper_antitheft::check($id, 'bid'); + } + + $classarr = C::t('home_class')->fetch($blog['classid']); + + if($blog['catid']) { + $blog['catname'] = C::t('home_blog_category')->fetch_catname_by_catid($blog['catid']); + $blog['catname'] = dhtmlspecialchars($blog['catname']); + } + + require_once libfile('function/blog'); + $blog['message'] = blog_bbcode($blog['message']); + + $otherlist = $newlist = array(); + + $otherlist = array(); + $query = C::t('home_blog')->fetch_all_by_uid($space['uid'], 'dateline', 0, 6); + foreach($query as $value) { + if($value['blogid'] != $blog['blogid'] && empty($value['friend']) && $value['status'] == 0) { + $otherlist[] = $value; + } + } + + $newlist = array(); + $query = C::t('home_blog')->fetch_all_by_hot($minhot, 'dateline', 0, 6); + foreach($query as $value) { + if($value['blogid'] != $blog['blogid'] && empty($value['friend']) && $value['status'] == 0) { + $newlist[] = $value; + } + } + + $perpage = 20; + $perpage = mob_perpage($perpage); + + $start = ($page-1)*$perpage; + + ckstart($start, $perpage); + + $count = $blog['replynum']; + + $list = array(); + if($count) { + if($_GET['goto']) { + $page = ceil($count/$perpage); + $start = ($page-1)*$perpage; + } else { + $cid = empty($_GET['cid'])?0:intval($_GET['cid']); + } + + $query = C::t('home_comment')->fetch_all_by_id_idtype($id, 'blogid', $start, $perpage, $cid); + foreach($query as $value) { + $list[] = $value; + } + + if(empty($list) && empty($cid)) { + $count = C::t('home_comment')->count_by_id_idtype($id, 'blogid'); + C::t('home_blog')->update($blog['blogid'], array('replynum'=>$count)); + } + } + + $multi = multi($count, $perpage, $page, "home.php?mod=space&uid={$blog['uid']}&do=$do&id=$id#comment"); + + if(!$_G['setting']['preventrefresh'] || !$space['self'] && $_G['cookie']['viewid'] != 'blog_'.$blog['blogid']) { + C::t('home_blog')->increase($blog['blogid'], 0, array('viewnum' => 1)); + dsetcookie('viewid', 'blog_'.$blog['blogid']); + } + + $hash = md5($blog['uid']."\t".$blog['dateline']); + $id = $blog['blogid']; + $idtype = 'blogid'; + + $maxclicknum = 0; + loadcache('click'); + $clicks = empty($_G['cache']['click']['blogid'])?array():$_G['cache']['click']['blogid']; + + foreach ($clicks as $key => $value) { + $value['clicknum'] = $blog["click{$key}"]; + $value['classid'] = mt_rand(1, 4); + if($value['clicknum'] > $maxclicknum) $maxclicknum = $value['clicknum']; + $clicks[$key] = $value; + } + + $clickuserlist = array(); + foreach(C::t('home_clickuser')->fetch_all_by_id_idtype($id, $idtype, 0, 24) as $value) { + $value['clickname'] = $clicks[$value['clickid']]['name']; + $clickuserlist[] = $value; + } + $actives = array('me' =>' class="a"'); + + $diymode = intval($_G['cookie']['home_diymode']); + + $tagarray_all = $array_temp = $blogtag_array = $blogmetatag_array = array(); + $blogmeta_tag = ''; + $tagarray_all = explode("\t", $blog['tag']); + if($tagarray_all) { + foreach($tagarray_all as $var) { + if($var) { + $array_temp = explode(',', $var); + $blogtag_array[] = $array_temp; + $blogmetatag_array[] = $array_temp['1']; + } + } + } + $blog['tag'] = $blogtag_array; + $blogmeta_tag = implode(',', $blogmetatag_array); + $blog['postip'] = ip::to_display($blog['postip']); + + $summary = cutstr(strip_tags($blog['message']), 140); + $seodata = array('subject' => $blog['subject'], 'user' => $blog['username'], 'summary' => $summary, 'tags' => $blogmeta_tag); + list($navtitle, $metadescription, $metakeywords) = get_seosetting('blog', $seodata); + if(empty($navtitle)) { + $navtitle = $blog['subject'].' - '.lang('space', 'sb_blog', array('who' => $blog['username'])); + $nobbname = false; + } else { + $nobbname = true; + } + if(empty($metakeywords)) { + $metakeywords = $blogmeta_tag ? $blogmeta_tag : $blog['subject']; + } + if(empty($metadescription)) { + $metadescription = $summary; + } + if(!$_G['setting']['relatedlinkstatus']) { + $_G['relatedlinks'] = get_related_link('blog'); + } else { + $blog['message'] = parse_related_link($blog['message'], 'blog'); + } + + include_once template("diy:home/space_blog_view"); + +} else { + + loadcache('blogcategory'); + $category = $_G['cache']['blogcategory']; + + $_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we'; + $_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline'; + + $perpage = 10; + $perpage = mob_perpage($perpage); + $start = ($page-1)*$perpage; + ckstart($start, $perpage); + + $summarylen = 300; + + $classarr = array(); + $list = array(); + $userlist = array(); + $stickblogs = array(); + $count = $pricount = 0; + + $gets = array( + 'mod' => 'space', + 'uid' => $space['uid'], + 'do' => 'blog', + 'view' => $_GET['view'], + 'order' => $_GET['order'], + 'classid' => $_GET['classid'], + 'catid' => $_GET['catid'], + 'clickid' => $_GET['clickid'], + 'fuid' => $_GET['fuid'], + 'searchkey' => $_GET['searchkey'], + 'from' => $_GET['from'], + 'friend' => $_GET['friend'] + ); + $theurl = 'home.php?'.url_implode($gets); + $multi = ''; + + $f_index = $searchsubject = ''; + $uids = array(); + $need_count = true; + $status = null; + if($_GET['view'] == 'all') { + if($_GET['order'] == 'hot') { + $gthot = $minhot; + + $orderactives = array('hot' => ' class="a"'); + } else { + $orderactives = array('dateline' => ' class="a"'); + } + + $status = 0; + } elseif($_GET['view'] == 'me') { + + space_merge($space, 'field_home'); + $stickblogs = explode(',', $space['stickblogs']); + $stickblogs = array_filter($stickblogs); + $uids[] = $space['uid']; + + $classid = empty($_GET['classid'])?0:intval($_GET['classid']); + + $privacyfriend = empty($_GET['friend'])?0:intval($_GET['friend']); + $query = C::t('home_class')->fetch_all_by_uid($space['uid']); + foreach($query as $value) { + $classarr[$value['classid']] = $value['classname']; + } + + if($_GET['from'] == 'space') $diymode = 1; + $status = array(0, 1); + } else { + + space_merge($space, 'field_home'); + + if($space['feedfriend']) { + + $fuid_actives = array(); + + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid, $space['uid'])) { + $uids[] = $fuid; + $fuid_actives = array($fuid=>' selected'); + } else { + $uids = explode(',', $space['feedfriend']); + $theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we"; + $f_index = 'dateline'; + } + + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true); + foreach($query as $value) { + $userlist[] = $value; + } + $status = 0; + } else { + $need_count = false; + } + } + + $actives = array($_GET['view'] =>' class="a"'); + + if($need_count) { + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $searchsubject = $searchkey; + $searchkey = dhtmlspecialchars($searchkey); + } + + $catid = empty($_GET['catid'])?0:intval($_GET['catid']); + + $count = C::t('home_blog')->count_all_by_search(null, $uids, null, null, $gthot, null, null, null, null, null, $privacyfriend, null, null, null, $classid, $catid, $searchsubject, true, $status); + if($count) { + $query = C::t('home_blog')->fetch_all_by_search(1, null, $uids, null, null, $gthot, null, null, null, null, null, $privacyfriend, null, null, null, 'dateline', 'DESC', $start, $perpage, $classid, $catid, $searchsubject, $f_index, false, $status); + } + } + + if($count) { + foreach($query as $value) { + if(ckfriend($value['uid'], $value['friend'], $value['target_ids']) && ($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1)) { + if(!empty($stickblogs) && in_array($value['blogid'], $stickblogs)) { + continue; + } + if($value['friend'] == 4) { + $value['message'] = $value['pic'] = ''; + } else { + $value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1); + } + $value['message'] = preg_replace("/&[a-z]+\;/i", '', $value['message']); + if($value['pic']) $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + $value['dateline'] = dgmdate($value['dateline']); + $list[] = $value; + } else { + $pricount++; + } + } + + $multi = multi($count, $perpage, $page, $theurl); + if(!empty($stickblogs)) { + $list = array_merge(blog_get_stick($space['uid'], $stickblogs, $summarylen), $list); + } + } + + dsetcookie('home_diymode', $diymode); + + if($_G['uid']) { + if($_GET['view'] == 'all') { + $navtitle = lang('core', 'title_view_all').lang('core', 'title_blog'); + } elseif($_GET['view'] == 'me') { + $navtitle = lang('core', 'title_my_blog'); + } else { + $navtitle = lang('core', 'title_friend_blog'); + + } + } else { + if($_GET['order'] == 'hot') { + $navtitle = lang('core', 'title_recommend_blog'); + } else { + $navtitle = lang('core', 'title_newest_blog'); + } + } + if($space['username']) { + $navtitle = lang('space', 'sb_blog', array('who' => $space['username'])); + } + $metakeywords = $navtitle; + $metadescription = $navtitle; + $navtitle = helper_seo::get_title_page($navtitle, $_G['page']); + + space_merge($space, 'field_home'); + include_once template("diy:home/space_blog_list"); + +} + +function blog_get_stick($uid, $stickblogs, $summarylen) { + $list = $stickids = array(); + if($stickblogs) { + $data_blog = C::t('home_blog')->fetch_all_blog($stickblogs); + $data_blogfield = C::t('home_blogfield')->fetch_all($stickblogs); + foreach ($stickblogs as $blogid) { + if(!empty($data_blog[$blogid]) && !empty($data_blogfield[$blogid])) { + $value = array_merge($data_blog[$blogid], $data_blogfield[$blogid]); + if(ckfriend($value['uid'], $value['friend'], $value['target_ids']) && ($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1)) { + $value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1); + $value['message'] = preg_replace("/&[a-z]+\;/i", '', $value['message']); + if($value['pic']) $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + $value['dateline'] = dgmdate($value['dateline']); + $value['stickflag'] = true; + $list[$value['blogid']] = $value; + $stickids[] = $value['blogid']; + } + } + } + if(count($stickids) != count($stickblogs)) { + C::t('common_member_field_home')->update($uid, array('stickblogs' => implode(',', $stickids))); + } + } + return $list; +} +?> \ No newline at end of file diff --git a/source/include/space/space_debate.php b/source/include/space/space_debate.php new file mode 100644 index 0000000..8608c28 --- /dev/null +++ b/source/include/space/space_debate.php @@ -0,0 +1,173 @@ + 'space', + 'uid' => $space['uid'], + 'do' => 'debate', + 'view' => $_GET['view'], + 'order' => $_GET['order'], + 'type' => $_GET['type'], + 'fuid' => $_GET['fuid'], + 'searchkey' => $_GET['searchkey'] +); +$theurl = 'home.php?'.url_implode($gets); +$multi = ''; + + +$f_index = ''; +$ordersql = 't.dateline DESC'; +$need_count = true; +$join = $authorid = $replies = 0; +$displayorder = null; +$subject = ''; + +if($_GET['view'] == 'me') { + + if($_GET['type'] == 'reply') { + $authorid = $space['uid']; + $join = true; + } else { + $authorid = $space['uid']; + } + $viewtype = in_array($_GET['type'], array('orig', 'reply')) ? $_GET['type'] : 'orig'; + $typeactives = array($viewtype => ' class="a"'); + +} else { + + space_merge($space, 'field_home'); + + if($space['feedfriend']) { + + $fuid_actives = array(); + + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid, $space['uid'])) { + $authorid = $fuid; + $fuid_actives = array($fuid=>' selected'); + } else { + $authorid = explode(',', $space['feedfriend']); + $theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we"; + } + + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true); + foreach($query as $value) { + $userlist[] = $value; + } + } else { + $need_count = false; + } +} + +$actives = array($_GET['view'] =>' class="a"'); + +if($need_count) { + + if($_GET['view'] != 'me') { + $displayorder = 0; + } + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $subject = $searchkey; + $searchkey = dhtmlspecialchars($searchkey); + } + + $count = C::t('forum_thread')->count_by_special(5, $authorid, $replies, $displayorder, $subject, $join); + if($count) { + + $dids = $special = $multitable = $tids = array(); + require_once libfile('function/post'); + foreach(C::t('forum_thread')->fetch_all_by_special(5, $authorid, $replies, $displayorder, $subject, $join, $start, $perpage) as $value) { + $value['dateline'] = dgmdate($value['dateline']); + if($_GET['view'] == 'me' && $_GET['type'] == 'reply' && $page == 1 && count($special) < 2) { + $value['message'] = messagecutstr($value['message'], 200); + $special[$value['tid']] = $value; + } else { + if($page == 1 && count($special) < 2) { + $tids[$value['posttableid']][$value['tid']] = $value['tid']; + $special[$value['tid']] = $value; + } else { + $list[$value['tid']] = $value; + } + } + $dids[$value['tid']] = $value['tid']; + } + if($tids) { + foreach($tids as $postid => $tid) { + foreach(C::t('forum_post')->fetch_all_by_tid(0, $tid) as $value) { + $special[$value['tid']]['message'] = messagecutstr($value['message'], 200); + } + } + } + if($dids) { + foreach(C::t('forum_debate')->fetch_all($dids) as $value) { + $value['negavotesheight'] = $value['affirmvotesheight'] = '8px'; + if($value['affirmvotes'] || $value['negavotes']) { + $allvotes = $value['affirmvotes'] + $value['negavotes']; + $value['negavotesheight'] = round($value['negavotes']/$allvotes * 100, 2).'%'; + $value['affirmvotesheight'] = round($value['affirmvotes']/$allvotes * 100, 2).'%'; + } + if($list[$value['tid']]) { + $list[$value['tid']] = array_merge($value, $list[$value['tid']]); + } elseif($special[$value['tid']]) { + $special[$value['tid']] = array_merge($value, $special[$value['tid']]); + } + } + } + + $multi = multi($count, $perpage, $page, $theurl); + + } + +} + + +if($_G['uid']) { + if($_GET['view'] == 'all') { + $navtitle = lang('core', 'title_view_all').lang('core', 'title_debate'); + } elseif($_GET['view'] == 'me') { + $navtitle = lang('core', 'title_my_debate'); + } else { + $navtitle = lang('core', 'title_friend_debate'); + } +} else { + if($_GET['order'] == 'hot') { + $navtitle = lang('core', 'title_top_debate'); + } else { + $navtitle = lang('core', 'title_newest_debate'); + } +} + +include_once template("diy:home/space_debate"); + +?> \ No newline at end of file diff --git a/source/include/space/space_doing.php b/source/include/space/space_doing.php new file mode 100644 index 0000000..b2c2824 --- /dev/null +++ b/source/include/space/space_doing.php @@ -0,0 +1,176 @@ + 'space', + 'uid' => $space['uid'], + 'do' => 'doing', + 'view' => $_GET['view'], + 'searchkey' => $_GET['searchkey'], + 'from' => $_GET['from'] +); +$theurl = 'home.php?'.url_implode($gets); + +$f_index = ''; +$diymode = 0; +if($_GET['view'] == 'all') { + + $f_index = 'dateline'; + +} elseif($_GET['view'] == 'we') { + + space_merge($space, 'field_home'); + if($space['feedfriend']) { + $uids = array_merge(explode(',', $space['feedfriend']), array($space['uid'])); + $f_index = 'dateline'; + } else { + $uids = array($space['uid']); + } + +} else { + + if($_GET['from'] == 'space') $diymode = 1; + + $uids = $_GET['highlight'] ? array() : array($space['uid']); +} +$actives = array($_GET['view'] =>' class="a"'); + +$doid = empty($_GET['doid'])?0:intval($_GET['doid']); +$doids = $clist = $newdoids = array(); +$pricount = 0; + +if($doid) { + $count = 1; + $f_index = ''; + $theurl .= "&doid=$doid"; +} + +if($searchkey = stripsearchkey($_GET['searchkey'])) { + $searchkey = dhtmlspecialchars($searchkey); +} + +if(empty($count)) { + $count = C::t('home_doing')->fetch_all_search($start, $perpage, 3, $uids, '', $searchkey, '', '' ,'', 1, $doid, $f_index); +} +if($count) { + $query = C::t('home_doing')->fetch_all_search($start, $perpage, 1, $uids, '', $searchkey, '', '' ,'', 1, $doid, $f_index); + foreach($query as $value) { + if(!empty($value['ip'])) { + $value['ip'] = ip::to_display($value['ip']); + } + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $doids[] = $value['doid']; + $dolist[] = $value; + } else { + $pricount ++; + } + } +} + +if($doid) { + $dovalue = empty($dolist)?array():$dolist[0]; + if($dovalue) { + if($dovalue['uid'] == $_G['uid']) { + $actives = array('me'=>' class="a"'); + } else { + $actives = array('all'=>' class="a"'); + } + } +} + + +if($doids) { + + $tree = new lib_tree(); + + $values = array(); + foreach(C::t('home_docomment')->fetch_all_by_doid($doids) as $value) { + $newdoids[$value['doid']] = $value['doid']; + if(empty($value['upid'])) { + $value['upid'] = "do{$value['doid']}"; + } + if(!empty($value['ip'])) { + $value['ip'] = ip::to_display($value['ip']); + } + $tree->setNode($value['id'], $value['upid'], $value); + } +} + +$showdoinglist = array(); +foreach ($newdoids as $cdoid) { + $values = $tree->getChilds("do$cdoid"); + $show = false; + foreach ($values as $key => $id) { + $one = $tree->getValue($id); + $one['layer'] = $tree->getLayer($id) * 2 - 2; + $one['style'] = "padding-left:{$one['layer']}em;"; + if($_GET['highlight'] && $one['id'] == $_GET['highlight']) { + $one['style'] .= 'color:#F60;'; + } + if($one['layer'] > 0){ + if($one['layer']%3 == 2) { + $one['class'] = ' dtls'; + } else { + $one['class'] = ' dtll'; + } + } + if(!$show && $one['uid']) { + $show = true; + } + $clist[$cdoid][] = $one; + } + $showdoinglist[$cdoid] = $show; +} + +$multi = multi($count, $perpage, $page, $theurl); + +dsetcookie('home_diymode', $diymode); +if($_G['uid']) { + if($_GET['view'] == 'all') { + $navtitle = lang('core', 'title_view_all').lang('core', 'title_doing'); + } elseif($_GET['view'] == 'me') { + $navtitle = lang('core', 'title_doing_view_me'); + } else { + $navtitle = lang('core', 'title_me_friend_doing'); + } + $defaultstr = getdefaultdoing(); +} else { + $navtitle = lang('core', 'title_newest_doing'); +} + +if($space['username']) { + $navtitle = lang('space', 'sb_doing', array('who' => $space['username'])); +} +$metakeywords = $navtitle; +$metadescription = $navtitle; +include_once template('diy:home/space_doing'); + +?> \ No newline at end of file diff --git a/source/include/space/space_favorite.php b/source/include/space/space_favorite.php new file mode 100644 index 0000000..9143323 --- /dev/null +++ b/source/include/space/space_favorite.php @@ -0,0 +1,124 @@ +'tid', 'forum'=>'fid', 'blog'=>'blogid', 'group'=>'gid', 'album'=>'albumid', 'space'=>'uid', 'article'=>'aid'); +$_GET['type'] = isset($idtypes[$_GET['type']]) ? $_GET['type'] : 'all'; +$actives[$_GET['type']] = ' class="a"'; + +$gets = array( + 'mod' => 'space', + 'uid' => $space['uid'], + 'do' => 'favorite', + 'type' => $_GET['type'], + 'from' => $_GET['from'] +); +$theurl = 'home.php?'.url_implode($gets); + +$wherearr = $list = array(); +$favid = empty($_GET['favid'])?0:intval($_GET['favid']); +$idtype = isset($idtypes[$_GET['type']]) ? $idtypes[$_GET['type']] : ''; + +$count = C::t('home_favorite')->count_by_uid_idtype($_G['uid'], $idtype, $favid); +if($count) { + $icons = array( + 'tid'=>'thread ', + 'fid'=>'forum ', + 'blogid'=>'blog ', + 'gid'=>'group ', + 'uid'=>'space ', + 'albumid'=>'album ', + 'aid'=>'article ', + ); + $articles = array(); + foreach(C::t('home_favorite')->fetch_all_by_uid_idtype($_G['uid'], $idtype, $favid, $start,$perpage) as $value) { + $value['icon'] = isset($icons[$value['idtype']]) ? $icons[$value['idtype']] : ''; + $value['url'] = makeurl($value['id'], $value['idtype'], $value['spaceuid']); + $value['description'] = !empty($value['description']) ? nl2br($value['description']) : ''; + $list[$value['favid']] = $value; + if($value['idtype'] == 'aid') { + $articles[$value['favid']] = $value['id']; + } + } + if(!empty($articles)) { + include_once libfile('function/portal'); + $_urls = array(); + foreach(C::t('portal_article_title')->fetch_all($articles) as $aid => $article) { + $_urls[$aid] = fetch_article_url($article); + } + foreach ($articles as $favid => $aid) { + $list[$favid]['url'] = $_urls[$aid]; + } + } +} + +$multi = multi($count, $perpage, $page, $theurl); + +dsetcookie('home_diymode', $diymode); + +if(!$_GET['type']) { + $_GET['type'] = 'all'; +} +if($_GET['type'] == 'group') { + $navtitle = lang('core', 'title_group_favorite', array('gorup' => $_G['setting']['navs'][3]['navname'])); +} else { + $navtitle = lang('core', 'title_'.$_GET['type'].'_favorite'); +} + +include_once template("diy:home/space_favorite"); + +function makeurl($id, $idtype, $spaceuid=0) { + $url = ''; + switch($idtype) { + case 'tid': + $url = 'forum.php?mod=viewthread&tid='.$id; + break; + case 'fid': + $url = 'forum.php?mod=forumdisplay&fid='.$id; + break; + case 'blogid': + $url = 'home.php?mod=space&uid='.$spaceuid.'&do=blog&id='.$id; + break; + case 'gid': + $url = 'forum.php?mod=group&fid='.$id; + break; + case 'uid': + $url = 'home.php?mod=space&uid='.$id; + break; + case 'albumid': + $url = 'home.php?mod=space&uid='.$spaceuid.'&do=album&id='.$id; + break; + case 'aid': + $url = 'portal.php?mod=view&aid='.$id; + break; + } + return $url; +} + +?> \ No newline at end of file diff --git a/source/include/space/space_friend.php b/source/include/space/space_friend.php new file mode 100644 index 0000000..e62f128 --- /dev/null +++ b/source/include/space/space_friend.php @@ -0,0 +1,272 @@ +' class="a"'); + + space_merge($space, 'field_home'); + $onlinedata = array(); + $wheresql = ''; + if($_GET['type']=='near') { + $theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=near"; + if(($count = C::app()->session->count_by_ip($_G['clientip']))) { + $onlinedata = C::app()->session->fetch_all_by_ip($_G['clientip'], $start, $perpage); + } + } elseif($_GET['type']=='friend') { + $theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=friend"; + if(!empty($space['feedfriend'])) { + $onlinedata = C::app()->session->fetch_all_by_uid(explode(',', $space['feedfriend']), $start, $perpage); + } + $count = count($onlinedata); + } elseif($_GET['type']=='member') { + $theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=member"; + $wheresql = " WHERE uid>0"; + if(($count = C::app()->session->count(1))) { + $onlinedata = C::app()->session->fetch_member(1, 2, $start, $perpage); + } + } else { + $_GET['type']='all'; + $theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=all"; + if(($count = C::app()->session->count_invisible(0))) { + $onlinedata = C::app()->session->fetch_member(0, 2, $start, $perpage); + } + } + + if($count) { + + foreach($onlinedata as $value) { + if($_GET['type']=='near') { + if($value['uid'] == $space['uid']) { + $count = $count-1; + continue; + } + } + + if(!$value['invisible']) $ols[$value['uid']] = $value['lastactivity']; + $list[$value['uid']] = $value; + $fuids[$value['uid']] = $value['uid']; + } + + if($fuids) { + require_once libfile('function/friend'); + friend_check($space['uid'], $fuids); + + $fieldhome = C::t('common_member_field_home')->fetch_all($fuids); + foreach(C::t('common_member')->fetch_all($fuids) as $uid => $value) { + $value = array_merge($value, $fieldhome[$uid]); + $value['isfriend'] = $uid==$space['uid'] || $_G["home_friend_".$space['uid'].'_'.$uid] ? 1 : 0; + $list[$uid] = array_merge($list[$uid], $value); + } + } + } + $multi = multi($count, $perpage, $page, $theurl); + +} elseif($_GET['view'] == 'visitor' || $_GET['view'] == 'trace') { + + $theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view={$_GET['view']}"; + $actives = array('me'=>' class="a"'); + + if($_GET['view'] == 'visitor') { + $count = C::t('home_visitor')->count_by_uid($space['uid']); + } else { + $count = C::t('home_visitor')->count_by_vuid($space['uid']); + } + if($count) { + if($_GET['view'] == 'visitor') { + $visitors = C::t('home_visitor')->fetch_all_by_uid($space['uid'], $start, $perpage); + } else { + $visitors = C::t('home_visitor')->fetch_all_by_vuid($space['uid'], $start, $perpage); + } + foreach($visitors as $value) { + if($_GET['view'] == 'visitor') { + $value['uid'] = $value['vuid']; + $value['username'] = $value['vusername']; + } + $fuids[] = $value['uid']; + $list[$value['uid']] = $value; + } + } + $multi = multi($count, $perpage, $page, $theurl); + +} elseif($_GET['view'] == 'blacklist') { + + $theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view={$_GET['view']}"; + $actives = array('me'=>' class="a"'); + + $count = C::t('home_blacklist')->count_by_uid_buid($space['uid']); + if($count) { + $backlist = C::t('home_blacklist')->fetch_all_by_uid($space['uid'], $start,$perpage); + $members = C::t('common_member')->fetch_all(array_keys($backlist)); + foreach($backlist as $buid => $value) { + $value = array_merge($value, $members[$buid]); + $value['isfriend'] = 0; + $fuids[] = $value['uid']; + $list[$value['uid']] = $value; + } + } + $multi = multi($count, $perpage, $page, $theurl); + +} else { + + $theurl = "home.php?mod=space&uid={$space['uid']}&do=$do"; + $actives = array('me'=>' class="a"'); + + $_GET['view'] = 'me'; + + $querydata = array(); + if($space['self']) { + require_once libfile('function/friend'); + $groups = friend_group_list(); + $group = !isset($_GET['group'])?'-1':intval($_GET['group']); + if($group > -1) { + $querydata['gid'] = $group; + $theurl .= "&group=$group"; + } + } + if($_GET['searchkey']) { + require_once libfile('function/search'); + $querydata['searchkey'] = $_GET['searchkey']; + $theurl .= "&searchkey={$_GET['searchkey']}"; + } + + $count = C::t('home_friend')->fetch_all_search($space['uid'], $querydata['gid'], $querydata['searchkey'], true); + $membercount = C::t('common_member_count')->fetch($_G['uid']); + $friendnum = $membercount['friends']; + unset($membercount); + if($count) { + + $query = C::t('home_friend')->fetch_all_search($space['uid'], $querydata['gid'], $querydata['searchkey'], false, $start, $perpage, $_GET['order'] ? true : false); + foreach($query as $value) { + $value['uid'] = $value['fuid']; + $_G["home_friend_".$space['uid'].'_'.$value['uid']] = $value['isfriend'] = 1; + $fuids[$value['uid']] = $value['uid']; + $list[$value['uid']] = $value; + } + } elseif(!$friendnum) { + if(($specialuser_count = C::t('home_specialuser')->count_by_status(1))) { + foreach(C::t('home_specialuser')->fetch_all_by_status(1, 7) as $value) { + if($_G['uid'] !== $value['uid']) { + $fuids[$value['uid']] = $value['uid']; + $specialuser_list[$value['uid']] = $value; + } + if(count($fuids) >= 6) { + break; + } + } + $specialuser_list = getfollowflag($specialuser_list); + + } + if(($online_count = C::app()->session->count(1)) > 1) { + $oluids = $online_list = array(); + foreach(C::app()->session->fetch_member(1, 2, 7) as $value) { + if($value['uid'] != $_G['uid'] && count($oluids) <= 6) { + $fuids[$value['uid']] = $value['uid']; + $oluids[$value['uid']] = $value['uid']; + $online_list[$value['uid']] = $value; + } + } + $online_list = getfollowflag($online_list); + + $fieldhome = C::t('common_member_field_home')->fetch_all($oluids, false, 0); + foreach(C::t('common_member')->fetch_all($oluids, false, 0) as $uid => $value) { + $value = array_merge($value, $fieldhome[$uid]); + $online_list[$uid] = array_merge($online_list[$uid], $value); + } + + } + } + + $diymode = 1; + if($space['self'] && ($_GET['from'] != 'space' || !$_G['setting']['homepagestyle'])) $diymode = 0; + if($diymode) { + $theurl .= "&from=space"; + } + + $multi = multi($count, $perpage, $page, $theurl); + + if($space['self']) { + $groupselect = array($group => ' class="a"'); + + $maxfriendnum = checkperm('maxfriendnum'); + if($maxfriendnum) { + $maxfriendnum = checkperm('maxfriendnum') + $space['addfriend']; + } + } +} + +if($fuids) { + foreach(C::app()->session->fetch_all_by_uid($fuids) as $value) { + if(!$value['invisible']) { + $ols[$value['uid']] = $value['lastactivity']; + } elseif($list[$value['uid']] && !in_array($_GET['view'], array('me', 'trace', 'blacklist'))) { + unset($list[$value['uid']]); + $count = $count - 1; + } + } + if($_GET['view'] != 'me') { + require_once libfile('function/friend'); + friend_check($fuids); + } + if($list) { + $fieldhome = C::t('common_member_field_home')->fetch_all($fuids); + foreach(C::t('common_member')->fetch_all($fuids) as $uid => $value) { + $fieldhome_value = is_array($fieldhome[$uid]) ? $fieldhome[$uid] : array(); + $value = array_merge($value, $fieldhome_value); + $value['isfriend'] = $uid==$space['uid'] || $_G["home_friend_".$space['uid'].'_'.$uid] ? 1 : 0; + if(empty($list[$uid])) $list[$uid] = array(); + $list[$uid] = array_merge($list[$uid], $value); + } + } +} +if($list) { + $list = getfollowflag($list); +} +$navtitle = lang('core', 'title_friend_list'); + +$navtitle = lang('space', 'sb_friend', array('who' => $space['username'])); +$metakeywords = lang('space', 'sb_friend', array('who' => $space['username'])); +$metadescription = lang('space', 'sb_share', array('who' => $space['username'])); + +$a_actives = array($_GET['view'].$_GET['type'] => ' class="a"'); +include_once template("diy:home/space_friend"); + +function getfollowflag($data) { + global $_G; + if($data) { + $follows = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], array_keys($data)); + foreach($data as $uid => $value) { + $data[$uid]['follow'] = isset($follows[$uid]) ? 1 : 0; + } + } + return $data; +} +?> \ No newline at end of file diff --git a/source/include/space/space_home.php b/source/include/space/space_home.php new file mode 100644 index 0000000..ec2009d --- /dev/null +++ b/source/include/space/space_home.php @@ -0,0 +1,412 @@ + true)); +} +require_once libfile('function/feed'); + +if(empty($_G['setting']['feedhotday'])) { + $_G['setting']['feedhotday'] = 2; +} + +$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin']; + +space_merge($space, 'count'); + +if($_G['uid'] != $space['uid'] && !$_G['group']['allowviewprofile']) { + if(!$_G['uid']) { + showmessage('home_no_privilege', '', array(), array('login' => true)); + } else { + showmessage('no_privilege_profile'); + } +} + +if(empty($_GET['view'])) { + if($space['self']) { + if($_G['setting']['showallfriendnum'] && $space['friends'] < $_G['setting']['showallfriendnum']) { + $_GET['view'] = 'all'; + } else { + $_GET['view'] = 'we'; + } + } else { + $_GET['view'] = 'all'; + } +} elseif(!in_array($_GET['view'], array('we', 'me', 'all', 'app'))) { + $_GET['view'] = 'all'; +} + +$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline'; + +$perpage = $_G['setting']['feedmaxnum']<20?20:$_G['setting']['feedmaxnum']; +$perpage = mob_perpage($perpage); + +if($_GET['view'] == 'all' && $_GET['order'] == 'hot') { + $perpage = 50; +} + +$page = intval($_GET['page']); +if($page < 1) $page = 1; +$start = ($page-1)*$perpage; + +ckstart($start, $perpage); + +$_G['home_today'] = $_G['timestamp'] - ($_G['timestamp'] + $_G['setting']['timeoffset'] * 3600) % 86400; + +$gets = array( + 'mod' => 'space', + 'uid' => $space['uid'], + 'do' => 'home', + 'view' => $_GET['view'], + 'order' => $_GET['order'], + 'type' => $_GET['type'], + 'icon' => $_GET['icon'] +); +$theurl = 'home.php?'.url_implode($gets); +$hotlist = array(); +if(!IS_ROBOT) { + $feed_users = $feed_list = $user_list = $filter_list = $list = $magic = array(); + if($_GET['view'] != 'app') { + if($space['self'] && empty($start) && $_G['setting']['feedhotnum'] > 0 && ($_GET['view'] == 'we' || $_GET['view'] == 'all')) { + $hotlist_all = array(); + $hotstarttime = $_G['timestamp'] - $_G['setting']['feedhotday']*3600*24; + $query = C::t('home_feed')->fetch_all_by_hot($hotstarttime); + foreach ($query as $value) { + if($value['hot']>0 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + if(empty($hotlist)) { + $hotlist[$value['feedid']] = $value; + } else { + $hotlist_all[$value['feedid']] = $value; + } + } + } + $nexthotnum = $_G['setting']['feedhotnum'] - 1; + if($nexthotnum > 0) { + if(count($hotlist_all)> $nexthotnum) { + $hotlist_key = array_rand($hotlist_all, $nexthotnum); + if($nexthotnum == 1) { + $hotlist[$hotlist_key] = $hotlist_all[$hotlist_key]; + } else { + foreach ($hotlist_key as $key) { + $hotlist[$key] = $hotlist_all[$key]; + } + } + } else { + $hotlist = array_merge($hotlist, $hotlist_all); + } + } + } + } + + $need_count = true; + $uids = array(); + $multi = $hot = ''; + + if($_GET['view'] == 'all') { + + if($_GET['order'] == 'dateline') { + $ordersql = "dateline DESC"; + $f_index = ''; + $findex = ''; + $orderactives = array('dateline' => ' class="a"'); + } else { + $hot = $minhot; + $ordersql = "dateline DESC"; + $f_index = ''; + $findex = ''; + $orderactives = array('hot' => ' class="a"'); + } + + } elseif($_GET['view'] == 'me') { + + $uids = array($space['uid']); + $ordersql = "dateline DESC"; + $f_index = ''; + $findex = ''; + + $diymode = 1; + if($space['self'] && $_GET['from'] != 'space') $diymode = 0; + + } else { + + space_merge($space, 'field_home'); + + if(empty($space['feedfriend'])) { + $need_count = false; + } else { + $uids = array_merge(explode(',', $space['feedfriend']), array(0)); + $ordersql = "dateline DESC"; + $f_index = 'USE INDEX(dateline)'; + $findex = 'dateline'; + } + } + + $icon = empty($_GET['icon'])?'':trim($_GET['icon']); + $gid = !isset($_GET['gid'])?'-1':intval($_GET['gid']); + if($gid>=0) { + $fuids = array(); + $query = C::t('home_friend')->fetch_all_by_uid_gid($_G['uid'], $gid); + foreach($query as $value) { + $fuids[] = $value['fuid']; + } + if(empty($fuids)) { + $need_count = false; + } else { + $uids = $fuids; + } + } + $gidactives[$gid] = ' class="a"'; + + $count = $filtercount = 0; + + if($need_count) { + + $query = C::t('home_feed')->fetch_all_by_search(1, $uids, $icon, '', '', '', $hot, '', $start, $perpage, $findex); + + if($_GET['view'] == 'me') { + foreach ($query as $value) { + if(!isset($hotlist[$value['feedid']]) && !isset($hotlist_all[$value['feedid']]) && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + $value = mkfeed($value); + + if($value['dateline']>=$_G['home_today']) { + $list['today'][] = $value; + } elseif ($value['dateline']>=$_G['home_today']-3600*24) { + $list['yesterday'][] = $value; + } else { + $theday = dgmdate($value['dateline'], 'Y-m-d'); + $list[$theday][] = $value; + } + } + $count++; + } + } else { + $hash_datas = array(); + $more_list = array(); + $uid_feedcount = array(); + + foreach($query as $value) { + if(!isset($hotlist[$value['feedid']]) && !isset($hotlist_all[$value['feedid']]) && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + $value = mkfeed($value); + if(ckicon_uid($value)) { + + if($value['dateline']>=$_G['home_today']) { + $dkey = 'today'; + } elseif ($value['dateline']>=$_G['home_today']-3600*24) { + $dkey = 'yesterday'; + } else { + $dkey = dgmdate($value['dateline'], 'Y-m-d'); + } + + $maxshownum = 3; + if(empty($value['uid'])) $maxshownum = 10; + + if(empty($value['hash_data'])) { + if(empty($feed_users[$dkey][$value['uid']])) $feed_users[$dkey][$value['uid']] = $value; + if(empty($uid_feedcount[$dkey][$value['uid']])) $uid_feedcount[$dkey][$value['uid']] = 0; + + $uid_feedcount[$dkey][$value['uid']]++; + + if($uid_feedcount[$dkey][$value['uid']]>$maxshownum) { + $more_list[$dkey][$value['uid']][] = $value; + } else { + $feed_list[$dkey][$value['uid']][] = $value; + } + + } elseif(empty($hash_datas[$value['hash_data']])) { + $hash_datas[$value['hash_data']] = 1; + if(empty($feed_users[$dkey][$value['uid']])) $feed_users[$dkey][$value['uid']] = $value; + if(empty($uid_feedcount[$dkey][$value['uid']])) $uid_feedcount[$dkey][$value['uid']] = 0; + + + $uid_feedcount[$dkey][$value['uid']] ++; + + if($uid_feedcount[$dkey][$value['uid']]>$maxshownum) { + $more_list[$dkey][$value['uid']][] = $value; + } else { + $feed_list[$dkey][$value['uid']][$value['hash_data']] = $value; + } + + } else { + $user_list[$value['hash_data']][] = "{$value['username']}"; + } + + + } else { + $filtercount++; + $filter_list[] = $value; + } + } + $count++; + } + } + + $multi = simplepage($count, $perpage, $page, $theurl); + } +} + +$olfriendlist = $visitorlist = $task = $ols = $birthlist = $guidelist = array(); +$oluids = array(); +$groups = array(); +$defaultusers = $newusers = $showusers = array(); + +if($space['self'] && empty($start)) { + + space_merge($space, 'field_home'); + if($_GET['view'] == 'we') { + require_once libfile('function/friend'); + $groups = friend_group_list(); + } + + $isnewer = ($_G['timestamp']-$space['regdate'] > 3600*24*7) ?0:1; + if($isnewer && $_G['setting']['homestyle']) { + + $friendlist = array(); + $query = C::t('home_friend')->fetch_all($space['uid']); + foreach($query as $value) { + $friendlist[$value['fuid']] = 1; + } + + foreach(C::t('home_specialuser')->fetch_all_by_status(1) as $value) { + if(empty($friendlist[$value['uid']])) { + $defaultusers[] = $value; + $oluids[] = $value['uid']; + } + } + } + + if($space['newprompt']) { + space_merge($space, 'status'); + } + + if($_G['setting']['homestyle']) { + foreach(C::t('home_visitor')->fetch_all_by_uid($space['uid'], 12) as $value) { + $visitorlist[$value['vuid']] = $value; + $oluids[] = $value['vuid']; + } + + if($oluids) { + foreach(C::app()->session->fetch_all_by_uid($oluids) as $value) { + if(!$value['invisible']) { + $ols[$value['uid']] = 1; + } elseif ($visitorlist[$value['uid']]) { + unset($visitorlist[$value['uid']]); + } + } + } + + $oluids = array(); + $olfcount = 0; + if($space['feedfriend']) { + foreach(C::app()->session->fetch_all_by_uid(explode(',', $space['feedfriend']), 15) as $value) { + if($olfcount < 15 && !$value['invisible']) { + $olfriendlist[$value['uid']] = $value; + $ols[$value['uid']] = 1; + $oluids[$value['uid']] = $value['uid']; + $olfcount++; + } + } + } + if($olfcount < 15) { + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 32, true); + foreach($query as $value) { + $value['uid'] = $value['fuid']; + $value['username'] = $value['fusername']; + if(empty($oluids[$value['uid']])) { + $olfriendlist[$value['uid']] = $value; + $olfcount++; + if($olfcount == 15) break; + } + } + } + + if($space['feedfriend']) { + $birthdaycache = C::t('forum_spacecache')->fetch_spacecache($_G['uid'], 'birthday'); + if(empty($birthdaycache) || TIMESTAMP > $birthdaycache['expiration']) { + $birthlist = C::t('common_member_profile')->fetch_all_will_birthday_by_uid($space['feedfriend']); + + C::t('forum_spacecache')->insert(array( + 'uid' => $_G['uid'], + 'variable' => 'birthday', + 'value' => serialize($birthlist), + 'expiration' => getexpiration(), + ), false, true); + } else { + $birthlist = dunserialize($birthdaycache['value']); + } + } + + if($_G['setting']['taskstatus']) { + require_once libfile('class/task'); + $tasklib = & task::instance(); + $taskarr = $tasklib->tasklist('canapply'); + $task = count($taskarr) ? $taskarr[array_rand($taskarr)] : array(); + } + if($_G['setting']['magicstatus']) { + loadcache('magics'); + if(!empty($_G['cache']['magics'])) { + $magic = $_G['cache']['magics'][array_rand($_G['cache']['magics'])]; + $magic['description'] = cutstr($magic['description'], 34, ''); + $magic['pic'] = strtolower($magic['identifier']).'.gif'; + } + } + } +} elseif(empty($_G['uid'])) { + $defaultusers = C::t('home_specialuser')->fetch_all_by_status(1, 12); + + $query = C::t('home_show')->fetch_all_by_credit(0, 12); //DB::query("SELECT * FROM ".DB::table('home_show')." ORDER BY credit DESC LIMIT 0,12"); + foreach($query as $value) { + $showusers[] = $value; + } + + foreach(C::t('common_member')->range(0, 12,'DESC') as $uid => $value) { + $value['regdate'] = dgmdate($value['regdate'], 'u', 9999, 'm-d'); + $newusers[$uid] = $value; + } +} + +dsetcookie('home_readfeed', $_G['timestamp'], 365*24*3600); +if($_G['uid']) { + $defaultstr = getdefaultdoing(); + space_merge($space, 'status'); + if(!$space['profileprogress']) { + include_once libfile('function/profile'); + $space['profileprogress'] = countprofileprogress(); + } +} +$actives = array($_GET['view'] => ' class="a"'); +if($_GET['from'] == 'space') { + if($_GET['do'] == 'home') { + $navtitle = lang('space', 'sb_feed', array('who' => $space['username'])); + $metakeywords = lang('space', 'sb_feed', array('who' => $space['username'])); + $metadescription = lang('space', 'sb_feed', array('who' => $space['username'])); + } +} else { + list($navtitle, $metadescription, $metakeywords) = get_seosetting('home'); + if(!$navtitle) { + $navtitle = $_G['setting']['navs'][4]['navname']; + $nobbname = false; + } else { + $nobbname = true; + } + + if(!$metakeywords) { + $metakeywords = $_G['setting']['navs'][4]['navname']; + } + + if(!$metadescription) { + $metadescription = $_G['setting']['navs'][4]['navname']; + } +} +if(empty($cp_mode)) include_once template("diy:home/space_home"); + +?> \ No newline at end of file diff --git a/source/include/space/space_index.php b/source/include/space/space_index.php new file mode 100644 index 0000000..6cf3f0c --- /dev/null +++ b/source/include/space/space_index.php @@ -0,0 +1,93 @@ + 1)); + $viewuids[$space['uid']] = $space['uid']; + dsetcookie('viewid', 'uid_'.$space['uid']); + } + + show_view(); + + if($_GET['additional'] == 'removevlog') { + C::t('home_visitor')->delete_by_uid_vuid($space['uid'], $_G['uid']); + } + + if($do != 'profile' && !ckprivacy($do, 'view')) { + $_G['privacy'] = 1; + require_once libfile('space/profile', 'include'); + include template('home/space_privacy'); + exit(); + } + + $widths = getlayout($userdiy['currentlayout']); + $leftlist = formatdata($userdiy, 'left', $space); + $centerlist = formatdata($userdiy, 'center', $space); + $rightlist = formatdata($userdiy, 'right', $space); + + dsetcookie('home_diymode', 1); +} + +$navtitle = !empty($space['spacename']) ? $space['spacename'] : lang('space', 'sb_space', array('who' => $space['username'])); +$metakeywords = lang('space', 'sb_space', array('who' => $space['username'])); +$metadescription = lang('space', 'sb_space', array('who' => $space['username'])); +$space['medals'] = getuserprofile('medals'); +if($space['medals']) { + loadcache('medals'); + foreach($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) { + list($medalid, $medalexpiration) = explode("|", $medalid); + if(isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) { + $space['medals'][$key] = $_G['cache']['medals'][$medalid]; + } else { + unset($space['medals'][$key]); + } + } +} +include_once(template('home/space_index')); + +function formatdata($data, $position, $space) { + $list = array(); + foreach ((array)$data['block']['frame`frame1']['column`frame1_'.$position] as $blockname => $blockdata) { + if (strpos($blockname, 'block`') === false || empty($blockdata) || !isset($blockdata['attr']['name'])) continue; + $name = $blockdata['attr']['name']; + if(check_ban_block($name, $space)) { + $list[$name] = getblockhtml($name, $data['parameters'][$name]); + } + } + return $list; +} + +?> \ No newline at end of file diff --git a/source/include/space/space_notice.php b/source/include/space/space_notice.php new file mode 100644 index 0000000..87f8279 --- /dev/null +++ b/source/include/space/space_notice.php @@ -0,0 +1,118 @@ +' class="a"'); +$opactives[$view] = 'class="a"'; +$categorynum = $newprompt = array(); +if($view) { + + if(!empty($_GET['ignore'])) { + C::t('home_notification')->ignore($_G['uid']); + } + + foreach (array('wall', 'piccomment', 'blogcomment', 'clickblog', 'clickpic', 'sharecomment', 'doing', 'friend', 'credit', 'bbs', 'system', 'thread', 'task', 'group') as $key) { + $noticetypes[$key] = lang('notification', "type_$key"); + } + + $isread = in_array($_GET['isread'], array(0, 1)) ? intval($_GET['isread']) : 0; + $category = $type = ''; + if(isset($_G['notice_structure'][$view])) { + if(!in_array($view, array('mypost', 'interactive'))) { + $category = $view; + } else { + $deftype = $_G['notice_structure'][$view][0]; + if($_G['member']['newprompt_num']) { + foreach($_G['notice_structure'][$view] as $subtype) { + if($_G['member']['newprompt_num'][$subtype]) { + $deftype = $subtype; + break; + } + } + } + $type = in_array($_GET['type'], $_G['notice_structure'][$view]) ? trim($_GET['type']) : $deftype; + } + } + $wherearr = array(); + $new = -1; + if(!empty($type)) { + $wherearr[] = "`type`='$type'"; + } + + $sql = ' AND '.implode(' AND ', $wherearr); + + + $newnotify = false; + $count = C::t('home_notification')->count_by_uid($_G['uid'], $new, $type, $category); + if($count) { + if($new == 1 && $perpage == 30) { + $perpage = 200; + } + foreach(C::t('home_notification')->fetch_all_by_uid($_G['uid'], $new, $type, $start, $perpage, $category) as $value) { + if($value['new']) { + $newnotify = true; + $value['style'] = 'color:#000;font-weight:bold;'; + } else { + $value['style'] = ''; + } + $value['rowid'] = ''; + if(in_array($value['type'], array('friend', 'poke'))) { + $value['rowid'] = ' id="'.($value['type'] == 'friend' ? 'pendingFriend_' : 'pokeQuery_').$value['authorid'].'" '; + } + if($value['from_num'] > 0) $value['from_num'] = $value['from_num'] - 1; + $list[$value['id']] = $value; + } + + $multi = ''; + $multi = multi($count, $perpage, $page, "home.php?mod=space&do=$do&view=$view&type=$type&isread=1"); + } + + if($newnotify) { + C::t('home_notification')->ignore($_G['uid'], $type, $category, true, true); + } + helper_notification::update_newprompt($_G['uid'], ($type ? $type : $category)); + if($_G['member']['newprompt']) { + $recountprompt = 0; + foreach($_G['member']['category_num'] as $promptnum) { + $recountprompt += $promptnum; + } + $recountprompt += $mynotice; + if($recountprompt == 0) { + C::t('common_member')->update($_G['uid'], array('newprompt' => 0)); + } + } + + $readtag = array($type => ' class="a"'); + + +} +dsetcookie('promptstate_'.$_G['uid'], '', 31536000); +include_once template("diy:home/space_notice"); + +?> \ No newline at end of file diff --git a/source/include/space/space_plugin.php b/source/include/space/space_plugin.php new file mode 100644 index 0000000..debee23 --- /dev/null +++ b/source/include/space/space_plugin.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/source/include/space/space_pm.php b/source/include/space/space_pm.php new file mode 100644 index 0000000..33afd97 --- /dev/null +++ b/source/include/space/space_pm.php @@ -0,0 +1,213 @@ +fetch_all($chatpmmember['member']); + foreach(C::t('common_member_field_home')->fetch_all($chatpmmember['member']) as $uid => $member) { + $chatpmmemberlist[$uid] = array_merge($member, $chatpmmemberlist[$uid]); + } + } + require_once libfile('function/friend'); + $friendgrouplist = friend_group_list(); + $actives = array('chatpmmember'=>' class="a"'); + } else { + if($touid) { + $ols = array(); + if(defined('IN_MOBILE')) { + $perpage = 5; + } else { + $perpage = 10; + } + $perpage = mob_perpage($perpage); + if(!$daterange) { + $member = getuserbyuid($touid); + $tousername = $member['username']; + unset($member); + $count = uc_pm_view_num($_G['uid'], $touid, 0); + if(!$page) { + $page = ceil($count/$perpage); + } + $list = uc_pm_view($_G['uid'], 0, $touid, 5, ceil($count/$perpage)-$page+1, $perpage, 0, 0); + $multi = pmmulti($count, $perpage, $page, "home.php?mod=space&do=pm&subop=view&touid=$touid"); + } else { + showmessage('parameters_error'); + } + } else { + if(defined('IN_MOBILE')) { + $perpage = 10; + } else { + $perpage = 50; + } + $perpage = mob_perpage($perpage); + $count = uc_pm_view_num($_G['uid'], $plid, 1); + if(!$daterange) { + if(!$page) { + $page = ceil($count/$perpage); + } + $list = uc_pm_view($_G['uid'], 0, $plid, 5, ceil($count/$perpage)-$page+1, $perpage, $type, 1); + $multi = pmmulti($count, $perpage, $page, "home.php?mod=space&do=pm&subop=view&plid=$plid&type=$type"); + } else { + $list = uc_pm_view($_G['uid'], 0, $plid, 5, ceil($count/$perpage)-$page+1, $perpage, $type, 1); + $chatpmmember = uc_pm_chatpmmemberlist($_G['uid'], $plid); + if(!empty($chatpmmember)) { + $authorid = $founderuid = $chatpmmember['author']; + $chatpmmemberlist = C::t('common_member')->fetch_all($chatpmmember['member']); + foreach(C::t('common_member_field_home')->fetch_all($chatpmmember['member']) as $uid => $member) { + $chatpmmemberlist[$uid] = array_merge($member, $chatpmmemberlist[$uid]); + } + foreach(C::app()->session->fetch_all_by_uid($chatpmmember['member']) as $value) { + if(!$value['invisible']) { + $ols[$value['uid']] = $value['lastactivity']; + } + } + } + $membernum = count($chatpmmemberlist); + $subject = $list[0]['subject']; + $refreshtime = $_G['setting']['chatpmrefreshtime']; + + } + } + $founderuid = empty($list)?0:$list[0]['founderuid']; + $pmid = empty($list)?0:$list[0]['pmid']; + } + $actives['privatepm'] = ' class="a"'; + +} elseif($_GET['subop'] == 'viewg') { + + $grouppm = C::t('common_grouppm')->fetch($_GET['pmid']); + if(!$grouppm) { + $grouppm = array_merge((array)C::t('common_member_grouppm')->fetch_gpm($_G['uid'], $_GET['pmid']), $grouppm); + } + if($grouppm) { + $grouppm['numbers'] = $grouppm['numbers'] - 1; + } + if(!$grouppm['status']) { + C::t('common_member_grouppm')->update($_G['uid'], $_GET['pmid'], array('status' => 1, 'dateline' => TIMESTAMP)); + } + $actives['announcepm'] = ' class="a"'; + +} elseif($_GET['subop'] == 'ignore') { + + $ignorelist = uc_pm_blackls_get($_G['uid']); + $actives = array('ignore'=>' class="a"'); + +} elseif($_GET['subop'] == 'setting') { + + $actives = array('setting'=>' class="a"'); + $acceptfriendpmstatus = $_G['member']['onlyacceptfriendpm'] ? $_G['member']['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2); + $ignorelist = uc_pm_blackls_get($_G['uid']); + +} else { + + $filter = in_array($_GET['filter'], array('newpm', 'privatepm', 'announcepm')) ? $_GET['filter'] : 'privatepm'; + + $perpage = 15; + $perpage = mob_perpage($perpage); + + $page = empty($_GET['page'])?0:intval($_GET['page']); + if($page<1) $page = 1; + + $grouppms = $gpmids = $gpmstatus = array(); + $newpm = $newpmcount = 0; + + if($filter == 'privatepm' && $page == 1 || $filter == 'announcepm' || $filter == 'newpm') { + $announcepm = 0; + foreach(C::t('common_member_grouppm')->fetch_all_by_uid($_G['uid'], $filter == 'announcepm' ? 1 : 0) as $gpmid => $gpuser) { + $gpmstatus[$gpmid] = $gpuser['status']; + if($gpuser['status'] == 0) { + $announcepm ++; + } + } + $gpmids = array_keys($gpmstatus); + if($gpmids) { + foreach(C::t('common_grouppm')->fetch_all_by_id_authorid($gpmids) as $grouppm) { + $grouppm['message'] = cutstr(strip_tags($grouppm['message']), 100, ''); + $grouppms[] = $grouppm; + } + } + } + + if($filter == 'privatepm' || $filter == 'newpm') { + $result = uc_pm_list($_G['uid'], $page, $perpage, 'inbox', $filter, 200); + $count = $result['count']; + $list = $result['data']; + } + + if($filter == 'privatepm' && $page == 1 || $filter == 'newpm') { + $newpmarr = uc_pm_checknew($_G['uid'], 1); + $newpm = $newpmarr['newpm']; + } + $newpmcount = $newpm + $announcepm; + if($_G['member']['newpm']) { + C::t('common_member')->update($_G['uid'], array('newpm' => 0)); + uc_pm_ignore($_G['uid']); + } + $multi = multi($count, $perpage, $page, "home.php?mod=space&do=pm&filter=$filter", 0, 5); + $actives = array($filter=>' class="a"'); +} + +if(!empty($list)) { + $today = $_G['timestamp'] - ($_G['timestamp'] + $_G['setting']['timeoffset'] * 3600) % 86400; + foreach ($list as $key => $value) { + $value['lastsummary'] = str_replace('&', '&', $value['lastsummary']); + $value['lastsummary'] = preg_replace("/&[a-z]+\;/i", '', $value['lastsummary']); + $value['daterange'] = 5; + if($value['lastdateline'] >= $today) { + $value['daterange'] = 1; + } elseif($value['lastdateline'] >= $today - 86400) { + $value['daterange'] = 2; + } elseif($value['lastdateline'] >= $today - 172800) { + $value['daterange'] = 3; + } elseif($value['lastdateline'] >= $today - 604800) { + $value['daterange'] = 4; + } + $list[$key] = $value; + } +} +include_once template("diy:home/space_pm"); + +function pmmulti($count, $perpage, $curpage, $mpurl) { + $return = ''; + $lang['next'] = lang('core', 'nextpage'); + $lang['prev'] = lang('core', 'prevpage'); + $next = $curpage < ceil($count/$perpage) ? ''.$lang['next'].'' : ''; + $prev = $curpage > 1 ? ''.$lang['prev'].'' : ''; + if($next || $prev) { + $return = '
          '.$prev.$next.'
          '; + } + return $return; +} + +?> \ No newline at end of file diff --git a/source/include/space/space_poll.php b/source/include/space/space_poll.php new file mode 100644 index 0000000..bdbfca8 --- /dev/null +++ b/source/include/space/space_poll.php @@ -0,0 +1,146 @@ + 'space', + 'uid' => $space['uid'], + 'do' => 'poll', + 'view' => $_GET['view'], + 'order' => $_GET['order'], + 'fuid' => $_GET['fuid'], + 'filter' => $_GET['filter'], + 'searchkey' => $_GET['searchkey'] +); +$theurl = 'home.php?'.url_implode($gets); +$multi = ''; + +$f_index = ''; +$ordersql = 't.dateline DESC'; +$need_count = true; +$join = $authorid = $replies = 0; +$displayorder = null; +$subject = ''; + +if($_GET['view'] == 'me') { + + $filter = in_array($_GET['filter'], array('publish', 'join')) ? $_GET['filter'] : 'publish'; + if($filter == 'join') { + $join = true; + $authorid = $space['uid']; + } else { + $authorid = $space['uid']; + } + $filteractives = array($filter => ' class="a"'); + +} else { + + space_merge($space, 'field_home'); + + if($space['feedfriend']) { + + $fuid_actives = array(); + + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid, $space['uid'])) { + $authorid = $fuid; + $fuid_actives = array($fuid=>' selected'); + } else { + $authorid = explode(',', $space['feedfriend']); + $theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we"; + } + + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true); + foreach($query as $value) { + $userlist[] = $value; + } + } else { + $need_count = false; + } +} + +$actives = array($_GET['view'] =>' class="a"'); + +if($need_count) { + + + if($_GET['view'] != 'me') { + $displayorder = 0; + } + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $subject = $searchkey; + $searchkey = dhtmlspecialchars($searchkey); + } + + $count = C::t('forum_thread')->count_by_special(1, $authorid, $replies, $displayorder, $subject, $join); + if($count) { + + loadcache('forums'); + $tids = array(); + require_once libfile('function/misc'); + foreach(C::t('forum_thread')->fetch_all_by_special(1, $authorid, $replies, $displayorder, $subject, $join, $start, $perpage) as $value) { + if(empty($value['author']) && $value['authorid'] != $_G['uid']) { + $hiddennum++; + continue; + } + $tids[$value['tid']] = $value['tid']; + $list[$value['tid']] = procthread($value); + } + if($tids) { + $query = C::t('forum_poll')->fetch_all($tids); + foreach($query as $value) { + $value['pollpreview'] = explode("\t", trim($value['pollpreview'])); + $list[$value['tid']]['poll'] = $value; + } + } + + $multi = multi($count, $perpage, $page, $theurl); + } + + +} + +if($_G['uid']) { + $_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view']; + $navtitle = lang('core', 'title_'.$_GET['view'].'_poll'); +} else { + $_GET['order'] = !$_GET['order'] ? 'dateline' : $_GET['order']; + $navtitle = lang('core', 'title_'.$_GET['order'].'_poll'); +} + +$actives = array($_GET['view'] => ' class="a"'); +include_once template("diy:home/space_poll"); + +?> \ No newline at end of file diff --git a/source/include/space/space_profile.php b/source/include/space/space_profile.php new file mode 100644 index 0000000..de29eb6 --- /dev/null +++ b/source/include/space/space_profile.php @@ -0,0 +1,198 @@ + true)); +} + +require_once libfile('function/spacecp'); + +$inarchive = isset($space['_inarchive']) && $space['_inarchive']; +space_merge($space, 'count', $inarchive); +space_merge($space, 'field_home', $inarchive); +space_merge($space, 'field_forum', $inarchive); +space_merge($space, 'profile', $inarchive); +space_merge($space, 'status', $inarchive); +getonlinemember(array($space['uid'])); + +if($_G['uid'] != $space['uid'] && !$_G['group']['allowviewprofile']) { + if(!$_G['uid']) { + showmessage('home_no_privilege', '', array(), array('login' => true)); + } else { + showmessage('no_privilege_profile'); + } +} + +$space['admingroup'] = $_G['cache']['usergroups'][$space['adminid']]; +$space['admingroup']['icon'] = g_icon($space['adminid'], 1); + +$space['group'] = $_G['cache']['usergroups'][$space['groupid']]; +$space['group']['icon'] = g_icon($space['groupid'], 1); +$encodeusername = rawurlencode($space['username']); + +if($space['extgroupids']) { + $newgroup = array(); + $e_ids = explode("\t", $space['extgroupids']); + foreach ($e_ids as $e_id) { + $newgroup[] = $_G['cache']['usergroups'][$e_id]['grouptitle']; + } + $space['extgroupids'] = implode(',', $newgroup); +} + +$space['regdate'] = dgmdate($space['regdate']); +if($space['lastvisit']) $space['lastvisit'] = dgmdate($space['lastvisit']); +if($space['lastactivity']) { + $space['lastactivitydb'] = $space['lastactivity']; + $space['lastactivity'] = dgmdate($space['lastactivity']); +} +if($space['lastpost']) $space['lastpost'] = dgmdate($space['lastpost']); +if($space['lastsendmail']) $space['lastsendmail'] = dgmdate($space['lastsendmail']); + + +if($_G['uid'] == $space['uid'] || getglobal('group/allowviewip')) { + $space['regip_loc'] = ip::convert($space['regip']); + $space['lastip_loc'] = ip::convert($space['lastip']); + $space['regip'] = ip::to_display($space['regip']); + $space['lastip'] = ip::to_display($space['lastip']); +} + +$space['buyerrank'] = 0; +if($space['buyercredit']){ + foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) { + if($space['buyercredit'] <= $credit) { + $space['buyerrank'] = $level; + break; + } + } +} + +$space['sellerrank'] = 0; +if($space['sellercredit']){ + foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) { + if($space['sellercredit'] <= $credit) { + $space['sellerrank'] = $level; + break; + } + } +} + +$space['attachsize'] = formatsize($space['attachsize']); + +$space['timeoffset'] = empty($space['timeoffset']) ? '9999' : $space['timeoffset']; +if(strtotime($space['regdate']) + $space['oltime'] * 3600 > TIMESTAMP) { + $space['oltime'] = 0; +} +require_once libfile('function/friend'); +$isfriend = friend_check($space['uid'], 1); +if(!$_G['adminid']){ + if(getglobal('setting/privacy/view/profile') == 1 && !$isfriend && !$space['self']) { + showmessage('specified_user_is_not_your_friend', '', array(), array()); + } + if(getglobal('setting/privacy/view/profile') == 2 && !$space['self']) { + showmessage('is_blacklist', '', array(), array()); + } +} +loadcache('profilesetting'); +include_once libfile('function/profile'); +$profiles = array(); +$privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array(); + +if($_G['setting']['verify']['enabled']) { + space_merge($space, 'verify'); +} +foreach($_G['cache']['profilesetting'] as $fieldid => $field) { + if($_G['setting']['nsprofiles']) { + break; + } + if(!$field['available'] || in_array($fieldid, array('birthcountry', 'birthprovince', 'birthdist', 'birthcommunity', 'residecountry', 'resideprovince', 'residedist', 'residecommunity'))) { + continue; + } + if( + $field['available'] && (strlen($space[$fieldid]) > 0 || ($fieldid == 'birthcity' && strlen($space['birthcountry']) && strlen($space['birthprovince']) || $fieldid == 'residecity' && strlen($space['residecountry']) && strlen($space['resideprovince']))) && + ($space['self'] || empty($privacy[$fieldid]) || ($isfriend && $privacy[$fieldid] == 1)) && + (!$_G['inajax'] && !$field['invisible'] || $_G['inajax'] && $field['showincard']) + ) { + $val = profile_show($fieldid, $space); + if($val !== false) { + if($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) { + continue; + } + if($field['formtype'] == 'file' && $val) { + $imgurl = getglobal('setting/attachurl').'./profile/'.$val; + $val = ''; + } + if($val == '') $val = '-'; + $profiles[$fieldid] = array('title'=>$field['title'], 'value'=>$val); + } + } +} + +$count = C::t('forum_moderator')->count_by_uid($space['uid']); +if($count) { + foreach(C::t('forum_moderator')->fetch_all_by_uid($space['uid']) as $result) { + $moderatefids[] = $result['fid']; + } + $query = C::t('forum_forum')->fetch_all_info_by_fids($moderatefids); + foreach($query as $result) { + $manage_forum[$result['fid']] = $result['name']; + } +} + +if(!$_G['inajax'] && $_G['setting']['groupstatus']) { + $groupcount = C::t('forum_groupuser')->fetch_all_group_for_user($space['uid'], 1); + if($groupcount > 0) { + $fids = C::t('forum_groupuser')->fetch_all_fid_by_uids($space['uid']); + $usergrouplist = C::t('forum_forum')->fetch_all_info_by_fids($fids); + } +} + +if($space['medals']) { + loadcache('medals'); + foreach($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) { + list($medalid, $medalexpiration) = explode("|", $medalid); + if(isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) { + $space['medals'][$key] = $_G['cache']['medals'][$medalid]; + $space['medals'][$key]['medalid'] = $medalid; + } else { + unset($space['medals'][$key]); + } + } +} +$upgradecredit = $space['uid'] && $space['group']['type'] == 'member' && $space['group']['creditslower'] != 9999999 ? $space['group']['creditslower'] - $space['credits'] : false; +$allowupdatedoing = $space['uid'] == $_G['uid'] && checkperm('allowdoing'); + +dsetcookie('home_diymode', 1); + +$navtitle = lang('space', 'sb_profile', array('who' => $space['username'])); +$metakeywords = lang('space', 'sb_profile', array('who' => $space['username'])); +$metadescription = lang('space', 'sb_profile', array('who' => $space['username'])); + +$clist = array(); +if(in_array($_G['adminid'], array(1, 2, 3))) { + include_once libfile('function/member'); + $clist = crime('getactionlist', $space['uid']); +} + +show_view(); + +if(!getglobal('privacy')) { + if(!$_G['inajax']) { + include_once template("home/space_profile"); + } else { + $_GET['do'] = 'card'; + if(helper_access::check_module('follow')) { + $follow = C::t('home_follow')->fetch_by_uid_followuid($_G['uid'], $space['uid']); + } + include_once template("home/space_card"); + } +} +?> \ No newline at end of file diff --git a/source/include/space/space_reward.php b/source/include/space/space_reward.php new file mode 100644 index 0000000..e9c3d9d --- /dev/null +++ b/source/include/space/space_reward.php @@ -0,0 +1,140 @@ + 'space', + 'uid' => $space['uid'], + 'do' => 'reward', + 'view' => $_GET['view'], + 'order' => $_GET['order'], + 'flag' => $_GET['flag'], + 'type' => $_GET['type'], + 'fuid' => $_GET['fuid'], + 'searchkey' => $_GET['searchkey'] +); +$theurl = 'home.php?'.url_implode($gets); +$multi = ''; + +$conditions['special'] = 3; +$conditions['specialthread'] = 1; + +$f_index = ''; +$ordersql = 't.dateline DESC'; +$need_count = true; +require_once libfile('function/misc'); +if($_GET['view'] == 'me') { + $conditions = array('authorid' => $space['uid'], 'special' => 3, 'specialthread' => 1); +} else { + + space_merge($space, 'field_home'); + if($space['feedfriend']) { + $fuid_actives = array(); + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid, $space['uid'])) { + $conditions = array('authorid' => $fuid, 'special' => 3, 'specialthread' => 1); + $fuid_actives = array($fuid=>' selected'); + } else { + $conditions['authorid'] = explode(',', $space['feedfriend']); + } + + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true); + foreach($query as $value) { + $userlist[] = $value; + } + } else { + $need_count = false; + } +} + +$actives = array($_GET['view'] =>' class="a"'); + +if($need_count) { + + if($_GET['view'] != 'me') { + $conditions['sticky'] = 0; + } + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $conditions['keywords'] = $searchkey; + $searchkey = dhtmlspecialchars($searchkey); + } + + if($_GET['flag'] < 0) { + $wheresql .= " AND t.price < '0'"; + $conditions['pricesless'] = 0; + $alltype .= '1'; + } elseif($_GET['flag'] > 0) { + $wheresql .= " AND t.price > '0'"; + $conditions['pricemore'] = 0; + $alltype .= '0'; + } + + + $count = C::t('forum_thread')->count_search($conditions); + if($count) { + + foreach(C::t('forum_thread')->fetch_all_search($conditions, 0, $start, $perpage, 'dateline') as $value) { + if(empty($value['author']) && $value['authorid'] != $_G['uid']) { + $hiddennum++; + continue; + } + $list[] = procthread($value); + } + $multi = multi($count, $perpage, $page, $theurl); + + } + +} + +$creditid = 0; +if($_G['setting']['creditstransextra'][2]) { + $creditid = intval($_G['setting']['creditstransextra'][2]); +} elseif ($_G['setting']['creditstrans']) { + $creditid = intval($_G['setting']['creditstrans']); +} + +if($_G['uid']) { + $_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view']; + $navtitle = lang('core', 'title_'.$_GET['view'].'_reward'); +} else { + $_GET['order'] = !$_GET['order'] ? 'dateline' : $_GET['order']; + $navtitle = lang('core', 'title_'.$_GET['order'].'_reward'); +} + +include_once template("diy:home/space_reward"); + +?> \ No newline at end of file diff --git a/source/include/space/space_share.php b/source/include/space/space_share.php new file mode 100644 index 0000000..3dde5dd --- /dev/null +++ b/source/include/space/space_share.php @@ -0,0 +1,142 @@ +fetch_by_sid_uid($id, $space['uid']); + if(empty($share)) { + showmessage('share_does_not_exist'); + } + + require_once libfile('function/share'); + $share = mkshare($share); + + $perpage = 50; + $start = ($page-1)*$perpage; + + ckstart($start, $perpage); + + $list = array(); + $cid = empty($_GET['cid'])?0:intval($_GET['cid']); + $csql = $cid?"cid='$cid' AND":''; + + $count = C::t('home_comment')->count_by_id_idtype($id, 'sid', $cid); + + if($count) { + $query = C::t('home_comment')->fetch_all_by_id_idtype($id, 'sid', $start, $perpage, $cid); + foreach($query as $value) { + $list[] = $value; + } + $multi = multi($count, $perpage, $page, "home.php?mod=space&uid={$share['uid']}&do=share&id=$id", '', 'comment_ul'); + } + $diymode = intval($_G['cookie']['home_diymode']); + } + include_once template("diy:home/space_share_view"); + +} else { + + $perpage = 20; + + $start = ($page-1)*$perpage; + ckstart($start, $perpage); + + $gets = array( + 'mod' => 'space', + 'uid' => $space['uid'], + 'do' => 'share', + 'view' => $_GET['view'], + 'from' => $_GET['from'] + ); + $navtheurl = $theurl = 'home.php?'.url_implode($gets); + $theurl .= '&type='.$_GET['type']; + if(!IS_ROBOT) { + $f_index = ''; + $need_count = true; + + if(empty($_GET['view'])) $_GET['view'] = 'we'; + $uids = 0; + $type = ''; + if($_GET['view'] == 'all') { + $wheresql = "1"; + + } elseif($_GET['view'] == 'we') { + + space_merge($space, 'field_home'); + + if($space['feedfriend']) { + $uids = explode(',', $space['feedfriend']); + $f_index = 'USE INDEX(dateline)'; + } else { + $need_count = false; + } + + } else { + + if($_GET['from'] == 'space') $diymode = 1; + + $uids = $space['uid']; + + } + $actives = array($_GET['view'] => ' class="a"'); + + if($_GET['type'] && $_GET['type'] != 'all') { + $sub_actives = array('type_'.$_GET['type'] => ' class="a"'); + $type = $_GET['type']; + } else { + $sub_actives = array('type_all' => ' class="a"'); + } + + $list = array(); + $pricount = 0; + + $sid = empty($_GET['sid'])?0:intval($_GET['sid']); + + if($need_count) { + $count = C::t('home_share')->count_by_sid_uid_type($sid, $uids, $type); + if($count) { + require_once libfile('function/share'); + foreach(C::t('home_share')->fetch_all_by_sid_uid_type($sid, $uids, $type, $start, $perpage) as $value) { + $value = mkshare($value); + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $list[] = $value; + } else { + $pricount ++; + } + } + $multi = multi($count, $perpage, $page, $theurl); + } + } + } + dsetcookie('home_diymode', $diymode); + $navtitle = lang('core', 'title_share_'.$_GET['type']); + $navtitle .= lang('core', 'title_share'); + if($space['username']) { + $navtitle = lang('space', 'sb_sharing', array('who' => $space['username'])); + } + $metakeywords = $navtitle; + $metadescription = $navtitle; + + include_once template("diy:home/space_share_list"); +} + +?> \ No newline at end of file diff --git a/source/include/space/space_thread.php b/source/include/space/space_thread.php new file mode 100644 index 0000000..34819ce --- /dev/null +++ b/source/include/space/space_thread.php @@ -0,0 +1,370 @@ + 'space', + 'uid' => $space['uid'], + 'do' => 'thread', + 'fid' => getgpc('fid'), + 'view' => $_GET['view'], + 'type' => getgpc('type'), + 'order' => $_GET['order'], + 'fuid' => getgpc('fuid'), + 'searchkey' => getgpc('searchkey'), + 'from' => $_GET['from'], + 'filter' => getgpc('filter') +); +$theurl = 'home.php?'.url_implode($gets); +unset($gets['fid']); +$forumurl = 'home.php?'.url_implode($gets); +$multi = ''; +$authorid = 0; +$replies = $closed = $displayorder = null; +$dglue = '='; +$vfid = getgpc('fid') ? intval($_GET['fid']) : null; + +require_once libfile('function/misc'); +require_once libfile('function/forum'); +loadcache(array('forums')); +$fids = $comma = ''; +if($_GET['view'] != 'me') { + $displayorder = 0; + $dglue = '>='; +} +$f_index = ''; +$ordersql = 't.dateline DESC'; +$need_count = true; +$viewuserthread = false; +$listcount = 0; + +if($_GET['view'] == 'me') { + + if($_GET['from'] == 'space') $diymode = 1; + $allowview = true; + $viewtype = in_array(getgpc('type'), array('reply', 'thread', 'postcomment')) ? $_GET['type'] : 'thread'; + $filter = in_array(getgpc('filter'), array('recyclebin', 'ignored', 'save', 'aduit', 'close', 'common')) ? $_GET['filter'] : ''; + if($space['uid'] != $_G['uid'] && in_array($viewtype, array('reply', 'thread'))) { + if($allowviewuserthread === -1 && $_G['adminid'] != 1) { + $allowview = false; + } + if($allowview) { + $viewuserthread = true; + $viewfids = str_replace("'", '', $allowviewuserthread); + if(!empty($viewfids)) { + $viewfids = explode(',', $viewfids); + } + } + } + + if($viewtype == 'thread' && $allowview) { + $authorid = $space['uid']; + + + + + if($filter == 'recyclebin') { + $displayorder = -1; + } elseif($filter == 'aduit') { + $displayorder = -2; + } elseif($filter == 'ignored') { + $displayorder = -3; + } elseif($filter == 'save') { + $displayorder = -4; + } elseif($filter == 'close') { + $closed = 1; + } elseif($filter == 'common') { + $closed = 0; + $displayorder = 0; + $dglue = '>='; + } + + $ordersql = 't.tid DESC'; + } elseif($viewtype == 'postcomment') { + $posttable = getposttable(); + require_once libfile('function/post'); + $pids = $tids = array(); + $postcommentarr = C::t('forum_postcomment')->fetch_all_by_authorid($_G['uid'], $start, $perpage); + foreach($postcommentarr as $value) { + $pids[] = $value['pid']; + $tids[] = $value['tid']; + } + $pids = C::t('forum_post')->fetch_all_post(0, $pids); + $tids = C::t('forum_thread')->fetch_all($tids); + + $list = $fids = array(); + foreach($postcommentarr as $value) { + $value['authorid'] = $pids[$value['pid']]['authorid']; + $value['fid'] = $pids[$value['pid']]['fid']; + $value['invisible'] = $pids[$value['pid']]['invisible']; + $value['dateline'] = $pids[$value['pid']]['dateline']; + $value['message'] = $pids[$value['pid']]['message']; + $value['special'] = $tids[$value['tid']]['special']; + $value['status'] = $tids[$value['tid']]['status']; + $value['subject'] = $tids[$value['tid']]['subject']; + $value['digest'] = $tids[$value['tid']]['digest']; + $value['attachment'] = $tids[$value['tid']]['attachment']; + $value['replies'] = $tids[$value['tid']]['replies']; + $value['views'] = $tids[$value['tid']]['views']; + $value['lastposter'] = $tids[$value['tid']]['lastposter']; + $value['lastpost'] = $tids[$value['tid']]['lastpost']; + $value['tid'] = $pids[$value['pid']]['tid']; + + $fids[] = $value['fid']; + $value['comment'] = messagecutstr($value['comment'], 100); + $list[] = procthread($value); + } + unset($pids, $tids, $postcommentarr); + if($fids) { + $fids = array_unique($fids); + $query = C::t('forum_forum')->fetch_all($fids); + foreach($query as $forum) { + $forums[$forum['fid']] = $forum['name']; + } + } + + $multi = simplepage(count($list), $perpage, $page, $theurl); + $need_count = false; + + } elseif($allowview) { + $invisible = null; + + $postsql = $threadsql = ''; + if($filter == 'recyclebin') { + $invisible = -5; + } elseif($filter == 'aduit') { + $invisible = -2; + } elseif($filter == 'save' || $filter == 'ignored') { + $invisible = -3; + $displayorder = -4; + } elseif($filter == 'close') { + $closed = 1; + } elseif($filter == 'common') { + $invisible = 0; + $displayorder = 0; + $dglue = '>='; + $closed = 0; + } else { + if($space['uid'] != $_G['uid']) { + $invisible = 0; + } + } + require_once libfile('function/post'); + $posts = C::t('forum_post')->fetch_all_by_authorid(0, $space['uid'], true, 'DESC', $start, $perpage, 0, $invisible, $vfid); + $listcount = count($posts); + foreach($posts as $pid => $post) { + $delrow = false; + if($post['anonymous'] && $post['authorid'] != $_G['uid']) { + $delrow = true; + } elseif($viewuserthread && $post['authorid'] != $_G['uid']) { + if(($_G['adminid'] != 1 && !empty($viewfids) && !in_array($post['fid'], $viewfids))) { + $delrow = true; + } + } + if($delrow) { + unset($posts[$pid]); + $hiddennum++; + continue; + } else { + $tids[$post['tid']][] = $pid; + $post['message'] = $post['status'] & 1 && $_G['adminid'] != 1 ? '' : (!getstatus($post['status'], 2) || $post['authorid'] == $_G['uid'] ? messagecutstr($post['message'], 100) : ''); + $posts[$pid] = $post; + } + } + + if(!empty($tids)) { + + $threads = C::t('forum_thread')->fetch_all_by_tid_displayorder(array_keys($tids), $displayorder, $dglue, array(), $closed); + + foreach($threads as $tid => $thread) { + $delrow = false; + if($_G['adminid'] != 1 && $thread['displayorder'] < 0) { + $delrow = true; + } elseif($_G['adminid'] != 1 && $_G['uid'] != $thread['authorid'] && getstatus($thread['status'], 2)) { + $delrow = true; + } elseif(!isset($_G['cache']['forums'][$thread['fid']])) { + if(!$_G['setting']['groupstatus']) { + $delrow = true; + } else { + $gids[$thread['fid']] = $thread['tid']; + } + } + if($delrow) { + foreach($tids[$tid] as $pid) { + unset($posts[$pid]); + $hiddennum++; + } + unset($tids[$tid]); + unset($threads[$tid]); + continue; + } else { + $threads[$tid] = procthread($thread); + $forums[$thread['fid']] = $threads[$tid]['forumname']; + } + + } + if(!empty($gids)) { + $groupforums = C::t('forum_forum')->fetch_all_name_by_fid(array_keys($gids)); + foreach($gids as $fid => $tid) { + $threads[$tid]['forumname'] = $groupforums[$fid]['name']; + $forums[$fid] = $groupforums[$fid]['name']; + } + } + if(!empty($tids)) { + foreach($tids as $tid => $pids) { + foreach($pids as $pid) { + if(!isset($threads[$tid])) { + unset($posts[$pid]); + unset($tids[$tid]); + $hiddennum++; + continue; + } + } + } + } + $list = &$threads; + } + + + $multi = simplepage($listcount, $perpage, $page, $theurl); + + $need_count = false; + } + if(!$allowview) { + $need_count = false; + } + $orderactives = array($viewtype => ' class="a"'); + +} else { + + if(!$_G['setting']['friendstatus']) { + showmessage('friend_status_off'); + } + + space_merge($space, 'field_home'); + + if($space['feedfriend']) { + + $fuid_actives = array(); + + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid, $space['uid'])) { + $authorid = $fuid; + $fuid_actives = array($fuid=>' selected'); + } else { + $authorid = explode(',', $space['feedfriend']); + } + + $query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, 100, true); + foreach($query as $value) { + $userlist[] = $value; + } + } else { + $need_count = false; + } +} + +$actives = array($_GET['view'] =>' class="a"'); + +if($need_count) { + + if($searchkey = stripsearchkey(getgpc('searchkey'))) { + $searchkey = dhtmlspecialchars($searchkey); + } + + + loadcache('forums'); + $gids = $fids = $forums = array(); + + foreach(C::t('forum_thread')->fetch_all_by_authorid_displayorder($authorid, $displayorder, $dglue, $closed, $searchkey, $start, $perpage, $replies, $vfid) as $tid => $value) { + if(empty($value['author']) && $value['authorid'] != $_G['uid']) { + $hiddennum++; + continue; + } elseif($viewuserthread && $value['authorid'] != $_G['uid']) { + if(($_G['adminid'] != 1 && !empty($viewfids) && !in_array($value['fid'], $viewfids)) || $value['displayorder'] < 0) { + $hiddennum++; + continue; + } + } + if(!isset($_G['cache']['forums'][$value['fid']])) { + if(!$_G['setting']['groupstatus']) { + $hiddennum++; + continue; + } else { + $gids[$value['fid']] = $value['tid']; + } + } + $list[$value['tid']] = procthread($value); + $forums[$value['fid']] = $list[$value['tid']]['forumname']; + } + + if(!empty($gids)) { + $gforumnames = C::t('forum_forum')->fetch_all_name_by_fid(array_keys($gids)); + foreach($gids as $fid => $tid) { + $list[$tid]['forumname'] = $gforumnames[$fid]['name']; + $forums[$fid] = $gforumnames[$fid]['name']; + } + } + + $threads = &$list; + + + if($_GET['view'] != 'all') { + $listcount = count($list)+$hiddennum; + $multi = simplepage($listcount, $perpage, $page, $theurl); + } +} + +require_once libfile('function/forumlist'); +$forumlist = forumselect(FALSE, 0, intval(getgpc('fid'))); +dsetcookie('home_diymode', $diymode); + +if($_G['uid']) { + $_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view']; + $navtitle = lang('core', 'title_'.$_GET['view'].'_thread'); +} else { + $navtitle = lang('core', 'title_thread'); +} + +if($space['username']) { + $navtitle = lang('space', 'sb_thread', array('who' => $space['username'])); +} +$metakeywords = $navtitle; +$metadescription = $navtitle; +if(!getglobal('follow')) { + include_once template("diy:home/space_thread"); +} +?> \ No newline at end of file diff --git a/source/include/space/space_trade.php b/source/include/space/space_trade.php new file mode 100644 index 0000000..181b3fc --- /dev/null +++ b/source/include/space/space_trade.php @@ -0,0 +1,258 @@ + 'space', + 'uid' => $space['uid'], + 'do' => 'trade', + 'view' => $_GET['view'], + 'order' => $_GET['order'], + 'type' => $_GET['type'], + 'status' => $_GET['status'], + 'fuid' => $_GET['fuid'], + 'searchkey' => $_GET['searchkey'] +); +$theurl = 'home.php?'.url_implode($gets); +$multi = ''; + +$wheresql = '1'; +$apply_sql = ''; + +$f_index = ''; +$ordersql = 't.dateline DESC'; +$need_count = true; + +if($_GET['view'] == 'me') { + + $wheresql = "t.sellerid = '{$space['uid']}'"; + +} elseif($_GET['view'] == 'tradelog') { + + $viewtype = in_array($_GET['type'], array('sell', 'buy')) ? $_GET['type'] : 'sell'; + $filter = $_GET['filter'] ? $_GET['filter'] : 'all'; + $sqlfield = $viewtype == 'sell' ? 'sellerid' : 'buyerid'; + $sqlfilter = ''; + $ratestatus = 0; + $item = $viewtype == 'sell' ? 'selltrades' : 'buytrades'; + + switch($filter) { + case 'attention': + $typestatus = $item; break; + case 'eccredit' : + $typestatus = 'eccredittrades'; + $ratestatus = $item == 'selltrades' ? 1 : 2; + break; + case 'all': + $typestatus = ''; break; + case 'success': + $typestatus = 'successtrades'; break; + case 'closed' : + $typestatus = 'closedtrades'; break; + case 'refund' : + $typestatus = 'refundtrades'; break; + case 'unstart' : + $typestatus = 'unstarttrades'; break; + default: + $typestatus = 'tradingtrades'; + break; + } + require_once libfile('function/trade'); + + $typestatus = $typestatus ? trade_typestatus($typestatus) : array(); + + $srchkey = stripsearchkey($_GET['searchkey']); + + + $tid = intval($_GET['tid']); + $pid = intval($_GET['pid']); + $sqltid = $tid ? 'tl.tid=\''.$tid.'\' AND '.($pid ? 'tl.pid=\''.$pid.'\' AND ' : '') : ''; + $extra .= $srchfid ? '&filter='.$filter : ''; + $extratid = $tid ? "&tid=$tid".($pid ? "&pid=$pid" : '') : ''; + $num = C::t('forum_tradelog')->count_log($viewtype, $_G['uid'], $tid, $pid, $ratestatus, $typestatus); + + $multi = multi($num, $perpage, $page, $theurl); + $tradeloglist = array(); + foreach(C::t('forum_tradelog')->fetch_all_log($viewtype, $_G['uid'], $tid, $pid, $ratestatus, $typestatus, $start, $perpage) as $tradelog) { + $tradelog['lastupdate'] = dgmdate($tradelog['lastupdate'], 'u', 1); + $tradelog['attend'] = trade_typestatus($item, $tradelog['status']); + $tradelog['status'] = trade_getstatus($tradelog['status']); + $tradeloglist[] = $tradelog; + } + $creditid = 0; + if($_G['setting']['creditstransextra'][5]) { + $creditid = intval($_G['setting']['creditstransextra'][5]); + } elseif ($_G['setting']['creditstrans']) { + $creditid = intval($_G['setting']['creditstrans']); + } + $extcredits = $_G['setting']['extcredits']; + $orderactives = array($viewtype => ' class="a"'); + $need_count = false; + +} elseif($_GET['view'] == 'eccredit') { + + require_once libfile('function/ec_credit'); + $uid = !empty($_GET['uid']) ? intval($_GET['uid']) : $_G['uid']; + + loadcache('usergroups'); + + $member = getuserbyuid($uid); + if(!$member) { + showmessage('member_nonexistence', NULL, array(), array('login' => 1)); + } + $member = array_merge($member, C::t('common_member_profile')->fetch($uid), C::t('common_member_status')->fetch($uid), C::t('common_member_field_forum')->fetch($uid)); + $member['avatar'] = '
          '.avatar($member['uid']); + if($_G['cache']['usergroups'][$member['groupid']]['groupavatar']) { + $member['avatar'] .= '
          '; + } + $member['avatar'] .= '
          '; + + $member['taobaoas'] = str_replace("'", '', addslashes($member['taobao'])); + $member['regdate'] = dgmdate($member['regdate'], 'd'); + $member['usernameenc'] = rawurlencode($member['username']); + $member['buyerrank'] = 0; + if($member['buyercredit']){ + foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) { + if($member['buyercredit'] <= $credit) { + $member['buyerrank'] = $level; + break; + } + } + } + $member['sellerrank'] = 0; + if($member['sellercredit']){ + foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) { + if($member['sellercredit'] <= $credit) { + $member['sellerrank'] = $level; + break; + } + } + } + + $caches = array(); + foreach(C::t('forum_spacecache')->fetch_all_spacecache($uid, array('buyercredit', 'sellercredit')) as $cache) { + $caches[$cache['variable']] = dunserialize($cache['value']); + $caches[$cache['variable']]['expiration'] = $cache['expiration']; + } + + foreach(array('buyercredit', 'sellercredit') AS $type) { + if(!isset($caches[$type]) || TIMESTAMP > $caches[$type]['expiration']) { + $caches[$type] = updatecreditcache($uid, $type, 1); + } + } + @$buyerpercent = $caches['buyercredit']['all']['total'] ? sprintf('%0.2f', $caches['buyercredit']['all']['good'] * 100 / $caches['buyercredit']['all']['total']) : 0; + @$sellerpercent = $caches['sellercredit']['all']['total'] ? sprintf('%0.2f', $caches['sellercredit']['all']['good'] * 100 / $caches['sellercredit']['all']['total']) : 0; + $need_count = false; + + include template('home/space_eccredit'); + exit; + +} elseif($_GET['view'] == 'onlyuser') { + $uid = !empty($_GET['uid']) ? intval($_GET['uid']) : $_G['uid']; + $wheresql = "t.sellerid = '$uid'"; +} else { + + space_merge($space, 'field_home'); + + if($space['feedfriend']) { + + $fuid_actives = array(); + + require_once libfile('function/friend'); + $fuid = intval($_GET['fuid']); + if($fuid && friend_check($fuid, $space['uid'])) { + $wheresql = 't.'.DB::field('sellerid', $fuid); + $fuid_actives = array($fuid=>' selected'); + } else { + $wheresql = 't.'.DB::field('sellerid', $space['feedfriend']); + $theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we"; + } + + $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true); + foreach($query as $value) { + $userlist[] = $value; + } + + } else { + $need_count = false; + } +} + +$actives = array($_GET['view'] =>' class="a"'); + +if($need_count) { + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $wheresql .= ' AND t.'.DB::field('subject', '%'.$searchkey.'%', 'like'); + } + $havecache = false; + + $count = C::t('forum_trade')->fetch_all_for_space($wheresql, '', 1); + if($count) { + $query = C::t('forum_trade')->fetch_all_for_space($wheresql, $ordersql, 0, $start, $perpage); + $pids = $aids = $thidden = array(); + foreach($query as $value) { + $aids[$value['aid']] = $value['aid']; + $value['dateline'] = dgmdate($value['dateline']); + $pids[] = (float)$value['pid']; + $list[$value['pid']] = $value; + } + + + $multi = multi($count, $perpage, $page, $theurl); + } + +} + +if($count) { + $emptyli = array(); + if(count($list) % 5 != 0) { + for($i = 0; $i < 5 - count($list) % 5; $i++) { + $emptyli[] = $i; + } + } +} + +if($_G['uid']) { + $_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view']; + $navtitle = lang('core', 'title_'.$_GET['view'].'_trade'); + if($navtitle == 'title_'.$_GET['view'].'_trade') { + $navtitle = lang('core', 'title_trade'); + } +} else { + $navtitle = lang('core', 'title_trade'); +} + +include_once template("diy:home/space_trade"); + +?> \ No newline at end of file diff --git a/source/include/space/space_wall.php b/source/include/space/space_wall.php new file mode 100644 index 0000000..f4cc905 --- /dev/null +++ b/source/include/space/space_wall.php @@ -0,0 +1,52 @@ +count_by_id_idtype($space['uid'], 'uid', $cid); +if($count) { + $query = C::t('home_comment')->fetch_all_by_id_idtype($space['uid'], 'uid', $start, $perpage, $cid, 'DESC'); + foreach($query as $value) { + $list[] = $value; + } +} + +$multi = multi($count, $perpage, $page, $theurl); + +$navtitle = lang('space', 'sb_wall', array('who' => $space['username'])); +$metakeywords = lang('space', 'sb_wall', array('who' => $space['username'])); +$metadescription = lang('space', 'sb_wall', array('who' => $space['username'])); + +dsetcookie('home_diymode', 1); + +include_once template("home/space_wall"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/index.htm b/source/include/spacecp/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/spacecp/spacecp_album.php b/source/include/spacecp/spacecp_album.php new file mode 100644 index 0000000..bc830a9 --- /dev/null +++ b/source/include/spacecp/spacecp_album.php @@ -0,0 +1,356 @@ +fetch_album($albumid)) { + showmessage('album_does_not_exist'); + } + + if($album['uid'] != $_G['uid'] && !checkperm('managealbum')) { + showmessage('no_privilege_album_edit'); + } + + if(submitcheck('editsubmit')) { + $_POST['albumname'] = getstr($_POST['albumname'], 50); + $_POST['albumname'] = censor($_POST['albumname']); + if(empty($_POST['albumname'])) { + showmessage('album_name_errors'); + } + + $_POST['friend'] = intval($_POST['friend']); + $_POST['target_ids'] = ''; + if($_POST['friend'] == 2) { + $uids = array(); + $names = empty($_POST['target_names'])?array():explode(',', preg_replace("/(\s+)/s", ',', $_POST['target_names'])); + if($names) { + $uids = C::t('common_member')->fetch_all_uid_by_username($names); + } + if(empty($uids)) { + $_POST['friend'] = 3; + } else { + $_POST['target_ids'] = implode(',', $uids); + } + } elseif($_POST['friend'] == 4) { + $_POST['password'] = trim($_POST['password']); + if($_POST['password'] == '') $_POST['friend'] = 0; + } + if($_POST['friend'] !== 2) { + $_POST['target_ids'] = ''; + } + if($_POST['friend'] !== 4) { + $_POST['password'] = ''; + } + + $_POST['catid'] = intval($_POST['catid']); + if($_POST['catid'] != $album['catid']) { + if($album['catid']) { + C::t('home_album_category')->update_num_by_catid('-1', $album['catid'], true); + } + if($_POST['catid']) { + C::t('home_album_category')->update_num_by_catid('1', $_POST['catid']); + } + } + + C::t('home_album')->update($albumid, array('albumname'=>$_POST['albumname'], 'catid'=>$_POST['catid'], 'friend'=>$_POST['friend'], 'password'=>$_POST['password'], 'target_ids'=>$_POST['target_ids'], 'depict'=>dhtmlspecialchars($_POST['depict']))); + showmessage('spacecp_edit_ok', "home.php?mod=spacecp&ac=album&op=edit&albumid=$albumid"); + } + + $album['target_names'] = ''; + + $friendarr = array($album['friend'] => ' selected'); + + $passwordstyle = $selectgroupstyle = 'display:none'; + if($album['friend'] == 4) { + $passwordstyle = ''; + } elseif($album['friend'] == 2) { + $selectgroupstyle = ''; + if($album['target_ids']) { + $names = array(); + foreach(C::t('common_member')->fetch_all($album['target_ids']) as $uid => $value) { + $names[$uid] = $value['username']; + } + $album['target_names'] = implode(' ', $names); + } + } + + require_once libfile('function/friend'); + $groups = friend_group_list(); + + if($_G['setting']['albumcategorystat']) { + loadcache('albumcategory'); + $category = $_G['cache']['albumcategory']; + + $categoryselect = ''; + if($category) { + $categoryselect = ""; + } + } + +} elseif($_GET['op'] == 'delete') { + + if(!$album = C::t('home_album')->fetch_album($albumid)) { + showmessage('album_does_not_exist'); + } + + if($album['uid'] != $_G['uid'] && !checkperm('managealbum')) { + showmessage('no_privilege_album_del'); + } + + $albums = getalbums($album['uid']); + if(empty($albums[$albumid])) { + showmessage('no_privilege_album_delother'); + } + + if(submitcheck('deletesubmit')) { + $_POST['moveto'] = intval($_POST['moveto']); + if($_POST['moveto'] < 0) { + require_once libfile('function/delete'); + deletealbums(array($albumid)); + } else { + if($_POST['moveto'] > 0 && $_POST['moveto'] != $albumid && !empty($albums[$_POST['moveto']])) { + C::t('home_pic')->update_for_albumid($albumid, array('albumid'=>$_POST['moveto'])); + album_update_pic($_POST['moveto']); + } else { + C::t('home_pic')->update_for_albumid($albumid, array('albumid'=>0)); + } + C::t('home_album')->delete($albumid); + } + showmessage('do_success', "home.php?mod=space&uid={$_GET['uid']}&do=album&view=me"); + } +} elseif($_GET['op'] == 'editpic') { + + $managealbum = checkperm('managealbum'); + + require_once libfile('class/bbcode'); + + if($albumid > 0) { + if(!$album = C::t('home_album')->fetch_album($albumid)) { + showmessage('album_does_not_exist', 'home.php?mod=space&uid='.$_G['uid'].'&do=album&view=me', array(), array('return' => true)); + } + + if($album['uid'] != $_G['uid'] && !$managealbum) { + showmessage('no_privilege_pic_edit', 'home.php?mod=space&uid='.$_G['uid'].'&do=album&view=me', array(), array('return' => true)); + } + } else { + $album['uid'] = $_G['uid']; + } + if(submitcheck('editpicsubmit')) { + $return = true; + if($_GET['subop'] == 'update') { + foreach ($_POST['title'] as $picid => $value) { + if($value == $_GET['oldtitle'][$picid]) { + continue; + } + $title = getstr($value, 150); + $title = censor($title, NULL, FALSE, FALSE); + if(censormod($title) || $_G['group']['allowuploadmod']) { + $pic_status = 1; + updatemoderate("picid", $picid); + manage_addnotify('verifypic'); + } else { + $pic_status = 0; + } + $wherearr = array('picid'=>$picid); + if(!$managealbum) $wherearr['uid'] = $_G['uid']; + C::t('home_pic')->update($picid, array('title'=>$title, 'status' => $pic_status)); + } + } + if($_GET['subop'] == 'delete') { + if($_POST['ids']) { + require_once libfile('function/delete'); + deletepics($_POST['ids']); + + if($albumid > 0) $return = album_update_pic($albumid); + } + + } elseif($_GET['subop'] == 'move') { + if($_POST['ids']) { + $sqluid = $managealbum ? '' : $_G['uid']; + $_POST['newalbumid'] = intval($_POST['newalbumid']); + if($_POST['newalbumid']) { + if(!$album = C::t('home_album')->fetch_album($_POST['newalbumid'], $sqluid)) { + $_POST['newalbumid'] = 0; + } + } + if($managealbum) { + $updatecount = C::t('home_pic')->update($_POST['ids'], array('albumid' => $_POST['newalbumid'])); + }else { + $updatecount = C::t('home_pic')->update_for_uid($_G['uid'], $_POST['ids'], array('albumid' => $_POST['newalbumid'])); + } + if($updatecount) { + if($albumid>0) { + C::t('home_album')->update_num_by_albumid($albumid, -$updatecount, 'picnum', $sqluid); + $return = album_update_pic($albumid); + } + if($_POST['newalbumid']) { + C::t('home_album')->update_num_by_albumid($_POST['newalbumid'], $updatecount, 'picnum', $sqluid); + $return = album_update_pic($_POST['newalbumid']); + } + } + } + + } + + $url = $return ? "home.php?mod=spacecp&ac=album&op=editpic&albumid=$albumid&page={$_POST['page']}" : 'home.php?mod=space&uid='.$_G['uid'].'&do=album&view=me'; + if($_G['inajax']) { + showmessage('do_success', $url, array('title' => $title), array('showdialog' => 3, 'showmsg' => true, 'closetime' => true)); + } else { + showmessage('do_success', $url); + } + } + + $perpage = 10; + $page = empty($_GET['page'])?0:intval($_GET['page']); + if($page<1) $page = 1; + $start = ($page-1)*$perpage; + ckstart($start, $perpage); + + + if($albumid > 0) { + $count = $picid?1:$album['picnum']; + } else { + $count = C::t('home_pic')->fetch_all_by_albumid($albumid, 0, 0, $picid, 0, 0, $_G['uid'], true); + } + + $list = array(); + if($count) { + if($page > 1 && $start >=$count) { + $page--; + $start = ($page-1)*$perpage; + } + $bbcode = & bbcode::instance(); + $query = C::t('home_pic')->fetch_all_by_albumid($albumid, $start, $perpage, $picid, 0, 1, ($albumid > 0 ? 0 : $_G['uid'])); + foreach($query as $value) { + if($picid) { + $value['checked'] = ' checked'; + } + $value['title'] = $bbcode->html2bbcode($value['title']); + $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']); + $value['bigpic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0); + $list[] = $value; + } + } + + $multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=album&op=editpic&albumid=$albumid"); + + $albumlist = getalbums($album['uid']); + +} elseif($_GET['op'] == 'setpic') { + + album_update_pic($albumid, $picid); + showmessage('do_success', dreferer(), array('picid' => $picid), array('showmsg' => true, 'closetime' => true)); + +} elseif($_GET['op'] == 'edittitle') { + + $picid = empty($_GET['picid'])?0:intval($_GET['picid']); + $pic = C::t('home_pic')->fetch($picid); + if(!checkperm('managealbum') && $pic['uid'] != $_G['uid']) { + $pic = array(); + } + +} elseif($_GET['op'] == 'edithot') { + if(!checkperm('managealbum')) { + showmessage('no_privilege_edithot_album'); + } + + if(!$pic = C::t('home_pic')->fetch($picid)) { + showmessage('image_does_not_exist'); + } + + if(submitcheck('hotsubmit')) { + $_POST['hot'] = intval($_POST['hot']); + C::t('home_pic')->update($picid, array('hot'=>$_POST['hot'])); + if($_POST['hot'] > 0) { + require_once libfile('function/feed'); + feed_publish($picid, 'picid'); + } else { + C::t('home_feed')->update_feed($picid, array('hot'=>$_POST['hot']), 'picid'); + } + showmessage('do_success', dreferer()); + } +} elseif($_GET['op'] == 'saveforumphoto') { + if(submitcheck('savephotosubmit')) { + $aid = intval($_GET['aid']); + $albumid = intval($_POST['albumid']); + if(!$aid) { + showmessage('parameters_error'); + } + $attach = C::t('forum_attachment_n')->fetch_attachment('aid:'.$aid, $aid); + if(empty($attach) || !$attach['isimage']) { + showmessage('parameters_error'); + } + if($albumid) { + $album = C::t('home_album')->fetch_album($albumid, $_G['uid']); + if(empty($album)) { + showmessage('album_does_not_exist'); + } + } else { + $album = array('albumid' => 0); + } + $picdata = array( + 'albumid' => $album['albumid'], + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => $attach['dateline'], + 'postip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'filename' => censor($attach['filename']), + 'title' => censor(cutstr(dhtmlspecialchars($attach['description']), 100)), + 'type' => fileext($attach['attachment']), + 'size' => $attach['filesize'], + 'filepath' => $attach['attachment'], + 'thumb' => $attach['thumb'], + 'remote' => $attach['remote'] + 2 + ); + $picid = C::t('home_pic')->insert($picdata, 1); + showmessage('do_success', dreferer(), array('picid' => $picid), array('showdialog'=>true, 'showmsg' => true, 'closetime' => true)); + } else { + $albumlist = C::t('home_album')->fetch_all_by_uid($_G['uid'], 'updatetime'); + } +} + +include_once template("home/spacecp_album"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_avatar.php b/source/include/spacecp/spacecp_avatar.php new file mode 100644 index 0000000..8709307 --- /dev/null +++ b/source/include/spacecp/spacecp_avatar.php @@ -0,0 +1,39 @@ +update($_G['uid'], array('avatarstatus'=>'1')); + + updatecreditbyaction('setavatar'); +} +$reload = intval($_GET['reload']); +$actives = array('avatar' =>' class="a"'); +include template("home/spacecp_avatar"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_blog.php b/source/include/spacecp/spacecp_blog.php new file mode 100644 index 0000000..15a3b2c --- /dev/null +++ b/source/include/spacecp/spacecp_blog.php @@ -0,0 +1,192 @@ +fetch($blogid), + C::t('home_blogfield')->fetch($blogid) + ); + if($blog['tag']) { + $tagarray_all = $array_temp = $blogtag_array = array(); + $tagarray_all = explode("\t", $blog['tag']); + if($tagarray_all) { + foreach($tagarray_all as $var) { + if($var) { + $array_temp = explode(',', $var); + $blogtag_array[] = $array_temp['1']; + } + } + } + $blog['tag'] = implode(',', $blogtag_array); + } +} + +if(empty($blog)) { + if(!helper_access::check_module('blog') || !checkperm('allowblog')) { + showmessage('no_authority_to_add_log', '', array(), array('return' => true)); + } + + cknewuser(); + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + + $blog['subject'] = empty($_GET['subject']) ? '' : (dstrlen($_GET['subject']) > $_G['setting']['maxsubjectsize'] ? getstr($_GET['subject'], $_G['setting']['maxsubjectsize']) : $_GET['subject']); + $blog['message'] = empty($_GET['message'])?'':getstr($_GET['message'], 5000); + +} else { + + if($_G['uid'] != $blog['uid'] && !checkperm('manageblog') && $_GET['modblogkey'] != modauthkey($blog['blogid'])) { + showmessage('no_authority_operation_of_the_log'); + } +} + +if(submitcheck('blogsubmit', 0, $seccodecheck, $secqaacheck) && helper_access::check_module('blog')) { + + if(empty($blog['blogid'])) { + $blog = array(); + } else { + if(!checkperm('allowblog')) { + showmessage('no_privilege_blog'); + } + } + + if($_G['setting']['blogcategorystat'] && $_G['setting']['blogcategoryrequired'] && !$_POST['catid']) { + showmessage('blog_choose_system_category'); + } + require_once libfile('function/blog'); + if($newblog = blog_post($_POST, $blog)) { + if(empty($blog) && $newblog['topicid']) { + $url = 'home.php?mod=space&uid='.$_G['uid'].'&do=topic&topicid='.$newblog['topicid'].'&view=blog&quickforward=1'; + } else { + $url = 'home.php?mod=space&uid='.$newblog['uid'].'&do=blog&quickforward=1&id='.$newblog['blogid']; + } + if($_GET['modblogkey']) { + $url .= "&modblogkey={$_GET['modblogkey']}"; + } + dsetcookie('clearUserdata', 'home'); + showmessage('do_success', $url); + } else { + showmessage('that_should_at_least_write_things', NULL, array(), array('return'=>1)); + } +} + +if($_GET['op'] == 'delete') { + if(submitcheck('deletesubmit')) { + require_once libfile('function/delete'); + if(deleteblogs(array($blogid))) { + showmessage('do_success', "home.php?mod=space&uid={$blog['uid']}&do=blog&view=me"); + } else { + showmessage('failed_to_delete_operation'); + } + } + +} elseif($_GET['op'] == 'stick') { + space_merge($space, 'field_home'); + + $stickflag = $_GET['stickflag'] ? 1 : 0; + if(submitcheck('sticksubmit')) { + if($space['uid'] === $blog['uid'] && empty($blog['status'])) { + $stickblogs = explode(',', $space['stickblogs']); + $pos = array_search($blogid, $stickblogs); + if($pos !== false) { + unset($stickblogs[$pos]); + } + $blogs = implode(',', $stickblogs); + $blogs = empty($_POST['stickflag']) ? $blogs : $blogid.','.$blogs; + $stickblogs = explode(',', $blogs); + $stickblogs = array_filter($stickblogs); + $space['stickblogs'] = implode(',', $stickblogs); + C::t('common_member_field_home')->update($space['uid'], array('stickblogs' => $space['stickblogs'])); + showmessage('do_success', dreferer("home.php?mod=space&uid={$blog['uid']}&do=blog&view=me")); + } else { + showmessage('failed_to_stick_operation'); + } + } + +} elseif($_GET['op'] == 'edithot') { + if(!checkperm('manageblog')) { + showmessage('no_privilege_edithot_blog'); + } + + if(submitcheck('hotsubmit')) { + $_POST['hot'] = intval($_POST['hot']); + C::t('home_blog')->update($blog['blogid'], array('hot'=>$_POST['hot'])); + if($_POST['hot']>0) { + require_once libfile('function/feed'); + feed_publish($blog['blogid'], 'blogid'); + } else { + C::t('home_feed')->update_feed($blog['blogid'], array('hot'=>$_POST['hot']), 'blogid'); + } + + showmessage('do_success', "home.php?mod=space&uid={$blog['uid']}&do=blog&id={$blog['blogid']}"); + } + +} else { + $classarr = $blog['uid']?getclassarr($blog['uid']):getclassarr($_G['uid']); + $albums = getalbums($_G['uid']); + + $friendarr = array($blog['friend'] => ' selected'); + + $passwordstyle = $selectgroupstyle = 'display:none'; + if($blog['friend'] == 4) { + $passwordstyle = ''; + } elseif($blog['friend'] == 2) { + $selectgroupstyle = ''; + if($blog['target_ids']) { + $names = array(); + if(!is_array($blog['target_ids'])){ + $blog['target_ids'] = explode(",", $blog['target_ids']); + } + foreach(C::t('common_member')->fetch_all($blog['target_ids']) as $uid => $value) { + $names[$uid] = $value['username']; + } + $blog['target_names'] = implode(' ', $names); + } + } + + + $blog['message'] = dhtmlspecialchars($blog['message']); + + $allowhtml = checkperm('allowhtml'); + + require_once libfile('function/friend'); + $groups = friend_group_list(); + + if($_G['setting']['blogcategorystat']) { + loadcache('blogcategory'); + $category = $_G['cache']['blogcategory']; + + $categoryselect = ''; + if($category) { + include_once libfile('function/portalcp'); + $categoryselect = category_showselect('blog', 'catid', !$_G['setting']['blogcategoryrequired'] ? true : false, $blog['catid']); + } + } + $menuactives = array('space'=>' class="active"'); +} +require_once libfile('function/upload'); +$swfconfig = getuploadconfig($_G['uid'], 0, false); +include_once template("home/spacecp_blog"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_class.php b/source/include/spacecp/spacecp_class.php new file mode 100644 index 0000000..ad41d0c --- /dev/null +++ b/source/include/spacecp/spacecp_class.php @@ -0,0 +1,54 @@ +fetch($classid); + if($class['uid'] != $_G['uid']) { + $class = null; + } +} +if(empty($class)) showmessage('did_not_specify_the_type_of_operation'); + +if ($op == 'edit') { + + if(submitcheck('editsubmit')) { + + $_POST['classname'] = getstr($_POST['classname'], 40); + $_POST['classname'] = censor($_POST['classname']); + if(strlen($_POST['classname']) < 1) { + showmessage('enter_the_correct_class_name'); + } + C::t('home_class')->update($classid, array('classname'=>$_POST['classname'])); + showmessage('do_success', dreferer(),array('classid'=>$classid, 'classname' => $_POST['classname']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + +} elseif ($op == 'delete') { + if(submitcheck('deletesubmit')) { + C::t('home_blog')->update_classid_by_classid($classid, 0); + C::t('home_class')->delete($classid); + + showmessage('do_success', dreferer()); + } +} + +include_once template("home/spacecp_class"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_click.php b/source/include/spacecp/spacecp_click.php new file mode 100644 index 0000000..6811dfd --- /dev/null +++ b/source/include/spacecp/spacecp_click.php @@ -0,0 +1,200 @@ +fetch($id); + if($item) { + $picfield = C::t('home_picfield')->fetch($id); + $album = C::t('home_album')->fetch_album($item['albumid']); + $item['hotuser'] = $picfield['hotuser']; + $item['friend'] = $album['friend']; + $item['username'] = $album['username']; + } + $tablename = 'home_pic'; + break; + case 'aid': + if (!$_G['setting']['portalstatus']) { + showmessage('portal_status_off'); + } + $item = C::t('portal_article_title')->fetch($id); + $tablename = 'portal_article_title'; + break; + default: + if (!$_G['setting']['blogstatus']) { + showmessage('blog_status_off'); + } + $idtype = 'blogid'; + $item = array_merge( + C::t('home_blog')->fetch($id), + C::t('home_blogfield')->fetch($id) + ); + $tablename = 'home_blog'; + break; +} +if(!$item) { + showmessage('click_item_error'); +} + +$hash = md5($item['uid']."\t".$item['dateline']); +if($_GET['op'] == 'add') { + if(!checkperm('allowclick') || $_GET['hash'] != $hash) { + showmessage('no_privilege_click'); + } + + if($item['uid'] == $_G['uid']) { + showmessage('click_no_self'); + } + + if(isblacklist($item['uid'])) { + showmessage('is_blacklist'); + } + + if(C::t('home_clickuser')->count_by_uid_id_idtype($space['uid'], $id, $idtype)) { + showmessage('click_have'); + } + + $setarr = array( + 'uid' => $space['uid'], + 'username' => $_G['username'], + 'id' => $id, + 'idtype' => $idtype, + 'clickid' => $clickid, + 'dateline' => $_G['timestamp'] + ); + C::t('home_clickuser')->insert($setarr); + + C::t($tablename)->update_click($id, $clickid, 1); + + hot_update($idtype, $id, $item['hotuser']); + + $q_note = ''; + $q_note_values = array(); + + $fs = array(); + switch ($idtype) { + case 'blogid': + $fs['title_template'] = 'feed_click_blog'; + $fs['title_data'] = array( + 'touser' => "{$item['username']}", + 'subject' => "{$item['subject']}", + 'click' => $click['name'] + ); + + $q_note = 'click_blog'; + $q_note_values = array( + 'url'=>"home.php?mod=space&uid={$item['uid']}&do=blog&id={$item['blogid']}", + 'subject'=>$item['subject'], + 'from_id' => $item['blogid'], + 'from_idtype' => 'blogid' + ); + break; + case 'aid': + require_once libfile('function/portal'); + $article_url = fetch_article_url($item); + $fs['title_template'] = 'feed_click_article'; + $fs['title_data'] = array( + 'touser' => "{$item['username']}", + 'subject' => "{$item['title']}", + 'click' => $click['name'] + ); + + $q_note = 'click_article'; + $q_note_values = array( + 'url'=>$article_url, + 'subject'=>$item['title'], + 'from_id' => $item['aid'], + 'from_idtype' => 'aid' + ); + break; + case 'picid': + $fs['title_template'] = 'feed_click_pic'; + $fs['title_data'] = array( + 'touser' => "{$item['username']}", + 'click' => $click['name'] + ); + $fs['images'] = array(pic_get($item['filepath'], 'album', $item['thumb'], $item['remote'])); + $fs['image_links'] = array("home.php?mod=space&uid={$item['uid']}&do=album&picid={$item['picid']}"); + $fs['body_general'] = $item['title']; + + $q_note = 'click_pic'; + $q_note_values = array( + 'url'=>"home.php?mod=space&uid={$item['uid']}&do=album&picid={$item['picid']}", + 'from_id' => $item['picid'], + 'from_idtype' => 'picid' + ); + break; + } + + if(empty($item['friend']) && ckprivacy('click', 'feed')) { + require_once libfile('function/feed'); + $fs['title_data']['hash_data'] = "{$idtype}{$id}"; + feed_add('click', $fs['title_template'], $fs['title_data'], '', array(), $fs['body_general'],$fs['images'], $fs['image_links']); + } + + updatecreditbyaction('click', 0, array(), $idtype.$id); + + require_once libfile('function/stat'); + updatestat('click'); + + notification_add($item['uid'], 'click', $q_note, $q_note_values); + + showmessage('click_success', '', array('idtype' => $idtype, 'id' => $id, 'clickid' => $clickid), array('msgtype' => 3, 'showmsg' => true, 'closetime' => true)); + +} elseif ($_GET['op'] == 'show') { + + $maxclicknum = 0; + foreach ($clicks as $key => $value) { + $value['clicknum'] = $item["click{$key}"]; + $value['classid'] = mt_rand(1, 4); + if($value['clicknum'] > $maxclicknum) $maxclicknum = $value['clicknum']; + $clicks[$key] = $value; + } + + $perpage = 18; + $page = intval($_GET['page']); + $start = ($page-1)*$perpage; + if($start < 0) $start = 0; + + $count = C::t('home_clickuser')->count_by_id_idtype($id, $idtype); + $clickuserlist = array(); + $click_multi = ''; + + if($count) { + foreach(C::t('home_clickuser')->fetch_all_by_id_idtype($id, $idtype, $start, $perpage) as $value) { + $value['clickname'] = $clicks[$value['clickid']]['name']; + $clickuserlist[] = $value; + } + + $click_multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=click&op=show&clickid=$clickid&idtype=$idtype&id=$id"); + } +} + +include_once(template('home/spacecp_click')); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_comment.php b/source/include/spacecp/spacecp_comment.php new file mode 100644 index 0000000..20d477c --- /dev/null +++ b/source/include/spacecp/spacecp_comment.php @@ -0,0 +1,130 @@ + 'album', 'blogid' => 'blog', 'sid' => 'share', 'uid' => 'wall'); +$tospace = $pic = $blog = $album = $share = $poll = array(); + +include_once libfile('class/bbcode'); +$bbcode = & bbcode::instance(); + +if($_POST['idtype'] == 'uid' && ($seccodecheck || $secqaacheck)) { + $seccodecheck = 0; + $secqaacheck = 0; +} + +if(submitcheck('commentsubmit', 0, $seccodecheck, $secqaacheck)) { + + if(!checkperm('allowcomment')) { + showmessage('no_privilege_comment', '', array(), array('return' => true)); + } + + cknewuser(); + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + + $id = intval($_POST['id']); + $idtype = $_POST['idtype']; + $message = getstr($_POST['message'], 0, 0, 0, 2); + $cid = empty($_POST['cid'])?0:intval($_POST['cid']); + + if(!array_key_exists($idtype, $idtype_array)) { + showmessage('no_privilege_comment', '', array(), array('return' => true)); + } else if(!$_G['setting'][$idtype_array[$idtype].'status']) { + showmessage($idtype_array[$idtype].'_status_off'); + } + + if(strlen($message) < 2) { + showmessage('content_is_too_short', '', array(), array()); + } + + require_once libfile('function/comment'); + $cidarr = add_comment($message, $id, $idtype, $cid); + + if($cidarr['cid'] != 0) { + showmessage($cidarr['msg'], dreferer(), $cidarr['magvalues'], $_GET['quickcomment'] ? array('msgtype' => 3, 'showmsg' => true) : array('showdialog' => 3, 'showmsg' => true, 'closetime' => true)); + } else { + showmessage('no_privilege_comment', '', array(), array('return' => true)); + } +} + +$cid = empty($_GET['cid'])?0:intval($_GET['cid']); + +$cmt = C::t('home_comment')->fetch_comment($cid); +if(empty($cmt)) { + showmessage('comments_do_not_exist'); +} else if(empty($cmt['idtype']) || !array_key_exists($cmt['idtype'], $idtype_array)) { + showmessage('no_privilege_comment', '', array(), array('return' => true)); +} else if(!$_G['setting'][$idtype_array[$cmt['idtype']].'status']) { + showmessage($idtype_array[$cmt['idtype']].'_status_off'); +} + +if($_GET['op'] == 'edit') { + if($_G['adminid'] != 1 && $_GET['modcommentkey'] != modauthkey($_GET['cid'])) { + $authorid = intval($_G['uid']); + } else { + $authorid = ''; + } + if(!$comment = C::t('home_comment')->fetch_comment($cid, $authorid)) { + showmessage('no_privilege_comment_edit'); + } + + if(submitcheck('editsubmit')) { + + $message = getstr($_POST['message'], 0, 0, 0, 2); + if(strlen($message) < 2) showmessage('content_is_too_short'); + $message = censor($message, NULL, FALSE, FALSE); + if(censormod($message) || $_G['group']['allowcommentmod']) { + $comment_status = 1; + } else { + $comment_status = 0; + } + if($comment_status == 1) { + $idtype = $comment['idtype']; + updatemoderate($idtype.'_cid', $cid); + manage_addnotify('verifycommontes'); + } + C::t('home_comment')->update_comment($comment['cid'], array('message'=>$message, 'status'=>$comment_status)); + showmessage('do_success', dreferer(), array('cid' => $comment['cid']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + $comment['message'] = $bbcode->html2bbcode($comment['message']); + +} elseif($_GET['op'] == 'delete') { + + if(submitcheck('deletesubmit')) { + require_once libfile('function/delete'); + if(deletecomments(array($cid))) { + showmessage('do_success', dreferer(), array('cid' => $cid), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } else { + showmessage('no_privilege_comment_del'); + } + } + +} elseif($_GET['op'] == 'reply') { + + if($cmt['idtype'] == 'uid' && ($seccodecheck || $secqaacheck)) { + $seccodecheck = 0; + $secqaacheck = 0; + } + $config = urlencode(getsiteurl().'home.php?mod=misc&ac=swfupload&op=config&doodle=1'); +} else { + + showmessage('undefined_action'); +} + +include template('home/spacecp_comment'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_common.php b/source/include/spacecp/spacecp_common.php new file mode 100644 index 0000000..664e931 --- /dev/null +++ b/source/include/spacecp/spacecp_common.php @@ -0,0 +1,57 @@ + $id ,'type' => $type ,'uid' => $authorid), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + $formid = random(8); + +} elseif($op == 'closefeedbox') { + + dsetcookie('closefeedbox', 1); + +} elseif($op == 'modifyunitprice') { + if(!$_G['setting']['ranklist']['membershow']) { + exit('Access Denied'); + } + $showinfo = C::t('home_show')->fetch($_G['uid']); //DB::fetch_first("SELECT credit, unitprice FROM ".DB::table('home_show')." WHERE uid='{$_G['uid']}'"); + if(submitcheck('modifysubmit')) { + $unitprice = intval($_POST['unitprice']); + if($unitprice < 1) { + showmessage('showcredit_error', '', array(), array('return' => 1)); + } + $unitprice = $unitprice > $showinfo['credit'] ? $showinfo['credit'] : $unitprice; + C::t('home_show')->update($_G['uid'], array('unitprice' => $unitprice)); + + showmessage('do_success', dreferer(), array('unitprice' => $unitprice), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } +} + +include template('home/spacecp_common'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_credit.php b/source/include/spacecp/spacecp_credit.php new file mode 100644 index 0000000..acb1fbc --- /dev/null +++ b/source/include/spacecp/spacecp_credit.php @@ -0,0 +1,43 @@ +' class="a"'); +if(in_array($operation, array('base', 'buy', 'transfer', 'exchange', 'rule'))) { + $operation = 'base'; +} + +if($_G['setting']['ec_ratio']) { + $is_enable_pay = payment::enable(); +} else { + $is_enable_pay = false; +} + +include_once libfile('spacecp/credit_'.$operation, 'include'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_credit_base.php b/source/include/spacecp/spacecp_credit_base.php new file mode 100644 index 0000000..90bc74a --- /dev/null +++ b/source/include/spacecp/spacecp_credit_base.php @@ -0,0 +1,331 @@ + $value) { + if($value['allowexchangein'] || $value['allowexchangeout']) { + $extcredits_exchange['extcredits'.$key] = array('title' => $value['title'], 'unit' => $value['unit']); + } + } + } + + $count = C::t('common_credit_log')->count_by_uid($_G['uid']); + if($count) { + loadcache(array('magics')); + foreach(C::t('common_credit_log')->fetch_all_by_uid($_G['uid'], 0, 10) as $log) { + $credits = array(); + $havecredit = false; + $maxid = $minid = 0; + foreach($_G['setting']['extcredits'] as $id => $credit) { + if($log['extcredits'.$id]) { + $havecredit = true; + if($log['operation'] == 'RPZ') { + $credits[] = $credit['title'].lang('spacecp', 'credit_update_reward_clean'); + } else { + $credits[] = $credit['title'].' '.($log['extcredits'.$id] > 0 ? '+' : '').$log['extcredits'.$id].''; + } + if($log['operation'] == 'CEC' && !empty($log['extcredits'.$id])) { + if($log['extcredits'.$id] > 0) { + $log['maxid'] = $id; + } elseif($log['extcredits'.$id] < 0) { + $log['minid'] = $id; + } + } + } + } + if(!$havecredit) { + continue; + } + $log['credit'] = implode('
          ', $credits); + if(in_array($log['operation'], array('RTC', 'RAC', 'STC', 'BTC', 'ACC', 'RCT', 'RCA', 'RCB'))) { + $tids[$log['relatedid']] = $log['relatedid']; + } elseif(in_array($log['operation'], array('SAC', 'BAC'))) { + $aids[$log['relatedid']] = $log['relatedid']; + } elseif(in_array($log['operation'], array('PRC', 'RSC'))) { + $pids[$log['relatedid']] = $log['relatedid']; + } elseif(in_array($log['operation'], array('TFR', 'RCV'))) { + $uids[$log['relatedid']] = $log['relatedid']; + } elseif($log['operation'] == 'TRC') { + $taskids[$log['relatedid']] = $log['relatedid']; + } + + $loglist[] = $log; + } + $otherinfo = getotherinfo($aids, $pids, $tids, $taskids, $uids); + + } + + $navtitle = lang('core', 'title_credit'); + $creditsformulaexp = str_replace('*', 'X', $_G['setting']['creditsformulaexp']); + +} elseif($_GET['op'] == 'buy') { + if((!$_G['setting']['ec_ratio'] || !$is_enable_pay) && !$_G['setting']['card']['open']) { + showmessage('action_closed', NULL); + } + + if(submitcheck('addfundsbuyform')) { + $amount = intval($_GET['addfundamount']); + if(!$amount) { + showmessage('memcp_credits_addfunds_msg_incorrect', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + $language = lang('forum/misc'); + if(($_G['setting']['ec_mincredits'] && $amount < $_G['setting']['ec_mincredits']) || ($_G['setting']['ec_maxcredits'] && $amount > $_G['setting']['ec_maxcredits'])) { + showmessage('credits_addfunds_amount_invalid', '', array('ec_maxcredits' => $_G['setting']['ec_maxcredits'], 'ec_mincredits' => $_G['setting']['ec_mincredits']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + if($_G['setting']['ec_maxcreditspermonth']) { + if(C::t('forum_order')->sum_amount_by_uid_submitdate_status($_G['uid'], $_G['timestamp'] - 2592000, array(2, 3)) + $amount > $_G['setting']['ec_maxcreditspermonth']) { + showmessage('credits_addfunds_toomuch', '', array('ec_maxcreditspermonth' => $_G['setting']['ec_maxcreditspermonth']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + } + + $price = round(($amount / $_G['setting']['ec_ratio'] * 100) / 100, 2); + + $credits = $_G['setting']['extcredits'][$_G['setting']['creditstrans']]; + + $return_url = $_G['siteurl'] . 'home.php?mod=spacecp&ac=credit&op=base'; + $pay_url = payment::create_order( + 'payment_credit', + $_G['setting']['bbname'].' - '.lang('forum/misc', 'credit_payment'), + trim(lang('forum/misc', 'credit_forum_payment') . ' ' . $credits['title'] . ' ' . $amount . ' ' . $credits['unit']), + $price * 100, + $return_url, + array( + 'index' => $_G['setting']['creditstrans'], + 'value' => $amount, + 'ip' => $_G['clientip'], + 'port' => $_G['remoteport'] + ) + ); + + include isset($_REQUEST['inajax']) ? template('common/header_ajax') : template('common/header'); + echo ''; + include isset($_REQUEST['inajax']) ? template('common/footer_ajax') : template('common/footer'); + dexit(); + } elseif(submitcheck('addfundscardsubmit')) { + list($seccodecheck, $secqaacheck) = seccheck('card'); + if($seccodecheck) { + if(!check_seccode($_GET['seccodeverify'], $_GET['seccodehash'])) { + showmessage('submit_seccode_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + } + if($secqaacheck) { + if(!check_secqaa($_GET['secanswer'], $_GET['secqaahash'])) { + showmessage('submit_secqaa_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + } + + if(!$_POST['cardid']) { + showmessage('memcp_credits_card_msg_cardid_incorrect', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + if(!($card = C::t('common_card')->fetch($_POST['cardid']))) { + showmessage('memcp_credits_card_msg_card_unfined', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true, 'extrajs' => '')); + } else { + if($card['status'] == 2) { + showmessage('memcp_credits_card_msg_used', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + if($card['cleardateline'] < TIMESTAMP) { + showmessage('memcp_credits_card_msg_cleardateline_early', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + if(C::t('common_card')->update_to_used($card['id'])) { + updatemembercount($_G['uid'], array($card['extcreditskey'] => $card['extcreditsval']), true, 'CDC', 1); + showmessage('memcp_credits_card_msg_succeed', 'home.php?mod=spacecp&ac=credit&op=base', array('extcreditstitle' => $_G['setting']['extcredits'][$card['extcreditskey']]['title'], 'extcreditsval' => $card['extcreditsval']), array('showdialog' => 1, 'alert' => 'right', 'showmsg' => true, 'locationtime' => true)); + } else { + showmessage('memcp_credits_card_msg_used', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + } + } else { + if($_G['setting']['card']['open']) { + list($seccodecheck, $secqaacheck) = seccheck('card'); + } + + $active = array(); + if($_G['setting']['ec_ratio'] && $is_enable_pay) { + $active['rmb'] = 1; + } elseif($_G['setting']['card']['open']) { + $active['card'] = 1; + } + } +} elseif($_GET['op'] == 'transfer') { + if(!empty($_G['setting']['submitlock']) && discuz_process::islocked('transferlock_'.$_G['uid'], 0, 1)) { + showmessage('credits_transfer_msg_locked', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + if(!($_G['setting']['transferstatus'] && $_G['group']['allowtransfer'])) { + showmessage('action_closed', NULL); + } + + if(submitcheck('transfersubmit')) { + if($_GET['to'] == $_G['username']) { + showmessage('memcp_credits_transfer_msg_self_incorrect', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + $amount = intval($_GET['transferamount']); + if($amount <= 0) { + showmessage('credits_transaction_amount_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } elseif(getuserprofile('extcredits'.$_G['setting']['creditstransextra'][9]) - $amount < ($minbalance = $_G['setting']['transfermincredits'])) { + showmessage('credits_transfer_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][9]]['title'], 'minbalance' => $minbalance), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } elseif(!($netamount = floor($amount * (1 - $_G['setting']['creditstax'])))) { + showmessage('credits_net_amount_iszero', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + $to = C::t('common_member')->fetch_by_username($_GET['to']); + if(!$to) { + showmessage('memcp_credits_transfer_msg_user_incorrect', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + loaducenter(); + $ucresult = uc_user_login(addslashes($_G['username']), $_GET['password']); + list($tmp['uid']) = $ucresult; + + if($tmp['uid'] <= 0) { + showmessage('credits_password_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][9] => -$amount), 1, 'TFR', $to['uid']); + updatemembercount($to['uid'], array($_G['setting']['creditstransextra'][9] => $netamount), 1, 'RCV', $_G['uid']); + + if(!empty($_GET['transfermessage'])) { + $transfermessage = dhtmlspecialchars($_GET['transfermessage']); + notification_add($to['uid'], 'credit', 'transfer', array('credit' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][9]]['title'].' '.$netamount.' '.$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][9]]['unit'], 'transfermessage' => $transfermessage)); + } + showmessage('credits_transfer_succeed', 'home.php?mod=spacecp&ac=credit&op=transfer', array(), array('showdialog' => 1, 'showmsg' => true, 'locationtime' => true)); + } + +} elseif ($_GET['op'] == 'exchange') { + + if(!$_G['setting']['exchangestatus']) { + showmessage('action_closed', NULL); + } + $_CACHE['creditsettings'] = array(); + if(file_exists(DISCUZ_ROOT.'/uc_client/data/cache/creditsettings.php')) { + include_once(DISCUZ_ROOT.'/uc_client/data/cache/creditsettings.php'); + } + + if(submitcheck('exchangesubmit')) { + if($_G['setting']['submitlock'] && discuz_process::islocked('exchangelock_'.$_G['uid'], 0, 1)){ + showmessage('memcp_credits_exchange_msg_locked', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + $tocredits = $_GET['tocredits']; + $fromcredits = $_GET['fromcredits']; + $exchangeamount = $_GET['exchangeamount']; + $outexange = strexists($tocredits, '|'); + if($outexange && !empty($_GET['outi'])) { + $fromcredits = $_GET['fromcredits_'.$_GET['outi']]; + } + + if($fromcredits == $tocredits) { + showmessage('memcp_credits_exchange_msg_num_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + if($outexange) { + $netamount = floor($exchangeamount * $_CACHE['creditsettings'][$tocredits]['ratiosrc'][$fromcredits] / $_CACHE['creditsettings'][$tocredits]['ratiodesc'][$fromcredits]); + } else { + if($_G['setting']['extcredits'][$tocredits]['ratio'] < $_G['setting']['extcredits'][$fromcredits]['ratio']) { + $netamount = ceil($exchangeamount * $_G['setting']['extcredits'][$tocredits]['ratio'] / $_G['setting']['extcredits'][$fromcredits]['ratio'] * (1 + $_G['setting']['creditstax'])); + } else { + $netamount = floor($exchangeamount * $_G['setting']['extcredits'][$tocredits]['ratio'] / $_G['setting']['extcredits'][$fromcredits]['ratio'] * (1 + $_G['setting']['creditstax'])); + } + } + if(!$outexange && !$_G['setting']['extcredits'][$tocredits]['ratio']) { + showmessage('credits_exchange_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + if(!$outexange && !$_G['setting']['extcredits'][$fromcredits]['allowexchangeout']) { + showmessage('extcredits_disallowexchangeout', '', array('credittitle' => $_G['setting']['extcredits'][$fromcredits]['title']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + if(!$outexange && !$_G['setting']['extcredits'][$tocredits]['allowexchangein']) { + showmessage('extcredits_disallowexchangein', '', array('credittitle' => $_G['setting']['extcredits'][$tocredits]['title']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + if(!$netamount) { + showmessage('memcp_credits_exchange_msg_balance_insufficient', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } elseif($exchangeamount <= 0) { + showmessage('credits_transaction_amount_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } elseif(getuserprofile('extcredits'.$fromcredits) - $netamount < ($minbalance = $_G['setting']['exchangemincredits'])) { + showmessage('credits_exchange_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$fromcredits]['title'], 'minbalance' => $minbalance), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + loaducenter(); + $ucresult = uc_user_login(addslashes($_G['username']), $_GET['password']); + list($tmp['uid']) = $ucresult; + + if($tmp['uid'] <= 0) { + showmessage('credits_password_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); + } + + if(!$outexange) { + updatemembercount($_G['uid'], array($fromcredits => -$netamount, $tocredits => $exchangeamount), 1, 'CEC', $_G['uid']); + } else { + if(!array_key_exists($fromcredits, $_CACHE['creditsettings'][$tocredits]['creditsrc'])) { + showmessage('extcredits_dataerror', NULL); + } + list($toappid, $tocredits) = explode('|', $tocredits); + $ucresult = uc_credit_exchange_request($_G['uid'], $fromcredits, $tocredits, $toappid, $exchangeamount); + if(!$ucresult) { + showmessage('extcredits_dataerror', NULL); + } + updatemembercount($_G['uid'], array($fromcredits => -$netamount), 1, 'ECU', $_G['uid']); + $netamount = $amount; + $amount = $tocredits = 0; + } + + showmessage('credits_transaction_succeed', 'home.php?mod=spacecp&ac=credit&op=exchange', array(), array('showdialog' => 1, 'showmsg' => true, 'locationtime' => true)); + } +} else { + $wheresql = ''; + $list = array(); + $rid = intval($_GET['rid']); + if($_GET['rid']) { + $wheresql = " AND rid='$rid'"; + } + require_once libfile('function/forumlist'); + $select = forumselect(false, 0, $_GET['fid']); + $keys = array_keys($_G['setting']['extcredits']); + foreach(C::t('common_credit_rule')->fetch_all_by_rid($rid) as $value) { + if(!helper_access::check_module('doing') && $value['action'] == 'doing') { + continue; + } elseif(!helper_access::check_module('blog') && $value['action'] == 'publishblog') { + continue; + } elseif(!helper_access::check_module('wall') && in_array($value['action'], array('guestbook', 'getguestbook'))) { + continue; + } + if(empty($_GET['fid']) || in_array($value['action'], array('digest', 'post', 'reply', 'getattach', 'postattach'))) { + if(checkvalue($value, $keys)) { + $list[$value['action']] = $value; + } + } + } + if(!empty($_GET['fid'])) { + $_GET['fid'] = intval($_GET['fid']); + $foruminfo = C::t('forum_forumfield')->fetch($_GET['fid']); + $flist = dunserialize($foruminfo['creditspolicy']); + foreach($flist as $action => $value) { + $list[$value['action']] = $value; + } + } +} +include_once template("home/spacecp_credit_base"); + +function checkvalue($value, $creditids) { + $havevalue = false; + foreach($creditids as $key) { + if($value['extcredits'.$key]) { + $havevalue = true; + break; + } + } + return $havevalue; +} +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_credit_log.php b/source/include/spacecp/spacecp_credit_log.php new file mode 100644 index 0000000..4ede18a --- /dev/null +++ b/source/include/spacecp/spacecp_credit_log.php @@ -0,0 +1,131 @@ + 'spacecp', + 'op' => $_GET['op'], + 'ac' => 'credit', + 'suboperation' => $_GET['suboperation'], + 'exttype' => $_GET['exttype'], + 'income' => $_GET['income'], + 'starttime' => $_GET['starttime'], + 'endtime' => $_GET['endtime'], + 'optype' => $_GET['optype'] +); +$theurl = 'home.php?'.url_implode($gets); +$multi = ''; + +$_GET['income'] = intval($_GET['income']); +$incomeactives = array($_GET['income'] => ' selected="selected"'); +$optypes = array_merge(lang('spacecp', 'logs_credit_update_INDEX'), lang('spacecp', 'logs_credit_update_SYS_INDEX')); +$endunixstr = $beginunixstr = 0; +if($_GET['starttime']) { + $beginunixstr = strtotime($_GET['starttime']); + $_GET['starttime'] = dgmdate($beginunixstr, 'Y-m-d'); +} +if($_GET['endtime']) { + $endunixstr = strtotime($_GET['endtime'].' 23:59:59'); + $_GET['endtime'] = dgmdate($endunixstr, 'Y-m-d'); +} +if($beginunixstr && $endunixstr && $endunixstr < $beginunixstr) { + showmessage('start_time_is_greater_than_end_time'); +} + +if($_GET['suboperation'] == 'creditrulelog') { + + $count = C::t('common_credit_rule_log')->count_by_uid($_G['uid']); + if($count) { + $rulelogs = C::t('common_credit_rule_log')->fetch_all_by_uid($_G['uid'], $start, $perpage); + $rules = C::t('common_credit_rule')->fetch_all_by_rid(C::t('common_credit_rule_log')->get_rids()); + foreach($rulelogs as $value) { + $value['rulename'] = $rules[$value['rid']]['rulename']; + $list[] = $value; + } + } + +} else { + + loadcache('usergroups'); + $suboperation = 'creditslog'; + $optype = ''; + if($_GET['optype'] && in_array($_GET['optype'], $optypes)) { + $optype = $_GET['optype']; + } + $exttype = intval($_GET['exttype']); + + $income = intval($_GET['income']); + $count = C::t('common_credit_log')->count_by_search($_G['uid'], $optype, $beginunixstr, $endunixstr, $exttype, $income, $_G['setting']['extcredits']); + if($count) { + $aids = $pids = $tids = $taskids = $uids = $loglist = array(); + loadcache(array('magics')); + foreach(C::t('common_credit_log')->fetch_all_by_search($_G['uid'], $optype, $beginunixstr, $endunixstr, $exttype, $income, $_G['setting']['extcredits'], $start,$perpage) as $log) { + $credits = array(); + $havecredit = false; + $maxid = $minid = 0; + foreach($_G['setting']['extcredits'] as $id => $credit) { + if($log['extcredits'.$id]) { + $havecredit = true; + if($log['operation'] == 'RPZ') { + $credits[] = $credit['title'].lang('spacecp', 'credit_update_reward_clean'); + } else { + $credits[] = $credit['title'].' '.($log['extcredits'.$id] > 0 ? '+' : '').$log['extcredits'.$id].''; + } + if($log['operation'] == 'CEC' && !empty($log['extcredits'.$id])) { + if($log['extcredits'.$id] > 0) { + $log['maxid'] = $id; + } elseif($log['extcredits'.$id] < 0) { + $log['minid'] = $id; + } + } + + } + } + if(!$havecredit) { + continue; + } + $log['credit'] = implode('
          ', $credits); + if(in_array($log['operation'], array('RTC', 'RAC', 'STC', 'BTC', 'ACC', 'RCT', 'RCA', 'RCB'))) { + $tids[$log['relatedid']] = $log['relatedid']; + } elseif(in_array($log['operation'], array('SAC', 'BAC'))) { + $aids[$log['relatedid']] = $log['relatedid']; + } elseif(in_array($log['operation'], array('PRC', 'RSC'))) { + $pids[$log['relatedid']] = $log['relatedid']; + } elseif(in_array($log['operation'], array('TFR', 'RCV'))) { + $uids[$log['relatedid']] = $log['relatedid']; + } elseif($log['operation'] == 'TRC') { + $taskids[$log['relatedid']] = $log['relatedid']; + } + $loglist[] = $log; + } + $otherinfo = getotherinfo($aids, $pids, $tids, $taskids, $uids); + } + +} + +if($count) { + $multi = multi($count, $perpage, $page, $theurl); +} + +$optypehtml = ''; +include template('home/spacecp_credit_log'); +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_doing.php b/source/include/spacecp/spacecp_doing.php new file mode 100644 index 0000000..61fc62b --- /dev/null +++ b/source/include/spacecp/spacecp_doing.php @@ -0,0 +1,252 @@ + 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime)); + } + + $message = getstr($_POST['message'], 200, 0, 0, 1); + $message = preg_replace("/\/i", ' ', $message); + if(strlen($message) < 1) { + showmessage('should_write_that'); + } + + $message = censor($message, NULL, TRUE, TRUE); + if(is_array($message) && $message['message']) { + showmessage('do_success', dreferer(), array('message'=>$message['message'])); + } + + if(censormod($message) || $_G['group']['allowdoingmod']) { + $doing_status = 1; + } else { + $doing_status = 0; + } + + + $setarr = array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => $_G['timestamp'], + 'message' => $message, + 'ip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'status' => $doing_status, + ); + $newdoid = C::t('home_doing')->insert($setarr, 1); + + $setarr = array('recentnote'=>$message, 'spacenote'=>$message); + $credit = $experience = 0; + $extrasql = array('doings' => 1); + + updatecreditbyaction('doing', 0, $extrasql); + + C::t('common_member_field_home')->update($_G['uid'], $setarr); + + if($_POST['to_signhtml'] && $_G['group']['maxsigsize']) { + if($_G['group']['maxsigsize'] < 200) { + $signhtml = getstr($_POST['message'], $_G['group']['maxsigsize'], 0, 0, 1); + $signhtml = preg_replace("/\/i", ' ', $signhtml); + } else { + $signhtml = $message; + } + C::t('common_member_field_forum')->update($_G['uid'], array('sightml'=>$signhtml)); + } + + if(helper_access::check_module('feed') && ckprivacy('doing', 'feed') && $doing_status == '0') { + $feedarr = array( + 'icon' => 'doing', + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => $_G['timestamp'], + 'title_template' => lang('feed', 'feed_doing_title'), + 'title_data' => serialize(array('message'=>$message)), + 'body_template' => '', + 'body_data' => '', + 'id' => $newdoid, + 'idtype' => 'doid' + ); + C::t('home_feed')->insert($feedarr); + } + if($doing_status == '1') { + updatemoderate('doid', $newdoid); + manage_addnotify('verifydoing'); + } + + require_once libfile('function/stat'); + updatestat('doing'); + C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED'); + if(!empty($_GET['fromcard'])) { + showmessage($message.lang('spacecp','card_update_doing')); + } else { + showmessage('do_success', dreferer(), array('doid' => $newdoid), $_GET['spacenote'] ? array('showmsg' => false):array('header' => true)); + } + + } elseif (submitcheck('commentsubmit')) { + + if(!checkperm('allowdoing')) { + showmessage('no_privilege_doing_comment'); + } + cknewuser(); + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime)); + } + + $message = getstr($_POST['message'], 200, 0, 0, 1); + $message = preg_replace("/\/i", ' ', $message); + if(strlen($message) < 1) { + showmessage('should_write_that'); + } + $message = censor($message); + + + $updo = array(); + if($id) { + $updo = C::t('home_docomment')->fetch($id); + } + if(empty($updo) && $doid) { + $updo = C::t('home_doing')->fetch($doid); + } + if(empty($updo)) { + showmessage('docomment_error'); + } else { + if(isblacklist($updo['uid'])) { + showmessage('is_blacklist'); + } + } + + $updo['id'] = intval($updo['id']); + $updo['grade'] = intval($updo['grade']); + + $setarr = array( + 'doid' => $updo['doid'], + 'upid' => $updo['id'], + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'dateline' => $_G['timestamp'], + 'message' => $message, + 'ip' => $_G['clientip'], + 'port' => $_G['remoteport'], + 'grade' => $updo['grade']+1 + ); + + if($updo['grade'] >= 3) { + $setarr['upid'] = $updo['upid']; + } + + $newid = C::t('home_docomment')->insert($setarr, true); + + C::t('home_doing')->update_replynum_by_doid(1, $updo['doid']); + + if($updo['uid'] != $_G['uid']) { + notification_add($updo['uid'], 'comment', 'doing_reply', array( + 'url'=>"home.php?mod=space&uid={$updo['uid']}&do=doing&view=me&doid={$updo['doid']}&highlight=$newid", + 'from_id'=>$updo['doid'], + 'from_idtype'=>'doid')); + updatecreditbyaction('comment', 0, array(), 'doing'.$updo['doid']); + } + + include_once libfile('function/stat'); + updatestat('docomment'); + C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED'); + showmessage('do_success', dreferer(), array('doid' => $updo['doid'])); + } +} +if($_GET['op'] == 'delete') { + + if(submitcheck('deletesubmit')) { + if($id) { + $allowmanage = checkperm('managedoing'); + if($value = C::t('home_docomment')->fetch($id)) { + $home_doing = C::t('home_doing')->fetch($value['doid']); + $value['duid'] = $home_doing['uid']; + if($allowmanage || $value['uid'] == $_G['uid'] || $value['duid'] == $_G['uid'] ) { + C::t('home_docomment')->update($id, array('uid' => 0, 'username' => '', 'message' => '')); + if($value['uid'] != $_G['uid'] && $value['duid'] != $_G['uid']) { + batchupdatecredit('comment', $value['uid'], array(), -1); + } + C::t('home_doing')->update_replynum_by_doid(-1, $updo['doid']); + } + } + } else { + require_once libfile('function/delete'); + deletedoings(array($doid)); + } + + dheader('location: '.dreferer()); + exit(); + } + +} elseif ($_GET['op'] == 'getcomment') { + + include_once(DISCUZ_ROOT.'./source/class/lib/lib_tree.php'); + $tree = new lib_tree(); + + $list = array(); + $highlight = 0; + $count = 0; + + if(empty($_GET['close'])) { + foreach(C::t('home_docomment')->fetch_all_by_doid($doid) as $value) { + if(!empty($value['ip'])) { + $value['ip'] = ip::to_display($value['ip']); + } + $tree->setNode($value['id'], $value['upid'], $value); + $count++; + if($value['uid'] == $space['uid']) $highlight = $value['id']; + } + } + + if($count) { + $values = $tree->getChilds(); + foreach ($values as $key => $vid) { + $one = $tree->getValue($vid); + $one['layer'] = $tree->getLayer($vid) * 2; + $one['style'] = "padding-left:{$one['layer']}em;"; + if($one['layer'] > 0){ + if($one['layer']%3 == 2) { + $one['class'] = ' dtls'; + } else { + $one['class'] = ' dtll'; + } + } + if($one['id'] == $highlight && $one['uid'] == $space['uid']) { + $one['style'] .= 'color:#F60;'; + } + $list[] = $one; + } + } +} elseif ($_GET['op'] == 'spacenote') { + space_merge($space, 'field_home'); +} + +include template('home/spacecp_doing'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_domain.php b/source/include/spacecp/spacecp_domain.php new file mode 100644 index 0000000..10af0c1 --- /dev/null +++ b/source/include/spacecp/spacecp_domain.php @@ -0,0 +1,70 @@ +update($_G['uid'], $setarr); + require_once libfile('function/delete'); + deletedomain($_G['uid'], 'home'); + if(!empty($setarr['domain'])) { + C::t('common_domain')->insert(array('domain' => $setarr['domain'], 'domainroot' => $_G['setting']['domain']['root']['home'], 'id' => $_G['uid'], 'idtype' => 'home')); + } + } + + showmessage('domain_succeed', 'home.php?mod=spacecp&ac=domain'); +} + +loadcache('creditrule'); +getuserprofile('extcredits1'); +$rule = $_G['cache']['creditrule']['modifydomain']; + +$credits = $consume = $common = ''; +for($i = 1; $i <= 8; $i++) { + if($_G['setting']['extcredits'][$i] && $rule['extcredits'.$i]) { + $consume .= $common.$_G['setting']['extcredits'][$i]['title'].$rule['extcredits'.$i].$_G['setting']['extcredits'][$i]['unit']; + $credits .= $common.$_G['setting']['extcredits'][$i]['title'].$_G['member']['extcredits'.$i].$_G['setting']['extcredits'][$i]['unit']; + $common = ','; + } +} +$defaultop = ''; +$profilegroup = C::t('common_setting')->fetch_setting('profilegroup', true); + +$actives = array('profile' =>' class="a"'); +$opactives = array('domain' =>' class="a"'); + +include_once template("home/spacecp_domain"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_eccredit.php b/source/include/spacecp/spacecp_eccredit.php new file mode 100644 index 0000000..637b84f --- /dev/null +++ b/source/include/spacecp/spacecp_eccredit.php @@ -0,0 +1,170 @@ +count_list($from, $uid, $dateline, $score); + $multipage = multi($num, 10, $page, "home.php?mod=spacecp&ac=list&uid=$uid".($from ? "&from=$from" : NULL).($filter ? "&filter=$filter" : NULL).($level ? "&level=$level" : NULL)); + + $comments = array(); + foreach(C::t('forum_tradecomment')->fetch_all_list($from, $uid, $dateline, $score, $start_limit) as $comment) { + $comment['expiration'] = dgmdate($comment['dateline'] + 30 * 86400, 'u'); + $comment['dbdateline'] = $comment['dateline']; + $comment['dateline'] = dgmdate($comment['dateline'], 'u'); + $comment['baseprice'] = sprintf('%0.2f', $comment['baseprice']); + $comments[] = $comment; + } + + include template('home/spacecp_ec_list'); + +} elseif($_GET['op'] == 'rate' && ($orderid = $_GET['orderid']) && isset($_GET['type'])) { + + require_once libfile('function/trade'); + + $type = intval($_GET['type']); + if(!$type) { + $raterid = 'buyerid'; + $ratee = 'seller'; + $rateeid = 'sellerid'; + } else { + $raterid = 'sellerid'; + $ratee = 'buyer'; + $rateeid = 'buyerid'; + } + $order = C::t('forum_tradelog')->fetch($orderid); + if(!$order || $order[$raterid] != $_G['uid']) { + showmessage('eccredit_order_notfound'); + } elseif($order['ratestatus'] == 3 || ($type == 0 && $order['ratestatus'] == 1) || ($type == 1 && $order['ratestatus'] == 2)) { + showmessage('eccredit_rate_repeat'); + } elseif(!trade_typestatus('successtrades', $order['status']) && !trade_typestatus('refundsuccess', $order['status'])) { + showmessage('eccredit_nofound'); + } + + $uid = $_G['uid'] == $order['buyerid'] ? $order['sellerid'] : $order['buyerid']; + + if(!submitcheck('ratesubmit')) { + + include template('home/spacecp_ec_rate'); + + } else { + + $score = intval($_GET['score']); + $message = cutstr(dhtmlspecialchars($_GET['message']), 200); + $level = $score == 1 ? 'good' : ($score == 0 ? 'soso' : 'bad'); + $pid = intval($order['pid']); + $order = daddslashes($order, 1); + + C::t('forum_tradecomment')->insert(array( + 'pid' => $pid, + 'orderid' => $orderid, + 'type' => $type, + 'raterid' => $_G['uid'], + 'rater' => $_G['username'], + 'ratee' => $order[$ratee], + 'rateeid' => $order[$rateeid], + 'score' => $score, + 'message' => $message, + 'dateline' => $_G['timestamp'] + )); + + if(!$order['offline'] || $order['credit']) { + if(C::t('forum_tradecomment')->get_month_score($_G['uid'], $type, $order[$rateeid]) < $_G['setting']['ec_credit']['maxcreditspermonth']) { + updateusercredit($uid, $type ? 'sellercredit' : 'buyercredit', $level); + } + } + + if($type == 0) { + $ratestatus = $order['ratestatus'] == 2 ? 3 : 1; + } else { + $ratestatus = $order['ratestatus'] == 1 ? 3 : 2; + } + + C::t('forum_tradelog')->update($order['orderid'], array('ratestatus' => $ratestatus)); + + if($ratestatus != 3) { + notification_add($order[$rateeid], 'goods', 'eccredit', array( + 'orderid' => $orderid, + ), 1); + } + + showmessage('eccredit_succeed', 'home.php?mod=space&uid='.$_G['uid'].'&do=trade&view=eccredit'); + + } + +} elseif($_GET['op'] == 'explain' && $_GET['id']) { + + $id = intval($_GET['id']); + $ajaxmenuid = $_GET['ajaxmenuid']; + if(!submitcheck('explainsubmit', 1)) { + include template('home/spacecp_ec_explain'); + } else { + $comment = C::t('forum_tradecomment')->fetch($id); + if(!$comment || $comment['rateeid'] != $_G['uid']) { + showmessage('eccredit_nofound'); + } elseif($comment['explanation']) { + showmessage('eccredit_reexplanation_repeat'); + } elseif($comment['dateline'] < TIMESTAMP - 30 * 86400) { + showmessage('eccredit_reexplanation_closed'); + } + + $explanation = cutstr(dhtmlspecialchars($_GET['explanation']), 200); + + C::t('forum_tradecomment')->update($id, array('explanation' => $explanation)); + + $language = lang('forum/misc'); + showmessage($language['eccredit_explain'].': '.$explanation, '', array(), array('msgtype' => 3, 'showmsg' => 1)); + } + +} +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_favorite.php b/source/include/spacecp/spacecp_favorite.php new file mode 100644 index 0000000..8bfd76c --- /dev/null +++ b/source/include/spacecp/spacecp_favorite.php @@ -0,0 +1,220 @@ +fetch_all($_GET['favorite']); + foreach($data as $dataone) { + $deletecounter[$dataone['idtype']]['idtype'] = $dataone['idtype']; + $deletecounter[$dataone['idtype']]['id'][] = $dataone['id']; + } + foreach($deletecounter as $thevalue) { + deletefavorite($thevalue); + } + C::t('home_favorite')->delete($_GET['favorite'], false, $_G['uid']); + } + showmessage('favorite_delete_succeed', 'home.php?mod=space&uid='.$_G['uid'].'&do=favorite&view=me&type='.$_GET['type'].'&quickforward=1'); + } else { + $type = empty($_GET['type']) ? '' : $_GET['type']; + $id = empty($_GET['id']) ? 0 : intval($_GET['id']); + if($type && $id){ + switch($type) { + case 'thread': + $idtype = 'tid'; + break; + case 'forum': + $idtype = 'fid'; + break; + case 'blog': + $idtype = 'blogid'; + break; + case 'group': + $idtype = 'gid'; + break; + case 'album': + $idtype = 'albumid'; + break; + case 'space': + $idtype = 'uid'; + break; + case 'article': + $idtype = 'aid'; + break; + } + $thevalue = C::t('home_favorite')->fetch_by_id_idtype($id, $idtype, $_G['uid']); + $favid = $thevalue['favid']; + }else{ + $favid = intval($_GET['favid']); + $thevalue = C::t('home_favorite')->fetch($favid); + } + if(empty($thevalue) || $thevalue['uid'] != $_G['uid']) { + showmessage('favorite_does_not_exist'); + } + + if(submitcheck('deletesubmit')) { + deletefavorite($thevalue); + C::t('home_favorite')->delete($favid); + showmessage('do_success', 'home.php?mod=space&uid='.$_G['uid'].'&do=favorite&view=me&type='.$_GET['type'].'&quickforward=1', array('favid' => $favid, 'id' => $thevalue['id']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true, 'locationtime' => 3)); + } + } + +} else { + + + cknewuser(); + + $type = empty($_GET['type']) ? '' : $_GET['type']; + $id = empty($_GET['id']) ? 0 : intval($_GET['id']); + $spaceuid = empty($_GET['spaceuid']) ? 0 : intval($_GET['spaceuid']); + $idtype = $title = $icon = ''; + switch($type) { + case 'thread': + $idtype = 'tid'; + $thread = C::t('forum_thread')->fetch_thread($id); + $title = $thread['subject']; + $icon = 'thread '; + break; + case 'forum': + $idtype = 'fid'; + $foruminfo = C::t('forum_forum')->fetch($id); + loadcache('forums'); + $forum = $_G['cache']['forums'][$id]; + if(!$forum['viewperm'] || ($forum['viewperm'] && forumperm($forum['viewperm'])) || strstr($forum['users'], "\t{$_G['uid']}\t")) { + $title = $foruminfo['status'] != 3 ? $foruminfo['name'] : ''; + $icon = 'forum '; + } + break; + case 'blog': + $idtype = 'blogid'; + $bloginfo = C::t('home_blog')->fetch($id); + $title = ($bloginfo['uid'] == $spaceuid) ? $bloginfo['subject'] : ''; + $icon = 'blog '; + break; + case 'group': + $idtype = 'gid'; + $foruminfo = C::t('forum_forum')->fetch($id); + $title = $foruminfo['status'] == 3 ? $foruminfo['name'] : ''; + $icon = 'group '; + break; + case 'album': + $idtype = 'albumid'; + $result = C::t('home_album')->fetch_album($id, $spaceuid); + $title = $result['albumname']; + $icon = 'album '; + break; + case 'space': + $idtype = 'uid'; + $_member = getuserbyuid($id); + $title = $_member['username']; + $unset($_member); + $icon = 'space '; + break; + case 'article': + $idtype = 'aid'; + $article = C::t('portal_article_title')->fetch($id); + $title = $article['title']; + $icon = 'article '; + break; + } + if(empty($idtype) || empty($title)) { + showmessage('favorite_cannot_favorite'); + } + + $fav = C::t('home_favorite')->fetch_by_id_idtype($id, $idtype, $_G['uid']); + if($fav) { + showmessage('favorite_repeat'); + } + $description = $extrajs = ''; + $description_show = nl2br($description); + + $fav_count = C::t('home_favorite')->count_by_id_idtype($id, $idtype); + if(submitcheck('favoritesubmit') || ($type == 'forum' || $type == 'group' || $type == 'thread') && $_GET['formhash'] == FORMHASH) { + $arr = array( + 'uid' => intval($_G['uid']), + 'idtype' => $idtype, + 'id' => $id, + 'spaceuid' => $spaceuid, + 'title' => getstr($title, 255), + 'description' => getstr($_POST['description'], '', 0, 0, 1), + 'dateline' => TIMESTAMP + ); + $favid = C::t('home_favorite')->insert($arr, true); + + switch($type) { + case 'thread': + C::t('forum_thread')->increase($id, array('favtimes'=>1)); + require_once libfile('function/forum'); + update_threadpartake($id); + break; + case 'forum': + C::t('forum_forum')->update_forum_counter($id, 0, 0, 0, 0, 1); + $extrajs = ''; + dsetcookie('nofavfid', '', -1); + break; + case 'blog': + C::t('home_blog')->increase($id, $spaceuid, array('favtimes' => 1)); + break; + case 'group': + C::t('forum_forum')->update_forum_counter($id, 0, 0, 0, 0, 1); + break; + case 'album': + C::t('home_album')->update_num_by_albumid($id, 1, 'favtimes', $spaceuid); + break; + case 'space': + C::t('common_member_status')->increase($id, array('favtimes' => 1)); + break; + case 'article': + C::t('portal_article_count')->increase($id, array('favtimes' => 1)); + break; + } + showmessage('favorite_do_success', dreferer(), array('id' => $id, 'favid' => $favid), array('showdialog' => true, 'closetime' => true, 'extrajs' => $extrajs)); + } +} + +include template('home/spacecp_favorite'); + +function deletefavorite($thevalue = array()){ + switch($thevalue['idtype']) { + case 'tid': + C::t('forum_thread')->increase($thevalue['id'], array('favtimes'=>-1)); + break; + case 'fid': + C::t('forum_forum')->update_forum_counter($thevalue['id'], 0, 0, 0, 0, -1); + break; + case 'blogid': + C::t('home_blog')->increase($thevalue['id'], 0, array('favtimes' => -1)); + break; + case 'gid': + C::t('forum_forum')->update_forum_counter($thevalue['id'], 0, 0, 0, 0, -1); + break; + case 'albumid': + C::t('home_album')->update_num_by_albumid($thevalue['id'], -1, 'favtimes', 0); + break; + case 'uid': + C::t('common_member_status')->increase($thevalue['id'], array('favtimes' => -1)); + break; + case 'aid': + C::t('portal_article_count')->increase($thevalue['id'], array('favtimes' => -1)); + break; + } +} + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_feed.php b/source/include/spacecp/spacecp_feed.php new file mode 100644 index 0000000..6a31e5f --- /dev/null +++ b/source/include/spacecp/spacecp_feed.php @@ -0,0 +1,141 @@ +fetch_feed('', '', '', $feedid)) { + showmessage('feed_no_found'); + } +} + +if(submitcheck('commentsubmit')) { + + if(empty($feed['id']) || empty($feed['idtype'])) { + showmessage('non_normal_operation'); + } + + if($feed['idtype'] == 'doid') { + + $_GET['id'] = intval($_POST['cid']); + $_GET['doid'] = $feed['id']; + + require_once libfile('spacecp/doing', 'include'); + + } else { + $_POST['id'] = $feed['id']; + $_POST['idtype'] = $feed['idtype']; + + require_once libfile('spacecp/comment', 'include'); + } +} + +if($_GET['op'] == 'delete') { + if(submitcheck('feedsubmit')) { + require_once libfile('function/delete'); + if(deletefeeds(array($feedid))) { + showmessage('do_success', dreferer(), array('feedid' => $feedid)); + } else { + showmessage('no_privilege_feed_del'); + } + } +} elseif($_GET['op'] == 'ignore') { + + $icon = empty($_GET['icon'])?'':preg_replace("/[^0-9a-zA-Z\_\-\.]/", '', $_GET['icon']); + if(submitcheck('feedignoresubmit')) { + $uid = empty($_POST['uid'])?0:intval($_POST['uid']); + if($icon) { + $icon_uid = $icon.'|'.$uid; + if(empty($space['privacy']['filter_icon']) || !is_array($space['privacy']['filter_icon'])) { + $space['privacy']['filter_icon'] = array(); + } + $space['privacy']['filter_icon'][$icon_uid] = $icon_uid; + privacy_update(); + } + showmessage('do_success', dreferer(), array('feedid' => $feedid), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } +} elseif($_GET['op'] == 'getapp') { + +} elseif($_GET['op'] == 'getcomment') { + + if(empty($feed['id']) || empty($feed['idtype'])) { + showmessage('non_normal_operation'); + } + $feedid = $feed['feedid']; + + $list = array(); + $multi = ''; + + if($feed['idtype'] == 'doid') { + + $_GET['doid'] = $feed['id']; + require_once libfile('spacecp/doing', 'include'); + + } else { + + $perpage = 5; + $start = ($page-1)*$perpage; + + ckstart($start, $perpage); + $count = C::t('home_comment')->count_by_id_idtype($feed['id'], $feed['idtype']); + if($count) { + $query = C::t('home_comment')->fetch_all_by_id_idtype($feed['id'], $feed['idtype'], $start, $perpage); + foreach($query as $value) { + $list[] = $value; + } + $multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=feed&op=getcomment&feedid=$feedid"); + } + + + } +} elseif($_GET['op'] == 'menu') { + + $allowmanage = checkperm('managefeed'); + if(empty($feed['uid'])) { + showmessage('non_normal_operation'); + } + +} else { + + $url = "home.php?mod=space&uid={$feed['uid']}&quickforward=1"; + switch ($feed['idtype']) { + case 'doid': + $url .= "&do=doing&id={$feed['id']}"; + break; + case 'blogid': + $url .= "&do=blog&id={$feed['id']}"; + break; + case 'picid': + $url .= "&do=album&picid={$feed['id']}"; + break; + case 'albumid': + $url .= "&do=album&id={$feed['id']}"; + break; + case 'sid': + $url .= "&do=share&id={$feed['id']}"; + break; + default: + break; + } + dheader('location:'.$url); +} + +include template('home/spacecp_feed'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_follow.php b/source/include/spacecp/spacecp_follow.php new file mode 100644 index 0000000..87dc249 --- /dev/null +++ b/source/include/spacecp/spacecp_follow.php @@ -0,0 +1,275 @@ +fetch($followuid); + if(!$fields['allowasfollow']) { + showmessage('follow_other_unfollow'); + } + $mutual = 0; + $followed = C::t('home_follow')->fetch_by_uid_followuid($followuid, $_G['uid']); + if(!empty($followed)) { + if($followed['status'] == '-1') { + showmessage('follow_other_unfollow'); + } + $mutual = 1; + C::t('home_follow')->update_by_uid_followuid($followuid, $_G['uid'], array('mutual'=>1)); + } + $followed = C::t('home_follow')->fetch_by_uid_followuid($_G['uid'], $followuid); + if(empty($followed)) { + $followdata = array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'followuid' => $followuid, + 'fusername' => $followuser['username'], + 'status' => 0, + 'mutual' => $mutual, + 'dateline' => TIMESTAMP + ); + C::t('home_follow')->insert($followdata, false, true); + C::t('common_member_count')->increase($_G['uid'], array('following' => 1)); + C::t('common_member_count')->increase($followuid, array('follower' => 1, 'newfollower' => 1)); + if($_G['setting']['followaddnotice']) { + notification_add($followuid, 'follower', 'member_follow_add', array('count' => $count, 'from_id'=>$_G['uid'], 'from_idtype' => 'following'), 1); + } + } elseif($special) { + $status = $special == 1 ? 1 : 0; + C::t('home_follow')->update_by_uid_followuid($_G['uid'], $followuid, array('status'=>$status)); + $special = $special == 1 ? 2 : 1; + } else { + showmessage('follow_followed_ta'); + } + $type = !$special ? 'add' : 'special'; + showmessage('follow_add_succeed', dreferer(), array('fuid' => $followuid, 'type' => $type, 'special' => $special, 'from' => !empty($_GET['from']) ? $_GET['from'] : 'list'), array('closetime' => '2', 'showmsg' => '1')); +} elseif($op == 'del') { + $_GET['handlekey'] = $_GET['handlekey'] ? $_GET['handlekey'] : 'followmod'; + $delfollowuid = intval($_GET['fuid']); + if(empty($delfollowuid)) { + exit('Access Denied'); + } + $affectedrows = C::t('home_follow')->delete_by_uid_followuid($_G['uid'], $delfollowuid); + if($affectedrows) { + C::t('home_follow')->update_by_uid_followuid($delfollowuid, $_G['uid'], array('mutual'=>0)); + C::t('common_member_count')->increase($_G['uid'], array('following' => -1)); + C::t('common_member_count')->increase($delfollowuid, array('follower' => -1, 'newfollower' => -1)); + } + showmessage('follow_cancel_succeed', dreferer(), array('fuid' => $delfollowuid, 'type' => 'del', 'from' => !empty($_GET['from']) ? $_GET['from'] : 'list'), array('closetime' => '2', 'showmsg' => '1')); +} elseif($op == 'bkname') { + $followuid = intval($_GET['fuid']); + $followuser = C::t('home_follow')->fetch_by_uid_followuid($_G['uid'], $followuid); + if(empty($followuser)) { + showmessage('follow_not_assignation_user'); + } + if(submitcheck('editbkname')) { + $bkname = cutstr(strip_tags($_GET['bkname']), 30, ''); + C::t('home_follow')->update_by_uid_followuid($_G['uid'], $followuid, array('bkname'=>$bkname)); + showmessage('follow_remark_succeed', dreferer(), array('bkname' => $bkname, 'btnstr' => empty($bkname) ? lang('spacecp', 'follow_add_remark') : lang('spacecp', 'follow_modify_remark')), array('showdialog'=>true, 'closetime' => true)); + } +} elseif($op == 'newthread') { + + if(!helper_access::check_module('follow')) { + showmessage('quickclear_noperm'); + } + + if(submitcheck('topicsubmit')) { + + if(empty($_GET['syncbbs'])) { + $fid = intval($_G['setting']['followforumid']); + if(!($fid && C::t('forum_forum')->fetch($fid))) { + $fid = 0; + } + if(!$fid) { + $gid = C::t('forum_forum')->fetch_fid_by_name(lang('spacecp', 'follow_specified_group')); + if(!$gid) { + $gid = C::t('forum_forum')->insert(array('type' => 'group', 'name' => lang('spacecp', 'follow_specified_group'), 'status' => 0), true); + C::t('forum_forumfield')->insert(array('fid' => $gid)); + } + $forumarr = array( + 'fup' => $gid, + 'type' => 'forum', + 'name' => lang('spacecp', 'follow_specified_forum'), + 'status' => 1, + 'allowsmilies' => 1, + 'allowbbcode' => 1, + 'allowimgcode' => 1 + ); + $fid = C::t('forum_forum')->insert($forumarr, true); + C::t('forum_forumfield')->insert(array('fid' => $fid)); + C::t('common_setting')->update_setting('followforumid', $fid); + include libfile('function/cache'); + updatecache('setting'); + } + + } else { + $fid = intval($_GET['fid']); + } + loadcache(array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes', 'domainwhitelist', 'albumcategory')); + + if(empty($_GET['syncbbs'])) { + $_GET['subject'] = cutstr($_GET['message'], 75, ''); + } + $_POST['replysubmit'] = true; + $_GET['fid'] = $fid; + $_GET['action'] = 'newthread'; + $_GET['allownoticeauthor'] = '1'; + include_once libfile('function/forum'); + require_once libfile('function/post'); + loadforum(); + $_G['forum']['picstyle'] = 0; + $skipmsg = 1; + include_once libfile('forum/post', 'module'); + } +} elseif($op == 'relay') { + + if(!helper_access::check_module('follow')) { + showmessage('quickclear_noperm'); + } + $tid = intval($_GET['tid']); + $preview = $post = array(); + $preview = C::t('forum_threadpreview')->fetch($tid); + if(empty($preview)) { + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid); + if($post['anonymous']) { + showmessage('follow_anonymous_unfollow'); + } + } + if(empty($post) && empty($preview)) { + showmessage('follow_content_not_exist'); + } + + if(submitcheck('relaysubmit')) { + if(strlen($_GET['note'])>140) { + showmessage('follow_input_word_limit'); + } + $count = C::t('home_follow_feed')->count_by_uid_tid($_G['uid'], $tid); + if(!$count) { + $count = C::t('home_follow_feed')->count_by_uid_tid($_G['uid'], $tid); + } + if($count && empty($_GET['addnewreply'])) { + showmessage('follow_only_allow_the_relay_time'); + } + if($_GET['addnewreply']) { + + $_G['setting']['seccodestatus'] = 0; + $_G['setting']['secqaa']['status'] = 0; + + $_POST['replysubmit'] = true; + $_GET['tid'] = $tid; + $_GET['action'] = 'reply'; + $_GET['message'] = $_GET['note']; + include_once libfile('function/forum'); + require_once libfile('function/post'); + loadforum(); + + $inspacecpshare = 1; + include_once libfile('forum/post', 'module'); + } + require_once libfile('function/discuzcode'); + require_once libfile('function/followcode'); + $followfeed = array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'tid' => $tid, + 'note' => cutstr(followcode(dhtmlspecialchars($_GET['note']), 0, 0, 0, false), 140), + 'dateline' => TIMESTAMP + ); + C::t('home_follow_feed')->insert($followfeed); + C::t('common_member_count')->increase($_G['uid'], array('feeds'=>1)); + if(empty($preview)) { + require_once libfile('function/discuzcode'); + require_once libfile('function/followcode'); + $feedcontent = array( + 'tid' => $tid, + 'content' => followcode($post['message'], $post['tid'], $post['pid'], 1000), + ); + C::t('forum_threadpreview')->insert($feedcontent); + C::t('forum_thread')->update_status_by_tid($tid, '512'); + } else { + C::t('forum_threadpreview')->update_relay_by_tid($tid, 1); + } + showmessage('relay_feed_success', dreferer(), array(), array('showdialog'=>true, 'closetime' => true)); + } + $fastpost = $_G['setting']['fastpost']; +} elseif($op == 'checkfeed') { + + header('Content-Type: text/javascript'); + + require_once libfile("function/member"); + checkfollowfeed(); + exit; +} elseif($op == 'getfeed') { + $archiver = $_GET['archiver'] ? true : false; + $uid = intval($_GET['uid']); + $page = empty($_GET['page']) ? 1 : intval($_GET['page']); + if($page<1) $page=1; + $perpage = 20; + $start = ($page-1)*$perpage; + if($uid) { + $list = getfollowfeed($uid, 'self', $archiver, $start, $perpage); + } else { + $type = in_array($_GET['viewtype'], array('special', 'follow', 'other')) ? $_GET['viewtype'] : 'follow'; + $list = getfollowfeed($type == 'other' ? 0 : $_G['uid'], $type, $archiver, $start, $perpage); + } + if(empty($list['feed'])) { + $list = false; + } + if(!isset($_G['cache']['forums'])) { + loadcache('forums'); + } +} elseif($op == 'delete') { + $archiver = false; + $feed = C::t('home_follow_feed')->fetch_by_feedid($_GET['feedid']); + if(empty($feed)) { + $feed = C::t('home_follow_feed')->fetch_by_feedid($_GET['feedid'], true); + $archiver = true; + } + if(empty($feed)) { + showmessage('follow_specify_follow_not_exist', '', array(), array('return' => true)); + } elseif($feed['uid'] != $_G['uid'] && $_G['adminid'] != 1) { + showmessage('quickclear_noperm', '', array(), array('return' => true)); + } + + if(submitcheck('deletesubmit')) { + if(C::t('home_follow_feed')->delete_by_feedid($_GET['feedid'], $archiver)) { + C::t('common_member_count')->increase($feed['uid'], array('feeds'=>-1)); + C::t('forum_threadpreview')->update_relay_by_tid($feed['tid'], -1); + showmessage('do_success', dreferer(), array('feedid' => $_GET['feedid']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } else { + showmessage('failed_to_delete_operation'); + } + } +} +include template('home/spacecp_follow'); +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_friend.php b/source/include/spacecp/spacecp_friend.php new file mode 100644 index 0000000..5513355 --- /dev/null +++ b/source/include/spacecp/spacecp_friend.php @@ -0,0 +1,549 @@ +' class="a"'); + +if($op == 'add') { + + if(!checkperm('allowfriend')) { + showmessage('no_privilege_addfriend'); + } + + if($uid == $_G['uid']) { + showmessage('friend_self_error'); + } + + if(friend_check($uid)) { + showmessage('you_have_friends'); + } + + $tospace = getuserbyuid($uid); + if(empty($tospace)) { + showmessage('space_does_not_exist'); + } + + $fields = C::t('common_member_field_home')->fetch($uid); + if(!$fields['allowasfriend']) { + showmessage('is_blacklist'); + } + + if(isblacklist($tospace['uid'])) { + showmessage('is_blacklist'); + } + + $groups = friend_group_list(); + + space_merge($space, 'count'); + space_merge($space, 'field_home'); + + $maxfriendnum = checkperm('maxfriendnum'); + if($maxfriendnum && $space['friends'] >= $maxfriendnum + $space['addfriend']) { + if($_G['setting']['magics']['friendnum']) { + showmessage('enough_of_the_number_of_friends_with_magic'); + } else { + showmessage('enough_of_the_number_of_friends'); + } + } + + if(friend_request_check($uid)) { + + if(submitcheck('add2submit')) { + + $_POST['gid'] = intval($_POST['gid']); + friend_add($uid, $_POST['gid']); + + if(ckprivacy('friend', 'feed')) { + require_once libfile('function/feed'); + feed_add('friend', 'feed_friend_title', array('touser'=>"{$tospace['username']}")); + } + + notification_add($uid, 'friend', 'friend_add'); + showmessage('friends_add', dreferer(), array('username' => $tospace['username'], 'uid'=>$uid, 'from' => $_GET['from']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + + $op = 'add2'; + $groupselect = empty($space['privacy']['groupname']) ? array(1 => ' checked') : array(); + $navtitle = lang('core', 'title_friend_add'); + include template('home/spacecp_friend'); + exit(); + + } else { + + if(C::t('home_friend_request')->count_by_uid_fuid($uid, $_G['uid'])) { + showmessage('waiting_for_the_other_test', '', array(), array('alert' => 'info')); + } + + if(submitcheck('addsubmit')) { + + $_POST['gid'] = intval($_POST['gid']); + $_POST['note'] = censor(htmlspecialchars(cutstr($_POST['note'], strtolower(CHARSET) == 'utf-8' ? 30 : 20, ''))); + friend_add($uid, $_POST['gid'], $_POST['note']); + + $note = array( + 'uid' => $_G['uid'], + 'url' => 'home.php?mod=spacecp&ac=friend&op=add&uid='.$_G['uid'].'&from=notice', + 'from_id' => $_G['uid'], + 'from_idtype' => 'friendrequest', + 'note' => !empty($_POST['note']) ? lang('spacecp', 'friend_request_note', array('note' => $_POST['note'])) : '' + ); + + notification_add($uid, 'friend', 'friend_request', $note); + + require_once libfile('function/mail'); + $values = array( + 'username' => $tospace['username'], + 'url' => $_G['setting']['securesiteurl'].'home.php?mod=spacecp&ac=friend&op=request' + ); + sendmail_touser($uid, lang('spacecp', 'friend_subject', $values), '', 'friend_add'); + showmessage('request_has_been_sent', dreferer(), array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + + } else { + include_once template('home/spacecp_friend'); + exit(); + } + } + +} elseif($op == 'ignore') { + + if($uid) { + if(submitcheck('friendsubmit')) { + + if(friend_check($uid)) { + friend_delete($uid); + } else { + friend_request_delete($uid); + } + showmessage('do_success', 'home.php?mod=spacecp&ac=friend&op=request', array('uid'=>$uid, 'from' => $_GET['from']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => 0)); + } + } elseif($_GET['key'] == $space['key']) { + $count = C::t('home_friend_request')->count_by_uid($_G['uid']); + if($count) { + C::t('home_friend_request')->delete_by_uid($_G['uid']); + + dsetcookie('promptstate_'.$_G['uid'], $space['newprompt'], 31536000); + } + showmessage('do_success', 'home.php?mod=spacecp&ac=friend&op=request'); + } + +} elseif($op == 'addconfirm') { + + if(!checkperm('allowfriend')) { + showmessage('no_privilege_addfriend'); + } + if($_GET['key'] == $space['key']) { + + $maxfriendnum = checkperm('maxfriendnum'); + space_merge($space, 'field_home'); + space_merge($space, 'count'); + + if($maxfriendnum && $space['friends'] >= $maxfriendnum + $space['addfriend']) { + if($_G['magic']['friendnum']) { + showmessage('enough_of_the_number_of_friends_with_magic'); + } else { + showmessage('enough_of_the_number_of_friends'); + } + } + + if($value = C::t('home_friend_request')->fetch_by_uid($space['uid'])) { + friend_add($value['fuid']); + showmessage('friend_addconfirm_next', 'home.php?mod=spacecp&ac=friend&op=addconfirm&key='.$space['key'], array('username' => $value['fusername']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + } + + showmessage('do_success', 'home.php?mod=spacecp&ac=friend&op=request&quickforward=1'); + +} elseif($op == 'find') { + + $maxnum = 36; + + $recommenduser = $myfuids = $fuids =array(); + + $i = 0; + $query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, 0, true); + foreach($query as $value) { + if($i < 100) { + $fuids[$value['fuid']] = $value['fuid']; + } + $myfuids[$value['fuid']] = $value['fuid']; + $i++; + } + $myfuids[$space['uid']] = $space['uid']; + + foreach(C::t('home_specialuser')->range() as $value) { + $recommenduser[$value['uid']] = $value; + } + + $i = 0; + $nearlist = array(); + foreach(C::app()->session->fetch_all_by_ip($_G['clientip'], 200) as $value) { + if($value['uid'] && empty($myfuids[$value['uid']])) { + $nearlist[$value['uid']] = $value; + $i++; + if($i>=$maxnum) break; + } + } + + $i = 0; + $friendlist = array(); + if($fuids) { + $query = C::t('home_friend')->fetch_all_by_uid($fuids, 0, 200); + $fuids[$space['uid']] = $space['uid']; + foreach($query as $value) { + $value['fuid'] = $value['uid']; + $value['fusername'] = $value['username']; + if(empty($myfuids[$value['uid']])) { + $friendlist[$value['uid']] = $value; + $i++; + if($i>=$maxnum) break; + } + } + } + + $i = 0; + $onlinelist = array(); + foreach(C::app()->session->fetch_member(1, 2, 200) as $value) { + if(empty($myfuids[$value['uid']]) && !isset($onlinelist[$value['uid']])) { + $onlinelist[$value['uid']] = $value; + $i++; + if($i>=$maxnum) break; + } + } + $navtitle = lang('core', 'title_people_might_know'); + +} elseif($op == 'changegroup') { + + if(submitcheck('changegroupsubmit')) { + C::t('home_friend')->update_by_uid_fuid($_G['uid'], $uid, array('gid'=>intval($_POST['group']))); + friend_cache($_G['uid']); + showmessage('do_success', dreferer(), array('gid'=>intval($_POST['group'])), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + + $query = C::t('home_friend')->fetch_all_by_uid_fuid($_G['uid'], $uid); + if(!$friend = $query[0]) { + showmessage('specified_user_is_not_your_friend'); + } + $groupselect = array($friend['gid'] => ' checked'); + + $groups = friend_group_list(); + + +} elseif($op == 'editnote') { + + if(submitcheck('editnotesubmit')) { + $note = getstr($_POST['note'], 20); + C::t('home_friend')->update_by_uid_fuid($_G['uid'], $uid, array('note'=>$note)); + showmessage('do_success', dreferer(), array('uid'=>$uid, 'note'=>$note), array('showdialog'=>1, 'msgtype' => 2, 'closetime' => true)); + } + + $query = C::t('home_friend')->fetch_all_by_uid_fuid($_G['uid'], $uid); + if(!$friend = $query[0]) { + showmessage('specified_user_is_not_your_friend'); + } + + +} elseif($op == 'changenum') { + + if(submitcheck('changenumsubmit')) { + $num = abs(intval($_POST['num'])); + if($num > 9999) $num = 9999; + C::t('home_friend')->update_by_uid_fuid($_G['uid'], $uid, array('num'=>$num)); + friend_cache($_G['uid']); + showmessage('do_success', dreferer(), array('fuid'=>$uid, 'num'=>$num), array('showmsg' => true, 'timeout' => 3, 'return'=>1)); + } + + $query = C::t('home_friend')->fetch_all_by_uid_fuid($_G['uid'], $uid); + if(!$friend = $query[0]) { + showmessage('specified_user_is_not_your_friend'); + } + +} elseif($op == 'group') { + + if(submitcheck('groupsubmin')) { + if(empty($_POST['fuids'])) { + showmessage('please_correct_choice_groups_friend', dreferer()); + } + $ids = $_POST['fuids']; + $groupid = intval($_POST['group']); + C::t('home_friend')->update_by_uid_fuid($_G['uid'], $ids, array('gid'=>$groupid)); + friend_cache($_G['uid']); + showmessage('do_success', dreferer()); + } + + $perpage = 50; + $perpage = mob_perpage($perpage); + + $page = empty($_GET['page'])?1:intval($_GET['page']); + if($page<1) $page = 1; + $start = ($page-1)*$perpage; + + $list = array(); + $multi = $wheresql = ''; + + space_merge($space, 'count'); + + if($space['friends']) { + + $groups = friend_group_list(); + + $theurl = 'home.php?mod=spacecp&ac=friend&op=group'; + $group = !isset($_GET['group'])?'-1':intval($_GET['group']); + if($group > -1) { + $wheresql = "AND main.gid='$group'"; + $theurl .= "&group=$group"; + } + + $count = C::t('home_friend')->fetch_all_search($space['uid'], $group, '', true); + if($count) { + $query = C::t('home_friend')->fetch_all_search($space['uid'], $group, '', false, $start, $perpage, true); + foreach($query as $value) { + $value['uid'] = $value['fuid']; + $value['username'] = $value['fusername']; + $value['group'] = $groups[$value['gid']]; + $list[] = $value; + } + } + $multi = multi($count, $perpage, $page, $theurl); + } + + $actives = array('group'=>' class="a"'); + + + +} elseif($op == 'request') { + + if(submitcheck('requestsubmin')) { + showmessage('do_success', dreferer()); + } + + $maxfriendnum = checkperm('maxfriendnum'); + if($maxfriendnum) { + $maxfriendnum = $maxfriendnum + $space['addfriend']; + } + + $perpage = 20; + $perpage = mob_perpage($perpage); + + $page = empty($_GET['page'])?0:intval($_GET['page']); + if($page<1) $page = 1; + $start = ($page-1)*$perpage; + + $list = $ols = array(); + + $count = C::t('home_friend_request')->count_by_uid($space['uid']); + if($count) { + $fuids = array(); + foreach(C::t('home_friend_request')->fetch_all_by_uid($space['uid'], $start, $perpage) as $value) { + $fuids[$value['fuid']] = $value['fuid']; + $list[$value['fuid']] = $value; + } + if (!empty($fuids)) { + foreach(C::app()->session->fetch_all_by_uid($fuids) as $value) { + if(!$value['invisible']) { + $ols[$value['uid']] = 1; + } + } + } + } else { + + dsetcookie('promptstate_'.$space['uid'], $space['newprompt'], 31536000); + + } + + $multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=friend&op=request"); + + $navtitle = lang('core', 'title_friend_request'); + +} elseif($op == 'groupname') { + + $groups = friend_group_list(); + $group = intval($_GET['group']); + if(!isset($groups[$group])) { + showmessage('change_friend_groupname_error'); + } + space_merge($space, 'field_home'); + if(submitcheck('groupnamesubmit')) { + $space['privacy']['groupname'][$group] = getstr($_POST['groupname'], 20); + privacy_update(); + showmessage('do_success', dreferer(), array('gid'=>$group), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } +} elseif($op == 'groupignore') { + + $groups = friend_group_list(); + $group = intval($_GET['group']); + if(!isset($groups[$group])) { + showmessage('change_friend_groupname_error'); + } + space_merge($space, 'field_home'); + if(submitcheck('groupignoresubmit')) { + if(isset($space['privacy']['filter_gid'][$group])) { + unset($space['privacy']['filter_gid'][$group]); + $ignore = false; + } else { + $space['privacy']['filter_gid'][$group] = $group; + $ignore = true; + } + privacy_update(); + friend_cache($_G['uid']); + + showmessage('do_success', dreferer(), array('group' => $group, 'ignore' => $ignore), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + +} elseif($op == 'blacklist') { + + if($_GET['subop'] == 'delete') { + $_GET['uid'] = intval($_GET['uid']); + C::t('home_blacklist')->delete_by_uid_buid($space['uid'], $_GET['uid']); + $count = C::t('home_blacklist')->count_by_uid_buid($space['uid']); + C::t('common_member_count')->update($_G['uid'], array('blacklist' => $count)); + showmessage('do_success', "home.php?mod=space&uid={$_G['uid']}&do=friend&view=blacklist&quickforward=1&start={$_GET['start']}"); + } + + if(submitcheck('blacklistsubmit')) { + $_POST['username'] = trim($_POST['username']); + if(!($tospace = C::t('common_member')->fetch_by_username($_POST['username']))) { + showmessage('space_does_not_exist'); + } + if($tospace['uid'] == $space['uid']) { + showmessage('unable_to_manage_self'); + } + + friend_delete($tospace['uid']); + + C::t('home_blacklist')->insert(array('uid'=>$space['uid'], 'buid'=>$tospace['uid'], 'dateline'=>$_G['timestamp']), false, false, true); + + $count = C::t('home_blacklist')->count_by_uid_buid($space['uid']); + C::t('common_member_count')->update($_G['uid'], array('blacklist' => $count)); + showmessage('do_success', "home.php?mod=space&uid={$_G['uid']}&do=friend&view=blacklist&quickforward=1&start={$_GET['start']}"); + } + +} elseif($op == 'rand') { + + $userlist = $randuids = array(); + space_merge($space, 'count'); + if($space['friends']<5) { + $userlist = C::app()->session->fetch_member(1, 2, 100); + } else { + $query = C::t('home_friend')->fetch($_G['uid']); + foreach($query as $value) { + $userlist[$value['uid']] = $value['fuid']; + } + } + unset($userlist[$space['uid']]); + + $randuids = sarray_rand($userlist, 1); + showmessage('do_success', "home.php?mod=space&quickforward=1&uid=".array_pop($randuids)); + +} elseif ($op == 'getcfriend') { + + $fuid = empty($_GET['fuid']) ? 0 : intval($_GET['fuid']); + + $list = array(); + if($fuid) { + $friend = $friendlist = array(); + $query = C::t('home_friend')->fetch_all_by_uid_common($space['uid'], $fuid); + foreach($query as $value) { + $friendlist[$value['uid']][] = $value['fuid']; + $friend[$value['fuid']] = $value; + } + if($friendlist[$_G['uid']] && $friendlist[$fuid]) { + $cfriend = array_intersect($friendlist[$_G['uid']], $friendlist[$fuid]); + $i = 0; + foreach($cfriend as $key => $uid) { + if(isset($friend[$uid])) { + $list[] = array('uid' => $friend[$uid]['fuid'], 'username' => $friend[$uid]['fusername']); + $i++; + if($i >= 15) break; + } + } + } + + } +} elseif($op == 'getinviteuser') { + require_once libfile('function/search'); + $perpage = 20; + $username = empty($_GET['username'])?'':searchkey($_GET['username'], "f.fusername LIKE '{text}%'"); + $page = empty($_GET['page'])?0:intval($_GET['page']); + $gid = isset($_GET['gid']) ? intval($_GET['gid']) : -1; + if($page<1) $page = 1; + $start = ($page-1) * $perpage; + $json = array(); + $wheresql = ''; + if($gid > -1) { + $wheresql .= " AND f.gid='$gid'"; + } + if(!empty($username)) { + $wheresql .= $username; + } + + $count = $count_at = $singlenum = 0; + if($_GET['at'] == 1 && $gid < 0) { + $count_at = C::t('home_follow')->count_by_uid_username($_G['uid'], $_GET['username']); + if($count_at) { + foreach(C::t('home_follow')->fetch_all_by_uid_username($_G['uid'], $_GET['username'], $start, $perpage) as $value) { + $value['fusername'] = daddslashes($value['fusername']); + $value['avatar'] = avatar($value['followuid'], 'small', true); + $singlenum++; + $json[$value['followuid']] = "{$value['followuid']}:{'uid':{$value['followuid']}, 'username':'{$value['fusername']}', 'avatar':'{$value['avatar']}'}"; + } + $perpage = $perpage - $singlenum; + $start = max($start - $count_at, 0); + } + + } + if($perpage && $gid != -2) { + $count = C::t('home_friend')->fetch_all_search($_G['uid'], $gid, $_GET['username'], true); + if($count) { + $homefriend = C::t('home_friend')->fetch_all_search($_G['uid'], $gid, $_GET['username'], false, $start, $perpage, true); + + $usrids = array(); + foreach($homefriend as $key=>$usrs) { + $usrids[$key] = $usrs['fuid']; + } + + $usernames = C::t('common_member')->fetch_all_username_by_uid($usrids); + foreach($homefriend as $value) { + $value['fusername'] = daddslashes($usernames[$value['fuid']]); + $value['avatar'] = avatar($value['fuid'], 'small', true); + $singlenum++; + $json[$value['fuid']] = "{$value['fuid']}:{'uid':{$value['fuid']}, 'username':'{$value['fusername']}', 'avatar':'{$value['avatar']}'}"; + } + } + } + $jsstr = "{'userdata':{".implode(',', $json)."}, 'maxfriendnum':'".($count+$count_at)."', 'singlenum':'$singlenum'}"; + +} elseif($op == 'search') { + + if(strlen($searchkey) < 2) { + showmessage('username_less_two_chars'); + } + + $list = array(); + $list = C::t('common_member')->fetch_all_by_like_username($searchkey, 0, 100); + $navtitle = lang('core', 'title_search_friend'); +} + +include template('home/spacecp_friend'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_index.php b/source/include/spacecp/spacecp_index.php new file mode 100644 index 0000000..deee590 --- /dev/null +++ b/source/include/spacecp/spacecp_index.php @@ -0,0 +1,333 @@ +fetch_all_by_uid($space['uid'], 'updatetime'); + foreach($query as $value) { + if (!isset($_GET['albumid']) && empty($albumid)) $albumid = $value['albumid']; + + $albumlist[$value['albumid']] = $value; + } + + $count = C::t('home_pic')->check_albumpic(0, NULL, $space['uid']); + $albumlist[0] = array( + 'uid' => $space['uid'], + 'albumid' => 0, + 'albumname' => lang('space', 'default_albumname'), + 'picnum' => $count + ); + + if ($albumid > 0) { + if (!isset($albumlist[$albumid])) { + showmessage('to_view_the_photo_does_not_exist'); + } + + $count = $albumlist[$albumid]['picnum']; + } else { + $wheresql = "albumid='0' AND uid='{$space['uid']}'"; + } + + $list = array(); + if($count) { + $query = C::t('home_pic')->fetch_all_by_albumid($albumid, $start, $perpage, 0, 0, 1, ($albumid > 0 ? 0 : $space['uid'])); + foreach($query as $value) { + $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']); + $list[] = $value; + } + } + + $_GET['ajaxtarget'] = empty($_GET['ajaxtarget']) ? 'diyimages' : $_GET['ajaxtarget']; + $multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=index&op=image&albumid=$albumid"); + +} elseif ($op == 'getblock') { + + $blockname = getstr($_GET['blockname'],15); + $blockhtml = ''; + if(check_ban_block($name, $space)) { + space_merge($space,'field_home'); + $data = getuserdiydata($space); + $blockhtml = getblockhtml($blockname, $data['parameters'][$blockname]); + } + +} elseif ($op == 'edit') { + + $blockname = getstr($_GET['blockname'],15); + $blockdata = lang('space','blockdata'); + if (!empty($blockdata[$blockname]) && check_ban_block($blockname, $space)) { + space_merge($space,'field_home'); + $userdiy = getuserdiydata($space); + $para = $userdiy['parameters'][$blockname]; + $para['title'] = !isset($para['title']) ? $blockdata[$blockname] : $para['title']; + } else { + showmessage('the_block_is_not_available'); + } +} elseif ($op == 'editnv') { + space_merge($space,'field_home'); + $blockposition = dunserialize($space['blockposition']); + $personalnv = !empty($blockposition) && isset($blockposition['nv']) ? $blockposition['nv'] : ''; +} elseif ($op == 'savespaceinfo') { + space_merge($space,'field_home'); + if (submitcheck('savespaceinfosubmit')) { + + $spacename = censor(getstr($_POST['spacename'], 30)); + $spacedescription = censor(getstr($_POST['spacedescription'], 135)); + + $setarr = array(); + $setarr['spacename'] = $spacename; + $setarr['spacedescription'] = $spacedescription; + C::t('common_member_field_home')->update($_G['uid'], $setarr); + + $space['spacename'] = $spacename; + $space['spacedescription'] = $spacedescription; + } +} elseif ($op == 'getspaceinfo') { + space_merge($space,'field_home'); +} elseif ($op == 'getpersonalnv') { + space_merge($space,'field_home'); + getuserdiydata($space); + $personalnv = isset($_G['blockposition']['nv']) ? $_G['blockposition']['nv'] : ''; + if($personalnv && !empty($_GET['show'])) { + $personalnv['nvhidden'] = 0; + } +} +if (submitcheck('blocksubmit')) { + + $blockname = getstr($_GET['blockname'],15); + if(check_ban_block($blockname, $space)) { + space_merge($space,'field_home'); + $blockdata = dunserialize($space['blockposition']); + + $title = censor(getstr($_POST['blocktitle'],50)); + $blockdata['parameters'][$blockname]['title'] = $title; + + if (in_array($blockname, array('block1', 'block2', 'block3', 'block4', 'block5'))) { + $content = censor(getstr($_POST['content'],1000,0,0,0,1)); + $blockdata['parameters'][$blockname]['content'] = $content; + } elseif($blockname == 'profile') { + $blockdata['parameters'][$blockname]['banavatar'] = in_array($_GET['avatar'], array('big', 'middle', 'small')) ? $_GET['avatar'] : 'middle'; + } elseif($blockname == 'statistic') { + $blockdata['parameters'][$blockname]['bancredits'] = $_GET['credits'] ? 0 : 1; + $blockdata['parameters'][$blockname]['banfriends'] = $_GET['friends'] ? 0 : 1; + $blockdata['parameters'][$blockname]['banthreads'] = $_GET['threads'] ? 0 : 1; + $blockdata['parameters'][$blockname]['banblogs'] = $_GET['blogs'] ? 0 : 1; + $blockdata['parameters'][$blockname]['banalbums'] = $_GET['albums'] ? 0 : 1; + $blockdata['parameters'][$blockname]['bansharings'] = $_GET['sharings'] ? 0 : 1; + $blockdata['parameters'][$blockname]['banviews'] = $_GET['views'] ? 0 : 1; + } elseif(in_array($blockname, array('personalinfo'))) { + + } else { + $shownum = max(1,intval($_POST['shownum'])); + if ($shownum <= 20) { + $blockdata['parameters'][$blockname]['shownum'] = $shownum; + } + } + + if($blockname == 'blog') { + $blockdata['parameters'][$blockname]['showmessage'] = min(100000, abs(intval($_GET['showmessage']))); + } + + $setarr = array(); + $setarr['blockposition'] = serialize($blockdata); + C::t('common_member_field_home')->update($space['uid'], $setarr); + + showmessage('do_success', 'portal.php?mod=spacecp&ac=index&op=getblock&blockname='.$blockname, array('blockname'=>$blockname)); + } else { + showmessage('the_block_is_not_available'); + } +} + +if (submitcheck('editnvsubmit')) { + + $hidden = intval($_POST['nvhidden']); + $nv = array('index', 'feed', 'doing', 'blog', 'album', 'topic', 'share', 'friends', 'wall', 'profile', 'follow'); + space_merge($space,'field_home'); + $blockdata = dunserialize($space['blockposition']); + + $personalnv = array(); + $personalnv['nvhidden'] = $hidden; + foreach($nv as $value) { + $namevalue = trim($_POST[$value]); + $personalnv['items'][$value] = getstr($namevalue,15); + $personalnv['banitems'][$value] = empty($_POST['ban'.$value]) ? 0 : 1; + } + $blockdata['nv'] = $personalnv; + $setarr = array(); + $setarr['blockposition'] = serialize($blockdata); + C::t('common_member_field_home')->update($space['uid'], $setarr); + + showmessage('do_success', 'portal.php?mod=spacecp&ac=index&op=getnv'); + +} + +if (submitcheck('musicsubmit')) { + + $blockname = getstr($_GET['blockname'],15); + space_merge($space,'field_home'); + $blockdata = dunserialize($space['blockposition']); + if ($_POST['act'] == 'config') { + $config = array ( + 'showmod' => $_POST['showmod'], + 'autorun' => $_POST['autorun'], + 'shuffle' => $_POST['shuffle'], + 'crontabcolor' => $_POST['crontabcolor'], + 'height' => min(9999,abs(intval($_POST['height']))), + ); + $blockdata['parameters']['music']['config'] = $config; + + $blockdata['parameters']['music']['title']= censor(getstr($_POST['blocktitle'],50)); + + } elseif ($_POST['act'] == 'addmusic') { + $mp3url = $_POST['mp3url']; + $mp3name = $_POST['mp3name']; + $cdbj = $_POST['cdbj']; + $mp3list = empty($blockdata['parameters']['music']['mp3list']) ? array() : $blockdata['parameters']['music']['mp3list']; + foreach ($mp3url as $key => $value) { + if (!empty($value)) { + if(empty($mp3name[$key])) $mp3name[$key] = substr($value,strrpos($value,'/')+1,strlen($value)); + $mp3list[] = array('mp3url'=>$value, 'mp3name'=>censor($mp3name[$key]), 'cdbj'=>$cdbj[$key]); + } + } + $blockdata['parameters']['music']['mp3list'] = $mp3list; + + } elseif ($_POST['act'] == 'editlist') { + $mp3url = $_POST['mp3url']; + $mp3name = $_POST['mp3name']; + $cdbj = $_POST['cdbj']; + $mp3list = array(); + foreach ($mp3url as $key => $value) { + if (!empty($value)) { + if(empty($mp3name[$key])) $mp3name[$key] = substr($value,strrpos($value,'/')+1,strlen($value)); + $mp3list[] = array('mp3url'=>$value, 'mp3name'=>censor($mp3name[$key]), 'cdbj'=>$cdbj[$key]); + } + } + + $blockdata['parameters']['music']['mp3list'] = $mp3list; + } + + if (empty($blockdata['parameters']['music']['config'])) { + $blockdata['parameters']['music']['config'] = array ( + 'showmod' => 'default', + 'autorun' => 'true', + 'shuffle' => 'true', + 'crontabcolor' => '#D2FF8C', + 'buttoncolor' => '#1F43FF', + 'fontcolor' => '#1F43FF', + ); + } + $setarr = array(); + $setarr['blockposition'] = serialize($blockdata); + C::t('common_member_field_home')->update($space['uid'], $setarr); + showmessage('do_success', 'home.php?mod=spacecp&ac=index&op=getblock&blockname='.$blockname, array('blockname'=>$blockname)); +} + +if (submitcheck('diysubmit')) { + + $blockdata = array(); + + checksecurity($_POST['spacecss']); + + $spacecss = $_POST['spacecss']; + $spacecss = preg_replace("/(\<|\>)/is", '', $spacecss); + + $currentlayout = getstr($_POST['currentlayout'],5); + $style = empty($_POST['style'])?'':preg_replace("/[^0-9a-z]/i", '', $_POST['style']); + + $layoutdata = $_POST['layoutdata']; + require_once libfile('class/xml'); + $layoutdata = xml2array($layoutdata); + if (empty($layoutdata)) showmessage('space_data_format_invalid'); + $layoutdata = $layoutdata['diypage']; + if($style && $style != 'uchomedefault') { + $cssfile = DISCUZ_ROOT.'./static/space/'.$style.'/style.css'; + if(!file_exists($cssfile)) { + showmessage('theme_does_not_exist'); + } + } + + space_merge($space, 'field_home'); + $blockdata = dunserialize($space['blockposition']); + $blockdata['block'] = $layoutdata; + $blockdata['currentlayout'] = $currentlayout; + $setarr = array(); + $setarr['spacecss'] = $spacecss; + $setarr['blockposition'] = serialize($blockdata); + $setarr['theme'] = $style; + C::t('common_member_field_home')->update($space['uid'], $setarr); + showmessage('do_success','home.php?mod=space&uid='.$space['uid'].($_G['adminid'] == 1 && $_G['setting']['allowquickviewprofile'] ? '&view=admin' : '')); +} + +if (submitcheck('uploadsubmit')) { + $albumid = $picid = 0; + + if(!checkperm('allowupload')) { + echo ""; + exit(); + } + $uploadfiles = pic_save($_FILES['attach'], $_POST['albumid'], $_POST['pic_title'], false); + if($uploadfiles && is_array($uploadfiles)) { + $albumid = $uploadfiles['albumid']; + $picid = $uploadfiles['picid']; + $uploadStat = 1; + require_once libfile('function/spacecp'); + album_update_pic($albumid); + } else { + $uploadStat = $uploadfiles; + } + + $picurl = pic_get($uploadfiles['filepath'], 'album', $uploadfiles['thumb'], $uploadfiles['remote']); + + echo ""; + exit(); +} +include_once(template('home/spacecp_index')); +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_invite.php b/source/include/spacecp/spacecp_invite.php new file mode 100644 index 0000000..f1e8296 --- /dev/null +++ b/source/include/spacecp/spacecp_invite.php @@ -0,0 +1,279 @@ + 1)); +} + +space_merge($space, 'count'); + +$baseurl = 'home.php?mod=spacecp&ac=invite'; + +$siteurl = getsiteurl(); + +$maxcount = 50; + +$config = $_G['setting']['inviteconfig']; +$creditname = $config['inviterewardcredit']; +$allowinvite = ($_G['setting']['regstatus'] > 1 && $creditname && $_G['group']['allowinvite']) ? 1 : 0; +$unit = $_G['setting']['extcredits'][$creditname]['unit']; +$credittitle = $_G['setting']['extcredits'][$creditname]['title']; +$creditname = 'extcredits'.$creditname; + +$inviteurl = $invite_code = ''; + +$creditkey = 'extcredits'.$creditid; +$extcredits = $_G['setting']['extcredits'][$creditid]; + +$mailvar = array( + 'avatar' => avatar($space['uid'], 'middle'), + 'uid' => $space['uid'], + 'username' => $space['username'], + 'sitename' => $_G['setting']['sitename'], + 'siteurl' => $siteurl +); + +if(!$creditnum) { + $inviteurl = getinviteurl(0, 0); +} +if(!$allowinvite) { + showmessage('close_invite', '', array(), $_G['inajax'] ? array('showdialog'=>1, 'showmsg' => true, 'closetime' => true) : array()); +} + +if(submitcheck('emailinvite')) { + + if(!$_G['group']['allowmailinvite']) { + showmessage('mail_invite_not_allow', $baseurl); + } + + $_POST['email'] = str_replace("\n", ',', $_POST['email']); + $newmails = array(); + $mails = explode(",", $_POST['email']); + foreach ($mails as $value) { + $value = trim($value); + if(isemail($value)) { + $newmails[] = $value; + } + } + $newmails = array_unique($newmails); + $invitenum = count($newmails); + + if($invitenum < 1) { + showmessage('mail_can_not_be_empty', $baseurl); + } + + $msetarr = array(); + if($creditnum) { + $allcredit = $invitenum * $creditnum; + if($space[$creditkey] < $allcredit) { + showmessage('mail_credit_inadequate', $baseurl); + } + + foreach($newmails as $value) { + $code = strtolower(random(6)); + $setarr = array( + 'uid' => $_G['uid'], + 'code' => $code, + 'email' => daddslashes($value), + 'type' => 1, + 'inviteip' => $_G['clientip'], + 'dateline' => $_G['timestamp'], + 'status' => 3, + 'endtime' => ($_G['group']['maxinviteday']?($_G['timestamp']+$_G['group']['maxinviteday']*24*3600):0) + ); + $id = C::t('common_invite')->insert($setarr, true); + + $mailvar['inviteurl'] = getinviteurl($id, $code); + + createmail($value, $mailvar); + } + + updatemembercount($_G['uid'], array($creditkey => "-$allcredit")); + + } else { + + $mailvar['inviteurl'] = $inviteurl; + foreach($newmails as $value) { + createmail($value, $mailvar); + } + } + + showmessage('send_result_succeed',$baseurl); + +} else if(submitcheck('invitesubmit')) { + + $invitenum = intval($_POST['invitenum']); + if($invitenum < 1) $invitenum = 1; + + if($_G['group']['maxinvitenum']) { + $daytime = $_G['timestamp'] - 24*3600; + $invitecount = C::t('common_invite')->count_by_uid_dateline($_G['uid'], $daytime); + if($invitecount + $invitenum > $_G['group']['maxinvitenum']) { + showmessage('max_invitenum_error', NULL, array('maxnum'=>$_G['group']['maxinvitenum']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + } + + $allcredit = $invitenum * $creditnum; + if($space[$creditkey] < $allcredit) { + showmessage('mail_credit_inadequate', $baseurl, array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + + $havecode = false; + $dateline = $_G['timestamp']; + for($i=0; $i<$invitenum; $i++) { + $code = strtolower(random(6)); + $havecode = true; + $invitedata = array( + 'uid' => $_G['uid'], + 'code' => $code, + 'dateline' => $dateline, + 'endtime' => $_G['group']['maxinviteday'] ? ($_G['timestamp']+$_G['group']['maxinviteday']*24*3600) : 0, + 'inviteip' => $_G['clientip'] + ); + C::t('common_invite')->insert($invitedata); + } + + if($havecode) { + require_once libfile('class/credit'); + require_once libfile('function/credit'); + $creditobj = new credit(); + credit_log($_G['uid'], 'INV', $_G['uid'], array($creditkey => 0-$allcredit)); + $creditobj->updatemembercount(array($creditkey => 0-$allcredit), $_G['uid']); + } + showmessage('do_success', $baseurl, array('deduction' => $allcredit, 'dateline' => $dateline), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true, 'return' => false)); +} + +if($_GET['op'] == 'resend') { + + $id = $_GET['id'] ? intval($_GET['id']) : 0; + + if(submitcheck('resendsubmit')) { + + if(empty($id)) { + showmessage('send_result_resend_error', $baseurl); + } + + if($value = C::t('common_invite')->fetch_by_id_uid($id, $_G['uid'])) { + if($creditnum) { + $inviteurl = getinviteurl($value['id'], $value['code']); + } + $mailvar['inviteurl'] = $inviteurl; + + createmail($value['email'], $mailvar); + showmessage('send_result_succeed', dreferer(), array('id' => $id), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + + } else { + showmessage('send_result_resend_error', $baseurl, array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + } + +} elseif($_GET['op'] == 'delete') { + + $id = $_GET['id'] ? intval($_GET['id']) : 0; + if(empty($id)) { + showmessage('there_is_no_record_of_invitation_specified', $baseurl); + } + if($value = C::t('common_invite')->fetch_by_id_uid($id, $_G['uid'])) { + if(submitcheck('deletesubmit')) { + C::t('common_invite')->delete($id); + showmessage('do_success', dreferer(), array('id' => $id), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + } else { + showmessage('there_is_no_record_of_invitation_specified', $baseurl, array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + +} elseif ($_GET['op'] == 'showinvite') { + foreach(C::t('common_invite')->fetch_all_by_uid($_G['uid']) as $value) { + if(!$value['fuid'] && !$value['type']) { + $inviteurl = getinviteurl($value['id'], $value['code']); + $list[$value['code']] = $inviteurl; + } + } +} else { + + $list = $flist = $dels = array(); + $invitedcount = $count = 0; + + foreach(C::t('common_invite')->fetch_all_by_uid($_G['uid']) as $value) { + if($value['fuid']) { + $flist[] = $value; + $invitedcount++; + } else { + + if($_G['timestamp'] > $value['endtime']) { + $dels[] = $value['id']; + continue; + } + + $inviteurl = getinviteurl($value['id'], $value['code']); + + if($value['type']) { + $maillist[] = array( + 'email' => $value['email'], + 'url' => $inviteurl, + 'id' => $value['id'] + ); + } else { + $list[$value['code']] = $inviteurl; + $count++; + } + } + } + + if($dels) { + C::t('common_invite')->delete($dels); + } + + $uri = $_SERVER['REQUEST_URI']?$_SERVER['REQUEST_URI']:($_SERVER['PHP_SELF']?$_SERVER['PHP_SELF']:$_SERVER['SCRIPT_NAME']); + $uri = substr($uri, 0, strrpos($uri, '/')+1); + + $actives = array('invite'=>' class="a"'); +} + +$navtitle = lang('core', 'title_invite_friend'); + +include template('home/spacecp_invite'); + +function createmail($mail, $mailvar) { + global $_G; + + $mailvar['saymsg'] = empty($_POST['saymsg'])?'':getstr($_POST['saymsg'], 500); + + require_once libfile('function/mail'); + $tplarray = array( + 'tpl' => 'invitemail', + 'var' => $mailvar, + 'svar'=> $mailvar + ); + + if(!sendmail($mail, $tplarray)) { + runlog('sendmail', "$mail sendmail failed."); + } +} + +function getinviteurl($inviteid, $invitecode) { + global $_G; + + if($inviteid && $invitecode) { + $inviteurl = getsiteurl()."home.php?mod=invite&id={$inviteid}&c={$invitecode}"; + } else { + $invite_code = helper_invite::generate_key($_G['uid']); + $inviteurl = getsiteurl()."home.php?mod=invite&u={$_G['uid']}&c=$invite_code"; + } + return $inviteurl; +} + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_magic.php b/source/include/spacecp/spacecp_magic.php new file mode 100644 index 0000000..8fa1a7e --- /dev/null +++ b/source/include/spacecp/spacecp_magic.php @@ -0,0 +1,122 @@ +fetch_comment($_GET['id'], $_G['uid']); + if(!$value || !$value['magicflicker']) { + showmessage('no_flicker_yet'); + } + + if(submitcheck('cancelsubmit')) { + C::t('home_comment')->update_comment('', array('magicflicker'=>0), $_G['uid']); + showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'closetime' => true)); + } + +} elseif($op == 'cancelcolor') { + + $mid = 'color'; + $_GET['id'] = intval($_GET['id']); + $mapping = array('blogid'=>'blogfield', 'tid'=>'thread'); + $tablename = $mapping[$_GET['idtype']]; + if(empty($tablename)) { + showmessage('no_color_yet'); + } + $value = C::t($tablename)->fetch($_GET['id']); + if(!$value || $value['uid'] != $_G['uid'] || !$value['magiccolor']) { + showmessage('no_color_yet'); + } + + if(submitcheck('cancelsubmit')) { + DB::update($tablename, array('magiccolor'=>0), array($_GET['idtype']=>$_GET['id'])); + $feed = C::t('home_feed')->fetch_feed($_GET['id'], $_GET['idtype']); + if($feed) { + $feed['body_data'] = dunserialize($feed['body_data']); + if($feed['body_data']['magic_color']) { + unset($feed['body_data']['magic_color']); + } + $feed['body_data'] = serialize($feed['body_data']); + C::t('home_feed')->update_feed('', array('body_data'=>$feed['body_data']), '', '', $feed['feedid']); + } + showmessage('do_success', dreferer(), 0); + } + +} elseif($op == 'receivegift') { + + $uid = intval($_GET['uid']); + $mid = 'gift'; + $memberfieldhome = C::t('common_member_field_home')->fetch($uid); + $info = $memberfieldhome['magicgift'] ? dunserialize($memberfieldhome['magicgift']) : array(); + unset($memberfieldhome); + if(!empty($info['left'])) { + $info['receiver'] = is_array($info['receiver']) ? $info['receiver'] : array(); + if(in_array($_G['uid'], $info['receiver'])) { + showmessage('haved_red_bag'); + } + $percredit = min($info['left'], $info['percredit']); + $info['receiver'][] = $_G['uid']; + $info['left'] = $info['left'] - $percredit; + C::t('common_member_field_home')->update($uid, array('magicgift' => ($info['left'] > 0 ? serialize($info) : ''))); + $credittype = ''; + if(preg_match('/^extcredits[1-8]$/', $info['credittype'])) { + $extcredits = str_replace('extcredits', '', $info['credittype']); + updatemembercount($_G['uid'], array($extcredits => $percredit), 1, 'AGC', $info['magicid']); + $credittype = $_G['setting']['extcredits'][$extcredits]['title']; + } + showmessage('haved_red_bag_gain', dreferer(), array('percredit' => $percredit, 'credittype' => $credittype), array('showdialog' => 1, 'locationtime' => true)); + } + showmessage('space_no_red_bag', dreferer(), array(), array('showdialog' => 1, 'locationtime' => true)); + +} elseif($op == 'retiregift') { + + $mid = 'gift'; + $memberfieldhome = C::t('common_member_field_home')->fetch($_G['uid']); + $info = $memberfieldhome['magicgift'] ? dunserialize($memberfieldhome['magicgift']) : array(); + unset($memberfieldhome); + $leftcredit = intval($info['left']); + if($leftcredit<=0) { + C::t('common_member_field_home')->update($_G['uid'], array('magicgift' => '')); + showmessage('red_bag_no_credits'); + } + + $extcredits = str_replace('extcredits', '', $info['credittype']); + $credittype = $_G['setting']['extcredits'][$extcredits]['title']; + + if(submitcheck('cancelsubmit')) { + C::t('common_member_field_home')->update($_G['uid'], array('magicgift' => '')); + if(preg_match('/^extcredits[1-8]$/', $info['credittype'])) { + updatemembercount($_G['uid'], array($extcredits => $leftcredit), 1, 'RGC', $info['magicid']); + } + showmessage('return_red_bag', dreferer(), array('leftcredit' => $leftcredit, 'credittype' => $credittype), array('showdialog' => 1, 'locationtime' => true)); + } +} + +include_once template('home/spacecp_magic'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_payment.php b/source/include/spacecp/spacecp_payment.php new file mode 100644 index 0000000..9e356a6 --- /dev/null +++ b/source/include/spacecp/spacecp_payment.php @@ -0,0 +1,30 @@ + ' class="a"'); + +if($_G['setting']['ec_ratio']) { + $is_enable_pay = payment::enable(); +} else { + $is_enable_pay = false; +} + +if(!$_G['setting']['ec_ratio'] || !$is_enable_pay) { + showmessage('action_closed', null); +} + +include_once libfile('spacecp/payment_' . $operation, 'include'); + + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_payment_order.php b/source/include/spacecp/spacecp_payment_order.php new file mode 100644 index 0000000..ae8f421 --- /dev/null +++ b/source/include/spacecp/spacecp_payment_order.php @@ -0,0 +1,84 @@ + 'spacecp', + 'ac' => 'payment', + 'starttime' => $_GET['starttime'], + 'endtime' => $_GET['endtime'], + 'optype' => $_GET['optype'] +); +$theurl = 'home.php?' . url_implode($gets); +$multi = ''; + +$endunixstr = $beginunixstr = 0; +if($_GET['starttime']) { + $beginunixstr = strtotime($_GET['starttime']); + $_GET['starttime'] = dgmdate($beginunixstr, 'Y-m-d'); +} +if($_GET['endtime']) { + $endunixstr = strtotime($_GET['endtime'] . ' 23:59:59'); + $_GET['endtime'] = dgmdate($endunixstr, 'Y-m-d'); +} +if($beginunixstr && $endunixstr && $endunixstr < $beginunixstr) { + showmessage('start_time_is_greater_than_end_time'); +} + +$payment_type_data = C::t('common_payment_order')->fetch_type_all($_G['uid']); + +$optype = ''; +if($_GET['optype'] && in_array($_GET['optype'], array_keys($payment_type_data))) { + $optype = $_GET['optype']; +} + +$count = C::t('common_payment_order')->count_by_search($_G['uid'], $optype, $beginunixstr, $endunixstr); +$order_list = array(); +if($count) { + foreach(C::t('common_payment_order')->fetch_all_by_search($_G['uid'], $optype, $_GET['starttime'], $_GET['endtime'], '', '', '', $start, $perpage) as $order) { + $order['type_name'] = dhtmlspecialchars($order['type_name']); + $order['amount'] = number_format($order['amount'] / 100, 2, '.', ','); + $order['subject'] = dhtmlspecialchars($order['subject']); + $order['description'] = dhtmlspecialchars($order['description']); + $order['dateline'] = dgmdate($order['dateline'], 'Y-m-d H:i:s'); + $status = $order['status']; + if(!$order['status'] && $order['expire_time'] < time()) { + $status = 2; + } + $order['status'] = $status; + $order['status_name'] = lang('spacecp', 'payment_status_' . $status); + $order_list[] = $order; + } +} + +if($count) { + $multi = multi($count, $perpage, $page, $theurl); +} + +$optypehtml = ''; + +include template('home/spacecp_payment_order'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_payment_pay.php b/source/include/spacecp/spacecp_payment_pay.php new file mode 100644 index 0000000..7ed659b --- /dev/null +++ b/source/include/spacecp/spacecp_payment_pay.php @@ -0,0 +1,111 @@ + true)); +} + +$order = C::t('common_payment_order')->fetch($order_id); +if(!$order || $order['expire_time'] < time() || ($order['uid'] && $_G['uid'] != $order['uid'])) { + showmessage('payment_order_no_exist', '', array(), array('showdialog' => true)); +} +if($order['status']) { + $return_url = $order['return_url']; + if(!$return_url) { + $return_url = $_G['siteurl'] . 'home.php?mod=spacecp&ac=payment'; + } + showmessage('payment_succeed', $return_url, array(), array('alert' => 'right')); +} + +if(submitcheck('paysubmit')) { + $pay_channel = daddslashes($_GET['pay_channel']); + $payclass = payment::get($pay_channel); + if(!$payclass) { + showmessage('payment_type_no_exist', $_G['siteurl'] . 'home.php?mod=spacecp&ac=payment&op=pay&order_id=' . $order_id, array(), array('showdialog' => true, 'locationtime' => 3)); + } + + if($pay_channel == 'qpay' && checkmobile() && strpos($_SERVER['HTTP_USER_AGENT'], ' QQ') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'MQQBrowser') !== false) { + $ec_qpay = C::t('common_setting')->fetch_setting('ec_qpay', true); + if($ec_qpay['jsapi']) { + $result = $payclass->pay_jsapi($order); + if($result['code'] == 200) { + $prepay_id = $result['prepay_id']; + $title = dhtmlspecialchars($order['subject']); + include template('home/spacecp_payment_qpayjsapi'); + exit(); + } + } + } + + if($pay_channel == 'wechat' && checkmobile() && strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) { + $redirect_uri = $_G['siteurl'] . 'home.php?mod=spacecp&ac=payment&op=pay&sop=wxjsapi&order_id=' . $order_id; + $state = md5($order_id . $order['dateline']); + $pay_url = $payclass -> wechat_authorize($redirect_uri, $state); + dheader('Location: ' . $pay_url); + } else { + $result = $payclass->pay($order); + if($result['code'] != 200) { + showmessage($result['message'], $_G['siteurl'] . 'home.php?mod=spacecp&ac=payment&op=pay&order_id=' . $order_id, array(), array('showdialog' => true, 'locationtime' => 3)); + } + $pay_url = $result['url']; + + include template('home/spacecp_payment_redirect'); + } +} elseif($_GET['sop'] == 'wxjsapi') { + $code = daddslashes($_GET['code']); + $state = daddslashes($_GET['state']); + if(!$code || !$state || !$order_id || $state != md5($order_id . $order['dateline'])) { + exit('Access Denied'); + } + + $payment = payment::get('wechat'); + $result = $payment->wechat_access_token_by_code($code); + $result = json_decode($result, true); + if(!$result['openid']) { + if(strtoupper($_G['charset']) != 'UTF-8') { + $result['errmsg'] = diconv($result['errmsg'], 'UTF-8', $_G['charset']); + } + showmessage($result['errmsg'], $order['return_url'], array(), array('showdialog' => true, 'locationtime' => 3)); + } + + $result = $payment->pay_jsapi($order, $result['openid']); + if($result['code'] != 200) { + showmessage($result['message'], $order['return_url'], array(), array('showdialog' => true, 'locationtime' => 3)); + } + + $jsapidata = $payment->wechat_jsapidata($result['url']); + $title = dhtmlspecialchars($order['subject']); + include template('home/spacecp_payment_wxjsapi'); +} elseif($_GET['sop'] == 'status') { + exit(); +} else { + $order['subject'] = dhtmlspecialchars($order['subject']); + $order['description'] = dhtmlspecialchars($order['description']); + if($order['amount_fee']) { + $order['total_amount'] = number_format((intval($order['amount']) + intval($order['amount_fee'])) / 100, '2', '.', ','); + } + $order['amount'] = number_format($order['amount'] / 100, '2', '.', ','); + + $pay_channel_list = array(); + $channels = payment::channels(); + foreach($channels as $channel) { + if($channel['enable']) { + $pay_channel_list[] = $channel; + } + } + + include template('home/spacecp_payment_pay'); +} + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_plugin.php b/source/include/spacecp/spacecp_plugin.php new file mode 100644 index 0000000..cf5a0a0 --- /dev/null +++ b/source/include/spacecp/spacecp_plugin.php @@ -0,0 +1,27 @@ +fetch_setting('profilegroup', true); + $operation = 'plugin'; + include template('home/spacecp_profile'); +} + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_pm.php b/source/include/spacecp/spacecp_pm.php new file mode 100644 index 0000000..fb5f79b --- /dev/null +++ b/source/include/spacecp/spacecp_pm.php @@ -0,0 +1,545 @@ +update($_G['uid'], array('newpm' => $newpm)); + } + } + dsetcookie('checkpm', 1, 30); + exit(); + +} elseif($_GET['op'] == 'getpmuser') { + $otherpm = $json = array(); + $result = uc_pm_list($_G['uid'], 1, 30, 'inbox', 'privatepm'); + foreach($result['data'] as $key => $value) { + $value['lastauthor'] = daddslashes($value['lastauthor']); + $value['avatar'] = avatar($value['lastauthorid'], 'small', true); + if($value['isnew']) { + $json[$value['lastauthorid']] = "{$value['lastauthorid']}:{'uid':{$value['lastauthorid']}, 'username':'{$value['lastauthor']}', 'avatar':'{$value['avatar']}', 'plid':{$value['plid']}, 'isnew':{$value['isnew']}, 'daterange':{$value['daterange']}"; + } else { + $otherpm[$value['lastauthorid']] = "{$value['lastauthorid']}:{'uid':{$value['lastauthorid']}, 'username':'{$value['lastauthor']}', 'avatar':'{$value['avatar']}', 'plid':{$value['plid']}, 'isnew':{$value['isnew']}, 'daterange':{$value['daterange']}"; + } + } + if(!empty($otherpm)) { + $json = array_merge($json, $otherpm); + } + $jsstr = "{'userdata':{".implode(',', $json)."}}"; + +} elseif($_GET['op'] == 'showmsg') { + + $msgonly = empty($_GET['msgonly']) ? 0 : intval($_GET['msgonly']); + $touid = empty($_GET['touid']) ? 0: intval($_GET['touid']); + $daterange = empty($_GET['daterange']) ? 1 : intval($_GET['daterange']); + $result = uc_pm_view($_G['uid'], 0, $touid, $daterange, 0, 0, 0, 0); + $msglist = array(); + $msguser = $messageappend = ''; + $online = 0; + foreach($result as $key => $value) { + if($value['authorid'] != $_G['uid']) { + $msguser = $value['author']; + } + $daykey = dgmdate($value['dateline'], 'Y-m-d'); + $msglist[$daykey][$key] = $value; + } + if($touid && empty($msguser)) { + $member = getuserbyuid($touid); + $msguser = $member['username']; + } + if(!$msgonly) { + $online = C::app()->session->fetch_by_uid($touid) ? 1 : 0; + if($_G['member']['newpm']) { + $newpm = setstatus(1, 0, $_G['member']['newpm']); + C::t('common_member')->update($_G['uid'], array('newpm' => $newpm)); + uc_pm_ignore($_G['uid']); + } + } + if(!empty($_GET['tradeid'])) { + $trade = C::t('forum_trade')->fetch_goods(0, $_GET['tradeid']); + if($trade) { + $messageappend = dhtmlspecialchars('[url='.$_G['siteurl'].'forum.php?mod=viewthread&tid='.$trade['tid'].'&do=tradeinfo&pid='.$trade['pid'].'][b]'.$trade['subject'].'[/b][/url]'); + } + } elseif(!empty($_GET['commentid'])) { + $comment = C::t('forum_postcomment')->fetch($_GET['commentid']); + if($comment) { + $comment['comment'] = str_replace(array('[b]', '[/b]', '[/color]'), array(''), preg_replace("/\[color=([#\w]+?)\]/i", '', strip_tags($comment['comment']))); + $messageappend = dhtmlspecialchars('[url='.$_G['siteurl'].'forum.php?mod=redirect&goto=findpost&pid='.$comment['pid'].'&ptid='.$comment['tid'].'][b]'.lang('spacecp', 'pm_comment').'[/b][/url][quote]'.$comment['comment'].'[/quote]'); + } + } elseif(!empty($_GET['tid']) && !empty($_GET['pid'])) { + $thread = C::t('forum_thread')->fetch_thread($_GET['tid']); + if($thread) { + $messageappend = dhtmlspecialchars('[url='.$_G['siteurl'].'forum.php?mod=redirect&goto=findpost&pid='.intval($_GET['pid']).'&ptid='.$thread['tid'].'][b]'.lang('spacecp', 'pm_thread_about', array('subject' => $thread['subject'])).'[/b][/url]'); + } + } + +} elseif($_GET['op'] == 'showchatmsg') { + $perpage = 50; + $perpage = mob_perpage($perpage); + $page = empty($_GET['page']) ? ceil($count/$perpage) : intval($_GET['page']); + $list = uc_pm_view($_G['uid'], 0, $plid, 5, ceil($count/$perpage)-$page+1, $perpage, 1, 1); + +} elseif($_GET['op'] == 'delete') { + + if($_GET['formhash'] != formhash()) { + showmessage('delete_pm_error_option'); + } + + $gpmid = is_array($_GET['deletepm_gpmid']) ? $_GET['deletepm_gpmid'] : 0; + $deluid = is_array($_GET['deletepm_deluid']) ? $_GET['deletepm_deluid'] : 0; + $delpmid = is_array($_GET['deletepm_pmid']) ? $_GET['deletepm_pmid'] : 0; + $delplid = is_array($_GET['deletepm_delplid']) ? $_GET['deletepm_delplid'] : 0; + $quitplid = is_array($_GET['deletepm_quitplid']) ? $_GET['deletepm_quitplid'] : 0; + + if(empty($gpmid) && empty($deluid) && empty($delpmid) && empty($delplid) && empty($quitplid)) { + showmessage('delete_pm_error_option'); + } + + if(submitcheck('deletesubmit', 1)) { + $flag = true; + + if(!empty($gpmid)) { + $return = C::t('common_member_grouppm')->update($_G['uid'], $gpmid, array('status' => -1)); + $returnurl = 'home.php?mod=space&do=pm&filter=announcepm'; + if(!$return) { + $flag = false; + } + } + if(!empty($deluid)) { + $return = uc_pm_deleteuser($_G['uid'], $deluid); + $returnurl = 'home.php?mod=space&do=pm&filter=privatepm'; + if($return <= 0) { + $flag = false; + } + } + + if(!empty($delpmid)) { + $return = uc_pm_delete($_G['uid'], 'inbox', $delpmid[0]); + $returnurl = 'home.php?mod=space&do=pm&subop=view&touid='.$touid; + if($return <= 0) { + $flag = false; + } + } + + if(!empty($delplid)) { + $return = uc_pm_deletechat($_G['uid'], $delplid, 1); + $returnurl = 'home.php?mod=space&do=pm&filter=privatepm'; + if(!$return) { + $flag = false; + } + } + + if(!empty($quitplid)) { + $return = uc_pm_deletechat($_G['uid'], $quitplid); + $returnurl = 'home.php?mod=space&do=pm&filter=privatepm'; + if(!$return) { + $flag = false; + } + } + + if($flag) { + showmessage('delete_pm_success', $returnurl); + } else { + showmessage('this_message_could_note_be_option'); + } + } + +} elseif($_GET['op'] == 'send') { + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('message_can_not_send_2', '', array(), array('return' => true)); + } + + cknewuser(); + + if(!checkperm('allowsendpm')) { + showmessage('no_privilege_sendpm', '', array(), array('return' => true)); + } + + if($touid) { + if(isblacklist($touid)) { + showmessage('is_blacklist', '', array(), array('return' => true)); + } + } + + if(submitcheck('pmsubmit')) { + if(!empty($_POST['username'])) { + $_POST['users'][] = $_POST['username']; + } + $users = empty($_POST['users']) ? array() : $_POST['users']; + $type = intval($_POST['type']); + $coef = 1; + if(!empty($users)) { + $coef = count($users); + } + + !($_G['group']['exempt'] & 1) && checklowerlimit('sendpm', 0, $coef); + + $message = (!empty($_POST['messageappend']) ? $_POST['messageappend']."\n" : '').trim($_POST['message']); + if(empty($message)) { + showmessage('unable_to_send_air_news', '', array(), array('return' => true)); + } + $message = censor($message); + loadcache(array('smilies', 'smileytypes')); + foreach($_G['cache']['smilies']['replacearray'] AS $key => $smiley) { + $_G['cache']['smilies']['replacearray'][$key] = '[img]'.$_G['siteurl'].'static/image/smiley/'.$_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$key]]['directory'].'/'.$smiley.'[/img]'; + } + $message = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], $message); + $subject = ''; + if($type == 1) { + $subject = dhtmlspecialchars(trim($_POST['subject'])); + } + + include_once libfile('function/friend'); + $return = 0; + if($touid || $pmid) { + if($touid) { + if(($value = getuserbyuid($touid))) { + $value['onlyacceptfriendpm'] = $value['onlyacceptfriendpm'] ? $value['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2); + if($_G['group']['allowsendallpm'] || $value['onlyacceptfriendpm'] == 2 || ($value['onlyacceptfriendpm'] == 1 && friend_check($touid))) { + $return = sendpm($touid, $subject, $message, '', 0, 0, $type); + } else { + showmessage('message_can_not_send_onlyfriend', '', array(), array('return' => true)); + } + } else { + showmessage('message_bad_touid', '', array(), array('return' => true)); + } + } else { + $topmuid = intval($_GET['topmuid']); + $return = sendpm($topmuid, $subject, $message, '', $pmid, 0); + } + + } elseif($users) { + $newusers = $uidsarr = $membersarr = array(); + if($users) { + $membersarr = C::t('common_member')->fetch_all_by_username($users); + foreach($membersarr as $aUsername=>$aUser) { + $uidsarr[] = $aUser['uid']; + } + } + if(empty($membersarr)) { + showmessage('message_bad_touser', '', array(), array('return' => true)); + } + if(isset($membersarr[$_G['uid']])) { + showmessage('message_can_not_send_to_self', '', array(), array('return' => true)); + } + + friend_check($uidsarr); + + foreach($membersarr as $key => $value) { + + $value['onlyacceptfriendpm'] = $value['onlyacceptfriendpm'] ? $value['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2); + if($_G['group']['allowsendallpm'] || $value['onlyacceptfriendpm'] == 2 || ($value['onlyacceptfriendpm'] == 1 && $_G['home_friend_'.$value['uid'].'_'.$_G['uid']])) { + $newusers[$value['uid']] = $value['username']; + unset($users[array_search($value['username'], $users)]); + } + } + + if(empty($newusers)) { + showmessage('message_can_not_send_onlyfriend', '', array(), array('return' => true)); + } + + foreach($newusers as $key=>$value) { + if(isblacklist($key)) { + showmessage('is_blacklist', '', array(), array('return' => true)); + } + } + $coef = count($newusers); + $return = sendpm(implode(',', $newusers), $subject, $message, '', 0, 1, $type); + } else { + showmessage('message_can_not_send_9', '', array(), array('return' => true)); + } + + if($return > 0) { + include_once libfile('function/stat'); + updatestat('sendpm', 0, $coef); + + C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP)); + !($_G['group']['exempt'] & 1) && updatecreditbyaction('sendpm', 0, array(), '', $coef); + if(!empty($newusers)) { + if($type == 1) { + $returnurl = 'home.php?mod=space&do=pm&filter=privatepm'; + } else { + $returnurl = 'home.php?mod=space&do=pm'; + } + $users = is_array($users) ? $users : array($users); + $newusers = is_array($newusers) ? $newusers : array($newusers); + showmessage(count($users) ? 'message_send_result' : 'do_success', $returnurl, array('users' => implode(',', $users), 'succeed' => count($newusers))); + } else { + if(!defined('IN_MOBILE')) { + showmessage('do_success', 'home.php?mod=space&do=pm&subop=view&touid='.$touid, array('pmid' => $return), $_G['inajax'] ? array('msgtype' => 3, 'showmsg' => false) : array()); + } else { + showmessage('do_success', 'home.php?mod=space&do=pm&subop=view'.(intval($_POST['touid']) ? '&touid='.intval($_POST['touid']) : ( intval($_POST['plid']) ? '&plid='.intval($_POST['plid']).'&daterange=1&type=1' : '' ))); + } + + } + } else { + if(in_array($return, range(-16, -1))) { + showmessage('message_can_not_send_'.abs($return)); + } else { + showmessage('message_can_not_send', '', array(), array('return' => true)); + } + } + } + +} elseif($_GET['op'] == 'ignore') { + + if(submitcheck('ignoresubmit')) { + $single = intval($_GET['single']); + if($single) { + uc_pm_blackls_add($_G['uid'], $_POST['ignoreuser']); + showmessage('do_success', dreferer(), array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } else { + uc_pm_blackls_set($_G['uid'], $_POST['ignorelist']); + showmessage('do_success', 'home.php?mod=space&do=pm&view=ignore', array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + } + +} elseif($_GET['op'] == 'setting') { + + if(submitcheck('settingsubmit')) { + if(!(intval($_GET['onlyacceptfriendpm']) && intval($_GET['onlyacceptfriendpm']) == $_GET['onlyacceptfriendpm'])) { + showmessage('pm_onlyacceptfriend_error', 'home.php?mod=space&do=pm&subop=setting'); + } + + uc_pm_blackls_set($_G['uid'], $_POST['ignorelist']); + $setarr['onlyacceptfriendpm'] = $_GET['onlyacceptfriendpm']; + + C::t('common_member')->update($_G['uid'], $setarr); + + showmessage('do_success_pm', 'home.php?mod=space&do=pm&subop=setting'); + } + +} elseif($_GET['op'] == 'pm_report') { + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + + if(!$pmid) { + showmessage('pm_report_error_nopm'); + } + if($pmid && submitcheck('pmreportsubmit', 1)) { + $pms = uc_pm_view($_G['uid'], $pmid); + $pm = $pms[0]; + if(empty($pm)) { + showmessage('pm_report_error_nopm'); + } + if($pm['authorid'] == $_G['uid'] || !$pm['authorid']) { + showmessage('pm_report_error_nome'); + } + $pmreportuser = explode(',', $_G['setting']['pmreportuser']); + if(empty($pmreportuser)) { + showmessage('pm_report_error_nopmreportuser'); + } + + $pmreportcontent = lang('spacecp', 'pm_report_content', array('reporterid' => $_G['uid'], 'reportername' => $_G['username'], 'uid' => $pm['authorid'], 'username' => $pm['author'], 'message' => $pm['message'])); + foreach($pmreportuser as $key => $value) { + notification_add($value, 'pmreport', 'pmreportcontent', array('pmreportcontent' => $pmreportcontent), 0); + } + showmessage('do_success', dreferer(), array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + +} elseif($_GET['op'] == 'pm_ignore') { + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + $username = $_GET['username']; + + if(!$username || !uc_get_user(addslashes($username))) { + showmessage('pm_ignore_error_nopm'); + } + + if(submitcheck('pmignoresubmit')) { + uc_pm_blackls_add($_G['uid'], addslashes($username)); + showmessage('do_success', dreferer(), array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } + +} elseif($_GET['op'] == 'kickmember') { + + $memberuid = intval($_GET['memberuid']); + if(!$memberuid) { + showmessage('pm_kickmember_error_nopm'); + } + if(submitcheck('pmkickmembersubmit')) { + uc_pm_kickchatpm($plid, $_G['uid'], $memberuid); + showmessage('do_success', dreferer(), array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true, 'locationtime' => 3)); + } + +} elseif($_GET['op'] == 'appendmember') { + + $memberusername = trim($_GET['memberusername']); + $members = array(); + if($memberusername) { + $members = C::t('common_member')->fetch_all_by_username(explode(',', $memberusername)); + } + if(empty($members)) { + showmessage('pm_appendkmember_error_nopm'); + } + if(submitcheck('pmappendmembersubmit')) { + include_once libfile('function/friend'); + $returns = array(); + foreach($members as $member) { + $member['onlyacceptfriendpm'] = $member['onlyacceptfriendpm'] ? $member['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2); + if($_G['group']['allowsendallpm'] || $member['onlyacceptfriendpm'] == 2 || ($member['onlyacceptfriendpm'] == 1 && friend_check($member['uid']))) { + $return = uc_pm_appendchatpm($plid, $_G['uid'], $member['uid']); + $returns[] = array('uid' => $member['uid'], 'username' => $member['username'], 'return' => $return); + } else { + $returns[] = array('uid' => $member['uid'], 'username' => $member['username'], 'return' => 0); + } + } + $cannotappend = array(); + foreach($returns as $value) { + if($value['return'] < 0) { + $cannotappend[] = $value['username'].'('.lang('spacecp', 'message_can_not_send_'.abs($value['return'])).')'; + } elseif($value['return'] == 0) { + $cannotappend[] = $value['username'].'('.lang('spacecp', 'message_can_not_send_onlyfriend').')'; + } + } + if(empty($cannotappend)) { + showmessage('do_success', dreferer(), array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true, 'locationtime' => 3)); + } else { + showmessage('message_can_not_append_reason', dreferer(), array('cannotappend' => implode('
          ', $cannotappend)), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true, 'locationtime' => 5)); + } + } + +} elseif($_GET['op'] == 'setpmstatus') { + + $gpmids = trim($_GET['gpmids']); + $plids = trim($_GET['plids']); + if($gpmids) { + $gpmidarr = explode(',', $gpmids); + C::t('common_member_grouppm')->update_to_read_by_unread($_G['uid'], $gpmidarr); + } + if($plids) { + $plidarr = explode(',', $plids); + uc_pm_readstatus($_G['uid'], array(), $plidarr, 0); + } + showmessage('do_success', '', array(), array('msgtype' => 3)); + +} elseif($_GET['op'] == 'viewpmid') { + + $list = uc_pm_view($_G['uid'], $_GET['pmid']); + $value = $list[0]; + include template('common/header_ajax'); + include template('home/space_pm_node'); + include template('common/footer_ajax'); + exit; + +} elseif($_GET['op'] == 'export') { + + if(!$touid && !$plid) { + showmessage('pm_export_touser_not_exists'); + } + + if($touid) { + $list = uc_pm_view($_G['uid'], 0, $touid, 5, 0, 0, 0, 0); + } else { + $list = uc_pm_view($_G['uid'], 0, $plid, 5, 0, 0, 1, 1); + $subject = $list[0]['subject']; + } + + if(count($list) == 0) { + showmessage('pm_emport_banned_export'); + } + $filename = lang('space', 'export_pm').'.html'; + if($touid) { + if($touser = uc_get_user($touid, 1)) { + $tousername = $touser[1]; + $filename = $touser[1].'.html'; + } + } + $contents = ''; + $contents .= ''; + $contents .= ''.lang('space', 'pm_export_header').''; + $contents .= ''; + $contents .= lang('space', 'pm_export_header'); + $contents .= "\r\n\r\n================================================================\r\n"; + if($touser) { + $contents .= lang('space', 'pm_export_touser', array('touser' => ''.$touser[1].'')); + $contents .= "\r\n================================================================\r\n"; + } elseif($subject) { + $contents .= lang('space', 'pm_export_subject', array('subject' => $subject)); + $contents .= "\r\n================================================================\r\n"; + } + $contents .= "\r\n"; + foreach($list as $key => $val) { + $contents .= $val['author']."\t".dgmdate($val['dateline'])."\r\n"; + $contents .= str_replace(array('
          ', '
          ', ' '), array("\r\n", "\r\n", ' '), $val['message'])."\r\n\r\n"; + } + $contents .= ''; + $contents = nl2br($contents); + + $filesize = strlen($contents); + $filenameencode = strtolower(CHARSET) == 'utf-8' ? rawurlencode($filename) : rawurlencode(diconv($filename, CHARSET, 'UTF-8')); + + $rfc6266blacklist = strexists($_SERVER['HTTP_USER_AGENT'], 'UCBrowser') || strexists($_SERVER['HTTP_USER_AGENT'], 'Quark') || strexists($_SERVER['HTTP_USER_AGENT'], 'SogouM') || strexists($_SERVER['HTTP_USER_AGENT'], 'baidu'); + + dheader('Date: '.gmdate('D, d M Y H:i:s', $val['dateline']).' GMT'); + dheader('Last-Modified: '.gmdate('D, d M Y H:i:s', $val['dateline']).' GMT'); + dheader('Content-Encoding: none'); + dheader('Content-Disposition: attachment; filename="'.$filenameencode.'"'.(($filename == $filenameencode || $rfc6266blacklist) ? '' : '; filename*=utf-8\'\''.$filenameencode)); + + dheader('Content-Type: application/octet-stream'); + dheader('Content-Length: '.$filesize); + + echo $contents; + die; + +} else { + + cknewuser(); + + if(!checkperm('allowsendpm')) { + showmessage('no_privilege_sendpm'); + } + $friends = array(); + if($space['friendnum']) { + $query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, 100, true); + foreach($query as $value) { + $value['uid'] = $value['fuid']; + $value['username'] = daddslashes($value['fusername']); + $friends[] = $value; + } + } + require_once libfile('function/friend'); + $friendgrouplist = friend_group_list(); + + $type = intval($_GET['type']); +} + +include_once template("home/spacecp_pm"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_poke.php b/source/include/spacecp/spacecp_poke.php new file mode 100644 index 0000000..13db032 --- /dev/null +++ b/source/include/spacecp/spacecp_poke.php @@ -0,0 +1,178 @@ +fetch_uid_by_username($_POST['username']); + } + + if($tospace && isblacklist($tospace['uid'])) { + showmessage('is_blacklist'); + } + + if(submitcheck('pokesubmit')) { + if(empty($tospace)) { + showmessage('space_does_not_exist'); + } + + $notetext = censor(htmlspecialchars(cutstr($_POST['note'], strtolower(CHARSET) == 'utf-8' ? 30 : 20, ''))); + $setarr = array( + 'pokeuid' => $uid+$_G['uid'], + 'uid' => $uid, + 'fromuid' => $_G['uid'], + 'note' => $notetext, //need to do + 'dateline' => $_G['timestamp'], + 'iconid' => intval($_POST['iconid']) + ); + C::t('home_pokearchive')->insert($setarr); + + $setarr = array( + 'uid' => $uid, + 'fromuid' => $_G['uid'], + 'fromusername' => $_G['username'], + 'note' => $notetext, + 'dateline' => $_G['timestamp'], + 'iconid' => intval($_POST['iconid']) + ); + + C::t('home_poke')->insert($setarr, false, true); + + require_once libfile('function/friend'); + friend_addnum($tospace['uid']); + + if($op == 'reply') { + C::t('home_poke')->delete_by_uid_fromuid($_G['uid'], $uid); + C::t('common_member')->increase($_G['uid'], array('newprompt' => -1)); + } + updatecreditbyaction('poke', 0, array(), $uid); + + if($setarr['iconid']) { + require_once libfile('function/spacecp'); + $pokemsg = makepokeaction($setarr['iconid']); + } else { + $pokemsg = lang('home/template', 'say_hi'); + } + if(!empty($setarr['note'])) { + $pokemsg .= ', '.lang('home/template', 'say').':'.$setarr['note']; + } + + $note = array( + 'fromurl' => 'home.php?mod=space&uid='.$_G['uid'], + 'fromusername' => $_G['username'], + 'fromuid' => $_G['uid'], + 'from_id' => $_G['uid'], + 'from_idtype' => 'pokequery', + 'pokemsg' => $pokemsg + ); + notification_add($uid, 'poke', 'poke_request', $note); + + include_once libfile('function/stat'); + updatestat('poke'); + + showmessage('poke_success', dreferer(), array('username' => $tospace['username'], 'uid' => $uid, 'from' => $_GET['from']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + + } + +} elseif($op == 'ignore') { + if(submitcheck('ignoresubmit')) { + $where = empty($uid)?'':"AND fromuid='$uid'"; + C::t('home_poke')->delete_by_uid_fromuid($_G['uid'], $uid); + + C::t('home_notification')->delete_by_uid_type_authorid($_G['uid'], 'poke', $uid); + + showmessage('has_been_hailed_overlooked', '', array('uid' => $uid, 'from' => $_GET['from']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true, 'alert' => 'right')); + } + +} elseif($op == 'view') { + + $_GET['uid'] = intval($_GET['uid']); + + $list = array(); + foreach(C::t('home_poke')->fetch_all_by_uid_fromuid($space['uid'], $_GET['uid']) as $value) { + $pokeuid = $value['uid']+$value['fromuid']; + + $value['uid'] = $value['fromuid']; + $value['username'] = $value['fromusername']; + + require_once libfile('function/friend'); + $value['isfriend'] = $value['uid']==$space['uid'] || friend_check($value['uid']) ? 1 : 0; + + foreach(C::t('home_pokearchive')->fetch_all_by_pokeuid($pokeuid) as $subvalue) { + $list[$subvalue['pid']] = $subvalue; + } + + } + +} else { + + $perpage = 20; + $perpage = mob_perpage($perpage); + + $page = empty($_GET['page'])?0:intval($_GET['page']); + if($page<1) $page = 1; + $start = ($page-1)*$perpage; + ckstart($start, $perpage); + + $fuids = $list = array(); + $count = C::t('home_poke')->count_by_uid($space['uid']); + if($count) { + foreach(C::t('home_poke')->fetch_all_by_uid($space['uid'], $start, $perpage) as $value) { + $value['uid'] = $value['fromuid']; + $value['username'] = $value['fromusername']; + + $fuids[$value['uid']] = $value['uid']; + $list[$value['uid']] = $value; + } + if($fuids) { + require_once libfile('function/friend'); + friend_check($fuids); + + $value = array(); + foreach($fuids as $key => $fuid) { + $value['isfriend'] = $fuid==$space['uid'] || $_G["home_friend_".$space['uid'].'_'.$fuid] ? 1 : 0; + $list[$fuid] = array_merge($list[$fuid], $value); + } + + } + } + $multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=poke"); + +} + +$actives = array($op=='send'?'send':'poke' =>' class="a"'); + +include_once template('home/spacecp_poke'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_privacy.php b/source/include/spacecp/spacecp_privacy.php new file mode 100644 index 0000000..f4bbc27 --- /dev/null +++ b/source/include/spacecp/spacecp_privacy.php @@ -0,0 +1,148 @@ + $value) { + if(in_array($key, $viewtype)) { + $space['privacy']['view'][$key] = intval($value); + } + } + } + + if($operation == 'feed') { + $space['privacy']['feed'] = array(); + if(isset($_POST['privacy']['feed'])) { + foreach ($_POST['privacy']['feed'] as $key => $value) { + $space['privacy']['feed'][$key] = 1; + } + } + } + privacy_update(); + + showmessage('do_success', 'home.php?mod=spacecp&ac=privacy&op='.$operation); + +} elseif(submitcheck('privacy2submit')) { + + $space['privacy']['filter_icon'] = array(); + if(isset($_POST['privacy']['filter_icon'])) { + foreach($_POST['privacy']['filter_icon'] as $key => $value) { + $space['privacy']['filter_icon'][$key] = 1; + } + } + $space['privacy']['filter_gid'] = array(); + if(isset($_POST['privacy']['filter_gid'])) { + foreach ($_POST['privacy']['filter_gid'] as $key => $value) { + $space['privacy']['filter_gid'][$key] = intval($value); + } + } + $space['privacy']['filter_note'] = array(); + if(isset($_POST['privacy']['filter_note'])) { + foreach ($_POST['privacy']['filter_note'] as $key => $value) { + $space['privacy']['filter_note'][$key] = 1; + } + } + privacy_update(); + + require_once libfile('function/friend'); + friend_cache($_G['uid']); + + showmessage('do_success', 'home.php?mod=spacecp&ac=privacy&op='.$operation); + +} elseif(submitcheck('privacy3submit')) { + + $arr = array(); + + if(isset($_POST['allowasfriend'])) { + $arr['allowasfriend'] = (int)$_POST['allowasfriend']; + } + + if(isset($_POST['allowasfollow'])) { + $arr['allowasfollow'] = (int)$_POST['allowasfollow']; + } + + C::t('common_member_field_home')->update($_G['uid'], $arr); + + showmessage('do_success', 'home.php?mod=spacecp&ac=privacy&op='.$operation); +} + +if($operation == 'filter') { + require_once libfile('function/friend'); + $groups = friend_group_list(); + + $filter_icons = empty($space['privacy']['filter_icon'])?array():$space['privacy']['filter_icon']; + $filter_note = empty($space['privacy']['filter_note'])?array():$space['privacy']['filter_note']; + $iconnames = $appids = $icons = $uids = $users = array(); + foreach ($filter_icons as $key => $value) { + list($icon, $uid) = explode('|', $key); + $icons[$key] = $icon; + $uids[$key] = $uid; + } + foreach ($filter_note as $key => $value) { + list($type, $uid) = explode('|', $key); + $types[$key] = $type; + $uids[$key] = $uid; + } + if($uids) { + foreach(C::t('common_member')->fetch_all($uids) as $uid => $value) { + $users[$uid] = $value['username']; + } + } + +} elseif ($operation == 'other') { + + $arr = array(); + + $fields = C::t('common_member_field_home')->fetch($_G['uid']); + + $arr['allowasfriend'][$fields['allowasfriend']] = ' selected="selected"'; + $arr['allowasfollow'][$fields['allowasfollow']] = ' selected="selected"'; + +} elseif ($operation == 'getgroup') { + + $gid = empty($_GET['gid'])?0:intval($_GET['gid']); + $users = array(); + $query = C::t('home_friend')->fetch_all_by_uid_gid($_G['uid'], $gid, 0, 0, false); + foreach($query as $value) { + $users[] = $value['fusername']; + } + $ustr = empty($users)?'': dhtmlspecialchars(implode(' ', $users)); + showmessage($ustr, '', array(), array('msgtype' => 3, 'handle'=>false)); + +} else { + + $sels = array(); + if($space['privacy']['view']) { + foreach ($space['privacy']['view'] as $key => $value) { + $sels['view'][$key] = array($value => ' selected'); + } + } + if($space['privacy']['feed']) { + foreach ($space['privacy']['feed'] as $key => $value) { + $sels['feed'][$key] = ' checked'; + } + } +} + +$actives = array('privacy' =>' class="a"'); +$opactives = array($operation =>' class="a"'); + +include template('home/spacecp_privacy'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_profile.php b/source/include/spacecp/spacecp_profile.php new file mode 100644 index 0000000..5c1998f --- /dev/null +++ b/source/include/spacecp/spacecp_profile.php @@ -0,0 +1,670 @@ +fetch_setting('profilegroup', true); + foreach($profilegroup as $key => $value) { + if($value['available']) { + $defaultop = $key; + break; + } + } + +$operation = in_array(getgpc('op'), array('base', 'contact', 'edu', 'work', 'info', 'password', 'verify')) ? trim($_GET['op']) : $defaultop; +$space = getuserbyuid($_G['uid']); +space_merge($space, 'field_home'); +space_merge($space, 'profile'); + +list($seccodecheck, $secqaacheck) = seccheck('password'); +@include_once DISCUZ_ROOT.'./data/cache/cache_domain.php'; +$spacedomain = isset($rootdomain['home']) && $rootdomain['home'] ? $rootdomain['home'] : array(); +$_GET['id'] = getgpc('id') ? preg_replace("/[^A-Za-z0-9_:]/", '', $_GET['id']) : ''; +if($operation != 'password') { + + include_once libfile('function/profile'); + + loadcache('profilesetting'); + if(empty($_G['cache']['profilesetting'])) { + require_once libfile('function/cache'); + updatecache('profilesetting'); + loadcache('profilesetting'); + } +} + +$allowcstatus = !empty($_G['group']['allowcstatus']) ? true : false; +$verify = C::t('common_member_verify')->fetch($_G['uid']); +if(!empty($verify) && is_array($verify)) { + foreach($verify as $key => $flag) { + if(in_array($key, array('verify1', 'verify2', 'verify3', 'verify4', 'verify5', 'verify6', 'verify7')) && $flag == 1) { + $verifyid = intval(substr($key, -1, 1)); + if($_G['setting']['verify'][$verifyid]['available']) { + foreach($_G['setting']['verify'][$verifyid]['field'] as $field) { + $_G['cache']['profilesetting'][$field]['unchangeable'] = 1; + } + } + } + } +} +$validate = array(); +if($_G['setting']['regverify'] == 2 && $_G['groupid'] == 8) { + $validate = C::t('common_member_validate')->fetch($_G['uid']); + if(empty($validate) || $validate['status'] != 1) { + $validate = array(); + } +} +if(getglobal('setting/connect/allow')) { + $connect = C::t('#qqconnect#common_member_connect')->fetch($_G['uid']); + $conisregister = $operation == 'password' && $connect['conisregister']; +} + +if(in_array('wechat', $_G['setting']['plugins']['available'])) { + if($_G['wechat']['setting']['wechat_qrtype']) { + $wechatuser = C::t('#wechat#common_member_wechatmp')->fetch($_G['uid']); + if($wechatuser && !$wechatuser['status']) { + $wechatuser['isregister'] = 1; + } + } else { + $wechatuser = C::t('#wechat#common_member_wechat')->fetch($_G['uid']); + } + + $conisregister = $operation == 'password' && $wechatuser['isregister']; +} + +if(submitcheck('profilesubmit')) { + + require_once libfile('function/discuzcode'); + + $forum = $setarr = $verifyarr = $errorarr = array(); + $forumfield = array('customstatus', 'sightml'); + + $censor = discuz_censor::instance(); + + if($_GET['vid']) { + $vid = intval($_GET['vid']); + if (getuserprofile('verify' . $vid) == 1) { + showmessage('spacecp_profile_message2'); + } + $verifyconfig = $_G['setting']['verify'][$vid]; + if($verifyconfig['available'] && (empty($verifyconfig['groupid']) || in_array($_G['groupid'], $verifyconfig['groupid']))) { + $verifyinfo = C::t('common_member_verify_info')->fetch_by_uid_verifytype($_G['uid'], $vid); + if(!empty($verifyinfo)) { + $verifyinfo['field'] = dunserialize($verifyinfo['field']); + } + foreach($verifyconfig['field'] as $key => $field) { + if(!isset($verifyinfo['field'][$key])) { + $verifyinfo['field'][$key] = $key; + } + } + } else { + $_GET['vid'] = $vid = 0; + $verifyconfig = array(); + } + } + if(isset($_POST['birthcountry'])) { + $initcity = array('birthcountry', 'birthprovince', 'birthcity', 'birthdist', 'birthcommunity'); + foreach($initcity as $key) { + $_GET[''.$key] = $_POST[$key] = !empty($_POST[$key]) ? $_POST[$key] : ''; + } + } + if(isset($_POST['residecountry'])) { + $initcity = array('residecountry', 'resideprovince', 'residecity', 'residedist', 'residecommunity'); + foreach($initcity as $key) { + $_GET[''.$key] = $_POST[$key] = !empty($_POST[$key]) ? $_POST[$key] : ''; + } + } + foreach($_POST as $key => $value) { + $field = $_G['cache']['profilesetting'][$key]; + if(in_array($field['formtype'], array('text', 'textarea')) || in_array($key, $forumfield)) { + $censor->check($value); + if($censor->modbanned() || $censor->modmoderated()) { + profile_showerror($key, lang('spacecp', 'profile_censor')); + } + } + if(in_array($key, $forumfield)) { + if($key == 'sightml') { + loadcache(array('smilies', 'smileytypes')); + $value = cutstr($value, $_G['group']['maxsigsize'], ''); + foreach($_G['cache']['smilies']['replacearray'] AS $skey => $smiley) { + $_G['cache']['smilies']['replacearray'][$skey] = '[img]'.$_G['siteurl'].'static/image/smiley/'.$_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'].'/'.$smiley.'[/img]'; + } + $value = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], trim($value)); + $forum[$key] = discuzcode($value, 1, 0, 0, 0, $_G['group']['allowsigbbcode'], $_G['group']['allowsigimgcode'], 0, 0, 1); + } elseif($key=='customstatus' && $allowcstatus) { + $forum[$key] = dhtmlspecialchars(trim($value)); + } + continue; + } elseif($field && !$field['available']) { + continue; + } elseif($key == 'timeoffset') { + if($value >= -12 && $value <= 12 || $value == 9999) { + C::t('common_member')->update($_G['uid'], array('timeoffset' => intval($value))); + } + } elseif($key == 'site') { + if(!in_array(strtolower(substr($value, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://')) && !preg_match('/^static\//', $value) && !preg_match('/^data\//', $value)) { + $value = 'http://'.$value; + } + } + if($field['formtype'] == 'file') { + if((!empty($_FILES[$key]) && $_FILES[$key]['error'] == 0) || (!empty($space[$key]) && empty($_GET['deletefile'][$key]))) { + $value = '1'; + } else { + $value = ''; + } + } + if(empty($field)) { + continue; + } elseif(profile_check($key, $value, $space)) { + $setarr[$key] = dhtmlspecialchars(trim($value)); + } else { + if($key=='birthcountry' || $key=='birthprovince') { + $key = 'birthcity'; + } elseif($key=='residecountry' || $key=='resideprovince' || $key=='residecommunity'||$key=='residedist') { + $key = 'residecity'; + } elseif($key=='birthyear' || $key=='birthmonth') { + $key = 'birthday'; + } + profile_showerror($key); + } + if($field['formtype'] == 'file') { + unset($setarr[$key]); + } + if (isset($setarr[$key]) && $_G['cache']['profilesetting'][$key]['unchangeable'] && $space[$key]) { + unset($setarr[$key]); + } + if($vid && $verifyconfig['available'] && isset($verifyconfig['field'][$key])) { + if(isset($verifyinfo['field'][$key]) && $setarr[$key] !== $space[$key]) { + $verifyarr[$key] = $setarr[$key]; + } + unset($setarr[$key]); + } + if(isset($setarr[$key]) && $_G['cache']['profilesetting'][$key]['needverify']) { + if($setarr[$key] !== $space[$key]) { + $verifyarr[$key] = $setarr[$key]; + } + unset($setarr[$key]); + } + } + if($_GET['deletefile'] && is_array($_GET['deletefile'])) { + foreach($_GET['deletefile'] as $key => $value) { + if(isset($_G['cache']['profilesetting'][$key]) && $_G['cache']['profilesetting'][$key]['formtype'] == 'file') { + $verifyarr[$key] = $setarr[$key] = ''; + if(isprofileimage($space[$key])) { + @unlink(getglobal('setting/attachdir').'./profile/'.$space[$key]); + } + if(isprofileimage($verifyinfo['field'][$key])) { + @unlink(getglobal('setting/attachdir').'./profile/'.$verifyinfo['field'][$key]); + } + } + } + } + if($_FILES) { + $upload = new discuz_upload(); + foreach($_FILES as $key => $file) { + if(!isset($_G['cache']['profilesetting'][$key])) { + continue; + } + $field = $_G['cache']['profilesetting'][$key]; + if($field['formtype'] != 'file'){ + continue; + } + if((!empty($file) && $file['error'] == 0) || (!empty($space[$key]) && empty($_GET['deletefile'][$key]))) { + $value = '1'; + } else { + $value = ''; + } + if(!profile_check($key, $value, $space)) { + profile_showerror($key); + } elseif($field['size'] && $field['size']*1024 < $file['size']) { + profile_showerror($key, lang('spacecp', 'filesize_lessthan').$field['size'].'KB'); + } elseif($_G['cache']['profilesetting'][$key]['unchangeable'] && !empty($space[$key])){ + profile_showerror($key); + } + $upload->init($file, 'profile'); + $attach = $upload->attach; + + if(!$upload->error()) { + $upload->save(); + + if(!$upload->get_image_info($attach['target'])) { + @unlink($attach['target']); + continue; + } + $setarr[$key] = ''; + if(isprofileimage($space[$key])) { + @unlink(getglobal('setting/attachdir').'./profile/'.$space[$key]); + } + $attach['attachment'] = dhtmlspecialchars(trim($attach['attachment'])); + if($vid && $verifyconfig['available'] && isset($verifyconfig['field'][$key])) { + if(isset($verifyinfo['field'][$key])) { + $verifyarr[$key] = $attach['attachment']; + if(isprofileimage($verifyinfo['field'][$key])) { + @unlink(getglobal('setting/attachdir').'./profile/'.$verifyinfo['field'][$key]); + } + } + continue; + } + if(isset($setarr[$key]) && $_G['cache']['profilesetting'][$key]['needverify']) { + $verifyarr[$key] = $attach['attachment']; + if(isprofileimage($verifyinfo['field'][$key])) { + @unlink(getglobal('setting/attachdir').'./profile/'.$verifyinfo['field'][$key]); + } + continue; + } + $setarr[$key] = $attach['attachment']; + } + + } + } + if($vid && !empty($verifyinfo['field']) && is_array($verifyinfo['field'])) { + foreach($verifyinfo['field'] as $key => $fvalue) { + if(!isset($verifyconfig['field'][$key])) { + unset($verifyinfo['field'][$key]); + continue; + } + if(empty($verifyarr[$key]) && !isset($verifyarr[$key]) && isset($verifyinfo['field'][$key])) { + $verifyarr[$key] = !empty($fvalue) && $key != $fvalue ? $fvalue : $space[$key]; + } + } + } + if($forum) { + if(!$_G['group']['maxsigsize']) { + $forum['sightml'] = ''; + } + C::t('common_member_field_forum')->update($_G['uid'], $forum); + + } + + if(isset($_POST['birthmonth']) && ($space['birthmonth'] != $_POST['birthmonth'] || $space['birthday'] != $_POST['birthday'])) { + $setarr['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']); + } + if(isset($_POST['birthyear']) && $space['birthyear'] != $_POST['birthyear']) { + $setarr['zodiac'] = get_zodiac($_POST['birthyear']); + } + if($setarr) { + if($_G['setting']['profilehistory']) { + C::t('common_member_profile_history')->insert(array_merge(C::t('common_member_profile')->fetch($_G['uid']), array('dateline' => time()))); + } + C::t('common_member_profile')->update($_G['uid'], $setarr); + } + + if($verifyarr) { + C::t('common_member_verify_info')->delete_by_uid($_G['uid'], $vid); + $setverify = array( + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'verifytype' => $vid, + 'field' => serialize($verifyarr), + 'dateline' => $_G['timestamp'] + ); + + C::t('common_member_verify_info')->insert($setverify); + if(!(C::t('common_member_verify')->count_by_uid($_G['uid']))) { + C::t('common_member_verify')->insert(array('uid' => $_G['uid'])); + } + if($_G['setting']['verify'][$vid]['available']) { + manage_addnotify('verify_'.$vid, 0, array('langkey' => 'manage_verify_field', 'verifyname' => $_G['setting']['verify'][$vid]['title'], 'doid' => $vid)); + } + } + + if(isset($_POST['privacy'])) { + foreach($_POST['privacy'] as $key=>$value) { + if(isset($_G['cache']['profilesetting'][$key])) { + $space['privacy']['profile'][$key] = intval($value); + } + } + C::t('common_member_field_home')->update($space['uid'], array('privacy'=>serialize($space['privacy']))); + } + + include_once libfile('function/feed'); + feed_add('profile', 'feed_profile_update_'.$operation, array('hash_data'=>'profile')); + countprofileprogress(); + $message = $vid ? lang('spacecp', 'profile_verify_verifying', array('verify' => $verifyconfig['title'])) : ''; + profile_showsuccess($message); + +} elseif(submitcheck('passwordsubmit', 0, $seccodecheck, $secqaacheck)) { + + $membersql = $memberfieldsql = $authstradd1 = $authstradd2 = $newpasswdadd = ''; + $setarr = array(); + $emailnew = dhtmlspecialchars($_GET['emailnew']); + $secmobiccnew = $_GET['secmobiccnew']; + $secmobilenew = $_GET['secmobilenew']; + $secmobseccode = $_GET['secmobseccodenew']; + $ignorepassword = 0; + if($_G['setting']['connect']['allow']) { + $connect = C::t('#qqconnect#common_member_connect')->fetch($_G['uid']); + if($connect['conisregister']) { + $_GET['oldpassword'] = ''; + $ignorepassword = 1; + if(empty($_GET['newpassword'])) { + showmessage('profile_passwd_empty'); + } + } + } + + if(in_array('mobile', $_G['setting']['plugins']['available']) && $wechatuser['isregister']) { + $_GET['oldpassword'] = ''; + $ignorepassword = 1; + if(empty($_GET['newpassword'])) { + showmessage('profile_passwd_empty'); + } + } + + if($_GET['questionidnew'] === '') { + $_GET['questionidnew'] = $_GET['answernew'] = ''; + } else { + $secquesnew = $_GET['questionidnew'] > 0 ? random(8) : ''; + } + + if(!empty($_GET['newpassword']) && $_G['setting']['strongpw']) { + $strongpw_str = array(); + if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpassword'])) { + $strongpw_str[] = lang('member/template', 'strongpw_1'); + } + if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpassword'])) { + $strongpw_str[] = lang('member/template', 'strongpw_2'); + } + if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpassword'])) { + $strongpw_str[] = lang('member/template', 'strongpw_3'); + } + if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpassword'])) { + $strongpw_str[] = lang('member/template', 'strongpw_4'); + } + if($strongpw_str) { + showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str)); + } + } + if(!empty($_GET['newpassword']) && $_GET['newpassword'] != addslashes($_GET['newpassword'])) { + showmessage('profile_passwd_illegal', '', array(), array('return' => true)); + } + if(!empty($_GET['newpassword']) && $_GET['newpassword'] != $_GET['newpassword2']) { + showmessage('profile_passwd_notmatch', '', array(), array('return' => true)); + } + + if($emailnew != $_G['member']['email'] && $_G['setting']['change_email']) { + showmessage('profile_email_not_change', '', array(), array('return' => true)); + } + + if((strcmp($secmobiccnew, $_G['member']['secmobicc']) != 0 || strcmp($secmobilenew, $_G['member']['secmobile']) != 0) && $_G['setting']['change_secmobile']) { + showmessage('profile_secmobile_not_change', '', array(), array('return' => true)); + } + + if($secmobiccnew === '' && $secmobilenew !== '' && preg_match('#^(\d){1,12}$#', $secmobilenew)) { + $secmobiccnew = $_G['setting']['smsdefaultcc']; + } + + if($secmobiccnew === '') { + $secmobiccnew == 0; + }elseif(!preg_match('#^(\d){1,3}$#', $secmobiccnew)) { + showmessage('profile_secmobicc_illegal', '', array(), array('return' => true)); + } + + if($secmobilenew === '') { + $secmobilenew == 0; + }elseif($secmobilenew !== '' && !preg_match('#^(\d){1,12}$#', $secmobilenew)) { + showmessage('profile_secmobile_illegal', '', array(), array('return' => true)); + } + + loaducenter(); + if($emailnew != $_G['member']['email']) { + include_once libfile('function/member'); + checkemail($emailnew); + } + $ucresult = uc_user_edit(addslashes($_G['username']), $_GET['oldpassword'], $_GET['newpassword'], '', $ignorepassword, $_GET['questionidnew'], $_GET['answernew'], $secmobiccnew, $secmobilenew); + if($ucresult == -1) { + showmessage('profile_passwd_wrong', '', array(), array('return' => true)); + } elseif($ucresult == -4) { + showmessage('profile_email_illegal', '', array(), array('return' => true)); + } elseif($ucresult == -5) { + showmessage('profile_email_domain_illegal', '', array(), array('return' => true)); + } elseif($ucresult == -6) { + showmessage('profile_email_duplicate', '', array(), array('return' => true)); + } elseif($ucresult == -9) { + showmessage('profile_secmobile_duplicate', '', array(), array('return' => true)); + } + + if(!empty($_GET['newpassword']) || $secquesnew) { + $setarr['password'] = md5(random(10)); + } + if($_G['setting']['connect']['allow']) { + C::t('#qqconnect#common_member_connect')->update($_G['uid'], array('conisregister' => 0)); + } + + if(in_array('mobile', $_G['setting']['plugins']['available']) && $wechatuser['isregister']) { + C::t('#wechat#common_member_wechat')->update($_G['uid'], array('isregister' => 0)); + } + + $authstr = false; + if($emailnew != $_G['member']['email']) { + if(emailcheck_send($space['uid'], $emailnew)) { + $authstr = true; + dsetcookie('newemail', "{$space['uid']}\t$emailnew\t{$_G['timestamp']}", 31536000); + } + } + if($_G['setting']['smsstatus'] && (strcmp($secmobiccnew, $_G['member']['secmobicc']) != 0 || strcmp($secmobilenew, $_G['member']['secmobile']) != 0) && empty($secmobseccode)) { + $length = $_G['setting']['smsdefaultlength'] ? $_G['setting']['smsdefaultlength'] : 4; + sms::send($_G['uid'], 0, 1, $secmobiccnew, $secmobilenew, random($length, 1), 0); + } + $setarr['secmobicc'] = $secmobiccnew == 0 ? '' : $secmobiccnew; + $setarr['secmobile'] = $secmobilenew == 0 ? '' : $secmobilenew; + if(strcmp($secmobiccnew, $_G['member']['secmobicc']) != 0 || strcmp($secmobilenew, $_G['member']['secmobile']) != 0) { + $setarr['secmobilestatus'] = sms::verify($_G['uid'], 1, $secmobiccnew, $secmobilenew, $secmobseccode); + } + if($setarr) { + if($_G['member']['freeze'] == 1) { + $setarr['freeze'] = 0; + } + C::t('common_member')->update($_G['uid'], $setarr); + } + if($_G['member']['freeze'] == 2 || $_G['member']['freeze'] == -1) { + $status = C::t('common_member_validate')->fetch($_G['uid']); + if($status) { + C::t('common_member_validate')->update($_G['uid'], array( + 'submitdate' => TIMESTAMP, + 'submittimes' => $status['submittimes'] + 1, + 'status' => 0, + 'message' => dhtmlspecialchars(addslashes($_POST['freezereson'])), + )); + } else { + C::t('common_member_validate')->insert(array( + 'uid' => $_G['uid'], + 'submitdate' => TIMESTAMP, + 'moddate' => 0, + 'admin' => '', + 'submittimes' => 1, + 'status' => 0, + 'message' => dhtmlspecialchars(addslashes($_POST['freezereson'])), + 'remark' => '', + ), false, true); + } + manage_addnotify('verifyuser'); + } + + if(!empty($_GET['newpassword'])) { + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + + $reset_password_subject = array( + 'tpl' => 'password_reset', + 'var' => array( + 'username' => $_G['member']['username'], + 'bbname' => $_G['setting']['bbname'], + 'siteurl' => $_G['setting']['securesiteurl'], + 'datetime' => dgmdate(time(), 'Y-m-d H:i:s'), + 'clientip' => $_G['clientip'] + ) + ); + if(!sendmail("{$_G['member']['username']} <{$_G['member']['email']}>", $reset_password_subject)) { + runlog('sendmail', "{$_G['member']['email']} sendmail failed."); + } + } + + if((strcmp($secmobiccnew, $_G['member']['secmobicc']) != 0 || strcmp($secmobilenew, $_G['member']['secmobile']) != 0) && (!$_G['setting']['smsstatus'] || $setarr['secmobilestatus'])) { + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + + $reset_secmobile_subject = array( + 'tpl' => 'secmobile_reset', + 'var' => array( + 'username' => $_G['member']['username'], + 'bbname' => $_G['setting']['bbname'], + 'siteurl' => $_G['setting']['securesiteurl'], + 'datetime' => dgmdate(time(), 'Y-m-d H:i:s'), + 'secmobile' => $_G['member']['secmobicc'].'-'.$_G['member']['secmobile'], + 'clientip' => $_G['clientip'] + ) + ); + if(!sendmail("{$_G['member']['username']} <{$_G['member']['email']}>", $reset_secmobile_subject)) { + runlog('sendmail', "{$_G['member']['email']} sendmail failed."); + } + } + + if($authstr) { + showmessage('profile_email_verify', 'home.php?mod=spacecp&ac=profile&op=password'); + } else { + showmessage('profile_succeed', 'home.php?mod=spacecp&ac=profile&op=password'); + } +} + +if($operation == 'password') { + + $interval = $_G['setting']['mailinterval'] > 0 ? (int)$_G['setting']['mailinterval'] : 300; + $resend = getcookie('resendemail'); + $resend = empty($resend) ? true : (TIMESTAMP - $resend) > $interval; + $newemail = getcookie('newemail'); + $space['newemail'] = !$space['emailstatus'] ? $space['email'] : ''; + if(!empty($newemail)) { + $mailinfo = explode("\t", $newemail); + if(is_array($mailinfo) && $mailinfo[0] == $_G['uid'] && isemail($mailinfo[1])) { + if($space['emailstatus'] && !$space['freeze'] && strcasecmp($mailinfo[1], $space['email']) === 0) { + dsetcookie('newemail', '', -1); + $space['newemail'] = ''; + } else { + $space['newemail'] = $mailinfo[1]; + } + } + } + + if(getgpc('resend') && $resend && $_GET['formhash'] == FORMHASH) { + $toemail = $space['newemail'] ? $space['newemail'] : $space['email']; + if(emailcheck_send($space['uid'], $toemail)) { + dsetcookie('newemail', "{$space['uid']}\t$toemail\t{$_G['timestamp']}", 31536000); + dsetcookie('resendemail', TIMESTAMP); + showmessage('send_activate_mail_succeed', "home.php?mod=spacecp&ac=profile&op=password"); + } else { + showmessage('send_activate_mail_error', 'home.php?mod=spacecp&ac=profile&op=password', array('interval' => $interval)); + } + } elseif (getgpc('resend')) { + showmessage('send_activate_mail_error', 'home.php?mod=spacecp&ac=profile&op=password', array('interval' => $interval)); + } + if(!empty($space['newemail'])) { + $acitvemessage = lang('spacecp', 'email_acitve_message', array('newemail' => $space['newemail'], 'imgdir' => $_G['style']['imgdir'], 'formhash' => FORMHASH)); + } + $actives = array('password' =>' class="a"'); + $navtitle = lang('core', 'title_password_security'); + if($_G['member']['freeze'] == 2 || $_G['member']['freeze'] == -1) { + $fzvalidate = C::t('common_member_validate')->fetch($space['uid']); + $space['freezereson'] = $fzvalidate['message']; + $space['freezemodremark'] = $fzvalidate['remark']; + $space['freezemoddate'] = dgmdate($fzvalidate['moddate'], 'Y-m-d H:i:s'); + $space['freezemodadmin'] = $fzvalidate['admin']; + $space['freezemodsubmittimes'] = $fzvalidate['submittimes']; + } + +} else { + + space_merge($space, 'field_home'); + space_merge($space, 'field_forum'); + + require_once libfile('function/editor'); + $space['sightml'] = html2bbcode($space['sightml']); + + $vid = getgpc('vid') ? intval($_GET['vid']) : 0; + + $privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array(); + $_G['setting']['privacy'] = $_G['setting']['privacy'] ? $_G['setting']['privacy'] : array(); + $_G['setting']['privacy'] = is_array($_G['setting']['privacy']) ? $_G['setting']['privacy'] : dunserialize($_G['setting']['privacy']); + $_G['setting']['privacy']['profile'] = !empty($_G['setting']['privacy']['profile']) ? $_G['setting']['privacy']['profile'] : array(); + $privacy = array_merge($_G['setting']['privacy']['profile'], $privacy); + + $actives = array('profile' =>' class="a"'); + $opactives = array($operation =>' class="a"'); + $allowitems = array(); + if(in_array($operation, array('base', 'contact', 'edu', 'work', 'info'))) { + $allowitems = $profilegroup[$operation]['field']; + } elseif($operation == 'verify') { + if($vid == 0) { + foreach($_G['setting']['verify'] as $key => $setting) { + if($setting['available'] && (empty($setting['groupid']) || in_array($_G['groupid'], $setting['groupid']))) { + $_GET['vid'] = $vid = $key; + break; + } + } + } + + if(empty($_G['setting']['verify'][$vid]['groupid']) || in_array($_G['groupid'], $_G['setting']['verify'][$vid]['groupid'])) { + $actives = array('verify' =>' class="a"'); + $opactives = array($operation.$vid =>' class="a"'); + $allowitems = $_G['setting']['verify'][$vid]['field']; + } + } + $showbtn = ($vid && $verify['verify'.$vid] != 1) || empty($vid); + if(!empty($verify) && is_array($verify)) { + foreach($verify as $key => $flag) { + if(in_array($key, array('verify1', 'verify2', 'verify3', 'verify4', 'verify5', 'verify6')) && $flag == 1) { + $verifyid = intval(substr($key, -1, 1)); + if($_G['setting']['verify'][$verifyid]['available']) { + foreach($_G['setting']['verify'][$verifyid]['field'] as $field) { + $_G['cache']['profilesetting'][$field]['unchangeable'] = 1; + } + } + } + } + } + if($vid) { + if($value = C::t('common_member_verify_info')->fetch_by_uid_verifytype($_G['uid'], $vid)) { + $field = dunserialize($value['field']); + foreach($field as $key => $fvalue) { + $space[$key] = $fvalue; + } + } + } + $htmls = $settings = array(); + foreach($allowitems as $fieldid) { + if(!in_array($fieldid, array('sightml', 'customstatus', 'timeoffset'))) { + $html = profile_setting($fieldid, $space, $vid ? false : true); + if($html) { + $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid]; + $htmls[$fieldid] = $html; + } + } + } +} + +include template("home/spacecp_profile"); + +function profile_showerror($key, $extrainfo = '') { + echo ''; + exit(); +} + +function profile_showsuccess($message = '') { + echo ''; + exit(); +} + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_profilevalidate.php b/source/include/spacecp/spacecp_profilevalidate.php new file mode 100644 index 0000000..3b54fa6 --- /dev/null +++ b/source/include/spacecp/spacecp_profilevalidate.php @@ -0,0 +1,24 @@ + '/^((\\(?\\d{3,4}\\)?)|(\\d{3,4}-)?)\\d{7,8}$/', + 'mobile' => '/^(\+)?(86)?0?1\\d{10}$/', + 'zipcode' => '/^\\d{5,6}$/', + 'revenue' => '/^\\d+$/', + 'height' => '/^\\d{1,3}$/', + 'weight' => '/^\\d{1,3}$/', + 'qq' => '/^[1-9]*[1-9][0-9]*$/' +); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_promotion.php b/source/include/spacecp/spacecp_promotion.php new file mode 100644 index 0000000..949ed0d --- /dev/null +++ b/source/include/spacecp/spacecp_promotion.php @@ -0,0 +1,34 @@ + $_G['username'], 'bbname' => daddslashes($_G['setting']['bbname']))); + +$visitstr = $regstr = ''; +foreach($_G['setting']['extcredits'] as $key => $credit) { + $creditkey = 'extcredits'.$key; + if($visit[$creditkey]) { + $visitstr .= $credit['title'].($visit[$creditkey] > 0 ? '+'.$visit[$creditkey] : $visit[$creditkey])." "; + } + if($register[$creditkey]) { + $regstr .= $credit['title'].($register[$creditkey] > 0 ? '+'.$register[$creditkey] : $register[$creditkey])." "; + } +} + +include_once template("home/spacecp_promotion"); +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_search.php b/source/include/spacecp/spacecp_search.php new file mode 100644 index 0000000..28a4368 --- /dev/null +++ b/source/include/spacecp/spacecp_search.php @@ -0,0 +1,179 @@ + $value) { + if($value['title'] && $value['available'] && $value['allowsearch'] && !in_array($key, $myfields)) { + $fields[$value['fieldid']] = $value; + } +} + +$nowy = dgmdate($_G['timestamp'], 'Y'); +$_GET = daddslashes($_GET); +if(!empty($_GET['searchsubmit']) || !empty($_GET['searchmode'])) { + $_GET['searchsubmit'] = $_GET['searchmode'] = 1; + $wherearr = $fromarr = $uidjoin = array(); + $fsql = ''; + + $fromarr['member'] = DB::table('common_member').' s'; + + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $wherearr[] = 's.'.DB::field('username', $searchkey); + $searchkey = dhtmlspecialchars($searchkey); + } else { + foreach (array('uid','username','avatarstatus') as $value) { + if($_GET[$value]) { + if($value == 'username' && empty($_GET['precision'])) { + $_GET[$value] = stripsearchkey($_GET[$value]); + $wherearr[] = 's.'.DB::field($value, '%'.$_GET[$value].'%', 'like'); + } else { + $wherearr[] = 's.'.DB::field($value, $_GET[$value]); + } + } + } + } + + $startage = $endage = 0; + if($_GET['endage']) { + $startage = $nowy - intval($_GET['endage']); + } + if($_GET['startage']) { + $endage = $nowy - intval($_GET['startage']); + } + + if($startage && $endage && $endage > $startage) { + $wherearr[] = 'sf.'.DB::field('birthyear', $startage, '>=').' AND sf.'.DB::field('birthyear', $endage, '<='); + } else if($startage && empty($endage)) { + $wherearr[] = 'sf.'.DB::field('birthyear', $startage, '>='); + } else if(empty($startage) && $endage) { + $wherearr[] = 'sf.'.DB::field('birthyear', $endage, '<='); + } + + $havefield = 0; + foreach ($myfields as $fkey) { + $_GET[$fkey] = trim($_GET[$fkey]); + if($_GET[$fkey]) { + $havefield = 1; + $wherearr[] = 'sf.'.DB::field($fkey, $_GET[$fkey]); + } + } + + foreach ($fields as $fkey => $fvalue) { + $_GET['field_'.$fkey] = empty($_GET['field_'.$fkey])?'':stripsearchkey($_GET['field_'.$fkey]); + if($_GET['field_'.$fkey]) { + $havefield = 1; + $wherearr[] = 'sf.'.DB::field($fkey, '%'.$_GET['field_'.$fkey].'%', 'like'); + } + } + + if($havefield || $startage || $endage) { + $fromarr['profile'] = DB::table('common_member_profile').' sf'; + $wherearr['profile'] = "sf.uid=s.uid"; + } + + $list = $ols = array(); + if($wherearr) { + + $space['friends'] = array(); + $query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, 0); + foreach($query as $value) { + $space['friends'][$value['fuid']] = $value['fuid']; + } + + foreach(C::t('common_member')->fetch_all_for_spacecp_search($wherearr, $fromarr, 0, 100) as $value) { + $value['isfriend'] = ($value['uid']==$space['uid'] || $space['friends'][$value['uid']])?1:0; + $list[$value['uid']] = $value; + } + $follows = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], array_keys($list)); + foreach($list as $uid => $value) { + $list[$uid]['follow'] = isset($follows[$uid]) ? 1 : 0; + } + if (!empty($list)) { + foreach(C::app()->session->fetch_all_by_uid(array_keys($list)) as $value) { + if(!$value['invisible']) { + $ols[$value['uid']] = 1; + } + } + } + } + + +} else { + + $yearhtml = ''; + + for ($i=0; $i<50; $i++) { + $they = $nowy - $i; + $yearhtml .= ""; + } + + $sexarr = array($space['sex']=>' checked=\"checked\"'); + + $birthyeayhtml = ''; + for ($i=0; $i<100; $i++) { + $they = $nowy - $i; + if(empty($_GET['all'])) $selectstr = $they == $space['birthyear']?' selected=\"selected\"':''; + $birthyeayhtml .= ""; + } + $birthmonthhtml = ''; + for ($i=1; $i<13; $i++) { + if(empty($_GET['all'])) $selectstr = $i == $space['birthmonth']?' selected=\"selected\"':''; + $birthmonthhtml .= ""; + } + $birthdayhtml = ''; + for ($i=1; $i<29; $i++) { + if(empty($_GET['all'])) $selectstr = $i == $space['birthday']?' selected=\"selected\"':''; + $birthdayhtml .= ""; + } + $bloodhtml = ''; + foreach (array('A','B','O','AB') as $value) { + if(empty($_GET['all'])) $selectstr = $value == $space['blood']?' selected=\"selected\"':''; + $bloodhtml .= ""; + } + $marryarr = array($space['marry'] => ' selected'); + + include_once libfile('function/profile'); + $birthcityhtml = showdistrict(array(0,0,0), array('birthcountry', 'birthprovince', 'birthcity'), 'birthcitybox', null, 'birth'); + $residecityhtml = showdistrict(array(0,0, 0, 0, 0), array('residecountry', 'resideprovince', 'residecity', 'residedist', 'residecommunity'), 'residecitybox', null, 'reside'); + + foreach ($fields as $fkey => $fvalue) { + if(empty($fvalue['choices'])) { + $fvalue['html'] = ''; + } else { + $fvalue['html'] = ""; + } + $fields[$fkey] = $fvalue; + } +} + +$navtitle = lang('core', 'title_search_friend'); + +$actives = array($op=>' class="a"', 'search'=>' class="a"'); +include template('home/spacecp_search'); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_sendmail.php b/source/include/spacecp/spacecp_sendmail.php new file mode 100644 index 0000000..abd29d8 --- /dev/null +++ b/source/include/spacecp/spacecp_sendmail.php @@ -0,0 +1,44 @@ +update($_G['uid'], array('acceptemail' => $_GET['sendmail'])); + showmessage('do_success', 'home.php?mod=spacecp&ac=sendmail'); +} + + +if(empty($space['email']) || !isemail($space['email'])) { + showmessage('email_input'); +} + +$sendmail = array(); +if($space['acceptemail'] && is_array($space['acceptemail'])) { + foreach($space['acceptemail'] as $mkey=>$mailset) { + if($mkey != 'frequency') { + $sendmail[$mkey] = empty($space['acceptemail'][$mkey]) ? '' : ' checked'; + } else { + $sendmail[$mkey] = array($space['acceptemail']['frequency'] => 'selected'); + } + } +} + +include_once template("home/spacecp_sendmail"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_share.php b/source/include/spacecp/spacecp_share.php new file mode 100644 index 0000000..6c20a64 --- /dev/null +++ b/source/include/spacecp/spacecp_share.php @@ -0,0 +1,551 @@ + $sid), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true)); + } +} elseif($_GET['op'] == 'edithot') { + if(!checkperm('manageshare')) { + showmessage('no_privilege_edithot_share'); + } + + if($sid) { + if(!$share = C::t('home_share')->fetch($sid)) { + showmessage('share_does_not_exist'); + } + } + + if(submitcheck('hotsubmit')) { + C::t('home_share')->update($sid, array('hot'=>$_POST['hot'])); + C::t('home_feed')->update_feed($sid, array('hot'=>$_POST['hot']), 'sid'); + + showmessage('do_success', dreferer()); + } + +} else { + + + if(!checkperm('allowshare') || !helper_access::check_module('share')) { + showmessage('no_privilege_share'); + } + + cknewuser(); + + $type = empty($_GET['type'])?'':$_GET['type']; + $id = empty($_GET['id'])?0:intval($_GET['id']); + $note_uid = 0; + $note_message = ''; + $note_values = array(); + + $hotarr = array(); + + $arr = array(); + $feed_hash_data = ''; + + switch ($type) { + case 'space': + + $feed_hash_data = "uid{$id}"; + + $tospace = getuserbyuid($id); + if(empty($tospace)) { + showmessage('space_does_not_exist'); + } + if(isblacklist($tospace['uid'])) { + showmessage('is_blacklist'); + } + + $arr['itemid'] = $id; + $arr['fromuid'] = $id; + $arr['title_template'] = lang('spacecp', 'share_space'); + $arr['body_template'] = '{username}
          {reside}
          {spacenote}'; + $arr['body_data'] = array( + 'username' => "".$tospace['username']."", + 'reside' => $tospace['residecountry'].$tospace['resideprovince'].$tospace['residecity'], + 'spacenote' => $tospace['spacenote'] + ); + + loaducenter(); + $isavatar = uc_check_avatar($id); + $arr['image'] = $isavatar?avatar($id, 'middle', true):$_G['setting']['avatarurl'].'/noavatar.svg'; + $arr['image_link'] = "home.php?mod=space&uid=$id"; + + $note_uid = $id; + $note_message = 'share_space'; + + break; + case 'blog': + + $feed_hash_data = "blogid{$id}"; + + $blog = array_merge( + C::t('home_blog')->fetch($id), + C::t('home_blogfield')->fetch($id) + ); + if(!$blog) { + showmessage('blog_does_not_exist'); + } + if(in_array($blog['status'], array(1, 2))) { + showmessage('moderate_blog_not_share'); + } + if($blog['friend']) { + showmessage('logs_can_not_share'); + } + if(isblacklist($blog['uid'])) { + showmessage('is_blacklist'); + } + $arr['fromuid'] = $blog['uid']; + $arr['itemid'] = $id; + $arr['title_template'] = lang('spacecp', 'share_blog'); + $arr['body_template'] = '{subject}
          {username}
          {message}'; + $arr['body_data'] = array( + 'subject' => "{$blog['subject']}", + 'username' => "".$blog['username']."", + 'message' => getstr($blog['message'], 150, 0, 0, 0, -1) + ); + if($blog['pic']) { + $arr['image'] = pic_cover_get($blog['pic'], $blog['picflag']); + $arr['image_link'] = "home.php?mod=space&uid={$blog['uid']}&do=blog&id={$blog['blogid']}"; + } + $note_uid = $blog['uid']; + $note_message = 'share_blog'; + $note_values = array('url'=>"home.php?mod=space&uid={$blog['uid']}&do=blog&id={$blog['blogid']}", 'subject'=>$blog['subject'], 'from_id' => $id, 'from_idtype' => 'blogid'); + + $hotarr = array('blogid', $blog['blogid'], $blog['hotuser']); + + break; + case 'album': + + $feed_hash_data = "albumid{$id}"; + + if(!$album = C::t('home_album')->fetch_album($id)) { + showmessage('album_does_not_exist'); + } + if($album['friend']) { + showmessage('album_can_not_share'); + } + if(isblacklist($album['uid'])) { + showmessage('is_blacklist'); + } + + $arr['itemid'] = $id; + $arr['fromuid'] = $album['uid']; + $arr['title_template'] = lang('spacecp', 'share_album'); + $arr['body_template'] = '{albumname}
          {username}'; + $arr['body_data'] = array( + 'albumname' => "{$album['albumname']}", + 'username' => "".$album['username']."" + ); + $arr['image'] = pic_cover_get($album['pic'], $album['picflag']); + $arr['image_link'] = "home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}"; + $note_uid = $album['uid']; + $note_message = 'share_album'; + $note_values = array('url'=>"home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}", 'albumname'=>$album['albumname'], 'from_id' => $id, 'from_idtype' => 'albumid'); + + break; + case 'pic': + + $feed_hash_data = "picid{$id}"; + $pic = C::t('home_pic')->fetch($id); + if(!$pic) { + showmessage('image_does_not_exist'); + } + $picfield = C::t('home_picfield')->fetch($id); + $album = C::t('home_album')->fetch_album($pic['albumid']); + $pic = array_merge($pic, $picfield, $album); + if(in_array($pic['status'], array(1, 2))) { + showmessage('moderate_pic_not_share'); + } + if($pic['friend']) { + showmessage('image_can_not_share'); + } + if(isblacklist($pic['uid'])) { + showmessage('is_blacklist'); + } + if(empty($pic['albumid'])) $pic['albumid'] = 0; + if(empty($pic['albumname'])) $pic['albumname'] = lang('spacecp', 'default_albumname'); + + $arr['itemid'] = $id; + $arr['fromuid'] = $pic['uid']; + $arr['title_template'] = lang('spacecp', 'share_image'); + $arr['body_template'] = lang('spacecp', 'album').': {albumname}
          {username}
          {title}'; + $arr['body_data'] = array( + 'albumname' => "{$pic['albumname']}", + 'username' => "".$pic['username']."", + 'title' => getstr($pic['title'], 100, 0, 0, 0, -1) + ); + $arr['image'] = pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote']); + $arr['image_link'] = "home.php?mod=space&uid={$pic['uid']}&do=album&picid={$pic['picid']}"; + $note_uid = $pic['uid']; + $note_message = 'share_pic'; + $note_values = array('url'=>"home.php?mod=space&uid={$pic['uid']}&do=album&picid={$pic['picid']}", 'albumname'=>$pic['albumname'], 'from_id' => $id, 'from_idtype' => 'picid'); + + $hotarr = array('picid', $pic['picid'], $pic['hotuser']); + + break; + + case 'thread': + + $feed_hash_data = "tid{$id}"; + + $actives = array('share' => ' class="active"'); + + $thread = C::t('forum_thread')->fetch_thread($id); + if(in_array($thread['displayorder'], array(-2, -3))) { + showmessage('moderate_thread_not_share'); + } + require_once libfile('function/post'); + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($id); + $arr['title_template'] = lang('spacecp', 'share_thread'); + $arr['body_template'] = '{subject}
          {author}
          {message}'; + $attachment = !preg_match("/\[hide=?\d*\](.*?)\[\/hide\]/is", $post['message'], $a) && preg_match("/\[attach\]\d+\[\/attach\]/i", $a[1]); + $post['message'] = threadmessagecutstr($thread, $post['message']); + $arr['body_data'] = array( + 'subject' => "{$thread['subject']}", + 'author' => "{$thread['author']}", + 'message' => getstr($post['message'], 150, 0, 0, 0, -1) + ); + $arr['itemid'] = $id; + $arr['fromuid'] = $thread['authorid']; + $attachment = $attachment ? C::t('forum_attachment_n')->fetch_max_image('tid:'.$id, 'tid', $id) : false; + if($attachment) { + $arr['image'] = pic_get($attachment['attachment'], 'forum', $attachment['thumb'], $attachment['remote'], 1); + $arr['image_link'] = "forum.php?mod=viewthread&tid=$id"; + } + + $note_uid = $thread['authorid']; + $note_message = 'share_thread'; + $note_values = array('url'=>"forum.php?mod=viewthread&tid=$id", 'subject'=>$thread['subject'], 'from_id' => $id, 'from_idtype' => 'tid'); + break; + + case 'article': + + $feed_hash_data = "articleid{$id}"; + + $article = C::t('portal_article_title')->fetch($id); + if(!$article) { + showmessage('article_does_not_exist'); + } + if(in_array($article['status'], array(1, 2))) { + showmessage('moderate_article_not_share'); + } + + require_once libfile('function/portal'); + $article_url = fetch_article_url($article); + $arr['itemid'] = $id; + $arr['fromuid'] = $article['uid']; + $arr['title_template'] = lang('spacecp', 'share_article'); + $arr['body_template'] = '{title}
          {username}
          {summary}'; + $arr['body_data'] = array( + 'title' => "{$article['title']}", + 'username' => "".$article['username']."", + 'summary' => getstr($article['summary'], 150, 0, 0, 0, -1) + ); + if($article['pic']) { + $arr['image'] = pic_get($article['pic'], 'portal', $article['thumb'], $article['remote'], 1, 1); + $arr['image_link'] = $article_url; + } + $note_uid = $article['uid']; + $note_message = 'share_article'; + $note_values = array('url'=>$article_url, 'subject'=>$article['title'], 'from_id' => $id, 'from_idtype' => 'aid'); + + break; + default: + + $actives = array('share' => ' class="active"'); + + $_G['refer'] = 'home.php?mod=space&uid='.$_G['uid'].'&do=share&view=me'; + $type = 'link'; + $_GET['op'] = 'link'; + $linkdefault = 'http://'; + $generaldefault = ''; + break; + } + + $commentcable = array('blog' => 'blogid', 'pic' => 'picid', 'thread' => 'thread', 'article' => 'article'); + + if(submitcheck('sharesubmit', 0, $seccodecheck, $secqaacheck)) { + + $magvalues = array(); + $redirecturl = ''; + $showmessagecontent = ''; + + if($type == 'link') { + $link = dhtmlspecialchars(trim($_POST['link'])); + preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)[^\[\"']+/i", $link, $matches); + $link = $matches[0]; + if($link) { + if(!preg_match("/^(http|ftp|https|mms)\:\/\/.{4,300}$/i", $link)) $link = ''; + } + if(empty($link)) { + showmessage('url_incorrect_format'); + } + + $arr['itemid'] = '0'; + $arr['fromuid'] = '0'; + $arr['title_template'] = lang('spacecp', 'share_link'); + $arr['body_template'] = '{link}'; + $link_text = sub_url($link, 45); + + $arr['body_data'] = array('link'=>"".$link_text."", 'data'=>$link); + $parseLink = parse_url($link); + require_once libfile('function/discuzcode'); + $flashvar = parseflv($link); + if(empty($flashvar) && preg_match("/\.flv$/i", $link)) { + $flashvar = array( + 'flv' => $link, + 'imgurl' => '' + ); + } + if(!empty($flashvar)) { + $title = geturltitle($link); + if($title) { + $arr['body_data'] = array('link'=>"".$title."", 'data'=>$link); + } + $arr['title_template'] = lang('spacecp', 'share_video'); + $type = 'video'; + $arr['body_data']['flashvar'] = $flashvar['flv']; + $arr['body_data']['host'] = 'flash'; + $arr['body_data']['imgurl'] = $flashvar['imgurl']; + } + if(preg_match("/\.(mp3|wma)$/i", $link)) { + $arr['title_template'] = lang('spacecp', 'share_music'); + $arr['body_data']['musicvar'] = $link; + $type = 'music'; + } + if(preg_match("/\.swf$/i", $link)) { + $arr['title_template'] = lang('spacecp', 'share_flash'); + $arr['body_data']['flashaddr'] = $link; + $type = 'flash'; + } + if(preg_match("/\.(mp4|m4v|3gp|ogv|webm)$/i", $link)) { + $arr['title_template'] = lang('spacecp', 'share_video'); + $arr['body_data']['videovar'] = $link; + $type = 'video'; + } + } + + if($_GET['iscomment'] && $_POST['general'] && $commentcable[$type] && $id) { + + $_POST['general'] = censor($_POST['general']); + + $currenttype = $commentcable[$type]; + $currentid = $id; + + if($currenttype == 'article') { + $article = C::t('portal_article_title')->fetch($currentid); + include_once libfile('function/portal'); + loadcache('portalcategory'); + $cat = $_G['cache']['portalcategory'][$article['catid']]; + $article['allowcomment'] = !empty($cat['allowcomment']) && !empty($article['allowcomment']) ? 1 : 0; + if(!$article['allowcomment']) { + showmessage('no_privilege_commentadd', '', array(), array('return' => true)); + } + if($article['idtype'] == 'blogid') { + $currentid = $article['id']; + $currenttype = 'blogid'; + } elseif($article['idtype'] == 'tid') { + $currentid = $article['id']; + $currenttype = 'thread'; + } + } + + if($currenttype == 'thread') { + if($commentcable[$type] == 'article') { + $_POST['portal_referer'] = $article_url ? $article_url : 'portal.php?mod=view&aid='.$id; + } + + $_G['setting']['seccodestatus'] = 0; + $_G['setting']['secqaa']['status'] = 0; + + $_POST['replysubmit'] = true; + $_GET['tid'] = $currentid; + $_GET['action'] = 'reply'; + $_GET['message'] = $_POST['general']; + include_once libfile('function/forum'); + require_once libfile('function/post'); + loadforum(); + + $inspacecpshare = 1; + include_once libfile('forum/post', 'module'); + + if($_POST['portal_referer']) { + $redirecturl = $_POST['portal_referer']; + } else { + if($modnewreplies) { + $redirecturl = "forum.php?mod=viewthread&tid=".$currentid; + } else { + $redirecturl = "forum.php?mod=viewthread&tid=".$currentid."&pid=".$modpost->pid."&page=".$modpost->param('page')."&extra=".$extra."#pid".$modpost->pid; + } + } + $showmessagecontent = ($modnewreplies && $commentcable[$type] != 'article') ? 'do_success_thread_share_mod' : ''; + + } elseif($currenttype == 'article') { + + if(!checkperm('allowcommentarticle')) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } + + include_once libfile('function/spacecp'); + include_once libfile('function/portalcp'); + + cknewuser(); + + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + + $aid = intval($currentid); + $message = $_POST['general']; + + $retmessage = addportalarticlecomment($aid, $message); + if($retmessage != 'do_success') { + showmessage($retmessage); + } + + } elseif($currenttype == 'picid' || $currenttype == 'blogid') { + + if(!checkperm('allowcomment')) { + showmessage('no_privilege_comment', '', array(), array('return' => true)); + } + cknewuser(); + $waittime = interval_check('post'); + if($waittime > 0) { + showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); + } + $message = getstr($_POST['general'], 0, 0, 0, 2); + if(strlen($message) < 2) { + showmessage('content_is_too_short', '', array(), array('return' => true)); + } + include_once libfile('class/bbcode'); + $bbcode = & bbcode::instance(); + + require_once libfile('function/comment'); + $cidarr = add_comment($message, $currentid, $currenttype, 0); + if($cidarr['cid']) { + $magvalues['cid'] = $cidarr['cid']; + $magvalues['id'] = $currentid; + } + } + $magvalues['type'] = $commentcable[$type]; + } + + $arr['body_general'] = getstr($_POST['general'], 150, 0, 0, 1); + $arr['body_general'] = censor($arr['body_general'], NULL, FALSE, FALSE); + if(censormod($arr['body_general']) || $_G['group']['allowsharemod']) { + $arr['status'] = 1; + } else { + $arr['status'] = 0; + } + + $arr['type'] = $type; + $arr['uid'] = $_G['uid']; + $arr['username'] = $_G['username']; + $arr['dateline'] = $_G['timestamp']; + + + if($arr['status'] == 0 && ckprivacy('share', 'feed')) { + require_once libfile('function/feed'); + feed_add('share', + '{actor} '.$arr['title_template'], + array('hash_data' => $feed_hash_data), + $arr['body_template'], + $arr['body_data'], + $arr['body_general'], + array($arr['image']), + array($arr['image_link']) + ); + } + + $arr['body_data'] = serialize($arr['body_data']); + + $sid = C::t('home_share')->insert($arr, true); + + switch($type) { + case 'space': + C::t('common_member_status')->increase($id, array('sharetimes' => 1)); + break; + case 'blog': + C::t('home_blog')->increase($id, null, array('sharetimes' => 1)); + break; + case 'album': + C::t('home_album')->update_num_by_albumid($id, 1, 'sharetimes'); + break; + case 'pic': + C::t('home_pic')->update_sharetimes($id); + break; + case 'thread': + C::t('forum_thread')->increase($id, array('sharetimes' => 1)); + require_once libfile('function/forum'); + update_threadpartake($id); + break; + case 'article': + C::t('portal_article_count')->increase($id, array('sharetimes' => 1)); + break; + } + + if($arr['status'] == 1) { + updatemoderate('sid', $sid); + manage_addnotify('verifyshare'); + } + + if($type == 'link' || !(C::t('home_share')->count_by_uid_itemid_type($_G['uid'], $id ? $id : '', $type ? $type : ''))) { + include_once libfile('function/stat'); + updatestat('share'); + } + + if($note_uid && $note_uid != $_G['uid']) { + notification_add($note_uid, 'sharenotice', $note_message, $note_values); + } + + $needle = $id ? $type.$id : ''; + updatecreditbyaction('createshare', $_G['uid'], array('sharings' => 1), $needle); + + $referer = "home.php?mod=space&uid={$_G['uid']}&do=share&view={$_GET['view']}&from={$_GET['from']}"; + $magvalues['sid'] = $sid; + + if(!$redirecturl) { + $redirecturl = dreferer(); + } + if(!$showmessagecontent) { + $showmessagecontent = 'do_success'; + } + showmessage($showmessagecontent, $redirecturl, $magvalues, ($_G['inajax'] && $_GET['view'] != 'me' ? array('showdialog'=>1, 'showmsg' => true, 'closetime' => true) : array())); + } + + $arr['body_data'] = serialize($arr['body_data']); + + require_once libfile('function/share'); + $arr = mkshare($arr); + $arr['dateline'] = $_G['timestamp']; +} + +if($type != 'link') { + if((C::t('home_share')->count_by_uid_itemid_type($_G['uid'], $id ? $id : '', $type ? $type : ''))) { + showmessage('spacecp_share_repeat'); + } +} + +$share_count = C::t('home_share')->count_by_uid_itemid_type(0, $id ? $id : '', $type ? $type : ''); +include template('home/spacecp_share'); +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_top.php b/source/include/spacecp/spacecp_top.php new file mode 100644 index 0000000..93b7bf5 --- /dev/null +++ b/source/include/spacecp/spacecp_top.php @@ -0,0 +1,97 @@ + 1)); +} +space_merge($space, 'count'); + +if(submitcheck('friendsubmit')) { + + $showcredit = intval($_POST['stakecredit']); + if($showcredit > $space[$key]) $showcredit = $space[$key]; + if($showcredit < 1) { + showmessage('showcredit_error'); + } + + $_POST['fusername'] = trim($_POST['fusername']); + $friend = C::t('home_friend')->fetch_all_by_uid_username($space['uid'], $_POST['fusername'], 0, 1); + $friend = $friend[0]; + $fuid = $friend['fuid']; + if(empty($_POST['fusername']) || empty($fuid) || $fuid == $space['uid']) { + showmessage('showcredit_fuid_error', '', array(), array('return' => 1)); + } + + $count = getcount('home_show', array('uid'=>$fuid)); + if($count) { + C::t('home_show')->update_credit_by_uid($fuid, $showcredit, false); + } else { + C::t('home_show')->insert(array('uid'=>$fuid, 'username'=>$_POST['fusername'], 'credit'=>$showcredit), false, true); + } + + updatemembercount($space['uid'], array($_G['setting']['creditstransextra'][6] => (0-$showcredit)), true, 'RKC', $space['uid']); + + notification_add($fuid, 'credit', 'showcredit', array('credit'=>$showcredit)); + + + if(ckprivacy('show', 'feed')) { + require_once libfile('function/feed'); + feed_add('show', 'feed_showcredit', array( + 'fusername' => "{$friend['fusername']}", + 'credit' => $showcredit)); + } + + showmessage('showcredit_friend_do_success', "misc.php?mod=ranklist&type=member"); + +} elseif(submitcheck('showsubmit')) { + + $showcredit = intval($_POST['showcredit']); + $unitprice = intval($_POST['unitprice']); + if($showcredit > $space[$key]) $showcredit = $space[$key]; + if($showcredit < 1 || $unitprice < 1) { + showmessage('showcredit_error', '', array(), array('return' => 1)); + } + $_POST['note'] = getstr($_POST['note'], 100); + $_POST['note'] = censor($_POST['note']); + $showarr = C::t('home_show')->fetch($_G['uid']); + if($showarr) { + $notesql = $_POST['note'] ? $_POST['note'] : false; + $unitprice = $unitprice > $showarr['credit']+$showcredit ? $showarr['credit']+$showcredit : $unitprice; + C::t('home_show')->update_credit_by_uid($_G['uid'], $showcredit, false, $unitprice, $notesql); + } else { + $unitprice = $unitprice > $showcredit ? $showcredit : $unitprice; + C::t('home_show')->insert(array('uid'=>$_G['uid'], 'username'=>$_G['username'], 'unitprice' => $unitprice, 'credit'=>$showcredit, 'note'=>$_POST['note']), false, true); + } + + updatemembercount($space['uid'], array($_G['setting']['creditstransextra'][6] => (0-$showcredit)), true, 'RKC', $space['uid']); + + if(ckprivacy('show', 'feed')) { + require_once libfile('function/feed'); + feed_add('show', 'feed_showcredit_self', array('credit'=>$showcredit), '', array(), $_POST['note']); + } + + showmessage('showcredit_do_success', dreferer()); +} +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_upload.php b/source/include/spacecp/spacecp_upload.php new file mode 100644 index 0000000..903c922 --- /dev/null +++ b/source/include/spacecp/spacecp_upload.php @@ -0,0 +1,164 @@ +count_size_by_uid($_G['uid']); + C::t('common_member_count')->update($_G['uid'], array('attachsize'=>$newsize)); + showmessage('do_success', 'home.php?mod=spacecp&ac=upload'); +} + +if(submitcheck('albumsubmit') && helper_access::check_module('album')) { + + if(!isset($_POST['title']) || !is_array($_POST['title']) || !count($_POST['title'])) { + showmessage('upload_select_image'); + } + if($_POST['albumop'] == 'creatalbum') { + $catid = intval($catid); + $_POST['albumname'] = empty($_POST['albumname'])?'':getstr($_POST['albumname'], 50); + $_POST['albumname'] = censor($_POST['albumname'], NULL, TRUE); + + if(is_array($_POST['albumname']) && $_POST['albumname']['message']) { + showmessage($_POST['albumname']['message']); + } + + if(empty($_POST['albumname'])) $_POST['albumname'] = gmdate('Ymd'); + + $_POST['friend'] = intval($_POST['friend']); + + $_POST['target_ids'] = ''; + if($_POST['friend'] == 2) { + $uids = array(); + $names = empty($_POST['target_names']) ? array() : explode(' ', str_replace(array(lang('spacecp', 'tab_space'), "\r\n", "\n", "\r"), ' ', $_POST['target_names'])); + if($names) { + $uids = C::t('common_member')->fetch_all_uid_by_username($names); + } + if(empty($uids)) { + $_POST['friend'] = 3; + } else { + $_POST['target_ids'] = implode(',', $uids); + } + } elseif($_POST['friend'] == 4) { + $_POST['password'] = trim($_POST['password']); + if($_POST['password'] == '') $_POST['friend'] = 0; + } + if($_POST['friend'] !== 2) { + $_POST['target_ids'] = ''; + } + if($_POST['friend'] !== 4) { + $_POST['password'] = ''; + } + + $setarr = array(); + $setarr['albumname'] = $_POST['albumname']; + $setarr['catid'] = intval($_POST['catid']); + $setarr['uid'] = $_G['uid']; + $setarr['username'] = $_G['username']; + $setarr['dateline'] = $setarr['updatetime'] = $_G['timestamp']; + $setarr['friend'] = $_POST['friend']; + $setarr['password'] = $_POST['password']; + $setarr['target_ids'] = $_POST['target_ids']; + $setarr['depict'] = dhtmlspecialchars($_POST['depict']); + + $albumid = C::t('home_album')->insert($setarr ,true); + + if($setarr['catid']) { + C::t('home_album_category')->update_num_by_catid('1', $setarr['catid']); + } + + if(empty($space['albumnum'])) { + $space['albums'] = C::t('home_album')->count_by_uid($space['uid']); + C::t('common_member_count')->update($_G['uid'], array('albums' => $space['albums'])); + } else { + C::t('common_member_count')->increase($_G['uid'], array('albums' => 1)); + } + + } else { + $albumid = intval($_POST['albumid']); + $albuminfo = C::t('home_album')->fetch_album($albumid, $_G['uid']); + if(empty($albuminfo)) { + $albumid = 0; + } + } + $havetitle = trim(implode('', $_POST['title'])); + if(!empty($havetitle)) { + foreach($_POST['title'] as $picid => $title) { + $title = dhtmlspecialchars($title); + C::t('home_pic')->update_for_uid($_G['uid'], $picid, array('title'=>$title, 'albumid' => $albumid)); + } + } else { + $picids = array_keys($_POST['title']); + C::t('home_pic')->update_for_uid($_G['uid'], $picids, array('albumid' => $albumid)); + } + if($albumid) { + album_update_pic($albumid); + } + + if(ckprivacy('upload', 'feed')) { + require_once libfile('function/feed'); + feed_publish($albumid, 'albumid'); + } + + showmessage('upload_images_completed', "home.php?mod=space&uid={$_G['uid']}&do=album&quickforward=1&id=".(empty($albumid)?-1:$albumid)); + +} else { + + if(!checkperm('allowupload') || !helper_access::check_module('album')) { + showmessage('no_privilege_upload', '', array(), array('return' => true)); + } + + cknewuser(); + + $config = urlencode($_G['siteroot'].'home.php?mod=misc&ac=swfupload&op=config'.($_GET['op'] == 'cam'? '&cam=1' : '')); + + $albums = getalbums($_G['uid']); + + $actives = ($_GET['op'] == 'flash' || $_GET['op'] == 'cam')?array($_GET['op']=>' class="a"'):array('js'=>' class="a"'); + + $maxspacesize = checkperm('maxspacesize'); + if(!empty($maxspacesize)) { + + space_merge($space, 'count'); + space_merge($space, 'field_home'); + $maxspacesize = $maxspacesize + $space['addsize'] * 1024 * 1024; + $haveattachsize = ($maxspacesize < $space['attachsize'] ? '-':'').formatsize($maxspacesize - $space['attachsize']); + } else { + $haveattachsize = 0; + } + + require_once libfile('function/friend'); + $groups = friend_group_list(); + + loadcache('albumcategory'); + $category = $_G['cache']['albumcategory']; + + $categoryselect = ''; + if($category) { + include_once libfile('function/portalcp'); + $categoryselect = category_showselect('album', 'catid', !$_G['setting']['albumcategoryrequired'] ? true : false, $_GET['catid']); + } +} + +$navtitle = lang('core', 'title_'.(!empty($_GET['op']) ? $_GET['op'] : 'normal').'_upload'); +require_once libfile('function/upload'); +$swfconfig = getuploadconfig($_G['uid'], 0, false); + +include_once template("home/spacecp_upload"); + +?> \ No newline at end of file diff --git a/source/include/spacecp/spacecp_usergroup.php b/source/include/spacecp/spacecp_usergroup.php new file mode 100644 index 0000000..4cbf017 --- /dev/null +++ b/source/include/spacecp/spacecp_usergroup.php @@ -0,0 +1,381 @@ + 0 && $_G['member']['groupexpiry'] > TIMESTAMP) { + showmessage('usergroup_switch_not_allow'); + } + + $groupid = intval($_GET['groupid']); + + $group = C::t('common_usergroup')->fetch($groupid); + if($group['type'] != 'special' || $group['system'] == 'private' || $group['radminid'] != 0) { + $group = null; + } + if(empty($group)) { + showmessage('usergroup_not_found'); + } + $join = $do == 'buy' ? 1 : 0; + $group['dailyprice'] = $group['minspan'] = 0; + + if($group['system'] != 'private') { + list($group['dailyprice'], $group['minspan']) = explode("\t", $group['system']); + if($group['dailyprice'] > -1 && $group['minspan'] == 0) { + $group['minspan'] = 1; + } + } + $creditstrans = $_G['setting']['creditstrans']; + if(!isset($_G['setting']['creditstrans'])) { + showmessage('credits_transaction_disabled'); + } + + if(!submitcheck('buysubmit')) { + $usermoney = $space['extcredits'.$creditstrans]; + $usermaxdays = $group['dailyprice'] > 0 ? intval($usermoney / $group['dailyprice']) : 0; + $group['minamount'] = $group['dailyprice'] * $group['minspan']; + } else { + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $groupterms = dunserialize($memberfieldforum['groupterms']); + unset($memberfieldforum); + require_once libfile('function/forum'); + if($join) { + $extgroupidsarray = array(); + foreach(array_unique(array_merge($extgroupids, array($groupid))) as $extgroupid) { + if($extgroupid) { + $extgroupidsarray[] = $extgroupid; + } + } + $extgroupidsnew = implode("\t", $extgroupidsarray); + if($group['dailyprice']) { + if(($days = intval($_GET['days'])) < $group['minspan']) { + showmessage('usergroups_span_invalid', '', array('minspan' => $group['minspan'])); + } + + if($space['extcredits'.$creditstrans] - ($amount = $days * $group['dailyprice']) < ($minbalance = 0)) { + showmessage('credits_balance_insufficient', '', array('title'=> $_G['setting']['extcredits'][$creditstrans]['title'],'minbalance' => ($minbalance + $amount))); + } + + $groupterms['ext'][$groupid] = ($groupterms['ext'][$groupid] > TIMESTAMP ? $groupterms['ext'][$groupid] : TIMESTAMP) + $days * 86400; + + $groupexpirynew = groupexpiry($groupterms); + + C::t('common_member')->update($_G['uid'], array('groupexpiry' => $groupexpirynew, 'extgroupids' => $extgroupidsnew)); + updatemembercount($_G['uid'], array($creditstrans => "-$amount"), true, 'UGP', $extgroupidsnew); + + C::t('common_member_field_forum')->update($_G['uid'], array('groupterms' => serialize($groupterms))); + + } else { + C::t('common_member')->update($_G['uid'], array('extgroupids' => $extgroupidsnew)); + } + + showmessage('usergroups_join_succeed', "home.php?mod=spacecp&ac=usergroup".($_GET['gid'] ? "&gid={$_GET['gid']}" : '&do=list'), array('group' => $group['grouptitle']), array('showdialog' => 3, 'showmsg' => true, 'locationtime' => true)); + + } else { + + if($groupid != $_G['groupid']) { + if(isset($groupterms['ext'][$groupid])) { + unset($groupterms['ext'][$groupid]); + } + $groupexpirynew = groupexpiry($groupterms); + C::t('common_member_field_forum')->update($_G['uid'], array('groupterms' => serialize($groupterms))); + + } else { + $groupexpirynew = 'groupexpiry'; + } + + $extgroupidsarray = array(); + foreach($extgroupids as $extgroupid) { + if($extgroupid && $extgroupid != $groupid) { + $extgroupidsarray[] = $extgroupid; + } + } + $extgroupidsnew = implode("\t", array_unique($extgroupidsarray)); + C::t('common_member')->update($_G['uid'], array('groupexpiry' => $groupexpirynew, 'extgroupids' => $extgroupidsnew)); + + showmessage('usergroups_exit_succeed', "home.php?mod=spacecp&ac=usergroup".($_GET['gid'] ? "&gid={$_GET['gid']}" : '&do=list'), array('group' => $group['grouptitle']), array('showdialog' => 3, 'showmsg' => true, 'locationtime' => true)); + + } + + } + +} elseif($do == 'switch') { + + $groupid = intval($_GET['groupid']); + if(!in_array($groupid, $extgroupids)) { + showmessage('usergroup_not_found'); + } + if($_G['groupid'] == 4 && $_G['member']['groupexpiry'] > 0 && $_G['member']['groupexpiry'] > TIMESTAMP) { + showmessage('usergroup_switch_not_allow'); + } + $group = C::t('common_usergroup')->fetch($groupid); + if(!$group['allowvisit']) { + showmessage("usergroup_switch_not_allowvisit"); + } + if(submitcheck('groupsubmit')) { + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $groupterms = dunserialize($memberfieldforum['groupterms']); + unset($memberfieldforum); + $extgroupidsnew = $_G['groupid']; + $groupexpirynew = $groupterms['ext'][$groupid]; + foreach($extgroupids as $extgroupid) { + if($extgroupid && $extgroupid != $groupid) { + $extgroupidsnew .= "\t".$extgroupid; + } + } + if($_G['adminid'] > 0 && $group['radminid'] > 0) { + $newadminid = $_G['adminid'] < $group['radminid'] ? $_G['adminid'] : $group['radminid']; + } elseif($_G['adminid'] > 0) { + $newadminid = $_G['adminid']; + } else { + $newadminid = $group['radminid']; + } + + C::t('common_member')->update($_G['uid'], array('groupid' => $groupid, 'adminid' => $newadminid, 'groupexpiry' => $groupexpirynew, 'extgroupids' => $extgroupidsnew)); + showmessage('usergroups_switch_succeed', "home.php?mod=spacecp&ac=usergroup".($_GET['gid'] ? "&gid={$_GET['gid']}" : '&do=list'), array('group' => $group['grouptitle']), array('showdialog' => 3, 'showmsg' => true, 'locationtime' => true)); + } + +} elseif($do == 'forum') { + + if($_G['setting']['verify']['enabled']) { + $myverify= array(); + getuserprofile('verify1'); + for($i = 1; $i <= 6; $i++) { + if($_G['member']['verify'.$i] == 1) { + $myverify[] = $i; + } + } + $ar = array(1, 2, 3, 4, 5); + } + $language = lang('forum/misc'); + $permlang = $language; + loadcache('forums'); + $fids = array_keys($_G['cache']['forums']); + $perms = array('viewperm', 'postperm', 'replyperm', 'getattachperm', 'postattachperm', 'postimageperm'); + $defaultperm = array( + array('viewperm' => 1, 'postperm' => 0, 'replyperm' => 0, 'getattachperm' => 1, 'postattachperm' => 0, 'postimageperm' => 0), + array('viewperm' => 1, 'postperm' => 1, 'replyperm' => 1, 'getattachperm' => 1, 'postattachperm' => 1, 'postimageperm' => 1), + ); + if($_G['setting']['verify']['enabled']) { + for($i = 1; $i <= 6; $i++) { + if($_G['setting']['verify'][$i]['available']) { + $verifyicon[$i] = !empty($_G['setting']['verify'][$i]['icon']) ? ''.$_G['setting']['verify'][$i]['title'].'' : $_G['setting']['verify'][$i]['title']; + } + } + } + $forumperm = $verifyperm = $myverifyperm = array(); + $query = C::t('forum_forum')->fetch_all_info_by_fids($fids); + foreach($query as $forum) { + foreach($perms as $perm) { + if($forum[$perm]) { + if($_G['setting']['verify']['enabled']) { + for($i = 1; $i <= 6; $i++) { + $verifyperm[$forum['fid']][$perm] .= preg_match("/(^|\t)(v".$i.")(\t|$)/", $forum[$perm]) ? $verifyicon[$i] : ''; + $includePerm = preg_match("/(^|\t)(v".$i.")(\t|$)/", $forum[$perm]) ? $verifyicon[$i] : ''; + if(in_array($i, $myverify) && $includePerm) { + $myverifyperm[$forum['fid']][$perm] = 1; + } + } + } + $groupids = array($_G['groupid']); + if(!empty($_G['member']['extgroupids'])) { + $groupids = array_merge($groupids, explode("\t", $_G['member']['extgroupids'])); + } + $forumperm[$forum['fid']][$perm] = preg_match("/(^|\t)(".implode('|', $groupids).")(\t|$)/", $forum[$perm]) ? 1 : 0; + } else { + $forumperm[$forum['fid']][$perm] = $defaultperm[$_G['groupid'] != 7 ? 1 : 0][$perm]; + } + } + } + +} elseif($do == 'list' || $do == 'expiry') { + + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $groupterms = dunserialize($memberfieldforum['groupterms']); + unset($memberfieldforum); + $expgrouparray = $expirylist = $termsarray = array(); + + if(!empty($groupterms['ext']) && is_array($groupterms['ext'])) { + $termsarray = $groupterms['ext']; + } + if(!empty($groupterms['main']['time']) && (empty($termsarray[$_G['groupid']]) || $termsarray[$_G['groupid']] > $groupterm['main']['time'])) { + $termsarray[$_G['groupid']] = $groupterms['main']['time']; + } + + foreach($termsarray as $expgroupid => $expiry) { + if($expiry <= TIMESTAMP) { + $expgrouparray[] = $expgroupid; + } + } + + if(!empty($groupterms['ext'])) { + foreach($groupterms['ext'] as $extgroupid => $time) { + $expirylist[$extgroupid] = array('time' => dgmdate($time, 'd'), 'type' => 'ext', 'noswitch' => $time < TIMESTAMP); + } + } + + if(!empty($groupterms['main'])) { + $expirylist[$_G['groupid']] = array('time' => dgmdate($groupterms['main']['time'], 'd'), 'type' => 'main'); + } + + $groupids = array(); + foreach($_G['cache']['usergroups'] as $groupid => $usergroup) { + if(!empty($usergroup['pubtype'])) { + $groupids[] = $groupid; + } + } + $expiryids = array_keys($expirylist); + if(!$expiryids && $_G['member']['groupexpiry']) { + C::t('common_member')->update($_G['uid'], array('groupexpiry' => 0)); + } + $groupids = array_merge($extgroupids, $expiryids, $groupids); + $usermoney = $space['extcredits'.$_G['setting']['creditstrans']]; + if($groupids) { + foreach(C::t('common_usergroup')->fetch_all_usergroup($groupids) as $group) { + $isexp = in_array($group['groupid'], $expgrouparray); + if($_G['cache']['usergroups'][$group['groupid']]['pubtype'] == 'buy') { + list($dailyprice) = explode("\t", $group['system']); + $expirylist[$group['groupid']]['dailyprice'] = $dailyprice; + $expirylist[$group['groupid']]['usermaxdays'] = $dailyprice > 0 ? round($usermoney / $dailyprice) : 0; + } else { + $expirylist[$group['groupid']]['usermaxdays'] = 0; + } + $expirylist[$group['groupid']]['maingroup'] = $group['type'] != 'special' || $group['system'] == 'private' || $group['radminid'] > 0; + $expirylist[$group['groupid']]['grouptitle'] = $isexp ? ''.$group['grouptitle'].'' : $group['grouptitle']; + } + } + +} else { + + $language = lang('forum/misc'); + require_once libfile('function/forumlist'); + $permlang = $language; + unset($language); + $maingroup = $_G['group']; + $ptype = in_array(getgpc('ptype'), array(0, 1, 2)) ? intval(getgpc('ptype')) : 0; + foreach($_G['cache']['usergroups'] as $gid => $value) { + $cachekey[] = 'usergroup_'.$gid; + } + loadcache($cachekey); + $_G['group'] = $maingroup; + $sidegroup = $usergroups = $activegs = array(); + $nextupgradeid = $nextexist = 0; + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $groupterms = dunserialize($memberfieldforum['groupterms']); + unset($memberfieldforum); + $switchmaingroup = $_G['group']['grouppublic'] || isset($groupterms['ext']) ? 1 : 0; + foreach($_G['cache']['usergroups'] as $gid => $group) { + $group['grouptitle'] = strip_tags($group['grouptitle']); + if($group['type'] == 'special') { + $type = $_G['cache']['usergroup_'.$gid]['radminid'] ? 'admin' : 'user'; + } elseif($group['type'] == 'system') { + $type = $_G['cache']['usergroup_'.$gid]['radminid'] ? 'admin' : 'user'; + } elseif($group['type'] == 'member') { + $type = 'upgrade'; + } + if($nextupgradeid && $group['type'] == 'member') { + $_GET['gid'] = $gid; + $nextupgradeid = 0; + } + $g = ''.$group['grouptitle'].''; + if(in_array($gid, $extgroupids)) { + $usergroups['my'] .= $g; + } + $usergroups[$type] = (isset($usergroups[$type]) ? $usergroups[$type] : '').$g; + if(!empty($_GET['gid']) && $_GET['gid'] == $gid) { + $switchtype = $type; + if(!empty($_GET['gid'])) { + $activegs[$switchtype] = ' a'; + } + $currentgrouptitle = $group['grouptitle']; + $sidegroup = $_G['cache']['usergroup_'.$gid]; + if($_G['cache']['usergroup_'.$gid]['radminid']) { + $admingids[] = $gid; + } + } elseif(empty($_GET['gid']) && $_G['groupid'] == $gid && $group['type'] == 'member') { + $nextupgradeid = 1; + } + } + $usergroups['my'] = ''.$maingroup['grouptitle'].''.(isset($usergroups['my']) ? $usergroups['my'] : ''); + if($activegs == array()) { + $activegs['my'] = ' a'; + } + + $bperms = array('allowvisit','readaccess','allowinvisible','allowsearch','allowcstatus','disablepostctrl', 'allowsendpm', 'allowfriend', 'allowstatdata'); + if($_G['setting']['portalstatus']) { + $bperms[] = 'allowpostarticle'; + } + $pperms = array('allowpost','allowreply','allowpostpoll','allowvote','allowpostreward','allowpostactivity','allowpostdebate','allowposttrade','allowat', 'allowreplycredit', 'allowposttag', 'allowcreatecollection','maxsigsize','allowsigbbcode','allowsigimgcode','allowrecommend','raterange','allowcommentpost','allowmediacode'); + $aperms = array('allowgetattach', 'allowgetimage', 'allowpostattach', 'allowpostimage', 'allowsetattachperm', 'maxattachsize', 'maxsizeperday', 'maxattachnum', 'attachextensions'); + $sperms = array('allowpoke', 'allowclick', 'allowcomment', 'maxspacesize', 'maximagesize'); + if(helper_access::check_module('blog')) {$sperms[] = 'allowblog';} + if(helper_access::check_module('album')) {$sperms[] = 'allowupload';} + if(helper_access::check_module('share')) {$sperms[] = 'allowshare';} + if(helper_access::check_module('doing')) {$sperms[] = 'allowdoing';} + $allperms = array(); + $allkey = array_merge($bperms, $pperms, $aperms, $sperms); + if($sidegroup) { + foreach($allkey as $pkey) { + if(in_array($pkey, array('maxattachsize', 'maxsizeperday', 'maxspacesize', 'maximagesize'))) { + $sidegroup[$pkey] = $sidegroup[$pkey] ? sizecount($sidegroup[$pkey]) : 0; + } + $allperms[$pkey][$sidegroup['groupid']] = $sidegroup[$pkey]; + } + } + + foreach($maingroup as $pkey => $v) { + if(in_array($pkey, array('maxattachsize', 'maxsizeperday', 'maxspacesize', 'maximagesize'))) { + $maingroup[$pkey] = $maingroup[$pkey] ? sizecount($maingroup[$pkey]) : 0; + } + } + + $publicgroup = array(); + $extgroupids[] = $_G['groupid']; + foreach(C::t('common_usergroup')->fetch_all_switchable(array_unique($extgroupids)) as $group) { + $group['allowsetmain'] = in_array($group['groupid'], $extgroupids); + $publicgroup[$group['groupid']] = $group; + } + $group = isset($group[count($group)]) ? $group[count($group)] : NULL; + $_GET['perms'] = 'member'; + if($sidegroup) { + $group = $sidegroup; + } +} + +include_once template("home/spacecp_usergroup"); + +?> \ No newline at end of file diff --git a/source/include/table/big5-unicode.table b/source/include/table/big5-unicode.table new file mode 100644 index 0000000..fcece8e Binary files /dev/null and b/source/include/table/big5-unicode.table differ diff --git a/source/include/table/gb-big5.table b/source/include/table/gb-big5.table new file mode 100644 index 0000000..abbaf80 Binary files /dev/null and b/source/include/table/gb-big5.table differ diff --git a/source/include/table/gb-unicode.table b/source/include/table/gb-unicode.table new file mode 100644 index 0000000..b02046f Binary files /dev/null and b/source/include/table/gb-unicode.table differ diff --git a/source/include/table/index.htm b/source/include/table/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/include/table/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/include/thread/index.htm b/source/include/thread/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/thread/thread_activity.php b/source/include/thread/thread_activity.php new file mode 100644 index 0000000..86ff198 --- /dev/null +++ b/source/include/thread/thread_activity.php @@ -0,0 +1,94 @@ +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_attachment('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']); +} +?> \ No newline at end of file diff --git a/source/include/thread/thread_album.php b/source/include/thread/thread_album.php new file mode 100644 index 0000000..2f8f615 --- /dev/null +++ b/source/include/thread/thread_album.php @@ -0,0 +1,75 @@ +fetch_all_pid_by_tid($_G['tid'], 0); +foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$_G['tid'], 'tid', $_G['tid'], 'aid') as $attach) { + if(!isset($validpids[$attach['pid']])) { + continue; + } + if($_G['forum_threadpay'] && !in_array($attach['aid'], $freeattachids)) { + continue; + } + if($attach['uid'] != $_G['forum_thread']['authorid'] && (!defined('IN_MOBILE') || IN_MOBILE != 2)) { + continue; + } + if($attach['isimage'] && !$_G['setting']['attachimgpost']) { + $attach['isimage'] = 0; + } + $attach['attachimg'] = $attach['isimage'] && (!$attach['readperm'] || $_G['group']['readaccess'] >= $attach['readperm']) ? 1 : 0; + if(!$attach['attachimg']) { + continue; + } + if($attach['price'] && $_G['uid'] != $attach['uid']) { + $albumpayaids[$attach['aid']] = $attach['aid']; + $attach['payed'] = 0; + } else { + $attach['payed'] = 1; + } + $attachmentlist[$attach['aid']] = $attach; +} + +if($albumpayaids) { + foreach(C::t('common_credit_log')->fetch_all_by_uid_operation_relatedid($_G['uid'], 'BAC', array_keys($albumpayaids)) as $creditlog) { + $attachmentlist[$creditlog['relatedid']]['payed'] = 1; + } +} + +foreach($attachmentlist as $attach) { + if($attach['payed'] == 0) { + continue; + } + $attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'; + $attach['dbdateline'] = $attach['dateline']; + $attach['dateline'] = dgmdate($attach['dateline'], 'u'); + $imglist['aid'][] = $attach['aid']; + $imglist['url'][] = $attach['url'].$attach['attachment']; + $apids[] = $attach['pid']; +} + +if(empty($imglist)) { + showmessage('author_not_uploadpic'); +} + +foreach($postlist as $key=>$subpost) { + if($subpost['first'] == 1 || in_array($subpost['pid'], $apids)) { + unset($postlist[$key]); + } +} +?> \ No newline at end of file diff --git a/source/include/thread/thread_debate.php b/source/include/thread/thread_debate.php new file mode 100644 index 0000000..877a5e4 --- /dev/null +++ b/source/include/thread/thread_debate.php @@ -0,0 +1,65 @@ +fetch($_G['tid']); +$debate['dbendtime'] = $debate['endtime']; +if($debate['dbendtime']) { + $debate['endtime'] = dgmdate($debate['dbendtime']); +} +if($debate['dbendtime'] > TIMESTAMP) { + $debate['remaintime'] = remaintime($debate['dbendtime'] - TIMESTAMP); +} +$debate['starttime'] = dgmdate($debate['starttime'], 'u'); +$debate['affirmpoint'] = discuzcode($debate['affirmpoint'], 0, 0, 0, 1, 1, 0, 0, 0, 0, 0); +$debate['negapoint'] = discuzcode($debate['negapoint'], 0, 0, 0, 1, 1, 0, 0, 0, 0, 0); +if($debate['affirmvotes'] || $debate['negavotes']) { + if($debate['affirmvotes'] && $debate['affirmvotes'] > $debate['negavotes']) { + $debate['affirmvoteswidth'] = 100; + $debate['negavoteswidth'] = intval($debate['negavotes'] / $debate['affirmvotes'] * 100); + $debate['negavoteswidth'] = $debate['negavoteswidth'] > 0 ? $debate['negavoteswidth'] : 5; + } elseif($debate['negavotes'] && $debate['negavotes'] > $debate['affirmvotes']) { + $debate['negavoteswidth'] = 100; + $debate['affirmvoteswidth'] = intval($debate['affirmvotes'] / $debate['negavotes'] * 100); + $debate['affirmvoteswidth'] = $debate['affirmvoteswidth'] > 0 ? $debate['affirmvoteswidth'] : 5; + } else { + $debate['affirmvoteswidth'] = $debate['negavoteswidth'] = 100; + } +} else { + $debate['negavoteswidth'] = $debate['affirmvoteswidth'] = 5; +} +if($debate['umpirepoint']) { + $debate['umpirepoint'] = discuzcode($debate['umpirepoint'], 0, 0, 0, 1, 1, 1, 0, 0, 0, 0); +} +$debate['umpireurl'] = rawurlencode($debate['umpire']); +list($debate['bestdebater'], $debate['bestdebateruid'], $debate['bestdebaterstand'], $debate['bestdebatervoters'], $debate['bestdebaterreplies']) = explode("\t", $debate['bestdebater']); +$debate['bestdebaterurl'] = rawurlencode($debate['bestdebater']); +foreach(C::t('forum_post')->fetch_all_debatepost_by_tid_stand($_G['tid'], 1, 0, 16) as $affirmavatar) { + if(!isset($debate['affirmavatars'][$affirmavatar['authorid']])) { + $affirmavatar['avatar'] = avatar($affirmavatar['authorid'], 'small'); + $debate['affirmavatars'][$affirmavatar['authorid']] = $affirmavatar; + } +} + +foreach(C::t('forum_post')->fetch_all_debatepost_by_tid_stand($_G['tid'], 2, 0, 16) as $negaavatar) { + if(!isset($debate['negaavatars'][$negaavatar['authorid']])) { + $negaavatar['avatar'] = avatar($negaavatar['authorid'], 'small'); + $debate['negaavatars'][$negaavatar['authorid']] = $negaavatar; + } +} + +if($_G['setting']['fastpost'] && $allowpostreply && $_G['forum_thread']['closed'] == 0) { + $firststand = C::t('forum_debatepost')->get_firststand($_G['tid'], $_G['uid']); +} + +?> \ No newline at end of file diff --git a/source/include/thread/thread_pay.php b/source/include/thread/thread_pay.php new file mode 100644 index 0000000..142955b --- /dev/null +++ b/source/include/thread/thread_pay.php @@ -0,0 +1,53 @@ +count_stc_by_relatedid($_G['tid'], $_G['setting']['creditstransextra'][1]); +$thread['payers'] = $payment['payers']; +$thread['netprice'] = !$_G['setting']['maxincperthread'] || ($_G['setting']['maxincperthread'] && $payment['income'] < $_G['setting']['maxincperthread']) ? floor($thread['price'] * (1 - $_G['setting']['creditstax'])) : 0; +$thread['creditstax'] = sprintf('%1.2f', $_G['setting']['creditstax'] * 100).'%'; +$thread['endtime'] = $_G['setting']['maxchargespan'] ? dgmdate($_G['forum_thread']['dateline'] + $_G['setting']['maxchargespan'] * 3600, 'u') : 0; +$thread['price'] = $_G['forum_thread']['price']; +$firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid']); +if($firstpost) { + $member = getuserbyuid($firstpost['authorid']); + $firstpost['groupid'] = $member['groupid']; +} +$pid = $firstpost['pid']; +$freemessage = array(); +$freemessage[$pid]['message'] = ''; +if(preg_match_all("/\[free\](.+?)\[\/free\]/is", $firstpost['message'], $matches)) { + foreach($matches[1] AS $match) { + $freemessage[$pid]['message'] .= discuzcode($match, $firstpost['smileyoff'], $firstpost['bbcodeoff'], sprintf('%00b', $firstpost['htmlon']), $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'] ? -$firstpost['groupid'] : 0, $_G['forum']['allowimgcode'], $_G['forum']['allowhtml'], ($_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0), 0, $post['authorid'], $_G['forum']['allowmediacode'], $pid).'
          '; + } +} + +$attachtags = array(); +if($_G['group']['allowgetattach'] || $_G['group']['allowgetimage']) { + if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $freemessage[$pid]['message'], $matchaids)) { + $attachtags[$pid] = $matchaids[1]; + } +} + +if($attachtags) { + require_once libfile('function/attachment'); + parseattach($pid, $attachtags, $freemessage); +} + +$thread['freemessage'] = $freemessage[$pid]['message']; +unset($freemessage); + +?> \ No newline at end of file diff --git a/source/include/thread/thread_poll.php b/source/include/thread/thread_poll.php new file mode 100644 index 0000000..89c9169 --- /dev/null +++ b/source/include/thread/thread_poll.php @@ -0,0 +1,89 @@ +fetch_count_by_tid($_G['tid'])) { + + $options = C::t('forum_poll')->fetch($_G['tid']); + if($options['isimage']) { + $pollimages = C::t('forum_polloption_image')->fetch_all_by_tid($_G['tid']); + require_once libfile('function/home'); + } + $isimagepoll = $options['isimage'] ? true : false; + $multiple = $options['multiple']; + $visible = $options['visible']; + $maxchoices = $options['maxchoices']; + $expiration = $options['expiration']; + $overt = $options['overt']; + $voterscount = $options['voters']; + + $query = C::t('forum_polloption')->fetch_all_by_tid($_G['tid'], 1); + $colors = array('E92725', 'F27B21', 'F2A61F', '5AAF4A', '42C4F5', '0099CC', '3365AE', '2A3591', '592D8E', 'DB3191'); + $voterids = $polloptionpreview = ''; + $ci = 0; + $opts = 1; + foreach($query as $options) { + $viewvoteruid[] = $options['voterids']; + $voterids .= "\t".$options['voterids']; + $option = preg_replace("/\[url=(https?){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/i", "\\3", $options['polloption']); + $attach = array(); + if($isimagepoll && $pollimages[$options['polloptionid']]) { + $attach = $pollimages[$options['polloptionid']]; + $attach['small'] = pic_get($attach['attachment'], 'forum', $attach['thumb'], $attach['remote']); + $attach['big'] = pic_get($attach['attachment'], 'forum', 0, $attach['remote']); + } + $polloptions[$opts++] = array + ( + 'polloptionid' => $options['polloptionid'], + 'polloption' => $option, + 'votes' => $options['votes'], + 'width' => $options['votes'] > 0 ? (@round($options['votes'] * 100 / $count['total'])).'%' : '8px', + 'percent' => $count['total'] ? sprintf("%01.2f", $options['votes'] * 100 / $count['total']) : 0, + 'color' => $colors[$ci], + 'imginfo' => $attach + ); + if($ci < 2) { + $polloptionpreview .= $option."\t"; + } + $ci++; + if($ci == count($colors)) { + $ci = 0; + } + } + + $voterids = explode("\t", $voterids); + $voters = array_unique($voterids); + array_shift($voters); + + if(!$expiration) { + $expirations = TIMESTAMP + 86400; + } else { + $expirations = $expiration; + if($expirations > TIMESTAMP) { + $_G['forum_thread']['remaintime'] = remaintime($expirations - TIMESTAMP); + } + } + + $allwvoteusergroup = $_G['group']['allowvote']; + $allowvotepolled = !in_array(($_G['uid'] ? $_G['uid'] : $_G['clientip']), $voters); + $allowvotethread = ($_G['forum_thread']['isgroup'] || !$_G['forum_thread']['closed'] && !checkautoclose($_G['forum_thread']) || $_G['group']['alloweditpoll']) && TIMESTAMP < $expirations && $expirations > 0; + + $_G['group']['allowvote'] = $allwvoteusergroup && $allowvotepolled && $allowvotethread; + + $optiontype = $multiple ? 'checkbox' : 'radio'; + $visiblepoll = $visible || $_G['forum']['ismoderator'] || ($_G['uid'] && $_G['uid'] == $_G['forum_thread']['authorid']) || ($expirations >= TIMESTAMP && in_array(($_G['uid'] ? $_G['uid'] : $_G['clientip']), $voters)) || $expirations < TIMESTAMP ? 0 : 1; + +} + +?> \ No newline at end of file diff --git a/source/include/thread/thread_printable.php b/source/include/thread/thread_printable.php new file mode 100644 index 0000000..41365bb --- /dev/null +++ b/source/include/thread/thread_printable.php @@ -0,0 +1,77 @@ +fetch_all_by_tid('tid:'.$_G['tid'], $_G['tid'], true, 'ASC', 0, 100, null, 0); +} else { + $posts = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid'], 0); + $posts = array($posts); +} +$userinfo = $uids = $skipaids = array(); +foreach($posts as $post) { + + if(strpos($post['message'], '[/password]') !== FALSE) { + $post['message'] = ''; + } + + $post['dateline'] = dgmdate($post['dateline'], 'u'); + if(preg_match("/\[hide\]\s*(.+?)\s*\[\/hide\]/is", $post['message'], $hide)) { + if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $hide[1], $matchaids)) { + $skipaids = array_merge($skipaids, $matchaids[1]); + } + $post['message'] = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is", '', $post['message']); + } + if(strpos(strtolower($post['message']), '[hide=') !== FALSE) { + $post['message'] = preg_replace("/\[hide=(\d+)\]\s*(.*?)\s*\[\/hide\]/is", "", $post['message']); + } + $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], sprintf('%00b', $post['htmlon']), $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'], $_G['forum']['allowhtml'], ($_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0)); + + if(strpos($post['message'], '[page]') !== FALSE) { + $post['message'] = preg_replace("/\s?\[page\]\s?/is", '', $post['message']); + } + if(strpos($post['message'], '[/index]') !== FALSE) { + $post['message'] = preg_replace("/\s?\[index\](.+?)\[\/index\]\s?/is", '', $post['message']); + } + + if($post['attachment']) { + $attachment = 1; + } + $post['attachments'] = array(); + if($post['attachment'] && ($_G['group']['allowgetattach'] || $_G['group']['allowgetimage'])) { + $_G['forum_attachpids'][] = $post['pid']; + $post['attachment'] = 0; + if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $post['message'], $matchaids)) { + $_G['forum_attachtags'][$post['pid']] = $matchaids[1]; + } + } + $uids[] = $post['authorid']; + $postlist[$post['pid']] = $post; +} +unset($posts); +if($uids) { + $uids = array_unique($uids); + $userinfo = C::t('common_member')->fetch_all($uids); +} + +if($_G['forum_attachpids'] && !defined('IN_ARCHIVER')) { + require_once libfile('function/attachment'); + if(is_array($threadsortshow) && !empty($threadsortshow['sortaids'])) { + $skipaids = array_merge($skipaids, $threadsortshow['sortaids']); + } + parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist, $skipaids); +} + +include template('forum/viewthread_printable'); + +?> \ No newline at end of file diff --git a/source/include/thread/thread_reward.php b/source/include/thread/thread_reward.php new file mode 100644 index 0000000..f2b722b --- /dev/null +++ b/source/include/thread/thread_reward.php @@ -0,0 +1,33 @@ + $post) { + if($post['dbdateline'] == $dateline) { + $bapid = $key; + break; + } + } +} + +if($bapid) { + $bestpost = C::t('forum_post')->fetch_post($posttableid, $bapid); + $bestpost['message'] = messagecutstr($bestpost['message'], 400); + $bestpost['avatar'] = avatar($bestpost['authorid'], 'small'); +} + +?> \ No newline at end of file diff --git a/source/include/thread/thread_trade.php b/source/include/thread/thread_trade.php new file mode 100644 index 0000000..d0707e4 --- /dev/null +++ b/source/include/thread/thread_trade.php @@ -0,0 +1,136 @@ +fetch_all_thread_goods($_G['tid'], $_GET['pid']); + $trades = $tradesstick = array();$tradelist = 0; + if(empty($_GET['do'])) { + $sellerid = 0; + $listcount = count($query); + $tradelist = $tradenum - $listcount; + } + + $tradesaids = $tradespids = array(); + foreach($query as $trade) { + if($trade['expiration']) { + $trade['expiration'] = ($trade['expiration'] - TIMESTAMP) / 86400; + if($trade['expiration'] > 0) { + $trade['expirationhour'] = floor(($trade['expiration'] - floor($trade['expiration'])) * 24); + $trade['expiration'] = floor($trade['expiration']); + } else { + $trade['expiration'] = -1; + } + } + $tradesaids[] = $trade['aid']; + $tradespids[] = $trade['pid']; + if($trade['displayorder'] < 0) { + $trades[$trade['pid']] = $trade; + } else { + $tradesstick[$trade['pid']] = $trade; + } + } + if(empty($_GET['do'])) { + $tradepostlist = C::t('forum_post')->fetch_all_post('tid:'.$_G['tid'], $tradespids); + } + $trades = $tradesstick + $trades; + unset($trade); + + if($tradespids) { + foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$_G['tid'], 'pid', $tradespids) as $attach) { + if($attach['isimage'] && is_array($tradesaids) && in_array($attach['aid'], $tradesaids)) { + $trades[$attach['pid']]['attachurl'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$attach['attachment']; + $trades[$attach['pid']]['thumb'] = $attach['thumb'] ? getimgthumbname($trades[$attach['pid']]['attachurl']) : $trades[$attach['pid']]['attachurl']; + $trades[$attach['pid']]['width'] = $attach['thumb'] && $_G['setting']['thumbwidth'] < $attach['width'] ? $_G['setting']['thumbwidth'] : $attach['width']; + } + } + } + + if($_GET['do'] == 'tradeinfo') { + $trade = $trades[$_GET['pid']]; + unset($trades); + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid']); + if($post) { + $post = array_merge(C::t('common_member_status')->fetch($post['authorid']), C::t('common_member_profile')->fetch($post['authorid']), + $post, getuserbyuid($post['authorid'])); + if($_G['setting']['verify']['enabled']) { + $post = array_merge($post, C::t('common_member_verify')->fetch($post['authorid'])); + } + } + + $postlist[$post['pid']] = viewthread_procpost($post, $lastvisit, $ordertype); + + $usertrades = $userthreads = array(); + if(!$_G['inajax']) { + $limit = 6; + $query = C::t('forum_trade')->fetch_all_for_seller($_G['forum_thread']['authorid'], $limit + 1, $_G['tid']); + $usertradecount = 0; + foreach($query as $usertrade) { + if($usertrade['pid'] == $post['pid']) { + continue; + } + $usertradecount++; + $usertrades[] = $usertrade; + if($usertradecount == $limit) { + break; + } + } + + } + + if($_G['forum_attachpids'] && !defined('IN_ARCHIVER')) { + require_once libfile('function/attachment'); + parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist, array($trade['aid'])); + } + + $post = $postlist[$_GET['pid']]; + + $post['buyerrank'] = 0; + if($post['buyercredit']){ + foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) { + if($post['buyercredit'] <= $credit) { + $post['buyerrank'] = $level; + break; + } + } + } + $post['sellerrank'] = 0; + if($post['sellercredit']){ + foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) { + if($post['sellercredit'] <= $credit) { + $post['sellerrank'] = $level; + break; + } + } + } + + $navtitle = $trade['subject']; + + if($post['authorid']) { + $online = $sessioninfo = C::app()->session->fetch_by_uid($post['authorid']) && empty($sessioninfo['invisible']) ? 1 : 0; + } + + include template('forum/trade_info'); + exit; + + } +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/index.htm b/source/include/topicadmin/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/include/topicadmin/topicadmin_banpost.php b/source/include/topicadmin/topicadmin_banpost.php new file mode 100644 index 0000000..26a77ca --- /dev/null +++ b/source/include/topicadmin/topicadmin_banpost.php @@ -0,0 +1,89 @@ +fetch_all_post('tid:'.$_G['tid'], $topiclist) as $post) { + if($post['tid'] != $_G['tid']) { + continue; + } + $banstatus = ($post['status'] & 1) || $banstatus; + $authors[$post['authorid']] = 1; + $posts[] = $post; +} + +$authorcount = count(array_keys($authors)); + +if(!submitcheck('modsubmit')) { + + $banid = $checkunban = $checkban = ''; + foreach($topiclist as $id) { + $banid .= ''; + } + + $banstatus ? $checkunban = 'checked="checked"' : $checkban = 'checked="checked"'; + + if($modpostsnum == 1 || $authorcount == 1) { + include_once libfile('function/member'); + $crimenum = crime('getcount', $posts[0]['authorid'], 'crime_banpost'); + $crimeauthor = $posts[0]['author']; + } + + include template('forum/topicadmin_action'); + +} else { + + $banned = intval($_GET['banned']); + $modaction = $banned ? 'BNP' : 'UBN'; + + $reason = checkreasonpm(); + + include_once libfile('function/member'); + + $pids = $comma = ''; + foreach($posts as $k => $post) { + if($banned) { + C::t('forum_postcomment')->delete_by_rpid($post['pid']); + C::t('forum_post')->increase_status_by_pid('tid:'.$_G['tid'], $post['pid'], 1, '|', true); + crime('recordaction', $post['authorid'], 'crime_banpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $_G['tid'], 'pid' => $post['pid']))); + + } else { + C::t('forum_post')->increase_status_by_pid('tid:'.$_G['tid'], $post['pid'], 1, '&~', true); + } + $pids .= $comma.$post['pid']; + $comma = ','; + } + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modtids' => 0, + 'modlog' => $thread + ); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_copy.php b/source/include/topicadmin/topicadmin_copy.php new file mode 100644 index 0000000..ac5b243 --- /dev/null +++ b/source/include/topicadmin/topicadmin_copy.php @@ -0,0 +1,103 @@ +fetch_info_by_fid($copyto); + if(!$toforum || $toforum['status'] != 1 || $toforum['type'] == 'group') { + showmessage('admin_copy_invalid'); + } else { + $modnewthreads = (!$_G['group']['allowdirectpost'] || $_G['group']['allowdirectpost'] == 1) && $toforum['modnewposts'] ? 1 : 0; + $modnewreplies = (!$_G['group']['allowdirectpost'] || $_G['group']['allowdirectpost'] == 2) && $toforum['modnewposts'] ? 1 : 0; + if($modnewthreads || $modnewreplies) { + showmessage('admin_copy_hava_mod'); + } + } + $toforum['threadsorts_arr'] = dunserialize($toforum['threadsorts']); + + if($thread['sortid'] != 0 && $toforum['threadsorts_arr']['types'][$thread['sortid']]) { + foreach(C::t('forum_typeoptionvar')->fetch_all_by_search($thread['sortid'], null, $thread['tid']) as $result) { + $typeoptionvar[] = $result; + } + } else { + $thread['sortid'] = ''; + } + + $sourcetid = $thread['tid']; + unset($thread['tid']); + $thread['fid'] = $copyto; + $thread['dateline'] = $thread['lastpost'] = TIMESTAMP; + $thread['lastposter'] = $thread['author']; + $thread['views'] = $thread['replies'] = $thread['highlight'] = $thread['digest'] = 0; + $thread['rate'] = $thread['displayorder'] = $thread['attachment'] = 0; + $thread['typeid'] = $_GET['threadtypeid']; + $thread = daddslashes($thread); + + $thread['posttableid'] = 0; + $threadid = C::t('forum_thread')->insert($thread, true); + C::t('forum_newthread')->insert(array( + 'tid' => $threadid, + 'fid' => $thread['fid'], + 'dateline' => $thread['dateline'], + )); + C::t('forum_sofa')->insert(array('tid' => $threadid,'fid' => $thread['fid'])); + if($post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid'])) { + $post['pid'] = ''; + $post['tid'] = $threadid; + $post['fid'] = $copyto; + $post['dateline'] = $thread['dateline']; + $post['attachment'] = 0; + $post['invisible'] = $post['rate'] = $post['ratetimes'] = 0; + $post['message'] .= "\n".lang('forum/thread', 'source').": [url=forum.php?mod=viewthread&tid={$sourcetid}]{$thread['subject']}[/url]"; + $post = daddslashes($post); + $pid = insertpost($post); + } + + $class_tag = new tag(); + $class_tag->copy_tag($_G['tid'], $threadid, 'tid'); + + if($typeoptionvar) { + foreach($typeoptionvar AS $key => $value) { + $value['tid'] = $threadid; + $value['fid'] = $toforum['fid']; + C::t('forum_typeoptionvar')->insert($value); + } + } + updatepostcredits('+', $post['authorid'], 'post', $copyto); + + updateforumcount($copyto); + updateforumcount($_G['fid']); + + $modpostsnum ++; + $resultarray = array( + 'redirect' => "forum.php?mod=forumdisplay&fid={$_G['fid']}", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_copy', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'threadid' => $threadid), + 'modtids' => $thread['tid'], + 'modlog' => array($thread, $other) + ); +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_delcomment.php b/source/include/topicadmin/topicadmin_delcomment.php new file mode 100644 index 0000000..1ba5486 --- /dev/null +++ b/source/include/topicadmin/topicadmin_delcomment.php @@ -0,0 +1,84 @@ +fetch($commentid); + $pid = $pid['pid']; + if(!$pid) { + showmessage('postcomment_not_found'); + } + $deleteid = ''; + + include template('forum/topicadmin_action'); + +} else { + + $reason = checkreasonpm(); + $modaction = 'DCM'; + + $commentid = intval($_GET['topiclist']); + $postcomment = C::t('forum_postcomment')->fetch($commentid); + if(!$postcomment) { + showmessage('postcomment_not_found'); + } + C::t('forum_postcomment')->delete($commentid); + $result = C::t('forum_postcomment')->count_by_pid($postcomment['pid']); + if(!$result) { + C::t('forum_post')->update_post($_G['thread']['posttableid'], $postcomment['pid'], array('comment' => 0)); + } + if($thread['comments']) { + C::t('forum_thread')->update($_G['tid'], array('comments' => $thread['comments'] - 1)); + } + if(!$postcomment['rpid']) { + updatepostcredits('-', $postcomment['authorid'], 'reply', $_G['fid']); + } + + $totalcomment = array(); + foreach(C::t('forum_postcomment')->fetch_all_by_pid_score($postcomment['pid'], 1) as $comment) { + if(strexists($comment['comment'], '
          ')) { + if(preg_match_all("/([^:]+?):\s(\d+)<\/i>/", $comment['comment'], $a)) { + foreach($a[1] as $k => $itemk) { + $totalcomment[trim($itemk)][] = $a[2][$k]; + } + } + } + } + $totalv = ''; + foreach($totalcomment as $itemk => $itemv) { + $totalv .= strip_tags(trim($itemk)).': '.(sprintf('%1.1f', array_sum($itemv) / count($itemv))).' '; + } + + if($totalv) { + C::t('forum_postcomment')->update_by_pid($postcomment['pid'], array('comment' => $totalv, 'dateline' => TIMESTAMP + 1), false, false, 0); + } else { + C::t('forum_postcomment')->delete_by_pid($postcomment['pid'], false, 0); + } + C::t('forum_postcache')->delete($postcomment['pid']); + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => array($postcomment), 'var' => 'post', 'item' => 'reason_delete_comment', 'notictype' => 'pcomment') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'pid' => $postcomment['pid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modtids' => 0, + 'modlog' => $thread + ); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_delpost.php b/source/include/topicadmin/topicadmin_delpost.php new file mode 100644 index 0000000..01f20b4 --- /dev/null +++ b/source/include/topicadmin/topicadmin_delpost.php @@ -0,0 +1,140 @@ +fetch_all_post('tid:'.$_G['tid'], $topiclist, false) as $post) { + if($post['tid'] != $_G['tid']) { + continue; + } + if($post['first'] == 1) { + dheader("location: {$_G['siteurl']}forum.php?mod=topicadmin&action=moderate&operation=delete&optgroup=3&fid={$_G['fid']}&moderate[]={$thread['tid']}&inajax=yes".($_GET['infloat'] ? "&infloat=yes&handlekey={$_GET['handlekey']}" : '')); + } else { + $authors[$post['authorid']] = 1; + $pids[] = $post['pid']; + $posts[] = $post; + } + } +} + +if(!submitcheck('modsubmit')) { + + $deleteid = ''; + foreach($topiclist as $id) { + $deleteid .= ''; + } + + $authorcount = count(array_keys($authors)); + + if($modpostsnum == 1 || $authorcount == 1) { + include_once libfile('function/member'); + $crimenum = crime('getcount', $posts[0]['authorid'], 'crime_delpost'); + $crimeauthor = $posts[0]['author']; + } + + include template('forum/topicadmin_action'); + +} else { + + $reason = checkreasonpm(); + + $uidarray = $puidarray = $auidarray = array(); + $losslessdel = $_G['setting']['losslessdel'] > 0 ? TIMESTAMP - $_G['setting']['losslessdel'] * 86400 : 0; + + if($pids) { + require_once libfile('function/delete'); + if($_G['forum']['recyclebin']) { + deletepost($pids, 'pid', true, false, true); + manage_addnotify('verifyrecyclepost', $modpostsnum); + } else { + $logs = array(); + $ratelog = C::t('forum_ratelog')->fetch_all_by_pid($pids); + $rposts = C::t('forum_post')->fetch_all_post('tid:'.$_G['tid'], $pids, false); + foreach(C::t('forum_ratelog')->fetch_all_by_pid($pids) as $rpid => $author) { + if($author['score'] > 0) { + $rpost = $rposts[$rpid]; + updatemembercount($rpost['authorid'], array($author['extcredits'] => -$author['score'])); + $author['score'] = $_G['setting']['extcredits'][$id]['title'].' '.-$author['score'].' '.$_G['setting']['extcredits'][$id]['unit']; + $logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G['member']['username']}\t{$_G['adminid']}\t{$rpost['author']}\t{$author['extcredits']}\t{$author['score']}\t{$thread['tid']}\t{$thread['subject']}\t$delpostsubmit"); + } + } + if(!empty($logs)) { + writelog('ratelog', $logs); + unset($logs); + } + deletepost($pids, 'pid', true); + } + + if($_G['group']['allowbanuser'] && ($_GET['banuser'] || $_GET['userdelpost']) && $_G['deleteauthorids']) { + $members = C::t('common_member')->fetch_all($_G['deleteauthorids']); + $banuins = array(); + foreach($members as $member) { + if(($_G['cache']['usergroups'][$member['groupid']]['type'] == 'system' && + in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || $_G['cache']['usergroups'][$member['groupid']]['type'] == 'special') { + continue; + } + $banuins[$member['uid']] = $member['uid']; + } + if($banuins) { + if($_GET['banuser']) { + C::t('common_member')->update($banuins, array('groupid' => 4)); + } + + if($_GET['userdelpost']) { + deletememberpost($banuins); + } + } + } + + if($_GET['crimerecord']) { + include_once libfile('function/member'); + + foreach($posts as $post) { + crime('recordaction', $post['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $post['tid'], 'pid' => $post['pid']))); + } + } + } + + updatethreadcount($_G['tid'], 1); + updateforumcount($_G['fid']); + + $_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']); + + $modaction = 'DLP'; + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_GET['page']}", + 'reasonpm' => ($sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_delete_post', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modtids' => 0, + 'modlog' => $thread + ); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_getip.php b/source/include/topicadmin/topicadmin_getip.php new file mode 100644 index 0000000..c2ad10c --- /dev/null +++ b/source/include/topicadmin/topicadmin_getip.php @@ -0,0 +1,37 @@ +fetch_post('tid:'.$_G['tid'], $pid, false); +if($post && $post['tid'] == $_G['tid']) { + $member = getuserbyuid($post['authorid']); + $member = array_merge($post, $member); +} +if(!$member) { + showmessage('thread_nonexistence', NULL); +} elseif(($member['adminid'] == 1 && $_G['adminid'] > 1) || ($member['adminid'] == 2 && $_G['adminid'] > 2)) { + showmessage('admin_getip_nopermission', NULL); +} + +$member['iplocation'] = convertip($member['useip']); + +$member['useip'] = ip::to_display($member['useip']); + +include template('forum/topicadmin_getip'); + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_live.php b/source/include/topicadmin/topicadmin_live.php new file mode 100644 index 0000000..4a1435c --- /dev/null +++ b/source/include/topicadmin/topicadmin_live.php @@ -0,0 +1,50 @@ +update($_G['fid'], array('livetid' => $_G['tid'])); + } elseif($modaction == 'LIC') { + if($_G['tid'] != $_G['forum']['livetid']) { + showmessage('topicadmin_live_noset_error'); + } + C::t('forum_forumfield')->update($_G['fid'], array('livetid' => 0)); + } + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'notictype' => 'post', 'item' => $_GET['live'] ? 'reason_live_update' : 'reason_live_cancle') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modaction' => $modaction, + 'modlog' => $thread + ); + $modpostsnum = 1; + + updatemodlog($_G['tid'], $modaction, $expiration, 0, '', $modaction == 'LIV' ? 1 : 0); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_merge.php b/source/include/topicadmin/topicadmin_merge.php new file mode 100644 index 0000000..b3be107 --- /dev/null +++ b/source/include/topicadmin/topicadmin_merge.php @@ -0,0 +1,123 @@ +fetch_by_tid_displayorder($othertid, 0); + if(!$other) { + showmessage('admin_merge_nonexistence'); + } elseif($other['special']) { + showmessage('special_noaction'); + } + if($othertid == $_G['tid'] || ($_G['adminid'] == 3 && $other['fid'] != $_G['forum']['fid'])) { + showmessage('admin_merge_invalid'); + } + + $other['views'] = intval($other['views']); + $other['replies']++; + if(!$other['maxposition']) { + $other['maxposition'] = C::t('forum_post')->fetch_maxposition_by_tid($other['posttableid'], $othertid); + } + if(!$thread['maxposition']) { + $thread['maxposition'] = C::t('forum_post')->fetch_maxposition_by_tid($thread['posttableid'], $_G['tid']); + } + $pos = 1; + if($posttable != $otherposttable) { + $pidlist = array(); + C::t('forum_post')->increase_position_by_tid($thread['posttableid'], $_G['tid'], $other['maxposition'] + $thread['maxposition']); + C::t('forum_post')->increase_position_by_tid($other['posttableid'], $othertid, $other['maxposition'] + $thread['maxposition']); + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $_G['tid'], false, 'ASC') as $row) { + $pidlist[$row['dateline']] = array('pid' => $row['pid'], 'tid' => $row['tid']); + } + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$othertid, $othertid, false, 'ASC') as $row) { + $pidlist[$row['dateline']] = array('pid' => $row['pid'], 'tid' => $row['tid']); + } + ksort($pidlist); + foreach($pidlist as $row) { + C::t('forum_post')->update_post('tid:'.$row['tid'], $row['pid'], array('position' => $pos)); + $pos ++; + } + unset($pidlist); + } else { + C::t('forum_post')->increase_position_by_tid($thread['posttableid'], array($_G['tid'], $othertid), $other['maxposition'] + $thread['maxposition']); + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], array($_G['tid'], $othertid), false, 'ASC') as $row) { + C::t('forum_post')->update_post('tid:'.$_G['tid'], $row['pid'], array('position' => $pos)); + $pos ++; + } + } + if($posttable != $otherposttable) { + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$othertid, $othertid) as $row) { + C::t('forum_post')->insert_post('tid:'.$_G['tid'], $row); + } + C::t('forum_post')->delete_by_tid('tid:'.$othertid, $othertid); + } + + $query = C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], array($_G['tid'], $othertid), false, 'ASC', 0, 1, null, 0); + foreach($query as $row) { + $firstpost = $row; + } + + $postsmerged = C::t('forum_post')->update_by_tid('tid:'.$_G['tid'], $othertid, array('tid' => $_G['tid'])); + + updateattachtid('tid', array($othertid), $othertid, $_G['tid']); + C::t('forum_thread')->delete_by_tid($othertid); + C::t('forum_threadmod')->delete_by_tid($othertid); + + C::t('forum_post')->update_by_tid('tid:'.$_G['tid'], $_G['tid'], array('first' => 0, 'fid' => $_G['forum']['fid'])); + C::t('forum_post')->update_post('tid:'.$_G['tid'], $firstpost['pid'], array('first' => 1)); + $fieldarr = array( + 'views' => $other['views'], + 'replies' => $other['replies'], + ); + C::t('forum_thread')->increase($_G['tid'], $fieldarr); + $fieldarr = array( + 'authorid' => $firstpost['authorid'], + 'author' => $firstpost['author'], + 'subject' => $firstpost['subject'], + 'dateline' => $firstpost['dateline'], + 'moderated' => 1, + 'maxposition' => $other['maxposition'] + $thread['maxposition'], + ); + C::t('forum_thread')->update($_G['tid'], $fieldarr); + updateforumcount($other['fid']); + updateforumcount($_G['fid']); + + $_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']); + + $modpostsnum ++; + $resultarray = array( + 'redirect' => "forum.php?mod=forumdisplay&fid={$_G['fid']}", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_merge', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modtids' => $thread['tid'], + 'modlog' => array($thread, $other) + ); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_moderate.php b/source/include/topicadmin/topicadmin_moderate.php new file mode 100644 index 0000000..073e4cf --- /dev/null +++ b/source/include/topicadmin/topicadmin_moderate.php @@ -0,0 +1,758 @@ +fetch_all_by_tid_fid_displayorder($_GET['moderate'], $_G['fid'], null, '', 0, $_G['tpp'], '', '', $tableid) as $thread) { + if($thread['closed'] > 1 && $operation && !in_array($operation, array('delete', 'highlight', 'stick', 'digest', 'bump', 'down')) || $thread['displayorder'] < 0 && $thread['displayorder'] != -4) { + if($operation == 'recommend_group') { + $recommend_group_count ++; + } + continue; + } + $thread['lastposterenc'] = rawurlencode($thread['lastposter']); + $thread['dblastpost'] = $thread['lastpost']; + $thread['lastpost'] = dgmdate($thread['lastpost'], 'u'); + $posttablearr[$thread['posttableid'] ? $thread['posttableid'] : 0][] = $thread['tid']; + $authors[$thread['authorid']] = 1; + $threadlist[$thread['tid']] = $thread; + $_G['tid'] = empty($_G['tid']) ? $thread['tid'] : $_G['tid']; + } + if(!empty($threadlist)) { + break; + } + } +} +if(empty($threadlist)) { + if($recommend_group_count) { + showmessage('recommend_group_invalid'); + } + showmessage('admin_moderate_invalid'); +} + +$authorcount = count(array_keys($authors)); +$modpostsnum = count($threadlist); +$single = $modpostsnum == 1 ? TRUE : FALSE; +$frommodcp = getgpc('frommodcp'); +switch($frommodcp) { + case '1': + $_G['referer'] = "forum.php?mod=modcp&action=thread&fid={$_G['fid']}&op=thread&do=list"; + break; + case '2': + $_G['referer'] = "forum.php?mod=modcp&action=forum&op=recommend".(getgpc('show') ? "&show=getgpc('show')" : '')."&fid={$_G['fid']}"; + break; + default: + if(in_array('delete', $operations) || in_array('move', $operations) && !strpos($_SERVER['HTTP_REFERER'], 'search.php?mod=forum')) { + $_G['referer'] = 'forum.php?mod=forumdisplay&fid='.$_G['fid'].(!empty($_GET['listextra']) ? '&'.rawurldecode($_GET['listextra']) : ''); + } else { + $_G['referer'] = $_GET['redirect']; + } + break; +} + +$optgroup = $_GET['optgroup'] = isset($_GET['optgroup']) ? intval($_GET['optgroup']) : 0; +$expirationstick = getgpc('expirationstick'); + +$defaultcheck = array(); +foreach ($allow_operation as $v) { + $defaultcheck[$v] = ''; +} +$defaultcheck[$operation] = 'checked="checked"'; + +if(!submitcheck('modsubmit')) { + + $stickcheck = $closecheck = $digestcheck = array('', '', '', '', ''); + $expirationdigest = $expirationhighlight = $expirationclose = ''; + + if($_GET['optgroup'] == 1 && $single) { + empty($threadlist[$_G['tid']]['displayorder']) ? $stickcheck[0] ='selected="selected"' : $stickcheck[$threadlist[$_G['tid']]['displayorder']] = 'selected="selected"'; + empty($threadlist[$_G['tid']]['digest']) ? $digestcheck[0] = 'selected="selected"' : $digestcheck[$threadlist[$_G['tid']]['digest']] = 'selected="selected"'; + $string = sprintf('%02d', $threadlist[$_G['tid']]['highlight']); + $stylestr = sprintf('%03b', $string[0]); + for($i = 1; $i <= 3; $i++) { + $stylecheck[$i] = $stylestr[$i - 1] ? 1 : 0; + } + $colorcheck = $string[1]; + $highlight_bgcolor = $threadlist[$_G['tid']]['bgcolor']; + $_G['forum']['modrecommend'] = is_array($_G['forum']['modrecommend']) ? $_G['forum']['modrecommend'] : array(); + $expirationstick = get_expiration($_G['tid'], 'EST'); + $expirationdigest = get_expiration($_G['tid'], 'EDI'); + $expirationhighlight = get_expiration($_G['tid'], 'EHL'); + + } elseif($_GET['optgroup'] == 2 || $_GET['optgroup'] == 5) { + require_once libfile('function/forumlist'); + $forumselect = forumselect(FALSE, 0, $threadlist[$_G['tid']]['fid'], $_G['adminid']==1 ? TRUE : FALSE); + $typeselect = typeselect($single ? $threadlist[$_G['tid']]['typeid'] : 0); + } elseif($_GET['optgroup'] == 4 && $single) { + !empty($threadlist[$_G['tid']]['closed']) ? $closecheck[0] = 'checked="checked"' : $closecheck[1] = 'checked="checked"'; + if($threadlist[$_G['tid']]['closed']) { + $expirationclose = get_expiration($_G['tid'], 'ECL'); + } + } elseif($_GET['optgroup'] == 3 && ($modpostsnum == 1 || $authorcount == 1)) { + include_once libfile('function/member'); + $crimenum = crime('getcount', $threadlist[$_G['tid']]['authorid'], 'crime_delpost'); + $crimeauthor = $threadlist[$_G['tid']]['author']; + } + + $imgattach = array(); + if(count($threadlist) == 1 && $operation == 'recommend') { + $imgattach = C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$_G['tid'], 'tid', $_G['tid'], '', array(1, -1)); + + $oldthread = C::t('forum_forumrecommend')->fetch($_G['tid']); + if($oldthread) { + $threadlist[$_G['tid']]['subject'] = $oldthread['subject']; + $selectposition[$oldthread['position']] = ' selected="selected"'; + $selectattach = $oldthread['aid']; + } else { + $keys = array_keys($imgattach); + $selectattach = $imgattach[$keys[0]]['aid']; + $selectposition[0] = ' selected="selected"'; + } + $expirationrecommend = get_expiration($_G['tid'], 'REC'); + } + include template('forum/topicadmin'); + +} else { + + $tidsarr = array_keys($threadlist); + $moderatetids = dimplode($tidsarr); + $reason = checkreasonpm(); + $stampaction = 'SPA'; + if(empty($operations)) { + showmessage('admin_nonexistence'); + } else { + $images = array(); + foreach($operations as $operation) { + $stampstatus = 0; + $updatemodlog = TRUE; + if($operation == 'stick') { + $sticklevel = intval($_GET['sticklevel']); + if($sticklevel < 0 || $sticklevel > 3 || $sticklevel > $_G['group']['allowstickthread']) { + showmessage('no_privilege_stickthread'); + } + $expiration = checkexpiration($_GET['expirationstick'], $operation); + $expirationstick = $sticklevel ? $_GET['expirationstick'] : 0; + + $forumstickthreads = $_G['setting']['forumstickthreads']; + $forumstickthreads = isset($forumstickthreads) ? dunserialize($forumstickthreads) : array(); + C::t('forum_thread')->update($tidsarr, array('displayorder'=>$sticklevel, 'moderated'=>1), true); + $delkeys = array_keys($threadlist); + foreach($delkeys as $k) { + unset($forumstickthreads[$k]); + } + C::t('common_setting')->update_setting('forumstickthreads', $forumstickthreads); + + $stickmodify = 0; + foreach($threadlist as $thread) { + $stickmodify = (in_array($thread['displayorder'], array(2, 3)) || in_array($sticklevel, array(2, 3))) && $sticklevel != $thread['displayorder'] ? 1 : $stickmodify; + C::t('common_member_secwhite')->add($thread['authorid']); + } + + if($_G['setting']['globalstick'] && $stickmodify) { + require_once libfile('function/cache'); + updatecache('globalstick'); + } + + $modaction = $sticklevel ? ($expiration ? 'EST' : 'STK') : 'UST'; + C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('STK', 'UST', 'EST', 'UES'), array('status' => 0)); + C::t('forum_threadhidelog')->delete_by_tid($tidsarr); + + if(!$sticklevel) { + $stampaction = 'SPD'; + } + + $stampstatus = 1; + + } elseif($operation == 'highlight') { + if(!$_G['group']['allowhighlightthread']) { + showmessage('no_privilege_highlightthread'); + } + $highlight_style = $_GET['highlight_style']; + $highlight_color = $_GET['highlight_color']; + $highlight_bgcolor = $_GET['highlight_bgcolor']; + $expiration = checkexpiration($_GET['expirationhighlight'], $operation); + $stylebin = ''; + for($i = 1; $i <= 3; $i++) { + $stylebin .= empty($highlight_style[$i]) ? '0' : '1'; + } + + $highlight_style = bindec($stylebin); + if($highlight_style < 0 || $highlight_style > 7 || $highlight_color < 0 || $highlight_color > 8) { + showmessage('parameters_error '); + } + $bgcolor = dhtmlspecialchars(preg_replace("/[^\[A-Za-z0-9#]/", '', $_GET['highlight_bgcolor'])); + + C::t('forum_thread')->update($tidsarr, array('highlight'=>$highlight_style.$highlight_color, 'moderated'=>1, 'bgcolor' => $bgcolor), true); + C::t('forum_forumrecommend')->update($tidsarr, array('highlight' => $highlight_style.$highlight_color)); + C::t('forum_threadhidelog')->delete_by_tid($tidsarr); + + $modaction = ($highlight_style + $highlight_color) ? ($expiration ? 'EHL' : 'HLT') : 'UHL'; + $expiration = $modaction == 'UHL' ? 0 : $expiration; + + foreach($threadlist as $thread) { + C::t('common_member_secwhite')->add($thread['authorid']); + } + + C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('HLT', 'UHL', 'EHL', 'UEH'), array('status' => 0)); + + } elseif($operation == 'digest') { + $digestlevel = intval($_GET['digestlevel']); + if($digestlevel < 0 || $digestlevel > 3 || $digestlevel > $_G['group']['allowdigestthread']) { + showmessage('no_privilege_digestthread'); + } + $expiration = checkexpiration($_GET['expirationdigest'], $operation); + $expirationdigest = $digestlevel ? $expirationdigest : 0; + + C::t('forum_thread')->update($tidsarr, array('digest'=>$digestlevel, 'moderated'=>1), true); + C::t('forum_threadhidelog')->delete_by_tid($tidsarr); + + foreach($threadlist as $thread) { + if($thread['digest'] != $digestlevel) { + if($digestlevel == $thread['digest']) continue; + $extsql = array(); + if($digestlevel > 0 && $thread['digest'] == 0) { + $extsql = array('digestposts' => 1); + } + if($digestlevel == 0 && $thread['digest'] > 0) { + $extsql = array('digestposts' => -1); + } + if($digestlevel == 0) { + $stampaction = 'SPD'; + } + updatecreditbyaction('digest', $thread['authorid'], $extsql, '', $digestlevel - $thread['digest']); + C::t('common_member_secwhite')->add($thread['authorid']); + } + } + + $modaction = $digestlevel ? ($expiration ? 'EDI' : 'DIG') : 'UDG'; + C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('DIG', 'UDI', 'EDI', 'UED'), array('status' => 0)); + + $stampstatus = 2; + + } elseif($operation == 'recommend') { + if(!$_G['group']['allowrecommendthread']) { + showmessage('no_privilege_recommendthread'); + } + $isrecommend = $_GET['isrecommend']; + $modrecommend = !empty($_G['forum']['modrecommend']) ? $_G['forum']['modrecommend'] : array(); + $imgw = $modrecommend['imagewidth'] ? intval($modrecommend['imagewidth']) : 200; + $imgh = $modrecommend['imageheight'] ? intval($modrecommend['imageheight']) : 150; + $expiration = checkexpiration($_GET['expirationrecommend'], $operation); + C::t('forum_thread')->update($tidsarr, array('moderated'=>1), true); + $modaction = $isrecommend ? 'REC' : 'URE'; + $thread = daddslashes($thread, 1); + $selectattach = $_GET['selectattach']; + $position = $_GET['position']; + + C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('REC'), array('status' => 0)); + if($isrecommend) { + C::t('forum_threadhidelog')->delete_by_tid($tidsarr); + $oldrecommendlist = $addthread = array(); + foreach(C::t('forum_forumrecommend')->fetch_all($tidsarr) as $row) { + $oldrecommendlist[$row['tid']] = $row; + } + foreach($threadlist as $thread) { + if(count($threadlist) > 1) { + if($oldrecommendlist[$thread['tid']]) { + $oldthread = $oldrecommendlist[$thread['tid']]; + $reducetitle = $oldthread['subject']; + $selectattach = $oldthread['aid']; + $typeid = $oldthread['typeid']; + $position = $oldthread['position']; + } else { + $reducetitle = $thread['subject']; + $typeid = 0; + $position = 0; + } + } else { + if(empty($_GET['reducetitle'])) { + $reducetitle = $thread['subject']; + } else { + $reducetitle = $_GET['reducetitle']; + } + $typeid = $selectattach ? 1 : 0; + empty($_GET['position']) && $position = 0; + } + if($selectattach) { + $key = md5($selectattach.'|'.$imgw.'|'.$imgh); + $filename = $selectattach."\t".$imgw."\t".$imgh."\t".$key; + } else { + $selectattach = 0; + $filename = ''; + } + + $addthread[] = array( + 'fid' => $thread['fid'], + 'tid' => $thread['tid'], + 'typeid' => $typeid, + 'displayorder' => 0, + 'subject' => $reducetitle, + 'author' => $thread['author'], + 'authorid' => $thread['authorid'], + 'moderatorid' => $_G['uid'], + 'expiration' => $expiration, + 'position' => $position, + 'aid' => $selectattach, + 'filename' => $filename, + 'highlight' => $thread['highlight'] + ); + + $reducetitle = ''; + } + if($addthread) { + foreach($addthread as $row) { + C::t('forum_forumrecommend')->insert($row, false, true); + } + } + + } else { + C::t('forum_forumrecommend')->delete($tidsarr); + $stampaction = 'SPD'; + } + $stampstatus = 3; + + } elseif($operation == 'bump') { + if(!$_G['group']['allowbumpthread']) { + showmessage('no_privilege_bumpthread'); + } + $modaction = 'BMP'; + $thread = $threadlist; + $thread = array_pop($thread); + + $expiration = checkexpiration($_GET['expirationbump'], $operation); + if(!$expiration) { + $expiration = $_G['timestamp']; + } + + + C::t('forum_thread')->update($tidsarr, array('lastpost'=>$expiration, 'moderated'=>1), true); + C::t('forum_forum')->update($_G['fid'], array('lastpost' => "{$thread['tid']}\t{$thread['subject']}\t$expiration\t{$thread['lastposter']}")); + + $_G['forum']['threadcaches'] && deletethreadcaches($moderatetids); + } elseif($operation == 'down') { + if(!$_G['group']['allowbumpthread']) { + showmessage('no_privilege_downthread'); + } + $modaction = 'DWN'; + $downtime = TIMESTAMP - 86400 * 730; + C::t('forum_thread')->update($tidsarr, array('lastpost'=>$downtime, 'moderated'=>1), true); + + $_G['forum']['threadcaches'] && deletethreadcaches($moderatetids); + } elseif($operation == 'delete') { + if(!$_G['group']['allowdelpost']) { + showmessage('no_privilege_delpost'); + } + loadcache('threadtableids'); + $stickmodify = 0; + $deleteredirect = $remarkclosed = array(); + foreach($threadlist as $thread) { + if($thread['digest']) { + updatecreditbyaction('digest', $thread['authorid'], array('digestposts' => -1), '', -$thread['digest']); + } + if(in_array($thread['displayorder'], array(2, 3))) { + $stickmodify = 1; + } + if($_G['forum']['status'] == 3 && $thread['closed'] > 1) { + $deleteredirect[] = $thread['closed']; + } + if($thread['isgroup'] == 1 && $thread['closed'] > 1) { + $remarkclosed[] = $thread['closed']; + } + } + + $modaction = 'DEL'; + require_once libfile('function/delete'); + $tids = array_keys($threadlist); + if($_G['forum']['recyclebin']) { + + deletethread($tids, true, true, true); + manage_addnotify('verifyrecycle', $modpostsnum); + } else { + + deletethread($tids, true, true); + $updatemodlog = FALSE; + } + + if($_G['group']['allowbanuser'] && ($_GET['banuser'] || $_GET['userdelpost']) && $_G['deleteauthorids']) { + $members = C::t('common_member')->fetch_all($_G['deleteauthorids']); + $banuins = array(); + foreach($members as $member) { + if(($_G['cache']['usergroups'][$member['groupid']]['type'] == 'system' && + in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || $_G['cache']['usergroups'][$member['groupid']]['type'] == 'special') { + continue; + } + $banuins[$member['uid']] = $member['uid']; + } + if($banuins) { + if($_GET['banuser']) { + C::t('common_member')->update($banuins, array('groupid' => 4)); + } + + if($_GET['userdelpost']) { + deletememberpost($banuins); + } + } + } + + $forumstickthreads = $_G['setting']['forumstickthreads']; + $forumstickthreads = !empty($forumstickthreads) ? dunserialize($forumstickthreads) : array(); + $delkeys = array_keys($threadlist); + foreach($delkeys as $k) { + unset($forumstickthreads[$k]); + } + C::t('common_setting')->update_setting('forumstickthreads', $forumstickthreads); + + C::t('forum_forum_threadtable')->delete_none_threads(); + if(!empty($deleteredirect)) { + deletethread($deleteredirect); + } + if(!empty($remarkclosed)) { + C::t('forum_thread')->update($remarkclosed, array('closed'=>0)); + } + + if($_G['setting']['globalstick'] && $stickmodify) { + require_once libfile('function/cache'); + updatecache('globalstick'); + } + + updateforumcount($_G['fid']); + + if($_GET['crimerecord']) { + include_once libfile('function/member'); + foreach($threadlist as $thread) { + crime('recordaction', $thread['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $thread['tid'], 'pid' => 0))); + } + } + } elseif($operation == 'close') { + if(!$_G['group']['allowclosethread']) { + showmessage('no_privilege_closethread'); + } + $expiration = checkexpiration($_GET['expirationclose'], $operation); + $modaction = $expiration ? 'ECL' : 'CLS'; + + C::t('forum_thread')->update($tidsarr, array('closed'=>1, 'moderated'=>1), true); + C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('CLS','OPN','ECL','UCL','EOP','UEO'), array('status' => 0)); + } elseif($operation == 'open') { + if(!$_G['group']['allowclosethread']) { + showmessage('no_privilege_openthread'); + } + $expiration = checkexpiration($_GET['expirationclose'], $operation); + $modaction = $expiration ? 'EOP' : 'OPN'; + + C::t('forum_thread')->update($tidsarr, array('closed'=>0, 'moderated'=>1), true); + C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('CLS','OPN','ECL','UCL','EOP','UEO'), array('status' => 0)); + } elseif($operation == 'move') { + if(!$_G['group']['allowmovethread']) { + showmessage('no_privilege_movethread'); + } + $moveto = $_GET['moveto']; + $toforum = C::t('forum_forum')->fetch_info_by_fid($moveto); + if(!$toforum || ($_G['adminid'] != 1 && $toforum['status'] != 1) || $toforum['type'] == 'group') { + showmessage('admin_move_invalid'); + } elseif($_G['fid'] == $toforum['fid']) { + continue; + } else { + $moveto = $toforum['fid']; + $modnewthreads = (!$_G['group']['allowdirectpost'] || $_G['group']['allowdirectpost'] == 1) && $toforum['modnewposts'] ? 1 : 0; + $modnewreplies = (!$_G['group']['allowdirectpost'] || $_G['group']['allowdirectpost'] == 2) && $toforum['modnewposts'] ? 1 : 0; + if($modnewthreads || $modnewreplies) { + showmessage('admin_move_have_mod'); + } + } + + if($_G['adminid'] == 3) { + $priv = C::t('forum_forumfield')->check_moderator_for_uid($moveto, $_G['uid'], $_G['member']['accessmasks']); + if((($priv['postperm'] && !in_array($_G['groupid'], explode("\t", $priv['postperm']))) || ($_G['member']['accessmasks'] && ($priv['allowview'] || $priv['allowreply'] || $priv['allowgetattach'] || $priv['allowpostattach']) && !$priv['allowpost'])) && !$priv['istargetmod']) { + showmessage('admin_move_nopermission'); + } + } + + $moderate = array(); + $stickmodify = 0; + $toforumallowspecial = array( + 1 => $toforum['allowpostspecial'] & 1, + 2 => $toforum['allowpostspecial'] & 2, + 3 => isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]) && ($toforum['allowpostspecial'] & 4), + 4 => $toforum['allowpostspecial'] & 8, + 5 => $toforum['allowpostspecial'] & 16, + 127 => $_G['setting']['threadplugins'] ? dunserialize($toforum['threadplugin']) : array(), + ); + foreach($threadlist as $tid => $thread) { + $allowmove = 0; + if(!$thread['special']) { + $allowmove = 1; + } else { + if($thread['special'] != 127) { + $allowmove = $toforum['allowpostspecial'] ? $toforumallowspecial[$thread['special']] : 0; + } else { + if($toforumallowspecial[127]) { + $posttable = getposttablebytid($thread['tid']); + $message = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']); + $message = $message['message']; + $sppos = strrpos($message, chr(0).chr(0).chr(0)); + $specialextra = substr($message, $sppos + 3); + $allowmove = in_array($specialextra, $toforumallowspecial[127]); + } else { + $allowmove = 0; + } + } + } + + if($allowmove) { + $moderate[] = $tid; + if(in_array($thread['displayorder'], array(2, 3))) { + $stickmodify = 1; + } + if($_GET['type'] == 'redirect') { + + $insertdata = array( + 'fid' => $thread['fid'], + 'readperm' => $thread['readperm'], + 'author' => $thread['author'], + 'authorid' => $thread['authorid'], + 'subject' => $thread['subject'], + 'dateline' => $thread['dateline'], + 'lastpost' => $thread['dblastpost'], + 'lastposter' => $thread['lastposter'], + 'views' => 0, + 'replies' => 0, + 'displayorder' => 0, + 'digest' => 0, + 'closed' => $thread['tid'], + 'special' => 0, + 'attachment' => 0, + 'typeid' => $_GET['threadtypeid'] + ); + $newtid = C::t('forum_thread')->insert($insertdata, true); + if($newtid) { + C::t('forum_threadclosed')->insert(array('tid' => $thread['tid'], 'redirect' => $newtid), true, true); + } + } + } + } + + if(!$moderatetids = implode(',', $moderate)) { + showmessage('admin_moderate_invalid'); + } + $fieldarr = array( + 'fid' => $moveto, + 'isgroup' => 0, + 'typeid' => $_GET['threadtypeid'], + 'moderated' => 1 + ); + if($_G['adminid'] == 3) { + $fieldarr['displayorder'] = 0; + } + C::t('forum_thread')->update($tidsarr, $fieldarr, true); + C::t('forum_forumrecommend')->update($tidsarr, array('fid' => $moveto)); + loadcache('posttableids'); + $posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0'); + foreach($posttableids as $id) { + C::t('forum_post')->update_by_tid($id, $tidsarr, array('fid' => $moveto)); + } + $typeoptionvars = C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tidsarr); + foreach($typeoptionvars as $typeoptionvar) { + C::t('forum_typeoptionvar')->update_by_tid($typeoptionvar['tid'], array('fid' => $moveto)); + C::t('forum_optionvalue')->update_optionvalue($typeoptionvar['sortid'], $typeoptionvar['tid'], $_G['fid'], "fid='$moveto'"); + } + + if($_G['setting']['globalstick'] && $stickmodify) { + require_once libfile('function/cache'); + updatecache('globalstick'); + } + $modaction = 'MOV'; + $_G['toforum'] = $toforum; + updateforumcount($moveto); + updateforumcount($_G['fid']); + } elseif($operation == 'type') { + if(!$_G['group']['allowedittypethread']) { + showmessage('no_privilege_edittypethread'); + } + if(!isset($_G['forum']['threadtypes']['types'][$_GET['typeid']]) && ($_GET['typeid'] != 0 || $_G['forum']['threadtypes']['required'])) { + showmessage('admin_type_invalid'); + } + + C::t('forum_thread')->update($tidsarr, array('typeid'=>$_GET['typeid'], 'moderated'=>1), true); + $modaction = 'TYP'; + } elseif($operation == 'recommend_group') { + if($_G['forum']['status'] != 3 || !in_array($_G['adminid'], array(1, 2))) { + showmessage('undefined_action'); + } + $moveto = $_GET['moveto']; + $toforum = C::t('forum_forum')->fetch_info_by_fid($moveto); + if(!$toforum || $toforum['status'] != 1 || $toforum['type'] == 'group') { + showmessage('admin_move_invalid'); + } elseif($_G['fid'] == $toforum['fid']) { + continue; + } + $moderate = array(); + $toforumallowspecial = array( + 1 => $toforum['allowpostspecial'] & 1, + 2 => $toforum['allowpostspecial'] & 2, + 3 => isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]) && ($toforum['allowpostspecial'] & 4), + 4 => $toforum['allowpostspecial'] & 8, + 5 => $toforum['allowpostspecial'] & 16, + 127 => $_G['setting']['threadplugins'] ? dunserialize($toforum['threadplugin']) : array(), + ); + foreach($threadlist as $tid => $thread) { + $allowmove = 0; + if($thread['closed']) { + continue; + } + if(!$thread['special']) { + $allowmove = 1; + } else { + if($thread['special'] != 127) { + $allowmove = $toforum['allowpostspecial'] ? $toforumallowspecial[$thread['special']] : 0; + } else { + if($toforumallowspecial[127]) { + $posttable = getposttablebytid($thread['tid']); + $message = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']); + $message = $message['message']; + $sppos = strrpos($message, chr(0).chr(0).chr(0)); + $specialextra = substr($message, $sppos + 3); + $allowmove = in_array($specialextra, $toforumallowspecial[127]); + } else { + $allowmove = 0; + } + } + } + + if($allowmove) { + $moderate[] = $tid; + + $newthread = array( + 'fid' => $moveto, + 'readperm' => $thread['readperm'], + 'author' => $thread['author'], + 'authorid' => $thread['authorid'], + 'subject' => $thread['subject'], + 'dateline' => $thread['dateline'], + 'lastpost' => TIMESTAMP, + 'lastposter' => $thread['lastposter'], + 'views' => $thread['views'], + 'replies' => $thread['replies'], + 'displayorder' => 0, + 'digest' => $thread['digest'], + 'closed' => $thread['tid'], + 'special' => $thread['special'], + 'attachment' => $thread['attachment'], + 'isgroup' => $thread['isgroup'] + ); + $newtid = C::t('forum_thread')->insert($newthread, true); + C::t('forum_thread')->update($thread['tid'], array('closed'=>$newtid, 'moderated'=>1), true); + } + } + if(!$moderatetids = implode(',', $moderate)) { + showmessage('admin_succeed', $_G['referer']); + } + $modaction = 'REG'; + } + + if($updatemodlog) { + updatemodlog($moderatetids, $modaction, $expiration, 0, $reason); + } + + updatemodworks($modaction, $modpostsnum); + foreach($threadlist as $thread) { + modlog($thread, $modaction); + } + + if($sendreasonpm) { + $modactioncode = lang('forum/modaction'); + $modtype = $modaction; + $modaction = $modactioncode[$modaction]; + foreach($threadlist as $thread) { + if($operation == 'move') { + sendreasonpm($thread, 'reason_move', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'tofid' => $toforum['fid'], 'toname' => $toforum['name'], 'from_id' => 0, 'from_idtype' => 'movethread'), 'post'); + } else { + sendreasonpm($thread, 'reason_moderate', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'moderate_'.$modtype), 'post'); + } + } + } + + if($stampstatus) { + set_stamp($stampstatus, $stampaction, $threadlist, $expiration); + } + + $fidarr = array(); + foreach ($threadlist as $thread) { + $fidarr[] = $thread['fid']; + } + C::t('forum_thread')->clear_cache($fidarr, 'forumdisplay_'); + + } + showmessage('admin_succeed', $_G['referer']); + } + +} + +function checkexpiration($expiration, $operation) { + global $_G; + if(!empty($expiration) && in_array($operation, array('recommend', 'stick', 'digest', 'highlight', 'close', 'open', 'bump'))) { + $expiration = strtotime($expiration) - $_G['setting']['timeoffset'] * 3600 + date('Z'); + if(dgmdate($expiration, 'Ymd') <= dgmdate(TIMESTAMP, 'Ymd') || ($expiration > TIMESTAMP + 86400 * 180)) { + showmessage('admin_expiration_invalid', '', array('min'=>dgmdate(TIMESTAMP, 'Y-m-d'), 'max'=>dgmdate(TIMESTAMP + 86400 * 180, 'Y-m-d'))); + } + } else { + $expiration = 0; + } + return $expiration; +} + +function set_stamp($typeid, $stampaction, &$threadlist, $expiration) { + global $_G; + $moderatetids = array_keys($threadlist); + if(empty($threadlist)) { + return false; + } + if(array_key_exists($typeid, $_G['cache']['stamptypeid'])) { + if($stampaction == 'SPD') { + C::t('forum_thread')->update($moderatetids, array('stamp'=>-1), true); + } else { + C::t('forum_thread')->update($moderatetids, array('stamp'=>$_G['cache']['stamptypeid'][$typeid]), true); + } + !empty($moderatetids) && updatemodlog($moderatetids, $stampaction, $expiration, 0, '', $_G['cache']['stamptypeid'][$typeid]); + } +} + +function get_expiration($tid, $action) { + $tid = intval($tid); + if(empty($tid) || empty($action)) { + return ''; + } + $row = C::t('forum_threadmod')->fetch_by_tid_action_status($tid, $action); + return $row['expiration'] ? date('Y-m-d H:i', $row['expiration']) : ''; +} +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_refund.php b/source/include/topicadmin/topicadmin_refund.php new file mode 100644 index 0000000..e3b2371 --- /dev/null +++ b/source/include/topicadmin/topicadmin_refund.php @@ -0,0 +1,70 @@ +count_stc_by_relatedid($_G['tid'], $_G['setting']['creditstransextra'][1]); + $payment['payers'] = intval($payment['payers']); + $payment['income'] = intval($payment['income']); + + include template('forum/topicadmin_action'); + +} else { + + $modaction = 'RFD'; + $modpostsnum ++; + + $reason = checkreasonpm(); + + $totalamount = 0; + $amountarray = array(); + + $logarray = array(); + foreach(C::t('common_credit_log')->fetch_all_by_uid_operation_relatedid(0, 'BTC', $_G['tid']) as $log) { + $amount = abs($log['extcredits'.$_G['setting']['creditstransextra'][1]]); + $totalamount += $amount; + $amountarray[$amount][] = $log['uid']; + } + + updatemembercount($thread['authorid'], array($_G['setting']['creditstransextra'][1] => -$totalamount)); + C::t('forum_thread')->update($_G['tid'], array('price'=>-1, 'moderated'=>1)); + + foreach($amountarray as $amount => $uidarray) { + updatemembercount($uidarray, array($_G['setting']['creditstransextra'][1] => $amount)); + } + + C::t('common_credit_log')->delete_by_operation_relatedid(array('BTC', 'STC'), $_G['tid']); + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_moderate', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modtids' => $thread['tid'], + 'modlog' => $thread + ); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_removereward.php b/source/include/topicadmin/topicadmin_removereward.php new file mode 100644 index 0000000..4b7aba2 --- /dev/null +++ b/source/include/topicadmin/topicadmin_removereward.php @@ -0,0 +1,46 @@ +fetch_by_operation_relatedid('RAC', $thread['tid']); + $answererid = $log['uid']; + if($thread['price'] < 0) { + $thread['price'] = abs($thread['price']); + updatemembercount($answererid, array($_G['setting']['creditstransextra'][2] => -$thread['price'])); + } + + updatemembercount($thread['authorid'], array($_G['setting']['creditstransextra'][2] => $thread['price'])); + C::t('forum_thread')->update($thread['tid'], array('special'=>0, 'price'=>0), true); + + C::t('common_credit_log')->delete_by_operation_relatedid(array('RTC', 'RAC'), $thread['tid']); + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$thread['tid']}", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_remove_reward', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'threadid' => $thread['tid']), + 'modtids' => $thread['tid'] + ); +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_repair.php b/source/include/topicadmin/topicadmin_repair.php new file mode 100644 index 0000000..0283964 --- /dev/null +++ b/source/include/topicadmin/topicadmin_repair.php @@ -0,0 +1,37 @@ +count_visiblepost_by_tid($_G['tid']) - 1; + +$attachcount = C::t('forum_attachment_n')->count_by_id('tid:'.$_G['tid'], 'tid', $_G['tid']); +$attachment = $attachcount ? (C::t('forum_attachment_n')->count_image_by_id('tid:'.$_G['tid'], 'tid', $_G['tid']) ? 2 : 1) : 0; + +$firstpost = C::t('forum_post')->fetch_visiblepost_by_tid('tid:'.$_G['tid'], $_G['tid'], 0); +$firstpost['subject'] = addslashes(cutstr($firstpost['subject'], 79)); +$firstpost['rate'] = intval(abs($firstpost['rate']) ? ($firstpost['rate'] / abs($firstpost['rate'])) : 0); + +$lastpost = C::t('forum_post')->fetch_visiblepost_by_tid('tid:'.$_G['tid'], $_G['tid'], 0, 1); + +C::t('forum_thread')->update($_G['tid'], array('subject'=>$firstpost['subject'], 'replies'=>$replies, 'lastpost'=>$lastpost['dateline'], 'lastposter'=>$lastpost['author'], 'rate'=>$firstpost['rate'], 'attachment'=>$attachment), true); +C::t('forum_post')->update_by_tid('tid:'.$_G['tid'], $_G['tid'], array('first' => 0), true); +C::t('forum_post')->update_post('tid:'.$_G['tid'], $firstpost['pid'], array('first' => 1, 'subject' => $firstpost['subject']), true); + +showmessage('admin_repair_succeed', '', array(), array('alert' => 'right')); + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_restore.php b/source/include/topicadmin/topicadmin_restore.php new file mode 100644 index 0000000..dc52dd3 --- /dev/null +++ b/source/include/topicadmin/topicadmin_restore.php @@ -0,0 +1,47 @@ +insert_thread_copy_by_tid($_G['tid'], $archiveid, 0); + C::t('forum_thread')->delete_by_tid($_G['tid'], false, $archiveid); + + $threadcount = C::t('forum_thread')->count_by_fid($_G['fid'], $archiveid); + if($threadcount) { + C::t('forum_forum_threadtable')->update_threadtable($_G['fid'], $archiveid, array('threads' => $threadcount)); + } else { + C::t('forum_forum_threadtable')->delete_threadtable($_G['fid'], $archiveid); + } + if(!C::t('forum_forum_threadtable')->count_by_fid($_G['fid'])) { + C::t('forum_forum')->update($_G['fid'], array('archive' => 0)); + } + $modaction = 'RST'; + $reason = checkreasonpm(); + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modaction' => $modaction, + 'modlog' => $thread + ); +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_split.php b/source/include/topicadmin/topicadmin_split.php new file mode 100644 index 0000000..ce79b3c --- /dev/null +++ b/source/include/topicadmin/topicadmin_split.php @@ -0,0 +1,116 @@ +fetch_thread($_G['tid']); +$posttableid = $thread['posttableid']; +if(!submitcheck('modsubmit')) { + + require_once libfile('function/discuzcode'); + + $replies = $thread['replies']; + if($replies <= 0) { + showmessage('admin_split_invalid'); + } + + $postlist = array(); + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tableid'], $_G['tid'], 'ASC') as $post) { + $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], sprintf('%00b', $post['htmlon']), $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'], $_G['forum']['allowhtml']); + $postlist[] = $post; + } + include template('forum/topicadmin_action'); + +} else { + + if(!trim($_GET['subject'])) { + showmessage('admin_split_subject_invalid'); + } elseif(!($nos = explode(',', $_GET['split']))) { + showmessage('admin_split_new_invalid'); + } + + sort($nos); + foreach(C::t('forum_post')->fetch_all_by_tid_position($thread['posttableid'], $_G['tid'], $nos) as $post) { + $pids[] = $post['pid']; + } + $pids = is_array($pids) ? $pids : array($pids); + if(!($pids = implode(',',$pids))) { + showmessage('admin_split_new_invalid'); + } + + $modaction = 'SPL'; + + $reason = checkreasonpm(); + + $subject = dhtmlspecialchars($_GET['subject']); + + $newtid = C::t('forum_thread')->insert(array('fid'=>$_G['fid'], 'posttableid'=>$posttableid, 'subject'=>$subject), true); + + C::t('forum_post')->update_post('tid:'.$_G['tid'], explode(',', $pids), array('tid' => $newtid)); + updateattachtid('pid', (array)explode(',', $pids), $_G['tid'], $newtid); + + $splitauthors = array(); + foreach(C::t('forum_post')->fetch_all_visiblepost_by_tid_groupby_authorid('tid:'.$_G['tid'], $newtid) as $splitauthor) { + $splitauthor['subject'] = $subject; + $splitauthors[] = $splitauthor; + } + + C::t('forum_post')->update_post('tid:'.$_G['tid'], $splitauthors[0]['pid'], array('first' => 1, 'subject' => $subject), true); + + $query = C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $_G['tid'], false, 'ASC', 0, 1); + foreach($query as $row) { + $fpost = $row; + } + C::t('forum_thread')->update($_G['tid'], array('author'=>$fpost['author'], 'authorid'=>$fpost['authorid'],'dateline'=>$fpost['dateline'], 'moderated'=>1)); + C::t('forum_post')->update_post('tid:'.$_G['post'], $fpost['pid'], array('first' => 1, 'subject' => $thread['subject'])); + + $query = C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $newtid, false, 'ASC', 0, 1); + foreach($query as $row) { + $fpost = $row; + } + $maxposition = 1; + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $_G['tid'], false, 'ASC') as $row) { + if($row['position'] != $maxposition) { + C::t('forum_post')->update_post('tid:'.$_G['tid'], $row['pid'], array('position' => $maxposition)); + } + $maxposition ++; + } + C::t('forum_thread')->update($_G['tid'], array('maxposition' => $maxposition)); + $maxposition = 1; + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $newtid, false, 'ASC') as $row) { + if($row['position'] != $maxposition) { + C::t('forum_post')->update_post('tid:'.$_G['tid'], $row['pid'], array('position' => $maxposition)); + } + $maxposition ++; + } + C::t('forum_thread')->update($newtid, array('author'=>$fpost['author'], 'authorid'=>$fpost['authorid'], 'dateline'=>$fpost['dateline'], 'rate'=>intval(abs($fpost['rate']) ? ($fpost['rate'] / abs($fpost['rate'])) : 0), 'maxposition' => $maxposition)); + updatethreadcount($_G['tid']); + updatethreadcount($newtid); + updateforumcount($_G['fid']); + + $_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']); + + $modpostsnum++; + $resultarray = array( + 'redirect' => "forum.php?mod=forumdisplay&fid={$_G['fid']}", + 'reasonpm' => ($sendreasonpm ? array('data' => $splitauthors, 'var' => 'thread', 'item' => 'reason_moderate', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modtids' => $thread['tid'].','.$newtid, + 'modlog' => array($thread, array('tid' => $newtid, 'subject' => $subject)) + ); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_stamp.php b/source/include/topicadmin/topicadmin_stamp.php new file mode 100644 index 0000000..8997c5c --- /dev/null +++ b/source/include/topicadmin/topicadmin_stamp.php @@ -0,0 +1,53 @@ +update($_G['tid'], array('moderated'=>1, 'stamp'=>$_GET['stamp'])); + if($modaction == 'SPA' && $_G['cache']['stamps'][$_GET['stamp']]['icon']) { + C::t('forum_thread')->update($_G['tid'], array('icon'=>$_G['cache']['stamps'][$_GET['stamp']]['icon'])); + C::t('forum_threadhidelog')->delete_by_tid($_G['tid']); + } elseif($modaction == 'SPD' && $_G['cache']['stamps'][$thread['stamp']]['icon'] == $thread['icon']) { + C::t('forum_thread')->update($_G['tid'], array('icon'=>-1)); + } + + C::t('common_member_secwhite')->add($thread['authorid']); + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'notictype' => 'post', 'item' => $_GET['stamp'] !== '' ? 'reason_stamp_update' : 'reason_stamp_delete') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'stamp' => $_G['cache']['stamps'][$stamp]['text']), + 'modaction' => $modaction, + 'modlog' => $thread + ); + $modpostsnum = 1; + + updatemodlog($_G['tid'], $modaction, 0, 0, '', $modaction == 'SPA' ? $_GET['stamp'] : 0); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_stamplist.php b/source/include/topicadmin/topicadmin_stamplist.php new file mode 100644 index 0000000..084789c --- /dev/null +++ b/source/include/topicadmin/topicadmin_stamplist.php @@ -0,0 +1,44 @@ += 0 ? 'L'.sprintf('%02d', $_GET['stamplist']) : 'SLD'; + $reason = checkreasonpm(); + + C::t('forum_thread')->update($_G['tid'], array('moderated'=>1, 'icon'=>$_GET['stamplist'])); + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'notictype' => 'post', 'item' => $_GET['stamplist'] !== '' ? 'reason_stamplist_update' : 'reason_stamplist_delete') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'stamp' => $_G['cache']['stamps'][$_GET['stamplist']]['text']), + 'modaction' => $modaction, + 'modlog' => $thread + ); + $modpostsnum = 1; + + updatemodlog($_G['tid'], $modaction); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_stickreply.php b/source/include/topicadmin/topicadmin_stickreply.php new file mode 100644 index 0000000..a45c52b --- /dev/null +++ b/source/include/topicadmin/topicadmin_stickreply.php @@ -0,0 +1,82 @@ +fetch_post('tid:'.$_G['tid'], $pid, false); + $authorids[] = array('authorid' => $post['authorid']); + $sticktopiclist[$pid] = $post['position']; +} + +if(!submitcheck('modsubmit')) { + + $stickpid = ''; + foreach($sticktopiclist as $id => $postnum) { + $stickpid .= ''; + } + + include template('forum/topicadmin_action'); + +} else { + + if($_GET['stickreply']) { + foreach($sticktopiclist as $pid => $postnum) { + $post = C::t('forum_post')->fetch_all_by_pid('tid:'.$_G['tid'], $pid, false); + if($post[$pid]['tid'] != $_G['tid']) { + continue; + } + C::t('forum_poststick')->insert(array( + 'tid' => $_G['tid'], + 'pid' => $pid, + 'position' => $postnum, + 'dateline' => $_G['timestamp'], + ), false, true); + } + } else { + foreach($sticktopiclist as $pid => $postnum) { + C::t('forum_poststick')->delete_stick($_G['tid'], $pid); + } + } + + $sticknum = C::t('forum_poststick')->count_by_tid($_G['tid']); + $stickreply = intval($_GET['stickreply']); + + if($sticknum == 0 || $stickreply == 1) { + C::t('forum_thread')->update($_G['tid'], array('moderated'=>1, 'stickreply'=>$stickreply)); + } + + $modaction = $_GET['stickreply'] ? 'SRE' : 'USR'; + $reason = checkreasonpm(); + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => $authorids, 'var' => 'post', 'notictype' => 'post', 'item' => $_GET['stickreply'] ? 'reason_stickreply': 'reason_stickdeletereply') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), + 'modlog' => $thread + ); + +} + +?> \ No newline at end of file diff --git a/source/include/topicadmin/topicadmin_warn.php b/source/include/topicadmin/topicadmin_warn.php new file mode 100644 index 0000000..661b4cc --- /dev/null +++ b/source/include/topicadmin/topicadmin_warn.php @@ -0,0 +1,131 @@ +fetch_all_post('tid:'.$_G['tid'], $topiclist); +foreach($postlist as $post) { + $uids[] = $post['authorid']; +} +$memberlist = C::t('common_member')->fetch_all($uids); +foreach($postlist as $post) { + if($post['tid'] != $_G['tid']) { + continue; + } + $post['adminid'] = $memberlist[$post['authorid']]['adminid']; + if($_G['adminid'] == 1 && $post['adminid'] != 1 || + $_G['adminid'] == 2 && !in_array($post['adminid'], array(1, 2)) || + $_G['adminid'] == 3 && in_array($post['adminid'], array(0, -1))) { + $warnstatus = ($post['status'] & 2) || $warnstatus; + $authors[$post['authorid']] = 1; + $posts[] = $post; + } +} +unset($memberlist, $postlist, $uids); + +if(!$posts) { + showmessage('admin_warn_nopermission'); +} +$authorcount = count(array_keys($authors)); +$modpostsnum = count($posts); + +if($modpostsnum == 1 || $authorcount == 1) { + $authorwarnings = C::t('forum_warning')->count_by_authorid_dateline($posts[0]['authorid']); + $warningauthor = $posts[0]['author']; +} + +if(!submitcheck('modsubmit')) { + + $warnpid = $checkunwarn = $checkwarn = ''; + foreach($topiclist as $id) { + $warnpid .= ''; + } + + $warnstatus ? $checkunwarn = 'checked="checked"' : $checkwarn = 'checked="checked"'; + + include template('forum/topicadmin_action'); + +} else { + + $warned = intval($_GET['warned']); + $modaction = $warned ? 'WRN' : 'UWN'; + + $reason = checkreasonpm(); + + include_once libfile('function/member'); + + $pids = $comma = ''; + foreach($posts as $k => $post) { + if($warned && !($post['status'] & 2)) { + C::t('forum_post')->increase_status_by_pid('tid:'.$_G['tid'], $post['pid'], 2, '|', true); + $reason = dhtmlspecialchars($_GET['reason']); + C::t('forum_warning')->insert(array( + 'pid' => $post['pid'], + 'operatorid' => $_G['uid'], + 'operator' => $_G['username'], + 'authorid' => $post['authorid'], + 'author' => $post['author'], + 'dateline' => $_G['timestamp'], + 'reason' => $reason, + )); + $authorwarnings = C::t('forum_warning')->count_by_authorid_dateline($post['authorid'], $_G['timestamp'] - $_G['setting']['warningexpiration'] * 86400); + if($authorwarnings >= $_G['setting']['warninglimit']) { + $member = getuserbyuid($post['authorid']); + $memberfieldforum = C::t('common_member_field_forum')->fetch($post['authorid']); + $groupterms = dunserialize($memberfieldforum['groupterms']); + unset($memberfieldforum); + if($member && $member['groupid'] != 4) { + $banexpiry = TIMESTAMP + $_G['setting']['warningexpiration'] * 86400; + $groupterms['main'] = array('time' => $banexpiry, 'adminid' => $member['adminid'], 'groupid' => $member['groupid']); + $groupterms['ext'][4] = $banexpiry; + C::t('common_member')->update($post['authorid'], array('groupid' => 4, 'adminid' => -1, 'groupexpiry' => groupexpiry($groupterms))); + C::t('common_member_field_forum')->update($post['authorid'], array('groupterms' => serialize($groupterms))); + } + } + $pids .= $comma.$post['pid']; + $comma = ','; + + crime('recordaction', $post['authorid'], 'crime_warnpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $_G['tid'], 'pid' => $post['pid']))); + + } elseif(!$warned && ($post['status'] & 2)) { + C::t('forum_post')->increase_status_by_pid('tid:'.$_G['tid'], $post['pid'], 2, '^', true); + C::t('forum_warning')->delete_by_pid($post['pid']); + $pids .= $comma.$post['pid']; + $comma = ','; + } + } + + $resultarray = array( + 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", + 'reasonpm' => ($sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_warn_post', 'notictype' => 'post') : array()), + 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, + 'warningexpiration' => $_G['setting']['warningexpiration'], 'warninglimit' => $_G['setting']['warninglimit'], 'warningexpiration' => $_G['setting']['warningexpiration'], + 'authorwarnings' => $authorwarnings), + 'modtids' => 0, + 'modlog' => $thread + ); + +} + +?> \ No newline at end of file diff --git a/source/index.htm b/source/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/language/adv/index.htm b/source/language/adv/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/adv/lang_article.php b/source/language/adv/lang_article.php new file mode 100644 index 0000000..97a3b35 --- /dev/null +++ b/source/language/adv/lang_article.php @@ -0,0 +1,27 @@ + '门户 文章广告', + 'article_desc' => '展现方式: 文章广告显示于文章页面,分为内容区域环绕广告和相关阅读上方广告 2 种。', + 'article_position' => '投放位置', + 'article_position_comment' => '分为 3 个位置,其中相关阅读上方广告有 2 个紧邻的显示位置', + 'article_position_float' => '内容区域环绕', + 'article_position_up' => '相关阅读上方(上)', + 'article_position_down' => '相关阅读上方(下)', + 'article_category' => '投放频道分类', + 'article_category_comment' => '设置广告投放的频道分类', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_articlelist.php b/source/language/adv/lang_articlelist.php new file mode 100644 index 0000000..6ed06ca --- /dev/null +++ b/source/language/adv/lang_articlelist.php @@ -0,0 +1,28 @@ + '门户 文章列表广告', + 'articlelist_desc' => '展现方式: 文章广告显示于频道文章分类的文章列表页面,分为顶部、底部 2 个投放位置。', + 'articlelist_position' => '投放位置', + 'articlelist_position_comment' => '分为 4 个位置,上下各有 2 个紧邻的显示位置', + 'articlelist_position_up1' => '顶部(上)', + 'articlelist_position_up2' => '顶部(下)', + 'articlelist_position_down1' => '底部(上)', + 'articlelist_position_down2' => '底部(下)', + 'articlelist_category' => '投放频道分类', + 'articlelist_category_comment' => '设置广告投放的频道分类', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_blog.php b/source/language/adv/lang_blog.php new file mode 100644 index 0000000..3ffede6 --- /dev/null +++ b/source/language/adv/lang_blog.php @@ -0,0 +1,20 @@ + '空间 日志广告', + 'blog_desc' => '展现方式: 日志广告显示于日志右方。', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_cornerbanner.php b/source/language/adv/lang_cornerbanner.php new file mode 100644 index 0000000..faba8a8 --- /dev/null +++ b/source/language/adv/lang_cornerbanner.php @@ -0,0 +1,33 @@ + '全局 右下角广告', + 'cornerbanner_desc' => '展现方式: 显示于页面右下角。当前页面有多个页头通栏广告时,系统会随机选取其中之一显示。
          价值分析: 由于能够在页面的明显位置展现,因此成为了网页中价位最高、最适合进行商业宣传或品牌推广的广告类型之一。', + 'cornerbanner_index' => '首页', + 'cornerbanner_fids' => '投放版块', + 'cornerbanner_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'cornerbanner_groups' => '投放圈子分类', + 'cornerbanner_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'cornerbanner_animator' => '动画效果', + 'cornerbanner_animator_comment' => '设置展现时是否显示动画效果', + 'cornerbanner_category' => '投放门户频道', + 'cornerbanner_category_comment' => '设置广告投放的频道分类,当广告投放范围中包含“门户”时有效', + 'cornerbanner_disableclose' => '关闭广告的链接', + 'cornerbanner_disableclose_comment' => '如果广告代码中已内置关闭操作,可以关闭系统预置的关闭链接', + 'cornerbanner_show' => '显示', + 'cornerbanner_hidden' => '隐藏', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_couplebanner.php b/source/language/adv/lang_couplebanner.php new file mode 100644 index 0000000..152dbf7 --- /dev/null +++ b/source/language/adv/lang_couplebanner.php @@ -0,0 +1,37 @@ + '全局 对联广告', + 'couplebanner_desc' => '展现方式: 对联广告以长方形图片的形式显示于页面顶部两侧,形似一幅对联,通常使用宽小高大的长方形图片或 Flash 的形式。对联广告一般只在使用像素约定主表格宽度的情况下使用,如使用超过 90% 以上的百分比约定主表格宽度时,可能会影响访问者的正常浏览。当访问者浏览器宽度小于 800 像素时,自动不显示此类广告。当前页面有多个对联广告时,系统会随机选取其中之一显示。
          价值分析: 对联广告由于只展现于高分辨率(1024x768 或更高)屏幕的两侧,只占用页面的空白区域,因此不会招致访问者反感,能够良好的突出推广内容。但由于对分辨率和主表格宽度的特殊要求,使得广告的受众比例无法达到 100%。', + 'couplebanner_index' => '首页', + 'couplebanner_fids' => '投放版块', + 'couplebanner_fids_comment' => '设置广告投放的论坛版块', + 'couplebanner_groups' => '投放圈子分类', + 'couplebanner_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'couplebanner_position' => '对联位置', + 'couplebanner_position_comment' => '设置广告对联的位置', + 'couplebanner_position_left' => '左侧', + 'couplebanner_position_right' => '右侧', + 'couplebanner_coupleadid' => '上/下联广告', + 'couplebanner_coupleadid_comment' => '设置和当前广告配对的上/下联广告', + 'couplebanner_category' => '投放门户频道', + 'couplebanner_category_comment' => '设置广告投放的频道分类,当广告投放范围中包含“门户”时有效', + 'couplebanner_disableclose' => '关闭广告的链接', + 'couplebanner_disableclose_comment' => '如果广告代码中已内置关闭操作,可以关闭系统预置的关闭链接', + 'couplebanner_show' => '显示', + 'couplebanner_hidden' => '隐藏', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_custom.php b/source/language/adv/lang_custom.php new file mode 100644 index 0000000..e78c806 --- /dev/null +++ b/source/language/adv/lang_custom.php @@ -0,0 +1,25 @@ + '自定义广告', + 'custom_desc' => '通过在模版、HTML 文件中添加广告代码,可以在站点的任意页面添加广告。适用于懂得简单 HTML 知识的站长。

          + 内部调用  + 外部调用', + 'custom_id_notfound' => '自定义广告不存在', + 'custom_codelink' => '内部调用', + 'custom_text' => '自定义广告', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_feed.php b/source/language/adv/lang_feed.php new file mode 100644 index 0000000..9697cb6 --- /dev/null +++ b/source/language/adv/lang_feed.php @@ -0,0 +1,20 @@ + '空间 动态广告', + 'feed_desc' => '展现方式: 日志广告显示于动态的上方。', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_float.php b/source/language/adv/lang_float.php new file mode 100644 index 0000000..672a8e3 --- /dev/null +++ b/source/language/adv/lang_float.php @@ -0,0 +1,35 @@ + '全局 漂浮广告', + 'float_desc' => '展现方式: 漂浮广告展现于页面左下角,当页面滚动时广告会自行移动以保持原来的位置,通常使用小图片或 Flash 的形式。当前页面有多个漂浮广告时,系统会随机选取其中之一显示。
          价值分析: 漂浮广告是进行强力商业推广的有效手段,其在页面中的浮动性,使其与固定的图片和文字相比,更容易被关注,正因为如此,这种强制性的关注也可能招致对此广告内容不感兴趣的访问者的反感。请注意不要将过大的图片或 Flash 以漂浮广告的形式显示,以免影响页面阅读。', + 'float_index' => '首页', + 'float_fids' => '投放版块', + 'float_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'float_groups' => '投放圈子分类', + 'float_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'float_position' => '漂浮位置', + 'float_position_comment' => '设置广告漂浮的位置', + 'float_position_left' => '左侧', + 'float_position_right' => '右侧', + 'float_category' => '投放门户频道', + 'float_category_comment' => '设置广告投放的频道分类,当广告投放范围中包含“门户”时有效', + 'float_disableclose' => '关闭广告的链接', + 'float_disableclose_comment' => '如果广告代码中已内置关闭操作,可以关闭系统预置的关闭链接', + 'float_show' => '显示', + 'float_hidden' => '隐藏', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_footerbanner.php b/source/language/adv/lang_footerbanner.php new file mode 100644 index 0000000..374160d --- /dev/null +++ b/source/language/adv/lang_footerbanner.php @@ -0,0 +1,32 @@ + '全局 页尾通栏广告', + 'footerbanner_desc' => '展现方式: 页尾通栏广告显示于页面下方,通常使用 960x60 或其他尺寸图片、Flash 的形式。当前页面有多个页尾通栏广告时,系统会随机选取其中之一显示。
          价值分析: 与页面头部和中部相比,页面尾部的展现机率相对较低,通常不会引起访问者的反感,同时又基本能够覆盖所有对广告内容感兴趣的受众,因此适合中性而温和的推广。', + 'footerbanner_index' => '首页', + 'footerbanner_fids' => '投放版块', + 'footerbanner_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'footerbanner_groups' => '投放圈子分类', + 'footerbanner_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'footerbanner_position' => '投放位置', + 'footerbanner_position_comment' => '分为上中下 3 个位置,当上面的广告到期或被删除,下面的广告会自动上移', + 'footerbanner_position_up' => '上', + 'footerbanner_position_middle' => '中', + 'footerbanner_position_down' => '下', + 'footerbanner_category' => '投放门户频道', + 'footerbanner_category_comment' => '设置广告投放的频道分类,当广告投放范围中包含“门户”时有效', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_headerbanner.php b/source/language/adv/lang_headerbanner.php new file mode 100644 index 0000000..b0a305c --- /dev/null +++ b/source/language/adv/lang_headerbanner.php @@ -0,0 +1,27 @@ + '全局 页头通栏广告', + 'headerbanner_desc' => '展现方式: 页头通栏广告显示于页面上方,通常使用 960x60 图片或 Flash 的形式。当前页面有多个页头通栏广告时,系统会随机选取其中之一显示。
          价值分析: 由于能够在页面打开的第一时间将广告内容展现于最醒目的位置,因此成为了网页中价位最高、最适合进行商业宣传或品牌推广的广告类型之一。', + 'headerbanner_index' => '首页', + 'headerbanner_fids' => '投放版块', + 'headerbanner_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'headerbanner_groups' => '投放圈子分类', + 'headerbanner_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'headerbanner_category' => '投放门户频道', + 'headerbanner_category_comment' => '设置广告投放的频道分类,当广告投放范围中包含“门户”时有效', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_intercat.php b/source/language/adv/lang_intercat.php new file mode 100644 index 0000000..687bab1 --- /dev/null +++ b/source/language/adv/lang_intercat.php @@ -0,0 +1,26 @@ + '论坛 分类间广告', + 'intercat_desc' => '展现方式: 论坛分类间广告显示于版块列表相邻的两个版块分类之间,可使用 960x60 或其他尺寸图片和 Flash 的形式。当前页面有多个分类间广告时,系统会从中抽取与版块分类数相等的条目进行随机显示。
          价值分析:由于出现在版块列表页比较明显的位置,广告展示效果较好,但是过多过大的广告可能会招致访问者反感。 ', + 'intercat_fids' => '投放分区', + 'intercat_fids_comment' => '设置广告投放的版块分区', + 'intercat_position' => '投放位置', + 'intercat_position_comment' => '设置广告在哪个分区的下方显示', + 'intercat_position_random' => '所有位置随机', + 'intercat_position_fav' => '收藏栏', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_interthread.php b/source/language/adv/lang_interthread.php new file mode 100644 index 0000000..62ee86c --- /dev/null +++ b/source/language/adv/lang_interthread.php @@ -0,0 +1,26 @@ + '论坛/圈子 帖间通栏广告', + 'interthread_desc' => '展现方式: 帖间通栏广告显示于主题帖和第一个回帖之间,可使用 468x60 或其他尺寸图片和 Flash 的形式。
          当前页面有多个帖间通栏广告时,系统会随机选取其中之一显示。价值分析: 由于能够将主题与回帖分开,广告尺寸大而且不影响文章内容,因此不会招致文章作者及访问者反感,适合在帖内进行商业宣传或品牌推广。', + 'interthread_fids' => '投放版块', + 'interthread_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'interthread_groups' => '投放圈子分类', + 'interthread_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'interthread_pnumber' => '广告显示楼层', + 'interthread_pnumber_comment' => '选项 #1 #2 #3 ... 表示文章楼层,可以按住 CTRL 多选,默认只投放 1 楼', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_search.php b/source/language/adv/lang_search.php new file mode 100644 index 0000000..7252627 --- /dev/null +++ b/source/language/adv/lang_search.php @@ -0,0 +1,20 @@ + '搜索 右侧广告', + 'search_desc' => '展现方式: 搜索右侧广告展现于搜索结果页右侧。', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_subnavbanner.php b/source/language/adv/lang_subnavbanner.php new file mode 100644 index 0000000..52e1cd1 --- /dev/null +++ b/source/language/adv/lang_subnavbanner.php @@ -0,0 +1,27 @@ + '全局 页头二级导航栏广告', + 'subnavbanner_desc' => '展现方式: 页头二级导航栏广告显示于页面上方,通常使用 960x60 图片或 Flash 的形式。当前页面有多个通栏广告时,系统会随机选取其中之一显示。
          价值分析: 由于能够在页面打开的第一时间将广告内容展现于最醒目的位置,因此成为了网页中价位最高、最适合进行商业宣传或品牌推广的广告类型之一。', + 'subnavbanner_index' => '首页', + 'subnavbanner_fids' => '投放版块', + 'subnavbanner_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'subnavbanner_groups' => '投放圈子分类', + 'subnavbanner_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'subnavbanner_category' => '投放门户频道', + 'subnavbanner_category_comment' => '设置广告投放的频道分类,当广告投放范围中包含“门户”时有效', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_text.php b/source/language/adv/lang_text.php new file mode 100644 index 0000000..a6a136f --- /dev/null +++ b/source/language/adv/lang_text.php @@ -0,0 +1,27 @@ + '门户/论坛/圈子/空间 格子广告', + 'text_desc' => '展现方式: 页内文字广告以表格的形式,显示于论坛、圈子页面的中上方,通常使用文字的形式,也可使用小图片和 Flash。当前页面有多个文字广告时,系统会以表格的形式按照设定的显示顺序全部展现,同时能够对表格列数在 3~5 的范围内动态排布,以自动实现最佳的广告排列效果。
          价值分析: 由于此类广告通常以文字形式展现,但其所在的较靠上的页面位置,使得此类广告成为了访问者必读的内容之一。同一页面可以呈现多达十几条文字广告的特性,也决定了它是一种平民化但性价比较高的推广方式,同时还可用于论坛自身的宣传和公告之用。', + 'text_index' => '首页', + 'text_fids' => '投放版块', + 'text_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'text_groups' => '投放圈子分类', + 'text_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'text_category' => '投放频道分类', + 'text_category_comment' => '设置广告投放的频道分类', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_thread.php b/source/language/adv/lang_thread.php new file mode 100644 index 0000000..9126da1 --- /dev/null +++ b/source/language/adv/lang_thread.php @@ -0,0 +1,32 @@ + '论坛/圈子 帖内广告', + 'thread_desc' => '展现方式: 帖内广告显示于文章内容的上方、下方或右方,文章内容的上方和下方通常使用文字的形式,文章内容右方通常使用图片的形式。当前页面有多个帖内广告时,系统会从中抽取与每页帖数相等的条目进行随机显示。您可以在 全局设置中的其他设置中修改每帖显示的广告数量。
          价值分析: 由于文章是论坛最核心的组成部分,嵌入文章内容内部的帖内广告,便可在用户浏览文章内容时自然的被接受,加上随机播放的特性,适合于特定内容的有效推广,也可用于论坛自身的宣传和公告之用。建议设置多条帖内广告以实现广告内容的差异化,从而吸引更多访问者的注意力。', + 'thread_fids' => '投放版块', + 'thread_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'thread_groups' => '投放圈子分类', + 'thread_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'thread_position' => '投放位置', + 'thread_position_comment' => '文章内容上方和下方的广告适合使用文字形式,而文章右侧广告适合使用图片或 Flash 形式,也可以同时显示多条文字广告', + 'thread_position_bottom' => '文章下方', + 'thread_position_top' => '文章上方', + 'thread_position_right' => '文章右侧', + 'thread_pnumber' => '广告显示楼层', + 'thread_pnumber_comment' => '选项 #1 #2 #3 ... 表示文章楼层,可以按住 CTRL 多选', + 'thread_pnumber_all' => '全部', +); + +?> \ No newline at end of file diff --git a/source/language/adv/lang_threadlist.php b/source/language/adv/lang_threadlist.php new file mode 100644 index 0000000..5809671 --- /dev/null +++ b/source/language/adv/lang_threadlist.php @@ -0,0 +1,33 @@ + '论坛/圈子 文章列表帖位广告', + 'threadlist_desc' => '展现方式: 帖位广告显示于文章列表页第一页的文章位置,可以模拟出一个具有广告意义的文章地址,吸引访问者的注意力。', + 'threadlist_fids' => '投放版块', + 'threadlist_fids_comment' => '设置广告投放的论坛版块,当广告投放范围中包含“论坛”时有效', + 'threadlist_groups' => '投放圈子分类', + 'threadlist_groups_comment' => '设置广告投放的圈子分类,当广告投放范围中包含“圈子”时有效', + 'threadlist_pos' => '投放位置', + 'threadlist_pos_comment' => '设置在主题列表的第几个主题位置显示此广告,如不指定则将随机位置显示', + 'threadlist_mode' => '显示模式', + 'threadlist_mode_comment' => '自由模式,占用主题列表的全部列宽显示本广告
          主题模式,把广告模拟成一个主题,点击广告后跳转到指定的主题', + 'threadlist_mode_0' => '自由模式', + 'threadlist_mode_1' => '主题模式', + 'threadlist_tid' => '主题模式指定主题 tid', + 'threadlist_threadurl' => '主题模式自定义主题 URL', + 'threadlist_threadurl_comment' => '留空表示使用指定主题的 URL', +); + +?> \ No newline at end of file diff --git a/source/language/block/index.htm b/source/language/block/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/block/lang_activitylist.php b/source/language/block/lang_activitylist.php new file mode 100644 index 0000000..554cf65 --- /dev/null +++ b/source/language/block/lang_activitylist.php @@ -0,0 +1,102 @@ + '所在版块', + 'activitylist_fids_comment' => '设置允许参与新帖调用的版块,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'activitylist_uids' => '发起者UID', + 'activitylist_uids_comment' => '设置活动发起者UID,多个UID请用半角逗号“,”隔开。', + 'activitylist_startrow' => '起始数据行数', + 'activitylist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'activitylist_items' => '显示数据条数', + 'activitylist_items_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'activitylist_titlelength' => '标题最大字节数', + 'activitylist_titlelength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'activitylist_fnamelength' => '标题最大字节数包含版块名称', + 'activitylist_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'activitylist_summarylength' => '主题简短内容文字数', + 'activitylist_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'activitylist_tids' => '指定主题', + 'activitylist_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'activitylist_keyword' => '标题关键字', + 'activitylist_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'activitylist_typeids' => '主题分类', + 'activitylist_typeids_comment' => '设置特定分类的主题。注意: 全选或全不选均为不进行任何过滤', + 'activitylist_typeids_all' => '全部的主题分类', + 'activitylist_sortids' => '分类信息', + 'activitylist_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'activitylist_sortids_all' => '全部的分类信息', + 'activitylist_digest' => '精华主题过滤', + 'activitylist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'activitylist_digest_0' => '普通主题', + 'activitylist_digest_1' => '精华 I', + 'activitylist_digest_2' => '精华 II', + 'activitylist_digest_3' => '精华 III', + 'activitylist_stick' => '置顶主题过滤', + 'activitylist_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'activitylist_stick_0' => '普通主题', + 'activitylist_stick_1' => '置顶 I', + 'activitylist_stick_2' => '置顶 II', + 'activitylist_stick_3' => '置顶 III', + 'activitylist_special' => '特殊主题过滤', + 'activitylist_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'activitylist_special_1' => '投票主题', + 'activitylist_special_2' => '商品主题', + 'activitylist_special_3' => '悬赏主题', + 'activitylist_special_4' => '活动主题', + 'activitylist_special_5' => '辩论主题', + 'activitylist_special_0' => '普通主题', + 'activitylist_special_reward' => '悬赏主题过滤', + 'activitylist_special_reward_comment' => '设置特定类型的悬赏主题', + 'activitylist_special_reward_0' => '全部', + 'activitylist_special_reward_1' => '已解决', + 'activitylist_special_reward_2' => '未解决', + 'activitylist_recommend' => '推荐主题过滤', + 'activitylist_recommend_comment' => '设置是否只显示推荐的主题', + 'activitylist_orderby' => '主题排序方式', + 'activitylist_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'activitylist_orderby_lastpost' => '按最后回复时间倒序排序', + 'activitylist_orderby_dateline' => '按发布时间倒序排序', + 'activitylist_orderby_replies' => '按回复数倒序排序', + 'activitylist_orderby_views' => '按浏览次数倒序排序', + 'activitylist_orderby_heats' => '按热度倒序排序', + 'activitylist_orderby_recommends' => '按主题评价倒序排序', + 'activitylist_orderby_hourviews' => '按指定时间内浏览次数倒序排序', + 'activitylist_orderby_todayviews' => '按当天浏览次数倒序排序', + 'activitylist_orderby_weekviews' => '按本周浏览次数倒序排序', + 'activitylist_orderby_monthviews' => '按当月浏览次数倒序排序', + 'activitylist_orderby_hours' => '指定时间(小时)', + 'activitylist_orderby_hours_comment' => '指定时间内浏览次数倒序排序的时间值', + 'activitylist_orderby_todayhots' => '按当天累计售出数倒序排序', + 'activitylist_orderby_weekhots' => '按本周累计售出数倒序排序', + 'activitylist_orderby_monthhots' => '按当月累计售出数倒序排序', + 'activitylist_price_add' => ' 附加 ', + 'activitylist_place' => '活动地点', + 'activitylist_class' => '活动类型', + 'activitylist_class_all' => '所有类型', + 'activitylist_gender' => '性别要求', + 'activitylist_gender_0' => '不限', + 'activitylist_gender_1' => '男', + 'activitylist_gender_2' => '女', + 'activitylist_orderby_weekstart' => '按一周内活动开始时间排序', + 'activitylist_orderby_monthstart' => '按一月内活动开始时间排序', + 'activitylist_orderby_weekexp' => '按一周内报名截止时间排序', + 'activitylist_orderby_monthexp' => '按一月内报名截止时间排序', + 'activitylist_orderby_weekhot' => '按一周内已参加人数排序', + 'activitylist_orderby_monthhot' => '按一月内已参加人数排序', + 'activitylist_orderby_alltimehot' => '按所有未结束活动已参加人数排序', + 'activitylist_highlight' => '获得高亮值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_adv.php b/source/language/block/lang_adv.php new file mode 100644 index 0000000..32ada13 --- /dev/null +++ b/source/language/block/lang_adv.php @@ -0,0 +1,19 @@ + '或者输入名称', + 'adv_adv' => '选择广告', +); +?> \ No newline at end of file diff --git a/source/language/block/lang_albumlist.php b/source/language/block/lang_albumlist.php new file mode 100644 index 0000000..fd2b377 --- /dev/null +++ b/source/language/block/lang_albumlist.php @@ -0,0 +1,33 @@ + '指定相册', + 'albumlist_aids_comment' => '填入指定相册的ID(aid),多个相册之间用逗号(,)分隔', + 'albumlist_uids' => '用户UID', + 'albumlist_uids_comment' => '填入指定用户的ID(uid),多个用户之间用逗号(,)分隔', + 'albumlist_catid' => '指定分类', + 'albumlist_catid_comment' => '选择相册所属的系统相册分类,可多选', + 'albumlist_startrow' => '起始数据行数', + 'albumlist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'albumlist_titlelength' => '标题长度', + 'albumlist_titlelength_comment' => '指定相册名称最大长度', + 'albumlist_orderby' => '图片排序方式', + 'albumlist_orderby_comment' => '设置以哪一字段或方式对图片进行排序', + 'albumlist_orderby_dateline' => '按发布时间倒序', + 'albumlist_orderby_picnum' => '按照片数倒序', + 'albumlist_orderby_updatetime' => '按更新时间倒序' +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_announcement.php b/source/language/block/lang_announcement.php new file mode 100644 index 0000000..2937ad2 --- /dev/null +++ b/source/language/block/lang_announcement.php @@ -0,0 +1,23 @@ + '公告类型', + 'announcement_type_text' => '文字公告', + 'announcement_type_link' => '网站链接', + 'announcement_titlelength' => '标题长度', + 'announcement_summarylength' => '内容长度', + 'announcement_startrow' => '起始位置', +); +?> \ No newline at end of file diff --git a/source/language/block/lang_articlelist.php b/source/language/block/lang_articlelist.php new file mode 100644 index 0000000..5ae058a --- /dev/null +++ b/source/language/block/lang_articlelist.php @@ -0,0 +1,52 @@ + '指定文章', + 'articlelist_aids_comment' => '填入指定文章的ID(aid),多篇文章之间用逗号(,)分隔', + 'articlelist_uids' => '作者UID', + 'articlelist_uids_comment' => '填入指定用户的ID(uid),多个用户之间用逗号(,)分隔', + 'articlelist_startrow' => '起始数据行数', + 'articlelist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'articlelist_tag' => '聚合标签', + 'articlelist_tag_comment' => '指定要聚合的标签', + 'articlelist_titlelength' => '标题长度', + 'articlelist_titlelength_comment' => '设置标题最大长度', + 'articlelist_summarylength' => '简介长度', + 'articlelist_summarylength_comment' => '设置简介最大长度', + 'articlelist_starttime' => '发布时间-起始', + 'articlelist_starttime_comment' => '文章的发布时间在指定时间之后', + 'articlelist_endtime' => '发布时间-结束', + 'articlelist_endtime_comment' => '文章的发布时间在指定时间之前', + 'articlelist_catid' => '文章栏目', + 'articlelist_catid_comment' => '选择文章所属栏目', + 'articlelist_picrequired' => '过滤无封面文章', + 'articlelist_picrequired_comment' => '是否过滤未设置封面图片的文章', + 'articlelist_orderby' => '文章排序方式', + 'articlelist_orderby_comment' => '设置以哪一字段或方式对文章进行排序', + 'articlelist_orderby_dateline' => '按发布时间倒序', + 'articlelist_orderby_viewnum' => '按查看数倒序', + 'articlelist_orderby_commentnum' => '按评论数倒序', + 'articlelist_orderby_click' => '按表态 {clickname} 数倒序', + 'articlelist_publishdateline' => '文章发布时间', + 'articlelist_publishdateline_nolimit' => '不限制', + 'articlelist_publishdateline_hour' => '1小时内', + 'articlelist_publishdateline_day' => '24小时内', + 'articlelist_publishdateline_week' => '7天内', + 'articlelist_publishdateline_month' => '1个月内', + 'articlelist_keyword' => '标题关键字', + 'articlelist_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_attachmentlist.php b/source/language/block/lang_attachmentlist.php new file mode 100644 index 0000000..22b1c6b --- /dev/null +++ b/source/language/block/lang_attachmentlist.php @@ -0,0 +1,65 @@ + '论坛附件列表', + 'attachmentlist_desc' => '论坛附件列表调用', + 'attachmentlist_fids' => '所在版块', + 'attachmentlist_fids_comment' => '设置允许参与图片调用的版块,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'attachmentlist_tids' => '指定主题', + 'attachmentlist_tids_comment' => '指定主题ID,多个ID之间用逗号分隔', + 'attachmentlist_startrow' => '起始数据行数', + 'attachmentlist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'attachmentlist_items' => '显示数据条数', + 'attachmentlist_items_comment' => '设置一次显示的图片主题条目数,请设置为大于 0 的整数', + 'attachmentlist_titlelength' => '标题长度', + 'attachmentlist_titlelength_comment' => '设置当附件名称/文章标题显示的最大长度', + 'attachmentlist_summarylength' => '内容长度', + 'attachmentlist_summarylength_comment' => '设置附件介绍/文章内容显示的最大长度', + 'attachmentlist_maxwidth' => '图片最大宽度(像素)', + 'attachmentlist_maxwidth_comment' => '设置是否自动缩小或放大图片的尺寸到本设定的宽度,0 为不自动缩放', + 'attachmentlist_maxheight' => '图片最大高度(像素)', + 'attachmentlist_maxheight_comment' => '设置是否自动缩小或放大图片的尺寸到本设定的高度,0 为不自动缩放', + 'attachmentlist_threadmethod' => '主题方式调用', + 'attachmentlist_threadmethod_comment' => '选择“是”将按照主题方式调用附件,一个主题显示一个附件;选择“否”将按照附件方式调用', + 'attachmentlist_digest' => '精华帖过滤', + 'attachmentlist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'attachmentlist_digest_0' => '普通主题', + 'attachmentlist_digest_1' => '精华 I', + 'attachmentlist_digest_2' => '精华 II', + 'attachmentlist_digest_3' => '精华 III', + 'attachmentlist_special' => '特殊主题过滤', + 'attachmentlist_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'attachmentlist_special_1' => '投票主题', + 'attachmentlist_special_2' => '商品主题', + 'attachmentlist_special_3' => '悬赏主题', + 'attachmentlist_special_4' => '活动主题', + 'attachmentlist_special_5' => '辩论主题', + 'attachmentlist_special_0' => '普通主题', + 'attachmentlist_special_reward' => '悬赏主题过滤', + 'attachmentlist_special_reward_comment' => '设置特定类型的悬赏主题', + 'attachmentlist_special_reward_0' => '全部', + 'attachmentlist_special_reward_1' => '已解决', + 'attachmentlist_special_reward_2' => '未解决', + 'attachmentlist_dateline' => '附件上传时间', + 'attachmentlist_dateline_nolimit' => '不限制', + 'attachmentlist_dateline_hour' => '最近1小时', + 'attachmentlist_dateline_day' => '最近24小时', + 'attachmentlist_dateline_week' => '最近1周', + 'attachmentlist_dateline_month' => '最近1月', + 'attachmentlist_highlight' => '获得高亮值', + +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_banner.php b/source/language/block/lang_banner.php new file mode 100644 index 0000000..c7ee6a2 --- /dev/null +++ b/source/language/block/lang_banner.php @@ -0,0 +1,27 @@ + '图片地址', + 'banner_width' => '图片宽度', + 'banner_height' => '图片高度', + 'banner_url' => '图片链接', + 'banner_text' => '图片介绍', + 'banner_atarget' => '链接打开方式', + 'banner_atarget_top' => '本页面打开(跳出框架)', + 'banner_atarget_blank' => '新窗口打开', + 'banner_atarget_self' => '本页面打开', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_blank.php b/source/language/block/lang_blank.php new file mode 100644 index 0000000..f57d450 --- /dev/null +++ b/source/language/block/lang_blank.php @@ -0,0 +1,18 @@ + 'HTML代码', +); +?> \ No newline at end of file diff --git a/source/language/block/lang_bloglist.php b/source/language/block/lang_bloglist.php new file mode 100644 index 0000000..5981c08 --- /dev/null +++ b/source/language/block/lang_bloglist.php @@ -0,0 +1,43 @@ + '指定日志', + 'bloglist_blogids_comment' => '填入指定日志的ID(blogid),多个日志之间用逗号(,)分隔', + 'bloglist_uids' => '作者UID', + 'bloglist_uids_comment' => '填入指定用户的ID(uid),多个用户之间用逗号(,)分隔', + 'bloglist_catid' => '指定分类', + 'bloglist_catid_comment' => '选择日志所属的系统日志分类,可多选', + 'bloglist_startrow' => '起始数据行数', + 'bloglist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'bloglist_titlelength' => '标题长度', + 'bloglist_summarylength' => '简介长度', + 'bloglist_picrequired' => '过滤无封面日志', + 'bloglist_picrequired_comment' => '是否过滤没有封面图片的日志', + 'bloglist_hours' => '时间范围', + 'bloglist_hours_nolimit' => '不限制', + 'bloglist_hours_hour' => '1小时内', + 'bloglist_hours_day' => '24小时内', + 'bloglist_hours_week' => '7天内', + 'bloglist_hours_month' => '1月内', + 'bloglist_hours_year' => '1年内', + 'bloglist_orderby' => '日志排序方式', + 'bloglist_orderby_comment' => '设置以哪一字段或方式对日志进行排序', + 'bloglist_orderby_dateline' => '按发布时间倒序', + 'bloglist_orderby_viewnum' => '按查看数倒序', + 'bloglist_orderby_replynum' => '按回复数倒序', + 'bloglist_orderby_hot' => '按热度倒序' +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_doinglist.php b/source/language/block/lang_doinglist.php new file mode 100644 index 0000000..d7f1ef8 --- /dev/null +++ b/source/language/block/lang_doinglist.php @@ -0,0 +1,28 @@ + '用户UID', + 'doinglist_uids_comment' => '填入指定用户的ID(uid),多个用户之间用逗号(,)分隔', + 'doinglist_startrow' => '起始数据行数', + 'doinglist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'doinglist_titlelength' => '记录长度', + 'doinglist_titlelength_comment' => '指定记录的最大长度,设置为0则支持表情图片', + 'doinglist_orderby' => '动态排序方式', + 'doinglist_orderby_comment' => '设置以哪一字段或方式对动态进行排序', + 'doinglist_orderby_dateline' => '按发布时间倒序', + 'doinglist_orderby_replynum' => '按回复数倒序' +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_forumlist.php b/source/language/block/lang_forumlist.php new file mode 100644 index 0000000..3808273 --- /dev/null +++ b/source/language/block/lang_forumlist.php @@ -0,0 +1,32 @@ + '指定版块', + 'forumlist_fids_comment' => '填入指定版块的ID(fid),多个版块之间用逗号(,)分隔', + 'forumlist_fups' => '上级版块', + 'forumlist_fups_comment' => '设置显示某些分类或版块下属的版块', + 'forumlist_titlelength' => '名称长度', + 'forumlist_titlelength_comment' => '设置版块名称显示的最大长度', + 'forumlist_summarylength' => '介绍长度', + 'forumlist_summarylength_comment' => '设置版块介绍显示的最大长度', + 'forumlist_orderby' => '版块排序方式', + 'forumlist_orderby_comment' => '设置以哪一字段或方式对版块进行排序', + 'forumlist_orderby_displayorder' => '按显示顺序顺序排序', + 'forumlist_orderby_threads' => '按主题数倒序排序', + 'forumlist_orderby_todayposts' => '按今日发帖数倒序排序', + 'forumlist_orderby_posts' => '按文章数倒序排序', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_forumstat.php b/source/language/block/lang_forumstat.php new file mode 100644 index 0000000..dfb6c1a --- /dev/null +++ b/source/language/block/lang_forumstat.php @@ -0,0 +1,49 @@ + '论坛统计', + 'forumstat_desc' => '论坛统计数据调用', + 'forumstat_forums_allow' => '显示版块数统计', + 'forumstat_forums_order' => '版块数统计显示顺序', + 'forumstat_forums_text' => '版块数统计提示文字', + 'forumstat_forums_default' => '版块数:', + + 'forumstat_threads_allow' => '显示主题数统计', + 'forumstat_threads_order' => '主题数统计显示顺序', + 'forumstat_threads_text' => '主题数统计提示文字', + 'forumstat_threads_default' => '主题数:', + + 'forumstat_posts_allow' => '显示文章数统计', + 'forumstat_posts_order' => '文章数统计显示顺序', + 'forumstat_posts_text' => '文章数统计提示文字', + 'forumstat_posts_default' => '文章数:', + + 'forumstat_members_allow' => '显示用户数统计', + 'forumstat_members_order' => '用户数统计显示顺序', + 'forumstat_members_text' => '用户数统计提示文字', + 'forumstat_members_default' => '用户数:', + + 'forumstat_online_allow' => '显示在线人数统计', + 'forumstat_online_order' => '在线人数统计显示顺序', + 'forumstat_online_text' => '在线人数统计提示文字', + 'forumstat_online_default' => '在线人数:', + + 'forumstat_onlinemember_allow' => '显示在线会员统计', + 'forumstat_onlinemember_order' => '在线会员统计显示顺序', + 'forumstat_onlinemember_text' => '在线会员统计提示文字', + 'forumstat_onlinemember_default' => '在线会员:', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_forumtree.php b/source/language/block/lang_forumtree.php new file mode 100644 index 0000000..71de146 --- /dev/null +++ b/source/language/block/lang_forumtree.php @@ -0,0 +1,22 @@ + '版块树形列表', + 'forumtree_desc' => '树形显示版块列表', + 'forumtree_fids' => '显示的版块', + 'forumtree_fids_comment' => '设置允许显示的版块,留空为显示所有版块', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_friendlink.php b/source/language/block/lang_friendlink.php new file mode 100644 index 0000000..3c5267e --- /dev/null +++ b/source/language/block/lang_friendlink.php @@ -0,0 +1,31 @@ + '展示样式', + 'friendlink_content_both' => 'logo和文字', + 'friendlink_content_logo' => '仅logo', + 'friendlink_content_text' => '仅文字', + 'friendlink_type' => '链接分组', + 'friendlink_type_group1' => '分组1', + 'friendlink_type_group2' => '分组2', + 'friendlink_type_group3' => '分组3', + 'friendlink_type_group4' => '分组4', + 'friendlink_titlelength' => '站点名称长度', + 'friendlink_titlelength_comment' => '设置站点名称的最大长度', + 'friendlink_summarylength' => '简介长度', + 'friendlink_summarylength_comment' => '设置站点简介最大长度', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_google.php b/source/language/block/lang_google.php new file mode 100644 index 0000000..849ee15 --- /dev/null +++ b/source/language/block/lang_google.php @@ -0,0 +1,32 @@ + 'Google 搜索', + 'google_desc' => 'Google 搜索框', + 'google_lang' => '搜索网页的语言', + 'google_lang_comment' => '设置适合自己论坛的网页语言可以有效的提高搜索结果的质量', + 'google_lang_any' => '任何语言', + 'google_lang_en' => '英文', + 'google_lang_zh-CN' => '简体中文', + 'google_lang_zh-TW' => '繁体中文', + 'google_default' => '默认搜索选择', + 'google_default_comment' => '搜索框默认选择的项目', + 'google_default_0' => '网页搜索', + 'google_default_1' => '站内搜索', + 'google_client' => '搜索联盟 ID', + 'google_client_comment' => '如果您加入了 Google 搜索联盟,可以在这里填写 ID', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_groupactivity.php b/source/language/block/lang_groupactivity.php new file mode 100644 index 0000000..db4b8c3 --- /dev/null +++ b/source/language/block/lang_groupactivity.php @@ -0,0 +1,105 @@ + '制定圈子', + 'groupactivity_fids_comment' => '指定圈子,多个ID之间请用半角逗号“,”隔开。', + 'groupactivity_gtids' => '圈子分类', + 'groupactivity_gtids_comment' => '设置圈子所在分类,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'groupactivity_uids' => '发起者UID', + 'groupactivity_uids_comment' => '设置活动发起人UID ,多个 UID 请用半角逗号“,”隔开。', + 'groupactivity_startrow' => '起始数据行数', + 'groupactivity_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'groupactivity_items' => '显示数据条数', + 'groupactivity_items_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'groupactivity_titlelength' => '标题最大字节数', + 'groupactivity_titlelength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'groupactivity_fnamelength' => '标题最大字节数包含版块名称', + 'groupactivity_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'groupactivity_summarylength' => '主题简短内容文字数', + 'groupactivity_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'groupactivity_tids' => '指定主题', + 'groupactivity_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'groupactivity_keyword' => '标题关键字', + 'groupactivity_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'groupactivity_typeids' => '主题分类', + 'groupactivity_typeids_comment' => '设置特定分类的主题。注意: 全选或全不选均为不进行任何过滤', + 'groupactivity_typeids_all' => '全部的主题分类', + 'groupactivity_sortids' => '分类信息', + 'groupactivity_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'groupactivity_sortids_all' => '全部的分类信息', + 'groupactivity_digest' => '精华主题过滤', + 'groupactivity_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupactivity_digest_0' => '普通主题', + 'groupactivity_digest_1' => '精华 I', + 'groupactivity_digest_2' => '精华 II', + 'groupactivity_digest_3' => '精华 III', + 'groupactivity_stick' => '置顶主题过滤', + 'groupactivity_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupactivity_stick_0' => '普通主题', + 'groupactivity_stick_1' => '置顶 I', + 'groupactivity_stick_2' => '置顶 II', + 'groupactivity_stick_3' => '置顶 III', + 'groupactivity_special' => '特殊主题过滤', + 'groupactivity_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupactivity_special_1' => '投票主题', + 'groupactivity_special_2' => '商品主题', + 'groupactivity_special_3' => '悬赏主题', + 'groupactivity_special_4' => '活动主题', + 'groupactivity_special_5' => '辩论主题', + 'groupactivity_special_0' => '普通主题', + 'groupactivity_special_reward' => '悬赏主题过滤', + 'groupactivity_special_reward_comment' => '设置特定类型的悬赏主题', + 'groupactivity_special_reward_0' => '全部', + 'groupactivity_special_reward_1' => '已解决', + 'groupactivity_special_reward_2' => '未解决', + 'groupactivity_recommend' => '推荐主题过滤', + 'groupactivity_recommend_comment' => '设置是否只显示推荐的主题', + 'groupactivity_orderby' => '主题排序方式', + 'groupactivity_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'groupactivity_orderby_lastpost' => '按最后回复时间倒序排序', + 'groupactivity_orderby_dateline' => '按发布时间倒序排序', + 'groupactivity_orderby_replies' => '按回复数倒序排序', + 'groupactivity_orderby_views' => '按浏览次数倒序排序', + 'groupactivity_orderby_heats' => '按热度倒序排序', + 'groupactivity_orderby_recommends' => '按主题评价倒序排序', + 'groupactivity_orderby_hourviews' => '按指定时间内浏览次数倒序排序', + 'groupactivity_orderby_todayviews' => '按当天浏览次数倒序排序', + 'groupactivity_orderby_weekviews' => '按本周浏览次数倒序排序', + 'groupactivity_orderby_monthviews' => '按当月浏览次数倒序排序', + 'groupactivity_orderby_hours' => '指定时间(小时)', + 'groupactivity_orderby_hours_comment' => '指定时间内浏览次数倒序排序的时间值', + 'groupactivity_orderby_todayhots' => '按当天累计售出数倒序排序', + 'groupactivity_orderby_weekhots' => '按本周累计售出数倒序排序', + 'groupactivity_orderby_monthhots' => '按当月累计售出数倒序排序', + 'groupactivity_price_add' => ' 附加 ', + 'groupactivity_place' => '活动地点', + 'groupactivity_class' => '活动类型', + 'groupactivity_class_all' => '所有类型', + 'groupactivity_gender' => '性别要求', + 'groupactivity_gender_0' => '不限', + 'groupactivity_gender_1' => '男', + 'groupactivity_gender_2' => '女', + 'groupactivity_orderby_weekstart' => '按一周内活动开始时间排序', + 'groupactivity_orderby_monthstart' => '按一月内活动开始时间排序', + 'groupactivity_orderby_weekexp' => '按一周内报名截止时间排序', + 'groupactivity_orderby_monthexp' => '按一月内报名截止时间排序', + 'groupactivity_gviewperm' => '圈子浏览权限', + 'groupactivity_gviewperm_nolimit' => '不限制', + 'groupactivity_gviewperm_only_member' => '仅成员', + 'groupactivity_gviewperm_all_member' => '所有人', + 'groupactivity_highlight' => '获得高亮值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_groupattachment.php b/source/language/block/lang_groupattachment.php new file mode 100644 index 0000000..f4068b0 --- /dev/null +++ b/source/language/block/lang_groupattachment.php @@ -0,0 +1,70 @@ + '论坛附件列表', + 'groupattachment_desc' => '论坛附件列表调用', + 'groupattachment_fids' => '指定圈子', + 'groupattachment_fids_comment' => '指定圈子,多个ID之间请用半角逗号“,”隔开。', + 'groupattachment_tids' => '指定主题', + 'groupattachment_tids_comment' => '指定主题ID,多个ID之间用逗号分隔', + 'groupattachment_gtids' => '圈子分类', + 'groupattachment_gtids_comment' => '设置圈子所在分类,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'groupattachment_startrow' => '起始数据行数', + 'groupattachment_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'groupattachment_items' => '显示数据条数', + 'groupattachment_items_comment' => '设置一次显示的图片主题条目数,请设置为大于 0 的整数', + 'groupattachment_titlelength' => '标题长度', + 'groupattachment_titlelength_comment' => '设置当附件名称/文章标题显示的最大长度', + 'groupattachment_summarylength' => '内容长度', + 'groupattachment_summarylength_comment' => '设置附件介绍/文章内容显示的最大长度', + 'groupattachment_maxwidth' => '图片最大宽度(像素)', + 'groupattachment_maxwidth_comment' => '设置是否自动缩小或放大图片的尺寸到本设定的宽度,0 为不自动缩放', + 'groupattachment_maxheight' => '图片最大高度(像素)', + 'groupattachment_maxheight_comment' => '设置是否自动缩小或放大图片的尺寸到本设定的高度,0 为不自动缩放', + 'groupattachment_threadmethod' => '主题方式调用', + 'groupattachment_threadmethod_comment' => '选择“是”将按照主题方式调用附件,一个主题显示一个附件;选择“否”将按照附件方式调用', + 'groupattachment_digest' => '精华帖过滤', + 'groupattachment_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupattachment_digest_0' => '普通主题', + 'groupattachment_digest_1' => '精华 I', + 'groupattachment_digest_2' => '精华 II', + 'groupattachment_digest_3' => '精华 III', + 'groupattachment_special' => '特殊主题过滤', + 'groupattachment_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupattachment_special_1' => '投票主题', + 'groupattachment_special_2' => '商品主题', + 'groupattachment_special_3' => '悬赏主题', + 'groupattachment_special_4' => '活动主题', + 'groupattachment_special_5' => '辩论主题', + 'groupattachment_special_0' => '普通主题', + 'groupattachment_special_reward' => '悬赏主题过滤', + 'groupattachment_special_reward_comment' => '设置特定类型的悬赏主题', + 'groupattachment_special_reward_0' => '全部', + 'groupattachment_special_reward_1' => '已解决', + 'groupattachment_special_reward_2' => '未解决', + 'groupattachment_dateline' => '附件上传时间', + 'groupattachment_dateline_nolimit' => '不限制', + 'groupattachment_dateline_hour' => '最近1小时', + 'groupattachment_dateline_day' => '最近24小时', + 'groupattachment_dateline_week' => '最近1周', + 'groupattachment_dateline_month' => '最近1月', + 'groupattachment_gviewperm' => '圈子浏览权限', + 'groupattachment_gviewperm_nolimit' => '不限制', + 'groupattachment_gviewperm_only_member' => '仅成员', + 'groupattachment_gviewperm_all_member' => '所有人', + 'groupattachment_highlight' => '获得高亮值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_grouplist.php b/source/language/block/lang_grouplist.php new file mode 100644 index 0000000..ff0cbaa --- /dev/null +++ b/source/language/block/lang_grouplist.php @@ -0,0 +1,39 @@ + '圈子类别', + 'grouplist_gtids_comment' => '选择圈子类别', + 'grouplist_fids' => '指定圈子', + 'grouplist_fids_comment' => '输入指定圈子的ID,多个ID之间用逗号分隔', + 'grouplist_startrow' => '起始数据行数', + 'grouplist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'grouplist_titlelength' => '名称长度', + 'grouplist_titlelength_comment' => '设置圈子名称最大长度', + 'grouplist_summarylength' => '介绍长度', + 'grouplist_summarylength_comment' => '设置圈子介绍最大长度', + 'grouplist_orderby' => '圈子排序方式', + 'grouplist_orderby_comment' => '设置以哪一字段或方式对圈子进行排序', + 'grouplist_orderby_dateline' => '按创建时间倒序', + 'grouplist_orderby_posts' => '按总发帖数倒序', + 'grouplist_orderby_todayposts' => '按今日发帖数倒序', + 'grouplist_orderby_threads' => '按话题数倒序', + 'grouplist_orderby_level' => '按等级倒序', + 'grouplist_orderby_membernum' => '按成员数倒序', + 'grouplist_orderby_activity' => '按活跃度倒序', + 'grouplist_orderby_commoncredits' => '按共同积分倒序', + 'grouplist_orderby_displayorder' => '按默认顺序' +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_groupthread.php b/source/language/block/lang_groupthread.php new file mode 100644 index 0000000..69b70ae --- /dev/null +++ b/source/language/block/lang_groupthread.php @@ -0,0 +1,113 @@ + '圈子ID', + 'groupthread_fids_comment' => '指定圈子ID,多个ID之间用 , 分割', + 'groupthread_gtids' => '圈子分类', + 'groupthread_gtids_comment' => '选择圈子分类', + 'groupthread_uids' => '楼主UID', + 'groupthread_uids_comment' => '指定主题作者ID,多个ID之间用 , 分割', + 'groupthread_keyword' => '标题关键字', + 'groupthread_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'groupthread_startrow' => '起始数据行数', + 'groupthread_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'groupthread_items' => '显示数据条数', + 'groupthread_items_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'groupthread_titlelength' => '标题最大字节数', + 'groupthread_maxlength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'groupthread_fnamelength' => '标题最大字节数包含版块名称', + 'groupthread_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'groupthread_summarylength' => '主题简短内容文字数', + 'groupthread_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'groupthread_picpre' => '前缀图标', + 'groupthread_picpre_comment' => '设置是否在主题前加入图片形式的图标,输入图片的 URL (绝对或相对)地址即可,留空为不显示前缀图标', + 'groupthread_tids' => '指定主题', + 'groupthread_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'groupthread_keyword' => '标题关键字', + 'groupthread_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'groupthread_typeids' => '主题分类', + 'groupthread_typeids_comment' => '设置特定分类的主题。注意: 全选或全不选均为不进行任何过滤', + 'groupthread_typeids_all' => '全部的主题分类', + 'groupthread_sortids' => '分类信息', + 'groupthread_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'groupthread_sortids_all' => '全部的分类信息', + 'groupthread_threadtype' => '显示主题分类前缀', + 'groupthread_threadtype_comment' => '设置是否在主题列表中,给分类的主题前加上分类名称', + 'groupthread_groupthreadort' => '显示分类信息前缀', + 'groupthread_groupthreadort_comment' => '设置是否在主题列表中,给分类信息的主题前加上分类信息名称', + 'groupthread_highlight' => '显示主题的高亮特性', + 'groupthread_highlight_comment' => '设置是否显示主题的高亮特性', + 'groupthread_digest' => '精华主题过滤', + 'groupthread_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupthread_digest_0' => '普通主题', + 'groupthread_digest_1' => '精华 I', + 'groupthread_digest_2' => '精华 II', + 'groupthread_digest_3' => '精华 III', + 'groupthread_stick' => '置顶主题过滤', + 'groupthread_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupthread_stick_0' => '普通主题', + 'groupthread_stick_1' => '置顶 I', + 'groupthread_stick_2' => '置顶 II', + 'groupthread_stick_3' => '置顶 III', + 'groupthread_special' => '特殊主题过滤', + 'groupthread_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'groupthread_special_1' => '投票主题', + 'groupthread_special_2' => '商品主题', + 'groupthread_special_3' => '悬赏主题', + 'groupthread_special_4' => '活动主题', + 'groupthread_special_5' => '辩论主题', + 'groupthread_special_0' => '普通主题', + 'groupthread_special_reward' => '悬赏主题过滤', + 'groupthread_special_reward_comment' => '设置特定类型的悬赏主题', + 'groupthread_picrequired' => '必须含图片附件', + 'groupthread_picrequired_comment' => '设置是否只显示含有图片附件的主题', + 'groupthread_special_reward_0' => '全部', + 'groupthread_special_reward_1' => '已解决', + 'groupthread_special_reward_2' => '未解决', + 'groupthread_recommend' => '推荐主题过滤', + 'groupthread_recommend_comment' => '设置是否只显示推荐的主题', + 'groupthread_orderby' => '主题排序方式', + 'groupthread_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'groupthread_orderby_lastpost' => '按最后回复时间倒序排序', + 'groupthread_orderby_dateline' => '按发布时间倒序排序', + 'groupthread_orderby_replies' => '按回复数倒序排序', + 'groupthread_orderby_views' => '按浏览次数倒序排序', + 'groupthread_orderby_heats' => '按热度倒序排序', + 'groupthread_orderby_recommends' => '按主题评价倒序排序', + 'groupthread_orderby_hourviews' => '按小时内浏览次数倒序排序', + 'groupthread_orderby_todayviews' => '按当天浏览次数倒序排序', + 'groupthread_orderby_weekviews' => '按本周浏览次数倒序排序', + 'groupthread_orderby_monthviews' => '按当月浏览次数倒序排序', + 'groupthread_postdateline' => '主题发布时间', + 'groupthread_postdateline_nolimit' => '不限制', + 'groupthread_postdateline_hour' => '1小时内', + 'groupthread_postdateline_day' => '24小时内', + 'groupthread_postdateline_week' => '7天内', + 'groupthread_postdateline_month' => '1个月内', + 'groupthread_lastpost' => '最后更新时间', + 'groupthread_lastpost_nolimit' => '不限制', + 'groupthread_lastpost_hour' => '1小时内', + 'groupthread_lastpost_day' => '24小时内', + 'groupthread_lastpost_week' => '7天内', + 'groupthread_lastpost_month' => '1个月内', + 'groupthread_orderby_displayorder' => '按默认顺序', + 'groupthread_gviewperm' => '圈子浏览权限', + 'groupthread_gviewperm_nolimit' => '不限制', + 'groupthread_gviewperm_only_member' => '仅成员', + 'groupthread_gviewperm_all_member' => '所有人', + 'groupthread_highlight' => '获得高亮值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_grouptrade.php b/source/language/block/lang_grouptrade.php new file mode 100644 index 0000000..081cbc0 --- /dev/null +++ b/source/language/block/lang_grouptrade.php @@ -0,0 +1,104 @@ + '指定圈子', + 'grouptrade_fids_comment' => '设置允许参与新帖调用的圈子,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'grouptrade_gtids' => '圈子分类', + 'grouptrade_gtids_comment' => '设置圈子所在分类,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'grouptrade_uids' => '用户UID', + 'grouptrade_uids_comment' => '设置要指定显示的用户UID,多个UID请用半角逗号“,”隔开。', + 'grouptrade_startrow' => '起始数据行数', + 'grouptrade_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'grouptrade_items' => '显示数据条数', + 'grouptrade_items_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'grouptrade_titlelength' => '标题最大字节数', + 'grouptrade_titlelength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'grouptrade_fnamelength' => '标题最大字节数包含版块名称', + 'grouptrade_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'grouptrade_summarylength' => '主题简短内容文字数', + 'grouptrade_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'grouptrade_tids' => '指定主题', + 'grouptrade_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'grouptrade_keyword' => '标题关键字', + 'grouptrade_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'grouptrade_typeids' => '主题分类', + 'grouptrade_typeids_comment' => '设置特定分类的主题。注意: 全选或全不选均为不进行任何过滤', + 'grouptrade_typeids_all' => '全部的主题分类', + 'grouptrade_sortids' => '分类信息', + 'grouptrade_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'grouptrade_sortids_all' => '全部的分类信息', + 'grouptrade_digest' => '精华主题过滤', + 'grouptrade_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'grouptrade_digest_0' => '普通主题', + 'grouptrade_digest_1' => '精华 I', + 'grouptrade_digest_2' => '精华 II', + 'grouptrade_digest_3' => '精华 III', + 'grouptrade_stick' => '置顶主题过滤', + 'grouptrade_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'grouptrade_stick_0' => '普通主题', + 'grouptrade_stick_1' => '置顶 I', + 'grouptrade_stick_2' => '置顶 II', + 'grouptrade_stick_3' => '置顶 III', + 'grouptrade_special' => '特殊主题过滤', + 'grouptrade_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'grouptrade_special_1' => '投票主题', + 'grouptrade_special_2' => '商品主题', + 'grouptrade_special_3' => '悬赏主题', + 'grouptrade_special_4' => '活动主题', + 'grouptrade_special_5' => '辩论主题', + 'grouptrade_special_0' => '普通主题', + 'grouptrade_special_reward' => '悬赏主题过滤', + 'grouptrade_special_reward_comment' => '设置特定类型的悬赏主题', + 'grouptrade_special_reward_0' => '全部', + 'grouptrade_special_reward_1' => '已解决', + 'grouptrade_special_reward_2' => '未解决', + 'grouptrade_recommend' => '推荐主题过滤', + 'grouptrade_recommend_comment' => '设置是否只显示推荐的主题', + 'grouptrade_orderby' => '主题排序方式', + 'grouptrade_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'grouptrade_orderby_lastpost' => '按最后回复时间倒序排序', + 'grouptrade_orderby_dateline' => '按发布时间倒序排序', + 'grouptrade_orderby_replies' => '按回复数倒序排序', + 'grouptrade_orderby_views' => '按浏览次数倒序排序', + 'grouptrade_orderby_heats' => '按热度倒序排序', + 'grouptrade_orderby_recommends' => '按主题评价倒序排序', + 'grouptrade_orderby_hourviews' => '按指定时间内浏览次数倒序排序', + 'grouptrade_orderby_todayviews' => '按当天浏览次数倒序排序', + 'grouptrade_orderby_weekviews' => '按本周浏览次数倒序排序', + 'grouptrade_orderby_monthviews' => '按当月浏览次数倒序排序', + 'grouptrade_orderby_hours' => '指定时间(小时)', + 'grouptrade_orderby_hours_comment' => '指定时间内浏览次数倒序排序的时间值', + 'grouptrade_orderby_todayhots' => '按当天累计售出数倒序排序', + 'grouptrade_orderby_weekhots' => '按本周累计售出数倒序排序', + 'grouptrade_orderby_monthhots' => '按当月累计售出数倒序排序', + 'grouptrade_price_add' => ' 附加 ', + 'grouptrade_place' => '活动地点', + 'grouptrade_class' => '活动类型', + 'grouptrade_gender' => '性别要求', + 'grouptrade_gender_0' => '不限', + 'grouptrade_gender_1' => '男', + 'grouptrade_gender_2' => '女', + 'grouptrade_orderby_weekstart' => '按一周内活动开始时间排序', + 'grouptrade_orderby_monthstart' => '按一月内活动开始时间排序', + 'grouptrade_orderby_weekexp' => '按一周内报名截止时间排序', + 'grouptrade_orderby_monthexp' => '按一月内报名截止时间排序', + 'grouptrade_gviewperm' => '圈子浏览权限', + 'grouptrade_gviewperm_nolimit' => '不限制', + 'grouptrade_gviewperm_only_member' => '仅成员', + 'grouptrade_gviewperm_all_member' => '所有人', + 'grouptrade_highlight' => '获得高亮值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_houselist.php b/source/language/block/lang_houselist.php new file mode 100644 index 0000000..1f177c1 --- /dev/null +++ b/source/language/block/lang_houselist.php @@ -0,0 +1,88 @@ + '所在版块', + 'categorylist_fids_comment' => '设置允许参与新帖调用的版块,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'categorylist_startrow' => '起始数据行数', + 'categorylist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'categorylist_showitems' => '显示数据条数', + 'categorylist_showitems_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'categorylist_titlelength' => '标题最大字节数', + 'categorylist_titlelength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'categorylist_fnamelength' => '标题最大字节数包含版块名称', + 'categorylist_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'categorylist_summarylength' => '主题简短内容文字数', + 'categorylist_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'categorylist_tids' => '指定主题', + 'categorylist_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'categorylist_keyword' => '标题关键字', + 'categorylist_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'categorylist_sortids' => '分类信息', + 'categorylist_sortids_comment' => '设置特定分类的主题。注意: 全选或全不选均为不进行任何过滤', + 'categorylist_styleids' => '分类模板', + 'categorylist_styleids_comment' => '在后台对应的分类信息里面设置模板', + 'categorylist_styleids_style1' => '样式1', + 'categorylist_styleids_style2' => '样式2', + 'categorylist_styleids_style3' => '样式3', + 'categorylist_styleids_style4' => '样式4', + 'categorylist_styleids_style5' => '样式5', + 'categorylist_typeids_all' => '全部的主题分类', + 'categorylist_categoryids' => '分类信息', + 'categorylist_categoryids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'categorylist_categoryids_all' => '全部的分类信息', + 'categorylist_digest' => '精华主题过滤', + 'categorylist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'categorylist_digest_0' => '普通主题', + 'categorylist_digest_1' => '精华 I', + 'categorylist_digest_2' => '精华 II', + 'categorylist_digest_3' => '精华 III', + 'categorylist_stick' => '置顶主题过滤', + 'categorylist_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'categorylist_stick_0' => '普通主题', + 'categorylist_stick_1' => '置顶 I', + 'categorylist_stick_2' => '置顶 II', + 'categorylist_stick_3' => '置顶 III', + 'categorylist_special' => '特殊主题过滤', + 'categorylist_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'categorylist_special_1' => '投票主题', + 'categorylist_special_2' => '商品主题', + 'categorylist_special_3' => '悬赏主题', + 'categorylist_special_4' => '活动主题', + 'categorylist_special_5' => '辩论主题', + 'categorylist_special_0' => '普通主题', + 'categorylist_special_reward' => '悬赏主题过滤', + 'categorylist_special_reward_comment' => '设置特定类型的悬赏主题', + 'categorylist_special_reward_0' => '全部', + 'categorylist_special_reward_1' => '已解决', + 'categorylist_special_reward_2' => '未解决', + 'categorylist_recommend' => '推荐主题过滤', + 'categorylist_recommend_comment' => '设置是否只显示推荐的主题', + 'categorylist_orderby' => '主题排序方式', + 'categorylist_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'categorylist_orderby_lastpost' => '按最后回复时间倒序排序', + 'categorylist_orderby_dateline' => '按发布时间倒序排序', + 'categorylist_orderby_replies' => '按回复数倒序排序', + 'categorylist_orderby_views' => '按浏览次数倒序排序', + 'categorylist_orderby_heats' => '按热度倒序排序', + 'categorylist_orderby_recommends' => '按主题评价倒序排序', + 'categorylist_orderby_hourviews' => '按指定时间内浏览次数倒序排序', + 'categorylist_orderby_todayviews' => '按当天浏览次数倒序排序', + 'categorylist_orderby_weekviews' => '按本周浏览次数倒序排序', + 'categorylist_orderby_monthviews' => '按当月浏览次数倒序排序', + 'categorylist_orderby_hours' => '指定时间(小时)', + 'categorylist_orderby_hours_comment' => '指定时间内浏览次数倒序排序的时间值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_line.php b/source/language/block/lang_line.php new file mode 100644 index 0000000..0d54eb7 --- /dev/null +++ b/source/language/block/lang_line.php @@ -0,0 +1,20 @@ + '分割线样式', + 'line_style_line' => '实线', + 'line_style_dash' => '虚线', +); +?> \ No newline at end of file diff --git a/source/language/block/lang_memberlist.php b/source/language/block/lang_memberlist.php new file mode 100644 index 0000000..026fda2 --- /dev/null +++ b/source/language/block/lang_memberlist.php @@ -0,0 +1,66 @@ + '用户UID', + 'memberlist_uids_comment' => '指定用户UID,多个UID之间用 ,分割', + 'memberlist_special' => '特殊会员', + 'memberlist_special_nolimit' => '不限', + 'memberlist_special_hot' => '推荐关注', + 'memberlist_gender' => '性别', + 'memberlist_gender_nolimit' => '不限', + 'memberlist_gender_male' => '男', + 'memberlist_gender_female' => '女', + 'memberlist_residecity' => '居住城市', + 'memberlist_birthcity' => '出生城市', + 'memberlist_avatarstatus' => '过滤无头像用户', + 'memberlist_emailstatus' => '通过邮件认证', + 'memberlist_secmobilestatus' => '通过安全手机认证', + 'memberlist_verifystatus' => '已通过的认证', + 'memberlist_special_default' => '推荐好友', + 'memberlist_startrow' => '起始数据行数', + 'memberlist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'memberlist_groupid' => '用户组', + 'memberlist_groupid_comment' => '指定用户组', + 'memberlist_items' => '显示数据条数', + 'memberlist_items_comment' => '设置一次显示的用户条目数,请设置为大于 0 的整数', + 'memberlist_orderby' => '用户排序方式', + 'memberlist_orderby_comment' => '设置以哪一字段或方式对用户进行排序', + 'memberlist_orderby_credits' => '按总积分倒序', + 'memberlist_orderby_extcredits' => '按指定扩展积分倒序', + 'memberlist_orderby_posts' => '按发帖数倒序', + 'memberlist_orderby_blogs' => '按日志数倒序', + 'memberlist_orderby_albums' => '按相册数倒序', + 'memberlist_orderby_doings' => '按记录数倒序', + 'memberlist_orderby_sharings' => '按分享数倒序', + 'memberlist_orderby_show' => '按竞价排行排序', + 'memberlist_orderby_special' => '按推荐优先级排序', + 'memberlist_orderby_threads' => '按主题数倒序', + 'memberlist_orderby_digestposts' => '按精华帖数倒序', + 'memberlist_orderby_regdate' => '按注册日期倒序', + 'memberlist_orderby_todayposts' => '按今日发帖数倒序', + 'memberlist_lastpost' => '最后发帖时间', + 'memberlist_lastpost_nolimit' => '不限制', + 'memberlist_lastpost_hour' => '最近1小时', + 'memberlist_lastpost_day' => '最近1天', + 'memberlist_lastpost_week' => '最近一周', + 'memberlist_lastpost_month' => '最近一月', + 'memberlist_orderby_extcreditselect' => '扩展积分', + 'memberlist_orderby_extcreditselect_comment' => '按指定扩展积分倒序排序的积分值', + 'memberlist_orderby_hours' => '按小时内发帖数倒序', + 'memberlist_orderby_hours_comment' => '指定时间内发帖数倒序排序的时间值', + 'memberlist_yes' => '是', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_piclist.php b/source/language/block/lang_piclist.php new file mode 100644 index 0000000..6b4fcbc --- /dev/null +++ b/source/language/block/lang_piclist.php @@ -0,0 +1,39 @@ + '指定图片', + 'piclist_picids_comment' => '填入指定图片的ID(picid),多个图片之间用逗号(,)分隔', + 'piclist_aids' => '相册ID', + 'piclist_aids_comment' => '填入指定相册的ID(aid),多个相册之间用逗号(,)分隔', + 'piclist_uids' => '用户UID', + 'piclist_uids_comment' => '填入指定用户的ID(uid),多个用户之间用逗号(,)分隔', + 'piclist_startrow' => '起始数据行数', + 'piclist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'piclist_hours' => '时间范围', + 'piclist_hours_nolimit' => '不限制', + 'piclist_hours_hour' => '1小时内', + 'piclist_hours_day' => '24小时内', + 'piclist_hours_week' => '7天内', + 'piclist_hours_month' => '1月内', + 'piclist_hours_year' => '1年内', + 'piclist_titlelength' => '标题长度', + 'piclist_titlelength_comment' => '指定图片标题最大长度', + 'piclist_orderby' => '图片排序方式', + 'piclist_orderby_comment' => '设置以哪一字段或方式对图片进行排序', + 'piclist_orderby_dateline' => '按发布时间倒序', + 'piclist_orderby_hot' => '按热度倒序' +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_polllist.php b/source/language/block/lang_polllist.php new file mode 100644 index 0000000..25ffe54 --- /dev/null +++ b/source/language/block/lang_polllist.php @@ -0,0 +1,41 @@ + '投票列表', + 'polllist_desc' => '投票列表调用', + 'polllist_uids' => '用户UID', + 'polllist_uids_comment' => '填入指定用户的ID(uid),多个用户之间用逗号(,)分隔', + 'polllist_startrow' => '起始数据行数', + 'polllist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'polllist_titlelength' => '标题长度', + 'polllist_summarylength' => '简介长度', + 'polllist_orderby' => '投票排序方式', + 'polllist_orderby_comment' => '设置以哪一字段或方式对投票进行排序', + 'polllist_orderby_dateline' => '按发布时间倒序', + 'polllist_orderby_hot' => '按热度倒序', + 'polllist_orderby_lastvote' => '按最后投票时间倒序', + 'polllist_orderby_viewnum' => '按查看数倒序', + 'polllist_orderby_replynum' => '按回复数倒序', + 'polllist_orderby_votenum' => '按投票数倒序', + 'polllist_credit' => '悬赏投票', + 'polllist_credit_nolimit' => '不限定', + 'polllist_credit_yes' => '只取悬赏投票', + 'polllist_expirefilter' => '过期投票', + 'polllist_expirefilter_off' => '不屏蔽', + 'polllist_expirefilter_on' => '屏蔽', + +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_portalcategory.php b/source/language/block/lang_portalcategory.php new file mode 100644 index 0000000..4f25c43 --- /dev/null +++ b/source/language/block/lang_portalcategory.php @@ -0,0 +1,26 @@ + '指定栏目', + 'portalcategory_thecatid_comment' => '指定栏目的ID,多个ID之间用半角逗号(,)分割', + 'portalcategory_catid' => '指定父级栏目', + 'portalcategory_catid_comment' => '选择父级栏目', + 'portalcategory_orderby' => '排序方式', + 'portalcategory_orderby_comment' => '设置以哪一字段或方式对分类进行排序', + 'portalcategory_orderby_displayorder' => '按默认顺序排序', + 'portalcategory_orderby_articles' => '按文章数倒序', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_sortlist.php b/source/language/block/lang_sortlist.php new file mode 100644 index 0000000..d135e3b --- /dev/null +++ b/source/language/block/lang_sortlist.php @@ -0,0 +1,82 @@ + '所在版块', + 'sortlist_fids_comment' => '设置允许参与新帖调用的版块,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'sortlist_startrow' => '起始数据行数', + 'sortlist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'sortlist_showitems' => '显示数据条数', + 'sortlist_showitems_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'sortlist_titlelength' => '标题最大字节数', + 'sortlist_titlelength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'sortlist_fnamelength' => '标题最大字节数包含版块名称', + 'sortlist_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'sortlist_summarylength' => '主题简短内容文字数', + 'sortlist_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'sortlist_tids' => '指定主题', + 'sortlist_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'sortlist_keyword' => '标题关键字', + 'sortlist_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'sortlist_typeids' => '主题分类', + 'sortlist_typeids_comment' => '设置特定分类的主题。注意: 全选或全不选均为不进行任何过滤', + 'sortlist_typeids_all' => '全部的主题分类', + 'sortlist_sortids' => '分类信息', + 'sortlist_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'sortlist_sortids_all' => '全部的分类信息', + 'sortlist_digest' => '精华主题过滤', + 'sortlist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'sortlist_digest_0' => '普通主题', + 'sortlist_digest_1' => '精华 I', + 'sortlist_digest_2' => '精华 II', + 'sortlist_digest_3' => '精华 III', + 'sortlist_stick' => '置顶主题过滤', + 'sortlist_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'sortlist_stick_0' => '普通主题', + 'sortlist_stick_1' => '置顶 I', + 'sortlist_stick_2' => '置顶 II', + 'sortlist_stick_3' => '置顶 III', + 'sortlist_special' => '特殊主题过滤', + 'sortlist_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'sortlist_special_1' => '投票主题', + 'sortlist_special_2' => '商品主题', + 'sortlist_special_3' => '悬赏主题', + 'sortlist_special_4' => '活动主题', + 'sortlist_special_5' => '辩论主题', + 'sortlist_special_0' => '普通主题', + 'sortlist_special_reward' => '悬赏主题过滤', + 'sortlist_special_reward_comment' => '设置特定类型的悬赏主题', + 'sortlist_special_reward_0' => '全部', + 'sortlist_special_reward_1' => '已解决', + 'sortlist_special_reward_2' => '未解决', + 'sortlist_recommend' => '推荐主题过滤', + 'sortlist_recommend_comment' => '设置是否只显示推荐的主题', + 'sortlist_orderby' => '主题排序方式', + 'sortlist_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'sortlist_orderby_lastpost' => '按最后回复时间倒序排序', + 'sortlist_orderby_dateline' => '按发布时间倒序排序', + 'sortlist_orderby_replies' => '按回复数倒序排序', + 'sortlist_orderby_views' => '按浏览次数倒序排序', + 'sortlist_orderby_heats' => '按热度倒序排序', + 'sortlist_orderby_recommends' => '按主题评价倒序排序', + 'sortlist_lastpost' => '主题发布时间', + 'sortlist_lastpost_nolimit' => '不限制', + 'sortlist_lastpost_hour' => '一小时内', + 'sortlist_lastpost_day' => '一天内', + 'sortlist_lastpost_week' => '一周内', + 'sortlist_lastpost_month' => '一月内', + 'sortlist_orderby_hours_comment' => '指定时间内浏览次数倒序排序的时间值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_stat.php b/source/language/block/lang_stat.php new file mode 100644 index 0000000..f4880ef --- /dev/null +++ b/source/language/block/lang_stat.php @@ -0,0 +1,48 @@ + '统计选项', + 'stat_option_posts' => '发帖总数', + 'stat_option_groups' => '圈子总数', + 'stat_option_members' => '会员总数', + 'stat_option_groupnewposts' => '圈子今日发帖', + 'stat_option_bbsnewposts' => '论坛今日发帖数', + 'stat_option_bbslastposts' => '论坛昨日发帖数', + 'stat_option_onlinemembers' => '当前在线会员数', + 'stat_option_maxmembers' => '历史最高在线会员数', + 'stat_option_doings' => '动态数', + 'stat_option_blogs' => '日志数', + 'stat_option_albums' => '相册数', + 'stat_option_pics' => '图片数', + 'stat_option_shares' => '分享数', + + 'stat_edit_showtitle' => '显示名称', + 'stat_edit_showtitle_detail' => '您可以编辑以下对应项来自定义各统计项的显示名称', + + 'stat_posts' => '文章', + 'stat_groups' => '圈子', + 'stat_members' => '会员', + 'stat_groupnewposts' => '圈子今日发帖', + 'stat_bbsnewposts' => '论坛今日发帖', + 'stat_bbslastposts' => '论坛昨日发帖', + 'stat_onlinemembers' => '当前在线会员', + 'stat_maxmembers' => '历史最高在线', + 'stat_doings' => '动态', + 'stat_blogs' => '日志', + 'stat_albums' => '相册', + 'stat_pics' => '图片', + 'stat_shares' => '分享', +); +?> \ No newline at end of file diff --git a/source/language/block/lang_threadlist.php b/source/language/block/lang_threadlist.php new file mode 100644 index 0000000..f88a936 --- /dev/null +++ b/source/language/block/lang_threadlist.php @@ -0,0 +1,116 @@ + '所在版块', + 'threadlist_fids_comment' => '设置允许参与新帖调用的版块,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'threadlist_uids' => '楼主UID', + 'threadlist_uids_comment' => '设置要楼主UID,多个UID请用半角逗号“,”隔开。', + 'threadlist_startrow' => '起始数据行数', + 'threadlist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'threadlist_items' => '显示数据条数', + 'threadlist_items_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'threadlist_titlelength' => '标题最大字节数', + 'threadlist_titlelength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'threadlist_fnamelength' => '标题最大字节数包含版块名称', + 'threadlist_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'threadlist_summarylength' => '主题简短内容文字数', + 'threadlist_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'threadlist_tids' => '指定主题', + 'threadlist_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'threadlist_keyword' => '标题关键字', + 'threadlist_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'threadlist_tagkeyword' => 'TAG标签', + 'threadlist_tagkeyword_comment' => 'TAG标签关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'threadlist_typeids' => '主题分类ID', + 'threadlist_typeids_comment' => '输入主题分类ID,多个 ID 之间用半角逗号“,”隔开。', + 'threadlist_typeids_all' => '全部的主题分类', + 'threadlist_sortids' => '分类信息', + 'threadlist_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'threadlist_sortids_all' => '全部的分类信息', + 'threadlist_reply' => '无回复主题过滤', + 'threadlist_digest' => '精华主题过滤', + 'threadlist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'threadlist_digest_0' => '普通主题', + 'threadlist_digest_1' => '精华 I', + 'threadlist_digest_2' => '精华 II', + 'threadlist_digest_3' => '精华 III', + 'threadlist_stick' => '置顶主题过滤', + 'threadlist_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'threadlist_stick_0' => '普通主题', + 'threadlist_stick_1' => '置顶 I', + 'threadlist_stick_2' => '置顶 II', + 'threadlist_stick_3' => '置顶 III', + 'threadlist_special' => '特殊主题过滤', + 'threadlist_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'threadlist_special_1' => '投票主题', + 'threadlist_special_2' => '商品主题', + 'threadlist_special_3' => '悬赏主题', + 'threadlist_special_4' => '活动主题', + 'threadlist_special_5' => '辩论主题', + 'threadlist_special_0' => '普通主题', + 'threadlist_special_reward' => '悬赏主题过滤', + 'threadlist_special_reward_comment' => '设置特定类型的悬赏主题', + 'threadlist_special_reward_0' => '全部', + 'threadlist_special_reward_1' => '已解决', + 'threadlist_special_reward_2' => '未解决', + 'threadlist_recommend' => '推荐主题过滤', + 'threadlist_viewmod' => '文章模式查看', + 'threadlist_recommend_comment' => '设置是否只显示推荐的主题', + 'threadlist_picrequired' => '必须含图片附件', + 'threadlist_picrequired_comment' => '设置是否只显示含有图片附件的主题', + 'threadlist_orderby' => '主题排序方式', + 'threadlist_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'threadlist_orderby_lastpost' => '按最后回复时间倒序排序', + 'threadlist_orderby_dateline' => '按发布时间倒序排序', + 'threadlist_orderby_replies' => '按回复数倒序排序', + 'threadlist_orderby_views' => '按浏览次数倒序排序', + 'threadlist_orderby_heats' => '按热度倒序排序', + 'threadlist_orderby_recommends' => '按主题评价倒序排序', + 'threadlist_orderby_hourviews' => '按指定时间内浏览次数倒序排序', + 'threadlist_orderby_todayviews' => '按当天浏览次数倒序排序', + 'threadlist_orderby_weekviews' => '按本周浏览次数倒序排序', + 'threadlist_orderby_monthviews' => '按当月浏览次数倒序排序', + 'threadlist_orderby_hours' => '指定时间(小时)', + 'threadlist_orderby_hours_comment' => '指定时间内浏览次数倒序排序的时间值', + 'threadlist_orderby_todayhots' => '按当天累计售出数倒序排序', + 'threadlist_orderby_weekhots' => '按本周累计售出数倒序排序', + 'threadlist_orderby_monthhots' => '按当月累计售出数倒序排序', + 'threadlist_lastpost' => '最后更新时间', + 'threadlist_postdateline' => '主题发布时间', + 'threadlist_postdateline_nolimit' => '不限制', + 'threadlist_postdateline_hour' => '1小时内', + 'threadlist_postdateline_day' => '24小时内', + 'threadlist_postdateline_week' => '7天内', + 'threadlist_postdateline_month' => '1个月内', + 'threadlist_lastpost_nolimit' => '不限制', + 'threadlist_lastpost_hour' => '1小时内', + 'threadlist_lastpost_day' => '24小时内', + 'threadlist_lastpost_week' => '7天内', + 'threadlist_lastpost_month' => '1个月内', + 'threadlist_price_add' => ' 附加 ', + 'threadlist_place' => '活动地点', + 'threadlist_class' => '活动类型', + 'threadlist_gender' => '性别要求', + 'threadlist_gender_0' => '不限', + 'threadlist_gender_1' => '男', + 'threadlist_gender_2' => '女', + 'threadlist_orderby_weekstart' => '按一周内活动开始时间排序', + 'threadlist_orderby_monthstart' => '按一月内活动开始时间排序', + 'threadlist_orderby_weekexp' => '按一周内报名截止时间排序', + 'threadlist_orderby_monthexp' => '按一月内报名截止时间排序', + 'threadlist_highlight' => '获得高亮值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_topiclist.php b/source/language/block/lang_topiclist.php new file mode 100644 index 0000000..fb17084 --- /dev/null +++ b/source/language/block/lang_topiclist.php @@ -0,0 +1,34 @@ + '指定专题', + 'topiclist_topicids_comment' => '填入指定专题的ID(topicid),多个专题之间用逗号(,)分隔', + 'topiclist_uids' => '创建者UID', + 'topiclist_uids_comment' => '填入指定专题创建者的ID(uid),多个用户之间用逗号(,)分隔', + 'topiclist_startrow' => '起始数据行数', + 'topiclist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'topiclist_titlelength' => '标题长度', + 'topiclist_titlelength_comment' => '指定专题标题最大长度', + 'topiclist_summarylength' => '介绍长度', + 'topiclist_summarylength_comment' => '指定专题介绍最大长度', + 'topiclist_picrequired' => '过滤无封面专题', + 'topiclist_picrequired_comment' => '是否过滤没有封面图片的专题', + 'topiclist_orderby' => '专题排序方式', + 'topiclist_orderby_comment' => '设置以哪一字段或方式对专题进行排序', + 'topiclist_orderby_dateline' => '按发布时间倒序', + 'topiclist_orderby_viewnum' => '按查看数倒序', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_tradelist.php b/source/language/block/lang_tradelist.php new file mode 100644 index 0000000..ff520eb --- /dev/null +++ b/source/language/block/lang_tradelist.php @@ -0,0 +1,98 @@ + '所在版块', + 'tradelist_fids_comment' => '设置允许参与新帖调用的版块,可以按住 CTRL 多选,全选或全不选均为不做限制', + 'tradelist_uids' => '用户UID', + 'tradelist_uids_comment' => '设置要指定显示的用户UID,多个 UID 请用半角逗号“,”隔开。', + 'tradelist_startrow' => '起始数据行数', + 'tradelist_startrow_comment' => '如需设定起始的数据行数,请输入具体数值,0 为从第一行开始,以此类推', + 'tradelist_items' => '显示数据条数', + 'tradelist_items_comment' => '设置一次显示的主题条目数,请设置为大于 0 的整数', + 'tradelist_titlelength' => '标题最大字节数', + 'tradelist_titlelength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'tradelist_fnamelength' => '标题最大字节数包含版块名称', + 'tradelist_fnamelength_comment' => '设置标题长度是否将所在版块名称的长度一同计算在内', + 'tradelist_summarylength' => '主题简短内容文字数', + 'tradelist_summarylength_comment' => '设置主题简短内容的文字数,0 为使用默认值 255', + 'tradelist_tids' => '指定主题', + 'tradelist_tids_comment' => '设置要指定显示的主题 tid ,多个 tid 请用半角逗号“,”隔开。注意: 留空为不进行任何过滤', + 'tradelist_keyword' => '标题关键字', + 'tradelist_keyword_comment' => '设置标题包含的关键字。注意: 留空为不进行任何过滤; 关键字中可使用通配符 *; 匹配多个关键字全部,可用空格或 AND 连接。如 win32 AND unix; 匹配多个关键字其中部分,可用 | 或 OR 连接。如 win32 OR unix', + 'tradelist_typeids' => '主题分类', + 'tradelist_typeids_comment' => '设置特定分类的主题。注意: 全选或全不选均为不进行任何过滤', + 'tradelist_typeids_all' => '全部的主题分类', + 'tradelist_sortids' => '分类信息', + 'tradelist_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', + 'tradelist_sortids_all' => '全部的分类信息', + 'tradelist_digest' => '精华主题过滤', + 'tradelist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'tradelist_digest_0' => '普通主题', + 'tradelist_digest_1' => '精华 I', + 'tradelist_digest_2' => '精华 II', + 'tradelist_digest_3' => '精华 III', + 'tradelist_stick' => '置顶主题过滤', + 'tradelist_stick_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'tradelist_stick_0' => '普通主题', + 'tradelist_stick_1' => '置顶 I', + 'tradelist_stick_2' => '置顶 II', + 'tradelist_stick_3' => '置顶 III', + 'tradelist_special' => '特殊主题过滤', + 'tradelist_special_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', + 'tradelist_special_1' => '投票主题', + 'tradelist_special_2' => '商品主题', + 'tradelist_special_3' => '悬赏主题', + 'tradelist_special_4' => '活动主题', + 'tradelist_special_5' => '辩论主题', + 'tradelist_special_0' => '普通主题', + 'tradelist_special_reward' => '悬赏主题过滤', + 'tradelist_special_reward_comment' => '设置特定类型的悬赏主题', + 'tradelist_special_reward_0' => '全部', + 'tradelist_special_reward_1' => '已解决', + 'tradelist_special_reward_2' => '未解决', + 'tradelist_recommend' => '推荐主题过滤', + 'tradelist_recommend_comment' => '设置是否只显示推荐的主题', + 'tradelist_orderby' => '主题排序方式', + 'tradelist_orderby_comment' => '设置以哪一字段或方式对主题进行排序', + 'tradelist_orderby_lastpost' => '按最后回复时间倒序排序', + 'tradelist_orderby_dateline' => '按发布时间倒序排序', + 'tradelist_orderby_replies' => '按回复数倒序排序', + 'tradelist_orderby_views' => '按浏览次数倒序排序', + 'tradelist_orderby_heats' => '按热度倒序排序', + 'tradelist_orderby_recommends' => '按主题评价倒序排序', + 'tradelist_orderby_hourviews' => '按指定时间内浏览次数倒序排序', + 'tradelist_orderby_todayviews' => '按当天浏览次数倒序排序', + 'tradelist_orderby_weekviews' => '按本周浏览次数倒序排序', + 'tradelist_orderby_monthviews' => '按当月浏览次数倒序排序', + 'tradelist_orderby_hours' => '指定时间(小时)', + 'tradelist_orderby_hours_comment' => '指定时间内浏览次数倒序排序的时间值', + 'tradelist_orderby_todayhots' => '按当天累计售出数倒序排序', + 'tradelist_orderby_weekhots' => '按本周累计售出数倒序排序', + 'tradelist_orderby_monthhots' => '按当月累计售出数倒序排序', + 'tradelist_price_add' => ' 附加 ', + 'tradelist_place' => '活动地点', + 'tradelist_class' => '活动类型', + 'tradelist_gender' => '性别要求', + 'tradelist_gender_0' => '不限', + 'tradelist_gender_1' => '男', + 'tradelist_gender_2' => '女', + 'tradelist_orderby_weekstart' => '按一周内活动开始时间排序', + 'tradelist_orderby_monthstart' => '按一月内活动开始时间排序', + 'tradelist_orderby_weekexp' => '按一周内报名截止时间排序', + 'tradelist_orderby_monthexp' => '按一月内报名截止时间排序', + 'tradelist_highlight' => '获得高亮值', +); + +?> \ No newline at end of file diff --git a/source/language/block/lang_vedio.php b/source/language/block/lang_vedio.php new file mode 100644 index 0000000..7513201 --- /dev/null +++ b/source/language/block/lang_vedio.php @@ -0,0 +1,20 @@ + '视频地址', + 'vedio_width' => '视频宽度', + 'vedio_height' => '视频高度', +); +?> \ No newline at end of file diff --git a/source/language/email/index.htm b/source/language/email/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/language/email/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/language/email/lang_template.php b/source/language/email/lang_template.php new file mode 100644 index 0000000..1076a42 --- /dev/null +++ b/source/language/email/lang_template.php @@ -0,0 +1,138 @@ + '您好', + 'moderate_member_invalidate' => '否决', + 'moderate_member_delete' => '删除', + 'moderate_member_validate' => '通过', + + 'comma' => ',', + 'show_sender' => '这封信是由 {$var[\'bbname\']} 发送的。', + 'show_reason' => '您收到这封邮件,是由于', + 'have_not_visit' => '如果您并没有访问过 {$var[\'bbname\']},', + 'have_not_do_this' => '或没有进行上述操作,', + 'not_interested' => '如果您对此不感兴趣,', + 'ignore_email' => '请忽略这封邮件。', + 'no_more_action' => '您不需要退订或进行其他进一步的操作。', + 'important' => '重要!', + 'if_not_link' => '如果上面不是链接形式,请将该地址手工粘贴到浏览器地址栏再访问', + 'msg_start' => '信件原文开始', + 'msg_end' => '信件原文结束', + 'not_responsible' => '网站管理团队不会对这类邮件负责。', + 'show_ip' => '本请求提交者的 IP 为 {$var[\'clientip\']}', + 'welcome_visit' => '欢迎您访问 {$_G[\'setting\'][\'bbname\']}', + 'thanks_for_visit' => '感谢您的访问,祝您使用愉快!', + 'sincerely' => '此致', + 'admin_team' => '{$var[\'bbname\']} 管理团队', + + + 'get_passwd_subject' => '取回密码说明', + 'get_passwd_reason' => '这个邮箱地址在 {$var[\'bbname\']} 被登记为用户邮箱,且该用户请求使用 Email 密码重置功能所致。', + 'get_passwd_if_not' => '如果您没有提交密码重置的请求或不是 {$var[\'bbname\']} 的注册用户,请立即忽略并删除这封邮件。只有在您确认需要重置密码的情况下,才需要继续阅读下面的内容。', + 'get_passwd_explain' => '密码重置说明', + 'get_passwd_click_link' => '您只需在提交请求后的三天内,通过点击下面的链接重置您的密码:', + 'get_passwd_new_pwd' => '在上面的链接所打开的页面中输入新的密码后提交,您即可使用新的密码登录网站了。您可以在用户控制面板中随时修改您的密码。', + + 'password_reset_subject' => '密码变更提示', + 'password_reset_reason' => '在 {$var[\'bbname\']} 被登记为用户邮箱,且该用户操作重置或者变更了密码所致。', + 'password_reset_if_not' => '如果您不是 {$var[\'bbname\']} 的注册用户,请立即忽略并删除这封邮件。只有在您是 {$var[\'bbname\']} 的注册用户的情况下,才需要继续阅读下面的内容。', + 'password_reset_explain' => '您在 {$var[\'bbname\']} 的用户账户 {$var[\'username\']} 在 {$var[\'datetime\']} 进行了密码变更或重置。', + 'password_reset_if_not_user_op' => '如果您没有操作密码变更或者重置,请您立即登录 {$var[\'bbname\']} 检查账户情况,并进行变更密码操作。', + 'password_reset_if_not_user_op_help' => '在处理问题时如果您有任何问题或需要帮助(如冻结账户),请联系 {$var[\'bbname\']} 管理团队获取更多帮助与支持。', + + 'email_verify_subject' => 'Email 地址验证', + 'email_verify_reason' => '在 {$var[\'bbname\']} 进行了新用户注册,或用户修改 Email 使用了这个邮箱地址。', + 'email_verify_explain' => '账号激活说明', + 'email_verify_explain2' => '如果您是 {$var[\'bbname\']} 的新用户,或在修改您的注册 Email 时使用了本地址,我们需要对您的地址有效性进行验证以避免垃圾邮件或地址被滥用。', + 'email_verify_click_link' => '您只需点击下面的链接即可激活您的账号:', + + 'email_reset_subject' => 'Email 地址变更提示', + 'email_reset_reason' => '在 {$var[\'bbname\']} 被登记为用户邮箱,且该用户操作 Email 地址变更所致。', + 'email_reset_if_not' => '如果您不是 {$var[\'bbname\']} 的注册用户,请立即忽略并删除这封邮件。只有在您是 {$var[\'bbname\']} 的注册用户的情况下,才需要继续阅读下面的内容。', + 'email_reset_explain' => '您在 {$var[\'bbname\']} 的用户账户 {$var[\'username\']} 在 {$var[\'datetime\']} 进行了 Email 地址变更。', + 'email_reset_new_email' => '新的 Email 地址为:{$var[\'email\']} ,验证邮件发送时间为:{$var[\'request_datetime\']}', + 'email_reset_if_not_user_op' => '如果您没有操作 Email 地址变更,请您立即登录 {$var[\'bbname\']} 检查账户情况,并进行变更密码和 Email 地址变更操作。', + 'email_reset_if_not_user_op_help' => '在处理问题时如果您有任何问题或需要帮助(如冻结账户),请联系 {$var[\'bbname\']} 管理团队获取更多帮助与支持。', + + 'secmobile_reset_subject' => '安全手机号变更提示', + 'secmobile_reset_reason' => '在 {$var[\'bbname\']} 被登记为用户邮箱,且该用户操作变更了安全手机号所致。', + 'secmobile_reset_if_not' => '如果您不是 {$var[\'bbname\']} 的注册用户,请立即忽略并删除这封邮件。只有在您是 {$var[\'bbname\']} 的注册用户的情况下,才需要继续阅读下面的内容。', + 'secmobile_reset_explain' => '您在 {$var[\'bbname\']} 的用户账户 {$var[\'username\']} 在 {$var[\'datetime\']} 进行了安全手机号变更。', + 'secmobile_reset_new_secmobile' => '新的安全手机号为:{$var[\'secmobile\']}', + 'secmobile_reset_if_not_user_op' => '如果您没有操作安全手机号变更,请您立即登录 {$var[\'bbname\']} 检查账户情况,并进行变更密码和安全手机号变更操作。', + 'secmobile_reset_if_not_user_op_help' => '在处理问题时如果您有任何问题或需要帮助(如冻结账户),请联系 {$var[\'bbname\']} 管理团队获取更多帮助与支持。', + + 'email_register_subject' => '论坛注册地址', + 'email_register_reason' => '在 {$var[\'bbname\']} 获取了新用户注册地址使用了这个邮箱地址。', + 'email_register_explain' => '新用户注册说明', + 'email_register_click_link' => '您只需点击下面的链接即可进行用户注册,以下链接有效期为3天。过期可以重新请求发送一封新的邮件验证:', + + 'add_member_subject' => '您被添加成为会员', + 'add_member_intro' => '我是 {$var[\'adminusername\']} ,{$var[\'bbname\']} 的管理者之一。', + 'add_member_reason' => '您刚刚被添加成为 {$var[\'bbname\']} 的会员,当前 Email 即是我们为您注册的邮箱地址。', + 'add_member_no_interest' => '如果您对 {$var[\'bbname\']} 不感兴趣或无意成为会员,', + 'add_member_info' => '账号信息', + 'add_member_bbname' => '网站名称:', + 'add_member_siteurl' => '网站地址:', + 'add_member_newusername' => '用户名:', + 'add_member_newpassword' => '密码:', + 'add_member_can_login' => '从现在起您可以使用您的账号登录 {$var[\'bbname\']},祝您使用愉快!', + + 'birthday_subject' => '祝您生日快乐', + 'birthday_reason' => '这个邮箱地址在 {$var[\'bbname\']} 被登记为用户邮箱,
          +并且按照您填写的信息,今天是您的生日。很高兴能在此时为您献上一份生日祝福,
          +我谨代表{$var[\'bbname\']}管理团队,衷心祝福您生日快乐。', + 'birthday_if_not' => '如果您并非 {$var[\'bbname\']} 的会员,或今天并非您的生日,可能是有人误用了您的邮件地址,
          +或错误的填写了生日信息。本邮件不会多次重复发送,', + + 'email_to_friend_subject' => '{$_G[\'member\'][\'username\']} 推荐给您: {$thread[\'subject\']}', + 'email_to_friend_sender' => '这封信是由 {$_G[\'setting\'][\'bbname\']} 的 {$_G[\'member\'][\'username\']} 发送的。', + 'email_to_friend_reason' => '在 {$_G[\'member\'][\'username\']} 通过 {$_G[\'setting\'][\'bbname\']} 的“推荐给朋友”功能推荐了如下的内容给您。', + 'email_to_friend_not_official' => '请注意这封信仅仅是由用户使用 “推荐给朋友”发送的,不是网站官方邮件,', + + 'email_to_invite_subject' => '您的朋友 {$_G[\'member\'][\'username\']} 发送 {$_G[\'setting\'][\'bbname\']} 网站注册邀请码给您', + 'email_to_invite_reason' => ' {$_G[\'member\'][\'username\']} 通过 {$var[\'bbname\']} 的“发送邀请码给朋友” 功能推荐了如下的内容给您。', + 'email_to_invite_not_official' => '请注意这封信仅仅是由用户使用 “发送邀请码给朋友”发送的,不是网站官方邮件,', + + 'invitemail_subject' => '{username}邀请您加入{sitename},并成为好友', + 'invitemail_from' => 'Hi,我是{$var[\'username\']},邀请您也加入{$var[\'sitename\']}并成为我的好友', + 'invitemail_reason' => '请加入到我的好友中,您就可以了解我的近况,与我一起交流,随时与我保持联系。', + 'invitemail_start' => '邀请附言:', + 'invitemail_accept_invite' => '请您点击以下链接,接受好友邀请:', + 'invitemail_viewpage' => '如果您拥有{$var[\'sitename\']}上面的账号,请点击以下链接查看我的个人主页:', + + 'moderate_member_subject' => '用户审核结果通知', + 'moderate_member_reason' => '这个邮箱地址在 {$var[\'bbname\']} 被新用户注册时所使用,且管理员设置了对新用户需要进行人工审核,本邮件将通知您提交申请的审核结果。', + 'moderate_member_info' => '注册信息与审核结果', + 'moderate_member_username' => '用户名:', + 'moderate_member_regdate' => '注册时间:', + 'moderate_member_submitdate' => '提交时间:', + 'moderate_member_submittimes' => '提交次数:', + 'moderate_member_msg' => '注册原因:', + 'moderate_member_modresult' => '审核结果:', + 'moderate_member_moddate' => '审核时间:', + 'moderate_member_adminusername' => '审核管理员:', + 'moderate_member_remark' => '管理员留言:', + 'moderate_member_explain' => '审核结果说明', + 'moderate_member_explain1' => '通过: 您的注册已通过审核,您已成为 {$var[\'bbname\']} 的正式用户。', + 'moderate_member_explain2' => '否决: 您的注册信息不完整,或未满足我们对新用户的某些要求,您可以根据管理员留言,完善您的注册信息,然后再次提交。', + 'moderate_member_explain3' => '删除:您的注册由于与我们的要求偏差较大,或本站的新注册人数已超过预期,申请已被否决。您的账号已从数据库中删除,将无法再使用其登录或提交再次审核,请您谅解。', + + 'adv_expiration_subject' => '您站点的广告将于 {day} 天后到期,请及时处理', + 'adv_expiration_msg' => '您站点的以下广告将于 {$var[\'day\']} 天后到期,请及时处理:', +); + +?> \ No newline at end of file diff --git a/source/language/forum/index.htm b/source/language/forum/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/language/forum/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/language/forum/lang_archiver.php b/source/language/forum/lang_archiver.php new file mode 100644 index 0000000..69f9a4c --- /dev/null +++ b/source/language/forum/lang_archiver.php @@ -0,0 +1,27 @@ + '页', + 'replies' => '篇回复', + 'anonymous' => '匿名', + 'full_version' => '查看完整版本', + 'forum_nonexistence' => '抱歉,您没有权限访问这个论坛的存档或该论坛不存在', + 'thread_nonexistence' => '抱歉,您没有权限查看这个话题或该话题不存在', + 'post_time' => '发表于', + +); + +?> \ No newline at end of file diff --git a/source/language/forum/lang_dz_feed.php b/source/language/forum/lang_dz_feed.php new file mode 100644 index 0000000..138a1ef --- /dev/null +++ b/source/language/forum/lang_dz_feed.php @@ -0,0 +1,61 @@ + '{actor} 发表的主题 {subject} 被 {operater} 置顶', + + 'feed_thread_digest_title' => '{actor} 发表的主题 {subject} 被 {operater} 加精', + + 'feed_thread_highlight_title' => '{actor} 发表的主题 {subject} 被 {operater} 高亮', + + 'feed_thread_del_title' => '{actor} 发表的主题 {subject} 被 {operater} 删除', + + 'feed_thread_move_title' => '{actor} 发表的主题 {subject} 被 {operater} 移动', + + 'feed_thread_views_title' => '{actor} 发表的主题 {subject} 查看数超过了 {count}', + + 'feed_thread_replies_title' => '{actor} 发表的主题 {subject} 回复数超过了 {count}', + + 'feed_thread_rate_title' => '{actor} 发表的主题 {subject} 评分超过了 {count}', + + 'feed_thread_magic_title' => '{actor} 发表的主题 {subject} 被 {operater} 使用了 {magiccard}', + + 'feed_thread_recommend_title' => '{actor} 发表的主题 {subject} 被版主推荐', + + 'feed_post_rate_title' => '{actor} 在 {thread} 的回复评分超过了{count}', + + 'feed_post_magic_title' => '{actor} 在 {thread} 的回复被 {operater} 使用了 {magiccard}', + + 'feed_user_profile_title' => '{actor} 更新了自己的个人资料', + + 'feed_user_usergroup_title' => '{actor} 的用户组升级为 {usergroup}', + + 'feed_user_credit_title' => '{actor} 的总积分达到 {count}', + + 'feed_user_threads_title' => '{actor} 发表的主题数达到 {count}', + + 'feed_user_posts_title' => '{actor} 的发帖数达到 {count}', + + 'feed_user_digest_title' => '{actor} 的精华帖数达到 {count}', + + 'feed_user_medal_title' => '{actor} 得到勋章 {medal} 奖励', + + 'feed_announce_title' => '公告: {subject}', + 'feed_announce_body' => '{message}', + + 'you' => '您', + +); + +?> \ No newline at end of file diff --git a/source/language/forum/lang_misc.php b/source/language/forum/lang_misc.php new file mode 100644 index 0000000..26968c9 --- /dev/null +++ b/source/language/forum/lang_misc.php @@ -0,0 +1,333 @@ + 'misc', + 'contact' => '联系方式:', + 'anonymous' => '匿名', + 'anonymoususer' => '匿名者', + 'guestuser' => '游客', + 'has_expired' => '该信息已经过期', + 'click_view' => '点击查看', + 'never_expired' => '永不过期', + 'sort_update' => '更新', + 'sort_upload' => '上传', + 'view_noperm' => '隐藏内容', + 'post_hidden' => '**** 本内容被作者隐藏 ****', + 'post_sold' => '**** 本内容购买后可见 ****', + 'post_banned' => '**** 作者被禁止或删除 内容自动屏蔽 ****', + 'post_single_banned' => '**** 该帖被屏蔽 ****', + 'message_ishidden_hiddenreplies' => '此帖仅作者可见', + 'post_reply_quote' => '{author} 发表于 {time}', + 'post_edit' => "[i=s] 本帖最后由 {editor} 于 {edittime} 编辑 [/i]\n\n", + 'post_edit_regexp' => '/^\[i=s\] 本帖最后由 .*? 于 .*? 编辑 \[\/i\][\r\n][\r\n]/s', + 'post_edithtml' => '[i=s] 本帖最后由 {editor} 于 {edittime} 编辑 [/i]

          ', + 'post_edithtml_regexp' => '/^\[i=s\] 本帖最后由 .*? 于 .*? 编辑 \[\/i\]<br \/><br \/>/s', + 'post_editnobbcode' => "[ 本帖最后由 {editor} 于 {edittime} 编辑 ]\n\n", + 'post_editnobbcode_regexp' => '/^\[ 本帖最后由 .*? 于 .*? 编辑 \][\r\n][\r\n]/s', + 'post_reply' => '回复', + 'post_thread' => '的文章', + + 'price' => '售价', + 'pay_view' => '记录', + 'attachment_buy' => '购买', + + 'post_trade_yuan' => '元', + 'post_trade_seller' => '卖家', + 'post_trade_name' => '商品名称', + 'post_trade_price' => '商品价格', + 'post_trade_quality' => '商品成色', + 'post_trade_locus' => '所在地点', + 'post_trade_transport_type' => '物流方式', + 'post_trade_transport_seller' => '卖家承担运费', + 'post_trade_transport_buyer' => '买家承担运费', + 'post_trade_transport_mail' => '平邮', + 'post_trade_transport_express' => '快递', + 'post_trade_transport_virtual' => '虚拟物品或无需邮递', + 'post_trade_transport_physical' => '买家收到货物后直接支付给物流公司', + 'post_trade_locus' => '所在地点', + 'post_trade_description' => '商品描述', + 'post_trade_pm_subject' => '[议价]', + 'post_trade_pm_buynum' => '购买数量', + 'post_trade_pm_wishprice' => '我期望的价格是', + 'post_trade_pm_reason' => '我议价的理由是', + 'postappend_content' => '补充内容', + 'payment_unit' => '元', + + 'attach' => '附件', + 'attach_pay' => '收费附件', + 'attach_credits_policy' => '查看积分策略说明', + 'attach_img' => '图片附件', + 'attach_readperm' => '阅读权限', + 'attach_img_zoom' => '点击在新窗口查看全图\\nCTRL+鼠标滚轮放大或缩小', + 'attach_img_thumb' => '点击在新窗口查看全图', + 'attach_downloads' => '下载次数', + + 'post_trade_transport' => '邮费', + 'post_trade_transport_mail' => '平邮', + 'post_trade_quality' => '商品成色', + 'post_trade_quality_new' => '全新', + 'post_trade_quality_secondhand' => '二手', + + 'trade_unstart' => '未生效的交易', + 'trade_waitbuyerpay' => '等待买家付款', + 'trade_waitsellerconfirm' => '交易已创建,等待卖家确认', + 'trade_sysconfirmpay' => '确认买家付款中,暂勿发货', + 'trade_waitsellersend' => '买家已付款,等待卖家发货', + 'trade_waitbuyerconfirm' => '卖家已发货,买家确认中', + 'trade_syspayseller' => '买家确认收到货,等待支付宝打款给卖家', + 'trade_finished' => '交易成功结束', + 'trade_closed' => '交易中途关闭(未完成)', + 'trade_waitselleragree' => '等待卖家同意退款', + 'trade_sellerrefusebuyer' => '卖家拒绝买家条件,等待买家修改条件', + 'trade_waitbuyerreturn' => '卖家同意退款,等待买家退货', + 'trade_waitsellerconfirmgoods' => '等待卖家收货', + 'trade_waitalipayrefund' => '双方已经一致,等待支付宝退款', + 'trade_alipaycheck' => '支付宝处理中', + 'trade_overedrefund' => '结束的退款', + 'trade_refundsuccess' => '退款成功', + 'trade_refundclosed' => '退款关闭', + + 'trade_offline_1' => '交易单生效', + 'trade_offline_4' => '我已付款,等待卖家发货', + 'trade_offline_5' => '我已发货', + 'trade_offline_7' => '我收到货,交易成功结束', + 'trade_offline_8' => '取消此次交易', + 'trade_offline_10' => '我要退货,等待卖家同意退款', + 'trade_offline_11' => '卖家拒绝退款', + 'trade_offline_12' => '卖家同意退款', + 'trade_offline_13' => '我已退货,等待卖家收货', + 'trade_offline_17' => '卖家收到退货,已退款', + + 'trade_message_4' => '可输入付款方式、银行账号等信息', + 'trade_message_5' => '可输入发货公司、发货单号等信息', + 'trade_message_13' => '可输入发货公司、发货单号等信息', + + 'credit_payment' => '积分充值', + 'credit_forum_payment' => '论坛积分充值', + 'credit_forum_royalty' => '交易手续费', + + 'credit_total' => '总积分', + + 'invite_payment' => '购买邀请码', + 'invite_forum_payment' => '购买邀请码', + 'invite_forum_payment_unit' => '个', + 'invite_forum_royalty' => '交易手续费', + + 'formulaperm_regdate' => '注册时间', + 'formulaperm_regday' => '注册天数', + 'formulaperm_regip' => '注册 IP', + 'formulaperm_lastip' => '最后登录 IP', + 'formulaperm_buyercredit' => '买家信用评价', + 'formulaperm_sellercredit' => '卖家信用评价', + 'formulaperm_digestposts' => '精华帖数', + 'formulaperm_posts' => '发帖数', + 'formulaperm_threads' => '主题数', + 'formulaperm_oltime' => '在线时间(小时)', + 'formulaperm_pageviews' => '页面浏览量', + 'formulaperm_and' => '并且', + 'formulaperm_or' => '或者', + 'formulaperm_extcredits' => '自定义积分', + + 'login_normal_mode' => '在线', + 'login_switch_invisible_mode' => '切换在线状态', + 'login_switch_normal_mode' => '我要上线', + 'login_invisible_mode' => '隐身', + + 'eccredit_explain' => '解释', + + 'modcp_logs_action_home' => '内部留言', + 'modcp_logs_action_moderate' => '审核', + 'modcp_logs_action_member' => '用户管理', + 'modcp_logs_action_forumaccess' => '用户权限', + 'modcp_logs_action_thread' => '主题管理', + 'modcp_logs_action_forum' => '版块管理', + 'modcp_logs_action_announcement' => '公告', + 'modcp_logs_action_log' => '管理日志', + 'modcp_logs_action_stat' => '管理统计', + + 'modcp_logs_action_login' => '登录', + + 'uch_selectalbum' => '请选择相册', + 'uch_noalbum' => '抱歉,您还没有相册,', + 'click_here' => '点击这里', + 'uch_createalbum' => '创建自己的相册吧!', + + 'pm_from' => '发件人', + 'pm_to' => '收件人', + 'pm_date' => '日期', + + 'share_message' => '您好!我在 {$_G[\'setting\'][\'bbname\']} 看到了这篇文章,认为很有价值,特推荐给您。\\n\\n$thread[\'subject\']\\n地址 [url={$threadurl}]{$threadurl}[/url]\\n\\n希望您能喜欢', + + 'week_0' => '星期日', + 'week_1' => '星期一', + 'week_2' => '星期二', + 'week_3' => '星期三', + 'week_4' => '星期四', + 'week_5' => '星期五', + 'week_6' => '星期六', + + 'y_m_d' => 'Y年m月d日', + + 'notice_actor' => '等 $actorcount 人', + + 'perms_allowvisit' => '访问论坛', + 'perms_readaccess' => '阅读权限', + 'perms_allowviewpro' => '查看用户资料', + 'perms_allowinvisible' => '隐身', + 'perms_allowsearch' => '使用搜索', + 'perms_allownickname' => '使用昵称', + 'perms_allowcstatus' => '自定义头衔', + 'perms_allowpost' => '发新话题', + 'perms_allowreply' => '发表回复', + 'perms_allowpostpoll' => '发起投票', + 'perms_allowvote' => '参与投票', + 'perms_allowpostreward' => '发表悬赏', + 'perms_allowpostactivity' => '发表活动', + 'perms_allowpostdebate' => '发表辩论', + 'perms_allowposttrade' => '发表交易', + 'perms_maxsigsize' => '最大签名长度', + 'perms_allowsigbbcode' => '签名中使用编辑器代码', + 'perms_allowsigimgcode' => '签名中使用 [img] 代码', + 'perms_maxbiosize' => '自我介绍最大长度', + 'perms_allowrecommend' => '主题评价影响值', + 'perms_allowbiobbcode' => '自我介绍中使用编辑器代码', + 'perms_allowbioimgcode' => '自我介绍中使用 [img] 代码', + 'perms_allowgetattach' => '下载附件', + 'perms_allowgetimage' => '查看图片', + 'perms_allowpostattach' => '上传附件', + 'perms_allowpostimage' => '上传图片', + 'perms_allowsetattachperm' => '允许设置附件权限', + 'perms_maxspacesize' => '空间大小', + 'perms_maxattachsize' => '单个最大附件尺寸', + 'perms_maxsizeperday' => '每天最大附件总尺寸', + 'perms_maxattachnum' => '每天最大附件数量', + 'perms_allowbioimgcode' => '自我介绍中使用 [img] 代码', + 'perms_attachextensions' => '附件类型', + 'perms_allowstickthread' => '主题置顶', + 'perms_allowdigestthread' => '主题精华', + 'perms_allowstickthread_value' => '置顶', + 'perms_allowdigestthread_value' => '精华', + 'perms_allowbumpthread' => '提升主题', + 'perms_allowhighlightthread' => '主题高亮', + 'perms_allowrecommendthread' => '主题推荐', + 'perms_allowstampthread' => '主题鉴定', + 'perms_allowclosethread' => '主题关闭', + 'perms_allowmovethread' => '主题移动', + 'perms_allowedittypethread' => '编辑主题分类', + 'perms_allowcopythread' => '主题复制', + 'perms_allowmergethread' => '主题合并', + 'perms_allowsplitthread' => '主题分割', + 'perms_allowrepairthread' => '主题修复', + 'perms_allowrefund' => '强制退款', + 'perms_alloweditpoll' => '编辑投票', + 'perms_allowremovereward' => '移除悬赏', + 'perms_alloweditactivity' => '管理活动', + 'perms_allowedittrade' => '管理商品', + 'perms_alloweditpost' => '编辑文章', + 'perms_allowwarnpost' => '警告文章', + 'perms_allowbanpost' => '屏蔽文章', + 'perms_allowdelpost' => '删除文章', + 'perms_allowviewreport' => '查看用户报告', + 'perms_allowmodpost' => '审核文章', + 'perms_allowmoduser' => '审核用户', + 'perms_allowbanuser' => '禁止用户', + 'perms_allowbanip' => '禁止 IP', + 'perms_allowedituser' => '编辑用户', + 'perms_allowmassprune' => '批量删帖', + 'perms_allowpostannounce' => '发布公告', + 'perms_disablepostctrl' => '发帖不受限制', + 'perms_allowviewip' => '允许查看 IP', + 'perms_viewperm' => '浏览版块', + 'perms_postperm' => '发新话题', + 'perms_replyperm' => '发表回复', + 'perms_getattachperm' => '下载附件', + 'perms_postattachperm' => '上传附件', + 'perms_postimageperm' => '上传图片', + 'perms_allowblog' => '发表日志', + 'perms_allowdoing' => '发表记录', + 'perms_allowupload' => '上传图片', + 'perms_allowshare' => '发布分享', + 'perms_allowpoke' => '允许打招呼', + 'perms_allowfriend' => '允许加好友', + 'perms_allowclick' => '允许表态', + 'perms_allowcomment' => '发表留言/评论', + 'perms_allowstatdata' => '查看统计数据报表', + 'perms_allowstat' => '允许查看趋势统计', + 'perms_allowpostarticle' => '发表文章', + 'perms_raterange' => '允许参与评分', + 'perms_allowcommentpost' => '允许参与点评', + 'perms_allowat' => '允许 @ 的人数', + 'perms_allowreplycredit' => '允许设置回帖奖励', + 'perms_allowposttag' => '允许使用标签', + 'perms_allowcreatecollection' => '允许创建淘专辑的数量', + 'perms_allowsendpm' => '允许发短消息', + 'perms_maximagesize' => '单张图片最大尺寸', + 'perms_allowmediacode' => '允许使用多媒体代码', + + 'join_topic' => '参与话题', + 'join_poll' => '参与投票', + 'buy_trade' => '购买商品', + 'join_reward' => '参与悬赏', + 'join_activity' => '参与活动', + 'join_debate' => '参与辩论', + 'at_invite' => '@我的好友', + + 'lower' => '低于', + 'higher' => '高于', + 'report_msg_your' => '您的 ', + 'report_noreward' => '不奖惩', + 'activity_viewimg' => '点击查看', + + 'crime_postreason' => '{reason}   查看详情', + 'crime_reason' => '{reason}', + + 'connectguest_message_search' => array('尚未登录', '先登录'), + 'connectguest_message_replace' => array('尚未 完善账号信息绑定已有账号 ', '先 完善账号信息绑定已有账号 '), + 'connectguest_message_mobile_search' => array('尚未登录', '先登录'), + 'connectguest_message_mobile_replace' => '在电脑版完善资料或绑定已有账号,', + + 'avatar' => '头像', + 'signature' => '签名', + 'custom_title' => '自定义头衔', + + 'forum_guide' => '导读', + + 'patch_site_have' => '您的网站有', + 'patch_is_fixed' => '个安全漏洞,已修复', + 'patch_need_fix' => '个安全漏洞,请尽快修复', + 'patch_fixed_status' => '已修复', + 'patch_unfix_status' => '未修复', + 'patch_fix_failed_status' => '修复失败', + 'patch_fix_right_now' => '立即修复', + 'patch_view_fix_detail' => '查看详情', + 'patch_name' => '漏洞名称', + 'patch_dateline' => '发布日期', + 'patch_status' => '当前状态', + 'patch_close' => '关闭', + + 'plugin_title' => '应用更新提醒', + 'plugin_memo' => '您有 {number} 款应用有可用更新', + 'plugin_link' => '现在更新', + + 'seccode' => '验证码', + 'seccode_update' => '换一个', + 'seccode_player' => ' 播放验证码', + 'secqaa' => '验证问答', + + 'mobileoem_creditrule' => '掌上论坛签到', + +); + +?> \ No newline at end of file diff --git a/source/language/forum/lang_modaction.php b/source/language/forum/lang_modaction.php new file mode 100644 index 0000000..c7693af --- /dev/null +++ b/source/language/forum/lang_modaction.php @@ -0,0 +1,95 @@ + '编辑', + + 'DEL' => '删除', + 'DLP' => '删除回复', + 'DCM' => '删除点评', + 'PRN' => '批量删帖', + 'UDL' => '反删除', + + 'DIG' => '加入精华', + 'UDG' => '解除精华', + 'EDI' => '限时精华', + 'UED' => '解除限时精华', + + 'CLS' => '关闭', + 'OPN' => '打开', + 'ECL' => '限时关闭', + 'UEC' => '解除限时关闭', + 'EOP' => '限时打开', + 'UEO' => '解除限时打开', + + 'STK' => '置顶', + 'UST' => '解除置顶', + 'EST' => '限时置顶', + 'UES' => '解除限时置顶', + + 'SPL' => '分割', + 'MRG' => '合并', + + 'HLT' => '设置高亮', + 'UHL' => '解除高亮', + 'EHL' => '限时高亮', + 'UEH' => '解除限时高亮', + + 'BMP' => '提升', + 'DWN' => '下沉', + + 'MOV' => '移动', + 'CPY' => '复制', + 'TYP' => '分类', + + 'RFD' => '强制退款', + + 'MOD' => '审核通过', + + 'ABL' => '加入文集', + 'RBL' => '移除文集', + + 'PTS' => '推送主题', + 'RFS' => '解除推送', + 'RMR' => '取消悬赏', + 'BNP' => '屏蔽文章', + 'UBN' => '解除屏蔽', + + 'REC' => '推荐', + 'URE' => '解除推荐', + + 'WRN' => '警告', + 'UWN' => '解除警告', + + 'SPA' => '添加图章', + 'SPD' => '撤销图章', + + 'SLA' => '添加图标', + 'SLD' => '撤销图标', + + 'REG' => '圈子推荐', + + 'PTA' => '生成文章', + + 'MAG' => '道具', + + 'REB' => '推送', + + 'LIV' => '直播', + 'LIC' => '取消直播', + +); + +?> \ No newline at end of file diff --git a/source/language/forum/lang_swfupload.php b/source/language/forum/lang_swfupload.php new file mode 100644 index 0000000..203c6f6 --- /dev/null +++ b/source/language/forum/lang_swfupload.php @@ -0,0 +1,34 @@ +确定 +继续 +文件名 +文件大小 +上传进度 +浏览 +删除 +返回 +上传 +上传完成 +文件上传完成 +正在上传 +总共有 +个文件等待上传,正在上传第 +个文件 +文件过大 +上传失败 +"; + +?> \ No newline at end of file diff --git a/source/language/forum/lang_template.php b/source/language/forum/lang_template.php new file mode 100644 index 0000000..d7646ae --- /dev/null +++ b/source/language/forum/lang_template.php @@ -0,0 +1,1331 @@ + '申请时间', + 'activity_member_unit' => '人', + 'activity_new_join' => '已通过', + 'activity_payment' => '每人花销', + 'activity_self' => '自付', + 'leaveword' => '留言', + 'payment_unit' => '元', + 'activity_allow_join' => '允许参加', + 'activity_applylist' => '活动报名者', + 'activity_applylist_manage' => '活动报名者管理', + 'activity_cant_audit' => '尚未审核', + 'activity_do_replenish' => '等待完善', + 'activity_join_members' => '申请者', + 'activity_ps' => '附言', + 'activity_refuse' => '拒绝', + 'checkall' => '全选', + 'close' => '关闭', + 'confirm' => '批准', + 'extension_project' => '扩展项目', + 'homepage' => '首页', + 'no_informations' => '无任何信息', + 'send_notification' => '发通知', + 'send_pm' => '发短消息', + 'status' => '状态', + 'to_improve' => '需完善', + 'views' => '查看', + 'activity_already' => '已报名人数', + 'activity_content' => '活动内容', + 'activity_space' => '活动地点', + 'activity_start_between' => '$activity[\'starttimefrom\'] 至 $activity[\'starttimeto\'] 商定', + 'activity_starttime' => '开始时间', + 'activity_totime' => '征集截止日期', + 'female' => '女', + 'gender' => '性别', + 'male' => '男', + 'unlimited' => '不限', + 'admin_pm' => '通知作者', + 'admin_reason' => '操作原因', + 'confirms' => '确定', + 'quickclear' => '快速清理', + 'quickclear_avatar' => '清除头像', + 'quickclear_crime_avatar_nums' => '用户 $crimeauthor 已被清除头像 $crimenum_avatar 次', + 'quickclear_crime_customstatus_nums' => '用户 $crimeauthor 已被清除自定义头衔 $crimenum_customstatus 次', + 'quickclear_crime_sightml_nums' => '用户 $crimeauthor 已被清除签名 $crimenum_sightml 次', + 'quickclear_customstatus' => '清除自定义头衔', + 'quickclear_sightml' => '清除签名', + 'submit' => '提交', + 'e_attach_del' => '删除', + 'e_attach_mediacode' => '添加附件媒体播放代码', + 'e_attach_url' => '添加附件地址', + 'highest_right' => '最高权限', + 'readperm' => '阅读权限', + 'update' => '更新', + 'upload_msg' => '$attach[\'filenametitle\'] {LF}上传日期: $attach[\'dateline\'] {LF}文件大小: $attach[\'attachsize\']', + 'delete' => '删除', + 'follow_quickreply' => '回复', + 'follow_relay' => '转播', + 'poston' => '发表于', + 'forumlist' => '版块列表', + 'forumlist_allforum' => '所有版块', + 'forumlist_myfav' => '收藏版块', + 'forumlist_recent' => '最近浏览', + 'search' => '搜索', + 'description' => '描述', + 'save_to_album' => '保存到相册', + 'post_meanwhile_relay' => '同时转播', + 'reply' => '回复', + 'view_all_replies' => '去论坛查看所有回复', + 'all' => '全部', + 'announcement' => '公告', + 'author' => '作者', + 'month' => '月', + 'open' => '展开', + 'year' => '年', + 'attachment' => '附件', + 'buy_all_attch' => '购买所有附件', + 'download' => '下载附件', + 'free_buy' => '免费购买', + 'pay_attachment' => '购买附件', + 'pay_author_income' => '作者所得', + 'pay_balance' => '购买后余额', + 'price' => '售价', + 'status_download' => '您所在的用户组可以免费下载', + 'status_insufficient' => '抱歉,您的 {$_G[\'setting\'][\'extcredits\'][$_G[\'setting\'][\'creditstransextra\'][1]][\'title\']} 不足,无法下载', + 'attachment_buy_not' => '目前没有用户购买此附件', + 'pay_view' => '记录', + 'time' => '时间', + 'username' => '用户名', + 'collection' => '淘帖', + 'collection_create' => '创建淘专辑', + 'collection_desc' => '淘帖简介:', + 'collection_desc_exceed' => '"简介不能超过 "+desclimit+" 字节"', + 'collection_edit' => '编辑淘专辑', + 'collection_keywords' => '淘帖标签:', + 'collection_keywords_desc' => '请使用空格隔开标签,最多可填写 5 个。用户可以根据标签来查找淘专辑,您也可以使用这些标签和淘贴标题搜索主题,快速创建淘贴专辑。', + 'collection_remain_tips' => '还可以创建 $reamincreatenum 个淘专辑', + 'collection_title' => '淘专辑名:', + 'collection_title_exceed' => '"标题不能超过 "+titlelimit+" 字节"', + 'collection_sortby_coomentnum' => '按评论数排序', + 'collection_sortby_follownum' => '按订阅数排序', + 'collection_sortby_threadnum' => '按主题数排序', + 'collection_sortby_update' => '按创建时间排序', + 'collection_backcollection' => '返回专辑', + 'collection_comment_submit' => '发表评论', + 'collection_commentlist' => '评论列表', + 'collection_followlist' => '订阅用户列表', + 'collection_norate' => '暂时还没有人评分', + 'collection_ratecollection' => '评价淘专辑', + 'collection_rated' => '您已评分:', + 'collection_totalrates' => '(共 {$_G[\'collection\'][\'ratenum\']} 次打分)', + 'collection_comment_specthread' => '针对《$thread[\'subject\']》的评论:', + 'collection_comment_thread' => '淘帖评论', + 'no_content' => '暂时没有内容', + 'collection_invite' => '邀请参与', + 'collection_max_invite' => '每个淘专辑最多可以邀请 $maxteamworkers 人维护', + 'collection_selectfriend' => '选择好友', + 'collection_username' => '用户名:', + 'invite' => '邀请', + 'collection_commentnum' => '评论', + 'collection_createtime' => '创建', + 'collection_follow' => '订阅', + 'collection_index_keywords' => '关键词', + 'collection_lastthread' => '最新主题', + 'collection_lastupdate' => '最后更新', + 'collection_nocollection' => '还没有淘专辑,快来创建吧', + 'collection_threadnum' => '主题', + 'collection_all' => '所有专辑', + 'collection_my' => '我的专辑', + 'collection_nav_related' => '相关专辑', + 'collection_recommended' => '推荐专辑', + 'collection_recommend' => '向作者推荐主题', + 'collection_recommend_submit' => '推荐主题', + 'collection_recommend_thread_url' => '主题地址:', + 'collection_addbtn' => '添加到淘专辑', + 'collection_addreason' => '淘帖理由:', + 'collection_fill_entire' => '请将标题填写完整', + 'collection_reason_exceed' => '"淘帖理由不能超过 "+reasonlimit+" 字节"', + 'collection_select' => '选择淘专辑:', + 'collection_select_nocollection' => '您还没有创建淘专辑。', + 'collection_select_remain' => '现在还可以创建 $reamincreatenum 个淘专辑。', + 'collection_view_mine' => '查看我的专辑', + 'collection_mycreate' => '我创建的', + 'collection_myteam' => '我参与的', + 'collection_mysubscribe' => '我订阅的', + 'anonymous' => '匿名', + 'attach_img' => '图片附件', + 'somebody_collection' => '的{$_G[\'setting\'][\'navs\'][11][\'navname\']}', + 'collection_allcomment' => '所有评论', + 'collection_allfollowers' => '所有订阅者', + 'collection_cloud_link' => '搜索相关主题', + 'collection_cloud_search' => '淘专辑还没有内容,您可以点击 搜索相关主题 找到相关内容。', + 'collection_creator' => '专辑创建人:', + 'collection_delete_confirm' => '确定要 删除这个淘专辑 吗?', + 'collection_delete_worker' => '确定要 删除这名共同维护者 吗?', + 'collection_exit_team' => '退出维护', + 'collection_exit_team_confirm' => '真的要退出维护淘专辑?', + 'collection_invite_team' => '邀请维护', + 'collection_inviteallfriend' => '邀请所有好友', + 'collection_newcomment' => '最新评论', + 'collection_newfollowers' => '最新订阅', + 'collection_recommended_reason' => '推荐理由', + 'collection_teamworkers' => '共同维护人:', + 'collection_thread' => '淘帖主题', + 'collection_unfollow' => '取消订阅', + 'collection_creators' => '他还有这些淘帖', + 'edit' => '编辑', + 'lastpost' => '最后发表', + 'replies' => '回复/查看', + 'reward_solved' => '已解决', + 'unresolved' => '未解决', + 'thread_activity' => '活动', + 'thread_debate' => '辩论', + 'thread_digest' => '精华', + 'thread_poll' => '投票', + 'thread_reward' => '悬赏', + 'thread_trade' => '商品', + 'comment_1' => '差', + 'comment_2' => '一般', + 'comment_3' => '还行', + 'comment_4' => '好', + 'comment_5' => '很好', + 'comment_6' => '非常好', + 'comment_give_ip' => '放弃此观点', + 'comment_message1' => '还可输入', + 'comment_message2' => '个字符', + 'comments' => '点评', + 'more' => '更多', + 'publish' => '发布', + 'detail' => '详情', + 'guest' => '游客', + 'debate_bestdebater' => '最佳辩手', + 'debate_draw' => '平局', + 'debate_list_nonexistence' => '如果不在列表中,请自行填写', + 'debate_opponent' => '反方', + 'debate_poll' => '票', + 'debate_recommend_list' => '推荐名单', + 'debate_square' => '正方', + 'debate_umpirecomment' => '裁判点评', + 'debate_umpirepoint' => '裁判观点', + 'debate_winner' => '获胜', + 'announcements' => '公告', + 'forum_category_modedby' => '分区版主', + 'forum_lastpost' => '最后发表', + 'forum_moderators' => '版主', + 'forum_myfav' => '我收藏的版块', + 'forum_posts' => '帖数', + 'forum_subforums' => '子版块', + 'forum_threads' => '主题', + 'forum_todayposts' => '今日', + 'hotthreads_forum' => '$_G[\'setting\'][\'navs\'][2][\'navname\']热点', + 'index_guests' => '位游客', + 'index_invisibles' => '隐身', + 'index_members' => '会员', + 'index_mostonlines' => '最高记录是', + 'index_posts' => '文章', + 'index_today' => '今日', + 'index_yesterday' => '昨日', + 'my_posts' => '我的文章', + 'never' => '从未', + 'on' => '于', + 'online_only_guests' => '当前只有游客或隐身会员在线', + 'onlinemember' => '在线会员', + 'onlines' => '人在线', + 'private_forum' => '私密版块', + 'show_newthreads' => '最新回复', + 'spread' => '收起/展开', + 'total' => '总计', + 'url_link' => '链接到外部地址', + 'welcome_new_members' => '欢迎新会员', + 'attachcredits' => '下载积分', + 'attachment_buy' => '购买', + 'clicktodownload' => '点击文件名下载附件', + 'guestviewthumb' => '登录/注册后可看大图', + 'discuzcode_copyclipboard' => '复制代码', + 'downloads' => '下载次数', + 'post_hide' => '本帖隐藏的内容', + 'post_code' => '代码', + 'post_quote' => '引用', + 'post_hide_credits' => '以下内容需要积分高于 $creditsrequire 才可浏览', + 'post_hide_credits_hidden' => ',本帖隐藏的内容需要积分高于 $creditsrequire 才可浏览,您当前积分为 {$_G[\'member\'][\'credits\']}', + 'post_hide_reply_hidden' => ',如果您要查看本帖隐藏内容请回复', + 'set_cover' => '设为封面', + 'upload' => '上传', + 'attachment_allow_exts' => '可用扩展名', + 'attachment_insert_all_attach' => '插入全部附件', + 'attachment_list' => '上传附件', + 'attachment_select_attach_image' => '全选', + 'attachment_size' => '文件尺寸', + 'cancel' => '取消', + 'common_upload' => '普通上传', + 'create_new_album' => '创建新相册', + 'credits_policy' => '积分说明', + 'e_attach_insert' => '点击附件文件名添加到文章内容中', + 'e_img_albumlist' => '相册图片', + 'e_img_attach' => '上传图片', + 'e_img_height' => '高(可选)', + 'e_img_insertphoto' => '点击图片添加到文章内容中', + 'e_img_inserturl' => '请输入图片地址', + 'e_img_width' => '宽(可选)', + 'e_img_www' => '网络图片', + 'filename' => '文件名', + 'input_album_name' => '请输入相册名称', + 'lower_than' => '小于', + 'normal_upload' => '普通上传', + 'post_credits_postattach' => '每上传一个附件您的', + 'post_price_attachincome_comment' => '附件出售最高收入上限为 {$_G[\'setting\'][\'maxincperthread\']} {$_G[\'setting\'][\'extcredits\'][$_G[\'setting\'][\'creditstransextra\'][1]][\'unit\']}    ', + 'post_select_usergroup_readacces' => '阅读权限按由高到低排列,高于或等于选中组的用户才可以阅读', + 'save_selected_pic' => '将选中的图片保存到相册', + 'select_album' => '选择相册', + 'size_no_limit' => '大小不限制', + 'uch_selectfromalbum' => '从我的相册中选择图片', + 'upload_after_selected' => '选择完文件后请点击“上传”按钮', + 'uploading' => '上传中,请稍候,您可以暂时关闭这个小窗口,上传完成后您会收到通知', + 'forum_activeusers' => '正在浏览此版块的会员', + 'forum_archive' => '存档', + 'forum_domain' => '本版域名', + 'forum_favorite' => '收藏本版', + 'forum_modedby' => '版主', + 'forum_moderate_unhandled' => '您有 $threadmodcount 个主题正等待审核中,点击查看', + 'forum_recommend' => '推荐主题', + 'forum_recyclebin' => '回收站', + 'forum_viewall' => '全部', + 'index_threads' => '主题', + 'forum_live_newreply_refresh' => '有新的发言了,点击刷新', + 'forum_live_fastreply_notice' => '#在这里快速回复#', + 'forum_live_post' => '发表', + 'forum_live_nocontent_error' => '抱歉,您尚未输入内容', + 'forum_live_nolength_error' => '\'您的文章长度不符合要求。\n\n当前长度: \' + mb_strlen(theform.message.value) + \' 字节\n系统限制: \' + postminchars + \' 到 \' + postmaxchars + \' 字节\'', + 'modcp' => '管理面板', + 'post_newthread' => '发表文章', + 'post_newthreadactivity' => '发起活动', + 'post_newthreaddebate' => '发起辩论', + 'post_newthreadpoll' => '发起投票', + 'post_newthreadreward' => '发布悬赏', + 'post_newthreadtrade' => '出售商品', + 'recommended_groups' => '推荐{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'return_index' => '返 回', + 'rss_subscribe_this' => '订阅', + 'send_posts' => '发新帖', + 'their' => '所属分类', + 'threads_all' => '全部主题', + 'viewd_threads' => '浏览过的文章', + 'viewed_forums' => '浏览过的版块', + 'click_to_show_reason' => '点击查看原因', + 'connect_fill_profile_to_post' => '您需要 完善账号信息绑定已有账号 后才可以发帖', + 'login_to_post' => '您需要登录后才可以发帖', + 'no_permission_to_post' => '您现在无权发帖。', + 'post_thread_closed' => '抱歉,本主题已关闭,不再接受新内容', + 'replyperm_nopermission' => '抱歉,您所在的用户组在此板块没有回帖权限,详细请 点击这里查看。', + 'post_thread_closed_by_dateline' => '抱歉,管理员设置了本版块发表于 {$autoclose} 天以前的主题自动关闭,不再接受新回复', + 'post_thread_closed_by_lastpost' => '抱歉,管理员设置了本版块最后回复于 {$autoclose} 天以前的主题自动关闭,不再接受新回复', + 'post_advancemode' => '高级模式', + 'post_relay' => '转播给听众', + 'post_sync_method' => '将此主题同步到', + 'quick_post' => '快速发帖', + 'select_thread_catgory' => '选择主题分类', + 'favorite_forums' => '收藏的版块', + 'forum_nav' => '版块导航', + 'all_reward' => '全部悬赏', + 'closed_thread' => '关闭的主题', + 'digest_posts' => '精华', + 'forum_group' => '版块/圈子', + 'forum_nothreads' => '本版块或指定的范围内尚无主题', + 'forum_thread' => '版块主题', + 'from' => '来自', + 'fromgroup' => '来自圈子', + 'selectmygroup' => '选择我的圈子', + 'have_newreplies' => '有新回复', + 'heats' => '热度', + 'heats_icon' => '火', + 'last_1_days' => '一天', + 'last_2_days' => '两天', + 'list_default_sort' => '默认排序', + 'list_one_month' => '一个月', + 'list_one_week' => '一周', + 'list_post_time' => '发帖时间', + 'list_three_month' => '三个月', + 'new_window' => '新窗', + 'new_window_thread' => '在新窗口中打开文章', + 'order_heats' => '热门', + 'order_recommends' => '推荐', + 'orderby' => '排序', + 'pics' => '张图片', + 'post_mobile' => '手机发帖', + 'posts_deducted' => '文章被减分', + 'rate_credit_add' => '文章被加分', + 'replycredit' => '回帖奖励', + 'replycredit_icon' => '奖', + 'rewarding' => '进行中', + 'rushreply' => '抢楼', + 'screening' => '筛选', + 'search_any_date' => '时间', + 'show' => '查看', + 'show_rewarded_only' => '只看已解决的', + 'show_rewarding_only' => '只看进行中的', + 'showupgrade' => '查看更新', + 'target_blank' => '新窗口打开', + 'thread_moved' => '移动', + 'thread_recommend' => '评价指数', + 'thread_recommend_icon' => '荐', + 'thread_stick' => '置顶', + 'thread_type1' => '本版置顶主题', + 'thread_type2' => '分类置顶主题', + 'thread_type3' => '全局置顶主题', + 'thread_type4' => '多版置顶主题', + 'title' => '标题', + 'view_thread' => '浏览文章', + 'view_thread_imagemode' => '图片模式', + 'forum_password_require' => '本版块需要密码,您必须在下面输入正确的密码才能浏览这个版块', + 'guide' => '导读', + 'guide_attend' => '人参与', + 'guide_digest' => '最新精华', + 'guide_forum_select' => '选择版块', + 'guide_hot' => '最新热门', + 'guide_index' => '导读首页', + 'guide_my' => '我的文章', + 'guide_new' => '最新回复', + 'guide_newthread' => '最新发表', + 'guide_sofa' => '抢沙发', + 'guide_nothreads' => '暂时还没有文章', + 'keyword' => '关键字', + 'posts_type' => '文章类型', + 'forum_moderate' => '审核', + 'logout' => '退出', + 'mod_error_invalid' => '抱歉,您无此权限', + 'mod_notice' => '论坛管理员在“管理面板”中权限和超级版主基本相同,如果需要更多功能,请进入 管理中心 ', + 'mod_notice_title' => '内部留言', + 'mod_option_error' => '系统错误', + 'mod_option_forum_edit' => '版块编辑', + 'mod_option_forum_recommend' => '推荐主题', + 'mod_option_member_access' => '用户权限', + 'mod_option_member_ban' => '禁止用户', + 'mod_option_member_edit' => '编辑用户', + 'mod_option_member_ipban' => '禁止 IP', + 'mod_option_return' => '返回论坛', + 'mod_option_subject' => '主题管理', + 'modcp_logs' => '管理日志', + 'modcp_report' => '管理举报', + 'action' => '操作', + 'delete_check' => '删?', + 'displayorder' => '顺序', + 'endtime' => '结束时间', + 'link' => '链接', + 'mod_announce_add' => '添加公告', + 'mod_announce_edit' => '编辑公告', + 'mod_announce_list' => '公告列表', + 'mod_announce_type' => '公告类型', + 'mod_announce_type_text' => '文字类型', + 'mod_announce_type_url' => '网址链接', + 'mod_message_announce_add' => '公告添加完毕,请继续操作', + 'mod_message_announce_del' => '选定公告删除完毕,请继续操作', + 'mod_message_announce_edit' => '公告设置更新完毕,请继续操作', + 'return' => '返回', + 'starttime' => '起始时间', + 'text' => '文字', + 'disabled' => '禁用', + 'discuzcode' => '编辑器代码', + 'enabled' => '可用', + 'forum_not_allow' => '抱歉,您所在的用户组不允许修改版规!', + 'forum_rules' => '本版规则', + 'memcp_profile_preview' => '预览', + 'mod_forum_recommend_expiration' => '时间期限', + 'mod_forum_recommend_list' => '更新列表', + 'mod_message_forum_nopermission' => '抱歉,您无此权限!', + 'mod_message_forum_update' => '版规更新成功,请继续操作', + 'mod_message_forum_updaterecommend' => '推荐主题更新成功,请继续操作', + 'more_settings' => '更多设置', + 'post_html' => 'HTML 代码', + 'post_imgcode' => '[img] 代码', + 'recommend_moderator' => '推荐人', + 'search_nomatch' => '抱歉,没有找到匹配结果', + 'subject' => '标题', + 'forum' => '版块', + 'member' => '会员', + 'mod_access_ban_download' => '禁止下载附件', + 'mod_access_ban_getimage' => '禁止查看图片', + 'mod_access_ban_postreply' => '禁止发表回复', + 'mod_access_ban_postthread' => '禁止发表主题', + 'mod_access_ban_upload' => '禁止上传附件', + 'mod_access_ban_uploadimage' => '禁止上传图片', + 'mod_access_ban_viewthread' => '禁止查看主题', + 'mod_access_change' => '权限变更', + 'mod_access_download' => '下载附件', + 'mod_access_getimage' => '查看图片', + 'mod_access_optime' => '操作时间', + 'mod_access_postreply' => '回复主题', + 'mod_access_postthread' => '发表主题', + 'mod_access_recover' => '恢复默认', + 'mod_access_specialuser' => '特殊用户', + 'mod_access_upload' => '上传附件', + 'mod_access_uploadimage' => '上传图片', + 'mod_access_viewthread' => '浏览主题', + 'mod_message_access_admin_invalid' => '管理员设置此用户某些权限为强制允许,您不能变更管理员的这些设置', + 'mod_message_access_nonexistence' => '当前没有特殊权限用户', + 'mod_message_access_updatepermission' => '用户权限更新成功, 请继续操作', + 'mod_message_access_user_invalid' => '抱歉,您没有权限操作管理人员或特殊用户!', + 'mod_message_access_user_nonexistence' => '此用户不存在或被冻结', + 'mod_moderate_selectforum' => '版块选择', + 'mod_notice_access' => '通常情况下,用户在版块的权限是根据他的用户组决定的,此处您可以限制某个用户在某版块的权限。
          注意: 看帖是基本权限,一旦禁止, 其他权限会同时进行禁止。
          图例说明: 默认权限    强制禁止    强制允许 ', + 'moderator' => '版主', + 'admin' => '论坛管理员', + 'days' => '天', + 'expire' => '有效期', + 'modcp_home_adminnote_add' => '添加留言', + 'modcp_home_adminnote_nonexistence' => '当前没有人留言', + 'modcp_home_adminnote_to' => '留言给', + 'modcp_home_message_list' => '留言列表', + 'supermod' => '超级版主', + 'modcp_logs_action' => '操作', + 'modcp_logs_list_1' => '日志列表', + 'modcp_logs_other' => '其他', + 'modcp_logs_perpage' => '每页显示条数', + 'modcp_logs_search' => '查找', + 'add_new' => '新增:', + 'avatar_del' => '删除头像', + 'bio' => '自我介绍', + 'changeto' => '变更为', + 'crime_action' => '操作行为', + 'crime_avatar' => '清除头像', + 'crime_banpost' => '屏蔽文章', + 'crime_banspeak' => '禁止发言', + 'crime_banstatus' => '锁定用户', + 'crime_banvisit' => '禁止访问', + 'crime_customstatus' => '清除自定义头衔', + 'crime_dateline' => '操作时间', + 'crime_delpost' => '删除文章', + 'crime_operator' => '操作者', + 'crime_reason' => '操作理由', + 'crime_record' => '违规记录', + 'crime_sightml' => '清除签名', + 'crime_warnpost' => '警告文章', + 'expiry' => '期限', + 'ip_location' => '地理位置', + 'mod_member_ban' => '禁止用户', + 'mod_member_edit' => '编辑用户', + 'mod_message_goto_admincp' => '请点击这里进入管理后台继续操作', + 'mod_message_member_nonexistence' => '该用户不存在或被冻结,请重新输入', + 'mod_message_member_nopermission' => '管理面板无权操作该用户', + 'mod_message_member_search' => '请首先输入用户名或者 UID 搜索用户,然后进行下一步。搜索 UID 比搜索用户名速度更快且准确', + 'modcp_ban_ip' => '已禁止的 IP 列表', + 'modcp_ip_message' => '用CIDR格式表示封禁一段的IP', + 'modcp_members_ban_days_comment' => '期限设置仅对禁止发言和禁止访问的操作有效', + 'modcp_members_ip_addadmin' => '操作者', + 'modcp_members_ip_error_1' => '请输入标准 IP 地址', + 'modcp_members_ip_error_2' => '新增 IP 地址失败,该 IP 地址范围包含您目前的 IP', + 'modcp_members_ip_error_3' => '新增 IP 地址失败,该 IP 地址已经在禁止范围内', + 'modcp_members_ip_error_4' => '您只能编辑和删改自己添加的 IP 地址', + 'modcp_members_ip_succed' => 'IP 地址更新成功,请继续操作', + 'modcp_members_status_banpost' => '禁止发言', + 'modcp_members_status_banvisit' => '禁止访问', + 'modcp_members_status_normal' => '正常状态', + 'no_ban_ip' => '当前没有已禁止的 IP', + 'online_ip' => 'IP 地址', + 'optional' => '可选', + 'reason' => '理由', + 'signature' => '个人签名', + 'valid_before' => '有效期至', + 'ignore' => '忽略', + 'invalidate' => '否决', + 'mod_message_moderate_nopermission' => '抱歉,您没有管理任何版块的权限,无法执行此操作', + 'mod_moderate_ignorereply_num' => '已忽略回复', + 'mod_moderate_ignorethread_num' => '已忽略主题', + 'mod_moderate_member_already' => '已否决的用户', + 'mod_moderate_member_info' => '审核信息', + 'mod_moderate_member_mod_admin' => '上次审核者', + 'mod_moderate_member_mod_dateline' => '上次审核时间', + 'mod_moderate_member_never' => '待审核的用户', + 'mod_moderate_member_profile' => '个人资料', + 'mod_moderate_member_range' => '用户范围', + 'mod_moderate_member_register_dateline' => '注册时间', + 'mod_moderate_member_register_ip' => '注册 IP', + 'mod_moderate_member_register_reason' => '注册原因', + 'mod_moderate_member_submit_dateline' => '上次提交', + 'mod_moderate_member_submit_times' => '提交次数', + 'mod_moderate_reply_num' => '未审核回复', + 'mod_moderate_select' => '当前已选定 0 个', + 'mod_moderate_thread_num' => '未审核主题', + 'mod_moderate_thread_range' => '文章范围', + 'mod_moderate_showcensor' => '显示过滤词', + 'mod_notice_moderate' => '审核结果: $modpost[\'validate\'] 篇文章审核通过,$modpost[\'delete\'] 篇文章删除,$modpost[\'ignore\'] 篇文章进入忽略列表等待审核', + 'mod_option_moduser' => '用户', + 'mod_option_subject_mod' => '审核', + 'mod_option_subject_modreplies' => '回复', + 'mod_option_subject_modthreads' => '主题', + 'mod_select_invalid' => '请先选择操作对象!', + 'pass' => '通过', + 'table_branch' => '分表:', + 'validate' => '通过', + 'mod_moderate_member' => '审核用户', + 'mod_moderate_member_sendemail' => '发 Email 通知被审核用户', + 'mod_moderate_nonexistence' => '抱歉,您没有选择任何内容,请返回', + 'mod_moderate_reason' => '操作理由[可选]', + 'mod_moderate_reply' => '审核回复', + 'mod_moderate_thread' => '审核主题', + 'mod_option_selectforum' => '版块选择', + 'mod_option_subject_delete' => '文章管理', + 'mod_option_subject_forum' => '版块主题', + 'mod_option_subject_recyclebin' => '主题回收站', + 'mod_option_subject_recyclebinpost' => '回帖回收站', + 'modcp_forum' => '当前版块', + 'modcp_posts_author' => '文章作者', + 'modcp_posts_dateline_range' => '时间范围', + 'modcp_posts_error_1' => '搜索条件不足!您至少应当在 关键字,文章作者或者发帖 IP 当中设置一个搜索的条件', + 'modcp_posts_error_2' => '时间范围错误!版主只能删除近 1 周的文章,超级版主可以删除 2 周内的文章,请重新选择开始时间', + 'modcp_posts_error_3' => '您输入的关键字不合法!每个关键字至少由 2 个汉字或者 4 个英文字符组成', + 'modcp_posts_error_4' => '抱歉,您无权使用批量删帖功能', + 'modcp_posts_ip' => '发帖 IP', + 'modcp_posts_keyword' => '内容关键字', + 'modcp_posts_member_credits' => '不更新用户积分', + 'modcp_posts_search' => '共搜索出结果 $total 条', + 'modcp_posts_thread' => '主题', + 'modcp_posts_threadfirst' => '主题首帖', + 'modcp_posts_threadreply' => '主题回复帖', + 'modcp_posts_to' => '至', + 'modcp_posts_type' => '文章类型', + 'modcp_posts_week_1' => '您只能操作最近 1 周的文章', + 'modcp_posts_week_2' => '您只能操作最近 2 周的文章', + 'modcp_select_forum' => '请选择版块', + 'posttable_branch' => '文章分表:', + 'mod_option_selectthreadclass' => '主题分类', + 'modcp_dateline_range' => '发表时间范围', + 'modcp_forum_select_msg' => '请选择版块进行管理', + 'modcp_no_reply_range' => '多少天内无回复', + 'modcp_reply_range' => '回复次数范围', + 'modcp_restore' => '恢复', + 'modcp_select_threadclass' => '请选择主题分类', + 'modcp_subject_keyword' => '标题关键字', + 'modcp_thread_msg' => '没有找到相关主题', + 'modcp_threadstick_1' => '置顶I', + 'modcp_threadstick_2' => '置顶II', + 'modcp_threadstick_3' => '置顶III', + 'modcp_views_range' => '点击次数范围', + 'none' => '无', + 'dateline' => '发布时间', + 'ishtmlon' => 'HTML帖', + 'no' => '否', + 'yes' => '是', + 'modcp_report_content' => '内容', + 'modcp_report_note' => '留言', + 'modcp_report_nothing' => '没有新的举报或没有选择版块', + 'modcp_report_perpage' => '每页显示举报数', + 'modcp_report_post' => '举报文章', + 'modcp_report_reason' => '举报理由', + 'modcp_report_reporter' => '举报者', + 'modcp_report_resolve' => '处理选中', + 'modcp_report_reward' => '奖惩', + 'modcp_report_time' => '举报时间', + 'modcp_report_waiting' => '等待处理的举报', + 'modcp_thread_search_msg' => '共搜索出结果 $total 条', + 'pay' => '购买主题', + 'pay_nobuyers' => '目前没有用户购买此主题', + 'draftbox' => '草稿箱', + 'edit_save' => '保存', + 'edit_thread' => '编辑文章', + 'edit_trade' => '编辑商品', + 'faq' => '帮助', + 'join_thread' => '参与/回复主题', + 'post_credits_rule' => '本版积分规则', + 'post_message2' => '继续添加商品', + 'post_message3' => '查看所有草稿', + 'reply_quote' => '引用', + 'replycredit_revenue' => '税后支付', + 'save_draft' => '保存草稿', + 'trade_add_post' => '添加商品', + 'activity_city' => '所在城市', + 'activity_need_member' => '需要人数', + 'activity_starttime_endtime' => '时间范围', + 'activiy_sort' => '活动类别', + 'consumption_credit' => '消耗积分', + 'input_invalid' => '填写无效', + 'optional_data' => '必填资料项', + 'other_data' => '扩展资料项', + 'post_activity_message' => '每行代表一个项目,最多', + 'post_click_message_1' => '点击更新来更换您的图片', + 'post_click_message_2' => '添加一张好看的图片,让活动更吸引人', + 'post_closing' => '报名截止', + 'post_error_message_1' => '抱歉,请输入活动时间', + 'post_error_message_2' => '抱歉,请输入活动地点', + 'post_error_message_3' => '抱歉,请输入活动类别', + 'post_event_time' => '活动时间', + 'post_option' => '项', + 'post_topic_image' => '活动图片', + 'user_consumption_money' => '活动参与者需消耗的金钱', + 'attachment_limit' => '您今日还能上传', + 'attachment_or' => '或者', + 'attachment_outoflimit' => '今日您已无法上传更多的附件', + 'attachment_sizelimit' => '总大小 $allowuploadsize 以内的文件', + 'attachment_unit' => '$allowuploadnum 个文件', + 'debate_opponent_point' => '反方观点', + 'debate_square_point' => '正方观点', + 'debate_umpire' => '裁判', + 'post_debate_message_1' => '抱歉,请输入正方观点', + 'post_debate_message_2' => '抱歉,请输入反方观点', + 'auto_keyword' => '自动获取', + 'choosetag' => '选择标签', + 'credits' => '积分', + 'min_limit' => '下限', + 'post_price_charge_comment' => '主题最多能销售 {$_G[\'setting\'][\'maxchargespan\']} 个小时', + 'post_price_comment' => '最高 {$_G[\'group\'][\'maxprice\']} {$_G[\'setting\'][\'extcredits\'][$_G[\'setting\'][\'creditstransextra\'][1]][\'unit\']}', + 'post_price_free_chargehours' => ',本主题还能销售 $freechargehours 个小时', + 'post_price_income_comment' => '主题出售最高收入上限为 {$_G[\'setting\'][\'maxincperthread\']} {$_G[\'setting\'][\'extcredits\'][$_G[\'setting\'][\'creditstransextra\'][1]][\'unit\']}    ', + 'post_rushreply_credit' => '大于此设置才能参与抢楼,可不填', + 'post_tag' => '标签', + 'post_timer' => '定时发布', + 'posttag' => '主题标签', + 'posttag_comment' => '用逗号或空格隔开多个标签,最多可填写 5 个', + 'recent_use_tag' => '最近使用标签:', + 'replycredit_empty' => '(留空或填 0 为不奖励)', + 'replycredit_however' => '本帖尚有', + 'replycredit_member' => '每人最多可获得', + 'replycredit_once' => '单次回帖奖励:', + 'replycredit_rate' => '中奖率', + 'replycredit_reward' => '共奖励', + 'replycredit_time' => '次', + 'replycredit_total' => '回帖奖励总额:', + 'rushreply_change' => '设为抢楼主题', + 'rushreply_end' => '截止楼层:', + 'rushreply_rewardfloor' => '奖励楼层:', + 'rushreply_rewardfloor_comment' => '多楼层用英文逗号隔开,*号可匹配任意数或空值,如:8,88,*88', + 'rushreply_time' => '抢楼时间:', + 'total_credits' => '总积分', + 'you_have' => '您有', + 'code' => '纯文本', + 'e_attach' => '附件', + 'e_attach_title' => '添加附件', + 'e_audio' => '音乐', + 'e_audio_title' => '添加音乐', + 'e_autotypeset' => '自动排版', + 'e_center' => '居中', + 'e_code_title' => '添加代码文字', + 'e_editor_loading' => '请稍后 ...', + 'e_flash' => 'Flash', + 'e_flash_title' => '添加 Flash', + 'e_beginning' => '动画', + 'e_beginning_title' => '添加起始动画', + 'e_floatleft' => '左浮动', + 'e_floatright' => '右浮动', + 'e_font' => '字体', + 'e_fontbgcolor' => '设置文字背景色', + 'e_fontname' => '设置字体', + 'e_fontsize' => '设置文字大小', + 'e_free' => '添加免费信息', + 'e_hide' => '添加隐藏内容', + 'e_hr_title' => '分隔线', + 'e_image_title' => '添加图片', + 'e_italic' => '文字斜体', + 'e_left' => '居左', + 'e_orderedlist' => '排序的列表', + 'e_quote_title' => '添加引用文字', + 'e_removeformat' => '清除文本格式', + 'e_right' => '居右', + 'e_size' => '大小', + 'e_smilies' => '表情', + 'e_smilies_title' => '添加表情', + 'e_table' => '添加表格', + 'e_underline' => '文字加下划线', + 'e_unlink' => '移除链接', + 'e_unorderedlist' => '未排序列表', + 'e_video' => '视频', + 'e_video_title' => '添加视频', + 'missed_data' => '您有上次未提交成功的数据', + 'approve' => '需审核', + 'attach_delete' => '删除', + 'attach_unused' => '个未使用的附件', + 'attach_use' => '使用', + 'attach_view' => '查看', + 'debate_neutral' => '中立', + 'debate_viewpoint' => '选择观点', + 'draft' => '草稿', + 'img_unused' => '个未使用的图片', + 'modify' => '修改', + 'post_message1' => '添加商品信息,完成后可在本帖中继续添加多个商品', + 'addfeed' => '发送动态', + 'auditstatuson' => '通过审核', + 'del_thread_warning' => '删除后无法撤销', + 'disable' => '禁用', + 'hiddenreplies' => '回帖仅作者可见', + 'post_additional_options' => '附加选项', + 'post_anonymous' => '使用匿名发帖', + 'post_delpost' => '删除本帖', + 'post_descviewdefault' => '回帖倒序排列', + 'post_digest_thread' => '精华文章', + 'post_imgurl' => '解析图片链接', + 'post_noticeauthor' => '接收回复通知', + 'post_parseurl' => '链接识别', + 'post_show_sig' => '使用个人签名', + 'post_stick_thread' => '主题置顶', + 'reward_price_back' => ',返还悬赏费用,不退还手续费', + 'smilies' => '表情', + 'nav_forum' => '进入版块', + 'nav_forum_frequently' => '常用版块', + 'post_forum_navigation' => '论坛导航', + 'threadtype_option' => '分类信息', + 'poll_after_result' => '投票后结果可见', + 'poll_close' => '关闭投票', + 'poll_finish' => '已结束', + 'post_poll_add' => '增加一项', + 'post_poll_allowmultiple' => '最多可选', + 'post_poll_comment' => '最多可填写 {$_G[\'setting\'][\'maxpolloptions\']} 个选项', + 'post_poll_comment_s' => '每行填写 1 个选项', + 'post_poll_expiration' => '记票天数', + 'post_poll_options' => '选项', + 'post_poll_overt' => '公开投票参与人', + 'post_poll_exceed' => '已达到最大投票数', + 'post_single_frame_mode' => '单框模式', + 'post_reward_error_message' => '抱歉,请输入悬赏价格', + 'post_reward_message' => '天后如果您仍未设置最佳答案,版主有权代为您选择', + 'post_reward_resolved' => '已解决的悬赏', + 'reward_cant_fall' => '不能降低悬赏积分', + 'reward_price' => '悬赏价格', + 'reward_price_bound' => '售价超出范围', + 'reward_price_max' => '不能高于', + 'reward_price_min' => '价格不能低于', + 'reward_price_overflow' => '售价不能高于 32767', + 'reward_tax_add' => '税后追加', + 'reward_tax_after' => '税后支付', + 'five_days' => '5天', + 'half_year' => '半年', + 'maxlength' => '最大长度', + 'maxnum' => '最大值', + 'minnum' => '最小值', + 'one_month' => '1个月', + 'one_year' => '1年', + 'please_select' => '请选择', + 'seven_days' => '7天', + 'threadtype_description' => '发帖说明', + 'threadtype_expiration' => '信息有效期', + 'three_days' => '3天', + 'three_months' => '3个月', + 'unchangeable' => '不可修改', + 'post_current_credit' => '现价积分', + 'post_current_price' => '现价(人民币)', + 'post_goods_error_message_1' => '抱歉,请输入商品名称', + 'post_goods_error_message_2' => '抱歉,请输入商品数量', + 'post_goods_error_message_3' => '抱歉,请输入商品价格', + 'post_original_credit' => '原价积分', + 'post_original_price' => '原价(人民币)', + 'post_trade_locus' => '所在地点', + 'post_trade_name' => '商品名称', + 'post_trade_number' => '商品数量', + 'post_trade_paymethod' => '交易方式', + 'post_trade_paymethod_offline' => '担保交易', + 'post_trade_paymethod_online' => '在线交易', + 'post_trade_picture' => '商品图片', + 'post_trade_price' => '商品价格', + 'post_trade_tenpay_seller' => '财付通账户', + 'post_trade_transport' => '物流方式', + 'post_trade_transport_buyer' => '买家承担运费', + 'post_trade_transport_express' => '快递', + 'post_trade_transport_mail' => '平邮', + 'post_trade_transport_offline' => '线下交易', + 'post_trade_transport_seller' => '卖家承担运费', + 'post_trade_transport_virtual' => '虚拟物品', + 'trade_new' => '全新', + 'trade_old' => '二手', + 'trade_type_transport_physical' => '支付给物流公司', + 'postappend' => '补充', + 'admin_operation_explain' => '操作说明', + 'admin_rate' => '评分扣除自身相应积分', + 'click_here' => '点击这里', + 'push_succeed' => '推送成功', + 'rate' => '评分', + 'rate_raterange' => '评分区间', + 'rate_thread' => '给本帖加分', + 'rate_todayleft' => '今日剩余', + 'thread_removerate' => '撤销评分', + 'user_operation_explain' => '可选评分理由', + 'rate_view' => '查看全部评分', + 'stats' => '站点统计', + 'stats_main' => '基本概况', + 'stats_main_admins' => '管理成员', + 'stats_main_board_activity' => '论坛活跃指数', + 'stats_main_forums_count' => '版块数', + 'stats_main_hot_forum' => '最热门的版块', + 'stats_main_member' => '会员统计', + 'stats_main_members' => '注册会员', + 'stats_main_members_count' => '最近 24 小时新增会员数', + 'stats_main_new' => '新会员', + 'stats_main_nmpd' => '平均每日注册会员数', + 'stats_main_nonposters' => '未发帖会员', + 'stats_main_nppd' => '平均每日新增文章数', + 'stats_main_posters' => '发帖会员', + 'stats_main_posters_percent' => '发帖会员占总数', + 'stats_main_posts_avg' => '平均每人发帖数', + 'stats_main_posts_count' => '文章数', + 'stats_main_rpt' => '平均每个主题被回复次数', + 'stats_main_threads_count' => '主题数', + 'stats_main_todays_newposts' => '最近 24 小时新增文章数', + 'stats_main_topposter' => '今日论坛之星', + 'stats_main_total_posted' => '发帖数', + 'stats_update' => '统计数据已被缓存,上次于 $lastupdate 被更新,下次将于 $nextupdate 进行更新', + 'lastvisit' => '上次访问', + 'member_list' => '会员列表', + 'posts' => '文章', + 'threads' => '主题', + 'regdate' => '注册日期', + 'uid' => 'UID', + 'stats_agent' => '客户软件', + 'stats_browser' => '浏览器', + 'stats_date' => '日期', + 'stats_day_posts' => '每日新增文章记录', + 'stats_forum_stat_log' => '版块统计日志', + 'stats_forums_forumname' => '版块名称', + 'stats_forums_month' => '月份', + 'stats_forums_stat' => '版块统计', + 'stats_forums_sub' => '子版', + 'stats_history' => '历史记录', + 'stats_hour' => '时段流量', + 'stats_modworks' => '管理统计', + 'stats_modworks_all' => '全体管理人员', + 'stats_modworks_data' => '的管理统计数据', + 'stats_modworks_details' => '查看详细管理统计', + 'stats_modworks_export' => '导出', + 'stats_modworks_in' => '在', + 'stats_modworks_timerange' => '时间范围', + 'stats_modworks_to' => '至', + 'stats_modworks_total' => '合计', + 'stats_month_posts' => '每月新增文章记录', + 'stats_os' => '操作系统', + 'stats_posthist' => '发帖量记录', + 'stats_views' => '流量统计', + 'stats_week' => '星期流量', + 'admin_status' => '管理级别', + 'admin_usergroup_title' => '组头衔', + 'hours' => '小时', + 'onlinetime_thismonth' => '本月在线', + 'onlinetime_total' => '总计在线', + 'stats_modworks_thismonth' => '本月管理', + 'stats_posts_thismonth' => '最近 30 天发帖', + 'stats_team' => '管理团队', + 'stats_team_admins' => '管理员和超级版主', + 'stats_team_offdays' => '离开天数', + 'stats_trade_rank' => '交易排行', + 'trace_number_sort' => '交易数排行', + 'trace_sell_number' => '售出数量', + 'trade_price_sort' => '交易额排行', + 'trade_seller' => '卖家', + 'trade_totalprice' => '总金额', + 'none_tag' => '没有相关标签', + 'tag_search' => '搜索结果最多显示 50 个,点击结果链接可直接插入标签', + 'admin_bump' => '提升主题', + 'admin_close' => '关闭主题', + 'admin_delthread_confirm' => '您确认要 删除 选择的主题么?', + 'admin_delthread_nopermission' => '您没有删除此主题权限', + 'admin_digest_add' => '精华', + 'admin_digest_remove' => '解除', + 'admin_down' => '下沉主题', + 'admin_move' => '移动主题', + 'admin_move_hold' => '保留转向', + 'admin_open' => '打开主题', + 'admin_select_piece' => '选择了 $modpostsnum 篇文章', + 'admin_target' => '目标版块', + 'admin_targettype' => '目标分类', + 'admin_type_msg' => '当前版块无分类设置,请联系管理员到后台设置主题分类', + 'admin_unrecommend' => '解除', + 'bump' => '提升', + 'crimerecord' => '违规登记', + 'forum_recommend_image' => '图片', + 'forum_recommend_noimage' => '不显示', + 'forum_recommend_reducetitle' => '标题', + 'recommend' => '推荐', + 'thread_highlight' => '高亮', + 'topicadmin_crime_delpost_nums' => '用户 $crimeauthor 文章已被违规删除 $crimenum 次', + 'types' => '分类', + 'admin_banpost' => '屏蔽', + 'admin_delposts' => '删除选定文章', + 'admin_merge' => '合并', + 'admin_merge_tid' => '填写要合并的主题 ID (tid)', + 'admin_select_one_piece' => '选择了 1 篇主题', + 'admin_split_comment' => '分割 →填写楼号 (用 "," 间隔)', + 'admin_split_newsubject' => '新标题', + 'admin_stamp_none' => '无图章', + 'admin_stamp_select' => '选择主题图章', + 'admin_stamplist_current' => '当前图标', + 'admin_stamplist_none' => '无图标', + 'admin_stamplist_select' => '选择主题图标', + 'admin_stickreply' => '置顶到主题帖', + 'admin_threadsplit_restore' => '您确认要将此主题移除存档区吗?', + 'admin_unbanpost' => '解除', + 'admin_unstickreply' => '解除置顶', + 'admin_live' => '直播', + 'admin_live_cancle' => '取消直播', + 'admin_live_tips' => '同一版块内只能设置一个直播帖
          设置直播后会覆盖原有直播帖
          建议超过5条回复后设置', + 'pay_buyers' => '已购买人数', + 'topicadmin_crime_banpost_nums' => '用户 $crimeauthor 文章已被屏蔽 $crimenum 次', + 'topicadmin_delet_comment' => '删除选定点评', + 'topicadmin_select_comment' => '选择了 1 个点评', + 'topicadmin_warn_add' => '警告', + 'topicadmin_warn_delete' => '解除', + 'topicadmin_warn_nums' => '用户 $warningauthor 已被警告 $authorwarnings 次', + 'topicadmin_warn_prompt' => '{$_G[\'setting\'][\'warningexpiration\']} 天内累计被警告 {$_G[\'setting\'][\'warninglimit\']} 次,将被自动禁止发帖 {$_G[\'setting\'][\'warningexpiration\']} 天', + 'topicadmin_useropt' => '用户操作', + 'topicadmin_banuser' => '禁言', + 'topicadmin_userdelpost' => '清空文章', + 'admin_ban_this_ip' => '禁止此 IP', + 'admin_user_this_ip' => '此 IP 下用户', + 'admin_bump_down' => '提升下沉', + 'admin_openclose' => '关闭打开', + 'admin_select' => '选中', + 'maximize' => '最大化', + 'minimize' => '最小化', + 'piece' => '篇', + 'topicadmin_recommend_forum' => '推荐到版块', + 'post_trade_sticklist' => '推荐商品', + 'post_trade_transport_physical' => '买家收到货物后直接支付给物流公司', + 'trade_additional' => '附加', + 'trade_buy_confirm' => '确认购买', + 'trade_buy_crediterror' => '您的积分不足', + 'trade_buyercontact' => '收货地址', + 'trade_buyermobile' => '收货人手机', + 'trade_buyername' => '收货人姓名', + 'trade_buyerphone' => '收货人电话', + 'trade_buyerzip' => '收货人邮编', + 'trade_confirm_buy' => '确认购买信息', + 'trade_confirm_goods' => '1.确认商品', + 'trade_credits_total' => '支付总额', + 'trade_guest_alarm' => '您目前为游客,购买后您无法在本版块查看交易状态,请到支付网站查询', + 'trade_nums' => '购买数量', + 'trade_pay_alipay' => '在线交易', + 'trade_pay_offline' => '担保交易', + 'trade_paymethod' => '交易方式', + 'trade_price' => '现价', + 'trade_recommended_goods' => '推荐的商品', + 'trade_seller_remark' => '备注信息', + 'trade_seller_remark_comment' => '200 字以内', + 'trade_units' => '元', + 'save' => '保存', + 'trade_displayorder' => '柜台商品管理', + 'trade_hour' => '小时', + 'trade_remaindays' => '剩余时间', + 'trade_show_order' => '显示顺序', + 'trade_timeout' => '成交结束', + 'trade_update_stick' => '推荐', + 'trade_update_stickmax' => '您最多可推荐的商品数:', + 'attach_nopermission' => '您所在的用户组无法下载或查看附件', + 'eccredit_buyerinfo' => '买家信用', + 'eccredit_sellerinfo' => '卖家信用', + 'on_line' => '在线', + 'pack_up' => '收起', + 'post_trade_buynumber' => '累计售出', + 'post_trade_removed' => '此商品已被删除', + 'post_trade_support_tenpay' => '此商品支持财付通,您可以先验货后付款', + 'post_trade_transport_none' => '无运费', + 'sold_out' => '已售完', + 'taobao' => '阿里旺旺', + 'trade' => '商品', + 'trade_bargain' => '砍价', + 'trade_costprice' => '原价', + 'trade_locus' => '地点', + 'trade_other_goods' => '柜台其它商品', + 'trade_rate' => '信用评价', + 'trade_seller_other_goods' => '$trade[\'seller\'] 的其它商品', + 'trade_seller_real_name' => '卖家实名', + 'trade_transport' => '运费', + 'trade_type_buy' => '商品', + 'trade_type_viewthread' => '商品类型', + 'trade_viewtrade' => '查看商品', + 'user_threads' => '查看主题', + 'eccredit1' => '评价', + 'eccredit_post_already' => '对方已评', + 'eccredit_post_between' => '双方已评', + 'eccredit_post_waiting' => '等待对方评价', + 'tenpay_trade_order_status' => '查看并确认财付通交易单状态', + 'trade_baseprice' => '商品价格', + 'trade_buyer' => '买家', + 'trade_message' => '留言', + 'trade_online_tenpay' => '使用财付通在线支付', + 'trade_online_tradeurl' => '在线交易单', + 'trade_order' => '交易单', + 'trade_order_no' => '交易单号', + 'trade_order_status' => '查看并确认支付宝交易单状态', + 'trade_password' => '登录密码', + 'trade_payment' => '交易金额', + 'trade_payment_comment' => '(点击下方的“更新交易单”按钮重新计算交易金额)', + 'trade_submit_order' => '更新交易单', + 'trade_transportfee' => '运费', + 'upload_selectfile' => '浏览', + 'poll_select_option' => '选择相应的投票项:(列出了有投票的选项,可多选,不选表示给所有投票用户加标签)', + 'set_tag_log' => '添加标签记录', + 'set_tag_to_activity_users' => '给活动参与者贴标签', + 'set_tag_to_poll_users' => '给参与投票的会员贴标签', + 'set_tag_to_reply_users' => '给参与回帖的会员贴标签', + 'follow' => '收听TA', + 'have_ignored' => '已忽略', + 'i_want' => '我要', + 'last_thread' => '上一主题', + 'moderating' => '审核中', + 'modmenu_archive' => '取消存档', + 'modmenu_banpost' => '屏蔽', + 'modmenu_banthread' => '屏蔽', + 'modmenu_copy' => '复制', + 'modmenu_deletepost' => '删除', + 'modmenu_deletethread' => '删除主题', + 'modmenu_digestpost' => '精华', + 'modmenu_grouprecommend' => '推到版块', + 'modmenu_live' => '直播', + 'modmenu_highlight' => '高亮', + 'modmenu_icon' => '图标', + 'modmenu_merge' => '合并', + 'modmenu_move' => '移动', + 'modmenu_pusharticle' => '生成文章', + 'modmenu_pushplus' => '文章连载', + 'modmenu_recommend' => '推荐', + 'modmenu_removereward' => '移除悬赏', + 'modmenu_repair' => '修复', + 'modmenu_restore' => '撤销付费', + 'modmenu_split' => '分割', + 'modmenu_stamp' => '图章', + 'modmenu_stickpost' => '置顶', + 'modmenu_stickthread' => '置顶', + 'modmenu_switch_off' => '关闭', + 'modmenu_switch_on' => '打开', + 'modmenu_type' => '分类', + 'modmenu_updown' => '升降', + 'modmenu_warn' => '警告', + 'next_thread' => '下一主题', + 'nofollow' => '不收听', + 'return_forumdisplay' => '返回列表', + 'rushreply_view' => '查看抢中楼层', + 'share_url_copy' => '复制链接', + 'share_url_copy_comment' => '您的朋友访问此链接后,您将获得相应的积分奖励', + 'thread_author' => '楼主', + 'thread_printable' => '打印', + 'thread_replycredit_tips1' => '回复本帖可获得 {$_G[\'forum_thread\'][\'replycredit_rule\'][\'extcredits\']} {$_G[\'setting\'][\'extcredits\'][$_G[\'forum_thread\'][\'replycredit_rule\'][\'extcreditstype\']][\'unit\']}{$_G[\'setting\'][\'extcredits\'][$_G[\'forum_thread\'][\'replycredit_rule\'][\'extcreditstype\']][\'title\']}奖励!', + 'thread_replycredit_tips2' => '每人限 {$_G[\'forum_thread\'][\'replycredit_rule\'][\'membertimes\']} 次', + 'thread_replycredit_tips3' => '(中奖概率 {$_G[\'forum_thread\'][\'replycredit_rule\'][\'random\']}%)', + 'thread_rushreply' => '本帖为抢楼帖,欢迎抢楼!', + 'thread_rushreply_check_back' => '返回抢楼帖', + 'thread_rushreply_end' => '截止楼层:', + 'thread_rushreply_floor' => '奖励楼层', + 'thread_rushreply_limit' => '本帖为抢楼帖,{$rushresult[\'creditlimit_title\']}大于{$rushresult[\'creditlimit\']}可以抢楼', + 'thread_rushreply_over' => '抢楼结束:', + 'thread_rushreply_rewardnum' => '个楼层已中奖', + 'thread_rushreply_noreward' => '暂时还没有楼层中奖', + 'thread_rushreply_start' => ' 抢楼开始:', + 'thread_rushreply_statnum' => '统计参与人数', + 'usertag' => '用户标签', + 'activity_about_member' => '剩余名额', + 'activity_enter_imgurl' => '请输入图片地址', + 'activity_imgurl_error' => '图片地址错误', + 'activity_join' => '我要参加', + 'activity_join_audit' => '您已经参加了此活动', + 'activity_join_cancel' => '取消报名', + 'activity_join_group' => '点此处马上加入 {$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'activity_need_credit' => '注意:参加此活动将扣除您', + 'activity_new_signup' => '暂未通过', + 'activity_no_member' => '您还不是本 {$_G[\'setting\'][\'navs\'][3][\'navname\']} 的成员不能参与此活动', + 'activity_pay_myself' => '承担自己应付的花销', + 'activity_paytype' => '支付方式', + 'activity_type' => '活动类型', + 'activity_wait' => '您的加入申请已发出,请等待发起者审批', + 'activity_would_payment' => '支付', + 'activiy_guest_more' => '您的留言超过 200 个字符的限制', + 'complete_data' => '完善资料', + 'manage' => '管理', + 'next_page' => '下一页', + 'next_page_extra' => '下一页 »', + 'pm_archive' => '导出', + 'debate_all_point' => '全部观点', + 'debate_comment_dateline' => '评判时间', + 'debate_join' => '加入', + 'debate_support' => '支持', + 'debate_umpire_end' => '结束此次辩论', + 'debate_umpirepoint_edit' => '编辑裁判观点', + 'debater' => '辩手', + 'login_to_reply' => '您需要登录后才可以回帖', + 'post_fastreply_gotolast' => '回帖后跳转到最后一页', + 'post_newreply' => '发表回复', + 'post_reply_relay' => '回帖并转播', + 'debate_view_neutral' => '只看中立', + 'debate_view_opponent' => '只看反方', + 'debate_view_square' => '只看正方', + 'post_add_aboutcounter' => '添加柜台介绍', + 'reward_set_bestanswer' => '最佳答案', + 'expiration_unlimit' => '永 久', + 'thread_moderations' => '主题操作记录', + 'thread_moderations_action' => '操作', + 'thread_moderations_cron' => '任务系统', + 'thread_moderations_team' => '管理团队', + 'thread_moderations_username' => '操作者', + 'to' => '到', + 'ban_member' => '禁止', + 'clear' => '清理', + 'collection_fromctid' => '您是从淘专辑 $post[\'sourcecollection\'][\'name\'] 访问到本帖的,欢迎对专辑打分:', + 'collection_rate' => '评分', + 'collection_related' => '本帖被以下淘专辑推荐:', + 'debate_filter' => '按立场筛选', + 'follower' => '听众', + 'from_mobile' => '来自手机', + 'ignore_replynotice' => '取消回复通知', + 'member_avatar_banned' => '头像被屏蔽', + 'member_deleted' => '该用户已被删除', + 'member_homepage' => '查看个人网站', + 'member_signature_banned' => '签名被屏蔽', + 'member_viewpro' => '查看详细资料', + 'modmenu_blockrecommend' => '推送', + 'offline' => '当前离线', + 'online' => '当前在线', + 'people_score' => '人评分', + 'post_ascview' => '正序浏览', + 'post_copied' => '文章地址复制成功', + 'post_descview' => '倒序浏览', + 'post_from_mobile' => '该帖通过手机客户端发布', + 'prosit' => '恭喜', + 'published' => '发表', + 'receive_replynotice' => '接收回复通知', + 'related_thread' => '相关文章', + 'removerate' => '撤销评分', + 'rushreply_hit' => '抢中本楼', + 'rushreply_hit_title' => '查看抢中楼层', + 'thread_favorite' => '收藏', + 'thread_magic' => '使用道具', + 'thread_mod' => '文章模式', + 'thread_mod_by' => '本主题由 $lastmod[\'modusername\'] 于 $lastmod[\'moddateline\'] $lastmod[\'modaction\']', + 'thread_mod_recommend_by' => '本主题由 $lastmod[\'modusername\'] 于 $lastmod[\'moddateline\'] $lastmod[\'modaction\']到 $lastmod[\'reason\']', + 'thread_realy' => '转播', + 'thread_redirect_postno' => '电梯直达', + 'thread_redirect_postno_tips' => '跳转到指定楼层', + 'thread_share' => '分享', + 'thread_show_all' => '显示全部楼层', + 'thread_show_author' => '只看该作者', + 'viewthread_left_addfriend' => '加好友', + 'viewthread_left_poke' => '打招呼', + 'viewthread_left_sendpm' => '发消息', + 'viewthread_left_tospace' => '串个门', + 'viewthread_share_to' => '分享到', + 'warn_get' => '受到警告', + 'admin_message_banned' => '提示: 作者被禁止或删除 内容自动屏蔽,只有管理员或有管理权限的成员可见', + 'admin_message_single_banned' => '提示: 该帖被管理员或版主屏蔽,只有管理员或有管理权限的成员可见', + 'attach_nopermission_login' => '您需要 登录 才可以下载或查看,没有账号?{$_G[\'setting\'][\'reglinkname\']}', + 'guesttipsinthread_text' => '马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。', + 'attach_nopermission_connect_fill_profile' => '您需要 完善账号信息绑定已有账号 后才可以下载或查看', + 'attach_nopermission_notice' => '本文章中包含更多资源', + 'has_expired' => '该信息已经过期', + 'have' => '已有', + 'image_big' => '大图', + 'image_list_openning' => '组图打开中,请稍候......', + 'image_small' => '小图', + 'message_banned' => '提示: 作者被禁止或删除 内容自动屏蔽', + 'message_ishidden_hiddenreplies' => '此帖仅作者可见', + 'message_single_banned' => '提示: 该帖被管理员或版主屏蔽', + 'message_password_exists' => '本帖为密码帖', + 'more_images' => '更多图片', + 'pack' => '收起', + 'pay_threads' => '付费主题, 价格', + 'published_in_floor' => '查看楼层', + 'rate_total' => '总评分', + 'replies_recommended' => '回帖推荐', + 'pay_comment' => '本主题需向作者支付 {$thread[\'price\']} {$_G[\'setting\'][\'extcredits\'][$_G[\'setting\'][\'creditstransextra\'][1]][\'unit\']}{$_G[\'setting\'][\'extcredits\'][$_G[\'setting\'][\'creditstransextra\'][1]][\'title\']} 才能浏览', + 'pay_free_time' => '本主题购买截止日期为 $thread[\'endtime\'],到期后将免费', + 'people_buy' => '人购买', + 'poll_count_down' => '距结束还有', + 'poll_end' => '投票已经结束', + 'poll_hour' => '小时', + 'poll_minute' => '分钟', + 'poll_more_than' => '最多可选 $maxchoices 项', + 'poll_msg_allowvotepolled' => '您已经投过票,谢谢您的参与', + 'poll_msg_allowvotethread' => '该投票已经关闭或者过期,不能投票', + 'poll_msg_allwvoteusergroup' => '您所在的用户组没有投票权限', + 'poll_msg_overt' => '此为公开投票,其他人可看到您的投票项目', + 'poll_multiple' => '多选', + 'poll_single' => '单选', + 'poll_view_voters' => '查看投票参与人', + 'poll_voterscount' => '共有 $voterscount 人参与投票', + 'poll_voters' => '参与投票的会员', + 'comment_num' => '评论数', + 'home_view_num' => '查看数', + 'latest_comments' => '最新评论', + 'portal' => '门户', + 'posted_by' => '发布者', + 'thread_print' => '打印本页', + 'welcometo' => '欢迎光临', + 'reward_answer' => '我来回答', + 'reward_bestanswer' => '最佳答案', + 'view_full_content' => '查看完整内容', + 'my_trade_stat' => '交易记录', + 'post_trade_totalnumber' => '商品数', + 'trade_nogoods' => '本柜台无商品', + 'viewthread_trade_message1' => '您可以在本帖中继续', + 'viewthread_trade_message2' => '添加多个商品', + 'viewthread_trade_message3' => '并可以针对帖内所有商品添加统一的', + 'viewthread_trade_message4' => '柜台介绍', + 'warn_view_log' => '$warnuser 警告记录', + 'warn_view_prompt' => '$warnuser 已被累计警告 $warnnum 次,{$_G[\'setting\'][\'warningexpiration\']} 天内累计被警告 {$_G[\'setting\'][\'warninglimit\']} 次,将被自动禁止发帖 {$_G[\'setting\'][\'warningexpiration\']} 天', + 'main_nav' => '主导航', + 'quick_nav' => '快捷导航', + 'post_deleted' => '无效楼层,该帖已经被删除', + 'have_posted' => '已发表', + 'guide_draft' => '草稿', + 'pending' => '待审核', + 'preview' => '预览', + 'expire_dateline' => '过期时间', + 'darkroom' => '小黑屋', + 'darkroom_no_users' => '还没有人入住小黑屋,大家都是模范会员~', + 'replystick' => '置顶回复', + 'replystick_icon' => '顶', + 'search_forum' => '搜索版块', + 'latest_images' => '最新图片', + 'hot_thread' => '热门文章', + 'my_order_collection' => '我订阅的专辑', + 'recommend_collection' => '淘专辑推荐', + 'rank' => '排名', + 'previous_rank' => '上次排名', + 'latest' => '最新', + 'showdisplayorder' => '显示置顶', + 'hidedisplayorder' => '隐藏置顶帖', + 'havemore_special' => '【还有', + 'over' => '结束', + 'right_special' => '】', + 'like' => '喜欢', + 'onloading' => '加载中', + 'youneedpay' => '您需要支付', + 'onlyintoforum' => '才能进入此版块', + 'confirmyourpay' => '确认支付', + 'rushreply_thread' => '抢楼主题', + 'thread_pricepay' => '主题售价', + 'stopfloor' => '回帖限制', + 'replylimit' => '每个用户回帖次数上限', + 'basic_attr' => '基本属性', + 'text_feature' => '文本特性', + 'content_to_pic' => '内容生成图片', + 'manage_operation' => '管理操作', + 'page_separate' => '分页', + 'directory' => '目录', + 'replypassword' => '文章密码', + 'replybackground' => '文章背景', + 'pictypefile' => '图片文件', + 'backgroundcolor' => '背景色', + 'collapse_the_left' => '收起左侧', + 'open_the_left' => '开启左侧', + 'other_reply_hide' => '还有一些文章被系统自动隐藏,点此展开', + 'keyboard_tip' => '提示:支持键盘翻页<-左 右->', + 'lightclose' => '关灯', + 'lightopen' => '开灯', + 'waitpicloading' => '组图打开中,请稍候', + 'text_summary' => '正文摘要', + 'view_bigpic' => '只看大图', + 'read_mode' => '阅读模式', + 'fav_thread' => '收藏本帖', + 'rate_position' => '评分表立场', + 'follow_spread' => '转播求扩散', + 'share_digest' => '分享推精华', + 'thread_collect' => '淘好帖进专辑', + 'maketoponce' => '顶一下', + 'makebottomonce' => '踩一下', + 'support_reply' => '支持', + 'against_reply' => '反对', + 'pleaseinputpw' => ',请输入密码', + 'number_of_participants' => '参与人数', + 'hide_preview' => '隐藏预览', + 'collapse_preview' => '收起预览', + 'hot_thread' => '热帖', + 'hidden' => '隐藏', + 'hiderecover_tips' => '点击恢复主题隐藏状态', + 'hiderecover' => '恢复隐藏', + 'content_actions' => '更多操作', +); + +?> \ No newline at end of file diff --git a/source/language/forum/lang_thread.php b/source/language/forum/lang_thread.php new file mode 100644 index 0000000..273aba2 --- /dev/null +++ b/source/language/forum/lang_thread.php @@ -0,0 +1,25 @@ + '存档', + 'source' => '来源', + + 't_question' => '?', + 't_comma' => ',', + 't_exclamatory' => '!', + 't_period' => '。', + 't_suspension' => '…', + +); +?> \ No newline at end of file diff --git a/source/language/group/index.htm b/source/language/group/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/group/lang_misc.php b/source/language/group/lang_misc.php new file mode 100644 index 0000000..8e64fdb --- /dev/null +++ b/source/language/group/lang_misc.php @@ -0,0 +1,23 @@ + '设为普通成员', + 'group_goaway' => '踢出圈子', + 'group_demise_message_title' => '把{_G/setting/navs/3/navname}{forum}成功转让给您了。', + 'group_demise_message_body' => '我的{_G/setting/navs/3/navname}{forum}成功转让给您了,[url={siteurl}forum.php?mod=group&fid={fid}]点这里查看{_G/setting/navs/3/navname}[/url]', + 'group_join' => '加入{groupname}圈子', +); + +?> \ No newline at end of file diff --git a/source/language/group/lang_template.php b/source/language/group/lang_template.php new file mode 100644 index 0000000..7db4444 --- /dev/null +++ b/source/language/group/lang_template.php @@ -0,0 +1,222 @@ + '积分', + 'favorite' => '收藏', + 'group_admin' => '管理{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_create' => '创建{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_create_buildcredits' => '创建{$_G[\'setting\'][\'navs\'][3][\'navname\']}需要消耗', + 'group_discuss_area' => '讨论区', + 'group_has_joined' => '已加入该{$_G[\'setting\'][\'navs\'][3][\'navname\']},等待圈主审核中...', + 'group_join_group' => '加入{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_join_type' => '加入方式', + 'group_join_type_free' => '自由加入', + 'group_join_type_invite' => '邀请加入', + 'group_join_type_moderate' => '审核加入', + 'group_join_confirm' => '您确定要加入该{$_G[\'setting\'][\'navs\'][3][\'navname\']}吗?', + 'group_level' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}等级', + 'group_member_list' => '成员列表', + 'group_moderator_title' => '圈主', + 'group_perm_all_user' => '所有人', + 'group_perm_member_only' => '仅成员', + 'group_perm_visit' => '浏览权限', + 'group_push_to_forum' => '推荐到版块', + 'home' => '首页', + 'my_buddylist_invite' => '邀请好友', + 'close' => '关闭', + 'confirms' => '确定', + 'max_can_select' => '最多可以选择', + 'select_focus_group' => '选择关注的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'choose_please' => '请选择', + 'create' => '创建', + 'group_category' => '所属分类', + 'group_create_mod' => '需要审核开通', + 'group_create_new' => '创建新{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_create_selete_categroy' => '请选择{$_G[\'setting\'][\'navs\'][3][\'navname\']}分类', + 'group_description' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}简介', + 'group_description_preview' => '预览', + 'group_name' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}名称', + 'anonymous' => '匿名', + 'author' => '作者', + 'click_to_readmore' => '点击查看更多话题', + 'dateline_range' => '时间', + 'forum_nothreads' => '本版块或指定的范围内尚无主题。', + 'group_member_status' => '成员动态', + 'group_no_latest_feeds' => '本{$_G[\'setting\'][\'navs\'][3][\'navname\']}没有最新动态', + 'lastpost' => '最后发表', + 'latest_threads' => '最新主题', + 'post_newthread' => '发新话题', + 'post_newthreadactivity' => '发布活动', + 'post_newthreaddebate' => '发布辩论', + 'post_newthreadpoll' => '发布投票', + 'post_newthreadreward' => '发布悬赏', + 'post_newthreadtrade' => '发布商品', + 'replies' => '回复/查看', + 'send_posts' => '发帖', + 'target_blank' => '新窗口打开', + 'thread_activity' => '活动', + 'thread_debate' => '辩论', + 'thread_poll' => '投票', + 'thread_reward' => '悬赏', + 'thread_trade' => '商品', + 'view_all_threads' => '查看所有主题', + 'finished' => '完成', + 'group_choose_friend_to_invite' => '请选择您要邀请的好友', + 'group_invite_list' => '邀请列表', + 'attach_img' => '图片附件', + 'attachment' => '附件', + 'forum_viewall' => '全部', + 'heats' => '级热门', + 'heats_icon' => '火', + 'price' => '售价', + 'rate_credit_add' => '文章被加分', + 'readperm' => '阅读权限', + 'return_index' => '返回首页', + 'reward_solved' => '已解决', + 'thread' => '文章', + 'thread_digest' => '精华', + 'thread_moved' => '移动', + 'thread_recommend' => '评价指数', + 'thread_recommend_icon' => '荐', + 'time' => '时间', + 'delete' => '删除', + 'displayorder' => '顺序', + 'enable' => '启用', + 'enter_member_user' => '请输入成员名称', + 'group_admin_member' => '管理成员', + 'group_admin_panel' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}管理面板', + 'group_close_notice' => '注:{$_G[\'setting\'][\'navs\'][3][\'navname\']}关闭后只有圈主才可以浏览', + 'group_demise' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}转让', + 'group_demise_comment' => '

          接受转让资格:

          只能转让给本{$_G[\'setting\'][\'navs\'][3][\'navname\']}的管理成员。

          接收者要具备可再创建新{$_G[\'setting\'][\'navs\'][3][\'navname\']}的资格。

          ', + 'group_demise_notice' => '

          温馨提示:

          {$_G[\'setting\'][\'navs\'][3][\'navname\']}转让成功后,您依然是该群的圈主,但不再是{$_G[\'setting\'][\'navs\'][3][\'navname\']}创始人,所以可自由退出该{$_G[\'setting\'][\'navs\'][3][\'navname\']}。

          转让后无法直接恢复群,需被接收者主动操作才可以再次转回,请谨慎操作。

          ', + 'group_domain_message' => '域名可使用最少 $domainlength 个 ,最多 30 个的字母或数字组合,且必须字母开头。', + 'group_edit_domain_message' => '修改域名将需要支付积分{$consume},您现在有拥有{$credits}', + 'group_icon' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}图标', + 'group_icon_resize' => '自动缩略成 48 X 48 像素大小的图片', + 'group_image' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}顶部图片', + 'group_image_filesize_advise' => '建议使用尺寸为 730×150 的图片以取得最佳效果', + 'group_image_filesize_limit' => '文件小于 $_G[\'setting\'][\'group_imgsizelimit\'] KB', + 'group_input_password' => '请输入登录密码', + 'group_level_cannot_do' => '目前您的{$_G[\'setting\'][\'navs\'][3][\'navname\']}等级不能使用此功能。', + 'group_member_management' => '成员管理', + 'group_member_moderate' => '成员审核', + 'group_moderator' => '设为圈主', + 'group_moderator_vice' => '设为副圈主', + 'group_moderator_vice_title' => '副圈主', + 'group_no_admin_member' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}目前还没有管理成员。', + 'group_no_image' => '不使用图片', + 'group_no_image_comment' => '当‘{$_G[\'setting\'][\'navs\'][3][\'navname\']}图片’使用的话,{$_G[\'setting\'][\'navs\'][3][\'navname\']}图标在该{$_G[\'setting\'][\'navs\'][3][\'navname\']}页面不做显示', + 'group_no_member_moderated' => '暂无需要审核成员。', + 'group_setup' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}设置', + 'group_star_member_title' => '明星成员', + 'group_threadtype' => '主题分类', + 'group_threadtype_limit_1' => '最多只能有', + 'group_threadtype_limit_2' => '个主题分类。', + 'ignore' => '忽略', + 'ignore_all' => '忽略全部', + 'login_normal_mode' => '在线', + 'member' => '成员', + 'no' => '否', + 'pass' => '通过', + 'pass_all' => '全部通过', + 'search' => '搜索', + 'subdomain' => '二级域名', + 'submit' => '提交', + 'threadtype' => '主题分类', + 'threadtype_add' => '添加分类', + 'threadtype_name' => '分类名称', + 'threadtype_prefix' => '类别前缀', + 'threadtype_prefix_comment' => '是否在主题前面显示分类的名称', + 'threadtype_prefix_off' => '不显示', + 'threadtype_prefix_on' => '显示', + 'threadtype_required' => '发帖必须归类', + 'threadtype_required_force' => '是否强制用户发表新主题时必须选择分类', + 'threadtype_turn_on' => '启用主题分类', + 'threadtype_turn_on_comment' => '设置是否启用主题分类功能,您需要同时设定相应的分类选项,才能启用本功能', + 'transfer_group_to' => '将{$_G[\'setting\'][\'navs\'][3][\'navname\']}转让给', + 'yes' => '是', + 'all' => '全部', + 'all_group' => '所有{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'attention_group' => '关注{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'friend_join_group' => '好友加入的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_thread' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}话题', + 'group_wait_mod' => '待审核', + 'hot_group' => '热门{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'last_post' => '最后发表', + 'last_topic_in_group' => '新话题(最近30天)', + 'more' => '更多', + 'my_join' => '我参与的', + 'my_join_group' => '我加入的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'my_last_topic_in_group' => '我在{$_G[\'setting\'][\'navs\'][3][\'navname\']}中发表的话题', + 'my_manage' => '我管理的', + 'my_manage_group' => '我管理的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'my_thread' => '我的话题', + 'no_group_create_now' => '您还没创建{$_G[\'setting\'][\'navs\'][3][\'navname\']},现在创建', + 'no_group_join' => '您还没有加入任何{$_G[\'setting\'][\'navs\'][3][\'navname\']},找喜欢的{$_G[\'setting\'][\'navs\'][3][\'navname\']}。', + 'no_related_posts' => '还没有相关的文章。', + 'somebody_group' => '的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_do_not_push' => '不推荐', + 'copy' => '复制', + 'create_on' => '创建于', + 'group_digest_recommend' => '精华推荐', + 'group_exit' => '退出{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_exit_confirm' => '您确定要退出该{$_G[\'setting\'][\'navs\'][3][\'navname\']}吗?', + 'group_find_topics' => '在本{$_G[\'setting\'][\'navs\'][3][\'navname\']}中寻找文章', + 'group_hot_topics_today' => '今天大家都在讨论的话题', + 'group_member_active' => '活跃成员', + 'group_member_new' => '新加入', + 'group_member_rank' => '排名', + 'group_url' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}地址', + 'group_url_copy_finished' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}地址复制成功', + 'group_visited' => '浏览过的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_you_have' => '您已有 {$groupnum} 个{$_G[\'setting\'][\'navs\'][3][\'navname\']},还能创建 {$allowbuildgroup} 个。', + 'input_search_key_words' => '请输入搜索关键字', + 'posts' => '文章', + 'create_group_message1' => '创建自己的地盘', + 'create_group_message2' => '精心打造{$_G[\'setting\'][\'navs\'][3][\'navname\']}空间', + 'create_group_message3' => '邀请好友加入我的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'create_group_message4' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}积分升级赢得社区推荐', + 'create_group_step' => '创建{$_G[\'setting\'][\'navs\'][3][\'navname\']}步骤', + 'group_categories' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}分类', + 'group_focus' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}焦点', + 'group_hot' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}积分排行', + 'group_upgrade' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}升级', + 'invite_friend' => '邀请好友', + 'my_group' => '我的{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'personality_setting' => '个性设置', + 'recommend_group' => '推荐{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_activities' => '活跃度', + 'group_category_no_groups' => '该分类下暂时没有{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'group_category_no_groups_detail' => '返回上级分类重新选择,或者[创建一个新的{$_G[\'setting\'][\'navs\'][3][\'navname\']}]', + 'group_create_time' => '建立时间', + 'group_founded_in' => '创建于', + 'group_member' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}成员', + 'group_member_count' => '人数', + 'group_total_members_threads' => '成员: $val[\'membernum\'], 主题: $val[\'threads\']', + 'group_total_numbers' => '共有 $curtype[\'groupnum\'] 个{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'orderby' => '排序方式', + 'orderby_default' => '默认排序', + 'stats_main_threads_count' => '主题数', + 'threads' => '主题', + 'reply' => '回复', + 'group_live' => '直播', + 'group_live_newreply_refresh' => '有新的发言了,点击刷新', + 'group_live_fastreply_notice' => '#在这里快速回复#', + 'group_live_post' => '发表', + 'group_live_nocontent_error' => '抱歉,您尚未输入内容', + 'login_to_reply' => '您需要登录后才可以回帖', + 'no_permission_to_post' => '您现在无权发帖。', + 'click_to_show_reason' => '点击查看原因', +); + +?> \ No newline at end of file diff --git a/source/language/home/index.htm b/source/language/home/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/language/home/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/language/home/lang_editor.php b/source/language/home/lang_editor.php new file mode 100644 index 0000000..13e9e72 --- /dev/null +++ b/source/language/home/lang_editor.php @@ -0,0 +1,85 @@ + '切换到多媒体', + 'editor_cut' => '剪切', + 'editor_copy' => '复制', + 'editor_paste' => '粘贴', + 'editor_font' => '字体', + 'editor_fontsize' => '字号', + 'editor_fontbold' => '加粗', + 'editor_fontitalic' => '斜体', + 'editor_fontunderline' => '下划线', + 'editor_funtcolor' => '字体颜色', + 'editor_align' => '对齐', + 'editor_list' => '编号', + 'editor_indent' => '缩进', + 'editor_hyperlink' => '超链接', + 'editor_remove_link' => '移除链接', + 'editor_link_image' => '添加图片', + 'editor_link_attach' => '添加附件', + 'editor_link_flash' => '添加视频FLASH或MP3音乐', + 'editor_insert_smiley' => '插入表情', + 'editor_doodle' => '涂鸦', + 'editor_pagebreak' => '插入分页标志', + 'editor_download_remote' => '下载远程图片', + 'editor_restore' => '恢复内容', + 'editor_switch_text' => '切换到纯文本', + 'editor_font_song' => '宋体', + 'editor_font_hei' => '黑体', + 'editor_font_kai' => '楷体', + 'editor_font_li' => '隶书', + 'editor_font_you' => '幼圆', + 'editor_fontsize_xxsmall' => '极小', + 'editor_fontsize_xsmall' => '特小', + 'editor_fontsize_small' => '小', + 'editor_fontsize_medium' => '中', + 'editor_fontsize_large' => '大', + 'editor_list_order' => '数字列表', + 'editor_list_unorder' => '符号列表', + 'editor_align_left' => '左对齐', + 'editor_align_center' => '居中对齐', + 'editor_align_right' => '右对齐', + 'editor_indent_inc' => '增加缩进', + 'editor_indent_dec' => '减少缩进', + 'editor_color_darkred' => '暗红色', + 'editor_color_purple' => '紫色', + 'editor_color_red' => '红色', + 'editor_color_pink' => '鲜粉色', + 'editor_color_darkblue' => '深蓝色', + 'editor_color_blue' => '蓝色', + 'editor_color_lakeblue' => '湖蓝色', + 'editor_color_greenblue' => '蓝绿色', + 'editor_color_green' => '绿色', + 'editor_color_olives' => '橄榄色', + 'editor_color_lightgreen' => '浅绿色', + 'editor_color_orange' => '橙黄色', + 'editor_color_black' => '黑色', + 'editor_color_grey' => '灰色', + 'editor_color_silver' => '银色', + 'editor_color_white' => '白色', + 'editor_ok' => '确定', + 'editor_cancel' => '取消', + 'editor_prompt_textlink' => '请输入选定文字链接地址', + 'editor_prompt_imagelink' => '请输入图片 URL 地址', + 'editor_prompt_pagetitle' => '请输入分页标题', + 'editor_prompt_videolink' => '请输入视频 URL 地址', + 'editor_prompt_video_flash' => 'Flash 动画', + 'editor_prompt_video_media' => 'Media 视频', + 'editor_prompt_video_real' => 'Real 视频', + 'editor_prompt_mp3' => 'mp3 音乐', + 'editor_full_screen' => '全屏', +); + +?> \ No newline at end of file diff --git a/source/language/home/lang_magic.php b/source/language/home/lang_magic.php new file mode 100644 index 0000000..9cf33d2 --- /dev/null +++ b/source/language/home/lang_magic.php @@ -0,0 +1,30 @@ + '目标主题 tid', + 'target_pid' => '目标文章 pid', + 'target_username' => '目标用户名', + 'magics_type_1' => '文章类', + 'magics_type_2' => '会员类', + 'magics_type_3' => '其他类', + + 'CCK_color' => '颜色', + 'MOK_info' => '获得的钱币数目规则:大于 1 且小于购买价格 150% 的随机数', + 'CODE_info' => '获得 Discuz! 测试邀请码一个', + 'MVK_target' => '要移动到的版面', + 'SOFA_message' => '一道闪电划破湛蓝的天空,随着一声巨响,沙发被我抢了!哈哈!', +); + +?> \ No newline at end of file diff --git a/source/language/home/lang_template.php b/source/language/home/lang_template.php new file mode 100644 index 0000000..19777e7 --- /dev/null +++ b/source/language/home/lang_template.php @@ -0,0 +1,1563 @@ + '取消', + 'close' => '关闭', + 'create' => '创建', + 'submit' => '提交', + 'accessory' => '附件', + 'activity' => '活动', + 'comefrom' => '来自', + 'credits' => '积分', + 'debate' => '辩论', + 'digest' => '精华', + 'follow' => '广播', + 'follow_add' => '收听', + 'follow_for' => '为', + 'follow_add_bkname' => '添加备注', + 'follow_add_feed' => '发广播', + 'follow_add_special_following' => '添加特别收听', + 'follow_add_special_tip' => '您可以将指定的用户加入到“特别收听”列表,然后通过页面筛选阅读他们广播, ', + 'follow_add_title' => '添加标题', + 'follow_auto_title' => '自动截取标题', + 'follow_del' => '取消收听', + 'follow_del_special_following' => '取消特别收听', + 'follow_feeds_num' => '广播数', + 'follow_fetch_interested_user' => '寻找感兴趣的人并收听他', + 'follow_follower' => '听众', + 'follow_following' => '我收听的', + 'follow_following_null' => '还没有关注的内容', + 'follow_no_content' => 'TA还没有发表广播', + 'follow_hall' => '广播大厅', + 'follow_have' => '有', + 'follow_i_know' => '我知道了', + 'follow_loading' => '加载中...', + 'follow_mod_bkname' => '修改备注', + 'follow_more' => '更多', + 'follow_my_feed' => '我的广播', + 'follow_my_follower' => '我的听众', + 'follow_new_thread' => '发表文章', + 'follow_open_feed' => '展开全文', + 'follow_other_forum' => '浏览其它版块', + 'follow_preview_null' => '没有预览内容', + 'follow_privacy_hidden' => '条记录涉及隐私被隐藏', + 'follow_recent_note' => '最近动作', + 'follow_recommend' => '推荐收听', + 'follow_relate_thread_null' => '没有相关主题', + 'follow_select_forum' => '选择版块', + 'follow_special_following' => '特别收听', + 'follow_user_follower_none' => '还没有人收听TA', + 'follow_user_following' => '收听的人', + 'follow_user_following_none' => 'TA还没有收听任何人', + 'follow_user_special_following' => '特别收听的人', + 'follow_view_space' => '查看空间', + 'follow_who_data' => '的资料', + 'follow_who_follower' => '的听众', + 'follow_you_follower_none1' => '还没有人收听您,多', + 'follow_you_follower_none2' => '多互动,别人才会收听您 :)', + 'follow_you_following_none' => '您还没有收听任何人,您可以先到', + 'follow_sync_forum' => '同步到论坛', + 'homepage' => '首页', + 'memcp_profile' => '个人资料', + 'pack_up' => '收起', + 'photo_accessories' => '图片附件', + 'poll' => '投票', + 'post' => '文章', + 'posts_num' => '文章数', + 'regdate' => '注册时间', + 'reply' => '回复', + 'reward' => '悬赏', + 'threads_num' => '主题数', + 'topic' => '主题', + 'trade' => '商品', + 'upload' => '上传', + 'delete' => '删除', + 'follow_post_by_time' => '发表于', + 'follow_reply' => '转播', + 'follow_special_thread_tip' => '这是一个特殊主题,点这里可以回原帖查看详细内容', + 'follow_thread_deleted' => '该主题已被删除', + 'follow_followed' => '已收听', + 'follow_follower_mutual' => '互相收听', + 'follow_user_followed' => 'TA已收听您', + 'did_not_follow_to_me' => 'TA未收听您', + 'accept_invitation' => '接受邀请', + 'become_friend' => '

          成为好友后,你们就可以一起讨论话题,及时关注对方的更新……

          +

          您也可以方便快捷地发布自己的日志、上传图片、记录生活点滴与好友分享

          +

          还等什么呢?赶快加入我们吧

          ', + 'friend_information' => '

          已有 $space[\'friends\'] 个好友, $space[\'albums\'] 个相册, $space[\'doings\'] 条记录, $space[\'blogs\'] 篇日志, $space[\'threads\'] 个话题

          ', + 'invite_friend' => '邀请好友', + 'invite_friends' => '好友邀请', + 'invite_you_to_friends' => '热情邀请您为好友', + 'lgnore_invitation' => '忽略邀请', + 'register_immediately' => '马上登录', + 'somebody_friends' => '的好友', + 'want_to_register' => '我要注册', + 'welcome' => '欢迎您,', + 'add' => '添加', + 'add_friend_max_10' => '添加好友(最多 10 个)', + 'sent_following_friends' => '已给下列好友发送通知', + 'no_redbag_space' => '没有探测到任何有红包的空间', + 'done_doodle_notice' => '涂鸦完成记得点"保存"', + 'modified_time' => '修改时间', + 'credits_per_part' => '每份积分', + 'credits_type' => '积分类型', + 'hide_credits' => '埋设积分', + 'friends_space_message_following' => '已在下列好友空间留言', + 'poke_1' => '踩一下', + 'poke_10' => '电一下', + 'poke_11' => '依偎', + 'poke_12' => '拍拍肩膀', + 'poke_13' => '咬一口', + 'poke_2' => '握个手', + 'poke_3' => '微笑', + 'poke_4' => '加油', + 'poke_5' => '抛媚眼', + 'poke_6' => '拥抱', + 'poke_7' => '飞吻', + 'poke_8' => '挠痒痒', + 'poke_9' => '给一拳', + 'poke_folowing_friends' => '已给下列好友打招呼', + 'say_hi' => '打个招呼', + 'select_a_poke' => '请选择一个招呼', + 'select_one_message' => '请选择一条留言内容', + 'space_access_following_friends' => '已访问下列好友空间', + 'space_message' => '空间留言', + 'visit_method' => '访问方式', + 'visit_space' => '访问空间', + 'visitmsg_1' => '踩踩', + 'visitmsg_2' => '好久不见', + 'visitmsg_3' => '记得回踩哦', + 'visitmsg_4' => '我又来了', + 'visitmsg_5' => '好漂亮的空间啊', + 'visitmsg_6' => '最近在忙什么呢', + 'experience' => '经验', + 'you_chance_pre_week' => '本周期内,您还有 $rule[\'cyclenum\'] 次机会', + 'enter_password' => '您需要正确输入密码后才能继续查看:', + 'password_authentication' => '密码验证', + 'basic_data' => '基础数据', + 'comprehensive_overview' => '综合概况', + 'comprehensive_overview_message' => '这里看到的是站点的综合概况发展统计(需要至少统计 2 天后才有效)', + 'info_interactive' => '信息互动', + 'interactive_help_message' => '
        • 来访用户:指的是每天访问本站的唯一用户数。一个用户访问多次,也只算一次
        • +
        • {$_G[\'setting\'][\'navs\'][2][\'navname\']}:指的是每天发布主题、投票、活动、悬赏、辩论、商品和主题回帖的总数量
        • +
        • 圈子:指的是每天创建{$_G[\'setting\'][\'navs\'][3][\'navname\']}、{$_G[\'setting\'][\'navs\'][3][\'navname\']}主题、{$_G[\'setting\'][\'navs\'][3][\'navname\']}回帖的总数量
        • +
        • 家园:指的是每天发布记录、日志、图片、话题、投票、活动、分享和互相评论的总数量
        • +
        • 互动:指的是每天用户之间互相留言、打招呼和的{$_G[\'setting\'][\'navs\'][4][\'navname\']}相应的表态互动总数量
        • ', + 'member_interactive' => '互动', + 'show' => '查看', + 'home' => '家园', + 'tgroup' => '圈子', + 'stat_classification' => '统计分类', + 'stat_date_range' => '统计日期', + 'stat_merge_statistic' => '合并统计', + 'stat_message' => '站点趋势统计系统,会记录站点每日的发展概况。通过每日的趋势变化,为站长运营站点提供科学的数据基础 ', + 'trends_and_statistics' => '趋势统计', + 'a_file' => '个文件', + 'album_name' => '相册名', + 'album_type' => '相册分类', + 'auto_shooting' => '秒自拍', + 'browser' => '浏览', + 'camera_pic_upload_ok' => '大头贴上传完成', + 'clear_bg' => '清除相框', + 'continue' => '继续', + 'count_backwards' => '倒数', + 'depict' => '描述(单击修改)', + 'desultory' => '抓拍', + 'done' => '完成', + 'file_too_big' => '文件过大', + 'filter_disable' => '禁用', + 'filter_fuzzy' => '模糊', + 'filter_gyrosigma' => '布纹', + 'filter_light' => '发光', + 'filter_shadow' => '阴影', + 'filter_splash' => '喷溅', + 'filter_watercolor' => '水彩', + 'no_camera_message' => '在您的机器上没有检测到摄象头或者您的摄象头设备正在使用中', + 'no_draw_message' => '没有任何涂鸦动作,无法保存', + 'pagedown' => '下一页', + 'pageup' => '上一页', + 'redraw' => '重画', + 'refuse_camera_message' => '在您的机器上检测到摄象头但您拒绝了摄象头的使用', + 'reload' => '重载', + 'save' => '保存', + 'save_pic_message_1' => '张大头贴,正在保存第', + 'save_pic_message_2' => '张大头贴', + 'save_to' => '保存到', + 'second' => '秒', + 'select_album_please' => '请选择相册', + 'select_album_type' => '请选择相册分类', + 'select_type' => '选择分类', + 'series' => '连拍', + 'set_parameter' => '参数设置', + 'site_error_message' => '参数错误,系统载入失败', + 'tatal_of' => '总共有', + 'upload_error' => '上传失败', + 'upload_ok' => '上传完成', + 'upload_ok_message' => '所有文件上传完成!', + 'upload_stat' => '上传进度', + 'uploading' => '正在上传', + 'uploading_message' => '个文件等待上传,正在上传第', + 'ver_message_1' => '程序需 FlashPlayer 9.0.45 以上版本您的播放器版本为', + 'ver_message_2' => '请升级', + 'my_dear_friend' => '亲爱的朋友', + 'system_email_not_replay' => '此邮件为系统自动发出的邮件,请勿直接回复 ', + 'all_friends' => '全部好友', + 'create_new_activity' => '发起新活动', + 'day' => '日', + 'filter_by_friend' => '按好友筛选', + 'five' => '五', + 'four' => '四', + 'friend_activity' => '好友发起的活动', + 'have' => '已有', + 'hide_activity' => '本页有 $hiddennum 个活动因隐私问题而隐藏', + 'join_num' => '人参加', + 'my_activity' => '我的活动', + 'my_create_activity' => '我发起的活动', + 'my_join_activity' => '我参与的活动', + 'newest_activity' => '最新活动', + 'no_activity' => '还没有相关的活动', + 'one' => '一', + 'six' => '六', + 'some_message' => '条留言', + 'they_activity' => 'TA 的所有活动', + 'three' => '三', + 'top_activity' => '热门活动', + 'two' => '二', + 'view_all' => '随便看看', + 'week' => '星期', + 'album' => '相册', + 'blog' => '日志', + 'doing_record_list' => '结果列表', + 'edit' => '编辑', + 'explain_album' => '您在论坛或日志里面上传的图片附件,全部存放在 默认相册 里', + 'follow_search_album' => '以下是搜索相册', + 'friend_album' => '好友的相册', + 'friendname_1' => '仅好友可见', + 'friendname_2' => '指定好友可见', + 'friendname_3' => '仅自己可见', + 'friendname_4' => '凭密码可见', + 'hide_album' => '提示:本页有 $pricount 个相册因作者的隐私设置而隐藏', + 'hide_pic' => '本页有 $pricount 张图片因作者的隐私设置或未通过而隐藏', + 'hot_pic_recommend' => '热门图片推荐', + 'my_album' => '我的相册', + 'newest_update_album' => '最近更新的相册', + 'no_album' => '没有可浏览的列表', + 'post_new_blog' => '发表新日志', + 'update' => '更新', + 'add_frame' => '加相框', + 'cancel_frame' => '取消相框', + 'comment' => '评论', + 'current_comment' => '当前只显示与您操作相关的单个评论,点击此处查看全部评论', + 'current_pic' => '当前第 $sequence 张|共 $album[\'picnum\'] 张图片', + 'edit_description' => '编辑说明', + 'hot' => '热度', + 'login' => '登录', + 'login_to_comment' => '您需要登录后才可以评论', + 'look_exif' => '查看 EXIF 信息', + 'look_pic' => '查看原图', + 'manage_pic' => '管理图片', + 'moderate_need' => '待审核', + 'next_pic' => '下一张', + 'no_exif' => '无 EXIF 信息', + 'previous_pic' => '上一张', + 'publish_comment' => '发表评论', + 'report' => '举报', + 'restart' => '重新播放', + 'return_pic_list' => '返回图片列表', + 'share' => '分享', + 'start_playing' => '幻灯播放', + 'stop_playing' => '停止播放', + 'upload_at' => '上传于', + 'album_pics' => '张图片', + 'favorite' => '收藏', + 'next_album' => '下一组', + 'no_pics' => '该相册下还没有图片', + 'previous_album' => '上一组', + 'switch_pics' => '其它相册', + 'system_cat' => '系统分类', + 'total' => '共', + 'blog_read' => '次阅读', + 'blog_replay' => '个评论', + 'cancel_stick' => '取消置顶', + 'follow_search_blog' => '以下是搜索日志', + 'friend_blog' => '好友的日志', + 'hide_blog' => '本页有 $pricount 篇日志因作者的隐私设置或未通过审核而隐藏', + 'my_blog' => '我的日志', + 'newest_blog' => '最新发表的日志', + 'no_related_blog' => '还没有相关的日志', + 'pending' => '待审核', + 'personal_category' => '个人分类', + 'recommend_blog' => '推荐阅读的日志', + 'stick' => '置顶', + 'they_blog' => 'TA 的所有日志', + 'all' => '全部', + 'article_push' => '生成文章', + 'author_newest_blog' => '作者的其他最新日志', + 'click_view_all' => '点击此处查看全部评论', + 'current_blog_replay' => '当前只显示与您操作相关的单个评论,', + 'have_read_blog' => '已有 $blog[\'viewnum\'] 次阅读', + 'insert_emoticons' => '插入表情', + 'invite' => '邀请', + 'popular_blog_review' => '热门日志导读', + 'use_magic_tools' => '使用道具', + 'view_blog' => '查看日志', + 'add_friend' => '加为好友', + 'connect_me' => '给我留言', + 'diy_space' => '装扮空间', + 'edit_avatar' => '编辑头像', + 'enter' => '进入', + 'ignore_friend' => '解除好友', + 'manage_post' => '管理文章', + 'online' => '在线', + 'send_pm' => '发送消息', + 'someone_space' => '的空间', + 'update_doing' => '更新记录', + 'update_profile' => '更新资料', + 'user_ban' => '禁止用户', + 'user_edit' => '编辑用户', + 'view_message' => '查看留言', + 'anonymity' => '匿名', + 'person' => '人', + 'position_friend' => '刚表态过的朋友', + 'moderate_not_validate' => '审核未通过', + 'affirm' => '正方', + 'affirm_votes' => '正方观点', + 'chart_support' => '点击支持', + 'create_new_debate' => '发起新辩论', + 'debate_all_point' => '全部观点', + 'draw' => '平局', + 'friend_debate' => '好友发起的辩论', + 'hide_debate' => '本页有 $hiddennum 个 辩论因隐私问题而隐藏', + 'my_create_debate' => '我发起的辩论', + 'my_debate' => '我的辩论', + 'my_join_debate' => '我参与的辩论', + 'nega' => '反方', + 'nega_votes' => '反方观点', + 'newest_debate' => '最新辩论', + 'no_debate' => '还没有相关的辩论', + 'ongoing' => '进行中', + 'open_new_window' => '新窗口打开', + 'popularity' => '人气', + 'rate' => '进度', + 'they_debate' => 'TA 的所有辩论', + 'top_debate' => '热门辩论', + 'view_by_friend' => '按好友查看', + 'win' => '获胜', + 'diy_add_block' => '添加模块', + 'diy_block' => '模块', + 'diy_dress' => '自定义装扮', + 'diy_layout' => '版式/布局', + 'diy_layout_1' => '版式', + 'diy_redo' => '重做', + 'diy_revocation' => '撤销', + 'diy_start' => '开始', + 'diy_style' => '风格', + 'do_it_yourself' => '自定义', + 'doing' => '记录', + 'doing_enter_keywords' => '请输入搜索关键字', + 'doing_no_replay' => '现在还没有记录', + 'doing_now' => '您可以用一句话记录下这一刻在做什么', + 'doing_orderby_time' => '按照发布时间排序', + 'doing_search' => '搜索记录', + 'doing_search_record' => '以下是搜索记录', + 'doing_they' => 'TA 的所有记录', + 'doing_view_me' => '我的记录', + 'hide_doing' => '本页有 $pricount 条记录因未通过审核而隐藏', + 'me_friend_doing' => '我和好友的记录', + 'search' => '搜索', + 'somebody_doing' => '的记录', + 'doing_maxlimit_char' => '还可输入 200 个字符', + 'doing_update_personal_signature' => '同步到个人签名', + 'publish' => '发布', + 'closed' => '已关闭', + 'credit_rating' => '信用评价', + 'draft' => '草稿箱', + 'eccredit_1month' => '最近 1 个月', + 'eccredit_1week' => '最近1周', + 'eccredit_6month' => '最近 6 个月', + 'eccredit_6monthbefore' => '6 个月前', + 'eccredit_bad' => '差评', + 'eccredit_buyerinfo' => '买家信用', + 'eccredit_buyerpercent' => '买家好评率', + 'eccredit_good' => '好评', + 'eccredit_sellerinfo' => '卖家信用', + 'eccredit_sellerpercent' => '卖家好评率', + 'eccredit_soso' => '中评', + 'eccredit_total' => '总计', + 'have_posted' => '已发表', + 'payto_creditinfo' => '支付宝账户信用信息', + 'recyclebin' => '回收站', + 'taobao' => '阿里旺旺', + 'del_favorite' => '删除选中收藏', + 'collection_favorite' => '添加到淘帖', + 'del_select_favorite_confirm' => '确定要删除选中的收藏吗?', + 'favorite_album' => '相册', + 'favorite_all' => '全部收藏', + 'favorite_article' => '文章', + 'favorite_blog' => '日志', + 'favorite_forum' => '版块', + 'favorite_group' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'favorite_thread' => '文章', + 'no_favorite_yet' => '您还没有添加任何收藏', + 'select_all' => '全选', + 'click_play' => '点击播放', + 'click_view' => '点击查看', + 'delete_feed' => '删除动态', + 'join_immediately' => '马上参与', + 'just_look_dynamic' => '只看此类动态', + 'menu' => '菜单', + 'other_participants' => '其他参与者', + 'shield_feed' => '屏蔽动态', + 'add_blacklist' => '添加黑名单用户', + 'all_friend_list' => '全部好友列表', + 'blacklist_message' => '加入到黑名单的用户,将会从您的好友列表中删除。同时,对方将不能进行与您相关的打招呼、踩日志、加好友、评论、留言、短消息等互动行为 ', + 'cannot_find_friend' => '在游戏中找不到自己的好友?', + 'click_syn' => '请点击下面的的按钮,将好友信息同步到里面 ', + 'count_member' => '当前共有 $count 个好友', + 'delete_blacklist' => '黑名单除名', + 'edit_group_name' => '编辑用户组名', + 'expansion_friend' => '我要扩容', + 'expansion_friend_message' => '您可以购买道具“{$_G[\'setting\'][\'magics\'][\'friendnum\']}”来扩容,让自己可以添加更多的好友 ', + 'friend_editnote' => '备注', + 'friend_list' => '好友列表', + 'friend_message' => '按照好友热度排序', + 'friends' => '好友', + 'add_friends' => '添加好友', + 'add_follow' => '添加收听', + 'ignore_group_feed' => '屏蔽用户组动态', + 'interactive' => '互动', + 'manage' => '管理', + 'max_friend_num' => '最多可以添加 $maxfriendnum 个好友', + 'month' => '月', + 'my_blacklist' => '我的黑名单', + 'my_trace' => '我的足迹', + 'my_visitor' => '我的访客', + 'near_friend_visit' => '通过系统匹配,这些朋友就在您附近,您可能认识他们', + 'no_friend_list' => '没有相关用户列表', + 'online_friend' => '当前在线的好友', + 'online_friend_visit' => '这些好友当前在线,赶快去拜访一下吧', + 'online_member' => '在线成员', + 'online_near' => '就在我附近的朋友', + 'recommend_friend' => '推荐好友', + 'refresh_friend' => '刷新好友信息', + 'search_friend' => '查找好友', + 'set_friend_group' => '好友分组', + 'shield' => '屏蔽', + 'syn_friend' => '正在同步好友信息...', + 'trace_list' => '您曾经拜访过的用户列表', + 'username' => '用户名', + 'view_online_friend' => '显示当前全部在线的用户', + 'view_profile' => '查看资料', + 'visit_friend' => '去串个门', + 'visitor_list' => '他们拜访过您,回访一下吧', + 'volume_group' => '批量分组', + 'friend_request' => '好友请求', + 'people_might_know' => '可能认识的人', + 'copy' => '复制', + 'copy_space_address' => '空间地址复制成功', + 'dress_space' => '装扮空间', + 'message_banned' => '提示: 作者被禁止或删除 内容自动屏蔽,只有管理员可见', + 'my_space' => '我的空间', + 'return_homepage' => '返回首页', + 'somebody_space' => '的个人空间', + 'visit_my_space' => '访问我的空间', + 'feed' => '动态', + 'main_page' => '空间首页', + 'message_board' => '留言板', + 'depending_your' => '根据您的', + 'filter_settings' => '筛选设置', + 'fix_profile' => '点此完善', + 'following_feed_shielding' => '以下是被屏蔽的动态', + 'friend_feed' => '好友的动态', + 'friends_birthday_reminder' => '好友生日提醒', + 'friends_recommended' => '好友推荐', + 'gettable' => '可以获得', + 'home_show_members' => '竞价排名', + 'hot_feed' => '热点动态', + 'invite_code' => '邀请码', + 'level' => '等级', + 'magic' => '道具', + 'magic_empty' => '此道具缺货', + 'magics_operation_buy' => '购买', + 'magics_operation_present' => '赠送', + 'magics_price' => '售价', + 'magics_title' => '道具', + 'magics_unit' => '张', + 'medals' => '勋章', + 'memcp_avatar' => '修改头像', + 'my_feed' => '我的动态', + 'my_friends' => '我的好友', + 'new_join_members' => '新加入会员', + 'newest_feed' => '最新动态', + 'no_feed' => '还没有相关动态', + 'no_app_feed' => '还没有相关应用动态,添加好友能为您的在玩游戏时带来更多的互动', + 'open' => '展开', + 'own' => '我在玩的', + 'profile_completed' => '您的资料已完成', + 'recent_recommended_hot' => '近期热点推荐', + 'recent_visit' => '最近来访', + 'shield_feed_message' => '有 $filtercount 条动态被屏蔽', + 'space_home_message' => '您好,$_G[\'username\'],欢迎加入我们。有新任务等着您,挺简单的,赶快来参加吧', + 'step_up' => '可以提升', + 'task' => '任务', + 'they_feed' => 'TA 的近期动态', + 'today' => '今天', + 'unit' => '个', + 'usergroup' => '用户组', + 'view_app_feed' => '应用动态', + 'view_more_hot' => '查看更多热点', + 'view_my_space' => '访问我的空间', + 'visit_per_man' => '人次访问', + 'what_everybody_playing' => '大家在玩什么', + 'what_friend_playing' => '好友在玩什么', + 'yesterday' => '昨天', + 'credit_num' => '积分数', + 'no_members_of' => '没有相关成员', + 'profile_certified' => '已认证', + 'magics_log' => '道具记录', + 'magics_shop' => '道具商店', + 'magics_tips' => '道具系统已关闭,仅管理员可以正常使用', + 'magics_user' => '我的道具', + 'data_nonexistence' => '暂无数据', + 'magics_amount_buy' => '购买数量', + 'magics_amount_present' => '赠送数量', + 'magics_amount_receive' => '获赠数量', + 'magics_dateline_buy' => '购买时间', + 'magics_dateline_present' => '赠送时间', + 'magics_dateline_receive' => '获赠时间', + 'magics_dateline_use' => '使用时间', + 'magics_log_buy' => '购买记录', + 'magics_log_present' => '赠送记录', + 'magics_log_receive' => '获赠记录', + 'magics_log_use' => '使用记录', + 'magics_name' => '名称', + 'magics_operation_drop' => '丢弃', + 'magics_operation_sell' => '出售', + 'magics_price_buy' => '购买价格', + 'magics_target' => '查看对象', + 'magics_target_present' => '赠送给', + 'magics_target_receive' => '赠送人', + 'magics_target_use' => '使用对象', + 'magics_capacity' => '我的道具包容量', + 'magics_num' => '数量', + 'magics_operation_use' => '使用', + 'magics_user_totalnum' => '总重量', + 'magics_confirm' => '确认该操作', + 'magics_outofperoid_1' => '今天', + 'magics_outofperoid_2' => '本周', + 'magics_outofperoid_3' => '本月', + 'magics_outofperoid_4' => '24 小时内', + 'magics_outofperoid_noperm' => '您无法再使用本道具了', + 'magics_outofperoid_value' => '您还能使用 $useperoid 次本道具', + 'magics_present_message' => '赠送留言', + 'magics_present_message_text' => '送您一个{$magic[\'name\']},{$magic[\'description\']},希望您能喜欢 ', + 'magics_select' => '选择道具', + 'magics_weight' => '重量', + 'recycling_prices' => '回收价', + 'buy_credits' => '充值', + 'credit_exchange' => '积分兑换', + 'default' => '默认', + 'magics_discount' => '可享受 {$_G[\'group\'][\'magicsdiscount\']} 折优惠', + 'sold' => '已售出', + 'top' => '热门', + 'you_have_now' => '目前有', + 'magics_discountprice' => '折扣价', + 'magics_permission_no' => '您无权使用此道具', + 'magics_yourcredit' => '我目前有{$_G[\'setting\'][\'extcredits\'][$magic[\'credit\']][\'title\']}', + 'memcp_usergroups_buy' => '购买', + 'my_magic_volume' => '我的道具包可用容量', + 'stock' => '库存', + 'days' => '天', + 'expire' => '有效期', + 'medals_apply' => '申请', + 'medals_center' => '勋章中心', + 'medals_draw' => '领取', + 'medals_list' => '勋章', + 'medals_message1' => '在', + 'medals_message2' => '获得', + 'medals_message3' => '我在', + 'medals_message4' => '申请了', + 'medals_message5' => '被授予了', + 'medals_noavailable' => '没有可用的勋章', + 'medals_noexpire' => '永久有效', + 'medals_nonexistence' => '您已经获得所有勋章了,恭喜您!', + 'medals_nonexistence_own' => '您还没有获得过勋章', + 'medals_operation_2' => '等待审核', + 'medals_operation_3' => '未通过审核', + 'medals_record' => '勋章记录', + 'medals_type_0' => '人工授予', + 'medals_type_1' => '自主申请', + 'medals_type_2' => '人工审核', + 'my_medals' => '我的勋章', + 'space_medal_applied' => '已申请', + 'space_medal_buy' => '购买', + 'space_medal_have' => '已拥有', + 'space_medal_purchased' => '已购买', + 'space_medal_receive' => '已领取', + 'space_medal_apply' => '申请勋章', + 'content_manage' => '内容管理', + 'content_isnull' => '抱歉,您尚未输入必须的内容', + 'manage_album' => '管理相册', + 'manage_blog' => '管理日志', + 'manage_comment' => '管理评论', + 'manage_doing' => '管理记录', + 'manage_feed' => '管理动态', + 'manage_group_prune' => '圈子文章', + 'manage_group_threads' => '圈子主题', + 'manage_share' => '管理分享', + 'member_manage' => '用户管理', + 'message' => '留言板', + 'space_menu_send_pm' => '发短消息', + 'all_applications_news' => '全部应用消息', + 'applications_news' => '应用消息', + 'ignore_invitations_application' => '忽略该应用的所有邀请', + 'ignore_same_notice_message' => '还有 $value[\'from_num\'] 个相同通知被忽略', + 'is_guide_you_in' => '正在引导您进入……', + 'new_notice' => '未读提醒', + 'no_new_notice' => '暂时没有新提醒,', + 'no_notice' => '暂时没有提醒内容', + 'no_request_applications_invite' => '没有新的应用请求或邀请', + 'notice' => '提醒', + 'notice_warning_message' => '当您感觉有些通知对您造成骚扰时,请点击右侧小图标进行屏蔽', + 'notice_you_have' => '您有', + 'old_notice' => '已读提醒', + 'prompt' => '通知', + 'request' => '请求', + 'successfully_ignored_information' => '成功忽略了该条应用消息', + 'view_old_notice' => '点此查看已读提醒', + 'announce_pm' => '公共消息', + 'appendchatpmmember' => '加入新的成员', + 'appendchatpmmember_comment' => '加入新的成员', + 'change_old_pm' => '标记已读', + 'delete_chatpm' => '删除群聊', + 'delete_chatpm_comment' => '删除该群聊话题', + 'delete_privatepm_user' => '删除与该用户的所有私人消息', + 'dots' => '……', + 'ignore_list' => '忽略列表', + 'ignore_member_pm_message' => '

          添加到该列表中的用户给您发送短消息时将不予接收

          +

          添加多个忽略人员名单时用逗号 "," 隔开,如“张三,李四,王五”

          +

          如需禁止所有用户发来的短消息,请设置为 "{ALL}"

          ', + 'just_now' => '刚刚', + 'kickmember' => '踢出', + 'kickmemberwho' => '将 $value[\'username\'] 从该群聊中踢出', + 'new_pm' => '有未读消息', + 'news' => '消息', + 'next_refresh' => '秒后刷新', + 'no' => '否', + 'no_corresponding_pm' => '当前没有相应的短消息', + 'pm' => '短消息', + 'pm_delete_all' => '全部删除', + 'pm_export' => '导出', + 'pm_group_admin' => '管理成员', + 'pm_group_index' => '群聊首页', + 'pm_group_member_list' => '成员列表', + 'pm_group_record' => '群聊记录', + 'pm_members_message' => '人话题', + 'pm_num' => '共 $value[\'pmnum\'] 条', + 'pm_onlyacceptfriendpm' => '只接收好友的短消息', + 'pm_setting' => '短消息设置', + 'pm_totail' => '共有 $count 条与 $tousername 的交谈记录  ', + 'pmignore' => '忽略', + 'private_pm' => '私人消息', + 'quit_chatpm' => '退出群聊', + 'quit_chatpm_comment' => '退出该群聊话题', + 'refresh' => '刷新', + 'say' => '说', + 'select_friend' => '选择好友', + 'selectfromfriendlist' => '从好友列表中选择', + 'send' => '发送', + 'sendmultipmsystem' => '这是由系统发送的多人消息', + 'sendmultipmwho' => '这是由 $grouppm[\'author\'] 发送的多人消息', + 'sendpm_tip' => '多个用户使用逗号、分号或回车提示系统分开', + 'view_newpm' => '点击这里查看 $newpmcount 条未读消息', + 'view_privatepm' => '查看全部私人消息', + 'yes' => '是', + 'you_to' => '对', + 'pmreport' => '举报', + 'create_new_poll' => '发起新投票', + 'friend_poll' => '好友发起的投票', + 'hide_poll' => '本页有 $hiddennum 个投票因隐私问题而隐藏', + 'my_create' => '我发起的', + 'my_join' => '我参与的', + 'my_poll' => '我的投票', + 'newest_poll' => '最新投票', + 'no_poll' => '还没有相关的投票', + 'people_join' => '人参与', + 'they_poll' => 'TA 的所有投票', + 'to_poll' => '去投票', + 'top_poll' => '热门投票', + 'active_profile' => '活跃概况', + 'albums_num' => '相册数', + 'become_friend_message' => '请加入到我的好友中,您就可以了解我的近况,与我一起交流,随时与我保持联系 ', + 'blogs_num' => '日志数', + 'buyer_credit' => '买家信用', + 'digest_num' => '精华数', + 'doings_num' => '记录数', + 'friends_num' => '好友数', + 'group_expiry_type_ext' => '扩展用户组', + 'last_activity_time' => '上次活动时间', + 'last_post_time' => '上次发表时间', + 'last_send_email' => '上次邮件通知', + 'last_visit' => '最后访问', + 'last_visit_ip' => '上次访问 IP', + 'manage_forums' => '管理以下版块', + 'manage_member' => '管理用户', + 'management_team' => '管理组', + 'privacy_prompt' => '隐私提醒', + 'profile_verify' => '用户认证', + 'register_ip' => '注册 IP', + 'seller_credit' => '卖家信用', + 'set_privacy' => '抱歉!由于 {$space[\'username\']} 的隐私设置,您不能访问当前内容 ', + 'shares_num' => '分享数', + 'space_visits' => '空间访问量', + 'time_offset' => '所在时区', + 'timezone' => ' + \'9999\' => \'使用系统默认\', + \'-12\' => \'(GMT -12:00) 埃尼威托克岛, 夸贾林环礁\', + \'-11\' => \'(GMT -11:00) 中途岛, 萨摩亚群岛\', + \'-10\' => \'(GMT -10:00) 夏威夷\', + \'-9\' => \'(GMT -09:00) 阿拉斯加\', + \'-8\' => \'(GMT -08:00) 太平洋时间(美国和加拿大), 提华纳\', + \'-7\' => \'(GMT -07:00) 山区时间(美国和加拿大), 亚利桑那\', + \'-6\' => \'(GMT -06:00) 中部时间(美国和加拿大), 墨西哥城\', + \'-5\' => \'(GMT -05:00) 东部时间(美国和加拿大), 波哥大, 利马, 基多\', + \'-4\' => \'(GMT -04:00) 大西洋时间(加拿大), 加拉加斯, 拉巴斯\', + \'-3.5\' => \'(GMT -03:30) 纽芬兰\', + \'-3\' => \'(GMT -03:00) 巴西利亚, 布宜诺斯艾利斯, 乔治敦, 福克兰群岛\', + \'-2\' => \'(GMT -02:00) 中大西洋, 阿森松群岛, 圣赫勒拿岛\', + \'-1\' => \'(GMT -01:00) 亚速群岛, 佛得角群岛 [格林尼治标准时间] 都柏林, 伦敦, 里斯本, 卡萨布兰卡\', + \'0\' => \'(GMT) 卡萨布兰卡,都柏林,爱丁堡,伦敦,里斯本,蒙罗维亚\', + \'1\' => \'(GMT +01:00) 柏林, 布鲁塞尔, 哥本哈根, 马德里, 巴黎, 罗马\', + \'2\' => \'(GMT +02:00) 赫尔辛基, 加里宁格勒, 南非, 华沙\', + \'3\' => \'(GMT +03:00) 巴格达, 利雅得, 莫斯科, 奈洛比\', + \'3.5\' => \'(GMT +03:30) 德黑兰\', + \'4\' => \'(GMT +04:00) 阿布扎比, 巴库, 马斯喀特, 特比利斯\', + \'4.5\' => \'(GMT +04:30) 坎布尔\', + \'5\' => \'(GMT +05:00) 叶卡特琳堡, 伊斯兰堡, 卡拉奇, 塔什干\', + \'5.5\' => \'(GMT +05:30) 孟买, 加尔各答, 马德拉斯, 新德里\', + \'5.75\' => \'(GMT +05:45) 加德满都\', + \'6\' => \'(GMT +06:00) 阿拉木图, 科伦坡, 达卡, 新西伯利亚\', + \'6.5\' => \'(GMT +06:30) 仰光\', + \'7\' => \'(GMT +07:00) 曼谷, 河内, 雅加达\', + \'8\' => \'(GMT +08:00) 北京, 香港, 帕斯, 新加坡, 台北\', + \'9\' => \'(GMT +09:00) 大阪, 札幌, 首尔, 东京, 雅库茨克\', + \'9.5\' => \'(GMT +09:30) 阿德莱德, 达尔文\', + \'10\' => \'(GMT +10:00) 堪培拉, 关岛, 墨尔本, 悉尼, 海参崴\', + \'11\' => \'(GMT +11:00) 马加丹, 新喀里多尼亚, 所罗门群岛\', + \'12\' => \'(GMT +12:00) 奥克兰, 惠灵顿, 斐济, 马绍尔群岛\'', + 'used_space' => '已用空间', + 'view_friend_list' => '查看好友列表', + 'crime_action' => '操作行为', + 'crime_avatar' => '清除头像', + 'crime_banpost' => '屏蔽文章', + 'crime_banspeak' => '禁止发言', + 'crime_banstatus' => '锁定用户', + 'crime_banvisit' => '禁止访问', + 'crime_customstatus' => '清除自定义头衔', + 'crime_dateline' => '操作时间', + 'crime_delpost' => '删除文章', + 'crime_operator' => '操作者', + 'crime_reason' => '操作理由', + 'crime_record' => '违规记录', + 'crime_sightml' => '清除签名', + 'crime_warnpost' => '警告文章', + 'email_status' => '邮箱状态', + 'group_useful_life' => '有效期至', + 'hours' => '小时', + 'joined_group' => '已加入圈子', + 'online_time' => '在线时间', + 'permission_basic_status' => '自定义头衔', + 'personal_signature' => '个人签名', + 'profile_no_certified' => '未认证', + 'profile_no_verified' => '未验证', + 'profile_verified' => '已验证', + 'replay_num' => '回帖数', + 'second_domain' => '二级域名', + 'spacenote' => '最新记录', + 'stat_info' => '统计信息', + 'view_certification_photos' => '查看认证照片', + 'friend_reward' => '好友发布的悬赏', + 'has_been_resolved' => '已解决', + 'hide_reward' => '本页有 $hiddennum 个悬赏因隐私问题而隐藏', + 'i_answer' => '我来回答', + 'my_reward' => '我的悬赏', + 'newest_reward' => '最新悬赏', + 'no_reward' => '还没有相关的悬赏', + 'not_yet' => '暂无', + 'publish_new_reward' => '发布新悬赏', + 'security_answer' => '回答', + 'they_reward' => 'TA 的所有悬赏', + 'top_reward' => '热门悬赏', + 'unresolved' => '未解决', + 'description' => '描述', + 'help' => '帮助', + 'how_to_share_tips' => '如何分享视频?
          填写视频所在网页的网址。(不需要填写视频的真实地址)
          我们支持的视频网站有:
          Youtube、优酷、酷6、Mofile、偶偶视频、56、新浪视频、搜狐视频等常见视频网站。

          如何分享音乐?
          填写音乐文件的地址。(后缀支持aac、flac、mp3、m4a、wav、ogg)', + 'share_description' => '分享说明', + 'share_web_music_flash' => '分享网址、视频、音乐', + 'sharemetoo' => '我也分享', + 'friend_share' => '好友的分享', + 'hide_share' => '本页有 $pricount 条分享因未通过审核而隐藏', + 'my_share' => '我的分享', + 'not_share_yet' => '现在还没分享', + 'order_by_type' => '按类型查看', + 'share_album' => '相册', + 'share_all' => '全部', + 'share_article' => '文章', + 'share_blog' => '日志', + 'share_flash' => 'Flash', + 'share_link' => '网址', + 'share_music' => '音乐', + 'share_pic' => '图片', + 'share_poll' => '投票', + 'share_space' => '用户', + 'share_thread' => '文章', + 'share_video' => '视频', + 'somebody_share' => '的分享', + 'they_share' => 'TA 的所有分享', + 'doing_sync' => '同步', + 'no_update_record' => '您还没有更新过心情记录', + 'view_all_my_doings' => '查看我的所有记录', + 'task_done' => '已完成的任务', + 'task_failed' => '失败的任务', + 'task_new' => '新任务', + 'nothing' => '无', + 'task_admins' => '管理人员', + 'task_applicants' => '已有 {$task[\'applicants\']} 位会员参与此任务', + 'task_applies_full' => '人数已满', + 'task_apply_condition' => '申请此任务所需条件', + 'task_applyagain' => ' 后可以再次申请', + 'task_applyagain_now' => '现在可以再次申请', + 'task_complete' => '已完成', + 'task_complete_condition' => '完成此任务所需条件', + 'task_complete_on' => '完成于', + 'task_detail' => '任务详情', + 'task_endtime' => '当前任务下线时间为 {$task[\'endtime\']},过期后您将不能申请此任务', + 'task_general_users' => '普通会员', + 'task_group_nopermission' => '您所在的用户组无法申请此任务', + 'task_lose_on' => '失败于', + 'task_newbie_apply' => '立即申请', + 'task_numlimit' => '人次上限', + 'task_period_day' => '每 {$task[\'period\']} 天允许申请一次', + 'task_period_hour' => '每隔 {$task[\'period\']} 小时允许申请一次', + 'task_period_month' => '每月 {$task[\'period\']} 日允许申请一次', + 'task_period_week' => '每周 $periodweek 允许申请一次', + 'task_quit' => '放弃任务', + 'task_reapply' => '后可以重新申请', + 'task_reapply_now' => '现在可以重新申请', + 'task_relatedtask' => '必须完成指定任务', + 'task_exclusivetask' => '必须未领取指定任务', + 'task_reward' => '奖励', + 'task_reward_get' => '领取奖励', + 'unlimited' => '不限', + 'task_applies' => '人气', + 'task_nodoing' => '暂无进行中的任务,请到新任务中申请 ', + 'task_nonew' => '暂无新任务,周期性任务完成后可以再次申请,敬请关注 ', + 'task_require' => '要求', + 'member_viewpro' => '查看详细资料', + 'author' => '作者', + 'del_select_thread' => '删除选中主题', + 'del_select_thread_confirm' => '确定要删除选中的主题吗?', + 'forum' => '版块', + 'friend_post' => '好友的文章', + 'group' => '圈子', + 'hide_thread' => '本页有 $hiddennum 篇文章因隐私问题而隐藏', + 'ignored' => '已忽略', + 'last_post' => '最后发帖', + 'my_post' => '我的文章', + 'newest_thread' => '最新文章', + 'no_related_posts' => '还没有相关的文章', + 'post_comment' => '点评', + 'posted' => '发帖', + 'replies' => '回复/查看', + 'they_thread' => 'TA 的所有文章', + 'top_thread' => '热门文章', + 'additional' => '附加', + 'buy_trade' => '买家交易', + 'create_new_trade' => '发起新交易', + 'eccredit1' => '评价', + 'eccredit_post_already' => '对方已评', + 'eccredit_post_between' => '双方已评', + 'eccredit_post_waiting' => '等待对方评价', + 'friend_trade' => '好友出售的商品', + 'hide_trade' => '本页有 $hiddennum 个商品因待审核而隐藏', + 'hot_trade' => '热门商品', + 'my_trade' => '我的商品', + 'newest_trade' => '最新商品', + 'no_trade' => '还没有相关的商品', + 'post_trade_sticklist' => '推荐商品', + 'sale_of_goods' => '出售的商品', + 'sell_trade' => '卖家交易', + 'they_credit_rating' => 'TA 的信用评价', + 'they_trade' => 'TA 的所有商品', + 'trade_all' => '全部交易', + 'trade_amount' => '交易金额', + 'trade_attention' => '关注的', + 'trade_buyer' => '买家', + 'trade_closed' => '失败的', + 'trade_closing' => '交易结束', + 'trade_eccredit' => '评价过的', + 'trade_goods_name' => '商品名称', + 'trade_log' => '交易记录', + 'trade_rate' => '信用评价', + 'trade_refund' => '退款的', + 'trade_seller' => '卖家', + 'trade_success' => '成功的', + 'trade_trading' => '进行中的', + 'trade_units' => '元', + 'trade_unstart' => '未生效的', + 'follow_view_feed' => '查看广播', + 'click_view_message' => '点击此处查看全部留言', + 'leave_comments' => '留言', + 'login_to_wall' => '您需要登录后才可以留言', + 'view_one_operation_message' => '当前只显示与您操作相关的单个留言', + 'adjust_hot' => '调整热度', + 'album_cover_notice' => '提示:您可以指定一张图片作为当前相册的封面图片,但是,在下次上传新的图片后,系统会自动选择一张新图片来更新本相册的封面图片 ', + 'album_depict' => '相册描述', + 'back_album_list' => '返回相册列表', + 'choices_following_friends_list' => '多次选择会累加到下面的好友名单', + 'completely_remove' => '彻底删除', + 'cover_pic' => '封面图片', + 'delete_album' => '删除相册', + 'delete_album_message' => '确定删除相册吗?', + 'delete_pic_notice' => '删除图片提示:如果您要删除的图片出现在您的文章、日志、话题中,删除后,会导致内容里面的图片同时无法显示 ', + 'determine' => '确定', + 'edit_album' => '编辑相册', + 'edit_album_information' => '编辑相册信息', + 'edit_pic' => '编辑图片', + 'friend_name_space' => '可以填写多个好友名,请用空格进行分割', + 'friendname_0' => '全站用户可见', + 'from_friends_group' => '从好友组选择好友', + 'move_to' => '转移到', + 'move_to_default_album' => '转移到 默认相册', + 'new_hot' => '新的热度', + 'password' => '密码', + 'privacy_settings' => '隐私设置', + 'select_site_album_categories' => '选择一个站点分类,可以让您的相册被更多的人浏览到', + 'set_to_conver' => '设为封面', + 'site_categories' => '站点分类', + 'specified_friends' => '指定好友', + 'the_album_pic' => '该相册中的图片', + 'update_explain' => '更新说明', + 'view_album' => '查看相册', + 'current_my_space' => '当前我的头像', + 'previous_page' => '返回上一页', + 'setting_avatar_message' => '如果您还没有设置自己的头像,系统会显示为默认头像,您需要自己上传一张新照片来作为自己的个人头像 ', + 'setting_my_new_avatar' => '设置我的新头像', + 'setting_my_new_avatar_message' => '请选择一个新照片进行上传编辑。
          头像保存后,您可能需要刷新一下本页面(按F5键),才能查看最新的头像效果 ', + 'setting_my_new_avatar_old' => '如无法正常上传头像,请点此处切换为 Flash 方式上传', + 'auto_keyword' => '自动获取', + 'cancel_stick_blog' => '取消置顶日志', + 'change_default_settings' => '更改默认配置', + 'comments_not_allowed' => '不允许评论', + 'create_category' => '创建分类', + 'create_new_categories' => '新建分类', + 'delete_blog' => '删除日志', + 'edit_blog' => '编辑日志', + 'feed_option' => '动态选项', + 'label' => '标签', + 'make_feed' => '发送动态', + 'memcp_blog' => '发表日志', + 'name' => '名称', + 'no_feed_notice' => '友情提醒:您确定此次发布不发送动态吗?\\n有了动态,好友才能及时看到您的更新 ', + 'save_publish' => '保存发布', + 'select_site_blog_categories' => '选择一个站点分类,可以让您的日志被更多的人浏览到', + 'select_system_cat' => '请选择系统分类', + 'stick_blog' => '置顶日志', + 'sure_cancel_stick_blog' => '确定要取消置顶指定的日志吗?', + 'sure_delete_blog' => '确定删除指定的日志吗?', + 'sure_stick_blog' => '确定置顶指定的日志吗?', + 'delete_category' => '删除分类', + 'delete_category_message' => '确定删除指定的分类吗?', + 'modify_category' => '修改分类', + 'new_category_name' => '新分类名', + 'content' => '内容', + 'delete_reply' => '删除回复', + 'delete_reply_message' => '确定删除指定的回复吗?', + 'edit_content' => '编辑内容', + 'bid_single_price' => '竞价单价', + 'modify_unitprice' => '修改竞价单价', + 'modify_unitprice_note' => '竞价单价决定您在竞价排行中的排名,单价越高,您的排名越靠前。站上会员访问一次您的个人主页将从您的竞价总额中扣除相应的竞价值 ', + 'no_view_notice_next' => '在下次浏览时不再显示此类通知', + 'shield_all_friend' => '屏蔽所有好友的', + 'shield_notice' => '屏蔽通知', + 'shield_this_friend' => '仅屏蔽该好友的', + 'credits_give' => '给', + 'memcp_credits_addfunds' => '充值', + 'memcp_credits_addfunds_msg' => '您将要充值$extcredits[$creditstrans][\'title\'] $_GET[\'addfundamount\'] $extcredits[$fromcredits][\'unit\'],所需人民币 $price 元
          请选择支付方式:', + 'memcp_credits_exchange' => '兑换', + 'memcp_credits_exchange_password' => '请输入您的登录密码确认', + 'memcp_credits_exchange_you_need' => '您要兑换 ', + 'memcp_credits_exchange_you_pay' => '需要付出 $_G[\'setting\'][\'extcredits\'][$fromcredits][\'title\'] $netamount $_G[\'setting\'][\'extcredits\'][$fromcredits][\'unit\']', + 'memcp_credits_password' => '请输入登录密码', + 'memcp_credits_transfer' => '转账', + 'memcp_credits_transfer_user' => '您要转账', + 'action_name' => '动作名称', + 'activity_award_message' => '进行以下事件动作,会得到积分奖励。不过,在一个周期内,您最多得到的奖励次数有限制 ', + 'card' => '充值卡', + 'card_credit' => '充值卡充值', + 'card_use' => '立即充值', + 'changedateline' => '变更时间', + 'credits_need' => '所需', + 'credits_tax' => '积分交易税', + 'credits_transfer_message' => '转账留言', + 'cycle_range' => '周期范围', + 'detail' => '详情', + 'everyday' => '每天', + 'interval_minutes' => '间隔分钟', + 'logs_credit' => '积分变更', + 'max_award_per_week' => '周期内最多奖励次数', + 'memcp_credits_addfunds_caculate_radio' => '人民币 0 元', + 'memcp_credits_addfunds_rules_max' => '单次最高充值', + 'memcp_credits_addfunds_rules_min' => '单次最低充值', + 'memcp_credits_addfunds_rules_month' => '最近 30 天最高充值', + 'memcp_credits_addfunds_rules_ratio' => '人民币现金 1 元', + 'memcp_credits_exchange_min_balance' => '兑换后最低余额', + 'memcp_credits_log' => '积分记录', + 'memcp_credits_log_none' => '目前没有积分交易记录', + 'memcp_credits_log_transaction' => '转账与兑换', + 'memcp_credits_transfer_min_balance' => '转账后最低余额', + 'mode_of_payment' => '支付方式', + 'one_time' => '一次性', + 'open_cycle' => '不限周期', + 'operation' => '操作', + 'the_time' => '整点', + 'transfer_login_password' => '登录密码', + 'unlimited_time' => '不限次数', + 'viewmore' => '查看更多', + 'credit_rule' => '积分规则', + 'credit_rule_global' => '全局规则', + 'exchange_credits' => '兑换', + 'my_credits' => '我的积分', + 'transfer_credits' => '转账', + 'credit_change' => '积分变更', + 'credit_income' => '收支', + 'credit_income_0' => '不限', + 'credit_income_1' => '收入', + 'credit_income_2' => '支出', + 'credit_log' => '积分收益', + 'credit_log_sys' => '系统奖励', + 'credit_to' => '至', + 'cycles_num' => '周期次数', + 'get_credit_histroy' => '积分获得历史', + 'last_award_time' => '最后奖励时间', + 'memcp_credits_log_payment' => '主题付费', + 'srch' => '查询', + 'starttime_endtime' => '时间范围', + 'total_time' => '总次数', + 'delete_log' => '删除记录', + 'determine_delete_doing' => '确定删除该记录吗?', + 'spacecp_doing_message1' => '还可输入', + 'spacecp_doing_message2' => '个字符', + 'edit_domain' => '修改域名', + 'edit_domain_message' => '修改域名将需要支付积分 $consume ,您现在有拥有 $credits', + 'space_domain_message' => '域名可使用最少 $domainlength 个 ,最多 30 个的字母或数字组合,且必须字母开头 ', + 'eccredit_needexplanation' => '我要解释', + 'eccredit_content' => '评价内容', + 'eccredit_explanation' => '解释', + 'eccredit_explanationexpiration' => '您可以在 $comment[\'expiration\'] 之前作出解释', + 'eccredit_goodsname_seller' => '宝贝名称/评价人', + 'eccredit_list_all' => '收到的所有评价', + 'eccredit_list_buyer' => '来自买家的评价', + 'eccredit_list_other' => '给他人的评价', + 'eccredit_list_seller' => '来自卖家的评价', + 'eccredit_nofound' => '没有找到相关评价!', + 'eccredit_s' => '的', + 'eccredit_tradeprice' => '成交价', + 'from' => '来自', + 'eccredit' => '信用评价', + 'eccredit_bad_comment' => '(扣1分)', + 'eccredit_good_comment' => '(加1分)', + 'eccredit_post' => '发表评价', + 'eccredit_retee' => '被评价人', + 'eccredit_soso_comment' => '(不加分)', + 'eccredit_tradegoods' => '相关商品', + 'delete_favorite' => '取消收藏', + 'delete_favorite_message' => '您确定要删除此收藏吗?', + 'favorite_count' => '已有 $fav_count 人收藏', + 'favorite_description' => '收藏说明', + 'determine_delete_feed' => '确定删除该动态吗?', + 'next_visit_not_view_feed' => '在下次浏览时不再显示此类动态', + 'follow_add_note' => '顺便说两句', + 'follow_can_enter' => '还能输入', + 'follow_del_feed' => '删除广播', + 'follow_del_feed_confirm' => '确定删除指定的广播吗?', + 'follow_editnote' => '备注', + 'follow_word' => '字', + 'post_add_inonetime' => '同时回复', + 'memcp_credit' => '积分', + 'memcp_payment' => '订单', + 'memcp_privacy' => '隐私筛选', + 'memcp_promotion' => '访问推广', + 'memcp_sendmail' => '邮件提醒', + 'memcp_usergroup' => '用户组', + 'memcp_verify' => '认证', + 'password_security' => '密码安全', + 'add_friend_note' => '为好友,附言', + 'adjust_friend_hot' => '调整好友的热度', + 'approval' => '批准', + 'approval_the_request' => '批准请求', + 'approval_the_request_group' => '批准 {$tospace[\'username\']} 的好友请求,并分组', + 'common_friends' => '共同好友', + 'confirm_all_applications' => '批准全部申请', + 'confirm_applications' => '批准申请', + 'determine_ignore_all_friends_application' => '确定要忽略所有的好友申请吗?', + 'determine_lgnore_friend' => '确定忽略好友关系吗?', + 'find_know_nofound' => '暂时没有可能认识的人', + 'friend_friend_might_know' => '他们是您的好友的好友,您也可能认识', + 'friend_group' => '分组', + 'friend_group_hot_message' => '对选定的好友进行分组,热度表示的是您跟好友互动的次数 ', + 'friend_hot' => '好友热度', + 'friend_note' => '好友备注', + 'friend_note_message' => '为当前好友填写一句话备注,便于自己识别', + 'friends_group' => '好友组', + 'ignore' => '忽略', + 'ignore_all_friends_application' => '忽略所有好友申请(慎用)', + 'lgnore_friend' => '忽略好友', + 'max_view_15_friends' => '当前最多显示 15 位共同的好友', + 'new_name' => '新名称', + 'no_new_friend_application' => '没有新的好友请求', + 'not_show_feed_homepage' => '在首页不显示该用户组的好友动态', + 'num_0_999' => '0~9999之间的一个数字', + 'recommend_user' => '站长推荐用户', + 'search_member_result' => '搜索用户结果', + 'select_friend_application_do' => '请选定好友的申请进行批准或忽略', + 'set_friend_group_name' => '设置新好友分组名', + 'set_member_feed' => '调整用户组动态', + 'set_member_group' => '设置用户组', + 'show_feed_homepage' => '在首页显示该用户组的好友动态', + 'surprise_they_near' => '惊喜,他们就在您的附近 ', + 'they_online_add_friend' => '他们当前正在线,加为好友就可以互动啦 ', + 'view_note_message' => '附言为可选,{$tospace[\'username\']} 会看到这条附言,最多 10 个字 ', + 'you_have_common_friends' => '你们目前有 {eval echo count($list)} 位共同的好友', + 'you_have_no_common_friends' => '你们目前还没有共同的好友', + 'your_common_friends' => '查看你们的共同好友', + 'add_music' => '添加音乐', + 'album_cover_documents_address' => '唱片集封面和文件地址', + 'auto_run' => '自动', + 'avatarsize' => '头像大小', + 'background' => '背景', + 'background_color' => '背景颜色', + 'background_rolling' => '背景滚动', + 'big' => '大', + 'cancel_bg_pic' => '取消背景图', + 'complete' => '完整', + 'content_area' => '内容区', + 'default_cover_color' => '封面背景', + 'current_playlist' => '当前播放列表', + 'custom_content' => '自定义内容', + 'delete_all' => '全选删除', + 'directly_use' => '直接使用', + 'display_mode' => '显示模式', + 'editing' => '正在编辑', + 'editing_module' => '编辑模块', + 'editing_nv' => '编辑导航菜单名称', + 'empty_name_message' => '为空则自动生成名字', + 'fixed' => '固定', + 'front_cover' => '封面', + 'header' => '头部', + 'horizontal_repeat' => '横向平铺', + 'increase' => '增加', + 'is_first_one' => '已是第一个', + 'is_last_one' => '已到最后一个', + 'link_color' => '链接颜色', + 'manual_run' => '手动', + 'middle' => '中', + 'mp3_address' => 'mp3地址', + 'mp3_warning_message' => '注意:仅支持浏览器可直接播放的音频格式添加', + 'musicbox_height' => '高度', + 'musicbox_height_message' => '设置音乐盒的高度', + 'my_space_describe' => '我的空间描述', + 'my_space_name' => '我的空间名称', + 'no_music_play_list' => '暂无音乐播放列表', + 'not_delete_last_line' => '最后一行不允许删除', + 'not_play_message' => '无法播放时请检查该地址文件是否存在以及文件格式是否满足要求', + 'nvhidden' => '隐藏', + 'nvshow' => '显示', + 'photo_location' => '图片位置', + 'pic_repeat' => '图片平铺', + 'play_mode' => '播放模式', + 'player_profile' => '播放器配置', + 'recover_style' => '恢复原装皮肤', + 'repeat_mode' => '平铺', + 'replace' => '更换', + 'rolling' => '滚动', + 'save_js_code_view' => 'javascript 脚本保存后显示', + 'show_message' => '摘要长度', + 'show_message_tips' => '单位字节,0 将不显示摘要', + 'show_num_of' => '显示条数', + 'showcountcontent' => '显示统计内容', + 'shuffle_list_1' => '随机顺序', + 'shuffle_list_2' => '列表顺序', + 'small' => '小', + 'space_block_title' => '模块名称', + 'space_nv_hidden' => '隐藏导航', + 'space_views' => '空间查看数', + 'start_mode' => '开始模式', + 'text_color' => '文字颜色', + 'title_bar' => '标题栏', + 'track_name' => '曲目名', + 'update_album_list' => '更新当前音乐列表', + 'upload_new_pic' => '上传新图片', + 'upload_start' => '开始上传', + 'vertical_repeat' => '纵向平铺', + 'add_from_address_book' => '从地址簿添加', + 'click_link_become_friend' => '请您点击以下链接,接受好友邀请', + 'click_link_copy' => '点击下面的链接可直接复制 (邀请链接和邀请码作用相同,可随意选择其一。)', + 'copy_invite_code' => '邀请码复制成功', + 'copy_invite_link' => '邀请链接复制成功', + 'copy_invite_manage' => '批量邀请链接(修改密码重置)', + 'credit_recharge' => '积分充值', + 'delete_log_message' => '

          确定要删除该邀请记录吗?

          +

          删除该邀请记录后,您的好友将不能通过
          原邀请记录链接注册成为您的好友

          ', + 'friend_email_address' => '好友 Email 地址', + 'friend_get' => '好友可获得', + 'friend_invite_link' => '我的好友邀请链接', + 'friend_invite_message' => '您可以通过 QQ、MSN 等 IM 工具,或者发送邮件,把下面的链接告诉您的好友,邀请他们加入进来 ', + 'friend_invite_play' => '邀请我的好友一起玩', + 'friend_invite_success' => '邀请成功一个好友,', + 'friend_play_together' => '好友一起玩', + 'friend_to_say' => '想对好友说的话', + 'get_invitation_code' => '获取邀请码', + 'go_nuts' => '赶快行动吧!', + 'have_account_view_homepage' => '如果您拥有{$mailvar[\'sitename\']}上面的账号,请点击以下链接查看我的个人主页:', + 'hi_iam_invite_you' => 'Hi,我是{$mailvar[\'username\']},邀请您也加入 {$mailvar[\'sitename\']} 并成为我的好友', + 'i_play_invite_you' => 'Hi,我是{$mailvar[\'username\']},在{$mailvar[\'sitename\']}上玩{$appinfo[\'appname\']},邀请您也加入一起玩 ', + 'invitation_code_spend' => '每个邀请码需要花费:', + 'invite_add_note' => '邀请附言', + 'invite_link' => '邀请链接', + 'invited_friend' => '已成功邀请 {$invitedcount} 个好友', + 'link' => '链接', + 'max_invite_day_message' => '请输入要购买的邀请码数量。邀请码的有效期为 {$_G[\'group\'][\'maxinviteday\']} 天,过期自动失效', + 'no_invitation_code' => '还没有邀请码', + 'no_invite_friend_email' => '尚未邀请成功的好友邮件', + 'no_right_invite_friend' => '抱歉,您目前还没有权限来邀请好友 ', + 'preview_invitation' => '预览邀请函', + 'resend' => '重发', + 'send_invitation_email' => '给好友发送 Email 邀请', + 'send_invitation_email_message' => '通过 Email 发送邮件的方式,邀请您的好友。多个 Email 使用 "," 分割', + 'send_mail_again' => '重发邮件', + 'sure_resend' => '确定重新发送邀请邮件吗?', + 'you_get' => '您自己可获得', + 'you_have' => '您现在拥有', + 'cancel_effects_message' => '您确定要取消道具 $_G[\'setting\'][\'magics\'][\'flicker\'] 的效果吗?', + 'cancel_magics_effects' => '取消道具效果', + 'return_redbag' => '回收红包', + 'spacecp_magic_message1' => '您确定要回收红包吗?', + 'spacecp_magic_message2' => '剩余', + 'confirm_new_password' => '确认新密码', + 'login_username' => '登录用户名', + 'modify_password' => '修改密码', + 'modify_password_login' => '修改密码后,您需要重新登录一次 ', + 'my_login_password' => '我的登录密码', + 'new_password' => '新密码', + 'old_password' => '旧密码', + 'addressee' => '收件人', + 'back_mailbox' => '返回消息列表', + 'chat_type' => '群聊', + 'delete_pm' => '删除短消息', + 'determine_appendmember' => '确定把该用户加入群聊吗?', + 'determine_delete_chatpm' => '确定删除该群聊消息吗?', + 'determine_delete_gpmid' => '确定删除该公共短消息吗?', + 'determine_delete_pm' => '确定删除与该用户的所有私人短消息吗?', + 'determine_delete_pmid' => '确定删除该短消息吗?', + 'determine_ignore_pm' => '确定把该用户加入忽略列表吗?', + 'determine_kickmember' => '确定把该用户踢出群聊吗?', + 'determine_quit_chatpm' => '确定退出该群聊消息吗?', + 'determine_report_pm' => '确定举报该短消息吗?', + 'joiner' => '参与人', + 'offline' => '离线', + 'pm_appendmember' => '加入', + 'pm_ignore' => '忽略', + 'pm_kickmember' => '踢出', + 'pm_report' => '短消息举报', + 'quit' => '退出', + 'shield_the_user' => '确定屏蔽该用户吗?', + 'taking_with_user' => '正在与{$msguser}聊天中……', + 'title' => '标题', + 'view_with_sb_chat' => '查看与{$msguser}的聊天记录', + 'visit_sb_space' => '访问{$msguser}的空间', + 'back_to_say_hello' => '回打招呼', + 'determine_lgnore_poke' => '确定忽略招呼吗?', + 'ignore_all' => '全部忽略', + 'ignore_all_poke' => '忽略了全部的招呼', + 'lgnore_poke' => '忽略打招呼', + 'max_text_poke_message' => '内容为可选,并且会覆盖之前的招呼,最多 10 个字', + 'me' => '我', + 'no_new_poke' => '还没有新招呼', + 'poke' => '招呼', + 'poke_received' => '收到的招呼', + 'see_all_poke' => '查看所有招呼', + 'to' => '向', + 'you_can_reply_ignore' => '您可以回复招呼或者进行忽略', + 'poke_0' => '不用动作', + 'add_share' => '添加分享', + 'allow' => '允许 ', + 'ban' => '禁止', + 'bidding_rank' => '竞价排名', + 'blog_comment' => '日志评论', + 'blog_position' => '日志表态', + 'complete_task' => '完成任务', + 'credit_consumption' => '积分消费', + 'feed_filter' => '动态筛选', + 'filtering_rules_message_1' => '您可以决定屏蔽哪些用户组的动态,屏蔽用户组内的组员所发布的动态都将被屏蔽掉(仅限查看好友的动态时生效) ', + 'filtering_rules_message_2' => '点击一下首页好友动态列表后面的屏蔽标志,就可以屏蔽指定好友指定类型的动态了。
          下面列出的是您已经屏蔽的动态类型识别名和好友名,您可以选择是否取消屏蔽 ', + 'filtering_rules_message_3' => '点击一下通知列表后面的屏蔽标志,就可以屏蔽指定好友指定类型的通知了。
          下面列出的是您已经屏蔽的通知类型和好友名,您可以选择是否取消屏蔽 ', + 'filtering_rules_title_1' => '筛选规则一:屏蔽指定用户组的动态', + 'filtering_rules_title_2' => '筛选规则二:屏蔽指定好友指定类型的动态', + 'filtering_rules_title_3' => '筛选规则三:屏蔽指定好友指定类型的提醒', + 'forum_post' => '论坛发帖', + 'forum_reply' => '论坛回帖', + 'friend_add' => '添加好友', + 'friend_privacy' => '好友可见', + 'friend_top' => '排行榜', + 'list_change_friend_name' => '您可以在自己的好友列表中,对好友进行分组,并可以对用户组进行改名 ', + 'no_shield_feed_cat' => '现在还没有屏蔽的动态类型', + 'open_privacy' => '公开', + 'personal_feed' => '动态', + 'personal_feed_settings' => '个人动态发布设置', + 'personal_other_settings' => '平台用户间互动设置', + 'personal_main_page' => '个人主页', + 'personal_privacy_settings' => '个人隐私设置', + 'pic_blog_position' => '对日志/图片表态', + 'pic_comment' => '图片评论', + 'pic_position' => '图片表态', + 'privacy_register' => '仅注册用户可见', + 'privacy_setting_message' => '本隐私设置仅在其他用户查看您主页时有效', + 'publish_comment_reply' => '发表评论/留言', + 'secrecy' => '保密', + 'share_comment' => '分享评论', + 'share_notification' => '分享通知', + 'site_default_setting' => '站点默认设置', + 'site_might_your_log' => '在全站的记录列表中可能会出现您的记录', + 'system' => '系统', + 'system_depend_action_message' => '系统会将您的各项动作反映到个人动态里,方便朋友了解您的动态。
          您可以控制是否在下列动作发生时,在个人动态里发布相关信息 ', + 'theme' => '话题', + 'topic_comment' => '话题点评', + 'topic_reply' => '话题回复', + 'update_presonal_profile' => '更新个人资料', + 'view_my_certified_photo' => '查看认证照片', + 'view_right_setting_effective' => '相关浏览权限需要在发表时单独设置方可完全生效', + 'write_blog' => '撰写日志', + 'you_control_see_content' => '您可以完全控制哪些人可以看到您的主页上面的内容', + 'you_control_other_operation' => '您可以完全控制其他用户是否可以和您进行互动', + 'check_date_item' => '请检查该资料项', + 'current_time' => '当前时间', + 'email' => 'Email', + 'email_been_active' => '当前邮箱已经验证激活', + 'memcp_profile_email_comment' => '!如更改地址,系统将修改您的密码并重新验证其有效性,请慎用 ', + 'memcp_profile_passwd_comment' => '如不需要更改密码,此处请留空 ', + 'memcp_profile_secmobile_comment' => '国际电话区号不含加号,留空则默认为', + 'memcp_profile_secmobseccode_comment' => '在更改完绑定安全手机号收到验证码后,需要在这里输入验证码并点击页面下方的 "保存" 按钮', + 'memcp_profile_security_answer_comment' => '如您设置新的安全提问,请在此输入答案 ', + 'memcp_profile_security_comment' => '如果您启用安全提问,登录时需填入相应的项目才能登录 ', + 'memcp_profile_security_keep' => '保持原有的安全提问和答案', + 'modify' => '修改', + 'new_password_confirm' => '确认新密码', + 'old_password_comment' => '您必须填写原密码才能修改下面的资料', + 'preview' => '预览', + 'reminder' => '提示信息', + 'required' => '必填', + 'security_question' => '安全提问', + 'security_question_0' => '无安全提问', + 'security_question_1' => '母亲的名字', + 'security_question_2' => '爷爷的名字', + 'security_question_3' => '父亲出生的城市', + 'security_question_4' => '您其中一位老师的名字', + 'security_question_5' => '您个人计算机的型号', + 'security_question_6' => '您最喜欢的餐馆名称', + 'security_question_7' => '驾驶执照最后四位数字', + 'spacecp_profile_message1' => '以下信息通过审核后将不能再次修改,提交后请耐心等待核查 ', + 'spacecp_profile_message2' => '恭喜您,您的认证审核已经通过,下面的资料项已经不允许被修改 ', + 'time_zone' => '时区', + 'time_zone_message' => '如果发现当前显示的时间与您本地时间相差几个小时,那么您需要更改自己的时区设置 ', + 'update_date_success' => '资料更新成功', + 'validator_comment' => '管理员否决了您的注册申请,请完善注册原因,重新提交申请', + 'validator_message' => '注册原因', + 'validator_remark' => '否决原因', + 'validator_submit' => '重新提交申请', + 'space_domain' => '我的空间域名', + 'mode_one' => '方式一:', + 'mode_two' => '方式二:', + 'mode_two_desc' => '通过点击文章标题旁的“复制链接”,推广成功后也可以获得积分奖励   去推广文章»', + 'post_promotion' => '如果您的朋友通过下面任意一个链接访问站点并注册新会员,您将获得积分奖励 $regstr', + 'post_promotion_reg' => '如果您的朋友不但访问并且注册成为会员,您将再获得积分奖励 $regstr', + 'post_promotion_url' => '如果您的朋友通过下面任意一个链接访问站点,您将获得积分奖励 $visitstr', + 'post_promotion_url1' => '推广链接1', + 'post_promotion_url2' => '推广链接2', + 'promotion_url_copied' => '推广链接复制成功', + 'advance_seek' => '高级方式查找', + 'age_segment' => '年龄段', + 'birth_city' => '出生地', + 'birthday' => '生日', + 'change_search' => '换个搜索条件试试', + 'female' => '女', + 'male' => '男', + 'no_search_friend' => '没有找到相关用户', + 'random' => '任意', + 'reside_city' => '居住地', + 'search_accuracy' => '精确搜索', + 'search_member_list_message' => '以下是查找到的用户列表(最多显示 100 个),您还可以换个搜索条件试试', + 'seek' => '查找', + 'seek_bgfriend' => '查找男女朋友', + 'seek_classmate' => '查找您的同学', + 'seek_colleague' => '查找您的同事', + 'seek_same_birthday' => '查找同年同月同日生的人', + 'seek_same_city' => '查找同城的人', + 'seek_same_city_people' => '查找老乡', + 'sex' => '性别', + 'upload_avatar' => '上传头像', + 'uploaded_avatar' => '已经上传头像', + 'user_id' => '用户 UID', + 'year' => '年', + 'activate_mailbox_first' => '您首先需要激活您的邮箱', + 'activate_mailbox_message' => '填写您常用的邮箱,系统会给您的邮箱发送一封含有激活链接的邮件,把激活链接复制到浏览器进行访问就可以激活您的邮箱,然后您就能可以设置邮件提醒 ', + 'click_activate_mailbox' => '点这里发送验证激活邮件', + 'mail_blogcomment' => '我的日志被评论', + 'mail_clickblog' => '我的日志被表态', + 'mail_clickpic' => '我的图片被表态', + 'mail_doing' => '我的记录被评论', + 'mail_frequency' => '邮件发送频率', + 'mail_pcomment' => '我的主题被人点评', + 'mail_piccomment' => '我的相册被评论', + 'mail_post' => '我的主题被人回复', + 'mail_pusearticle' => '我的日志或文章被推送成文章', + 'mail_reward' => '悬赏主题回复被设为最佳答案', + 'mail_send_your_mail' => '提醒邮件会发送到您当前的邮箱', + 'mail_sharecomment' => '我分享的内容被评论', + 'mail_sharenotice' => '我的信息被分享', + 'mail_system_activity' => '活动状态变更', + 'mail_system_credit' => '积分相关', + 'mail_system_friend' => '添加好友请求被确认', + 'mail_system_goods' => '商品状态变更', + 'mail_system_group' => '圈子邀请', + 'mail_system_insys' => '系统提醒', + 'mail_system_magic' => '道具相关', + 'mail_system_mod_member' => '用户审核状态', + 'mail_system_pmreport' => '短消息举报', + 'mail_system_report' => '举报处理结果', + 'mail_system_show' => '竞价排名下榜', + 'mail_system_task' => '任务相关', + 'mail_system_verify' => '认证审核', + 'mail_wall' => '有人给我留言', + 'modify_email' => '修改邮箱地址', + 'modify_mailbox' => '修改邮箱', + 'reminder_mail_message_1' => '系统会在您超过', + 'reminder_mail_message_2' => '天没有登录站点时,自动给您发送提醒邮件,您可以选择只接受某些类别的提醒', + 'send_once_per_day' => '每天发送一次', + 'send_once_per_week' => '每周发送一次', + 'send_real_time' => '实时发送', + 'comment_add_inonetime' => '同时作为评论发表', + 'delete_share' => '删除分享', + 'delete_share_message' => '确定删除指定的分享吗?', + 'share_copylink' => '地址复制成功
          您可以用快捷键 Ctrl + V 粘贴到 QQ、MSN 里', + 'share_count' => '已有 $share_count 人分享', + 'share_im' => '通过 QQ、MSN 分享给朋友', + 'hide_app' => '隐藏应用', + 'hide_app_message' => '确定要隐藏该应用吗?', + 'add_to_existing_album' => '添加到现有相册', + 'back_to_my_album' => '返回我的相册', + 'camera_pic' => '大头贴', + 'common_upload' => '普通上传', + 'hava_attach_size' => '当前附件空间还剩余容量', + 'i_want_more_space' => '我要增加附件容量', + 'recount' => '重新统计', + 'select_pic' => '选择图片', + 'select_upload_pic' => '请选择要上传的图片', + 'upload_pic_tips' => '

          从电脑中选择您要上传的图片。
          提示:选择图片后,您可以继续选择图片,这样就可以一次上传多张图片了

          ', + 'you_can_buy_magictools' => '您可以购买道具“{$_G[\'setting\'][\'magics\'][\'attachsize\']}”来增加附件容量,上传更多的附件', + 'about_space' => '家园相关', + 'bytes' => '字节', + 'forum_name' => '版块名称', + 'free' => '免费', + 'free_buy' => '免费购买', + 'main_usergroup' => '主用户组', + 'memcp_usergroup_unallow' => '抱歉!本站尚未开通可供购买的用户组', + 'memcp_usergroups_admin_exit_comment' => '注意: 该组不是开放用户组,一旦您退出,只有管理员才能将您重新加入进来', + 'memcp_usergroups_credit' => '您目前可以购买', + 'memcp_usergroups_dailyprice' => '日价格', + 'memcp_usergroups_exit' => '退出', + 'memcp_usergroups_exit_comment' => '本操作不可恢复,您退出收费用户组后,如需再次加入,将重新支付相应的费用,因此请在提交前仔细确定是否退出本组 ', + 'memcp_usergroups_explain' => '说明', + 'memcp_usergroups_free_comment' => '加入该组是免费的,且没有时间限制,您可以随时加入或者退出', + 'memcp_usergroups_join_comment' => '本组是收费用户组,您可以根据日价格按天购买,
          但是不能少于 $group[\'minspan\'] 天。请注意,购买后不能退款 ', + 'memcp_usergroups_joinbuy' => '购买用户组 $group[\'grouptitle\']', + 'memcp_usergroups_joinexit' => '退出用户组 $group[\'grouptitle\']', + 'memcp_usergroups_main_new' => '新主用户组', + 'memcp_usergroups_main_old' => '原主用户组', + 'memcp_usergroups_open_exit_comment' => '该组是开放的用户组,您退出后,可以随时加入进来 ', + 'memcp_usergroups_set_main' => '切换', + 'memcp_usergroups_span' => '购买时间', + 'memcp_usergroups_switch' => '切换到 $group[\'grouptitle\']', + 'memcp_usergroups_timelimit' => '用户组过期时间', + 'my_main_usergroup' => '我的主用户组', + 'permission_attachment_nopermission' => '没有限制', + 'permission_basic_disable_sarch' => '禁用搜索', + 'permission_basic_search_content' => '允许搜索文章内容', + 'permission_basic_search_title' => '只允许搜索标题', + 'permission_menu_attachment' => '附件相关', + 'permission_menu_normaloptions' => '普通权限', + 'permission_menu_post' => '文章相关', + 'permission_modoptions_name' => '管理权限', + 'renew' => '续费', + 'spacecp_usergroup_message1' => '您升级到此用户组还需积分', + 'spacecp_usergroup_message2' => '积分下限', + 'user_level' => '用户级别', + 'usergroup_group1' => '普通用户组', + 'usergroup_group2' => '晋级用户组', + 'usergroup_group3' => '站点管理组', + 'usergroup_right_message1' => '表示有权操作', + 'usergroup_right_message2' => '表示无权操作', + 'usergroup_right_message3' => '表示必须拥有指定的认证', + 'youhave' => '您目前有', + 'yourusergroup' => '当前用户组', + 'my' => '我的', + 'my_usergroups' => '我的用户组', + 'rights' => '权限', + 'usergroups_joinbuy' => '购买用户组', + 'connect_fill_profile_to_view' => '完善账号信息 绑定已有账号', + 'connect_fill_profile_to_comment' => '您需要完善账号信息绑定已有账号 后才可以留言', + 'save_to_album' => '保存到相册', + 'usergroup_expired' => '您当前的用户组已经到期,请选择继续续费还是要切换到其他用户组', + 'freeze_pw_tips' => '您当前的账号已经被冻结,请修改密码解除冻结状态', + 'freeze_email_tips' => '您当前的账号已经被冻结,必须验证邮箱后才能解除冻结状态 重新接收验证邮件', + 'freeze_admincp_tips' => '您当前的账号已经被冻结,必须在本页面填写申诉理由,并经管理中心审核通过后才能解除冻结状态', + 'freeze_reason' => '申诉理由', + 'freeze_reason_comment' => '如果您无法通过邮箱验证,请填写申诉理由', + 'freeze_reason_admincp_comment' => '如果您认为您的账号不应被冻结,请填写申诉理由', + 'freeze_remark' => '审核结果', + 'freeze_remark_comment' => '您已提交 $space[\'freezemodsubmittimes\'] 次审核,最后一次审核操作由 $space[\'freezemodadmin\'] 于 $space[\'freezemoddate\'] 做出', + 'payment_pay' => '支付确认', + 'payment_order' => '我的订单', + 'payment_order_amount' => '订单金额', + 'payment_order_dateline' => '创建时间', + 'payment_order_status' => '状态', + 'payment_order_no_data' => '目前没有交易记录', + 'payment_order_status_0' => '未支付', + 'payment_order_status_1' => '已支付', + 'payment_order_status_2' => '已过期', + 'payment_pay_order_id' => '订单号', + 'payment_pay_order_info' => '订单信息', + 'payment_pay_subject' => '订单标题', + 'payment_pay_description' => '订单描述', + 'payment_pay_amount' => '订单金额', + 'payment_pay_type' => '支付方式', + 'payment_unit_yang' => '¥', + 'payment_unit_yuan' => '元', + 'payment_pay_btn' => '立即支付', + 'payment_wxjsapi_succeed' => '支付成功', + 'payment_wx_qrcode_title' => '微信扫码支付', +); +?> \ No newline at end of file diff --git a/source/language/index.htm b/source/language/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/lang_action.php b/source/language/lang_action.php new file mode 100644 index 0000000..c3ce9f2 --- /dev/null +++ b/source/language/lang_action.php @@ -0,0 +1,27 @@ + '注册/登录', + 1 => '空间', + 2 => '论坛', + 3 => '圈子', + 4 => '首页', + + 100 => '其他', + 127 => '插件', + +); + +?> \ No newline at end of file diff --git a/source/language/lang_admincp.php b/source/language/lang_admincp.php new file mode 100644 index 0000000..5f72d21 --- /dev/null +++ b/source/language/lang_admincp.php @@ -0,0 +1,7364 @@ + '您当前系统环境内的 {req} 版本 ({now_ver}) 过低,程序无法按预期正常运行。我们强烈建议您升级到 {sug_ver} 版本,程序正常运行最低要求为 {req_ver} 版本。', + 'req_not_found' => '您当前系统环境内未安装或开启 {req} 模块,程序无法按预期正常运行。我们强烈建议您安装或开启此模块,以满足程序正常运行的最低要求。', + 'req_ok' => '您当前系统环境适合当前版本的 Discuz! {version}。', + 'subscribe_comsenz_email' => '填写您的邮件地址,订阅 Discuz! 官方产品动态、安全提醒、官方新闻', + 'scan_discuz_qrcode' => '
          扫描关注Discuz!官方微信

          获取官方最新动态', + 'reglinkname_default' => '注册', + 'yes' => '是', + 'no' => '否', + 'index' => '站点首页', + 'setindex' => '首页', + 'allthread' => '全部版块和圈子', + 'submit' => '提交', + 'submit_tips' => '按 Enter 键可随时提交您的修改', + 'reset' => '重置', + 'ok' => '确定', + 'cancel' => '取消', + 'modify' => '修改', + 'start' => '开始', + 'tips' => '技巧提示', + 'setseotips' => 'SEO优化设置提示', + 'tips_all' => '显示全部提示', + 'tips_textarea' => '双击输入框可扩大/缩小', + 'name' => '名称', + 'none' => '无', + 'default' => '默认', + 'use_default' => '- 使用默认 -', + 'unknown' => '未知', + 'unlimited' => '无限制', + 'config' => '设置', + 'admin' => '管理', + 'add' => '添加', + 'del' => '删?', + 'delete' => '删除', + 'undelete' => '还原', + 'unarchive' => '移出', + 'clean' => '清理', + 'invite' => '邀请', + 'invalidate' => '否决', + 'validate' => '通过', + 'ignore' => '忽略', + 'open' => '打开', + 'closed' => '关闭', + 'public' => '公开', + 'freeze' => '已冻结', + 'operation' => '操作', + 'operator' => '操作者', + 'reason' => '原因', + 'author' => '作者', + 'privacy' => '隐私', + 'dateline' => '发表日期', + 'dateline_7776000' => '三月', + 'dateline_2592000' => '一月', + 'dateline_604800' => '一周', + 'dateline_all' => '全部', + 'thismonth' => '本月', + 'thisweek' => '本周', + 'today' => '今日', + 'subject' => '标题', + 'nosubject' => '无标题', + 'message' => '内容', + 'mergeto' => '合并到', + 'doings' => '记录', + 'blogs' => '日志', + 'albums' => '相册', + 'shares' => '分享', + 'description' => '描述', + 'copyright' => '版权信息', + 'attachment' => '附件', + 'file' => '文件', + 'dir' => '目录', + 'filename' => '文件名', + 'version' => '版本', + 'time' => '时间', + 'type' => '类型', + 'size' => '尺寸', + 'ip' => 'IP 地址', + 'usergroup' => '用户组', + 'usernum' => '用户数:', + 'guest' => '游客', + 'anonymous' => '匿名', + 'forum' => '版块', + 'square' => '论坛', + 'username' => '用户名', + 'password' => '密 码', + 'uid' => '用户 ID', + 'loading' => '页面加载中', + 'security_question' => '提 问', + 'security_answer' => '回 答', + 'security_question_0' => '无安全提问', + 'security_question_1' => '母亲的名字', + 'security_question_2' => '爷爷的名字', + 'security_question_3' => '父亲出生的城市', + 'security_question_4' => '您其中一位老师的名字', + 'security_question_5' => '您个人计算机的型号', + 'security_question_6' => '您最喜欢的餐馆名称', + 'security_question_7' => '驾驶执照最后四位数字', + 'no_censor_word' => '无敏感词', + 'birthday' => '生日', + 'year' => '年', + 'month' => '月', + 'day' => '日', + 'days' => '天', + '0_day' => '永久', + '1_day' => '一天', + '2_day' => '两天', + '3_day' => '三天', + '5_day' => '五天', + '7_day' => '一周', + '14_day' => '两周', + '30_day' => '一个月', + '60_day' => '两个月', + '90_day' => '三个月', + '180_day' => '半年', + '365_day' => '一年', + 'more' => '更多', + 'credits' => '积分', + 'credits_id' => '积分代号', + 'credits_title' => '积分名称', + 'credits_unit' => '积分单位', + 'credits_import' => '积分兑入', + 'credits_inport' => '积分兑出', + 'rmb' => '人民币', + 'rmb_yuan' => '元', + 'posts' => '发帖数', + 'threadsnum' => '主题数', + 'blogid' =>'日志 ID', + 'view' => '查看', + 'reply' => '回复', + 'banuser' => '禁言', + 'userdelpost' => '清空文章', + 'crimerecord' => '违规登记', + 'hot' => '热度', + 'feed_title' => '动态标题', + 'feed_body' => '动态内容', + 'feed_icon' => '动态类型', + 'albumpic' => '相册封面', + 'albumname' => '相册名', + 'pic_comment' => '评论管理', + 'pic_size' => '图片大小', + 'updatetime' => '更新时间', + 'pic_num' => '图片数', + 'email' => 'Email', + 'thread' => '主题', + 'action' => '动作', + 'other' => '其他', + 'add_new' => '新增', + 'select' => '请选择', + 'select_all' => '全选', + 'option' => '选项', + 'search' => '搜索', + 'search_higher' => '高级搜索', + 'search_result' => '搜索结果', + 'search_result_find' => '找到 {number} 条记录', + 'search_result_item' => '含 {number} 条记录', + 'sameinfo' => '相关信息', + 'newlist' => '最新列表', + 'bloglist' => '日志列表', + 'research' => '重新搜索', + 'result' => '搜索结果', + 'return' => '返回', + 'copy' => '复制', + 'restore' => '恢复', + 'preview' => '预览', + 'preview_large' => '点击图片放大', + 'all' => '全部', + 'link' => '网址', + 'video' => '视频', + 'music' => '音乐', + 'pics' => '图片', + 'import' => '导入', + 'export' => '导出', + 'download' => '下载', + 'edit' => '编辑', + 'detail' => '详情', + 'display_order' => '显示顺序', + 'order' => '顺序', + 'available' => '可用', + 'enable' => '启用', + 'apply' => '应用', + 'start_time' => '起始时间', + 'end_time' => '终止时间', + 'validity' => '有效期', + 'pm' => '短消息', + 'grouppm' => '短消息', + 'notice' => '提醒', + 'custom_status' => '自定义头衔', + 'check' => '检查', + 'more_options' => '更多选项', + 'nolimit' => '不限制', + 'low' => '低', + 'middle' => '中', + 'high' => '高', + 'price' => '价格', + 'num' => '数量', + 'weight' => '重量', + 'saveconf' => '保存为设置方案', + 'value' => '数据', + 'hour' => '小时制', + 'hourtime' => '小时', + 'required' => '必填', + 'unchangeable' => '不可修改', + 'norecords' => '暂无相关记录!', + 'lastmodified' => '最后修改时间', + 'laststep' => '上一步', + 'nextstep' => '下一步', + 'inbuilt' => '内置', + 'custom' => '自定义', + 'channel' => '频道', + 'display' => '显示', + 'url' => '链接', + 'member' => '会员', + 'list' => '列表', + 'lock' => '锁定', + 'unit' => '单位', + 'equal_to' => '等于', + 'more_than' => '大于', + 'lower_than' => '小于', + 'likesupport' => '表示支持模糊查询', + 'lengthabove1' => '查询字串长度需大于1', + 'resultsort' => '结果排序', + 'defaultsort' => '默认排序', + 'defaultpoke' => '默认打招呼', + 'orderdesc' => '递减', + 'orderasc' => '递增', + 'perpage' => '每页显示', + 'perpage_10' => '每页显示10个', + 'perpage_20' => '每页显示20个', + 'perpage_50' => '每页显示50个', + 'perpage_100' => '每页显示100个', + 'multiedit' => '批量编辑', + 'show_search' => '显示搜索框', + 'hide_search' => '隐藏搜索框', + 'keywords' => '关键词', + 'startendtime' => '起止时间', + 'plugin' => '插件', + + 'import_type' => '请选择导入方式', + 'import_type_file' => '上传文件', + 'import_type_txt' => '粘贴文本', + 'import_file' => '请上传数据文件', + 'import_txt' => '请将数据内容粘贴如下', + + 'thread_general' => '普通主题', + 'thread_poll' => '投票主题', + 'thread_trade' => '商品主题', + 'thread_reward' => '悬赏主题', + 'thread_activity' => '活动主题', + 'thread_debate' => '辩论主题', + + 'discuz_message' => 'Discuz! 提示', + 'message_redirect' => '如果您的浏览器没有自动跳转,请点击这里', + 'message_download' => '如果您的浏览器没有自动下载,请点击此链接', + 'message_return' => '点击这里返回上一页', + 'xml_http_building_link' => '请等待,正在建立连接...', + 'xml_http_sending' => '请等待,正在发送数据...', + 'xml_http_loading' => '请等待,正在接受数据...', + 'xml_http_load_failed' => '通信失败,请刷新重新尝试!', + 'xml_http_data_in_processed' => '通信成功,数据正在处理中...', + + 'admincp_maptext' => '管理中心导航(ESC键)', + 'admincp_maptitle' => '管理中心导航', + + 'tiny_bbcode_support' => '(支持[color][b][u][i][s])', + + 'nav_newwin' => '新窗口打开', + 'nav_index' => '首页', + 'nav_global' => '全局', + 'nav_forum' => '论坛', + 'nav_user' => '用户', + 'nav_topic' => '内容', + 'nav_extended' => '运营', + 'nav_plugin' => '插件', + 'nav_style' => '界面', + 'nav_adv' => '广告', + 'nav_tools' => '工具', + 'nav_portal' => '门户', + 'nav_group' => '圈子', + 'nav_postsplit' => '文章分表', + 'nav_group_setting' => '圈子设置', + 'nav_group_type' => '圈子分类', + 'nav_group_manage' => '圈子管理', + 'nav_group_userperm' => '圈主权限', + 'nav_group_level' => '圈子等级', + 'nav_group_mod' => '审核圈子', + 'nav_group_level_editor' => '圈子等级 -- 编辑', + 'nav_home' => '家园', + + 'nav_runwizard' => '快速设置向导', + 'nav_setting_register' => '注册', + 'nav_setting_access' => '访问控制', + 'nav_setting_style' => '风格设置', + 'nav_setting_index' => '论坛首页', + 'nav_setting_forumdisplay' => '主题列表页', + 'nav_setting_viewthread' => '文章内容页', + 'nav_setting_member' => '用户列表页', + 'nav_setting_refresh' => '提示信息', + 'nav_setting_sitemessage' => '弹出信息', + 'nav_setting_search' => '搜索设置', + 'nav_setting_datetime' => '日期和时间格式', + 'nav_setting_periods' => '时间段设置', + 'nav_setting_global' => '全局', + 'nav_setting_editor' => '编辑器相关', + 'nav_setting_stat' => '统计相关', + 'nav_setting_mod' => '管理相关', + 'nav_setting_tags' => '主题标签(TAG)', + 'nav_setting_rate' => '评分', + 'nav_setting_sitemap' => 'Sitemap相关设置', + 'nav_setting_customnav' => '导航设置', + 'nav_setting_other' => '其他', + 'nav_setting_home' => '空间设置', + 'nav_setting_district' => '地区设置', + + 'nav_magics' => '道具中心', + 'nav_magics_market' => '市场', + 'nav_magics_confer' => '赠送', + 'nav_magics_image' => '道具图片', + 'nav_magics_name' => '道具名称', + 'nav_magics_num' => '赠送数量', + + 'nav_medals' => '勋章中心', + 'nav_medals_confer' => '颁发', + 'nav_medals_mod' => '审核', + + 'nav_card' => '充值卡密', + 'nav_card_make' => '生成', + 'nav_card_log' => '记录', + 'nav_card_log_add' => '生成记录', + 'nav_card_log_del' => '删除记录', + 'nav_card_log_cron' => '过期记录', + 'nav_card_type' => '分类', + + 'nav_tasks' => '站点任务', + 'nav_task_member' => '会员类任务', + 'nav_task_post' => '文章类任务', + 'nav_task_type' => '任务类型', + + 'nav_seo' => 'SEO设置', + 'nav_seo_rewrite' => 'URL 静态化', + 'nav_seo_portal' => '门户', + 'nav_seo_forum' => '论坛', + 'nav_seo_home' => '家园', + 'nav_seo_group' => '圈子', + + 'nav_ec' => '电子商务', + 'nav_ec_config' => '基本设置', + 'nav_ec_alipay' => '支付宝', + 'nav_ec_qpay' => 'QQ 钱包', + 'nav_ec_wechat' => '微信支付', + 'nav_ec_credit' => '诚信规则', + 'nav_ec_orders' => '积分充值订单', + 'nav_ec_tradelog' => '商品交易订单', + 'nav_ec_inviteorders' => '邀请码订单', + 'nav_ec_paymentorders' => '支付订单', + 'nav_ec_transferorders' => '转账订单', + + 'nav_moderate_posts' => '审核文章', + 'nav_moderate_threads' => '审核主题', + 'nav_moderate_replies' => '审核文章', + 'nav_moderate_blogs' => '审核日志', + 'nav_moderate_pictures' => '审核图片', + 'nav_moderate_doings' => '审核记录', + 'nav_moderate_shares' => '审核分享', + 'nav_moderate_articlecomments' => '审核文章评论', + 'nav_moderate_topiccomments' => '审核专题评论', + 'nav_moderate_comments' => '审核评论/留言', + 'nav_moderate_articles' => '审核文章', + + 'nav_modmembers' => '审核用户', + 'nav_moderate_users' => '审核用户', + 'nav_moderate_users_mod' => '审核', + + 'nav_db' => '数据库', + 'nav_db_export' => '备份', + 'nav_db_import' => '恢复', + 'nav_db_runquery' => '升级', + 'nav_db_optimize' => '优化', + 'nav_db_dbcheck' => '校验', + 'nav_db_postsplit' => '文章分表', + + 'nav_attaches' => '论坛附件管理', + 'nav_attaches_group' => '圈子附件管理', + 'nav_styles' => '模板风格管理', + 'nav_templates' => '模板套系管理', + 'nav_smilies' => '表情管理', + 'nav_click' => '表态动作', + + 'nav_maint_threads' => '论坛主题管理', + 'nav_maint_threads_group' => '圈子主题管理', + 'nav_recyclebin' => '主题回收站', + 'nav_recyclebinpost' => '回帖回收站', + 'nav_prune' => '论坛批量删帖', + 'nav_prune_group' => '圈子批量删帖', + 'nav_doing' => '记录管理', + 'nav_blog' => '日志管理', + 'nav_blog_recycle_bin' => '日志回收站', + 'nav_feed' => '动态管理', + 'nav_album' => '相册管理', + 'nav_pic' => '图片管理', + 'nav_comment' => '留言管理', + 'nav_share' => '分享管理', + 'nav_postcomment' => '文章点评管理', + + 'nav_plugins' => '插件管理', + 'nav_announce' => '站点公告', + 'nav_javascript' => '数据调用', + 'nav_infoside' => '边栏', + 'nav_updatecounters' => '更新统计', + + 'nav_admingroups' => '管理组', + 'nav_usergroups' => '用户组', + + 'nav_forums' => '版块管理', + 'nav_forums_edit' => '编辑版块', + 'nav_forums_rules' => '版块规则', + 'nav_forums_merge' => '版块合并', + 'nav_forums_types' => '分类信息', + + 'nav_members' => '用户管理', + 'nav_members_add' => '添加用户', + 'nav_members_profile' => '用户栏目', + 'nav_members_profile_group' => '用户栏目分组', + 'nav_members_profile_card' => '用户属性名片', + 'nav_members_verify' => '用户认证', + 'nav_members_stat' => '资料统计', + 'nav_members_search' => '搜索用户', + 'nav_members_clean' => '清理用户', + 'nav_members_reward' => '积分奖惩', + 'nav_members_confermedal' => '颁发勋章', + 'nav_members_confermagic' => '道具赠送', + 'nav_members_newsletter' => '站点通知', + 'nav_members_newsletter_mobile' => '手机通知', + 'nav_members_newsletter_sms' => '短信通知', + 'nav_members_ipban' => '禁止 IP', + 'nav_members_ipban_output' => '导入/导出', + 'nav_members_select' => '选取目标用户', + 'nav_members_notify' => '填写通知内容', + 'nav_defaultuser' => '推荐好友', + 'nav_follow' => '推荐关注', + 'nav_add_hotuser' => '添加推荐', + 'nav_add_follow' => '添加推荐', + 'nav_add_defaultuser' => '添加好友', + + 'nav_repeat' => '马甲', + + 'nav_misc_onlinelist' => '在线列表图标', + 'nav_misc_links' => '友情链接', + 'nav_misc_relatedlink' => '关联链接', + 'nav_posting_censor' => '词语过滤', + 'nav_remoderate' => '内容重新审核', + 'nav_posting_bbcode' => '编辑 Discuz! 代码', + 'nav_thread_icon' => '主题图标', + 'nav_thread_stamp' => '主题鉴定', + 'nav_posting_attachtype' => '附件类型尺寸', + 'nav_misc_cron' => '计划任务', + 'nav_posting_tag' => '标签管理', + + 'nav_smsgw' => '短信服务', + + 'nav_logs' => '运行记录', + 'nav_logs_illegal' => '密码错误', + 'nav_logs_rate' => '用户评分', + 'nav_logs_warn' => '用户警告', + 'nav_logs_credit' => '积分变更', + 'nav_logs_mods' => '版主管理', + 'nav_logs_medal' => '勋章颁发', + 'nav_logs_ban' => '禁止用户', + 'nav_logs_cp' => '后台访问', + 'nav_logs_magic' => '道具操作', + 'nav_logs_invite' => '邀请注册', + 'nav_logs_error' => '系统错误', + 'nav_logs_sendmail' => '邮件发送失败', + 'nav_logs_SMTP' => 'SMTP 邮件异常', + 'nav_logs_member' => '用户记录', + 'nav_logs_system' => '系统记录', + 'nav_logs_extended' => '扩展记录', + 'nav_logs_payment' => '买卖主题', + 'nav_logs_pmt' => '支付记录', + 'nav_logs_crime' => '违规记录', + 'nav_logs_crime_delpost' => '删除文章', + 'nav_logs_crime_warnpost' => '警告文章', + 'nav_logs_crime_banpost' => '屏蔽文章', + 'nav_logs_crime_banspeak' => '禁止发言', + 'nav_logs_crime_banvisit' => '禁止访问', + 'nav_logs_crime_banstatus' => '锁定用户', + 'nav_logs_crime_avatar' => '清除头像', + 'nav_logs_crime_sightml' => '清除签名', + 'nav_logs_crime_customstatus' => '清除自定义头衔', + + 'nav_fileperms' => '文件权限检查', + 'nav_fileperms_confirm' => '确认开始', + 'nav_fileperms_verify' => '开始检查', + 'nav_fileperms_completed' => '检查结果', + + 'nav_filecheck' => '文件校验', + 'nav_filecheck_confirm' => '确认开始', + 'nav_filecheck_verify' => '开始校验', + 'nav_filecheck_completed' => '校验结果', + + 'nav_hookcheck' => '嵌入点校验', + 'nav_hookcheck_confirm' => '确认开始', + 'nav_hookcheck_verify' => '开始校验', + 'nav_hookcheck_completed' => '校验结果', + + 'nav_replacekey' => '密钥更新', + 'nav_replacekey_confirm' => '确认开始', + 'nav_replacekey_verify' => '开始更新', + 'nav_replacekey_completed' => '更新结果', + + 'nav_updatecache' => '更新缓存', + 'nav_updatecache_confirm' => '确认开始', + 'nav_updatecache_verify' => '开始更新', + 'nav_updatecache_completed' => '更新结果', + + 'nav_article' => '文章管理', + + 'nav_threadsort_sortlist' => '分类列表', + 'nav_threadsort_optionlist' => '分类项目', + + 'nav_founder_perm_group' => '团队职务', + 'nav_founder_perm_member' => '团队成员', + 'nav_founder_perm_notifyusers' => '管理通知', + + 'nav_postsplit_manage' => '分表管理', + 'nav_postsplit_move' => '文章移动', + + 'nav_threadsplit' => '主题分表', + 'nav_threadsplit_manage' => '分表管理', + 'nav_threadsplit_move' => '主题移动', + + 'nav_membersplit' => '用户分表', + 'nav_mmebersplit_manage' => '分表管理', + + 'nav_custommenu' => '编辑常用操作', + + 'nav_founder_patch' => '安全中心', + 'founder_patch_list' => '安全补丁列表', + 'founder_patch_updatesetting' => '更新设置', + 'founder_patch_autoupdate' => '是否开启自动更新', + 'founder_patch_autoupdate_mobile' => '有安全补丁时通过手机短信及时通知', + 'founder_patch_autoupdate_mobile_comment' => '请您填写接收安全补丁通知的手机号码', + 'founder_patch_autoupdate_qq' => '有安全补丁时通过QQ及时通知', + 'founder_patch_autoupdate_qq_comment' => '请您填写接收安全补丁通知的QQ号码', + 'founder_patch_autoupdate_email' => '有安全补丁时通过电子邮件及时通知', + 'founder_patch_autoupdate_email_comment' => '请您填写接收安全补丁通知的电子邮箱', + 'founder_patch_serial' => '安全补丁编号', + 'founder_patch_note' => '安全补丁名称', + 'founder_patch_dateline' => '发布时间', + 'founder_patch_status' => '状态', + 'founder_patch_fix' => '修复', + 'founder_patch_rescan' => '重新扫描', + 'founder_patch_set_ftpinfo' => '设置ftp账号', + 'founder_patch_reset' => '重试', + 'patch_fix_complete' => 'Discuz! 重要安全更新: 您已修复了全部严重安全漏洞点击查看', + 'patch_fix_rigth_now' => 'Discuz! 重要安全更新: 您目前的版本存在严重安全漏洞,请尽快修复立即修复', + 'founder_patch_fixpatch' => '安全补丁', + 'founder_patch_failedreason' => '失败原因', + + 'nav_founder_upgrade' => '在线升级', + 'founder_upgrade_updatelist' => '获取待更新文件列表', + 'founder_upgrade_download' => '下载更新', + 'founder_upgrade_compare' => '本地文件比对', + 'founder_upgrade_upgrading' => '正在升级', + 'founder_upgrade_complete' => '升级完成', + 'founder_upgrade_preupdatelist' => '待更新文件列表', + 'founder_upgrade_store_directory' => '文件存放目录: ', + 'founder_upgrade_diff_show' => '与本地文件的比对结果,状态 差异 表示该本地文件被修改过

          注意:如果您的源文件是通过 非二进制 方式上传到服务器,可能导致对比结果不准确', + 'founder_upgrade_diff' => '差异', + 'founder_upgrade_normal' => '正常', + 'founder_upgrade_new' => '新增', + 'founder_upgrade_download_file' => '升级文件已经全部下载完毕,并存储到服务器目录: ', + 'founder_upgrade_backup_file' => '继续升级,将会把现有的旧文件备份到目录: ', + 'founder_upgrade_backup_file2' => ',并用新的文件进行覆盖', + 'founder_upgrade_force' => '强制升级', + 'founder_upgrade_regular' => '正常升级', + 'founder_upgrade_set_ftp' => '设置 ftp 账号', + 'founder_upgrade_reset' => '重试', + 'founder_upgrade_reupload' => '重新上传', + 'founder_upgrade_reset_ftp' => '重新设置 ftp 账号', + 'founder_upgrade_recopy' => '重新复制', + 'founder_upgrade_newword' => '新', + 'founder_upgrade_require_config' => '要求配置达到', + 'founder_upgrade_backup_remind' => '自动升级前请您先备份程序及数据库,确定开始升级吗?', + 'founder_upgrade_automatically' => '自动升级', + 'founder_upgrade_manually' => '手动下载', + 'founder_upgrade_select_version' => '检测到有新的版本可供升级,您可以选择自动升级或者下载安装包手动升级。', + 'founder_upgrade_continue' => '继续升级', + 'founder_upgrade_recheck' => '重新检测', + 'founder_upgrade_dbupdate' => '升级数据库', + 'upgrade_right_now' => '您目前使用的 Discuz! 程序有新版本发布,请及时升级在线升级', + + 'nav_founder_optimizer' => '优化大师', + 'founder_optimizer_index' => '优化首页', + 'founder_optimizer_setting' => '设置项优化', + 'founder_optimizer_setting_option' => '设置项', + 'founder_optimizer_setting_option_description' => '设置项描述', + 'founder_optimizer_setting_description' => '优化描述', + 'founder_optimizer_checking' => '正在检测', + 'founder_optimizer_start_check' => '开始检测', + 'founder_optimizer_first_use' => '这是您第一次使用优化大师,建议您立即进行检测', + 'founder_optimizer_lastcheck' => '上次检测时间: ', + 'founder_optimizer_findnum' => ',共发现 ', + 'founder_optimizer_neednum' => ' 项需要优化', + 'founder_optimizer_checking_js' => '检测中...,已检测', + 'founder_optimizer_option_js' => '项', + 'founder_optimizer_recheck_js' => '重新检测', + 'founder_optimizer_check_complete_js' => '检测完成,共检测', + 'founder_optimizer_optimizer' => '优化', + 'founder_optimizer_view' => '查看', + 'founder_optimizer_scan' => '扫描', + 'founder_optimizer_check_option' => '检测项目', + 'founder_optimizer_status' => '状态', + + 'founder_optimizer_security' => '安全测试', + 'founder_optimizer_serversec' => '底层安全', + 'founder_optimizer_performance' => '性能优化', + 'founder_optimizer_low' => '低', + 'founder_optimizer_middle' => '中', + 'founder_optimizer_high' => '高', + 'founder_optimizer_level' => '安全级别', + 'founder_optimizer_needopti' => '可优化项', + 'founder_optimizer_safe' => '安全项', + 'founder_optimizer_notice' => '提示项', + + 'nav_makehtml' => 'HTML管理', + 'makehtml_topic' => '专题', + 'makehtml_article' => '文章', + 'makehtml_category' => '频道', + 'makehtml_index' => '首页', + 'makehtml_createall' => '生成全部', + 'makehtml_createindex' => '生成首页', + 'makehtml_createcategory' => '生成频道', + 'makehtml_createarticle' => '生成文章', + 'makehtml_createtopic' => '生成专题', + 'makehtml_clear' => '清理HTML', + 'makehtml_tips_all' => '
        • 生成指定起始时间以后发布的文章的HTML文件
        • 生成指定起始时间以后发布过文章的频道HTML文件
        • 生成门户首页的HTML文件
        • ', + 'makehtml_tips_index' => '
        • 生成门户首页的HTML文件,文件名可在设置里单独指定,默认为index
        • 服务器端设置默认访问文件时,应将生成的静态文件名放在index.php之前,如:DirectoryIndex index.html index.php
        • 使用静态文件访问时,原有的某些不带index.php的动态访问将失效,如:https://www.discuz.vip/?1
        • ', + 'makehtml_tips_category' => '
        • 生成指定频道首页HTML文件
        • 生成指定起始时间以后发布过文章的频道首页HTML文件
        • 使用静态文件访问时,原有的某些不带index.php的动态访问将失效。
        • ', + 'makehtml_tips_article' => '
        • 生成指定起始时间以后发布的文章的HTML文件
        • 生成指定频道下所有文章的HTML文件
        • 生成指定起始时间以后发布的文章的HTML文件
        • ', + 'makehtml_tips_topic' => '
        • 生成指定起始时间以后发布的专题的HTML文件
        • ', + 'makehtml_recreate' => '重新生成', + 'makehtml_allfilecomplete' => '全部文件生成完成', + 'makehtml_selectcategorycomplete' => '选择的频道全部生成完成', + 'makehtml_allarticlecomplete' => '全部文章生成完成', + 'makehtml_alltopiccomplete' => '全部专题生成完成', + 'makehtml_waitmaking' => '请稍等,正在生成首页...', + 'makehtml_getcategoryid' => '获取所有要生成的频道ID并生成所有catids的文章', + 'makehtml_gettopicid' => '获取所有要生成的专题ID并生成所有topicids的专题', + 'makehtml_getarticleid' => '获取所有要生成的文章ID并生成所有aids的文章', + 'makehtml_waitmakingcategory' => '请稍等,正在检查可生成的频道页面...', + 'makehtml_nofindcategory' => '没有可生成的频道页面', + 'makehtml_nofindtopic' => '没有可生成的专题页面', + 'makehtml_nofindarticle' => '没有可生成的文章页面', + 'makehtml_startmaketopic' => '现在开始生成专题文件...', + 'makehtml_startmakeindex' => '现在开始生成主页文件...', + 'makehtml_startmakecategory' => '现在开始生成频道文件...', + 'makehtml_browser_error' => '如果您的浏览器没有反应,请点击继续...', + 'makehtml_waitchecktopic' => '请稍等,正在检查可生成的专题页面...', + 'makehtml_waitcheckarticle' => '请稍等,正在检查可生成的文章页面...', + 'makehtml_createallcategory' => '生成所有频道', + 'makehtml_selectcategory' => '选择频道', + 'makehtml_startid' => '起始ID(空或0表示从头开始)', + 'makehtml_endid' => '结束ID(空或0表示直到结束)', + 'makehtml_allcategory' => '所有频道', + + + 'nav_report' => '用户举报', + 'report_user' => '举报人', + 'report_detail' => '举报详情', + 'report_optuser' => '处理人', + 'report_opttime' => '处理时间', + 'report_receive_tips' => '
        • 下面列出了在后台有举报管理权限的管理员及全部超级版主。
        • 有新的举报时将给所有选中用户发送通知。
        • 当有新的文章被举报时同时会给相应版主发送通知。
        • ', + 'report_tips' => '
        • 可以根据举报真实情况,给举报者加减积分,设置用户举报奖惩使用的积分
        • 多人举报时奖惩第一个举报人。
        • ', + 'report_need_founder' => '只有创始人可以管理此项', + 'switch_url' => '输入 URL', + 'switch_upload' => '上传文件', + + 'login_tips' => 'Discuz! 是一个采用 PHP 和 MySQL 等多种数据库构建的高效建站解决方案,是众多 BBS 网站首选技术品牌!', + 'login_nosecques' => '您还没有使用安全登录,请在个人中心设置您的安全提问后,再访问管理中心。您可以 点击这里 进入安全提问的设置', + + 'home' => '首页', + 'home_diy' => '首页 DIY', + 'home_welcome' => '{bbname} 管理中心', + 'home_welcome_txt' => '欢迎回来,', + 'home_security_tips' => '安全提示', + 'home_security_founder' => '
        • 您可以制定多种团队职务分配给您网站管理团队的各个成员,让他们管理网站的不同事务
        • 副站长”拥有除“创始人(站长)”专有权限以外的所有后台权限,仅次于“创始人(站长)”
        • ', + 'home_security_nofounder' => '
        • 您尚未设置 站点创始人,所有在管理员用户组的用户均可以登录管理中心。请修改 config/config_global.php 添加创始人,以有效控制管理团队成员的权限范围', + 'home_security_checkip' => '
        • 您关闭了 管理员IP验证。建议只有在管理员无法登录后台的时候才关闭此项检查。修改 config/config_global.php 当中的相应设置可以开启此功能', + 'home_security_tpledit' => '
        • 您开启了 在线编辑模板 功能。建议您只有在十分必要的时候才开启它。请修改 config/config_global.php 关闭此功能', + 'home_security_runquery' => '
        • 您开启了 运行 SQL 语句 功能。建议您只有在十分必要的时候才开启它。请修改 config/config_global.php 关闭此功能', + 'home_security_service_mobile' => '您的手机号码', + 'home_security_service_qq' => '您的QQ号码', + 'home_security_service_email' => '您的电子邮箱', + 'home_security_service_mobile_save' => '信息绑定成功,此处手机采用保密方式显示', + 'home_security_service_mobile_none' => '请填写您常用的手机号码、QQ号码、电子邮箱,开通安全服务', + 'home_security_service_open' => '开通安全服务', + 'home_onlines' => '在线成员', + 'home_online_regip' => '注册 IP', + 'home_onlines_ip' => '访问 IP', + 'home_notes' => '管理团队留言', + 'home_notes_add' => '留言', + 'home_mods' => '待处理事项', + 'home_nomods' => '暂无', + 'home_mod_verify_prefix' => '等待审核的', + 'home_mod_members' => '等待审核的会员数', + 'home_mod_threads' => '等待审核的主题数', + 'home_mod_posts' => '等待审核的回复数', + 'home_mod_medals' => '等待审核的勋章数', + 'home_mod_blogs' => '等待审核的日志数', + 'home_mod_doings' => '等待审核的记录数', + 'home_mod_pictures' => '等待审核的图片数', + 'home_mod_shares' => '等待审核的分享数', + 'home_mod_comments' => '等待审核的留言数', + 'home_mod_articles' => '等待审核的文章数', + 'home_mod_articlecomments' => '等待审核的文章评论数', + 'home_mod_topiccomments' => '等待审核的专题评论数', + 'home_mod_reports' => '等待审核的举报数', + 'home_del_threads' => '回收站中的主题数', + 'home_sys_info' => '系统信息', + 'home_discuz_version' => 'Discuz! 程序版本', + 'home_ucclient_version' => 'UCenter 客户端版本', + 'home_git_version' => '(非正式版)', + 'home_check_newversion' => '查看最新版本', + 'home_environment' => '服务器系统及 PHP', + 'home_serversoftware' => '服务器软件', + 'home_database' => '服务器 MySQL 版本', + 'home_upload_perm' => '上传许可', + 'home_database_size' => '当前数据库尺寸', + 'home_attach_size' => '当前附件尺寸', + 'home_dev' => 'Discuz! 开发团队', + 'home_dev_copyright' => '版权所有', + 'home_dev_manager' => '总策划兼项目经理', + 'home_dev_team' => '产品设计与研发团队', + 'home_dev_addons' => '插件与模板设计', + 'home_dev_skins' => '界面与用户体验团队', + 'home_dev_thanks' => '感谢贡献者', + 'home_dev_supportwebs' => '第三方支持网站', + 'home_dev_links' => '相关链接', + 'home_git_thanks' => '特别感谢', + + 'setting' => '全局设置', + 'setting_tips' => '
        • 以红色虚线标示的选项,表示该选项和系统效率、负载能力与资源消耗有关(提高效率、或降低效率),建议依据自身服务器情况进行调整。
        • ', + 'setting_multi_tips' => '
        • 按住 ALT 键点击单选、复选的选项,可进行横向选择
        • ', + + 'setting_basic' => '站点信息', + 'setting_basic_bbname' => '站点名称', + 'setting_basic_bbname_comment' => '站点名称,将显示在浏览器窗口标题等位置', + 'setting_basic_sitename' => '网站名称', + 'setting_basic_sitename_comment' => '网站名称,将显示在页面底部的联系方式处', + 'setting_basic_siteurl' => '网站 URL', + 'setting_basic_siteurl_comment' => '网站 URL,将作为链接显示在页面底部', + 'setting_basic_adminemail' => '管理员邮箱', + 'setting_basic_adminemail_comment' => '管理员 E-mail,将作为系统发邮件的时候的发件人地址', + 'setting_basic_index_name' => '首页文件名', + 'setting_basic_index_name_comment' => '设置站点首页的文件名,默认为“forum.php?mod=index”,如果您更改了此设置,那么您需要使用“FTP工具”手动重命名文件名称', + 'setting_basic_site_qq' => 'QQ在线客服号码', + 'setting_basic_site_qq_comment' => '设置我的QQ在线状态', + 'setting_basic_icp' => '网站备案信息代码', + 'setting_basic_icp_comment' => '页面底部可以显示 ICP 备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空', + 'setting_basic_mps' => '联网备案信息代码', + 'setting_basic_mps_comment' => '页面底部可以显示联网备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空', + 'setting_basic_stat' => '网站第三方统计代码', + 'setting_basic_stat_comment' => '页面底部可以显示第三方统计', + 'setting_basic_boardlicensed' => '显示授权信息链接', + 'setting_basic_boardlicensed_comment' => '选择“是”将在页脚显示商业授权用户链接,链接将指向 Discuz! 官方网站,用户可通过此链接验证其所使用的 Discuz! 是否经过商业授权', + 'setting_basic_bbclosed' => '关闭站点', + 'setting_basic_bbclosed_comment' => '暂时将站点关闭,其他人无法访问,但不影响管理员访问', + 'setting_basic_closedreason' => '关闭站点的原因', + 'setting_basic_closedreason_comment' => '站点关闭时出现的提示信息', + 'setting_basic_bbclosed_activation' => '站点关闭时允许 UCenter 中的用户激活', + + 'setting_access' => '注册与访问控制', + 'setting_access_register' => '注册', + 'setting_access_register_status' => '允许新用户注册', + 'setting_access_register_status_comment' => '设置是否允许游客注册成为站点会员,您可以根据站点需求选择注册方式', + 'setting_access_register_regclosemessage' => '关闭注册提示信息', + 'setting_access_register_regclosemessage_comment' => '当站点关闭注册时的提示信息', + 'setting_access_register_censoruser' => '用户信息保留关键字', + 'setting_access_register_censoruser_comment' => '用户在其用户信息中无法使用这些关键字。每个关键字一行,可使用通配符 "*" 如 "*版主*"(不含引号)', + 'setting_access_register_verify' => '新用户注册验证', + 'setting_access_register_verify_comment' => '选择“无”用户可直接注册成功;选择“Email 验证”将向用户注册 Email 发送一封验证邮件以确认邮箱的有效性(开启“通过邮件发送注册链接”该设置自动通过验证);选择“人工审核”将由管理员人工逐个确定是否允许新用户注册', + 'setting_access_register_verify_email' => 'Email 验证', + 'setting_access_register_verify_manual' => '人工审核', + 'setting_access_register_verify_areawhite' => '不受新用户注册验证限制的地区列表', + 'setting_access_register_verify_areawhite_comment' => '当用户处于本列表中的地址时,直接注册成功,无需新用户注册验证。每个地区一行,例如 "北京"(不含引号),留空为不设置', + 'setting_access_register_verify_ipwhite' => '不受新用户注册验证限制的 IP 列表', + 'setting_access_register_verify_ipwhite_comment' => '当用户处于本列表中的 IP 地址时,直接注册成功,无需新用户注册验证。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 'setting_access_register_maildomain' => '注册邮箱域名限制', + 'setting_access_register_maildomain_comment' => '选择“无”直接关闭本功能;选择“白名单模式”,只有限制名单中的邮箱域名可以注册;选择“黑名单模式”,限制名单中的邮箱域名不能注册。', + 'setting_access_register_maildomain_white' => '白名单模式', + 'setting_access_register_maildomain_black' => '黑名单模式', + 'setting_access_register_maildomain_list' => '限制名单', + 'setting_access_register_maildomain_list_comment' => '当邮箱的域名处于本列表中的地址时,将根据上述选项进行相应限制操作。输入要限制的邮箱域名即可,例如屏蔽 xxx@xxx.com 的域,只需输入 @xxx.com。每行一个域名。', + 'setting_access_register_ctrl' => '同一 IP 注册间隔限制(小时)', + 'setting_access_register_ctrl_comment' => '同一 IP 在本时间间隔内将只能注册一个账号,0 为不限制', + 'setting_access_register_floodctrl' => '同一 IP 在 24 小时允许注册的最大次数', + 'setting_access_register_floodctrl_comment' => '同一 IP 地址在 24 小时内尝试注册的次数限制,建议在 30 - 100 范围内取值,0 为不限制', + 'setting_access_register_welcomemsg' => '发送欢迎信息', + 'setting_access_register_welcomemsg_comment' => '可选择是否自动向新注册用户发送一条欢迎信息', + 'setting_access_register_welcomemsg_nosend' => '不发送', + 'setting_access_register_welcomemsg_pm' => '发送欢迎信息', + 'setting_access_register_welcomemsg_email' => '发送欢迎 Email', + 'setting_access_register_welcomemsgtitle' => '欢迎信息标题', + 'setting_access_register_welcomemsgtitle_comment' => '系统发送的欢迎信息的标题,不支持 HTML,不超过 75 字节。 ', + 'setting_access_register_welcomemsgtxt' => '欢迎信息内容', + 'setting_access_register_welcomemsgtxt_comment' => '系统发送的欢迎信息的内容。标题内容均支持变量替换,可以使用如下变量:
          {username} : 用户名
          {time} : 发送时间
          {sitename} : 网站名称(显示在页面底部的联系方式处的名称)
          {bbname} : 站点名称(显示在浏览器窗口标题等位置的名称)
          {adminemail} : 管理员 Email', + 'setting_access_register_bbrules' => '显示网站服务条款', + 'setting_access_register_bbruleforce' => '是否强制显示网站服务条款', + 'setting_access_register_bbruleforce_comment' => '选择是则在用户注册时,首先将看到网站服务条款全文,必须同意才可以继续注册', + 'setting_access_register_bbrules_comment' => '新用户注册时显示网站服务条款', + 'setting_access_register_bbrulestxt' => '服务条款内容', + 'setting_access_register_bbrulestxt_comment' => '网站服务条款的详细内容', + 'setting_access_register_ipctrl_time' => '限时注册IP注册间隔限制(小时):', + 'setting_access_register_ipctrl_time_comment' => '用户处于限时注册的 IP 列表中的 IP 地址时,同一 IP 在本时间间隔内将只能注册一个账号', + 'setting_access_register_ipctrl' => '限时注册的 IP 列表', + 'setting_access_register_ipctrl_comment' => '当用户处于本列表中的 IP 地址时,在限时注册IP注册间隔限制内将至多只允许注册一个账号。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 'setting_access_register_close' => '关闭注册', + 'setting_access_register_open' => '开放普通注册', + 'setting_access_register_invite' => '开放邀请注册', + 'setting_access_register_connect' => '开放QQ注册', + 'setting_access_register_send_register_url' => '通过邮件发送注册链接', + 'setting_access_register_send_register_url_comment' => '开启后系统会发一条注册的地址到用户的邮箱,从该地址链接过来的允许注册,同时建议UCenter中开启一个邮箱只允许注册一个账户
          注意:只有在站长 - 邮件设置中完成邮件设置,确保邮件能发送成功下可以开启该功能 ', + + + 'setting_access_register_invite_buy' => '允许充值购买邀请码', + 'setting_access_register_invite_buy_comment' => '允许游客通过在线充值购买注册邀请码。仅限于关闭普通注册时有效。开启前请确认您的电子商务发送邮件功能可正常使用', + 'setting_access_register_invite_buyprice' => '邀请码单价(元)', + 'setting_access_register_invite_buyprompt' => '邀请注册说明', + 'setting_access_register_invite_credit' => '邀请新注册会员奖励所用扩展积分', + 'setting_access_register_invite_credit_comment' => '邀请新注册会员奖励所用的扩展积分,包括奖励邀请人和被邀请人的奖励积分', + 'setting_access_register_invite_addcredit' => '被邀请人奖励积分数量', + 'setting_access_register_invite_addcredit_comment' => '通过邀请码注册成功后,奖励被邀请人的扩展积分数量', + 'setting_access_register_invite_invitedcredit' => '邀请人奖励积分数量', + 'setting_access_register_invite_invitedcredit_comment' => '通过邀请码注册成功后,奖励邀请人的扩展积分数量', + 'setting_access_register_invite_addfriend' => '邀请注册成功是否加为好友', + 'setting_access_register_invite_addfriend_comment' => '通过邀请码注册成功后,邀请人和被邀请人互相加为好友', + 'setting_access_register_invite_group' => '邀请注册用户初始用户组', + 'setting_access_register_invite_group_comment' => '被邀请人的初始用户组', + 'setting_access_register_invite_areawhite' => '不受邀请码限制的地区列表', + 'setting_access_register_invite_areawhite_comment' => '当用户处于本列表中的地址时,注册时不受邀请码限制。每个地区一行,例如 "北京"(不含引号),留空为不设置。
          注意:如要正确无误的判断您 IP 地址所在的地区,请到网上下载 qqwry.dat IP 地址库文件上传到 "data/ipdata/" 目录下更名为 wry.dat', + 'setting_access_register_invite_ipwhite' => '不受邀请码限制的 IP 列表', + 'setting_access_register_invite_ipwhite_comment' => '当用户处于本列表中的 IP 地址时,注册时不受邀请码限制。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 'setting_access_register_connect_birthday' => 'QQ注册时必填生日', + 'setting_access_register_connect_gender' => 'QQ注册时必填性别', + 'setting_access_register_connect_uinlimit' => '同一QQ账号最多可创建论坛账号的个数', + 'setting_access_register_connect_uinlimit_comment' => '一个QQ账号无论绑定/解绑多少次,通过此QQ账号最多可以创建论坛新账号的个数,0 或留空为不限制', + 'setting_access_register_connect_credit' => 'QQ注册用户奖励所用扩展积分', + 'setting_access_register_connect_credit_comment' => '通过QQ注册后,用户奖励所用的扩展积分', + 'setting_access_register_connect_addcredit' => 'QQ注册用户奖励积分数量', + 'setting_access_register_connect_addcredit_comment' => '通过QQ注册后,用户奖励的扩展积分数量', + 'setting_access_register_connect_group' => 'QQ注册用户初始用户组', + 'setting_access_register_connect_group_comment' => '通过QQ注册后,用户的初始用户组', + 'setting_access_register_connect_regverify' => 'QQ注册的用户忽略注册验证', + 'setting_access_register_connect_regverify_comment' => '设置通过QQ注册的用户是否忽略新用户注册验证,可直接注册成功 ', + 'setting_access_register_connect_invite' => 'QQ注册的用户忽略邀请注册', + 'setting_access_register_connect_invite_comment' => '设置通过QQ注册的用户是否忽略邀请注册,不必填写邀请码', + 'setting_access_register_connect_newbiespan' => 'QQ注册用户的新手见习期限(分钟):', + 'setting_access_register_connect_newbiespan_comment' => '通过QQ注册的用户在本期限内将无法发表信息,不影响版主和管理员,0 为不限制,留空表示使用全局设置', + 'setting_access_register_advanced' => '显示高级选项', + 'setting_access_register_advanced_comment' => '在注册页面是否显示选填内容', + 'setting_access_register_name' => '注册地址:', + 'setting_access_register_name_comment' => '设置站点注册地址 mod 值,默认为“register”,修改名称有利于防止灌水软件,有别于 Discuz! X 之前的版本更改了此设置,不需要修改任何文件名称,只在此修改即可', + 'setting_access_register_link_name' => '注册链接文字', + 'setting_access_register_link_name_comment' => '设置站点注册页的链接文字,默认为“立即注册”', + 'setting_access_register_strongpw' => '强制密码复杂度', + 'setting_access_register_strongpw_comment' => '新用户注册时密码中必须存在所选字符类型,不选则为无限制', + 'setting_access_register_strongpw_1' => '数字', + 'setting_access_register_strongpw_2' => '小写字母', + 'setting_access_register_strongpw_3' => '大写字母', + 'setting_access_register_strongpw_4' => '符号', + 'setting_access_register_pwlength' => '密码最小长度', + 'setting_access_register_pwlength_comment' => '新用户注册时密码最小长度,0或不填为不限制', + 'setting_access_guest_connect_group' => 'QQ登录用户游客用户组', + 'setting_access_guest_connect_group_comment' => '通过QQ登录后,尚未完善资料用户的初始用户组', + + 'setting_access_access' => '访问控制', + 'setting_access_access_newbiespan' => '新手见习期限(分钟)', + 'setting_access_access_newbiespan_comment' => '新注册用户在本期限内将无法发帖和短消息,不影响版主和管理员,0 为不限制', + 'setting_access_access_ipaccess' => '允许访问站点的 IP 列表', + 'setting_access_access_ipaccess_comment' => '只有当用户处于本列表中的 IP 地址时才可以访问本站点,列表以外的地址访问将视为 IP 被禁止,仅适用于诸如企业、学校内部站点等极个别场合。本功能对管理员没有特例,如果管理员不在此列表范围内将同样不能登录,请务必慎重使用本功能。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为所有 IP 除明确禁止的以外均可访问', + 'setting_access_access_adminipaccess' => '允许访问管理中心的 IP 列表', + 'setting_access_access_adminipaccess_comment' => '只有当用户处于本列表中的 IP 地址时才可以访问站点管理中心,列表以外的地址访问将无法访问,但仍可访问站点前端用户界面,请务必慎重使用本功能。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为所有 IP 除明确禁止的以外均可访问管理中心', + 'setting_access_access_domainwhitelist' => '允许发表的域名列表', + 'setting_access_access_domainwhitelist_comment' => '当用户组禁止发表 URL ,或者 URL 不解析时,处于本列表中的域名下的 URL 仍然可以正常发表,正常解析,每行一个域名,默认为本站域名可以正常发表', + 'setting_access_access_domainwhitelist_affectimg' => '不解析此名单外的远程图片', + + 'setting_styles' => '界面设置', + + 'setting_styles_global' => '全局', + 'setting_styles_global_styleid' => '站点默认风格', + 'setting_styles_global_styleid_comment' => '站点默认的界面风格,游客和使用默认风格的会员将以此风格显示', + 'setting_styles_global_navsubhover' => '二级导航显示方式', + 'setting_styles_global_navsubhover_comment' => '设置二级导航的显示方式。如果设置为显示所有主导航的二级导航,那么会当鼠标移动到其他主导航文字上方的时候显示它们的二级导航', + 'setting_styles_global_navsubhover_0' => '只显示当前的二级导航', + 'setting_styles_global_navsubhover_1' => '显示所有主导航的二级导航', + 'setting_styles_global_topnavtype' => '显示位置', + 'setting_styles_global_topnavtype_0' => '左侧', + 'setting_styles_global_topnavtype_1' => '右侧', + 'setting_styles_global_stylejump' => '显示风格切换按钮', + 'setting_styles_global_stylejump_comment' => '设置是否显示可用的站点风格切换按钮,用户可以此按钮切换不同的站点风格', + 'setting_styles_global_jsmenu' => '论坛显示版块跳转菜单', + 'setting_styles_global_jsmenu_comment' => '注意: 当论坛分版块很多时,本功能会严重加重服务器负担', + 'setting_styles_global_allowfloatwin' => '启用浮动窗口', + 'setting_styles_global_allowfloatwin_comment' => '设置以浮动方式显示的窗口', + 'setting_styles_global_allowfloatwin_login' => '登录', + 'setting_styles_global_allowfloatwin_register' => '注册', + 'setting_styles_global_allowfloatwin_sendpm' => '发短消息', + 'setting_styles_global_allowfloatwin_newthread' => '发帖', + 'setting_styles_global_allowfloatwin_reply' => '回帖', + 'setting_styles_global_allowfloatwin_attachpay' => '购买附件', + 'setting_styles_global_allowfloatwin_pay' => '购买主题', + 'setting_styles_global_allowfloatwin_viewvote' => '投票主题', + 'setting_styles_global_allowfloatwin_tradeorder' => '商品主题', + 'setting_styles_global_allowfloatwin_activity' => '活动主题', + 'setting_styles_global_allowfloatwin_debate' => '辩论主题', + 'setting_styles_global_allowfloatwin_viewratings' => '查看评分', + 'setting_styles_global_allowfloatwin_viewwarning' => '查看警告', + 'setting_styles_global_allowfloatwin_viewthreadmod' => '主题操作记录', + 'setting_styles_global_allowfloatwin_nav' => '导航', + 'setting_styles_global_allowfloatwin_usergroups' => '购买用户组', + 'setting_styles_global_allowfloatwin_task' => '站点任务', + 'setting_styles_global_showfjump' => '显示版块导航', + 'setting_styles_global_showfjump_comment' => '设置是否在快捷导航中显示版块导航', + 'setting_styles_global_creditnotice' => '积分变动提示', + 'setting_styles_global_creditnotice_comment' => '当用户在站点的操作产生积分变动时,将弹出提示信息告知用户', + 'setting_styles_global_showusercard' => '显示用户名片', + 'setting_styles_global_showusercard_comment' => '设置当鼠标移动到用户名位置上时是否显示他的名片', + 'setting_styles_global_anonymoustext' => '匿名用户的昵称', + 'setting_styles_global_anonymoustext_comment' => '设置文章或评论留言中的匿名用户显示的文字。如:本站网友', + 'setting_styles_global_home_style' => '家园展示风格', + 'setting_styles_global_home_style_comment' => '选择日志、相册、分享、记录、广播展示风格', + 'setting_styles_global_home_style_1' => '以SNS模块风格展示', + 'setting_styles_global_home_style_0' => '以论坛模块风格展示', + 'setting_styles_global_homepage_style' => '个人主页默认皮肤', + 'setting_styles_global_homepage_style_comment' => '选择个人主页默认展示风格', + 'setting_styles_global_homepage_style_1' => '个性化DIY风格', + 'setting_styles_global_homepage_style_0' => '论坛样式', + + 'setting_styles_customnav' => '导航设置', + + 'setting_styles_sitemessage' => '弹出信息', + 'setting_styles_sitemessage_time' => '弹出信息停留时间(秒)', + 'setting_styles_sitemessage_time_comment' => '各种弹出信息显示时间的长短,一般设置为 3-10,0 为鼠标点击后消失', + 'setting_styles_sitemessage_register' => '注册页面', + 'setting_styles_sitemessage_register_comment' => '注册页面的弹出信息,每行填写一条信息,多条信息将随机显示', + 'setting_styles_sitemessage_login' => '登录页面', + 'setting_styles_sitemessage_login_comment' => '登录页面的弹出信息,每行填写一条信息,多条信息将随机显示', + 'setting_styles_sitemessage_newthread' => '发帖页面', + 'setting_styles_sitemessage_newthread_comment' => '发帖页面的弹出信息,每行填写一条信息,多条信息将随机显示', + 'setting_styles_sitemessage_reply' => '回复页面', + 'setting_styles_sitemessage_reply_comment' => '回复页面的弹出信息,每行填写一条信息,多条信息将随机显示', + + 'setting_styles_index' => '论坛首页', + 'setting_styles_index_allowindextype' => '在首页切换显示风格', + 'setting_styles_index_indextype' => '首页显示风格', + 'setting_styles_index_indextype_comment' => '设置论坛首页的默认显示风格', + 'setting_styles_index_indextype_classics' => '经典版块列表', + 'setting_styles_index_indextype_feeds' => '论坛实时动态', + 'setting_styles_index_indexhot_status' => '论坛热点', + 'setting_styles_index_indexhot_status_comment' => '设置是否显示全论坛的热点主题', + 'setting_styles_index_indexhot_limit' => '论坛热点显示数量', + 'setting_styles_index_indexhot_limit_comment' => '设置论坛热点条目数,默认值 10 条', + 'setting_styles_index_indexhot_days' => '论坛热点天数', + 'setting_styles_index_indexhot_days_comment' => '设置显示多少天内的主题,默认值 7 天', + 'setting_styles_index_indexhot_expiration' => '论坛热点更新周期(秒)', + 'setting_styles_index_indexhot_expiration_comment' => '设置论坛热点在多长时间更新一次,默认值 900', + 'setting_styles_index_indexhot_messagecut' => '论坛热点内容截取文字长度', + 'setting_styles_index_indexhot_messagecut_comment' => '设置论坛热点内容的文字长度,默认值 200 个字', + 'setting_styles_index_allowwidthauto' => '站点宽窄风格', + 'setting_styles_index_allowwidthauto_comment' => '设置站点的显示风格是宽版还是窄版。其中论坛的版块中还可以进行独立的设置', + 'setting_styles_index_allowwidthauto_1' => '窄屏(固定宽度)', + 'setting_styles_index_allowwidthauto_0' => '宽屏(自由宽度)', + 'setting_styles_index_switchwidthauto' => '允许用户自由切换', + 'setting_styles_index_switchwidthauto_comment' => '设置是否允许用户自由切换宽窄风格', + 'setting_styles_index_subforumsindex' => '显示版块的下级子版块', + 'setting_styles_index_subforumsindex_comment' => '设置是否在版块描述下方显示下级子版块名字和链接(如果存在的话)。注意: 本功能不考虑子版块特殊浏览权限的情况,只要存在即会被显示出来', + 'setting_styles_index_forumlinkstatus' => '显示友情链接', + 'setting_styles_index_forumlinkstatus_comment' => '设置是否显示友情链接', + 'setting_styles_index_forumallowside' => '显示边栏', + 'setting_styles_index_forumallowside_comment' => '选择“是”论坛首页侧边将显示聚合论坛内容的信息', + 'setting_styles_index_whosonline' => '显示在线用户', + 'setting_styles_index_display_none' => '不显示', + 'setting_styles_index_whosonline_comment' => '设置是否在论坛首页底部和论坛版块边栏显示在线会员列表', + 'setting_styles_index_whosonline_contract' => '缩略显示在线列表', + 'setting_styles_index_whosonline_contract_comment' => '如果打开该选项,在线列表将只显示在线用户数,不显示详情,此时会员可手动打开在线用户列表(最大在线超过 500 人系统将自动缩略显示在线列表)', + 'setting_styles_index_whosonline_index' => '仅在论坛首页显示', + 'setting_styles_index_whosonline_forum' => '仅在论坛版块显示', + 'setting_styles_index_whosonline_both' => '在论坛首页和论坛版块显示', + 'setting_styles_index_hideprivate' => '隐藏无权访问的版块', + 'setting_styles_index_hideprivate_comment' => '不在列表中显示当前用户无权访问的版块', + 'setting_styles_index_showfollowcollection' => '首页显示用户订阅的淘专辑数量', + 'setting_styles_index_showfollowcollection_comment' => '在首页显示用户订阅的淘专辑数量', + 'setting_styles_index_members' => '首页显示生日人数', + 'setting_styles_index_members_comment' => '在首页显示今天过生日的最大会员人数,0 为关闭显示生日会员功能。注意: 本功能会加重服务器负担', + 'setting_styles_index_moddisplay' => '版主显示方式', + 'setting_styles_index_moddisplay_comment' => '首页版块列表中版主显示方式', + 'setting_styles_index_moddisplay_flat' => '平面显示', + 'setting_styles_index_moddisplay_selectbox' => '下拉菜单', + 'setting_styles_index_online_more_members' => '最多显示在线人数', + 'setting_styles_index_online_more_members_comment' => '此设置只有在显示在线用户启用时才有效。设置为 0 则为不限制', + 'setting_styles_index_disfixednv' => '关闭顶部导航固定', + 'setting_styles_index_disfixednv_comment' => '当向上滚动屏幕时,主导航将即时出现在屏幕的顶部', + + 'setting_styles_forumdisplay' => '主题列表页', + 'setting_styles_forumdisplay_tpp' => '每页显示主题数', + 'setting_styles_forumdisplay_tpp_comment' => '主题列表中每页显示主题数目', + 'setting_styles_forumdisplay_threadmaxpages' => '主题列表最大页数', + 'setting_styles_forumdisplay_threadmaxpages_comment' => '主题列表中用户可以翻阅到的最大页数,建议设置为默认值 1000,或在不超过 2500 范围内取值,0 为不限制', + 'setting_styles_forumdisplay_leftsidewidth' => '左侧版块导航宽度', + 'setting_styles_forumdisplay_leftsidewidth_comment' => '设置左侧版块导航的宽度,设置为 0 或者版块开启了边栏时不显示此导航', + 'setting_styles_forumdisplay_leftsideopen' => '左侧版块默认展开', + 'setting_styles_forumdisplay_leftsideopen_comment' => '设置左侧版块导航是否默认全部展开', + 'setting_styles_forumdisplay_globalstick' => '启用全局置顶', + 'setting_styles_forumdisplay_globalstick_comment' => '选择“是”,置顶 III 的主题将在全部论坛显示,置顶 II 的主题将在当前分区中显示。注意: 本功能会加重服务器负担', + 'setting_styles_forumdisplay_targetblank' => '“新窗”是否默认勾选', + 'setting_styles_forumdisplay_targetblank_comment' => '选择“是”则默认情况下主题列表页主题链接在新窗口打开,默认为“否”', + 'setting_styles_forumdisplay_part' => '显示主题列表分割带', + 'setting_styles_forumdisplay_part_comment' => '选择“否”,在主题列表页将不显示置顶主题与普通主题之间的分割带(版块主题那一空行)', + 'setting_styles_forumdisplay_stick' => '置顶主题的标识', + 'setting_styles_forumdisplay_stick_comment' => '以英文状态下的逗号分割,只有三项有效,级别依次为从高至低', + 'setting_styles_forumdisplay_visitedforums' => '显示最近访问版块数量', + 'setting_styles_forumdisplay_visitedforums_comment' => '设置在版块列表和文章浏览中显示最近访问过的版块数量,建议设置为 10 以内,0 为关闭此功能', + 'setting_styles_forumdisplay_fastpost' => '快速发帖/回帖', + 'setting_styles_forumdisplay_fastpost_comment' => '在主题列表页底部显示快速发帖,在文章内容页底部显示快速回帖', + 'setting_styles_forumdisplay_fastsmilies' => '显示推荐表情', + 'setting_styles_forumdisplay_fastsmilies_comment' => '在快速发帖右侧显示推荐表情。推荐的表情需要到“表情管理”中设置', + 'setting_styles_forumdisplay_forumpicstyle_thumbwidth' => '主题封面宽度', + 'setting_styles_forumdisplay_forumpicstyle_thumbwidth_comment' => '当版块开启图片列表模式时有效,0或不填 将使用默认值(203)。变更宽高建议重建主题封面,点此重建', + 'setting_styles_forumdisplay_forumpicstyle_thumbheight' => '主题封面高度', + 'setting_styles_forumdisplay_forumpicstyle_thumbheight_comment' => '当版块开启图片列表模式时有效,0或不填 将根据原图高度按比例生成,封面高度不同,有瀑布流的效果', + 'setting_styles_forumdisplay_forumpicstyle_thumbnum' => '封面图显示数量', + 'setting_styles_forumdisplay_forumpicstyle_thumbnum_comment' => '当版块开启图片列表模式时有效,0或不填 将和普通列表模式每页显示主题数一致', + 'setting_styles_forumdisplay_defstyle_comment' => '选择“是”时,默认不以图片列表形式显示,用户也可以自己选择', + 'setting_styles_forumdisplay_newbie' => '新人帖图标', + 'setting_styles_forumdisplay_newbie_comment' => '用户发第一篇主题时显示的图标,为空则不打图标', + 'setting_styles_forumdisplay_disfixednv_forumdisplay' => '关闭顶部导航固定', + 'setting_styles_forumdisplay_disfixednv_forumdisplay_comment' => '当向上滚动屏幕时,主导航将即时出现在屏幕的顶部', + 'setting_styles_forumdisplay_threadpreview' => '关闭主题预览', + 'setting_styles_forumdisplay_threadpreview_comment' => '关闭后将不可在主题列表页预览文章内容', + + 'setting_styles_viewthread' => '文章内容页', + 'setting_styles_viewthread_ppp' => '每页显示帖数', + 'setting_styles_viewthread_ppp_comment' => '文章列表中每页显示文章数目', + 'setting_styles_viewthread_starthreshold' => '星星升级阈值', + 'setting_styles_viewthread_starthreshold_comment' => '星星数在达到此阈值(设为 N)时,N 个星星显示为 1 个月亮、N 个月亮显示为 1 个太阳。默认值为 2,如设为 0 则取消此项功能,始终以星星显示', + 'setting_styles_viewthread_maxsigrows' => '签名最大高度(px)', + 'setting_styles_viewthread_maxsigrows_comment' => '设置文章中允许显示签名的最大高度', + 'setting_styles_viewthread_sigviewcond' => '签名显示条件', + 'setting_styles_viewthread_sigimgclick_on' => '取消签名图片的动态放大功能', + 'setting_styles_viewthread_sigviewcond_comment' => '只有文章字数大于指定数值后才显示签名,0为不限制', + 'setting_styles_viewthread_author_onleft' => '作者用户名显示位置', + 'setting_styles_viewthread_author_onleft_comment' => '显示位置并不会影响论坛的性能和美观,请根据您会员的浏览习惯进行选择', + 'setting_styles_viewthread_author_onleft_yes' => '显示在头像上方', + 'setting_styles_viewthread_author_onleft_no' => '显示在文章内部', + 'setting_styles_viewthread_customauthorinfo' => '设置用户信息显示的位置', + 'setting_styles_viewthread_userinfo_uid' => 'UID', + 'setting_styles_viewthread_userinfo_posts' => '回帖', + 'setting_styles_viewthread_userinfo_threads' => '主题', + 'setting_styles_viewthread_userinfo_doings' => '记录', + 'setting_styles_viewthread_userinfo_blogs' => '日志', + 'setting_styles_viewthread_userinfo_albums' => '相册', + 'setting_styles_viewthread_userinfo_sharings' => '分享', + 'setting_styles_viewthread_userinfo_friends' => '好友', + 'setting_styles_viewthread_userinfo_digest' => '精华', + 'setting_styles_viewthread_userinfo_credits' => '积分', + 'setting_styles_viewthread_userinfo_gender_male' => '男', + 'setting_styles_viewthread_userinfo_gender_female' => '女', + 'setting_styles_viewthread_userinfo_regtime' => '注册时间', + 'setting_styles_viewthread_userinfo_lastdate' => '最后登录', + 'setting_styles_viewthread_userinfo_oltime' => '在线时间', + 'setting_styles_viewthread_userinfo_creditinfo' => '信用度', + 'setting_styles_viewthread_userinfo_follower' => '听众数', + 'setting_styles_viewthread_userinfo_following' => '收听数', + 'setting_styles_viewthread_userinfo_readperm' => '阅读权限', + 'setting_styles_viewthread_userinfo_gender' => '性别', + 'setting_styles_viewthread_userinfo_location' => '来自', + 'setting_styles_viewthread_userinfo_none' => '普通主题不显示', + 'setting_styles_viewthread_userinfo_left' => '帖内左侧', + 'setting_styles_viewthread_userinfo_menu' => '作者头像菜单', + 'setting_styles_viewthread_rate_on' => '是否在页面上显示评分理由', + 'setting_styles_viewthread_rate_number' => '评分条目数', + 'setting_styles_viewthread_rate_number_comment' => '在文章中显示最近评分结果的条目数,0 为不显示', + 'setting_styles_viewthread_collection_number' => '相关淘专辑条目数', + 'setting_styles_viewthread_collection_number_comment' => '在主题帖中显示相关淘专辑的条目数,0 为不显示', + 'setting_styles_viewthread_relate_number' => '相关文章条目数', + 'setting_styles_viewthread_relate_number_comment' => '在主题帖中显示相关文章的条目数,0 为不显示', + 'setting_styles_viewthread_relate_time' => '相关文章缓存时间', + 'setting_styles_viewthread_relate_time_comment' => '单位:分钟,在主题帖中显示相关文章的缓存时间(0 为不缓存,不推荐)', + 'setting_styles_viewthread_hideattachdown' => '是否隐藏附件下载次数', + 'setting_styles_viewthread_hideattachdown_comment' => '开启后贴内图片、附件的下载次数会被隐藏', + 'setting_styles_viewthread_hideattachtips' => '是否隐藏附件信息条', + 'setting_styles_viewthread_hideattachtips_comment' => '开启后贴内图片、附件的提示信息条会被隐藏,开启后无法使用转存到相册功能,如果当前板块是图片列表板块且当前用户有权设置主题封面则此功能无效', + 'setting_styles_viewthread_show_signature' => '是否显示作者签名', + 'setting_styles_viewthread_show_signature_comment' => '', + 'setting_styles_viewthread_show_face' => '是否显示作者头像', + 'setting_styles_viewthread_show_face_comment' => '', + 'setting_styles_viewthread_show_images' => '是否显示帖内图片', + 'setting_styles_viewthread_show_images_comment' => '', + 'setting_styles_viewthread_showexif' => '图片附件显示 EXIF 信息', + 'setting_styles_viewthread_showexif_comment' => '设置图片附件在动态放大效果中是否显示 EXIF 信息', + 'setting_styles_viewthread_showexif_disabled' => '您的主机不支持 EXIF 库,无法开启此功能', + 'setting_styles_viewthread_imagemaxwidth' => '帖内图片最大宽度', + 'setting_styles_viewthread_imagemaxwidth_comment' => '当帖内图片宽度大于设置的值时图片宽度会被自动调节。请填写整数值,不支持百分比数值', + 'setting_styles_viewthread_imagelistthumb' => '帖内图片列表中图片横排显示条件', + 'setting_styles_viewthread_imagelistthumb_comment' => '设置当帖内图片列表中图片数量满足多少张以后以横排方式显示,0 或留空为关闭横排显示', + 'setting_styles_viewthread_zoomstatus' => '是否使用图片动态放大效果', + 'setting_styles_viewthread_zoomstatus_comment' => '当帖内图片宽度大于“帖内图片最大宽度”时是否附加鼠标点击时的动态放大效果。选择“是”单击图片会有动态放大效果,选择“否”将会新窗口打开图片', + 'setting_styles_viewthread_csscache' => '缓存 CSS 风格', + 'setting_styles_viewthread_csscache_comment' => '启用这个设置可以把 CSS 风格缓存成文件,有效降低 HTML 页面文件输出', + 'setting_styles_viewthread_postno' => '文章顺序单位', + 'setting_styles_viewthread_postno_comment' => '设置文章显示顺序编号的单位,如“#”将显示为 1 #', + 'setting_styles_viewthread_postnocustom' => '文章顺序名称', + 'setting_styles_viewthread_postnocustom_comment' => '设置每篇主题所有文章的顺序名称,每行填写一个名称,第一行代表主题帖,第二行代表主题的第一个回复,以此类推', + 'setting_styles_viewthread_maxsmilies' => '最大单一表情解析次数', + 'setting_styles_viewthread_maxsmilies_comment' => '在一篇文章中解析的单一表情符号的最大次数,超过此次数限制的表情将不被解析而保留原样,以避免用户在一篇文章中恶意发表大量表情影响正常阅读,0 为不限制', + 'setting_styles_viewthread_usernamepos' => '作者用户名显示位置', + 'setting_styles_viewthread_imgcontent' => '主题内容生成图片宽度', + 'setting_styles_viewthread_imgcontent_comment' => '本功能需要PHP支持GD库,内容里有中文需要将中文 TTF 字体文件放到 static/image/seccode/font/ch/ 目录下。默认100个汉字,字体不同宽度略有差别,请跟据实际效果调整。', + 'setting_styles_viewthread_fast_reply' => '开启主题帖快速回复', + 'setting_styles_viewthread_fast_reply_comment' => '开启后将在主题帖下方展示快速回复框', + 'setting_styles_viewthread_allow_replybg' => '开启文章快速回复框背景', + 'setting_styles_viewthread_allow_replybg_comment' => '开启后允许给文章快速回复框添加背景图片', + 'setting_styles_viewthread_global_reply_background' => '全局文章快速回复框背景', + 'setting_styles_viewthread_global_reply_background_comment' => '设置全局文章快速回复框背景图片,版块设置优先', + + 'setting_threadprofile' => '布局方案设置', + 'setting_styles_threadprofile' => '帖内用户信息', + 'setting_styles_threadprofile_group' => '用户组方案设置', + 'setting_styles_threadprofile_project' => '布局方案列表', + 'setting_styles_threadprofile_name' => '名称', + 'setting_styles_threadprofile_plan' => '方案', + 'setting_styles_threadprofile_addplan' => '添加新方案', + 'setting_styles_threadprofile_attrcard' => '属性名片', + 'setting_styles_threadprofile_groupicon' => '用户组图标', + 'setting_styles_threadprofile_groupname' => '用户组名称', + 'setting_styles_threadprofile_groupstep' => '等级进度', + 'setting_styles_threadprofile_eccredit_seller' => '卖家信用', + 'setting_styles_threadprofile_eccredit_buyer' => '买家信用', + 'setting_styles_threadprofile_leftinfoprofile' => '左侧信息模板', + 'setting_styles_threadprofile_avatarprofile' => '头像菜单模板', + + 'setting_styles_forumdisplay_disfixednv_viewthread' => '关闭顶部导航固定', + 'setting_styles_forumdisplay_disfixednv_viewthread_comment' => '当向上滚动屏幕时,主导航将即时出现在屏幕的顶部', + 'setting_styles_forumdisplay_disfixedavatar' => '关闭头像区域固定', + 'setting_styles_forumdisplay_disfixedavatar_comment' => '当滚动屏幕时,左侧头像区域将跟随右侧文章内容浮动,填充文章内容区域很高时导致的左侧空白', + 'setting_styles_forumdisplay_threadguestlite' => '游客阅读简化模式', + 'setting_styles_forumdisplay_threadguestlite_comment' => '启用后,游客阅读主题时,将不显示用户的具体资料信息。', + 'setting_styles_viewthread_close_leftinfo' => '关闭左侧信息栏', + 'setting_styles_viewthread_close_leftinfo_comment' => '文章左侧用户信息栏是否默认关闭', + 'setting_styles_viewthread_close_leftinfo_userctrl' => '左侧信息栏允许用户控制', + 'setting_styles_viewthread_close_leftinfo_userctrl_comment' => '浏览主题时,用户是否可以控制左侧信息栏的显示状态', + 'setting_styles_viewthread_guestviewthumb' => '游客看小图', + 'setting_styles_viewthread_guestviewthumb_comment' => '游客浏览主题时,帖内的图片将以指定大小的小图显示,可提高会员注册数和活跃量', + 'setting_styles_viewthread_guestviewthumb_width' => '小图宽度', + 'setting_styles_viewthread_guestviewthumb_width_comment' => '指定小图的宽度,默认值为100', + 'setting_styles_viewthread_guestviewthumb_height' => '小图高度', + 'setting_styles_viewthread_guestviewthumb_height_comment' => '指定小图的高度,默认值为100', + 'setting_styles_viewthread_guesttipsinthread' => '帖内游客登录提示', + 'setting_styles_viewthread_guesttipsinthread_comment' => '游客在浏览主题时,在主题的顶部显示提示文字', + 'setting_styles_viewthread_guesttipsinthread_text' => '登录提示提示文字', + 'setting_styles_viewthread_guesttipsinthread_text_comment' => '自定义显示提示文字,默认为:马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。', + + 'setting_styles_viewthread_vtonlinestatus' => '显示作者在线状态', + 'setting_styles_viewthread_vtonlinestatus_comment' => '是否显示文章作者的在线状态,注意:“精确显示”会轻微加重服务器负担', + 'setting_styles_viewthread_userstatusby' => '显示作者的组头衔', + 'setting_styles_viewthread_userstatusby_comment' => '设置在文章中是否显示作者的用户组头衔', + 'setting_styles_viewthread_userstatusby_usergroup' => '显示用户组头衔(组名)', + 'setting_styles_viewthread_online_easy' => '快速显示(推荐使用)', + 'setting_styles_viewthread_online_exactitude' => '精确显示', + + 'setting_styles_refresh' => '提示信息', + 'setting_styles_refresh_refreshtime' => '提示信息停留时间(秒)', + 'setting_styles_refresh_refreshtime_comment' => '各种提示信息页面显示时间的长短,一般设置为 1-3。较短的提示时间让用户拥有快速的体验,但是也可能让用户无法看清信息', + 'setting_styles_refresh_quick' => '开启直接/快速跳转', + 'setting_styles_refresh_quick_comment' => '对于站点中的某些成功的操作不显示提示信息,直接跳转到下一个页面,例如发帖,回复等等,可以节省用户等待跳转的时间', + 'setting_styles_refresh_messages' => '直接/快速跳转的信息', + 'setting_styles_refresh_messages_comment' => '当开启直接/快速跳转以后,以下信息将会直接跳转。每行填写一个信息的关键字', + + 'setting_follow' => '广播设置', + 'setting_follow_base' => '基本设置', + 'setting_follow_base_default_referer' => '默认查看广播页面', + 'setting_follow_base_default_referer_comment' => '选择“是”则默认查看广播页面;选择“否”则查看个空间页面', + 'setting_follow_base_default_follow_retain_day' => '广播存档时间', + 'setting_follow_base_default_follow_retain_day_comment' => '广播超过多少天移入存档表(单位:天)', + 'setting_follow_base_default_view_profile' => '默认查看个人资料', + 'setting_follow_base_default_view_profile_comment' => '该设置对管理员有效,开启后默认管理员查看将直接查看个人资料页面', + 'setting_follow_base_default_follow_add_notice' => '被关注时通知被关注者', + 'setting_follow_base_default_follow_add_notice_comment' => '开启后用户被关注时将会收到通知', + 'setting_home' => '空间设置', + 'setting_home_base' => '基本设置', + 'setting_home_base_feedday' => '动态保留天数', + 'setting_home_base_feedday_comment' => '(默认为 7)个人动态的保留天数。超过该天数的个人动态会被清理掉,从而可以保证MySQL的效率。建议不要设置太长', + 'setting_home_base_feedmaxnum' => '首页动态显示数', + 'setting_home_base_feedmaxnum_comment' => '(默认为 100)首页显示的好友动态将从这些数目的事件中进行合并显示。建议不要设置太多,从而可以保证MySQL的效率,但最少不能低于50', + 'setting_home_base_showallfriendnum' => '首页动态默认标签设置', + 'setting_home_base_showallfriendnum_comment' => '好友数小于该值的时候显示所有人的动态,超过这个数值显示好友动态。
          在日志、相册列表页面,该参数同样生效', + 'setting_home_base_feedhiddenicon' => '首页动态折叠设置', + 'setting_home_base_feedhiddenicon_comment' => '请输入要折叠显示的动态类型(icon),多个类型之间用半角逗号 "," 隔开。
          + 将某些动态折叠后,可以适当减少首页的动态噪音。
          + 动态类型的获取方法:
          + 在查看好友动态的时候,点击每条动态前面的小图标(例如 ),
          + 浏览器的网址会变为类似如下的链接:
          + http://xxx.com/home.php?mod=space&uid=&do=feed&view=we&icon=blog
          + 其中,icon=blog,就表示该动态类型为 blog', + 'setting_home_base_feedhotnum' => '首页显示热点的数目', + 'setting_home_base_feedhotnum_comment' => '(默认为 3)为0,则首页不显示热点推荐。最大不要超过10个。
          系统会自动获取10个热点,其中,排名第一的热点会固定显示,其余热点会随机显示', + 'setting_home_base_newspacenum' => '首页欢迎新成员选项', + 'setting_home_base_newspacenum_comment' => '显示新成员个数(0为不显示)', + 'setting_home_base_welcome_new_user' => '首页显示欢迎新成员', + 'setting_home_base_new_user_type' => '显示的新成员条件', + 'setting_home_base_new_user_type_avatar' => '已经上传头像', + 'setting_home_base_new_user_type_realname' => '已经实名认证', + 'setting_home_base_feedhotday' => '热点推荐的天数范围', + 'setting_home_base_feedhotday_comment' => '(单位天,默认为 2天)设置首页热点推荐选择的天数范围', + 'setting_home_base_feedhotmin' => '热点推荐的最小热度值', + 'setting_home_base_feedhotmin_comment' => '设置当发布的信息热度值超过多少后,才会显示在推荐里面', + 'setting_home_base_feedtargetblank' => '动态链接新窗口打开', + 'setting_home_base_feedtargetblank_comment' => '如果选择是,用户阅读动态的时候,所有的链接都会在新窗口打开', + 'setting_home_base_updatestat_comment' => '建议开启,记录站点每日的登录人数、发表数、互动数等重点参数,可为站点运营发展提供重要数据依据', + 'setting_home_base_feedread' => '记录动态阅读状态', + 'setting_home_base_feedread_comment' => '如果选择是,该条动态被点击的时候,会变成灰色,以表示已经阅读。(注意,该功能对热点动态无效)', + 'setting_home_base_maxpage' => '列表最大分页数', + 'setting_home_base_maxpage_comment' => '(默认为 100)允许用户查看的最大分页数。当用户查看的分页数越大的时候,对服务器的负载压力就越大', + 'setting_home_base_sendmailday' => '邮件通知更新天数', + 'setting_home_base_sendmailday_comment' => '(默认 0) 单位:天,当用户多少天没有登录站点的时候才会给其发送邮件通知;
          设置为0,则不启用邮件通知功能;
          启用本功能将会轻微增加服务器负载', + 'setting_home_base_recycle_bin' => '开启日志回收站', + 'setting_home_base_recycle_bin_comment' => '打开此功能后,所有被删除日志将被放在回收站中,而不会被直接删除', + + 'setting_home_base_networkpage' => '成员排行榜允许分页浏览', + 'setting_home_base_networkpage_comment' => '该设置只对排行榜中的竞价排行、在线成员、全部成员有效', + 'setting_home_base_topcachetime' => '成员排行榜缓存时间(单位:分钟)', + 'setting_home_base_topcachetime_comment' => '用户排行榜中,除竞价排行、在线成员、全部成员外,其余排行榜是缓存处理的。
          请根据服务器的负载情况,设置合理的更新时间间隔。最少不能低于5分钟', + 'setting_home_base_starcredit' => '星星经验阈值', + 'setting_home_base_starcredit_comment' => '(默认为 100)当用户经验数到此阈值时,增加一个星星。最小为2,否则此功能无效,不显示星星数', + 'setting_home_base_starlevelnum' => '星星升级阈值', + 'setting_home_base_starlevelnum_comment' => '(默认为 5)星星数在达到此阈值时,会升级为高级别的图标。最小为2,否则此项功能无效,始终以星星显示', + 'setting_home_base_groupnum' => '好友用户组个数', + 'setting_home_base_groupnum_comment' => '(默认为 8)设置每个用户最多拥有的好友用户组个数', + 'setting_home_base_default_follow_forum' => '广播帖默认版块', + 'setting_home_base_default_follow_forum_comment' => '选择一个广播帖默认发表版块', + 'setting_home_base_default_poll_forum' => '空间投票帖默认版块', + 'setting_home_base_default_poll_forum_comment' => '选择一个空间投票帖默认发表版块', + 'setting_home_base_default_trade_forum' => '空间商品帖默认版块', + 'setting_home_base_default_trade_forum_comment' => '选择一个空间商品帖默认发表版块', + 'setting_home_base_default_reward_forum' => '空间悬赏帖默认版块', + 'setting_home_base_default_reward_forum_comment' => '选择一个空间悬赏帖默认发表版块', + 'setting_home_base_default_activity_forum' => '空间活动帖默认版块', + 'setting_home_base_default_activity_forum_comment' => '选择一个空间活动帖默认发表版块', + 'setting_home_base_default_debate_forum' => '空间辩论帖默认版块', + 'setting_home_base_default_debate_forum_comment' => '选择一个空间辩论帖默认发表版块', + 'setting_home_base_default_doing' => '默认记录提示内容', + 'setting_home_base_default_doing_comment' => '一行为一个提示内容,这些内容将在记录发表框中显示,随机从这些默认提示中选取一行做为提示内容', + + + 'setting_home_base_allowdomain' => '开启二级域名', + 'setting_home_base_allowdomain_comment' => '二级域名功能需要服务器配置支持 ', + 'setting_home_base_holddomain' => '保留二级域名', + 'setting_home_base_holddomain_comment' => '多个之间用 | 隔开,可以使用通配符* ', + 'setting_home_base_domainroot' => '二级域名根域名', + 'setting_home_realname' => '实名认证', + 'setting_home_realname_switch' => '开启实名', + 'setting_home_realname_switch_comment' => '以下设置只有在开启实名机制后有效;
          注意,开启实名认证会增加服务器负担。 ', + 'setting_home_realname_namecheck' => '实名需手工认证', + 'setting_home_realname_namecheck_comment' => '设置为“是”,则用户填写的姓名只有在被管理者手工认证后才算有效。否则,则自动为认证有效', + 'setting_home_realname_namechange' => '认证实名可再修改', + 'setting_home_realname_namechange_comment' => '填写的姓名经认证有效后,是否允许用户再次修改姓名。
          如果允许修改且手工认证,那么用户修改的新姓名需要再次手工认证后方可有效', + 'setting_home_realname_authority' => '未认证实名权限设置', + 'setting_home_realname_setting' => '实名设置', + 'setting_home_realname_setting_detail' => '请在“用户”-“用户栏目”-“真实姓名”项 设置 是否必填,是否需要审核 等属性', + 'setting_home_realname_allowviewspace' => '允许查看实名用户主页', + 'setting_home_realname_allowfriend' => '允许加好友', + 'setting_home_realname_allowpoke' => '允许打招呼', + 'setting_home_realname_allowdoing' => '允许发记录', + 'setting_home_realname_allowblog' => '允许发日志', + 'setting_home_realname_allowalbum' => '允许使用相册', + 'setting_home_realname_allowpoll' => '允许发投票', + 'setting_home_realname_allowshare' => '允许分享', + 'setting_home_realname_allowfavorite' => '允许收藏', + 'setting_home_realname_allowcomment' => '允许留言/评论', + + 'setting_home_privacy' => '隐私设置', + 'setting_home_privacy_new_user' => '新用户默认隐私设置', + 'setting_home_privacy_view_index' => '个人空间首页', + 'setting_home_privacy_view_profile' => '个人空间资料', + 'setting_home_privacy_alluser' => '全站用户可见', + 'setting_home_privacy_friend' => '仅好友可见', + 'setting_home_privacy_self' => '仅自己可见', + 'setting_home_privacy_register' => '仅注册用户可见', + 'setting_home_privacy_specified_friend' => '仅指定的好友可见', + 'setting_home_privacy_password' => '凭密码查看', + 'setting_home_privacy_view_friend' => '好友列表', + 'setting_home_privacy_view_wall' => '留言板', + 'setting_home_privacy_view_feed' => '动态', + 'setting_home_privacy_view_feed_comment' => '非“全站用户可见”同时限制了动态首页的游客访问', + 'setting_home_privacy_view_doing' => '记录', + 'setting_home_privacy_view_doing_comment' => '在全站的记录列表中可能会出现记录信息。 ', + 'setting_home_privacy_view_blog' => '日志', + 'setting_home_privacy_view_blog_comment' => '相关浏览权限需要在每篇日志中单独设置方可完全生效', + 'setting_home_privacy_view_album' => '相册', + 'setting_home_privacy_view_album_comment' => '相关浏览权限需要在每个相册中单独设置方可完全生效', + 'setting_home_privacy_view_share' => '分享', + 'setting_home_privacy_view_share_comment' => '在全站的分享列表中可能会出现分享信息。 ', + 'setting_home_privacy_view_poll' => '投票', + 'setting_home_privacy_view_poll_comment' => '在全站的投票列表中可能会出现投票信息。 ', + 'setting_home_privacy_default_feed' => '默认动态发布设置', + 'setting_home_privacy_default_feed_doing' => '记录', + 'setting_home_privacy_default_feed_blog' => '撰写日志', + 'setting_home_privacy_default_feed_upload' => '上传图片', + 'setting_home_privacy_default_feed_share' => '添加分享', + 'setting_home_privacy_default_feed_poll' => '发起投票', + 'setting_home_privacy_default_feed_joinpoll' => '参与投票', + 'setting_home_privacy_default_feed_friend' => '添加好友', + 'setting_home_privacy_default_feed_comments' => '发表评论/留言', + 'setting_home_privacy_default_feed_show' => '竞价排名', + 'setting_home_privacy_default_feed_credit' => '积分消费', + 'setting_home_privacy_default_feed_spaceopen' => '新空间开通', + 'setting_home_privacy_default_feed_invite' => '邀请好友', + 'setting_home_privacy_default_feed_task' => '完成任务', + 'setting_home_privacy_default_feed_profile' => '更新个人资料', + 'setting_home_privacy_default_feed_click' => '对日志/图片表态', + 'setting_home_privacy_default_feed_newthread' => '论坛发帖', + 'setting_home_privacy_default_feed_newreply' => '论坛回帖', + + 'setting_home_hotuser' => '推荐成员', + 'setting_home_hotuser_comment' => '添加格式:
          请输入用户名,每个用户名一行。
          例如:
          admin
          webmaster
          这些用户将随机显示在“站长推荐”栏目中', + 'setting_home_hotuser_defaultuser' => '推荐好友', + 'setting_home_hotuser_defaultuser_comment' => '添加格式:
          请输入用户名,每个用户名一行。
          例如:
          admin
          webmaster
          这些用户会自动将新注册用户添加为好友,并向其打个招呼。 + 注意,指定的这几位用户浏览自己的首页时,可能会因其好友数众多而增加服务器负载', + 'setting_home_hotuser_defaultpoke' => '默认打招呼内容', + 'setting_home_hotuser_defaultpoke_comment' => '(不要超过25个汉字)设置自动好友向新人打招呼的内容', + + 'setting_domain' => '域名设置', + 'setting_domain_base' => '基本设置', + 'setting_domain_base_tips' => "
        • 保留二级域名设置后所有人都无法申请或使用该域名
        • 个人空间、圈子的二级域名开启后需要到根域名设置中设置{$_G['setting']['navs'][3]['navname']}、{$_G['setting']['navs'][4]['navname']}的根域名
        • ", + 'setting_domain_app' => '应用域名', + 'setting_domain_app_domain' => '域名', + 'setting_domain_app_tips' => "
        • 各自绑定的域名不能相同,域名不需要添加“http://”,也不要以“/”结尾,例如:portal.discuz.vip
        • 任意开启一项域名,需要配置默认域名,否则会造成多入口问题
        • 当开启多域名时,请在 config/config_global.php 中修改 cookiedomain 值来设置 cookie 作用域
        • ", + 'setting_domain_app_mobile_tips' => '当配置手机域名后,非手机浏览器访问会自动跳转至默认域名', + 'setting_domain_root' => '根域名设置', + 'setting_domain_root_tips' => "
        • 可以为个人空间、{$_G['setting']['navs'][3]['navname']}、版块、专题、频道设置一个二级域名的根域名。例:用户申请XXX.discuz.vip,根域名填:discuz.vip
        • 个人空间、{$_G['setting']['navs'][3]['navname']}设置完二级域名的根后,还需要在基本设置中开启相应的二级域名开关,用户才能在相应的地方申请绑定二级域名,同时受限于用户组的二级域名长度
        • 频道启用二级域名如果是绑定目录的,需要自已在环境中配置相关的绑定操作
        • 不建议中途将不同的根域变更为相同的根域
        • ", + 'setting_domain_allow_space' => '开启个人空间二级域名', + 'setting_domain_allow_space_comment' => '开启后需在设置根域名、以及用户组域名长度后方能开启域名申请', + 'setting_domain_allow_group' => '开启圈子二级域名', + 'setting_domain_allow_group_comment' => '开启后需在设置根域名、以及用户组域名长度后方能开启域名申请', + 'setting_domain_hold_domain' => '保留二级域名', + 'setting_domain_hold_domain_comment' => '多个之间用 | 隔开,可以使用通配符* ', + 'setting_profile_group' => '用户栏目分组', + 'setting_profile_group_setting' => '用户栏目分组设置', + 'setting_profile_group_available' => '显示', + 'setting_profile_group_displayorder' => '显示顺序', + 'setting_profile_group_name' => '栏目分组名称', + 'setting_profile_group_list' => '列表', + 'setting_profile_permission_basic_status' => '自定义头衔', + 'setting_profile_personal_signature' => '个人签名', + 'setting_profile_time_zone' => '时区', + 'setting_profile_tips' => '
        • 用户栏目分组至少必须启用一项,如果都不启用,默认为全部启用
        • ', + + 'setting_threadprofile_tpl_tpls' => '
        • {标记} 不含参数的贴内用户信息标记调用。
        • {标记=参数} 含参数的贴内用户信息标记调用,多个参数用","分割
        • {标记}HTML{*}HTML{/标记} 当有调用内容有值时显示 {*} 前后的 HTML 内容
        • plugin:插件标识”格式的标记为插件增加的贴内用户信息标记调用。插件开发人员在设计新的贴内用户信息标记前请务必仔细阅读《Discuz! 技术文档》中的内容。
        • ', + + 'setting_numbercard' => '用户属性名片', + 'setting_numbercard_row' => '第 {i} 列', + 'setting_numbercard_type_threads' => '主题数', + 'setting_numbercard_type_posts' => '文章数', + 'setting_numbercard_type_digestposts' => '精华数', + 'setting_numbercard_type_credits' => '总积分', + 'setting_numbercard_type_doings' => '记录数', + 'setting_numbercard_type_blogs' => '日志数', + 'setting_numbercard_type_albums' => '相册数', + 'setting_numbercard_type_sharings' => '分享数', + 'setting_numbercard_type_oltime' => '在线时间', + 'setting_numbercard_type_feeds' => '广播数', + 'setting_numbercard_type_follower' => '听众数量', + 'setting_numbercard_type_following' => '收听数量', + 'setting_numbercard_type_friends' => '好友数', + + 'district' => '地区设置', + 'district_tips' => '
        • 您可以自己编辑地区数据
        • 添加,编辑或删除操作后需要点击“提交”按钮才生效
        • ', + 'district_choose' => '选择地区', + 'district_birthcity' => '出生地', + 'district_residecity' => '居住地', + + 'misc_focus' => '站长推荐', + 'misc_focus_handadd' => '手动添加', + 'misc_focus_threadadd' => '添加主题', + 'misc_focus_autoadd' => '自动添加', + 'misc_focus_tips' => '
        • 站长推荐将以浮窗的形式显示在文章内容页面右下角。
        • 您可以手动添加一些指定的主题,或者选择一些版主推荐的主题。最多 10 条,每次随机显示其中 1 条。
        • ', + 'misc_focus_add_tips' => '
        • 输入文章地址自动获取标题和内容
        • ', + 'misc_focus_threadurl' => '文章地址', + 'misc_focus_get_threadcontent' => '获取文章内容', + 'misc_focus_reget_threadcontent' => '重新获取文章内容', + 'misc_focus_handurl' => '推荐链接地址', + 'misc_focus_handsubject' => '推荐标题', + 'misc_focus_handsummary' => '推荐内容', + 'misc_focus_handsummary_comment' => '此处支持 HTML 代码,建议少于150个字符', + 'misc_focus_handimg' => '附加图片', + 'misc_focus_handimg_comment' => '请填写图片的绝对路径', + 'misc_focus_recommend_tips' => '
        • 您可以选择一些版主推荐的主题作为站长推荐。
        • ', + 'misc_focus_recommender' => '推荐人', + 'misc_focus_edit' => '编辑站长推荐', + 'misc_focus_topic_subject' => '标题', + 'misc_focus_topic_msg' => '摘要', + 'misc_focus_image' => '图片', + 'misc_focus_image_comment' => '从该主题的图片附件中选择一个作为站长推荐的图片展示', + 'misc_focus_noimage' => '不使用图片', + 'misc_focus_invalidurl' => '无效的文章地址,请重新输入!', + 'misc_focus_nothread' => '指定的主题不存在,请重新输入!', + 'misc_focus_area_title' => '站长推荐区域标题', + 'misc_focus_area_title_comment' => '默认为“站长推荐”,您可以设置为您希望的标题', + 'misc_focus_area_cookie' => '设置关闭后可再次弹出的时间(小时)', + 'misc_focus_area_cookie_comment' => '0表示再刷新页面就会弹出。1表示1小时后刷新页面才会出现。默认为1,可以设置为您希望弹出的时间 +', + 'misc_focus_position' => '站长推荐投放区域', + 'misc_focus_position_portal' => '门户', + 'misc_focus_position_home' => '空间', + 'misc_focus_position_member' => '登录/注册', + 'misc_focus_position_forum' => '论坛', + 'misc_focus_position_group' => '圈子', + 'misc_focus_position_search' => '搜索', + + 'setting_faq_title' => '查看更多提示', + + 'setting_optimize' => '性能优化', + + 'setting_seo' => '搜索引擎优化', + 'setting_seo_insallowcode' => '可用代码,点击插入', + 'setting_seo_opendetail' => '展开详细设置', + 'setting_seo_closedetail' => '收起详细设置', + 'setting_seo_portal' => '门户首页', + 'setting_seo_global_tips' => '
        • 插入的变量必需包括花括号“{}”,当应用范围不支持该变量时,该变量将不会在前台显示(变量后边的分隔符也不会显示),留空为系统默认设置,SEO自定义支持手写。
          以下是可用SEO变量: 
        • ', + 'setting_seo_portal_tips' => '
        • 站点名称 {bbname}(应用范围:所有位置)
        • 当前频道名称 {curcat}(应用范围:除首页以外)
        • 一级频道名称 {firstcat}(应用范围:除首页以外)
        • 二级频道名称 {secondcat}(应用范围:除首页以外)
        • 文章标题 {subject}(应用范围:文章内容页)
        • 文章摘要 {summary}(应用范围:文章内容页)
        • 文章作者 {user}(应用范围:文章内容页)
        • 分页数 {page}(应用范围:文章列表页、文章内容页)
        • ', + 'setting_seo_articlelist' => '文章列表', + 'setting_seo_article' => '文章内容', + 'setting_seo_forum' => '论坛首页', + 'setting_seo_forum_tips' => '
        • 站点名称 {bbname}(应用范围:所有位置)
        • 当前版块名称 {forum}(应用范围:除首页以外)
        • 一级版块名称 {fup}(应用范围:子版块主题列表页和文章内容页)
        • 分区名称 {fgroup}(应用范围:除首页以外)
        • 文章标题 {subject}(应用范围:文章内容页)
        • 主题摘要 {summary}(应用范围:文章内容页)
        • 主题标签 {tags}(应用范围:文章内容页)
        • 分页数 {page}(应用范围:主题列表页、文章内容页)
        • ', + 'setting_seo_threadlist' => '主题列表', + 'setting_seo_viewthread' => '文章内容', + 'setting_seo_home' => '家园首页', + 'setting_seo_home_tips' => '
        • 站点名称 {bbname}(应用范围:所有位置)
        • 日志标题 {subject}(应用范围:日志内容页)
        • 日志/相册作者 {user}(应用范围:日志和相册内容页)
        • 日志摘要 {summary}(应用范围:日志内容页)
        • 日志标签 {tags}(应用范围:日志内容页)
        • 相册名称 {album}(应用范围:相册内容页)
        • 相册描述 {depict}(应用范围:相册内容页)
        • ', + 'setting_seo_blog' => '日志内容', + 'setting_seo_album' => '相册内容', + 'setting_seo_group' => '圈子首页/分类', + 'setting_seo_group_tips' => '
        • 站点名称 {bbname}(应用范围:所有位置)
        • 当前圈子名称 {forum}(应用范围:除圈子首页、分类页)
        • 一级分类名称 {first}(应用范围:所有位置)
        • 二级分类名称 {second}(应用范围:所有位置)
        • 当前圈子简介 {gdes}(应用范围:圈子和圈子文章页)
        • 文章标题 {subject}(应用范围:圈子文章页)
        • 主题摘要 {summary}(应用范围:圈子文章页)
        • 主题标签 {tags}(应用范围:圈子文章内容页)
        • 分页数 {page}(应用范围:主题列表页、文章内容页)
        • ', + 'setting_seo_grouppage' => '单一圈子页面', + 'setting_seo_viewthread_group' => '圈子文章内容', + 'setting_seo_seotitle' => 'title', + 'setting_seo_seotitle_comment' => '设置这里的标题会替换以下模块页面的模块标题,可以使用 {bbname} 表示当前的站点名称', + 'setting_seo_seokeywords' => 'keywords', + 'setting_seo_seokeywords_comment' => 'keywords出现在页面头部的 Meta 标签中,用于记录本页面的关键字,多个关键字间请用半角逗号 "," 隔开', + 'setting_seo_seodescription' => 'description', + 'setting_seo_seodescription_comment' => 'description出现在页面头部的 Meta 标签中,用于记录本页面的概要与描述', + 'setting_seo_code_bbname' => '站点名称', + 'setting_seo_code_articlelist_curcat' => '当前频道名称', + 'setting_seo_code_articlelist_firstcat' => '一级频道名称', + 'setting_seo_code_articlelist_secondcat' => '二级频道名称', + 'setting_seo_code_articlelist_page' => '频道文章列表分页数', + 'setting_seo_code_article_curcat' => '当前频道名称', + 'setting_seo_code_article_firstcat' => '一级频道名称', + 'setting_seo_code_article_secondcat' => '二级频道名称', + 'setting_seo_code_article_subject' => '文章标题', + 'setting_seo_code_article_summary' => '文章摘要', + 'setting_seo_code_article_user' => '文章作者', + 'setting_seo_code_article_page' => '文章分页数', + 'setting_seo_code_threadlist_forum' => '当前版块名称', + 'setting_seo_code_threadlist_fup' => '一级版块名称', + 'setting_seo_code_threadlist_fgroup' => '分区名称', + 'setting_seo_code_threadlist_page' => '版块主题列表分页数', + 'setting_seo_code_viewthread_forum' => '当前版块名称', + 'setting_seo_code_viewthread_fup' => '一级版块名称', + 'setting_seo_code_viewthread_fgroup' => '分区名称', + 'setting_seo_code_viewthread_subject' => '主题标题', + 'setting_seo_code_viewthread_summary' => '主题摘要', + 'setting_seo_code_viewthread_tags' => '主题标签', + 'setting_seo_code_viewthread_page' => '文章分页数', + 'setting_seo_code_blog_subject' => '日志标题', + 'setting_seo_code_blog_summary' => '日志摘要', + 'setting_seo_code_blog_tags' => '日志标签', + 'setting_seo_code_blog_user' => '日志作者', + 'setting_seo_code_album_album' => '相册名称', + 'setting_seo_code_album_depict' => '相册描述', + 'setting_seo_code_album_user' => '相册作者', + 'setting_seo_code_group_forum' => '当前圈子名称', + 'setting_seo_code_group_first' => '一级分类名称', + 'setting_seo_code_group_second' => '二级分类名称', + 'setting_seo_code_grouppage_forum' => '当前圈子名称', + 'setting_seo_code_grouppage_first' => '一级分类名称', + 'setting_seo_code_grouppage_second' => '二级分类名称', + 'setting_seo_code_grouppage_gdes' => '当前圈子简介', + 'setting_seo_code_grouppage_page' => '圈子主题列表分页数', + 'setting_seo_code_viewthread_group_forum' => '当前圈子名称', + 'setting_seo_code_viewthread_group_first' => '一级分类名称', + 'setting_seo_code_viewthread_group_second' => '二级分类名称', + 'setting_seo_code_viewthread_group_gdes' => '当前圈子简介', + 'setting_seo_code_viewthread_group_subject' => '主题标题', + 'setting_seo_code_viewthread_group_summary' => '主题摘要', + 'setting_seo_code_viewthread_group_tags' => '主题标签', + 'setting_seo_code_viewthread_group_page' => '文章分页数', + + 'setting_seo_seohead' => '其他头部信息', + 'setting_seo_seohead_comment' => '如需在 <head></head> 中添加其他的 HTML 代码,可以使用本设置,否则请留空', + 'setting_seo_rewritestatus' => 'URL 静态化', + 'setting_seo_pages' => '页面', + 'setting_seo_vars' => '标记', + 'setting_seo_rule' => '格式', + 'setting_seo_robots_output' => '生成 robots.txt', + 'setting_seo_rewritestatus_forum_forumdisplay' => '论坛主题列表页', + 'setting_seo_rewritestatus_forum_viewthread' => '论坛主题内容页', + 'setting_seo_rewritestatus_home_space' => '用户个人主页', + 'setting_seo_rewritestatus_home_blog' => '用户日志内容页', + 'setting_seo_rewritestatus_group_group' => '圈子主题列表页', + 'setting_seo_rewritestatus_portal_topic' => '门户专题页', + 'setting_seo_rewritestatus_portal_article' => '门户文章页', + 'setting_seo_rewritestatus_forum_archiver' => '论坛 Archiver 页', + 'setting_seo_rewritestatus_plugin' => '插件', + 'setting_seo_rewritestatus_comment' => 'URL 静态化可以提高搜索引擎抓取,开启本功能需要对 Web 服务器增加相应的 Rewrite 支持,且会轻微增加服务器负担。同时您还可以调整每个页面的静态格式,但不得删除其中的标记,重置静态格式请留空。注意,修改静态格式后您需要修改服务器的 Rewrite 规则设置', + 'setting_seo_rewritestatus_viewrule' => '查看当前的 Rewrite 规则', + 'setting_seo_rewritecompatible' => 'Rewrite 兼容性', + 'setting_seo_rewritecompatible_comment' => '如果您的服务器不支持 Rewrite 规则中的中文字符,请选择“是”。对于没有此问题的服务器,可以选择“否”', + 'setting_seo_rewriteguest' => '仅对游客有效', + 'setting_seo_rewriteguest_comment' => '开启此项,则 Rewrite 功能只对游客和搜索引擎有效,可减轻服务器负担', + 'setting_seo_rewritemobile' => '手机版模式 Rewrite', + 'setting_seo_rewritemobile_comment' => '开启此项,则 Rewrite 功能将同时对手机版有效,可能会影响极少数手机正常工作', + + 'setting_cachethread' => '论坛页面缓存设置', + 'setting_cachethread_comment' => '开启后,缓存页面内容到静态文件,游客访问时速度将大大提升,建议独立服务器使用,虚拟空间请根据实际情况调节缓存的有效期', + 'setting_cachethread_indexlife' => '缓存论坛首页有效期', + 'setting_cachethread_indexlife_comment' => '设置论坛首页缓存更新的时间,单位为秒,0 为关闭(此处关闭以后,缓存系数将不再起作用),建议设置为 900。此功能只针对游客', + 'setting_cachethread_life' => '缓存文章有效期', + 'setting_cachethread_life_comment' => '设置文章页面缓存更新的时间,单位为秒,0 为关闭。请根据实际情况进行调整,建议设置为 900。另外,请通过编辑论坛来指定文章页面缓存系数', + 'setting_cachethread_dir' => '缓存目录', + 'setting_cachethread_dir_comment' => '默认为 data/threadcache 目录,如果您需要将其指定为其他目录,请确定您指定的目录有可写权限', + 'setting_cachethread_coefficient_set' => '缓存系数批量设置', + 'setting_cachethread_coefficient' => '缓存系数', + 'setting_cachethread_coefficient_comment' => '页面缓存功能可以将会员经常访问的主题临时缓存起来,缓解大型论坛服务器压力。缓存阈值范围 0 - 100,建议设置为 40 ,0 为关闭。在磁盘空间允许的情况下,适当调高缓存系数,可以提高缓存效果', + 'setting_cachethread_coefficient_forum' => '请选择要设置的论坛', + 'setting_cachethread_coefficient_forum_comment' => '将会覆盖以前的缓存系数值,可以按住 CTRL 多选', + + 'setting_memory' => '内存优化', + 'setting_memory_tips' => '
        • 启用内存优化功能将会大幅度提升程序性能和服务器的负载能力,内存优化功能需要服务器系统以及PHP扩展模块支持
        • 目前支持的内存优化接口有 Memcache、eAccelerator、Alternative PHP Cache(APC)、Xcache、Redis、YAC、APCu,优化系统将会依据当前服务器环境依次选用接口
        • 内存接口的主要设置位于 config_global.php 当中,您可以通过编辑 config_global.php 进行高级设置
        • ', + 'setting_memory_status' => '当前内存工作状态', + 'setting_memory_php_enable' => '支持', + 'setting_memory_php_disable' => '不支持', + 'setting_memory_clear' => '内存清理', + 'setting_memory_do_clear' => ' (清理完毕)', + 'setting_memory_function' => '内存优化功能设置', + 'setting_memory_state_interface' => '内存接口', + 'setting_memory_state_extension' => 'PHP 扩展环境', + 'setting_memory_state_config' => 'Config 设置', + 'setting_memory_func' => '功能模块', + 'setting_memory_func_enable' => '是否开启', + 'setting_memory_func_ttl' => '自动更新时间(秒)', + 'setting_memory_func_forumindex' => '论坛首页', + 'setting_memory_func_forumindex_comment' => '推荐开启,时间设置为30秒,用户组ID或\'for_robot\'为单位,缓存时间内数据不更新', + 'setting_memory_func_diyblock' => 'DIY 模块数据', + 'setting_memory_func_diyblock_comment' => '推荐开启,时间设置为300秒,5分钟,模块ID为单位,缓存时间内数据不更新', + 'setting_memory_func_diyblockoutput' => 'DIY 模块输出', + 'setting_memory_func_diyblockoutput_comment' => '推荐开启,时间设置为30秒,模块ID为单位,缓存时间内数据不更新', + 'setting_memory_func_common_member' => '用户数据', + 'setting_memory_func_common_member_comment' => '推荐开启,时间设置为0,永不过期,UID为单位,表数据更新时缓存数据会同步更新', + 'setting_memory_func_forum_forum' => '版块数据', + 'setting_memory_func_forum_forum_comment' => '推荐开启,时间设置为0,永不过期,FID为单位,表数据更新时缓存数据会同步更新', + 'setting_memory_func_forum_thread' => '主题数据', + 'setting_memory_func_forum_thread_comment' => '推荐开启,时间设置为172800秒,两天,TID为单位,表数据更新时缓存数据会同步更新', + 'setting_memory_func_forum_thread_forumdisplay' => '版块列表数据', + 'setting_memory_func_forum_thread_forumdisplay_comment' => '推荐开启,时间设置为300秒,5分钟,FID为单位,第一页数据缓存,缓存时间内数据不更新', + 'setting_memory_func_forum_postcache' => '回帖点评和评分数据', + 'setting_memory_func_forum_postcache_comment' => '推荐开启,时间设置为300秒,5分钟,PID为单位,缓存时间内数据不更新', + 'setting_memory_func_forum_collection' => '主题专辑数据', + 'setting_memory_func_forum_collection_comment' => '推荐开启,时间设置为300秒,5分钟,TID为单位,此TID的专辑集合,缓存时间内数据不更新', + 'setting_memory_func_forum_collectionrelated' => '主题和专辑关系', + 'setting_memory_func_forum_collectionrelated_comment' => '推荐开启,时间设置为0,永不过期,TID为单位,此TID的专辑ID集合,表数据更新时缓存数据会同步更新', + 'setting_memory_func_home_follow' => '用户关注关系数据', + 'setting_memory_func_home_follow_comment' => '推荐开启,时间设置为86400秒,一天,UID为单位,此UID关注用户的关系数据,缓存时间内数据不更新', + + 'setting_memorydata' => '内存缓存管理', + 'setting_memorydata_rm_cache_key' => '删除缓存KEY', + 'setting_memory_data_forumindex_comment' => '用户组ID或\'for_robot\'', + 'setting_memory_data_diyblock_comment' => '模块BID', + 'setting_memory_data_diyblockoutput_comment' => '模块BID', + 'setting_memory_data_common_member_comment' => '用户UID', + 'setting_memory_data_forum_forum_comment' => '版块FID', + 'setting_memory_data_forum_post_comment' => '主题TID', + 'setting_memory_data_forum_thread_comment' => '主题TID', + 'setting_memory_data_forum_thread_forumdisplay_comment' => '版块FID', + 'setting_memory_data_forum_postcache_comment' => '文章PID', + 'setting_memory_data_forum_collection_comment' => '主题TID', + 'setting_memory_data_forum_collectionrelated_comment' => '主题TID', + 'setting_memory_data_home_follow_comment' => '用户UID', + + 'setting_serveropti' => '服务器优化', + 'setting_serveropti_maxonlines' => '最大在线人数', + 'setting_serveropti_maxonlines_comment' => '请设置合理的数值,范围 10~65535,建议设置为平均在线人数的 10 倍左右', + 'setting_serveropti_onlinehold' => '在线保持时间(分钟)', + 'setting_serveropti_onlinehold_comment' => '请根据访问情况设置合理的数值,访问量大的站点应当调小该数值,设置范围 5 - 60,过大或者过小的设置都有可能会增大服务器资源开销', + 'setting_serveropti_jspath' => 'JS 文件 URL', + 'setting_serveropti_jspath_comment' => '设置站点 JS 文件的 URL。当设置为缓存目录时,系统会将系统目录中的 *.js 文件进行压缩然后保存到缓存目录以提高读取速度和用户访问速度', + 'setting_serveropti_jspath_default' => '系统目录 static/js/', + 'setting_serveropti_jspath_cache' => '缓存目录', + 'setting_serveropti_jspath_custom' => '自定义 URL', + 'setting_serveropti_csspath' => 'CSS 文件 URL', + 'setting_serveropti_csspath_comment' => '设置站点 CSS 文件缓存的 URL。更改此设置后您需要更新模板缓存', + 'setting_serveropti_csspath_cache' => '缓存目录', + 'setting_serveropti_csspath_custom' => '自定义 URL', + 'setting_serveropti_searchctrl' => '搜索时间限制(秒)', + 'setting_serveropti_searchctrl_comment' => '两次搜索间隔小于此时间将被禁止,0 为不限制', + 'setting_serveropti_maxspm' => '60 秒最大搜索次数
          ', + 'setting_serveropti_maxspm_comment' => '站点系统每 60 秒系统响应的最大搜索次数,0 为不限制。注意: 如果服务器负担较重,建议设置为 5,或在 5~20 范围内取值,以避免过于频繁的搜索造成数据表被锁', + 'setting_serveropti_maxsearchresults' => '最大搜索结果', + 'setting_serveropti_maxsearchresults_comment' => '每次搜索获取的最大结果数,建议设置为默认值 500,或在不超过 1500 范围内取值', + 'setting_serveropti_gzipcompress' => '页面 Gzip 压缩', + 'setting_serveropti_gzipcompress_comment' => '将页面内容以 gzip 压缩后传输,可以加快传输速度,需 PHP 4.0.4 以上且支持 Zlib 模块才能使用', + 'setting_serveropti_gzipcompress_disabled' => '您的空间不支持 Zlib 模块,不能开启此功能', + 'setting_serveropti_optimize_thread_view' => '是否优化更新主题浏览量', + 'setting_serveropti_preventrefresh' => '查看数开启防刷新', + 'setting_serveropti_preventrefresh_comment' => '选择“否”,主题、空间、日志每访问一次,浏览量增1,会增大服务器压力,建议选择“是”', + 'setting_serveropti_delayviewcount' => '附件下载量延迟更新', + 'setting_serveropti_delayviewcount_attach' => '附件下载量', + 'setting_serveropti_delayviewcount_thread_attach' => '主题浏览量和附件下载量', + 'setting_serveropti_delayviewcount_comment' => '延迟更新附件的浏览量,可明显降低访问量很大的站点的服务器负担,建议开启本功能', + 'setting_serveropti_nocacheheaders' => '禁止浏览器缓冲', + 'setting_serveropti_nocacheheaders_comment' => '禁止浏览器对站点页面进行缓冲,可用于解决极个别浏览器内容刷新不正常的问题。注意: 本功能会加重服务器负担', + 'setting_serveropti_lazyload' => '开启图片延时加载', + 'setting_serveropti_lazyload_comment' => '当开启后,页面中的图片在浏览器的当前窗口时再加载,可明显降低访问量很大的站点的服务器负担,建议开启本功能', + 'setting_serveropti_blockmaxaggregationitem' => '参与模块聚合数据条数', + 'setting_serveropti_blockmaxaggregationitem_comment' => '此值影响模块聚合时MYSQL检索数据的条数,设置太大将严重影响MYSQL的性能,设置太小将会影响模块聚合结果数据的理想程度。0为关闭此功能', + 'setting_serveropti_blockcachetimerange' => '模块更新时间区间', + 'setting_serveropti_blockcachetimerange_comment' => '设置全部模块在指定的时间区间内更新。可以根据网站的访问情况,避开访问高峰时间段。如:3点-7点', + 'setting_serveropti_blockcachetimerangepoint' => '点', + 'setting_serveropti_sessionclose' => '是否关闭session机制', + 'setting_serveropti_sessionclose_comment' => '关闭session机制以后,可明显降低站点的服务器负担,建议在线用户数超过2万时开启本功能(注意:游客数和用户的在线时长将不再进行统计,论坛首页和版块列表页面的在线用户列表功能将不可用)', + 'setting_serveropti_onlineguestsmultiple' => '在线人数测算比例', + 'setting_serveropti_onlineguestsmultiple_comment' => '关闭session机制以后,总在线人(包括游客和用户) ≈ 实际在线用户数 * 在线人数测算比例,建议值为10左右,可为浮点数(注意:实际在线用户数缓存周期为600秒)', + + 'setting_functions' => '站点功能', + + 'setting_functions_curscript' => '功能模块', + 'setting_functions_curscript_scriptclosed_portal' => '是否开启门户功能', + 'setting_functions_curscript_scriptclosed_portal_comment' => '关闭门户后,频道和发布文章的功能将不能使用。但是不会影响其他页面的 DIY 和模块聚合功能', + 'setting_functions_curscript_scriptclosed_group' => '是否开启圈子功能', + 'setting_functions_curscript_scriptclosed_group_comment' => '关闭圈子后,圈子相关的所有功能将不能使用', + 'setting_functions_curscript_scriptclosed_home' => '是否开启家园功能', + 'setting_functions_curscript_scriptclosed_home_comment' => '关闭家园后,站点将不再产生用户动态,用户将不能够使用记录,日志,相册和分享功能,同时个人资料页面不支持自定义', + 'setting_functions_curscript_list' => '功能列表', + 'setting_functions_curscript_open' => '开启', + 'setting_functions_curscript_close' => '关闭', + 'setting_functions_curscript_portal' => '门户', + 'setting_functions_curscript_forum' => '论坛', + 'setting_functions_curscript_group' => '圈子', + 'setting_functions_curscript_follow' => '广播', + 'setting_functions_curscript_collection' => '淘帖', + 'setting_functions_curscript_guide' => '导读', + 'setting_functions_curscript_feed' => '动态', + 'setting_functions_curscript_friend' => '好友', + 'setting_functions_curscript_blog' => '日志', + 'setting_functions_curscript_album' => '相册', + 'setting_functions_curscript_share' => '分享', + 'setting_functions_curscript_doing' => '记录', + 'setting_functions_curscript_message' => '留言板', + 'setting_functions_curscript_ranklist' => '排行榜', + 'setting_functions_curscript_medal' => '勋章', + 'setting_functions_curscript_task' => '任务', + 'setting_functions_curscript_magic' => '道具', + 'setting_functions_curscript_favorite' => '收藏', + 'setting_functions_curscript_portal_intro' => '通过门户,网站可以将最热门的文章、文章、活动等信息展现给用户', + 'setting_functions_curscript_forum_intro' => '通过论坛,网站可以给用户提供在线讨论、交流、互动的平台', + 'setting_functions_curscript_group_intro' => '志同道合者的聚集地,更加专业更加隐秘的交流乐园', + 'setting_functions_curscript_follow_intro' => '收听感兴趣的人,分享有趣的事儿,信息快速传播的利器', + 'setting_functions_curscript_collection_intro' => '网站优质内容的收集与分类,网站内容运营必不可少的好帮手', + 'setting_functions_curscript_guide_intro' => '自动聚合网站最具争议、最热门、最精华、最新发布等“最”主题', + 'setting_functions_curscript_feed_intro' => '了解网站关注好友网站动向的直接渠道,让用户不再感觉孤独', + 'setting_functions_curscript_friend_intro' => '结交感兴趣的人,了解感兴趣的事儿,情感快速蔓延的渠道', + 'setting_functions_curscript_blog_intro' => '记录每日见闻,分享人生感悟,用户感情宣泄的家园', + 'setting_functions_curscript_album_intro' => '自己的美丽容颜,祖国的大好河山,各种美图的影像档案', + 'setting_functions_curscript_share_intro' => '将网站精华内容推荐给其他网友,形成良好的共享氛围', + 'setting_functions_curscript_doing_intro' => '分享灵感,表达心情,记录随时想到的人和事儿', + 'setting_functions_curscript_message_intro' => '通过留言,可以让其他用户不会错过你的互动', + 'setting_functions_curscript_ranklist_intro' => '通过排行榜,可以查看本站的相关排行内容', + 'setting_functions_curscript_medal_intro' => '彰显用户在某一方面的特殊贡献,调动用户积极性', + 'setting_functions_curscript_task_intro' => '缩短用户适应时间,让用户快速融入站点', + 'setting_functions_curscript_magic_intro' => '提供丰富多彩的娱乐功能,提升站点交互性和活跃度', + 'setting_functions_curscript_favorite_intro' => '让用户记录喜爱的内容,增加用户留存和用户粘性', + + 'setting_functions_mod' => '管理相关', + 'setting_functions_mod_updatestat' => '开启站点趋势统计', + 'setting_functions_mod_updatestat_comment' => '站点趋势统计可以使站长了解到站点的运作状况。注意: 本功能会轻微加重系统负担', + 'setting_functions_mod_status' => '开启论坛管理工作统计', + 'setting_functions_archiver' => '开启论坛 Archiver 功能', + 'setting_functions_archiver_comment' => '论坛 Archiver 能够将论坛公开的内容模拟成静态页面,以便搜索引擎获取其中的内容', + 'setting_functions_archiverredirect' => '禁止用户访问 Archiver', + 'setting_functions_archiverredirect_comment' => '选择“是”,当用户通过搜索引擎中的链接访问 Archiver 页时将自动跳转到原始内容页', + 'setting_functions_mod_status_comment' => '论坛管理工作统计可以使版主、管理员了解论坛版主等管理人员的工作状况。注意: 本功能会轻微加重系统负担', + 'setting_functions_mod_maxmodworksmonths' => '管理记录保留时间(月)', + 'setting_functions_mod_maxmodworksmonths_comment' => '系统中保留管理记录的时间,默认为 3 个月,建议在 3~6 个月的范围内取值', + 'setting_functions_mod_losslessdel' => '删帖不减积分时间期限(天)', + 'setting_functions_mod_losslessdel_comment' => '设置版主或管理员从前台删除发表于多少天以前的文章时,不更新用户的扩展积分,可用于清理老文章而不对作者的扩展积分造成损失。0 为不使用此功能,始终更新用户积分', + 'setting_functions_mod_warninglimit' => '用户被警告多少次自动禁言', + 'setting_functions_mod_warninglimit_comment' => '警告有效期结束自动解除禁言', + 'setting_functions_mod_warningexpiration' => '警告有效期(天)', + 'setting_functions_mod_warningexpiration_comment' => '默认为 30 天', + 'setting_functions_mod_reasons' => '管理操作理由选项', + 'setting_functions_user_reasons' => '用户评分理由选项', + 'setting_functions_mod_user_public' => '是否公开管理操作人员', + 'setting_functions_mod_user_public_comment' => '开启后主题管理操作人员显示为用户的用户名和 UID ,反之主题管理操作人员将只显示为 “管理团队” 而不显示具体信息,同时适用于系统提醒和操作记录', + 'setting_functions_mod_reasons_public' => '是否公开管理操作理由', + 'setting_functions_mod_reasons_comment' => '本设定将在用户执行部分管理操作时显示,每个理由一行,如果空行则显示一行分隔符“--------”,用户可选择本设定中预置的理由选项或自行输入', + 'setting_functions_mod_reasons_public_comment' => '开启后点击主题帖下方主题操作记录将同时显示管理操作理由', + 'setting_functions_user_reasons_comment' => '本设定将在用户执行评分时显示,每个理由一行,如果空行则显示一行分隔符“--------”,用户可选择本设定中预置的理由选项或自行输入', + 'setting_functions_mod_bannedmessages' => '隐藏敏感文章内容', + 'setting_functions_mod_bannedmessages_comment' => '选择相应项目将隐藏被删除或被禁止的用户的相关资料,在相关资料处显示被屏蔽的字样', + 'setting_functions_mod_bannedmessages_thread' => '文章内容', + 'setting_functions_mod_bannedmessages_avatar' => '用户头像', + 'setting_functions_mod_bannedmessages_signature' => '用户签名', + 'setting_functions_mod_rewardexpiration' => '悬赏主题有效期', + 'setting_functions_mod_rewardexpiration_comment' => '设置悬赏主题的有效天数,当悬赏主题超过有效期后依然未发放悬赏,版主或管理员有权代为主题作者发放悬赏。0 或留空表示不允许版主或管理员进行此操作', + 'setting_functions_mod_moddetail' => '版主面板显示审核数目', + 'setting_functions_mod_moddetail_comment' => '设置版主面板是否详细显示待审核主题、文章及用户的具体数目', + 'setting_functions_heatthread_tips' => '
        • 主题热度将按参与人次计算,包括回帖,点评,收藏,分享,评分,推荐
        • ', + 'setting_functions_heatthread' => '主题热度', + 'setting_functions_heatthread_type' => '热度计算方式', + 'setting_functions_heatthread_type_comment' => '切换热度计算方式后,主题之前已获得的热度值不会被重新计算,之后的热度值按照新的计算方式增加', + 'setting_functions_heatthread_type_1' => '按热度公式', + 'setting_functions_heatthread_type_2' => '按参与人次', + 'setting_functions_heatthread_type_2_comment' => '按参与人次', + 'setting_functions_heatthread_period' => '用户热度值周期(天)', + 'setting_functions_heatthread_period_comment' => '以天为单位,一个周期内某用户多次参与主题,只加一次热度。0代表不设置周期,只要参与一次,热度就加1。为避免用户刷热度,建议不要设置为0。(回复、点评、评论、收藏、分享等都算作参与主题的动作)', + 'setting_functions_heatthread_guidelimit' => '热度值聚合下限', + 'setting_functions_heatthread_guidelimit_comment' => '导读功能中收集热门主题时的热度值下限,默认值“3”', + 'setting_functions_heatthread_reply' => '单次回复热度值', + 'setting_functions_heatthread_reply_comment' => '主题每次被回复时主题热度增量,默认值“5”', + 'setting_functions_heatthread_recommend' => '单次评价热度值', + 'setting_functions_heatthread_recommend_comment' => '主题每次被评价时主题热度增量,默认值“3”', + 'setting_functions_heatthread_iconlevels' => '热门主题显示级别', + 'setting_functions_heatthread_iconlevels_comment' => '设置主题列表页主题图标每一级别对应的热度指数,默认为 3 个级别,请用逗号分隔,如:“50,100,200”表示当主题的热度大于 50 时为 1 级,大于 100 时为 2 级,大于 200 时为 3 级。留空表示不显示图标', + 'setting_functions_recommend' => '主题评价', + 'setting_functions_recommend_tips' => '
        • 不同用户组会员的主题评价影响值不同,您可以在”用户组”设置的“文章相关”中设置。
        • ', + 'setting_functions_recommend_status' => '启用主题评价', + 'setting_functions_recommend_status_comment' => '主题评价是让用户参与主题热度的重要指标,您可以设定用户在每天允许执行的评价次数', + 'setting_functions_recommend_addtext' => '加分操作文字', + 'setting_functions_recommend_addtext_comment' => '设置评价加分的文字,不宜过长。建议使用“顶”、“支持”', + 'setting_functions_recommend_subtracttext' => '减分操作文字', + 'setting_functions_recommend_subtracttext_comment' => '设置评价减分的文字,不宜过长。建议使用“踩”、“反对”', + 'setting_functions_recommend_defaultshow' => '隐藏主题评价指数', + 'setting_functions_recommend_defaultshow_comment' => '设置是否隐藏主题的评价结果数值', + 'setting_functions_recommend_defaultshow_0' => '是', + 'setting_functions_recommend_defaultshow_1' => '否', + 'setting_functions_recommend_daycount' => '每 24 小时评价主题次数', + 'setting_functions_recommend_daycount_comment' => '设置用户每 24 小时可以评价多少篇主题,0 或留空为不限制', + 'setting_functions_recommend_ownthread' => '是否允许评价自己的文章', + 'setting_functions_recommend_ownthread_comment' => '设置是否允许评价自己的主题。评价自己的主题无积分奖励', + 'setting_functions_recommend_iconlevels' => '评价图标显示级别', + 'setting_functions_recommend_iconlevels_comment' => '设置主题列表页评价图标每一级别对应的评价指数。建议为 3 个级别,请用逗号分隔,如:“0,100,200”表示当主题的评价指数大于 0 时为 1 级,大于 100 时为 2 级,大于 200 时为 3 级。1 级及以上级别的主题会在主题列表页“查看好评主题”中列出。留空或者 0 表示不显示图标', + 'setting_functions_comment' => '文章点评', + 'setting_functions_comment_allow' => '点评方式', + 'setting_functions_comment_allow_comment' => '设置点评的发表方式,如不选择表示不启用点评功能。开启任意一种点评方式都需要在用户组中设置点评权限
          “直接点评”即通过文章每楼层中的“点评”链接发表点评
          “楼层回复”即通过文章每楼层中的“回复”链接发表回帖时,自动对该楼层产生点评
          注意:点击主题中的“回复”链接,不会对主题产生点评', + 'setting_functions_comment_allow_1' => '直接点评', + 'setting_functions_comment_allow_2' => '楼层回复', + 'setting_functions_comment_number' => '点评条目数', + 'setting_functions_comment_number_comment' => '在文章中显示点评的条目数', + 'setting_functions_comment_firstpost' => '允许点评楼主帖', + 'setting_functions_comment_firstpost_comment' => '设置是否允许直接点评楼主帖,关闭表示只能点评回帖', + 'setting_functions_comment_postself' => '允许点评自己的文章', + 'setting_functions_comment_postself_comment' => '设置是否发帖作者能点评自己的文章', + 'setting_functions_comment_commentitem_0' => '普通主题点评预置观点', + 'setting_functions_comment_commentitem_0_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 'setting_functions_comment_commentitem_1' => '投票主题点评预置观点', + 'setting_functions_comment_commentitem_1_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 'setting_functions_comment_commentitem_2' => '商品主题点评预置观点', + 'setting_functions_comment_commentitem_2_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 'setting_functions_comment_commentitem_3' => '悬赏主题点评预置观点', + 'setting_functions_comment_commentitem_3_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 'setting_functions_comment_commentitem_4' => '活动主题点评预置观点', + 'setting_functions_comment_commentitem_4_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 'setting_functions_comment_commentitem_5' => '辩论主题点评预置观点', + 'setting_functions_comment_commentitem_5_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 'setting_functions_comment_commentitem_threadplugin' => '点评预置观点', + 'setting_functions_comment_commentitem_threadplugin_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + + 'setting_functions_threadexp' => '文章阅读', + 'setting_functions_threadexp_repliesrank' => '启用回帖投票', + 'setting_functions_threadexp_repliesrank_comment' => '开启后,用户可对回帖进行“支持”、“反对”操作。', + 'setting_functions_threadexp_blacklist' => '启用用户黑名单隐藏', + 'setting_functions_threadexp_blacklist_comment' => '开启后,用户可以通过将其他用户加入黑名单的方法,隐藏指定用户的文章。', + 'setting_functions_threadexp_hotreplies' => '推荐回复数', + 'setting_functions_threadexp_hotreplies_comment' => '系统根据回帖评价和水帖情况,在主题第一页推荐回帖,0 为不显示。', + 'setting_functions_threadexp_nofilteredpost' => '推荐回复时推荐非水帖', + 'setting_functions_threadexp_nofilteredpost_comment' => '启用后会在第一页推荐回复处推荐相应一定的非水帖。', + 'setting_functions_threadexp_filter' => '水帖字数', + 'setting_functions_threadexp_filter_comment' => '系统判断水帖的条件,小于此数值的文章会被判断为水帖,0 为不过滤水帖。', + 'setting_functions_threadexp_hidefilteredpost' => '启用隐藏水帖', + 'setting_functions_threadexp_hidefilteredpost_comment' => '开启后系统判断为水帖的文章会被自动隐藏。', + 'setting_functions_threadexp_filterednovote' => '水帖不能参与回帖投票', + 'setting_functions_threadexp_filterednovote_comment' => '开启后系统判断为水帖的文章将不能参与回帖投票。', + + 'setting_functions_makehtml' => '生成HTML', + 'setting_functions_makehtml_articlehtmldir' => '文章HTML存放根目录', + 'setting_functions_makehtml_articlehtmldir_comment' => '文章静态文件存放的根目录,子目录与频道目录相同,从网站的根目录开始,结尾不需要添加/,为空则存放在当前频道的文件夹下', + 'setting_functions_makehtml_htmldirformat' => '目录结构', + 'setting_functions_makehtml_htmldirformat_comment' => '静态文件文件存放目录的下级目录结构, 0:/Ym/, 1:/Ym/d/, 2:/Y/m/, 3:/Y/m/d/', + 'setting_functions_makehtml_topichtmldir' => '专题HTML存放目录', + 'setting_functions_makehtml_topichtmldir_comment' => '专题HTML文件存放目录,从网站的根目录开始,结尾不需要添加/,为空则不生成专题HTML文件', + 'setting_functions_makehtml_articlehtmldir_invalid' => '文章HTML文件的存放目录只能包含字母、数字、下划线(_)和\,请确认存放目录的合法性', + 'setting_functions_makehtml_extendname_invalid' => '扩展名只能包含字母、数字、下划线(_)和单点(.),请确认扩展名的合法性', + 'setting_functions_makehtml_filename_invalid' => '文件名只能包含字母、数字、下划线(_),请确认文件名的合法性', + 'setting_functions_makehtml_topichtmldir_invalid' => '专题HTML文件的存放目录只能包含字母、数字、下划线(_)和\,请确认存放目录的合法性', + 'setting_functions_makehtml_indexname' => '门户首页静态文件名', + 'setting_functions_makehtml_indexname_comment' => '生成门户首页的静态文件名,默认为index,不带扩展名', + 'setting_functions_makehtml_indexname_invalid' => '门户首页静态文件名只能包含字母、数字、下划线(_),请确认文件名的合法性', + 'setting_functions_makehtml_extendname' => '静态文件扩展名', + 'setting_functions_makehtml_extendname_comment' => '所有静态文件的扩展名,默认为html', + 'setting_functions_makehtml_make_has_no_foldername' => '生成', + 'setting_functions_makehtml_make_has_closed' => '生成', + 'setting_functions_makehtml_make' => '生成', + 'setting_functions_makehtml_made' => '已生成', + 'setting_functions_makehtml_dismake' => '未生成', + 'setting_functions_makehtml_cleanhtml' => '需要清理的HTML', + 'setting_functions_makehtml_cleanhtml_comment' => '选择需要要清理的HTML', + 'setting_functions_makehtml_cleanhtml_index' => '门户首页', + 'setting_functions_makehtml_cleanhtml_category' => '所有频道页', + 'setting_functions_makehtml_cleanhtml_other' => '所有其它页', + + + 'setting_functions_other' => '其他', + 'setting_functions_other_uidlogin' => '启用UID登录', + 'setting_functions_other_uidlogin_comment' => '选择“是”,站点登录时允许通过 UID的方式登录验证', + 'setting_functions_other_secmobilelogin' => '启用安全手机号登录', + 'setting_functions_other_secmobilelogin_comment' => '选择“是”,站点登录时允许通过安全手机号或国际电话区号-安全手机号的方式登录验证', + 'setting_functions_other_autoidselect' => '启用登录自动选择账号', + 'setting_functions_other_autoidselect_comment' => '选择“是”,站点登录时的将自动按 UID、E-mail、用户名的顺序逐一去匹配,其中UID验证只有UID登录方式被启用后才有效', + 'setting_functions_other_submitlock' => '启用表单防并发功能', + 'setting_functions_other_submitlock_comment' => '选择“是”,将会防止用户同一时间提交多次表单,可有效防止可能刷分的问题。注意: 在未使用内存缓存(Redis、Memcached)的情况下,本功能可能会加重服务器负担', + 'setting_functions_other_rssstatus' => '启用 RSS', + 'setting_functions_other_rssstatus_comment' => '选择“是”,将允许用户使用 RSS 客户端软件接收最新的文章、文章更新。注意: 在分类很多的情况下,本功能可能会加重服务器负担', + 'setting_functions_other_rssttl' => 'RSS TTL(分钟)', + 'setting_functions_other_rssttl_comment' => 'TTL(Time to Live) 是 RSS 2.0 的一项属性,用于控制订阅内容的自动刷新时间,时间越短则资料实时性就越高,但会加重服务器负担,通常可设置为 30~180 范围内的数值', + 'setting_functions_other_oltimespan' => '用户在线时间更新时长(分钟)', + 'setting_functions_other_oltimespan_comment' => 'Discuz! 可统计每个用户总共和当月的在线时间,本设置用以设定更新用户在线时间的时间频率。例如设置为 10,则用户每在线 10 分钟更新一次记录。本设置值越小,则统计越精确,但消耗资源越大。建议设置为 5~30 范围内,0 为不记录用户在线时间', + 'setting_functions_other_debug' => '显示程序运行信息', + 'setting_functions_other_debug_comment' => '选择“是”将在页脚处显示程序运行时间和数据库查询次数', + 'setting_functions_other_onlyacceptfriendpm' => '全站是否默认只接受好友短消息', + 'setting_functions_other_onlyacceptfriendpm_comment' => '选择“是”将在个人短消息设置中,默认只接收好友的短消息', + 'setting_functions_other_pmreportuser' => '接收短消息举报人(UID,多人使用英文逗号分隔)', + 'setting_functions_other_pmreportuser_comment' => '根据接收的短消息举报提醒用户,可及时处理发送垃圾短信的用户,留空表示不启用短消息举报功能', + 'setting_functions_other_at_anyone' => '发帖时可@任何人', + 'setting_functions_other_at_anyone_comment' => '选择否表示,只有被@人在用户的收听列表和好友中时才有效', + 'setting_functions_other_chatpmrefreshtime' => '群聊消息内容自动刷新间隔(秒)', + 'setting_functions_other_chatpmrefreshtime_comment' => '用于群聊消息内容刷新, 间隔时间越短对服务器压力越大, 0为不刷新', + 'setting_functions_other_collectionteamworkernum' => '淘帖专辑允许共同维护的人数', + 'setting_functions_other_collectionteamworkernum_comment' => '每个淘帖专辑可以共同参与维护的人数。', + 'setting_functions_other_closeforumorderby' => '关闭主题列表页排序功能', + 'setting_functions_other_closeforumorderby_comment' => '选择“是”用户将只能按默认排序查看,否则,用户自选排序将会增加系统压力。', + 'setting_functions_other_darkroom' => '开启小黑屋', + 'setting_functions_other_darkroom_comment' => '选择“是”将开启小黑屋,用户可以在右下角导航中进入小黑屋,查看被禁言禁止访问用户', + 'setting_functions_other_disableipnotice' => '关闭登录安全提醒', + 'setting_functions_other_disableipnotice_comment' => '选择“是”将关闭用户登录地区异常安全提醒功能', + 'setting_functions_other_global_sign' => '全局签名内容', + 'setting_functions_other_global_sign_comment' => '该设置必须开启签名后有效,如果用户没有设置签名就显示该签名内容', + 'setting_functions_other_shortcut' => '提醒添加桌面快捷的积分下限', + 'setting_functions_other_shortcut_comment' => '大于等于设置积分的用户将看到添加桌面快捷的顶部提醒,0或不填为关闭此功能', + + 'setting_functions_activity' => '活动主题', + 'setting_functions_activity_type' => '内置类别', + 'setting_functions_activity_type_comment' => '本设定将在用户发起活动时显示活动类别,每个类别一行', + 'setting_functions_activity_field' => '(点此新增资料项)活动发起者可选的必填资料项', + 'setting_functions_activity_field_comment' => '用户发起活动时可选择的资料项', + 'setting_functions_activity_extnum' => '扩展资料项数量', + 'setting_functions_activity_extnum_comment' => '用户发起活动时自定义资料项数量,0为不允许自定义资料项', + 'setting_functions_activity_pp' => '列表用户数', + 'setting_functions_activity_pp_comment' => '用户列表每页显示参与活动的人数', + 'setting_functions_activity_credit' => '使用积分', + 'setting_functions_activity_credit_comment' => '参与消耗积分的活动时使用的积分', + 'setting_functions_guide' => '导读设置', + 'setting_functions_guide_index' => '导读默认首页', + 'setting_functions_guide_index_index' => '聚合首页', + 'setting_functions_guide_index_newthread' => '最新发表', + 'setting_functions_guide_index_new' => '最新回复', + 'setting_functions_guide_index_hot' => '最新热门', + 'setting_functions_guide_index_digest' => '最新精华', + 'setting_functions_guide_index_sofa' => '抢沙发', + 'setting_functions_guide_hotlimt' => '热帖聚合热度值下限', + 'setting_functions_guide_hotdt' => '热帖聚合时间范围', + 'setting_functions_guide_digestdt' => '精华聚合时间范围', + + 'setting_editor' => '编辑器设置', + 'setting_editor_global' => '全局', + 'setting_editor_code' => 'Discuz! 代码', + 'setting_editor_mode_default' => '默认的编辑器模式', + 'setting_editor_swtich_enable' => '是否允许切换编辑器模式', + 'setting_editor_swtich_enable_comment' => '选择否将禁止用户在纯文本模式和所见即所得模式之间切换', + 'setting_editor_simplemode' => '编辑栏样式', + 'setting_editor_simplemode_comment' => '设置默认的编辑栏样式', + 'setting_editor_simplemode_1' => '高级', + 'setting_editor_simplemode_0' => '常用', + 'setting_editor_mode_discuzcode' => '纯文本模式', + 'setting_editor_mode_wysiwyg' => '所见即所得模式', + 'setting_editor_smthumb' => '表情图片的宽高', + 'setting_editor_smthumb_comment' => '允许范围在 20~40 之间,图片实际尺寸超出设置值时将自动缩略显示', + 'setting_editor_smcols' => '表情列数', + 'setting_editor_smcols_comment' => '发帖页面表情显示的列数,允许范围在 8~12之间', + 'setting_editor_smrows' => '表情行数', + 'setting_editor_smrows_comment' => '发帖页面表情显示的行数', + + 'setting_permissions' => '用户权限', + 'setting_permissions_alloweditpost' => '允许用户随时编辑的文章类型', + 'setting_permissions_alloweditpost_comment' => '被选中的文章类型将不受用户组中的“编辑文章时间”限制,任何时刻都可以编辑', + 'setting_permissions_allowviewuserthread' => '允许查看用户的主题和文章', + 'setting_permissions_allowviewuserthread_comment' => '设置是否允许查看其他用户的主题和文章,选择相应的版块那么在个人空间将出现“主题”模块和链接', + 'setting_permissions_allowviewuserthread_forum_group' => '所有版块和圈子', + 'setting_permissions_allowviewuserthread_fids' => '允许查看哪些版块的文章', + 'setting_permissions_allowviewuserthread_fids_comment' => '设置允许查看其他用户哪些版块的主题和文章,可以按住 CTRL 多选', + 'setting_permissions_allowmoderatingthread' => '是否提示用户自己有未审核的主题或者文章', + 'setting_permissions_allowmoderatingthread_comment' => '选择“是”,用户如果有正在审核的主题,将可以在文章列表页看到提示', + 'setting_permissions_memliststatus' => '允许查看会员列表', + 'setting_permissions_modratelimit' => '版主评分限制', + 'setting_permissions_modratelimit_comment' => '设置版主只能在自身所管辖的版块范围内对文章进行评分。本限制只对版主有效,允许评分的普通用户及超级版主、管理员不受此限制,因此如果赋予这些用户评分权限,他们仍将可以在全版块范围内进行评分', + 'setting_permissions_dupkarmarate' => '允许重复评分', + 'setting_permissions_dupkarmarate_comment' => '选择“是”将允许用户对一个文章进行多次评分,默认为“否”', + 'setting_permissions_editperdel' => '允许用户编辑文章时删除文章', + 'setting_permissions_editperdel_comment' => '选择“是”将允许用户编辑文章时删除文章,默认为“否”', + 'setting_permissions_hideexpiration' => '文章中[hide]标签最大有效天数', + 'setting_permissions_hideexpiration_comment' => '距发帖日期天数超过此设置时标签自动失效,0或不填为不限制', + 'setting_permissions_reportpost' => '允许报告内容', + 'setting_permissions_minpostsize' => '文章最小字数(字节)', + 'setting_permissions_minpostsize_comment' => '管理组成员可通过“发帖不受限制”设置而不受影响,0 为不限制', + 'setting_permissions_minpostsize_mobile' => '手机客户端发帖最小字数(字节)', + 'setting_permissions_minpostsize_mobile_comment' => '是否单独为手机客户端设置发帖的最小字节数,0 为不单独设置', + 'setting_permissions_maxpostsize' => '文章最大字数(字节)', + 'setting_permissions_maxpostsize_comment' => '管理组成员可通过“发帖不受限制”设置而不受影响', + 'setting_permissions_minsubjectsize' => '标题最小字数', + 'setting_permissions_minsubjectsize_comment' => '论坛、门户、日志均受限制,管理组成员可通过“发帖不受限制”设置而在论坛模块不受影响,0 为不限制', + 'setting_permissions_maxsubjectsize' => '标题最大字数', + 'setting_permissions_maxsubjectsize_comment' => '论坛、门户、日志均受限制,管理组成员可通过“发帖不受限制”设置而在论坛模块不受影响, 80 为默认值, 255 为最大值', + 'setting_permissions_mailinterval' => '邮件发送时间间隔', + 'setting_permissions_mailinterval_comment' => '设定邮件发送时间间隔,默认为 300 秒', + 'setting_permissions_maxpolloptions' => '投票最大选项数:', + 'setting_permissions_maxpolloptions_comment' => '设定发布投票包含的最大选项数', + 'setting_permissions_favorite_storage_comment' => '允许收藏的最大版块 / 主题数,默认为100', + 'setting_permissions_karmaratelimit' => '评分时间限制(小时)', + 'setting_permissions_karmaratelimit_comment' => '文章发表后超过此时间限制其他用户将不能对此帖评分,版主和管理员不受此限制,0 为不限制', + 'setting_permissions_editby' => '编辑文章附加编辑记录', + 'setting_permissions_editby_comment' => '在 60 秒后编辑文章添加“本帖由 xxx 于 xxxx-xx-xx 编辑”字样。管理员编辑不受此限制', + 'setting_permissions_post_append' => '启用文章补充功能', + 'setting_permissions_post_append_comment' => '启用后,当用户无法编辑自己的文章时,可以补充内容', + 'setting_permissions_profilehistory' => '启用个人信息历史记录功能', + 'setting_permissions_profilehistory_comment' => '启用后,个人信息历史记录将被保存,可以在后台下载。历史邮箱、安全手机号数据不受此功能限制', + 'setting_permissions_nsprofiles' => '个人空间内不展现个人信息', + 'setting_permissions_nsprofiles_comment' => '启用后个人空间内将不展现个人信息', + 'setting_permissions_modasban' => '不忽略审核关键词', + 'setting_permissions_modasban_comment' => '启用后在不支持审核关键词的模块内发现此类关键词将拒绝提交,关闭则允许提交', + + 'setting_credits' => '积分设置', + 'setting_credits_base' => '基本设置', + 'setting_credits_scheme_title' => '积分设置方案', + 'setting_credits_scheme' => '积分设置方案', + 'setting_credits_extended' => '扩展积分设置', + 'setting_credits_extended_comment' => '兑换比率为单项积分对应一个单位标准积分的值,例如 extcredits1 的比率为 1.5(相当于 1.5 个单位标准积分)、extcredits2 的比率为 3(相当于 3 个单位标准积分)、extcredits3 的比率为 15(相当于 15 个单位标准积分),则 extcredits3 的 1 分相当于 extcredits2 的 5 分或 extcredits1 的 10 分。一旦设置兑换比率,则用户将可以在个人中心自行兑换各项设置了兑换比率的积分,如不希望实行积分自由兑换,请将其兑换比率设置为 0', + 'setting_credits_ratio' => '兑换比率', + 'setting_credits_lower_limit' => '积分下限', + 'setting_credits_init' => '初始积分', + 'setting_credits_available' => '启用', + 'credits_img' => '积分图标', + 'setting_credits_show_in_thread' => '在文章中显示', + 'setting_credits_export' => '允许兑出', + 'setting_credits_export_comment' => '设置该是否允许该项积分兑换为其他积分', + 'setting_credits_import' => '允许兑入', + 'setting_credits_import_comment' => '设置该是否允许其他积分兑换为该项积分', + 'setting_credits_policy_name' => '策略名称', + 'setting_credits_policy_lowerlimit' => '积分策略下限', + 'setting_credits_policy_lowerlimit_comment' => '当用户该项积分低于此下限时,将禁止用户执行积分策略中涉及扣减此项积分的操作。例如设置为 -100,而“搜索”扣减该积分 10 个单位,则当用户该项积分小于 -100 时,将不能再执行“搜索”操作', + 'setting_credits_policy' => '积分策略', + 'setting_credits_policy_comment' => '
        • 各项积分增减允许的范围为 -99~+99。如果为更多的操作设置积分策略,系统就需要更频繁的更新用户积分,同时意味着消耗更多的系统资源,因此请根据实际情况酌情设置。查看积分规则
        • ', + 'setting_credits_policy_post' => '发主题(+)', + 'setting_credits_policy_post_comment' => '作者发新主题增加的积分数,如果该主题被删除,作者积分也会按此标准相应减少', + 'setting_credits_policy_reply' => '回复(+)', + 'setting_credits_policy_reply_comment' => '作者发新回复增加的积分数,如果该回复被删除,作者积分也会按此标准相应减少', + 'setting_credits_policy_digest' => '加精华(+)', + 'setting_credits_policy_digest_comment' => '主题被加入精华时单位级别作者增加的积分数(根据精华级别乘以1~3),如果该主题被移除精华,作者积分也会按此标准相应减少', + 'setting_credits_policy_postattach' => '上传附件(+)', + 'setting_credits_policy_postattach_comment' => '用户每上传一个附件增加的积分数,如果该附件被删除,发布者积分也会按此标准相应减少', + 'setting_credits_policy_getattach' => '下载附件(-)', + 'setting_credits_policy_getattach_comment' => '用户每下载一个附件扣除的积分数。注意: 如果允许游客组下载附件,本策略将可能被绕过', + 'setting_credits_policy_tradefinished' => '成功交易(+)', + 'setting_credits_policy_tradefinished_comment' => '用户每成功进行一次交易后增加的积分数', + 'setting_credits_policy_sendpm' => '发短消息(-)', + 'setting_credits_policy_sendpm_comment' => '用户每发送一条短消息扣除的积分数', + 'setting_credits_policy_votepoll' => '参与投票(+)', + 'setting_credits_policy_votepoll_comment' => '用户每参与一次投票后增加的积分数', + 'setting_credits_policy_search' => '搜索(-)', + 'setting_credits_policy_search_comment' => '用户每进行一次搜索扣除的积分数', + 'setting_credits_policy_promotion_visit' => '访问推广(+)', + 'setting_credits_policy_promotion_visit_comment' => '访问者通过用户提供的推广链接(如 forum.php?mod=index&fromuid=1、?fromuser=username)访问站点,推广人所得的积分数', + 'setting_credits_policy_promotion_register' => '注册推广(+)', + 'setting_credits_policy_promotion_register_comment' => '访问者通过用户提供的推广链接(如 forum.php?mod=register&fromuid=2、?fromuser=username)访问站点并注册新会员,推广人所得的积分数', + 'setting_credits_policy_cycletype' => '周期', + 'setting_credits_policy_cycletype_0' => '一次', + 'setting_credits_policy_cycletype_1' => '每天', + 'setting_credits_policy_cycletype_2' => '整点', + 'setting_credits_policy_cycletype_3' => '间隔分钟', + 'setting_credits_policy_cycletype_4' => '不限', + 'setting_credits_policy_rewardnum' => '奖励次数', + 'setting_credits_policy_mobile' => '手机版访问额外加分', + 'setting_credits_policy_mobile_comment' => '当手机版访问时,相应积分策略项获得的额外加分,仅对加分项目有效', + 'setting_credits_use_custom_credit' => '自定义该版块当前积分策略', + + 'setting_credits_formula' => '总积分计算公式', + 'setting_credits_formula_credits' => '总积分', + 'setting_credits_formulaperm_and' => '并且', + 'setting_credits_formulaperm_or' => '或', + 'setting_credits_formula_digestposts' => '精华帖数', + 'setting_credits_formula_posts' => '发帖数', + 'setting_credits_formula_threads' => '主题数', + 'setting_credits_formula_replies' => '回帖数', + 'setting_credits_formula_oltime' => '在线时间(小时)', + 'setting_credits_formula_blogs' => '日志数', + 'setting_credits_formula_friends' => '好友数', + 'setting_credits_formula_albums' => '相册数', + 'setting_credits_formula_doings' => '记录数', + 'setting_credits_formula_polls' => '投票数', + 'setting_credits_formula_sharings' => '分享数', + 'setting_credits_formula_extcredits' => '自定义积分', + 'setting_credits_formula_comment' => '总积分是衡量用户级别的唯一标准,您可以在此设定用户的总积分计算公式,其中 posts 代表发帖数 (主题 + 回复数);threads 代表用户发表的主题数;digestposts 代表精华帖数;oltime 代表用户总在线时间(小时);friends 代表好友数;doings 代表发表的记录数;blogs 代表发表的日志数;albums 代表上传的相册数;sharings 代表发表的分享数;extcredits1~extcredits8 分别代表上述 8 个自定义积分。公式中可使用包括 + - * / () 在内的运算符号', + 'setting_credits_trans' => '交易积分设置', + 'setting_credits_trans_comment' => '交易积分是一种可以由用户间自行转让、买卖交易、发布悬赏主题的积分类型,您可以指定一种积分作为交易积分。如果不指定交易积分,则用户间积分交易功能将不能使用。注意: 交易积分必须是已启用的积分,一旦确定请尽量不要更改,否则以往记录及交易可能会产生问题', + 'setting_credits_trans_credits' => '使用总积分', + 'setting_credits_trans_used' => '使用交易积分', + 'setting_credits_trans1' => '主题(附件)买卖使用的积分', + 'setting_credits_trans1_comment' => '主题(附件)买卖使用的积分', + 'setting_credits_trans2' => '悬赏使用的积分', + 'setting_credits_trans2_comment' => '设置悬赏使用的积分', + 'setting_credits_trans3' => '道具、勋章使用的积分', + 'setting_credits_trans3_comment' => '设置道具、勋章中使用的积分', + 'setting_credits_trans4' => '邀请注册获得邀请码使用的积分', + 'setting_credits_trans4_comment' => '设置邀请注册获得邀请码使用的积分', + 'setting_credits_trans5' => '商品主题使用的积分', + 'setting_credits_trans5_comment' => '设置商品主题使用的积分', + 'setting_credits_trans5_none' => '不使用积分', + 'setting_credits_trans6' => '空间消费使用的积分', + 'setting_credits_trans6_comment' => '设置在空间中消费使用的积分类型', + 'setting_credits_trans8' => '用户举报奖惩使用的积分', + 'setting_credits_trans8_comment' => '设置用户举报后对用户奖惩时使用的积分', + 'setting_credits_trans9' => '积分转账使用的积分', + 'setting_credits_trans9_comment' => '设置积分转账时使用的积分', + 'setting_credits_trans10' => '回帖奖励使用的积分', + 'setting_credits_trans10_comment' => '当用户发帖时可以设置的回帖奖励所使用的积分', + 'setting_credits_trans11' => '抢楼帖积分限制', + 'setting_credits_trans11_comment' => '参与抢楼帖积分限制时使用的积分', + 'setting_credits_trans12' => '创建圈子消耗积分', + 'setting_credits_trans12_comment' => '创建圈子时要消耗的积分', + 'setting_credits_tax' => '积分交易税', + 'setting_credits_tax_comment' => '积分交易税(损失率)为用户在利用积分进行转让、兑换、买卖时扣除的税率,范围为 0~1 之间的浮点数,例如设置为 0.2,则用户在转换 100 个单位积分时,损失掉的积分为 20 个单位,0 为不损失', + 'setting_credits_mintransfer' => '转账最低余额', + 'setting_credits_mintransfer_comment' => '积分转账后要求用户所拥有的余额最小数值。利用此功能,您可以设置较大的余额限制,使积分小于这个数值的用户无法转账;也可以将余额限制设置为负数,使得转账在限额内可以透支', + 'setting_credits_minexchange' => '兑换最低余额', + 'setting_credits_minexchange_comment' => '积分兑换后要求用户所拥有的余额最小数值。利用此功能,您可以设置较大的余额限制,使积分小于这个数值的用户无法兑换;也可以将余额限制设置为负数,使得兑换在限额内可以透支', + 'setting_credits_maxincperthread' => '单主题(附件)最高收入', + 'setting_credits_maxincperthread_comment' => '设置单一主题(附件)出售作者所得的最高税后积分收入,超过此限制后购买者将仍然被扣除相应积分,但主题(附件)作者收益将不再上涨。本限制只在主题(附件)买卖时起作用,0 为不限制', + 'setting_credits_maxchargespan' => '单主题(附件)最高出售时限(小时)', + 'setting_credits_maxchargespan_comment' => '设置当主题(附件)被作者出售时,系统允许自主题(附件)发布时间起,其可出售的最长时间。超过此时间限制后将变为普通主题(附件),阅读者无需支付积分购买,作者也将不再获得相应收益,以小时为单位,0 为不限制', + + 'setting_mail' => '邮件设置', + 'setting_mail_setting' => '设置', + 'setting_mail_setting_silent' => '屏蔽邮件发送中的全部错误提示', + 'setting_mail_setting_send' => '邮件发送方式', + 'setting_mail_setting_send_comment' => '如需使用 SSL 加密的 SMTP 发送,请在服务器地址前添加 ssl:// 并调整端口号。', + 'setting_mail_setting_send_1' => '通过 PHP 函数的 sendmail 发送(推荐此方式)', + 'setting_mail_setting_send_2' => '通过 SOCKET 连接 SMTP 服务器发送(支持 ESMTP 验证)', + 'setting_mail_setting_send_3' => '通过 PHP 函数 SMTP 发送 Email(仅 Windows 主机下有效,不支持 ESMTP 验证)', + 'setting_mail_setting_send_4' => '通过插件发送(插件控制发送流程)', + 'setting_mail_setting_server' => 'SMTP 服务器', + 'setting_mail_setting_port' => '端口', + 'setting_mail_setting_timeout' => '超时(秒)', + 'setting_mail_setting_validate' => '验证', + 'setting_mail_setting_auth' => 'SMTP 服务器要求身份验证', + 'setting_mail_setting_from' => '发信人邮件地址', + 'setting_mail_setting_username' => 'SMTP 身份验证用户名', + 'setting_mail_setting_password' => 'SMTP 身份验证密码', + 'setting_mail_setting_precedence' => '优先发送邮件后缀(多个以,分隔)', + 'setting_mail_setting_delimiter' => '邮件头的分隔符(仅针对PHP sendmail方式有效)', + 'setting_mail_setting_delimiter_comment' => '请根据您邮件服务器的设置调整此参数', + 'setting_mail_setting_delimiter_crlf' => '使用 CRLF 作为分隔符(通常为 Windows 主机)', + 'setting_mail_setting_delimiter_lf' => '使用 LF 作为分隔符(通常为 Unix/Linux 主机)', + 'setting_mail_setting_delimiter_cr' => '使用 CR 作为分隔符(通常为 Mac 主机)', + 'setting_mail_setting_includeuser' => '收件人地址中包含用户名', + 'setting_mail_setting_includeuser_comment' => '选择“是”将在收件人的邮件地址中包含站点用户名', + 'setting_mail_setting_edit_addnew' => '添加新SMTP服务器', + 'setting_mail_setting_plugin' => '插件标识及脚本标识', + 'setting_mail_setting_plugin_comment' => '填写插件的标识符和脚本名称的后半段,用英文冒号隔开', + + 'setting_mail_check' => '检测', + 'setting_mail_check_test_from' => '测试发件人', + 'setting_mail_check_test_to' => '测试收件人', + 'setting_mail_check_test_to_comment' => '如果要测试包含用户名的邮件地址,格式为“username <user@domain.com>” 。多个邮件地址用逗号分隔', + 'setting_mail_check_submit' => '检测邮件发送设置', + 'setting_mail_check_title_1' => '标准方式发送 Email', + 'setting_mail_check_message_1' => "通过 PHP 函数及 Unix sendmail 发送\n\n来自", + 'setting_mail_check_title_2' => '通过 SMTP 服务器(SOCKET)发送 Email', + 'setting_mail_check_message_2' => "通过 SOCKET 连接 SMTP 服务器发送\n\n来自", + 'setting_mail_check_title_3' => '通过 PHP 函数 SMTP 发送 Email', + 'setting_mail_check_message_3' => "通过 PHP 函数 SMTP 发送 Email\n\n来自", + 'setting_mail_check_date' => "\n\n发送时间", + 'setting_mail_check_method_1' => '邮件单发测试', + 'setting_mail_check_method_2' => '邮件群发测试', + 'setting_mail_check_success_1' => '邮件发送成功:\n2 封标题为“', + 'setting_mail_check_success_2' => '”的测试邮件已经发出,请查收', + 'setting_mail_check_error' => '邮件发送返回错误信息:\n', + + 'setting_sec' => '基本设置', + 'setting_seccheck' => '验证设置', + 'setting_accountguard' => '账号保镖', + 'setting_sec_code_tips' => '
        • 使用图片作为验证码文字,图片必须包含字符“2346789BCEFGHJKMPQRTVWXY”24 个字符,且必须为 GIF 透明图片、背景透明、前景黑色,黑色为图片的第一个索引色。图片大小不限制,但建议宽度不大于验证码宽度的 1/4,高度不大于验证码高度。制作完毕后在 static/image/seccode/gif/ 下创建一个新的子目录,目录名任意,把制作完毕的 24 个 GIF 图片上传到新子目录下
        • 使用图片作为验证码的背景,把制作好的 JPG 图片上传到 static/image/seccode/background/ 目录下,站点将随机使用里面的图片作为验证码的背景
        • 使用 TTF 字体作为验证码文字,把下载的 TTF 英文字体文件上传到 static/image/seccode/font/en/ 目录下,站点将随机使用里面的字体文件作为验证码的文字
        • 使用中文图片验证码前,需要把包含完整中文汉字的 TTF 中文字体文件上传到 static/image/seccode/font/ch/ 目录下,站点将随机使用里面的字体文件作为验证码的文字
        • 系统验证码位于 source/class/seccode/ 目录中,插件验证码位于 source/plugin/插件目录/seccode/ 目录中。
        • ', + 'setting_sec_qaa_tips' => '
        • 验证问题应该言简意赅,没有歧义,正常人都能够正确作答。请经常更新验证问答的问题及答案以防止被猜测!
        • 系统验证问答位于 source/class/secqaa/ 目录中,插件验证问答位于 source/plugin/插件目录/secqaa/ 目录中。
        • 插件开发人员在设计新的验证问答脚本前请务必仔细阅读《Discuz! 技术文档》中的内容。
        • ', + + 'setting_sec_seclevel' => '安全验证模式', + 'setting_sec_seclevel_comment' => '通常情况下,我们推荐您使用高级验证模式。当您站点有较多用户遇到验证码无法通过的时候,您可以使用一般验证模式', + 'setting_sec_seclevel_lower' => '一般验证模式', + 'setting_sec_seclevel_higher' => '高级验证模式', + + 'setting_sec_base' => '用户设置', + 'setting_sec_base_need_email' => '强制用户验证激活邮箱', + 'setting_sec_base_need_email_comment' => '选择是的话,用户必须验证激活自己的邮箱后,才可以进行发布操作。 ', + 'setting_sec_base_uniqueemail' => '验证激活邮箱唯一性', + 'setting_sec_base_uniqueemail_comment' => '选择是的话,验证激活的邮箱将唯一性,不允许重复', + 'setting_sec_base_change_email' => '禁止用户前台修改邮箱', + 'setting_sec_base_change_email_comment' => '选择是的话,用户不能通过前台自行修改账号绑定的邮箱', + 'setting_sec_base_change_secmobile' => '禁止用户前台修改安全手机', + 'setting_sec_base_change_secmobile_comment' => '选择是的话,用户不能通过前台自行修改账号绑定的安全手机', + 'setting_sec_base_need_secmobile' => '强制用户认证安全手机', + 'setting_sec_base_need_secmobile_comment' => '选择是的话,用户必须认证自己的安全手机后才能进行发布操作', + 'setting_sec_base_need_avatar' => '强制用户上传头像', + 'setting_sec_base_need_avatar_comment' => '选择是的话,用户必须设置自己的头像后才能进行发布操作', + 'setting_sec_base_need_friendnum' => '强制用户好友个数', + 'setting_sec_base_need_friendnum_comment' => '设置用户必须拥有多少个好友后,才可以进行发布操作', + 'setting_sec_floodctrl' => '两次发表时间间隔(秒)', + 'setting_sec_floodctrl_comment' => '两次发帖间隔小于此时间,0 为不限制', + + 'setting_sec_seccode' => '验证码设置', + 'setting_sec_seccode_rule_setting' => '规则设置', + 'setting_sec_seccode_type_setting' => '显示设置', + 'setting_sec_seccode_status' => '启用验证码', + 'setting_sec_seccode_status_register' => '新用户注册', + 'setting_sec_seccode_status_login' => '用户登录', + 'setting_sec_seccode_status_post' => '发表信息', + 'setting_sec_seccode_status_sendpm' => '发送短消息', + 'setting_sec_seccode_status_password' => '修改密码', + 'setting_sec_seccode_status_card' => '充值卡密及短信验证', + 'setting_sec_seccode_status_connect_register' => 'QQ注册', + 'setting_sec_seccode_status_comment' => '验证码可以避免恶意注册及恶意灌水,请选择需要打开验证码的操作。注意: 启用验证码会使得部分操作变得繁琐,建议仅在必需时打开。
          充值卡密验证码建议一直开启', + 'setting_sec_seccode_minposts' => '发帖数限制', + 'setting_sec_seccode_minposts_comment' => '发帖数超过此设置的会员将不受验证码功能限制,0 表示所有会员均受限制。仅针对发表信息及修改密码时有效', + 'setting_sec_seccode_loginfailedcount' => '登录失败时显示验证码', + 'setting_sec_seccode_loginfailedcount_comment' => '选择“是”将在用户登录失败 3 次后才显示验证码,选择“否”将始终在登录时显示验证码。注意: 只有在启用了用户登录验证码时本设置才有效', + 'setting_sec_seccode_type' => '验证码类型', + 'setting_sec_seccode_type_comment' => '设置验证码的类型。中文图片验证码需要您的主机支持 FreeType 库。要显示 Flash 验证码,建议您的主机支持 Ming 库以提高安全性

          验证码预览', + 'setting_sec_seccode_type_image' => '英文图片验证码', + 'setting_sec_seccode_type_chnfont' => '中文图片验证码', + 'setting_sec_seccode_type_wav' => '语音验证码', + 'setting_sec_seccode_type_flash' => 'Flash 验证码', + 'setting_sec_seccode_type_bitmap' => '位图验证码', + 'setting_sec_seccode_animator' => 'GIF 动画', + 'setting_sec_seccode_animator_comment' => '选择“是”验证码将显示成 GIF 动画方式,选择“否”验证码将显示成静态图片方式', + 'setting_sec_seccode_animator_disabled' => '您的空间不支持 GIF 文件的写入,无法开启此功能', + 'setting_sec_seccode_ttf' => '随机 TTF 字体', + 'setting_sec_seccode_ttf_comment' => '选择“是”将随机使用 static/image/seccode/font/en/ 目录下的 TTF 字体文件生成验证码文字,选择“否”将随机使用 static/image/seccode/gif/ 目录中的 GIF 图片生成验证码文字。中文图片验证码将随机使用 static/image/seccode/font/ch/ 目录下的 TTF 字体文件,无需进行此设置', + 'setting_sec_seccode_ttf_disabled' => '您的主机不支持 FreeType 库,无法开启此功能', + 'setting_sec_seccode_background' => '随机图片背景', + 'setting_sec_seccode_background_comment' => '选择“是”将随机使用 static/image/seccode/background/ 目录下的 JPG 图片作为验证码的背景图片,选择“否”将使用随机的背景色', + 'setting_sec_seccode_adulterate' => '随机背景图形', + 'setting_sec_seccode_adulterate_comment' => '选择“是”将给验证码背景增加随机的图形', + 'setting_sec_seccode_angle' => '随机倾斜度', + 'setting_sec_seccode_angle_comment' => '选择“是”将给验证码文字增加随机的倾斜度,本设置只针对 TTF 字体的验证码', + 'setting_sec_seccode_warping' => '随机扭曲', + 'setting_sec_seccode_warping_comment' => '选择“是”将给验证码文字增加随机的扭曲,本设置只针对 TTF 字体的验证码', + 'setting_sec_seccode_scatter' => '图片打散', + 'setting_sec_seccode_scatter_comment' => '打散生成的验证码图片,输入打散的级别,0 为不打散', + 'setting_sec_seccode_color' => '随机颜色', + 'setting_sec_seccode_color_comment' => '选择“是”将给验证码的背景图形和文字增加随机的颜色', + 'setting_sec_seccode_size' => '随机大小', + 'setting_sec_seccode_size_comment' => '选择“是”验证码文字的大小随机显示', + 'setting_sec_seccode_shadow' => '文字阴影', + 'setting_sec_seccode_shadow_comment' => '选择“是”将给验证码文字增加阴影', + 'setting_sec_seccode_width' => '验证码图片宽度', + 'setting_sec_seccode_width_comment' => '验证码图片的宽度,范围在 100~200 之间', + 'setting_sec_seccode_height' => '验证码图片高度', + 'setting_sec_seccode_height_comment' => '验证码图片的高度,范围在 30~80 之间', + + 'setting_sec_seccode_rule_min' => '分钟', + 'setting_sec_seccode_rule_hour' => '小时', + 'setting_sec_seccode_rule_register' => '注册时启用验证码', + 'setting_sec_seccode_rule_register_comment' => '设置注册时验证码的启用规则', + 'setting_sec_seccode_rule_register_auto' => '智能启用', + 'setting_sec_seccode_rule_register_on' => '启用', + 'setting_sec_seccode_rule_register_off' => '不启用', + 'setting_sec_seccode_rule_register_numlimit' => '一段时间内注册上限', + 'setting_sec_seccode_rule_register_numlimit_comment' => '当网站注册用户在选择的时间段内超过设置值时,全天用户注册均需要通过验证码验证,0 代表不启用此规则', + 'setting_sec_seccode_rule_register_timelimit' => '时间段选择', + + 'setting_sec_seccode_rule_login' => '登录时启用验证码', + 'setting_sec_seccode_rule_login_comment' => '设置登录时验证码的启用规则', + 'setting_sec_seccode_rule_login_auto' => '智能启用', + 'setting_sec_seccode_rule_login_on' => '启用', + 'setting_sec_seccode_rule_login_off' => '不启用', + 'setting_sec_seccode_rule_login_nolocal' => '异地登录时启用', + 'setting_sec_seccode_rule_login_nolocal_comment' => '当用户本地登录 IP 为异地登录时启用验证码', + 'setting_sec_seccode_rule_login_pwsimple' => '用户密码太简单时启用', + 'setting_sec_seccode_rule_login_pwsimple_comment' => '当用户登录时使用的密码的长度与复杂度不符合后台设置时', + 'setting_sec_seccode_rule_login_pwerror' => '尝试密码错误 2 次后启用', + 'setting_sec_seccode_rule_login_numiptry' => '重复 IP 段尝试密码错误上限', + 'setting_sec_seccode_rule_login_numiptry_comment' => '当一个 IP 段在选择的时间段内错误次数超过设置时,该 IP 段再次登录需要输入验证码,0 代表不启用此规则', + 'setting_sec_seccode_rule_login_timeiptry' => '时间段选择', + 'setting_sec_seccode_rule_login_outofday' => '长时间未登录后 (天)', + 'setting_sec_seccode_rule_login_outofday_comment' => '当用户最近一次登录时间距离上次登录时间超过设置值时需要输入验证码,0 代表不启用此规则', + + 'setting_sec_seccode_rule_post' => '发表信息时启用验证码', + 'setting_sec_seccode_rule_post_comment' => '设置发表信息时验证码的启用规则', + 'setting_sec_seccode_rule_post_auto' => '智能启用', + 'setting_sec_seccode_rule_post_on' => '启用', + 'setting_sec_seccode_rule_post_off' => '不启用', + 'setting_sec_seccode_rule_post_numlimit' => '用户一段时间内发帖操作总次数上限', + 'setting_sec_seccode_rule_post_numlimit_comment' => '当用户在选择的时间段内发表主题,回复总数超过设置值时需要输入验证码,0 代表不启用此规则', + 'setting_sec_seccode_rule_post_timelimit' => '时间段选择', + 'setting_sec_seccode_rule_post_nplimit' => '提交主题时间太短后启用 (秒)', + 'setting_sec_seccode_rule_post_nplimit_comment' => '用户打开发帖页面到提交的最短时间,低于最短设置时间时需要输入验证码,0 代表不启用此规则', + 'setting_sec_seccode_rule_post_vplimit' => '提交回复时间太短后启用 (秒)', + 'setting_sec_seccode_rule_post_vplimit_comment' => '用户打开文章页面到提交回复的最短时间,低于最短设置时间时需要输入验证码,0 代表不启用此规则', + + 'setting_sec_seccode_rule_password' => '修改密码时启用验证码', + 'setting_sec_seccode_rule_password_comment' => '设置修改密码时是否启用验证码', + + 'setting_sec_seccode_rule_card' => '充值卡密及短信验证时启用验证码', + 'setting_sec_seccode_rule_card_comment' => '设置充值卡密及短信验证时是否启用验证码 (推荐开启)', + + 'setting_sec_secqaa' => '验证问答设置', + 'setting_sec_secqaa_add' => '添加新问题', + 'setting_sec_secqaa_status' => '启用验证问答', + 'setting_sec_secqaa_status_comment' => '验证问答功能要求会员必须正确回答系统随机抽取的问题才能继续操作,可以避免恶意注册或发布信息,请选择需要打开验证问答的操作。注意: 启用该功能会使得部分操作变得繁琐,建议仅在必需时打开', + 'setting_sec_secqaa_minposts' => '发帖数限制', + 'setting_sec_secqaa_minposts_comment' => '发帖数超过此设置的会员将不受验证问答功能限制,0 表示所有会员均受限制。仅针对发表信息及修改密码时有效', + 'setting_sec_secqaa_qaa' => '验证问题及答案设置', + 'setting_sec_secqaa_question' => '问题', + 'setting_sec_secqaa_answer' => '答案', + 'setting_sec_secqaa_comment' => '建议您设置 10 个以上验证问题及答案,验证问题越多,验证问答防止恶意注册或发布信息的效果越明显。问题支持 HTML 代码,答案长度不超过 50 字节', + + 'setting_sec_reginput' => '注册表单名称设置', + 'setting_sec_reginput_username' => '用户名表单设置', + 'setting_sec_reginput_username_comment' => '默认为 username ,只能是字母和数字的组合,必须以字母开头。修改后的表单名会使得注册机更难发挥作用', + 'setting_sec_reginput_password' => '密码表单设置', + 'setting_sec_reginput_password_comment' => '默认为 password ,只能是字母和数字的组合,必须以字母开头。 修改后的表单名会使得注册机更难发挥作用', + 'setting_sec_reginput_password2' => '重复密码表单设置', + 'setting_sec_reginput_password2_comment' => '默认为 password2 ,只能是字母和数字的组合,必须以字母开头。 修改后的表单名会使得注册机更难发挥作用', + 'setting_sec_reginput_email' => 'Email表单设置', + 'setting_sec_reginput_email_comment' => '默认为 email ,只能是字母和数字的组合,必须以字母开头。 修改后的表单名会使得注册机更难发挥作用', + 'setting_sec_postperiodtime'=> '发帖时间段限制', + 'setting_sec_accountguard'=> '账号保镖', + + 'setting_datetime' => '时间设置', + + 'setting_datetime_format' => '日期和时间格式', + 'setting_datetime_timeformat' => '默认时间格式', + 'setting_datetime_dateformat' => '默认日期格式', + 'setting_datetime_dateformat_comment' => '使用 yyyy(yy) 表示年,mm 表示月,dd 表示天。如 yyyy-mm-dd 表示 2000-1-1', + 'setting_datetime_dateconvert' => '人性化时间格式', + 'setting_datetime_dateconvert_comment' => '选择“是”,站点中的时间将显示以“n分钟前”、“昨天”、“n天前”等形式显示', + 'setting_datetime_timeoffset' => '默认时差', + 'setting_datetime_timeoffset_comment' => '当地时间与 GMT 的时差。遇夏制时的情况也可以手动输入,如:-7.5', + 'setting_datetime_timezone' => array( + '' => '选择公共时区', + '-12' => '(GMT -12:00) 埃尼威托克岛, 夸贾林环礁', + '-11' => '(GMT -11:00) 中途岛, 萨摩亚群岛', + '-10' => '(GMT -10:00) 夏威夷', + '-9' => '(GMT -09:00) 阿拉斯加', + '-8' => '(GMT -08:00) 太平洋时间(美国和加拿大), 提华纳', + '-7' => '(GMT -07:00) 山区时间(美国和加拿大), 亚利桑那', + '-6' => '(GMT -06:00) 中部时间(美国和加拿大), 墨西哥城', + '-5' => '(GMT -05:00) 东部时间(美国和加拿大), 波哥大, 利马, 基多', + '-4' => '(GMT -04:00) 大西洋时间(加拿大), 加拉加斯, 拉巴斯', + '-3.5' => '(GMT -03:30) 纽芬兰', + '-3' => '(GMT -03:00) 巴西利亚, 布宜诺斯艾利斯, 乔治敦, 福克兰群岛', + '-2' => '(GMT -02:00) 中大西洋, 阿森松群岛, 圣赫勒拿岛', + '-1' => '(GMT -01:00) 亚速群岛, 佛得角群岛 [格林尼治标准时间] 都柏林, 伦敦, 里斯本, 卡萨布兰卡', + '0' => '(GMT) 卡萨布兰卡, 都柏林, 爱丁堡, 伦敦, 里斯本, 蒙罗维亚', + '1' => '(GMT +01:00) 柏林, 布鲁塞尔, 哥本哈根, 马德里, 巴黎, 罗马', + '2' => '(GMT +02:00) 赫尔辛基, 加里宁格勒, 南非, 华沙', + '3' => '(GMT +03:00) 巴格达, 利雅得, 莫斯科, 奈洛比', + '3.5' => '(GMT +03:30) 德黑兰', + '4' => '(GMT +04:00) 阿布扎比, 巴库, 马斯喀特, 特比利斯', + '4.5' => '(GMT +04:30) 坎布尔', + '5' => '(GMT +05:00) 叶卡特琳堡, 伊斯兰堡, 卡拉奇, 塔什干', + '5.5' => '(GMT +05:30) 孟买, 加尔各答, 马德拉斯, 新德里', + '5.75' => '(GMT +05:45) 加德满都', + '6' => '(GMT +06:00) 阿拉木图, 科伦坡, 达卡, 新西伯利亚', + '6.5' => '(GMT +06:30) 仰光', + '7' => '(GMT +07:00) 曼谷, 河内, 雅加达', + '8' => '(GMT +08:00) 北京, 香港, 帕斯, 新加坡, 台北', + '9' => '(GMT +09:00) 大阪, 札幌, 首尔, 东京, 雅库茨克', + '9.5' => '(GMT +09:30) 阿德莱德, 达尔文', + '10' => '(GMT +10:00) 堪培拉, 关岛, 墨尔本, 悉尼, 海参崴', + '11' => '(GMT +11:00) 马加丹, 新喀里多尼亚, 所罗门群岛', + '12' => '(GMT +12:00) 奥克兰, 惠灵顿, 斐济, 马绍尔群岛'), + + 'setting_datetime_periods' => '时间段设置', + 'setting_datetime_visitbanperiods' => '禁止访问时间段', + 'setting_datetime_visitbanperiods_comment' => '每天该时间段内用户不能访问站点,请使用 24 小时时段格式,每个时间段一行,如需要也可跨越零点,留空为不限制。例如:
          每日晚 11:25 到次日早 5:05 可设置为: 23:25-5:05
          每日早 9:00 到当日下午 2:30 可设置为: 9:00-14:30
          注意: 格式不正确将可能导致意想不到的问题,用户组中如开启“不受时间段限制”的选项,则该组可不被任何时间段设置约束。所有时间段设置均以站点系统默认时区为准,不受用户自定义时区的影响', + 'setting_datetime_postbanperiods' => '禁止发帖时间段', + 'setting_datetime_postbanperiods_comment' => '每天该时间段内用户不能发帖,请使用 24 小时时段格式,每个时间段一行,如需要也可跨越零点,留空为不限制。例如:
          每日晚 11:25 到次日早 5:05 可设置为: 23:25-5:05
          每日早 9:00 到当日下午 2:30 可设置为: 9:00-14:30
          注意: 格式不正确将可能导致意想不到的问题,用户组中如开启“不受时间段限制”的选项,则该组可不被任何时间段设置约束。所有时间段设置均以站点系统默认时区为准,不受用户自定义时区的影响', + 'setting_datetime_postmodperiods' => '发帖审核时间段', + 'setting_datetime_postmodperiods_comment' => '每天该时间段内用户发帖不直接显示,需经版主或管理员人工审核才能发表,格式和用法同上', + 'setting_datetime_postignorearea' => '发帖不受时间限制的地区列表', + 'setting_datetime_postignorearea_comment' => '当用户处于本列表中的地址时,发帖不受时间段限制。每个地区一行,例如 "北京"(不含引号),留空为不设置。
          注意:如要正确无误的判断您 IP 地址所在的地区,请到网上下载 qqwry.dat IP 地址库文件上传到 "data/ipdata/" 目录下更名为 wry.dat', + 'setting_datetime_postignoreip' => '发帖不受时间限制的IP列表', + 'setting_datetime_postignoreip_comment' => '当用户处于本列表中的 IP 地址时,发帖不受时间段限制。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 'setting_datetime_searchbanperiods' => '禁止全文搜索时间段', + 'setting_datetime_searchbanperiods_comment' => '每天该时间段内用户不能使用全文搜索,格式和用法同上', + 'setting_datetime_ban_downtime' => '禁止下载附件时间段', + 'setting_datetime_ban_downtime_comment' => '每天该时间段内用户不能下载附件,格式和用法同上', + + 'setting_sec_accountguard_forcelogin' => '安全登录', + 'setting_sec_accountguard_forcelogin_comment' => '设置用户组的用户是否强制使用指定的登录方式', + 'setting_sec_accountguard_postqqonly' => '发帖需要绑定QQ号', + 'setting_sec_accountguard_postqqonly_comment' => '开启后用户发帖必须先绑定QQ号', + 'setting_sec_accountguard_loginpwcheck' => '弱密码登录检测', + 'setting_sec_accountguard_loginpwcheck_comment' => '当用户登录时使用的密码强度不符合“全局>注册与访问控制>注册>强制密码复杂度”设置时的操作。若启用强制修改,弱密码账号会被暂时冻结,修改密码成功后自动解除', + 'setting_sec_accountguard_loginpwcheck_none' => '不开启', + 'setting_sec_accountguard_loginpwcheck_prompt' => '开启并提示', + 'setting_sec_accountguard_loginpwcheck_force' => '开启并强制修改弱密码', + 'setting_sec_accountguard_loginoutofdate' => '异常登录检测', + 'setting_sec_accountguard_loginoutofdate_comment' => '当用户距离上次登录超过一定期限时,账号会进入未审核组,用户可以通过验证邮箱或者申诉解冻账号,QQ登录的用户不受此功能影响 审核用户', + 'setting_sec_accountguard_loginoutofdatenum' => '异常登录检测天数', + 'setting_sec_accountguard_loginoutofdatenum_comment' => '配置异常登录检测天数,默认值为 90 天', + + + 'setting_attach' => '上传设置', + + 'setting_attach_basic' => '基本设置', + 'setting_attach_basic_dir' => '本地附件保存位置', + 'setting_attach_basic_dir_comment' => '服务器路径,属性 777,必须为 web 可访问到的目录,结尾不加 "/",相对目录务必以 "./" 开头', + 'setting_attach_basic_url' => '本地附件 URL 地址', + 'setting_attach_basic_url_comment' => '可为当前 URL 下的相对地址或 http:// 开头的绝对地址,结尾不加 "/",不能把这个设为远程附件URL地址', + 'setting_attach_basic_imgpost' => '文章中显示图片附件', + 'setting_attach_basic_imgpost_comment' => '在文章中直接将图片或动画附件显示出来,而不需要点击附件链接', + 'setting_attach_basic_save' => '附件保存方式', + 'setting_attach_basic_save_comment' => '本设置只影响新上传的附件,设置更改之前的附件仍存放在原来位置。如使用非标准的保存方式,请确认 mkdir() 函数可正常使用,否则将出现附件无法保存的问题', + 'setting_attach_basic_save_disabled' => '您的空间不支持 mkdir 函数,只能使用默认附件保存方式', + 'setting_attach_basic_save_default' => '标准(全部存入同一目录)', + 'setting_attach_basic_save_forum' => '按版块存入不同目录', + 'setting_attach_basic_save_type' => '按文件类型存入不同目录', + 'setting_attach_basic_save_month' => '按月份存入不同目录', + 'setting_attach_basic_save_day' => '按天存入不同目录', + 'setting_attach_basic_swfupload' => '上传方式', + 'setting_attach_basic_multi' => '批量上传', + 'setting_attach_basic_simple' => '普通上传', + 'setting_attach_basic_allowattachurl' => '附件 URL 地址、媒体附件播放', + 'setting_attach_basic_allowattachurl_comment' => '开启附件 URL 地址后,上传附件的地址可通过 "attach://aid.ext" 方式在任何帖内引用(不支持附件收费以及阅读权限判定),并支持媒体类附件的直接播放,此项设置需要在 用户组 - 文章相关 中允许用户组使用多媒体代码,并保证 config_global.php 配置的本地文件读取模式为 1 或 4 方可生效', + 'setting_attach_basic_swfupload_comment' => '批量上传采用 Flash 机制上传,可一次上传多个附件,上传时还会有进度显示', + + 'setting_attach_forumattach' => '论坛附件', + 'setting_attach_image_preview' => '预览', + 'setting_attach_image_preview_comment' => '无需保存设置即可预览', + 'setting_attach_image_thumb_preview_btn' => '', + 'setting_attach_remote_preview_btn' => '', + 'setting_attach_image_lib' => '图片处理库类型', + 'setting_attach_image_lib_comment' => '请选择 Discuz! 用来处理缩略图和水印的图像处理库。GD 是最广泛的处理库但是使用的系统资源较多。ImageMagick 速度快系统资源占用少,但安全性相对较差,且需要服务器安装 ImageMagick 扩展。如果您的服务器有条件安装此程序,请到 http://www.imagemagick.org 下载', + 'setting_attach_image_watermarktype_GD' => 'GD', + 'setting_attach_image_watermarktype_IM' => 'ImageMagick', + 'setting_attach_image_impath' => 'ImageMagick 程序安装路径', + 'setting_attach_image_impath_comment' => 'ImageMagick 程序的安装路径。如果服务器的操作系统为 Windows,路径不要使用长文件名', + 'setting_attach_image_thumbstatus' => '论坛文章附件缩略图设置', + 'setting_attach_image_thumbstatus_comment' => '您可以设置自动为用户上传的 JPG/PNG/GIF 图片附件添加缩略图或将图片附件缩到指定的大小。不支持动画 GIF 格式', + 'setting_attach_image_thumbstatus_none' => '不启用', + 'setting_attach_image_thumbstatus_fixnone' => '小于指定大小、保持比率', + 'setting_attach_image_thumbstatus_fixwr' => '与指定大小相同、保持比率,超出部分剪切', + 'setting_attach_basic_thumbsource' => '直接缩放原图', + 'setting_attach_basic_thumbsource_comment' => '选择“是”,将直接缩放原图,而不生成缩略图文件', + 'setting_attach_image_thumbsourcewidthheight' => '原图缩放大小', + 'setting_attach_image_thumbsourcewidthheight_comment' => '设置原图的大小,所有大于此尺寸的图片附件将缩小到指定大小', + 'setting_attach_image_gdlimit' => 'GD 图片像素点上限', + 'setting_attach_image_gdlimit_comment' => '设置 GD 图片像素点上限,数值越大需要的服务器内存也越多,超过默认值 16777216 的站点需要在 php.ini 中设置更大的 memory_limit 以适应此配置', + 'setting_attach_image_thumbquality' => '缩略图质量', + 'setting_attach_image_thumbquality_comment' => '设置图片附件缩略图的质量参数,范围为 0~100 的整数,数值越大结果图片效果越好,但尺寸也越大', + 'setting_attach_image_disabledmobile' => '是否生成手机版缩略图', + 'setting_attach_image_disabledmobile_comment' => '设置是否为每个附件生成手机版的缩略图', + 'setting_attach_image_thumbwidthheight' => '缩略图大小', + 'setting_attach_image_thumbwidthheight_comment' => '设置缩略图的大小,小于此尺寸的图片附件将不生成缩略图', + 'setting_imgwater_image_watermarkstatus' => '水印', + 'setting_imgwater_image_watermarks_portal' => '文章图片水印设置', + 'setting_imgwater_image_watermarks_forum' => '论坛附件图片水印设置', + 'setting_imgwater_image_watermarks_album' => '空间相册图片水印设置', + 'setting_imgwater_image_watermarkstatus_none' => '不启用水印功能', + 'setting_imgwater_image_watermarkstatus_comment' => '您可以设置自动为用户上传的 JPG/PNG/GIF 图片附件添加水印,请在此选择水印添加的位置(3x3 共 9 个位置可选)。不支持动画 GIF 格式', + 'setting_imgwater_image_watermarkminwidthheight' => '水印添加条件', + 'setting_imgwater_image_watermarkminwidthheight_comment' => '设置水印添加的条件,小于此尺寸的图片附件将不添加水印', + 'setting_imgwater_image_watermarktype' => '水印图片类型', + 'setting_imgwater_image_watermarktype_comment' => '如果设置 GIF 类型的文件作为水印,水印图片为 static/image/common/watermark.gif,如果设置 PNG 类型的文件作为水印,水印图片为 static/image/common/watermark.png,您可替换水印文件以实现不同的水印效果。如果设置文本类型的水印并且使用 GD 图片处理库,那么还需要 FreeType 库支持才能使用', + 'setting_imgwater_image_watermarktype_gif' => 'GIF 类型水印', + 'setting_imgwater_image_watermarktype_png' => 'PNG 类型水印', + 'setting_imgwater_image_watermarktype_text' => '文本类型水印', + 'setting_imgwater_image_watermarktrans' => '水印融合度', + 'setting_imgwater_image_watermarktrans_comment' => '设置 GIF 类型水印图片与原始图片的融合度,范围为 1~100 的整数,数值越大水印图片透明度越低。PNG 类型水印本身具有真彩透明效果,无须此设置。本功能需要开启水印功能后才有效', + 'setting_imgwater_image_watermarkquality' => 'JPEG 水印质量', + 'setting_imgwater_image_watermarkquality_comment' => '设置 JPEG 类型的图片附件添加水印后的质量参数,范围为 0~100 的整数,数值越大结果图片效果越好,但尺寸也越大。本功能需要开启水印功能后才有效', + 'setting_imgwater_image_watermarktext_text' => '文本水印文字', + 'setting_imgwater_image_watermarktext_text_comment' => '如果您指定的 TrueType 字体为中文字体文件,那么您可以在文本水印中书写中文', + 'setting_imgwater_image_watermarktext_fontpath' => '文本水印 TrueType 字体文件名', + 'setting_imgwater_image_watermarktext_fontpath_comment' => '填写存放在 static/image/seccode/font/ch/ 或 static/image/seccode/font/en/ 目录下的 TTF 字体文件,支持中文字体。如使用中文 TTF 字体请使用包含完整中文汉字的字体文件', + 'setting_imgwater_image_watermarktext_size' => '文本水印字体大小', + 'setting_imgwater_image_watermarktext_size_comment' => '设置文本水印字体大小,请按照字体设置相应的大小', + 'setting_imgwater_image_watermarktext_angle' => '文本水印显示角度', + 'setting_imgwater_image_watermarktext_angle_comment' => '0 度为从左向右阅读文本', + 'setting_imgwater_image_watermarktext_color' => '文本水印字体颜色', + 'setting_imgwater_image_watermarktext_color_comment' => '输入 16 进制颜色代表文本水印字体颜色', + 'setting_imgwater_image_watermarktext_shadowx' => '文本水印阴影横向偏移量', + 'setting_imgwater_image_watermarktext_shadowx_comment' => '设置文本水印阴影横向偏移量,此数值不宜设置的太大', + 'setting_imgwater_image_watermarktext_shadowy' => '文本水印阴影纵向偏移量', + 'setting_imgwater_image_watermarktext_shadowy_comment' => '设置文本水印阴影纵向偏移量,此数值不宜设置的太大', + 'setting_imgwater_image_watermarktext_shadowcolor' => '文本水印阴影颜色', + 'setting_imgwater_image_watermarktext_shadowcolor_comment' => '输入 16 进制颜色代表文本水印阴影字体颜色', + 'setting_imgwater_image_watermarktext_imtranslatex' => '文本水印横向偏移量(ImageMagick)', + 'setting_imgwater_image_watermarktext_imtranslatex_comment' => '设置水印文本输出后向屏幕中央的横向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 'setting_imgwater_image_watermarktext_imtranslatey' => '文本水印纵向偏移量(ImageMagick)', + 'setting_imgwater_image_watermarktext_imtranslatey_comment' => '设置水印文本输出后向屏幕中央的纵向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 'setting_imgwater_image_watermarktext_imskewx' => '文本水印横向倾斜角度(ImageMagick)', + 'setting_imgwater_image_watermarktext_imskewx_comment' => '设置水印文本横向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + 'setting_imgwater_image_watermarktext_imskewy' => '文本水印纵向倾斜角度(ImageMagick)', + 'setting_imgwater_image_watermarktext_imskewy_comment' => '设置水印文本纵向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + + 'setting_attach_remote' => '远程附件', + 'setting_attach_remote_preview' => '连接测试', + 'setting_attach_remote_preview_comment' => '无需保存设置即可测试,请在测试通过后再保存', + 'setting_attach_remote_enabled' => '启用远程附件', + 'setting_attach_remote_enabled_ssl' => '启用 SSL 连接', + 'setting_attach_remote_enabled_ssl_comment' => '注意:FTP 服务器必需开启了 SSL', + 'setting_attach_remote_ftp_host' => 'FTP 服务器地址', + 'setting_attach_remote_ftp_host_comment' => '可以是 FTP 服务器的 IP 地址或域名', + 'setting_attach_remote_ftp_port' => 'FTP 服务器端口', + 'setting_attach_remote_ftp_port_comment' => '默认为 21', + 'setting_attach_remote_ftp_user' => 'FTP 账号', + 'setting_attach_remote_ftp_user_comment' => '该账号必需具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承', + 'setting_attach_remote_ftp_pass' => 'FTP 密码', + 'setting_attach_remote_ftp_pass_comment' => '基于安全考虑将只显示 FTP 密码的第一位和最后一位,中间显示八个 * 号', + 'setting_attach_remote_ftp_pasv' => '被动模式(pasv)连接', + 'setting_attach_remote_ftp_pasv_comment' => '一般情况下非被动模式即可,如果存在上传失败问题,可尝试打开此设置', + 'setting_attach_remote_dir' => '远程附件目录', + 'setting_attach_remote_dir_comment' => '远程附件目录的绝对路径或相对于 FTP 主目录的相对路径,结尾不要加斜杠“/”,“.”表示 FTP 主目录', + 'setting_attach_remote_url' => '远程访问 URL', + 'setting_attach_remote_url_comment' => '支持 HTTP 和 FTP 协议,结尾不要加斜杠“/”;如果使用 FTP 协议,FTP 服务器必需支持 PASV 模式,为了安全起见,使用 FTP 连接的账号不要设置可写权限和列表权限', + 'setting_attach_remote_timeout' => 'FTP 传输超时时间', + 'setting_attach_remote_timeout_comment' => '单位:秒,0 为服务器默认', + 'setting_attach_remote_allowedexts' => '允许的附件扩展名', + 'setting_attach_remote_allowedexts_comment' => '只允许这些扩展名结尾的附件使用远程附件功能,每行一个,不区分大小写,留空为不限制', + 'setting_attach_remote_disallowedexts' => '禁止的附件扩展名', + 'setting_attach_remote_disallowedexts_comment' => '禁止这些扩展名结尾的附件使用远程附件功能,每行一个,不区分大小写,留空为不限制', + 'setting_attach_remote_minsize' => '附件尺寸下限', + 'setting_attach_remote_minsize_comment' => '单位:KB,只有尺寸大于当前设置的附件才使用远程附件功能,0 或留空为不限制', + 'setting_attach_remote_ftpcheck' => '检测远程附件设置', + + 'setting_ftp_remote_-100' => '当前服务器 PHP 没有安装 FTP 扩展模块或 FTP 函数被禁用', + 'setting_ftp_remote_-101' => '尝试连接到 FTP 服务器失败,请检查 FTP 服务器地址和端口号设置是否正确', + 'setting_ftp_remote_-102' => '尝试连接到 FTP 服务器失败,请检查 FTP 服务器地址和端口号设置是否正确', + 'setting_ftp_remote_-103' => '尝试登录到 FTP 服务器失败,请检查 FTP 账号密码设置是否正确', + 'setting_ftp_remote_-104' => '尝试切换目录失败,请检查站点目录设置是否正确', + 'setting_ftp_remote_-105' => '尝试创建目录失败,请检查站点目录设置是否正确,并检查 FTP 账号是否具有创建目录的权限', + 'setting_ftp_remote_-106' => '尝试上传文件失败,请检查站点目录是否具有上传文件的权限', + 'setting_ftp_remote_-107' => '尝试上传文件失败,请检查 FTP 账号是否具有上传文件的权限,如果确认权限正常,请尝试使用被动模式(pasv)连接', + 'setting_attach_ftp_dir' => '站点根目录', + 'setting_attach_ftp_dir_comment' => '站点根目录的绝对路径或相对于 FTP 主目录的相对路径,结尾不要加斜杠“/”,“.”表示 FTP 主目录', + + 'setting_attach_remote_-100' => '当前服务器 PHP 没有安装 FTP 扩展模块或 FTP 函数被禁用', + 'setting_attach_remote_-101' => '远程附件功能未开启', + 'setting_attach_remote_-102' => '尝试连接到 FTP 服务器失败,请检查 FTP 服务器地址和端口号设置是否正确', + 'setting_attach_remote_-103' => '尝试登录到 FTP 服务器失败,请检查 FTP 账号密码设置是否正确', + 'setting_attach_remote_-104' => '尝试切换目录失败,请检查远程附件目录设置是否正确', + 'setting_attach_remote_-105' => '尝试创建目录失败,请检查远程附件目录设置是否正确,并检查 FTP 账号是否具有创建目录的权限', + 'setting_attach_remote_-106' => '尝试上传文件失败,请检查站点附件目录是否具有上传文件的权限', + 'setting_attach_remote_-107' => '尝试上传文件失败,请检查 FTP 账号是否具有上传文件的权限,如果确认权限正常,请尝试使用被动模式(pasv)连接', + 'setting_attach_remote_wtferr' => '尝试写入临时文件失败,请检查本地是否有写入文件权限', + 'setting_attach_remote_geterr' => '尝试下载文件失败,请检查远程访问 URL 设置是否正确', + 'setting_attach_remote_delerr' => '尝试删除文件失败,请检查 FTP 账号是否具有删除文件的权限', + 'setting_attach_remote_ok' => '远程附件设置一切正常', + + 'setting_attach_album' => '空间附件', + 'setting_attach_album_maxtimage' => '图片最大尺寸', + 'setting_attach_album_maxtimage_comment' => '如果用户上传一些尺寸很大的数码图片,则程序会按照本设置进行缩小该图片并显示,比如可以设置为 宽:1024px,高:768px,但都不能小于 300px。设置为 0,则不做任何处理', + + 'setting_attach_portal_article_attach' => '门户附件', + 'setting_attach_portal_article_img_thumb_closed' => '开启文章图片缩略图', + 'setting_attach_portal_article_img_thumb_closed_comment' => '是否开启文章上传图片的缩略图', + 'setting_attach_portal_article_imgsize' => '文章图片缩略图尺寸', + 'setting_attach_portal_article_imgsize_comment' => '如果上传一些尺寸很大的数码图片,则程序会按照本设置进行生成相应的小图片,默认大小为 300*300', + + 'setting_attach_antileech' => '防盗链设置', + 'setting_attach_antileech_expire' => '附件链接有效期', + 'setting_attach_antileech_expire_comment' => '单位:小时,0 或留空表示附件链接永久有效,过期后链接自动更新。本功能可有效防止附件被盗链或附件被软件批量下载,但是会给会员的正常下载带来不便', + 'setting_attach_antileech_refcheck' => '下载附件来路检查', + 'setting_attach_antileech_refcheck_comment' => '选择“是”将检查下载附件的来路,来自其他网站或站点的下载请求将被禁止。注意: 本功能在开启“文章中显示图片附件”时,会加重服务器负担', + 'setting_attach_antileech_remote_hide_dir' => '隐藏远程附件真实路径', + 'setting_attach_antileech_remote_hide_dir_comment' => '选择是,将加重本地服务器负担,并明显增加本地服务器流量;选择否,下载的附件与上传的附件文件名将会不一致', + + 'setting_imgwater' => '水印设置', + 'setting_imgwater_portal' => '文章', + 'setting_imgwater_forum' => '论坛', + 'setting_imgwater_album' => '空间相册', + 'setting_imgwater_preview' => '预览', + 'setting_imgwater_preview_comment' => '请先提交后再预览', + 'setting_imgwater_preview_portal' => '预览水印效果', + 'setting_imgwater_preview_forum' => '预览水印效果', + 'setting_imgwater_preview_album' => '预览水印效果', + + 'setting_search' => '搜索设置', + 'setting_search_status' => '开启搜索', + 'setting_search_status_portal' => '搜索文章', + 'setting_search_status_forum' => '搜索论坛', + 'setting_search_status_blog' => '搜索日志', + 'setting_search_status_album' => '搜索相册', + 'setting_search_status_group' => '搜索圈子', + 'setting_search_status_collection' => '搜索淘专辑', + 'setting_search_status_comment' => '勾选您要开启的搜索栏目', + 'setting_search_onoff' => '开启', + 'search_item_name' => '搜索项目', + + 'setting_search_srchsetting' => '搜索选项设置', + 'setting_search_srchcensor' => '搜索受词语过滤控制', + + 'setting_search_srchhotkeywords' => '热门关键词', + 'setting_search_srchhotkeywords_comment' => '每行一个', + + 'settings_sphinx' => 'Sphinx 全文检索设置', + 'settings_sphinx_sphinxon' => '是否开启', + 'settings_sphinx_sphinxon_comment' => '设置是否开启 Sphinx 全文检索功能,开启前确认 Sphinx 安装及配置成功', + 'settings_sphinx_sphinxhost' => '设置 Sphinx 主机名,或者 Sphinx 服务 socket 地址', + 'settings_sphinx_sphinxhost_comment' => '填写 Sphinx 主机名:例如,本地主机填写“localhost”,或者填写 Sphinx 服务 socket 地址,必须是绝对地址:例如,/tmp/sphinx.sock', + 'settings_sphinx_sphinxport' => '设置 Sphinx 主机端口', + 'settings_sphinx_sphinxport_comment' => '填写 Sphinx 主机端口:例如,3312,主机名填写 socket 地址的,则此处不需要设置', + 'settings_sphinx_sphinxsubindex' => '设置标题索引名', + 'settings_sphinx_sphinxsubindex_comment' => '填写 Sphinx 配置中的标题主索引名及标题增量索引名:例如,“threads,threads_minute”。
          注意:多个索引使用半角逗号 "," 隔开,必须按照 Sphinx 配置文件中的索引名填写', + 'settings_sphinx_sphinxmsgindex' => '设置全文索引名', + 'settings_sphinx_sphinxmsgindex_comment' => '填写 Sphinx 配置中的全文主索引名及全文增量索引名:例如,“posts,posts_minute”。
          注意:多个索引使用半角逗号 "," 隔开,必须按照 Sphinx 配置文件中的索引名填写', + 'settings_sphinx_sphinxmaxquerytime' => '设置最大搜索时间', + 'settings_sphinx_sphinxmaxquerytime_comment' => '填写最大搜索时间,以毫秒为单位。参数必须是非负整数。默认值为 0,意思是不做限制', + 'settings_sphinx_sphinxlimit' => '设置最大返回匹配项数目', + 'settings_sphinx_sphinxlimit_comment' => '填写最大返回匹配项数目,必须是非负整数,默认值10000', + 'settings_sphinx_sphinxrank' => '设置全文索引评分模式', + 'settings_sphinx_sphinxrank_comment' => '(1)SPH_RANK_PROXIMITY_BM25, 默认模式,同时使用词组评分和 BM25 评分,并且将二者结合。[默认] +
          (2)SPH_RANK_BM25,统计相关度计算模式,仅使用 BM25 评分计算(与大多数全文检索引擎相同)。这个模式比较快,但是可能使包含多个词的查询的结果质量下降。 +
          (3)SPH_RANK_NONE,禁用评分的模式,这是最快的模式。实际上这种模式与布尔搜索相同。所有的匹配项都被赋予权重1', + + 'setting_ranklist' => '排行榜设置', + 'setting_ranklist_all' => '全部', + 'setting_ranklist_other' => '其他', + 'setting_ranklist_member' => '用户', + 'setting_ranklist_thread' => '文章', + 'setting_ranklist_blog' => '日志', + 'setting_ranklist_poll' => '投票', + 'setting_ranklist_activity' => '活动', + 'setting_ranklist_picture' => '图片', + 'setting_ranklist_forum' => '版块', + 'setting_ranklist_group' => '圈子', + 'setting_ranklist_status' => '是否开启排行榜', + 'setting_ranklist_index_select' => '排行榜首页排行时间类型', + 'setting_ranklist_block_set' => '排行榜详细模块设置', + 'setting_ranklist_block_name' => '模块名称', + 'setting_ranklist_index_cache_time' => '排行榜首页缓存时间', + 'setting_ranklist_index_cache_time_comment' => '单位:小时', + 'setting_ranklist_cache_time' => '缓存时间(单位:小时)', + 'setting_ranklist_ignorefid' => '不参与排行的版块/圈子', + 'setting_ranklist_ignorefid_comment' => '填入版块ID或圈子ID,对应版块及下面的主题将不进入排行榜,多个版块ID间请用半角逗号 "," 隔开', + 'setting_ranklist_member_show' => '竞价排名功能开启', + 'setting_ranklist_member_show_comment' => '开启用户模块下竞价排名功能', + 'setting_ranklist_member_show_announcement' => '竞价排名功能公告信息', + 'setting_ranklist_member_show_announcement_comment' => '填入竞价排名功能公告信息', + 'setting_ranklist_show_num' => '显示条数', + 'setting_ranklist_block_comment' => '请根据服务器的负载情况,设置合理的更新时间间隔,建议最少不能低于 5 小时。显示条数越多负载越高,建议最多不要超过100条,默认为 20 条', + 'setting_ranklist_show_num_comment' => '更改条数后,缓存更新后才会显示', + 'setting_ranklist_update_cache' => '更新缓存', + 'setting_ranklist_update_cache_choose' => '选择更新缓存模块', + 'setting_ranklist_index' => '排行榜首页', + 'setting_ranklist_cache_comment' => '请根据服务器的负载情况,合理选择需要更新缓存的模块,选的模块越多服务器的负载越高', + + 'setting_profile_field' => '可选的资料项(点此启用新资料项)', + + 'tag' => '标签管理', + 'tag_set' => '设置', + 'tag_enable' => '是否启用标签', + 'tag_tagitem_num' => '标签关联主题数量', + 'tag_tagitem_num_comment' => '设置主题帖关联相关标签主题的数量,0 为不关联。注意: 数量太大会消耗服务器资源,推荐数目 10', + 'tag_index_num' => '首页显示标签数量', + 'tag_tagindex_num' => '标签页显示标签数量', + 'tag_thread_link_num' => '主题解析推荐标签数量', + 'tag_thread_link_num_comment' => '设置主题帖解析推荐标签的数目,0 为不解析。注意: 数量太大会消耗服务器资源,推荐数目 100', + 'tag_recommend' => '推荐标签', + 'tagname' => '标签名称', + 'tag_status' => '标签状态', + 'tag_recommend_comment' => '每行一个推荐标签,标签长度在3-20个字符内', + 'tag_admin' => '标签管理', + 'tag_result' => '符合条件的标签数', + + 'collection' => '淘帖管理', + 'collection_date' => '发表时间', + 'collection_admin' => '管理专辑', + 'collection_comment' => '管理评论', + 'collection_recommend' => '首页推荐', + 'collection_name' => '淘专辑名称', + 'collection_ctid' => '淘专辑 ID', + 'collection_username' => '淘专辑作者', + 'collection_threadnum' => '淘专辑主题数', + 'collection_commentnum' => '淘专辑评论数', + 'collection_uid' => '淘专辑作者 UID', + 'collection_result' => '符合条件的淘专辑数', + 'collection_comment_message' => '评论内容', + 'collection_comment_cid' => '评论 ID', + 'collection_comment_username' => '评论人用户名', + 'collection_comment_uid' => '评论人 UID', + 'collection_comment_ratenum' => '评分', + 'collection_comment_rate' => '评分大于', + 'collection_comment_useip' => 'IP 地址', + 'collection_comment_result' => '符合条件的评论数', + 'collection_recommend_settings' => '首页推荐选项', + 'collection_recommend_existed' => '手动首页推荐', + 'collection_recommend_tips' => '还没有手动推荐任何淘专辑,去搜索几个专辑然后推荐到首页吧!', + 'collection_recommend_index_autonumber' => '首页推荐数量', + 'collection_recommend_index_autonumber_comment' => '设置后,会在首页推荐指定数量的热门专辑,设为“0”则关闭推荐功能。当手动推荐数量未达到设置的数量时,系统会自动推荐专辑。', + + 'usertag' => '用户标签', + 'usertag_list' => '管理', + 'usertag_count' => '目前共有 {tagcount} 个用户标签', + 'usertag_golist' => '返回列表', + 'usertag_add' => '批量添加', + 'usertag_add_tips' => '
        • 可以给线下活动的用户批量贴标签
        • 当只填写了标签,用户列表为空时,是批量添加用户标签
        • 如果标签和用户列表都有输入,说明是给指定用户批量贴标签
        • ', + 'usertag_add_tags' => '标签', + 'usertag_add_tags_comment' => '可以输入多个标签,多个标签可以用空格、逗号 分隔', + 'usertag_add_usernames' => '用户列表', + 'usertag_add_usernames_comment' => '可以输入多个用户,每行输入一个用户名', + 'usertag_user' => '用户', + 'usertag_send_notice' => '发通知', + 'mobile' => '手机', + 'secmobile' => '安全手机号', + 'setting_mobile' => '手机版设置', + 'setting_mobile_status' => '全局设置', + 'setting_mobile_portal' => '门户设置', + 'setting_mobile_forum' => '论坛设置', + 'setting_mobile_index' => '首页推荐设置', + 'setting_mobile_forums' => '版块设置', + 'setting_mobile_status_tips' => '
        • 本手机功能页仅支持WAP2.0(XHTML方式)以上的手机浏览器进行访问。
        • ', + 'setting_mobile_allowmobile' => '开启手机版', + 'setting_mobile_allowmobile_comment' => '开启本功能,用户使用手机访问论坛时,将自动跳转到手机版界面
          手机访问域名配置请进入: 全局 - 域名设置 - 应用域名
          底部导航设置请进入:界面 - 导航设置 - 底部导航', + 'setting_mobile_mobileforward' => '开启手机浏览器自动跳转', + 'setting_mobile_mobileforward_comment' => '开启后用户使用手机浏览器访问社区论坛功能页以外页面时自动跳转到论坛首页进行访问', + 'setting_mobile_preview' => '开启电脑访问手机版预览功能', + 'setting_mobile_preview_comment' => '当电脑浏览器访问手机版时,给予用户引导手机登录的预览页面,用户可以在电脑版中预览手机版首页', + 'setting_mobile_register' => '是否允许手机版注册', + 'setting_mobile_register_comment' => '是否开启手机版注册功能,手机注册不会对用户栏目中的注册页必填项进行检测
          请谨慎开启', + 'setting_mobile_simpletype' => '开启无图模式', + 'setting_mobile_simpletype_comment' => '默认显示图片,开启后,手机版不显示文章图片', + 'setting_mobile_cachetime' => '页面浏览缓存时间', + 'setting_mobile_cachetime_comment' => '设置访问过的页面在用户手机上保存的时间,留空或0为不缓存
          单位:秒', + 'setting_mobile_come_from' => '手机发帖来源自定义', + 'setting_mobile_come_from_comment' => '默认留空,如果填写,将在看帖页面"来自手机"处增加自定义文字或图标
          如:<a href=\'http://m.x.com\'>手机频道</a>
          此处支持HTML标签有:<a><font><span><strong><b><img>
          如果使用图标,请保证图片高度在16px(像素)以内', + 'setting_mobile_portal_catnav' => '开启首页频道导航', + 'setting_mobile_portal_catnav_comment' => '开启后门户首页将显示一级频道作为导航', + 'setting_mobile_portal_wzpicture' => '首页显示文章幻灯片', + 'setting_mobile_portal_wzpicture_comment' => '选“是”将显示门户频道文章的图片聚合幻灯片', + 'setting_mobile_portal_wzlist' => '首页显示文章列表', + 'setting_mobile_portal_wzlist_comment' => '选“是”将显示门户频道文章的聚合列表', + 'setting_mobile_forum_forumindex' => '论坛首页样式', + 'setting_mobile_forum_forumindex_guide' => '导读', + 'setting_mobile_forum_forumindex_grid' => '首页四格', + 'setting_mobile_forum_forumindex_forumlist' => '论坛版块', + 'setting_mobile_forum_forumindex_forumgrid' => '论坛版块含首页四格', + 'setting_mobile_forum_forumindex_comment' => '选择导读需要开启导读功能;
          选择首页四格需要开启首页四格功能;', + 'setting_mobile_forum_statshow' => '显示统计信息', + 'setting_mobile_forum_statshow_comment' => '开启后将在论坛首页顶部显示论坛统计信息,仅在论坛首页样式为论坛版块或论坛版块含首页四格模式下显示', + 'setting_mobile_forum_displayorder3' => '是否显示置顶贴', + 'setting_mobile_forum_displayorder3_comment' => '手机版功能,在文章列表页面中是否显示置顶贴,否为不显示', + 'setting_mobile_forum_topicperpage' => '每页显示主题数', + 'setting_mobile_forum_topicperpage_comment' => '主题列表页每页显示主题个数,为空时和界面设置保持一致
          当此处和界面设置数值不同时会导致手机端和电脑端分页不一致,请谨慎配置', + 'setting_mobile_forum_postperpage' => '主题内每页显示帖数', + 'setting_mobile_forum_postperpage_comment' => '主题内每页显示的文章数目,为空时和界面设置保持一致
          当此处和界面设置数值不同时会导致手机端和电脑端分页不一致,请谨慎配置', + 'setting_mobile_forum_forumview' => '首页分区展示方式', + 'setting_mobile_forum_forumview_comment' => '如“收起”,论坛首页将默认只展示分区标题
          用户需点击分区展开该分区下的版块列表', + 'setting_mobile_forum_iconautowidth' => '版块图标宽度自适应', + 'setting_mobile_forum_iconautowidth_comment' => '选“是”将不限制手机版版块图标的宽度', + 'pack' => '收起', + 'unwind' => '展开', + + 'setting_antitheft' => '防采集设置', + 'setting_antitheft_tips' => '
        • 防采集功能不影响正常用户浏览检验。
        • 可防止本站主题、文章和日志被非法采集。
        • 当IP同时存在于黑/白名单时,白名单优先。
        • 开启防采集功能后文章列表页面的文章预览功能将不可使用。
        • ', + 'setting_antitheft_status' => '防采集全局设置', + 'setting_antitheft_allow' => '是否开启防采集', + 'setting_antitheft_black' => '黑名单防采集过滤IP', + 'setting_antitheft_black_comment' => '当用户处于本列表中的 IP 地址时,全部进行防采集过滤。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 'setting_antitheft_white' => '白名单防采集过滤IP', + 'setting_antitheft_white_comment' => '当用户处于本列表中的 IP 地址时,可无限次数访问,不进行防采集过滤。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 'setting_antitheft_24_max' => '每日最大访问量', + 'setting_antitheft_24_max_comment' => '设置独立IP每日最大访问次数,推荐值200', + 'setting_antitheft_iplist' => '访问列表', + 'setting_antitheft_ip' => 'IP', + 'setting_antitheft_view' => '次数', + 'setting_antitheft_op' => '操作', + 'setting_antitheft_disable' => '不进行防采集的内容', + 'setting_antitheft_disable_thread' => '主题', + 'setting_antitheft_disable_article' => '文章', + 'setting_antitheft_disable_blog' => '日志', + 'setting_antitheft_choose_ip' => '请选择需要处理的IP地址', + 'setting_antitheft_add_white' => '加入白名单成功,访问记录已删除', + 'setting_antitheft_add_black' => '加入黑名单成功,访问记录已删除', + 'setting_antitheft_delete_view' => '访问记录删除成功', + 'setting_antitheft_choose_optype' => '请指定要进行的操作', + 'setting_antitheft_addwhitelist' => '加入白名单', + 'setting_antitheft_addblacklist' => '加入黑名单', + + 'setting_uc' => 'UCenter 设置', + 'setting_uc_tips' => '
        • 本设置在站点安装时自动生成,一般情况下请不要修改,修改前请备份 config/config_ucenter.php 文件,以防止修改错误导致站点无法运行
        • ', + 'setting_uc_linkstatus' => '通信情况', + 'setting_uc_linkstatus_correct' => '通信成功', + 'setting_uc_linkstatus_unfixed' => '通信失败,请检查通信配置,使用 UCenter 提供的 "应用的 UCenter 配置信息" 覆盖 config/config_ucenter.php 文件内的常量或尝试设置 UCenter IP 地址', + 'setting_uc_key' => 'UCenter 通信密钥', + 'setting_uc_key_comment' => '通信密钥用于在 UCenter 和 Discuz! 之间传输信息的加密,可包含任何字母及数字,请在 UCenter 与 Discuz! 设置完全相同的通讯密钥,以确保两套系统能够正常通信', + 'setting_uc_api' => 'UCenter 访问地址', + 'setting_uc_api_comment' => '如果您的 UCenter 访问地址发生了改变,请修改此项。不正确的设置可能导致站点功能异常,请小心修改。
          格式: http://www.sitename.com/uc_server (最后不要加\'/\')', + 'setting_uc_ip' => 'UCenter IP 地址', + 'setting_uc_ip_comment' => '如果您的服务器无法通过域名访问 UCenter 或者想通过指定的本机或内网 IP 直连,可以输入 UCenter 服务器的 IP 地址', + 'setting_uc_connect' => 'UCenter 连接方式', + 'setting_uc_connect_comment' => '采用接口方式时,站点和 Ucenter 通信采用远程方式,数据库方式需要您站点可以连接 UCenter 数据库', + 'setting_uc_connect_mysql' => '数据库方式', + 'setting_uc_connect_api' => '接口方式', + 'setting_uc_dbhost' => 'UCenter 数据库服务器', + 'setting_uc_dbhost_comment' => '可以是本地也可以是远程数据库服务器,如果 MySQL 端口不是默认的 3306,请填写如下形式:127.0.0.1:6033', + 'setting_uc_dbuser' => 'UCenter 数据库用户名', + 'setting_uc_dbpass' => 'UCenter 数据库密码', + 'setting_uc_dbname' => 'UCenter 数据库名', + 'setting_uc_dbtablepre' => 'UCenter 表前缀', + 'setting_uc_appid' => 'UCenter 应用 ID', + 'setting_uc_appid_comment' => '该值为当前站点在 UCenter 的应用 ID,一般情况请不要改动', + 'setting_uc_activation' => '是否允许其他应用的会员在站点激活', + 'setting_uc_activation_comment' => '选择“是”,允许会员在本站点激活;选择“否”,则不允许任何第三方应用在本站点激活', + 'setting_uc_fastactivation' => '是否允许直接激活', + 'setting_uc_fastactivation_comment' => '选择“是”,用户登录即自动激活;选择“否”,允许用户激活,但必须填写注册设置中的必填项', + 'setting_uc_avatarmethod' => '头像调用方式', + 'setting_uc_avatarmethod_comment' => '设置用户头像的调用方式,动态方式依靠服务器检测头像的存在情况,静态方式不检测,用户直接请求头像并在失败后加载默认头像。', + 'setting_uc_avatarmethod_0' => '使用动态方式调用头像', + 'setting_uc_avatarmethod_1' => '使用静态方式调用头像', + 'setting_uc_dynavt' => '头像缓存机制', + 'setting_uc_dynavt_comment' => '设置用户头像的缓存机制,仅在动态调用模式下生效,可以避免更换头像后无法及时看到的问题,但会增加一些服务器压力。', + 'setting_uc_dynavt_0' => '自动(完全由用户浏览器处理,性能最好)', + 'setting_uc_dynavt_1' => '用户自身头像带更新时间戳,其他头像自动', + 'setting_uc_dynavt_2' => '全部带更新时间戳(可能会增加服务器压力)', + + + 'setting_ec' => '电子商务基本设置', + 'setting_ec_credittrade' => '积分兑换设置', + 'setting_ec_goodstrade' => '商品相关设置', + 'setting_ec_ratio' => '现金/积分兑换比率', + 'setting_ec_ratio_comment' => '设置真实货币现金(以人民币元为单位)与站点交易积分间的兑换比率,例如设置为 10,则 1 元人民币可以兑换 10 个单位的交易积分。本功能需开启交易积分,并成功进行收款账号的相关设置后方可使用,如果禁止使用现金与交易积分的兑换功能,请设置为 0', + 'setting_ec_mincredits' => '单次购买最小积分数额', + 'setting_ec_mincredits_comment' => '设置用户一次支付所购买的交易积分的最小数额,单位为交易积分的单位,0 为不限制', + 'setting_ec_maxcredits' => '单次购买最大积分数额', + 'setting_ec_maxcredits_comment' => '设置用户一次支付所购买的交易积分的最大数额,单位为交易积分的单位,0 为不限制', + 'setting_ec_maxcreditspermonth' => '每月购买最大积分数额', + 'setting_ec_maxcreditspermonth_comment' => '设置用户每月能够通过在线支付方式购买的交易积分的最大数额,单位为交易积分的单位,0 为不限制', + 'setting_ec_imagewidthheight' => '商品图片大小', + 'setting_ec_imagewidthheight_comment' => '设置商品主题商品图片的显示大小', + 'setting_ec_biosize' => '店铺介绍文字最大长度', + 'setting_ec_biosize_comment' => '设置用户店铺介绍最大字节数,0 为使用系统默认值 400', + 'setting_ec_type' => '商品主题内置类别', + 'setting_ec_type_comment' => '从分类信息中选择提供给商品主题使用的类别。注意: 当您设置完毕此参数后可以在版块详细设置中分配版块可使用的类别,如果您不指定版块的可用类别,那么版块默认可使用全部类别', + + 'forums' => '版块', + 'forums_admin' => '版块管理', + 'forums_admin_add_category' => '添加新分区', + 'forums_admin_add_category_name' => '新分区名称', + 'forums_admin_add_forum' => '添加新版块', + 'forums_admin_add_forum_name' => '新版块名称', + 'forums_admin_add_sub' => '添加子版块', + 'forums_admin_add_sub_name' => '子版块名称', + 'forums_admin_no_moderator' => '无 / 添加版主', + 'forums_admin_name' => '版块名称', + 'forums_admin_tips' => '
        • 版主用户名为粗体,则表示该版主权限可继承到下级版块
        • ', + 'forums_admin_hidden' => '隐藏', + 'forums_admin_password' => '密码', + 'forums_admin_url' => '外链', + 'forums_relation' => '关联版块', + + 'forums_grid' => '首页四格', + 'forums_grid_tips' => '
        • 开启后在论坛首页会显示四格内容推荐
        • ', + 'forums_grid_show_grid' => '是否开启首页四格', + 'forums_grid_show_grid_comment' => '在论坛首页展示四格内容', + 'forums_grid_style_type' => '展示风格', + 'forums_grid_style_type_comment' => '图文并茂: 幻灯+新帖+新回复+热帖; 简洁文字:新帖+新回复+热帖+精华贴;', + 'forums_grid_style_image' => '图文并茂', + 'forums_grid_style_text' => '简洁文字', + 'forums_grid_data_source' => '数据来源版块', + 'forums_grid_data_source_comment' => '数据来源版块,默认为所有版块,可以按住 CTRL 多选', + 'forums_grid_text_length' => '标题截取长度', + 'forums_grid_text_length_comment' => '设置标题的最大长度,超过的部分将被截取掉, 单位:字符', + 'forums_grid_high_light' => '是否显示主题高亮', + 'forums_grid_high_light_comment' => '在首页四格中显示主题高亮效果', + 'forums_grid_target_blank' => '是否在新窗口打开', + 'forums_grid_show_tips' => '是否显示文章信息', + 'forums_grid_show_tips_comment' => '鼠标移到标题上方时,显示文章详细信息', + 'forums_grid_target_blank_comment' => '在新窗口中打开链接', + 'forums_grid_cache_life' => '缓存有效期', + 'forums_grid_cache_life_comment' => '设置论坛首页四格缓存更新的时间,单位为秒,0代表默认600秒', + 'show_all' => '全部展开', + 'hide_all' => '全部折叠', + + 'forums_cat_detail' => '分区详细设置', + 'forums_cat_display' => '显示分区', + 'forums_cat_display_comment' => '选择“否”将暂时将分区隐藏不显示,但分区内容仍将保留,且用户仍可通过 URL 访问到此分区及其版块', + 'forums_edit' => '编辑版块', + 'forums_edit_comment' => '编辑本版块设置', + 'forums_edit_inherited' => '继承上级版块设置', + 'forums_edit_newinherited' => '继承指定版块设置', + 'forums_edit_tips' => '
        • 以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。
        • ', + 'forums_edit_switch' => '切换版块 / 批量编辑', + 'forums_multiedit' => '批量编辑所选版块', + + 'forums_edit_basic' => '基本设置', + 'forums_edit_basic_cat_name' => '分区名称', + 'forums_edit_basic_cat_name_color' => '分区名称颜色', + 'forums_edit_basic_cat_style' => '分区风格方案(会影响该分区下的子版块)', + 'forums_edit_basic_cat_style_comment' => '访问者进入分区版块及子版块(子版块不同于分区风格,可单独设置)所使用的风格方案', + 'forums_edit_basic_name' => '版块名称', + 'forums_edit_base_name_color' => '版块名称颜色', + 'forums_edit_basic_scheme' => '站点设置方案', + 'forums_edit_basic_scheme_comment' => '如果选择了版块设置方案,下面除版块基本设置外,其他设置将以所选方案为准', + 'forums_edit_basic_display' => '显示版块', + 'forums_edit_basic_display_comment' => '选择“不显示”将暂时将版块隐藏不显示,但版块内容仍将保留,且用户仍可通过直接提供带有 fid 的 URL 访问到此版块', + 'forums_edit_basic_shownav' => '在导航显示', + 'forums_edit_basic_shownav_comment' => '选择是否在主导航中显示', + 'forums_edit_basic_up' => '上级版块', + 'forums_edit_basic_up_comment' => '本版块的上级版块或分类', + 'forums_edit_basic_redirect' => '版块转向 URL', + 'forums_edit_basic_redirect_comment' => '如果设置转向 URL(例如 https://www.discuz.vip),用户点击本分版块将进入转向中设置的 URL。一旦设定将无法进入版块页面,请确认是否需要使用此功能,留空为不设置转向 URL', + 'forums_edit_basic_icon' => '版块图标', + 'forums_edit_basic_icon_width' => '图标宽度 (单位: px)', + 'forums_edit_basic_banner' => '顶部图片', + 'forums_edit_basic_basic_icon_comment' => '版块名称和简介左侧的小图标,可填写相对或绝对地址。如使用 Flash 动画,请用逗号隔开 URL,宽度和高度,如“forum.swf,80,40”', + 'forums_edit_basic_description' => '版块简介', + 'forums_edit_basic_description_comment' => '将显示于版块名称的下面,提供对本版块的简短描述
          支持内置的 Discuz! 代码', + 'forums_edit_basic_rules' => '本版块规则', + 'forums_edit_basic_rules_comment' => '显示于主题列表页的当前版块规则,留空为不显示
          支持内置的 Discuz! 代码', + 'forums_edit_basic_seotitle' => 'title', + 'forums_edit_basic_keyword' => 'keywords', + 'forums_edit_basic_keyword_comment' => 'keywords用于搜索引擎优化,放在 meta 的 keyword 标签中,多个关键字间请用半角逗号 "," 隔开', + 'forums_edit_basic_seodescription' => 'description', + 'forums_edit_basic_seodescription_comment' => 'description用于搜索引擎优化,放在 meta 的 description 标签中', + 'forums_edit_basic_threadtable' => '关联主题存档表', + 'forums_edit_basic_threadtable_comment' => '关联一个主题存档表后,此版块将作为主题存档版块,仅可以浏览存档表中的主题,不能进行回复、删除等操作', + 'forums_edit_basic_threadtable_norelate' => '不关联', + 'forums_edit_basic_keys' => '绑定别名', + 'forums_edit_basic_keys_comment' => '绑定后当站点开启 URL 静态化后可通过别名访问此版块,如设置别名为“developer”那么版块的 URL 将变为“'.$_G['siteurl'].'forum-developer-1.html”。注意:别名中只能包含字母或数字,且不能是纯数字', + 'forums_edit_basic_binddomain' => '绑定域名', + 'forums_edit_basic_binddomain_comment' => '绑定后可以通过该域名访问此版块', + + 'forums_edit_extend' => '扩展设置', + 'forums_edit_extend_style' => '风格方案', + 'forums_edit_extend_style_comment' => '访问者进入本版块所使用的风格方案', + 'forums_edit_extend_domain' => '绑定域名', + 'forums_edit_extend_domain_comment' => '根域名设置完后,此处域名绑定才能生效,设置根域名', + 'forums_edit_extend_forum_horizontal' => '论坛首页下级子版块横排', + 'forums_edit_extend_forum_horizontal_comment' => '设置进入论坛首页时下级子版块横排时每行版块数量,如果设置为 0,则按正常方式排列', + 'forums_edit_extend_sub_horizontal' => '论坛版块下级子版块横排', + 'forums_edit_extend_sub_horizontal_comment' => '设置进入论坛版块时下级子版块横排时每行版块数量,如果设置为 0,则按正常方式排列', + 'forums_edit_extend_cat_sub_horizontal' => '分区下级子版块横排', + 'forums_edit_extend_cat_sub_horizontal_comment' => '设置进入分区时,下级子版块横排时每行版块数量,如果设置为 0,则按正常方式排列', + 'forums_edit_extend_subforumsindex' => '本版块在首页显示下级子版块', + 'forums_edit_extend_subforumsindex_comment' => '首页版块列表中在版块简介下方显示下级子版块名字和链接(如果存在的话)。注意: 本功能不考虑子版块特殊浏览权限的情况,只要存在即会被显示出来。选择“默认”,将使用全局设置', + 'forums_edit_extend_simple' => '只显示下级子版块', + 'forums_edit_extend_simple_comment' => '选择“是”将不显示本版块的主题列表、发帖按钮等等,类似于一个分类', + 'forums_edit_extend_widthauto' => '本版块宽窄风格', + 'forums_edit_extend_widthauto_comment' => '设置本版块的显示风格是宽版还是窄版,设置后用户将无法自由切换宽窄风格。默认表示继承全局设置', + 'forums_edit_extend_widthauto_-1' => '窄屏(固定宽度)', + 'forums_edit_extend_widthauto_1' => '宽屏(自由宽度)', + 'forums_edit_extend_picstyle' => '开启图片列表模式', + 'forums_edit_extend_picstyle_comment' => '主题列表将以图片方式显示,主题封面可统一设置宽高', + 'forums_edit_extend_allowside' => '显示边栏', + 'forums_edit_extend_allowside_comment' => '选择“是”版块首页侧边将显示聚合本版内容的信息', + 'forums_edit_extend_disablecollect' => '禁止淘帖', + 'forums_edit_extend_disablecollect_comment' => '选择“是”将禁止用户淘帖本版主题', + 'forums_edit_extend_defaultorderfield' => '主题默认排序字段', + 'forums_edit_extend_defaultorderfield_comment' => '设置版块的主题列表默认按照哪个字段进行排序显示。默认为“回复时间”,除默认设置外其他排序方式会加重服务器负担', + 'forums_edit_extend_defaultorder' => '主题默认排序方式', + 'forums_edit_extend_defaultorder_comment' => '设置版块的主题列表默认排序的方式。默认为“按降序排列”,除默认设置外其他排序方式会加重服务器负担', + 'forums_edit_extend_order_lastpost' => '回复时间', + 'forums_edit_extend_order_starttime' => '发布时间', + 'forums_edit_extend_order_replies' => '回复数量', + 'forums_edit_extend_order_views' => '浏览次数', + 'forums_edit_extend_order_desc' => '按降序排列', + 'forums_edit_extend_order_asc' => '按升序排列', + 'forums_edit_extend_reply_background' => '快捷回复框背景图片', + 'forums_edit_extend_reply_background_comment' => '设置后将在快速回复框中展现该图片', + 'forums_edit_extend_threadcache' => '页面缓存系数', + 'forums_edit_extend_threadcache_comment' => '此功能可以将游客经常访问的主题临时缓存起来,缓解大型服务器压力。系数范围 0~100,建议数值 20 ~ 40,0 为关闭缓存。在磁盘空间允许的情况下,适当调高缓存系数,可以提高缓存效果
          注:版块设置完毕后请到 全局 -> 优化设置 -> 站点页面缓存设置,调整其缓存时间', + 'forums_edit_extend_relatedgroup' => '关联圈子/版块', + 'forums_edit_extend_relatedgroup_comment' => '填写被关联圈子/版块的fid,以半角逗号 "," 隔开。版块的主题列表页将显示被关联圈子/版块的主题', + 'forums_edit_extend_edit_rules' => '允许版主修改本版块规则', + 'forums_edit_extend_edit_rules_comment' => '设置是否允许超级版主和版主修改本版规则', + 'forums_edit_extend_recommend' => '是否开启推荐主题功能', + 'forums_edit_extend_recommend_comment' => '设置是否开启推荐主题功能', + 'forums_edit_extend_recommend_sort' => '版主推荐主题方式', + 'forums_edit_extend_recommend_sort_auto' => '自动生成', + 'forums_edit_extend_recommend_sort_manual' => '手动生成', + 'forums_edit_extend_recommend_sort_mix' => '半自动生成', + 'forums_edit_extend_recommend_sort_comment' => '自动生成则按照推荐主题规则设定生成推荐列表。
          手动生成则由版主自行推荐生成推荐列表。
          半自动生成则和手动方式类似,当手动生成的列表条数不足设置的显示条数时,将按照推荐主题规则自动补足相差条数', + 'forums_edit_extend_recommend_num' => '推荐主题显示数量', + 'forums_edit_extend_recommend_num_comment' => '推荐主题显示的数量,默认为 10 条,建议不要超过 20 条', + 'forums_edit_extend_recommend_imagenum' => '推荐主题图片附件显示数量', + 'forums_edit_extend_recommend_imagenum_comment' => '推荐主题中图片附件显示的数量,默认为 5 条。设置为 0 则不显示,建议不要超过 10 条', + 'forums_edit_extend_recommend_imagesize' => '推荐主题图片附件显示大小', + 'forums_edit_extend_recommend_imagesize_comment' => '推荐主题中图片附件显示的大小,默认为 300 x 250', + 'forums_edit_extend_recommend_orderby' => '推荐主题规则', + 'forums_edit_extend_recommend_orderby_dateline' => '按发帖时间', + 'forums_edit_extend_recommend_orderby_lastpost' => '按最后回复时间', + 'forums_edit_extend_recommend_orderby_views' => '按查看数', + 'forums_edit_extend_recommend_orderby_replies' => '按回复数', + 'forums_edit_extend_recommend_orderby_digest' => '按精华帖', + 'forums_edit_extend_recommend_orderby_recommend' => '按评价指数', + 'forums_edit_extend_recommend_orderby_heats' => '按主题热度', + 'forums_edit_extend_recommend_orderby_comment' => '推荐主题规则,只对自动和半自动生成推荐主题列表有效,此规则均为降序排列', + 'forums_edit_extend_recommend_maxlength' => '标题最大字节数', + 'forums_edit_extend_recommend_maxlength_comment' => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 'forums_edit_extend_recommend_cachelife' => '数据缓存时间(秒)', + 'forums_edit_extend_recommend_cachelife_comment' => '由于一些排序检索操作比较耗费资源,建议设置为 900 的数值', + 'forums_edit_extend_recommend_dateline' => '推荐主题时间段', + 'forums_edit_extend_recommend_dateline_comment' => '按照设置的排序方式,取从访问推荐主题列表这一刻往前推送时间段内的主题,自动生成推荐主题列表,单位为小时,设置成0为所有时段', + 'forums_edit_extend_recommend_top' => '显示全局置顶和分类置顶的主题', + 'forums_edit_extend_recommend_top_comment' => '是否在本版显示全局置顶和分版置顶', + 'forums_edit_sub_multi_tips' => '子版块无需修改', + + 'forums_edit_posts' => '文章选项', + 'forums_edit_posts_modposts' => '发帖审核', + 'forums_edit_posts_modposts_comment' => '选择“是”将使用户在本版发表的文章待版主或管理员审查通过后才显示出来,打开此功能后,您可以在用户组中设定哪些组发帖可不经审核,也可以在管理组中设定哪些组可以审核别人的文章', + 'forums_edit_posts_alloweditpost' => '允许编辑文章', + 'forums_edit_posts_alloweditpost_comment' => '选择“是”将允许用户编辑本版发表的文章', + 'forums_edit_posts_modposts_threads' => '审核新主题', + 'forums_edit_posts_modposts_posts' => '审核新主题和新回复', + 'forums_edit_posts_recyclebin' => '回收站', + 'forums_edit_posts_recyclebin_comment' => '是否在本版启用回收站功能,打开此功能后,所有被删除主题和回帖将被放在回收站中,而不会被直接删除', + 'forums_edit_posts_html' => '允许使用 HTML 代码', + 'forums_edit_posts_html_comment' => '注意: 选择“是”将不屏蔽文章中的任何代码,将带来严重的安全隐患,请慎用', + 'forums_edit_posts_bbcode' => '允许使用Discuz!代码', + 'forums_edit_posts_bbcode_comment' => 'Discuz! 代码是一种简化和安全的页面格式代码', + 'forums_edit_posts_imgcode' => '允许使用 [img] 代码', + 'forums_edit_posts_imgcode_comment' => '允许 [img] 代码作者将可以在文章插入其他网站的图片并显示', + 'forums_edit_posts_mediacode' => '允许使用多媒体代码', + 'forums_edit_posts_mediacode_comment' => '允许 [audio] [media] [flash] 等多媒体代码后,作者将可以在文章插入多媒体文件并显示', + 'forums_edit_posts_smilies' => '允许使用表情', + 'forums_edit_posts_smilies_comment' => '表情提供对表情符号,如“:)”的解析,使之作为图片显示', + 'forums_edit_posts_jammer' => '启用内容干扰码', + 'forums_edit_posts_jammer_comment' => '选择“是”将在文章内容中增加随机的干扰字串,使得访问者无法复制原始内容。注意: 本功能会轻微加重服务器负担', + 'forums_edit_posts_anonymous' => '允许匿名发帖', + 'forums_edit_posts_anonymous_comment' => '是否允许用户在本版匿名发表主题和回复,只要用户组或本版块允许,用户均可使用匿名发帖功能。匿名发帖不同于游客发帖,用户需要登录后才可使用,版主和管理员可以查看真实作者', + 'forums_edit_posts_disablethumb' => '禁用图片附件添加缩略图', + 'forums_edit_posts_disablethumb_comment' => '选择“是”将不对本版块上传的图片附件自动缩略图,即便全局设置中开启了此项功能。选择“否”为按照系统默认设置决定是否添加缩略图', + + 'forums_edit_posts_disablewatermark' => '禁用图片附件添加水印', + 'forums_edit_posts_disablewatermark_comment' => '选择“是”将不对本版块上传的图片附件自动添加水印,即便全局设置中开启了此项功能。选择“否”为按照系统默认设置决定是否添加水印', + 'forums_edit_posts_tagstatus' => '启用主题标签(TAG)', + 'forums_edit_posts_tagstatus_comment' => '设置当前版块使用主题标签功能的方式', + 'forums_edit_posts_tagstatus_none' => '不使用', + 'forums_edit_posts_tagstatus_use' => '使用', + 'forums_edit_posts_tagstatus_quired' => '使用且自动生成', + 'forums_edit_posts_trade' => '允许发起交易', + 'forums_edit_posts_trade_thread' => '显示“发布商品”按钮', + 'forums_edit_posts_trade_type' => '商品主题内置类别', + 'forums_edit_posts_trade_type_comment' => '设置本版块可用的商品主题内置类别,本功能只有在开启了商品主题后有效', + 'forums_edit_posts_trade_payto' => '显示“用支付宝求购”按钮', + 'forums_edit_posts_trade_payto_comment' => '设置本版块的商品主题是否显示“用支付宝求购”的按钮', + 'forums_edit_posts_allowpostspecial' => '允许发布的特殊主题', + 'forums_edit_posts_threadplugin' => '允许发布的扩展特殊主题', + 'forums_edit_posts_threadplugin_comment' => '设置本版允许发布哪些其他扩展的特殊主题', + 'forums_edit_posts_allowspecialonly' => '只允许发布特殊类型主题', + 'forums_edit_posts_allowspecialonly_comment' => '设置本版是否只允许发布特殊类型主题', + 'forums_edit_posts_trade_comment' => '设置是否在本版显示和支持社区电子商务交易功能', + 'forums_edit_posts_autoclose' => '主题自动关闭', + 'forums_edit_posts_autoclose_comment' => '设置主题是否在某时间后自动关闭,禁止普通用户回复', + 'forums_edit_posts_autoclose_none' => '不自动关闭', + 'forums_edit_posts_autoclose_dateline' => '按发布时间自动关闭', + 'forums_edit_posts_autoclose_lastpost' => '按最后回复时间自动关闭', + 'forums_edit_posts_autoclose_time' => '自动关闭时间(天)', + 'forums_edit_posts_autoclose_time_comment' => '本设定必须在“主题自动关闭”功能打开时才生效,主题依据自动关闭的设定: 在发表后若干天、或被最后回复后若干天被自动转入关闭状态,从而使普通用户无法回复', + 'forums_edit_posts_attach_ext' => '允许附件类型(小写)', + 'forums_edit_posts_attach_ext_comment' => '设置允许上传的附件扩展名,多个扩展名之间用半角逗号 "," 隔开。本设置的优先级高于用户组,留空为按照用户组允许的附件类型设定', + 'forums_edit_posts_allowfeed' => '允许发送广播和动态', + 'forums_edit_posts_allowfeed_comment' => '开启后默认允许用户发送广播和动态,同时用户也可以选择不发送,隐私版块建议设为否。如果关闭广播功能,该设置将无效。', + 'forums_edit_posts_commentitem' => '普通主题点评预置观点', + 'forums_edit_posts_commentitem_comment' => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点。只有开启文章点评功能后本设置才生效,如留空表示使用全局的“普通主题点评预置观点”设置', + 'forums_edit_posts_noantitheft' => '关闭防采集', + 'forums_edit_posts_noantitheft_comment' => '关闭防采集功能可节省少量服务器资源,建议灌水类版块关闭防采集功能。', + 'forums_edit_posts_noforumhidewater' => '关闭隐藏水帖', + 'forums_edit_posts_noforumhidewater_comment' => '可单独关闭本版的隐藏水帖功能,适用于灌水类版块。', + 'forums_edit_posts_noforumrecommend' => '关闭推荐回复', + 'forums_edit_posts_noforumrecommend_comment' => '可单独关闭本版的推荐回复功能,适用于灌水类版块。', + + 'forums_edit_attachtype' => '附件类型', + 'forums_edit_attachtype_tips' => '
        • 本功能可限定本版块某特定类型附件的最大尺寸,当这里设定的尺寸小于用户组允许的最大尺寸时,指定类型的附件尺寸限制将按本设定为准。
        • 您可以设置某类附件最大尺寸为 0 以整体禁止这类附件被上传。
        • 此处设置留空则使用全局的“附件类型尺寸”设置。
        • ', + + 'forums_edit_credits' => '积分策略', + 'forums_edit_credits_policy' => '扩展积分增减策略', + 'forums_edit_credits_comment' => '各项积分增减允许的范围为 -99~+99。括号中数字为全局积分策略中设定的值。查看本版积分策略说明', + + 'forums_edit_threadtypes' => '主题分类', + 'forums_edit_threadtypes_comment' => '您可以启用已有的主题分类或添加新主题分类应用于本版块,在分类很多的情况下,建议只有重要的分类使用“平板显示”方式,更多的分类使用“下拉显示”方式', + 'forums_edit_threadtypes_config' => '主题分类', + 'forums_edit_threadtypes_tips' => '
          • “主题分类”用于给分版块中的主题进行归类。作者在发表新主题时,可以按照预设的类型给主题归类;用户也可以在版块中按照类别地进行浏览(需在“编辑版块”中设定)。与子版块功能不同的是,主题分类只用来归类特定版块中的文章,适用于相关性大而又需要某种分类的情况。
          • “主题分类”是全论坛共用的,您可以在“编辑版块”中设置当前版块以某些类型来将主题分类。
          • 如果您将某些主题分类更名、删除或修改显示顺序,请编辑与此分类相关联的版块(不需做任何改动)后提交,主题分类才能被更新。
          ', + 'forums_edit_threadtypes_name' => '分类名称', + 'forums_edit_threadtypes_note' => '分类说明', + 'forums_edit_threadtypes_showtype' => '显示方式', + 'forums_edit_threadtypes_moderators' => '管理组专用', + 'forums_edit_threadtypes_icon' => '前缀图标', + 'forums_edit_threadtypes_use_cols' => '平板显示', + 'forums_edit_threadtypes_use_choice' => '下拉显示', + 'forums_edit_threadtypes_show' => '发帖菜单中显示', + 'forums_edit_threadtypes_status' => '启用主题分类', + 'forums_edit_threadtypes_status_comment' => '设置是否在本版块启用主题分类功能,您需要同时设定相应的分类选项,才能启用本功能', + 'forums_edit_threadtypes_required' => '发帖必须归类', + 'forums_edit_threadtypes_required_comment' => '是否强制用户发表新主题时必须选择分类', + 'forums_edit_threadtypes_listable' => '允许按类别浏览', + 'forums_edit_threadtypes_listable_comment' => '用户是否可以按照主题分类筛选浏览内容', + 'forums_edit_threadtypes_prefix' => '类别前缀', + 'forums_edit_threadtypes_prefix_comment' => '是否在主题前面显示分类的名称', + 'forums_edit_threadtypes_noprefix' => '不显示', + 'forums_edit_threadtypes_textonly' => '只显示文字', + 'forums_edit_threadtypes_icononly' => '只显示图标', + 'forums_edit_threadtypes_template_list' => '分类信息模板', + 'forums_edit_threadtypes_template_list_comment' => '该版块下分类信息使用模板', + 'forums_edit_threadtypes_defaultshow' => '默认显示分类', + 'forums_edit_threadtypes_options_comment' => '请勾选您期望在本版块中使用的类别选项,用户发表主题或浏览时,将可按照选中的类别归类或浏览。注意: 本功能必须“启用主题分类”后才可使用', + 'forums_edit_threadtypes_nonexistence' => '主题分类不存在,请添加', + + 'forums_edit_threadsorts' => '分类信息', + 'forums_edit_threadsorts_tips' => '
          • 正式使用后尽量不要修改添加字段,不要修改项目字段,以免造成数据丢失
          • 开启表单搜索,除number、select、radio字段类型外,其它字段类型对系统性能影响较大
          ', + 'forums_edit_threadsorts_status' => '启用分类信息', + 'forums_edit_threadsorts_defaultorderfield' => '主题默认排序字段', + 'forums_edit_threadsorts_defaultorderfield_comment' => '设置版块的主题列表默认按照哪个字段进行排序显示。默认为“回复时间”,除默认设置外其他排序方式会加重服务器负担', + 'forums_edit_threadsorts_defaultorder' => '主题默认排序方式', + 'forums_edit_threadsorts_defaultorder_comment' => '设置版块的主题列表默认排序的方式。默认为“按降序排列”,除默认设置外其他排序方式会加重服务器负担', + 'forums_edit_threadsorts_order_lastpost' => '回复时间', + 'forums_edit_threadsorts_order_starttime' => '发布时间', + 'forums_edit_threadsorts_order_replies' => '回复数量', + 'forums_edit_threadsorts_order_views' => '浏览次数', + 'forums_edit_threadsorts_order_desc' => '按降序排列', + 'forums_edit_threadsorts_order_asc' => '按升序排列', + 'forums_edit_threadsorts_subforumsindex' => '本版块在首页显示下级子版块', + 'forums_edit_threadsorts_subforumsindex_comment' => '首页版块列表中在版块简介下方显示下级子版块名字和链接(如果存在的话)。注意: 本功能不考虑子版块特殊浏览权限的情况,只要存在即会被显示出来。选择“默认”,将使用全局设置', + 'forums_edit_threadsorts_nonexistence' => '分类信息不存在,请到分类信息设置', + 'forums_edit_threadsorts_default' => '启用默认显示分类', + 'forums_edit_threadsorts_default_comment' => '是否启用默认显示分类,如果启用请在下面的分类信息里面选择', + 'forums_edit_threadsorts_template_default' => '默认模板', + 'forums_edit_threadsorts_template_house' => '房地产模板', + + 'forums_edit_perm' => '权限相关', + 'forums_edit_perm_forum' => '版块权限', + 'forums_edit_perm_price' => '付费价格', + 'forums_edit_perm_price_comment' => '当你设置了价格后,用户必须使用指定的交易积分付费后才可进入此版块。当价格增长时,用户还需要支付所增加的积分', + 'forums_edit_perm_passwd' => '访问密码', + 'forums_edit_perm_passwd_comment' => '当您设置密码后,用户必须输入密码才可以访问到此版块', + 'forums_edit_perm_formulapermmessage' => '无权限访问时的提示信息', + 'forums_edit_perm_formulapermmessage_comment' => '自定义无权限时的提示信息,如不填写则无权限时将显示权限表达式的公式', + 'forums_edit_perm_users' => '访问用户', + 'forums_edit_perm_users_comment' => '限定只有列表中的用户可以访问本版块,每行填写一个用户名', + 'forums_edit_perm_medal' => '拥有勋章', + 'forums_edit_perm_medal_comment' => '用户必须拥有指定的勋章才可访问此版块', + 'forums_edit_perm_view' => '浏览版块', + 'forums_edit_perm_post' => '发新话题', + 'forums_edit_perm_reply' => '发表回复', + 'forums_edit_perm_getattach' => '下载附件/查看图片', + 'forums_edit_perm_postattach' => '上传附件', + 'forums_edit_perm_postimage' => '上传图片', + 'forums_edit_perm_mask' => '特殊用户', + 'forums_edit_perm_forum_comment' => '某权限如果全部未选则表示如下含义:
            浏览版块,全部用户组具有浏览版块文章权限;发新话题,除游客以外的用户组具有发帖权限;发表回复,除游客以外的用户组具有回复权限;查看附件,全部用户组具有下载/查看附件权限;上传附件,除游客以外的用户组具有上传附件权限;上传图片,除游客以外的用户组具有上传图片权限', + 'forums_edit_perm_spview' => '不受限制的用户组', + 'forums_edit_perm_formula' => '权限表达式设置', + 'forums_edit_perm_formula_comment' => '当您设定了权限表达式后,只有符合此表达式的会员才可以浏览本版块。如 "posts > 100 and extcredits1 > 10" 表示 "发帖数 > 100 并且 威望 > 10"
          日期格式 "{Y-M-D}",如 "{2009-10-1}"。IP 格式 "{x.x.x.x}",既可输入完整地址,也可只输入 IP 开头,如 "{10.0.0.1}"、"{192.168.0}"', + 'forums_edit_perm_formula_and' => '并且', + 'forums_edit_perm_formula_or' => '或者', + 'forums_edit_perm_formula_digestposts' => '精华帖数', + 'forums_edit_perm_formula_posts' => '发帖数', + 'forums_edit_perm_formula_threads' => '主题数', + 'forums_edit_perm_formula_replies' => '回帖数', + 'forums_edit_perm_formula_oltime' => '在线时间(小时)', + 'forums_edit_perm_formula_pageviews' => '页面浏览量', + 'forums_edit_perm_formula_regdate' => '注册时间', + 'forums_edit_perm_formula_regday' => '注册天数', + 'forums_edit_perm_formula_regip' => '注册IP', + 'forums_edit_perm_formula_lastip' => '最后登录IP', + 'forums_edit_perm_formula_buyercredit' => '买家信用评价', + 'forums_edit_perm_formula_sellercredit' => '卖家信用评价', + 'forums_edit_perm_verify' => '用户认证', + + 'forums_edit_plugin' => '插件相关', + + 'forums_copy' => '设置复制', + 'forums_copy_comment' => '将本版块的设置复制到其他版块', + 'forums_copy_tips' => '
        • 版块设置复制可将源版块栏目的某些设置应用到其他多个版块,用于以一个版块的设置为基础,快速设置一批版块。
        • 版块设置复制一旦提交立即生效,并无法恢复,请仔细选择目标版块和设置项目。
        • ', + 'forums_copy_source' => '源版块', + 'forums_copy_target' => '目标版块', + 'forums_copy_target_comment' => '选择要将源版块复制到哪些目标版块,可以按住 CTRL 多选', + 'forums_copy_options' => '项目选择', + 'forums_copy_options_comment' => '选择要将源版块的哪些设置复制到目标版块,可按住 CTRL 多选', + + 'forums_moderators' => '版主', + 'forums_moderators_comment' => '编辑本版块版主', + 'forums_moderators_tips' => '
        • “由上级版块继承”表示该版主是由上级版块或分类继承而来,而不是针对本版块独立设置的设置的版主,不能单独删除。
        • “将本版块或分类版主的权力继承到下级版块”在当前论坛是分类时,默认为选定状态;在当前版块是子版块时,默认为不选状态。
        • ', + 'forums_moderators_inherit' => '将本版块或分类版主的权力继承到下级版块', + 'forums_moderators_inherited' => '由上级版块继承', + 'forums_moderators_edit' => '编辑版主', + + 'forums_delete_comment' => '删除本版块及其中所有文章', + + 'forums_merge' => '版块合并', + 'forums_merge_source' => '源版块', + 'forums_merge_source_comment' => '源版块的文章全部转入目标版块,同时删除源版块', + 'forums_merge_target' => '目标版块', + + 'threadtype_infotypes' => '分类信息管理', + 'threadtype_infotypes_type' => '分类管理', + 'threadtype_infotypes_option' => '字段管理', + 'threadtype_infotypes_content' => '内容管理', + 'threadtype_infotypes_class' => '字段分类管理', + 'threadtype_infotypes_add' => '添加分类', + 'threadtype_infotypes_option_config' => '分类选项基本设置', + 'threadtype_infotypes_add_option' => '添加分类信息字段', + 'threadtype_infotypes_exist_option' => '已有字段', + 'threadtype_infotypes_insert_template' => '插入模板', + 'threadtype_infotypes_add_template' => '插入文章', + 'threadtype_infotypes_add_stemplate' => '插入主题', + 'threadtype_infotypes_add_ptemplate' => '插入发帖', + 'threadtype_infotypes_add_btemplate' => '插入调用', + 'threadtype_infotypes_template' => '分类信息文章显示模板', + 'threadtype_infotypes_stemplate' => '分类信息主题显示模板', + 'threadtype_infotypes_ptemplate' => '分类信息发帖显示模板', + 'threadtype_infotypes_btemplate' => '分类信息模块调用显示模板', + 'threadtype_infotypes_template_tips' => '
        • 如果模板为空则采用系统默认模板。
        • 点击上面的 [插入模板] 链接,可以将相关的代码插入到模板,然后您可以用网页编辑工具如 DreamWeaver 或者手工进行编辑。
        • 分类信息显示模板支持 HTML,其中{字段变量名}代表该字段的名称,[字段变量名]代表该字段的具体值。
          例如有一个字段变量名为 age,字段名称为年龄,会员填写的数值为 20。那么 {age}[agevalue] 这样的字符串,在模板中将显示为年龄 20。
        • ', + 'threadtype_infotypes_validity' => '是否设置有效期', + 'threadtype_infotypes_validity_comment' => '此分类信息是否有有效期限制,过期后将不参与分类信息搜索,此有效期在前台发帖时选择', + 'threadtype_infotypes_imgnum' => '上传图片限制', + 'threadtype_infotypes_imgnum_comment' => '此分类信息允许上传图片的数量,0为不允许上传图片', + 'threadtype_infotypes_fontsearch' => '文字检索', + 'threadtype_infotypes_formsearch' => '表单搜索', + 'threadtype_infotypes_show' => '主题展示', + 'threadtype_infotypes_visitshow' => '最近浏览展示', + 'threadtype_content_choose' => '选择分类', + 'threadtype_content_sort_by_conditions' => '条件筛选', + 'threadtype_content_name' => '分类名称', + 'threadtype_content_delete' => '删除信息', + 'threadtype_cat_name' => '字段名称', + 'threadtype_variable' => '变量名', + 'threadtype_unit' => '单位', + 'threadtype_type' => '类型', + 'threadtype_expiration' => '是否限制有效期', + 'threadtype_expiration_comment' => '选择是则超过有效期信息自动隐藏', + 'threadtype_protect' => '信息保护设置', + 'threadtype_protect_mode' => '选择保护方式', + 'threadtype_protect_mode_pic' => '图片方式', + 'threadtype_protect_mode_html' => 'Html方式', + 'threadtype_protect_mode_usergroup' => '用户组方式', + 'threadtype_protect_mode_comment' => '选择图片方式:需要空间GD库支持,内容里有中文需要将中文 TTF 字体文件放到 static/image/seccode/font/ch/ 目录下', + 'threadtype_protect_usergroup' => '可查看该信息的用户组', + 'threadtype_protect_usergroup_comment' => '可查看该信息的用户组,不选则为不限制', + 'threadtype_protect_verify' => '可查看该信息的认证组', + 'threadtype_protect_verify_comment' => '可查看该信息的认证组,不选则为不限制', + 'threadtype_protect_permprompt' => '无权限提示信息', + 'threadtype_protect_permprompt_comment' => '当用户无权查看字段内容时显示的提示信息', + 'threadtype_defaultvalue' => '默认值(可选)', + 'threadtype_manage' => '分类信息字段管理', + 'threadtype_cat_manage' => '分类信息字段管理', + 'threadtype_edit_vars_type_number' => '数字(number)', + 'threadtype_edit_vars_type_text' => '字串(text)', + 'threadtype_edit_vars_type_textarea' => '文本(textarea)', + 'threadtype_edit_vars_type_radio' => '单选(radio)', + 'threadtype_edit_vars_type_checkbox' => '多选(checkbox)', + 'threadtype_edit_vars_type_select' => '选择(select)', + 'threadtype_edit_vars_type_calendar' => '日历(calendar)', + 'threadtype_edit_vars_type_url' => '超级链接(url)', + 'threadtype_edit_vars_type_image' => '上传图片(image)', + 'threadtype_edit_vars_type_email' => '电子邮件(email)', + 'threadtype_edit_vars_type_upload' => '上传(upload)', + 'threadtype_edit_vars_type_range' => '范围(range)', + 'threadtype_edit_vars_type_area' => '地区(area)', + 'threadtype_edit_desc' => '简短描述(可选)', + 'threadtype_edit_maxnum' => '数值最大值(可选)', + 'threadtype_edit_minnum' => '数值最小值(可选)', + 'threadtype_edit_textmax' => '内容最大长度(可选)', + 'threadtype_edit_inputsize' => '表单显示长度(可选)', + 'threadtype_edit_searchtxt' => '搜索范围预置值(可选)', + 'threadtype_edit_searchtxt_comment' => '设置项目的快速搜索预置数值,逗号分隔,例如:“0,50,10”,将显示 0 - 50、50 - 100 的搜索快捷链接', + 'threadtype_edit_rowsize' => '输入框行数(可选)', + 'threadtype_edit_colsize' => '输入框宽度(可选)', + 'threadtype_edit_colsize_comment' => '此宽度设置仅在自定义"分类信息发帖显示模板"时生效', + 'threadtype_edit_select_choices' => '字段内容', + 'threadtype_edit_select_choices_comment' => '只在项目为可选时有效,每行一个字段,等号前面为字段索引(建议用数字),后面为内容,例如:
          1 = 光电鼠标
          2 = 机械鼠标
          3 = 没有鼠标

          1.1 = 黑色光电鼠标
          1.2 = 红色光电鼠标
          1.2.1 = 蓝牙红色光电鼠标
          注意:
          1、 "1.2.1 = 蓝牙红色光电鼠标"必须有"1.2 = 红色光电鼠标"和"1 = 光电鼠标"这两项
          2、 "1.2.1"之间不能有空格
          3、 字段确定后请勿修改索引和内容的对应关系,但仍可以新增字段。如需调换显示顺序,可以通过移动整行的上下位置来实现', + 'threadtype_edit_choices' => '字段内容', + 'threadtype_edit_choices_comment' => '只在项目为可选时有效,每行一个字段,等号前面为字段索引(建议用数字),后面为内容,例如:
          1 = 光电鼠标
          2 = 机械鼠标
          3 = 没有鼠标

          注意: 字段确定后请勿修改索引和内容的对应关系,但仍可以新增字段。如需调换显示顺序,可以通过移动整行的上下位置来实现', + 'threadtype_edit_images_weight' => '图片最大宽度(可选)', + 'threadtype_edit_images_height' => '图片最大高度(可选)', + 'threadtype_edit_upload_extension' => '允许上传的文件类型(可选)', + 'threadtype_edit_upload_extension_comment' => '允许上传的文件类型,留空为允许上传所有文件,各个类型之间用,隔开', + 'threadtype_edit_area' => '使用几级分类', + 'threadtype_edit_profile' => '关联用户栏目初始值', + 'threadtype_edit_profile_comment' => '可以指定某个用户栏目作为初始值,方便用户在发帖时填写。
          此项优先于默认值', + 'threadtype_template' => '模板', + 'threadtype_template_viewthread' => '文章页模板', + 'threadtype_template_forumdisplay' => '列表页模板', + 'threadtype_template_post' => '发帖页模板', + 'threadtype_template_diy' => 'DIY调用模板', + 'threadtype_template_threadtitle' => '主题标题', + 'threadtype_template_threadurl' => '主题 URL', + 'threadtype_template_threadid' => '主题 ID', + 'threadtype_template_dateline' => '发布时间', + 'threadtype_template_author' => '作者用户名', + 'threadtype_template_authorid' => '作者用户 ID', + 'threadtype_template_authorurl' => '作者 URL', + 'threadtype_template_authoravatar' => '头像 URL', + 'threadtype_template_authorverify' => '认证标识', + 'threadtype_template_threadauthor' => '主题作者', + 'threadtype_template_threadviews' => '主题查看数', + 'threadtype_template_threadreplies' => '主题回复数', + 'threadtype_template_lastpostdateline' => '最后回复时间', + 'threadtype_template_lastposturl' => '最后回复 URL', + 'threadtype_template_lastpostuser' => '最后回复用户', + 'threadtype_template_lastpostuserurl' => '最后回复用户 URL', + 'threadtype_template_lastpost' => '最后回复', + 'threadtype_template_threadtypename' => '主题分类名称', + 'threadtype_template_threadtypeurl' => '主题分类 URL', + 'threadtype_template_threadtype' => '主题分类', + 'threadtype_template_attachmentexist' => '是否存在附件的标识图片', + 'threadtype_template_attachment' => '附件标识', + 'threadtype_template_modcheck' => '版主管理主题的操作选项', + 'threadtype_template_threadmod' => '主题操作', + 'threadtype_template_loop' => '单一主题循环内容', + 'threadtype_template_title' => '标题', + 'threadtype_template_varname' => '变量名称', + 'threadtype_template_varvalue' => '变量的值', + 'threadtype_template_varunit' => '变量单位', + 'threadtype_template_requiredflag' => '必填标识', + 'threadtype_template_tipflag' => '提示标识', + 'threadtype_template_briefdes' => '简短描述', + 'threadtype_template_tag' => '标签', + 'threadtype_template_intro' => '说明', + 'threadtype_template_example' => '范例', + + + + 'misc_customnav_detail' => '导航设置', + 'misc_customnav_name' => '导航名称', + 'misc_customnav_parent' => '导航位置', + 'misc_customnav_parent_comment' => '设置此导航的位于哪个主导航下面', + 'misc_customnav_parent_top' => '主导航', + 'misc_customnav_subtype' => '二级导航样式', + 'misc_customnav_subtype_comment' => '如果此主导航存在二级导航,设置二级导航样式是以菜单方式显示,还是以横排方式显示', + 'misc_customnav_subtype_menu' => '菜单样式', + 'misc_customnav_subtype_sub' => '横排样式', + 'misc_customnav_title' => '导航说明', + 'misc_customnav_title_comment' => '导航的说明会在鼠标移动到其上面时显示', + 'misc_customnav_url' => '导航链接', + 'misc_customnav_url_comment' => '设置导航的链接,可填写站内、站外的链接地址', + 'misc_customnav_style' => '导航字体样式', + 'misc_customnav_style_underline' => '下划线', + 'misc_customnav_style_italic' => '斜体', + 'misc_customnav_style_bold' => '粗体', + 'misc_customnav_style_color' => '导航字体颜色', + 'misc_customnav_url_open' => '导航打开方式', + 'misc_customnav_level' => '导航权限', + 'misc_customnav_level_comment' => '设置哪些用户组的用户才可看到此导航', + 'misc_customnav_url_open_default' => '在本窗口打开', + 'misc_customnav_url_open_blank' => '在新窗口打开', + 'misc_customnav_subcols' => '横排一行显示的条目数', + 'misc_customnav_subcols_comment' => '设置横排一行显示的条目数,留空表示不限制,文字超出自动换行', + 'misc_customnav_logo' => '自定义 Logo', + 'misc_customnav_logo_comment' => '设置此导航下所涉及页面的 Logo,留空表示使用风格中的 Logo', + + 'misc_customnav_icon' => '导航图标', + 'misc_customnav_icon_comment' => '图标大小 16x16。URL 中可用“{STATICURL}”代表站点静态文件 static/ 目录,可在 config/config_global.php 中修改', + 'misc_mynav_icon_comment' => '图标大小 40x40。URL 中可用“{STATICURL}”代表站点静态文件 static/ 目录,可在 config/config_global.php 中修改', + 'misc_customnav_allowsub' => '显示副导航', + 'misc_customnav_subname' => '副导航名称', + 'misc_customnav_suburl' => '副导航链接', + + 'nav_nav_headernav' => '主导航', + 'nav_nav_spacenav' => '家园导航', + 'nav_nav_footernav' => '底部导航', + 'nav_nav_mynav' => '快捷导航', + 'nav_nav_topnav' => '顶部导航', + 'nav_nav_mfindnav' => '手机发现页导航', + 'nav_mfindnav_add' => '添加发现页导航', + 'nav_topnav_add' => '添加顶部导航', + 'nav_footernav_add' => '添加底部导航', + 'nav_spacenav_add' => '添加家园导航', + 'nav_spacenav_add_hr' => '添加分割线', + 'nav_spacenav_hr' => '分割线', + 'nav_spacenav_userpanelarea1' => "{navname}区域1", + 'nav_spacenav_userpanelarea2' => "{navname}区域2", + 'nav_mynav_add' => '添加快捷导航', + 'nav_spacenav_tips' => '
        • 以下导航链接在“家园展示风格”中启用“以SNS模块风格展示”时有效
        • ', + + 'styles' => '模板', + 'styles_admin' => '模板管理', + 'styles_list' => '模板列表', + 'styles_admin_tips' => '
        • 如果把导出的风格文件放置在模板目录下,则可以通过风格管理直接安装风格
        • ', + 'styles_admin_name' => '方案名称', + 'styles_admin_template' => '所用模板', + 'styles_home_tips' => '
        • 手机版模板需要开启手机版以后才能生效,前往手机版设置
        • 如果您是模板开发者,请阅读《Discuz! 技术文档》中的内容,并开启设计模式。
        • ', + 'styles_tips' => '
        • 由于扩展配色会重定义某些风格变量,因此某些风格变量可能只对默认配色有效
        • ', + + 'styles_edit' => '编辑风格', + 'styles_edit_type_bg' => '背景', + 'styles_edit_type_header' => '页头/页脚', + 'styles_edit_type_font' => '文字', + 'styles_edit_type_url' => '链接', + 'styles_edit_type_wrap' => '主体表格', + 'styles_edit_type_menu' => '菜单', + 'styles_edit_type_post' => '文章内容', + 'styles_edit_type_input' => '输入框', + 'styles_edit_type_dropmenu' => '下拉菜单', + 'styles_edit_type_float' => '浮动窗口', + 'styles_edit_type_other' => '其他', + + 'styles_edit_headerbgcolor' => '页头背景', + 'styles_edit_bgcolor' => '页面背景', + 'styles_edit_sidebgcolor' => '家园侧边背景', + 'styles_edit_headerborder' => '页头分割线高度', + 'styles_edit_headerbordercolor' => '页头分割线颜色', + 'styles_edit_headertext' => '页头文字颜色', + 'styles_edit_footertext' => '页脚文字颜色', + 'styles_edit_font' => '正常字体', + 'styles_edit_fontsize' => '正常字体大小', + 'styles_edit_threadtitlefont' => '主题列表字体', + 'styles_edit_threadtitlefontsize' => '主题列表字体大小', + 'styles_edit_smfont' => '小号字体', + 'styles_edit_smfontsize' => '小号字体大小', + 'styles_edit_tabletext' => '普通文本颜色', + 'styles_edit_midtext' => '中等文本颜色', + 'styles_edit_lighttext' => '浅色文字', + 'styles_edit_link' => '链接文字颜色', + 'styles_edit_highlightlink' => '高亮链接颜色', + 'styles_edit_lightlink' => '浅色链接颜色', + 'styles_edit_wrapwidth' => '主体表格宽度', + 'styles_edit_wrapbg' => '主体表格背景色', + 'styles_edit_wrapborder' => '主体表格边框宽度', + 'styles_edit_wrapbordercolor' => '主体表格边框色', + 'styles_edit_menubgcolor' => '菜单背景颜色', + 'styles_edit_menutext' => '菜单文字颜色', + 'styles_edit_menucurbgcolor' => '当前菜单背景', + 'styles_edit_menuhoverbgcolor' => '菜单高亮背景', + 'styles_edit_menuhovertext' => '菜单高亮文字颜色', + 'styles_edit_msgfontsize' => '文章内容字号', + 'styles_edit_msgbigsize' => '文章内容大字号', + 'styles_edit_contentwidth' => '阅读区域宽度', + 'styles_edit_contentseparate' => '文章间隔颜色', + 'styles_edit_inputborder' => '输入框边框浅色', + 'styles_edit_inputborderdarkcolor' => '输入框边框深色', + 'styles_edit_inputbg' => '输入框背景色', + 'styles_edit_dropmenuborder' => '下拉菜单边框色', + 'styles_edit_dropmenubgcolor' => '下拉菜单背景色', + 'styles_edit_floatmaskbgcolor' => '弹出窗口边框颜色', + 'styles_edit_floatbgcolor' => '弹出窗口背景色', + 'styles_edit_commonborder' => '通用边框颜色', + 'styles_edit_commonbg' => '通用显示区域背景颜色', + 'styles_edit_specialborder' => '彩色区域边框', + 'styles_edit_specialbg' => '彩色区域背景色(文章用户信息栏、需强调的表头等)', + 'styles_edit_interleavecolor' => '隔行换色背景', + 'styles_edit_noticetext' => '提示信息颜色', + 'styles_edit_iconbgcolor' => '风格图标背景色', + 'styles_edit_titlebgcolor' => '版块列表标题背景', + + 'styles_edit_bg' => '
          输入背景图片地址
          输入附加属性', + 'styles_edit_name' => '界面方案名称', + 'styles_edit_name_comment' => '识别界面风格的标志,请勿使用空格或特殊符号', + 'styles_edit_tpl' => '匹配模板', + 'styles_edit_tpl_comment' => '与本套界面风格相匹配的模板名称', + 'styles_edit_logo' => '站点 Logo {BOARDIMG},{BOARDLOGO}', + 'styles_edit_logo_comment' => '可以上传图片,或者直接填写图片文件名(按论坛根目录、扩展图片目录、界面基础图片目录识别图片路径)
          如果需要为指定模块导航设置自定义Logo,可前往 界面 - 导航设置 - 导航编辑 功能中进行设置。', + 'styles_edit_searchlogo' => '搜索 Logo {SEARCHIMG},{SEARCHLOGO}', + 'styles_edit_touchlogo' => '手机版 Logo {TOUCHIMG},{TOUCHLOGO}', + 'styles_edit_imgdir' => '界面基础图片目录 {IMGDIR}', + 'styles_edit_imgdir_comment' => '风格基础图片存放的目录,留空表示使用 static/image/common/ 目录为基础图片目录', + 'styles_edit_styleimgdir' => '扩展图片目录 {STYLEIMGDIR}', + 'styles_edit_styleimgdir_comment' => '风格扩展图片存放的目录,留空表示无扩展图片目录', + 'styles_edit_smileytype' => '默认表情分类', + 'styles_edit_hexcolor' => '输入 16 进制颜色 #RRGGBB', + 'styles_edit_extstyle' => '扩展配色', + 'styles_edit_extstyle_comment' => '选择开放给用户自由选择的扩展配色方案
          要增加新的扩展配色方案,可上传到风格目录的 style/ 文件夹下,如 template/default/style/', + 'styles_edit_defaultextstyle' => '默认配色', + + 'styles_edit_simple' => '预览模式', + 'styles_edit_adv' => '编辑模式', + 'styles_edit_simple_switch' => '预览风格设置', + 'styles_edit_adv_switch' => '编辑风格设置', + 'styles_edit_visual' => '可视化预览', + 'styles_edit_visual_exit' => '退出', + 'styles_edit_visual_menu_current' => '当前', + 'styles_edit_visual_menu' => '导航', + 'styles_edit_visual_text' => '

          Crossday Discuz! Board 论坛系统(简称 Discuz! 论坛)是一个采用 PHP 和 MySQL 等其他多种数据库构建的高效建站解决方案。

          ', + 'styles_edit_visual_footer' => '版权及页脚信息', + 'styles_edit_visual_setting_commonborder' => '间隔线颜色', + 'styles_edit_visual_setting_commonbg' => '常用背景色', + 'styles_edit_visual_setting_font' => '正常字体,字号', + 'styles_edit_visual_setting_smfont' => '小号字体,字号', + 'styles_edit_visual_setting_tabletext' => '普通文本色', + 'styles_edit_visual_setting_midtext' => '中等文本色', + 'styles_edit_visual_setting_lighttext' => '浅色文字色', + 'styles_edit_visual_setting_link' => '链接文字色', + 'styles_edit_visual_setting_highlightlink' => '链接高亮色', + 'styles_edit_visual_setting_noticetext' => '提示文字色', + 'styles_edit_visual_setting_boardimg' => '站点 Logo', + 'styles_edit_visual_setting_headerbgcolor' => '页头背景', + 'styles_edit_visual_setting_headerborder' => '页头分割线', + 'styles_edit_visual_setting_headertext' => '页头文字色', + 'styles_edit_visual_setting_menuborder' => '菜单边框色', + 'styles_edit_visual_setting_menubgcolor' => '菜单背景色', + 'styles_edit_visual_setting_menutext' => '菜单文字色', + 'styles_edit_visual_setting_menuhover' => '高亮菜单背景色', + 'styles_edit_visual_setting_menuhovertext' => '高亮菜单文字色', + 'styles_edit_visual_setting_bgcolor' => '页面背景', + 'styles_edit_visual_setting_sidebgcolor' => '侧边背景', + 'styles_edit_visual_setting_wrapwidth' => '主体表格宽度', + 'styles_edit_visual_setting_wrapbg' => '主体表格背景色', + 'styles_edit_visual_setting_wrapborder' => '主体表格边框', + 'styles_edit_visual_setting_footertext' => '页脚文字色', + 'styles_edit_visual_selectcolorbox' => '请先点击颜色输入框', + 'styles_edit_visual_getcolorfromimg' => '图片取色工具', + 'styles_edit_visual_getcolor' => '取色', + 'styles_edit_visual_getcolor_fileerror' => '输入的图片地址无效', + 'styles_edit_visual_getcolor_nosupport' => '服务器不支持取色功能', + + 'styles_edit_customvariable' => '自定义模板变量', + 'styles_edit_variable' => '变量', + 'styles_edit_subst' => '替换内容', + 'styles_csscache_update' => '更新 CSS 缓存', + 'styles_needinstall' => '未安装', + 'styles_install' => '安装', + 'styles_stylecount' => '风格数', + 'styles_uninstall' => '卸载', + 'styles_find_newversion' => '发现新版', + + 'styles_default' => '默认风格', + 'styles_default0' => '电脑版', + 'styles_default2' => '手机版', + + 'styles_import' => '导入界面方案', + 'styles_import_ignore_version' => '允许导入老版本 Discuz! 的界面(易产生错误!!)', + 'styles_import_version_invalid' => '版本号不匹配,当前版本:{cur_version},系统版本:{set_version}', + + 'styles_validator_nowupgrade' => '以下模板现在可以更新为新版本,点击安装更新', + 'styles_validator_newversion' => '以下模板存在新版本,点击安装更新', + 'styles_validator_error' => '以下模板不是正版模板,点击安装正版模板', + + 'templates_admin' => '模板套系管理', + 'templates_admin_name' => '模板名称', + 'templates_add' => '设计新模板', + 'templates_add_tips' => '
        • 本功能仅供模板开发者使用。
        • 模板开发人员在使用本功能前请务必仔细阅读《Discuz! 技术文档》中的内容。
        • 警告: 不正确的模板设计或安装可能危及到整个站点的正常使用。
        • ', + 'templates_edit_name' => '模板名称(name)', + 'templates_edit_name_comment' => '此模板的名称,中英文均可,最多 40 个字节', + 'templates_edit_copyright' => '版权信息(copyright)', + 'templates_edit_copyright_comment' => '设置模板的版权信息,最多 100 个字节,一旦设置无法更改', + 'templates_edit_identifier' => '唯一标识符(identifier)', + 'templates_edit_identifier_comment' => '模板的唯一英文标识,不能够与现有模板标识重复。可使用字母、数字、下划线命名,不能包含其他符号或特殊字符,需以字母开头,最大 40 个字节', + 'templates_edit_style' => '初始化模板设置', + 'templates_edit_style_comment' => '使用已经存在的模板设置初始化本模板,或创建空白设置的模板', + 'templates_empty' => '空', + 'templates_question' => '模板问题求助', + + 'templates_maint' => '模板维护', + 'templates_maint_default_comment' => '
        • 您正在修改默认模板,为了扩充其他模板的方便,强烈建议您不要对默认模板的内容进行修改。
        • 如要修改请将要修改的模板文件复制到其他模板目录后再修改。
        • ', + 'templates_maint_nondefault_comment' => '
        • 本套系中并不要求必须完整,所缺少的模板将使用默认模板代替。
        • 如果模板名称显示红色,表示此模板与默认模板不相同;显示绿色,表示此模板为用户添加的模板文件,默认模板没有相应的模板文件存在。
        • 如果您要发布此套模板,建议您把与默认模板相同的模板文件删除后再发布。
        • ', + 'templates_maint_keyword' => '关键字', + 'templates_maint_view_all' => '查看全部模板', + 'templates_maint_new' => '添加模板', + 'templates_maint_search' => '搜索模板内容', + 'templates_maint_select' => '选择模板', + 'templates_maint_language_pack' => '语言包', + 'templates_maint_html' => '模板', + 'templates_maint_reset' => '恢复为默认模板', + + 'templates_edit' => '编辑模板', + 'templates_edit_default_overwriteconfirm' => '为了扩充其他模板的方便,强烈建议您不要对默认模板的内容进行修改,您确定要修改吗?', + 'templates_edit_diff' => '与默认模板对比', + 'templates_edit_diff_current' => '当前模板', + 'templates_edit_diff_default' => '默认模板', + 'templates_edit_diff_deleted' => '从旧版本中删除的文本', + 'templates_edit_diff_changed' => '在两个版本间修改的文本', + 'templates_edit_diff_added' => '在新版本中添加的文本', + 'templates_edit_clickboard' => '将模板内容复制到剪帖板', + 'templates_edit_keyword_not_found' => '未找到指定字串', + 'templates_edit_copyto_otherdirs' => '将该模板文件复制到: ', + 'templates_edit_start_copy' => '开始复制', + 'templates_edit_reset' => '恢复为默认模板', + 'templates_edit_check_del' => '缺少的语法', + 'templates_edit_check_add' => '增加的语法', + 'templates_edit_check_ok' => '未发现语法问题', + 'templates_edit_check_result' => '模板检查结果 (与默认模板的对比结果)', + 'templates_edit_variable' => '变量', + 'templates_edit_value' => '内容', + 'templates_edit_select' => '请先选择您要进行操作的模板套系:', + + 'members' => '用户', + + 'members_add' => '添加新用户', + 'members_add_email_notify' => '发送通知到上述地址', + 'members_admin_tips' => '
        • 通过用户管理,您可以进行编辑会员资料、用户组、权限、积分,授予会员勋章以及删除会员等操作;
        • 请先根据条件搜索用户,然后选择相应的操作。
        • 输入框可使用通配符 *,多个值之间用半角逗号 "," 隔开。
        • ', + 'members_admin_comment' => '用户组名称以黑体字显示的,为系统用户组;以斜体字显示的,为自定义用户组;否则为会员用户组', + 'members_export_tips' => '
        • 用户组名称以黑体字显示的,为系统用户组;以斜体字显示的,为自定义用户组;否则为会员用户组。
        • 导出用户信息最多支持 10000 条数据。导出的文件可用 EXCEL、WPS表格、腾讯文档等工具打开。
        • ', + + 'members_delete_post' => '文章', + 'members_delete_blog' => '日志', + 'members_delete_pic' => '图片', + 'members_delete_doing' => '记录', + 'members_delete_share' => '分享', + 'members_delete_feed' => '广播', + 'members_delete_comment' => '评论', + 'members_delete_allitem' => '全部', + 'members_delete_user_processing_next' => '已处理 {deletestart}至{nextdeletestart} 名用户,继续进行...', + 'members_delete_user_processing' => '正处理 {deletestart}至{nextdeletestart} 名用户...', + 'members_delete_processing_next' => '{deladdmsg}{item} 处理完成,即将处理用户 {nextitem} 数据', + 'members_delete_processing' => '{deladdmsg}正在删除 用户{item}数据 从 {current} 到 {next} (该操作比较消耗资源,请您耐心等待)', + 'members_delete_all' => '删除用户所有数据(含附件),该操作比较消耗资源,请您耐心等待', + 'members_delete_ucdata' => '删除 UCenter 中的用户资料', + + 'members_edit' => '编辑用户', + 'members_edit_reason' => '变更理由', + 'members_edit_username' => '用户名', + 'members_edit_avatar' => '头像', + 'members_edit_avatar_clear' => '删除头像', + 'members_edit_password' => '新密码', + 'members_edit_password_comment' => '如果不更改密码此处请留空', + 'members_edit_clearquestion' => '清除用户安全提问', + 'members_edit_status' => '锁定当前用户', + 'members_edit_freeze' => '用户冻结状态', + 'members_edit_freeze_false' => '未冻结', + 'members_edit_freeze_password' => '需重置密码后解冻', + 'members_edit_freeze_admincp' => '需后台审核后解冻', + 'members_edit_freeze_email' => '需验证邮箱或后台审核后解冻', + 'members_edit_clearquestion_comment' => '选择“是”将清除用户安全提问,该用户将不需要回答安全提问即可登录;选择“否”为不改变用户的安全提问设置', + 'members_edit_nickname' => '昵称', + 'members_edit_gender' => '性别', + 'members_edit_gender_male' => '男', + 'members_edit_gender_female' => '女', + 'members_edit_gender_secret' => '保密', + 'members_edit_email' => 'Email', + 'members_edit_email_emailstatus' => '邮箱激活状态', + 'members_edit_secmobile_secmobicc' => '安全手机国际电话区号', + 'members_edit_secmobile_secmobile' => '安全手机号', + 'members_edit_secmobile_secmobilestatus' => '安全手机激活状态', + 'members_edit_posts' => '发帖数', + 'members_edit_digestposts' => '精华帖数', + 'members_edit_pageviews' => '页面访问量', + 'members_edit_online_total' => '总在线时间(分钟)', + 'members_edit_online_thismonth' => '本月在线时间(分钟)', + 'members_edit_regip' => '注册 IP', + 'members_edit_regport' => '注册端口号', + 'members_edit_regdate' => '注册时间', + 'members_edit_lastvisit' => '上次访问', + 'members_edit_lastip' => '上次访问 IP', + 'members_edit_port' => '上次访问端口号', + 'members_edit_addsize' => '额外附件容量', + 'members_edit_addfriend' => '额外好友数', + 'members_edit_statistics' => '统计信息', + 'members_edit_uinblack' => '封禁QQ账号', + 'members_edit_uinblack_comment' => '把当前用户的QQ账号封锁,封禁后此QQ账号无法再登录本站点', + 'members_edit_uinblack_notice' => '
          警告: 当前用户未设置独立密码,被封禁后将无法登录本站', + 'members_edit_unbind' => '解除QQ账号绑定状态', + 'members_edit_unbind_comment' => '如当前用户的QQ账号丢失或者被盗,可以在这里解除QQ账号的绑定', + + 'members_edit_info' => '用户资料', + 'members_edit_site' => '主页', + 'members_edit_qq' => 'QQ', + 'members_edit_icq' => 'ICQ', + 'members_edit_yahoo' => 'Yahoo', + 'members_edit_taobao' => '淘宝旺旺', + 'members_edit_alipay' => '支付宝账号', + 'members_edit_location' => '来自', + 'members_edit_bday' => '生日', + 'members_edit_bio' => '自我介绍', + 'members_edit_signature' => '签名', + + 'members_edit_option' => '论坛选项', + 'members_edit_style' => '界面风格', + 'members_edit_tpp' => '每页显示主题数', + 'members_edit_ppp' => '每页显示帖数', + 'members_edit_cstatus' => '自定义头衔', + 'members_edit_timeformat' => '时间格式', + 'members_edit_timeformat_12' => '12 小时', + 'members_edit_timeformat_24' => '24 小时', + 'members_edit_dateformat' => '日期格式', + 'members_edit_dateformat_comment' => '留空即为默认格式,和站点设置保持一致', + 'members_edit_invisible' => '隐身登录', + 'members_edit_showemail' => 'Email 地址可见', + 'members_edit_newsletter' => '同意接收站点通知 (Email 或短消息)', + 'members_edit_timeoffset' => '时差设定', + 'members_edit_timeoffset_comment' => '用户本地时间与 GMT 标准的时间差,设置 9999 即为默认时差,和站点设置保持一致', + 'members_edit_pmsound' => '短消息提示音', + 'members_edit_ignorepm' => '忽略短消息', + 'members_edit_exphistory' => '用户历史资料下载', + 'members_edit_exphistory_comment' => '历史邮箱、手机号数据请到 UCenter 后台查询', + + 'members_group' => '编辑会员用户组', + 'members_group_member' => '编辑会员 {username} 的用户组', + 'members_group_group' => '所属用户组', + 'members_group_related_adminid' => '所属管理组', + 'members_group_extended' => '扩展用户组', + 'members_group_extended_comment' => '注意: 有效期格式 yyyy-mm-dd,如果留空,则默认该扩展用户组不自动过期', + 'members_group_validity' => '用户组有效期', + 'members_group_validity_comment' => '如需设定当前用户组的有效期,请输入用户组截止日期,留空为不做过期限制', + 'members_group_validity_date' => '格式: yyyy-mm-dd', + 'members_group_validity_days' => '天之后', + 'members_group_orig_groupid' => '过期后管理组变为', + 'members_group_orig_adminid' => '过期后用户组变为', + 'members_group_reason' => '操作用户的理由', + 'members_group_reason_comment' => '如果您通过用户组设定禁止或解除禁止该用户,请输入操作理由,系统将把理由记录在用户禁止记录中以供日后查看并可选发送给用户。如果并非上述情况且不选择下方的告知用户,可不输入操作理由', + 'members_group_reason_notify' => '禁止/解禁用户的理由是否告知用户', + 'members_group_extended_none' => '未配置扩展用户组', + + 'members_credit' => '编辑用户积分', + 'members_credit_tips' => '
        • Discuz! 支持对用户 8 种扩展积分的设置,只有被启用的积分才允许您进行编辑。
        • 修改用户的某项积分会造成该用户总积分的变化,从引起普通会员等级的变化,因此请仔细设置各项积分。
        • ', + 'members_credit_ranges' => '用户组积分上下限', + 'members_credit_reason' => '修改用户积分的理由', + 'members_credit_reason_comment' => '如果您修改了用户的积分资料,请输入操作理由,系统将把理由记录在用户评分记录中并可选发送给用户,以供日后查看', + 'members_credit_reason_notify' => '修改用户积分的理由是否告知用户', + 'members_credit_logs' => '积分变更记录', + + 'members_medal' => '颁发/收回用户勋章', + 'members_medal_grant' => '颁发', + 'members_medal_revoke' => '收回', + 'members_medal_unavailable' => '不可用', + 'members_medal_reason' => '颁发/收回勋章的理由', + 'members_medal_reason_comment' => '如果您修改了用户的勋章资料,请输入操作理由,系统将把理由记录在勋章颁发记录中,以供日后查看', + + 'members_ban' => '禁止用户', + 'members_ban_tips' => '
        • 此操作需要在管理组内开启相关权限
        • ', + 'members_ban_username' => '禁止用户名', + 'members_ban_user' => '禁止用户', + 'members_ban_type' => '禁止类型', + 'members_ban_type_comment' => '选正常状态可以恢复该用户的普通身份
          锁定用户后该用户将无法访问及进行任何操作,包括其它用户也无法访问该用户的相关信息', + 'members_ban_none' => '正常状态', + 'members_ban_post' => '禁止发言', + 'members_ban_visit' => '禁止访问', + 'members_ban_status' => '锁定用户', + 'members_ban_delete_avatar' => '删除头像', + 'members_ban_clear_content' => '清空该用户相关内容', + 'members_ban_clear_content_comment' => ',全选', + 'members_ban_crime_record' => '违规记录', + 'members_edit_current_status' => '当前状态', + 'members_ban_validity' => '禁止用户有效期', + 'members_ban_validity_comment' => '在有效期过后该用户可以自动解除限制,成为普通用户', + 'members_ban_delpost' => '文章', + 'members_ban_delfollow' => '广播', + 'members_ban_delothers' => '杂项', + 'members_ban_delblog' => '日志', + 'members_ban_delalbum' => '相册', + 'members_ban_deldoing' => '记录', + 'members_ban_delshare' => '分享', + 'members_ban_postcomment' => '点评', + 'members_ban_delcomment' => '评论和留言', + 'members_ban_delprofile' => '用户资料', + 'members_ban_delavatar' => '头像', + 'members_ban_reason' => '理由', + 'members_ban_reason_comment' => '禁止或解禁用户的理由', + + 'members_unarchive' => '移出', + 'members_chgusername' => '发起更名', + 'members_chgusername_tips' => '
        • 此操作需要在管理组内开启相关权限
        • 本操作对于站点所属 UCenter 下支持此类通知的应用均可生效,但会导致不支持此类通知并以用户名作为外键的应用出现异常,敬请注意
        • 提交后本请求将会发送至 UCenter 处理,由于数据交互需要时间,一般本操作会在几分钟内生效,如超时未生效请更新缓存或检查 UCenter 和站点通信是否正常
        • ', + 'members_chgusername_oldusername' => '该用户在本应用的用户名', + 'members_chgusername_newusername' => '新用户名', + + 'members_search' => '搜索用户', + 'members_delete' => '删除用户', + 'members_search_between' => '介于', + 'members_search_group' => '主用户组', + 'members_search_group_comment' => '设置允许参与搜索的用户组,可以按住 CTRL 多选', + 'members_search_medal' => '勋章', + 'members_search_medal_comment' => '设置拥有指定勋章的用户,可以按住 CTRL 多选', + 'members_search_usertag' => '用户标签', + 'members_search_usertag_comment' => '设置指定标签的用户,可以按住 CTRL 多选', + 'members_search_extgroup' => '扩展用户组', + 'members_search_table' => '用户表', + 'members_search_table_comment' => '更新用户数据时,存档表中的用户相关数据不会更新', + 'members_search_table_master' => '主表', + 'members_search_table_archive' => '存档表', + 'members_search_user' => '用户名', + 'members_search_user_comment' => '可使用通配符 *,多个用户名用半角逗号 "," 隔开', + 'members_search_repeatuser' => '用户名', + 'members_search_uid' => '用户 UID', + 'members_search_email' => 'Email', + 'members_search_email_comment' => '可使用通配符 *', + 'members_search_friendsrange' => '好友数介于', + 'members_search_postsrange' => '发帖数介于', + 'members_search_threadsrange' => '主题数介于', + 'members_search_regip' => '注册 IP 开始于', + 'members_search_regip_comment' => '如 192.168,可使用通配符 *', + 'members_search_lastip' => '上次访问 IP 开始于', + 'members_search_lastip_comment' => '如 192.168,可使用通配符 *', + 'members_search_oltimerange' => '用户在线时间(单位小时)', + 'members_search_repeatip' => 'IP 地址', + 'members_search_regdaterange' => '注册日期介于', + 'members_search_lastvisitrange' => '最后访问时间介于', + 'members_search_lastpostrange' => '最后发帖时间介于', + 'members_search_birthday' => '用户生日', + 'members_search_result' => '共搜索到 {membernum} 名符合条件的用户', + 'members_search_deleteall' => '操作搜索到的全部 {membernum} 名用户', + 'members_search_export' => '导出用户信息', + 'members_search_nonexistence' => '您没有提供搜索条件或没有与条件匹配的会员。重新搜索', + 'members_search_lockstatus' => '是否锁定', + 'members_search_freezestatus' => '是否冻结', + 'members_search_emailstatus' => '是否通过Email认证', + 'members_search_avatarstatus' => '是否有头像', + 'members_search_online' => '是否在线', + 'members_search_group_fid' => '圈子 ID(多个圈子逗号分隔)', + 'members_search_verify' => '认证', + 'members_search_conisbind' => '是否绑定QQ', + 'members_search_uinblacklist' => 'QQ账号是否被封', + 'members_search_nonemedal' => '暂时没有可用勋章', + 'members_search_noneusertags' => '暂时没有用户标签', + + 'members_verify_tips' => '
        • 可以批量操作
        • ', + 'members_verify_pass' => '通过', + 'members_verify_pass_with_group' => '并升到用户组', + 'members_verify_pass_with_credit' => '并增加', + 'members_verify_ignore' => '忽略', + 'members_verify_gender_0' => '保密', + 'members_verify_gender_1' => '男', + 'members_verify_gender_2' => '女', + + 'members_verify_securitylist' => '审核项列表', + 'members_verify_fieldid_sel' => '选择审核项', + 'members_verify_dateline' => '提交时间', + 'members_verify_oldvalue' => '当前信息', + 'members_verify_newvalue' => '提交信息', + 'members_verify_submit' => '提交', + + 'members_verify' => '认证设置', + 'members_verify_base' => '基本设置', + 'members_verify_add' => '添加认证', + 'members_verify_verify' => '审核资料', + 'members_verify_available' => '启用', + 'members_verify_id' => '认证代号', + 'members_verify_title' => '认证名称', + 'members_verify_manage' => '认证审核', + 'members_verify_enable' => '是否启用', + 'members_verify_icon' => '认证图标', + 'members_unverify_icon' => '未认证图标', + 'members_verify_showicon' => '显示认证图标', + 'members_verify_view_real_name' => '是否允许未认证用户查看实名', + 'members_verify_view_real_name_comment' => '该设置限制了未实名认证用户是否有权限查看认证通过的用户实名', + 'members_verify_uid' => '用户 UID', + 'members_verify_username' => '用户名', + 'members_verify_info' => '审核信息', + 'members_verify_type' => '审核类型', + 'members_verify_fieldid' => '审核项', + 'members_verify_profile' => '资料审核', + 'members_verify_refusal' => '拒绝', + 'members_verify_nav_authstr' => '待审核', + 'members_verify_nav_refusal' => '已拒绝', + 'members_verify_nav_pass' => '已通过', + 'members_verify_nav_add' => '添加', + 'members_verify_userlist' => '用户名列表', + 'members_verify_userlist_comment' => '支持同时添加多个用户,一行一个用户', + 'members_verify_setting' => '认证设置', + 'members_verify_setting_tips' => '认证设置', + 'members_verify_setting_field' => '(点此新增资料项)可选资料项', + 'members_verify_group' => '允许参与认证的用户组', + 'members_verify_group_comment' => '设置允许参与认证的用户组,可以按住 CTRL 多选, 空代表都可以参于认证', + 'members_verify_pic_removed' => '未上传图片或已被删除', + + 'members_newsletter' => '站点通知', + 'members_newsletter_method' => '通知发送方式', + 'members_newsletter_send' => '发送站点通知', + 'members_newsletter_members' => '通知会员', + 'members_newsletter_subject' => '通知标题', + 'members_newsletter_message' => '通知内容', + 'members_newsletter_num' => '分批发送数量', + 'members_newsletter_processing' => '正在处理 从 {current} 到 {next}', + 'members_newsletter_system' => '以系统身份发送', + 'members_newsletter_system_comment' => '选中“是”将已系统身份发送,收件人无法回复', + 'members_newsletter_empty' => '您还没群发送过短消息,您可直接通过“发送通知”和“积分奖惩”中的“发送积分变更通知”发送短消息,发送后在这里可查看短消息的接收情况', + 'members_newsletter_posttype' => '内容解析方式', + 'members_newsletter_posttype_text' => '文本方式', + 'members_newsletter_posttype_html' => 'html方式', + 'members_newsletter_mobile_tips' => '
        • 您可以通过该功能给手机客户端用户发送通知,为了您更好的触达用户建议大力推广我们的手机客户端。
        • 要使用本功能需要开启手机客户端插件
        • 请关注应用中心中"手机客户端"的更新,功能启用时将会在插件中做详细说明
        • ', + 'members_newsletter_sms_tips' => '
        • 您可以通过该功能用户发送短信通知到用户的安全手机号,为了您更好的触达用户建议用户绑定安全手机号。
        • 要使用本功能需要绑定消息类短信网关。
        • 请务必注意此处发送的短信发送数量以及长度,此处不受 Discuz! X 短信风控系统控制,过多的数量或者过长的内容会带来高昂的短信费用。
        • ', + + 'members_grouppmlist' => '群发短消息记录', + 'members_grouppmlist_newsletter' => '发送通知', + 'members_grouppmlist_view' => '{number} 个用户接收此消息', + 'members_grouppmlist_view_all' => '全部接收的用户', + 'members_grouppmlist_view_unread' => '未读消息的用户', + 'members_grouppmlist_view_read' => '已读消息的用户', + 'members_grouppmlist_status_1' => '阅读', + 'members_grouppmlist_status_0' => '未读', + 'members_grouppmlist_status_-1' => '已删除', + + 'members_reward' => '积分奖惩', + 'members_reward_value' => '奖惩数值', + 'members_reward_members' => '奖惩会员', + 'members_reward_notify' => '发送积分变更通知(同时记录到积分变更日志中)', + 'members_reward_clean' => '积分清零', + 'members_reward_affect' => '积分影响', + 'members_reward_clean_alarm' => '您确认要将这些用户所选的积分清零吗?', + + 'members_confermedal' => '颁发勋章', + 'members_confermedal_members' => '授予会员', + 'members_confermedal_to' => '颁发勋章给', + 'members_confermagic' => '道具赠送', + 'members_confermagic_members' => '赠予会员', + + 'members_access' => '权限', + 'members_access_now' => '当前特殊权限', + 'members_access_add' => '增加或编辑用户的特殊权限', + 'members_access_add_forum' => '选择版块', + 'members_access_add_forum_comment' => '请选择要设置的版块。以下权限设置仅仅影响该用户在此版块的权限', + 'members_access_tips' => '
        • 用户在版块中的权限是基于用户和站点间的权限设定,如果设置为非默认状态,将不受用户组的设定限制。
        • 删除某个用户在某版块的特殊权限设置,您只需要将他在这个版块中的权限全部设置为默认即可
        • 修改某个用户在这个版块的权限,您只需要重新添加他的权限设置即可
        • ', + 'members_access_edit' => '编辑用户权限', + 'members_access_allowed' => '允许 ', + 'members_access_disallowed' => '禁止', + 'members_access_view' => '查看', + 'members_access_post' => '发新帖', + 'members_access_reply' => '回复', + 'members_access_getattach' => '下载附件', + 'members_access_getimage' => '查看图片', + 'members_access_postattach' => '上传附件', + 'members_access_postimage' => '上传图片', + 'members_access_adminuser' => '操作人', + 'members_access_dateline' => '操作时间', + 'members_warn' => '被警告用户', + 'members_access_add_view' => '主题查看权限', + 'members_access_add_view_comment' => '访问权限是基本权限,如果禁止此项权限,则以下所有权限会自动禁止', + 'members_access_add_post' => '发新主题权限', + 'members_access_add_reply' => '发布回复权限', + 'members_access_add_getattach' => '下载附件权限', + 'members_access_add_getimage' => '查看图片权限', + 'members_access_add_postattach' => '上传附件权限', + 'members_access_add_postimage' => '上传图片权限', + + 'members_repeat' => '马甲', + + 'members_ipban' => '禁止 IP', + 'members_ipban_tips' => '
        • 此操作需要在管理组内开启相关权限。
        • 如果您是站点管理员,可以使用CIDR格式禁止某段地址。
        • 如果您不是站点管理员,您将无法使用CIDR且只能对自己添加的项目进行编辑或删除。
        • ', + 'members_ipban_location' => '地理位置', + 'members_ipban_input' => '导入禁止 IP 列表', + 'members_ipban_input_tips' => '
        • 此操作需要在管理组内开启相关权限,只有站点管理员可以使用。
        • 可以使用以前导出的禁止IP列表,也可以手动编写以便批量禁止IP。
        • 你可以 导出现有禁止IP库
        • ', + 'members_ipban_input_comment' => '手动导入禁止 IP 的格式为“IP地址;有效天数”或者“IP地址”(有效期默认30天),每行一条;也可以导入以前导出的禁止IP地址列表。', + + 'members_profile' => '用户栏目', + 'members_profile_edit' => '编辑用户栏目', + 'members_profile_list' => '栏目列表', + 'members_profile_group' => '栏目分组', + 'members_profile_numbercard' => '属性名片', + 'members_profile_numbercard_tips' => '
        • 可以设置用户头像下数字栏显示的用户资料项
        • ', + 'members_profile_tips' => '
        • 增加或隐藏用户扩展资料
        • 设置结果可以扩充现有的用户资料
        • ', + 'members_profile_edit_name' => '栏目名称', + 'members_profile_edit_field' => '字段名', + 'members_profile_edit_field_desc' => '栏目描述', + 'members_profile_edit_field_type' => '填写类型', + 'members_profile_edit_display_order' => '显示顺序', + 'members_profile_edit_display_order_comment' => '值越大显示越靠后', + 'members_profile_edit_text' => '单行文本框', + 'members_profile_edit_textarea' => '多行文本框', + 'members_profile_edit_radio' => '单选框', + 'members_profile_edit_checkbox' => '复选框', + 'members_profile_edit_select' => '下拉菜单', + 'members_profile_edit_list' => '多选列表框', + 'members_profile_edit_file' => '上传图片', + 'members_profile_edit_desc' => '栏目介绍', + 'members_profile_edit_form_type' => '表单类型', + 'members_profile_edit_value_number' => '大小限定', + 'members_profile_edit_value_number_comment' => '最多可填写的字符数或最多可选择的项数,图片类型时限制了上传图片大小(单位:KB)', + 'members_profile_edit_validate' => '正则验证', + 'members_profile_edit_validate_comment' => '检验输入数据的正则表达式,请慎重修改', + 'members_profile_edit_choices' => '可选值', + 'members_profile_edit_choices_comment' => '每行一个值,例如输入:
          北京
          上海', + 'members_profile_edit_available' => '是否启用', + 'members_profile_edit_unchangeable' => '提交后不可修改', + 'members_profile_edit_needverify' => '修改后需要审核', + 'members_profile_edit_required' => '是否必填', + 'members_profile_edit_invisible' => '资料页面隐藏', + 'members_profile_edit_invisible_comment' => '如果设为是,则不论个人隐私如何设定都不会在个人空间资料页面显示', + 'members_profile_edit_showincard' => '是否在名片中显示', + 'members_profile_edit_showinthread' => '是否在文章中显示', + 'members_profile_edit_showinthread_comment' => '选择是,还需在文章内容页中选择展示位置', + 'members_profile_edit_showinregister' => '是否在注册页面显示', + 'members_profile_edit_allowsearch' => '允许搜索', + 'members_profile_edit_default_privacy' => '默认隐私', + 'members_profile_edit_privacy_public' => '公开', + 'members_profile_edit_privacy_friend' => '好友可见', + 'members_profile_edit_privacy_secret' => '保密', + 'members_profile_edit_profile_view' => '资料页显示', + 'members_profile_edit_card_view' => '名片中显示', + 'members_profile_edit_reg_view' => '注册页显示', + + + 'members_stat_options' => '资料统计项', + 'members_stat_null_fieldvalue' => '未填写', + 'members_stat_current_field' => '当前统计项为: ', + 'members_stat_members' => '参与统计的用户数: ', + 'members_stat_option' => '统计项', + 'members_stat_view' => '比例视图', + 'members_stat_option_members' => '用户数(比率)', + 'members_stat_updatetime' => '更新时间', + 'members_stat_update_option' => '更新统计项', + 'members_stat_update_data' => '更新数据', + 'members_stat_tips' => '
        • 统计的用户资料与用户栏目设置有关:只有表单元素为下拉框或单选框的会做统计。
        • 如果统计项可能有改变,请先更新统计项,再更新数据
        • ', + + 'admingroup' => '管理组', + 'admingroup_tips' => '
        • Discuz! 管理组包括管理员、超级版主、版主三个内置管理组以及自定义管理组。
        • ', + 'admingroup_level' => '管理级别', + 'admingroup_setting_user' => '基本设置', + 'admingroup_setting_admin' => '管理权限', + 'admingroups_multiedit' => '批量编辑所选管理组', + + 'admingroup_edit' => '编辑管理组', + 'admingroup_edit_permdetail' => '权限', + 'admingroup_edit_admincpperm' => '管理中心权限', + 'admingroup_edit_threadperm' => '主题管理权限', + 'admingroup_edit_postperm' => '文章管理权限', + 'admingroup_edit_modcpperm' => '管理面板权限', + 'admingroup_edit_spaceperm' => '空间管理权限', + 'admingroup_edit_portalperm' => '门户管理权限', + 'admingroup_edit_otherperm' => '其他权限', + 'admingroup_edit_mod_thread' => '允许管理主题', + 'admingroup_edit_mod_thread_comment' => '设置是否允许对管理范围内的主题进行置顶、移动等管理操作', + 'admingroup_edit_edit_post' => '允许编辑文章', + 'admingroup_edit_edit_post_comment' => '设置是否允许编辑管理范围内的文章', + 'admingroup_edit_edit_poll' => '允许编辑投票', + 'admingroup_edit_edit_poll_comment' => '设置是否允许编辑管理范围内投票主题的选项', + 'admingroup_edit_edit_trade' => '允许编辑商品', + 'admingroup_edit_edit_trade_comment' => '设置是否允许编辑管理范围内商品主题的商品', + 'admingroup_edit_usertag' => '允许添加用户标签', + 'admingroup_edit_usertag_comment' => '设置是否允许编辑管理范围内主题的用户标签', + 'admingroup_edit_edit_activity' => '允许管理活动报名者', + 'admingroup_edit_edit_activity_comment' => '设置是否允许管理范围内活动主题的报名者', + 'admingroup_edit_remove_reward' => '允许移除悬赏', + 'admingroup_edit_remove_reward_comment' => '设置是否允许移除管理范围内悬赏主题的悬赏金额', + 'admingroup_edit_stick_thread' => '允许置顶主题', + 'admingroup_edit_stick_thread_none' => '不允许置顶', + 'admingroup_edit_stick_thread_1' => '允许置顶 I', + 'admingroup_edit_stick_thread_2' => '允许置顶 I/II', + 'admingroup_edit_stick_thread_3' => '允许置顶 I/II/III', + 'admingroup_edit_stick_thread_comment' => '设置是否允许置顶管理范围内主题的级别。如果打开全局置顶的功能,置顶 III 将全站置顶,置顶 II 将在当前分类置顶', + 'admingroup_edit_digest_thread' => '允许精华主题', + 'admingroup_edit_digest_thread_none' => '不允许精华', + 'admingroup_edit_digest_thread_1' => '允许精华 I', + 'admingroup_edit_digest_thread_2' => '允许精华 I/II', + 'admingroup_edit_digest_thread_3' => '允许精华 I/II/III', + 'admingroup_edit_digest_thread_comment' => '设置是否允许精华管理范围内主题的级别', + 'admingroup_edit_highlight_thread' => '允许高亮主题', + 'admingroup_edit_highlight_thread_comment' => '设置是否允许高亮管理范围内的主题', + 'admingroup_edit_live_thread' => '允许直播主题', + 'admingroup_edit_live_thread_comment' => '设置是否允许直播管理范围内的主题', + 'admingroup_edit_recommend_thread' => '允许推荐主题', + 'admingroup_edit_recommend_thread_comment' => '设置是否允许推荐管理范围内的主题 (要在相应版块的扩展设置里开启推荐主题功能)', + 'admingroup_edit_bump_thread' => '允许提升主题', + 'admingroup_edit_bump_thread_comment' => '设置是否允许提升管理范围内的主题', + 'admingroup_edit_close_thread' => '允许关闭主题', + 'admingroup_edit_close_thread_comment' => '设置是否允许关闭管理范围内的主题', + 'admingroup_edit_move_thread' => '允许移动主题', + 'admingroup_edit_move_thread_comment' => '设置是否允许移动管理范围内的主题', + 'admingroup_edit_edittype_thread' => '允许编辑主题分类', + 'admingroup_edit_edittype_thread_comment' => '设置是否允许编辑管理范围内主题的分类', + 'admingroup_edit_stamp_thread' => '允许添加主题图章', + 'admingroup_edit_stamp_thread_comment' => '设置是否允许给主题在文章内容页添加图章', + 'admingroup_edit_stamp_list' => '允许添加主题图标', + 'admingroup_edit_stamp_list_comment' => '设置是否允许给主题在文章列表页添加图标', + 'admingroup_edit_copy_thread' => '允许复制主题', + 'admingroup_edit_copy_thread_comment' => '设置是否允许复制管理范围内的主题', + 'admingroup_edit_merge_thread' => '允许合并主题', + 'admingroup_edit_merge_thread_comment' => '设置是否允许合并管理范围内的主题', + 'admingroup_edit_split_thread' => '允许分割主题', + 'admingroup_edit_split_thread_comment' => '设置是否允许分割管理范围内的主题', + 'admingroup_edit_repair_thread' => '允许修复主题', + 'admingroup_edit_repair_thread_comment' => '设置是否允许修复管理范围内的主题', + 'admingroup_edit_view_report' => '允许查看用户报告', + 'admingroup_edit_view_report_comment' => '设置是否允许查看管理范围内的用户报告', + 'admingroup_edit_edit_forum' => '允许编辑版块', + 'admingroup_edit_edit_forum_comment' => '设置是否允许编辑管理范围内的版块的资料', + 'admingroup_edit_warn_post' => '允许警告文章', + 'admingroup_edit_warn_post_comment' => '设置是否允许警告管理范围内的文章', + 'admingroup_edit_mod_post' => '允许审核文章', + 'admingroup_edit_mod_post_comment' => '设置是否允许审核用户发表的文章,只在站点设置需要审核时有效', + 'admingroup_edit_del_post' => '允许删除文章', + 'admingroup_edit_del_post_comment' => '设置是否允许删除管理范围内的文章', + 'admingroup_edit_stick_post' => '允许置顶回帖', + 'admingroup_edit_stick_post_comment' => '设置是否允许置顶管理范围内的回帖', + 'admingroup_edit_manage_tag' => '允许管理标签', + 'admingroup_edit_manage_tag_comment' => '设置是否允许管理管理范围内的标签', + 'admingroup_edit_ban_post' => '允许屏蔽文章', + 'admingroup_edit_ban_post_comment' => '设置是否允许屏蔽管理范围内的文章', + 'admingroup_edit_mass_prune' => '允许批量删帖', + 'admingroup_edit_mass_prune_comment' => '设置是否允许通过管理面板批量删帖,版主在面板中批量删帖的范围是 1 周内,超级版主删帖范围是 2 周内, 管理员无限制', + 'admingroup_edit_refund' => '允许强制退款', + 'admingroup_edit_refund_comment' => '允许将作者发布的收费主题终止,并将作者所获得收益退还给购买者。退款后,该主题将不能再被设置为收费主题,同时作者将自行承担积分交易而产生的损失', + 'admingroup_edit_censor_word' => '允许过滤词语', + 'admingroup_edit_censor_word_comment' => '设置是否允许添加或修改词语过滤设置', + 'admingroup_edit_view_ip' => '允许查看 IP', + 'admingroup_edit_view_ip_comment' => '设置是否允许查看用户 IP', + 'admingroup_edit_manage_collection' => '允许管理淘专辑', + 'admingroup_edit_manage_collection_comment' => '设置是否允许管理淘专辑', + 'admingroup_edit_allow_make_html' => '允许生成HTML文件', + 'admingroup_edit_allow_make_html_comment' => '设置是否允许生成HTML文件', + 'admingroup_edit_ban_ip' => '允许禁止 IP', + 'admingroup_edit_ban_ip_comment' => '设置是否允许添加或修改禁止 IP 设置', + 'admingroup_edit_edit_user' => '允许编辑用户', + 'admingroup_edit_edit_user_comment' => '设置是否允许编辑用户资料', + 'admingroup_edit_ban_user' => '允许禁止用户发言', + 'admingroup_edit_ban_user_comment' => '设置是否允许禁止用户发言', + 'admingroup_edit_ban_user_visit' => '允许禁止用户访问', + 'admingroup_edit_ban_user_visit_comment' => '设置是否允许禁止用户访问', + 'admingroup_edit_mod_user' => '允许审核用户', + 'admingroup_edit_mod_user_comment' => '设置是否允许审核新注册用户,只在站点设置需要人工审核新用户时有效', + 'admingroup_edit_post_announce' => '允许发布公告', + 'admingroup_edit_post_announce_comment' => '设置是否允许发布站点公告', + 'admingroup_edit_clear_recycle' => '允许删除回收站的文章', + 'admingroup_edit_clear_recycle_comment' => '设置是否允在“前台->管理面板->主题回收站”中删除主题', + 'admingroup_edit_view_log' => '允许查看管理日志', + 'admingroup_edit_view_log_comment' => '设置是否允许查看管理日志', + 'admingroup_edit_disable_postctrl' => '发表不受限制', + 'admingroup_edit_disable_postctrl_comment' => '设置发表是否不受灌水预防和最大字数等', + 'admingroup_edit_manage_article' => '允许管理所有文章', + 'admingroup_edit_manage_article_comment' => '选择“是”则允许此管理组成员管理编辑删除所有频道栏目文章', + 'admingroup_edit_add_topic' => '允许创建专题', + 'admingroup_edit_add_topic_comment' => '设置是否允许创建专题', + 'admingroup_edit_manage_topic' => '允许管理专题', + 'admingroup_edit_manage_topic_comment' => '设置是否允许编辑所有专题', + 'admingroup_edit_diy' => '允许 DIY', + 'admingroup_edit_diy_comment' => '设置是否允许 DIY 论坛,文章,空间,论坛等页面', + 'admingroup_edit_manage_feed' => '允许管理动态(feed)', + 'admingroup_edit_manage_doing' => '允许管理记录', + 'admingroup_edit_manage_share' => '允许管理分享', + 'admingroup_edit_manage_blog' => '允许管理日志', + 'admingroup_edit_manage_album' => '允许管理相册', + 'admingroup_edit_manage_comment' => '允许管理评论', + 'admingroup_edit_manage_magiclog' => '允许管理道具记录', + 'admingroup_edit_manage_report' => '允许管理举报', + 'admingroup_edit_manage_hotuser' => '允许管理推荐成员', + 'admingroup_edit_manage_defaultuser' => '允许管理推荐好友', + 'admingroup_edit_manage_magic' => '允许管理道具', + 'admingroup_edit_manage_click' => '允许管理表态动作', + + 'report_newreport' => '最新举报', + 'report_resolved' => '已处理记录', + 'report_note' => '留言', + 'report_your' => '您的 ', + 'report_receiveuser' => '接收提醒', + 'report_newreport_no_operate' => '不奖惩', + 'report_newreport_url' => '页面地址:', + 'report_newreport_view' => '举报预览:', + 'report_newreport_message' => '举报理由:', + 'report_newreport_resolve' => '处理选中', + 'report_newreport_time' => '举报时间:', + 'report_resolved_result' => '处理结果:', + 'report_reward_min' => '奖惩最小值', + 'report_reward_max' => '奖惩最大值', + 'report_reward_comment' => '两值为空或为0时不启用举报奖惩', + + 'warn_info' => '警告信息', + 'warn_user' => '警告用户', + 'warn_reason' => '警告理由:', + 'warn_url' => '页面地址:', + + 'founder_cpgroupname' => '职务名称', + 'founder_username' => '成员用户', + 'founder_usergname' => '职务', + 'founder_admin' => '创始人', + 'founder_master' => '副站长', + 'founder_usergname_comment' => '设置当前管理团队成员的职务', + 'founder_perm_setting' => '基本权限', + 'founder_perm_all' => '拥有全部权限', + 'founder_perm_allowpost' => '开启授权', + 'founder_group_switch' => '切换团队职务', + + 'founder_perm_moderate_threads' => '审核主题', + 'founder_perm_moderate_replies' => '审核回复', + 'founder_perm_moderate_blogs' => '审核日志', + 'founder_perm_moderate_pictures' => '审核图片', + 'founder_perm_moderate_doings' => '审核记录', + 'founder_perm_moderate_shares' => '审核分享', + 'founder_perm_moderate_comments' => '审核评论/留言', + 'founder_perm_moderate_articles' => '审核文章', + 'founder_perm_moderate_articlecomments' => '审核文章评论', + 'founder_perm_credits' => '积分策略', + 'founder_perm_members_group' => '用户所在用户组', + 'founder_perm_members_access' => '用户权限', + 'founder_perm_members_credit' => '用户积分', + 'founder_perm_members_medal' => '用户勋章', + 'founder_perm_members_confermedal' => '颁发勋章', + 'founder_perm_members_repeat' => '用户马甲', + 'founder_perm_members_clean' => '用户清理', + 'founder_perm_members_edit' => '用户编辑', + 'founder_perm_group_editgroup' => '编辑圈子', + 'founder_perm_group_deletegroup' => '删除圈子', + 'founder_perm_group_deletegroupcomments' => '被选中圈子所有数据将被删除', + 'founder_perm_ec_qpay' => 'QQ 钱包账号', + 'founder_perm_ec_wechat' => '微信账号', + 'founder_perm_ec_alipay' => '支付宝账号', + 'founder_perm_ec_credit' => '诚信规则', + 'founder_perm_ec_orders' => '积分充值订单', + 'founder_perm_tradelog' => '商品交易订单', + + 'founder_notifyusers_types' => '可接收的通知类型', + 'founder_notifyusers_tips' => '
        • 可设置哪些用户可以接收管理类的通知。
        • ', + 'founder_notidyusers_verifythread' => '主题审核', + 'founder_notidyusers_verifypost' => '回复审核', + 'founder_notidyusers_verifyuser' => '用户审核', + 'founder_notidyusers_verifypic' => '图片审核', + 'founder_notidyusers_verifyshare' => '分享审核', + 'founder_notidyusers_verifyblog' => '日志审核', + 'founder_notidyusers_verifydoing' => '记录审核', + 'founder_notidyusers_verifyrecyclepost' => '回帖回收站', + 'founder_notidyusers_verifymedal' => '勋章申请', + 'founder_notidyusers_verifycommontes' => '留言/评论审核', + 'founder_notidyusers_verifyrecycle' => '回收站', + 'founder_notidyusers_verifyarticle' => '文章审核', + 'founder_notidyusers_verifyacommont' => '文章评论审核', + 'founder_notidyusers_verifyfield' => '认证相关审核', + + 'founder_patchstatus_0' => '未修复', + 'founder_patchstatus_1' => '完成修复', + 'founder_patchstatus_2' => '文件可能已经修改过,未发现漏洞', + 'founder_patchstatus_error1' => '安全补丁编码为空,您本地的补丁信息数据可能出现问题', + 'founder_patchstatus_error2' => '漏洞修补文件不存在或文件不可修改,请检查并修改权限为可读可写(777)', + 'founder_patchstatus_error3' => '写入临时文件出错,请查看data目录是否可写', + 'founder_patchstatus_error4' => 'ftp方式无法使用,请确认ftp账号等相关信息填写正确', + 'founder_patchstatus_error5' => '复制文件出现问题,请确认源代码文件目录及子目录可读可写,或文件可能被锁,请关闭站点后进行操作', + 'founder_patchstatus_error6' => '修复漏洞出现问题,回退时出现问题,请尽快恢复文件,文件备份可在同级目录找到', + 'founder_patch_tips' => '
        • 漏洞修复状态说明:
        • +
        • +  2 文件可能已经修改过,未发现漏洞
          +  1 完成修复
          +  0 未修复
          + -1 漏洞编码为空,您本地的漏洞信息数据可能出现问题
          + -2 漏洞修补文件不存在或文件不可修改,请检查并修改权限为可读可写(777)
          + -3 写入临时文件出错,请查看data目录是否可写
          + -4 ftp方式无法使用,请确认ftp账号等相关信息填写正确
          + -5 复制文件出现问题,请确认源代码文件目录及子目录可读可写,或文件可能被锁,请关闭站点后进行操作
          + -6 修复漏洞出现问题,回退时出现问题,请尽快恢复文件,文件备份可在同级目录找到 +
        • ', + + 'usergroups' => '用户组', + 'usergroups_system_0' => '普通用户', + 'usergroups_system_1' => '管理员', + 'usergroups_system_2' => '超级版主', + 'usergroups_system_3' => '版主', + 'usergroups_system_4' => '禁止发言', + 'usergroups_system_5' => '禁止访问', + 'usergroups_system_6' => '用户IP被禁止', + 'usergroups_system_7' => '游客', + 'usergroups_system_8' => '等待验证', + 'usergroups_creditsrange' => '积分介于', + + 'usergroups_add' => '添加新用户组', + 'usergroups_level_add' => '添加新级别', + 'usergroups_sepcial_add' => '添加新自定义用户组', + 'usergroups_tips' => '
        • 用户组分为系统组、会员组和自定义组,会员组以积分确定组别和权限,而系统组和自定义组是人为设定,不会由系统自行改变。
        • 系统组和自定义组的设定不需要指定积分,Discuz! 预留了从站点管理员到游客等的 8 个系统头衔,自定义组的用户需要在编辑会员时将其加入。
        • 会员用户组至少分为两组,其积分下限分别为负值(任一负数)和 0,否则将导致部分用户无法与用户组匹配的问题。
        • ', + 'usergroups_member' => '会员用户组', + 'usergroups_special' => '自定义用户组', + 'usergroups_specialadmin' => '自定义管理组', + 'usergroups_system' => '系统用户组', + 'usergroups_title' => '组头衔', + 'usergroups_stars' => '星星数', + 'usergroups_color' => '头衔颜色', + 'usergroups_icon' => '组图标', + 'usergroups_status' => '系统头衔', + 'usergroups_specified_members' => '包含特殊用户', + 'usergroups_specified_members_leaved_out' => ' ... (自动省略)', + 'usergroups_project' => '设置参照', + 'usergroups_switch' => '切换用户组 / 批量编辑', + 'usergroups_multiedit' => '批量编辑所选用户组', + + 'usergroups_copy' => '设置复制', + 'usergroups_copy_comment' => '将本用户组的设置复制到其他用户组', + 'usergroups_copy_tips' => '
        • 用户组设置复制可将源用户组栏目的某些设置应用到其他多个用户组,用于以一个用户组的设置为基础,快速设置一批用户组。
        • 用户组设置复制一旦提交立即生效,并无法恢复,请仔细选择目标用户组和设置项目。
        • ', + 'usergroups_copy_source' => '源用户组', + 'usergroups_copy_target' => '目标用户组', + 'usergroups_copy_target_comment' => '选择要将源用户组复制到哪些目标用户组,可以按住 CTRL 多选', + 'usergroups_copy_options' => '项目选择', + 'usergroups_copy_options_comment' => '选择要将源用户组的哪些设置复制到目标用户组,可以按住 CTRL 多选', + + 'usergroups_merge' => '用户组合并', + 'usergroups_merge_link' => '合并', + 'usergroups_merge_comment' => '将本用户组的会员移动到其他用户组,并删除本用户组。', + 'usergroups_merge_tips' => '
        • 用户组合并可将源用户组的用户合并进入所选的新用户组,并且可以选择删除源用户组。
        • 用户组合并不可以操作管理组。
        • 用户组合并一旦提交立即生效,并无法恢复,请仔细选择目标用户组和设置项目。
        • ', + 'usergroups_merge_source' => '源用户组', + 'usergroups_merge_target' => '目标用户组', + 'usergroups_merge_target_comment' => '选择要将源用户组合并到哪个用户组', + 'usergroups_merge_delete_source' => '同时删除源用户组', + + 'usergroups_edit' => '编辑用户组', + + 'usergroups_edit_basic' => '基本设置', + 'usergroups_edit_basic_title' => '用户组头衔', + 'usergroups_edit_basic_scheme' => '用户组设置方案', + 'usergroups_edit_basic_visit' => '访问站点权限', + 'usergroups_edit_basic_visit_none' => '禁止访问', + 'usergroups_edit_basic_visit_normal' => '正常访问', + 'usergroups_edit_basic_visit_super' => '超级访问', + 'usergroups_edit_basic_visit_comment' => '禁止访问: 禁止用户浏览本站任何页面
          正常访问: 当站点开放的时候,可以正常浏览页面
          超级访问: 即便站点关闭也可以访问,一般用于管理员或站内测试组', + 'usergroups_edit_basic_read_access' => '阅读权限', + 'usergroups_edit_basic_read_access_comment' => '设置用户浏览文章或附件的权限级别,范围 0~255,0 为禁止用户浏览任何文章或附件。当用户的阅读权限小于文章或附件的阅读权限许可(默认时为 1)时,用户将不能阅读该文章或下载该附件', + 'usergroups_edit_basic_max_friend_number' => '最多好友数', + 'usergroups_edit_basic_max_friend_number_comment' => '0为无限', + 'usergroups_edit_basic_view_profile' => '允许查看用户资料', + 'usergroups_edit_basic_view_profile_comment' => '设置是否允许查看其他用户的资料信息', + 'usergroups_edit_basic_view_stats' => '允许查看统计数据', + 'usergroups_edit_basic_view_stats_comment' => '设置是否允许用户查看统计数据', + 'usergroups_edit_basic_invisible' => '允许隐身', + 'usergroups_edit_basic_invisible_comment' => '设置是否允许用户登录后不显示在在线列表中', + 'usergroups_edit_basic_multigroups' => '允许加入/离开公众用户组', + 'usergroups_edit_basic_multigroups_comment' => '设置是否允许用户在个人中心加入或离开可用的公众用户组', + 'usergroups_edit_basic_allowtransfer' => '允许积分转账', + 'usergroups_edit_basic_allowtransfer_comment' => '设置是否允许用户在个人中心将自己的交易积分转让给其他用户。注意: 本功能需在 全局设置中启用交易积分后才可使用', + 'usergroups_edit_basic_allowfollow' => '允许用户收听他人', + 'usergroups_edit_basic_allowfollow_comment' => '设置是否允许用户收听他人,避免收听类骚扰', + 'usergroups_edit_basic_allowavatarupload' => '允许在本应用上传头像', + 'usergroups_edit_basic_allowavatarupload_comment' => '设置是否允许该用户组在本应用上传头像。注意:本选项与强制用户上传头像同时开启时可能导致用户无法正常发布内容', + 'usergroups_edit_basic_allowviewprofile' => '允许用户浏览个人资料页', + 'usergroups_edit_basic_allowviewprofile_comment' => '设置是否允许该用户组浏览其他用户的个人资料页', + 'usergroups_edit_basic_allowsendpm' => '允许发送短消息', + 'usergroups_edit_basic_allowsendpm_comment' => '设置是否允许用户发送短消息', + 'usergroups_edit_basic_search' => '允许使用搜索', + 'usergroups_edit_basic_search_disable' => '禁用搜索', + 'usergroups_edit_basic_search_thread' => '只允许搜索标题', + 'usergroups_edit_basic_search_post' => '允许全文搜索', + 'usergroups_edit_basic_search_post_comment' => '此设置只对搜索论坛有效。注意: 当数据量大时,全文搜索将非常耗费服务器资源,请慎用', + 'usergroups_edit_basic_search_comment' => '选择您要为此用户组开启的搜索项目', + 'usergroups_edit_basic_reasonpm' => '操作理由短消息通知作者', + 'usergroups_edit_basic_reasonpm_none' => '不强制', + 'usergroups_edit_basic_reasonpm_reason' => '强制输入理由', + 'usergroups_edit_basic_reasonpm_pm' => '强制通知作者', + 'usergroups_edit_basic_reasonpm_both' => '强制输入理由和通知作者', + 'usergroups_edit_basic_reasonpm_comment' => '设置用户在对他人评分或管理操作时是否强制输入理由和通知作者', + 'usergroups_edit_basic_blog' => '允许使用文集', + 'usergroups_edit_basic_blog_comment' => '设置是否允许把文章加入个人的文集中,从而供他人浏览', + 'usergroups_edit_basic_cstatus' => '允许自定义头衔', + 'usergroups_edit_basic_cstatus_comment' => '设置是否允许用户设置自己的头衔名字并在文章中显示', + 'usergroups_edit_basic_hour_threads' => '会员每小时发主题数限制', + 'usergroups_edit_basic_hour_threads_comment' => '设置允许会员每小时最多的发主题数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效', + 'usergroups_edit_basic_hour_posts' => '会员每小时发回帖数限制', + 'usergroups_edit_basic_hour_posts_comment' => '设置允许会员每小时最多的发回帖数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效', + 'usergroups_edit_basic_disable_periodctrl' => '不受时间段限制', + 'usergroups_edit_basic_disable_periodctrl_comment' => '设置用户是否可以不受全局设置中设置的特殊时间段禁令限制', + 'usergroups_edit_basic_radminid' => '关联管理权', + 'usergroups_edit_basic_radminid_comment' => '与本用户组相关联的管理权限类别,如果选择“无”,则本用户组用户无管理权限;否则,按照管理组中本组的权限赋予用户管理权限', + 'usergroups_edit_basic_seccode' => '启用验证码或验证问答机制', + 'usergroups_edit_basic_seccode_comment' => '开启验证机制可以防止灌水机等,但会增加用户操作易用度。修改密码不受此限制,开启验证码或验证问答后,该设置有效', + 'usergroups_edit_basic_disable_postctrl' => '发表不受限制', + 'usergroups_edit_basic_disable_postctrl_comment' => '设置发表是否不受灌水预防和最大字数等', + 'usergroups_edit_basic_forcesecques' => '强制设置安全提问', + 'usergroups_edit_basic_forcesecques_comment' => '选择“是”则此用户组的用户在登录后台前必须设置安全提问后才可登录后台, config中为全局开关', + 'usergroups_edit_basic_forcelogin' => '安全登录方式', + 'usergroups_edit_basic_forcelogin_comment' => '选择此用户组用户安全登录的方式', + 'usergroups_edit_basic_forcelogin_none' => '不开启', + 'usergroups_edit_basic_forcelogin_qq' => 'QQ登录', + 'usergroups_edit_basic_forcelogin_mail' => '邮箱登录', + 'usergroups_edit_basic_ignore_censor' => '忽略需要审核的关键字', + 'usergroups_edit_basic_ignore_censor_comment' => '选择“是”则此用户组的用户在发表时不会触发需要审核的关键字', + 'usergroups_edit_basic_allow_stat' => '允许查看趋势统计', + 'usergroups_edit_basic_allow_statdata' => '允许查看站点统计', + 'usergroups_edit_basic_domain_length' => '二级域名最短长度', + 'usergroups_edit_basic_domain_length_comment' => '0为禁止使用二级域名,最大长度为15,在站点开启二级域名时有效', + 'usergroups_edit_basic_intro_length' => '介绍类文字最大长度', + 'usergroups_edit_basic_intro_length_comment' => '字节(单位),0不限制', + 'usergroups_edit_basic_allowcreatecollection' => '允许用户创建淘专辑的数量', + 'usergroups_edit_basic_allowcreatecollection_comment' => '“0”表示不允许创建淘专辑', + 'usergroups_edit_basic_allowfollowcollection' => '最多允许关注淘专辑的数量', + 'usergroups_edit_basic_allowfollowcollection_comment' => '允许用户最多关注淘专辑的数量', + 'usergroups_edit_basic_close_ad' => '是否关闭广告展示', + 'usergroups_edit_basic_close_ad_comment' => '选择“是”则此用户组的用户在站点中看不到任何广告', + + + 'usergroups_edit_system' => '用户组体制', + 'usergroups_edit_system_tips' => '
        • 非公众用户组
          当用户组设置为“非公众用户组”时,无论是以主用户组的形式,还是以扩展用户组的形式,均只能由管理员手工将用户加入本组。
        • 公众用户组
          当本用户组设置为“公众用户组”,且用户当前所在的用户组被允许加入/离开公众用户组时,用户将可以在个人中心将本组设置为其主用户组或扩展用户组。当设为主用户组后,相关权限将遵循本用户组的权限设定;当设为扩展用户组后,将能访问特定的只有本用户组能够访问的论坛版块。
        • 收费公众用户组:
          您可以选择要求用户支付一定的交易积分才能加入本组,用户支付的交易积分多少,决定了系统允许其拥有本组权限时间的长短。您可以设定用户拥有本组权限一天,所需支付的交易积分的数额。超过用户购买的相应期限后,系统会自动去除该用户相关的用户组属性。
        • 免费公众用户组:
          用户只需在个人中心选择加入本用户组,即可拥有本用户组的权限和头衔,而不需要付出任何代价。
        • ', + 'usergroups_edit_system_public' => '公众用户组', + 'usergroups_edit_system_buy' => '收费用户组', + 'usergroups_edit_system_free' => '免费用户组', + 'usergroups_edit_system_public_comment' => '设置是否为公众用户组。注意: 使用此功能前请确定是否确实需要,否则用户一旦自行加入本组,即便之后再设置本组为非公众用户组,仍然无法将用户从该组中批量去除,除非删除本用户组。公众用户组不能关联管理组,以免产生安全隐患', + 'usergroups_edit_system_dailyprice' => '收费公众用户组日价格', + 'usergroups_edit_system_dailyprice_comment' => '如果您需要用户支付相应的交易积分后才能加入本用户组,请在此输入本组的日购买价格,单位为交易积分所使用的单位。例如设置为 2,则用户购买为期 30 天的本组权限,需要支付 2*30=60 个交易积分,30 天有效期后该用户将自动从本组中退出。如设置为 0,则本组为免费公众用户组。注意: 本功能需要首先设定用户组为公众用户组且设置了有效的交易积分后才有效', + 'usergroups_edit_system_minspan' => '收费公众用户组一次最短购买时间(天)', + 'usergroups_edit_system_minspan_comment' => '设置用户在购买本组权限时,一次支付价值至少多少日的交易积分,请设置为大于等于 1 的数值。例如日价格为 2,最短购买时间为 10,则用户至少需要花费 2*10=20 个交易积分,获得至少 10 天本组权限,才能加入本组。注意: 本功能需要首先设定用户组为收费公众用户组才有效', + 'usergroups_edit_system_guest_portal_tips' => '
        • 游客用户组设置时,门户相关的发表权限对此用户组无效
        • ', + 'usergroups_edit_system_guest_home_tips' => '
        • 游客用户组设置时,空间相关的发表、评论权限对此用户组无效
        • ', + + 'usergroups_edit_forum' => '论坛相关', + 'usergroups_edit_special' => '特殊主题', + 'usergroups_edit_special_poll' => '允许发起投票', + 'usergroups_edit_special_poll_comment' => '选择“是”允许在论坛发布投票主题', + 'usergroups_edit_special_vote' => '允许参与投票', + 'usergroups_edit_special_vote_comment' => '选择“是”允许在论坛参与投票', + 'usergroups_edit_special_activity' => '允许发起活动', + 'usergroups_edit_special_activity_comment' => '选择“是”允许在论坛发布活动主题', + 'usergroups_edit_special_reward' => '允许发起悬赏', + 'usergroups_edit_special_reward_comment' => '选择“是”允许在论坛发布悬赏主题,悬赏使用交易积分', + 'usergroups_edit_special_reward_min' => '最小悬赏积分', + 'usergroups_edit_special_reward_min_comment' => '每笔悬赏最少悬赏积分(最小设置为 1)', + 'usergroups_edit_special_reward_max' => '最大悬赏积分', + 'usergroups_edit_special_reward_max_comment' => '每笔悬赏最多悬赏的积分,最大可设置为 65535 (不限制请输入 0)', + 'usergroups_edit_special_trade' => '允许发布商品', + 'usergroups_edit_special_trade_comment' => '选择“是”允许在论坛发布商品主题', + 'usergroups_edit_special_trade_fee_mode' => '交易手续费计算方式', + 'usergroups_edit_special_trade_fee_mode_comment' => '交易手续费的计算方式,本功能需要设置“允许发布商品”,在支付宝管理中设置“开启交易手续费”后才有效', + 'usergroups_edit_special_trade_fee_mode_fixed' => '固定值', + 'usergroups_edit_special_trade_fee_mode_per' => '百分比', + 'usergroups_edit_special_trade_fee' => '交易手续费', + 'usergroups_edit_special_trade_fee_comment' => '交易手续费计算方式设置为固定值时,手续费将按照固定的金额(单位:人民币 元)收取。设置为百分比时,手续费将按照每笔交易金额的百分比收取。本功能需要设置“允许发起交易”,在支付宝管理中设置“开启交易手续费”后才有效', + 'usergroups_edit_special_trade_min' => '最小交易金额', + 'usergroups_edit_special_trade_min_comment' => '每笔交易的最小交易金额(单位:人民币元或积分单位,最小交易金额为 1 元)', + 'usergroups_edit_special_trade_max' => '最大交易金额', + 'usergroups_edit_special_trade_max_comment' => '设置每笔交易所能设置的最大交易金额(单位:人民币元或积分单位,不限制请输入 0)', + 'usergroups_edit_special_trade_stick' => '商品主题最多推荐商品数', + 'usergroups_edit_special_trade_stick_comment' => '设置用户在每篇商品主题中最多推荐商品的数目', + 'usergroups_edit_special_debate' => '允许发起辩论', + 'usergroups_edit_special_debate_comment' => '选择“是”允许在论坛发布辩论主题', + 'usergroups_edit_special_allowthreadplugin' => '允许发布扩展特殊主题', + 'usergroups_edit_special_allowthreadplugin_comment' => '设置是否允许发表扩展的特殊主题', + 'usergroups_edit_special_rushreply' => '允许发表抢楼帖', + 'usergroups_edit_special_rushreply_comment' => '抢楼帖不允许用户删除回帖', + + 'usergroups_edit_post' => '文章相关', + 'usergroups_edit_post_new' => '允许发新话题', + 'usergroups_edit_post_new_comment' => '设置是否允许发新话题。注意: 只有当用户组阅读权限高于 0 时,才能发新话题', + 'usergroups_edit_post_reply' => '允许发表回复', + 'usergroups_edit_post_reply_comment' => '设置是否允许发表回复。注意: 只有当用户组阅读权限高于 0 时,才能发表回复', + + 'usergroups_edit_post_direct' => '允许直接发帖', + 'usergroups_edit_post_direct_none' => '全部需要审核', + 'usergroups_edit_post_direct_reply' => '发新回复不需要审核', + 'usergroups_edit_post_direct_thread' => '发新主题不需要审核', + 'usergroups_edit_post_direct_all' => '全部不需要审核', + 'usergroups_edit_post_direct_comment' => '是否允许直接发帖或者对回复及主题进行审核,此设置受版块审核影响,如果版块设置为不需要审核,则此设置无效', + 'usergroups_edit_post_direct_group' => '允许直接发帖', + 'usergroups_edit_post_url' => '允许发站外URL', + 'usergroups_edit_post_url_comment' => '是否允许发帖包含URL,合理的设置可以有效的减少广告帖的量', + 'usergroups_edit_post_url_enable' => '允许,并正常解析', + 'usergroups_edit_post_url_unhandle' => '允许,但不解析', + 'usergroups_edit_post_url_mod' => '允许,但文章进入审核', + 'usergroups_edit_post_url_banned' => '禁止发表', + 'usergroups_edit_post_url_group' => '允许发站外URL', + 'usergroups_edit_post_anonymous' => '允许发匿名帖', + 'usergroups_edit_post_anonymous_comment' => '是否允许用户匿名发表主题和回复,只要用户组或本论坛允许,用户均可使用匿名发帖功能。匿名发帖不同于游客发帖,用户需要登录后才可使用,版主和管理员可以查看真实作者', + 'usergroups_edit_post_set_read_perm' => '允许设置文章权限', + 'usergroups_edit_post_set_read_perm_comment' => '设置是否允许设置文章需要指定阅读权限才可浏览', + 'usergroups_edit_post_maxprice' => '主题(附件)最高售价', + 'usergroups_edit_post_maxprice_comment' => '主题(附件)出售使得作者可以将自己发表的主题(附件)隐藏起来,只有当浏览者向作者支付相应的交易积分后才能查看主题(附件)内容。此处设置用户出售主题(附件)时允许设置的最高价格,0 为不允许用户出售。注意: 本功能需在 全局设置中启用交易积分后才可使用。如开启版主及管理员的出售主题(附件)功能,请将其最高价格设置为高于普通用户组允许的最高价格,这样在文章被编辑时不至于导致主题(附件)售价的硬性下调', + 'usergroups_edit_post_tag' => '允许使用标签', + 'usergroups_edit_post_tag_comment' => '设置是否允许发表新话题时使用标签', + 'usergroups_edit_post_hide_code' => '允许使用 [hide] 代码', + 'usergroups_edit_post_hide_code_comment' => '设置是否允许文章中使用 [hide] 隐藏标签', + 'usergroups_edit_post_mediacode' => '允许使用 [audio] [media] [flash] 等多媒体代码', + 'usergroups_edit_post_mediacode_comment' => '设置是否允许 [audio] [media] [flash] 等多媒体代码', + 'usergroups_edit_post_html' => '允许使用 HTML 代码', + 'usergroups_edit_post_html_comment' => '注意: 开放 HTML 功能将产生安全隐患,请慎用。建议只在十分必要的情况下使用,并限制只开放给最核心的管理人员', + 'usergroups_edit_post_custom_bbcode' => '允许使用自定义 Discuz! 代码', + 'usergroups_edit_post_custom_bbcode_comment' => '设置是否解析用户文章中的自定义 Discuz! 代码。注意: 自定义 Discuz! 代码由管理团队成员在管理中心中自行定义,不包括系统内置的数十种代码', + 'usergroups_edit_post_bio_bbcode' => '允许自我介绍中使用 Discuz! 代码', + 'usergroups_edit_post_bio_bbcode_comment' => '设置是否解析用户自我介绍中的 Discuz! 代码', + 'usergroups_edit_post_bio_img_code' => '允许自我介绍中使用 [img] 代码', + 'usergroups_edit_post_bio_img_code_comment' => '设置是否解析用户自我介绍中的 [img] 代码', + 'usergroups_edit_post_max_bio_size' => '自我介绍文字最大长度', + 'usergroups_edit_post_max_bio_size_comment' => '设置用户自我介绍最大字节数,0 为使用系统默认值 200', + 'usergroups_edit_post_begincode' => '允许使用 [begin] 代码', + 'usergroups_edit_post_begincode_comment' => '设置是否允许文章中使用 [begin] 开头动画标签', + 'usergroups_edit_post_sig_bbcode' => '允许签名中使用 Discuz! 代码', + 'usergroups_edit_post_sig_bbcode_comment' => '设置是否解析用户签名中的 Discuz! 代码', + 'usergroups_edit_post_sig_img_code' => '允许签名中使用 [img] 代码', + 'usergroups_edit_post_sig_img_code_comment' => '设置是否解析用户签名中的 [img] 代码', + 'usergroups_edit_post_max_sig_size' => '签名文字最大长度', + 'usergroups_edit_post_max_sig_size_comment' => '设置用户签名最大字节数,0 为不允许用户使用签名', + 'usergroups_edit_post_recommend' => '主题评价影响值', + 'usergroups_edit_post_recommend_comment' => '设置用户评价一次主题,对主题评价指数的影响,0 为不允许用户评价主题', + 'usergroups_edit_post_edit_time_limit' => '编辑文章时间限制(分钟)', + 'usergroups_edit_post_edit_time_limit_comment' => '文章作者发帖后超过此时间限制将不能再编辑帖,版主和管理员在 全局 - 用户权限 选择“允许用户随时编辑的文章类型”后不受此限制,0 为不限制', + 'usergroups_edit_post_allowcommentpost' => '文章直接点评', + 'usergroups_edit_post_allowcommentpost_comment' => '设置允许点评的范围,如不选择表示不启用点评功能
          注意:只有在 全局 - 站点功能 - 文章点评 中开启直接点评功能,本设置才会生效', + 'usergroups_edit_post_allowcommentpost_firstpost' => '点评主题', + 'usergroups_edit_post_allowcommentpost_reply' => '点评回复', + 'usergroups_edit_post_allowcommentreply' => '楼层回复点评', + 'usergroups_edit_post_allowcommentreply_comment' => '允许用户通过点击文章中的“回复”链接回复他人回帖时,自动对该楼层产生点评
          注意:只有在 全局 - 站点功能 - 文章点评 中开启楼层回复功能,本设置才会生效;点击主题中的“回复”链接,不会对主题产生点评', + 'usergroups_edit_post_allowat' => '发帖时可 @ 其他人的数量', + 'usergroups_edit_post_allowat_comment' => '0为不允许 @ 其他人(包括他关注的人和他的好友)', + 'usergroups_edit_post_allowsave' => '允许保存草稿', + 'usergroups_edit_post_allowsave_comment' => '设置是否允许用户保存草稿', + 'usergroups_edit_post_allowsavereply' => '允许回复草稿', + 'usergroups_edit_post_allowsavereply_comment' => '设置是否允许用户回复草稿(回复草稿不增加用户积分,但增加用户发帖数)', + 'usergroups_edit_post_allowsavenum' => '允许保存草稿的数量', + 'usergroups_edit_post_allowsavenum_comment' => '设置为 0 为不限制用户保存草稿的数量(高流量站点不建议限制草稿数)', + 'usergroups_edit_post_allowcommentitem' => '允许用户在点评时发表观点', + 'usergroups_edit_post_allowcommentitem_comment' => '允许用户在点评时发表观点
          注意:只有在 全局 - 站点功能 - 文章点评 中开启直接点评功能,本设置才会生效', + 'usergroups_edit_post_allow_down_remote_img' => '允许下载远程图片', + 'usergroups_edit_post_allow_down_remote_img_comment' => '远程图片本地化保存', + 'usergroups_edit_post_allowreplycredit' => '允许设置回帖奖励', + 'usergroups_edit_post_allowreplycredit_comment' => '允许用户在发布主题时给予回帖者一定的扩展积分奖励。回帖奖励默认积分可在全局 - 积分设置指定', + 'usergroups_edit_post_allowsetpublishdate' => '允许设置定时发布', + 'usergroups_edit_post_allowsetpublishdate_comment' => '允许用户在发布主题时设置指定的发帖时间。只能设置在每半小时(如 13:00 或 13:30)自动发布。', + 'usergroups_edit_post_allowcommentcollection' => '允许评论淘专辑', + 'usergroups_edit_post_allowcommentcollection_comment' => '允许用户在主题和淘专辑页面进行评论。', + 'usergroups_edit_post_allowimgcontent' => '允许主题内容生成图片', + 'usergroups_edit_post_allowimgcontent_comment' => '看帖时所有文章正文内容将以字符形式生成图片展示。', + 'usergroups_edit_attach' => '附件相关', + 'usergroups_edit_attach_get' => '允许下载附件', + 'usergroups_edit_attach_get_comment' => '设置是否允许在没有设置特殊权限的论坛中下载附件', + 'usergroups_edit_attach_getimage' => '允许查看图片', + 'usergroups_edit_attach_getimage_comment' => '设置是否允许在没有设置特殊权限的论坛中查看图片', + 'usergroups_edit_attach_post' => '允许上传附件', + 'usergroups_edit_attach_post_comment' => '设置是否允许上传附件到没有设置特殊权限的论坛中。需要 PHP 设置允许才有效,请参考管理中心首页', + 'usergroups_edit_image_post' => '允许上传图片', + 'usergroups_edit_image_post_comment' => '设置是否允许上传图片到没有设置特殊权限的论坛中。需要 PHP 设置允许才有效,请参考管理中心首页', + 'usergroups_edit_attach_set_perm' => '允许设置附件权限', + 'usergroups_edit_attach_set_perm_comment' => '设置是否允许设置附件需要指定积分以上才可下载', + 'usergroups_edit_attach_max_space_size' => '空间大小(单位M)', + 'usergroups_edit_attach_max_space_size_comment' => '设置最大空间尺寸(单位M),0 为不限制', + 'usergroups_edit_attach_max_size' => '论坛最大附件尺寸(单位K 1M=1024K)', + 'usergroups_edit_attach_max_size_comment' => '设置附件最大尺寸(单位K 1M=1024K),0 为不限制,需要 PHP 设置允许才有效,请参考管理中心首页', + 'usergroups_edit_attach_max_size_per_day' => '每天最大附件总尺寸(单位K 1M=1024K)', + 'usergroups_edit_attach_max_size_per_day_comment' => '设置用户每天可以上传的附件总量(单位K 1M=1024K),0 为不限制', + 'usergroups_edit_attach_max_number_per_day' => '每天最大附件数量', + 'usergroups_edit_attach_max_number_per_day_comment' => '设置用户每天可以上传的附件数量,0 为不限制', + 'usergroups_edit_attach_ext' => '允许附件类型', + 'usergroups_edit_attach_ext_comment' => '设置允许上传的附件扩展名,多个扩展名之间用半角逗号 "," 隔开,留空为不限制', + + 'usergroups_edit_other' => '其他', + 'usergroups_edit_magic' => '道具相关', + 'usergroups_edit_magic_tips' => '
        • 道具相关设置需要打开道具功能方生效,点这里打开道具功能
        • ', + 'usergroups_edit_magic_permission' => '允许使用道具', + 'usergroups_edit_magic_permission_comment' => '是否允许使用道具,包括买卖、赠送的权限', + 'usergroups_edit_magic_discount' => '购买道具折扣', + 'usergroups_edit_magic_discount_comment' => '购买道具的折扣值,范围 1~9 数值越小折扣越多,0 为不享受折扣', + 'usergroups_edit_magic_max' => '道具包容量', + 'usergroups_edit_magic_max_comment' => '本组用户带有道具的最大重量,范围 0~60000', + 'usergroups_edit_magic_unallowed' => '不允许使用、购买和转让', + 'usergroups_edit_magic_allow' => '允许使用、购买', + 'usergroups_edit_magic_allow_and_pass' => '允许使用、购买和转让', + + 'usergroups_edit_invite' => '注册相关', + 'usergroups_edit_invite_tips' => '
        • 邀请注册相关设置需要打开邀请注册功能方生效,点这里打开邀请注册功能
        • ', + 'usergroups_edit_invite_permission' => '允许购买邀请码', + 'usergroups_edit_invite_permission_comment' => '是否允许购买邀请码的权限', + 'usergroups_edit_invite_send_permission' => '允许发送邀请注册', + 'usergroups_edit_invite_send_permission_comment' => '是否允许通过站点邮件系统发送邀请码', + 'usergroups_edit_invite_price' => '邀请码购买价格', + 'usergroups_edit_invite_price_comment' => '该用户组的会员购买邀请码的价格', + 'usergroups_edit_invite_buynum' => '24小时内购买邀请码最大数量', + 'usergroups_edit_invite_buynum_comment' => '该用户组24小时内购买邀请码的最大数量,超过此数量将不能购买新的邀请码', + 'usergroups_edit_invite_maxinviteday' => '邀请码有效期', + 'usergroups_edit_invite_maxinviteday_comment' => '该用户组购买邀请码的最大有效期,超过此有效期验证码将自动失效,单位为天,默认为10', + + 'usergroups_edit_pm' => '消息相关', + 'usergroups_edit_pm_sendallpm' => '是否可以给任何人发短消息', + 'usergroups_edit_pm_sendallpm_comment' => '选择否的话,当对方设置为只接受好友短消息,将无法对其发送短消息', + 'usergroups_edit_pm_sendpmmaxnum' => '24小时内发布短消息最大数', + 'usergroups_edit_pm_sendpmmaxnum_comment' => '设置该用户组用户24小时内发布短消息的最大数,有效的控制短消息发布广告的情况, 0为不限制', + + 'usergroups_edit_credit' => '积分相关', + 'usergroups_edit_credit_allowrate' => '允许参与评分', + 'usergroups_edit_credit_rate_isself' => '扣除自身积分', + 'usergroups_edit_credit_rate_min' => '评分最小值', + 'usergroups_edit_credit_rate_max' => '评分最大值', + 'usergroups_edit_credit_rate_mrpd' => '24 小时最大评分数', + 'usergroups_edit_credit_rate_comment' => '请勾选允许本组用户参与评分的积分(只有在 全局设置 中启用了的扩展积分,才能在此进行设置),如果全部不勾选,则不允许评分。请同时设置每次评分的最小和最大分值(范围 -999~+999),且最小值不得大于最大值,否则评分设置无法生效', + 'usergroups_edit_credit_rate_tips' => '当选中扣除自身积分后,前台用户评分时会扣除用户的相应积分,否则扣除的系统积分', + 'usergroups_edit_credit_exempt' => '扩展积分豁免权', + 'usergroups_edit_credit_exempt_comment' => '以上项目中,选择“是”表示本组用户将不执行相应的扣积分操作,选择“否”将使用论坛默认或版块设定的规则', + 'usergroups_edit_credit_exempt_sendpm' => '发短消息不扣积分', + 'usergroups_edit_credit_exempt_search' => '搜索不扣积分', + 'usergroups_edit_credit_exempt_getattch' => '下载附件不扣积分', + 'usergroups_edit_credit_exempt_threadpay' => '可直接查看收费主题', + 'usergroups_edit_credit_exempt_attachpay' => '可直接下载收费附件', + 'usergroups_edit_credit_exempt_inperm' => '管辖版块内', + 'usergroups_edit_credit_exempt_outperm' => '管辖版块外', + + 'usergroups_edit_home' => '空间相关', + 'usergroups_edit_home_allow_viewprofile' => '允许查看用户资料', + 'usergroups_edit_home_allow_viewprofile_comment' => '设置是否允许查看其他用户的资料信息', + 'usergroups_edit_home_allow_blog' => '发表日志', + 'usergroups_edit_home_allow_blog_mod' => '发表日志需要审核', + 'usergroups_edit_home_allow_doing' => '发表记录', + 'usergroups_edit_home_allow_doing_mod' => '发表记录需要审核', + 'usergroups_edit_home_allow_upload' => '上传图片', + 'usergroups_edit_home_allow_upload_mod' => '上传图片需要审核', + 'usergroups_edit_home_allow_share' => '发布分享', + 'usergroups_edit_home_allow_share_mod' => '发布分享需要审核', + 'usergroups_edit_home_allow_poke' => '允许打招呼', + 'usergroups_edit_home_allow_friend' => '允许加好友', + 'usergroups_edit_home_allow_click' => '允许表态', + 'usergroups_edit_home_allow_comment' => '发表留言/评论', + 'usergroups_edit_home_allow_comment_mod' => '留言/评论评论需要审核', + 'usergroups_edit_home_allow_comment_mod_comment' => '设置此用户组发表留言/评论强制审核,关闭时仅命中审核敏感词时才审核', + 'usergroups_edit_home_allow_space_diy_html' => '允许自定义模块使用 HTML', + 'usergroups_edit_home_allow_space_diy_html_comment' => '注意: 开放 HTML 功能将产生安全隐患,请慎用。建议只在十分必要的情况下使用,并限制只开放给最核心的管理人员', + 'usergroups_edit_home_allow_space_diy_bbcode' => '允许自定义模块使用 BBCODE', + 'usergroups_edit_home_allow_space_diy_bbcode_comment' => '设置是否解析个人主页自定义模块中的 BBCODE 代码', + 'usergroups_edit_home_allow_space_diy_imgcode' => '允许自定义模块使用 [img]', + 'usergroups_edit_home_allow_space_diy_imgcode_comment' => '设置是否解析个人主页自定义模块中的 [img] 代码', + 'usergroups_edit_home_image_max_size' => '相册单张图片最大尺寸(单位K 1M=1024K)', + 'usergroups_edit_home_image_max_size_comment' => '设置相册单张图片最大尺寸(单位K 1M=1024K),0 为不限制,需要 PHP 设置允许才有效,请参考管理中心首页', + + 'usergroups_edit_group' => '圈子相关', + 'usergroups_edit_group_build' => '允许建立圈子的数量', + 'usergroups_edit_group_build_comment' => '范围1-255,0为不允许建立圈子', + 'usergroups_edit_group_buildcredits' => '创建圈子消耗积分', + 'usergroups_edit_group_buildcredits_comment' => '创建圈子需要消耗和积分数量,0为不需要积分', + + 'usergroups_edit_portal' => '门户相关', + 'usergroups_edit_portal_allow_post_article' => '发布文章', + 'usergroups_edit_portal_allow_down_local_img' => '允许下载本地图片', + 'usergroups_edit_portal_allow_down_local_img_comment' => '下载远程图片的同时允许重新生成一份本地图片', + 'usergroups_edit_portal_allow_post_article_moderate' => '发布文章需要审核', + 'usergroups_edit_portal_allow_comment_article_mod' => '文章评论需要审核', + 'usergroups_edit_portal_allow_comment_article_mod_comment' => '设置此用户组发表文章评论强制审核,关闭时仅命中审核敏感词时才审核', + 'usergroups_edit_portal_allow_comment_article' => '文章评论字数', + 'usergroups_edit_portal_allow_comment_article_comment' => '设置此用户组发表文章评论字数限制,设置为0将禁止此用户组发表评论', + + 'usergroups_edit_raterange_min' => '评分最小值', + 'usergroups_edit_raterange_max' => '评分最大值', + 'usergroups_edit_raterange_mrpd' => '24 小时最大评分数', + + 'usergroups_edit_plugin' => '插件相关', + + 'groups_search_result' => '共搜索到 {groupnum} 个符合条件的圈子', + 'groups_setting_basic' => '基本设置', + 'groups_setting_basic_status' => '是否开启圈子功能', + 'groups_setting_basic_mod' => '审核新圈子', + 'groups_setting_basic_mod_comment' => '管理员建立圈子时不需要审核', + 'groups_setting_basic_iconsize' => '圈子图标文件大小(单位:KB)', + 'groups_setting_basic_iconsize_comment' => '设置圈子图标文件的最大尺寸,0 或留空为不限制', + 'groups_setting_basic_recommend' => '推荐圈子', + 'groups_setting_basic_recommend_comment' => '填写要推荐到圈子首页的圈子 ID,以半角逗号 "," 隔开,最多显示 8 个,如不足8个会自动补充积分最高的圈子。例:“23,56,983”', + 'groups_setting_admingroup' => '选择管理用户组(在圈子中具有与论坛中相对应的管理权限)', + 'groups_setting_succeed' => '操作成功', + 'groups_type_level_1' => '一级分类', + 'groups_type_level_1_add' => '添加一级分类', + 'groups_type_sub_new' => '新子分类', + 'groups_type_name' => '分类名称', + 'groups_type_count' => '圈子数', + 'groups_type_operation' => '操作', + 'groups_type_show_rows' => '圈子横排:', + 'groups_type_delete' => '删除本分类及分类下所有圈子', + 'groups_type_search' => '搜索圈子', + 'groups_manage_name' => '圈子名称', + 'groups_manage_id' => '圈子 ID', + 'groups_manage_postcount' => '文章数', + 'groups_manage_replycount' => '回复数', + 'groups_manage_createtime' => '创建时间', + 'groups_manage_updatetime' => '最后更新时间', + 'groups_manage_threadcount' => '主题数', + 'groups_manage_membercount' => '成员数', + 'groups_manage_founder' => '创建者', + 'groups_manage_founder_uid' => '创建者 UID', + 'groups_editgroup_name' => '圈子名', + 'groups_editgroup_category' => '圈子分类', + 'groups_editgroup_category_comment' => '可以按住 CTRL 多选', + 'group_mergetype' => '合并分类', + 'group_mergegroup' => '合并到圈子', + 'group_changetype' => '转移到分类:', + 'group_mergetype_selecttype' => '选择目标分类', + 'group_mergetype_selecttype_comment' => '合并操作将把原分类下的所有圈子转移到目标分类下,并删除原分类', + 'groups_editgroup_jointype' => '加入方式', + 'groups_editgroup_recommend' => '推荐圈子', + 'groups_editgroup_visible_all' => '所有人可见', + 'groups_editgroup_description' => '简介', + 'groups_editgroup_rules' => '公告', + 'groups_editgroup_icon' => '圈子图标', + 'groups_editgroup_banner' => '顶部图片', + 'groups_mergegroup_id' => '请填写目标圈子ID', + 'group_mod_wait' => '待审核的圈子', + 'group_mod_description' => '简介', + 'group_mod_delconfirm' => '确认要删除选中的圈子吗?', + + 'threads' => '批量主题管理', + 'threads_tips' => '
        • 通过批量主题管理,您可以对搜索到的主题进行批量删除、移动、分类/取消分类、删除、置顶/取消置顶、设置/取消精华、打开/关闭以及删除主题中的附件等操作;
        • 请先根据条件搜索主题,然后选择相应的操作。
        • ', + 'threads_list' => '主题列表', + 'threads_search' => '搜索符合条件主题', + 'threads_search_include_yes' => '包含且仅包含', + 'threads_search_include_no' => '不包含', + 'threads_search_detail' => '显示详细主题列表', + 'threads_search_forum' => '所在版块', + 'threads_search_type' => '所在主题分类', + 'threads_search_sort' => '所在分类信息', + 'threads_search_type_none' => '无分类', + 'threads_search_special' => '所属特殊主题', + 'threads_search_sticky' => '是否包含置顶帖', + 'threads_search_digest' => '是否包含精华帖', + 'threads_search_blog' => '是否包含文集', + 'threads_search_attach' => '是否包含附件', + 'threads_search_viewrange' => '被浏览次数介于', + 'threads_search_replyrange' => '被回复次数介于', + 'threads_search_readpermmore' => '所需阅读权限高于', + 'threads_search_pricemore' => '售价高于', + 'threads_search_time' => '发表时间范围', + 'threads_search_time_comment' => '格式 yyyy-mm-dd,不限制请输入 0', + 'threads_search_noreplyday' => '多少天内无新回复', + 'threads_search_user' => '主题作者', + 'threads_search_user_comment' => '多用户名中间请用半角逗号 "," 隔开', + 'threads_search_keyword' => '标题关键字', + 'threads_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开', + 'threads_search_perpage' => '每页显示数', + 'threads_result' => '符合条件的主题数', + 'threads_new_result' => '最新主题数', + 'threads_readperm' => '阅读权限', + 'threads_price' => '售价', + 'threads_thread_nonexistence' => '您没有提供搜索条件或没有与条件匹配的主题', + 'threads_delete' => '批量删除', + 'threads_delete_no_update_member' => '删帖不减用户发帖数和积分', + 'threads_delete_attach' => '删除主题中的附件', + 'threads_stick' => '批量置顶', + 'threads_add_digest' => '批量设置精华', + 'threads_open_close' => '批量打开关闭', + 'threads_move_forum' => '批量移动到版块', + 'threads_move_type' => '分类', + 'threads_move_sort' => '批量移动到分类信息', + 'threads_views' => '浏览', + 'threads_replies' => '回复', + 'threads_lastpost' => '最后发表', + 'threads_remove' => '解除', + 'threads_special' => '是否包含特殊主题', + 'threads_rate' => '是否包含评分帖', + 'threads_highlight' => '是否包含高亮帖', + 'threads_save' => '是否包含草稿', + 'threads_hide' => '是否包含隐藏主题', + 'threads_batch' => '批量设置打开/关闭', + 'threads_digest_one' => '精华I', + 'threads_digest_two' => '精华II', + 'threads_digest_three' => '精华III', + 'threads_stick_one' => '置顶I', + 'threads_stick_two' => '置顶II', + 'threads_stick_three' => '置顶III', + 'threads_succeed' => '批量管理成功完成', + + 'threads_forumstick' => '版块/圈子置顶', + 'threads_forumstick_tips' => '
        • 多版块置顶功能可让一个主题在任意多个版块或圈子分类内置顶显示。
        • 管理员只需指定主题帖的 URL 地址,并选择要在哪些版块或圈子分类中置顶该主题即可。
        • ', + 'threads_forumstick_threadurl' => '主题URL', + 'threads_forumstick_targets' => '选择目标论坛版块', + 'threads_forumstick_targets_comment' => '指定的主题会在这些论坛版块中置顶显示,可以按住 CTRL 多选', + 'threads_forumstick_targets_change' => '更改目标版块/圈子分类', + 'threads_forumstick_targetgroups' => '选择目标圈子分类', + 'threads_forumstick_targetgroups_comment' => '指定的主题会在这些圈子分类的群中置顶显示,可以按住 CTRL 多选', + 'threads_forumstick_forum' => '论坛版块', + 'threads_forumstick_group' => '圈子分类', + + 'threads_postposition' => '文章优化', + 'threads_postposition_tips' => '
        • 本功能主要用于优化回复数量较多的主题在显示时候的性能,通常情况下,当文章回复数量超过5000或者预计此帖的回复数量将会在5000 以上的时候,您可以将该主题加入优化队列
        • +
        • 当主题进入优化队列后,我们不建议对该主题的某个文章进行删除操作,如果该内容确实违规,我们建议您屏蔽它即可
        • +
        • 当您发起抢楼活动的时候,系统会自动将抢楼的主题放入优化队列。您也可以在这里将任意一个回复较多的主题放入优化队列
        • + ', + + 'threads_postposition_replies' => '指定回复数大于', + 'delandadd' => '重建优化', + 'deleteposition' => '删除优化', + 'replies' => '回复数', + 'addposition' => '添加优化', + 'srchthread' => '搜索主题', + 'above' => '大于', + 'srch' => '查询', + 'srch_replies' => '根据回复数大于', + 'srch_tid' => '或直接指定主题 tid =', + + 'prune_tips' => '
        • 批量删帖仅用于删除违规文章使用,如您需要批量删除历史旧帖,请使用批量主题管理功能。
        • 使用此功能,需同时提供起始时间和终止时间其中之一,及发帖用户名、发帖 IP、内容关键字其中之一,至少共二项必要的条件,否则将无法进行操作。
        • 如果符合删除条件的文章为主题第一帖,或该主题无回复,将删除整个主题。
        • 如果您不是论坛管理员,您只能删除从某一时间到现在的范围内的文章。
        • 超级版主的删帖的时间范围为二星期(14 天);版主的时间范围为一星期(7 天)且只能删除所管辖论坛内的文章。
        • 关键字可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略字符的个数,如 "a{1}s{2}s"(不含引号) 可以搜索到 "ass" 也可搜索到 "axsxs" 和 "axsxxs" 等等。
        • ', + 'prune' => '批量删帖', + 'prune_search' => '搜索符合条件的文章', + 'prune_search_detail' => '显示详细文章列表', + 'prune_search_time' => '发表时间范围', + 'prune_search_time_comment' => '格式 yyyy-mm-dd,不限制请输入 0', + 'prune_search_select_postsplit' => '选择文章分表', + 'prune_search_forum' => '所在版块', + 'prune_search_perpage' => '每页显示数', + 'prune_search_user' => '发帖用户名', + 'prune_search_user_comment' => '多用户名中间请用半角逗号 "," 隔开', + 'prune_search_ip' => '发帖 IP ', + 'prune_search_ip_comment' => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 'prune_search_keyword' => '内容关键字', + 'prune_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 'prune_search_lengthlimit' => '内容最小长度', + 'prune_search_lengthlimit_comment' => '本功能会加重服务器负担', + 'prune_result' => '符合条件的文章数', + 'prune_nosubject' => '(无标题)', + 'prune_no_update_member' => '删帖不减用户发帖数和积分', + 'prune_succeed' => '符合条件的 {deletedthreads} 篇主题和 {deletedposts} 篇文章被删除', + 'prune_condition_invalid' => '您没有同时选择时间范围和指定相关的搜索条件,请返回', + 'prune_mod_range_illegal' => '您指定的时间范围超过限制', + 'prune_post_nonexistence' => '没有与条件匹配的文章', + + 'quickquery_open_forum' => '快速开启论坛版块功能', + 'quickquery_open_recycle' => '开启 所有版块 主题回收站', + 'quickquery_open_discuzcode' => '开启 所有版块 Discuz! 代码', + 'quickquery_open_imgcode' => '开启 所有版块 [IMG] 代码', + 'quickquery_open_smilies' => '开启 所有版块 Smilies 代码', + 'quickquery_open_jam' => '开启 所有版块 内容干扰码', + 'quickquery_open_guest' => '开启 所有版块 允许匿名发贴', + 'quickquery_close_forum' => '快速关闭论坛版块功能', + 'quickquery_close_recycle' => '关闭 所有版块 主题回收站', + 'quickquery_close_html' => '关闭 所有版块 HTML 代码', + 'quickquery_close_discuzcode' => '关闭 所有版块 Discuz! 代码', + 'quickquery_close_imgcode' => '关闭 所有版块 [IMG] 代码', + 'quickquery_close_smilies' => '关闭 所有版块 Smilies 代码', + 'quickquery_close_jam' => '关闭 所有版块 内容干扰码', + 'quickquery_close_guest' => '关闭 所有版块 允许匿名发贴', + 'quickquery_user' => '会员操作相关', + 'quickquery_clear_userlog' => '清空 所有会员 积分交易记录', + + 'specialuser_defaultuser' => '推荐好友', + 'specialuser_defaultuser_tips' => '
        • 以下为推荐好友列表。
        • 推荐优先级的数值越小,优先级越高。
        • ', + 'specialuser_follow_tips' => '
        • 以下为推荐关注用户列表
        • 推荐优先级的数值越小,优先级越高。
        • ', + 'specialuser_defaultuser_add_tips' => '
        • 用户名和原因需同时填写。
        • 已添加的用户不可重复添加。
        • ', + 'specialuser_hotuser' => '明星会员', + 'specialuser_hotuser_tips' => '
        • 以下为明星会员列表,没推荐则为空。可添加推荐。
        • 推荐优先级的数值越小,优先级越高。
        • ', + 'specialuser_order' =>'推荐优先级', + + 'doing_tips' => '
        • 批量记录信息管理用于删除记录使用,并且连同对应的回复一同删除。
        • 关键字可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略字符的个数,如 "a{1}s{2}s"(不含引号) 可以搜索到 "ass" 也可搜索到 "axsxs" 和 "axsxxs" 等等。
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'doing' => '记录管理', + 'doing_search' => '搜索符合条件的记录', + 'doing_search_detail' => '显示详细记录列表', + 'doing_search_time' => '发表时间范围', + 'doing_search_time_comment' => '格式 yyyy-mm-dd', + 'doing_search_user' => '发表记录用户名', + 'doing_search_user_comment' => '多用户名中间请用半角逗号 "," 隔开', + 'doing_search_ip' => '发表记录 IP ', + 'doing_search_ip_comment' => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 'doing_search_keyword' => '内容关键字', + 'doing_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 'doing_search_lengthlimit' => '内容最小长度', + 'doing_search_lengthlimit_comment' => '本功能会加重服务器负担', + 'doing_search_perpage' => '每页显示数', + 'doing_result' => '符合条件的记录数', + 'doing_new_result' => '最新记录数', + 'doing_succeed' => '符合条件的 {deletecount} 篇记录被删除', + 'doing_condition_invalid' => '您没有同时选择时间范围和指定相关的搜索条件', + 'doing_mod_range_illegal' => '您指定的时间范围超过限制', + 'doing_post_nonexistence' => '没有与条件匹配的记录', + + 'blog_tips' => '
        • 批量日志信息管理用于删除日志使用,并且连同对应的回复一同删除。
        • 关键字可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略字符的个数,如 "a{1}s{2}s"(不含引号) 可以搜索到 "ass" 也可搜索到 "axsxs" 和 "axsxxs" 等等。
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'blog' => '日志管理', + 'blog_search_uid' => '用户 UID', + 'blog_search_uid_comment' => '多 UID 中间请用半角逗号 "," 隔开', + 'blog_search_blogid' => '日志 ID', + 'blog_search_blogid_comment' => '多日志 ID 中间请用半角逗号 "," 隔开', + 'blog_search_view' => '查看数', + 'blog_search_reply' => '回复数', + 'blog_search_hot' => '热度', + 'blog_search' => '搜索符合条件的日志', + 'blog_search_detail' => '显示详细日志列表', + 'blog_search_time' => '发表时间范围', + 'blog_search_time_comment' => '格式 yyyy-mm-dd', + 'blog_search_user' => '发表日志用户名', + 'blog_search_user_comment' => '多用户名中间请用半角逗号 "," 隔开', + 'blog_search_ip_comment' => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 'blog_search_keyword' => '标题或内容关键字', + 'blog_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 'blog_search_friend' => '查看权限', + 'blog_search_ip' => '发布IP', + 'blog_search_lengthlimit' => '内容最小长度', + 'blog_search_lengthlimit_comment' => '本功能会加重服务器负担', + 'blog_search_perpage' => '每页显示数', + 'blog_result' => '符合条件的日志数', + 'blog_new_result' => '最新日志数', + 'blog_succeed' => '符合条件的 {deletecount} 篇日志被删除', + 'blog_restore_succeed' => '符合条件的 {restorecount} 篇日志被恢复', + 'blog_condition_invalid' => '您没有同时选择时间范围和指定相关的搜索条件', + 'blog_mod_range_illegal' => '您指定的时间范围超过限制', + 'blog_post_nonexistence' => '没有与条件匹配的日志', + + 'feed_tips' => '
        • 批量动态管理用于删除动态(feed)使用。
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'feed' => '动态管理', + 'feed_search_uid' => '用户 UID', + 'feed_search_uid_comment' => '多 UID 中间请用半角逗号 "," 隔开', + 'feed_search_perpage' => '每页显示数', + 'feed_search_feedid' => '动态 ID', + 'feed_search_feedid_comment' => '多动态 ID 中间请用半角逗号 "," 隔开', + 'feed_search_hot' => '热度', + 'feed_search_icon' => '动态类型', + 'feed_search' => '搜索符合条件的动态', + 'feed_search_detail' => '显示详细动态列表', + 'feed_search_time' => '发表时间范围', + 'feed_search_time_comment' => '格式 yyyy-mm-dd', + 'feed_search_user' => '发表动态用户名', + 'feed_search_user_comment' => '多用户名中间请用半角逗号 "," 隔开', + 'feed_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 'feed_result' => '符合条件的动态数', + 'feed_succeed' => '符合条件的 {deletecount} 条动态被删除', + 'feed_mod_range_illegal' => '您指定的时间范围超过限制', + 'feed_post_nonexistence' => '没有与条件匹配的动态', + 'feed_global' => '全局动态', + 'feed_global_title' => '动态标题', + 'feed_global_title_comment' => '支持html,例如:加粗<b></b>,变色 <font color=red></font>', + 'feed_global_body_general' => '动态备注', + 'feed_global_body_general_comment' => '支持html', + 'feed_global_image_1' => '第1张图片地址', + 'feed_global_image_1_link' => '第1张图片链接', + 'feed_global_image_2' => '第2张图片地址', + 'feed_global_image_2_link' => '第2张图片链接', + 'feed_global_image_3' => '第3张图片地址', + 'feed_global_image_3_link' => '第3张图片链接', + 'feed_global_image_4' => '第4张图片地址', + 'feed_global_image_4_link' => '第4张图片链接', + 'feed_global_dateline' => '发布时间', + 'feed_global_dateline_comment' => '(格式:yyyy-mm-dd H:i)您可以填写一个将来的日期和时间,那么这条动态会在这个将来的日期到来之前,一直显示在第一位', + 'feed_global_hot' => '动态热度', + 'feed_blog' => '撰写日志', + 'feed_thread' => '论坛发帖', + 'feed_album' => '更新相册', + 'feed_friend' => '添加好友', + 'feed_poll' => '发起投票', + 'feed_comment' => '发表评论/留言', + 'feed_click' => '对日志/图片表态', + 'feed_show' => '竞价排名', + 'feed_profile' => '更新个人资料', + 'feed_sitefeed' => '全局动态', + + 'album_tips' => '
        • 批量相册管理用于删除相册使用。连图片一同删除
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'album' => '相册管理', + 'album_default' => '默认相册', + 'album_search_uid' => '用户 UID', + 'album_search_albumname' => '相册名', + 'album_search_perpage' => '每页显示数', + 'album_search_uid_comment' => '多 UID 中间请用半角逗号 "," 隔开', + 'album_search_albumid' => '相册 ID', + 'album_search_albumid_comment' => '多相册 ID 中间请用半角逗号 "," 隔开', + 'album_search' => '搜索符合条件的相册', + 'album_search_detail' => '显示详细相册列表', + 'album_search_time' => '更新时间范围', + 'album_search_time_comment' => '格式 yyyy-mm-dd', + 'album_search_user' => '创建相册用户名', + 'album_search_user_comment' => '多用户名中间请用半角逗号 "," 隔开', + 'album_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 'album_result' => '符合条件的相册数', + 'album_new_result' => '最新相册数', + 'album_succeed' => '符合条件的 {deletecount} 个相册被删除', + 'album_mod_range_illegal' => '您指定的时间范围超过限制', + 'album_post_nonexistence' => '没有与条件匹配的相册', + + 'pic_tips' => '
        • 批量图片管理用于删除图片使用。连图片评论一同删除
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'pic' => '图片管理', + 'pic_search_picid' => '图片 ID', + 'pic_search_picid_comment' => '多图片 ID 中间请用半角逗号 "," 隔开', + 'pic_search_title' => '图片标题', + 'pic_search' => '搜索符合条件的图片', + 'pic_search_detail' => '显示详细图片列表', + 'pic_search_time' => '上传时间范围', + 'pic_search_time_comment' => '格式 yyyy-mm-dd', + 'pic_search_albumid' => '所在相册 ID', + 'pic_search_albumid_comment' => '多相册 ID 中间,请用半角逗号 "," 隔开', + 'pic_search_perpage' => '每页显示数', + 'pic_search_user' => '发表图片用户名', + 'pic_search_user_comment' => '多所有者中间请用半角逗号 "," 隔开', + 'pic_result' => '符合条件的图片数', + 'pic_new_result' => '最新图片数', + 'pic_succeed' => '符合条件的 {deletecount} 张图片被删除', + 'pic_mod_range_illegal' => '您指定的时间范围超过限制', + 'pic_post_nonexistence' => '没有与条件匹配的图片', + 'pic_search_createtime' => '上传时间', + 'pic_search_hot' => '热度', + 'pic_search_ip' =>'发布IP', + 'pic_search_ip_comment' => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 'postcomment_search_detail' => '显示详细点评列表', + 'postcomment_tips' => '
        • 批量点评管理用于删除文章点评。
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'postcomment_delete' => '删除点评成功', + 'postcomment_nonexistence' => '没有与条件匹配的点评', + 'postcomment_result' => '符合条件的点评数', + 'postcomment_new_result' => '最新点评数', + 'postcomment_search' => '搜索符合条件的点评', + 'postcomment_pid' => '查看文章', + 'postcomment_content' => '点评内容', + 'postcomment_guest' => '游客', + 'postcomment_search_tid' => '被点评主题 ID', + 'postcomment_search_tid_comment' => '指定主题的所有点评(包括主题帖和回帖),多 ID 中间请用半角逗号 "," 隔开', + 'postcomment_search_pid' => '被点评文章 ID', + 'postcomment_search_pid_comment' => '指定文章的点评,多 ID 中间请用半角逗号 "," 隔开', + 'postcomment_search_author' => '点评者', + 'postcomment_search_author_comment' => '多点评者名中间请用半角逗号 "," 隔开', + 'postcomment_search_authorid' => '点评者 ID', + 'postcomment_search_authorid_comment' => '多点评者 ID 中间请用半角逗号 "," 隔开', + 'postcomment_search_time' => '点评时间范围', + 'postcomment_search_time_comment' => '格式 yyyy-mm-dd', + 'comment_idtype' => '评论类型', + 'comment_comment' => '评论/留言', + 'comment_article_comment' => '文章评论', + 'comment_topic_comment' => '专题评论', + 'comment_article_tips' => '
        • 这里管理非文章推送的文章的评论。
        • 由文章推送生成的文章的评论,请到批量删帖管理。
        • ', + 'comment_topic_tips' => '
        • 这里管理门户里专题的评论。
        • ', + 'comment_uid' => '留言', + 'comment_blogid' => '日志', + 'comment_picid' => '图片', + 'comment_eventid' => '活动', + 'comment_sid' => '分享', + 'comment_article' => '文章', + 'comment_topic' => '专题', + 'comment_tips' => '
        • 批量留言管理用于删除留言使用。
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'comment' => '留言管理', + 'comment_search_perpage' => '每页显示数', + 'comment_search_id' => '留言 ID', + 'comment_search_id_comment' => '多留言 ID 中间请用半角逗号 "," 隔开', + 'comment_search_author' => '评论者', + 'comment_search_author_comment' => '多评论者名中间请用半角逗号 "," 隔开', + 'comment_search_authorid' => '评论者 ID', + 'comment_search_authorid_comment' => '多评论者 ID 中间请用半角逗号 "," 隔开', + 'comment_search_uid' => '被评论者 UID', + 'comment_search_uid_comment' => '多 UID 中间请用半角逗号 "," 隔开', + 'comment_search_message' => '评论内容', + 'comment_article_subject' => '被评论文章标题', + 'comment_article_id' => '被评论文章 ID', + 'comment_article_id_comment' => '多被评论文章 ID 中间请用半角逗号 "," 隔开', + 'comment_topic_subject' => '被评论专题标题', + 'comment_topic_id' => '被评论专题 ID', + 'comment_topic_id_comment' => '多被评论专题 ID 中间请用半角逗号 "," 隔开', + 'comment_search' => '搜索符合条件的留言', + 'comment_search_detail' => '显示详细留言列表', + 'comment_search_time' => '评论时间范围', + 'comment_search_time_comment' => '格式 yyyy-mm-dd', + 'comment_result' => '符合条件的评论数', + 'comment_succeed' => '符合条件的 {deletecount} 个评论被删除', + 'comment_article_delete' => '删除评论成功', + 'comment_mod_range_illegal' => '您指定的时间范围超过限制', + 'comment_post_nonexistence' => '没有与条件匹配的评论', + 'comment_search_ip' =>'发布IP', + 'comment_search_ip_comment' => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + + 'share_tips' => '
        • 批量分享管理用于删除分享(share)使用。
        • 提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!
        • ', + 'share' => '分享管理', + 'share_search_uid' => '用户 UID', + 'share_search_perpage' => '每页显示数', + 'share_search_uid_comment' => '多 UID 中间请用半角逗号 "," 隔开', + 'share_search_sid' => '分享 ID', + 'share_search_sid_comment' => '多分享 ID 中间请用半角逗号 "," 隔开', + 'share_search_hot' => '热度', + 'share_search_icon' => '分享类型', + 'share_search' => '搜索符合条件的分享', + 'share_search_detail' => '显示详细分享列表', + 'share_search_time' => '发表时间范围', + 'share_search_time_comment' => '格式 yyyy-mm-dd', + 'share_search_user' => '发表分享用户名', + 'share_search_user_comment' => '多用户名中间请用半角逗号 "," 隔开', + 'share_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 'share_result' => '符合条件的分享数', + 'share_succeed' => '符合条件的 {deletecount} 条分享被删除', + 'share_mod_range_illegal' => '您指定的时间范围超过限制', + 'share_post_nonexistence' => '没有与条件匹配的分享', + 'share_title' => '分享标题', + 'share_body' => '分享内容', + 'share_type' => '分享类型', + 'share_type_thread' => '文章', + 'share_type_space' => '用户空间', + 'share_type_blog' => '日志', + 'share_type_pic' => '图片', + 'share_type_album' => '相册', + 'share_type_article' => '文章', + + 'attach' => '论坛附件管理', + 'attach_attachtableid' => '选择附件分表', + 'attach_attachtableid_n' => '分表', + 'attach_nomatched' => '只搜索记录存在但文件缺失的附件', + 'attach_forum' => '所在版块', + 'attach_sizerange' => '附件尺寸介于', + 'attach_sizerange_comment' => '单位:字节', + 'attach_dlcountrange' => '被下载次数介于', + 'attach_search_perpage' => '每页最多显示数', + 'attach_daysold' => '发表于多少天以前', + 'attach_filename' => '附件文件名包含', + 'attach_keyword' => '描述关键字', + 'attach_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开', + 'attach_author' => '作者', + 'attach_lost' => '丢失', + 'attach_path' => '路径', + 'attach_downloadnums' => '下载次数', + 'attach_thread' => '所在主题', + 'attach_tips' => '
        • 文件名蓝色标示的附件为远程附件,鼠标指向文件名可以查看附件描述;
        • 附件丢失是指:附件属性比如文件名、路径、尺寸以及下载次数等相关数据在数据库中记录完好,但是附件文件已经被删除。
        • ', + 'attach_edit_succeed' => '附件列表成功更新', + 'attach_edit_invalid' => '您没有选择要删除的附件,请返回修改', + + 'moderate_m_forum' => '论坛审核项目', + 'moderate_m_home' => '家园审核项目', + 'moderate_m_portal' => '门户审核项目', + 'moderate' => '审核', + 'moderate_members' => '审核用户', + 'moderate_members_tips' => '
        • 本功能仅在“新用户注册验证”中设置为“人工审核”时或者开启账号保镖时才有效
        • ', + 'moderate_members_email' => '发 Email 通知被审核用户', + 'moderate_members_submit_times' => '提交次数', + 'moderate_members_submit_time' => '上次提交', + 'moderate_members_admin' => '上次审核者', + 'moderate_members_mod_time' => '上次审核时间', + 'moderate_members_prune' => '清理等待验证用户', + 'moderate_members_message' => '理由', + 'moderate_members_info' => '审核信息', + 'moderate_members_remark' => '管理员留言', + 'moderate_members_prune_submitmore' => '提交次数大于', + 'moderate_members_prune_regbefore' => '注册时间于多少天前', + 'moderate_members_prune_modbefore' => '上次审核于多少天前', + 'moderate_members_prune_regip' => '注册 IP 开头 (如 192.168)', + 'moderate_members_bad_reason' => '您的注册理由不符合本站要求,请重新申请', + 'moderate_members_succeed' => '注册审核已批准,欢迎光临!', + 'moderate_members_op_succeed' => '审核操作成功', + 'moderate_refusal_all' => '全选拒绝', + 'moderate_cancel_all' => '取消选择', + 'moderate_export_all' => '全选导出', + 'moderate_export_getall' => '全部导出', + 'moderate_nodata' => '暂无相关数据', + + + 'moderate_threads' => '审核新主题', + 'moderate_threads_none' => '没有等待审核新主题,您可以点击这里进入新回复的审核页面', + + 'moderate_replies' => '审核新回复', + 'moderate_replies_none' => '没有等待审核新回复,您可以点击这里进入新主题的审核页面', + + 'moderate_blogs' => '审核新日志', + 'moderate_pictures' => '审核新图片', + 'moderate_doings' => '审核新记录', + 'moderate_shares' => '审核新分享', + 'moderate_comments' => '审核新留言', + 'moderate_articles' => '审核新文章', + 'moderate_articlecomments' => '审核文章评论', + + 'moderate_all_invalidate' => '全部否决', + 'moderate_all_validate' => '全部通过', + 'moderate_all_delete' => '全部删除', + 'moderate_all_ignore' => '全部忽略', + 'moderate_all_cancel' => '全部取消', + 'moderate_apply_all' => '将操作应用到其他所有页面', + 'moderate_all_fold' => '全部折叠', + 'moderate_all_expand' => '全部展开', + 'moderate_validate_list' => '审核操作成功,共 {validates} 个主题被通过,{ignores} 个主题被忽略,{recycles} 个主题被放入回收站,{deletes} 个主题被删除。
          您可以继续审核新主题', + 'moderate_none' => '未审核', + 'moderate_ignore' => '已忽略', + 'moderate_all_fields' => '所有文章', + 'moderate_all_groups' => '仅圈子', + 'moderate_edit_thread' => '编辑主题', + 'moderate_reasonpm' => '操作理由', + 'moderate_bound' => '审核范围', + 'moderate_dateline' => '发表时间范围', + 'moderate_article_category' => '频道栏目', + 'moderate_content_keyword' => '内容包含', + 'moderate_title_keyword' => '标题包含', + 'moderate_showcensor' => '显示过滤词', + 'moderate_forum' => '审核版块', + 'moderate_edit_post' => '编辑文章', + 'moderate_delthread' => '删除主题', + 'moderate_close' => '关闭主题', + 'moderate_move' => '移动主题', + 'moderate_copy' => '拷贝主题', + 'moderate_highlight' => '高亮显示', + 'moderate_digest' => '设置精华', + 'moderate_stick' => '主题置顶', + 'moderate_merge' => '合并主题', + 'moderate_bump' => '提升主题', + 'moderate_repair' => '修复主题', + 'moderate_t_comment' => '微博评论', + + 'recyclebin' => '回收站', + 'recyclebin_list' => '主题列表', + 'recyclebin_list_thread' => '版块', + 'recyclebin_list_author' => '作者', + 'recyclebin_list_status' => '回复 / 查看', + 'recyclebin_list_operation' => '操作人', + 'recyclebin_list_lastpost' => '最后回复', + 'recyclebin_search' => '搜索符合条件的被删文章', + 'recyclebin_search_forum' => '所在版块', + 'recyclebin_search_author' => '原帖作者', + 'recyclebin_search_author_comment' => '多个用户名间请用半角逗号 "," 隔开', + 'recyclebin_search_keyword' => '标题关键字', + 'recyclebin_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开', + 'recyclebin_search_admin' => '删帖管理员', + 'recyclebin_search_admin_comment' => '多个用户名间请用半角逗号 "," 隔开', + 'recyclebin_search_post_time' => '文章发表时间范围', + 'recyclebin_search_post_time_comment' => '格式 yyyy-mm-dd,不限制请留空', + 'recyclebin_search_mod_time' => '删帖时间范围', + 'recyclebin_search_mod_time_comment' => '格式 yyyy-mm-dd,不限制请留空', + 'recyclebin_result' => '符合条件的回收站主题数', + 'recyclebin_all_delete' => '全部删除', + 'recyclebin_all_undelete' => '全部还原', + 'recyclebin_all_ignore' => '全部忽略', + 'recyclebin_delete_time' => '删除时间', + + 'recyclebin_clean' => '批量清空回收站', + 'recyclebin_clean_days' => '清空多少天以前的回收站文章', + 'recyclebin_clean_days_comment' => '0 为清空全部', + 'recyclebin_delete' => '删除主题', + 'recyclebin_undelete' => '恢复主题', + 'recyclebin_succeed' => '回收站更新成功,共 {threadsdel} 个主题被删除,{threadsundel} 个主题被恢复', + 'recyclebin_nothread' => '没有可清空主题', + + 'recyclebinpost' => '回帖回收站', + 'recyclebinpost_list' => '回帖列表', + 'recyclebinpost_search' => '搜索符合条件的被删回帖', + 'recyclebinpost_search_forum' => '所在版块', + 'recyclebinpost_search_author' => '原帖作者', + 'recyclebinpost_search_author_comment' => '多个用户名间请用半角逗号 "," 隔开', + 'recyclebinpost_search_keyword' => '内容关键字', + 'recyclebinpost_search_keyword_comment' => '多关键字中间请用半角逗号 "," 隔开', + 'recyclebinpost_search_post_time' => '回帖发表时间范围', + 'recyclebinpost_search_post_time_comment' => '格式 yyyy-mm-dd,不限制请留空', + 'recyclebinpost_result' => '符合条件的回收站主题数', + + 'recyclebinpost_clean' => '批量清空回帖回收站', + 'recyclebinpost_clean_days' => '清空多少天以前的回帖回收站文章', + 'recyclebinpost_clean_days_comment' => '0 为清空全部', + 'recyclebinpost_none' => '没有可清空的回帖', + 'recyclebinpost_succeed' => '回帖回收站更新成功,共 {postsdel} 个回帖被删除,{postsundel} 个回帖被恢复', + 'recyclebinpost_clean_next' => '回帖回收站更新,已经删除 {postsdel} 个回帖,程序将自动继续', + + 'isanonymous' => '匿名发布', + 'ishtmlon' => '支持html', + + 'misc' => '其他', + + 'misc_customnav' => '导航设置', + 'misc_customnav_add_menu' => '添加主导航', + 'misc_customnav_add_submenu' => '添加二级导航', + 'misc_customnav_add_ucenter' => '添加 UCenter 应用', + + 'announce' => '站点公告', + 'announce_tips' => '
        • 如果您不是站点管理员,您将只能对自己添加的项目进行编辑或删除。
        • ', + 'announce_edit' => '站点公告编辑', + 'announce_add' => '添加站点公告', + 'announce_type' => '公告类型', + 'announce_words' => '文字公告', + 'announce_url' => '网址链接', + 'announce_time_comment' => '格式: yyyy-mm-dd', + 'announce_end_time_comment' => '留空为不限制', + 'announce_message' => '内容', + 'announce_message_comment' => '文字公告: 直接输入公告内容,支持 Discuz! 代码
          网址链接: 请输入公告的链接地址如某个主题地址: http://xxx.xxx.xxx', + + 'misc_onlinelist' => '在线列表图标', + 'misc_onlinelist_tips' => '
        • 本功能用于自定义首页及主题列表页显示的在线会员分组及图例,只在在线列表功能打开时有效。
        • 用户组图例处空白为不区分该组用户,所有未区分的用户组将统一归入第一行的“普通用户”项。
        • 用户组图例中请填写图片文件名,并将相应图片文件上传到 static/image/common/ 目录中。
        • ', + 'misc_onlinelist_image' => '用户组图例', + + 'misc_link_group1' => '分组1', + 'misc_link_group2' => '分组2', + 'misc_link_group3' => '分组3', + 'misc_link_group4' => '分组4', + 'misc_link' => '友情链接', + 'misc_link_add' => '添加友情链接', + 'misc_link_tips' => '
        • 如果您不想在论坛首页显示友情链接,可以在“界面设置”中关闭。
        • 未填写文字说明的项目将以紧凑型显示。
        • +
        • 友情链接分组只供 DIY 的展示类模块使用。
        • ', + 'misc_link_edit' => '友情链接编辑', + 'misc_link_edit_name' => '站点名称', + 'misc_link_edit_url' => '站点 URL', + 'misc_link_edit_description' => '文字说明(可选)', + 'misc_link_edit_logo' => 'logo 地址(可选)', + 'misc_relatedlink' => '关联链接', + 'misc_relatedlink_status' => 'SEO兼容模式', + 'misc_relatedlink_status_comment' => '注意:开启后对搜索引擎有好处,但会对服务器造成压力', + 'misc_relatedlink_add' => '添加关联链接', + 'misc_relatedlink_tips' => '
        • 在指定范围内出现的相关文字自动加上链接。
        • ', + 'misc_relatedlink_edit' => '关联链接编辑', + 'misc_relatedlink_edit_name' => '链接文字', + 'misc_relatedlink_edit_url' => '链接地址', + 'misc_relatedlink_edit_extent' => '作用范围', + 'misc_relatedlink_extent_article' => '文章', + 'misc_relatedlink_extent_forum' => '论坛主题', + 'misc_relatedlink_extent_group' => '圈子主题', + 'misc_relatedlink_extent_blog' => '日志', + + 'misc_bbcode' => '自定义 Discuz! 代码', + 'misc_bbcode_edit' => '编辑 Discuz! 代码', + 'misc_bbcode_edit_tips' => '
        • 只有在自定义 Discuz! 代码可用并设置了图标文件时,具有“允许使用自定义 Discuz! 代码”权限的用户组在发帖时才会看到相应自定义 Discuz! 代码按钮。
        • ', + 'misc_bbcode_tag' => '标签', + 'misc_bbcode_edit_tag' => '标签', + 'misc_bbcode_edit_tag_comment' => '方括号中的标签代码,如 [tag] 的标签为 "tag"(不含引号)', + 'misc_bbcode_edit_replacement' => '替换内容', + 'misc_bbcode_edit_replacement_comment' => '标签替换为的 HTML 代码内容,支持至多三个动态参数
          {1} 代表第一个参数
          {2} 代表第二个参数
          {3} 代表第三个参数', + 'misc_bbcode_edit_example' => '例子', + 'misc_bbcode_edit_example_comment' => '本代码作用的例子', + 'misc_bbcode_edit_explanation' => '解释', + 'misc_bbcode_edit_explanation_comment' => '本代码功能的解释', + 'misc_bbcode_edit_params' => '参数个数', + 'misc_bbcode_edit_params_comment' => '本代码中使用到的动态参数个数', + 'misc_bbcode_edit_prompt' => '参数提示语', + 'misc_bbcode_edit_prompt_comment' => '点击代码按钮时相应的说明和提示,每行一个,依次代表第一、二、三个参数的解释说明', + 'misc_bbcode_edit_nest' => '嵌套次数', + 'misc_bbcode_edit_nest_comment' => '最大解析的代码嵌套次数(深度),范围从 1~3', + 'misc_bbcode_edit_usergroup' => '允许使用此代码的用户组', + 'misc_bbcode_edit_usergroup_comment' => '设置哪些用户组可以使用此代码,可以按住 CTRL 多选', + 'misc_bbcode_icon_file' => '图标文件 / 描述', + 'misc_bbcode_icon' => '图标', + + 'misc_cron' => '计划任务', + 'misc_cron_list' => '计划任务列表', + 'misc_cron_tips' => '
        • 计划任务是 Discuz! 提供的一项使系统在规定时间自动执行某些特定任务的功能,在需要的情况下,您也可以方便的将其用于站点功能的扩展。
        • 计划任务是与系统核心紧密关联的功能特性,不当的设置可能造成站点功能的隐患,严重时可能导致站点无法正常运行,因此请务必仅在您对计划任务特性十分了解,并明确知道正在做什么、有什么样后果的时候才自行添加或修改任务项目。
        • 此处和其他功能不同,本功能中完全按照站点系统默认时差对时间进行设定和显示,而不会依据某一用户或管理员的时差设定而改变显示或设置的时间值。
        • ', + 'misc_cron_permonth' => '每月', + 'misc_cron_perweek' => '每周', + 'misc_cron_perday' => '每日', + 'misc_cron_perhour' => '每小时', + 'misc_cron_minute' => '分', + 'misc_cron_hour' => '时', + 'misc_cron_day' => '日', + 'misc_cron_week_day_0' => '日', + 'misc_cron_week_day_1' => '一', + 'misc_cron_week_day_2' => '二', + 'misc_cron_week_day_3' => '三', + 'misc_cron_week_day_4' => '四', + 'misc_cron_week_day_5' => '五', + 'misc_cron_week_day_6' => '六', + 'misc_cron_last_run' => '上次执行时间', + 'misc_cron_next_run' => '下次执行时间', + 'misc_cron_run' => '执行', + 'misc_cron_edit' => '编辑计划任务', + 'misc_cron_edit_tips' => '
        • 您正在对系统内置的计划任务进行编辑,除非非常了解 Discuz! 结构,否则强烈建议不要修改默认设置。
        • 请在修改之前记录原有设置,不当的设置将可能导致站点出现不可预期的错误。
        • ', + 'misc_cron_edit_weekday' => '每周', + 'misc_cron_edit_weekday_comment' => '设置星期几执行本任务,“*”为不限制,本设置会覆盖下面的“日”设定', + 'misc_cron_edit_day' => '每月', + 'misc_cron_edit_day_comment' => '设置哪一日执行本任务,“*”为不限制', + 'misc_cron_edit_hour' => '小时', + 'misc_cron_edit_hour_comment' => '设置哪一小时执行本任务,“*”为不限制', + 'misc_cron_edit_minute' => '分钟', + 'misc_cron_edit_minute_comment' => '设置哪些分钟执行本任务,至多可以设置 12 个分钟值,多个值之间用半角逗号 "," 隔开,留空为不限制', + 'misc_cron_edit_filename' => '任务脚本', + 'misc_cron_edit_filename_comment' => '设置本任务的执行程序文件名,请勿包含路径,系统计划任务位于 source/include/cron/ 目录中,插件计划任务位于 source/plugin/插件目录/cron/ 目录中', + + 'misc_censor' => '词语过滤', + 'misc_censor_tips' => '
        • 替换前的内容可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略的字节数。如 "a{1}s{2}s"(不含引号) 可以过滤 "ass" 也可过滤 "axsxs" 和 "axsxxs" 等等。对于中文字符,若使用 GBK、Big-5 版本,每个中文字符相当于 2 个字节;若使用 UTF-8 版本,每个中文字符相当于 3 个字节。
        • 为不影响程序效率,请不要设置过多不需要的过滤内容。
        • 审核只对论坛中的内容有效
        • 如果您不是论坛管理员,您将只能对自己添加的项目进行编辑或删除。
        • 敏感词如果以"/"(不含引号)开头和结尾则表示格式为正则表达式,这时替换内容可用"(n)"引用正则中的子模式,如"/1\d{10}([^\d]+|$)/"替换为"手机(1)"。
        • ', + 'misc_censor_word' => '敏感词', + 'misc_censor_replacement' => '过滤动作', + 'misc_censor_type' => '词语分类', + 'misc_censor_postlimit' => '发帖数限制', + 'misc_censor_wordtype_edit' => '编辑词语分类', + 'misc_censor_wordtype_tips' => '
        • 默认分类为内置分类,当删除一组分类时,词语过滤将会自动编入默认分类中。
        • ', + 'misc_censor_batch_add' => '批量添加', + 'misc_censor_batch_add_tips' => '
        • 每行一组过滤词语,敏感词和替换词之间使用“=”进行分割;
        • 如需禁止发布包含某个词语的文字,而不是替换过滤,请将其对应的替换内容设置为{BANNED}即可;如需当用户发布包含某个词语的文字时,自动标记为需要人工审核,而不直接显示或替换过滤,请将其对应的替换内容设置为{MOD}即可(审核只对论坛中的内容有效)。
        • 如果只是想将某个词语直接替换成 **,则只输入词语即可;
        • 例如:
          toobad
          nobad
          badword=good
          sexword={BANNED}
        • 导出/导入时支持词语分类导入,导入时不带有分类则可以通过选择指定导入分类。没有分类时自动归入默认分类
        • ', + 'misc_censor_batch_add_clear' => '清空当前词表后导入新词语,此操作不可恢复,建议首先 导出词表,做好备份。
          ', + 'misc_censor_batch_add_overwrite' => '使用新的设置覆盖已经存在的词语', + 'misc_censor_batch_add_no_overwrite' => '不导入已经存在的词语', + 'misc_censor_word_banned' => '禁止关键词', + 'misc_censor_word_moderated' => '审核关键词', + 'misc_censor_word_replaced' => '替换关键词', + 'misc_censor_word_default_typename' => '默认分类', + 'misc_censor_wordtype_search' => '不限分类', + 'misc_censor_wordtype_name' => '分类名', + + + 'misc_tag' => '标签', + 'misc_tag_threadnum' => '主题数', + 'misc_tag_status' => '状态', + 'misc_tag_status_0' => '开放', + 'misc_tag_status_1' => '锁定', + 'misc_tag_status_2' => '推荐', + 'misc_tag_count' => '标签总数', + 'misc_tag_hot' => '热门标签', + 'misc_tag_search' => '搜索标签', + 'misc_tag_threadnum_between' => '主题数介于', + 'misc_tag_all_delete' => '全部删除', + 'misc_tag_all_close' => '全部锁定', + 'misc_tag_all_open' => '全部开放', + 'misc_tag_all_recommend' => '全部推荐', + + 'smilies' => '表情管理', + 'smilies_edit' => '表情管理', + 'smilies_type' => '表情分类', + 'smilies_nums' => '表情数量', + 'smilies_update' => '更新', + 'smilies_fast' => '推荐', + 'smilies_update_confirm1' => '此操作将自动搜索 static/image/smiley/ 目录', + 'smilies_update_confirm2' => ' 目录下尚未启用的表情,并自动添加到表情分类“', + 'smilies_update_confirm3' => '”,请确认!', + 'smilies_edit_code' => '表情代码', + 'smilies_edit_filename' => '文件名', + 'smilies_edit_image' => '图片', + 'smilies_edit_icon' => '主题图标编辑', + 'smilies_edit_add_code' => '批量设置表情代码', + 'smilies_edit_order_file' => '文件名', + 'smilies_edit_order_radom' => '自然顺序', + 'smilies_edit_add_tips' => '目录 {smurl} 中没有找到尚未使用的表情图片,表情图片文件名只允许数字、26 个英文字母、下划线、半角空格及 <>-.&[]() 等符号,文件名长度不能超过 30 字节,否则将会无法识别。请通过 FTP 上传需要添加的表情图片到 {smurl} 目录,然后点击“重新搜索”', + 'smilies_edit_addcode_auto' => '自动设置', + 'smilies_no_use' => '尚未使用的图片', + 'smilies_add' => '批量添加表情', + 'smilies_add_search' => '搜索此目录下所有尚未使用的表情图片', + 'smilies_prefix_tips' => '请输入表情前缀及后缀,建议使用 [ ( : 等符号作为前缀,] ) : 等符号作为后缀', + 'smilies_id' => '表情 ID', + 'smilies_prefix' => '前缀', + 'smilies_suffix' => '后缀', + 'smilies_import' => '导入表情', + 'smilies_tips' => '
        • 添加表情请上传表情图片到相应的表情目录中(static/image/smiley/表情目录/)。
        • 表情支持"JPG、GIF、PNG"格式的图片,文件名只允许数字、26 个英文字母、下划线、半角空格及 <>-.&[]() 等符号,文件名长度不能超过 30 字节,否则将会无法识别。
        • 请不要设置过多的表情,以免占用过多的服务器资源。
        • ', + 'smilies_tips_smileytypes' => '
        • 表情导出包含表情分类信息及表情代码信息,表情图片文件请通过 FTP 下载。
        • 请不要同时启用过多的表情分类,并控制好表情分类的名称长度,以免表情窗口无法完全显示所有表情分类。
        • 您可以在界面风格中设置默认显示的表情分类。删除表情分类请先删除该分类下所有表情。
        • ', + 'smiliesupload_tips' => '没有找到尚未使用的表情分类,您可以通过 FTP 在 static/image/smiley/ 目录中创建表情分类目录并上传表情图片,然后刷新本页。表情分类目录名只允许数字、26 个英文字母及下划线', + + 'click' => '表态动作', + 'click_edit' => '表态动作', + 'click_edit_blogid' => '日志动作', + 'click_edit_picid' => '图片动作', + 'click_edit_aid' => '文章动作', + 'click_edit_tips' => '
        • 本功能用于设置日志/图片/文章表态动作,动作图片中请填写图片文件名,并将相应图片文件上传到 static/image/click/ 目录中或直接填写图片 URL 地址。
        • 警告:站点运营一段时间后,中途改变各表情的顺序将会影响之前的表态结果
        • 每个类型最多启用8个动作
        • ', + 'click_edit_addnew' => '添加新动作', + 'click_edit_image' => '动作图片', + 'click_edit_type' => '动作类型', + 'click_edit_succeed' => '表态动作成功更新', + + + 'misc_icon' => '主题图标', + 'misc_icon_tips' => '目录 static/image/forum/icon/ 中没有找到尚未使用的主题图标,请通过 FTP 上传需要添加的主题图标到 static/image/forum/icon/ 目录,然后刷新本页', + 'misc_icon_add' => '添加主题图标', + + 'misc_stamp' => '主题鉴定', + 'misc_stamp_thread' => '图章', + 'misc_stamp_list' => '图标', + 'misc_stamp_type' => '类型', + 'misc_stamp_id' => '图片 ID', + 'misc_stamp_name' => '图章名称', + 'misc_stamp_listname' => '图标名称', + 'misc_stamp_option' => '关联操作', + 'misc_stamp_option_stick' => '置顶', + 'misc_stamp_option_digest' => '精华', + 'misc_stamp_option_recommend' => '推荐', + 'misc_stamp_option_recommendto' => '推送', + 'misc_stamp_tips' => '目录 static/image/stamp/ 中没有找到尚未使用的主题图章,请通过 FTP 上传需要添加的图章到 static/image/stamp/ 目录,然后刷新本页', + 'misc_stamp_listtips' => '
        • 鉴定图章显示在文章内容页,鉴定图标显示在主题列表页。
        • 系统预留了 100 个主题鉴定图片位置,分别为图片 ID 0 至 99。
        • 不要随意修改图片 ID,否则将会导致主题中已使用的图章、图标错乱。
        • 当图章设置了关联操作后,图章会在执行相应操作时被自动添加到主题中;当图章设置了关联图标后,图标会在添加图章时自动添加到主题列表中。关联操作不可与关联图标同时设置。
        • ', + 'misc_stamp_add' => '添加图章', + 'misc_stamp_imagename' => '图章/图标名称', + 'misc_stamp_addtips' => '
        • 可以选择是添加成图章还是图标。
        • 图片名称必需填写,没有名称的图片不会被添加。
        • ', + 'misc_stamp_icon' => '关联图标', + + 'misc_attachtype' => '附件类型管理', + 'misc_attachtype_add' => '添加新附件类型', + 'misc_attachtype_tips' => '
        • 本功能可限定某特定类型附件的最大尺寸,当这里设定的尺寸小于用户组允许的最大尺寸时,指定类型的附件尺寸限制将按本设定为准。
        • 您可以设置某类附件最大尺寸为 0 以整体禁止这类附件被上传。
        • ', + 'misc_attachtype_ext' => '扩展名(小写)', + 'misc_attachtype_maxsize' => '最大尺寸(单位:KB)', + + 'faq' => '站点帮助', + 'faq_thread' => '帮助主题', + 'faq_sortup' => '上级分类', + 'faq_list_update' => '帮助列表更新', + 'faq_detail' => '帮助详情', + 'faq_edit' => '编辑详情', + 'faq_title' => '帮助标题', + 'faq_identifier' => '帮助标识', + 'faq_identifier_comment' => '用于帮助信息的前台模版调用,前台模版中可以用{faq 帮助标识}调用此帮助,此标识唯一。如没有特殊需要请不要修改', + 'faq_keywords' => '帮助关键字', + 'faq_keywords_comment' => '配合帮助标识用于帮助信息的前台的模版调用', + 'faq_content' => '帮助内容', + 'faq_content_comment' => '帮助内容,支持 HTML 代码', + 'faq_additem' => '添加新帮助主题', + 'faq_addcat' => '添加新帮助分类', + + 'plugins' => '插件配置', + 'plugins_home' => '查看说明', + 'plugins_visit' => '评分', + 'plugins_editlink' => '设计', + 'plugins_validator' => '检查更新', + 'plugins_validator_new' => '发现新版({updatecount})', + 'plugins_question' => '插件问题求助', + 'plugins_list' => '插件列表', + 'plugins_system' => '系统插件', + 'plugins_install' => '安装新插件', + 'plugins_newcomment' => '以下为插件目录 source/plugin/ 下未安装的插件', + 'plugins_menu' => '插件', + 'plugins_name' => '插件名称', + 'plugins_unavailable' => '未启用', + 'plugins_empty' => '空', + 'plugins_directory' => '插件目录', + 'plugins_identifier' => '唯一标识符', + 'plugins_vars_title' => '配置名称(必填)', + 'plugins_vars_variable' => '配置变量名(必填)', + 'plugins_vars_type' => '配置类型', + 'plugins_add' => '设计新插件', + 'plugins_add_tips' => '
        • 本功能仅供插件开发者使用。
        • 插件开发人员在使用本功能前请务必仔细阅读《Discuz! 技术文档》中的内容。
        • 警告: 不正确的插件设计或安装可能危及到整个站点的正常使用。
        • ', + 'plugins_import' => '导入插件数据', + 'plugins_import_ignore_version' => '允许导入老版本 Discuz! 的插件(易产生错误!!)', + 'plugins_update_to' => '更新到 ', + 'plugins_config' => '参数设置', + 'plugins_config_module' => '模块', + 'plugins_config_vars' => '变量', + 'plugins_config_install' => '安装', + 'plugins_config_uninstall' => '卸载', + 'plugins_config_upgrade' => '更新', + 'plugins_config_delete' => '卸载', + 'plugins_config_uninstall_tips' => '您确定要把 {pluginname} 插件卸载并不可逆的删除由 {pluginname} 插件产生的所有数据么?', + 'plugins_config_upgrade_other' => '您确定要把 {pluginname} {version} 插件更新到以下版本吗?', + 'plugins_config_uninstallplugin' => '卸载此插件', + 'plugins_edit' => '设计插件', + 'plugins_edit_available' => ' (插件已启用)', + 'plugins_edit_tips' => '
        • 本功能仅供插件开发者使用,如果您只是安装或使用本插件,切勿修改本设置。
        • 插件开发人员在使用本功能前请务必仔细阅读《Discuz! 技术文档》中的内容。
        • 警告: 不正确的插件设计或安装可能危及到整个站点的正常使用。
        • 把设计完的插件发布到“Discuz! 应用中心”分享给广大站长。
        • ', + 'plugins_edit_name' => '插件名称(name)', + 'plugins_edit_name_comment' => '此插件的名称,中英文均可,最多 40 个字节', + 'plugins_edit_version' => '插件版本号(version)', + 'plugins_edit_version_comment' => '此插件的版本,中英文均可,最多 20 个字节。版本号高于旧版本号时,安装给用户时将会提示更新', + 'plugins_edit_copyright' => '版权信息(copyright)', + 'plugins_edit_copyright_comment' => '设置插件的版权信息,最多 100 个字节,一旦设置无法更改', + 'plugins_edit_identifier' => '唯一标识符(identifier)', + 'plugins_edit_identifier_comment' => '插件的唯一英文标识,不能够与现有插件标识重复。可使用字母、数字、下划线命名,不能包含其他符号或特殊字符,需以字母开头,最大 40 个字节', + 'plugins_edit_adminid' => '后台权限等级(adminid)', + 'plugins_edit_adminid_comment' => '使用管理中心中插件接口自带的插件参数设置程序所需的最低权限等级要求。注意: 插件的后台模块拥有自己的权限设置,因此不受此限制', + 'plugins_edit_directory' => '插件目录(directory)', + 'plugins_edit_directory_comment' => '插件程序(包括前台和后台)相对于 source/plugin/ 的相对路径,必须以 "/" 结尾,否则会产生错误。如果不指定本设置,则默认插件的前后台程序均放置于 source/plugin/ 里。 ', + 'plugins_edit_description' => '插件描述(description)', + 'plugins_edit_description_comment' => '插件的简单描述,最多 100 个字节,可选填', + 'plugins_edit_langexists' => '插件语言包', + 'plugins_edit_langexists_comment' => '如果插件存在语言包,请选择“是”', + 'plugins_edit_modules' => '插件模块和导航', + 'plugins_edit_modules_name' => '程序模块(必填)', + 'plugins_edit_modules_param' => '模块参数', + 'plugins_edit_modules_menu' => '链接名称', + 'plugins_edit_modules_menu_url' => '链接 URL', + 'plugins_edit_modules_navtitle' => '导航说明', + 'plugins_edit_modules_navicon' => '导航图标', + 'plugins_edit_modules_navsubname' => '副导航名称', + 'plugins_edit_modules_navsuburl' => '副导航链接', + 'plugins_edit_modules_type' => '模块类型', + 'plugins_edit_modules_type_1' => '主导航项目', + 'plugins_edit_modules_type_2' => '', + 'plugins_edit_modules_type_5' => '主导航项目 - 插件菜单', + 'plugins_edit_modules_type_23' => '底部导航项目', + 'plugins_edit_modules_type_24' => '家园导航项目', + 'plugins_edit_modules_type_25' => '快捷导航项目', + 'plugins_edit_modules_type_30' => '手机发现页导航项目', + 'plugins_edit_modules_type_6' => '', + 'plugins_edit_modules_type_7' => '个人设置', + 'plugins_edit_modules_type_8' => '', + 'plugins_edit_modules_type_9' => '', + 'plugins_edit_modules_type_10' => '', + 'plugins_edit_modules_type_3' => '管理中心', + 'plugins_edit_modules_type_4' => '全局包含', + 'plugins_edit_modules_type_11' => '页面嵌入 - 普通版', + 'plugins_edit_modules_type_12' => '特殊主题', + 'plugins_edit_modules_type_13' => '普通脚本', + 'plugins_edit_modules_type_14' => '站点帮助', + 'plugins_edit_modules_type_15' => '论坛管理 - 基本', + 'plugins_edit_modules_type_16' => '论坛管理 - 工具', + 'plugins_edit_modules_type_17' => '个人设置 - 个人资料', + 'plugins_edit_modules_type_19' => '个人设置 - 积分', + 'plugins_edit_modules_type_18' => '', + 'plugins_edit_modules_type_21' => '门户管理', + 'plugins_edit_modules_type_26' => '我的文章', + 'plugins_edit_modules_type_27' => '顶部导航项目', + 'plugins_edit_modules_type_28' => '页面嵌入 - 手机版', + 'plugins_edit_modules_type_29' => '管理中心 - 列表链接', + 'plugins_edit_modules_type_g1' => '程序链接', + 'plugins_edit_modules_type_g2' => '程序脚本', + 'plugins_edit_modules_type_g3' => '扩展项目', + 'plugins_edit_modules_adminid' => '使用等级', + 'plugins_edit_modules_include' => '包含运行', + 'plugins_edit_vars' => '插件变量配置', + 'plugins_edit_vars_title' => '配置名称', + 'plugins_edit_vars_title_comment' => '中英文均可,用于显示在插件配置的菜单中,最多 100 个字节。此处支持语言定义,例如:lang_admincp.php 定义了 \'myaction\'=>\'我的操作\' ,则此处填写 myaction 即可,这样有利于多语言版本插件的制作', + 'plugins_edit_vars_description' => '配置说明', + 'plugins_edit_vars_description_comment' => '描述此项配置的用途和取值范围,详细的描述有利于插件使用者了解这个设置的作用,最多 255 个字节。此处和配置名称类似,也支持语言定义', + 'plugins_edit_vars_type' => '配置类型', + 'plugins_edit_vars_type_number' => '数字(number)', + 'plugins_edit_vars_type_text' => '字串(text)', + 'plugins_edit_vars_type_textarea' => '文本(textarea)', + 'plugins_edit_vars_type_radio' => '开关(radio)', + 'plugins_edit_vars_type_select' => '单选选择(select)', + 'plugins_edit_vars_type_selects' => '多项选择(selects)', + 'plugins_edit_vars_type_color' => '颜色(color)', + 'plugins_edit_vars_type_date' => '日期(date)', + 'plugins_edit_vars_type_datetime' => '日期/时间(datetime)', + 'plugins_edit_vars_type_forum' => '版块单选(forum)', + 'plugins_edit_vars_type_forums' => '版块多选(forums)', + 'plugins_edit_vars_type_group' => '用户组单选(group)', + 'plugins_edit_vars_type_groups' => '用户组多选(groups)', + 'plugins_edit_vars_type_extcredit' => '扩展积分(extcredit)', + 'plugins_edit_vars_type_forum_text' => '版块/字串(forum_text)', + 'plugins_edit_vars_type_forum_textarea' => '版块/文本(forum_textarea)', + 'plugins_edit_vars_type_forum_radio' => '版块/开关(forum_radio)', + 'plugins_edit_vars_type_forum_select' => '版块/单选选择(forum_select)', + 'plugins_edit_vars_type_group_text' => '用户组/字串(group_text)', + 'plugins_edit_vars_type_group_textarea' => '用户组/文本(group_textarea)', + 'plugins_edit_vars_type_group_radio' => '用户组/开关(group_radio)', + 'plugins_edit_vars_type_group_select' => '用户组/单选选择(group_select)', + 'plugins_edit_vars_multiselect_comment' => '按住 CTRL 多选', + 'plugins_edit_vars_type_comment' => '设置此配置的数据类型,用于程序中检查和过滤相应配置值', + 'plugins_edit_vars_variable' => '配置变量名', + 'plugins_edit_vars_variable_comment' => '设置配置项目的变量名,用于插件程序中调用,可包含英文、数字和下划线,在同一个插件中需要保持变量名的唯一性,最多 40 个字节', + 'plugins_edit_vars_extra' => '扩充设置', + 'plugins_edit_vars_extra_comment' => '只在配置类型为“选择(select)”时有效,用于设定选项值。等号前面为选项索引(建议用数字),后面为内容,例如:
          1 = 光电鼠标
          2 = 机械鼠标
          3 = 没有鼠标

          注意: 选项确定后请勿修改索引和内容的对应关系,但仍可以新增选项。如需调换显示顺序,可以通过移动整行的上下位置来实现', + 'plugins_import_default' => '默认', + 'plugins_import_installtype_1' => '插件', + 'plugins_import_installtype_2' => '提供了以下', + 'plugins_import_installtype_3' => '种安装方式,请选择', + 'plugins_import_license' => '授权协议', + 'plugins_import_agree' => '我同意', + 'plugins_import_pass' => '我不同意', + 'plugins_conflict_view' => '查看细节', + 'plugins_conflict_info' => '联系作者', + 'plugins_module_sample' => '[↓]', + 'plugins_find_newversion' => '发现新版', + 'plugins_online_update' => '点击在线安装新版', + 'plugins_list_available' => '已启用的插件', + 'plugins_list_unavailable' => '未启用的插件', + 'plugins_list_new' => '未安装的插件', + + 'medals' => '勋章', + 'medals_tips' => '
        • 本功能用于设置可以颁发给用户的勋章信息,勋章图片中请填写图片文件名,并将相应图片文件上传到 static/image/common/ 目录中或直接填写图片 URL 地址。
        • ', + 'medals_edit' => '编辑勋章', + 'medals_list' => '勋章列表', + 'medals_mod' => '勋章审核', + 'medals_log' => '勋章记录', + 'medals_setting' => '勋章设置', + 'medals_image' => '勋章图片', + 'medals_grant' => '颁发', + 'medals_grant_notify' => '发送勋章颁发通知', + 'medals_register' => '用户申请', + 'medals_apply_auto' => '用户申请自动颁发', + 'medals_adminadd' => '手动发放', + 'modals_moderate' => '人工审核', + 'medals_buy' => '用户购买', + 'medals_apply_noauto' => '用户申请不自动颁发', + 'medals_addnew' => '添加新勋章', + 'medals_forever' => '永久有效', + 'medals_pass' => '通过?', + 'medals_user' => '申请人', + 'medals_name' => '勋章名称', + 'medals_name1' => '勋章名称', + 'medals_img' => '勋章图片', + 'medals_type' => '领取方式', + 'medals_type1' => '领取方式', + 'medals_date' => '申请日期', + 'medals_usergroups_allow' => '用户组限制', + 'medals_usergroups_allow_comment' => '设置是否启用用户组限制', + 'medals_usergroups' => '用户组限制', + 'medals_usergroups_comment' => '设置哪些用户组可以领取此勋章,可以按住 CTRL 多选', + 'medals_expr' => '勋章有效期', + 'medals_expr1' => '勋章有效期', + 'medals_expr1_comment' => '设置勋章有效时间,单位为天,0为永久有效', + 'medals_memo' => '勋章描述', + 'medals_perm' => '勋章领取权限', + 'medals_modpass' => '通过', + 'medals_modnopass' => '否决', + 'medals_permformula' => '当您设定了权限表达式后,只有符合此表达式的会员才可以领取本勋章,如勋章可购买本功能失效。如 "posts > 100 and extcredits1 > 10" 表示 "发帖数 > 100 并且 威望 > 10"
          日期格式 "{Y-M-D}",如 "{2009-10-1}"。IP 格式 "{x.x.x.x}",既可输入完整地址,也可只输入 IP 开头,如 "{10.0.0.1}"、"{192.168.0}"', + 'medals_credit' => '积分', + 'medals_price' => '价格', + + 'smsgw' => '短信服务', + 'smsgw_admin' => '短信服务', + 'smsgw_admin_setting' => '设置', + 'smsgw_admin_list' => '列表', + + 'smsgw_edit' => '编辑', + 'smsgw_edit_name' => '接口名称', + 'smsgw_edit_order' => '接口顺序', + 'smsgw_edit_sendrule' => '支持的国际电话区号', + + 'smsgw_type_message' => '文字类网关', + 'smsgw_type_template' => '模板类网关', + + 'smsgw_setting_smsstatus' => '短信功能开关', + 'smsgw_setting_smsdefaultcc' => '默认国际电话区号', + 'smsgw_setting_smsdefaultlength' => '默认短信验证码长度', + 'smsgw_setting_smstimelimit' => '风控限制时间区间', + 'smsgw_setting_smsnumlimit' => '单用户/单号码短信限制时间区间内总量', + 'smsgw_setting_smsinterval' => '单用户/单号码短信时间间隔', + 'smsgw_setting_smsmillimit' => '万号段短信限制时间区间内总量', + 'smsgw_setting_smsglblimit' => '全局短信限制时间区间内总量', + 'smsgw_setting_smsstatus_comment' => '是否打开短信功能', + 'smsgw_setting_smsdefaultcc_comment' => '默认为 86 (中国大陆)', + 'smsgw_setting_smstimelimit_comment' => '默认为 86400 秒', + 'smsgw_setting_smsnumlimit_comment' => '默认为 5 条', + 'smsgw_setting_smsinterval_comment' => '默认为 300 秒', + 'smsgw_setting_smsmillimit_comment' => '默认为 20 条', + 'smsgw_setting_smsglblimit_comment' => '默认为 1000 条', + + 'card' => '充值卡密', + 'card_make_tips' => '
        • 生成卡密时,简单的规则或较小的生成张数可能导致实际生成张数小于预设生成张数。
        • ', + 'card_config_open' => '允许前台充值', + 'card_config_open_comment' => '设置是否允许前台充值,关闭前台充值功能,不影响后台卡密的生成
          充值卡密验证码开关:全局->安全->验证设置', + 'card_number' =>'卡密', + 'card_number_unit' => '位', + 'card_make_rule' => '卡密生成规则', + 'card_make_rule_comment' => '"@"代表任意随机英文字符,"#"代表任意随机数字,"*"代表任意英文或数字
          卡密规则样本:"DZ2011@@@@@#####*****"
          注意:规则位数过小会造成卡密生成重复概率增大,过多的重复卡密会造成卡密生成终止
          卡密规则中不能带有中文及其他特殊符号
          为了避免卡密重复,随机位数最好不要少于8位', + 'card_make_price' => '实际面值', + 'card_make_price_unit' => '元', + 'card_make_price_comment' => '单位(元),实际面值常用在卡片印刷,用作告知用户面值以衡量卡密价值', + 'card_make_extcredits' => '积分数额及类型', + 'card_make_extcredits_comment' => '设置本次生成充值卡密可充得的积分数额与类型', + 'card_make_num' => '生成张数', + 'card_make_num_comment' => '设置本次生成的卡密张数', + 'card_make_cleardateline' => '有效期至', + 'card_make_cleardateline_none' => ' -- (不过期)', + 'card_make_cleardateline_comment' => '默认有效期为一年
          卡密会在设定时间的24:00失效,状态变更为“已过期”', + 'card_make_description' => '备注', + 'card_make_description_comment' => '为本次生成的卡密添加备注说明,备注将显示在“生成记录”中', + 'card_log_operation' => '动作', + 'card_log_operation_add' => '生成', + 'card_log_operation_task' => '任务生成', + 'card_log_operation_del' => '删除', + 'card_log_operation_cron' => '状态变更为"已过期"', + 'card_log_rule' => '卡密规则', + 'card_log_user' => '操作者', + 'card_log_used_user' => '使用者', + 'card_log_maker' => '生成者', + 'card_log_price' => '面值', + 'card_log_add_info' => '生成详细', + 'card_log_del_info' => '删除详细', + 'card_log_cron_info' => '清除详细', + 'card_log_description' => '操作备注', + 'card_log_extcredits' => '积分', + 'card_log_make_num' => '生成数量', + 'card_log_num' => '操作数量', + 'succeed_num' => '成功数', + 'fail_num' => '失败数', + 'card_manage_tips' => '
        • 导出充值卡密最多支持 10000 条数据,导出的文件可用 EXCEL、WPS表格、腾讯文档等工具打开。
        • ', + 'card_manage_title' => '充值卡密列表', + 'card_status' => '状态', + 'card_manage_status_1' => '未使用', + 'card_manage_status_2' => '已使用', + 'card_manage_status_9' => '已过期', + 'card_manage_maketype_0' => '后台批量生成', + 'card_manage_maketype_1' => '任务生成', + 'between' => '介于', + 'card_search_perpage' => '每页显示数', + 'card_used_dateline' => '充值时间', + 'card_extcredits' => '积分类型', + 'card_extcreditsval' => '积分数额', + 'card_export' => '导出充值卡密', + 'card_export_title' => '导出当前筛选出的所有卡密', + 'card_maketype' => '生成方式', + 'card_maketime' => '生成时间', + 'card_type' => '卡密分类', + 'card_type_tips' => '
        • 卡密分类删除时,其下所有卡片将自动纳入“默认分类”
        • ', + 'card_type_none' => '暂无分类', + 'card_type_default' => '默认分类', + + + + 'magics' => '道具中心', + 'magics_tips' => '
        • 系统道具位于 source/class/magic/ 目录中,插件道具位于 source/plugin/插件目录/magic/ 目录中
        • 插件开发人员在设计新的道具前请务必仔细阅读《Discuz! 技术文档》中的内容。
        • ', + + 'magics_config' => '道具基本设置', + 'magics_config_open' => '是否打开道具中心', + 'magics_config_open_comment' => '是否开启道具中心功能', + 'magics_config_discount' => '道具回收价格折扣', + 'magics_config_discount_comment' => '设置道具系统回收价格折扣,此值为百分比,例如如果此值为 85,则系统将以道具原价 85% 的价格回收,建议不超过 100,有效防止刷积分。留空或者 0 表示不开启道具回收功能', + + 'magics_market'=> '道具市场', + 'magics_market_seller'=> '出售者', + + 'magics_identifier' => '标识', + 'magic_recommend' => '推荐', + 'magic_suppytype_1' => '天', + 'magic_suppytype_2' => '周', + 'magic_suppytype_3' => '月', + 'magic_unit' => '张', + 'magics_num' => '存货量/上限/周期', + 'magics_add' => '添加新道具', + 'magics_edit' => '编辑道具', + 'magics_list' => '道具列表', + 'magics_edit_tips' => '
        • 道具唯一标识长度限制为3字节,超过此长度系统会自动截断
        • 道具唯一标识添加后,如果没有特殊需要请勿修改
        • ', + 'magics_edit_name' => '道具名称', + 'magics_edit_type' => '道具分类', + 'magics_edit_credit' => '道具使用积分', + 'magics_edit_price' => '道具价格', + 'magics_edit_num' => '道具存货量', + 'magics_edit_num_comment' => '现有道具的存货量', + 'magics_edit_weight' => '道具重量', + 'magics_edit_identifier' => '道具标识', + 'magics_edit_supplytype' => '补货周期', + 'magics_edit_supplytype_comment' => '设置道具补货的上限', + 'magics_edit_supplynum' => '道具存货量上限', + 'magics_edit_supplynum_comment' => '设置道具补货的上限,每周期将道具补货至该上限', + 'magics_edit_useperoid' => '使用周期', + 'magics_edit_useperoid_comment' => '设定用户使用此道具的使用周期', + 'magics_edit_useperoid_none' => '总是可以', + 'magics_edit_useperoid_day' => '间隔一天', + 'magics_edit_useperoid_24hr' => '间隔 24 小时', + 'magics_edit_useperoid_week' => '间隔一周', + 'magics_edit_useperoid_month' => '间隔一个月', + 'magics_edit_usenum' => '使用数目', + 'magics_edit_usenum_comment' => '设定用户在使用周期内最多能使用此道具的个数', + 'magics_edit_filename' => '道具脚本', + 'magics_edit_filename_comment' => '设置本道具的执行程序文件名,请勿包含路径,程序脚本统一存放于 source/include/magic/ 目录中', + 'magics_edit_description' => '道具描述', + 'magics_edit_perm' => '道具权限', + 'magics_edit_usergroupperm' => '允许使用的用户组', + 'magics_edit_targetgroupperm' => '允许被使用的用户组全选', + 'magics_edit_forumperm' => '允许使用的版块全选', + 'magics_goods_stack_none' => '不自动补货', + 'magics_goods_stack_day' => '每天自动补货', + 'magics_goods_stack_week' => '每周自动补货', + 'magics_goods_stack_month' => '每月自动补货', + 'magics_type' => '道具类型', + 'magics_grant_notify' => '发送赠送道具通知', + + 'tasks' => '站点任务', + 'tasks_on' => '是否开启站点任务', + 'tasks_online' => '上线', + 'tasks_offline' => '下线', + 'tasks_reward' => '奖励', + 'tasks_reward_invite' => '邀请码', + 'tasks_reward_magic' => '道具', + 'tasks_script' => '任务脚本', + 'tasks_version' => '任务版本', + 'tasks_install' => '安装', + 'tasks_upgrade' => '升级', + 'tasks_uninstall' => '卸载', + 'tasks_status' => '状态', + 'tasks_status_0' => '未启用', + 'tasks_status_1' => '未上线', + 'tasks_status_2' => '进行中', + 'tasks_status_3' => '已结束', + + 'tasks_tips' => '
        • 只有标记为“可用”状态的任务,会员才能访问并申请。
        • ', + 'tasks_tips_edit' => '
        • 只有任务标示为“可用”状态,会员才可能看到并参与他。
        • 任务是可以设置开始时间的,您可以预定某个任务何时开始。如果没有设置,那么这个任务默认就是开始了。
        • ', + 'tasks_tips_add_member' => '
        • 会员类任务目前包括三种:添加好友、收藏主题、使用道具,此类任务用来鼓励和引导会员使用论坛的某个功能,活跃论坛的氛围。
        • 设置不同的完成任务条件,可以创造出适合您论坛的任务。
        • ', + 'tasks_tips_add_post' => '
        • 文章类任务目前包括三种:发新主题、发新回复、发新主题/回复。
        • 文章类任务如果指定了版块,那么请您注意用户组及版块的权限设置,否则有的用户申请了任务,可能由于无权在该版块发帖,而永远无法完成任务。
        • 发新回复的任务您可以指定回复某个主题或者某个作者的主题,但请注意该主题必须存在,否则用户无法完成任务。
        • ', + 'tasks_tips_add_type' => '
        • 系统任务位于 source/class/task/ 目录中,插件任务位于 source/plugin/插件目录/task/ 目录中。
        • 插件开发人员在设计新的任务类型前请务必仔细阅读《Discuz! 技术文档》中的内容。
        • ', + 'tasks_edit' => '编辑任务', + 'tasks_list' => '任务列表', + 'tasks_edit_basic' => '编辑任务设置', + 'tasks_add' => '添加任务', + 'tasks_add_basic' => '任务基本设置', + 'tasks_add_name' => '任务名称', + 'tasks_add_name_comment' => '不超过 50 字节', + 'tasks_add_desc' => '任务描述', + 'tasks_add_desc_comment' => '任务的详细说明,支持 HTML 代码', + 'tasks_add_icon' => '任务图标', + 'tasks_add_icon_comment' => '请将图标文件上传到 static/image/task/ 目录,这里填写文件名即可,留空则使用默认图标,建议图标文件尺寸为 64 x 64', + 'tasks_add_starttime' => '上线时间', + 'tasks_add_starttime_comment' => '任务开始时间,留空表示任务立即开始', + 'tasks_add_endtime' => '下线时间', + 'tasks_add_endtime_comment' => '任务结束时间,结束后会员将无法申请此任务,留空表示不限制', + 'tasks_add_periodtype' => '任务间隔周期单位', + 'tasks_add_periodtype_comment' => '设置任务间隔周期的计算单位
          + 小时:表示指定小时后可再次申请,间隔周期填写间隔的小时数
          + 天:表示指定天后可再次申请,间隔周期填写间隔的天数
          + 周:表示在每周指定时间(周一到周日)后才可再次申请,间隔周期填写数字 1 (周一) 到 7 (周日)
          + 月:表示在每月指定日期后才可再次申请,间隔周期填写数字 1 到 29、30、31
          ', + 'tasks_add_periodtype_hour' => '小时', + 'tasks_add_periodtype_day' => '天', + 'tasks_add_periodtype_week' => '周', + 'tasks_add_periodtype_month' => '月', + 'tasks_add_period' => '任务间隔周期', + 'tasks_add_period_comment' => '留空表示一次性任务,否则为周期性任务', + 'tasks_add_reward' => '任务奖励', + 'tasks_add_reward_comment' => '奖励的类型有:积分、道具、勋章及自定义用户组,其中,道具和勋章需要开启相应功能', + + 'tasks_add_extcredit' => '积分种类', + 'tasks_add_credits' => '积分数量', + 'tasks_add_magicname' => '道具种类', + 'tasks_add_magicnum' => '道具数量', + 'tasks_add_medalname' => '勋章种类', + 'tasks_add_medalexp' => '勋章有效期(天)', + 'tasks_add_invitenum' => '邀请码数量', + 'tasks_add_inviteexp' => '邀请码有效期(天)', + 'tasks_add_group' => '自定义用户组', + 'tasks_add_groupexp' => '用户组有效期(天)', + 'tasks_add_appyperm' => '申请任务条件', + 'tasks_add_groupperm' => '用户组限制', + 'tasks_add_groupperm_comment' => '设置哪些用户组的会员允许申请此任务', + 'tasks_add_usergroup' => '选择指定用户组', + 'tasks_add_usergroup_comment' => '您可以选择某一个或多个用户组,可以按住 CTRL 多选', + 'tasks_add_group_all' => '所有会员', + 'tasks_add_group_member' => '普通会员', + 'tasks_add_group_admin' => '管理人员', + 'tasks_add_group_special' => '指定用户组', + 'tasks_add_relatedtask' => '必须完成指定任务', + 'tasks_add_relatedtask_comment' => '申请此任务是否需要先完成其他任务,利用此设置,可设计一个系列任务,通常为不限制', + 'tasks_add_exclusivetask' => '必须未领取指定任务', + 'tasks_add_exclusivetask_comment' => '配置的任务被领取且未放弃时不允许申请或完成本任务,利用此设置,可设计一个系列任务,通常为不限制', + 'tasks_add_conditions' => '完成任务条件', + 'tasks_add_maxnum' => '申请人次上限', + 'tasks_add_maxnum_comment' => '当完成此任务的人次达到这个数值时,系统将自动拒绝新的申请,0 或留空为不限制', + 'tasks_add_limit_act' => '动作', + 'tasks_add_limit_num' => '执行动作次数下限', + 'tasks_add_limit_num_comment' => '会员需要执行相应动作的最少次数', + 'tasks_add_limit_time' => '时间限制(小时)', + 'tasks_add_limit_time_comment' => '设置会员从申请任务到完成任务的时间限制,会员在此时间内未能完成任务则不能领取奖励并标记任务失败,0 或留空为不限制', + 'tasks_add_limit_forumid' => '版块限制', + 'tasks_add_limit_forumid_comment' => '设置会员只能在某个版块完成任务', + 'tasks_add_limit_threadid' => '回复指定主题', + 'tasks_add_limit_threadid_comment' => '设置会员只有回复该主题才能完成任务,请填写主题的 tid(比如一个主题的地址是 http://localhost/forum.php?mod=viewthread&tid=8 那么该主题的 tid 就是 8)', + 'tasks_add_limit_authorid' => '回复指定作者', + 'tasks_add_limit_authorid_comment' => '设置会员只有回复该作者发表的主题才能完成任务,请填写作者的用户名', + 'tasks_add_act_buddy' => '添加好友', + 'tasks_add_act_favorite' => '收藏主题', + 'tasks_add_act_magic' => '使用道具', + 'tasks_add_act_newthread' => '发新主题', + 'tasks_add_act_newreply' => '发新回复', + 'tasks_add_act_newpost' => '发新主题/回复', + 'tasks_add_setting' => '其他设置', + + 'ec' => '电子商务', + + 'ec_alipay' => '支付宝设置', + 'ec_alipay_on' => '是否启用支付宝', + 'ec_alipay_tips' => '
        • “支付宝”(http://www.alipay.com)是中国领先的网上支付平台,由全球最佳 B2B 公司阿里巴巴公司创建,为 Discuz! 用户提供积分购买及论坛 B2C、C2C 交易平台。您只需进行简单的设置,即可使论坛内容和人气,真成为除广告收入外的重要利润来源,从而实现论坛的规模化经营。
        • 由于涉及现金交易,为避免因操作不当而造成的资金损失,请在开始使用支付宝积分交易功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关设置。
        • 您使用支付宝服务是建立在完全自愿的基础上,除 Discuz! 因主观恶意的因素造成的资金损失以外,腾讯云不对因使用此功能造成的任何损失承担责任。
        • 支付宝客户服务电话为 95188。
        • ', + 'ec_alipay_account' => '收款支付宝账号', + 'ec_alipay_account_comment' => '如果开启兑换或交易功能,请填写真实有效的支付宝账号,用于收取用户以现金兑换交易积分的相关款项。如账号无效或安全码有误,将导致用户支付后无法正确对其积分账户自动充值,或进行正常的交易对其积分账户自动充值,或进行正常的交易。
          如您没有支付宝账号,请点击这里注册', + 'ec_alipay_check_comment' => '本测试将模拟提交 0.01 元人民币的订单进行测试,如果提交后成功出现付款界面,说明您站点的支付宝功能可以正常使用', + 'ec_alipay_check_virtualgoodssubject' => '测试虚拟商品', + 'ec_alipay_check_goodssubject' => '测试实物商品', + 'ec_alipay_checklink_credit' => '积分充值订单测试', + 'ec_alipay_checklink_virtualgoods' => '虚拟商品订单测试', + 'ec_alipay_checklink_goods' => '实物商品订单测试', + 'ec_contract' => '支付宝签约用户设置', + 'ec_alipay_contract' => '使用支付宝签约接口', + 'ec_alipay_contract_comment' => '如果您的支付宝账号是签约用户,可以选择“是”让论坛使用您自己的商家服务平台。如果您还未签约,请点击这里签约', + 'ec_alipay_securitycode' => '交易安全校验码 (key)', + 'ec_alipay_securitycode_comment' => '支付宝签约用户可以在此处填写支付宝分配给您的交易安全校验码,此校验码您可以到支付宝官方的商家服务功能处查看', + 'ec_alipay_partner' => '合作者身份 (PID)', + 'ec_alipay_partner_comment' => '支付宝签约用户请在此处填写支付宝分配给您的合作者身份,签约用户的手续费按照您与支付宝官方的签约协议为准。
          如果您还未签约,请点击这里签约;如果已签约,请点击这里获取PID、Key;如果在签约时出现合同模板冲突,请咨询0571-88158090', + 'ec_alipay_creditdirectpay' => '使用纯即时到账接口', + 'ec_alipay_creditdirectpay_comment' => '如果您的签约协议中包含纯即时到账接口(不是标准双接口)可以选择此项,让积分充值只能使用即时到账方式付款', + 'ec_alipay_sign_mode' => '加签模式', + 'ec_alipay_sign_mode_01' => '普通公钥模式加签', + 'ec_alipay_sign_mode_02' => '公钥证书模式加签', + 'ec_alipay_sign_mode_comment' => '支付宝开放平台:查看; 企业开发者若涉及 资金类支出接口 接入,必须使用 公钥证书模式加签 方式; 个人开发者不涉及到资金类接口,建议使用 普通公钥模式加签 进行加签; 接口加签配置接口加签方式', + 'ec_alipay_appid' => '(必须)应用ID', + 'ec_alipay_appid_comment' => '支付宝分配给开发者的应用ID,查看我的应用列表', + 'ec_alipay_app_private_key' => '(必须)RSA2(SHA256)开发者私钥', + 'ec_alipay_app_private_key_comment' => '普通公钥模式获取详情请参见 获取普通公钥', + 'ec_alipay_app_private_key_b_comment' => '公钥证书模式获取详情请参见 获取公钥证书', + 'ec_alipay_public_key' => '(必须)RSA2(SHA256)支付宝公钥', + 'ec_alipay_public_key_comment' => '普通公钥模式获取详情请参见 获取普通公钥', + 'ec_alipay_app_cert' => '(必须)RSA2(SHA256)应用公钥证书', + 'ec_alipay_app_cert_comment' => '公钥证书模式获取详情请参见 获取公钥证书;appCertPublicKey_*.crt,使用记事本打开此文件,全选复制内容到此处', + 'ec_alipay_alipay_cert' => '(必须)RSA2(SHA256)支付宝公钥证书', + 'ec_alipay_alipay_cert_comment' => '公钥证书模式获取详情请参见 获取公钥证书;alipayCertPublicKey_RSA2.crt,使用记事本打开此文件,全选复制内容到此处', + 'ec_alipay_alipay_root_cert' => '(必须)RSA2(SHA256)支付宝根证书', + 'ec_alipay_alipay_root_cert_comment' => '公钥证书模式获取详情请参见 获取公钥证书;alipayRootCert.crt,使用记事本打开此文件,全选复制内容到此处', + 'ec_alipay_check' => '支付测试', + + 'ec_wechat' => '微信支付设置', + 'ec_wechat_tips' => '
        • 微信支付(https://pay.weixin.qq.com)是腾讯集团旗下中国领先的第三方支付平台,一直致力于为用户和企业提供安全、便捷、专业的在线支付服务。以“微信支付,不止支付”为核心理念,为个人用户创造了多种便民服务和应用场景,为各类企业以及小微商户提供专业的收款能力,运营能力,资金结算解决方案,以及安全保障。企业、商品、门店、用户已经通过微信连在了一起,让智慧生活,变成了现实。
        • 由于涉及现金交易,为避免因操作不当而造成的资金损失,请在开始使用微信支付积分交易功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关设置。
        • 您使用微信支付服务是建立在完全自愿的基础上,除 Discuz! 因主观恶意的因素造成的资金损失以外,腾讯云不对因使用此功能造成的任何损失承担责任。
        • 微信支付客户服务电话为 95017。
        • ', + 'ec_wechat_on' => '是否启用微信支付', + 'ec_wechat_version' => 'API版本', + 'ec_wechat_version_comment' => 'APIV3要求PHP版本 >= 7.2', + 'ec_wechat_version_2' => 'API', + 'ec_wechat_version_3' => 'APIV3', + 'ec_wechat_appid' => '(必须)公众号APPID', + 'ec_wechat_appid_comment' => '微信公众号必须有开通微信商户平台', + 'ec_wechat_appsecret' => '(必须)公众号APPSECRET', + 'ec_wechat_mch_id' => '(必须)商户号', + 'ec_wechat_mch_id_comment' => '微信支付分配的商户号', + 'ec_wechat_v1_key' => '(必须)API密钥', + 'ec_wechat_v1_key_comment' => '微信商户平台-->账户设置-->API安全-->密钥设置 - API密钥', + 'ec_wechat_v1_cert' => '(可选)支付证书路径', + 'ec_wechat_v1_cert_comment' => 'cert.p12证书的位置;建议修改文件名称,避免被直接访问;退款时用到,如果不办理退款业务,可以不填。必须在网站目录中,如:source/data/{randomstr}.p12', + 'ec_wechat_v3_private_key' => '(必须)API证书私钥', + 'ec_wechat_v3_private_key_comment' => '商户申请/更换商户API证书(微信商户平台-->账户设置-->API安全-->API证书)时,会生成API证书私钥,并保存在本地证书文件夹的文件apiclient_key.pem 中。', + 'ec_wechat_v3_serial_no' => '(必须)API证书序列号', + 'ec_wechat_v3_serial_no_comment' => '在微信商户平台 - 账户中心 - API安全 - API证书 - 查看证书 - 证书序列号', + 'ec_wechat_v3_key' => '(必须)APIV3密钥', + 'ec_wechat_v3_key_comment' => '微信商户平台-->账户设置-->API安全-->密钥设置 - APIv3密钥', + 'ec_wechat_check' => '支付测试', + 'ec_wechat_checklink_credit' => '积分充值订单测试', + 'ec_wechat_php_version_low' => 'PHP版本过低', + + 'ec_qpay' => 'QQ 钱包设置', + 'ec_qpay_tips' => '
        • QQ 钱包是腾讯集团财付通旗下的第三方支付平台,一直致力于为用户和企业提供安全、便捷、专业的在线支付服务。
        • 由于涉及现金交易,为避免因操作不当而造成的资金损失,请在开始使用 QQ 钱包支付积分交易功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关设置。
        • 您可以设置允许用户通过现金在线支付的方式,为其交易积分账户充值,用于购买文章内容、购买用户组权限、积分转账或用户组升级等功能。请务必正确设置您的收款信息,否则将造成用户付款后积分无法实时到账,造成大量需要人工处理的订单信息。
        • 您使用 QQ 钱包服务是建立在完全自愿的基础上,除 Discuz! 因主观恶意的因素造成的资金损失以外,腾讯云不对因使用此功能造成的任何损失承担责任。
        • 财付通服务热线:0755-83762288-2 (全天 24 小时服务热线) , QQ 钱包客户服务邮箱为 qpay@tencent.com 。
        • ', + 'ec_qpay_on' => '是否启用 QQ 钱包支付', + 'ec_qpay_jsapi' => '是否启用 QQ 钱包 JSAPI 支付', + 'ec_qpay_jsapi_comment' => '需要添加经过腾讯审核通过的添加支付授权域名, 如无此权限或打开后无法支付请关闭', + 'ec_qpay_appid' => '(可选)应用 ID', + 'ec_qpay_appid_comment' => '腾讯开放平台或 QQ 互联平台审核通过的应用 AppID', + 'ec_qpay_mch_id' => '(必须)商户号', + 'ec_qpay_mch_id_comment' => 'QQ 钱包分配的商户号', + 'ec_qpay_op_user_id' => '(可选)操作员 ID', + 'ec_qpay_op_user_id_comment' => '退款时用到的操作员账号, 默认为商户号', + 'ec_qpay_op_user_passwd' => '(可选)操作员密码', + 'ec_qpay_op_user_passwd_comment' => '退款时用到的操作员密码, 系统内使用 md5 编码保存', + 'ec_qpay_v1_key' => '(必须)API密钥', + 'ec_qpay_v1_key_comment' => 'QQ 钱包商户平台 --> 账户管理 --> API 安全', + 'ec_qpay_v1_cert' => '(可选)支付证书路径', + 'ec_qpay_v1_cert_comment' => 'cert.p12 证书的位置;建议修改文件名称,避免被直接访问;退款时用到,如果不办理退款业务,可以不填。必须在网站目录中,如:source/data/{randomstr}.p12', + 'ec_qpay_check' => '支付测试', + 'ec_qpay_checklink_credit' => '积分充值订单测试', + + 'ec_orders' => '积分充值订单', + 'ec_orders_tips' => '
        • 请在开始使用支付宝积分交易订单管理功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关操作。
        • 如果您的用户反映在线支付后无法自动为其积分账户充值,可能是由于您的支付宝账户的通知接口设置有误,或您的网站无法被支付宝通知系统正常访问所致。您可以登录支付宝交易管理界面,通过比对交易详情人工确认相关订单。
        • 订单信息保留 60 天,因此您只能查询和管理 60 天之内的订单信息,超过 60 天的信息将被自动删除。
        • ', + 'ec_orders_search' => '积分充值订单搜索', + 'ec_inviteorders_search' => '邀请码订单搜索', + 'ec_inviteorders_status' => '订单状态', + 'ec_orders_search_email' => '购买者邮箱', + 'ec_orders_search_status' => '订单状态', + 'ec_orders_search_status_all' => '全部状态', + 'ec_orders_search_status_pending' => '等待付款', + 'ec_orders_search_status_auto_finished' => '成功在线支付', + 'ec_orders_search_status_manual_finished' => '成功人工补单', + 'ec_orders_search_id' => '订单号', + 'ec_orders_search_users' => '付款用户名(多个用户名间请用半角逗号 "," 隔开)', + 'ec_orders_search_buyer' => '付款用户的支付宝账号', + 'ec_orders_search_admin' => '人工补单管理员', + 'ec_orders_search_submit_date' => '订单提交时间范围(yyyy-mm-dd)', + 'ec_orders_search_confirm_date' => '订单确认时间范围(格式 yyyy-mm-dd)', + 'ec_orders_validate' => '人工补单', + 'ec_orders_id' => '订单号 / 交易号', + 'ec_orders_status' => '订单状态
          (补单管理员)', + 'ec_orders_username' => '付款用户名', + 'ec_orders_buyer' => '付款人', + 'ec_inviteorders_buyer' => '付款人 / IP', + 'ec_orders_amount' => '收入积分', + 'ec_orders_price' => '支出人民币', + 'ec_orders_submitdate' => '提交时间', + 'ec_orders_confirmdate' => '确认时间', + + 'ec_paymentorders_date' => '提交时间', + 'ec_paymentorders_search' => '支付订单搜索', + 'ec_paymentorders_channel' => '支付渠道', + 'ec_paymentorders_channel_alipay' => '支付宝', + 'ec_paymentorders_channel_wechat' => '微信支付', + 'ec_paymentorders_status' => '订单状态', + 'ec_paymentorders_user' => '付款用户', + 'ec_paymentorders_buyer' => '付款用户 / IP', + 'ec_paymentorders_no' => '订单号', + 'ec_paymentorders_type' => '订单类型', + 'ec_paymentorders_amount' => '交易金额(元)', + 'ec_paymentorders_desc' => '订单描述', + 'ec_paymentorders_status_0' => '未支付', + 'ec_paymentorders_status_1' => '已支付', + 'ec_paymentorders_status_2' => '已过期', + 'ec_paymentorders_status_3' => '已退款', + 'ec_paymentorders_callback_tips' => '回调失败,点击重试', + 'ec_paymentorders_no_data' => '目前没有支付记录', + 'ec_paymentorders_refund_amount' => '已退款', + 'ec_paymentorders_op_status' => '查询', + 'ec_paymentorders_op_refund' => '退款', + 'ec_paymentorders_detail' => '订单详情', + 'ec_paymentorders_query_submit_tips' => '如果订单支付成功,会执行相应的业务操作', + + 'ec_transferorders_search' => '付款订单查询', + 'ec_transferorders_user' => '收款用户', + 'ec_transferorders_channel' => '付款渠道', + 'ec_transferorders_desc' => '付款描述', + 'ec_transferorders_error' => '失败原因', + 'ec_transferorders_status_1' => '付款中', + 'ec_transferorders_status_2' => '付款成功', + 'ec_transferorders_status_3' => '付款失败', + 'ec_transferorders_no_data' => '目前没有转账记录', + 'ec_transferorders_op_retry' => '重试', + + 'ec_credit' => '诚信规则', + 'ec_credit_tips' => '
        • 您可以修改 static/image/traderank/ 目录下的图片,设计适合自己站点风格的图标
        • ', + 'ec_credit_maxcreditspermonth' => '每个自然月中,相同买家和卖家之间的评价计分最大值', + 'ec_credit_maxcreditspermonth_comment' => '以交易创建的时间计算,超出计分规则范围的评价将不计分', + 'ec_credit_rank' => '信用等级', + 'ec_credit_between' => '信用度介于', + 'ec_credit_sellericon' => '卖家图标', + 'ec_credit_buyericon' => '买家图标', + + 'tradelog_order_status' => '订单状态', + 'tradelog_all_order' => '全部订单', + 'tradelog_order_count' => '订单数', + 'tradelog_trade_total' => '交易总金额', + 'tradelog_trade_totalcredit' => '交易总积分', + 'tradelog_fee_total' => '手续费总额', + 'tradelog_trade_no' => '交易单号', + 'tradelog_trade_name' => '商品名称', + 'tradelog_offline' => '线下担保交易', + 'tradelog_seller' => '卖家', + 'tradelog_buyer' => '买家', + 'tradelog_money' => '金额(元)', + 'tradelog_credit' => '积分', + 'tradelog_fee' => '手续费(元)', + + 'credits_edit' => '编辑积分规则', + 'credits_edit_cycletype' => '编辑积分规则', + 'credits_edit_cycletime' => '间隔时间', + 'credits_edit_cycletime_comment' => '当选择“整点”时,该单位为“小时”;选择“间隔分钟”时,该单位为“分钟”', + 'credits_edit_rewardnum' => '周期内最多奖励次数', + 'credits_edit_rewardnum_comment' => '0为不限次数', + 'credits_edit_lowerlimit' => '积分策略下限', + 'credits_edit_globalrule' => '全局积分策略', + + 'project_option_forum_styleid' => '风格方案', + 'project_option_forum_allowsmilies' => '允许使用表情', + 'project_option_forum_allowhtml' => '允许使用 HTML 代码', + 'project_option_forum_allowside' => '允许开启边栏', + 'project_option_forum_allowbbcode' => '允许使用 Discuz! 代码', + 'project_option_forum_allowimgcode' => '允许使用 [img] 代码', + 'project_option_forum_allowmediacode' => '允许使用 [audio] [media] [flash] 等多媒体代码', + 'project_option_forum_allowanonymous' => '允许发表匿名帖', + 'project_option_forum_allowshare' => '允许其他模块共享', + 'project_option_forum_allowpostspecial' => '显示特殊类型主题发布按钮', + 'project_option_forum_allowspecialonly' => '只允许发布特殊类型主题', + 'project_option_forum_alloweditrules' => '允许版主修改本版块规则', + 'project_option_forum_allowfeed' => '允许发送动态', + 'project_option_forum_recyclebin' => '主题回收站', + 'project_option_forum_modnewposts' => '发帖审核', + 'project_option_forum_jammer' => '启用内容干扰码', + 'project_option_forum_disablethumb' => '禁用图片附件添加缩略图', + 'project_option_forum_disablewatermark' => '禁用图片附件添加水印', + 'project_option_forum_tagstatus' => '启用主题标签(TAG)', + 'project_option_forum_inheritedmod' => '版主上级版块继承', + 'project_option_forum_autoclose' => '主题自动关闭', + 'project_option_forum_postattachperm' => '上传附件权限', + 'project_option_forum_forumcolumns' => '下级子版块横排', + 'project_option_forum_threadcaches' => '页面缓存系数', + 'project_option_forum_allowpaytoauthor' => '显示“用支付宝求购”按钮', + 'project_option_forum_alloweditpost' => '允许编辑文章', + 'project_option_forum_simple' => '只显示下级子版块等显示方式设置', + 'project_option_forum_creditspolicy' => '版块积分策略', + 'project_option_forum_postcredits' => '发表主题积分策略', + 'project_option_forum_replycredit' => '发表回复积分策略', + 'project_option_forum_getattachcredits' => '下载附件积分策略', + 'project_option_forum_postattachcredits' => '上传附件积分策略', + 'project_option_forum_digestcredits' => '精华积分策略', + 'project_option_forum_attachextensions' => '允许附件类型', + 'project_option_forum_viewperm' => '浏览版块权限', + 'project_option_forum_postperm' => '发主题帖权限', + 'project_option_forum_replyperm' => '发回复帖权限', + 'project_option_forum_getattachperm' => '下载附件权限', + 'project_option_forum_postimageperm' => '上传图片权限', + 'project_option_forum_commentitem' => '点评观点', + 'project_option_forum_spviewperm' => '不受限制的用户组', + 'project_option_forum_hidemenu' => '在版块跳转菜单中隐藏', + 'project_option_forum_modrecommend' => '版主推荐设置', + 'project_option_forum_keywords' => 'SEO keywords', + 'project_option_forum_formulaperm' => '权限表达式设置', + 'project_option_forum_allowglobalstick' => '显示全局置顶和分类置顶的主题', + 'project_option_forum_threadtypes' => '主题分类设置', + 'project_option_forum_extra' => '其他设置', + 'project_option_forum_supe_pushsetting' => '推送设置', + 'project_option_forum_favtimes' => '收藏次数', + 'project_option_forum_sharetimes' => '分享次数', + 'project_option_forum_allowappend' => '允许开启文章补充', + 'project_option_forum_domain' => '绑定的二级域名', + 'project_option_forum_catforumcolumns' => '分区版块横排', + 'project_option_forum_seotitle' => 'SEO title', + 'project_option_forum_relatedgroup' => '关联的用户组', + 'project_option_forum_picstyle' => '主题封面', + 'project_option_forum_widthauto' => '默认是否宽屏', + 'project_option_forum_seodescription' => 'SEO description', + 'project_option_forum_showexif' => '图片附件显示 EXIF', + 'project_option_forum_disablecollect' => '禁止淘帖', + + 'project_option_group_readaccess' => '阅读权限', + 'project_option_group_allowvisit' => '允许访问论坛', + 'project_option_group_allowpost' => '允许发表主题帖', + 'project_option_group_allowreply' => '允许发表回复帖', + 'project_option_group_allowpostpoll' => '允许发表投票', + 'project_option_group_allowpostreward' => '允许发表悬赏帖', + 'project_option_group_allowposttrade' => '允许发表商品帖', + 'project_option_group_allowpostactivity' => '允许发表活动帖', + 'project_option_group_allowdirectpost' => '允许直接发帖', + 'project_option_group_allowgetattach' => '允许下载附件', + 'project_option_group_allowpostattach' => '允许上传附件', + 'project_option_group_allowpostimage' => '允许上传图片', + 'project_option_group_allowvote' => '允许投票', + 'project_option_group_allowmultigroups' => '允许加入/离开公众用户组', + 'project_option_group_allowsearch' => '允许使用搜索', + 'project_option_group_allowcstatus' => '允许查看论坛统计', + 'project_option_group_allowuseblog' => '允许使用文集', + 'project_option_group_allowinvisible' => '允许隐身', + 'project_option_group_allowtransfer' => '允许积分转账', + 'project_option_group_allowsetreadperm' => '允许设置文章权限', + 'project_option_group_allowsetattachperm' => '允许设置附件权限', + 'project_option_group_allowhidecode' => '允许使用 [hide] 代码', + 'project_option_group_allowmediacode' => '允许使用 [audio] [media] [flash] 等多媒体代码', + 'project_option_group_allowhtml' => '允许使用 HTML 代码', + 'project_option_group_allowanonymous' => '允许发匿名帖', + 'project_option_group_allowmagics' => '允许使用道具', + 'project_option_group_allownickname' => '允许使用昵称', + 'project_option_group_allowsigbbcode' => '允许签名中使用 Discuz! 代码', + 'project_option_group_allowsigimgcode' => '允许签名中使用 [img] 代码', + 'project_option_group_allowviewpro' => '允许查看用户资料', + 'project_option_group_allowviewstats' => '允许查看统计数据', + 'project_option_group_disableperiodctrl' => '不受时间段限制', + 'project_option_group_reasonpm' => '操作理由短消息通知作者', + 'project_option_group_maxprice' => '主题(附件)最高售价', + 'project_option_group_maxsigsize' => '签名文字最大长度', + 'project_option_group_maxattachsize' => '最大附件尺寸', + 'project_option_group_maxsizeperday' => '每天最大附件总尺寸', + 'project_option_group_maxattachnum' => '每天最大附件数量', + 'project_option_group_maxmagicsweight' => '道具最大携带重量', + 'project_option_group_maxpostsperhour' => '会员每小时发帖数限制', + 'project_option_group_attachextensions' => '允许附件类型', + 'project_option_group_raterange' => '允许参与评分', + 'project_option_group_magicsdiscount' => '道具最大折扣量', + 'project_option_group_tradetaxtype' => '交易手续费计算方式', + 'project_option_group_tradetaxs' => '交易手续费', + 'project_option_group_mintradeprice' => '最小交易金额', + 'project_option_group_maxtradeprice' => '最大交易金额', + 'project_option_group_minrewardprice' => '最小悬赏积分', + 'project_option_group_maxrewardprice' => '最大悬赏积分', + 'project_option_group_allowbiobbcode' => '允许自我介绍中使用 Discuz! 代码', + 'project_option_group_allowbioimgcode' => '允许自我介绍中使用 [img] 代码', + 'project_option_group_maxbiosize' => '自我介绍文字最大长度', + 'project_option_group_maxbiotradesize' => '店铺介绍文字最大长度', + 'project_option_group_allowinvite' => '是否允许使用邀请注册', + 'project_option_group_allowmailinvite' => '是否允许发送邀请码', + 'project_option_group_maxinvitenum' => '24小时内购买邀请码最大数量', + 'project_option_group_inviteprice' => '购买单个邀请码价格', + 'project_option_group_maxinviteday' => '邀请码有效期', + 'project_option_group_allowpostdebate' => '允许用户发起辩论', + 'project_option_group_tradestick' => '商品主题最多推荐商品数', + 'project_option_group_exempt' => '扩展积分豁免权', + 'project_option_group_allowsendpm' => '允许发送短消息', + 'project_option_group_allowrecommend' => '允许用户推荐主题', + 'project_option_group_allowposturl' => '是否允许发站外URL', + 'project_option_group_allowpostrushreply' => '允许发表抢楼帖', + 'project_option_group_maxfriendnum' => '最多好友数', + 'project_option_group_maxspacesize' => '空间大小', + 'project_option_group_allowcomment' => '发表留言/评论', + 'project_option_group_searchinterval' => '两次搜索操作间隔', + 'project_option_group_searchignore' => '是否免费搜索', + 'project_option_group_allowblog' => '允许发表日志', + 'project_option_group_allowdoing' => '允许发表记录', + 'project_option_group_allowupload' => '允许在空间上传图片', + 'project_option_group_allowshare' => '允许发布分享', + 'project_option_group_allowcss' => '允许自定义 CSS', + 'project_option_group_allowpoke' => '允许打招呼', + 'project_option_group_allowfriend' => '允许加好友', + 'project_option_group_allowclick' => '允许表态', + 'project_option_group_allowmagic' => '允许使用道具', + 'project_option_group_allowstat' => '允许查看趋势统计', + 'project_option_group_allowstatdata' => '允许查看站点统计', + 'project_option_group_magicdiscount' => '购买道具折扣', + 'project_option_group_domainlength' => '二级域名最短长度', + 'project_option_group_seccode' => '发布操作需填验证码', + 'project_option_group_disablepostctrl' => '发表是否受防灌水限制', + 'project_option_group_allowbuildgroup' => '是否允许建立圈子', + 'project_option_group_edittimelimit' => '编辑文章时间限制', + 'project_option_group_allowpostarticle' => '允许发布文章', + 'project_option_group_allowspacediyhtml' => '允许自定义模块使用HTML', + 'project_option_group_allowspacediybbcode' => '允许自定义模块使用BBCODE', + 'project_option_group_allowspacediyimgcode' => '允许自定义模块使用[img]', + 'project_option_group_allowcommentpost' => '允许文章点评', + 'project_option_group_allowcommentitem' => '允许发表点评观点', + 'project_option_group_allowcommentreply' => '允许楼层回复点评', + 'project_option_group_allowblogmod' => '发表日志需要审核', + 'project_option_group_allowcusbbcode' => '允许自定义BBCODE', + 'project_option_group_allowdoingmod' => '发表记录需要审核', + 'project_option_group_allowuploadmod' => '上传图片需要审核', + 'project_option_group_allowsharemod' => '发布分享需要审核', + 'project_option_group_allowgroupdirectpost' => '是否允许直接在圈子中发帖', + 'project_option_group_allowgroupposturl' => '是否允许在圈子中发站外URL', + 'project_option_group_allowpostarticlemod' => '发布文章是否需要审核', + 'project_option_group_allowdownlocalimg' => '允许下载本地图片', + 'project_option_group_allowdownremoteimg' => '允许下载远程图片', + 'project_option_group_allowcommentarticle' => '发表文章的评论', + 'project_option_group_ignorecensor' => '忽略需要审核的关键字', + 'project_option_group_allowreplycredit' => '允许设置回帖奖励', + 'project_option_group_allowsendallpm' => '是否不受“只接收好友短消息”设置的限制', + 'project_option_group_maximagesize' => '相册中允许最大图片大小', + 'project_option_group_allowgetimage' => '允许查看图片', + 'project_option_group_allowposttag' => '允许使用标签', + 'project_option_group_allowat' => '发帖时可 @ 其他人的数量', + 'project_option_group_allowsendpmmaxnum' => '24小时内发布短消息最大数', + 'project_option_group_allowsetpublishdate' => '允许设置预发帖时间', + 'project_option_group_allowfollowcollection' => '最多允许关注淘专辑的数量', + 'project_option_group_allowcommentcollection' => '允许评论淘专辑', + 'project_option_group_allowcreatecollection' => '允许用户创建淘专辑的数量', + 'project_option_group_maxthreadsperhour' => '会员每小时发主题数限制', + + 'extended' => '扩展', + + 'extended_tag' => '标签聚合', + 'extended_tag_tips' => '
        • 论坛当前未开启主题标签功能,标签聚合开启后将无法根据主题的相关内容显示。点这里打开主题标签功能
        • ', + 'extended_tag_on' => '显示标签聚合', + 'extended_tag_on_comment' => '开启后,主题内容页面将调用标签聚合的信息', + 'extended_tag_tag' => '标签聚合', + 'extended_tag_items' => '显示数据条数', + 'extended_tag_tpl' => '单条显示模板', + 'extended_tag_status' => '是否显示', + 'extended_tag_order' => '显示顺序', + 'extended_tag_name' => '应用名称', + 'extended_tag_memo' => '代表', + + 'tools' => '工具', + + 'tools_updatecache' => '更新缓存', + 'tools_updatecache_tips' => '
        • 当站点进行了数据恢复、升级或者工作出现异常的时候,您可以使用本功能重新生成缓存。更新缓存的时候,可能让服务器负载升高,请尽量避开会员访问的高峰时间
        • +
        • 数据缓存:更新站点的全部数据缓存
        • +
        • 模板缓存:更新论坛模板、风格等缓存文件,当您修改了模板或者风格,但是没有立即生效的时候使用
        • +
        • DIY 模块分类缓存:更新 DIY 模块分类,当您安装或修改了 DIY 模块分类,但是没有立即生效的时候使用
        • +
        • CSS缓存:更新论坛模板、风格等CSS文件,当您修改了模版或者风格CSS,但是没有立即生效的时候使用
        • + ', + + 'tools_updatecache_data'=>'数据缓存', + 'tools_updatecache_tpl'=>'模板缓存', + 'tools_updatecache_blockclass'=>'DIY 模块分类缓存', + 'tools_updatecache_searchindex'=>'后台搜索索引缓存', + 'tools_updatecache_waiting'=>'正在更新缓存,请稍候......', + + 'fileperms_check_note' => '主要检查文件及文件夹的写入权限,点击下面按钮开始进行检查', + 'fileperms_check_waiting'=>'正在进行文件权限检查,请稍候......', + 'fileperms_tips' => '
        • 如果某个文件或目录被检查到“无法写入”(以红色列出),请即刻通过 FTP 或其他工具修改其属性(例如设置为 777),以确保站点功能的正常使用。
        • ', + 'fileperms_check_ok' => '文件及目录属性全部正确', + 'fileperms_unwritable' => '无法写入', + + 'filecheck_start' => '开 始', + 'filecheck_verifying' => '正在进行文件校验,请稍候......', + 'filecheck_tips_step1' => '文件校验是针对 Discuz! 官方发布的文件为基础进行核对,点击下面按钮开始进行校验', + 'filecheck_tips' => '
        • 当论坛出现异常或者被非法入侵后,您应当使用本功能校验论坛程序文件,以确保论坛安全运行
        • 丢失”的文件您应当通过 FTP 及时将文件补充进来,否则可能论坛运行不正常
        • 被修改”、“未知”的文件应当引起您的警惕,必须确认文件是您自己修改或者是某个插件添加的,否则请删除未知文件和恢复被修改的文件
        • ', + 'filecheck_completed' => '校验结果', + 'filecheck_unknown' => '未知文件', + 'filecheck_modify' => '被修改文件', + 'filecheck_delete' => '丢失文件', + 'filecheck_doubt' => '一周内更新', + 'filecheck_check_ok' => '正确', + 'filecheck_status' => '状态', + 'filecheck_check_now' => '立即检测', + 'filecheck_view_list' => '查看文件列表', + 'filecheck_last_homecheck' => '最后校验时间', + + 'hookcheck_start' => '开 始', + 'hookcheck_verifying' => '正在进行嵌入点校验,请稍候......', + 'hookcheck_tips_step1' => '嵌入点校验是针对 Discuz! 官方发布的文件为基础进行核对,点击下面按钮开始进行校验{template}', + 'hookcheck_tips' => '
        • 嵌入点”是模板文件中的“<!--{hook/xxx}-->”代码,模板文件丢失嵌入点代码会造成云服务(如QQ群、腾讯分析等)等插件无法正常使用
        • 缺失“嵌入点”的模板文件需要使用对比工具,对比原始文件和服务器上对应的模板文件进行对比,将丢失的嵌入点代码补充好
        • ', + 'hookcheck_completed' => '校验结果', + 'hookcheck_delete' => '丢失嵌入点的文件', + 'hookcheck_discuzhook' => '源文件嵌入点', + 'hookcheck_delhook' => '丢失的嵌入点', + + 'replacekey_tips' => '
        • 当站点沦陷时您应该考虑在此处密钥更新,以避免黑客通过已知的 AUTHKEY 获取站点控制权限。
        • 少数插件会使用站点密钥保存数据,当重置密钥时相关数据会丢失且无法恢复,敬请注意并在更新前做好数据库与站点文件的备份工作。
        • ', + 'replacekey_tips_step1' => '在操作之前建议您选择低峰期操作或在操作前关闭站点,并做好数据、文件备份工作,点击下面按钮开始更换', + 'replacekey_tips_step2' => '正在进行密钥更新,请稍候......', + + 'imagepreview_imagesize_source' => '原图片大小', + 'imagepreview_imagesize_target' => '处理后图片大小', + + 'imagepreview_thumb' => '缩略图预览效果', + 'imagepreview_watermark' => '水印预览效果', + + 'dbcheck_verifying' => '正在进行数据库校验,请稍候......', + 'dbcheck_tips_step1' => '点击下面按钮开始进行数据库校验', + 'dbcheck_tips' => '
        • 数据库校验只针对 Discuz! 官方发布的数据库结构为基础进行核对
        • 此工具只对字段的修改以及缺少进行简单的检查,不针对索引的缺少进行处理。
        • ', + 'dbcheck_field' => '错误的字段', + 'dbcheck_org_field' => '正确的字段', + 'dbcheck_new_field' => '新增的字段', + 'dbcheck_status' => '状态', + 'dbcheck_modify' => '字段被修改', + 'dbcheck_delete' => '字段被删除', + 'dbcheck_slow' => '字段影响效率', + 'dbcheck_userfield' => '用户新增字段', + 'dbcheck_repair' => '修复选择的字段或数据', + 'dbcheck_errorfields_tables' => '存在错误字段的数据表 (为了保证站点的正常运行,请立即修复以下标有 字段被修改字段被删除 的字段)', + 'dbcheck_missing_tables' => '缺少的数据表 (为了保证站点的正常运行,请立即补充以下缺少的数据表)', + 'dbcheck_charseterror_tables' => '字符集错误的数据表', + 'dbcheck_charseterror_notice' => '字符集不一致可能会导致乱码,请手动修复以下数据表,当前字符集 ', + 'dbcheck_setting' => '缺少的论坛设置参数 (为了保证站点的正常运行,请立即补充以下设置参数)', + 'dbcheck_repairtable' => '修复所有被修改的字段', + 'dbcheck_userfields' => '新增字段的数据表 (以下数据表中的字段可能是某些插件添加的,如您确认无误,可以忽略它们)', + + 'counter' => '更新统计', + 'counter_forum' => '重建(论坛/圈子)帖数', + 'counter_digest' => '重建用户精华帖数', + 'counter_member' => '重建用户发帖数', + 'counter_thread' => '重建主题帖数', + 'counter_moved_thread' => '清理移动标记', + 'counter_amount' => '每个循环更新数量', + 'counter_processing' => '正在处理 从 {current} 到 {next}', + 'counter_moved_favorites_logs' => '清理收藏夹和日志数据', + 'counter_special_arrange' => '分类信息整理:(第{cursort}类/共{sortids}类)', + 'counter_special' => '分类信息整理', + 'counter_groupmember_num' => '重建圈子成员数', + 'counter_groupmember_post' => '重建圈子成员发帖数', + 'counter_groupnum' => '重建分类圈子数', + 'counter_blog_replynum' => '重建日志回复数', + 'counter_friendnum' => '重建空间好友数', + 'counter_album_picnum' => '重建相册图片数', + 'counter_thread_cover' => '重建主题封面', + 'counter_thread_cover_settime' => '主题最后回复时间范围', + 'counter_thread_heat' => '重建热点主题', + 'counter_forumid' => '版块ID', + 'counter_have_cover' => '包含已有封面主题', + 'counter_tips' => '
        • 当下列数据不正常时,可以使用此功能对数据进行更新校正。请尽量避开会员访问的高峰时间
        • +
        • 每个循环更新数量:数值请在一个合理范围,不要过大,否则会给服务器带来负载压力
        • + ', + + 'remoderate' => '内容重新审核', + 'remoderate_thread' => '主题/文章标题及内容重新审核', + 'remoderate_blog' => '日志标题及内容重新审核', + 'remoderate_pic' => '图片标题重新审核', + 'remoderate_doing' => '记录内容重新审核', + 'remoderate_share' => '分享内容重新审核', + 'remoderate_comment' => '家园评论内容重新审核', + 'remoderate_article' => '文章标题及内容重新审核', + 'remoderate_articlecomment' => '文章评论内容重新审核', + 'remoderate_topiccomment' => '专题评论内容重新审核', + 'remoderate_amount' => '每个循环更新数量', + 'remoderate_processing' => '正在处理 从 {current} 到 {next}', + 'remoderate_tips' => '
        • 当词语过滤参数有较大变动或邻近敏感时间点时,可以使用此功能对历史数据进行重新审核。请尽量避开会员访问的高峰时间
        • +
        • 每个循环更新数量:数值请在一个合理范围,不要过大,否则会给服务器带来负载压力
        • + ', + + 'db' => '数据库', + 'db_export' => '数据备份', + 'db_method' => '方式', + 'db_shell' => 'Shell', + 'db_multivol' => '多卷', + 'db_zip' => 'ZIP', + 'db_volume' => '卷数', + 'db_delete_tips' => '

          删除服务器上的备份数据', + 'db_export_tips_nouc' => '
        • 您当前的数据备份不包含 UCenter,会影响到您的会员数据,请点击这里单独备份 UCenter 数据
        • 数据备份功能根据您的选择备份全部Discuz!数据,导出的数据文件可用“数据恢复”功能或 phpMyAdmin 导入。
        • ', + 'db_export_tips_uc' => '
        • 数据备份功能根据您的选择备份全部Discuz! 和 UCenter数据,导出的数据文件可用“数据恢复”功能或 phpMyAdmin 导入。
        • ', + 'db_export_tips' => '
        • 出于安全考虑,我们强烈建议您下载数据库备份文件后删除文件或设置文件不可通过 URL 访问。
        • 全部备份均不包含模板文件和附件文件。模板、附件的备份只需通过 FTP 等下载 template/、data/attachment/ 目录即可,Discuz! 不提供单独备份。
        • MySQL Dump 的速度比 Discuz! 分卷备份快很多,但需要服务器支持相关的 Shell 权限,同时由于 MySQL 本身的兼容性问题,通常进行备份和恢复的服务器应当具有相同或相近的版本号才能顺利进行。因此 MySQL Dump 是有风险的:一旦进行备份或恢复操作的服务器其中之一禁止了 Shell,或由于版本兼容性问题导致导入失败,您将无法使用 MySQL Dump 备份或由备份数据恢复;Discuz! 分卷备份没有此限制。
        • 数据备份选项中的设置,仅供高级用户的特殊用途使用,当您尚未对数据库做全面细致的了解之前,请使用默认参数备份,否则将导致备份数据错误等严重问题。
        • 十六进制方式可以保证备份数据的完整性,但是备份文件会占用更多的空间。
        • 压缩备份文件可以让您的备份文件占用更小的空间。
        • ', + 'db_export_type' => '数据备份类型', + 'db_export_discuz' => 'Discuz! 数据(不含UCenter)', + 'db_export_discuz_uc' => 'Discuz! 和 UCenter 数据', + 'db_export_custom' => '自定义备份', + 'db_export_custom_comment' => '根据需要自行选择需要备份的数据表', + 'db_export_custom_select_all' => '全选', + 'db_export_method' => '数据备份方式', + 'db_export_shell' => '系统 MySQL Dump (Shell) 备份', + 'db_export_multivol' => 'Discuz! 分卷备份 - 文件长度限制(单位:KB)', + 'db_export_options' => '数据备份选项', + 'db_export_options_extended_insert' => '使用扩展插入(Extended Insert)方式', + 'db_export_options_sql_compatible' => '建表语句格式', + 'db_export_options_charset' => '强制字符集', + 'db_export_usehex' => '十六进制方式', + 'db_export_usezip' => '压缩备份文件', + 'db_export_zip' => '压缩备份', + 'db_export_zip_1' => '多分卷压缩成一个文件', + 'db_export_zip_2' => '每个分卷压缩成单独文件', + 'db_export_zip_3' => '不压缩', + 'db_export_filename' => '备份文件名', + 'db_export_file' => '数据备份记录', + 'db_export_discuz_table' => 'Discuz! 数据表', + 'db_export_discuz_table_uc' => 'Discuz! 和 UCenter 数据表', + + 'db_import' => '数据恢复', + 'db_import_confirm' => '导入和当前 Discuz! 版本不一致的数据极有可能产生无法解决的故障,您确定继续吗?', + 'db_import_confirm_sql' => '您确定导入该备份吗?', + 'db_import_confirm_zip' => '您确定解压该备份吗?', + 'db_import_tips' => '
        • 本功能在恢复备份数据的同时,将全部覆盖原有数据,请确定恢复前已将站点关闭,恢复全部完成后可以将站点重新开放。
        • 出于安全考虑,我们强烈建议您恢复数据库备份文件后删除文件或设置文件不可通过 URL 访问。
        • 恢复数据前请在 Discuz! 安装文件目录下 utility 文件夹内找到 restore.php 文件,然后将 restore.php 文件上传到程序文件夹data目录下。为了您站点的安全,成功恢复数据后请务必及时删除 restore.php 文件。
        • 您可以在数据备份记录处查看站点的备份文件的详细信息,删除过期的备份,并导入需要的备份。
        • ', + 'do_import_option' => '
          • 您可以在本页面数据备份记录处导入备份恢复数据,也可以通过在浏览器中执行 {restore_url} 恢复数据', + 'db_import_from_server' => '从服务器(填写文件名或 URL)', + 'db_import_from_local' => '从本地文件', + 'db_import_unzip' => '解压缩', + + 'db_runquery' => '数据库升级', + 'db_runquery_tips' => '
          • 您可以通过修改 /source/admincp/admincp_quickquery.php 来添加常用 SQL 操作进行功能扩充。
          • 出于安全考虑,Discuz! 后台默认情况下禁止 SQL 语句直接执行,只能使用常用 SQL 当中的内容,
            如果您想自己随意书写 SQL 升级语句,需要将 config/config_global.php 当中的 $_config[\'admincp\'][\'runquery\'] 设置修改为 1。
          • ', + 'db_runquery_sql' => 'Discuz! 数据库升级 - 请将数据库升级语句粘贴在下面', + 'db_runquery_denied' => '对不起,此项功能已经被禁止,如果需要开启,请修改 config/config_global.php 中的相关配置', + 'db_runquery_comment' => '注意: 为确保升级成功,请不要修改 SQL 语句的任何部分', + 'db_runquery_select' => '现有方案', + 'db_runquery_simply' => '常用 SQL 升级语句', + 'db_runquery_createcompatible' => '转换建表语句格式和字符集', + + 'db_optimize_tables' => '待优化数据表列表', + 'db_optimize_tips' => '
          • 数据表优化可以去除数据文件中的碎片,使记录排列紧密,提高读写速度。
          • ', + 'db_optimize_opt' => '优化?', + 'db_optimize_table_name' => '数据表', + 'db_optimize_data' => '数据', + 'db_optimize_rows' => '记录数', + 'db_optimize_index' => '索引', + 'db_optimize_frag' => '碎片', + 'db_optimize_used' => '尺寸', + 'db_optimize_done' => '数据表没有碎片,不需要再优化', + + 'logs' => '运行记录', + 'logs_lpp' => '每页显示', + 'logs_passwd' => '密码错误记录', + 'logs_passwd_username' => '尝试用户名', + 'logs_passwd_password' => '尝试密码', + 'logs_passwd_security' => '安全提问', + 'logs_rating' => '用户评分记录', + 'logs_rating_username' => '被评分用户', + 'logs_rating_rating' => '分数', + 'logs_rating_manual' => '管理员人工编辑', + 'logs_rating_delete' => '撤销 ', + 'logs_credit' => '积分交易记录', + 'logs_credit_fromto' => '对象', + 'logs_credit_send' => '支出', + 'logs_credit_total' => '合计', + 'logs_credit_receive' => '收入', + 'logs_moderate' => '版主管理记录', + 'logs_medal' => '勋章颁发记录', + 'logs_medal_name' => '勋章', + 'logs_medal_operation_0' => '人工授予', + 'logs_medal_operation_1' => '审核通过', + 'logs_medal_operation_2' => '等待审核', + 'logs_medal_operation_3' => '未通过审核', + 'logs_medal_expiration' => '有效期', + 'logs_banned' => '禁止用户记录', + 'logs_banned_ban' => '禁止', + 'logs_banned_unban' => '解禁', + 'logs_banned_group' => '原用户组/新用户组', + 'logs_cp' => '系统管理记录', + 'logs_error' => '系统错误记录', + 'logs_invite' => '邀请注册记录', + 'logs_invite_target' => '邀请对象', + 'logs_magic' => '道具操作记录', + 'logs_magic_type' => '道具种类', + 'logs_magic_operation_1' => '购买记录', + 'logs_magic_operation_2' => '使用记录', + 'logs_magic_operation_3' => '赠送给: ', + 'logs_magic_operation_4' => '黑市出售记录', + 'logs_magic_operation_5' => '黑市购买记录', + 'logs_invite_buyer' => '购买者', + 'logs_invite_buydate' => '购买时间', + 'logs_invite_expiration' => '到期时间', + 'logs_invite_ip' => '购买者IP', + 'logs_invite_code' => '邀请码', + 'logs_invite_status' => '状态', + 'logs_noexpire' => '永久有效', + 'logs_invite_status_1' => '可使用', + 'logs_invite_status_2' => '已使用', + 'logs_invite_status_3' => '已发送', + 'logs_invite_status_4' => '已过期', + 'logs_payment_amount' => '售价', + 'logs_payment_netamount' => '实际收入', + 'logs_payment_seller' => '卖家', + 'logs_payment_buyer' => '买家', + 'logs_payment_dateline' => '发表时间', + 'logs_payment_buydateline' => '购买时间', + 'logs_payment_del' => '主题已删除', + 'logs_payment_view' => '主题已删除', + 'logs_payment_channel' => '支付渠道', + 'logs_payment_status' => '状态', + 'logs_payment_status_0' => '异常', + 'logs_payment_status_1' => '完成', + 'logs_payment_order' => '订单号', + 'logs_payment_error' => '异常描述', + 'logs_tips_illegal' => '
          • 密码错误记录中的IP,需要在管理组内开启查看IP功能才能显示。
          • ', + 'logs_tips_ban' => '
          • 禁止用户记录,需要在管理组内开启禁止用户功能才能显示。
          • ', + 'logs_credits_log_update' => '积分变化', + 'logs_credit_update_TRC' => '任务奖励积分', + 'logs_credit_update_RTC' => '发表悬赏主题扣除积分', + 'logs_credit_update_RAC' => '最佳答案获取悬赏积分', + 'logs_credit_update_MRC' => '道具随即获取积分', + 'logs_credit_update_TFR' => '积分转账转出', + 'logs_credit_update_RCV' => '积分转账接收', + 'logs_credit_update_CEC' => '积分兑换', + 'logs_credit_update_ECU' => '通过 UCenter 兑换积分支出', + 'logs_credit_update_SAC' => '出售附件获得积分', + 'logs_credit_update_BAC' => '购买附件支出积分', + 'logs_credit_update_PRC' => '文章被评分所得积分', + 'logs_credit_update_RSC' => '评分文章扣除自己的积分', + 'logs_credit_update_STC' => '出售主题获得积分', + 'logs_credit_update_BTC' => '购买主题支出积分', + 'logs_credit_update_AFD' => '购买积分即积分充值', + 'logs_credit_update_UGP' => '购买扩展用户组', + 'logs_credit_update_RPC' => '举报功能中的奖惩', + 'logs_credit_update_ACC' => '参与活动扣除积分', + 'logs_credit_update_RCT' => '回帖奖励', + 'logs_credit_update_RCA' => '回帖中奖', + 'logs_credit_update_RCB' => '返还回帖奖励积分', + 'logs_credit_update_CDC' => '卡密充值', + 'logs_credit_update_BMC' => '购买道具', + 'logs_credit_update_AGC' => '获得红包', + 'logs_credit_update_BGC' => '埋下红包', + 'logs_credit_update_RGC' => '回收红包', + 'logs_credit_update_RKC' => '竞价排名', + 'logs_credit_update_BME' => '购买勋章', + 'logs_credit_update_RPR' => '后台积分奖惩', + 'logs_credit_update_RPZ' => '后台积分奖惩清零', + 'logs_credit_update_RUL' => '积分规则', + 'logs_credit_update_INV' => '购买邀请码', + 'logs_credit_update_reward_clean' => '清零', + 'logs_select_operation' => '请选择类型', + 'logs_viewtype' => '查看方式', + 'logs_credit_relatedid' => '关联 ID', + 'logs_task_id' => '任务 ID', + 'logs_magic_id' => '道具 ID', + 'logs_medal_id' => '勋章 ID', + 'logs_member_id' => '用户 ID', + 'logs_usergroup_id' => '用户组 ID', + 'logs_thread_id' => '主题 ID', + 'logs_post_id' => '回复 ID', + 'logs_attach_id' => '附件 ID', + 'logs_report_id' => '举报 ID', + 'logs_click2view' => '点击查看', + 'logs_archive' => '档案', + 'logs_lock' => '锁定', + 'logs_unlock' => '解锁', + 'logs_select_ridtype' => '请选择关联 ID 类型', + + 'crime_action' => '操作行为', + 'crime_dateline' => '操作时间', + 'crime_reason' => '操作理由', + 'crime_operator' => '操作者', + 'crime_user' => '操作对象', + 'crime_record' => '违规记录', + 'crime_delpost' => '删除文章', + 'crime_warnpost' => '警告文章', + 'crime_banpost' => '屏蔽文章', + 'crime_banspeak' => '禁止发言', + 'crime_banvisit' => '禁止访问', + 'crime_banstatus' => '锁定用户', + 'crime_avatar' => '清除头像', + 'crime_sightml' => '清除签名', + 'crime_customstatus' => '清除自定义头衔', + 'crime_checkrecord' => '查看违规记录', + + 'adv' => '广告', + 'adv_admin' => '站点广告', + 'adv_admin_setting' => '设置', + 'adv_admin_list' => '广告位', + 'adv_admin_listall' => '所有广告', + 'adv_admin_discuzunion' => 'Discuz!联盟', + + 'adv_type_version' => '模块版本', + 'adv_type_headerbanner' => '页头通栏广告', + 'adv_type_headerbanner_tips' => '
          • 展现方式: 页头通栏广告显示于论坛页面右上方,通常使用 468x60 图片或 Flash 的形式。当前页面有多个页头通栏广告时,系统会随机选取其中之一显示。
          • 价值分析: 由于能够在页面打开的第一时间将广告内容展现于最醒目的位置,因此成为了网页中价位最高、最适合进行商业宣传或品牌推广的广告类型之一。
          • ', + 'adv_type_footerbanner' => '页尾通栏广告', + 'adv_type_footerbanner_tips' => '
          • 展现方式: 页尾通栏广告显示于论坛页面中下方,通常使用 468x60 或其他尺寸图片、Flash 的形式。当前页面有多个页尾通栏广告时,系统会随机选取其中之一显示。
          • 价值分析: 与页面头部和中部相比,页面尾部的展现机率相对较低,通常不会引起访问者的反感,同时又基本能够覆盖所有对广告内容感兴趣的受众,因此适合中性而温和的推广。
          • ', + 'adv_type_text' => '页内文字广告', + 'adv_type_text_tips' => '
          • 展现方式: 页内文字广告以表格的形式,显示于首页、主题列表和文章内容三个页面的中上方,通常使用文字的形式,也可使用小图片和 Flash。当前页面有多个文字广告时,系统会以表格的形式按照设定的显示顺序全部展现,同时能够对表格列数在 3~5 的范围内动态排布,以自动实现最佳的广告排列效果。
          • 价值分析: 由于此类广告通常以文字形式展现,但其所在的较靠上的页面位置,使得此类广告成为了访问者必读的内容之一。同一页面可以呈现多达十几条文字广告的特性,也决定了它是一种平民化但性价比较高的推广方式,同时还可用于论坛自身的宣传和公告之用。
          • ', + 'adv_type_thread' => '帖内广告', + 'adv_type_thread_tips' => '
          • 展现方式: 帖内广告显示于文章内容的上方、下方或右方,文章内容的上方和下方通常使用文字的形式,文章内容右方通常使用图片的形式。当前页面有多个帖内广告时,系统会从中抽取与每页帖数相等的条目进行随机显示。您可以在 全局设置中的其他设置中修改每帖显示的广告数量。
          • 价值分析: 由于文章是论坛最核心的组成部分,嵌入文章内容内部的帖内广告,便可在用户浏览文章内容时自然的被接受,加上随机播放的特性,适合于特定内容的有效推广,也可用于论坛自身的宣传和公告之用。建议设置多条帖内广告以实现广告内容的差异化,从而吸引更多访问者的注意力。
          • ', + 'adv_type_interthread' => '帖间通栏广告', + 'adv_type_interthread_tips' => '
          • 展现方式: 帖间通栏广告显示于主题帖和第一个回帖之间,可使用 468x60 或其他尺寸图片和 Flash 的形式。当前页面有多个帖间通栏广告时,系统会随机选取其中之一显示。
          • 价值分析: 由于能够将主题与回帖分开,广告尺寸大而且不影响文章内容,因此不会招致文章作者及访问者反感,适合在帖内进行商业宣传或品牌推广。
          • ', + 'adv_type_float' => '漂浮广告', + 'adv_type_float_tips' => '
          • 展现方式: 漂浮广告展现于页面左下角,当页面滚动时广告会自行移动以保持原来的位置,通常使用小图片或 Flash 的形式。当前页面有多个漂浮广告时,系统会随机选取其中之一显示。
          • 价值分析: 漂浮广告是进行强力商业推广的有效手段,其在页面中的浮动性,使其与固定的图片和文字相比,更容易被关注,正因为如此,这种强制性的关注也可能招致对此广告内容不感兴趣的访问者的反感。请注意不要将过大的图片或 Flash 以漂浮广告的形式显示,以免影响页面阅读。
          • ', + 'adv_type_couplebanner' => '对联广告', + 'adv_type_couplebanner_tips' => '
          • 展现方式: 对联广告以长方形图片的形式显示于页面顶部两侧,形似一幅对联,通常使用宽小高大的长方形图片或 Flash 的形式。对联广告一般只在使用像素约定主表格宽度的情况下使用,如使用超过 90% 以上的百分比约定主表格宽度时,可能会影响访问者的正常浏览。当访问者浏览器宽度小于 800 像素时,自动不显示此类广告。当前页面有多个对联广告时,系统会随机选取其中之一显示。
          • 价值分析: 对联广告由于只展现于高分辨率(1024x768 或更高)屏幕的两侧,只占用页面的空白区域,因此不会招致访问者反感,能够良好的突出推广内容。但由于对分辨率和主表格宽度的特殊要求,使得广告的受众比例无法达到 100%。
          • ', + 'adv_type_intercat' => '分类间广告', + 'adv_type_intercat_tips' => '
          • 展现方式: 分类间广告显示于论坛首页相邻的两个论坛分类之间,可使用 468x60 或其他尺寸图片和 Flash 的形式。当前页面有多个分类间广告时,系统会从中抽取与论坛分类数相等的条目进行随机显示。
          • 价值分析:由于出现在论坛首页比较明显的位置,广告展示效果较好,但是过多过大的首页广告可能会招致访问者反感。
          • ', + 'adv_type' => '广告类型', + 'adv_style' => '样式', + 'adv_style_code' => '代码', + 'adv_style_text' => '文字', + 'adv_style_image' => '图片', + 'adv_style_flash' => 'Flash', + 'adv_targets' => '投放范围', + 'adv_thread_down' => '文章下方', + 'adv_thread_up' => '文章上方', + 'adv_thread_right' => '文章右侧', + 'adv_up' => '上', + 'adv_middle' => '中', + 'adv_down' => '下', + 'adv_edit_position_intercat' => '广告投放位置', + 'adv_edit_position_intercat_comment' => '广告将显示在您选择的分类与其下方相邻分类之间,可以按住 CTRL 多选', + 'adv_inputtitle' => '请输入广告标题', + 'adv_orderby' => '排序方式', + 'adv_addtime' => '添加时间', + 'adv_nonexistence' => '没有找到广告模块,请将广告模块的脚本文件上传到 source/class/adv/ 目录,然后刷新本页', + 'adv_custom' => '自定义广告位', + 'adv_custom_add' => '添加自定义广告位', + 'adv_custom_edit' => '编辑自定义广告位', + 'adv_custom_delete' => '删除此自定义广告位吗?', + 'adv_customnamenew' => '请输入此自定义广告位的新名称:', + 'adv_list_tip' => '
          • 您可以使用“自定义广告位”在页面的任意位置添加广告位。
          • 系统广告位位于 source/class/adv/ 目录中,插件广告位位于 source/plugin/插件目录/adv/ 目录中。
          • 插件开发人员在设计新的广告位前请务必仔细阅读《Discuz! 技术文档》中的内容。
          • ', + 'adv_custom_target' => '自定义投放范围,输入站点根目录程序文件名(无扩展名),多个用逗号分隔', + + 'adv_edit' => '编辑广告', + 'adv_add' => '添加广告', + 'adv_list' => '广告列表', + 'adv_edit_style' => '展现方式', + 'adv_edit_style_comment' => '请选择所需的广告展现方式', + 'adv_edit_title' => '广告标题(必填)', + 'adv_edit_title_comment' => '注意: 广告标题只为识别辨认不同广告条目之用,并不在广告中显示', + 'adv_edit_targets' => '广告投放范围(必选)', + 'adv_edit_targets_comment' => '设置本广告投放的页面或论坛范围', + 'adv_edit_targets_member' => '注册/登录', + 'adv_edit_targets_portal' => '门户', + 'adv_edit_targets_forum' => '论坛', + 'adv_edit_targets_group' => '圈子', + 'adv_edit_targets_home' => '空间', + 'adv_edit_targets_search' => '搜索', + 'adv_edit_targets_plugin' => '独立插件', + 'adv_edit_showtype' => '广告展现方式:', + 'adv_edit_showtype_0' => '页面中直接输出', + 'adv_edit_showtype_1' => 'IFRAME 同步输出', + 'adv_edit_starttime' => '广告起始时间(选填)', + 'adv_edit_starttime_comment' => '设置广告起始生效的时间,格式 yyyy-mm-dd,留空为不限制起始时间', + 'adv_edit_endtime' => '广告结束时间(选填)', + 'adv_edit_endtime_comment' => '设置广告广告结束的时间,格式 yyyy-mm-dd,留空为不限制结束时间', + 'adv_edit_style_code' => 'HTML 代码', + 'adv_edit_style_code_html' => '广告 HTML 代码', + 'adv_edit_style_code_html_comment' => '请直接输入需要展现的广告的 HTML 代码', + 'adv_edit_style_text' => '文字广告', + 'adv_edit_style_text_title' => '文字内容(必填)', + 'adv_edit_style_text_title_comment' => '请输入文字广告的显示内容', + 'adv_edit_style_text_link' => '文字链接(必填)', + 'adv_edit_style_text_link_comment' => '请输入文字广告指向的 URL 链接地址。注意:站外的地址必须以http://开头', + 'adv_edit_style_text_size' => '文字大小(选填)', + 'adv_edit_style_text_size_comment' => '请输入文字广告的内容显示字体,可使用 pt、px、em 为单位', + 'adv_edit_style_custom' => '自定义', + 'adv_edit_style_image' => '图片广告', + 'adv_edit_style_image_url' => '图片地址(必填)', + 'adv_edit_style_image_url_comment' => '请输入图片广告的图片调用地址', + 'adv_edit_style_image_link' => '图片链接(必填)', + 'adv_edit_style_image_link_comment' => '请输入图片广告指向的 URL 链接地址', + 'adv_edit_style_image_width' => '图片宽度(选填)', + 'adv_edit_style_image_width_comment' => '请输入图片广告的宽度,单位为像素', + 'adv_edit_style_image_height' => '图片高度(选填)', + 'adv_edit_style_image_height_comment' => '请输入图片广告的高度,单位为像素', + 'adv_edit_style_image_alt' => '图片替换文字(选填)', + 'adv_edit_style_image_alt_comment' => '请输入图片广告的鼠标悬停文字信息', + 'adv_edit_style_image_size' => '图片推荐大小', + 'adv_edit_style_image_size_comment' => '您可以选择我们推荐给您的尺寸也可以自定义尺寸', + 'adv_edit_style_flash' => 'Flash 广告', + 'adv_edit_style_flash_url' => 'Flash 地址(必填)', + 'adv_edit_style_flash_url_comment' => '请输入 Flash 广告的调用地址', + 'adv_edit_style_flash_size' => 'Flash 推荐大小', + 'adv_edit_style_flash_size_comment' => '您可以选择我们推荐给您的尺寸也可以自定义尺寸', + 'adv_edit_style_flash_width' => 'Flash 宽度(必填)', + 'adv_edit_style_flash_width_comment' => '请输入 Flash 广告的宽度,单位为像素', + 'adv_edit_style_flash_height' => 'Flash 高度(必填)', + 'adv_edit_style_flash_height_comment' => '请输入 Flash 广告的高度,单位为像素', + 'adv_edit_position_thread' => '广告投放位置', + 'adv_edit_position_thread_comment' => '文章内容上方和下方的广告适合使用文字形式,而文章右侧广告适合使用图片或 Flash 形式,也可以同时显示多条文字广告', + 'adv_edit_display_position' => '广告显示位置', + 'adv_edit_display_position_comment' => '选项 #1 #2 #3 ... 表示文章顺序,可以按住 CTRL 多选', + 'adv_edit_position_footerbanner' => '广告投放位置', + 'adv_edit_position_footerbanner_comment' => '分为上中下 3 个位置,当上面的广告到期或被删除,下面的广告会自动上移', + 'adv_setting_advexpiration' => '广告到期提醒', + 'adv_setting_advexpiration_comment' => '是否需要在广告即将到期前发送消息提醒广告管理员', + 'adv_setting_advexpiration_day' => '到期前多少天提醒', + 'adv_setting_advexpiration_method' => '提醒发送方式', + 'adv_setting_advexpiration_method_email' => 'Email 方式', + 'adv_setting_advexpiration_method_notice' => '站内提醒方式', + 'adv_setting_advexpiration_users' => '提醒接收人', + 'adv_setting_advexpiration_users_comment' => '设置接收提醒的广告管理员,每个填写用户名一行', + + 'runwizard_small' => '小', + 'runwizard_midding' => '中', + 'runwizard_big' => '大', + 'runwizard_low' => '低', + 'runwizard_high' => '高', + 'runwizard_concision' => '简洁', + 'runwizard_commonly' => '一般', + 'runwizard_abundance' => '丰富', + 'runwizard_tips' => '
          • 快速设置向导将帮助您最快速的设置您的论坛;
          • 只有在第四步您确认后,所有的设置才会生效;
          • 如果您已经运行过本向导或自行配置过论坛,运行本向导将覆盖您已经设置的相关参数。
          • ', + 'runwizard_step_1' => '设置论坛类型', + 'runwizard_step_2' => '填写论坛基本信息', + 'runwizard_step_3' => '批量增加版块', + 'runwizard_step_4' => '确认', + 'runwizard_forum_scope' => '论坛规模', + 'runwizard_forum_scope_small' => '小型 (15分钟,在线人数 < 500)', + 'runwizard_forum_scope_midding' => '中型 (15分钟,在线人数 < 6000)', + 'runwizard_forum_scope_big' => '大型 (15分钟,在线人数 > 6000)', + 'runwizard_security' => '权限控制', + 'runwizard_security_high' => '严格 (比较严格的权限体系,适用于对会员权限有较高要求的论坛)', + 'runwizard_security_midding' => '一般 (限制用户的部分操作,适用于绝大部分论坛)', + 'runwizard_security_low' => '宽松 (开放较多权限给会员,适用于对权限要求不是很严格的论坛)', + 'runwizard_hobby' => '功能偏好', + 'runwizard_hobby_concision' => '简洁 (关闭娱乐和部分消耗系统资源功能,追求论坛效率首选)', + 'runwizard_hobby_commonly' => '一般 (按照标准论坛需求设置,可满足一般论坛日常需求,效率和功能比较平衡)', + 'runwizard_hobby_abundance' => '丰富 (开启所有站点功能,论坛会员有较好使用体验,较前两种模式占用服务器资源略高一些)', + + 'runwizard_size_0' => '小', + 'runwizard_size_1' => '中', + 'runwizard_size_2' => '大', + 'runwizard_safe_0' => '低', + 'runwizard_safe_1' => '中', + 'runwizard_safe_2' => '高', + 'runwizard_func_0' => '简洁', + 'runwizard_func_1' => '一般', + 'runwizard_func_2' => '丰富', + 'runwizard_cat' => '分区', + 'runwizard_forum' => '版块', + 'runwizard_forum_initialization' => '以下为您的论坛初始化信息', + 'runwizard_forum_add' => '新增版块', + 'runwizard_succeed' => '恭喜,设置完毕!接下来,您可以进行如下操作:', + 'runwizard_particular' => '详细设置', + 'runwizard_database_backup' => '我们建议您定期备份数据:', + + 'upgrade_tips' => '
          • 在线升级前,请确认您已经备份程序及数据库
          • ', + + + 'cplog_home' => '管理中心首页', + 'cplog_runwizard' => '快速设置向导', + + 'cplog_setting_basic' => '站点信息', + 'cplog_setting_access' => '注册与访问控制', + 'cplog_setting_styles' => '界面设置', + 'cplog_setting_seo' => '搜索引擎优化', + 'cplog_setting_cachethread' => '论坛页面缓存设置', + 'cplog_setting_serveropti' => '服务器优化', + 'cplog_setting_functions' => '站点功能', + 'cplog_setting_permissions' => '用户权限', + 'cplog_setting_credits' => '积分设置', + 'cplog_setting_mail' => '邮件设置', + 'cplog_setting_sec' => '安全验证设置', + 'cplog_setting_datetime' => '时间设置', + 'cplog_setting_attach' => '上传设置', + 'cplog_setting_imgwater' => '水印设置', + 'cplog_setting_wap' => 'WAP 设置', + 'cplog_setting_uc' => 'UCenter 设置', + + 'cplog_forums' => '版块管理', + 'cplog_forums_merge' => '版块合并', + 'cplog_forums_edit' => '编辑版块', + 'cplog_forums_delete' => '删除版块', + 'cplog_forums_moderators' => '增减版主', + 'cplog_forums_copy' => '论坛设置复制', + + 'cplog_threadtypes' => '主题分类', + 'cplog_threadtypes_type' => '分类信息类别', + 'cplog_threadtypes_option' => '分类信息选项', + + 'cplog_members' => '用户管理', + 'cplog_members_add' => '添加用户', + 'cplog_members_ban' => '禁止用户', + 'cplog_members_group' => '编辑用户组', + 'cplog_members_access' => '设置用户权限', + 'cplog_members_medal' => '颁发/收回用户勋章', + 'cplog_members_credit' => '编辑会员积分', + 'cplog_members_edit' => '用户详细设置', + 'cplog_profilefields' => '用户栏目定制', + 'cplog_members_ipban' => '禁止IP', + 'cplog_members_newsletter' => '站点通知', + 'cplog_members_confermedal' => '道具赠送', + 'cplog_members_reward' => '积分奖惩', + 'cplog_members_clean' => '用户清理', + + 'cplog_moderate_members_mod' => '审核用户', + 'cplog_moderate_members_del' => '清理等待验证用户', + 'cplog_moderate_threads' => '审核新主题', + 'cplog_moderate_replies' => '审核新回复', + 'cplog_recyclebin' => '主题回收站', + 'cplog_recyclebinpost' => '回帖回收站', + + 'cplog_usergroups' => '用户组操作', + 'cplog_admingroups' => '管理组操作', + + 'cplog_styles' => '风格管理', + 'cplog_templates' => '模板管理', + 'cplog_templates_add' => '添加模板', + 'cplog_templates_edit' => '编辑模板', + 'cplog_templates_copy' => '模板复制', + + 'cplog_announce' => '站点公告', + 'cplog_announce_add' => '添加公告', + 'cplog_announce_edit' => '编辑公告', + + 'cplog_misc_link' => '友情链接', + 'cplog_misc_onlinelist' => '在线列表图标', + 'cplog_misc_censor' => '词语过滤', + 'cplog_misc_bbcode' => 'Discuz! 代码', + 'cplog_misc_attachtype' => '附件类型尺寸', + 'cplog_misc_cron' => '计划任务', + 'cplog_misc_tag' => '标签管理', + 'cplog_icon' => '主题图标', + 'cplog_smilies' => '表情管理', + 'cplog_faq_list' => '论坛帮助', + 'cplog_faq_detail' => '论坛帮助', + + 'cplog_plugins_list' => '插件列表', + 'cplog_plugins_export' => '插件导出', + 'cplog_plugins_import' => '插件导入', + 'cplog_plugins_config' => '插件管理', + 'cplog_plugins_edit' => '设计插件', + 'cplog_plugins_hooks' => '插件嵌入点管理', + 'cplog_plugins_vars' => '插件变量管理', + 'cplog_medals' => '勋章管理', + 'cplog_magics_config' => '道具配置', + 'cplog_magics_magic' => '道具管理', + 'cplog_magics_add' => '添加道具', + 'cplog_magics_edit' => '编辑道具', + 'cplog_magics_market' => '道具市场', + 'cplog_tasks' => '站点任务', + + 'cplog_ecommerce_alipay' => '支付宝设置', + 'cplog_ecommerce_tenpay' => '财付通设置', + 'cplog_ecommerce_orders' => '积分充值订单', + 'cplog_setting_ec' => '电子商务基本设置', + 'cplog_ecommerce_ec_credit' => '信用评级体系', + 'cplog_tradelog' => '商品交易订单', + + 'cplog_database_export' => '数据备份', + 'cplog_database_import' => '数据恢复', + 'cplog_database_importzip' => '资料恢复', + 'cplog_database_runquery' => '数据库升级', + 'cplog_database_optimize' => '数据表优化', + 'cplog_database_dbcheck' => '数据库校验', + + 'cplog_attach' => '编辑附件', + 'cplog_counter' => '更新论坛统计', + 'cplog_threads' => '论坛主题管理', + 'cplog_prune' => '批量删帖', + 'cplog_jswizard' => '数据调用', + 'cplog_project' => '站点方案管理', + 'cplog_project_add' => '添加站点方案', + 'cplog_project_apply' => '站点方案应用', + + 'cplog_logs_illegal' => '密码错误记录', + 'cplog_logs_rate' => '用户评分记录', + 'cplog_logs_credits' => '积分交易记录', + 'cplog_logs_mods' => '版主管理记录', + 'cplog_logs_medals' => '勋章颁发记录', + 'cplog_logs_ban' => '禁止用户记录', + 'cplog_logs_cp' => '后台访问记录', + 'cplog_logs_magic' => '道具操作记录', + 'cplog_logs_invite' => '邀请注册记录', + 'cplog_logs_error' => '系统错误记录', + + 'cplog_tools_updatecache' => '更新缓存', + 'cplog_tools_relatedtag' => '标签聚合', + 'cplog_tools_fileperms' => '文件权限检查', + + 'cplog_checktools_hookcheck' => '嵌入点校验', + 'cplog_checktools_filecheck' => '文件校验', + 'cplog_checktools_ftpcheck' => '检测远程附件设置', + 'cplog_checktools_mailcheck' => '检测邮件发送设置', + 'cplog_checktools_imagepreview' => '预览图片附件设置效果', + + 'cplog_advertisements' => '站点广告', + 'cplog_advertisements_advadd' => '添加广告', + 'cplog_advertisements_advedit' => '编辑广告', + + 'cplog_upgrade' => '程序更新', + 'cplog_upgradedown' => '程序更新', + 'cplog_upgradeopenbbs' => '程序更新', + 'cplog_logout' => '退出管理', + + 'article' => '文章管理', + 'article_id' => '文章 ID', + 'article_add' => '发布文章', + 'article_trash' => '回收站', + 'article_url' => '文章链接', + 'article_pic' => '文章图片', + 'article_pre' => '前缀', + 'article_summary' => '简介', + 'article_list' => '文章列表', + 'article_title' => '文章标题', + 'article_delete' => '移入回收站', + 'article_optrash' => '移入回收站', + 'article_opmove' => '移到分类', + 'article_category' => '频道栏目', + 'article_dateline' => '发布时间', + 'article_uid' => '作者 UID', + 'article_username' => '作者', + 'article_trash_list' => '回收站文章列表', + 'article_trash_delete' => '彻底删除', + 'article_trash_recover' => '恢复文章', + 'article_tag' => '聚合标签', + 'article_tag_tip' => '
          • 文章内置 8 个标签,在文章类模块调用数据时可以通过指定标签来聚合文章
          • 您可以为这 8 个标签设定显示名称
          • ', + 'article_tag_setting' => '设置标签显示名称', + 'article_clear_trash' => '清空回收站', + 'article_clear_trash_confirm' => '确定要清空回收站吗', + + 'diytemplate'=> '页面管理', + 'diytemplate_perm_tips' => '
          • 此处设置的用户权限将作用于此页面所有 DIY 添加的模块(模块不继承所在页面权限除外)
          • 模块是否继承所在页面权限和单个模块的权限的设置在“模块管理”=>“管理权限”中设置
          • 1、权限由小到大(模块的权限大于所在页面的权限);2、权限"允许管理"即可以管理模块属性又可以管理模块数据;
            3、权限"允许推送"且非"推送需要审核"可以管理模块数据; 4、权限"允许推送"且"推送需要审核"可以推送但不可以管理模块数据
          • ', + 'diytemplate_name'=> '页面名称', + 'diytemplate_name_comment'=> '使用些模板的页面的名称', + 'diytemplate_targettplname'=> '生成模板', + 'diytemplate_targettplname_comment'=> 'DIY 完成以后生成模板的路径', + 'diytemplate_primaltplname'=> '原模板', + 'diytemplate_primaltplname_comment'=> 'DIY 原模板的路径', + 'diytemplate_dateline'=> '更新时间', + 'diytemplate_dateline_comment'=> 'DIY 最后一次更新时间', + 'diytemplate_list'=> '页面列表', + 'diytemplate_path' => '路径:', + 'diytemplate_perm' => '模块权限', + 'diytemplate_uid' => '修改者 ID', + 'diytemplate_username' => '修改者名字', + 'diytemplate_username_comment' => 'DIY 最后一次修改者名字', + 'diytemplate_edit' => '页面编辑', + 'diytemplate_edit_succeed' => '数据更新功能', + 'diytemplate_perm_edit' => '模块权限', + 'diytemplate_perm_update_succeed' => '页面权限更新成功 ', + 'diytemplate_targettplname_error' => '生成模板名称错误', + 'diytemplate_share' => '共享模板', + 'diytemplate_alone' => '独立模板', + 'diytemplate_permname' => '用户名', + 'diytemplate_permname_tips' => '此用户名可管理模块', + 'diytemplate_the_username_has_not_template' => '没有可管理的页面,请返回', + + 'portalcategory_article_perm_tips' => '
          • 添加的用户名所在的用户组需要拥有“允许参与管理文章”的权限
          • 只添加用户名,不选择任何权限可实现此用户可以发布/管理上级频道栏目,但不可以发布/管理此频道栏目(要求此频道栏目继承上级权限,并且上级权限中有此用户名)
          • 权限判断的规则:由小到大(子频道栏目的权限大于父频道栏目的权限)
          • ', + 'portalcategory_catname' => '栏目名称', + 'portalcategory_domain' => '域名', + 'portalcategory_is_closed' => '启用', + 'portalcategory_is_closed_comment' => '选择否只有管理员可以查看该频道', + 'portalcategory_shownav' => '在导航显示', + 'portalcategory_shownav_comment' => '选择是将在主导航中显示', + 'portalcategory_allowcomment' => '评论', + 'portalcategory_allowcomment_comment' => '设置此频道下的文章是否允许评论', + 'portalcategory_noantitheft' => '关闭防采集', + 'portalcategory_noantitheft_comment' => '关闭防采集功能可节省少量服务器资源,建议灌水类频道关闭防采集功能。', + 'portalcategory_perm' => '模块权限', + 'portalcategory_detail' => '频道详细设置', + 'portalcategory_upname' => '上级频道', + 'portalcategory_dateline' => '创建时间', + 'portalcategory_username' => '创建者', + 'portalcategory_filewrite_error' => '写文件错误,请确定程序有网站根目录的写权限', + 'portalcategory_foldername_is_empty' => '目录名不能为空', + 'portalcategory_foldername_rename_error' => '目录重命名失败,目录名只能包含字母、数字和下划线(_),请确认目录名的合法性', + 'portalcategory_foldername_invalid' => '目录名只能包含字母、数字和下划线(_),请确认目录名的合法性', + 'portalcategory_foldername' => '目录名称', + 'portalcategory_foldername_comment' => '当您要为此频道绑定目录或顶级频道绑定域名时请输入此频道要生成的文件夹名称(只能使用字母、数字、下划线)
            要求网站根目录有写的权限,会在网站根目录下生成相应文件夹
            设置为空将删除所建立的目录', + 'portalcategory_summary' => 'description', + 'portalcategory_summary_comment' => 'description内容用于搜索引擎优化,放在 meta 的 description 标签中', + + 'portalcategory_keyword' => 'keywords', + 'portalcategory_keyword_comment' => 'keywords用于搜索引擎优化,放在 meta 的 keyword 标签中,多个关键字间请用半角逗号 "," 隔开', + 'portalcategory_seotitle' => 'title', + 'portalcategory_url' => '自定义链接地址', + 'portalcategory_url_comment' => '定义要跳转的链接地址', + 'portalcategory_listprimaltplname' => '列表页模板名', + 'portalcategory_listprimaltplname_comment' => '将模板文件上传到模板目录的portal目录下,如:template/default/portal目录下,文件名必须为list_*.htm,*为自定义文件名
            如果要重新选择模板,请确保新模板与原模板中可拖拽区域具有相同的 ID,否则将会丢失部分或全部原 DIY 数据', + 'portalcategory_viewprimaltplname' => '文章页模板名', + 'portalcategory_viewprimaltplname_comment' => '将模板文件上传到模板目录的portal目录下,如:template/default/portal目录下,文件名必须为view_*.htm,*为自定义文件名
            如果要重新选择模板,请确保新模板与原模板中可拖拽区域具有相同的 ID,否则将会丢失部分或全部原 DIY 数据', + 'portalcategory_domain_duplicate' => '频道二级域名不能重复', + 'portalcategory_parentfoldername_empty' => '父级频道的目录名不能为空,请先设置父级频道的目录', + 'portalcategory_foldername_duplicate' => '指定的目录已经存在,请更换其它的目录名', + 'portalcategory_edit_nopermission' => '您没有权限创建或编辑频道', + 'portalcategory_additional_content' => '附加内容', + 'portalcategory_useheader' => '站点导航', + 'portalcategory_usefooter' => '站点尾部信息', + 'portalcategory_inheritancearticle' => '继承上级文章管理权限', + 'portalcategory_inheritancearticle_comment' => '是否继承上级文章管理权限,包括发布文章和管理文章的权限', + 'portalcategory_inheritanceblock' => '继承上级模块管理权限', + 'portalcategory_inheritanceblock_comment' => '是否继承上级模块管理权限,包括页面 DIY 权限和模块管理权限', + 'portalcategory_allowpublish' => '发布文章', + 'portalcategory_allowpublish_comment' => '设置此频道下是否允许发布文章', + 'portalcategory_edit_succeed' => '频道栏目编辑成功 ', + 'portalcategory' => '频道栏目', + 'portalcategory_addcategory' => '添加频道', + 'portalcategory_addsubcategory' => '添加频道子栏目', + 'portalcategory_addthirdcategory' => '添加三级频道栏目', + 'portalcategory_inheritance' => '继承上级权限', + 'portalcategory_name' => '分类名称', + 'portalcategory_delete' => '提交', + 'portalcategory_move' => '转移', + 'portalcategory_articles' => '文章数', + 'portalcategory_perm_comment' => '允许评论', + 'portalcategory_subcategory_moveto' => '该分类下的子分类', + 'portalcategory_subcategory_moveto_trash' => '直接删除', + 'portalcategory_subcategory_moveto_parent' => '移动到上一级分类', + 'portalcategory_article' => '该分类下的文章', + 'portalcategory_article_op' => '文章操作', + 'portalcategory_article_delete' => '直接删除', + 'portalcategory_article_moveto' => '该分类下的文章移动到', + 'portalcategory_articleperm' => '权限', + 'portalcategory_blockperm' => '模块权限', + 'portalcategory_articlemanagement' => '管理', + 'portalcategory_perm_edit' => '编辑分类权限', + 'portalcategory_perm_publish' => '发布文章', + 'portalcategory_perm_manage' => '管理文章', + 'portalcategory_perm_update_succeed' => '权限更新成功', + 'portalcategory_has_no_allowauthorizedarticle' => '指定的用户名不存在', + 'portalcategory_publish' => '发布', + 'portalcategory_parentcategory_no_shownav' => '上级频道栏目没有设置为导航显示,请先设置上级频道', + 'portalcategory_indextplname' => '频道空白模板(需 DIY 添加内容)', + 'portalcategory_listtplname' => '文章列表模板', + 'portalcategory_viewtplname' => '文章内容模板', + 'portalcategory_listoneranktplname' => '文章分类单列模板', + 'portalcategory_listtworanktplname' => '文章分类两列模板', + 'portalcategory_notshowarticlesummay' => '文章内容页显示摘要', + 'portalcategory_notshowarticlesummay_comment' => '设置此频道下的文章内容页是否显示摘要', + 'portalcategory_perpage' => '列表每页显示文章数', + 'portalcategory_maxpages' => '列表最大分页数', + 'portalcategory_viewpage' => '文章内容页', + 'portalcategory_inheritupsetting' => '继承上级设置', + 'diy_template_filename_invalid' => 'DIY模板名不正确', + 'diy_tpldirectory_invalid' => 'DIY模板目录不正确', + 'diy_template_extension_invalid' => '模板文件扩展名不正确', + 'diy_template_noexist' => '模板文件不存在', + 'diy_sign_invalid' => 'DIY模板数据验证错误', + + 'portalpermission' => '权限列表', + 'portalpermission_article' => '文章权限', + 'portalpermission_template' => '页面权限', + 'portalpermission_block' => '模块权限', + 'portalpermission_no_inherited' => '非继承权限', + + 'blogcategory' => '日志分类', + 'blogcategory_addcategory' => '添加分类', + 'blogcategory_addsubcategory' => '添加子分类', + 'blogcategory_addthirdcategory' => '添加三级分类', + 'blogcategory_name' => '分类名称', + 'blogcategory_num' => '日志数', + 'blogcategory_subcategory_moveto' => '该分类下的子分类', + 'blogcategory_subcategory_moveto_trash' => '直接删除', + 'blogcategory_subcategory_moveto_parent' => '移动到上一级分类', + 'blogcategory_article_moveto' => '该分类下的日志移动到', + 'blogcategory_blog_moveto' => '分类移动到', + + 'albumcategory' => '相册分类', + 'albumcategory_addcategory' => '添加分类', + 'albumcategory_addsubcategory' => '添加子分类', + 'albumcategory_addthirdcategory' => '添加三级分类', + 'albumcategory_name' => '分类名称', + 'albumcategory_num' => '相册数', + 'albumcategory_subcategory_moveto' => '该分类下的子分类', + 'albumcategory_subcategory_moveto_trash' => '直接删除', + 'albumcategory_subcategory_moveto_parent' => '移动到上一级分类', + 'albumcategory_article_moveto' => '该分类下的相册移动到', + + 'system_category_stat' => '开启系统分类', + 'system_category_required' => '系统分类必填', + + 'blockstyle' => '模块模板', + 'blockstyle_add' => '添加模板', + 'blockstyle_add_tips' => '
          • 您可以使用[loop]...[/loop]标签来循环显示模块中的数据;如果要在模板中多处循环可以使用[loop1]...[/loop1]的方式扩展(只能扩展1-9个)
          • 您可以使用[order=N]...[/order]标签来替代默认loop中的第N个位置数据的展示,您可以使用[order1=N]...[/order1]的方式来扩展(对应[loop1])
          • 您可以使用[index=N]...[/index]的方式来指定第N条数据的展示方式,由该语法指定的数据不再在loop循环中出现,可以通过[index1]...[/index1]的方式来扩展(只能扩展1-9个)以实现同一条数据多处展示
          • 您可以使用可生成缩略图的图片标签/可指定打开方式的链接,并在生成模块时指定缩略图大小/链接打开方式
          • 某些模块(如静态模块)内容是由数据源生成的,不需要对应模板
          • 字段项(如:{title})只在[loop]、[order]、[index]标签内生效
          • ', + 'blockstyle_id' => '模板 ID', + 'blockstyle_list' => '模板列表', + 'blockstyle_blockclass' => '模块分类', + 'blockstyle_blockclass_sel' => '选择模块分类', + 'blockstyle_name' => '模板名称', + 'blockstyle_template' => '模板内容', + 'blockstyle_preview' => '模板预览', + 'blockstyle_makethumb' => '生成缩略图', + 'blockstyle_delete' => '删除', + 'blockstyle_edit' => '编辑', + 'blockstyle_delete_tips' => '
          • 此模板正被某些模块使用,所以不建议您删除它
          • 如果一定删除,您可以为这些模块选择一个新模板
          • ', + 'blockstyle_moveto' => '为使用此模板的模块选择一个新模板', + 'blockstyle_add_blockclass' => '模块分类', + 'blockstyle_add_name' => '模板名称', + 'blockstyle_add_preview' => '模板预览', + 'blockstyle_add_makethumb' => '生成缩略图', + 'blockstyle_add_template' => '模板', + 'blockstyle_add_addstyle' => '添加模块模板', + 'blockstyle_add_editstyle' => '编辑模块模板', + 'blockstyle_add_index' => '特殊指定数据显示内容', + 'blockstyle_add_loop' => '默认循环内容', + 'blockstyle_add_order' => '替代对应loop中指定数据内容,[order=odd]为奇数行,[order=even]为偶数行', + 'blockstyle_add_urltitle' => '带链接的标题', + 'blockstyle_add_picthumb' => '可生成缩略图的图片', + 'blockstyle_add_currentorder' => '当前数据顺序', + 'blockstyle_add_moreurl' => '更多链接', + 'blockstyle_add_parity' => '当前数据是否在奇数行', + + 'blockxml' => '第三方模块', + 'blockxml_tips' => '
          • 插件开发人员在设计新的第三方模块前请务必仔细阅读《Discuz! 技术文档》中的内容。
          • ', + 'blockxml_list' => '第三方模块列表', + 'blockxml_name' => '模块名称', + 'blockxml_signtype_no' => '不使用签名', + 'blockxml_signtype_md5' => 'MD5签名', + 'blockxml_xmlurl' => '第三方地址', + 'blockxml_xmlurl_comment' => '输入 第三方模块的 URL 地址,第三方返回的内容必须 XML 模块的格式', + 'blockxml_clientid' => '客户端ID', + 'blockxml_clientid_comment' => '此ID由数据源方提供', + 'blockxml_xmlkey' => '通信密钥', + 'blockxml_xmlkey_comment' => '从 URL 地址获得数据时的密钥,如果数据源不需要密钥可以为空。此密钥由数据源方提供', + 'blockxml_signtype' => '签名加密方式', + 'blockxml_signtype_comment' => '目前支持MD5加密方式,也可以不使用签名,由数据源方提供', + 'blockxml_update' => '更新', + 'blockxml_edit' => '编辑 第三方模块', + 'blockxml_add' => '添加 第三方模块', + 'blockxml_import_ignore_version' => '允许添加老版本 Discuz! 的 第三方模块(易产生错误!!)', + 'blockxml_xmlurl_update_succeed' => '第三方模块更新成功 ', + 'blockxml_xmlurl_delete_confirm' => '确定要删除此 第三方模块吗?', + 'blockxml_xmlurl_delete_succeed' => ' 第三方模块删除成功 ', + 'blockxml_xmlurl_add_succeed' => ' 第三方模块添加成功 ', + 'blockxml_import_version_invalid' => '版本号不匹配,当前版本:{cur_version},系统版本:{set_version}', + 'CLIENT_NOT_EXISTS' => '客户端不存在', + 'SIGN_ERROR' => '数据签名错误', + 'NO_OPERATION' => '未定义的操作', + + 'block' => '模块管理', + 'block_id' => '模块 ID', + 'block_list' => '模块列表', + 'block_jscall' => '数据调用', + 'block_add_jscall' => '添加调用', + 'block_name' => '模块标识', + 'block_permname' => '用户名', + 'block_permname_tips' => '此用户名可管理模块', + 'block_the_username_has_not_block' => '没有可管理的模块,请返回', + 'block_blockclass' => '模块分类', + 'block_blockclass_sel' => '选择模块分类', + 'block_style' => '模块模板', + 'block_dateline' => '更新时间', + 'block_dateline_null' => '尚未更新', + 'block_delete' => '删除模块', + 'block_clear_unused' => '清除未使用模块', + 'block_name_null' => '[未填写]', + 'block_templatecall' => '模板调用', + 'block_script' => '数据来源', + 'block_setting' => '属性', + 'block_update' => '更新', + 'block_data' => '数据', + 'block_copycode_inner' => '内部调用', + 'block_copycode_outer' => '外部调用', + 'block_copycode_message' => '请复制(CTRL+C)以下内容并添加到模板中', + 'block_copycode_jsmessage' => '请复制(CTRL+C)以下内容并添加到 HTML 文件中', + 'block_page' => '所在页面', + 'block_page_single' => '单独页', + 'block_page_pub' => '公共页', + 'block_page_unused' => '未使用', + 'block_page_nopage' => '无所在页面', + 'block_perm' => '模块权限', + 'block_perm_edit' => '编辑模块权限', + 'block_perm_inheritance' => '继承所在页面权限', + 'block_perm_manage' => '允许管理', + 'block_perm_recommend' => '允许推送', + 'block_perm_needverify' => '推送需要审核', + 'block_perm_update_succeed' => '权限更新成功', + 'block_has_no_allowauthorizedblock' => '指定的用户名不存在', + 'block_choose_blockclass_to_add_jscall' => '请先选择模块分类', + 'block_diytemplate' => '所属页面', + 'block_perm_tips' => '
          • 不选择继承所在页面的权限,所在页面的权限设置将不会作用于此模块
          • 只添加用户名,不选择任何权限可实现此用户可以管理所在页面其它模块,但不可以管理此模块(要求此模块继承所在页面权限,并且所在页面权限中有此用户名)
          • 1、权限由小到大(模块的权限大于所在页面的权限);2、权限"允许管理"即可以管理模块属性又可以管理模块数据;
            3、权限"允许推送"且非"推送需要审核"可以管理模块数据; 4、权限"允许推送"且"推送需要审核"可以推送但不可以管理模块数据
          • ', + 'block_not_exists' => '指定的模块不存在', + 'block_perm_inherited' => '继承自', + + 'topic' => '专题管理', + 'topic_id' => '专题 ID', + 'topic_list' => '专题列表', + 'topic_add' => '创建专题', + 'topic_title' => '专题名称', + 'topic_domain' => '专题域名', + 'topic_name' => '静态化名称', + 'topic_uid' => '创建者 UID', + 'topic_username' => '创建者用户名', + 'topic_closed' => '是否关闭', + 'topic_closed_yes' => '关闭', + 'topic_closed_no' => '开启', + 'topic_edit' => '编辑', + 'topic_delete' => '删除专题', + 'topic_dateline' => '创建时间', + 'topic_creator' => '创建者', + 'topic_perm' => '模块权限', + 'group_thread' => '圈子主题', + 'group_level' => '圈子等级', + 'group_level_title' => '等级名称', + 'group_level_icon' => '等级图标', + 'group_level_creditsrange' => '积分介于', + 'group_level_add' => '增加圈子等级', + 'group_level_tips' => '
          • 圈子等级不宜设置过多。
          • 当允许圈子内发帖等操作影响用户积分时应谨慎,用户有可能通过圈子刷积分。
          • 默认等级图标大小是25 X 25像素。
          • ', + 'group_level_credits' => '积分相关', + 'group_level_credits_post' => '发帖加积分', + 'group_level_credits_reply' => '回复加积分', + 'group_level_credits_digest' => '加精华增加积分', + 'group_level_credits_upload' => '上传附件加积分', + 'group_level_credits_download' => '下载附件扣积分', + 'group_level_credits_trade' => '成功交易加积分', + 'group_level_credits_poll' => '参与投票加积分', + 'group_level_posts' => '文章相关', + 'group_level_special' => '特殊功能', + 'group_level_special_allowchangename' => '允许创始人改圈子名', + 'group_level_special_allowchangetype' => '允许创始人更改圈子分类', + 'group_level_special_allowclose' => '允许创始人关闭圈子', + 'group_level_special_allowthreadtype' => '允许设置主题分类', + 'group_level_special_membermax' => '圈子最大成员数', + + 'group_userperm_moderator' => '圈主', + 'group_userperm_upload_banner' => '上传圈子顶部图片', + 'group_userperm_others' => '其它权限', + + 'postsplit' => '文章分表', + 'postsplit_name' => '分表', + 'postsplit_select' => '选择分表', + 'postsplit_from' => '分表来源', + 'postsplit_to' => '目标表', + 'postsplit_create' => '创建新表', + 'postsplit_manage_tips' => '
          • 进行文章分表前一定要先关闭站点,为防止分表操作过程中出现问题,必须做好数据库备份后再进行此操作
          • 文章数据转移完毕会对源文章表进行表优化操作,优化表所耗时间比较长,在这期间绝对不能重起服务器或者停止MySQL服务
          • forum_post(主表)必须保留300M的数据
          • 文章分表功能可以将文章分在不同的数据表中,适合文章数很多并且运行效率受到影响的站点使用
          • ', + 'postsplit_move_tips' => '
          • 文章移动涉及大量的数据转移,请关闭论坛后使用
          • 为防止数据库在移动过程中出现问题,请先进行数据备份。
          • 按条件搜索出要移动的主题帖,然后选择目标分表。
          • 移动操作可能需要一段时间,请耐心等待。
          • ', + 'postsplit_manage' => '分表管理', + 'postsplit_move' => '文章移动', + 'postsplit_move_to' => '移动到', + 'postsplit_move_size' => '转移数据大小', + 'postsplit_move_tidrange' => 'tid 范围', + 'postsplit_manage_datalength' => '数据大小', + 'postsplit_manage_indexlength' => '索引大小', + 'postsplit_manage_table_createtime' => '表创建时间', + 'postsplit_manage_table_updatetime' => '表更新时间', + 'postsplit_manage_table_memo' => '备注信息', + 'postsplit_manage_postcount' => '文章数', + 'postsplit_manage_tablename' => '分表名称', + 'postsplit_move_per_step' => '每次移动主题帖数量', + 'postsplit_move_thread_table' => '所属分表', + 'postsplit_move_threadtable' => '在以下主题 (thread) 表中检索', + 'postsplit_manage_primary_table' => '主表', + 'postsplit_manage_addition_table' => '副表', + 'postsplit_manage_archive_table' => '存档表', + 'postsplit_manage_primary_table_add' => '添加主表', + 'postsplit_manage_archive_table_add' => '添加存档表', + 'postsplit_manage_update_memo_submit' => '更新备注信息', + 'postsplit_manage_pidreset' => '重置 Post ID', + 'postsplit_move_threads_search_posttable' => '所在分表', + 'postsplit_move_threads_per_time' => '每次移动主题数', + 'postsplit_move_threads_per_time_comment' => '建议不超过 1000', + 'postsplit_move_threads_per_time_250' => '250 (推荐低端服务器、共享主机用户使用)', + 'postsplit_move_threads_per_time_500' => '500 (推荐选项)', + 'postsplit_move_threads_per_time_1000' => '1000 (推荐独立服务器用户使用,可提高处理速度)', + 'postsplit_manage_submit' => '确认分表', + + 'optimizer_security_tips' => '
          • 体检可以帮助您发现网站问题,消除安全风险
          • 设置项安全检测
          • 安装插件安全及更新检测
          • ', + 'optimizer_serversec_tips' => '
          • 体检可以帮助您发现网站底层问题,消除安全风险
          • ', + 'optimizer_performance_tips' => '
          • 体检可以帮助您发现网站性能问题,增强网站性能
          • ', + 'optimizer_check_unit_optimizer_plugin' => '检测应用是否有新的更新', + 'optimizer_check_unit_optimizer_upgrade' => '查看是否有新的产品版本', + 'optimizer_check_unit_optimizer_patch' => '检测产品是有有漏洞补丁发布', + 'optimizer_check_unit_optimizer_thread' => '检测是否需要对主题表进行优化', + 'optimizer_check_unit_optimizer_setting' => '查看是否有设置项可以优化', + 'optimizer_check_unit_optimizer_post' => '检测是否需要对文章表进行优化', + 'optimizer_check_unit_optimizer_dbbackup' => '检测数据是否需要进行备份', + 'optimizer_check_unit_optimizer_filecheck' => '查看是否需要进行文件校验', + 'optimizer_check_unit_optimizer_log' => '查看是否有需要优化清理的日志表', + 'optimizer_check_unit_optimizer_seo' => '检测SEO优化设置', + 'optimizer_check_unit_optimizer_dbbackup_clean' => '检测是否存在未删除的备份文件', + 'optimizer_check_unit_optimizer_dbbackup_visit' => '检测是否存在可访问的备份文件', + 'optimizer_check_unit_optimizer_inviteregister' => '检测允许新用户注册项', + 'optimizer_check_unit_optimizer_emailregister' => '检测通过邮件发送注册连接项', + 'optimizer_check_unit_optimizer_pwlength' => '检测密码最小长度项', + 'optimizer_check_unit_optimizer_regmaildomain' => '检测注册邮箱域名限制', + 'optimizer_check_unit_optimizer_ipregctrl' => '检测限时注册的 IP 列表项', + 'optimizer_check_unit_optimizer_newbiespan' => '检测新手见习期限', + 'optimizer_check_unit_optimizer_editperdel' => '检测允许用户编辑文章时删除文章项', + 'optimizer_check_unit_optimizer_recyclebin' => '检测版块是否开启回收站', + 'optimizer_check_unit_optimizer_forumstatus' => '检测隐藏版块是否设置访问权限', + 'optimizer_check_unit_optimizer_usergroup9' => '检测限制会员用户组权限设置', + 'optimizer_check_unit_optimizer_usergroup4' => '检测禁止发言用户组权限设置', + 'optimizer_check_unit_optimizer_usergroup5' => '检测禁止访问用户组权限设置', + 'optimizer_check_unit_optimizer_usergroup6' => '检测禁止IP用户组权限设置', + 'optimizer_check_unit_optimizer_cloudsecurity' => '检测防水墙设置', + 'optimizer_check_unit_optimizer_attachexpire' => '检测防盗链设置', + 'optimizer_check_unit_optimizer_attachrefcheck' => '检测下载附件来路检查设置', + 'optimizer_check_unit_optimizer_loginpwcheck' => '检测弱密码登录检测是否开启提示或者强制修改密码', + 'optimizer_check_unit_optimizer_loginoutofdate' => '检测异地登录检测是否开启', + 'optimizer_check_unit_optimizer_eviluser' => '检测防水墙违规用户', + 'optimizer_check_unit_optimizer_white_list' => '检测防水墙白名单', + 'optimizer_check_unit_optimizer_security_daily' => '检测是否开启防水墙每日优化计划任务', + 'optimizer_check_unit_optimizer_postqqonly' => '检测发帖需要绑定QQ号检测是否开启', + 'optimizer_check_unit_optimizer_aggid' => '检测“管理员,超级版主,版主”QQ登录检测是否开启', + 'optimizer_check_unit_optimizer_filesafe' => '检测是否有升级或安装残留的文件', + 'optimizer_check_unit_optimizer_remote' => '检测是否有开启了远程调用', + 'optimizer_check_unit_optimizer_dos8p3' => '检测 DOS 8.3 文件名支持是否开启', + 'optimizer_check_unit_optimizer_httphost' => '检测空 HOST 访问是否开启', + + 'domain_topic' => '专题', + 'domain_home' => '个人空间', + 'domain_forum' => '版块', + + 'threadsplit' => '主题分表', + 'threadsplit_manage' => '分表管理', + 'threadsplit_manage_tips' => '
          • 主题分表功能可将 forum_thread 表(包含主题标题、创建时间等信息,但不包含主题及回复内容)分在多个数据表中。
          • 创建新的主题存档表后,可使用主题移动功能将特定主题移动到存档表中。
          • 移动到存档表中的主题,会在主题所在的版块下建立一个存档区(名称可自定义),通过存档区可浏览存档表中的主题。
          • 存档表中的主题,只供浏览,不可回复、评分,不能进行管理操作,但可以删除和移动到非存档区。
          • ', + 'threadsplit_manage_tablename' => '表名', + 'threadsplit_manage_dislayname' => '显示名称', + 'threadsplit_manage_threadcount' => '主题数', + 'threadsplit_manage_datalength' => '数据大小', + 'threadsplit_manage_indexlength' => '索引大小', + 'threadsplit_manage_table_createtime' => '表创建时间', + 'threadsplit_manage_table_updatetime' => '表更新时间', + 'threadsplit_manage_table_memo' => '备注信息', + 'threadsplit_manage_table_orig' => 'thread 主表信息', + 'threadsplit_manage_table_archive' => 'thread 存档表信息', + 'threadsplit_move_tips' => '
          • 主题移动功能可将特定的主题在原始表(forum_thread)和新建的主题存档表之间移动。
          • 移动主题之前,请确定存在至少一个主题存档表(表名为 forum_thread_1、forum_thread_2……)。
          • 通过主题搜索筛选出要移动的主题,再选择目标表,即可完成主题数据的移动。
          • ', + 'threads_search_sourcetable' => '搜索以下 thread 分表', + 'threadsplit_move_tidrange' => 'tid 范围', + 'threadsplit_move_to' => '移动到', + 'threadsplit_manage_table_add' => '添加存档表', + 'threadsplit_manage_update' => '更新表信息', + 'threadsplit_manage_forum_update' => '更新版块存档', + 'threadsplit_move_threads_per_time' => '每次移动主题数', + 'threadsplit_move_threads_per_time_comment' => '建议不超过 1000', + + 'membersplit' => '用户分表', + 'membersplit_check' => '立即检查', + 'membersplit_lasttime_check' => '上次检查', + 'membersplit_has_no_check' => '您的网站从未进行过用户分表', + 'membersplit_without_optimization' => '用户表良好,目前不用分表', + 'membersplit_check_tips' => '
          • 此功能仅限极个别特定需求使用,一般站点不需要此功能。
          • 因检查操作较慢,所以检查的结果会缓存一天的时间
          • ', + 'membersplit_tips' => '
          • 此功能仅限极个别特定需求使用,一般站点不需要此功能。
          • 请根据服务器性能,适当调整单步处理数。
          • 建议在关闭站点下进行分表操作。
          • ', + 'membersplit_combie_count' => '可分表用户数', + 'membersplit_splitnum' => '单步处理数', + 'membersplit_count' => '总用户数', + 'membersplit_table_orig' => '用户表信息', + 'membersplit_archive' => '开始分表', + + 'category_channel' => '基本设置', + 'category_channel_config' => '基本设置', + 'category_channel_open' => '是否开启', + 'category_channel_title' => '名称', + 'category_channel_identifier' => '标识', + 'category_channel_identifier_comment' => '做为改模块的唯一标识,如无必要请勿修改', + + 'category_option' => '选项管理', + 'category_sort' => '分类管理', + 'category_area' => '地区管理', + 'category_counter' => '统计数据', + + 'setting_runtests' => '运行测试用例', + 'setting_runtests_prompt' => '点击确定,开始运行', + + 'connect_menu_setting' => '基本设置', + 'connect_setting_allow' => '开启QQ注册/绑定/登录服务', + 'connect_setting_allow_comment' => 'QQ绑定功能开启后,用户可以通过QQ账号登录站点,以及更多和QQ相关的操作', + 'connect_member_info' => '用户信息', + 'connect_member_bindlog' => 'QQ绑定日志', + 'connect_member_bindlog_type' => '操作', + 'connect_member_bindlog_username' => '用户名', + 'connect_member_bindlog_date' => '日期', + 'connect_member_bindlog_type_1' => '绑定', + 'connect_member_bindlog_type_2' => '解除绑定', + 'connect_member_bindlog_uin' => 'QQ账号绑定日志', + 'connect_member_bindlog_uid' => '用户账号绑定日志', + + 'custommenu_edit_succeed' => '常用操作成功更新', + 'custommenu_add' => '添加常用操作', + 'custommenu_addto' => '添加到常用操作', + + 'import_data_invalid' => '数据无法识别,请返回', + 'import_data_typeinvalid' => '数据类型错误,请返回', + + 'cloudaddons_ftp_setting' => '站点 FTP 设置', + 'cloudaddons_unwriteabledirs' => '
          • 站点 {basedir} 目录下的以下目录不可写,无法在线安装此应用,请将目录设置为可写或填写本站点的 FTP 连接参数(本设置不会被保存):
            {unwriteabledirs}
          • ', + 'cloudaddons_plugin_link' => '获取更多插件', + 'cloudaddons_style_link' => '获取更多模板', + 'cloudaddons_linkto' => '在应用中心查看', + 'plugins_validator_nowupgrade' => '以下插件现在可以更新为新版本,点击安装更新', + 'plugins_validator_newversion' => '以下插件存在新版本,点击安装更新', + 'plugins_validator_error' => '以下插件不是正版插件,点击安装正版插件', + + + 'rewrite_message' => '

            Apache Web Server(独立主机用户)

            +
            +<IfModule mod_rewrite.c>
            +	RewriteEngine On
            +{apache1}</IfModule>
            +
            + +

            Apache Web Server(虚拟主机用户)

            +
            +# 将 RewriteEngine 模式打开
            +RewriteEngine On
            +
            +# 如 www.discuz.vip/bbs/,对应的就是 RewriteBase /bbs/,如果程序放在根目录中,使用 RewriteBase /
            +RewriteBase {siteroot}
            +
            +# Rewrite 系统规则请勿修改
            +{apache2}
            +
            + +

            Nginx Web Server

            +
            +{nginx}
            +
            + +

            IIS Web Server(独立主机用户)

            +
            +[ISAPI_Rewrite]
            +
            +# 3600 = 1 hour
            +CacheClockRate 3600
            +
            +RepeatLimit 32
            +
            +# Protect httpd.ini and httpd.parse.errors files
            +# from accessing through HTTP
            +{iis}
            +
            + +

            IIS7 Web Server(独立主机用户)

            +
            +<rewrite>
            +	<rules>
            +{iis7}	</rules>
            +</rewrite>
            +
            + +

            Lighttpd Web Server

            +
            +url.rewrite-once = (
            +{lighttpd})
            +
            + +

            Caddy Web Server

            +
            +{caddy}
            +
            ', + + 'detect_environment' => '运行环境检测', + 'version_tips' => '关于本版本的温馨提示', + 'version_tips_msg' => '感谢您选择 Discuz! {version} ,您可以查看 发行注记 以了解本版本更新内容。我们建议您尽快进行一次 安全检测 以及 底层安全检测 以尽可能保证站点安全。我已知晓', + 'contributors' => '开源贡献者', + 'contributors_see' => '查看全部贡献者', + 'detect_environment_error' => '你的服务器无法检测新版,请点击查看新版', + 'refresh' => '刷新', + 'qq_group' => 'QQ群:', + 'discuz_news' => 'Discuz! 动态', + 'log_in_to_update' => '暂未获取到动态,请登录 Discuz! 社区 查看。', + 'download_latest' => 'Discuz! X3.5 最新版本下载', + 'org_name' => '腾讯云计算(北京)有限责任公司', + 'dev_manager' => '戴志康 (Kevin \'Crossday\' Day)', + 'app_discussion' => 'Discuz! 交流社区', + 'org_site' => '公司网站', + 'purchase_service' => '购买授权', + 'discussion_area' => 'Discuz! 官方网站', + 'app_center' => 'Discuz! 应用中心', + 'discuz_git' => 'Discuz! 项目地址', +); + +$adminextend = array(); +if(file_exists($adminextendfile = DISCUZ_ROOT.'./data/sysdata/cache_adminextend.php')) { + @include $adminextendfile; + foreach($adminextend as $extend) { + $extend_lang = array(); + @include DISCUZ_ROOT.'./source/language/lang_admincp_'.$extend; + $lang = array_merge($lang, $extend_lang); + } +} + +?> \ No newline at end of file diff --git a/source/language/lang_admincp_login.php b/source/language/lang_admincp_login.php new file mode 100644 index 0000000..dd0fcf8 --- /dev/null +++ b/source/language/lang_admincp_login.php @@ -0,0 +1,52 @@ + 'Discuz!管理中心', + 'login_title' => '登录管理中心', + 'login_username' => '用户名', + 'login_password' => '密码', + 'login_dk_light_mode' => '亮色模式', + 'login_dk_by_system' => '跟随系统', + 'login_dk_normal_mode' => '正常模式', + 'login_dk_dark_mode' => '夜间模式', + + 'submit' => '提交', + 'forcesecques' => '必填项', + 'security_question' => '安全提问', + 'security_answer' => '回答', + 'security_question_0' => '无安全提问', + 'security_question_1' => '母亲的名字', + 'security_question_2' => '爷爷的名字', + 'security_question_3' => '父亲出生的城市', + 'security_question_4' => '您其中一位老师的名字', + 'security_question_5' => '您个人计算机的型号', + 'security_question_6' => '您最喜欢的餐馆名称', + 'security_question_7' => '驾驶执照最后四位数字', + + 'login_tips' => 'Discuz! 是一款以社区为基础的专业建站平台,帮助网站实现一站式服务。', + 'login_nosecques' => '您还没有使用安全登录,请在个人中心设置您的安全提问后,再访问管理中心。您可以 点击这里 进入安全提问的设置。', + 'copyright' => '© 2001-'.date('Y').' Discuz! Team.', + + 'login_cp_guest' => '

            您尚未登录网站

            登录

            站长需要强制登录时,修改 config/config_global.php 可关闭此功能。

            ', + 'login_cplock' => '您的管理面板已经锁定!
            请在 {ltime} 秒以后重新访问管理中心。', + 'login_user_lock' => '由于您的登录密码错误次数过多,本次登录请求已经被拒绝。请 15 分钟后重新尝试。', + 'login_cp_noaccess' => '管理中心(或此项操作)尚未对您开放

            您的此次操作已经记录,请勿非法尝试', + 'login_ip_noaccess' => 'IP变动可能导致登录失败,查看解决办法', + 'noaccess' => '后台管理权限(或此项操作)尚未对您开放,请联系站点管理员', + + +); + +?> \ No newline at end of file diff --git a/source/language/lang_admincp_menu.php b/source/language/lang_admincp_menu.php new file mode 100644 index 0000000..d3e5b81 --- /dev/null +++ b/source/language/lang_admincp_menu.php @@ -0,0 +1,219 @@ + '首页', + 'header_global' => '全局', + 'header_forum' => '论坛', + 'header_user' => '用户', + 'header_topic' => '内容', + 'header_extended' => '运营', + 'header_plugin' => '插件', + 'header_template' => '模板', + 'header_style' => '界面', + 'header_adv' => '广告', + 'header_tools' => '工具', + 'header_uc' => 'UCenter', + 'header_welcome' => '您好', + 'header_logout' => '退出', + 'header_bbs' => '站点首页', + 'header_portal' => '门户', + 'header_group' => '圈子', + 'header_safe' => '安全', + 'header_founder' => '站长', + 'header_cloudaddons' => '应用中心', + + + 'menu_home' => '管理中心首页', + 'menu_home_clearhistorymenus' => '清空历史操作', + + 'menu_setting_basic' => '站点信息', + 'menu_setting_access' => '注册与访问控制', + 'menu_setting_customnav' => '导航设置', + 'menu_setting_styles' => '界面设置', + 'menu_setting_optimize' => '性能优化', + 'menu_setting_seo' => 'SEO设置', + 'menu_setting_functions' => '站点功能', + 'menu_setting_domain' => '域名设置', + 'menu_setting_user' => '用户权限', + 'menu_setting_credits' => '积分设置', + 'menu_setting_mail' => '邮件设置', + 'menu_setting_sec' => '防灌水设置', + 'menu_setting_datetime' => '时间设置', + 'menu_setting_attachments' => '上传设置', + 'menu_setting_imgwater' => '水印设置', + 'menu_setting_uc' => 'UCenter 设置', + 'menu_setting_uchome' => 'UCHome 设置', + 'menu_setting_follow' => '广播设置', + 'menu_setting_home' => '空间设置', + 'menu_setting_search' => '搜索设置', + 'menu_setting_district' => '地区设置', + 'menu_setting_ranklist' => '排行榜设置', + 'menu_setting_mobile' => '手机版设置', + 'menu_setting_tag' => '标签管理', + 'menu_setting_antitheft' => '防采集设置', + 'menu_setting_runtests' => '测试用例', + + 'menu_forums' => '版块管理', + 'menu_forums_merge' => '版块合并', + 'menu_forums_threadtypes' => '主题分类', + 'menu_forums_infotypes' => '分类信息', + 'menu_forums_infooption' => '分类信息选项', + 'menu_grid' => '首页四格', + + 'menu_members_add' => '添加用户', + 'menu_members_edit' => '用户管理', + 'menu_members_newsletter' => '发送通知', + 'menu_members_mobile' => '发送手机通知', + 'menu_members_sms' => '发送手机短信', + 'menu_usertag' => '用户标签', + 'menu_members_edit_ban_user' => '禁止用户', + 'menu_members_ipban' => '禁止 IP', + 'menu_members_credits' => '积分奖惩', + 'menu_members_profile' => '用户栏目', + 'menu_members_profile_group' => '用户栏目分组', + 'menu_members_verify_setting' => '认证设置', + 'menu_members_stat' => '资料统计', + 'menu_moderate_modmembers' => '审核用户', + 'menu_profilefields' => '用户栏目定制', + 'menu_admingroups' => '管理组', + 'menu_usergroups' => '用户组', + 'menu_follow' => '推荐关注', + 'menu_defaultuser' => '推荐好友', + 'menu_members_verify_profile' => '资料审核', + + 'menu_moderate_posts' => '内容审核', + 'menu_moderate_blogs' => '审核日志', + 'menu_moderate_doings' => '审核记录', + 'menu_moderate_pictures' => '审核图片', + 'menu_moderate_shares' => '审核分享', + 'menu_moderate_comments' => '审核评论/留言', + 'menu_moderate_articles' => '审核文章', + 'menu_moderate_articlecomments' => '审核文章评论', + 'menu_maint_threads' => '论坛主题管理', + 'menu_maint_prune' => '论坛批量删帖', + 'menu_maint_attaches' => '论坛附件管理', + 'menu_maint_threads_group' => '圈子主题管理', + 'menu_maint_prune_group' => '圈子批量删帖', + 'menu_maint_attaches_group' => '圈子附件管理', + 'menu_setting_collection' => '淘帖管理', + 'menu_posting_tags' => '标签管理', + 'menu_posting_censors' => '词语过滤', + 'menu_remoderate' => '内容重新审核', + 'menu_maint_report' => '用户举报', + 'menu_threads_forumstick' => '版块/圈子置顶', + 'menu_post_position_index' => '文章优化', + 'menu_postcomment' => '文章点评管理', + 'menu_maint_doing' => '记录管理', + 'menu_maint_blog' => '日志管理', + 'menu_maint_blog_recycle_bin' => '日志回收站', + 'menu_maint_feed' => '动态管理', + 'menu_maint_album' => '相册管理', + 'menu_maint_pic' => '图片管理', + 'menu_maint_comment' => '评论/留言管理', + 'menu_maint_share' => '分享管理', + + 'menu_posting_attachtypes' => '附件类型尺寸', + 'menu_moderate_recyclebin' => '主题回收站', + 'menu_moderate_recyclebinpost' => '回帖回收站', + + 'menu_founder' => '站点信息', + 'menu_founder_perm' => '后台管理团队', + 'menu_founder_groupperm' => '编辑团队职务权限 - {group}', + 'menu_founder_permgrouplist' => '编辑权限 - {perm}', + 'menu_founder_memberperm' => '编辑团队成员 - {username}', + + 'menu_patch' => '安全中心', + 'menu_upgrade' => '在线升级', + 'menu_optimizer' => '优化大师', + 'menu_security' => '安全大师', + 'menu_serversec' => '底层安全', + + 'menu_addons' => '应用中心', + 'menu_plugins' => '插件管理', + 'menu_tasks' => '站点任务', + 'menu_magics' => '道具中心', + 'menu_medals' => '勋章中心', + 'menu_smsgw' => '短信服务', + 'menu_misc_help' => '站点帮助', + 'menu_ec' => '电子商务', + 'menu_card' => '充值卡密', + + 'menu_styles' => '模板管理', + 'menu_styles_templates' => '模板套系管理', + 'menu_templates_add' => '设计新模板', + 'menu_posting_smilies' => '表情管理', + 'menu_click' => '表态动作', + 'menu_thread_icon' => '主题图标', + 'menu_thread_stamp' => '主题鉴定', + 'menu_posting_editor' => '编辑器设置', + 'menu_misc_onlinelist' => '在线列表图标', + + 'menu_misc_link' => '友情链接', + 'menu_misc_relatedlink' => '关联链接', + 'memu_focus_topic' => '站长推荐', + 'menu_adv_custom' => '站点广告', + + 'menu_misc_announce' => '站点公告', + 'menu_tools_updatecaches' => '更新缓存', + 'menu_tools_postposition' => '高楼帖优化', + 'menu_tools_updatecounters' => '更新统计', + 'menu_tools_javascript' => '数据调用', + 'menu_tools_relatedtag' => ' 标签聚合', + 'menu_tools_creditwizard' => '积分策略向导', + 'menu_tools_fileperms' => '文件权限检查', + 'menu_tools_hookcheck' => '嵌入点校验', + 'menu_tools_filecheck' => '文件校验', + 'menu_tools_replacekey' => '密钥更新', + 'menu_db' => '数据库', + 'menu_postsplit' => '文章分表', + 'menu_threadsplit' => '主题分表', + 'menu_membersplit' => '用户分表', + 'menu_logs' => '运行记录', + 'menu_custommenu_manage' => '常用操作管理', + 'menu_misc_cron' => '计划任务', + + 'menu_article' => '文章管理', + 'menu_portalcategory' => '频道栏目', + 'menu_blogcategory' => '日志分类', + 'menu_albumcategory' => '相册分类', + 'menu_block' => '模块管理', + 'menu_blockstyle' => '模块模板', + 'menu_portalpermission' => '权限列表', + 'menu_blockxml' => '第三方模块', + 'menu_topic' => '专题管理', + 'menu_html' => 'HTML管理', + 'menu_diytemplate' => '页面管理', + + 'menu_group_setting' => '圈子设置', + 'menu_group_type' => '圈子分类', + 'menu_group_manage' => '圈子管理', + 'menu_group_userperm' => '圈主权限', + 'menu_group_level' => '圈子等级', + 'menu_group_mod' => '审核圈子', + + 'menu_safe_setting' => '基本设置', + 'menu_safe_security' => '防水墙', + 'menu_safe_seccheck' => '验证设置', + 'menu_safe_accountguard' => '账号保镖', + + 'menu_setting_qqconnect' => 'QQ 绑定设置', + + 'admincp_title' => $_G['setting']['bbname'].' 管理中心', + +); + +?> \ No newline at end of file diff --git a/source/language/lang_admincp_msg.php b/source/language/lang_admincp_msg.php new file mode 100644 index 0000000..476f607 --- /dev/null +++ b/source/language/lang_admincp_msg.php @@ -0,0 +1,701 @@ + '管理组权限设置更新成功 ', + 'albumcategory_move_category_failed' => '无法移动相册到指定分类', + 'albumcategory_delete_succeed' => '删除相册分类成功 ', + 'announce_time_invalid' => '抱歉,您没有输入起始时间或您输入的终止时间不正确', + 'announce_invalid' => '您必须输入公告标题和内容', + 'announce_succeed' => '站点公告成功编辑', + 'article_choose_at_least_one_article' => '请至少选择一篇文章', + 'article_choose_at_least_one_operation' => '请至少选择一个操作', + 'blockstyle_delete_succeed' => '删除模块模板成功 ', + 'blogcategory_move_category_failed' => '无法移动日志到指定分类', + 'blogcategory_delete_succeed' => '删除日志分类成功 ', + 'filecheck_nofound_md5file' => '不存在校验文件,无法进行此操作 {upgradeurl}', + 'replacekey_must_write_config' => 'config_global.php 不可写,无法进行此操作', + 'replacekey_succeed' => '密钥更新成功,请重新登录站点并更新缓存', + 'cloudaddons_download_error' => '数据下载错误({ErrorCode}),点击查看常见问题解决办法', + 'cloudaddons_downloading' => '应用 {addonid} 下载中,请稍候 ......', + 'collection_admin_updated' => '专辑管理操作成功', + 'counter_member_succeed' => '用户发帖数重建完成', + 'credits_update_succeed' => '积分规则更新成功 ', + 'noaccess_isfounder' => '您没有权限访问该设置,出于安全考虑只有站点创始人可以使用,请检查 config/config_global.php 文件内创始人的设置', + 'database_export_multivol_succeed' => '恭喜您,成功创建 {volume} 个备份文件,备份全部完成。

            出于安全考虑,我们强烈建议您下载数据库备份文件后删除文件或设置文件不可通过 URL 访问。

            {filelist}{deletetips}', + 'database_export_zip_succeed' => '数据成功备份并压缩至服务器 {filename}

            出于安全考虑,我们强烈建议您下载数据库备份文件后删除文件或设置文件不可通过 URL 访问。{deletetips}', + 'setting_update_succeed' => '当前设置更新成功 ', + 'setting_domain_http_error' => '请您填写合法的域名,常见错误为以 “http://”、“.”开头或者以“/”、“/index.php”、“.”结尾,或域名包含未转换为 Punycode 的国际化域名等', + 'orders_validate_succeed' => '订单处理成功 ', + 'faq_list_update' => '帮助列表更新成功 ', + 'forums_edit_succeed' => '版块设置更新成功 ', + 'forums_copy_source_invalid' => '您没有选择要复制的源版块', + 'founder_perm_group_name_duplicate' => '团队职务 {name} 已经存在', + 'founder_perm_member_noexists' => '用户不存在或被冻结', + 'founder_perm_member_update_succeed' => '管理团队成员资料已更新成功 ', + 'group_nonexist' => '圈子不存在', + 'grouptype_delete_sub_notnull' => '存在下级分类,请先返回删除本分类或分类的下级圈子', + 'magics_data_succeed' => '道具资料更新成功 ', + 'medals_please_input' => '请选择需要操作的勋章', + 'forums_formulaperm_error' => '权限表达式无效', + 'medals_succeed' => '编辑勋章成功 ', + 'members_no_find_user' => '抱歉,没有搜索到用户', + 'members_no_find_deluser' => '抱歉,没有搜索到需要删除的用户', + 'members_delete_succeed' => '符合条件的 {numdeleted} 个用户被成功删除', + 'members_no_find_unarchiveuser' => '抱歉,没有搜索到需要移出存档表的用户', + 'members_unarchive_succeed' => '符合条件的 {numunarchived} 个用户被成功移出存档表', + 'members_nonexistence' => '请先输入您要进行操作的用户名', + 'members_edit_nonexistence' => '指定用户不存在', + 'undefined_action' => '未定义操作', + 'members_edit_medals_nonexistence' => '目前没有可用的勋章,请到“勋章中心”启用勋章后再进行此操作', + 'members_email_illegal' => 'Email 地址无效', + 'members_email_domain_illegal' => 'Email 包含不可使用的邮箱域名', + 'members_email_duplicate' => '该 Email 地址已经被注册', + 'members_mobile_duplicate' => '该安全手机号已经被注册', + 'members_mobicc_illegal' => '安全手机号国际电话区号格式不正确', + 'members_mobile_illegal' => '安全手机号格式不正确', + 'members_edit_protectedmembers' => 'UCenter受保护用户无法直接编辑', + 'members_edit_succeed' => '用户资料更新成功 ', + 'members_profile_edit_succeed' => '用户栏目更新成功 ', + 'members_stat_update_data_succeed' => '统计数据更新成功 ', + 'members_reward_succeed' => '用户积分奖惩执行成功 ', + 'membersplit_split_must_be_closed' => '请在站点关闭的状态下进行用户分表操作', + 'dzcode_edit_tag_invalid' => '代码标签为空或包含非法字符', + 'dzcode_edit_succeed' => 'Discuz! 代码更新成功 ', + 'censor_keywords_tooshort' => '添加关键词长度过短(少于 3 个字节)', + 'attachtypes_duplicate' => '新增扩展名与现有重复', + 'crons_succeed' => '计划任务更新成功 ', + 'smsgw_succeed' => '短信服务更新成功 ', + 'nav_add_succeed' => '导航栏更新成功 ', + 'nav_not_found' => '导航未找到或类型不符', + 'patch_successful' => '操作成功', + 'templates_edit_name_invalid' => '您没有输入模板名称', + 'templates_edit_identifier_invalid' => '您输入的唯一标识符不合法或与现有模板重复', + 'templates_add_succeed' => '模板已成功添加,请继续完成模板开发', + 'plugin_not_found' => '插件未找到', + 'plugins_install_succeed' => '插件成功安装!
            为了正常使用此插件,您可能还需要上传或修改相应的文件或模板,详情请查看本插件的安装说明

            点击这里返回应用中心
            ', + 'plugin_file_error' => '插件文件缺失', + 'plugins_edit_identifier_invalid' => '您输入的唯一标识符不合法或与现有插件重复', + 'plugins_upgrade_succeed' => '插件成功更新到 {toversion}

            点击这里返回应用中心
            ', + 'plugins_edit_name_invalid' => '您没有输入插件名称', + 'plugins_edit_succeed' => '插件配置更新成功 ', + 'plugins_delete_succeed' => '插件成功卸载!
            为了正常卸载此插件,您可能还需要删除或修改相应的文件或模板,详情请查看本插件的安装说明', + 'portalcategory_move_category_failed' => '无法移动文章到所选分类', + 'portalcategory_delete_succeed' => '删除分类成功 ', + 'portalcategory_catgory_not_found' => '分类不存在或没有选择分类', + 'postsplit_forum_must_be_closed' => '请在站点关闭的状态下进行文章移动操作', + 'postsplit_done' => '数据转移成功,接下来将对源文章表进行优化操作,注意:优化表所耗时间比较长,在这期间绝对不能重起服务器或者停止MySQL服务', + 'postsplit_doing' => '正在转移数据,当前表有{datalength}的数据,还剩{nowdatalength}的数据等待入库', + 'recyclebin_succeed' => '回收站更新成功,共 {threadsdel} 个主题被删除,{threadsundel} 个主题被恢复', + 'search_result_noexists' => '抱歉,没有找到相关设置或管理操作!
            输入多个词语搜索(不同字词之间用一个空格隔开,不区分大小写)可以获得更精确的搜索结果', + 'smilies_directory_invalid' => '表情目录 {smurl} 不存在,您可以通过 FTP 创建目录 {smurl} 并上传相应的表情图片', + 'smilies_edit_succeed' => '表情列表更新成功 ', + 'smilies_type_nonexistence' => '指定的表情分类不存在', + 'specialuser_defaultuser_edit_succeed' => '编辑成功 ', + 'specialuser_defaultuser_add_invaild' => '需要同时输入用户名和添加原因', + 'specialuser_defaultuser_added_invalid' => '该用户已添加过', + 'specialuser_defaultuser_nouser_invalid' => '该用户不存在或被冻结', + 'styles_edit_succeed' => '界面方案更新成功 ', + 'parameters_error' => '参数错误', + 'tasks_succeed' => '任务添加或更新成功 ', + 'tasks_basic_invalid' => '任务设置不完整', + 'tasks_time_invalid' => '上线时间或下线时间设置不合理', + 'tasks_reward_invalid' => '任务奖励设置不合理', + 'tpl_directory_invalid' => '模板目录 {directory} 不存在于 ./template/ 目录中,或以 "/" 结尾', + 'threads_move_invalid' => '您没有选择或选择的目标版块/分类不存在', + 'threads_forumstick_url_invalid' => '您输入的URL无效', + 'threads_forumstick_targets_empty' => '请选择一个或多个目标版块', + 'select_thread_empty' => '没有选择主题', + 'threadtype_infotypes_option_invalid' => '分类扩展选项名称或者变量名为空', + 'threadtype_infotypes_optionvariable_iskeyword' => '选项变量名不被允许使用', + 'threadtype_infotypes_optionvariable_invalid' => '分类选项变量名重复或不为字母开头', + 'threadtype_infotypes_succeed' => '分类选项更新成功 ', + 'forums_threadtypes_duplicate' => '新增主题分类与现有重复', + 'threadtype_import_succeed' => '导入成功', + 'usergroups_nonexistence' => '指定的用户组不存在', + 'usergroups_copy_source_invalid' => '您没有选择源用户组', + 'members_verify_succeed' => '资料审核成功 ', + 'members_verify_update_succeed' => '认证设置更新成功 ', + 'action_noaccess' => '抱歉,您无权使用此功能', + 'action_access_noexists' => '抱歉,站点配置文件中未配置需要的权限', + 'action_noaccess_config' => '抱歉,站点配置文件中未配置本功能所需要的权限', + 'maxsubjectsize_no_more' => '标题最大字数不得超过 255 字符', + 'members_delete_confirm' => '本操作不可恢复,您确定要删除符合条件的 {membernum} 个用户吗?', + 'members_unarchive_confirm' => '本操作不可恢复,您确定要将 {membernum} 个用户移出存档表么?', + 'cloudaddons_check_write_error' => '"data/download/" 或 "data/addonmd5/" 目录无法创建或写入,这将会导致应用无法安装,请检查服务器环境', + 'cloudaddons_file_read_error' => '文件读取错误,请重试', + 'cloudaddons_file_write_error' => '文件写入错误,请重试', + 'cloudaddons_noaccess' => '只有网站创始人账号才能使用 Discuz! 应用中心 安装插件和模板,如有疑问,请进入应用中心咨询应用中心客服:https://addon.dismall.com/', + + 'admingroups_edit_nonexistence' => '请先选择您要进行操作的管理组:', + + 'adv_update_succeed' => '广告列表更新成功 ', + 'advertisement_nonexistence' => '广告ID不存在', + 'adv_title_invalid' => '您没有填写广告标题', + 'adv_title_more' => '抱歉,您的广告标题超过 50 个字符', + 'adv_endtime_invalid' => '您输入的广告结束时间早于当前时间或广告起始时间', + 'adv_parameter_invalid' => '您没有完成与展现方式相对应的必填内容', + 'adv_succeed' => '广告成功添加或已更新', + + 'smsgw_nonexistence' => '短信网关不存在', + 'smsgw_name_invalid' => '您没有填写短信网关名称', + 'smsgw_name_more' => '抱歉,您的短信网关名称超过 255 个字符', + 'smsgw_order_invalid' => '短信网关排序非法', + 'smsgw_sendrule_invalid' => '短信网关发送方法非法', + 'smsgw_succeed' => '短信网关配置成功更新', + + 'album_move_succeed' => '已成功移动相册到指定分类', + 'album_choose_at_least_one_operation' => '请选择操作', + 'album_choose_at_least_one_album' => '请至少选择一个相册', + + 'albumcategory_update_succeed' => '相册分类更新成功 ', + 'albumcategory_catgory_not_found' => '指定的相册分类不存在', + + 'announce_update_succeed' => '站点公告更新成功 ', + 'announce_nonexistence' => '指定的公告不存在或无权编辑', + + 'update_articletag_succeed' => '更新聚合标签名称成功 ', + 'article_trash_recover_succeed' => '恢复文章成功 ', + 'article_trash_delete_succeed' => '选中文章已经彻底删除', + 'article_trash_is_clearing' => '正在进行清空垃圾箱,每批清除50个文章...', + 'article_trash_is_empty' => '垃圾箱已清空', + 'article_trash_succeed' => '文章移入垃圾箱成功 ', + 'article_move_succeed' => '文章成功移动到指定分类', + + 'block_delete_succeed' => '删除模块成功 ', + 'block_choose_at_least_one_block' => '请至少选择一个模块', + 'block_clear_unused_succeed' => '清理无用模块成功 ', + + 'blockstyle_edit_succeed' => '编辑模块模板成功 ', + 'blockstyle_create_succeed' => '创建模块模板成功 ', + 'blockstyle_should_be_kept' => '每个模块类至少需要保留一个样式', + 'blockstyle_blockclass_not_match' => '选择的新样式和原样式不属于同一模块类', + + 'blog_move_succeed' => '已成功移动日志到指定分类', + 'blog_choose_at_least_one_operation' => '请选择操作', + 'blog_choose_at_least_one_blog' => '请至少选择一篇日志', + + 'blogcategory_update_succeed' => '更新日志分类成功 ', + 'blogcategory_catgory_not_found' => '指定的日志分类不存在', + + 'card_config_succeed' => '充值卡密设置成功 ', + 'card_make_cleardateline_early' => '抱歉,请选择一个有效期大于现在的时间,以正确生成有效卡片', + 'card_make_rule_empty' => '生成规则为空', + 'card_make_num_error' => '生成张数不能为 0', + 'card_make_rule_error' => '卡片规则中不能使用中文或其他特殊字符', + 'card_make_step' => '正在生成卡片:第{step}步/共{step_num}步, 成功{succeed_num}张/重复{fail_num}张', + 'card_make_rate_succeed' => '卡片生成完毕!按此生成规则随机的卡片号码重复过多!共生成了{succeed_num}张, 失败了{fail_num}张', + 'card_make_succeed' => '卡片生成完毕!共生成了{succeed_num}张, 失败了{fail_num}张', + + 'hookcheck_nodelhook' => '没有丢失嵌入点的文件', + 'imagepreview_errorcode_0' => '图片不符合处理条件,无法处理', + 'imagepreview_errorcode_-1' => '无效的图片,无法处理', + 'imagepreview_errorcode_-2' => '文件读写权限不足,无法处理图片', + 'imagepreview_errorcode_-3' => '系统设置错误,无法处理图片', + 'imagepreview_errorcode_-4' => '服务器缺少处理图片所需的功能,无法处理', + 'watermarkpreview_error' => '水印功能未启用,无法预览', + 'robots_output' => '请下载此文件,并上传至您站点的根目录下 {siteurl}robots.txt 位置处,如已存在其他内容的同名文件请自行合并。', + + 'cloudaddons_validator_error' => '校验失败,您无法下载此应用', + 'cloudaddons_download_write_error' => '文件无法下载,请确认 "data/download/" 目录是否可写', + 'cloudaddons_download_write_md5_error' => '校验文件无法写入,请确认 "data/download/" 目录是否可写', + 'cloudaddons_install_error' => '您不能安装此应用({ErrorCode})', + 'cloudaddons_installing' => '应用 {addonid} 安装中,请稍候......', + 'cloudaddons_install_files_changed' => '以下文件被修改过,是否继续覆盖?

            {files}', + 'cloudaddons_pack_installed' => '扩展安装完毕', + 'cloudaddons_batch_succeed' => '请分别点击下面的链接进行安装及升级操作', + + 'counter_forum_succeed' => '论坛帖数重建完成', + 'counter_digest_succeed' => '精华帖数重建完成', + 'counter_thread_succeed' => '主题帖数重建完成', + 'counter_moved_thread_succeed' => '移动标记清理完成', + 'counter_moved_favorites_logs_succeed' => '清理收藏夹和日志数据完成', + 'counter_special_arrange_succeed' => '分类信息数据整理完成', + 'counter_groupmember_num_succeed' => '圈子成员数重建完成', + 'counter_groupmember_post_succeed' => '圈子成员发帖数重建完成', + 'counter_groupnum_succeed' => '分类圈子数重建完成', + 'counter_blog_replynum_succeed' => '日志回复数重建完成', + 'counter_friendnum_succeed' => '空间好友数重建完成', + 'counter_album_picnum_succeed' => '相册图片数重建完成', + 'counter_thread_cover_fiderror' => '版块ID错误', + 'counter_thread_cover_fidnopicstyle' => '指定版块没有开启图片列表模式', + 'counter_thread_cover_succeed' => '主题封面重建完成', + + 'remoderate_thread_succeed' => '主题/文章标题及内容重新审核完成', + 'remoderate_blog_succeed' => '日志标题及内容重新审核完成', + 'remoderate_pic_succeed' => '图片标题重新审核完成', + 'remoderate_doing_succeed' => '记录内容重新审核完成', + 'remoderate_share_succeed' => '分享内容重新审核完成', + 'remoderate_comment_succeed' => '家园评论内容重新审核完成', + 'remoderate_article_succeed' => '文章标题及内容重新审核完成', + 'remoderate_articlecomment_succeed' => '文章评论内容重新审核完成', + 'remoderate_topiccomment_succeed' => '专题评论内容重新审核完成', + + 'database_export_dos8p3_failed' => '服务器开启了 DOS 8.3 文件名支持,为避免可能发生的数据库爆破风险,不允许在线备份数据库', + 'database_export_filename_invalid' => '您没有输入备份文件名或文件名中使用了敏感的扩展名', + 'database_export_custom_invalid' => '您至少需要选择一个数据表进行备份', + 'database_export_file_invalid' => '数据文件无法保存到服务器,请检查目录属性', + 'database_export_zip_invalid' => '压缩包文件无法保存到服务器,请检查目录属性', + 'database_export_multivol_redirect' => '分卷备份:数据文件 #{volume} 创建成功,程序将自动继续', + 'database_export_succeed' => '数据成功备份至服务器 {filename}

            出于安全考虑,我们强烈建议您下载数据库备份文件后删除文件或设置文件不可通过 URL 访问。{deletetips}', + 'database_shell_fail' => 'Shell 权限被禁止或服务器不支持,无法使用 MySQL Dump 方式备份或恢复数据', + 'database_export_dest_invalid' => '目录不存在或无法访问,请检查 ./data/ 目录', + 'database_file_delete_succeed' => '指定备份文件删除成功 ', + 'database_file_delete_invalid' => '您没有选择要删除的备份文件', + 'database_run_query_invalid' => '升级错误,MySQL 提示: {sqlerror} ', + 'database_run_query_succeed' => 'Discuz! 数据结构升级成功,影响的记录行数 {affected_rows}', + 'dbcheck_permissions_invalid' => '您的服务器环境不允许执行数据库校验,无法进行此操作', + 'dbcheck_nofound_md5file' => '不存在校验文件,无法进行此操作', + 'dbcheck_repair_error' => '数据库修复成功,但仍有 {errorcount} 个数据字段修复失败

            {error}', + 'dbcheck_repair_completed' => '数据库修复成功 ', + 'dbcheck_ok' => '您的数据库完整无误', + + 'setting_district_edit_success' => '修改地区数据成功 ', + + 'setting_domain_repeat_error' => '配置中存在重复的域名', + 'setting_domain_need_default_error' => '请设置默认域名', + 'only_two_names_from_english_composition_and_figures' => '抱歉,您设置的二级域名只能含有英文和数字', + 'two_domain_have_been_occupied' => '抱歉,二级域名已被占用', + + 'alipay_not_contract' => '请输入支付宝签约用户信息', + 'alipay_succeed' => '支付宝功能设定成功 ', + 'wechat_succeed' => '微信支付功能设定成功 ', + 'qpay_succeed' => 'QQ 钱包功能设定成功 ', + 'orders_disabled' => '您没有启用交易积分或支付宝积分充值功能,无法对订单进行管理', + 'ecommerce_invalidcredit' => '信用度必须大于 0 才能进行评级', + 'ecommerce_must_larger' => '信用等级 {rank} 的信用度必须大于上一等级的信用度', + 'ec_credit_succeed' => '信用评价体系设定成功 ', + + 'faq_nonexistence' => '指定帮助不存在', + 'faq_no_title' => '您没有填写帮助标题', + 'faq_identifier_invalid' => '帮助标识重复', + 'faq_keyword_toolong' => '帮助关键词过长', + + 'sitefeed_error' => '请正确添加动态标题、动态内容再提交发布', + 'feed_global_add_success' => '动态发布成功 ', + + 'forums_update_succeed' => '版块设置更新成功 ', + 'forums_moderators_update_succeed' => '版主设置更新成功 ', + 'forums_merge_source_sub_notnull' => '源版块下级版块不为空,请先返回修改相关下级版块的上级设置', + 'forums_merge_succeed' => '版块合并成功 ', + 'forums_edit_nonexistence' => '请先选择您要进行操作的版块:', + 'forums_nonexistence' => '指定的版块不存在', + 'forums_name_toolong' => '版块名称不能超过50个字符', + 'forums_edit_name_invalid' => '分类名称不能为空', + 'forums_edit_sub_notnull' => '存在下级版块,不能修改本版块的上级版块归属', + 'forums_edit_threadsort_nonexistence' => '没有选择默认的分类信息', + 'forums_delete_succeed' => '版块删除成功 ', + 'forums_delete_sub_notnull' => '存在下级版块,请先返回删除本分类或本版块的下级版块', + 'forums_delete_confirm' => '本操作不可恢复,您确定要删除该版块,清除其中文章和附件吗?
            注意: 删除版块并不会更新用户发帖数和积分', + 'forums_delete_alarm' => '本操作不可恢复,正在删除版块数据...', + 'forums_copy_target_invalid' => '您没有选择要复制的目标版块', + 'forums_copy_options_invalid' => '您没有选择要复制的项目', + 'forums_copy_succeed' => '版块设置复制成功 ', + + 'founder_perm_group_update_succeed' => '管理团队职务资料更新成功 ', + 'founder_perm_groupperm_update_succeed' => '职务权限更新成功 ', + 'founder_perm_member_duplicate' => '用户 {name} 已经存在更改', + 'founder_perm_gperm_update_succeed' => '管理团队权限资料更新成功 ', + 'founder_perm_notifyusers_succeed' => '管理通知接收者设置成功 ', + + 'founder_optimizer_setting_succeed' => '设置项优化成功 ', + 'founder_optimizer_setting_error' => '优化中出现问题 ', + + 'group_status_off' => '请先开启圈子功能,现在转到圈子设置页', + 'group_update_succeed' => '圈子分类设置更新成功 ', + 'grouptype_delete_succeed' => '圈子分类删除成功 ', + 'grouptype_delete_confirm' => '本操作不可恢复,您确定要删除该分类,清除其中文章和附件吗?
            注意:删除圈子并不会更新用户发帖数和积分', + 'grouptype_delete_alarm' => '本操作不可恢复,正在删除圈子数据...', + 'group_name_exist' => '该圈子名称已经存在', + 'group_edit_succeed' => '圈子编辑成功 ', + 'group_thread_removing' => '正在删除圈子内的文章,请勿关闭浏览器!', + 'group_delete_succeed' => '圈子删除成功 ', + 'group_changetype_succeed' => '圈子分类调整成功 ', + 'group_merge_continue' => '正在合并第{m}个圈子,还有{n}个,请勿关闭浏览器!', + 'group_mergegroup_succeed' => '圈子合并成功 ', + 'group_optype_no_choice' => '没有选择操作类型', + 'group_newtypeid_no_choice' => '没有选择圈子分类', + 'group_targetgroup_no_choice' => '没有填写目标圈子ID', + 'group_targetgroup_repeat' => '目标圈子与被合并圈子重复', + 'group_targetid_error' => '目标ID错误', + 'group_delete_confirm' => '删除圈子操作不可恢复,确认要删除吗?', + 'group_changetype_confirm' => '确认要将所选圈子移动到分类 [{targetname}] 下吗?', + 'group_mergegroup_confirm' => '合并圈子操作不可恢复,确认要合并到圈子 [{targetname}] 吗?', + 'group_group_no_choice' => '没有选择要操作的圈子', + 'group_userperm_succeed' => '操作成功 ', + 'group_level_update_credits_invalid' => '缺少积分下限为负数或 0 的圈子等级', + 'group_level_update_credits_duplicate' => '圈子等级积分下限设置重复', + 'group_level_succeed_except_all_levels' => '操作失败,不允许删除除所有的圈子等级', + 'group_level_update_succeed' => '圈子等级更新成功。如您添加了新的等级,
            请不要忘记修改其相应的设置', + 'group_level_noexist' => '圈子等级不存在', + 'group_mergetype_confirm' => '合并圈子操作不可恢复,确认要合并吗?', + 'group_mergetype_target_error' => '目标分类错误', + 'group_mergetype_succeed' => '分类合并成功 ', + 'group_mod_succeed' => '圈子审核成功 ', + + 'magics_parameter_invalid' => '道具参数填写不全', + 'magics_identifier_invalid' => '道具唯一标识重复', + + 'medals_invalidate_succeed' => '勋章申请已被否决', + 'medals_validate_succeed' => '勋章申请审核通过', + + 'members_edit_continue' => '是否继续上次未发送完成的操作?', + 'members_grouppm_delete_confirm' => '您确认要删除此群消息吗?', + 'members_edit_magics_nonexistence' => '目前没有可用的道具,请到“道具中心”启用道具后再进行此操作', + 'members_add_invalid' => '您没有填写完整用户资料', + 'members_add_username_tooshort' => '抱歉,您输入的用户名小于 3 个字符,请输入一个较长的用户名', + 'members_add_username_toolong' => '抱歉,您的用户名超过 15 个字符,请输入一个较短的用户名', + 'members_add_username_duplicate' => '用户名已经存在', + 'members_add_illegal' => '用户名包含敏感字符或被系统屏蔽', + 'members_username_protect' => '用户名包含被系统屏蔽的字符', + 'members_add_username_activation' => '用户名已经存在,但尚未激活,是否需要激活?
            激活的用户可用以前的用户密码登录', + 'members_add_admin_none' => '抱歉,出于安全考虑,不允许直接添加管理员', + 'members_add_ban_all_none' => '抱歉,不允许添加禁止访问、禁止IP、游客用户组', + 'members_add_succeed' => '用户 {username}(UID {uid}) 添加成功 ', + 'members_edit_groups_toomany' => '您设置了过多的扩展用户组,已超出系统允许的存储容量', + 'members_edit_groups_isfounder' => '该用户是站点创始人,您不能更改该用户的所属用户组', + 'members_edit_groups_illegal' => '过期用户组和用户当前所属用户组相同', + 'members_edit_groups_succeed' => '用户的用户组属性编辑成功 ', + 'members_edit_credits_failure' => '已分表的用户将不能编辑积分 ', + 'members_edit_credits_succeed' => '用户积分编辑成功 ', + 'members_edit_medals_succeed' => '用户勋章编辑成功 ', + 'members_edit_lock' => '您不能直接锁定该用户,请编辑去掉其“{grouptitle}”身份', + 'members_edit_illegal' => '您不能直接禁止该用户,请编辑去掉其“{grouptitle}”身份', + 'members_edit_illegal_portal' => '您不能直接禁止该用户,请查询其门户相关权限并清除', + 'members_edit_reason_invalid' => '您没有输入执行此变更的理由', + 'members_access_succeed' => '指定用户站点权限更新成功 ', + 'members_ipban_closed' => '禁止 IP 功能已在 config_global.php 内被关闭', + 'members_ipban_nopermission' => '只有管理员可以使用CIDR格式禁止某段地址', + 'members_ipban_illegal' => '操作错误!请不要禁止您自己的 IP', + 'members_ipban_invalid' => '新的禁止 IP 已经存在于列表中', + 'members_ipban_formaterror' => '操作错误!您输入的IP地址或CIDR不合法', + 'members_ipban_succeed' => 'IP 禁止列表更新成功 ', + 'members_profile_edit_title_empty_error' => '栏目标题不能为空', + 'members_stat_do_stepstat' => '更新统计数据中({i} / {t}),请稍候...', + 'members_stat_bad_fieldid' => '指定的资料项不正确', + 'members_stat_update_option_succeed' => '更新统计项成功 ', + 'members_stat_do_stepstat_prepared' => '准备更新统计数据,共 {t} 项。此过程将自动完成,请稍候...', + 'members_stat_null_operation' => '请选择一项操作', + 'members_newsletter_sm_invalid' => '您没有输入消息的标题或内容', + 'members_reward_invalid' => '您没有对用户积分进行奖惩', + 'members_confermedal_succeed' => '颁发勋章执行成功 ', + 'members_newsletter_notify_succeed' => '站点通知发送成功 ', + 'members_reward_notify_succeed' => '用户积分奖惩执行成功,并已通知相关用户', + 'members_confermedal_notify_succeed' => '颁发勋章执行成功,并已通知相关用户', + 'members_confermagic_notify_succeed' => '道具赠送成功,并已通知相关用户', + 'members_chgusername_check_failed' => '用户名合法性检测失败', + 'members_chgusername_name_badword' => '用户名包含被系统屏蔽的字符', + 'members_chgusername_name_exists' => '用户名已经存在', + 'members_chgusername_change_failed' => '用户名修改操作提交失败', + 'members_chgusername_change_success' => '用户名修改操作提交成功', + + 'membersplit_split_in_backstage' => '正在进行用户分表,请稍后重试...', + 'membersplit_split_check_table' => '正在进行数据表一致性检查...', + 'membersplit_split_succeed' => '用户分表完毕,已经没有可以继续移动到存档表的用户 ', + 'membersplit_split_doing' => '正在进行用户分表,已经移动到存档表 {num} 个用户... ', + 'membersplit_split_check_table_done' => '数据表结构一致性检查完毕,正在进行用户数据优化', + 'membersplit_split_checking_table' => '正在进行数据表一致性检查,第 {step} 步', + 'membersplit_split_check_table_fail' => '数据表数据结构整理失败,请手工处理将主表({tablename})和存档表({tablename}_archive)的数据结构调整按顺序调整一致。', + + 'onlinelist_succeed' => '在线列表项目更新成功 ', + 'forumlinks_succeed' => '友情链接更新成功 ', + 'relatedlink_succeed' => '关联链接更新成功 ', + 'bbcode_not_found' => '标签未找到', + 'dzcode_edit_range_invalid' => '代码参数个数或嵌套层数范围无效', + 'censor_batch_add_succeed' => '批量导入词语完成。新增 ({newcount}), 更新 ({updatecount}), 忽略 ({ignorecount})', + 'censor_wordtype_edit' => '词语分类编辑成功 ', + 'censor_keywords_existence' => '当前词库中已经有此关键词,请勿添加重复词语', + 'censor_succeed' => '词语过滤更新成功 ', + 'thread_stamp_succeed' => '主题图章更新成功 ', + 'attachtypes_succeed' => '附件类型更新成功 ', + 'smsgw_not_found' => '短信服务未找到', + 'cron_not_found' => '计划任务未找到', + 'crons_filename_illegal' => '您输入的任务脚本文件名包含非法字符', + 'crons_filename_invalid' => '您指定的任务脚本文件({cronfile})不存在或包含语法错误', + 'crons_time_invalid' => '您没有指定计划任务执行的时间或条件', + 'crons_run_invalid' => '您要运行任务的脚本文件({cronfile})不存在或包含语法错误,任务无法运行', + 'crons_run_succeed' => '计划任务执行成功 ', + 'focus_update_succeed' => '站长推荐更新成功 ', + 'focus_add_num_limit' => '抱歉,最多只能添加 10 条站长推荐', + 'focus_topic_exists' => '添加的站长推荐已存在', + 'focus_topic_addrequired' => '添加站长推荐,连接、标题、内容均不能为空', + 'focus_add_succeed' => '站长推荐添加成功 ', + 'focus_topic_noexists' => '指定的站长推荐不存在', + 'focus_edit_succeed' => '站长推荐编辑成功 ', + 'focus_conf_succeed' => '站长推荐设置成功 ', + 'custommenu_add_succeed' => '菜单 {title} 已成功添加到常用操作,即将返回上一页,您可以点这里编辑常用操作', + + 'patch_no_privilege_autoupdate' => '没有权限修改文件,无法开启自动更新', + 'patch_updatesetting_successful' => '设置更新成功', + 'patch_please_select_patch' => '请选择需要修复的安全补丁', + 'patch_cannot_access_file' => '发现您的目录及文件无修改权限,请您填写ftp账号,或者修改文件权限为可读可写后重试', + 'patch_updatesetting_failed' => '以下安全补丁更新失败:
            {list}', + 'patch_cheking' => '正在检测安全补丁', + + 'plugins_enable_succeed' => '插件已启用', + 'plugins_conflict' => '插件已启用
            友情提示:您刚启用的插件与某些插件存在共用的嵌入点。虽然共用嵌入点属于正常情况,但是如果您遇到插件运行不正常的情况请及时联系插件作者。[点击查看]

            ', + 'plugins_disable_succeed' => '插件已关闭', + 'plugins_import_var_invalid' => '插件的嵌入点名称不合法,无法导入', + 'plugins_import_identifier_duplicated' => '您要导入的插件({plugin_name})已经安装', + 'plugins_import_version_invalid_confirm' => '本插件适用于 Discuz! {cur_version} 与当前版本({set_version})不一致,您确定要安装吗?
            如果本插件的安装说明中不包含修改文件的内容则说明此插件为绿色插件,您可放心安装', + 'plugins_import_version_invalid' => '本插件适用于 Discuz! {cur_version} 与当前版本({set_version})不一致', + 'plugins_import_succeed' => '插件数据导入成功!
            为了正常使用此插件,您可能还需要上传或修改相应的文件或模板,详情请查看本插件的安装说明', + 'plugins_config_upgrade_confirm' => '您确定要把 {pluginname} {version} 插件更新到 {toversion} 吗?', + 'plugins_config_upgrade_missed' => '此插件已更新到最新版本
            点击这里进入应用中心

            ', + 'plugins_config_upgrade_new' => '此插件已更新到最新版本
            但是发现此插件在应用中心存在新版本 {newver},是否需要升级?


            升级此插件    暂不升级

            ', + 'plugins_upgrade_var_invalid' => '插件的嵌入点名称不合法,无法更新', + 'plugins_setting_succeed' => '插件参数设置更新成功 ', + 'plugins_setting_module_nonexistence' => '指定的插件管理模块文件({modfile})不存在或存在语法错误,请检查是否已将插件完整上传', + 'plugins_add_succeed' => '插件已成功添加,请继续进行详细设置', + 'plugins_nonexistence' => '您即将进行的操作:设计插件。请先选择插件:', + 'plugin_donot_edit' => '不允许编辑', + 'plugins_edit_directory_invalid' => '您输入的插件目录不合法或没有使用 "/" 结尾', + 'plugins_edit_language_invalid' => '插件语言包文件({langfile})不存在', + 'plugins_edit_modules_name_invalid' => '您输入的程序模块名称不合法', + 'plugins_edit_modules_duplicated' => '您输入的程序模块名称与现有模块重复', + 'plugins_edit_var_invalid' => '您输入的配置变量名不合法或重复', + 'plugins_delete_error' => '您不能卸载系统插件。', + 'pluginvar_not_found' => '插件变量未找到', + 'plugins_edit_var_title_invalid' => '您没有输入配置名称', + 'plugins_edit_vars_succeed' => '插件变量配置更新成功 ', + 'plugins_edit_vars_invalid' => '插件配置变量名不合法或者已被占用', + 'plugins_validator_noupdate' => '没有检测到新版本插件', + + 'portalcategory_update_succeed' => '更新分类成功 ', + 'portal_delete_confirm' => '本操作不可恢复,您确定要删除该分类下的文章吗?', + 'portalcategory_move_empty_error' => '该分类下没有任何文章', + 'portalcategory_move_succeed' => '移动文章成功 ', + + 'postsplit_table_memo_update_succeed' => '表备注信息更新成功 ', + 'postsplit_do_error' => '分表失败:经过校验发现{tableid}表中缺少{fields}字段', + 'postsplit_table_create_succeed' => '新的文章表创建成功,正在进入最后的数据转移操作', + 'postsplit_finish' => '目标分表已确认,正在进入最后的数据转移操作', + 'postsplit_unallow' => '当前表未达到指定的分表界限,不建议进行分表操作', + 'postsplit_abnormal' => '非正常的文章分表操作', + 'postsplit_do_succeed' => '恭喜您,文章分表操作成功,请返回', + 'postsplit_resetpid_succeed' => 'Post ID 重置完成', + + 'recyclebin_none_selected' => '没有选择要操作的文章', + 'recyclebin_clean_next' => '回收站更新, 已经删除 {threadsdel} 个主题,程序将自动继续', + + 'report_resolve_succeed' => '处理成功,现在返回列表页', + 'report_receive_succeed' => '操作成功 ', + + 'searchindex_not_found' => '索引文件丢失', + 'search_keyword_noexists' => '请输入要搜索的关键词', + + 'setting_memory_rm_succeed' => '缓存删除成功', + 'setting_memory_rm_error' => '请输入要删除的缓存KEY', + 'founder_action' => '创始人专用功能,您无权使用', + 'setting_extcredits_must_available' => '您需要开启至少一种扩展积分', + 'uc_database_connect_error' => '连接用户中心数据库服务器失败检查设置', + 'uc_config_write_error' => '配置文件写入失败,请检查设置', + 'uc_config_appid_error' => 'UCenter 应用 ID 必须为数字,请检查设置', + 'uc_config_ip_error' => 'UCenter IP 地址必须为合法的 IP 地址,请检查设置', + 'uc_config_load_data_local_infile_error' => '服务器开启了 MySQL LOAD DATA LOCAL IN FILE 功能,为避免可能发生的安全威胁,不允许在线编辑 UCenter 数据库服务器地址,如需修改请编辑 config/config_ucenter.php 内 UC_DBHOST 常量', + 'setting_ipaccess_invalid' => '操作错误!您必须将自己的 IP 加入到允许访问站点的 IP 列表中', + 'setting_adminipaccess_invalid' => '操作错误!您必须将自己的 IP 加入到允许访问后台的 IP 列表中', + 'setting_creditsformula_invalid' => '积分公式包含无效变量或运算符', + 'setting_credits_title_invalid' => '您没有为启用的积分设置积分名称', + 'setting_creditstrans_invalid' => '交易积分必须是已经被启用的积分类型', + 'setting_maxonlines_invalid' => '指定的最大在线人数必须填写且不得超过 65535', + 'setting_seccode_ttf_lost' => '验证码缺少显示所需的字体文件,请上传字体文件至 {path} 目录', + 'forum_name_duplicate' => '表单名称设置不能重复,请重新设置', + 'alipay_ratio_invalid' => '您输入的现金/积分兑换比率小于 0', + 'setting_threadprofile_name_empty' => '方案名称不能为空', + 'ftp_password_short' => 'FTP 密码不得少于 3 位', + 'cachethread_dir_noexists' => '抱歉,您所指定的目录 {cachethreaddir} 不存在或者不可写,请尝试通过 FTP 将其属性改为 777', + 'ranklistcache_update' => '排行榜缓存文件已更新', + 'watermarkpreview_fontpath_error' => '文本水印 TrueType 字体文件不存在', + + 'smilies_delete_invalid' => '您不能直接删除非空的表情分类,请先返回删除本分类下的所有表情', + 'smilies_update_succeed' => '更新成功,在 {smurl} 目录中共搜索到 {num} 个尚未启用的表情,已自动添加到表情分类“{typename}”', + 'smilies_update_error' => '目录 {smurl} 中没有找到尚未使用的表情图片
            添加表情请通过 FTP 上传表情图片到 {smurl} 目录,然后刷新本页', + 'smilies_import_succeed_renamed' => '表情导入成功。导入的表情分类名称与现有重复,已被自动重命名', + 'smilies_import_succeed' => '表情导入成功 ', + + 'specialuser_hotuser_noreason_invalid' => '请输入原因', + 'specialuser_follow_del_succeed' => '删除推荐关注成功 ', + 'specialuser_defaultuser_del_succeed' => '删除推荐好友成功 ', + 'specialuser_hotuser_del_succeed' => '删除明星会员成功 ', + 'specialuser_hotuser_edit_succeed' => '编辑成功 ', + 'specialuser_hotuser_add_invaild' => '需要同时输入用户名和推荐原因', + 'specialuser_hotuser_added_invalid' => '该用户已推荐过', + 'specialuser_hotuser_nouser_invalid' => '该用户不存在或被冻结', + 'specialuser_follow_add_succeed' => '添加推荐关注成功 ', + 'specialuser_defaultuser_add_succeed' => '添加推荐好友成功 ', + 'specialuser_hotuser_add_succeed' => '添加会员成功 ', + + 'styles_export_invalid' => '指定的风格不存在,无法导出', + 'csscache_update' => 'CSS 缓存文件已更新', + 'styles_delete_invalid' => '您不能直接删除正在使用中的模板风格,选择使用其他模板风格为默认后再进行删除', + 'styles_install_succeed' => '界面方案安装完成

            点击这里返回应用中心
            ', + 'styles_restore_succeed' => '界面方案已恢复成初始设置', + 'styles_import_succeed_renamed' => '界面方案导入完成。导入的风格或模板名称与现有重复,已被自动重命名', + 'styles_import_succeed' => '界面方案导入完成', + 'styles_copy_succeed' => '界面方案复制成功 ', + 'styles_nonexistence' => '请先选择您要进行操作的界面方案:', + 'style_not_found' => '风格未找到', + 'styles_edit_variable_duplicate' => '新增的替换变量名已经存在', + 'styles_edit_variable_illegal' => '新增的替换变量名称不合法', + 'styles_validator_noupdate' => '没有检测到新版本风格', + + 'tag_admin_updated' => '标签更新成功 ', + + 'tasks_setting_invalid' => '部分任务设置不合理无法启用,请重新设置', + 'tasks_del_confirm' => '您确定要删除当前任务吗?', + 'tasks_del' => '任务成功删除', + 'tasks_install_duplicate' => '指定的任务脚本已安装', + 'tasks_installed' => '指定任务安装成功 ', + 'tasks_uninstall_confirm' => '该操作将卸载当前任务类型并删除其下所有任务,请确认!', + 'tasks_uninstalled' => '指定任务卸载成功 ', + 'tasks_newest' => '请上传更高版本的任务脚本,然后刷新本页', + 'tasks_updated' => '指定任务升级成功 ', + + 'tpl_new_directory_invalid' => '您没有填写模板所在目录', + 'tpl_default_directory_invalid' => '您不能修改默认模板的目录设置', + 'tpl_delete_invalid' => '您不能删除默认模板', + 'tpl_update_succeed' => '模板套系更新成功 ', + + 'threads_forumstick_del_nochoice' => '您没有选择要取消置顶的主题', + 'threads_forumstick_del_succeed' => '置顶主题列表更新成功 ', + 'threads_forumstick_edit_succeed' => '目标版块更改成功 ', + 'threads_forumstick_add_succeed' => '主题添加成功 ', + 'delete_position_succeed' => '删除文章索引成功 ', + 'delete_position_gotu_add' => '已经删除了文章索引,正转向重新创建文章索引,请勿关闭浏览器!', + 'add_postposition_succeed' => '添加文章索引成功 ', + 'addpostposition_continue' => '正在添加文章索引,请勿关闭浏览器!', + + 'threadsplit_manage_update_succeed' => '更新信息成功 ', + 'threadsplit_table_create_succeed' => '主题存档表创建成功 ', + 'threadsplit_table_no_exists' => '要删除的表不存在', + 'threadsplit_drop_table_no_empty_error' => '不能删除非空的主题表', + 'threadsplit_drop_table_succeed' => '主题存档表删除成功 ', + 'threadsplit_forum_must_be_closed' => '移动主题前请先关闭站点', + 'threadsplit_no_target_table' => '请选择目标数据表', + 'threadsplit_move_source_target_no_same' => '目标表和原始表不能相同', + 'threadsplit_moving' => '已经移动了 {count} 个主题,共有 {total} 个主题
            ', + 'threadsplit_move_succeed' => '主题移动完成,下面更新版块存档区', + 'threadsplit_manage_forum_processing' => '已处理完 {table},请稍候...', + 'threadsplit_manage_forum_complete' => '已更新所有版块存档区', + + 'forums_threadtypes_succeed' => '主题分类更新成功 ', + 'threadtype_infotypes_noexist' => '主题选项分类不存在', + 'typeoption_not_found' => '选项未找到', + 'threadtype_infotypes_option_succeed' => '分类扩展选项更新成功 ', + 'threadtype_infotypes_invalid' => '分类信息至少应该有一个选项', + 'threadtype_content_no_choice' => '没有选择分类信息', + 'threadtype_content_delete_succeed' => '数据删除完成', + 'threadtype_export_error' => '分类选项导出失败', + + 'update_cache_succeed' => '全部缓存更新完毕', + + 'topic_choose_at_least_one_topic' => '请至少选择一个专题', + 'topic_delete_succeed' => '删除专题成功 ', + 'topic_close_succeed' => '关闭专题成功 ', + 'topic_open_succeed' => '开启专题成功 ', + 'topic_choose_at_least_one_optype' => '请选择一个操作项', + + 'upgrade_close_site' => '升级前,请先关闭站点,并对文件及数据备份', + 'upgrade_none' => '没有该升级信息 {upgradeurl}', + 'upgrade_continue' => '您上次升级到 {step},请继续完成升级', + 'upgrade_download_upgradelist_error' => '获取待更新文件列表失败,是否重新获取? {upgradeurl}', + 'upgrade_download_complete_to_compare' => '待更新文件下载完成,即将进行本地文件比较 {upgradeurl}', + 'upgrade_redownload' => '文件 {file} 下载出现问题,请查看您的服务器网络以及data目录是否有写权限,请确认无误后点击确定 {upgradeurl}', + 'upgrade_downloading_file' => '正在从官方下载更新文件 {file}
            已完成{percent} {upgradeurl}', + 'upgrade_cannot_access_file' => '发现您的目录及文件无修改权限,请您填写 ftp 账号,或者修改文件权限为可读可写后重试', + 'upgrade_backuping' => '正在备份原始文件... {upgradeurl}', + 'upgrade_backup_error' => '备份原始文件出错 {upgradeurl}', + 'upgrade_backup_complete' => '备份完成,正在进行升级... {upgradeurl}', + 'upgrade_ftp_upload_error' => 'ftp上传文件 {file} 出错, 请修改文件权限后重新上传 或 重新设置ftp账号 {upgradeurl}', + 'upgrade_copy_error' => '复制文件 {file} 出错,请检测原始文件是否存在,重新复制 或 通过ftp上传复制文件 {upgradeurl}', + 'upgrade_file_successful' => '文件升级成功,即将进入更新数据库 {upgradeurl}', + 'upgrade_successful' => '恭喜您,升级成功!
            您当前的版本为:[Discuz! X{version} Release[{release}]

            为安全起见,升级文件已保存至{save_update_dir}目录,
            备份文件已保存至{save_back_dir}目录 {upgradeurl}', + 'upgrade_checking' => '正在检测新的升级版本', + 'upgrade_latest_version' => '您目前使用的已经是最新版本,不需要升级', + 'upgrade_param_error' => '请求的参数不正确', + + 'usergroups_type_nonexistence' => '用户组类型错误', + 'usergroups_update_creditshigher_invalid' => '您没有填写积分下限', + 'usergroups_update_credits_invalid' => '缺少积分下限为负数或 0 的会员用户组', + 'usergroups_update_credits_duplicate' => '会员用户组积分下限设置重复', + 'usergroups_update_succeed' => '用户组更新成功。如您添加了新的用户组,
            请不要忘记修改其相应的权限设置', + 'usergroups_edit_nonexistence' => '请先选择您要进行操作的用户组:', + 'usergroups_edit_creditstrans_disabled' => '您需要先在全局设置中启用交易积分才能设置收费公众用户组的相关功能', + 'usergroups_edit_rate_invalid' => '用户组评分上下限或 24 小时最大评分数设置有误', + 'trade_fee_error' => '交易设置有误', + 'reward_credits_error' => '悬赏交易积分设置有误', + 'usergroups_edit_succeed' => '用户组权限设置更新成功 ', + 'usergroups_copy_target_invalid' => '您没有选择目标用户组', + 'usergroups_copy_options_invalid' => '您没有选择要复制的项目', + 'usergroups_copy_succeed' => '用户组设置复制成功 ', + 'usergroups_merge_succeed' => '用户组合并成功 ', + + 'usertag_delete_succeed' => '删除标签成功', + 'usertag_merge_succeed' => '标签合并成功', + 'usertag_add_succeed' => '成功为用户添加标签', + 'usertag_add_tag_succeed' => '成功添加标签', + 'usertag_add_error' => '添加失败,用户或标签错误,请重新填写', + + 'members_verify_add_user_succeed' => '认证用户添加完成', + 'members_verify_add_user_failure' => '认证用户添加失败', + 'members_verify_update_title_error' => '认证启用时认证名称不能为空修改', + 'members_verify_title_invalid' => '您没有为启用的认证设置认证名称', + + 'connect_update_succeed' => 'QQ绑定设置更新成功 ', + + 'moderate_articles_succeed' => '审核操作成功,共 {validates} 个文章被通过,{ignores} 个文章被忽略,{deletes} 个文章被删除', + + 'moderate_blogs_succeed' => '审核操作成功,共 {validates} 个日志被通过,{ignores} 个日志被忽略,{deletes} 个日志被删除', + + 'moderate_comments_succeed' => '审核操作成功,共 {validates} 个留言被通过,{ignores} 个留言被忽略,{deletes} 个留言被删除', + + 'moderate_doings_succeed' => '审核操作成功,共 {validates} 个记录被通过,{ignores} 个记录被忽略,{deletes} 个记录被删除', + + 'members_search_noresults' => '没有找到符合条件的会员', + + 'moderate_pictures_succeed' => '审核操作成功,共 {validates} 个图片被通过,{ignores} 个图片被忽略,{deletes} 个图片被删除', + + 'moderate_articlecomments_succeed' => '审核操作成功,共 {validates} 个评论被通过,{ignores} 个评论被忽略,{deletes} 个评论被删除', + 'moderate_topiccomments_succeed' => '审核操作成功,共 {validates} 个评论被通过,{ignores} 个评论被忽略,{deletes} 个评论被删除', + + 'moderate_replies_succeed' => '审核操作成功,共 {validates} 个回复被通过,{ignores} 个回复被忽略,{deletes} 个回复被删除', + + 'moderate_shares_succeed' => '审核操作成功,共 {validates} 个分享被通过,{ignores} 个分享被忽略,{deletes} 个分享被删除', + + 'moderate_threads_succeed' => '审核操作成功,共 {validates} 个主题被通过,{ignores} 个主题被忽略,{recycles} 个主题被放入回收站,{deletes} 个主题被删除', + + 'cloudaddons_ftp_path_error' => '站点 FTP 路径错误,请重新填写', + + 'cloudaddons_check_url_fopen_error' => '您的服务器无法访问应用中心,这将会导致应用无法安装。请联系您的服务商或者网站技术人员,确保您的服务器能够正常访问 addon.dismall.com', + 'cloudaddons_check_gzuncompress_error' => '您的服务器不支持 Zlib,这将会导致应用无法安装。请联系您的服务商或者网站技术人员。', + 'cloudaddons_check_curl_error' => '您的服务器不支持 CURL,这将会导致应用无法安装。请联系您的服务商或者网站技术人员。', + 'cloudaddons_genuine_message' => '对不起,您安装的不是正版应用,安装程序无法继续执行

            点击这里安装正版应用', + + 'admincp_makehtml_cleanhtml_error' => '对不起,开启生成HTML静态文件时,不能清理HTML文件。', + 'admincp_makehtml_cleanhtml_succeed' => '清理HTML文件成功。', + 'admincp_makehtml_cleanhtml_choose_item' => '对不起,请选择需要清理HTML文件。', + 'attach_readmod_error' => '抱歉,当前的本地文件读取模式会导致部分浏览器下视频播放异常,如需开启附件URL地址、媒体附件播放,请在 config_global.php 内修改本地文件读取模式为 1 或 4 后再试', + 'optimizer_dos8p3_optimizer' => '请您根据您底层的情况正确选择技术路线和解决方案, 通过对底层的正确配置以关闭 DOS 8.3 文件名支持', + 'optimizer_httphost_optimizer' => '请您根据您底层的情况正确选择技术路线和解决方案, 通过对底层的正确配置以关闭空 HOST 头支持', + 'optimizer_filesafe_optimizer' => '已经尝试为您删除安装程序、数据恢复程序以及重复的后台入口文件, 如果检测仍异常则需要您自查相关目录文件是否存在, 尤其是 old 目录以及 utility 目录是否删除', + 'optimizer_remote_optimizer' => '如此功能并非您主动开启的, 请在 config_global.php 内关闭远程调用功能并修改远程密钥', + 'payment_succeed' => '支付成功', + 'payment_transfer_succeed' => '转账成功', + 'payment_error_50001' => '验签失败', + 'payment_error_50002' => '订单不存在', + 'payment_error_50003' => '订单已完成', + 'payment_error_50004' => '更新订单失败', + +); + +?> \ No newline at end of file diff --git a/source/language/lang_admincp_searchindex.php b/source/language/lang_admincp_searchindex.php new file mode 100644 index 0000000..fa99810 --- /dev/null +++ b/source/language/lang_admincp_searchindex.php @@ -0,0 +1,7584 @@ + + array ( + 'index' => + array ( + '管理中心首页' => 'action=index', + ), + 'text' => + array ( + 0 => '管理中心首页', + ), + ), + 1 => + array ( + 'index' => + array ( + '常用操作管理' => 'action=misc&operation=custommenu', + ), + 'text' => + array ( + 0 => '常用操作管理', + ), + ), + 2 => + array ( + 'index' => + array ( + '站点信息' => 'action=setting&operation=basic', + ), + 'text' => + array ( + 0 => '站点信息', + ), + ), + 3 => + array ( + 'index' => + array ( + '注册与访问控制' => 'action=setting&operation=access', + ), + 'text' => + array ( + 0 => '注册与访问控制', + ), + ), + 4 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + ), + 'text' => + array ( + 0 => '站点功能', + ), + ), + 5 => + array ( + 'index' => + array ( + '性能优化' => 'action=setting&operation=cachethread', + ), + 'text' => + array ( + 0 => '性能优化', + ), + ), + 6 => + array ( + 'index' => + array ( + 'SEO设置' => 'action=setting&operation=seo', + ), + 'text' => + array ( + 0 => 'SEO设置', + ), + ), + 7 => + array ( + 'index' => + array ( + '域名设置' => 'action=domain', + ), + 'text' => + array ( + 0 => '域名设置', + ), + ), + 8 => + array ( + 'index' => + array ( + '广播设置' => 'action=setting&operation=follow', + ), + 'text' => + array ( + 0 => '广播设置', + ), + ), + 9 => + array ( + 'index' => + array ( + '空间设置' => 'action=setting&operation=home', + ), + 'text' => + array ( + 0 => '空间设置', + ), + ), + 10 => + array ( + 'index' => + array ( + '用户权限' => 'action=setting&operation=permissions', + ), + 'text' => + array ( + 0 => '用户权限', + ), + ), + 11 => + array ( + 'index' => + array ( + '积分设置' => 'action=setting&operation=credits', + ), + 'text' => + array ( + 0 => '积分设置', + ), + ), + 12 => + array ( + 'index' => + array ( + '时间设置' => 'action=setting&operation=datetime', + ), + 'text' => + array ( + 0 => '时间设置', + ), + ), + 13 => + array ( + 'index' => + array ( + '上传设置' => 'action=setting&operation=attach', + ), + 'text' => + array ( + 0 => '上传设置', + ), + ), + 14 => + array ( + 'index' => + array ( + '水印设置' => 'action=setting&operation=imgwater', + ), + 'text' => + array ( + 0 => '水印设置', + ), + ), + 15 => + array ( + 'index' => + array ( + '附件类型尺寸' => 'action=misc&operation=attachtype', + ), + 'text' => + array ( + 0 => '附件类型尺寸', + ), + ), + 16 => + array ( + 'index' => + array ( + '搜索设置' => 'action=setting&operation=search', + ), + 'text' => + array ( + 0 => '搜索设置', + ), + ), + 17 => + array ( + 'index' => + array ( + '地区设置' => 'action=district', + ), + 'text' => + array ( + 0 => '地区设置', + ), + ), + 18 => + array ( + 'index' => + array ( + '排行榜设置' => 'action=setting&operation=ranklist', + ), + 'text' => + array ( + 0 => '排行榜设置', + ), + ), + 19 => + array ( + 'index' => + array ( + '手机版设置' => 'action=setting&operation=mobile', + ), + 'text' => + array ( + 0 => '手机版设置', + ), + ), + 20 => + array ( + 'index' => + array ( + '防采集设置' => 'action=setting&operation=antitheft', + ), + 'text' => + array ( + 0 => '防采集设置', + ), + ), + 21 => + array ( + 'index' => + array ( + '导航设置' => 'action=nav', + ), + 'text' => + array ( + 0 => '导航设置', + ), + ), + 22 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + ), + 'text' => + array ( + 0 => '界面设置', + ), + ), + 23 => + array ( + 'index' => + array ( + '表情管理' => 'action=smilies', + ), + 'text' => + array ( + 0 => '表情管理', + ), + ), + 24 => + array ( + 'index' => + array ( + '表态动作' => 'action=click', + ), + 'text' => + array ( + 0 => '表态动作', + ), + ), + 25 => + array ( + 'index' => + array ( + '主题鉴定' => 'action=misc&operation=stamp', + ), + 'text' => + array ( + 0 => '主题鉴定', + ), + ), + 26 => + array ( + 'index' => + array ( + '编辑器设置' => 'action=setting&operation=editor', + ), + 'text' => + array ( + 0 => '编辑器设置', + ), + ), + 27 => + array ( + 'index' => + array ( + '在线列表图标' => 'action=misc&operation=onlinelist', + ), + 'text' => + array ( + 0 => '在线列表图标', + ), + ), + 28 => + array ( + 'index' => + array ( + '内容审核' => 'action=moderate', + ), + 'text' => + array ( + 0 => '内容审核', + ), + ), + 29 => + array ( + 'index' => + array ( + '内容重新审核' => 'action=remoderate', + ), + 'text' => + array ( + 0 => '内容重新审核', + ), + ), + 30 => + array ( + 'index' => + array ( + '词语过滤' => 'action=misc&operation=censor', + ), + 'text' => + array ( + 0 => '词语过滤', + ), + ), + 31 => + array ( + 'index' => + array ( + '用户举报' => 'action=report', + ), + 'text' => + array ( + 0 => '用户举报', + ), + ), + 32 => + array ( + 'index' => + array ( + '标签管理' => 'action=tag', + ), + 'text' => + array ( + 0 => '标签管理', + ), + ), + 33 => + array ( + 'index' => + array ( + '淘帖管理' => 'action=collection', + ), + 'text' => + array ( + 0 => '淘帖管理', + ), + ), + 34 => + array ( + 'index' => + array ( + '论坛主题管理' => 'action=threads', + ), + 'text' => + array ( + 0 => '论坛主题管理', + ), + ), + 35 => + array ( + 'index' => + array ( + '论坛批量删帖' => 'action=prune', + ), + 'text' => + array ( + 0 => '论坛批量删帖', + ), + ), + 36 => + array ( + 'index' => + array ( + '论坛附件管理' => 'action=attach', + ), + 'text' => + array ( + 0 => '论坛附件管理', + ), + ), + 37 => + array ( + 'index' => + array ( + '圈子主题管理' => 'action=threads&operation=group', + ), + 'text' => + array ( + 0 => '圈子主题管理', + ), + ), + 38 => + array ( + 'index' => + array ( + '圈子批量删帖' => 'action=prune&operation=group', + ), + 'text' => + array ( + 0 => '圈子批量删帖', + ), + ), + 39 => + array ( + 'index' => + array ( + '圈子附件管理' => 'action=attach&operation=group', + ), + 'text' => + array ( + 0 => '圈子附件管理', + ), + ), + 40 => + array ( + 'index' => + array ( + '主题回收站' => 'action=recyclebin', + ), + 'text' => + array ( + 0 => '主题回收站', + ), + ), + 41 => + array ( + 'index' => + array ( + '回帖回收站' => 'action=recyclebinpost', + ), + 'text' => + array ( + 0 => '回帖回收站', + ), + ), + 42 => + array ( + 'index' => + array ( + '版块/圈子置顶' => 'action=threads&operation=forumstick', + ), + 'text' => + array ( + 0 => '版块/圈子置顶', + ), + ), + 43 => + array ( + 'index' => + array ( + '文章点评管理' => 'action=postcomment', + ), + 'text' => + array ( + 0 => '文章点评管理', + ), + ), + 44 => + array ( + 'index' => + array ( + '记录管理' => 'action=doing', + ), + 'text' => + array ( + 0 => '记录管理', + ), + ), + 45 => + array ( + 'index' => + array ( + '日志管理' => 'action=blog', + ), + 'text' => + array ( + 0 => '日志管理', + ), + ), + 46 => + array ( + 'index' => + array ( + '日志回收站' => 'action=blogrecyclebin', + ), + 'text' => + array ( + 0 => '日志回收站', + ), + ), + 47 => + array ( + 'index' => + array ( + '动态管理' => 'action=feed', + ), + 'text' => + array ( + 0 => '动态管理', + ), + ), + 48 => + array ( + 'index' => + array ( + '相册管理' => 'action=album', + ), + 'text' => + array ( + 0 => '相册管理', + ), + ), + 49 => + array ( + 'index' => + array ( + '图片管理' => 'action=pic', + ), + 'text' => + array ( + 0 => '图片管理', + ), + ), + 50 => + array ( + 'index' => + array ( + '评论/留言管理' => 'action=comment', + ), + 'text' => + array ( + 0 => '评论/留言管理', + ), + ), + 51 => + array ( + 'index' => + array ( + '分享管理' => 'action=share', + ), + 'text' => + array ( + 0 => '分享管理', + ), + ), + 52 => + array ( + 'index' => + array ( + '用户管理' => 'action=members&operation=search', + ), + 'text' => + array ( + 0 => '用户管理', + ), + ), + 53 => + array ( + 'index' => + array ( + '添加用户' => 'action=members&operation=add', + ), + 'text' => + array ( + 0 => '添加用户', + ), + ), + 54 => + array ( + 'index' => + array ( + '用户栏目' => 'action=members&operation=profile', + ), + 'text' => + array ( + 0 => '用户栏目', + ), + ), + 55 => + array ( + 'index' => + array ( + '资料统计' => 'action=members&operation=stat', + ), + 'text' => + array ( + 0 => '资料统计', + ), + ), + 56 => + array ( + 'index' => + array ( + '发送通知' => 'action=members&operation=newsletter', + ), + 'text' => + array ( + 0 => '发送通知', + ), + ), + 57 => + array ( + 'index' => + array ( + '发送手机通知' => 'action=members&operation=newsletter&do=mobile', + ), + 'text' => + array ( + 0 => '发送手机通知', + ), + ), + 58 => + array ( + 'index' => + array ( + '发送手机短信' => 'action=members&operation=newsletter&do=sms', + ), + 'text' => + array ( + 0 => '发送手机短信', + ), + ), + 59 => + array ( + 'index' => + array ( + '用户标签' => 'action=usertag', + ), + 'text' => + array ( + 0 => '用户标签', + ), + ), + 60 => + array ( + 'index' => + array ( + '禁止用户' => 'action=members&operation=ban', + ), + 'text' => + array ( + 0 => '禁止用户', + ), + ), + 61 => + array ( + 'index' => + array ( + '禁止 IP' => 'action=members&operation=ipban', + ), + 'text' => + array ( + 0 => '禁止 IP', + ), + ), + 62 => + array ( + 'index' => + array ( + '积分奖惩' => 'action=members&operation=reward', + ), + 'text' => + array ( + 0 => '积分奖惩', + ), + ), + 63 => + array ( + 'index' => + array ( + '审核用户' => 'action=moderate&operation=members', + ), + 'text' => + array ( + 0 => '审核用户', + ), + ), + 64 => + array ( + 'index' => + array ( + '管理组' => 'action=admingroup', + ), + 'text' => + array ( + 0 => '管理组', + ), + ), + 65 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + ), + 'text' => + array ( + 0 => '用户组', + ), + ), + 66 => + array ( + 'index' => + array ( + '推荐关注' => 'action=specialuser&operation=follow', + ), + 'text' => + array ( + 0 => '推荐关注', + ), + ), + 67 => + array ( + 'index' => + array ( + '推荐好友' => 'action=specialuser&operation=defaultuser', + ), + 'text' => + array ( + 0 => '推荐好友', + ), + ), + 68 => + array ( + 'index' => + array ( + '资料审核' => 'action=verify&operation=verify', + ), + 'text' => + array ( + 0 => '资料审核', + ), + ), + 69 => + array ( + 'index' => + array ( + '认证设置' => 'action=verify', + ), + 'text' => + array ( + 0 => '认证设置', + ), + ), + 70 => + array ( + 'index' => + array ( + '频道栏目' => 'action=portalcategory', + ), + 'text' => + array ( + 0 => '频道栏目', + ), + ), + 71 => + array ( + 'index' => + array ( + '文章管理' => 'action=article', + ), + 'text' => + array ( + 0 => '文章管理', + ), + ), + 72 => + array ( + 'index' => + array ( + '专题管理' => 'action=topic', + ), + 'text' => + array ( + 0 => '专题管理', + ), + ), + 73 => + array ( + 'index' => + array ( + 'HTML管理' => 'action=makehtml', + ), + 'text' => + array ( + 0 => 'HTML管理', + ), + ), + 74 => + array ( + 'index' => + array ( + '页面管理' => 'action=diytemplate', + ), + 'text' => + array ( + 0 => '页面管理', + ), + ), + 75 => + array ( + 'index' => + array ( + '模块管理' => 'action=block', + ), + 'text' => + array ( + 0 => '模块管理', + ), + ), + 76 => + array ( + 'index' => + array ( + '模块模板' => 'action=blockstyle', + ), + 'text' => + array ( + 0 => '模块模板', + ), + ), + 77 => + array ( + 'index' => + array ( + '第三方模块' => 'action=blockxml', + ), + 'text' => + array ( + 0 => '第三方模块', + ), + ), + 78 => + array ( + 'index' => + array ( + '权限列表' => 'action=portalpermission', + ), + 'text' => + array ( + 0 => '权限列表', + ), + ), + 79 => + array ( + 'index' => + array ( + '日志分类' => 'action=blogcategory', + ), + 'text' => + array ( + 0 => '日志分类', + ), + ), + 80 => + array ( + 'index' => + array ( + '相册分类' => 'action=albumcategory', + ), + 'text' => + array ( + 0 => '相册分类', + ), + ), + 81 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + ), + 'text' => + array ( + 0 => '版块管理', + ), + ), + 82 => + array ( + 'index' => + array ( + '版块合并' => 'action=forums&operation=merge', + ), + 'text' => + array ( + 0 => '版块合并', + ), + ), + 83 => + array ( + 'index' => + array ( + '分类信息' => 'action=threadtypes', + ), + 'text' => + array ( + 0 => '分类信息', + ), + ), + 84 => + array ( + 'index' => + array ( + '首页四格' => 'action=grid', + ), + 'text' => + array ( + 0 => '首页四格', + ), + ), + 85 => + array ( + 'index' => + array ( + '圈子设置' => 'action=group&operation=setting', + ), + 'text' => + array ( + 0 => '圈子设置', + ), + ), + 86 => + array ( + 'index' => + array ( + '圈子分类' => 'action=group&operation=type', + ), + 'text' => + array ( + 0 => '圈子分类', + ), + ), + 87 => + array ( + 'index' => + array ( + '圈子管理' => 'action=group&operation=manage', + ), + 'text' => + array ( + 0 => '圈子管理', + ), + ), + 88 => + array ( + 'index' => + array ( + '圈主权限' => 'action=group&operation=userperm', + ), + 'text' => + array ( + 0 => '圈主权限', + ), + ), + 89 => + array ( + 'index' => + array ( + '圈子等级' => 'action=group&operation=level', + ), + 'text' => + array ( + 0 => '圈子等级', + ), + ), + 90 => + array ( + 'index' => + array ( + '审核圈子' => 'action=group&operation=mod', + ), + 'text' => + array ( + 0 => '审核圈子', + ), + ), + 91 => + array ( + 'index' => + array ( + '基本设置' => 'action=setting&operation=sec', + ), + 'text' => + array ( + 0 => '基本设置', + ), + ), + 92 => + array ( + 'index' => + array ( + '验证设置' => 'action=setting&operation=seccheck', + ), + 'text' => + array ( + 0 => '验证设置', + ), + ), + 93 => + array ( + 'index' => + array ( + '安全大师' => 'action=optimizer&operation=security', + ), + 'text' => + array ( + 0 => '安全大师', + ), + ), + 94 => + array ( + 'index' => + array ( + '底层安全' => 'action=optimizer&operation=serversec', + ), + 'text' => + array ( + 0 => '底层安全', + ), + ), + 95 => + array ( + 'index' => + array ( + '账号保镖' => 'action=setting&operation=accountguard', + ), + 'text' => + array ( + 0 => '账号保镖', + ), + ), + 96 => + array ( + 'index' => + array ( + '站点公告' => 'action=announce', + ), + 'text' => + array ( + 0 => '站点公告', + ), + ), + 97 => + array ( + 'index' => + array ( + '站点广告' => 'action=adv', + ), + 'text' => + array ( + 0 => '站点广告', + ), + ), + 98 => + array ( + 'index' => + array ( + '站点任务' => 'action=tasks', + ), + 'text' => + array ( + 0 => '站点任务', + ), + ), + 99 => + array ( + 'index' => + array ( + '道具中心' => 'action=magics', + ), + 'text' => + array ( + 0 => '道具中心', + ), + ), + 100 => + array ( + 'index' => + array ( + '勋章中心' => 'action=medals', + ), + 'text' => + array ( + 0 => '勋章中心', + ), + ), + 101 => + array ( + 'index' => + array ( + '短信服务' => 'action=smsgw', + ), + 'text' => + array ( + 0 => '短信服务', + ), + ), + 102 => + array ( + 'index' => + array ( + '站点帮助' => 'action=faq', + ), + 'text' => + array ( + 0 => '站点帮助', + ), + ), + 103 => + array ( + 'index' => + array ( + '电子商务' => 'action=setting&operation=ec', + ), + 'text' => + array ( + 0 => '电子商务', + ), + ), + 104 => + array ( + 'index' => + array ( + '友情链接' => 'action=misc&operation=link', + ), + 'text' => + array ( + 0 => '友情链接', + ), + ), + 105 => + array ( + 'index' => + array ( + '站长推荐' => 'action=misc&operation=focus', + ), + 'text' => + array ( + 0 => '站长推荐', + ), + ), + 106 => + array ( + 'index' => + array ( + '关联链接' => 'action=misc&operation=relatedlink', + ), + 'text' => + array ( + 0 => '关联链接', + ), + ), + 107 => + array ( + 'index' => + array ( + '充值卡密' => 'action=card', + ), + 'text' => + array ( + 0 => '充值卡密', + ), + ), + 108 => + array ( + 'index' => + array ( + '插件管理' => 'action=plugins', + ), + 'text' => + array ( + 0 => '插件管理', + ), + ), + 109 => + array ( + 'index' => + array ( + '模板管理' => 'action=styles', + ), + 'text' => + array ( + 0 => '模板管理', + ), + ), + 110 => + array ( + 'index' => + array ( + '更新缓存' => 'action=tools&operation=updatecache', + ), + 'text' => + array ( + 0 => '更新缓存', + ), + ), + 111 => + array ( + 'index' => + array ( + '更新统计' => 'action=counter', + ), + 'text' => + array ( + 0 => '更新统计', + ), + ), + 112 => + array ( + 'index' => + array ( + '运行记录' => 'action=logs', + ), + 'text' => + array ( + 0 => '运行记录', + ), + ), + 113 => + array ( + 'index' => + array ( + '计划任务' => 'action=misc&operation=cron', + ), + 'text' => + array ( + 0 => '计划任务', + ), + ), + 114 => + array ( + 'index' => + array ( + '文件权限检查' => 'action=tools&operation=fileperms', + ), + 'text' => + array ( + 0 => '文件权限检查', + ), + ), + 115 => + array ( + 'index' => + array ( + '文件校验' => 'action=checktools&operation=filecheck', + ), + 'text' => + array ( + 0 => '文件校验', + ), + ), + 116 => + array ( + 'index' => + array ( + '嵌入点校验' => 'action=checktools&operation=hookcheck', + ), + 'text' => + array ( + 0 => '嵌入点校验', + ), + ), + 117 => + array ( + 'index' => + array ( + '密钥更新' => 'action=checktools&operation=replacekey', + ), + 'text' => + array ( + 0 => '密钥更新', + ), + ), + 118 => + array ( + 'index' => + array ( + '后台管理团队' => 'action=founder&operation=perm', + ), + 'text' => + array ( + 0 => '后台管理团队', + ), + ), + 119 => + array ( + 'index' => + array ( + '邮件设置' => 'action=setting&operation=mail', + ), + 'text' => + array ( + 0 => '邮件设置', + ), + ), + 120 => + array ( + 'index' => + array ( + 'UCenter 设置' => 'action=setting&operation=uc', + ), + 'text' => + array ( + 0 => 'UCenter 设置', + ), + ), + 121 => + array ( + 'index' => + array ( + '数据库' => 'action=db&operation=export', + ), + 'text' => + array ( + 0 => '数据库', + ), + ), + 122 => + array ( + 'index' => + array ( + '用户分表' => 'action=membersplit&operation=check', + ), + 'text' => + array ( + 0 => '用户分表', + ), + ), + 123 => + array ( + 'index' => + array ( + '文章分表' => 'action=postsplit&operation=manage', + ), + 'text' => + array ( + 0 => '文章分表', + ), + ), + 124 => + array ( + 'index' => + array ( + '主题分表' => 'action=threadsplit&operation=manage', + ), + 'text' => + array ( + 0 => '主题分表', + ), + ), + 125 => + array ( + 'index' => + array ( + '优化大师' => 'action=optimizer&operation=performance', + ), + 'text' => + array ( + 0 => '优化大师', + ), + ), + 126 => + array ( + 'index' => + array ( + '管理组' => 'action=admingroup', + '主题管理权限' => 'action=admingroup&operation=edit&anchor=threadperm', + ), + 'text' => + array ( + 0 => '管理组 » 主题管理权限', + 1 => 'admingroup_edit_threadperm', + 2 => '主题管理权限', + 3 => 'admingroup_edit_stick_thread', + 4 => '允许置顶主题', + 5 => '设置是否允许置顶管理范围内主题的级别。如果打开全局置顶的功能,置顶 III 将全站置顶,置顶 II 将在当前分类置顶', + 6 => 'admingroup_edit_digest_thread', + 7 => '允许精华主题', + 8 => '设置是否允许精华管理范围内主题的级别', + 9 => 'admingroup_edit_bump_thread', + 10 => '允许提升主题', + 11 => '设置是否允许提升管理范围内的主题', + 12 => 'admingroup_edit_highlight_thread', + 13 => '允许高亮主题', + 14 => '设置是否允许高亮管理范围内的主题', + 15 => 'admingroup_edit_live_thread', + 16 => '允许直播主题', + 17 => '设置是否允许直播管理范围内的主题', + 18 => 'admingroup_edit_recommend_thread', + 19 => '允许推荐主题', + 20 => '设置是否允许推荐管理范围内的主题 (要在相应版块的扩展设置里开启推荐主题功能)', + 21 => 'admingroup_edit_stamp_thread', + 22 => '允许添加主题图章', + 23 => '设置是否允许给主题在文章内容页添加图章', + 24 => 'admingroup_edit_stamp_list', + 25 => '允许添加主题图标', + 26 => '设置是否允许给主题在文章列表页添加图标', + 27 => 'admingroup_edit_close_thread', + 28 => '允许关闭主题', + 29 => '设置是否允许关闭管理范围内的主题', + 30 => 'admingroup_edit_move_thread', + 31 => '允许移动主题', + 32 => '设置是否允许移动管理范围内的主题', + 33 => 'admingroup_edit_edittype_thread', + 34 => '允许编辑主题分类', + 35 => '设置是否允许编辑管理范围内主题的分类', + 36 => 'admingroup_edit_copy_thread', + 37 => '允许复制主题', + 38 => '设置是否允许复制管理范围内的主题', + 39 => 'admingroup_edit_merge_thread', + 40 => '允许合并主题', + 41 => '设置是否允许合并管理范围内的主题', + 42 => 'admingroup_edit_split_thread', + 43 => '允许分割主题', + 44 => '设置是否允许分割管理范围内的主题', + 45 => 'admingroup_edit_repair_thread', + 46 => '允许修复主题', + 47 => '设置是否允许修复管理范围内的主题', + 48 => 'admingroup_edit_refund', + 49 => '允许强制退款', + 50 => '允许将作者发布的收费主题终止,并将作者所获得收益退还给购买者。退款后,该主题将不能再被设置为收费主题,同时作者将自行承担积分交易而产生的损失', + 51 => 'admingroup_edit_edit_poll', + 52 => '允许编辑投票', + 53 => '设置是否允许编辑管理范围内投票主题的选项', + 54 => 'admingroup_edit_remove_reward', + 55 => '允许移除悬赏', + 56 => '设置是否允许移除管理范围内悬赏主题的悬赏金额', + 57 => 'admingroup_edit_edit_activity', + 58 => '允许管理活动报名者', + 59 => '设置是否允许管理范围内活动主题的报名者', + 60 => 'admingroup_edit_edit_trade', + 61 => '允许编辑商品', + 62 => '设置是否允许编辑管理范围内商品主题的商品', + 63 => 'admingroup_edit_usertag', + 64 => '允许添加用户标签', + 65 => '设置是否允许编辑管理范围内主题的用户标签', + 66 => 'admingroup_edit_stick_thread_none', + 67 => '不允许置顶', + 68 => 'admingroup_edit_stick_thread_1', + 69 => '允许置顶 I', + 70 => 'admingroup_edit_stick_thread_2', + 71 => '允许置顶 I/II', + 72 => 'admingroup_edit_stick_thread_3', + 73 => '允许置顶 I/II/III', + 74 => 'admingroup_edit_digest_thread_none', + 75 => '不允许精华', + 76 => 'admingroup_edit_digest_thread_1', + 77 => '允许精华 I', + 78 => 'admingroup_edit_digest_thread_2', + 79 => '允许精华 I/II', + 80 => 'admingroup_edit_digest_thread_3', + 81 => '允许精华 I/II/III', + ), + ), + 127 => + array ( + 'index' => + array ( + '管理组' => 'action=admingroup', + '文章管理权限' => 'action=admingroup&operation=edit&anchor=postperm', + ), + 'text' => + array ( + 0 => '管理组 » 文章管理权限', + 1 => 'admingroup_edit_postperm', + 2 => '文章管理权限', + 3 => 'admingroup_edit_edit_post', + 4 => '允许编辑文章', + 5 => '设置是否允许编辑管理范围内的文章', + 6 => 'admingroup_edit_warn_post', + 7 => '允许警告文章', + 8 => '设置是否允许警告管理范围内的文章', + 9 => 'admingroup_edit_ban_post', + 10 => '允许屏蔽文章', + 11 => '设置是否允许屏蔽管理范围内的文章', + 12 => 'admingroup_edit_del_post', + 13 => '允许删除文章', + 14 => '设置是否允许删除管理范围内的文章', + 15 => 'admingroup_edit_stick_post', + 16 => '允许置顶回帖', + 17 => '设置是否允许置顶管理范围内的回帖', + 18 => 'admingroup_edit_manage_tag', + 19 => '允许管理标签', + 20 => '设置是否允许管理管理范围内的标签', + ), + ), + 128 => + array ( + 'index' => + array ( + '管理组' => 'action=admingroup', + '管理面板权限' => 'action=admingroup&operation=edit&anchor=modcpperm', + ), + 'text' => + array ( + 0 => '管理组 » 管理面板权限', + 1 => 'admingroup_edit_modcpperm', + 2 => '管理面板权限', + 3 => 'admingroup_edit_mod_post', + 4 => '允许审核文章', + 5 => '设置是否允许审核用户发表的文章,只在站点设置需要审核时有效', + 6 => 'admingroup_edit_mod_user', + 7 => '允许审核用户', + 8 => '设置是否允许审核新注册用户,只在站点设置需要人工审核新用户时有效', + 9 => 'admingroup_edit_ban_user', + 10 => '允许禁止用户发言', + 11 => '设置是否允许禁止用户发言', + 12 => 'admingroup_edit_ban_user_visit', + 13 => '允许禁止用户访问', + 14 => '设置是否允许禁止用户访问', + 15 => 'admingroup_edit_ban_ip', + 16 => '允许禁止 IP', + 17 => '设置是否允许添加或修改禁止 IP 设置', + 18 => 'admingroup_edit_edit_user', + 19 => '允许编辑用户', + 20 => '设置是否允许编辑用户资料', + 21 => 'admingroup_edit_mass_prune', + 22 => '允许批量删帖', + 23 => '设置是否允许通过管理面板批量删帖,版主在面板中批量删帖的范围是 1 周内,超级版主删帖范围是 2 周内, 管理员无限制', + 24 => 'admingroup_edit_edit_forum', + 25 => '允许编辑版块', + 26 => '设置是否允许编辑管理范围内的版块的资料', + 27 => 'admingroup_edit_post_announce', + 28 => '允许发布公告', + 29 => '设置是否允许发布站点公告', + 30 => 'admingroup_edit_clear_recycle', + 31 => '允许删除回收站的文章', + 32 => '设置是否允在“前台->管理面板->主题回收站”中删除主题', + 33 => 'admingroup_edit_view_log', + 34 => '允许查看管理日志', + 35 => '设置是否允许查看管理日志', + ), + ), + 129 => + array ( + 'index' => + array ( + '管理组' => 'action=admingroup', + '空间管理权限' => 'action=admingroup&operation=edit&anchor=spaceperm', + ), + 'text' => + array ( + 0 => '管理组 » 空间管理权限', + 1 => 'admingroup_edit_spaceperm', + 2 => '空间管理权限', + 3 => 'admingroup_edit_manage_feed', + 4 => '允许管理动态(feed)', + 5 => 'admingroup_edit_manage_doing', + 6 => '允许管理记录', + 7 => 'admingroup_edit_manage_share', + 8 => '允许管理分享', + 9 => 'admingroup_edit_manage_blog', + 10 => '允许管理日志', + 11 => 'admingroup_edit_manage_album', + 12 => '允许管理相册', + 13 => 'admingroup_edit_manage_comment', + 14 => '允许管理评论', + 15 => 'admingroup_edit_manage_magiclog', + 16 => '允许管理道具记录', + 17 => 'admingroup_edit_manage_report', + 18 => '允许管理举报', + 19 => 'admingroup_edit_manage_hotuser', + 20 => '允许管理推荐成员', + 21 => 'admingroup_edit_manage_defaultuser', + 22 => '允许管理推荐好友', + 23 => 'admingroup_edit_manage_magic', + 24 => '允许管理道具', + 25 => 'admingroup_edit_manage_click', + 26 => '允许管理表态动作', + ), + ), + 130 => + array ( + 'index' => + array ( + '管理组' => 'action=admingroup', + '其他权限' => 'action=admingroup&operation=edit&anchor=otherperm', + ), + 'text' => + array ( + 0 => '管理组 » 其他权限', + 1 => 'admingroup_edit_otherperm', + 2 => '其他权限', + 3 => 'admingroup_edit_view_ip', + 4 => '允许查看 IP', + 5 => '设置是否允许查看用户 IP', + 6 => 'admingroup_edit_manage_collection', + 7 => '允许管理淘专辑', + 8 => '设置是否允许管理淘专辑', + 9 => 'admingroup_edit_allow_make_html', + 10 => '允许生成HTML文件', + 11 => '设置是否允许生成HTML文件', + ), + ), + 131 => + array ( + 'index' => + array ( + '管理组' => 'action=admingroup', + '门户管理权限' => 'action=admingroup&operation=edit&anchor=portalperm', + ), + 'text' => + array ( + 0 => '管理组 » 门户管理权限', + 1 => 'admingroup_edit_portalperm', + 2 => '门户管理权限', + 3 => 'admingroup_edit_manage_article', + 4 => '允许管理所有文章', + 5 => '选择“是”则允许此管理组成员管理编辑删除所有频道栏目文章', + 6 => 'admingroup_edit_add_topic', + 7 => '允许创建专题', + 8 => '设置是否允许创建专题', + 9 => 'admingroup_edit_manage_topic', + 10 => '允许管理专题', + 11 => '设置是否允许编辑所有专题', + 12 => 'admingroup_edit_diy', + 13 => '允许 DIY', + 14 => '设置是否允许 DIY 论坛,文章,空间,论坛等页面', + ), + ), + 132 => + array ( + 'index' => + array ( + '站点广告' => 'action=adv', + '广告位' => 'action=adv&operation=list', + ), + 'text' => + array ( + 0 => '站点广告 » 广告位', + 1 => 'adv_list_tip', + 2 => '您可以使用“自定义广告位”在页面的任意位置添加广告位。系统广告位位于 source/class/adv/ 目录中,插件广告位位于 source/plugin/插件目录/adv/ 目录中。插件开发人员在设计新的广告位前请务必仔细阅读《Discuz! 技术文档》中的内容。', + ), + ), + 133 => + array ( + 'index' => + array ( + '相册管理' => 'action=album', + '最新列表' => 'action=album', + ), + 'text' => + array ( + 0 => '相册管理 » 最新列表', + 1 => 'album_tips', + 2 => '批量相册管理用于删除相册使用。连图片一同删除提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + ), + ), + 134 => + array ( + 'index' => + array ( + '相册管理' => 'action=album', + '搜索' => 'action=album&search=true', + ), + 'text' => + array ( + 0 => '相册管理 » 搜索', + 1 => 'album_search_detail', + 2 => '显示详细相册列表', + 3 => 'album_search_perpage', + 4 => '每页显示数', + 5 => 'resultsort', + 6 => '结果排序', + 7 => 'album_search_albumname', + 8 => '相册名', + 9 => 'album_search_albumid', + 10 => '相册 ID', + 11 => '多相册 ID 中间请用半角逗号 "," 隔开', + 12 => 'album_search_uid', + 13 => '用户 UID', + 14 => '多 UID 中间请用半角逗号 "," 隔开', + 15 => 'album_search_user', + 16 => '创建相册用户名', + 17 => '多用户名中间请用半角逗号 "," 隔开', + 18 => 'blog_search_friend', + 19 => '查看权限', + 20 => 'album_search_time', + 21 => '更新时间范围', + 22 => '格式 yyyy-mm-dd', + ), + ), + 135 => + array ( + 'index' => + array ( + '相册分类' => 'action=albumcategory', + ), + 'text' => + array ( + 0 => '相册分类', + 1 => 'system_category_stat', + 2 => '开启系统分类', + 3 => 'system_category_required', + 4 => '系统分类必填', + ), + ), + 136 => + array ( + 'index' => + array ( + '站点公告' => 'action=announce', + ), + 'text' => + array ( + 0 => '站点公告', + 1 => 'announce_edit', + 2 => '站点公告编辑', + 3 => 'start_time', + 4 => '起始时间', + 5 => 'end_time', + 6 => '终止时间', + 7 => 'announce_type', + 8 => '公告类型', + 9 => 'announce_message', + 10 => '内容', + 11 => '文字公告: 直接输入公告内容,支持 Discuz! 代码网址链接: 请输入公告的链接地址如某个主题地址: http://xxx.xxx.xxx', + 12 => 'subject', + 13 => '标题', + 14 => 'announce_words', + 15 => '文字公告', + 16 => 'announce_url', + 17 => '网址链接', + ), + ), + 137 => + array ( + 'index' => + array ( + '第三方模块' => 'action=blockxml', + '搜索' => 'action=blockxml&operation=add', + ), + 'text' => + array ( + 0 => '第三方模块 » 搜索', + 1 => 'blockxml_tips', + 2 => '插件开发人员在设计新的第三方模块前请务必仔细阅读《Discuz! 技术文档》中的内容。', + 3 => 'blockxml_add', + 4 => '添加 第三方模块', + 5 => 'blockxml_xmlurl', + 6 => '第三方地址', + 7 => '输入 第三方模块的 URL 地址,第三方返回的内容必须 XML 模块的格式', + 8 => 'blockxml_clientid', + 9 => '客户端ID', + 10 => '此ID由数据源方提供', + 11 => 'blockxml_signtype', + 12 => '签名加密方式', + 13 => '目前支持MD5加密方式,也可以不使用签名,由数据源方提供', + 14 => 'blockxml_xmlkey', + 15 => '通信密钥', + 16 => '从 URL 地址获得数据时的密钥,如果数据源不需要密钥可以为空。此密钥由数据源方提供', + ), + ), + 138 => + array ( + 'index' => + array ( + '日志管理' => 'action=blog', + '最新列表' => 'action=blog', + ), + 'text' => + array ( + 0 => '日志管理 » 最新列表', + 1 => 'blog_tips', + 2 => '批量日志信息管理用于删除日志使用,并且连同对应的回复一同删除。关键字可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略字符的个数,如 "a{1}s{2}s"(不含引号) 可以搜索到 "ass" 也可搜索到 "axsxs" 和 "axsxxs" 等等。提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + ), + ), + 139 => + array ( + 'index' => + array ( + '日志管理' => 'action=blog', + '搜索' => 'action=blog&search=true', + ), + 'text' => + array ( + 0 => '日志管理 » 搜索', + 1 => 'blog_search_detail', + 2 => '显示详细日志列表', + 3 => 'blog_search_perpage', + 4 => '每页显示数', + 5 => 'resultsort', + 6 => '结果排序', + 7 => 'blog_search_uid', + 8 => '用户 UID', + 9 => '多 UID 中间请用半角逗号 "," 隔开', + 10 => 'blog_search_blogid', + 11 => '日志 ID', + 12 => '多日志 ID 中间请用半角逗号 "," 隔开', + 13 => 'blog_search_user', + 14 => '发表日志用户名', + 15 => '多用户名中间请用半角逗号 "," 隔开', + 16 => 'blog_search_keyword', + 17 => '标题或内容关键字', + 18 => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 19 => 'blog_search_friend', + 20 => '查看权限', + 21 => 'blog_search_ip', + 22 => '发布IP', + 23 => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 24 => 'blog_search_lengthlimit', + 25 => '内容最小长度', + 26 => '本功能会加重服务器负担', + 27 => 'blog_search_view', + 28 => '查看数', + 29 => 'blog_search_reply', + 30 => '回复数', + 31 => 'blog_search_hot', + 32 => '热度', + 33 => 'blog_search_time', + 34 => '发表时间范围', + 35 => '格式 yyyy-mm-dd', + ), + ), + 140 => + array ( + 'index' => + array ( + '日志分类' => 'action=blogcategory', + ), + 'text' => + array ( + 0 => '日志分类', + 1 => 'system_category_stat', + 2 => '开启系统分类', + 3 => 'system_category_required', + 4 => '系统分类必填', + ), + ), + 141 => + array ( + 'index' => + array ( + '日志回收站' => 'action=blogrecyclebin', + '日志列表' => 'action=blogrecyclebin', + ), + 'text' => + array ( + 0 => '日志回收站 » 日志列表', + 1 => 'blog_tips', + 2 => '批量日志信息管理用于删除日志使用,并且连同对应的回复一同删除。关键字可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略字符的个数,如 "a{1}s{2}s"(不含引号) 可以搜索到 "ass" 也可搜索到 "axsxs" 和 "axsxxs" 等等。提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + ), + ), + 142 => + array ( + 'index' => + array ( + '日志管理' => 'action=blog', + '搜索' => 'action=blog&search=true', + ), + 'text' => + array ( + 0 => '日志管理 » 搜索', + 1 => 'blog_search_detail', + 2 => '显示详细日志列表', + 3 => 'blog_search_perpage', + 4 => '每页显示数', + 5 => 'resultsort', + 6 => '结果排序', + 7 => 'blog_search_uid', + 8 => '用户 UID', + 9 => '多 UID 中间请用半角逗号 "," 隔开', + 10 => 'blog_search_blogid', + 11 => '日志 ID', + 12 => '多日志 ID 中间请用半角逗号 "," 隔开', + 13 => 'blog_search_user', + 14 => '发表日志用户名', + 15 => '多用户名中间请用半角逗号 "," 隔开', + 16 => 'blog_search_keyword', + 17 => '标题或内容关键字', + 18 => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 19 => 'blog_search_friend', + 20 => '查看权限', + 21 => 'blog_search_ip', + 22 => '发布IP', + 23 => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 24 => 'blog_search_lengthlimit', + 25 => '内容最小长度', + 26 => '本功能会加重服务器负担', + 27 => 'blog_search_view', + 28 => '查看数', + 29 => 'blog_search_reply', + 30 => '回复数', + 31 => 'blog_search_hot', + 32 => '热度', + 33 => 'blog_search_time', + 34 => '发表时间范围', + 35 => '格式 yyyy-mm-dd', + ), + ), + 143 => + array ( + 'index' => + array ( + '允许前台充值' => 'action=card', + ), + 'text' => + array ( + 0 => '允许前台充值', + 1 => 'card_config_open', + 2 => '允许前台充值', + 3 => '设置是否允许前台充值,关闭前台充值功能,不影响后台卡密的生成充值卡密验证码开关:全局->安全->验证设置', + ), + ), + 144 => + array ( + 'index' => + array ( + '导出充值卡密最多支持 10000 条数据,导出的文件可用 EXCEL、WPS表格、腾讯文档等工具打开。' => 'action=card&operation=manage', + ), + 'text' => + array ( + 0 => '导出充值卡密最多支持 10000 条数据,导出的文件可用 EXCEL、WPS表格、腾讯文档等工具打开。', + 1 => 'card_manage_tips', + 2 => '导出充值卡密最多支持 10000 条数据,导出的文件可用 EXCEL、WPS表格、腾讯文档等工具打开。', + ), + ), + 145 => + array ( + 'index' => + array ( + '卡密分类删除时,其下所有卡片将自动纳入“默认分类”' => 'action=card&operation=type', + ), + 'text' => + array ( + 0 => '卡密分类删除时,其下所有卡片将自动纳入“默认分类”', + 1 => 'card_type_tips', + 2 => '卡密分类删除时,其下所有卡片将自动纳入“默认分类”', + ), + ), + 146 => + array ( + 'index' => + array ( + '生成卡密时,简单的规则或较小的生成张数可能导致实际生成张数小于预设生成张数。' => 'admin.php?action=card&operation=make', + ), + 'text' => + array ( + 0 => '生成卡密时,简单的规则或较小的生成张数可能导致实际生成张数小于预设生成张数。', + 1 => 'card_make_tips', + 2 => '生成卡密时,简单的规则或较小的生成张数可能导致实际生成张数小于预设生成张数。', + 3 => 'card_make_rule', + 4 => '卡密生成规则', + 5 => '"@"代表任意随机英文字符,"#"代表任意随机数字,"*"代表任意英文或数字卡密规则样本:"DZ2011@@@@@#####*****"注意:规则位数过小会造成卡密生成重复概率增大,过多的重复卡密会造成卡密生成终止卡密规则中不能带有中文及其他特殊符号为了避免卡密重复,随机位数最好不要少于8位', + 6 => 'card_type', + 7 => '卡密分类', + 8 => 'card_make_num', + 9 => '生成张数', + 10 => '设置本次生成的卡密张数', + 11 => 'card_make_extcredits', + 12 => '积分数额及类型', + 13 => '设置本次生成充值卡密可充得的积分数额与类型', + 14 => 'card_make_price', + 15 => '实际面值', + 16 => '单位(元),实际面值常用在卡片印刷,用作告知用户面值以衡量卡密价值', + 17 => 'card_make_cleardateline', + 18 => '有效期至', + 19 => '默认有效期为一年卡密会在设定时间的24:00失效,状态变更为“已过期”', + 20 => 'card_make_description', + 21 => '备注', + 22 => '为本次生成的卡密添加备注说明,备注将显示在“生成记录”中', + 23 => 'card_number', + 24 => '卡密', + 25 => 'card_number_unit', + 26 => '位', + ), + ), + 147 => + array ( + 'index' => + array ( + '表态动作' => 'action=click', + ), + 'text' => + array ( + 0 => '表态动作', + 1 => 'click_edit_tips', + 2 => '本功能用于设置日志/图片/文章表态动作,动作图片中请填写图片文件名,并将相应图片文件上传到 static/image/click/ 目录中或直接填写图片 URL 地址。警告:站点运营一段时间后,中途改变各表情的顺序将会影响之前的表态结果每个类型最多启用8个动作', + ), + ), + 148 => + array ( + 'index' => + array ( + '淘帖管理' => 'action=collection', + ), + 'text' => + array ( + 0 => '淘帖管理', + 1 => 'collection_ctid', + 2 => '淘专辑 ID', + 3 => 'collection_comment_message', + 4 => '评论内容', + 5 => 'collection_comment_cid', + 6 => '评论 ID', + 7 => 'collection_comment_username', + 8 => '评论人用户名', + 9 => 'collection_comment_uid', + 10 => '评论人 UID', + 11 => 'collection_comment_rate', + 12 => '评分大于', + 13 => 'collection_comment_useip', + 14 => 'IP 地址', + 15 => 'threads_search_time', + 16 => '发表时间范围', + 17 => '格式 yyyy-mm-dd,不限制请输入 0', + 18 => 'feed_search_perpage', + 19 => '每页显示数', + 20 => 'collection_name', + 21 => '淘专辑名称', + 22 => 'collection_username', + 23 => '淘专辑作者', + 24 => 'collection_uid', + 25 => '淘专辑作者 UID', + 26 => 'collection_recommend_index_autonumber', + 27 => '首页推荐数量', + 28 => '设置后,会在首页推荐指定数量的热门专辑,设为“0”则关闭推荐功能。当手动推荐数量未达到设置的数量时,系统会自动推荐专辑。', + ), + ), + 149 => + array ( + 'index' => + array ( + '留言管理' => 'action=comment', + '评论/留言' => 'action=comment', + ), + 'text' => + array ( + 0 => '留言管理 » 评论/留言', + 1 => 'comment_tips', + 2 => '批量留言管理用于删除留言使用。提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + 3 => 'comment_search_detail', + 4 => '显示详细留言列表', + 5 => 'comment_search_perpage', + 6 => '每页显示数', + 7 => 'comment_idtype', + 8 => '评论类型', + 9 => 'comment_search_id', + 10 => '留言 ID', + 11 => '多留言 ID 中间请用半角逗号 "," 隔开', + 12 => 'comment_search_author', + 13 => '评论者', + 14 => '多评论者名中间请用半角逗号 "," 隔开', + 15 => 'comment_search_authorid', + 16 => '评论者 ID', + 17 => '多评论者 ID 中间请用半角逗号 "," 隔开', + 18 => 'comment_search_uid', + 19 => '被评论者 UID', + 20 => '多 UID 中间请用半角逗号 "," 隔开', + 21 => 'comment_search_message', + 22 => '评论内容', + 23 => 'comment_search_ip', + 24 => '发布IP', + 25 => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 26 => 'comment_search_time', + 27 => '评论时间范围', + 28 => '格式 yyyy-mm-dd', + 29 => 'all', + 30 => '全部', + 31 => 'comment_uid', + 32 => '留言', + 33 => 'comment_blogid', + 34 => '日志', + 35 => 'comment_picid', + 36 => '图片', + 37 => 'comment_sid', + 38 => '分享', + ), + ), + 150 => + array ( + 'index' => + array ( + '留言管理' => 'action=comment', + '文章评论' => 'action=comment&operation=article', + '专题评论' => 'action=comment&operation=topic', + ), + 'text' => + array ( + 0 => '留言管理 » 文章评论 » 专题评论', + 1 => 'comment_', + 2 => '', + 3 => 'comment_search_perpage', + 4 => '每页显示数', + 5 => 'comment_search_message', + 6 => '评论内容', + 7 => 'comment_search_author', + 8 => '评论者', + 9 => '多评论者名中间请用半角逗号 "," 隔开', + 10 => 'comment_search_authorid', + 11 => '评论者 ID', + 12 => '多评论者 ID 中间请用半角逗号 "," 隔开', + 13 => 'comment_search_time', + 14 => '评论时间范围', + 15 => '格式 yyyy-mm-dd', + ), + ), + 151 => + array ( + 'index' => + array ( + '更新统计' => 'action=counter', + ), + 'text' => + array ( + 0 => '更新统计', + 1 => 'counter_tips', + 2 => '当下列数据不正常时,可以使用此功能对数据进行更新校正。请尽量避开会员访问的高峰时间 + 每个循环更新数量:数值请在一个合理范围,不要过大,否则会给服务器带来负载压力 + ', + ), + ), + 152 => + array ( + 'index' => + array ( + '数据库' => 'action=db&operation=export', + '备份' => 'action=db&operation=export', + ), + 'text' => + array ( + 0 => '数据库 » 备份', + 1 => 'db_export_type', + 2 => '数据备份类型', + 3 => 'db_export_method', + 4 => '数据备份方式', + 5 => 'db_export_options', + 6 => '数据备份选项', + 7 => 'db_export_options_extended_insert', + 8 => '使用扩展插入(Extended Insert)方式', + 9 => 'db_export_options_sql_compatible', + 10 => '建表语句格式', + 11 => 'db_export_options_charset', + 12 => '强制字符集', + 13 => 'db_export_usehex', + 14 => '十六进制方式', + 15 => 'db_export_usezip', + 16 => '压缩备份文件', + 17 => 'db_export_filename', + 18 => '备份文件名', + 19 => 'db_export_custom', + 20 => '自定义备份', + 21 => '根据需要自行选择需要备份的数据表', + 22 => 'db_export_shell', + 23 => '系统 MySQL Dump (Shell) 备份', + 24 => 'db_export_multivol', + 25 => 'Discuz! 分卷备份 - 文件长度限制(单位:KB)', + 26 => 'default', + 27 => '默认', + 28 => 'db_export_zip_1', + 29 => '多分卷压缩成一个文件', + 30 => 'db_export_zip_2', + 31 => '每个分卷压缩成单独文件', + 32 => 'db_export_zip_3', + 33 => '不压缩', + ), + ), + 153 => + array ( + 'index' => + array ( + '数据库' => 'action=db&operation=export', + '恢复' => 'action=db&operation=import', + ), + 'text' => + array ( + 0 => '数据库 » 恢复', + 1 => 'db_import_tips', + 2 => '本功能在恢复备份数据的同时,将全部覆盖原有数据,请确定恢复前已将站点关闭,恢复全部完成后可以将站点重新开放。出于安全考虑,我们强烈建议您恢复数据库备份文件后删除文件或设置文件不可通过 URL 访问。恢复数据前请在 Discuz! 安装文件目录下 utility 文件夹内找到 restore.php 文件,然后将 restore.php 文件上传到程序文件夹data目录下。为了您站点的安全,成功恢复数据后请务必及时删除 restore.php 文件。您可以在数据备份记录处查看站点的备份文件的详细信息,删除过期的备份,并导入需要的备份。', + 3 => 'db_import', + 4 => '数据恢复', + ), + ), + 154 => + array ( + 'index' => + array ( + '数据库' => 'action=db&operation=export', + '升级' => 'action=db&operation=runquery', + ), + 'text' => + array ( + 0 => '数据库 » 升级', + 1 => 'db_runquery_tips', + 2 => '您可以通过修改 /source/admincp/admincp_quickquery.php 来添加常用 SQL 操作进行功能扩充。出于安全考虑,Discuz! 后台默认情况下禁止 SQL 语句直接执行,只能使用常用 SQL 当中的内容,如果您想自己随意书写 SQL 升级语句,需要将 config/config_global.php 当中的 $_config[\'admincp\'][\'runquery\'] 设置修改为 1。', + 3 => 'db_runquery_simply', + 4 => '常用 SQL 升级语句', + 5 => 'db_runquery_sql', + 6 => 'Discuz! 数据库升级 - 请将数据库升级语句粘贴在下面', + ), + ), + 155 => + array ( + 'index' => + array ( + '数据库' => 'action=db&operation=export', + '优化' => 'action=db&operation=optimize', + ), + 'text' => + array ( + 0 => '数据库 » 优化', + 1 => 'db_optimize_tips', + 2 => '数据表优化可以去除数据文件中的碎片,使记录排列紧密,提高读写速度。', + ), + ), + 156 => + array ( + 'index' => + array ( + '地区设置' => 'action=district', + ), + 'text' => + array ( + 0 => '地区设置', + 1 => 'district_tips', + 2 => '您可以自己编辑地区数据添加,编辑或删除操作后需要点击“提交”按钮才生效', + ), + ), + 157 => + array ( + 'index' => + array ( + '记录管理' => 'action=doing', + ), + 'text' => + array ( + 0 => '记录管理', + 1 => 'doing_tips', + 2 => '批量记录信息管理用于删除记录使用,并且连同对应的回复一同删除。关键字可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略字符的个数,如 "a{1}s{2}s"(不含引号) 可以搜索到 "ass" 也可搜索到 "axsxs" 和 "axsxxs" 等等。提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + ), + ), + 158 => + array ( + 'index' => + array ( + '记录管理' => 'action=doing', + '搜索' => 'action=doing&search=true', + ), + 'text' => + array ( + 0 => '记录管理 » 搜索', + 1 => 'doing_search_detail', + 2 => '显示详细记录列表', + 3 => 'doing_search_perpage', + 4 => '每页显示数', + 5 => 'doing_search_user', + 6 => '发表记录用户名', + 7 => '多用户名中间请用半角逗号 "," 隔开', + 8 => 'doing_search_ip', + 9 => '发表记录 IP ', + 10 => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 11 => 'doing_search_keyword', + 12 => '内容关键字', + 13 => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 14 => 'doing_search_lengthlimit', + 15 => '内容最小长度', + 16 => '本功能会加重服务器负担', + 17 => 'doing_search_time', + 18 => '发表时间范围', + 19 => '格式 yyyy-mm-dd', + ), + ), + 159 => + array ( + 'index' => + array ( + '域名设置' => 'action=domain', + '应用域名' => 'domain&operation=app', + ), + 'text' => + array ( + 0 => '域名设置 » 应用域名', + 1 => 'setting_domain_app_tips', + 2 => '各自绑定的域名不能相同,域名不需要添加“http://”,也不要以“/”结尾,例如:portal.discuz.vip任意开启一项域名,需要配置默认域名,否则会造成多入口问题当开启多域名时,请在 config/config_global.php 中修改 cookiedomain 值来设置 cookie 作用域', + ), + ), + 160 => + array ( + 'index' => + array ( + '域名设置' => 'action=domain', + '根域名设置' => 'domain&operation=root', + ), + 'text' => + array ( + 0 => '域名设置 » 根域名设置', + 1 => 'setting_domain_root_tips', + 2 => '可以为个人空间、圈子、版块、专题、频道设置一个二级域名的根域名。例:用户申请XXX.discuz.vip,根域名填:discuz.vip个人空间、圈子设置完二级域名的根后,还需要在基本设置中开启相应的二级域名开关,用户才能在相应的地方申请绑定二级域名,同时受限于用户组的二级域名长度频道启用二级域名如果是绑定目录的,需要自已在环境中配置相关的绑定操作不建议中途将不同的根域变更为相同的根域', + ), + ), + 161 => + array ( + 'index' => + array ( + '域名设置' => 'action=domain', + '基本设置' => 'domain&operation=base', + ), + 'text' => + array ( + 0 => '域名设置 » 基本设置', + 1 => 'setting_domain_base_tips', + 2 => '保留二级域名设置后所有人都无法申请或使用该域名个人空间、圈子的二级域名开启后需要到根域名设置中设置圈子、动态的根域名', + 3 => 'setting_domain_allow_space', + 4 => '开启个人空间二级域名', + 5 => '开启后需在设置根域名、以及用户组域名长度后方能开启域名申请', + 6 => 'setting_domain_allow_group', + 7 => '开启圈子二级域名', + 8 => '开启后需在设置根域名、以及用户组域名长度后方能开启域名申请', + 9 => 'setting_domain_hold_domain', + 10 => '保留二级域名', + 11 => '多个之间用 | 隔开,可以使用通配符* ', + ), + ), + 162 => + array ( + 'index' => + array ( + '电子商务' => 'action=setting&operation=ec', + '支付宝' => 'action=ec&operation=alipay', + ), + 'text' => + array ( + 0 => '电子商务 » 支付宝', + 1 => 'ec_alipay_tips', + 2 => '“支付宝”(http://www.alipay.com)是中国领先的网上支付平台,由全球最佳 B2B 公司阿里巴巴公司创建,为 Discuz! 用户提供积分购买及论坛 B2C、C2C 交易平台。您只需进行简单的设置,即可使论坛内容和人气,真成为除广告收入外的重要利润来源,从而实现论坛的规模化经营。由于涉及现金交易,为避免因操作不当而造成的资金损失,请在开始使用支付宝积分交易功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关设置。您使用支付宝服务是建立在完全自愿的基础上,除 Discuz! 因主观恶意的因素造成的资金损失以外,腾讯云不对因使用此功能造成的任何损失承担责任。支付宝客户服务电话为 95188。', + 3 => 'ec_alipay', + 4 => '支付宝设置', + 5 => 'ec_alipay_on', + 6 => '是否启用支付宝', + 7 => 'ec_alipay_sign_mode', + 8 => '加签模式', + 9 => '支付宝开放平台:查看; 企业开发者若涉及 资金类支出接口 接入,必须使用 公钥证书模式加签 方式; 个人开发者不涉及到资金类接口,建议使用 普通公钥模式加签 进行加签; 接口加签:配置接口加签方式', + 10 => 'ec_alipay_appid', + 11 => '(必须)应用ID', + 12 => '支付宝分配给开发者的应用ID,查看我的应用列表', + 13 => 'ec_alipay_app_private_key', + 14 => '(必须)RSA2(SHA256)开发者私钥', + 15 => '普通公钥模式获取详情请参见 获取普通公钥', + 16 => 'ec_alipay_public_key', + 17 => '(必须)RSA2(SHA256)支付宝公钥', + 18 => '普通公钥模式获取详情请参见 获取普通公钥', + 19 => 'ec_alipay_app_cert', + 20 => '(必须)RSA2(SHA256)应用公钥证书', + 21 => '公钥证书模式获取详情请参见 获取公钥证书;appCertPublicKey_*.crt,使用记事本打开此文件,全选复制内容到此处', + 22 => 'ec_alipay_alipay_cert', + 23 => '(必须)RSA2(SHA256)支付宝公钥证书', + 24 => '公钥证书模式获取详情请参见 获取公钥证书;alipayCertPublicKey_RSA2.crt,使用记事本打开此文件,全选复制内容到此处', + 25 => 'ec_alipay_alipay_root_cert', + 26 => '(必须)RSA2(SHA256)支付宝根证书', + 27 => '公钥证书模式获取详情请参见 获取公钥证书;alipayRootCert.crt,使用记事本打开此文件,全选复制内容到此处', + 28 => 'ec_alipay_check', + 29 => '支付测试', + 30 => '本测试将模拟提交 0.01 元人民币的订单进行测试,如果提交后成功出现付款界面,说明您站点的支付宝功能可以正常使用', + 31 => 'ec_alipay_checklink_credit', + 32 => '积分充值订单测试', + ), + ), + 163 => + array ( + 'index' => + array ( + '电子商务' => 'action=setting&operation=ec', + '微信支付' => 'action=ec&operation=wechat', + ), + 'text' => + array ( + 0 => '电子商务 » 微信支付', + 1 => 'ec_wechat_tips', + 2 => '微信支付(https://pay.weixin.qq.com)是腾讯集团旗下中国领先的第三方支付平台,一直致力于为用户和企业提供安全、便捷、专业的在线支付服务。以“微信支付,不止支付”为核心理念,为个人用户创造了多种便民服务和应用场景,为各类企业以及小微商户提供专业的收款能力,运营能力,资金结算解决方案,以及安全保障。企业、商品、门店、用户已经通过微信连在了一起,让智慧生活,变成了现实。由于涉及现金交易,为避免因操作不当而造成的资金损失,请在开始使用微信支付积分交易功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关设置。您使用微信支付服务是建立在完全自愿的基础上,除 Discuz! 因主观恶意的因素造成的资金损失以外,腾讯云不对因使用此功能造成的任何损失承担责任。微信支付客户服务电话为 95017。', + 3 => 'ec_wechat', + 4 => '微信支付设置', + 5 => 'ec_wechat_on', + 6 => '是否启用微信支付', + 7 => 'ec_wechat_version', + 8 => 'API版本', + 9 => 'APIV3要求PHP版本 >= 7.2', + 10 => 'ec_wechat_appid', + 11 => '(必须)公众号APPID', + 12 => '微信公众号必须有开通微信商户平台', + 13 => 'ec_wechat_appsecret', + 14 => '(必须)公众号APPSECRET', + 15 => 'ec_wechat_mch_id', + 16 => '(必须)商户号', + 17 => '微信支付分配的商户号', + 18 => 'ec_wechat_v1_key', + 19 => '(必须)API密钥', + 20 => '微信商户平台-->账户设置-->API安全-->密钥设置 - API密钥', + 21 => 'ec_wechat_v1_cert', + 22 => '(可选)支付证书路径', + 23 => 'cert.p12证书的位置;建议修改文件名称,避免被直接访问;退款时用到,如果不办理退款业务,可以不填。必须在网站目录中,如:source/data/{randomstr}.p12', + 24 => 'ec_wechat_v3_key', + 25 => '(必须)APIV3密钥', + 26 => '微信商户平台-->账户设置-->API安全-->密钥设置 - APIv3密钥', + 27 => 'ec_wechat_v3_private_key', + 28 => '(必须)API证书私钥', + 29 => '商户申请/更换商户API证书(微信商户平台-->账户设置-->API安全-->API证书)时,会生成API证书私钥,并保存在本地证书文件夹的文件apiclient_key.pem 中。', + 30 => 'ec_wechat_v3_serial_no', + 31 => '(必须)API证书序列号', + 32 => '在微信商户平台 - 账户中心 - API安全 - API证书 - 查看证书 - 证书序列号', + 33 => 'ec_wechat_check', + 34 => '支付测试', + 35 => 'ec_wechat_version_2', + 36 => 'API', + 37 => 'ec_wechat_version_3', + 38 => 'APIV3', + 39 => 'ec_wechat_php_version_low', + 40 => 'PHP版本过低', + 41 => 'ec_wechat_checklink_credit', + 42 => '积分充值订单测试', + ), + ), + 164 => + array ( + 'index' => + array ( + '电子商务' => 'action=setting&operation=ec', + 'QQ 钱包' => 'action=ec&operation=qpay', + ), + 'text' => + array ( + 0 => '电子商务 » QQ 钱包', + 1 => 'ec_qpay_tips', + 2 => 'QQ 钱包是腾讯集团财付通旗下的第三方支付平台,一直致力于为用户和企业提供安全、便捷、专业的在线支付服务。由于涉及现金交易,为避免因操作不当而造成的资金损失,请在开始使用 QQ 钱包支付积分交易功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关设置。您可以设置允许用户通过现金在线支付的方式,为其交易积分账户充值,用于购买文章内容、购买用户组权限、积分转账或用户组升级等功能。请务必正确设置您的收款信息,否则将造成用户付款后积分无法实时到账,造成大量需要人工处理的订单信息。您使用 QQ 钱包服务是建立在完全自愿的基础上,除 Discuz! 因主观恶意的因素造成的资金损失以外,腾讯云不对因使用此功能造成的任何损失承担责任。财付通服务热线:0755-83762288-2 (全天 24 小时服务热线) , QQ 钱包客户服务邮箱为 qpay@tencent.com 。', + 3 => 'ec_qpay', + 4 => 'QQ 钱包设置', + 5 => 'ec_qpay_on', + 6 => '是否启用 QQ 钱包支付', + 7 => 'ec_qpay_jsapi', + 8 => '是否启用 QQ 钱包 JSAPI 支付', + 9 => '需要添加经过腾讯审核通过的添加支付授权域名, 如无此权限或打开后无法支付请关闭', + 10 => 'ec_qpay_appid', + 11 => '(可选)应用 ID', + 12 => '腾讯开放平台或 QQ 互联平台审核通过的应用 AppID', + 13 => 'ec_qpay_mch_id', + 14 => '(必须)商户号', + 15 => 'QQ 钱包分配的商户号', + 16 => 'ec_qpay_op_user_id', + 17 => '(可选)操作员 ID', + 18 => '退款时用到的操作员账号, 默认为商户号', + 19 => 'ec_qpay_op_user_passwd', + 20 => '(可选)操作员密码', + 21 => '退款时用到的操作员密码, 系统内使用 md5 编码保存', + 22 => 'ec_qpay_v1_key', + 23 => '(必须)API密钥', + 24 => 'QQ 钱包商户平台 --> 账户管理 --> API 安全', + 25 => 'ec_qpay_v1_cert', + 26 => '(可选)支付证书路径', + 27 => 'cert.p12 证书的位置;建议修改文件名称,避免被直接访问;退款时用到,如果不办理退款业务,可以不填。必须在网站目录中,如:source/data/{randomstr}.p12', + 28 => 'ec_qpay_check', + 29 => '支付测试', + 30 => 'ec_qpay_checklink_credit', + 31 => '积分充值订单测试', + ), + ), + 165 => + array ( + 'index' => + array ( + '电子商务' => 'action=setting&operation=ec', + '积分充值订单' => 'action=ec&operation=orders', + ), + 'text' => + array ( + 0 => '电子商务 » 积分充值订单', + 1 => 'ec_orders_tips', + 2 => '请在开始使用支付宝积分交易订单管理功能(不包含支付宝按钮功能)前,务必仔细阅读《用户使用说明书》中有关电子商务的部分,当确认完全理解和接受相关流程及使用方法后再进行相关操作。如果您的用户反映在线支付后无法自动为其积分账户充值,可能是由于您的支付宝账户的通知接口设置有误,或您的网站无法被支付宝通知系统正常访问所致。您可以登录支付宝交易管理界面,通过比对交易详情人工确认相关订单。订单信息保留 60 天,因此您只能查询和管理 60 天之内的订单信息,超过 60 天的信息将被自动删除。', + 3 => 'ec_orders_search', + 4 => '积分充值订单搜索', + 5 => 'ec_orders_search_status', + 6 => '订单状态', + 7 => 'ec_orders_search_id', + 8 => '订单号', + 9 => 'ec_orders_search_users', + 10 => '付款用户名(多个用户名间请用半角逗号 "," 隔开)', + 11 => 'ec_orders_search_buyer', + 12 => '付款用户的支付宝账号', + 13 => 'ec_orders_search_admin', + 14 => '人工补单管理员', + 15 => 'ec_orders_search_submit_date', + 16 => '订单提交时间范围(yyyy-mm-dd)', + 17 => 'ec_orders_search_confirm_date', + 18 => '订单确认时间范围(格式 yyyy-mm-dd)', + 19 => 'ec_orders_search_status_all', + 20 => '全部状态', + 21 => 'ec_orders_search_status_pending', + 22 => '等待付款', + 23 => 'ec_orders_search_status_auto_finished', + 24 => '成功在线支付', + 25 => 'ec_orders_search_status_manual_finished', + 26 => '成功人工补单', + ), + ), + 166 => + array ( + 'index' => + array ( + '电子商务' => 'action=setting&operation=ec', + '诚信规则' => 'action=ec&operation=credit', + ), + 'text' => + array ( + 0 => '电子商务 » 诚信规则', + 1 => 'ec_credit_tips', + 2 => '您可以修改 static/image/traderank/ 目录下的图片,设计适合自己站点风格的图标', + 3 => 'ec_credit', + 4 => '诚信规则', + 5 => 'ec_credit_maxcreditspermonth', + 6 => '每个自然月中,相同买家和卖家之间的评价计分最大值', + 7 => '以交易创建的时间计算,超出计分规则范围的评价将不计分', + ), + ), + 167 => + array ( + 'index' => + array ( + '动态管理' => 'action=feed', + ), + 'text' => + array ( + 0 => '动态管理', + 1 => 'feed_global_title', + 2 => '动态标题', + 3 => '支持html,例如:加粗<b></b>,变色 <font color=red></font>', + 4 => 'feed_global_body_general', + 5 => '动态备注', + 6 => '支持html', + 7 => 'feed_global_image_1', + 8 => '第1张图片地址', + 9 => 'feed_global_image_1_link', + 10 => '第1张图片链接', + 11 => 'feed_global_image_2', + 12 => '第2张图片地址', + 13 => 'feed_global_image_2_link', + 14 => '第2张图片链接', + 15 => 'feed_global_image_3', + 16 => '第3张图片地址', + 17 => 'feed_global_image_3_link', + 18 => '第3张图片链接', + 19 => 'feed_global_image_4', + 20 => '第4张图片地址', + 21 => 'feed_global_image_4_link', + 22 => '第4张图片链接', + 23 => 'feed_global_dateline', + 24 => '发布时间', + 25 => '(格式:yyyy-mm-dd H:i)您可以填写一个将来的日期和时间,那么这条动态会在这个将来的日期到来之前,一直显示在第一位', + 26 => 'feed_global_hot', + 27 => '动态热度', + 28 => 'message', + 29 => '内容', + ), + ), + 168 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '编辑版块' => 'action=forums&operation=edit', + ), + 'text' => + array ( + 0 => '版块管理 » 编辑版块', + 1 => 'forums_edit_basic_cat_name', + 2 => '分区名称', + 3 => 'forums_edit_basic_cat_name_color', + 4 => '分区名称颜色', + 5 => 'forums_edit_basic_cat_style', + 6 => '分区风格方案(会影响该分区下的子版块)', + 7 => '访问者进入分区版块及子版块(子版块不同于分区风格,可单独设置)所使用的风格方案', + 8 => 'forums_edit_extend_forum_horizontal', + 9 => '论坛首页下级子版块横排', + 10 => '设置进入论坛首页时下级子版块横排时每行版块数量,如果设置为 0,则按正常方式排列', + 11 => 'forums_edit_extend_cat_sub_horizontal', + 12 => '分区下级子版块横排', + 13 => '设置进入分区时,下级子版块横排时每行版块数量,如果设置为 0,则按正常方式排列', + 14 => 'forums_edit_extend_domain', + 15 => '绑定域名', + 16 => '根域名设置完后,此处域名绑定才能生效,设置根域名', + 17 => 'forums_cat_display', + 18 => '显示分区', + 19 => '选择“否”将暂时将分区隐藏不显示,但分区内容仍将保留,且用户仍可通过 URL 访问到此分区及其版块', + 20 => 'forums_edit_basic_shownav', + 21 => '在导航显示', + 22 => '选择是否在主导航中显示', + 23 => 'setting_seo_forum_tips', + 24 => '站点名称 {bbname}(应用范围:所有位置)当前版块名称 {forum}(应用范围:除首页以外)一级版块名称 {fup}(应用范围:子版块主题列表页和文章内容页)分区名称 {fgroup}(应用范围:除首页以外)文章标题 {subject}(应用范围:文章内容页)主题摘要 {summary}(应用范围:文章内容页)主题标签 {tags}(应用范围:文章内容页)分页数 {page}(应用范围:主题列表页、文章内容页)', + 25 => 'forums_edit_basic_seotitle', + 26 => 'title', + 27 => 'forums_edit_basic_keyword', + 28 => 'keywords', + 29 => 'keywords用于搜索引擎优化,放在 meta 的 keyword 标签中,多个关键字间请用半角逗号 "," 隔开', + 30 => 'forums_edit_basic_seodescription', + 31 => 'description', + 32 => 'description用于搜索引擎优化,放在 meta 的 description 标签中', + ), + ), + 169 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '基本设置' => 'action=forums&operation=edit&anchor=basic', + ), + 'text' => + array ( + 0 => '版块管理 » 基本设置', + 1 => 'forums_edit_tips', + 2 => '以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。', + 3 => 'forums_edit_basic', + 4 => '基本设置', + 5 => 'forums_edit_basic_name', + 6 => '版块名称', + 7 => 'forums_edit_base_name_color', + 8 => '版块名称颜色', + 9 => 'forums_edit_basic_icon', + 10 => '版块图标', + 11 => 'forums_edit_basic_icon_width', + 12 => '图标宽度 (单位: px)', + 13 => 'forums_edit_basic_banner', + 14 => '顶部图片', + 15 => 'forums_edit_basic_display', + 16 => '显示版块', + 17 => '选择“不显示”将暂时将版块隐藏不显示,但版块内容仍将保留,且用户仍可通过直接提供带有 fid 的 URL 访问到此版块', + 18 => 'forums_edit_basic_shownav', + 19 => '在导航显示', + 20 => '选择是否在主导航中显示', + 21 => 'forums_edit_basic_up', + 22 => '上级版块', + 23 => '本版块的上级版块或分类', + 24 => 'forums_edit_basic_redirect', + 25 => '版块转向 URL', + 26 => '如果设置转向 URL(例如 https://www.discuz.vip),用户点击本分版块将进入转向中设置的 URL。一旦设定将无法进入版块页面,请确认是否需要使用此功能,留空为不设置转向 URL', + 27 => 'forums_edit_basic_description', + 28 => '版块简介', + 29 => '将显示于版块名称的下面,提供对本版块的简短描述支持内置的 Discuz! 代码', + 30 => 'forums_edit_basic_rules', + 31 => '本版块规则', + 32 => '显示于主题列表页的当前版块规则,留空为不显示支持内置的 Discuz! 代码', + 33 => 'forums_edit_basic_keys', + 34 => '绑定别名', + 35 => '绑定后当站点开启 URL 静态化后可通过别名访问此版块,如设置别名为“developer”那么版块的 URL 将变为“forum-developer-1.html”。注意:别名中只能包含字母或数字,且不能是纯数字', + 36 => 'forums_edit_extend_domain', + 37 => '绑定域名', + 38 => '根域名设置完后,此处域名绑定才能生效,设置根域名', + 39 => 'setting_seo_forum_tips', + 40 => '站点名称 {bbname}(应用范围:所有位置)当前版块名称 {forum}(应用范围:除首页以外)一级版块名称 {fup}(应用范围:子版块主题列表页和文章内容页)分区名称 {fgroup}(应用范围:除首页以外)文章标题 {subject}(应用范围:文章内容页)主题摘要 {summary}(应用范围:文章内容页)主题标签 {tags}(应用范围:文章内容页)分页数 {page}(应用范围:主题列表页、文章内容页)', + 41 => 'forums_edit_basic_seotitle', + 42 => 'title', + 43 => 'forums_edit_basic_keyword', + 44 => 'keywords', + 45 => 'keywords用于搜索引擎优化,放在 meta 的 keyword 标签中,多个关键字间请用半角逗号 "," 隔开', + 46 => 'forums_edit_basic_seodescription', + 47 => 'description', + 48 => 'description用于搜索引擎优化,放在 meta 的 description 标签中', + 49 => 'delete', + 50 => '删除', + ), + ), + 170 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '扩展设置' => 'action=forums&operation=edit&anchor=extend', + ), + 'text' => + array ( + 0 => '版块管理 » 扩展设置', + 1 => 'forums_edit_tips', + 2 => '以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。', + 3 => 'forums_edit_extend', + 4 => '扩展设置', + 5 => 'forums_edit_extend_style', + 6 => '风格方案', + 7 => '访问者进入本版块所使用的风格方案', + 8 => 'forums_edit_extend_sub_horizontal', + 9 => '论坛版块下级子版块横排', + 10 => '设置进入论坛版块时下级子版块横排时每行版块数量,如果设置为 0,则按正常方式排列', + 11 => 'forums_edit_extend_subforumsindex', + 12 => '本版块在首页显示下级子版块', + 13 => '首页版块列表中在版块简介下方显示下级子版块名字和链接(如果存在的话)。注意: 本功能不考虑子版块特殊浏览权限的情况,只要存在即会被显示出来。选择“默认”,将使用全局设置', + 14 => 'forums_edit_extend_simple', + 15 => '只显示下级子版块', + 16 => '选择“是”将不显示本版块的主题列表、发帖按钮等等,类似于一个分类', + 17 => 'forums_edit_extend_widthauto', + 18 => '本版块宽窄风格', + 19 => '设置本版块的显示风格是宽版还是窄版,设置后用户将无法自由切换宽窄风格。默认表示继承全局设置', + 20 => 'forums_edit_extend_picstyle', + 21 => '开启图片列表模式', + 22 => '主题列表将以图片方式显示,主题封面可统一设置宽高', + 23 => 'forums_edit_extend_allowside', + 24 => '显示边栏', + 25 => '选择“是”版块首页侧边将显示聚合本版内容的信息', + 26 => 'forums_edit_extend_recommend_top', + 27 => '显示全局置顶和分类置顶的主题', + 28 => '是否在本版显示全局置顶和分版置顶', + 29 => 'forums_edit_extend_defaultorderfield', + 30 => '主题默认排序字段', + 31 => '设置版块的主题列表默认按照哪个字段进行排序显示。默认为“回复时间”,除默认设置外其他排序方式会加重服务器负担', + 32 => 'forums_edit_extend_defaultorder', + 33 => '主题默认排序方式', + 34 => '设置版块的主题列表默认排序的方式。默认为“按降序排列”,除默认设置外其他排序方式会加重服务器负担', + 35 => 'forums_edit_extend_reply_background', + 36 => '快捷回复框背景图片', + 37 => '设置后将在快速回复框中展现该图片', + 38 => 'forums_edit_extend_threadcache', + 39 => '页面缓存系数', + 40 => '此功能可以将游客经常访问的主题临时缓存起来,缓解大型服务器压力。系数范围 0~100,建议数值 20 ~ 40,0 为关闭缓存。在磁盘空间允许的情况下,适当调高缓存系数,可以提高缓存效果注:版块设置完毕后请到 全局 -> 优化设置 -> 站点页面缓存设置,调整其缓存时间', + 41 => 'forums_edit_extend_relatedgroup', + 42 => '关联圈子/版块', + 43 => '填写被关联圈子/版块的fid,以半角逗号 "," 隔开。版块的主题列表页将显示被关联圈子/版块的主题', + 44 => 'forums_edit_extend_edit_rules', + 45 => '允许版主修改本版块规则', + 46 => '设置是否允许超级版主和版主修改本版规则', + 47 => 'forums_edit_extend_disablecollect', + 48 => '禁止淘帖', + 49 => '选择“是”将禁止用户淘帖本版主题', + 50 => 'forums_edit_extend_recommend', + 51 => '是否开启推荐主题功能', + 52 => '设置是否开启推荐主题功能', + 53 => 'forums_edit_extend_recommend_sort', + 54 => '版主推荐主题方式', + 55 => '自动生成则按照推荐主题规则设定生成推荐列表。手动生成则由版主自行推荐生成推荐列表。半自动生成则和手动方式类似,当手动生成的列表条数不足设置的显示条数时,将按照推荐主题规则自动补足相差条数', + 56 => 'forums_edit_extend_recommend_orderby', + 57 => '推荐主题规则', + 58 => '推荐主题规则,只对自动和半自动生成推荐主题列表有效,此规则均为降序排列', + 59 => 'forums_edit_extend_recommend_num', + 60 => '推荐主题显示数量', + 61 => '推荐主题显示的数量,默认为 10 条,建议不要超过 20 条', + 62 => 'forums_edit_extend_recommend_imagenum', + 63 => '推荐主题图片附件显示数量', + 64 => '推荐主题中图片附件显示的数量,默认为 5 条。设置为 0 则不显示,建议不要超过 10 条', + 65 => 'forums_edit_extend_recommend_imagesize', + 66 => '推荐主题图片附件显示大小', + 67 => '推荐主题中图片附件显示的大小,默认为 300 x 250', + 68 => 'forums_edit_extend_recommend_maxlength', + 69 => '标题最大字节数', + 70 => '设置当标题长度超过本设定时,是否将标题自动缩减到本设定中的字节数,0 为不自动缩减', + 71 => 'forums_edit_extend_recommend_cachelife', + 72 => '数据缓存时间(秒)', + 73 => '由于一些排序检索操作比较耗费资源,建议设置为 900 的数值', + 74 => 'forums_edit_extend_recommend_dateline', + 75 => '推荐主题时间段', + 76 => '按照设置的排序方式,取从访问推荐主题列表这一刻往前推送时间段内的主题,自动生成推荐主题列表,单位为小时,设置成0为所有时段', + 77 => 'delete', + 78 => '删除', + ), + ), + 171 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '文章选项' => 'action=forums&operation=edit&anchor=posts', + ), + 'text' => + array ( + 0 => '版块管理 » 文章选项', + 1 => 'forums_edit_tips', + 2 => '以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。', + 3 => 'forums_edit_posts', + 4 => '文章选项', + 5 => 'forums_edit_posts_modposts', + 6 => '发帖审核', + 7 => '选择“是”将使用户在本版发表的文章待版主或管理员审查通过后才显示出来,打开此功能后,您可以在用户组中设定哪些组发帖可不经审核,也可以在管理组中设定哪些组可以审核别人的文章', + 8 => 'forums_edit_posts_alloweditpost', + 9 => '允许编辑文章', + 10 => '选择“是”将允许用户编辑本版发表的文章', + 11 => 'forums_edit_posts_recyclebin', + 12 => '回收站', + 13 => '是否在本版启用回收站功能,打开此功能后,所有被删除主题和回帖将被放在回收站中,而不会被直接删除', + 14 => 'forums_edit_posts_html', + 15 => '允许使用 HTML 代码', + 16 => '注意: 选择“是”将不屏蔽文章中的任何代码,将带来严重的安全隐患,请慎用', + 17 => 'forums_edit_posts_bbcode', + 18 => '允许使用Discuz!代码', + 19 => 'Discuz! 代码是一种简化和安全的页面格式代码', + 20 => 'forums_edit_posts_imgcode', + 21 => '允许使用 [img] 代码', + 22 => '允许 [img] 代码作者将可以在文章插入其他网站的图片并显示', + 23 => 'forums_edit_posts_mediacode', + 24 => '允许使用多媒体代码', + 25 => '允许 [audio] [media] [flash] 等多媒体代码后,作者将可以在文章插入多媒体文件并显示', + 26 => 'forums_edit_posts_smilies', + 27 => '允许使用表情', + 28 => '表情提供对表情符号,如“:)”的解析,使之作为图片显示', + 29 => 'forums_edit_posts_jammer', + 30 => '启用内容干扰码', + 31 => '选择“是”将在文章内容中增加随机的干扰字串,使得访问者无法复制原始内容。注意: 本功能会轻微加重服务器负担', + 32 => 'forums_edit_posts_anonymous', + 33 => '允许匿名发帖', + 34 => '是否允许用户在本版匿名发表主题和回复,只要用户组或本版块允许,用户均可使用匿名发帖功能。匿名发帖不同于游客发帖,用户需要登录后才可使用,版主和管理员可以查看真实作者', + 35 => 'forums_edit_posts_disablethumb', + 36 => '禁用图片附件添加缩略图', + 37 => '选择“是”将不对本版块上传的图片附件自动缩略图,即便全局设置中开启了此项功能。选择“否”为按照系统默认设置决定是否添加缩略图', + 38 => 'forums_edit_posts_disablewatermark', + 39 => '禁用图片附件添加水印', + 40 => '选择“是”将不对本版块上传的图片附件自动添加水印,即便全局设置中开启了此项功能。选择“否”为按照系统默认设置决定是否添加水印', + 41 => 'forums_edit_posts_allowpostspecial', + 42 => '允许发布的特殊主题', + 43 => 'forums_edit_posts_threadplugin', + 44 => '允许发布的扩展特殊主题', + 45 => '设置本版允许发布哪些其他扩展的特殊主题', + 46 => 'forums_edit_posts_allowspecialonly', + 47 => '只允许发布特殊类型主题', + 48 => '设置本版是否只允许发布特殊类型主题', + 49 => 'forums_edit_posts_autoclose', + 50 => '主题自动关闭', + 51 => '设置主题是否在某时间后自动关闭,禁止普通用户回复', + 52 => 'forums_edit_posts_autoclose_time', + 53 => '自动关闭时间(天)', + 54 => '本设定必须在“主题自动关闭”功能打开时才生效,主题依据自动关闭的设定: 在发表后若干天、或被最后回复后若干天被自动转入关闭状态,从而使普通用户无法回复', + 55 => 'forums_edit_posts_attach_ext', + 56 => '允许附件类型(小写)', + 57 => '设置允许上传的附件扩展名,多个扩展名之间用半角逗号 "," 隔开。本设置的优先级高于用户组,留空为按照用户组允许的附件类型设定', + 58 => 'forums_edit_posts_allowfeed', + 59 => '允许发送广播和动态', + 60 => '开启后默认允许用户发送广播和动态,同时用户也可以选择不发送,隐私版块建议设为否。如果关闭广播功能,该设置将无效。', + 61 => 'forums_edit_posts_commentitem', + 62 => '普通主题点评预置观点', + 63 => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点。只有开启文章点评功能后本设置才生效,如留空表示使用全局的“普通主题点评预置观点”设置', + 64 => 'forums_edit_posts_noantitheft', + 65 => '关闭防采集', + 66 => '关闭防采集功能可节省少量服务器资源,建议灌水类版块关闭防采集功能。', + 67 => 'forums_edit_posts_noforumhidewater', + 68 => '关闭隐藏水帖', + 69 => '可单独关闭本版的隐藏水帖功能,适用于灌水类版块。', + 70 => 'forums_edit_posts_noforumrecommend', + 71 => '关闭推荐回复', + 72 => '可单独关闭本版的推荐回复功能,适用于灌水类版块。', + ), + ), + 172 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '附件类型' => 'action=forums&operation=edit&anchor=attachtype', + ), + 'text' => + array ( + 0 => '版块管理 » 附件类型', + 1 => 'forums_edit_attachtype_tips', + 2 => '本功能可限定本版块某特定类型附件的最大尺寸,当这里设定的尺寸小于用户组允许的最大尺寸时,指定类型的附件尺寸限制将按本设定为准。您可以设置某类附件最大尺寸为 0 以整体禁止这类附件被上传。此处设置留空则使用全局的“附件类型尺寸”设置。', + 3 => 'misc_attachtype_add', + 4 => '添加新附件类型', + ), + ), + 173 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '扩展积分增减策略' => 'action=forums&operation=edit&anchor=credits', + ), + 'text' => + array ( + 0 => '版块管理 » 扩展积分增减策略', + 1 => 'forums_edit_tips', + 2 => '以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。', + 3 => 'forums_edit_credits_policy', + 4 => '扩展积分增减策略', + ), + ), + 174 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '主题分类' => 'action=forums&operation=edit&anchor=threadtypes', + ), + 'text' => + array ( + 0 => '版块管理 » 主题分类', + 1 => 'forums_edit_tips', + 2 => '以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。', + 3 => 'forums_edit_threadtypes_config', + 4 => '主题分类', + 5 => 'forums_edit_threadtypes_status', + 6 => '启用主题分类', + 7 => '设置是否在本版块启用主题分类功能,您需要同时设定相应的分类选项,才能启用本功能', + 8 => 'forums_edit_threadtypes_required', + 9 => '发帖必须归类', + 10 => '是否强制用户发表新主题时必须选择分类', + 11 => 'forums_edit_threadtypes_listable', + 12 => '允许按类别浏览', + 13 => '用户是否可以按照主题分类筛选浏览内容', + 14 => 'forums_edit_threadtypes_prefix', + 15 => '类别前缀', + 16 => '是否在主题前面显示分类的名称', + 17 => 'forums_edit_threadtypes', + 18 => '主题分类', + 19 => '您可以启用已有的主题分类或添加新主题分类应用于本版块,在分类很多的情况下,建议只有重要的分类使用“平板显示”方式,更多的分类使用“下拉显示”方式', + ), + ), + 175 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '分类信息' => 'action=forums&operation=edit&anchor=threadsorts', + ), + 'text' => + array ( + 0 => '版块管理 » 分类信息', + 1 => 'forums_edit_tips', + 2 => '以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。', + 3 => 'forums_edit_threadsorts', + 4 => '分类信息', + 5 => 'forums_edit_threadsorts_status', + 6 => '启用分类信息', + 7 => 'forums_edit_threadtypes_required', + 8 => '发帖必须归类', + 9 => '是否强制用户发表新主题时必须选择分类', + 10 => 'forums_edit_threadtypes_prefix', + 11 => '类别前缀', + 12 => '是否在主题前面显示分类的名称', + 13 => 'forums_edit_threadsorts_default', + 14 => '启用默认显示分类', + 15 => '是否启用默认显示分类,如果启用请在下面的分类信息里面选择', + ), + ), + 176 => + array ( + 'index' => + array ( + '版块管理' => 'action=forums', + '版块权限' => 'action=forums&operation=edit&anchor=perm', + ), + 'text' => + array ( + 0 => '版块管理 » 版块权限', + 1 => 'forums_edit_tips', + 2 => '以下设置没有继承性,即仅对当前版块有效,不会对下级子版块产生影响。', + 3 => 'forums_edit_perm_price', + 4 => '付费价格', + 5 => '当你设置了价格后,用户必须使用指定的交易积分付费后才可进入此版块。当价格增长时,用户还需要支付所增加的积分', + 6 => 'forums_edit_perm_passwd', + 7 => '访问密码', + 8 => '当您设置密码后,用户必须输入密码才可以访问到此版块', + 9 => 'forums_edit_perm_users', + 10 => '访问用户', + 11 => '限定只有列表中的用户可以访问本版块,每行填写一个用户名', + 12 => 'forums_edit_perm_medal', + 13 => '拥有勋章', + 14 => '用户必须拥有指定的勋章才可访问此版块', + 15 => 'forums_edit_perm_forum', + 16 => '版块权限', + 17 => '某权限如果全部未选则表示如下含义:  浏览版块,全部用户组具有浏览版块文章权限;发新话题,除游客以外的用户组具有发帖权限;发表回复,除游客以外的用户组具有回复权限;查看附件,全部用户组具有下载/查看附件权限;上传附件,除游客以外的用户组具有上传附件权限;上传图片,除游客以外的用户组具有上传图片权限', + 18 => 'forums_edit_perm_formula', + 19 => '权限表达式设置', + 20 => '当您设定了权限表达式后,只有符合此表达式的会员才可以浏览本版块。如 "posts > 100 and extcredits1 > 10" 表示 "发帖数 > 100 并且 威望 > 10"日期格式 "{Y-M-D}",如 "{2009-10-1}"。IP 格式 "{x.x.x.x}",既可输入完整地址,也可只输入 IP 开头,如 "{10.0.0.1}"、"{192.168.0}"', + 21 => 'forums_edit_perm_spview', + 22 => '不受限制的用户组', + 23 => 'forums_edit_perm_formulapermmessage', + 24 => '无权限访问时的提示信息', + 25 => '自定义无权限时的提示信息,如不填写则无权限时将显示权限表达式的公式', + 26 => 'forums_edit_perm_verify', + 27 => '用户认证', + ), + ), + 177 => + array ( + 'index' => + array ( + '后台管理团队' => 'action=founder', + ), + 'text' => + array ( + 0 => '后台管理团队', + 1 => 'home_security_founder', + 2 => '您可以制定多种团队职务分配给您网站管理团队的各个成员,让他们管理网站的不同事务“副站长”拥有除“创始人(站长)”专有权限以外的所有后台权限,仅次于“创始人(站长)”', + ), + ), + 178 => + array ( + 'index' => + array ( + '圈子设置' => 'action=group&operation=setting', + ), + 'text' => + array ( + 0 => '圈子设置', + 1 => 'groups_setting_basic', + 2 => '基本设置', + 3 => 'groups_setting_basic_mod', + 4 => '审核新圈子', + 5 => '管理员建立圈子时不需要审核', + 6 => 'groups_setting_basic_iconsize', + 7 => '圈子图标文件大小(单位:KB)', + 8 => '设置圈子图标文件的最大尺寸,0 或留空为不限制', + 9 => 'groups_setting_basic_recommend', + 10 => '推荐圈子', + 11 => '填写要推荐到圈子首页的圈子 ID,以半角逗号 "," 隔开,最多显示 8 个,如不足8个会自动补充积分最高的圈子。例:“23,56,983”', + 12 => 'groups_setting_admingroup', + 13 => '选择管理用户组(在圈子中具有与论坛中相对应的管理权限)', + 14 => 'forums_edit_posts_allowfeed', + 15 => '允许发送广播和动态', + 16 => '开启后默认允许用户发送广播和动态,同时用户也可以选择不发送,隐私版块建议设为否。如果关闭广播功能,该设置将无效。', + ), + ), + 179 => + array ( + 'index' => + array ( + 'newgroup_userperm' => 'action=group&operation=userperm', + ), + 'text' => + array ( + 0 => 'newgroup_userperm', + 1 => 'admingroup_edit_threadperm', + 2 => '主题管理权限', + 3 => 'admingroup_edit_digest_thread', + 4 => '允许精华主题', + 5 => '设置是否允许精华管理范围内主题的级别', + 6 => 'admingroup_edit_postperm', + 7 => '文章管理权限', + 8 => 'admingroup_edit_modcpperm', + 9 => '管理面板权限', + 10 => 'group_userperm_others', + 11 => '其它权限', + ), + ), + 180 => + array ( + 'index' => + array ( + '圈子等级' => 'action=group&operation=level', + ), + 'text' => + array ( + 0 => '圈子等级', + 1 => 'group_level_tips', + 2 => '圈子等级不宜设置过多。当允许圈子内发帖等操作影响用户积分时应谨慎,用户有可能通过圈子刷积分。默认等级图标大小是25 X 25像素。', + ), + ), + 181 => + array ( + 'index' => + array ( + '圈子管理' => 'action=group&operation=manage', + ), + 'text' => + array ( + 0 => '圈子管理', + 1 => 'groups_manage_name', + 2 => '圈子名称', + 3 => 'groups_manage_id', + 4 => '圈子 ID', + 5 => 'groups_editgroup_category', + 6 => '圈子分类', + 7 => '可以按住 CTRL 多选', + 8 => 'groups_manage_membercount', + 9 => '成员数', + 10 => 'groups_manage_threadcount', + 11 => '主题数', + 12 => 'groups_manage_replycount', + 13 => '回复数', + 14 => 'groups_manage_createtime', + 15 => '创建时间', + 16 => 'groups_manage_updatetime', + 17 => '最后更新时间', + 18 => 'groups_manage_founder', + 19 => '创建者', + 20 => 'groups_manage_founder_uid', + 21 => '创建者 UID', + ), + ), + 182 => + array ( + 'index' => + array ( + '道具中心' => 'action=magics', + ), + 'text' => + array ( + 0 => '道具中心', + 1 => 'magics_tips', + 2 => '系统道具位于 source/class/magic/ 目录中,插件道具位于 source/plugin/插件目录/magic/ 目录中插件开发人员在设计新的道具前请务必仔细阅读《Discuz! 技术文档》中的内容。', + 3 => 'magics_config_discount', + 4 => '道具回收价格折扣', + 5 => '设置道具系统回收价格折扣,此值为百分比,例如如果此值为 85,则系统将以道具原价 85% 的价格回收,建议不超过 100,有效防止刷积分。留空或者 0 表示不开启道具回收功能', + ), + ), + 183 => + array ( + 'index' => + array ( + 'HTML管理' => 'action=makehtml&operation=all', + ), + 'text' => + array ( + 0 => 'HTML管理', + 1 => 'makehtml_tips_all', + 2 => '生成指定起始时间以后发布的文章的HTML文件生成指定起始时间以后发布过文章的频道HTML文件生成门户首页的HTML文件', + 3 => 'start_time', + 4 => '起始时间', + 5 => 'makehtml_createall', + 6 => '生成全部', + 7 => 'makehtml_recreate', + 8 => '重新生成', + 9 => 'makehtml_allfilecomplete', + 10 => '全部文件生成完成', + 11 => 'makehtml_waitmaking', + 12 => '请稍等,正在生成首页...', + 13 => 'makehtml_waitmakingcategory', + 14 => '请稍等,正在检查可生成的频道页面...', + 15 => 'makehtml_nofindcategory', + 16 => '没有可生成的频道页面', + 17 => 'makehtml_startmaketopic', + 18 => '现在开始生成专题文件...', + 19 => 'makehtml_browser_error', + 20 => '如果您的浏览器没有反应,请点击继续...', + 21 => 'makehtml_waitchecktopic', + 22 => '请稍等,正在检查可生成的专题页面...', + 23 => 'makehtml_nofindtopic', + 24 => '没有可生成的专题页面', + 25 => 'makehtml_startmakeindex', + 26 => '现在开始生成主页文件...', + 27 => 'makehtml_waitcheckarticle', + 28 => '请稍等,正在检查可生成的文章页面...', + 29 => 'makehtml_nofindarticle', + 30 => '没有可生成的文章页面', + 31 => 'makehtml_startmakecategory', + 32 => '现在开始生成频道文件...', + ), + ), + 184 => + array ( + 'index' => + array ( + 'HTML管理' => 'action=makehtml', + '生成HTML' => 'action=makehtml&operation=makehtmlsetting', + ), + 'text' => + array ( + 0 => 'HTML管理 » 生成HTML', + 1 => 'setting_functions_makehtml', + 2 => '生成HTML', + 3 => 'setting_functions_makehtml_extendname', + 4 => '静态文件扩展名', + 5 => '所有静态文件的扩展名,默认为html', + 6 => 'setting_functions_makehtml_articlehtmldir', + 7 => '文章HTML存放根目录', + 8 => '文章静态文件存放的根目录,子目录与频道目录相同,从网站的根目录开始,结尾不需要添加/,为空则存放在当前频道的文件夹下', + 9 => 'setting_functions_makehtml_htmldirformat', + 10 => '目录结构', + 11 => '静态文件文件存放目录的下级目录结构, 0:/Ym/, 1:/Ym/d/, 2:/Y/m/, 3:/Y/m/d/', + 12 => 'setting_functions_makehtml_topichtmldir', + 13 => '专题HTML存放目录', + 14 => '专题HTML文件存放目录,从网站的根目录开始,结尾不需要添加/,为空则不生成专题HTML文件', + 15 => 'setting_functions_makehtml_indexname', + 16 => '门户首页静态文件名', + 17 => '生成门户首页的静态文件名,默认为index,不带扩展名', + ), + ), + 185 => + array ( + 'index' => + array ( + 'HTML管理' => 'action=makehtml', + '清理HTML' => 'action=makehtml&operation=cleanhtml', + ), + 'text' => + array ( + 0 => 'HTML管理 » 清理HTML', + 1 => 'setting_functions_makehtml_cleanhtml', + 2 => '需要清理的HTML', + 3 => '选择需要要清理的HTML', + ), + ), + 186 => + array ( + 'index' => + array ( + '勋章中心' => 'action=medals', + ), + 'text' => + array ( + 0 => '勋章中心', + 1 => 'medals_tips', + 2 => '本功能用于设置可以颁发给用户的勋章信息,勋章图片中请填写图片文件名,并将相应图片文件上传到 static/image/common/ 目录中或直接填写图片 URL 地址。', + ), + ), + 187 => + array ( + 'index' => + array ( + '马甲' => 'action=members&operation=repeat', + ), + 'text' => + array ( + 0 => '马甲', + 1 => 'members_search_repeatuser', + 2 => '用户名', + 3 => 'members_search_uid', + 4 => '用户 UID', + 5 => 'members_search_repeatip', + 6 => 'IP 地址', + ), + ), + 188 => + array ( + 'index' => + array ( + '添加用户' => 'action=members&operation=add', + ), + 'text' => + array ( + 0 => '添加用户', + 1 => 'username', + 2 => '用户名', + 3 => 'password', + 4 => '密 码', + 5 => 'email', + 6 => 'Email', + 7 => 'usergroup', + 8 => '用户组', + 9 => 'members_add_email_notify', + 10 => '发送通知到上述地址', + ), + ), + 189 => + array ( + 'index' => + array ( + '编辑会员用户组' => 'action=members&operation=group', + ), + 'text' => + array ( + 0 => '编辑会员用户组', + 1 => 'usergroup', + 2 => '用户组', + 3 => 'members_group_group', + 4 => '所属用户组', + 5 => 'members_group_related_adminid', + 6 => '所属管理组', + 7 => 'members_group_validity', + 8 => '用户组有效期', + 9 => '如需设定当前用户组的有效期,请输入用户组截止日期,留空为不做过期限制', + 10 => 'members_group_orig_adminid', + 11 => '过期后用户组变为', + 12 => 'members_group_orig_groupid', + 13 => '过期后管理组变为', + 14 => 'members_group_extended', + 15 => '扩展用户组', + 16 => '注意: 有效期格式 yyyy-mm-dd,如果留空,则默认该扩展用户组不自动过期', + 17 => 'members_edit_reason', + 18 => '变更理由', + 19 => 'members_group_reason', + 20 => '操作用户的理由', + 21 => '如果您通过用户组设定禁止或解除禁止该用户,请输入操作理由,系统将把理由记录在用户禁止记录中以供日后查看并可选发送给用户。如果并非上述情况且不选择下方的告知用户,可不输入操作理由', + 22 => 'members_group_reason_notify', + 23 => '禁止/解禁用户的理由是否告知用户', + ), + ), + 190 => + array ( + 'index' => + array ( + '编辑用户积分' => 'action=members&operation=credit', + ), + 'text' => + array ( + 0 => '编辑用户积分', + 1 => 'members_credit_tips', + 2 => 'Discuz! 支持对用户 8 种扩展积分的设置,只有被启用的积分才允许您进行编辑。修改用户的某项积分会造成该用户总积分的变化,从引起普通会员等级的变化,因此请仔细设置各项积分。', + 3 => 'members_edit_reason', + 4 => '变更理由', + 5 => 'members_credit_reason', + 6 => '修改用户积分的理由', + 7 => '如果您修改了用户的积分资料,请输入操作理由,系统将把理由记录在用户评分记录中并可选发送给用户,以供日后查看', + 8 => 'members_credit_reason_notify', + 9 => '修改用户积分的理由是否告知用户', + ), + ), + 191 => + array ( + 'index' => + array ( + '编辑用户权限' => 'action=members&operation=access', + ), + 'text' => + array ( + 0 => '编辑用户权限', + 1 => 'members_access_tips', + 2 => '用户在版块中的权限是基于用户和站点间的权限设定,如果设置为非默认状态,将不受用户组的设定限制。删除某个用户在某版块的特殊权限设置,您只需要将他在这个版块中的权限全部设置为默认即可修改某个用户在这个版块的权限,您只需要重新添加他的权限设置即可', + 3 => 'members_access_add_forum', + 4 => '选择版块', + 5 => '请选择要设置的版块。以下权限设置仅仅影响该用户在此版块的权限', + 6 => 'members_access_add_', + 7 => '', + ), + ), + 192 => + array ( + 'index' => + array ( + '编辑用户' => 'action=members&operation=edit', + ), + 'text' => + array ( + 0 => '编辑用户', + 1 => 'members_edit_username', + 2 => '用户名', + 3 => 'members_edit_avatar', + 4 => '头像', + 5 => 'members_edit_statistics', + 6 => '统计信息', + 7 => 'members_edit_password', + 8 => '新密码', + 9 => '如果不更改密码此处请留空', + 10 => 'members_edit_unbind', + 11 => '解除QQ账号绑定状态', + 12 => '如当前用户的QQ账号丢失或者被盗,可以在这里解除QQ账号的绑定', + 13 => 'members_edit_uinblack', + 14 => '封禁QQ账号', + 15 => '把当前用户的QQ账号封锁,封禁后此QQ账号无法再登录本站点', + 16 => 'members_edit_clearquestion', + 17 => '清除用户安全提问', + 18 => '选择“是”将清除用户安全提问,该用户将不需要回答安全提问即可登录;选择“否”为不改变用户的安全提问设置', + 19 => 'members_edit_status', + 20 => '锁定当前用户', + 21 => 'members_edit_freeze', + 22 => '用户冻结状态', + 23 => 'members_edit_email', + 24 => 'Email', + 25 => 'members_edit_email_emailstatus', + 26 => '邮箱激活状态', + 27 => 'members_edit_secmobile_secmobicc', + 28 => '安全手机国际电话区号', + 29 => 'members_edit_secmobile_secmobile', + 30 => '安全手机号', + 31 => 'members_edit_secmobile_secmobilestatus', + 32 => '安全手机激活状态', + 33 => 'members_edit_posts', + 34 => '发帖数', + 35 => 'members_edit_digestposts', + 36 => '精华帖数', + 37 => 'members_edit_regip', + 38 => '注册 IP', + 39 => 'members_edit_regport', + 40 => '注册端口号', + 41 => 'members_edit_regdate', + 42 => '注册时间', + 43 => 'members_edit_lastvisit', + 44 => '上次访问', + 45 => 'members_edit_lastip', + 46 => '上次访问 IP', + 47 => 'members_edit_port', + 48 => '上次访问端口号', + 49 => 'members_edit_addsize', + 50 => '额外附件容量', + 51 => 'members_edit_addfriend', + 52 => '额外好友数', + 53 => 'members_edit_timeoffset', + 54 => '时差设定', + 55 => '用户本地时间与 GMT 标准的时间差,设置 9999 即为默认时差,和站点设置保持一致', + 56 => 'members_edit_invisible', + 57 => '隐身登录', + 58 => 'members_edit_option', + 59 => '论坛选项', + 60 => 'members_edit_cstatus', + 61 => '自定义头衔', + 62 => 'members_edit_signature', + 63 => '签名', + 64 => 'members_profile', + 65 => '用户栏目', + 66 => 'members_edit_exphistory', + 67 => '用户历史资料下载', + 68 => '历史邮箱、手机号数据请到 UCenter 后台查询', + 69 => 'members_edit', + 70 => '编辑用户', + 71 => 'members_edit_avatar_clear', + 72 => '删除头像', + 73 => 'posts', + 74 => '发帖数', + 75 => 'doings', + 76 => '记录', + 77 => 'blogs', + 78 => '日志', + 79 => 'albums', + 80 => '相册', + 81 => 'shares', + 82 => '分享', + 83 => 'setting_styles_viewthread_userinfo_oltime', + 84 => '在线时间', + 85 => 'hourtime', + 86 => '小时', + 87 => 'members_edit_freeze_false', + 88 => '未冻结', + 89 => 'members_edit_freeze_password', + 90 => '需重置密码后解冻', + 91 => 'members_edit_freeze_admincp', + 92 => '需后台审核后解冻', + 93 => 'members_edit_freeze_email', + 94 => '需验证邮箱或后台审核后解冻', + ), + ), + 193 => + array ( + 'index' => + array ( + '用户管理' => 'action=members&operation=search', + ), + 'text' => + array ( + 0 => '用户管理', + 1 => 'members_search_table', + 2 => '用户表', + 3 => '更新用户数据时,存档表中的用户相关数据不会更新', + 4 => 'members_search_user', + 5 => '用户名', + 6 => '可使用通配符 *,多个用户名用半角逗号 "," 隔开', + 7 => 'members_search_uid', + 8 => '用户 UID', + 9 => 'members_search_group', + 10 => '主用户组', + 11 => '设置允许参与搜索的用户组,可以按住 CTRL 多选', + 12 => 'members_search_medal', + 13 => '勋章', + 14 => '设置拥有指定勋章的用户,可以按住 CTRL 多选', + 15 => 'members_search_usertag', + 16 => '用户标签', + 17 => '设置指定标签的用户,可以按住 CTRL 多选', + 18 => 'members_search_conisbind', + 19 => '是否绑定QQ', + 20 => 'members_search_uinblacklist', + 21 => 'QQ账号是否被封', + 22 => 'members_search_online', + 23 => '是否在线', + 24 => 'members_search_lockstatus', + 25 => '是否锁定', + 26 => 'members_search_freezestatus', + 27 => '是否冻结', + 28 => 'members_search_emailstatus', + 29 => '是否通过Email认证', + 30 => 'members_search_avatarstatus', + 31 => '是否有头像', + 32 => 'members_search_email', + 33 => 'Email', + 34 => '可使用通配符 *', + 35 => 'members_search_friendsrange', + 36 => '好友数介于', + 37 => 'members_search_postsrange', + 38 => '发帖数介于', + 39 => 'members_search_regip', + 40 => '注册 IP 开始于', + 41 => '如 192.168,可使用通配符 *', + 42 => 'members_search_lastip', + 43 => '上次访问 IP 开始于', + 44 => '如 192.168,可使用通配符 *', + 45 => 'members_search_oltimerange', + 46 => '用户在线时间(单位小时)', + 47 => 'members_search_regdaterange', + 48 => '注册日期介于', + 49 => 'members_search_lastvisitrange', + 50 => '最后访问时间介于', + 51 => 'members_search_lastpostrange', + 52 => '最后发帖时间介于', + 53 => 'members_search_group_fid', + 54 => '圈子 ID(多个圈子逗号分隔)', + 55 => 'members_search_verify', + 56 => '认证', + 57 => 'members_search_birthday', + 58 => '用户生日', + 59 => 'members_reward_clean_alarm', + 60 => '您确认要将这些用户所选的积分清零吗?', + 61 => 'yes', + 62 => '是', + 63 => 'no', + 64 => '否', + 65 => 'members_edit_freeze_email', + 66 => '需验证邮箱或后台审核后解冻', + 67 => 'members_edit_freeze_admincp', + 68 => '需后台审核后解冻', + 69 => 'members_edit_freeze_password', + 70 => '需重置密码后解冻', + 71 => 'members_edit_freeze_false', + 72 => '未冻结', + 73 => 'credits', + 74 => '积分', + 75 => 'members_search_between', + 76 => '介于', + 77 => 'year', + 78 => '年', + 79 => 'month', + 80 => '月', + 81 => 'day', + 82 => '日', + ), + ), + 194 => + array ( + 'index' => + array ( + '用户分表' => 'action=membersplit&operation=check', + ), + 'text' => + array ( + 0 => '用户分表', + 1 => 'membersplit_check_tips', + 2 => '此功能仅限极个别特定需求使用,一般站点不需要此功能。因检查操作较慢,所以检查的结果会缓存一天的时间', + ), + ), + 195 => + array ( + 'index' => + array ( + '用户分表' => 'action=membersplit&operation=check', + ), + 'text' => + array ( + 0 => '用户分表', + 1 => 'membersplit_tips', + 2 => '此功能仅限极个别特定需求使用,一般站点不需要此功能。请根据服务器性能,适当调整单步处理数。建议在关闭站点下进行分表操作。', + ), + ), + 196 => + array ( + 'index' => + array ( + '友情链接' => 'action=misc&operation=link', + ), + 'text' => + array ( + 0 => '友情链接', + 1 => 'misc_link_tips', + 2 => '如果您不想在论坛首页显示友情链接,可以在“界面设置”中关闭。未填写文字说明的项目将以紧凑型显示。 + 友情链接分组只供 DIY 的展示类模块使用。', + ), + ), + 197 => + array ( + 'index' => + array ( + '关联链接' => 'action=misc&operation=relatedlink', + ), + 'text' => + array ( + 0 => '关联链接', + 1 => 'misc_relatedlink_tips', + 2 => '在指定范围内出现的相关文字自动加上链接。', + ), + ), + 198 => + array ( + 'index' => + array ( + '编辑器设置' => 'action=setting&operation=editor', + 'Discuz! 代码' => 'action=setting&operation=bbcode', + ), + 'text' => + array ( + 0 => '编辑器设置 » Discuz! 代码', + 1 => 'misc_bbcode_edit_tips', + 2 => '只有在自定义 Discuz! 代码可用并设置了图标文件时,具有“允许使用自定义 Discuz! 代码”权限的用户组在发帖时才会看到相应自定义 Discuz! 代码按钮。', + 3 => 'detail', + 4 => '详情', + ), + ), + 199 => + array ( + 'index' => + array ( + '词语过滤' => 'action=misc&operation=censor', + ), + 'text' => + array ( + 0 => '词语过滤', + 1 => 'misc_censor_tips', + 2 => '替换前的内容可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略的字节数。如 "a{1}s{2}s"(不含引号) 可以过滤 "ass" 也可过滤 "axsxs" 和 "axsxxs" 等等。对于中文字符,若使用 GBK、Big-5 版本,每个中文字符相当于 2 个字节;若使用 UTF-8 版本,每个中文字符相当于 3 个字节。为不影响程序效率,请不要设置过多不需要的过滤内容。审核只对论坛中的内容有效如果您不是论坛管理员,您将只能对自己添加的项目进行编辑或删除。敏感词如果以"/"(不含引号)开头和结尾则表示格式为正则表达式,这时替换内容可用"(n)"引用正则中的子模式,如"/1\\d{10}([^\\d]+|$)/"替换为"手机(1)"。', + 3 => 'misc_censor_batch_add_tips', + 4 => '每行一组过滤词语,敏感词和替换词之间使用“=”进行分割;如需禁止发布包含某个词语的文字,而不是替换过滤,请将其对应的替换内容设置为{BANNED}即可;如需当用户发布包含某个词语的文字时,自动标记为需要人工审核,而不直接显示或替换过滤,请将其对应的替换内容设置为{MOD}即可(审核只对论坛中的内容有效)。如果只是想将某个词语直接替换成 **,则只输入词语即可;例如:toobadnobadbadword=goodsexword={BANNED}导出/导入时支持词语分类导入,导入时不带有分类则可以通过选择指定导入分类。没有分类时自动归入默认分类', + 5 => 'misc_censor_wordtype_tips', + 6 => '默认分类为内置分类,当删除一组分类时,词语过滤将会自动编入默认分类中。', + ), + ), + 200 => + array ( + 'index' => + array ( + '主题鉴定' => 'action=misc&operation=stamp', + '图章' => 'action=misc&operation=stamp&anchor=list', + ), + 'text' => + array ( + 0 => '主题鉴定 » 图章', + 1 => 'misc_stamp_listtips', + 2 => '鉴定图章显示在文章内容页,鉴定图标显示在主题列表页。系统预留了 100 个主题鉴定图片位置,分别为图片 ID 0 至 99。不要随意修改图片 ID,否则将会导致主题中已使用的图章、图标错乱。当图章设置了关联操作后,图章会在执行相应操作时被自动添加到主题中;当图章设置了关联图标后,图标会在添加图章时自动添加到主题列表中。关联操作不可与关联图标同时设置。', + ), + ), + 201 => + array ( + 'index' => + array ( + '主题鉴定' => 'action=misc&operation=stamp', + '图标' => 'action=misc&operation=stamp&anchor=llist', + ), + 'text' => + array ( + 0 => '主题鉴定 » 图标', + 1 => 'misc_stamp_listtips', + 2 => '鉴定图章显示在文章内容页,鉴定图标显示在主题列表页。系统预留了 100 个主题鉴定图片位置,分别为图片 ID 0 至 99。不要随意修改图片 ID,否则将会导致主题中已使用的图章、图标错乱。当图章设置了关联操作后,图章会在执行相应操作时被自动添加到主题中;当图章设置了关联图标后,图标会在添加图章时自动添加到主题列表中。关联操作不可与关联图标同时设置。', + ), + ), + 202 => + array ( + 'index' => + array ( + '主题鉴定' => 'action=misc&operation=stamp', + '添加' => 'action=misc&operation=stamp&anchor=add', + ), + 'text' => + array ( + 0 => '主题鉴定 » 添加', + 1 => 'misc_stamp_addtips', + 2 => '可以选择是添加成图章还是图标。图片名称必需填写,没有名称的图片不会被添加。', + ), + ), + 203 => + array ( + 'index' => + array ( + '附件类型尺寸' => 'action=misc&operation=attachtype', + ), + 'text' => + array ( + 0 => '附件类型尺寸', + 1 => 'misc_attachtype_tips', + 2 => '本功能可限定某特定类型附件的最大尺寸,当这里设定的尺寸小于用户组允许的最大尺寸时,指定类型的附件尺寸限制将按本设定为准。您可以设置某类附件最大尺寸为 0 以整体禁止这类附件被上传。', + ), + ), + 204 => + array ( + 'index' => + array ( + '计划任务' => 'action=misc&operation=cron', + ), + 'text' => + array ( + 0 => '计划任务', + 1 => 'misc_cron_tips', + 2 => '计划任务是 Discuz! 提供的一项使系统在规定时间自动执行某些特定任务的功能,在需要的情况下,您也可以方便的将其用于站点功能的扩展。计划任务是与系统核心紧密关联的功能特性,不当的设置可能造成站点功能的隐患,严重时可能导致站点无法正常运行,因此请务必仅在您对计划任务特性十分了解,并明确知道正在做什么、有什么样后果的时候才自行添加或修改任务项目。此处和其他功能不同,本功能中完全按照站点系统默认时差对时间进行设定和显示,而不会依据某一用户或管理员的时差设定而改变显示或设置的时间值。', + ), + ), + 205 => + array ( + 'index' => + array ( + '站长推荐' => 'action=misc&operation=focus', + '管理' => 'action=misc&operation=focus', + ), + 'text' => + array ( + 0 => '站长推荐 » 管理', + 1 => 'misc_focus_tips', + 2 => '站长推荐将以浮窗的形式显示在文章内容页面右下角。您可以手动添加一些指定的主题,或者选择一些版主推荐的主题。最多 10 条,每次随机显示其中 1 条。', + 3 => 'admin', + 4 => '管理', + 5 => 'edit', + 6 => '编辑', + ), + ), + 206 => + array ( + 'index' => + array ( + '站长推荐' => 'action=misc&operation=focus', + '添加' => 'action=misc&operation=focus&do=add', + ), + 'text' => + array ( + 0 => '站长推荐 » 添加', + 1 => 'misc_focus_handadd', + 2 => '手动添加', + 3 => 'misc_focus_handurl', + 4 => '推荐链接地址', + 5 => 'misc_focus_handsubject', + 6 => '推荐标题', + 7 => 'misc_focus_handsummary', + 8 => '推荐内容', + 9 => '此处支持 HTML 代码,建议少于150个字符', + 10 => 'misc_focus_handimg', + 11 => '附加图片', + 12 => '请填写图片的绝对路径', + 13 => 'misc_focus_position', + 14 => '站长推荐投放区域', + ), + ), + 207 => + array ( + 'index' => + array ( + '站长推荐' => 'action=misc&operation=focus', + '设置' => 'action=misc&operation=focus&do=config', + ), + 'text' => + array ( + 0 => '站长推荐 » 设置', + 1 => 'config', + 2 => '设置', + 3 => 'misc_focus_area_title', + 4 => '站长推荐区域标题', + 5 => '默认为“站长推荐”,您可以设置为您希望的标题', + 6 => 'misc_focus_area_cookie', + 7 => '设置关闭后可再次弹出的时间(小时)', + 8 => '0表示再刷新页面就会弹出。1表示1小时后刷新页面才会出现。默认为1,可以设置为您希望弹出的时间 +', + ), + ), + 208 => + array ( + 'index' => + array ( + '图片管理' => 'action=pic', + ), + 'text' => + array ( + 0 => '图片管理', + 1 => 'pic_tips', + 2 => '批量图片管理用于删除图片使用。连图片评论一同删除提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + ), + ), + 209 => + array ( + 'index' => + array ( + '图片管理' => 'action=pic', + '搜索' => 'action=pic&search=true', + ), + 'text' => + array ( + 0 => '图片管理 » 搜索', + 1 => 'pic_search_detail', + 2 => '显示详细图片列表', + 3 => 'pic_search_perpage', + 4 => '每页显示数', + 5 => 'resultsort', + 6 => '结果排序', + 7 => 'pic_search_albumid', + 8 => '所在相册 ID', + 9 => '多相册 ID 中间,请用半角逗号 "," 隔开', + 10 => 'pic_search_user', + 11 => '发表图片用户名', + 12 => '多所有者中间请用半角逗号 "," 隔开', + 13 => 'pic_search_picid', + 14 => '图片 ID', + 15 => '多图片 ID 中间请用半角逗号 "," 隔开', + 16 => 'pic_search_title', + 17 => '图片标题', + 18 => 'pic_search_ip', + 19 => '发布IP', + 20 => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 21 => 'pic_search_hot', + 22 => '热度', + 23 => 'pic_search_time', + 24 => '上传时间范围', + 25 => '格式 yyyy-mm-dd', + ), + ), + 210 => + array ( + 'index' => + array ( + '文章点评管理' => 'action=postcomment', + ), + 'text' => + array ( + 0 => '文章点评管理', + 1 => 'postcomment_tips', + 2 => '批量点评管理用于删除文章点评。提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + ), + ), + 211 => + array ( + 'index' => + array ( + '文章点评管理' => 'action=postcomment', + '搜索' => 'action=postcomment&search=true', + ), + 'text' => + array ( + 0 => '文章点评管理 » 搜索', + 1 => 'postcomment_search_detail', + 2 => '显示详细点评列表', + 3 => 'comment_search_perpage', + 4 => '每页显示数', + 5 => 'postcomment_content', + 6 => '点评内容', + 7 => 'postcomment_search_tid', + 8 => '被点评主题 ID', + 9 => '指定主题的所有点评(包括主题帖和回帖),多 ID 中间请用半角逗号 "," 隔开', + 10 => 'postcomment_search_pid', + 11 => '被点评文章 ID', + 12 => '指定文章的点评,多 ID 中间请用半角逗号 "," 隔开', + 13 => 'postcomment_search_author', + 14 => '点评者', + 15 => '多点评者名中间请用半角逗号 "," 隔开', + 16 => 'postcomment_search_authorid', + 17 => '点评者 ID', + 18 => '多点评者 ID 中间请用半角逗号 "," 隔开', + 19 => 'comment_search_ip', + 20 => '发布IP', + 21 => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 22 => 'postcomment_search_time', + 23 => '点评时间范围', + 24 => '格式 yyyy-mm-dd', + ), + ), + 212 => + array ( + 'index' => + array ( + '文章分表' => 'action=postsplit&operation=manage', + '分表管理' => 'action=postsplit&operation=manage', + ), + 'text' => + array ( + 0 => '文章分表 » 分表管理', + 1 => 'postsplit_manage_tips', + 2 => '进行文章分表前一定要先关闭站点,为防止分表操作过程中出现问题,必须做好数据库备份后再进行此操作文章数据转移完毕会对源文章表进行表优化操作,优化表所耗时间比较长,在这期间绝对不能重起服务器或者停止MySQL服务forum_post(主表)必须保留300M的数据文章分表功能可以将文章分在不同的数据表中,适合文章数很多并且运行效率受到影响的站点使用', + ), + ), + 213 => + array ( + 'index' => + array ( + '文章分表' => 'action=postsplit&operation=manage', + '分表管理' => 'action=postsplit&operation=manage', + ), + 'text' => + array ( + 0 => '文章分表 » 分表管理', + 1 => 'postsplit_manage_tips', + 2 => '进行文章分表前一定要先关闭站点,为防止分表操作过程中出现问题,必须做好数据库备份后再进行此操作文章数据转移完毕会对源文章表进行表优化操作,优化表所耗时间比较长,在这期间绝对不能重起服务器或者停止MySQL服务forum_post(主表)必须保留300M的数据文章分表功能可以将文章分在不同的数据表中,适合文章数很多并且运行效率受到影响的站点使用', + ), + ), + 214 => + array ( + 'index' => + array ( + '论坛批量删帖' => 'action=prune', + ), + 'text' => + array ( + 0 => '论坛批量删帖', + 1 => 'prune_tips', + 2 => '批量删帖仅用于删除违规文章使用,如您需要批量删除历史旧帖,请使用批量主题管理功能。使用此功能,需同时提供起始时间和终止时间其中之一,及发帖用户名、发帖 IP、内容关键字其中之一,至少共二项必要的条件,否则将无法进行操作。如果符合删除条件的文章为主题第一帖,或该主题无回复,将删除整个主题。如果您不是论坛管理员,您只能删除从某一时间到现在的范围内的文章。超级版主的删帖的时间范围为二星期(14 天);版主的时间范围为一星期(7 天)且只能删除所管辖论坛内的文章。关键字可以使用限定符 {x} 以限定相邻两字符间可忽略的文字,x 是忽略字符的个数,如 "a{1}s{2}s"(不含引号) 可以搜索到 "ass" 也可搜索到 "axsxs" 和 "axsxxs" 等等。', + 3 => 'prune_search_detail', + 4 => '显示详细文章列表', + 5 => 'prune_search_select_postsplit', + 6 => '选择文章分表', + 7 => 'prune_search_forum', + 8 => '所在版块', + 9 => 'prune_search_perpage', + 10 => '每页显示数', + 11 => 'prune_search_time', + 12 => '发表时间范围', + 13 => '格式 yyyy-mm-dd,不限制请输入 0', + 14 => 'prune_search_user', + 15 => '发帖用户名', + 16 => '多用户名中间请用半角逗号 "," 隔开', + 17 => 'prune_search_ip', + 18 => '发帖 IP ', + 19 => '通配符 "*" 如 "127.0.*.*"(不含引号),慎用!!!', + 20 => 'prune_search_keyword', + 21 => '内容关键字', + 22 => '多关键字中间请用半角逗号 "," 隔开,关键词可以用限定符 {x}', + 23 => 'prune_search_lengthlimit', + 24 => '内容最小长度', + 25 => '本功能会加重服务器负担', + ), + ), + 215 => + array ( + 'index' => + array ( + '主题回收站' => 'action=recyclebin', + '搜索' => 'action=recyclebin&operation=search', + ), + 'text' => + array ( + 0 => '主题回收站 » 搜索', + 1 => 'recyclebin_search', + 2 => '搜索符合条件的被删文章', + 3 => 'recyclebin_search_forum', + 4 => '所在版块', + 5 => 'recyclebin_search_author', + 6 => '原帖作者', + 7 => '多个用户名间请用半角逗号 "," 隔开', + 8 => 'recyclebin_search_keyword', + 9 => '标题关键字', + 10 => '多关键字中间请用半角逗号 "," 隔开', + 11 => 'recyclebin_search_admin', + 12 => '删帖管理员', + 13 => '多个用户名间请用半角逗号 "," 隔开', + 14 => 'recyclebin_search_post_time', + 15 => '文章发表时间范围', + 16 => '格式 yyyy-mm-dd,不限制请留空', + 17 => 'recyclebin_search_mod_time', + 18 => '删帖时间范围', + 19 => '格式 yyyy-mm-dd,不限制请留空', + 20 => 'recyclebin_search_security_thread', + 21 => '', + ), + ), + 216 => + array ( + 'index' => + array ( + '主题回收站' => 'action=recyclebin', + '清理' => 'action=recyclebin&operation=clean', + ), + 'text' => + array ( + 0 => '主题回收站 » 清理', + 1 => 'recyclebin_clean', + 2 => '批量清空回收站', + 3 => 'recyclebin_clean_days', + 4 => '清空多少天以前的回收站文章', + 5 => '0 为清空全部', + ), + ), + 217 => + array ( + 'index' => + array ( + '回帖回收站' => 'action=recyclebinpost', + '搜索' => 'action=recyclebinpost&operation=search', + ), + 'text' => + array ( + 0 => '回帖回收站 » 搜索', + 1 => 'recyclebinpost_search', + 2 => '搜索符合条件的被删回帖', + 3 => 'recyclebinpost_search_forum', + 4 => '所在版块', + 5 => 'recyclebinpost_search_author', + 6 => '原帖作者', + 7 => '多个用户名间请用半角逗号 "," 隔开', + 8 => 'recyclebinpost_search_keyword', + 9 => '内容关键字', + 10 => '多关键字中间请用半角逗号 "," 隔开', + 11 => 'recyclebin_search_post_time', + 12 => '文章发表时间范围', + 13 => '格式 yyyy-mm-dd,不限制请留空', + 14 => 'postsplit', + 15 => '文章分表', + 16 => 'recyclebin_search_security_thread', + 17 => '', + ), + ), + 218 => + array ( + 'index' => + array ( + '回帖回收站' => 'action=recyclebinpost', + '清理' => 'action=recyclebinpost&operation=clean', + ), + 'text' => + array ( + 0 => '回帖回收站 » 清理', + 1 => 'recyclebinpost_clean', + 2 => '批量清空回帖回收站', + 3 => 'recyclebinpost_clean_days', + 4 => '清空多少天以前的回帖回收站文章', + 5 => '0 为清空全部', + ), + ), + 219 => + array ( + 'index' => + array ( + '内容重新审核' => 'action=remoderate', + ), + 'text' => + array ( + 0 => '内容重新审核', + 1 => 'remoderate_tips', + 2 => '当词语过滤参数有较大变动或邻近敏感时间点时,可以使用此功能对历史数据进行重新审核。请尽量避开会员访问的高峰时间 + 每个循环更新数量:数值请在一个合理范围,不要过大,否则会给服务器带来负载压力 + ', + ), + ), + 220 => + array ( + 'index' => + array ( + '用户举报' => 'action=report', + ), + 'text' => + array ( + 0 => '用户举报', + 1 => 'report_tips', + 2 => '可以根据举报真实情况,给举报者加减积分,设置用户举报奖惩使用的积分多人举报时奖惩第一个举报人。', + ), + ), + 221 => + array ( + 'index' => + array ( + '站点信息' => 'action=setting&operation=basic', + ), + 'text' => + array ( + 0 => '站点信息', + 1 => 'setting_basic_bbname', + 2 => '站点名称', + 3 => '站点名称,将显示在浏览器窗口标题等位置', + 4 => 'setting_basic_sitename', + 5 => '网站名称', + 6 => '网站名称,将显示在页面底部的联系方式处', + 7 => 'setting_basic_siteurl', + 8 => '网站 URL', + 9 => '网站 URL,将作为链接显示在页面底部', + 10 => 'setting_basic_adminemail', + 11 => '管理员邮箱', + 12 => '管理员 E-mail,将作为系统发邮件的时候的发件人地址', + 13 => 'setting_basic_site_qq', + 14 => 'QQ在线客服号码', + 15 => '设置我的QQ在线状态', + 16 => 'setting_basic_icp', + 17 => '网站备案信息代码', + 18 => '页面底部可以显示 ICP 备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空', + 19 => 'setting_basic_mps', + 20 => '联网备案信息代码', + 21 => '页面底部可以显示联网备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空', + 22 => 'setting_basic_boardlicensed', + 23 => '显示授权信息链接', + 24 => '选择“是”将在页脚显示商业授权用户链接,链接将指向 Discuz! 官方网站,用户可通过此链接验证其所使用的 Discuz! 是否经过商业授权', + 25 => 'setting_basic_stat', + 26 => '网站第三方统计代码', + 27 => '页面底部可以显示第三方统计', + 28 => 'setting_basic_bbclosed', + 29 => '关闭站点', + 30 => '暂时将站点关闭,其他人无法访问,但不影响管理员访问', + 31 => 'setting_basic_closedreason', + 32 => '关闭站点的原因', + 33 => '站点关闭时出现的提示信息', + 34 => 'setting_basic_bbclosed_activation', + 35 => '站点关闭时允许 UCenter 中的用户激活', + ), + ), + 222 => + array ( + 'index' => + array ( + '广播设置' => 'action=setting&operation=follow', + '基本设置' => 'action=setting&operation=follow&anchor=base', + ), + 'text' => + array ( + 0 => '广播设置 » 基本设置', + 1 => 'setting_follow_base_default_follow_retain_day', + 2 => '广播存档时间', + 3 => '广播超过多少天移入存档表(单位:天)', + 4 => 'setting_follow_base_default_follow_add_notice', + 5 => '被关注时通知被关注者', + 6 => '开启后用户被关注时将会收到通知', + 7 => 'setting_follow_base_default_view_profile', + 8 => '默认查看个人资料', + 9 => '该设置对管理员有效,开启后默认管理员查看将直接查看个人资料页面', + ), + ), + 223 => + array ( + 'index' => + array ( + '空间设置' => 'action=setting&operation=home', + '基本设置' => 'action=setting&operation=home&anchor=base', + ), + 'text' => + array ( + 0 => '空间设置 » 基本设置', + 1 => 'setting_home_base_feedday', + 2 => '动态保留天数', + 3 => '(默认为 7)个人动态的保留天数。超过该天数的个人动态会被清理掉,从而可以保证MySQL的效率。建议不要设置太长', + 4 => 'setting_home_base_feedmaxnum', + 5 => '首页动态显示数', + 6 => '(默认为 100)首页显示的好友动态将从这些数目的事件中进行合并显示。建议不要设置太多,从而可以保证MySQL的效率,但最少不能低于50', + 7 => 'setting_home_base_feedhotday', + 8 => '热点推荐的天数范围', + 9 => '(单位天,默认为 2天)设置首页热点推荐选择的天数范围', + 10 => 'setting_home_base_feedhotmin', + 11 => '热点推荐的最小热度值', + 12 => '设置当发布的信息热度值超过多少后,才会显示在推荐里面', + 13 => 'setting_home_base_feedtargetblank', + 14 => '动态链接新窗口打开', + 15 => '如果选择是,用户阅读动态的时候,所有的链接都会在新窗口打开', + 16 => 'setting_home_base_showallfriendnum', + 17 => '首页动态默认标签设置', + 18 => '好友数小于该值的时候显示所有人的动态,超过这个数值显示好友动态。在日志、相册列表页面,该参数同样生效', + 19 => 'setting_home_base_feedhotnum', + 20 => '首页显示热点的数目', + 21 => '(默认为 3)为0,则首页不显示热点推荐。最大不要超过10个。系统会自动获取10个热点,其中,排名第一的热点会固定显示,其余热点会随机显示', + 22 => 'setting_home_base_maxpage', + 23 => '列表最大分页数', + 24 => '(默认为 100)允许用户查看的最大分页数。当用户查看的分页数越大的时候,对服务器的负载压力就越大', + 25 => 'setting_home_base_sendmailday', + 26 => '邮件通知更新天数', + 27 => '(默认 0) 单位:天,当用户多少天没有登录站点的时候才会给其发送邮件通知;设置为0,则不启用邮件通知功能;启用本功能将会轻微增加服务器负载', + 28 => 'setting_home_base_recycle_bin', + 29 => '开启日志回收站', + 30 => '打开此功能后,所有被删除日志将被放在回收站中,而不会被直接删除', + 31 => 'setting_home_base_groupnum', + 32 => '好友用户组个数', + 33 => '(默认为 8)设置每个用户最多拥有的好友用户组个数', + 34 => 'setting_home_base_default_', + 35 => '', + 36 => 'setting_home_base_default_doing', + 37 => '默认记录提示内容', + 38 => '一行为一个提示内容,这些内容将在记录发表框中显示,随机从这些默认提示中选取一行做为提示内容', + ), + ), + 224 => + array ( + 'index' => + array ( + '空间设置' => 'action=setting&operation=home', + '隐私设置' => 'action=setting&operation=home&anchor=privacy', + ), + 'text' => + array ( + 0 => '空间设置 » 隐私设置', + 1 => 'setting_home_privacy_new_user', + 2 => '新用户默认隐私设置', + 3 => 'setting_home_privacy_view_index', + 4 => '个人空间首页', + 5 => 'setting_home_privacy_view_profile', + 6 => '个人空间资料', + 7 => 'setting_home_privacy_view_friend', + 8 => '好友列表', + 9 => 'setting_home_privacy_view_wall', + 10 => '留言板', + 11 => 'setting_home_privacy_view_feed', + 12 => '动态', + 13 => '非“全站用户可见”同时限制了动态首页的游客访问', + 14 => 'setting_home_privacy_view_doing', + 15 => '记录', + 16 => '在全站的记录列表中可能会出现记录信息。 ', + 17 => 'setting_home_privacy_view_blog', + 18 => '日志', + 19 => '相关浏览权限需要在每篇日志中单独设置方可完全生效', + 20 => 'setting_home_privacy_view_album', + 21 => '相册', + 22 => '相关浏览权限需要在每个相册中单独设置方可完全生效', + 23 => 'setting_home_privacy_view_share', + 24 => '分享', + 25 => '在全站的分享列表中可能会出现分享信息。 ', + 26 => 'setting_home_privacy_default_feed', + 27 => '默认动态发布设置', + 28 => 'setting_home_privacy_alluser', + 29 => '全站用户可见', + 30 => 'setting_home_privacy_friend', + 31 => '仅好友可见', + 32 => 'setting_home_privacy_self', + 33 => '仅自己可见', + 34 => 'setting_home_privacy_register', + 35 => '仅注册用户可见', + 36 => 'setting_home_privacy_default_feed_doing', + 37 => '记录', + 38 => 'setting_home_privacy_default_feed_blog', + 39 => '撰写日志', + 40 => 'setting_home_privacy_default_feed_upload', + 41 => '上传图片', + 42 => 'setting_home_privacy_default_feed_share', + 43 => '添加分享', + 44 => 'setting_home_privacy_default_feed_poll', + 45 => '发起投票', + 46 => 'setting_home_privacy_default_feed_joinpoll', + 47 => '参与投票', + 48 => 'setting_home_privacy_default_feed_friend', + 49 => '添加好友', + 50 => 'setting_home_privacy_default_feed_comments', + 51 => '发表评论/留言', + 52 => 'setting_home_privacy_default_feed_show', + 53 => '竞价排名', + 54 => 'setting_home_privacy_default_feed_credit', + 55 => '积分消费', + 56 => 'setting_home_privacy_default_feed_spaceopen', + 57 => '新空间开通', + 58 => 'setting_home_privacy_default_feed_invite', + 59 => '邀请好友', + 60 => 'setting_home_privacy_default_feed_task', + 61 => '完成任务', + 62 => 'setting_home_privacy_default_feed_profile', + 63 => '更新个人资料', + 64 => 'setting_home_privacy_default_feed_click', + 65 => '对日志/图片表态', + 66 => 'setting_home_privacy_default_feed_newthread', + 67 => '论坛发帖', + 68 => 'setting_home_privacy_default_feed_newreply', + 69 => '论坛回帖', + ), + ), + 225 => + array ( + 'index' => + array ( + '注册与访问控制' => 'action=setting&operation=access', + '注册' => 'action=setting&operation=access&anchor=register', + ), + 'text' => + array ( + 0 => '注册与访问控制 » 注册', + 1 => 'setting_access_register_status', + 2 => '允许新用户注册', + 3 => '设置是否允许游客注册成为站点会员,您可以根据站点需求选择注册方式', + 4 => 'setting_access_register_invite_buyprompt', + 5 => '邀请注册说明', + 6 => 'setting_access_register_invite_buy', + 7 => '允许充值购买邀请码', + 8 => '允许游客通过在线充值购买注册邀请码。仅限于关闭普通注册时有效。开启前请确认您的电子商务及发送邮件功能可正常使用', + 9 => 'setting_access_register_invite_buyprice', + 10 => '邀请码单价(元)', + 11 => 'setting_access_register_invite_credit', + 12 => '邀请新注册会员奖励所用扩展积分', + 13 => '邀请新注册会员奖励所用的扩展积分,包括奖励邀请人和被邀请人的奖励积分', + 14 => 'setting_access_register_invite_addcredit', + 15 => '被邀请人奖励积分数量', + 16 => '通过邀请码注册成功后,奖励被邀请人的扩展积分数量', + 17 => 'setting_access_register_invite_invitedcredit', + 18 => '邀请人奖励积分数量', + 19 => '通过邀请码注册成功后,奖励邀请人的扩展积分数量', + 20 => 'setting_access_register_invite_group', + 21 => '邀请注册用户初始用户组', + 22 => '被邀请人的初始用户组', + 23 => 'setting_access_register_invite_areawhite', + 24 => '不受邀请码限制的地区列表', + 25 => '当用户处于本列表中的地址时,注册时不受邀请码限制。每个地区一行,例如 "北京"(不含引号),留空为不设置。注意:如要正确无误的判断您 IP 地址所在的地区,请到网上下载 qqwry.dat IP 地址库文件上传到 "data/ipdata/" 目录下更名为 wry.dat', + 26 => 'setting_access_register_invite_ipwhite', + 27 => '不受邀请码限制的 IP 列表', + 28 => '当用户处于本列表中的 IP 地址时,注册时不受邀请码限制。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 29 => 'setting_access_register_regclosemessage', + 30 => '关闭注册提示信息', + 31 => '当站点关闭注册时的提示信息', + 32 => 'setting_access_register_name', + 33 => '注册地址:', + 34 => '设置站点注册地址 mod 值,默认为“register”,修改名称有利于防止灌水软件,有别于 Discuz! X 之前的版本更改了此设置,不需要修改任何文件名称,只在此修改即可', + 35 => 'setting_access_register_send_register_url', + 36 => '通过邮件发送注册链接', + 37 => '开启后系统会发一条注册的地址到用户的邮箱,从该地址链接过来的允许注册,同时建议UCenter中开启一个邮箱只允许注册一个账户注意:只有在站长 - 邮件设置中完成邮件设置,确保邮件能发送成功下可以开启该功能 ', + 38 => 'setting_access_register_link_name', + 39 => '注册链接文字', + 40 => '设置站点注册页的链接文字,默认为“立即注册”', + 41 => 'setting_access_register_censoruser', + 42 => '用户信息保留关键字', + 43 => '用户在其用户信息中无法使用这些关键字。每个关键字一行,可使用通配符 "*" 如 "*版主*"(不含引号)', + 44 => 'setting_access_register_pwlength', + 45 => '密码最小长度', + 46 => '新用户注册时密码最小长度,0或不填为不限制', + 47 => 'setting_access_register_strongpw', + 48 => '强制密码复杂度', + 49 => '新用户注册时密码中必须存在所选字符类型,不选则为无限制', + 50 => 'setting_access_register_verify', + 51 => '新用户注册验证', + 52 => '选择“无”用户可直接注册成功;选择“Email 验证”将向用户注册 Email 发送一封验证邮件以确认邮箱的有效性(开启“通过邮件发送注册链接”该设置自动通过验证);选择“人工审核”将由管理员人工逐个确定是否允许新用户注册', + 53 => 'setting_access_register_verify_areawhite', + 54 => '不受新用户注册验证限制的地区列表', + 55 => '当用户处于本列表中的地址时,直接注册成功,无需新用户注册验证。每个地区一行,例如 "北京"(不含引号),留空为不设置', + 56 => 'setting_access_register_verify_ipwhite', + 57 => '不受新用户注册验证限制的 IP 列表', + 58 => '当用户处于本列表中的 IP 地址时,直接注册成功,无需新用户注册验证。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 59 => 'setting_access_register_maildomain', + 60 => '注册邮箱域名限制', + 61 => '选择“无”直接关闭本功能;选择“白名单模式”,只有限制名单中的邮箱域名可以注册;选择“黑名单模式”,限制名单中的邮箱域名不能注册。', + 62 => 'setting_access_register_maildomain_list', + 63 => '限制名单', + 64 => '当邮箱的域名处于本列表中的地址时,将根据上述选项进行相应限制操作。输入要限制的邮箱域名即可,例如屏蔽 xxx@xxx.com 的域,只需输入 @xxx.com。每行一个域名。', + 65 => 'setting_access_register_ctrl', + 66 => '同一 IP 注册间隔限制(小时)', + 67 => '同一 IP 在本时间间隔内将只能注册一个账号,0 为不限制', + 68 => 'setting_access_register_floodctrl', + 69 => '同一 IP 在 24 小时允许注册的最大次数', + 70 => '同一 IP 地址在 24 小时内尝试注册的次数限制,建议在 30 - 100 范围内取值,0 为不限制', + 71 => 'setting_access_register_ipctrl_time', + 72 => '限时注册IP注册间隔限制(小时):', + 73 => '用户处于限时注册的 IP 列表中的 IP 地址时,同一 IP 在本时间间隔内将只能注册一个账号', + 74 => 'setting_access_register_ipctrl', + 75 => '限时注册的 IP 列表', + 76 => '当用户处于本列表中的 IP 地址时,在限时注册IP注册间隔限制内将至多只允许注册一个账号。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 77 => 'setting_access_register_welcomemsg', + 78 => '发送欢迎信息', + 79 => '可选择是否自动向新注册用户发送一条欢迎信息', + 80 => 'setting_access_register_welcomemsgtitle', + 81 => '欢迎信息标题', + 82 => '系统发送的欢迎信息的标题,不支持 HTML,不超过 75 字节。 ', + 83 => 'setting_access_register_welcomemsgtxt', + 84 => '欢迎信息内容', + 85 => '系统发送的欢迎信息的内容。标题内容均支持变量替换,可以使用如下变量:{username} : 用户名{time} : 发送时间{sitename} : 网站名称(显示在页面底部的联系方式处的名称){bbname} : 站点名称(显示在浏览器窗口标题等位置的名称){adminemail} : 管理员 Email', + 86 => 'setting_access_register_bbrules', + 87 => '显示网站服务条款', + 88 => '新用户注册时显示网站服务条款', + 89 => 'setting_access_register_bbruleforce', + 90 => '是否强制显示网站服务条款', + 91 => '选择是则在用户注册时,首先将看到网站服务条款全文,必须同意才可以继续注册', + 92 => 'setting_access_register_bbrulestxt', + 93 => '服务条款内容', + 94 => '网站服务条款的详细内容', + 95 => 'setting_access_register_open', + 96 => '开放普通注册', + 97 => 'setting_access_register_invite', + 98 => '开放邀请注册', + 99 => 'setting_access_register_connect', + 100 => '开放QQ注册', + 101 => 'setting_access_register_strongpw_1', + 102 => '数字', + 103 => 'setting_access_register_strongpw_2', + 104 => '小写字母', + 105 => 'setting_access_register_strongpw_3', + 106 => '大写字母', + 107 => 'setting_access_register_strongpw_4', + 108 => '符号', + 109 => 'none', + 110 => '无', + 111 => 'setting_access_register_verify_email', + 112 => 'Email 验证', + 113 => 'setting_access_register_verify_manual', + 114 => '人工审核', + 115 => 'setting_access_register_maildomain_white', + 116 => '白名单模式', + 117 => 'setting_access_register_maildomain_black', + 118 => '黑名单模式', + 119 => 'setting_access_register_welcomemsg_pm', + 120 => '发送欢迎信息', + 121 => 'setting_access_register_welcomemsg_email', + 122 => '发送欢迎 Email', + ), + ), + 226 => + array ( + 'index' => + array ( + '注册与访问控制' => 'action=setting&operation=access', + '访问控制' => 'action=setting&operation=access&anchor=access', + ), + 'text' => + array ( + 0 => '注册与访问控制 » 访问控制', + 1 => 'setting_access_access_newbiespan', + 2 => '新手见习期限(分钟)', + 3 => '新注册用户在本期限内将无法发帖和短消息,不影响版主和管理员,0 为不限制', + 4 => 'setting_access_access_ipaccess', + 5 => '允许访问站点的 IP 列表', + 6 => '只有当用户处于本列表中的 IP 地址时才可以访问本站点,列表以外的地址访问将视为 IP 被禁止,仅适用于诸如企业、学校内部站点等极个别场合。本功能对管理员没有特例,如果管理员不在此列表范围内将同样不能登录,请务必慎重使用本功能。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为所有 IP 除明确禁止的以外均可访问', + 7 => 'setting_access_access_adminipaccess', + 8 => '允许访问管理中心的 IP 列表', + 9 => '只有当用户处于本列表中的 IP 地址时才可以访问站点管理中心,列表以外的地址访问将无法访问,但仍可访问站点前端用户界面,请务必慎重使用本功能。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为所有 IP 除明确禁止的以外均可访问管理中心', + 10 => 'setting_access_access_domainwhitelist', + 11 => '允许发表的域名列表', + 12 => '当用户组禁止发表 URL ,或者 URL 不解析时,处于本列表中的域名下的 URL 仍然可以正常发表,正常解析,每行一个域名,默认为本站域名可以正常发表', + ), + ), + 227 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + '全局' => 'action=setting&operation=styles&anchor=global', + ), + 'text' => + array ( + 0 => '界面设置 » 全局', + 1 => 'setting_tips', + 2 => '以红色虚线标示的选项,表示该选项和系统效率、负载能力与资源消耗有关(提高效率、或降低效率),建议依据自身服务器情况进行调整。', + 3 => 'setting_styles_global', + 4 => '全局', + 5 => 'setting_styles_global_home_style', + 6 => '家园展示风格', + 7 => '选择日志、相册、分享、记录、广播展示风格', + 8 => 'setting_styles_global_homepage_style', + 9 => '个人主页默认皮肤', + 10 => '选择个人主页默认展示风格', + 11 => 'setting_styles_global_navsubhover', + 12 => '二级导航显示方式', + 13 => '设置二级导航的显示方式。如果设置为显示所有主导航的二级导航,那么会当鼠标移动到其他主导航文字上方的时候显示它们的二级导航', + 14 => 'setting_styles_index_allowwidthauto', + 15 => '站点宽窄风格', + 16 => '设置站点的显示风格是宽版还是窄版。其中论坛的版块中还可以进行独立的设置', + 17 => 'setting_styles_index_switchwidthauto', + 18 => '允许用户自由切换', + 19 => '设置是否允许用户自由切换宽窄风格', + 20 => 'setting_styles_global_allowfloatwin', + 21 => '启用浮动窗口', + 22 => '设置以浮动方式显示的窗口', + 23 => 'setting_styles_global_showfjump', + 24 => '显示版块导航', + 25 => '设置是否在快捷导航中显示版块导航', + 26 => 'setting_styles_global_creditnotice', + 27 => '积分变动提示', + 28 => '当用户在站点的操作产生积分变动时,将弹出提示信息告知用户', + 29 => 'setting_styles_global_showusercard', + 30 => '显示用户名片', + 31 => '设置当鼠标移动到用户名位置上时是否显示他的名片', + 32 => 'setting_styles_global_anonymoustext', + 33 => '匿名用户的昵称', + 34 => '设置文章或评论留言中的匿名用户显示的文字。如:本站网友', + 35 => 'setting_styles_global_home_style_1', + 36 => '以SNS模块风格展示', + 37 => 'setting_styles_global_home_style_0', + 38 => '以论坛模块风格展示', + 39 => 'setting_styles_global_homepage_style_1', + 40 => '个性化DIY风格', + 41 => 'setting_styles_global_homepage_style_0', + 42 => '论坛样式', + 43 => 'setting_styles_global_navsubhover_0', + 44 => '只显示当前的二级导航', + 45 => 'setting_styles_global_navsubhover_1', + 46 => '显示所有主导航的二级导航', + 47 => 'setting_styles_index_allowwidthauto_1', + 48 => '窄屏(固定宽度)', + 49 => 'setting_styles_index_allowwidthauto_0', + 50 => '宽屏(自由宽度)', + ), + ), + 228 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + '论坛首页' => 'action=setting&operation=styles&anchor=index', + ), + 'text' => + array ( + 0 => '界面设置 » 论坛首页', + 1 => 'setting_styles_index', + 2 => '论坛首页', + 3 => 'setting_styles_index_indexhot_status', + 4 => '论坛热点', + 5 => '设置是否显示全论坛的热点主题', + 6 => 'setting_styles_index_indexhot_limit', + 7 => '论坛热点显示数量', + 8 => '设置论坛热点条目数,默认值 10 条', + 9 => 'setting_styles_index_indexhot_days', + 10 => '论坛热点天数', + 11 => '设置显示多少天内的主题,默认值 7 天', + 12 => 'setting_styles_index_indexhot_expiration', + 13 => '论坛热点更新周期(秒)', + 14 => '设置论坛热点在多长时间更新一次,默认值 900', + 15 => 'setting_styles_index_indexhot_messagecut', + 16 => '论坛热点内容截取文字长度', + 17 => '设置论坛热点内容的文字长度,默认值 200 个字', + 18 => 'setting_styles_index_subforumsindex', + 19 => '显示版块的下级子版块', + 20 => '设置是否在版块描述下方显示下级子版块名字和链接(如果存在的话)。注意: 本功能不考虑子版块特殊浏览权限的情况,只要存在即会被显示出来', + 21 => 'setting_styles_index_forumlinkstatus', + 22 => '显示友情链接', + 23 => '设置是否显示友情链接', + 24 => 'setting_styles_index_forumallowside', + 25 => '显示边栏', + 26 => '选择“是”论坛首页侧边将显示聚合论坛内容的信息', + 27 => 'setting_styles_index_whosonline', + 28 => '显示在线用户', + 29 => '设置是否在论坛首页底部和论坛版块边栏显示在线会员列表', + 30 => 'setting_styles_index_whosonline_contract', + 31 => '缩略显示在线列表', + 32 => '如果打开该选项,在线列表将只显示在线用户数,不显示详情,此时会员可手动打开在线用户列表(最大在线超过 500 人系统将自动缩略显示在线列表)', + 33 => 'setting_styles_index_online_more_members', + 34 => '最多显示在线人数', + 35 => '此设置只有在显示在线用户启用时才有效。设置为 0 则为不限制', + 36 => 'setting_styles_index_hideprivate', + 37 => '隐藏无权访问的版块', + 38 => '不在列表中显示当前用户无权访问的版块', + 39 => 'setting_styles_index_showfollowcollection', + 40 => '首页显示用户订阅的淘专辑数量', + 41 => '在首页显示用户订阅的淘专辑数量', + 42 => 'setting_styles_index_disfixednv', + 43 => '关闭顶部导航固定', + 44 => '当向上滚动屏幕时,主导航将即时出现在屏幕的顶部', + 45 => 'setting_styles_index_display_none', + 46 => '不显示', + 47 => 'setting_styles_index_whosonline_index', + 48 => '仅在论坛首页显示', + 49 => 'setting_styles_index_whosonline_forum', + 50 => '仅在论坛版块显示', + 51 => 'setting_styles_index_whosonline_both', + 52 => '在论坛首页和论坛版块显示', + ), + ), + 229 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + '主题列表页' => 'action=setting&operation=styles&anchor=forumdisplay', + ), + 'text' => + array ( + 0 => '界面设置 » 主题列表页', + 1 => 'setting_tips', + 2 => '以红色虚线标示的选项,表示该选项和系统效率、负载能力与资源消耗有关(提高效率、或降低效率),建议依据自身服务器情况进行调整。', + 3 => 'setting_styles_forumdisplay', + 4 => '主题列表页', + 5 => 'setting_styles_forumdisplay_tpp', + 6 => '每页显示主题数', + 7 => '主题列表中每页显示主题数目', + 8 => 'setting_styles_forumdisplay_threadmaxpages', + 9 => '主题列表最大页数', + 10 => '主题列表中用户可以翻阅到的最大页数,建议设置为默认值 1000,或在不超过 2500 范围内取值,0 为不限制', + 11 => 'setting_styles_forumdisplay_leftsidewidth', + 12 => '左侧版块导航宽度', + 13 => '设置左侧版块导航的宽度,设置为 0 或者版块开启了边栏时不显示此导航', + 14 => 'setting_styles_forumdisplay_leftsideopen', + 15 => '左侧版块默认展开', + 16 => '设置左侧版块导航是否默认全部展开', + 17 => 'setting_styles_forumdisplay_globalstick', + 18 => '启用全局置顶', + 19 => '选择“是”,置顶 III 的主题将在全部论坛显示,置顶 II 的主题将在当前分区中显示。注意: 本功能会加重服务器负担', + 20 => 'setting_styles_forumdisplay_targetblank', + 21 => '“新窗”是否默认勾选', + 22 => '选择“是”则默认情况下主题列表页主题链接在新窗口打开,默认为“否”', + 23 => 'setting_styles_forumdisplay_stick', + 24 => '置顶主题的标识', + 25 => '以英文状态下的逗号分割,只有三项有效,级别依次为从高至低', + 26 => 'setting_styles_forumdisplay_part', + 27 => '显示主题列表分割带', + 28 => '选择“否”,在主题列表页将不显示置顶主题与普通主题之间的分割带(版块主题那一空行)', + 29 => 'setting_styles_forumdisplay_visitedforums', + 30 => '显示最近访问版块数量', + 31 => '设置在版块列表和文章浏览中显示最近访问过的版块数量,建议设置为 10 以内,0 为关闭此功能', + 32 => 'setting_styles_forumdisplay_fastpost', + 33 => '快速发帖/回帖', + 34 => '在主题列表页底部显示快速发帖,在文章内容页底部显示快速回帖', + 35 => 'setting_styles_forumdisplay_fastsmilies', + 36 => '显示推荐表情', + 37 => '在快速发帖右侧显示推荐表情。推荐的表情需要到“表情管理”中设置', + 38 => 'setting_styles_forumdisplay_forumpicstyle_thumbwidth', + 39 => '主题封面宽度', + 40 => '当版块开启图片列表模式时有效,0或不填 将使用默认值(203)。变更宽高建议重建主题封面,点此重建', + 41 => 'setting_styles_forumdisplay_forumpicstyle_thumbheight', + 42 => '主题封面高度', + 43 => '当版块开启图片列表模式时有效,0或不填 将根据原图高度按比例生成,封面高度不同,有瀑布流的效果', + 44 => 'setting_styles_forumdisplay_forumpicstyle_thumbnum', + 45 => '封面图显示数量', + 46 => '当版块开启图片列表模式时有效,0或不填 将和普通列表模式每页显示主题数一致', + 47 => 'setting_styles_forumdisplay_newbie', + 48 => '新人帖图标', + 49 => '用户发第一篇主题时显示的图标,为空则不打图标', + 50 => 'setting_styles_forumdisplay_disfixednv_forumdisplay', + 51 => '关闭顶部导航固定', + 52 => '当向上滚动屏幕时,主导航将即时出现在屏幕的顶部', + 53 => 'setting_styles_forumdisplay_threadpreview', + 54 => '关闭主题预览', + 55 => '关闭后将不可在主题列表页预览文章内容', + ), + ), + 230 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + '文章内容页' => 'action=setting&operation=styles&anchor=viewthread', + ), + 'text' => + array ( + 0 => '界面设置 » 文章内容页', + 1 => 'nav_setting_viewthread', + 2 => '文章内容页', + 3 => 'setting_styles_viewthread_ppp', + 4 => '每页显示帖数', + 5 => '文章列表中每页显示文章数目', + 6 => 'setting_styles_viewthread_starthreshold', + 7 => '星星升级阈值', + 8 => '星星数在达到此阈值(设为 N)时,N 个星星显示为 1 个月亮、N 个月亮显示为 1 个太阳。默认值为 2,如设为 0 则取消此项功能,始终以星星显示', + 9 => 'setting_styles_viewthread_maxsigrows', + 10 => '签名最大高度(px)', + 11 => '设置文章中允许显示签名的最大高度', + 12 => 'setting_styles_viewthread_sigviewcond', + 13 => '签名显示条件', + 14 => '只有文章字数大于指定数值后才显示签名,0为不限制', + 15 => 'setting_styles_viewthread_sigimgclick_on', + 16 => '取消签名图片的动态放大功能', + 17 => 'setting_styles_viewthread_rate_on', + 18 => '是否在页面上显示评分理由', + 19 => 'setting_styles_viewthread_rate_number', + 20 => '评分条目数', + 21 => '在文章中显示最近评分结果的条目数,0 为不显示', + 22 => 'setting_styles_viewthread_collection_number', + 23 => '相关淘专辑条目数', + 24 => '在主题帖中显示相关淘专辑的条目数,0 为不显示', + 25 => 'setting_styles_viewthread_relate_number', + 26 => '相关文章条目数', + 27 => '在主题帖中显示相关文章的条目数,0 为不显示', + 28 => 'setting_styles_viewthread_relate_time', + 29 => '相关文章缓存时间', + 30 => '单位:分钟,在主题帖中显示相关文章的缓存时间(0 为不缓存,不推荐)', + 31 => 'setting_styles_viewthread_hideattachdown', + 32 => '是否隐藏附件下载次数', + 33 => '开启后贴内图片、附件的下载次数会被隐藏', + 34 => 'setting_styles_viewthread_hideattachtips', + 35 => '是否隐藏附件信息条', + 36 => '开启后贴内图片、附件的提示信息条会被隐藏,开启后无法使用转存到相册功能,如果当前板块是图片列表板块且当前用户有权设置主题封面则此功能无效', + 37 => 'setting_styles_viewthread_show_signature', + 38 => '是否显示作者签名', + 39 => '', + 40 => 'setting_styles_viewthread_show_face', + 41 => '是否显示作者头像', + 42 => '', + 43 => 'setting_styles_viewthread_show_images', + 44 => '是否显示帖内图片', + 45 => '', + 46 => 'setting_styles_viewthread_imagemaxwidth', + 47 => '帖内图片最大宽度', + 48 => '当帖内图片宽度大于设置的值时图片宽度会被自动调节。请填写整数值,不支持百分比数值', + 49 => 'setting_styles_viewthread_imagelistthumb', + 50 => '帖内图片列表中图片横排显示条件', + 51 => '设置当帖内图片列表中图片数量满足多少张以后以横排方式显示,0 或留空为关闭横排显示', + 52 => 'setting_styles_viewthread_zoomstatus', + 53 => '是否使用图片动态放大效果', + 54 => '当帖内图片宽度大于“帖内图片最大宽度”时是否附加鼠标点击时的动态放大效果。选择“是”单击图片会有动态放大效果,选择“否”将会新窗口打开图片', + 55 => 'setting_styles_viewthread_showexif', + 56 => '图片附件显示 EXIF 信息', + 57 => '设置图片附件在动态放大效果中是否显示 EXIF 信息', + 58 => 'setting_styles_viewthread_vtonlinestatus', + 59 => '显示作者在线状态', + 60 => '是否显示文章作者的在线状态,注意:“精确显示”会轻微加重服务器负担', + 61 => 'setting_styles_viewthread_userstatusby', + 62 => '显示作者的组头衔', + 63 => '设置在文章中是否显示作者的用户组头衔', + 64 => 'setting_styles_viewthread_postno', + 65 => '文章顺序单位', + 66 => '设置文章显示顺序编号的单位,如“#”将显示为 1 #', + 67 => 'setting_styles_viewthread_postnocustom', + 68 => '文章顺序名称', + 69 => '设置每篇主题所有文章的顺序名称,每行填写一个名称,第一行代表主题帖,第二行代表主题的第一个回复,以此类推', + 70 => 'setting_styles_viewthread_maxsmilies', + 71 => '最大单一表情解析次数', + 72 => '在一篇文章中解析的单一表情符号的最大次数,超过此次数限制的表情将不被解析而保留原样,以避免用户在一篇文章中恶意发表大量表情影响正常阅读,0 为不限制', + 73 => 'setting_styles_viewthread_author_onleft', + 74 => '作者用户名显示位置', + 75 => '显示位置并不会影响论坛的性能和美观,请根据您会员的浏览习惯进行选择', + 76 => 'setting_styles_forumdisplay_disfixedavatar', + 77 => '关闭头像区域固定', + 78 => '当滚动屏幕时,左侧头像区域将跟随右侧文章内容浮动,填充文章内容区域很高时导致的左侧空白', + 79 => 'setting_styles_forumdisplay_disfixednv_viewthread', + 80 => '关闭顶部导航固定', + 81 => '当向上滚动屏幕时,主导航将即时出现在屏幕的顶部', + 82 => 'setting_styles_forumdisplay_threadguestlite', + 83 => '游客阅读简化模式', + 84 => '启用后,游客阅读主题时,将不显示用户的具体资料信息。', + 85 => 'setting_styles_viewthread_close_leftinfo', + 86 => '关闭左侧信息栏', + 87 => '文章左侧用户信息栏是否默认关闭', + 88 => 'setting_styles_viewthread_close_leftinfo_userctrl', + 89 => '左侧信息栏允许用户控制', + 90 => '浏览主题时,用户是否可以控制左侧信息栏的显示状态', + 91 => 'setting_styles_viewthread_guestviewthumb', + 92 => '游客看小图', + 93 => '游客浏览主题时,帖内的图片将以指定大小的小图显示,可提高会员注册数和活跃量', + 94 => 'setting_styles_viewthread_guestviewthumb_width', + 95 => '小图宽度', + 96 => '指定小图的宽度,默认值为100', + 97 => 'setting_styles_viewthread_guestviewthumb_height', + 98 => '小图高度', + 99 => '指定小图的高度,默认值为100', + 100 => 'setting_styles_viewthread_guesttipsinthread', + 101 => '帖内游客登录提示', + 102 => '游客在浏览主题时,在主题的顶部显示提示文字', + 103 => 'setting_styles_viewthread_guesttipsinthread_text', + 104 => '登录提示提示文字', + 105 => '自定义显示提示文字,默认为:马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。', + 106 => 'setting_styles_viewthread_imgcontent', + 107 => '主题内容生成图片宽度', + 108 => '本功能需要PHP支持GD库,内容里有中文需要将中文 TTF 字体文件放到 static/image/seccode/font/ch/ 目录下。默认100个汉字,字体不同宽度略有差别,请跟据实际效果调整。', + 109 => 'setting_styles_viewthread_fast_reply', + 110 => '开启主题帖快速回复', + 111 => '开启后将在主题帖下方展示快速回复框', + 112 => 'setting_styles_viewthread_allow_replybg', + 113 => '开启文章快速回复框背景', + 114 => '开启后允许给文章快速回复框添加背景图片', + 115 => 'setting_styles_viewthread_global_reply_background', + 116 => '全局文章快速回复框背景', + 117 => '设置全局文章快速回复框背景图片,版块设置优先', + 118 => 'setting_styles_viewthread_display_none', + 119 => '', + 120 => 'setting_styles_viewthread_online_easy', + 121 => '快速显示(推荐使用)', + 122 => 'setting_styles_viewthread_online_exactitude', + 123 => '精确显示', + 124 => 'delete', + 125 => '删除', + ), + ), + 231 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + '帖内用户信息' => 'action=setting&operation=styles&anchor=threadprofile', + ), + 'text' => + array ( + 0 => '界面设置 » 帖内用户信息', + 1 => 'nav_global', + 2 => '全局', + 3 => 'setting_styles_threadprofile_addplan', + 4 => '添加新方案', + ), + ), + 232 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + '提示信息' => 'action=setting&operation=styles&anchor=refresh', + ), + 'text' => + array ( + 0 => '界面设置 » 提示信息', + 1 => 'setting_styles_refresh', + 2 => '提示信息', + 3 => 'setting_styles_refresh_refreshtime', + 4 => '提示信息停留时间(秒)', + 5 => '各种提示信息页面显示时间的长短,一般设置为 1-3。较短的提示时间让用户拥有快速的体验,但是也可能让用户无法看清信息', + 6 => 'setting_styles_refresh_quick', + 7 => '开启直接/快速跳转', + 8 => '对于站点中的某些成功的操作不显示提示信息,直接跳转到下一个页面,例如发帖,回复等等,可以节省用户等待跳转的时间', + 9 => 'setting_styles_refresh_messages', + 10 => '直接/快速跳转的信息', + 11 => '当开启直接/快速跳转以后,以下信息将会直接跳转。每行填写一个信息的关键字', + ), + ), + 233 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=styles', + '弹出信息' => 'action=setting&operation=styles&anchor=sitemessage', + ), + 'text' => + array ( + 0 => '界面设置 » 弹出信息', + 1 => 'setting_styles_sitemessage', + 2 => '弹出信息', + 3 => 'setting_styles_sitemessage_time', + 4 => '弹出信息停留时间(秒)', + 5 => '各种弹出信息显示时间的长短,一般设置为 3-10,0 为鼠标点击后消失', + 6 => 'setting_styles_sitemessage_register', + 7 => '注册页面', + 8 => '注册页面的弹出信息,每行填写一条信息,多条信息将随机显示', + 9 => 'setting_styles_sitemessage_login', + 10 => '登录页面', + 11 => '登录页面的弹出信息,每行填写一条信息,多条信息将随机显示', + 12 => 'setting_styles_sitemessage_newthread', + 13 => '发帖页面', + 14 => '发帖页面的弹出信息,每行填写一条信息,多条信息将随机显示', + 15 => 'setting_styles_sitemessage_reply', + 16 => '回复页面', + 17 => '回复页面的弹出信息,每行填写一条信息,多条信息将随机显示', + ), + ), + 234 => + array ( + 'index' => + array ( + '界面设置' => 'action=setting&operation=threadprofile&do=add', + ), + 'text' => + array ( + 0 => '界面设置', + 1 => 'setting_threadprofile_tpl_tpls', + 2 => '{标记} 不含参数的贴内用户信息标记调用。{标记=参数} 含参数的贴内用户信息标记调用,多个参数用","分割{标记}HTML{*}HTML{/标记} 当有调用内容有值时显示 {*} 前后的 HTML 内容“plugin:插件标识”格式的标记为插件增加的贴内用户信息标记调用。插件开发人员在设计新的贴内用户信息标记前请务必仔细阅读《Discuz! 技术文档》中的内容。', + 3 => 'setting_styles_threadprofile_name', + 4 => '名称', + ), + ), + 235 => + array ( + 'index' => + array ( + '性能优化' => 'action=setting&operation=seo', + '搜索引擎优化' => 'action=setting&operation=seo', + ), + 'text' => + array ( + 0 => '性能优化 » 搜索引擎优化', + 1 => 'setting_tips', + 2 => '以红色虚线标示的选项,表示该选项和系统效率、负载能力与资源消耗有关(提高效率、或降低效率),建议依据自身服务器情况进行调整。', + 3 => 'setting_seo_rewritecompatible', + 4 => 'Rewrite 兼容性', + 5 => '如果您的服务器不支持 Rewrite 规则中的中文字符,请选择“是”。对于没有此问题的服务器,可以选择“否”', + 6 => 'setting_seo_rewriteguest', + 7 => '仅对游客有效', + 8 => '开启此项,则 Rewrite 功能只对游客和搜索引擎有效,可减轻服务器负担', + 9 => 'setting_seo_rewritemobile', + 10 => '触屏版模式 Rewrite', + 11 => '开启此项,则 Rewrite 功能将同时对触屏版有效,可能会影响极少数手机正常工作', + 12 => 'setting_seo_seohead', + 13 => '其他头部信息', + 14 => '如需在 <head></head> 中添加其他的 HTML 代码,可以使用本设置,否则请留空', + ), + ), + 236 => + array ( + 'index' => + array ( + '性能优化' => 'action=setting&operation=seo', + '论坛页面缓存设置' => 'action=setting&operation=cachethread', + ), + 'text' => + array ( + 0 => '性能优化 » 论坛页面缓存设置', + 1 => 'setting_cachethread', + 2 => '论坛页面缓存设置', + 3 => '开启后,缓存页面内容到静态文件,游客访问时速度将大大提升,建议独立服务器使用,虚拟空间请根据实际情况调节缓存的有效期', + 4 => 'setting_cachethread_indexlife', + 5 => '缓存论坛首页有效期', + 6 => '设置论坛首页缓存更新的时间,单位为秒,0 为关闭(此处关闭以后,缓存系数将不再起作用),建议设置为 900。此功能只针对游客', + 7 => 'setting_cachethread_life', + 8 => '缓存文章有效期', + 9 => '设置文章页面缓存更新的时间,单位为秒,0 为关闭。请根据实际情况进行调整,建议设置为 900。另外,请通过编辑论坛来指定文章页面缓存系数', + 10 => 'setting_cachethread_dir', + 11 => '缓存目录', + 12 => '默认为 data/threadcache 目录,如果您需要将其指定为其他目录,请确定您指定的目录有可写权限', + 13 => 'setting_cachethread_coefficient_set', + 14 => '缓存系数批量设置', + 15 => 'setting_cachethread_coefficient', + 16 => '缓存系数', + 17 => '页面缓存功能可以将会员经常访问的主题临时缓存起来,缓解大型论坛服务器压力。缓存阈值范围 0 - 100,建议设置为 40 ,0 为关闭。在磁盘空间允许的情况下,适当调高缓存系数,可以提高缓存效果', + 18 => 'setting_cachethread_coefficient_forum', + 19 => '请选择要设置的论坛', + 20 => '将会覆盖以前的缓存系数值,可以按住 CTRL 多选', + ), + ), + 237 => + array ( + 'index' => + array ( + '性能优化' => 'action=setting&operation=seo', + '服务器优化' => 'action=setting&operation=serveropti', + ), + 'text' => + array ( + 0 => '性能优化 » 服务器优化', + 1 => 'setting_tips', + 2 => '以红色虚线标示的选项,表示该选项和系统效率、负载能力与资源消耗有关(提高效率、或降低效率),建议依据自身服务器情况进行调整。', + 3 => 'setting_serveropti', + 4 => '服务器优化', + 5 => 'setting_serveropti_optimize_thread_view', + 6 => '是否优化更新主题浏览量', + 7 => 'setting_serveropti_preventrefresh', + 8 => '查看数开启防刷新', + 9 => '选择“否”,主题、空间、日志每访问一次,浏览量增1,会增大服务器压力,建议选择“是”', + 10 => 'setting_serveropti_delayviewcount', + 11 => '附件下载量延迟更新', + 12 => '延迟更新附件的浏览量,可明显降低访问量很大的站点的服务器负担,建议开启本功能', + 13 => 'setting_serveropti_nocacheheaders', + 14 => '禁止浏览器缓冲', + 15 => '禁止浏览器对站点页面进行缓冲,可用于解决极个别浏览器内容刷新不正常的问题。注意: 本功能会加重服务器负担', + 16 => 'setting_serveropti_maxonlines', + 17 => '最大在线人数', + 18 => '请设置合理的数值,范围 10~65535,建议设置为平均在线人数的 10 倍左右', + 19 => 'setting_serveropti_onlinehold', + 20 => '在线保持时间(分钟)', + 21 => '请根据访问情况设置合理的数值,访问量大的站点应当调小该数值,设置范围 5 - 60,过大或者过小的设置都有可能会增大服务器资源开销', + 22 => 'setting_serveropti_jspath', + 23 => 'JS 文件 URL', + 24 => '设置站点 JS 文件的 URL。当设置为缓存目录时,系统会将系统目录中的 *.js 文件进行压缩然后保存到缓存目录以提高读取速度和用户访问速度', + 25 => 'setting_serveropti_csspath', + 26 => 'CSS 文件 URL', + 27 => '设置站点 CSS 文件缓存的 URL。更改此设置后您需要更新模板缓存', + 28 => 'setting_serveropti_lazyload', + 29 => '开启图片延时加载', + 30 => '当开启后,页面中的图片在浏览器的当前窗口时再加载,可明显降低访问量很大的站点的服务器负担,建议开启本功能', + 31 => 'setting_serveropti_blockmaxaggregationitem', + 32 => '参与模块聚合数据条数', + 33 => '此值影响模块聚合时MYSQL检索数据的条数,设置太大将严重影响MYSQL的性能,设置太小将会影响模块聚合结果数据的理想程度。0为关闭此功能', + 34 => 'setting_serveropti_blockcachetimerange', + 35 => '模块更新时间区间', + 36 => '设置全部模块在指定的时间区间内更新。可以根据网站的访问情况,避开访问高峰时间段。如:3点-7点', + 37 => 'setting_serveropti_sessionclose', + 38 => '是否关闭session机制', + 39 => '关闭session机制以后,可明显降低站点的服务器负担,建议在线用户数超过2万时开启本功能(注意:游客数和用户的在线时长将不再进行统计,论坛首页和版块列表页面的在线用户列表功能将不可用)', + 40 => 'setting_serveropti_onlineguestsmultiple', + 41 => '在线人数测算比例', + 42 => '关闭session机制以后,总在线人(包括游客和用户) ≈ 实际在线用户数 * 在线人数测算比例,建议值为10左右,可为浮点数(注意:实际在线用户数缓存周期为600秒)', + 43 => 'setting_serveropti_jspath_default', + 44 => '系统目录 static/js/', + 45 => 'setting_serveropti_jspath_cache', + 46 => '缓存目录', + 47 => 'setting_serveropti_jspath_custom', + 48 => '自定义 URL', + 49 => 'setting_serveropti_csspath_cache', + 50 => '缓存目录', + 51 => 'setting_serveropti_csspath_custom', + 52 => '自定义 URL', + 53 => 'setting_serveropti_blockcachetimerangepoint', + 54 => '点', + ), + ), + 238 => + array ( + 'index' => + array ( + '编辑器设置' => 'action=setting&operation=editor', + '全局' => 'action=setting&operation=editor', + ), + 'text' => + array ( + 0 => '编辑器设置 » 全局', + 1 => 'setting_editor_mode_default', + 2 => '默认的编辑器模式', + 3 => 'setting_editor_swtich_enable', + 4 => '是否允许切换编辑器模式', + 5 => '选择否将禁止用户在纯文本模式和所见即所得模式之间切换', + 6 => 'setting_editor_simplemode', + 7 => '编辑栏样式', + 8 => '设置默认的编辑栏样式', + 9 => 'setting_editor_smthumb', + 10 => '表情图片的宽高', + 11 => '允许范围在 20~40 之间,图片实际尺寸超出设置值时将自动缩略显示', + 12 => 'setting_editor_smcols', + 13 => '表情列数', + 14 => '发帖页面表情显示的列数,允许范围在 8~12之间', + 15 => 'setting_editor_smrows', + 16 => '表情行数', + 17 => '发帖页面表情显示的行数', + 18 => 'setting_editor_mode_discuzcode', + 19 => '纯文本模式', + 20 => 'setting_editor_mode_wysiwyg', + 21 => '所见即所得模式', + 22 => 'setting_editor_simplemode_1', + 23 => '高级', + 24 => 'setting_editor_simplemode_0', + 25 => '常用', + ), + ), + 239 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '功能模块' => 'action=setting&operation=functions&anchor=curscript', + ), + 'text' => + array ( + 0 => '站点功能 » 功能模块', + 1 => 'setting_functions_curscript_forum', + 2 => '论坛', + 3 => 'setting_functions_curscript_forum_intro', + 4 => '通过论坛,网站可以给用户提供在线讨论、交流、互动的平台', + 5 => 'setting_functions_curscript_close', + 6 => '关闭', + 7 => 'setting_functions_curscript_open', + 8 => '开启', + 9 => 'setting_functions_curscript_portal', + 10 => '门户', + 11 => 'setting_functions_curscript_portal_intro', + 12 => '通过门户,网站可以将最热门的文章、文章、活动等信息展现给用户', + 13 => 'setting_functions_curscript_group', + 14 => '圈子', + 15 => 'setting_functions_curscript_group_intro', + 16 => '志同道合者的聚集地,更加专业更加隐秘的交流乐园', + 17 => 'setting_functions_curscript_follow', + 18 => '广播', + 19 => 'setting_functions_curscript_follow_intro', + 20 => '收听感兴趣的人,分享有趣的事儿,信息快速传播的利器', + 21 => 'setting_functions_curscript_collection', + 22 => '淘帖', + 23 => 'setting_functions_curscript_collection_intro', + 24 => '网站优质内容的收集与分类,网站内容运营必不可少的好帮手', + 25 => 'setting_functions_curscript_guide', + 26 => '导读', + 27 => 'setting_functions_curscript_guide_intro', + 28 => '自动聚合网站最具争议、最热门、最精华、最新发布等“最”主题', + 29 => 'setting_functions_curscript_feed', + 30 => '动态', + 31 => 'setting_functions_curscript_feed_intro', + 32 => '了解网站关注好友网站动向的直接渠道,让用户不再感觉孤独', + 33 => 'setting_functions_curscript_blog', + 34 => '日志', + 35 => 'setting_functions_curscript_blog_intro', + 36 => '记录每日见闻,分享人生感悟,用户感情宣泄的家园', + 37 => 'setting_functions_curscript_friend', + 38 => '好友', + 39 => 'setting_functions_curscript_friend_intro', + 40 => '结交感兴趣的人,了解感兴趣的事儿,情感快速蔓延的渠道', + 41 => 'setting_functions_curscript_album', + 42 => '相册', + 43 => 'setting_functions_curscript_album_intro', + 44 => '自己的美丽容颜,祖国的大好河山,各种美图的影像档案', + 45 => 'setting_functions_curscript_share', + 46 => '分享', + 47 => 'setting_functions_curscript_share_intro', + 48 => '将网站精华内容推荐给其他网友,形成良好的共享氛围', + 49 => 'setting_functions_curscript_doing', + 50 => '记录', + 51 => 'setting_functions_curscript_doing_intro', + 52 => '分享灵感,表达心情,记录随时想到的人和事儿', + 53 => 'setting_functions_curscript_message', + 54 => '留言板', + 55 => 'setting_functions_curscript_message_intro', + 56 => '通过留言,可以让其他用户不会错过你的互动', + 57 => 'setting_functions_curscript_ranklist', + 58 => '排行榜', + 59 => 'setting_functions_curscript_ranklist_intro', + 60 => '通过排行榜,可以查看本站的相关排行内容', + 61 => 'setting_functions_curscript_task', + 62 => '任务', + 63 => 'setting_functions_curscript_task_intro', + 64 => '缩短用户适应时间,让用户快速融入站点', + 65 => 'setting_functions_curscript_medal', + 66 => '勋章', + 67 => 'setting_functions_curscript_medal_intro', + 68 => '彰显用户在某一方面的特殊贡献,调动用户积极性', + 69 => 'setting_functions_curscript_magic', + 70 => '道具', + 71 => 'setting_functions_curscript_magic_intro', + 72 => '提供丰富多彩的娱乐功能,提升站点交互性和活跃度', + 73 => 'setting_functions_curscript_favorite', + 74 => '收藏', + 75 => 'setting_functions_curscript_favorite_intro', + 76 => '让用户记录喜爱的内容,增加用户留存和用户粘性', + ), + ), + 240 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '管理相关' => 'action=setting&operation=functions&anchor=mod', + ), + 'text' => + array ( + 0 => '站点功能 » 管理相关', + 1 => 'setting_tips', + 2 => '以红色虚线标示的选项,表示该选项和系统效率、负载能力与资源消耗有关(提高效率、或降低效率),建议依据自身服务器情况进行调整。', + 3 => 'setting_functions_mod_updatestat', + 4 => '开启站点趋势统计', + 5 => '站点趋势统计可以使站长了解到站点的运作状况。注意: 本功能会轻微加重系统负担', + 6 => 'setting_functions_mod_status', + 7 => '开启论坛管理工作统计', + 8 => '论坛管理工作统计可以使版主、管理员了解论坛版主等管理人员的工作状况。注意: 本功能会轻微加重系统负担', + 9 => 'setting_functions_archiver', + 10 => '开启论坛 Archiver 功能', + 11 => '论坛 Archiver 能够将论坛公开的内容模拟成静态页面,以便搜索引擎获取其中的内容', + 12 => 'setting_functions_archiverredirect', + 13 => '禁止用户访问 Archiver', + 14 => '选择“是”,当用户通过搜索引擎中的链接访问 Archiver 页时将自动跳转到原始内容页', + 15 => 'setting_functions_mod_maxmodworksmonths', + 16 => '管理记录保留时间(月)', + 17 => '系统中保留管理记录的时间,默认为 3 个月,建议在 3~6 个月的范围内取值', + 18 => 'setting_functions_mod_losslessdel', + 19 => '删帖不减积分时间期限(天)', + 20 => '设置版主或管理员从前台删除发表于多少天以前的文章时,不更新用户的扩展积分,可用于清理老文章而不对作者的扩展积分造成损失。0 为不使用此功能,始终更新用户积分', + 21 => 'setting_functions_mod_reasons', + 22 => '管理操作理由选项', + 23 => '本设定将在用户执行部分管理操作时显示,每个理由一行,如果空行则显示一行分隔符“--------”,用户可选择本设定中预置的理由选项或自行输入', + 24 => 'setting_functions_mod_reasons_public', + 25 => '是否公开管理操作理由', + 26 => '开启后点击主题帖下方主题操作记录将同时显示管理操作理由', + 27 => 'setting_functions_mod_user_public', + 28 => '是否公开管理操作人员', + 29 => '开启后主题管理操作人员显示为用户的用户名和 UID ,反之主题管理操作人员将只显示为 “管理团队” 而不显示具体信息,同时适用于系统提醒和操作记录', + 30 => 'setting_functions_user_reasons', + 31 => '用户评分理由选项', + 32 => '本设定将在用户执行评分时显示,每个理由一行,如果空行则显示一行分隔符“--------”,用户可选择本设定中预置的理由选项或自行输入', + 33 => 'setting_functions_mod_bannedmessages', + 34 => '隐藏敏感文章内容', + 35 => '选择相应项目将隐藏被删除或被禁止的用户的相关资料,在相关资料处显示被屏蔽的字样', + 36 => 'setting_functions_mod_warninglimit', + 37 => '用户被警告多少次自动禁言', + 38 => '警告有效期结束自动解除禁言', + 39 => 'setting_functions_mod_warningexpiration', + 40 => '警告有效期(天)', + 41 => '默认为 30 天', + 42 => 'setting_functions_mod_rewardexpiration', + 43 => '悬赏主题有效期', + 44 => '设置悬赏主题的有效天数,当悬赏主题超过有效期后依然未发放悬赏,版主或管理员有权代为主题作者发放悬赏。0 或留空表示不允许版主或管理员进行此操作', + 45 => 'setting_functions_mod_moddetail', + 46 => '版主面板显示审核数目', + 47 => '设置版主面板是否详细显示待审核主题、文章及用户的具体数目', + 48 => 'setting_functions_mod_bannedmessages_thread', + 49 => '文章内容', + 50 => 'setting_functions_mod_bannedmessages_avatar', + 51 => '用户头像', + 52 => 'setting_functions_mod_bannedmessages_signature', + 53 => '用户签名', + ), + ), + 241 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '主题热度' => 'action=setting&operation=functions&anchor=heatthread', + ), + 'text' => + array ( + 0 => '站点功能 » 主题热度', + 1 => 'setting_functions_heatthread_tips', + 2 => '主题热度将按参与人次计算,包括回帖,点评,收藏,分享,评分,推荐', + 3 => 'setting_functions_heatthread_period', + 4 => '用户热度值周期(天)', + 5 => '以天为单位,一个周期内某用户多次参与主题,只加一次热度。0代表不设置周期,只要参与一次,热度就加1。为避免用户刷热度,建议不要设置为0。(回复、点评、评论、收藏、分享等都算作参与主题的动作)', + 6 => 'setting_functions_heatthread_iconlevels', + 7 => '热门主题显示级别', + 8 => '设置主题列表页主题图标每一级别对应的热度指数,默认为 3 个级别,请用逗号分隔,如:“50,100,200”表示当主题的热度大于 50 时为 1 级,大于 100 时为 2 级,大于 200 时为 3 级。留空表示不显示图标', + ), + ), + 242 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '主题评价' => 'action=setting&operation=functions&anchor=recommend', + ), + 'text' => + array ( + 0 => '站点功能 » 主题评价', + 1 => 'setting_functions_recommend_tips', + 2 => '不同用户组会员的主题评价影响值不同,您可以在”用户组”设置的“文章相关”中设置。', + 3 => 'setting_functions_recommend_status', + 4 => '启用主题评价', + 5 => '主题评价是让用户参与主题热度的重要指标,您可以设定用户在每天允许执行的评价次数', + 6 => 'setting_functions_recommend_addtext', + 7 => '加分操作文字', + 8 => '设置评价加分的文字,不宜过长。建议使用“顶”、“支持”', + 9 => 'setting_functions_recommend_subtracttext', + 10 => '减分操作文字', + 11 => '设置评价减分的文字,不宜过长。建议使用“踩”、“反对”', + 12 => 'setting_functions_recommend_daycount', + 13 => '每 24 小时评价主题次数', + 14 => '设置用户每 24 小时可以评价多少篇主题,0 或留空为不限制', + 15 => 'setting_functions_recommend_ownthread', + 16 => '是否允许评价自己的文章', + 17 => '设置是否允许评价自己的主题。评价自己的主题无积分奖励', + 18 => 'setting_functions_recommend_iconlevels', + 19 => '评价图标显示级别', + 20 => '设置主题列表页评价图标每一级别对应的评价指数。建议为 3 个级别,请用逗号分隔,如:“0,100,200”表示当主题的评价指数大于 0 时为 1 级,大于 100 时为 2 级,大于 200 时为 3 级。1 级及以上级别的主题会在主题列表页“查看好评主题”中列出。留空或者 0 表示不显示图标', + ), + ), + 243 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '文章点评' => 'action=setting&operation=functions&anchor=comment', + ), + 'text' => + array ( + 0 => '站点功能 » 文章点评', + 1 => 'setting_functions_comment_allow', + 2 => '点评方式', + 3 => '设置点评的发表方式,如不选择表示不启用点评功能。开启任意一种点评方式都需要在用户组中设置点评权限“直接点评”即通过文章每楼层中的“点评”链接发表点评“楼层回复”即通过文章每楼层中的“回复”链接发表回帖时,自动对该楼层产生点评注意:点击主题中的“回复”链接,不会对主题产生点评', + 4 => 'setting_functions_comment_number', + 5 => '点评条目数', + 6 => '在文章中显示点评的条目数', + 7 => 'setting_functions_comment_postself', + 8 => '允许点评自己的文章', + 9 => '设置是否发帖作者能点评自己的文章', + 10 => 'setting_functions_comment_firstpost', + 11 => '允许点评楼主帖', + 12 => '设置是否允许直接点评楼主帖,关闭表示只能点评回帖', + 13 => 'setting_functions_comment_commentitem_0', + 14 => '普通主题点评预置观点', + 15 => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 16 => 'setting_functions_comment_commentitem_1', + 17 => '投票主题点评预置观点', + 18 => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 19 => 'setting_functions_comment_commentitem_2', + 20 => '商品主题点评预置观点', + 21 => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 22 => 'setting_functions_comment_commentitem_3', + 23 => '悬赏主题点评预置观点', + 24 => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 25 => 'setting_functions_comment_commentitem_4', + 26 => '活动主题点评预置观点', + 27 => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 28 => 'setting_functions_comment_commentitem_5', + 29 => '辩论主题点评预置观点', + 30 => '每个观点一行。如存在空行,空行下方的内容将显示在下拉菜单中作为备选观点', + 31 => 'setting_functions_comment_allow_1', + 32 => '直接点评', + 33 => 'setting_functions_comment_allow_2', + 34 => '楼层回复', + ), + ), + 244 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '文章阅读' => 'action=setting&operation=functions&anchor=threadexp', + ), + 'text' => + array ( + 0 => '站点功能 » 文章阅读', + 1 => 'setting_functions_threadexp_repliesrank', + 2 => '启用回帖投票', + 3 => '开启后,用户可对回帖进行“支持”、“反对”操作。', + 4 => 'setting_functions_threadexp_blacklist', + 5 => '启用用户黑名单隐藏', + 6 => '开启后,用户可以通过将其他用户加入黑名单的方法,隐藏指定用户的文章。', + 7 => 'setting_functions_threadexp_hotreplies', + 8 => '推荐回复数', + 9 => '系统根据回帖评价和水帖情况,在主题第一页推荐回帖,0 为不显示。', + 10 => 'setting_functions_threadexp_filter', + 11 => '水帖字数', + 12 => '系统判断水帖的条件,小于此数值的文章会被判断为水帖,0 为不过滤水帖。', + 13 => 'setting_functions_threadexp_nofilteredpost', + 14 => '推荐回复时推荐非水帖', + 15 => '启用后会在第一页推荐回复处推荐相应一定的非水帖。', + 16 => 'setting_functions_threadexp_hidefilteredpost', + 17 => '启用隐藏水帖', + 18 => '开启后系统判断为水帖的文章会被自动隐藏。', + 19 => 'setting_functions_threadexp_filterednovote', + 20 => '水帖不能参与回帖投票', + 21 => '开启后系统判断为水帖的文章将不能参与回帖投票。', + ), + ), + 245 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '其他' => 'action=setting&operation=functions&anchor=other', + ), + 'text' => + array ( + 0 => '站点功能 » 其他', + 1 => 'setting_tips', + 2 => '以红色虚线标示的选项,表示该选项和系统效率、负载能力与资源消耗有关(提高效率、或降低效率),建议依据自身服务器情况进行调整。', + 3 => 'setting_functions_other_uidlogin', + 4 => '启用UID登录', + 5 => '选择“是”,站点登录时允许通过 UID的方式登录验证', + 6 => 'setting_functions_other_secmobilelogin', + 7 => '启用安全手机号登录', + 8 => '选择“是”,站点登录时允许通过安全手机号或国际电话区号-安全手机号的方式登录验证', + 9 => 'setting_functions_other_autoidselect', + 10 => '启用登录自动选择账号', + 11 => '选择“是”,站点登录时的将自动按 UID、E-mail、用户名的顺序逐一去匹配,其中UID验证只有UID登录方式被启用后才有效', + 12 => 'setting_functions_other_submitlock', + 13 => '启用表单防并发功能', + 14 => '选择“是”,将会防止用户同一时间提交多次表单,可有效防止可能刷分的问题。注意: 在未使用内存缓存(Redis、Memcached)的情况下,本功能可能会加重服务器负担', + 15 => 'setting_functions_other_rssstatus', + 16 => '启用 RSS', + 17 => '选择“是”,将允许用户使用 RSS 客户端软件接收最新的文章、文章更新。注意: 在分类很多的情况下,本功能可能会加重服务器负担', + 18 => 'setting_functions_other_rssttl', + 19 => 'RSS TTL(分钟)', + 20 => 'TTL(Time to Live) 是 RSS 2.0 的一项属性,用于控制订阅内容的自动刷新时间,时间越短则资料实时性就越高,但会加重服务器负担,通常可设置为 30~180 范围内的数值', + 21 => 'setting_functions_other_oltimespan', + 22 => '用户在线时间更新时长(分钟)', + 23 => 'Discuz! 可统计每个用户总共和当月的在线时间,本设置用以设定更新用户在线时间的时间频率。例如设置为 10,则用户每在线 10 分钟更新一次记录。本设置值越小,则统计越精确,但消耗资源越大。建议设置为 5~30 范围内,0 为不记录用户在线时间', + 24 => 'setting_functions_other_debug', + 25 => '显示程序运行信息', + 26 => '选择“是”将在页脚处显示程序运行时间和数据库查询次数', + 27 => 'setting_functions_other_onlyacceptfriendpm', + 28 => '全站是否默认只接受好友短消息', + 29 => '选择“是”将在个人短消息设置中,默认只接收好友的短消息', + 30 => 'setting_functions_other_pmreportuser', + 31 => '接收短消息举报人(UID,多人使用英文逗号分隔)', + 32 => '根据接收的短消息举报提醒用户,可及时处理发送垃圾短信的用户,留空表示不启用短消息举报功能', + 33 => 'setting_functions_other_at_anyone', + 34 => '发帖时可@任何人', + 35 => '选择否表示,只有被@人在用户的收听列表和好友中时才有效', + 36 => 'setting_functions_other_chatpmrefreshtime', + 37 => '群聊消息内容自动刷新间隔(秒)', + 38 => '用于群聊消息内容刷新, 间隔时间越短对服务器压力越大, 0为不刷新', + 39 => 'setting_functions_other_collectionteamworkernum', + 40 => '淘帖专辑允许共同维护的人数', + 41 => '每个淘帖专辑可以共同参与维护的人数。', + 42 => 'setting_functions_other_shortcut', + 43 => '提醒添加桌面快捷的积分下限', + 44 => '大于等于设置积分的用户将看到添加桌面快捷的顶部提醒,0或不填为关闭此功能', + 45 => 'setting_functions_other_closeforumorderby', + 46 => '关闭主题列表页排序功能', + 47 => '选择“是”用户将只能按默认排序查看,否则,用户自选排序将会增加系统压力。', + 48 => 'setting_functions_other_disableipnotice', + 49 => '关闭登录安全提醒', + 50 => '选择“是”将关闭用户登录地区异常安全提醒功能', + 51 => 'setting_functions_other_darkroom', + 52 => '开启小黑屋', + 53 => '选择“是”将开启小黑屋,用户可以在右下角导航中进入小黑屋,查看被禁言禁止访问用户', + 54 => 'setting_functions_other_global_sign', + 55 => '全局签名内容', + 56 => '该设置必须开启签名后有效,如果用户没有设置签名就显示该签名内容', + ), + ), + 246 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '导读设置' => 'action=setting&operation=functions&anchor=guide', + ), + 'text' => + array ( + 0 => '站点功能 » 导读设置', + 1 => 'setting_functions_heatthread_guidelimit', + 2 => '热度值聚合下限', + 3 => '导读功能中收集热门主题时的热度值下限,默认值“3”', + 4 => 'setting_functions_guide_hotdt', + 5 => '热帖聚合时间范围', + 6 => 'setting_functions_guide_digestdt', + 7 => '精华聚合时间范围', + 8 => '7_day', + 9 => '一周', + 10 => '14_day', + 11 => '两周', + 12 => '30_day', + 13 => '一个月', + 14 => '90_day', + 15 => '三个月', + ), + ), + 247 => + array ( + 'index' => + array ( + '站点功能' => 'action=setting&operation=functions', + '活动主题' => 'action=setting&operation=functions&anchor=activity', + ), + 'text' => + array ( + 0 => '站点功能 » 活动主题', + 1 => 'setting_functions_activity_type', + 2 => '内置类别', + 3 => '本设定将在用户发起活动时显示活动类别,每个类别一行', + 4 => 'setting_functions_activity_field', + 5 => '(点此新增资料项)活动发起者可选的必填资料项', + 6 => '用户发起活动时可选择的资料项', + 7 => 'setting_functions_activity_extnum', + 8 => '扩展资料项数量', + 9 => '用户发起活动时自定义资料项数量,0为不允许自定义资料项', + 10 => 'setting_functions_activity_credit', + 11 => '使用积分', + 12 => '参与消耗积分的活动时使用的积分', + 13 => 'setting_functions_activity_pp', + 14 => '列表用户数', + 15 => '用户列表每页显示参与活动的人数', + 16 => 'none', + 17 => '无', + ), + ), + 248 => + array ( + 'index' => + array ( + '用户权限' => 'action=setting&operation=permissions', + ), + 'text' => + array ( + 0 => '用户权限', + 1 => 'setting_permissions_allowviewuserthread', + 2 => '允许查看用户的主题和文章', + 3 => '设置是否允许查看其他用户的主题和文章,选择相应的版块那么在个人空间将出现“主题”模块和链接', + 4 => 'setting_permissions_allowviewuserthread_fids', + 5 => '允许查看哪些版块的文章', + 6 => '设置允许查看其他用户哪些版块的主题和文章,可以按住 CTRL 多选', + 7 => 'setting_permissions_allowmoderatingthread', + 8 => '是否提示用户自己有未审核的主题或者文章', + 9 => '选择“是”,用户如果有正在审核的主题,将可以在文章列表页看到提示', + 10 => 'setting_permissions_memliststatus', + 11 => '允许查看会员列表', + 12 => 'setting_permissions_minsubjectsize', + 13 => '标题最小字数', + 14 => '论坛、门户、日志均受限制,管理组成员可通过“发帖不受限制”设置而在论坛模块不受影响,0 为不限制', + 15 => 'setting_permissions_maxsubjectsize', + 16 => '标题最大字数', + 17 => '论坛、门户、日志均受限制,管理组成员可通过“发帖不受限制”设置而在论坛模块不受影响, 80 为默认值, 255 为最大值', + 18 => 'setting_permissions_minpostsize', + 19 => '文章最小字数(字节)', + 20 => '管理组成员可通过“发帖不受限制”设置而不受影响,0 为不限制', + 21 => 'setting_permissions_minpostsize_mobile', + 22 => '手机客户端发帖最小字数(字节)', + 23 => '是否单独为手机客户端设置发帖的最小字节数,0 为不单独设置', + 24 => 'setting_permissions_maxpostsize', + 25 => '文章最大字数(字节)', + 26 => '管理组成员可通过“发帖不受限制”设置而不受影响', + 27 => 'setting_permissions_alloweditpost', + 28 => '允许用户随时编辑的文章类型', + 29 => '被选中的文章类型将不受用户组中的“编辑文章时间”限制,任何时刻都可以编辑', + 30 => 'setting_permissions_post_append', + 31 => '启用文章补充功能', + 32 => '启用后,当用户无法编辑自己的文章时,可以补充内容', + 33 => 'setting_permissions_mailinterval', + 34 => '邮件发送时间间隔', + 35 => '设定邮件发送时间间隔,默认为 300 秒', + 36 => 'setting_permissions_maxpolloptions', + 37 => '投票最大选项数:', + 38 => '设定发布投票包含的最大选项数', + 39 => 'setting_permissions_editby', + 40 => '编辑文章附加编辑记录', + 41 => '在 60 秒后编辑文章添加“本帖由 xxx 于 xxxx-xx-xx 编辑”字样。管理员编辑不受此限制', + 42 => 'setting_permissions_profilehistory', + 43 => '启用个人信息历史记录功能', + 44 => '启用后,个人信息历史记录将被保存,可以在后台下载。历史邮箱、安全手机号数据不受此功能限制', + 45 => 'setting_permissions_nsprofiles', + 46 => '个人空间内不展现个人信息', + 47 => '启用后个人空间内将不展现个人信息', + 48 => 'setting_permissions_modasban', + 49 => '不忽略审核关键词', + 50 => '启用后在不支持审核关键词的模块内发现此类关键词将拒绝提交,关闭则允许提交', + 51 => 'nav_setting_rate', + 52 => '评分', + 53 => 'setting_permissions_karmaratelimit', + 54 => '评分时间限制(小时)', + 55 => '文章发表后超过此时间限制其他用户将不能对此帖评分,版主和管理员不受此限制,0 为不限制', + 56 => 'setting_permissions_modratelimit', + 57 => '版主评分限制', + 58 => '设置版主只能在自身所管辖的版块范围内对文章进行评分。本限制只对版主有效,允许评分的普通用户及超级版主、管理员不受此限制,因此如果赋予这些用户评分权限,他们仍将可以在全版块范围内进行评分', + 59 => 'setting_permissions_dupkarmarate', + 60 => '允许重复评分', + 61 => '选择“是”将允许用户对一个文章进行多次评分,默认为“否”', + 62 => 'setting_permissions_editperdel', + 63 => '允许用户编辑文章时删除文章', + 64 => '选择“是”将允许用户编辑文章时删除文章,默认为“否”', + 65 => 'setting_permissions_hideexpiration', + 66 => '文章中[hide]标签最大有效天数', + 67 => '距发帖日期天数超过此设置时标签自动失效,0或不填为不限制', + ), + ), + 249 => + array ( + 'index' => + array ( + '积分设置' => 'action=setting&operation=credits', + '基本设置' => 'action=setting&operation=credits&anchor=base', + ), + 'text' => + array ( + 0 => '积分设置 » 基本设置', + 1 => 'setting_credits_extended', + 2 => '扩展积分设置', + 3 => '兑换比率为单项积分对应一个单位标准积分的值,例如 extcredits1 的比率为 1.5(相当于 1.5 个单位标准积分)、extcredits2 的比率为 3(相当于 3 个单位标准积分)、extcredits3 的比率为 15(相当于 15 个单位标准积分),则 extcredits3 的 1 分相当于 extcredits2 的 5 分或 extcredits1 的 10 分。一旦设置兑换比率,则用户将可以在个人中心自行兑换各项设置了兑换比率的积分,如不希望实行积分自由兑换,请将其兑换比率设置为 0', + 4 => 'setting_credits', + 5 => '积分设置', + 6 => 'setting_credits_trans', + 7 => '交易积分设置', + 8 => '交易积分是一种可以由用户间自行转让、买卖交易、发布悬赏主题的积分类型,您可以指定一种积分作为交易积分。如果不指定交易积分,则用户间积分交易功能将不能使用。注意: 交易积分必须是已启用的积分,一旦确定请尽量不要更改,否则以往记录及交易可能会产生问题', + 9 => 'setting_credits_trans9', + 10 => '积分转账使用的积分', + 11 => '设置积分转账时使用的积分', + 12 => 'setting_credits_trans1', + 13 => '主题(附件)买卖使用的积分', + 14 => '主题(附件)买卖使用的积分', + 15 => 'setting_credits_trans2', + 16 => '悬赏使用的积分', + 17 => '设置悬赏使用的积分', + 18 => 'setting_credits_trans3', + 19 => '道具、勋章使用的积分', + 20 => '设置道具、勋章中使用的积分', + 21 => 'setting_credits_trans5', + 22 => '商品主题使用的积分', + 23 => '设置商品主题使用的积分', + 24 => 'setting_credits_trans6', + 25 => '空间消费使用的积分', + 26 => '设置在空间中消费使用的积分类型', + 27 => 'setting_credits_trans10', + 28 => '回帖奖励使用的积分', + 29 => '当用户发帖时可以设置的回帖奖励所使用的积分', + 30 => 'setting_credits_trans8', + 31 => '用户举报奖惩使用的积分', + 32 => '设置用户举报后对用户奖惩时使用的积分', + 33 => 'setting_credits_trans11', + 34 => '抢楼帖积分限制', + 35 => '参与抢楼帖积分限制时使用的积分', + 36 => 'setting_credits_trans12', + 37 => '创建圈子消耗积分', + 38 => '创建圈子时要消耗的积分', + 39 => 'setting_credits_tax', + 40 => '积分交易税', + 41 => '积分交易税(损失率)为用户在利用积分进行转让、兑换、买卖时扣除的税率,范围为 0~1 之间的浮点数,例如设置为 0.2,则用户在转换 100 个单位积分时,损失掉的积分为 20 个单位,0 为不损失', + 42 => 'setting_credits_mintransfer', + 43 => '转账最低余额', + 44 => '积分转账后要求用户所拥有的余额最小数值。利用此功能,您可以设置较大的余额限制,使积分小于这个数值的用户无法转账;也可以将余额限制设置为负数,使得转账在限额内可以透支', + 45 => 'setting_credits_minexchange', + 46 => '兑换最低余额', + 47 => '积分兑换后要求用户所拥有的余额最小数值。利用此功能,您可以设置较大的余额限制,使积分小于这个数值的用户无法兑换;也可以将余额限制设置为负数,使得兑换在限额内可以透支', + 48 => 'setting_credits_maxincperthread', + 49 => '单主题(附件)最高收入', + 50 => '设置单一主题(附件)出售作者所得的最高税后积分收入,超过此限制后购买者将仍然被扣除相应积分,但主题(附件)作者收益将不再上涨。本限制只在主题(附件)买卖时起作用,0 为不限制', + 51 => 'setting_credits_maxchargespan', + 52 => '单主题(附件)最高出售时限(小时)', + 53 => '设置当主题(附件)被作者出售时,系统允许自主题(附件)发布时间起,其可出售的最长时间。超过此时间限制后将变为普通主题(附件),阅读者无需支付积分购买,作者也将不再获得相应收益,以小时为单位,0 为不限制', + 54 => 'setting_credits_extended_comment', + 55 => '兑换比率为单项积分对应一个单位标准积分的值,例如 extcredits1 的比率为 1.5(相当于 1.5 个单位标准积分)、extcredits2 的比率为 3(相当于 3 个单位标准积分)、extcredits3 的比率为 15(相当于 15 个单位标准积分),则 extcredits3 的 1 分相当于 extcredits2 的 5 分或 extcredits1 的 10 分。一旦设置兑换比率,则用户将可以在个人中心自行兑换各项设置了兑换比率的积分,如不希望实行积分自由兑换,请将其兑换比率设置为 0', + 56 => 'setting_credits_formula_digestposts', + 57 => '精华帖数', + 58 => 'setting_credits_formula_posts', + 59 => '发帖数', + 60 => 'setting_credits_formula_threads', + 61 => '主题数', + 62 => 'setting_credits_formula_oltime', + 63 => '在线时间(小时)', + 64 => 'setting_credits_formula_friends', + 65 => '好友数', + 66 => 'setting_credits_formula_doings', + 67 => '记录数', + 68 => 'setting_credits_formula_blogs', + 69 => '日志数', + 70 => 'setting_credits_formula_albums', + 71 => '相册数', + 72 => 'setting_credits_formula_sharings', + 73 => '分享数', + 74 => 'setting_credits_formula', + 75 => '总积分计算公式', + 76 => '总积分是衡量用户级别的唯一标准,您可以在此设定用户的总积分计算公式,其中 posts 代表发帖数 (主题 + 回复数);threads 代表用户发表的主题数;digestposts 代表精华帖数;oltime 代表用户总在线时间(小时);friends 代表好友数;doings 代表发表的记录数;blogs 代表发表的日志数;albums 代表上传的相册数;sharings 代表发表的分享数;extcredits1~extcredits8 分别代表上述 8 个自定义积分。公式中可使用包括 + - * / () 在内的运算符号', + 77 => 'setting_credits_formula_comment', + 78 => '总积分是衡量用户级别的唯一标准,您可以在此设定用户的总积分计算公式,其中 posts 代表发帖数 (主题 + 回复数);threads 代表用户发表的主题数;digestposts 代表精华帖数;oltime 代表用户总在线时间(小时);friends 代表好友数;doings 代表发表的记录数;blogs 代表发表的日志数;albums 代表上传的相册数;sharings 代表发表的分享数;extcredits1~extcredits8 分别代表上述 8 个自定义积分。公式中可使用包括 + - * / () 在内的运算符号', + 79 => 'setting_credits_trans_used', + 80 => '使用交易积分', + 81 => 'setting_credits_trans_credits', + 82 => '使用总积分', + 83 => 'none', + 84 => '无', + ), + ), + 250 => + array ( + 'index' => + array ( + '邮件设置' => 'action=setting&operation=mail', + '设置' => 'action=setting&operation=mail&anchor=setting', + ), + 'text' => + array ( + 0 => '邮件设置 » 设置', + 1 => 'setting_mail_setting_send', + 2 => '邮件发送方式', + 3 => '如需使用 SSL 加密的 SMTP 发送,请在服务器地址前添加 ssl:// 并调整端口号。', + 4 => 'setting_mail_setting_plugin', + 5 => '插件标识及脚本标识', + 6 => '填写插件的标识符和脚本名称的后半段,用英文冒号隔开', + 7 => 'setting_mail_setting_delimiter', + 8 => '邮件头的分隔符(仅针对PHP sendmail方式有效)', + 9 => '请根据您邮件服务器的设置调整此参数', + 10 => 'setting_mail_setting_includeuser', + 11 => '收件人地址中包含用户名', + 12 => '选择“是”将在收件人的邮件地址中包含站点用户名', + 13 => 'setting_mail_setting_silent', + 14 => '屏蔽邮件发送中的全部错误提示', + 15 => 'setting_mail_setting_send_1', + 16 => '通过 PHP 函数的 sendmail 发送(推荐此方式)', + 17 => 'setting_mail_setting_send_2', + 18 => '通过 SOCKET 连接 SMTP 服务器发送(支持 ESMTP 验证)', + 19 => 'setting_mail_setting_send_3', + 20 => '通过 PHP 函数 SMTP 发送 Email(仅 Windows 主机下有效,不支持 ESMTP 验证)', + 21 => 'setting_mail_setting_send_4', + 22 => '通过插件发送(插件控制发送流程)', + 23 => 'delete', + 24 => '删除', + 25 => 'setting_mail_setting_server', + 26 => 'SMTP 服务器', + 27 => 'setting_mail_setting_port', + 28 => '端口', + 29 => 'setting_mail_setting_timeout', + 30 => '超时(秒)', + 31 => 'setting_mail_setting_edit_addnew', + 32 => '添加新SMTP服务器', + 33 => 'setting_mail_setting_validate', + 34 => '验证', + 35 => 'setting_mail_setting_from', + 36 => '发信人邮件地址', + 37 => 'setting_mail_setting_username', + 38 => 'SMTP 身份验证用户名', + 39 => 'setting_mail_setting_password', + 40 => 'SMTP 身份验证密码', + 41 => 'setting_mail_setting_precedence', + 42 => '优先发送邮件后缀(多个以,分隔)', + 43 => 'setting_mail_setting_delimiter_crlf', + 44 => '使用 CRLF 作为分隔符(通常为 Windows 主机)', + 45 => 'setting_mail_setting_delimiter_lf', + 46 => '使用 LF 作为分隔符(通常为 Unix/Linux 主机)', + 47 => 'setting_mail_setting_delimiter_cr', + 48 => '使用 CR 作为分隔符(通常为 Mac 主机)', + ), + ), + 251 => + array ( + 'index' => + array ( + '邮件设置' => 'action=setting&operation=mail', + '检测' => 'action=setting&operation=mail&anchor=check', + ), + 'text' => + array ( + 0 => '邮件设置 » 检测', + 1 => 'setting_mail_check_test_from', + 2 => '测试发件人', + 3 => 'setting_mail_check_test_to', + 4 => '测试收件人', + 5 => '如果要测试包含用户名的邮件地址,格式为“username <user@domain.com>” 。多个邮件地址用逗号分隔', + ), + ), + 252 => + array ( + 'index' => + array ( + '账号保镖' => 'action=setting&operation=sec', + '注册表单名称设置' => 'action=setting&operation=sec&anchor=accountguard', + ), + 'text' => + array ( + 0 => '账号保镖 » 注册表单名称设置', + 1 => 'setting_sec_accountguard_postqqonly', + 2 => '发帖需要绑定QQ号', + 3 => '开启后用户发帖必须先绑定QQ号', + 4 => 'setting_sec_accountguard_loginpwcheck', + 5 => '弱密码登录检测', + 6 => '当用户登录时使用的密码强度不符合“全局>注册与访问控制>注册>强制密码复杂度”设置时的操作。若启用强制修改,弱密码账号会被暂时冻结,修改密码成功后自动解除', + 7 => 'setting_sec_accountguard_loginoutofdate', + 8 => '异常登录检测', + 9 => '当用户距离上次登录超过一定期限时,账号会进入未审核组,用户可以通过验证邮箱或者申诉解冻账号,QQ登录的用户不受此功能影响 审核用户', + 10 => 'setting_sec_accountguard_loginoutofdatenum', + 11 => '异常登录检测天数', + 12 => '配置异常登录检测天数,默认值为 90 天', + 13 => 'setting_sec_accountguard_loginpwcheck_none', + 14 => '不开启', + 15 => 'setting_sec_accountguard_loginpwcheck_prompt', + 16 => '开启并提示', + 17 => 'setting_sec_accountguard_loginpwcheck_force', + 18 => '开启并强制修改弱密码', + ), + ), + 253 => + array ( + 'index' => + array ( + '验证设置' => 'action=setting&operation=sec', + '验证码设置' => 'action=setting&operation=sec&anchor=seccode', + ), + 'text' => + array ( + 0 => '验证设置 » 验证码设置', + 1 => 'setting_sec_code_tips', + 2 => '使用图片作为验证码文字,图片必须包含字符“2346789BCEFGHJKMPQRTVWXY”24 个字符,且必须为 GIF 透明图片、背景透明、前景黑色,黑色为图片的第一个索引色。图片大小不限制,但建议宽度不大于验证码宽度的 1/4,高度不大于验证码高度。制作完毕后在 static/image/seccode/gif/ 下创建一个新的子目录,目录名任意,把制作完毕的 24 个 GIF 图片上传到新子目录下使用图片作为验证码的背景,把制作好的 JPG 图片上传到 static/image/seccode/background/ 目录下,站点将随机使用里面的图片作为验证码的背景使用 TTF 字体作为验证码文字,把下载的 TTF 英文字体文件上传到 static/image/seccode/font/en/ 目录下,站点将随机使用里面的字体文件作为验证码的文字使用中文图片验证码前,需要把包含完整中文汉字的 TTF 中文字体文件上传到 static/image/seccode/font/ch/ 目录下,站点将随机使用里面的字体文件作为验证码的文字系统验证码位于 source/class/seccode/ 目录中,插件验证码位于 source/plugin/插件目录/seccode/ 目录中。', + 3 => 'setting_sec_seccode_rule_setting', + 4 => '规则设置', + 5 => 'setting_sec_seccode_rule_register', + 6 => '注册时启用验证码', + 7 => '设置注册时验证码的启用规则', + 8 => 'setting_sec_seccode_rule_register_numlimit', + 9 => '一段时间内注册上限', + 10 => '当网站注册用户在选择的时间段内超过设置值时,全天用户注册均需要通过验证码验证,0 代表不启用此规则', + 11 => 'setting_sec_seccode_rule_register_timelimit', + 12 => '时间段选择', + 13 => 'setting_sec_seccode_rule_login', + 14 => '登录时启用验证码', + 15 => '设置登录时验证码的启用规则', + 16 => 'setting_sec_seccode_rule_login_nolocal', + 17 => '异地登录时启用', + 18 => '当用户本地登录 IP 为异地登录时启用验证码', + 19 => 'setting_sec_seccode_rule_login_pwsimple', + 20 => '用户密码太简单时启用', + 21 => '当用户登录时使用的密码的长度与复杂度不符合后台设置时', + 22 => 'setting_sec_seccode_rule_login_pwerror', + 23 => '尝试密码错误 2 次后启用', + 24 => 'setting_sec_seccode_rule_login_outofday', + 25 => '长时间未登录后 (天)', + 26 => '当用户最近一次登录时间距离上次登录时间超过设置值时需要输入验证码,0 代表不启用此规则', + 27 => 'setting_sec_seccode_rule_login_numiptry', + 28 => '重复 IP 段尝试密码错误上限', + 29 => '当一个 IP 段在选择的时间段内错误次数超过设置时,该 IP 段再次登录需要输入验证码,0 代表不启用此规则', + 30 => 'setting_sec_seccode_rule_login_timeiptry', + 31 => '时间段选择', + 32 => 'setting_sec_seccode_rule_post', + 33 => '发表信息时启用验证码', + 34 => '设置发表信息时验证码的启用规则', + 35 => 'setting_sec_seccode_rule_post_numlimit', + 36 => '用户一段时间内发帖操作总次数上限', + 37 => '当用户在选择的时间段内发表主题,回复总数超过设置值时需要输入验证码,0 代表不启用此规则', + 38 => 'setting_sec_seccode_rule_post_timelimit', + 39 => '时间段选择', + 40 => 'setting_sec_seccode_rule_post_nplimit', + 41 => '提交主题时间太短后启用 (秒)', + 42 => '用户打开发帖页面到提交的最短时间,低于最短设置时间时需要输入验证码,0 代表不启用此规则', + 43 => 'setting_sec_seccode_rule_post_vplimit', + 44 => '提交回复时间太短后启用 (秒)', + 45 => '用户打开文章页面到提交回复的最短时间,低于最短设置时间时需要输入验证码,0 代表不启用此规则', + 46 => 'setting_sec_seccode_rule_password', + 47 => '修改密码时启用验证码', + 48 => '设置修改密码时是否启用验证码', + 49 => 'setting_sec_seccode_rule_card', + 50 => '充值卡密及短信验证时启用验证码', + 51 => '设置充值卡密及短信验证时是否启用验证码 (推荐开启)', + 52 => 'setting_sec_seccode_minposts', + 53 => '发帖数限制', + 54 => '发帖数超过此设置的会员将不受验证码功能限制,0 表示所有会员均受限制。仅针对发表信息及修改密码时有效', + 55 => 'setting_sec_seccode_type_setting', + 56 => '显示设置', + 57 => 'setting_sec_seccode_type', + 58 => '验证码类型', + 59 => '设置验证码的类型。中文图片验证码需要您的主机支持 FreeType 库。要显示 Flash 验证码,建议您的主机支持 Ming 库以提高安全性验证码预览', + 60 => 'setting_sec_seccode_width', + 61 => '验证码图片宽度', + 62 => '验证码图片的宽度,范围在 100~200 之间', + 63 => 'setting_sec_seccode_height', + 64 => '验证码图片高度', + 65 => '验证码图片的高度,范围在 30~80 之间', + 66 => 'setting_sec_seccode_scatter', + 67 => '图片打散', + 68 => '打散生成的验证码图片,输入打散的级别,0 为不打散', + 69 => 'setting_sec_seccode_background', + 70 => '随机图片背景', + 71 => '选择“是”将随机使用 static/image/seccode/background/ 目录下的 JPG 图片作为验证码的背景图片,选择“否”将使用随机的背景色', + 72 => 'setting_sec_seccode_adulterate', + 73 => '随机背景图形', + 74 => '选择“是”将给验证码背景增加随机的图形', + 75 => 'setting_sec_seccode_ttf', + 76 => '随机 TTF 字体', + 77 => '选择“是”将随机使用 static/image/seccode/font/en/ 目录下的 TTF 字体文件生成验证码文字,选择“否”将随机使用 static/image/seccode/gif/ 目录中的 GIF 图片生成验证码文字。中文图片验证码将随机使用 static/image/seccode/font/ch/ 目录下的 TTF 字体文件,无需进行此设置', + 78 => 'setting_sec_seccode_angle', + 79 => '随机倾斜度', + 80 => '选择“是”将给验证码文字增加随机的倾斜度,本设置只针对 TTF 字体的验证码', + 81 => 'setting_sec_seccode_warping', + 82 => '随机扭曲', + 83 => '选择“是”将给验证码文字增加随机的扭曲,本设置只针对 TTF 字体的验证码', + 84 => 'setting_sec_seccode_color', + 85 => '随机颜色', + 86 => '选择“是”将给验证码的背景图形和文字增加随机的颜色', + 87 => 'setting_sec_seccode_size', + 88 => '随机大小', + 89 => '选择“是”验证码文字的大小随机显示', + 90 => 'setting_sec_seccode_shadow', + 91 => '文字阴影', + 92 => '选择“是”将给验证码文字增加阴影', + 93 => 'setting_sec_seccode_animator', + 94 => 'GIF 动画', + 95 => '选择“是”验证码将显示成 GIF 动画方式,选择“否”验证码将显示成静态图片方式', + ), + ), + 254 => + array ( + 'index' => + array ( + '验证设置' => 'action=setting&operation=sec', + '验证问答设置' => 'action=setting&operation=sec&anchor=secqaa', + ), + 'text' => + array ( + 0 => '验证设置 » 验证问答设置', + 1 => 'setting_sec_qaa_tips', + 2 => '验证问题应该言简意赅,没有歧义,正常人都能够正确作答。请经常更新验证问答的问题及答案以防止被猜测!系统验证问答位于 source/class/secqaa/ 目录中,插件验证问答位于 source/plugin/插件目录/secqaa/ 目录中。插件开发人员在设计新的验证问答脚本前请务必仔细阅读《Discuz! 技术文档》中的内容。', + 3 => 'setting_sec_secqaa', + 4 => '验证问答设置', + 5 => '建议您设置 10 个以上验证问题及答案,验证问题越多,验证问答防止恶意注册或发布信息的效果越明显。问题支持 HTML 代码,答案长度不超过 50 字节', + 6 => 'setting_sec_secqaa_status', + 7 => '启用验证问答', + 8 => '验证问答功能要求会员必须正确回答系统随机抽取的问题才能继续操作,可以避免恶意注册或发布信息,请选择需要打开验证问答的操作。注意: 启用该功能会使得部分操作变得繁琐,建议仅在必需时打开', + 9 => 'setting_sec_secqaa_minposts', + 10 => '发帖数限制', + 11 => '发帖数超过此设置的会员将不受验证问答功能限制,0 表示所有会员均受限制。仅针对发表信息及修改密码时有效', + 12 => 'setting_sec_secqaa_qaa', + 13 => '验证问题及答案设置', + 14 => 'setting_sec_secqaa_add', + 15 => '添加新问题', + ), + ), + 255 => + array ( + 'index' => + array ( + '基本设置' => 'action=setting&operation=sec', + '用户设置' => 'action=setting&operation=sec&anchor=base', + ), + 'text' => + array ( + 0 => '基本设置 » 用户设置', + 1 => 'setting_sec_floodctrl', + 2 => '两次发表时间间隔(秒)', + 3 => '两次发帖间隔小于此时间,0 为不限制', + 4 => 'setting_sec_base_need_email', + 5 => '强制用户验证激活邮箱', + 6 => '选择是的话,用户必须验证激活自己的邮箱后,才可以进行发布操作。 ', + 7 => 'setting_sec_base_need_secmobile', + 8 => '强制用户认证安全手机', + 9 => '选择是的话,用户必须认证自己的安全手机后才能进行发布操作', + 10 => 'setting_sec_base_need_avatar', + 11 => '强制用户上传头像', + 12 => '选择是的话,用户必须设置自己的头像后才能进行发布操作', + 13 => 'setting_sec_base_change_email', + 14 => '禁止用户前台修改邮箱', + 15 => '选择是的话,用户不能通过前台自行修改账号绑定的邮箱', + 16 => 'setting_sec_base_change_secmobile', + 17 => '禁止用户前台修改安全手机', + 18 => '选择是的话,用户不能通过前台自行修改账号绑定的安全手机', + 19 => 'setting_sec_base_need_friendnum', + 20 => '强制用户好友个数', + 21 => '设置用户必须拥有多少个好友后,才可以进行发布操作', + ), + ), + 256 => + array ( + 'index' => + array ( + '基本设置' => 'action=setting&operation=sec', + '注册表单名称设置' => 'action=setting&operation=sec&anchor=reginput', + ), + 'text' => + array ( + 0 => '基本设置 » 注册表单名称设置', + 1 => 'setting_sec_reginput', + 2 => '注册表单名称设置', + 3 => 'setting_sec_reginput_username', + 4 => '用户名表单设置', + 5 => '默认为 username ,只能是字母和数字的组合,必须以字母开头。修改后的表单名会使得注册机更难发挥作用', + 6 => 'setting_sec_reginput_password', + 7 => '密码表单设置', + 8 => '默认为 password ,只能是字母和数字的组合,必须以字母开头。 修改后的表单名会使得注册机更难发挥作用', + 9 => 'setting_sec_reginput_password2', + 10 => '重复密码表单设置', + 11 => '默认为 password2 ,只能是字母和数字的组合,必须以字母开头。 修改后的表单名会使得注册机更难发挥作用', + 12 => 'setting_sec_reginput_email', + 13 => 'Email表单设置', + 14 => '默认为 email ,只能是字母和数字的组合,必须以字母开头。 修改后的表单名会使得注册机更难发挥作用', + ), + ), + 257 => + array ( + 'index' => + array ( + '基本设置' => 'action=setting&operation=sec', + '注册表单名称设置' => 'action=setting&operation=sec&anchor=postperiodtime', + ), + 'text' => + array ( + 0 => '基本设置 » 注册表单名称设置', + 1 => 'setting_sec_postperiodtime', + 2 => '发帖时间段限制', + 3 => 'setting_datetime_postbanperiods', + 4 => '禁止发帖时间段', + 5 => '每天该时间段内用户不能发帖,请使用 24 小时时段格式,每个时间段一行,如需要也可跨越零点,留空为不限制。例如:每日晚 11:25 到次日早 5:05 可设置为: 23:25-5:05每日早 9:00 到当日下午 2:30 可设置为: 9:00-14:30注意: 格式不正确将可能导致意想不到的问题,用户组中如开启“不受时间段限制”的选项,则该组可不被任何时间段设置约束。所有时间段设置均以站点系统默认时区为准,不受用户自定义时区的影响', + 6 => 'setting_datetime_postmodperiods', + 7 => '发帖审核时间段', + 8 => '每天该时间段内用户发帖不直接显示,需经版主或管理员人工审核才能发表,格式和用法同上', + 9 => 'setting_datetime_postignorearea', + 10 => '发帖不受时间限制的地区列表', + 11 => '当用户处于本列表中的地址时,发帖不受时间段限制。每个地区一行,例如 "北京"(不含引号),留空为不设置。注意:如要正确无误的判断您 IP 地址所在的地区,请到网上下载 qqwry.dat IP 地址库文件上传到 "data/ipdata/" 目录下更名为 wry.dat', + 12 => 'setting_datetime_postignoreip', + 13 => '发帖不受时间限制的IP列表', + 14 => '当用户处于本列表中的 IP 地址时,发帖不受时间段限制。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + ), + ), + 258 => + array ( + 'index' => + array ( + '时间设置' => 'action=setting&operation=datetime', + ), + 'text' => + array ( + 0 => '时间设置', + 1 => 'setting_datetime_format', + 2 => '日期和时间格式', + 3 => 'setting_datetime_dateformat', + 4 => '默认日期格式', + 5 => '使用 yyyy(yy) 表示年,mm 表示月,dd 表示天。如 yyyy-mm-dd 表示 2000-1-1', + 6 => 'setting_datetime_timeformat', + 7 => '默认时间格式', + 8 => 'setting_datetime_dateconvert', + 9 => '人性化时间格式', + 10 => '选择“是”,站点中的时间将显示以“n分钟前”、“昨天”、“n天前”等形式显示', + 11 => 'setting_datetime_timeoffset', + 12 => '默认时差', + 13 => '当地时间与 GMT 的时差。遇夏制时的情况也可以手动输入,如:-7.5', + 14 => 'setting_datetime_periods', + 15 => '时间段设置', + 16 => 'setting_datetime_visitbanperiods', + 17 => '禁止访问时间段', + 18 => '每天该时间段内用户不能访问站点,请使用 24 小时时段格式,每个时间段一行,如需要也可跨越零点,留空为不限制。例如:每日晚 11:25 到次日早 5:05 可设置为: 23:25-5:05每日早 9:00 到当日下午 2:30 可设置为: 9:00-14:30注意: 格式不正确将可能导致意想不到的问题,用户组中如开启“不受时间段限制”的选项,则该组可不被任何时间段设置约束。所有时间段设置均以站点系统默认时区为准,不受用户自定义时区的影响', + 19 => 'setting_datetime_ban_downtime', + 20 => '禁止下载附件时间段', + 21 => '每天该时间段内用户不能下载附件,格式和用法同上', + 22 => 'setting_datetime_searchbanperiods', + 23 => '禁止全文搜索时间段', + 24 => '每天该时间段内用户不能使用全文搜索,格式和用法同上', + 25 => 'hour', + 26 => '小时制', + ), + ), + 259 => + array ( + 'index' => + array ( + '上传设置' => 'action=setting&operation=attach', + '基本设置' => 'action=setting&operation=attach&anchor=basic', + ), + 'text' => + array ( + 0 => '上传设置 » 基本设置', + 1 => 'setting_attach_basic_dir', + 2 => '本地附件保存位置', + 3 => '服务器路径,属性 777,必须为 web 可访问到的目录,结尾不加 "/",相对目录务必以 "./" 开头', + 4 => 'setting_attach_basic_url', + 5 => '本地附件 URL 地址', + 6 => '可为当前 URL 下的相对地址或 http:// 开头的绝对地址,结尾不加 "/",不能把这个设为远程附件URL地址', + 7 => 'setting_attach_image_lib', + 8 => '图片处理库类型', + 9 => '请选择 Discuz! 用来处理缩略图和水印的图像处理库。GD 是最广泛的处理库但是使用的系统资源较多。ImageMagick 速度快系统资源占用少,但安全性相对较差,且需要服务器安装 ImageMagick 扩展。如果您的服务器有条件安装此程序,请到 http://www.imagemagick.org 下载', + 10 => 'setting_attach_image_gdlimit', + 11 => 'GD 图片像素点上限', + 12 => '设置 GD 图片像素点上限,数值越大需要的服务器内存也越多,超过默认值 16777216 的站点需要在 php.ini 中设置更大的 memory_limit 以适应此配置', + 13 => 'setting_attach_image_thumbquality', + 14 => '缩略图质量', + 15 => '设置图片附件缩略图的质量参数,范围为 0~100 的整数,数值越大结果图片效果越好,但尺寸也越大', + 16 => 'setting_attach_image_disabledmobile', + 17 => '是否生成手机版缩略图', + 18 => '设置是否为每个附件生成手机版的缩略图', + 19 => 'setting_attach_image_preview', + 20 => '预览', + 21 => '无需保存设置即可预览', + 22 => 'setting_attach_image_watermarktype_GD', + 23 => 'GD', + 24 => 'setting_attach_image_watermarktype_IM', + 25 => 'ImageMagick', + ), + ), + 260 => + array ( + 'index' => + array ( + '上传设置' => 'action=setting&operation=attach', + '论坛附件' => 'action=setting&operation=attach&anchor=forumattach', + ), + 'text' => + array ( + 0 => '上传设置 » 论坛附件', + 1 => 'setting_attach_basic_imgpost', + 2 => '文章中显示图片附件', + 3 => '在文章中直接将图片或动画附件显示出来,而不需要点击附件链接', + 4 => 'setting_attach_basic_allowattachurl', + 5 => '附件 URL 地址、媒体附件播放', + 6 => '开启附件 URL 地址后,上传附件的地址可通过 "attach://aid.ext" 方式在任何帖内引用(不支持附件收费以及阅读权限判定),并支持媒体类附件的直接播放,此项设置需要在 用户组 - 文章相关 中允许用户组使用多媒体代码,并保证 config_global.php 配置的本地文件读取模式为 1 或 4 方可生效', + 7 => 'setting_attach_image_thumbstatus', + 8 => '论坛文章附件缩略图设置', + 9 => '您可以设置自动为用户上传的 JPG/PNG/GIF 图片附件添加缩略图或将图片附件缩到指定的大小。不支持动画 GIF 格式', + 10 => 'setting_attach_image_thumbwidthheight', + 11 => '缩略图大小', + 12 => '设置缩略图的大小,小于此尺寸的图片附件将不生成缩略图', + 13 => 'setting_attach_basic_thumbsource', + 14 => '直接缩放原图', + 15 => '选择“是”,将直接缩放原图,而不生成缩略图文件', + 16 => 'setting_attach_image_thumbsourcewidthheight', + 17 => '原图缩放大小', + 18 => '设置原图的大小,所有大于此尺寸的图片附件将缩小到指定大小', + 19 => 'setting_attach_antileech_expire', + 20 => '附件链接有效期', + 21 => '单位:小时,0 或留空表示附件链接永久有效,过期后链接自动更新。本功能可有效防止附件被盗链或附件被软件批量下载,但是会给会员的正常下载带来不便', + 22 => 'setting_attach_antileech_refcheck', + 23 => '下载附件来路检查', + 24 => '选择“是”将检查下载附件的来路,来自其他网站或站点的下载请求将被禁止。注意: 本功能在开启“文章中显示图片附件”时,会加重服务器负担', + 25 => 'setting_attach_image_thumbstatus_none', + 26 => '不启用', + 27 => 'setting_attach_image_thumbstatus_fixnone', + 28 => '小于指定大小、保持比率', + 29 => 'setting_attach_image_thumbstatus_fixwr', + 30 => '与指定大小相同、保持比率,超出部分剪切', + ), + ), + 261 => + array ( + 'index' => + array ( + '上传设置' => 'action=setting&operation=attach', + '远程附件' => 'action=setting&operation=attach&anchor=remote', + ), + 'text' => + array ( + 0 => '上传设置 » 远程附件', + 1 => 'setting_attach_remote_enabled', + 2 => '启用远程附件', + 3 => 'setting_attach_remote_enabled_ssl', + 4 => '启用 SSL 连接', + 5 => '注意:FTP 服务器必需开启了 SSL', + 6 => 'setting_attach_remote_ftp_host', + 7 => 'FTP 服务器地址', + 8 => '可以是 FTP 服务器的 IP 地址或域名', + 9 => 'setting_attach_remote_ftp_port', + 10 => 'FTP 服务器端口', + 11 => '默认为 21', + 12 => 'setting_attach_remote_ftp_user', + 13 => 'FTP 账号', + 14 => '该账号必需具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承', + 15 => 'setting_attach_remote_ftp_pass', + 16 => 'FTP 密码', + 17 => '基于安全考虑将只显示 FTP 密码的第一位和最后一位,中间显示八个 * 号', + 18 => 'setting_attach_remote_ftp_pasv', + 19 => '被动模式(pasv)连接', + 20 => '一般情况下非被动模式即可,如果存在上传失败问题,可尝试打开此设置', + 21 => 'setting_attach_remote_dir', + 22 => '远程附件目录', + 23 => '远程附件目录的绝对路径或相对于 FTP 主目录的相对路径,结尾不要加斜杠“/”,“.”表示 FTP 主目录', + 24 => 'setting_attach_remote_url', + 25 => '远程访问 URL', + 26 => '支持 HTTP 和 FTP 协议,结尾不要加斜杠“/”;如果使用 FTP 协议,FTP 服务器必需支持 PASV 模式,为了安全起见,使用 FTP 连接的账号不要设置可写权限和列表权限', + 27 => 'setting_attach_remote_timeout', + 28 => 'FTP 传输超时时间', + 29 => '单位:秒,0 为服务器默认', + 30 => 'setting_attach_remote_preview', + 31 => '连接测试', + 32 => '无需保存设置即可测试,请在测试通过后再保存', + 33 => 'setting_attach_remote_allowedexts', + 34 => '允许的附件扩展名', + 35 => '只允许这些扩展名结尾的附件使用远程附件功能,每行一个,不区分大小写,留空为不限制', + 36 => 'setting_attach_remote_disallowedexts', + 37 => '禁止的附件扩展名', + 38 => '禁止这些扩展名结尾的附件使用远程附件功能,每行一个,不区分大小写,留空为不限制', + 39 => 'setting_attach_remote_minsize', + 40 => '附件尺寸下限', + 41 => '单位:KB,只有尺寸大于当前设置的附件才使用远程附件功能,0 或留空为不限制', + 42 => 'setting_attach_antileech_remote_hide_dir', + 43 => '隐藏远程附件真实路径', + 44 => '选择是,将加重本地服务器负担,并明显增加本地服务器流量;选择否,下载的附件与上传的附件文件名将会不一致', + 45 => 'yes', + 46 => '是', + 47 => 'no', + 48 => '否', + ), + ), + 262 => + array ( + 'index' => + array ( + '上传设置' => 'action=setting&operation=attach', + '空间附件' => 'action=setting&operation=attach&anchor=albumattach', + ), + 'text' => + array ( + 0 => '上传设置 » 空间附件', + 1 => 'setting_attach_album_maxtimage', + 2 => '图片最大尺寸', + 3 => '如果用户上传一些尺寸很大的数码图片,则程序会按照本设置进行缩小该图片并显示,比如可以设置为 宽:1024px,高:768px,但都不能小于 300px。设置为 0,则不做任何处理', + ), + ), + 263 => + array ( + 'index' => + array ( + '上传设置' => 'action=setting&operation=attach', + '门户附件' => 'action=setting&operation=attach&anchor=portalarticle', + ), + 'text' => + array ( + 0 => '上传设置 » 门户附件', + 1 => 'setting_attach_portal_article_img_thumb_closed', + 2 => '开启文章图片缩略图', + 3 => '是否开启文章上传图片的缩略图', + 4 => 'setting_attach_portal_article_imgsize', + 5 => '文章图片缩略图尺寸', + 6 => '如果上传一些尺寸很大的数码图片,则程序会按照本设置进行生成相应的小图片,默认大小为 300*300', + ), + ), + 264 => + array ( + 'index' => + array ( + '水印设置' => 'action=setting&operation=imgwater', + '文章' => 'action=setting&operation=imgwater&anchor=portal', + ), + 'text' => + array ( + 0 => '水印设置 » 文章', + 1 => 'setting_imgwater_image_watermarks_portal', + 2 => '文章图片水印设置', + 3 => 'setting_imgwater_image_watermarkstatus', + 4 => '水印', + 5 => '您可以设置自动为用户上传的 JPG/PNG/GIF 图片附件添加水印,请在此选择水印添加的位置(3x3 共 9 个位置可选)。不支持动画 GIF 格式', + 6 => 'setting_imgwater_image_watermarkminwidthheight', + 7 => '水印添加条件', + 8 => '设置水印添加的条件,小于此尺寸的图片附件将不添加水印', + 9 => 'setting_imgwater_image_watermarktype', + 10 => '水印图片类型', + 11 => '如果设置 GIF 类型的文件作为水印,水印图片为 static/image/common/watermark.gif,如果设置 PNG 类型的文件作为水印,水印图片为 static/image/common/watermark.png,您可替换水印文件以实现不同的水印效果。如果设置文本类型的水印并且使用 GD 图片处理库,那么还需要 FreeType 库支持才能使用', + 12 => 'setting_imgwater_image_watermarktrans', + 13 => '水印融合度', + 14 => '设置 GIF 类型水印图片与原始图片的融合度,范围为 1~100 的整数,数值越大水印图片透明度越低。PNG 类型水印本身具有真彩透明效果,无须此设置。本功能需要开启水印功能后才有效', + 15 => 'setting_imgwater_image_watermarkquality', + 16 => 'JPEG 水印质量', + 17 => '设置 JPEG 类型的图片附件添加水印后的质量参数,范围为 0~100 的整数,数值越大结果图片效果越好,但尺寸也越大。本功能需要开启水印功能后才有效', + 18 => 'setting_imgwater_image_watermarktext_text', + 19 => '文本水印文字', + 20 => '如果您指定的 TrueType 字体为中文字体文件,那么您可以在文本水印中书写中文', + 21 => 'setting_imgwater_image_watermarktext_fontpath', + 22 => '文本水印 TrueType 字体文件名', + 23 => '填写存放在 static/image/seccode/font/ch/ 或 static/image/seccode/font/en/ 目录下的 TTF 字体文件,支持中文字体。如使用中文 TTF 字体请使用包含完整中文汉字的字体文件', + 24 => 'setting_imgwater_image_watermarktext_size', + 25 => '文本水印字体大小', + 26 => '设置文本水印字体大小,请按照字体设置相应的大小', + 27 => 'setting_imgwater_image_watermarktext_angle', + 28 => '文本水印显示角度', + 29 => '0 度为从左向右阅读文本', + 30 => 'setting_imgwater_image_watermarktext_color', + 31 => '文本水印字体颜色', + 32 => '输入 16 进制颜色代表文本水印字体颜色', + 33 => 'setting_imgwater_image_watermarktext_shadowx', + 34 => '文本水印阴影横向偏移量', + 35 => '设置文本水印阴影横向偏移量,此数值不宜设置的太大', + 36 => 'setting_imgwater_image_watermarktext_shadowy', + 37 => '文本水印阴影纵向偏移量', + 38 => '设置文本水印阴影纵向偏移量,此数值不宜设置的太大', + 39 => 'setting_imgwater_image_watermarktext_shadowcolor', + 40 => '文本水印阴影颜色', + 41 => '输入 16 进制颜色代表文本水印阴影字体颜色', + 42 => 'setting_imgwater_image_watermarktext_imtranslatex', + 43 => '文本水印横向偏移量(ImageMagick)', + 44 => '设置水印文本输出后向屏幕中央的横向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 45 => 'setting_imgwater_image_watermarktext_imtranslatey', + 46 => '文本水印纵向偏移量(ImageMagick)', + 47 => '设置水印文本输出后向屏幕中央的纵向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 48 => 'setting_imgwater_image_watermarktext_imskewx', + 49 => '文本水印横向倾斜角度(ImageMagick)', + 50 => '设置水印文本横向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + 51 => 'setting_imgwater_image_watermarktext_imskewy', + 52 => '文本水印纵向倾斜角度(ImageMagick)', + 53 => '设置水印文本纵向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + 54 => 'setting_imgwater_preview', + 55 => '预览', + 56 => '请先提交后再预览', + 57 => 'setting_imgwater_image_watermarkstatus_none', + 58 => '不启用水印功能', + 59 => 'setting_imgwater_image_watermarktype_gif', + 60 => 'GIF 类型水印', + 61 => 'setting_imgwater_image_watermarktype_png', + 62 => 'PNG 类型水印', + 63 => 'setting_imgwater_image_watermarktype_text', + 64 => '文本类型水印', + ), + ), + 265 => + array ( + 'index' => + array ( + '水印设置' => 'action=setting&operation=imgwater', + '论坛' => 'action=setting&operation=imgwater&anchor=forum', + ), + 'text' => + array ( + 0 => '水印设置 » 论坛', + 1 => 'setting_imgwater_image_watermarks_forum', + 2 => '论坛附件图片水印设置', + 3 => 'setting_imgwater_image_watermarkstatus', + 4 => '水印', + 5 => '您可以设置自动为用户上传的 JPG/PNG/GIF 图片附件添加水印,请在此选择水印添加的位置(3x3 共 9 个位置可选)。不支持动画 GIF 格式', + 6 => 'setting_imgwater_image_watermarkminwidthheight', + 7 => '水印添加条件', + 8 => '设置水印添加的条件,小于此尺寸的图片附件将不添加水印', + 9 => 'setting_imgwater_image_watermarktype', + 10 => '水印图片类型', + 11 => '如果设置 GIF 类型的文件作为水印,水印图片为 static/image/common/watermark.gif,如果设置 PNG 类型的文件作为水印,水印图片为 static/image/common/watermark.png,您可替换水印文件以实现不同的水印效果。如果设置文本类型的水印并且使用 GD 图片处理库,那么还需要 FreeType 库支持才能使用', + 12 => 'setting_imgwater_image_watermarktrans', + 13 => '水印融合度', + 14 => '设置 GIF 类型水印图片与原始图片的融合度,范围为 1~100 的整数,数值越大水印图片透明度越低。PNG 类型水印本身具有真彩透明效果,无须此设置。本功能需要开启水印功能后才有效', + 15 => 'setting_imgwater_image_watermarkquality', + 16 => 'JPEG 水印质量', + 17 => '设置 JPEG 类型的图片附件添加水印后的质量参数,范围为 0~100 的整数,数值越大结果图片效果越好,但尺寸也越大。本功能需要开启水印功能后才有效', + 18 => 'setting_imgwater_image_watermarktext_text', + 19 => '文本水印文字', + 20 => '如果您指定的 TrueType 字体为中文字体文件,那么您可以在文本水印中书写中文', + 21 => 'setting_imgwater_image_watermarktext_fontpath', + 22 => '文本水印 TrueType 字体文件名', + 23 => '填写存放在 static/image/seccode/font/ch/ 或 static/image/seccode/font/en/ 目录下的 TTF 字体文件,支持中文字体。如使用中文 TTF 字体请使用包含完整中文汉字的字体文件', + 24 => 'setting_imgwater_image_watermarktext_size', + 25 => '文本水印字体大小', + 26 => '设置文本水印字体大小,请按照字体设置相应的大小', + 27 => 'setting_imgwater_image_watermarktext_angle', + 28 => '文本水印显示角度', + 29 => '0 度为从左向右阅读文本', + 30 => 'setting_imgwater_image_watermarktext_color', + 31 => '文本水印字体颜色', + 32 => '输入 16 进制颜色代表文本水印字体颜色', + 33 => 'setting_imgwater_image_watermarktext_shadowx', + 34 => '文本水印阴影横向偏移量', + 35 => '设置文本水印阴影横向偏移量,此数值不宜设置的太大', + 36 => 'setting_imgwater_image_watermarktext_shadowy', + 37 => '文本水印阴影纵向偏移量', + 38 => '设置文本水印阴影纵向偏移量,此数值不宜设置的太大', + 39 => 'setting_imgwater_image_watermarktext_shadowcolor', + 40 => '文本水印阴影颜色', + 41 => '输入 16 进制颜色代表文本水印阴影字体颜色', + 42 => 'setting_imgwater_image_watermarktext_imtranslatex', + 43 => '文本水印横向偏移量(ImageMagick)', + 44 => '设置水印文本输出后向屏幕中央的横向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 45 => 'setting_imgwater_image_watermarktext_imtranslatey', + 46 => '文本水印纵向偏移量(ImageMagick)', + 47 => '设置水印文本输出后向屏幕中央的纵向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 48 => 'setting_imgwater_image_watermarktext_imskewx', + 49 => '文本水印横向倾斜角度(ImageMagick)', + 50 => '设置水印文本横向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + 51 => 'setting_imgwater_image_watermarktext_imskewy', + 52 => '文本水印纵向倾斜角度(ImageMagick)', + 53 => '设置水印文本纵向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + 54 => 'setting_imgwater_preview', + 55 => '预览', + 56 => '请先提交后再预览', + 57 => 'setting_imgwater_image_watermarkstatus_none', + 58 => '不启用水印功能', + 59 => 'setting_imgwater_image_watermarktype_gif', + 60 => 'GIF 类型水印', + 61 => 'setting_imgwater_image_watermarktype_png', + 62 => 'PNG 类型水印', + 63 => 'setting_imgwater_image_watermarktype_text', + 64 => '文本类型水印', + ), + ), + 266 => + array ( + 'index' => + array ( + '水印设置' => 'action=setting&operation=imgwater', + '空间相册' => 'action=setting&operation=imgwater&anchor=album', + ), + 'text' => + array ( + 0 => '水印设置 » 空间相册', + 1 => 'setting_imgwater_image_watermarks_album', + 2 => '空间相册图片水印设置', + 3 => 'setting_imgwater_image_watermarkstatus', + 4 => '水印', + 5 => '您可以设置自动为用户上传的 JPG/PNG/GIF 图片附件添加水印,请在此选择水印添加的位置(3x3 共 9 个位置可选)。不支持动画 GIF 格式', + 6 => 'setting_imgwater_image_watermarkminwidthheight', + 7 => '水印添加条件', + 8 => '设置水印添加的条件,小于此尺寸的图片附件将不添加水印', + 9 => 'setting_imgwater_image_watermarktype', + 10 => '水印图片类型', + 11 => '如果设置 GIF 类型的文件作为水印,水印图片为 static/image/common/watermark.gif,如果设置 PNG 类型的文件作为水印,水印图片为 static/image/common/watermark.png,您可替换水印文件以实现不同的水印效果。如果设置文本类型的水印并且使用 GD 图片处理库,那么还需要 FreeType 库支持才能使用', + 12 => 'setting_imgwater_image_watermarktrans', + 13 => '水印融合度', + 14 => '设置 GIF 类型水印图片与原始图片的融合度,范围为 1~100 的整数,数值越大水印图片透明度越低。PNG 类型水印本身具有真彩透明效果,无须此设置。本功能需要开启水印功能后才有效', + 15 => 'setting_imgwater_image_watermarkquality', + 16 => 'JPEG 水印质量', + 17 => '设置 JPEG 类型的图片附件添加水印后的质量参数,范围为 0~100 的整数,数值越大结果图片效果越好,但尺寸也越大。本功能需要开启水印功能后才有效', + 18 => 'setting_imgwater_image_watermarktext_text', + 19 => '文本水印文字', + 20 => '如果您指定的 TrueType 字体为中文字体文件,那么您可以在文本水印中书写中文', + 21 => 'setting_imgwater_image_watermarktext_fontpath', + 22 => '文本水印 TrueType 字体文件名', + 23 => '填写存放在 static/image/seccode/font/ch/ 或 static/image/seccode/font/en/ 目录下的 TTF 字体文件,支持中文字体。如使用中文 TTF 字体请使用包含完整中文汉字的字体文件', + 24 => 'setting_imgwater_image_watermarktext_size', + 25 => '文本水印字体大小', + 26 => '设置文本水印字体大小,请按照字体设置相应的大小', + 27 => 'setting_imgwater_image_watermarktext_angle', + 28 => '文本水印显示角度', + 29 => '0 度为从左向右阅读文本', + 30 => 'setting_imgwater_image_watermarktext_color', + 31 => '文本水印字体颜色', + 32 => '输入 16 进制颜色代表文本水印字体颜色', + 33 => 'setting_imgwater_image_watermarktext_shadowx', + 34 => '文本水印阴影横向偏移量', + 35 => '设置文本水印阴影横向偏移量,此数值不宜设置的太大', + 36 => 'setting_imgwater_image_watermarktext_shadowy', + 37 => '文本水印阴影纵向偏移量', + 38 => '设置文本水印阴影纵向偏移量,此数值不宜设置的太大', + 39 => 'setting_imgwater_image_watermarktext_shadowcolor', + 40 => '文本水印阴影颜色', + 41 => '输入 16 进制颜色代表文本水印阴影字体颜色', + 42 => 'setting_imgwater_image_watermarktext_imtranslatex', + 43 => '文本水印横向偏移量(ImageMagick)', + 44 => '设置水印文本输出后向屏幕中央的横向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 45 => 'setting_imgwater_image_watermarktext_imtranslatey', + 46 => '文本水印纵向偏移量(ImageMagick)', + 47 => '设置水印文本输出后向屏幕中央的纵向的偏移值。本设置只适用于 ImageMagick 图片处理库', + 48 => 'setting_imgwater_image_watermarktext_imskewx', + 49 => '文本水印横向倾斜角度(ImageMagick)', + 50 => '设置水印文本横向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + 51 => 'setting_imgwater_image_watermarktext_imskewy', + 52 => '文本水印纵向倾斜角度(ImageMagick)', + 53 => '设置水印文本纵向的倾斜角度。本设置只适用于 ImageMagick 图片处理库', + 54 => 'setting_imgwater_preview', + 55 => '预览', + 56 => '请先提交后再预览', + 57 => 'setting_imgwater_image_watermarkstatus_none', + 58 => '不启用水印功能', + 59 => 'setting_imgwater_image_watermarktype_gif', + 60 => 'GIF 类型水印', + 61 => 'setting_imgwater_image_watermarktype_png', + 62 => 'PNG 类型水印', + 63 => 'setting_imgwater_image_watermarktype_text', + 64 => '文本类型水印', + ), + ), + 267 => + array ( + 'index' => + array ( + '搜索设置' => 'action=setting&operation=search', + ), + 'text' => + array ( + 0 => '搜索设置', + 1 => 'setting_search_status', + 2 => '开启搜索', + 3 => '勾选您要开启的搜索栏目', + 4 => 'setting_search_srchsetting', + 5 => '搜索选项设置', + 6 => 'setting_search_srchcensor', + 7 => '搜索受词语过滤控制', + 8 => 'setting_search_srchhotkeywords', + 9 => '热门关键词', + 10 => '每行一个', + 11 => 'settings_sphinx', + 12 => 'Sphinx 全文检索设置', + 13 => 'settings_sphinx_sphinxon', + 14 => '是否开启', + 15 => '设置是否开启 Sphinx 全文检索功能,开启前确认 Sphinx 安装及配置成功', + 16 => 'settings_sphinx_sphinxhost', + 17 => '设置 Sphinx 主机名,或者 Sphinx 服务 socket 地址', + 18 => '填写 Sphinx 主机名:例如,本地主机填写“localhost”,或者填写 Sphinx 服务 socket 地址,必须是绝对地址:例如,/tmp/sphinx.sock', + 19 => 'settings_sphinx_sphinxport', + 20 => '设置 Sphinx 主机端口', + 21 => '填写 Sphinx 主机端口:例如,3312,主机名填写 socket 地址的,则此处不需要设置', + 22 => 'settings_sphinx_sphinxsubindex', + 23 => '设置标题索引名', + 24 => '填写 Sphinx 配置中的标题主索引名及标题增量索引名:例如,“threads,threads_minute”。注意:多个索引使用半角逗号 "," 隔开,必须按照 Sphinx 配置文件中的索引名填写', + 25 => 'settings_sphinx_sphinxmsgindex', + 26 => '设置全文索引名', + 27 => '填写 Sphinx 配置中的全文主索引名及全文增量索引名:例如,“posts,posts_minute”。注意:多个索引使用半角逗号 "," 隔开,必须按照 Sphinx 配置文件中的索引名填写', + 28 => 'settings_sphinx_sphinxmaxquerytime', + 29 => '设置最大搜索时间', + 30 => '填写最大搜索时间,以毫秒为单位。参数必须是非负整数。默认值为 0,意思是不做限制', + 31 => 'settings_sphinx_sphinxlimit', + 32 => '设置最大返回匹配项数目', + 33 => '填写最大返回匹配项数目,必须是非负整数,默认值10000', + 34 => 'settings_sphinx_sphinxrank', + 35 => '设置全文索引评分模式', + 36 => '(1)SPH_RANK_PROXIMITY_BM25, 默认模式,同时使用词组评分和 BM25 评分,并且将二者结合。[默认] +(2)SPH_RANK_BM25,统计相关度计算模式,仅使用 BM25 评分计算(与大多数全文检索引擎相同)。这个模式比较快,但是可能使包含多个词的查询的结果质量下降。 +(3)SPH_RANK_NONE,禁用评分的模式,这是最快的模式。实际上这种模式与布尔搜索相同。所有的匹配项都被赋予权重1', + ), + ), + 268 => + array ( + 'index' => + array ( + 'UCenter 设置' => 'action=setting&operation=uc', + ), + 'text' => + array ( + 0 => 'UCenter 设置', + 1 => 'setting_uc_tips', + 2 => '本设置在站点安装时自动生成,一般情况下请不要修改,修改前请备份 config/config_ucenter.php 文件,以防止修改错误导致站点无法运行', + 3 => 'setting_uc_appid', + 4 => 'UCenter 应用 ID', + 5 => '该值为当前站点在 UCenter 的应用 ID,一般情况请不要改动', + 6 => 'setting_uc_key', + 7 => 'UCenter 通信密钥', + 8 => '通信密钥用于在 UCenter 和 Discuz! 之间传输信息的加密,可包含任何字母及数字,请在 UCenter 与 Discuz! 设置完全相同的通讯密钥,以确保两套系统能够正常通信', + 9 => 'setting_uc_api', + 10 => 'UCenter 访问地址', + 11 => '如果您的 UCenter 访问地址发生了改变,请修改此项。不正确的设置可能导致站点功能异常,请小心修改。格式: http://www.sitename.com/uc_server (最后不要加\'/\')', + 12 => 'setting_uc_ip', + 13 => 'UCenter IP 地址', + 14 => '如果您的服务器无法通过域名访问 UCenter 或者想通过指定的本机或内网 IP 直连,可以输入 UCenter 服务器的 IP 地址', + 15 => 'setting_uc_connect', + 16 => 'UCenter 连接方式', + 17 => '采用接口方式时,站点和 Ucenter 通信采用远程方式,数据库方式需要您站点可以连接 UCenter 数据库', + 18 => 'setting_uc_dbhost', + 19 => 'UCenter 数据库服务器', + 20 => '可以是本地也可以是远程数据库服务器,如果 MySQL 端口不是默认的 3306,请填写如下形式:127.0.0.1:6033', + 21 => 'setting_uc_dbuser', + 22 => 'UCenter 数据库用户名', + 23 => 'setting_uc_dbpass', + 24 => 'UCenter 数据库密码', + 25 => 'setting_uc_dbname', + 26 => 'UCenter 数据库名', + 27 => 'setting_uc_dbtablepre', + 28 => 'UCenter 表前缀', + 29 => 'setting_uc_activation', + 30 => '是否允许其他应用的会员在站点激活', + 31 => '选择“是”,允许会员在本站点激活;选择“否”,则不允许任何第三方应用在本站点激活', + 32 => 'setting_uc_fastactivation', + 33 => '是否允许直接激活', + 34 => '选择“是”,用户登录即自动激活;选择“否”,允许用户激活,但必须填写注册设置中的必填项', + 35 => 'setting_uc_avatarmethod', + 36 => '头像调用方式', + 37 => '设置用户头像的调用方式,动态方式依靠服务器检测头像的存在情况,静态方式不检测,用户直接请求头像并在失败后加载默认头像。', + 38 => 'setting_uc_dynavt', + 39 => '头像缓存机制', + 40 => '设置用户头像的缓存机制,仅在动态调用模式下生效,可以避免更换头像后无法及时看到的问题,但会增加一些服务器压力。', + 41 => 'setting_uc_connect_mysql', + 42 => '数据库方式', + 43 => 'setting_uc_connect_api', + 44 => '接口方式', + 45 => 'setting_uc_avatarmethod_0', + 46 => '使用动态方式调用头像', + 47 => 'setting_uc_avatarmethod_1', + 48 => '使用静态方式调用头像', + 49 => 'setting_uc_dynavt_0', + 50 => '自动(完全由用户浏览器处理,性能最好)', + 51 => 'setting_uc_dynavt_1', + 52 => '用户自身头像带更新时间戳,其他头像自动', + 53 => 'setting_uc_dynavt_2', + 54 => '全部带更新时间戳(可能会增加服务器压力)', + ), + ), + 269 => + array ( + 'index' => + array ( + '电子商务' => 'action=setting&operation=ec', + '基本设置' => 'action=setting&operation=ec', + ), + 'text' => + array ( + 0 => '电子商务 » 基本设置', + 1 => 'setting_ec_credittrade', + 2 => '积分兑换设置', + 3 => 'setting_ec_ratio', + 4 => '现金/积分兑换比率', + 5 => '设置真实货币现金(以人民币元为单位)与站点交易积分间的兑换比率,例如设置为 10,则 1 元人民币可以兑换 10 个单位的交易积分。本功能需开启交易积分,并成功进行收款账号的相关设置后方可使用,如果禁止使用现金与交易积分的兑换功能,请设置为 0', + 6 => 'setting_ec_mincredits', + 7 => '单次购买最小积分数额', + 8 => '设置用户一次支付所购买的交易积分的最小数额,单位为交易积分的单位,0 为不限制', + 9 => 'setting_ec_maxcredits', + 10 => '单次购买最大积分数额', + 11 => '设置用户一次支付所购买的交易积分的最大数额,单位为交易积分的单位,0 为不限制', + 12 => 'setting_ec_maxcreditspermonth', + 13 => '每月购买最大积分数额', + 14 => '设置用户每月能够通过在线支付方式购买的交易积分的最大数额,单位为交易积分的单位,0 为不限制', + ), + ), + 270 => + array ( + 'index' => + array ( + '性能优化' => 'action=setting&operation=seo', + '内存优化' => 'action=setting&operation=memory', + ), + 'text' => + array ( + 0 => '性能优化 » 内存优化', + 1 => 'setting_memory_tips', + 2 => '启用内存优化功能将会大幅度提升程序性能和服务器的负载能力,内存优化功能需要服务器系统以及PHP扩展模块支持目前支持的内存优化接口有 Memcache、eAccelerator、Alternative PHP Cache(APC)、Xcache、Redis、YAC、APCu,优化系统将会依据当前服务器环境依次选用接口内存接口的主要设置位于 config_global.php 当中,您可以通过编辑 config_global.php 进行高级设置', + 3 => 'setting_memory_status', + 4 => '当前内存工作状态', + 5 => 'setting_memory_function', + 6 => '内存优化功能设置', + ), + ), + 271 => + array ( + 'index' => + array ( + '性能优化' => 'action=setting&operation=seo', + '内存缓存管理' => 'action=setting&operation=memorydata', + ), + 'text' => + array ( + 0 => '性能优化 » 内存缓存管理', + 1 => 'setting_memorydata', + 2 => '内存缓存管理', + ), + ), + 272 => + array ( + 'index' => + array ( + '排行榜设置' => 'action=setting&operation=ranklist', + ), + 'text' => + array ( + 0 => '排行榜设置', + 1 => 'setting_ranklist_index_cache_time', + 2 => '排行榜首页缓存时间', + 3 => '单位:小时', + 4 => 'setting_ranklist_index_select', + 5 => '排行榜首页排行时间类型', + 6 => 'setting_ranklist_ignorefid', + 7 => '不参与排行的版块/圈子', + 8 => '填入版块ID或圈子ID,对应版块及下面的主题将不进入排行榜,多个版块ID间请用半角逗号 "," 隔开', + 9 => 'setting_ranklist_member_show', + 10 => '竞价排名功能开启', + 11 => '开启用户模块下竞价排名功能', + 12 => 'setting_ranklist_member_show_announcement', + 13 => '竞价排名功能公告信息', + 14 => '填入竞价排名功能公告信息', + 15 => 'setting_ranklist_block_set', + 16 => '排行榜详细模块设置', + 17 => 'setting_ranklist_update_cache_choose', + 18 => '选择更新缓存模块', + 19 => 'setting_ranklist_block_comment', + 20 => '请根据服务器的负载情况,设置合理的更新时间间隔,建议最少不能低于 5 小时。显示条数越多负载越高,建议最多不要超过100条,默认为 20 条', + 21 => 'setting_ranklist_cache_comment', + 22 => '请根据服务器的负载情况,合理选择需要更新缓存的模块,选的模块越多服务器的负载越高', + ), + ), + 273 => + array ( + 'index' => + array ( + '手机版设置' => 'action=setting&operation=mobile', + '全局设置' => 'action=setting&operation=mobile&anchor=status', + ), + 'text' => + array ( + 0 => '手机版设置 » 全局设置', + 1 => 'setting_mobile_status_tips', + 2 => '本手机功能页仅支持WAP2.0(XHTML方式)以上的手机浏览器进行访问。', + 3 => 'setting_mobile_status', + 4 => '全局设置', + 5 => 'setting_mobile_allowmobile', + 6 => '开启手机版', + 7 => '开启本功能,用户使用手机访问论坛时,将自动跳转到手机版界面手机访问域名配置请进入: 全局 - 域名设置 - 应用域名底部导航设置请进入:界面 - 导航设置 - 底部导航', + 8 => 'setting_mobile_mobileforward', + 9 => '开启手机浏览器自动跳转', + 10 => '开启后用户使用手机浏览器访问社区论坛功能页以外页面时自动跳转到论坛首页进行访问', + 11 => 'setting_mobile_register', + 12 => '是否允许手机版注册', + 13 => '是否开启手机版注册功能,手机注册不会对用户栏目中的注册页必填项进行检测请谨慎开启', + 14 => 'setting_mobile_simpletype', + 15 => '开启无图模式', + 16 => '默认显示图片,开启后,“触屏版”不显示文章图片,“简易版”不显示文章图片、小图标、主题列表日期等页面元素', + 17 => 'setting_mobile_cachetime', + 18 => '页面浏览缓存时间', + 19 => '设置访问过的页面在用户手机上保存的时间,留空或0为不缓存单位:秒', + 20 => 'setting_mobile_come_from', + 21 => '手机发帖来源自定义', + 22 => '默认留空,如果填写,将在看帖页面"来自手机"处增加自定义文字或图标如:<a href=\'http://m.x.com\'>手机频道</a>此处支持HTML标签有:<a><font><span><strong><b><img>如果使用图标,请保证图片高度在16px(像素)以内', + 23 => 'yes', + 24 => '是', + 25 => 'no', + 26 => '否', + ), + ), + 274 => + array ( + 'index' => + array ( + '手机版设置' => 'action=setting&operation=mobile', + '门户设置' => 'action=setting&operation=mobile&anchor=portal', + ), + 'text' => + array ( + 0 => '手机版设置 » 门户设置', + 1 => 'setting_mobile_portal', + 2 => '门户设置', + 3 => 'setting_mobile_portal_catnav', + 4 => '开启首页频道导航', + 5 => '开启后门户首页将显示一级频道作为导航', + ), + ), + 275 => + array ( + 'index' => + array ( + '手机版设置' => 'action=setting&operation=mobile', + '论坛设置' => 'action=setting&operation=mobile&anchor=forum', + ), + 'text' => + array ( + 0 => '手机版设置 » 论坛设置', + 1 => 'setting_mobile_forum', + 2 => '论坛设置', + 3 => 'setting_mobile_forum_forumindex', + 4 => '论坛首页样式', + 5 => '选择导读需要开启导读功能;选择首页四格需要开启首页四格功能;', + 6 => 'setting_mobile_forum_statshow', + 7 => '显示统计信息', + 8 => '开启后将在论坛首页顶部显示论坛统计信息,仅在论坛首页样式为论坛版块或论坛版块含首页四格模式下显示', + 9 => 'setting_mobile_forum_displayorder3', + 10 => '是否显示置顶贴', + 11 => '“触屏版”功能,在文章列表页面中是否显示置顶贴,否为不显示', + 12 => 'setting_mobile_forum_topicperpage', + 13 => '每页显示主题数', + 14 => '主题列表页每页显示主题个数,为空时和界面设置保持一致当此处和界面设置数值不同时会导致手机端和电脑端分页不一致,请谨慎配置', + 15 => 'setting_mobile_forum_postperpage', + 16 => '主题内每页显示帖数', + 17 => '主题内每页显示的文章数目,为空时和界面设置保持一致当此处和界面设置数值不同时会导致手机端和电脑端分页不一致,请谨慎配置', + 18 => 'setting_mobile_forum_forumview', + 19 => '首页分区展示方式', + 20 => '如“收起”,论坛首页将默认只展示分区标题用户需点击分区展开该分区下的版块列表', + 21 => 'setting_mobile_forum_forumindex_guide', + 22 => '导读', + 23 => 'setting_mobile_forum_forumindex_grid', + 24 => '首页四格', + 25 => 'setting_mobile_forum_forumindex_forumlist', + 26 => '论坛版块', + 27 => 'setting_mobile_forum_forumindex_forumgrid', + 28 => '论坛版块含首页四格', + 29 => 'pack', + 30 => '收起', + 31 => 'unwind', + 32 => '展开', + ), + ), + 276 => + array ( + 'index' => + array ( + '防采集设置' => 'action=setting&operation=antitheft', + ), + 'text' => + array ( + 0 => '防采集设置', + 1 => 'setting_antitheft_tips', + 2 => '防采集功能不影响正常用户浏览检验。可防止本站主题、文章和日志被非法采集。当IP同时存在于黑/白名单时,白名单优先。开启防采集功能后文章列表页面的文章预览功能将不可使用。', + 3 => 'setting_antitheft_status', + 4 => '防采集全局设置', + 5 => 'setting_antitheft_allow', + 6 => '是否开启防采集', + 7 => 'setting_antitheft_24_max', + 8 => '每日最大访问量', + 9 => '设置独立IP每日最大访问次数,推荐值200', + 10 => 'setting_antitheft_white', + 11 => '白名单防采集过滤IP', + 12 => '当用户处于本列表中的 IP 地址时,可无限次数访问,不进行防采集过滤。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 13 => 'setting_antitheft_black', + 14 => '黑名单防采集过滤IP', + 15 => '当用户处于本列表中的 IP 地址时,全部进行防采集过滤。每个 IP 一行,既可输入完整地址,也可只输入 IP 开头,例如 "192.168."(不含引号) 可匹配 192.168.0.0~192.168.255.255 范围内的所有地址,留空为不设置', + 16 => 'setting_antitheft_disable', + 17 => '不进行防采集的内容', + 18 => 'setting_antitheft_addwhitelist', + 19 => '加入白名单', + 20 => 'setting_antitheft_addblacklist', + 21 => '加入黑名单', + 22 => 'delete', + 23 => '删除', + 24 => 'yes', + 25 => '是', + 26 => 'no', + 27 => '否', + 28 => 'setting_antitheft_disable_thread', + 29 => '主题', + 30 => 'setting_antitheft_disable_article', + 31 => '文章', + 32 => 'setting_antitheft_disable_blog', + 33 => '日志', + ), + ), + 277 => + array ( + 'index' => + array ( + '分享管理' => 'action=share', + ), + 'text' => + array ( + 0 => '分享管理', + 1 => 'share_tips', + 2 => '批量分享管理用于删除分享(share)使用。提醒:点击搜索结果页的删除按钮,将会直接删除相关信息!', + ), + ), + 278 => + array ( + 'index' => + array ( + '分享管理' => 'action=share', + '搜索' => 'action=share&search=true', + ), + 'text' => + array ( + 0 => '分享管理 » 搜索', + 1 => 'share_search_detail', + 2 => '显示详细分享列表', + 3 => 'share_search_perpage', + 4 => '每页显示数', + 5 => 'share_search_icon', + 6 => '分享类型', + 7 => 'share_search_uid', + 8 => '用户 UID', + 9 => '多 UID 中间请用半角逗号 "," 隔开', + 10 => 'share_search_user', + 11 => '发表分享用户名', + 12 => '多用户名中间请用半角逗号 "," 隔开', + 13 => 'share_search_sid', + 14 => '分享 ID', + 15 => '多分享 ID 中间请用半角逗号 "," 隔开', + 16 => 'share_search_hot', + 17 => '热度', + 18 => 'share_search_time', + 19 => '发表时间范围', + 20 => '格式 yyyy-mm-dd', + 21 => 'all', + 22 => '全部', + 23 => 'link', + 24 => '网址', + 25 => 'video', + 26 => '视频', + 27 => 'music', + 28 => '音乐', + 29 => 'blogs', + 30 => '日志', + 31 => 'albums', + 32 => '相册', + 33 => 'pics', + 34 => '图片', + 35 => 'members', + 36 => '用户', + 37 => 'thread', + 38 => '主题', + ), + ), + 279 => + array ( + 'index' => + array ( + '表情管理' => 'action=smilies', + '表情分类' => 'action=smilies', + ), + 'text' => + array ( + 0 => '表情管理 » 表情分类', + 1 => 'smilies_tips_smileytypes', + 2 => '表情导出包含表情分类信息及表情代码信息,表情图片文件请通过 FTP 下载。请不要同时启用过多的表情分类,并控制好表情分类的名称长度,以免表情窗口无法完全显示所有表情分类。您可以在界面风格中设置默认显示的表情分类。删除表情分类请先删除该分类下所有表情。', + ), + ), + 280 => + array ( + 'index' => + array ( + '表情管理' => 'action=smilies', + '导入表情' => 'action=smilies&operation=import', + ), + 'text' => + array ( + 0 => '表情管理 » 导入表情', + 1 => 'smilies_tips', + 2 => '添加表情请上传表情图片到相应的表情目录中(static/image/smiley/表情目录/)。表情支持"JPG、GIF、PNG"格式的图片,文件名只允许数字、26 个英文字母、下划线、半角空格及 -.&[]() 等符号,文件名长度不能超过 30 字节,否则将会无法识别。请不要设置过多的表情,以免占用过多的服务器资源。', + ), + ), + 281 => + array ( + 'index' => + array ( + '模板管理' => 'action=styles&operation=edit', + ), + 'text' => + array ( + 0 => '模板管理', + 1 => 'styles_tips', + 2 => '由于扩展配色会重定义某些风格变量,因此某些风格变量可能只对默认配色有效', + 3 => 'styles_edit_name', + 4 => '界面方案名称', + 5 => '识别界面风格的标志,请勿使用空格或特殊符号', + 6 => 'styles_edit_tpl', + 7 => '匹配模板', + 8 => '与本套界面风格相匹配的模板名称', + 9 => 'styles_edit_extstyle', + 10 => '扩展配色', + 11 => '选择开放给用户自由选择的扩展配色方案要增加新的扩展配色方案,可上传到风格目录的 style/ 文件夹下,如 template/default/style/', + 12 => 'styles_edit_defaultextstyle', + 13 => '默认配色', + 14 => 'styles_edit_smileytype', + 15 => '默认表情分类', + 16 => 'styles_edit_imgdir', + 17 => '界面基础图片目录 {IMGDIR}', + 18 => '风格基础图片存放的目录,留空表示使用 static/image/common/ 目录为基础图片目录', + 19 => 'styles_edit_styleimgdir', + 20 => '扩展图片目录 {STYLEIMGDIR}', + 21 => '风格扩展图片存放的目录,留空表示无扩展图片目录', + 22 => 'styles_edit_logo', + 23 => '站点 Logo {BOARDIMG},{BOARDLOGO}', + 24 => '如使用 Flash 动画,请用逗号隔开 URL、宽度和高度,如“logo.swf,80,40”', + 25 => 'styles_edit_searchlogo', + 26 => '搜索 Logo {SEARCHIMG},{SEARCHLOGO}', + 27 => 'styles_edit_touchlogo', + 28 => '手机触屏版 Logo {TOUCHIMG},{TOUCHLOGO}', + 29 => 'styles_edit_customvariable', + 30 => '自定义模板变量', + 31 => 'styles_edit', + 32 => '编辑风格', + 33 => 'styles_edit_hexcolor', + 34 => '输入 16 进制颜色 #RRGGBB', + 35 => 'styles_edit_bg', + 36 => '输入背景图片地址输入附加属性', + ), + ), + 282 => + array ( + 'index' => + array ( + '标签管理' => 'action=tag', + ), + 'text' => + array ( + 0 => '标签管理', + 1 => 'tagname', + 2 => '标签名称', + 3 => 'feed_search_perpage', + 4 => '每页显示数', + 5 => 'misc_tag_status', + 6 => '状态', + ), + ), + 283 => + array ( + 'index' => + array ( + '论坛主题管理' => 'action=threads', + '最新列表' => 'action=threads', + ), + 'text' => + array ( + 0 => '论坛主题管理 » 最新列表', + 1 => 'threads_tips', + 2 => '通过批量主题管理,您可以对搜索到的主题进行批量删除、移动、分类/取消分类、删除、置顶/取消置顶、设置/取消精华、打开/关闭以及删除主题中的附件等操作;请先根据条件搜索主题,然后选择相应的操作。', + ), + ), + 284 => + array ( + 'index' => + array ( + '论坛主题管理' => 'action=threads', + '搜索' => 'action=threads&search=true', + ), + 'text' => + array ( + 0 => '论坛主题管理 » 搜索', + 1 => 'threads_search_detail', + 2 => '显示详细主题列表', + 3 => 'threads_search_perpage', + 4 => '每页显示数', + 5 => 'threads_search_time', + 6 => '发表时间范围', + 7 => '格式 yyyy-mm-dd,不限制请输入 0', + 8 => 'threads_search_user', + 9 => '主题作者', + 10 => '多用户名中间请用半角逗号 "," 隔开', + 11 => 'threads_search_keyword', + 12 => '标题关键字', + 13 => '多关键字中间请用半角逗号 "," 隔开', + 14 => 'threads_search_sort', + 15 => '所在分类信息', + 16 => 'threads_search_viewrange', + 17 => '被浏览次数介于', + 18 => 'threads_search_replyrange', + 19 => '被回复次数介于', + 20 => 'threads_search_readpermmore', + 21 => '所需阅读权限高于', + 22 => 'threads_search_pricemore', + 23 => '售价高于', + 24 => 'threads_search_noreplyday', + 25 => '多少天内无新回复', + 26 => 'threads_search_type', + 27 => '所在主题分类', + 28 => 'threads_search_sticky', + 29 => '是否包含置顶帖', + 30 => 'threads_search_digest', + 31 => '是否包含精华帖', + 32 => 'threads_search_attach', + 33 => '是否包含附件', + 34 => 'threads_rate', + 35 => '是否包含评分帖', + 36 => 'threads_highlight', + 37 => '是否包含高亮帖', + 38 => 'threads_save', + 39 => '是否包含草稿', + 40 => 'threads_hide', + 41 => '是否包含隐藏主题', + ), + ), + 285 => + array ( + 'index' => + array ( + '主题分表' => 'action=threadsplit', + '分表管理' => 'action=threadsplit&operation=manage', + ), + 'text' => + array ( + 0 => '主题分表 » 分表管理', + 1 => 'threadsplit_manage_tips', + 2 => '主题分表功能可将 forum_thread 表(包含主题标题、创建时间等信息,但不包含主题及回复内容)分在多个数据表中。创建新的主题存档表后,可使用主题移动功能将特定主题移动到存档表中。移动到存档表中的主题,会在主题所在的版块下建立一个存档区(名称可自定义),通过存档区可浏览存档表中的主题。存档表中的主题,只供浏览,不可回复、评分,不能进行管理操作,但可以删除和移动到非存档区。', + 3 => 'threadsplit_manage_table_orig', + 4 => 'thread 主表信息', + 5 => 'threadsplit_manage_table_archive', + 6 => 'thread 存档表信息', + 7 => 'delete', + 8 => '删除', + 9 => 'threadsplit_manage_table_add', + 10 => '添加存档表', + 11 => 'threadsplit_manage_forum_update', + 12 => '更新版块存档', + ), + ), + 286 => + array ( + 'index' => + array ( + '主题分表' => 'action=threadsplit', + '主题移动' => 'action=threadsplit&operation=move', + ), + 'text' => + array ( + 0 => '主题分表 » 主题移动', + 1 => 'threadsplit_move_tips', + 2 => '主题移动功能可将特定的主题在原始表(forum_thread)和新建的主题存档表之间移动。移动主题之前,请确定存在至少一个主题存档表(表名为 forum_thread_1、forum_thread_2……)。通过主题搜索筛选出要移动的主题,再选择目标表,即可完成主题数据的移动。', + 3 => 'threads_search_detail', + 4 => '显示详细主题列表', + 5 => 'threads_search_sourcetable', + 6 => '搜索以下 thread 分表', + 7 => 'threads_search_forum', + 8 => '所在版块', + 9 => 'threadsplit_move_tidrange', + 10 => 'tid 范围', + 11 => 'threads_search_noreplyday', + 12 => '多少天内无新回复', + 13 => 'threads_search_time', + 14 => '发表时间范围', + 15 => '格式 yyyy-mm-dd,不限制请输入 0', + 16 => 'threads_search_type', + 17 => '所在主题分类', + 18 => 'threads_search_sort', + 19 => '所在分类信息', + 20 => 'threads_search_viewrange', + 21 => '被浏览次数介于', + 22 => 'threads_search_replyrange', + 23 => '被回复次数介于', + 24 => 'threads_search_readpermmore', + 25 => '所需阅读权限高于', + 26 => 'threads_search_pricemore', + 27 => '售价高于', + 28 => 'threads_search_keyword', + 29 => '标题关键字', + 30 => '多关键字中间请用半角逗号 "," 隔开', + 31 => 'threads_search_user', + 32 => '主题作者', + 33 => '多用户名中间请用半角逗号 "," 隔开', + 34 => 'threads_search_sticky', + 35 => '是否包含置顶帖', + 36 => 'threads_search_digest', + 37 => '是否包含精华帖', + 38 => 'threads_search_attach', + 39 => '是否包含附件', + 40 => 'threads_rate', + 41 => '是否包含评分帖', + 42 => 'threads_highlight', + 43 => '是否包含高亮帖', + 44 => 'threads_list', + 45 => '主题列表', + 46 => 'threadsplit_move_threads_per_time', + 47 => '每次移动主题数', + 48 => '建议不超过 1000', + ), + ), + 287 => + array ( + 'index' => + array ( + '更新缓存' => 'action=tools&operation=updatecache', + ), + 'text' => + array ( + 0 => '更新缓存', + 1 => 'tools_updatecache_tips', + 2 => '当站点进行了数据恢复、升级或者工作出现异常的时候,您可以使用本功能重新生成缓存。更新缓存的时候,可能让服务器负载升高,请尽量避开会员访问的高峰时间 + 数据缓存:更新站点的全部数据缓存 + 模板缓存:更新论坛模板、风格等缓存文件,当您修改了模板或者风格,但是没有立即生效的时候使用 + DIY 模块分类缓存:更新 DIY 模块分类,当您安装或修改了 DIY 模块分类,但是没有立即生效的时候使用 + CSS缓存:更新论坛模板、风格等CSS文件,当您修改了模版或者风格CSS,但是没有立即生效的时候使用 + ', + ), + ), + 288 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + ), + 'text' => + array ( + 0 => '用户组', + 1 => 'usergroups_tips', + 2 => '用户组分为系统组、会员组和自定义组,会员组以积分确定组别和权限,而系统组和自定义组是人为设定,不会由系统自行改变。系统组和自定义组的设定不需要指定积分,Discuz! 预留了从站点管理员到游客等的 8 个系统头衔,自定义组的用户需要在编辑会员时将其加入。会员用户组至少分为两组,其积分下限分别为负值(任一负数)和 0,否则将导致部分用户无法与用户组匹配的问题。', + ), + ), + 289 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '基本设置' => 'action=usergroups&operation=edit&anchor=system', + ), + 'text' => + array ( + 0 => '用户组 » 基本设置', + 1 => 'usergroups_edit_system_public', + 2 => '公众用户组', + 3 => '设置是否为公众用户组。注意: 使用此功能前请确定是否确实需要,否则用户一旦自行加入本组,即便之后再设置本组为非公众用户组,仍然无法将用户从该组中批量去除,除非删除本用户组。公众用户组不能关联管理组,以免产生安全隐患', + 4 => 'usergroups_edit_system_dailyprice', + 5 => '收费公众用户组日价格', + 6 => '如果您需要用户支付相应的交易积分后才能加入本用户组,请在此输入本组的日购买价格,单位为交易积分所使用的单位。例如设置为 2,则用户购买为期 30 天的本组权限,需要支付 2*30=60 个交易积分,30 天有效期后该用户将自动从本组中退出。如设置为 0,则本组为免费公众用户组。注意: 本功能需要首先设定用户组为公众用户组且设置了有效的交易积分后才有效', + 7 => 'usergroups_edit_system_minspan', + 8 => '收费公众用户组一次最短购买时间(天)', + 9 => '设置用户在购买本组权限时,一次支付价值至少多少日的交易积分,请设置为大于等于 1 的数值。例如日价格为 2,最短购买时间为 10,则用户至少需要花费 2*10=20 个交易积分,获得至少 10 天本组权限,才能加入本组。注意: 本功能需要首先设定用户组为收费公众用户组才有效', + ), + ), + 290 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '基本设置' => 'action=usergroups&operation=edit&anchor=basic', + ), + 'text' => + array ( + 0 => '用户组 » 基本设置', + 1 => 'usergroups_edit_basic', + 2 => '基本设置', + 3 => 'usergroups_edit_basic_title', + 4 => '用户组头衔', + 5 => 'usergroups_icon', + 6 => '组图标', + 7 => 'usergroups_edit_basic_visit', + 8 => '访问站点权限', + 9 => '禁止访问: 禁止用户浏览本站任何页面正常访问: 当站点开放的时候,可以正常浏览页面超级访问: 即便站点关闭也可以访问,一般用于管理员或站内测试组', + 10 => 'usergroups_edit_basic_read_access', + 11 => '阅读权限', + 12 => '设置用户浏览文章或附件的权限级别,范围 0~255,0 为禁止用户浏览任何文章或附件。当用户的阅读权限小于文章或附件的阅读权限许可(默认时为 1)时,用户将不能阅读该文章或下载该附件', + 13 => 'usergroups_edit_basic_max_friend_number', + 14 => '最多好友数', + 15 => '0为无限', + 16 => 'usergroups_edit_basic_domain_length', + 17 => '二级域名最短长度', + 18 => '0为禁止使用二级域名,最大长度为15,在站点开启二级域名时有效', + 19 => 'usergroups_edit_basic_invisible', + 20 => '允许隐身', + 21 => '设置是否允许用户登录后不显示在在线列表中', + 22 => 'usergroups_edit_basic_allowtransfer', + 23 => '允许积分转账', + 24 => '设置是否允许用户在个人中心将自己的交易积分转让给其他用户。注意: 本功能需在 全局设置中启用交易积分后才可使用', + 25 => 'usergroups_edit_basic_allowfollow', + 26 => '允许用户收听他人', + 27 => '设置是否允许用户收听他人,避免收听类骚扰', + 28 => 'usergroups_edit_basic_allowsendpm', + 29 => '允许发送短消息', + 30 => '设置是否允许用户发送短消息', + 31 => 'usergroups_edit_pm_sendpmmaxnum', + 32 => '24小时内发布短消息最大数', + 33 => '设置该用户组用户24小时内发布短消息的最大数,有效的控制短消息发布广告的情况, 0为不限制', + 34 => 'usergroups_edit_pm_sendallpm', + 35 => '是否可以给任何人发短消息', + 36 => '选择否的话,当对方设置为只接受好友短消息,将无法对其发送短消息', + 37 => 'usergroups_edit_post_html', + 38 => '允许使用 HTML 代码', + 39 => '注意: 开放 HTML 功能将产生安全隐患,请慎用。建议只在十分必要的情况下使用,并限制只开放给最核心的管理人员', + 40 => 'usergroups_edit_post_url', + 41 => '允许发站外URL', + 42 => '是否允许发帖包含URL,合理的设置可以有效的减少广告帖的量', + 43 => 'usergroups_edit_basic_allow_statdata', + 44 => '允许查看站点统计', + 45 => 'usergroups_edit_basic_allowavatarupload', + 46 => '允许在本应用上传头像', + 47 => '设置是否允许该用户组在本应用上传头像。注意:本选项与强制用户上传头像同时开启时可能导致用户无法正常发布内容', + 48 => 'usergroups_edit_basic_allowviewprofile', + 49 => '允许用户浏览个人资料页', + 50 => '设置是否允许该用户组浏览其他用户的个人资料页', + 51 => 'usergroups_edit_basic_search_post', + 52 => '允许全文搜索', + 53 => '此设置只对搜索论坛有效。注意: 当数据量大时,全文搜索将非常耗费服务器资源,请慎用', + 54 => 'usergroups_edit_basic_search', + 55 => '允许使用搜索', + 56 => '选择您要为此用户组开启的搜索项目', + 57 => 'usergroups_edit_basic_reasonpm', + 58 => '操作理由短消息通知作者', + 59 => '设置用户在对他人评分或管理操作时是否强制输入理由和通知作者', + 60 => 'usergroups_edit_basic_cstatus', + 61 => '允许自定义头衔', + 62 => '设置是否允许用户设置自己的头衔名字并在文章中显示', + 63 => 'usergroups_edit_basic_disable_periodctrl', + 64 => '不受时间段限制', + 65 => '设置用户是否可以不受全局设置中设置的特殊时间段禁令限制', + 66 => 'usergroups_edit_basic_hour_threads', + 67 => '会员每小时发主题数限制', + 68 => '设置允许会员每小时最多的发主题数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效', + 69 => 'usergroups_edit_basic_hour_posts', + 70 => '会员每小时发回帖数限制', + 71 => '设置允许会员每小时最多的发回帖数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效', + 72 => 'usergroups_edit_basic_seccode', + 73 => '启用验证码或验证问答机制', + 74 => '开启验证机制可以防止灌水机等,但会增加用户操作易用度。修改密码不受此限制,开启验证码或验证问答后,该设置有效', + 75 => 'usergroups_edit_basic_forcesecques', + 76 => '强制设置安全提问', + 77 => '选择“是”则此用户组的用户在登录后台前必须设置安全提问后才可登录后台, config中为全局开关', + 78 => 'usergroups_edit_basic_forcelogin', + 79 => '安全登录方式', + 80 => '选择此用户组用户安全登录的方式', + 81 => 'usergroups_edit_basic_disable_postctrl', + 82 => '发表不受限制', + 83 => '设置发表是否不受灌水预防和最大字数等', + 84 => 'usergroups_edit_basic_ignore_censor', + 85 => '忽略需要审核的关键字', + 86 => '选择“是”则此用户组的用户在发表时不会触发需要审核的关键字', + 87 => 'usergroups_edit_basic_allowcreatecollection', + 88 => '允许用户创建淘专辑的数量', + 89 => '“0”表示不允许创建淘专辑', + 90 => 'usergroups_edit_basic_allowfollowcollection', + 91 => '最多允许关注淘专辑的数量', + 92 => '允许用户最多关注淘专辑的数量', + 93 => 'usergroups_edit_basic_close_ad', + 94 => '是否关闭广告展示', + 95 => '选择“是”则此用户组的用户在站点中看不到任何广告', + 96 => 'delete', + 97 => '删除', + 98 => 'usergroups_edit_post_url_banned', + 99 => '禁止发表', + 100 => 'usergroups_edit_post_url_mod', + 101 => '允许,但文章进入审核', + 102 => 'usergroups_edit_post_url_unhandle', + 103 => '允许,但不解析', + 104 => 'usergroups_edit_post_url_enable', + 105 => '允许,并正常解析', + 106 => 'usergroups_edit_basic_reasonpm_none', + 107 => '不强制', + 108 => 'usergroups_edit_basic_reasonpm_reason', + 109 => '强制输入理由', + 110 => 'usergroups_edit_basic_reasonpm_pm', + 111 => '强制通知作者', + 112 => 'usergroups_edit_basic_reasonpm_both', + 113 => '强制输入理由和通知作者', + 114 => 'usergroups_edit_basic_forcelogin_none', + 115 => '不开启', + 116 => 'usergroups_edit_basic_forcelogin_qq', + 117 => 'QQ登录', + 118 => 'usergroups_edit_basic_forcelogin_mail', + 119 => '邮箱登录', + ), + ), + 291 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '特殊主题' => 'action=usergroups&operation=edit&anchor=special', + ), + 'text' => + array ( + 0 => '用户组 » 特殊主题', + 1 => 'usergroups_edit_special', + 2 => '特殊主题', + 3 => 'usergroups_edit_special_activity', + 4 => '允许发起活动', + 5 => '选择“是”允许在论坛发布活动主题', + 6 => 'usergroups_edit_special_poll', + 7 => '允许发起投票', + 8 => '选择“是”允许在论坛发布投票主题', + 9 => 'usergroups_edit_special_vote', + 10 => '允许参与投票', + 11 => '选择“是”允许在论坛参与投票', + 12 => 'usergroups_edit_special_reward', + 13 => '允许发起悬赏', + 14 => '选择“是”允许在论坛发布悬赏主题,悬赏使用交易积分', + 15 => 'usergroups_edit_special_reward_min', + 16 => '最小悬赏积分', + 17 => '每笔悬赏最少悬赏积分(最小设置为 1)', + 18 => 'usergroups_edit_special_reward_max', + 19 => '最大悬赏积分', + 20 => '每笔悬赏最多悬赏的积分,最大可设置为 65535 (不限制请输入 0)', + 21 => 'usergroups_edit_special_trade', + 22 => '允许发布商品', + 23 => '选择“是”允许在论坛发布商品主题', + 24 => 'usergroups_edit_special_trade_min', + 25 => '最小交易金额', + 26 => '每笔交易的最小交易金额(单位:人民币元或积分单位,最小交易金额为 1 元)', + 27 => 'usergroups_edit_special_trade_max', + 28 => '最大交易金额', + 29 => '设置每笔交易所能设置的最大交易金额(单位:人民币元或积分单位,不限制请输入 0)', + 30 => 'usergroups_edit_special_trade_stick', + 31 => '商品主题最多推荐商品数', + 32 => '设置用户在每篇商品主题中最多推荐商品的数目', + 33 => 'usergroups_edit_special_debate', + 34 => '允许发起辩论', + 35 => '选择“是”允许在论坛发布辩论主题', + 36 => 'usergroups_edit_special_rushreply', + 37 => '允许发表抢楼帖', + 38 => '抢楼帖不允许用户删除回帖', + 39 => 'usergroups_edit_special_allowthreadplugin', + 40 => '允许发布扩展特殊主题', + 41 => '设置是否允许发表扩展的特殊主题', + ), + ), + 292 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '文章相关' => 'action=usergroups&operation=edit&anchor=post', + ), + 'text' => + array ( + 0 => '用户组 » 文章相关', + 1 => 'usergroups_edit_post', + 2 => '文章相关', + 3 => 'usergroups_edit_post_new', + 4 => '允许发新话题', + 5 => '设置是否允许发新话题。注意: 只有当用户组阅读权限高于 0 时,才能发新话题', + 6 => 'usergroups_edit_post_reply', + 7 => '允许发表回复', + 8 => '设置是否允许发表回复。注意: 只有当用户组阅读权限高于 0 时,才能发表回复', + 9 => 'usergroups_edit_post_direct', + 10 => '允许直接发帖', + 11 => '是否允许直接发帖或者对回复及主题进行审核,此设置受版块审核影响,如果版块设置为不需要审核,则此设置无效', + 12 => 'usergroups_edit_post_allow_down_remote_img', + 13 => '允许下载远程图片', + 14 => '远程图片本地化保存', + 15 => 'usergroups_edit_post_anonymous', + 16 => '允许发匿名帖', + 17 => '是否允许用户匿名发表主题和回复,只要用户组或本论坛允许,用户均可使用匿名发帖功能。匿名发帖不同于游客发帖,用户需要登录后才可使用,版主和管理员可以查看真实作者', + 18 => 'usergroups_edit_post_set_read_perm', + 19 => '允许设置文章权限', + 20 => '设置是否允许设置文章需要指定阅读权限才可浏览', + 21 => 'usergroups_edit_post_maxprice', + 22 => '主题(附件)最高售价', + 23 => '主题(附件)出售使得作者可以将自己发表的主题(附件)隐藏起来,只有当浏览者向作者支付相应的交易积分后才能查看主题(附件)内容。此处设置用户出售主题(附件)时允许设置的最高价格,0 为不允许用户出售。注意: 本功能需在 全局设置中启用交易积分后才可使用。如开启版主及管理员的出售主题(附件)功能,请将其最高价格设置为高于普通用户组允许的最高价格,这样在文章被编辑时不至于导致主题(附件)售价的硬性下调', + 24 => 'usergroups_edit_post_hide_code', + 25 => '允许使用 [hide] 代码', + 26 => '设置是否允许文章中使用 [hide] 隐藏标签', + 27 => 'usergroups_edit_post_mediacode', + 28 => '允许使用 [audio] [media] [flash] 等多媒体代码', + 29 => '设置是否允许 [audio] [media] [flash] 等多媒体代码', + 30 => 'usergroups_edit_post_begincode', + 31 => '允许使用 [begin] 代码', + 32 => '设置是否允许文章中使用 [begin] 开头动画标签', + 33 => 'usergroups_edit_post_sig_bbcode', + 34 => '允许签名中使用 Discuz! 代码', + 35 => '设置是否解析用户签名中的 Discuz! 代码', + 36 => 'usergroups_edit_post_sig_img_code', + 37 => '允许签名中使用 [img] 代码', + 38 => '设置是否解析用户签名中的 [img] 代码', + 39 => 'usergroups_edit_post_max_sig_size', + 40 => '签名文字最大长度', + 41 => '设置用户签名最大字节数,0 为不允许用户使用签名', + 42 => 'usergroups_edit_post_recommend', + 43 => '主题评价影响值', + 44 => '设置用户评价一次主题,对主题评价指数的影响,0 为不允许用户评价主题', + 45 => 'usergroups_edit_post_edit_time_limit', + 46 => '编辑文章时间限制(分钟)', + 47 => '文章作者发帖后超过此时间限制将不能再编辑帖,版主和管理员在 全局 - 用户权限 选择“允许用户随时编辑的文章类型”后不受此限制,0 为不限制', + 48 => 'usergroups_edit_post_allowreplycredit', + 49 => '允许设置回帖奖励', + 50 => '允许用户在发布主题时给予回帖者一定的扩展积分奖励。回帖奖励默认积分可在全局 - 积分设置指定', + 51 => 'usergroups_edit_post_tag', + 52 => '允许使用标签', + 53 => '设置是否允许发表新话题时使用标签', + 54 => 'usergroups_edit_post_allowcommentpost', + 55 => '文章直接点评', + 56 => '设置允许点评的范围,如不选择表示不启用点评功能注意:只有在 全局 - 站点功能 - 文章点评 中开启直接点评功能,本设置才会生效', + 57 => 'usergroups_edit_post_allowcommentreply', + 58 => '楼层回复点评', + 59 => '允许用户通过点击文章中的“回复”链接回复他人回帖时,自动对该楼层产生点评注意:只有在 全局 - 站点功能 - 文章点评 中开启楼层回复功能,本设置才会生效;点击主题中的“回复”链接,不会对主题产生点评', + 60 => 'usergroups_edit_post_allowcommentitem', + 61 => '允许用户在点评时发表观点', + 62 => '允许用户在点评时发表观点注意:只有在 全局 - 站点功能 - 文章点评 中开启直接点评功能,本设置才会生效', + 63 => 'usergroups_edit_post_allowat', + 64 => '发帖时可 @ 其他人的数量', + 65 => '0为不允许 @ 其他人(包括他关注的人和他的好友)', + 66 => 'usergroups_edit_post_allowsave', + 67 => '允许保存草稿', + 68 => '设置是否允许用户保存草稿', + 69 => 'usergroups_edit_post_allowsavereply', + 70 => '允许回复草稿', + 71 => '设置是否允许用户回复草稿(回复草稿不增加用户积分,但增加用户发帖数)', + 72 => 'usergroups_edit_post_allowsavenum', + 73 => '允许保存草稿的数量', + 74 => '设置为 0 为不限制用户保存草稿的数量(高流量站点不建议限制草稿数)', + 75 => 'usergroups_edit_post_allowsetpublishdate', + 76 => '允许设置定时发布', + 77 => '允许用户在发布主题时设置指定的发帖时间。只能设置在每半小时(如 13:00 或 13:30)自动发布。', + 78 => 'usergroups_edit_post_allowcommentcollection', + 79 => '允许评论淘专辑', + 80 => '允许用户在主题和淘专辑页面进行评论。', + 81 => 'usergroups_edit_post_allowimgcontent', + 82 => '允许主题内容生成图片', + 83 => '看帖时所有文章正文内容将以字符形式生成图片展示。', + 84 => 'usergroups_edit_attach', + 85 => '附件相关', + 86 => 'usergroups_edit_attach_get', + 87 => '允许下载附件', + 88 => '设置是否允许在没有设置特殊权限的论坛中下载附件', + 89 => 'usergroups_edit_attach_getimage', + 90 => '允许查看图片', + 91 => '设置是否允许在没有设置特殊权限的论坛中查看图片', + 92 => 'usergroups_edit_attach_post', + 93 => '允许上传附件', + 94 => '设置是否允许上传附件到没有设置特殊权限的论坛中。需要 PHP 设置允许才有效,请参考管理中心首页', + 95 => 'usergroups_edit_attach_set_perm', + 96 => '允许设置附件权限', + 97 => '设置是否允许设置附件需要指定积分以上才可下载', + 98 => 'usergroups_edit_image_post', + 99 => '允许上传图片', + 100 => '设置是否允许上传图片到没有设置特殊权限的论坛中。需要 PHP 设置允许才有效,请参考管理中心首页', + 101 => 'usergroups_edit_attach_max_size', + 102 => '论坛最大附件尺寸(单位K 1M=1024K)', + 103 => '设置附件最大尺寸(单位K 1M=1024K),0 为不限制,需要 PHP 设置允许才有效,请参考管理中心首页', + 104 => 'usergroups_edit_attach_max_size_per_day', + 105 => '每天最大附件总尺寸(单位K 1M=1024K)', + 106 => '设置用户每天可以上传的附件总量(单位K 1M=1024K),0 为不限制', + 107 => 'usergroups_edit_attach_max_number_per_day', + 108 => '每天最大附件数量', + 109 => '设置用户每天可以上传的附件数量,0 为不限制', + 110 => 'usergroups_edit_attach_ext', + 111 => '允许附件类型', + 112 => '设置允许上传的附件扩展名,多个扩展名之间用半角逗号 "," 隔开,留空为不限制', + 113 => 'usergroups_edit_post_direct_none', + 114 => '全部需要审核', + 115 => 'usergroups_edit_post_direct_reply', + 116 => '发新回复不需要审核', + 117 => 'usergroups_edit_post_direct_thread', + 118 => '发新主题不需要审核', + 119 => 'usergroups_edit_post_direct_all', + 120 => '全部不需要审核', + 121 => 'usergroups_edit_post_allowcommentpost_firstpost', + 122 => '点评主题', + 123 => 'usergroups_edit_post_allowcommentpost_reply', + 124 => '点评回复', + ), + ), + 293 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '道具相关' => 'action=usergroups&operation=edit&anchor=magic', + ), + 'text' => + array ( + 0 => '用户组 » 道具相关', + 1 => 'usergroups_edit_magic', + 2 => '道具相关', + 3 => 'usergroups_edit_magic_permission', + 4 => '允许使用道具', + 5 => '是否允许使用道具,包括买卖、赠送的权限', + 6 => 'usergroups_edit_magic_discount', + 7 => '购买道具折扣', + 8 => '购买道具的折扣值,范围 1~9 数值越小折扣越多,0 为不享受折扣', + 9 => 'usergroups_edit_magic_max', + 10 => '道具包容量', + 11 => '本组用户带有道具的最大重量,范围 0~60000', + 12 => 'usergroups_edit_magic_unallowed', + 13 => '不允许使用、购买和转让', + 14 => 'usergroups_edit_magic_allow', + 15 => '允许使用、购买', + 16 => 'usergroups_edit_magic_allow_and_pass', + 17 => '允许使用、购买和转让', + ), + ), + 294 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '注册相关' => 'action=usergroups&operation=edit&anchor=invite', + ), + 'text' => + array ( + 0 => '用户组 » 注册相关', + 1 => 'usergroups_edit_invite', + 2 => '注册相关', + 3 => 'usergroups_edit_invite_permission', + 4 => '允许购买邀请码', + 5 => '是否允许购买邀请码的权限', + 6 => 'usergroups_edit_invite_send_permission', + 7 => '允许发送邀请注册', + 8 => '是否允许通过站点邮件系统发送邀请码', + 9 => 'usergroups_edit_invite_price', + 10 => '邀请码购买价格', + 11 => '该用户组的会员购买邀请码的价格', + 12 => 'usergroups_edit_invite_buynum', + 13 => '24小时内购买邀请码最大数量', + 14 => '该用户组24小时内购买邀请码的最大数量,超过此数量将不能购买新的邀请码', + 15 => 'usergroups_edit_invite_maxinviteday', + 16 => '邀请码有效期', + 17 => '该用户组购买邀请码的最大有效期,超过此有效期验证码将自动失效,单位为天,默认为10', + ), + ), + 295 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '积分相关' => 'action=usergroups&operation=edit&anchor=credit', + ), + 'text' => + array ( + 0 => '用户组 » 积分相关', + 1 => 'usergroups_edit_credit', + 2 => '积分相关', + 3 => 'usergroups_edit_credit_exempt_sendpm', + 4 => '发短消息不扣积分', + 5 => 'usergroups_edit_credit_exempt_search', + 6 => '搜索不扣积分', + 7 => 'usergroups_edit_credit_exempt_getattch', + 8 => '下载附件不扣积分', + 9 => 'usergroups_edit_credit_exempt_attachpay', + 10 => '可直接下载收费附件', + 11 => 'usergroups_edit_credit_exempt_threadpay', + 12 => '可直接查看收费主题', + 13 => 'usergroups_edit_credit_allowrate', + 14 => '允许参与评分', + 15 => 'usergroups_edit_credit_exempt_outperm', + 16 => '管辖版块外', + 17 => 'usergroups_edit_credit_exempt_inperm', + 18 => '管辖版块内', + 19 => 'usergroups_edit_credit_exempt_comment', + 20 => '以上项目中,选择“是”表示本组用户将不执行相应的扣积分操作,选择“否”将使用论坛默认或版块设定的规则', + 21 => 'name', + 22 => '名称', + 23 => 'usergroups_edit_credit_rate_tips', + 24 => '当选中扣除自身积分后,前台用户评分时会扣除用户的相应积分,否则扣除的系统积分', + ), + ), + 296 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '空间相关' => 'action=usergroups&operation=edit&anchor=home', + ), + 'text' => + array ( + 0 => '用户组 » 空间相关', + 1 => 'usergroups_edit_home', + 2 => '空间相关', + 3 => 'usergroups_edit_attach_max_space_size', + 4 => '空间大小(单位M)', + 5 => '设置最大空间尺寸(单位M),0 为不限制', + 6 => 'usergroups_edit_home_allow_blog', + 7 => '发表日志', + 8 => 'usergroups_edit_home_allow_blog_mod', + 9 => '发表日志需要审核', + 10 => 'usergroups_edit_home_allow_doing', + 11 => '发表记录', + 12 => 'usergroups_edit_home_allow_doing_mod', + 13 => '发表记录需要审核', + 14 => 'usergroups_edit_home_allow_upload', + 15 => '上传图片', + 16 => 'usergroups_edit_home_allow_upload_mod', + 17 => '上传图片需要审核', + 18 => 'usergroups_edit_home_image_max_size', + 19 => '相册单张图片最大尺寸(单位K 1M=1024K)', + 20 => '设置相册单张图片最大尺寸(单位K 1M=1024K),0 为不限制,需要 PHP 设置允许才有效,请参考管理中心首页', + 21 => 'usergroups_edit_home_allow_share', + 22 => '发布分享', + 23 => 'usergroups_edit_home_allow_share_mod', + 24 => '发布分享需要审核', + 25 => 'usergroups_edit_home_allow_comment', + 26 => '发表留言/评论', + 27 => 'usergroups_edit_home_allow_comment_mod', + 28 => '留言/评论评论需要审核', + 29 => '设置此用户组发表留言/评论强制审核,关闭时仅命中审核敏感词时才审核', + 30 => 'usergroups_edit_home_allow_poke', + 31 => '允许打招呼', + 32 => 'usergroups_edit_home_allow_friend', + 33 => '允许加好友', + 34 => 'usergroups_edit_home_allow_click', + 35 => '允许表态', + 36 => 'usergroups_edit_home_allow_space_diy_html', + 37 => '允许自定义模块使用 HTML', + 38 => '注意: 开放 HTML 功能将产生安全隐患,请慎用。建议只在十分必要的情况下使用,并限制只开放给最核心的管理人员', + 39 => 'usergroups_edit_home_allow_space_diy_bbcode', + 40 => '允许自定义模块使用 BBCODE', + 41 => '设置是否解析个人主页自定义模块中的 BBCODE 代码', + 42 => 'usergroups_edit_home_allow_space_diy_imgcode', + 43 => '允许自定义模块使用 [img]', + 44 => '设置是否解析个人主页自定义模块中的 [img] 代码', + ), + ), + 297 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '圈子相关' => 'action=usergroups&operation=edit&anchor=group', + ), + 'text' => + array ( + 0 => '用户组 » 圈子相关', + 1 => 'usergroups_edit_group', + 2 => '圈子相关', + 3 => 'usergroups_edit_group_build', + 4 => '允许建立圈子的数量', + 5 => '范围1-255,0为不允许建立圈子', + 6 => 'usergroups_edit_group_buildcredits', + 7 => '创建圈子消耗积分', + 8 => '创建圈子需要消耗和积分数量,0为不需要积分', + 9 => 'usergroups_edit_post_direct_group', + 10 => '允许直接发帖', + 11 => 'usergroups_edit_post_url_group', + 12 => '允许发站外URL', + 13 => 'usergroups_edit_post_direct_none', + 14 => '全部需要审核', + 15 => 'usergroups_edit_post_direct_reply', + 16 => '发新回复不需要审核', + 17 => 'usergroups_edit_post_direct_thread', + 18 => '发新主题不需要审核', + 19 => 'usergroups_edit_post_direct_all', + 20 => '全部不需要审核', + 21 => 'usergroups_edit_post_url_banned', + 22 => '禁止发表', + 23 => 'usergroups_edit_post_url_mod', + 24 => '允许,但文章进入审核', + 25 => 'usergroups_edit_post_url_unhandle', + 26 => '允许,但不解析', + 27 => 'usergroups_edit_post_url_enable', + 28 => '允许,并正常解析', + ), + ), + 298 => + array ( + 'index' => + array ( + '用户组' => 'action=usergroups', + '门户相关' => 'action=usergroups&operation=edit&anchor=portal', + ), + 'text' => + array ( + 0 => '用户组 » 门户相关', + 1 => 'usergroups_edit_portal', + 2 => '门户相关', + 3 => 'usergroups_edit_portal_allow_comment_article', + 4 => '文章评论字数', + 5 => '设置此用户组发表文章评论字数限制,设置为0将禁止此用户组发表评论', + 6 => 'usergroups_edit_portal_allow_comment_article_mod', + 7 => '文章评论需要审核', + 8 => '设置此用户组发表文章评论强制审核,关闭时仅命中审核敏感词时才审核', + 9 => 'usergroups_edit_portal_allow_post_article', + 10 => '发布文章', + 11 => 'usergroups_edit_portal_allow_down_local_img', + 12 => '允许下载本地图片', + 13 => '下载远程图片的同时允许重新生成一份本地图片', + 14 => 'usergroups_edit_portal_allow_post_article_moderate', + 15 => '发布文章需要审核', + ), + ), + 299 => + array ( + 'index' => + array ( + '用户标签' => 'action=usertag', + ), + 'text' => + array ( + 0 => '用户标签', + 1 => 'usertag_add_tips', + 2 => '可以给线下活动的用户批量贴标签当只填写了标签,用户列表为空时,是批量添加用户标签如果标签和用户列表都有输入,说明是给指定用户批量贴标签', + 3 => 'usertag_add_tags', + 4 => '标签', + 5 => '可以输入多个标签,多个标签可以用空格、逗号 分隔', + 6 => 'usertag_add_usernames', + 7 => '用户列表', + 8 => '可以输入多个用户,每行输入一个用户名', + 9 => 'keywords', + 10 => '关键词', + 11 => 'search', + 12 => '搜索', + 13 => 'view', + 14 => '查看', + 15 => 'usertag_user', + 16 => '用户', + 17 => 'usertag_send_notice', + 18 => '发通知', + ), + ), +); + +?> \ No newline at end of file diff --git a/source/language/lang_blockclass.php b/source/language/lang_blockclass.php new file mode 100644 index 0000000..422cf09 --- /dev/null +++ b/source/language/lang_blockclass.php @@ -0,0 +1,458 @@ + '展示类', + + 'blockclass_html_html' => '静态模块', + 'blockclass_html_script_blank' => '自定义HTML', + 'blockclass_html_script_search' => '搜索条', + 'blockclass_html_script_line' => '分割线', + 'blockclass_html_script_banner' => '图片横幅', + 'blockclass_html_script_vedio' => '网络视频', + 'blockclass_html_script_stat' => '数据统计', + 'blockclass_html_script_forumtree' => '版块列表', + 'blockclass_html_script_google' => 'GOOGLE', + 'blockclass_html_script_adv' => '站点广告', + 'blockclass_html_script_friendlink' => '友情链接', + 'blockclass_html_script_sort' => '分类信息', + 'blockclass_html_script_category' => '分类信息', + + 'blockclass_html_announcement' => '公告模块', + 'blockclass_announcement_field_url' => '公告链接', + 'blockclass_announcement_field_title' => '公告标题', + 'blockclass_announcement_field_summary' => '公告内容', + 'blockclass_announcement_field_starttime' => '开始时间', + 'blockclass_announcement_field_endtime' => '结束时间', + 'blockclass_announcement_script_announcement' => '站点公告', + + 'blockclass_forum' => '论坛类', + + 'blockclass_forum_thread' => '文章模块', + 'blockclass_thread_field_url' => '文章URL', + 'blockclass_thread_field_title' => '文章标题', + 'blockclass_thread_field_pic' => '附件图片', + 'blockclass_thread_field_summary' => '文章内容', + 'blockclass_thread_field_author' => '楼主', + 'blockclass_thread_field_authorid' => '楼主UID', + 'blockclass_thread_field_avatar' => '楼主头像', + 'blockclass_thread_field_avatar_middle' => '楼主头像(中)', + 'blockclass_thread_field_avatar_big' => '楼主头像(大)', + 'blockclass_thread_field_forumurl' => '版块URL', + 'blockclass_thread_field_forumname' => '版块名称', + 'blockclass_thread_field_typename' => '主题分类名称', + 'blockclass_thread_field_typeicon' => '主题分类图标', + 'blockclass_thread_field_typeurl' => '主题分类URL', + 'blockclass_thread_field_sortname' => '分类信息名称', + 'blockclass_thread_field_sorturl' => '分类信息URL', + 'blockclass_thread_field_posts' => '总发帖数', + 'blockclass_thread_field_todayposts' => '今日发帖数', + 'blockclass_thread_field_lastposter' => '最后回复作者', + 'blockclass_thread_field_lastpost' => '最后回复时间', + 'blockclass_thread_field_dateline' => '发帖时间', + 'blockclass_thread_field_replies' => '回复数', + 'blockclass_thread_field_views' => '总浏览数', + 'blockclass_thread_field_heats' => '热度值', + 'blockclass_thread_field_recommends' => '推荐数', + 'blockclass_thread_field_hourviews' => '小时浏览数', + 'blockclass_thread_field_todayviews' => '今日浏览数', + 'blockclass_thread_field_weekviews' => '本周浏览数', + 'blockclass_thread_field_monthviews' => '本月浏览数', + 'blockclass_thread_script_threaddigest' => '精华帖', + 'blockclass_thread_script_threadhot' => '热门帖', + 'blockclass_thread_script_threadstick' => '置顶帖', + 'blockclass_thread_script_threadspecial' => '特殊主题帖', + 'blockclass_thread_script_threadnew' => '最新帖', + 'blockclass_thread_script_threadspecified' => '指定文章', + 'blockclass_thread_script_thread' => '高级自定义', + + 'blockclass_forum_forum' => '版块模块', + 'blockclass_forum_field_title' => '版块名称', + 'blockclass_forum_field_url' => '版块链接', + 'blockclass_forum_field_summary' => '版块介绍', + 'blockclass_forum_field_icon' => '版块图标', + 'blockclass_forum_field_posts' => '版块文章数', + 'blockclass_forum_field_threads' => '版块话题数', + 'blockclass_forum_field_todayposts' => '版块今日新帖数', + 'blockclass_forum_script_forum' => '论坛版块', + + 'blockclass_sort_sort' => '分类信息', + 'blockclass_sort_field_title' => '文章名称', + 'blockclass_sort_field_url' => '文章链接', + 'blockclass_sort_field_summary' => '文章介绍', + 'blockclass_sort_script_sort' => '高级自定义', + + 'blockclass_forum_trade' => '商品模块', + 'blockclass_trade_trade' => '商品模块', + 'blockclass_trade_field_title' => '商品名称', + 'blockclass_trade_field_url' => '商品链接', + 'blockclass_trade_field_summary' => '商品说明', + 'blockclass_trade_field_pic' => '商品图片地址', + 'blockclass_trade_field_totalitems' => '商品累计售出数', + 'blockclass_trade_field_author' => '商品卖家', + 'blockclass_trade_field_authorid' => '商品卖家UID', + 'blockclass_trade_field_price' => '商品价格', + 'blockclass_trade_script_tradenew' => '新商品', + 'blockclass_trade_script_tradehot' => '热门商品', + 'blockclass_trade_script_tradespecified' => '指定商品', + 'blockclass_trade_script_trade' => '高级自定义', + + 'blockclass_forum_activity' => '活动模块', + 'blockclass_activity_activity' => '活动模块', + 'blockclass_activity_field_url' => '活动帖URL', + 'blockclass_activity_field_title' => '活动标题', + 'blockclass_activity_field_pic' => '主题图片', + 'blockclass_activity_field_summary' => '活动介绍', + 'blockclass_activity_field_time' => '活动时间', + 'blockclass_activity_field_expiration' => '报名截止时间', + 'blockclass_activity_field_author' => '发起人', + 'blockclass_activity_field_authorid' => '发起人UID', + 'blockclass_activity_field_cost' => '每人花销', + 'blockclass_activity_field_place' => '活动地点', + 'blockclass_activity_field_class' => '活动类型', + 'blockclass_activity_field_gender' => '性别要求', + 'blockclass_activity_field_number' => '需要人数', + 'blockclass_activity_field_applynumber' => '已报名人数', + 'blockclass_activity_script_activitynew' => '最新活动', + 'blockclass_activity_script_activitycity' => '同城活动', + 'blockclass_activity_script_activity' => '高级自定义', + + 'blockclass_portal' => '门户类', + + 'blockclass_portal_article' => '文章模块', + 'blockclass_article_field_url' => '文章链接', + 'blockclass_article_field_title' => '文章标题', + 'blockclass_article_field_pic' => '文章封面', + 'blockclass_article_field_summary' => '文章简介', + 'blockclass_article_field_dateline' => '发布时间', + 'blockclass_article_field_uid' => '作者UID', + 'blockclass_article_field_username' => '作者名', + 'blockclass_article_field_avatar' => '用户头像', + 'blockclass_article_field_avatar_middle' => '用户头像(中)', + 'blockclass_article_field_avatar_big' => '用户头像(大)', + 'blockclass_article_field_caturl' => '栏目链接', + 'blockclass_article_field_catname' => '栏目名称', + 'blockclass_article_field_fromurl' => '来源地址', + 'blockclass_article_field_from' => '文章来源', + 'blockclass_article_field_viewnum' => '查看数', + 'blockclass_article_field_articles' => '文章数', + 'blockclass_article_field_commentnum' => '评论数', + 'blockclass_article_script_articlenew' => '最新文章', + 'blockclass_article_script_articlehot' => '热门文章', + 'blockclass_article_script_articlespecified' => '指定文章', + 'blockclass_article_script_article' => '高级自定义', + + 'blockclass_portal_category' => '文章栏目', + 'blockclass_category_field_url' => '栏目链接', + 'blockclass_category_field_title' => '栏目名称', + 'blockclass_category_field_articles' => '文章数', + 'blockclass_category_script_portalcategory' => '文章栏目', + + 'blockclass_portal_topic' => '专题模块', + 'blockclass_topic_field_url' => '专题链接', + 'blockclass_topic_field_title' => '专题名称', + 'blockclass_topic_field_pic' => '专题封面', + 'blockclass_topic_field_summary' => '专题介绍', + 'blockclass_topic_field_uid' => '创建者UID', + 'blockclass_topic_field_username' => '创建者', + 'blockclass_topic_field_dateline' => '创建时间', + 'blockclass_topic_field_viewnum' => '查看数', + 'blockclass_topic_script_topicnew' => '最新专题', + 'blockclass_topic_script_topichot' => '热门专题', + 'blockclass_topic_script_topicspecified' => '指定专题', + 'blockclass_topic_script_topic' => '高级自定义', + 'blockclass_member' => '会员类', + + 'blockclass_member_member' => '会员模块', + 'blockclass_member_field_url' => '空间链接', + 'blockclass_member_field_title' => '用户名', + 'blockclass_member_field_avatar' => '用户头像', + 'blockclass_member_field_avatar_middle' => '用户头像(中)', + 'blockclass_member_field_avatar_big' => '用户头像(大)', + 'blockclass_member_field_credits' => '积分数', + 'blockclass_member_field_reason' => '推荐原因', + 'blockclass_member_field_unitprice' => '竟价单次访问单价', + 'blockclass_member_field_showcredit' => '竟价总积分', + 'blockclass_member_field_shownote' => '竟价上榜宣言', + 'blockclass_member_field_extcredits1' => '扩展积分1', + 'blockclass_member_field_extcredits2' => '扩展积分2', + 'blockclass_member_field_extcredits3' => '扩展积分3', + 'blockclass_member_field_extcredits4' => '扩展积分4', + 'blockclass_member_field_extcredits5' => '扩展积分5', + 'blockclass_member_field_extcredits6' => '扩展积分6', + 'blockclass_member_field_extcredits7' => '扩展积分7', + 'blockclass_member_field_extcredits8' => '扩展积分8', + 'blockclass_member_field_gender' => '性别', + 'blockclass_member_field_birthday' => '出生日期', + 'blockclass_member_field_constellation' => '星座', + 'blockclass_member_field_zodiac' => '生肖', + 'blockclass_member_field_telephone' => '固定电话', + 'blockclass_member_field_mobile' => '手机', + 'blockclass_member_field_idcardtype' => '证件号类型', + 'blockclass_member_field_idcard' => '证件号', + 'blockclass_member_field_address' => '邮寄地址', + 'blockclass_member_field_zipcode' => '邮编', + 'blockclass_member_field_nationality' => '国籍', + 'blockclass_member_field_birthcity' => '出生城市', + 'blockclass_member_field_residecity' => '居住城市', + 'blockclass_member_field_residedist' => '居住县', + 'blockclass_member_field_residecommunity' => '居住小区', + 'blockclass_member_field_residesuite' => '房间', + 'blockclass_member_field_graduateschool' => '毕业学校', + 'blockclass_member_field_education' => '学历', + 'blockclass_member_field_occupation' => '职业', + 'blockclass_member_field_company' => '公司', + 'blockclass_member_field_position' => '职位', + 'blockclass_member_field_revenue' => '年收入', + 'blockclass_member_field_affectivestatus' => '情感状态', + 'blockclass_member_field_lookingfor' => '交友目的', + 'blockclass_member_field_bloodtype' => '血型', + 'blockclass_member_field_height' => '身高', + 'blockclass_member_field_weight' => '体重', + 'blockclass_member_field_alipay' => '支付宝账号', + 'blockclass_member_field_icq' => 'ICQ号', + 'blockclass_member_field_qq' => 'QQ号', + 'blockclass_member_field_yahoo' => 'YAHOO账号', + 'blockclass_member_field_msn' => 'MSN账号', + 'blockclass_member_field_taobao' => '阿里旺旺账号', + 'blockclass_member_field_site' => '个人主页', + 'blockclass_member_field_bio' => '自我介绍', + 'blockclass_member_field_interest' => '兴趣爱好', + 'blockclass_member_field_field1' => '自定义字段1', + 'blockclass_member_field_field2' => '自定义字段2', + 'blockclass_member_field_field3' => '自定义字段3', + 'blockclass_member_field_field4' => '自定义字段4', + 'blockclass_member_field_field5' => '自定义字段5', + 'blockclass_member_field_field6' => '自定义字段6', + 'blockclass_member_field_field7' => '自定义字段7', + 'blockclass_member_field_field8' => '自定义字段8', + 'blockclass_member_field_posts' => '发帖数', + 'blockclass_member_field_threads' => '主题数', + 'blockclass_member_field_digestposts' => '精华帖数', + 'blockclass_member_field_regdate' => '注册时间', + 'blockclass_member_field_hourposts' => '小时发帖数', + 'blockclass_member_field_todayposts' => '今日发帖数', + 'blockclass_member_field_weekposts' => '本周发帖数', + 'blockclass_member_field_monthposts' => '本月发帖数', + 'blockclass_member_script_membernew' => '新会员', + 'blockclass_member_script_memberspecial' => '特殊会员', + 'blockclass_member_script_membercredit' => '积分排行', + 'blockclass_member_script_membershow' => '竞价排行', + 'blockclass_member_script_memberposts' => '发帖排行', + 'blockclass_member_script_memberspecified' => '指定用户', + 'blockclass_member_script_member' => '高级自定义', + 'blockclass_space' => '空间类', + + 'blockclass_space_doing' => '记录模块', + 'blockclass_doing_field_url' => '记录链接', + 'blockclass_doing_field_title' => '记录内容', + 'blockclass_doing_field_uid' => '用户UID', + 'blockclass_doing_field_username' => '用户名', + 'blockclass_doing_field_avatar' => '用户头像', + 'blockclass_doing_field_avatar_middle' => '用户头像(中)', + 'blockclass_doing_field_avatar_big' => '用户头像(大)', + 'blockclass_doing_field_dateline' => '发布时间', + 'blockclass_doing_field_replynum' => '回复数', + 'blockclass_doing_script_doingnew' => '最新记录', + 'blockclass_doing_script_doinghot' => '热门记录', + 'blockclass_doing_script_doing' => '高级自定义', + + 'blockclass_space_blog' => '日志模块', + 'blockclass_blog_field_url' => '日志链接', + 'blockclass_blog_field_title' => '日志标题', + 'blockclass_blog_field_pic' => '日志图片', + 'blockclass_blog_field_summary' => '日志简介', + 'blockclass_blog_field_dateline' => '发布时间', + 'blockclass_blog_field_uid' => '作者UID', + 'blockclass_blog_field_username' => '作者名', + 'blockclass_blog_field_avatar' => '用户头像', + 'blockclass_blog_field_avatar_middle' => '用户头像(中)', + 'blockclass_blog_field_avatar_big' => '用户头像(大)', + 'blockclass_blog_field_replynum' => '评论数', + 'blockclass_blog_field_viewnum' => '浏览数', + 'blockclass_blog_field_click1' => '表态项1', + 'blockclass_blog_field_click2' => '表态项2', + 'blockclass_blog_field_click3' => '表态项3', + 'blockclass_blog_field_click4' => '表态项4', + 'blockclass_blog_field_click5' => '表态项5', + 'blockclass_blog_field_click6' => '表态项6', + 'blockclass_blog_field_click7' => '表态项7', + 'blockclass_blog_field_click8' => '表态项8', + 'blockclass_blog_script_blognew' => '最新日志', + 'blockclass_blog_script_bloghot' => '热门日志', + 'blockclass_blog_script_blogspecified' => '指定日志', + 'blockclass_blog_script_blog' => '高级自定义', + + 'blockclass_space_album' => '相册模块', + 'blockclass_album_field_url' => '相册链接', + 'blockclass_album_field_title' => '相册名称', + 'blockclass_album_field_pic' => '相册封面', + 'blockclass_album_field_dateline' => '创建日期', + 'blockclass_album_field_updatetime' => '更新日期', + 'blockclass_album_field_username' => '用户名', + 'blockclass_album_field_uid' => '用户UID', + 'blockclass_album_field_picnum' => '照片数', + 'blockclass_album_script_albumnew' => '最新相册', + 'blockclass_album_script_albumspecified' => '指定相册', + 'blockclass_album_script_album' => '高级自定义', + + 'blockclass_space_pic' => '图片模块', + 'blockclass_pic_field_url' => '图片链接', + 'blockclass_pic_field_title' => '图片名称', + 'blockclass_pic_field_pic' => '图片地址', + 'blockclass_pic_field_summary' => '图片说明', + 'blockclass_pic_field_dateline' => '上传时间', + 'blockclass_pic_field_username' => '用户名', + 'blockclass_pic_field_uid' => '用户UID', + 'blockclass_pic_field_viewnum' => '查看数', + 'blockclass_pic_field_click1' => '表态项1', + 'blockclass_pic_field_click2' => '表态项2', + 'blockclass_pic_field_click3' => '表态项3', + 'blockclass_pic_field_click4' => '表态项4', + 'blockclass_pic_field_click5' => '表态项5', + 'blockclass_pic_field_click6' => '表态项6', + 'blockclass_pic_field_click7' => '表态项7', + 'blockclass_pic_field_click8' => '表态项8', + 'blockclass_pic_script_picnew' => '最新图片', + 'blockclass_pic_script_pichot' => '热门图片', + 'blockclass_pic_script_picspecified' => '指定图片', + 'blockclass_pic_script_pic' => '高级自定义', + 'blockclass_group' => '圈子类', + + 'blockclass_group_group' => '圈子模块', + 'blockclass_group_field_url' => '圈子链接', + 'blockclass_group_field_title' => '圈子名称', + 'blockclass_group_field_pic' => '圈子图片', + 'blockclass_group_field_summary' => '圈子介绍', + 'blockclass_group_field_foundername' => '创始人', + 'blockclass_group_field_founderuid' => '创始人UID', + 'blockclass_group_field_icon' => '圈子图标', + 'blockclass_group_field_threads' => '总话题数', + 'blockclass_group_field_posts' => '总发帖数', + 'blockclass_group_field_todayposts' => '今日发帖数', + 'blockclass_group_field_membernum' => '成员数', + 'blockclass_group_field_dateline' => '创建时间', + 'blockclass_group_field_level' => '圈子等级', + 'blockclass_group_field_commoncredits' => '圈子公共积分', + 'blockclass_group_field_activity' => '圈子活跃度', + 'blockclass_group_script_groupnew' => '最新圈子', + 'blockclass_group_script_grouphot' => '热门圈子', + 'blockclass_group_script_groupspecified' => '指定圈子', + 'blockclass_group_script_group' => '高级自定义', + + 'blockclass_group_thread' => '圈子文章', + 'blockclass_groupthread_field_url' => '文章链接', + 'blockclass_groupthread_field_title' => '文章标题', + 'blockclass_groupthread_field_pic' => '附件图片', + 'blockclass_groupthread_field_summary' => '文章内容', + 'blockclass_groupthread_field_icon' => '文章图标', + 'blockclass_groupthread_field_author' => '楼主', + 'blockclass_groupthread_field_authorid' => '楼主UID', + 'blockclass_groupthread_field_avatar' => '楼主头像', + 'blockclass_groupthread_field_avatar_middle' => '楼主头像(中)', + 'blockclass_groupthread_field_avatar_big' => '楼主头像(大)', + 'blockclass_groupthread_field_posts' => '主题文章总数', + 'blockclass_groupthread_field_todayposts' => '主题今日文章数', + 'blockclass_groupthread_field_lastpost' => '主题最后发帖时间', + 'blockclass_groupthread_field_dateline' => '主题发布时间', + 'blockclass_groupthread_field_replies' => '主题回复数', + 'blockclass_groupthread_field_views' => '主题查看数', + 'blockclass_groupthread_field_heats' => '主题热度', + 'blockclass_groupthread_field_recommends' => '主题推荐数', + 'blockclass_groupthread_field_groupname' => '圈子名称', + 'blockclass_groupthread_field_groupurl' => '圈子链接', + 'blockclass_groupthread_script_groupthreadnew' => '新主题', + 'blockclass_groupthread_script_groupthreadhot' => '热门主题', + 'blockclass_groupthread_script_groupthreadspecial' => '特殊主题', + 'blockclass_groupthread_script_groupthreadspecified' => '指定主题', + 'blockclass_groupthread_script_groupthread' => '高级自定义', + + 'blockclass_group_trade' => '圈子商品', + 'blockclass_grouptrade_field_title' => '商品名称', + 'blockclass_grouptrade_field_url' => '商品链接', + 'blockclass_grouptrade_field_summary' => '商品说明', + 'blockclass_grouptrade_field_pic' => '商品图片地址', + 'blockclass_grouptrade_field_totalitems' => '商品累计售出数', + 'blockclass_grouptrade_field_author' => '商品卖家', + 'blockclass_grouptrade_field_authorid' => '商品卖家UID', + 'blockclass_grouptrade_field_price' => '商品价格', + 'blockclass_grouptrade_script_grouptradenew' => '新商品', + 'blockclass_grouptrade_script_grouptradehot' => '热门商品', + 'blockclass_grouptrade_script_grouptradespecified' => '指定商品', + 'blockclass_grouptrade_script_grouptrade' => '高级自定义', + + 'blockclass_group_groupactivity' => '圈子活动', + 'blockclass_group_activity' => '圈子活动', + 'blockclass_groupactivity_field_url' => '活动帖URL', + 'blockclass_groupactivity_field_title' => '活动标题', + 'blockclass_groupactivity_field_pic' => '主题图片', + 'blockclass_groupactivity_field_summary' => '活动介绍', + 'blockclass_groupactivity_field_time' => '活动时间', + 'blockclass_groupactivity_field_expiration' => '报名截止时间', + 'blockclass_groupactivity_field_author' => '发起人', + 'blockclass_groupactivity_field_authorid' => '发起人UID', + 'blockclass_groupactivity_field_cost' => '每人花销', + 'blockclass_groupactivity_field_place' => '活动地点', + 'blockclass_groupactivity_field_class' => '活动类型', + 'blockclass_groupactivity_field_gender' => '性别要求', + 'blockclass_groupactivity_field_number' => '需要人数', + 'blockclass_groupactivity_field_applynumber' => '已报名人数', + 'blockclass_groupactivity_script_groupactivitynew' => '最新活动', + 'blockclass_groupactivity_script_groupactivitycity' => '同城活动', + 'blockclass_groupactivity_script_groupactivity' => '高级自定义', + + 'blockclass_xml' => '第三方类', + + 'blockclass_other' => '其它类', + 'blockclass_other_script_friendlink' => '高级自定义', + 'blockclass_other_friendlink' => '友情链接', + 'blockclass_other_friendlink_field_url' => '站点URL', + 'blockclass_other_friendlink_field_title' => '站点名称', + 'blockclass_other_friendlink_field_pic' => '站点LOGO', + 'blockclass_other_friendlink_field_summary' => '站点简介', + + 'blockclass_other_script_stat' => '高级自定义', + 'blockclass_other_stat' => '统计模块', + 'blockclass_other_stat_posts' => '发帖总数', + 'blockclass_other_stat_groups' => '圈子总数', + 'blockclass_other_stat_members' => '会员总数', + 'blockclass_other_stat_groupnewposts' => '圈子今日发帖', + 'blockclass_other_stat_bbsnewposts' => '论坛今日发帖数', + 'blockclass_other_stat_bbslastposts' => '论坛昨日发帖数', + 'blockclass_other_stat_onlinemembers' => '当前在线会员数', + 'blockclass_other_stat_maxmembers' => '历史最高在线会员数', + 'blockclass_other_stat_doings' => '动态数', + 'blockclass_other_stat_blogs' => '日志数', + 'blockclass_other_stat_albums' => '相册数', + 'blockclass_other_stat_pics' => '图片数', + 'blockclass_other_stat_shares' => '分享数', + + 'blockclass_other_stat_posts_title' => '文章显示名', + 'blockclass_other_stat_groups_title' => '圈子显示名', + 'blockclass_other_stat_members_title' => '会员显示名', + 'blockclass_other_stat_groupnewposts_title' => '今日发帖显示名', + 'blockclass_other_stat_bbsnewposts_title' => '今日发帖显示名', + 'blockclass_other_stat_bbslastposts_title' => '昨日发帖显示名', + 'blockclass_other_stat_onlinemembers_title' => '当前在线会员显示名', + 'blockclass_other_stat_maxmembers_title' => '历史最高在线显示名', + 'blockclass_other_stat_doings_title' => '动态显示名', + 'blockclass_other_stat_blogs_title' => '日志显示名', + 'blockclass_other_stat_albums_title' => '相册显示名', + 'blockclass_other_stat_pics_title' => '图片显示名', + 'blockclass_other_stat_shares_title' => '分享显示名', + + 'blockclass_field_id' => '数据ID', +); + + +?> \ No newline at end of file diff --git a/source/language/lang_cloud_register.php b/source/language/lang_cloud_register.php new file mode 100644 index 0000000..bce9b10 --- /dev/null +++ b/source/language/lang_cloud_register.php @@ -0,0 +1,21 @@ + '您需要绑定QQ账号后才能开启此应用', + 'bindqq_link' => '开始绑定QQ', + 'back' => '点击这里返回上一页', +); + +?> \ No newline at end of file diff --git a/source/language/lang_core.php b/source/language/lang_core.php new file mode 100644 index 0000000..5751dd6 --- /dev/null +++ b/source/language/lang_core.php @@ -0,0 +1,218 @@ + '下一页', + 'prevpage' => '上一页', + 'pageunit' => '页', + 'total' => '共', + '10k' => '万', + 'pagejumptip' => '输入页码,按回车快速跳转', + 'date' => array( + 'before' => '前', + 'day' => '天', + 'yday' => '昨天', + 'byday' => '前天', + 'hour' => '小时', + 'half' => '半', + 'min' => '分钟', + 'sec' => '秒', + 'now' => '刚刚', + ), + 'yes' => '是', + 'no' => '否', + 'weeks' => array( + 1 => '周一', + 2 => '周二', + 3 => '周三', + 4 => '周四', + 5 => '周五', + 6 => '周六', + 7 => '周日', + ), + 'dot' => '、', + 'archive' => '存档', + 'portal' => '门户', + 'end' => '末尾', + + 'seccode_image_tips' => '输入下图中的字符
            ', + 'seccode_image_ani_tips' => '请输入下面动画图片中的字符
            ', + 'seccode_sound_tips' => '输入您听到的字符
            ', + 'secqaa_tips' => '输入下面问题的答案
            ', + + 'fullblankspace' => ' ', + + 'title_goruptype' => '类', + 'title_of' => '的', + 'title_board_message' => '提示信息', + 'title_view_all' => '随便看看', + 'title_activity' => '活动', + 'title_friend_activity' => '好友发起的活动', + 'title_my_activity' => '我的活动', + 'title_newest_activity' => '最新活动', + 'title_top_activity' => '热门活动', + 'title_album' => '相册', + 'title_friend_album' => '好友的相册', + 'title_my_album' => '我的相册', + 'title_newest_update_album' => '最新更新的相册', + 'title_hot_pic_recommend' => '热门图片推荐', + 'title_blog' => '日志', + 'title_friend_blog' => '好友的日志', + 'title_my_blog' => '我的日志', + 'title_post_new_blog' => '发表新日志', + 'title_newest_blog' => '最新发表的日志', + 'title_recommend_blog' => '推荐阅读的日志', + 'title_debate' => '辩论', + 'title_friend_debate' => '好友发起的辩论', + 'title_my_debate' => '我的辩论', + 'title_create_new_debate' => '发起新辩论', + 'title_my_create_debate' => '我发起的辩论', + 'title_my_join_debate' => '我参与的辩论', + 'title_newest_debate' => '最新辩论', + 'title_top_debate' => '热门辩论', + 'title_doing' => '记录', + 'title_newest_doing' => '记录', + 'title_me_friend_doing' => '我和好友的记录', + 'title_doing_view_me' => '我的记录', + 'title_thread_favorite' => '文章收藏', + 'title_forum_favorite' => '文章收藏', + 'title_group_favorite' => '{gorup}收藏', + 'title_blog_favorite' => '日志收藏', + 'title_album_favorite' => '相册收藏', + 'title_article_favorite' => '文章收藏', + 'title_all_favorite' => '全部收藏', + 'title_friend_list' => '好友列表', + 'title_all_poll' => '随便看看投票', + 'title_we_poll' => '好友发起的投票', + 'title_me_poll' => '我的投票', + 'title_hot_poll' => '热门投票', + 'title_dateline_poll' => '最新投票', + 'title_all_reward' => '随便看看悬赏', + 'title_we_reward' => '好友发起的悬赏', + 'title_me_reward' => '我的悬赏', + 'title_hot_reward' => '热门悬赏', + 'title_dateline_reward' => '最新悬赏', + 'title_share_all' => '全部', + 'title_share_link' => '网址', + 'title_share_video' => '视频', + 'title_share_music' => '音乐', + 'title_share_flash' => 'Flash', + 'title_share_poll' => '投票', + 'title_share_pic' => '图片', + 'title_share_album' => '相册', + 'title_share_blog' => '日志', + 'title_share_space' => '用户', + 'title_share_thread' => '文章', + 'title_share_article' => '文章', + 'title_share_tag' => 'TAG', + 'title_share' => '分享', + 'title_thread' => '文章', + 'title_all_thread' => '随便看看文章', + 'title_we_thread' => '好友发起的文章', + 'title_me_thread' => '我的文章', + 'title_hot_thread' => '热门文章', + 'title_dateline_thread' => '最新文章', + 'title_trade' => '商品', + 'title_all_trade' => '随便看看商品', + 'title_we_trade' => '好友出售的商品', + 'title_me_trade' => '我的商品', + 'title_hot_trade' => '热门商品', + 'title_dateline_trade' => '最新商品', + 'title_tradelog_trade' => '交易记录', + 'title_eccredit_trade' => '信用评价', + 'title_credit' => '积分', + 'title_friend_add' => '添加好友', + 'title_people_might_know' => '可能认识的人', + 'title_friend_request' => '好友请求', + 'title_search_friend' => '查找好友', + 'title_invite_friend' => '邀请好友', + 'title_password_security' => '密码安全', + 'title_flash_upload' => '批量上传', + 'title_cam_upload' => '大头贴', + 'title_normal_upload' => '普通上传', + 'title_newthread_post' => '发表文章', + 'title_reply_post' => '参与/回复主题', + 'title_edit_post' => '编辑文章', + 'title_newtrade_post' => '发布商品', + 'title_magics_shop' => '道具商店', + 'title_magics_hot' => '热销道具', + 'title_magics_user' => '我的道具', + 'title_magics_log' => '道具记录', + 'title_medals_list' => '勋章', + 'title_setup' => '设置', + 'title_memcp_blog' => '发表日志', + 'title_memcp_upload' => '上传', + 'title_memcp_share' => '添加分享', + 'title_memcp_sendmail' => '邮件提醒', + 'title_memcp_privacy' => '隐私筛选', + 'title_memcp_avatar' => '修改头像', + 'title_memcp_profile' => '个人资料', + 'title_memcp_credit' => '积分', + 'title_memcp_payment' => '订单', + 'title_memcp_friend' => '好友', + 'title_memcp_usergroup' => '用户组', + 'title_memcp_album' => '编辑相册', + 'title_memcp_poke' => '打招呼', + 'title_memcp_comment' => '评论', + 'title_memcp_eccredit' => '信用评价', + 'title_memcp_promotion' => '访问推广', + 'title_task' => '任务', + 'title_login' => '登录', + 'title_getpasswd' => '找回密码', + 'title_ranklist_picture' => '图片排行', + 'title_ranklist_member' => '用户排行', + 'title_ranklist_thread' => '文章排行', + 'title_ranklist_blog' => '日志排行', + 'title_ranklist_poll' => '投票排行', + 'title_ranklist_activity' => '活动排行', + 'title_ranklist_forum' => '版块排行', + 'title_ranklist_group' => '圈子排行', + 'title_ranklist_app' => '应用排行', + 'title_ranklist_index' => '全部排行', + 'title_ranklist_rankname' => '排行榜', + 'title_search' => '搜索', + 'title_topic_management' => '创建专题', + 'title_portal_management' => '门户管理', + 'title_portalblock_management' => '模块管理', + 'title_block_management' => '模块管理', + 'title_blockdata_management' => '推送审核', + 'title_index_management' => '频道栏目', + 'title_article_management' => '发布文章', + 'title_category_management' => '管理文章', + + 'title_stats' => '站点统计', + 'title_stats_basic' => '基本概况', + 'title_stats_forumstat' => '版块统计', + 'title_stats_team' => '管理团队', + 'title_stats_modworks' => '管理统计', + 'title_stats_memberlist' => '会员列表', + 'title_stats_trend' => '趋势统计', + + 'title_memcp_pm' => '发送短消息', + 'title_memcp_domain' => '我的空间域名', + + 'title_collection' => '淘帖', + 'title_collection_create' => '创建淘专辑', + 'title_collection_edit' => '编辑淘专辑', + 'title_collection_comment_list' => '评论列表', + 'title_collection_followers_list' => '订阅用户列表', + + 'faq' => '帮助', + 'search' => '搜索', + 'page' => '第{page}页', + + 'close' => '关闭', +); + +?> \ No newline at end of file diff --git a/source/language/lang_email.php b/source/language/lang_email.php new file mode 100644 index 0000000..db33f6c --- /dev/null +++ b/source/language/lang_email.php @@ -0,0 +1,283 @@ + '您好', + 'moderate_member_invalidate' => '否决', + 'moderate_member_delete' => '删除', + 'moderate_member_validate' => '通过', + + + 'get_passwd_subject' => '取回密码说明', + 'get_passwd_message' => ' +

            {username}, +这封信是由 {bbname} 发送的。

            + +

            您收到这封邮件,是由于这个邮箱地址在 {bbname} 被登记为用户邮箱, +且该用户请求使用 Email 密码重置功能所致。

            +

            +----------------------------------------------------------------------
            +重要!
            +----------------------------------------------------------------------

            + +

            如果您没有提交密码重置的请求或不是 {bbname} 的注册用户,请立即忽略 +并删除这封邮件。只有在您确认需要重置密码的情况下,才需要继续阅读下面的 +内容。

            +

            +----------------------------------------------------------------------
            +密码重置说明
            +----------------------------------------------------------------------

            +

            +您只需在提交请求后的三天内,通过点击下面的链接重置您的密码:
            + +{siteurl}member.php?mod=getpasswd&uid={uid}&id={idstring}&sign={sign} +
            +(如果上面不是链接形式,请将该地址手工粘贴到浏览器地址栏再访问)

            + +

            在上面的链接所打开的页面中输入新的密码后提交,您即可使用新的密码登录网站了。您可以在用户控制面板中随时修改您的密码。

            + +

            本请求提交者的 IP 为 {clientip}

            + + +

            +此致
            +

            +

            {bbname} 管理团队. +{siteurl}

            ', + + + 'email_verify_subject' => 'Email 地址验证', + 'email_verify_message' => '
            +

            {username},
            +这封信是由 {bbname} 发送的。

            + +

            您收到这封邮件,是由于在 {bbname} 进行了新用户注册,或用户修改 Email 使用 +了这个邮箱地址。如果您并没有访问过 {bbname},或没有进行上述操作,请忽 +略这封邮件。您不需要退订或进行其他进一步的操作。

            +
            +----------------------------------------------------------------------
            +账号激活说明
            +----------------------------------------------------------------------
            +
            +

            如果您是 {bbname} 的新用户,或在修改您的注册 Email 时使用了本地址,我们需 +要对您的地址有效性进行验证以避免垃圾邮件或地址被滥用。

            + +

            您只需点击下面的链接即可激活您的账号:
            + +{url} +
            +(如果上面不是链接形式,请将该地址手工粘贴到浏览器地址栏再访问)

            + +

            感谢您的访问,祝您使用愉快!

            + + +

            +此致
            + +{bbname} 管理团队.
            +{siteurl}

            ', + + 'email_register_subject' => '论坛注册地址', + 'email_register_message' => '
            +

            这封信是由 {bbname} 发送的。

            + +

            您收到这封邮件,是由于在 {bbname} 获取了新用户注册地址使用 +了这个邮箱地址。如果您并没有访问过 {bbname},或没有进行上述操作,请忽 +略这封邮件。您不需要退订或进行其他进一步的操作。

            +
            +----------------------------------------------------------------------
            +新用户注册说明
            +----------------------------------------------------------------------
            +
            +

            如果您是 {bbname} 的新用户,或在修改您的注册 Email 时使用了本地址,我们需 +要对您的地址有效性进行验证以避免垃圾邮件或地址被滥用。

            + +

            您只需点击下面的链接即可进行用户注册,以下链接有效期为3天。过期可以重新请求发送一封新的邮件验证:
            + +{url} +
            +(如果上面不是链接形式,请将该地址手工粘贴到浏览器地址栏再访问)

            + +

            感谢您的访问,祝您使用愉快!

            + + +

            +此致
            + +{bbname} 管理团队.
            +{siteurl}

            ', + + + 'add_member_subject' => '您被添加成为会员', + 'add_member_message' => ' +{newusername} , +这封信是由 {bbname} 发送的。
            +
            +我是 {adminusername} ,{bbname} 的管理者之一。您收到这封邮件,是由于您
            +刚刚被添加成为 {bbname} 的会员,当前 Email 即是我们为您注册的邮箱地址。
            +
            +----------------------------------------------------------------------
            +重要!
            +----------------------------------------------------------------------
            +
            +如果您对 {bbname} 不感兴趣或无意成为会员,请忽略这封邮件。
            +
            +----------------------------------------------------------------------
            +账号信息
            +----------------------------------------------------------------------
            +
            +网站名称:{bbname}
            +网站地址:{siteurl}
            +
            +用户名:{newusername}
            +密码:{newpassword}
            +
            +从现在起您可以使用您的账号登录 {bbname},祝您使用愉快!
            +
            +
            +
            +此致
            +
            +{bbname} 管理团队.
            +{siteurl}', + + + 'birthday_subject' => '祝您生日快乐', + 'birthday_message' => '
            +{username},
            +这封信是由 {bbname} 发送的。
            +
            +您收到这封邮件,是由于这个邮箱地址在 {bbname} 被登记为用户邮箱,
            +并且按照您填写的信息,今天是您的生日。很高兴能在此时为您献上一份
            +生日祝福,我谨代表{bbname}管理团队,衷心祝福您生日快乐。
            +
            +如果您并非 {bbname} 的会员,或今天并非您的生日,可能是有人误用了您的邮
            +件地址,或错误的填写了生日信息。本邮件不会多次重复发送,请忽略这封邮件。
            +
            +
            +此致
            +
            +{bbname} 管理团队.
            +{siteurl}', + + 'email_to_friend_subject' => '{$_G[\'member\'][\'username\']} 推荐给您: {$thread[\'subject\']}', + 'email_to_friend_message' => '
            +这封信是由 {$_G[\'setting\'][\'bbname\']} 的 {$_G[\'member\'][\'username\']} 发送的。
            +
            +您收到这封邮件,是由于在 {$_G[\'member\'][\'username\']} 通过 {$_G[\'setting\'][\'bbname\']} 的“推荐给朋友”
            +功能推荐了如下的内容给您。如果您对此不感兴趣,请忽略这封邮件。您不需要退订或进行其他进一步的操作。
            +
            +----------------------------------------------------------------------
            +信件原文开始
            +----------------------------------------------------------------------
            +
            +$message
            +
            +----------------------------------------------------------------------
            +信件原文结束
            +----------------------------------------------------------------------
            +
            +请注意这封信仅仅是由用户使用 “推荐给朋友”发送的,不是网站官方邮件,
            +网站管理团队不会对这类邮件负责。
            +
            +欢迎您访问 {$_G[\'setting\'][\'bbname\']}
            +{$_G[\'siteurl\']}', + + 'email_to_invite_subject' => '您的朋友 {$_G[\'member\'][\'username\']} 发送 {$_G[\'setting\'][\'bbname\']} 网站注册邀请码给您', + 'email_to_invite_message' => '
            +$sendtoname,
            +这封信是由 {$_G[\'setting\'][\'bbname\']} 的 {$_G[\'member\'][\'username\']} 发送的。
            +
            +您收到这封邮件,是由于 {$_G[\'member\'][\'username\']} 通过 {bbname} 的“发送邀请码给朋友”
            +功能推荐了如下的内容给您。如果您对此不感兴趣,请忽略这封邮件。您不需要退订或进行其他进
            +一步的操作。
            +
            +----------------------------------------------------------------------
            +信件原文开始
            +----------------------------------------------------------------------
            +
            +$message
            +
            +----------------------------------------------------------------------
            +信件原文结束
            +----------------------------------------------------------------------
            +
            +请注意这封信仅仅是由用户使用 “发送邀请码给朋友”发送的,不是网站官方邮件,
            +网站管理团队不会对这类邮件负责。
            +
            +欢迎您访问 {$_G[\'setting\'][\'bbname\']}
            +{$_G[\'siteurl\']}', + + + 'moderate_member_subject' => '用户审核结果通知', + 'moderate_member_message' => '
            +

            {username}, +这封信是由 {bbname} 发送的。

            + +

            您收到这封邮件,是由于这个邮箱地址在 {bbname} 被新用户注册时所 +使用,且管理员设置了对新用户需要进行人工审核,本邮件将通知您提交 +申请的审核结果。

            +
            +----------------------------------------------------------------------
            +注册信息与审核结果
            +----------------------------------------------------------------------
            +
            +用户名: {username}
            +注册时间: {regdate}
            +提交时间: {submitdate}
            +提交次数: {submittimes}
            +注册原因: {message}
            +
            +审核结果: {modresult}
            +审核时间: {moddate}
            +审核管理员: {adminusername}
            +管理员留言: {remark}
            +
            +----------------------------------------------------------------------
            +审核结果说明
            +----------------------------------------------------------------------
            + +

            通过: 您的注册已通过审核,您已成为 {bbname} 的正式用户。

            + +

            否决: 您的注册信息不完整,或未满足我们对新用户的某些要求,您可以 + 根据管理员留言,完善您的注册信息,然后再次提交。

            + +

            删除:您的注册由于与我们的要求偏差较大,或本站的新注册人数已 + 超过预期,申请已被否决。您的账号已从数据库中删除,将无法 + 再使用其登录或提交再次审核,请您谅解。

            + +
            +
            +此致
            +
            +{bbname} 管理团队.
            +{siteurl}', + + 'adv_expiration_subject' => '您站点的广告将于 {day} 天后到期,请及时处理', + 'adv_expiration_message' => '您站点的以下广告将于 {day} 天后到期,请及时处理:

            {advs}', + 'invite_payment_email_message' => ' +欢迎您光临{bbname}({siteurl}),您的订单{orderid}已经支付完成,订单已确认有效。
            +
            ----------------------------------------------------------------------
            +以下是您获得的邀请码 +
            ----------------------------------------------------------------------
            + +{codetext} + +
            ----------------------------------------------------------------------
            +重要! +
            ----------------------------------------------------------------------
            ', +); + +?> \ No newline at end of file diff --git a/source/language/lang_error.php b/source/language/lang_error.php new file mode 100644 index 0000000..b33e396 --- /dev/null +++ b/source/language/lang_error.php @@ -0,0 +1,46 @@ + '站点信息', + + 'config_notfound' => '配置文件 "config_global.php" 未找到或者无法访问, 请确认您已经正确安装了程序', + 'template_notfound' => '模版文件未找到或者无法访问', + 'directory_notfound' => '目录未找到或者无法访问', + 'request_tainting' => '您当前的访问请求当中含有非法字符,已经被系统拒绝', + 'db_help_link' => '点击这里寻求帮助', + 'db_error_message' => '错误信息', + 'db_error_sql' => 'SQL: $sql
            ', + 'db_error_backtrace' => 'Backtrace: $backtrace
            ', + 'db_error_no' => '错误代码', + 'db_notfound_config' => '配置文件 "config_global.php" 未找到或者无法访问。', + 'db_notconnect' => '无法连接到数据库服务器', + 'db_security_error' => '查询语句安全威胁', + 'db_query_sql' => '查询语句', + 'db_query_error' => '查询语句错误', + 'db_config_db_not_found' => '数据库配置错误,请仔细检查 config_global.php 文件', + 'system_init_ok' => '网站系统初始化完成,请点击这里进入', + 'backtrace' => '运行信息', + 'error_end_message' => '{host} 已经将此出错信息详细记录, 由此给您带来的访问不便我们深感歉意', + 'suggestion_user' => '如果您是用户,建议您尝试刷新页面、关闭所有浏览器窗口重新进行操作。如果无法解决,建议您完整截图本页面并保存,随后向站点管理员反馈此问题', + 'suggestion_plugin' => '如果您是站点管理员,建议您尝试在管理中心关闭 {guess} 插件并 更新缓存 。如关闭插件后问题解决,建议您凭完整截图联系插件供应方获得帮助', + 'suggestion' => '如果您是站点管理员,建议您尝试在管理中心 更新缓存 ,或凭完整截图通过 官方论坛 寻求帮助。如果您确定是程序自身Bug,您也可直接 提交Issue 给我们', + + 'file_upload_error_-101' => '上传失败!上传文件不存在或不合法,请返回。', + 'file_upload_error_-102' => '上传失败!非图片类型文件,请返回。', + 'file_upload_error_-103' => '上传失败!无法写入文件或写入失败,请返回。', + 'file_upload_error_-104' => '上传失败!无法识别的图像文件格式,请返回。', +); + +?> \ No newline at end of file diff --git a/source/language/lang_exif.php b/source/language/lang_exif.php new file mode 100644 index 0000000..274dc55 --- /dev/null +++ b/source/language/lang_exif.php @@ -0,0 +1,101 @@ + '未知', + 'resolutionunit' => array('', '', '英寸', '厘米'), + 'exposureprogram' => array('未定义', '手动', '标准程序', '光圈先决', '快门先决', '景深先决', '运动模式', '肖像模式', '风景模式'), + 'meteringmode' => array( + '0' => '未知', + '1' => '平均', + '2' => '中央重点平均测光', + '3' => '点测', + '4' => '分区', + '5' => '评估', + '6' => '局部', + '255' => '其他' + ), + 'lightsource' => array( + '0' => '未知', + '1' => '日光', + '2' => '荧光灯', + '3' => '钨丝灯', + '10' => '闪光灯', + '17' => '标准灯光A', + '18' => '标准灯光B', + '19' => '标准灯光C', + '20' => 'D55', + '21' => 'D65', + '22' => 'D75', + '255' => '其他' + ), + 'img_info' => array ('文件信息' => '没有图片EXIF信息'), + + 'FileName' => '文件名', + 'FileType' => '文件类型', + 'MimeType' => '文件格式', + 'FileSize' => '文件大小', + 'FileDateTime' => '时间戳', + 'ImageDescription' => '图片说明', + 'auto' => '自动', + 'Make' => '制造商', + 'Model' => '型号', + 'Orientation' => '方向', + 'XResolution' => '水平分辨率', + 'YResolution' => '垂直分辨率', + 'Software' => '创建软件', + 'DateTime' => '修改时间', + 'Artist' => '作者', + 'YCbCrPositioning' => 'YCbCr位置控制', + 'Copyright' => '版权', + 'Photographer'=> '摄影版权', + 'Editor' => '编辑版权', + 'ExifVersion' => 'Exif版本', + 'FlashPixVersion' => 'FlashPix版本', + 'DateTimeOriginal' => '拍摄时间', + 'DateTimeDigitized'=> '数字化时间', + 'Height' => '拍摄分辨率高', + 'Width' => '拍摄分辨率宽', + 'ApertureValue' => '光圈', + 'ShutterSpeedValue' => '快门速度', + 'ApertureFNumber' => '快门光圈', + 'MaxApertureValue' => '最大光圈值', + 'ExposureTime' => '曝光时间', + 'FNumber' => 'F-Number', + 'MeteringMode' => '测光模式', + 'LightSource' => '光源', + 'Flash' => '闪光灯', + 'ExposureMode' => '曝光模式', + 'manual' => '手动', + 'WhiteBalance' => '白平衡', + 'ExposureProgram' => '曝光程序', + 'ExposureBiasValue' => '曝光补偿', + 'ISOSpeedRatings' => 'ISO感光度', + 'ComponentsConfiguration' => '分量配置', + 'CompressedBitsPerPixel' => '图像压缩率', + 'FocusDistance' => '对焦距离', + 'FocalLength' => '焦距', + 'FocalLengthIn35mmFilm' => '等价35mm焦距', + 'UserCommentEncoding' => '用户注释编码', + 'UserComment' => '用户注释', + 'ColorSpace' => '色彩空间', + 'ExifImageLength' => 'Exif图像宽度', + 'ExifImageWidth' => 'Exif图像高度', + 'FileSource' => '文件来源', + 'SceneType' => '场景类型', + 'ThumbFileType' => '缩略图文件格式', + 'ThumbMimeType' => '缩略图Mime格式' +); + +?> \ No newline at end of file diff --git a/source/language/lang_feed.php b/source/language/lang_feed.php new file mode 100644 index 0000000..06c5385 --- /dev/null +++ b/source/language/lang_feed.php @@ -0,0 +1,110 @@ + '{actor} 发表了新加密日志 {subject}', + 'feed_blog_title' => '{actor} 发表了新日志', + 'feed_blog_body' => '{subject}
            {summary}', + 'feed_album_title' => '{actor} 更新了相册', + 'feed_album_body' => '{album}
            共 {picnum} 张图片', + 'feed_pic_title' => '{actor} 上传了新图片', + 'feed_pic_body' => '{title}', + + + + 'feed_poll' => '{actor} 发起了新投票', + + 'feed_comment_space' => '{actor} 在 {touser} 的留言板留了言', + 'feed_comment_image' => '{actor} 评论了 {touser} 的图片', + 'feed_comment_blog' => '{actor} 评论了 {touser} 的日志 {blog}', + 'feed_comment_poll' => '{actor} 评论了 {touser} 的投票 {poll}', + 'feed_comment_event' => '{actor} 在 {touser} 组织的活动 {event} 中留言了', + 'feed_comment_share' => '{actor} 对 {touser} 分享的 {share} 发表了评论', + + 'feed_showcredit' => '{actor} 赠送给 {fusername} 竞价积分 {credit} 个,帮助好友提升在竞价排行榜中的名次', + 'feed_showcredit_self' => '{actor} 增加竞价积分 {credit} 个,提升自己在竞价排行榜中的名次', + 'feed_doing_title' => '{actor}:{message}', + 'feed_friend_title' => '{actor} 和 {touser} 成为了好友', + + + + 'feed_click_blog' => '{actor} 送了一个“{click}”给 {touser} 的日志 {subject}', + 'feed_click_thread' => '{actor} 送了一个“{click}”给 {touser} 的话题 {subject}', + 'feed_click_pic' => '{actor} 送了一个“{click}”给 {touser} 的图片', + 'feed_click_article' => '{actor} 送了一个“{click}”给 {touser} 的文章 {subject}', + + + 'feed_task' => '{actor} 完成了有奖任务 {task}', + 'feed_task_credit' => '{actor} 完成了有奖任务 {task},领取了 {credit} 个奖励积分', + + 'feed_profile_update_base' => '{actor} 更新了自己的基本资料', + 'feed_profile_update_contact' => '{actor} 更新了自己的联系方式', + 'feed_profile_update_edu' => '{actor} 更新了自己的教育情况', + 'feed_profile_update_work' => '{actor} 更新了自己的工作信息', + 'feed_profile_update_info' => '{actor} 更新了自己的个人信息', + 'feed_profile_update_bbs' => '{actor} 更新了自己的论坛信息', + 'feed_profile_update_verify' => '{actor} 更新了自己的认证信息', + + 'feed_add_attachsize' => '{actor} 用 {credit} 个积分兑换了 {size} 附件空间,可以上传更多的图片啦(我也来兑换)', + + 'feed_invite' => '{actor} 发起邀请,和 {username} 成为了好友', + + 'magicuse_thunder_announce_title' => '{username} 发出了“雷鸣之声”', + 'magicuse_thunder_announce_body' => '大家好,我上线啦
            欢迎来我家串个门', + + + 'feed_thread_title' => '{actor} 发表了新话题', + 'feed_thread_message' => '{subject}
            {message}', + + 'feed_reply_title' => '{actor} 回复了 {author} 的话题 {subject}', + 'feed_reply_title_anonymous' => '{actor} 回复了话题 {subject}', + 'feed_reply_message' => '', + + 'feed_thread_poll_title' => '{actor} 发起了新投票', + 'feed_thread_poll_message' => '{subject}
            {message}', + + 'feed_thread_votepoll_title' => '{actor} 参与了关于 {subject} 的投票', + 'feed_thread_votepoll_message' => '', + + 'feed_thread_goods_title' => '{actor} 出售了一个新商品', + 'feed_thread_goods_message_1' => '{itemname}
            售价 {itemprice} 元 附加 {itemcredit}{creditunit}', + 'feed_thread_goods_message_2' => '{itemname}
            售价 {itemprice} 元', + 'feed_thread_goods_message_3' => '{itemname}
            售价 {itemcredit}{creditunit}', + + 'feed_thread_reward_title' => '{actor} 发起了新悬赏', + 'feed_thread_reward_message' => '{subject}
            悬赏 {rewardprice}{extcredits}', + + 'feed_reply_reward_title' => '{actor} 回复了关于 {subject} 的悬赏', + 'feed_reply_reward_message' => '', + + 'feed_thread_activity_title' => '{actor} 发起了新活动', + 'feed_thread_activity_message' => '{subject}
            开始时间:{starttimefrom}
            活动地点:{activityplace}
            {message}', + + 'feed_reply_activity_title' => '{actor} 报名参加了 {subject} 的活动', + 'feed_reply_activity_message' => '', + + 'feed_thread_debate_title' => '{actor} 发起了新辩论', + 'feed_thread_debate_message' => '{subject}
            正方:{affirmpoint}
            反方:{negapoint}
            {message}', + + 'feed_thread_debatevote_title_1' => '{actor} 以正方身份参与了关于 {subject} 的辩论', + 'feed_thread_debatevote_title_2' => '{actor} 以反方身份参与了关于 {subject} 的辩论', + 'feed_thread_debatevote_title_3' => '{actor} 以中立身份参与了关于 {subject} 的辩论', + 'feed_thread_debatevote_message_1' => '', + 'feed_thread_debatevote_message_2' => '', + 'feed_thread_debatevote_message_3' => '', + +); + +?> \ No newline at end of file diff --git a/source/language/lang_friend.php b/source/language/lang_friend.php new file mode 100644 index 0000000..dbbe54d --- /dev/null +++ b/source/language/lang_friend.php @@ -0,0 +1,26 @@ + '其他', + 'friend_group_1' => '通过本站认识', + 'friend_group_2' => '通过活动认识', + 'friend_group_3' => '通过朋友认识', + 'friend_group_4' => '亲人', + 'friend_group_5' => '同事', + 'friend_group_6' => '同学', + 'friend_group_7' => '不认识', + 'friend_group_more' => '自定义{num}' +); + +?> \ No newline at end of file diff --git a/source/language/lang_message.php b/source/language/lang_message.php new file mode 100644 index 0000000..be18b58 --- /dev/null +++ b/source/language/lang_message.php @@ -0,0 +1,1139 @@ + '未定义操作', + 'plugin_nonexistence' => '插件不存在或已关闭', + 'profile_username_protect' => '用户名包含被系统屏蔽的字符', + 'set_cover_faild' => '封面设置失败', + 'set_cover_succeed' => '封面设置成功', + 'quickclear_noperm' => '您没有权限进行此操作', + 'attachment_nonexistence' => '抱歉,该附件无法读取', + 'attachment_forum_nopermission' => '抱歉,只有特定用户可以下载本站附件', + 'album_status_off' => '抱歉,相册功能尚未开启', + 'blog_status_off' => '抱歉,日志功能尚未开启', + 'collection_status_off' => '抱歉,淘帖功能尚未开启', + 'doing_status_off' => '抱歉,记录功能尚未开启', + 'feed_status_off' => '抱歉,动态功能尚未开启', + 'friend_status_off' => '抱歉,好友功能尚未开启', + 'forum_status_off' => '抱歉,论坛功能尚未开启', + 'follow_status_off' => '抱歉,广播功能尚未开启', + 'group_module_status_off' => '抱歉,圈子功能尚未开启', + 'guide_status_off' => '抱歉,导读功能尚未开启', + 'medal_status_off' => '抱歉,勋章功能尚未开启', + 'share_status_off' => '抱歉,分享功能尚未开启', + 'wall_status_off' => '抱歉,留言板功能尚未开启', + 'favorite_status_off' => '抱歉,收藏功能尚未开启', + 'forum_not_group' => '该版块不是{_G/setting/navs/3/navname}', + 'forum_group_status_off' => '该{_G/setting/navs/3/navname}已关闭', + 'forum_group_noallowed' => '抱歉,您没有权限访问该{_G/setting/navs/3/navname}', + 'forum_group_moderated' => '请等待圈主审核', + 'group_name_empty' => '请填写{_G/setting/navs/3/navname}名称', + 'group_name_exist' => '{_G/setting/navs/3/navname}名称已存在', + 'group_admin_noallowed' => '抱歉,您没有权限限管理此{_G/setting/navs/3/navname}', + 'group_name_failed' => '{_G/setting/navs/3/navname}名称含有敏感词', + 'group_category_empty' => '请选择{_G/setting/navs/3/navname}分类', + 'group_description_failed' => '{_G/setting/navs/3/navname}简介含有敏感词', + 'group_setup_succeed' => '{_G/setting/navs/3/navname}设置成功 ', + 'to_login' => '您需要先登录才能继续本操作', + 'postcomment_closed' => '点评功能已关闭', + 'group_nopermission' => '抱歉,您所在的用户组({grouptitle})无法进行此操作', + 'nopermission_email' => '

            您需要验证激活自己的邮箱后再次尝试进行本操作,点击这里激活邮箱

            ', + 'nopermission_verify' => '

            您需要等待注册申请审核通过后再次尝试进行本操作,请您耐心等待管理团队审核

            ', + 'thread_nonexistence' => '抱歉,指定的主题不存在或已被删除或正在被审核', + 'parameters_error' => '参数错误', + 'thread_poll_succeed' => '投票成功 ', + 'thread_hidden_error' => '抱歉,指定的主题不能隐藏 ', + 'thread_hidden_success' => '隐藏成功 ', + 'thread_hiderecover_success' => '主题已从隐藏状态恢复 ', + 'thread_rate_range_invalid' => '请输入正确的分值', + 'rate_post_error' => '文章不存在或不能被推送', + 'thread_rate_log_nonexistence' => '抱歉,指定文章在近一年内没有评分记录', + 'targetpost_donotbelongto_thisthread' => '目标文章不属于本主题', + 'credits_transaction_disabled' => '抱歉,交易积分尚未启用,无法使用此功能', + 'credits_balance_insufficient' => '抱歉,{title}不足 {minbalance}', + 'not_loggedin' => '抱歉,您尚未登录,无法进行此操作', + 'activity_is_not_manager' => '抱歉,您不是此活动的管理者,没有权限进行此操作', + 'activity_is_not_exists' => '抱歉,指定的活动不存在', + 'thread_poll_closed' => '抱歉,本主题已关闭,无法继续投票', + 'debate_nofound' => '抱歉,该辩论主题不存在', + 'debate_poll_voted' => '您已投过票', + 'debate_poll_end' => '抱歉,投票已结束,不能再投票', + 'debate_poll_succeed' => '投票成功 ', + 'debate_umpire_bestdebater_invalid' => '抱歉,您指定的最佳辩手不存在或者不合法', + 'group_status_off' => '抱歉,{_G/setting/navs/3/navname}功能尚未开启', + 'thread_nopermission' => '抱歉,本帖要求阅读权限高于 {readperm} 才能浏览', + 'forum_passwd' => '本版块需要密码', + 'trade_credit_lack' => '抱歉,您的积分不足无法购买', + 'trade_closed' => '本交易已关闭', + 'trade_input_no' => '抱歉,请输入正确的商品数', + 'trade_lack' => '抱歉,商品剩余数量不足', + 'forum_access_view_disallow' => '抱歉,您在本版没有权限进行此操作', + 'view_log_invalid' => '浏览量记录文件({logfile})无法写入,请设置其属性 777 或删除后重新建立', + 'invite_code_error' => '抱歉,您访问的邀请链接不正确', + 'magics_nopermission' => '抱歉,您所在的用户组不允许使用道具', + 'magics_nonexistence' => '抱歉,您选择的道具不存在,请到道具商店购买', + 'magics_credits_no_enough_and_charge' => '抱歉,您没有足够的 {credit} 购买此道具,请【充值】', + 'magics_credits_no_enough' => '抱歉,您没有足够的 {credit} 购买此道具', + 'magics_num_no_enough' => '抱歉,本道具已售完,请下次再来', + 'magics_num_invalid' => '抱歉,操作数量不合法', + 'magics_filename_nonexistence' => '道具所需文件 {file} 不存在', + 'magics_amount_no_enough' => '抱歉,您没有足够的道具可以操作,请修改', + 'magics_username_nonexistence' => '抱歉,您尚未输入要赠送的用户名', + 'medal_apply_existence' => '抱歉,您已申请过或领取过此勋章,请不要重复申请或领取', + 'space_does_not_exist' => '抱歉,您指定的用户空间不存在', + 'login_before_enter_home' => '请先登录后才能继续浏览', + 'home_status_off' => '抱歉,家园功能尚未开启', + 'space_has_been_locked' => '空间已被锁定无法访问,如有疑问请联系管理员', + 'activate_illegal' => '您所用的 ID 不存在或您不是等待验证会员', + 'getpasswd_account_notmatch' => '抱歉,您填写的账户资料不匹配,不能使用取回密码功能,如有疑问请与管理员联系', + 'credits_addfunds_order_invalid' => '抱歉,当前订单号无效,请重新提交', + 'do_success' => '操作成功 ', + 'group_member_maximum' => '抱歉,该{_G/setting/navs/3/navname}等级最多可拥有{membermaximum}名成员,已达到上限', + 'group_choose_friends_max' => '抱歉,您最多可以选择 20 位好友', + 'group_invite_succeed' => '邀请成功 ', + 'group_invite_choose_member' => '请选择要邀请的用户', + 'modcp_logout_succeed' => '退出成功 ', + 'topic_edit_nopermission' => '抱歉,您没有权限创建或编辑专题', + 'search_id_invalid' => '抱歉,您指定的搜索不存在或已过期', + 'search_ctrl' => '抱歉,您在 {searchctrl} 秒内只能进行一次搜索', + 'search_toomany' => '抱歉,站点设置每分钟系统最多响应搜索请求 {maxspm} 次,请稍候再试', + 'search_closed' => '搜索功能已关闭', + 'collection_permission_deny' => '抱歉,该淘专辑不存在或没有相应的权限', + 'collection_edit_checkentire' => '请将内容填写完整', + 'collection_teamworkers_exceed' => '共同维护人数已达上限,不能再邀请或接受其他人参与维护', + 'no_privilege_guest' => '抱歉,游客没有权限进行此操作', + 'forum_nonexistence' => '抱歉,指定的版块不存在', + 'ranklist_this_status_off' => '此排行功能已关闭', + 'modcp_mod_succeed' => '审核处理完毕', + 'article_not_exist' => '抱歉,指定的文章不存在', + 'article_delete_success' => '删除成功 ', + 'no_article_specified_for_pushplus' => '抱歉,尚未指定要连载的文章', + 'block_edit_nopermission' => '抱歉,您没有权限编辑此模块', + 'block_no_right_recommend' => '抱歉,您没有权限向该模块推荐数据', + 'portal_nopermission' => '抱歉,您没有权限使用门户管理功能', + 'operating_too_fast' => '抱歉,两次发布操作太快,请等待 {waittime} 秒再试', + 'topic_not_exist' => '抱歉,指定的专题不存在', + 'post_sm_isnull' => '抱歉,您尚未输入标题或内容', + 'post_not_allow_save' => '抱歉,您无权保存草稿贴', + 'post_max_save' => '抱歉,您保存草稿贴的数量超限', + 'post_not_allow_reply_save' => '抱歉,您无权回复草稿贴', + 'activity_fromtime_error' => '抱歉,活动开始时间格式不正确', + 'post_edit_delete_succeed' => '主题删除成功 ', + 'debate_end' => '抱歉,辩论已结束', + 'replyperm_login_nopermission' => '抱歉,您尚未登录,没有权限在该版块回帖', + 'post_nonexistence' => '文章不存在', + 'post_thread_closed' => '抱歉,本主题已关闭,不再接受新内容', + 'reply_quotepost_error' => '禁止引用自己和主题帖之外的文章', + 'post_flood_ctrl' => '抱歉,您两次发表间隔少于 {floodctrl} 秒,请稍候再发表', + 'post_flood_ctrl_posts_per_hour' => '抱歉,您所在的用户组每小时限制发回帖 {posts_per_hour} 个,请稍候再发表', + 'trade_please_name' => '抱歉,商品名称不能为空', + 'trade_price_between' => '抱歉,商品人民币价格必须在 {mintradeprice} 元至 {maxtradeprice} 元之间', + 'trade_credit_between' => '抱歉,商品积分价格必须在 {mintradeprice} 至 {maxtradeprice} 之间', + 'trade_price_more_than' => '抱歉,商品人民币价格必须大于 {mintradeprice} 元', + 'trade_credit_more_than' => '抱歉,商品积分价格必须大于 {mintradeprice} ', + 'trade_pricecredit_need' => '抱歉,商品价格不能为空', + 'tread_please_number' => '抱歉,商品数量不能为空', + 'post_reply_mod_succeed' => '回复需要审核,请等待通过', + 'postperm_login_nopermission' => '抱歉,您尚未登录,没有权限在该版块发帖', + 'post_type_isnull' => '抱歉,您尚未选择主题的类别', + 'post_net_price_iszero' => '抱歉,您的主题售价扣除积分交易税后为 0', + 'post_poll_option_toomany' => '抱歉,您的投票选项超过 {maxpolloptions} 个', + 'reward_credits_between' => '抱歉,悬赏积分必须在 {minrewardprice} 与 {maxrewardprice} 之间', + 'reward_credits_shortage' => '抱歉,积分余额不足', + 'activity_fromtime_please' => '抱歉,活动开始时间不能为空', + 'activity_sort_please' => '抱歉,活动所属类别不能为空', + 'activity_address_please' => '抱歉,活动地点不能为空', + 'activity_totime_error' => '抱歉,活动征集截止日期格式不正确', + 'post_activity_extfield_toomany' => '抱歉,您的自定义项目超过 {maxextfield} 个', + 'debate_position_nofound' => '抱歉,发表辩论主题需要输入正方和反方观点', + 'debate_endtime_invalid' => '抱歉,您设置辩论的结束时间小于当前时间', + 'debate_umpire_invalid' => '抱歉,您指定的裁判 ({umpire}) 不存在或者被删除', + 'post_rushreply_timewrong' => '抱歉,抢楼时间范围设置错误', + 'post_newthread_mod_succeed' => '新主题需要审核,您的文章通过审核后才能显示{coverimg}', + 'post_newthread_succeed' => '非常感谢,您的主题已发布,现在将转入主题页,请稍候……
            [ 点击这里转入主题列表 ]{coverimg}', + 'submitcheck_error' => '抱歉,您的提交有误', + 'post_forum_newthread_nopermission' => '抱歉,本版块只有特定用户组可以发新主题', + 'postperm_qqonly_nopermission' => '为避免您的账号被盗用,请您绑定QQ账号后发帖,绑定后请使用QQ账号登录
            ', + 'thread_flood_ctrl_threads_per_hour' => '抱歉,您所在的用户组每小时限制发主题 {threads_per_hour} 个,请稍候再发表', + 'search_forum_invalid' => '抱歉,您尚未指定搜索论坛的范围', + 'search_invalid' => '抱歉,您尚未指定要搜索的关键字或用户名', + 'search_redirect' => '搜索成功,现在将转入结果页面', + 'to_view_the_photo_does_not_exist' => '抱歉,您要查看的相册不存在或正在审核', + 'ban_view_other_thead' => '抱歉,禁止查看其他用户的主题和文章', + 'album_does_not_exist' => '抱歉,指定的相册不存在', + 'is_blacklist' => '抱歉,受对方的隐私设置影响,您目前没有权限进行本操作', + 'content_is_too_short' => '抱歉,输入的内容不能少于 2 个字符', + 'no_privilege_comment' => '抱歉,您目前没有权限进行评论,点击这里查看权限', + 'action_closed' => '抱歉,站点尚未开启此功能或此功能已被管理员禁止', + 'credits_addfunds_ctrl' => '抱歉,您两次提交订单间隔过小', + 'credits_addfunds_toomuch' => '抱歉,您超出本月允许购买 {ec_maxcreditspermonth} 的限额', + 'credits_transaction_amount_invalid' => '抱歉,您要转账或兑换的积分数量输入有误', + 'credits_password_invalid' => '抱歉,您输入的密码错误', + 'credits_transfer_msg_locked' => '抱歉,正在进行其他的积分转账操作,转账失败,请稍后再试', + 'extcredits_dataerror' => '抱歉,兑换失败,请与管理员联系', + 'start_time_is_greater_than_end_time' => '开始日期不能大于结束日期', + 'should_write_that' => '至少应该写点东西', + 'eccredit_nofound' => '指定的评价不存在或已被删除', + 'non_normal_operation' => '非正常操作', + 'failed_to_delete_operation' => '抱歉,删除失败,请检查操作', + 'you_have_friends' => '你们已成为好友', + 'no_privilege_addfriend' => '抱歉,您目前没有权限添加好友,点击这里查看权限', + 'enough_of_the_number_of_friends_with_magic' => '抱歉,您当前的好友数目达到系统限制,请使用好友增容卡增容', + 'enough_of_the_number_of_friends' => '抱歉,您当前的好友数目达到系统限制,请先删除部分好友', + 'specified_user_is_not_your_friend' => '抱歉,指定的用户还不是您的好友', + 'change_friend_groupname_error' => '抱歉,指定的好友用户组不能被操作', + 'the_block_is_not_available' => '抱歉,指定的模块不存在或已关闭', + 'theme_does_not_exist' => '抱歉,指定的风格不存在', + 'trade_credit_invalid' => '抱歉,管理员已关闭积分交易功能', + 'mail_credit_inadequate' => '抱歉,您没有足够的积分来完成此次邀请', + 'send_result_succeed' => '邮件已送出,您的好友可能需要几分钟后才能收到邮件', + 'send_result_resend_error' => '抱歉,尚未找到相应的邀请记录, 邮件重发失败', + 'there_is_no_record_of_invitation_specified' => '您指定的邀请记录不存在', + 'no_color_yet' => '抱歉,您尚未对此信息使用彩色灯', + 'message_can_not_send_onlyfriend' => '抱歉,该用户只接收好友发送的短消息', + 'message_bad_touid' => '抱歉,用户不存在或被冻结,请检查用户uid是否正确', + 'message_can_not_send_2' => '两次发送短消息太快,请稍候再发送', + 'message_can_not_send_9' => '收件人为空或对方屏蔽了您的短消息', + 'pm_report_error_nopm' => '抱歉,您指定的短消息不存在', + 'no_privilege_sendpm' => '抱歉,您目前没有权限发短消息,点击这里查看权限', + 'profile_passwd_illegal' => '抱歉,密码空或包含非法字符', + 'share_does_not_exist' => '抱歉,查看的分享不存在或正在审核', + 'image_does_not_exist' => '抱歉,指定的图片不存在', + 'showcredit_error' => '抱歉,填写的数字需要大于0,并且小于您的积分数,请确认', + 'usergroup_not_found' => '用户组未找到', + 'admin_nopermission' => '抱歉,您没有权限使用管理功能', + 'postcomment_not_found' => '文章点评未找到', + 'special_noaction' => '无法操作特殊主题', + 'admin_moderate_invalid' => '抱歉,您尚未选择主题或主题不可执行此类管理', + 'no_privilege_delpost' => '抱歉,您没有权限删除文章', + 'admin_move_invalid' => '抱歉,目标版块不存在', + 'admin_succeed' => '管理操作成功 ', + 'admin_split_new_invalid' => '抱歉,您尚未选择要分割入新主题的文章', + 'view_images_do_not_exist' => '抱歉,您要查看的图片不存在或正在审核', + 'view_to_info_did_not_exist' => '抱歉,您要查看的信息不存在或已被删除', + 'plugin_module_nonexistence' => '指定的插件模块文件({mod})不存在或存在语法错误,请检查是否已将插件完整上传', + 'postperm_none_nopermission' => '抱歉,您没有权限在该版块发帖

          ', + 'replyperm_none_nopermission' => '抱歉,您没有权限在该版块回帖

          ', + 'getattachperm_none_nopermission' => '抱歉,您没有权限下载本附件

          ', + 'magics_target_member_nonexistence' => '抱歉,您指定的用户不存在或被冻结', + 'unknown_magic' => '抱歉,指定的道具不存在或已被禁止使用', + 'magic_groupid_not_allowed' => '抱歉,您所在的用户组没有权限使用道具', + 'profile_email_illegal' => 'Email 地址无效', + 'profile_email_domain_illegal' => '抱歉,Email 包含不可使用的邮箱域名', + 'profile_email_duplicate' => '该 Email 地址已被注册', + 'profile_secmobile_duplicate' => '该安全手机已被注册', + 'article_category_empty' => '抱歉,栏目不能为空', + 'article_edit_nopermission' => '抱歉,您没有权限进行当前文章操作', + 'post_message_toolong' => '抱歉,您的文章超过 {maxpostsize} 个字符的限制', + 'no_privilege_newbiespan' => '抱歉,您目前处于见习期间,需要等待 {newbiespan} 分钟后才能进行本操作', + 'no_privilege_avatar' => '抱歉,您需要设置自己的头像后才能进行本操作,点击这里设置', + 'no_privilege_secmobile' => '抱歉,您需要验证激活自己的安全手机后才能进行本操作,点击这里验证安全手机', + 'no_privilege_email' => '抱歉,您需要验证激活自己的邮箱后才能进行本操作,点击这里激活邮箱', + 'no_privilege_friendnum' => '抱歉,您需要添加 {friendnum} 个好友之后才能进行本操作,点击这里添加好友', + 'login_seccheck2' => '请输入验证码后继续登录', + 'login_succeed' => '欢迎您回来,{usergroup} {username},现在将转入登录前页面', + 'login_strike' => '密码错误次数过多,请 15 分钟后重新登录', + 'logout_succeed' => '您已退出站点,现在将以游客身份转入退出前页面,请稍候…… {ucsynlogout} ', + 'location_logout_succeed_mobile' => '您已退出站点,现在将以游客身份转入退出前页面,请稍候……', + 'register_activation_invalid' => '抱歉,激活失败,请重新登录验证需要激活的用户', + 'profile_username_tooshort' => '抱歉,您输入的用户名小于 3 个字符,请输入一个较长的用户名', + 'profile_username_toolong' => '抱歉,您的用户名超过 15 个字符,请输入一个较短的用户名', + 'profile_passwd_notmatch' => '抱歉,两次输入的密码不一致', + 'profile_email_not_change' => '抱歉,本站不允许通过前台自行修改账号绑定的邮箱', + 'profile_secmobile_not_change' => '抱歉,本站不允许通过前台自行修改账号绑定的安全手机', + 'profile_secmobicc_illegal' => '安全手机号国际电话区号格式不正确', + 'profile_secmobile_illegal' => '安全手机号格式不正确', + 'profile_username_illegal' => '用户名包含敏感字符', + 'profile_username_duplicate' => '该用户名已被注册', + 'profile_illegal' => '格式不正确或为空', + 'task_nonexistence' => '抱歉,该任务不存在或已被删除', + 'task_not_found' => '任务文件丢失,{taskclassname}', + 'task_not_underway' => '不是进行中的任务', + 'user_banned' => '抱歉,您的 IP 地址不在允许范围内,或您的账号被禁用,无法访问本站点', + 'user_banned_has_expiry' => '抱歉,您的账号被禁用,暂无法访问本站点。
          预计解禁时间:{expiry}', + 'submit_seccode_invalid' => '抱歉,验证码填写错误', + 'submit_invalid' => '抱歉,您的请求来路不正确或表单验证串不符,无法提交', + 'submit_islocked' => '抱歉,您当前的请求正在进行中,请勿重复提交', + 'word_banned' => '抱歉,您填写的内容包含敏感词而无法提交', + 'magics_use_success' => '道具 {magicname} 使用成功 ', + 'magicuse_object_once_limit' => '抱歉,已对该对象使用过此道具,不能重复使用', + 'magicuse_bad_object' => '尚未正确选择道具要作用的对象', + 'magicuse_has_no_valid_friend' => '抱歉,此道具仅对您的好友有效', + 'mobile_template_no_found' => '您访问的页面无手机页面,是否进一步访问电脑版?

          继续访问

          ', + 'medals_existence' => '目前系统内有可用的勋章,请到“勋章中心”取消所有可用勋章后再进行此操作', + 'close_ggcf_before_close_forum' => '请先关闭圈子、导读、淘帖、广播功能后再关闭论坛功能', + 'open_forum_before_open_ggcf' => '请先开启论坛功能后再开启圈子、导读、淘帖、广播功能', + 'portal_status_off' => '抱歉,门户功能尚未开启', + + 'register_check_found' => '该用户名已注册,请更换用户名或登录', + 'register_activation' => '用户名已存在', + 'no_invitation_code' => '抱歉,邀请码为空请填写,没有邀请码不允许注册', + 'wrong_invitation_code' => '抱歉,邀请码错误,请重新填写,没有邀请码不允许注册', + 'username_nonexistence' => '抱歉,指定用户不存在或被冻结', + 'thread_reshreply_membernum' => '共有 {membernum}人参与了本主题', + 'group_name_oversize' => '抱歉,{_G/setting/navs/3/navname}名称超过20个字节将被截断', + 'quickclear_need_operation' => '请选择操作类型', + 'quickclear_success' => '清理完成', + + 'announcement_nonexistence' => '抱歉,目前没有公告供查看', + + 'attachment_expired' => '抱歉,原附件链接已失效
          [ 点击这里重新下载 ]
          [ 点击这里查看原帖 ]', + 'attachment_expired_nosession' => '抱歉,原附件链接已失效
          [ 点击这里查看原帖 ]', + 'attachment_referer_invalid' => '请不要从外部链接下载本站附件', + 'attachment_payto' => '附件所在主题需要付费,请您付费后下载', + 'attachement_payto_attach' => '附件需要付费,请您付费后下载', + + 'forum_passwd_incorrect' => '抱歉,您输入的密码不正确,不能访问这个版块', + 'forum_passwd_correct' => '密码验证成功,请继续可以访问此版块', + 'forum_pay_incorrect' => '抱歉,此版块需要支付 {paycredits} {credits}才能进入此版块,您的{title}不足', + 'forum_pay_correct' => '支付成功,请继续可以访问此版块', + + 'group_rediret_now' => '现在转入{_G/setting/navs/3/navname}首页', + 'group_verify' => '{_G/setting/navs/3/navname}正在审核中', + 'group_has_joined' => '您已加入该{_G/setting/navs/3/navname}', + 'group_join_need_invite' => '该{_G/setting/navs/3/navname}需要邀请才能加入', + 'group_join_succeed' => '成功加入该{_G/setting/navs/3/navname}', + 'group_join_apply_succeed' => '成功申请加入该{_G/setting/navs/3/navname}', + 'group_exit_founder' => '抱歉,{_G/setting/navs/3/navname}创始人不能退出{_G/setting/navs/3/navname}', + 'group_exit_succeed' => '已经成功退出{_G/setting/navs/3/navname}', + 'group_create_usergroup_failed' => '抱歉,您所在的用户组不能建立{_G/setting/navs/3/navname}', + 'group_create_usergroup_credits_failed' => '抱歉,您的积分不足,创建{_G/setting/navs/3/navname}需要消耗 {buildgroupcredits}', + 'group_create_max_failed' => '抱歉,您的建立{_G/setting/navs/3/navname}数量已到达设置上限,不能建立新的{_G/setting/navs/3/navname}', + 'group_category_error' => '抱歉,选择{_G/setting/navs/3/navname}分类错误', + 'group_create_mod_succeed' => '创建{_G/setting/navs/3/navname}的申请已经提交,我们会尽快进行审核', + 'group_create_succeed' => '{_G/setting/navs/3/navname}建立成功 ', + 'group_edit_only_founder' => '抱歉,只有{_G/setting/navs/3/navname}创始人可以修改{_G/setting/navs/3/navname}名称或{_G/setting/navs/3/navname}分类', + 'group_close_only_founder' => '抱歉,只有{_G/setting/navs/3/navname}创始人可以关闭{_G/setting/navs/3/navname}', + 'group_moderate_succeed' => '指定成员已审核通过', + 'group_moderate_failed' => '指定成员已被忽略', + 'group_only_one_moderator' => '抱歉,只剩最后一个圈主,必须由管理员在后台删除{_G/setting/navs/3/navname}', + 'group_choose_member' => '请选择成员', + 'group_level_cannot_do' => '抱歉,目前您的{_G/setting/navs/3/navname}等级没有此功能', + 'group_threadtype_only_founder' => '抱歉,只有{_G/setting/navs/3/navname}创始人可以管理主题分类', + 'group_threadtype_edit_succeed' => '修改主题分类成功 ', + 'group_cannot_demise' => '抱歉,本{_G/setting/navs/3/navname}暂无其他管理成员,不能进行转让', + 'group_demise_choose_receiver' => '抱歉,您尚未选择接收者', + 'group_demise_password' => '为安全起见,请输入您的登录密码', + 'group_demise_password_error' => '抱歉,密码错误', + 'group_demise_receiver_cannot_do' => '抱歉,接收者不能再拥有新的{_G/setting/navs/3/navname}', + 'group_demise_succeed' => '{_G/setting/navs/3/navname}转让成功 ', + 'group_demise_founder_only' => '抱歉,只有{_G/setting/navs/3/navname}创始人才能转让{_G/setting/navs/3/navname}', + 'grouprecommend_succeed' => '操作成功 ', + + 'payonline_succeed' => '支付成功 ', + 'attachment_credit' => '您的 {policymsg} ,现在将开始下载“{filename}”', + 'attachment_yetpay' => '您已购买过此附件,无需重复购买,现在将开始附件下载', + 'attachment_buyall' => '本帖所有附件购买成功 ', + 'attachment_buy' => '附件购买成功,开始下载“{filename}”', + 'attachment_mobile_buy' => '附件购买成功', + 'attachment_locked' => '抱歉,由于您所发起的其他附件购买操作正在进行,因此您无法购买当前附件,请稍后再试', + 'no_privilege_postimage' => '抱歉,您目前没有权限上传图片,点击这里查看权限', + 'no_privilege_postattach' => '抱歉,您目前没有权限上传附件,点击这里查看权限', + 'thread_closed' => '该文章已被关闭,不能评论!', + 'postcomment_error' => '抱歉,您不能点评此帖或文章尚未找到', + 'postappend_not_open' => '抱歉,站点没有开启文章补充功能', + 'postappend_only_yourself' => '只能在自己的文章后补充内容', + 'postappend_add_succeed' => '添加成功 ', + 'replynotice_success_1' => '接收设置成功 ', + 'replynotice_success_0' => '取消设置成功 ', + 'replynotice_error' => '抱歉,回复通知设置失败,主题正在审核或不存在', + 'no_privilege_indexheats' => '抱歉,您没有权限删除论坛热点项目', + 'forum_nopermission' => '本版块只有特定用户组可以访问', + 'thread_poll_invalid' => '抱歉,您没有选择投票选项', + 'poll_not_found' => '投票未找到', + 'poll_overdue' => '抱歉,投票已过期', + 'poll_choose_most' => '抱歉,此投票最多只能选择 {maxchoices} 项', + 'thread_poll_voted' => '抱歉,您已参与过这个投票', + 'thread_poll_none' => '抱歉,本帖非投票帖', + 'thread_poll_nopermission' => '抱歉,您无权查看本帖投票人', + 'thread_rate_moderator_invalid' => '抱歉,作为版主您只能在自己的管辖范围内评分', + 'thread_rate_timelimit' => '抱歉,您不能对发表于 {karmaratelimit} 小时前的文章进行评分', + 'thread_rate_member_invalid' => '抱歉,您不能给自己发表的文章评分', + 'thread_rate_anonymous' => '抱歉,您不能对匿名帖评分', + 'thread_rate_banned' => '抱歉,您不能对屏蔽帖评分', + 'thread_rate_duplicate' => '抱歉,您不能对同一个文章重复评分', + 'thread_rate_range_self_invalid' => '抱歉,您的{extcreditstitle}不足,无法评分', + 'thread_rate_ctrl' => '抱歉,24 小时评分数超过限制', + 'thread_rate_locked' => '抱歉,当前评分正在进行中,请稍后再试', + 'thread_rate_succeed' => '感谢您的参与,现在将转入评分前页面', + 'no_privilege_removerate' => '抱歉,您没有权限撤销评分', + 'thread_rate_removesucceed' => '评分撤销成功 ', + 'member_no_found' => '该用户未找到', + 'thread_warning_nonexistence' => '抱歉,指定文章没有警告记录', + 'thread_pay_error' => '抱歉,您不能购买本主题', + 'credits_balance_insufficient_and_charge' => '抱歉,{title}不足 {minbalance},请【充值】', + 'credits_buy_thread' => '抱歉,您已购买过此主题,请勿重复付费', + 'thread_pay_succeed' => '主题购买成功 ', + 'threadmod_nonexistence' => '抱歉,主题管理记录不存在或已过期删除', + 'reward_cant_operate' => '抱歉,您不能设置最佳答案', + 'reward_cant_self' => '抱歉,您不能把自己的回复设置成最佳答案', + 'reward_repeat_selection' => '抱歉,不能重复选定最佳答案', + 'reward_completion' => '最佳答案设置成功 ', + 'activity_stop' => '抱歉,活动已停止申请', + 'activity_repeat_apply' => '抱歉,活动不能重复申请', + 'activity_imgurl_error' => '图片地址错误 ', + 'activity_exile_field' => '带 "*" 号为必填项,请填写完整', + 'activity_completion' => '活动申请成功 ', + 'activity_cancel_success' => '活动报名取消成功 ', + 'activity_choice_applicant' => '请选择活动的申请者', + 'activity_notification_user' => '请选择要发送的用户', + 'activity_notification_reason' => '请在附言框中填写通知内容', + 'activity_notification_success' => '活动通知发送成功 ', + 'activity_delete_completion' => '活动列表清理成功', + 'activity_auditing_completion' => '活动人员审核成功', + 'no_privilege_tradeorder' => '抱歉,您没有权限管理此柜台的商品', + 'trade_displayorder_updated' => '柜台商品摆放顺序已更新', + 'debate_poll_nopermission' => '抱歉,请您先登录,然后再进行投票', + 'debate_poll_myself' => '抱歉,您不能给自己投票', + 'debate_umpire_edit_invalid' => '抱歉,您发表的评论已超过一个小时,您不能再进行编辑', + 'debate_umpire_nopermission' => '抱歉,您不是裁判,不能对此辩论进行评判', + 'debate_umpire_nofound_bestdebater' => '抱歉,您没有填写最佳辩手', + 'debate_umpire_nofound_winner' => '抱歉,您没有填写获胜方', + 'debate_umpire_nofound_point' => '抱歉,您没填写您的观点', + 'debate_umpire_comment_succeed' => '评判成功 ', + 'no_privilege_recommend' => '抱歉,您目前没有权限评价此主题,点击这里查看权限', + 'recommend_self_disallow' => '评价指数 {recommendc}
          您不能评价自己的文章', + 'recommend_duplicate' => '评价指数 {recommendc}
          您已评价过本主题', + 'recommend_outoftimes' => '评价指数 {recommendc}
          今日评价机会已用完', + 'recommend_daycount_succeed' => '评价指数 {recommendc} {recommendv}
          您今天还能评价 {daycount} 次', + 'recommend_succeed' => '评价指数 {recommendc} {recommendv}', + 'thread_poll_voter_isnull' => '暂时还没有人参与投票,不能添加标签。', + 'thread_activityapply_isnull' => '暂时还没有人参加活动,不能添加标签。', + 'forum_usertag_set_continue' => '共 {count} 个用户,正在设置 {limit} 至 {next} 个用户,请稍候 ', + 'forum_usertag_succeed' => '用户标签设置成功 ', + + 'group_admin_enter_panel' => '请进入{_G/setting/navs/3/navname}管理页面进行管理', + + 'forum_group_not_groupmember' => '抱歉,您还不是本{_G/setting/navs/3/navname}成员不能发帖
          马上加入该{_G/setting/navs/3/navname}', + 'forum_group_not_groupmember_guest' => '抱歉,您还不是本{_G/setting/navs/3/navname}成员不能发帖', + 'forum_disablepost' => '本版块禁止发帖', + 'post_newbie_span' => '抱歉,您在注册时间起 {newbiespan} 分钟后才能拥有发帖权限', + 'post_hide_nopermission' => '抱歉,您没有权限使用 [hide] 代码', + 'reward_credits_closed' => '交易积分被关闭,请联系管理员。', + 'forum_access_disallow' => '抱歉,您在本版没有权限进行此操作', + + 'post_check' => '抱歉,指定的文章不存在或已被删除或正在被审核
          [ 尝试点击这里转入主题 ]', + 'redirect_nextnewset_nonexistence' => '抱歉,没有比当前更新的主题', + 'redirect_nextoldset_nonexistence' => '抱歉,没有比当前更早的主题', + + 'trade_credits_no_enough' => '抱歉,您的 {credittitle} 不足,无法用 {credittitle} 换取商品的优惠', + 'trade_directtopay' => '订单提交成功,现在将跳转到支付页面', + 'trade_password_error' => '抱歉,您输入的密码不正确,不能修改订单状态', + 'trade_orderstatus_updated' => '交易单状态更新成功 ', + 'trade_pricecredit_error' => '商品基价输入错误', + 'trade_not_found' => '没有找到商品', + 'trade_invalid' => '无效的交易请求', + 'trade_by_myself' => '抱歉,您无法购买自己的商品', + 'trade_order_created' => '交易单创建成功,现在将转入交易单页面', + + 'post_not_found' => '没有找到文章', + + 'setup_finished' => '设置成功 ', + + 'follow_visituser_not_exist' => '抱歉,您所访问的用户不存在', + + 'not_open_invite' => '抱歉,本站目前暂时不允许用户通过邀请链接注册', + 'invite_accept_no' => '当前好友邀请已被忽略', + 'invite_code_fuid' => '抱歉,您访问的邀请链接已被使用', + 'invite_code_endtime_error' => '抱歉,您访问的邀请链接已失效', + 'should_not_invite_your_own' => '抱歉,您不能通过访问自己的邀请链接来邀请自己', + 'invite_friend_ok' => '好友邀请确认成功 ', + + 'magics_close' => '抱歉,道具中心关闭', + 'magics_buy_succeed' => '您用 {credit} 购买了 {num} 张{magicname}', + 'magics_buygive_succeed' => '您用 {credit} 购买了 {num} 张{magicname},并把它送给了 {toname}', + 'magics_use_nopermission' => '抱歉,您没有权限使用该道具', + 'magics_outofperoid_1' => '抱歉,今天您只能使用 {usenum} 次本道具', + 'magics_outofperoid_2' => '抱歉,一周您只能使用 {usenum} 次本道具', + 'magics_outofperoid_3' => '抱歉,一个月您只能使用 {usenum} 次本道具', + 'magics_outofperoid_4' => '抱歉,24 小时内您只能使用 {usenum} 次本道具', + 'magics_sell_succeed' => '您卖出了 {num} 张{magicname},获得 {credit}', + 'magics_drop_succeed' => '您丢弃了 {num} 张{magicname}', + + 'medal_apply_invalid' => '抱歉,此勋章不可申请', + 'medal_permforum_nopermission' => '抱歉,您尚未达到领取该勋章的条件


          所需条件:

          {formulamessage}

          您的信息:

          {usermsg} ', + 'medal_not_get_credit' => '抱歉,您的{credit}不足,无法购买此勋章', + 'medal_get_succeed' => '恭喜您获得{medalname}', + 'medal_apply_succeed' => '勋章{medalname}申请成功,请等待管理员审核。', + + 'enter_the_space' => '进入个人空间页面', + + 'task_close' => '抱歉,站点任务关闭', + 'task_relatedtask' => '申请此任务需要先完成另一个任务,任务页面跳转中请稍候……', + 'task_exclusivetask' => '抱歉,您已领取且未放弃另一个任务,不能再申请或完成此任务', + 'task_grouplimit' => '抱歉,您所在的用户组不允许申请此任务', + 'task_duplicate' => '抱歉,您已申请过此任务,请不要重复申请', + 'task_nextperiod' => '抱歉,本期您已申请过此任务,请下期再来', + 'task_applied' => '任务申请成功 ', + 'task_deleted' => '您已放弃该任务,您还可以继续完成其他任务或者申请新任务', + 'task_up_to_limit' => '抱歉,该任务仅限 {tasklimits} 人领取奖励,按照先到先得的原则,您无法领取奖励,请下次再来', + 'task_failed' => '抱歉,您没能在指定时间内完成任务', + 'task_completed' => '恭喜您,任务已成功完成,您将收到奖励通知,请注意查收', + 'task_giveup' => '您已放弃此任务', + + 'activate_succeed' => '您好,{username},您的账号已被成功激活,现在将转入站点首页', + + 'login_clearcookie' => '登录痕迹已清除', + + 'register_verify_invalid' => '站点设置了人工验证注册用户,请等待验证通过', + 'email_verify_invalid' => '抱歉,您在 24 小时内只能提交一次验证 Email 请求', + 'email_verify_succeed' => '确认 Email 已发送,请用邮件中提供的方法激活您的账号', + + 'getpasswd_illegal' => '抱歉,您所用的 ID 不存在或已过期,无法取回密码', + 'getpasswd_succeed' => '您的密码已重新设置,请使用新密码登录', + + 'lostpasswd_email_not_exist' => '抱歉,使用此 Email 的用户不存在,不能使用取回密码功能', + 'lostpasswd_many_users_use_email' => '抱歉,存在多个使用此 Email 的用户,请填写您需要找回密码的用户名', + 'getpasswd_account_invalid' => '抱歉,创始人、受保护用户、拥有站点设置权限的用户不能使用取回密码功能', + 'getpasswd_send_succeed' => '取回密码的方法已通过 Email 发送到您的信箱中,
          请在 3 天之内修改您的密码', + 'getpasswd_has_send' => '您已经发送过取回密码邮件了,如果您没有收到,请稍等 {interval} 秒后重试发送取回密码邮件', + + 'submit_verify_succeed' => '审核请求提交成功,现在将返回个人中心', + + 'buyinvitecode_no_count' => '未填写购买邀请码数量,请返回', + 'buyinvitecode_email_error' => '邮件地址未填或格式错误', + 'buyinvitecode_no_id' => '没有找到相应的邀请码,如有问题请联系管理员', + + 'faq_content_empty' => '抱歉,指定的帮助项目不存在', + 'faq_keywords_empty' => '抱歉,您尚未指定要搜索的关键字', + + 'login_reward_succeed' => '签到成功!', + 'login_reward_error' => '抱歉,您今天已经签过到了哦!', + + 'imagepreview_errorcode_0' => '图片不符合处理条件,无法处理', + 'imagepreview_errorcode_-1' => '无效的图片,无法处理', + 'imagepreview_errorcode_-2' => '文件读写权限不足,无法处理图片', + 'imagepreview_errorcode_-3' => '系统设置错误,无法处理图片', + 'imagepreview_errorcode_-4' => '服务器缺少处理图片所需的功能,无法处理', + + 'group_invite_failed' => '抱歉,您不是本{_G/setting/navs/3/navname}成员,不能邀请', + 'noperm_at_user' => '您没有@用户的权限', + 'thread_at_usernum_limit' => '本主题的@用户数达到上限', + + 'ranklist_status_off' => '排行榜功能关闭', + + 'report_parameters_invalid' => '页面参数错误,暂不能举报', + 'report_succeed' => '举报成功 ', + + 'tag_closed' => '抱歉,管理员锁定了此标签', + + 'portal_attachment_noexist' => '抱歉,指定下载的文件不存在', + 'portal_attachment_nopermission_delete' => '抱歉,您没有权限删除该文件', + 'portal_image_noexist' => '图片已删除', + + 'block_choose_bid' => '抱歉,您尚未正确指定要查看的模块', + 'block_noexist' => '抱歉,您指定要查看的模块不存在', + 'block_nomore' => '抱歉,您指定要查看的模块不存在更多信息', + + 'comment_no_aid_id' => '抱歉,您尚未正确指定要查看的文章 ID', + 'comment_no_topicid_id' => '抱歉,您尚未正确指定要查看的专题 ID', + 'comment_aid_no_exist' => '抱歉,您指定要查看的文章不存在', + 'comment_topicid_no_exist' => '抱歉,您指定要查看的专题不存在', + + 'list_choose_category' => '抱歉,您尚未正确指定要查看的分类', + 'list_category_noexist' => '抱歉,您指定要查看的分类不存在', + 'list_category_is_closed' => '抱歉,您指定要查看的分类已关闭', + + 'topic_is_closed' => '抱歉,此专题当前尚未开放', + + 'view_no_article_id' => '抱歉,您尚未正确指定要查看的文章 ID', + 'view_article_no_exist' => '抱歉,您指定要查看的文章不存在或正在审核', + + 'search_album_closed' => '抱歉,相册搜索已关闭', + + 'search_blog_closed' => '抱歉,日志搜索已关闭', + + 'search_forum_closed' => '抱歉,论坛搜索已关闭', + + 'search_group_closed' => '抱歉,{_G/setting/navs/3/navname}搜索已关闭', + + 'search_portal_closed' => '抱歉,文章搜索已关闭', + + 'collection_comment_closed' => '抱歉,管理员没有开放淘专辑的评论功能', + 'collection_comment_succ' => '发表评论成功', + 'collection_comment_remove_succ' => '评论成功删除', + 'collection_recommend_url' => '请填写主题地址', + 'collection_recommend_succ' => '已经成功向淘专辑作者发送了推荐消息', + 'collection_recommend_message' => '{fromuser} 向您的专辑《{collectioname}》推荐了一个主题:[url]{url}[/url]', + + 'collection_create_exceed_limit' => '抱歉,已经超过了可以创建的淘专辑数量', + 'collection_create_succ' => '新建淘专辑成功,即将进入淘专辑页面', + 'collection_edit_succ' => '淘专辑编辑成功,即将进入淘专辑页面', + 'collection_delete_succ' => '删除淘专辑成功,即将进入我的专辑', + 'collection_forum_deny' => '抱歉,管理员设置了本版主题不能被加入淘专辑', + 'collection_none_avail_collection' => '抱歉,现在没有可以能够淘帖的淘专辑,您所在的用户组也无法再创建新的淘专辑。', + 'collection_no_selected' => '您还没有选择可以添加的淘专辑', + 'collection_non_creator' => '抱歉,只有创建人和参与者可以管理淘专辑', + 'collection_thread_exists' => '您选择的主题已经在淘专辑中了,不需要重复添加', + 'collection_collect_succ' => '淘帖成功,主题已经被加入到相应淘专辑中', + 'collection_no_thread' => '无法找到要删除的主题,请先选择要删除的主题', + 'collection_remove_thread' => '删除淘专辑内主题成功,即将返回淘专辑页面', + 'collection_teamworkers_noselect' => '您还没有选择要邀请的用户', + 'collection_no_teamworkers' => '邀请参与维护的用户不存在或被冻结', + 'collection_non_friend' => '只能邀请自己的好友加入维护淘专辑', + 'collection_teamworkers_exists' => '邀请参与维护的用户已在共同维护名单中', + 'collection_invite_succ' => '邀请成功,等待该用户接受邀请后即可成为淘专辑共同维护者,邀请7天内有效。', + 'collection_invite_accept' => '接受邀请成功,您已经成为该淘专辑的共同维护者', + 'collection_remove_deny' => '抱歉,只有创建人和管理员可以维护淘专辑', + 'collection_teamworkers_nonexists' => '抱歉,没有找到该共同维护者', + 'collection_teamworkers_exit_succ' => '取消共同维护成功,即将进入淘帖首页', + + 'collection_follow_limited' => '关注淘专辑的数量不能超过 {limit} 个', + 'collection_follow_succ' => '成功订阅淘专辑', + 'collection_unfollow_succ' => '成功取消订阅淘专辑', + + 'email_check_sucess' => '您的邮箱({email})验证激活成功 ', + 'email_check_account_invalid' => '抱歉,受保护用户或创始人不能使用邮箱验证,直接修改用户信息。', + 'email_check_error' => '抱歉,您输入的邮箱验证链接不正确。您可以在个人资料页面,重新接收新的邮箱验证链接', + + 'news_does_not_exist' => '抱歉,您指定的信息不存在', + 'proved_to_be_successful' => '验证成功,现在进入查看页面', + 'password_is_not_passed' => '抱歉,您输入的网站登录密码不正确', + + 'not_open_updatestat' => '站点尚未开启趋势统计功能', + 'no_privilege_statdata' => '抱歉,您目前没有权限查看统计数据报表,点击这里查看权限', + 'start_time_end_time_is_equal_to' => '开始日期不能等于结束日期', + + 'modcp_ann_nofound' => '抱歉,该公告已删除或您没有权限编辑它', + 'modcp_ann_empty' => '您必须输入公告标题和内容', + 'modcp_ann_urlerror' => '网址链接无效', + + 'recommend_expiration_invalid' => '时间期限格式无效,正确格式为“yyyy-mm-dd hh:mm”', + + 'members_edit_succeed' => '用户信息成功更新,请继续操作', + 'modcp_member_ban_illegal' => '您不能直接禁止该用户', + 'modcp_member_ban_succeed' => '用户资料成功更新', + + 'modcp_noaction' => '您没有选择执行任何操作', + 'modcp_moduser_invalid' => '审核失败, 尚未找到相应的用户', + + 'modcp_report_success' => '处理成功,现在返回管理面板', + + 'portal_category_not_find' => '抱歉,您指定的分类尚未找到', + 'portal_category_disallowpublish' => '抱歉,此分类不允许发布文章', + 'title_not_too_little' => '标题不能少于最少字符限制', + 'article_choose_system_category' => '请选择一个合适的系统分类', + 'no_posts_for_pushplus' => '抱歉,您尚未指定要添加的文章', + 'pushplus_do_success' => '已成功添加指定文章到文章', + 'article_passed' => '文章已通过审核', + 'article_ignored' => '文章已忽略', + 'article_deleted' => '文章已删除', + 'select_operation' => '请选择一个操作项', + 'article_move_success' => '文章转移成功 ', + 'article_move_select_cat' => '请选择要转移到的目标栏目', + 'all_posts_pushed_already' => '所有指定文章均已连载过了', + 'portal_has_not_category' => '抱歉,您尚未创建任何频道栏目,请先创建频道栏目', + 'portal_article_add_nopermission' => '抱歉,您没有发布文章的权限', + 'article_push_blogid_invalid_repeat' => '该日志已生成过文章,不能重复生成', + 'article_push_tid_invalid_repeat' => '该文章已生成过文章,不能重复生成', + 'article_push_invalid_private' => '该日志因隐私设置不能进行生成文章操作', + + 'block_not_exist' => '抱歉,您指定的模块不存在', + 'block_topic_nopermission' => '抱歉,您没有权限添加专题模块', + 'block_add_nopermission' => '抱歉,您没有权限添加此模块', + 'block_no_recommend_library' => '此模块不含推荐库', + 'data_in_mod_library' => '
          该数据已在模块推送库且不是您推送的此条数据,您无权进行修改
          ', + 'block_data_type_invalid' => '数据类型不匹配,无法推送', + 'no_right_manage_data' => '抱歉,您没有权限管理该模块的推荐数据', + + 'comment_edit_noexist' => '抱歉,您要编辑的评论不存在', + 'comment_delete_noexist' => '抱歉,您要删除的评论不存在', + + 'diy_topic_noexist' => '指定的专题不存在', + 'diy_remote_upload_failed' => '远程上传失败', + 'diy_sign_invalid' => 'DIY模板数据验证错误', + 'diy_backup_noexist' => '备份文件不存在', + 'diy_data_format_invalid' => '数据格式错误', + 'diy_no_export_data' => '没有可以导出的数据', + 'diy_export_no_data' => '此页面无DIY数据', + 'diy_export_tpl_invalid' => '指定的页面标识不正确', + 'diy_operation_invalid' => '错误的操作', + 'diy_nopermission' => '抱歉,您没有DIY权限', + + 'portalcp_block_push_the_update_line' => '所选的模块已加入更新队列', + 'select_a_option' => '请选择一项操作', + 'select_a_moderate_data' => '请选择至少一条审核数据', + 'operation_done' => '进行的操作成功 ', + + 'post_edit_nopermission' => '抱歉,您没有权限编辑他人发表的文章', + 'post_edit_timelimit' => '抱歉,您的文章从发表到现在已超过 {edittimelimit} 分钟,不能再进行编辑', + 'debate_umpire_comment_invalid' => '抱歉,裁判已进行过评判,您不能再进行编辑', + 'post_edit_nopermission_threadplign' => '抱歉,您没有权限编辑本文章或特殊帖功能已关闭', + 'reward_credits_invalid' => '抱歉,悬赏积分设置不合理', + 'reward_credits_fall' => '抱歉,悬赏积分不能减少', + 'post_edit_thread_replaycredit_nocredit' => '您的积分不足,不能为回帖奖励增加积分', + 'post_edit_thread_ban_del' => '抱歉,编辑文章时不允许删除文章', + 'post_edit_reward_already_reply' => '抱歉,您不能删除已经有回复的悬赏', + 'post_edit_thread_already_reply' => '对不起,您不能删除已经有回复的主题,请返回。', + 'post_edit_reward_nopermission' => '抱歉,悬赏已结束,无法退还积分', + 'post_edit_delete_rushreply_nopermission' => '抱歉,抢楼帖不能删除', + 'auditstatuson_succeed' => '审核成功,点击查看该帖', + 'audit_edit_succeed' => ' 编辑成功,点击关闭本页', + 'edit_newthread_mod_succeed' => '编辑后的主题需要审核,请等待审核通过', + 'edit_reply_mod_succeed' => '编辑后的回复需要审核,请等待审核通过', + 'post_edit_succeed' => '文章编辑成功,现在将转入主题页,请稍候……
          [ 点击这里转入主题列表 ]', + + 'post_forum_newreply_nopermission' => '抱歉,本版块只有特定用户组可以回复', + 'comment_add_succeed' => '文章点评成功 ', + 'post_rushreply_creditlimit' => '抱歉,您的 {creditlimit_title} 不足,本抢楼帖限制最小 {creditlimit_title} 为 {creditlimit}', + 'trade_newreply_nopermission' => '抱歉,只有已开放的商品主题可以回复', + 'post_reply_succeed' => '非常感谢,回复发布成功,现在将转入主题页,请稍候……
          [ 点击这里转入主题列表 ]', + 'trade_add_succeed' => '非常感谢,您的商品已经发布,现在将转入主题页,请稍候……
          [ 继续添加商品请点击这里 ]
          [ 点击这里转入主题列表 ]', + + 'postperm_login_nopermission_mobile' => '您尚未登录,没有权限在该版块发帖', + 'post_sort_isnull' => '抱歉,您尚未选择主题的分类信息', + 'post_poll_inputmore' => '抱歉,您至少应当填写 2 个投票选项', + 'poll_maxchoices_expiration_invalid' => '抱歉,最多可选项数与有效记票天数只接受数字', + 'reward_credits_please' => '抱歉,悬赏积分不能为空', + 'reward_credits_overflow' => '抱歉,悬赏积分不能高于 32767', + 'reward_credits_lower' => '抱歉,悬赏积分必须大于 {minrewardprice}', + 'threadtype_expiration_invalid' => '抱歉,此主题必须指定有效期', + 'replycredit_morethan_self' => '抱歉,回帖送积分额度大于您的积分', + 'post_newthread_set_cover' => '正在设置主题封面,   ', + + 'search_threadtype_invalid' => '抱歉,您尚未输入要搜索的分类信息项目', + + 'home_no_privilege' => '抱歉,您需要登录后才能查看', + 'no_privilege_profile' => '抱歉,您没有权限查看个人资料', + + 'member_nonexistence' => '抱歉,指定的用户不存在或被冻结', + + 'photos_do_not_support_the_default_settings' => '抱歉,默认相册不支持本设置', + 'no_privilege_album_edit' => '抱歉,您没有权限编辑此相册', + 'album_name_errors' => '抱歉,您尚未正确设置相册名', + 'spacecp_edit_ok' => '设置保存成功 ', + 'no_privilege_upload_avatar' => '抱歉,您目前没有权限上传头像', + 'no_privilege_album_del' => '抱歉,您没有权限删除此相册', + 'no_privilege_album_delother' => '抱歉,您没有权限删除其他人的相册', + 'no_privilege_pic_edit' => '抱歉,您没有权限编辑此相册中的图片', + 'no_privilege_edithot_album' => '抱歉,您没有权限调整此相册的热度', + + 'no_authority_to_add_log' => '您目前没有权限添加日志', + 'no_authority_operation_of_the_log' => '抱歉,您没有权限操作该日志', + 'no_privilege_blog' => '抱歉,您目前没有权限发表日志,点击这里查看权限', + 'blog_choose_system_category' => '抱歉,请选择系统分类', + 'that_should_at_least_write_things' => '至少应该写一点东西', + 'failed_to_stick_operation' => '抱歉,只能置顶自己的日志,且日志已被审核通过', + 'no_privilege_edithot_blog' => '抱歉,您没有权限调整此日志的热度', + + 'did_not_specify_the_type_of_operation' => '抱歉,您尚未正确指定要操作的分类', + 'enter_the_correct_class_name' => '抱歉,请正确输入分类名', + + 'click_error' => '抱歉,您尚未进行正常的表态操作', + 'click_item_error' => '要表态的对象不存在', + 'no_privilege_click' => '抱歉,您目前没有权限进行表态,点击这里查看权限', + 'click_no_self' => '您不能给自己表态', + 'click_have' => '您已表过态', + 'click_success' => '表态成功 ', + + 'no_privilege_comment_edit' => '抱歉,您没有权限编辑此评论', + 'no_privilege_comment_del' => '抱歉,您没有权限删除此评论', + 'comments_do_not_exist' => '抱歉,您指定的评论不存在', + + 'memcp_credits_card_msg_cardid_incorrect' => '抱歉,您尚未输入充值卡密', + 'memcp_credits_card_msg_card_unfined' => '抱歉,您要使用的卡密不存在', + 'memcp_credits_card_msg_used' => '抱歉,此卡密已使用', + 'memcp_credits_card_msg_cleardateline_early' => '抱歉,此卡密已过期', + 'memcp_credits_card_msg_succeed' => '{extcreditsval}{extcreditstitle},充值成功 ', + 'memcp_credits_addfunds_msg_incorrect' => '抱歉,您尚未输入需要充值的数量', + 'memcp_credits_addfunds_msg_notype' => '抱歉,您尚未选择支付方式', + 'memcp_credits_exchange_msg_locked' => '抱歉,正在进行其他的积分兑换操作,兑换失败,请稍后再试', + 'credits_addfunds_amount_invalid' => '您单次购买的积分数量超出最大值 {ec_maxcredits} 或最小值 {ec_mincredits} 的限制', + 'memcp_credits_transfer_msg_self_incorrect' => '您无需给自己转账', + 'credits_transfer_balance_insufficient' => '抱歉,转账后 {title}不足 {minbalance}', + 'credits_net_amount_iszero' => '本交易扣除积分交易税后的净值为 0', + 'memcp_credits_transfer_msg_user_incorrect' => '抱歉,您尚未输入转账接收人或者接收人不存在或被冻结', + 'credits_transfer_succeed' => '积分转账成功 ', + 'memcp_credits_exchange_msg_num_invalid' => '您要兑换的积分相同,无法兑换', + 'credits_exchange_invalid' => '兑换的积分方案有错,不能进行兑换', + 'extcredits_disallowexchangeout' => '{credittitle} 不允许兑出', + 'extcredits_disallowexchangein' => '{credittitle} 不允许兑入', + 'memcp_credits_exchange_msg_balance_insufficient' => '抱歉,您尚未输入需要兑换的数量', + 'credits_exchange_balance_insufficient' => '抱歉,兑换后{title}不足 {minbalance}', + 'credits_transaction_succeed' => '积分操作成功 ', + + 'no_privilege_doing' => '抱歉,您目前没有权限发表记录,点击这里查看权限', + 'no_privilege_doing_comment' => '抱歉,您目前没有权限评论记录,点击这里查看权限', + 'docomment_error' => '抱歉,请正确指定要评论的记录', + + 'no_privilege_spacedomain' => '抱歉,您没有权限设置空间域名', + 'domain_succeed' => '空间域名保存成功 ', + + 'eccredit_order_notfound' => '抱歉,您指定的订单不存在或已被删除', + 'eccredit_rate_repeat' => '抱歉,您不能重复评价', + 'eccredit_succeed' => '评价成功 ', + 'eccredit_reexplanation_repeat' => '请勿重复解释', + 'eccredit_reexplanation_closed' => '抱歉,允许解释的有效期已过', + + 'favorite_delete_succeed' => '收藏删除成功 ', + 'favorite_does_not_exist' => '抱歉,您指定的收藏不存在', + 'no_privilege' => '抱歉,您目前没有权限进行此操作,点击这里查看权限', + 'favorite_cannot_favorite' => '抱歉,您指定的信息无法收藏', + 'favorite_repeat' => '抱歉,您已收藏,请勿重复收藏', + 'favorite_do_success' => '信息收藏成功 ', + + 'feed_no_found' => '抱歉,您指定要查看的动态不存在', + 'no_privilege_feed_del' => '抱歉,您没有权限删除此动态', + + 'follow_not_follow_self' => '不能关注自己', + 'follow_not_follow_others' => '您当前用户组不允许收听他人', + 'follow_other_unfollow' => '对方不允许您关注TA', + 'follow_followed_ta' => '您已经收听了TA', + 'follow_add_succeed' => '成功收听', + 'follow_cancel_succeed' => '取消成功', + 'follow_not_assignation_user' => '未指定用户', + 'follow_remark_succeed' => '备注成功', + 'follow_anonymous_unfollow' => '匿名文章不允许被转播', + 'follow_content_not_exist' => '转播的内容不存在', + 'follow_input_word_limit' => '您输入的转播理由超过140个字', + 'follow_only_allow_the_relay_time' => '抱歉,第二次转播必须同时进行回帖操作', + 'relay_feed_success' => '转播成功', + 'follow_specify_follow_not_exist' => '指定的广播记录不存在', + + 'friend_self_error' => '抱歉,您不能加自己为好友', + 'friends_add' => '您已和{username}成为好友', + 'waiting_for_the_other_test' => '正在等待验证', + 'request_has_been_sent' => '好友请求已发送,请等待对方验证', + 'friend_addconfirm_next' => '您已和{username}成为好友,处理下一个好友请求中……(停止处理)', + 'please_correct_choice_groups_friend' => '请正确选择分组好友', + 'unable_to_manage_self' => '抱歉,您不能对自己进行操作', + 'username_less_two_chars' => '抱歉,您填写的用户名不能少于2个字符', + + 'space_data_format_invalid' => '数据格式错误', + + 'close_invite' => '抱歉,您目前还没有权限邀请好友', + 'mail_invite_not_allow' => '抱歉,您没有权限使用邮件邀请', + 'mail_can_not_be_empty' => '抱歉,邮件列表不能为空', + 'max_invitenum_error' => '抱歉,24小时内您只能获得 {maxnum} 个邀请码', + + 'no_flicker_yet' => '抱歉,您尚未对此信息使用彩虹炫', + 'haved_red_bag' => '您已领取此次红包', + 'haved_red_bag_gain' => '您已领到红包:获得 {percredit} {credittype}', + 'space_no_red_bag' => '抱歉,空间主人尚未设置红包或已被领完', + 'red_bag_no_credits' => '红包已被领完', + 'return_red_bag' => '红包回收成功 {leftcredit} {credittype}', + + 'delete_pm_error_option' => '抱歉,您的操作有误', + 'delete_pm_success' => '进行的短消息操作成功 ', + 'this_message_could_note_be_option' => '抱歉,您的操作有误', + 'unable_to_send_air_news' => '抱歉,不能发送空消息', + 'message_bad_touser' => '抱歉,用户不存在或被冻结,请检查用户名是否正确', + 'message_can_not_send_to_self' => '不能给自己发送短消息', + 'message_send_result' => '短消息已发送完成。共有 {succeed} 个用户发送成功,以下用户({users})发送失败请检查用户名是否拼写正确或对方不接收非好友短消息', + 'message_can_not_send_1' => '发送失败,您当前超出了24小时内两人会话的上限', + 'message_can_not_send_3' => '抱歉,您不能给非好友批量发送短消息', + 'message_can_not_send_4' => '抱歉,您目前还不能使用发送短消息功能', + 'message_can_not_send_5' => '您超出了24小时内群聊会话的上限', + 'message_can_not_send_6' => '对方屏蔽了您的短消息', + 'message_can_not_send_7' => '超过了群聊人数上限', + 'message_can_not_send_8' => '抱歉,您不能给自己发短消息', + 'message_can_not_send_10' => '发起群聊人数不能小于两人', + 'message_can_not_send_11' => '该会话不存在', + 'message_can_not_send_12' => '抱歉,您没有权限操作', + 'message_can_not_send_13' => '这不是群聊消息', + 'message_can_not_send_14' => '这不是私人消息', + 'message_can_not_send_15' => '数据有误', + 'message_can_not_send_16' => '您超出了24小时内发短消息数量的上限', + 'message_can_not_send' => '抱歉,发送短消息失败', + 'pm_onlyacceptfriend_error' => '抱歉,您的操作有误', + 'do_success_pm' => '短消息设置成功 ', + 'pm_report_error_nome' => '您不能举报自己的短消息或公共群发短消息', + 'pm_report_error_nopmreportuser' => '抱歉,您尚未指定短消息举报人', + 'pm_ignore_error_nopm' => '抱歉,您指定的用户不存在或被冻结', + 'pm_kickmember_error_nopm' => '抱歉,您要踢除的用户不存在或被冻结', + 'pm_appendkmember_error_nopm' => '抱歉,您要添加的用户不存在或被冻结', + 'message_can_not_append_reason' => '抱歉,以下用户列表加入圈子失败 {cannotappend}', + 'pm_export_touser_not_exists' => '抱歉,您尚未指定导出短消息对象', + 'pm_emport_banned_export' => '抱歉,没有用于导出的短消息记录', + + 'not_to_their_own_greeted' => '不能向自己打招呼', + 'no_privilege_poke' => '抱歉,您目前没有权限打招呼,点击这里查看权限', + 'poke_success' => '已发送,{username}下次访问时会收到通知', + 'has_been_hailed_overlooked' => '招呼已忽略', + + 'profile_passwd_empty' => '请设置新密码', + 'profile_passwd_wrong' => '原密码不正确,您不能修改密码或 Email 或安全提问', + 'profile_email_verify' => '确认 Email 已发送,请用邮件中提供的方法激活您的账号。如果您尚未收到我们发送的系统邮件,请点击密码安全中的“重新接收验证邮件”,或尝试更换另外一个地址', + 'profile_succeed' => '个人资料保存成功 ', + 'send_activate_mail_succeed' => '邮件已发送,可能需要几分钟后才能收到邮件', + 'send_activate_mail_error' => '抱歉,邮件已发送过了,若确实未收到,请在 {interval} 秒后重试', + + 'no_privilege_sendmailday' => '抱歉,本站尚未开启邮件提醒功能', + 'email_input' => '抱歉,您尚未设置邮箱,请在联系方式中准确填写您的邮箱', + + 'no_privilege_edithot_share' => '抱歉,您没有权限调整此分享的热度', + 'no_privilege_share' => '抱歉,您目前没有权限发布分享,点击这里查看权限', + 'blog_does_not_exist' => '抱歉,指定的日志不存在', + 'moderate_blog_not_share' => '抱歉,您不能分享尚未通过审核的日志', + 'logs_can_not_share' => '抱歉,指定的日志因隐私设置不能够被分享', + 'album_can_not_share' => '抱歉,指定的相册因隐私设置不能够被分享', + 'moderate_pic_not_share' => '抱歉,您不能分享尚未通过审核的图片', + 'image_can_not_share' => '抱歉,指定的图片因隐私设置不能够被分享', + 'moderate_thread_not_share' => '抱歉,不能分享尚未通过审核的主题', + 'article_does_not_exist' => '抱歉,指定的话题不存在', + 'moderate_article_not_share' => '抱歉,不能分享尚未通过审核的文章', + 'url_incorrect_format' => '抱歉,分享的网址格式不正确', + 'no_privilege_commentadd' => '抱歉,您没有权限发表评论', + 'do_success_thread_share_mod' => '您的分享成功了,回复请等待管理员审核通过', + 'spacecp_share_repeat' => '抱歉,您已分享,请勿重复分享', + + 'showcredit_fuid_error' => '抱歉,您指定的用户不是您的好友,请确认', + 'showcredit_friend_do_success' => '上榜积分赠送成功,好友会收到通知', + 'showcredit_do_success' => '上榜积分增加成功,赶快查看自己的最新排名吧', + + 'upload_select_image' => '请选择要上传的相册图片', + 'upload_images_completed' => '图片上传成功 ', + 'no_privilege_upload' => '抱歉,您目前没有权限上传图片,点击这里查看权限', + + 'usergroups_span_invalid' => '抱歉,您至少需要支付 {minspan} 天的积分价格', + 'usergroups_join_succeed' => '您已加入用户组 {group}', + 'usergroups_exit_succeed' => '您已退出用户组 {group}', + 'usergroup_switch_not_allow' => '您当前的用户组未到期,无法切换到其他用户组', + 'usergroup_switch_not_allowvisit' => '抱歉,您无法切换到不能访问论坛的用户组', + 'usergroups_switch_succeed' => '您已切换到用户组 {group}', + + 'no_privilege_banpost' => '抱歉,您没有权限屏蔽主题', + 'admin_banpost_invalid' => '抱歉,您尚未选择要屏蔽的文章', + + 'no_privilege_copythread' => '抱歉,您没有权限或主题不存在', + + 'no_privilege_delcomment' => '抱歉,您没有权限删除点评', + + 'admin_delpost_invalid' => '抱歉,您尚未选择要删除的文章', + + 'no_privilege_viewip' => '抱歉,您没有权限查看 IP', + 'admin_getip_nopermission' => '抱歉,您没有权限查看更高级别的管理员 IP', + + 'no_privilege_mergethread' => '抱歉,您没有权限合并主题', + 'admin_merge_nonexistence' => '抱歉,主题 ID (tid) 不存在', + 'admin_merge_invalid' => '抱歉,请选择其他主题进行合并', + + 'recommend_group_invalid' => '抱歉,您选择的主题已被推荐版块', + 'admin_nonexistence' => '抱歉,您尚未选择操作项目', + 'no_privilege_stickthread' => '抱歉,您没有权限设置主题置顶', + 'no_privilege_highlightthread' => '抱歉,您没有权限设置主题高亮', + 'no_privilege_digestthread' => '抱歉,您没有权限设置主题精华', + 'no_privilege_recommendthread' => '抱歉,您没有权限推荐主题', + 'no_privilege_bumpthread' => '抱歉,您没有权限提升此主题', + 'no_privilege_downthread' => '抱歉,您没有权限下沉此主题', + 'no_privilege_closethread' => '抱歉,您没有权限关闭此主题', + 'no_privilege_openthread' => '抱歉,您没有权限开启已关闭的主题', + 'no_privilege_movethread' => '抱歉,您没有权限移动此主题', + 'admin_move_have_mod' => '抱歉,目标版块需要内容审核', + 'admin_move_nopermission' => '抱歉,目标版块无发帖权', + 'no_privilege_edittypethread' => '抱歉,您没有权限设置主题分类', + 'admin_type_invalid' => '抱歉,目标分类无效', + 'admin_expiration_invalid' => '抱歉,有效期无效, 有效期应该介于{min}至{max}之间', + + 'special_refundment_invalid' => '抱歉,特殊主题不能执行强制退款', + + 'no_privilege_removereward' => '抱歉,您没有权限移除悬赏主题状态', + 'reward_end' => '抱歉,请确认是否是悬赏帖或者悬赏已结束', + + 'no_privilege_repairthread' => '抱歉,您没有权限修复此主题', + 'admin_repair_succeed' => '主题修复成功 ', + + 'no_privilege_restore' => '抱歉,您没有权限恢复此主题', + + 'no_privilege_splitthread' => '抱歉,您没有权限分割此主题', + 'admin_split_invalid' => '抱歉,主题没有回复,无法分割', + 'admin_split_subject_invalid' => '抱歉,您尚未输入标题', + + 'no_privilege_stampthread' => '抱歉,您没有权限给主题添加图章', + + 'no_privilege_stamplist' => '抱歉,您没有权限给主题添加图标', + + 'no_privilege_stickreply' => '抱歉,您没有权限置顶此帖', + 'admin_stickreply_invalid' => '抱歉,目标文章不存在或者为主题', + + 'no_privilege_warnpost' => '抱歉,您没有权限警告此主题', + 'admin_warn_invalid' => '抱歉,您尚未选择要警告的作者的文章', + 'admin_warn_nopermission' => '抱歉,您没有权限警告该作者', + + 'no_privilege_ckfriend_pic' => '对方的隐私设置禁止您评论此图片', + 'no_privilege_ckpassword_pic' => '抱歉,您的密码输入错误,不能评论此图片', + 'no_privilege_ckfriend_blog' => '对方的隐私设置禁止您评论此日志', + 'no_privilege_ckpassword_blog' => '抱歉,您的密码输入错误,不能评论此日志', + 'do_not_accept_comments' => '抱歉,该日志不接受评论', + 'sharing_does_not_exist' => '抱歉,评论的分享不存在', + 'note_wall_reply_success' => '已经回复到{username}的留言板', + + 'period_nopermission' => '抱歉,管理员设置了每日 {banperiods} 不能进行此操作或访问此页面,请其他时间再试', + + 'credits_policy_lowerlimit' => '抱歉,{ruletext} {rulecredit},本操作后您的{title}将不足 {lowerlimit} {unit}', + 'credits_policy_lowerlimit_fid' => '抱歉,本版块{ruletext} {rulecredit},本操作后您的{title}将不足 {lowerlimit} {unit}', + 'credits_policy_lowerlimit_norule' => '抱歉,本操作后您的{title}将不足 {lowerlimit} {unit}', + + 'domain_length_error' => '抱歉,设置的二级域名长度不能小于{length}个字符', + 'two_domain_length_not_more_than_30_characters' => '抱歉,设置的二级域名长度不能超过30个字符', + 'only_two_names_from_english_composition_and_figures' => '抱歉,您设置的二级域名只能含有英文和数字', + 'domain_be_retained' => '抱歉,您设定的域名被系统保留,请选择其他域名', + 'two_domain_have_been_occupied' => '抱歉,二级域名已被占用', + + 'forum_permforum_nomedal' => '您需要拥有以下勋章才能访问这个版块

          {forum_permforum_nomedal} 点击进入勋章页面', + 'forum_permforum_disallow' => '本版块只有特定用户可以访问', + 'forum_permforum_nopermission' => '您需要满足以下条件才能访问这个版块

          访问条件:
             {formulamessage}
          您的信息: {usermsg} ', + 'forum_permforum_nopermission_custommsg' => '

          {formulamessage} ', + 'viewperm_none_nopermission' => '抱歉,您没有权限访问该版块

          ', + 'viewperm_upgrade_nopermission' => '抱歉,您需要升级您所在的用户组后才能访问该版块,详细请 点击这里查看

          有权访问的用户组或认证用户为:
              {permgroups}', + 'viewperm_login_nopermission' => '抱歉,您尚未登录,没有权限访问该版块', + 'postperm_upgrade_nopermission' => '抱歉,您需要升级所在的用户组后才能发帖,详细请 点击这里查看

          有权发帖的用户组或认证用户为:
              {permgroups}', + 'replyperm_upgrade_nopermission' => '抱歉,您需要升级所在的用户组后才能回帖,详细请 点击这里查看

          有权回帖的用户组或认证用户为:
              {permgroups}', + 'getattachperm_upgrade_nopermission' => '抱歉,您需要升级所在的用户组才能下载本附件,详细请 点击这里查看

          有权下载附件的用户组或认证用户为:
              {permgroups}', + 'getattachperm_login_nopermission' => '抱歉,您尚未登录,没有权限下载本附件', + 'postattachperm_none_nopermission' => '抱歉,您没有权限上传附件

          ', + 'postattachperm_upgrade_nopermission' => '抱歉,您需要升级您所在的用户组后才能上传附件,详细请 点击这里查看

          有权上传附件的用户组或认证用户为:
              {permgroups}', + 'postattachperm_login_nopermission' => '抱歉,您尚未登录,没有权限上传附件', + 'file_size_overflow' => '抱歉,文件不能大于 {size} 字节', + 'forum_archiver_disabled' => '抱歉,论坛 Archiver 功能尚未开启', + + 'post_thread_closed_by_dateline' => '抱歉,管理员设置了本版块发表于 {autoclose} 天以前的主题自动关闭,不再接受新回复', + 'post_thread_closed_by_lastpost' => '抱歉,管理员设置了本版块最后回复于 {autoclose} 天以前的主题自动关闭,不再接受新回复', + + 'length_is_not_within_the_scope_of' => '抱歉,分页数不在允许的范围内', + + 'magics_weight_range_invalid' => '抱歉,道具包容量不足,超出 {less}', + 'magics_target_nonexistence' => '抱歉,您指定的目标不存在', + 'magics_give_myself' => '抱歉,不能赠送给自己', + 'magics_give_weight_range_invalid' => '抱歉,对方道具包容量不足,最多只能接受赠送 {num} 个该道具', + 'magics_give_succeed' => '您送给 {toname} {num} 张 {magicname}', + 'magics_mod_forbidden' => '抱歉,此帖已被版主操作,禁止使用道具', + 'magic_is_closed' => '此道具已被禁用', + 'magic_not_for_sale' => '此道具不能通过购买获得', + 'magic_groupid_limit' => '抱歉,您当前所在的用户组没有权限购买本道具', + 'magics_locked' => '当前道具正在使用/卖出/赠送中,请稍后再试。', + 'bad_buynum' => '抱歉,您输入的购买数目有误', + 'not_enough_coupon' => '抱歉,您的代金券数目不足', + 'credit_is_not_enough' => '抱歉,您的积分不足购买此道具', + + 'admin_reason_invalid' => '请输入原因', + + 'css_contains_elements_of_insecurity' => '抱歉,您提交的内容含有不安全元素', + 'diy_template_filename_invalid' => 'DIY模板名不正确', + 'diy_tpldirectory_invalid' => 'DIY模板目录不正确', + 'diy_template_extension_invalid' => '模板文件扩展名不正确', + 'diy_template_noexist' => '模板文件不存在', + 'topic_title_cannot_be_empty' => '抱歉,专题名称不能为空', + 'topic_has_on_template' => '没有找到专题模板', + 'topic_name_duplicated' => '抱歉,专题静态化名称不能重复', + 'topic_created_failed' => '抱歉,创建专题失败', + 'comment_comment_noexist' => '抱歉,要评论的文章不存在', + 'comment_comment_notallowed' => '该文章不允许评论', + + 'post_subject_toolong' => '抱歉,您的标题超过最大字符限制,请缩短标题后再试', + 'post_subject_tooshort' => '抱歉,您的标题小于最小字符限制,请加长标题后再试', + 'post_message_tooshort' => '抱歉,您的文章小于 {minpostsize} 个字符的限制', + + 'no_privilege_realname' => '抱歉,您需要填写真实姓名后才能进行当前操作,点击这里设置真实姓名', + + 'threadtype_required_invalid' => '抱歉,资料填写不全,请检查 {typetitle} 选项', + 'threadtype_format_invalid' => '抱歉,资料格式不正确,请检查 {typetitle} 选项', + 'threadtype_toolong_invalid' => '抱歉,资料长度过长,请检查 {typetitle} 选项', + 'threadtype_num_invalid' => '抱歉,资料数值不正确,请检查 {typetitle} 选项', + 'threadtype_unchangeable_invalid' => '抱歉,资料不得修改,请检查{typetitle}选项', + + 'location_login' => '', + 'location_login_force_qq' => '您所在的用户组必须使用QQ账号登录', + 'location_login_force_mail' => '您所在的用户组必须使用邮箱登录', + 'location_login_outofdate' => '您当前的账号已经太长时间未登录网站已经被冻结,必须验证邮箱后才能解除冻结状态', + 'location_login_succeed_mobile' => '欢迎您回来,{username}。点击进入登录前页面', + 'location_login_succeed' => '', + 'location_activation' => '您的账号处于未激活状态,点击进行激活', + 'login_succeed_inactive_member' => '欢迎您回来,{usergroup} {username}。您的账号处于非激活状态,部分功能可能无法正常使用,现在将转入密码安全页面', + 'login_succeed_password_change' => '您的账户存在安全隐患,建议立即修改密码', + 'login_question_empty' => '请选择安全提问以及填写正确的答案', + 'login_question_invalid' => '抱歉,安全提问答案填写错误', + 'login_invalid' => '登录失败,您还可以尝试 {loginperm} 次', + 'login_password_invalid' => '抱歉,您输入的密码有误', + 'register_disable' => '抱歉,目前站点禁止新用户注册', + 'register_disable_activation' => '抱歉,目前站点禁止激活', + 'register_email_send_succeed' => '感谢您注册 {bbname},
          系统给您发送了一封带有注册地址的邮件,快去登录邮箱获取注册链接进行下一步注册吧', + 'not_open_registration_invite' => '抱歉,本站目前暂时不允许用户直接注册,需要有效的邀请码才能注册', + 'register_rules_agree' => '您必须同意服务条款后才能注册', + 'register_activation_message' => '抱歉,您输入的用户名 "{username}" 已存在,请登录站点激活此账号', + 'profile_password_tooshort' => '密码太短了,至少要{pwlength}个字符', + 'profile_required_info_invalid' => '抱歉,您尚未填写必填项目或必填项目格式不正确', + 'register_ctrl' => '抱歉,您的 IP 地址在 {regctrl} 小时内无法注册', + 'register_flood_ctrl' => '抱歉,IP 地址在 24 小时内只能注册 {regfloodctrl} 次', + 'profile_uid_duplicate' => '抱歉,用户 ID {uid} 已被占用', + 'register_email_verify' => '感谢您注册 {bbname},
          系统给您发送了一封激活邮件,快去登录邮箱激活账号吧', + 'register_email_verify_location' => '重新接收验证邮件 先去逛逛', + 'register_manual_verify' => '感谢您的注册,站点开启了人工验证注册用户,请等待审核', + 'register_manual_verify_location' => '先去逛逛', + 'register_succeed' => '感谢您注册 {bbname},现在将以 {usergroup} 身份登录站点', + 'register_succeed_location' => '现在去完善资料 先去逛逛', + + 'task_offline' => '抱歉,该任务尚未上线或已下线', + 'task_full' => '抱歉,该任务申请人数已满', + 'task_doing_rt' => '您已完成该任务的 {csc}%,还有{t}时间,加油啊!', + 'task_doing' => '您已完成该任务的 {csc}%,加油啊!', + 'task_waiting_rt' => '您还没有开始执行任务,还有{t}时间,赶快哦!', + 'task_waiting' => '您还没有开始执行任务,赶快哦!', + + 'board_closed' => '抱歉,本站点暂时关闭,详情请 联系管理员', + + 'admin_cpanel_noaccess' => '抱歉,您没有权限访问管理面板,请重新登录站点,然后重试', + 'admin_cpanel_locked' => '抱歉,由于密码尝试次数过多,管理面板已锁定

          管理版面将于 {unlocktime} 解除锁定', + + 'submit_secqaa_invalid' => '抱歉,验证问答填写错误', + 'post_url_nopermission' => '抱歉,您没有权限发表 URL 连接', + + 'not_in_mobile' => '您访问的页面无手机页面,是否进一步访问电脑版?', + 'template_developer_not_in_mobile' => '您访问的页面 {file} 无手机模板,是否进一步访问电脑版?', + + 'magics_operation_nopermission' => '抱歉,此道具只能操作自己发文章或评论', + + 'magics_attachsize_message' => '已增加 {num}M 额外附件容量', + + 'magicuse_bad_dateline' => '抱歉,输入的时间无效', + + 'magics_friendadd_message' => '已增加 {num} 个额外好友名额', + + 'magics_credit_message' => '恭喜您获得 {credit}', + + 'magics_thunder_message' => '{magicname} 发布成功 ', + + 'topicadmin_live_noset_error' => '该主题并没有设置为直播帖', + 'no_privilege_livethread' => '抱歉,您没有权限设置直播帖', + 'portal_category_has_no_folder_name' => '抱歉,文章所属的频道没有设置目录名称', + 'noreply_replynum_error' => '对不起,你已经达到本主题的回帖上限。', + 'author_not_uploadpic' => '楼主暂时没有上传图片', + 'noreply_yourself_error' => '您不能对自己的回帖进行投票', + 'noreply_voted_error' => '您已经对此回帖投过票了', + + 'payment_order_no_exist' => '订单不存在或已过期', + 'payment_type_no_exist' => '请选择支付渠道', + 'payment_succeed' => '支付成功', + 'payment_transfer_succeed' => '转账成功', + 'payment_refund_id_exist' => '退款订单号已存在,必须保证全局唯一', + 'payment_refund_exist' => '当前退款订单正在退款中,请通过状态接口查询退款状态', + 'payment_transfer_id_exist' => '转账订单号已存在,必须保证全局唯一', + 'payment_transfer_exist' => '当前转账订单正在处理中,请通过状态接口查询状态', + 'payment_transfer_id_no_exist' => '转账订单号不存在', + 'payment_retry_callback_no_exist' => '订单号不存在', + 'payment_retry_callback_no_pay' => '订单未支付', + + 'secmobseccode_send_success' => '短信发送成功,请在页面上输入短信验证码。', + 'secmobseccode_send_failure' => '未知异常,请稍候再试。', + 'secmobseccode_send_err_1' => '发送短信间隔过短,请稍候再试。', + 'secmobseccode_send_err_2' => '您一段时间内发送的短信过多,请稍候再试。', + 'secmobseccode_send_err_3' => '号码组一段时间内发送的短信过多,请稍候再试。', + 'secmobseccode_send_err_4' => '本站点一段时间内发送的短信过多,请稍候再试。', + 'secmobseccode_send_err_5' => '本站点不支持向您安全手机号所在区域发送短信,请更换号码或稍候再试。', + 'secmobseccode_send_err_6' => '网关接口文件不存在,请稍候再试。', + 'secmobseccode_send_err_7' => '网关接口类不存在,请稍候再试。', + 'secmobseccode_send_err_8' => '短信功能已被关闭,请稍候再试。', + 'secmobseccode_send_err_9' => '短信网关异常,请稍候再试。', + +); + +?> \ No newline at end of file diff --git a/source/language/lang_notification.php b/source/language/lang_notification.php new file mode 100644 index 0000000..ec0dc2f --- /dev/null +++ b/source/language/lang_notification.php @@ -0,0 +1,237 @@ + '留言', + 'type_piccomment' => '图片评论', + 'type_blogcomment' => '日志评论', + 'type_clickblog' => '日志表态', + 'type_clickarticle' => '文章表态', + 'type_clickpic' => '图片表态', + 'type_sharecomment' => '分享评论', + 'type_doing' => '记录', + 'type_friend' => '好友', + 'type_credit' => '积分', + 'type_bbs' => '论坛', + 'type_system' => '系统', + 'type_thread' => '主题', + 'type_task' => '任务', + 'type_group' => '圈子', + + 'mail_to_user' => '有新的通知', + 'showcredit' => '{actor} 赠送给您 {credit} 个竞价积分,帮助提升您在 竞价排行榜 中的名次', + 'share_space' => '{actor} 分享了您的空间', + 'share_blog' => '{actor} 分享了您的日志 {subject}', + 'share_album' => '{actor} 分享了您的相册 {albumname}', + 'share_pic' => '{actor} 分享了您的相册 {albumname} 中的 图片', + 'share_thread' => '{actor} 分享了您的文章 {subject}', + 'share_article' => '{actor} 分享了您的文章 {subject}', + 'magic_present_note' => '送给您一个道具 {name}', + 'friend_add' => '{actor} 和您成为了好友', + 'friend_request' => '{actor} 请求加您为好友{note}  批准申请', + 'doing_reply' => '{actor} 回复了您的 记录', + 'wall_reply' => '{actor} 回复了您的 留言', + 'pic_comment_reply' => '{actor} 回复了您的 图片评论', + 'blog_comment_reply' => '{actor} 回复了您的 日志评论', + 'share_comment_reply' => '{actor} 回复了您的 分享评论', + 'wall' => '{actor} 在留言板上给您 留言', + 'pic_comment' => '{actor} 评论了您的 图片', + 'blog_comment' => '{actor} 评论了您的日志 {subject}', + 'share_comment' => '{actor} 评论了您的 分享', + 'click_blog' => '{actor} 对您的日志 {subject} 做了表态', + 'click_pic' => '{actor} 对您的 图片 做了表态', + 'click_article' => '{actor} 对您的文章 {subject} 做了表态', + 'show_out' => '{actor} 访问了您的主页后,您在竞价排名榜中的最后一个积分也被消费掉了', + 'puse_article' => '恭喜您,您的{subject}已被添加到文章列表, 点击查看', + + 'group_member_join' => '{actor} 加入您的 {groupname} 圈子需要审核,请到圈子管理中心 进行审核', + 'group_member_invite' => '{actor} 邀请您加入 {groupname} 圈子,点此马上加入', + 'group_member_check' => '您已通过了 {groupname} 圈子的审核,请 点击这里访问', + 'group_member_check_failed' => '您没有通过 {groupname} 圈子的审核。', + 'group_mod_check' => '您的创建的圈子 {groupname} 审核通过了,请 点击这里访问', + + 'reason_moderate' => '您的主题 {subject} 被 {actor} {modaction}

          {reason}
          ', + + 'reason_merge' => '您的主题 {subject} 被 {actor} {modaction}
          {reason}
          ', + + 'reason_delete_post' => '您在 {subject} 的文章被 {actor} 删除
          {reason}
          ', + + 'reason_delete_comment' => '您在 {subject} 的点评被 {actor} 删除
          {reason}
          ', + + 'reason_ban_post' => '您的主题 {subject} 被 {actor} {modaction}
          {reason}
          ', + + 'reason_warn_post' => '您的主题 {subject} 被 {actor} {modaction}
          +连续 {warningexpiration} 天内累计 {warninglimit} 次警告,您将被自动禁止发言 {warningexpiration} 天。
          +截止至目前,您已被警告 {authorwarnings} 次,请注意!
          {reason}
          ', + + 'reason_move' => '您的主题 {subject} 被 {actor} 移动到 {toname}
          {reason}
          ', + + 'reason_copy' => '您的主题 {subject} 被 {actor} 复制为 {subject}
          {reason}
          ', + + 'reason_remove_reward' => '您的悬赏主题 {subject} 被 {actor} 撤销
          {reason}
          ', + + 'reason_stamp_update' => '您的主题 {subject} 被 {actor} 添加了图章 {stamp}
          {reason}
          ', + + 'reason_stamp_delete' => '您的主题 {subject} 被 {actor} 撤销了图章
          {reason}
          ', + + 'reason_stamplist_update' => '您的主题 {subject} 被 {actor} 添加了图标 {stamp}
          {reason}
          ', + + 'reason_stamplist_delete' => '您的主题 {subject} 被 {actor} 撤销了图标
          {reason}
          ', + + 'reason_stickreply' => '您在主题 {subject} 的回帖被 {actor} 置顶
          {reason}
          ', + + 'reason_stickdeletereply' => '您在主题 {subject} 的回帖被 {actor} 撤销置顶
          {reason}
          ', + + 'reason_quickclear' => '您的{cleartype} 被 {actor} 清除
          {reason}
          ', + + 'reason_live_update' => '您的主题 {subject} 被 {actor} 设置为直播贴
          {reason}
          ', + 'reason_live_cancle' => '您的主题 {subject} 被 {actor} 取消直播
          {reason}
          ', + + 'modthreads_delete' => '您发表的主题 {threadsubject} 已由管理团队 {modusername} 审核拒绝,现已被删除!', + + 'modthreads_delete_reason' => '您发表的主题 {threadsubject} 已由管理团队 {modusername} 审核拒绝,现已被删除!
          {reason}
          ', + 'modthreads_validate' => '您发表的主题 {threadsubject} 已由管理团队 {modusername} 审核通过!   查看 ›', + + 'modreplies_delete' => '您发表的回复已由管理团队 {modusername} 审核拒绝,现已被删除!

          回复内容:{post}

          ', + + 'modreplies_delete_reason' => '您发表的回复已由管理团队 {modusername} 审核拒绝,现已被删除!

          回复内容:{post}

          {reason}
          ', + + 'modreplies_validate' => '您发表的回复已由管理团队 {modusername} 审核通过!   查看 ›

          回复内容:{post}

          ', + + 'transfer' => '您收到一笔来自 {actor} 的积分转账 {credit}   查看 › +

          {actor} 说:{transfermessage}

          ', + + 'addfunds' => '您提交的积分充值请求已完成,相应数额的积分已存入您的积分账户   查看 › +

          订单号:{orderid}

          支出:人民币 {price} 元

          收入:{value}

          ', + + 'rate_reason' => '您在主题 {subject} 的文章被 {actor} 评分 {ratescore}
          {reason}
          ', + + 'recommend_note_post' => '恭喜,您的文章 {subject} 被编辑采用', + + 'rate_removereason' => '您在主题 {subject} 中文章的评分 {ratescore}
          {reason}
          被 {actor} 撤销', + + 'trade_seller_send' => '{buyer} 购买您的商品 {subject},对方已付款,等待您发货   查看 ›', + + 'trade_buyer_confirm' => '您购买的商品 {subject}{seller} 已发货,等待您确认   查看 ›', + + 'trade_fefund_success' => '商品 {subject} 已退款成功   评价 ›', + + 'trade_success' => '商品 {subject} 已交易成功   评价 ›', + + 'trade_order_update_sellerid' => '卖家 {seller} 修改了商品 {subject} 的交易单,请确认   查看 ›', + + 'trade_order_update_buyerid' => '买家 {buyer} 修改了商品 {subject} 的交易单,请确认   查看 ›', + + 'eccredit' => '与您交易的 {actor} 已对您作了评价   回评 ›', + + 'activity_notice' => '{actor} 申请加入您举办的活动 {subject},请审核   查看 ›', + + 'activity_apply' => '活动 {subject} 的发起人 {actor} 已批准您参加此活动   查看 ›
          {reason}
          ', + + 'activity_replenish' => '活动 {subject} 的发起人 {actor} 通知您需要完善活动报名信息   查看 ›
          {reason}
          ', + + 'activity_delete' => '活动 {subject} 的发起人 {actor} 拒绝您参加此活动   查看 ›
          {reason}
          ', + + 'activity_cancel' => '{actor} 取消了参加 {subject} 活动   查看 ›
          {reason}
          ', + + 'activity_notification' => '活动 {subject} 的发起人 {actor} 发来通知  查看活动 ›
          {msg}
          ', + + 'reward_question' => '您的悬赏主题 {subject} 被 {actor} 设置了最佳答案   查看 ›', + + 'reward_bestanswer' => '您的回复被悬赏主题 {subject} 的作者 {actor} 选为最佳答案   查看 ›', + + 'reward_bestanswer_moderator' => '您在悬赏主题 {subject} 的回复被选为最佳答案   查看 ›', + + 'comment_add' => '{actor} 点评了您曾经在主题 {subject} 发表的文章   查看 ›', + + 'reppost_noticeauthor' => '{actor} 回复了您的文章 {subject}   查看', + + 'task_reward_credit' => '恭喜您完成任务:{name},获得积分 {creditbonus}   查看我的积分 ›

          ', + + 'task_reward_magic' => '恭喜您完成任务:{name},获得道具 {rewardtext} {bonus} 张', + + 'task_reward_medal' => '恭喜您完成任务:{name},获得勋章 {rewardtext} 有效期 {bonus} 天', + + 'task_reward_medal_forever' => '恭喜您完成任务:{name},获得勋章 {rewardtext} 永久有效', + + 'task_reward_invite' => '恭喜您完成任务:{name},获得邀请码 {rewardtext}个 有效期 {bonus} 天', + + 'task_reward_group' => '恭喜您完成任务:{name},获得用户组 {rewardtext} 有效期 {bonus} 天   看看我能做什么 ›', + + 'user_usergroup' => '您的用户组升级为 {usergroup}   看看我能做什么 ›', + + 'grouplevel_update' => '恭喜您,您的圈子 {groupname} 已升级到 {newlevel}。', + + 'thread_invite' => '{actor} 邀请您{invitename} {subject}   查看 ›', + 'blog_invite' => '{actor} 邀请您查看日志 {subject}   查看 ›', + 'article_invite' => '{actor} 邀请您查看文章 {subject}   查看 ›', + 'invite_friend' => '恭喜您成功邀请到 {actor} 并成为您的好友', + + 'poke_request' => '{fromusername}: {pokemsg} 回打招呼|忽略', + + 'profile_verify_error' => '{verify}资料审核被拒绝,以下字段需要重新填写:
          {profile}
          拒绝理由:{reason}', + 'profile_verify_pass' => '恭喜您,您填写的{verify}资料审核已通过', + 'profile_verify_pass_refusal' => '很遗憾,您填写的{verify}资料审核已被拒绝', + 'member_ban_speak' => '您已被 {user} 禁止发言,期限:{day}天(0:代表永久禁言),禁言理由:{reason}', + 'member_ban_visit' => '您已被 {user} 禁止访问,期限:{day}天(0:代表永久禁止访问),禁止访问理由:{reason}', + 'member_ban_status' => '您已被 {user} 锁定,锁定理由:{reason}', + 'member_change_usergroup' => '您已被 {user} 修改为 {groupname} 用户组,期限:{day} (0:代表永久生效),扩展组信息为 {extgroupinfo},并应操作者要求告知您相关变动,操作理由:{reason}', + 'member_change_credits' => '您已被 {user} 调整积分,积分类型与调整值为 {extcredits} ,并应操作者要求告知您相关变动,操作理由:{reason}', + + 'member_follow' => '您关注的人已有{count}条新动态。点击查看', + 'member_follow_add' => '{actor} 收听了您。点击查看', + + 'member_moderate_invalidate' => '您的账号未能通过管理员的审核,请重新提交注册信息
          管理员留言: {remark}', + 'member_moderate_validate' => '您的账号已通过审核。
          管理员留言: {remark}', + 'member_moderate_invalidate_no_remark' => '您的账号未能通过管理员的审核,请重新提交注册信息。', + 'member_moderate_validate_no_remark' => '您的账号已通过审核。', + 'manage_verifythread' => '有新的待审核主题。现在进行审核', + 'manage_verifypost' => '有新的待审核回帖。现在进行审核', + 'manage_verifyuser' => '有新的待审核会员。现在进行审核', + 'manage_verifyblog' => '有新的待审核日志。现在进行审核', + 'manage_verifydoing' => '有新的待审核记录。现在进行审核', + 'manage_verifypic' => '有新的待审核图片。现在进行审核', + 'manage_verifyshare' => '有新的待审核分享。现在进行审核', + 'manage_verifycommontes' => '有新的待审核留言/评论。现在进行审核', + 'manage_verifyrecycle' => '回收站有新的待处理主题。现在处理', + 'manage_verifyrecyclepost' => '回帖回收站有新的待处理回帖。现在处理', + 'manage_verifyarticle' => '有新的待审核文章。现在进行审核', + 'manage_verifymedal' => '有新的待审核勋章申请。现在进行审核', + 'manage_verifyacommont' => '有新的待审核文章评论。现在进行审核', + 'manage_verifytopiccommont' => '有新的待审核专题评论。现在进行审核', + 'manage_verify_field' => '有新的待处理{verifyname}。现在处理', + 'system_notice' => '{subject}

          {message}

          ', + 'system_adv_expiration' => '您站点的以下广告将于 {day} 天后到期,请及时处理:
          {advs}', + 'report_change_credits' => '{actor} 处理了您的举报 {creditchange} {msg}', + 'at_message' => '{buyer} 在主题 {subject} 中提到了您
          {message}
          现在去看看。', + 'new_report' => '有新的来自 {username} 的举报等待处理,点此进入管理中心处理。', + 'new_post_report' => '有新的来自 {username} 的举报等待处理,点此进入管理面板。', + 'magics_receive' => '您收到 {actor} 送给您的道具 {magicname} +

          {actor} 说:{msg}

          +

          回赠道具|查看我的道具箱

          ', + 'invite_collection' => '{actor} 邀请您参与维护淘专辑 {collectionname}
          接受邀请', + 'collection_removed' => '您参与维护的淘专辑 {collectionname} 已被 {actor} 关闭。', + 'exit_collection' => '您已经退出维护淘专辑 {collectionname}。', + 'collection_becommented' => '您的淘专辑 {collectionname} 收到了新评论。', + 'collection_befollowed' => '您的淘专辑 {collectionname} 有新用户订阅了!', + 'collection_becollected' => '恭喜您的主题 {threadname} 被淘专辑 {collectionname} 收录了!', + + 'pmreportcontent' => '{pmreportcontent}', + + 'thread_hidden' => '您的主题 {subject} 被多个用户认定为垃圾帖,现已被隐藏   查看 ›', + +); + +?> \ No newline at end of file diff --git a/source/language/lang_optimizer.php b/source/language/lang_optimizer.php new file mode 100644 index 0000000..7bd4e06 --- /dev/null +++ b/source/language/lang_optimizer.php @@ -0,0 +1,133 @@ + '三个月没有进行数据备份了,建议立即备份数据', + 'optimizer_dbbackup_lastback' => '上次数据备份于', + 'optimizer_dbbackup_clean_safe' => '没有检测到数据库备份文件,无安全问题', + 'optimizer_dbbackup_clean_delete' => '检测到 {filecount} 个数据备份文件(目录: ./data/backup_xxx),
          请尽快手工复制到安全位置备份,然后删除这些文件', + 'optimizer_dbbackup_visit_safe' => '没有检测到可访问的数据库备份文件,无安全问题', + 'optimizer_dbbackup_visit_delete' => '检测到 {filecount} 个数据备份文件(目录: ./data/backup_xxx)可以通过 Web 方式访问,
          请在数据库恢复页面删除数据库数据库备份文件或设置数据库备份文件不可通过 URL 访问', + 'optimizer_filecheck_advice' => '三个月没有进行文件校验了,建议立即进行校验', + 'optimizer_filecheck_lastcheck' => '上次文件校验于', + 'optimizer_log_clean' => '有 {count} 个日志表可以清理优化', + 'optimizer_log_not_found' => '未发现可清理的日志表', + 'optimizer_patch_have' => '您有 {patchnum} 个,请尽快更新', + 'optimizer_patch_check_safe' => '检测安全', + 'optimizer_plugin_new_plugin' => '您有 {newversion} 款应用有可用更新', + 'optimizer_plugin_no_upgrade' => '不需要应用更新', + 'optimizer_post_need_split' => '文章表及分表有 {count} 个需要优化', + 'optimizer_post_not_need' => '不需要优化', + 'optimizer_seo_advice' => '建议您完善SEO设置', + 'optimizer_seo_no_need' => '发现已经完善了seo设置', + 'optimizer_setting_cache_index' => '缓存论坛首页', + 'optimizer_setting_cache_index_desc' => '开启此功能可减轻服务器负载', + 'optimizer_setting_cache_optimize_desc' => '设置缓存时间为900秒', + 'optimizer_setting_cache_post' => '缓存文章', + 'optimizer_setting_cache_post_desc' => '开启此功能可减轻服务器负载', + 'optimizer_setting_cache_post_optimize_desc' => '设置缓存时间为900秒', + 'optimizer_setting_optimizeviews' => '优化更新主题浏览量', + 'optimizer_setting_optimizeviews_desc' => '开启此功能可减轻更新主题浏览量时对服务器产生的负载', + 'optimizer_setting_optimizeviews_optimize_desc' => '开启此功能', + 'optimizer_setting_delayviewcount' => '附件下载量延迟更新', + 'optimizer_setting_delayviewcount_desc' => '延迟更新附件的浏览量,可明显降低访问量很大的站点的服务器负担', + 'optimizer_setting_delayviewcount_optimize_desc' => '开启此功能', + 'optimizer_setting_preventrefresh' => '查看数开启防刷新', + 'optimizer_setting_preventrefresh_desc' => '开启防刷新,可明显降低服务器压力', + 'optimizer_setting_preventrefresh_optimize_desc' => '开启此功能', + 'optimizer_setting_nocacheheaders' => '禁止浏览器缓冲', + 'optimizer_setting_nocacheheaders_desc' => '可用于解决极个别浏览器内容刷新不正常的问题,本功能会加重服务器负担', + 'optimizer_setting_nocacheheaders_optimize_desc' => '关闭此功能', + 'optimizer_setting_jspath' => 'JS 文件缓存', + 'optimizer_setting_jspath_desc' => '当脚本为缓存目录时,系统会将默认目录中的 *.js 文件进行压缩然后保存到缓存目录以提高读取速度', + 'optimizer_setting_jspath_optimize_desc' => '修改js路径到缓存目录', + 'optimizer_setting_lazyload' => '图片延时加载', + 'optimizer_setting_lazyload_desc' => '页面中的图片在浏览器的当前窗口时再加载,可明显降低访问量很大的站点的服务器负担', + 'optimizer_setting_lazyload_optimize_desc' => '开启此功能', + 'optimizer_setting_sessionclose' => '关闭session机制', + 'optimizer_setting_sessionclose_desc' => '关闭session机制以后,可明显降低站点的服务器负担,建议在线用户数超过2万时开启本功能
          注意:游客数和用户的在线时长将不再进行统计,论坛首页和版块列表页面的在线用户列表功能将不可用', + 'optimizer_setting_sessionclose_optimize_desc' => '开启此功能', + 'optimizer_setting_need_optimizer' => '有 {count} 个设置项可以优化', + 'optimizer_setting_no_need' => '设置项无需优化', + 'optimizer_thread_need_optimizer' => '需要优化您的主题表了', + 'optimizer_thread_no_need' => '不需要优化', + 'optimizer_upgrade_need_optimizer' => '有新版本,及时更新到最新版本', + 'optimizer_upgrade_no_need' => '已经是最新版', + 'optimizer_setting_rewriteguest' => 'Rewrite仅针对游客', + 'optimizer_setting_rewriteguest_desc' => '开启此项,则 Rewrite功能只对游客和搜索引擎有效,可减轻服务器负担', + 'optimizer_setting_rewriteguest_optimize_desc' => '开启此功能', + 'optimizer_inviteregister_tip' => '注册项中开启邀请注册后,设置不受邀请码限制的地方列表,适合地方社区设置', + 'optimizer_iniviteregister_normal' => '检测设置正常', + 'optimizer_emailregister_normal' => '已设置该项,请查看是否配置邮件服务器', + 'optimizer_emailregister_tip' => '此设置可以提升用户质量', + 'optimizer_pwlength_need' => '密码最小长度过低,不安全', + 'optimizer_pwlength_no_need' => '经检测密码长度设置正常', + 'optimizer_filesafe_need' => 'old 目录、utility 目录、安装程序、数据恢复程序或重复的管理员入口其中之一未删除', + 'optimizer_filesafe_no_need' => '文件安全检测正常', + 'optimizer_remote_need' => '您开启了正常站点无需开启的远程调用功能,请检查是否是主动开启', + 'optimizer_remote_no_need' => '远程调用功能关闭', + 'optimizer_regmaildomain_need' => '需要优化黑名单列表', + 'optimizer_regmaildomain_tip' => '可以设置邮箱域名限制阻止垃圾注册', + 'optimizer_ipregctrl_no_need' => '已经设置了限时注册IP列表', + 'optimizer_ipregctrl_tip' => '当有某些IP段在恶意注册时,可以将恶意的IP地址录入', + 'optimizer_newbiespan_no_need' => '已经设置了见习时间', + 'optimizer_newbiespan_need' => '设置一下见习时间更安全', + 'optimizer_editperdel_no_need' => '已经设置了此设置项', + 'optimizer_editperdel_need' => '需要优化此项', + 'optimizer_recyclebin_no_need' => '版块都已经开启回收站了', + 'optimizer_recyclebin_need' => '版块没有开启回收站
          {forumdesc}', + 'optimizer_forumstatus_no_need' => '无隐藏版块或者隐藏版块都已经设置了访问权限', + 'optimizer_forumstatus_need' => '隐藏版块还没有设置访问权限
          {forumdesc}', + 'optimizer_usergroup9_no_need' => '限制会员用户组设置正常', + 'optimizer_usergroup9_need' => '请关闭 "{desc}" 这些选项', + 'optimizer_usergroup4_need' => '请关闭 "{desc}" 这些选项', + 'optimizer_usergroup5_need' => '请关闭 "{desc}" 这些选项', + 'optimizer_usergroup6_need' => '请关闭 "{desc}" 这些选项', + 'optimizer_usergroup_need_allowsendpm' => '是否允许发短消息', + 'optimizer_usergroup_need_allowposturl' => '是否允许发站外URL', + 'optimizer_usergroup_need_allowgroupposturl' => '圈子是否允许发站外URL', + 'optimizer_usergroup_need_allowpost' => '允许发新话题', + 'optimizer_usergroup_need_allowreply' => '允许发表回复', + 'optimizer_usergroup_need_allowdirectpost' => '允许直接发帖', + 'optimizer_usergroup_need_allowgroupdirectpost' => '圈子允许直接发帖', + 'optimizer_usergroup4_no_need' => '禁止发言用户组设置正常', + 'optimizer_usergroup5_no_need' => '禁止访问用户组设置正常', + 'optimizer_usergroup6_no_need' => '禁止IP用户组设置正常', + 'optimizer_cloudsecurity_no_need' => '防水墙已开启', + 'optimizer_cloudsecurity_need' => '防水墙可以有效的防止垃圾帖,提升网站内容质量,降低管理成本,非常建议安装此应用', + 'optimizer_cloudsecurity_setting_need' => '防水墙设置被修改', + 'optimizer_attachexpire_need' => '设置后可以起到防盗链的作用', + 'optimizer_attachexpire_no_need' => '已经设置了此项', + 'optimizer_attachrefcheck_need' => '设置后可以起到防盗链的作用', + 'optimizer_attachrefcheck_no_need' => '已经设置了此项', + 'optimizer_loginpwcheck_need' => '弱密码登录检测未开启', + 'optimizer_loginpwcheck_no_need' => '弱密码登录检测已开启', + 'optimizer_loginoutofdate_need' => '异常登录检测未开启', + 'optimizer_loginoutofdate_no_need' => '异常登录检测已开启', + 'optimizer_postqqonly_need' => '发帖需要绑定QQ号检测未开启', + 'optimizer_postqqonly_no_need' => '发帖需要绑定QQ号检测已开启', + 'optimizer_aggid_need' => '“管理员,超级版主,版主”QQ登录检测未开启', + 'optimizer_aggid_no_need' => '“管理员,超级版主,版主”QQ登录检测已开启', + 'optimizer_eviluser_need' => '防水墙识别到违规用户,请及时处理', + 'optimizer_eviluser_no_need' => '未发现违规用户', + 'optimizer_white_list_need' => '您设置了防水墙白名单,白名单用户发垃圾贴不被处理,请慎重', + 'optimizer_white_list_no_need' => '未设置白名单', + 'optimizer_security_daily_need' => '开启防水墙每日优化,可清除删帖后首页痕迹', + 'optimizer_security_daily_no_need' => '该计划任务已开启', + 'optimizer_dos8p3_need' => 'DOS 8.3 文件名支持错误开启', + 'optimizer_dos8p3_no_need' => 'DOS 8.3 文件名支持未开启或底层不支持', + 'optimizer_httphost_need' => '空 HOST 访问已开启', + 'optimizer_httphost_no_need' => '空 HOST 访问支持未开启或底层不支持', +); +?> \ No newline at end of file diff --git a/source/language/lang_portalcp.php b/source/language/lang_portalcp.php new file mode 100644 index 0000000..434d376 --- /dev/null +++ b/source/language/lang_portalcp.php @@ -0,0 +1,103 @@ + '

          此模块内容包含js代码,不能立即预览,请点击保存后查看

          ', + 'block_diy_summary_html_tag' => '自定义内容错误,HTML标签:', + 'block_diy_summary_not_closed' => ' 不匹配', + 'block_all_category' => '全部分类', + 'block_first_category' => '顶级分类', + 'block_all_forum' => '全部版块', + 'block_all_group' => '全部用户组', + 'block_all_type' => '全部分类', + 'file_size_limit' => '文件不能大于 {size} KB,请返回.', + 'set_to_conver' => '设为封面', + 'small_image' => '小图', + 'insert_small_image' => '插入小图', + 'insert_large_image' => '插入大图', + 'insert_file' => '插入文件', + 'delete' => '删除', + 'upload_error' => '上传失败', + 'upload_remote_failed' => '远程上传失败', + 'article_noexist' => '指定的文章不存在,请检查', + 'article_noallowed' => '您没有权限对指定的文章进行操作', + 'article_publish_noallowed' => '您没有权限进行文章发布操作', + 'article_category_empty' => '抱歉,栏目不能为空', + 'article_edit_nopermission' => '抱歉,您没有权限进行当前文章操作', + 'article_publish' => '发布文章', + 'article_manage' => '文章管理', + 'article_tag' => '标签', + 'select_category' => '选择分类', + 'blockstyle_diy' => '自定义模板', + + 'article_pushplus_info' => '

          本文内容由 {author} 提供

          ', + + 'diytemplate_name_null' => '[未填写]', + 'portal_view_name' => ' 文章查看页', + 'forum_viewthread_name' => ' 文章查看页', + 'portal/index' => '门户首页', + 'portal/list' => '文章列表页(公共)', + 'portal/view' => '文章查看页(公共)', + 'portal/comment' => '文章评论页', + 'forum/discuz' => '论坛首页', + 'forum/viewthread' => '文章查看页(公共)', + 'forum/forumdisplay' => '版块列表页(公共)', + 'group/index' => $_G['setting']['navs'][3]['navname'].'首页', + 'group/group_my' => '我的'.$_G['setting']['navs'][3]['navname'].'首页', + 'group/group' => $_G['setting']['navs'][3]['navname'].'内容页', + 'home/space_home' => '空间首页', + 'home/space_trade' => '空间商品页', + 'home/space_top' => '空间排行榜', + 'home/space_thread' => '空间文章页', + 'home/space_reward' => '空间悬赏页', + 'home/space_share_list' => '空间分享列表页', + 'home/space_share_view' => '空间分享查看页', + 'space_share_view' => '空间分享查看页', + 'home/space_poll' => '空间投票页', + 'home/space_pm' => '空间短消息页', + 'home/space_notice' => '空间提醒页', + 'home/space_group' => '空间'.$_G['setting']['navs'][3]['navname'].'页', + 'home/space_friend' => '空间好友页', + 'home/space_favorite' => '空间收藏页', + 'home/space_doing' => '空间记录页', + 'home/space_debate' => '空间辩论页', + 'home/space_blog_view' => '空间日志查看页', + 'home/space_blog_list' => '空间日志列表页', + 'home/space_album_view' => '空间相册查看页', + 'home/space_album_pic' => '空间图片查看页', + 'home/space_album_list' => '空间相册列表页', + 'home/space_activity' => '空间活动页', + 'ranklist/ranklist' => '全部排行榜页', + 'ranklist/blog' => '日志排行榜页', + 'ranklist/poll' => '投票排行榜页', + 'ranklist/activity' => '活动排行榜页', + 'ranklist/forum' => '版块排行榜页', + 'ranklist/picture' => '图片排行榜页', + 'ranklist/group' => '圈子排行榜页', + 'ranklist/thread' => '文章排行榜页', + 'ranklist/member' => '用户排行榜页', + 'other_page' => '非DIY模块', + 'upload' => '上传', + 'remote' => '远程', + 'portal_index' => '门户首页', + 'portal_topic_blue' => '蓝色调专题', + 'portal_topic_green' => '绿色调专题', + 'portal_topic_grey' => '灰色调专题', + 'portal_topic_red' => '红色调专题', + + 'itemtypename0' => '自动', + 'itemtypename1' => '固定', + 'itemtypename2' => '编辑', + 'itemtypename3' => '推送', + +); \ No newline at end of file diff --git a/source/language/lang_seccode.php b/source/language/lang_seccode.php new file mode 100644 index 0000000..2890a0a --- /dev/null +++ b/source/language/lang_seccode.php @@ -0,0 +1,19 @@ + '的一是在了不和有大这主中人上为们地个用工时要动国产以我到他会作来分生对于学下级就年阶义发成部民可出能方进同行面说种过命度革而多子后自社加小机也经力线本电高量长党得实家定深法表着水理化争现所二起政三好十战无农使性前等反体合斗路图把结第里正新开论之物从当两些还天资事队批如应形想制心样干都向变关点育重其思与间内去因件日利相由压员气业代全组数果期导平各基或月毛然问比展那它最及外没看治提五解系林者米群头意只明四道马认次文通但条较克又公孔领军流入接席位情运器并飞原油放立题质指建区验活众很教决特此常石强极土少已根共直团统式转别造切九您取西持总料连任志观调七么山程百报更见必真保热委手改管处己将修支识病象几先老光专什六型具示复安带每东增则完风回南广劳轮科北打积车计给节做务被整联步类集号列温装即毫知轴研单色坚据速防史拉世设达尔场织历花受求传口断况采精金界品判参层止边清至万确究书术状厂须离再目海交权且儿青才证低越际八试规斯近注办布门铁需走议县兵固除般引齿千胜细影济白格效置推空配刀叶率述今选养德话查差半敌始片施响收华觉备名红续均药标记难存测士身紧液派准斤角降维板许破述技消底床田势端感往神便贺村构照容非搞亚磨族火段算适讲按值美态黄易彪服早班麦削信排台声该击素张密害侯草何树肥继右属市严径螺检左页抗苏显苦英快称坏移约巴材省黑武培着河帝仅针怎植京助升王眼她抓含苗副杂普谈围食射源例致酸旧却充足短划剂宣环落首尺波承粉践府鱼随考刻靠够满夫失包住促枝局菌杆周护岩师举曲春元超负砂封换太模贫减阳扬江析亩木言球朝医校古呢稻宋听唯输滑站另卫字鼓刚写刘微略范供阿块某功套友限项余倒卷创律雨让骨远帮初皮播优占死毒圈伟季训控激找叫云互跟裂粮粒母练塞钢顶策双留误础吸阻故寸盾晚丝女散焊功株亲院冷彻弹错散商视艺灭版烈零室轻血倍缺厘泵察绝富城冲喷壤简否柱李望盘磁雄似困巩益洲脱投送奴侧润盖挥距触星松送获兴独官混纪依未突架宽冬章湿偏纹吃执阀矿寨责熟稳夺硬价努翻奇甲预职评读背协损棉侵灰虽矛厚罗泥辟告卵箱掌氧恩爱停曾溶营终纲孟钱待尽俄缩沙退陈讨奋械载胞幼哪剥迫旋征槽倒握担仍呀鲜吧卡粗介钻逐弱脚怕盐末阴丰编印蜂急拿扩伤飞露核缘游振操央伍域甚迅辉异序免纸夜乡久隶缸夹念兰映沟乙吗儒杀汽磷艰晶插埃燃欢铁补咱芽永瓦倾阵碳演威附牙芽永瓦斜灌欧献顺猪洋腐请透司危括脉宜笑若尾束壮暴企菜穗楚汉愈绿拖牛份染既秋遍锻玉夏疗尖殖井费州访吹荣铜沿替滚客召旱悟刺脑' +); + +?> \ No newline at end of file diff --git a/source/language/lang_security.php b/source/language/lang_security.php new file mode 100644 index 0000000..e76392a --- /dev/null +++ b/source/language/lang_security.php @@ -0,0 +1,22 @@ + '频繁刷新限制', + 'attackevasive_1_message' => '您访问本站速度过快或者刷新间隔时间小于两秒!请等待页面自动跳转 ...', + 'attackevasive_2_subject' => '代理服务器访问限制', + 'attackevasive_2_message' => '本站现在限制使用代理服务器访问,请去除您的代理设置,直接访问本站。', + 'attackevasive_4_subject' => '页面重载开启', + 'attackevasive_4_message' => '欢迎光临本站,页面正在重新载入,请稍候 ...', +); \ No newline at end of file diff --git a/source/language/lang_space.php b/source/language/lang_space.php new file mode 100644 index 0000000..2727d79 --- /dev/null +++ b/source/language/lang_space.php @@ -0,0 +1,272 @@ + '小时', + 'before' => '前', + 'minute' => '分钟', + 'second' => '秒', + 'now' => '现在', + 'dot' => '、', + 'poll' => '投票', + 'blog' => '日志', + 'friend_group_default' => '其他', + 'friend_group_1' => '通过本站认识', + 'friend_group_2' => '通过活动认识', + 'friend_group_3' => '通过朋友认识', + 'friend_group_4' => '亲人', + 'friend_group_5' => '同事', + 'friend_group_6' => '同学', + 'friend_group_7' => '不认识', + 'friend_group' => '自定义', + 'wall' => '留言', + 'pic_comment' => '图片评论', + 'blog_comment' => '日志评论', + 'clickblog' => '日志表态', + 'clickpic' => '图片表态', + 'clickthread' => '话题表态', + 'share_comment' => '分享评论', + 'share_notice' => '分享', + 'doing_comment' => '记录回复', + 'friend_notice' => '好友', + 'poll_comment' => '投票评论', + 'poll_invite' => '投票邀请', + 'default_albumname' => '默认相册', + 'credit' => '积分', + 'credit_unit' => '个', + 'man' => '男', + 'woman' => '女', + 'gender_0' => '保密', + 'gender_1' => '男', + 'gender_2' => '女', + 'year' => '年', + 'month' => '月', + 'day' => '日', + 'unmarried' => '单身', + 'married' => '非单身', + 'hidden_username' => '匿名', + 'gender' => '性别', + 'age' => '岁', + 'comment' => '评论', + 'reply' => '回复', + 'from' => '来自', + 'anonymity' => '匿名', + 'viewmore' => '查看更多', + 'constellation_1' => '水瓶座', + 'constellation_2' => '双鱼座', + 'constellation_3' => '白羊座', + 'constellation_4' => '金牛座', + 'constellation_5' => '双子座', + 'constellation_6' => '巨蟹座', + 'constellation_7' => '狮子座', + 'constellation_8' => '处女座', + 'constellation_9' => '天秤座', + 'constellation_10' => '天蝎座', + 'constellation_11' => '射手座', + 'constellation_12' => '摩羯座', + 'zodiac_1' => '鼠', + 'zodiac_2' => '牛', + 'zodiac_3' => '虎', + 'zodiac_4' => '兔', + 'zodiac_5' => '龙', + 'zodiac_6' => '蛇', + 'zodiac_7' => '马', + 'zodiac_8' => '羊', + 'zodiac_9' => '猴', + 'zodiac_10' => '鸡', + 'zodiac_11' => '狗', + 'zodiac_12' => '猪', + + 'credits' => '积分', + 'usergroup' => '用户组', + 'friends' => '好友', + 'blogs' => '日志', + 'threads' => '主题', + 'albums' => '相册', + 'sharings' => '分享', + 'space_views' => '已有 {views} 人来访过', + 'views' => '空间查看数', + 'block1' => '自定义模块1', + 'block2' => '自定义模块2', + 'block3' => '自定义模块3', + 'block4' => '自定义模块4', + 'block5' => '自定义模块5', + 'blockdata' => array('personalinfo' => '个人资料', 'profile' => '头像', 'doing' => '记录', 'feed' => '动态', + 'blog' => '日志', 'stickblog' => '置顶日志', 'album' => '相册', 'friend' => '好友', + 'visitor' => '最近访客', 'wall' => '留言板', 'share' => '分享', + 'thread' => '主题', 'group'=>(isset($_G['setting']['navs'][3]['navname']) ? $_G['setting']['navs'][3]['navname'] : ''),'music'=>'音乐盒', + 'statistic' => '统计信息', + 'block1'=>'自由模块1', 'block2'=>'自由模块2', 'block3'=>'自由模块3', + 'block4'=>'自由模块4','block5'=>'自由模块5'), + + 'block_title' => '
          {bname}{more}
          ', + 'blog_li' => '
          {subject} {date}
          ', + 'blog_li_img' => '
          ', + 'blog_li_ext' => '
          ({viewnum})次阅读|({replynum})个评论
          ', + 'album_li' => '
        • {albumname}

          {albumname}

          图片数: {picnum}
        • ', + 'doing_li' => '
        • {message}

        • {date} {from} 回复({replynum})', + 'visitor_anonymity' => '
          匿名

          匿名

          ', + 'visitor_list' => '{avatar}

          {username}

          ', + 'wall_form' => '
          +
          + '.($_G['uid'] ? 'facelist +
          + + + + ' : ($_G['connectguest'] ? '
          您需要 完善账号信息绑定已有账号 后才可以回帖
          ' : '
          你需要登录后才可以留言 登录 | '.$_G['setting']['reglinkname'].'
          ')).' +

          + + + +
          '. + ($_G['uid'] ? '' : '').' +
          ', + 'wall_li' => '
          +
          + {author_avatar} +
          +
          + {author} + {op} + {date} + {moderated} +
          +
          {message}
          +
          ', + 'wall_more' => '
          查看全部
          ', + 'wall_edit' => '编辑 ', + 'wall_del' => '删除 ', + 'wall_reply' => '回复', + 'group_li' => '
        • {name}

          {name}

        • ', + 'poll_li' => '
          poll

          {subject}

          发布时间:{dateline}
          ', + 'music_no_content' => '还没有设置音乐盒的内容', + 'block_profile_diy' => '装扮空间', + 'block_profile_wall' => '查看留言', + 'block_profile_avatar' => '编辑头像', + 'block_profile_update' => '更新资料', + 'block_profile_follow' => '查看广播', + 'block_profile_wall_to_me' => '给我留言', + 'block_profile_friend_add' => '加为好友', + 'block_profile_friend_ignore' => '解除好友', + 'block_profile_poke' => '打个招呼', + 'block_profile_sendmessage' => '发送消息', + 'block_doing_reply' => '回复', + 'block_doing_no_content' => '现在还没有记录', + 'block_doing_no_content_publish' => ',更新记录', + 'block_blog_no_content' => '现在还没有日志', + 'block_blog_no_content_publish' => ',发布日志', + 'block_album_no_content' => '现在还没有相册', + 'block_album_no_content_publish' => ',上传图片', + 'block_feed_no_content' => '现在还没有动态', + 'block_thread_no_content' => '现在还没有主题', + 'block_thread_no_content_publish' => ',发布主题', + 'block_friend_no_content' => '现在还没有好友', + 'block_friend_no_content_publish' => ',查找好友邀请好友', + 'block_visitor_no_content' => '现在还没有访客', + 'block_visitor_no_content_publish' => ',去串串门', + 'block_share_no_content' => '现在还没有分享', + 'block_wall_no_content' => '现在还没有留言', + 'block_group_no_content' => '现在还没有圈子', + 'block_group_no_content_publish' => ',创建自己的圈子加入圈子', + 'block_group_no_content_join' => ',加入圈子', + 'block_view_noperm' => '无权查看', + 'block_view_profileinfo_noperm' => '暂无资料项或无权查看', + 'click_play' => '点击播放', + 'click_view' => '点击查看', + 'feed_view_only' => '只看此类动态', + + 'export_pm' => '导出短消息', + 'pm_export_header' => 'Discuz! X 短消息记录(此消息记录不支持重新导入)', + 'pm_export_touser' => '消息对象: {touser}', + 'pm_export_subject' => '群聊话题: {subject}', + 'all' => '全部', + 'manage_post' => '管理文章', + 'manage_album' => '管理相册', + 'manage_blog' => '管理日志', + 'manage_comment' => '管理评论', + 'manage_doing' => '管理记录', + 'manage_feed' => '管理动态', + 'manage_group_prune' => '圈子文章', + 'manage_group_threads' => '圈子主题', + 'manage_share' => '管理分享', + 'manage_pic' => '管理图片', + + 'sb_blog' => '{who}的日志', + 'sb_album' => '{who}的相册', + 'sb_space' => '{who}的空间', + 'sb_feed' => '{who}的动态', + 'sb_doing' => '{who}的记录', + 'sb_sharing' => '{who}的分享', + 'sb_friend' => '{who}的好友', + 'sb_wall' => '{who}的留言板', + 'sb_profile' => '{who}的个人资料', + 'sb_thread' => '{who}的文章', + 'doing_you_can' => '您可以更新记录, 让好友们知道您在做什么...', + 'block_profile_all' => '

          查看全部个人资料

          ', + 'block_profile_edit' => '编辑我的资料', + 'sb_follow' => '{who}的广播', + + 'viewthread_userinfo_hour' => '小时', + 'viewthread_userinfo_uid' => 'UID', + 'viewthread_userinfo_posts' => '回帖', + 'viewthread_userinfo_threads' => '主题', + 'viewthread_userinfo_doings' => '记录', + 'viewthread_userinfo_blogs' => '日志', + 'viewthread_userinfo_albums' => '相册', + 'viewthread_userinfo_sharings' => '分享', + 'viewthread_userinfo_friends' => '好友', + 'viewthread_userinfo_digest' => '精华', + 'viewthread_userinfo_digestposts' => '精华', + 'viewthread_userinfo_credits' => '积分', + 'viewthread_userinfo_readperm' => '阅读权限', + 'viewthread_userinfo_regtime' => '注册时间', + 'viewthread_userinfo_lastdate' => '最后登录', + 'viewthread_userinfo_oltime' => '在线时间', + 'viewthread_userinfo_sellercredit' => '卖家信用', + 'viewthread_userinfo_buyercredit' => '买家信用', + 'viewthread_userinfo_follower' => '听众', + 'viewthread_userinfo_following' => '收听', + 'viewthread_userinfo_feeds' => '广播', + 'viewthread_userinfo_privacy' => '保密', + 'follow_view_follow' => '我关注的', + 'follow_view_special' => '特别关注', + 'follow_view_other' => '广播大厅', + 'follow_view_feed' => '{who}的广播', + 'follow_view_thread' => '{who}的主题', + 'follow_view_reply' => '{who}的回复', + 'follow_view_profile' => '{who}的个人资料', + 'follow_view_type_feed' => '广播', + 'follow_view_type_thread' => '主题', + 'follow_view_type_reply' => '回帖', + 'follow_view_type_profile' => '个人资料', + 'follow_view_type_follower' => '听众列表', + 'follow_view_type_following' => '收听用户', + 'follow_view_my_follower' => '我的听众', + 'follow_view_my_following' => '我收听的人', + 'follow_view_do_follower' => '他的听众', + 'follow_view_do_following' => '他收听的人', + 'follow_view_fulltext' => '...查看全文', + 'follow_retract' => '收起', + 'follow_click_play' => '点击播放', + 'follow_cancle_follow' => '取消收听', + 'follow_follow_ta' => '收听TA', + + +); + +?> \ No newline at end of file diff --git a/source/language/lang_spacecp.php b/source/language/lang_spacecp.php new file mode 100644 index 0000000..2c9ccc4 --- /dev/null +++ b/source/language/lang_spacecp.php @@ -0,0 +1,324 @@ + '通过', + 'tab_space' => ' ', + + 'share' => '分享', + 'share_action' => '分享了', + + 'pm_comment' => '答复点评', + 'pm_thread_about' => '关于您在“{subject}”的文章', + + 'wall_pm_subject' => '您好,我给您留言了', + 'wall_pm_message' => '我在您的留言板给您留言了,[url=\\1]点击这里去留言板看看吧[/url]', + 'reward' => '悬赏', + 'reward_info' => '参与投票可获得 \\1 积分', + 'poll_separator' => '"、"', + + 'pm_report_content' => '{reportername}举报短消息:
          来自{username}的短消息
          内容:{message}', + 'message_can_not_send_1' => '发送失败,您当前超出了24小时内两人会话的上限', + 'message_can_not_send_2' => '两次发送短消息太快,请稍候再发送', + 'message_can_not_send_3' => '抱歉,您不能给非好友批量发送短消息', + 'message_can_not_send_4' => '抱歉,您目前还不能使用发送短消息功能', + 'message_can_not_send_5' => '您超出了24小时内群聊会话的上限', + 'message_can_not_send_6' => '对方屏蔽了您的短消息', + 'message_can_not_send_7' => '超过了群聊人数上限', + 'message_can_not_send_8' => '抱歉,您不能给自己发短消息', + 'message_can_not_send_9' => '收件人为空或对方屏蔽了您的短消息', + 'message_can_not_send_10' => '发起群聊人数不能小于两人', + 'message_can_not_send_11' => '该会话不存在', + 'message_can_not_send_12' => '抱歉,您没有权限操作', + 'message_can_not_send_13' => '这不是群聊消息', + 'message_can_not_send_14' => '这不是私人消息', + 'message_can_not_send_15' => '数据有误', + 'message_can_not_send_16' => '您超出了24小时内发短消息数量的上限', + 'message_can_not_send_onlyfriend' => '该用户只接收好友发送的短消息', + + + 'friend_subject' => '{username} 请求加您为好友', + 'friend_request_note' => ',附言:{note}', + 'comment_friend' =>'\\1 给您留言了', + 'photo_comment' => '\\1 评论了您的照片', + 'blog_comment' => '\\1 评论了您的日志', + 'poll_comment' => '\\1 评论了您的投票', + 'share_comment' => '\\1 评论了您的分享', + 'friend_pm' => '\\1 给您发私信了', + 'poke_subject' => '\\1 向您打招呼', + 'mtag_reply' => '\\1 回复了您的话题', + 'event_comment' => '\\1 评论了您的活动', + + 'friend_pm_reply' => '\\1 回复了您的私信', + 'comment_friend_reply' => '\\1 回复了您的留言', + 'blog_comment_reply' => '\\1 回复了您的日志评论', + 'photo_comment_reply' => '\\1 回复了您的照片评论', + 'poll_comment_reply' => '\\1 回复了您的投票评论', + 'share_comment_reply' => '\\1 回复了您的分享评论', + 'event_comment_reply' => '\\1 回复了您的活动评论', + + 'mail_my' => '好友与我的互动提醒', + 'mail_system' => '系统提醒', + + 'person' => '人', + 'delete' => '删除', + + 'space_update' => '{actor} 被SHOW了一下', + + 'active_email_subject' => '您的邮箱激活邮件', + 'active_email_msg' => '请复制下面的激活链接到浏览器进行访问,以便激活您的邮箱。
          邮箱激活链接:
          {url}', + 'share_space' => '分享了一个用户', + 'share_blog' => '分享了一篇日志', + 'share_album' => '分享了一个相册', + 'default_albumname' => '默认相册', + 'share_image' => '分享了一张图片', + 'share_article' => '分享了一篇文章', + 'album' => '相册', + 'share_thread' => '分享了一个文章', + 'mtag' => '{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'share_mtag' => '分享了一个{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'share_mtag_membernum' => '现有 {membernum} 名成员', + 'share_tag' => '分享了一个标签', + 'share_tag_blognum' => '现有 {blognum} 篇日志', + 'share_link' => '分享了一个网址', + 'share_video' => '分享了一个视频', + 'share_music' => '分享了一个音乐', + 'share_flash' => '分享了一个 Flash', + 'share_event' => '分享了一个活动', + 'share_poll' => '分享了一个\\1投票', + 'event_time' => '活动时间', + 'event_location' => '活动地点', + 'event_creator' => '发起人', + 'the_default_style' => '默认风格', + 'the_diy_style' => '自定义风格', + + 'thread_edit_trail' => '[本话题由 \\1 于 \\2 编辑]', + 'create_a_new_album' => '创建了新相册', + 'not_allow_upload' => '您现在没有权限上传图片', + 'not_allow_upload_extend' => '不允许上传{extend}类型的图片', + 'files_can_not_exceed_size' => '{extend}类文件不能超过{size}', + 'get_passwd_subject' => '取回密码邮件', + 'get_passwd_message' => '您只需在提交请求后的三天之内,通过点击下面的链接重置您的密码:
          \\1
          (如果上面不是链接形式,请将地址手工粘帖到浏览器地址栏再访问)
          上面的页面打开后,输入新的密码后提交,之后您即可使用新的密码登录了。', + 'file_is_too_big' => '文件过大', + + 'take_part_in_the_voting' => '{actor} 参与了 {touser} 的{reward}投票 {subject}', + 'lack_of_access_to_upload_file_size' => '无法获取上传文件大小', + 'only_allows_upload_file_types' => '只允许上传jpg、jpeg、gif、png标准格式的图片', + 'unable_to_create_upload_directory_server' => '服务器无法创建上传目录', + 'inadequate_capacity_space' => '空间容量不足,不能上传新附件', + 'mobile_picture_temporary_failure' => '无法转移临时文件到服务器指定目录', + 'ftp_upload_file_size' => '远程上传图片失败', + 'comment' => '评论', + 'upload_a_new_picture' => '上传了新图片', + 'upload_album' => '更新了相册', + 'the_total_picture' => '共 \\1 张图片', + + 'space_open_subject' => '快来打理一下您的个人主页吧', + 'space_open_message' => 'hi,我今天去拜访了一下您的个人主页,发现您自己还没有打理过呢。赶快来看看吧。地址是:\\1space.php', + + + + 'apply_mtag_manager' => '想申请成为 \\2 的圈主,理由如下:\\3。(点击这里进入管理)', + + + 'magicunit' => '个', + 'magic_note_wall' => '{actor}在留言板上给您留言', + 'magic_call' => '在日志中点了您的名,快去看看吧', + + + 'present_user_magics' => '您收到了管理员赠送的道具:\\1', + 'has_not_more_doodle' => '您没有涂鸦板了', + + 'do_stat_login' => '来访用户', + 'do_stat_mobilelogin' => '手机访问', + 'do_stat_connectlogin' => 'QQ登录访问', + 'do_stat_register' => '新注册用户', + 'do_stat_invite' => '好友邀请', + 'do_stat_add' => '信息发布', + 'do_stat_comment' => '信息互动', + 'do_stat_space' => '互动', + 'do_stat_doing' => '记录', + 'do_stat_blog' => '日志', + 'do_stat_activity' => '活动', + 'do_stat_reward' => '悬赏', + 'do_stat_debate' => '辩论', + 'do_stat_trade' => '商品', + 'do_stat_group' => "创建".(isset($_G['setting']['navs'][3]['navname']) ? $_G['setting']['navs'][3]['navname'] : ''), + 'do_stat_tgroup' => (isset($_G['setting']['navs'][3]['navname']) ? $_G['setting']['navs'][3]['navname'] : ''), + 'do_stat_home' => (isset($_G['setting']['navs'][4]['navname']) ? $_G['setting']['navs'][4]['navname'] : ''), + 'do_stat_forum' => (isset($_G['setting']['navs'][2]['navname']) ? $_G['setting']['navs'][2]['navname'] : ''), + 'do_stat_groupthread' => '圈子主题', + 'do_stat_post' => '主题回复', + 'do_stat_grouppost' => '圈子回复', + 'do_stat_pic' => '图片', + 'do_stat_poll' => '投票', + 'do_stat_event' => '活动', + 'do_stat_share' => '分享', + 'do_stat_thread' => '主题', + 'do_stat_docomment' => '记录回复', + 'do_stat_blogcomment' => '日志评论', + 'do_stat_piccomment' => '图片评论', + 'do_stat_pollcomment' => '投票评论', + 'do_stat_pollvote' => '参与投票', + 'do_stat_eventcomment' => '活动评论', + 'do_stat_eventjoin' => '参加活动', + 'do_stat_sharecomment' => '分享评论', + 'do_stat_post' => '主题回帖', + 'do_stat_click' => '表态', + 'do_stat_wall' => '留言', + 'do_stat_poke' => '打招呼', + 'do_stat_sendpm' => '发短消息', + 'do_stat_addfriend' => '好友请求', + 'do_stat_friend' => '成为好友', + 'do_stat_post_number' => '发帖量', + 'do_stat_statistic' => '合并统计', + 'logs_credit_update_INDEX' => array('TRC','RTC','RAC','MRC','BMC','TFR','RCV','CEC','ECU','SAC','BAC','PRC','RSC','STC','BTC','AFD','UGP','RPC','ACC','RCT','RCA','RCB','CDC','RGC','BGC','AGC','RKC','BME','RPR','RPZ','FCP','BGR'), + 'logs_credit_update_SYS_INDEX' => array('RUL','INV'), + 'logs_credit_update_TRC' => '任务奖励', + 'logs_credit_update_RTC' => '悬赏主题', + 'logs_credit_update_RAC' => '最佳答案', + 'logs_credit_update_MRC' => '道具随机获取', + 'logs_credit_update_BMC' => '购买道具', + 'logs_credit_update_TFR' => '转账转出', + 'logs_credit_update_RCV' => '转账接收', + 'logs_credit_update_CEC' => '积分兑换', + 'logs_credit_update_ECU' => 'UCenter积分兑换支出', + 'logs_credit_update_SAC' => '出售附件', + 'logs_credit_update_BAC' => '购买附件', + 'logs_credit_update_PRC' => '文章被评分', + 'logs_credit_update_RSC' => '文章评分', + 'logs_credit_update_STC' => '出售主题', + 'logs_credit_update_BTC' => '购买主题', + 'logs_credit_update_AFD' => '购买积分', + 'logs_credit_update_UGP' => '购买扩展用户组', + 'logs_credit_update_RPC' => '举报奖惩', + 'logs_credit_update_ACC' => '参与活动', + 'logs_credit_update_RCT' => '回帖奖励', + 'logs_credit_update_RCA' => '回帖中奖', + 'logs_credit_update_RCB' => '返还回帖奖励积分', + 'logs_credit_update_CDC' => '卡密充值', + 'logs_credit_update_RGC' => '回收红包', + 'logs_credit_update_BGC' => '埋下红包', + 'logs_credit_update_AGC' => '获得红包', + 'logs_credit_update_RKC' => '竞价排名', + 'logs_credit_update_BME' => '购买勋章', + 'logs_credit_update_RPR' => '后台积分奖惩', + 'logs_credit_update_RPZ' => '后台积分奖惩清零', + 'logs_credit_update_FCP' => '付费版块', + 'logs_credit_update_BGR' => '创建圈子', + 'logs_credit_update_RUL' => '积分规则', + 'logs_credit_update_INV' => '购买邀请码', + 'buildgroup' => '查看已创建的圈子', + 'logs_credit_update_reward_clean' => '清零', + 'logs_select_operation' => '请选择操作类型', + 'task_credit' => '任务奖励积分', + 'special_3_credit' => '悬赏主题扣除积分', + 'special_3_best_answer' => '最佳答案获取悬赏积分', + 'magic_credit' => '道具随机获取积分', + 'magic_space_gift' => '在自已空间首页埋下红包', + 'magic_space_re_gift' => '回收还没有用完的红包', + 'magic_space_get_gift' => '访问空间领取的红包', + 'credit_transfer' => '进行积分转账', + 'credit_transfer_tips' => '的转账收入', + 'credit_exchange_tips_1' => '执行积分对兑换操作,将 ', + 'credit_exchange_to' => '兑换成', + 'credit_exchange_center' => '通过UCenter兑换积分', + 'attach_sell' => '出售', + 'attach_sell_tips' => '的附件获得积分', + 'attach_buy' => '购买', + 'attach_buy_tips' => '的附件支出积分', + 'grade_credit' => '被评分获得的积分', + 'grade_credit2' => '文章评分扣除的积分', + 'thread_credit' => '主题获得积分', + 'thread_credit2' => '主题支出积分', + 'buy_credit' => '对积分充值', + 'buy_usergroup' => '购买扩展用户组支出积分', + 'buy_medal' => '购买勋章', + 'buy_forum' => '购买付费版块的访问权限', + 'report_credit' => '举报功能中的奖惩', + 'join' => '参与', + 'activity_credit' => '活动扣除积分', + 'thread_send' => '扣除发表', + 'replycredit' => '散发的积分', + 'add_credit' => '奖励积分', + 'recovery' => '回收', + 'replycredit_post' => '回帖奖励', + 'replycredit_thread' => '散发的文章', + 'card_credit' => '卡密充值获得的积分', + 'ranklist_top' => '参加竞价排名消费积分', + 'admincp_op_credit' => '后台积分奖惩操作', + 'credit_update_reward_clean' => '清零', + + 'profile_unchangeable' => '此项资料提交后不可修改', + 'profile_is_verifying' => '此项资料正在审核中', + 'profile_mypost' => '我提交的内容', + 'profile_need_verifying' => '此项资料提交后需要审核', + 'profile_edit' => '修改', + 'profile_censor' => '(含有敏感词汇)', + 'profile_verify_modify_error' => '{verify}已经认证通过不允许修改', + 'profile_verify_verifying' => '您的{verify}信息已提交,请耐心等待核查。', + + 'district_level_0' => '-国家或地区-', + 'district_level_1' => '-省份-', + 'district_level_2' => '-城市-', + 'district_level_3' => '-州县-', + 'district_level_4' => '-乡镇-', + 'invite_you_to_visit' => '{user}邀请您访问{bbname}', + + 'portal' => '门户', + 'forum' => '论坛', + 'friend' => '好友', + 'group' => '圈子', + 'follow' => '广播', + 'collection' => '淘帖', + 'guide' => '导读', + 'feed' => '动态', + 'blog' => '日志', + 'doing' => '记录', + 'wall' => '留言板', + 'homepage' => '个人主页', + 'ranklist' => '排行榜', + 'medal' => '勋章', + 'task' => '任务', + 'magic' => '道具', + 'favorite' => '收藏', + 'select_the_navigation_position' => '选择{type}导航位置', + 'close_module' => '关闭{type}功能', + + 'follow_add_remark' => '添加备注', + 'follow_modify_remark' => '修改备注', + 'follow_specified_group' => '广播专区', + 'follow_specified_forum' => '广播专版', + + 'filesize_lessthan' => '文件大小应该小于', + + 'spacecp_message_prompt' => '(支持 {msg} 代码,最大 1000 字)', + 'card_update_doing' => ' [更新记录]', + 'email_acitve_message' => '新邮箱({newemail})等待验证中...
          + 系统已经向该邮箱发送了一封验证激活邮件,请查收邮件,进行验证激活。
          + 如果没有收到验证邮件,您可以更换一个邮箱,或者重新接收验证邮件', + 'qq_set_status' => '设置我的QQ在线状态', + 'qq_dialog' => '发起QQ聊天', + + 'payment_alipay' => '支付宝', + 'payment_wechat' => '微信支付', + 'payment_qpay' => 'QQ 钱包支付', + 'payment_status_0' => '未支付', + 'payment_status_1' => '已支付', + 'payment_status_2' => '已过期', + 'payment_credit' => '积分充值', + +); + +?> \ No newline at end of file diff --git a/source/language/lang_template.php b/source/language/lang_template.php new file mode 100644 index 0000000..4538a03 --- /dev/null +++ b/source/language/lang_template.php @@ -0,0 +1,469 @@ + '剩余名额', + 'activity_already' => '已参加人数', + 'additional' => '附加', + 'debate_opponent' => '反方', + 'debate_square' => '正方', + 'thread_poll' => '投票', + 'credits' => '积分', + 'login' => '登录', + 'active_email' => '接收邮箱', + 'active_email_comment' => '必填,用来接收邀请码的邮箱地址', + 'apitype_alipay' => '支付宝', + 'apitype_tenpay' => '财付通', + 'buy_nums' => '购买数量', + 'confirms' => '确定', + 'copycode' => '全部复制到剪贴板', + 'copycode_invite_succeed' => '邀请码已经复制到剪贴板', + 'copyright' => '© 2001-'.date('Y').' Discuz! Team.', + 'copyright_s' => '2001-'.date('Y').' Discuz! Team.', + 'invitecode_buycode' => '获取邀请码', + 'invitecode_email' => '我们还将邀请码发送到了您填写的邮箱 {$order[\'email\']} 以备查阅', + 'invitecode_expiration' => '失效时间', + 'invitecode_succeed_title' => '恭喜您,成功获得邀请码', + 'money_unit' => '元', + 'need_money' => '需支付', + 'reg_continue' => '继续注册', + 'trade_type' => '付款方式', + 'e_fontoptions' => '"宋体", "新宋体", "黑体", "微软雅黑", "Arial", "Verdana", "simsun", "Helvetica", "Trebuchet MS", "Tahoma", "Impact", "Times New Roman", "仿宋,仿宋_GB2312", "楷体,楷体_GB2312"', + 'editor_increase' => '加大编辑框', + 'editor_narrow' => '缩小编辑框', + 'post_autosave_restore' => '恢复数据', + 'post_check_length' => '字数检查', + 'post_savedata' => '保存数据', + 'post_topicreset' => '清除内容', + 'all' => '全部', + 'faq' => '帮助', + 'faq_search_nomatch' => '对不起,没有找到匹配结果', + 'homepage' => '首页', + 'keyword_faq' => '关键字为“$keyword”的帮助', + 'open' => '展开', + 'search' => '搜索', + 'close' => '关闭', + 'focus_hottopics' => '站长推荐', + 'focus_show' => '查看', + 'newpm_subject' => '新的短消息', + 'newpm_notice_info' => '有新的短消息,快去看看吧', + 'newnotice_notice_info' => '有新的提醒,快去看看吧', + 'footer_next' => '下一条', + 'footer_previous' => '上一条', + 'login_invisible_mode' => '隐身', + 'login_normal_mode' => '在线', + 'scrolltop' => '返回顶部', + 'thread_groupupgrade' => '距离下一级还需', + 'time_now' => 'GMT{$_G[\'timenow\'][\'offset\']}, {$_G[\'timenow\'][\'time\']}', + 'activation' => '激活', + 'admincp' => '管理中心', + 'changestyle' => '切换风格', + 'default' => '默认', + 'forum_manager' => '{$_G[\'setting\'][\'navs\'][2][\'navname\']}管理', + 'shortcut_notice' => '您经常访问 {$_G[\'setting\'][\'bbname\']},试试添加到桌面,访问更方便!', + 'shortcut_add' => '添加 {$_G[\'setting\'][\'bbname\']} 到桌面', + 'go_to_mobile' => '进入手机版', + 'header_diy_mode_adv' => '高级模式', + 'header_diy_mode_simple' => '简洁模式', + 'header_qq_login_user' => 'QQ 登录用户', + 'login_switch_invisible_mode' => '切换在线状态', + 'logout' => '退出', + 'my_nav' => '快捷导航', + 'my_nav_login' => '请 登录 后使用快捷导航
          没有账号?$_G[\'setting\'][\'reglinkname\']', + 'open_diy' => '打开 DIY 面板', + 'pm_center' => '消息', + 'portal_block_manage' => '模块管理', + 'portal_manage' => '门户管理', + 'remind' => '提醒', + 'setup' => '设置', + 'freeze' => '已冻结', + 'switch_narrow' => '切换到窄版', + 'switch_wide' => '切换到宽版', + 'switch_blind' => '开启辅助访问', + 'task_doing' => '进行中的任务', + 'to_be_continue' => '继续访问电脑版', + 'usergroup' => '用户组', + 'visit_my_space' => '访问我的空间', + 'your_mobile_browser' => '请选择 ', + 'e_redo' => '重做', + 'e_undo' => '撤销', + 'header_add_frame' => '添加框架', + 'header_add_module' => '添加模块', + 'header_clearall' => '清空', + 'header_clearall_desc' => '清空页面上所在DIY数据', + 'header_diy' => '自定义', + 'header_diy_backup_tip' => '您可以通过导出进行模板备份', + 'header_diy_i_know' => '我知道了', + 'header_diy_sample_mode' => '当前为简洁模式,您可以更新模块,修改模块属性和数据,要使用完整的拖拽功能,请点击进入高级模式', + 'header_export' => '导出', + 'header_export_desc' => '导出当前页面中所有DIY数据', + 'header_frame' => '框架', + 'header_import' => '导入', + 'header_import_desc' => '将DIY数据导入到当前页面', + 'header_module' => '模块', + 'header_more_actions' => '更多操作', + 'header_perview' => '预览', + 'header_perview_desc' => '预览DIY的效果', + 'header_restore_backup' => '恢复备份', + 'header_restore_backup_desc' => '恢复备份', + 'header_start' => '开始', + 'header_update' => '更新', + 'header_update_desc' => '更新当前页面所有模块的数据', + 'save' => '保存', + 'style' => '风格', + 'find' => '查找', + 'invite' => '邀请', + 'invite_all_friend' => '全部好友', + 'invite_friend' => '邀请好友', + 'invite_my_follow' => '我关注的', + 'invite_orderby_friend' => '按好友分组查找', + 'invite_orderby_name' => '按好友用户名查找', + 'invite_send' => '发送邀请', + 'invite_still_choose' => '还能选择', + 'selected' => '已选', + 'unit' => '个', + 'unselected' => '未选', + 'imgcropper' => '裁切图片', + 'imgcropper_crop' => '裁切', + 'parse_av_tips' => '如果无法播放,请点击此处在新窗口打开', + 'preview_footertext' => '版权及页脚信息', + 'preview_highlightlink' => '高亮链接', + 'preview_lighttext' => '浅色文字', + 'preview_link' => '链接文字', + 'preview_midtext' => '中等文本', + 'preview_msg' => 'Crossday Discuz! Board 社区系统(简称 Discuz!)是一个采用 PHP 和 MySQL 等其他多种数据库构建的高效建站解决方案。', + 'preview_smalltext' => 'SMALL FONT', + 'preview_text' => '普通文本', + 'preview_threadtext' => '主题列表字体', + 'table_header' => '表头', + 'album' => '相册', + 'article' => '文章', + 'blog' => '日志', + 'enter_content' => '请输入搜索内容', + 'hot_search' => '热搜', + 'search_this_forum' => '本版', + 'thread' => '文章', + 'users' => '用户', + 'input_message1' => '还可输入', + 'input_message2' => '个字符', + 'report' => '举报', + 'report_reason' => '请点击举报理由', + 'report_reason_message' => "['广告垃圾','违规内容','恶意灌水','重复发帖','其他']", + 'report_reason_other' => '请填写举报内容', + 'secmobile' => '安全手机号', + 'secmobseccode' => '手机验证码', + 'seccode' => '验证码', + 'seccode_change' => '换一个', + 'secqaa' => '验证问答', + 'at_friend' => '@朋友', + 'e_at' => '@朋友', + 'e_bold' => '文字加粗', + 'e_code' => '代码', + 'e_forecolor' => '设置文字颜色', + 'e_image' => '图片', + 'e_quote' => '引用', + 'e_url' => '添加链接', + 'attach_forward' => '如果 {$refreshsecond} 秒后下载仍未开始,请点击此链接', + 'board_message' => '提示信息', + 'cancel' => '取消', + 'message_closetime' => '秒后窗口关闭', + 'message_forward' => '如果您的浏览器没有自动跳转,请点击此链接', + 'message_go_back' => '[ 点击这里返回上一页 ]', + 'message_locationtime' => '秒后页面跳转', + 'basic_situation' => '基本概况', + 'forum_stat' => '版块统计', + 'manage_team' => '管理团队', + 'member_list' => '会员列表', + 'mod_works' => '管理统计', + 'stats' => '站点统计', + 'trend' => '趋势统计', + 'submit' => '提交', + 'e_attach_del' => '删除', + 'e_attach_mediacode' => '添加附件媒体播放代码', + 'e_attach_url' => '添加附件地址', + 'readperm' => '阅读权限', + 'update' => '更新', + 'delete' => '删除', + 'none_newthread' => '暂无新回复主题', + 'author' => '作者', + 'username' => '用户名', + 'anonymous' => '匿名', + 'edit' => '编辑', + 'thread_activity' => '活动', + 'thread_debate' => '辩论', + 'thread_reward' => '悬赏', + 'thread_trade' => '商品', + 'more' => '更多', + 'publish' => '发布', + 'guest' => '游客', + 'upload' => '上传', + 'e_attach_insert' => '点击附件文件名添加到文章内容中', + 'e_attach_inserturl' => ',"attach://" 开头的附件地址支持任何人下载请谨慎添加', + 'e_img_albumlist' => '相册图片', + 'e_img_attach' => '上传图片', + 'e_img_height' => '高(可选)', + 'e_img_insertphoto' => '点击图片添加到文章内容中', + 'e_img_inserturl' => '请输入图片地址', + 'e_img_width' => '宽(可选)', + 'e_img_www' => '网络图片', + 'target_blank' => '新窗口打开', + 'return' => '返回', + 'discuzcode' => 'Discuz 代码', + 'member' => '会员', + 'panel_login' => '登录管理面板', + 'panel_login_password' => '密码', + 'panel_login_username' => '用户名', + 'panel_notice_login' => '首次进入管理面板或空闲时间过长, 您输入密码才能进入。如果密码输入错误超过 5 次,管理面板将会锁定 15 分钟。', + 'select_all' => '全选', + 'e_at_title' => '@好友和关注的人', + 'e_attach' => '附件', + 'e_attach_title' => '添加附件', + 'e_audio' => '音乐', + 'e_audio_title' => '添加音乐', + 'e_autotypeset' => '自动排版', + 'e_center' => '居中', + 'e_code_title' => '添加代码文字', + 'e_downremoteimg' => '下载图片', + 'e_downremoteimg_title' => '下载远程图片', + 'e_flash' => 'Flash', + 'e_flash_title' => '添加 Flash', + 'e_font' => '字体', + 'e_fontname' => '设置字体', + 'e_fontsize' => '设置文字大小', + 'e_free' => '添加免费信息', + 'e_hide' => '添加隐藏内容', + 'e_hr_title' => '分隔线', + 'e_image_title' => '添加图片', + 'e_italic' => '文字斜体', + 'e_left' => '居左', + 'e_orderedlist' => '排序的列表', + 'e_pasteword' => 'Word 粘贴', + 'e_pasteword_title' => '从 Word 粘贴内容', + 'e_quote_title' => '添加引用文字', + 'e_removeformat' => '清除文本格式', + 'e_right' => '居右', + 'e_size' => '大小', + 'e_smilies' => '表情', + 'e_smilies_title' => '添加表情', + 'e_table' => '添加表格', + 'e_underline' => '文字加下划线', + 'e_unlink' => '移除链接', + 'e_unorderedlist' => '未排序列表', + 'e_video' => '视频', + 'e_video_title' => '添加视频', + 'smilies' => '表情', + 'uid' => 'UID', + 'recommend' => '模块推送', + 'trade' => '商品', + 'manage' => '管理', + 'not_enough' => '不足', + 'moderate_need' => '待审核', + 'portal' => '门户', + 'reward_answer' => '我来回答', + 'favorite' => '收藏', + 'choose_please' => '请选择', + 'create' => '创建', + 'finished' => '完成', + 'ignore_all' => '忽略全部', + 'pass_all' => '全部通过', + 'create_on' => '创建于', + 'activity' => '活动', + 'debate' => '辩论', + 'poll' => '投票', + 'reward' => '悬赏', + 'add' => '添加', + 'blockdata_recommend' => '模块推送', + 'share' => '分享', + 'article_push' => '生成文章', + 'doing' => '记录', + 'friends' => '好友', + 'online_member' => '在线成员', + 'my_space' => '我的中心', + 'magic' => '道具', + 'medals' => '勋章', + 'task' => '任务', + 'notice' => '提醒', + 'notice_pm' => '我的私信', + 'notice_mypost' => '我的文章', + 'notice_mypost_rate' => '评分', + 'notice_mypost_at' => '提到我的', + 'notice_mypost_post' => '文章', + 'notice_mypost_pcomment' => '点评', + 'notice_mypost_activity' => '活动', + 'notice_mypost_reward' => '悬赏', + 'notice_mypost_goods' => '商品', + 'notice_all' => '全部提醒', + 'notice_interactive' => '坛友互动', + 'notice_interactive_follow' => '我关注的', + 'notice_interactive_follower' => '新听众', + 'notice_interactive_poke' => '打招呼', + 'notice_interactive_friend' => '好友', + 'notice_interactive_comment' => '评论', + 'notice_interactive_wall' => '留言', + 'notice_interactive_click' => '挺你', + 'notice_interactive_sharenotice' => '分享', + 'notice_system' => '系统提醒', + 'notice_manage' => '管理工作', + 'notice_app' => '应用提醒', + 'you' => '您', + 'group_expiry_type_ext' => '扩展用户组', + 'task_done' => '已完成的任务', + 'task_failed' => '失败的任务', + 'task_new' => '新任务', + 'task_admins' => '管理人员', + 'task_applicants' => '已有 {$task[\'applicants\']} 位会员参与此任务', + 'task_applies_full' => '人数已满', + 'task_apply_condition' => '申请此任务所需条件', + 'task_applyagain' => ' 后可以再次申请', + 'task_applyagain_now' => '现在可以再次申请', + 'task_complete' => '已完成', + 'task_complete_condition' => '完成此任务所需条件', + 'task_complete_on' => '完成于', + 'task_detail' => '任务详情', + 'task_endtime' => '当前任务下线时间为 {$task[\'endtime\']},过期后您将不能申请此任务', + 'task_general_users' => '普通会员', + 'task_group_nopermission' => '您所在的用户组无法申请此任务', + 'task_lose_on' => '失败于', + 'task_numlimit' => '人次上限', + 'task_period_day' => '每 {$task[\'period\']} 天允许申请一次', + 'task_period_hour' => '每隔 {$task[\'period\']} 小时允许申请一次', + 'task_period_month' => '每月 {$task[\'period\']} 日允许申请一次', + 'task_period_week' => '每周 $periodweek 允许申请一次', + 'task_reapply' => '后可以重新申请', + 'task_reapply_now' => '现在可以重新申请', + 'task_relatedtask' => '必须完成指定任务', + 'task_exclusivetask' => '必须未领取指定任务', + 'task_reward' => '奖励', + 'task_applies' => '人气', + 'task_nodoing' => '暂无进行中的任务,请到新任务中申请!', + 'task_nonew' => '暂无新任务,周期性任务完成后可以再次申请,敬请关注!', + 'password_security' => '密码安全', + 'increase' => '增加', + 'friend_top' => '排行榜', + 'connect_register_profile' => '创建新账号', + 'connect_register_bind' => '已有本站账号', + 'connect_member_login_tip' => '欢迎使用QQ账号登录 {$_G[\'setting\'][\'bbname\']}', + 'connect_config_newpassword_comment' => '您目前使用的是QQ账号绑定本站,您可以在这里设置独立密码,只有设置了独立密码后本站需要填写密码的相应功能才可使用', + 'wechat_config_newpassword_comment' => '您目前使用的是微信账号绑定本站,您可以在这里设置独立密码,只有设置了独立密码后本站需要填写密码的相应功能才可使用', + 'email' => 'Email', + 'security_question' => '安全提问(未设置请忽略)', + 'security_question_0' => '安全提问', + 'security_question_1' => '母亲的名字', + 'security_question_2' => '爷爷的名字', + 'security_question_3' => '父亲出生的城市', + 'security_question_4' => '您其中一位老师的名字', + 'security_question_5' => '您个人计算机的型号', + 'security_question_6' => '您最喜欢的餐馆名称', + 'security_question_7' => '驾驶执照最后四位数字', + 'group_expiry_time' => '到期时间', + 'login_id' => '账号', + 'login_password' => '密码', + 'login_permanent' => '自动登录', + 'security_a' => '答案', + 'security_q' => '安全提问', + 'forgotpw' => '找回密码', + 'image' => '图片', + 'remote' => '远程', + 'credit_ranking' => '积分排行', + 'auction_ranking' => '竞价排行', + 'close_ranking_note' => '管理员已关闭竞价,暂时无法继续上榜', + 'credit_is_not_number' => '您所填写的{$extcredits[$creditid][\'title\']}不是一个合法数值', + 'credit_title_error' => '您所填写的{$extcredits[$creditid][\'title\']}不能小于1', + 'credit_title_message' => '您的当前{$extcredits[$creditid][\'title\']}为: "+maxCredit+",请填写一个小于该值的数字', + 'current_ranking' => '当前排名', + 'friend_need_help' => '要帮助的好友', + 'friend_num_ranking' => '好友数排行', + 'friend_top_note' => '排行榜公告', + 'handsel' => '赠送', + 'handsel_bid' => '赠送竞价', + 'help_friend_in_top' => '帮助好友来上榜', + 'i_ranking' => '我也要上榜', + 'increase_bid' => '增加竞价', + 'make_persistent_efforts' => '再接再厉', + 'max_char_ranking' => '最多50个汉字,会显示在榜单中', + 'my_ranking_declaration' => '我的上榜宣言', + 'not_exceed' => '不要超过自己的', + 'ranking_message_0' => '您现在还没有上榜。让自己上榜吧,这会大大提升您的主页曝光率。', + 'ranking_message_1' => '竞价{$extcredits[$creditid][\'title\']}越多,竞价排名越靠前,您的主页曝光率也会越高;', + 'ranking_message_2' => '上榜用户的主页被别人有效浏览一次,其竞价{$extcredits[$creditid][\'title\']}将减少1个(恶意刷新访问不扣减)。', + 'self_current_credit' => '您当前的积分', + 'self_current_friend_num' => '您当前的好友数', + 'top_100_update' => '下面列出的为排行前100名,数据每 $cache_time 分钟更新一次。', + 'your_current_bid' => '自己当前的竞价', + 'top_orderby_blogs' => '按日志总数', + 'top_orderby_credits' => '按积分总数', + 'top_orderby_posts' => '按发帖总数', + 'top_orderby_uid' => '按注册时间', + 'upload_pic' => '上传图片', + 'aim_album' => '上传到:', + 'default_album' => '默认相册', + 'create_new_album' => '创建新相册', + 'input_album_name' => '请输入相册名称', + 'click_pic_to_editor' => '点击图片添加到编辑器内容中', + 'select_album' => '选择相册', + 'upload_attach' => '上传附件', + 'filename' => '文件名', + 'file_size' => '文件大小', + 'click_filename_to_article' => '点击文件名将附件添加到文章中', + 'connect_fill_profile_to_visit' => '请先
          完善账号信息绑定已有账号
          后使用快捷导航', + 'ipnoice_current' => '本次登录位置', + 'ipnoice_last' => '上次登录位置', + 'ipnoice_lasttime' => '上次登录时间', + 'ipnoice_title' => '安全提醒', + 'ipnoice_link' => '登录地点异常,建议立即更改密码', + 'recharge_immediately' => '立即充值', + 'manage_grade' => '管理级别', + 'manager' => '管理员', + 'super_forummanager' => '超级版主', + 'forummanager' => '版主', + 'buy_usergroup' => '购买用户组', + 'fastreply' => '快速回复', + 'return_list' => '返回列表', + 'return_forum' => '返回版块', + 'temporarily_to_remind' => '暂不提醒', + 'myitem' => '我的', + 'mypost' => '文章', + + 'm_loading' => '正在加载...', + 'm_its_all' => '已显示全部', + 'm_view_his' => '查看历史消息', + 'm_login_user' => '账 号:', + 'm_login_user_ph' => '请输入账户', + 'm_login_pw' => '密 码:', + 'm_login_pw_ph' => '请输入密码', + 'm_login_q' => '安全提问:', + 'm_login_q_ph' => '安全提问(未设置请忽略)', + 'm_login_a' => '答 案:', + 'm_login_a_ph' => '请输入答案', + 'm_login_submit' => '登录', + 'm_login_orQQ' => '或使用已绑定的QQ账号登录', + 'm_login_QQ' => 'QQ账号登录', + 'm_login_orWX' => '或使用已绑定的微信账号登录', + 'm_login_WX' => '微信账号登录', + 'm_login_reg' => '注册账户', + 'm_new_t' => '发帖', + 'm_new_submit' => '发送', + 'm_new_subject_ph' => '标题(必填)', + 'm_new_memo_ph' => '说两句吧', + 'm_new_upload' => '最多可上传8张图片', + 'm_new_ttype' => '主题分类:', + 'm_new_tsel' => '选择', + 'm_my_send_pm' => '发送私信', + 'm_my_ntc' => '我的提醒', + 'm_my_pm' => '我的私信', + 'm_my_t' => '我的话题', + 'm_my_r' => '我的回复', + 'm_stickt' => '置顶帖', + 'm_share' => '如果喜欢这个话题,请点击右上角图标分享', + 'm_logout' => '退出登录', +); + +?> \ No newline at end of file diff --git a/source/language/magic/index.htm b/source/language/magic/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/magic/lang_anonymouspost.php b/source/language/magic/lang_anonymouspost.php new file mode 100644 index 0000000..77daadb --- /dev/null +++ b/source/language/magic/lang_anonymouspost.php @@ -0,0 +1,29 @@ + '匿名卡', + 'anonymouspost_desc' => '在指定的地方,让自己的名字显示为匿名。', + 'anonymouspost_num' => '拥有个数: {magicnum}', + 'anonymouspost_forum' => '允许使用本道具的版块', + 'anonymouspost_info' => '将自己的文章设置为匿名身份,请输入文章的 ID', + 'anonymouspost_info_nonexistence' => '请指定要匿名的文章', + 'anonymouspost_succeed' => '成功设置为匿名', + 'anonymouspost_use_error' => '参数错误,不能在此处使用本道具。', + 'anonymouspost_info_noperm' => '对不起,主题所在版块不允许使用本道具', + 'anonymouspost_info_user_noperm' => '对不起,您不能对此人使用本道具', + 'anonymouspost_once_limit' => '已经是匿名状态了,不能重复使用本道具。', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_attachsize.php b/source/language/magic/lang_attachsize.php new file mode 100644 index 0000000..a35b535 --- /dev/null +++ b/source/language/magic/lang_attachsize.php @@ -0,0 +1,22 @@ + '附件增容卡', + 'attachsize_desc' => '增加附件容量上限', + 'attachsize_info' => '额外增加 {num} M 附件容量上限', + 'attachsize_addsize' => '增加容量', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_bump.php b/source/language/magic/lang_bump.php new file mode 100644 index 0000000..b418f42 --- /dev/null +++ b/source/language/magic/lang_bump.php @@ -0,0 +1,27 @@ + '提升卡', + 'bump_forum' => '允许使用本道具的版块', + 'bump_desc' => '可以提升某个主题', + 'bump_info' => '提升指定的主题,请输入主题的 ID', + 'bump_info_nonexistence' => '请指定要提升的主题', + 'bump_succeed' => '您操作的主题已提升', + 'bump_info_noperm' => '对不起,主题所在版块不允许使用本道具', + + 'bump_notification' => '您的主题 {subject} 被 {actor} 使用了{magicname},快去看看吧!', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_call.php b/source/language/magic/lang_call.php new file mode 100644 index 0000000..60aa339 --- /dev/null +++ b/source/language/magic/lang_call.php @@ -0,0 +1,21 @@ + '点名卡', + 'call_desc' => '发通知给自己的好友,让他们来查看自己的日志', + 'call_info' => '发通知给自己的好友,让他们来查看自己的日志', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_checkonline.php b/source/language/magic/lang_checkonline.php new file mode 100644 index 0000000..97e030e --- /dev/null +++ b/source/language/magic/lang_checkonline.php @@ -0,0 +1,28 @@ + '雷达卡', + 'checkonline_desc' => '查看某个用户是否在线', + 'checkonline_targetuser' => '您要查看谁是否在线', + 'checkonline_info_nonexistence' => '请输入用户名', + 'checkonline_hidden_message' => '{username} 当前隐身,最后活动时间是 {time}', + 'checkonline_online_message' => '{username} 当前在线,最后活动时间是 {time}', + 'checkonline_offline_message' => '{username} 当前离线', + 'checkonline_info_noperm' => '对不起,您无权查看此人的 IP', + + 'checkonline_notification' => '有人使用了{magicname}检查您是否在线', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_chgusername.php b/source/language/magic/lang_chgusername.php new file mode 100644 index 0000000..e85d439 --- /dev/null +++ b/source/language/magic/lang_chgusername.php @@ -0,0 +1,28 @@ + '更名卡', + 'chgusername_desc' => '可以修改当前用户的用户名', + 'chgusername_newusername' => '请输入新用户名', + 'chgusername_info_nonexistence' => '请输入新用户名后再提交', + 'chgusername_check_failed' => '用户名合法性检测失败,请您更换后再试', + 'chgusername_name_badword' => '用户名包含被系统屏蔽的字符,请您更换后再试', + 'chgusername_name_exists' => '用户名已经存在,请您更换后再试', + 'chgusername_change_failed' => '用户名修改操作提交失败,请联系管理员', + 'chgusername_change_success' => '用户名修改操作提交成功,请几分钟后重新登录,如出现任何问题请联系管理员', + +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_close.php b/source/language/magic/lang_close.php new file mode 100644 index 0000000..2a525b2 --- /dev/null +++ b/source/language/magic/lang_close.php @@ -0,0 +1,30 @@ + '沉默卡', + 'close_desc' => '可以将主题关闭,禁止回复', + 'close_expiration' => '关闭有效期', + 'close_expiration_comment' => '设置主题可以被关闭多长时间,默认 24 小时', + 'close_forum' => '允许使用本道具的版块', + 'close_info' => '关闭指定的主题 {expiration} 小时,请输入主题的 ID', + 'close_info_nonexistence' => '请指定要关闭的主题', + 'close_succeed' => '您操作的主题已关闭', + 'close_info_noperm' => '对不起,主题所在版块不允许使用本道具', + 'close_info_user_noperm' => '对不起,您不能对此人使用本道具', + + 'close_notification' => '您的主题 {subject} 被 {actor} 使用了{magicname},快去看看吧!', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_detector.php b/source/language/magic/lang_detector.php new file mode 100644 index 0000000..7318658 --- /dev/null +++ b/source/language/magic/lang_detector.php @@ -0,0 +1,22 @@ + '探测器', + 'detector_desc' => '探测埋了红包的会员空间', + 'detector_num' => '最大探测数', + 'detector_info' => '探测(最多 {num} 个)埋了红包的会员空间', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_doodle.php b/source/language/magic/lang_doodle.php new file mode 100644 index 0000000..9b0ddfb --- /dev/null +++ b/source/language/magic/lang_doodle.php @@ -0,0 +1,21 @@ + '涂鸦板', + 'doodle_desc' => '在日志、文章中使用涂鸦板', + 'doodle_info' => '在日志、文章中使用涂鸦板', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_downdateline.php b/source/language/magic/lang_downdateline.php new file mode 100644 index 0000000..86ccad4 --- /dev/null +++ b/source/language/magic/lang_downdateline.php @@ -0,0 +1,21 @@ + '时光机', + 'downdateline_desc' => '把自己日志的发布时间修改为过去', + 'downdateline_info' => '把自己日志的发布时间修改为过去', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_flicker.php b/source/language/magic/lang_flicker.php new file mode 100644 index 0000000..239a733 --- /dev/null +++ b/source/language/magic/lang_flicker.php @@ -0,0 +1,18 @@ + '彩虹炫', + 'flicker_desc' => '在日志、相册评论中使用彩虹炫', + 'flicker_info' => '在日志、相册评论中使用彩虹炫', + 'flicker_succeed' => '彩虹炫使用成功。', +); \ No newline at end of file diff --git a/source/language/magic/lang_friendnum.php b/source/language/magic/lang_friendnum.php new file mode 100644 index 0000000..e96aead --- /dev/null +++ b/source/language/magic/lang_friendnum.php @@ -0,0 +1,22 @@ + '好友增容卡', + 'friendnum_desc' => '增加好友容量上限', + 'friendnum_info' => '额外增加 {num} 个好友上限', + 'friendnum_addnum' => '增加好友数', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_gift.php b/source/language/magic/lang_gift.php new file mode 100644 index 0000000..f539056 --- /dev/null +++ b/source/language/magic/lang_gift.php @@ -0,0 +1,30 @@ + '红包卡', + 'gift_desc' => '将自己的一部分积分埋在空间,来访者可以点击获取', + 'gift_info' => '将积分作为红包(可分成多份)埋在自己空间,
          每个来访者最多可以获取其中一份', + 'gift_succeed' => '埋设红包成功 ', + 'gift_bad_credits_input' => '输入的积分总数有误', + 'gift_bad_percredit_input' => '输入的每份积分数有误', + 'gift_bad_credittype_input' => '指定的积分类型有误', + 'gift_credits_out_of_own' => '输入的积分数超出您拥有的积分数', + 'gift_gc' => '回收红包', + 'gift_use' => '埋个红包', + + 'gift_receive_gift' => '领取红包 {percredit} {credittype}', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_highlight.php b/source/language/magic/lang_highlight.php new file mode 100644 index 0000000..2b77237 --- /dev/null +++ b/source/language/magic/lang_highlight.php @@ -0,0 +1,35 @@ + '变色卡', + 'highlight_desc' => '可以将文章或日志的标题高亮,变更颜色', + 'highlight_expiration' => '高亮有效期', + 'highlight_expiration_comment' => '设置标题可以被高亮多长时间,默认 24 小时。作用于日志时无有效期。', + 'highlight_forum' => '允许使用本道具的版块', + 'highlight_info_tid' => '高亮主题的标题 {expiration} 小时', + 'highlight_info_blogid' => '可以将日志或文章的标题高亮,变更颜色', + 'highlight_color' => '颜色', + 'highlight_info_nonexistence_tid' => '请指定要高亮的文章', + 'highlight_info_nonexistence_blogid' => '请指定要高亮的日志', + 'highlight_succeed_tid' => '您操作的文章已高亮', + 'highlight_succeed_blogid' => '您操作的日志已高亮', + 'highlight_info_noperm' => '对不起,主题所在版块不允许使用本道具', + 'highlight_info_notype' => '参数错误,没有指定操作类型。', + + 'highlight_notification' => '您的主题 {subject} 被 {actor} 使用了{magicname},快去看看吧!', + 'highlight_notification_blogid' => '您的日志 {subject} 被 {actor} 使用了{magicname},快去看看吧!', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_hot.php b/source/language/magic/lang_hot.php new file mode 100644 index 0000000..b6ff2c6 --- /dev/null +++ b/source/language/magic/lang_hot.php @@ -0,0 +1,21 @@ + '热点灯', + 'hot_desc' => '把自己的日志热度增加站点推荐的热点值', + 'hot_info' => '把自己的日志热度增加 {num} 个热点值', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_jack.php b/source/language/magic/lang_jack.php new file mode 100644 index 0000000..b480d52 --- /dev/null +++ b/source/language/magic/lang_jack.php @@ -0,0 +1,31 @@ + '千斤顶', + 'jack_desc' => '可以将主题顶起一段时间,重复使用可延长文章被顶起的时间', + 'jack_expiration' => '时长', + 'jack_expiration_comment' => '设置主题可以被顶起多长时间,默认 1 小时', + 'jack_forum' => '允许使用本道具的版块', + 'jack_info' => '

          顶起指定的主题 {expiration} 小时。

          您现在有 {magicnum} 个千斤顶可以使用。

          ', + 'jack_num' => '本次使用数量:', + 'jack_num_not_enough' => '道具数量不足或没有填写使用数量。', + 'jack_info_nonexistence' => '请指定要顶起的主题', + 'jack_succeed' => '千斤顶成功将主题顶起', + 'jack_info_noperm' => '对不起,主题所在版块不允许使用本道具', + + 'jack_notification' => '您的主题 {subject} 被 {actor} 使用了{magicname},快去看看吧!', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_money.php b/source/language/magic/lang_money.php new file mode 100644 index 0000000..9f44491 --- /dev/null +++ b/source/language/magic/lang_money.php @@ -0,0 +1,21 @@ + '金钱卡', + 'money_desc' => '可以随机获得特定积分', + 'money_info' => '获得的钱币数目规则:大于1且小于购买价格150%的随机数', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_namepost.php b/source/language/magic/lang_namepost.php new file mode 100644 index 0000000..ef8a7c0 --- /dev/null +++ b/source/language/magic/lang_namepost.php @@ -0,0 +1,28 @@ + '照妖镜', + 'namepost_desc' => '可以查看一次匿名用户的真实身份。', + 'namepost_forum' => '允许使用本道具的版块', + 'namepost_num' => '拥有个数: {magicnum}', + 'namepost_info' => '指定要显身的文章,请输入文章的 ID', + 'namepost_info_nonexistence' => '参数错误,不能在此使用本道具。', + 'namepost_succeed' => '匿名的用户是 {username}', + 'namepost_info_noperm' => '对不起,主题所在版块不允许使用本道具', + 'namepost_info_user_noperm' => '对不起,您不能对此人使用本道具', + 'magic_namepost_succeed' => '匿名的用户是', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_open.php b/source/language/magic/lang_open.php new file mode 100644 index 0000000..6fb05fa --- /dev/null +++ b/source/language/magic/lang_open.php @@ -0,0 +1,28 @@ + '喧嚣卡', + 'open_desc' => '可以将主题开启,可以回复', + 'open_forum' => '允许使用本道具的版块', + 'open_info' => '开放指定的主题,请输入主题的 ID', + 'open_info_nonexistence' => '请指定要开放的主题', + 'open_succeed' => '您操作的主题已开放回复', + 'open_info_noperm' => '对不起,主题所在版块不允许使用本道具', + 'open_info_user_noperm' => '对不起,您不能对此人使用本道具', + + 'open_notification' => '您的主题 {subject} 被 {actor} 使用了{magicname},快去看看吧!', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_repent.php b/source/language/magic/lang_repent.php new file mode 100644 index 0000000..0fbc12c --- /dev/null +++ b/source/language/magic/lang_repent.php @@ -0,0 +1,27 @@ + '悔悟卡', + 'repent_desc' => '可以删除自己的文章', + 'repent_forum' => '允许使用本道具的版块', + 'repent_info' => '删除自己的文章,请输入文章的 ID', + 'repent_info_nonexistence' => '请指定要删除的文章', + 'repent_succeed' => '您操作的文章已删除', + 'repent_info_noperm' => '对不起,主题所在版块不允许使用本道具', + 'repent_info_user_noperm' => '对不起,您只能删除自己的文章', + 'repent_do_not_rushreply' => '不能在抢楼帖中使用此道具', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_showip.php b/source/language/magic/lang_showip.php new file mode 100644 index 0000000..38f2287 --- /dev/null +++ b/source/language/magic/lang_showip.php @@ -0,0 +1,26 @@ + '窥视卡', + 'showip_desc' => '可以查看指定用户的 IP', + 'showip_targetuser' => '您要查看谁的 IP', + 'showip_info_nonexistence' => '请输入用户名', + 'showip_ip_message' => '{username} 的 IP 为 {ip}', + 'showip_info_noperm' => '对不起,您无权查看此人的 IP', + + 'showip_notification' => '您被人使用了{magicname}', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_stick.php b/source/language/magic/lang_stick.php new file mode 100644 index 0000000..e6163c7 --- /dev/null +++ b/source/language/magic/lang_stick.php @@ -0,0 +1,29 @@ + '置顶卡', + 'stick_desc' => '可以将主题置顶', + 'stick_expiration' => '置顶有效期', + 'stick_expiration_comment' => '设置主题可以被置顶多长时间,默认 24 小时', + 'stick_forum' => '允许使用本道具的版块', + 'stick_info' => '置顶指定的主题 {expiration} 小时,请输入主题的 ID', + 'stick_info_nonexistence' => '请指定要置顶的主题', + 'stick_succeed' => '您操作的主题已置顶', + 'stick_info_noperm' => '对不起,主题所在版块不允许使用本道具', + + 'stick_notification' => '您的主题 {subject} 被 {actor} 使用了{magicname},快去看看吧!', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_thunder.php b/source/language/magic/lang_thunder.php new file mode 100644 index 0000000..13be7cd --- /dev/null +++ b/source/language/magic/lang_thunder.php @@ -0,0 +1,21 @@ + '雷鸣之声', + 'thunder_desc' => '发布一条全站动态,通知大家自己上线了', + 'thunder_info' => '发布一条全站动态,通知大家自己上线了', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_updateline.php b/source/language/magic/lang_updateline.php new file mode 100644 index 0000000..74f4b70 --- /dev/null +++ b/source/language/magic/lang_updateline.php @@ -0,0 +1,21 @@ + '救生圈', + 'updateline_desc' => '把自己日志的发布时间更新为当前时间', + 'updateline_info' => '把自己日志的发布时间更新为当前时间', +); + +?> \ No newline at end of file diff --git a/source/language/magic/lang_visit.php b/source/language/magic/lang_visit.php new file mode 100644 index 0000000..e1ca0e1 --- /dev/null +++ b/source/language/magic/lang_visit.php @@ -0,0 +1,22 @@ + '互访卡', + 'visit_desc' => '随机访问好友空间/向好友打招呼/给好友留言', + 'visit_num' => '访问好友数', + 'visit_info' => '随机访问(最多 {num} 个)好友空间/向好友打招呼/给好友留言', +); + +?> \ No newline at end of file diff --git a/source/language/member/index.htm b/source/language/member/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/language/member/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/language/member/lang_template.php b/source/language/member/lang_template.php new file mode 100644 index 0000000..dfafd56 --- /dev/null +++ b/source/language/member/lang_template.php @@ -0,0 +1,61 @@ + '找回密码', + 'login_guest' => '没有账号?{$_G[\'setting\'][\'reglinkname\']}', + 'new_password' => '新密码', + 'new_password_confirm' => '确认密码', + 'password_weak' => '密码太弱,密码中必须包含', + 'strongpw_1' => '数字', + 'strongpw_2' => '小写字母', + 'strongpw_3' => '大写字母', + 'strongpw_4' => '特殊符号', + 'submit' => '提交', + 'close' => '关闭', + 'faq' => '帮助', + 'login' => '登录', + 'login_clearcookies' => '清除痕迹', + 'login_guestmessage' => '您需要先登录才能继续本操作', + 'login_seccheck2' => '请输入验证码后继续登录', + 'login_member' => '用户登录', + 'login_method' => '快捷登录', + 'login_permanent' => '自动登录', + 'profile_renew' => '请补充下面的登录信息', + 'register_from' => '推荐人', + 'account' => '账号', + 'password' => '密码', + 'activation' => '激活', + 'agree' => '同意', + 'disagree' => '不同意', + 'index_activation' => '您的账号需要激活', + 'invite_code' => '邀请码', + 'login_inactive' => '放弃激活,现在{$_G[\'setting\'][\'reglinkname\']}', + 'login_now' => '已有账号?现在登录', + 'password_confirm' => '确认密码', + 'register_buyinvitecode' => '还没有邀请码?点击此处获取', + 'register_email_tips' => '请输入正确的邮箱地址', + 'register_message' => '注册原因', + 'register_message1' => '您填写的注册原因会被当作申请注册的重要参考依据,请认真填写。', + 'register_password_length_tips1' => '最小长度为', + 'register_password_length_tips2' => '个字符', + 'register_password_tips' => '请填写密码', + 'register_repassword_tips' => '请再次输入密码', + 'register_username_tips' => '用户名由 3 到 15 个字符组成', + 'register_validate_email_tips' => '注册需要验证邮箱,请务必填写正确的邮箱,提交后请及时查收邮件。
          您可能需要等待几分钟才能收到邮件,如果收件箱没有,请检查一下垃圾邮件箱。', + 'rulemessage' => '网站服务条款', +); + +?> \ No newline at end of file diff --git a/source/language/payment/index.htm b/source/language/payment/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/payment/lang_type.php b/source/language/payment/lang_type.php new file mode 100644 index 0000000..998c92d --- /dev/null +++ b/source/language/payment/lang_type.php @@ -0,0 +1,19 @@ + '积分充值', + 'payment_invite' => '购买邀请码', +); + +?> \ No newline at end of file diff --git a/source/language/portal/index.htm b/source/language/portal/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/portal/lang_template.php b/source/language/portal/lang_template.php new file mode 100644 index 0000000..1784685 --- /dev/null +++ b/source/language/portal/lang_template.php @@ -0,0 +1,324 @@ + '版块', + 'homepage' => '首页', + 'no_content' => '抱歉,此模块没有更多内容', + 'portal' => '{$_G[\'setting\'][\'navs\'][1][\'navname\']}', + 'category' => '分类', + 'comment' => '评论', + 'comment_view' => '查看评论', + 'hide_portal_comment' => '提示:本页有 $pricount 个评论因未通过审核而被隐藏', + 'post_comment' => '发表评论', + 'delete' => '删除', + 'edit' => '编辑', + 'moderate_not_validate' => '审核未通过', + 'quote' => '引用', + 'article_publish' => '发布文章', + 'category_related' => '相关分类', + 'rss_subscribe_this' => '订阅', + 'sub_category' => '下级分类', + 'article_hot' => '热门内容', + 'article_last' => '最新文章', + 'portal_attachment_big_img' => '插入大图', + 'portal_attachment_set_cover' => '设为封面', + 'portal_attachment_small_img' => '小图', + 'latest_comment' => '最新评论', + 'view_all_comments' => '查看全部评论', + 'diyhelp_doit' => '自己动手,让自己拥有个性的页面。请点击上面的按钮开始 DIY,或者', + 'diyhelp_import' => '导入程序现有模板', + 'diyhelp_no_content' => '正在建设中,请稍候……', + 'diyhelp_start_diy' => '开始 DIY', + 'frame' => '框架', + 'article_author' => '原作者', + 'article_auto_grab' => '自动获取', + 'article_category' => '频道栏目', + 'article_comment_setup' => '评论设置', + 'article_dateline' => '发布时间', + 'article_delete' => '删除文章', + 'article_delete_direct' => '直接删除', + 'article_delete_recyclebin' => '放入回收站', + 'article_delete_sure' => '确认要删除此文章吗?', + 'article_description' => '摘要', + 'article_edit' => '编辑文章', + 'article_forbidcomment_description' => '禁止评论', + 'article_getauthorall' => '获取楼主所有文章', + 'article_id' => '文章 ID', + 'article_pushplus' => '文章连载', + 'article_related' => '添加相关文章', + 'article_send_continue' => '继续发布新文章', + 'article_send_succeed' => '发布文章成功', + 'article_show_inner_navigation' => '显示分页导航', + 'article_source' => '文章来源', + 'article_source_url' => '来源地址', + 'article_tag' => '聚合标签', + 'article_title' => '标  题', + 'article_url' => '跳转URL', + 'article_validate_category' => '请选择系统分类', + 'article_validate_has_added' => '该文章已经添加过了', + 'article_validate_noexist' => '没有找到指定的文章', + 'article_html_existed' => 'HTML静态文件名重名', + 'article_validate_title' => '标题长度不符合要求', + 'grab' => '获取', + 'ignore' => '忽略', + 'moderate_article' => '审核文章', + 'page_title' => '分页标题', + 'passed' => '通过', + 'portalcp_article_message1' => '个新帖将添加到文章连载。', + 'portalcp_article_message2' => '提示:$pushedcount 个文章已经在连载中了', + 'select' => '选择', + 'select_color' => '点击选择颜色', + 'submit' => '提交', + 'view_article' => '查看文章', + 'block_adddata' => '添加', + 'block_adddata_comment' => '添加数据', + 'block_cancel_favorite' => '取消收藏', + 'block_data' => '模块数据', + 'block_data_block' => '屏蔽数据', + 'block_data_custom' => '自定义内容', + 'block_data_from_datasource' => '从数据源获取', + 'block_data_source' => '数据来源', + 'block_data_update_cache' => '数据缓存更新', + 'block_display_position' => '显示位置', + 'block_display_style' => '显示样式', + 'block_edit' => '编辑模块', + 'block_expire_time' => '失效时间', + 'block_expire_time_comment' => '留空表示不失效', + 'block_favorite' => '收藏', + 'block_id' => '模块标识', + 'block_isblank' => '只接受推送数据', + 'block_isblank_tips' => '勾选此项,则该模块只显示推送的数据,不自动聚合数据', + 'block_item_display_num' => '显示条数', + 'block_itemdata' => '推送库', + 'block_management' => '模块管理', + 'block_moreurl' => '更多页设置', + 'block_properties' => '模块属性', + 'block_properties_comment' => '此模块数据由属性决定,请编辑属性以展示需要的数据', + 'block_start_time' => '开始时间', + 'block_start_time_comment' => '留空表示立即开始', + 'block_stop' => '屏蔽', + 'block_template' => '模块模板', + 'block_type' => '模块分类', + 'block_type_convert_tips' => '此模块分类支持转换模块的类型,但可能会存在部分特殊字段的丢失且模块的显示样式将会变为自定义模板,请根据需要使用。
          注意:选择下拉列表中的模块类型以后模块分类立即发生改变。', + 'block_view_banned_data' => '查看屏蔽数据', + 'cachetimerange' => '更新区间', + 'cancel' => '取消', + 'current_data_odd' => '当前数据是否在奇数行', + 'current_data_order' => '当前数据顺序', + 'data_repeat_recommend' => '此信息已被推送,再次推送将使用本次修改数据', + 'day' => '天', + 'default_loop_content' => '默认循环显示内容', + 'diy_module' => '自定义模板', + 'edit_data' => '编辑数据', + 'edit_diy_content' => '编辑自定义内容', + 'grammar' => '语法', + 'hide' => '隐藏', + 'hide_setting' => '收起设置项', + 'hidedisplay' => '隐藏输出', + 'hidedisplay_tips' => '不输出模块内容;而是提供数据供模板调用。', + 'hour' => '小时', + 'image' => '图片', + 'is_stick' => '是否置顶', + 'locked' => '固定', + 'minute' => '分钟', + 'mod_name' => '模块模板名称', + 'mod_save_to' => '模板另存为...', + 'moderate_data' => '审核数据', + 'moderate_message' => '勾选则加入审核库;否则直接加入模块推送库', + 'more_introduction' => '更多说明...', + 'more_url' => '更多链接', + 'need_moderate' => '需要审核', + 'never_update' => '永不更新', + 'no' => '否', + 'no_data' => '没有相关数据', + 'no_data_mod' => '此模块的推送库里还没有任何数据', + 'not_auto_update' => '不自动更新', + 'not_stick' => '不置顶', + 'operation' => '操作', + 'pass_moderate_time' => '通过审核时间', + 'perpage' => '显示条数', + 'perpage_tips' => '设置更多页每页显示数据的条数', + 'point' => '点', + 'portalcp_block_message1' => '提醒: 您选择了隐藏输出,模块不会输出任何内容;但是您可以在页面模板中调用模块的数据。', + 'portalcp_block_message2' => '输入名称将此样式保存到公共模块模板(以便在其他模块中使用)', + 'position' => '位置', + 'preorder' => '预订', + 'punctualupdate' => '准时更新', + 'punctualupdate_tips' => '为了减轻系统负载,系统设定为同一时间最多只更新一个模块;勾选此项可以忽略此优化,保证模块按指定缓存时间及时更新(警告:这会严重加重系统负载!不要同一页面内设置大量“准时更新”模块!)', + 'reference_call_data' => '参考调用格式', + 'reference_call_field' => '可调用字段', + 'reference_message' => '请参考: 后台 - 门户 - 模块模板 - 编辑/添加模板', + 'replace_loop_content' => '替代对应loop中指定数据内容,[order=odd]为奇数行,[order=even]为偶数行', + 'seodescription' => 'SEO Description', + 'seodescription_tips' => '设置更多页的页面SEO Description', + 'seokeywords' => 'SEO Keywords', + 'seokeywords_tips' => '设置更多页的页面SEO Keywords', + 'seotitle' => 'SEO Title', + 'seotitle_tips' => '设置更多页的页面SEO Title', + 'set_open_link' => '可设置打开方式的链接', + 'set_small_pic' => '可设置缩略图大小的图片', + 'special_data_content' => '特殊指定数据显示内容', + 'statements' => '语句', + 'stick' => '置顶', + 'stick_level' => '置顶等级', + 'title' => '标题', + 'todo_updateblock' => '更新模块', + 'todo_updateblock_message' => '即时更新模块数据', + 'update_mod' => '更新模块', + 'update_mod_now' => '立即更新该模块数据', + 'verify_message' => '您推送的信息将进入审核库', + 'cut' => '裁切', + 'remote' => '远程', + 'block_link_target_blank' => '新链接打开', + 'block_link_target_self' => '本页面打开', + 'block_link_target_top' => '本页面打开(跳出框架)', + 'block_link_target_type' => '链接打开方式', + 'block_thumb_height' => '缩略图高度', + 'block_thumb_width' => '缩略图宽度', + 'dateformat' => '日期格式', + 'dateuformat' => '使用人性化日期格式', + 'dateuformat_tips' => '勾选此项,则最近的时间显示“几天前”的形式', + 'action_invalid' => '请选择要进行的操作', + 'all' => '全部', + 'article_category_move' => '移到栏目', + 'article_manage' => '文章管理', + 'article_new' => '新文章', + 'article_not_choose' => '请选择要操作的文章', + 'article_operation' => '操作', + 'article_subject' => '文章标题', + 'category_management' => '频道栏目', + 'ignored' => '已忽略', + 'me' => '我的文章', + 'moderate' => '审核', + 'portalcp_perpage' => '每页显示', + 'view_space' => '查看空间', + 'comment_delete' => '删除回复', + 'comment_delete_confirm' => '确定删除指定的回复吗?', + 'comment_edit_content' => '编辑内容', + 'background' => '背景', + 'background_attach_fixed' => '固定', + 'background_attach_mode' => '背景滚动', + 'background_attach_scroll' => '滚动', + 'background_color' => '背景颜色', + 'background_image_cancel' => '取消背景图', + 'content_area' => '内容区', + 'diy_change' => '更换', + 'diy_editing' => '正在编辑', + 'diy_systemfile' => '系统内置', + 'diy_update_start' => '开始上传', + 'diy_upload_image' => '上传新图片', + 'diy_uploadfile' => '上传文件', + 'image_position' => '图片位置', + 'image_repeat' => '平铺', + 'image_repeat_direct' => '直接使用', + 'image_repeat_horizontal' => '横向平铺', + 'image_repeat_mode' => '图片平铺', + 'image_repeat_vertical' => '纵向平铺', + 'import' => '导入', + 'import_frame' => '导入框架', + 'import_select_file' => '选择要导入的文件', + 'import_system_file_no_exists' => '没有找到内置文件', + 'import_text_file_from' => '文本文件的位置', + 'link_color' => '链接颜色', + 'restore_skin' => '恢复原装皮肤', + 'text_color' => '文字颜色', + 'title_bar' => '标题栏', + 'article_numbers' => '文章数', + 'category_name' => '分类名称', + 'category_push_select' => '选择一个频道分类:', + 'portalcp_has_no_category' => '您还没有创建任何频道栏目', + 'portalcp_index_message' => '您还没有可管理的频道栏目', + 'block_recommend_data_in_block' => '已被推送到的模块', + 'has_no_block' => '没有要推送的模块', + 'select_block' => '请在下面选择要推送的模块', + 'admin_pm' => '通知作者', + 'all_page' => '全部页面', + 'block_in_updateline' => '已进入更新队列', + 'block_list' => '模块列表', + 'block_no_managable' => '没有可管理的模块', + 'block_not_in_updateline' => ' 秒后进入更新队列', + 'block_operation' => '操作', + 'block_page' => '所在页面', + 'block_verifieddata' => '已审核数据', + 'block_verifydata' => '未审核数据', + 'click_return_list' => '点击返回列表页', + 'data' => '数据', + 'find' => '查找', + 'mod_category' => '模块分类', + 'property' => '属性', + 'push' => '推送', + 'push_dateline' => '推送时间', + 'push_people' => '推送者', + 'push_updateblock' => '加入更新队列', + 'push_updateblock_tips' => '已经加入更新队列的模块并不立即更新,当此模块所在的页面被访问时才触发更新,请耐心等待', + 'show_push' => '显示推送标志', + 'unoperation' => '−', + 'unused' => '未使用', + 'update_block_tips' => '数据通过审核以后,相应的模块将加入更新队列', + 'view_select_mod' => '仅显示搜索条件下的模块。 ', + 'add_by_self' => '手工添加', + 'add_portal_related_success' => '操作成功 ', + 'already_select' => '已选', + 'manage_related_article' => '管理相关文章', + 'max_wait_select' => '最多显示50条', + 'move_down' => '下移', + 'move_up' => '上移', + 'selected_tag_selected' => '将选中项标记为已选', + 'wait_select' => '待选', + 'link_to_internet' => '网络链接', + 'modify' => '修改', + 'topic_add' => '新建专题', + 'topic_additional' => '附加内容', + 'topic_allowcomment' => '是否允许评论', + 'topic_cover' => '专题封面', + 'topic_cover_current' => '当前封面', + 'topic_create_closed' => '创建专题时默认为关闭', + 'topic_custom_start' => '开始自定义 {$topic[\'title\']} 吧~', + 'topic_description' => 'SEO 描述', + 'topic_description_comment' => '专题介绍,此描述内容用于搜索引擎优化,放在 meta 的 description 标签中', + 'topic_domain' => '二级域名', + 'topic_domain_comment' => '根域名设置完后,此处域名绑定才能生效,设置根域名,专题的二级域名,不能重复', + 'topic_edit' => '编辑专题', + 'topic_keyword' => 'SEO 关键字', + 'topic_keyword_comment' => '此关键词用于搜索引擎优化,放在 meta 的 keyword 标签中,多个关键字间请用半角逗号 "," 隔开', + 'topic_navs' => '站点导航', + 'topic_opened' => '是否开启', + 'topic_page_bottom' => '站点尾部信息', + 'topic_static_name' => '静态化名称', + 'topic_static_name_comment' => '用于专题静态化时显示在链接中的个性化名称,不能重复', + 'topic_submit' => '专题标题', + 'topic_tplname_comment' => '请将模板文件上传到模板目录的portal目录下,如:template/default/portal目录下,文件名必须为portal_topic_*.htm,*为自定义文件名
          如果要重新选择模板,请确保新模板与原模板中可拖拽区域具有相同的ID,否则将会丢失分部或全部原DIY数据', + 'tplname' => '模板名', + 'upload_from_local' => '本地上传', + 'yes' => '是', + 'article_inner_navigation' => '本文导航', + 'article_inner_page' => '页', + 'article_inner_page_pre' => '第', + 'from' => '来自', + 'nav_index' => '{$_G[\'setting\'][\'navs\'][1][\'navname\']}', + 'view_author_original' => '原作者', + 'view_comments' => '评论', + 'view_content' => '查看内容', + 'view_publisher' => '发布者', + 'view_related' => '相关阅读', + 'view_views' => '查看', + 'pre_article' => '上一篇:', + 'next_article' => '下一篇:', + 'display_order' => '显示位置', + 'filename' => '文件名', +); + +?> \ No newline at end of file diff --git a/source/language/ranklist/index.htm b/source/language/ranklist/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/ranklist/lang_navtitle.php b/source/language/ranklist/lang_navtitle.php new file mode 100644 index 0000000..9ebcde9 --- /dev/null +++ b/source/language/ranklist/lang_navtitle.php @@ -0,0 +1,76 @@ + '用户积分排行', + 'ranklist_title_member_bid' => '用户竞价排行', + 'ranklist_title_member_girl' => '美女排行', + 'ranklist_title_member_boy' => '帅哥排行', + 'ranklist_title_member_friend' => '好友数排行', + 'ranklist_title_member_invite' => '邀请排行', + 'ranklist_title_member_post' => '发帖数排行', + 'ranklist_title_member_blog' => '日志数排行', + 'ranklist_title_member_onlinetime' => '在线时间排行', + + 'ranklist_title_thread_reply' => '文章回复排行', + 'ranklist_title_thread_view' => '文章查看排行', + 'ranklist_title_thread_share' => '文章分享排行', + 'ranklist_title_thread_favorite' => '文章收藏排行', + 'ranklist_title_thread_heat' => '文章热度排行', + + 'ranklist_title_blog_heat' => '日志人气排行', + 'ranklist_title_blog_reply' => '日志评论排行', + 'ranklist_title_blog_view' => '日志查看排行', + 'ranklist_title_blog_share' => '日志分享排行', + 'ranklist_title_blog_favorite' => '日志收藏排行', + 'ranklist_title_blog_1' => '日志路过排行', + 'ranklist_title_blog_2' => '日志鸡蛋排行', + 'ranklist_title_blog_3' => '日志鲜花排行', + 'ranklist_title_blog_4' => '日志握手排行', + 'ranklist_title_blog_5' => '日志雷人排行', + + 'ranklist_title_poll_heat' => '投票热度排行', + 'ranklist_title_poll_favorite' => '投票收藏排行', + 'ranklist_title_poll_share' => '投票分享排行', + + 'ranklist_title_activity_heat' => '活动热度排行', + 'ranklist_title_activity_favorite' => '活动收藏排行', + 'ranklist_title_activity_share' => '活动分享排行', + + 'ranklist_title_picture_heat' => '图片热图排行', + 'ranklist_title_picture_share' => '图片分享排行', + 'ranklist_title_picture_1' => '图片漂亮排行', + 'ranklist_title_picture_2' => '图片酷毙排行', + 'ranklist_title_picture_3' => '图片雷人排行', + 'ranklist_title_picture_4' => '图片鲜花排行', + 'ranklist_title_picture_5' => '图片鸡蛋排行', + + 'ranklist_title_forum_thread' => '版块发帖排行', + 'ranklist_title_forum_post' => '版块回复排行', + 'ranklist_title_forum_post_30' => '版块 30 天发帖排行', + 'ranklist_title_forum_post_24' => '版块最近 24 小时发帖排行', + + 'ranklist_title_group_credit' => '圈子积分排行', + 'ranklist_title_group_member' => '圈子成员数排行', + 'ranklist_title_group_thread' => '圈子发帖排行', + 'ranklist_title_group_post' => '圈子回复排行', + 'ranklist_title_group_post_30' => '圈子最近 30 天发帖排行', + 'ranklist_title_group_post_24' => '圈子最近 24 小时发帖排行', + + 'ranklist_title_app_today' => '今日应用活跃排行', + 'ranklist_title_app_all' => '最流行应用', +); + +?> \ No newline at end of file diff --git a/source/language/ranklist/lang_template.php b/source/language/ranklist/lang_template.php new file mode 100644 index 0000000..efb6870 --- /dev/null +++ b/source/language/ranklist/lang_template.php @@ -0,0 +1,141 @@ + '全部', + 'have' => '已有', + 'homepage' => '首页', + 'hot' => '热度', + 'join' => '人参加', + 'message' => '条留言', + 'none_data' => '没有相关数据', + 'ranklist' => '排行', + 'ranklist_activity' => '活动排行', + 'ranklist_activity_end' => '报名截止', + 'ranklist_activity_start' => '活动时间:', + 'ranklist_favorite' => '收藏排行', + 'ranklist_hot' => '热度排行', + 'ranklist_month' => '本月', + 'ranklist_share' => '分享排行', + 'ranklist_thread_favorite' => '收藏', + 'ranklist_thread_share' => '分享', + 'ranklist_today' => '今日', + 'ranklist_update' => '排行榜数据已被缓存,上次于 $lastupdate 被更新,下次将于 $nextupdate 进行更新', + 'ranklist_week' => '本周', + 'blog_ranklist' => '日志排行', + 'comment' => '评论', + 'comment_ranklist' => '评论排行', + 'hot_ranklist' => '人气排行', + 'ranklist_thread_view' => '查看', + 'views' => '人气:', + 'visit_ranklist' => '查看排行', + 'forum' => '版块', + 'ranklist_forum' => '版块排行', + 'ranklist_forum_day_post' => '最近 24 小时发帖', + 'ranklist_forum_month_post' => '最近 30 天发帖', + 'ranklist_forum_post' => '发帖', + 'ranklist_post' => '发帖排行', + 'ranklist_post_day' => '最近 24 小时发帖排行', + 'ranklist_reply' => '回复排行', + 'reply' => '回复', + 'credit_num' => '积分数', + 'credit_ranking' => '积分排行', + 'group' => '圈子', + 'member_num' => '成员数', + 'ranklist_group' => '圈子排行', + 'ranklist_group_credit' => '圈子积分数排行', + 'ranklist_member_num' => '成员数排行', + 'auction_ranking' => '竞价排行', + 'close_ranking_note' => '管理员已关闭竞价,暂时无法继续上榜', + 'credit_is_not_number' => '您所填写的{$extcredits[$creditid][\'title\']}不是一个合法数值', + 'credit_title_error' => '您所填写的{$extcredits[$creditid][\'title\']}不能小于1', + 'credit_title_message' => '您的当前{$extcredits[$creditid][\'title\']}为 {$space[\'credit\']},请填写一个小于该值的数字', + 'current_ranking' => '当前排名', + 'edit_price' => '修改单价', + 'friend_need_help' => '要帮助的好友', + 'friend_num_ranking' => '好友数排行', + 'friend_top_note' => '排行榜公告', + 'handsel' => '赠送', + 'handsel_bid' => '赠送竞价', + 'help_friend_in_top' => '帮助好友来上榜', + 'i_ranking' => '我也要上榜', + 'increase_bid' => '增加竞价', + 'make_persistent_efforts' => '再接再厉', + 'max_char_ranking' => '最多50个汉字,会显示在榜单中', + 'my_ranking_declaration' => '我的上榜宣言', + 'not_exceed' => '不要超过自己的', + 'please_input_friend_name' => '请输入好友的用户名', + 'price_can_not_be_higher_than_the_total' => '您所填写的单价不能高于竞价总额', + 'ranking_message_0' => '您现在还没有上榜。让自己上榜吧,这会大大提升您的主页曝光率。', + 'ranking_message_1' => '竞价单价越多,竞价排名越靠前,您的主页曝光率也会越高;', + 'ranking_message_2' => '上榜用户的主页被别人有效浏览一次,将从竞价{$extcredits[$creditid][\'title\']}中扣除您设定的竞价值(恶意刷新访问不扣减)。', + 'ranklist_beauty' => '美女排行', + 'ranklist_blog' => '日志数排行', + 'ranklist_handsome' => '帅哥排行', + 'ranklist_invite' => '邀请排行', + 'ranklist_member' => '用户排行', + 'ranklist_onlinetime' => '在线时间排行', + 'ranklist_post_num' => '发帖数排行', + 'reminder' => '提示信息', + 'self_current_credit' => '您当前的', + 'self_current_friend_num' => '您当前的好友数', + 'show_unitprice' => '竞价单价', + 'top_100_update' => '下面列出的为排行前100名,数据每 $cache_time 分钟更新一次。', + 'unitprice_is_not_number' => '您所填写的单价不是一个合法数值', + 'unitprice_title_error' => '您所填写的单价不能小于1', + 'your_current_bid' => '自己当前的竞价单价', + 'add_friend' => '加为好友', + 'blogs_num' => '日志数', + 'day_post_num' => '最近24小时发帖数', + 'digest_num' => '精华数', + 'friends_num' => '好友数', + 'invite_num' => '邀请数', + 'last_activity' => '最后活跃', + 'minute' => '分钟', + 'modify' => '修改', + 'month_post_num' => '最近30天发帖数', + 'no_members_of' => '没有相关成员。', + 'online' => '在线', + 'online_time' => '在线时间', + 'order' => '排序:', + 'post_num' => '发帖数', + 'posts_num' => '文章数', + 'say_hi' => '打个招呼', + 'send_pm' => '发送消息', + 'show_credit' => '剩余竞价', + 'show_credit_note' => '竞价宣言', + 'visit_friend' => '去串个门', + 'hot_pic_ranklist' => '热图排行', + 'ranklist_picture' => '图片排行', + 'people_join' => '人参与', + 'ranklist_poll' => '投票排行', + 'to_poll' => '去投票', + 'bidding_rank' => '竞价排名', + 'i_want_rank' => '我要上榜', + 'more' => '更多', + 'ranklist_thread' => '文章排行', + 'activity' => '活动', + 'blogs' => '日志', + 'pics' => '图片', + 'poll' => '投票', + 'posts' => '文章', + 'user' => '用户', + 'author' => '作者', + 'ranklist_thread_heat' => '热度', + 'ranklist_thread_reply' => '回复', + 'thread' => '主题', +); + +?> \ No newline at end of file diff --git a/source/language/search/index.htm b/source/language/search/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/search/lang_template.php b/source/language/search/lang_template.php new file mode 100644 index 0000000..6ff4729 --- /dev/null +++ b/source/language/search/lang_template.php @@ -0,0 +1,99 @@ + '对不起,没有找到匹配结果。', + 'search_result' => '结果: 找到相关主题 {$index[\'num\']} 个', + 'search_result_keyword' => '结果: 找到 “$keyword” 相关内容 {$index[\'num\']} 个', + 'a_comment' => '个评论', + 'a_visit' => '次查看', + 'heat' => '热度', + 'search_credit_msg' => '每进行一次搜索将扣除 $policymsgs', + '180_days_ago' => '6 个月', + '1_days_ago' => '1 天', + '2_days_ago' => '2 天', + '30_days_ago' => '1 个月', + '365_days_ago' => '1 年', + '7_days_ago' => '1 周', + '90_days_ago' => '3 个月', + 'author' => '作者', + 'dateline' => '发布时间', + 'keywords' => '关键词', + 'order_asc' => '按升序排列', + 'order_desc' => '按降序排列', + 'order_lastpost' => '回复时间', + 'order_replies' => '回复数量', + 'order_starttime' => '发布时间', + 'order_views' => '浏览次数', + 'post_trade_price' => '商品价格', + 'search_allforum' => '全部版块', + 'search_any_date' => '全部时间', + 'search_fulltext' => '全文', + 'search_newer' => '以内', + 'search_older' => '以前', + 'search_orderby' => '排序类型', + 'search_range' => '搜索范围', + 'search_thread_higher' => '文章高级搜索', + 'search_thread_range' => '主题范围', + 'search_thread_range_all' => '全部主题', + 'search_thread_range_digest' => '精华主题', + 'search_thread_range_top' => '置顶主题', + 'search_time' => '搜索时间', + 'special_activity' => '活动主题', + 'special_debate' => '辩论主题', + 'special_poll' => '投票主题', + 'special_reward' => '悬赏主题', + 'special_thread' => '特殊主题', + 'special_trade' => '商品主题', + 'trade_remaindays' => '剩余时间', + 'a_comment_thread' => '个回复', + 'anonymous' => '匿名', + 'creating_time' => '创建时间', + 'credits' => '积分', + 'member' => '成员', + 'public' => '公开', + 'search_group_result' => '结果: 找到相关{$_G[\'setting\'][\'navs\'][3][\'navname\']} $groupnum 个', + 'search_group_result_keyword' => '结果: 找到相关{$_G[\'setting\'][\'navs\'][3][\'navname\']} $groupnum 个,  相关主题 $index[\'num\'] 个', + 'search_group_viewgroup' => '查看{$_G[\'setting\'][\'navs\'][3][\'navname\']}', + 'threads' => '主题', + 'subscribe' => '订阅', + 'comment' => '评论', + 'lastupdate' => '最后更新', + 'return_homepage' => '返回首页', + 'visit_my_space' => '访问我的空间', + 'album' => '相册', + 'blog' => '日志', + 'collection' => '淘帖', + 'portal' => '文章', + 'quick' => '快速', + 'search_adv' => '高级', + 'search_quick_day_180' => '6 月内文章', + 'search_quick_day_30' => '1 月内文章', + 'search_quick_day_365' => '1 年内文章', + 'search_quick_day_7' => '1 周内文章', + 'search_quick_hour_1' => '1 小时以内的新帖', + 'search_quick_hour_24' => '24 小时以内的新帖', + 'search_quick_hour_4' => '4 小时以内的新帖', + 'search_quick_hour_8' => '8 小时以内的新帖', + 'user' => '用户', + 'equal_to' => '等于', + 'lower_than' => '小于', + 'more_than' => '大于', + 'unlimited' => '不限', + 'goto_memcp' => '进入管理面板', + 'thread_list_message1' => '内容隐藏需要,请点击进去查看', +); + +?> \ No newline at end of file diff --git a/source/language/seccode/index.htm b/source/language/seccode/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/language/seccode/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/language/secqaa/index.htm b/source/language/secqaa/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/secqaa/lang_calc.php b/source/language/secqaa/lang_calc.php new file mode 100644 index 0000000..cd7c66b --- /dev/null +++ b/source/language/secqaa/lang_calc.php @@ -0,0 +1,20 @@ + '100 以内加减法', + 'calc_desc' => '随机显示 100 以内加减法的验证问答', +); + +?> \ No newline at end of file diff --git a/source/language/secqaa/lang_calcmad.php b/source/language/secqaa/lang_calcmad.php new file mode 100644 index 0000000..dd9f679 --- /dev/null +++ b/source/language/secqaa/lang_calcmad.php @@ -0,0 +1,18 @@ + '九九乘法表', + 'calcmad_desc' => '随机显示九九乘法表内包含的乘除法的验证问答', +); \ No newline at end of file diff --git a/source/language/tag/index.htm b/source/language/tag/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/tag/lang_template.php b/source/language/tag/lang_template.php new file mode 100644 index 0000000..9cddd46 --- /dev/null +++ b/source/language/tag/lang_template.php @@ -0,0 +1,36 @@ + '还没有任何标签', + 'tag' => '标签', + 'blog_read' => '次阅读', + 'blog_replay' => '个评论', + 'empty_tags' => '没有此标签,您可以继续搜索或者返回标签首页', + 'forum' => '版块', + 'hot' => '热度', + 'lastpost' => '最后发表', + 'no_content' => '没有相关内容', + 'personal_category' => '个人分类', + 'related_blog' => '相关日志', + 'related_thread' => '相关文章', + 'replies' => '回复/查看', + 'price' => '售价', + 'attach_img' => '图片附件', + 'attachment' => '附件', + 'thread_digest' => '精华', +); + +?> \ No newline at end of file diff --git a/source/language/task/index.htm b/source/language/task/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/task/lang_avatar.php b/source/language/task/lang_avatar.php new file mode 100644 index 0000000..146bf38 --- /dev/null +++ b/source/language/task/lang_avatar.php @@ -0,0 +1,25 @@ + '头像类任务', + 'avatar_desc' => '该任务仅限没有上传头像的会员申请,申请后只要上传头像即可完成任务,获得相应的奖励', + 'avatar_view' => '请按照以下的说明来参与本任务: + ', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_blog.php b/source/language/task/lang_blog.php new file mode 100644 index 0000000..f535117 --- /dev/null +++ b/source/language/task/lang_blog.php @@ -0,0 +1,25 @@ + '发表日志任务', + 'blog_desc' => '发表日志即可完成任务,获得相应的奖励', + 'blog_view' => '请按照以下的说明来参与本任务: + ', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_connect_bind.php b/source/language/task/lang_connect_bind.php new file mode 100644 index 0000000..f88f56f --- /dev/null +++ b/source/language/task/lang_connect_bind.php @@ -0,0 +1,25 @@ + 'QQ 账号绑定任务', + 'connect_bind_desc' => '绑定 QQ 账号即可获得相应的奖励', + 'connect_bind_view' => '请按照以下的说明来参与本任务: + ', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_email.php b/source/language/task/lang_email.php new file mode 100644 index 0000000..82607e8 --- /dev/null +++ b/source/language/task/lang_email.php @@ -0,0 +1,26 @@ + '验证邮箱任务', + 'email_desc' => '验证邮箱获得相应的奖励。', + 'email_view' => '请按照以下的说明来参与本任务: +
            +
          • 新窗口打开账号设置页面
          • +
          • 在新打开的设置页面中,将自己的邮箱真实填写(新填写的邮箱需要先保存),并点击“重新接收验证邮件”链接
          • +
          • 几分钟后,系统会给您发送一封邮件,收到邮件后,请按照邮件的说明,访问邮件中的验证链接就可以了
          • +
          ', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_friend.php b/source/language/task/lang_friend.php new file mode 100644 index 0000000..da2074a --- /dev/null +++ b/source/language/task/lang_friend.php @@ -0,0 +1,26 @@ + '添加好友任务', + 'friend_desc' => '拥有 5 个好友获得相应的奖励', + 'friend_view' => '请按照以下的说明来参与本任务: +
            +
          • 1. 新窗口打开寻找好友页面
          • +
          • 2. 在新打开的页面中,可以将系统自动给您找到的推荐用户加为好友,也可以自己设置条件寻找并添加为好友
          • +
          • 3. 接下来,您还需要等待对方批准您的好友申请
          • +
          ', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_gift.php b/source/language/task/lang_gift.php new file mode 100644 index 0000000..09a31f1 --- /dev/null +++ b/source/language/task/lang_gift.php @@ -0,0 +1,20 @@ + '红包类任务', + 'gift_desc' => '申请此任务即可领取红包', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_invite.php b/source/language/task/lang_invite.php new file mode 100644 index 0000000..fe51d85 --- /dev/null +++ b/source/language/task/lang_invite.php @@ -0,0 +1,26 @@ + '

          哇,厉害!您现在已经邀请了 {count} 个好友,请继续努力!


          ', + 'invite_guide' => '请按照以下的说明来完成本任务: +
            +
          • 在新窗口中打开好友邀请页面
          • +
          • 通过 QQ、MSN 等 IM 工具,或者发送邮件,把邀请链接告诉您的好友,邀请他们加入进来吧
          • +
          • 您需要邀请 10 个好友才算完成
          • +
          ', + +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_member.php b/source/language/task/lang_member.php new file mode 100644 index 0000000..20f6653 --- /dev/null +++ b/source/language/task/lang_member.php @@ -0,0 +1,33 @@ + '会员类任务', + 'member_desc' => '此类任务用来鼓励和引导会员使用论坛的某个功能,活跃论坛的氛围,例如收藏主题、使用道具等', + 'member_complete_var_act' => '动作', + 'member_complete_var_act_favorite' => '收藏主题', + 'member_complete_var_act_magic' => '使用道具', + 'member_complete_var_act_userapp' => '添加漫游应用', + 'member_complete_var_num' => '执行动作次数下限', + 'member_complete_var_num_comment' => '会员需要执行相应动作的最少次数', + 'member_complete_var_time' => '时间限制(小时)', + 'member_complete_var_time_comment' => '设置会员从申请任务到完成任务的时间限制,会员在此时间内未能完成任务则不能领取奖励并标记任务失败,0 或留空为不限制', + + 'task_complete_time_start' => '从申请任务开始计时,', + 'task_complete_time_limit' => '{value} 小时内,', + 'task_complete_act_favorite' => '收藏 {value} 个主题', + 'task_complete_act_magic' => '使用 {value} 次道具。
          您可以在文章页面、日志页面、图片页面等使用道具', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_post.php b/source/language/task/lang_post.php new file mode 100644 index 0000000..7784bc0 --- /dev/null +++ b/source/language/task/lang_post.php @@ -0,0 +1,40 @@ + '论坛文章类任务', + 'post_desc' => '通过发帖回帖完成任务,活跃论坛的氛围', + 'post_complete_var_act' => '动作', + 'post_complete_var_act_newthread' => '发新主题', + 'post_complete_var_act_newreply' => '发新回复', + 'post_complete_var_act_newpost' => '发新主题/回复', + 'post_complate_var_forumid' => '版块限制', + 'post_complate_var_forumid_comment' => '设置会员只能在某个版块完成任务', + 'post_complate_var_threadid' => '回复指定主题', + 'post_complate_var_threadid_comment' => '设置会员只有回复该主题才能完成任务,请填写主题的 TID', + 'post_complate_var_author' => '回复指定作者', + 'post_complate_var_author_comment' => '设置会员只有回复该作者发表的主题才能完成任务,请填写作者的用户名', + 'post_complete_var_num' => '执行动作次数下限', + 'post_complete_var_num_comment' => '会员需要执行相应动作的最少次数', + 'post_complete_var_time' => '时间限制(小时)', + 'post_complete_var_time_comment' => '设置会员从申请任务到完成任务的时间限制,会员在此时间内未能完成任务则不能领取奖励并标记任务失败,0 或留空为不限制', + + 'task_complete_forumid' => '在版块 {value} ', + 'task_complete_act_newthread' => '发新主题 {num} 次', + 'task_complete_act_newpost' => '发新主题/回复 {num} 次', + 'task_complete_act_newreply_thread' => '在“{value}”回复主题 {num} 次', + 'task_complete_act_newreply_author' => '回复作者“{value}”的主题 {num} 次', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_profile.php b/source/language/task/lang_profile.php new file mode 100644 index 0000000..50c4851 --- /dev/null +++ b/source/language/task/lang_profile.php @@ -0,0 +1,28 @@ + '完善用户资料任务', + 'profile_desc' => '完善指定的用户资料获得相应的奖励', + + 'profile_view' => '您还有以下个人资料项需要补充完整:
          + {profiles}

          + 请按照以下的说明来完成本任务: + ', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_promotion.php b/source/language/task/lang_promotion.php new file mode 100644 index 0000000..afb05ab --- /dev/null +++ b/source/language/task/lang_promotion.php @@ -0,0 +1,22 @@ + '站点推广任务', + 'promotion_desc' => '到“访问推广”页面,复制您的推广链接,发给QQ好友、您的博客或其他大型网站,推广获积分', + 'promotion_complete_var_iplimit' => '推广 IP 数下限', + 'promotion_complete_var_iplimit_comment' => '当日推广 IP 数大于或等于此设置,才能完成任务', +); + +?> \ No newline at end of file diff --git a/source/language/task/lang_secmobile.php b/source/language/task/lang_secmobile.php new file mode 100644 index 0000000..f5fc85f --- /dev/null +++ b/source/language/task/lang_secmobile.php @@ -0,0 +1,24 @@ + '验证安全手机任务', + 'secmobile_desc' => '验证安全手机获得相应的奖励。', + 'secmobile_view' => '请按照以下的说明来参与本任务: +
            +
          • 新窗口打开账号设置页面
          • +
          • 在新打开的设置页面中,将自己的安全手机真实填写,随后获取并输入验证码
          • +
          • 输入正确的验证码后点击提交即可
          • +
          ', +); \ No newline at end of file diff --git a/source/language/touch/index.htm b/source/language/touch/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/language/touch/lang_template.php b/source/language/touch/lang_template.php new file mode 100644 index 0000000..63a778c --- /dev/null +++ b/source/language/touch/lang_template.php @@ -0,0 +1,227 @@ + '简易版', + 'nomobiletype' => '电脑版', + 'extremelysimplemobiletype' => 'WML版', + 'favorite' => '收藏', + 'my_posts' => '我的文章', + 'new_pm' => '新短消息', + 'waptitle' => '手机版', + 'misc_mobile_title' => '手机版', + 'login_mobile' => '现在就登录 - {$_G[\'setting\'][\'bbname\']} 手机版', + 'login_mobile_join' => '立即使用手机访问,获得极速移动体验', + 'mobile_favorite' => '快速收藏', + 'mobile_favorite_comment' => '您可以通过手机快速访问论坛版块及管理收藏夹,随时随地访问自己最爱的内容', + 'mobile_other_1' => '节省流量与获得优质手机体验并存', + 'mobile_pm' => '站内短信实时收发,与短信另一端的朋友进行单人或多人聊天', + 'mobile_viewthread' => '看帖及回帖更快速', + 'mobile_viewthread_comment' => '通过手机版,可以快速的访问您需要阅读的主题,并可以快速的发布新帖及回复', + 'continue' => '继续访问', + 'goback' => '返回上一页', + 'message_forward_mobile' => '点击此链接进行跳转', + 'favorite_delete' => '取消收藏', + 'index_members' => '会员', + 'index_today' => '今日', + 'my_favorites_forums' => '我收藏的版块', + 'online' => '在线', + 'sourceimagesize' => '原图尺寸', + 'forum_posts' => '回', + 'forum_post_insert'=> '插入', + 'forum_post_perm'=>'阅读权限', + 'e_audio' => '音乐', + 'e_video' => '视频', + 'group' => '群', + 'post_newthreaddebate' => '发辩论', + 'post_newthreadpoll' => '发投票', + 'post_newthreadreward' => '发悬赏', + 'send_threads' => '发帖', + 'thread_digest' => '精华', + 'thread_recommend' => '推荐', + 'thread_sticky' => '置顶', + 'threadsort' => '分类信息', + 'threadtype' => '主题分类', + 'viewnewthread' => '新帖排序', + 'admin_threadtopicadmin_error' => '手机版不支持复杂管理操作', + 'expiry' => '期限(0为永久/1为1天)', + 'mod_message_goto_admincp' => '需要您使用电脑浏览器进入后台进行高级功能操作', + 'result' => '查找结果', + 'join_thread' => '回复', + 'required' => '必填', + 'send_special_activity_error' => '手机版不支持活动发布,请点击上方发帖选择其他方式', + 'send_special_trade_error' => '手机版不支持商品发布,请点击上方发帖选择其他方式', + 'threadsort_error' => '发布分类信息请使用电脑版', + 'threadsort_calendar' => '日期格式:2010-12-01', + 'post_poll_options' => '投票选项', + 'admin_close_expire_comment' => '选填日期格式:2010-12-01 10:50', + 'admin_delthread_confirm' => '您确认要删除?', + 'topicadmin_mobile_mod' => '手机版主题操作', + 'admin_banpost_confirm' => '您要进行屏蔽操作', + 'admin_delpost_confirm' => '您确定要删除此回复?', + 'admin_warn_confirm' => '您要进行警告操作', + 'attach_nopermission_login' => '您需要登录才可以下载或查看附件。没有账号?{$_G[\'setting\'][\'reglinkname\']}', + 'attachlist' => '附件列表', + 'ban_member' => '禁止', + 'digest' => '精华', + 'forum_views' => '看', + 'send_pm' => '发消息', + 'thread_show_all' => '看全部', + 'thread_show_author' => '只看他', + 'activity_mod' => '请您使用非手机版管理活动', + 'poll_msg_allwvote_user' => '您需要登录之后方能进行投票', + 'resolved' => '已解决', + 'unresolved' => '未解决', + 'trade_mod' => '请您使用非手机版管理商品', + 'my_favorites_thread' => '我收藏的文章', + 'return_forum' => '返回论坛', + 'title_memcp_favorite' => '收藏', + 'back' => '返回', + 'chatpm' => '群聊', + 'chatpm_author' => '发起者', + 'pm_totail' => '交谈', + 'pm_with' => '与', + 'user_mobile_pm_error' => '手机版不支持复杂短消息操作,请返回我的短消息', + 'basic_information' => '基本资料', + 'favorite_description_default' => '手机收藏', + 'favorite_forum_confirm' => '收藏此版块: ', + 'favorite_thread_confirm' => '收藏此主题: ', + 'user_mobile_pm_comment' => '短消息发出后将跳回上一页', + 'reset' => '重填', + 'reg_username' => '用户名必须为大于3位小于15位', + 'empty' => '没有文章', + 'mobilehome' => '首页', + 'register' => '注册', + 'mobile2version' => '手机版', + 'clientversion' => '客户端', + 'forum_list' => '版块列表', + 'user_info' => '用户信息', + 'hot_thread' => '热帖', + 'send_reply_fast_tip' => '我也说一句', + 'nologin_tip' => '您还未登录,立即登录?', + 'nopostreply' => '您暂时没有权限发表', + 'hotest_thread' => '精彩热帖', + 'send_thread' => '发表', + 'thread_subject' => '标题', + 'thread_content' => '内容', + 'uploadpicfailed' => '上传失败,请稍后再试', + 'uploadpicatttypeban' => '(附件类型被禁止)', + 'donotcross' => '(不能超过', + 'bytemore' => '字节)', + 'networkerror' => '网络出现问题,请稍后再试', + 'viewonlyauthorid' => '只看楼主', + 'recommend_post' => '推荐', + 'numheader' => '第', + 'unitpaper' => '张', + 'numtotal' => '共', + 'lastpic' => '最后一张', + 'firstpic' => '第一张', + 'favforum' => '收藏版块', + 'favthread' => '收藏文章', + 'viewmypm' => '查看消息', + 'myprofile' => '我的资料', + 'otherprofile' => '的资料', + 'admincp_mobile' => '管理中心', + 'logout_mobile' => '退出登录', + 'myfavorite' => '我的收藏', + 'mythread' => '我的主题', + 'mypm' => '我的消息', + 'sendpm' => '发送', + 'inputyourname' => '请输入用户名', + 'useqqconnectlogin' => '或使用QQ登录', + 'noregister' => '还没有注册?', + 'registerinputtip' => '用户名:3-15位', + 'registerpassword2' => '确认密码', + 'registeremail' => '邮箱', + 'quickregister' => '立即注册', + 'searchthread' => '搜索文章', + 'uploadstatusmsgnag1' => '内部服务器错误', + 'uploadstatusmsg0' => '上传成功', + 'uploadstatusmsg1' => '不支持此类扩展名', + 'uploadstatusmsg2' => '服务器限制无法上传那么大的附件', + 'uploadstatusmsg3' => '用户组限制无法上传那么大的附件', + 'uploadstatusmsg4' => '不支持此类扩展名', + 'uploadstatusmsg5' => '文件类型限制无法上传那么大的附件', + 'uploadstatusmsg6' => '今日您已无法上传更多的附件', + 'uploadstatusmsg7' => '请选择图片文件', + 'uploadstatusmsg8' => '附件文件无法保存', + 'uploadstatusmsg9' => '没有合法的文件被上传', + 'uploadstatusmsg10' => '非法操作', + 'uploadstatusmsg11' => '今日您已无法上传那么大的附件', + 'uploadstatusmsg12' => '因文件名包含敏感词而无法提交', + 'uploadstatusmsg13' => '服务器限制无法上传分辨率过高的附件', + 'postreplyneedmod' => '本版回帖需要审核,您的文章将在通过审核后显示', + 'replylist' => '回复列表', + 'last_thread' => '上一个主题', + 'next_thread' => '下一个主题', + 'warmtip' => '温馨提示', + 'zsltmobileclient' => '掌上论坛手机客户端', + 'visitbbsanytime' => '随时随地上论坛', + 'clicktodownload' => '点击下载', + 'iphoneandriodmobile' => 'iPhone,Andriod等智能手机', + 'visitwapmobile' => '直接登录手机版,阅读体验更佳', + 'clicktovisitwapmobile' => '访问手机版', + 'downloadnow' => '立即下载', + 'downloadzslttoshareview' => '下载新版掌上论坛客户端,尊享多项看帖特权!', + 'mobhome' => '首页', + 'mobportal' => '门户', + 'mobforum' => '社区', + 'mobpost' => '发布', + 'mobfind' => '发现', + 'mobmy' => '我的', + 'mobfeed' => '动态', + 'mobsearchtxt' => '搜索关键字', + 'mobredian' => '热点', + 'mobtuijian' => '推荐', + 'mobrenqi' => '人气', + 'mobyuedu' => '查看', + 'mobnodescription' => '暂无版块介绍', + 'mobposts' => '帖数', + 'mobzan' => '点赞', + 'mobpinglun' => '评论', + 'mobtishi' => '提示信息', + 'mobtu' => '图', + 'mobta' => 'Ta的', + 'mobfa' => '发', + 'mobthread' => '主题', + 'mobnodata' => '暂无数据', + 'mobfenlei' => '分类', + 'mobzhiding' => '置顶', + 'mobnews' => '资讯', + 'mobsendpm' => '请输入内容...', + 'mobshezhi' => '设置', + 'mobnoreply' => '暂无回复,快来抢沙发', + 'mobdebate_tip' => '请使用电脑版对辩论文章进行高级管理', + 'mobdaodu' => '导读', + + 'guide_forumlist' => '看版块', + + 'home_credit_buy' => '充值', + 'home_credit_buy_rmb' => '人民币', + 'home_credit_buy_rmb_placeholder' => '请输入充值的数量', + 'home_credit_buy_card' => '充值卡', + + 'mob_required_lost' => '必填项目没有填写', + 'mob_sort_selnext' => '请选择下一级', + 'mob_sort_emailerr' => '邮件地址不正确', + 'mob_sort_toolong' => '填写项目长度过长', + 'mob_sort_numerr' => '数字填写不正确', + 'mob_sort_max' => '大于设置最大值', + 'mob_sort_min' => '小于设置最小值', + 'mob_sort_urlerr' => '请正确填写以http或https开头的URL地址', + 'mob_sort_uploaderr' => '暂不支持上传图片', + +); +?> \ No newline at end of file diff --git a/source/module/forum/forum_ajax.php b/source/module/forum/forum_ajax.php new file mode 100644 index 0000000..c8d3ef6 --- /dev/null +++ b/source/module/forum/forum_ajax.php @@ -0,0 +1,744 @@ + false)); + } elseif($usernamelen > 15) { + showmessage('profile_username_toolong', '', array(), array('handle' => false)); + } + + loaducenter(); + $ucresult = uc_user_checkname($username); + + if($ucresult == -1) { + showmessage('profile_username_illegal', '', array(), array('handle' => false)); + } elseif($ucresult == -2) { + showmessage('profile_username_protect', '', array(), array('handle' => false)); + } elseif($ucresult == -3) { + if(C::t('common_member')->fetch_by_username($username) || C::t('common_member_archive')->fetch_by_username($username)) { + showmessage('register_check_found', '', array(), array('handle' => false)); + } else { + showmessage('register_activation', '', array(), array('handle' => false)); + } + } + + $censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($_G['setting']['censoruser'] = trim($_G['setting']['censoruser'])), '/')).')$/i'; + if($_G['setting']['censoruser'] && @preg_match($censorexp, $username)) { + showmessage('profile_username_protect', '', array(), array('handle' => false)); + } + +} elseif($_GET['action'] == 'checkemail') { + + require_once libfile('function/member'); + checkemail($_GET['email']); + +} elseif($_GET['action'] == 'checkinvitecode') { + + $invitecode = trim($_GET['invitecode']); + if(!$invitecode) { + showmessage('no_invitation_code', '', array(), array('handle' => false)); + } + $result = array(); + if($invite = C::t('common_invite')->fetch_by_code($invitecode)) { + if(empty($invite['fuid']) && (empty($invite['endtime']) || $_G['timestamp'] < $invite['endtime'])) { + $result['uid'] = $invite['uid']; + $result['id'] = $invite['id']; + } + } + if(empty($result)) { + showmessage('wrong_invitation_code', '', array(), array('handle' => false)); + } + +} elseif($_GET['action'] == 'checkuserexists') { + + if(C::t('common_member')->fetch_by_username(trim($_GET['username'])) || C::t('common_member_archive')->fetch_by_username(trim($_GET['username']))) { + showmessage('', '', array(), array('msgtype' => 3)); + } else { + showmessage('username_nonexistence', '', array(), array('msgtype' => 3)); + } + +} elseif($_GET['action'] == 'attachlist') { + + require_once libfile('function/post'); + loadcache('groupreadaccess'); + $attachlist = getattach($_GET['pid'], intval($_GET['posttime']), $_GET['aids']); + $attachlist = $attachlist['attachs']['unused']; + $_G['group']['maxprice'] = isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]) ? $_G['group']['maxprice'] : 0; + + include template('common/header_ajax'); + include template('forum/ajax_attachlist'); + include template('common/footer_ajax'); + dexit(); +} elseif($_GET['action'] == 'imagelist') { + + require_once libfile('function/post'); + $attachlist = getattach($_GET['pid'], intval($_GET['posttime']), $_GET['aids']); + $imagelist = $attachlist['imgattachs']['unused']; + + include template('common/header_ajax'); + include template('forum/ajax_imagelist'); + include template('common/footer_ajax'); + dexit(); + +} elseif($_GET['action'] == 'get_rushreply_membernum') { + $tid = intval($_GET['tid']); + if($tid) { + $membernum = C::t('forum_post')->count_author_by_tid($tid); + showmessage('thread_reshreply_membernum', '', array('membernum' => intval($membernum - 1)), array('alert' => 'info')); + } + dexit(); +} elseif($_GET['action'] == 'deleteattach') { + + $count = 0; + if(isset($_GET['aids']) && isset($_GET['formhash']) && formhash() == $_GET['formhash']) { + foreach($_GET['aids'] as $aid) { + $attach = C::t('forum_attachment_n')->fetch_attachment('aid:'.$aid, $aid); + if($attach && ($attach['pid'] && $attach['pid'] == $_GET['pid'] && $_G['uid'] == $attach['uid'])) { + updatecreditbyaction('postattach', $attach['uid'], array(), '', -1, 1, $_G['fid']); + } + if($attach && ($attach['pid'] && $attach['pid'] == $_GET['pid'] && $_G['uid'] == $attach['uid'] || $_G['forum']['ismoderator'] || !$attach['pid'] && $_G['uid'] == $attach['uid'])) { + C::t('forum_attachment_n')->delete_attachment('aid:'.$aid, $aid); + C::t('forum_attachment')->delete($aid); + dunlink($attach); + $count++; + } + } + } + include template('common/header_ajax'); + echo $count; + include template('common/footer_ajax'); + dexit(); + +} elseif($_GET['action'] == 'secondgroup') { + + require_once libfile('function/group'); + $groupselect = get_groupselect($_GET['fupid'], $_GET['groupid']); + include template('common/header_ajax'); + include template('forum/ajax_secondgroup'); + include template('common/footer_ajax'); + dexit(); + +} elseif($_GET['action'] == 'displaysearch_adv') { + $display = $_GET['display'] == 1 ? 1 : ''; + dsetcookie('displaysearch_adv', $display); +} elseif($_GET['action'] == 'checkgroupname') { + $groupname = trim($_GET['groupname']); + if(empty($groupname)) { + showmessage('group_name_empty', '', array(), array('msgtype' => 3)); + } + $tmpname = cutstr($groupname, 20, ''); + if($tmpname != $groupname) { + showmessage('group_name_oversize', '', array(), array('msgtype' => 3)); + } + if(C::t('forum_forum')->fetch_fid_by_name($groupname)) { + showmessage('group_name_exist', '', array(), array('msgtype' => 3)); + } + showmessage('', '', array(), array('msgtype' => 3)); + include template('common/header_ajax'); + include template('common/footer_ajax'); + dexit(); +} elseif($_GET['action'] == 'getthreadtypes') { + include template('common/header_ajax'); + if(empty($_GET['selectname'])) $_GET['selectname'] = 'threadtypeid'; + echo ''; + include template('common/footer_ajax'); +} elseif($_GET['action'] == 'getimage') { + $_GET['aid'] = intval($_GET['aid']); + $image = C::t('forum_attachment_n')->fetch_attachment('aid:'.$_GET['aid'], $_GET['aid'], 1); + include template('common/header_ajax'); + if($image['aid']) { + echo ''; + } + include template('common/footer_ajax'); + dexit(); +} elseif($_GET['action'] == 'setthreadcover') { + $aid = intval($_GET['aid']); + $imgurl = $_GET['imgurl']; + require_once libfile('function/post'); + if($_G['forum'] && ($aid || $imgurl)) { + if($imgurl) { + $tid = intval($_GET['tid']); + $pid = intval($_GET['pid']); + } else { + $threadimage = C::t('forum_attachment_n')->fetch_attachment('aid:'.$aid, $aid); + $tid = $threadimage['tid']; + $pid = $threadimage['pid']; + } + + if($tid && $pid) { + $thread =get_thread_by_tid($tid); + } else { + $thread = array(); + } + if(empty($thread) || (!$_G['forum']['ismoderator'] && $_G['uid'] != $thread['authorid'])) { + if($_GET['newthread']) { + showmessage('set_cover_faild', '', array(), array('msgtype' => 3)); + } else { + showmessage('set_cover_faild', '', array(), array('closetime' => 3)); + } + } + if(setthreadcover($pid, $tid, $aid, 0, $imgurl)) { + if(empty($imgurl)) { + C::t('forum_threadimage')->delete_by_tid($threadimage['tid']); + C::t('forum_threadimage')->insert(array( + 'tid' => $threadimage['tid'], + 'attachment' => $threadimage['attachment'], + 'remote' => $threadimage['remote'], + )); + } + if($_GET['newthread']) { + showmessage('set_cover_succeed', '', array(), array('msgtype' => 3)); + } else { + showmessage('set_cover_succeed', '', array(), array('alert' => 'right', 'closetime' => 1)); + } + } + } + if($_GET['newthread']) { + showmessage('set_cover_faild', '', array(), array('msgtype' => 3)); + } else { + showmessage('set_cover_faild', '', array(), array('closetime' => 3)); + } + +} elseif($_GET['action'] == 'updateattachlimit') { + + $_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : ''; + $_G['group']['allowpostattach'] = $_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || (!$_G['forum']['postattachperm'] && $_G['group']['allowpostattach']) || ($_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm']))); + $_G['forum']['allowpostimage'] = isset($_G['forum']['allowpostimage']) ? $_G['forum']['allowpostimage'] : ''; + $_G['group']['allowpostimage'] = $_G['forum']['allowpostimage'] != -1 && ($_G['forum']['allowpostimage'] == 1 || (!$_G['forum']['postimageperm'] && $_G['group']['allowpostimage']) || ($_G['forum']['postimageperm'] && forumperm($_G['forum']['postimageperm']))); + + $allowuploadnum = $allowuploadtoday = TRUE; + if($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) { + if($_G['group']['maxattachnum']) { + $allowuploadnum = $_G['group']['maxattachnum'] - getuserprofile('todayattachs'); + $allowuploadnum = $allowuploadnum < 0 ? 0 : $allowuploadnum; + if(!$allowuploadnum) { + $allowuploadtoday = false; + } + } + if($_G['group']['maxsizeperday']) { + $allowuploadsize = $_G['group']['maxsizeperday'] - getuserprofile('todayattachsize'); + $allowuploadsize = $allowuploadsize < 0 ? 0 : $allowuploadsize; + if(!$allowuploadsize) { + $allowuploadtoday = false; + } + $allowuploadsize = $allowuploadsize / 1048576 >= 1 ? round(($allowuploadsize / 1048576), 1).'MB' : round(($allowuploadsize / 1024)).'KB'; + } + } + include template('common/header_ajax'); + include template('forum/post_attachlimit'); + include template('common/footer_ajax'); + exit; + +} elseif($_GET['action'] == 'forumchecknew' && !empty($_GET['fid']) && !empty($_GET['time'])) { + $fid = intval($_GET['fid']); + $time = intval($_GET['time']); + + if(!getgpc('uncheck')) { + $foruminfo = C::t('forum_forum')->fetch($fid); + $lastpost_str = $foruminfo['lastpost']; + if($lastpost_str) { + $lastpost = explode("\t", $lastpost_str); + unset($lastpost_str); + } + include template('common/header_ajax'); + echo $lastpost['2'] > $time ? 1 : 0 ; + include template('common/footer_ajax'); + exit; + } else { + $_G['forum_colorarray'] = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282'); + $query = C::t('forum_forumfield')->fetch($fid); + $forum_field['threadtypes'] = dunserialize($query['threadtypes']); + $forum_field['threadsorts'] = dunserialize($query['threadsorts']); + + if($forum_field['threadtypes']['types']) { + safefilter($forum_field['threadtypes']['types']); + } + if($forum_field['threadtypes']['options']['name']) { + safefilter($forum_field['threadtypes']['options']['name']); + } + if($forum_field['threadsorts']['types']) { + safefilter($forum_field['threadsorts']['types']); + } + + unset($query); + $forum_field = daddslashes($forum_field); + $todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd')); + foreach(C::t('forum_thread')->fetch_all_by_fid_lastpost($fid, $time, TIMESTAMP) as $thread) { + $thread['icontid'] = $thread['forumstick'] || !$thread['moved'] && $thread['isgroup'] != 1 ? $thread['tid'] : $thread['closed']; + if(!$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])) { + $thread['icontid'] = $thread['closed'] > 1 ? $thread['closed'] : $thread['tid']; + } + list($thread['subject'], $thread['author'], $thread['lastposter']) = daddslashes(array($thread['subject'], $thread['author'], $thread['lastposter'])); + $thread['dateline'] = $thread['dateline'] > $todaytime ? "".dgmdate($thread['dateline'], 'd')."" : "".dgmdate($thread['dateline'], 'd').""; + $thread['lastpost'] = dgmdate($thread['lastpost']); + if(isset($forum_field['threadtypes']['prefix'])) { + if($forum_field['threadtypes']['prefix'] == 1) { + $thread['threadtype'] = $forum_field['threadtypes']['types'][$thread['typeid']] ? '['.$forum_field['threadtypes']['types'][$thread['typeid']].'] ' : '' ; + } elseif($forum_field['threadtypes']['prefix'] == 2) { + $thread['threadtype'] = $forum_field['threadtypes']['icons'][$thread['typeid']] ? ' ' : '' ; + } + } + if(isset($forum_field['threadsorts']['prefix'])) { + $thread['threadsort'] = $forum_field['threadsorts']['types'][$thread['sortid']] ? '['.$forum_field['threadsorts']['types'][$thread['sortid']].']' : '' ; + } + if($thread['highlight']) { + $string = sprintf('%02d', $thread['highlight']); + $stylestr = sprintf('%03b', $string[0]); + + $thread['highlight'] = ' style="'; + $thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : ''; + $thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : ''; + $thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : ''; + $thread['highlight'] .= $string[1] ? 'color: '.$_G['forum_colorarray'][$string[1]].';' : ''; + if($thread['bgcolor']) { + $thread['highlight'] .= "background-color: $thread[bgcolor];"; + } + $thread['highlight'] .= '"'; + } else { + $thread['highlight'] = ''; + } + $target = $thread['isgroup'] == 1 || $thread['forumstick'] ? ' target="_blank"' : ' onclick="atarget(this)"'; + if(is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $thread['threadurl'] = ''.$thread['subject'].''; + } else { + $thread['threadurl'] = ''.$thread['subject'].''; + } + if(is_array($_G['setting']['rewritestatus']) && in_array($thread['displayorder'], array(1, 2, 3, 4))) { + $thread['id'] = 'stickthread_'.$thread['tid']; + } else { + $thread['id'] = 'normalthread_'.$thread['tid']; + } + $thread['threadurl'] = $thread['threadtype'].$thread['threadsort'].$thread['threadurl']; + if(is_array($_G['setting']['rewritestatus']) && in_array('home_space', $_G['setting']['rewritestatus'])) { + $thread['authorurl'] = ''.$thread['author'].''; + $thread['lastposterurl'] = ''.$thread['lastposter'].''; + } else { + $thread['authorurl'] = ''.$thread['author'].''; + $thread['lastposterurl'] = ''.$thread['lastposter'].''; + } + $threadlist[] = $thread; + } + if($threadlist) { + krsort($threadlist); + } + include template('forum/ajax_threadlist'); + + } +} elseif($_GET['action'] == 'downremoteimg') { + if(!$_G['group']['allowdownremoteimg']) { + dexit(); + } + $_GET['message'] = str_replace(array("\r", "\n"), array($_GET['wysiwyg'] ? '
          ' : '', "\\n"), $_GET['message']); + preg_match_all("/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]|\[img=\d{1,4}[x|\,]\d{1,4}\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", $_GET['message'], $image1, PREG_SET_ORDER); + preg_match_all("/\/ismU", $_GET['message'], $image2, PREG_SET_ORDER); + $temp = $aids = $existentimg = array(); + if(is_array($image1) && !empty($image1)) { + foreach($image1 as $value) { + $temp[] = array( + '0' => $value[0], + '1' => trim(!empty($value[1]) ? $value[1] : $value[2]) + ); + } + } + if(is_array($image2) && !empty($image2)) { + foreach($image2 as $value) { + $temp[] = array( + '0' => $value[0], + '1' => trim($value[2]) + ); + } + } + require_once libfile('class/image'); + if(is_array($temp) && !empty($temp)) { + $upload = new discuz_upload(); + $attachaids = array(); + + foreach($temp as $value) { + $imageurl = $value[1]; + $hash = md5($imageurl); + if(strlen($imageurl)) { + $imagereplace['oldimageurl'][] = $value[0]; + if(!isset($existentimg[$hash])) { + $existentimg[$hash] = $imageurl; + $attach['ext'] = $upload->fileext($imageurl); + if(!$upload->is_image_ext($attach['ext'])) { + continue; + } + $content = ''; + if(preg_match('/^(http(s?):\/\/|\.)/i', $imageurl)) { + $content = dfsockopen($imageurl); + } elseif(preg_match('/^('.preg_quote(getglobal('setting/attachurl'), '/').')/i', $imageurl)) { + $imagereplace['newimageurl'][] = $value[0]; + } + if(empty($content)) continue; + $patharr = explode('/', $imageurl); + $attach['name'] = trim($patharr[count($patharr)-1]); + $attach['thumb'] = ''; + + $attach['isimage'] = $upload -> is_image_ext($attach['ext']); + $attach['extension'] = $upload -> get_target_extension($attach['ext']); + $attach['attachdir'] = $upload -> get_target_dir('forum'); + $attach['attachment'] = $attach['attachdir'] . $upload->get_target_filename('forum').'.'.$attach['extension']; + $attach['target'] = getglobal('setting/attachdir').'./forum/'.$attach['attachment']; + + if(!@$fp = fopen($attach['target'], 'wb')) { + continue; + } else { + flock($fp, 2); + fwrite($fp, $content); + fclose($fp); + } + + if(!$upload->get_image_info($attach['target'])) { + @unlink($attach['target']); + continue; + } + $attach['size'] = filesize($attach['target']); + $upload->attach = $attach; + $thumb = $width = $height = 0; + if($upload->attach['isimage']) { + if($_G['setting']['thumbsource'] && $_G['setting']['sourcewidth'] && $_G['setting']['sourceheight']) { + $image = new image(); + $thumb = $image->Thumb($upload->attach['target'], '', $_G['setting']['sourcewidth'], $_G['setting']['sourceheight'], 1, 1) ? 1 : 0; + $width = $image->imginfo['width']; + $height = $image->imginfo['height']; + $upload->attach['size'] = $image->imginfo['size']; + } + if($_G['setting']['thumbstatus']) { + $image = new image(); + $thumb = $image->Thumb($upload->attach['target'], '', $_G['setting']['thumbwidth'], $_G['setting']['thumbheight'], $_G['setting']['thumbstatus'], 0) ? 1 : 0; + $width = $image->imginfo['width']; + $height = $image->imginfo['height']; + } + if($_G['setting']['thumbsource'] || !$_G['setting']['thumbstatus']) { + list($width, $height) = @getimagesize($upload->attach['target']); + } + if($_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark'])) { + $image = new image(); + $image->Watermark($attach['target'], '', 'forum'); + $upload->attach['size'] = $image->imginfo['size']; + } + } + $aids[] = $aid = getattachnewaid(); + $setarr = array( + 'aid' => $aid, + 'dateline' => $_G['timestamp'], + 'filename' => strip_tags(str_replace('"', '', $upload->attach['name'])), + 'filesize' => $upload->attach['size'], + 'attachment' => $upload->attach['attachment'], + 'isimage' => $upload->attach['isimage'], + 'uid' => $_G['uid'], + 'thumb' => $thumb, + 'remote' => '0', + 'width' => $width, + 'height' => $height + ); + C::t("forum_attachment_unused")->insert($setarr); + $attachaids[$hash] = $imagereplace['newimageurl'][] = '[attachimg]'.$aid.'[/attachimg]'; + + } else { + $imagereplace['newimageurl'][] = $attachaids[$hash]; + } + } + } + if(!empty($aids)) { + require_once libfile('function/post'); + } + $_GET['message'] = str_replace($imagereplace['oldimageurl'], $imagereplace['newimageurl'], $_GET['message']); + } + $_GET['message'] = addcslashes($_GET['message'], '/"\''); + print << + parent.ATTACHORIMAGE = 1; + parent.updateDownImageList('{$_GET['message']}'); + +EOF; + dexit(); +} elseif($_GET['action'] == 'exif') { + $exif = C::t('forum_attachment_exif')->fetch($_GET['aid']); + $s = $exif['exif']; + if(!$s) { + require_once libfile('function/attachment'); + $s = getattachexif($_GET['aid']); + C::t('forum_attachment_exif')->insert_exif($_GET['aid'], $s); + } + include template('common/header_ajax'); + echo $s; + include template('common/footer_ajax'); + exit; +} elseif($_GET['action'] == 'getthreadclass') { + $fid = intval($_GET['fid']); + $threadclass = ''; + if($fid) { + $option = array(); + $forumfield = C::t('forum_forumfield')->fetch($fid); + if(!empty($forumfield['threadtypes'])) { + foreach(C::t('forum_threadclass')->fetch_all_by_fid($fid) as $tc) { + $option[] = ''; + } + if(!empty($option)) { + $threadclass .= ''; + $threadclass .= implode('', $option); + } + } + } + + if(!empty($threadclass)) { + $threadclass = ''; + } + include template('common/header_ajax'); + echo $threadclass; + include template('common/footer_ajax'); + exit; + +} elseif($_GET['action'] == 'forumjump') { + require_once libfile('function/forumlist'); + $favforums = C::t('home_favorite')->fetch_all_by_uid_idtype($_G['uid'], 'fid'); + $visitedforums = array(); + if($_G['cookie']['visitedfid']) { + loadcache('forums'); + foreach(explode('D', $_G['cookie']['visitedfid']) as $fid) { + $fid = intval($fid); + $visitedforums[$fid] = $_G['cache']['forums'][$fid]['name']; + } + } + $forumlist = forumselect(FALSE, 1); + include template('forum/ajax_forumlist'); +} elseif($_GET['action'] == 'quickreply') { + $tid = intval($_GET['tid']); + $fid = intval($_GET['fid']); + if($tid) { + $thread = C::t('forum_thread')->fetch_thread($tid); + if($thread && !getstatus($thread['status'], 2)) { + $list = C::t('forum_post')->fetch_all_by_tid('tid:'.$tid, $tid, true, 'DESC', 0, 10, null, 0); + loadcache('smilies'); + foreach($list as $pid => $post) { + if($post['first']) { + unset($list[$pid]); + } else { + $post['message'] = preg_replace($_G['cache']['smilies']['searcharray'], '', $post['message']); + $post['message'] = preg_replace("/\{\:soso_((e\d+)|(_\d+_\d))\:\}/", '', $post['message']); + $list[$pid]['message'] = cutstr(preg_replace("/\[.+?\]/is", '', dhtmlspecialchars($post['message'])), 300) ; + } + } + krsort($list); + } + } + list($seccodecheck, $secqaacheck) = seccheck('post', 'reply'); + include template('forum/ajax_quickreply'); +} elseif($_GET['action'] == 'getpost') { + $tid = intval($_GET['tid']); + $fid = intval($_GET['fid']); + $pid = intval($_GET['pid']); + $thread = C::t('forum_thread')->fetch_thread($tid); + $post = C::t('forum_post')->fetch_post($thread['posttableid'], $pid); + if($_G['uid'] != $post['authorid']) { + showmessage('quickclear_noperm'); + } + include template('forum/ajax_followpost'); +} elseif($_GET['action'] == 'quickclear') { + $uid = intval($_GET['uid']); + if($_G['adminid'] != 1) { + showmessage('quickclear_noperm'); + } + include_once libfile('function/misc'); + include_once libfile('function/member'); + + if(!submitcheck('qclearsubmit')) { + $crimenum_avatar = crime('getcount', $uid, 'crime_avatar'); + $crimenum_sightml = crime('getcount', $uid, 'crime_sightml'); + $crimenum_customstatus = crime('getcount', $uid, 'crime_customstatus'); + $crimeauthor = getuserbyuid($uid); + $crimeauthor = $crimeauthor['username']; + + include template('forum/ajax'); + } else { + if(empty($_GET['operations'])) { + showmessage('quickclear_need_operation'); + } + $reason = checkreasonpm(); + $allowop = array('avatar', 'sightml', 'customstatus'); + $cleartype = array(); + if(in_array('avatar', $_GET['operations'])) { + C::t('common_member')->update($uid, array('avatarstatus'=>0)); + loaducenter(); + uc_user_deleteavatar($uid); + $cleartype[] = lang('forum/misc', 'avatar'); + crime('recordaction', $uid, 'crime_avatar', lang('forum/misc', 'crime_reason', array('reason' => $reason))); + } + if(in_array('sightml', $_GET['operations'])) { + C::t('common_member_field_forum')->update($uid, array('sightml' => ''), 'UNBUFFERED'); + $cleartype[] = lang('forum/misc', 'signature'); + crime('recordaction', $uid, 'crime_sightml', lang('forum/misc', 'crime_reason', array('reason' => $reason))); + } + if(in_array('customstatus', $_GET['operations'])) { + C::t('common_member_field_forum')->update($uid, array('customstatus' => ''), 'UNBUFFERED'); + $cleartype[] = lang('forum/misc', 'custom_title'); + crime('recordaction', $uid, 'crime_customstatus', lang('forum/misc', 'crime_reason', array('reason' => $reason))); + } + if(($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3) || !empty($_GET['sendreasonpm'])) { + sendreasonpm(array('authorid' => $uid), 'reason_quickclear', array( + 'cleartype' => implode(',', $cleartype), + 'reason' => $reason, + 'from_id' => 0, + 'from_idtype' => 'quickclear' + )); + } + showmessage('quickclear_success', $_POST['redirect'], array(), array('showdialog'=>1, 'closetime' => true, 'msgtype' => 2, 'locationtime' => 1)); + } +} elseif($_GET['action'] == 'getpostfeed') { + if(!$_G['setting']['followstatus']) { + showmessage('follow_status_off'); + } + $tid = intval($_GET['tid']); + $pid = intval($_GET['pid']); + $flag = intval($_GET['flag']); + $feed = $thread = array(); + if($tid) { + $thread = C::t('forum_thread')->fetch_thread($tid); + if(empty($_G['setting']['followforumid']) || $thread['fid'] != $_G['setting']['followforumid']) { + $flag = 0; + } + if($flag) { + $post = C::t('forum_post')->fetch_post($thread['posttableid'], $pid); + if($thread['tid'] != $post['tid']) { + showmessage('quickclear_noperm'); + } + require_once libfile('function/discuzcode'); + require_once libfile('function/followcode'); + $post['message'] = followcode($post['message'], $tid, $pid); + } else { + if(!isset($_G['cache']['forums'])) { + loadcache('forums'); + } + $feedid = intval($_GET['feedid']); + $feed = C::t('forum_threadpreview')->fetch($tid); + if($feedid) { + $feed = array_merge($feed, C::t('home_follow_feed')->fetch_by_feedid($feedid)); + } + $post['message'] = $feed['content']; + } + } + include template('forum/ajax_followpost'); + +} elseif($_GET['action'] == 'setnav') { + if($_G['adminid'] != 1) { + showmessage('quickclear_noperm'); + } + $allowfuntype = array('portal', 'forum', 'friend', 'group', 'follow', 'collection', 'guide', 'feed', 'blog', 'doing', 'album', 'share', 'wall', 'homepage', 'ranklist', 'medal', 'task', 'magic', 'favorite'); + $type = in_array($_GET['type'], $allowfuntype) ? trim($_GET['type']) : ''; + $do = in_array($_GET['do'], array('open', 'close')) ? $_GET['do'] : 'close'; + if(!submitcheck('funcsubmit')) { + $navtitle = lang('spacecp', $do == 'open' ? 'select_the_navigation_position' : 'close_module', array('type' => lang('spacecp', $type))); + $closeprompt = lang('spacecp', 'close_module', array('type' => lang('spacecp', $type))); + include template('forum/ajax'); + } else { + if(!empty($type)) { + $funkey = $type.'status'; + $funstatus = $do == 'open' ? 1 : 0; + if($type != 'homepage') { + $identifier = array('portal' => 1, 'forum' => 2, 'group' => 3, 'feed' => 4, 'ranklist' => 8, 'follow' => 9, 'guide' => 10, 'collection' => 11, 'blog' => 12, 'album' => 13, 'share' => 14, 'doing' => 15, 'friend' => 26, 'favorite' => 27, 'medal' => 29, 'task' => 30, 'magic' => 31); + $navdata = array('available' => -1); + $navtype = $do == 'open' ? array() : array(0, 3); + if(in_array($type, array('blog', 'album', 'share', 'doing', 'follow', 'friend', 'favorite', 'medal', 'task', 'magic'))) { + $navtype[] = 2; + } + if($do == 'close' && $type == 'medal') { + if(intval(C::t('forum_medal')->count_by_available()) > 0) { + showmessage('medals_existence', dreferer(), array(), array('showdialog' => true, 'locationtime' => true)); + exit; + } + } + if($do == 'close' && $type == 'forum') { + if($_G['setting']['groupstatus'] || $_G['setting']['guidestatus'] || $_G['setting']['collectionstatus'] || $_G['setting']['followstatus']) { + showmessage('close_ggcf_before_close_forum', dreferer(), array(), array('showdialog' => true, 'locationtime' => true)); + exit; + } + } + if($do == 'open' && in_array($type, array('group', 'guide', 'collection', 'follow'))) { + if(!$_G['setting']['forumstatus']) { + showmessage('open_forum_before_open_ggcf', dreferer(), array(), array('showdialog' => true, 'locationtime' => true)); + exit; + } + } + if($do == 'open') { + if($_GET['location']['header']) { + $navtype[] = 0; + $navdata['available'] = 1; + } + if($_GET['location']['quick']) { + $navtype[] = 3; + $navdata['available'] = 1; + } + $navdata['available'] = $navdata['available'] == 1 ? 1 : 0; + if(empty($_GET['location']['header']) || empty($_GET['location']['quick'])) { + C::t('common_nav')->update_by_navtype_type_identifier(array(0, 2, 3), 0, array("$type", "$identifier[$type]"), array('available' => 0)); + } + } + if($navtype) { + C::t('common_nav')->update_by_navtype_type_identifier($navtype, 0, array("$type", "$identifier[$type]"), $navdata); + if(in_array($type, array('blog', 'album', 'share', 'doing', 'follow')) && !$navdata['available']) { + C::t('common_nav')->update_by_navtype_type_identifier(array(2), 0, array("$type"), array('available' => 1)); + } + } + } + C::t('common_setting')->update_setting($funkey, $funstatus); + + $setting[$funkey] = $funstatus; + if(!function_exists('updatecache')) { + include libfile('function/cache'); + } + updatecache('setting'); + } + showmessage('do_success', dreferer(), array(), array('showdialog' => true, 'locationtime' => true)); + } + exit; +} elseif($_GET['action'] == 'checkpostrule') { + require_once libfile('function/post'); + include template('common/header_ajax'); + $_POST = array('action' => $_GET['ac']); + list($seccodecheck, $secqaacheck) = seccheck('post', $_GET['ac']); + if($seccodecheck || $secqaacheck) { + include template('forum/seccheck_post'); + } + include template('common/footer_ajax'); + exit; +} + +showmessage('succeed', '', array(), array('handle' => false)); + +?> \ No newline at end of file diff --git a/source/module/forum/forum_announcement.php b/source/module/forum/forum_announcement.php new file mode 100644 index 0000000..7c251a7 --- /dev/null +++ b/source/module/forum/forum_announcement.php @@ -0,0 +1,40 @@ +fetch_all_by_date($_G['timestamp']); + +if(!count($announcedata)) { + showmessage('announcement_nonexistence'); +} + +$announcelist = array(); +foreach ($announcedata as $announce) { + $announce['authorenc'] = rawurlencode($announce['author']); + $tmp = explode('.', dgmdate($announce['starttime'], 'Y.m')); + $months[$tmp[0].$tmp[1]] = $tmp; + if(!empty($_GET['m']) && $_GET['m'] != dgmdate($announce['starttime'], 'Ym')) { + continue; + } + $announce['starttime'] = dgmdate($announce['starttime'], 'd'); + $announce['endtime'] = $announce['endtime'] ? dgmdate($announce['endtime'], 'd') : ''; + $announce['message'] = $announce['type'] == 1 ? "[url]{$announce['message']}[/url]" : $announce['message']; + $announce['message'] = nl2br(discuzcode($announce['message'], 0, 0, 1, 1, 1, 1, 1)); + $announcelist[] = $announce; +} +$annid = isset($_GET['id']) ? intval($_GET['id']) : 0; + +include template('forum/announcement'); + +?> \ No newline at end of file diff --git a/source/module/forum/forum_attachment.php b/source/module/forum/forum_attachment.php new file mode 100644 index 0000000..1ff9f92 --- /dev/null +++ b/source/module/forum/forum_attachment.php @@ -0,0 +1,395 @@ + TIMESTAMP + 3600) { + if(!$requestmode) { + showmessage('attachment_nonexistence'); + } else { + exit; + } +} + +if(!empty($_GET['findpost']) && ($attach = C::t('forum_attachment')->fetch($aid))) { + dheader('location: forum.php?mod=redirect&goto=findpost&pid='.$attach['pid'].'&ptid='.$attach['tid']); +} + +if($_GET['uid'] != $_G['uid'] && $_GET['uid']) { + $_G['uid'] = $_GET['uid'] = intval($_GET['uid']); + $member = getuserbyuid($_GET['uid']); + loadcache('usergroup_'.$member['groupid']); + $_G['group'] = $_G['cache']['usergroup_'.$member['groupid']]; + $_G['group']['grouptitle'] = $_G['cache']['usergroup_'.$_G['groupid']]['grouptitle']; + $_G['group']['color'] = $_G['cache']['usergroup_'.$_G['groupid']]['color']; +} + + +$tableid = 'aid:'.$aid; + +if($_G['setting']['attachexpire']) { + + if(TIMESTAMP - $t > $_G['setting']['attachexpire'] * 3600) { + $aid = intval($aid); + if($attach = C::t('forum_attachment_n')->fetch_attachment($tableid, $aid)) { + if($attach['isimage']) { + dheader('location: '.$_G['siteurl'].'static/image/common/none.gif'); + } else { + if(!$requestmode) { + if($sameuser) { + showmessage('attachment_expired', '', array('aid' => aidencode($aid, 0, $attach['tid']), 'pid' => $attach['pid'], 'tid' => $attach['tid'])); + } else { + showmessage('attachment_expired_nosession', '', array('pid' => $attach['pid'], 'tid' => $attach['tid'])); + } + } else { + exit; + } + } + } else { + if(!$requestmode) { + showmessage('attachment_nonexistence'); + } else { + exit; + } + } + } +} + +$readmod = getglobal('config/download/readmod'); +$readmod = $readmod > 0 && $readmod < 5 ? $readmod : 2; + +$refererhost = parse_url($_SERVER['HTTP_REFERER']); +$serverhost = $_SERVER['HTTP_HOST']; +if(($pos = strpos($serverhost, ':')) !== FALSE) { + $serverhost = substr($serverhost, 0, $pos); +} + +if(!$requestmode && $_G['setting']['attachrefcheck'] && $_SERVER['HTTP_REFERER'] && !($refererhost['host'] == $serverhost)) { + showmessage('attachment_referer_invalid', NULL); +} + +periodscheck('attachbanperiods'); + +loadcache('threadtableids'); +$threadtableids = !empty($_G['cache']['threadtableids']) ? $_G['cache']['threadtableids'] : array(); +if(!in_array(0, $threadtableids)) { + $threadtableids = array_merge(array(0), $threadtableids); +} +$archiveid = in_array($_GET['archiveid'], $threadtableids) ? intval($_GET['archiveid']) : 0; + +$attachexists = FALSE; +if(!empty($aid) && is_numeric($aid)) { + $attach = C::t('forum_attachment_n')->fetch_attachment($tableid, $aid); + $thread = C::t('forum_thread')->fetch_by_tid_displayorder($attach['tid'], 0, '>=', null, $archiveid); + if($_G['uid'] && $attach['uid'] != $_G['uid']) { + if($attach) { + $attachpost = C::t('forum_post')->fetch_post($thread['posttableid'], $attach['pid'], false); + $attach['invisible'] = $attachpost['invisible']; + unset($attachpost); + } + if($attach && $attach['invisible'] == 0) { + $thread && $attachexists = TRUE; + } + } else { + $attachexists = TRUE; + } +} + +if(!$attachexists) { + if(!$requestmode) { + showmessage('attachment_nonexistence'); + } else { + exit; + } +} + +if(!$requestmode) { + $forum = C::t('forum_forumfield')->fetch_info_for_attach($thread['fid'], $_G['uid']); + $_GET['fid'] = $forum['fid']; + + if($attach['isimage']) { + $allowgetattach = ($_G['uid'] == $attach['uid']) ? true : ((!empty($forum['allowgetimage'])) ? ($forum['allowgetimage'] == 1 ? true : false) : ($forum['getattachperm'] ? forumperm($forum['getattachperm']) : $_G['group']['allowgetimage'])); + } else { + $allowgetattach = ($_G['uid'] == $attach['uid']) ? true : ((!empty($forum['allowgetattach'])) ? ($forum['allowgetattach'] == 1 ? true : false) : ($forum['getattachperm'] ? forumperm($forum['getattachperm']) : $_G['group']['allowgetattach'])); + } + if(($attach['readperm'] && $attach['readperm'] > $_G['group']['readaccess']) && $_G['adminid'] <= 0 && !($_G['uid'] && $_G['uid'] == $attach['uid'])) { + $allowgetattach = FALSE; + showmessage('attachment_forum_nopermission', NULL, array(), array('login' => 1)); + } + + $ismoderator = in_array($_G['adminid'], array(1, 2)) ? 1 : ($_G['adminid'] == 3 ? C::t('forum_moderator')->fetch_uid_by_tid($attach['tid'], $_G['uid'], $archiveid) : 0); + + $ispaid = FALSE; + $exemptvalue = $ismoderator ? 128 : 16; + if(!$thread['special'] && $thread['price'] > 0 && (!$_G['uid'] || ($_G['uid'] != $attach['uid'] && !($_G['group']['exempt'] & $exemptvalue)))) { + if(!$_G['uid'] || $_G['uid'] && !($ispaid = C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BTC', $attach['tid']))) { + showmessage('attachment_payto', 'forum.php?mod=viewthread&tid='.$attach['tid']); + } + } + + $exemptvalue = $ismoderator ? 64 : 8; + if($attach['price'] && (!$_G['uid'] || ($_G['uid'] != $attach['uid'] && !($_G['group']['exempt'] & $exemptvalue)))) { + $payrequired = $_G['uid'] ? !C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BAC', $attach['aid']) : 1; + $payrequired && showmessage('attachement_payto_attach', 'forum.php?mod=misc&action=attachpay&aid='.$attach['aid'].'&tid='.$attach['tid']); + } + + if(!$ispaid && !$allowgetattach) { + if(($forum['getattachperm'] && !forumperm($forum['getattachperm'])) || ($forum['viewperm'] && !forumperm($forum['viewperm']))) { + showmessagenoperm('getattachperm', $forum['fid']); + } else { + showmessage('getattachperm_none_nopermission', NULL, array(), array('login' => 1)); + } + } +} + +$isimage = $attach['isimage']; +$_G['setting']['ftp']['hideurl'] = $_G['setting']['ftp']['hideurl'] || ($isimage && !empty($_GET['noupdate']) && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp'); + +if(empty($_GET['nothumb']) && $attach['isimage'] && $attach['thumb']) { + $db = DB::object(); + $db->close(); + !$_G['config']['output']['gzip'] && ob_end_clean(); + dheader('Content-Disposition: inline; filename='.getimgthumbname($attach['filename'])); + dheader('Content-Type: image/pjpeg'); + if($attach['remote']) { + $_G['setting']['ftp']['hideurl'] ? getremotefile(getimgthumbname($attach['attachment'])) : dheader('location:'.$_G['setting']['ftp']['attachurl'].'forum/'.getimgthumbname($attach['attachment'])); + } else { + getlocalfile($_G['setting']['attachdir'].'/forum/'.getimgthumbname($attach['attachment'])); + } + exit(); +} + +$filename = $_G['setting']['attachdir'].'/forum/'.$attach['attachment']; +if(!$attach['remote'] && !is_readable($filename)) { + if(!$requestmode) { + showmessage('attachment_nonexistence'); + } else { + exit; + } +} + +if(!$requestmode) { + $exemptvalue = $ismoderator ? 32 : 4; + if(!$isimage && !($_G['group']['exempt'] & $exemptvalue)) { + $creditlog = updatecreditbyaction('getattach', $_G['uid'], array(), '', 1, 0, $thread['fid']); + if($creditlog['updatecredit']) { + if($_G['uid']) { + $k = $_GET['ck']; + $t = $_GET['t']; + if(empty($k) || empty($t) || $k != substr(md5($aid.$t.md5($_G['config']['security']['authkey'])), 0, 8) || TIMESTAMP - $t > 3600) { + dheader('location: forum.php?mod=misc&action=attachcredit&aid='.$attach['aid'].'&formhash='.FORMHASH); + exit(); + } + } else { + showmessage('attachment_forum_nopermission', NULL, array(), array('login' => 1)); + } + } + } +} + +$range_start = 0; +$range_end = 0; +$has_range_header = false; +if(($readmod == 4 || $readmod == 1) && !empty($_SERVER['HTTP_RANGE'])) { + $has_range_header = true; + list($range_start, $range_end) = explode('-',(str_replace('bytes=', '', $_SERVER['HTTP_RANGE']))); +} + +if(!$requestmode && !$has_range_header && empty($_GET['noupdate'])) { + if($_G['setting']['delayviewcount']) { + $_G['forum_logfile'] = './data/cache/forum_attachviews_'.intval(getglobal('config/server/id')).'.log'; + if(substr(TIMESTAMP, -1) == '0') { + attachment_updateviews($_G['forum_logfile']); + } + + if(file_put_contents(DISCUZ_ROOT.$_G['forum_logfile'], "$aid\n", FILE_APPEND) === false) { + if($_G['adminid'] == 1) { + showmessage('view_log_invalid', '', array('logfile' => $_G['forum_logfile'])); + } + C::t('forum_attachment')->update_download($aid); + } + } else { + C::t('forum_attachment')->update_download($aid); + } +} + +$db = DB::object(); +$db->close(); +!$_G['config']['output']['gzip'] && ob_end_clean(); + + +if($attach['remote'] && !$_G['setting']['ftp']['hideurl'] && $isimage) { + dheader('location:'.$_G['setting']['ftp']['attachurl'].'forum/'.$attach['attachment']); +} + +$mimetype = ext_to_mimetype($attach['filename']); +$filesize = !$attach['remote'] ? filesize($filename) : $attach['filesize']; +if ($has_range_header && !$range_end) $range_end = $filesize - 1; +$filenameencode = strtolower(CHARSET) == 'utf-8' ? rawurlencode($attach['filename']) : rawurlencode(diconv($attach['filename'], CHARSET, 'UTF-8')); + +$rfc6266blacklist = strexists($_SERVER['HTTP_USER_AGENT'], 'UCBrowser') || strexists($_SERVER['HTTP_USER_AGENT'], 'Quark') || strexists($_SERVER['HTTP_USER_AGENT'], 'SogouM') || strexists($_SERVER['HTTP_USER_AGENT'], 'baidu'); + +dheader('Date: '.gmdate('D, d M Y H:i:s', $attach['dateline']).' GMT'); +dheader('Last-Modified: '.gmdate('D, d M Y H:i:s', $attach['dateline']).' GMT'); +dheader('Content-Encoding: none'); + +if($isimage && !empty($_GET['noupdate']) || !empty($_GET['request'])) { + $cdtype = 'inline'; +} else { + $cdtype = 'attachment'; +} +dheader('Content-Disposition: '.$cdtype.'; '.'filename="'.$filenameencode.'"'.(($attach['filename'] == $filenameencode || $rfc6266blacklist) ? '' : '; filename*=utf-8\'\''.$filenameencode)); + +if($isimage) { + dheader('Content-Type: image'); +} else { + dheader('Content-Type: ' . $mimetype); +} + +dheader('Content-Length: '.$filesize); + +if(!$attach['remote']) { + $xsendfile = getglobal('config/download/xsendfile'); + if(!empty($xsendfile)) { + $type = intval($xsendfile['type']); + if($isimage){ + $type = 0; + } + $cmd = ''; + switch ($type) { + case 1: $cmd = 'X-Accel-Redirect'; $url = $xsendfile['dir'].$attach['attachment']; break; + case 2: $cmd = $_SERVER['SERVER_SOFTWARE'] <'lighttpd/1.5' ? 'X-LIGHTTPD-send-file' : 'X-Sendfile'; $url = $filename; break; + case 3: $cmd = 'X-Sendfile'; $url = $filename; break; + } + if($cmd) { + dheader("$cmd: $url"); + exit(); + } + } + + if (($readmod == 4) || ($readmod == 1)) { + dheader('Accept-Ranges: bytes'); + if($has_range_header) { + $rangesize = ($range_end - $range_start) >= 0 ? ($range_end - $range_start) + 1 : 0; + dheader('Content-Length: '.$rangesize); + dheader('HTTP/1.1 206 Partial Content'); + dheader('Content-Range: bytes '.$range_start.'-'.$range_end.'/'.($filesize)); + } + } +} + +$attach['remote'] ? getremotefile($attach['attachment']) : getlocalfile($filename, $readmod, $range_start, $range_end); + +function getremotefile($file) { + global $_G; + @set_time_limit(0); + if(!@readfile($_G['setting']['ftp']['attachurl'].'forum/'.$file)) { + $ftp = ftpcmd('object'); + $tmpfile = @tempnam($_G['setting']['attachdir'], ''); + if(is_object($ftp) && $ftp->ftp_get($tmpfile, 'forum/'.$file, FTP_BINARY)) { + @readfile($tmpfile); + @unlink($tmpfile); + } else { + @unlink($tmpfile); + return FALSE; + } + } + return TRUE; +} + +function getlocalfile($filename, $readmod = 2, $range_start = 0, $range_end = 0) { + if($readmod == 1 || $readmod == 3 || $readmod == 4) { + if($fp = @fopen($filename, 'rb')) { + @fseek($fp, $range_start); + if(function_exists('fpassthru') && ($readmod == 3 || $readmod == 4) && ($range_end <= 0)) { + @fpassthru($fp); + } else { + if ($range_end > 0) { + send_file_by_chunk($fp, $range_end - $range_start + 1); + } else { + send_file_by_chunk($fp); + } + } + } + @fclose($fp); + } else { + @readfile($filename); + } + @flush(); @ob_flush(); +} + +function send_file_by_chunk($fp, $limit = PHP_INT_MAX) { + static $CHUNK_SIZE = 65536; + $count = 0; + while (!feof($fp)) { + $size_to_read = $CHUNK_SIZE; + if ($count + $size_to_read > $limit) $size_to_read = $limit - $count; + $buf = fread($fp, $size_to_read); + echo $buf; + flush(); + ob_flush(); + $count += strlen($buf); + if ($count >= $limit) break; + } +} + +function attachment_updateviews($logfile) { + $viewlog = $viewarray = array(); + $newlog = DISCUZ_ROOT.$logfile.random(6); + if(@rename(DISCUZ_ROOT.$logfile, $newlog)) { + $viewlog = file($newlog); + unlink($newlog); + if(is_array($viewlog) && !empty($viewlog)) { + $viewlog = array_count_values($viewlog); + foreach($viewlog as $id => $views) { + if($id > 0) { + $viewarray[$views][] = intval($id); + } + } + foreach($viewarray as $views => $ids) { + C::t('forum_attachment')->update_download($ids, $views); + } + } + } +} + +function ext_to_mimetype($path) { + $ext = pathinfo($path, PATHINFO_EXTENSION); + $map = array( + 'aac' => 'audio/aac', + 'flac' => 'audio/flac', + 'mp3' => 'audio/mpeg', + 'm4a' => 'audio/mp4', + 'wav' => 'audio/wav', + 'ogg' => 'audio/ogg', + 'weba' => 'audio/webm', + 'flv' => 'video/x-flv', + 'mp4' => 'video/mp4', + 'm4v' => 'video/mp4', + '3gp' => 'video/3gpp', + 'ogv' => 'video/ogg', + 'webm' => 'video/webm' + ); + $mime = $map[$ext]; + if (!$mime) $mime = "application/octet-stream"; + return $mime; +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_collection.php b/source/module/forum/forum_collection.php new file mode 100644 index 0000000..37bb846 --- /dev/null +++ b/source/module/forum/forum_collection.php @@ -0,0 +1,44 @@ +fetch($ctid); +} + +$allowaction = array('index', 'view', 'edit', 'follow', 'comment', 'mycollection', 'all'); + +if(!in_array($action, $allowaction)) { + $action = 'index'; +} + +require_once libfile('collection/'.$action, 'include'); + + +?> \ No newline at end of file diff --git a/source/module/forum/forum_forumdisplay.php b/source/module/forum/forum_forumdisplay.php new file mode 100644 index 0000000..a9d5e32 --- /dev/null +++ b/source/module/forum/forum_forumdisplay.php @@ -0,0 +1,1003 @@ +fetch_all_by_fid($_G['fid']) as $archive) { + $forumarchive[$archive['threadtableid']] = array( + 'displayname' => dhtmlspecialchars($threadtable_info[$archive['threadtableid']]['displayname']), + 'threads' => $archive['threads'], + 'posts' => $archive['posts'], + ); + if(empty($forumarchive[$archive['threadtableid']]['displayname'])) { + $forumarchive[$archive['threadtableid']]['displayname'] = lang('forum/thread', 'forum_archive').' '.$archive['threadtableid']; + } + } +} + +$forum_up = $_G['cache']['forums'][$_G['forum']['fup']]; +if($_G['forum']['type'] == 'forum') { + $fgroupid = $_G['forum']['fup']; + if(empty($_GET['archiveid'])) { + $navigation = ' '.$forum_up['name'].' '.$_G['forum']['name'].''; + } else { + $navigation = ' '.''.$_G['forum']['name'].' '.$forumarchive[$_GET['archiveid']]['displayname']; + } + $seodata = array('forum' => $_G['forum']['name'], 'fgroup' => $forum_up['name'], 'page' => intval(getgpc('page'))); +} else { + $fgroupid = $forum_up['fup']; + if(empty($_GET['archiveid'])) { + $forum_top = $_G['cache']['forums'][$forum_up['fup']]; + $navigation = ' '.$forum_top['name'].' '.$forum_up['name'].' '.$_G['forum']['name']; + } else { + $navigation = ' '.$forum_up['name'].' '.''.$_G['forum']['name'].' '.$forumarchive[$_GET['archiveid']]['displayname']; + } + $seodata = array('forum' => $_G['forum']['name'], 'fup' => $forum_up['name'], 'fgroup' => $forum_top['name'], 'page' => intval(getgpc('page'))); +} + +$rssauth = $_G['rssauth']; + +$forumseoset = array( + 'seotitle' => $_G['forum']['seotitle'], + 'seokeywords' => $_G['forum']['keywords'], + 'seodescription' => $_G['forum']['seodescription'] +); + +$seotype = 'threadlist'; +if($_G['forum']['status'] == 3) { + $navtitle = helper_seo::get_title_page($_G['forum']['name'], $_G['page']).' - '.$_G['setting']['navs'][3]['navname']; + $metakeywords = $_G['forum']['metakeywords']; + $metadescription = $_G['forum']['description']; + if($_G['forum']['level'] == -1) { + showmessage('group_verify', '', array(), array('alert' => 'info')); + } + $_G['seokeywords'] = $_G['setting']['seokeywords']['group']; + $_G['seodescription'] = $_G['setting']['seodescription']['group']; + $action = getgpc('action') ? $_GET['action'] : 'list'; + require_once libfile('function/group'); + $status = groupperm($_G['forum'], $_G['uid']); + if($status == -1) { + showmessage('forum_not_group', 'group.php'); + } elseif($status == 1) { + showmessage('forum_group_status_off'); + } elseif($status == 2) { + showmessage('forum_group_noallowed', 'forum.php?mod=group&fid='.$_G['fid']); + } elseif($status == 3) { + showmessage('forum_group_moderated', 'forum.php?mod=group&fid='.$_G['fid']); + } + $_G['forum']['icon'] = get_groupimg($_G['forum']['icon'], 'icon'); + $_G['grouptypeid'] = $_G['forum']['fup']; + $_G['forum']['dateline'] = dgmdate($_G['forum']['dateline'], 'd'); + + $nav = get_groupnav($_G['forum']); + $groupnav = $nav['nav']; + $onlinemember = grouponline($_G['fid']); + $groupmanagers = $_G['forum']['moderators']; + $groupcache = getgroupcache($_G['fid'], array('replies', 'views', 'digest', 'lastpost', 'ranking', 'activityuser', 'newuserlist')); + $seotype = 'grouppage'; + $seodata['first'] = $nav['first']['name']; + $seodata['second'] = $nav['second']['name']; + $seodata['gdes'] = $_G['forum']['description']; + $forumseoset = array(); +} +$_G['forum']['banner'] = get_forumimg($_G['forum']['banner']); + +list($navtitle, $metadescription, $metakeywords) = get_seosetting($seotype, $seodata, $forumseoset); + +if(!$navtitle) { + $navtitle = helper_seo::get_title_page($_G['forum']['name'], $_G['page']); + $nobbname = false; +} else { + $nobbname = true; +} +$_GET['typeid'] = intval(getgpc('typeid')); +if(!empty($_GET['typeid']) && !empty($_G['forum']['threadtypes']['types'][$_GET['typeid']])) { + $navtitle = strip_tags($_G['forum']['threadtypes']['types'][$_GET['typeid']]).' - '.$navtitle; +} + +$rsshead = $_G['setting']['rssstatus'] ? ('\n") : ''; + +if(!$metakeywords) { + $metakeywords = $_G['forum']['name']; +} +if(!$metadescription) { + $metadescription = $_G['forum']['name']; +} +if($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm']) && !$_G['forum']['allowview']) { + showmessagenoperm('viewperm', $_G['fid'], $_G['forum']['formulaperm']); +} elseif($_G['forum']['formulaperm']) { + formulaperm($_G['forum']['formulaperm']); +} + +if($_G['forum']['password']) { + if($_GET['action'] == 'pwverify') { + if($_GET['pw'] != $_G['forum']['password']) { + showmessage('forum_passwd_incorrect', NULL); + } else { + dsetcookie('fidpw'.$_G['fid'], $_GET['pw']); + showmessage('forum_passwd_correct', "forum.php?mod=forumdisplay&fid={$_G['fid']}"); + } + } elseif($_G['forum']['password'] != $_G['cookie']['fidpw'.$_G['fid']]) { + include template('forum/forumdisplay_passwd'); + exit(); + } +} + +if($_G['forum']['price'] && !$_G['forum']['ismoderator']) { + $membercredits = C::t('common_member_forum_buylog')->get_credits($_G['uid'], $_G['fid']); + $paycredits = $_G['forum']['price'] - $membercredits; + if($paycredits > 0) { + if($_GET['action'] == 'paysubmit') { + updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][1] => -$paycredits), 1, 'FCP', $_G['fid']); + C::t('common_member_forum_buylog')->update_credits($_G['uid'], $_G['fid'], $_G['forum']['price']); + showmessage('forum_pay_correct', "forum.php?mod=forumdisplay&fid={$_G['fid']}"); + } else { + if(getuserprofile('extcredits'.$_G['setting']['creditstransextra'][1]) < $paycredits) { + showmessage('forum_pay_incorrect', NULL, array('paycredits' => $paycredits, 'credits' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit'].$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'])); + } else { + include template('forum/forumdisplay_pay'); + exit(); + } + } + } +} + +if(!isset($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], 'forum_rules_'.$_G['fid']) === FALSE) { + $collapse['forum_rules'] = ''; + $collapse['forum_rulesimg'] = 'no'; +} else { + $collapse['forum_rules'] = 'display: none'; + $collapse['forum_rulesimg'] = 'yes'; +} + +$forumlastvisit = 0; +if(empty($_G['forum']['picstyle']) && isset($_G['cookie']['forum_lastvisit']) && strexists($_G['cookie']['forum_lastvisit'], 'D_'.$_G['fid'])) { + preg_match('/D\_'.$_G['fid'].'\_(\d+)/', $_G['cookie']['forum_lastvisit'], $a); + $forumlastvisit = $a[1]; + unset($a); +} +dsetcookie('forum_lastvisit', preg_replace("/D\_".$_G['fid']."\_\d+/", '', getcookie('forum_lastvisit')).'D_'.$_G['fid'].'_'.TIMESTAMP, 604800); + +$threadtableids = !empty($_G['cache']['threadtableids']) ? $_G['cache']['threadtableids'] : array(); + +$tableid = $_GET['archiveid'] && in_array($_GET['archiveid'], $threadtableids) ? intval($_GET['archiveid']) : 0; + +if($_G['setting']['allowmoderatingthread'] && $_G['uid']) { + $threadmodcount = C::t('forum_thread')->count_by_fid_displayorder_authorid($_G['fid'], -2, $_G['uid'], $tableid); +} + +$optionadd = $filterurladd = $searchsorton = ''; + +$quicksearchlist = array(); +if(!empty($_G['forum']['threadsorts']['types'])) { + require_once libfile('function/threadsort'); + + $showpic = intval($_GET['showpic']); + $templatearray = $sortoptionarray = array(); + foreach($_G['forum']['threadsorts']['types'] as $stid => $sortname) { + loadcache(array('threadsort_option_'.$stid, 'threadsort_template_'.$stid)); + sortthreadsortselectoption($stid); + $templatearray[$stid] = $_G['cache']['threadsort_template_'.$stid]['subject']; + $sortoptionarray[$stid] = $_G['cache']['threadsort_option_'.$stid]; + } + + if(!empty($_G['forum']['threadsorts']['defaultshow']) && empty($_GET['sortid']) && empty($_GET['sortall'])) { + $_GET['sortid'] = $_G['forum']['threadsorts']['defaultshow']; + $_GET['filter'] = 'sortid'; + $_SERVER['QUERY_STRING'] = $_SERVER['QUERY_STRING'] ? $_SERVER['QUERY_STRING'].'&sortid='.$_GET['sortid'] : 'sortid='.$_GET['sortid']; + $filterurladd = '&filter=sort'; + } + + $_GET['sortid'] = $_GET['sortid'] ? $_GET['sortid'] : $_GET['searchsortid']; + if(isset($_GET['sortid']) && $_G['forum']['threadsorts']['types'][$_GET['sortid']]) { + $searchsortoption = $sortoptionarray[$_GET['sortid']]; + $quicksearchlist = quicksearch($searchsortoption); + $_G['forum_optionlist'] = $_G['cache']['threadsort_option_'.$_GET['sortid']]; + $forum_optionlist = getsortedoptionlist(); + } +} +$_GET['sortid'] = intval(getgpc('sortid')); +$moderatedby = $_G['forum']['status'] != 3 ? moddisplay($_G['forum']['moderators'], 'forumdisplay') : ''; +$_GET['highlight'] = empty($_GET['highlight']) ? '' : dhtmlspecialchars($_GET['highlight']); +if($_G['forum']['autoclose']) { + $closedby = $_G['forum']['autoclose'] > 0 ? 'dateline' : 'lastpost'; + $_G['forum']['autoclose'] = abs($_G['forum']['autoclose']) * 86400; +} + +$subexists = 0; +foreach($_G['cache']['forums'] as $sub) { + if($sub['type'] == 'sub' && $sub['fup'] == $_G['fid'] && (!$_G['setting']['hideprivate'] || !$sub['viewperm'] || forumperm($sub['viewperm']) || strstr($sub['users'], "\t{$_G['uid']}\t"))) { + if(!$sub['status']) { + continue; + } + $subexists = 1; + $sublist = array(); + $query = C::t('forum_forum')->fetch_all_info_by_fids(0, 'available', 0, $_G['fid'], 1, 0, 0, 'sub'); + + if(!empty($_G['member']['accessmasks'])) { + $fids = array_keys($query); + $accesslist = C::t('forum_access')->fetch_all_by_fid_uid($fids, $_G['uid']); + foreach($query as $key => $val) { + $query[$key]['allowview'] = $accesslist[$key]; + } + } + foreach($query as $sub) { + $sub['extra'] = dunserialize($sub['extra']); + if(!is_array($sub['extra'])) { + $sub['extra'] = array(); + } + if(forum($sub)) { + $sub['orderid'] = count($sublist); + $sublist[] = $sub; + } + } + break; + } +} + +if(!empty($_GET['archiveid']) && in_array($_GET['archiveid'], $threadtableids)) { + $subexists = 0; +} + +if($subexists) { + if($_G['forum']['forumcolumns']) { + $_G['forum']['forumcolwidth'] = (floor(100 / $_G['forum']['forumcolumns']) - 0.1).'%'; + $_G['forum']['subscount'] = count($sublist); + $_G['forum']['endrows'] = ''; + if($colspan = $_G['forum']['subscount'] % $_G['forum']['forumcolumns']) { + while(($_G['forum']['forumcolumns'] - $colspan) > 0) { + $_G['forum']['endrows'] .= ' '; + $colspan ++; + } + $_G['forum']['endrows'] .= ''; + } + } + if(empty($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], 'subforum_'.$_G['fid']) === FALSE) { + $collapse['subforum'] = ''; + $collapseimg['subforum'] = 'collapsed_no.gif'; + $collapseicon['subforum'] = '_no'; + } else { + $collapse['subforum'] = 'display: none'; + $collapseimg['subforum'] = 'collapsed_yes.gif'; + $collapseicon['subforum'] = '_yes'; + } +} + + +$page = $_G['page']; +$subforumonly = $_G['forum']['simple'] & 1; +$simplestyle = !$_G['forum']['allowside'] || $page > 1 ? true : false; + +if($subforumonly) { + $_G['setting']['fastpost'] = false; + $_GET['orderby'] = ''; + if(!defined('IN_ARCHIVER')) { + include template('diy:forum/forumdisplay:'.$_G['fid']); + } else { + include loadarchiver('forum/forumdisplay'); + } + exit(); +} +if(getgpc('filter') != 'hot') { + $page = $_G['setting']['threadmaxpages'] && $page > $_G['setting']['threadmaxpages'] ? 1 : $page; +} + +if($_G['forum']['modrecommend'] && $_G['forum']['modrecommend']['open']) { + $_G['forum']['recommendlist'] = recommendupdate($_G['fid'], $_G['forum']['modrecommend'], '', 1); +} +$recommendgroups = array(); +if($_G['forum']['status'] != 3 && helper_access::check_module('group')) { + loadcache('forumrecommend'); + $recommendgroups = $_G['cache']['forumrecommend'][$_G['fid']]; +} + +if($recommendgroups) { + if(empty($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], 'recommendgroups_'.$_G['fid']) === FALSE) { + $collapse['recommendgroups'] = ''; + $collapseimg['recommendgroups'] = 'collapsed_no.gif'; + $collapseicon['recommendgroups'] = '_no'; + } else { + $collapse['recommendgroups'] = 'display: none'; + $collapseimg['recommendgroups'] = 'collapsed_yes.gif'; + $collapseicon['recommendgroups'] = '_yes'; + } +} +if(!$simplestyle || !$_G['forum']['allowside'] && $page == 1) { + if($_G['cache']['announcements_forum'] && (!$_G['cache']['announcements_forum']['endtime'] || $_G['cache']['announcements_forum']['endtime'] > TIMESTAMP)) { + $announcement = $_G['cache']['announcements_forum']; + $announcement['starttime'] = dgmdate($announcement['starttime'], 'd'); + } else { + $announcement = NULL; + } +} + +$filteradd = $sortoptionurl = $sp = ''; +$sorturladdarray = $selectadd = array(); +$forumdisplayadd = array('orderby' => ''); +$specialtype = array('poll' => 1, 'trade' => 2, 'reward' => 3, 'activity' => 4, 'debate' => 5); +$filterfield = array('digest', 'recommend', 'sortall', 'typeid', 'sortid', 'dateline', 'page', 'orderby', 'specialtype', 'author', 'view', 'reply', 'lastpost', 'heat', 'hot'); + +foreach($filterfield as $v) { + $forumdisplayadd[$v] = ''; +} + +$filter = isset($_GET['filter']) && in_array($_GET['filter'], $filterfield) ? $_GET['filter'] : ''; +$filterbool = !empty($filter); +$filterarr = $multiadd = array(); +$threadclasscount = array(); + +if($filter && $filter != 'hot') { + if($query_string = $_SERVER['QUERY_STRING']) { + $query_string = substr($query_string, (strpos($query_string, "&") + 1)); + parse_str($query_string, $geturl); + $geturl = daddslashes($geturl, 1); + if($geturl && is_array($geturl)) { + $issort = isset($_GET['sortid']) && isset($_G['forum']['threadsorts']['types'][$_GET['sortid']]) && $quicksearchlist ? TRUE : FALSE; + $selectadd = $issort ? $geturl : array(); + foreach($filterfield as $option) { + foreach($geturl as $field => $value) { + if(in_array($field, $filterfield) && $option != $field && $field != 'page' && $option != 'page' && ($field != 'orderby' || !in_array($option, array('author', 'reply', 'view', 'lastpost', 'heat')))) { + if(!(in_array($option, array('digest', 'recommend')) && in_array($field, array('digest', 'recommend')))) { + $forumdisplayadd[$option] .= '&'.rawurlencode($field).'='.rawurlencode($value); + } + } + } + } + if($issort) { + $sfilterfield = array_merge(array('filter', 'sortid', 'orderby', 'fid'), $filterfield); + foreach($geturl as $soption => $value) { + $forumdisplayadd[$soption] .= !in_array($soption, $sfilterfield) ? '&'.rawurlencode($soption).'='.rawurlencode($value) : ''; + } + unset($sfilterfield); + } + if($issort && is_array($quicksearchlist)) { + foreach($quicksearchlist as $option) { + $identifier = $option['identifier']; + foreach($geturl as $option => $value) { + $sorturladdarray[$identifier] .= !in_array($option, array('filter', 'sortid', 'orderby', 'fid', 'searchsort', $identifier)) ? '&'.rawurlencode($option).'='.rawurlencode($value) : ''; + } + } + } + + foreach($geturl as $field => $value) { + if($field != 'page' && $field != 'fid' && $field != 'searchoption' && $field != 't') { + $multiadd[] = rawurlencode($field).'='.rawurlencode($value); + if(in_array($field, $filterfield)) { + if($field == 'digest') { + $filterarr['digest'] = 1; + } elseif($field == 'recommend') { + $filterarr['recommends'] = intval($_G['setting']['recommendthread']['iconlevels'][0]); + } elseif($field == 'specialtype') { + $filterarr['special'] = $specialtype[$value]; + $filterarr['specialthread'] = 1; + if($value == 'reward') { + if($_GET['rewardtype'] == 1) { + $filterarr['pricemore'] = 0; + } elseif($_GET['rewardtype'] == 2) { + $filterarr['pricesless'] = 0; + } + } + } elseif($field == 'dateline') { + if($value) { + $filterarr['lastpostmore'] = TIMESTAMP - $value; + } + } elseif($field == 'typeid' || $field == 'sortid') { + $fieldstr = $field == 'typeid' ? 'intype' : 'insort'; + $filterarr[$fieldstr] = dintval($value); + } + $sp = ' '; + } + } + } + if(count($filterarr) == 1) { + foreach($filterarr as $key => $value) { + if($key == 'intype') { + $threadclasscount = array('id' => $value, 'idtype' => 'typeid'); + } elseif($key == 'insort') { + $threadclasscount = array('id' => $value, 'idtype' => 'sortid'); + } + } + } + } + } + $simplestyle = true; +} + +if(!empty($_GET['orderby']) && empty($_G['setting']['closeforumorderby']) && in_array($_GET['orderby'], array('lastpost', 'dateline', 'replies', 'views', 'recommends', 'heats'))) { + $forumdisplayadd['orderby'] .= '&orderby='.$_GET['orderby']; +} else { + $_GET['orderby'] = isset($_G['cache']['forums'][$_G['fid']]['orderby']) ? $_G['cache']['forums'][$_G['fid']]['orderby'] : 'lastpost'; +} + +$_GET['ascdesc'] = isset($_G['cache']['forums'][$_G['fid']]['ascdesc']) ? $_G['cache']['forums'][$_G['fid']]['ascdesc'] : 'DESC'; + +$check = array(); +$check[$filter] = $check[$_GET['orderby']] = $check[$_GET['ascdesc']] = 'selected="selected"'; + +if(($_G['forum']['status'] != 3 && $_G['forum']['allowside'])) { + updatesession(); + $onlinenum = C::app()->session->count_by_fid($_G['fid']); + if(!IS_ROBOT && ($_G['setting']['whosonlinestatus'] == 2 || $_G['setting']['whosonlinestatus'] == 3)) { + $_G['setting']['whosonlinestatus'] = 1; + $detailstatus = $showoldetails == 'yes' || (((!isset($_G['cookie']['onlineforum']) && !$_G['setting']['whosonline_contract']) || $_G['cookie']['onlineforum']) && !$showoldetails); + + if($detailstatus) { + $actioncode = lang('forum/action'); + $whosonline = array(); + $forumname = strip_tags($_G['forum']['name']); + + $whosonline = C::app()->session->fetch_all_by_fid($_G['fid'], 12); + $_G['setting']['whosonlinestatus'] = 1; + } + } else { + $_G['setting']['whosonlinestatus'] = 0; + } +} + +if(!empty($_G['forum']['threadsorts']['types']) && $sortoptionarray && ($_GET['searchoption'] || $_GET['searchsort'])) { + $sortid = intval($_GET['sortid']); + + if($_GET['searchoption']){ + $forumdisplayadd['page'] = '&sortid='.$sortid; + foreach($_GET['searchoption'] as $optionid => $option) { + $optionid = intval($optionid); + $searchoption = ''; + if(is_array($option['value'])) { + foreach($option['value'] as $v) { + $v = rawurlencode((string)$v); + $searchoption .= "&searchoption[$optionid][value][$v]=$v"; + } + } else { + $option['value'] = rawurlencode((string)$option['value']); + $option['value'] && $searchoption = "&searchoption[$optionid][value]=$option[value]"; + } + $option['type'] = rawurlencode((string)$option['type']); + $identifier = $sortoptionarray[$sortid][$optionid]['identifier']; + $forumdisplayadd['page'] .= $searchoption ? "$searchoption&searchoption[$optionid][type]=$option[type]" : ''; + } + } + + $searchsorttids = sortsearch($_GET['sortid'], $sortoptionarray, $_GET['searchoption'], $selectadd, $_G['fid']); + $filterarr['intids'] = $searchsorttids ? $searchsorttids : array(0); +} + +if(isset($_GET['searchoption'])) { + $_GET['searchoption'] = dhtmlspecialchars($_GET['searchoption']); +} + +if($_G['forum']['relatedgroup']) { + $relatedgroup = explode(',', $_G['forum']['relatedgroup']); + $relatedgroup[] = $_G['fid']; + $filterarr['inforum'] = $relatedgroup; +} else { + $filterarr['inforum'] = $_G['fid']; +} +if(empty($filter) && empty($_GET['sortid']) && empty($_G['forum']['relatedgroup'])) { + if($forumarchive) { + if($_GET['archiveid']) { + $_G['forum_threadcount'] = $forumarchive[$_GET['archiveid']]['threads']; + } else { + $primarytabthreads = $_G['forum']['threads']; + foreach($forumarchive as $arcid => $avalue) { + if($arcid) { + $primarytabthreads = $primarytabthreads - $avalue['threads']; + } + } + $_G['forum_threadcount'] = $primarytabthreads; + } + } else { + $_G['forum_threadcount'] = $_G['forum']['threads']; + } +} else { + $filterarr['sticky'] = 0; + $_G['forum_threadcount'] = C::t('forum_thread')->count_search($filterarr, $tableid); + if($threadclasscount) { + threadclasscount($_G['fid'], $threadclasscount['id'], $threadclasscount['idtype'], $_G['forum_threadcount']); + } +} + +$thisgid = $_G['forum']['type'] == 'forum' ? $_G['forum']['fup'] : (!empty($_G['cache']['forums'][$_G['forum']['fup']]['fup']) ? $_G['cache']['forums'][$_G['forum']['fup']]['fup'] : 0); +$forumstickycount = $stickycount = 0; +$stickytids = array(); +$showsticky = !defined('MOBILE_HIDE_STICKY') || !MOBILE_HIDE_STICKY; +if($showsticky) { + $forumstickytids = array(); + if($_G['page'] !== 1 || $filterbool === false) { + if($_G['setting']['globalstick'] && $_G['forum']['allowglobalstick']) { + if(!empty($_G['cache']['globalstick']['global']['tids'])) { + $stickytids = explode(',', str_replace("'", '', $_G['cache']['globalstick']['global']['tids'])); + } + if(!empty($_G['cache']['globalstick']['categories'][$thisgid]['count'])) { + $stickytids = array_merge($stickytids, explode(',', str_replace("'", '', $_G['cache']['globalstick']['categories'][$thisgid]['tids']))); + } + + if($_G['forum']['status'] != 3) { + $stickycount = $_G['cache']['globalstick']['global']['count']; + if(!empty($_G['cache']['globalstick']['categories'][$thisgid])) { + $stickycount += $_G['cache']['globalstick']['categories'][$thisgid]['count']; + } + } + } + + if($_G['forum']['allowglobalstick']) { + $forumstickycount = 0; + $forumstickfid = $_G['forum']['status'] != 3 ? $_G['fid'] : $_G['forum']['fup']; + if(isset($_G['cache']['forumstick'][$forumstickfid])) { + $forumstickycount = count($_G['cache']['forumstick'][$forumstickfid]); + $forumstickytids = $_G['cache']['forumstick'][$forumstickfid]; + } + if(!empty($forumstickytids)) { + $stickytids = array_merge($stickytids, $forumstickytids); + } + $stickycount += $forumstickycount; + } + } +} + +if($_G['forum']['picstyle']) { + $forumdefstyle = isset($_GET['forumdefstyle']) ? $_GET['forumdefstyle'] : ''; + if($forumdefstyle) { + switch($forumdefstyle) { + case 'no': dsetcookie('forumdefstyle', ''); break; + case 'yes': dsetcookie('forumdefstyle', 1, 31536000); break; + } + } + if(empty($_G['cookie']['forumdefstyle'])) { + if(!empty($_G['setting']['forumpicstyle']['thumbnum'])) { + $_G['tpp'] = $_G['setting']['forumpicstyle']['thumbnum']; + } + $stickycount = $showsticky = 0; + } +} + +if(!empty($_G['cookie']['forumdefstyle'])) { + $_G['cookie']['forumdefstyle'] = 1; +} + +if($filter != 'hot' && @ceil($_G['forum_threadcount']/$_G['tpp']) < $page) { + $page = 1; +} +$start_limit = ($page - 1) * $_G['tpp']; + +$forumdisplayadd['page'] = !empty($forumdisplayadd['page']) ? $forumdisplayadd['page'] : ''; +$multipage_archive = $_GET['archiveid'] && in_array($_GET['archiveid'], $threadtableids) ? "&archiveid={$_GET['archiveid']}" : ''; +$multipage = multi($_G['forum_threadcount'], $_G['tpp'], $page, "forum.php?mod=forumdisplay&fid={$_G['fid']}".$forumdisplayadd['page'].($multiadd ? '&'.implode('&', $multiadd) : '')."$multipage_archive", $_G['setting']['threadmaxpages']); + +$realpages = @ceil($_G['forum_threadcount']/$_G['tpp']); +$maxpage = ($_G['setting']['threadmaxpages'] && $_G['setting']['threadmaxpages'] < $realpages) ? $_G['setting']['threadmaxpages'] : $realpages; +$nextpage = ($page + 1) > $maxpage ? 1 : ($page + 1); +$multipage_more = "forum.php?mod=forumdisplay&fid={$_G['fid']}".$forumdisplayadd['page'].($multiadd ? '&'.implode('&', $multiadd) : '')."$multipage_archive".'&page='.$nextpage; + +$extra = rawurlencode(!IS_ROBOT ? 'page='.$page.($forumdisplayadd['page'] ? '&filter='.$filter.$forumdisplayadd['page'] : '') : 'page=1'); + +$separatepos = 0; +$_G['forum_threadlist'] = $threadids = array(); +$_G['forum_colorarray'] = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282'); + +$filterarr['sticky'] = 4; +$filterarr['displayorder'] = !$filterbool && $stickycount ? array(0, 1) : array(0, 1, 2, 3, 4); +if($filter !== 'hot') { + $threadlist = array(); + $indexadd = ''; + $_order = "displayorder DESC, {$_GET['orderby']} {$_GET['ascdesc']}"; + if($filterbool) { + if(!empty($filterarr['digest'])) { + $indexadd = " FORCE INDEX (digest) "; + } + } elseif($showsticky && is_array($stickytids) && !empty($stickytids[0])) { + $filterarr1 = $filterarr; + $filterarr1['inforum'] = ''; + $filterarr1['intids'] = $stickytids; + $filterarr1['displayorder'] = array(2, 3, 4); + $threadlist = C::t('forum_thread')->fetch_all_search($filterarr1, $tableid, $start_limit, $_G['tpp'], $_order, ''); + unset($filterarr1); + } + $threadlist = array_merge($threadlist, C::t('forum_thread')->fetch_all_search($filterarr, $tableid, $start_limit, $_G['tpp'], $_order, '', $indexadd)); + unset($_order); + + if(empty($threadlist) && $page <= ceil($_G['forum_threadcount'] / $_G['tpp'])) { + require_once libfile('function/post'); + updateforumcount($_G['fid']); + } +} else { + $hottime = dintval(str_replace('-', '', getgpc('time'))); + $multipage = ''; + if($hottime && checkdate(substr($hottime, 4, 2), substr($hottime, 6, 2), substr($hottime, 0, 4))) { + $calendartime = abs($hottime); + $ctime = sprintf('%04d', substr($hottime, 0, 4)).'-'.sprintf('%02d', substr($hottime, 4, 2)).'-'.sprintf('%02d', substr($hottime, 6, 2)); + } else { + $calendartime = dgmdate(strtotime(dgmdate(TIMESTAMP, 'Y-m-d')) - 86400, 'Ymd'); + $ctime = dgmdate(strtotime(dgmdate(TIMESTAMP, 'Y-m-d')) - 86400, 'Y-m-d'); + } + $caldata = C::t('forum_threadcalendar')->fetch_by_fid_dateline($_G['fid'], $calendartime); + $_G['forum_threadcount'] = 0; + if($caldata) { + $hottids = C::t('forum_threadhot')->fetch_all_tid_by_cid($caldata['cid']); + $threadlist = C::t('forum_thread')->fetch_all_by_tid($hottids); + $_G['forum_threadcount'] = count($threadlist); + } + +} + +$_G['ppp'] = $_G['forum']['threadcaches'] && !$_G['uid'] ? $_G['setting']['postperpage'] : $_G['ppp']; +$page = $_G['page']; +$todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd')); + +$verify = $verifyuids = $authorids = $grouptids = $rushtids = array(); + +$thide = !empty($_G['cookie']['thide']) ? explode('|', $_G['cookie']['thide']) : array(); +$_G['showrows'] = $_G['hiddenexists'] = 0; + +$threadindex = 0; +if(empty($threadlist)) $threadlist = array(); +foreach($threadlist as $thread) { + $thread['allreplies'] = $thread['replies'] + $thread['comments']; + $thread['ordertype'] = getstatus($thread['status'], 4); + if($_G['forum']['picstyle'] && empty($_G['cookie']['forumdefstyle'])) { + if($thread['fid'] != $_G['fid'] && empty($thread['cover'])) { + continue; + } + $thread['coverpath'] = getthreadcover($thread['tid'], $thread['cover']); + $thread['cover'] = abs($thread['cover']); + } + $thread['forumstick'] = in_array($thread['tid'], $forumstickytids); + $thread['related_group'] = 0; + if($_G['forum']['relatedgroup'] && $thread['fid'] != $_G['fid']) { + if($thread['closed'] > 1) continue; + $thread['related_group'] = 1; + $grouptids[] = $thread['tid']; + } + $thread['lastposterenc'] = rawurlencode($thread['lastposter']); + if($thread['typeid'] && !empty($_G['forum']['threadtypes']['prefix']) && isset($_G['forum']['threadtypes']['types'][$thread['typeid']])) { + if($_G['forum']['threadtypes']['prefix'] == 1) { + $thread['typehtml'] = '['.$_G['forum']['threadtypes']['types'][$thread['typeid']].']'; + } elseif($_G['forum']['threadtypes']['icons'][$thread['typeid']] && $_G['forum']['threadtypes']['prefix'] == 2) { + $thread['typehtml'] = ''.''.strip_tags($_G['forum']['threadtypes']['types'][$thread['typeid']]).''; + } + $thread['typename'] = $_G['forum']['threadtypes']['types'][$thread['typeid']]; + } else { + $thread['typename'] = $thread['typehtml'] = ''; + } + + $thread['sorthtml'] = $thread['sortid'] && !empty($_G['forum']['threadsorts']['prefix']) && isset($_G['forum']['threadsorts']['types'][$thread['sortid']]) ? + '['.$_G['forum']['threadsorts']['types'][$thread['sortid']].']' : ''; + $thread['multipage'] = ''; + $topicposts = $thread['special'] ? $thread['replies'] : $thread['replies'] + 1; + $multipate_archive = $_GET['archiveid'] && in_array($_GET['archiveid'], $threadtableids) ? "archiveid={$_GET['archiveid']}" : ''; + if($topicposts > $_G['ppp']) { + $pagelinks = ''; + $thread['pages'] = ceil($topicposts / $_G['ppp']); + $realtid = $_G['forum']['status'] != 3 && $thread['isgroup'] == 1 ? $thread['closed'] : $thread['tid']; + for($i = 2; $i <= 6 && $i <= $thread['pages']; $i++) { + $pagelinks .= "$i"; + } + if($thread['pages'] > 6) { + $pagelinks .= "..$thread[pages]"; + } + $thread['multipage'] = ' ...'.$pagelinks; + } + + if($thread['highlight']) { + $string = sprintf('%02d', $thread['highlight']); + $stylestr = sprintf('%03b', $string[0]); + + $thread['highlight'] = ' style="'; + $thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : ''; + $thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : ''; + $thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : ''; + $thread['highlight'] .= $string[1] ? 'color: '.$_G['forum_colorarray'][$string[1]].';' : ''; + if($thread['bgcolor']) { + $thread['highlight'] .= "background-color: {$thread['bgcolor']};"; + } + $thread['highlight'] .= '"'; + } else { + $thread['highlight'] = ''; + } + + $thread['recommendicon'] = ''; + if(!empty($_G['setting']['recommendthread']['status']) && $thread['recommends']) { + foreach($_G['setting']['recommendthread']['iconlevels'] as $k => $i) { + if($thread['recommends'] > $i) { + $thread['recommendicon'] = $k+1; + break; + } + } + } + + $thread['moved'] = $thread['heatlevel'] = $thread['new'] = 0; + if($_G['forum']['status'] != 3 && ($thread['closed'] || ($_G['forum']['autoclose'] && $thread['fid'] == $_G['fid'] && TIMESTAMP - $thread[$closedby] > $_G['forum']['autoclose']))) { + if($thread['isgroup'] == 1) { + $thread['folder'] = 'common'; + $grouptids[] = $thread['closed']; + } else { + if($thread['closed'] > 1) { + $thread['moved'] = $thread['tid']; + $thread['allreplies'] = $thread['replies'] = '-'; + $thread['views'] = '-'; + } + $thread['folder'] = 'lock'; + } + } elseif($_G['forum']['status'] == 3 && $thread['closed'] == 1) { + $thread['folder'] = 'lock'; + } else { + $thread['folder'] = 'common'; + $thread['weeknew'] = TIMESTAMP - 604800 <= $thread['dateline']; + if($thread['allreplies'] > $thread['views']) { + $thread['views'] = $thread['allreplies']; + } + if($_G['setting']['heatthread']['iconlevels']) { + foreach($_G['setting']['heatthread']['iconlevels'] as $k => $i) { + if($thread['heats'] > $i) { + $thread['heatlevel'] = $k + 1; + break; + } + } + } + } + $thread['icontid'] = $thread['forumstick'] || !$thread['moved'] && $thread['isgroup'] != 1 ? $thread['tid'] : $thread['closed']; + if(!$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])) { + $thread['icontid'] = $thread['closed'] > 1 ? $thread['closed'] : $thread['tid']; + } + $thread['istoday'] = $thread['dateline'] > $todaytime ? 1 : 0; + $thread['dbdateline'] = $thread['dateline']; + $thread['dateline'] = dgmdate($thread['dateline'], 'u', '9999', getglobal('setting/dateformat')); + $thread['dblastpost'] = $thread['lastpost']; + $thread['lastpost'] = dgmdate($thread['lastpost'], 'u'); + $thread['hidden'] = $_G['setting']['threadhidethreshold'] && $thread['hidden'] >= $_G['setting']['threadhidethreshold'] || in_array($thread['tid'], $thide); + if($thread['hidden']) { + $_G['hiddenexists']++; + } + + if(in_array($thread['displayorder'], array(1, 2, 3, 4))) { + $thread['id'] = 'stickthread_'.$thread['tid']; + $separatepos++; + } else { + $thread['id'] = 'normalthread_'.$thread['tid']; + if($thread['folder'] == 'common' && $thread['dblastpost'] >= $forumlastvisit || !$forumlastvisit) { + $thread['new'] = 1; + $thread['folder'] = 'new'; + $thread['weeknew'] = TIMESTAMP - 604800 <= $thread['dbdateline']; + } + $_G['showrows']++; + } + if(isset($_G['setting']['verify']['enabled']) && $_G['setting']['verify']['enabled']) { + $verifyuids[$thread['authorid']] = $thread['authorid']; + } + $authorids[$thread['authorid']] = $thread['authorid']; + $thread['mobile'] = base_convert(getstatus($thread['status'], 13).getstatus($thread['status'], 12).getstatus($thread['status'], 11), 2, 10); + $thread['rushreply'] = getstatus($thread['status'], 3); + if($thread['rushreply']) { + $rushtids[$thread['tid']] = $thread['tid']; + } + $threadids[$threadindex] = $thread['tid']; + $_G['forum_threadlist'][$threadindex] = $thread; + $threadindex++; + +} + +$_G['hiddenexists'] = !$_G['forum']['ismoderator'] && $_G['hiddenexists'] && $_G['showrows'] >= $_G['hiddenexists']; + +$livethread = array(); +if($_G['forum']['livetid'] && $page == 1 && (!$filter || ($filter == 'sortid' && $_G['forum']['threadsorts']['defaultshow'] == $_GET['sortid']))) { + include_once libfile('function/post'); + $livethread = C::t('forum_thread')->fetch_thread($_G['forum']['livetid']); + $livepost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['forum']['livetid']); + $livemessage = threadmessagecutstr($livethread, $livepost['message'], 200); + $liveallowpostreply = ($_G['forum']['allowreply'] != -1) && (($livethread['isgroup'] || (!$livethread['closed'] && !checkautoclose($livethread))) || $_G['forum']['ismoderator']) && ((!$_G['forum']['replyperm'] && $_G['group']['allowreply']) || ($_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm'])) || $_G['forum']['allowreply']); +} + +if($rushtids) { + $rushinfo = C::t('forum_threadrush')->fetch_all($rushtids); + foreach($rushinfo as $tid => $info) { + if($info['starttimefrom'] > TIMESTAMP) { + $info['timer'] = $info['starttimefrom'] - TIMESTAMP; + $info['timertype'] = 'start'; + } elseif($info['starttimeto'] > TIMESTAMP) { + $info['timer'] = $info['starttimeto'] - TIMESTAMP; + $info['timertype'] = 'end'; + } else { + $info = ''; + } + $rushinfo[$tid] = $info; + } +} +if(!empty($threadids)) { + $indexlist = array_flip($threadids); + foreach(C::t('forum_threadaddviews')->fetch_all($threadids) as $tidkey => $value) { + $index = $indexlist[$tidkey]; + $threadlist[$index]['views'] += $value['addviews']; + $_G['forum_threadlist'][$index]['views'] += $value['addviews']; + } +} + +$verify = array(); +if($_G['setting']['verify']['enabled'] && $verifyuids) { + $verify = forumdisplay_verify_author($verifyuids); +} + +if($authorids) { + loadcache('usergroups'); + $groupcolor = array(); + foreach(C::t('common_member')->fetch_all($authorids) as $value) { + $groupcolor[$value['uid']] = $_G['cache']['usergroups'][$value['groupid']]['color']; + } +} +$_G['forum_threadnum'] = count($_G['forum_threadlist']) - $separatepos; + +if(!empty($grouptids)) { + $groupfids = array(); + foreach(C::t('forum_thread')->fetch_all_by_tid($grouptids) as $row) { + $groupnames[$row['tid']]['fid'] = $row['fid']; + $groupnames[$row['tid']]['views'] = $row['views']; + $groupfids[] = $row['fid']; + } + $forumsinfo = C::t('forum_forum')->fetch_all($groupfids); + foreach($groupnames as $gtid => $value) { + $gfid = $groupnames[$gtid]['fid']; + $groupnames[$gtid]['name'] = $forumsinfo[$gfid]['name']; + $groupnames[$gtid]['type'] = $forumsinfo[$gfid]['type']; + $groupnames[$gtid]['status'] = $forumsinfo[$gfid]['status']; + } +} + +$stemplate = null; +if(!empty($_G['forum']['threadsorts']['types']) && $sortoptionarray && $templatearray && $threadids) { + $sortid = intval($_GET['sortid']); + if(!strexists($templatearray[$sortid], '{subject_url}') && !strexists($templatearray[$sortid], '{tid}')) { + $sortlistarray = showsorttemplate($sortid, $_G['fid'], $sortoptionarray, $templatearray, $_G['forum_threadlist'], $threadids); + $stemplate = $sortlistarray['template']; + } else { + $sorttemplate = showsortmodetemplate($sortid, $_G['fid'], $sortoptionarray, $templatearray, $_G['forum_threadlist'], $threadids, $verify); + $_G['forum']['sortmode'] = 1; + } + + if(($_GET['searchoption'] || $_GET['searchsort']) && empty($searchsorttids)) { + $_G['forum_threadlist'] = $multipage = ''; + } +} + +$separatepos = $separatepos ? $separatepos + 1 : 0; + +$_G['setting']['visitedforums'] = $_G['setting']['visitedforums'] && $_G['forum']['status'] != 3 ? visitedforums() : ''; + + +$_G['group']['allowpost'] = (!$_G['forum']['postperm'] && $_G['group']['allowpost']) || ($_G['forum']['postperm'] && forumperm($_G['forum']['postperm'])) || (isset($_G['forum']['allowpost']) && $_G['forum']['allowpost'] == 1 && $_G['group']['allowpost']); +$fastpost = $_G['setting']['fastpost'] && !$_G['forum']['allowspecialonly'] && empty($_G['forum']['threadsorts']['required']) && !$_G['forum']['picstyle']; +$allowfastpost = $fastpost && $_G['group']['allowpost']; +$_G['group']['allowpost'] = isset($_G['forum']['allowpost']) && $_G['forum']['allowpost'] == -1 ? false : $_G['group']['allowpost']; + +$_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : ''; +$allowpostattach = $fastpost && ($_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || (!$_G['forum']['postattachperm'] && $_G['group']['allowpostattach']) || ($_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm'])))); + +if($fastpost || $livethread) { + if(in_array($_G['adminid'], array(0, -1)) && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - getglobal('member/regdate') < $_G['setting']['newbiespan'] * 60)) { + $allowfastpost = false; + } + $usesigcheck = $_G['uid'] && $_G['group']['maxsigsize']; + list($seccodecheck, $secqaacheck) = seccheck('post', 'newthread'); +} elseif(!$_G['uid']) { + $fastpostdisabled = true; +} + +$showpoll = $showtrade = $showreward = $showactivity = $showdebate = 0; +if($_G['forum']['allowpostspecial']) { + $showpoll = $_G['forum']['allowpostspecial'] & 1; + $showtrade = $_G['forum']['allowpostspecial'] & 2; + $showreward = isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]) && ($_G['forum']['allowpostspecial'] & 4); + $showactivity = $_G['forum']['allowpostspecial'] & 8; + $showdebate = $_G['forum']['allowpostspecial'] & 16; +} + +if($_G['group']['allowpost']) { + $_G['group']['allowpostpoll'] = $_G['group']['allowpostpoll'] && $showpoll; + $_G['group']['allowposttrade'] = $_G['group']['allowposttrade'] && $showtrade; + $_G['group']['allowpostreward'] = $_G['group']['allowpostreward'] && $showreward; + $_G['group']['allowpostactivity'] = $_G['group']['allowpostactivity'] && $showactivity; + $_G['group']['allowpostdebate'] = $_G['group']['allowpostdebate'] && $showdebate; +} + +$showthreadclasscount = array(); +if(($_G['forum']['threadtypes'] && $_G['forum']['threadtypes']['listable']) || (isset($_G['forum']['threadsorts']['types']) && is_array($_G['forum']['threadsorts']['types']) && count($_G['forum']['threadsorts']['types']) > 0)) { + $showthreadclasscount = threadclasscount($_G['fid']); +} + +$_G['forum']['threadplugin'] = $_G['group']['allowpost'] && $_G['setting']['threadplugins'] ? dunserialize($_G['forum']['threadplugin']) : array(); + +$allowleftside = !$subforumonly && $_G['setting']['leftsidewidth'] && !$_G['forum']['allowside']; +if(isset($_GET['leftsidestatus'])) { + dsetcookie('disableleftside', $_GET['leftsidestatus'], 2592000); + $_G['cookie']['disableleftside'] = $_GET['leftsidestatus']; +} +$leftside = empty($_G['cookie']['disableleftside']) && $allowleftside ? forumleftside() : array(); +$leftsideswitch = $allowleftside ? "forum.php?mod=forumdisplay&fid={$_G['fid']}&page=$page".($multiadd ? '&'.implode('&', $multiadd) : '') : ''; + +require_once libfile('function/upload'); +$swfconfig = getuploadconfig($_G['uid'], $_G['fid']); + +$template = 'diy:forum/forumdisplay:'.$_G['fid']; + +if($_G['forum']['status'] == 3) { + $groupviewed_list = get_viewedgroup(); + write_groupviewed($_G['fid']); + $template = 'diy:group/group:'.$_G['fid']; +} + +$threadlist_data = array(); +if(defined('IN_MOBILE') && $_G['forum_threadcount']) { + $threadlist_data = get_attach($_G['forum_threadlist']); +} +if(!defined('IN_ARCHIVER')) { + include template($template); +} else { + include loadarchiver('forum/forumdisplay'); +} + + +function forumdisplay_verify_author($ids) { + global $_G; + $verify = array(); + foreach(C::t('common_member_verify')->fetch_all($ids) as $value) { + foreach($_G['setting']['verify'] as $vid => $vsetting) { + if($vsetting['available'] && $vsetting['showicon'] && $value['verify'.$vid] == 1) { + $srcurl = !empty($vsetting['icon']) ? $vsetting['icon'] : ''; + $verify[$value['uid']] .= "".(!empty($srcurl) ? ''.$vsetting['title'].'' : $vsetting['title']).''; + } + } + + } + return $verify; +} +?> \ No newline at end of file diff --git a/source/module/forum/forum_group.php b/source/module/forum/forum_group.php new file mode 100644 index 0000000..05af20a --- /dev/null +++ b/source/module/forum/forum_group.php @@ -0,0 +1,748 @@ + 1)); + } +} +if(empty($_G['fid']) && $action != 'create') { + showmessage('group_rediret_now', 'group.php'); +} +$first = &$_G['cache']['grouptype']['first']; +$second = &$_G['cache']['grouptype']['second']; +$rssauth = $_G['rssauth']; +$rsshead = $_G['setting']['rssstatus'] ? ('\n") : ''; +if($_G['fid']) { + if($_G['forum']['status'] != 3) { + showmessage('forum_not_group', 'group.php'); + } elseif($_G['forum']['level'] == -1) { + showmessage('group_verify', '', array(), array('alert' => 'info')); + } elseif($_G['forum']['jointype'] < 0 && !$_G['forum']['ismoderator']) { + showmessage('forum_group_status_off', 'group.php'); + } + $groupcache = getgroupcache($_G['fid'], array('replies', 'views', 'digest', 'lastpost', 'ranking', 'activityuser', 'newuserlist'), 604800); + + $_G['forum']['icon'] = get_groupimg($_G['forum']['icon'], 'icon'); + $_G['forum']['banner'] = get_groupimg($_G['forum']['banner']); + $_G['forum']['dateline'] = dgmdate($_G['forum']['dateline'], 'd'); + $_G['forum']['posts'] = intval($_G['forum']['posts']); + $_G['grouptypeid'] = $_G['forum']['fup']; + $groupuser = C::t('forum_groupuser')->fetch_userinfo($_G['uid'], $_G['fid']); + $onlinemember = grouponline($_G['fid'], 1); + $groupmanagers = $_G['forum']['moderators']; + $nav = get_groupnav($_G['forum']); + $groupnav = $nav['nav']; + + $seodata = array('forum' => $_G['forum']['name'], 'first' => $nav['first']['name'], 'second' => $nav['second']['name'], 'gdes' => $_G['forum']['description']); + list($navtitle, $metadescription, $metakeywords) = get_seosetting('grouppage', $seodata); + if(!$navtitle) { + $navtitle = helper_seo::get_title_page($_G['forum']['name'], $_G['page']).' - '.$_G['setting']['navs'][3]['navname']; + $nobbname = false; + } else { + $nobbname = true; + } + if(!$metakeywords) { + $metakeywords = $_G['forum']['name']; + } + if(!$metadescription) { + $metadescription = $_G['forum']['name']; + } + $_G['seokeywords'] = $_G['setting']['seokeywords']['group']; + $_G['seodescription'] = $_G['setting']['seodescription']['group']; +} + +if(in_array($action, array('out', 'viewmember', 'manage', 'index', 'memberlist'))) { + $status = groupperm($_G['forum'], $_G['uid'], $action, $groupuser); + if($status == -1) { + showmessage('forum_not_group', 'group.php'); + } elseif($status == 1) { + showmessage('forum_group_status_off'); + } + if($action != 'index') { + if($status == 2) { + showmessage('forum_group_noallowed', "forum.php?mod=group&fid={$_G['fid']}"); + } elseif($status == 3) { + showmessage('forum_group_moderated', "forum.php?mod=group&fid={$_G['fid']}"); + } + } +} + +if(in_array($action, array('index')) && $status != 2) { + + $newuserlist = $activityuserlist = array(); + foreach($groupcache['newuserlist']['data'] as $user) { + $newuserlist[$user['uid']] = $user; + $newuserlist[$user['uid']]['online'] = !empty($onlinemember['list']) && is_array($onlinemember['list']) && !empty($onlinemember['list'][$user['uid']]) ? 1 : 0; + } + + $activityuser = array_slice($groupcache['activityuser']['data'], 0, 8); + foreach($activityuser as $user) { + $activityuserlist[$user['uid']] = $user; + $activityuserlist[$user['uid']]['online'] = !empty($onlinemember['list']) && is_array($onlinemember['list']) && !empty($onlinemember['list'][$user['uid']]) ? 1 : 0; + } + + $groupviewed_list = get_viewedgroup(); + +} + +$showpoll = $showtrade = $showreward = $showactivity = $showdebate = 0; +if($_G['forum']['allowpostspecial']) { + $showpoll = $_G['forum']['allowpostspecial'] & 1; + $showtrade = $_G['forum']['allowpostspecial'] & 2; + $showreward = isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]) && ($_G['forum']['allowpostspecial'] & 4); + $showactivity = $_G['forum']['allowpostspecial'] & 8; + $showdebate = $_G['forum']['allowpostspecial'] & 16; +} + +if($_G['group']['allowpost']) { + $_G['group']['allowpostpoll'] = $_G['group']['allowpostpoll'] && $showpoll; + $_G['group']['allowposttrade'] = $_G['group']['allowposttrade'] && $showtrade; + $_G['group']['allowpostreward'] = $_G['group']['allowpostreward'] && $showreward; + $_G['group']['allowpostactivity'] = $_G['group']['allowpostactivity'] && $showactivity; + $_G['group']['allowpostdebate'] = $_G['group']['allowpostdebate'] && $showdebate; +} +if($action == 'index') { + + $newthreadlist = $livethread = array(); + if($status != 2) { + loadcache('forumstick'); + $forumstickytids = ''; + if(isset($_G['cache']['forumstick'][$_G['forum']['fup']])) { + $forumstickytids = $_G['cache']['forumstick'][$_G['forum']['fup']]; + } + require_once libfile('function/feed'); + if($forumstickytids) { + foreach(C::t('forum_thread')->fetch_all_by_tid_or_fid($_G['fid'], $forumstickytids) as $row) { + $row['dateline'] = dgmdate($row['dateline'], 'd'); + $row['lastpost'] = dgmdate($row['lastpost'], 'u'); + $row['allreplies'] = $row['replies'] + $row['comments']; + $row['lastposterenc'] = rawurlencode($row['lastposter']); + $stickythread[$row['tid']] = $row; + } + } + $newthreadlist = getgroupcache($_G['fid'], array('dateline'), 0, 10, 0, 1); + foreach($newthreadlist['dateline']['data'] as $key => $thread) { + if(!empty($stickythread) && $stickythread[$thread['tid']]) { + unset($newthreadlist['dateline']['data'][$key]); + continue; + } + $newthreadlist['dateline']['data'][$key]['allreplies'] = $newthreadlist['dateline']['data'][$key]['replies'] + $newthreadlist['dateline']['data'][$key]['comments']; + if($thread['closed'] == 1) { + $newthreadlist['dateline']['data'][$key]['folder'] = 'lock'; + } elseif(empty($_G['cookie']['oldtopics']) || strpos($_G['cookie']['oldtopics'], 'D'.$thread['tid'].'D') === FALSE) { + $newthreadlist['dateline']['data'][$key]['folder'] = 'new'; + } else { + $newthreadlist['dateline']['data'][$key]['folder'] = 'common'; + } + } + + if($stickythread) { + $newthreadlist['dateline']['data'] = array_merge($stickythread, $newthreadlist['dateline']['data']); + } + $groupfeedlist = array(); + if(!IS_ROBOT) { + $activityuser = array_keys($groupcache['activityuser']['data']); + if($activityuser) { + $query = C::t('home_feed')->fetch_all_by_uid_dateline($activityuser); + foreach($query as $feed) { + if($feed['friend'] == 0) { + $groupfeedlist[] = mkfeed($feed); + } + } + } + } + + if($_G['forum']['livetid']) { + include_once libfile('function/post'); + $livethread = C::t('forum_thread')->fetch_thread($_G['forum']['livetid']); + $livepost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['forum']['livetid']); + $livemessage = threadmessagecutstr($livethread, $livepost['message'], 200); + $liveallowpostreply = $groupuser['uid'] && $groupuser['level'] ? true : false; + list($seccodecheck, $secqaacheck) = seccheck('post', 'newthread'); + } + + } else { + $newuserlist = $activityuserlist = array(); + $newuserlist = array_slice($groupcache['newuserlist']['data'], 0, 4); + foreach($newuserlist as $user) { + $newuserlist[$user['uid']] = $user; + $newuserlist[$user['uid']]['online'] = !empty($onlinemember['list']) && is_array($onlinemember['list']) && !empty($onlinemember['list'][$user['uid']]) ? 1 : 0; + } + } + + write_groupviewed($_G['fid']); + include template('diy:group/group:'.$_G['fid']); + +} elseif($action == 'memberlist') { + + $oparray = array('card', 'address', 'alluser'); + $op = getgpc('op') && in_array($_GET['op'], $oparray) ? $_GET['op'] : 'alluser'; + $page = intval(getgpc('page')) ? intval($_GET['page']) : 1; + $perpage = 50; + $start = ($page - 1) * $perpage; + + $alluserlist = $adminuserlist = array(); + $staruserlist = $page < 2 ? C::t('forum_groupuser')->groupuserlist($_G['fid'], 'lastupdate', 0, 0, array('level' => '3'), array('uid', 'username', 'level', 'joindateline', 'lastupdate')) : ''; + $adminlist = $groupmanagers && $page < 2 ? $groupmanagers : array(); + + if($op == 'alluser') { + $alluserlist = C::t('forum_groupuser')->groupuserlist($_G['fid'], 'lastupdate', $perpage, $start, "AND level='4'", '', $onlinemember['list']); + $multipage = multi($_G['forum']['membernum'], $perpage, $page, 'forum.php?mod=group&action=memberlist&op=alluser&fid='.$_G['fid']); + + if($adminlist) { + foreach($adminlist as $user) { + $adminuserlist[$user['uid']] = $user; + $adminuserlist[$user['uid']]['online'] = $onlinemember['list'] && is_array($onlinemember['list']) && $onlinemember['list'][$user['uid']] ? 1 : 0; + } + } + } + + include template('diy:group/group:'.$_G['fid']); + +} elseif($action == 'join') { + if(!submitcheck('groupjoin')) { + dheader('location: '.$_G['siteurl']."forum.php?mod=forumdisplay&fid={$_G['fid']}&extra=join"); + } + $inviteuid = 0; + $membermaximum = $_G['current_grouplevel']['specialswitch']['membermaximum']; + if(!empty($membermaximum)) { + $curnum = C::t('forum_groupuser')->fetch_count_by_fid($_G['fid']); + if($curnum >= $membermaximum) { + showmessage('group_member_maximum', '', array('membermaximum' => $membermaximum)); + } + } + if($groupuser['uid']) { + showmessage('group_has_joined', "forum.php?mod=group&fid={$_G['fid']}"); + } else { + $modmember = 4; + $showmessage = 'group_join_succeed'; + $confirmjoin = TRUE; + $inviteuid = C::t('forum_groupinvite')->fetch_uid_by_inviteuid($_G['fid'], $_G['uid']); + if($_G['forum']['jointype'] == 1) { + if(!$inviteuid) { + $confirmjoin = FALSE; + $showmessage = 'group_join_need_invite'; + } + } elseif($_G['forum']['jointype'] == 2) { + $modmember = !empty($groupmanagers[$inviteuid]) || $_G['adminid'] == 1 ? 4 : 0; + !empty($groupmanagers[$inviteuid]) && $showmessage = 'group_join_apply_succeed'; + } + + if($confirmjoin) { + C::t('forum_groupuser')->insert($_G['fid'], $_G['uid'], $_G['username'], $modmember, TIMESTAMP, TIMESTAMP); + if($_G['forum']['jointype'] == 2 && (empty($inviteuid) || empty($groupmanagers[$inviteuid]))) { + foreach($groupmanagers as $manage) { + notification_add($manage['uid'], 'group', 'group_member_join', array('fid' => $_G['fid'], 'groupname' => $_G['forum']['name'], 'url' => $_G['siteurl'].'forum.php?mod=group&action=manage&op=checkuser&fid='.$_G['fid']), 1); + } + } else { + } + if($inviteuid) { + C::t('forum_groupinvite')->delete_by_inviteuid($_G['fid'], $_G['uid']); + } + if($modmember == 4) { + C::t('forum_forumfield')->update_membernum($_G['fid']); + } + C::t('forum_forumfield')->update($_G['fid'], array('lastupdate' => TIMESTAMP)); + } + include_once libfile('function/stat'); + updatestat('groupjoin'); + delgroupcache($_G['fid'], array('activityuser', 'newuserlist')); + showmessage($showmessage, "forum.php?mod=group&fid={$_G['fid']}"); + } + +} elseif($action == 'out') { + + if(!submitcheck('groupexit')) { + showmessage('undefined_action'); + } + if($_G['uid'] == $_G['forum']['founderuid']) { + showmessage('group_exit_founder'); + } + $showmessage = 'group_exit_succeed'; + C::t('forum_groupuser')->delete_by_fid($_G['fid'], $_G['uid']); + C::t('forum_forumfield')->update_membernum($_G['fid'], -1); + update_groupmoderators($_G['fid']); + delgroupcache($_G['fid'], array('activityuser', 'newuserlist')); + showmessage($showmessage, "forum.php?mod=forumdisplay&fid={$_G['fid']}"); + +} elseif($action == 'create') { + + if(!$_G['group']['allowbuildgroup']) { + showmessage('group_create_usergroup_failed', "group.php"); + } + + $creditstransextra = $_G['setting']['creditstransextra']['12'] ? $_G['setting']['creditstransextra']['12'] : $_G['setting']['creditstrans']; + if($_G['group']['buildgroupcredits']) { + if(empty($creditstransextra)) { + $_G['group']['buildgroupcredits'] = 0; + } else { + getuserprofile('extcredits'.$creditstransextra); + if($_G['member']['extcredits'.$creditstransextra] < $_G['group']['buildgroupcredits']) { + showmessage('group_create_usergroup_credits_failed', '', array('buildgroupcredits' => $_G['group']['buildgroupcredits']. $_G['setting']['extcredits'][$creditstransextra]['unit'].$_G['setting']['extcredits'][$creditstransextra]['title'])); + } + } + } + + $groupnum = C::t('forum_forumfield')->fetch_groupnum_by_founderuid($_G['uid']); + $allowbuildgroup = $_G['group']['allowbuildgroup'] - $groupnum; + if($allowbuildgroup < 1) { + showmessage('group_create_max_failed'); + } + $_GET['fupid'] = intval($_GET['fupid']); + $_GET['groupid'] = intval($_GET['groupid']); + + if(!submitcheck('createsubmit')) { + $groupselect = get_groupselect(getgpc('fupid'), getgpc('groupid')); + } else { + $parentid = intval($_GET['parentid']); + $fup = intval($_GET['fup']); + $name = censor(dhtmlspecialchars(cutstr(trim($_GET['name']), 20, '')), NULL, FALSE, FALSE); + $censormod = censormod($name); + if(empty($name)) { + showmessage('group_name_empty'); + } elseif($censormod) { + showmessage('group_name_failed'); + } elseif(empty($parentid) && empty($fup)) { + showmessage('group_category_empty'); + } + if(empty($_G['cache']['grouptype']['first'][$parentid]) && empty($_G['cache']['grouptype']['second'][$fup]) + || $_G['cache']['grouptype']['first'][$parentid]['secondlist'] && !in_array($_G['cache']['grouptype']['second'][$fup]['fid'], $_G['cache']['grouptype']['first'][$parentid]['secondlist'])) { + showmessage('group_category_error'); + } + if(empty($fup)) { + $fup = $parentid; + } + if(C::t('forum_forum')->fetch_fid_by_name($name)) { + showmessage('group_name_exist'); + } + require_once libfile('function/discuzcode'); + $descriptionnew = discuzcode(dhtmlspecialchars(censor(trim($_GET['descriptionnew']), NULL, FALSE, FALSE)), 0, 0, 0, 0, 1, 1, 0, 0, 1); + $censormod = censormod($descriptionnew); + if($censormod) { + showmessage('group_description_failed'); + } + if(empty($_G['setting']['groupmod']) || $_G['adminid'] == 1) { + $levelinfo = C::t('forum_grouplevel')->fetch_by_credits(); + $levelid = $levelinfo['levelid']; + } else { + $levelid = -1; + } + $newfid = C::t('forum_forum')->insert_group($fup, 'sub', $name, '3', $levelid); + if($newfid) { + $jointype = intval($_GET['jointype']); + $gviewperm = intval($_GET['gviewperm']); + $fieldarray = array('fid' => $newfid, 'description' => $descriptionnew, 'jointype' => $jointype, 'gviewperm' => $gviewperm, 'dateline' => TIMESTAMP, 'founderuid' => $_G['uid'], 'foundername' => $_G['username'], 'membernum' => 1); + C::t('forum_forumfield')->insert($fieldarray); + C::t('forum_forumfield')->update_groupnum($fup, 1); + C::t('forum_groupuser')->insert($newfid, $_G['uid'], $_G['username'], 1, TIMESTAMP); + require_once libfile('function/cache'); + updatecache('grouptype'); + } + if($creditstransextra && $_G['group']['buildgroupcredits']) { + updatemembercount($_G['uid'], array($creditstransextra => -$_G['group']['buildgroupcredits']), 1, 'BGR', $newfid); + } + include_once libfile('function/stat'); + updatestat('group'); + if($levelid == -1) { + showmessage('group_create_mod_succeed', "group.php?mod=my&view=manager", array(), array('alert' => 'right', 'showdialog' => 1, 'showmsg' => true, 'locationtime' => true)); + } + showmessage('group_create_succeed', "forum.php?mod=group&action=manage&fid=$newfid", array(), array('showdialog' => 1, 'showmsg' => true, 'locationtime' => true)); + } + + include template('diy:group/group:'.$_G['fid']); + +} elseif($action == 'manage'){ + if(!$_G['forum']['ismoderator']) { + showmessage('group_admin_noallowed'); + } + $specialswitch = $_G['current_grouplevel']['specialswitch']; + + $oparray = array('group', 'checkuser', 'manageuser', 'threadtype', 'demise'); + $_GET['op'] = getgpc('op') && in_array($_GET['op'], $oparray) ? $_GET['op'] : 'group'; + if(empty($groupmanagers[$_G['uid']]) && !in_array($_GET['op'], array('group', 'threadtype', 'demise')) && $_G['adminid'] != 1) { + showmessage('group_admin_noallowed'); + } + $page = intval(getgpc('page')) ? intval($_GET['page']) : 1; + $perpage = 50; + $start = ($page - 1) * $perpage; + $url = 'forum.php?mod=group&action=manage&op='.$_GET['op'].'&fid='.$_G['fid']; + if($_GET['op'] == 'group') { + $domainlength = checkperm('domainlength'); + if(submitcheck('groupmanage')) { + $forumarr = array(); + if(isset($_GET['domain']) && $_G['forum']['domain'] != $_GET['domain']) { + $domain = strtolower(trim($_GET['domain'])); + if($_G['setting']['allowgroupdomain'] && !empty($_G['setting']['domain']['root']['group']) && $domainlength) { + checklowerlimit('modifydomain'); + } + require_once libfile('function/delete'); + if(empty($domainlength) || empty($domain)) { + $domain = ''; + deletedomain($_G['fid'], 'group'); + } else { + require_once libfile('function/domain'); + if(domaincheck($domain, $_G['setting']['domain']['root']['group'], $domainlength)) { + deletedomain($_G['fid'], 'group'); + C::t('common_domain')->insert(array('domain' => $domain, 'domainroot' => $_G['setting']['domain']['root']['group'], 'id' => $_G['fid'], 'idtype' => 'group')); + } + + } + $forumarr['domain'] = $domain; + updatecreditbyaction('modifydomain'); + } + + if(($_GET['name'] && !empty($specialswitch['allowchangename'])) || ($_GET['fup'] && !empty($specialswitch['allowchangetype']))) { + if($_G['uid'] != $_G['forum']['founderuid'] && $_G['adminid'] != 1) { + showmessage('group_edit_only_founder'); + } + $fup = intval($_GET['fup']); + $parentid = intval($_GET['parentid']); + + if(isset($_GET['name'])) { + $_GET['name'] = censor(dhtmlspecialchars(cutstr(trim($_GET['name']), 20, '')), NULL, FALSE, FALSE); + if(empty($_GET['name'])) { + showmessage('group_name_empty'); + } + $censormod = censormod($_GET['name']); + if($censormod) { + showmessage('group_name_failed'); + } + } elseif(isset($_GET['parentid']) && empty($parentid) && empty($fup)) { + showmessage('group_category_empty'); + } + if(!empty($_GET['name']) && $_GET['name'] != $_G['forum']['name']) { + if(C::t('forum_forum')->fetch_fid_by_name($_GET['name'])) { + showmessage('group_name_exist', $url); + } + $forumarr['name'] = $_GET['name']; + } + if(empty($fup)) { + $fup = $parentid; + } + if(isset($_GET['parentid']) && $fup != $_G['forum']['fup']) { + $forumarr['fup'] = $fup; + } + } + if($forumarr) { + C::t('forum_forum')->update($_G['fid'], $forumarr); + if($forumarr['fup']) { + C::t('forum_forumfield')->update_groupnum($forumarr['fup'], 1); + C::t('forum_forumfield')->update_groupnum($_G['forum']['fup'], -1); + require_once libfile('function/cache'); + updatecache('grouptype'); + } + } + + $setarr = array(); + $deletebanner = $_GET['deletebanner']; + $iconnew = upload_icon_banner($_G['forum'], $_FILES['iconnew'], 'icon'); + $bannernew = upload_icon_banner($_G['forum'], $_FILES['bannernew'], 'banner'); + if($iconnew) { + $setarr['icon'] = $iconnew; + $group_recommend = dunserialize($_G['setting']['group_recommend']); + if($group_recommend[$_G['fid']]) { + $group_recommend[$_G['fid']]['icon'] = get_groupimg($iconnew); + C::t('common_setting')->update_setting('group_recommend', $group_recommend); + include libfile('function/cache'); + updatecache('setting'); + } + } + if($bannernew && empty($deletebanner)) { + $setarr['banner'] = $bannernew; + } elseif($deletebanner) { + $setarr['banner'] = ''; + @unlink($_G['forum']['banner']); + } + require_once libfile('function/discuzcode'); + $_GET['descriptionnew'] = discuzcode(censor(trim($_GET['descriptionnew']), NULL, FALSE, FALSE), 0, 0, 0, 0, 1, 1, 0, 0, 1); + $censormod = censormod($_GET['descriptionnew']); + if($censormod) { + showmessage('group_description_failed'); + } + $_GET['jointypenew'] = intval($_GET['jointypenew']); + if($_GET['jointypenew'] == '-1' && $_G['uid'] != $_G['forum']['founderuid']) { + showmessage('group_close_only_founder'); + } + $_GET['gviewpermnew'] = intval($_GET['gviewpermnew']); + $setarr['description'] = $_GET['descriptionnew']; + $setarr['jointype'] = $_GET['jointypenew']; + $setarr['gviewperm'] = $_GET['gviewpermnew']; + C::t('forum_forumfield')->update($_G['fid'], $setarr); + showmessage('group_setup_succeed', $url); + } else { + $firstgid = $_G['cache']['grouptype']['second'][$_G['forum']['fup']]['fup']; + $groupselect = get_groupselect($firstgid ? $firstgid : $_G['forum']['fup'], $_G['forum']['fup']); + $gviewpermselect = $jointypeselect = array('','',''); + require_once libfile('function/editor'); + $_G['forum']['descriptionnew'] = html2bbcode($_G['forum']['description']); + $jointypeselect[$_G['forum']['jointype']] = 'checked="checked"'; + $gviewpermselect[$_G['forum']['gviewperm']] = 'checked="checked"'; + if($_G['setting']['allowgroupdomain'] && !empty($_G['setting']['domain']['root']['group']) && $domainlength) { + loadcache('creditrule'); + getuserprofile('extcredits1'); + $rule = $_G['cache']['creditrule']['modifydomain']; + $credits = $consume = $common = ''; + for($i = 1; $i <= 8; $i++) { + if($_G['setting']['extcredits'][$i] && $rule['extcredits'.$i]) { + $consume .= $common.$_G['setting']['extcredits'][$i]['title'].$rule['extcredits'.$i].$_G['setting']['extcredits'][$i]['unit']; + $credits .= $common.$_G['setting']['extcredits'][$i]['title'].$_G['member']['extcredits'.$i].$_G['setting']['extcredits'][$i]['unit']; + $common = ','; + } + } + } + } + } elseif($_GET['op'] == 'checkuser') { + $checktype = 0; + $checkusers = array(); + if(!empty($_GET['uid'])) { + $checkusers = array($_GET['uid']); + $checktype = intval($_GET['checktype']); + } elseif(getgpc('checkall') == 1 || getgpc('checkall') == 2) { + $checktype = $_GET['checkall']; + $query = C::t('forum_groupuser')->fetch_all_by_fid($_G['fid'], 1); + foreach($query as $row) { + $checkusers[] = $row['uid']; + } + } + if($checkusers) { + foreach($checkusers as $uid) { + $notification = $checktype == 1 ? 'group_member_check' : 'group_member_check_failed'; + notification_add($uid, 'group', $notification, array('fid' => $_G['fid'], 'groupname' => $_G['forum']['name'], 'url' => $_G['siteurl'].'forum.php?mod=group&fid='.$_G['fid']), 1); + } + if($checktype == 1) { + C::t('forum_groupuser')->update_for_user($checkusers, $_G['fid'], null, null, 4); + C::t('forum_forumfield')->update_membernum($_G['fid'], count($checkusers)); + } elseif($checktype == 2) { + C::t('forum_groupuser')->delete_by_fid($_G['fid'], $checkusers); + } + if($checktype == 1) { + showmessage('group_moderate_succeed', $url); + } else { + showmessage('group_moderate_failed', $url); + } + } else { + $checkusers = array(); + $userlist = C::t('forum_groupuser')->groupuserlist($_G['fid'], 'joindateline', $perpage, $start, array('level' => 0)); + $checknum = C::t('forum_groupuser')->fetch_count_by_fid($_G['fid'], 1); + $multipage = multi($checknum, $perpage, $page, $url); + foreach($userlist as $user) { + $user['joindateline'] = date('Y-m-d H:i', $user['joindateline']); + $checkusers[$user['uid']] = $user; + } + } + } elseif($_GET['op'] == 'manageuser') { + $mtype = array(1 => lang('group/template', 'group_moderator'), 2 => lang('group/template', 'group_moderator_vice'), 3 => lang('group/template', 'group_star_member_title'), 4 => lang('group/misc', 'group_normal_member'), 5 => lang('group/misc', 'group_goaway')); + if(!submitcheck('manageuser')) { + $userlist = array(); + if(empty($_GET['srchuser'])) { + $staruserlist = $page < 2 ? C::t('forum_groupuser')->groupuserlist($_G['fid'], '', 0, 0, array('level' => '3'), array('uid', 'username', 'level', 'joindateline', 'lastupdate')) : ''; + $adminuserlist = $groupmanagers && $page < 2 ? $groupmanagers : array(); + $multipage = multi($_G['forum']['membernum'], $perpage, $page, $url); + } else { + $start = 0; + } + $userlist = C::t('forum_groupuser')->groupuserlist($_G['fid'], '', $perpage, $start, $_GET['srchuser'] ? "AND username like '".addslashes($_GET['srchuser'])."%'" : "AND level='4'"); + } else { + $muser = getgpc('muid'); + $targetlevel = $_GET['targetlevel']; + if($muser && is_array($muser)) { + foreach($muser as $muid => $mlevel) { + if($_G['adminid'] != 1 && $_G['forum']['founderuid'] != $_G['uid'] && $groupmanagers[$muid] && $groupmanagers[$muid]['level'] <= $groupuser['level']) { + showmessage('group_member_level_admin_noallowed.', $url); + } + if($_G['adminid'] == 1 || ($muid != $_G['uid'] && ($_G['forum']['founderuid'] == $_G['uid'] || !$groupmanagers[$muid] || $groupmanagers[$muid]['level'] > $groupuser['level']))) { + if($targetlevel != 5) { + C::t('forum_groupuser')->update_for_user($muid, $_G['fid'], null, null, $targetlevel); + } else { + if(!$groupmanagers[$muid] || count($groupmanagers) > 1) { + C::t('forum_groupuser')->delete_by_fid($_G['fid'], $muid); + C::t('forum_forumfield')->update_membernum($_G['fid'], -1); + } else { + showmessage('group_only_one_moderator', $url); + } + } + } + } + update_groupmoderators($_G['fid']); + showmessage('group_setup_succeed', $url.'&page='.$page); + } else { + showmessage('group_choose_member', $url); + } + } + } elseif($_GET['op'] == 'threadtype') { + if(empty($specialswitch['allowthreadtype'])) { + showmessage('group_level_cannot_do'); + } + if($_G['uid'] != $_G['forum']['founderuid'] && $_G['adminid'] != 1) { + showmessage('group_threadtype_only_founder'); + } + $typenumlimit = 20; + if(!submitcheck('groupthreadtype')) { + $threadtypes = $checkeds = array(); + if(empty($_G['forum']['threadtypes'])) { + $checkeds['status'][0] = 'checked'; + $display = 'none'; + } else { + $display = ''; + $_G['forum']['threadtypes']['status'] = 1; + foreach($_G['forum']['threadtypes'] as $key => $val) { + $val = intval($val); + $checkeds[$key][$val] = 'checked'; + } + } + foreach(C::t('forum_threadclass')->fetch_all_by_fid($_G['fid']) as $type) { + $type['enablechecked'] = isset($_G['forum']['threadtypes']['types'][$type['typeid']]) ? ' checked="checked"' : ''; + $type['name'] = dhtmlspecialchars($type['name']); + $threadtypes[] = $type; + } + } else { + $threadtypesnew = $_GET['threadtypesnew']; + $threadtypesnew['types'] = $threadtypes['special'] = $threadtypes['show'] = array(); + if(is_array($_GET['newname']) && $_GET['newname']) { + $newname = array_unique($_GET['newname']); + if($newname) { + foreach($newname as $key => $val) { + $val = dhtmlspecialchars(censor(cutstr(trim($val), 16, ''))); + if($_GET['newenable'][$key] && $val) { + $newtype = C::t('forum_threadclass')->fetch_by_fid_name($_G['fid'], $val); + $newtypeid = $newtype['typeid']; + if(!$newtypeid) { + $typenum = C::t('forum_threadclass')->count_by_fid($_G['fid']); + if($typenum < $typenumlimit) { + $threadtypes_newdisplayorder = intval($_GET['newdisplayorder'][$key]); + $newtypeid = C::t('forum_threadclass')->insert(array('fid' => $_G['fid'], 'name' => $val, 'displayorder' => $threadtypes_newdisplayorder), true); + } + } + if($newtypeid) { + $threadtypesnew['options']['name'][$newtypeid] = $val; + $threadtypesnew['options']['displayorder'][$newtypeid] = $threadtypes_newdisplayorder; + $threadtypesnew['options']['enable'][$newtypeid] = 1; + } + } + } + } + $threadtypesnew['status'] = 1; + } else { + $newname = array(); + } + if($threadtypesnew['status']) { + if(is_array($threadtypesnew['options']) && $threadtypesnew['options']) { + + if(!empty($threadtypesnew['options']['enable'])) { + $typeids = array_keys($threadtypesnew['options']['enable']); + } else { + $typeids = array(0); + } + if(!empty($threadtypesnew['options']['delete'])) { + C::t('forum_threadclass')->delete_by_typeid_fid($threadtypesnew['options']['delete'], $_G['fid']); + } + foreach(C::t('forum_threadclass')->fetch_all_by_typeid_fid($typeids, $_G['fid']) as $type) { + if($threadtypesnew['options']['name'][$type['typeid']] != $type['name'] || $threadtypesnew['options']['displayorder'][$type['typeid']] != $type['displayorder']) { + $threadtypesnew['options']['name'][$type['typeid']] = dhtmlspecialchars(censor(cutstr(trim($threadtypesnew['options']['name'][$type['typeid']]), 16, ''))); + $threadtypesnew['options']['displayorder'][$type['typeid']] = intval($threadtypesnew['options']['displayorder'][$type['typeid']]); + C::t('forum_threadclass')->update_by_typeid_fid($type['typeid'], $_G['fid'], array( + 'name' => $threadtypesnew['options']['name'][$type['typeid']], + 'displayorder' => $threadtypesnew['options']['displayorder'][$type['typeid']], + )); + } + } + } + if($threadtypesnew && $typeids) { + foreach(C::t('forum_threadclass')->fetch_all_by_typeid($typeids) as $type) { + if($threadtypesnew['options']['enable'][$type['typeid']]) { + $threadtypesnew['types'][$type['typeid']] = $threadtypesnew['options']['name'][$type['typeid']]; + } + } + } + $threadtypesnew = !empty($threadtypesnew) ? serialize($threadtypesnew) : ''; + } else { + $threadtypesnew = ''; + } + C::t('forum_forumfield')->update($_G['fid'], array('threadtypes' => $threadtypesnew)); + showmessage('group_threadtype_edit_succeed', $url); + } + } elseif($_GET['op'] == 'demise') { + if((!empty($_G['forum']['founderuid']) && $_G['forum']['founderuid'] == $_G['uid']) || $_G['adminid'] == 1) { + $ucresult = $allowbuildgroup = $groupnum = 0; + if(count($groupmanagers) <= 1) { + showmessage('group_cannot_demise'); + } + + if(submitcheck('groupdemise')) { + $suid = intval($_GET['suid']); + if(empty($suid)) { + showmessage('group_demise_choose_receiver'); + } + if(empty($_GET['grouppwd'])) { + showmessage('group_demise_password'); + } + loaducenter(); + $ucresult = uc_user_login($_G['uid'], $_GET['grouppwd'], 1); + if(!is_array($ucresult) || $ucresult[0] < 1) { + showmessage('group_demise_password_error'); + } + $user = getuserbyuid($suid); + loadcache('usergroup_'.$user['groupid']); + $allowbuildgroup = $_G['cache']['usergroup_'.$user['groupid']]['allowbuildgroup']; + if($allowbuildgroup > 0) { + $groupnum = C::t('forum_forumfield')->fetch_groupnum_by_founderuid($suid); + } + if(empty($allowbuildgroup) || $allowbuildgroup - $groupnum < 1) { + showmessage('group_demise_receiver_cannot_do'); + } + C::t('forum_forumfield')->update($_G['fid'], array('founderuid' => $suid, 'foundername' => $user['username'])); + C::t('forum_groupuser')->update_for_user($suid, $_G['fid'], NULL, NULL, 1); + update_groupmoderators($_G['fid']); + sendpm($suid, lang('group/misc', 'group_demise_message_title', array('forum' => $_G['forum']['name'])), lang('group/misc', 'group_demise_message_body', array('forum' => $_G['forum']['name'], 'siteurl' => $_G['siteurl'], 'fid' => $_G['fid'])), $_G['uid']); + showmessage('group_demise_succeed', 'forum.php?mod=group&action=manage&fid='.$_G['fid']); + } + } else { + showmessage('group_demise_founder_only'); + } + } else { + showmessage('undefined_action'); + } + include template('diy:group/group:'.$_G['fid']); + +} elseif($action == 'recommend') { + if(!$_G['forum']['ismoderator'] || !in_array($_G['adminid'], array(1,2))) { + showmessage('group_admin_noallowed'); + } + if(submitcheck('grouprecommend')) { + if($_GET['recommend'] != $_G['forum']['recommend']) { + C::t('forum_forum')->update($_G['fid'], array('recommend' => intval($_GET['recommend']))); + require_once libfile('function/cache'); + updatecache('forumrecommend'); + } + showmessage('grouprecommend_succeed', '', array(), array('alert' => 'right', 'closetime' => true, 'showdialog' => 1)); + } else { + require_once libfile('function/forumlist'); + $forumselect = forumselect(FALSE, 0, $_G['forum']['recommend']); + } + include template('group/group_recommend'); +} + + +?> \ No newline at end of file diff --git a/source/module/forum/forum_guide.php b/source/module/forum/forum_guide.php new file mode 100644 index 0000000..db078f1 --- /dev/null +++ b/source/module/forum/forum_guide.php @@ -0,0 +1,485 @@ +\n". + "\n". + " \n". + " {$_G['setting']['bbname']} - {$lang['guide']} - ".$lang['guide_'.$view]."\n". + " {$_G['siteurl']}forum.php?mod=guide&view=$view\n". + " ".$lang['guide_'.$view]."\n". + " Copyright(C) {$_G['setting']['bbname']}\n". + " Discuz! Board by Comsenz Inc.\n". + " ".gmdate('r', TIMESTAMP)."\n". + " $ttl\n". + " \n". + " {$_G['siteurl']}static/image/common/logo_88_31.gif\n". + " {$_G['setting']['bbname']}\n". + " {$_G['siteurl']}\n". + " \n"; + + $info = C::t('forum_rsscache')->fetch_all_by_guidetype($view, $perpage); + if(empty($info) || (TIMESTAMP - $info[0]['lastupdate'] > $ttl * 60)) { + update_guide_rsscache($view, $perpage); + } + foreach($info as $thread) { + list($thread['description'], $attachremote, $attachfile, $attachsize) = explode("\t", $thread['description']); + if($attachfile) { + if($attachremote) { + $filename = $_G['setting']['ftp']['attachurl'].'forum/'.$attachfile; + } else { + $filename = $_G['siteurl'].$_G['setting']['attachurl'].'forum/'.$attachfile; + } + } + echo " \n". + " ".$thread['subject']."\n". + " {$_G['siteurl']}".($trewriteflag ? rewriteoutput('forum_viewthread', 1, '', $thread['tid']) : "forum.php?mod=viewthread&tid={$thread['tid']}")."\n". + " \n". + " ".dhtmlspecialchars($thread['forum'])."\n". + " ".dhtmlspecialchars($thread['author'])."\n". + ($attachfile ? '' : ''). + " ".gmdate('r', $thread['dateline'])."\n". + " \n"; + } + echo " \n". + ""; + exit(); +} +if($view != 'index') { + $theurl = 'forum.php?mod=guide&view='.$view; + if($view == 'my') { + if(!$_G['uid']) { + showmessage('to_login', '', array(), array('login' => 1)); + } + $lang = lang('forum/template'); + $filter_array = array( 'common' => $lang['have_posted'], 'save' => $lang['guide_draft'], 'close' => $lang['close'], 'aduit' => $lang['pending'], 'ignored' => $lang['have_ignored'], 'recyclebin' => $lang['forum_recyclebin']); + $viewtype = in_array($_GET['type'], array('reply', 'thread', 'postcomment')) ? $_GET['type'] : 'thread'; + if($searchkey = stripsearchkey($_GET['searchkey'])) { + $searchkey = dhtmlspecialchars($searchkey); + } + $theurl .= '&type='.$viewtype; + $filter = in_array($_GET['filter'], array_keys($filter_array)) ? $_GET['filter'] : ''; + $searchbody = 0; + if($filter) { + $theurl .= '&filter='.$filter; + $searchbody = 1; + } + if($_GET['fid']) { + $theurl .= '&fid='.intval($_GET['fid']); + $searchbody = 1; + } + if($searchkey) { + $theurl .= '&searchkey='.$searchkey; + $searchbody = 1; + } + require_once libfile('function/forumlist'); + $orderactives[$viewtype] = 'class="a"'; + $forumlist = forumselect(FALSE, 0, intval($_GET['fid'])); + $data['my'] = get_my_threads($viewtype, $_GET['fid'], $filter, $searchkey, $start, $perpage, $theurl); + $tids = $data['my']['tids']; + $posts = $data['my']['posts']; + } else { + $data[$view] = get_guide_list($view, $start, $perpage); + } + if(empty($data['my']['multi'])) { + $multipage = multi($data[$view]['threadcount'], $perpage, $_G['page'], $theurl, $_G['setting']['threadmaxpages']); + } else { + $multipage = $data['my']['multi']; + } + +} else { + $data['hot'] = get_guide_list('hot', 0, 30); + $data['digest'] = get_guide_list('digest', 0, 30); + $data['new'] = get_guide_list('new', 0, 30); + $data['newthread'] = get_guide_list('newthread', 0, 30); +} + +loadcache('stamps'); +$currentview[$view] = 'class="xw1 a"'; + +$navigation = $view != 'index' ? ' '.$lang['guide_'.$view].'' : ''; +include template('diy:forum/guide'); + +function get_guide_list($view, $start = 0, $num = 50, $again = 0) { + global $_G; + $setting_guide = dunserialize($_G['setting']['guide']); + if(!in_array($view, array('hot', 'digest', 'new', 'newthread', 'sofa'))) { + return array(); + } + loadcache('forums'); + $cachetimelimit = ($view != 'sofa') ? 900 : 60; + $cache = $_G['cache']['forum_guide'][$view.($view=='sofa' && $_G['fid'] ? $_G['fid'] : '')]; + $notsofatids = array(); + if($cache && (TIMESTAMP - $cache['cachetime']) < $cachetimelimit) { + $tids = is_array($cache['data']) ? $cache['data'] : array(); + $threadcount = count($tids); + $tids = array_slice($tids, $start, $num, true); + $updatecache = false; + if(empty($tids)) { + return array(); + } + } else { + $dateline = 0; + $maxnum = 50000; + if($setting_guide[$view.'dt']) { + $dateline = time() - intval($setting_guide[$view.'dt']); + } + + if($view != 'sofa') { + $maxtid = C::t('forum_thread')->fetch_max_tid(); + $limittid = max(0,($maxtid - $maxnum)); + if($again) { + $limittid = max(0,($limittid - $maxnum)); + } + $tids = array(); + } + foreach($_G['cache']['forums'] as $fid => $forum) { + if($forum['type'] != 'group' && $forum['status'] > 0 && !$forum['viewperm'] && !$forum['havepassword']) { + $fids[$fid] = $fid; + } + } + if(empty($fids)) { + return array(); + } + if($view == 'sofa') { + $sofa = C::t('forum_sofa')->fetch_all_by_fid($fids, $start, $num); + $tids = array_keys($sofa); + } + $updatecache = true; + } + $query = C::t('forum_thread')->fetch_all_for_guide($view, $limittid, $tids, $_G['setting']['heatthread']['guidelimit'], $dateline); + $list = array(); + $n = 0; + foreach($query as $thread) { + if(empty($tids) && ($thread['isgroup'] || !in_array($thread['fid'], $fids))) { + continue; + } + if($thread['displayorder'] < 0) { + continue; + } + if($view == 'sofa' && $thread['replies'] > 0) { + $notsofatids[] = $thread['tid']; + continue; + } + $thread = guide_procthread($thread); + $threadids[] = $thread['tid']; + if($tids || ($n >= $start && $n < ($start + $num))) { + $list[$thread['tid']] = $thread; + $fids[$thread['fid']] = $thread['fid']; + } + $n ++; + } + if($limittid > $maxnum && !$again && count($list) < 50) { + return get_guide_list($view, $start, $num, 1); + } + $forumnames = array(); + if($fids) { + $forumnames = C::t('forum_forum')->fetch_all_name_by_fid($fids); + } + $threadlist = array(); + if($tids) { + $threadids = array(); + foreach($tids as $key => $tid) { + if($list[$tid]) { + $threadlist[$key] = $list[$tid]; + $threadids[] = $tid; + } + } + } else { + $threadlist = $list; + } + unset($list); + if($updatecache) { + $threadids = is_array($threadids) ? $threadids : array(); + $threadcount = count($threadids); + $data = array('cachetime' => TIMESTAMP, 'data' => $threadids); + $_G['cache']['forum_guide'][$view.($view=='sofa' && $_G['fid'] ? $_G['fid'] : '')] = $data; + savecache('forum_guide', $_G['cache']['forum_guide']); + if(!empty($notsofatids)) { + C::t('forum_sofa')->delete($notsofatids); + } + } + return array('forumnames' => $forumnames, 'threadcount' => $threadcount, 'threadlist' => $threadlist); +} + +function get_my_threads($viewtype, $fid = 0, $filter = '', $searchkey = '', $start = 0, $perpage = 20, $theurl = '') { + global $_G; + $fid = $fid ? intval($fid) : null; + loadcache('forums'); + $dglue = '='; + if($viewtype == 'thread') { + $authorid = $_G['uid']; + $dglue = '='; + if($filter == 'recyclebin') { + $displayorder = -1; + } elseif($filter == 'aduit') { + $displayorder = -2; + } elseif($filter == 'ignored') { + $displayorder = -3; + } elseif($filter == 'save') { + $displayorder = -4; + } elseif($filter == 'close') { + $closed = 1; + } elseif($filter == 'common') { + $closed = 0; + $displayorder = 0; + $dglue = '>='; + } + + $gids = $fids = $forums = $list = array(); + foreach(C::t('forum_thread')->fetch_all_by_authorid_displayorder($authorid, $displayorder, $dglue, $closed, $searchkey, $start, $perpage, null, $fid) as $tid => $value) { + if(!isset($_G['cache']['forums'][$value['fid']])) { + $gids[$value['fid']] = $value['fid']; + } else { + $forumnames[$value['fid']] = array('fid'=> $value['fid'], 'name' => $_G['cache']['forums'][$value['fid']]['name']); + } + $list[$value['tid']] = guide_procthread($value); + } + + if(!empty($gids)) { + $gforumnames = C::t('forum_forum')->fetch_all_name_by_fid($gids); + foreach($gforumnames as $fid => $val) { + $forumnames[$fid] = $val; + } + } + $listcount = count($list); + } elseif($viewtype == 'postcomment') { + require_once libfile('function/post'); + $pids = $tids = array(); + $postcommentarr = C::t('forum_postcomment')->fetch_all_by_authorid($_G['uid'], $start, $perpage); + foreach($postcommentarr as $value) { + $pids[] = $value['pid']; + $tids[] = $value['tid']; + } + $pids = C::t('forum_post')->fetch_all_post(0, $pids); + $tids = C::t('forum_thread')->fetch_all($tids); + + $list = $fids = array(); + foreach($postcommentarr as $value) { + $value['authorid'] = $pids[$value['pid']]['authorid']; + $value['fid'] = $pids[$value['pid']]['fid']; + $value['invisible'] = $pids[$value['pid']]['invisible']; + $value['dateline'] = $pids[$value['pid']]['dateline']; + $value['message'] = $pids[$value['pid']]['message']; + $value['special'] = $tids[$value['tid']]['special']; + $value['status'] = $tids[$value['tid']]['status']; + $value['subject'] = $tids[$value['tid']]['subject']; + $value['digest'] = $tids[$value['tid']]['digest']; + $value['attachment'] = $tids[$value['tid']]['attachment']; + $value['replies'] = $tids[$value['tid']]['replies']; + $value['views'] = $tids[$value['tid']]['views']; + $value['lastposter'] = $tids[$value['tid']]['lastposter']; + $value['lastpost'] = $tids[$value['tid']]['lastpost']; + $value['icon'] = $tids[$value['tid']]['icon']; + $value['tid'] = $pids[$value['pid']]['tid']; + + $fids[] = $value['fid']; + $value['comment'] = messagecutstr($value['comment'], 100); + $list[] = guide_procthread($value); + } + unset($pids, $tids, $postcommentarr); + if($fids) { + $fids = array_unique($fids); + $forumnames = C::t('forum_forum')->fetch_all_name_by_fid($fids); + } + $listcount = count($list); + } else { + $invisible = null; + + if($filter == 'recyclebin') { + $invisible = -5; + } elseif($filter == 'aduit') { + $invisible = -2; + } elseif($filter == 'save' || $filter == 'ignored') { + $invisible = -3; + $displayorder = -4; + } elseif($filter == 'close') { + $closed = 1; + } elseif($filter == 'common') { + $invisible = 0; + $displayorder = 0; + $dglue = '>='; + $closed = 0; + } + require_once libfile('function/post'); + $followfid = getglobal('setting/followforumid'); + $posts = C::t('forum_post')->fetch_all_by_authorid(0, $_G['uid'], true, 'DESC', $start, $perpage, null, $invisible, $fid, $followfid); + $listcount = count($posts); + foreach($posts as $pid => $post) { + $tids[$post['tid']][] = $pid; + $post['message'] = $post['status'] & 1 && $_G['adminid'] != 1 ? '' : (!getstatus($post['status'], 2) || $post['authorid'] == $_G['uid'] ? messagecutstr($post['message'], 100) : ''); + $posts[$pid] = $post; + } + if(!empty($tids)) { + $threads = C::t('forum_thread')->fetch_all_by_tid_displayorder(array_keys($tids), $displayorder, $dglue, array(), $closed); + foreach($threads as $tid => $thread) { + if(!isset($_G['cache']['forums'][$thread['fid']])) { + $gids[$thread['fid']] = $thread['fid']; + } else { + $forumnames[$thread['fid']] = array('fid' => $thread['fid'], 'name' => $_G['cache']['forums'][$thread['fid']]['name']); + } + $threads[$tid] = guide_procthread($thread); + } + if(!empty($gids)) { + $groupforums = C::t('forum_forum')->fetch_all_name_by_fid($gids); + foreach($groupforums as $fid => $val) { + $forumnames[$fid] = $val; + } + } + $list = array(); + foreach($tids as $key => $val) { + $list[$key] = $threads[$key]; + } + unset($threads); + } + } + $multi = simplepage($listcount, $perpage, $_G['page'], $theurl); + return array('forumnames' => $forumnames, 'threadcount' => $listcount, 'threadlist' => $list, 'multi' => $multi, 'tids' => $tids, 'posts' => $posts); +} + +function guide_procthread($thread) { + global $_G; + $todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd')); + $thread['lastposterenc'] = rawurlencode($thread['lastposter']); + $thread['multipage'] = ''; + $topicposts = $thread['special'] ? $thread['replies'] : $thread['replies'] + 1; + if($topicposts > $_G['ppp']) { + $pagelinks = ''; + $thread['pages'] = ceil($topicposts / $_G['ppp']); + for($i = 2; $i <= 6 && $i <= $thread['pages']; $i++) { + $pagelinks .= "$i"; + } + if($thread['pages'] > 6) { + $pagelinks .= "..{$thread['pages']}"; + } + $thread['multipage'] = ' ...'.$pagelinks; + } + + if($thread['highlight']) { + $_G['forum_colorarray'] = $_G['forum_colorarray'] ? $_G['forum_colorarray'] : array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282'); + $string = sprintf('%02d', $thread['highlight']); + $stylestr = sprintf('%03b', $string[0]); + + $thread['highlight'] = ' style="'; + $thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : ''; + $thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : ''; + $thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : ''; + $thread['highlight'] .= $string[1] ? 'color: '.$_G['forum_colorarray'][$string[1]].';' : ''; + $thread['highlight'] .= '"'; + } else { + $thread['highlight'] = ''; + } + + $thread['recommendicon'] = ''; + if(!empty($_G['setting']['recommendthread']['status']) && $thread['recommends']) { + foreach($_G['setting']['recommendthread']['iconlevels'] as $k => $i) { + if($thread['recommends'] > $i) { + $thread['recommendicon'] = $k+1; + break; + } + } + } + + $thread['moved'] = $thread['heatlevel'] = $thread['new'] = 0; + $thread['icontid'] = $thread['forumstick'] || !$thread['moved'] && $thread['isgroup'] != 1 ? $thread['tid'] : $thread['closed']; + $thread['folder'] = 'common'; + $thread['dbdateline'] = $thread['dateline']; + $thread['weeknew'] = TIMESTAMP - 604800 <= $thread['dbdateline']; + if($thread['replies'] > $thread['views']) { + $thread['views'] = $thread['replies']; + } + if($_G['setting']['heatthread']['iconlevels']) { + foreach($_G['setting']['heatthread']['iconlevels'] as $k => $i) { + if($thread['heats'] > $i) { + $thread['heatlevel'] = $k + 1; + break; + } + } + } + $thread['istoday'] = $thread['dateline'] > $todaytime ? 1 : 0; + $thread['dateline'] = dgmdate($thread['dateline'], 'u', '9999', getglobal('setting/dateformat')); + $thread['dblastpost'] = $thread['lastpost']; + $thread['lastpost'] = dgmdate($thread['lastpost'], 'u'); + + if(in_array($thread['displayorder'], array(1, 2, 3, 4))) { + $thread['id'] = 'stickthread_'.$thread['tid']; + } else { + $thread['id'] = 'normalthread_'.$thread['tid']; + } + $thread['rushreply'] = getstatus($thread['status'], 3); + return $thread; +} + +function update_guide_rsscache($type, $perpage) { + global $_G; + $processname = 'guide_rss_cache'; + if(discuz_process::islocked($processname, 600)) { + return false; + } + C::t('forum_rsscache')->delete_by_guidetype($type); + require_once libfile('function/post'); + $data = get_guide_list($type, 0, $perpage); + foreach($data['threadlist'] as $thread) { + $thread['author'] = $thread['author'] != '' ? addslashes($thread['author']) : 'Anonymous'; + $thread['subject'] = addslashes($thread['subject']); + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']); + $attachdata = ''; + if($post['attachment'] == 2) { + $attach = C::t('forum_attachment_n')->fetch_max_image('tid:'.$thread['tid'], 'pid', $post['pid']); + $attachdata = "\t".$attach['remote']."\t".$attach['attachment']."\t".$attach['filesize']; + } + $thread['message'] = $post['message']; + $thread['status'] = $post['status']; + $thread['description'] = $thread['readperm'] > 0 || $thread['price'] > 0 || $thread['status'] & 1 ? '' : addslashes(messagecutstr($thread['message'], 250 - strlen($attachdata)).$attachdata); + C::t('forum_rsscache')->insert(array( + 'lastupdate'=>$_G['timestamp'], + 'fid'=>$thread['fid'], + 'tid'=>$thread['tid'], + 'dateline'=>$thread['dbdateline'], + 'forum'=>strip_tags($data['forumnames'][$thread['fid']]['name']), + 'author'=>$thread['author'], + 'subject'=>$thread['subject'], + 'description'=>$thread['description'], + 'guidetype'=>$type + ), false, true); + } + discuz_process::unlock($processname); + return true; +} +?> \ No newline at end of file diff --git a/source/module/forum/forum_image.php b/source/module/forum/forum_image.php new file mode 100644 index 0000000..38991f0 --- /dev/null +++ b/source/module/forum/forum_image.php @@ -0,0 +1,61 @@ +fetch_attachment('aid:'.$daid, $daid, array(1, -1))) { + if(!$dw && !$dh && $attach['tid'] != $id) { + dheader('location: '.$_G['siteurl'].'static/image/common/none.gif'); + } + dheader('Expires: '.gmdate('D, d M Y H:i:s', TIMESTAMP + 3600).' GMT'); + if($attach['remote']) { + $filename = $_G['setting']['ftp']['attachurl'].'forum/'.$attach['attachment']; + } else { + $filename = $_G['setting']['attachdir'].'forum/'.$attach['attachment']; + } + require_once libfile('class/image'); + $img = new image; + if($img->Thumb($filename, $thumbfile, $w, $h, $type)) { + if($nocache) { + dheader('Content-Type: image'); + @readfile($_G['setting']['attachdir'].$thumbfile); + @unlink($_G['setting']['attachdir'].$thumbfile); + } else { + dheader('location: '.$attachurl.$thumbfile); + } + } else { + dheader('Content-Type: image'); + @readfile($filename); + } +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_index.php b/source/module/forum/forum_index.php new file mode 100644 index 0000000..9cc3404 --- /dev/null +++ b/source/module/forum/forum_index.php @@ -0,0 +1,550 @@ +fetch_all_by_uid_idtype($_G['uid'], 'fid'); + if(!$forum_favlist) { + dsetcookie('nofavfid', 1, 31536000); + } + foreach($forum_favlist as $key => $favorite) { + if(defined('IN_MOBILE')) { + $forum_favlist[$key]['title'] = strip_tags($favorite['title']); + } + $favfids[] = $favorite['id']; + } + if($favfids) { + $favforumlist = C::t('forum_forum')->fetch_all($favfids); + $favforumlist_fields = C::t('forum_forumfield')->fetch_all($favfids); + foreach($favforumlist as $id => $forum) { + if($favforumlist_fields[$forum['fid']]['fid']) { + $favforumlist[$id] = array_merge($forum, $favforumlist_fields[$forum['fid']]); + } + $favforumlist[$id]['extra'] = empty($favforumlist[$id]['extra']) ? array() : dunserialize($favforumlist[$id]['extra']); + if(!is_array($favforumlist[$id]['extra'])) { + $favforumlist[$id]['extra'] = array(); + } + forum($favforumlist[$id]); + } + + } +} + + +if(!$gid && $_G['setting']['collectionstatus'] && ($_G['setting']['collectionrecommendnum'] || !$_G['setting']['hidefollowcollection'])) { + require_once libfile('function/cache'); + loadcache('collection_index'); + $collectionrecommend = dunserialize($_G['setting']['collectionrecommend']); + if(TIMESTAMP - $_G['cache']['collection_index']['dateline'] > 3600 * 4) { + $collectiondata = $followdata = array(); + if($_G['setting']['collectionrecommendnum']) { + if($collectionrecommend['ctids']) { + $collectionrecommend['ctidsKey'] = array_keys($collectionrecommend['ctids']); + $tmpcollection = C::t('forum_collection')->fetch_all($collectionrecommend['ctidsKey']); + foreach($collectionrecommend['ctids'] as $ctid=>$setcollection) { + if($tmpcollection[$ctid]) { + $collectiondata[$ctid] = $tmpcollection[$ctid]; + } + } + unset($tmpcollection, $ctid, $setcollection); + } + if($collectionrecommend['autorecommend']) { + require_once libfile('function/collection'); + $autorecommenddata = getHotCollection(500); + } + } + + savecache('collection_index', array('dateline' => TIMESTAMP, 'data' => $collectiondata, 'auto' => $autorecommenddata)); + $collectiondata = array('data' => $collectiondata, 'auto' => $autorecommenddata); + } else { + $collectiondata = &$_G['cache']['collection_index']; + } + + if($_G['setting']['showfollowcollection']) { + $followcollections = $_G['uid'] ? C::t('forum_collectionfollow')->fetch_all_by_uid($_G['uid']) : array();; + if($followcollections) { + $collectiondata['follows'] = C::t('forum_collection')->fetch_all(array_keys($followcollections), 'dateline', 'DESC', 0, $_G['setting']['showfollowcollection']); + } + } + if($collectionrecommend['autorecommend'] && $collectiondata['auto']) { + $randrecommend = array_rand($collectiondata['auto'], min($collectionrecommend['autorecommend'], count($collectiondata['auto']))); + if($randrecommend && !is_array($randrecommend)) { + $collectiondata['data'][$randrecommend] = $collectiondata['auto'][$randrecommend]; + } else { + foreach($randrecommend as $ctid) { + $collectiondata['data'][$ctid] = $collectiondata['auto'][$ctid]; + } + } + } + if($collectiondata['data']) { + $collectiondata['data'] = array_slice($collectiondata['data'], 0, $collectionrecommend['autorecommend'], true); + } + +} + +if(empty($gid) && empty($_G['member']['accessmasks']) && empty($showoldetails) && !IS_ROBOT) { + $memindex = get_index_memory_by_groupid($_G['member']['groupid']); + extract($memindex); + if(defined('FORUM_INDEX_PAGE_MEMORY') && FORUM_INDEX_PAGE_MEMORY) { + categorycollapse(); + if(!defined('IN_ARCHIVER')) { + include template('diy:forum/discuz'); + } else { + include loadarchiver('forum/discuz'); + } + dexit(); + } +} + +$grids = array(); +if($_G['setting']['grid']['showgrid']) { + loadcache('grids'); + $cachelife = $_G['setting']['grid']['cachelife'] ? $_G['setting']['grid']['cachelife'] : 600; + $now = dgmdate(TIMESTAMP, lang('forum/misc', 'y_m_d')).' '.lang('forum/misc', 'week_'.dgmdate(TIMESTAMP, 'w')); + if(TIMESTAMP - $_G['cache']['grids']['cachetime'] < $cachelife) { + $grids = $_G['cache']['grids']; + } else { + $images = array(); + $_G['setting']['grid']['fids'] = in_array(0, $_G['setting']['grid']['fids']) ? 0 : $_G['setting']['grid']['fids']; + + if($_G['setting']['grid']['gridtype']) { + $grids['digest'] = C::t('forum_thread')->fetch_all_for_guide('digest', 0, array(), 3, 0, 0, 10, $_G['setting']['grid']['fids']); + } else { + $images = C::t('forum_threadimage')->fetch_all_order_by_tid_for_guide(10, 0, $_G['setting']['grid']['fids']); + foreach($images as $key => $value) { + $tids[$value['tid']] = $value['tid']; + } + $grids['image'] = C::t('forum_thread')->fetch_all_by_tid($tids); + } + $grids['newthread'] = C::t('forum_thread')->fetch_all_for_guide('newthread', 0, array(), 0, 0, 0, 10, $_G['setting']['grid']['fids']); + + $grids['newreply'] = C::t('forum_thread')->fetch_all_for_guide('reply', 0, array(), 0, 0, 0, 10, $_G['setting']['grid']['fids']); + $grids['hot'] = C::t('forum_thread')->fetch_all_for_guide('hot', 0, array(), 3, 0, 0, 10, $_G['setting']['grid']['fids']); + + $_G['forum_colorarray'] = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282'); + foreach($grids as $type => $gridthreads) { + foreach($gridthreads as $key => $gridthread) { + $gridthread['dateline'] = str_replace('"', '\'', dgmdate($gridthread['dateline'], 'u', '9999', getglobal('setting/dateformat'))); + $gridthread['lastpost'] = str_replace('"', '\'', dgmdate($gridthread['lastpost'], 'u', '9999', getglobal('setting/dateformat'))); + if($gridthread['highlight'] && $_G['setting']['grid']['highlight']) { + $string = sprintf('%02d', $gridthread['highlight']); + $stylestr = sprintf('%03b', $string[0]); + + $gridthread['highlight'] = ' style="'; + $gridthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : ''; + $gridthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : ''; + $gridthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : ''; + $gridthread['highlight'] .= $string[1] ? 'color: '.$_G['forum_colorarray'][$string[1]] : ''; + $gridthread['highlight'] .= '"'; + } else { + $gridthread['highlight'] = ''; + } + if($_G['setting']['grid']['textleng']) { + $gridthread['oldsubject'] = dhtmlspecialchars($gridthread['subject']); + $gridthread['subject'] = cutstr($gridthread['subject'], $_G['setting']['grid']['textleng']); + } + + $grids[$type][$key] = $gridthread; + } + } + if(!$_G['setting']['grid']['gridtype']) { + + $grids['slide'] = $focuspic = $focusurl = $focustext = array(); + $grids['focus'] = 'config=5|0xffffff|0x0099ff|50|0xffffff|0x0099ff|0x000000'; + foreach($grids['image'] as $ithread) { + if($ithread['displayorder'] < 0) { + continue; + } + if($images[$ithread['tid']]['remote']) { + $imageurl = $_G['setting']['ftp']['attachurl'].'forum/'.$images[$ithread['tid']]['attachment']; + } else { + $imageurl = $_G['setting']['attachurl'].'forum/'.$images[$ithread['tid']]['attachment']; + } + $grids['slide'][$ithread['tid']] = array( + 'image' => $imageurl, + 'url' => 'forum.php?mod=viewthread&tid='.$ithread['tid'], + 'subject' => addslashes($ithread['subject']) + ); + } + $grids['slide'] = array_reverse($grids['slide'], true); + } + $grids['cachetime'] = TIMESTAMP; + savecache('grids', $grids); + } +} + +if(!$gid && (!defined('FORUM_INDEX_PAGE_MEMORY') || !FORUM_INDEX_PAGE_MEMORY)) { + $announcements = get_index_announcements(); + + + $forums = C::t('forum_forum')->fetch_all_by_status(1); + $fids = array(); + foreach($forums as $forum) { + $fids[$forum['fid']] = $forum['fid']; + } + + $forum_access = array(); + if(!empty($_G['member']['accessmasks'])) { + $forum_access = C::t('forum_access')->fetch_all_by_fid_uid($fids, $_G['uid']); + } + + $forum_fields = C::t('forum_forumfield')->fetch_all($fids); + + foreach($forums as $forum) { + if($forum_fields[$forum['fid']]['fid']) { + $forum = (array_key_exists('fid', $forum) && array_key_exists($forum['fid'], $forum_fields)) ? array_merge($forum, $forum_fields[$forum['fid']]) : $forum; + } + if(!empty($forum_access['fid'])) { + $forum = (array_key_exists('fid', $forum) && array_key_exists($forum['fid'], $forum_access)) ? array_merge($forum, $forum_access[$forum['fid']]) : $forum; + } + $forumname[$forum['fid']] = strip_tags($forum['name']); + $forum['extra'] = empty($forum['extra']) ? array() : dunserialize($forum['extra']); + if(!is_array($forum['extra'])) { + $forum['extra'] = array(); + } + + if($forum['type'] != 'group') { + + $threads += $forum['threads']; + $posts += $forum['posts']; + $todayposts += $forum['todayposts']; + + if($forum['type'] == 'forum' && isset($catlist[$forum['fup']])) { + if(forum($forum)) { + $catlist[$forum['fup']]['forums'][] = $forum['fid']; + $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++; + $forum['subforums'] = ''; + $forumlist[$forum['fid']] = $forum; + } + + } elseif(isset($forumlist[$forum['fup']])) { + + $forumlist[$forum['fup']]['threads'] += $forum['threads']; + $forumlist[$forum['fup']]['posts'] += $forum['posts']; + $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts']; + if($_G['setting']['subforumsindex'] && $forumlist[$forum['fup']]['permission'] == 2 && !($forumlist[$forum['fup']]['simple'] & 16) || ($forumlist[$forum['fup']]['simple'] & 8)) { + $forumurl = !empty($forum['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? $_G['scheme'].'://'.$forum['domain'].'.'.$_G['setting']['domain']['root']['forum'] : 'forum.php?mod=forumdisplay&fid='.$forum['fid']; + $forumlist[$forum['fup']]['subforums'] .= (empty($forumlist[$forum['fup']]['subforums']) ? '' : ', ').''.$forum['name'].''; + } + } + + } else { + + if($forum['moderators']) { + $forum['moderators'] = moddisplay($forum['moderators'], 'flat'); + } + $forum['forumscount'] = 0; + $catlist[$forum['fid']] = $forum; + + } + } + unset($forum_access, $forum_fields); + + foreach($catlist as $catid => $category) { + $catlist[$catid]['collapseimg'] = 'collapsed_no.gif'; + $catlist[$catid]['collapseicon'] = '_no'; + if($catlist[$catid]['forumscount'] && $category['forumcolumns']) { + $catlist[$catid]['forumcolwidth'] = (floor(100 / $category['forumcolumns']) - 0.1).'%'; + $catlist[$catid]['endrows'] = ''; + if($colspan = $category['forumscount'] % $category['forumcolumns']) { + while(($category['forumcolumns'] - $colspan) > 0) { + $catlist[$catid]['endrows'] .= ' '; + $colspan ++; + } + } + } elseif(empty($category['forumscount'])) { + unset($catlist[$catid]); + } + } + unset($catid, $category); + + if(isset($catlist[0]) && $catlist[0]['forumscount']) { + $catlist[0]['fid'] = 0; + $catlist[0]['type'] = 'group'; + $catlist[0]['name'] = $_G['setting']['bbname']; + $catlist[0]['collapseimg'] = 'collapsed_no.gif'; + $catlist[0]['collapseicon'] = '_no'; + } else { + unset($catlist[0]); + } + + if(!IS_ROBOT && ($_G['setting']['whosonlinestatus'] == 1 || $_G['setting']['whosonlinestatus'] == 3)) { + $_G['setting']['whosonlinestatus'] = 1; + + $onlineinfo = explode("\t", $_G['cache']['onlinerecord']); + if(empty($_G['cookie']['onlineusernum'])) { + $onlinenum = C::app()->session->count(); + if($onlinenum > $onlineinfo[0]) { + $onlinerecord = "$onlinenum\t".TIMESTAMP; + C::t('common_setting')->update_setting('onlinerecord', $onlinerecord); + savecache('onlinerecord', $onlinerecord); + $onlineinfo = array($onlinenum, TIMESTAMP); + } + dsetcookie('onlineusernum', intval($onlinenum), 300); + } else { + $onlinenum = intval($_G['cookie']['onlineusernum']); + } + $onlineinfo[1] = dgmdate($onlineinfo[1], 'd'); + + $detailstatus = $showoldetails == 'yes' || (((!isset($_G['cookie']['onlineindex']) && !$_G['setting']['whosonline_contract']) || $_G['cookie']['onlineindex']) && $onlinenum < 500 && !$showoldetails); + + $guestcount = $membercount = $invisiblecount = 0; + if(!empty($_G['setting']['sessionclose'])) { + $detailstatus = false; + $membercount = C::app()->session->count(1); + $guestcount = $onlinenum - $membercount; + } + + if($detailstatus) { + $actioncode = lang('action'); + + $_G['uid'] && updatesession(); + $whosonline = array(); + + $_G['setting']['maxonlinelist'] = $_G['setting']['maxonlinelist'] ? $_G['setting']['maxonlinelist'] : 500; + foreach(C::app()->session->fetch_member(1, 0, $_G['setting']['maxonlinelist']) as $online){ + $membercount ++; + if($online['invisible']) { + $invisiblecount++; + continue; + } else { + $online['icon'] = !empty($_G['cache']['onlinelist'][$online['groupid']]) ? $_G['cache']['onlinelist'][$online['groupid']] : $_G['cache']['onlinelist'][0]; + } + $online['lastactivity'] = dgmdate($online['lastactivity'], 't'); + $whosonline[] = $online; + } + if(isset($_G['cache']['onlinelist'][7]) && $_G['setting']['maxonlinelist'] > $membercount) { + foreach(C::app()->session->fetch_member(2, 0, $_G['setting']['maxonlinelist'] - $membercount) as $online){ + $online['icon'] = $_G['cache']['onlinelist'][7]; + $online['username'] = $_G['cache']['onlinelist']['guest']; + $online['lastactivity'] = dgmdate($online['lastactivity'], 't'); + $whosonline[] = $online; + } + } + unset($actioncode, $online); + + if($onlinenum > $_G['setting']['maxonlinelist']) { + $membercount = C::app()->session->count(1); + $invisiblecount = C::app()->session->count_invisible(); + } + + if($onlinenum < $membercount) { + $onlinenum = C::app()->session->count(); + dsetcookie('onlineusernum', intval($onlinenum), 300); + } + + $invisiblecount = intval($invisiblecount); + $guestcount = $onlinenum - $membercount; + + unset($online); + } + + } else { + $_G['setting']['whosonlinestatus'] = 0; + } + + if(defined('FORUM_INDEX_PAGE_MEMORY') && !FORUM_INDEX_PAGE_MEMORY) { + $key = !IS_ROBOT ? $_G['member']['groupid'] : 'for_robot'; + memory('set', 'forum_index_page_'.$key, array( + 'catlist' => $catlist, + 'forumlist' => $forumlist, + 'sublist' => $sublist, + 'whosonline' => $whosonline, + 'onlinenum' => $onlinenum, + 'membercount' => $membercount, + 'guestcount' => $guestcount, + 'grids' => $grids, + 'announcements' => $announcements, + 'threads' => $threads, + 'posts' => $posts, + 'todayposts' => $todayposts, + 'onlineinfo' => $onlineinfo, + 'announcepm' => $announcepm), getglobal('setting/memory/forumindex')); + } + +} else { + require_once DISCUZ_ROOT.'./source/include/misc/misc_category.php'; +} + + +if(defined('IN_ARCHIVER')) { + include loadarchiver('forum/discuz'); + exit(); +} +categorycollapse(); + +if($gid && !empty($catlist)) { + $_G['category'] = $catlist[$gid]; + $forumseoset = array( + 'seotitle' => $catlist[$gid]['seotitle'], + 'seokeywords' => $catlist[$gid]['keywords'], + 'seodescription' => $catlist[$gid]['seodescription'] + ); + $seodata = array('fgroup' => $catlist[$gid]['name']); + list($navtitle, $metadescription, $metakeywords) = get_seosetting('threadlist', $seodata, $forumseoset); + if(empty($navtitle)) { + $navtitle = $navtitle_g; + $nobbname = false; + } else { + $nobbname = true; + } + $_G['fid'] = $gid; +} + +include template('diy:forum/discuz:'.$gid); + +function get_index_announcements() { + global $_G; + $announcements = ''; + if($_G['cache']['announcements']) { + $readapmids = !empty($_G['cookie']['readapmid']) ? explode('D', $_G['cookie']['readapmid']) : array(); + foreach($_G['cache']['announcements'] as $announcement) { + if(!$announcement['endtime'] || $announcement['endtime'] > TIMESTAMP && (empty($announcement['groups']) || in_array($_G['member']['groupid'], $announcement['groups']))) { + if(empty($announcement['type'])) { + $announcements .= '
        • '.$announcement['subject']. + '('.dgmdate($announcement['starttime'], 'd').')
        • '; + } elseif($announcement['type'] == 1) { + $announcements .= '
        • '.$announcement['subject']. + '('.dgmdate($announcement['starttime'], 'd').')
        • '; + } + } + } + } + return $announcements; +} + +function get_index_page_guest_cache() { + global $_G; + $indexcache = getcacheinfo(0); + if(TIMESTAMP - $indexcache['filemtime'] > $_G['setting']['cacheindexlife']) { + @unlink($indexcache['filename']); + define('CACHE_FILE', $indexcache['filename']); + } elseif($indexcache['filename']) { + $start_time = microtime(TRUE); + $filemtime = $indexcache['filemtime']; + ob_start(function($input) use (&$filemtime) { + return replace_formhash($filemtime, $input); + }); + readfile($indexcache['filename']); + $updatetime = dgmdate($filemtime, 'Y-m-d H:i:s'); + $debuginfo = ", Updated at $updatetime"; + if(getglobal('setting/debug')) { + $gzip = $_G['gzipcompress'] ? ', Gzip On' : ''; + $debuginfo .= ', Processed in '.sprintf("%0.6f", microtime(TRUE) - $start_time).' second(s)'.$gzip; + } + echo ''; + ob_end_flush(); + exit(); + } +} + +function get_index_memory_by_groupid($key) { + $enable = getglobal('setting/memory/forumindex'); + if($enable !== null && memory('check')) { + if(IS_ROBOT) { + $key = 'for_robot'; + } + $ret = memory('get', 'forum_index_page_'.$key); + define('FORUM_INDEX_PAGE_MEMORY', $ret ? 1 : 0); + if($ret) { + return $ret; + } + } + return array('none' => null); +} + +function get_index_online_details() { + $showoldetails = getgpc('showoldetails'); + switch($showoldetails) { + case 'no': dsetcookie('onlineindex', ''); break; + case 'yes': dsetcookie('onlineindex', 1, 86400 * 365); break; + } + return $showoldetails; +} + +function do_forum_bind_domains() { + global $_G; + if($_G['setting']['binddomains'] && $_G['setting']['forumdomains']) { + $loadforum = isset($_G['setting']['binddomains'][$_SERVER['HTTP_HOST']]) ? max(0, intval($_G['setting']['binddomains'][$_SERVER['HTTP_HOST']])) : 0; + if($loadforum) { + dheader('Location: '.$_G['setting']['siteurl'].'/forum.php?mod=forumdisplay&fid='.$loadforum); + } + } +} + +function categorycollapse() { + global $_G, $collapse, $catlist; + if(!$_G['uid']) { + return; + } + foreach($catlist as $fid => $forum) { + if(!isset($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], '_category_'.$fid.'_') === FALSE) { + $catlist[$fid]['collapseimg'] = 'collapsed_no.gif'; + $catlist[$fid]['collapseicon'] = '_no'; + $collapse['category_'.$fid] = ''; + } else { + $catlist[$fid]['collapseimg'] = 'collapsed_yes.gif'; + $catlist[$fid]['collapseicon'] = '_yes'; + $collapse['category_'.$fid] = 'display: none'; + } + } + + for($i = -2; $i <= 0; $i++) { + if(!isset($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], '_category_'.$i.'_') === FALSE) { + $collapse['collapseimg_'.$i] = 'collapsed_no.gif'; + $collapse['collapseicon_'.$i] = '_no'; + $collapse['category_'.$i] = ''; + } else { + $collapse['collapseimg_'.$i] = 'collapsed_yes.gif'; + $collapse['collapseicon_'.$i] = '_yes'; + $collapse['category_'.$i] = 'display: none'; + } + } +} +?> \ No newline at end of file diff --git a/source/module/forum/forum_misc.php b/source/module/forum/forum_misc.php new file mode 100644 index 0000000..5536957 --- /dev/null +++ b/source/module/forum/forum_misc.php @@ -0,0 +1,1895 @@ +fetch_attachment('aid:'.$aid, $aid); + $thread = C::t('forum_thread')->fetch_by_tid_displayorder($attach['tid'], 0); + + checklowerlimit('getattach', 0, 1, $thread['fid']); + $getattachcredits = updatecreditbyaction('getattach', $_G['uid'], array(), '', 1, 1, $thread['fid']); + $_G['policymsg'] = $p = ''; + if($getattachcredits['updatecredit']) { + if($getattachcredits['updatecredit']) for($i = 1;$i <= 8;$i++) { + if($policy = $getattachcredits['extcredits'.$i]) { + $_G['policymsg'] .= $p.($_G['setting']['extcredits'][$i]['img'] ? $_G['setting']['extcredits'][$i]['img'].' ' : '').$_G['setting']['extcredits'][$i]['title'].' '.$policy.' '.$_G['setting']['extcredits'][$i]['unit']; + $p = ', '; + } + } + } + + $ck = substr(md5($aid.TIMESTAMP.md5($_G['config']['security']['authkey'])), 0, 8); + $aidencode = aidencode($aid, 0, $attach['tid']); + showmessage('attachment_credit', "forum.php?mod=attachment&aid=$aidencode&ck=$ck", array('policymsg' => $_G['policymsg'], 'filename' => $attach['filename']), array('redirectmsg' => 1, 'login' => 1)); + +} elseif($_GET['action'] == 'attachpay') { + $aid = intval($_GET['aid']); + if(!$aid) { + showmessage('parameters_error'); + } elseif(!isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]])) { + showmessage('credits_transaction_disabled'); + } elseif(!$_G['uid']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } else { + $attachtable = !empty($_GET['tid']) ? 'tid:'.dintval($_GET['tid']) : 'aid:'.$aid; + $attach = C::t('forum_attachment_n')->fetch_attachment($attachtable, $aid); + $attachmember = getuserbyuid($attach['uid']); + $attach['author'] = $attachmember['username']; + if($attach['price'] <= 0) { + showmessage('undefined_action'); + } + } + + if($attach['readperm'] && $attach['readperm'] > $_G['group']['readaccess']) { + showmessage('attachment_forum_nopermission', NULL, array(), array('login' => 1)); + } + + $balance = getuserprofile('extcredits'.$_G['setting']['creditstransextra'][1]); + $status = $balance < $attach['price'] ? 1 : 0; + + if($_G['adminid'] == 3) { + $fid = C::t('forum_thread')->fetch_thread($attach['tid']); + $fid = $fid['fid']; + $ismoderator = C::t('forum_moderator')->fetch_uid_by_fid_uid($fid, $_G['uid']); + } elseif(in_array($_G['adminid'], array(1, 2))) { + $ismoderator = 1; + } else { + $ismoderator = 0; + } + $exemptvalue = $ismoderator ? 64 : 8; + if($_G['uid'] == $attach['uid'] || $_G['group']['exempt'] & $exemptvalue) { + $status = 2; + } else { + $payrequired = $_G['uid'] ? !C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BAC', $attach['aid']) : 1; + $status = $payrequired ? $status : 2; + } + $balance = $status != 2 ? $balance - $attach['price'] : $balance; + + $sidauth = rawurlencode(authcode($_G['sid'], 'ENCODE', $_G['authkey'])); + + $aidencode = aidencode($aid, 0, $attach['tid']); + + if(C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BAC', $aid)) { + showmessage('attachment_yetpay', "forum.php?mod=attachment&aid=$aidencode", array(), array('redirectmsg' => 1)); + } + + $attach['netprice'] = $status != 2 ? round($attach['price'] * (1 - $_G['setting']['creditstax'])) : 0; + $lockid = 'attachpay_'.$_G['uid']; + if(!submitcheck('paysubmit')) { + $post = C::t('forum_post')->fetch('tid:'.$attach['tid'], $attach['pid']); + if($post['anonymous'] && !$_G['forum']['ismoderator']) { + $attach['uid'] = 0; + $attach['author'] = $_G['setting']['anonymoustext']; + } + include template('forum/attachpay'); + } elseif(!discuz_process::islocked($lockid)) { + if(!empty($_GET['buyall'])) { + $aids = $prices = array(); + $tprice = 0; + foreach(C::t('forum_attachment_n')->fetch_all_by_id('aid:'.$aid, 'pid', $attach['pid'], '', false, true) as $tmp) { + $aids[$tmp['aid']] = $tmp['aid']; + $prices[$tmp['aid']] = $status != 2 ? array($tmp['price'], round($tmp['price'] * (1 - $_G['setting']['creditstax']))) : array(0, 0); + } + if($aids) { + foreach(C::t('common_credit_log')->fetch_all_by_uid_operation_relatedid($_G['uid'], 'BAC', $aids) as $tmp) { + unset($aids[$tmp['relatedid']]); + } + } + foreach($aids as $aid) { + $tprice += $prices[$aid][0]; + } + $status = getuserprofile('extcredits'.$_G['setting']['creditstransextra'][1]) < $tprice ? 1 : 0; + } else { + $aids = array($aid); + $prices[$aid] = $status != 2 ? array($attach['price'], $attach['netprice']) : array(0, 0); + } + + if($status == 1) { + discuz_process::unlock($lockid); + showmessage('credits_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'minbalance' => (empty($_GET['buyall']) ? $attach['price'] : $tprice))); + } + foreach($aids as $aid) { + $updateauthor = 1; + $authorEarn = $prices[$aid][1]; + if($_G['setting']['maxincperthread'] > 0) { + $extcredit = 'extcredits'.$_G['setting']['creditstransextra'][1]; + $alog = C::t('common_credit_log')->count_credit_by_uid_operation_relatedid($attach['uid'], 'SAC', $aid, $_G['setting']['creditstransextra'][1]); + if($alog >= $_G['setting']['maxincperthread']) { + $updateauthor = 0; + } else { + $authorEarn = min($_G['setting']['maxincperthread'] - $alog['credit'], $prices[$aid][1]); + } + } + if($updateauthor) { + updatemembercount($attach['uid'], array($_G['setting']['creditstransextra'][1] => $authorEarn), 1, 'SAC', $aid); + } + updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][1] => -$prices[$aid][0]), 1, 'BAC', $aid); + + $aidencode = aidencode($aid, 0, $_GET['tid']); + } + discuz_process::unlock($lockid); + if(defined('IN_MOBILE')) { + showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']); + } else { + if(count($aids) > 1) { + showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']); + } else { + $_G['forum_attach_filename'] = $attach['filename']; + showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1)); + } + } + } else { + showmessage('attachment_locked'); + } + +} elseif($_GET['action'] == 'viewattachpayments') { + + $aid = intval($_GET['aid']); + $extcreditname = 'extcredits'.$_G['setting']['creditstransextra'][1]; + + $loglist = array(); + $logs = C::t('common_credit_log')->fetch_all_by_uid_operation_relatedid(0, 'BAC', $aid); + $luids = array(); + foreach($logs as $log) { + $luids[$log['uid']] = $log['uid']; + } + $members = C::t('common_member')->fetch_all($luids); + foreach($logs as $log) { + $log['username'] = $members[$log['uid']]['username']; + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log[$extcreditname] = abs($log[$extcreditname]); + $loglist[] = $log; + } + include template('forum/attachpay_view'); + +} elseif($_GET['action'] == 'getonlines') { + + $num = C::app()->session->count(); + showmessage($num); + +} elseif($_GET['action'] == 'upload') { + + $type = !empty($_GET['type']) && in_array($_GET['type'], array('image', 'file')) ? $_GET['type'] : 'image'; + $attachexts = $imgexts = ''; + $_G['group']['allowpostattach'] = $_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || (!$_G['forum']['postattachperm'] && $_G['group']['allowpostattach']) || ($_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm']))); + $_G['group']['allowpostimage'] = $_G['forum']['allowpostimage'] != -1 && ($_G['forum']['allowpostimage'] == 1 || (!$_G['forum']['postimageperm'] && $_G['group']['allowpostimage']) || ($_G['forum']['postimageperm'] && forumperm($_G['forum']['postimageperm']))); + $_G['group']['attachextensions'] = $_G['forum']['attachextensions'] ? $_G['forum']['attachextensions'] : $_G['group']['attachextensions']; + if($_G['group']['attachextensions']) { + $imgexts = explode(',', str_replace(' ', '', $_G['group']['attachextensions'])); + $imgexts = array_intersect(array('jpg','jpeg','gif','png','bmp','webp'), $imgexts); + $imgexts = implode(', ', $imgexts); + } else { + $imgexts = 'jpg, jpeg, gif, png, bmp, webp'; + } + if($type == 'image' && (!$_G['group']['allowpostimage'] || !$imgexts)) { + showmessage('no_privilege_postimage'); + } + if($type == 'file' && !$_G['group']['allowpostattach']) { + showmessage('no_privilege_postattach'); + } + include template('forum/upload'); + +} elseif($_GET['action'] == 'comment') { + + if(!$_G['setting']['commentnumber']) { + showmessage('postcomment_closed'); + } + $thread = C::t('forum_thread')->fetch_thread($_GET['tid']); + if($thread['closed'] && !$_G['forum']['ismoderator']) { + showmessage('thread_closed'); + } + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid']); + if($_G['group']['allowcommentitem'] && !empty($_G['uid']) && $post['authorid'] != $_G['uid']) { + $thread = C::t('forum_thread')->fetch_thread($post['tid']); + $itemi = $thread['special']; + if($thread['special'] > 0) { + if($thread['special'] == 2){ + $thread['special'] = $post['first'] || C::t('forum_trade')->check_goods($post['pid']) ? 2 : 0; + } elseif($thread['special'] == 127) { + $thread['special'] = $_GET['special']; + } else { + $thread['special'] = $post['first'] ? $thread['special'] : 0; + } + } + $_G['setting']['commentitem'] = $_G['setting']['commentitem'][$thread['special']]; + if($thread['special'] == 0) { + loadcache('forums'); + if($_G['cache']['forums'][$post['fid']]['commentitem']) { + $_G['setting']['commentitem'] = $_G['cache']['forums'][$post['fid']]['commentitem']; + } + } + if($_G['setting']['commentitem'] && !C::t('forum_postcomment')->count_by_pid($_GET['pid'], $_G['uid'], 1)) { + $commentitem = explode("\n", $_G['setting']['commentitem']); + } + } + if(!$post || !($_G['setting']['commentpostself'] || $post['authorid'] != $_G['uid']) || !(($post['first'] && $_G['setting']['commentfirstpost'] && in_array($_G['group']['allowcommentpost'], array(1, 3)) || (!$post['first'] && in_array($_G['group']['allowcommentpost'], array(2, 3)))))) { + showmessage('postcomment_error'); + } + $extra = !empty($_GET['extra']) ? rawurlencode($_GET['extra']) : ''; + list($seccodecheck, $secqaacheck) = seccheck('post', 'reply'); + + include template('forum/comment'); + +} elseif($_GET['action'] == 'commentmore') { + + function forum_misc_commentmore_callback_1($matches, $action = 0) { + static $cic = 0; + + if($action == 1) { + $cic = $matches; + } else { + return ''.sprintf('%1.1f', $matches[1]).''.str_repeat('',intval($matches[1])).str_repeat('',(5-intval($matches[1]))).($cic++ % 2 ? '
          ' : ''); + } + } + + if(!$_G['setting']['commentnumber'] || !$_G['inajax']) { + showmessage('postcomment_closed'); + } + require_once libfile('function/discuzcode'); + $commentlimit = intval($_G['setting']['commentnumber']); + $page = max(1, $_G['page']); + $start_limit = ($page - 1) * $commentlimit; + $comments = array(); + foreach(C::t('forum_postcomment')->fetch_all_by_search(null, $_GET['pid'], null, null, null, null, null, $start_limit, $commentlimit) as $comment) { + $comment['avatar'] = avatar($comment['authorid'], 'small'); + $comment['dateline'] = dgmdate($comment['dateline'], 'u'); + $comment['comment'] = str_replace(array('[b]', '[/b]', '[/color]'), array('', '', '
          '), preg_replace("/\[color=([#\w]+?)\]/i", "", $comment['comment'])); + $comments[] = $comment; + } + forum_misc_commentmore_callback_1(0, 1); + $totalcomment = C::t('forum_postcomment')->fetch_standpoint_by_pid($_GET['pid']); + $totalcomment = $totalcomment['comment']; + $totalcomment = preg_replace_callback('/([\.\d]+)<\/i>/', 'forum_misc_commentmore_callback_1', $totalcomment); + $count = C::t('forum_postcomment')->count_by_search(null, $_GET['pid']); + $multi = multi($count, $commentlimit, $page, "forum.php?mod=misc&action=commentmore&tid={$_G['tid']}&pid={$_GET['pid']}"); + include template('forum/comment_more'); + +} elseif($_GET['action'] == 'postappend') { + + if(!$_G['setting']['postappend']) { + showmessage('postappend_not_open'); + } + + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid']); + if($post['authorid'] != $_G['uid']) { + showmessage('postappend_only_yourself'); + } + if(submitcheck('postappendsubmit')) { + $message = censor($_GET['postappendmessage']); + $sppos = 0; + if($post['first'] && strexists($post['message'], chr(0).chr(0).chr(0))) { + $sppos = strpos($post['message'], chr(0).chr(0).chr(0)); + $specialextra = substr($post['message'], $sppos + 3); + $post['message'] = substr($post['message'], 0, $sppos); + } + $message = $post['message'] . "\n\n[b]".lang('forum/misc', 'postappend_content')." (".dgmdate(TIMESTAMP)."):[/b]\n$message"; + if($sppos) { + $message .= chr(0).chr(0).chr(0).$specialextra; + } + require_once libfile('function/post'); + $bbcodeoff = checkbbcodes($message, 0); + C::t('forum_post')->update_post('tid:'.$_G['tid'], $_GET['pid'], array( + 'message' => $message, + 'bbcodeoff' => $bbcodeoff, + 'port' => $_G['remoteport'] + )); + showmessage('postappend_add_succeed', "forum.php?mod=viewthread&tid={$post['tid']}&pid={$post['pid']}&page={$_GET['page']}&extra={$_GET['extra']}#pid{$post['pid']}", array('tid' => $post['tid'], 'pid' => $post['pid'])); + } else { + include template('forum/postappend'); + } + +} elseif($_GET['action'] == 'pubsave') { + + $return = threadpubsave($_G['tid']); + if($return > 0) { + showmessage('post_newthread_succeed', dreferer(), array('coverimg' => '')); + } elseif($return == -1) { + showmessage('post_newthread_mod_succeed', dreferer(), array('coverimg' => '')); + } elseif($return == -2) { + showmessage('post_reply_mod_succeed', dreferer()); + } else { + showmessage('thread_nonexistence'); + } + +} elseif($_GET['action'] == 'loadsave') { + + $message = ' '; + $savepost = C::t('forum_post')->fetch_post(0, $_GET['pid']); + if($savepost && $_G['uid'] == $savepost['authorid']) { + $message = $savepost['message']; + if($_GET['type']) { + require_once libfile('function/discuzcode'); + $message = discuzcode($message, $savepost['smileyoff'], $savepost['bbcodeoff'], $savepost['htmlon']); + } + $message = $message ? $message : ' '; + } + include template('common/header_ajax'); + echo $message; + include template('common/footer_ajax'); + exit; + +} elseif($_GET['action'] == 'replynotice') { + $tid = intval($_GET['tid']); + $status = $_GET['op'] == 'ignore' ? 0 : 1; + if(!empty($tid)) { + $thread = C::t('forum_thread')->fetch_by_tid_displayorder($tid, 0); + if($thread['authorid'] == $_G['uid']) { + $thread['status'] = setstatus(6, $status, $thread['status']); + C::t('forum_thread')->update($tid, array('status'=>$thread['status']), true); + showmessage('replynotice_success_'.$status); + } + } + showmessage('replynotice_error', 'forum.php?mod=viewthread&tid='.$tid); + +} elseif($_GET['action'] == 'removeindexheats') { + + if($_G['adminid'] != 1) { + showmessage('no_privilege_indexheats'); + } + C::t('forum_thread')->update($_G['tid'], array('heats'=>0)); + require_once libfile('function/cache'); + updatecache('heats'); + dheader('Location: '.dreferer()); + +} elseif($_GET['action'] == 'showdarkroom') { + + include_once libfile('class/member'); + if($_G['setting']['darkroom']) { + $limit = $_G['tpp']; + $cid = getgpc('cid') ? dintval($_GET['cid']) : 0; + $crimelist = array(); + $i = 0; + foreach(C::t('common_member_crime')->fetch_all_by_cid($cid, array(4, 5), $limit) as $crime) { + $i++; + $cid = $crime['cid']; + if(isset($crimelist[$crime['uid']])) { + continue; + } + $crime['action'] = lang('forum/template', crime_action_ctl::$actions[$crime['action']]); + $crime['dateline'] = dgmdate($crime['dateline'], 'u'); + $crimelist[$crime['uid']] = $crime; + } + if($crimelist && $i == $limit) { + $dataexist = 1; + } else { + $dataexist = 0; + } + foreach(C::t('common_member')->fetch_all(array_keys($crimelist)) as $uid => $user) { + if($user['groupid'] == 4 || $user['groupid'] == 5) { + $crimelist[$uid]['username'] = $user['username']; + $crimelist[$uid]['groupexpiry'] = $user['groupexpiry'] ? dgmdate($user['groupexpiry'], 'u') : lang('forum/misc', 'never_expired'); + } else { + unset($crimelist[$uid]); + } + } + if(getgpc('ajaxdata') === 'json') { + showmessage($dataexist.'|'.$cid, '', $crimelist); + } else { + include_once template("forum/darkroom"); + } + exit; + } + showmessage('undefined_action'); +} elseif($_GET['action'] == 'shortcut') { + + if($_GET['type'] == 'ico') { + $shortcut = @readfile(DISCUZ_ROOT.'favicon.ico'); + $filename = 'favicon.ico'; + } else { + $shortcut = '[InternetShortcut] +URL='.$_G['siteurl'].' +IconFile='.$_G['siteurl'].'favicon.ico +IconIndex=1 +'; + $filename = $_G['setting']['bbname'].'.url'; + } + + $filenameencode = strtolower(CHARSET) == 'utf-8' ? rawurlencode($filename) : rawurlencode(diconv($filename, CHARSET, 'UTF-8')); + $rfc6266blacklist = strexists($_SERVER['HTTP_USER_AGENT'], 'UCBrowser') || strexists($_SERVER['HTTP_USER_AGENT'], 'Quark') || strexists($_SERVER['HTTP_USER_AGENT'], 'SogouM') || strexists($_SERVER['HTTP_USER_AGENT'], 'baidu'); + dheader('Content-type: application/octet-stream'); + dheader('Content-Disposition: attachment; filename="'.$filenameencode.'"'.(($filename == $filenameencode || $rfc6266blacklist) ? '' : '; filename*=utf-8\'\''.$filenameencode)); + echo $shortcut; + exit; +} elseif($_GET['action'] == 'livelastpost') { + $fid = dintval($_GET['fid']); + $forum = C::t('forum_forumfield')->fetch($fid); + $livetid = $forum['livetid']; + $postlist = array(); + if($livetid) { + $thread = C::t('forum_thread')->fetch_thread($livetid); + $postlist['count'] = $thread['replies']; + $postarr = C::t('forum_post')->fetch_all_by_tid('tid:'.$livetid, $livetid, true, 'DESC', 20); + ksort($postarr); + foreach($postarr as $post) { + if($post['first'] == 1 || getstatus($post['status'], 1)) { + continue; + } + $contentarr = array( + 'authorid' => !$post['anonymous'] ? $post['authorid'] : '', + 'author' => !$post['anonymous'] ? $post['author'] : lang('forum/misc', 'anonymous'), + 'message' => str_replace("\r\n", '
          ', messagecutstr($post['message'])), + 'dateline' => dgmdate($post['dateline'], 'u'), + 'avatar' => !$post['anonymous'] ? avatar($post['authorid'], 'small') : '', + ); + $postlist['list'][$post['pid']] = $contentarr; + } + } + + showmessage('', '', $postlist); + exit; + +} else { + + if(empty($_G['forum']['allowview'])) { + if(!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } elseif($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) { + showmessage('forum_nopermission', NULL, array($_G['group']['grouptitle']), array('login' => 1)); + } + } + + $thread = C::t('forum_thread')->fetch_thread($_G['tid']); + if(!($thread['displayorder']>=0 || $thread['displayorder']==-4 && $thread['authorid']==$_G['uid'])) { + $thread = array(); + } + if($thread['readperm'] && $thread['readperm'] > $_G['group']['readaccess'] && !$_G['forum']['ismoderator'] && $thread['authorid'] != $_G['uid']) { + showmessage('thread_nopermission', NULL, array('readperm' => $thread['readperm']), array('login' => 1)); + } + + if($_G['forum']['password'] && $_G['forum']['password'] != $_G['cookie']['fidpw'.$_G['fid']]) { + showmessage('forum_passwd', "forum.php?mod=forumdisplay&fid={$_G['fid']}"); + } + + + if(!$thread) { + showmessage('thread_nonexistence'); + } + + if($_G['forum']['type'] == 'forum') { + $navigation = ''.$_G['setting']['navs'][2]['navname']." ".$_G['forum']['name']." {$thread['subject']} "; + $navtitle = strip_tags($_G['forum']['name']).' - '.$thread['subject']; + } elseif($_G['forum']['type'] == 'sub') { + $fup = C::t('forum_forum')->fetch($_G['forum']['fup']); + $navigation = ''.$_G['setting']['navs'][2]['navname']." {$fup['name']} » ".$_G['forum']['name']." {$thread['subject']} "; + $navtitle = strip_tags($fup['name']).' - '.strip_tags($_G['forum']['name']).' - '.$thread['subject']; + } + +} + +if($_GET['action'] == 'votepoll' && submitcheck('pollsubmit', 1)) { + + if(!$_G['group']['allowvote']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } elseif(!empty($thread['closed'])) { + showmessage('thread_poll_closed', NULL, array(), array('login' => 1)); + } elseif(empty($_GET['pollanswers'])) { + showmessage('thread_poll_invalid', NULL, array(), array('login' => 1)); + } + + $pollarray = C::t('forum_poll')->fetch($_G['tid']); + $overt = $pollarray['overt']; + if(!$pollarray) { + showmessage('poll_not_found'); + } elseif($pollarray['expiration'] && $pollarray['expiration'] < TIMESTAMP) { + showmessage('poll_overdue', NULL, array(), array('login' => 1)); + } elseif($pollarray['maxchoices'] && $pollarray['maxchoices'] < count($_GET['pollanswers'])) { + showmessage('poll_choose_most', NULL, array('maxchoices' => $pollarray['maxchoices']), array('login' => 1)); + } + + $voterids = $_G['uid'] ? $_G['uid'] : $_G['clientip']; + + $polloptionid = array(); + $query = C::t('forum_polloption')->fetch_all_by_tid($_G['tid']); + foreach($query as $pollarray) { + if(strexists("\t".$pollarray['voterids']."\t", "\t".$voterids."\t")) { + showmessage('thread_poll_voted', NULL, array(), array('login' => 1)); + } + $polloptionid[] = $pollarray['polloptionid']; + } + + $polloptionids = array(); + foreach($_GET['pollanswers'] as $key => $id) { + if(!in_array($id, $polloptionid)) { + showmessage('parameters_error'); + } + unset($polloptionid[$key]); + $polloptionids[] = $id; + } + + C::t('forum_polloption')->update_vote($polloptionids, $voterids."\t", 1); + C::t('forum_thread')->update($_G['tid'], array('lastpost'=>$_G['timestamp']), true); + C::t('forum_poll')->update_vote($_G['tid']); + C::t('forum_pollvoter')->insert(array( + 'tid' => $_G['tid'], + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'options' => implode("\t", $_GET['pollanswers']), + 'dateline' => $_G['timestamp'], + )); + updatecreditbyaction('joinpoll'); + + $space = array(); + space_merge($space, 'field_home'); + + if($overt && !empty($space['privacy']['feed']['newreply'])) { + $feed['icon'] = 'poll'; + $feed['title_template'] = 'feed_thread_votepoll_title'; + $feed['title_data'] = array( + 'subject' => "{$thread['subject']}", + 'author' => "{$thread['author']}", + 'hash_data' => "tid{$_G['tid']}" + ); + $feed['id'] = $_G['tid']; + $feed['idtype'] = 'tid'; + postfeed($feed); + } + + if(!empty($_G['inajax'])) { + showmessage('thread_poll_succeed', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('location' => true)); + } else { + showmessage('thread_poll_succeed', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : '')); + } + +} elseif($_GET['action'] == 'viewvote') { + if($_G['forum_thread']['special'] != 1) { + showmessage('thread_poll_none'); + } + require_once libfile('function/post'); + $polloptionid = is_numeric($_GET['polloptionid']) ? $_GET['polloptionid'] : ''; + + $page = intval($_GET['page']) ? intval($_GET['page']) : 1; + $perpage = 100; + $pollinfo = C::t('forum_poll')->fetch($_G['tid']); + $overt = $pollinfo['overt']; + + $polloptions = array(); + $query = C::t('forum_polloption')->fetch_all_by_tid($_G['tid']); + foreach($query as $options) { + if(empty($polloptionid)) { + $polloptionid = $options['polloptionid']; + } + $options['polloption'] = preg_replace("/\[url=(https?){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/i", + "\\3", $options['polloption']); + $polloptions[] = $options; + } + + $arrvoterids = array(); + if($overt || $_G['adminid'] == 1 || $thread['authorid'] == $_G['uid']) { + $polloptioninfo = C::t('forum_polloption')->fetch($polloptionid); + $voterids = $polloptioninfo['voterids']; + $arrvoterids = explode("\t", trim($voterids)); + } else { + showmessage('thread_poll_nopermission'); + } + + if(!empty($arrvoterids)) { + $count = count($arrvoterids); + $multi = $perpage * ($page - 1); + $multipage = multi($count, $perpage, $page, "forum.php?mod=misc&action=viewvote&tid={$_G['tid']}&polloptionid=$polloptionid".( $_GET['handlekey'] ? "&handlekey=".$_GET['handlekey'] : '' )); + $arrvoterids = array_slice($arrvoterids, $multi, $perpage); + } + $voterlist = $voter = array(); + if($arrvoterids) { + $voterlist = C::t('common_member')->fetch_all($arrvoterids); + } + include template('forum/viewthread_poll_voter'); + +} elseif($_GET['action'] == 'rate' && $_GET['pid']) { + + $_GET['tid'] = dintval($_GET['tid']); + $_GET['pid'] = dintval($_GET['pid']); + + if($_GET['showratetip']) { + include template('forum/rate'); + exit(); + } + + if(!$_G['inajax']) { + showmessage('undefined_action'); + } + if(!$_G['group']['raterange']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } elseif($_G['setting']['modratelimit'] && $_G['adminid'] == 3 && !$_G['forum']['ismoderator']) { + showmessage('thread_rate_moderator_invalid', NULL); + } + $reasonpmcheck = $_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3 ? 'checked="checked" disabled' : ''; + if(($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3) || !empty($_GET['sendreasonpm'])) { + $forumname = strip_tags($_G['forum']['name']); + $sendreasonpm = 1; + } else { + $sendreasonpm = 0; + } + + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid']); + if($post['invisible'] != 0 || $post['authorid'] == 0) { + $post = array(); + } + + if(!$post || $post['tid'] != $thread['tid'] || !$post['authorid']) { + showmessage('rate_post_error'); + } elseif(!$_G['forum']['ismoderator'] && $_G['setting']['karmaratelimit'] && TIMESTAMP - $post['dateline'] > $_G['setting']['karmaratelimit'] * 3600) { + showmessage('thread_rate_timelimit', NULL, array('karmaratelimit' => $_G['setting']['karmaratelimit'])); + } elseif($post['authorid'] == $_G['uid'] || $post['tid'] != $_G['tid']) { + showmessage('thread_rate_member_invalid', NULL); + } elseif($post['anonymous']) { + showmessage('thread_rate_anonymous', NULL); + } elseif($post['status'] & 1) { + showmessage('thread_rate_banned', NULL); + } + + $allowrate = TRUE; + if(!$_G['setting']['dupkarmarate']) { + if(C::t('forum_ratelog')->count_by_uid_pid($_G['uid'], $_GET['pid'])) { + showmessage('thread_rate_duplicate', NULL); + } + } + + $page = intval($_GET['page']); + + require_once libfile('function/misc'); + + $maxratetoday = getratingleft($_G['group']['raterange']); + + if(!submitcheck('ratesubmit')) { + $referer = $_G['siteurl'].'forum.php?mod=viewthread&tid='.$_G['tid'].'&page='.$page.($_GET['from'] ? '&from='.$_GET['from'] : '').'#pid'.$_GET['pid']; + $ratelist = getratelist($_G['group']['raterange']); + include template('forum/rate'); + + } else { + if($_G['setting']['submitlock'] && discuz_process::islocked('ratelock_'.$_G['uid'].'_'.$_GET['pid'], 0, 1)){ + showmessage('thread_rate_locked'); + } + + $reason = checkreasonpm(); + $rate = $ratetimes = 0; + $creditsarray = $sub_self_credit = array(); + getuserprofile('extcredits1'); + foreach($_G['group']['raterange'] as $id => $rating) { + $score = intval($_GET['score'.$id]); + if(isset($_G['setting']['extcredits'][$id]) && !empty($score)) { + if($rating['isself'] && (intval($_G['member']['extcredits'.$id]) - $score < 0)) { + showmessage('thread_rate_range_self_invalid', '', array('extcreditstitle' => $_G['setting']['extcredits'][$id]['title'])); + } + if(abs($score) <= $maxratetoday[$id]) { + if($score > $rating['max'] || $score < $rating['min']) { + showmessage('thread_rate_range_invalid'); + } else { + $creditsarray[$id] = $score; + if($rating['isself']) { + $sub_self_credit[$id] = -abs($score); + } + $rate += $score; + $ratetimes += ceil(max(abs($rating['min']), abs($rating['max'])) / 5); + } + } else { + showmessage('thread_rate_ctrl'); + } + } + } + + if(!$creditsarray) { + showmessage('thread_rate_range_invalid', NULL); + } + + updatemembercount($post['authorid'], $creditsarray, 1, 'PRC', $_GET['pid']); + + if(!empty($sub_self_credit)) { + updatemembercount($_G['uid'], $sub_self_credit, 1, 'RSC', $_GET['pid']); + } + C::t('forum_post')->increase_rate_by_pid('tid:'.$_G['tid'], $_GET['pid'], $rate, $ratetimes); + if($post['first']) { + $threadrate = intval((abs($post['rate'] + $rate) ? (($post['rate'] + $rate) / abs($post['rate'] + $rate)) : 0)); + C::t('forum_thread')->update($_G['tid'], array('rate'=>$threadrate)); + + } + + require_once libfile('function/discuzcode'); + $sqlvalues = $comma = ''; + $sqlreason = censor(trim($_GET['reason'])); + $sqlreason = cutstr(dhtmlspecialchars($sqlreason), 40); + foreach($creditsarray as $id => $addcredits) { + $insertarr = array( + 'pid' => $_GET['pid'], + 'uid' => $_G['uid'], + 'username' => $_G['username'], + 'extcredits' => $id, + 'dateline' => $_G['timestamp'], + 'score' => $addcredits, + 'reason' => $sqlreason + ); + C::t('forum_ratelog')->insert($insertarr); + } + + include_once libfile('function/post'); + $_G['forum']['threadcaches'] && @deletethreadcaches($_G['tid']); + + $reason = dhtmlspecialchars(censor(trim($reason))); + if($sendreasonpm) { + $ratescore = $slash = ''; + foreach($creditsarray as $id => $addcredits) { + $ratescore .= $slash.$_G['setting']['extcredits'][$id]['title'].' '.($addcredits > 0 ? '+'.$addcredits : $addcredits).' '.$_G['setting']['extcredits'][$id]['unit']; + $slash = ' / '; + } + sendreasonpm($post, 'rate_reason', array( + 'tid' => $thread['tid'], + 'pid' => $_GET['pid'], + 'subject' => $thread['subject'], + 'ratescore' => $ratescore, + 'reason' => $reason, + 'from_id' => 0, + 'from_idtype' => 'rate' + ), 'rate', 0); + } + + $logs = array(); + foreach($creditsarray as $id => $addcredits) { + $logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G['member']['username']}\t{$_G['adminid']}\t{$post['author']}\t$id\t$addcredits\t{$_G['tid']}\t{$thread['subject']}\t$reason"); + } + update_threadpartake($post['tid']); + C::t('forum_postcache')->delete($_GET['pid']); + writelog('ratelog', $logs); + + showmessage('thread_rate_succeed', dreferer()); + } +} elseif($_GET['action'] == 'removerate' && $_GET['pid']) { + + if(!$_G['forum']['ismoderator'] || !$_G['group']['raterange']) { + showmessage('no_privilege_removerate'); + } + + $reasonpmcheck = $_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3 ? 'checked="checked" disabled' : ''; + if(($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3) || !empty($_GET['sendreasonpm'])) { + $forumname = strip_tags($_G['forum']['name']); + $sendreasonpm = 1; + } else { + $sendreasonpm = 0; + } + + foreach($_G['group']['raterange'] as $id => $rating) { + $maxratetoday[$id] = $rating['mrpd']; + } + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid']); + if($post['invisible'] != 0 || $post['authorid'] == 0) { + $post = array(); + } + + if(!$post || $post['tid'] != $thread['tid'] || !$post['authorid']) { + showmessage('rate_post_error'); + } + + require_once libfile('function/misc'); + + if(!submitcheck('ratesubmit')) { + + $referer = $_G['siteurl'].'forum.php?mod=viewthread&tid='.$_G['tid'].'&page='.$page.($_GET['from'] ? '&from='.$_GET['from'] : '').'#pid'.$_GET['pid']; + $ratelogs = array(); + + foreach(C::t('forum_ratelog')->fetch_all_by_pid($_GET['pid'], 'ASC') as $ratelog) { + $ratelog['dbdateline'] = $ratelog['dateline']; + $ratelog['dateline'] = dgmdate($ratelog['dateline'], 'u'); + $ratelog['scoreview'] = $ratelog['score'] > 0 ? '+'.$ratelog['score'] : $ratelog['score']; + $ratelogs[] = $ratelog; + } + + include template('forum/rate'); + + } else { + + $reason = checkreasonpm(); + + if(!empty($_GET['logidarray'])) { + if($sendreasonpm) { + $ratescore = $slash = ''; + } + + $rate = $ratetimes = 0; + $logs = array(); + foreach(C::t('forum_ratelog')->fetch_all_by_pid($_GET['pid']) as $ratelog) { + if(in_array($ratelog['uid'].' '.$ratelog['extcredits'].' '.$ratelog['dateline'], $_GET['logidarray'])) { + $rate += $ratelog['score'] = -$ratelog['score']; + $ratetimes += ceil(max(abs($rating['min']), abs($rating['max'])) / 5); + updatemembercount($post['authorid'], array($ratelog['extcredits'] => $ratelog['score'])); + C::t('common_credit_log')->delete_by_uid_operation_relatedid($post['authorid'], 'PRC', $_GET['pid']); + C::t('forum_ratelog')->delete_by_pid_uid_extcredits_dateline($_GET['pid'], $ratelog['uid'], $ratelog['extcredits'], $ratelog['dateline']); + $logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G['member']['username']}\t{$_G['adminid']}\t{$ratelog['username']}\t{$ratelog['extcredits']}\t{$ratelog['score']}\t{$_G['tid']}\t{$thread['subject']}\t$reason\tD"); + if($sendreasonpm) { + $ratescore .= $slash.$_G['setting']['extcredits'][$ratelog['extcredits']]['title'].' '.($ratelog['score'] > 0 ? '+'.$ratelog['score'] : $ratelog['score']).' '.$_G['setting']['extcredits'][$ratelog['extcredits']]['unit']; + $slash = ' / '; + } + } + } + C::t('forum_postcache')->delete($_GET['pid']); + writelog('ratelog', $logs); + + if($sendreasonpm) { + sendreasonpm($post, 'rate_removereason', array( + 'tid' => $thread['tid'], + 'pid' => $_GET['pid'], + 'subject' => $thread['subject'], + 'ratescore' => $ratescore, + 'reason' => $reason, + 'from_id' => 0, + 'from_idtype' => 'removerate' + )); + } + C::t('forum_post')->increase_rate_by_pid('tid:'.$_G['tid'], $_GET['pid'], $rate, $ratetimes); + if($post['first']) { + $threadrate = intval((abs($post['rate'] + $rate) ? (($post['rate'] + $rate) / abs($post['rate'] + $rate)) : 0)); + C::t('forum_thread')->update($_G['tid'], array('rate'=>$threadrate)); + } + + } + + showmessage('thread_rate_removesucceed', dreferer()); + + } + +} elseif($_GET['action'] == 'viewratings' && $_GET['pid']) { + + $loglist = $logcount = array(); + + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid']); + if($post['invisible'] != 0) { + $post = array(); + } + if($post) { + $loglist = C::t('forum_ratelog')->fetch_all_by_pid($_GET['pid']); + } + if(empty($post) || empty($loglist)) { + showmessage('thread_rate_log_nonexistence'); + } + if($post['tid'] != $thread['tid']) { + showmessage('targetpost_donotbelongto_thisthread'); + } + if($_G['setting']['bannedmessages']) { + $postmember = getuserbyuid($post['authorid']); + $post['groupid'] = $postmember['groupid']; + } + + foreach($loglist as $k => $log) { + $logcount[$log['extcredits']] += $log['score']; + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log['score'] = $log['score'] > 0 ? '+'.$log['score'] : $log['score']; + $log['reason'] = dhtmlspecialchars($log['reason']); + $loglist[$k] = $log; + } + + include template('forum/rate_view'); + +} elseif($_GET['action'] == 'viewwarning' && $_GET['uid']) { + + $warnuser = getuserbyuid($_GET['uid']); + $warnuser = $warnuser['username']; + if(!$warnuser) { + showmessage('member_no_found'); + } + + $warnings = array(); + $warnings = C::t('forum_warning')->fetch_all_by_authorid($_GET['uid']); + + if(!$warnings) { + showmessage('thread_warning_nonexistence'); + } + + foreach($warnings as $key => $warning) { + $warning['dateline'] = dgmdate($warning['dateline'], 'u'); + $warning['reason'] = dhtmlspecialchars($warning['reason']); + $warnings[$key] = $warning; + } + $warnnum = count($warnings); + + include template('forum/warn_view'); + +} elseif($_GET['action'] == 'pay') { + + if(!isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]])) { + showmessage('credits_transaction_disabled'); + } elseif($thread['price'] <= 0 || $thread['special'] <> 0) { + showmessage('thread_pay_error', NULL); + } elseif(!$_G['uid']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } + + if(($balance = getuserprofile('extcredits'.$_G['setting']['creditstransextra'][1]) - $thread['price']) < ($minbalance = 0)) { + if($_G['setting']['creditstrans'][0] == $_G['setting']['creditstransextra'][1]) { + showmessage('credits_balance_insufficient_and_charge', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'minbalance' => $thread['price'])); + } else { + showmessage('credits_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'minbalance' => $thread['price'])); + } + } + + if(C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BTC', $_G['tid'])) { + showmessage('credits_buy_thread', 'forum.php?mod=viewthread&tid='.$_G['tid'].($_GET['from'] ? '&from='.$_GET['from'] : '')); + } + + $thread['netprice'] = floor($thread['price'] * (1 - $_G['setting']['creditstax'])); + + if(!submitcheck('paysubmit')) { + + if(empty($thread['author'])) { + if($_G['forum']['ismoderator']) { + $authorinfo = getuserbyuid($thread['authorid']); + $thread['author'] = $authorinfo['username']; + } else { + $thread['authorid'] = 0; + $thread['author'] = $_G['setting']['anonymoustext']; + } + } + include template('forum/pay'); + + } else { + + $updateauthor = true; + $authorEarn = $thread['netprice']; + if($_G['setting']['maxincperthread'] > 0) { + $extcredit = 'extcredits'.$_G['setting']['creditstransextra'][1]; + $log = C::t('common_credit_log')->count_credit_by_uid_operation_relatedid($thread['authorid'], 'STC', $_G['tid'], $_G['setting']['creditstransextra'][1]); + if($log >= $_G['setting']['maxincperthread']) { + $updateauthor = false; + } else { + $authorEarn = min($_G['setting']['maxincperthread'] - $log['credit'], $thread['netprice']); + } + } + if($updateauthor) { + updatemembercount($thread['authorid'], array($_G['setting']['creditstransextra'][1] => $authorEarn), 1, 'STC', $_G['tid']); + } + updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][1] => -$thread['price']), 1, 'BTC', $_G['tid']); + + showmessage('thread_pay_succeed', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : '')); + + } + +} elseif($_GET['action'] == 'viewpayments') { + $extcreditname = 'extcredits'.$_G['setting']['creditstransextra'][1]; + $loglist = array(); + $logs = C::t('common_credit_log')->fetch_all_by_uid_operation_relatedid(0, 'BTC', $_G['tid']); + $luids = array(); + foreach($logs as $log) { + $luids[$log['uid']] = $log['uid']; + } + $members = C::t('common_member')->fetch_all($luids); + foreach($logs as $log) { + $log['username'] = $members[$log['uid']]['username']; + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log[$extcreditname] = abs($log[$extcreditname]); + $loglist[] = $log; + } + include template('forum/pay_view'); + +} elseif($_GET['action'] == 'viewthreadmod' && $_G['tid']) { + + $modactioncode = lang('forum/modaction'); + $loglist = array(); + + foreach(C::t('forum_threadmod')->fetch_all_by_tid($_G['tid']) as $log) { + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log['expiration'] = !empty($log['expiration']) ? dgmdate($log['expiration'], 'dt') : ''; + $log['status'] = empty($log['status']) ? 'style="text-decoration: line-through" disabled' : ''; + if(!$modactioncode[$log['action']] && preg_match('/S(\d\d)/', $log['action'], $a) || $log['action'] == 'SPA') { + loadcache('stamps'); + if($log['action'] == 'SPA') { + $log['action'] = 'SPA'.$log['stamp']; + $stampid = $log['stamp']; + } else { + $stampid = intval($a[1]); + } + $modactioncode[$log['action']] = $modactioncode['SPA'].' '.$_G['cache']['stamps'][$stampid]['text']; + } elseif(preg_match('/L(\d\d)/', $log['action'], $a)) { + loadcache('stamps'); + $modactioncode[$log['action']] = $modactioncode['SLA'].' '.$_G['cache']['stamps'][intval($a[1])]['text']; + } + if($log['magicid']) { + loadcache('magics'); + $log['magicname'] = $_G['cache']['magics'][$log['magicid']]['name']; + } + $loglist[] = $log; + } + + if(empty($loglist)) { + showmessage('threadmod_nonexistence'); + } + + $reasons_public = $_G['setting']['modreasons_public']; + + include template('forum/viewthread_mod'); + +} elseif($_GET['action'] == 'bestanswer' && $_G['tid'] && $_GET['pid'] && submitcheck('bestanswersubmit')) { + + $forward = 'forum.php?mod=viewthread&tid='.$_G['tid'].($_GET['from'] ? '&from='.$_GET['from'] : ''); + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['pid'], false); + if($post['tid'] != $_G['tid']) { + $post = array(); + } + + if(!($thread['special'] == 3 && $post && ($_G['forum']['ismoderator'] && (!$_G['setting']['rewardexpiration'] || $_G['setting']['rewardexpiration'] > 0 && ($_G['timestamp'] - $thread['dateline']) / 86400 > $_G['setting']['rewardexpiration']) || $thread['authorid'] == $_G['uid']) && $post['authorid'] != $thread['authorid'] && $post['first'] == 0 && $_G['uid'] != $post['authorid'] && $thread['price'] > 0)) { + showmessage('reward_cant_operate'); + } elseif($post['authorid'] == $thread['authorid']) { + showmessage('reward_cant_self'); + } elseif($thread['price'] < 0) { + showmessage('reward_repeat_selection'); + } + updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][2] => $thread['price']), 1, 'RAC', $_G['tid']); + $thread['price'] = '-'.$thread['price']; + C::t('forum_thread')->update($_G['tid'], array('price'=>$thread['price'])); + C::t('forum_post')->update_post('tid:'.$_G['tid'], $_GET['pid'], array( + 'dateline' => $thread['dateline'] + 1, + )); + + $thread['dateline'] = dgmdate($thread['dateline']); + if($_G['uid'] != $thread['authorid']) { + notification_add($thread['authorid'], 'reward', 'reward_question', array( + 'tid' => $thread['tid'], + 'subject' => $thread['subject'], + )); + } + if($thread['authorid'] == $_G['uid']) { + notification_add($post['authorid'], 'reward', 'reward_bestanswer', array( + 'tid' => $thread['tid'], + 'subject' => $thread['subject'], + )); + } else { + notification_add($post['authorid'], 'reward', 'reward_bestanswer_moderator', array( + 'tid' => $thread['tid'], + 'subject' => $thread['subject'], + )); + } + + + showmessage('reward_completion', $forward); + +} elseif($_GET['action'] == 'activityapplies') { + + if(!$_G['uid']) { + showmessage('not_loggedin', NULL, array(), array('login' => 1)); + } + + if(submitcheck('activitysubmit')) { + $activity = C::t('forum_activity')->fetch($_G['tid']); + if($activity['expiration'] && $activity['expiration'] < TIMESTAMP) { + showmessage('activity_stop', NULL, array(), array('login' => 1)); + } + $applyinfo = array(); + $applyinfo = C::t('forum_activityapply')->fetch_info_for_user($_G['uid'], $_G['tid']); + if($applyinfo && $applyinfo['verified'] < 2) { + showmessage('activity_repeat_apply', NULL, array(), array('login' => 1)); + } + $payvalue = intval($_GET['payvalue']); + $payment = $_GET['payment'] ? $payvalue : -1; + $message = cutstr(dhtmlspecialchars($_GET['message']), 200); + $verified = $thread['authorid'] == $_G['uid'] ? 1 : 0; + if($activity['ufield']) { + $ufielddata = array(); + $activity['ufield'] = dunserialize($activity['ufield']); + if(!empty($activity['ufield']['userfield'])) { + $censor = discuz_censor::instance(); + loadcache('profilesetting'); + foreach($activity['ufield']['userfield'] as $filedname) { + $value = $_POST[$filedname]; + if(is_array($value)) { + $value = implode(',', $value); + } + $value = cutstr(dhtmlspecialchars(trim($value)), 100, '.'); + if($_G['cache']['profilesetting'][$filedname]['formtype'] == 'file' && !preg_match("/^https?:\/\/(.*)?\.(jpg|png|gif|jpeg|bmp)$/i", $value)) { + showmessage('activity_imgurl_error'); + } + if(empty($value) && $filedname != 'residedist' && $filedname != 'residecommunity') { + showmessage('activity_exile_field'); + } + $ufielddata['userfield'][$filedname] = $value; + } + } + if(!empty($activity['ufield']['extfield'])) { + foreach($activity['ufield']['extfield'] as $fieldid) { + $value = cutstr(dhtmlspecialchars(trim($_GET[''.$fieldid])), 50, '.'); + $ufielddata['extfield'][$fieldid] = $value; + } + } + $ufielddata = !empty($ufielddata) ? serialize($ufielddata) : ''; + } + if($_G['setting']['activitycredit'] && $activity['credit'] && empty($applyinfo['verified'])) { + checklowerlimit(array('extcredits'.$_G['setting']['activitycredit'] => '-'.$activity['credit'])); + updatemembercount($_G['uid'], array($_G['setting']['activitycredit'] => '-'.$activity['credit']), true, 'ACC', $_G['tid']); + } + if($applyinfo && $applyinfo['verified'] == 2) { + $newinfo = array( + 'tid' => $_G['tid'], + 'username' => $_G['username'], + 'uid' => $_G['uid'], + 'message' => $message, + 'verified' => $verified, + 'dateline' => $_G['timestamp'], + 'payment' => $payment, + 'ufielddata' => $ufielddata + ); + C::t('forum_activityapply')->update($applyinfo['applyid'], $newinfo); + } else { + $data = array('tid' => $_G['tid'], 'username' => $_G['username'], 'uid' => $_G['uid'], 'message' => $message, 'verified' => $verified, 'dateline' => $_G['timestamp'], 'payment' => $payment, 'ufielddata' => $ufielddata); + C::t('forum_activityapply')->insert($data); + } + + $applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']); + C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber)); + + if($thread['authorid'] != $_G['uid']) { + notification_add($thread['authorid'], 'activity', 'activity_notice', array( + 'tid' => $_G['tid'], + 'subject' => $thread['subject'], + )); + $space = array(); + space_merge($space, 'field_home'); + + if(!empty($space['privacy']['feed']['newreply'])) { + $feed['icon'] = 'activity'; + $feed['title_template'] = 'feed_reply_activity_title'; + $feed['title_data'] = array( + 'subject' => "{$thread['subject']}", + 'hash_data' => "tid{$_G['tid']}" + ); + $feed['id'] = $_G['tid']; + $feed['idtype'] = 'tid'; + postfeed($feed); + } + } + showmessage('activity_completion', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showdialog' => 1, 'showmsg' => true, 'locationtime' => true, 'alert' => 'right')); + + } elseif(submitcheck('activitycancel')) { + C::t('forum_activityapply')->delete_for_user($_G['uid'], $_G['tid']); + $applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']); + C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber)); + $message = cutstr(dhtmlspecialchars($_GET['message']), 200); + if($thread['authorid'] != $_G['uid']) { + notification_add($thread['authorid'], 'activity', 'activity_cancel', array( + 'tid' => $_G['tid'], + 'subject' => $thread['subject'], + 'reason' => $message + )); + } + showmessage('activity_cancel_success', "forum.php?mod=viewthread&tid={$_G['tid']}&do=viewapplylist".($_GET['from'] ? '&from='.$_GET['from'] :''), array(), array('showdialog' => 1, 'closetime' => true)); + } + +} elseif($_GET['action'] == 'getactivityapplylist') { + $pp = $_G['setting']['activitypp']; + $page = max(1, $_G['page']); + $start = ($page - 1) * $pp; + $activity = C::t('forum_activity')->fetch($_G['tid']); + if(!$activity || $thread['special'] != 4) { + showmessage('undefined_action'); + } + $query = C::t('forum_activityapply')->fetch_all_for_thread($_G['tid'], $start, $pp); + foreach($query as $activityapplies) { + $activityapplies['dateline'] = dgmdate($activityapplies['dateline']); + $applylist[] = $activityapplies; + } + $multi = multi($activity['applynumber'], $pp, $page, "forum.php?mod=misc&action=getactivityapplylist&tid={$_G['tid']}&pid={$_GET['pid']}"); + include template('forum/activity_applist_more'); +} elseif($_GET['action'] == 'activityapplylist') { + + $isactivitymaster = $thread['authorid'] == $_G['uid'] || + (in_array($_G['group']['radminid'], array(1, 2)) || ($_G['group']['radminid'] == 3 && $_G['forum']['ismoderator']) + && $_G['group']['alloweditactivity']); + if(!$isactivitymaster) { + showmessage('activity_is_not_manager'); + } + + $activity = C::t('forum_activity')->fetch($_G['tid']); + if(empty($activity) || $thread['special'] != 4) { + showmessage('activity_is_not_exists'); + } + + if(!submitcheck('applylistsubmit')) { + $applylist = array(); + $activity['ufield'] = $activity['ufield'] ? dunserialize($activity['ufield']) : array(); + $query = C::t('forum_activityapply')->fetch_all_for_thread($_G['tid'], 0, 500, $_GET['uid'], $isactivitymaster); + foreach($query as $activityapplies) { + $ufielddata = ''; + $activityapplies['dateline'] = dgmdate($activityapplies['dateline'], 'u'); + $activityapplies['ufielddata'] = !empty($activityapplies['ufielddata']) ? dunserialize($activityapplies['ufielddata']) : array(); + if($activityapplies['ufielddata']) { + if($activityapplies['ufielddata']['userfield']) { + require_once libfile('function/profile'); + loadcache('profilesetting'); + $data = ''; + foreach($activity['ufield']['userfield'] as $fieldid) { + if($fieldid == 'qq') { + $fieldid = 'qqnumber'; + } + $data = profile_show($fieldid, $activityapplies['ufielddata']['userfield']); + $ufielddata .= '
        • '.$_G['cache']['profilesetting'][$fieldid]['title'].'  :  '; + if(empty($data)) { + $ufielddata .= '
        • '; + continue; + } + if($_G['cache']['profilesetting'][$fieldid]['formtype'] != 'file') { + $ufielddata .= $data; + } else { + $ufielddata .= ''.lang('forum/misc', 'activity_viewimg').''; + } + $ufielddata .= ''; + } + } + if($activityapplies['ufielddata']['extfield']) { + foreach($activity['ufield']['extfield'] as $name) { + $ufielddata .= '
        • '.$name.'  :  '.$activityapplies['ufielddata']['extfield'][$name].'
        • '; + } + } + } + $activityapplies['ufielddata'] = $ufielddata; + $applylist[] = $activityapplies; + } + + $activity['starttimefrom'] = dgmdate($activity['starttimefrom'], 'u'); + $activity['starttimeto'] = $activity['starttimeto'] ? dgmdate($activity['starttimeto'], 'u') : 0; + $activity['expiration'] = $activity['expiration'] ? dgmdate($activity['expiration'], 'u') : 0; + + include template('forum/activity_applylist'); + } else { + if(empty($_GET['applyidarray'])) { + showmessage('activity_choice_applicant'); + } else { + $reason = cutstr(dhtmlspecialchars($_GET['reason']), 200); + $tempuid = $uidarray = $unverified = array(); + $query = C::t('forum_activityapply')->fetch_all($_GET['applyidarray']); + foreach($query as $row) { + if($row['tid'] == $_G['tid']) { + $tempusers[$row['uid']] = $row; + } + } + $query = C::t('common_member')->fetch_all(array_keys($tempusers)); + foreach($query as $user) { + $uidarray[] = $user['uid']; + if(is_array($tempusers[$user['uid']]) && $tempusers[$user['uid']]['verified'] != 1) { + $unverified[] = $user['uid']; + } + } + $activity_subject = $thread['subject']; + + if($_GET['operation'] == 'notification') { + if(empty($uidarray)) { + showmessage('activity_notification_user'); + } + if(empty($reason)) { + showmessage('activity_notification_reason'); + } + if($uidarray) { + foreach($uidarray as $uid) { + notification_add($uid, 'activity', 'activity_notification', array('tid' => $_G['tid'], 'subject' => $activity_subject, 'msg' => $reason)); + } + showmessage('activity_notification_success', "forum.php?mod=viewthread&tid={$_G['tid']}&do=viewapplylist".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showdialog' => 1, 'closetime' => true)); + } + } elseif($_GET['operation'] == 'delete') { + if($uidarray) { + C::t('forum_activityapply')->delete_for_thread($_G['tid'], $_GET['applyidarray']); + foreach($uidarray as $uid) { + notification_add($uid, 'activity', 'activity_delete', array( + 'tid' => $_G['tid'], + 'subject' => $activity_subject, + 'reason' => $reason, + )); + } + } + $applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']); + C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber)); + showmessage('activity_delete_completion', "forum.php?mod=viewthread&tid={$_G['tid']}&do=viewapplylist".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showdialog' => 1, 'closetime' => true)); + } else { + if($unverified) { + $verified = $_GET['operation'] == 'replenish' ? 2 : 1; + + C::t('forum_activityapply')->update_verified_for_thread($verified, $_G['tid'], $_GET['applyidarray']); + $notification_lang = $verified == 1 ? 'activity_apply' : 'activity_replenish'; + foreach($unverified as $uid) { + notification_add($uid, 'activity', $notification_lang, array( + 'tid' => $_G['tid'], + 'subject' => $activity_subject, + 'reason' => $reason, + )); + } + } + $applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']); + C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber)); + + showmessage('activity_auditing_completion', "forum.php?mod=viewthread&tid={$_G['tid']}&do=viewapplylist".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showdialog' => 1, 'closetime' => true)); + } + } + } + +} elseif($_GET['action'] == 'activityexport') { + + $isactivitymaster = $thread['authorid'] == $_G['uid'] || + (in_array($_G['group']['radminid'], array(1, 2)) || ($_G['group']['radminid'] == 3 && $_G['forum']['ismoderator']) + && $_G['group']['alloweditactivity']); + if(!$isactivitymaster) { + showmessage('activity_is_not_manager'); + } + + $activity = C::t('forum_activity')->fetch($_G['tid']); + $postinfo = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid']); + $activity['message'] = $postinfo['message']; + if(empty($activity) || $thread['special'] != 4) { + showmessage('activity_is_not_exists'); + } + $ufield = ''; + if($activity['ufield']) { + $activity['ufield'] = dunserialize($activity['ufield']); + if($activity['ufield']['userfield']) { + loadcache('profilesetting'); + foreach($activity['ufield']['userfield'] as $fieldid) { + $ufield .= ','.$_G['cache']['profilesetting'][$fieldid]['title']; + } + } + if($activity['ufield']['extfield']) { + foreach($activity['ufield']['extfield'] as $extname) { + $ufield .= ','.$extname; + } + } + } + $activity['starttimefrom'] = dgmdate($activity['starttimefrom'], 'dt'); + $activity['starttimeto'] = $activity['starttimeto'] ? dgmdate($activity['starttimeto'], 'dt') : 0; + $activity['expiration'] = $activity['expiration'] ? dgmdate($activity['expiration'], 'dt') : 0; + $activity['message'] = trim(preg_replace('/\[.+?\]/', '', $activity['message'])); + $applynumbers = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']); + + $applylist = array(); + $query = C::t('forum_activityapply')->fetch_all_for_thread($_G['tid'], 0, 2000, 0, 1); + foreach($query as $apply) { + $apply = str_replace(',', lang('forum/thread', 't_comma'), $apply); + $apply['dateline'] = dgmdate($apply['dateline'], 'dt'); + $apply['ufielddata'] = !empty($apply['ufielddata']) ? dunserialize($apply['ufielddata']) : array(); + $ufielddata = ''; + if($apply['ufielddata'] && $activity['ufield']) { + if($apply['ufielddata']['userfield'] && $activity['ufield']['userfield']) { + require_once libfile('function/profile'); + loadcache('profilesetting'); + foreach($activity['ufield']['userfield'] as $fieldid) { + if($fieldid == 'qq') { + $fieldid = 'qqnumber'; + } + $data = profile_show($fieldid, $apply['ufielddata']['userfield']); + if(strlen($data) > 11 && is_numeric($data)) { + $data = '['.$data.']'; + } + $ufielddata .= ','.strip_tags(str_replace(' ', ' ', $data)); + } + } + if($activity['ufield']['extfield']) { + foreach($activity['ufield']['extfield'] as $extname) { + if(strlen($apply['ufielddata']['extfield'][$extname]) > 11 && is_numeric($apply['ufielddata']['extfield'][$extname])) { + $apply['ufielddata']['extfield'][$extname] = '['.$apply['ufielddata']['extfield'][$extname].']'; + } + $ufielddata .= ','.strip_tags(str_replace(' ', ' ', $apply['ufielddata']['extfield'][$extname])); + } + } + } + $apply['fielddata'] = $ufielddata; + if(strlen($apply['message']) > 11 && is_numeric($apply['message'])) { + $apply['message'] = '['.$apply['message'].']'; + } + $applylist[] = $apply; + } + $filename = "activity_{$_G['tid']}.csv"; + + include template('forum/activity_export'); + $csvstr = ob_get_contents(); + ob_end_clean(); + header('Content-Encoding: none'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename='.$filename); + header('Pragma: no-cache'); + header('Expires: 0'); + if($_G['charset'] != 'gbk') { + $csvstr = diconv($csvstr, $_G['charset'], 'GBK'); + } + echo $csvstr; +} elseif($_GET['action'] == 'tradeorder') { + + $trades = array(); + $query = C::t('forum_trade')->fetch_all_thread_goods($_G['tid']); + if($thread['authorid'] != $_G['uid'] && !$_G['group']['allowedittrade']) { + showmessage('no_privilege_tradeorder'); + } + + if(!submitcheck('tradesubmit')) { + + $stickcount = 0;$trades = $tradesstick = array(); + foreach($query as $trade) { + $stickcount = $trade['displayorder'] > 0 ? $stickcount + 1 : $stickcount; + $trade['displayorderview'] = $trade['displayorder'] < 0 ? 128 + $trade['displayorder'] : $trade['displayorder']; + if($trade['expiration']) { + $trade['expiration'] = ($trade['expiration'] - TIMESTAMP) / 86400; + if($trade['expiration'] > 0) { + $trade['expirationhour'] = floor(($trade['expiration'] - floor($trade['expiration'])) * 24); + $trade['expiration'] = floor($trade['expiration']); + } else { + $trade['expiration'] = -1; + } + } + if($trade['displayorder'] < 0) { + $trades[] = $trade; + } else { + $tradesstick[] = $trade; + } + } + $trades = array_merge($tradesstick, $trades); + include template('forum/trade_displayorder'); + + } else { + + $count = 0; + foreach($query as $trade) { + $displayordernew = abs(intval($_GET['displayorder'][$trade['pid']])); + $displayordernew = $displayordernew > 128 ? 0 : $displayordernew; + if($_GET['stick'][$trade['pid']]) { + $count++; + $displayordernew = $displayordernew == 0 ? 1 : $displayordernew; + } + if(!$_GET['stick'][$trade['pid']] || $displayordernew > 0 && $_G['group']['tradestick'] < $count) { + $displayordernew = -1 * (128 - $displayordernew); + } + C::t('forum_trade')->update_trade($_G['tid'], $trade['pid'], array('displayorder' => $displayordernew)); + } + + showmessage('trade_displayorder_updated', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : '')); + + } + +} elseif($_GET['action'] == 'debatevote') { + + if(!empty($thread['closed'])) { + showmessage('thread_poll_closed'); + } + + if(!$_G['uid']) { + showmessage('debate_poll_nopermission', NULL, array(), array('login' => 1)); + } + + $isfirst = empty($_GET['pid']) ? TRUE : FALSE; + + $debate = C::t('forum_debate')->fetch($_G['tid']); + + if(empty($debate)) { + showmessage('debate_nofound'); + } + + if($isfirst) { + $stand = intval($_GET['stand']); + + if($stand == 1 || $stand == 2) { + if(strpos("\t".$debate['affirmvoterids'], "\t{$_G['uid']}\t") !== FALSE || strpos("\t".$debate['negavoterids'], "\t{$_G['uid']}\t") !== FALSE) { + showmessage('debate_poll_voted'); + } elseif($debate['endtime'] && $debate['endtime'] < TIMESTAMP) { + showmessage('debate_poll_end'); + } + } + C::t('forum_debate')->update_voters($_G['tid'], $_G['uid'], $stand); + + showmessage('debate_poll_succeed', 'forum.php?mod=viewthread&tid='.$_G['tid'], array(), array('showmsg' => 1, 'locationtime' => true)); + } + + $debatepost = C::t('forum_debatepost')->fetch($_GET['pid']); + if(empty($debatepost) || $debatepost['tid'] != $_G['tid']) { + showmessage('debate_nofound'); + } + $debate = array_merge($debate, $debatepost); + unset($debatepost); + + if($debate['uid'] == $_G['uid']) { + showmessage('debate_poll_myself', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showmsg' => 1)); + } elseif(strpos("\t".$debate['voterids'], "\t{$_G['uid']}\t") !== FALSE) { + showmessage('debate_poll_voted', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showmsg' => 1)); + } elseif($debate['endtime'] && $debate['endtime'] < TIMESTAMP) { + showmessage('debate_poll_end', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showmsg' => 1)); + } + + C::t('forum_debatepost')->update_voters($_GET['pid'], $_G['uid']); + + showmessage('debate_poll_succeed', "forum.php?mod=viewthread&tid={$_G['tid']}".($_GET['from'] ? '&from='.$_GET['from'] : ''), array(), array('showmsg' => 1)); + +} elseif($_GET['action'] == 'debateumpire') { + + $debate = C::t('forum_debate')->fetch($_G['tid']); + + if(empty($debate)) { + showmessage('debate_nofound'); + }elseif(!empty($thread['closed']) && TIMESTAMP - $debate['endtime'] > 3600) { + showmessage('debate_umpire_edit_invalid'); + } elseif($_G['member']['username'] != $debate['umpire']) { + showmessage('debate_umpire_nopermission'); + } + + $debate = array_merge($debate, $thread); + + if(!submitcheck('umpiresubmit')) { + $candidates = array(); + $uids = array(); + $voters = C::t('forum_debatepost')->fetch_all_voters($_G['tid'], 30); + foreach($voters as $candidate) { + $uids[] = $candidate['uid']; + } + $users = C::t('common_member')->fetch_all_username_by_uid($uids); + foreach($voters as $candidate) { + $candidate['username'] = dhtmlspecialchars($users[$candidate['uid']]); + $candidates[$candidate['username']] = $candidate; + } + $winnerchecked = array($debate['winner'] => ' checked="checked"'); + + list($debate['bestdebater']) = preg_split("/\s/", $debate['bestdebater']); + + include template('forum/debate_umpire'); + } else { + if(empty($_GET['bestdebater'])) { + showmessage('debate_umpire_nofound_bestdebater'); + } elseif(empty($_GET['winner'])) { + showmessage('debate_umpire_nofound_winner'); + } elseif(empty($_GET['umpirepoint'])) { + showmessage('debate_umpire_nofound_point'); + } + $bestdebateruid = C::t('common_member')->fetch_uid_by_username($_GET['bestdebater']); + if(!$bestdebateruid) { + showmessage('debate_umpire_bestdebater_invalid'); + } + if(!($bestdebaterstand = C::t('forum_debatepost')->get_stand_by_bestuid($_G['tid'], $bestdebateruid, array($debate['uid'], $_G['uid'])))) { + showmessage('debate_umpire_bestdebater_invalid'); + } + list($bestdebatervoters, $bestdebaterreplies) = C::t('forum_debatepost')->get_numbers_by_bestuid($_G['tid'], $bestdebateruid); + + $umpirepoint = dhtmlspecialchars($_GET['umpirepoint']); + $bestdebater = dhtmlspecialchars($_GET['bestdebater']); + $winner = intval($_GET['winner']); + C::t('forum_thread')->update($_G['tid'], array('closed' => 1)); + C::t('forum_debate')->update($_G['tid'], array('umpirepoint' => $umpirepoint, 'winner' => $winner, 'bestdebater' => "$bestdebater\t$bestdebateruid\t$bestdebaterstand\t$bestdebatervoters\t$bestdebaterreplies", 'endtime' => $_G['timestamp'])); + showmessage('debate_umpire_comment_succeed', 'forum.php?mod=viewthread&tid='.$_G['tid'].($_GET['from'] ? '&from='.$_GET['from'] : '')); + } + +} elseif($_GET['action'] == 'recommend') { + + dsetcookie('discuz_recommend', '', -1, 0); + if(empty($_G['uid'])) { + showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1)); + } + + if(empty($_GET['hash']) || $_GET['hash'] != formhash()) { + showmessage('submit_invalid'); + } + if(!$_G['setting']['recommendthread']['status'] || !$_G['group']['allowrecommend']) { + showmessage('no_privilege_recommend'); + } + + if($thread['authorid'] == $_G['uid'] && !$_G['setting']['recommendthread']['ownthread']) { + showmessage('recommend_self_disallow', '', array('recommendc' => $thread['recommends']), array('msgtype' => 3)); + } + if(C::t('forum_memberrecommend')->fetch_by_recommenduid_tid($_G['uid'], $_G['tid'])) { + showmessage('recommend_duplicate', '', array('recommendc' => $thread['recommends']), array('msgtype' => 3)); + } + + $recommendcount = C::t('forum_memberrecommend')->count_by_recommenduid_dateline($_G['uid'], $_G['timestamp']-86400); + if($_G['setting']['recommendthread']['daycount'] && $recommendcount >= $_G['setting']['recommendthread']['daycount']) { + showmessage('recommend_outoftimes', '', array('recommendc' => $thread['recommends']), array('msgtype' => 3)); + } + + $_G['group']['allowrecommend'] = intval($_GET['do'] == 'add' ? $_G['group']['allowrecommend'] : -$_G['group']['allowrecommend']); + $fieldarr = array(); + if($_GET['do'] == 'add') { + $heatadd = 'recommend_add=recommend_add+1'; + $fieldarr['recommend_add'] = 1; + } else { + $heatadd = 'recommend_sub=recommend_sub+1'; + $fieldarr['recommend_sub'] = 1; + } + + update_threadpartake($_G['tid']); + $fieldarr['heats'] = 0; + $fieldarr['recommends'] = $_G['group']['allowrecommend']; + C::t('forum_thread')->increase($_G['tid'], $fieldarr); + if(empty($thread['closed'])) { + C::t('forum_thread')->update($_G['tid'], array('lastpost' => TIMESTAMP)); + } + C::t('forum_memberrecommend')->insert(array('tid'=>$_G['tid'], 'recommenduid'=>$_G['uid'], 'dateline'=>$_G['timestamp'])); + + dsetcookie('recommend', 1, 43200); + $recommendv = $_G['group']['allowrecommend'] > 0 ? '+'.$_G['group']['allowrecommend'] : $_G['group']['allowrecommend']; + if($_G['setting']['recommendthread']['daycount']) { + $daycount = $_G['setting']['recommendthread']['daycount'] - $recommendcount; + showmessage('recommend_daycount_succeed', '', array('recommendv' => $recommendv, 'recommendc' => $thread['recommends'], 'daycount' => $daycount), array('msgtype' => 3)); + } else { + showmessage('recommend_succeed', '', array('recommendv' => $recommendv, 'recommendc' => $thread['recommends']), array('msgtype' => 3)); + } + +} elseif($_GET['action'] == 'protectsort') { + $tid = $_GET['tid']; + $optionid = $_GET['optionid']; + include template('common/header_ajax'); + $typeoptionvarvalue = C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tid, $optionid); + $typeoptionvarvalue[0]['expiration'] = $typeoptionvarvalue[0]['expiration'] && $typeoptionvarvalue[0]['expiration'] <= TIMESTAMP ? 1 : 0; + $option = C::t('forum_typeoption')->fetch($optionid); + + if(($option['expiration'] && !$typeoptionvarvalue[0]['expiration']) || empty($option['expiration'])) { + $protect = dunserialize($option['protect']); + include_once libfile('function/threadsort'); + if(protectguard($protect)) { + if(empty($option['permprompt'])) { + echo lang('forum/misc', 'view_noperm'); + } else { + echo $option['permprompt']; + } + } else { + echo nl2br($typeoptionvarvalue[0]['value']); + } + } else { + echo lang('forum/misc', 'has_expired'); + } + include template('common/footer_ajax'); + +} elseif($_GET['action'] == 'usertag') { + if($_G['tid'] && $_G['group']['alloweditusertag']) { + if(!submitcheck('addusertag')) { + $recent_use_tag = $lastlog = $polloptions = array(); + $i = 0; + $query = C::t('common_tagitem')->select(0, 0, 'uid', 'tagid', 'DESC', 200); + foreach($query as $result) { + if($i > 4) { + break; + } + if($recent_use_tag[$result['tagid']] == '') { + $i++; + } + $recent_use_tag[$result['tagid']] = 1; + } + if($recent_use_tag) { + $query = C::t('common_tag')->fetch_all(array_keys($recent_use_tag)); + foreach($query as $result) { + $recent_use_tag[$result['tagid']] = $result['tagname']; + } + } + foreach(C::t('forum_threadmod')->fetch_all_by_tid($_G['tid'], 'AUT', 3) as $row) { + $row['dateline'] = dgmdate($row['dateline'], 'u'); + $lastlog[] = $row; + } + if($_G['thread']['special'] == 1) { + $query = C::t('forum_polloption')->fetch_all_by_tid($_G['tid']); + foreach($query as $polloption) { + if($polloption['votes'] > 0) { + $polloptions[] = $polloption; + } + + } + if(empty($polloptions)) { + showmessage('thread_poll_voter_isnull', '', array('haserror' => 1)); + } + } elseif($_G['thread']['special'] == 4) { + $activityapplys = C::t('forum_activityapply')->fetch_all_for_thread($_G['tid'], 0, 1); + if(empty($activityapplys)) { + showmessage('thread_activityapply_isnull', '', array('haserror' => 1)); + } + } + } else { + $class_tag = new tag(); + $tagarray = $class_tag->add_tag($_GET['tags'], 0, 'uid', 1); + if($tagarray) { + $uids = array(); + if($_G['thread']['special'] == 1) { + if($_GET['polloptions']) { + $query = C::t('forum_polloption')->fetch_all($_GET['polloptions']); + } else { + $query = C::t('forum_polloption')->fetch_all_by_tid($_G['tid']); + } + $uids = ''; + foreach($query as $row) { + $uids .= $row['voterids']; + } + if($uids) { + $uids = explode("\t", trim($uids)); + } + } elseif($_G['thread']['special'] == 4) { + $query = C::t('forum_activityapply')->fetch_all_for_thread($_G['tid'], 0, 2000); + foreach($query as $row) { + $uids[] = $row['uid']; + } + } else { + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$_G['tid'], $_G['tid'], false) as $author) { + $uids[] = $author['authorid']; + } + } + + $uids = is_array($uids) ? array_unique($uids) : array(); + $count = count($uids); + $limit = intval($_GET['limit']); + $per = 200; + $uids = array_slice($uids, $limit, $per); + if($uids) { + foreach($uids as $uid) { + if(empty($uid)) continue; + foreach($tagarray as $tagid => $tagname) { + C::t('common_tagitem')->insert(array('tagid' => $tagid, 'itemid' => $uid, 'idtype' => 'uid'), 0, 1); + } + } + updatemodlog($_G['tid'], 'AUT', 0, 0, implode(',', $tagarray)); + showmessage('forum_usertag_set_continue', '', array('limit' => $limit, 'next' => min($limit + $per, $count), 'count' => $count), array('alert' => 'right')); + } + showmessage('forum_usertag_succeed', '', array(), array('alert' => 'right')); + } else { + showmessage('parameters_error', '', array('haserror' => 1)); + } + } + + } else { + showmessage('parameters_error', '', array('haserror' => 1)); + } + include_once template("forum/usertag"); +} elseif($_GET['action'] == 'postreview') { + + if(!$_G['setting']['repliesrank'] || empty($_G['uid'])) { + showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1)); + } + if(empty($_GET['hash']) || $_GET['hash'] != formhash()) { + showmessage('submit_invalid'); + } + + $doArray = array('support', 'against'); + + $post = C::t('forum_post')->fetch_post('tid:'.$_GET['tid'], $_GET['pid'], false); + + if(!in_array($_GET['do'], $doArray) || empty($post) || $post['first'] == 1 || ($_G['setting']['threadfilternum'] && $_G['setting']['filterednovote'] && getstatus($post['status'], 11)) || $post['invisible'] < 0) { + showmessage('undefined_action', NULL); + } + + $hotreply = C::t('forum_hotreply_number')->fetch_by_pid($post['pid']); + if($_G['uid'] == $post['authorid']) { + showmessage('noreply_yourself_error', '', array(), array('msgtype' => 3)); + } + + if(empty($hotreply)) { + $hotreply['pid'] = C::t('forum_hotreply_number')->insert(array( + 'pid' => $post['pid'], + 'tid' => $post['tid'], + 'support' => 0, + 'against' => 0, + 'total' => 0, + ), true); + } else { + if(C::t('forum_hotreply_member')->fetch_member($post['pid'], $_G['uid'])) { + showmessage('noreply_voted_error', '', array(), array('msgtype' => 3)); + } + } + + $typeid = $_GET['do'] == 'support' ? 1 : 0; + + C::t('forum_hotreply_number')->update_num($post['pid'], $typeid); + C::t('forum_hotreply_member')->insert(array( + 'tid' => $post['tid'], + 'pid' => $post['pid'], + 'uid' => $_G['uid'], + 'attitude' => $typeid, + )); + + $hotreply[$_GET['do']]++; + + showmessage('thread_poll_succeed', '', array(), array('msgtype' => 3, 'extrajs' => '')); +} elseif($_GET['action'] == 'hidden') { + if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action', NULL); + } + if(!$_G['uid']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } + if(in_array($thread['fid'], $_G['setting']['security_forums_white_list']) || $thread['displayorder'] > 0 || $thread['highlight'] || $thread['digest'] || $thread['stamp'] > -1) { + showmessage('thread_hidden_error', NULL); + } + $member = C::t('common_member')->fetch($thread['authorid']); + if(in_array($member['groupid'], $_G['setting']['security_usergroups_white_list'])) { + showmessage('thread_hidden_error', NULL); + } + if(C::t('forum_forumrecommend')->fetch($thread['tid'])) { + showmessage('thread_hidden_error', NULL); + } + C::t('forum_threadhidelog')->insert_hidelog($_GET['tid'], $_G['uid']); + if($thread['hidden'] + 1 == $_G['setting']['threadhidethreshold']) { + notification_add($thread['authorid'], 'post', 'thread_hidden', array('tid' => $thread['tid'], 'subject' => $thread['subject']), 1); + } + $thide = explode('|', $_G['cookie']['thide']); + $thide = array_slice($thide, -20); + if(!in_array($_GET['tid'], $thide)) { + $thide[] = $_GET['tid']; + } + dsetcookie('thide', implode('|', $thide), 2592000); + showmessage('thread_hidden_success', dreferer(), array(), array('showdialog' => true, 'closetime' => true, 'extrajs' => '')); +} elseif($_GET['action'] == 'hiderecover') { + if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action', NULL); + } + $seccodecheck = true; + if(submitcheck('hiderecoversubmit')) { + C::t('forum_threadhidelog')->delete_by_tid($_GET['tid']); + showmessage('thread_hiderecover_success', dreferer()); + } else { + include template('forum/hiderecover'); + } +} + +function getratelist($raterange) { + global $_G; + $maxratetoday = getratingleft($raterange); + + $ratelist = array(); + foreach($raterange as $id => $rating) { + if(isset($_G['setting']['extcredits'][$id])) { + $ratelist[$id] = ''; + $rating['max'] = $rating['max'] < $maxratetoday[$id] ? $rating['max'] : $maxratetoday[$id]; + $rating['min'] = -$rating['min'] < $maxratetoday[$id] ? $rating['min'] : -$maxratetoday[$id]; + $offset = abs(ceil(($rating['max'] - $rating['min']) / 10)); + if($rating['max'] > $rating['min']) { + for($vote = $rating['max']; $vote >= $rating['min']; $vote -= $offset) { + $ratelist[$id] .= $vote ? '
        • '.($vote > 0 ? '+'.$vote : $vote).'
        • ' : ''; + } + } + } + } + return $ratelist; +} + +function getratingleft($raterange) { + global $_G; + $maxratetoday = array(); + + foreach($raterange as $id => $rating) { + $maxratetoday[$id] = $rating['mrpd']; + } + + foreach(C::t('forum_ratelog')->fetch_all_sum_score($_G['uid'], $_G['timestamp']-86400) as $rate) { + $maxratetoday[$rate['extcredits']] = $raterange[$rate['extcredits']]['mrpd'] - $rate['todayrate']; + } + return $maxratetoday; +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_modcp.php b/source/module/forum/forum_modcp.php new file mode 100644 index 0000000..8d43fe5 --- /dev/null +++ b/source/module/forum/forum_modcp.php @@ -0,0 +1,205 @@ +dologin($_G['uid'], getgpc('cppwd'), true); +} + +if(!$modsession->islogin) { + $_GET['action'] = 'login'; +} + +if(getgpc('action') == 'logout') { + $modsession->dologout(); + showmessage('modcp_logout_succeed', 'forum.php'); +} + +$modforums = $modsession->get('modforums'); +$_GET['action'] = empty($_GET['action']) ? (($_G['setting']['forumstatus'] && $_G['fid']) ? 'thread' : 'home') : $_GET['action']; +$op = getgpc('op'); +if($modforums === null) { + $modforums = array('fids' => '', 'list' => array(), 'recyclebins' => array()); + $comma = ''; + if($_G['adminid'] == 3) { + foreach(C::t('forum_moderator')->fetch_all_by_uid_forum($_G['uid']) as $tforum) { + $modforums['fids'] .= $comma.$tforum['fid']; $comma = ','; + $modforums['recyclebins'][$tforum['fid']] = $tforum['recyclebin']; + $modforums['list'][$tforum['fid']] = strip_tags($tforum['name']); + } + } else { + $query = C::t('forum_forum')->fetch_all_info_by_fids(0, 1, 0, 0, 0, 1, 1); + if(!empty($_G['member']['accessmasks'])) { + $fids = array_keys($query); + $accesslist = C::t('forum_access')->fetch_all_by_fid_uid($fids, $_G['uid']); + foreach($query as $key => $val) { + $query[$key]['allowview'] = $accesslist[$key]; + } + } + foreach($query as $tforum) { + $tforum['allowview'] = !isset($tforum['allowview']) ? 0 : $tforum['allowview']; + if($tforum['allowview'] == 1 || ($tforum['allowview'] == 0 && ((!$tforum['viewperm'] && $_G['group']['readaccess']) || ($tforum['viewperm'] && forumperm($tforum['viewperm']))))) { + $modforums['fids'] .= $comma.$tforum['fid']; $comma = ','; + $modforums['recyclebins'][$tforum['fid']] = $tforum['recyclebin']; + $modforums['list'][$tforum['fid']] = strip_tags($tforum['name']); + } + } + } + + $modsession->set('modforums', $modforums, true); +} + +$threadclasslist = array(); +if($_G['fid'] && in_array($_G['fid'], explode(',', $modforums['fids']))) { + foreach(C::t('forum_threadclass')->fetch_all_by_fid($_G['fid']) as $tc) { + $threadclasslist[] = $tc; + } +} + +if($_G['fid'] && $_G['forum']['ismoderator']) { + dsetcookie('modcpfid', $_G['fid']); + $forcefid = "&fid={$_G['fid']}"; +} elseif(!empty($modforums) && count($modforums['list']) == 1) { + $forcefid = "&fid={$modforums['fids']}"; +} else { + $forcefid = ''; +} + +$script = $modtpl = ''; +switch ($_GET['action']) { + + case 'announcement': + $_G['group']['allowpostannounce'] && $script = 'announcement'; + break; + + case 'member': + $op == 'edit' && $_G['group']['allowedituser'] && $script = 'member'; + $op == 'ban' && ($_G['group']['allowbanuser'] || $_G['group']['allowbanvisituser']) && $script = 'member'; + $op == 'ipban' && $_G['group']['allowbanip'] && $script = 'member'; + break; + + case 'moderate': + ($op == 'threads' || $op == 'replies') && $_G['group']['allowmodpost'] && $script = 'moderate'; + $op == 'members' && $_G['group']['allowmoduser'] && $script = 'moderate'; + break; + + case 'forum': + $op == 'editforum' && $_G['group']['alloweditforum'] && $script = 'forum'; + $op == 'recommend' && $_G['group']['allowrecommendthread'] && $script = 'forum'; + break; + + case 'forumaccess': + $_G['group']['allowedituser'] && $script = 'forumaccess'; + break; + + case 'log': + $_G['group']['allowviewlog'] && $script = 'log'; + break; + + case 'login': + $script = $modsession->islogin ? 'home' : 'login'; + break; + + case 'thread': + $script = 'thread'; + break; + + case 'recyclebin': + $script = 'recyclebin'; + break; + + case 'recyclebinpost': + $script = 'recyclebinpost'; + break; + + case 'plugin': + $script = 'plugin'; + break; + + case 'report': + $script = 'report'; + break; + + default: + $_GET['action'] = $script = 'home'; + $modtpl = 'modcp_home'; +} + +$script = empty($script) ? 'noperm' : $script; +$modtpl = empty($modtpl) ? (!empty($script) ? 'modcp_'.$script : '') : $modtpl; +$modtpl = 'forum/' . $modtpl; +$op = isset($op) ? trim($op) : ''; + +if($script != 'log') { + require_once libfile('function/misc'); + $extra = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('cppwd', 'formhash', 'submit', 'addsubmit')); + $modcplog = array(TIMESTAMP, $_G['username'], $_G['adminid'], $_G['clientip'], $_GET['action'], $op, $_G['fid'], $extra); + writelog('modcp', implode("\t", clearlogstring($modcplog))); +} + +require DISCUZ_ROOT.'./source/include/modcp/modcp_'.$script.'.php'; + +$reportnum = $modpostnum = $modthreadnum = $modforumnum = 0; +$modforumnum = count($modforums['list']); +$modnum = ''; +if($modforumnum) { + if(!empty($_G['setting']['moddetail'])) { + if($_G['group']['allowmodpost']) { + $modnum = C::t('common_moderate')->count_by_idtype_status_fid('tid', 0, explode(',', $modforums['fids'])); + $modnum += C::t('common_moderate')->count_by_idtype_status_fid('pid', 0, explode(',', $modforums['fids'])); + } + if($_G['group']['allowmoduser']) { + $modnum += C::t('common_member_validate')->count_by_status(0); + } + } +} + +switch($_G['adminid']) { + case 1: $access = '1,2,3,4,5,6,7'; break; + case 2: $access = '2,3,6,7'; break; + default: $access = '1,3,5,7'; break; +} +$notenum = C::t('common_adminnote')->count_by_access(explode(',', $access)); + +include template('forum/modcp'); + +function getposttableselect() { + global $_G; + + loadcache('posttable_info'); + if(!empty($_G['cache']['posttable_info']) && is_array($_G['cache']['posttable_info'])) { + $posttableselect = ''; + } else { + $posttableselect = ''; + } + return $posttableselect; +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_post.php b/source/module/forum/forum_post.php new file mode 100644 index 0000000..738c003 --- /dev/null +++ b/source/module/forum/forum_post.php @@ -0,0 +1,400 @@ + ''); +$thread = array('readperm' => '', 'pricedisplay' => '', 'hiddenreplies' => ''); + +$_G['forum_dtype'] = $_G['forum_checkoption'] = $_G['forum_optionlist'] = $tagarray = $_G['forum_typetemplate'] = array(); + + +if($sortid) { + require_once libfile('post/threadsorts', 'include'); +} + +if($_G['forum']['status'] == 3) { + if(!helper_access::check_module('group')) { + showmessage('group_status_off'); + } + require_once libfile('function/group'); + $status = groupperm($_G['forum'], $_G['uid'], 'post'); + if($status == -1) { + showmessage('forum_not_group', 'index.php'); + } elseif($status == 1) { + showmessage('forum_group_status_off'); + } elseif($status == 2) { + showmessage('forum_group_noallowed', "forum.php?mod=group&fid={$_G['fid']}"); + } elseif($status == 3) { + showmessage('forum_group_moderated'); + } elseif($status == 4) { + if($_G['uid']) { + showmessage('forum_group_not_groupmember', "", array('fid' => $_G['fid']), array('showmsg' => 1)); + } else { + showmessage('forum_group_not_groupmember_guest', "", array('fid' => $_G['fid']), array('showmsg' => 1, 'login' => 1)); + } + } elseif($status == 5) { + showmessage('forum_group_moderated', "", array('fid' => $_G['fid']), array('showmsg' => 1)); + } +} + +if(empty($_GET['action'])) { + showmessage('undefined_action', NULL); +} elseif($_GET['action'] == 'albumphoto') { + require libfile('post/albumphoto', 'include'); +} elseif(($_G['forum']['simple'] & 1) || $_G['forum']['redirect']) { + showmessage('forum_disablepost'); +} + +require_once libfile('function/discuzcode'); + +$space = array(); +space_merge($space, 'field_home'); + +if($_GET['action'] == 'reply') { + $addfeedcheck = !empty($space['privacy']['feed']['newreply']) ? 'checked="checked"': ''; +} else { + $addfeedcheck = !empty($space['privacy']['feed']['newthread']) ? 'checked="checked"': ''; +} + + +$navigation = $navtitle = ''; + +if(!empty($_GET['cedit'])) { + unset($_G['inajax'], $_GET['infloat'], $_GET['ajaxtarget'], $_GET['handlekey']); +} + +if($_GET['action'] == 'edit' || $_GET['action'] == 'reply') { + + $thread = C::t('forum_thread')->fetch_thread($_G['tid']); + if(!$_G['forum_auditstatuson'] && !($thread['displayorder']>=0 || (in_array($thread['displayorder'], array(-4, -2)) && $thread['authorid']==$_G['uid']))) { + $thread = array(); + } + if(!empty($thread)) { + + if($thread['readperm'] && $thread['readperm'] > $_G['group']['readaccess'] && !$_G['forum']['ismoderator'] && $thread['authorid'] != $_G['uid']) { + showmessage('thread_nopermission', NULL, array('readperm' => $thread['readperm']), array('login' => 1)); + } + + $_G['fid'] = $thread['fid']; + $special = $thread['special']; + + } else { + showmessage('thread_nonexistence'); + } + + if($thread['closed'] == 1 && !$_G['forum']['ismoderator']) { + showmessage('post_thread_closed'); + } + if(!$thread['isgroup'] && $post_autoclose = checkautoclose($thread)) { + showmessage($post_autoclose, '', array('autoclose' => $_G['forum']['autoclose'])); + } +} + +if($_G['forum']['status'] == 3) { + $returnurl = 'forum.php?mod=forumdisplay&fid='.$_G['fid'].(!empty($_GET['extra']) ? '&action=list&'.preg_replace("/^(&)*/", '', $_GET['extra']) : '').'#groupnav'; + $nav = get_groupnav($_G['forum']); + $navigation = ' '.$_G['setting']['navs'][3]['navname'].' '.$nav['nav']; +} else { + loadcache('forums'); + $returnurl = 'forum.php?mod=forumdisplay&fid='.$_G['fid'].(!empty($_GET['extra']) ? '&'.preg_replace("/^(&)*/", '', $_GET['extra']) : ''); + $navigation = ' '.$_G['setting']['navs'][2]['navname'].''; + + if($_G['forum']['type'] == 'sub') { + $fup = $_G['cache']['forums'][$_G['forum']['fup']]['fup']; + $t_link = $_G['cache']['forums'][$fup]['type'] == 'group' ? 'forum.php?gid='.$fup : 'forum.php?mod=forumdisplay&fid='.$fup; + $navigation .= ' '.($_G['cache']['forums'][$fup]['name']).''; + } + + if($_G['forum']['fup']) { + $fup = $_G['forum']['fup']; + $t_link = $_G['cache']['forums'][$fup]['type'] == 'group' ? 'forum.php?gid='.$fup : 'forum.php?mod=forumdisplay&fid='.$fup; + $navigation .= ' '.($_G['cache']['forums'][$fup]['name']).''; + } + + $t_link = 'forum.php?mod=forumdisplay&fid='.$_G['fid'].($_GET['extra'] && !IS_ROBOT ? '&'.$_GET['extra'] : ''); + $navigation .= ' '.($_G['forum']['name']).''; + + unset($t_link, $t_name); +} + +periodscheck('postbanperiods'); + +if($_G['forum']['password'] && $_G['forum']['password'] != $_G['cookie']['fidpw'.$_G['fid']]) { + showmessage('forum_passwd', "forum.php?mod=forumdisplay&fid={$_G['fid']}"); +} + +if(empty($_G['forum']['allowview'])) { + if(!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } elseif($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) { + showmessagenoperm('viewperm', $_G['fid']); + } +} elseif($_G['forum']['allowview'] == -1) { + showmessage('forum_access_view_disallow'); +} + +formulaperm($_G['forum']['formulaperm']); + +if(in_array($_G['adminid'], array(0, -1)) && $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - getglobal('member/regdate') < $_G['setting']['newbiespan'] * 60) { + showmessage('post_newbie_span', '', array('newbiespan' => $_G['setting']['newbiespan'])); +} + +$special = $special > 0 && $special < 7 || $special == 127 ? intval($special) : 0; + +$_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : ''; +$_G['group']['allowpostattach'] = $_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || (!$_G['forum']['postattachperm'] && $_G['group']['allowpostattach']) || ($_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm']))); +$_G['forum']['allowpostimage'] = isset($_G['forum']['allowpostimage']) ? $_G['forum']['allowpostimage'] : ''; +$_G['group']['allowpostimage'] = $_G['forum']['allowpostimage'] != -1 && ($_G['forum']['allowpostimage'] == 1 || (!$_G['forum']['postimageperm'] && $_G['group']['allowpostimage']) || ($_G['forum']['postimageperm'] && forumperm($_G['forum']['postimageperm']))); +$_G['group']['attachextensions'] = $_G['forum']['attachextensions'] ? $_G['forum']['attachextensions'] : $_G['group']['attachextensions']; +require_once libfile('function/upload'); +$swfconfig = getuploadconfig($_G['uid'], $_G['fid']); +$imgexts = str_replace(array(';', '*.'), array(', ', ''), $swfconfig['imageexts']['ext']); +$allowuploadnum = $allowuploadtoday = TRUE; +if($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) { + if($_G['group']['maxattachnum']) { + $allowuploadnum = $_G['group']['maxattachnum'] - getuserprofile('todayattachs'); + $allowuploadnum = $allowuploadnum < 0 ? 0 : $allowuploadnum; + if(!$allowuploadnum) { + $allowuploadtoday = false; + } + } + if($_G['group']['maxsizeperday']) { + $allowuploadsize = $_G['group']['maxsizeperday'] - getuserprofile('todayattachsize'); + $allowuploadsize = $allowuploadsize < 0 ? 0 : $allowuploadsize; + if(!$allowuploadsize) { + $allowuploadtoday = false; + } + $allowuploadsize = $allowuploadsize / 1048576 >= 1 ? round(($allowuploadsize / 1048576), 1).'MB' : round(($allowuploadsize / 1024)).'KB'; + } +} +$allowpostimg = $_G['group']['allowpostimage'] && $imgexts; +$enctype = ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) ? 'enctype="multipart/form-data"' : ''; +$maxattachsize_mb = $_G['group']['maxattachsize'] / 1048576 >= 1 ? round(($_G['group']['maxattachsize'] / 1048576), 1).'MB' : round(($_G['group']['maxattachsize'] / 1024)).'KB'; + +$_G['group']['maxprice'] = isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]) ? $_G['group']['maxprice'] : 0; + +$extra = !empty($_GET['extra']) ? rawurlencode($_GET['extra']) : ''; +$notifycheck = empty($emailnotify) ? '' : 'checked="checked"'; +$stickcheck = empty($sticktopic) ? '' : 'checked="checked"'; +$digestcheck = empty($addtodigest) ? '' : 'checked="checked"'; + +$subject = isset($_GET['subject']) ? dhtmlspecialchars(censor(trim($_GET['subject']), NULL, FALSE, FALSE)) : ''; +$subject = !empty($subject) ? str_replace("\t", ' ', $subject) : $subject; +$message = isset($_GET['message']) ? censor($_GET['message'], NULL, FALSE, FALSE) : ''; +$polloptions = isset($polloptions) ? censor(trim($polloptions)) : ''; +$readperm = isset($_GET['readperm']) ? intval($_GET['readperm']) : 0; +$price = isset($_GET['price']) ? intval($_GET['price']) : 0; + +if(empty($bbcodeoff) && !$_G['group']['allowhidecode'] && !empty($message) && preg_match("/\[hide=?d?\d*,?\d*\].*?\[\/hide\]/is", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message))) { + showmessage('post_hide_nopermission'); +} + + +$urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = ''; + +list($seccodecheck, $secqaacheck) = seccheck('post', $_GET['action']); + +$_G['group']['allowpostpoll'] = $_G['group']['allowpost'] && $_G['group']['allowpostpoll'] && ($_G['forum']['allowpostspecial'] & 1); +$_G['group']['allowposttrade'] = $_G['group']['allowpost'] && $_G['group']['allowposttrade'] && ($_G['forum']['allowpostspecial'] & 2); +$_G['group']['allowpostreward'] = $_G['group']['allowpost'] && $_G['group']['allowpostreward'] && ($_G['forum']['allowpostspecial'] & 4); +$_G['group']['allowpostactivity'] = $_G['group']['allowpost'] && $_G['group']['allowpostactivity'] && ($_G['forum']['allowpostspecial'] & 8); +$_G['group']['allowpostdebate'] = $_G['group']['allowpost'] && $_G['group']['allowpostdebate'] && ($_G['forum']['allowpostspecial'] & 16); +$usesigcheck = $_G['uid'] && $_G['group']['maxsigsize'] ? 'checked="checked"' : ''; +$ordertypecheck = !empty($thread['tid']) && getstatus($thread['status'], 4) ? 'checked="checked"' : ''; +$imgcontentcheck = !empty($thread['tid']) && getstatus($thread['status'], 15) ? 'checked="checked"' : ''; +$specialextra = !empty($_GET['specialextra']) ? $_GET['specialextra'] : ''; +$_G['forum']['threadplugin'] = dunserialize($_G['forum']['threadplugin']); + +if($specialextra && $_G['group']['allowpost'] && $_G['setting']['threadplugins'] && + (!array_key_exists($specialextra, $_G['setting']['threadplugins']) || + !in_array($specialextra, is_array($_G['forum']['threadplugin']) ? $_G['forum']['threadplugin'] : (is_array(dunserialize($_G['forum']['threadplugin'])) ? dunserialize($_G['forum']['threadplugin']) : array())) || + (is_array($_G['group']['allowthreadplugin']) && !in_array($specialextra, $_G['group']['allowthreadplugin'])))) { + $specialextra = ''; +} +if($special == 3 && !isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']])) { + showmessage('reward_credits_closed'); +} +$_G['group']['allowanonymous'] = $_G['forum']['allowanonymous'] || $_G['group']['allowanonymous'] ? 1 : 0; + +if($_GET['action'] == 'newthread' && $_G['forum']['allowspecialonly'] && !$special) { + if($_G['group']['allowpostpoll']) { + $special = 1; + } elseif($_G['group']['allowposttrade']) { + $special = 2; + } elseif($_G['group']['allowpostreward']) { + $special = 3; + } elseif($_G['group']['allowpostactivity']) { + $special = 4; + } elseif($_G['group']['allowpostdebate']) { + $special = 5; + } elseif($_G['group']['allowpost'] && $_G['setting']['threadplugins'] && $_G['group']['allowthreadplugin']) { + if(empty($_GET['specialextra'])) { + foreach($_G['forum']['threadplugin'] as $tpid) { + if(array_key_exists($tpid, $_G['setting']['threadplugins']) && is_array($_G['group']['allowthreadplugin']) && in_array($tpid, $_G['group']['allowthreadplugin'])){ + $specialextra=$tpid; + break; + } + } + } + $threadpluginary = array_intersect($_G['forum']['threadplugin'], $_G['group']['allowthreadplugin']); + $specialextra = in_array($specialextra, $threadpluginary) ? $specialextra : ''; + } + + if(!$special && !$specialextra) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } +} + +if(!$sortid && !$specialextra) { + $postspecialcheck[$special] = ' class="a"'; +} + +$editorid = 'e'; +$_G['setting']['editoroptions'] = str_pad(decbin($_G['setting']['editoroptions']), 3, 0, STR_PAD_LEFT); +$editormode = $_G['setting']['editoroptions'][0]; +$allowswitcheditor = $_G['setting']['editoroptions'][1]; +$editor = array( + 'editormode' => $editormode, + 'allowswitcheditor' => $allowswitcheditor, + 'allowhtml' => $_G['forum']['allowhtml'], + 'allowsmilies' => $_G['forum']['allowsmilies'], + 'allowbbcode' => $_G['forum']['allowbbcode'], + 'allowimgcode' => $_G['forum']['allowimgcode'], + 'allowresize' => 1, + 'allowchecklength' => 1, + 'allowtopicreset' => 1, + 'textarea' => 'message', + 'simplemode' => !isset($_G['cookie']['editormode_'.$editorid]) ? !$_G['setting']['editoroptions'][2] : $_G['cookie']['editormode_'.$editorid], +); +if($specialextra) { + $special = 127; +} + +if($_GET['action'] == 'newthread') { + $policykey = 'post'; +} elseif($_GET['action'] == 'reply') { + $policykey = 'reply'; +} else { + $policykey = ''; +} +$policykeys = array('postattach', $policykey); +loadcache('creditrule'); +foreach ($policykeys as $key) { + if($key && is_array($_G['cache']['creditrule'][$key])) { + $data = array(); + $creditrule = $_G['cache']['creditrule'][$key]; + for($i = 1; $i <= 8; $i++) { + if($creditrule['extcredits'.$i]) { + $data[$i] = $creditrule['extcredits'.$i]; + } + } + $_G['setting']['creditspolicy'][$key] = $data; + } +} +$postattachcredits = !empty($_G['forum']['postattachcredits']) ? $_G['forum']['postattachcredits'] : $_G['setting']['creditspolicy']['postattach']; +if($policykey) { + $postcredits = getglobal('forum/'.$policykey.'credits') ? getglobal('forum/'.$policykey.'credits') : $_G['setting']['creditspolicy'][$policykey]; +} + +$albumlist = array(); +if(helper_access::check_module('album') && $_G['group']['allowupload'] && $_G['uid']) { + $query = C::t('home_album')->fetch_all_by_uid($_G['uid'], 'updatetime'); + foreach($query as $value) { + if($value['picnum']) { + $albumlist[] = $value; + } + } +} + +$posturl = "action={$_GET['action']}&fid={$_G['fid']}". + (!empty($_G['tid']) ? "&tid={$_G['tid']}" : ''). + (!empty($pid) ? "&pid=$pid" : ''). + (!empty($special) ? "&special=$special" : ''). + (!empty($sortid) ? "&sortid=$sortid" : ''). + (!empty($typeid) ? "&typeid=$typeid" : ''). + (!empty($_GET['firstpid']) ? "&firstpid=".$_GET['firstpid'] : ''). + (!empty($_GET['addtrade']) ? "&addtrade=".$_GET['addtrade'] : ''); + +if($_GET['action'] == 'reply') { + check_allow_action('allowreply'); +} else { + check_allow_action('allowpost'); +} + +if($special == 4) { + $_G['setting']['activityfield'] = $_G['setting']['activityfield'] ? dunserialize($_G['setting']['activityfield']) : array(); +} +if(helper_access::check_module('album') && $_G['group']['allowupload'] && $_G['setting']['albumcategorystat'] && !empty($_G['cache']['albumcategory'])) { + require_once libfile('function/portalcp'); +} +$navtitle = lang('core', 'title_'.$_GET['action'].'_post'); +list($modnewthreads, $modnewreplies) = threadmodstatus(''); + +if($_GET['action'] == 'newthread' || $_GET['action'] == 'newtrade') { + loadcache('groupreadaccess'); + $navtitle .= ' - '.$_G['forum']['name']; + require_once libfile('post/newthread', 'include'); +} elseif($_GET['action'] == 'reply') { + $navtitle .= ' - '.$thread['subject'].' - '.$_G['forum']['name']; + require_once libfile('post/newreply', 'include'); +} elseif($_GET['action'] == 'edit') { + loadcache('groupreadaccess'); + $navtitle .= ' - '.$thread['subject'].' - '.$_G['forum']['name']; + require_once libfile('post/editpost', 'include'); +} + +function check_allow_action($action = 'allowpost') { + global $_G; + if(isset($_G['forum'][$action]) && $_G['forum'][$action] == -1) { + showmessage('forum_access_disallow'); + } +} +function recent_use_tag() { + $tagarray = $stringarray = array(); + $string = ''; + $i = 0; + $query = C::t('common_tagitem')->select(0, 0, 'tid', 'itemid', 'DESC', 10); + foreach($query as $result) { + if($i > 4) { + break; + } + if($tagarray[$result['tagid']] == '') { + $i++; + } + $tagarray[$result['tagid']] = 1; + } + if($tagarray) { + $query = C::t('common_tag')->fetch_all(array_keys($tagarray)); + foreach($query as $result) { + $tagarray[$result['tagid']] = $result['tagname']; + } + } + return $tagarray; +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_redirect.php b/source/module/forum/forum_redirect.php new file mode 100644 index 0000000..c484f9b --- /dev/null +++ b/source/module/forum/forum_redirect.php @@ -0,0 +1,151 @@ +fetch_post($thread['posttableid'], $pid); + } else { + $post = get_post_by_pid($pid); + } + + if($post && empty($thread)) { + $thread = get_thread_by_tid($post['tid']); + } + } + + if(empty($thread)) { + showmessage('thread_nonexistence'); + } else { + $tid = $thread['tid']; + } + + if(empty($pid)) { + + if($postno) { + if(getstatus($thread['status'], 3)) { + $rowarr = C::t('forum_post')->fetch_all_by_tid_position($thread['posttableid'], $ptid, $postno); + $pid = $rowarr[0]['pid']; + } + + if($pid) { + $post = C::t('forum_post')->fetch_post($thread['posttableid'], $pid); + if($post['invisible'] != 0) { + $post = array(); + } + } else { + $postno = $postno > 1 ? $postno - 1 : 0; + $post = C::t('forum_post')->fetch_visiblepost_by_tid($thread['posttableid'], $ptid, $postno); + } + } + + } + + if(empty($post)) { + if($ptid) { + header("HTTP/1.1 301 Moved Permanently"); + dheader("Location: forum.php?mod=viewthread&tid=$ptid"); + } else { + showmessage('post_check', NULL, array('tid' => $ptid)); + } + } else { + $pid = $post['pid']; + } + + $ordertype = !isset($_GET['ordertype']) && getstatus($thread['status'], 4) ? 1 : $ordertype; + if($thread['special'] == 2 || C::t('forum_threaddisablepos')->fetch($tid)) { + $curpostnum = C::t('forum_post')->count_by_tid_dateline($thread['posttableid'], $tid, $post['dateline']); + } else { + if($thread['maxposition']) { + $maxposition = $thread['maxposition']; + } else { + $maxposition = C::t('forum_post')->fetch_maxposition_by_tid($thread['posttableid'], $tid); + } + $thread['replies'] = $maxposition; + $curpostnum = $post['position']; + } + if($ordertype != 1) { + $page = ceil($curpostnum / $_G['ppp']); + } elseif($curpostnum > 1) { + $page = ceil(($thread['replies'] - $curpostnum + 3) / $_G['ppp']); + } else { + $page = 1; + } + + if($thread['special'] == 2 && C::t('forum_trade')->check_goods($pid)) { + header("HTTP/1.1 301 Moved Permanently"); + dheader("Location: forum.php?mod=viewthread&do=tradeinfo&tid=$tid&pid=$pid"); + } + + $authoridurl = $authorid ? '&authorid='.$authorid : ''; + $ordertypeurl = $ordertype ? '&ordertype='.$ordertype : ''; + header("HTTP/1.1 301 Moved Permanently"); + dheader("Location: forum.php?mod=viewthread&tid=$tid&page=$page$authoridurl$ordertypeurl".(isset($_GET['modthreadkey']) && ($modthreadkey = modauthkey($tid)) ? "&modthreadkey=$modthreadkey": '')."#pid$pid"); +} + + +if(empty($_G['thread'])) { + showmessage('thread_nonexistence'); +} + +if($_GET['goto'] == 'lastpost') { + + $pageadd = ''; + if(!getstatus($_G['thread'], 4)) { + $page = ceil(($_G['thread']['special'] ? $_G['thread']['replies'] : $_G['thread']['replies'] + 1) / $_G['ppp']); + $pageadd = $page > 1 ? '&page='.$page : ''; + } + + dheader('Location: forum.php?mod=viewthread&tid='.$_G['tid'].$pageadd.'#lastpost'); + +} elseif($_GET['goto'] == 'nextnewset' || $_GET['goto'] == 'nextoldset') { + + $lastpost = $_G['thread']['lastpost']; + + + $glue = '<'; + $sort = 'DESC'; + if($_GET['goto'] == 'nextnewset') { + $glue = '>'; + $sort = 'ASC'; + } + $next = C::t('forum_thread')->fetch_next_tid_by_fid_lastpost($_G['fid'], $lastpost, $glue, $sort, $_G['thread']['threadtableid']); + if($next) { + dheader("Location: forum.php?mod=viewthread&tid=$next"); + } elseif($_GET['goto'] == 'nextnewset') { + showmessage('redirect_nextnewset_nonexistence'); + } else { + showmessage('redirect_nextoldset_nonexistence'); + } + +} else { + showmessage('undefined_action', NULL); +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_rss.php b/source/module/forum/forum_rss.php new file mode 100644 index 0000000..c655ecf --- /dev/null +++ b/source/module/forum/forum_rss.php @@ -0,0 +1,161 @@ + $forum) { + if(rssforumperm($forum)) { + $fidarray[] = $fid; + } + } +} else { + $forum = isset($_G['cache']['forums'][$rssfid]) && $_G['cache']['forums'][$rssfid]['type'] != 'group' ? $_G['cache']['forums'][$rssfid] : array(); + if(!isset($_G['cache']['forums'][$rssfid])) { + $forum = $_G['cache']['forums'][$rssfid] = array(); + $subforum = C::t('forum_forum')->fetch_info_by_fid($rssfid); + if($subforum['type'] == 'sub') { + $forum = $_G['cache']['forums'][$rssfid] = $subforum; + } + } + if($forum && rssforumperm($forum)) { + $fidarray = array($rssfid); + $forumname = dhtmlspecialchars($_G['cache']['forums'][$rssfid]['name']); + } else { + exit('Specified forum not found'); + } +} + +$frewriteflag = $trewriteflag = 0; +$havedomain = implode('', $_G['setting']['domain']['app']); +if(is_array($_G['setting']['rewritestatus']) && in_array('forum_forumdisplay', $_G['setting']['rewritestatus'])) { + $frewriteflag = 1; +} +if(is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $trewriteflag = 1; +} + +$charset = $_G['config']['output']['charset']; +dheader("Content-type: application/xml"); +echo "\n". + "\n". + " \n". + (count($fidarray) > 1 ? + " {$_G['setting']['bbname']}\n". + " {$_G['siteurl']}forum.php\n". + " Latest $num threads of all forums\n" + : + " {$_G['setting']['bbname']} - $forumname\n". + " {$_G['siteurl']}".($frewriteflag ? rewriteoutput('forum_forumdisplay', 1, '', $rssfid) : "forum.php?mod=forumdisplay&fid=$rssfid")."\n". + " Latest $num threads of $forumname\n" + ). + " Copyright(C) {$_G['setting']['bbname']}\n". + " Discuz! Board by Comsenz Inc.\n". + " ".gmdate('r', TIMESTAMP)."\n". + " $ttl\n". + " \n". + " {$_G['siteurl']}static/image/common/logo_88_31.gif\n". + " {$_G['setting']['bbname']}\n". + " {$_G['siteurl']}\n". + " \n"; + +if($fidarray) { + $alldata = C::t('forum_rsscache')->fetch_all_by_fid($fidarray, $num); + if($alldata) { + foreach($alldata as $thread) { + if(TIMESTAMP - $thread['lastupdate'] > $ttl * 60) { + updatersscache($num); + break; + } else { + list($thread['description'], $attachremote, $attachfile, $attachsize) = explode("\t", $thread['description']); + if($attachfile) { + if($attachremote) { + $filename = $_G['setting']['ftp']['attachurl'].'forum/'.$attachfile; + } else { + $filename = (!strstr($_G['setting']['attachurl'], '://') ? $_G['siteurl'] : '').$_G['setting']['attachurl'].'forum/'.$attachfile; + } + } + echo " \n". + " ".$thread['subject']."\n". + " {$_G['siteurl']}".($trewriteflag ? rewriteoutput('forum_viewthread', 1, '', $thread['tid']) : "forum.php?mod=viewthread&tid={$thread['tid']}")."\n". + " \n". + " ".dhtmlspecialchars($thread['forum'])."\n". + " ".dhtmlspecialchars($thread['author'])."\n". + ($attachfile ? '' : ''). + " ".gmdate('r', $thread['dateline'])."\n". + " \n"; + } + } + } else { + updatersscache($num); + } +} + +echo " \n". + ""; + +function updatersscache($num) { + global $_G; + $processname = 'forum_rss_cache'; + if(discuz_process::islocked($processname, 600)) { + return false; + } + C::t('forum_rsscache')->truncate(); + require_once libfile('function/post'); + foreach($_G['cache']['forums'] as $fid => $forum) { + if($forum['type'] != 'group') { + $forum['name'] = addslashes($forum['name']); + foreach(C::t('forum_thread')->fetch_all_by_fid_displayorder($fid, 0, null, null, 0, $num, 'tid') as $thread) { + $thread['author'] = $thread['author'] != '' ? addslashes($thread['author']) : 'Anonymous'; + $thread['subject'] = addslashes($thread['subject']); + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']); + $attachdata = ''; + $thread['message'] = $post['message']; + $thread['status'] = $post['status']; + $thread['description'] = $thread['readperm'] > 0 || $thread['price'] > 0 || $thread['status'] & 1 ? '' : addslashes(threadmessagecutstr($thread, $thread['message'], 250 - strlen($attachdata)).$attachdata); + C::t('forum_rsscache')->insert(array( + 'lastupdate'=>$_G['timestamp'], + 'fid'=>$fid, + 'tid'=>$thread['tid'], + 'dateline'=>$thread['dateline'], + 'forum'=>$forum['name'], + 'author'=>$thread['author'], + 'subject'=>$thread['subject'], + 'description'=>$thread['description'] + ), false, true); + } + } + } + discuz_process::unlock($processname); + return true; +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_tag.php b/source/module/forum/forum_tag.php new file mode 100644 index 0000000..ec582e3 --- /dev/null +++ b/source/module/forum/forum_tag.php @@ -0,0 +1,69 @@ +fetch_all_by_status(0, $searchkey, 50, 0); + foreach($query as $value) { + $taglist[] = $value; + } + $searchkey = dhtmlspecialchars($searchkey); + +} elseif($op == 'manage') { + if($_G['tid']) { + $tagarray_all = $array_temp = $threadtag_array = array(); + $tags = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid']); + $tags = $tags['tags']; + $tagarray_all = explode("\t", $tags); + if($tagarray_all) { + foreach($tagarray_all as $var) { + if($var) { + $array_temp = explode(',', $var); + $threadtag_array[] = $array_temp['1']; + } + } + } + $tags = implode(',', $threadtag_array); + + $recent_use_tag = array(); + $i = 0; + $query = C::t('common_tagitem')->select(0, 0, 'tid', 'itemid', 'DESC', 10); + foreach($query as $result) { + if($i > 4) { + break; + } + if($recent_use_tag[$result['tagid']] == '') { + $i++; + } + $recent_use_tag[$result['tagid']] = 1; + } + if($recent_use_tag) { + $query = C::t('common_tag')->fetch_all(array_keys($recent_use_tag)); + foreach($query as $result) { + $recent_use_tag[$result['tagid']] = $result['tagname']; + } + } + } +} elseif($op == 'set' && $_GET['formhash'] == FORMHASH && $_G['group']['allowmanagetag']) { + $class_tag = new tag(); + $tagstr = $class_tag->update_field($_GET['tags'], $_G['tid'], 'tid', $_G['thread']); + C::t('forum_post')->update_by_tid('tid:'.$_G['tid'], $_G['tid'], array('tags' => $tagstr), false, false, 1); +} + +include_once template("forum/tag"); +?> \ No newline at end of file diff --git a/source/module/forum/forum_topicadmin.php b/source/module/forum/forum_topicadmin.php new file mode 100644 index 0000000..4879c18 --- /dev/null +++ b/source/module/forum/forum_topicadmin.php @@ -0,0 +1,102 @@ +fetch_by_tid_fid_displayorder($_G['tid'], $_G['fid'], $displayorder, $archiveid); + if(!$thread) { + showmessage('thread_nonexistence'); + } + + $navigation .= " » {$thread['subject']} "; + $navtitle .= ' - '.$thread['subject'].' - '; + + if($thread['special'] && in_array($_GET['action'], array('copy', 'split', 'merge'))) { + showmessage('special_noaction'); + } +} +if(($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3) || !empty($_GET['sendreasonpm'])) { + $forumname = strip_tags($_G['forum']['name']); + $sendreasonpm = 1; +} else { + $sendreasonpm = 0; +} + +$_GET['handlekey'] = 'mods'; + + +if(preg_match('/^\w+$/', $_GET['action']) && file_exists($topicadminfile = libfile('topicadmin/'.$_GET['action'], 'include'))) { + require_once $topicadminfile; +} else { + showmessage('undefined_action', NULL); +} + +if($resultarray) { + + if($resultarray['modtids']) { + updatemodlog($resultarray['modtids'], $modaction, $resultarray['expiration']); + } + + updatemodworks($modaction, $modpostsnum); + if(is_array($resultarray['modlog'])) { + if(isset($resultarray['modlog']['tid'])) { + modlog($resultarray['modlog'], $modaction); + } else { + foreach($resultarray['modlog'] as $thread) { + modlog($thread, $modaction); + } + } + } + + if($resultarray['reasonpm']) { + $modactioncode = lang('forum/modaction'); + $modaction = $modactioncode[$modaction]; + foreach($resultarray['reasonpm']['data'] as $var) { + sendreasonpm($var, $resultarray['reasonpm']['item'], $resultarray['reasonvar'], $resultarray['reasonpm']['notictype']); + } + } + + showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']); + +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_trade.php b/source/module/forum/forum_trade.php new file mode 100644 index 0000000..b4d1753 --- /dev/null +++ b/source/module/forum/forum_trade.php @@ -0,0 +1,377 @@ + 1)); +} + +$page = max(1, intval($_GET['page'])); +$orderid = $_GET['orderid']; +if(!empty($orderid) && empty($_GET['apitype'])) { + $orderinfo = C::t('forum_tradelog')->fetch($orderid); + $paytype = $orderinfo['paytype']; + if($paytype == 1) { + $apitype = 'alipay'; + } + if($paytype == 2) { + $apitype = 'tenpay'; + } +} + +require_once libfile('function/trade'); +if(!empty($orderid)) { + + $language = lang('forum/misc'); + + $tradelog = C::t('forum_tradelog')->fetch($orderid); + if(!$_G['forum_auditstatuson'] && (empty($tradelog) || $_G['uid'] != $tradelog['sellerid'] && $_G['uid'] != $tradelog['buyerid'])) { + showmessage('undefined_action', NULL); + } + + $limit = 6; + $query = C::t('forum_trade')->fetch_all_for_seller($tradelog['sellerid'], $limit); + $usertrades = array(); + $usertradecount = 0; + foreach($query as $usertrade) { + $usertradecount++; + $usertrades[] = $usertrade; + } + + $trade_message = ''; + $currentcredit = $_G['setting']['creditstrans'] ? getuserprofile('extcredits'.$_G['setting']['creditstrans']) : 0; + $discountprice = $tradelog['baseprice'] * $tradelog['number']; + + if(!empty($_GET['pay']) && !$tradelog['offline'] && $tradelog['status'] == 0 && $tradelog['buyerid'] == $_G['uid']) { + if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['credit']) { + if($tradelog['credit'] > getuserprofile('extcredits'.$_G['setting']['creditstransextra'][5])) { + showmessage('trade_credit_lack'); + } + updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstransextra'][5] => -$tradelog['credit'])); + } + $trade = C::t('forum_trade')->fetch_goods($tradelog['tid'], $tradelog['pid']); + + if($_G['uid'] && $currentcredit < $discountcredit && $tradelog['discount']) { + showmessage('trade_credits_no_enough', '', array('credittitle' => $_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'])); + } + $pay = array(); + $pay['commision'] = 0; + $transport = $tradelog['transport']; + $transportfee = 0; + trade_setprice(array('fee' => $fee, 'trade' => $trade, 'transport' => $transport), $price, $pay, $transportfee); + $payurl = trade_payurl($pay, $trade, $tradelog); + $paytype = 0; + if($apitype == 'alipay') { + $paytype = 1; + } elseif($apitype == 'tenpay') { + $paytype = 2; + } + C::t('forum_tradelog')->update($orderid, array('paytype' => $paytype)); + showmessage('trade_directtopay', $payurl); + } + + if(submitcheck('offlinesubmit') && in_array($_GET['offlinestatus'], trade_offline($tradelog, 0))) { + + loaducenter(); + $ucresult = uc_user_login($_G['username'], $_GET['password']); + list($tmp['uid']) = daddslashes($ucresult); + + if($tmp['uid'] <= 0) { + showmessage('trade_password_error', 'forum.php?mod=trade&orderid='.$orderid); + } + if($_GET['offlinestatus'] == 4) { + if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['credit']) { + if($tradelog['credit'] > getuserprofile('extcredits'.$_G['setting']['creditstransextra'][5])) { + showmessage('trade_credit_lack'); + } + updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstransextra'][5] => -$tradelog['credit'])); + } + $trade = C::t('forum_trade')->fetch_goods($tradelog['tid'], $tradelog['pid']); + notification_add($tradelog['sellerid'], 'goods', 'trade_seller_send', array( + 'buyerid' => $tradelog['buyerid'], + 'buyer' => $tradelog['buyer'], + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + } elseif($_GET['offlinestatus'] == 5) { + notification_add($tradelog['buyerid'], 'goods', 'trade_buyer_confirm', array( + 'sellerid' => $tradelog['sellerid'], + 'seller' => $tradelog['seller'], + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + } elseif($_GET['offlinestatus'] == 7) { + if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['basecredit']) { + $netcredit = round($tradelog['number'] * $tradelog['basecredit'] * (1 - $_G['setting']['creditstax'])); + updatemembercount($tradelog['sellerid'], array($_G['setting']['creditstransextra'][5] => $netcredit)); + } else { + $netcredit = 0; + } + $data = array('lastbuyer' => $tradelog['buyer'], 'lastupdate' => $_G['timestamp']); + C::t('forum_trade')->update_trade($tradelog['tid'], $tradelog['pid'], $data); + C::t('forum_trade')->update_counter($tradelog['tid'], $tradelog['pid'], $tradelog['number'], $tradelog['price'], $netcredit); + notification_add($tradelog['sellerid'], 'goods', 'trade_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + notification_add($tradelog['buyerid'], 'goods', 'trade_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + } elseif($_GET['offlinestatus'] == 17) { + C::t('forum_trade')->update_counter($tradelog['tid'], $tradelog['pid'], 0, 0, 0, $tradelog['number']); + notification_add($tradelog['sellerid'], 'goods', 'trade_fefund_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + notification_add($tradelog['buyerid'], 'goods', 'trade_fefund_success', array( + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['basecredit']) { + updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstransextra'][5] => $tradelog['number'] * $tradelog['basecredit'])); + } + } + + $_GET['message'] = trim($_GET['message']); + if($_GET['message']) { + $_GET['message'] = $tradelog['message']."\t\t\t".$_G['uid']."\t".$_G['member']['username']."\t".TIMESTAMP."\t".nl2br(strip_tags(substr($_GET['message'], 0, 200))); + } else { + $_GET['message'] = $tradelog['message']; + } + + C::t('forum_tradelog')->update($orderid, array( + 'status' => $_GET['offlinestatus'], + 'lastupdate' => $_G['timestamp'], + 'message' => $_GET['message'] + )); + showmessage('trade_orderstatus_updated', 'forum.php?mod=trade&orderid='.$orderid); + } + + if(submitcheck('tradesubmit')) { + + if($tradelog['status'] == 0) { + + $update = array(); + $oldbasecredit = $tradelog['basecredit']; + $oldnumber = $tradelog['number']; + if($tradelog['sellerid'] == $_G['uid']) { + $tradelog['baseprice'] = floatval($_GET['newprice']); + $tradelog['basecredit'] = intval($_GET['newcredit']); + if(!$tradelog['baseprice'] < 0 || $tradelog['basecredit'] < 0) { + showmessage('trade_pricecredit_error'); + } + $tradelog['transportfee'] = intval($_GET['newfee']); + $newnumber = $tradelog['number']; + $update = array( + 'baseprice' => $tradelog['baseprice'], + 'basecredit' => $tradelog['basecredit'], + 'transportfee' => $tradelog['transportfee'] + ); + notification_add($tradelog['buyerid'], 'goods', 'trade_order_update_sellerid', array( + 'seller' => $tradelog['seller'], + 'sellerid' => $tradelog['sellerid'], + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + } + if($tradelog['buyerid'] == $_G['uid']) { + $newnumber = intval($_GET['newnumber']); + if($newnumber <= 0) { + showmessage('trade_input_no'); + } + $trade = C::t('forum_trade')->fetch_goods($tradelog['tid'], $tradelog['pid']); + if($newnumber > $trade['amount'] + $tradelog['number']) { + showmessage('trade_lack'); + } + $amount = $trade['amount'] + $tradelog['number'] - $newnumber; + C::t('forum_trade')->update_trade($tradelog['tid'], $tradelog['pid'], array('amount' => $amount)); + $tradelog['number'] = $newnumber; + + $update = array( + 'number' => $tradelog['number'], + 'discount' => 0, + 'buyername' => dhtmlspecialchars($_GET['newbuyername']), + 'buyercontact' => dhtmlspecialchars($_GET['newbuyercontact']), + 'buyerzip' => dhtmlspecialchars($_GET['newbuyerzip']), + 'buyerphone' => dhtmlspecialchars($_GET['newbuyerphone']), + 'buyermobile' => dhtmlspecialchars($_GET['newbuyermobile']), + 'buyermsg' => dhtmlspecialchars($_GET['newbuyermsg']) + ); + notification_add($tradelog['sellerid'], 'goods', 'trade_order_update_buyerid', array( + 'buyer' => $tradelog['buyer'], + 'buyerid' => $tradelog['buyerid'], + 'orderid' => $orderid, + 'subject' => $tradelog['subject'] + )); + } + if($update) { + if($tradelog['discount']) { + $tradelog['baseprice'] = $tradelog['baseprice'] - $tax; + $price = $tradelog['baseprice'] * $tradelog['number']; + } else { + $price = $tradelog['baseprice'] * $tradelog['number']; + } + if($_G['setting']['creditstransextra'][5] != -1 && ($oldnumber != $newnumber || $oldbasecredit != $tradelog['basecredit'])) { + $tradelog['credit'] = $newnumber * $tradelog['basecredit']; + $update['credit'] = $tradelog['credit']; + } + + $update['price'] = $price + ($tradelog['transport'] == 2 ? $tradelog['transportfee'] : 0); + C::t('forum_tradelog')->update($orderid, $update); + $tradelog = C::t('forum_tradelog')->fetch($orderid); + } + } + + } + + $tradelog['lastupdate'] = dgmdate($tradelog['lastupdate'], 'u'); + $tradelog['statusview'] = trade_getstatus($tradelog['status']); + + $messagelist = array(); + if($tradelog['offline']) { + $offlinenext = trade_offline($tradelog, 1, $trade_message); + $message = explode("\t\t\t", $tradelog['message']); + foreach($message as $row) { + $row = explode("\t", $row); + $row[2] = dgmdate($row[2], 'u'); + $row[0] && $messagelist[] = $row; + } + } else { + $loginurl = trade_getorderurl($tradelog['tradeno']); + } + + $trade = C::t('forum_trade')->fetch_goods($tradelog['tid'], $tradelog['pid']); + + include template('forum/trade_view'); + +} else { + + if(empty($_GET['pid'])) { + $pid = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid']); + $pid = $pid['pid']; + } else { + $pid = $_GET['pid']; + } + $thread = C::t('forum_thread')->fetch_thread($_G['tid']); + if($thread['closed']) { + showmessage('trade_closed', 'forum.php?mod=viewthread&tid='.$_G['tid'].'&page='.$page); + } + $trade = C::t('forum_trade')->fetch_goods($_G['tid'], $pid); + if(empty($trade)) { + showmessage('trade_not_found'); + } + $fromcode = false; + + if($trade['closed']) { + showmessage('trade_closed', 'forum.php?mod=viewthread&tid='.$_G['tid'].'&page='.$page); + } + + if($trade['price'] <= 0 && $trade['credit'] <= 0) { + showmessage('trade_invalid', 'forum.php?mod=viewthread&tid='.$_G['tid'].'&page='.$page); + } + if($trade['credit'] > 0 && $_G['setting']['creditstransextra'][5] == -1) { + showmessage('trade_credit_invalid', 'forum.php?mod=viewthread&tid='.$_G['tid'].'&page='.$page); + } + + $limit = 6; + $query = C::t('forum_trade')->fetch_all_for_seller($trade['sellerid'], $limit); + $usertrades = array(); + $usertradecount = 0; + foreach($query as $usertrade) { + $usertradecount++; + $usertrades[] = $usertrade; + } + + if($_GET['action'] != 'trade' && !submitcheck('tradesubmit')) { + $lastbuyerinfo = dhtmlspecialchars(C::t('forum_tradelog')->fetch_last($_G['uid'])); + $extra = rawurlencode($extra); + include template('forum/trade'); + } else { + + if($trade['sellerid'] == $_G['uid']) { + showmessage('trade_by_myself'); + } elseif($_GET['number'] <= 0) { + showmessage('trade_input_no'); + } elseif(!$fromcode && $_GET['number'] > $trade['amount']) { + showmessage('trade_lack'); + } + + $pay['number'] = $_GET['number']; + $pay['price'] = $trade['price']; + $credit = 0; + if($_G['setting']['creditstransextra'][5] != -1 && $trade['credit']) { + $credit = $_GET['number'] * $trade['credit']; + } + + $price = $pay['price'] * $pay['number']; + $buyercredits = 0; + $pay['commision'] = 0; + + $orderid = $pay['orderid'] = dgmdate(TIMESTAMP, 'YmdHis').random(18); + $transportfee = 0; + trade_setprice(array('fee' => $fee, 'trade' => $trade, 'transport' => $_GET['transport']), $price, $pay, $transportfee); + + $buyerid = $_G['uid'] ? $_G['uid'] : 0; + $_G['username'] = $_G['username'] ? $_G['username'] : $guestuser; + $trade = daddslashes($trade, 1); + $buyermsg = dhtmlspecialchars($_GET['buyermsg']); + $buyerzip = dhtmlspecialchars($_GET['buyerzip']); + $buyerphone = dhtmlspecialchars($_GET['buyerphone']); + $buyermobile = dhtmlspecialchars($_GET['buyermobile']); + $buyername = dhtmlspecialchars($_GET['buyername']); + $buyercontact = dhtmlspecialchars($_GET['buyercontact']); + + $offline = !empty($_GET['offline']) ? 1 : 0; + C::t('forum_tradelog')->insert(array( + 'tid' => $trade['tid'], + 'pid' => $trade['pid'], + 'orderid' => $orderid, + 'subject' => $trade['subject'], + 'price' => $price, + 'quality' => $trade['quality'], + 'itemtype' => $trade['itemtype'], + 'number' => $_GET['number'], + 'tax' => $tax, + 'locus' => $trade['locus'], + 'sellerid' => $trade['sellerid'], + 'seller' => $trade['seller'], + 'selleraccount' => $trade['account'], + 'tenpayaccount' => $trade['tenpayaccount'], + 'buyerid' => $_G['uid'], + 'buyer' => $_G['username'], + 'buyercontact' => $buyercontact, + 'buyercredits' => 0, + 'buyermsg' => $buyermsg, + 'lastupdate' => $_G['timestamp'], + 'offline' => $offline, + 'buyerzip' => $buyerzip, + 'buyerphone' => $buyerphone, + 'buyermobile' => $buyermobile, + 'buyername' => $buyername, + 'transport' => $_GET['transport'], + 'transportfee' => $transportfee, + 'baseprice' => $trade['price'], + 'discount' => 0, + 'credit' => $credit, + 'basecredit' => $trade['credit'] + )); + + C::t('forum_trade')->update_counter($trade['tid'], $trade['pid'], 0, 0, 0, '-'.$_GET['number']); + showmessage('trade_order_created', 'forum.php?mod=trade&orderid='.$orderid); + } + +} + +?> \ No newline at end of file diff --git a/source/module/forum/forum_viewthread.php b/source/module/forum/forum_viewthread.php new file mode 100644 index 0000000..89011f1 --- /dev/null +++ b/source/module/forum/forum_viewthread.php @@ -0,0 +1,1712 @@ + $_G['ppp'] ? $_G['ppp'] : ($_G['forum_thread']['replies'] ? $_G['forum_thread']['replies'] : 1); + +if(!empty($_GET['extra'])) { + parse_str($_GET['extra'], $extra); + $_GET['extra'] = array(); + foreach($extra as $_k => $_v) { + if(preg_match('/^\w+$/', $_k)) { + if(!is_array($_v)) { + $_GET['extra'][] = $_k.'='.rawurlencode($_v); + } else { + $_GET['extra'][] = http_build_query(array($_k => $_v)); + } + } + } + $_GET['extra'] = implode('&', $_GET['extra']); +} + +$_G['forum_threadindex'] = ''; +$skipaids = $aimgs = $_G['forum_posthtml'] = array(); + +$thread['subjectenc'] = rawurlencode($_G['forum_thread']['subject']); +$thread['short_subject'] = cutstr($_G['forum_thread']['subject'], 52); + +$navigation = ''; +if($_GET['from'] == 'portal') { + if($_G['forum']['status'] == 3) { + _checkviewgroup(); + } + $_G['setting']['ratelogon'] = 1; + $navigation = ' '.lang('core', 'portal').''; + $navsubject = $_G['forum_thread']['subject']; + $navtitle = $_G['forum_thread']['subject']; + +}elseif($_GET['from'] == 'preview') { + + $_G['setting']['ratelogon'] = 1; + +} elseif($_G['forum']['status'] == 3) { + _checkviewgroup(); + $nav = get_groupnav($_G['forum']); + $navigation = ' '.$_G['setting']['navs'][3]['navname'].' '.$nav['nav']; + $upnavlink = 'forum.php?mod=forumdisplay&fid='.$_G['fid'].($_GET['extra'] && !IS_ROBOT ? '&'.$_GET['extra'] : ''); + $_G['grouptypeid'] = $_G['forum']['fup']; + +} else { + $navigation = ''; + $upnavlink = 'forum.php?mod=forumdisplay&fid='.$_G['fid'].(getgpc('extra') && !IS_ROBOT ? '&'.$_GET['extra'] : ''); + + if($_G['forum']['type'] == 'sub') { + $fup = $_G['cache']['forums'][$_G['forum']['fup']]['fup']; + $t_link = $_G['cache']['forums'][$fup]['type'] == 'group' ? 'forum.php?gid='.$fup : 'forum.php?mod=forumdisplay&fid='.$fup; + $navigation .= ' '.($_G['cache']['forums'][$fup]['name']).''; + } + + if($_G['forum']['fup']) { + $fup = $_G['forum']['fup']; + $t_link = $_G['cache']['forums'][$fup]['type'] == 'group' ? 'forum.php?gid='.$fup : 'forum.php?mod=forumdisplay&fid='.$fup; + $navigation .= ' '.($_G['cache']['forums'][$fup]['name']).''; + } + + $t_link = 'forum.php?mod=forumdisplay&fid='.$_G['fid'].(getgpc('extra') && !IS_ROBOT ? '&'.$_GET['extra'] : ''); + $navigation .= ' '.($_G['forum']['name']).''; + + if($archiveid) { + if($threadtable_info[$archiveid]['displayname']) { + $t_name = dhtmlspecialchars($threadtable_info[$archiveid]['displayname']); + } else { + $t_name = lang('core', 'archive').' '.$archiveid; + } + $navigation .= ' '.$t_name.''; + } + + unset($t_link, $t_name); +} + + +$_GET['extra'] = getgpc('extra') ? rawurlencode($_GET['extra']) : ''; + +if(is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $canonical = rewriteoutput('forum_viewthread', 1, '', $_G['tid'], 1, '', ''); +} else { + $canonical = 'forum.php?mod=viewthread&tid='.$_G['tid']; +} +$_G['setting']['seohead'] .= ''; + +$_G['forum_tagscript'] = ''; + +$threadsort = $thread['sortid'] && isset($_G['forum']['threadsorts']['types'][$thread['sortid']]) ? 1 : 0; +if($threadsort) { + require_once libfile('function/threadsort'); + $threadsortshow = threadsortshow($thread['sortid'], $_G['tid']); +} + +if(empty($_G['forum']['allowview'])) { + + if(!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) { + showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); + } elseif($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) { + showmessagenoperm('viewperm', $_G['fid'], $_G['forum']['formulaperm']); + } + +} elseif($_G['forum']['allowview'] == -1) { + showmessage('forum_access_view_disallow'); +} + +if($_G['forum']['formulaperm']) { + formulaperm($_G['forum']['formulaperm']); +} + +if($_G['forum']['password'] && $_G['forum']['password'] != $_G['cookie']['fidpw'.$_G['fid']]) { + dheader("Location: {$_G['siteurl']}forum.php?mod=forumdisplay&fid={$_G['fid']}"); +} + +if($_G['forum']['price'] && !$_G['forum']['ismoderator']) { + $membercredits = C::t('common_member_forum_buylog')->get_credits($_G['uid'], $_G['fid']); + $paycredits = $_G['forum']['price'] - $membercredits; + if($paycredits > 0) { + dheader("Location: {$_G['siteurl']}forum.php?mod=forumdisplay&fid={$_G['fid']}"); + } +} + +if($_G['forum_thread']['readperm'] && $_G['forum_thread']['readperm'] > $_G['group']['readaccess'] && !$_G['forum']['ismoderator'] && $_G['forum_thread']['authorid'] != $_G['uid']) { + showmessage('thread_nopermission', NULL, array('readperm' => $_G['forum_thread']['readperm']), array('login' => 1)); +} + +$usemagic = array('user' => array(), 'thread' => array()); + +$replynotice = getstatus($_G['forum_thread']['status'], 6); + +$hiddenreplies = getstatus($_G['forum_thread']['status'], 2); + +$rushreply = getstatus($_G['forum_thread']['status'], 3); + +$savepostposition = getstatus($_G['forum_thread']['status'], 1); + +$incollection = getstatus($_G['forum_thread']['status'], 9); + +$_G['forum_threadpay'] = FALSE; +if($_G['forum_thread']['price'] > 0 && $_G['forum_thread']['special'] == 0) { + if($_G['setting']['maxchargespan'] && TIMESTAMP - $_G['forum_thread']['dateline'] >= $_G['setting']['maxchargespan'] * 3600) { + C::t('forum_thread')->update($_G['tid'], array('price' => 0), false, false, $archiveid); + $_G['forum_thread']['price'] = 0; + } else { + $exemptvalue = $_G['forum']['ismoderator'] ? 128 : 16; + if(!($_G['group']['exempt'] & $exemptvalue) && $_G['forum_thread']['authorid'] != $_G['uid']) { + if(!(C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BTC', $_G['tid']))) { + require_once libfile('thread/pay', 'include'); + $_G['forum_threadpay'] = TRUE; + } + } + } +} + +if($rushreply) { + $rewardfloor = ''; + $rushresult = $rewardfloorarr = $rewardfloorarray = array(); + $rushresult = C::t('forum_threadrush')->fetch($_G['tid']); + if($rushresult['creditlimit'] == -996) { + $rushresult['creditlimit'] = ''; + } + if((TIMESTAMP < $rushresult['starttimefrom'] || ($rushresult['starttimeto'] && TIMESTAMP > $rushresult['starttimeto']) || ($rushresult['stopfloor'] && $_G['forum_thread']['replies'] + 1 >= $rushresult['stopfloor'])) && $_G['forum_thread']['closed'] == 0) { + C::t('forum_thread')->update($_G['tid'], array('closed'=>1)); + } elseif(($rushresult['starttimefrom'] && TIMESTAMP > $rushresult['starttimefrom']) && $_G['forum_thread']['closed'] == 1) { + if(($rushresult['starttimeto'] && TIMESTAMP < $rushresult['starttimeto'] || !$rushresult['starttimeto']) && ($rushresult['stopfloor'] && $_G['forum_thread']['replies'] + 1 < $rushresult['stopfloor'] || !$rushresult['stopfloor'])) { + C::t('forum_thread')->update($_G['tid'], array('closed'=>0)); + } + } + if($rushresult['starttimefrom'] > TIMESTAMP) { + $rushresult['timer'] = $rushresult['starttimefrom'] - TIMESTAMP; + $rushresult['timertype'] = 'start'; + } elseif($rushresult['starttimeto'] > TIMESTAMP) { + $rushresult['timer'] = $rushresult['starttimeto'] - TIMESTAMP; + $rushresult['timertype'] = 'end'; + } + $rushresult['starttimefrom'] = $rushresult['starttimefrom'] ? dgmdate($rushresult['starttimefrom']) : ''; + $rushresult['starttimeto'] = $rushresult['starttimeto'] ? dgmdate($rushresult['starttimeto']) : ''; + $rushresult['creditlimit_title'] = $_G['setting']['creditstransextra'][11] ? $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][11]]['title'] : lang('forum/misc', 'credit_total'); +} + +if($_G['forum_thread']['replycredit'] > 0) { + $_G['forum_thread']['replycredit_rule'] = C::t('forum_replycredit')->fetch($thread['tid']); + $_G['forum_thread']['replycredit_rule']['remaining'] = $_G['forum_thread']['replycredit'] / $_G['forum_thread']['replycredit_rule']['extcredits']; + $_G['forum_thread']['replycredit_rule']['extcreditstype'] = $_G['forum_thread']['replycredit_rule']['extcreditstype'] ? $_G['forum_thread']['replycredit_rule']['extcreditstype'] : $_G['setting']['creditstransextra'][10] ; +} else { + $_G['forum_thread']['replycredit_rule']['extcreditstype'] = $_G['setting']['creditstransextra'][10]; +} +$_G['group']['raterange'] = $_G['setting']['modratelimit'] && $adminid == 3 && !$_G['forum']['ismoderator'] ? array() : $_G['group']['raterange']; + +$_G['group']['allowgetattach'] = (!empty($_G['forum']['allowgetattach'])) ? ($_G['forum']['allowgetattach'] == 1 ? true : false) : ($_G['forum']['getattachperm'] ? forumperm($_G['forum']['getattachperm']) : $_G['group']['allowgetattach']); +$_G['group']['allowgetimage'] = (!empty($_G['forum']['allowgetimage'])) ? ($_G['forum']['allowgetimage'] == 1 ? true : false) : ($_G['forum']['getattachperm'] ? forumperm($_G['forum']['getattachperm']) : $_G['group']['allowgetimage']); +$_G['getattachcredits'] = ''; +if($_G['forum_thread']['attachment']) { + $exemptvalue = $_G['forum']['ismoderator'] ? 32 : 4; + if(!($_G['group']['exempt'] & $exemptvalue)) { + $creditlog = updatecreditbyaction('getattach', $_G['uid'], array(), '', 1, 0, $_G['forum_thread']['fid']); + $p = ''; + if($creditlog['updatecredit']) for($i = 1;$i <= 8;$i++) { + if($policy = $creditlog['extcredits'.$i]) { + $_G['getattachcredits'] .= $p.$_G['setting']['extcredits'][$i]['title'].' '.$policy.' '.$_G['setting']['extcredits'][$i]['unit']; + $p = ', '; + } + } + } +} + +$exemptvalue = $_G['forum']['ismoderator'] ? 64 : 8; +$_G['forum_attachmentdown'] = $_G['group']['exempt'] & $exemptvalue; + +list($seccodecheck, $secqaacheck) = seccheck('post', 'reply'); +$usesigcheck = $_G['uid'] && $_G['group']['maxsigsize']; + +$postlist = $_G['forum_attachtags'] = $attachlist = $_G['forum_threadstamp'] = array(); +$aimgcount = 0; +$_G['forum_attachpids'] = array(); + +if(!empty($_GET['action']) && $_GET['action'] == 'printable' && $_G['tid']) { + require_once libfile('thread/printable', 'include'); + dexit(); +} + +if($_G['forum_thread']['stamp'] >= 0) { + $_G['forum_threadstamp'] = $_G['cache']['stamps'][$_G['forum_thread']['stamp']]; +} + +$lastmod = viewthread_lastmod($_G['forum_thread']); + +$showsettings = str_pad(decbin($_G['setting']['showsettings']), 3, '0', STR_PAD_LEFT); + +$showsignatures = $showsettings[0]; +$showavatars = $showsettings[1]; +$_G['setting']['showimages'] = $showsettings[2]; + +$highlightstatus = isset($_GET['highlight']) && str_replace('+', '', $_GET['highlight']) ? 1 : 0; + +$_G['forum']['allowreply'] = isset($_G['forum']['allowreply']) ? $_G['forum']['allowreply'] : ''; +$_G['forum']['allowpost'] = isset($_G['forum']['allowpost']) ? $_G['forum']['allowpost'] : ''; + +$allowpostreply = ($_G['forum']['allowreply'] != -1) && (($_G['forum_thread']['isgroup'] || (!$_G['forum_thread']['closed'] && !checkautoclose($_G['forum_thread']))) || $_G['forum']['ismoderator']) && ((!$_G['forum']['replyperm'] && $_G['group']['allowreply']) || ($_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm'])) || $_G['forum']['allowreply']); +$fastpost = $_G['setting']['fastpost'] && !$_G['forum_thread']['archiveid'] && ($_G['forum']['status'] != 3 || $_G['isgroupuser']); +$allowfastpost = $_G['setting']['fastpost'] && $allowpostreply; +if(!$_G['uid'] && (getglobal('setting/need_avatar') || getglobal('setting/need_secmobile') || getglobal('setting/need_email') || getglobal('setting/need_friendnum')) || in_array($_G['adminid'], array(0, -1)) && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - getglobal('member/regdate') < $_G['setting']['newbiespan'] * 60)) { + $allowfastpost = false; +} +$_G['group']['allowpost'] = $_G['forum']['allowpost'] != -1 && ((!$_G['forum']['postperm'] && $_G['group']['allowpost']) || ($_G['forum']['postperm'] && forumperm($_G['forum']['postperm'])) || $_G['forum']['allowpost']); + +$_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : ''; +$allowpostattach = $allowpostreply && ($_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || (!$_G['forum']['postattachperm'] && $_G['group']['allowpostattach']) || ($_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm'])))); + +if($_G['group']['allowpost']) { + $_G['group']['allowpostpoll'] = $_G['group']['allowpostpoll'] && ($_G['forum']['allowpostspecial'] & 1); + $_G['group']['allowposttrade'] = $_G['group']['allowposttrade'] && ($_G['forum']['allowpostspecial'] & 2); + $_G['group']['allowpostreward'] = $_G['group']['allowpostreward'] && ($_G['forum']['allowpostspecial'] & 4) && isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]); + $_G['group']['allowpostactivity'] = $_G['group']['allowpostactivity'] && ($_G['forum']['allowpostspecial'] & 8); + $_G['group']['allowpostdebate'] = $_G['group']['allowpostdebate'] && ($_G['forum']['allowpostspecial'] & 16); +} else { + $_G['group']['allowpostpoll'] = $_G['group']['allowposttrade'] = $_G['group']['allowpostreward'] = $_G['group']['allowpostactivity'] = $_G['group']['allowpostdebate'] = FALSE; +} + +$_G['forum']['threadplugin'] = $_G['group']['allowpost'] && $_G['setting']['threadplugins'] ? is_array($_G['forum']['threadplugin']) ? $_G['forum']['threadplugin'] : dunserialize($_G['forum']['threadplugin']) : array(); + +$_G['setting']['visitedforums'] = $_G['setting']['visitedforums'] && $_G['forum']['status'] != 3 ? visitedforums() : ''; + + + +$relatedthreadlist = array(); +$relatedthreadupdate = $tagupdate = FALSE; +$relatedkeywords = $tradekeywords = $_G['forum_firstpid'] = ''; + +if(!isset($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], 'modarea_c') === FALSE) { + $collapseimg['modarea_c'] = 'collapsed_no'; + $collapse['modarea_c'] = ''; +} else { + $collapseimg['modarea_c'] = 'collapsed_yes'; + $collapse['modarea_c'] = 'display: none'; +} + +$threadtag = array(); +viewthread_updateviews($archiveid); + +$postfieldsadd = $specialadd1 = $specialadd2 = $specialextra = ''; +$tpids = array(); +if($_G['forum_thread']['special'] == 2) { + if(!empty($_GET['do']) && $_GET['do'] == 'tradeinfo') { + require_once libfile('thread/trade', 'include'); + } + $query = C::t('forum_trade')->fetch_all_thread_goods($_G['tid']); + foreach($query as $trade) { + $tpids[] = $trade['pid']; + } + $specialadd2 = 1; + +} elseif($_G['forum_thread']['special'] == 5) { + if(isset($_GET['stand'])) { + $specialadd2 = 1; + $specialextra = "&stand={$_GET['stand']}"; + } +} + +$onlyauthoradd = $threadplughtml = ''; +$postarr = array(); +$maxposition = 0; +if(empty($_GET['viewpid'])) { + if(!in_array($_G['forum_thread']['special'], array(2,3,5))) { + $disablepos = !$rushreply && C::t('forum_threaddisablepos')->fetch($_G['tid']) ? 1 : 0; + if(!$disablepos) { + if($_G['forum_thread']['maxposition']) { + $maxposition = $_G['forum_thread']['maxposition']; + } else { + $maxposition = C::t('forum_post')->fetch_maxposition_by_tid($posttableid, $_G['tid']); + C::t('forum_thread')->update($_G['tid'], array('maxposition' => $maxposition)); + } + } + } + + $ordertype = empty($_GET['ordertype']) && getstatus($_G['forum_thread']['status'], 4) ? 1 : $_GET['ordertype']; + if($_GET['from'] == 'album') { + $ordertype = 1; + } + $sticklist = array(); + if($_G['page'] === 1 && $_G['forum_thread']['stickreply'] && empty($_GET['authorid'])) { + $poststick = C::t('forum_poststick')->fetch_all_by_tid($_G['tid']); + foreach(C::t('forum_post')->fetch_all_post($posttableid, array_keys($poststick)) as $post) { + if($post['invisible'] != 0) { + continue; + } + $post['position'] = $poststick[$post['pid']]['position']; + $post['avatar'] = avatar($post['authorid'], 'small'); + $post['isstick'] = true; + $sticklist[$post['pid']] = $post; + } + $stickcount = count($sticklist); + } + if($rushreply) { + $rushids = $rushpids = $rushpositionlist = $preg = $arr = array(); + $str = ',,'; + $preg_str = rushreply_rule($rushresult); + if($_GET['checkrush']) { + $maxposition = 0; + for($i = 1; $i <= $_G['forum_thread']['replies'] + 1; $i++) { + $str = $str.$i.',,'; + } + preg_match_all($preg_str, $str, $arr); + $arr = $arr[0]; + foreach($arr as $var) { + $var = str_replace(',', '', $var); + $rushids[$var] = $var; + } + $temp_reply = $_G['forum_thread']['replies']; + $_G['forum_thread']['replies'] = $countrushpost = max(0, count($rushids) - 1); + $countrushpost = max(0, count($rushids)); + $rushids = array_slice($rushids, ($page - 1) * $_G['ppp'], $_G['ppp']); + foreach(C::t('forum_post')->fetch_all_by_tid_position($posttableid, $_G['tid'], $rushids) as $post) { + $postarr[$post['position']] = $post; + } + } else { + for($i = ($page - 1) * $_G['ppp'] + 1; $i <= $page * $_G['ppp']; $i++) { + $str = $str.$i.',,'; + } + preg_match_all($preg_str, $str, $arr); + $arr = $arr[0]; + foreach($arr as $var) { + $var = str_replace(',', '', $var); + $rushids[$var] = $var; + } + $_G['forum_thread']['replies'] = $_G['forum_thread']['replies'] - 1; + } + } + + if(!empty($_GET['authorid'])) { + $maxposition = 0; + $_G['forum_thread']['replies'] = C::t('forum_post')->count_by_tid_invisible_authorid($_G['tid'], $_GET['authorid']); + $_G['forum_thread']['replies']--; + if($_G['forum_thread']['replies'] < 0) { + showmessage('undefined_action'); + } + $onlyauthoradd = 1; + } elseif($_G['forum_thread']['special'] == 5) { + if(isset($_GET['stand']) && $_GET['stand'] >= 0 && $_GET['stand'] < 3) { + $_G['forum_thread']['replies'] = C::t('forum_debatepost')->count_by_tid_stand($_G['tid'], $_GET['stand']); + } else { + $_G['forum_thread']['replies'] = C::t('forum_post')->count_visiblepost_by_tid($_G['tid']); + $_G['forum_thread']['replies'] > 0 && $_G['forum_thread']['replies']--; + } + } elseif($_G['forum_thread']['special'] == 2) { + $tradenum = C::t('forum_trade')->fetch_counter_thread_goods($_G['tid']); + $_G['forum_thread']['replies'] -= $tradenum; + } + + if($maxposition) { + $_G['forum_thread']['replies'] = $maxposition - 1; + } + $_G['ppp'] = $_G['forum']['threadcaches'] && !$_G['uid'] ? $_G['setting']['postperpage'] : $_G['ppp']; + $totalpage = ceil(($_G['forum_thread']['replies'] + 1) / $_G['ppp']); + $page > $totalpage && $page = $totalpage; + $_G['forum_pagebydesc'] = !$maxposition && $page > 2 && $page > ($totalpage / 2) ? TRUE : FALSE; + + if($_G['forum_pagebydesc']) { + $firstpagesize = ($_G['forum_thread']['replies'] + 1) % $_G['ppp']; + $_G['forum_ppp3'] = $_G['forum_ppp2'] = $page == $totalpage && $firstpagesize ? $firstpagesize : $_G['ppp']; + $realpage = $totalpage - $page + 1; + if($firstpagesize == 0) { + $firstpagesize = $_G['ppp']; + } + $start_limit = max(0, ($realpage - 2) * $_G['ppp'] + $firstpagesize); + $_G['forum_numpost'] = ($page - 1) * $_G['ppp']; + if($ordertype != 1) { + } else { + $_G['forum_numpost'] = $_G['forum_thread']['replies'] + 2 - $_G['forum_numpost'] + ($page == $totalpage ? 1 : 0); + } + } else { + $start_limit = $_G['forum_numpost'] = max(0, ($page - 1) * $_G['ppp']); + if($start_limit > $_G['forum_thread']['replies']) { + $start_limit = $_G['forum_numpost'] = 0; + $page = 1; + } + if($ordertype != 1) { + } else { + $_G['forum_numpost'] = $_G['forum_thread']['replies'] + 2 - $_G['forum_numpost']; + } + } + $multipageparam = ($_G['forum_thread']['is_archived'] ? '&archive='.$_G['forum_thread']['archiveid'] : ''). + '&extra='.$_GET['extra']. + ($ordertype && $ordertype != getstatus($_G['forum_thread']['status'], 4) ? '&ordertype='.$ordertype : ''). + (isset($_GET['highlight']) ? '&highlight='.rawurlencode($_GET['highlight']) : ''). + (!empty($_GET['authorid']) ? '&authorid='.$_GET['authorid'] : ''). + (!empty($_GET['from']) ? '&from='.$_GET['from'] : ''). + (!empty($_GET['checkrush']) ? '&checkrush='.$_GET['checkrush'] : ''). + (!empty($_GET['modthreadkey']) ? '&modthreadkey='.rawurlencode($_GET['modthreadkey']) : ''). + $specialextra; + $multipage = multi($_G['forum_thread']['replies'] + ($ordertype != 1 ? 1 : 0), $_G['ppp'], $page, 'forum.php?mod=viewthread&tid='.$_G['tid'].$multipageparam); +} else { + $_GET['viewpid'] = intval($_GET['viewpid']); + $pageadd = "AND p.pid='{$_GET['viewpid']}'"; +} + +$_G['forum_newpostanchor'] = $_G['forum_postcount'] = 0; + +$_G['forum_onlineauthors'] = $_G['forum_cachepid'] = $_G['blockedpids'] = array(); + + +$isdel_post = $cachepids = $postusers = $skipaids = array(); + +if($_G['forum_auditstatuson'] || in_array($_G['forum_thread']['displayorder'], array(-2, -3, -4)) && $_G['forum_thread']['authorid'] == $_G['uid']) { + $visibleallflag = 1; +} + +if($maxposition) { + $start = ($page - 1) * $_G['ppp'] + 1; + $end = $start + $_G['ppp']; + if($ordertype == 1) { + $end = $maxposition - ($page - 1) * $_G['ppp'] + ($page > 1 ? 2 : 1); + $start = $end - $_G['ppp'] + ($page > 1 ? 0 : 1); + $start = max(array(1,$start)); + } + $have_badpost = $realpost = $lastposition = 0; + foreach(C::t('forum_post')->fetch_all_by_tid_range_position($posttableid, $_G['tid'], $start, $end, $maxposition, $ordertype) as $post) { + if($post['invisible'] != 0) { + $have_badpost = 1; + } + $cachepids[$post['position']] = $post['pid']; + $postarr[$post['position']] = $post; + $lastposition = $post['position']; + } + $realpost = is_array($postarr) ? count($postarr) : 0; + if($realpost != $_G['ppp'] || $have_badpost) { + $k = 0; + for($i = $start; $i < $end; $i ++) { + if(!empty($cachepids[$i])) { + $k = $cachepids[$i]; + $isdel_post[$i] = array('deleted' => 1, 'pid' => $k, 'message' => '', 'position' => $i); + } elseif($i < $maxposition || ($lastposition && $i < $lastposition)) { + $isdel_post[$i] = array('deleted' => 1, 'pid' => $k, 'message' => '', 'position' => $i); + } + $k ++; + } + } + $pagebydesc = false; +} + +if(getgpc('checkrush') && $rushreply) { + $_G['forum_thread']['replies'] = $temp_reply; +} + + +if(!$maxposition && empty($postarr)) { + + if(empty($_GET['viewpid'])) { + if($_G['forum_thread']['special'] == 2) { + $postarr = C::t('forum_post')->fetch_all_tradepost_viewthread_by_tid($_G['tid'], $visibleallflag, $_GET['authorid'], $tpids, $_G['forum_pagebydesc'], $ordertype, $start_limit, ($_G['forum_pagebydesc'] ? $_G['forum_ppp2'] : $_G['ppp'])); + } elseif($_G['forum_thread']['special'] == 5) { + $postarr = C::t('forum_post')->fetch_all_debatepost_viewthread_by_tid($_G['tid'], $visibleallflag, $_GET['authorid'], $_GET['stand'], $_G['forum_pagebydesc'], $ordertype, $start_limit, ($_G['forum_pagebydesc'] ? $_G['forum_ppp2'] : $_G['ppp'])); + } else { + $postarr = C::t('forum_post')->fetch_all_common_viewthread_by_tid($_G['tid'], $visibleallflag, $_GET['authorid'], $_G['forum_pagebydesc'], $ordertype, $_G['forum_thread']['replies'] + 1, $start_limit, ($_G['forum_pagebydesc'] ? $_G['forum_ppp2'] : $_G['ppp'])); + } + } else { + $post = array(); + if($_G['forum_thread']['special'] == 2) { + if(!in_array($_GET['viewpid'], $tpids)) { + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'],$_GET['viewpid']); + } + } elseif($_G['forum_thread']['special'] == 5) { + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['viewpid']); + $debatpost = C::t('forum_debatepost')->fetch($_GET['viewpid']); + if(!isset($_GET['stand']) || (isset($_GET['stand']) && ($post['first'] == 1 || $debatpost['stand'] == $_GET['stand']))) { + $post = array_merge($post, $debatpost); + } else { + $post = array(); + } + unset($debatpost); + } else { + $post = C::t('forum_post')->fetch_post('tid:'.$_G['tid'], $_GET['viewpid']); + } + if($post['tid'] != $_G['tid']) { + $post = array(); + } + + if($post) { + if($visibleallflag || (!$visibleallflag && !$post['invisible'])) { + $postarr[0] = $post; + } + } + } + +} + +if(!empty($isdel_post)) { + $updatedisablepos = false; + foreach($isdel_post as $id => $post) { + if(isset($postarr[$id]['invisible']) && ($postarr[$id]['invisible'] == 0 || $postarr[$id]['invisible'] == -3 || $visibleallflag)) { + continue; + } + $postarr[$id] = $post; + $updatedisablepos = true; + } + if($updatedisablepos && !$rushreply) { + C::t('forum_threaddisablepos')->insert(array('tid' => $_G['tid']), false, true); + dheader('Location:'.$_G['siteurl'].'forum.php?mod=viewthread&tid='.$_G['tid'].($_G['forum_auditstatuson'] ? '&modthreadkey='.$_GET['modthreadkey'] : '').($_G['page'] > 1 ? '&page=' . $_G['page'] : '')); + } + $ordertype != 1 ? ksort($postarr) : krsort($postarr); +} +$summary = ''; +$curpagepids = array(); +foreach($postarr as $post) { + $curpagepids[] = $post['pid']; +} +if($page == 1 && $ordertype == 1) { + $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid']); + if($firstpost['invisible'] == 0 || $visibleallflag == 1) { + $postarr = array_merge(array($firstpost), $postarr); + unset($firstpost); + } +} +$tagnames = $locationpids = $hotpostarr = $hotpids = $member_blackList = array(); + +$remainhots = ($_G['page'] == 1 && !$rushreply && !$hiddenreplies && !$_G['forum_thread']['special'] && !$_G['forum']['noforumrecommend'] && empty($_GET['authorid'])) ? $_G['setting']['threadhotreplies'] : 0; +if($remainhots) { + $hotpids = array_keys(C::t('forum_hotreply_number')->fetch_all_by_tid_total($_G['tid'], 10)); + $remainhots = $remainhots - count($hotpids); +} + +if($_G['setting']['nofilteredpost'] && $_G['forum_thread']['replies'] > $_G['setting']['postperpage'] && $remainhots) { + $hotpids = array_merge($hotpids, array_keys(C::t('forum_filter_post')->fetch_all_by_tid_postlength_limit($_G['tid'], $remainhots))); +} + +if($hotpids) { + $hotposts = C::t('forum_post')->fetch_all_by_pid($posttableid, $hotpids); + foreach($hotpids as $hotpid) { + if($hotposts[$hotpid]) { + $hotpostarr[$hotpid] = $hotposts[$hotpid]; + $hotpostarr[$hotpid]['hotrecommended'] = true; + } + } + unset($hotposts); +} + +if($hotpostarr || $sticklist) { + $_newpostarr_first = array_shift($postarr); + $postarr = (array)$sticklist + (array)$hotpostarr + $postarr; + array_unshift($postarr, $_newpostarr_first); + unset($_newpostarr_first, $sticklist); +} + +foreach($postarr as $post) { + if(($onlyauthoradd && empty($post['anonymous']) || !$onlyauthoradd) && !isset($postlist[$post['pid']])) { + + if(isset($hotpostarr[$post['pid']])) { + $post['existinfirstpage'] = true; + } + + $post['incurpage'] = in_array($post['pid'],$curpagepids); + $postusers[$post['authorid']] = array(); + if($post['first']) { + if($ordertype == 1 && $page != 1) { + continue; + } + $_G['forum_firstpid'] = $post['pid']; + if($_G['forum_thread']['price']) { + $summary = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($thread['freemessage']), 160)); + } else { + $summary = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160)); + } + $tagarray_all = $posttag_array = array(); + $tagarray_all = explode("\t", $post['tags']); + if($tagarray_all) { + foreach($tagarray_all as $var) { + if($var) { + $tag = explode(',', $var); + $posttag_array[] = $tag; + $tagnames[] = $tag[1]; + } + } + } + $post['tags'] = $posttag_array; + if($post['tags']) { + $post['relateitem'] = getrelateitem($post['tags'], $post['tid'], $_G['setting']['relatenum'], $_G['setting']['relatetime']); + } + if(!$_G['forum']['disablecollect']) { + if($incollection) { + $post['relatecollection'] = getrelatecollection($post['tid'], false, $post['releatcollectionnum'], $post['releatcollectionmore']); + if($_G['group']['allowcommentcollection'] && $_GET['ctid']) { + $ctid = dintval($_GET['ctid']); + $post['sourcecollection'] = C::t('forum_collection')->fetch($ctid); + } + } else { + $post['releatcollectionnum'] = 0; + } + } + } + $postlist[$post['pid']] = $post; + } +} +unset($hotpostarr); +$seodata = array('forum' => $_G['forum']['name'], 'fup' => $_G['cache']['forums'][$fup]['name'], 'subject' => $_G['forum_thread']['subject'], 'summary' => $summary, 'tags' => @implode(',', $tagnames), 'page' => intval(getgpc('page'))); +if($_G['forum']['status'] != 3) { + $seotype = 'viewthread'; +} else { + $seotype = 'viewthread_group'; + $seodata['first'] = $nav['first']['name']; + $seodata['second'] = $nav['second']['name']; + $seodata['gdes'] = $_G['forum']['description']; +} + +list($navtitle, $metadescription, $metakeywords) = get_seosetting($seotype, $seodata); +if(!$navtitle) { + $navtitle = helper_seo::get_title_page($_G['forum_thread']['subject'], $_G['page']).' - '.strip_tags($_G['forum']['name']); + $nobbname = false; +} else { + $nobbname = true; +} +if(!$metakeywords) { + $metakeywords = strip_tags($thread['subject']); +} +if(!$metadescription) { + $metadescription = $summary.' '.strip_tags($_G['forum_thread']['subject']); +} + +$_G['allblocked'] = true; +$postno = & $_G['cache']['custominfo']['postno']; +$postnostick = str_replace(array('', ''), '', $postno[0]); +if($postusers) { + $member_verify = $member_field_forum = $member_status = $member_count = $member_profile = $member_field_home = array(); + $uids = array_keys($postusers); + $uids = array_filter($uids); + + $selfuids = $uids; + if($_G['setting']['threadblacklist'] && $_G['uid'] && !in_array($_G['uid'], $selfuids)) { + $selfuids[] = $_G['uid']; + } + if(!(getglobal('setting/threadguestlite') && !$_G['uid'])) { + if($_G['setting']['verify']['enabled']) { + $member_verify = C::t('common_member_verify')->fetch_all($uids); + foreach($member_verify as $uid => $data) { + foreach($_G['setting']['verify'] as $vid => $verify) { + if($verify['available'] && $verify['showicon']) { + if($data['verify'.$vid] == 1) { + $member_verify[$uid]['verifyicon'][] = $vid; + } elseif (!empty($verify['unverifyicon'])) { + $member_verify[$uid]['unverifyicon'][] = $vid; + } + } + } + } + } + $member_count = C::t('common_member_count')->fetch_all($selfuids); + $member_status = C::t('common_member_status')->fetch_all($uids); + $member_field_forum = C::t('common_member_field_forum')->fetch_all($uids); + $member_profile = C::t('common_member_profile')->fetch_all($uids); + $member_field_home = C::t('common_member_field_home')->fetch_all($uids); + } + + if($_G['setting']['threadblacklist'] && $_G['uid'] && $member_count[$_G['uid']]['blacklist']) { + $member_blackList = C::t('home_blacklist')->fetch_all_by_uid_buid($_G['uid'], $uids); + } + + foreach(C::t('common_member')->fetch_all($uids) as $uid => $postuser) { + $member_field_home[$uid]['privacy'] = empty($member_field_home[$uid]['privacy']) ? array() : dunserialize($member_field_home[$uid]['privacy']); + $postuser['memberstatus'] = $postuser['status']; + $postuser['authorinvisible'] = $member_status[$uid]['invisible']; + $postuser['signature'] = $member_field_forum[$uid]['sightml']; + unset($member_field_home[$uid]['privacy']['feed'], $member_field_home[$uid]['privacy']['view'], $postuser['status'], $member_status[$uid]['invisible'], $member_field_forum[$uid]['sightml']); + $postusers[$uid] = array_merge((isset($member_verify[$uid]) ? (array)$member_verify[$uid] : array()), (array)$member_field_home[$uid], (array)$member_profile[$uid], (array)$member_count[$uid], (array)$member_status[$uid], (array)$member_field_forum[$uid], $postuser); + if($postusers[$uid]['regdate'] + $postusers[$uid]['oltime'] * 3600 > TIMESTAMP) { + $postusers[$uid]['oltime'] = 0; + } + $postusers[$uid]['office'] = $postusers[$uid]['position']; + $postusers[$uid]['inblacklist'] = !empty($member_blackList[$uid]); + $postusers[$uid]['groupcolor'] = $_G['cache']['usergroups'][$postuser['groupid']]['color']; + unset($postusers[$uid]['position']); + } + unset($member_field_forum, $member_status, $member_count, $member_profile, $member_field_home, $member_blackList); + $_G['medal_list'] = array(); + foreach($postlist as $pid => $post) { + if(getstatus($post['status'], 6)) { + $locationpids[] = $pid; + } + $postusers[$post['authorid']]['field_position'] = $postusers[$post['authorid']]['position']; + $post = array_merge($postlist[$pid], (array)$postusers[$post['authorid']]); + $postlist[$pid] = viewthread_procpost($post, $_G['member']['lastvisit'], $ordertype, $maxposition); + } +} + +if($_G['allblocked']) { + $_G['blockedpids'] = array(); +} + +if($locationpids) { + $locations = C::t('forum_post_location')->fetch_all($locationpids); +} + +if($postlist && !empty($rushids)) { + foreach($postlist as $pid => $post) { + $post['number'] = $post['position']; + $postlist[$pid] = checkrushreply($post); + } +} + +if($_G['setting']['repliesrank'] && $postlist) { + if($postlist) { + foreach(C::t('forum_hotreply_number')->fetch_all_by_pids(array_keys($postlist)) as $pid => $post) { + $postlist[$pid]['postreview']['support'] = dintval($post['support']); + $postlist[$pid]['postreview']['against'] = dintval($post['against']); + } + } +} + + +if($_G['forum_thread']['special'] > 0 && (empty($_GET['viewpid']) || $_GET['viewpid'] == $_G['forum_firstpid'])) { + $_G['forum_thread']['starttime'] = gmdate($_G['forum_thread']['dateline']); + $_G['forum_thread']['remaintime'] = ''; + switch($_G['forum_thread']['special']) { + case 1: require_once libfile('thread/poll', 'include'); break; + case 2: require_once libfile('thread/trade', 'include'); break; + case 3: require_once libfile('thread/reward', 'include'); break; + case 4: require_once libfile('thread/activity', 'include'); break; + case 5: require_once libfile('thread/debate', 'include'); break; + case 127: + if($_G['forum_firstpid']) { + $sppos = strpos($postlist[$_G['forum_firstpid']]['message'], chr(0).chr(0).chr(0)); + $specialextra = substr($postlist[$_G['forum_firstpid']]['message'], $sppos + 3); + $postlist[$_G['forum_firstpid']]['message'] = substr($postlist[$_G['forum_firstpid']]['message'], 0, $sppos); + if($specialextra) { + if(array_key_exists($specialextra, $_G['setting']['threadplugins'])) { + @include_once DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['threadplugins'][$specialextra]['module'].'.class.php'; + $classname = 'threadplugin_'.$specialextra; + if(class_exists($classname) && method_exists($threadpluginclass = new $classname, 'viewthread')) { + $threadplughtml = $threadpluginclass->viewthread($_G['tid']); + } + } + } + } + break; + } +} +if(empty($_GET['authorid']) && empty($postlist)) { + if($rushreply) { + dheader("Location: forum.php?mod=redirect&tid={$_G['tid']}&goto=lastpost"); + } else { + $replies = C::t('forum_post')->count_visiblepost_by_tid($_G['tid']); + $replies = intval($replies) - 1; + if($_G['forum_thread']['replies'] != $replies && $replies > 0) { + C::t('forum_thread')->update($_G['tid'], array('replies' => $replies), false, false, $archiveid); + dheader("Location: forum.php?mod=redirect&tid={$_G['tid']}&goto=lastpost"); + } + } +} + +if($_G['forum_pagebydesc'] && (!$savepostposition || $_GET['ordertype'] == 1)) { + $postlist = array_reverse($postlist, TRUE); +} + +if(!empty($_G['setting']['sessionclose'])) { + $_G['setting']['vtonlinestatus'] = 1; +} + +if($_G['setting']['vtonlinestatus'] == 2 && $_G['forum_onlineauthors']) { + foreach(C::app()->session->fetch_all_by_uid(array_keys($_G['forum_onlineauthors'])) as $author) { + if(!$author['invisible']) { + $_G['forum_onlineauthors'][$author['uid']] = 1; + } + } +} else { + $_G['forum_onlineauthors'] = array(); +} +$ratelogs = $comments = $commentcount = $totalcomment = array(); +if($_G['forum_cachepid']) { + foreach(C::t('forum_postcache')->fetch_all($_G['forum_cachepid']) as $postcache) { + if($postcache['rate']) { + $postcache['rate'] = dunserialize($postcache['rate']); + $postlist[$postcache['pid']]['ratelog'] = dhtmlspecialchars($postcache['rate']['ratelogs']); + $postlist[$postcache['pid']]['ratelogextcredits'] = $postcache['rate']['extcredits']; + $postlist[$postcache['pid']]['totalrate'] = $postcache['rate']['totalrate']; + } + if($postcache['comment']) { + $postcache['comment'] = dunserialize($postcache['comment']); + $commentcount[$postcache['pid']] = $postcache['comment']['count']; + $comments[$postcache['pid']] = $postcache['comment']['data']; + $totalcomment[$postcache['pid']] = $postcache['comment']['totalcomment']; + } + unset($_G['forum_cachepid'][$postcache['pid']]); + } + $postcache = $ratelogs = array(); + if($_G['forum_cachepid']) { + list($ratelogs, $postlist, $postcache) = C::t('forum_ratelog')->fetch_postrate_by_pid($_G['forum_cachepid'], $postlist, $postcache, $_G['setting']['ratelogrecord']); + } + foreach($postlist as $key => $val) { + if(!empty($val['ratelogextcredits'])) { + ksort($postlist[$key]['ratelogextcredits']); + } + } + + if($_G['forum_cachepid'] && $_G['setting']['commentnumber']) { + list($commentsnew, $postcache, $commentcount, $totalcomment) = C::t('forum_postcomment')->fetch_postcomment_by_pid($_G['forum_cachepid'], $postcache, $commentcount, $totalcomment, $_G['setting']['commentnumber']); + $comments = $commentsnew + $comments; + } + + foreach($postcache as $pid => $data) { + C::t('forum_postcache')->insert(array('pid' => $pid, 'rate' => serialize($data['rate']), 'comment' => serialize($data['comment']), 'dateline' => TIMESTAMP), false, true); + } +} + +if($_G['forum_attachpids'] && !defined('IN_ARCHIVER')) { + require_once libfile('function/attachment'); + if(is_array($threadsortshow) && !empty($threadsortshow['sortaids'])) { + $skipaids = $threadsortshow['sortaids']; + } + parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist, $skipaids); +} + +if(empty($postlist)) { + if($thread['closed'] > 1 && $thread['isgroup'] != 1) { + if(is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $canonical = rewriteoutput('forum_viewthread', 1, '', $thread['closed'], 1, '', ''); + } else { + $canonical = 'forum.php?mod=viewthread&tid='.$thread['closed']; + } + dheader('Location:'.$_G['siteurl'].$canonical); + } + showmessage('post_not_found'); +} elseif(!defined('IN_MOBILE_API')) { + foreach($postlist as $pid => $post) { + $postlist[$pid]['message'] = preg_replace("/\[attach\]\d+\[\/attach\]/i", '', $postlist[$pid]['message']); + } +} + +if(defined('IN_ARCHIVER')) { + include loadarchiver('forum/viewthread'); + exit(); +} + +$_G['forum_thread']['heatlevel'] = $_G['forum_thread']['recommendlevel'] = 0; +if($_G['setting']['heatthread']['iconlevels']) { + foreach($_G['setting']['heatthread']['iconlevels'] as $k => $i) { + if($_G['forum_thread']['heats'] > $i) { + $_G['forum_thread']['heatlevel'] = $k + 1; + break; + } + } +} + +if(!empty($_G['setting']['recommendthread']['status']) && $_G['forum_thread']['recommends']) { + foreach($_G['setting']['recommendthread']['iconlevels'] as $k => $i) { + if($_G['forum_thread']['recommends'] > $i) { + $_G['forum_thread']['recommendlevel'] = $k+1; + break; + } + } +} + +$allowblockrecommend = getglobal('group/allowdiy') || getstatus(getglobal('member/allowadmincp'), 4) || getstatus(getglobal('member/allowadmincp'), 5) || getstatus(getglobal('member/allowadmincp'), 6); +if($_G['setting']['portalstatus']) { + $allowpostarticle = $_G['group']['allowmanagearticle'] || $_G['group']['allowpostarticle'] || getstatus($_G['member']['allowadmincp'], 2) || getstatus($_G['member']['allowadmincp'], 3); + $allowpusharticle = empty($_G['forum_thread']['special']) && empty($_G['forum_thread']['sortid']) && !$_G['forum_thread']['pushedaid']; +} else { + $allowpostarticle = $allowpusharticle = false; +} +if($_G['forum_thread']['displayorder'] != -4) { + $modmenu = array( + 'thread' => $_G['forum']['ismoderator'] || $allowblockrecommend || $allowpusharticle && $allowpostarticle, + 'post' => $_G['forum']['ismoderator'] && ($_G['group']['allowwarnpost'] || $_G['group']['allowbanpost'] || $_G['group']['allowdelpost'] || $_G['group']['allowstickreply']) || $_G['forum_thread']['pushedaid'] && $allowpostarticle || $_G['forum_thread']['authorid'] == $_G['uid'] + ); +} else { + $modmenu = array(); +} + +if($_G['forum']['alloweditpost'] && $_G['uid']) { + $alloweditpost_status = getstatus($_G['setting']['alloweditpost'], $_G['forum_thread']['special'] + 1); + if(!$alloweditpost_status) { + $edittimelimit = $_G['group']['edittimelimit'] * 60; + } +} + +if($_G['forum_thread']['replies'] > $_G['forum_thread']['views']) { + $_G['forum_thread']['views'] = $_G['forum_thread']['replies']; +} + +require_once libfile('function/upload'); +$swfconfig = getuploadconfig($_G['uid'], $_G['fid']); +$_G['forum_thread']['relay'] = 0; + +if(getstatus($_G['forum_thread']['status'], 10)) { + $preview = C::t('forum_threadpreview')->fetch($_G['tid']); + $_G['forum_thread']['relay'] = $preview['relay']; +} + +if(empty($_GET['viewpid'])) { + $sufix = ''; + if($_GET['from'] == 'portal') { + $_G['disabledwidthauto'] = 1; + $_G['widthauto'] = 0; + $sufix = '_portal'; + $post = &$postlist[$_G['forum_firstpid']]; + } elseif($_GET['from'] == 'preview') { + $_G['disabledwidthauto'] = 1; + $_G['widthauto'] = 0; + $sufix = '_preview'; + } elseif($_GET['from'] == 'album') { + $_G['disabledwidthauto'] = 1; + $_G['widthauto'] = 0; + $sufix = '_album'; + $post = &$postlist[$_G['forum_firstpid']]; + $post['message'] = cutstr(strip_tags(preg_replace('/(.*<\/ignore_js_op>)/is', '', $post['message'])), 200); + require_once libfile('thread/album', 'include'); + } + include template('diy:forum/viewthread'.$sufix.':'.$_G['fid']); +} else { + $_G['setting']['admode'] = 0; + $post = $postlist[$_GET['viewpid']]; + if($maxposition) { + $post['number'] = $post['position']; + } else { + $post['number'] = C::t('forum_post')->count_by_tid_dateline($posttableid, $post['tid'], $post['dbdateline']); + } + if($rushreply) { + $post['number'] = $post['position']; + $preg_str = rushreply_rule($rewardfloorarr); + preg_match_all($preg_str, ",,".$post['number'].",,", $arr); + if($post['number'] == str_replace(",", '', $arr['0']['0'])) { + $post['rewardfloor'] = 1; + } + } + include template('common/header_ajax'); + hookscriptoutput('viewthread'); + $postcount = 0; + if($_GET['from']) { + include template($_GET['from'] == 'preview' ? 'forum/viewthread_preview_node' : 'forum/viewthread_from_node'); + } else { + include template('forum/viewthread_node'); + } + include template('common/footer_ajax'); +} + + + +function viewthread_updateviews($tableid) { + global $_G; + + if(!$_G['setting']['preventrefresh'] || getcookie('viewid') != 'tid_'.$_G['tid']) { + if(!$tableid && getglobal('setting/optimizeviews')) { + if(isset($_G['forum_thread']['addviews'])) { + if($_G['forum_thread']['addviews'] < 100) { + C::t('forum_threadaddviews')->update_by_tid($_G['tid']); + } else { + if(!discuz_process::islocked('update_thread_view')) { + $row = C::t('forum_threadaddviews')->fetch($_G['tid']); + C::t('forum_threadaddviews')->update($_G['tid'], array('addviews' => 0)); + C::t('forum_thread')->increase($_G['tid'], array('views' => $row['addviews']+1), true); + discuz_process::unlock('update_thread_view'); + } + } + } else { + C::t('forum_threadaddviews')->insert(array('tid' => $_G['tid'], 'addviews' => 1), false, true); + } + } else { + C::t('forum_thread')->increase($_G['tid'], array('views' => 1), true, $tableid); + } + } + dsetcookie('viewid', 'tid_'.$_G['tid']); +} + +function viewthread_procpost($post, $lastvisit, $ordertype, $maxposition = 0) { + global $_G, $rushreply, $hiddenreplies; + + if(!$_G['forum_newpostanchor'] && $post['dateline'] > $lastvisit) { + $post['newpostanchor'] = ''; + $_G['forum_newpostanchor'] = 1; + } else { + $post['newpostanchor'] = ''; + } + + $post['lastpostanchor'] = ($ordertype != 1 && $_G['forum_numpost'] == $_G['forum_thread']['replies']) || ($ordertype == 1 && $_G['forum_numpost'] == $_G['forum_thread']['replies'] + 2 && (!$_G['forum_thread']['replies'] || !$post['first'])) ? '' : ''; + + if(empty($post['hotrecommended']) && $post['incurpage']) { + if($_G['forum_pagebydesc']) { + if($ordertype != 1) { + $post['number'] = $_G['forum_numpost'] + $_G['forum_ppp2']--; + } else { + $post['number'] = $post['first'] == 1 ? 1 : $_G['forum_numpost'] - $_G['forum_ppp2']--; + } + } else { + if($ordertype != 1) { + $post['number'] = ++$_G['forum_numpost']; + } else { + $post['number'] = $post['first'] == 1 ? 1 : --$_G['forum_numpost']; + } + } + } + + if(!empty($post['existinfirstpage']) && $post['incurpage']) { + if($_G['forum_pagebydesc']) { + $_G['forum_ppp2']--; + } else { + if($ordertype != 1) { + ++$_G['forum_numpost']; + } else { + --$_G['forum_numpost']; + } + } + } + + if($maxposition) { + $post['number'] = $post['position']; + } + + if(!empty($post['hotrecommended'])) { + $post['number'] = -1; + } + + if(!$_G['forum_thread']['special'] && !$rushreply && empty($hiddenreplies) && $_G['setting']['threadfilternum'] && getstatus($post['status'], 11)) { + $post['isWater'] = true; + if($_G['setting']['hidefilteredpost'] && !$_G['forum']['noforumhidewater']) { + $post['inblacklist'] = true; + } + } else { + $_G['allblocked'] = false; + } + + if($post['inblacklist']) { + $_G['blockedpids'][] = $post['pid']; + } + + $_G['forum_postcount']++; + + $post['dbdateline'] = $post['dateline']; + $post['dateline'] = dgmdate($post['dateline'], 'u', '9999', getglobal('setting/dateformat').' H:i:s'); + $post['groupid'] = $_G['cache']['usergroups'][$post['groupid']] ? $post['groupid'] : 7; + + if($post['username']) { + + $_G['forum_onlineauthors'][$post['authorid']] = 0; + $post['usernameenc'] = rawurlencode($post['username']); + $post['readaccess'] = $_G['cache']['usergroups'][$post['groupid']]['readaccess']; + if($_G['cache']['usergroups'][$post['groupid']]['userstatusby'] == 1) { + $post['authortitle'] = $_G['cache']['usergroups'][$post['groupid']]['grouptitle']; + $post['stars'] = $_G['cache']['usergroups'][$post['groupid']]['stars']; + } + $post['upgradecredit'] = false; + if($_G['cache']['usergroups'][$post['groupid']]['type'] == 'member' && $_G['cache']['usergroups'][$post['groupid']]['creditslower'] != 999999999) { + $post['upgradecredit'] = $_G['cache']['usergroups'][$post['groupid']]['creditslower'] - $post['credits']; + $post['upgradeprogress'] = 100 - ceil($post['upgradecredit'] / ($_G['cache']['usergroups'][$post['groupid']]['creditslower'] - $_G['cache']['usergroups'][$post['groupid']]['creditshigher']) * 100); + $post['upgradeprogress'] = min(max($post['upgradeprogress'], 2), 100); + } + + $post['taobaoas'] = addslashes($post['taobao']); + $post['regdate'] = dgmdate($post['regdate'], 'd'); + $post['lastdate'] = dgmdate($post['lastvisit'], 'd'); + + $post['authoras'] = !$post['anonymous'] ? ' '.addslashes($post['author']) : ''; + + if($post['medals']) { + loadcache('medals'); + foreach($post['medals'] = explode("\t", $post['medals']) as $key => $medalid) { + list($medalid, $medalexpiration) = explode("|", $medalid); + if(isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) { + $post['medals'][$key] = $_G['cache']['medals'][$medalid]; + $post['medals'][$key]['medalid'] = $medalid; + $_G['medal_list'][$medalid] = $_G['cache']['medals'][$medalid]; + } else { + unset($post['medals'][$key]); + } + } + } + + $post['avatar'] = avatar($post['authorid']); + $post['groupicon'] = $post['avatar'] ? g_icon($post['groupid'], 1) : ''; + $post['banned'] = $post['status'] & 1; + $post['warned'] = ($post['status'] & 2) >> 1; + + } else { + if(!$post['authorid']) { + $post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')).'.x'; + } + } + $post['attachments'] = array(); + $post['imagelist'] = $post['attachlist'] = array(); + + if($post['attachment']) { + if((!empty($_G['setting']['guestviewthumb']['flag']) && !$_G['uid']) || $_G['group']['allowgetattach'] || $_G['group']['allowgetimage']) { + $_G['forum_attachpids'][] = $post['pid']; + $post['attachment'] = 0; + if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $post['message'], $matchaids)) { + $_G['forum_attachtags'][$post['pid']] = $matchaids[1]; + } + } else { + $post['message'] = preg_replace("/\[attach\](\d+)\[\/attach\]/i", '', $post['message']); + } + } + + if($_G['setting']['ratelogrecord'] && $post['ratetimes']) { + $_G['forum_cachepid'][$post['pid']] = $post['pid']; + } + if($_G['setting']['commentnumber'] && ($post['first'] && $_G['setting']['commentfirstpost'] || !$post['first']) && $post['comment']) { + $_G['forum_cachepid'][$post['pid']] = $post['pid']; + } + $post['allowcomment'] = $_G['setting']['commentnumber'] && is_array($_G['setting']['allowpostcomment']) && in_array(1, $_G['setting']['allowpostcomment']) && ($_G['setting']['commentpostself'] || $post['authorid'] != $_G['uid']) && + ($post['first'] && $_G['setting']['commentfirstpost'] && in_array($_G['group']['allowcommentpost'], array(1, 3)) || + (!$post['first'] && in_array($_G['group']['allowcommentpost'], array(2, 3)))); + $forum_allowbbcode = $_G['forum']['allowbbcode'] ? -$post['groupid'] : 0; + $post['signature'] = $post['usesig'] ? ($_G['setting']['sigviewcond'] ? (strlen($post['message']) > $_G['setting']['sigviewcond'] ? $post['signature'] : '') : $post['signature']) : ''; + $imgcontent = $post['first'] ? getstatus($_G['forum_thread']['status'], 15) : 0; + if(!defined('IN_ARCHIVER')) { + if($post['first']) { + if(!defined('IN_MOBILE')) { + $messageindex = false; + if(strpos($post['message'], '[/index]') !== FALSE) { + $post['message'] = preg_replace_callback( + "/\s?\[index\](.+?)\[\/index\]\s?/is", + function($matches) use ($post) { + return parseindex($matches[1], intval($post['pid'])); + }, + $post['message'] + ); + $messageindex = true; + unset($_GET['threadindex']); + } + if(strpos($post['message'], '[page]') !== FALSE) { + if($_GET['cp'] != 'all') { + $postbg = ''; + if(strpos($post['message'], '[/postbg]') !== FALSE) { + preg_match("/\s?\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]\s?/is", $post['message'], $r); + $postbg = $r[0]; + } + $messagearray = explode('[page]', $post['message']); + $cp = max(intval($_GET['cp']), 1); + $post['message'] = $messagearray[$cp - 1]; + if($postbg && strpos($post['message'], '[/postbg]') === FALSE) { + $post['message'] = $postbg.$post['message']; + } + unset($postbg); + } else { + $cp = 0; + $post['message'] = preg_replace("/\s?\[page\]\s?/is", '', $post['message']); + } + if($_GET['cp'] != 'all' && strpos($post['message'], '[/index]') === FALSE && empty($_GET['threadindex']) && !$messageindex) { + $_G['forum_posthtml']['footer'][$post['pid']] .= '
          '; + } + } + } + } + if(!empty($_GET['threadindex'])) { + $_G['forum_posthtml']['header'][$post['pid']] .= '
          '; + } + if(!$imgcontent) { + $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $forum_allowbbcode, ($_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0), $_G['forum']['allowhtml'], ($_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0), 0, $post['authorid'], $_G['cache']['usergroups'][$post['groupid']]['allowmediacode'] && $_G['forum']['allowmediacode'], $post['pid'], getglobal('setting/lazyload'), $post['dbdateline'], $post['first']); + if($post['first']) { + $_G['relatedlinks'] = ''; + $relatedtype = !$_G['forum_thread']['isgroup'] ? 'forum' : 'group'; + if(!getglobal('setting/relatedlinkstatus')) { + $_G['relatedlinks'] = get_related_link($relatedtype); + } else { + $post['message'] = parse_related_link($post['message'], $relatedtype); + } + if(strpos($post['message'], '[/begin]') !== FALSE) { + $post['message'] = preg_replace_callback( + "/\[begin(=\s*([^\[\<\r\n]*?)\s*,(\d*),(\d*),(\d*),(\d*))?\]\s*([^\[\<\r\n]+?)\s*\[\/begin\]/is", + function ($matches) { + if (!intval($_G['cache']['usergroups'][$post['groupid']]['allowbegincode'])) { + return ''; + } + return parsebegin($matches[2], $matches[7], $matches[3], $matches[4], $matches[5], $matches[6]); + }, + $post['message'] + ); + } + } + } + } + if(defined('IN_ARCHIVER') || defined('IN_MOBILE') || !$post['first']) { + if(strpos($post['message'], '[page]') !== FALSE) { + $post['message'] = preg_replace("/\s?\[page\]\s?/is", '', $post['message']); + } + if(strpos($post['message'], '[/index]') !== FALSE) { + $post['message'] = preg_replace("/\s?\[index\](.+?)\[\/index\]\s?/is", '', $post['message']); + } + if(strpos($post['message'], '[/begin]') !== FALSE) { + $post['message'] = preg_replace("/\[begin(=\s*([^\[\<\r\n]*?)\s*,(\d*),(\d*),(\d*),(\d*))?\]\s*([^\[\<\r\n]+?)\s*\[\/begin\]/is", '', $post['message']); + } + } + if($imgcontent) { + $post['message'] = ''; + } + $_G['forum_firstpid'] = intval($_G['forum_firstpid']); + $post['numbercard'] = viewthread_numbercard($post); + $post['mobiletype'] = getstatus($post['status'], 4) ? base_convert(getstatus($post['status'], 10).getstatus($post['status'], 9).getstatus($post['status'], 8), 2, 10) : 0; + return $post; +} + +function viewthread_loadcache() { + global $_G; + $_G['thread']['livedays'] = ceil((TIMESTAMP - $_G['thread']['dateline']) / 86400); + $_G['thread']['lastpostdays'] = ceil((TIMESTAMP - $_G['thread']['lastpost']) / 86400); + + $threadcachemark = 100 - ( + $_G['thread']['digest'] * 20 + + min($_G['thread']['views'] / max($_G['thread']['livedays'], 10) * 2, 50) + + max(-10, (15 - $_G['thread']['lastpostdays'])) + + min($_G['thread']['replies'] / $_G['setting']['postperpage'] * 1.5, 15)); + if($threadcachemark < $_G['forum']['threadcaches']) { + + $threadcache = getcacheinfo($_G['tid']); + + if(TIMESTAMP - $threadcache['filemtime'] > $_G['setting']['cachethreadlife']) { + @unlink($threadcache['filename']); + define('CACHE_FILE', $threadcache['filename']); + } else { + $start_time = microtime(TRUE); + $filemtime = $threadcache['filemtime']; + ob_start(function($input) use (&$filemtime) { + return replace_formhash($filemtime, $input); + }); + readfile($threadcache['filename']); + viewthread_updateviews($_G['forum_thread']['threadtableid']); + $updatetime = dgmdate($filemtime, 'Y-m-d H:i:s'); + $debuginfo = ", Updated at $updatetime"; + if(getglobal('setting/debug')) { + $gzip = $_G['gzipcompress'] ? ', Gzip On' : ''; + $debuginfo .= ', Processed in '.sprintf("%0.6f", microtime(TRUE) - $start_time).' second(s)'.$gzip; + } + echo ''; + ob_end_flush(); + exit(); + } + } +} + +function viewthread_lastmod(&$thread) { + global $_G; + if(!$thread['moderated']) { + return array(); + } + $lastmod = array(); + $lastlog = C::t('forum_threadmod')->fetch_by_tid($thread['tid']); + if($lastlog) { + $lastmod = array( + 'moduid' => $lastlog['uid'], + 'modusername' => $lastlog['username'], + 'moddateline' => $lastlog['dateline'], + 'modaction' => $lastlog['action'], + 'magicid' => $lastlog['magicid'], + 'stamp' => $lastlog['stamp'], + 'reason' => $lastlog['reason'] + ); + } + if($lastmod) { + $modactioncode = lang('forum/modaction'); + $lastmod['moduid'] = $_G['setting']['moduser_public'] ? $lastmod['moduid'] : 0; + $lastmod['modusername'] = $lastmod['modusername'] ? ($_G['setting']['moduser_public'] ? $lastmod['modusername'] : lang('forum/template', 'thread_moderations_team')) : lang('forum/template', 'thread_moderations_cron'); + $lastmod['moddateline'] = dgmdate($lastmod['moddateline'], 'u'); + $lastmod['modactiontype'] = $lastmod['modaction']; + if($modactioncode[$lastmod['modaction']]) { + $lastmod['modaction'] = $modactioncode[$lastmod['modaction']].($lastmod['modaction'] != 'SPA' ? '' : ' '.$_G['cache']['stamps'][$lastmod['stamp']]['text']); + } elseif(substr($lastmod['modaction'], 0, 1) == 'L' && preg_match('/L(\d\d)/', $lastmod['modaction'], $a)) { + $lastmod['modaction'] = $modactioncode['SLA'].' '.$_G['cache']['stamps'][intval($a[1])]['text']; + } else { + $lastmod['modaction'] = ''; + } + if($lastmod['magicid']) { + loadcache('magics'); + $lastmod['magicname'] = $_G['cache']['magics'][$lastmod['magicid']]['name']; + } + } else { + C::t('forum_thread')->update($thread['tid'], array('moderated' => 0), false, false, $thread['threadtableid']); + $thread['moderated'] = 0; + } + return $lastmod; +} + +function viewthread_baseinfo($post, $extra) { + global $_G; + list($key, $type) = $extra; + $v = ''; + if(substr($key, 0, 10) == 'extcredits') { + $i = substr($key, 10); + $extcredit = $_G['setting']['extcredits'][$i]; + if($extcredit) { + $v = $type ? ($extcredit['img'] ? $extcredit['img'].' ' : '').$extcredit['title'] : $post['extcredits'.$i].' '.$extcredit['unit']; + } + } elseif(substr($key, 0, 6) == 'field_') { + $field = substr($key, 6); + if(!empty($post['privacy']['profile'][$field])) { + return ''; + } + require_once libfile('function/profile'); + if($field != 'qq') { + $v = profile_show($field, $post); + } elseif(!empty($post['qq'])) { + $v = 'QQ'; + } + if($v) { + if(!isset($_G['cache']['profilesetting'])) { + loadcache('profilesetting'); + } + $v = $type ? $_G['cache']['profilesetting'][$field]['title'] : $v; + } + } elseif($key == 'eccredit_seller') { + $v = $type ? lang('space', 'viewthread_userinfo_sellercredit') : ''; + } elseif($key == 'eccredit_buyer') { + $v = $type ? lang('space', 'viewthread_userinfo_buyercredit') : ''; + } else { + $v = getLinkByKey($key, $post); + if($v !== '') { + $v = $type ? lang('space', 'viewthread_userinfo_'.$key) : $v; + } + } + return $v; +} + +function viewthread_profile_nodeparse($param) { + list($name, $s, $e, $extra, $post) = $param; + if(strpos($name, ':') === false) { + if(function_exists('profile_node_'.$name)) { + return call_user_func('profile_node_'.$name, $post, $s, $e, explode(',', $extra)); + } else { + return ''; + } + } else { + list($plugin, $pluginid) = explode(':', $name); + if($plugin == 'plugin') { + global $_G; + static $pluginclasses = array(); + if(isset($_G['setting']['plugins']['profile_node'][$pluginid])) { + @include_once DISCUZ_ROOT.'./source/plugin/'.$_G['setting']['plugins']['profile_node'][$pluginid].'.class.php'; + $classkey = 'plugin_'.$pluginid; + if(!class_exists($classkey, false)) { + return ''; + } + if(!isset($pluginclasses[$classkey])) { + $pluginclasses[$classkey] = new $classkey; + } + return call_user_func(array($pluginclasses[$classkey], 'profile_node'), $post, $s, $e, explode(',', $extra)); + } + } + } +} + +function viewthread_profile_node($type, $post) { + global $_G; + $tpid = false; + if(!empty($post['verifyicon'])) { + $tpid = isset($_G['setting']['profilenode']['groupid'][-$post['verifyicon'][0]]) ? $_G['setting']['profilenode']['groupid'][-$post['verifyicon'][0]] : false; + } + if($tpid === false) { + $tpid = isset($_G['setting']['profilenode']['groupid'][$post['groupid']]) ? $_G['setting']['profilenode']['groupid'][$post['groupid']] : 0; + } + $template = $_G['setting']['profilenode']['template'][$tpid][$type]; + $code = $_G['setting']['profilenode']['code'][$tpid][$type]; + include_once template('forum/viewthread_profile_node'); + foreach($code as $k => $p) { + $p[] = $post; + $template = str_replace($k, call_user_func('viewthread_profile_nodeparse', $p), $template); + } + echo $template; +} + +function viewthread_numbercard($post) { + global $_G; + if(!is_array($_G['setting']['numbercard'])) { + $_G['setting']['numbercard'] = dunserialize($_G['setting']['numbercard']); + } + + $numbercard = array(); + foreach($_G['setting']['numbercard']['row'] as $key) { + if(substr($key, 0, 10) == 'extcredits') { + $numbercard[] = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=profile', 'value' => $post[$key], 'lang' => $_G['setting']['extcredits'][substr($key, 10)]['title']); + } else { + $getLink = getLinkByKey($key, $post, 1); + $numbercard[] = array('link' => $getLink['link'], 'value' => $getLink['value'], 'lang' => lang('space', 'viewthread_userinfo_'.$key)); + } + } + return $numbercard; +} +function getLinkByKey($key, $post, $returnarray = 0) { + switch($key) { + case 'uid': $v = array('link' => '?'.$post['uid'], 'value' => $post['uid']);break; + case 'posts': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=thread&type=reply&view=me&from=space', 'value' => $post['posts'] - $post['threads']);break; + case 'threads': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=thread&type=thread&view=me&from=space', 'value' => $post['threads']);break; + case 'digestposts': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=thread&type=thread&view=me&from=space', 'value' => $post['digestposts']);break; + case 'feeds': $v = array('link' => 'home.php?mod=follow&uid='.$post['uid'].'&do=view', 'value' => $post['feeds']);break; + case 'doings': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=doing&view=me&from=space', 'value' => $post['doings']);break; + case 'blogs': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=blog&view=me&from=space', 'value' => $post['blogs']);break; + case 'albums': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=album&view=me&from=space', 'value' => $post['albums']);break; + case 'sharings': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=share&view=me&from=space', 'value' => $post['sharings']);break; + case 'friends': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=friend&view=me&from=space', 'value' => $post['friends']);break; + case 'follower': $v = array('link' => 'home.php?mod=follow&do=follower&uid='.$post['uid'], 'value' => $post['follower']);break; + case 'following': $v = array('link' => 'home.php?mod=follow&do=following&uid='.$post['uid'], 'value' => $post['following']);break; + case 'credits': $v = array('link' => 'home.php?mod=space&uid='.$post['uid'].'&do=profile', 'value' => $post['credits']);break; + case 'digest': $v = array('value' => $post['digestposts']);break; + case 'readperm': $v = array('value' => $post['readaccess']);break; + case 'regtime': $v = array('value' => $post['regdate']);break; + case 'lastdate': $v = array('value' => $post['lastdate']);break; + case 'oltime': $v = array('value' => $post['oltime'].' '.lang('space', 'viewthread_userinfo_hour'));break; + } + if(!$returnarray) { + if($v['link']) { + $v = ''.$v['value'].''; + } else { + $v = $v['value']; + } + } + return $v; +} +function countlevel($usercredit) { + global $_G; + + $rank = 0; + if($usercredit){ + foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) { + if($usercredit <= $credit) { + $rank = $level; + break; + } + } + } + return $rank; +} +function remaintime($time) { + $days = intval($time / 86400); + $time -= $days * 86400; + $hours = intval($time / 3600); + $time -= $hours * 3600; + $minutes = intval($time / 60); + $time -= $minutes * 60; + $seconds = $time; + return array((int)$days, (int)$hours, (int)$minutes, (int)$seconds); +} + +function getrelateitem($tagarray, $tid, $relatenum, $relatetime, $relatecache = '', $type = 'tid') { + $tagidarray = $relatearray = $relateitem = array(); + $updatecache = 0; + $limit = $relatenum; + if(!$limit) { + return ''; + } + foreach($tagarray as $var) { + $tagidarray[] = $var['0']; + } + if(!$tagidarray) { + return ''; + } + if(empty($relatecache)) { + $thread = C::t('forum_thread')->fetch_thread($tid); + $relatecache = $thread['relatebytag']; + } + if($relatecache) { + $relatecache = explode("\t", $relatecache); + if(TIMESTAMP > $relatecache[0] + $relatetime * 60) { + $updatecache = 1; + } else { + if(!empty($relatecache[1])) { + $relatearray = explode(',', $relatecache[1]); + } + } + } else { + $updatecache = 1; + } + if($updatecache) { + $query = C::t('common_tagitem')->select($tagidarray, $tid, $type, 'itemid', 'DESC', $limit, 0, '<>'); + foreach($query as $result) { + if($result['itemid']) { + $relatearray[] = $result['itemid']; + } + } + if($relatearray) { + $relatebytag = implode(',', $relatearray); + } + C::t('forum_thread')->update($tid, array('relatebytag'=>TIMESTAMP."\t".$relatebytag)); + } + + + if(!empty($relatearray)) { + rsort($relatearray); + foreach(C::t('forum_thread')->fetch_all_by_tid($relatearray) as $result) { + if($result['displayorder'] >= 0) { + $relateitem[] = $result; + } + } + } + return $relateitem; +} + +function rushreply_rule () { + global $rushresult; + if(!empty($rushresult['rewardfloor'])) { + $rushresult['rewardfloor'] = preg_replace('/\*+/', '*', $rushresult['rewardfloor']); + $rewardfloorarr = explode(',', $rushresult['rewardfloor']); + if($rewardfloorarr) { + foreach($rewardfloorarr as $var) { + $var = trim($var); + if(strlen($var) > 1) { + $var = str_replace('*', '[^,]?[\d]*', $var); + } else { + $var = str_replace('*', '\d+', $var); + } + $preg[] = "(,$var,)"; + } + $preg = is_array($preg) ? $preg : array($preg); + $preg_str = "/".implode('|', $preg)."/"; + } + } + return $preg_str; +} + +function checkrushreply($post) { + global $_G, $rushids; + if($_GET['authorid']) { + return $post; + } + if(in_array($post['number'], $rushids)) { + $post['rewardfloor'] = 1; + } + return $post; +} + +function parseindex($nodes, $pid) { + global $_G; + $nodes = dhtmlspecialchars($nodes); + $nodes = preg_replace('/(\**?)\[#(\d+)\](.+?)[\r\n]/', "\\3", $nodes); + $nodes = preg_replace('/(\**?)\[#(\d+),(\d+)\](.+?)[\r\n]/', "\\4", $nodes); + $_G['forum_posthtml']['header'][$pid] .= '
          '.$nodes.'
          '; + return ''; +} + +function parsebegin($linkaddr, $imgflashurl, $w = 0, $h = 0, $type = 0, $s = 0) { + static $begincontent; + if($begincontent || $_GET['from'] == 'preview') { + return ''; + } + preg_match("/((https?){1}:\/\/|www\.)[^\[\"']+/i", $imgflashurl, $matches); + $imgflashurl = $matches[0]; + $fileext = fileext($imgflashurl); + preg_match("/((https?){1}:\/\/|www\.)[^\[\"']+/i", $linkaddr, $matches); + $linkaddr = $matches[0]; + $randomid = 'swf_'.random(3); + $w = ($w >=400 && $w <=1024) ? $w : 900; + $h = ($h >=300 && $h <=640) ? $h : 500; + $s = $s ? $s*1000 : 5000; + switch($fileext) { + case 'jpg': + case 'jpeg': + case 'gif': + case 'png': + $content = ''; + break; + case 'swf': + $content = ''. + ''; + break; + default: + $content = ''; + } + if($content) { + if($type == 1) { + $content = ''. + ''; + } else { + $content = '
          '. + '
          +
          '.lang('core', 'close').'
          +
          '. + $content.'
          '. + '
          +
          '. + ''; + } + } + $begincontent = $content; + return $content; +} + +function _checkviewgroup() { + global $_G; + $_G['action']['action'] = 3; + require_once libfile('function/group'); + $status = groupperm($_G['forum'], $_G['uid']); + if($status == 1) { + showmessage('forum_group_status_off'); + } elseif($status == 2) { + showmessage('forum_group_noallowed', 'forum.php?mod=group&fid='.$_G['fid']); + } elseif($status == 3) { + showmessage('forum_group_moderated', 'forum.php?mod=group&fid='.$_G['fid']); + } +} + +?> \ No newline at end of file diff --git a/source/module/forum/index.htm b/source/module/forum/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/group/group_attentiongroup.php b/source/module/group/group_attentiongroup.php new file mode 100644 index 0000000..87128b4 --- /dev/null +++ b/source/module/group/group_attentiongroup.php @@ -0,0 +1,30 @@ +update($_G['uid'], array('attentiongroup' => implode(',', $_GET['attentiongroupid']))); + } else { + C::t('common_member_field_forum')->update($_G['uid'], array('attentiongroup' => '')); + } + showmessage('setup_finished', 'group.php?mod=my&view=groupthread'); +} +include template('group/group_attentiongroup'); + +?> \ No newline at end of file diff --git a/source/module/group/group_index.php b/source/module/group/group_index.php new file mode 100644 index 0000000..b9dfac9 --- /dev/null +++ b/source/module/group/group_index.php @@ -0,0 +1,168 @@ + '', 'thread' => '', 'membernum' => '', 'dateline' => '', 'activity' => ''); +if(!empty($_GET['orderby'])) { + $selectorder[$_GET['orderby']] = 'selected'; +} else { + $selectorder['default'] = 'selected'; +} +$first = &$_G['cache']['grouptype']['first']; +$second = &$_G['cache']['grouptype']['second']; +require_once libfile('function/group'); +$url = $_G['basescript'].'.php'; + +if($gid) { + if(!empty($first[$gid])) { + $curtype = $first[$gid]; + if($curtype['secondlist']) { + foreach($curtype['secondlist'] as $fid) { + $typelist[$fid] = $second[$fid]; + } + $groupids = $first[$gid]['secondlist']; + } + $groupids[] = $gid; + $url .= '?gid='.$gid; + $fup = $gid; + } else { + $gid = 0; + } +} elseif($sgid) { + if(!empty($second[$sgid])) { + $curtype = $second[$sgid]; + $fup = $curtype['fup']; + $groupids = array($sgid); + $url .= '?sgid='.$sgid; + } else { + $sgid = 0; + } +} + +if(empty($curtype)) { + if($_G['uid'] && empty($_G['mod'])) { + $usergroups = getuserprofile('groups'); + if(!empty($usergroups)) { + dheader('Location:group.php?mod=my'); + exit; + } + } + $curtype = array(); + +} else { + $nav = get_groupnav($curtype); + $groupnav = $nav['nav']; + $_G['grouptypeid'] = $curtype['fid']; + $perpage = 10; + if($curtype['forumcolumns'] > 1) { + $curtype['forumcolwidth'] = (floor(100 / $curtype['forumcolumns']) - 0.1).'%'; + $perpage = $curtype['forumcolumns'] * 10; + } +} +$seodata = array('first' => $nav['first']['name'], 'second' => $nav['second']['name']); +list($navtitle, $metadescription, $metakeywords) = get_seosetting('group', $seodata); + +$data = $randgrouplist = $randgroupdata = $grouptop = $newgrouplist = $fids = array(); +$topgrouplist = $_G['cache']['groupindex']['topgrouplist']; +$lastupdategroup = $_G['cache']['groupindex']['lastupdategroup']; +$todayposts = intval($_G['cache']['groupindex']['todayposts']); +$groupnum = intval($_G['cache']['groupindex']['groupnum']); +$cachetimeupdate = TIMESTAMP - intval($_G['cache']['groupindex']['updateline']); + +if(empty($_G['cache']['groupindex']) || $cachetimeupdate > 3600 || empty($lastupdategroup)) { + $data['randgroupdata'] = $randgroupdata = grouplist('lastupdate', array('ff.membernum', 'ff.icon'), 80); + $data['topgrouplist'] = $topgrouplist = grouplist('activity', array('f.commoncredits', 'ff.membernum', 'ff.icon'), 10); + $data['updateline'] = TIMESTAMP; + $groupdata = C::t('forum_forum')->fetch_group_counter(); + $data['todayposts'] = $todayposts = $groupdata['todayposts']; + $data['groupnum'] = $groupnum = $groupdata['groupnum']; + foreach($first as $id => $toptype) { + if(empty($toptype['secondlist'])) $toptype['secondlist'][] = $id; + $query = C::t('forum_forum')->fetch_all_sub_group_by_fup($toptype['secondlist']); + foreach($query as $row) { + if(!in_array($row['fid'], $fids)){ + $fids[] = $row['fid']; + } + } + foreach($query as $row) { + $data['lastupdategroup'][$id][] = $row; + } + if(empty($data['lastupdategroup'][$id])) $data['lastupdategroup'][$id] = array(); + } + $lastupdategroupdetail = grouplist('activity', array('ff.membernum', 'ff.icon'), count($fids), $fids); + foreach($data['lastupdategroup'] as $id => $toptype) { + foreach($toptype as $key => $detail) { + $data['lastupdategroup'][$id][$key] = array_merge($lastupdategroupdetail[$detail['fid']], $detail); + } + } + $lastupdategroup = $data['lastupdategroup']; + savecache('groupindex', $data); +} + +$list = array(); +if($groupids) { + $orderby = in_array(getgpc('orderby'), array('membernum', 'dateline', 'thread', 'activity')) ? getgpc('orderby') : 'displayorder'; + $page = intval(getgpc('page')) ? intval($_GET['page']) : 1; + $page = $page > 65535 ? 1 : $page; + $start = ($page - 1) * $perpage; + $getcount = grouplist('', '', '', $groupids, 1, 1); + if($getcount) { + $list = grouplist($orderby, '', array($start, $perpage), $groupids, 1); + $multipage = multi($getcount, $perpage, $page, $url."&orderby=$orderby"); + } + +} + +$endrows = $curtype['forumcolumns'] > 1 ? str_repeat('', $curtype['forumcolumns'] - count($list) % $curtype['forumcolumns']) : ''; +$groupviewed_list = get_viewedgroup(); + +if(empty($sgid) && empty($gid)) { + foreach($first as $key => $val) { + if(is_array($val['secondlist']) && !empty($val['secondlist'])) { + $first[$key]['secondlist'] = array_slice($val['secondlist'], 0, 8); + } + } +} +if(!$navtitle || !empty($sgid) || !empty($gid)) { + if(!$navtitle) { + $navtitle = !empty($gid) ? $nav['first']['name'] : (!empty($sgid) ? $nav['second']['name'] : ''); + } + $navtitle = (!empty($sgid) || !empty($gid) ? helper_seo::get_title_page($navtitle, $_G['page']).' - ' : '').$_G['setting']['navs'][3]['navname']; + $nobbname = false; +} else { + $nobbname = true; +} + +if(!$metakeywords) { + $metakeywords = $_G['setting']['navs'][3]['navname']; +} +if(!$metadescription) { + $metadescription = $_G['setting']['navs'][3]['navname']; +} +if(empty($curtype)) { + include template('diy:group/index'); +} else { + if(empty($sgid)) { + include template('diy:group/type:'.$gid); + } else { + include template('diy:group/type:'.$fup); + } +} + + +?> \ No newline at end of file diff --git a/source/module/group/group_my.php b/source/module/group/group_my.php new file mode 100644 index 0000000..fb32714 --- /dev/null +++ b/source/module/group/group_my.php @@ -0,0 +1,165 @@ + true, 'login' => 1)); +} +require_once libfile('function/group'); + +$view = $_GET['view'] && in_array($_GET['view'], array('manager', 'join', 'groupthread', 'mythread')) ? $_GET['view'] : 'groupthread'; +$actives = array('manager' => '', 'join' => '', 'groupthread' => '', 'mythread' => ''); +$actives[$view] = ' class="a"'; + +$perpage = 20; +$page = intval($_GET['page']) ? intval($_GET['page']) : 1; +$start = ($page - 1) * $perpage; +if($view == 'groupthread' || $view == 'mythread') { + $typeid = intval($_GET['typeid']); + $attentiongroups = $usergroups = array(); + $usergroups = update_usergroups($_G['uid']); + if($view == 'groupthread' && empty($typeid) && !empty($usergroups['grouptype'])) { + $attentiongroup = $_G['member']['attentiongroup']; + if(empty($attentiongroup)) { + $attentiongroups = array_slice(array_keys($usergroups['groups']), 0, 1); + } else { + $attentiongroups = explode(',', $attentiongroup); + } + $attentionthread = $attentiongroup_icon = array(); + $attentiongroupfid = ''; + $query = C::t('forum_forum')->fetch_all_info_by_fids($attentiongroups); + foreach($query as $row) { + $attentiongroup_icon[$row['fid']] = get_groupimg($row['icon'], 'icon'); + } + foreach($attentiongroups as $groupid) { + $attentiongroupfid .= $attentiongroupfid ? ','.$groupid : $groupid; + if($page == 1) { + foreach(C::t('forum_thread')->fetch_all_by_fid_displayorder($groupid, 0, null, null, 0, 5, 'lastpost', 'DESC', '=') as $thread) { + $attentionthread[$groupid][$thread['tid']]['fid'] = $thread['fid']; + $attentionthread[$groupid][$thread['tid']]['subject'] = $thread['subject']; + $attentionthread[$groupid][$thread['tid']]['groupname'] = $usergroups['groups'][$thread['fid']]; + $attentionthread[$groupid][$thread['tid']]['views'] = $thread['views']; + $attentionthread[$groupid][$thread['tid']]['replies'] = $thread['replies']; + $attentionthread[$groupid][$thread['tid']]['lastposter'] = $thread['lastposter']; + $attentionthread[$groupid][$thread['tid']]['lastpost'] = dgmdate($thread['lastpost'], 'u'); + $attentionthread[$groupid][$thread['tid']]['folder'] = 'common'; + if(empty($_G['cookie']['oldtopics']) || strpos($_G['cookie']['oldtopics'], 'D'.$thread['tid'].'D') === FALSE) { + $attentionthread[$groupid][$thread['tid']]['folder'] = 'new'; + } + } + } + } + } + + $mygrouplist = mygrouplist($_G['uid'], 'lastupdate', array('f.name', 'ff.icon'), 50); + if($mygrouplist) { + $managegroup = $commongroup = $groupthreadlist = array(); + foreach($mygrouplist as $fid => $group) { + if($group['level'] == 1 || $group['level'] == 2) { + if(count($managegroup) == 8) { + continue; + } + $managegroup[$fid]['name'] = $group['name']; + $managegroup[$fid]['icon'] = $group['icon']; + } else { + if(count($commongroup) == 8) { + continue; + } + $commongroup[$fid]['name'] = $group['name']; + $commongroup[$fid]['icon'] = $group['icon']; + } + } + + $mygroupfid = array_keys($mygrouplist); + if($typeid && !empty($usergroups['grouptype'][$typeid]['groups'])) { + $mygroupfid = explode(',', $usergroups['grouptype'][$typeid]['groups']); + $typeurl = '&typeid='.$typeid; + } else { + $typeid = 0; + } + if(!empty($attentiongroupfid) && !empty($mygroupfid)) { + $mygroupfid = array_diff($mygroupfid, explode(',', $attentiongroupfid)); + } + if($mygroupfid) { + $lastpost = 0; + $displayorder = null; + if($view != 'mythread') { + $displayorder = 0; + $lastpost = TIMESTAMP - 86400*30; + } + $authorid = $_G['uid']; + foreach(C::t('forum_thread')->fetch_all_by_fid_authorid_displayorder($mygroupfid, $authorid, $displayorder, $lastpost, $start, $perpage) as $thread) { + $groupthreadlist[$thread['tid']]['fid'] = $thread['fid']; + $groupthreadlist[$thread['tid']]['subject'] = $thread['subject']; + $groupthreadlist[$thread['tid']]['groupname'] = $mygrouplist[$thread['fid']]['name']; + $groupthreadlist[$thread['tid']]['views'] = $thread['views']; + $groupthreadlist[$thread['tid']]['replies'] = $thread['replies']; + $groupthreadlist[$thread['tid']]['lastposter'] = $thread['lastposter']; + $groupthreadlist[$thread['tid']]['lastpost'] = dgmdate($thread['lastpost'], 'u'); + $groupthreadlist[$thread['tid']]['folder'] = 'common'; + if(empty($_G['cookie']['oldtopics']) || strpos($_G['cookie']['oldtopics'], 'D'.$thread['tid'].'D') === FALSE) { + $groupthreadlist[$thread['tid']]['folder'] = 'new'; + } + } + if($view == 'mythread') { + $multipage = simplepage(count($groupthreadlist), $perpage, $page, 'group.php?mod=my&view='.$view.$typeurl); + } + } + } +} elseif($view == 'manager' || $view == 'join') { + $perpage = 40; + $start = ($page - 1) * $perpage; + $ismanager = $view == 'manager' ? 1 : 2; + $num = mygrouplist($_G['uid'], 'lastupdate', array('f.name', 'ff.icon'), 0, 0, $ismanager, 1); + $multipage = multi($num, $perpage, $page, 'group.php?mod=my&view='.$view); + $grouplist = mygrouplist($_G['uid'], 'lastupdate', array('f.name', 'ff.icon'), $perpage, $start, $ismanager); +} + +$frienduidarray = $friendgrouplist = $randgroupdata = $randgrouplist = $randgroup = array(); +loadcache('groupindex'); +$randgroupdata = $_G['cache']['groupindex']['randgroupdata']; +if($randgroupdata) { + foreach($randgroupdata as $groupid => $rgroup) { + if($rgroup['iconstatus']) { + $randgrouplist[$groupid] = $rgroup; + } + } +} + +if(count($randgrouplist) > 9) { + foreach(array_rand($randgrouplist, 9) as $fid) { + $randgroup[] = $randgrouplist[$fid]; + } +} elseif (count($randgrouplist)) { + $randgroup = $randgrouplist; +} + +require_once libfile('function/friend'); +$frienduid = friend_list($_G['uid'], 50); +if($frienduid && is_array($frienduid)) { + foreach($frienduid as $friend) { + $frienduidarray[] = $friend['fuid']; + } + $fids = C::t('forum_groupuser')->fetch_all_fid_by_uids($frienduidarray); + $query = C::t('forum_forum')->fetch_all_info_by_fids($fids, 0, 9); + foreach($query as $group) { + $icon = get_groupimg($group['icon'], 'icon'); + $friendgrouplist[$group['fid']] = array('fid' => $group['fid'], 'name' => $group['name'], 'icon' => $icon); + } +} + +$navtitle = $_G['username'].lang('core', 'title_of').$_G['setting']['navs'][3]['navname']; + +include_once template("diy:group/group_my"); + +?> \ No newline at end of file diff --git a/source/module/group/index.htm b/source/module/group/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/home/home_editor.php b/source/module/home/home_editor.php new file mode 100644 index 0000000..18c755c --- /dev/null +++ b/source/module/home/home_editor.php @@ -0,0 +1,324 @@ + + + + + + + + Editor + + + + + + + +
          + +
          + + + + +
          + +
          +
          + + + +
          + + + + + + + + + + + + +
          + + + + + + + + + + + + + + + + + + + + + + +
          +
          + + + +
          +
          + +
          + + + + + + + + + + + + + + + + + +
          +
          + +
          + + +
          +
          +
          + + + + + + + + + + + Editor + + + + + + \ No newline at end of file diff --git a/source/module/home/home_follow.php b/source/module/home/home_follow.php new file mode 100644 index 0000000..f7d4b3e --- /dev/null +++ b/source/module/home/home_follow.php @@ -0,0 +1,264 @@ + true, 'login' => 1)); +} +$dos = array('feed', 'follower', 'following', 'view'); +$do = (!empty($_GET['do']) && in_array($_GET['do'], $dos)) ? $_GET['do'] : (!$_GET['uid'] ? 'feed' : 'view'); + +$page = empty($_GET['page']) ? 1 : intval($_GET['page']); +if($page<1) $page=1; +$perpage = 20; +$start = ($page-1)*$perpage; +$multi = ''; +$theurl = 'home.php?mod='.($do == 'view' ? 'space' : 'follow').(!in_array($do, array('feed', 'view')) ? '&do='.$do : ''); +$uid = $_GET['uid'] ? $_GET['uid'] : $_G['uid']; +$viewself = $uid == $_G['uid'] ? true : false; +$space = $viewself ? $_G['member'] : getuserbyuid($uid, 1); +if(empty($space)) { + showmessage('follow_visituser_not_exist'); +} elseif(in_array($space['groupid'], array(4, 5, 6)) && ($_G['adminid'] != 1 && $space['uid'] != $_G['uid'])) { + dheader("Location:home.php?mod=space&uid=$uid&do=profile"); +} +space_merge($space, 'count'); +space_merge($space, 'profile'); +space_merge($space, 'field_home'); + +if($viewself) { + $showguide = false; +} else { + $theurl .= $uid ? '&uid='.$uid : ''; + $do = $do == 'feed' ? 'view' : $do; + + $flag = C::t('home_follow')->fetch_status_by_uid_followuid($_G['uid'], $uid); +} +$showrecommend = true; +$archiver = $primary = 1; +$followerlist = array(); +$space['bio'] = cutstr($space['bio'], 200); +$lastviewtime = 0; +if($do == 'feed') { + $view = 'follow'; + if(in_array($_GET['view'], array('special', 'follow', 'other'))) { + $view = $_GET['view']; + $theurl .= '&view='.$_GET['view']; + } + + $vuid = $view == 'other' ? 0 : $_G['uid']; + $list = getfollowfeed($vuid, $view, false, $start, $perpage); + if((empty($list['feed']) || !is_array($list['feed']) || count($list['feed']) < 20) && (!empty($list['user']) || $view == 'other')) { + $primary = 0; + $alist = getfollowfeed($vuid, $view, true, $start, $perpage); + if(empty($list['feed']) && empty($alist['feed'])) { + $showguide = true; + $archiver = 0; + } else { + $showguide = false; + foreach($alist as $key => $values) { + if($key != 'user') { + foreach($values as $id => $value) { + if(!isset($list[$key][$id])) { + $list[$key][$id] = $value; + } + } + } + } + } + + } elseif(empty($list['user']) && $view != 'other') { + $archiver = $primary = 0; + $showguide = false; + } + if($showguide) { + if(!empty($_G['cookie']['lastshowtime'])) { + $time = explode('|', $_G['cookie']['lastshowtime']); + $today = strtotime(dgmdate($_G['timestamp'], 'Y-m-d')); + if($time[0] == $uid && (TIMESTAMP - $time[1] < 86400 && $time[1] > $today)) { + $showguide = false; + } + } + dsetcookie('lastshowtime', $uid.'|'.TIMESTAMP, 86400); + } + if(!empty($_G['cookie']['lastviewtime'])) { + $time = explode('|', $_G['cookie']['lastviewtime']); + if($time[0] == $_G['uid']) { + $lastviewtime = $time[1]; + } + } else { + $lastviewtime = getuserprofile('lastactivity'); + } + dsetcookie('lastviewtime', $_G['uid'].'|'.TIMESTAMP, 31536000); + if($_G['member']['newprompt_num']['follow']) { + C::t('home_notification')->delete_by_type('follow', $_G['uid']); + helper_notification::update_newprompt($_G['uid'], 'follow'); + } + $recommend = $users = array(); + if(helper_access::check_module('follow')) { + loadcache('recommend_follow'); + if(empty($_G['cache']['recommend_follow']) || !empty($_G['cache']['recommend_follow']) && (empty($_G['cache']['recommend_follow']['users']) || TIMESTAMP - $_G['cache']['recommend_follow']['dateline'] > 86400)) { + foreach(C::t('home_specialuser')->fetch_all_by_status(0, 10) as $value) { + $recommend[$value['uid']] = $value['username']; + } + unset($recommend[$_G['uid']]); + if(count($recommend) < 10) { + $followuser = C::t('common_member_count')->range_by_field(0, 100, 'follower', 'DESC'); + $userstatus = C::t('common_member_status')->fetch_all_orderby_lastpost(array_keys($followuser), 0, 20); + $users = C::t('common_member')->fetch_all_username_by_uid(array_keys($userstatus)); + } + savecache('recommend_follow', array('dateline'=>TIMESTAMP, 'users'=>$users, 'defaultusers' => $recommend)); + } else { + $users = &$_G['cache']['recommend_follow']['users']; + $recommend = &$_G['cache']['recommend_follow']['defaultusers']; + } + if(!empty($users)) { + if(count($recommend) < 10) { + $randkeys = array_rand($users, min(count($users), 11 - count($recommend))); + foreach($randkeys as $ruid) { + if($ruid != $_G['uid']) { + $recommend[$ruid] = $users[$ruid]; + } + } + } + } + if($do == 'following') { + foreach($list as $ruid => $user) { + if(isset($recommend[$ruid])) { + unset($recommend[$ruid]); + } + } + } + if($recommend) { + $users = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], array_keys($recommend)); + foreach($users as $ruid => $user) { + if(isset($recommend[$ruid])) { + unset($recommend[$ruid]); + } + } + } + } + + $navactives = array('feed' => ' class="a"'); + $actives = array($view => ' class="a"'); + + list($seccodecheck, $secqaacheck) = seccheck('publish'); + +} elseif($do == 'view') { + $list = getfollowfeed($uid, 'self', false, $start, $perpage); + if(empty($list['feed'])) { + $primary = 0; + $list = getfollowfeed($uid, 'self', true, $start, $perpage); + if(empty($list['user'])) { + $archiver = 0; + } + } + if(!isset($_G['cache']['forums'])) { + loadcache('forums'); + } + if(helper_access::check_module('follow')) { + $followerlist = C::t('home_follow')->fetch_all_following_by_uid($uid, 0, 9); + } + list($seccodecheck, $secqaacheck) = seccheck('publish'); +} elseif($do == 'follower') { + $count = C::t('home_follow')->count_follow_user($uid, 1); + if($viewself && !empty($_G['member']['newprompt_num']['follower'])) { + $newfollower = C::t('home_notification')->fetch_all_by_uid($uid, -1, 'follower', 0, $_G['member']['newprompt_num']['follower']); + $newfollower_list = array(); + foreach($newfollower as $val) { + $newfollower_list[] = $val['from_id']; + } + C::t('home_notification')->delete_by_type('follower', $_G['uid']); + helper_notification::update_newprompt($_G['uid'], 'follower'); + } + if($count) { + $list = C::t('home_follow')->fetch_all_follower_by_uid($uid, $start, $perpage); + $multi = multi($count, $perpage, $page, $theurl); + } + if(helper_access::check_module('follow')) { + $followerlist = C::t('home_follow')->fetch_all_following_by_uid($uid, 0, 9); + } + $navactives = array($do => ' class="a"'); +} elseif($do == 'following') { + $count = C::t('home_follow')->count_follow_user($uid); + if($count) { + $status = $_GET['status'] ? 1 : 0; + $list = C::t('home_follow')->fetch_all_following_by_uid($uid, $status, $start, $perpage); + $multi = multi($count, $perpage, $page, $theurl); + } + if(helper_access::check_module('follow')) { + $followerlist = C::t('home_follow')->fetch_all_follower_by_uid($uid, 9); + } + $navactives = array($do => ' class="a"'); +} + +if(($do == 'follower' || $do == 'following') && $list) { + $uids = array_keys($list); + $fieldhome = C::t('common_member_field_home')->fetch_all($uids); + foreach($fieldhome as $fuid => $val) { + $list[$fuid]['recentnote'] = $val['recentnote']; + } + $memberinfo = C::t('common_member_count')->fetch_all($uids); + $memberprofile = C::t('common_member_profile')->fetch_all($uids); + + if(!$viewself) { + $myfollow = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], $uids); + foreach($uids as $muid) { + $list[$muid]['mutual'] = 0; + if(!empty($myfollow[$muid])) { + $list[$muid]['mutual'] = $myfollow[$muid]['mutual'] ? 1 : -1; + } + + } + } + $specialfollow = C::t('home_follow')->fetch_all_following_by_uid($uid, 1, 10); +} + +if($viewself) { + if(!isset($_G['cache']['forums'])) { + loadcache('forums'); + } + $fields = C::t('forum_forumfield')->fetch_all_by_fid(array_keys($_G['cache']['forums'])); + foreach($fields as $fid => $field) { + if(!empty($field['threadsorts'])) { + unset($_G['cache']['forums'][$fid]); + } + } + require_once libfile('function/forumlist'); + $forumlist = forumselect(); + $defaultforum = $_G['setting']['followforumid'] ? $_G['cache']['forums'][$_G['setting']['followforumid']] : array(); + require_once libfile('function/upload'); + $swfconfig = getuploadconfig($_G['uid']); +} + +if($do == 'feed') { + $navigation = ' '.lang('space', 'follow_view_'.$view).''; + $navtitle = lang('space', 'follow_view_'.$view); +} elseif($do == 'view') { + $navigation = ' '.$space['username'].''; + if($type != 'feed') { + $navigation .= ' '.lang('space', 'follow_view_type_feed').''; + } + $navtitle = lang('space', 'follow_view_feed', array('who' => $space['username'])); +} else { + $navigation = ' '.$space['username'].' '.lang('space', 'follow_view_'.($viewself?'my':'do').'_'.$do); + $navtitle = lang('space', 'follow_view_'.($viewself?'my':'do').'_'.$do); +} +$metakeywords = $navtitle; +$metadescription = $navtitle; +$navtitle = helper_seo::get_title_page($navtitle, $_G['page']); +include template('diy:home/follow_feed'); + +?> \ No newline at end of file diff --git a/source/module/home/home_invite.php b/source/module/home/home_invite.php new file mode 100644 index 0000000..23190df --- /dev/null +++ b/source/module/home/home_invite.php @@ -0,0 +1,153 @@ + true)); +} +if($_G['uid']) { + + if($_GET['accept'] == 'yes') { + $cookies = empty($_G['cookie']['invite_auth'])?array():explode(',', $_G['cookie']['invite_auth']); + + if(empty($cookies)) { + showmessage('invite_code_error', '', array(), array('return' => true)); + } + if(count($cookies) == 3) { + $uid = intval($cookies[0]); + $_GET['c'] = $cookies[1]; + } else { + $id = intval($cookies[0]); + $_GET['c'] = $cookies[1]; + } + $acceptconfirm = true; + + } elseif($_GET['accept'] == 'no') { + dsetcookie('invite_auth', ''); + showmessage('invite_accept_no', 'home.php'); + } +} + +if($id) { + + $invite = C::t('common_invite')->fetch($id); + + if(empty($invite) || $invite['code'] != $_GET['c']) { + showmessage('invite_code_error', '', array(), array('return' => true)); + } + if($invite['fuid'] && $invite['fuid'] != $_G['uid']) { + showmessage('invite_code_fuid', '', array(), array('return' => true)); + } + if($invite['endtime'] && $_G['timestamp'] > $invite['endtime']) { + C::t('common_invite')->delete($id); + showmessage('invite_code_endtime_error', '', array(), array('return' => true)); + } + + $uid = $invite['uid']; + + $cookievar = "$id,{$invite['code']}"; + +} elseif ($uid) { + + $id = 0; + $invite_code = helper_invite::generate_key($uid); + if($_GET['c'] !== $invite_code) { + showmessage('invite_code_error', '', array(), array('return' => true)); + } + $inviteuser = getuserbyuid($uid); + loadcache('usergroup_'.$inviteuser['groupid']); + if(!empty($_G['cache']['usergroup_'.$inviteuser['groupid']]) && (!$_G['cache']['usergroup_'.$inviteuser['groupid']]['allowinvite'] || $_G['cache']['usergroup_'.$inviteuser['groupid']]['inviteprice'])) { + showmessage('invite_code_error', '', array(), array('return' => true)); + } + + $cookievar = "$uid,$invite_code,0"; + +} else { + showmessage('invite_code_error', '', array(), array('return' => true)); +} + +$space = getuserbyuid($uid); +if(empty($space)) { + showmessage('space_does_not_exist', '', array(), array('return' => true)); +} +$jumpurl = 'home.php?mod=space&uid='.$uid; +if($acceptconfirm) { + + dsetcookie('invite_auth', ''); + + if($_G['uid'] == $uid) { + showmessage('should_not_invite_your_own', '', array(), array('return' => true)); + } + + require_once libfile('function/friend'); + if(friend_check($uid)) { + showmessage('you_have_friends', $jumpurl); + } + + $fields = C::t('common_member_field_home')->fetch($uid); + if(!$fields['allowasfriend']) { + showmessage('is_blacklist'); + } + + require_once libfile('function/spacecp'); + if(isblacklist($uid)) { + showmessage('is_blacklist'); + } + + friend_make($space['uid'], $space['username']); + + if($id) { + C::t('common_invite')->update($id, array('fuid'=>$_G['uid'], 'fusername'=>$_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2)); + notification_add($uid, 'friend', 'invite_friend', array('actor' => ''.$_G['username'].''), 1); + } + space_merge($space, 'field_home'); + if(is_array($space['privacy']) && !empty($space['privacy']['feed']['invite'])) { + require_once libfile('function/feed'); + $tite_data = array('username' => ''.$_G['username'].''); + feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $space['uid'], $space['username']); + } + + if($_G['setting']['inviteconfig']['inviteaddcredit']) { + updatemembercount($_G['uid'], + array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['inviteaddcredit'])); + } + if($_G['setting']['inviteconfig']['invitedaddcredit']) { + updatemembercount($uid, + array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['invitedaddcredit'])); + } + + include_once libfile('function/stat'); + updatestat('invite'); + + showmessage('invite_friend_ok', $jumpurl); + +} else { + dsetcookie('invite_auth', $cookievar, 604800); +} + +space_merge($space, 'count'); +space_merge($space, 'field_home'); +space_merge($space, 'profile'); +$flist = array(); +$query = C::t('home_friend')->fetch_all_by_uid($uid, 0, 12, true); +foreach($query as $value) { + $value['uid'] = $value['fuid']; + $value['username'] = $value['fusername']; + $flist[] = $value; +} +$jumpurl = urlencode($jumpurl); +include_once template('home/invite'); + +?> \ No newline at end of file diff --git a/source/module/home/home_magic.php b/source/module/home/home_magic.php new file mode 100644 index 0000000..1de4505 --- /dev/null +++ b/source/module/home/home_magic.php @@ -0,0 +1,524 @@ + 1)); +} + +if(!$_G['setting']['creditstransextra'][3]) { + showmessage('credits_transaction_disabled'); +} elseif(!$_G['setting']['magicstatus']) { + showmessage('magics_close'); +} + +require_once libfile('function/magic'); +loadcache('magics'); + +$_G['mnid'] = 'mn_common'; +$magiclist = array(); +$_G['tpp'] = 16; +$page = max(1, intval($_GET['page'])); +$action = $_GET['action']; +$operation = $_GET['operation']; +$start_limit = ($page - 1) * $_G['tpp']; +$_GET['idtype'] = dhtmlspecialchars($_GET['idtype']); + +$comma = $typeadd = $filteradd = $forumperm = $targetgroupperm = ''; +$magicarray = is_array($_G['cache']['magics']) ? $_G['cache']['magics'] : array(); + +if(!$_G['uid'] && ($operation || $action == 'mybox')) { + showmessage('not_loggedin', NULL, array(), array('login' => 1)); +} + +if(!$_G['group']['allowmagics']) { + showmessage('magics_nopermission'); +} + +$totalweight = getmagicweight($_G['uid'], $magicarray); +$allowweight = $_G['group']['maxmagicsweight'] - $totalweight; +$location = 0; + +if(empty($action) && !empty($_GET['mid'])) { + $_GET['magicid'] = C::t('common_member_magic')->fetch_magicid_by_identifier($_G['uid'], $_GET['mid']); + if(!$_GET['magicid']) { + $magic = C::t('common_magic')->fetch_by_identifier($_GET['mid']); + if(!$magic['price'] && $magic['num']) { + getmagic($magic['magicid'], 1, $magic['weight'], $totalweight, $_G['uid'], $_G['group']['maxmagicsweight']); + updatemagiclog($magic['magicid'], '1', 1, $magic['price'].'|'.$magic['credit'], $_G['uid']); + + C::t('common_magic')->update_salevolume($magic['magicid'], 1); + updatemembercount($_G['uid'], array($magic['credit'] => -0), true, 'BMC', $magic['magicid']); + $_GET['magicid'] = $magic['magicid']; + } + } + if($_GET['magicid']) { + $action = 'mybox'; + $operation = 'use'; + } else { + $action = 'shop'; + $operation = 'buy'; + $location = 1; + } +} + +$action = empty($action) ? 'shop' : $action; +$actives[$action] = ' class="a"'; + +if($action == 'shop') { + + $operation = empty($operation) ? 'index' : $operation; + + if(in_array($operation, array('index', 'hot'))) { + + $subactives[$operation] = 'class="a"'; + $filteradd = ''; + if($operation == 'index') { + $navtitle = lang('core', 'title_magics_shop'); + } else { + $navtitle = lang('core', 'title_magics_hot'); + } + + $magiccount = C::t('common_magic')->count_page($operation); + $multipage = multi($magiccount, $_G['tpp'], $page, "home.php?mod=magic&action=shop&operation=$operation"); + + foreach(C::t('common_magic')->fetch_all_page($operation, $start_limit, $_G['tpp']) as $magic) { + $magic['discountprice'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']); + $eidentifier = explode(':', $magic['identifier']); + if(count($eidentifier) > 1) { + $magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif'; + } else { + $magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif'; + } + $magiclist[] = $magic; + } + + $magiccredits = array(); + foreach($magicarray as $magic) { + $magiccredits[$magic['credit']] = $magic['credit']; + } + + } elseif($operation == 'buy') { + + $magic = C::t('common_magic')->fetch_by_identifier($_GET['mid']); + if(!$magic || !$magic['available']) { + showmessage('magics_nonexistence'); + } + $magicperm = dunserialize($magic['magicperm']); + $useperm = (strstr($magicperm['usergroups'], "\t{$_G['groupid']}\t") || empty($magicperm['usergroups'])) ? '1' : '0'; + if(!$useperm) { + showmessage('magics_use_nopermission'); + } + $querystring = array(); + foreach($_GET as $k => $v) { + $querystring[] = rawurlencode($k).'='.rawurlencode($v); + } + $querystring = implode('&', $querystring); + + $eidentifier = explode(':', $magic['identifier']); + if(count($eidentifier) > 1) { + $magicfile = './source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.php'; + $magicclass = 'magic_'.$eidentifier[1]; + } else { + $magicfile = './source/class/magic/magic_'.$magic['identifier'].'.php'; + $magicclass = 'magic_'.$magic['identifier']; + } + + if(!@include_once DISCUZ_ROOT.$magicfile) { + showmessage('magics_filename_nonexistence', '', array('file' => $magicfile)); + } + $magicclass = new $magicclass; + $magicclass->magic = $magic; + $magicclass->parameters = $magicperm; + if(method_exists($magicclass, 'buy')) { + $magicclass->buy(); + } + + $magic['discountprice'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']); + if(count($eidentifier) > 1) { + $magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif'; + } else { + $magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif'; + } + $magic['credit'] = $magic['credit'] ? $magic['credit'] : $_G['setting']['creditstransextra'][3]; + $useperoid = magic_peroid($magic, $_G['uid']); + + if(!submitcheck('operatesubmit')) { + + if($magicperm['targetgroups']) { + loadcache('usergroups'); + foreach(explode("\t", $magicperm['targetgroups']) as $_G['groupid']) { + if(isset($_G['cache']['usergroups'][$_G['groupid']])) { + $targetgroupperm .= $comma.$_G['cache']['usergroups'][$_G['groupid']]['grouptitle']; + $comma = ' '; + } + } + } + + if($magicperm['forum']) { + loadcache('forums'); + foreach(explode("\t", $magicperm['forum']) as $fid) { + if(isset($_G['cache']['forums'][$fid])) { + $forumperm .= $comma.''.$_G['cache']['forums'][$fid]['name'].''; + $comma = ' '; + } + } + } + + include template('home/space_magic_shop_opreation'); + dexit(); + + } else { + + $magicnum = intval($_GET['magicnum']); + $magic['weight'] = $magic['weight'] * $magicnum; + $totalprice = $magic['discountprice'] * $magicnum; + + if(getuserprofile('extcredits'.$magic['credit']) < $totalprice) { + if($_G['setting']['ec_ratio'] && $_G['setting']['creditstrans'][0] == $magic['credit']) { + showmessage('magics_credits_no_enough_and_charge', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title'])); + } else { + showmessage('magics_credits_no_enough', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title'])); + } + } elseif($magic['num'] < $magicnum) { + showmessage('magics_num_no_enough'); + } elseif(!$magicnum || $magicnum < 0) { + showmessage('magics_num_invalid'); + } + + getmagic($magic['magicid'], $magicnum, $magic['weight'], $totalweight, $_G['uid'], $_G['group']['maxmagicsweight']); + updatemagiclog($magic['magicid'], '1', $magicnum, $magic['price'].'|'.$magic['credit'], $_G['uid']); + + C::t('common_magic')->update_salevolume($magic['magicid'], $magicnum); + updatemembercount($_G['uid'], array($magic['credit'] => -$totalprice), true, 'BMC', $magic['magicid']); + showmessage('magics_buy_succeed', 'home.php?mod=magic&action=mybox', array('magicname' => $magic['name'], 'num' => $magicnum, 'credit' => $totalprice.' '.$_G['setting']['extcredits'][$magic['credit']]['unit'].$_G['setting']['extcredits'][$magic['credit']]['title'])); + + + } + + } elseif($operation == 'give') { + + if($_G['group']['allowmagics'] < 2) { + showmessage('magics_nopermission'); + } + + $magic = C::t('common_magic')->fetch_by_identifier($_GET['mid']); + if(!$magic || !$magic['available']) { + showmessage('magics_nonexistence'); + } + + $magic['discountprice'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']); + $eidentifier = explode(':', $magic['identifier']); + if(count($eidentifier) > 1) { + $magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif'; + } else { + $magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif'; + } + + if(!submitcheck('operatesubmit')) { + + include libfile('function/friend'); + $buddyarray = friend_list($_G['uid'], 20); + include template('home/space_magic_shop_opreation'); + dexit(); + + } else { + + $magicnum = intval($_GET['magicnum']); + $totalprice = $magic['price'] * $magicnum; + + if(getuserprofile('extcredits'.$magic['credit']) < $totalprice) { + if($_G['setting']['ec_ratio'] && $_G['setting']['creditstrans'][0] == $magic['credit']) { + showmessage('magics_credits_no_enough_and_charge', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title'])); + } else { + showmessage('magics_credits_no_enough', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title'])); + } + } elseif($magic['num'] < $magicnum) { + showmessage('magics_num_no_enough'); + } elseif(!$magicnum || $magicnum < 0) { + showmessage('magics_num_invalid'); + } + + $toname = dhtmlspecialchars(trim($_GET['tousername'])); + if(!$toname) { + showmessage('magics_username_nonexistence'); + } + + $givemessage = dhtmlspecialchars(trim($_GET['givemessage'])); + givemagic($toname, $magic['magicid'], $magicnum, $magic['num'], $totalprice, $givemessage, $magicarray); + C::t('common_magic')->update_salevolume($magic['magicid'], $magicnum); + updatemembercount($_G['uid'], array($magic['credit'] => -$totalprice), true, 'BMC', $magicid); + showmessage('magics_buygive_succeed', 'home.php?mod=magic&action=shop', array('magicname' => $magic['name'], 'toname' => $toname, 'num' => $magicnum, 'credit' => $_G['setting']['extcredits'][$magic['credit']]['title'].' '.$totalprice.' '.$_G['setting']['extcredits'][$magic['credit']]['unit']), array('locationtime' => true)); + + } + + } else { + showmessage('undefined_action'); + } + +} elseif($action == 'mybox') { + + if(empty($operation)) { + + $pid = !empty($_GET['pid']) ? intval($_GET['pid']) : 0; + $magiccount = C::t('common_member_magic')->count_by_uid($_G['uid']); + + $multipage = multi($magiccount, $_G['tpp'], $page, "home.php?mod=magic&action=mybox&pid=$pid$typeadd"); + $query = C::t('common_member_magic')->fetch_all_magic($_G['uid'], null, $start_limit, $_G['tpp']); + foreach($query as $value) { + $magicids[] = $value['magicid']; + } + $magicm = C::t('common_magic')->fetch_all($magicids); + foreach($query as $curmagicid => $mymagic) { + $mymagic = $mymagic + $magicm[$mymagic['magicid']]; + $eidentifier = explode(':', $mymagic['identifier']); + if(count($eidentifier) > 1) { + $mymagic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif'; + } else { + $mymagic['pic'] = STATICURL.'image/magic/'.strtolower($mymagic['identifier']).'.gif'; + } + $mymagic['weight'] = intval($mymagic['weight'] * $mymagic['num']); + $mymagic['type'] = $mymagic['type']; + $mymagiclist[] = $mymagic; + } + $navtitle = lang('core', 'title_magics_user'); + + } else { + + $magicid = intval($_GET['magicid']); + $membermagic = C::t('common_member_magic')->fetch_magic($_G['uid'], $magicid); + $magic = $membermagic + C::t('common_magic')->fetch($magicid); + + if(!$membermagic) { + showmessage('magics_nonexistence'); + } elseif(!$magic['num']) { + C::t('common_member_magic')->delete_magic($_G['uid'], $magic['magicid']); + showmessage('magics_nonexistence'); + } + $magicperm = dunserialize($magic['magicperm']); + $eidentifier = explode(':', $magic['identifier']); + if(count($eidentifier) > 1) { + $magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif'; + } else { + $magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif'; + } + + if($operation == 'use') { + + $useperm = (strstr($magicperm['usergroups'], "\t{$_G['groupid']}\t") || empty($magicperm['usergroups'])) ? '1' : '0'; + if(!$useperm) { + showmessage('magics_use_nopermission'); + } + + if($magic['num'] <= 0) { + C::t('common_member_magic')->delete_magic($_G['uid'], $magic['magicid']); + showmessage('magics_nopermission'); + } + + $magic['weight'] = intval($magicarray[$magic['magicid']]['weight'] * $magic['num']); + + if(count($eidentifier) > 1) { + $magicfile = './source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.php'; + $magicclass = 'magic_'.$eidentifier[1]; + } else { + $magicfile = './source/class/magic/magic_'.$magic['identifier'].'.php'; + $magicclass = 'magic_'.$magic['identifier']; + } + + if(!@include_once DISCUZ_ROOT.$magicfile) { + showmessage('magics_filename_nonexistence', '', array('file' => $magicfile)); + } + $magicclass = new $magicclass; + $magicclass->magic = $magic; + $magicclass->parameters = $magicperm; + $useperoid = magic_peroid($magic, $_G['uid']); + + if(submitcheck('usesubmit')) { + if(discuz_process::islocked('magiclock_'.$_G['uid'].'_'.$magicid, 0, 1)) { + showmessage('magics_locked'); + } + if($useperoid !== true && $useperoid <= 0) { + showmessage('magics_outofperoid_'.$magic['useperoid'], '', array('usenum' => $magic['usenum'])); + } + if(method_exists($magicclass, 'usesubmit')) { + $magicclass->usesubmit(); + } + dexit(); + } + + include template('home/space_magic_mybox_opreation'); + dexit(); + + } elseif($operation == 'sell') { + $magic['price'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']); + $discountprice = floor($magic['price'] * $_G['setting']['magicdiscount'] / 100); + if(!submitcheck('operatesubmit')) { + include template('home/space_magic_mybox_opreation'); + dexit(); + } else { + if(discuz_process::islocked('magiclock_'.$_G['uid'].'_'.$magicid, 0, 1)) { + showmessage('magics_locked'); + } + + $magicnum = intval($_GET['magicnum']); + + if(!$magicnum || $magicnum < 0) { + showmessage('magics_num_invalid'); + } elseif($magicnum > $magic['num']) { + showmessage('magics_amount_no_enough'); + } + usemagic($magic['magicid'], $magic['num'], $magicnum); + updatemagiclog($magic['magicid'], '2', $magicnum, '0', 0, 'sell'); + $totalprice = $discountprice * $magicnum; + updatemembercount($_G['uid'], array($magic['credit'] => $totalprice)); + showmessage('magics_sell_succeed', 'home.php?mod=magic&action=mybox', array('magicname' => $magic['name'], 'num' => $magicnum, 'credit' => $totalprice.' '.$_G['setting']['extcredits'][$magic['credit']]['unit'].$_G['setting']['extcredits'][$magic['credit']]['title'])); + } + + } elseif($operation == 'drop') { + + if(!submitcheck('operatesubmit')) { + include template('home/space_magic_mybox_opreation'); + dexit(); + } else { + $magicnum = intval($_GET['magicnum']); + + if(!$magicnum || $magicnum < 0) { + showmessage('magics_num_invalid'); + } elseif($magicnum > $magic['num']) { + showmessage('magics_amount_no_enough'); + } + usemagic($magic['magicid'], $magic['num'], $magicnum); + updatemagiclog($magic['magicid'], '2', $magicnum, '0', 0, 'drop'); + showmessage('magics_drop_succeed', 'home.php?mod=magic&action=mybox', array('magicname' => $magic['name'], 'num' => $magicnum), array('locationtime' => true)); + } + + } elseif($operation == 'give') { + + if($_G['group']['allowmagics'] < 2) { + showmessage('magics_nopermission'); + } + + if(!submitcheck('operatesubmit')) { + + include libfile('function/friend'); + $buddyarray = friend_list($_G['uid'], 20); + + include template('home/space_magic_mybox_opreation'); + dexit(); + + } else { + if($_G['setting']['submitlock'] && discuz_process::islocked('magiclock_'.$_G['uid'].'_'.$magicid, 0, 1)) { + showmessage('magics_locked'); + } + $magicnum = intval($_GET['magicnum']); + $toname = dhtmlspecialchars(trim($_GET['tousername'])); + if(!$toname) { + showmessage('magics_username_nonexistence'); + } elseif($magicnum < 0 || $magic['num'] < $magicnum) { + showmessage('magics_num_invalid'); + } + + $givemessage = dhtmlspecialchars(trim($_GET['givemessage'])); + givemagic($toname, $magic['magicid'], $magicnum, $magic['num'], '0', $givemessage, $magicarray); + + } + + } else { + showmessage('undefined_action'); + } + + } + +} elseif($action == 'log') { + + $subactives[$operation] = 'class="a"'; + $loglist = array(); + if($operation == 'uselog') { + $count = C::t('common_magiclog')->count_by_uid_action($_G['uid'], 2); + if($count) { + $multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&operation=uselog'); + + $logs = C::t('common_magiclog')->fetch_all_by_uid_action($_G['uid'], 2, $start_limit, $_G['tpp']); + $luids=array(); + foreach($luids as $log) { + $luids[$log['uid']] = $log['uid']; + } + foreach($logs as $log) { + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log['name'] = $magicarray[$log['magicid']]['name']; + $loglist[] = $log; + } + } + + } elseif($operation == 'buylog') { + $count = C::t('common_magiclog')->count_by_uid_action($_G['uid'], 1); + if($count) { + $multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&operation=buylog'); + + foreach(C::t('common_magiclog')->fetch_all_by_uid_action($_G['uid'], 1, $start_limit, $_G['tpp']) as $log) { + $log['credit'] = $log['credit'] ? $log['credit'] : $_G['setting']['creditstransextra'][3]; + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log['name'] = $magicarray[$log['magicid']]['name']; + $loglist[] = $log; + } + } + + } elseif($operation == 'givelog') { + $count = C::t('common_magiclog')->count_by_uid_action($_G['uid'], 3); + if($count) { + $multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&operation=givelog'); + + $uids = null; + $query = C::t('common_magiclog')->fetch_all_by_uid_action($_G['uid'], 3, $start_limit, $_G['tpp']); + foreach($query as $log) { + $uids[] = $log['targetuid']; + } + if($uids != null) { + $memberdata = C::t('common_member')->fetch_all_username_by_uid($uids); + } + foreach($query as $log) { + $log['username'] = $memberdata[$log['targetuid']]; + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log['name'] = $magicarray[$log['magicid']]['name']; + $loglist[] = $log; + } + } + + } elseif($operation == 'receivelog') { + $count = C::t('common_magiclog')->count_by_targetuid_action($_G['uid'], 3); + if($count) { + $multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&operation=receivelog'); + + $logs = C::t('common_magiclog')->fetch_all_by_targetuid_action($_G['uid'], 3, $start_limit, $_G['tpp']); + $luids = array(); + foreach($logs as $log) { + $luids[$log['uid']] = $log['uid']; + } + $members = C::t('common_member')->fetch_all_username_by_uid($luids); + + foreach($logs as $log) { + $log['username'] = $members[$log['uid']]; + $log['dateline'] = dgmdate($log['dateline'], 'u'); + $log['name'] = $magicarray[$log['magicid']]['name']; + $loglist[] = $log; + } + } + } + $navtitle = lang('core', 'title_magics_log'); + +} else { + showmessage('undefined_action'); +} + +include template('home/space_magic'); + +?> \ No newline at end of file diff --git a/source/module/home/home_medal.php b/source/module/home/home_medal.php new file mode 100644 index 0000000..6b97aeb --- /dev/null +++ b/source/module/home/home_medal.php @@ -0,0 +1,186 @@ + 1)); +} + +$_G['mnid'] = 'mn_common'; +$medallist = $medallogs = array(); +$tpp = 10; +$page = max(1, intval($_GET['page'])); +$start_limit = ($page - 1) * $tpp; + +if(empty($_GET['action'])) { + include libfile('function/forum'); + $medalcredits = array(); + foreach(C::t('forum_medal')->fetch_all_data(1) as $medal) { + $medal['permission'] = medalformulaperm(serialize(array('medal' => dunserialize($medal['permission']))), $medal['type']); + $medal['image'] = preg_match('/^https?:\/\//is', $medal['image']) ? $medal['image'] : STATICURL.'image/common/'.$medal['image']; + if($medal['price']) { + $medal['credit'] = $medal['credit'] ? $medal['credit'] : $_G['setting']['creditstransextra'][3]; + $medalcredits[$medal['credit']] = $medal['credit']; + } + $medallist[$medal['medalid']] = $medal; + } + + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $membermedal = $memberfieldforum['medals'] ? explode("\t", $memberfieldforum['medals']) : array(); + $membermedal = array_map('intval', $membermedal); + + $lastmedals = $uids = array(); + foreach(C::t('forum_medallog')->fetch_all_lastmedal(10) as $id => $lastmedal) { + $lastmedal['dateline'] = dgmdate($lastmedal['dateline'], 'u'); + $lastmedals[$id] = $lastmedal; + $uids[] = $lastmedal['uid']; + } + $lastmedalusers = C::t('common_member')->fetch_all($uids); + $mymedals = C::t('common_member_medal')->fetch_all_by_uid($_G['uid']); + $mymedals = array_keys($mymedals); + $applylogs = C::t('forum_medallog')->fetch_all_by_type(2); + foreach ($applylogs as $id => $log) { + $log['uid'] == $_G['uid'] && $mymedals[$log['medalid']] = $log['medalid']; + } + +} elseif($_GET['action'] == 'confirm') { + + include libfile('function/forum'); + $medal = C::t('forum_medal')->fetch($_GET['medalid']); + $medal['permission'] = medalformulaperm(serialize(array('medal' => dunserialize($medal['permission']))), $medal['type']); + $medal['image'] = preg_match('/^https?:\/\//is', $medal['image']) ? $medal['image'] : STATICURL.'image/common/'.$medal['image']; + if($medal['price']) { + $medal['credit'] = $medal['credit'] ? $medal['credit'] : $_G['setting']['creditstransextra'][3]; + $medalcredits[$medal['credit']] = $medal['credit']; + } + include template('home/space_medal_float'); + +} elseif($_GET['action'] == 'apply' && submitcheck('medalsubmit')) { + + $medalid = intval($_GET['medalid']); + $_G['forum_formulamessage'] = $_G['forum_usermsg'] = $medalnew = ''; + $medal = C::t('forum_medal')->fetch($medalid); + if(!$medal['type']) { + showmessage('medal_apply_invalid'); + } + + if(C::t('common_member_medal')->count_by_uid_medalid($_G['uid'], $medalid)) { + showmessage('medal_apply_existence', 'home.php?mod=medal'); + } + + $applysucceed = FALSE; + $medalpermission = $medal['permission'] ? dunserialize($medal['permission']) : array(); + if($medalpermission[0] || $medalpermission['usergroupallow']) { + include libfile('function/forum'); + medalformulaperm(serialize(array('medal' => $medalpermission)), $medal['type']); + + if($_G['forum_formulamessage']) { + showmessage('medal_permforum_nopermission', 'home.php?mod=medal', array('formulamessage' => $_G['forum_formulamessage'], 'usermsg' => $_G['forum_usermsg'])); + } else { + $applysucceed = TRUE; + } + } else { + $applysucceed = TRUE; + } + + if($applysucceed) { + $expiration = empty($medal['expiration'])? 0 : TIMESTAMP + $medal['expiration'] * 86400; + if($medal['type'] == 1) { + if($medal['price']) { + $medal['credit'] = $medal['credit'] ? $medal['credit'] : $_G['setting']['creditstransextra'][3]; + if($medal['price'] > getuserprofile('extcredits'.$medal['credit'])) { + showmessage('medal_not_get_credit', '', array('credit' => $_G['setting']['extcredits'][$medal['credit']]['title'])); + } + updatemembercount($_G['uid'], array($medal['credit'] => -$medal['price']), true, 'BME', $medal['medalid']); + } + + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $usermedal = $memberfieldforum; + unset($memberfieldforum); + $medal['medalid'] = $medal['medalid'].(empty($expiration) ? '' : '|'.$expiration); + $medalnew = $usermedal['medals'] ? $usermedal['medals']."\t".$medal['medalid'] : $medal['medalid']; + C::t('common_member_field_forum')->update($_G['uid'], array('medals' => $medalnew)); + C::t('common_member_medal')->insert(array('uid' => $_G['uid'], 'medalid' => $medal['medalid']), 0, 1); + $medalmessage = 'medal_get_succeed'; + } else { + if(C::t('forum_medallog')->count_by_verify_medalid($_G['uid'], $medal['medalid'])) { + showmessage('medal_apply_existence', 'home.php?mod=medal'); + } + $medalmessage = 'medal_apply_succeed'; + manage_addnotify('verifymedal'); + } + + C::t('forum_medallog')->insert(array( + 'uid' => $_G['uid'], + 'medalid' => $medalid, + 'type' => $medal['type'], + 'dateline' => TIMESTAMP, + 'expiration' => $expiration, + 'status' => ($expiration ? 1 : 0), + )); + showmessage($medalmessage, 'home.php?mod=medal', array('medalname' => $medal['name'])); + } + +} elseif($_GET['action'] == 'log') { + + include libfile('function/forum'); + foreach(C::t('forum_medal')->fetch_all_data(1) as $medal) { + $medal['image'] = preg_match('/^https?:\/\//is', $medal['image']) ? $medal['image'] : STATICURL.'image/common/'.$medal['image']; + $medallist[$medal['medalid']] = $medal; + } + + $memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']); + $membermedal = $memberfieldforum['medals'] ? explode("\t", $memberfieldforum['medals']) : array(); + foreach($membermedal as $k => $medal) { + if(!in_array($medal, array_keys($medallist))) { + unset($membermedal[$k]); + } + } + $medalcount = count($membermedal); + + if(!empty($membermedal)) { + $mymedal = array(); + foreach($membermedal as $medalid) { + if($medalpos = strpos($medalid, '|')) { + $medalid = substr($medalid, 0, $medalpos); + } + $mymedal['name'] = $_G['cache']['medals'][$medalid]['name']; + $mymedal['image'] = $medallist[$medalid]['image']; + $mymedals[] = $mymedal; + } + } + + $medallognum = C::t('forum_medallog')->count_by_uid($_G['uid']); + $multipage = multi($medallognum, $tpp, $page, "home.php?mod=medal&action=log"); + + foreach(C::t('forum_medallog')->fetch_all_by_uid($_G['uid'], $start_limit, $tpp) as $medallog) { + $medallog['name'] = $_G['cache']['medals'][$medallog['medalid']]['name']; + $medallog['dateline'] = dgmdate($medallog['dateline']); + $medallog['expiration'] = !empty($medallog['expiration']) ? dgmdate($medallog['expiration']) : ''; + $medallogs[] = $medallog; + } + +} else { + showmessage('undefined_action'); +} + +$navtitle = lang('core', 'title_medals_list'); + +include template('home/space_medal'); + +?> \ No newline at end of file diff --git a/source/module/home/home_misc.php b/source/module/home/home_misc.php new file mode 100644 index 0000000..fe9010e --- /dev/null +++ b/source/module/home/home_misc.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/source/module/home/home_rss.php b/source/module/home/home_rss.php new file mode 100644 index 0000000..b6335d1 --- /dev/null +++ b/source/module/home/home_rss.php @@ -0,0 +1,78 @@ +range_blog(0, $pagenum, 'DESC', 'dateline', 0, null, $uid); +$blogids = array_keys($data_blog); +$data_blogfield = C::t('home_blogfield')->fetch_all($blogids); + +$charset = $_G['config']['output']['charset']; +dheader("Content-type: application/xml"); +echo "\n". + "\n". + " \n". + " {$space['username']}\n". + " {$space['space_url']}\n". + " {$_G['setting']['bbname']}\n". + " Copyright(C) {$_G['setting']['bbname']}\n". + " Discuz! Board by Comsenz Inc.\n". + " ".gmdate('r', TIMESTAMP)."\n". + " \n". + " {$_G['siteurl']}static/image/common/logo_88_31.gif\n". + " {$_G['setting']['bbname']}\n". + " {$_G['siteurl']}\n". + " \n"; + +foreach($data_blog as $curblogid => $value) { + $value = array_merge($value, (array)$data_blogfield[$curblogid]); + $value['message'] = getstr($value['message'], 300, 0, 0, 0, -1); + if($value['pic']) { + $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + $value['message'] .= "
          "; + } + echo " \n". + " ".$value['subject']."\n". + " {$_G['siteurl']}home.php?mod=space&uid={$value['uid']}&do=blog&id={$value['blogid']}\n". + " \n". + " ".dhtmlspecialchars($value['username'])."\n". + " ".gmdate('r', $value['dateline'])."\n". + " \n"; +} + +echo "
          \n". + "
          "; +?> \ No newline at end of file diff --git a/source/module/home/home_space.php b/source/module/home/home_space.php new file mode 100644 index 0000000..ccfb730 --- /dev/null +++ b/source/module/home/home_space.php @@ -0,0 +1,123 @@ + true, 'login' => 1)); +} +$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']); + +$member = array(); +if(getgpc('username')) { + $member = C::t('common_member')->fetch_by_username($_GET['username']); + if(empty($member) && !($member = C::t('common_member_archive')->fetch_by_username($_GET['username']))) { + showmessage('space_does_not_exist'); + } + $uid = $member['uid']; + $member['self'] = $uid == $_G['uid'] ? 1 : 0; +} + +if(getgpc('view') == 'admin') { + $_GET['do'] = $do; +} +if(empty($uid) || in_array($do, array('notice', 'pm'))) $uid = $_G['uid']; +if(empty($_GET['do']) && !isset($_GET['diy'])) { + if($_G['adminid'] == 1) { + if($_G['setting']['allowquickviewprofile']) { + if(!$_G['inajax']) dheader("Location:home.php?mod=space&uid=$uid&do=profile"); + } + } + if(helper_access::check_module('follow')) { + $do = $_GET['do'] = 'follow'; + } else { + $do = $_GET['do'] = !$_G['setting']['homepagestyle'] ? 'profile' : 'index'; + } +} elseif(empty($_GET['do']) && isset($_GET['diy']) && !empty($_G['setting']['homepagestyle'])) { + $_GET['do'] = 'index'; +} + +if($_GET['do'] == 'follow') { + if($uid != $_G['uid']) { + $_GET['do'] = 'view'; + $_GET['uid'] = $uid; + } + require_once libfile('home/follow', 'module'); + exit; +} elseif(empty($_GET['do']) && !$_G['inajax'] && !helper_access::check_module('follow')) { + $do = 'profile'; +} + +if($uid && empty($member)) { + $space = getuserbyuid($uid, 1); + if(empty($space)) { + showmessage('space_does_not_exist'); + } +} else { + $space = &$member; +} + +if(empty($space)) { + if(in_array($do, array('doing', 'blog', 'album', 'share', 'home', 'trade', 'poll', 'activity', 'debate', 'reward', 'group'))) { + if(empty($_GET['view']) || $_GET['view'] == 'all') { + $_GET['view'] = 'all'; + $space['uid'] = 0; + $space['self'] = 0; + } else { + showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1)); + } + } else { + showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1)); + } +} else { + + $navtitle = $space['username']; + + if($space['status'] == -1 && $_G['adminid'] != 1) { + showmessage('space_has_been_locked'); + } + + if(in_array($space['groupid'], array(4, 5, 6)) && ($_G['adminid'] != 1 && $space['uid'] != $_G['uid'])) { + $_GET['do'] = $do = 'profile'; + } + + $encodeusername = rawurlencode($space['username']); + + if($do != 'profile' && $do != 'index' && !ckprivacy($do, 'view')) { + $_G['privacy'] = 1; + require_once libfile('space/profile', 'include'); + include template('home/space_privacy'); + exit(); + } + + if(!$space['self'] && getgpc('view') != 'eccredit' && getgpc('view') != 'admin') $_GET['view'] = 'me'; +} + +$diymode = 0; + +list($seccodecheck, $secqaacheck) = seccheck('publish'); +if($do != 'index') { + $_G['disabledwidthauto'] = 0; +} +require_once libfile('function/friend'); +$isfriend = friend_check($space['uid']); +require_once libfile('space/'.$do, 'include'); + +?> \ No newline at end of file diff --git a/source/module/home/home_spacecp.php b/source/module/home/home_spacecp.php new file mode 100644 index 0000000..460fdf0 --- /dev/null +++ b/source/module/home/home_spacecp.php @@ -0,0 +1,63 @@ + true, 'login' => 1)); + } + + $space = getuserbyuid($_G['uid']); + if(empty($space)) { + showmessage('space_does_not_exist'); + } + space_merge($space, 'field_home'); + + if(($space['status'] == -1 || in_array($space['groupid'], array(4, 5, 6))) && $ac != 'usergroup') { + showmessage('space_has_been_locked'); + } + } +} +$actives = array($ac => ' class="a"'); + +list($seccodecheck, $secqaacheck) = seccheck('publish'); + +$navtitle = lang('core', 'title_setup'); +if(lang('core', 'title_memcp_'.$ac)) { + $navtitle = lang('core', 'title_memcp_'.$ac); +} + +$_G['disabledwidthauto'] = 0; + +require_once libfile('spacecp/'.$ac, 'include'); + +?> \ No newline at end of file diff --git a/source/module/home/home_task.php b/source/module/home/home_task.php new file mode 100644 index 0000000..1110aef --- /dev/null +++ b/source/module/home/home_task.php @@ -0,0 +1,125 @@ +update_available(); + +$_G['mnid'] = 'mn_common'; +$id = intval($_GET['id']); +$do = empty($_GET['do']) ? '' : $_GET['do']; + +if(empty($_G['uid'])) { + showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1)); +} + +$navtitle = lang('core', 'title_task'); + +if(empty($do)) { + + $_GET['item'] = empty($_GET['item']) ? 'new' : $_GET['item']; + $actives = array($_GET['item'] => ' class="a"'); + $tasklist = $tasklib->tasklist($_GET['item']); + $listdata = $tasklib->listdata; + if($_GET['item'] == 'doing' && empty($tasklist)) { + dsetcookie('taskdoing_'.$_G['uid']); + } + +} elseif($do == 'view' && $id) { + + cleartaskstatus(); + $allowapply = $tasklib->view($id); + $task = & $tasklib->task; + $taskvars = & $tasklib->taskvars; + +} elseif($do == 'apply' && $id) { + + if(!$_G['uid']) { + showmessage('not_loggedin', NULL, array(), array('login' => 1)); + } + + $result = $tasklib->apply($id); + + if($result === -1) { + showmessage('task_relatedtask', 'home.php?mod=task&do=view&id='.$tasklib->task['relatedtaskid']); + } elseif($result === -2) { + showmessage('task_grouplimit', 'home.php?mod=task&item=new'); + } elseif($result === -3) { + showmessage('task_duplicate', 'home.php?mod=task&item=new'); + } elseif($result === -4) { + showmessage('task_nextperiod', 'home.php?mod=task&item=new'); + } elseif($result === -5) { + showmessage('task_exclusivetask', 'home.php?mod=task&item=new'); + } else { + dsetcookie('taskdoing_'.$_G['uid'], 1, 7776000); + showmessage('task_applied', 'home.php?mod=task&do=view&id='.$id); + } + +} elseif($do == 'delete' && $id) { + + $result = $tasklib->delete($id); + showmessage('task_deleted', 'home.php?mod=task&item=doing'); + +} elseif($do == 'draw' && $id) { + + if(!$_G['uid']) { + showmessage('not_loggedin', NULL, array(), array('login' => 1)); + } + + $result = $tasklib->draw($id); + if($result === -1) { + showmessage('task_up_to_limit', 'home.php?mod=task', array('tasklimits' => $tasklib->task['tasklimits'])); + } elseif($result === -2) { + showmessage('task_failed', 'home.php?mod=task&item=failed'); + } elseif($result === -3) { + showmessage($tasklib->messagevalues['msg'], 'home.php?mod=task&do=view&id='.$id, $tasklib->messagevalues['values']); + } elseif($result === -4) { + showmessage('task_exclusivetask', 'home.php?mod=task&item=new'); + } else { + cleartaskstatus(); + showmessage('task_completed', 'home.php?mod=task&item=done'); + } + +} elseif($do == 'giveup' && $id) { + + $tasklib->giveup($id); + showmessage('task_giveup', 'home.php?mod=task&item=view&id='.$id); + +} elseif($do == 'parter' && $id) { + + $parterlist = $tasklib->parter($id); + include template('home/space_task_parter'); + dexit(); + +} else { + showmessage('undefined_action'); +} + +include template('home/space_task'); + +function cleartaskstatus() { + global $_G; + if(!C::t('common_mytask')->count_mytask($_G['uid'], false, 0)) { + dsetcookie('taskdoing_'.$_G['uid']); + } +} + +?> \ No newline at end of file diff --git a/source/module/home/index.htm b/source/module/home/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/index.htm b/source/module/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/member/index.htm b/source/module/member/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/member/member_connect.php b/source/module/member/member_connect.php new file mode 100644 index 0000000..f840152 --- /dev/null +++ b/source/module/member/member_connect.php @@ -0,0 +1,117 @@ +connect_guest = $connect_guest; + + $ctl_obj->extrafile = libfile('member/connect_logging', 'module'); + $ctl_obj->template = 'member/login'; + $ctl_obj->on_login(); + +} else { // debug 完善我的资料,即添加个新的论坛账号走此分支 + + $_G['qc']['connect_auth_hash'] = $_GET['con_auth_hash']; + if(!$_G['qc']['connect_auth_hash']) { + $_G['qc']['connect_auth_hash'] = $_G['cookie']['con_auth_hash']; + } + + $conopenid = authcode($_G['qc']['connect_auth_hash']); + + $ctl_obj = new register_ctl(); + $ctl_obj->setting = $_G['setting']; + + if($_G['setting']['regconnect']) { + $ctl_obj->setting['regstatus'] = $ctl_obj->setting['regstatus'] ? $ctl_obj->setting['regstatus'] : 1; + } + + $_G['setting']['regclosed'] = $_G['setting']['regconnect'] && !$_G['setting']['regstatus']; + + loadcache('connect_blacklist'); + if(in_array($conopenid, $_G['cache']['connect_blacklist'])) { + showmessage('qqconnect:connect_uin_in_blacklist', $referer, array('changeqqurl' => $_G['connect']['discuz_change_qq_url'])); + } + + $_G['qc']['uinlimit'] = $_G['setting']['connect']['register_uinlimit'] && C::t('#qqconnect#connect_memberbindlog')->count_uid_by_openid_type($conopenid, '1') >= $_G['setting']['connect']['register_uinlimit']; + if($_G['qc']['uinlimit']) { + $_G['setting']['regconnect'] = false; + } + if(!$_G['setting']['regconnect']) { + $ctl_obj->showregisterform = 0; + $ctl_obj->setting['sitemessage']['register'] = array(); + } + + if($_G['qc']['uinlimit']) { + $ctl_obj->showregisterform = 0; + $ctl_obj->setting['sitemessage']['register'] = array(); + $ctl_obj->setting['regconnect'] = false; + } + + if($_G['setting']['connect']['register_regverify']) { + $ctl_obj->setting['regverify'] = 0; + } + $_G['setting']['seccodestatus'] = 0; + $_G['setting']['secqaa']['status'] = 0; + + $ctl_obj->setting['sendregisterurl'] = false; + + $ctl_obj->connect_guest = $connect_guest; + + loadcache(array('fields_connect_register', 'profilesetting')); + foreach($_G['cache']['fields_connect_register'] as $field => $data) { + unset($_G['cache']['fields_register'][$field]); + } + $_G['cache']['profilesetting']['gender']['unchangeable'] = 0; + $_G['cache']['profilesetting']['birthyear']['unchangeable'] = 0; + $_G['cache']['profilesetting']['birthmonth']['unchangeable'] = 0; + $_G['cache']['profilesetting']['birthday']['unchangeable'] = 0; + $_G['cache']['fields_register'] = array_merge($_G['cache']['fields_connect_register'], $_G['cache']['fields_register']); + + if($_G['setting']['connect']['register_invite']) { + $ctl_obj->setting['regstatus'] = 1; + } + + if(!$_G['setting']['connect']['register_regverify']) { + $ctl_obj->setting['seccodestatus'] = $_G['setting']['seccodestatus']; + $ctl_obj->setting['secqaa']['status'] = $_G['setting']['secqaa']['status']; + } + + if(!defined('IN_MOBILE') || empty($_GET[$_G['setting']['reginput']['password']])) { + $ctl_obj->setting['ignorepassword'] = 1; + } + $ctl_obj->setting['checkuinlimit'] = 1; + $ctl_obj->setting['strongpw'] = 0; + $ctl_obj->setting['pwlength'] = 0; + + if($_GET['ac'] == 'bind') { + $ctl_obj->setting['reglinkname'] = lang('plugin/qqconnect', 'connect_register_bind'); + } else { + $ctl_obj->setting['reglinkname'] = lang('plugin/qqconnect', 'connect_register_profile'); + } + + $ctl_obj->extrafile = libfile('member/connect_register', 'module'); + $ctl_obj->template = 'member/register'; + $ctl_obj->on_register(); + +} + +?> \ No newline at end of file diff --git a/source/module/member/member_connect_logging.php b/source/module/member/member_connect_logging.php new file mode 100644 index 0000000..f00cca0 --- /dev/null +++ b/source/module/member/member_connect_logging.php @@ -0,0 +1,56 @@ +connect_guest['conuin']; + $conuinsecret = $this->connect_guest['conuinsecret']; + $conopenid = $this->connect_guest['conopenid']; + $conuintoken = $this->connect_guest['conuintoken']; + + $user_auth_fields = 1; + $conispublishfeed = 0; + $conispublisht = 0; + + $is_use_qqshow = 0; + + if ($conopenid) { + C::t('#qqconnect#common_member_connect')->insert(array('uid' => $uid, 'conuin' => $conuin, 'conuinsecret' => $conuinsecret, 'conuintoken' => $conuintoken, 'conopenid' => $conopenid, 'conispublishfeed' => $conispublishfeed, 'conispublisht' => $conispublisht, 'conisregister' => '0', 'conisqzoneavatar' => '0', 'conisfeed' => $user_auth_fields, 'conisqqshow' => $is_use_qqshow), false, true); + C::t('common_member')->update($uid, array('conisbind' => '1')); + C::t('#qqconnect#connect_memberbindlog')->insert(array('uid' => $uid, 'uin' => $conopenid, 'type' => '1', 'dateline' => $_G['timestamp'])); + + C::t('#qqconnect#common_connect_guest')->delete($conopenid); + + dsetcookie('connect_js_name', 'user_bind', 86400); + dsetcookie('connect_js_params', base64_encode(serialize(array('type' => 'registerbind'))), 86400); + + dsetcookie('connect_login', 1, 31536000); + dsetcookie('connect_is_bind', '1', 31536000); + dsetcookie('connect_uin', $conopenid, 31536000); + dsetcookie('stats_qc_reg', 2, 86400); + if ($_GET['is_feed']) { + dsetcookie('connect_synpost_tip', 1, 31536000); + } + + } else { + showmessage('qqconnect:connect_get_access_token_failed', dreferer()); + } +} + +?> \ No newline at end of file diff --git a/source/module/member/member_connect_register.php b/source/module/member/member_connect_register.php new file mode 100644 index 0000000..15d842d --- /dev/null +++ b/source/module/member/member_connect_register.php @@ -0,0 +1,132 @@ + true, 'login' => 1)); + } + + $_G['qc']['connect_is_feed'] = false; + + $_G['qc']['connect_app_id'] = $_G['setting']['connectappid']; + $_G['qc']['connect_openid'] = $conopenid; + unset($auth_code, $conopenid); + + $_G['qc']['connect_is_notify'] = true; + + foreach($_G['cache']['fields_register'] as $field) { + $fieldid = $field['fieldid']; + $html = profile_setting($fieldid, $connectdefault); + if($html) { + $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid]; + $htmls[$fieldid] = $html; + } + } + +} else { + + if(!empty($_G['setting']['checkuinlimit']) && !empty($_GET['uin'])) { + if($_G['qc']['uinlimit']) { + showmessage('qqconnect:connect_register_uinlimit', '', array('limit' => $this->setting['connect']['register_uinlimit'])); + } + if(!$_G['setting']['regconnect']) { + showmessage('qqconnect:connect_register_closed'); + } + } + + $conuin = $this->connect_guest['conuin']; + $conuinsecret = $this->connect_guest['conuinsecret']; + $conuintoken = $this->connect_guest['conuintoken']; + $conopenid = $this->connect_guest['conopenid']; + + $cookie_expires = 2592000; + dsetcookie('client_created', TIMESTAMP, $cookie_expires); + dsetcookie('client_token', 1, $cookie_expires); + + if (!$conuintoken || !$conopenid) { + showmessage('qqconnect:connect_get_request_token_failed'); + } + + if(C::t('#qqconnect#common_member_connect')->fetch_fields_by_openid($conopenid, 'uid')) { + showmessage('qqconnect:connect_register_bind_uin_already'); + } + + $conispublishfeed = 0; + $conispublisht = 0; + + $userdata = array(); + $userdata['avatarstatus'] = 0; + $userdata['conisbind'] = 1; + + C::t('#qqconnect#common_member_connect')->insert(array( + 'uid' => $uid, + 'conuin' => $conuin, + 'conuinsecret' => $conuinsecret, + 'conuintoken' => $conuintoken, + 'conopenid' => $conopenid, + 'conispublishfeed' => $conispublishfeed, + 'conispublisht' => $conispublisht, + 'conisregister' => $this->setting['ignorepassword'] ? '1' : '0', + 'conisqzoneavatar' => '0', + 'conisfeed' => '1', + 'conisqqshow' => '0', + )); + + dsetcookie('connect_js_name', 'user_bind', 86400); + dsetcookie('connect_js_params', base64_encode(serialize(array('type' => 'register'))), 86400); + dsetcookie('connect_login', 1, 31536000); + dsetcookie('connect_is_bind', '1', 31536000); + dsetcookie('connect_uin', $conopenid, 31536000); + dsetcookie('stats_qc_reg', 1, 86400); + if ($_GET['is_feed']) { + dsetcookie('connect_synpost_tip', 1, 31536000); + } + + C::t('#qqconnect#connect_memberbindlog')->insert(array('uid' => $uid, 'uin' => $conopenid, 'type' => '1', 'dateline' => $_G['timestamp'])); + dsetcookie('con_auth_hash'); + + C::t('#qqconnect#common_connect_guest')->delete($conopenid); + if(!function_exists('build_cache_userstats')) { + require_once libfile('cache/userstats', 'function'); + } + build_cache_userstats(); + + if($_G['setting']['connect']['register_groupid']) { + $userdata['groupid'] = $groupinfo['groupid'] = $_G['setting']['connect']['register_groupid']; + } + C::t('common_member')->update($uid, $userdata); + + if($_G['setting']['connect']['register_addcredit']) { + $addcredit = array('extcredits'.$_G['setting']['connect']['register_rewardcredit'] => $_G['setting']['connect']['register_addcredit']); + } + C::t('common_member_count')->increase($uid, $addcredit); +} + +function connect_filter_username($username) { + $username = str_replace(' ', '_', trim($username)); + return cutstr($username, 15, ''); +} + +?> \ No newline at end of file diff --git a/source/module/member/member_getpasswd.php b/source/module/member/member_getpasswd.php new file mode 100644 index 0000000..961b5fb --- /dev/null +++ b/source/module/member/member_getpasswd.php @@ -0,0 +1,105 @@ + $paramv){ + $param[$parammatchs[4][$paramk]] = $paramv; + } +} +$uid = isset($_GET['uid']) ? $_GET['uid'] : $param['uid']; +$id = isset($_GET['id']) ? $_GET['id'] : $param['id']; +$sign = isset($_GET['sign']) ? $_GET['sign'] : $param['sign']; + +if($uid && $id && $sign === make_getpws_sign($uid, $id)) { + + $discuz_action = 141; + + + $member = getuserbyuid($uid, 1); + $table_ext = isset($member['_inarchive']) ? '_archive' : ''; + $member = array_merge(C::t('common_member_field_forum'.$table_ext)->fetch($uid), $member); + list($dateline, $operation, $idstring) = explode("\t", $member['authstr']); + + if($dateline < TIMESTAMP - 86400 * 3 || $operation != 1 || $idstring != $id) { + showmessage('getpasswd_illegal', NULL); + } + + if(!submitcheck('getpwsubmit') || $_GET['newpasswd1'] != $_GET['newpasswd2']) { + $navtitle = lang('core', 'title_getpasswd'); + $hashid = $id; + $uid = $_GET['uid']; + include template('member/getpasswd'); + } else { + if($_GET['newpasswd1'] != addslashes($_GET['newpasswd1'])) { + showmessage('profile_passwd_illegal'); + } + if($_G['setting']['pwlength']) { + if(strlen($_GET['newpasswd1']) < $_G['setting']['pwlength']) { + showmessage('profile_password_tooshort', '', array('pwlength' => $_G['setting']['pwlength'])); + } + } + if($_G['setting']['strongpw']) { + $strongpw_str = array(); + if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpasswd1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_1'); + } + if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpasswd1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_2'); + } + if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpasswd1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_3'); + } + if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpasswd1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_4'); + } + if($strongpw_str) { + showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str)); + } + } + loaducenter(); + uc_user_edit(addslashes($member['username']), $_GET['newpasswd1'], $_GET['newpasswd1'], addslashes($member['email']), 1, 0); + $password = md5(random(10)); + + if(isset($member['_inarchive'])) { + C::t('common_member_archive')->move_to_master($member['uid']); + } + C::t('common_member')->update($uid, array('password' => $password)); + C::t('common_member_field_forum')->update($uid, array('authstr' => '')); + + if(!function_exists('sendmail')) { + include libfile('function/mail'); + } + $reset_password_subject = array( + 'tpl' => 'password_reset', + 'var' => array( + 'username' => $member['username'], + 'bbname' => $_G['setting']['bbname'], + 'siteurl' => $_G['setting']['securesiteurl'], + 'datetime' => dgmdate(time(), 'Y-m-d H:i:s'), + 'clientip' => $_G['clientip'] + ) + ); + if(!sendmail("{$member['username']} <{$member['email']}>", $reset_password_subject)) { + runlog('sendmail', "{$member['email']} sendmail failed."); + } + + showmessage('getpasswd_succeed', 'index.php', array(), array('login' => 1)); + } + +} else { + showmessage('parameters_error'); +} +?> \ No newline at end of file diff --git a/source/module/member/member_logging.php b/source/module/member/member_logging.php new file mode 100644 index 0000000..b1f0536 --- /dev/null +++ b/source/module/member/member_logging.php @@ -0,0 +1,26 @@ +setting = $_G['setting']; +$method = 'on_'.$_GET['action']; +$ctl_obj->template = 'member/login'; +$ctl_obj->$method(); + +?> \ No newline at end of file diff --git a/source/module/member/member_lostpasswd.php b/source/module/member/member_lostpasswd.php new file mode 100644 index 0000000..a487578 --- /dev/null +++ b/source/module/member/member_lostpasswd.php @@ -0,0 +1,79 @@ +count_by_email($_GET['email'], 1); + if(!$emailcount) { + showmessage('lostpasswd_email_not_exist'); + } + if($emailcount > 1) { + showmessage('lostpasswd_many_users_use_email'); + } + $member = C::t('common_member')->fetch_by_email($_GET['email'], 1); + list($tmp['uid'], , $tmp['email']) = uc_get_user(addslashes($member['username'])); + $tmp['email'] = strtolower(trim($tmp['email'])); + } + if(!$member) { + showmessage('getpasswd_account_notmatch'); + } elseif($member['adminid'] == 1 || $member['adminid'] == 2) { + showmessage('getpasswd_account_invalid'); + } + + $table_ext = $member['_inarchive'] ? '_archive' : ''; + if($member['email'] != $tmp['email']) { + C::t('common_member'.$table_ext)->update($tmp['uid'], array('email' => $tmp['email'])); + } + + $memberauthstr = C::t('common_member_field_forum'.$table_ext)->fetch($member['uid']); + list($dateline, $operation, $idstring) = explode("\t", $memberauthstr['authstr']); + $interval = $_G['setting']['mailinterval'] > 0 ? (int)$_G['setting']['mailinterval'] : 300; + if($dateline && $operation == 1 && $dateline > TIMESTAMP - $interval) { + showmessage('getpasswd_has_send', '', array('interval' => $interval)); + } + + $idstring = random(6); + C::t('common_member_field_forum'.$table_ext)->update($member['uid'], array('authstr' => "{$_G['timestamp']}\t1\t$idstring")); + require_once libfile('function/mail'); + $get_passwd_message = array( + 'tpl' => 'get_passwd', + 'var' => array( + 'username' => $member['username'], + 'bbname' => $_G['setting']['bbname'], + 'siteurl' => $_G['setting']['securesiteurl'], + 'uid' => $member['uid'], + 'idstring' => $idstring, + 'clientip' => $_G['clientip'], + 'sign' => make_getpws_sign($member['uid'], $idstring), + ) + ); + if(!sendmail("{$_GET['username']} <{$tmp['email']}>", $get_passwd_message)) { + runlog('sendmail', "{$tmp['email']} sendmail failed."); + } + showmessage('getpasswd_send_succeed', $_G['siteurl'], array(), array('showdialog' => 1, 'locationtime' => true)); +} + +?> \ No newline at end of file diff --git a/source/module/member/member_register.php b/source/module/member/member_register.php new file mode 100644 index 0000000..887b1ec --- /dev/null +++ b/source/module/member/member_register.php @@ -0,0 +1,21 @@ +setting = $_G['setting']; +$ctl_obj->template = 'member/register'; +$ctl_obj->on_register(); + +?> \ No newline at end of file diff --git a/source/module/member/member_regverify.php b/source/module/member/member_regverify.php new file mode 100644 index 0000000..795abd6 --- /dev/null +++ b/source/module/member/member_regverify.php @@ -0,0 +1,32 @@ +fetch($_G['uid'])) && $verify_member['status'] == 1) { + C::t('common_member_validate')->update($_G['uid'], array( + 'submittimes' => $verify_member['submittimes']+1, + 'submitdate' => $_G['timestamp'], + 'status' => '0', + 'message' => dhtmlspecialchars($_GET['regmessagenew']) + )); + showmessage('submit_verify_succeed', 'home.php?mod=spacecp&ac=profile'); + } else { + showmessage('undefined_action'); + } + +} + +?> \ No newline at end of file diff --git a/source/module/member/member_switchstatus.php b/source/module/member/member_switchstatus.php new file mode 100644 index 0000000..f2129f2 --- /dev/null +++ b/source/module/member/member_switchstatus.php @@ -0,0 +1,34 @@ + $_G['group']['grouptitle']), array('login' => 1)); + } + + $_G['session']['invisible'] = $_G['session']['invisible'] ? 0 : 1; + C::app()->session->update_by_uid($_G['uid'], array('invisible' => $_G['session']['invisible'])); + C::t('common_member_status')->update($_G['uid'], array('invisible' => $_G['session']['invisible']), 'UNBUFFERED'); + if(!empty($_G['setting']['sessionclose'])) { + dsetcookie('ulastactivity', TIMESTAMP.'|'.getuserprofile('invisible'), 31536000); + } + $language = lang('forum/misc'); + $msg = $_G['session']['invisible'] ? $language['login_invisible_mode'] : $language['login_normal_mode']; + showmessage(''.$msg.'', dreferer(), array(), array('msgtype' => 3, 'showmsg' => 1)); + +} + +?> \ No newline at end of file diff --git a/source/module/misc/index.htm b/source/module/misc/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/misc/misc_buyinvitecode.php b/source/module/misc/misc_buyinvitecode.php new file mode 100644 index 0000000..e22ac26 --- /dev/null +++ b/source/module/misc/misc_buyinvitecode.php @@ -0,0 +1,76 @@ + $amount, + 'email' => $email, + 'ip' => $_G['clientip'], + 'port' => $_G['remoteport'] + ) + ); + + include isset($_REQUEST['inajax']) ? template('common/header_ajax') : template('common/header'); + echo '
          '; + include isset($_REQUEST['inajax']) ? template('common/footer_ajax') : template('common/footer'); + dexit(); + } else { + showmessage('action_closed', NULL); + } + +} +if($_GET['action'] == 'paysucceed' && $_GET['orderid']) { + $orderid = $_GET['orderid']; + $order = C::t('forum_order')->fetch($orderid); + if(!$order) { + showmessage('parameters_error'); + } + $codes = array(); + foreach(C::t('common_invite')->fetch_all_orderid($orderid) as $code) { + $codes[] = $code['code']; + } + if(empty($codes)) { + showmessage('buyinvitecode_no_id'); + } + $codetext = implode("\r\n", $codes); +} + +if($_G['group']['maxinviteday']) { + $maxinviteday = time() + 86400 * $_G['group']['maxinviteday']; +} else { + $maxinviteday = time() + 86400 * 10; +} +$maxinviteday = dgmdate($maxinviteday, 'Y-m-d H:i'); +$_G['setting']['inviteconfig']['invitecodeprompt'] = nl2br($_G['setting']['inviteconfig']['invitecodeprompt']); + +include template('common/buyinvitecode'); +?> \ No newline at end of file diff --git a/source/module/misc/misc_diyhelp.php b/source/module/misc/misc_diyhelp.php new file mode 100644 index 0000000..cd4820d --- /dev/null +++ b/source/module/misc/misc_diyhelp.php @@ -0,0 +1,38 @@ +fetch($topicid)) && $topic['uid'] == $_G['uid']) { + $allowdiy = true; + } + } + } + } +} + +include_once template('portal/portal_diyhelp'); + +?> \ No newline at end of file diff --git a/source/module/misc/misc_error.php b/source/module/misc/misc_error.php new file mode 100644 index 0000000..8e21ae5 --- /dev/null +++ b/source/module/misc/misc_error.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/source/module/misc/misc_faq.php b/source/module/misc/misc_faq.php new file mode 100644 index 0000000..a214790 --- /dev/null +++ b/source/module/misc/misc_faq.php @@ -0,0 +1,82 @@ +fetch_all_by_fpid() as $faq) { + if(empty($faq['fpid'])) { + $faqparent[$faq['id']] = $faq; + if($_GET['id'] == $faq['id']) { + $ctitle = $faq['title']; + } + } else { + $faqsub[$faq['fpid']][] = $faq; + } +} + +if($_GET['action'] == 'faq') { + + $id = intval($_GET['id']); + $faq = C::t('forum_faq')->fetch_all_by_fpid($id); + if($faq) { + $ffaq = $faq[$id]; + + $navtitle = $ctitle; + $navigation = " $ctitle"; + $faqlist = array(); + $messageid = empty($_GET['messageid']) ? 0 : $_GET['messageid']; + foreach(C::t('forum_faq')->fetch_all_by_fpid($id) as $faq) { + if(!$messageid) { + $messageid = $faq['id']; + } + $faqlist[] = $faq; + } + } else { + showmessage('faq_content_empty', 'misc.php?mod=faq'); + } + +} elseif($_GET['action'] == 'search') { + + $navtitle = lang('core', 'search'); + if(submitcheck('searchsubmit')) { + if(($keyword = $_GET['keyword'])) { + $sqlsrch = ''; + $searchtype = in_array($_GET['searchtype'], array('all', 'title', 'message')) ? $_GET['searchtype'] : 'all'; + $faqlist = array(); + foreach(C::t('forum_faq')->fetch_all_by_fpid('', $keyword) as $faq) { + if(!empty($faq['fpid'])) { + $faq['title'] = preg_replace("/(?<=[\s\"\]>()]|[\x7f-\xff]|^)(".preg_quote($keyword, '/').")(([.,:;-?!()\s\"<\[]|[\x7f-\xff]|$))/siU", "\\1\\2", $faq['title']); + $faq['message'] = preg_replace("/(?<=[\s\"\]>()]|[\x7f-\xff]|^)(".preg_quote($keyword, '/').")(([.,:;-?!()\s\"<\[]|[\x7f-\xff]|$))/siU", "\\1\\2", $faq['message']); + $faqlist[] = $faq; + } + } + } else { + showmessage('faq_keywords_empty', 'misc.php?mod=faq'); + } + $keyword = dhtmlspecialchars($keyword); + } + +} elseif($_GET['action'] == 'plugin' && !empty($_GET['id'])) { + + $navtitle = $_G['setting']['plugins']['faq'][$_GET['id']]['name']; + $navigation = ' '.$_G['setting']['plugins']['faq'][$_GET['id']]['name']; + include pluginmodule($_GET['id'], 'faq'); + +} else { + $navtitle = lang('core', 'faq'); +} + +include template('common/faq'); + +?> \ No newline at end of file diff --git a/source/module/misc/misc_getatuser.php b/source/module/misc/misc_getatuser.php new file mode 100644 index 0000000..a750d17 --- /dev/null +++ b/source/module/misc/misc_getatuser.php @@ -0,0 +1,48 @@ +fetch_all($cookies, false) as $row) { + if ($row['uid'] != $_G['uid'] && in_array($row['uid'], $cookies)) { + $atlist_cookie[$row['uid']] = $row['username']; + } + } + } + foreach(C::t('home_follow')->fetch_all_following_by_uid($_G['uid'], 0, 0, $limit) as $row) { + if($atlist_cookie[$row['followuid']]) { + continue; + } + $atlist[$row['followuid']] = $row['fusername']; + } + $num = count($atlist); + if($num < $limit) { + $query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, $limit * 2); + foreach($query as $row) { + if(count($atlist) == $limit) { + break; + } + if($atlist_cookie[$row['fuid']]) { + continue; + } + $atlist[$row['fuid']] = $row['fusername']; + } + } + $result = implode(',', $atlist_cookie).($atlist_cookie && $atlist ? ',' : '').implode(',', $atlist); +} +include template('common/getatuser'); +?> \ No newline at end of file diff --git a/source/module/misc/misc_imgcropper.php b/source/module/misc/misc_imgcropper.php new file mode 100644 index 0000000..21e714c --- /dev/null +++ b/source/module/misc/misc_imgcropper.php @@ -0,0 +1,66 @@ + 50 ? $_GET['width'] : 300; + $cboxheight = $_GET['height'] > 50 ? $_GET['height'] : 300; + + $cbgboxwidth = $cboxwidth + 300; + $cbgboxheight = $cboxheight + 300; + $dragpl = ($cbgboxwidth - $cboxwidth)/2; + $dragpt = ($cbgboxheight - $cboxheight)/2; + } else { + $prefix = $_GET['picflag'] == 2 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']; + } + include_once template("common/misc_imgcropper"); +} else { + $pathinfos = pathinfo($_GET['cutimg']); + if(!in_array(strtolower($pathinfos['extension']), array('jpg', 'jpeg', 'gif', 'png', 'bmp'))) { + showmessage('imagepreview_errorcode_0', null, null, array('showdialog' => true, 'closetime' => true)); + } + $cropfile = md5($_GET['cutimg']).'.jpg'; + $ictype = $_GET['ictype']; + + if($ictype == 'block') { + require_once libfile('function/block'); + $block = C::t('common_block')->fetch($_GET['bid']); + $cropfile = block_thumbpath($block, array('picflag' => intval($_GET['picflag']), 'pic' => $_GET['cutimg'])); + $cutwidth = $block['picwidth']; + $cutheight = $block['picheight']; + } else { + $cutwidth = $_GET['cutwidth']; + $cutheight = $_GET['cutheight']; + } + $top = intval($_GET['cuttop'] < 0 ? 0 : $_GET['cuttop']); + $left = intval($_GET['cutleft'] < 0 ? 0 : $_GET['cutleft']); + $picwidth = $cutwidth > $_GET['picwidth'] ? $cutwidth : $_GET['picwidth']; + $picheight = $cutheight > $_GET['picheight'] ? $cutheight : $_GET['picheight']; + + require_once libfile('class/image'); + $image = new image(); + $prefix = $_GET['picflag'] == 2 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']; + if(!$image->Thumb($prefix.$_GET['cutimg'], $cropfile, $picwidth, $picheight)) { + showmessage('imagepreview_errorcode_'.$image->errorcode, null, null, array('showdialog' => true, 'closetime' => true)); + } + $image->Cropper($image->target, $cropfile, $cutwidth, $cutheight, $left, $top); + showmessage('do_success', dreferer(), array('icurl' => $cropfile), array('showdialog' => true, 'closetime' => true)); +} + +?> \ No newline at end of file diff --git a/source/module/misc/misc_initsys.php b/source/module/misc/misc_initsys.php new file mode 100644 index 0000000..320c1ca --- /dev/null +++ b/source/module/misc/misc_initsys.php @@ -0,0 +1,92 @@ +fetch_by_identifier($pluginid); + if($plugin) { + $modules = dunserialize($plugin['modules']); + if($modules['system'] > 0) { + if($pluginarray['plugin']['version'] != $plugin['version']) { + pluginupgrade($pluginarray, ''); + if($pluginarray['upgradefile']) { + $plugindir = DISCUZ_ROOT.'./source/plugin/'.$pluginarray['plugin']['directory']; + if(file_exists($plugindir.'/'.$pluginarray['upgradefile'])) { + @include_once $plugindir.'/'.$pluginarray['upgradefile']; + } + } + } + if($modules['system'] != $systemvalue) { + $modules['system'] = $systemvalue; + $modules = serialize($modules); + C::t('common_plugin')->update($plugin['pluginid'], array('modules' => $modules)); + } + continue; + } + C::t('common_plugin')->delete_by_identifier($pluginid); + } + + if($plugin['available']) { + $opens[] = $pluginid; + } + + $pluginarray['plugin']['modules'] = dunserialize(dstripslashes($pluginarray['plugin']['modules'])); + $pluginarray['plugin']['modules']['system'] = $systemvalue; + $pluginarray['plugin']['modules'] = serialize($pluginarray['plugin']['modules']); + plugininstall($pluginarray, '', in_array($pluginid, $opens)); + + if($pluginarray['installfile']) { + $plugindir = DISCUZ_ROOT.'./source/plugin/'.$pluginarray['plugin']['directory']; + if(file_exists($plugindir.'/'.$pluginarray['installfile'])) { + @include_once $plugindir.'/'.$pluginarray['installfile']; + } + } +} + +?> \ No newline at end of file diff --git a/source/module/misc/misc_invite.php b/source/module/misc/misc_invite.php new file mode 100644 index 0000000..f0bfc04 --- /dev/null +++ b/source/module/misc/misc_invite.php @@ -0,0 +1,170 @@ +fetch_userinfo($_G['uid'], $id); + if(empty($groupuserinfo['uid'])) { + showmessage('group_invite_failed'); + } + $foruminfo = C::t('forum_forum')->fetch($id); + $grouplevel = $foruminfo['level']; + loadcache('grouplevels'); + $grouplevel = $_G['grouplevels'][$grouplevel]; + $membermaximum = $grouplevel['specialswitch']['membermaximum']; + if(!empty($membermaximum)) { + $curnum = C::t('forum_groupuser')->fetch_count_by_fid($id, -1); + if($curnum >= $membermaximum) { + showmessage('group_member_maximum', '', array('membermaximum' => $membermaximum)); + } + } + + $groupname = $foruminfo['name']; + $invitename = lang('group/misc', 'group_join', array('groupname' => $groupname)); + if(!submitcheck('invitesubmit')) { + $friends = friend_list($_G['uid'], 100); + if(!empty($friends)) { + $frienduids = array_keys($friends); + $inviteduids = array(); + $query = C::t('forum_groupinvite')->fetch_all_inviteuid($id, $frienduids, $_G['uid']); + foreach($query as $inviteuser) { + $inviteduids[$inviteuser['inviteuid']] = $inviteuser['inviteuid']; + } + $query = C::t('forum_groupuser')->fetch_all_userinfo($frienduids, $id); + foreach($query as $inviteuser) { + $inviteduids[$inviteuser['uid']] = $inviteuser['uid']; + } + } + $inviteduids = !empty($inviteduids) ? implode(',', $inviteduids) : ''; + } else { + $uids = $_GET['uids']; + if($uids) { + if(count($uids) > 20) { + showmessage('group_choose_friends_max'); + } + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $user) { + C::t('forum_groupinvite')->insert(array('fid' => $id, 'uid' => $_G['uid'], 'inviteuid' => $uid, 'dateline' => TIMESTAMP), true, true); + $already = C::t('forum_groupinvite')->affected_rows(); + if($already == 1) { + notification_add($uid, 'group', 'group_member_invite', array('groupname' => $groupname, 'fid' => $id, 'url' =>'forum.php?mod=group&action=join&fid='.$id, 'from_id' => $id, 'from_idtype' => 'invite_group'), 1); + } + } + showmessage('group_invite_succeed', "forum.php?mod=group&fid=$id"); + } else { + showmessage('group_invite_choose_member', "forum.php?mod=group&fid=$id"); + } + } +} elseif($_GET['action'] == 'thread') { + $inviteduids = array(); + $id = intval($_GET['id']); + $thread = C::t('forum_thread')->fetch_thread($id); + $at = 0; + $maxselect = 20; + if(empty($_GET['activity'])) { + $at = 1; + $maxselect = 0; + if($_G['group']['allowat']) { + $atnum = 0; + foreach(C::t('home_notification')->fetch_all_by_authorid_fromid($_G['uid'], $id, 'at') as $row) { + $atnum ++; + $inviteduids[$row['uid']] = $row['uid']; + } + $maxselect = $_G['group']['allowat'] - $atnum; + } else { + showmessage('noperm_at_user'); + } + if($maxselect <= 0) { + showmessage('thread_at_usernum_limit'); + } + $invitename = lang('forum/misc', 'at_invite'); + } else { + $invitename = lang('forum/misc', 'join_activity'); + } + + if(!submitcheck('invitesubmit')) { + $inviteduids = !empty($inviteduids) ? implode(',', $inviteduids) : ''; + } else { + $uids = $_GET['uids']; + if($uids) { + if(count($uids) > $maxselect) { + showmessage('group_choose_friends_max'); + } + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($id); + require_once libfile('function/post'); + $post['message'] = threadmessagecutstr($thread, $post['message'], 150); + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $user) { + if($at) { + notification_add($uid, 'at', 'at_message', array('from_id' => $id, 'from_idtype' => 'at', 'buyerid' => $_G['uid'], 'buyer' => $_G['username'], 'tid' => $id, 'subject' => $thread['subject'], 'pid' => $post['pid'], 'message' => $post['message'])); + } else { + notification_add($uid, 'thread', 'thread_invite', array('subject' => $thread['subject'], 'invitename' => $invitename, 'tid' => $id, 'from_id' => $id, 'from_idtype' => 'invite_thread')); + } + } + showmessage(($at ? 'at_succeed' : 'group_invite_succeed'), "forum.php?mod=viewthread&tid=$id"); + } else { + showmessage(($at ? 'at_choose_member' : 'group_invite_choose_member'), "forum.php?mod=viewthread&tid=$id"); + } + } +} elseif($_GET['action'] == 'blog') { + $id = intval($_GET['id']); + $blog = C::t('home_blog')->fetch($id); + + if(!submitcheck('invitesubmit')) { + $inviteduids = ''; + } else { + $uids = $_GET['uids']; + if($uids) { + if(count($uids) > 20) { + showmessage('group_choose_friends_max'); + } + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $user) { + notification_add($uid, 'blog', 'blog_invite', array('subject' => $blog['subject'], 'uid' => $blog['uid'], 'blogid' => $id, 'from_id' => $id, 'from_idtype' => 'invite_blog')); + } + showmessage('group_invite_succeed', "home.php?mod=space&uid=".$blog['uid']."&do=blog&id=$id"); + } else { + showmessage('group_invite_choose_member', "home.php?mod=space&uid=".$blog['uid']."&do=blog&id=$id"); + } + } +} elseif($_GET['action'] == 'article') { + $id = intval($_GET['id']); + $article = C::t('portal_article_title')->fetch($id); + + if(!submitcheck('invitesubmit')) { + $inviteduids = ''; + } else { + require_once libfile('function/portal'); + $article_url = fetch_article_url($article); + $uids = $_GET['uids']; + if($uids) { + if(count($uids) > 20) { + showmessage('group_choose_friends_max'); + } + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $user) { + notification_add($uid, 'article', 'article_invite', array('subject' => $article['title'], 'url' => $article_url, 'from_id' => $id, 'from_idtype' => 'invite_article')); + } + showmessage('group_invite_succeed', $article_url); + } else { + showmessage('group_invite_choose_member', $article_url); + } + } +} + +include template('common/invite'); +?> \ No newline at end of file diff --git a/source/module/misc/misc_mobile.php b/source/module/misc/misc_mobile.php new file mode 100644 index 0000000..c71daa9 --- /dev/null +++ b/source/module/misc/misc_mobile.php @@ -0,0 +1,94 @@ +fetch_all_forum(1); + $threads = $posts = $todayposts = 0; + foreach($query as $forum) { + if($forum['type'] != 'group') { + $threads += $forum['threads']; + $posts += $forum['posts']; + $todayposts += $forum['todayposts']; + + if($forum['type'] == 'forum' && isset($catlist[$forum['fup']])) { + if(forum($forum)) { + $catlist[$forum['fup']]['forums'][] = $forum['fid']; + $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++; + $forum['subforums'] = ''; + $forumlist[$forum['fid']] = $forum; + } + + } elseif(isset($forumlist[$forum['fup']])) { + $forumlist[$forum['fup']]['threads'] += $forum['threads']; + $forumlist[$forum['fup']]['posts'] += $forum['posts']; + $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts']; + } + + } else { + $forum['forumscount'] = 0; + $catlist[$forum['fid']] = $forum; + } + } + $_GET['forumlist'] = 1; + define('IN_MOBILE',2); + define('IN_PREVIEW',1); + ob_start(); + include template('forum/discuz'); +} else { + if(getglobal('setting/domain/app/mobile')) { + $url = $_G['scheme'].'://'.$_G['setting']['domain']['app']['mobile']; + $file = 'newmobiledomain.png'; + } else { + $url = $_G['siteurl']; + $file = 'newmobile.png'; + } + $qrimg = DISCUZ_ROOT.'./data/cache/'.$file; + if(!file_exists($qrimg)) { + require_once DISCUZ_ROOT.'source/plugin/mobile/qrcode.class.php'; + QRcode::png($url, $qrimg, QR_ECLEVEL_Q, 4); + } + include template('touch/common/preview'); +} +function output_preview() { + $content = ob_get_contents(); + ob_end_clean(); + ob_start(); + $content = preg_replace_callback("/(\]+href=\").*?(\"[^\>]*\>)/", 'output_preview_callback_replace_href_21', $content); + $content = preg_replace("/\/", '', $content); + $content = str_replace('' , '', $content); + echo $content; + exit; +} + +function output_preview_callback_replace_href_21($matches) { + return $matches[1].'misc.php?mod=mobile&view=true'.$matches[2];; +} + +?> \ No newline at end of file diff --git a/source/module/misc/misc_patch.php b/source/module/misc/misc_patch.php new file mode 100644 index 0000000..165bcd2 --- /dev/null +++ b/source/module/misc/misc_patch.php @@ -0,0 +1,72 @@ +fetch_all_data(); + $addonids = $vers = array(); + foreach($pluginarray as $row) { + if(ispluginkey($row['identifier'])) { + $addonids[] = $row['identifier'].'.plugin'; + $vers[$row['identifier'].'.plugin'] = $row['version']; + } + } + $checkresult = dunserialize(cloudaddons_upgradecheck($addonids)); + savecache('addoncheck_plugin', $checkresult); + $newversion = 0; + if(is_array($checkresult)) { + foreach($checkresult as $addonid => $value) { + list(, $newver, $sysver) = explode(':', $value); + if($sysver && $sysver > $vers[$addonid] || $newver) { + $newversion++; + } + } + } + include template('common/header_ajax'); + if($newversion) { + $lang = lang('forum/misc'); + echo '
          '.$lang['patch_close'].''; + echo '

          '.$lang['plugin_title'].'

          '; + echo '
          '.lang('forum/misc', 'plugin_memo', array('number' => $newversion)).'
          '; + echo ''; + echo '
          '; + } + include template('common/footer_ajax'); + exit; +} elseif($_GET['action'] == 'ipnotice') { + require_once libfile('function/misc'); + include template('common/header_ajax'); + if($_G['cookie']['lip'] && $_G['cookie']['lip'] != ',' && $_G['uid'] && getglobal('setting/disableipnotice') != 1) { + $status = C::t('common_member_status')->fetch($_G['uid']); + $lip = explode(',', $_G['cookie']['lip']); + $lastipConvert = convertip($lip[0]); + $lastipDate = dgmdate($lip[1]); + $nowipConvert = convertip($status['lastip']); + + $lastipConvert = process_ipnotice($lastipConvert); + $nowipConvert = process_ipnotice($nowipConvert); + + if($lastipConvert != $nowipConvert && stripos($lastipConvert, $nowipConvert) === false && stripos($nowipConvert, $lastipConvert) === false) { + $lang = lang('forum/misc'); + include template('common/ipnotice'); + } + } + include template('common/footer_ajax'); + exit; +} + + + +?> \ No newline at end of file diff --git a/source/module/misc/misc_ranklist.php b/source/module/misc/misc_ranklist.php new file mode 100644 index 0000000..cdf0810 --- /dev/null +++ b/source/module/misc/misc_ranklist.php @@ -0,0 +1,486 @@ + 'ranklist', 'thread' => 'forum', 'blog' => 'blog', 'poll' => 'forum', 'picture' => 'album', 'activity' => 'forum', 'forum' => 'forum', 'group' => 'group'); + +if($type != 'index') { + if(!array_key_exists($type, $allowtype) || !$_G['setting'][$allowtype[$type].'status'] || !$ranklist_setting[$type]['available']) { + showmessage('ranklist_this_status_off'); + } +} + +include libfile('misc/ranklist_'.$type, 'include'); +function getranklist_thread($num = 20, $view = 'replies', $orderby = 'all') { + global $_G; + $dateline = ''; + $timestamp = 0; + if($orderby == 'today') { + $timestamp = TIMESTAMP - 86400; + } elseif($orderby == 'thisweek') { + $timestamp = TIMESTAMP - 604800; + } elseif($orderby == 'thismonth') { + $timestamp = TIMESTAMP - 2592000; + } + $data = array(); + $rank = 0; + $notfid = $_G['setting']['ranklist']['ignorefid'] ? explode(',', $_G['setting']['ranklist']['ignorefid']) : array(); + foreach(C::t('forum_thread')->fetch_all_rank_thread($timestamp, $notfid, $view, $num) as $thread) { + ++$rank; + $thread['rank'] = $rank; + $thread['dateline'] = dgmdate($thread['dateline']); + $data[] = $thread; + } + return $data; +} + +function getranklist_poll($num = 20, $view = 'heats', $orderby = 'all') { + global $_G; + $dateline = ''; + $timestamp = 0; + if($orderby == 'today') { + $timestamp = TIMESTAMP - 86400; + } elseif($orderby == 'thisweek') { + $timestamp = TIMESTAMP - 604800; + } elseif($orderby == 'thismonth') { + $timestamp = TIMESTAMP - 2592000; + } + $data = array(); + require_once libfile('function/forum'); + $rank = 0; + $notfid = $_G['setting']['ranklist']['ignorefid'] ? explode(',', $_G['setting']['ranklist']['ignorefid']) : array(); + foreach(C::t('forum_thread')->fetch_all_rank_poll($timestamp, $notfid, $view, $num) as $poll) { + ++$rank; + $poll['rank'] = $rank; + $poll['avatar'] = avatar($poll['authorid'], 'small'); + $poll['dateline'] = dgmdate($poll['dateline']); + $poll['pollpreview'] = explode("\t", trim($poll['pollpreview'])); + $data[] = $poll; + } + return $data; +} + +function getranklist_activity($num = 20, $view = 'heats', $orderby = 'all') { + global $_G; + $dateline = ''; + $timestamp = 0; + if($orderby == 'today') { + $timestamp = TIMESTAMP - 86400; + } elseif($orderby == 'thisweek') { + $timestamp = TIMESTAMP - 604800; + } elseif($orderby == 'thismonth') { + $timestamp = TIMESTAMP - 2592000; + } + $data = array(); + $rank = 0;$attachtables = array(); + $notfid = $_G['setting']['ranklist']['ignorefid'] ? explode(',', $_G['setting']['ranklist']['ignorefid']) : array(); + foreach(C::t('forum_thread')->fetch_all_rank_activity($timestamp, $notfid, $view, $num) as $thread) { + ++$rank; + $thread['rank'] = $rank; + $thread['starttimefrom'] = dgmdate($thread['starttimefrom']); + if($thread['starttimeto']) { + $thread['starttimeto'] = dgmdate($thread['starttimeto']); + } else { + $thread['starttimeto'] = ''; + } + if($thread['expiration'] && TIMESTAMP > $thread['expiration']) { + $thread['has_expiration'] = true; + } else { + $thread['has_expiration'] = false; + } + $data[$thread['tid']] = $thread; + $attachtables[getattachtableid($thread['tid'])][] = $thread['aid']; + } + foreach($attachtables as $attachtable => $aids) { + $attachs = C::t('forum_attachment_n')->fetch_all_attachment($attachtable, $aids); + foreach($attachs as $attach) { + $attach['attachurl'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$attach['attachment']; + $data[$attach['tid']] = array_merge($data[$attach['tid']], $attach); + } + } + return $data; +} + +function getranklist_picture($num = 20, $view = 'hot', $orderby = 'all') { + + if($orderby == 'thisweek') { + $timestamp = TIMESTAMP - 604800; + $dateline = 'p.'.DB::field('dateline', $timestamp, '>='); + } elseif($orderby == 'thismonth') { + $timestamp = TIMESTAMP - 2592000; + $dateline = 'p.'.DB::field('dateline', $timestamp, '>='); + } elseif($orderby == 'today') { + $timestamp = TIMESTAMP - 86400; + $dateline = 'p.'.DB::field('dateline', $timestamp, '>='); + } + + $data = array(); + $query = C::t('home_pic')->fetch_all_by_sql($dateline, 'p.'.DB::order($view, 'DESC'), 0, $num); + + require_once libfile('function/home'); + $rank = 0; + foreach($query as $value) { + ++$rank; + $picture = array('picid' => $value['picid'], 'uid' => $value['uid'], 'username' => $value['username'], 'title' => $value['title'], 'filepath' => $value['filepath'], 'thumb' => $value['thumb'], 'remote' => $value['remote'], 'hot' => $value['hot'], 'sharetimes' => $value['sharetimes'], 'click1' => $value['click1'], 'click2' => $value['click2'], 'click3' => $value['click3'], 'click4' => $value['click4'], 'click5' => $value['click5'], 'click6' => $value['click6'], 'click7' => $value['click7'], 'click8' => $value['click8'], 'albumid' => $value['albumid'], 'albumname' => $value['albumname'], 'friend' => $value['friend']); + $picture['rank'] = $rank; + $picture['url'] = $picture['friend'] == 0 ? pic_get($picture['filepath'], 'album', $picture['thumb'], $picture['remote']) : STATICURL.'image/common/nopublish.svg';; + $picture['origurl'] = pic_get($picture['filepath'], 'album', 0, $picture['remote']); + $data[] = $picture; + } + return $data; +} + +function getranklist_pictures_index($num = 20, $dateline = 0, $orderby = 'hot DESC') { + $picturelist = array(); + $query = C::t('home_pic')->fetch_all_by_sql('p.hot>3', 'p.dateline DESC', 0, $num); + require_once libfile('function/home'); + foreach($query as $value) { + $picture = array('picid' => $value['picid'], 'uid' => $value['uid'], 'username' => $value['username'], 'title' => $value['title'], 'filepath' => $value['filepath'], 'thumb' => $value['thumb'], 'remote' => $value['remote'], 'albumid' => $value['albumid'], 'albumname' => $value['albumname'], 'friend' => $value['friend']); + $picture['url'] = $picture['friend'] == 0 ? pic_get($picture['filepath'], 'album', $picture['thumb'], $picture['remote']) : STATICURL.'image/common/nopublish.svg';; + $picture['origurl'] = $picture['friend'] == 0 ? pic_get($picture['filepath'], 'album', 0, $picture['remote']) : STATICURL.'image/common/nopublish.svg'; + $picturelist[] = $picture; + } + return $picturelist; +} + +function getranklist_members($offset = 0, $limit = 20) { + require_once libfile('function/forum'); + $members = array(); + $topusers = C::t('home_show')->fetch_all_by_unitprice($offset, $limit, true); + foreach($topusers as $member) { + $member['avatar'] = avatar($member['uid'], 'small'); + $member['note'] = htmlspecialchars(dhtmlspecialchars($member['note'])); + $members[] = $member; + } + return $members; +} + +function getranklist_girls($offset = 0, $limit = 20, $orderby = 'ORDER BY s.unitprice DESC, s.credit DESC') { + return C::t('common_member')->fetch_all_girls_for_ranklist($offset, $limit, $orderby); +} + +function getranklist_blog($num = 20, $view = 'hot', $orderby = 'all') { + $dateline = $timestamp = ''; + if($orderby == 'today') { + $timestamp = TIMESTAMP - 86400; + } elseif($orderby == 'thisweek') { + $timestamp = TIMESTAMP - 604800; + } elseif($orderby == 'thismonth') { + $timestamp = TIMESTAMP - 2592000; + } + + $data = array(); + $data_blog = C::t('home_blog')->range_blog(0, $num, 'DESC', $view, 0, 0, null, $timestamp); + $blogids = array_keys($data_blog); + $data_blogfield = C::t('home_blogfield')->fetch_all($blogids); + + require_once libfile('function/forum'); + require_once libfile('function/post'); + $rank = 0; + foreach($data_blog as $curblogid => $blog) { + $blog = array_merge($blog, (array)$data_blogfield[$curblogid]); + ++$rank; + $blog['rank'] = $rank; + $blog['dateline'] = dgmdate($blog['dateline']); + $blog['avatar'] = avatar($blog['uid'], 'small'); + $blog['message'] = preg_replace('/<([^>]*?)>/', '', $blog['message']); + $blog['message'] = messagecutstr($blog['message'], 140); + $data[] = $blog; + } + return $data; +} + +function getranklist_forum($num = 20, $view = 'threads') { + global $_G; + + $data = array(); + $timelimit = 0; + if($view == 'posts') { + $key = 'posts'; + } elseif($view == 'today') { + $key = 'todayposts'; + } else { + $key = 'threads'; + } + $query = C::t('forum_forum')->fetch_all_for_ranklist(1, 0, $key, 0, $num, explode(',', $_G['setting']['ranklist']['ignorefid'])); + $i = 1; + foreach($query as $row) { + $result = array('fid' => $row['fid'], 'name' => $row['name']); + $result['posts'] = $row[$key]; + $result['rank'] = $i; + $data[] = $result; + $i++; + } + + return $data; + +} + +function getranklist_group($num = 20, $view = 'threads') { + global $_G; + + $timestamp = TIMESTAMP; + $data = array(); + $timelimit = 0; + + if($view == 'posts') { + $key = 'posts'; + } elseif($view == 'today'){ + $key = 'todayposts'; + } elseif($view == 'credit'){ + $key = 'commoncredits'; + } elseif($view == 'member'){ + $key = 'membernum'; + } else { + $key = 'threads'; + } + $query = C::t('forum_forum')->fetch_all_for_ranklist(3, 'sub', $key, 0, $num, explode(',', $_G['setting']['ranklist']['ignorefid'])); + $i = 1; + foreach($query as $row) { + $result = array('fid' => $row['fid'], 'name' => $row['name']); + $result[$key] = $result['posts'] = $row[$key]; + $result['rank'] = $i; + $data[] = $result; + $i++; + } + + return $data; + +} + +function getranklist_member($num = 20, $view = 'credit', $orderby = 'all') { + $data = array(); + $functionname = 'getranklist_member_'.$view; + $data = $functionname($num, $orderby); + return $data; +} + +function getranklist_member_credit($num, $orderby) { + return C::t('common_member')->fetch_all_order_by_credit_for_ranklist($num, $orderby); +} + +function getranklist_member_friendnum($num) { + return C::t('common_member')->fetch_all_order_by_friendnum_for_ranklist($num); + +} + +function getranklist_member_invite($num, $orderby) { + global $_G; + + if($orderby == 'thisweek') { + $dateline = TIMESTAMP - 604800; + } elseif($orderby == 'thismonth') { + $dateline = TIMESTAMP - 2592000; + } elseif($orderby == 'today') { + $dateline = TIMESTAMP - 86400; + } + + $invite = $invitearray = $inviteuidarray = $invitefieldarray = array(); + foreach(C::t('common_invite')->fetch_all_invitenum_group_by_uid($dateline) as $result) { + $invitearray[] = $result; + $inviteuidarray[] = $result['uid']; + } + + $invitememberfield = C::t('common_member')->fetch_all($inviteuidarray, false, 0); + if($invitearray) { + foreach($invitearray as $key => $var) { + $invite[] = $var; + $invite[$key]['username'] = $invitememberfield[$var['uid']]['username']; + $invite[$key]['groupid'] = $invitememberfield[$var['uid']]['groupid']; + } + } + return $invite; + +} + +function getranklist_member_onlinetime($num, $orderby) { + global $_G; + + if($orderby == 'thismonth') { + $orderby = 'thismonth'; + $online = 'thismonth AS onlinetime'; + } elseif($orderby == 'all') { + $orderby = 'total'; + $online = 'total AS onlinetime'; + } + + $onlinetime = $onlinetimearray = $onlinetimeuidarray = $onlinetimefieldarray = array(); + + $onlinetimearray = C::t('common_onlinetime')->range_by_field(0, $num, $orderby, 'DESC'); + $onlinetimeuidarray = array_keys($onlinetimearray); + $onlinetimefieldarray = C::t('common_member')->fetch_all($onlinetimeuidarray, false, 0); + if($onlinetimearray) { + foreach($onlinetimearray as $key => $var) { + $var['onlinetime'] = $var[$orderby]; + $var['username'] = $onlinetimefieldarray[$var['uid']]['username']; + $var['groupid'] = $onlinetimefieldarray[$var['uid']]['groupid']; + $onlinetime[$key] = $var; + } + } + return $onlinetime; + +} + +function getranklist_member_blog($num) { + global $_G; + + $blogs = array(); + $sql = "SELECT m.uid,m.username,m.groupid,c.blogs FROM ".DB::table('common_member'). + " m LEFT JOIN ".DB::table('common_member_count')." c ON m.uid=c.uid WHERE c.blogs>0 ORDER BY blogs DESC LIMIT 0, $num"; + + $query = DB::query($sql); + while($result = DB::fetch($query)) { + $blogs[] = $result; + } + + return $blogs; + +} + + +function getranklist_member_gender($gender, $num = 20) { + global $_G; + + $num = intval($num); + $num = $num ? $num : 20; + $users = array(); + $query = DB::query("SELECT c.uid, c.views FROM ".DB::table('common_member_count')." c + LEFT JOIN ".DB::table('common_member_profile')." p ON c.uid=p.uid + WHERE c.views>0 AND p.gender = '$gender' ORDER BY c.views DESC LIMIT 0, $num"); + while($user = DB::fetch($query)) { + $users[$user['uid']] = $user; + } + $uids = array_keys($users); + if($uids) { + foreach(C::t('common_member')->fetch_all($uids, false, 0) as $uid => $value) { + $users[$uid] = array_merge($users[$uid], $value); + } + } + return $users; + +} + +function getranklist_member_beauty($num = 20) { + return getranklist_member_gender(2, $num); +} + +function getranklist_member_handsome($num = 20) { + return getranklist_member_gender(1, $num); +} + +function getranklist_member_post($num, $orderby) { + global $_G; + + $timestamp = TIMESTAMP; + $posts = array(); + $timelimit = 0; + if($orderby == 'digestposts') { + $sql = "SELECT m.username, m.uid, mc.digestposts AS posts + FROM ".DB::table('common_member')." m + LEFT JOIN ".DB::table('common_member_count')." mc ON mc.uid=m.uid WHERE mc.digestposts>0 + ORDER BY mc.digestposts DESC LIMIT 0, $num"; + } elseif($orderby == 'thismonth') { + $timelimit = $timestamp-86400*30; + } elseif($orderby == 'today') { + $timelimit = $timestamp-86400; + } else { + $sql = "SELECT m.username, m.uid, mc.posts + FROM ".DB::table('common_member')." m + LEFT JOIN ".DB::table('common_member_count')." mc ON mc.uid=m.uid WHERE mc.posts>0 + ORDER BY mc.posts DESC LIMIT 0, $num"; + } + if($timelimit) { + $posts = C::t('forum_post')->fetch_all_top_post_author(0, $timelimit, $num); + + } else { + $query = DB::query($sql); + while($result = DB::fetch($query)) { + $posts[] = $result; + } + } + + return $posts; + +} + +function getranklistdata($type, $view = '', $orderby = 'all') { + if (!function_exists('getranklist_'.$type)) { + return array(); + } + global $_G; + $cache_time = $_G['setting']['ranklist'][$type]['cache_time']; + $cache_num = $_G['setting']['ranklist'][$type]['show_num']; + if($cache_time <= 0 ) { + $cache_time = 5; + } + $cache_time = $cache_time * 3600; + if($cache_num <= 0 ) { + $cache_num = 20; + } + + $ranklistvars = array(); + loadcache('ranklist_'.$type); + if(!isset($_G['cache']['ranklist_'.$type]) || !is_array($_G['cache']['ranklist_'.$type])) { + $_G['cache']['ranklist_'.$type] = array(); + } + if(!isset($_G['cache']['ranklist_'.$type][$view]) || !is_array($_G['cache']['ranklist_'.$type][$view])) { + $_G['cache']['ranklist_'.$type][$view] = array(); + } + if(!isset($_G['cache']['ranklist_'.$type][$view][$orderby]) || !is_array($_G['cache']['ranklist_'.$type][$view][$orderby])) { + $_G['cache']['ranklist_'.$type][$view][$orderby] = array(); + } + $ranklistvars = & $_G['cache']['ranklist_'.$type][$view][$orderby]; + + if(empty($ranklistvars['lastupdated']) || (TIMESTAMP - $ranklistvars['lastupdated'] > $cache_time)) { + $functionname = 'getranklist_'.$type; + + if(!discuz_process::islocked('ranklist_update', 600)) { + $ranklistvars = $functionname($cache_num, $view, $orderby); + $ranklistvars['lastupdated'] = TIMESTAMP; + $ranklistvars['lastupdate'] = dgmdate(TIMESTAMP); + $ranklistvars['nextupdate'] = dgmdate(TIMESTAMP + $cache_time); + $_G['cache']['ranklist_'.$type][$view][$orderby] = $ranklistvars; + savecache('ranklist_'.$type, $_G['cache']['ranklist_'.$type]); + } + discuz_process::unlock('ranklist_update'); + } + $_G['lastupdate'] = $ranklistvars['lastupdate']; + $_G['nextupdate'] = $ranklistvars['nextupdate']; + unset($ranklistvars['lastupdated'], $ranklistvars['lastupdate'], $ranklistvars['nextupdate']); + return $ranklistvars; +} + +function getignorefid($pre = '') { + global $_G; + $fidsql = ''; + if($_G['setting']['ranklist']['ignorefid']) { + $fidsql = ' AND '.($pre ? $pre.'.' : '').'fid NOT IN('.dimplode(explode(',', $_G['setting']['ranklist']['ignorefid'])).')'; + } + return $fidsql; +} +?> \ No newline at end of file diff --git a/source/module/misc/misc_report.php b/source/module/misc/misc_report.php new file mode 100644 index 0000000..d92444b --- /dev/null +++ b/source/module/misc/misc_report.php @@ -0,0 +1,75 @@ + 1)); +} +$rtype = $_GET['rtype']; +$rid = intval($_GET['rid']); +$tid = intval($_GET['tid']); +$fid = intval($_GET['fid']); +$uid = intval($_GET['uid']); +$default_url = array( + 'user' => 'home.php?mod=space&uid=', + 'post' => 'forum.php?mod=redirect&goto=findpost&ptid='.$tid.'&pid=', + 'thread' => 'forum.php?mod=viewthread&tid=', + 'group' => 'forum.php?mod=group&fid=', + 'album' => 'home.php?mod=space&do=album&uid='.$uid.'&id=', + 'blog' => 'home.php?mod=space&do=blog&uid='.$uid.'&id=', + 'pic' => 'home.php?mod=space&do=album&uid='.$uid.'&picid=' +); +$url = ''; +if($rid && !empty($default_url[$rtype])) { + $url = $default_url[$rtype].intval($rid); +} else { + $url = addslashes(dhtmlspecialchars(base64_decode($_GET['url']))); + $url = preg_match("/^http[s]?:\/\/[^\[\"']+$/i", trim($url)) ? trim($url) : ''; +} +if(empty($url) || empty($_G['inajax'])) { + showmessage('report_parameters_invalid'); +} +$urlkey = md5($url); +if(submitcheck('reportsubmit')) { + $message = censor(cutstr(dhtmlspecialchars(trim($_GET['message'])), 200, '')); + $message = $_G['username'].' : '.rtrim($message, "\\"); + if($reportid = C::t('common_report')->fetch_by_urlkey($urlkey)) { + C::t('common_report')->update_num($reportid, $message); + } else { + $data = array('url' => $url, 'urlkey' => $urlkey, 'uid' => $_G['uid'], 'username' => $_G['username'], 'message' => $message, 'dateline' => TIMESTAMP); + if($fid) { + $data['fid'] = $fid; + } + C::t('common_report')->insert($data); + $report_receive = dunserialize($_G['setting']['report_receive']); + $moderators = array(); + if($report_receive['adminuser']) { + foreach($report_receive['adminuser'] as $touid) { + notification_add($touid, 'report', 'new_report', array('from_id' => 1, 'from_idtype' => 'newreport', 'username' => $_G['username']), 1); + } + } + if($fid && $rtype == 'post') { + foreach(C::t('forum_moderator')->fetch_all_by_fid($fid, false) as $row) { + $moderators[] = $row['uid']; + } + if($report_receive['supmoderator']) { + $moderators = array_unique(array_merge($moderators, $report_receive['supmoderator'])); + } + foreach($moderators as $touid) { + $touid != $_G['uid'] && !in_array($touid, $report_receive['adminuser']) && notification_add($touid, 'report', 'new_post_report', array('fid' => $fid, 'from_id' => 1, 'from_idtype' => 'newreport', 'username' => $_G['username']), 1); + } + } + } + showmessage('report_succeed', '', array(), array('closetime' => true, 'showdialog' => 1, 'alert' => 'right')); +} +require_once libfile('function/misc'); +include template('common/report'); +?> \ No newline at end of file diff --git a/source/module/misc/misc_seccode.php b/source/module/misc/misc_seccode.php new file mode 100644 index 0000000..1ba5493 --- /dev/null +++ b/source/module/misc/misc_seccode.php @@ -0,0 +1,214 @@ +'; + } elseif($_G['setting']['seccodedata']['type'] == 3) { + $htmlcode = "(function(){var a=document.createElement('audio');a.src='{$_G['siteurl']}misc.php?mod=seccode&update=$rand&idhash=$idhash&fromFlash=1',a.style.display='none',$('seccodeplay_$idhash').onclick=function(){a.play()},$('seccodeswf_$idhash').appendChild(a)})();"; + $message = ''.lang('core', 'seccode_sound_tips').''.lang('forum/misc', 'seccode_player', array('idhash' => $idhash)); + } else { + if(!is_numeric($_G['setting']['seccodedata']['type']) && preg_match('/^[\w\d:_]+$/i', $_G['setting']['seccodedata']['type'])) { + $etype = explode(':', $_G['setting']['seccodedata']['type']); + if(count($etype) > 1) { + $codefile = DISCUZ_ROOT.'./source/plugin/'.$etype[0].'/seccode/seccode_'.$etype[1].'.php'; + $class = $etype[1]; + } else { + $codefile = libfile('seccode/'.$_G['setting']['seccodedata']['type'], 'class'); + $class = $_G['setting']['seccodedata']['type']; + } + if(file_exists($codefile)) { + @include_once $codefile; + $class = 'seccode_'.$class; + if(class_exists($class)) { + $code = new $class(); + if(method_exists($code, 'make')) { + ob_start(); + $seccode = $code->make($idhash, $modid); + make_seccode($seccode); + $message = preg_replace("/\r|\n/", '', ob_get_contents()); + ob_end_clean(); + } + } + } + } else { + $message = lang('core', 'seccode_image'.$ani.'_tips').''; + } + } + $imemode = $_G['setting']['seccodedata']['type'] != 1 ? 'ime-mode:disabled;' : ''; + $message = str_replace("'", "\'", $message); + $seclang = lang('forum/misc'); + header("Content-Type: application/javascript"); +echo <</g, 'code$idhash') : ''; + var sectplcode = sectpl != '' ? sectpl.split('') : Array('
          ',': ','
          ',''); + var string = '' + sectplcode[0] + '{$seclang['seccode']}' + sectplcode[1] + '' + + ' {$seclang['seccode_update']}' + + '' + + sectplcode[2] + '$message' + sectplcode[3]; + evalscript(string); + $('$showid').innerHTML = string; + } else { + var string = '$message'; + evalscript(string); + $('v$showid').innerHTML = string; + } + $htmlcode +} +EOF; + +} elseif(getgpc('action') == 'update' && defined("IN_MOBILE") && constant("IN_MOBILE") == 2) { + $message = ''; + $showid = 'seccode_'.$idhash; + $rand = random(5, 1); + $htmlcode = ''; + $ani = $_G['setting']['seccodedata']['animator'] ? '_ani' : ''; + if($_G['setting']['seccodedata']['type'] == 2 || $_G['setting']['seccodedata']['type'] == 3) { + $message = ''; + } else { + if(!is_numeric($_G['setting']['seccodedata']['type']) && preg_match('/^[\w\d:_]+$/i', $_G['setting']['seccodedata']['type'])) { + $etype = explode(':', $_G['setting']['seccodedata']['type']); + if(count($etype) > 1) { + $codefile = DISCUZ_ROOT.'./source/plugin/'.$etype[0].'/seccode/seccode_'.$etype[1].'.php'; + $class = $etype[1]; + } else { + $codefile = libfile('seccode/'.$_G['setting']['seccodedata']['type'], 'class'); + $class = $_G['setting']['seccodedata']['type']; + } + if(file_exists($codefile)) { + @include_once $codefile; + $class = 'seccode_'.$class; + if(class_exists($class)) { + $code = new $class(); + if(method_exists($code, 'make')) { + ob_start(); + $seccode = $code->make($idhash, $modid); + make_seccode($seccode); + $message = preg_replace("/\r|\n/", '', ob_get_contents()); + ob_end_clean(); + } + } + } + } else { + $message = ''; + } + } + $imemode = $_G['setting']['seccodedata']['type'] != 1 ? 'ime-mode:disabled;' : ''; + $message = str_replace("'", "\'", $message); + $seclang = lang('forum/misc'); + header("Content-Type: application/javascript"); +echo <</g, 'code$idhash') : ''; + var sectplcode = sectpl != '' ? sectpl.split('') : Array('
          ',': ','
          ',''); + var string = '$message'; + evalscript(string); + document.getElementById('$showid').innerHTML = string; + } else { + var string = '$message'; + evalscript(string); + document.getElementById('v$showid').innerHTML = string; + } + $htmlcode +} +EOF; + +} elseif(getgpc('action') == 'check') { + + include template('common/header_ajax'); + echo helper_seccheck::check_seccode($_GET['secverify'], $_GET['idhash'], 1, $modid, true) ? 'succeed' : 'invalid'; + include template('common/footer_ajax'); + +} else { + + $refererhost = parse_url(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''); + $refererhost['host'] = (isset($refererhost['host']) ? $refererhost['host'] : '').(!empty($refererhost['port']) ? (':'.$refererhost['port']) : ''); + + if(($_G['setting']['seccodedata']['type'] < 2 && ($refererhost['host'] != $_SERVER['HTTP_HOST'])) || ((defined("IN_MOBILE") && in_array($_G['setting']['seccodedata']['type'], array(2, 3)) && ($refererhost['host'] != $_SERVER['HTTP_HOST'])) && ($_G['setting']['seccodedata']['type'] == 2 && !extension_loaded('ming') && $_POST['fromFlash'] != 1 || $_G['setting']['seccodedata']['type'] == 3 && $_GET['fromFlash'] != 1))) { + exit('Access Denied'); + } + + if(is_numeric($_G['setting']['seccodedata']['type']) || !preg_match('/^[\w\d:_]+$/i', $_G['setting']['seccodedata']['type'])) { + + $seccode = make_seccode(); + + if(!$_G['setting']['nocacheheaders']) { + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + } + + require_once libfile('class/seccode'); + + $code = new seccode(); + $code->code = $seccode; + $code->type = (in_array($_G['setting']['seccodedata']['type'], array(2, 3)) && defined("IN_MOBILE")) ? 0 : $_G['setting']['seccodedata']['type']; + $code->width = $_G['setting']['seccodedata']['width']; + $code->height = $_G['setting']['seccodedata']['height']; + $code->background = $_G['setting']['seccodedata']['background']; + $code->adulterate = $_G['setting']['seccodedata']['adulterate']; + $code->ttf = $_G['setting']['seccodedata']['ttf']; + $code->angle = $_G['setting']['seccodedata']['angle']; + $code->warping = $_G['setting']['seccodedata']['warping']; + $code->scatter = $_G['setting']['seccodedata']['scatter']; + $code->color = $_G['setting']['seccodedata']['color']; + $code->size = $_G['setting']['seccodedata']['size']; + $code->shadow = $_G['setting']['seccodedata']['shadow']; + $code->animator = $_G['setting']['seccodedata']['animator']; + $code->fontpath = DISCUZ_ROOT.'./static/image/seccode/font/'; + $code->datapath = DISCUZ_ROOT.'./static/image/seccode/'; + $code->includepath = DISCUZ_ROOT.'./source/class/'; + + $code->display(); + + } else { + $etype = explode(':', $_G['setting']['seccodedata']['type']); + if(count($etype) > 1) { + $codefile = DISCUZ_ROOT.'./source/plugin/'.$etype[0].'/seccode/seccode_'.$etype[1].'.php'; + $class = $etype[1]; + } else { + $codefile = libfile('seccode/'.$_G['setting']['seccodedata']['type'], 'class'); + $class = $_G['setting']['seccodedata']['type']; + } + if(file_exists($codefile)) { + @include_once $codefile; + $class = 'seccode_'.$class; + if(class_exists($class)) { + make_seccode(); + $code = new $class(); + $image = $code->image($idhash, $modid); + if($image) { + dheader('location: '.$image); + } + } + } + } + +} + +?> \ No newline at end of file diff --git a/source/module/misc/misc_secmobseccode.php b/source/module/misc/misc_secmobseccode.php new file mode 100644 index 0000000..bb69075 --- /dev/null +++ b/source/module/misc/misc_secmobseccode.php @@ -0,0 +1,54 @@ += 0) { + showmessage('secmobseccode_send_success', '', array(), array('alert' => 'right')); + } else { + if($result <= -1 && $result >= -9) { + showmessage('secmobseccode_send_err_'.abs($result)); + } else { + showmessage('secmobseccode_send_failure'); + } + } + } else { + $handlekey = 'sendsecmobseccode'; + include template('common/secmobseccode'); + } + +} \ No newline at end of file diff --git a/source/module/misc/misc_secqaa.php b/source/module/misc/misc_secqaa.php new file mode 100644 index 0000000..9f867e7 --- /dev/null +++ b/source/module/misc/misc_secqaa.php @@ -0,0 +1,93 @@ +/g, 'code$idhash') : ''; + var sectplcode = sectpl != '' ? sectpl.split('') : Array('
          ',': ','
          ',''); + var string = '' + sectplcode[0] + '{$seclang['secqaa']}' + sectplcode[1] + '' + + ' {$seclang['seccode_update']}' + + '' + + sectplcode[2] + '$message' + sectplcode[3]; + evalscript(string); + $('$showid').innerHTML = string; +} +EOF; + +} elseif(getgpc('action') == 'update' && defined("IN_MOBILE") && constant("IN_MOBILE") == 2) { + $refererhost = parse_url($_SERVER['HTTP_REFERER']); + $refererhost['host'] .= !empty($refererhost['port']) ? (':'.$refererhost['port']) : ''; + + if($refererhost['host'] != $_SERVER['HTTP_HOST']) { + exit('Access Denied'); + } + + $message = ''; + $showid = 'secqaa_'.$idhash; + if($_G['setting']['secqaa']) { + $question = make_secqaa(); + } + + $message = preg_replace("/\r|\n/", '', $question); + $message = str_replace("'", "\'", $message); + $seclang = lang('forum/misc'); + header("Content-Type: application/javascript"); +echo <</g, 'code$idhash') : ''; + var sectplcode = sectpl != '' ? sectpl.split('') : Array('
          ',': ','',''); + var string = '' + '$message' + + '' + + ''; + evalscript(string); + document.getElementById('$showid').innerHTML = string; + } else { + var string = '' + '$message' + + ''; + evalscript(string); + document.getElementById('v$showid').innerHTML = string; + } +} +EOF; + +} elseif($_GET['action'] == 'check') { + + include template('common/header_ajax'); + echo helper_seccheck::check_secqaa($_GET['secverify'], $idhash, true) ? 'succeed' : 'invalid'; + include template('common/footer_ajax'); + +} + +?> \ No newline at end of file diff --git a/source/module/misc/misc_stat.php b/source/module/misc/misc_stat.php new file mode 100644 index 0000000..49a0a25 --- /dev/null +++ b/source/module/misc/misc_stat.php @@ -0,0 +1,554 @@ + $_G['group']['grouptitle']), array('login' => 1)); +} + +$navtitle = lang('core', 'title_stats_'.$op).' - '.lang('core', 'title_stats'); + +loadcache('statvars'); + +if($op == 'basic') { + $statvars = getstatvars('basic'); + extract($statvars); + include template('forum/stat_main'); +} elseif($op == 'trade') { + $statvars = getstatvars('trade'); + extract($statvars); + include template('forum/stat_trade'); +} elseif($op == 'team') { + $statvars = getstatvars('team'); + extract($statvars); + include template('forum/stat_team'); +} elseif($op == 'modworks' && $_G['setting']['modworkstatus']) { + $statvars = getstatvars('modworks'); + extract($statvars); + if($_GET['exportexcel']) { + $filename = 'stat_modworks_'.($username ? $username.'_' : '').$starttime.'_'.$endtime.'.csv'; + $filenameencode = strtolower(CHARSET) == 'utf-8' ? rawurlencode($filename) : rawurlencode(diconv($filename, CHARSET, 'UTF-8')); + $rfc6266blacklist = strexists($_SERVER['HTTP_USER_AGENT'], 'UCBrowser') || strexists($_SERVER['HTTP_USER_AGENT'], 'Quark') || strexists($_SERVER['HTTP_USER_AGENT'], 'SogouM') || strexists($_SERVER['HTTP_USER_AGENT'], 'baidu'); + include template('forum/stat_misc_export'); + $csvstr = ob_get_contents(); + ob_end_clean(); + header('Content-Encoding: none'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename="'.$filenameencode.'"'.(($filename == $filenameencode || $rfc6266blacklist) ? '' : '; filename*=utf-8\'\''.$filenameencode)); + header('Pragma: no-cache'); + header('Expires: 0'); + if($_G['charset'] != 'gbk') { + $csvstr = diconv($csvstr, $_G['charset'], 'GBK'); + } + echo $csvstr; + exit; + } else { + include template('forum/stat_misc'); + } +} elseif($op == 'memberlist' && $_G['setting']['memliststatus']) { + $statvars = getstatvars('memberlist'); + extract($statvars); + include template('forum/stat_memberlist'); +} elseif($op == 'forumstat') { + $statvars = getstatvars('forumstat'); + extract($statvars); + include template('forum/stat_misc'); +} elseif($op == 'trend') { + include libfile('misc/stat', 'include'); +} else { + showmessage('undefined_action'); +} + +function getstatvars($type) { + global $_G; + $statvars = & $_G['cache']['statvars'][$type]; + + if(!empty($statvars['lastupdated']) && TIMESTAMP - $statvars['lastupdated'] < CACHE_TIME) { + return $statvars; + } + + switch($type) { + case 'basic': + case 'trade': + case 'onlinetime': + case 'team': + case 'modworks': + case 'memberlist': + case 'forumstat': + $statvars = call_user_func('getstatvars_'.$type, ($type == 'forumstat' ? getgpc('fid') : ''));//getstatvars_forumstat($_GET['fid']); + break; + } + return $statvars; +} + +function getstatvars_basic() { + global $_G; + + $statvars = array(); + $statvars['members'] = C::t('common_member')->count(); + $members_runtime = C::t('common_member')->fetch_runtime(); + $statvars['membersaddavg'] = $members_runtime > 0.00001 ? (round($statvars['members'] / $members_runtime)) : 0; + $statvars['memnonpost'] = C::t('common_member_count')->count_by_posts(0); + $statvars['mempost'] = $statvars['members'] - $statvars['memnonpost']; + $statvars['admins'] = C::t('common_member')->count_admins(); + $statvars['lastmember'] = C::t('common_member')->count_by_regdate(TIMESTAMP - 86400); + $statvars['mempostpercent'] = number_format((double)$statvars['mempost'] / $statvars['members'] * 100, 2); + + $bestmember = C::t('forum_post')->fetch_all_top_post_author(0, $_G['timestamp']-86400, 1); + $bestmember = isset($bestmember[0]) ? $bestmember[0] : array('username' => ''); + $bestmember['author'] = $bestmember['username']; + $statvars['bestmem'] = isset($bestmember['author']) ? $bestmember['author'] : null; + $statvars['bestmemposts'] = isset($bestmember['posts']) ? $bestmember['posts'] : null; + $postsinfo = C::t('forum_post')->fetch_posts(0); + $statvars['posts'] = $postsinfo['posts']; + $runtime= $postsinfo['runtime']; + + $statvars['postsaddavg'] = $runtime > 0.00001 ? round($statvars['posts'] / $runtime) : 0; + + $statvars['mempostavg'] = sprintf ("%01.2f", $statvars['members'] ? ($statvars['posts'] / $statvars['members']) : 0); + + $statvars['forums'] = C::t('forum_forum')->fetch_all_fids(0, 'forum', 0, 0, 0, 1); + + $hotforum = C::t('forum_forum')->fetch_all_for_ranklist(1, '', 'posts', 0, 1); + $statvars['hotforum'] = array('posts' => $hotforum[0]['posts'], 'threads' => $hotforum[0]['threads'], 'fid' => $hotforum[0]['fid'], 'name' => $hotforum[0]['name']); + + $statvars['threads'] = C::t('forum_thread')->count_all_thread(); + + $statvars['postsaddtoday'] = C::t('forum_post')->count_by_dateline(0, TIMESTAMP - 86400); + + $statvars['threadreplyavg'] = sprintf ("%01.2f", $statvars['threads'] ? (($statvars['posts'] - $statvars['threads']) / $statvars['threads']) : 0); + + $statvars['membersaddtoday'] = $statvars['lastmember']; + $statvars['activeindex'] = round((($statvars['members'] ? ($statvars['membersaddavg'] / $statvars['members']) : 0) + ($statvars['posts'] ? ($statvars['postsaddavg'] / $statvars['posts']) : 0)) * 1500 + $statvars['threadreplyavg'] * 10 + $statvars['mempostavg'] * 1 + $statvars['mempostpercent'] / 10); + + $statvars['lastupdate'] = dgmdate(TIMESTAMP); + $statvars['nextupdate'] = dgmdate(TIMESTAMP + CACHE_TIME); + $statvars['lastupdated'] = TIMESTAMP; + $_G['cache']['statvars']['basic'] = $statvars; + savecache('statvars', $_G['cache']['statvars']); + + return $statvars; +} + +function getstatvars_trade() { + global $_G; + $statvars = array(); + $query = C::t('forum_trade')->fetch_all_statvars('tradesum'); + foreach($query as $data) { + $tradesums[] = $data; + } + $statvars['tradesums'] = $tradesums; + $query = C::t('forum_trade')->fetch_all_statvars('credittradesum'); + foreach($query as $data) { + $credittradesums[] = $data; + } + $statvars['credittradesums'] = $credittradesums; + $query = C::t('forum_trade')->fetch_all_statvars('totalitems'); + foreach($query as $data) { + $totalitems[] = $data; + } + $statvars['totalitems'] = $totalitems; + + $statvars['lastupdate'] = dgmdate(TIMESTAMP); + $statvars['nextupdate'] = dgmdate(TIMESTAMP + CACHE_TIME); + $statvars['lastupdated'] = TIMESTAMP; + $_G['cache']['statvars']['trade'] = $statvars; + savecache('statvars', $_G['cache']['statvars']); + + return $statvars; +} + +function getstatvars_team() { + global $_G; + + $statvars = array(); + $team = array(); + + $forums = $moderators = $members = $fuptemp = array(); + $categories = array(0 => array('fid' => 0, 'fup' => 0, 'type' => 'group', 'name' => $_G['setting']['bbname'])); + + $uids = array(); + foreach(C::t('forum_moderator')->fetch_all_no_inherited() as $moderator) { + $moderators[$moderator['fid']][] = $moderator['uid']; + $uids[$moderator['uid']] = $moderator['uid']; + } + + $totaloffdays = $totalol = $totalthismonthol = 0; + $admins = array(); + $members = C::t('common_member')->fetch_all($uids) + C::t('common_member')->fetch_all_by_adminid(array(1, 2)); + $uids = array_keys($members); + $onlinetime = $_G['setting']['oltimespan'] ? C::t('common_onlinetime')->fetch_all($uids) : array(); + $member_status = C::t('common_member_status')->fetch_all($uids); + $member_count = C::t('common_member_count')->fetch_all($uids); + foreach($members as $uid => $member) { + $member = array_merge($member, $member_status[$uid], $member_count[$uid], (array)$onlinetime[$uid]); + $member['thismonthol'] = $member['thismonth']; + $member['totalol'] = $member['total']; + if($member['adminid'] == 1 || $member['adminid'] == 2) { + $admins[] = $member['uid']; + } + + $member['offdays'] = intval((TIMESTAMP - $member['lastactivity']) / 86400); + $totaloffdays += $member['offdays']; + + if($_G['setting']['oltimespan']) { + $member['totalol'] = round($member['totalol'] / 60, 2); + $member['thismonthol'] = gmdate('Yn', $member['lastactivity']) == gmdate('Yn', TIMESTAMP) ? round($member['thismonthol'] / 60, 2) : 0; + $totalol += $member['totalol']; + $totalthismonthol += $member['thismonthol']; + } + + $members[$member['uid']] = $member; + $uids[$member['uid']] = $member['uid']; + } + + $totalthismonthposts = 0; + foreach(C::t('forum_post')->fetch_all_author_posts_by_dateline(0, $uids, $_G['timestamp']-86400*30) as $post) { + $members[$post['authorid']]['thismonthposts'] = $post['posts']; + $totalthismonthposts += $post['posts']; + } + + $totalmodposts = $totalmodactions = 0; + if($_G['setting']['modworkstatus']) { + $starttime = gmdate("Y-m-1", TIMESTAMP + $_G['setting']['timeoffset'] * 3600); + foreach(C::t('forum_modwork')->fetch_all_user_count_by_dateline($starttime) as $member) { + $members[$member['uid']]['modactions'] = $member['actioncount']; + $totalmodactions += $member['actioncount']; + } + } + + $query = C::t('forum_forum')->fetch_all_by_status(1, 1); + foreach($query as $val) { + $forum = array('fid' => $val['fid'], 'fup' => $val['fup'], 'type' => $val['type'], 'name' => $val['name'], 'inheritedmod' => $val['inheritedmod']); + $moderators[$forum['fid']] = (isset($moderators[$forum['fid']]) && is_array($moderators[$forum['fid']])) ? $moderators[$forum['fid']] : array(); + $forum['moderators'] = count($moderators[$forum['fid']]); + switch($forum['type']) { + case 'group': + $categories[$forum['fid']] = $forum; + $forums[$forum['fid']][$forum['fid']] = $forum; + $catfid = $forum['fid']; + break; + case 'forum': + $forums[$forum['fup']][$forum['fid']] = $forum; + $fuptemp[$forum['fid']] = $forum['fup']; + $catfid = $forum['fup']; + break; + case 'sub': + $forums[$fuptemp[$forum['fup']]][$forum['fid']] = $forum; + $catfid = $fuptemp[$forum['fup']]; + break; + } + if(!empty($moderators[$forum['fid']])) { + $categories[$catfid]['moderating'] = 1; + } + } + + foreach($categories as $fid => $category) { + if(empty($category['moderating'])) { + unset($categories[$fid]); + } + } + + $team = array ( + 'categories' => $categories, + 'forums' => $forums, + 'admins' => $admins, + 'moderators' => $moderators, + 'members' => $members, + 'avgoffdays' => count($members) ? ($totaloffdays / count($members)) : 0, + 'avgthismonthposts' => count($members) ? ($totalthismonthposts / count($members)) : 0, + 'avgtotalol' => count($members) ? ($totalol / count($members)) : 0, + 'avgthismonthol' => count($members) ? ($totalthismonthol / count($members)) : 0, + 'avgmodactions' => count($members) ? ($totalmodactions / count($members)) : 0, + ); + + loadcache('usergroups'); + if(is_array($team)) { + foreach($team['members'] as $uid => $member) { + $member['thismonthposts'] = intval($member['thismonthposts']); + $team['members'][$uid]['offdays'] = $member['offdays'] > $team['avgoffdays'] ? ''.$member['offdays'].'' : $member['offdays']; + $team['members'][$uid]['thismonthposts'] = $member['thismonthposts'] < $team['avgthismonthposts'] / 2 ? ''.$member['thismonthposts'].'' : $member['thismonthposts']; + $team['members'][$uid]['lastactivity'] = dgmdate($member['lastactivity'] + $_G['setting']['timeoffset'] * 3600, 'd'); + $team['members'][$uid]['thismonthol'] = $member['thismonthol'] < $team['avgthismonthol'] / 2 ? ''.$member['thismonthol'].'' : $member['thismonthol']; + $team['members'][$uid]['totalol'] = $member['totalol'] < $team['avgtotalol'] / 2 ? ''.$member['totalol'].'' : $member['totalol']; + $team['members'][$uid]['modposts'] = $member['modposts'] < $team['avgmodposts'] / 2 ? ''.intval($member['modposts']).'' : intval($member['modposts']); + $team['members'][$uid]['modactions'] = $member['modactions'] < $team['avgmodactions'] / 2 ? ''.intval($member['modactions']).'' : intval($member['modactions']); + $team['members'][$uid]['grouptitle'] = $_G['cache']['usergroups'][$member['adminid']]['grouptitle']; + } + } + + $statvars['team'] = $team; + $statvars['lastupdate'] = dgmdate(TIMESTAMP); + $statvars['nextupdate'] = dgmdate(TIMESTAMP + CACHE_TIME); + + $statvars['lastupdated'] = TIMESTAMP; + $_G['cache']['statvars']['team'] = $statvars; + savecache('statvars', $_G['cache']['statvars']); + + return $statvars; +} + +function getstatvars_modworks() { + global $_G; + $statvars = array(); + + $before = $_GET['before']; + $before = (isset($before) && $before > 0 && $before <= $_G['setting']['maxmodworksmonths']) ? intval($before) : 0 ; + + $modworks_starttime = $_GET['modworks_starttime']; + $modworks_endtime = $_GET['modworks_endtime']; + + list($now['year'], $now['month'], $now['day']) = explode("-", dgmdate(TIMESTAMP, 'Y-n-j')); + + $monthlinks = array(); + $uid = !empty($_GET['uid']) ? $_GET['uid'] : 0; + for($i = 0; $i <= $_G['setting']['maxmodworksmonths']; $i++) { + $month = date("Y-m", mktime(0, 0, 0, $now['month'] - $i, 1, $now['year'])); + if($i != $before) { + $monthlinks[$i] = "
        • $month
        • "; + } else { + if(!isset($_GET['before']) && $modworks_starttime && $modworks_endtime) { + $starttime = dgmdate(strtotime($modworks_starttime), 'Y-m-d'); + $endtime = dgmdate(strtotime($modworks_endtime), 'Y-m-d'); + $monthlinks[$i] = "
        • $month
        • "; + } else { + $starttime = $month.'-01'; + $endtime = date("Y-m-01", mktime(0, 0, 0, $now['month'] - $i + 1 , 1, $now['year'])); + $monthlinks[$i] = "
        • $month
        • "; + } + } + } + $statvars['monthlinks'] = $monthlinks; + + $expiretime = date('Y-m', mktime(0, 0, 0, $now['month'] - $_G['setting']['maxmodworksmonths'] - 1, 1, $now['year'])); + + $mergeactions = array('OPN' => 'CLS', 'ECL' => 'CLS', 'UEC' => 'CLS', 'EOP' => 'CLS', 'UEO' => 'CLS', + 'UDG' => 'DIG', 'EDI' =>'DIG', 'UED' => 'DIG', 'UST' => 'STK', 'EST' => 'STK', 'UES' => 'STK', + 'DLP' => 'DEL', 'PRN' => 'DEL', 'UDL' => 'DEL', 'UHL' => 'HLT', 'EHL' => 'HLT', 'UEH' => 'HLT', + 'SPL' => 'MRG', 'ABL' => 'EDT', 'RBL' => 'EDT'); + + if($uid) { + + $uid = $_GET['uid']; + $member = getuserbyuid($uid, 1); + if(empty($member) || !is_array($member) || in_array($_G['adminid'], array(0, -1))) { + showmessage('member_not_found'); + } + + $modactions = $totalactions = array(); + $starttime_dateline = strtotime($starttime); + $endtime_dateline = strtotime($endtime); + $endtime_dateline = $endtime_dateline > TIMESTAMP ? TIMESTAMP : $endtime_dateline; + while($starttime_dateline <= $endtime_dateline) { + $modactions[dgmdate($starttime_dateline, 'Y-m-d')] = array(); + $starttime_dateline += 86400; + } + + foreach(C::t('forum_modwork')->fetch_all_by_uid_dateline($uid, $starttime, $endtime) as $data) { + if(isset($mergeactions[$data['modaction']])) { + $data['modaction'] = $mergeactions[$data['modaction']]; + } + $modactions[$data['dateline']]['total'] += $data['count']; + $modactions[$data['dateline']][$data['modaction']]['count'] += $data['count']; + $modactions[$data['dateline']][$data['modaction']]['posts'] += $data['posts']; + $totalactions[$data['modaction']]['count'] += $data['count']; + $totalactions[$data['modaction']]['posts'] += $data['posts']; + $totalactions['total'] += $data['count']; + } + $statvars['modactions'] = $modactions; + $statvars['totalactions'] = $totalactions; + $statvars['username'] = $member['username']; + + } else { + + $members = $total = array(); + $uids = $totalmodactions = 0; + + $members = C::t('common_member')->fetch_all_by_adminid(array(1, 2, 3)); + + + foreach(C::t('forum_modwork')->fetch_all_user_count_posts_by_uid_dateline(array_keys($members), $starttime, $endtime) as $data) { + if(isset($mergeactions[$data['modaction']])) { + $data['modaction'] = $mergeactions[$data['modaction']]; + } + $members[$data['uid']]['total'] += $data['count']; + $totalmodactioncount += $data['count']; + + $members[$data['uid']][$data['modaction']]['count'] += $data['count']; + $members[$data['uid']][$data['modaction']]['posts'] += $data['posts']; + + $total[$data['modaction']]['count'] += $data['count']; + $total[$data['modaction']]['posts'] += $data['posts']; + $total['total'] += $data['count']; + + } + + $avgmodactioncount = count($members) ? ($totalmodactioncount / count($members)) : 0; + foreach($members as $id => $member) { + $members[$id]['totalactions'] = intval($members[$id]['totalactions']); + $members[$id]['username'] = ($members[$id]['total'] < $avgmodactioncount / 2) ? (''.$members[$id]['username'].'') : ($members[$id]['username']); + } + + if(!empty($before)) { + C::t('forum_modwork')->delete_by_dateline($expiretime.'-01'); + } else { + $members['thismonth'] = $starttime; + $members['lastupdate'] = TIMESTAMP; + unset($members['lastupdate'], $members['thismonth']); + } + $statvars['members'] = $members; + $statvars['total'] = $total; + } + $modactioncode = lang('forum/modaction'); + + $bgarray = array(); + foreach($modactioncode as $key => $val) { + if(isset($mergeactions[$key])) { + unset($modactioncode[$key]); + } + } + + $statvars['modactioncode'] = $modactioncode; + $tdcols = count($modactioncode) + 1; + $tdwidth = floor(90 / ($tdcols - 1)).'%'; + $statvars['tdwidth'] = $tdwidth; + $statvars['uid'] = $uid; + $statvars['starttime'] = $starttime; + $statvars['endtime'] = $endtime; + return $statvars; +} + +function getstatvars_memberlist() { + global $_G; + $statvars = array(); + $srchmem = $_GET['srchmem']; + $page = $_G['setting']['membermaxpages'] && isset($_GET['page']) && $_GET['page'] > $_G['setting']['membermaxpages'] ? 1 : $_GET['page']; + if(empty($page)) { + $page = 1; + } + $start_limit = ($page - 1) * $_G['setting']['memberperpage']; + $statvars['memberlist'] = C::t('common_member')->fetch_all_stat_memberlist($srchmem, $_GET['order'], $_GET['asc'] ? 'ASC' : 'DESC', $start_limit, $_G['setting']['memberperpage']); + $num = !empty($srchmem) ? C::t('common_member')->count_by_like_username($srchmem) : C::t('common_member')->count(); + $multipage = multi($num, $_G['setting']['memberperpage'], $page, 'misc.php?mod=stat&op=memberlist&srchmem='.rawurlencode($srchmem).'&order='.rawurlencode($_GET['order']).'&asc='.rawurlencode($_GET['asc']), $_G['setting']['membermaxpages']); + $statvars['multipage'] = $multipage; + + return $statvars; +} + +function getstatvars_forumstat($fid) { + global $_G; + $xml = '<'."?xml version=\"1.0\" encoding=\"utf-8\"?>"; + $statvars = array(); + $monthdays = array('31', '29', '31', '30', '31', '30', '31', '31', '30', '31', '30', '31'); + if(!$fid) { + $query = C::t('forum_forum')->fetch_all_fids(); + $forums = array(); + foreach($query as $val) { + $forums[] = array('fid' => $val['fid'], 'type' => $val['type'], 'name' => $val['name'], 'posts' => $val['posts']); + } + $statvars['forums'] = $forums; + } else { + $foruminfo = C::t('forum_forum')->fetch($fid); + $statvars['foruminfo'] = array('fid' => $foruminfo['fid'], 'name' => $foruminfo['name'], 'posts' => $foruminfo['posts'], 'threads' => $foruminfo['threads'], 'todayposts' => $foruminfo['todayposts']); + + $current_date = $end_date = date('Y-m-d'); + $current_month = $end_month = date('Y-m'); + $current_month_start = $end_month_start = $current_month . '-01'; + if($_GET['month']) { + $end_month = trim($_GET['month']); + $month = substr($end_month, strpos($end_month, '-') + 1); + $end_date = $end_month . '-' . $monthdays[$month - 1]; + $end_month_start = $end_month . '-' . '01'; + } + $statvars['month'] = $end_month; + $logs = array(); + $xml .= ""; + $xmlvalue = ''; + $xaxisindex = 0; + foreach(C::t('forum_statlog')->fetch_all_by_logdate($end_month_start, $end_date, $fid) as $log) { + $logs[] = $log; + list($yyyy, $mm, $dd) = explode('-', $log['logdate']); + $xaxisindex++; + $xml .= "{$mm}{$dd}"; + $xmlvalue .= "{$log['value']}"; + } + $xml .= ""; + $xml .= ""; + $xml .= ""; + $xml .= $xmlvalue; + $xml .= ""; + $xml .= ""; + $xml .= ""; + if($_GET['xml']) { + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + @header("Content-type: application/xml; charset=utf-8"); + echo $xml; + exit; + } + $statvars['logs'] = $logs; + + $mindate = C::t('forum_statlog')->fetch_min_logdate_by_fid($fid); + if(!$mindate) { + return $statvars; + } + list($minyear, $minmonth, $minday) = explode('-', $mindate); + $minmonth = $minyear . '-' . $minmonth; + $month = $minmonth; + $monthlist = array(); + while(datecompare($month, $current_month) <= 0) { + $monthlist[] = $month; + $month = getnextmonth($month); + } + $statvars['monthlist'] = $monthlist; + + $monthposts = array(); + foreach(C::t('forum_statlog')->fetch_all_by_fid_type($fid) as $data) { + list($year, $month, $day) = explode('-', $data['logdate']); + if(isset($monthposts[$year.'-'.$month])) { + $monthposts[$year.'-'.$month] += $data['value']; + } else { + $monthposts[$year.'-'.$month] = $data['value']; + } + } + $statvars['monthposts'] = $monthposts; + } + $statvars['statuspara'] = "misc.php?mod=stat&op=forumstat&fid=$fid&month={getgpc('month')}&xml=1"; + return $statvars; +} + +function datecompare($date1, $date2) { + $year1 = $month1 = $day1 = 1; + $year2 = $month2 = $day2 = 1; + list($year1, $month1, $day1) = explode('-', $date1); + list($year2, $month2, $day2) = explode('-', $date2); + + return mktime(0, 0, 0, $month1, $day1, $year1) - mktime(0, 0, 0, $month2, $day2, $year2); +} + +function getnextmonth($monthdate) { + list($year, $month) = explode('-', $monthdate); + $month = $month + 1; + if($month > 12) { + $month = 1; + $year = $year + 1; + } + $month = sprintf("%02d", $month); + return $year . '-' . $month; +} \ No newline at end of file diff --git a/source/module/misc/misc_swfupload.php b/source/module/misc/misc_swfupload.php new file mode 100644 index 0000000..6895ec2 --- /dev/null +++ b/source/module/misc/misc_swfupload.php @@ -0,0 +1,252 @@ +fetch_info_by_fid($fid) : $_G['forum']; + if($forum['status'] == 3 && $forum['level']) { + $levelinfo = C::t('forum_grouplevel')->fetch($forum['level']); + if($postpolicy = $levelinfo['postpolicy']) { + $postpolicy = dunserialize($postpolicy); + $forumattachextensions = $postpolicy['attachextensions']; + } + } else { + $forumattachextensions = $forum['attachextensions']; + } + if($forumattachextensions) { + $_G['group']['attachextensions'] = $forumattachextensions; + } + } + $upload = new forum_upload(); + +} elseif($_GET['operation'] == 'poll') { + + if(!$_G['group']['allowpostpoll'] || !$_G['group']['allowpostimage']) { + exit("{\"aid\":0, \"errorcode\":4}"); + } + + $upload = new discuz_upload(); + + $_FILES["Filedata"]['name'] = addslashes(diconv(urldecode($_FILES["Filedata"]['name']), 'UTF-8')); + $upload->init($_FILES['Filedata'], 'forum'); + $attach = $upload->attach; + if(!$upload->attach['isimage']) { + $errorcode = 4; + } else { + $upload->save(); + $errorcode = 0; + } + if($upload->error()) { + $errorcode = 4; + } else { + if($attach['isimage']) { + require_once libfile('class/image'); + $image = new image(); + $thumbimgwidth = 300; + $thumbimgheight = 300; + $attach['thumb'] = $image->Thumb($attach['target'], '', $thumbimgwidth, $thumbimgheight, 2); + $image->Watermark($attach['target'], '', 'forum'); + $imginfo = @getimagesize($attach['target']); + if($imginfo !== FALSE) { + $attach['width'] = $imginfo[0]; + $attach['height'] = $imginfo[1]; + } + } + + if(ftpperm($attach['ext'], $attach['size'])) { + if(ftpcmd('upload', 'forum/'.$attach['attachment']) && (!$attach['thumb'] || ftpcmd('upload', 'forum/'.getimgthumbname($attach['attachment'])))) { + @unlink($_G['setting']['attachdir'].'/forum/'.$attach['attachment']); + @unlink($_G['setting']['attachdir'].'/forum/'.getimgthumbname($attach['attachment'])); + $attach['remote'] = 1; + } else { + if(getglobal('setting/ftp/mirror')) { + @unlink($attach['target']); + @unlink(getimgthumbname($attach['target'])); + $errorcode = 5; + } + } + } + } + if(!$errorcode) { + $aid = intval($_GET['aid']); + $setarr = array( + 'uid' => $_G['uid'], + 'filename' => $attach['name'], + 'attachment' => $attach['attachment'], + 'filesize' => $attach['size'], + 'thumb' => $attach['thumb'], + 'remote' => $attach['remote'], + 'dateline' => $_G['timestamp'], + 'width' => $attach['width'], + 'height' => $attach['height'] + ); + $image = array(); + if($aid) { + $image = C::t('forum_polloption_image')->fetch($aid); + } + if($image['uid'] == $_G['uid']) { + C::t('forum_polloption_image')->update($aid, $setarr); + @unlink($_G['setting']['attachdir'].'/forum/'.$image['attachment']); + @unlink($_G['setting']['attachdir'].'/forum/'.getimgthumbname($image['attachment'])); + $attach['attachid'] = $aid; + } else { + $attach['attachid'] = C::t('forum_polloption_image')->insert($setarr, true); + } + + require_once libfile('function/home'); + $smallimg = pic_get($attach['attachment'], 'forum', $attach['thumb'], $attach['remote']); + $bigimg = pic_get($attach['attachment'], 'forum', 0, $attach['remote']); + echo "{\"aid\":{$attach['attachid']}, \"smallimg\":\"$smallimg\", \"bigimg\":\"$bigimg\", \"errorcode\":$errorcode}"; + exit(); + } else { + echo "{\"aid\":0, \"errorcode\":$errorcode}"; + } + + + + +} elseif($_GET['operation'] == 'album') { + + + $showerror = true; + if(helper_access::check_module('album')) { + require_once libfile('function/spacecp'); + if($_FILES["Filedata"]['error']) { + $file = lang('spacecp', 'file_is_too_big'); + } else { + require_once libfile('function/home'); + $_FILES["Filedata"]['name'] = addslashes(diconv(urldecode($_FILES["Filedata"]['name']), 'UTF-8')); + $file = pic_save($_FILES["Filedata"], 0, '', true, 0); + if(!empty($file) && is_array($file)) { + $url = pic_get($file['filepath'], 'album', $file['thumb'], $file['remote']); + $bigimg = pic_get($file['filepath'], 'album', 0, $file['remote']); + echo "{\"picid\":\"{$file['picid']}\", \"url\":\"$url\", \"bigimg\":\"$bigimg\"}"; + $showerror = false; + } + } + } + if($showerror) { + echo "{\"picid\":\"0\", \"url\":\"0\", \"bigimg\":\"0\"}"; + } + + +} elseif($_GET['operation'] == 'portal') { + + $aid = intval($_POST['aid']); + $catid = intval($_POST['catid']); + $msg = ''; + $errorcode = 0; + require_once libfile('function/portalcp'); + if($aid) { + $article = C::t('portal_article_title')->fetch($aid); + if(!$article) { + $errorcode = 1; + } + + if(check_articleperm($catid, $aid, $article, false, true) !== true) { + $errorcode = 2; + } + + } else { + if(check_articleperm($catid, $aid, null, false, true) !== true) { + $errorcode = 3; + } + } + + $upload = new discuz_upload(); + + $_FILES["Filedata"]['name'] = addslashes(diconv(urldecode($_FILES["Filedata"]['name']), 'UTF-8')); + $upload->init($_FILES['Filedata'], 'portal'); + $attach = $upload->attach; + if(!$upload->error()) { + $upload->save(); + } + if($upload->error()) { + $errorcode = 4; + } + if(!$errorcode) { + if($attach['isimage'] && empty($_G['setting']['portalarticleimgthumbclosed'])) { + require_once libfile('class/image'); + $image = new image(); + $thumbimgwidth = $_G['setting']['portalarticleimgthumbwidth'] ? $_G['setting']['portalarticleimgthumbwidth'] : 300; + $thumbimgheight = $_G['setting']['portalarticleimgthumbheight'] ? $_G['setting']['portalarticleimgthumbheight'] : 300; + $attach['thumb'] = $image->Thumb($attach['target'], '', $thumbimgwidth, $thumbimgheight, 2); + $image->Watermark($attach['target'], '', 'portal'); + } + + if(ftpperm($attach['ext'], $attach['size'])) { + if(ftpcmd('upload', 'portal/'.$attach['attachment']) && (!$attach['thumb'] || ftpcmd('upload', 'portal/'.getimgthumbname($attach['attachment'])))) { + @unlink($_G['setting']['attachdir'].'/portal/'.$attach['attachment']); + @unlink($_G['setting']['attachdir'].'/portal/'.getimgthumbname($attach['attachment'])); + $attach['remote'] = 1; + } else { + if(getglobal('setting/ftp/mirror')) { + @unlink($attach['target']); + @unlink(getimgthumbname($attach['target'])); + $errorcode = 5; + } + } + } + + $setarr = array( + 'uid' => $_G['uid'], + 'filename' => $attach['name'], + 'attachment' => $attach['attachment'], + 'filesize' => $attach['size'], + 'isimage' => $attach['isimage'], + 'thumb' => $attach['thumb'], + 'remote' => $attach['remote'], + 'filetype' => $attach['extension'], + 'dateline' => $_G['timestamp'], + 'aid' => $aid + ); + $setarr['attachid'] = C::t('portal_attachment')->insert($setarr, true); + if($attach['isimage']) { + require_once libfile('function/home'); + $smallimg = pic_get($attach['attachment'], 'portal', $attach['thumb'], $attach['remote']); + $bigimg = pic_get($attach['attachment'], 'portal', 0, $attach['remote']); + $coverstr = addslashes(serialize(array('pic'=>'portal/'.$attach['attachment'], 'thumb'=>$attach['thumb'], 'remote'=>$attach['remote']))); + echo "{\"aid\":{$setarr['attachid']}, \"isimage\":{$attach['isimage']}, \"smallimg\":\"$smallimg\", \"bigimg\":\"$bigimg\", \"errorcode\":$errorcode, \"cover\":\"$coverstr\"}"; + exit(); + } else { + $fileurl = 'portal.php?mod=attachment&id='.$attach['attachid']; + echo "{\"aid\":{$setarr['attachid']}, \"isimage\":{$attach['isimage']}, \"file\":\"$fileurl\", \"errorcode\":$errorcode}"; + exit(); + } + } else { + echo "{\"aid\":0, \"errorcode\":$errorcode}"; + } + +} + +?> \ No newline at end of file diff --git a/source/module/misc/misc_tag.php b/source/module/misc/misc_tag.php new file mode 100644 index 0000000..9dee7a7 --- /dev/null +++ b/source/module/misc/misc_tag.php @@ -0,0 +1,175 @@ +count_by_tagid($id); + } + include_once template('tag/tag'); + exit(); +} +$taglang = lang('tag/template', 'tag'); +if($id || $name) { + + $tpp = 20; + $page = max(1, intval($page)); + $start_limit = ($page - 1) * $tpp; + if($id) { + $tag = C::t('common_tag')->fetch_info($id); + } else { + if(!preg_match('/^([\x7f-\xff_-]|\w|\s)+$/', $name) || strlen($name) > 20) { + showmessage('parameters_error'); + } + $name = addslashes($name); + $tag = C::t('common_tag')->fetch_info(0, $name); + } + + if($tag['status'] == 1) { + showmessage('tag_closed'); + } + $tagname = $tag['tagname']; + $id = $tag['tagid']; + $searchtagname = $name; + $navtitle = $tagname ? $taglang.' - '.$tagname : $taglang; + $metakeywords = $tagname ? $taglang.' - '.$tagname : $taglang; + $metadescription = $tagname ? $taglang.' - '.$tagname : $taglang; + + + $showtype = ''; + $count = ''; + $summarylen = 300; + + if($type == 'thread') { + $showtype = 'thread'; + $tidarray = $threadlist = array(); + $count = C::t('common_tagitem')->select($id, 0, 'tid', '', '', 0, 0, 0, 1); + if($count) { + $query = C::t('common_tagitem')->select($id, 0, 'tid', '', '', $start_limit, $tpp); + foreach($query as $result) { + $tidarray[$result['itemid']] = $result['itemid']; + } + $threadlist = getthreadsbytids($tidarray); + $multipage = multi($count, $tpp, $page, "misc.php?mod=tag&id={$tag['tagid']}&type=thread"); + } + } elseif($type == 'blog') { + $showtype = 'blog'; + $blogidarray = $bloglist = array(); + $count = C::t('common_tagitem')->select($id, 0, 'blogid', '', '', 0, 0, 0, 1); + if($count) { + $query = C::t('common_tagitem')->select($id, 0, 'blogid', '', '', $start_limit, $tpp); + foreach($query as $result) { + $blogidarray[$result['itemid']] = $result['itemid']; + } + $bloglist = getblogbyid($blogidarray); + + $multipage = multi($count, $tpp, $page, "misc.php?mod=tag&id={$tag['tagid']}&type=blog"); + } + } else { + $shownum = 20; + + $tidarray = $threadlist = array(); + $query = C::t('common_tagitem')->select($id, 0, 'tid', '', '', $shownum); + foreach($query as $result) { + $tidarray[$result['itemid']] = $result['itemid']; + } + $threadlist = getthreadsbytids($tidarray); + + if(helper_access::check_module('blog')) { + $blogidarray = $bloglist = array(); + $query = C::t('common_tagitem')->select($id, 0, 'blogid', '', '', $shownum); + foreach($query as $result) { + $blogidarray[$result['itemid']] = $result['itemid']; + } + $bloglist = getblogbyid($blogidarray); + } + + } + + include_once template('tag/tagitem'); + +} else { + $navtitle = $metakeywords = $metadescription = $taglang; + $viewthreadtags = 100; + $tagarray = array(); + $query = C::t('common_tag')->fetch_all_by_status(0, '', $viewthreadtags, 0, 0, 'DESC'); + foreach($query as $result) { + $tagarray[] = $result; + } + include_once template('tag/tag'); +} + +function getthreadsbytids($tidarray) { + global $_G; + + $threadlist = array(); + if(!empty($tidarray)) { + loadcache('forums'); + include_once libfile('function_misc', 'function'); + $fids = array(); + foreach(C::t('forum_thread')->fetch_all_by_tid($tidarray) as $result) { + if($result['displayorder'] >= 0){ + if(!isset($_G['cache']['forums'][$result['fid']]['name'])) { + $fids[$result['fid']][] = $result['tid']; + } else { + $result['name'] = $_G['cache']['forums'][$result['fid']]['name']; + } + $threadlist[$result['tid']] = procthread($result); + } + } + if(!empty($fids)) { + foreach(C::t('forum_forum')->fetch_all_by_fid(array_keys($fids)) as $fid => $forum) { + foreach($fids[$fid] as $tid) { + $threadlist[$tid]['forumname'] = $forum['name']; + } + } + } + } + return $threadlist; +} + +function getblogbyid($blogidarray) { + global $_G, $summarylen; + + $bloglist = array(); + if(!empty($blogidarray)) { + $data_blog = C::t('home_blog')->fetch_all_blog($blogidarray, 'dateline', 'DESC'); + $data_blogfield = C::t('home_blogfield')->fetch_all($blogidarray); + + require_once libfile('function/spacecp'); + require_once libfile('function/home'); + $classarr = array(); + foreach($data_blog as $curblogid => $result) { + $result = array_merge($result, (array)$data_blogfield[$curblogid]); + $result['dateline'] = dgmdate($result['dateline']); + $classarr = getclassarr($result['uid']); + $result['classname'] = $classarr[$result['classid']]['classname']; + if($result['friend'] == 4) { + $result['message'] = $result['pic'] = ''; + } else { + $result['message'] = getstr($result['message'], $summarylen, 0, 0, 0, -1); + } + $result['message'] = preg_replace("/&[a-z]+\;/i", '', $result['message']); + if($result['pic']) { + $result['pic'] = pic_cover_get($result['pic'], $result['picflag']); + } + $bloglist[] = $result; + } + } + return $bloglist; +} +?> \ No newline at end of file diff --git a/source/module/misc/misc_userstatus.php b/source/module/misc/misc_userstatus.php new file mode 100644 index 0000000..42b6d94 --- /dev/null +++ b/source/module/misc/misc_userstatus.php @@ -0,0 +1,53 @@ +increase($typeid, array('viewnum' => 1)); +} elseif($_GET['type'] === 'article' && $typeid = intval($_GET['typeid'])) { + C::t('portal_article_count')->increase($typeid, array('viewnum' => 1)); + $tablename = 'portal_article_count'; +} +if($tablename) { + $dynamicdata = C::t($tablename)->fetch($typeid); + $output['viewnum'] = $dynamicdata['viewnum']; + $output['commentnum'] = $dynamicdata['commentnum']; +} +if($output['uid']) { + $_G['style']['tplfile'] = 'misc/userstatus'; + if(check_diy_perm($topic)){ + require template('common/header_diynav'); + echo $diynav; + } + $output['diynav'] = str_replace(array("\r", "\n"), '' ,ob_get_contents()); + ob_end_clean(); + $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start(); + + require template('common/header_userstatus'); + $output['userstatus'] = str_replace(array("\r", "\n"), '' ,ob_get_contents()); + ob_end_clean(); + $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start(); + + require template('common/header_qmenu'); + $output['qmenu'] = str_replace(array("\r", "\n"), '' ,ob_get_contents()); + ob_end_clean(); + $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start(); +} + +header("Content-Type: application/json"); +echo helper_json::encode($output); + +?> \ No newline at end of file diff --git a/source/module/portal/index.htm b/source/module/portal/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/portal/portal_attachment.php b/source/module/portal/portal_attachment.php new file mode 100644 index 0000000..35ff3d7 --- /dev/null +++ b/source/module/portal/portal_attachment.php @@ -0,0 +1,130 @@ +fetch($id); +if(empty($attach)) { + showmessage('portal_attachment_noexist'); +} + +if($operation == 'delete') { + if(!$_G['group']['allowmanagearticle'] && ($_G['uid'] != $attach['uid'] || $aid != $attach['aid'])) { + showmessage('portal_attachment_nopermission_delete'); + } + if(!isset($_GET['formhash']) || formhash() != $_GET['formhash']) { + showmessage('portal_attachment_nopermission_delete'); + } + if($aid) { + C::t('portal_article_title')->update($aid, array('pic' => '')); + } + C::t('portal_attachment')->delete($id); + pic_delete($attach['attachment'], 'portal', $attach['thumb'], $attach['remote']); + showmessage('portal_image_noexist'); + +} elseif($operation == 'getattach') { + + require_once libfile('function/attachment'); + if($attach['isimage']) { + require_once libfile('function/home'); + $smallimg = pic_get($attach['attachment'], 'portal', $attach['thumb'], $attach['remote']); + $bigimg = pic_get($attach['attachment'], 'portal', 0, $attach['remote']); + $coverstr = addslashes(serialize(array('pic'=>'portal/'.$attach['attachment'], 'thumb'=>$attach['thumb'], 'remote'=>$attach['remote']))); + } + $attach['filetype'] = attachtype($attach['filetype']."\t".$attach['filetype']); + $attach['filesize'] = sizecount($attach['filesize']); + include template('portal/portal_attachment'); + + exit; + +} else { + $filename = $_G['setting']['attachdir'].'/portal/'.$attach['attachment']; + if(!$attach['remote'] && !is_readable($filename)) { + showmessage('attachment_nonexistence'); + } + + $readmod = 2;//read local file's function: 1=fread 2=readfile 3=fpassthru 4=fpassthru+multiple + $range = 0; + if($readmod == 4 && !empty($_SERVER['HTTP_RANGE'])) { + list($range) = explode('-',(str_replace('bytes=', '', $_SERVER['HTTP_RANGE']))); + } + + if($attach['remote'] && !$_G['setting']['ftp']['hideurl'] && $attach['isimage']) { + dheader('location:'.$_G['setting']['ftp']['attachurl'].'portal/'.$attach['attachment']); + } + + $filesize = $attach['filesize']; + $filenameencode = strtolower(CHARSET) == 'utf-8' ? rawurlencode($attach['filename']) : rawurlencode(diconv($attach['filename'], CHARSET, 'UTF-8')); + + $rfc6266blacklist = strexists($_SERVER['HTTP_USER_AGENT'], 'UCBrowser') || strexists($_SERVER['HTTP_USER_AGENT'], 'Quark') || strexists($_SERVER['HTTP_USER_AGENT'], 'SogouM') || strexists($_SERVER['HTTP_USER_AGENT'], 'baidu'); + + dheader('Date: '.gmdate('D, d M Y H:i:s', $attach['dateline']).' GMT'); + dheader('Last-Modified: '.gmdate('D, d M Y H:i:s', $attach['dateline']).' GMT'); + dheader('Content-Encoding: none'); + dheader('Content-Disposition: attachment; filename="'.$filenameencode.'"'.(($attach['filename'] == $filenameencode || $rfc6266blacklist) ? '' : '; filename*=utf-8\'\''.$filenameencode)); + dheader('Content-Type: '.$attach['filetype']); + dheader('Content-Length: '.$filesize); + + if($readmod == 4) { + dheader('Accept-Ranges: bytes'); + if(!empty($_SERVER['HTTP_RANGE'])) { + $rangesize = ($filesize - $range) > 0 ? ($filesize - $range) : 0; + dheader('Content-Length: '.$rangesize); + dheader('HTTP/1.1 206 Partial Content'); + dheader('Content-Range: bytes='.$range.'-'.($filesize-1).'/'.($filesize)); + } + } + + $attach['remote'] ? getremotefile($attach['attachment']) : getlocalfile($filename, $readmod, $range); +} +function getremotefile($file) { + global $_G; + @set_time_limit(0); + if(!@readfile($_G['setting']['ftp']['attachurl'].'portal/'.$file)) { + + $ftp = new discuz_ftp(); + if(!($_G['setting']['ftp']['connid'] = $ftp->connect())) { + return FALSE; + } + $tmpfile = @tempnam($_G['setting']['attachdir'], ''); + if($ftp->ftp_get($_G['setting']['ftp']['connid'], $tmpfile, $file, FTP_BINARY)) { + @readfile($tmpfile); + @unlink($tmpfile); + } else { + @unlink($tmpfile); + return FALSE; + } + } + return TRUE; +} + +function getlocalfile($filename, $readmod = 2, $range = 0) { + if($readmod == 1 || $readmod == 3 || $readmod == 4) { + if($fp = @fopen($filename, 'rb')) { + @fseek($fp, $range); + if(function_exists('fpassthru') && ($readmod == 3 || $readmod == 4)) { + @fpassthru($fp); + } else if(filesize($filename)) { + echo fread($fp, filesize($filename)); + } + } + @fclose($fp); + } else { + @readfile($filename); + } + @flush(); + @ob_flush(); +} + +?> \ No newline at end of file diff --git a/source/module/portal/portal_block.php b/source/module/portal/portal_block.php new file mode 100644 index 0000000..eb7230a --- /dev/null +++ b/source/module/portal/portal_block.php @@ -0,0 +1,44 @@ + 20, 'seotitle' => $block['name'], 'keywords' => '', 'description' => ''); +$blocktype = $block['blockclass']; +if(!in_array($blocktype, array('forum_thread', 'portal_article', 'group_thread'), true)) { + showmessage('block_nomore', dreferer()); +} + +$perpage = max(1, intval($blockmoreurl['perpage'])); +$curpage = max(1, intval($_GET['page'])); +$start = ($curpage-1) * $perpage; +$count = C::t('common_block_item_data')->count_by_bid($bid); +$list = $count ? C::t('common_block_item_data')->fetch_all_by_bid($bid, 1, $start, $perpage) : array(); +$multipage = $count ? multi($count, $perpage, $curpage, 'portal.php?mod=block&bid='.$bid) : ''; + +$navtitle = $blockmoreurl['seotitle']; +$metakeywords = $blockmoreurl['seokeywords']; +$metadescription = $blockmoreurl['seodescription']; + +$file = 'portal/block_more_'.$blocktype; +include template('diy:'.$file); + +?> \ No newline at end of file diff --git a/source/module/portal/portal_comment.php b/source/module/portal/portal_comment.php new file mode 100644 index 0000000..f690b71 --- /dev/null +++ b/source/module/portal/portal_comment.php @@ -0,0 +1,60 @@ +fetch($id); + if($csubject) { + $csubject = array_merge($csubject, C::t('portal_article_count')->fetch($id)); + } + $url = fetch_article_url($csubject); +} elseif($idtype == 'topicid') { + $csubject = C::t('portal_topic')->fetch($id); + $url = fetch_topic_url($csubject); +} +if(empty($csubject)) { + showmessage('comment_'.$idtype.'_no_exist'); +} elseif(empty($csubject['allowcomment'])) { + showmessage($idtype.'_comment_is_forbidden'); +} + +$perpage = 25; +$page = intval($_GET['page']); +if($page<1) $page = 1; +$start = ($page-1)*$perpage; + +$commentlist = array(); +$multi = ''; + +if($csubject['commentnum']) { + $pricount = 0; + $query = C::t('portal_comment')->fetch_all_by_id_idtype($id, $idtype, 'dateline', 'DESC', $start, $perpage); + foreach($query as $value) { + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $commentlist[] = $value; + } else { + $pricount ++; + } + } +} + +$multi = multi($csubject['commentnum'], $perpage, $page, "portal.php?mod=comment&id=$id&idtype=$idtype"); +list($seccodecheck, $secqaacheck) = seccheck('publish'); +include_once template("diy:portal/comment"); + +?> \ No newline at end of file diff --git a/source/module/portal/portal_index.php b/source/module/portal/portal_index.php new file mode 100644 index 0000000..ecf9dac --- /dev/null +++ b/source/module/portal/portal_index.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/source/module/portal/portal_list.php b/source/module/portal/portal_list.php new file mode 100644 index 0000000..9e32c3c --- /dev/null +++ b/source/module/portal/portal_list.php @@ -0,0 +1,205 @@ + 'pg_list_'.$cat['topid']); +if($cat['upid']) { + $bodycss[$cat['upid']] = 'pg_list_'.$cat['upid']; +} +$bodycss[$cat['catid']] = 'pg_list_'.$cat['catid']; +$cat['bodycss'] = implode(' ', $bodycss); + +$catseoset = array( + 'seotitle' => $cat['seotitle'], + 'seokeywords' => $cat['keyword'], + 'seodescription' => $cat['description'] +); +$seodata = array('firstcat' => $cats[0], 'secondcat' => $cats[1], 'curcat' => $cat['catname'], 'page' => intval($_GET['page'])); +list($navtitle, $metadescription, $metakeywords) = get_seosetting('articlelist', $seodata, $catseoset); +if(!$navtitle) { + $navtitle = helper_seo::get_title_page($cat['catname'], $_G['page']); + $nobbname = false; +} else { + $nobbname = true; +} +if(!$metakeywords) { + $metakeywords = $cat['catname']; +} +if(!$metadescription) { + $metadescription = $cat['catname']; +} + +if(isset($_G['makehtml'])){ + helper_makehtml::portal_list($cat); +} + +$file = 'portal/list:'.$catid; +$tpldirectory = ''; +$primaltplname = $cat['primaltplname']; +if(strpos($primaltplname, ':') !== false) { + list($tpldirectory, $primaltplname) = explode(':', $primaltplname); +} +include template('diy:'.$file, NULL, $tpldirectory, NULL, $primaltplname); + + +function category_get_wheresql($cat) { + $wheresql = ''; + if(is_array($cat)) { + $catid = $cat['catid']; + if(!empty($cat['subs'])) { + include_once libfile('function/portalcp'); + $subcatids = category_get_childids('portal', $catid); + $subcatids[] = $catid; + + $wheresql = "at.catid IN (".dimplode($subcatids).")"; + } else { + $wheresql = "at.catid='$catid'"; + } + } + $wheresql .= " AND at.status='0'"; + return $wheresql; +} + +function category_get_list($cat, $wheresql, $page = 1, $perpage = 0) { + global $_G; + $cat['perpage'] = empty($cat['perpage']) ? 15 : $cat['perpage']; + $cat['maxpages'] = empty($cat['maxpages']) ? 1000 : $cat['maxpages']; + $perpage = intval($perpage); + $page = intval($page); + $perpage = empty($perpage) ? $cat['perpage'] : $perpage; + $page = empty($page) ? 1 : min($page, $cat['maxpages']); + $start = ($page-1)*$perpage; + if($start<0) $start = 0; + $list = array(); + $pricount = 0; + $multi = ''; + $count = C::t('portal_article_title')->fetch_all_by_sql($wheresql, '', 0, 0, 1, 'at'); + if($count) { + $query = C::t('portal_article_title')->fetch_all_by_sql($wheresql, 'ORDER BY at.dateline DESC', $start, $perpage, 0, 'at'); + foreach($query as $value) { + $value['catname'] = $value['catid'] == $cat['catid'] ? $cat['catname'] : $_G['cache']['portalcategory'][$value['catid']]['catname']; + $value['onerror'] = ''; + if($value['pic']) { + $value['pic'] = pic_get($value['pic'], '', $value['thumb'], $value['remote'], 1, 1); + } + $value['dateline'] = dgmdate($value['dateline']); + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $list[] = $value; + } else { + $pricount++; + } + } + if(strpos($cat['caturl'], 'portal.php') === false) { + $cat['caturl'] .= 'index.php'; + } + $multi = multi($count, $perpage, $page, $cat['caturl'], $cat['maxpages']); + } + return $return = array('list'=>$list,'count'=>$count,'multi'=>$multi,'pricount'=>$pricount); +} + +function category_get_list_more($cat, $wheresql, $hassub = true,$hasnew = true,$hashot = true) { + global $_G; + $data = array(); + $catid = $cat['catid']; + + $cachearr = array(); + if($hashot) $cachearr[] = 'portalhotarticle'; + if($hasnew) $cachearr[] = 'portalnewarticle'; + + if($hassub) { + foreach($cat['children'] as $childid) { + $cachearr[] = 'subcate'.$childid; + } + } + + $allowmemory = memory('check'); + foreach ($cachearr as $key) { + $cachekey = $key.$catid; + $data[$key] = $allowmemory ? memory('get', $cachekey) : false; + if($data[$key] === false) { + $list = array(); + $sql = ''; + if($key == 'portalhotarticle') { + $dateline = TIMESTAMP - 3600 * 24 * 90; + $query = C::t('portal_article_count')->fetch_all_hotarticle($wheresql, $dateline); + } elseif($key == 'portalnewarticle') { + $query = C::t('portal_article_title')->fetch_all_by_sql($wheresql, 'ORDER BY at.dateline DESC', 0, 10, 0, 'at'); + } elseif(substr($key, 0, 7) == 'subcate') { + $cacheid = intval(str_replace('subcate', '', $key)); + if(!empty($_G['cache']['portalcategory'][$cacheid])) { + $where = ''; + if(!empty($_G['cache']['portalcategory'][$cacheid]['children']) && dimplode($_G['cache']['portalcategory'][$cacheid]['children'])) { + $_G['cache']['portalcategory'][$cacheid]['children'][] = $cacheid; + $where = 'at.catid IN ('.dimplode($_G['cache']['portalcategory'][$cacheid]['children']).')'; + } else { + $where = 'at.catid='.$cacheid; + } + $where .= " AND at.status='0'"; + $query = C::t('portal_article_title')->fetch_all_by_sql($where, 'ORDER BY at.dateline DESC', 0, 10, 0, 'at'); + } + } + + if($query) { + + foreach($query as $value) { + $value['catname'] = $value['catid'] == $cat['catid'] ? $cat['catname'] : $_G['cache']['portalcategory'][$value['catid']]['catname']; + if($value['pic']) $value['pic'] = pic_get($value['pic'], '', $value['thumb'], $value['remote'], 1, 1); + $value['timestamp'] = $value['dateline']; + $value['dateline'] = dgmdate($value['dateline']); + $list[] = $value; + } + } + + $data[$key] = $list; + if($allowmemory) { + memory('set', $cachekey, $list, empty($list) ? 60 : 600); + } + } + } + return $data; +} \ No newline at end of file diff --git a/source/module/portal/portal_portalcp.php b/source/module/portal/portal_portalcp.php new file mode 100644 index 0000000..c6c28a6 --- /dev/null +++ b/source/module/portal/portal_portalcp.php @@ -0,0 +1,50 @@ +dologin($_G['uid'], getgpc('cppwd'), true); + } + + if(!$modsession->islogin) { + include template('portal/portalcp_login'); + dexit(); + } +} + +if($ac == 'logout') { + $modsession = new discuz_panel(PORTALCP_PANEL); + $modsession->dologout(); + showmessage('modcp_logout_succeed', 'index.php'); +} + +$navtitle = lang('core', 'title_'.$ac.'_management').' - '.lang('core', 'title_portal_management'); + +require_once libfile('function/portalcp'); +require_once libfile('portalcp/'.$ac, 'include'); +?> \ No newline at end of file diff --git a/source/module/portal/portal_rss.php b/source/module/portal/portal_rss.php new file mode 100644 index 0000000..df737e8 --- /dev/null +++ b/source/module/portal/portal_rss.php @@ -0,0 +1,143 @@ + $category) { + $catarray[] = $catid; + } +} else { + + if(isset($_G['cache']['portalcategory'][$rsscatid])) { + $catarray = array($rsscatid); + $catname = dhtmlspecialchars($_G['cache']['portalcategory'][$rsscatid]['catname']); + } else { + exit('Specified article not found'); + } +} + +$rewriteflag = 0; +$havedomain = implode('', $_G['setting']['domain']['app']); +if(is_array($_G['setting']['rewritestatus']) && in_array('portal_article', $_G['setting']['rewritestatus'])) { + $rewriteflag = 1; +} + +$charset = $_G['config']['output']['charset']; +dheader("Content-type: application/xml"); +echo "\n". + "\n". + " \n". + (count($catarray) > 1 ? + " {$_G['setting']['bbname']}\n". + " {$_G['siteurl']}forum.php\n". + " Latest $num articles of all categories\n" + : + " {$_G['setting']['bbname']} - $catname\n". + " {$_G['siteurl']}portal.php?mod=list&catid=$rsscatid\n". + " Latest $num articles of $catname\n" + ). + " Copyright(C) {$_G['setting']['bbname']}\n". + " Discuz! Board by Comsenz Inc.\n". + " ".gmdate('r', TIMESTAMP)."\n". + " $ttl\n". + " \n". + " {$_G['siteurl']}static/image/common/logo_88_31.gif\n". + " {$_G['setting']['bbname']}\n". + " {$_G['siteurl']}\n". + " \n"; + +if($catarray) { + $alldata = C::t('portal_rsscache')->fetch_all_by_catid($catarray, $num); + if($alldata) { + foreach($alldata as $article) { + if(TIMESTAMP - $article['lastupdate'] > $ttl * 60) { + updatersscache($num); + break; + } else { + list($article['description'], $attachremote, $attachfile, $attachsize) = explode("\t", $article['description']); + if($attachfile) { + if($attachremote) { + $filename = $_G['setting']['ftp']['attachurl'].'portal/'.$attachfile; + } else { + $filename = $_G['siteurl'].$_G['setting']['attachurl'].'portal/'.$attachfile; + } + } + echo " \n". + " ".$article['subject']."\n". + " {$_G['siteurl']}".($rewriteflag ? rewriteoutput('portal_article', 1, '', $article['aid']) : "portal.php?mod=view&aid={$article['aid']}")."\n". + " \n". + " ".dhtmlspecialchars($article['catname'])."\n". + " ".dhtmlspecialchars($article['author'])."\n". + ($attachfile ? ''."\n" : ''). + " ".gmdate('r', $article['dateline'])."\n". + " \n"; + } + } + } else { + updatersscache($num); + } +} + +echo " \n". + ""; + + +function updatersscache($num) { + global $_G; + $processname = 'portal_rss_cache'; + if(discuz_process::islocked($processname, 600)) { + return false; + } + C::t('portal_rsscache')->truncate(); + require_once libfile('function/post'); + foreach($_G['cache']['portalcategory'] as $catid => $catarray) { + $query = C::t('portal_article_title')->fetch_all_for_cat($catid, 0, 1, 0, $num); + $catarray['catname'] = addslashes($catarray['catname']); + foreach($query as $article) { + $article['author'] = $article['author'] != '' ? addslashes($article['author']) : ($article['username'] ? addslashes($article['username']) : 'Anonymous'); + $article['title'] = addslashes($article['title']); + $articleattach = C::t('portal_attachment')->fetch_by_aid_image($article['aid']); + $attachdata = ''; + if(!empty($articleattach)) { + $attachdata = "\t".$articleattach['remote']."\t".$articleattach['attachment']."\t".$articleattach['filesize']; + } + $article['description'] = addslashes(messagecutstr($article['summary'], 250 - strlen($attachdata)).$attachdata); + C::t('portal_rsscache')->insert(array( + 'lastupdate'=>$_G['timestamp'], + 'catid'=>$catid, + 'aid'=>$article['aid'], + 'dateline'=>$article['dateline'], + 'catname'=>$catarray['catname'], + 'author'=>$article['author'], + 'subject'=>$article['title'], + 'description'=>$article['description'] + )); + } + } + discuz_process::unlock($processname); + return true; +} +?> \ No newline at end of file diff --git a/source/module/portal/portal_topic.php b/source/module/portal/portal_topic.php new file mode 100644 index 0000000..d2f4367 --- /dev/null +++ b/source/module/portal/portal_topic.php @@ -0,0 +1,85 @@ +fetch($topicid); +} elseif($_GET['topic']) { + $topic = C::t('portal_topic')->fetch_by_name($_GET['topic']); +} + +if(empty($topic)) { + showmessage('topic_not_exist'); +} + +if($topic['closed'] && !$_G['group']['allowmanagetopic'] && !($topic['uid'] == $_G['uid'] && $_G['group']['allowaddtopic'])) { + showmessage('topic_is_closed'); +} + +if($_GET['diy'] == 'yes' && $topic['uid'] != $_G['uid'] && !$_G['group']['allowmanagetopic']) { + $_GET['diy'] = ''; + showmessage('topic_edit_nopermission'); +} + +if(!empty($_G['setting']['makehtml']['flag']) && $topic['htmlmade'] && !isset($_G['makehtml']) && empty($_GET['diy'])) { + dheader('location:'.fetch_topic_url($topic)); +} + +$topicid = intval($topic['topicid']); + +C::t('portal_topic')->increase($topicid, array('viewnum' => 1)); + +$navtitle = $topic['title']; +$metadescription = empty($topic['summary']) ? $topic['title'] : $topic['summary']; +$metakeywords = empty($topic['keyword']) ? $topic['title'] : $topic['keyword']; + +$attachtags = $aimgs = array(); + +list($seccodecheck, $secqaacheck) = seccheck('publish'); + +if(isset($_G['makehtml'])) { + helper_makehtml::portal_topic($topic); +} + +$file = 'portal/portal_topic_content:'.$topicid; +$tpldirectory = ''; +$primaltplname = $topic['primaltplname']; +if(strpos($primaltplname, ':') !== false) { + list($tpldirectory, $primaltplname) = explode(':', $primaltplname); +} +$topicurl = fetch_topic_url($topic); +include template('diy:'.$file, NULL, $tpldirectory, NULL, $primaltplname); + +function portaltopicgetcomment($topcid, $limit = 20, $start = 0) { + global $_G; + $topcid = intval($topcid); + $limit = intval($limit); + $start = intval($start); + $data = array(); + if($topcid) { + $query = C::t('portal_comment')->fetch_all_by_id_idtype($topcid, 'topicid', 'dateline', 'DESC', $start, $limit); + foreach($query as $value) { + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $data[$value['cid']] = $value; + } + } + } + return $data; +} +?> \ No newline at end of file diff --git a/source/module/portal/portal_view.php b/source/module/portal/portal_view.php new file mode 100644 index 0000000..4555b5a --- /dev/null +++ b/source/module/portal/portal_view.php @@ -0,0 +1,345 @@ +fetch($aid); +require_once libfile('function/portalcp'); +$categoryperm = getallowcategory($_G['uid']); + +if(empty($article) || ($article['status'] > 0 && $article['uid'] != $_G['uid'] && !$_G['group']['allowmanagearticle'] && empty($categoryperm[$article['catid']]['allowmanage']) && $_G['adminid'] != 1 && $_GET['modarticlekey'] != modauthkey($article['aid']))) { + header("HTTP/1.1 404 Not Found"); + showmessage('view_article_no_exist'); +} + +if(!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['article']) && empty($_G['cache']['portalcategory'][$article['catid']]['noantitheft'])) { + helper_antitheft::check($aid, 'aid'); +} + +if(!empty($_G['setting']['makehtml']['flag']) && $article['htmlmade'] && !isset($_G['makehtml']) && empty($_GET['diy']) && empty($article['url'])) { + dheader('location:'. fetch_article_url($article)); +} +$article_count = C::t('portal_article_count')->fetch($aid); +if($article_count) $article = array_merge($article_count, $article); + +if($article_count) { + C::t('portal_article_count')->increase($aid, array('viewnum'=>1)); + unset($article_count); +} else { + C::t('portal_article_count')->insert(array( + 'aid'=>$aid, + 'catid'=>$article['catid'], + 'viewnum'=>1)); +} + +if($article['url']) { + if(!isset($_G['makehtml'])) { + dheader("location:{$article['url']}"); + } + exit(); +} + + +$cat = category_remake($article['catid']); + +$article['pic'] = pic_get($article['pic'], '', $article['thumb'], $article['remote'], 1, 1); + +$page = intval($_GET['page']); +if($page<1) $page = 1; + +$content = $contents = array(); +$multi = ''; + +$content = C::t('portal_article_content')->fetch_by_aid_page($aid, $page); + +if($article['contents'] && $article['showinnernav']) { + foreach(C::t('portal_article_content')->fetch_all_by_aid($aid) as $value) { + $contents[] = $value; + } + if(empty($contents)) { + C::t('portal_article_content')->update($aid, array('showinnernav' => '0')); + } +} + +require_once libfile('function/blog'); +$content['content'] = blog_bbcode($content['content']); + +if(!empty($_G['setting']['makehtml']['flag']) && $article['htmlmade']) { + $_caturl = $_G['cache']['portalcategory'][$cat['topid']]['domain'] ? $_G['cache']['portalcategory'][$cat['topid']]['caturl'] : ''; + $viewurl = $_caturl.$article['htmldir'].$article['htmlname'].'{page}.'.$_G['setting']['makehtml']['extendname']; + unset($_caturl); +} else { + $viewurl = "portal.php?mod=view&aid=$aid"; +} + +$multi = multi($article['contents'], 1, $page, $viewurl); +$org = array(); +if($article['idtype'] == 'tid' || $content['idtype']=='pid') { + $thread = $firstpost = array(); + require_once libfile('function/discuzcode'); + require_once libfile('function/forum'); + $thread = get_thread_by_tid($article['id']); + if(!empty($thread)) { + if($content['idtype']=='pid') { + $firstpost = C::t('forum_post')->fetch_post($thread['posttableid'], $content['id']); + } else { + $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($article['id']); + } + if($firstpost && $firstpost['tid'] == $article['id']) { + $firstpost['uid'] = $firstpost['authorid']; + $firstpost['username'] = $firstpost['author']; + } + } + if(!empty($firstpost) && !empty($thread) && $thread['displayorder'] != -1) { + $_G['tid'] = $article['id']; + $aids = array(); + $firstpost['message'] = $content['content']; + if($thread['attachment']) { + $_G['group']['allowgetimage'] = 1; + if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $firstpost['message'], $matchaids)) { + $aids = $matchaids[1]; + } + } + + if($aids) { + parseforumattach($firstpost, $aids); + } + $content['content'] = $firstpost['message']; + $content['pid'] = $firstpost['pid']; + + $org = $firstpost; + $org_url = "forum.php?mod=viewthread&tid={$article['id']}"; + } else { + C::t('portal_article_title')->update($aid, array('id' => 0, 'idtype' => '')); + C::t('portal_article_content')->update_by_aid($aid, array('id' => 0, 'idtype' => '')); + } +} elseif($article['idtype']=='blogid') { + $org = C::t('home_blog')->fetch($article['id']); + if(empty($org)) { + C::t('portal_article_title')->update($aid, array('id' => 0, 'idtype' => '')); + dheader('location: '. fetch_article_url($article)); + exit(); + } +} + +$article['related'] = array(); +if(($relateds = C::t('portal_article_related')->fetch_all_by_aid($aid))) { + foreach(C::t('portal_article_title')->fetch_all(array_keys($relateds)) as $raid => $value) { + $value['uri'] = fetch_article_url($value); + $article['related'][$raid] = $value; + } +} +$article['allowcomment'] = !empty($cat['allowcomment']) && !empty($article['allowcomment']) ? 1 : 0; +$_G['catid'] = $_GET['catid'] = $article['catid']; +$common_url = ''; +$commentlist = array(); +if($article['allowcomment']) { + + if($org && empty($article['owncomment'])) { + + if($article['idtype'] == 'blogid') { + + $common_url = "home.php?mod=space&uid={$org['uid']}&do=blog&id={$article['id']}"; + $form_url = "home.php?mod=spacecp&ac=comment"; + + $article['commentnum'] = C::t('home_comment')->count_by_id_idtype($article['id'], 'blogid'); + if($article['commentnum']) { + $query = C::t('home_comment')->fetch_all_by_id_idtype($article['id'], 'blogid', 0, 20, '', 'DESC'); + foreach($query as $value) { + if($value['status'] == 0 || $_G['adminid'] == 1 || $value['uid'] == $_G['uid']) { + $commentlist[] = $value; + } + } + } + + } elseif($article['idtype'] == 'tid') { + + $common_url = "forum.php?mod=viewthread&tid={$article['id']}"; + $form_url = "forum.php?mod=post&action=reply&tid={$article['id']}&replysubmit=yes&infloat=yes&handlekey=fastpost"; + + require_once libfile('function/discuzcode'); + $posttable = empty($thread['posttable']) ? getposttablebytid($article['id']) : $thread['posttable']; + $_G['tid'] = $article['id']; + $article['commentnum'] = getcount($posttable, array('tid'=>$article['id'], 'first'=>'0')); + + if($article['allowcomment'] && $article['commentnum']) { + $attachpids = $attachtags = array(); + $_G['group']['allowgetattach'] = $_G['group']['allowgetimage'] = 1; + foreach(C::t('forum_post')->fetch_all_by_tid('tid:'.$article['id'], $article['id'], true, 'ASC', 0, 20, null, 0) as $value) { + $value['uid'] = $value['authorid']; + $value['username'] = $value['author']; + if($value['status'] != 1 && !$value['first']) { + $value['message'] = discuzcode($value['message'], $value['smileyoff'], $value['bbcodeoff'], $value['htmlon']); + $value['cid'] = $value['pid']; + $commentlist[$value['pid']] = $value; + if($value['attachment']) { + $attachpids[] = $value['pid']; + if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $value['message'], $matchaids)) { + $attachtags[$value['pid']] = $matchaids[1]; + } + } + } + } + + if($attachpids) { + require_once libfile('function/attachment'); + parseattach($attachpids, $attachtags, $commentlist); + } + } + } + + } else { + + $common_url = "portal.php?mod=comment&id=$aid&idtype=aid"; + $form_url = "portal.php?mod=portalcp&ac=comment"; + + $query = C::t('portal_comment')->fetch_all_by_id_idtype($aid, 'aid', 'dateline', 'DESC', 0, 20); + $pricount = 0; + foreach($query as $value) { + if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) { + $value['allowop'] = 1; + $commentlist[] = $value; + } else { + $pricount += 1; + } + } + } +} + +$hash = md5($article['uid']."\t".$article['dateline']); +$id = $article['aid']; +$idtype = 'aid'; + +loadcache('click'); +$clicks = empty($_G['cache']['click']['aid'])?array():$_G['cache']['click']['aid']; +$maxclicknum = 0; +foreach ($clicks as $key => $value) { + $value['clicknum'] = $article["click{$key}"]; + $value['classid'] = mt_rand(1, 4); + if($value['clicknum'] > $maxclicknum) $maxclicknum = $value['clicknum']; + $clicks[$key] = $value; +} + +$clickuserlist = array(); +foreach(C::t('home_clickuser')->fetch_all_by_id_idtype($id, $idtype, 0, 24) as $value) { + $value['clickname'] = $clicks[$value['clickid']]['name']; + $clickuserlist[] = $value; +} + +$article['timestamp'] = $article['dateline']; +$article['dateline'] = dgmdate($article['dateline']); + +foreach($cat['ups'] as $val) { + $cats[] = $val['catname']; +} +$seodata = array('firstcat' => $cats[0], 'secondcat' => $cats[1], 'curcat' => $cat['catname'], 'subject' => $article['title'], 'user' => $article['username'], 'summary' => $article['summary'], 'page' => intval($_GET['page'])); +list($navtitle, $metadescription, $metakeywords) = get_seosetting('article', $seodata); +if(empty($navtitle)) { + $navtitle = helper_seo::get_title_page($article['title'], $_G['page']).' - '.$cat['catname']; + $nobbname = false; +} else { + $nobbname = true; +} +if(empty($metakeywords)) { + $metakeywords = $article['title']; +} +if(empty($metadescription)) { + $metadescription = $article['summary'] ? $article['summary'] : $article['title']; +} + +list($seccodecheck, $secqaacheck) = seccheck('publish'); + +$catid = $article['catid']; +if(!$_G['setting']['relatedlinkstatus']) { + $_G['relatedlinks'] = get_related_link('article'); +} else { + $content['content'] = parse_related_link($content['content'], 'article'); +} +if(isset($_G['makehtml'])) { + helper_makehtml::portal_article($cat, $article, $page); +} +portal_get_per_next_article($article); +$tpldirectory = ''; +$articleprimaltplname = $cat['articleprimaltplname']; +if(strpos($articleprimaltplname, ':') !== false) { + list($tpldirectory, $articleprimaltplname) = explode(':', $articleprimaltplname); +} +include_once template("diy:portal/view:{$catid}", NULL, $tpldirectory, NULL, $articleprimaltplname); + +function parseforumattach(&$post, $aids) { + global $_G; + if(($aids = array_unique($aids))) { + require_once libfile('function/attachment'); + $finds = $replaces = array(); + foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$post['tid'], 'aid', $aids) as $attach) { + + $attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'; + $attach['dateline'] = dgmdate($attach['dateline'], 'u'); + $extension = strtolower(fileext($attach['filename'])); + $attach['ext'] = $extension; + $attach['imgalt'] = $attach['isimage'] ? strip_tags(str_replace('"', '\"', $attach['description'] ? $attach['description'] : $attach['filename'])) : ''; + $attach['attachicon'] = attachtype($extension."\t".$attach['filetype']); + $attach['attachsize'] = sizecount($attach['filesize']); + + $attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp'))); + $aidencode = packaids($attach); + $widthcode = attachwidth($attach['width']); + $is_archive = $_G['forum_thread']['is_archived'] ? "&fid=".$_G['fid']."&archiveid=".$_G['forum_thread']['archiveid'] : ''; + if($attach['isimage']) { + $attachthumb = getimgthumbname($attach['attachment']); + if($_G['setting']['thumbstatus'] && $attach['thumb']) { + $replaces[$attach['aid']] = "\"{$attach['imgalt']}\""; + } else { + $replaces[$attach['aid']] = "\"{$attach['imgalt']}\""; + } + } else { + $replaces[$attach['aid']] = "{$attach['attachicon']}{$attach['filename']}"; + } + $finds[$attach['aid']] = '[attach]'.$attach['aid'].'[/attach]'; + } + if($finds && $replaces) { + $post['message'] = str_ireplace($finds, $replaces, $post['message']); + } + } +} + +function portal_get_per_next_article(&$article) { + $data = array(); + $aids = array(); + if($article['preaid']) { + $aids[$article['preaid']] = $article['preaid']; + } + if($article['nextaid']) { + $aids[$article['nextaid']] = $article['nextaid']; + } + if($aids) { + $data = C::t('portal_article_title')->fetch_all($aids); + foreach ($data as $aid => &$value) { + $value['url'] = fetch_article_url($value); + } + } + if($data[$article['preaid']]) { + $article['prearticle'] = $data[$article['preaid']]; + } + if($data[$article['nextaid']]) { + $article['nextarticle'] = $data[$article['nextaid']]; + } +} +?> \ No newline at end of file diff --git a/source/module/search/index.htm b/source/module/search/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/module/search/search_album.php b/source/module/search/search_album.php new file mode 100644 index 0000000..3e8e477 --- /dev/null +++ b/source/module/search/search_album.php @@ -0,0 +1,149 @@ + $_G['group']['grouptitle']), array('login' => 1)); +} + +$_G['setting']['search']['album']['searchctrl'] = intval($_G['setting']['search']['album']['searchctrl']); + +$srchmod = 4; + +$cachelife_time = 300; // Life span for cache of searching in specified range of time +$cachelife_text = 3600; // Life span for cache of text searching + +$srchtype = empty($_GET['srchtype']) ? '' : trim($_GET['srchtype']); +$searchid = isset($_GET['searchid']) ? intval($_GET['searchid']) : 0; + +$srchtxt = $_GET['srchtxt']; +$keyword = isset($srchtxt) ? dhtmlspecialchars(trim($srchtxt)) : ''; + +if(!submitcheck('searchsubmit', 1)) { + + include template('search/album'); + +} else { + + $orderby = in_array($_GET['orderby'], array('dateline', 'replies', 'views')) ? $_GET['orderby'] : 'lastpost'; + $ascdesc = isset($_GET['ascdesc']) && $_GET['ascdesc'] == 'asc' ? 'asc' : 'desc'; + + if(!empty($searchid)) { + + $page = max(1, intval($_GET['page'])); + $start_limit = ($page - 1) * $_G['tpp']; + + $index = C::t('common_searchindex')->fetch_by_searchid_srchmod($searchid, $srchmod); + if(!$index) { + showmessage('search_id_invalid'); + } + + $keyword = dhtmlspecialchars($index['keywords']); + $keyword = $keyword != '' ? str_replace('+', ' ', $keyword) : ''; + + $index['keywords'] = rawurlencode($index['keywords']); + + $albumlist = array(); + $maxalbum = $nowalbum = 0; + $query = C::t('home_album')->fetch_all_album(explode(',', $index['ids']), 'updatetime', $start_limit, $_G['tpp']); + foreach($query as $value) { + if($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { + $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + } elseif ($value['picnum']) { + $value['pic'] = STATICURL.'image/common/nopublish.jpg'; + } else { + $value['pic'] = ''; + } + $value['albumname'] = bat_highlight($value['albumname'], $keyword); + $albumlist[$value['albumid']] = $value; + } + + $multipage = multi($index['num'], $_G['tpp'], $page, "search.php?mod=album&searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&searchsubmit=yes"); + + $url_forward = 'search.php?mod=album&'.$_SERVER['QUERY_STRING']; + + include template('search/album'); + + } else { + + $searchstring = 'album|title|'.addslashes($srchtxt); + $searchindex = array('id' => 0, 'dateline' => '0'); + + foreach(C::t('common_searchindex')->fetch_all_search($_G['setting']['search']['album']['searchctrl'], $_G['clientip'], $_G['uid'], $_G['timestamp'], $searchstring, $srchmod) as $index) { + if($index['indexvalid'] && $index['dateline'] > $searchindex['dateline']) { + $searchindex = array('id' => $index['searchid'], 'dateline' => $index['dateline']); + break; + } elseif($_G['adminid'] != '1' && $index['flood']) { + showmessage('search_ctrl', 'search.php?mod=album', array('searchctrl' => $_G['setting']['search']['album']['searchctrl'])); + } + } + + if($searchindex['id']) { + + $searchid = $searchindex['id']; + + } else { + + !($_G['group']['exempt'] & 2) && checklowerlimit('search'); + + if(!$srchtxt && !$srchuid && !$srchuname) { + dheader('Location: search.php?mod=album'); + } + + if($_G['adminid'] != '1' && $_G['setting']['search']['album']['maxspm']) { + if(C::t('common_searchindex')->count_by_dateline($_G['timestamp'], $srchmod) >= $_G['setting']['search']['album']['maxspm']) { + showmessage('search_toomany', 'search.php?mod=album', array('maxspm' => $_G['setting']['search']['album']['maxspm'])); + } + } + + $num = $ids = 0; + $_G['setting']['search']['album']['maxsearchresults'] = $_G['setting']['search']['album']['maxsearchresults'] ? intval($_G['setting']['search']['album']['maxsearchresults']) : 500; + list($srchtxt, $srchtxtsql) = searchkey($keyword, "albumname LIKE '%{text}%'", true); + $query = C::t('home_album')->fetch_albumid_by_searchkey($srchtxtsql, $_G['setting']['search']['album']['maxsearchresults']); + foreach($query as $album) { + $ids .= ','.$album['albumid']; + $num++; + } + unset($query); + + $keywords = str_replace('%', '+', $srchtxt); + $expiration = TIMESTAMP + $cachelife_text; + + $searchid = C::t('common_searchindex')->insert(array( + 'srchmod' => $srchmod, + 'keywords' => $keywords, + 'searchstring' => $searchstring, + 'useip' => $_G['clientip'], + 'uid' => $_G['uid'], + 'dateline' => $_G['timestamp'], + 'expiration' => $expiration, + 'num' => $num, + 'ids' => $ids + ), true); + + !($_G['group']['exempt'] & 2) && updatecreditbyaction('search'); + } + + dheader("location: search.php?mod=album&searchid=$searchid&searchsubmit=yes&kw=".urlencode($keyword)); + + } + +} + +?> \ No newline at end of file diff --git a/source/module/search/search_blog.php b/source/module/search/search_blog.php new file mode 100644 index 0000000..711d03a --- /dev/null +++ b/source/module/search/search_blog.php @@ -0,0 +1,159 @@ + $_G['group']['grouptitle']), array('login' => 1)); +} + +$_G['setting']['search']['blog']['searchctrl'] = intval($_G['setting']['search']['blog']['searchctrl']); + +$srchmod = 3; + +$cachelife_time = 300; // Life span for cache of searching in specified range of time +$cachelife_text = 3600; // Life span for cache of text searching + +$srchtype = empty($_GET['srchtype']) ? '' : trim($_GET['srchtype']); +$searchid = isset($_GET['searchid']) ? intval($_GET['searchid']) : 0; + + +$srchtxt = $_GET['srchtxt']; + +$keyword = isset($srchtxt) ? dhtmlspecialchars(trim($srchtxt)) : ''; + +if(!submitcheck('searchsubmit', 1)) { + + include template('search/blog'); + +} else { + + $orderby = in_array($_GET['orderby'], array('dateline', 'replies', 'views')) ? $_GET['orderby'] : 'lastpost'; + $ascdesc = isset($_GET['ascdesc']) && $_GET['ascdesc'] == 'asc' ? 'asc' : 'desc'; + + if(!empty($searchid)) { + + $page = max(1, intval($_GET['page'])); + $start_limit = ($page - 1) * $_G['tpp']; + + $index = C::t('common_searchindex')->fetch_by_searchid_srchmod($searchid, $srchmod); + if(!$index) { + showmessage('search_id_invalid'); + } + + $keyword = dhtmlspecialchars($index['keywords']); + $keyword = $keyword != '' ? str_replace('+', ' ', $keyword) : ''; + + $index['keywords'] = rawurlencode($index['keywords']); + $result = array(); + $bloglist = array(); + $pricount = 0; + $blogidarray = explode(',', $index['ids']); + $data_blog = C::t('home_blog')->fetch_all_blog($blogidarray, 'dateline', 'DESC', $start_limit, $_G['tpp']); + $data_blogfield = C::t('home_blogfield')->fetch_all($blogidarray); + + foreach($data_blog as $curblogid => $value) { + $result = array_merge($result, (array)$data_blogfield[$curblogid]); + if(ckfriend($value['uid'], $value['friend'], $value['target_ids']) && ($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1)) { + if($value['friend'] == 4) { + $value['message'] = $value['pic'] = ''; + } else { + $value['message'] = bat_highlight($value['message'], $keyword); + $value['message'] = getstr($value['message'], 255, 0, 0, 0, -1); + } + $value['subject'] = bat_highlight($value['subject'], $keyword); + $value['dateline'] = dgmdate($value['dateline']); + $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); + $bloglist[] = $value; + } else { + $pricount++; + } + } + $multipage = multi($index['num'], $_G['tpp'], $page, "search.php?mod=blog&searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&searchsubmit=yes"); + + $url_forward = 'search.php?mod=blog&'.$_SERVER['QUERY_STRING']; + + include template('search/blog'); + + } else { + + $searchstring = 'blog|title|'.addslashes($srchtxt); + $searchindex = array('id' => 0, 'dateline' => '0'); + + foreach(C::t('common_searchindex')->fetch_all_search($_G['setting']['search']['blog']['searchctrl'], $_G['clientip'], $_G['uid'], $_G['timestamp'], $searchstring, $srchmod) as $index) { + if($index['indexvalid'] && $index['dateline'] > $searchindex['dateline']) { + $searchindex = array('id' => $index['searchid'], 'dateline' => $index['dateline']); + break; + } elseif($_G['adminid'] != '1' && $index['flood']) { + showmessage('search_ctrl', 'search.php?mod=blog', array('searchctrl' => $_G['setting']['search']['blog']['searchctrl'])); + } + } + + if($searchindex['id']) { + + $searchid = $searchindex['id']; + + } else { + + !($_G['group']['exempt'] & 2) && checklowerlimit('search'); + + if(!$srchtxt && !$srchuid && !$srchuname) { + dheader('Location: search.php?mod=blog'); + } + + if($_G['adminid'] != '1' && $_G['setting']['search']['blog']['maxspm']) { + if(C::t('common_searchindex')->count_by_dateline($_G['timestamp'], $srchmod) >= $_G['setting']['search']['blog']['maxspm']) { + showmessage('search_toomany', 'search.php?mod=blog', array('maxspm' => $_G['setting']['search']['blog']['maxspm'])); + } + } + + $num = $ids = 0; + $_G['setting']['search']['blog']['maxsearchresults'] = $_G['setting']['search']['blog']['maxsearchresults'] ? intval($_G['setting']['search']['blog']['maxsearchresults']) : 500; + list($srchtxt, $srchtxtsql) = searchkey($keyword, "subject LIKE '%{text}%'", true); + $query = C::t('home_blog')->fetch_blogid_by_subject($keyword, $_G['setting']['search']['blog']['maxsearchresults']); + foreach($query as $blog) { + $ids .= ','.$blog['blogid']; + $num++; + } + unset($query); + + $keywords = str_replace('%', '+', $srchtxt); + $expiration = TIMESTAMP + $cachelife_text; + + $searchid = C::t('common_searchindex')->insert(array( + 'srchmod' => $srchmod, + 'keywords' => $keywords, + 'searchstring' => $searchstring, + 'useip' => $_G['clientip'], + 'uid' => $_G['uid'], + 'dateline' => $_G['timestamp'], + 'expiration' => $expiration, + 'num' => $num, + 'ids' => $ids + ), true); + + !($_G['group']['exempt'] & 2) && updatecreditbyaction('search'); + } + + dheader("location: search.php?mod=blog&searchid=$searchid&searchsubmit=yes&kw=".urlencode($keyword)); + + } + +} + +?> \ No newline at end of file diff --git a/source/module/search/search_collection.php b/source/module/search/search_collection.php new file mode 100644 index 0000000..9c83e5f --- /dev/null +++ b/source/module/search/search_collection.php @@ -0,0 +1,146 @@ + $_G['group']['grouptitle']), array('login' => 1)); +} + +$_G['setting']['search']['collection']['searchctrl'] = intval($_G['setting']['search']['collection']['searchctrl']); + +$srchmod = 7; + +$cachelife_time = 300; // Life span for cache of searching in specified range of time +$cachelife_text = 3600; // Life span for cache of text searching + +$srchtype = empty($_GET['srchtype']) ? '' : trim($_GET['srchtype']); +$searchid = isset($_GET['searchid']) ? intval($_GET['searchid']) : 0; + +$srchtxt = $_GET['srchtxt']; +$keyword = isset($srchtxt) ? dhtmlspecialchars(trim($srchtxt)) : ''; + +if(!submitcheck('searchsubmit', 1)) { + + include template('search/collection'); + +} else { + + $orderby = in_array($_GET['orderby'], array('follownum', 'threadnum', 'commentnum', 'dateline')) ? $_GET['orderby'] : 'dateline'; + $ascdesc = isset($_GET['ascdesc']) && $_GET['ascdesc'] == 'asc' ? 'asc' : 'desc'; + + if(!empty($searchid)) { + + $page = max(1, intval($_GET['page'])); + $start_limit = ($page - 1) * $_G['tpp']; + + $index = C::t('common_searchindex')->fetch_by_searchid_srchmod($searchid, $srchmod); + if(!$index) { + showmessage('search_id_invalid'); + } + + $keyword = dhtmlspecialchars($index['keywords']); + $keyword = $keyword != '' ? str_replace('+', ' ', $keyword) : ''; + + $index['keywords'] = rawurlencode($index['keywords']); + + require_once libfile('function/discuzcode'); + + $collectionlist = array(); + $maxcollection = $nowcollection = 0; + $query = C::t('forum_collection')->fetch_all(explode(',', $index['ids']), $orderby, $ascdesc, $start_limit, $_G['tpp']); + foreach($query as $value) { + $value['lastupdate'] = dgmdate($value['lastupdate']); + $value['shortdesc'] = cutstr(strip_tags(discuzcode($value['desc'])), 50); + $value['name'] = bat_highlight($value['name'], $keyword); + $collectionlist[$value['ctid']] = $value; + } + + $multipage = multi($index['num'], $_G['tpp'], $page, "search.php?mod=collection&searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&searchsubmit=yes"); + + $url_forward = 'search.php?mod=collection&'.$_SERVER['QUERY_STRING']; + + include template('search/collection'); + + } else { + + $searchstring = 'collection|title|'.addslashes($srchtxt); + $searchindex = array('id' => 0, 'dateline' => '0'); + + foreach(C::t('common_searchindex')->fetch_all_search($_G['setting']['search']['collection']['searchctrl'], $_G['clientip'], $_G['uid'], $_G['timestamp'], $searchstring, $srchmod) as $index) { + if($index['indexvalid'] && $index['dateline'] > $searchindex['dateline']) { + $searchindex = array('id' => $index['searchid'], 'dateline' => $index['dateline']); + break; + } elseif($_G['adminid'] != '1' && $index['flood']) { + showmessage('search_ctrl', 'search.php?mod=collection', array('searchctrl' => $_G['setting']['search']['collection']['searchctrl'])); + } + } + + if($searchindex['id']) { + + $searchid = $searchindex['id']; + + } else { + + !($_G['group']['exempt'] & 2) && checklowerlimit('search'); + + if(!$srchtxt && !$srchuid && !$srchuname) { + dheader('Location: search.php?mod=collection'); + } + + if($_G['adminid'] != '1' && $_G['setting']['search']['collection']['maxspm']) { + if(C::t('common_searchindex')->count_by_dateline($_G['timestamp'], $srchmod) >= $_G['setting']['search']['collection']['maxspm']) { + showmessage('search_toomany', 'search.php?mod=collection', array('maxspm' => $_G['setting']['search']['collection']['maxspm'])); + } + } + + $num = $ids = 0; + $_G['setting']['search']['collection']['maxsearchresults'] = $_G['setting']['search']['collection']['maxsearchresults'] ? intval($_G['setting']['search']['collection']['maxsearchresults']) : 500; + list($srchtxt, $srchtxtsql) = searchkey($keyword, "name LIKE '%{text}%' OR keyword LIKE '%{text}%'", true); + $query = C::t('forum_collection')->fetch_ctid_by_searchkey($srchtxtsql, $_G['setting']['search']['collection']['maxsearchresults']); + foreach($query as $collection) { + $ids .= ','.$collection['ctid']; + $num++; + } + unset($query); + + $keywords = str_replace('%', '+', $srchtxt); + $expiration = TIMESTAMP + $cachelife_text; + + $searchid = C::t('common_searchindex')->insert(array( + 'srchmod' => $srchmod, + 'keywords' => $keywords, + 'searchstring' => $searchstring, + 'useip' => $_G['clientip'], + 'uid' => $_G['uid'], + 'dateline' => $_G['timestamp'], + 'expiration' => $expiration, + 'num' => $num, + 'ids' => $ids + ), true); + + !($_G['group']['exempt'] & 2) && updatecreditbyaction('search'); + } + + dheader("location: search.php?mod=collection&searchid=$searchid&searchsubmit=yes&kw=".urlencode($keyword)); + + } + +} + +?> \ No newline at end of file diff --git a/source/module/search/search_forum.php b/source/module/search/search_forum.php new file mode 100644 index 0000000..c72bf26 --- /dev/null +++ b/source/module/search/search_forum.php @@ -0,0 +1,417 @@ + $_G['group']['grouptitle']), array('login' => 1)); +} + +$_G['setting']['search']['forum']['searchctrl'] = intval($_G['setting']['search']['forum']['searchctrl']); + +require_once libfile('function/forumlist'); +require_once libfile('function/forum'); +require_once libfile('function/post'); +loadcache(array('forums', 'posttable_info')); +$posttableselect = ''; +if(!empty($_G['cache']['posttable_info']) && is_array($_G['cache']['posttable_info'])) { + $posttableselect = ''; +} + +$srchmod = 2; + +$cachelife_time = 300; // Life span for cache of searching in specified range of time +$cachelife_text = 3600; // Life span for cache of text searching + +$srchtype = empty($_GET['srchtype']) ? '' : trim($_GET['srchtype']); +$searchid = isset($_GET['searchid']) ? intval($_GET['searchid']) : 0; +$seltableid = intval(getgpc('seltableid')); + +if($srchtype != 'title' && $srchtype != 'fulltext') { + $srchtype = ''; +} + +$srchtxt = trim(getgpc('srchtxt')); +$srchuid = intval(getgpc('srchuid')); +$srchuname = isset($_GET['srchuname']) ? trim(str_replace('|', '', $_GET['srchuname'])) : '';; +$srchfrom = intval(getgpc('srchfrom')); +$before = intval(getgpc('before')); +$srchfid = getgpc('srchfid'); +$srhfid = intval($_GET['srhfid']); + +$keyword = isset($srchtxt) ? dhtmlspecialchars(trim($srchtxt)) : ''; + +$forumselect = forumselect(); +if(!empty($srchfid) && !is_numeric($srchfid)) { + $forumselect = str_replace('
          ', '
          ', '', '', '', '', '', '', '', '
          ', '

          ', '', '', + '', '', '', '
            ', '
              ', '
                ', + '
                  ', '
                • ', '
                • ', '
                ', '', '', '' + ), preg_replace(array( + "/\[color=([#\w]+?)\]/i", + "/\[color=((rgb|rgba)\([\d\s\.,]+?\))\]/i", + "/\[backcolor=([#\w]+?)\]/i", + "/\[backcolor=((rgb|rgba)\([\d\s\.,]+?\))\]/i", + "/\[size=(\d{1,2}?)\]/i", + "/\[size=(\d+(\.\d+)?(px|pt)+?)\]/i", + "/\[font=([^\[\<]+?)\]/i", + "/\[align=(left|center|right)\]/i", + "/\[p=(\d{1,2}|null), (\d{1,2}|null), (left|center|right)\]/i", + "/\[float=left\]/i", + "/\[float=right\]/i" + ), array( + "", + "", + "", + "", + "", + "", + "", + "", + "

                ", + "", + "" + ), $message)); + + $message = preg_replace("/\s?\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]\s?/is", "", $message); + + if($parsetype != 1) { + if(strpos($msglower, '[/quote]') !== FALSE) { + $message = preg_replace("/\s?\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s?/is", mobile_quote(), $message); + } + if(strpos($msglower, '[/free]') !== FALSE) { + $message = preg_replace("/\s*\[free\][\n\r]*(.+?)[\n\r]*\[\/free\]\s*/is", mobile_free(), $message); + } + } + if(strpos($msglower, '[/media]') !== FALSE) { + $message = preg_replace_callback("/\[media=([\w%,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/is", 'mobile_discuzcode_callback_bbcodeurl_media2', $message); + } + if(strpos($msglower, '[/audio]') !== FALSE) { + $message = preg_replace_callback("/\[audio(=1)*\]\s*([^\[\<\r\n]+?)\s*\[\/audio\]/is", 'mobile_discuzcode_callback_bbcodeurl_href2', $message); + } + if(strpos($msglower, '[/flash]') !== FALSE) { + $message = preg_replace_callback("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", 'mobile_discuzcode_callback_bbcodeurl_4', $message); + } + + if($parsetype != 1 && $allowbbcode < 0 && isset($_G['cache']['bbcodes'][-$allowbbcode])) { + $message = preg_replace($_G['cache']['bbcodes'][-$allowbbcode]['searcharray'], $_G['cache']['bbcodes'][-$allowbbcode]['replacearray'], $message); + } + if($parsetype != 1 && strpos($msglower, '[/hide]') !== FALSE && $pid) { + if($_G['setting']['hideexpiration'] && $pdateline && (TIMESTAMP - $pdateline) / 86400 > $_G['setting']['hideexpiration']) { + $message = preg_replace("/\[hide[=]?(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", "\\3", $message); + $msglower = strtolower($message); + } + if(strpos($msglower, '[hide=d') !== FALSE) { + $message = preg_replace_callback( + "/\[hide=(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", + function ($matches) use ($pdateline) { + return expirehide($matches[1], $matches[2], $matches[3], intval($pdateline)); + }, + $message + ); + $msglower = strtolower($message); + } + if(strpos($msglower, '[hide]') !== FALSE) { + if($authorreplyexist === null) { + if(!$_G['forum']['ismoderator']) { + if($_G['uid']) { + $authorreplyexist = C::t('forum_post')->fetch_pid_by_tid_authorid($_G['tid'], $_G['uid']); + } + } else { + $authorreplyexist = TRUE; + } + } + if($authorreplyexist) { + $message = preg_replace("/\[hide\]\s*(.*?)\s*\[\/hide\]/is", mobile_hide_reply(), $message); + } else { + $message = preg_replace("/\[hide\](.*?)\[\/hide\]/is", mobile_hide_reply_hidden(), $message); + } + } + if(strpos($msglower, '[hide=') !== FALSE) { + $message = preg_replace_callback( + "/\[hide=(\d+)\]\s*(.*?)\s*\[\/hide\]/is", + function ($matches) use ($pid, $authorid) { + return creditshide($matches[1], $matches[2], intval($pid), intval($authorid)); + }, + $message + ); + } + } + } + + if(strpos($message, '[/tthread]') !== FALSE) { + $matches = array(); + preg_match('/\[tthread=(.+?),(.+?)\](.*?)\[\/tthread\]/', $message, $matches); + $message = preg_replace('/\[tthread=(.+?)\](.*?)\[\/tthread\]/', lang('plugin/qqconnect', 'connect_tthread_message', array('username' => $matches[1], 'nick' => $matches[2])), $message); + } + + if(!$bbcodeoff) { + if($parsetype != 1 && strpos($msglower, '[swf]') !== FALSE) { + $message = preg_replace_callback("/\[swf\]\s*([^\[\<\r\n]+?)\s*\[\/swf\]/is", 'mobile_discuzcode_callback_bbcodeurl_1', $message); + } + + $attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src'; + if(strpos($msglower, '[/img]') !== FALSE) { + $message = preg_replace_callback( + "/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", + function ($matches) use ($allowimgcode, $lazyload, $pid, $allowbbcode) { + if ($allowimgcode) { + return mobile_parseimg(0, 0, $matches[1], intval($lazyload), intval($pid), 'onmouseover="img_onmouseoverfunc(this)" '.(intval($lazyload) ? 'lazyloadthumb="1"' : 'onload="thumbImg(this)"')); + } + return (intval($allowbbcode) ? (!defined('IN_MOBILE') ? bbcodeurl($matches[1], '{url}') : bbcodeurl($matches[1], '')) : bbcodeurl($matches[1], '{url}')); + }, + $message + ); + $message = preg_replace_callback( + "/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", + function($matches) use ($allowimgcode, $lazyload, $pid, $allowbbcode) { + if (intval($allowimgcode)) { + mobile_parseimg($matches[1], $matches[2], $matches[3], intval($lazyload), intval($pid)); + } + return (intval($allowbbcode) ? (!defined('IN_MOBILE') ? bbcodeurl($matches[3], '{url}') : bbcodeurl($matches[3], '')) : bbcodeurl($matches[3], '{url}')); + }, + $message + ); + } + } + + for($i = 0; $i <= $_G['forum_discuzcode']['pcodecount']; $i++) { + $message = str_replace("[\tDISCUZ_CODE_$i\t]", $_G['forum_discuzcode']['codehtml'][$i], $message); + } + + unset($msglower); + $message = preg_replace("/(\[groupid=\d+\].*\[\/groupid\])/i", '', $message); + $message = preg_replace("/(\r\n|\n|\r){3,}/i", "\\1\\1\\1", $message); + return $message; +} + +function mobile_discuzcode_callback_mobile_parsecode_1($matches) { + return mobile_parsecode($matches[1]); +} + +function mobile_discuzcode_callback_parseattachurl_12($matches) { + return parseattachurl($matches[1], $matches[2], 1); +} + +function mobile_discuzcode_callback_mobile_parseed2k_1($matches) { + return mobile_parseed2k($matches[1]); +} + +function mobile_discuzcode_callback_mobile_parseurl_152($matches) { + return mobile_parseurl($matches[1], $matches[5], $matches[2]); +} + +function mobile_discuzcode_callback_mobile_parseemail_14($matches) { + return strip_tags(parseemail($matches[1], $matches[4])); +} + +function mobile_discuzcode_callback_mobile_parsetable_123($matches) { + return mobile_parsetable($matches[1], $matches[2], $matches[3]); +} + +function mobile_discuzcode_callback_bbcodeurl_media2($matches) { + return bbcodeurl($matches[2], '{url}'); +} + +function mobile_discuzcode_callback_bbcodeurl_href2($matches) { + return bbcodeurl($matches[2], '{url}'); +} + +function mobile_discuzcode_callback_bbcodeurl_4($matches) { + return bbcodeurl($matches[4], '{url}'); +} + +function mobile_discuzcode_callback_bbcodeurl_1($matches) { + return bbcodeurl($matches[1], ' Flash: {url} '); +} + +function mobile_parseurl($url, $text, $scheme) { + global $_G; + if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) { + $url = $matches[0]; + $length = 65; + if(strlen($url) > $length) { + $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3)); + } + $url = substr(strtolower($url), 0, 4) == 'www.' ? 'http://'.$url : $url; + return ''.$text.''; + } else { + $url = substr($url, 1); + if(substr(strtolower($url), 0, 4) == 'www.') { + $url = 'http://'.$url; + } + $url = !$scheme ? $_G['siteurl'].$url : $url; + return ''.$text.''; + } +} + +function mobile_parsecode($code) { + global $_G; + $_G['forum_discuzcode']['pcodecount']++; + $code = dhtmlspecialchars(str_replace('\\"', '"', $code)); + $code = str_replace("\n", "

              • ", $code); + $_G['forum_discuzcode']['codehtml'][$_G['forum_discuzcode']['pcodecount']] = mobile_codedisp($code); + $_G['forum_discuzcode']['codecount']++; + return "[\tDISCUZ_CODE_".$_G['forum_discuzcode']['pcodecount']."\t]"; +} + +function mobile_parseimg($width, $height, $url) { + global $_G; + $url = htmlspecialchars(str_replace(array('<', '>'), '', str_replace('\\"', '\"', $url))); + if(strtolower(substr($url, 0, 7)) == 'static/') { + $url = $_G['siteurl'].$url; + } + if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://'))) { + $url = 'http://'.$url; + } + $extra = ($width > 0 ? 'width="'.$width.'" ' : '').($height > 0 ? 'height="'.$height.'" ' : ''); + return mobile_image($url, $extra); +} + +function mobile_parsesmiles(&$message) { + global $_G; + static $enablesmiles; + if($enablesmiles === null) { + $url = !in_array(strtolower(substr(STATICURL, 0, 6)), array('http:/', 'https:', 'ftp://')) ? $_G['siteurl'] : ''; + $enablesmiles = false; + if(!empty($_G['cache']['smilies']) && is_array($_G['cache']['smilies'])) { + foreach($_G['cache']['smilies']['replacearray'] AS $key => $smiley) { + $enablesmiles[$key] = ''; + } + } + } + $enablesmiles && $message = preg_replace($_G['cache']['smilies']['searcharray'], $enablesmiles, $message, $_G['setting']['maxsmilies']); + return $message; +} + +function mobile_parsetable($width, $bgcolor, $message) { + if(strpos($message, '[/tr]') === FALSE && strpos($message, '[/td]') === FALSE) { + $rows = explode("\n", $message); + $s = '
                  '; + foreach($rows as $row) { + $s .= '
                • '.str_replace(array('\|', '|', '\n'), array('|', '
                • ', "\n"), $row).'
                • '; + } + $s .= '
                '; + return $s; + } else { + if(!preg_match("/^\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td([=\d,%]+)?\]/", $message) && !preg_match("/^]*?>\s*]*?>/", $message)) { + return str_replace('\\"', '"', preg_replace("/\[tr(?:=([\(\)\s%,#\w]+))?\]|\[td([=\d,%]+)?\]|\[\/td\]|\[\/tr\]/", '', $message)); + } + $message = preg_replace_callback("/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,4}%?))?\]/i", 'mobile_parsetable_callback_mobile_parsetrtd_12', $message); + $message = preg_replace_callback("/\[\/td\]\s*\[td(?:=(\d{1,4}%?))?\]/i", 'mobile_parsetable_callback_mobile_parsetrtd_1', $message); + $message = preg_replace_callback("/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/i", 'mobile_parsetable_callback_mobile_parsetrtd_1234', $message); + $message = preg_replace_callback("/\[\/td\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/i", 'mobile_parsetable_callback_mobile_parsetrtd_123', $message); + return '' : '>'). + str_replace('\\"', '"', preg_replace("/\[\/td\]\s*\[\/tr\]\s*/i", '', $message) + ).'
                '; + } +} + +function mobile_parsetable_callback_mobile_parsetrtd_12($matches) { + return mobile_parsetrtd($matches[1], 0, 0, $matches[2]); +} + +function mobile_parsetable_callback_mobile_parsetrtd_1($matches) { + return mobile_parsetrtd('td', 0, 0, $matches[1]); +} + +function mobile_parsetable_callback_mobile_parsetrtd_1234($matches) { + return mobile_parsetrtd($matches[1], $matches[2], $matches[3], $matches[4]); +} + +function mobile_parsetable_callback_mobile_parsetrtd_123($matches) { + return mobile_parsetrtd('td', $matches[1], $matches[2], $matches[3]); +} + +function mobile_parsetrtd($bgcolor, $colspan, $rowspan, $width) { + return ($bgcolor == 'td' ? '' : '').''; +} + +function mobile_parseed2k($url) { + global $_G; + list(,$type, $name, $size,) = explode('|', $url); + $name = addslashes($name); + if($type == 'file') { + return ''.$name.' ('.sizecount($size).')'; + } else { + return ''.$url.''; + } +} + +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/index.htm b/source/plugin/mobile/extends/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/plugin/mobile/extends/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/plugin/mobile/extends/mobile_extends_check.php b/source/plugin/mobile/extends/mobile_extends_check.php new file mode 100644 index 0000000..e16fbe5 --- /dev/null +++ b/source/plugin/mobile/extends/mobile_extends_check.php @@ -0,0 +1,64 @@ + array( + 'extendversion' => '1', + 'extendlist' => array( + array( + 'identifier' => 'dz_newthread', + 'name' => lang('plugin/mobile', 'mobile_extend_newthread'), + 'icon' => '0', + 'islogin' => '0', + 'iconright' => '0', + 'redirect' => '', + ), + array( + 'identifier' => 'dz_newreply', + 'name' => lang('plugin/mobile', 'mobile_extend_newreply'), + 'icon' => '0', + 'islogin' => '0', + 'iconright' => '0', + 'redirect' => '', + ), + array( + 'identifier' => 'dz_digest', + 'name' => lang('plugin/mobile', 'mobile_extend_digest'), + 'icon' => '0', + 'islogin' => '0', + 'iconright' => '0', + 'redirect' => '', + ), + array( + 'identifier' => 'dz_newpic', + 'name' => lang('plugin/mobile', 'mobile_extend_newpic'), + 'icon' => '0', + 'islogin' => '0', + 'iconright' => '0', + 'redirect' => '', + ), + ), + ) + ); + } + + public static function output() { + mobile_core::result(mobile_core::variable(self::$variable)); + } +} +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/mobile_extends_data.php b/source/plugin/mobile/extends/mobile_extends_data.php new file mode 100644 index 0000000..d79498c --- /dev/null +++ b/source/plugin/mobile/extends/mobile_extends_data.php @@ -0,0 +1,56 @@ + self::$id, + 'title' => self::$title, + 'image' => self::$image, + 'icon' => self::$icon, + 'poptype' => self::$poptype, + 'popvalue' => self::$popvalue, + 'clicktype' => self::$clicktype, + 'clickvalue' => self::$clickvalue, + 'fields' => self::$field, + ); + self::$field = array(); + } + + public static function field($id, $icon, $value) { + self::$field[] = array('id' => $id, 'icon' => $icon, 'value' => $value); + } + + public static function output() { + return array( + __CLASS__ => array('page' => self::$page, 'perpage' => self::$perpage, 'list' => self::$list) + ); + } +} +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/mobile_extends_list.php b/source/plugin/mobile/extends/mobile_extends_list.php new file mode 100644 index 0000000..1035d82 --- /dev/null +++ b/source/plugin/mobile/extends/mobile_extends_list.php @@ -0,0 +1,48 @@ + 'identifier_not_exists')); + } + include_once 'source/plugin/mobile/extends/mobile_extends_data.php'; + $extendsfilename = "./source/plugin/mobile/extends/module/".$_GET['identifier'].".php"; + if(empty($_GET['identifier'])) { + mobile_core::result(array('error' => 'identifier_not_exists')); + } else if(!file_exists($extendsfilename)) { + mobile_core::result(array('error' => 'identifier_file_not_exists')); + } else { + require_once $extendsfilename; + if(!class_exists($_GET['identifier'])) { + mobile_core::result(array('error' => 'identifier_file_not_exists')); + } + self::$extendsclass = new $_GET['identifier']; + if(method_exists(self::$extendsclass, 'common')) { + self::$extendsclass->common(); + } + } + + } + + public static function output() { + $variable = self::$extendsclass->output(); + mobile_core::result(mobile_core::variable($variable)); + } +} + +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/module/dz_digest.php b/source/plugin/mobile/extends/module/dz_digest.php new file mode 100644 index 0000000..fda7e30 --- /dev/null +++ b/source/plugin/mobile/extends/module/dz_digest.php @@ -0,0 +1,85 @@ +fetch_max_tid(); + $limittid = max(0,($maxtid - $maxnum)); + $tids = array_slice($_G['cache']['forum_guide']['digest']['data'], $start ,$num); + $query = C::t('forum_thread')->fetch_all_for_guide('digest', $limittid, $tids, $_G['setting']['heatthread']['guidelimit'], $dateline); + + $fids = array(); + loadcache('forums'); + foreach($_G['cache']['forums'] as $fid => $forum) { + if($forum['type'] != 'group' && $forum['status'] > 0 && (!$forum['viewperm'] && $_G['group']['readaccess']) || ($forum['viewperm'] && forumperm($forum['viewperm']))) { + $fids[] = $fid; + } + } + $list = array(); + $n = 0; + foreach($query as $thread) { + if(empty($tids) && ($thread['isgroup'] || !in_array($thread['fid'], $fids))) { + continue; + } + if($thread['displayorder'] < 0) { + continue; + } + if($tids || ($n >= $start && $n < ($start + $num))) { + $list[$thread['tid']] = $thread; + } + $n ++; + } + $threadlist = array(); + if($tids) { + foreach($tids as $key => $tid) { + if($list[$tid]) { + $threadlist[$key] = $list[$tid]; + } + } + } else { + $threadlist = $list; + } + unset($list); + + foreach($threadlist as $thread) { + self::field('author', '0', $thread['author']); + self::field('dateline', '0', $thread['dateline']); + self::field('replies', '1', $thread['replies']); + self::field('views', '2', $thread['views']); + self::$id = $thread['tid']; + self::$title = $thread['subject']; + self::$image = ''; + self::$icon = '1'; + self::$poptype = '0'; + self::$popvalue = ''; + self::$clicktype = 'tid'; + self::$clickvalue = $thread['tid']; + + self::insertrow(); + } + } +} +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/module/dz_newpic.php b/source/plugin/mobile/extends/module/dz_newpic.php new file mode 100644 index 0000000..dfa276d --- /dev/null +++ b/source/plugin/mobile/extends/module/dz_newpic.php @@ -0,0 +1,129 @@ +fetch_max_tid(); + $limittid = max(0,($maxtid - $maxnum)); + + self::$page = intval($_GET['page']) ? intval($_GET['page']) : 1; + $start = (self::$page - 1)*self::$perpage; + $num = self::$perpage; + + if($_G['cache']['mobile_pnewpic'] && (TIMESTAMP - $_G['cache']['mobile_pnewpic']['cachetime']) < 900) { + $tids = array_slice($_G['cache']['mobile_pnewpic']['data'], $start ,$num); + if(empty($tids)) { + return; + } + } else { + $tids = array(); + } + + $tsql = $addsql = ''; + $updatecache = false; + $fids = array(); + if($_G['setting']['followforumid']) { + $addsql .= ' AND '.DB::field('fid', $_G['setting']['followforumid'], '<>'); + } + if($tids) { + $tids = dintval($tids, true); + $tidsql = DB::field('tid', $tids); + } else { + $tidsql = 'tid>'.intval($limittid); + $addsql .= ' AND attachment=2 AND displayorder>=0 ORDER BY tid DESC LIMIT 600'; + $tids = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + if($forum['type'] != 'group' && $forum['status'] > 0 && (!$forum['viewperm'] && $_G['group']['readaccess']) || ($forum['viewperm'] && forumperm($forum['viewperm']))) { + $fids[] = $fid; + } + } + if(empty($fids)) { + return ; + } + $updatecache = true; + } + + $list = $threadids = array(); + $n = 0; + $query = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE ".$tidsql.$addsql); + while($thread = DB::fetch($query)) { + if(empty($tids) && ($thread['isgroup'] || !in_array($thread['fid'], $fids))) { + continue; + } + if($thread['displayorder'] < 0) { + continue; + } + $threadids[] = $thread['tid']; + if($tids || ($n >= $start && $n < ($start + $num))) { + $list[$thread['tid']] = $thread; + } + $n ++; + } + $threadlist = array(); + if($tids) { + foreach($tids as $key => $tid) { + if($list[$tid]) { + $threadlist[$tid] = $list[$tid]; + } + } + } else { + $threadlist = $list; + } + unset($list); + + $images = array(); + if($threadlist) { + $query = DB::query("SELECT * FROM ".DB::table('forum_threadimage')." WHERE ".DB::field('tid', array_keys($threadlist))); + while($image = DB::fetch($query)) { + if($image['remote']) { + $img = $_G['setting']['ftp']['attachurl'].'forum/'.$image['attachment']; + } else { + $img = $_G['setting']['attachurl'].'forum/'.$image['attachment']; + } + $images[$image['tid']] = $img; + } + } + + if($updatecache) { + $data = array('cachetime' => TIMESTAMP, 'data' => $threadids); + $_G['cache']['mobile_pnewpic'] = $data; + savecache('mobile_pnewpic', $_G['cache']['mobile_pnewpic']); + } + + foreach($threadlist as $thread) { + self::field('author', '0', $thread['author']); + self::field('dateline', '0', $thread['dateline']); + self::field('replies', '1', $thread['replies']); + self::field('views', '2', $thread['views']); + self::$id = $thread['tid']; + self::$title = $thread['subject']; + self::$image = $images[$thread['tid']] ? $images[$thread['tid']] : STATICURL.'image/common/nophoto.gif'; + self::$icon = '1'; + self::$poptype = '0'; + self::$popvalue = ''; + self::$clicktype = 'tid'; + self::$clickvalue = $thread['tid']; + + self::insertrow(); + } + } +} +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/module/dz_newreply.php b/source/plugin/mobile/extends/module/dz_newreply.php new file mode 100644 index 0000000..b133df5 --- /dev/null +++ b/source/plugin/mobile/extends/module/dz_newreply.php @@ -0,0 +1,85 @@ +fetch_max_tid(); + $limittid = max(0,($maxtid - $maxnum)); + $tids = array_slice($_G['cache']['forum_guide']['new']['data'], $start ,$num); + $query = C::t('forum_thread')->fetch_all_for_guide('new', $limittid, $tids, $_G['setting']['heatthread']['guidelimit'], $dateline); + + $fids = array(); + loadcache('forums'); + foreach($_G['cache']['forums'] as $fid => $forum) { + if($forum['type'] != 'group' && $forum['status'] > 0 && (!$forum['viewperm'] && $_G['group']['readaccess']) || ($forum['viewperm'] && forumperm($forum['viewperm']))) { + $fids[] = $fid; + } + } + $list = array(); + $n = 0; + foreach($query as $thread) { + if(empty($tids) && ($thread['isgroup'] || !in_array($thread['fid'], $fids))) { + continue; + } + if($thread['displayorder'] < 0) { + continue; + } + if($tids || ($n >= $start && $n < ($start + $num))) { + $list[$thread['tid']] = $thread; + } + $n ++; + } + $threadlist = array(); + if($tids) { + foreach($tids as $key => $tid) { + if($list[$tid]) { + $threadlist[$key] = $list[$tid]; + } + } + } else { + $threadlist = $list; + } + unset($list); + + foreach($threadlist as $thread) { + self::field('author', '0', $thread['author']); + self::field('dateline', '0', $thread['dateline']); + self::field('replies', '1', $thread['replies']); + self::field('views', '2', $thread['views']); + self::$id = $thread['tid']; + self::$title = $thread['subject']; + self::$image = ''; + self::$icon = '1'; + self::$poptype = '0'; + self::$popvalue = ''; + self::$clicktype = 'tid'; + self::$clickvalue = $thread['tid']; + + self::insertrow(); + } + } +} +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/module/dz_newthread.php b/source/plugin/mobile/extends/module/dz_newthread.php new file mode 100644 index 0000000..ffefe76 --- /dev/null +++ b/source/plugin/mobile/extends/module/dz_newthread.php @@ -0,0 +1,118 @@ +fetch_max_tid(); + $limittid = max(0,($maxtid - $maxnum)); + + self::$page = intval($_GET['page']) ? intval($_GET['page']) : 1; + $start = (self::$page - 1)*self::$perpage; + $num = self::$perpage; + + if($_G['cache']['mobile_pnewthread'] && (TIMESTAMP - $_G['cache']['mobile_pnewthread']['cachetime']) < 900) { + $tids = array_slice($_G['cache']['mobile_pnewthread']['data'], $start ,$num); + if(empty($tids)) { + return; + } + } else { + $tids = array(); + } + + $tsql = $addsql = ''; + $updatecache = false; + $fids = array(); + if($_G['setting']['followforumid']) { + $addsql .= ' AND '.DB::field('fid', $_G['setting']['followforumid'], '<>'); + } + if($tids) { + $tids = dintval($tids, true); + $tidsql = DB::field('tid', $tids); + } else { + $tidsql = 'tid>'.intval($limittid); + $addsql .= ' AND displayorder>=0 ORDER BY tid DESC LIMIT 600'; + $tids = array(); + foreach($_G['cache']['forums'] as $fid => $forum) { + if($forum['type'] != 'group' && $forum['status'] > 0 && (!$forum['viewperm'] && $_G['group']['readaccess']) || ($forum['viewperm'] && forumperm($forum['viewperm']))) { + $fids[] = $fid; + } + } + if(empty($fids)) { + return ; + } + $updatecache = true; + } + + $list = $threadids = array(); + $n = 0; + $query = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE ".$tidsql.$addsql); + while($thread = DB::fetch($query)) { + if(empty($tids) && ($thread['isgroup'] || !in_array($thread['fid'], $fids))) { + continue; + } + if($thread['displayorder'] < 0) { + continue; + } + $threadids[] = $thread['tid']; + if($tids || ($n >= $start && $n < ($start + $num))) { + $list[$thread['tid']] = $thread; + } + $n ++; + } + $threadlist = array(); + if($tids) { + foreach($tids as $key => $tid) { + if($list[$tid]) { + $threadlist[$key] = $list[$tid]; + } + } + } else { + $threadlist = $list; + } + unset($list); + + if($updatecache) { + $data = array('cachetime' => TIMESTAMP, 'data' => $threadids); + $_G['cache']['mobile_pnewthread'] = $data; + savecache('mobile_pnewthread', $_G['cache']['mobile_pnewthread']); + } + + foreach($threadlist as $thread) { + self::field('author', '0', $thread['author']); + self::field('dateline', '0', $thread['dateline']); + self::field('replies', '1', $thread['replies']); + self::field('views', '2', $thread['views']); + self::$id = $thread['tid']; + self::$title = $thread['subject']; + self::$image = ''; + self::$icon = '1'; + self::$poptype = '0'; + self::$popvalue = ''; + self::$clicktype = 'tid'; + self::$clickvalue = $thread['tid']; + + self::insertrow(); + + } + } + +} +?> \ No newline at end of file diff --git a/source/plugin/mobile/extends/module/index.htm b/source/plugin/mobile/extends/module/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/plugin/mobile/extends/module/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/plugin/mobile/index.htm b/source/plugin/mobile/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/mobile/install.php b/source/plugin/mobile/install.php new file mode 100644 index 0000000..01a39d6 --- /dev/null +++ b/source/plugin/mobile/install.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/source/plugin/mobile/json.class.php b/source/plugin/mobile/json.class.php new file mode 100644 index 0000000..6fcb2a7 --- /dev/null +++ b/source/plugin/mobile/json.class.php @@ -0,0 +1,452 @@ += 0x20) && ($ord_var_c <= 0x7F)): + $ascii .= $var[$c]; + break; + + case (($ord_var_c & 0xE0) == 0xC0): + $char = pack('C*', $ord_var_c, ord($var[$c+1])); + $c+=1; + $utf16 = self::utf8ToUTF16BE($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF0) == 0xE0): + $char = pack('C*', $ord_var_c, + ord($var[$c+1]), + ord($var[$c+2])); + $c+=2; + $utf16 = self::utf8ToUTF16BE($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF8) == 0xF0): + $char = pack('C*', $ord_var_c, + ord($var[$c+1]), + ord($var[$c+2]), + ord($var[$c+3])); + $c+=3; + $utf16 = self::utf8ToUTF16BE($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFC) == 0xF8): + $char = pack('C*', $ord_var_c, + ord($var[$c+1]), + ord($var[$c+2]), + ord($var[$c+3]), + ord($var[$c+4])); + $c+=4; + $utf16 = self::utf8ToUTF16BE($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFE) == 0xFC): + $char = pack('C*', $ord_var_c, + ord($var[$c+1]), + ord($var[$c+2]), + ord($var[$c+3]), + ord($var[$c+4]), + ord($var[$c+5])); + $c+=5; + $utf16 = self::utf8ToUTF16BE($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + } + } + + return '"'.$ascii.'"'; + + case 'array': + if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { + return '{' . + join(',', array_map(array('CJSON', 'nameValue'), + array_keys($var), + array_values($var))) + . '}'; + } + + return '[' . join(',', array_map(array('CJSON', 'encode'), $var)) . ']'; + case 'object': + if ($var instanceof Traversable) + { + $vars = array(); + foreach ($var as $k=>$v) + $vars[$k] = $v; + } + else + $vars = get_object_vars($var); + return '{' . + join(',', array_map(array('CJSON', 'nameValue'), + array_keys($vars), + array_values($vars))) + . '}'; + + default: + return ''; + } + } + + static function nameValue($name, $value) { + return self::encode(strval($name)) . ':' . self::encode($value); + } + + static function reduceString($str) { + $str = preg_replace(array( + + '#^\s*//(.+)$#m', + + '#^\s*/\*(.+)\*/#Us', + + '#/\*(.+)\*/\s*$#Us' + + ), '', $str); + + return trim($str); + } + + static function decode($str, $useArray=true) { + if(function_exists('json_decode')) { + return json_decode($str, $useArray); + } + + $str = self::reduceString($str); + + switch (strtolower($str)) { + case 'true': + return true; + + case 'false': + return false; + + case 'null': + return null; + + default: + if (is_numeric($str)) { + return ((float)$str == (integer)$str) + ? (integer)$str + : (float)$str; + + } elseif (preg_match('/^("|\').+(\1)$/s', $str, $m) && $m[1] == $m[2]) { + + $delim = substr($str, 0, 1); + $chrs = substr($str, 1, -1); + $utf8 = ''; + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c < $strlen_chrs; ++$c) { + + $substr_chrs_c_2 = substr($chrs, $c, 2); + $ord_chrs_c = ord($chrs[$c]); + + switch (true) { + case $substr_chrs_c_2 == '\b': + $utf8 .= chr(0x08); + ++$c; + break; + case $substr_chrs_c_2 == '\t': + $utf8 .= chr(0x09); + ++$c; + break; + case $substr_chrs_c_2 == '\n': + $utf8 .= chr(0x0A); + ++$c; + break; + case $substr_chrs_c_2 == '\f': + $utf8 .= chr(0x0C); + ++$c; + break; + case $substr_chrs_c_2 == '\r': + $utf8 .= chr(0x0D); + ++$c; + break; + + case $substr_chrs_c_2 == '\\"': + case $substr_chrs_c_2 == '\\\'': + case $substr_chrs_c_2 == '\\\\': + case $substr_chrs_c_2 == '\\/': + if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || + ($delim == "'" && $substr_chrs_c_2 != '\\"')) { + $utf8 .= $chrs[++$c]; + } + break; + + case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): + $utf16 = chr(hexdec(substr($chrs, ($c+2), 2))) + . chr(hexdec(substr($chrs, ($c+4), 2))); + $utf8 .= self::utf16beToUTF8($utf16); + $c+=5; + break; + + case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): + $utf8 .= $chrs[$c]; + break; + + case ($ord_chrs_c & 0xE0) == 0xC0: + $utf8 .= substr($chrs, $c, 2); + ++$c; + break; + + case ($ord_chrs_c & 0xF0) == 0xE0: + $utf8 .= substr($chrs, $c, 3); + $c += 2; + break; + + case ($ord_chrs_c & 0xF8) == 0xF0: + $utf8 .= substr($chrs, $c, 4); + $c += 3; + break; + + case ($ord_chrs_c & 0xFC) == 0xF8: + $utf8 .= substr($chrs, $c, 5); + $c += 4; + break; + + case ($ord_chrs_c & 0xFE) == 0xFC: + $utf8 .= substr($chrs, $c, 6); + $c += 5; + break; + + } + + } + + return $utf8; + + } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { + + if ($str[0] == '[') { + $stk = array(self::JSON_IN_ARR); + $arr = array(); + } else { + if ($useArray) { + $stk = array(self::JSON_IN_OBJ); + $obj = array(); + } else { + $stk = array(self::JSON_IN_OBJ); + $obj = new stdClass(); + } + } + + array_push($stk, array('what' => self::JSON_SLICE, + 'where' => 0, + 'delim' => false)); + + $chrs = substr($str, 1, -1); + $chrs = self::reduceString($chrs); + + if ($chrs == '') { + if (reset($stk) == self::JSON_IN_ARR) { + return $arr; + + } else { + return $obj; + + } + } + + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c <= $strlen_chrs; ++$c) { + + $top = end($stk); + $substr_chrs_c_2 = substr($chrs, $c, 2); + + if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == self::JSON_SLICE))) { + + $slice = substr($chrs, $top['where'], ($c - $top['where'])); + array_push($stk, array('what' => self::JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); + if (reset($stk) == self::JSON_IN_ARR) { + array_push($arr, self::decode($slice,$useArray)); + + } elseif (reset($stk) == self::JSON_IN_OBJ) { + if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + $key = self::decode($parts[1],$useArray); + $val = self::decode($parts[2],$useArray); + + if ($useArray) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + $key = $parts[1]; + $val = self::decode($parts[2],$useArray); + + if ($useArray) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } + + } + + } elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != self::JSON_IN_STR)) { + array_push($stk, array('what' => self::JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c])); + } elseif (($chrs[$c] == $top['delim']) && + ($top['what'] == self::JSON_IN_STR) && + (($chrs[$c - 1] != "\\") || + ($chrs[$c - 1] == "\\" && $chrs[$c - 2] == "\\"))) { + array_pop($stk); + } elseif (($chrs[$c] == '[') && + in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) { + array_push($stk, array('what' => self::JSON_IN_ARR, 'where' => $c, 'delim' => false)); + } elseif (($chrs[$c] == ']') && ($top['what'] == self::JSON_IN_ARR)) { + array_pop($stk); + } elseif (($chrs[$c] == '{') && + in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) { + array_push($stk, array('what' => self::JSON_IN_OBJ, 'where' => $c, 'delim' => false)); + } elseif (($chrs[$c] == '}') && ($top['what'] == self::JSON_IN_OBJ)) { + array_pop($stk); + } elseif (($substr_chrs_c_2 == '/**') && + in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) { + array_push($stk, array('what' => self::JSON_IN_CMT, 'where' => $c, 'delim' => false)); + $c++; + } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == self::JSON_IN_CMT)) { + array_pop($stk); + $c++; + for ($i = $top['where']; $i <= $c; ++$i) { + $chrs = substr_replace($chrs, ' ', $i, 1); + } + } + + } + + if (reset($stk) == self::JSON_IN_ARR) { + return $arr; + + } elseif (reset($stk) == self::JSON_IN_OBJ) { + return $obj; + + } + + } + } + } + + + static function utf8ToUnicode( &$str ) { + $unicode = array(); + $values = array(); + $lookingFor = 1; + + for ($i = 0; $i < strlen( $str ); $i++ ) { + $thisValue = ord( $str[ $i ] ); + if ( $thisValue < 128 ) { + $unicode[] = $thisValue; + } else { + if ( count( $values ) == 0 ) { + $lookingFor = ( $thisValue < 224 ) ? 2 : 3; + } + $values[] = $thisValue; + if ( count( $values ) == $lookingFor ) { + $number = ( $lookingFor == 3 ) ? + ( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ): + ( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 ); + $unicode[] = $number; + $values = array(); + $lookingFor = 1; + } + } + } + return $unicode; + } + + static function unicodeToUTF8( &$str ) + { + $utf8 = ''; + foreach( $str as $unicode ) + { + if ( $unicode < 128 ) + { + $utf8.= chr( $unicode ); + } + elseif ( $unicode < 2048 ) + { + $utf8.= chr( 192 + ( ( $unicode - ( $unicode % 64 ) ) / 64 ) ); + $utf8.= chr( 128 + ( $unicode % 64 ) ); + } + else + { + $utf8.= chr( 224 + ( ( $unicode - ( $unicode % 4096 ) ) / 4096 ) ); + $utf8.= chr( 128 + ( ( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ) ); + $utf8.= chr( 128 + ( $unicode % 64 ) ); + } + } + return $utf8; + } + + static function utf8ToUTF16BE(&$str, $bom = false) { + $out = $bom ? "\xFE\xFF" : ''; + if(function_exists('mb_convert_encoding')) + return $out.mb_convert_encoding($str,'UTF-16BE','UTF-8'); + + $uni = self::utf8ToUnicode($str); + foreach($uni as $cp) + $out .= pack('n',$cp); + return $out; + } + + static function utf16beToUTF8(&$str) { + $uni = unpack('n*',$str); + return self::unicodeToUTF8($uni); + } +} \ No newline at end of file diff --git a/source/plugin/mobile/mobile.class.php b/source/plugin/mobile/mobile.class.php new file mode 100644 index 0000000..106b886 --- /dev/null +++ b/source/plugin/mobile/mobile.class.php @@ -0,0 +1,474 @@ + $_v) { + $result[$_k] = mobile_core::format($_v); + } + break; + case 'boolean': + case 'integer': + case 'double': + case 'float': + $result = (string)$result; + break; + } + return $result; + } + + public static function json($encode) { + if(!empty($_GET['debug']) && defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) { + return debug($encode); + } + require_once 'source/plugin/mobile/json.class.php'; + return CJSON::encode($encode); + } + + public static function getvalues($variables, $keys, $subkeys = array()) { + $return = array(); + foreach($variables as $key => $value) { + foreach($keys as $k) { + if($k[0] == '/' && preg_match($k, $key) || $key == $k) { + if($subkeys) { + $return[$key] = mobile_core::getvalues($value, $subkeys); + } else { + if(!empty($value) || !empty($_GET['debug']) || (is_numeric($value) && intval($value) === 0 )) { + $return[$key] = is_array($value) ? mobile_core::arraystring($value) : (string)$value; + } + } + } + } + } + return $return; + } + + static function arraystring($array) { + foreach($array as $k => $v) { + $array[$k] = is_array($v) ? mobile_core::arraystring($v) : (string)$v; + } + return $array; + } + + static function variable($variables = array()) { + global $_G; + if(in_array('mobileoem', $_G['setting']['plugins']['available'])) { + $check = C::t('#mobileoem#mobileoem_member')->fetch($_G['uid']); + } + $globals = array( + 'cookiepre' => $_G['config']['cookie']['cookiepre'], + 'auth' => $_G['cookie']['auth'], + 'saltkey' => $_G['cookie']['saltkey'], + 'member_uid' => $_G['member']['uid'], + 'member_username' => $_G['member']['username'], + 'member_avatar' => avatar($_G['member']['uid'], 'small', true), + 'groupid' => $_G['groupid'], + 'formhash' => FORMHASH, + 'ismoderator' => $_G['forum']['ismoderator'], + 'readaccess' => $_G['group']['readaccess'], + 'notice' => array( + 'newpush' => $check['newpush'] ? 1 : 0, + 'newpm' => dintval($_G['member']['newpm']), + 'newprompt' => dintval(($_G['member']['newprompt'] - $_G['member']['category_num']['mypost']) >= 0 ? ($_G['member']['newprompt'] - $_G['member']['category_num']['mypost']) : 0), + 'newmypost' => dintval($_G['member']['category_num']['mypost']), + ) + ); + if(!empty($_GET['submodule']) == 'checkpost') { + $apifile = 'source/plugin/mobile/api/'.$_GET['version'].'/sub_checkpost.php'; + if(file_exists($apifile)) { + require_once $apifile; + $globals = $globals + mobile_api_sub::getvariable(); + } + } + $pluginvariables = array(); + if(!empty($_G['setting']['mobileapihook'])) { + $mobileapihook = dunserialize($_G['setting']['mobileapihook']); + if(!empty($mobileapihook[$_GET['module']])) { + if(!empty($mobileapihook[$_GET['module']]['variables'])) { + mobile_core::activeHook($_GET['module'], $mobileapihook, $variables, true); + unset($mobileapihook[$_GET['module']]['variables']); + } + if(!empty($mobileapihook[$_GET['module']])) { + $param = array(); + $pluginvariables = mobile_core::activeHook($_GET['module'], $mobileapihook, $param); + } + } + } + $xml = array( + 'Version' => $_GET['version'], + 'Charset' => strtoupper($_G['charset']), + 'Variables' => array_merge($globals, $variables), + ); + if($pluginvariables) { + $xml['pluginVariables'] = $pluginvariables; + } + if(!empty($_G['messageparam'])) { + $message_result = lang('plugin/mobile', $_G['messageparam'][0], $_G['messageparam'][2]); + if($message_result == $_G['messageparam'][0]) { + $vars = explode(':', $_G['messageparam'][0]); + if (count($vars) == 2) { + $message_result = lang('plugin/' . $vars[0], $vars[1], $_G['messageparam'][2]); + $_G['messageparam'][0] = $vars[1]; + } else { + $message_result = lang('message', $_G['messageparam'][0], $_G['messageparam'][2]); + } + } + $message_result = strip_tags($message_result); + + if(defined('IS_WEBVIEW') && IS_WEBVIEW && in_array('mobileoem', $_G['setting']['plugins']['available'])) { + include_once DISCUZ_ROOT.'./source/plugin/mobileoem/discuzcode.func.php'; + include mobileoem_template('common/showmessage'); + if(!empty($_GET['debug'])) { + exit; + } + $content = ob_get_contents(); + ob_end_clean(); + $xml['Variables']['datatype'] = -1; + $xml['Variables']['webview_page'] = $content; + return $xml; + } + + if($_G['messageparam'][4]) { + $_G['messageparam'][0] = "custom"; + } + if ($_G['messageparam'][3]['login'] && !$_G['uid']) { + $_G['messageparam'][0] .= '//' . $_G['messageparam'][3]['login']; + } + $xml['Message'] = array("messageval" => $_G['messageparam'][0], "messagestr" => $message_result); + if($_GET['mobilemessage']) { + $return = mobile_core::json($xml); + header("HTTP/1.1 301 Moved Permanently"); + header("Location:discuz://" . rawurlencode($_G['messageparam'][0]) . "//" . rawurlencode(diconv($message_result, $_G['charset'], "utf-8")) . ($return ? "//" . rawurlencode($return) : '' )); + exit; + } + } + return $xml; + } + + public static function diconv_array($variables, $in_charset, $out_charset) { + foreach($variables as $_k => $_v) { + if(is_array($_v)) { + $variables[$_k] = mobile_core::diconv_array($_v, $in_charset, $out_charset); + } elseif(is_string($_v)) { + $variables[$_k] = diconv($_v, $in_charset, $out_charset); + } + } + return $variables; + } + + public static function make_cors($request_method, $origin = '') { + + $origin = $origin ? $origin : REQUEST_METHOD_DOMAIN; + + if ($request_method === 'OPTIONS') { + header('Access-Control-Allow-Origin:'.$origin); + + header('Access-Control-Allow-Credentials:true'); + header('Access-Control-Allow-Methods:GET, POST, OPTIONS'); + + + header('Access-Control-Max-Age:1728000'); + header('Content-Type:text/plain charset=UTF-8'); + header("status: 204"); + header('HTTP/1.0 204 No Content'); + header('Content-Length: 0',true); + flush(); + } + + if ($request_method === 'POST') { + + header('Access-Control-Allow-Origin:'.$origin); + header('Access-Control-Allow-Credentials:true'); + header('Access-Control-Allow-Methods:GET, POST, OPTIONS'); + } + + if ($request_method === 'GET') { + + header('Access-Control-Allow-Origin:'.$origin); + header('Access-Control-Allow-Credentials:true'); + header('Access-Control-Allow-Methods:GET, POST, OPTIONS'); + } + + } + + public static function usergroupIconId($groupid) { + global $_G; + if($_G['cache']['usergroupIconId']) { + return $_G['cache']['usergroupIconId']['variable'][$groupid]; + } + loadcache('usergroupIconId'); + if(!$_G['cache']['usergroupIconId'] || TIMESTAMP - $_G['cache']['usergroupIconId']['expiration'] > 3600) { + loadcache('usergroups'); + $memberi = 0; + $return = array(); + foreach($_G['cache']['usergroups'] as $groupid => $data) { + if($data['type'] == 'member') { + if(!$memberi && $groupid == $_G['setting']['newusergroupid']) { + $memberi = 1; + } + if($memberi > 0) { + $return[$groupid] = $memberi++; + } + } elseif($data['type'] == 'system' && $groupid < 4) { + $return[$groupid] = 'admin'; + } elseif($data['type'] == 'special') { + $return[$groupid] = 'special'; + } + } + savecache('usergroupIconId', array('variable' => $return, 'expiration' => TIMESTAMP)); + return $return[$groupid]; + } else { + return $_G['cache']['usergroupIconId']['variable'][$groupid]; + } + } + + public static function activeHook($module, $mobileapihook, &$param, $isavariables = false) { + global $_G; + static $pluginclasses = array(); + if($isavariables) { + $mobileapihook[$module] = array( + 'variables' => $mobileapihook[$module]['variables'] + ); + } + foreach($mobileapihook[$module] as $hookname => $hooks) { + foreach($hooks as $plugin => $hook) { + if(!$hook['allow'] || !in_array($plugin, $_G['setting']['plugins']['available'])) { + continue; + } + if(!preg_match('/^[\w\_\.]+\.php$/i', $hook['include'])) { + continue; + } + include_once DISCUZ_ROOT . 'source/plugin/' . $plugin . '/' . $hook['include']; + if(!class_exists($hook['class'], false)) { + continue; + } + if(!isset($pluginclasses[$hook['class']])) { + $pluginclasses[$hook['class']] = new $hook['class']; + } + if(!method_exists($pluginclasses[$hook['class']], $hook['method'])) { + continue; + } + if(!$isavariables) { + $value[$module.'_'.$hookname][$plugin] = call_user_func(array($pluginclasses[$hook['class']], $hook['method']), $param); + } else { + call_user_func(array($pluginclasses[$hook['class']], $hook['method']), $param); + } + } + } + if(!$isavariables) { + return $value; + } + } +} + +class base_plugin_mobile { + + function common() { + global $_G; + if(!defined('IN_MOBILE_API')) { + return; + } + if(!$_G['setting']['mobile']['allowmobile']) { + mobile_core::result(array('error' => 'mobile_is_closed')); + } + if(!empty($_GET['tpp'])) { + $_G['tpp'] = intval($_GET['tpp']); + } + if(!empty($_GET['ppp'])) { + $_G['ppp'] = intval($_GET['ppp']); + } + $_G['pluginrunlist'] = array('mobile', 'qqconnect', 'wechat'); + $_G['siteurl'] = preg_replace('/api\/mobile\/$/', '', $_G['siteurl']); + $_G['setting']['msgforward'] = ''; + $_G['setting']['cacheindexlife'] = $_G['setting']['cachethreadlife'] = false; + if($_GET['_auth']) { + require_once DISCUZ_ROOT.'./source/plugin/wechat/wsq.class.php'; + $uid = wsq::decodeauth($_GET['_auth']); + $disablesec = false; + if($uid) { + require_once libfile('function/member'); + $member = getuserbyuid($uid, 1); + if($_GET['module'] != 'login') { + setloginstatus($member, 1296000); + $disablesec = true; + } else { + $disablesec = logincheck($member['username']); + } + } elseif($_GET['module'] == 'login') { + $disablesec = logincheck($_GET['username']); + } + if($disablesec) { + $_G['setting']['seccodedata'] = array(); + $_G['setting']['seccodestatus'] = 0; + $_G['setting']['secqaa'] = array(); + unset($_GET['force']); + define('IN_MOBILE_AUTH', $uid); + if($_SERVER['REQUEST_METHOD'] == 'POST') { + $_GET['formhash'] = $_G['formhash']; + } + } + } + if(class_exists('mobile_api', false) && method_exists('mobile_api', 'common')) { + mobile_api::common(); + } + } + + function discuzcode($param) { + if(!defined('IN_MOBILE_API') || $param['caller'] != 'discuzcode') { + return; + } + global $_G; + if(defined('IS_WEBVIEW') && IS_WEBVIEW && in_array('mobileoem', $_G['setting']['plugins']['available'])) { + include_once DISCUZ_ROOT.'./source/plugin/mobileoem/discuzcode.func.php'; + include_once mobileoem_template('forum/discuzcode'); + $_G['discuzcodemessage'] = mobileoem_discuzcode($param['param']); + } elseif($_GET['version'] == 4) { + include_once 'discuzcode.func.php'; + $_G['discuzcodemessage'] = mobile_discuzcode($param['param']); + } else { + $_G['discuzcodemessage'] = preg_replace(array( + "/\[size=(\d+?)\]/i", + "/\[size=(\d+(\.\d+)?(px|pt)+?)\]/i", + "/\[\/size]/i", + ), '', $_G['discuzcodemessage']); + } + } + + function global_mobile() { + if(!defined('IN_MOBILE_API')) { + return; + } + if(class_exists('mobile_api', false) && method_exists('mobile_api', 'output')) { + mobile_api::output(); + } + } + +} + +class base_plugin_mobile_forum extends base_plugin_mobile { + + function post_mobile_message($param) { + if(!defined('IN_MOBILE_API')) { + return; + } + if(class_exists('mobile_api', false) && method_exists('mobile_api', 'post_mobile_message')) { + list($message, $url_forward, $values, $extraparam, $custom) = $param['param']; + mobile_api::post_mobile_message($message, $url_forward, $values, $extraparam, $custom); + } + } + + function misc_mobile_message($param) { + if(!defined('IN_MOBILE_API')) { + return; + } + if(class_exists('mobile_api', false) && method_exists('mobile_api', 'misc_mobile_message')) { + list($message, $url_forward, $values, $extraparam, $custom) = $param['param']; + mobile_api::misc_mobile_message($message, $url_forward, $values, $extraparam, $custom); + } + } + + function viewthread_postbottom_output() { + global $_G, $postlist; + foreach($postlist as $k => $post) { + if($post['mobiletype'] == 1) { + $post['message'] .= lang('plugin/mobile', 'mobile_fromtype_ios'); + } elseif($post['mobiletype'] == 2) { + $post['message'] .= lang('plugin/mobile', 'mobile_fromtype_android'); + } elseif($post['mobiletype'] == 3) { + $post['message'] .= lang('plugin/mobile', 'mobile_fromtype_windowsphone'); + } elseif($post['mobiletype'] == 5) { + $threadmessage = $_G['setting']['wechatviewpluginid'] ? lang('plugin/'.$_G['setting']['wechatviewpluginid'], 'lang_wechat_threadmessage', array('tid' => $_G['tid'], 'pid' => $post['pid'])) : array(); + $post['message'] .= $threadmessage ? $threadmessage : ''; + } + $postlist[$k] = $post; + } + return array(); + } + +} + +class base_plugin_mobile_misc extends base_plugin_mobile { + + +} + +class plugin_mobile extends base_plugin_mobile {} +class plugin_mobile_forum extends base_plugin_mobile_forum { + function post_mobile_message($param) { + parent::post_mobile_message($param); + list($message) = $param['param']; + if(in_array($message, array('post_reply_succeed', 'post_reply_mod_succeed'))) { + include_once 'source/plugin/mobile/api/4/sub_sendreply.php'; + } + } +} + +class plugin_mobile_misc extends base_plugin_mobile_misc {} +class mobileplugin_mobile extends base_plugin_mobile { + function global_header_mobile() { + global $_G; + if(in_array('mobileoem', $_G['setting']['plugins']['available'])) { + loadcache('mobileoem_data'); + if($_G['cache']['mobileoem_data']['iframeUrl']) { + return; + } + } + if(IN_MOBILE === '1' || IN_MOBILE === 'yes' || IN_MOBILE === true) { + return; + } + } +} +class mobileplugin_mobile_forum extends base_plugin_mobile_forum { + function post_mobile_message($param) { + parent::post_mobile_message($param); + list($message) = $param['param']; + if(in_array($message, array('post_reply_succeed', 'post_reply_mod_succeed'))) { + include_once 'source/plugin/mobile/api/4/sub_sendreply.php'; + } + } +} +class mobileplugin_mobile_misc extends base_plugin_mobile_misc {} + +class plugin_mobile_connect extends plugin_mobile { + + function login_mobile_message($param) { + global $_G; + if(substr($_GET['referer'], 0, 7) == 'Mobile_') { + if($_GET['referer'] == 'Mobile_iOS' || $_GET['referer'] == 'Mobile_Android') { + $_GET['mobilemessage'] = 1; + } + $param = array('con_auth_hash' => $_G['cookie']['con_auth_hash']); + mobile_core::result(mobile_core::variable($param)); + } + } + +} + +?> \ No newline at end of file diff --git a/source/plugin/mobile/mobile.php b/source/plugin/mobile/mobile.php new file mode 100644 index 0000000..c10bfe4 --- /dev/null +++ b/source/plugin/mobile/mobile.php @@ -0,0 +1,75 @@ + 4, +); + +if(!isset($_GET['module']) || !in_array($_GET['module'], $modules)) { + mobile_core::result(array('error' => 'module_not_exists')); +} +$_GET['version'] = !empty($_GET['version']) ? intval($_GET['version']) : (!$defaultversions[$_GET['module']] ? 1 : $defaultversions[$_GET['module']]); +$_GET['version'] = $_GET['version'] > MOBILE_PLUGIN_VERSION ? MOBILE_PLUGIN_VERSION : $_GET['version']; + +if(empty($_GET['module']) || empty($_GET['version']) || !preg_match('/^[\w\.]+$/', $_GET['module']) || !preg_match('/^[\d\.]+$/', $_GET['version'])) { + mobile_core::result(array('error' => 'param_error')); +} + +if($_GET['module'] == 'extends') { + require_once 'source/plugin/mobile/mobile_extends.php'; + return; +}else{ + define('HOOKTYPE', 'hookscriptmobile'); +} + +if(!empty($_GET['_auth'])) { + unset($_GET['formhash'], $_POST['formhash']); +} + +$apifile = 'source/plugin/mobile/api/'.$_GET['version'].'/'.$_GET['module'].'.php'; + +if(file_exists($apifile)) { + require_once $apifile; +} else { + if($_GET['version'] > 1) { + for($i = $_GET['version']; $i >= 1; $i--) { + $apifile = 'source/plugin/mobile/api/'.$i.'/'.$_GET['module'].'.php'; + if(file_exists($apifile)) { + $_GET['version'] = $i; + require_once $apifile; + break; + } elseif($i==1 && !file_exists($apifile)) { + mobile_core::result(array('error' => 'module_not_exists')); + } + } + } else { + mobile_core::result(array('error' => 'module_not_exists')); + } +} + +?> \ No newline at end of file diff --git a/source/plugin/mobile/mobile_extends.php b/source/plugin/mobile/mobile_extends.php new file mode 100644 index 0000000..0bf5b9b --- /dev/null +++ b/source/plugin/mobile/mobile_extends.php @@ -0,0 +1,30 @@ +init(); +define('HOOKTYPE', 'hookscript'); +hookscript('common', 'global'); +hookscript('global', 'global'); + +?> \ No newline at end of file diff --git a/source/plugin/mobile/qrcode.class.php b/source/plugin/mobile/qrcode.class.php new file mode 100644 index 0000000..d5e6f7a --- /dev/null +++ b/source/plugin/mobile/qrcode.class.php @@ -0,0 +1,2680 @@ + 1) { + $eccLevel = $mode[1]; + } + + $qrTab = QRcode::text($code, false, $eccLevel); + $size = count($qrTab); + + $barcode_array['num_rows'] = $size; + $barcode_array['num_cols'] = $size; + $barcode_array['bcode'] = array(); + + foreach ($qrTab as $line) { + $arrAdd = array(); + foreach (str_split($line) as $char) + $arrAdd[] = ($char == '1') ? 1 : 0; + $barcode_array['bcode'][] = $arrAdd; + } + + return $barcode_array; + } + + public static function clearCache() { + self::$frames = array(); + } + + public static function buildCache() { + QRtools::markTime('before_build_cache'); + + $mask = new QRmask(); + for ($a = 1; $a <= QRSPEC_VERSION_MAX; $a++) { + $frame = QRspec::newFrame($a); + if (QR_IMAGE) { + $fileName = QR_CACHE_DIR . 'frame_' . $a . '.png'; + QRimage::png(self::binarize($frame), $fileName, 1, 0); + } + + $width = count($frame); + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + for ($maskNo = 0; $maskNo < 8; $maskNo++) + $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true); + } + + QRtools::markTime('after_build_cache'); + } + + public static function log($outfile, $err) { + if (QR_LOG_DIR !== false) { + if ($err != '') { + if ($outfile !== false) { + file_put_contents(QR_LOG_DIR . basename($outfile) . '-errors.txt', date('Y-m-d H:i:s') . ': ' . $err, FILE_APPEND); + } else { + file_put_contents(QR_LOG_DIR . 'errors.txt', date('Y-m-d H:i:s') . ': ' . $err, FILE_APPEND); + } + } + } + } + + public static function dumpMask($frame) { + $width = count($frame); + for ($y = 0; $y < $width; $y++) { + for ($x = 0; $x < $width; $x++) { + echo ord($frame[$y][$x]) . ','; + } + } + } + + public static function markTime($markerId) { + global $qr_time_bench; + list($usec, $sec) = explode(" ", microtime()); + $time = ((float) $usec + (float) $sec); + + if (!isset($qr_time_bench)) { + $qr_time_bench = array(); + } + + $qr_time_bench[$markerId] = $time; + } + + public static function timeBenchmark() { + self::markTime('finish'); + + $lastTime = 0; + $startTime = 0; + $p = 0; + + echo ' + + '; + + foreach ($GLOBALS['qr_time_bench'] as $markerId => $thisTime) { + if ($p > 0) { + echo ''; + } else { + $startTime = $thisTime; + } + + $p++; + $lastTime = $thisTime; + } + + echo ' + + +
                BENCHMARK
                till ' . $markerId . ': ' . number_format($thisTime - $lastTime, 6) . 's
                TOTAL: ' . number_format($lastTime - $startTime, 6) . 's
                '; + } + +} + +QRtools::markTime('start'); + +define('QRSPEC_VERSION_MAX', 40); +define('QRSPEC_WIDTH_MAX', 177); +define('QRCAP_WIDTH', 0); +define('QRCAP_WORDS', 1); +define('QRCAP_REMINDER', 2); +define('QRCAP_EC', 3); + +class QRspec { + + public static $capacity = array( + array(0, 0, 0, array(0, 0, 0, 0)), + array(21, 26, 0, array(7, 10, 13, 17)), + array(25, 44, 7, array(10, 16, 22, 28)), + array(29, 70, 7, array(15, 26, 36, 44)), + array(33, 100, 7, array(20, 36, 52, 64)), + array(37, 134, 7, array(26, 48, 72, 88)), + array(41, 172, 7, array(36, 64, 96, 112)), + array(45, 196, 0, array(40, 72, 108, 130)), + array(49, 242, 0, array(48, 88, 132, 156)), + array(53, 292, 0, array(60, 110, 160, 192)), + array(57, 346, 0, array(72, 130, 192, 224)), + array(61, 404, 0, array(80, 150, 224, 264)), + array(65, 466, 0, array(96, 176, 260, 308)), + array(69, 532, 0, array(104, 198, 288, 352)), + array(73, 581, 3, array(120, 216, 320, 384)), + array(77, 655, 3, array(132, 240, 360, 432)), + array(81, 733, 3, array(144, 280, 408, 480)), + array(85, 815, 3, array(168, 308, 448, 532)), + array(89, 901, 3, array(180, 338, 504, 588)), + array(93, 991, 3, array(196, 364, 546, 650)), + array(97, 1085, 3, array(224, 416, 600, 700)), + array(101, 1156, 4, array(224, 442, 644, 750)), + array(105, 1258, 4, array(252, 476, 690, 816)), + array(109, 1364, 4, array(270, 504, 750, 900)), + array(113, 1474, 4, array(300, 560, 810, 960)), + array(117, 1588, 4, array(312, 588, 870, 1050)), + array(121, 1706, 4, array(336, 644, 952, 1110)), + array(125, 1828, 4, array(360, 700, 1020, 1200)), + array(129, 1921, 3, array(390, 728, 1050, 1260)), + array(133, 2051, 3, array(420, 784, 1140, 1350)), + array(137, 2185, 3, array(450, 812, 1200, 1440)), + array(141, 2323, 3, array(480, 868, 1290, 1530)), + array(145, 2465, 3, array(510, 924, 1350, 1620)), + array(149, 2611, 3, array(540, 980, 1440, 1710)), + array(153, 2761, 3, array(570, 1036, 1530, 1800)), + array(157, 2876, 0, array(570, 1064, 1590, 1890)), + array(161, 3034, 0, array(600, 1120, 1680, 1980)), + array(165, 3196, 0, array(630, 1204, 1770, 2100)), + array(169, 3362, 0, array(660, 1260, 1860, 2220)), + array(173, 3532, 0, array(720, 1316, 1950, 2310)), + array(177, 3706, 0, array(750, 1372, 2040, 2430)) + ); + + public static function getDataLength($version, $level) { + return self::$capacity[$version][QRCAP_WORDS] - self::$capacity[$version][QRCAP_EC][$level]; + } + + public static function getECCLength($version, $level) { + return self::$capacity[$version][QRCAP_EC][$level]; + } + + public static function getWidth($version) { + return self::$capacity[$version][QRCAP_WIDTH]; + } + + public static function getRemainder($version) { + return self::$capacity[$version][QRCAP_REMINDER]; + } + + public static function getMinimumVersion($size, $level) { + + for ($i = 1; $i <= QRSPEC_VERSION_MAX; $i++) { + $words = self::$capacity[$i][QRCAP_WORDS] - self::$capacity[$i][QRCAP_EC][$level]; + if ($words >= $size) + return $i; + } + + return -1; + } + + public static $lengthTableBits = array( + array(10, 12, 14), + array(9, 11, 13), + array(8, 16, 16), + array(8, 10, 12) + ); + + public static function lengthIndicator($mode, $version) { + if ($mode == QR_MODE_STRUCTURE) + return 0; + + if ($version <= 9) { + $l = 0; + } else if ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + return self::$lengthTableBits[$mode][$l]; + } + + public static function maximumWords($mode, $version) { + if ($mode == QR_MODE_STRUCTURE) + return 3; + + if ($version <= 9) { + $l = 0; + } else if ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + $bits = self::$lengthTableBits[$mode][$l]; + $words = (1 << $bits) - 1; + + if ($mode == QR_MODE_KANJI) { + $words *= 2; + } + + return $words; + } + + public static $eccTable = array( + array(array(0, 0), array(0, 0), array(0, 0), array(0, 0)), + array(array(1, 0), array(1, 0), array(1, 0), array(1, 0)), + array(array(1, 0), array(1, 0), array(1, 0), array(1, 0)), + array(array(1, 0), array(1, 0), array(2, 0), array(2, 0)), + array(array(1, 0), array(2, 0), array(2, 0), array(4, 0)), + array(array(1, 0), array(2, 0), array(2, 2), array(2, 2)), + array(array(2, 0), array(4, 0), array(4, 0), array(4, 0)), + array(array(2, 0), array(4, 0), array(2, 4), array(4, 1)), + array(array(2, 0), array(2, 2), array(4, 2), array(4, 2)), + array(array(2, 0), array(3, 2), array(4, 4), array(4, 4)), + array(array(2, 2), array(4, 1), array(6, 2), array(6, 2)), + array(array(4, 0), array(1, 4), array(4, 4), array(3, 8)), + array(array(2, 2), array(6, 2), array(4, 6), array(7, 4)), + array(array(4, 0), array(8, 1), array(8, 4), array(12, 4)), + array(array(3, 1), array(4, 5), array(11, 5), array(11, 5)), + array(array(5, 1), array(5, 5), array(5, 7), array(11, 7)), + array(array(5, 1), array(7, 3), array(15, 2), array(3, 13)), + array(array(1, 5), array(10, 1), array(1, 15), array(2, 17)), + array(array(5, 1), array(9, 4), array(17, 1), array(2, 19)), + array(array(3, 4), array(3, 11), array(17, 4), array(9, 16)), + array(array(3, 5), array(3, 13), array(15, 5), array(15, 10)), + array(array(4, 4), array(17, 0), array(17, 6), array(19, 6)), + array(array(2, 7), array(17, 0), array(7, 16), array(34, 0)), + array(array(4, 5), array(4, 14), array(11, 14), array(16, 14)), + array(array(6, 4), array(6, 14), array(11, 16), array(30, 2)), + array(array(8, 4), array(8, 13), array(7, 22), array(22, 13)), + array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), + array(array(8, 4), array(22, 3), array(8, 26), array(12, 28)), + array(array(3, 10), array(3, 23), array(4, 31), array(11, 31)), + array(array(7, 7), array(21, 7), array(1, 37), array(19, 26)), + array(array(5, 10), array(19, 10), array(15, 25), array(23, 25)), + array(array(13, 3), array(2, 29), array(42, 1), array(23, 28)), + array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), + array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), + array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), + array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), + array(array(6, 14), array(6, 34), array(46, 10), array(2, 64)), + array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), + array(array(4, 18), array(13, 32), array(48, 14), array(42, 32)), + array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), + array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)), + ); + + public static function getEccSpec($version, $level, array &$spec) { + if (count($spec) < 5) { + $spec = array(0, 0, 0, 0, 0); + } + + $b1 = self::$eccTable[$version][$level][0]; + $b2 = self::$eccTable[$version][$level][1]; + $data = self::getDataLength($version, $level); + $ecc = self::getECCLength($version, $level); + + if ($b2 == 0) { + $spec[0] = $b1; + $spec[1] = (int) ($data / $b1); + $spec[2] = (int) ($ecc / $b1); + $spec[3] = 0; + $spec[4] = 0; + } else { + $spec[0] = $b1; + $spec[1] = (int) ($data / ($b1 + $b2)); + $spec[2] = (int) ($ecc / ($b1 + $b2)); + $spec[3] = $b2; + $spec[4] = $spec[1] + 1; + } + } + + public static $alignmentPattern = array( + array(0, 0), + array(0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), + array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), + array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), + array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), + array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), + array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), + array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), + array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58), + ); + + public static function putAlignmentMarker(array &$frame, $ox, $oy) { + $finder = array( + "\xa1\xa1\xa1\xa1\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa0\xa1\xa0\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa1\xa1\xa1\xa1" + ); + + $yStart = $oy - 2; + $xStart = $ox - 2; + + for ($y = 0; $y < 5; $y++) { + QRstr::set($frame, $xStart, $yStart + $y, $finder[$y]); + } + } + + public static function putAlignmentPattern($version, &$frame, $width) { + if ($version < 2) + return; + + $d = self::$alignmentPattern[$version][1] - self::$alignmentPattern[$version][0]; + if ($d < 0) { + $w = 2; + } else { + $w = (int) (($width - self::$alignmentPattern[$version][0]) / $d + 2); + } + + if ($w * $w - 3 == 1) { + $x = self::$alignmentPattern[$version][0]; + $y = self::$alignmentPattern[$version][0]; + self::putAlignmentMarker($frame, $x, $y); + return; + } + + $cx = self::$alignmentPattern[$version][0]; + for ($x = 1; $x < $w - 1; $x++) { + self::putAlignmentMarker($frame, 6, $cx); + self::putAlignmentMarker($frame, $cx, 6); + $cx += $d; + } + + $cy = self::$alignmentPattern[$version][0]; + for ($y = 0; $y < $w - 1; $y++) { + $cx = self::$alignmentPattern[$version][0]; + for ($x = 0; $x < $w - 1; $x++) { + self::putAlignmentMarker($frame, $cx, $cy); + $cx += $d; + } + $cy += $d; + } + } + + public static $versionPattern = array( + 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, + 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, + 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, + 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, + 0x27541, 0x28c69 + ); + + public static function getVersionPattern($version) { + if ($version < 7 || $version > QRSPEC_VERSION_MAX) + return 0; + + return self::$versionPattern[$version - 7]; + } + + public static $formatInfo = array( + array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), + array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), + array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), + array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) + ); + + public static function getFormatInfo($mask, $level) { + if ($mask < 0 || $mask > 7) + return 0; + + if ($level < 0 || $level > 3) + return 0; + + return self::$formatInfo[$level][$mask]; + } + + public static $frames = array(); + + public static function putFinderPattern(&$frame, $ox, $oy) { + $finder = array( + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1" + ); + + for ($y = 0; $y < 7; $y++) { + QRstr::set($frame, $ox, $oy + $y, $finder[$y]); + } + } + + public static function createFrame($version) { + $width = self::$capacity[$version][QRCAP_WIDTH]; + $frameLine = str_repeat("\0", $width); + $frame = array_fill(0, $width, $frameLine); + + self::putFinderPattern($frame, 0, 0); + self::putFinderPattern($frame, $width - 7, 0); + self::putFinderPattern($frame, 0, $width - 7); + + $yOffset = $width - 7; + + for ($y = 0; $y < 7; $y++) { + $frame[$y][7] = "\xc0"; + $frame[$y][$width - 8] = "\xc0"; + $frame[$yOffset][7] = "\xc0"; + $yOffset++; + } + + $setPattern = str_repeat("\xc0", 8); + + QRstr::set($frame, 0, 7, $setPattern); + QRstr::set($frame, $width - 8, 7, $setPattern); + QRstr::set($frame, 0, $width - 8, $setPattern); + + $setPattern = str_repeat("\x84", 9); + QRstr::set($frame, 0, 8, $setPattern); + QRstr::set($frame, $width - 8, 8, $setPattern, 8); + + $yOffset = $width - 8; + + for ($y = 0; $y < 8; $y++, $yOffset++) { + $frame[$y][8] = "\x84"; + $frame[$yOffset][8] = "\x84"; + } + + + for ($i = 1; $i < $width - 15; $i++) { + $frame[6][7 + $i] = chr(0x90 | ($i & 1)); + $frame[7 + $i][6] = chr(0x90 | ($i & 1)); + } + + self::putAlignmentPattern($version, $frame, $width); + + if ($version >= 7) { + $vinf = self::getVersionPattern($version); + + $v = $vinf; + + for ($x = 0; $x < 6; $x++) { + for ($y = 0; $y < 3; $y++) { + $frame[($width - 11) + $y][$x] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + + $v = $vinf; + for ($y = 0; $y < 6; $y++) { + for ($x = 0; $x < 3; $x++) { + $frame[$y][$x + ($width - 11)] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + } + + $frame[$width - 8][8] = "\x81"; + + return $frame; + } + + public static function debug($frame, $binary_mode = false) { + if ($binary_mode) { + + foreach ($frame as &$frameLine) { + $frameLine = join('  ', explode('0', $frameLine)); + $frameLine = join('██', explode('1', $frameLine)); + } + ?> + +


                        '; + echo join("
                        ", $frame); + echo '






                '; + } else { + + foreach ($frame as &$frameLine) { + $frameLine = join(' ', explode("\xc0", $frameLine)); + $frameLine = join('', explode("\xc1", $frameLine)); + $frameLine = join(' ', explode("\xa0", $frameLine)); + $frameLine = join('', explode("\xa1", $frameLine)); + $frameLine = join('', explode("\x84", $frameLine)); + $frameLine = join('', explode("\x85", $frameLine)); + $frameLine = join('', explode("\x81", $frameLine)); + $frameLine = join(' ', explode("\x90", $frameLine)); + $frameLine = join('', explode("\x91", $frameLine)); + $frameLine = join(' ', explode("\x88", $frameLine)); + $frameLine = join('', explode("\x89", $frameLine)); + $frameLine = join('♦', explode("\x01", $frameLine)); + $frameLine = join('⋅', explode("\0", $frameLine)); + } + ?> + + "; + echo join("
                ", $frame); + echo "
                "; + } + } + + public static function serial($frame) { + return gzcompress(join("\n", $frame), 9); + } + + public static function unserial($code) { + return explode("\n", gzuncompress($code)); + } + + public static function newFrame($version) { + if ($version < 1 || $version > QRSPEC_VERSION_MAX) + return null; + + if (!isset(self::$frames[$version])) { + + $fileName = QR_CACHE_DIR . 'frame_' . $version . '.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + self::$frames[$version] = self::unserial(file_get_contents($fileName)); + } else { + self::$frames[$version] = self::createFrame($version); + file_put_contents($fileName, self::serial(self::$frames[$version])); + } + } else { + self::$frames[$version] = self::createFrame($version); + } + } + + if (is_null(self::$frames[$version])) + return null; + + return self::$frames[$version]; + } + + public static function rsBlockNum($spec) { + return $spec[0] + $spec[3]; + } + + public static function rsBlockNum1($spec) { + return $spec[0]; + } + + public static function rsDataCodes1($spec) { + return $spec[1]; + } + + public static function rsEccCodes1($spec) { + return $spec[2]; + } + + public static function rsBlockNum2($spec) { + return $spec[3]; + } + + public static function rsDataCodes2($spec) { + return $spec[4]; + } + + public static function rsEccCodes2($spec) { + return $spec[2]; + } + + public static function rsDataLength($spec) { + return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); + } + + public static function rsEccLength($spec) { + return ($spec[0] + $spec[3]) * $spec[2]; + } + +} + +define('QR_IMAGE', true); + +class QRimage { + + public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = FALSE) { + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + Header("Content-type: image/png"); + ImagePng($image); + } else { + if ($saveandprint === TRUE) { + ImagePng($image, $filename); + header("Content-type: image/png"); + ImagePng($image); + } else { + ImagePng($image, $filename); + } + } + + ImageDestroy($image); + } + + public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) { + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + Header("Content-type: image/jpeg"); + ImageJpeg($image, null, $q); + } else { + ImageJpeg($image, $filename, $q); + } + + ImageDestroy($image); + } + + private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4) { + $h = count($frame); + $w = strlen($frame[0]); + + $imgW = $w + 2 * $outerFrame; + $imgH = $h + 2 * $outerFrame; + + $base_image = ImageCreate($imgW, $imgH); + + $col[0] = ImageColorAllocate($base_image, 255, 255, 255); + $col[1] = ImageColorAllocate($base_image, 0, 0, 0); + + imagefill($base_image, 0, 0, $col[0]); + + for ($y = 0; $y < $h; $y++) { + for ($x = 0; $x < $w; $x++) { + if ($frame[$y][$x] == '1') { + ImageSetPixel($base_image, $x + $outerFrame, $y + $outerFrame, $col[1]); + } + } + } + + $target_image = ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint); + ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); + ImageDestroy($base_image); + + return $target_image; + } + +} + +define('STRUCTURE_HEADER_BITS', 20); +define('MAX_STRUCTURED_SYMBOLS', 16); + +class QRinputItem { + + public $mode; + public $size; + public $data; + public $bstream; + + public function __construct($mode, $size, $data, $bstream = null) { + $setData = array_slice($data, 0, $size); + + if (count($setData) < $size) { + $setData = array_merge($setData, array_fill(0, $size - count($setData), 0)); + } + + if (!QRinput::check($mode, $size, $setData)) { + throw new Exception('Error m:' . $mode . ',s:' . $size . ',d:' . join(',', $setData)); + return null; + } + + $this->mode = $mode; + $this->size = $size; + $this->data = $setData; + $this->bstream = $bstream; + } + + public function encodeModeNum($version) { + try { + + $words = (int) ($this->size / 3); + $bs = new QRbitstream(); + + $val = 0x1; + $bs->appendNum(4, $val); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_NUM, $version), $this->size); + + for ($i = 0; $i < $words; $i++) { + $val = (ord($this->data[$i * 3]) - ord('0')) * 100; + $val += (ord($this->data[$i * 3 + 1]) - ord('0')) * 10; + $val += (ord($this->data[$i * 3 + 2]) - ord('0')); + $bs->appendNum(10, $val); + } + + if ($this->size - $words * 3 == 1) { + $val = ord($this->data[$words * 3]) - ord('0'); + $bs->appendNum(4, $val); + } else if ($this->size - $words * 3 == 2) { + $val = (ord($this->data[$words * 3]) - ord('0')) * 10; + $val += (ord($this->data[$words * 3 + 1]) - ord('0')); + $bs->appendNum(7, $val); + } + + $this->bstream = $bs; + return 0; + } catch (Exception $e) { + return -1; + } + } + + public function encodeModeAn($version) { + try { + $words = (int) ($this->size / 2); + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x02); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_AN, $version), $this->size); + + for ($i = 0; $i < $words; $i++) { + $val = (int) QRinput::lookAnTable(ord($this->data[$i * 2])) * 45; + $val += (int) QRinput::lookAnTable(ord($this->data[$i * 2 + 1])); + + $bs->appendNum(11, $val); + } + + if ($this->size & 1) { + $val = QRinput::lookAnTable(ord($this->data[$words * 2])); + $bs->appendNum(6, $val); + } + + $this->bstream = $bs; + return 0; + } catch (Exception $e) { + return -1; + } + } + + public function encodeMode8($version) { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x4); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_8, $version), $this->size); + + for ($i = 0; $i < $this->size; $i++) { + $bs->appendNum(8, ord($this->data[$i])); + } + + $this->bstream = $bs; + return 0; + } catch (Exception $e) { + return -1; + } + } + + public function encodeModeKanji($version) { + try { + + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x8); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_KANJI, $version), (int) ($this->size / 2)); + + for ($i = 0; $i < $this->size; $i+=2) { + $val = (ord($this->data[$i]) << 8) | ord($this->data[$i + 1]); + if ($val <= 0x9ffc) { + $val -= 0x8140; + } else { + $val -= 0xc140; + } + + $h = ($val >> 8) * 0xc0; + $val = ($val & 0xff) + $h; + + $bs->appendNum(13, $val); + } + + $this->bstream = $bs; + return 0; + } catch (Exception $e) { + return -1; + } + } + + public function encodeModeStructure() { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x03); + $bs->appendNum(4, ord($this->data[1]) - 1); + $bs->appendNum(4, ord($this->data[0]) - 1); + $bs->appendNum(8, ord($this->data[2])); + + $this->bstream = $bs; + return 0; + } catch (Exception $e) { + return -1; + } + } + + public function estimateBitStreamSizeOfEntry($version) { + $bits = 0; + + if ($version == 0) + $version = 1; + + switch ($this->mode) { + case QR_MODE_NUM: $bits = QRinput::estimateBitsModeNum($this->size); + break; + case QR_MODE_AN: $bits = QRinput::estimateBitsModeAn($this->size); + break; + case QR_MODE_8: $bits = QRinput::estimateBitsMode8($this->size); + break; + case QR_MODE_KANJI: $bits = QRinput::estimateBitsModeKanji($this->size); + break; + case QR_MODE_STRUCTURE: return STRUCTURE_HEADER_BITS; + default: + return 0; + } + + $l = QRspec::lengthIndicator($this->mode, $version); + $m = 1 << $l; + $num = (int) (($this->size + $m - 1) / $m); + + $bits += $num * (4 + $l); + + return $bits; + } + + public function encodeBitStream($version) { + try { + + unset($this->bstream); + $words = QRspec::maximumWords($this->mode, $version); + + if ($this->size > $words) { + + $st1 = new QRinputItem($this->mode, $words, $this->data); + $st2 = new QRinputItem($this->mode, $this->size - $words, array_slice($this->data, $words)); + + $st1->encodeBitStream($version); + $st2->encodeBitStream($version); + + $this->bstream = new QRbitstream(); + $this->bstream->append($st1->bstream); + $this->bstream->append($st2->bstream); + + unset($st1); + unset($st2); + } else { + + $ret = 0; + + switch ($this->mode) { + case QR_MODE_NUM: $ret = $this->encodeModeNum($version); + break; + case QR_MODE_AN: $ret = $this->encodeModeAn($version); + break; + case QR_MODE_8: $ret = $this->encodeMode8($version); + break; + case QR_MODE_KANJI: $ret = $this->encodeModeKanji($version); + break; + case QR_MODE_STRUCTURE: $ret = $this->encodeModeStructure(); + break; + + default: + break; + } + + if ($ret < 0) + return -1; + } + + return $this->bstream->size(); + } catch (Exception $e) { + return -1; + } + } + +} + +; + +class QRinput { + + public $items; + private $version; + private $level; + + public function __construct($version = 0, $level = QR_ECLEVEL_L) { + if ($version < 0 || $version > QRSPEC_VERSION_MAX || $level > QR_ECLEVEL_H) { + throw new Exception('Invalid version no'); + return NULL; + } + + $this->version = $version; + $this->level = $level; + } + + public function getVersion() { + return $this->version; + } + + public function setVersion($version) { + if ($version < 0 || $version > QRSPEC_VERSION_MAX) { + throw new Exception('Invalid version no'); + return -1; + } + + $this->version = $version; + + return 0; + } + + public function getErrorCorrectionLevel() { + return $this->level; + } + + public function setErrorCorrectionLevel($level) { + if ($level > QR_ECLEVEL_H) { + throw new Exception('Invalid ECLEVEL'); + return -1; + } + + $this->level = $level; + + return 0; + } + + public function appendEntry(QRinputItem $entry) { + $this->items[] = $entry; + } + + public function append($mode, $size, $data) { + try { + $entry = new QRinputItem($mode, $size, $data); + $this->items[] = $entry; + return 0; + } catch (Exception $e) { + return -1; + } + } + + public function insertStructuredAppendHeader($size, $index, $parity) { + if ($size > MAX_STRUCTURED_SYMBOLS) { + throw new Exception('insertStructuredAppendHeader wrong size'); + } + + if ($index <= 0 || $index > MAX_STRUCTURED_SYMBOLS) { + throw new Exception('insertStructuredAppendHeader wrong index'); + } + + $buf = array($size, $index, $parity); + + try { + $entry = new QRinputItem(QR_MODE_STRUCTURE, 3, $buf); + array_unshift($this->items, $entry); + return 0; + } catch (Exception $e) { + return -1; + } + } + + public function calcParity() { + $parity = 0; + + foreach ($this->items as $item) { + if ($item->mode != QR_MODE_STRUCTURE) { + for ($i = $item->size - 1; $i >= 0; $i--) { + $parity ^= $item->data[$i]; + } + } + } + + return $parity; + } + + public static function checkModeNum($size, $data) { + for ($i = 0; $i < $size; $i++) { + if ((ord($data[$i]) < ord('0')) || (ord($data[$i]) > ord('9'))) { + return false; + } + } + + return true; + } + + public static function estimateBitsModeNum($size) { + $w = (int) $size / 3; + $bits = $w * 10; + + switch ($size - $w * 3) { + case 1: + $bits += 4; + break; + case 2: + $bits += 7; + break; + default: + break; + } + + return $bits; + } + + public static $anTable = array( + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, + -1, 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, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + ); + + public static function lookAnTable($c) { + return (($c > 127) ? -1 : self::$anTable[$c]); + } + + public static function checkModeAn($size, $data) { + for ($i = 0; $i < $size; $i++) { + if (self::lookAnTable(ord($data[$i])) == -1) { + return false; + } + } + + return true; + } + + public static function estimateBitsModeAn($size) { + $w = (int) ($size / 2); + $bits = $w * 11; + + if ($size & 1) { + $bits += 6; + } + + return $bits; + } + + public static function estimateBitsMode8($size) { + return $size * 8; + } + + public static function estimateBitsModeKanji($size) { + return (int) (($size / 2) * 13); + } + + public static function checkModeKanji($size, $data) { + if ($size & 1) + return false; + + for ($i = 0; $i < $size; $i+=2) { + $val = (ord($data[$i]) << 8) | ord($data[$i + 1]); + if ($val < 0x8140 + || ($val > 0x9ffc && $val < 0xe040) + || $val > 0xebbf) { + return false; + } + } + + return true; + } + + public static function check($mode, $size, $data) { + if ($size <= 0) + return false; + + switch ($mode) { + case QR_MODE_NUM: return self::checkModeNum($size, $data); + break; + case QR_MODE_AN: return self::checkModeAn($size, $data); + break; + case QR_MODE_KANJI: return self::checkModeKanji($size, $data); + break; + case QR_MODE_8: return true; + break; + case QR_MODE_STRUCTURE: return true; + break; + + default: + break; + } + + return false; + } + + public function estimateBitStreamSize($version) { + $bits = 0; + + foreach ($this->items as $item) { + $bits += $item->estimateBitStreamSizeOfEntry($version); + } + + return $bits; + } + + public function estimateVersion() { + $version = 0; + $prev = 0; + do { + $prev = $version; + $bits = $this->estimateBitStreamSize($prev); + $version = QRspec::getMinimumVersion((int) (($bits + 7) / 8), $this->level); + if ($version < 0) { + return -1; + } + } while ($version > $prev); + + return $version; + } + + public static function lengthOfCode($mode, $version, $bits) { + $payload = $bits - 4 - QRspec::lengthIndicator($mode, $version); + switch ($mode) { + case QR_MODE_NUM: + $chunks = (int) ($payload / 10); + $remain = $payload - $chunks * 10; + $size = $chunks * 3; + if ($remain >= 7) { + $size += 2; + } else if ($remain >= 4) { + $size += 1; + } + break; + case QR_MODE_AN: + $chunks = (int) ($payload / 11); + $remain = $payload - $chunks * 11; + $size = $chunks * 2; + if ($remain >= 6) + $size++; + break; + case QR_MODE_8: + $size = (int) ($payload / 8); + break; + case QR_MODE_KANJI: + $size = (int) (($payload / 13) * 2); + break; + case QR_MODE_STRUCTURE: + $size = (int) ($payload / 8); + break; + default: + $size = 0; + break; + } + + $maxsize = QRspec::maximumWords($mode, $version); + if ($size < 0) + $size = 0; + if ($size > $maxsize) + $size = $maxsize; + + return $size; + } + + public function createBitStream() { + $total = 0; + + foreach ($this->items as $item) { + $bits = $item->encodeBitStream($this->version); + + if ($bits < 0) + return -1; + + $total += $bits; + } + + return $total; + } + + public function convertData() { + $ver = $this->estimateVersion(); + if ($ver > $this->getVersion()) { + $this->setVersion($ver); + } + + for (;;) { + $bits = $this->createBitStream(); + + if ($bits < 0) + return -1; + + $ver = QRspec::getMinimumVersion((int) (($bits + 7) / 8), $this->level); + if ($ver < 0) { + throw new Exception('WRONG VERSION'); + return -1; + } else if ($ver > $this->getVersion()) { + $this->setVersion($ver); + } else { + break; + } + } + + return 0; + } + + public function appendPaddingBit(&$bstream) { + $bits = $bstream->size(); + $maxwords = QRspec::getDataLength($this->version, $this->level); + $maxbits = $maxwords * 8; + + if ($maxbits == $bits) { + return 0; + } + + if ($maxbits - $bits < 5) { + return $bstream->appendNum($maxbits - $bits, 0); + } + + $bits += 4; + $words = (int) (($bits + 7) / 8); + + $padding = new QRbitstream(); + $ret = $padding->appendNum($words * 8 - $bits + 4, 0); + + if ($ret < 0) + return $ret; + + $padlen = $maxwords - $words; + + if ($padlen > 0) { + + $padbuf = array(); + for ($i = 0; $i < $padlen; $i++) { + $padbuf[$i] = ($i & 1) ? 0x11 : 0xec; + } + + $ret = $padding->appendBytes($padlen, $padbuf); + + if ($ret < 0) + return $ret; + } + + $ret = $bstream->append($padding); + + return $ret; + } + + public function mergeBitStream() { + if ($this->convertData() < 0) { + return null; + } + + $bstream = new QRbitstream(); + + foreach ($this->items as $item) { + $ret = $bstream->append($item->bstream); + if ($ret < 0) { + return null; + } + } + + return $bstream; + } + + public function getBitStream() { + + $bstream = $this->mergeBitStream(); + + if ($bstream == null) { + return null; + } + + $ret = $this->appendPaddingBit($bstream); + if ($ret < 0) { + return null; + } + + return $bstream; + } + + public function getByteStream() { + $bstream = $this->getBitStream(); + if ($bstream == null) { + return null; + } + + return $bstream->toByte(); + } + +} + +class QRbitstream { + + public $data = array(); + + public function size() { + return count($this->data); + } + + public function allocate($setLength) { + $this->data = array_fill(0, $setLength, 0); + return 0; + } + + public static function newFromNum($bits, $num) { + $bstream = new QRbitstream(); + $bstream->allocate($bits); + + $mask = 1 << ($bits - 1); + for ($i = 0; $i < $bits; $i++) { + if ($num & $mask) { + $bstream->data[$i] = 1; + } else { + $bstream->data[$i] = 0; + } + $mask = $mask >> 1; + } + + return $bstream; + } + + public static function newFromBytes($size, $data) { + $bstream = new QRbitstream(); + $bstream->allocate($size * 8); + $p = 0; + + for ($i = 0; $i < $size; $i++) { + $mask = 0x80; + for ($j = 0; $j < 8; $j++) { + if ($data[$i] & $mask) { + $bstream->data[$p] = 1; + } else { + $bstream->data[$p] = 0; + } + $p++; + $mask = $mask >> 1; + } + } + + return $bstream; + } + + public function append(QRbitstream $arg) { + if (is_null($arg)) { + return -1; + } + + if ($arg->size() == 0) { + return 0; + } + + if ($this->size() == 0) { + $this->data = $arg->data; + return 0; + } + + $this->data = array_values(array_merge($this->data, $arg->data)); + + return 0; + } + + public function appendNum($bits, $num) { + if ($bits == 0) + return 0; + + $b = QRbitstream::newFromNum($bits, $num); + + if (is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + public function appendBytes($size, $data) { + if ($size == 0) + return 0; + + $b = QRbitstream::newFromBytes($size, $data); + + if (is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + public function toByte() { + + $size = $this->size(); + + if ($size == 0) { + return array(); + } + + $data = array_fill(0, (int) (($size + 7) / 8), 0); + $bytes = (int) ($size / 8); + + $p = 0; + + for ($i = 0; $i < $bytes; $i++) { + $v = 0; + for ($j = 0; $j < 8; $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$i] = $v; + } + + if ($size & 7) { + $v = 0; + for ($j = 0; $j < ($size & 7); $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$bytes] = $v; + } + + return $data; + } + +} + +class QRsplit { + + public $dataStr = ''; + public $input; + public $modeHint; + + public function __construct($dataStr, $input, $modeHint) { + $this->dataStr = $dataStr; + $this->input = $input; + $this->modeHint = $modeHint; + } + + public static function isdigitat($str, $pos) { + if ($pos >= strlen($str)) + return false; + + return ((ord($str[$pos]) >= ord('0')) && (ord($str[$pos]) <= ord('9'))); + } + + public static function isalnumat($str, $pos) { + if ($pos >= strlen($str)) + return false; + + return (QRinput::lookAnTable(ord($str[$pos])) >= 0); + } + + public function identifyMode($pos) { + if ($pos >= strlen($this->dataStr)) + return QR_MODE_NUL; + + $c = $this->dataStr[$pos]; + + if (self::isdigitat($this->dataStr, $pos)) { + return QR_MODE_NUM; + } else if (self::isalnumat($this->dataStr, $pos)) { + return QR_MODE_AN; + } else if ($this->modeHint == QR_MODE_KANJI) { + + if ($pos + 1 < strlen($this->dataStr)) { + $d = $this->dataStr[$pos + 1]; + $word = (ord($c) << 8) | ord($d); + if (($word >= 0x8140 && $word <= 0x9ffc) || ($word >= 0xe040 && $word <= 0xebbf)) { + return QR_MODE_KANJI; + } + } + } + + return QR_MODE_8; + } + + public function eatNum() { + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + while (self::isdigitat($this->dataStr, $p)) { + $p++; + } + + $run = $p; + $mode = $this->identifyMode($p); + + if ($mode == QR_MODE_8) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsMode8(1) + - QRinput::estimateBitsMode8($run + 1); + if ($dif > 0) { + return $this->eat8(); + } + } + if ($mode == QR_MODE_AN) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsModeAn(1) + - QRinput::estimateBitsModeAn($run + 1); + if ($dif > 0) { + return $this->eatAn(); + } + } + + $ret = $this->input->append(QR_MODE_NUM, $run, str_split($this->dataStr)); + if ($ret < 0) + return -1; + + return $run; + } + + public function eatAn() { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + + while (self::isalnumat($this->dataStr, $p)) { + if (self::isdigitat($this->dataStr, $p)) { + $q = $p; + while (self::isdigitat($this->dataStr, $q)) { + $q++; + } + + $dif = QRinput::estimateBitsModeAn($p) + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsModeAn($q); + + if ($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + + if (!self::isalnumat($this->dataStr, $p)) { + $dif = QRinput::estimateBitsModeAn($run) + 4 + $la + + QRinput::estimateBitsMode8(1) + - QRinput::estimateBitsMode8($run + 1); + if ($dif > 0) { + return $this->eat8(); + } + } + + $ret = $this->input->append(QR_MODE_AN, $run, str_split($this->dataStr)); + if ($ret < 0) + return -1; + + return $run; + } + + public function eatKanji() { + $p = 0; + + while ($this->identifyMode($p) == QR_MODE_KANJI) { + $p += 2; + } + + $ret = $this->input->append(QR_MODE_KANJI, $p, str_split($this->dataStr)); + if ($ret < 0) + return -1; + + return $run; + } + + public function eat8() { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 1; + $dataStrLen = strlen($this->dataStr); + + while ($p < $dataStrLen) { + + $mode = $this->identifyMode($p); + if ($mode == QR_MODE_KANJI) { + break; + } + if ($mode == QR_MODE_NUM) { + $q = $p; + while (self::isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsMode8($q); + if ($dif < 0) { + break; + } else { + $p = $q; + } + } else if ($mode == QR_MODE_AN) { + $q = $p; + while (self::isalnumat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) + + QRinput::estimateBitsModeAn($q - $p) + 4 + $la + - QRinput::estimateBitsMode8($q); + if ($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + $ret = $this->input->append(QR_MODE_8, $run, str_split($this->dataStr)); + + if ($ret < 0) + return -1; + + return $run; + } + + public function splitString() { + while (strlen($this->dataStr) > 0) { + if ($this->dataStr == '') + return 0; + + $mode = $this->identifyMode(0); + + switch ($mode) { + case QR_MODE_NUM: $length = $this->eatNum(); + break; + case QR_MODE_AN: $length = $this->eatAn(); + break; + case QR_MODE_KANJI: + if ($hint == QR_MODE_KANJI) + $length = $this->eatKanji(); + else + $length = $this->eat8(); + break; + default: $length = $this->eat8(); + break; + } + + if ($length == 0) + return 0; + if ($length < 0) + return -1; + + $this->dataStr = substr($this->dataStr, $length); + } + } + + public function toUpper() { + $stringLen = strlen($this->dataStr); + $p = 0; + + while ($p < $stringLen) { + $mode = self::identifyMode(substr($this->dataStr, $p), $this->modeHint); + if ($mode == QR_MODE_KANJI) { + $p += 2; + } else { + if (ord($this->dataStr[$p]) >= ord('a') && ord($this->dataStr[$p]) <= ord('z')) { + $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32); + } + $p++; + } + } + + return $this->dataStr; + } + + public static function splitStringToQRinput($string, QRinput $input, $modeHint, $casesensitive = true) { + if (is_null($string) || $string == '\0' || $string == '') { + throw new Exception('empty string!!!'); + } + + $split = new QRsplit($string, $input, $modeHint); + + if (!$casesensitive) + $split->toUpper(); + + return $split->splitString(); + } + +} + +class QRrsItem { + + public $mm; + public $nn; + public $alpha_to = array(); + public $index_of = array(); + public $genpoly = array(); + public $nroots; + public $fcr; + public $prim; + public $iprim; + public $pad; + public $gfpoly; + + public function modnn($x) { + while ($x >= $this->nn) { + $x -= $this->nn; + $x = ($x >> $this->mm) + ($x & $this->nn); + } + + return $x; + } + + public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { + + $rs = null; + + if ($symsize < 0 || $symsize > 8) + return $rs; + if ($fcr < 0 || $fcr >= (1 << $symsize)) + return $rs; + if ($prim <= 0 || $prim >= (1 << $symsize)) + return $rs; + if ($nroots < 0 || $nroots >= (1 << $symsize)) + return $rs; + if ($pad < 0 || $pad >= ((1 << $symsize) - 1 - $nroots)) + return $rs; + + $rs = new QRrsItem(); + $rs->mm = $symsize; + $rs->nn = (1 << $symsize) - 1; + $rs->pad = $pad; + + $rs->alpha_to = array_fill(0, $rs->nn + 1, 0); + $rs->index_of = array_fill(0, $rs->nn + 1, 0); + + $NN = & $rs->nn; + $A0 = & $NN; + + $rs->index_of[0] = $A0; + $rs->alpha_to[$A0] = 0; + $sr = 1; + + for ($i = 0; $i < $rs->nn; $i++) { + $rs->index_of[$sr] = $i; + $rs->alpha_to[$i] = $sr; + $sr <<= 1; + if ($sr & (1 << $symsize)) { + $sr ^= $gfpoly; + } + $sr &= $rs->nn; + } + + if ($sr != 1) { + $rs = NULL; + return $rs; + } + + $rs->genpoly = array_fill(0, $nroots + 1, 0); + + $rs->fcr = $fcr; + $rs->prim = $prim; + $rs->nroots = $nroots; + $rs->gfpoly = $gfpoly; + + for ($iprim = 1; ($iprim % $prim) != 0; $iprim += $rs->nn) + ; + + $rs->iprim = (int) ($iprim / $prim); + $rs->genpoly[0] = 1; + + for ($i = 0, $root = $fcr * $prim; $i < $nroots; $i++, $root += $prim) { + $rs->genpoly[$i + 1] = 1; + + for ($j = $i; $j > 0; $j--) { + if ($rs->genpoly[$j] != 0) { + $rs->genpoly[$j] = $rs->genpoly[$j - 1] ^ $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[$j]] + $root)]; + } else { + $rs->genpoly[$j] = $rs->genpoly[$j - 1]; + } + } + $rs->genpoly[0] = $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[0]] + $root)]; + } + + for ($i = 0; $i <= $nroots; $i++) + $rs->genpoly[$i] = $rs->index_of[$rs->genpoly[$i]]; + + return $rs; + } + + public function encode_rs_char($data, &$parity) { + $MM = & $this->mm; + $NN = & $this->nn; + $ALPHA_TO = & $this->alpha_to; + $INDEX_OF = & $this->index_of; + $GENPOLY = & $this->genpoly; + $NROOTS = & $this->nroots; + $FCR = & $this->fcr; + $PRIM = & $this->prim; + $IPRIM = & $this->iprim; + $PAD = & $this->pad; + $A0 = & $NN; + + $parity = array_fill(0, $NROOTS, 0); + + for ($i = 0; $i < ($NN - $NROOTS - $PAD); $i++) { + + $feedback = $INDEX_OF[$data[$i] ^ $parity[0]]; + if ($feedback != $A0) { + + $feedback = $this->modnn($NN - $GENPOLY[$NROOTS] + $feedback); + + for ($j = 1; $j < $NROOTS; $j++) { + $parity[$j] ^= $ALPHA_TO[$this->modnn($feedback + $GENPOLY[$NROOTS - $j])]; + } + } + + array_shift($parity); + if ($feedback != $A0) { + array_push($parity, $ALPHA_TO[$this->modnn($feedback + $GENPOLY[0])]); + } else { + array_push($parity, 0); + } + } + } + +} + +class QRrs { + + public static $items = array(); + + public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { + foreach (self::$items as $rs) { + if ($rs->pad != $pad) + continue; + if ($rs->nroots != $nroots) + continue; + if ($rs->mm != $symsize) + continue; + if ($rs->gfpoly != $gfpoly) + continue; + if ($rs->fcr != $fcr) + continue; + if ($rs->prim != $prim) + continue; + + return $rs; + } + + $rs = QRrsItem::init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad); + array_unshift(self::$items, $rs); + + return $rs; + } + +} + +define('N1', 3); +define('N2', 3); +define('N3', 40); +define('N4', 10); + +class QRmask { + + public $runLength = array(); + + public function __construct() { + $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); + } + + public function writeFormatInformation($width, &$frame, $mask, $level) { + $blacks = 0; + $format = QRspec::getFormatInfo($mask, $level); + + for ($i = 0; $i < 8; $i++) { + if ($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[8][$width - 1 - $i] = chr($v); + if ($i < 6) { + $frame[$i][8] = chr($v); + } else { + $frame[$i + 1][8] = chr($v); + } + $format = $format >> 1; + } + + for ($i = 0; $i < 7; $i++) { + if ($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[$width - 7 + $i][8] = chr($v); + if ($i == 0) { + $frame[8][7] = chr($v); + } else { + $frame[8][6 - $i] = chr($v); + } + + $format = $format >> 1; + } + + return $blacks; + } + + public function mask0($x, $y) { + return ($x + $y) & 1; + } + + public function mask1($x, $y) { + return ($y & 1); + } + + public function mask2($x, $y) { + return ($x % 3); + } + + public function mask3($x, $y) { + return ($x + $y) % 3; + } + + public function mask4($x, $y) { + return (((int) ($y / 2)) + ((int) ($x / 3))) & 1; + } + + public function mask5($x, $y) { + return (($x * $y) & 1) + ($x * $y) % 3; + } + + public function mask6($x, $y) { + return ((($x * $y) & 1) + ($x * $y) % 3) & 1; + } + + public function mask7($x, $y) { + return ((($x * $y) % 3) + (($x + $y) & 1)) & 1; + } + + private function generateMaskNo($maskNo, $width, $frame) { + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + + for ($y = 0; $y < $width; $y++) { + for ($x = 0; $x < $width; $x++) { + if (ord($frame[$y][$x]) & 0x80) { + $bitMask[$y][$x] = 0; + } else { + $maskFunc = call_user_func(array($this, 'mask' . $maskNo), $x, $y); + $bitMask[$y][$x] = ($maskFunc == 0) ? 1 : 0; + } + } + } + + return $bitMask; + } + + public static function serial($bitFrame) { + $codeArr = array(); + + foreach ($bitFrame as $line) + $codeArr[] = join('', $line); + + return gzcompress(join("\n", $codeArr), 9); + } + + public static function unserial($code) { + $codeArr = array(); + + $codeLines = explode("\n", gzuncompress($code)); + foreach ($codeLines as $line) + $codeArr[] = str_split($line); + + return $codeArr; + } + + public function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly = false) { + $b = 0; + $bitMask = array(); + + $fileName = QR_CACHE_DIR . 'mask_' . $maskNo . DIRECTORY_SEPARATOR . 'mask_' . $width . '_' . $maskNo . '.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + $bitMask = self::unserial(file_get_contents($fileName)); + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + if (!file_exists(QR_CACHE_DIR . 'mask_' . $maskNo)) + mkdir(QR_CACHE_DIR . 'mask_' . $maskNo); + file_put_contents($fileName, self::serial($bitMask)); + } + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + } + + if ($maskGenOnly) + return; + + $d = $s; + + for ($y = 0; $y < $width; $y++) { + for ($x = 0; $x < $width; $x++) { + if ($bitMask[$y][$x] == 1) { + $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int) $bitMask[$y][$x]); + } + $b += (int) (ord($d[$y][$x]) & 1); + } + } + + return $b; + } + + public function makeMask($width, $frame, $maskNo, $level) { + $masked = array_fill(0, $width, str_repeat("\0", $width)); + $this->makeMaskNo($maskNo, $width, $frame, $masked); + $this->writeFormatInformation($width, $masked, $maskNo, $level); + + return $masked; + } + + public function calcN1N3($length) { + $demerit = 0; + + for ($i = 0; $i < $length; $i++) { + + if ($this->runLength[$i] >= 5) { + $demerit += (N1 + ($this->runLength[$i] - 5)); + } + if ($i & 1) { + if (($i >= 3) && ($i < ($length - 2)) && ($this->runLength[$i] % 3 == 0)) { + $fact = (int) ($this->runLength[$i] / 3); + if (($this->runLength[$i - 2] == $fact) && + ($this->runLength[$i - 1] == $fact) && + ($this->runLength[$i + 1] == $fact) && + ($this->runLength[$i + 2] == $fact)) { + if (($this->runLength[$i - 3] < 0) || ($this->runLength[$i - 3] >= (4 * $fact))) { + $demerit += N3; + } else if ((($i + 3) >= $length) || ($this->runLength[$i + 3] >= (4 * $fact))) { + $demerit += N3; + } + } + } + } + } + return $demerit; + } + + public function evaluateSymbol($width, $frame) { + $head = 0; + $demerit = 0; + + for ($y = 0; $y < $width; $y++) { + $head = 0; + $this->runLength[0] = 1; + + $frameY = $frame[$y]; + + if ($y > 0) + $frameYM = $frame[$y - 1]; + + for ($x = 0; $x < $width; $x++) { + if (($x > 0) && ($y > 0)) { + $b22 = ord($frameY[$x]) & ord($frameY[$x - 1]) & ord($frameYM[$x]) & ord($frameYM[$x - 1]); + $w22 = ord($frameY[$x]) | ord($frameY[$x - 1]) | ord($frameYM[$x]) | ord($frameYM[$x - 1]); + + if (($b22 | ($w22 ^ 1)) & 1) { + $demerit += N2; + } + } + if (($x == 0) && (ord($frameY[$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if ($x > 0) { + if ((ord($frameY[$x]) ^ ord($frameY[$x - 1])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head + 1); + } + + for ($x = 0; $x < $width; $x++) { + $head = 0; + $this->runLength[0] = 1; + + for ($y = 0; $y < $width; $y++) { + if ($y == 0 && (ord($frame[$y][$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if ($y > 0) { + if ((ord($frame[$y][$x]) ^ ord($frame[$y - 1][$x])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head + 1); + } + + return $demerit; + } + + public function mask($width, $frame, $level) { + $minDemerit = PHP_INT_MAX; + $bestMaskNum = 0; + $bestMask = array(); + + $checked_masks = array(0, 1, 2, 3, 4, 5, 6, 7); + + if (QR_FIND_FROM_RANDOM !== false) { + + $howManuOut = 8 - (QR_FIND_FROM_RANDOM % 9); + for ($i = 0; $i < $howManuOut; $i++) { + $remPos = rand(0, count($checked_masks) - 1); + unset($checked_masks[$remPos]); + $checked_masks = array_values($checked_masks); + } + } + + $bestMask = $frame; + + foreach ($checked_masks as $i) { + $mask = array_fill(0, $width, str_repeat("\0", $width)); + + $demerit = 0; + $blacks = 0; + $blacks = $this->makeMaskNo($i, $width, $frame, $mask); + $blacks += $this->writeFormatInformation($width, $mask, $i, $level); + $blacks = (int) (100 * $blacks / ($width * $width)); + $demerit = (int) ((int) (abs($blacks - 50) / 5) * N4); + $demerit += $this->evaluateSymbol($width, $mask); + + if ($demerit < $minDemerit) { + $minDemerit = $demerit; + $bestMask = $mask; + $bestMaskNum = $i; + } + } + + return $bestMask; + } + +} + +class QRrsblock { + + public $dataLength; + public $data = array(); + public $eccLength; + public $ecc = array(); + + public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs) { + $rs->encode_rs_char($data, $ecc); + + $this->dataLength = $dl; + $this->data = $data; + $this->eccLength = $el; + $this->ecc = $ecc; + } + +} + +; + +class QRrawcode { + + public $version; + public $datacode = array(); + public $ecccode = array(); + public $blocks; + public $rsblocks = array(); + public $count; + public $dataLength; + public $eccLength; + public $b1; + + public function __construct(QRinput $input) { + $spec = array(0, 0, 0, 0, 0); + + $this->datacode = $input->getByteStream(); + if (is_null($this->datacode)) { + throw new Exception('null imput string'); + } + + QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); + + $this->version = $input->getVersion(); + $this->b1 = QRspec::rsBlockNum1($spec); + $this->dataLength = QRspec::rsDataLength($spec); + $this->eccLength = QRspec::rsEccLength($spec); + $this->ecccode = array_fill(0, $this->eccLength, 0); + $this->blocks = QRspec::rsBlockNum($spec); + + $ret = $this->init($spec); + if ($ret < 0) { + throw new Exception('block alloc error'); + return null; + } + + $this->count = 0; + } + + public function init(array $spec) { + $dl = QRspec::rsDataCodes1($spec); + $el = QRspec::rsEccCodes1($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + + $blockNo = 0; + $dataPos = 0; + $eccPos = 0; + for ($i = 0; $i < QRspec::rsBlockNum1($spec); $i++) { + $ecc = array_slice($this->ecccode, $eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode, 0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + if (QRspec::rsBlockNum2($spec) == 0) + return 0; + + $dl = QRspec::rsDataCodes2($spec); + $el = QRspec::rsEccCodes2($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + if ($rs == NULL) + return -1; + + for ($i = 0; $i < QRspec::rsBlockNum2($spec); $i++) { + $ecc = array_slice($this->ecccode, $eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode, 0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + return 0; + } + + public function getCode() { + $ret; + + if ($this->count < $this->dataLength) { + $row = $this->count % $this->blocks; + $col = $this->count / $this->blocks; + if ($col >= $this->rsblocks[0]->dataLength) { + $row += $this->b1; + } + $ret = $this->rsblocks[$row]->data[$col]; + } else if ($this->count < $this->dataLength + $this->eccLength) { + $row = ($this->count - $this->dataLength) % $this->blocks; + $col = ($this->count - $this->dataLength) / $this->blocks; + $ret = $this->rsblocks[$row]->ecc[$col]; + } else { + return 0; + } + $this->count++; + + return $ret; + } + +} + +class QRcode { + + public $version; + public $width; + public $data; + + public function encodeMask(QRinput $input, $mask) { + if ($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) { + throw new Exception('wrong version'); + } + if ($input->getErrorCorrectionLevel() > QR_ECLEVEL_H) { + throw new Exception('wrong level'); + } + + $raw = new QRrawcode($input); + + QRtools::markTime('after_raw'); + + $version = $raw->version; + $width = QRspec::getWidth($version); + $frame = QRspec::newFrame($version); + + $filler = new FrameFiller($width, $frame); + if (is_null($filler)) { + return NULL; + } + + for ($i = 0; $i < $raw->dataLength + $raw->eccLength; $i++) { + $code = $raw->getCode(); + $bit = 0x80; + for ($j = 0; $j < 8; $j++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); + $bit = $bit >> 1; + } + } + + QRtools::markTime('after_filler'); + + unset($raw); + + $j = QRspec::getRemainder($version); + for ($i = 0; $i < $j; $i++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02); + } + + $frame = $filler->frame; + unset($filler); + + + $maskObj = new QRmask(); + if ($mask < 0) { + + if (QR_FIND_BEST_MASK) { + $masked = $maskObj->mask($width, $frame, $input->getErrorCorrectionLevel()); + } else { + $masked = $maskObj->makeMask($width, $frame, (intval(QR_DEFAULT_MASK) % 8), $input->getErrorCorrectionLevel()); + } + } else { + $masked = $maskObj->makeMask($width, $frame, $mask, $input->getErrorCorrectionLevel()); + } + + if ($masked == NULL) { + return NULL; + } + + QRtools::markTime('after_mask'); + + $this->version = $version; + $this->width = $width; + $this->data = $masked; + + return $this; + } + + public function encodeInput(QRinput $input) { + return $this->encodeMask($input, -1); + } + + public function encodeString8bit($string, $version, $level) { + if ($string == NULL) { + throw new Exception('empty string!'); + return NULL; + } + + $input = new QRinput($version, $level); + if ($input == NULL) + return NULL; + + $ret = $input->append($input, QR_MODE_8, strlen($string), str_split($string)); + if ($ret < 0) { + unset($input); + return NULL; + } + return $this->encodeInput($input); + } + + public function encodeString($string, $version, $level, $hint, $casesensitive) { + + if ($hint != QR_MODE_8 && $hint != QR_MODE_KANJI) { + throw new Exception('bad hint'); + return NULL; + } + + $input = new QRinput($version, $level); + if ($input == NULL) + return NULL; + + $ret = QRsplit::splitStringToQRinput($string, $input, $hint, $casesensitive); + if ($ret < 0) { + return NULL; + } + + return $this->encodeInput($input); + } + + public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint = false) { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodePNG($text, $outfile, $saveandprint = false); + } + + public static function text($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encode($text, $outfile); + } + + public static function raw($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodeRAW($text, $outfile); + } + +} + +class FrameFiller { + + public $width; + public $frame; + public $x; + public $y; + public $dir; + public $bit; + + public function __construct($width, &$frame) { + $this->width = $width; + $this->frame = $frame; + $this->x = $width - 1; + $this->y = $width - 1; + $this->dir = -1; + $this->bit = -1; + } + + public function setFrameAt($at, $val) { + $this->frame[$at['y']][$at['x']] = chr($val); + } + + public function getFrameAt($at) { + return ord($this->frame[$at['y']][$at['x']]); + } + + public function next() { + do { + + if ($this->bit == -1) { + $this->bit = 0; + return array('x' => $this->x, 'y' => $this->y); + } + + $x = $this->x; + $y = $this->y; + $w = $this->width; + + if ($this->bit == 0) { + $x--; + $this->bit++; + } else { + $x++; + $y += $this->dir; + $this->bit--; + } + + if ($this->dir < 0) { + if ($y < 0) { + $y = 0; + $x -= 2; + $this->dir = 1; + if ($x == 6) { + $x--; + $y = 9; + } + } + } else { + if ($y == $w) { + $y = $w - 1; + $x -= 2; + $this->dir = -1; + if ($x == 6) { + $x--; + $y -= 8; + } + } + } + if ($x < 0 || $y < 0) + return null; + + $this->x = $x; + $this->y = $y; + } while (ord($this->frame[$y][$x]) & 0x80); + + return array('x' => $x, 'y' => $y); + } + +} + +; + +class QRencode { + + public $casesensitive = true; + public $eightbit = false; + public $version = 0; + public $size = 3; + public $margin = 4; + public $structured = 0; + public $level = QR_ECLEVEL_L; + public $hint = QR_MODE_8; + + public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4) { + $enc = new QRencode(); + $enc->size = $size; + $enc->margin = $margin; + + switch ($level . '') { + case '0': + case '1': + case '2': + case '3': + $enc->level = $level; + break; + case 'l': + case 'L': + $enc->level = QR_ECLEVEL_L; + break; + case 'm': + case 'M': + $enc->level = QR_ECLEVEL_M; + break; + case 'q': + case 'Q': + $enc->level = QR_ECLEVEL_Q; + break; + case 'h': + case 'H': + $enc->level = QR_ECLEVEL_H; + break; + } + + return $enc; + } + + public function encodeRAW($intext, $outfile = false) { + $code = new QRcode(); + + if ($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + return $code->data; + } + + public function encode($intext, $outfile = false) { + $code = new QRcode(); + + if ($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + QRtools::markTime('after_encode'); + + if ($outfile !== false) { + file_put_contents($outfile, join("\n", QRtools::binarize($code->data))); + } else { + return QRtools::binarize($code->data); + } + } + + public function encodePNG($intext, $outfile = false, $saveandprint = false) { + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int) (QR_PNG_MAXIMUM_SIZE / (count($tab) + 2 * $this->margin)); + + QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin, $saveandprint); + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + } + } + +} + +?> \ No newline at end of file diff --git a/source/plugin/mobile/table/index.htm b/source/plugin/mobile/table/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/plugin/mobile/table/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/plugin/mobile/table/table_common_devicetoken.php b/source/plugin/mobile/table/table_common_devicetoken.php new file mode 100644 index 0000000..2121034 --- /dev/null +++ b/source/plugin/mobile/table/table_common_devicetoken.php @@ -0,0 +1,38 @@ +_table = 'common_devicetoken'; + $this->_pk = 'token'; + + parent::__construct(); + } + + public function loginToken($deviceToken, $uid) { + return DB::insert($this->_table, array( + 'uid' => $uid, + 'token' => $deviceToken, + ), false, true); + } + + public function logoutToken($deviceToken, $uid) { + return DB::query('DELETE FROM %t WHERE uid=%d AND token=%s', array($this->_table, $uid, $deviceToken)); + } + + public function clearToken($deviceToken) { + return DB::query('DELETE FROM %t WHERE token=%s', array($this->_table, $deviceToken)); + } + +} \ No newline at end of file diff --git a/source/plugin/mobile/table/table_mobile_setting.php b/source/plugin/mobile/table/table_mobile_setting.php new file mode 100644 index 0000000..31fdec2 --- /dev/null +++ b/source/plugin/mobile/table/table_mobile_setting.php @@ -0,0 +1,39 @@ +_table = 'mobile_setting'; + $this->_pk = 'skey'; + + parent::__construct(); + } + + public function fetch($skey, $force_from_db = 1) { + return DB::result_first('SELECT svalue FROM %t WHERE skey=%s', array($this->_table, $skey)); + } + + public function fetch_all($skeyarr, $force_from_db = 1) { + if(!empty($skeyarr)) { + return array(); + } + $return = array(); + $query = DB::query('SELECT * FROM %t WHERE '.DB::field($this->_pk, $skeyarr), array($this->_table)); + while($svalue = DB::fetch($query)) { + $return[$svalue['skey']] = $svalue['svalue']; + } + return $return; + } + +} \ No newline at end of file diff --git a/source/plugin/mobile/table/table_mobile_wsq_threadlist.php b/source/plugin/mobile/table/table_mobile_wsq_threadlist.php new file mode 100644 index 0000000..5964a55 --- /dev/null +++ b/source/plugin/mobile/table/table_mobile_wsq_threadlist.php @@ -0,0 +1,31 @@ +_table = 'mobile_wsq_threadlist'; + $this->_pk = 'skey'; + $this->_pre_cache_key = 'wsq_threadlist_'; + $this->_cache_ttl = 0; + + parent::__construct(); + } + + public function insert_thread($tid, $data, $return_insert_id = false, $replace = false, $silent = false) { + if($this->_allowmem) { + $this->store_cache($tid, $data); + } + return DB::insert($this->_table, $data, $return_insert_id, $replace, $silent); + } +} \ No newline at end of file diff --git a/source/plugin/mobile/template/image/android.jpg b/source/plugin/mobile/template/image/android.jpg new file mode 100644 index 0000000..eb5c90e Binary files /dev/null and b/source/plugin/mobile/template/image/android.jpg differ diff --git a/source/plugin/mobile/template/image/close.jpg b/source/plugin/mobile/template/image/close.jpg new file mode 100644 index 0000000..5298e95 Binary files /dev/null and b/source/plugin/mobile/template/image/close.jpg differ diff --git a/source/plugin/mobile/template/image/codebg.jpg b/source/plugin/mobile/template/image/codebg.jpg new file mode 100644 index 0000000..33bbc71 Binary files /dev/null and b/source/plugin/mobile/template/image/codebg.jpg differ diff --git a/source/plugin/mobile/template/image/index.htm b/source/plugin/mobile/template/image/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/mobile/template/image/iphone.jpg b/source/plugin/mobile/template/image/iphone.jpg new file mode 100644 index 0000000..28a0cda Binary files /dev/null and b/source/plugin/mobile/template/image/iphone.jpg differ diff --git a/source/plugin/mobile/template/image/tipsbg.jpg b/source/plugin/mobile/template/image/tipsbg.jpg new file mode 100644 index 0000000..a2a039f Binary files /dev/null and b/source/plugin/mobile/template/image/tipsbg.jpg differ diff --git a/source/plugin/mobile/template/image/title_intro.jpg b/source/plugin/mobile/template/image/title_intro.jpg new file mode 100644 index 0000000..b45a6ed Binary files /dev/null and b/source/plugin/mobile/template/image/title_intro.jpg differ diff --git a/source/plugin/mobile/template/image/wp7.jpg b/source/plugin/mobile/template/image/wp7.jpg new file mode 100644 index 0000000..d61618d Binary files /dev/null and b/source/plugin/mobile/template/image/wp7.jpg differ diff --git a/source/plugin/mobile/template/image/wrapbg.jpg b/source/plugin/mobile/template/image/wrapbg.jpg new file mode 100644 index 0000000..354a15d Binary files /dev/null and b/source/plugin/mobile/template/image/wrapbg.jpg differ diff --git a/source/plugin/mobile/template/index.htm b/source/plugin/mobile/template/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/mobile/template/mobile.htm b/source/plugin/mobile/template/mobile.htm new file mode 100644 index 0000000..bdd4088 --- /dev/null +++ b/source/plugin/mobile/template/mobile.htm @@ -0,0 +1,50 @@ + + + + + +
                + + + + +
                +
                {lang close}{lang mobile:admin_tips}
                + +
                +
                  +
                • {lang mobile:iphone_alt}
                • +
                • {lang mobile:android_alt}
                • +
                • {lang mobile:windowsphone_alt}
                • +
                +
                +
                +

                {lang mobile:discuzmobile_alt}

                +
                +
                {lang mobile:tips_1}
                +
                {lang mobile:tips_1_desc}
                +
                {lang mobile:tips_2}
                +
                {lang mobile:tips_2_desc}
                +
                {lang mobile:tips_3}
                +
                {lang mobile:tips_3_desc}
                +
                +
                +
                +
                +
                {lang mobile:qr_desc}
                +
                {lang mobile:qr}
                +
                {lang mobile:wapmode}
                +
                {$_G['siteurl']}
                +
                +
                +
                +
                + +
                +
                + diff --git a/source/plugin/mobile/template/mobile/discuzcode.htm b/source/plugin/mobile/template/mobile/discuzcode.htm new file mode 100644 index 0000000..a75808b --- /dev/null +++ b/source/plugin/mobile/template/mobile/discuzcode.htm @@ -0,0 +1,46 @@ +{eval +function mobile_codedisp($code) { +} +
                1. $code
                + +{eval +} + +function mobile_quote() { +} +
                \\1
                + +{eval +} + +function mobile_free() { +} +
                \\1
                + +{eval +} + +function mobile_image($url, $extra) { +} +
                + +{eval +} + +function mobile_hide_reply() { + global $_G; +} +\\1 + +{eval +} + +function mobile_hide_reply_hidden() { + global $_G; +} +
                {$_G[username]}{lang guest}{lang mobile:post_hide_reply_hidden}
                + +{eval +} + +} \ No newline at end of file diff --git a/source/plugin/mobile/template/mobile/index.htm b/source/plugin/mobile/template/mobile/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/mobile/template/mobile/register.htm b/source/plugin/mobile/template/mobile/register.htm new file mode 100644 index 0000000..9aac05f --- /dev/null +++ b/source/plugin/mobile/template/mobile/register.htm @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + +
                +
                + + + + + + + + +
                +
                +
                  + +
                • + + +
                • +
                • + {lang mobile:register_validate_email_tips} +
                • + + +
                • + + +
                • + + + +
                • + + +
                • + + +
                • + + +
                • + + +
                • + + +
                • +
                • + + +
                • + + +
                • + + +
                • + + + +
                • + + +
                • + + + +
                • + + +
                • + + + + +
                • + $field[title]: + $htmls[$field['fieldid']] +
                • + + + +
                + + {eval $sechash = random(8);} + +
                  + +
                • + + + {lang mobile:change_seccode} + + +
                • + + +
                • + + {echo make_secqaa();} + +
                • + +
                + +
                  +
                • + + +
                • +
                +
                +
                +
                + + +
                + + + +
                +
                +
                  +
                • + + +
                • +
                • + + +
                • +
                • + + +
                • +
                • + + +
                • +
                +
                  +
                • + + +
                • +
                +
                +
                +
                + +
                + + \ No newline at end of file diff --git a/source/plugin/mobile/template/register.htm b/source/plugin/mobile/template/register.htm new file mode 100644 index 0000000..4a20bb1 --- /dev/null +++ b/source/plugin/mobile/template/register.htm @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + +
                +
                + + + + + + + + +
                +
                +
                  + +
                • + + +
                • +
                • + {lang mobile:register_validate_email_tips} +
                • + + +
                • + + +
                • + + + +
                • + + +
                • + + +
                • + + +
                • + + +
                • + + +
                • +
                • + + +
                • + + +
                • + + +
                • + + + +
                • + + +
                • + + + +
                • + + +
                • + + + + +
                • + $field[title]: + $htmls[$field['fieldid']] +
                • + + +
                + + {eval $sechash = random(8);} + +
                  + +
                • + + + {lang mobile:change_seccode} + + +
                • + + +
                • + + {echo make_secqaa();} + +
                • + +
                + +
                  +
                • + + +
                • +
                +
                +
                +
                + + +
                + + + +
                +
                +
                  +
                • + + +
                • +
                • + + +
                • +
                • + + +
                • +
                • + + +
                • +
                +
                  +
                • + + +
                • +
                +
                +
                +
                + +
                + + \ No newline at end of file diff --git a/source/plugin/mobile/template/style.css b/source/plugin/mobile/template/style.css new file mode 100644 index 0000000..1a29d64 --- /dev/null +++ b/source/plugin/mobile/template/style.css @@ -0,0 +1,20 @@ +input,button,select,textarea{outline:none} +textarea{resize:none} +.tips{height:67px;line-height:67px;font-weight:700;background:url(image/tipsbg.jpg) no-repeat 0 0;text-indent:86px;font-size:14px;} + .tips .close{background:url(image/close.jpg) no-repeat 0 0;width:30px;height:30px;display:block;overflow:hidden;text-indent:-9999px;margin-top:20px;margin-right:20px;} +.content{position:relative;background:url(image/wrapbg.jpg) no-repeat 0 0;padding-top:389px;} + .platform{position:absolute;top:145px;left:557px;} + .platform li{padding-bottom:18px;} + .inner{padding-left:70px;padding-right:11px;} + .intro{margin-top:60px;width:420px;} + .intro h2{margin-bottom:16px;} + .intro dl{} + .intro dt{font-size:14px;padding-bottom:9px;font-weight:700;} + .intro dd{padding-bottom:12px;} + .code{width:387px;height:297px;background:url(image/codebg.jpg) no-repeat 0 0;font-size:14px;} + .code dl{} + .code dt{font-weight:700;color:#000;text-indent:23px;} + .code dt.shoot{height:40px;line-height:40px;text-indent:65px;margin-top:16px;margin-bottom:8px;} + .code_img{height:160px;} + .code_img img{margin-left:132px;margin-top:4px;} + .code dd.url{text-indent:23px;padding-top:10px;} \ No newline at end of file diff --git a/source/plugin/mobile/template/touch/discuzcode.htm b/source/plugin/mobile/template/touch/discuzcode.htm new file mode 100644 index 0000000..a75808b --- /dev/null +++ b/source/plugin/mobile/template/touch/discuzcode.htm @@ -0,0 +1,46 @@ +{eval +function mobile_codedisp($code) { +} +
                1. $code
                + +{eval +} + +function mobile_quote() { +} +
                \\1
                + +{eval +} + +function mobile_free() { +} +
                \\1
                + +{eval +} + +function mobile_image($url, $extra) { +} +
                + +{eval +} + +function mobile_hide_reply() { + global $_G; +} +\\1 + +{eval +} + +function mobile_hide_reply_hidden() { + global $_G; +} +
                {$_G[username]}{lang guest}{lang mobile:post_hide_reply_hidden}
                + +{eval +} + +} \ No newline at end of file diff --git a/source/plugin/mobile/template/touch/index.htm b/source/plugin/mobile/template/touch/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/mobile/template/touch/register.htm b/source/plugin/mobile/template/touch/register.htm new file mode 100644 index 0000000..9aac05f --- /dev/null +++ b/source/plugin/mobile/template/touch/register.htm @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + +
                +
                + + + + + + + + +
                +
                +
                  + +
                • + + +
                • +
                • + {lang mobile:register_validate_email_tips} +
                • + + +
                • + + +
                • + + + +
                • + + +
                • + + +
                • + + +
                • + + +
                • + + +
                • +
                • + + +
                • + + +
                • + + +
                • + + + +
                • + + +
                • + + + +
                • + + +
                • + + + + +
                • + $field[title]: + $htmls[$field['fieldid']] +
                • + + + +
                + + {eval $sechash = random(8);} + +
                  + +
                • + + + {lang mobile:change_seccode} + + +
                • + + +
                • + + {echo make_secqaa();} + +
                • + +
                + +
                  +
                • + + +
                • +
                +
                +
                +
                + + +
                + + + +
                +
                +
                  +
                • + + +
                • +
                • + + +
                • +
                • + + +
                • +
                • + + +
                • +
                +
                  +
                • + + +
                • +
                +
                +
                +
                + +
                + + \ No newline at end of file diff --git a/source/plugin/mobile/upgrade.php b/source/plugin/mobile/upgrade.php new file mode 100644 index 0000000..3a08198 --- /dev/null +++ b/source/plugin/mobile/upgrade.php @@ -0,0 +1,47 @@ +fetch_all_by_uid_username($_GET['uid'], $_GET['username']); + $lock = $myrepeat[0]['locked']; + $locknew = $lock ? 0 : 1; + C::t('#myrepeats#myrepeats')->update_locked_by_uid_username($_GET['uid'], $_GET['username'], $locknew); + ajaxshowheader(); + echo $lock ? $Plang['normal'] : $Plang['lock']; + ajaxshowfooter(); +} elseif($_GET['op'] == 'delete') { + C::t('#myrepeats#myrepeats')->delete_by_uid_usernames($_GET['uid'], $_GET['username']); + ajaxshowheader(); + echo $Plang['deleted']; + ajaxshowfooter(); +} + +$ppp = 100; +$resultempty = FALSE; +$srchadd = $searchtext = $extra = $srchuid = ''; +$page = max(1, intval($_GET['page'])); +if(!empty($_GET['srchuid'])) { + $srchuid = intval($_GET['srchuid']); + $srchadd = "AND uid='$srchuid'"; +} elseif(!empty($_GET['srchusername'])) { + $srchuid = C::t('common_member')->fetch_uid_by_username($_GET['srchusername']); + if($srchuid) { + $srchadd = "AND uid='$srchuid'"; + } else { + $resultempty = TRUE; + } +} elseif(!empty($_GET['srchrepeat'])) { + $extra = '&srchrepeat='.rawurlencode($_GET['srchrepeat']); + $srchadd = "AND username='".addslashes($_GET['srchrepeat'])."'"; + $searchtext = $Plang['search'].' "'.$_GET['srchrepeat'].'" '.$Plang['repeats'].' '; +} + +if($srchuid) { + $extra = '&srchuid='.$srchuid; + $member = getuserbyuid($srchuid); + $searchtext = $Plang['search'].' "'.$member['username'].'" '.$Plang['repeatusers'].' '; +} + +$statary = array(-1 => $Plang['status'], 0 => $Plang['normal'], 1 => $Plang['lock']); +$status = isset($_GET['status']) ? intval($_GET['status']) : -1; + +if(isset($status) && $status >= 0) { + $srchadd .= " AND locked='$status'"; + $searchtext .= $Plang['search'].$statary[$status].$Plang['statuss']; +} + +if($searchtext) { + $searchtext = ''.$Plang['viewall'].' '.$searchtext; +} + +loadcache('usergroups'); + +showtableheader(); +showformheader('plugins&operation=config&do='.$pluginid.'&identifier=myrepeats&pmod=admincp', 'repeatsubmit'); +showsubmit('repeatsubmit', $Plang['search'], $lang['username'].':   '.$Plang['repeat'].': ', $searchtext); +showformfooter(); + +$statselect = ''; + +echo ''.$Plang['username'].''.$lang['usergroup'].''.$Plang['repeat'].''.$Plang['lastswitch'].''.$statselect.''; +if(!$resultempty) { + $count = C::t('#myrepeats#myrepeats')->count_by_search($srchadd); + $myrepeats = C::t('#myrepeats#myrepeats')->fetch_all_by_search($srchadd, ($page - 1) * $ppp, $ppp); + $uids = array(); + foreach($myrepeats as $myrepeat) { + $uids[] = $myrepeat['uid']; + } + $users = C::t('common_member')->fetch_all($uids); + $i = 0; + foreach($myrepeats as $myrepeat) { + $myrepeat['lastswitch'] = $myrepeat['lastswitch'] ? dgmdate($myrepeat['lastswitch']) : ''; + $myrepeat['usernameenc'] = rawurlencode($myrepeat['username']); + $opstr = !$myrepeat['locked'] ? $Plang['normal'] : $Plang['lock']; + $i++; + echo ''.$users[$myrepeat['uid']]['username'].''. + ''.$_G['cache']['usergroups'][$users[$myrepeat['uid']]['groupid']]['grouptitle'].''. + ''.$myrepeat['username'].''.''. + ''.($myrepeat['lastswitch'] ? $myrepeat['lastswitch'] : '').''. + ''.$opstr.''. + '['.$lang['delete'].']'; + } +} +showtablefooter(); + +echo multi($count, $ppp, $page, ADMINSCRIPT."?action=plugins&operation=config&do=$pluginid&identifier=myrepeats&pmod=admincp$extra"); + +?> \ No newline at end of file diff --git a/source/plugin/myrepeats/discuz_plugin_myrepeats.xml b/source/plugin/myrepeats/discuz_plugin_myrepeats.xml new file mode 100644 index 0000000..5f3df79 --- /dev/null +++ b/source/plugin/myrepeats/discuz_plugin_myrepeats.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ 设置 {olduser} 为本账号的马甲 ]
                [ 转入切换前页面 ]]]>
                + + + + + + + + + + + + + + + + + + + + + + + + +
                + + + + + + + + + + + + + + + + + + + + + + + + + + +
                +
                +
                diff --git a/source/plugin/myrepeats/index.htm b/source/plugin/myrepeats/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/plugin/myrepeats/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/plugin/myrepeats/install.php b/source/plugin/myrepeats/install.php new file mode 100644 index 0000000..0c18676 --- /dev/null +++ b/source/plugin/myrepeats/install.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/source/plugin/myrepeats/memcp.inc.php b/source/plugin/myrepeats/memcp.inc.php new file mode 100644 index 0000000..0b73131 --- /dev/null +++ b/source/plugin/myrepeats/memcp.inc.php @@ -0,0 +1,75 @@ + 1)); +} + +$myrepeatsusergroups = (array)dunserialize($_G['cache']['plugin']['myrepeats']['usergroups']); +if(in_array('', $myrepeatsusergroups)) { + $myrepeatsusergroups = array(); +} +$singleprem = FALSE; +$permusers = $permuids = array(); +if(!in_array($_G['groupid'], $myrepeatsusergroups)) { + $singleprem = TRUE; +} + +foreach(C::t('#myrepeats#myrepeats')->fetch_all_by_username($_G['username']) as $user) { + $permuids[] = $user['uid']; +} +$permusers = C::t('common_member')->fetch_all_username_by_uid($permuids); +if(!$permusers && $singleprem) { + showmessage('myrepeats:usergroup_disabled'); +} + +if($_GET['pluginop'] == 'add' && submitcheck('adduser')) { + if($singleprem && in_array($_GET['usernamenew'], $permusers) || !$singleprem) { + $usernamenew = addslashes(strip_tags($_GET['usernamenew'])); + $logindata = addslashes(authcode($_GET['passwordnew']."\t".$_GET['questionidnew']."\t".$_GET['answernew'], 'ENCODE', $_G['config']['security']['authkey'])); + if(C::t('#myrepeats#myrepeats')->count_by_uid_username($_G['uid'], $usernamenew)) { + DB::query("UPDATE ".DB::table('myrepeats')." SET logindata='$logindata' WHERE uid='{$_G['uid']}' AND username='$usernamenew'"); + } else { + $_GET['commentnew'] = addslashes($_GET['commentnew']); + DB::query("INSERT INTO ".DB::table('myrepeats')." (uid, username, logindata, comment) VALUES ('{$_G['uid']}', '$usernamenew', '$logindata', '".strip_tags($_GET['commentnew'])."')"); + } + dsetcookie('mrn', ''); + dsetcookie('mrd', ''); + showmessage('myrepeats:adduser_succeed', 'home.php?mod=spacecp&ac=plugin&id=myrepeats:memcp', array('usernamenew' => stripslashes($usernamenew))); + } +} elseif($_GET['pluginop'] == 'update' && submitcheck('updateuser')) { + if(!empty($_GET['delete'])) { + C::t('#myrepeats#myrepeats')->delete_by_uid_usernames($_G['uid'], $_GET['delete']); + } + $_GET['comment'] = daddslashes($_GET['comment']); + foreach($_GET['comment'] as $user => $v) { + C::t('#myrepeats#myrepeats')->update_comment_by_uid_username($_G['uid'], $user, strip_tags($v)); + } + dsetcookie('mrn', ''); + dsetcookie('mrd', ''); + showmessage('myrepeats:updateuser_succeed', 'home.php?mod=spacecp&ac=plugin&id=myrepeats:memcp'); +} + +$username = empty($_GET['username']) ? '' : htmlspecialchars($_GET['username']); + +$repeatusers = array(); +foreach(C::t('#myrepeats#myrepeats')->fetch_all_by_uid($_G['uid']) as $myrepeat) { + $myrepeat['lastswitch'] = $myrepeat['lastswitch'] ? dgmdate($myrepeat['lastswitch']) : ''; + $myrepeat['usernameenc'] = rawurlencode($myrepeat['username']); + $myrepeat['comment'] = htmlspecialchars($myrepeat['comment']); + $repeatusers[] = $myrepeat; +} + +$_G['basescript'] = 'home'; + +?> \ No newline at end of file diff --git a/source/plugin/myrepeats/myrepeats.class.php b/source/plugin/myrepeats/myrepeats.class.php new file mode 100644 index 0000000..9bb2d67 --- /dev/null +++ b/source/plugin/myrepeats/myrepeats.class.php @@ -0,0 +1,57 @@ +fetch_all_by_username($_G['username'])); + dsetcookie('myrepeat_rr', 'R'.$users, 86400); + } else { + $users = substr($_G['cookie']['myrepeat_rr'], 1); + } + if(!$users) { + return ''; + } + } + + $this->value['global_usernav_extra1'] = ''. + '|'.lang('plugin/myrepeats', 'switch').''."\n"; + } + + function global_usernav_extra1() { + return $this->value['global_usernav_extra1']; + } + +} + +?> \ No newline at end of file diff --git a/source/plugin/myrepeats/switch.inc.php b/source/plugin/myrepeats/switch.inc.php new file mode 100644 index 0000000..99e36a3 --- /dev/null +++ b/source/plugin/myrepeats/switch.inc.php @@ -0,0 +1,178 @@ + 1)); +} + +$myrepeatsusergroups = (array)dunserialize($_G['cache']['plugin']['myrepeats']['usergroups']); + +if(!empty($_GET['list'])) { + if(in_array('', $myrepeatsusergroups)) { + $myrepeatsusergroups = array(); + } + $userlist = array(); + if(!in_array($_G['groupid'], $myrepeatsusergroups)) { + $userlist = get_rrepeats($_G['username']); + $count = count($userlist); + if(!$count) { + unset($_G['setting']['plugins']['spacecp']['myrepeats:memcp']); + } + } + + foreach(C::t('#myrepeats#myrepeats')->fetch_all_by_uid($_G['uid']) as $user) { + $userlist[$user['username']] = $user['username']; + } + $list = '
                  '; + foreach($userlist as $user) { + if(!$user) { + continue; + } + $list .= '
                • '.$user.'
                • '; + } + $list .= '
                • '.lang('plugin/myrepeats', 'memcp').'
                • '; + include template('common/header_ajax'); + echo $list; + include template('common/footer_ajax'); + exit; +} + +if($_GET['formhash'] != FORMHASH) { + showmessage('undefined_action'); +} + +$referer = dreferer(); + +if(in_array('', $myrepeatsusergroups)) { + $myrepeatsusergroups = array(); +} +if(!in_array($_G['groupid'], $myrepeatsusergroups)) { + $users = C::t('#myrepeats#myrepeats')->fetch_all_by_username($_G['username']); + if(!$users) { + showmessage('myrepeats:usergroup_disabled'); + } else { + $permusers = array(); + foreach($users as $user) { + $permusers[] = $user['uid']; + } + $member = C::t('common_member')->fetch_by_username($_GET['username']); + if(!$member || !in_array($member['uid'], $permusers)) { + showmessage('myrepeats:usergroup_disabled'); + } + } +} + +require_once libfile('function/member'); + +$_G['myrepeats_loginperm'] = logincheck($_GET['username']); +if(!$_G['myrepeats_loginperm']) { + showmessage('myrepeats:login_strike', '', array('loginperm' => $_G['myrepeats_loginperm'])); +} + +if(!empty($_GET['authorfirst']) && submitcheck('myrepeatssubmit')) { + $result = userlogin($_GET['username'], $_GET['password'], $_GET['questionid'], $_GET['answer'], 'username', $_G['clientip']); + $_G['myrepeats_ucresult'] = $result['ucresult']; + if($result['status'] > 0) { + $logindata = addslashes(authcode($_GET['password']."\t".$_GET['questionid']."\t".$_GET['answer'], 'ENCODE', $_G['config']['security']['authkey'])); + if(C::t('#myrepeats#myrepeats')->count_by_uid_username($_G['uid'], $_GET['username'])) { + C::t('#myrepeats#myrepeats')->update_logindata_by_uid_username($_G['uid'], $_GET['username'], $logindata); + } else { + C::t('#myrepeats#myrepeats')->insert(array( + 'uid' => $_G['uid'], + 'username' => $_GET['username'], + 'logindata' => $logindata, + 'comment' => '' + )); + } + } else { + myrepeats_loginfailure($_GET['username'], $_GET['password'], $_GET['questionid'], $_GET['answer']); + } +} + +$user = C::t('#myrepeats#myrepeats')->fetch_all_by_uid_username($_G['uid'], $_GET['username']); +$user = current($user); +$olddiscuz_uid = $_G['uid']; +$olddiscuz_user = $_G['username']; +$olddiscuz_userss = $_G['member']['username']; + +if(!$user) { + $newuid = C::t('common_member')->fetch_uid_by_username($_GET['username']); + if(C::t('#myrepeats#myrepeats')->count_by_uid_username($newuid, $olddiscuz_userss)) { + $username = htmlspecialchars($_GET['username']); + include template('myrepeats:switch_login'); + exit; + } + showmessage('myrepeats:user_nonexistence'); +} elseif($user['locked']) { + showmessage('myrepeats:user_locked', '', array('user' => $_GET['username'])); +} + +list($password, $questionid, $answer) = explode("\t", authcode($user['logindata'], 'DECODE', $_G['config']['security']['authkey'])); + +$result = userlogin($_GET['username'], $password, $questionid, $answer, 'username', $_G['clientip']); +$_G['myrepeats_ucresult'] = $result['ucresult']; +if($result['status'] > 0) { + setloginstatus($result['member'], 2592000); + C::t('#myrepeats#myrepeats')->update_lastswitch_by_uid_username($olddiscuz_uid, $_GET['username'], TIMESTAMP); + C::t('common_member_status')->update($_G['uid'], array('lastvisit' => TIMESTAMP), 'UNBUFFERED'); + $ucsynlogin = $_G['setting']['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : ''; + dsetcookie('mrn', ''); + dsetcookie('mrd', ''); + $comment = $user['comment'] ? '('.$user['comment'].') ' : ''; + showmessage('myrepeats:login_succeed', $referer, array('user' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'comment' => $comment), array('showmsg' => 1, 'showdialog' => 1, 'locationtime' => 3, 'extrajs' => $ucsynlogin)); +} elseif($result['status'] == -1) { + clearcookies(); + $_G['myrepeats_ucresult']['username'] = addslashes($_G['myrepeats_ucresult']['username']); + $_G['username'] = ''; + $_G['uid'] = 0; + $auth = authcode($_G['myrepeats_ucresult']['username']."\t".formhash(), 'ENCODE'); + showmessage('myrepeats:login_activation', 'member.php?mod='.$_G['setting']['regname'].'&action=activation&auth='.rawurlencode($auth).'&referer='.rawurlencode($referer), array('user' => $_G['myrepeats_ucresult']['username']), array('showmsg' => 1, 'showdialog' => 1, 'locationtime' => 3)); +} else { + myrepeats_loginfailure($_GET['username'], $password, $questionid, $answer); +} + +function myrepeats_loginfailure($username, $password, $questionid, $answer) { + global $_G; + $password = preg_replace("/^(.{".round(strlen($password) / 4)."})(.+?)(.{".round(strlen($password) / 6)."})$/s", "\\1***\\3", $password); + $errorlog = dhtmlspecialchars( + TIMESTAMP."\t". + ($_G['myrepeats_ucresult']['username'] ? $_G['myrepeats_ucresult']['username'] : stripslashes($username))."\t". + $password."\t". + "Ques #".intval($questionid)."\t". + $_G['clientip']); + writelog('illegallog', $errorlog); + loginfailed($username); + $fmsg = $_G['myrepeats_ucresult']['uid'] == '-3' ? (empty($questionid) || $answer == '' ? 'login_question_empty' : 'login_question_invalid') : 'login_invalid'; + if($_G['myrepeats_loginperm'] > 1) { + showmessage('myrepeats:'.$fmsg, '', array('loginperm' => $_G['myrepeats_loginperm'])); + } elseif($_G['myrepeats_loginperm'] == -1) { + showmessage('myrepeats:login_password_invalid'); + } else { + showmessage('myrepeats:login_strike'); + } +} + +function get_rrepeats($username) { + $users = C::t('#myrepeats#myrepeats')->fetch_all_by_username($username); + $uids = array(); + foreach($users as $user) { + $uids[] = $user['uid']; + } + $userlist = array(); + foreach(C::t('common_member')->fetch_all($uids) as $user) { + $userlist[$user['username']] = $user['username']; + } + return $userlist; +} + +?> \ No newline at end of file diff --git a/source/plugin/myrepeats/table/index.htm b/source/plugin/myrepeats/table/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/myrepeats/table/table_myrepeats.php b/source/plugin/myrepeats/table/table_myrepeats.php new file mode 100644 index 0000000..5b573af --- /dev/null +++ b/source/plugin/myrepeats/table/table_myrepeats.php @@ -0,0 +1,69 @@ +_table = 'myrepeats'; + $this->_pk = ''; + + parent::__construct(); + } + + public function fetch_all_by_uid($uid) { + return DB::fetch_all("SELECT * FROM %t WHERE uid=%d", array($this->_table, $uid)); + } + + public function fetch_all_by_username($username) { + return DB::fetch_all("SELECT * FROM %t WHERE username=%s", array($this->_table, $username)); + } + + public function fetch_all_by_uid_username($uid, $username) { + return DB::fetch_all("SELECT * FROM %t WHERE uid=%d AND username=%s", array($this->_table, $uid, $username)); + } + + public function count_by_uid_username($uid, $username) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE uid=%d AND username=%s", array($this->_table, $uid, $username)); + } + + public function delete_by_uid_usernames($uid, $usernames) { + DB::query("DELETE FROM %t WHERE uid=%d AND username IN (%n)", array($this->_table, $uid, $usernames)); + } + + public function update_comment_by_uid_username($uid, $username, $value) { + DB::query("UPDATE %t SET comment=%s WHERE uid=%d AND username=%s", array($this->_table, $value, $uid, $username)); + } + + public function update_locked_by_uid_username($uid, $username, $value) { + DB::query("UPDATE %t SET locked=%d WHERE uid=%d AND username=%s", array($this->_table, $value, $uid, $username)); + } + + public function update_logindata_by_uid_username($uid, $username, $value) { + DB::query("UPDATE %t SET logindata=%s WHERE uid=%d AND username=%s", array($this->_table, $value, $uid, $username)); + } + + public function update_lastswitch_by_uid_username($uid, $username, $value) { + DB::query("UPDATE %t SET lastswitch=%d WHERE uid=%d AND username=%s", array($this->_table, $value, $uid, $username)); + } + + public function count_by_search($condition) { + return DB::result_first("SELECT COUNT(*) FROM %t WHERE 1 %i", array($this->_table, $condition)); + } + + public function fetch_all_by_search($condition, $start, $ppp) { + return DB::fetch_all("SELECT * FROM %t WHERE 1 %i ORDER BY uid LIMIT %d, %d", array($this->_table, $condition, $start, $ppp)); + } + +} + +?> \ No newline at end of file diff --git a/source/plugin/myrepeats/template/index.htm b/source/plugin/myrepeats/template/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/plugin/myrepeats/template/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/plugin/myrepeats/template/memcp.htm b/source/plugin/myrepeats/template/memcp.htm new file mode 100644 index 0000000..242f310 --- /dev/null +++ b/source/plugin/myrepeats/template/memcp.htm @@ -0,0 +1,66 @@ +
                  + +

                  {lang myrepeats:adduser}

                  + + + + +
                  +

                  + + {lang myrepeats:username} + + + +   + + {lang myrepeats:username} + + {lang myrepeats:password} + + +

                  +

                  + {lang myrepeats:comment} + +

                  +
                  +
                  +
                  + + + + + + + + + + + + + + + + +
                  {lang myrepeats:username}{lang myrepeats:commentrow}{lang myrepeats:lastswitch}
                  $user[username]$user[username] ({lang myrepeats:locked})$user[lastswitch]{lang myrepeats:nouse}
                  + +
                  \ No newline at end of file diff --git a/source/plugin/myrepeats/template/switch_login.htm b/source/plugin/myrepeats/template/switch_login.htm new file mode 100644 index 0000000..f9e7563 --- /dev/null +++ b/source/plugin/myrepeats/template/switch_login.htm @@ -0,0 +1,76 @@ + + + +
                  +
                  + + +
                  +
                  +

                  + {lang myrepeats:switch_title} + {lang close} +

                  +
                  +
                  + + + +
                  +

                  + {lang myrepeats:switch_tips} +

                  +
                  + + +
                  +

                  + + +

                  + +
                  + +
                  +

                  +

                  +
                  + +
                  +

                  + +

                  +
                  +
                  +
                  + + + + +
                  +
          + + + \ No newline at end of file diff --git a/source/plugin/myrepeats/uninstall.php b/source/plugin/myrepeats/uninstall.php new file mode 100644 index 0000000..467badf --- /dev/null +++ b/source/plugin/myrepeats/uninstall.php @@ -0,0 +1,21 @@ + 1); + +if (!$_G['inajax']) { + cpheader(); +} + +if ($_GET['anchor'] == 'setting') { + + $setting = C::t('common_setting')->fetch_all_setting(array('extcredits', 'connect', 'connectsiteid', 'connectsitekey', 'regconnect', 'connectappid', 'connectappkey')); + $setting['connect'] = (array)dunserialize($setting['connect']); + + if(!submitcheck('connectsubmit')) { + + include_once libfile('function/forumlist'); + $forumselect = array(); + $forumselect['t'] = ''; + if($setting['connect']['t']['fids']) { + foreach($setting['connect']['t']['fids'] as $v) { + $forumselect['t'] = str_replace(''; + } + } + + $groups = C::t('common_usergroup')->fetch_all_by_type('special'); + foreach($groups as $group) { + $connectgroup .= "\n"; + $connectguestgroup .= "\n"; + } + + showformheader('plugins&operation=config&do='.$pluginid.'&identifier=qqconnect&pmod=admincp', 'connectsubmit'); + showtableheader(); + showsetting('connect_setting_allow', 'connectnew[allow]', $setting['connect']['allow'], 'radio', 0, 1); + showsetting('App Id', 'connectappidnew', $setting['connectappid'], 'text', '', 0, $scriptlang['qqconnect']['connect_appid_desc']); + showsetting('App Key', 'connectappkeynew', $setting['connectappkey'], 'text'); + showsetting('setting_access_guest_connect_group', '', '', ''); + showsetting('setting_access_register_connect_birthday', 'connectnew[register_birthday]', $setting['connect']['register_birthday'], 'radio'); + showsetting('setting_access_register_connect_gender', 'connectnew[register_gender]', $setting['connect']['register_gender'], 'radio'); + showsetting('setting_access_register_connect_uinlimit', 'connectnew[register_uinlimit]', $setting['connect']['register_uinlimit'], 'text'); + showsetting('setting_access_register_connect_credit', '', '', ''); + showsetting('setting_access_register_connect_addcredit', 'connectnew[register_addcredit]', $setting['connect']['register_addcredit'], 'text'); + showsetting('setting_access_register_connect_group', '', '', ''); + showsetting('setting_access_register_connect_regverify', 'connectnew[register_regverify]', $setting['connect']['register_regverify'], 'radio'); + showsetting('setting_access_register_connect_invite', 'connectnew[register_invite]', $setting['connect']['register_invite'], 'radio'); + showsetting('setting_access_register_connect_newbiespan', 'connectnew[newbiespan]', $setting['connect']['newbiespan'], 'text'); + showtagfooter('tbody'); + showsubmit('connectsubmit'); + showtablefooter(); + showformfooter(); + + } else { + + $_GET['connectnew'] = array_merge($setting['connect'], $_GET['connectnew']); + $_GET['connectnew']['like_url'] = ''; + $_GET['connectnew']['turl_code'] = ''; + $connectnew = serialize($_GET['connectnew']); + $regconnectnew = !$setting['connect']['allow'] && $_GET['connectnew']['allow'] ? 1 : $setting['regconnect']; + C::t('common_setting')->update_batch(array( + 'regconnect' => $regconnectnew, + 'connect' => $connectnew, + 'connectappid' => $_GET['connectappidnew'], + 'connectappkey' => $_GET['connectappkeynew'], + )); + + updatecache(array('setting', 'fields_register', 'fields_connect_register')); + cpmsg('connect_update_succeed', 'action=plugins&operation=config&do='.$pluginid.'&identifier=qqconnect&pmod=admincp', 'succeed'); + + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/connect.class.php b/source/plugin/qqconnect/connect.class.php new file mode 100644 index 0000000..3af372e --- /dev/null +++ b/source/plugin/qqconnect/connect.class.php @@ -0,0 +1,304 @@ +allow = true; + } + + function common_base() { + global $_G; + + if(!isset($_G['connect'])) { + $_G['connect']['qzone_public_share_url'] = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey'; + $_G['connect']['referer'] = !$_G['inajax'] && CURSCRIPT != 'member' ? $_G['basefilename'].($_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : '') : dreferer(); + + $_G['connect']['login_url'] = $_G['siteurl'].'connect.php?mod=login&op=init&referer='.urlencode($_G['connect']['referer'] ? $_G['connect']['referer'] : 'index.php'); + $_G['connect']['callback_url'] = $_G['siteurl'].'connect.php?mod=login&op=callback'; + $_G['connect']['discuz_new_feed_url'] = $_G['siteurl'].'connect.php?mod=feed&op=new&formhash=' . formhash(); + $_G['connect']['discuz_new_post_feed_url'] = $_G['siteurl'].'connect.php?mod=feed&op=new&action=post&formhash=' . formhash(); + $_G['connect']['discuz_new_share_url'] = $_G['siteurl'].'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=new'; + $_G['connect']['discuz_sync_tthread_url'] = $_G['siteurl'].'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=sync_tthread&formhash=' . formhash(); + $_G['connect']['discuz_change_qq_url'] = $_G['siteurl'].'connect.php?mod=login&op=change'; + $_G['connect']['auth_fields'] = array( + 'is_user_info' => 1, + 'is_feed' => 0, + ); + + if($_G['uid']) { + dsetcookie('connect_is_bind', $_G['member']['conisbind'], 31536000); + if(!$_G['member']['conisbind'] && $_G['cookie']['connect_login']) { + $_G['cookie']['connect_login'] = 0; + dsetcookie('connect_login'); + } + } + + if (!$_G['uid'] && $_G['connectguest']) { + if ($_G['cookie']['connect_qq_nick']) { + $_G['member']['username'] = $_G['cookie']['connect_qq_nick']; + } else { + $connectGuest = C::t('#qqconnect#common_connect_guest')->fetch($conopenid); + if ($connectGuest['conqqnick']) { + $_G['member']['username'] = $connectGuest['conqqnick']; + } + } + } + + if($this->allow && !$_G['uid'] && !defined('IN_MOBILE')) { + $_G['setting']['pluginhooks']['global_login_text'] = tpl_login_bar(); + } + } + } + +} + +class plugin_qqconnect extends plugin_qqconnect_base { + + var $allow = false; + + function __construct() { + $this->init(); + } + + function common() { + $this->common_base(); + } + + function discuzcode($param) { + global $_G; + if($param['caller'] == 'discuzcode') { + $_G['discuzcodemessage'] = preg_replace('/\[wb=(.+?)\](.+?)\[\/wb\]/', '', $_G['discuzcodemessage']); + } + if($param['caller'] == 'messagecutstr') { + $_G['discuzcodemessage'] = preg_replace('/\[tthread=(.+?)\](.*?)\[\/tthread\]/', '', $_G['discuzcodemessage']); + } + } + + function global_login_extra() { + global $_G; + if(!$this->allow) { + return; + } + return tpl_global_login_extra(); + } + + function global_usernav_extra1() { + global $_G; + if(!$this->allow) { + return; + } + if (!$_G['uid'] && !$_G['connectguest']) { + return; + } + if(!$_G['member']['conisbind']) { + return tpl_global_usernav_extra1(); + } + } + + function _allowconnectfeed() { + if(!$this->allow) { + return; + } + global $_G; + return $_G['uid'] && $_G['setting']['connect']['allow'] && $_G['setting']['connect']['feed']['allow'] && ($_G['forum']['status'] == 3 && $_G['setting']['connect']['feed']['group'] || $_G['forum']['status'] != 3 && (!$_G['setting']['connect']['feed']['fids'] || in_array($_G['fid'], $_G['setting']['connect']['feed']['fids']))); + } + + function _allowconnectt() { + if(!$this->allow) { + return; + } + global $_G; + return $_G['uid'] && $_G['setting']['connect']['allow'] && $_G['setting']['connect']['t']['allow'] && ($_G['forum']['status'] == 3 && $_G['setting']['connect']['t']['group'] || $_G['forum']['status'] != 3 && (!$_G['setting']['connect']['t']['fids'] || in_array($_G['fid'], $_G['setting']['connect']['t']['fids']))); + } + + function _viewthread_share_method_output() { + global $_G; + $_G['connect']['qq_share_url'] = $_G['siteurl'] . 'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=share&sh_type=4&thread_id=' . $_G['tid']; + $_G['connect']['first_post'] = $postlist[$_G['forum_firstpid']]; + if ($_G['connect']['first_post']['anonymous']) { + $_G['connect']['first_post']['authorid'] = 0; + $_G['connect']['first_post']['author'] = ''; + } + if ($_G['group']['allowgetimage'] && $_G['thread']['price'] == 0) { + if (trim($_G['forum']['viewperm'])) { + $allowViewPermGroupIds = explode("\t", trim($_G['forum']['viewperm'])); + } + if (trim($_G['forum']['getattachperm'])) { + $allowViewAttachGroupIds = explode("\t", trim($_G['forum']['getattachperm'])); + } + $bigWidth = '400'; + $bigHeight = '400'; + $share_images = array(); + foreach ($_G['connect']['first_post']['attachments'] as $attachment) { + if ($attachment['isimage'] == 0 || $attachment['price'] > 0 + || $attachment['readperm'] > $_G['group']['readaccess'] + || ($allowViewPermGroupIds && !in_array($_G['groupid'], $allowViewPermGroupIds)) + || ($allowViewAttachGroupIds && !in_array($_G['groupid'], $allowViewAttachGroupIds))) { + continue; + } + $bigImageURL = $_G['siteurl'] . getforumimg($attachment['aid'], 1, $bigWidth, $bigHeight, 'fixnone'); + $share_images[] = urlencode($bigImageURL); + } + $_G['connect']['share_images'] = implode('|', $share_images); + } + return tpl_viewthread_share_method($jsurl); + } + +} + +class plugin_qqconnect_member extends plugin_qqconnect { + + function connect_member() { + global $_G, $seccodecheck, $secqaacheck, $connect_guest; + + if($this->allow) { + if($_G['uid'] && $_G['member']['conisbind']) { + dheader('location: '.$_G['siteurl'].'index.php'); + } + $connect_guest = array(); + if($_G['connectguest'] && (submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck) || submitcheck('loginsubmit', 1, $seccodestatus))) { + if(!$_GET['auth_hash']) { + $_GET['auth_hash'] = $_G['cookie']['con_auth_hash']; + } + $conopenid = authcode($_GET['auth_hash']); + $connect_guest = C::t('#qqconnect#common_connect_guest')->fetch($conopenid); + if(!$connect_guest) { + dsetcookie('con_auth_hash'); + showmessage('qqconnect:connect_login_first'); + } + } + } + } + + function logging_member() { + global $_G; + if($this->allow && $_G['connectguest'] && $_GET['action'] == 'login') { + if ($_G['inajax']) { + showmessage('qqconnect:connectguest_message_complete_or_bind'); + } else { + dheader('location: '.$_G['siteurl'].'member.php?mod=connect&ac=bind'); + } + } + } + + function register_member() { + global $_G; + if($this->allow && $_G['connectguest']) { + if ($_G['inajax']) { + showmessage('qqconnect:connectguest_message_complete_or_bind'); + } else { + dheader('location: '.$_G['siteurl'].'member.php?mod=connect'); + } + } + } + + function logging_method() { + if(!$this->allow) { + return; + } + return tpl_login_bar(); + } + + function register_logging_method() { + if(!$this->allow) { + return; + } + return tpl_login_bar(); + } + + function connect_input_output() { + if(!$this->allow) { + return; + } + global $_G; + $_G['setting']['pluginhooks']['register_input'] = tpl_register_input(); + } + + function connect_bottom_output() { + if(!$this->allow) { + return; + } + global $_G; + $_G['setting']['pluginhooks']['register_bottom'] = tpl_register_bottom(); + } + +} + +class plugin_qqconnect_forum extends plugin_qqconnect { + + function viewthread_share_method_output() { + return $this->_viewthread_share_method_output(); + } + +} + +class plugin_qqconnect_group extends plugin_qqconnect { + + function viewthread_share_method_output() { + return $this->_viewthread_share_method_output(); + } + +} + + +class mobileplugin_qqconnect extends plugin_qqconnect_base { + + var $allow = false; + + function __construct() { + global $_G; + if(!$_G['setting']['connect']['allow'] || $_G['setting']['bbclosed']) { + return; + } + $this->allow = true; + } + + function common() { + $this->common_base(); + } + +} + +class mobileplugin_qqconnect_member extends mobileplugin_qqconnect { + + function connect_member() { + global $_G, $seccodecheck, $secqaacheck, $connect_guest; + + if($this->allow) { + if($_G['uid'] && $_G['member']['conisbind']) { + dheader('location: '.$_G['siteurl'].'index.php'); + } + $connect_guest = array(); + if($_G['connectguest'] && (submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck) || submitcheck('loginsubmit', 1, $seccodestatus))) { + if(!$_GET['auth_hash']) { + $_GET['auth_hash'] = $_G['cookie']['con_auth_hash']; + } + $conopenid = authcode($_GET['auth_hash']); + $connect_guest = C::t('#qqconnect#common_connect_guest')->fetch($conopenid); + if(!$connect_guest) { + dsetcookie('con_auth_hash'); + showmessage('qqconnect:connect_login_first'); + } + } + } + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/connect/connect_check.php b/source/plugin/qqconnect/connect/connect_check.php new file mode 100644 index 0000000..34f44fe --- /dev/null +++ b/source/plugin/qqconnect/connect/connect_check.php @@ -0,0 +1,40 @@ +connectAjaxOuputMessage('0', '1'); +} + +if ($op == 'cookie') { + loadcache('connect_login_report_date'); + $cookieLogins = C::t('common_setting')->fetch_setting('connect_login_times'); + if (dgmdate(TIMESTAMP, 'Y-m-d') != $_G['cache']['connect_login_report_date']) { + if (!discuz_process::islocked('connect_login_report', 600)) { + $result = $connectService->connectCookieLoginReport($cookieLogins); + if (isset($result['status']) && $result['status'] == 0) { + $date = dgmdate(TIMESTAMP, 'Y-m-d'); + C::t('common_setting')->update_setting('connect_login_times', 0); + C::t('common_setting')->update_setting('connect_login_report_date', $date); + savecache('connect_login_report_date', $date); + } + } + discuz_process::unlock('connect_login_report'); + } +} + +include template('common/header_ajax'); +include template('common/footer_ajax'); \ No newline at end of file diff --git a/source/plugin/qqconnect/connect/connect_config.php b/source/plugin/qqconnect/connect/connect_config.php new file mode 100644 index 0000000..6c1426f --- /dev/null +++ b/source/plugin/qqconnect/connect/connect_config.php @@ -0,0 +1,156 @@ + true, 'login' => 1)); +} + +$op = !empty($_GET['op']) ? $_GET['op'] : ''; +$referer = dreferer(); + +if(submitcheck('connectsubmit')) { + + if($op == 'config') { // debug 修改QQ绑定设置 + + $ispublisht = !empty($_GET['ispublisht']) ? 1 : 0; + C::t('#qqconnect#common_member_connect')->update($_G['uid'], + array( + 'conispublisht' => $ispublisht, + ) + ); + if (!$ispublisht) { + dsetcookie('connect_synpost_tip'); + } + showmessage('qqconnect:connect_config_success', $referer); + + } elseif($op == 'unbind') { + + $connect_member = C::t('#qqconnect#common_member_connect')->fetch($_G['uid']); + $_G['member'] = array_merge($_G['member'], $connect_member); + + if ($connect_member['conuinsecret']) { + + if($_G['member']['conisregister']) { + if($_G['setting']['strongpw']) { + $strongpw_str = array(); + if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpassword1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_1'); + } + if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpassword1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_2'); + } + if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpassword1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_3'); + } + if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpassword1'])) { + $strongpw_str[] = lang('member/template', 'strongpw_4'); + } + if($strongpw_str) { + showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str)); + } + } + if($_GET['newpassword1'] !== $_GET['newpassword2']) { + showmessage('profile_passwd_notmatch', $referer); + } + if(!$_GET['newpassword1'] || $_GET['newpassword1'] != addslashes($_GET['newpassword1'])) { + showmessage('profile_passwd_illegal', $referer); + } + } + + } else { // debug 因为老用户access token等信息,所以没法通知connect,所以直接在本地解绑就行了,不fopen connect + + if($_G['member']['conisregister']) { + if($_GET['newpassword1'] !== $_GET['newpassword2']) { + showmessage('profile_passwd_notmatch', $referer); + } + if(!$_GET['newpassword1'] || $_GET['newpassword1'] != addslashes($_GET['newpassword1'])) { + showmessage('profile_passwd_illegal', $referer); + } + } + } + + C::t('#qqconnect#common_member_connect')->delete($_G['uid']); + + C::t('common_member')->update($_G['uid'], array('conisbind' => 0)); + C::t('#qqconnect#connect_memberbindlog')->insert( + array( + 'uid' => $_G['uid'], + 'uin' => $_G['member']['conopenid'], + 'type' => 2, + 'dateline' => $_G['timestamp'], + ) + ); + + if($_G['member']['conisregister']) { + loaducenter(); + uc_user_edit(addslashes($_G['member']['username']), null, $_GET['newpassword1'], null, 1); + } + + foreach($_G['cookie'] as $k => $v) { + dsetcookie($k); + } + + $_G['uid'] = $_G['adminid'] = 0; + $_G['username'] = $_G['member']['password'] = ''; + + showmessage('qqconnect:connect_config_unbind_success', 'member.php?mod=logging&action=login'); + } + +} else { + + if($_G['inajax'] && $op == 'synconfig') { + C::t('#qqconnect#common_member_connect')->update($_G['uid'], + array( + 'conispublisht' => 0, + ) + ); + dsetcookie('connect_synpost_tip'); + + } elseif($op == 'weibosign') { + if($_GET['hash'] != formhash()) { + showmessage('submit_invalid'); + } + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Connect.php'; + $connectService = new Cloud_Service_Connect(); + $connectService->connectMergeMember(); + + if($_G['member']['conuin'] && $_G['member']['conuinsecret']) { + + $arr = array(); + $arr['oauth_consumer_key'] = $_G['setting']['connectappid']; + $arr['oauth_nonce'] = mt_rand(); + $arr['oauth_timestamp'] = TIMESTAMP; + $arr['oauth_signature_method'] = 'HMAC_SHA1'; + $arr['oauth_token'] = $_G['member']['conuin']; + ksort($arr); + $arr['oauth_signature'] = $connectService->connectGetOauthSignature('http://api.discuz.qq.com/connect/getSignature', $arr, 'GET', $_G['member']['conuinsecret']); + + $arr['version'] = 'qzone1.0'; + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + $result = $connectService->connectOutputPhp('http://api.discuz.qq.com/connect/getSignature?' . $utilService->httpBuildQuery($arr, '', '&')); + if ($result['status'] == 0) { + $connectService->connectAjaxOuputMessage('[wb=' . $result['result']['username'] . ']' . $result['result']['signature_url'] . '[/wb]', 0); + } else { + $connectService->connectAjaxOuputMessage('connect_wbsign_no_account', $result['status']); + } + } else { + $connectService->connectAjaxOuputMessage('connect_wbsign_no_bind', -1); + } + + } else { + dheader('location: home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp'); + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/connect/connect_feed.php b/source/plugin/qqconnect/connect/connect_feed.php new file mode 100644 index 0000000..71cfed0 --- /dev/null +++ b/source/plugin/qqconnect/connect/connect_feed.php @@ -0,0 +1,292 @@ +connectJsOutputMessage('', 'undefined_action', 1); +} + +if ($op == 'new') { + + if ($action == 'thread') { + $tid = trim(intval($_GET['thread_id'])); + if (empty($tid)) { + $connectService->connectJsOutputMessage('', 'connect_thread_id_miss', 1); + } + + $connectService->connectMergeMember(); + + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid, 0); + $thread = C::t('forum_thread')->fetch_by_tid_displayorder($tid, 0); + $feedlog = C::t('#qqconnect#connect_feedlog')->fetch_by_tid($thread['tid']); + if ($_G['uid'] != $thread['authorid']) { + $connectService->connectJsOutputMessage('', 'connect_about', 2); + } + if (!getstatus($thread['status'], 7) && !getstatus($thread['status'], 8)) { + $connectService->connectJsOutputMessage('', 'connect_about', 2); + } + + if ($feedlog['publishtimes'] >= 5 || $_G['timestamp'] - $thread['dateline'] > 1800) { + $connectService->connectJsOutputMessage('', 'connect_about', 2); + } + + $f_type = trim(dintval($_GET['type'])); + + $msglower = strtolower($post['message']); + if(strpos($msglower, '[/quote]') !== FALSE) { + $post['message'] = preg_replace('/\[quote\].*\[\/quote\](\r\n|\n|\r){0,}/is', '', $post['message']); + } + if(strpos($msglower, '[/media]') !== FALSE) { + $post['message'] = preg_replace("/\[media=([\w%,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/is", '', $post['message']); + } + if(strpos($msglower, '[/flash]') !== FALSE) { + $post['message'] = preg_replace("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", '', $post['message']); + } + if(strpos($msglower, '[/hide]') !== FALSE) { + $post['message'] = preg_replace("/\[hide[=]?(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", '', $post['message']); + } + $html_content = $connectService->connectParseBbcode($post['message'], $thread['fid'], $post['pid'], $post['htmlon'], $attach_images); + $html_content = strip_tags(preg_replace('/( )+/', ' ', $html_content)); + + if($_G['setting']['rewritestatus'] && is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $url = rewriteoutput('forum_viewthread', 1, $_G['siteurl'], $tid); + } else { + $url = $_G['siteurl'].'forum.php?mod=viewthread&tid='.$tid; + } + + $qzone_params = array( + 'title' => $thread['subject'], + 'url' => $url, + 'summary' => $html_content, + 'nswb' => '1', + ); + + $_t_content = lang('plugin/qqconnect', 'connect_feed_iam'); + $_t_content .= '#' . cutstr($_G['setting']['bbname'], 20,'') . '#'; + $_t_content .= lang('plugin/qqconnect', 'connect_feed_published_thread', array('subject' => cutstr($thread['subject'], 120))); + $_t_content .= cutstr($html_content, 80); + $_t_content .= ' ' . $url; + + $t_params = array( + 'content' => $_t_content, + ); + + if($attach_images && is_array($attach_images)) { + $attach_image = array_shift($attach_images); + $qzone_params['images'] = $attach_image['big']; + $t_params['pic'] = $attach_image['path']; + $t_params['remote'] = $attach_image['remote']; + } + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/ConnectOAuth.php'; + $connectOAuthClient = new Cloud_Service_Client_ConnectOAuth(); + $feed_succ = $weibo_succ = false; + if(getstatus($f_type, 1)) { + try { + $response = $connectOAuthClient->connectAddShare($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $qzone_params); + + $f_type = setstatus(1, 0, $f_type); + if ($response['ret'] == 0) { + $feed_succ = true; + } + } catch(Exception $e) { + if($e->getCode()) { + $f_type = setstatus(1, 0, $f_type); + $shareErrorCode = $e->getCode(); + } + $feed_succ = false; + } + } + if(getstatus($f_type, 2)) { + try { + if ($t_params['pic']) { + $method = 'connectAddPicT'; + } else { + $method = 'connectAddT'; + } + + $response = $connectOAuthClient->$method($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $t_params); + if($response['data']['id']) { + if($_G['setting']['connect']['t']['reply'] && $thread['tid'] && !$thread['closed'] && !getstatus($thread['status'], 3) && empty($_G['forum']['replyperm'])) { + $memberConnect = C::t('#qqconnect#common_member_connect')->fetch($thread['authorid']); + $conopenid = $memberConnect['conopenid']; + C::t('#qqconnect#connect_tthreadlog')->insert(array( + 'twid' => $response['data']['id'], + 'tid' => $tid, + 'conopenid' => $conopenid, + 'pagetime' => 0, + 'lasttwid' => '0', + 'nexttime' => $_G['timestamp'] + 30 * 60, + 'updatetime' => 0, + 'dateline' => $_G['timestamp'], + )); + } + } + + $f_type = setstatus(2, 0, $f_type); + if ($response['ret'] == 0) { + $weibo_succ = true; + } + } catch(Exception $e) { + if($e->getCode()) { + $f_type = setstatus(2, 0, $f_type); + $weiboErrorCode = $e->getCode(); + } + $weibo_succ = false; + } + } + + $thread_status = $thread['status']; + $feedlog_status = $feedlog['status']; + if ($feed_succ) { + $thread_status = setstatus(7, 0, $thread_status); + $feedlog_status = setstatus(2, 1, $feedlog_status); + $feedlog_status = setstatus(1, 0, $feedlog_status); + } + if ($weibo_succ) { + $thread_status = setstatus(8, 0, $thread_status); + $thread_status = setstatus(14, 1, $thread_status); + $feedlog_status = setstatus(4, 1, $feedlog_status); + $feedlog_status = setstatus(3, 0, $feedlog_status); + } + if ($feed_succ || $weibo_succ) { + C::t('#qqconnect#connect_feedlog')->update_by_tid($thread['tid'], + array( + 'status' => $feedlog_status, + 'lastpublished' => $_G['timestamp'], + 'publishtimes' => $feedlog['publishtimes'] + 1, + )); + C::t('forum_thread')->update($thread['tid'], array('status' => $thread_status)); + } + + if(!$shareErrorCode && !$weiboErrorCode) { + $connectService->connectJsOutputMessage(lang('plugin/qqconnect', 'connect_feed_sync_success'), '', 0); + } else { + C::t('#qqconnect#connect_feedlog')->update_by_tid($thread['tid'], + array( + 'lastpublished' => $_G['timestamp'], + 'publishtimes' => $feedlog['publishtimes'] + 1, + )); + $connectService->connectJsOutputMessage('', '', $shareErrorCode.'|'.$weiboErrorCode); + } + } elseif ($action == 'post') { + + $tid = trim(intval($_GET['thread_id'])); + $pid = trim(intval($_GET['post_id'])); + + if (empty($pid)) { + $connectService->connectJsOutputMessage('', 'connect_thread_id_miss', 1); + } + + $thread = C::t('forum_thread')->fetch_by_tid_displayorder($tid, 0); + $post = C::t('forum_post')->fetch_post('tid:'.$tid, $pid); + + if (empty($thread) || empty($post)) { + $connectService->connectJsOutputMessage('', 'connect_thread_id_miss', 1); + } + + if ($_G['uid'] != $post['authorid']) { + $connectService->connectJsOutputMessage('', 'connect_about', 2); + } + + $feedlog = C::t('#qqconnect#connect_postfeedlog')->fetch_by_pid($pid); + if (!$feedlog || $feedlog['publishtimes'] >= 5 || $_G['timestamp'] - $post['dateline'] > 1800) { + $connectService->connectJsOutputMessage('', 'connect_about', 2); + } + + $connectService->connectMergeMember(); + + $msglower = strtolower($post['message']); + if(strpos($msglower, '[/quote]') !== FALSE) { + $post['message'] = preg_replace('/\[quote\].*\[\/quote\](\r\n|\n|\r){0,}/is', '', $post['message']); + } + if(strpos($msglower, '[/media]') !== FALSE) { + $post['message'] = preg_replace("/\[media=([\w%,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/is", '', $post['message']); + } + if(strpos($msglower, '[/flash]') !== FALSE) { + $post['message'] = preg_replace("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", '', $post['message']); + } + $html_content = $connectService->connectParseBbcode($post['message'], $post['fid'], $post['pid'], $post['htmlon'], $attach_images); + $html_content = strip_tags(preg_replace('/( )+/', ' ', $html_content)); + + $url = $_G['siteurl'].'forum.php?mod=redirect&goto=findpost&ptid='.$tid.'&pid='.$pid; + + $_t_content = lang('plugin/qqconnect', 'connect_feed_iam'); + $_t_content .= '#' . cutstr($_G['setting']['bbname'], 20,'') . '#'; + $_t_content .= lang('plugin/qqconnect', 'connect_feed_published_post', array('subject' => cutstr($thread['subject'], 120))); + $_t_content .= cutstr($html_content, 80); + $_t_content .= ' ' . $url; + $t_params = array( + 'content' => $_t_content, + ); + + if($attach_images && is_array($attach_images)) { + $attach_image = array_shift($attach_images); + $t_params['pic'] = $attach_image['path']; + $t_params['remote'] = $attach_image['remote']; + } + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/ConnectOAuth.php'; + $connectOAuthClient = new Cloud_Service_Client_ConnectOAuth(); + $weibo_succ = false; + + try { + if ($t_params['pic']) { + $method = 'connectAddPicT'; + } else { + $method = 'connectAddT'; + } + + $response = $connectOAuthClient->$method($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $t_params); + + if ($response['ret'] == 0) { + $weibo_succ = true; + } + } catch(Exception $e) { + if($e->getCode()) { + $weiboErrorCode = $e->getCode(); + } + $weibo_succ = false; + } + + if ($weibo_succ) { + $feedlog_status = $feedlog['status']; + $feedlog_status = setstatus(4, 1, $feedlog_status); + $feedlog_status = setstatus(3, 0, $feedlog_status); + C::t('#qqconnect#connect_postfeedlog')->update_by_pid($pid, + array( + 'status' => $feedlog_status, + 'lastpublished' => $_G['timestamp'], + 'publishtimes' => $feedlog['publishtimes'] + 1, + )); + } + + if(!$weiboErrorCode) { + dsetcookie('connect_sync_post'); + $connectService->connectJsOutputMessage(lang('plugin/qqconnect', 'connect_feed_sync_success'), '', 0); + } else { + C::t('#qqconnect#connect_postfeedlog')->update_by_pid($pid, + array( + 'lastpublished' => $_G['timestamp'], + 'publishtimes' => $feedlog['publishtimes'] + 1, + )); + $connectService->connectJsOutputMessage('', '', $weiboErrorCode); + } + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/connect/connect_login.php b/source/plugin/qqconnect/connect/connect_login.php new file mode 100644 index 0000000..0f9ba06 --- /dev/null +++ b/source/plugin/qqconnect/connect/connect_login.php @@ -0,0 +1,327 @@ +connectMergeMember(); + } else { + showmessage('submit_invalid'); + } + } + + $callback = $_G['connect']['callback_url'] . '&referer=' . urlencode($_GET['referer']); + + try { + dsetcookie('con_request_uri', $callback); + $redirect = $connectOAuthClient->getOAuthAuthorizeURL_V2($callback); + if(defined('IN_MOBILE') || $_GET['oauth_style'] == 'mobile') { + $redirect .= '&display=mobile'; + } + } catch(Exception $e) { + showmessage('qqconnect:connect_get_request_token_failed_code', $referer, array('codeMessage' => getErrorMessage($e->getmessage()), 'code' => $e->getmessage())); + } + + + dheader('Location:' . $redirect); + +} elseif($op == 'callback') { + + $params = $_GET; + + if(!isset($params['receive'])) { + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + echo ''; + exit; + } + + if($_GET['state'] != md5(FORMHASH)){ + showmessage('qqconnect:connect_get_access_token_failed', $referer); + } + try { + $response = $connectOAuthClient->connectGetOpenId_V2($_G['cookie']['con_request_uri'], $_GET['code']); + } catch(Exception $e) { + showmessage('qqconnect:connect_get_access_token_failed_code', $referer, array('codeMessage' => getErrorMessage($e->getmessage()), 'code' => $e->getmessage())); + } + + dsetcookie('con_request_token'); + dsetcookie('con_request_token_secret'); + + $conuintoken = $response['access_token']; + $conopenid = strtoupper($response['openid']); + if(!$conuintoken || !$conopenid) { + showmessage('qqconnect:connect_get_access_token_failed', $referer); + } + + loadcache('connect_blacklist'); + if(in_array($conopenid, array_map('strtoupper', $_G['cache']['connect_blacklist']))) { + $change_qq_url = $_G['connect']['discuz_change_qq_url']; + showmessage('qqconnect:connect_uin_in_blacklist', $referer, array('changeqqurl' => $change_qq_url)); + } + + $referer = $referer && (strpos($referer, 'logging') === false) && (strpos($referer, 'mod=login') === false) ? $referer : 'index.php'; + + if($params['uin']) { + $old_conuin = $params['uin']; + } + + $is_notify = true; + + $conispublishfeed = 0; + $conispublisht = 0; + + $is_user_info = 1; + $is_feed = 0; + + $user_auth_fields = 1; + + $cookie_expires = 2592000; + dsetcookie('client_created', TIMESTAMP, $cookie_expires); + dsetcookie('client_token', $conopenid, $cookie_expires); + + $connect_member = array(); + $fields = array('uid', 'conuin', 'conuinsecret', 'conopenid'); + if($old_conuin) { + $connect_member = C::t('#qqconnect#common_member_connect')->fetch_fields_by_openid($old_conuin, $fields); + } + if(empty($connect_member)) { + $connect_member = C::t('#qqconnect#common_member_connect')->fetch_fields_by_openid($conopenid, $fields); + } + if($connect_member) { + $member = getuserbyuid($connect_member['uid']); + if($member) { + if(!$member['conisbind']) { + C::t('#qqconnect#common_member_connect')->delete($connect_member['uid']); + unset($connect_member); + } else { + $connect_member['conisbind'] = $member['conisbind']; + } + } else { + C::t('#qqconnect#common_member_connect')->delete($connect_member['uid']); + unset($connect_member); + } + } + + $connect_is_unbind = $params['is_unbind'] == 1 ? 1 : 0; + if($connect_is_unbind && $connect_member && !$_G['uid'] && $is_notify) { + dsetcookie('connect_js_name', 'user_bind', 86400); + dsetcookie('connect_js_params', base64_encode(serialize(array('type' => 'registerbind'))), 86400); + } + + if($_G['uid']) { + + if($connect_member && $connect_member['uid'] != $_G['uid']) { + showmessage('qqconnect:connect_register_bind_uin_already', $referer, array('username' => $_G['member']['username'])); + } + + $isqqshow = 0; + + $current_connect_member = C::t('#qqconnect#common_member_connect')->fetch($_G['uid']); + if($_G['member']['conisbind'] && $current_connect_member['conopenid']) { + if(strtoupper($current_connect_member['conopenid']) != $conopenid) { + showmessage('qqconnect:connect_register_bind_already', $referer); + } + C::t('#qqconnect#common_member_connect')->update($_G['uid'], array( + 'conuintoken' => $conuintoken, + 'conopenid' => $conopenid, + 'conisregister' => 0, + 'conisfeed' => 1, + 'conisqqshow' => $isqqshow, + )); + + } else { // debug 当前登录的论坛账号并没有绑定任何QQ号,则可以绑定当前的这个QQ号 + if(empty($current_connect_member)) { + C::t('#qqconnect#common_member_connect')->insert(array( + 'uid' => $_G['uid'], + 'conuin' => '', + 'conuintoken' => $conuintoken, + 'conopenid' => $conopenid, + 'conispublishfeed' => $conispublishfeed, + 'conispublisht' => $conispublisht, + 'conisregister' => 0, + 'conisfeed' => 1, + 'conisqqshow' => $isqqshow, + )); + } else { + C::t('#qqconnect#common_member_connect')->update($_G['uid'], + array( + 'conuintoken' => $conuintoken, + 'conopenid' => $conopenid, + 'conispublishfeed' => $conispublishfeed, + 'conispublisht' => $conispublisht, + 'conisregister' => 0, + 'conisfeed' => 1, + 'conisqqshow' => $isqqshow, + ) + ); + } + C::t('common_member')->update($_G['uid'], array('conisbind' => '1')); + + C::t('#qqconnect#common_connect_guest')->delete($conopenid); + } + + if($is_notify) { + dsetcookie('connect_js_name', 'user_bind', 86400); + dsetcookie('connect_js_params', base64_encode(serialize(array('type' => 'loginbind'))), 86400); + } + dsetcookie('connect_login', 1, 31536000); + dsetcookie('connect_is_bind', '1', 31536000); + dsetcookie('connect_uin', $conopenid, 31536000); + dsetcookie('stats_qc_reg', 3, 86400); + + C::t('#qqconnect#connect_memberbindlog')->insert( + array( + 'uid' => $_G['uid'], + 'uin' => $conopenid, + 'type' => 1, + 'dateline' => $_G['timestamp'], + ) + ); + + showmessage('qqconnect:connect_register_bind_success', $referer); + + } else { + + if($connect_member) { // debug 此分支是用户直接点击QQ登录,并且这个QQ号已经绑好一个论坛账号了,将直接登进论坛了 + C::t('#qqconnect#common_member_connect')->update($connect_member['uid'], array( + 'conuintoken' => $conuintoken, + 'conopenid' => $conopenid, + 'conisfeed' => 1, + )); + + $params['mod'] = 'login'; + connect_login($connect_member); + + loadcache('usergroups'); + $usergroups = $_G['cache']['usergroups'][$_G['groupid']]['grouptitle']; + $param = array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle']); + + C::t('common_member_status')->update($connect_member['uid'], array('lastip'=>$_G['clientip'], 'lastvisit'=>TIMESTAMP, 'lastactivity' => TIMESTAMP)); + $ucsynlogin = ''; + if($_G['setting']['allowsynlogin']) { + loaducenter(); + $ucsynlogin = uc_user_synlogin($_G['uid']); + } + + dsetcookie('stats_qc_login', 3, 86400); + showmessage('login_succeed', $referer, $param, array('extrajs' => $ucsynlogin)); + + } else { // debug 此分支是用户直接点击QQ登录,并且这个QQ号还未绑定任何论坛账号,将将跳转到一个新页引导用户注册个新论坛账号或绑一个已有的论坛账号 + + $auth_hash = authcode($conopenid, 'ENCODE'); + $insert_arr = array( + 'conuintoken' => $conuintoken, + 'conopenid' => $conopenid, + ); + + $connectGuest = C::t('#qqconnect#common_connect_guest')->fetch($conopenid); + if ($connectGuest['conqqnick']) { + $insert_arr['conqqnick'] = $connectGuest['conqqnick']; + } else { + try { + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/ConnectOAuth.php'; + $connectOAuthClient = new Cloud_Service_Client_ConnectOAuth(); + $connectUserInfo = $connectOAuthClient->connectGetUserInfo_V2($conopenid, $conuintoken); + if ($connectUserInfo['nickname']) { + $connectUserInfo['nickname'] = strip_tags($connectUserInfo['nickname']); + $insert_arr['conqqnick'] = $connectUserInfo['nickname']; + } + } catch(Exception $e) { + } + } + + if ($insert_arr['conqqnick']) { + dsetcookie('connect_qq_nick', $insert_arr['conqqnick'], 86400); + } + + C::t('#qqconnect#common_connect_guest')->insert($insert_arr, false, true); + + dsetcookie('con_auth_hash', $auth_hash, 86400); + dsetcookie('connect_js_name', 'guest_ptlogin', 86400); + dsetcookie('stats_qc_login', 4, 86400); + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + + $refererParams = explode('/', $referer); + $mobileId = $refererParams[count($refererParams) - 1]; + + if (substr($mobileId, 0, 7) == 'Mobile_') { + showmessage('login_succeed', $referer); + } else { + $referer = 'member.php?mod=connect&referer='.urlencode($referer); + $utilService->redirect($referer); + } + + } + } + +} elseif($op == 'change') { + $callback = $_G['connect']['callback_url'] . '&referer=' . urlencode($_GET['referer']); + + try { + dsetcookie('con_request_uri', $callback); + $redirect = $connectOAuthClient->getOAuthAuthorizeURL_V2($callback); + if(defined('IN_MOBILE') || $_GET['oauth_style'] == 'mobile') { + $redirect .= '&display=mobile'; + } + } catch(Exception $e) { + showmessage('qqconnect:connect_get_request_token_failed_code', $referer, array('codeMessage' => getErrorMessage($e->getmessage()), 'code' => $e->getmessage())); + } + + dheader('Location:' . $redirect); +} + +function connect_login($connect_member) { + global $_G; + + if(!($member = getuserbyuid($connect_member['uid'], 1))) { + return false; + } else { + if(isset($member['_inarchive'])) { + C::t('common_member_archive')->move_to_master($member['uid']); + } + } + + require_once libfile('function/member'); + $cookietime = 1296000; + setloginstatus($member, $cookietime); + + dsetcookie('connect_login', 1, $cookietime); + dsetcookie('connect_is_bind', '1', 31536000); + dsetcookie('connect_uin', $connect_member['conopenid'], 31536000); + return true; +} + +function getErrorMessage($errroCode) { + $str = sprintf('connect_error_code_%d', $errroCode); + + return lang('plugin/qqconnect', $str); +} \ No newline at end of file diff --git a/source/plugin/qqconnect/connect/connect_user.php b/source/plugin/qqconnect/connect/connect_user.php new file mode 100644 index 0000000..20bf8aa --- /dev/null +++ b/source/plugin/qqconnect/connect/connect_user.php @@ -0,0 +1,67 @@ +fetch($conopenid); + if(!$connect_guest) { + dsetcookie('con_auth_hash'); + connect_error_output('qqconnect:connect_login_first'); + } + + $conuin = $connect_guest['conuin']; + $conuinsecret = $connect_guest['conuinsecret']; + + if($conuin && $conuinsecret && $conopenid) { + try { + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/ConnectOAuth.php'; + $connectOAuthClient = new Cloud_Service_Client_ConnectOAuth(); + $connect_user_info = $connectOAuthClient->connectGetUserInfo($conopenid, $conuin, $conuinsecret); + } catch(Exception $e) { + connect_error_output(); + } + if ($connect_user_info['nickname']) { + $qq_nick = $connect_user_info['nickname']; + $connect_nickname = $connectService->connectFilterUsername($qq_nick); + } + + loaducenter(); + $ucresult = uc_user_checkname($connect_nickname); + $first_available_username = ''; + if($ucresult >= 0) { + $first_available_username = $connect_nickname; + } + echo $first_available_username; + } +} + +include template('common/footer'); + +function connect_error_output($error = '') { + include template('common/footer'); + exit; +} \ No newline at end of file diff --git a/source/plugin/qqconnect/connect/index.htm b/source/plugin/qqconnect/connect/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/qqconnect/discuz_plugin_qqconnect.xml b/source/plugin/qqconnect/discuz_plugin_qqconnect.xml new file mode 100644 index 0000000..ddb15b0 --- /dev/null +++ b/source/plugin/qqconnect/discuz_plugin_qqconnect.xml @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {code},请您稍候再试。谢谢。]]> + + {code},请您稍候再试。谢谢。]]> + + + + + + {code},请您稍候再尝试解绑。谢谢。]]> + + 更换其他QQ账号登录]]> + + + + + + + +
          点击QQ登录页面将发生跳转]]>
          + + + + QQ登录,马上完善授权]]> + + + + 完善账号信息 或 绑定已有账号,无法进行此操作]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {$_G[member][username]}
          与QQ号码绑定]]> + + + + + + + + + + + + + + + + $_G[member][username],请设置本站登录密码]]> + + 这里退出后]]> + + + + + +
          点击QQ登录页面将发生跳转,请确保您已保存好文章数据]]>
          +
          点击QQ登录页面将发生跳转]]>
          + + + + 创建密码
          ]]> + 更换其他QQ账号]]> + + + + 提示:点击这里退出后,重新使用QQ账号登录。]]> + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/plugin/qqconnect/index.htm b/source/plugin/qqconnect/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/plugin/qqconnect/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/plugin/qqconnect/install.php b/source/plugin/qqconnect/install.php new file mode 100644 index 0000000..981c123 --- /dev/null +++ b/source/plugin/qqconnect/install.php @@ -0,0 +1,193 @@ +fetch_setting('connect', true); + +$sql = <<fetch($connect['guest_groupid']); + if ($group) { + $needCreateGroup = false; + } +} else { + $connect = array ( + 'allow' => '1', + 'feed' => + array ( + 'allow' => '1', + 'group' => '0', + ), + 't' => + array ( + 'allow' => '1', + 'group' => '0', + 'reply' => 1, + 'reply_showauthor' => 1, + ), + 'like_allow' => '1', + 'like_qq' => '', + 'turl_allow' => '1', + 'turl_qq' => '', + 'like_url' => '', + 'register_birthday' => '0', + 'register_gender' => '0', + 'register_uinlimit' => '', + 'register_rewardcredit' => '1', + 'register_addcredit' => '', + 'register_groupid' => '0', + 'register_regverify' => '1', + 'register_invite' => '0', + 'newbiespan' => '', + 'turl_code' => '', + 'mblog_app_key' => 'abc', + ); +} + +if ($needCreateGroup) { + $name = $installlang['connect_guest_group_name']; + $userGroupData = array( + 'type' => 'special', + 'grouptitle' => $name, + 'allowvisit' => 1, + 'color' => '', + 'stars' => '', + ); + $newGroupId = C::t('common_usergroup')->insert($userGroupData, true); + + $dataField = array( + 'groupid' => $newGroupId, + 'allowsearch' => 2, + 'readaccess' => 1, + 'allowgetattach' => 1, + 'allowgetimage' => 1, + ); + C::t('common_usergroup_field')->insert($dataField); + + $connect['guest_groupid'] = $newGroupId; + updatecache('usergroups'); +} + +$https = json_decode(dfsockopen('https://graph.qq.com/user/get_user_info')); +$connect['oauth2'] = $https->ret == -1 ? 1 : 0; + +C::t('common_setting')->update_setting('connect', serialize($connect)); +updatecache('setting'); +$finish = true; \ No newline at end of file diff --git a/source/plugin/qqconnect/lib/Connect.php b/source/plugin/qqconnect/lib/Connect.php new file mode 100644 index 0000000..e483610 --- /dev/null +++ b/source/plugin/qqconnect/lib/Connect.php @@ -0,0 +1,580 @@ +fetch($_G['uid']); + if ($connect_member) { + $_G['member'] = array_merge($_G['member'], $connect_member); + $user_auth_fields = $connect_member['conisfeed']; + if ($user_auth_fields == 0) { + $_G['member']['is_user_info'] = 0; + $_G['member']['is_feed'] = 0; + } elseif ($user_auth_fields == 1) { + $_G['member']['is_user_info'] = 1; + $_G['member']['is_feed'] = 0; + } elseif ($user_auth_fields == 2) { + $_G['member']['is_user_info'] = 1; + $_G['member']['is_feed'] = 0; + } elseif ($user_auth_fields == 3) { + $_G['member']['is_user_info'] = 0; + $_G['member']['is_feed'] = 0; + } + unset($connect_member, $_G['member']['conisfeed']); + } + $merged = true; + } + + public function connectUserBindParams() { + global $_G; + + $this->connectMergeMember(); + getuserprofile('birthyear'); + getuserprofile('birthmonth'); + getuserprofile('birthday'); + switch ($_G['member']['gender']) { + case 1 : + $sex = 'male'; + break; + case 2 : + $sex = 'female'; + break; + default : + $sex = 'unknown'; + } + + $is_public_email = 2; + $is_use_qq_avatar = $_G['member']['conisqzoneavatar'] == 1 ? 1 : 2; + $birthday = sprintf('%04d', $_G['member']['birthyear']).'-'.sprintf('%02d', $_G['member']['birthmonth']).'-'.sprintf('%02d', $_G['member']['birthday']); + + $agent = md5(time().rand().uniqid()); + $inputArray = array ( + 'uid' => $_G['uid'], + 'agent' => $agent, + 'time' => TIMESTAMP + ); + require_once DISCUZ_ROOT.'./config/config_ucenter.php'; + $input = 'uid='.$_G['uid'].'&agent='.$agent.'&time='.TIMESTAMP; + $avatar_input = authcode($input, 'ENCODE', UC_KEY); + + $params = array ( + 'oauth_consumer_key' => $_G['setting']['connectappid'], + 'u_id' => $_G['uid'], + 'username' => $_G['member']['username'], + 'email' => $_G['member']['email'], + 'birthday' => $birthday, + 'sex' => $sex, + 'is_public_email' => $is_public_email, + 'is_use_qq_avatar' => $is_use_qq_avatar, + 's_id' => null, + 'avatar_input' => $avatar_input, + 'avatar_agent' => $agent, + 'site_ucenter_id' => UC_APPID, + 'source' => 'qzone', + ); + + return $params; + } + + public function connectFeedResendJs() { + global $_G; + + $jsname = $_G['cookie']['connect_js_name']; + if($jsname != 'feed_resend') { + return false; + } + + $params = dunserialize(base64_decode($_G['cookie']['connect_js_params'])); + $params['sig'] = $this->connectGetSig($params, $this->connectGetSigKey()); + + $jsurl = $_G['connect']['discuz_new_feed_url']; + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + $jsurl .= '?' . $utilService->httpBuildQuery($params, '', '&'); + + return $jsurl; + } + + public function connectCookieLoginJs() { + global $_G; + + return $ajaxUrl = 'connect.php?mod=check&op=cookie'; + } + + public function connectGetSigKey() { + global $_G; + + return $_G['setting']['connectappid'] . '|' . $_G['setting']['connectappkey']; + } + + + public function connectGetSig($params, $app_key) { + ksort($params); + $base_string = ''; + foreach($params as $key => $value) { + $base_string .= $key.'='.$value; + } + $base_string .= $app_key; + return md5($base_string); + } + + public function connectParseBbcode($bbcode, $fId, $pId, $isHtml, &$attachImages) { + include_once libfile('function/discuzcode'); + + $result = preg_replace('/\[hide(=\d+)?\].+?\[\/hide\](\r\n|\s)/i', '', $bbcode); + $result = preg_replace('/\[payto(=\d+)?\].+?\[\/payto\](\r\n|\s)/i', '', $result); + $result = preg_replace('/\[quote\].*\[\/quote\](\r\n|\n|\r){0,}/is', '', $result); + $result = discuzcode($result, 0, 0, $isHtml, 1, 2, 1, 0, 0, 0, 0, 1, 0); + $result = strip_tags($result, ''); + $result = preg_replace('/connectParseAttach($result, $fId, $pId, $attachImages, $attachImageThumb); + return $result; + } + + public function connectParseAttach($content, $fId, $pId, &$attachImages) { + global $_G; + + $permissions = $this->connectGetUserGroupPermissions(self::SPECIAL_GID, $fId); + $visitorPermission = $permissions[self::SPECIAL_GID]; + + $attachIds = array(); + $attachImages = array (); + $attachments = C::t('forum_attachment')->fetch_all_by_id('pid', $pId); + $attachments = C::t('forum_attachment_n')->fetch_all_attachment("pid:$pId", array_keys($attachments)); + + foreach ($attachments as $k => $attach) { + $aid = $attach['aid']; + if($attach['isimage'] == 0 || $attach['price'] > 0 || $attach['readperm'] > $visitorPermission['readPermission'] || in_array($fId, $visitorPermission['forbidViewAttachForumIds']) || in_array($attach['aid'], $attachIds)) { + continue; + } + + $imageItem = array (); + $thumbWidth = '100'; + $thumbHeight = '100'; + $bigWidth = '400'; + $bigHeight = '400'; + $thumbImageURL = $_G['siteurl'] . getforumimg($aid, 1, $thumbWidth, $thumbHeight, 'fixwr'); + $bigImageURL = $_G['siteurl'] . getforumimg($aid, 1, $bigWidth, $bigHeight, 'fixnone'); + $imageItem['aid'] = $aid; + $imageItem['thumb'] = $thumbImageURL; + $imageItem['big'] = $bigImageURL; + if($attach['remote']) { + $imageItem['path'] = $_G['setting']['ftp']['attachurl'].'forum/'.$attach['attachment']; + $imageItem['remote'] = true; + } else { + $imageItem['path'] = $_G['setting']['attachdir'].'forum/'.$attach['attachment']; + } + + $attachIds[] = $aid; + $attachImages[] = $imageItem; + } + + $this->connectParseAttach_callback_connectParseAttachTag_1($attachNames, 1); + + $content = preg_replace_callback('/\[attach\](\d+)\[\/attach\]/i', array($this, 'connectParseAttach_callback_connectParseAttachTag_1'), $content); + + return $content; + } + + public function connectParseAttach_callback_connectParseAttachTag_1($matches, $action = 0) { + static $attachNames = ''; + + if($action == 1) { + $attachNames = $matches; + } else { + return $this->connectParseAttachTag($matches[1], $attachNames); + } + } + + public function connectParseAttachTag($attachId, $attachNames) { + include_once libfile('function/discuzcode'); + if(array_key_exists($attachId, $attachNames)) { + return ''.$attachNames[$attachId].''; + } + return ''; + } + + function connectGetUserGroupPermissions($gid, $fid) { + global $_G; + + loadcache('usergroups'); + $fields = array ( + 'groupid' => 'userGroupId', + 'grouptitle' => 'userGroupName', + 'readaccess' => 'readPermission', + 'allowvisit' => 'allowVisit' + ); + $userGroup = C::t('common_usergroup')->fetch_all_usergroup($gid); + $userGroupInfo = array(); + foreach ($userGroup as $id => $value) { + $userGroupInfo[$id] = array_merge($value, $_G['cache']['usergroups'][$id]); + $userGroupInfo[$id]['forbidForumIds'] = array (); + $userGroupInfo[$id]['allowForumIds'] = array (); + $userGroupInfo[$id]['specifyAllowForumIds'] = array (); + $userGroupInfo[$id]['allowViewAttachForumIds'] = array (); + $userGroupInfo[$id]['forbidViewAttachForumIds'] = array (); + foreach ($fields as $k => $v) { + $userGroupInfo[$id][$v] = $userGroupInfo[$id][$k]; + } + } + $forumField = C::t('forum_forumfield')->fetch($fid); + $allowViewGroupIds = array (); + if($forumField['viewperm']) { + $allowViewGroupIds = explode("\t", $forumField['viewperm']); + } + $allowViewAttachGroupIds = array (); + if($forumField['getattachperm']) { + $allowViewAttachGroupIds = explode("\t", $forumField['getattachperm']); + } + + foreach ($userGroupInfo as $groupId => $value) { + if($forumField['password']) { + $userGroupInfo[$groupId]['forbidForumIds'][] = $fid; + continue; + } + $perm = dunserialize($forumField['formulaperm']); + if(is_array($perm)) { + if($perm[0] || $perm[1] || $perm['users']) { + $userGroupInfo[$groupId]['forbidForumIds'][] = $fid; + continue; + } + } + + if(!$allowViewGroupIds) { + $userGroupInfo[$groupId]['allowForumIds'][] = $fid; + } elseif (!in_array($groupId, $allowViewGroupIds)) { + $userGroupInfo[$groupId]['forbidForumIds'][] = $fid; + } elseif (in_array($groupId, $allowViewGroupIds)) { + $userGroupInfo[$groupId]['allowForumIds'][] = $fid; + $userGroupInfo[$groupId]['specifyAllowForumIds'][] = $fid; + } + + if(!$allowViewAttachGroupIds) { + $userGroupInfo[$groupId]['allowViewAttachForumIds'][] = $fid; + } elseif (!in_array($groupId, $allowViewAttachGroupIds)) { + $userGroupInfo[$groupId]['forbidViewAttachForumIds'][] = $fid; + } elseif (in_array($groupId, $allowViewGroupIds)) { + $userGroupInfo[$groupId]['allowViewAttachForumIds'][] = $fid; + } + } + + return $userGroupInfo; + } + + public function connectOutputPhp($url, $postData = '') { + global $_G; + + $response = dfsockopen($url, 0, $postData, '', false, $_G['setting']['cloud_api_ip']); + $result = (array) dunserialize($response); + return $result; + } + + public function connectJsOutputMessage($msg = '', $errMsg = '', $errCode = '') { + $result = array ( + 'result' => $msg, + 'errMessage' => $errMsg, + 'errCode' => $errCode + ); + echo sprintf('con_handle_response(%s);', json_encode($this->_connectUrlencode($result))); + exit; + } + + protected function _connectUrlencode($value) { + + if (is_array($value)) { + foreach ($value as $k => $v) { + $value[$k] = $this->_connectUrlencode($v); + } + } else if (is_string($value)) { + $value = urlencode(str_replace(array("\r\n", "\r", "\n", "\"", "\/", "\t"), array('\\n', '\\n', '\\n', '\\"', '\\/', '\\t'), $value)); + } + + return $value; + } + + public function connectCookieLoginParams() { + global $_G; + + $this->connectMergeMember(); + $oauthToken = $_G['member']['conuin']; + $api_url = $_G['connect']['api_url'].'/connect/discuz/cookieReport'; + + if($oauthToken) { + $extra = array ( + 'oauth_token' => $oauthToken + ); + + $sig_params = $this->connectGetOauthSignatureParams($extra); + + $oauth_token_secret = $_G['member']['conuinsecret']; + $sig_params['oauth_signature'] = $this->connectGetOauthSignature($api_url, $sig_params, 'POST', $oauth_token_secret); + $params = array ( + 'client_ip' => $_G['clientip'], + 'u_id' => $_G['uid'], + 'version' => 'qzone1.0', + ); + + $params = array_merge($sig_params, $params); + $params['response_type'] = 'php'; + + return $params; + } else { + return false; + } + } + + function connectAddCookieLogins() { + global $_G; + + loadcache('connect_has_setting_count'); + if (!$_G['cache']['connect_has_setting_count']) { + $times = C::t('common_setting')->fetch_setting('connect_login_times'); + C::t('common_setting')->update_setting('connect_login_times', $times + 1); + savecache('connect_has_setting_count', '1'); + } else { + C::t('common_setting')->update_count('connect_login_times', 1); + } + + $life = 86400; + $current_date = date('Y-m-d'); + dsetcookie('connect_last_report_time', $current_date, $life); + + return true; + } + + public function connectAjaxOuputMessage($msg = '', $errCode = '') { + + @header("Content-type: text/html; charset=".CHARSET); + + echo "errCode=$errCode&result=$msg"; + exit; + } + + public function connectGetOauthSignature($url, $params, $method = 'POST', $oauth_token_secret = '') { + + global $_G; + + $method = strtoupper($method); + if(!in_array($method, array ('GET', 'POST'))) { + return FALSE; + } + + $url = urlencode($url); + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + $param_str = urlencode($utilService->httpBuildQuery($params, '', '&')); + + $base_string = $method.'&'.$url.'&'.$param_str; + + $key = $_G['setting']['connectappkey'].'&'.$oauth_token_secret; + + $signature = $utilService->hashHmac('sha1', $base_string, $key); + + return $signature; + } + + public function connectGetOauthSignatureParams($extra = array ()) { + global $_G; + + $params = array ( + 'oauth_consumer_key' => $_G['setting']['connectappid'], + 'oauth_nonce' => $this->_connectGetNonce(), + 'oauth_signature_method' => 'HMAC_SHA1', + 'oauth_timestamp' => TIMESTAMP + ); + if($extra) { + $params = array_merge($params, $extra); + } + ksort($params); + + return $params; + } + + protected function _connectGetNonce() { + $mt = microtime(); + $rand = mt_rand(); + + return md5($mt.$rand); + } + + public function connectParseXml($contents, $getAttributes = true, $priority = 'tag') { + if (!$contents) { + return array(); + } + + if (!function_exists('xml_parser_create')) { + return array(); + } + + $parser = xml_parser_create(''); + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'UTF-8'); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, trim($contents), $xmlValues); + xml_parser_free($parser); + + if (!$xmlValues) { + return; + } + + $xmlArray = $parent = array(); + + $current = &$xmlArray; + $repeatedTagIndex = array(); + + foreach($xmlValues as $data) { + unset($attributes, $value); + extract($data); + + $result = $attributesData = array(); + + if (isset($value)) { + if ($priority == 'tag') { + $result = $value; + } else { + $result['value'] = $value; + } + } + + if (isset($attributes) && $getAttributes) { + foreach ($attributes as $attr => $val) { + if ($priority == 'tag') { + $attributesData[$attr] = $val; + } else { + $result['attr'][$attr] = $val; + } + } + } + + if ($type == 'open') { + $parent[$level - 1] = &$current; + if (!is_array($current) || (!in_array($tag, array_keys($current)))) { + $current[$tag] = $result; + if ($attributesData) { + $current[$tag . '_attr'] = $attributesData; + } + $repeatedTagIndex[$tag . '_' . $level] = 1; + $current = &$current[$tag]; + } else { + if (isset($current[$tag][0])) { + $current[$tag][$repeatedTagIndex[$tag . '_' . $level]] = $result; + $repeatedTagIndex[$tag . '_' . $level] ++; + } else { + $current[$tag] = array($current[$tag], $result); + $repeatedTagIndex[$tag . '_' . $level] = 2; + if (isset($current[$tag . '_attr'])) { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset($current[$tag . '_attr']); + } + } + $lastItemIndex = $repeatedTagIndex[$tag . '_' . $level] - 1; + $current = &$current[$tag][$lastItemIndex]; + } + } elseif($type == 'complete') { + if (!isset($current[$tag])) { + $current[$tag] = $result; + $repeatedTagIndex[$tag . '_' . $level] = 1; + if ($priority == 'tag' && $attributesData) { + $current[$tag . '_attr'] = $attributesData; + } + } else { + if (isset($current[$tag][0]) && is_array($current[$tag])) { + $current[$tag][$repeatedTagIndex[$tag . '_' . $level]] = $result; + if ($priority == 'tag' && $getAttributes && $attributesData) { + $current[$tag][$repeatedTagIndex[$tag . '_' . $level] . '_attr'] = $attributesData; + } + $repeatedTagIndex[$tag . '_' . $level] ++; + } else { + $current[$tag] = array($current[$tag], $result); + $repeatedTagIndex[$tag . '_' . $level] = 1; + if ($priority == 'tag' && $getAttributes) { + if (isset($current[$tag . '_attr'])) { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset($current[$tag . '_attr']); + } + if ($attributesData) { + $current[$tag][$repeatedTagIndex[$tag . '_' . $level] . '_attr'] = $attributesData; + } + } + $repeatedTagIndex[$tag . '_' . $level] ++; + } + } + } elseif($type == 'close') { + $current = &$parent[$level - 1]; + } + } + + return $xmlArray[key($parent[0])] ? $xmlArray[key($parent[0])] : $xmlArray; + } + + + public function connectFilterUsername($username) { + $username = str_replace(' ', '_', trim($username)); + return cutstr($username, 15, ''); + } + + public function connectErrlog($errno, $error) { + return true; + } + + function connectCookieLoginReport($loginTimes) { + global $_G; + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + $response = ''; + + if ($loginTimes) { + $api_url = $_G['connect']['api_url'].'/connect/discuz/batchCookieReport'; + $params = array ( + 'oauth_consumer_key' => $_G['setting']['connectappid'], + 'login_times' => $loginTimes, + 'date' => dgmdate(TIMESTAMP - 86400, 'Y-m-d'), + 'ts' => TIMESTAMP, + ); + $params['sig'] = $this->connectGetSig($params, $this->connectGetSigKey()); + + $response = $this->connectOutputPhp($api_url.'?', $utilService->httpBuildQuery($params, '', '&')); + } else { + $response = array('status' => 0); + } + + return $response; + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/lib/ConnectOAuth.php b/source/plugin/qqconnect/lib/ConnectOAuth.php new file mode 100644 index 0000000..d756c36 --- /dev/null +++ b/source/plugin/qqconnect/lib/ConnectOAuth.php @@ -0,0 +1,524 @@ +setAppkey($connectAppId, $connectAppKey); + if(!$this->_appKey || !$this->_appSecret) { + throw new Exception('connectAppId/connectAppKey Invalid', __LINE__); + } + + if(!$apiIp) { + global $_G; + $apiIp = $_G['setting']['connect_api_ip'] ? $_G['setting']['connect_api_ip'] : ''; + } + + if($apiIp && !$_G['setting']['connect']['oauth2']) { + $this->setApiIp($apiIp); + } + } + + public function connectGetRequestToken($callback, $clientIp = '') { + + $extra = array(); + + $extra['oauth_callback'] = rawurlencode($callback); + + if ($clientIp) { + $extra['oauth_client_ip'] = $clientIp; + } + + $this->setTokenSecret(''); + $response = $this->_request($this->_requestTokenURL, $extra); + + parse_str($response, $params); + if($params['oauth_token'] && $params['oauth_token_secret']) { + return $params; + } else { + $params['error_code'] = $params['error_code'] ? $params['error_code'] : self::RESPONSE_ERROR; + throw new Exception($params['error_code'], __LINE__); + } + + } + + public function getOAuthAuthorizeURL($requestToken) { + + $params = array( + 'oauth_consumer_key' => $this->_appKey, + 'oauth_token' => $requestToken, + ); + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + $oAuthAuthorizeURL = $this->_oAuthAuthorizeURL.'?'.$utilService->httpBuildQuery($params, '', '&'); + + return $oAuthAuthorizeURL; + } + + private function _connectIsValidOpenid($openId, $timestamp, $sig) { + + $key = $this->_appSecret; + $str = $openId.$timestamp; + $signature = $this->customHmac($str, $key); + return $sig == $signature; + } + + public function connectGetAccessToken($params, $requestTokenSecret) { + + if(!$this->_connectIsValidOpenid($params['openid'], $params['timestamp'], $params['oauth_signature'])) { + throw new Exception('openId signature invalid', __LINE__); + } + + if(!$params['oauth_token'] || !$params['oauth_vericode']) { + throw new Exception('requestToken/vericode invalid', __LINE__); + } + + $extra = array( + 'oauth_token' => $params['oauth_token'], + 'oauth_vericode' => $params['oauth_vericode'], + ); + $this->setTokenSecret($requestTokenSecret); + $response = $this->_request($this->_accessTokenURL, $extra); + + parse_str($response, $result); + if($result['oauth_token'] && $result['oauth_token_secret'] && $result['openid']) { + return $result; + } else { + $result['error_code'] = $result['error_code'] ? $result['error_code'] : self::RESPONSE_ERROR; + throw new Exception($result['error_code'], __LINE__); + } + } + + public function connectGetUserInfo($openId, $accessToken, $accessTokenSecret) { + + $extra = array( + 'oauth_token' => $accessToken, + 'openid' => $openId, + 'format' => 'xml', + ); + $this->setTokenSecret($accessTokenSecret); + $response = $this->_request($this->_getUserInfoURL, $extra); + + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + } + + private function _request($requestURL, $extra = array(), $oauthMethod = 'GET', $multi = array()) { + + if(!$this->_appKey || !$this->_appSecret) { + throw new Exception('appKey or appSecret not init'); + } + + if(strtoupper(CHARSET) != 'UTF-8') { + foreach((array)$extra as $k => $v) { + $extra[$k] = diconv($v, CHARSET, 'UTF-8'); + } + } + + return $this->getRequest($requestURL, $extra, $oauthMethod, $multi); + } + + private function _xmlParse($data) { + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Connect.php'; + $connectService = new Cloud_Service_Connect(); + $data = $connectService->connectParseXml($data); + if (strtoupper(CHARSET) != 'UTF-8') { + $data = $this->_iconv($data, 'UTF-8', CHARSET); + } + + if(!isset($data['ret']) && !isset($data['errcode'])) { + $data = array( + 'ret' => self::RESPONSE_ERROR, + 'msg' => self::RESPONSE_ERROR_MSG + ); + } + + return $data; + } + + private function _iconv($data, $inputCharset, $outputCharset) { + if (is_array($data)) { + foreach($data as $key => $val) { + $value = array_map(array($this, '_iconv'), array($val), array($inputCharset), array($outputCharset)); + $result[$key] = $value[0]; + } + } else { + $result = diconv($data, $inputCharset, $outputCharset); + } + return $result; + + } + + public function connectAddShare($openId, $accessToken, $accessTokenSecret, $params) { + if(!$params['title'] || !$params['url']) { + throw new Exception('Required Parameter Missing'); + } + + $paramsName = array('title', 'url', 'comment', 'summary', 'images', 'source', 'type', 'playurl', 'nswb'); + + if($params['title']) { + $params['title'] = cutstr($params['title'], 72, ''); + } + + if($params['comment']) { + $params['comment'] = cutstr($params['comment'], 80, ''); + } + + if($params['summary']) { + $params['summary'] = cutstr($params['summary'], 160, ''); + } + + if($params['images']) { + $params['images'] = cutstr($params['images'], 255, ''); + } + + if($params['playurl']) { + $params['playurl'] = cutstr($params['playurl'], 256, ''); + } + + $extra = array( + 'oauth_token' => $accessToken, + 'openid' => $openId, + 'format' => 'xml', + ); + + foreach($paramsName as $name) { + if($params[$name]) { + $extra[$name] = $params[$name]; + } + } + + $this->setTokenSecret($accessTokenSecret); + $response = $this->_request($this->_addShareURL, $extra, 'POST'); + + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + + } + + public function connectAddPicT($openId, $accessToken, $accessTokenSecret, $params) { + if(!$params['content'] || !$params['pic']) { + throw new Exception('Required Parameter Missing'); + } + + $paramsName = array('content', 'pic', 'clientip', 'jing', 'wei', 'syncflag'); + $extra = array( + 'oauth_token' => $accessToken, + 'openid' => $openId, + 'format' => 'xml', + ); + + foreach($paramsName as $name) { + if($params[$name]) { + $extra[$name] = $params[$name]; + } + } + $pic = $extra['pic']; + unset($extra['pic']); + + $this->setTokenSecret($accessTokenSecret); + $response = $this->_request($this->_addPicTURL, $extra, 'POST', array('pic' => $pic, 'remote' => $params['remote'] ? true : false)); + + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + } + + + public function connectAddT($openId, $accessToken, $accessTokenSecret, $params) { + if(!$params['content']) { + throw new Exception('Required Parameter Missing'); + } + + $paramsName = array('content', 'clientip', 'jing', 'wei'); + $extra = array( + 'oauth_token' => $accessToken, + 'openid' => $openId, + 'format' => 'xml', + ); + + foreach($paramsName as $name) { + if($params[$name]) { + $extra[$name] = $params[$name]; + } + } + + $this->setTokenSecret($accessTokenSecret); + $response = $this->_request($this->_addTURL, $extra, 'POST'); + + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + + } + + public function connectGetRepostList($openId, $accessToken, $accessTokenSecret, $params) { + if(!isset($params['flag']) || !$params['rootid'] || !isset($params['pageflag']) || !isset($params['pagetime']) || !$params['reqnum'] || !isset($params['twitterid'])) { + throw new Exception('Required Parameter Missing'); + } + + $paramsName = array('flag', 'rootid', 'pageflag', 'pagetime', 'reqnum', 'twitterid'); + $extra = array( + 'oauth_token' => $accessToken, + 'openid' => $openId, + 'format' => 'xml', + ); + + foreach($paramsName as $name) { + if($params[$name]) { + $extra[$name] = $params[$name]; + } + } + $this->setTokenSecret($accessTokenSecret); + $response = $this->_request($this->_getReportListURL, $extra, 'GET'); + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + } + + public function getOAuthAuthorizeURL_V2($redirect_uri) { + $params = array( + 'response_type' => 'code', + 'client_id' => $this->_appKey, + 'redirect_uri' => $redirect_uri, + 'state' => md5(FORMHASH), + 'scope' => 'get_user_info,add_share,add_t,add_pic_t,get_repost_list', + ); + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + return $this->_oAuthAuthorizeURL_V2.'?'.$utilService->httpBuildQuery($params, '', '&'); + } + + public function connectGetOpenId_V2($redirect_uri, $code) { + $params = array( + 'grant_type' => 'authorization_code', + 'client_id' => $this->_appKey, + 'redirect_uri' => $redirect_uri, + 'client_secret' => $this->_appSecret, + 'code' => $code + ); + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + $response = $this->dfsockopen($this->_accessTokenURL_V2.'?'.$utilService->httpBuildQuery($params, '', '&')); + parse_str($response, $result); + if($result['access_token'] && $result['refresh_token']) { + $params = array( + 'access_token' => $result['access_token'] + ); + $response = $this->callback($this->dfsockopen($this->_openIdURL_V2.'?'.$utilService->httpBuildQuery($params, '', '&'))); + if($response['openid']) { + $result = array( + 'openid' => $response['openid'], + 'access_token' => $result['access_token'] + ); + return $result; + } else { + $result['error'] = $result['error'] ? $result['error'] : self::RESPONSE_ERROR; + throw new Exception($result['error'], __LINE__); + } + } else { + $result = $this->callback($response); + $result['error'] = $result['error'] ? $result['error'] : self::RESPONSE_ERROR; + throw new Exception($result['error'], __LINE__); + } + } + + public function connectGetUserInfo_V2($openId, $accessToken) { + $params = array( + 'access_token' => $accessToken, + 'oauth_consumer_key' => $this->_appKey, + 'openid' => $openId + ); + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + $response = $this->dfsockopen($this->_getUserInfoURL_V2.'?'.$utilService->httpBuildQuery($params, '', '&')); + + $data = json_decode($response, true); + $data = $this->_iconv($data, 'UTF-8', CHARSET); + + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + } + + public function connectAddShare_V2($openId, $accessToken, $params) { + if(!$params['title'] || !$params['url']) { + throw new Exception('Required Parameter Missing'); + } + + $paramsName = array('title', 'url', 'comment', 'summary', 'images', 'source', 'type', 'playurl', 'nswb'); + + if($params['title']) { + $params['title'] = diconv(cutstr($params['title'], 72, ''), CHARSET, 'UTF-8'); + } + + if($params['comment']) { + $params['comment'] = diconv(cutstr($params['comment'], 80, ''), CHARSET, 'UTF-8'); + } + + if($params['summary']) { + $params['summary'] = diconv(cutstr($params['summary'], 160, ''), CHARSET, 'UTF-8'); + } + + if($params['images']) { + $params['images'] = cutstr($params['images'], 255, ''); + } + + if($params['playurl']) { + $params['playurl'] = cutstr($params['playurl'], 256, ''); + } + + $extra = array( + 'access_token' => $accessToken, + 'oauth_consumer_key' => $this->_appKey, + 'openid' => $openId, + 'format' => 'xml', + ); + + foreach($paramsName as $name) { + if($params[$name]) { + $extra[$name] = $params[$name]; + } + } + + $response = $this->dfsockopen($this->_addShareURL_V2, $extra); + + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + + } + + public function connectAddPicT_V2($openId, $accessToken, $params) { + if(!$params['content'] || !$params['pic']) { + throw new Exception('Required Parameter Missing'); + } + + $extra = array( + 'access_token' => $accessToken, + 'oauth_consumer_key' => $this->_appKey, + 'openid' => $openId, + 'content' => diconv($params['content'], CHARSET, 'UTF-8'), + 'format' => 'xml', + ); + + $response = $this->dfsockopen($this->_addPicTURL_V2, $extra, array('pic' => $params['pic'])); + + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + } + + public function connectAddT_V2($openId, $accessToken, $params) { + if(!$params['content']) { + throw new Exception('Required Parameter Missing'); + } + $extra = array( + 'access_token' => $accessToken, + 'oauth_consumer_key' => $this->_appKey, + 'openid' => $openId, + 'content' => diconv($params['content'], CHARSET, 'UTF-8'), + 'format' => 'xml', + ); + + $response = $this->dfsockopen($this->_addTURL_V2, $extra); + + $data = $this->_xmlParse($response); + if(isset($data['ret']) && $data['ret'] == 0) { + return $data; + } else { + throw new Exception($data['msg'], $data['ret']); + } + + } + +} \ No newline at end of file diff --git a/source/plugin/qqconnect/lib/OAuth.php b/source/plugin/qqconnect/lib/OAuth.php new file mode 100644 index 0000000..260182a --- /dev/null +++ b/source/plugin/qqconnect/lib/OAuth.php @@ -0,0 +1,223 @@ +_apiIp, 15, TRUE, !$files ? 'URLENCODE' : 'FORMDATA', true, 0, $files); + } + + public function callback($response) { + $return = array(); + if(strpos($response, "callback") !== false) { + $lpos = strpos($response, "("); + $rpos = strrpos($response, ")"); + $response = substr($response, $lpos + 1, $rpos - $lpos - 1); + $return = json_decode($response, true); + if(!is_array($return)) { + $return = array(); + } + } + return $return; + } + + public function getRequest($requestURL, $extra = array(), $oauthMethod = 'GET', $multi = array()) { + + if($multi) { + $imageFile = $this->_getImageBinary($multi); + $extra = array_merge($extra, $imageFile['binary']); + } + + $params = $this->_getOAuthSignatureParams($extra); + $params['oauth_signature'] = $this->_getOAuthSignature($requestURL, $params, $oauthMethod, $multi ? TRUE : FALSE); + $queryString = $this->_httpBuildQuery($params, $imageFile['fileInfo']); + if($oauthMethod == 'GET') { + $requestURL = $requestURL.'?'.$queryString; + $queryString = ''; + } else { + $requestURL = $requestURL.'?'; + } + + return $this->dfsockopen($requestURL, $queryString, $multi); + } + + public function getTimestamp() { + return time(); + } + + public function getOAuthNonce() { + return time().(time() % $this->_appKey); + } + + protected function setAppKey($appKey, $appSecret) { + $this->_appKey = $appKey; + $this->_appSecret = $appSecret; + } + + protected function setTokenSecret($tokenSecret) { + $this->_tokenSecret = $tokenSecret; + } + + protected function setApiIp($apiIp) { + $this->_apiIp = $apiIp; + } + + public function customHmac($str, $key) { + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Util.php'; + $utilService = new Cloud_Service_Util(); + return base64_encode($utilService->hashHmac('sha1', $str, $key, true)); + } + + private function _getOAuthSignatureParams($extra = array()) { + + $params = array( + 'oauth_consumer_key' => $this->_appKey, + 'oauth_nonce' => $this->getOAuthNonce(), + 'oauth_signature_method' => self::OAUTH_SIGNATURE_METHOD, + 'oauth_timestamp' => $this->getTimestamp(), + 'oauth_version' => self::OAUTH_VERSION, + ); + + if($extra) { + $params = array_merge($params, $extra); + } + uksort($params, 'strcmp'); + + return $params; + } + + private function _httpBuildQuery($params, $multi = array()) { + + if(!$params) { + return ''; + } + + $multiPartBody = ''; + if($multi) { + $this->_boundary = uniqid('------------------'); + $bodyBoundary = '--'.$this->_boundary; + $endBodyBoundary = $bodyBoundary.'--'; + + foreach($params as $param => $value) { + if(array_key_exists($param, $multi)) { + $ext = strtolower(substr(strrchr($multi[$param]['file'], '.'), 1, 10)); + $fileName = 'picture.'.$ext; + $mime = $multi[$param]['mime']; + $multiPartBody .= $bodyBoundary."\r\n"; + $multiPartBody .= 'Content-Disposition: form-data; name="'.$param.'"; filename="'.$fileName.'"'."\r\n"; + $multiPartBody .= 'Content-Type: '.$mime."\r\n\r\n"; + $multiPartBody .= $value. "\r\n"; + } else { + $multiPartBody .= $bodyBoundary . "\r\n"; + $multiPartBody .= 'content-disposition: form-data; name="'.$param."\"\r\n\r\n"; + $multiPartBody .= $value."\r\n"; + } + } + $multiPartBody .= $endBodyBoundary."\r\n"; + } else { + foreach($params as $param => $value) { + $multiPartBody .= $comma.$this->rawurlencode($param).'='.$this->rawurlencode($value); + $comma = '&'; + } + } + + return $multiPartBody; + } + + private function _getOAuthSignature($url, $params, $method = 'POST', $multi = FALSE) { + + $method = strtoupper($method); + if(!in_array($method, array ('GET', 'POST'))) { + throw new Exception('Request Method Invlid'); + } + + if ($params['oauth_callback']) { + $params['oauth_callback'] = rawurlencode($params['oauth_callback']); + } + + foreach($params as $name => $val) { + $param_str .= $comma.$name.'='.$val; + $comma = '&'; + } + + if($multi) { + $base_string = $method.'&'.$url.'&'.$param_str; + } else { + $base_string = $method.'&'.$this->rawurlencode($url).'&'.$this->rawurlencode($param_str); + } + + $key = $this->_appSecret.'&'.$this->_tokenSecret; + $signature = $this->customHmac($base_string, $key); + + return $signature; + } + + public function rawurlencode($input) { + if(is_array($input)) { + return array_map(array($this, 'rawurlencode'), $input); + } elseif(is_scalar($input)) { + return str_replace('%7E', '~', rawurlencode($input)); + } else { + return ''; + } + } + + private function _getImageBinary($files) { + + $keys = array_keys($files); + $fileInfo = array(); + foreach($keys as $key) { + if($key != 'remote') { + $fileInfo[$key]['file'] = $files[$key]; + $imgInfo = getimagesize($files[$key]); + $fileInfo[$key]['mime'] = $imgInfo['mime']; + + $contents = $use_include_path = null; + if($files['remote']) { + $opt = array( + 'http' => array( + 'timeout' => 10, + ) + ); + $contents = stream_context_create($opt); + } + $files[$key] = file_get_contents($files[$key], $use_include_path, $contents); + } + } + + unset($files['remote']); + return array('binary' => $files, 'fileInfo' => $fileInfo); + } + +} \ No newline at end of file diff --git a/source/plugin/qqconnect/lib/Util.php b/source/plugin/qqconnect/lib/Util.php new file mode 100644 index 0000000..e4831c6 --- /dev/null +++ b/source/plugin/qqconnect/lib/Util.php @@ -0,0 +1,211 @@ +httpBuildQuery($params, '', '&'); + $sig = md5(sprintf('%s|%s|%s', $str, $sKey, $ts)); + + $params['ts'] = $ts; + $params['sig'] = $sig; + + if(!$isReturnArray) { + $params = $this->httpBuildQuery($params, '', '&'); + } + + return $params; + } + + public function redirect($url, $code = 302) { + + @ob_end_clean(); + @ob_start(); + + $errorChars = array(); + for ($i = 0; $i <= 31; $i ++) { + $errorChars[] = chr($i); + } + + $url = trim(str_replace($errorChars, '', $url)); + + if (strpos($url, '/') === 0) { + $url = '/' . ltrim($url, '/'); + } + + @header('Location: ' . $url, true, $code); + + exit; + } + + public function generateUniqueId() { + $siteuniqueid = C::t('common_setting')->fetch_setting('siteuniqueid'); + if(empty($siteuniqueid) || strlen($siteuniqueid) < 16) { + $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; + $siteuniqueid = 'DX'.$chars[date('y')%60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($_G['clientip'].$_G['username'].TIMESTAMP), 0, 4).random(4); + C::t('common_setting')->update_setting('siteuniqueid', $siteuniqueid); + require_once libfile('function/cache'); + updatecache('setting'); + } + } + + public function httpBuildQuery($data, $numeric_prefix='', $arg_separator='', $prefix='') { + + $render = array(); + if (empty($arg_separator)) { + $arg_separator = @ini_get('arg_separator.output'); + empty($arg_separator) && $arg_separator = '&'; + } + foreach ((array) $data as $key => $val) { + if (is_array($val) || is_object($val)) { + $_key = empty($prefix) ? "{$key}[%s]" : sprintf($prefix, $key) . "[%s]"; + $_render = $this->httpBuildQuery($val, '', $arg_separator, $_key); + if (!empty($_render)) { + $render[] = $_render; + } + } else { + if (is_numeric($key) && empty($prefix)) { + $render[] = urlencode("{$numeric_prefix}{$key}") . "=" . urlencode($val); + } else { + if (!empty($prefix)) { + $_key = sprintf($prefix, $key); + $render[] = urlencode($_key) . "=" . urlencode($val); + } else { + $render[] = urlencode($key) . "=" . urlencode($val); + } + } + } + } + $render = implode($arg_separator, $render); + if (empty($render)) { + $render = ''; + } + + return $render; + } + + public function getApiVersion() { + + return '0.6'; + } + + public function hashHmac($algo, $data, $key, $raw_output = false) { + if (function_exists('hash_hmac')) { + return hash_hmac($algo, $data, $key, $raw_output); + } else { + $algo = strtolower($algo); + $pack = 'H'.strlen(call_user_func($algo, 'test')); + $size = 64; + $opad = str_repeat(chr(0x5C), $size); + $ipad = str_repeat(chr(0x36), $size); + + if(strlen($key) > $size) { + $key = str_pad(pack($pack, call_user_func($algo, $key)), $size, chr(0x00)); + } else { + $key = str_pad($key, $size, chr(0x00)); + } + + for ($i = 0; $i < strlen($key) - 1; $i++) { + $opad[$i] = $opad[$i] ^ $key[$i]; + $ipad[$i] = $ipad[$i] ^ $key[$i]; + } + + $output = call_user_func($algo, $opad.pack($pack, call_user_func($algo, $ipad.$data))); + + return ($raw_output) ? pack($pack, $output) : $output; + } + } + + public function isMobile($status) { + if (getstatus($status, 11) || getstatus($status, 12) || getstatus($status, 13)) { + return true; + } + return false; + } + + public function mobileHasSound() { + if (getstatus($status, 13)) { + return true; + } + return false; + } + + public function mobileHasPhoto() { + if (getstatus($status, 12) && getstatus($status, 11)) { + return true; + } + return false; + } + + public function mobileHasGPS() { + if (getstatus($status, 12)) { + return true; + } + return false; + } + + public function isfounder($user) { + global $_G; + $founders = str_replace(' ', '', $_G['config']['admincp']['founder']); + if(!$user['uid'] || $user['groupid'] != 1 || $user['adminid'] != 1) { + return false; + } elseif(empty($founders)) { + return false; + } elseif(strexists(",$founders,", ",{$user['uid']},")) { + return true; + } elseif(!is_numeric($user['username']) && strexists(",$founders,", ",{$user['username']},")) { + return true; + } else { + return FALSE; + } + } + +} \ No newline at end of file diff --git a/source/plugin/qqconnect/lib/index.htm b/source/plugin/qqconnect/lib/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/qqconnect/spacecp.inc.php b/source/plugin/qqconnect/spacecp.inc.php new file mode 100644 index 0000000..5079b33 --- /dev/null +++ b/source/plugin/qqconnect/spacecp.inc.php @@ -0,0 +1,375 @@ + 1)); +} + +$pluginop = !empty($_GET['pluginop']) ? $_GET['pluginop'] : 'config'; +if (!in_array($pluginop, array('config', 'share', 'new', 'sync_tthread'))) { + showmessage('undefined_action'); +} +$sh_type = trim(intval($_GET['sh_type'])); +$tid = trim(intval($_GET['thread_id'])); +require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Connect.php'; +$connectService = new Cloud_Service_Connect(); +if ($pluginop == 'config') { + + $connectService->connectMergeMember(); + + $_G['connect']['is_oauth_user'] = true; + if (empty($_G['member']['conuinsecret'])) { + $_G['connect']['is_oauth_user'] = false; + } + + $referer = str_replace($_G['siteurl'], '', dreferer()); + if(!empty($_GET['connect_autoshare'])) { + if(strpos($referer, '?') !== false) { + $referer .= '&connect_autoshare=1'; + } else { + $referer .= '?connect_autoshare=1'; + } + } + + $_G['connect']['loginbind_url'] = $_G['siteurl'].'connect.php?mod=login&op=init&type=loginbind&referer='.urlencode($_G['connect']['referer'] ? $_G['connect']['referer'] : 'index.php'); + +} elseif ($pluginop == 'share') { + + $_GET['share_url'] = $_G['connect']['discuz_new_share_url']; + + $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid, 0); + $thread = C::t('forum_thread')->fetch_by_tid_displayorder($tid, 0); + require_once libfile('function/post'); + $post['message'] = messagesafeclear($post['message']); + $html_content = $connectService->connectParseBbcode($post['message'], $thread['fid'], $post['pid'], $post['htmlon'], $attach_images); + if ($_G['group']['allowgetimage'] && $thread['price'] == 0 && $post['pid']) { + if ($attach_images && is_array($attach_images)) { + $_GET['share_images'] = array_slice($attach_images, 0, 3); + + $attach_images = array(); + foreach ($_GET['share_images'] as $image) { + $attach_images[] = $image['big']; + } + $_GET['attach_image'] = implode('|', $attach_images); + unset($attach_images); + } + } + + if($_GET['sh_type'] == 4){ + if($_G['setting']['rewritestatus'] && is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $url = rewriteoutput('forum_viewthread', 1, $_G['siteurl'], $tid); + } else { + $url = $_G['siteurl'].'forum.php?mod=viewthread&tid='.$tid; + } + $shareqq_params = array( + 'url' => $url, + 'title' => diconv($thread['subject'], CHARSET, 'UTF-8'), + 'summary' => diconv(cutstr(strip_tags(str_replace(' ', ' ', $html_content)), 80), CHARSET, 'UTF-8'), + 'desc' => diconv(lang('plugin/qqconnect', 'connect_spacecp_share_qq_default'), CHARSET, 'UTF-8'), + 'site' => 'discuz|', + 'style' => '103', + 'width' => 50, + 'height' => 16 + ); + $s = ''; + foreach($shareqq_params as $key => $val) { + $s .= ($s ? '&' : '').$key.'='.urlencode($val); + } + header('Location: https://connect.qq.com/widget/shareqq/index.html?'.$s); + } else { + $share_message = lang('plugin/qqconnect', 'connect_spacecp_share_a_post', array('bbname' => cutstr($_G['setting']['bbname'], 20,''), 'subject' => cutstr($thread['subject'], 120), 'message' => cutstr(strip_tags(str_replace(' ', ' ', $html_content)), 80))); + $share_message = str_replace(array('\'', "\r\n", "\r", "\n"), array('"', '', '', ''), $share_message); + } +} elseif ($pluginop == 'new') { + if (trim($_GET['formhash']) != formhash()) { + showmessage('submit_invalid'); + } + + $sh_type = intval(trim($_POST['sh_type'])); + $tid = intval(trim($_POST['thread_id'])); + $dialog_id = $_POST['dialog_id']; + + $connectService->connectMergeMember(); + + if($_G['setting']['rewritestatus'] && is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { + $url = rewriteoutput('forum_viewthread', 1, $_G['siteurl'], $tid); + } else { + $url = $_G['siteurl'].'forum.php?mod=viewthread&tid='.$tid; + } + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/ConnectOAuth.php'; + $connectOAuthClient = new Cloud_Service_Client_ConnectOAuth(); + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/Connect.php'; + $connectService = new Cloud_Service_Connect(); + if($sh_type == 3) { + + $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid, 0); + require_once libfile('function/post'); + $firstpost['message'] = messagesafeclear($firstpost['message']); + $summary = $connectService->connectParseBbcode($firstpost['message'], $firstpost['fid'], $firstpost['pid'], $firstpost['htmlon'], $attach_images); + + $qzone_params = array( + 'title' => $_POST['share_subject'], + 'url' => $url, + 'comment' => $_POST['reason'], + 'summary' => strip_tags($summary), + 'images' => $_POST['attach_image'], + 'nswb' => '1', + ); + + if(!$_G['setting']['connect']['oauth2'] || !$_G['member']['conuintoken']) { + try { + $response = $connectOAuthClient->connectAddShare($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $qzone_params); + } catch(Exception $e) { + $errorCode = $e->getCode(); + } + } else { + try { + $response = $connectOAuthClient->connectAddShare_V2($_G['member']['conopenid'], $_G['member']['conuintoken'], $qzone_params); + } catch(Exception $e) { + $errorCode = $e->getCode(); + } + } + + if($errorCode) { + $code = $errorCode; + if($errorCode == 41001) { + $message = lang('plugin/qqconnect', 'connect_user_unauthorized', array('login_url' => $_G['connect']['login_url'].'&reauthorize=yes&formhash='.FORMHASH)); + } elseif($errorCode == 41003 || $errorCode == 40006) { // access token失效或非法 + $message = lang('plugin/qqconnect', 'connect_share_token_outofdate', array('login_url' => $_G['connect']['login_url'])); + } elseif ($errorCode == 3021) { + $message = lang('plugin/qqconnect', 'connect_qzone_share_same_url'); + } else { + $code = 100; + $message = lang('plugin/qqconnect', 'connect_server_busy'); + $connectService->connectErrlog($code, lang('plugin/qqconnect', 'connect_errlog_server_no_response')); + } + } else { + $code = $response['ret']; + $message = lang('plugin/qqconnect', 'connect_share_success'); + } + } elseif($sh_type == 2) { + + $t_params = array( + 'content' => $_POST['reason'], + ); + + $aid = intval($_POST['attach_image_id']); + if ($aid) { + $method = 'connectAddPicT'; + $attach = C::t('forum_attachment_n')->fetch_attachment('aid:'.$aid, $aid); + if($attach['remote']) { + $t_params['pic'] = $_G['setting']['ftp']['attachurl'].'forum/'.$attach['attachment']; + $t_params['remote'] = true; + } else { + $t_params['pic'] = $_G['setting']['attachdir'].'forum/'.$attach['attachment']; + } + } else { + $method = 'connectAddT'; + } + + if(!$_G['setting']['connect']['oauth2'] || !$_G['member']['conuintoken']) { + try { + $response = $connectOAuthClient->$method($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $t_params); + } catch(Exception $e) { + $errorCode = $e->getCode(); + } + } else { + try { + $method = $method.'_V2'; + $response = $connectOAuthClient->$method($_G['member']['conopenid'], $_G['member']['conuintoken'], $t_params); + } catch(Exception $e) { + $errorCode = $e->getCode(); + } + } + + if($errorCode) { + $code = $errorCode; + if($errorCode == 41001) { + $message = lang('plugin/qqconnect', 'connect_user_unauthorized', array('login_url' => $_G['connect']['login_url'].'&reauthorize=yes&formhash='.FORMHASH)); + } elseif($errorCode == 41003 || $errorCode == 40006) { // access token失效或非法 + $message = lang('plugin/qqconnect', 'connect_share_token_outofdate', array('login_url' => $_G['connect']['login_url'])); + } elseif ($errorCode == 3013) { + $message = lang('plugin/qqconnect', 'connect_qzone_weibo_same_content'); + } else { + $code = 100; + $message = lang('plugin/qqconnect', 'connect_server_busy'); + $connectService->connectErrlog($code, lang('plugin/qqconnect', 'connect_errlog_server_no_response')); + } + } else { + $thread = C::t('forum_thread')->fetch_thread($tid); + if($response['data']['id'] && $_G['setting']['connect']['t']['reply'] && $thread['tid'] && !$thread['closed'] && !getstatus($thread['status'], 3) && empty($_G['forum']['replyperm'])) { + + C::t('#qqconnect#connect_tthreadlog')->insert(array( + 'twid' => $response['data']['id'], + 'tid' => $tid, + 'conopenid' => $_G['member']['conopenid'], + 'pagetime' => 0, + 'lasttwid' => '0', + 'nexttime' => $_G['timestamp'] + 30 * 60, + 'updatetime' => 0, + 'dateline' => $_G['timestamp'], + )); + } + if(!getstatus($thread['status'], 8)) { + C::t('forum_thread')->update($tid, array('status' => setstatus(8, 1, $thread['status']))); + } + $code = $response['ret']; + $message = lang('plugin/qqconnect', 'connect_broadcast_success'); + } + } +} elseif($pluginop == 'sync_tthread') { + if (trim($_GET['formhash']) != formhash()) { + showmessage('submit_invalid'); + } + if(!$_G['setting']['connect']['t']['reply']) { + exit; + } + $tid = $_GET['tid']; + $processname = 'connect_tthread_'.$tid.'_cache'; + if(discuz_process::islocked($processname, 600)) { + exit; + } + $thread = C::t('forum_thread')->fetch_thread($tid); + if(!$thread || $thread['closed'] == 1 || getstatus($thread['status'], 3) || $thread['displayorder'] < 0 || !empty($_G['forum']['replyperm'])) { + discuz_process::unlock($processname); + exit; + } + + $updatetime = C::t('#qqconnect#connect_tthreadlog')->fetch_max_updatetime_by_tid($tid); + if($_G['timestamp'] < $updatetime + 10 * 60) { + discuz_process::unlock($processname); + exit; + } + $tthread = C::t('#qqconnect#connect_tthreadlog')->fetch_min_nexttime_by_tid($tid); + if(empty($tthread)) { + discuz_process::unlock($processname); + exit; + } + + require_once DISCUZ_ROOT.'/source/plugin/qqconnect/lib/ConnectOAuth.php'; + $connectOAuthClient = new Cloud_Service_Client_ConnectOAuth(); + $connectmember = C::t('#qqconnect#common_member_connect')->fetch_fields_by_openid($tthread['conopenid']); + $param = array(); + $param['format'] = 'xml'; + $param['flag'] = '2'; + $param['rootid'] = $tthread['twid']; + $param['pageflag'] = 2; + $param['pagetime'] = $tthread['pagetime']; + $param['reqnum'] = 20; + $param['twitterid'] = $tthread['lasttwid']; + + try { + $response = $connectOAuthClient->connectGetRepostList($tthread['conopenid'], $connectmember['conuin'], $connectmember['conuinsecret'], $param); + } catch(Exception $e) { + showmessage('qqconnect:server_busy'); + } + if($response && $response['ret'] == 0 && $response['data']['info']) { + + include_once libfile('function/forum'); + $forum = C::t('forum_forum')->fetch($thread['fid']); + $pinvisible = $forum['modnewposts'] ? -2 : 0; + + $pids = array(); + $i = 0; + $responseinfo = array(); + if(!isset($response['data']['info'][0])) { + $responseinfo[] = $response['data']['info']; + } else { + $responseinfo = $response['data']['info']; + krsort($responseinfo); + } + foreach($responseinfo as $post) { + $message = trim($post['text']); + $post['username'] = trim($post['name']); + $post['nick'] = trim($post['nick']); + $message = preg_replace("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+\s*)/i", '', $message); + $message = str_replace(explode(' ', lang('plugin/qqconnect', 'connect_reply_filter_smiley')), '', $message); + if($message) { + $newmessage = censor($message, null, true); + if($message != $newmessage) { + continue; + } + } else { + $message = lang('plugin/qqconnect', 'connect_tthread_broadcast'); + } + if($_G['setting']['connect']['t']['reply_showauthor']) { + $message .= '[tthread='.$post['username'].', '.$post['nick'].']'.$post['head'].'[/tthread]'; + } + + $pid = insertpost(array( + 'fid' => $thread['fid'], + 'tid' => $thread['tid'], + 'first' => '0', + 'author' => '', + 'authorid' => '0', + 'subject' => '', + 'dateline' => $_G['timestamp'] + $i, + 'message' => $message, + 'useip' => '', + 'invisible' => $pinvisible, + 'anonymous' => '0', + 'usesig' => '0', + 'htmlon' => '1', + 'bbcodeoff' => '0', + 'smileyoff' => '0', + 'parseurloff' => '0', + 'attachment' => '0', + 'status' => 16, + )); + if($pid) { + $pids[] = $pid; + } + $i++; + } + + if($pinvisible) { + updatemoderate('pid', $pids); + C::t('forum_forum')->update_forum_counter($thread['fid'], 0, 0, count($pids), 1); + } else { + $fieldarr = array( + 'lastposter' => array(''), + 'replies' => count($pids), + ); + if($thread['lastpost'] < $_G['timestamp']) { + $fieldarr['lastpost'] = array($_G['timestamp']); + } + C::t('forum_thread')->increase($tid, $fieldarr); + $postionid = C::t('forum_post')->fetch_maxposition_by_tid($thread['posttableid'], $tid); + C::t('forum_thread')->update($tid, array('maxposition' => $postionid)); + + $thread['shortsubject'] = cutstr($thread['subject'], 80); + $lastpost = "{$thread['tid']}\t{$thread['shortsubject']}\t{$_G['timestamp']}\t".''; + C::t('forum_forum')->update($thread['fid'], array('lastpost' => $lastpost)); + C::t('forum_forum')->update_forum_counter($thread['fid'], 0, count($pids), count($pids)); + if($forum['type'] == 'sub') { + C::t('forum_forum')->update($forum['fup'], array('lastpost' => $lastpost)); + } + } + + $setarr['pagetime'] = $post['timestamp']; + $setarr['lasttwid'] = $post['id']; + if(count($responseinfo) < $param['reqnum']) { + $setarr['nexttime'] = $_G['timestamp'] + 2 * 3600; + } else { + $setarr['nexttime'] = $_G['timestamp'] + 30 * 60; + } + } else { + $setarr['nexttime'] = $_G['timestamp'] + 3 * 3600; + } + $setarr['updatetime'] = $_G['timestamp']; + C::t('#qqconnect#connect_tthreadlog')->update($tthread['twid'], $setarr); + + discuz_process::unlock($processname); + exit; +} \ No newline at end of file diff --git a/source/plugin/qqconnect/table/index.htm b/source/plugin/qqconnect/table/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/source/plugin/qqconnect/table/table_common_connect_guest.php b/source/plugin/qqconnect/table/table_common_connect_guest.php new file mode 100644 index 0000000..8ebabb8 --- /dev/null +++ b/source/plugin/qqconnect/table/table_common_connect_guest.php @@ -0,0 +1,23 @@ +_table = 'common_connect_guest'; + $this->_pk = 'conopenid'; + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/source/plugin/qqconnect/table/table_common_member_connect.php b/source/plugin/qqconnect/table/table_common_member_connect.php new file mode 100644 index 0000000..1166687 --- /dev/null +++ b/source/plugin/qqconnect/table/table_common_member_connect.php @@ -0,0 +1,43 @@ +_table = 'common_member_connect'; + $this->_pk = 'uid'; + $this->_fields = array('uid', 'conuin', 'conuinsecret', 'conopenid', 'conisfeed', 'conispublishfeed', 'conispublisht', 'conisregister', 'conisqzoneavatar'); + $this->_pre_cache_key = 'common_member_connect_'; + $this->_cache_ttl = 0; + + parent::__construct(); + } + + public function fetch_fields_by_openid($openid, $fields = array()) { + $fields = (array)$fields; + if(!empty($fields)) { + $field = implode(',', array_intersect($fields, $this->_fields)); + } else { + $field = '*'; + } + + return DB::fetch_first('SELECT %i FROM %t WHERE conopenid=%s', array($field, $this->_table, $openid)); + } + + public function update_by_openid($openId, $data) { + + return DB::update($this->_table, $data, DB::field('openId', $openId)); + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/table/table_connect_disktask.php b/source/plugin/qqconnect/table/table_connect_disktask.php new file mode 100644 index 0000000..2c8e68c --- /dev/null +++ b/source/plugin/qqconnect/table/table_connect_disktask.php @@ -0,0 +1,23 @@ + +_table = 'connect_disktask'; + $this->_pk = 'taskid'; + + parent::__construct(); + } + + public function delete_by_status($status) { + if (dintval($status)) { + return DB::query('DELETE FROM %t WHERE status = %d', array($this->_table, $status)); + } + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/table/table_connect_feedlog.php b/source/plugin/qqconnect/table/table_connect_feedlog.php new file mode 100644 index 0000000..8541ec2 --- /dev/null +++ b/source/plugin/qqconnect/table/table_connect_feedlog.php @@ -0,0 +1,32 @@ +_table = 'connect_feedlog'; + $this->_pk = 'flid'; + + parent::__construct(); + } + + public function fetch_by_tid($tid) { + + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d', array($this->_table, $tid)); + } + + public function update_by_tid($tid, $data) { + $tid = dintval($tid); + return DB::update($this->_table, $data, DB::field('tid', $tid)); + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/table/table_connect_memberbindlog.php b/source/plugin/qqconnect/table/table_connect_memberbindlog.php new file mode 100644 index 0000000..72a89af --- /dev/null +++ b/source/plugin/qqconnect/table/table_connect_memberbindlog.php @@ -0,0 +1,43 @@ +_table = 'connect_memberbindlog'; + $this->_pk = 'mblid'; + + parent::__construct(); + } + + public function count_uid_by_openid_type($openid, $type) { + $count = (int) DB::result_first('SELECT count(DISTINCT uid) FROM %t WHERE uin=%s AND type=%d', array($this->_table, $openid, $type)); + return $count; + } + + public function fetch_all_by_openids($openids, $start = 0, $limit = 0) { + $result = array(); + if($openids) { + $result = DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('uin', $openids).' ORDER BY dateline DESC '.DB::limit($start, $limit)); + } + return $result; + } + + public function fetch_all_by_uids($uids, $start = 0, $limit = 0) { + $result = array(); + if($uids) { + $result = DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('uid', $uids).' ORDER BY dateline DESC '.DB::limit($start, $limit)); + } + return $result; + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/table/table_connect_postfeedlog.php b/source/plugin/qqconnect/table/table_connect_postfeedlog.php new file mode 100644 index 0000000..056e8b0 --- /dev/null +++ b/source/plugin/qqconnect/table/table_connect_postfeedlog.php @@ -0,0 +1,32 @@ +_table = 'connect_postfeedlog'; + $this->_pk = 'flid'; + + parent::__construct(); + } + + public function fetch_by_pid($pid) { + + return DB::fetch_first('SELECT * FROM %t WHERE pid=%d', array($this->_table, $pid)); + } + + public function update_by_pid($pid, $data) { + $pid = dintval($pid); + return DB::update($this->_table, $data, DB::field('pid', $pid)); + } +} \ No newline at end of file diff --git a/source/plugin/qqconnect/table/table_connect_tthreadlog.php b/source/plugin/qqconnect/table/table_connect_tthreadlog.php new file mode 100644 index 0000000..8da6b1e --- /dev/null +++ b/source/plugin/qqconnect/table/table_connect_tthreadlog.php @@ -0,0 +1,31 @@ +_table = 'connect_tthreadlog'; + $this->_pk = 'twid'; + + parent::__construct(); + } + + public function fetch_max_updatetime_by_tid($tid) { + return DB::result_first('SELECT updatetime FROM %t WHERE tid=%d ORDER BY updatetime DESC LIMIT 1', array($this->_table, $tid)); + } + + public function fetch_min_nexttime_by_tid($tid) { + return DB::fetch_first('SELECT * FROM %t WHERE tid=%d ORDER BY nexttime ASC LIMIT 1', array($this->_table, $tid)); + } + +} \ No newline at end of file diff --git a/source/plugin/qqconnect/template/extend_common.css b/source/plugin/qqconnect/template/extend_common.css new file mode 100644 index 0000000..8b7f2b0 --- /dev/null +++ b/source/plugin/qqconnect/template/extend_common.css @@ -0,0 +1 @@ +.qq_bind { margin-top: -3px; } \ No newline at end of file diff --git a/source/plugin/qqconnect/template/extend_module.css b/source/plugin/qqconnect/template/extend_module.css new file mode 100644 index 0000000..fef144d --- /dev/null +++ b/source/plugin/qqconnect/template/extend_module.css @@ -0,0 +1,25 @@ +/** forum::viewthread,group::viewthread **/ +#share_picture_list { float: left; margin: 10px auto; padding: 0; } + #share_picture_list div.share_picture_box { float: left; text-align: center; width: 120px; } + #share_picture_list div.share_picture_box a { padding: 2px; border: #ddd 2px solid; display: block; width: 100px; height: 100px;} + #share_picture_list div.share_picture_box a:hover { padding: 2px; border: #74CBEC 2px solid; display: block; width: 100px; height: 100px;} + + #share_picture_list div.select a { border-color: #74CBEC; } + #share_picture_list div.share_picture_box a img { width: 100px; height: 100px; } + #share_picture_list div div.badge { position: absolute; z-index: 1; margin: -2px 0 0 -2px; width: 112px; height: 112px; display: block; background: transparent url({IMGDIR}/transparent.gif) no-repeat 0 0; cursor: pointer; } + #share_picture_list div.select div.badge { background: transparent url({IMGDIR}/share_img.png) no-repeat 0 0; } +#share_picture_title { overflow: hidden; padding: 0 15px; width: 100%; clear: both; } + #cancel_share_picture_title { padding: 5px 0; } +/** end **/ + +/** forum,group,home **/ + .syn_qq, .syn_tqq, .syn_qq_check, .syn_tqq_check { display: inline-block; margin-top: 3px; width: 19px; height: 19px; background: transparent url({IMGDIR}/connect_post_syn.png) no-repeat 0 0; line-height: 64px; overflow: hidden; vertical-align: top; cursor: pointer; } + .ie6 .syn_qq, .ie6 .syn_tqq, .ie6 .syn_qq_check, .ie6 .syn_tqq_check { display: inline; } + .syn_qq_check { background-position: -22px 0; } + .syn_tqq { background-position: 0 -22px; margin-left: 5px; } + .syn_tqq_check { background-position: -22px -22px; margin-left: 5px; } +/** end **/ + +/** member **/ + .qqregtb { margin-top: 0; padding-top: 5px; background-color: {SPECIALBG}; } +/** end **/ \ No newline at end of file diff --git a/source/plugin/qqconnect/template/index.htm b/source/plugin/qqconnect/template/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/source/plugin/qqconnect/template/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/plugin/qqconnect/template/module.htm b/source/plugin/qqconnect/template/module.htm new file mode 100644 index 0000000..78a37cd --- /dev/null +++ b/source/plugin/qqconnect/template/module.htm @@ -0,0 +1,297 @@ +{eval +function tpl_global_login_extra() { +global $_G; +} + +
          +

          {lang qqconnect:connect_header_login}

          +

          {lang qqconnect:connect_header_login_tip}

          +
          + + +{eval +} + +function tpl_global_usernav_extra1() { +global $_G; +} + + + + |{lang qqconnect:connect_register_profile}|{lang qqconnect:connect_register_bind} + + |{lang qqconnect:connect_config} + + + + +{eval +} + +function tpl_login_bar() { +global $_G; +} + + + + + + +{eval +} + +function tpl_viewthread_share_method() { +global $_G; +if (!$_G['setting']['connect']['allow']) return; +$connect_thread_subject = addslashes(strip_tags($_G['thread']['subject'])); +} + + {lang qqconnect:connect_viewthread_share_to_qq}{lang qqconnect:connect_viewthread_share_to_qq} + {lang qqconnect:connect_viewthread_share_to_qzone}{lang qqconnect:connect_viewthread_share_to_qzone} + + +{eval +} + +function tpl_viewthread_bottom($jsurl) { +global $_G; +} + + + + + + + + + + +{eval +} + +function tpl_register_input() { +global $_G; + +$connect_app_id = $_G['qc']['connect_app_id']; +$connect_openid = $_G['qc']['connect_openid']; +} + + + + + + +{eval +} + +function tpl_register_bottom() { +global $_G; + +$loginhash = 'L'.random(4); +$change_qq_url = $_G['connect']['discuz_change_qq_url']; +$qq_nick = $_G['qc']['qq_nick']; +$connect_app_id = $_G['qc']['connect_app_id']; +$connect_openid = $_G['qc']['connect_openid']; +$connect_tab_1 = $_GET['ac'] != 'bind' && $_G['setting']['regconnect'] ? ' class="a"' : ''; +$connect_tab_2 = $_GET['ac'] == 'bind' ? ' class="a"' : ''; +} + + +
          +
          +
          +

          Hi,$_G['member']['username'], {lang connect_member_login_tip}

          + +
          +
          +
          + + +{eval +$js2 = str_replace(array("'", "\r", "\n"), array("\'", '', ''), $js2); +} + +
          + +
          + + + + +{eval +} + +} diff --git a/source/plugin/qqconnect/template/spacecp.htm b/source/plugin/qqconnect/template/spacecp.htm new file mode 100644 index 0000000..2f62820 --- /dev/null +++ b/source/plugin/qqconnect/template/spacecp.htm @@ -0,0 +1,76 @@ + +

          {lang qqconnect:connect_config_bindinfo}

          +
          + + +

          + {lang qqconnect:connect_config_newpassword} +

          +
          + + +

          + {lang qqconnect:connect_config_unbind} +

          + + + + + + + + +
          +
          + +

          {lang qqconnect:connect_config_bind}

          +
          +
          +
          +

          {lang qqconnect:connect_config_title}

          +
          {lang qqconnect:connect_config_desc_title1}
          +
          {lang qqconnect:connect_config_desc_content1}
          +
          {lang qqconnect:connect_config_desc_title2}
          +
          {lang qqconnect:connect_config_desc_content2}
          +
          +
          +
          + \ No newline at end of file diff --git a/source/plugin/qqconnect/upgrade.php b/source/plugin/qqconnect/upgrade.php new file mode 100644 index 0000000..02fdd7c --- /dev/null +++ b/source/plugin/qqconnect/upgrade.php @@ -0,0 +1,158 @@ +fetch_setting('connect', true); + +if (!array_key_exists('reply', $connect['t'])) { + $connect['t']['reply'] = 1; +} +if (!array_key_exists('reply_showauthor', $connect['t'])) { + $connect['t']['reply_showauthor'] = 1; +} + +$needCreateGroup = false; +if ($connect['guest_groupid']) { + $group = C::t('common_usergroup')->fetch($connect['guest_groupid']); + if (!$group) { + $needCreateGroup = true; + } +} else { + $needCreateGroup = true; +} + +$newConnect = array(); +$name = $extend_lang['connect_guest_group_name']; +if ($needCreateGroup) { + $userGroupData = array( + 'type' => 'special', + 'grouptitle' => $name, + 'allowvisit' => 1, + 'color' => '', + 'stars' => '', + ); + $newGroupId = C::t('common_usergroup')->insert($userGroupData, true); + + $dataField = array( + 'groupid' => $newGroupId, + 'allowsearch' => 2, + 'readaccess' => 1, + 'allowgetattach' => 1, + 'allowgetimage' => 1, + ); + C::t('common_usergroup_field')->insert($dataField); + + $newConnect['guest_groupid'] = $newGroupId; +} + +$https = json_decode(dfsockopen('https://graph.qq.com/user/get_user_info')); +$newConnect['oauth2'] = $https->ret == -1 ? 1 : 0; + +$updateData = array_merge($connect, $newConnect); +C::t('common_setting')->update_setting('connect', serialize($updateData)); +updatecache('setting'); +$finish = true; \ No newline at end of file diff --git a/source/plugin/witframe_api/api.inc.php b/source/plugin/witframe_api/api.inc.php new file mode 100644 index 0000000..1535094 --- /dev/null +++ b/source/plugin/witframe_api/api.inc.php @@ -0,0 +1,9 @@ +run(); \ No newline at end of file diff --git a/source/plugin/witframe_api/class/remote.class.php b/source/plugin/witframe_api/class/remote.class.php new file mode 100644 index 0000000..60b43aa --- /dev/null +++ b/source/plugin/witframe_api/class/remote.class.php @@ -0,0 +1,166 @@ +charset = strtolower($charset); + } + } + + public function paramDecode($key) { + if (empty($_POST[$key])) { + return array(); + } + + return $this->iconv(!is_array($_POST[$key]) ? unserialize($_POST[$key]) : $_POST[$key], 'UTF-8', $this->charset); + } + + public function check($hash) { + require 'config/config_ucenter.php'; + + $this->charset = strtolower(UC_CHARSET); + + $t = substr(time(), 0, 7); + $code = sha1($hash . UC_KEY . $t); + return $code == $_GET['code']; + } + + public function output($value) { + echo json_encode($this->iconv($value, $this->charset, 'UTF-8')); + exit; + } + + public function showOutput() { + $return = array('ret' => 0); + + $s = ob_get_contents(); + ob_end_clean(); + $return['data']['content'] = $s; + + $this->_setSysVar($return['data']); + $this->output($return); + } + + public function rawOutput() { + exit; + } + + public function convertOutput($output) { + ob_end_clean(); + $return = array('ret' => 0); + + $this->_setSysVar($return['data'], $output); + $tmp = $GLOBALS; + foreach ($output as $k => $v) { + if (strpos($k, '/') !== false) { + $return['data'][$v] = $this->_arrayVar($tmp, $k); + } else { + $return['data'][$v] = $this->_singleVar($tmp, $k); + } + } + + $this->output($return); + } + + public function sessionDecode($v) { + return unserialize(base64_decode($v)); + } + + private function _sessionEncode($v) { + return base64_encode(serialize($v)); + } + + private function _setSysVar(&$data, &$output = array()) { + global $_G; + $data['_session'] = $this->_sessionEncode($_COOKIE); + $data['_formhash'] = $this->_singleVar($_G, 'formhash'); + if (isset($output['_attachhash'])) { + if (!empty($_G['config']['security']['authkey'])) { + $data['_attachhash'] = md5(substr(md5($_G['config']['security']['authkey']), 8) . $_G['uid']); + } + unset($output['_attachhash']); + } + + unset($_G['config'], + $_G['setting']['siteuniqueid'], + $_G['setting']['ec_tenpay_opentrans_chnid'], + $_G['setting']['ec_tenpay_opentrans_key'], + $_G['setting']['ec_tenpay_bargainor'], + $_G['setting']['ec_tenpay_key'], + $_G['setting']['ec_account'], + $_G['setting']['ec_contract']); + } + + private function _singleVar(&$var, $k) { + return isset($var[$k]) ? $var[$k] : null; + } + + private function _arrayVar(&$var, $k) { + $value = null; + $sVar = &$var; + $e = explode('/', $k); + $count = count($e); + foreach ($e as $i => $_k) { + if ($_k == '*') { + foreach ($sVar as $_k3 => $_v3) { + $nKey = implode('/', array_slice($e, $i + 1)); + $value[$_k3] = $this->_arrayVar($_v3, $nKey); + } + break; + } + $isMulti = strpos($_k, ',') !== false; + if (!isset($sVar[$_k]) && !$isMulti) { + break; + } + if ($isMulti) { + $value = null; + foreach (explode(',', $_k) as $_k2) { + $value[$_k2] = $this->_singleVar($sVar, $_k2); + } + break; + } else { + if ($count - 1 == $i) { + $value = $this->_singleVar($sVar, $_k); + } + $sVar = &$sVar[$_k]; + } + } + return $value; + } + + public function iconv($variables, $in_charset, $out_charset) { + if ($this->charset == 'utf-8') { + return $variables; + } + if (is_string($variables)) { + return $this->_iconvStr($variables, $in_charset, $out_charset); + } + if (is_array($variables)) { + foreach ($variables as $k => $v) { + if (is_array($v)) { + $variables[$k] = $this->iconv($v, $in_charset, $out_charset); + } elseif (is_string($v)) { + $variables[$k] = $this->_iconvStr($v, $in_charset, $out_charset); + } + } + } + + return $variables; + } + + private function _iconvStr($v, $in_charset, $out_charset) { + if (function_exists('diconv')) { + return diconv($v, $in_charset, $out_charset); + } elseif (function_exists('iconv')) { + return iconv($in_charset, $out_charset, $v); + } else { + return $v; + } + } + +} \ No newline at end of file diff --git a/source/plugin/witframe_api/core.php b/source/plugin/witframe_api/core.php new file mode 100644 index 0000000..6265739 --- /dev/null +++ b/source/plugin/witframe_api/core.php @@ -0,0 +1,134 @@ + "0", + 'witSecretId' => $secretId, + 'witSecretKey' => $secretKey, + 'witPid' => "0", + 'ver' => 0, + ); + } + + $requestBody = array( + 'witUid' => $baseConf['witUid'], + 'witPid' => $baseConf['witPid'], + 'class' => $class, + 'func' => $func, + 'param' => $param, + 'type' => $type, + ); + $requestBody['t'] = time(); + $requestBody['sign'] = self::_getSign($baseConf['witSecretId'], $baseConf['witSecretKey'], $requestBody); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, self::WitApiURL); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($requestBody)); + $response = curl_exec($ch); + if(!$response) { + throw new Exception($class.'::'.$func.'() response error'); + } + $responseBody = json_decode($response, true); + if(!$responseBody) { + throw new Exception($class.'::'.$func.'() response error'); + } + if($func == 'Discuz_GetConf') { + if($responseBody['errCode']) { + self::SetSetting(array()); + return array(); + } + if(empty($baseConf['witUid']) || empty($baseConf['ver']) || + !empty($responseBody['data']['ver']) && $responseBody['data']['ver'] > $baseConf['ver']) { + self::SetSetting($responseBody['data']); + } + } + if($responseBody['errCode']) { + throw new Exception($class.'::'.$func.'() response '.$responseBody['message'], $responseBody['errCode']); + } + } catch(Exception $e) { + writelog('witframe', $e->getCode().': '.$e->getMessage()); + return array(); + } + return $responseBody['data']; + } + + public static function GetSetting() { + global $_G; + if (!empty($_G['setting'][self::SettingKey])) { + return unserialize($_G['setting'][self::SettingKey]); + } + return array(); + } + + public static function SetSetting($data) { + C::t('common_setting')->update_batch(array(self::SettingKey => $data)); + require_once libfile('function/cache'); + updatecache('setting'); + } + + private static function _getSign($witSecretId, $witSecretKey, $data) { + $srcStr = $witSecretId . '|' . serialize($data); + return Crypt::encode($witSecretKey, 'sha1', $srcStr); + } + +} \ No newline at end of file diff --git a/source/plugin/witframe_api/discuz_plugin_witframe_api.xml b/source/plugin/witframe_api/discuz_plugin_witframe_api.xml new file mode 100644 index 0000000..03fc1d3 --- /dev/null +++ b/source/plugin/witframe_api/discuz_plugin_witframe_api.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/plugin/witframe_api/install.php b/source/plugin/witframe_api/install.php new file mode 100644 index 0000000..852cb2b --- /dev/null +++ b/source/plugin/witframe_api/install.php @@ -0,0 +1,11 @@ +obj = $obj; + } + + public function __call($name, $arguments) { + $return = Core::RequestWit($this->obj, $name, $arguments, Core::Type_ObjMethod); + $this->obj = $return['obj']; + return $return['return']; + } + +} \ No newline at end of file diff --git a/source/plugin/witframe_api/lib/apis.php b/source/plugin/witframe_api/lib/apis.php new file mode 100644 index 0000000..11ebf6a --- /dev/null +++ b/source/plugin/witframe_api/lib/apis.php @@ -0,0 +1,30 @@ +_return(self::Ret_AuthFail); + } + parse_str(authcode($_GET['code'], 'DECODE', UC_KEY), $get); + + if (time() - $get['t'] > self::AuthExpire) { + $this->_return(self::Ret_AuthFail); + } + + if (empty($get['action'])) { + $this->_return(self::Ret_ParamFail); + } + + $this->method = '_action_' . $get['action']; + if (!method_exists($this, $this->method)) { + $this->_return(self::Ret_ParamFail); + } + + $this->get = $get; + $this->post = !empty($_POST) ? $_POST : array(); + + $this->r = new \WitClass\Remote(UC_CHARSET); + + return call_user_func(array($this, $this->method)); + } + + private function _action_test() { + $this->_return(self::Ret_Success, array('time' => time())); + } + + private function _action_getUser() { + $user = array(); + if (!empty($this->get['username'])) { + $this->get['username'] = $this->r->iconv($this->get['username'], 'UTF-8', UC_CHARSET); + $user = uc_get_user($this->get['username']); + } elseif (!empty($this->get['uid'])) { + $user = uc_get_user($this->get['uid'], 1); + } + if (!$user) { + $this->_return(self::Ret_Success); + } + $return = array('errCode' => 0); + list($return['uid'], $return['username'], $return['email']) = $user; + $return['avatar'] = $this->_getAvatar($return['uid']); + $return['count'] = C::t('common_member_count')->fetch($return['uid']); + $this->_return(self::Ret_Success, $return); + } + + private function _action_getSiteInfo() { + global $_G; + $return['siteName'] = $_G['setting']['bbname']; + $return['extcredits'] = $_G['setting']['extcredits']; + $this->_return(self::Ret_Success, $return); + } + + private function _action_login() { + if (empty($this->get['password'])) { + $this->_return(self::Ret_ParamFail); + } + $name = ''; + $isUid = 0; + if (!empty($this->get['username'])) { + $name = $this->get['username']; + } elseif (!empty($this->get['uid'])) { + $name = $this->get['uid']; + $isUid = 1; + } elseif (!empty($this->get['email'])) { + $name = $this->get['email']; + $isUid = 2; + } else { + $this->_return(self::Ret_ParamFail); + } + $user = uc_user_login($name, $this->get['password'], $isUid); + if (!$user) { + $this->_return(self::Ret_Success); + } + list($status) = $user; + if ($status <= 0) { + $this->_return(self::Ret_Success, array('errCode' => $status)); + } + $return = array('errCode' => 0); + list($return['uid'], $return['username'], , $return['email']) = $user; + $return['avatar'] = $this->_getAvatar($return['uid']); + $this->_return(self::Ret_Success, $return); + } + + private function _getAvatar($uid) { + return UC_API . '/avatar.php?uid=' . $uid . '&size=middle'; + } + + private function _return($ret, $data = array()) { + $this->r->output(array( + 'ret' => $ret, + 'data' => $data, + )); + } +} \ No newline at end of file diff --git a/source/plugin/witframe_api/lib/site.php b/source/plugin/witframe_api/lib/site.php new file mode 100644 index 0000000..26fe2fe --- /dev/null +++ b/source/plugin/witframe_api/lib/site.php @@ -0,0 +1,15 @@ + + \ No newline at end of file diff --git a/source/plugin/witframe_api/page.remote.php b/source/plugin/witframe_api/page.remote.php new file mode 100644 index 0000000..1e08ee1 --- /dev/null +++ b/source/plugin/witframe_api/page.remote.php @@ -0,0 +1,63 @@ +output(array( + 'ret' => -1, + )); + } + + if (!preg_match('/^\w+$/', $_POST['_script_'])) { + $r->output(array( + 'ret' => -2, + )); + } + + $script = $_POST['_script_']; + $session = !empty($_POST['_session_']) ? $_POST['_session_'] : ''; + if (!$r->check($script . $session)) { + $r->output(array( + 'ret' => -4, + )); + } + + $output = !empty($_POST['_output_']) ? $_POST['_output_'] : array(); + $rawOutput = !empty($_POST['_raw_']); + $_GET = $r->paramDecode('_get_'); + $cookies = $session ? $r->sessionDecode($session) : array(); + foreach ($cookies as $k => $v) { + $_COOKIE[$k] = $v; + setcookie($k, $v); + } + $_POST = $r->paramDecode('_post_'); + + $shutdownFunc = 'showOutput'; + if($rawOutput) { + $shutdownFunc = 'rawOutput'; + } elseif($output) { + $shutdownFunc = 'convertOutput'; + } + + register_shutdown_function(array($r, $shutdownFunc), $output); + + try { + require './' . $script . '.php'; + } catch (Exception $e) { + $r->output(array( + 'ret' => -3, + )); + } +} else { + $_GET['id'] = 'witframe_api:api'; + require './plugin.php'; +} \ No newline at end of file diff --git a/source/plugin/witframe_api/remote.class.php b/source/plugin/witframe_api/remote.class.php new file mode 100644 index 0000000..932f581 --- /dev/null +++ b/source/plugin/witframe_api/remote.class.php @@ -0,0 +1,19 @@ + 1 ? $conf['ver'] : 1; + if (strpos($settingnew['witSecretKey'], $mask) !== false) { + $settingnew['witSecretKey'] = $conf['witSecretKey']; + } + Lib\Core::SetSetting($settingnew); + cpmsg('设置已更新', 'action=plugins&operation=config&do=' . $pluginid . '&identifier=witframe_api&pmod=setting', 'succeed'); +} + +$conf['witSecretKey'] = $conf['witSecretKey'] ? substr($conf['witSecretKey'], 0, 3) . $mask . substr($conf['witSecretKey'], -3) : ''; + +showtableheader(); +showformheader('plugins&operation=config&do=' . $pluginid . '&identifier=witframe_api&pmod=setting', ''); +showsetting('witUid', 'settingnew[witUid]', $conf['witUid'], 'text'); +showsetting('witSecretId', 'settingnew[witSecretId]', $conf['witSecretId'], 'text'); +showsetting('witSecretKey', 'settingnew[witSecretKey]', $conf['witSecretKey'], 'text'); +showsetting('witPid', 'settingnew[witPid]', $conf['witPid'], 'text'); +showsubmit('editsubmit'); +showformfooter(); +showtablefooter(); \ No newline at end of file diff --git a/source/plugin/witframe_api/test.inc.php b/source/plugin/witframe_api/test.inc.php new file mode 100644 index 0000000..25b2121 --- /dev/null +++ b/source/plugin/witframe_api/test.inc.php @@ -0,0 +1,5 @@ + " ); + jQuery("#slider").append("
           
          " ); + jQuery("#slider").append("
           
          " ); +}); + +window.addEventListener('message', receiveMessage, false); + +function receiveMessage(event) { + var msgdata = event.data; + if (typeof(msgdata) !== 'string') { + return; + } + rectAvatarDone(msgdata); +} + +function uploadAvatarDone() { + if (this.files && this.files[0]) { + var fr = new FileReader(); + fr.onload = function(e) { + jQuery('#avatarfileselector').hide(); + jQuery('#avatardisplayer').hide(); + jQuery('#avataradjuster').show(); + jQuery('#selector').css('left', Math.floor((dwidth-300)/2)); + jQuery('#selector').css('top', Math.floor((dheight-150)/2)); + jQuery('#selector').width(150); + jQuery('#selector').height(150); + $('avatarimage').src = e.target.result; + jQuery("#slider").slider('value', 50); + }; + fr.readAsDataURL(this.files[0]); + } +} + +function showAvatarFileSelector() { + $('avatarimage').src = null; + $('avatarfile').value = null; + clearAvatar(); + $('avataradjuster').style.display = 'none'; + $('avatarfileselector').style.display = 'block'; +} + +function getAvatarDimension() { + var factor = jQuery('#slider').slider('option', 'value'); + var cw = jQuery('#widgetparent').width(); + var ch = jQuery('#widgetparent').height(); + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var minw = 48; + var minh = 48; + var midw = Math.min(Math.max(iw, 48), cw); + var midh = Math.min(Math.max(ih, 48), ch); + var maxw = Math.max(Math.max(iw, 48), cw); + var maxh = Math.max(Math.max(ih, 48), ch); + var minr = Math.max(minw/iw, minh/ih); + var midr = Math.max(midw/iw, midh/ih); + var maxr = Math.max(maxw/iw, maxh/ih); + if (factor<=50) { + r = (minr * (50-factor) + midr * factor)/50; + } + else { + r = (midr * (100-factor) + maxr * (factor-50))/50; + } + var aw = r*iw; + var ah = r*ih; + var al = (cw-aw)/2; + var at = (ch-ah)/2; + var sd = getSelectorDimention(); + if (aw>cw) al = (cw-aw)/(cw-sd.width)*sd.left; + if (ah>ch) at = (ch-ah)/(ch-sd.height)*sd.top; + return { left: Math.floor(al), top: Math.floor(at), width: Math.floor(aw), height: Math.floor(ah) }; +} + +function clearAvatar() { + var canvas = $('avatarcanvas'); + var cw = canvas.width; + var ch = canvas.height; + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, cw, ch); +} + +function refreshAvatarCanvas(uiposition) { + var canvas = $('avatarcanvas'); + var cw = canvas.width; + var ch = canvas.height; + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, cw, ch); + var ad = getAvatarDimension(); + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var img = $('avatarimage'); + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, 0,0, iw, ih, ad.left, ad.top, ad.width, ad.height); + var sd = getSelectorDimention(); + if (uiposition) { + sd.left = uiposition.left; + sd.top = uiposition.top; + } + ctx.fillStyle="rgba(0,0,0,0.6)"; + ctx.fillRect(0, 0, cw, sd.top); + ctx.fillRect(sd.left+sd.width, sd.top, cw-sd.left-sd.width, ch-sd.top); + ctx.fillRect(0, sd.top+sd.height, sd.left+sd.width, ch-sd.top-sd.height); + ctx.fillRect(0, sd.top, sd.left, sd.height); +} + +function getSelectorDimention() { + var sl = Math.ceil(jQuery('#selector').position().left); + var st = Math.ceil(jQuery('#selector').position().top); + var sw = jQuery('#selector').width(); + var sh = jQuery('#selector').height(); + return { left: sl, top: st, width: sw, height: sh }; +} + +function forceSelectorInsideAvatar() { + var sd = getSelectorDimention(); + var ad = getAvatarDimension(); + if (sd.width>ad.width) jQuery('#selector').width(ad.width); + if (sd.height>ad.height) jQuery('#selector').height(ad.height); + sd = getSelectorDimention(); + if (sd.leftad.left+ad.width) jQuery('#selector').css('left', ad.left+ad.width-sd.width); + if (sd.top+sd.height>ad.top+ad.height) jQuery('#selector').css('top', ad.top+ad.height-sd.height); + refreshAvatarCanvas(); +} + +function saveAvatar() { + var img = $('avatarimage'); + var sd = getSelectorDimention(); + var ad = getAvatarDimension(); + var rl = (sd.left-ad.left)/ad.width; + var rt = (sd.top-ad.top)/ad.height; + var rw = sd.width/ad.width; + var rh = sd.height/ad.height; + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var sl = rl*iw; + var st = rt*ih; + var sw = rw*iw; + var sh = rh*ih; + var tw = sw; + var th = sh; + if (sw>200 || sh>250) { + var r = Math.max(sw/200, sh/250); + tw = Math.floor(sw/r); + th = Math.floor(sh/r); + } + var canvas = document.createElement('canvas'); + canvas.width = tw; + canvas.height = th; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, tw, th); + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); + var dataURL = canvas.toDataURL("image/jpeg", 1.0); + jQuery('#avatar1').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var tw = sw; + var th = sh; + if (sw>120 || sh>120) { + var r = Math.max(sw/120, sh/120); + tw = Math.floor(sw/r); + th = Math.floor(sh/r); + } + var canvas = document.createElement('canvas'); + canvas.width = tw; + canvas.height = th; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, tw, th); + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); + var dataURL = canvas.toDataURL("image/jpeg", 1.0); + jQuery('#avatar2').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var mwh = Math.min(sw, sh); + if (sw>mwh) { + sl += Math.floor((sw-mwh)/2); + sw = mwh; + } + if (sh>mwh) { + st += Math.floor((sh-mwh)/2); + sh = mwh; + } + var tw = 48; + var th = 48; + var canvas = document.createElement('canvas'); + canvas.width = tw; + canvas.height = th; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, tw, th); + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); + var dataURL = canvas.toDataURL("image/jpeg", 1.0); + jQuery('#avatar3').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var src = $('avatarform').action; + $('avatarform').action = data[data.indexOf('stl_src')+1]; + $('avatarform').target='rectframe'; +} + +function refreshAvatarCanvasForDisplay() { + var img = $('avatarimage'); + var canvas = $('avatardisplaycanvas'); + var ctx = canvas.getContext("2d"); + var sd = getSelectorDimention(); + var ad = getAvatarDimension(); + var rl = (sd.left-ad.left)/ad.width; + var rt = (sd.top-ad.top)/ad.height; + var rw = sd.width/ad.width; + var rh = sd.height/ad.height; + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var sl = rl*iw; + var st = rt*ih; + var sw = rw*iw; + var sh = rh*ih; + var tw = sw; + var th = sh; + if (sw>200 || sh>250) { + var r = Math.max(sw/200, sh/250); + tw = Math.floor(sw/r); + th = Math.floor(sh/r); + } + var ctl = 10; + var ctt = 10; + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, sl, st, sw, sh, ctl, ctt, tw, th); + ctl += 20 + tw; + + var tw = sw; + var th = sh; + if (sw>120 || sh>120) { + var r = Math.max(sw/120, sh/120); + tw = Math.floor(sw/r); + th = Math.floor(sh/r); + } + ctx.drawImage(img, sl, st, sw, sh, ctl, ctt, tw, th); + ctl += 20 + tw; + + var tw = 48; + var th = 48; + var mwh = Math.min(sw, sh); + if (sw>mwh) { + sl += Math.floor((sw-mwh)/2); + sw = mwh; + } + if (sh>mwh) { + st += Math.floor((sh-mwh)/2); + sh = mwh; + } + ctx.drawImage(img, sl, st, sw, sh, ctl, ctt, tw, th); + + ctx.fillStyle = "black"; + ctx.font = "bold 16px Arial"; + ctx.fillText('上传成功!', dwidth - 160,155); + ctx.fillStyle = "grey"; + ctx.font = "bold 12px Arial"; + ctx.fillText('以上是您头像的三种尺寸', dwidth - 200, 180); +} + +function rectAvatarDone(res) { + if (!res) return; + if (res == 'success') { + jQuery('#avatardisplayer').show(); + refreshAvatarCanvasForDisplay(); + jQuery('#avataradjuster').hide(); + jQuery('#avatarfileselector').hide(); + } else if (res == 'failure') { + alert('上传失败'); + } +} +})(); \ No newline at end of file diff --git a/static/avatar/avatar_back.gif b/static/avatar/avatar_back.gif new file mode 100644 index 0000000..b97a716 Binary files /dev/null and b/static/avatar/avatar_back.gif differ diff --git a/static/avatar/avatar_blank.gif b/static/avatar/avatar_blank.gif new file mode 100644 index 0000000..4f79f90 Binary files /dev/null and b/static/avatar/avatar_blank.gif differ diff --git a/static/avatar/avatar_finishback.png b/static/avatar/avatar_finishback.png new file mode 100644 index 0000000..e231716 Binary files /dev/null and b/static/avatar/avatar_finishback.png differ diff --git a/static/avatar/avatar_finishbutton.gif b/static/avatar/avatar_finishbutton.gif new file mode 100644 index 0000000..d139dd3 Binary files /dev/null and b/static/avatar/avatar_finishbutton.gif differ diff --git a/static/avatar/avatar_lattice.png b/static/avatar/avatar_lattice.png new file mode 100644 index 0000000..f9eed6c Binary files /dev/null and b/static/avatar/avatar_lattice.png differ diff --git a/static/avatar/avatar_mobile.js b/static/avatar/avatar_mobile.js new file mode 100644 index 0000000..0d327f5 --- /dev/null +++ b/static/avatar/avatar_mobile.js @@ -0,0 +1,246 @@ + +var jQuery = window.jQuery.noConflict(true); +var dwidth = window.screen.width -20; +var dheight = data[data.indexOf('height')+1]; +jQuery('#avatardesigner').width(dwidth-40); +jQuery('#avatardesigner').height(dheight-25); +jQuery('#widgetparent').width(dwidth-40); +jQuery('#widgetparent').height(dheight-25); +jQuery('#selector').width(150); +jQuery('#selector').height(150); +jQuery('#avatarfileselector').width(dwidth-40); +jQuery('#avatarfileselector').height(dheight-25); +jQuery('#avatarfile').width('100%'); +jQuery('#avatarfile').height(dheight-25); + +jQuery('#avatarcanvas').attr('width', (dwidth-40)); +jQuery('#avatarcanvas').attr('height', dheight-25); +jQuery('#avatardisplaycanvas').attr('width', dwidth-40); +jQuery('#avatardisplaycanvas').attr('height', 400); + +getID('avatarform').target ='uploadframe'; +getID('avatarfile').onchange = uploadAvatarDone; +getID('avatarimage').onload = forceSelectorInsideAvatar; +getID('backfileselection').onclick = showAvatarFileSelector; + +jQuery(document).ready(function () { + +}); + +window.addEventListener('message', receiveMessage, false); + +function receiveMessage(event) { + var msgdata = event.data; + if (typeof(msgdata) !== 'string') { + return; + } +} + +function uploadAvatarDone() { + if (this.files && this.files[0]) { + var fr = new FileReader(); + fr.onload = function(e) { + jQuery('#avatarfileselector').hide(); + jQuery('#avatardisplayer').hide(); + jQuery('#avataradjuster').show(); + jQuery('#avataradjuster2').show(); + + }; + fr.readAsDataURL(this.files[0]); + } +} + +function showAvatarFileSelector() { + getID('avatarfile').value = null; + clearAvatar(); + getID('avataradjuster').style.display = 'none'; + getID('avataradjuster2').style.display = 'none'; + getID('avatarfileselector').style.display = 'block'; +} + +function getAvatarDimension() { + var factor = 50; + var cw = jQuery('#widgetparent').width(); + var ch = jQuery('#widgetparent').height(); + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var minw = 48; + var minh = 48; + var midw = Math.min(Math.max(iw, 48), cw); + var midh = Math.min(Math.max(ih, 48), ch); + var maxw = Math.max(Math.max(iw, 48), cw); + var maxh = Math.max(Math.max(ih, 48), ch); + var minr = Math.max(minw/iw, minh/ih); + var midr = Math.max(midw/iw, midh/ih); + var maxr = Math.max(maxw/iw, maxh/ih); + if (factor<=50) { + r = (minr * (50-factor) + midr * factor)/50; + } + else { + r = (midr * (100-factor) + maxr * (factor-50))/50; + } + var aw = r*iw; + var ah = r*ih; + var al = (cw-aw)/2; + var at = (ch-ah)/2; + var sd = getSelectorDimention(); + if (aw>cw) al = (cw-aw)/(cw-sd.width)*sd.left; + if (ah>ch) at = (ch-ah)/(ch-sd.height)*sd.top; + return { left: Math.floor(al), top: Math.floor(at), width: Math.floor(aw), height: Math.floor(ah) }; +} + +function clearAvatar() { + var canvas = getID('avatarcanvas'); + var cw = canvas.width; + var ch = canvas.height; + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, cw, ch); +} + +function refreshAvatarCanvas(uiposition) { + var canvas = getID('avatarcanvas'); + var cw = canvas.width; + var ch = canvas.height; + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, cw, ch); + var ad = getAvatarDimension(); + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var img = getID('avatarimage'); + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, 0,0, iw, ih, ad.left, ad.top, ad.width, ad.height); + var sd = getSelectorDimention(); + if (uiposition) { + sd.left = uiposition.left; + sd.top = uiposition.top; + } + ctx.fillStyle="rgba(0,0,0,0.6)"; + ctx.fillRect(0, 0, cw, sd.top); + ctx.fillRect(sd.left+sd.width, sd.top, cw-sd.left-sd.width, ch-sd.top); + ctx.fillRect(0, sd.top+sd.height, sd.left+sd.width, ch-sd.top-sd.height); + ctx.fillRect(0, sd.top, sd.left, sd.height); +} + +function getSelectorDimention() { + var sl = Math.ceil(jQuery('.photo-clip-layer').position().left); + var st = Math.ceil(jQuery('.photo-clip-layer').position().top); + var sw = jQuery('.photo-clip-layer').width(); + var sh = jQuery('.photo-clip-layer').height(); + return { left: sl, top: st, width: sw, height: sh }; +} + +function forceSelectorInsideAvatar() { + var sd = getSelectorDimention(); + var ad = getAvatarDimension(); + if (sd.width>ad.width) jQuery('.photo-clip-layer').width(ad.width); + if (sd.height>ad.height) jQuery('.photo-clip-layer').height(ad.height); + sd = getSelectorDimention(); +} + +function saveAvatar(src) { + var img = getID('avatarimage'); + var canvas = document.createElement('canvas'); + canvas.width = 200; + canvas.height = 200; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, 200, 200); + ctx.drawImage(img, 0, 0, 200, 200, 0, 0, 200, 200); + var dataURL = canvas.toDataURL("image/jpeg", 1.0); + jQuery('#avatar1').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var tw = 120; + var th = 120; + var canvas = document.createElement('canvas'); + canvas.width = 120; + canvas.height = 120; + var ctx = canvas.getContext("2d"); + ctx.fillRect(0, 0, 120, 120); + ctx.drawImage(img, 0, 0, 200, 200, 0, 0, 120, 120); + var dataURL = canvas.toDataURL("image/jpeg", 1.0); + jQuery('#avatar2').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + + var tw = 48; + var th = 48; + var canvas = document.createElement('canvas'); + canvas.width = tw; + canvas.height = th; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, 48, 48); + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, 0, 0, 200, 200, 0, 0, 48, 48); + var dataURL = canvas.toDataURL("image/jpeg", 1.0); + jQuery('#avatar3').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var src = getID('avatarform').action; + getID('avatarform').action = data[data.indexOf('stl_src')+1]; + getID('avatarform').target='rectframe'; + console.log('readysubmit'); + getID('avatarform').submit(); + refreshAvatarCanvasForDisplay(); + console.log('submited'); + jQuery('#avatardisplayer').show(); + jQuery('#avataradjuster').hide(); + jQuery('#avataradjuster2').hide(); +} + +function refreshAvatarCanvasForDisplay() { + jQuery('#avatardesigner').height(420); + var img = getID('avatarimage'); + var canvas = getID('avatardisplaycanvas'); + var ctx = canvas.getContext("2d"); + var ctl = 10; + var ctt = 10; + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage(img, 0, 0, 200, 200, 5, ctt, 200, 200); + ctl += 10 + 200; + + ctx.drawImage(img, 0, 0, 200, 200, 5, 220, 120, 120); + ctl += 10 + 120; + + ctx.drawImage(img, 0, 0, 200, 200, 5, 350, 48, 48); + + ctx.fillStyle = "black"; + ctx.font = "bold 16px Arial"; + ctx.fillText('上传成功!', dwidth - 160,315); + ctx.fillStyle = "grey"; + ctx.font = "bold 12px Arial"; + ctx.fillText('以上是您头像的三种尺寸', dwidth - 200, 340); +} + +function rectAvatarDone(res) { + if (!res) return; + if (res == 'success') { + jQuery('#avatardisplayer').show(); + jQuery('#avataradjuster').hide(); + jQuery('#avataradjuster2').hide(); + jQuery('#avatarfileselector').hide(); + } else if (res == 'failure') { + alert('上传失败'); + } +} +var clipArea = new PhotoClip("#widgetparent", { + size: [200, 200], + outputSize: [200, 200], + outputType: "jpg", + file: "#avatarfile", + ok: "#avconfirm", + loadStart: function(file) { + }, + loadComplete: function() { + }, + loadError: function(msg) { + }, + done: function(dataURL) { + imagesAjax(dataURL); + }, + fail: function(msg) { + }, +}); + +function imagesAjax(src) { + jQuery('#avatarimage').attr('src', src); + setTimeout(function() {saveAvatar(src);}, 1000); +} \ No newline at end of file diff --git a/static/avatar/avatar_save.gif b/static/avatar/avatar_save.gif new file mode 100644 index 0000000..bffd7db Binary files /dev/null and b/static/avatar/avatar_save.gif differ diff --git a/static/avatar/avatar_upload.gif b/static/avatar/avatar_upload.gif new file mode 100644 index 0000000..ad8557c Binary files /dev/null and b/static/avatar/avatar_upload.gif differ diff --git a/static/avatar/hammer.min.js b/static/avatar/hammer.min.js new file mode 100644 index 0000000..94b653d --- /dev/null +++ b/static/avatar/hammer.min.js @@ -0,0 +1,6 @@ +/*! Hammer.JS - v2.0.8 - 2016-04-23 + * http://hammerjs.github.io/ + * + * Copyright (c) 2016 Jorik Tangelder; + * Licensed under the MIT license */ +!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;ch&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;af?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance0&&(h=n?n/2.5*(c/8):0,l=s.abs(t)+h,a=l/c),{destination:s.round(h),duration:a}};var h=e("transform");return o.extend(o,{hasTransform:h!==!1,hasPerspective:e("perspective")in n,hasTouch:"ontouchstart"in t,hasPointer:!(!t.PointerEvent&&!t.MSPointerEvent),hasTransition:e("transition")in n}),o.isBadAndroid=function(){var i=t.navigator.appVersion;if(/Android/.test(i)&&!/Chrome\/\d/.test(i)){var s=i.match(/Safari\/(\d+.\d)/);return!(s&&"object"==typeof s&&s.length>=2)||parseFloat(s[1])<535.19}return!1}(),o.extend(o.style={},{transform:h,transitionTimingFunction:e("transitionTimingFunction"),transitionDuration:e("transitionDuration"),transitionDelay:e("transitionDelay"),transformOrigin:e("transformOrigin"),touchAction:e("touchAction")}),o.hasClass=function(t,i){var s=new RegExp("(^|\\s)"+i+"(\\s|$)");return s.test(t.className)},o.addClass=function(t,i){if(!o.hasClass(t,i)){var s=t.className.split(" ");s.push(i),t.className=s.join(" ")}},o.removeClass=function(t,i){if(o.hasClass(t,i)){var s=new RegExp("(^|\\s)"+i+"(\\s|$)","g");t.className=t.className.replace(s," ")}},o.offset=function(t){for(var i=-t.offsetLeft,s=-t.offsetTop;t=t.offsetParent;)i-=t.offsetLeft,s-=t.offsetTop;return{left:i,top:s}},o.preventDefaultException=function(t,i){for(var s in i)if(i[s].test(t[s]))return!0;return!1},o.extend(o.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3}),o.extend(o.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(t){return s.sqrt(1- --t*t)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(t){var i=4;return(t-=1)*t*((i+1)*t+i)+1}},bounce:{style:"",fn:function(t){return(t/=1)<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},elastic:{style:"",fn:function(t){var i=.22,e=.4;return 0===t?0:1==t?1:e*s.pow(2,-10*t)*s.sin((t-i/4)*(2*s.PI)/i)+1}}}),o.tap=function(t,s){var e=i.createEvent("Event");e.initEvent(s,!0,!0),e.pageX=t.pageX,e.pageY=t.pageY,t.target.dispatchEvent(e)},o.click=function(s){var e,o=s.target;/(SELECT|INPUT|TEXTAREA)/i.test(o.tagName)||(e=i.createEvent(t.MouseEvent?"MouseEvents":"Event"),e.initEvent("click",!0,!0),e.view=s.view||t,e.detail=1,e.screenX=o.screenX||0,e.screenY=o.screenY||0,e.clientX=o.clientX||0,e.clientY=o.clientY||0,e.ctrlKey=!!s.ctrlKey,e.altKey=!!s.altKey,e.shiftKey=!!s.shiftKey,e.metaKey=!!s.metaKey,e.button=0,e.relatedTarget=null,e._constructed=!0,o.dispatchEvent(e))},o.getTouchAction=function(t,i){var s="none";return"vertical"===t?s="pan-y":"horizontal"===t&&(s="pan-x"),i&&"none"!=s&&(s+=" pinch-zoom"),s},o.getRect=function(t){if(t instanceof SVGElement){var i=t.getBoundingClientRect();return{top:i.top,left:i.left,width:i.width,height:i.height}}return{top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}},o}();e.prototype={version:"5.2.0-snapshot",_init:function(){this._initEvents(),this.options.zoom&&this._initZoom(),(this.options.scrollbars||this.options.indicators)&&this._initIndicators(),this.options.mouseWheel&&this._initWheel(),this.options.snap&&this._initSnap(),this.options.keyBindings&&this._initKeys()},destroy:function(){this._initEvents(!0),clearTimeout(this.resizeTimeout),this.resizeTimeout=null,this._execEvent("destroy")},_transitionEnd:function(t){t.target==this.scroller&&this.isInTransition&&(this._transitionTime(),this.resetPosition(this.options.bounceTime)||(this.isInTransition=!1,this._execEvent("scrollEnd")))},_start:function(t){if(1!=h.eventType[t.type]){var i;if(i=t.which?t.button:t.button<2?0:4==t.button?1:2,0!==i)return}if(this.enabled&&(!this.initiated||h.eventType[t.type]===this.initiated)){!this.options.preventDefault||h.isBadAndroid||h.preventDefaultException(t.target,this.options.preventDefaultException)||t.preventDefault();var e,o=t.touches?t.touches[0]:t;this.initiated=h.eventType[t.type],this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.directionLocked=0,this.startTime=h.getTime(),this.options.useTransition&&this.isInTransition?(this._transitionTime(),this.isInTransition=!1,e=this.getComputedPosition(),this._translate(s.round(e.x),s.round(e.y)),this._execEvent("scrollEnd")):!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,this._execEvent("scrollEnd")),this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=o.pageX,this.pointY=o.pageY,this._execEvent("beforeScrollStart")}},_move:function(t){if(this.enabled&&h.eventType[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault();var i,e,o,n,r=t.touches?t.touches[0]:t,a=r.pageX-this.pointX,l=r.pageY-this.pointY,c=h.getTime();if(this.pointX=r.pageX,this.pointY=r.pageY,this.distX+=a,this.distY+=l,o=s.abs(this.distX),n=s.abs(this.distY),!(c-this.endTime>300&&o<10&&n<10)){if(this.directionLocked||this.options.freeScroll||(o>n+this.options.directionLockThreshold?this.directionLocked="h":n>=o+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"==this.directionLocked){if("vertical"==this.options.eventPassthrough)t.preventDefault();else if("horizontal"==this.options.eventPassthrough)return void(this.initiated=!1);l=0}else if("v"==this.directionLocked){if("horizontal"==this.options.eventPassthrough)t.preventDefault();else if("vertical"==this.options.eventPassthrough)return void(this.initiated=!1);a=0}this.options.scrollX||(a=this.hasHorizontalScroll?a:0),this.options.scrollY||(l=this.hasVerticalScroll?l:0),i=this.x+a,e=this.y+l,(i>0||i0?0:this.maxScrollX),(e>0||e0?0:this.maxScrollY),this.directionX=a>0?-1:a<0?1:0,this.directionY=l>0?-1:l<0?1:0,this.moved||this._execEvent("scrollStart"),this.moved=!0,this._translate(i,e),c-this.startTime>300&&(this.startTime=c,this.startX=this.x,this.startY=this.y)}}},_end:function(t){if(this.enabled&&h.eventType[t.type]===this.initiated){this.options.preventDefault&&!h.preventDefaultException(t.target,this.options.preventDefaultException)&&t.preventDefault();var i,e,o=(t.changedTouches?t.changedTouches[0]:t,h.getTime()-this.startTime),n=s.round(this.x),r=s.round(this.y),a=s.abs(n-this.startX),l=s.abs(r-this.startY),c=0,p="";if(this.isInTransition=0,this.initiated=0,this.endTime=h.getTime(),!this.resetPosition(this.options.bounceTime)){if(this.scrollTo(n,r),!this.moved)return this.options.tap&&h.tap(t,this.options.tap),this.options.click&&h.click(t),void this._execEvent("scrollCancel");if(this._events.flick&&o<200&&a<100&&l<100)return void this._execEvent("flick");if(this.options.momentum&&o<300&&(i=this.hasHorizontalScroll?h.momentum(this.x,this.startX,o,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:n,duration:0},e=this.hasVerticalScroll?h.momentum(this.y,this.startY,o,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:r,duration:0},n=i.destination,r=e.destination,c=s.max(i.duration,e.duration),this.isInTransition=1),this.options.snap){var d=this._nearestSnap(n,r);this.currentPage=d,c=this.options.snapSpeed||s.max(s.max(s.min(s.abs(n-d.x),1e3),s.min(s.abs(r-d.y),1e3)),300),n=d.x,r=d.y,this.directionX=0,this.directionY=0,p=this.options.bounceEasing}return n!=this.x||r!=this.y?((n>0||n0||r0?i=0:this.x0?s=0:this.y-1&&this._events[t].splice(s,1)}},_execEvent:function(t){if(this._events[t]){var i=0,s=this._events[t].length;if(s)for(;i0;var o=this.options.useTransition&&e.style;!s||o?(o&&(this._transitionTimingFunction(e.style),this._transitionTime(s)),this._translate(t,i)):this._animate(t,i,s,e.fn)},scrollToElement:function(t,i,e,o,n){if(t=t.nodeType?t:this.scroller.querySelector(t)){var r=h.offset(t);r.left-=this.wrapperOffset.left,r.top-=this.wrapperOffset.top;var a=h.getRect(t),l=h.getRect(this.wrapper);e===!0&&(e=s.round(a.width/2-l.width/2)),o===!0&&(o=s.round(a.height/2-l.height/2)),r.left-=e||0,r.top-=o||0,r.left=r.left>0?0:r.left0?0:r.topthis.options.zoomMax&&(l=2*this.options.zoomMax*s.pow(.5,this.options.zoomMax/l)),i=l/this.startScale,e=this.originX-this.originX*i+this.startX,o=this.originY-this.originY*i+this.startY,this.scale=l,this.scrollTo(e,o,0)}},_zoomEnd:function(t){if(this.enabled&&h.eventType[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault();var i,s,e;this.isInTransition=0,this.initiated=0,this.scale>this.options.zoomMax?this.scale=this.options.zoomMax:this.scale0?i=0:i0?s=0:sthis.options.zoomMax&&(t=this.options.zoomMax),t!=this.scale){var o=t/this.scale;i=void 0===i?this.wrapperWidth/2-this.wrapperOffset.left:i,s=void 0===s?this.wrapperHeight/2-this.wrapperOffset.top:s,e=void 0===e?300:e,i=i+this.wrapperOffset.left-this.x,s=s+this.wrapperOffset.top-this.y,i=i-i*o+this.x,s=s-s*o+this.y,this.scale=t,this.refresh(),i>0?i=0:i0?s=0:s0?o--:i<0&&o++,e>0?n--:e<0&&n++,void this.goToPage(o,n);o=this.x+s.round(this.hasHorizontalScroll?i:0),n=this.y+s.round(this.hasVerticalScroll?e:0),this.directionX=i>0?-1:i<0?1:0,this.directionY=e>0?-1:e<0?1:0,o>0?o=0:o0?n=0:n-this.scrollerWidth;){for(this.pages[l]=[],t=0,n=0;n>-this.scrollerHeight;)this.pages[l][t]={x:s.max(p,this.maxScrollX),y:s.max(n,this.maxScrollY),width:d,height:u,cx:p-e,cy:n-o},n-=u,t++;p-=d,l++}else for(r=this.options.snap,t=r.length,i=-1;lthis.maxScrollX&&c++;this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0),this.options.snapThreshold%1===0?(this.snapThresholdX=this.options.snapThreshold,this.snapThresholdY=this.options.snapThreshold):(this.snapThresholdX=s.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold),this.snapThresholdY=s.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold))}}),this.on("flick",function(){var t=this.options.snapSpeed||s.max(s.max(s.min(s.abs(this.x-this.startX),1e3),s.min(s.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,t)})},_nearestSnap:function(t,i){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var e=0,o=this.pages.length,n=0;if(s.abs(t-this.absStartX)0?t=0:t0?i=0:i=this.pages[e][0].cx){t=this.pages[e][0].x;break}for(o=this.pages[e].length;n=this.pages[0][n].cy){i=this.pages[0][n].y;break}return e==this.currentPage.pageX&&(e+=this.directionX,e<0?e=0:e>=this.pages.length&&(e=this.pages.length-1),t=this.pages[e][0].x),n==this.currentPage.pageY&&(n+=this.directionY,n<0?n=0:n>=this.pages[0].length&&(n=this.pages[0].length-1),i=this.pages[0][n].y),{x:t,y:i,pageX:e,pageY:n}},goToPage:function(t,i,e,o){o=o||this.options.bounceEasing,t>=this.pages.length?t=this.pages.length-1:t<0&&(t=0),i>=this.pages[t].length?i=this.pages[t].length-1:i<0&&(i=0);var n=this.pages[t][i].x,r=this.pages[t][i].y;e=void 0===e?this.options.snapSpeed||s.max(s.max(s.min(s.abs(n-this.x),1e3),s.min(s.abs(r-this.y),1e3)),300):e,this.currentPage={x:n,y:r,pageX:t,pageY:i},this.scrollTo(n,r,e,o)},next:function(t,i){var s=this.currentPage.pageX,e=this.currentPage.pageY;s++,s>=this.pages.length&&this.hasVerticalScroll&&(s=0,e++),this.goToPage(s,e,t,i)},prev:function(t,i){var s=this.currentPage.pageX,e=this.currentPage.pageY;s--,s<0&&this.hasVerticalScroll&&(s=0,e--),this.goToPage(s,e,t,i)},_initKeys:function(i){var s,e={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};if("object"==typeof this.options.keyBindings)for(s in this.options.keyBindings)"string"==typeof this.options.keyBindings[s]&&(this.options.keyBindings[s]=this.options.keyBindings[s].toUpperCase().charCodeAt(0));else this.options.keyBindings={};for(s in e)this.options.keyBindings[s]=this.options.keyBindings[s]||e[s];h.addEvent(t,"keydown",this),this.on("destroy",function(){h.removeEvent(t,"keydown",this)})},_key:function(t){if(this.enabled){var i,e=this.options.snap,o=e?this.currentPage.pageX:this.x,n=e?this.currentPage.pageY:this.y,r=h.getTime(),a=this.keyTime||0,l=.25;switch(this.options.useTransition&&this.isInTransition&&(i=this.getComputedPosition(),this._translate(s.round(i.x),s.round(i.y)),this.isInTransition=!1),this.keyAcceleration=r-a<200?s.min(this.keyAcceleration+l,50):0,t.keyCode){case this.options.keyBindings.pageUp:this.hasHorizontalScroll&&!this.hasVerticalScroll?o+=e?1:this.wrapperWidth:n+=e?1:this.wrapperHeight;break;case this.options.keyBindings.pageDown:this.hasHorizontalScroll&&!this.hasVerticalScroll?o-=e?1:this.wrapperWidth:n-=e?1:this.wrapperHeight;break;case this.options.keyBindings.end:o=e?this.pages.length-1:this.maxScrollX,n=e?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:o=0,n=0;break;case this.options.keyBindings.left:o+=e?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:n+=e?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:o-=e?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.down:n-=e?1:5+this.keyAcceleration>>0;break;default:return}if(e)return void this.goToPage(o,n);o>0?(o=0,this.keyAcceleration=0):o0?(n=0,this.keyAcceleration=0):n=p?(n.isAnimating=!1,n._translate(t,i),void(n.resetPosition(n.options.bounceTime)||n._execEvent("scrollEnd"))):(f=(f-c)/s,m=e(f),d=(t-a)*m+a,u=(i-l)*m+l,n._translate(d,u),void(n.isAnimating&&r(o)))}var n=this,a=this.x,l=this.y,c=h.getTime(),p=c+s;this.isAnimating=!0,o()},handleEvent:function(t){switch(t.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(t),this.options.zoom&&t.touches&&t.touches.length>1&&this._zoomStart(t);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":if(this.options.zoom&&t.touches&&t.touches[1])return void this._zoom(t);this._move(t);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":if(this.scaled)return void this._zoomEnd(t);this._end(t);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(t);break;case"wheel":case"DOMMouseScroll":case"mousewheel":if("zoom"==this.options.wheelAction)return void this._wheelZoom(t);this._wheel(t);break;case"keydown":this._key(t)}}},n.prototype={handleEvent:function(t){switch(t.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(t);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(t);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(t)}},destroy:function(){this.options.fadeScrollbars&&(clearTimeout(this.fadeTimeout),this.fadeTimeout=null),this.options.interactive&&(h.removeEvent(this.indicator,"touchstart",this),h.removeEvent(this.indicator,h.prefixPointerEvent("pointerdown"),this),h.removeEvent(this.indicator,"mousedown",this),h.removeEvent(t,"touchmove",this),h.removeEvent(t,h.prefixPointerEvent("pointermove"),this),h.removeEvent(t,"mousemove",this),h.removeEvent(t,"touchend",this),h.removeEvent(t,h.prefixPointerEvent("pointerup"),this),h.removeEvent(t,"mouseup",this)),this.options.defaultScrollbars&&this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper)},_start:function(i){var s=i.touches?i.touches[0]:i;i.preventDefault(),i.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=s.pageX,this.lastPointY=s.pageY,this.startTime=h.getTime(),this.options.disableTouch||h.addEvent(t,"touchmove",this),this.options.disablePointer||h.addEvent(t,h.prefixPointerEvent("pointermove"),this),this.options.disableMouse||h.addEvent(t,"mousemove",this),this.scroller._execEvent("beforeScrollStart")},_move:function(t){var i,s,e,o,n=t.touches?t.touches[0]:t;h.getTime();this.moved||this.scroller._execEvent("scrollStart"),this.moved=!0,i=n.pageX-this.lastPointX,this.lastPointX=n.pageX,s=n.pageY-this.lastPointY,this.lastPointY=n.pageY,e=this.x+i,o=this.y+s,this._pos(e,o),t.preventDefault(),t.stopPropagation()},_end:function(i){if(this.initiated){if(this.initiated=!1,i.preventDefault(),i.stopPropagation(),h.removeEvent(t,"touchmove",this),h.removeEvent(t,h.prefixPointerEvent("pointermove"),this),h.removeEvent(t,"mousemove",this),this.scroller.options.snap){var e=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),o=this.options.snapSpeed||s.max(s.max(s.min(s.abs(this.scroller.x-e.x),1e3),s.min(s.abs(this.scroller.y-e.y),1e3)),300); +this.scroller.x==e.x&&this.scroller.y==e.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=e,this.scroller.scrollTo(e.x,e.y,o,this.scroller.options.bounceEasing))}this.moved&&this.scroller._execEvent("scrollEnd")}},transitionTime:function(t){t=t||0;var i=h.style.transitionDuration;if(i&&(this.indicatorStyle[i]=t+"ms",!t&&h.isBadAndroid)){this.indicatorStyle[i]="0.0001ms";var s=this;r(function(){"0.0001ms"===s.indicatorStyle[i]&&(s.indicatorStyle[i]="0s")})}},transitionTimingFunction:function(t){this.indicatorStyle[h.style.transitionTimingFunction]=t},refresh:function(){this.transitionTime(),this.options.listenX&&!this.options.listenY?this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block":"none":this.options.listenY&&!this.options.listenX?this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none":this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none",this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll?(h.addClass(this.wrapper,"iScrollBothScrollbars"),h.removeClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="8px":this.wrapper.style.bottom="8px")):(h.removeClass(this.wrapper,"iScrollBothScrollbars"),h.addClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="2px":this.wrapper.style.bottom="2px")),h.getRect(this.wrapper),this.options.listenX&&(this.wrapperWidth=this.wrapper.clientWidth,this.options.resize?(this.indicatorWidth=s.max(s.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px"):this.indicatorWidth=this.indicator.clientWidth,this.maxPosX=this.wrapperWidth-this.indicatorWidth,"clip"==this.options.shrink?(this.minBoundaryX=-this.indicatorWidth+8,this.maxBoundaryX=this.wrapperWidth-8):(this.minBoundaryX=0,this.maxBoundaryX=this.maxPosX),this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX),this.options.listenY&&(this.wrapperHeight=this.wrapper.clientHeight,this.options.resize?(this.indicatorHeight=s.max(s.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px"):this.indicatorHeight=this.indicator.clientHeight,this.maxPosY=this.wrapperHeight-this.indicatorHeight,"clip"==this.options.shrink?(this.minBoundaryY=-this.indicatorHeight+8,this.maxBoundaryY=this.wrapperHeight-8):(this.minBoundaryY=0,this.maxBoundaryY=this.maxPosY),this.maxPosY=this.wrapperHeight-this.indicatorHeight,this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY),this.updatePosition()},updatePosition:function(){var t=this.options.listenX&&s.round(this.sizeRatioX*this.scroller.x)||0,i=this.options.listenY&&s.round(this.sizeRatioY*this.scroller.y)||0;this.options.ignoreBoundaries||(tthis.maxBoundaryX?"scale"==this.options.shrink?(this.width=s.max(this.indicatorWidth-(t-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",t=this.maxPosX+this.indicatorWidth-this.width):t=this.maxBoundaryX:"scale"==this.options.shrink&&this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),ithis.maxBoundaryY?"scale"==this.options.shrink?(this.height=s.max(this.indicatorHeight-3*(i-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",i=this.maxPosY+this.indicatorHeight-this.height):i=this.maxBoundaryY:"scale"==this.options.shrink&&this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px")),this.x=t,this.y=i,this.scroller.options.useTransform?this.indicatorStyle[h.style.transform]="translate("+t+"px,"+i+"px)"+this.scroller.translateZ:(this.indicatorStyle.left=t+"px",this.indicatorStyle.top=i+"px")},_pos:function(t,i){t<0?t=0:t>this.maxPosX&&(t=this.maxPosX),i<0?i=0:i>this.maxPosY&&(i=this.maxPosY),t=this.options.listenX?s.round(t/this.sizeRatioX):this.scroller.x,i=this.options.listenY?s.round(i/this.sizeRatioY):this.scroller.y,this.scroller.scrollTo(t,i)},fade:function(t,i){if(!i||this.visible){clearTimeout(this.fadeTimeout),this.fadeTimeout=null;var s=t?250:500,e=t?0:300;t=t?"1":"0",this.wrapperStyle[h.style.transitionDuration]=s+"ms",this.fadeTimeout=setTimeout(function(t){this.wrapperStyle.opacity=t,this.visible=+t}.bind(this,t),e)}}},e.utils=h,"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):t.IScroll=e}(window,document,Math); \ No newline at end of file diff --git a/static/avatar/jquery-ui.min.js b/static/avatar/jquery-ui.min.js new file mode 100644 index 0000000..5824d12 --- /dev/null +++ b/static/avatar/jquery-ui.min.js @@ -0,0 +1,13 @@ +/*! jQuery UI - v1.11.4 - 2015-03-11 +* http://jqueryui.com +* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js +* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ + +(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("
          "))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
          ",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("
          "),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.widthi?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget); +i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("
            ").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("
            ").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("
            ").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"").addClass(this._triggerClass).html(a?e("").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e(""),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target); +return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?""+i+"":J?"":""+i+"",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?""+n+"":J?"":""+n+"",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"",l=B?"
            "+(Y?h:"")+(this._isInRange(e,r)?"":"")+(Y?"":h)+"
            ":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="
            "}for(M+="
            "+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"
            "+"",C=d?"":"",x=0;7>x;x++)N=(x+u)%7,C+="";for(M+=C+"",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="",E=d?"":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+""}Z++,Z>11&&(Z=0,et++),M+="
            "+this._get(e,"weekHeader")+"=5?" class='ui-datepicker-week-end'":"")+">"+""+p[N]+"
            "+this._get(e,"calculateWeek")(z)+""+(j&&!v?" ":W?""+z.getDate()+"":""+z.getDate()+"")+"
            "+(Q?"
            "+(K[0]>0&&T===K[1]-1?"
            ":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="
            ",_="";if(a||!g)_+=""+o[t]+"";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+=""}if(y||(b+=_+(!a&&g&&v?"":" ")),!e.yearshtml)if(e.yearshtml="",a||!v)b+=""+i+"";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":" ")+_),b+="
            "},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("
            ").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0) +},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.lefti[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("
            ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("
            "),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidthe.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
            "),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("
            ").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0; +if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("
            ").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("
            ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("
            ").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("
            ").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("
            ").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("

            ")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("

            ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("
            ").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()}; +f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("
            ").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("
            ").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("
            ").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("
            ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels; +this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("
            ").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("
            ").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("
            ").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("
            ").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("
            ").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file diff --git a/static/avatar/jquery.photoClip.min.js b/static/avatar/jquery.photoClip.min.js new file mode 100644 index 0000000..e570ce3 --- /dev/null +++ b/static/avatar/jquery.photoClip.min.js @@ -0,0 +1,1968 @@ +/*! + * PhotoClip - 一款手势驱动的裁图插件 + * @version v3.4.6 + * @author baijunjie + * @license MIT + * + * git - https://github.com/baijunjie/PhotoClip.js.git + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("hammerjs"), require("iscroll/build/iscroll-zoom"), require("lrz")); + else if(typeof define === 'function' && define.amd) + define(["hammerjs", "iscroll", "lrz"], factory); + else if(typeof exports === 'object') + exports["PhotoClip"] = factory(require("hammerjs"), require("iscroll/build/iscroll-zoom"), require("lrz")); + else + root["PhotoClip"] = factory(root["Hammer"], root["IScroll"], root["lrz"]); +})(window, function(__WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__6__, __WEBPACK_EXTERNAL_MODULE__7__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 4); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 判断对象是否为数组 + module.exports = function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + }; +}); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + // 判断是否为一个对象 + module.exports = function (obj) { + return _typeof(obj) === 'object'; + }; +}); + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 判断是否为数字类型 + module.exports = function (num) { + return typeof num === 'number'; + }; +}); + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + /** + * 让隐藏元素正确执行程序(IE9及以上浏览器) + * @param elems {DOM|Array} DOM元素或者DOM元素组成的数组 + * @param func {Function} 需要执行的程序函数 + * @param target {Object} 执行程序时函数中 this 的指向 + */ + var defaultDisplayMap = {}; + + module.exports = function (elems, func, target) { + if (_typeof(elems) !== 'object') { + elems = []; + } + + if (typeof elems.length === 'undefined') { + elems = [elems]; + } + + var hideElems = [], + hideElemsDisplay = []; + + for (var i = 0, elem; elem = elems[i++];) { + while (elem instanceof HTMLElement) { + var nodeName = elem.nodeName; + + if (!elem.getClientRects().length) { + hideElems.push(elem); + hideElemsDisplay.push(elem.style.display); + var display = defaultDisplayMap[nodeName]; + + if (!display) { + var temp = document.createElement(nodeName); + document.body.appendChild(temp); + display = window.getComputedStyle(temp).display; + temp.parentNode.removeChild(temp); + if (display === 'none') display = 'block'; + defaultDisplayMap[nodeName] = display; + } + + elem.style.display = display; + } + + if (nodeName === 'BODY') break; + elem = elem.parentNode; + } + } + + if (typeof func === 'function') func.call(target || this); + var l = hideElems.length; + + while (l--) { + hideElems.pop().style.display = hideElemsDisplay.pop(); + } + }; +}); + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(5), __webpack_require__(6), __webpack_require__(7), __webpack_require__(8), __webpack_require__(9), __webpack_require__(10), __webpack_require__(2), __webpack_require__(0), __webpack_require__(14), __webpack_require__(15), __webpack_require__(16), __webpack_require__(3), __webpack_require__(17), __webpack_require__(18), __webpack_require__(19), __webpack_require__(20), __webpack_require__(22)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function (_exports, _hammerjs, _iscrollZoom, _lrz, _bind, _destroy2, _extend, _isNumber, _isArray, _isPercent, _createElement, _removeElement, _hideAction, _support, _css, _attr, _$, utils) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.default = void 0; + _hammerjs = _interopRequireDefault(_hammerjs); + _iscrollZoom = _interopRequireDefault(_iscrollZoom); + _lrz = _interopRequireDefault(_lrz); + _bind = _interopRequireDefault(_bind); + _destroy2 = _interopRequireDefault(_destroy2); + _extend = _interopRequireDefault(_extend); + _isNumber = _interopRequireDefault(_isNumber); + _isArray = _interopRequireDefault(_isArray); + _isPercent = _interopRequireDefault(_isPercent); + _createElement = _interopRequireDefault(_createElement); + _removeElement = _interopRequireDefault(_removeElement); + _hideAction = _interopRequireDefault(_hideAction); + _support = _interopRequireDefault(_support); + _css = _interopRequireDefault(_css); + _attr = _interopRequireDefault(_attr); + _$ = _interopRequireDefault(_$); + utils = _interopRequireWildcard(utils); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + + var is_mobile = !!navigator.userAgent.match(/mobile/i), + is_android = !!navigator.userAgent.match(/android/i), + // 测试浏览器是否支持 Transition 动画,以及支持的前缀 + supportTransition = (0, _support.default)('transition'), + prefix = (0, _support.default)('transform'), + noop = function noop() {}; + + var defaultOptions = { + size: [100, 100], + adaptive: '', + outputSize: [0, 0], + outputType: 'jpg', + outputQuality: .8, + maxZoom: 1, + rotateFree: !is_android, + view: '', + file: '', + ok: '', + img: '', + loadStart: noop, + loadComplete: noop, + loadError: noop, + done: noop, + fail: noop, + lrzOption: { + width: is_android ? 1000 : undefined, + height: is_android ? 1000 : undefined, + quality: .7 + }, + style: { + maskColor: 'rgba(0,0,0,.5)', + maskBorder: '2px dashed #ddd', + jpgFillColor: '#fff' + }, + errorMsg: { + noSupport: '您的浏览器版本过于陈旧,无法支持裁图功能,请更换新的浏览器!', + imgError: '不支持该图片格式,请选择常规格式的图片文件!', + imgHandleError: '图片处理失败!请更换其它图片尝试。', + imgLoadError: '图片读取失败!可能图片过大,请更换其它图片尝试。', + imgSizeError: '图片过大,请重新选择', + noImg: '没有可裁剪的图片!', + clipError: '截图失败!当前图片源文件可能存在跨域问题,请确保图片与应用同源。如果您是在本地环境下执行本程序,请更换至服务器环境。' + } + }; + + var PhotoClip = + /*#__PURE__*/ + function () { + function PhotoClip(container, options) { + _classCallCheck(this, PhotoClip); + + container = (0, _$.default)(container); // 获取容器 + + if (container && container.length) { + this._$container = container[0]; + } else { + return; + } + + this._options = (0, _extend.default)(true, {}, defaultOptions, options); + + if (prefix === undefined) { + this._options.errorMsg.noSupport && alert(this._options.errorMsg.noSupport); + } + + this._init(); + } + + _createClass(PhotoClip, [{ + key: "_init", + value: function _init() { + var _this = this; + + var options = this._options; // options 预设 + + if ((0, _isNumber.default)(options.size)) { + options.size = [options.size, options.size]; + } else if ((0, _isArray.default)(options.size)) { + if (!(0, _isNumber.default)(options.size[0]) || options.size[0] <= 0) options.size[0] = defaultOptions.size[0]; + if (!(0, _isNumber.default)(options.size[1]) || options.size[1] <= 0) options.size[1] = defaultOptions.size[1]; + } else { + options.size = (0, _extend.default)({}, defaultOptions.size); + } + + if ((0, _isNumber.default)(options.outputSize)) { + options.outputSize = [options.outputSize, 0]; + } else if ((0, _isArray.default)(options.outputSize)) { + if (!(0, _isNumber.default)(options.outputSize[0]) || options.outputSize[0] < 0) options.outputSize[0] = defaultOptions.outputSize[0]; + if (!(0, _isNumber.default)(options.outputSize[1]) || options.outputSize[1] < 0) options.outputSize[1] = defaultOptions.outputSize[1]; + } else { + options.outputSize = (0, _extend.default)({}, defaultOptions.outputSize); + } + + if (options.outputType === 'jpg') { + options.outputType = 'image/jpeg'; + } else { + // 如果不是 jpg,则全部按 png 来对待 + options.outputType = 'image/png'; + } // 变量初始化 + + + if ((0, _isArray.default)(options.adaptive)) { + this._widthIsPercent = options.adaptive[0] && (0, _isPercent.default)(options.adaptive[0]) ? options.adaptive[0] : false; + this._heightIsPercent = options.adaptive[1] && (0, _isPercent.default)(options.adaptive[1]) ? options.adaptive[1] : false; + } + + this._outputWidth = options.outputSize[0]; + this._outputHeight = options.outputSize[1]; + this._canvas = document.createElement('canvas'); // 图片裁剪用到的画布 + + this._iScroll = null; // 图片的scroll对象,包含图片的位置与缩放信息 + + this._hammerManager = null; // hammer 管理对象 + + this._clipWidth = 0; + this._clipHeight = 0; + this._clipSizeRatio = 1; // 截取框宽高比 + + this._$img = null; // 图片的DOM对象 + + this._imgLoaded = false; // 图片是否已经加载完成 + + this._containerWidth = 0; + this._containerHeight = 0; + this._viewList = null; // 最终截图后呈现的视图容器的DOM数组 + + this._fileList = null; // file 控件的DOM数组 + + this._okList = null; // 截图按钮的DOM数组 + + this._$mask = null; + this._$mask_left = null; + this._$mask_right = null; + this._$mask_right = null; + this._$mask_bottom = null; + this._$clip_frame = null; + this._$clipLayer = null; // 裁剪层,包含移动层 + + this._$moveLayer = null; // 移动层,包含旋转层 + + this._$rotateLayer = null; // 旋转层 + + this._moveLayerWidth = 0; // 移动层的宽度(不跟随scale发生变化) + + this._moveLayerHeight = 0; // 移动层的高度(不跟随scale发生变化) + + this._moveLayerPaddingLeft = 0; // 当图片宽度小于裁剪框宽度时,移动层的补偿左边距(不跟随scale发生变化) + + this._moveLayerPaddingTop = 0; // 当图片高度小于裁剪框高度时,移动层的补偿顶边距(不跟随scale发生变化) + + this._atRotation = false; // 旋转层是否正在旋转中 + + this._rotateLayerWidth = 0; // 旋转层所呈现矩形的宽度(不跟随scale发生变化) + + this._rotateLayerHeight = 0; // 旋转层所呈现矩形的高度(不跟随scale发生变化) + + this._rotateLayerX = 0; // 旋转层的当前X坐标(不跟随scale发生变化) + + this._rotateLayerY = 0; // 旋转层的当前Y坐标(不跟随scale发生变化) + + this._rotateLayerOriginX = 0; // 旋转层的旋转参考点X(不跟随scale发生变化) + + this._rotateLayerOriginY = 0; // 旋转层的旋转参考点Y(不跟随scale发生变化) + + this._curAngle = 0; // 旋转层的当前角度 + + (0, _bind.default)(this, '_resetScroll', '_rotateCW90', '_fileOnChangeHandle', '_clipImg', '_resize', 'size', 'load', 'clear', 'rotate', 'scale', 'clip', 'destroy'); + + this._initElements(); + + this._initScroll(); + + this._initRotationEvent(); + + this._initFile(); + + this._resize(); + + window.addEventListener('resize', this._resize); + + if (this._okList = (0, _$.default)(options.ok)) { + this._okList.forEach(function ($ok) { + $ok.addEventListener('click', _this._clipImg); + }); + } + + if (this._options.img) { + this._lrzHandle(this._options.img); + } + } + }, { + key: "_initElements", + value: function _initElements() { + // 初始化容器 + var $container = this._$container, + style = $container.style, + containerOriginStyle = {}; + containerOriginStyle['user-select'] = style['user-select']; + containerOriginStyle['overflow'] = style['overflow']; + containerOriginStyle['position'] = style['position']; + this._containerOriginStyle = containerOriginStyle; + (0, _css.default)($container, { + 'user-select': 'none', + 'overflow': 'hidden' + }); + + if ((0, _css.default)($container, 'position') === 'static') { + (0, _css.default)($container, 'position', 'relative'); + } // 创建裁剪层 + + + this._$clipLayer = (0, _createElement.default)($container, 'photo-clip-layer', { + 'position': 'absolute', + 'left': '50%', + 'top': '50%' + }); + this._$moveLayer = (0, _createElement.default)(this._$clipLayer, 'photo-clip-move-layer'); + this._$rotateLayer = (0, _createElement.default)(this._$moveLayer, 'photo-clip-rotate-layer'); // 创建遮罩 + + var $mask = this._$mask = (0, _createElement.default)($container, 'photo-clip-mask', { + 'position': 'absolute', + 'left': 0, + 'top': 0, + 'width': '100%', + 'height': '100%', + 'pointer-events': 'none' + }); + var options = this._options, + maskColor = options.style.maskColor, + maskBorder = options.style.maskBorder; + this._$mask_left = (0, _createElement.default)($mask, 'photo-clip-mask-left', { + 'position': 'absolute', + 'left': 0, + 'right': '50%', + 'top': '50%', + 'bottom': '50%', + 'width': 'auto', + 'background-color': maskColor + }); + this._$mask_right = (0, _createElement.default)($mask, 'photo-clip-mask-right', { + 'position': 'absolute', + 'left': '50%', + 'right': 0, + 'top': '50%', + 'bottom': '50%', + 'background-color': maskColor + }); + this._$mask_top = (0, _createElement.default)($mask, 'photo-clip-mask-top', { + 'position': 'absolute', + 'left': 0, + 'right': 0, + 'top': 0, + 'bottom': '50%', + 'background-color': maskColor + }); + this._$mask_bottom = (0, _createElement.default)($mask, 'photo-clip-mask-bottom', { + 'position': 'absolute', + 'left': 0, + 'right': 0, + 'top': '50%', + 'bottom': 0, + 'background-color': maskColor + }); // 创建截取框 + + this._$clip_frame = (0, _createElement.default)($mask, 'photo-clip-area', { + 'border': maskBorder, + 'position': 'absolute', + 'left': '50%', + 'top': '50%' + }); // 初始化视图容器 + + this._viewList = (0, _$.default)(options.view); + + if (this._viewList) { + var viewOriginStyleList = []; + + this._viewList.forEach(function ($view, i) { + var style = $view.style, + viewOriginStyle = {}; + //viewOriginStyle['background-repeat'] = style['background-repeat']; + //viewOriginStyle['background-position'] = style['background-position']; + //viewOriginStyle['background-size'] = style['background-size']; + viewOriginStyleList[i] = viewOriginStyle; + /* + (0, _css.default)($view, { + 'background-repeat': 'no-repeat', + 'background-position': 'center', + 'background-size': 'contain' + }); + */ + }); + + this._viewOriginStyleList = viewOriginStyleList; + } + } + }, { + key: "_initScroll", + value: function _initScroll() { + var _this2 = this; + + this._iScroll = new _iscrollZoom.default(this._$clipLayer, { + zoom: true, + scrollX: true, + scrollY: true, + freeScroll: true, + mouseWheel: true, + disablePointer: true, + // important to disable the pointer events that causes the issues + disableTouch: false, + // false if you want the slider to be usable with touch devices + disableMouse: false, + // false if you want the slider to be usable with a mouse (desktop) + wheelAction: 'zoom', + bounceTime: 300 + }); + + this._iScroll.on('zoomEnd', function () { + _this2._calcScale(); + + _this2._resizeMoveLayer(); + + _this2._refreshScroll(); + }); + } // 重置 iScroll + + }, { + key: "_resetScroll", + value: function _resetScroll() { + var iScroll = this._iScroll; + + this._calcScale(); + + var scale = iScroll.scale = iScroll.options.startZoom; + + this._resizeMoveLayer(); // 重置旋转层 + + + this._rotateLayerX = 0; + this._rotateLayerY = 0; + this._curAngle = 0; + setTransform(this._$rotateLayer, this._rotateLayerX + this._moveLayerPaddingLeft, this._rotateLayerY + this._moveLayerPaddingTop, this._curAngle); // 初始化居中 + + iScroll.scrollTo((this._clipWidth - this._moveLayerWidth * scale) * .5, (this._clipHeight - this._moveLayerHeight * scale) * .5); + + this._refreshScroll(); + } // 刷新 iScroll + // duration 表示移动层超出容器时的复位动画持续时长 + + }, { + key: "_refreshScroll", + value: function _refreshScroll(duration) { + duration = duration || 0; + var iScroll = this._iScroll, + scale = iScroll.scale, + iScrollOptions = iScroll.options; + var lastScale = Math.max(iScrollOptions.zoomMin, Math.min(iScrollOptions.zoomMax, scale)); + + if (lastScale !== scale) { + iScroll.zoom(lastScale, undefined, undefined, duration); + } + + iScroll.refresh(duration); + } // 调整移动层 + + }, { + key: "_resizeMoveLayer", + value: function _resizeMoveLayer() { + var iScroll = this._iScroll, + iScrollOptions = iScroll.options, + scale = Math.max(iScrollOptions.zoomMin, Math.min(iScrollOptions.zoomMax, iScroll.scale)); + var width = this._rotateLayerWidth, + height = this._rotateLayerHeight, + clipWidth = this._clipWidth / scale, + clipHeight = this._clipHeight / scale, + ltClipArea = false; + + if (clipWidth > width) { + ltClipArea = true; + var offset = clipWidth - width; + width += offset * 2; + iScroll.x += (this._moveLayerPaddingLeft - offset) * scale; + this._moveLayerPaddingLeft = offset; + } else { + this._moveLayerPaddingLeft = 0; + } + + if (clipHeight > height) { + ltClipArea = true; + + var _offset = clipHeight - height; + + height += _offset * 2; + iScroll.y += (this._moveLayerPaddingTop - _offset) * scale; + this._moveLayerPaddingTop = _offset; + } else { + this._moveLayerPaddingTop = 0; + } + + if (ltClipArea) { + setTransform(this._$rotateLayer, this._rotateLayerX + this._moveLayerPaddingLeft, this._rotateLayerY + this._moveLayerPaddingTop, this._curAngle); + iScroll.scrollTo(iScroll.x, iScroll.y); + } + + if (this._moveLayerWidth === width && this._moveLayerHeight === height) return; + this._moveLayerWidth = width; + this._moveLayerHeight = height; + (0, _css.default)(this._$moveLayer, { + 'width': width, + 'height': height + }); // 在移动设备上,尤其是Android设备,当为一个元素重置了宽高时 + // 该元素的 offsetWidth/offsetHeight、clientWidth/clientHeight 等属性并不会立即更新,导致相关的js程序出现错误 + // iscroll 在刷新方法中正是使用了 offsetWidth/offsetHeight 来获取scroller元素($moveLayer)的宽高 + // 因此需要手动将元素重新添加进文档,迫使浏览器强制更新元素的宽高 + + this._$clipLayer.appendChild(this._$moveLayer); + } + }, { + key: "_calcScale", + value: function _calcScale() { + var iScroll = this._iScroll, + iScrollOptions = iScroll.options, + width = this._rotateLayerWidth, + height = this._rotateLayerHeight, + maxZoom = this._options.maxZoom; + + if (width && height) { + iScrollOptions.zoomMin = utils.getScale(this._clipWidth, this._clipHeight, width, height); + iScrollOptions.zoomMax = Math.max(1, iScrollOptions.zoomMin); + iScrollOptions.startZoom = Math.min(iScrollOptions.zoomMax, utils.getScale(this._containerWidth, this._containerHeight, width, height)); + } else { + iScrollOptions.zoomMin = 1; + iScrollOptions.zoomMax = 1; + iScrollOptions.startZoom = 1; + } // console.log('zoomMin', iScrollOptions.zoomMin); + // console.log('zoomMax', iScrollOptions.zoomMax); + // console.log('startZoom', iScrollOptions.startZoom); + + } + }, { + key: "_initRotationEvent", + value: function _initRotationEvent() { + var _this3 = this; + + if (is_mobile) { + this._hammerManager = new _hammerjs.default.Manager(this._$moveLayer); + + this._hammerManager.add(new _hammerjs.default.Rotate()); + + var rotateFree = this._options.rotateFree, + bounceTime = this._iScroll.options.bounceTime; + var startTouch, startAngle, curAngle; + + this._hammerManager.on('rotatestart', function (e) { + if (_this3._atRotation) return; + startTouch = true; + + if (rotateFree) { + startAngle = (e.rotation - _this3._curAngle) % 360; + + _this3._rotateLayerRotateReady(e.center); + } else { + startAngle = e.rotation; + } + }); + + this._hammerManager.on('rotatemove', function (e) { + if (!startTouch) return; + curAngle = e.rotation - startAngle; + rotateFree && _this3._rotateLayerRotate(curAngle); + }); + + this._hammerManager.on('rotateend rotatecancel', function (e) { + if (!startTouch) return; + startTouch = false; + + if (!rotateFree) { + curAngle %= 360; + if (curAngle > 180) curAngle -= 360;else if (curAngle < -180) curAngle += 360; + + if (curAngle > 30) { + _this3._rotateBy(90, bounceTime, e.center); + } else if (curAngle < -30) { + _this3._rotateBy(-90, bounceTime, e.center); + } + + return; + } // 接近整90度方向时,进行校正 + + + var angle = curAngle % 360; + if (angle < 0) angle += 360; + + if (angle < 10) { + curAngle += -angle; + } else if (angle > 80 && angle < 100) { + curAngle += 90 - angle; + } else if (angle > 170 && angle < 190) { + curAngle += 180 - angle; + } else if (angle > 260 && angle < 280) { + curAngle += 270 - angle; + } else if (angle > 350) { + curAngle += 360 - angle; + } + + _this3._rotateLayerRotateFinish(curAngle, bounceTime); + }); + } else { + this._$moveLayer.addEventListener('dblclick', this._rotateCW90); + } + } + }, { + key: "_rotateCW90", + value: function _rotateCW90(e) { + this._rotateBy(90, this._iScroll.options.bounceTime, { + x: e.clientX, + y: e.clientY + }); + } + }, { + key: "_rotateBy", + value: function _rotateBy(angle, duration, center) { + this._rotateTo(this._curAngle + angle, duration, center); + } + }, { + key: "_rotateTo", + value: function _rotateTo(angle, duration, center) { + if (this._atRotation) return; + + this._rotateLayerRotateReady(center); // 旋转层旋转结束 + + + this._rotateLayerRotateFinish(angle, duration); + } // 旋转层旋转准备 + + }, { + key: "_rotateLayerRotateReady", + value: function _rotateLayerRotateReady(center) { + var scale = this._iScroll.scale; + var coord; // 旋转参考点在移动层中的坐标 + + if (!center) { + coord = utils.loaclToLoacl(this._$moveLayer, this._$clipLayer, this._clipWidth * .5, this._clipHeight * .5); + } else { + coord = utils.globalToLoacl(this._$moveLayer, center.x, center.y); + } // 由于得到的坐标是在缩放后坐标系上的坐标,因此需要除以缩放比例 + + + coord.x /= scale; + coord.y /= scale; // 旋转参考点相对于旋转层零位(旋转层旋转前左上角)的坐标 + + var coordBy0 = { + x: coord.x - (this._rotateLayerX + this._moveLayerPaddingLeft), + y: coord.y - (this._rotateLayerY + this._moveLayerPaddingTop) + }; // 求出旋转层旋转前的旋转参考点 + // 这个参考点就是旋转中心点映射在旋转层图片上的坐标 + // 这个位置表示旋转层旋转前,该点所对应的坐标 + + var origin = utils.pointRotate(coordBy0, -this._curAngle); + this._rotateLayerOriginX = origin.x; + this._rotateLayerOriginY = origin.y; // 设置参考点,算出新参考点作用下的旋转层位移,然后进行补差 + + var rect = this._$rotateLayer.getBoundingClientRect(); + + setOrigin(this._$rotateLayer, this._rotateLayerOriginX, this._rotateLayerOriginY); + + var newRect = this._$rotateLayer.getBoundingClientRect(); + + this._rotateLayerX += (rect.left - newRect.left) / scale; + this._rotateLayerY += (rect.top - newRect.top) / scale; + setTransform(this._$rotateLayer, this._rotateLayerX + this._moveLayerPaddingLeft, this._rotateLayerY + this._moveLayerPaddingTop, this._curAngle); + } // 旋转层旋转 + + }, { + key: "_rotateLayerRotate", + value: function _rotateLayerRotate(angle) { + setTransform(this._$rotateLayer, this._rotateLayerX + this._moveLayerPaddingLeft, this._rotateLayerY + this._moveLayerPaddingTop, angle); + this._curAngle = angle; + } // 旋转层旋转结束 + + }, { + key: "_rotateLayerRotateFinish", + value: function _rotateLayerRotateFinish(angle, duration) { + var _this4 = this; + + setTransform(this._$rotateLayer, this._rotateLayerX + this._moveLayerPaddingLeft, this._rotateLayerY + this._moveLayerPaddingTop, angle); + var iScroll = this._iScroll, + scale = iScroll.scale, + iScrollOptions = iScroll.options; // 获取旋转后的矩形 + + var rect = this._$rotateLayer.getBoundingClientRect(); // 更新旋转层当前所呈现矩形的宽高 + + + this._rotateLayerWidth = rect.width / scale; + this._rotateLayerHeight = rect.height / scale; // 当参考点为零时,获取位移后的矩形 + + setOrigin(this._$rotateLayer, 0, 0); + + var rectByOrigin0 = this._$rotateLayer.getBoundingClientRect(); // 获取旋转前(零度)的矩形 + + + setTransform(this._$rotateLayer, this._rotateLayerX + this._moveLayerPaddingLeft, this._rotateLayerY + this._moveLayerPaddingTop, 0); + + var rectByAngle0 = this._$rotateLayer.getBoundingClientRect(); // 当参考点为零时,旋转层旋转后,在形成的新矩形中,旋转层零位(旋转层旋转前左上角)的新坐标 + + + this._rotateLayerX = (rectByAngle0.left - rectByOrigin0.left) / scale; + this._rotateLayerY = (rectByAngle0.top - rectByOrigin0.top) / scale; + + this._calcScale(); + + this._resizeMoveLayer(); // 获取移动层的矩形 + + + var moveLayerRect = this._$moveLayer.getBoundingClientRect(); // 求出移动层与旋转层之间的位置偏移 + // 由于直接应用在移动层,因此不需要根据缩放换算 + // 注意,这里的偏移有可能还包含缩放过量时多出来的偏移 + + + var offset = { + x: rect.left - this._moveLayerPaddingLeft * scale - moveLayerRect.left, + y: rect.top - this._moveLayerPaddingTop * scale - moveLayerRect.top + }; + iScroll.scrollTo(iScroll.x + offset.x, iScroll.y + offset.y); + + this._refreshScroll(iScroll.options.bounceTime); // 由于 offset 可能还包含缩放过量时多出来的偏移 + // 因此,这里判断是否缩放过量 + + + var lastScale = Math.max(iScrollOptions.zoomMin, Math.min(iScrollOptions.zoomMax, scale)); + + if (lastScale !== scale) { + // 当缩放过量时,将 offset 换算为最终的正常比例对应的值 + offset.x = offset.x / scale * lastScale; + offset.y = offset.y / scale * lastScale; + } // 由于双指旋转时也伴随着缩放,因此这里代码执行完后,将会执行 iscroll 的 _zoomEnd + // 而该方法会基于 touchstart 时记录的位置重新计算 x、y,这将导致手指离开屏幕后,移动层又会向回移动一段距离 + // 所以这里也要将 startX、startY 这两个值进行补差,而这个差值必须是最终的正常比例对应的值 + + + iScroll.startX += offset.x; + iScroll.startY += offset.y; + + if (angle !== this._curAngle && duration && (0, _isNumber.default)(duration) && supportTransition !== undefined) { + // 计算旋转层参考点,设为零位前后的偏移量 + offset = { + x: (rectByOrigin0.left - rect.left) / scale, + y: (rectByOrigin0.top - rect.top) / scale + }; // 将旋转参考点设回前值,同时调整偏移量,保证视图位置不变,准备开始动画 + + setOrigin(this._$rotateLayer, this._rotateLayerOriginX, this._rotateLayerOriginY); + var targetX = this._rotateLayerX + this._moveLayerPaddingLeft + offset.x, + targetY = this._rotateLayerY + this._moveLayerPaddingTop + offset.y; + setTransform(this._$rotateLayer, targetX, targetY, this._curAngle); // 开始旋转 + + this._atRotation = true; + setTransition(this._$rotateLayer, targetX, targetY, angle, duration, function () { + _this4._atRotation = false; + + _this4._rotateFinishUpdataElem(angle); + }); + } else { + this._rotateFinishUpdataElem(angle); + } + } // 旋转结束更新相关元素 + + }, { + key: "_rotateFinishUpdataElem", + value: function _rotateFinishUpdataElem(angle) { + setOrigin(this._$rotateLayer, this._rotateLayerOriginX = 0, this._rotateLayerOriginY = 0); + setTransform(this._$rotateLayer, this._rotateLayerX + this._moveLayerPaddingLeft, this._rotateLayerY + this._moveLayerPaddingTop, this._curAngle = angle % 360); + } + }, { + key: "_initFile", + value: function _initFile() { + var _this5 = this; + + var options = this._options; + + if (this._fileList = (0, _$.default)(options.file)) { + this._fileList.forEach(function ($file) { + // 移动端如果设置 'accept',会使相册打开缓慢,因此这里只为非移动端设置 + if (!is_mobile) { + (0, _attr.default)($file, 'accept', 'image/jpeg, image/x-png, image/png, image/gif'); + } + + $file.addEventListener('change', _this5._fileOnChangeHandle); + }); + } + } + }, { + key: "_fileOnChangeHandle", + value: function _fileOnChangeHandle(e) { + var files = e.target.files; + if (files.length) { + var filemaxsize = 1024 * 5;//5M + var Size = files[0].size / 1024; + if(is_mobile && Size > filemaxsize) { + this._options.loadError.call(this, errorMsg.imgSizeError); + return false; + }else{ + this._lrzHandle(files[0]); + } + } + } + }, { + key: "_lrzHandle", + value: function _lrzHandle(src) { + var _this6 = this; + + var options = this._options, + errorMsg = options.errorMsg; + + if (_typeof(src) === 'object' && src.type && !/image\/\w+/.test(src.type)) { + options.loadError.call(this, errorMsg.imgError); + return false; + } + + this._imgLoaded = false; + options.loadStart.call(this, src); + + try { + (0, _lrz.default)(src, options.lrzOption).then(function (rst) { + // 处理成功会执行 + _this6._clearImg(); + + _this6._createImg(rst.base64); + }).catch(function (err) { + // 处理失败会执行 + options.loadError.call(_this6, errorMsg.imgHandleError, err); + }); + } catch (err) { + options.loadError.call(this, errorMsg.imgHandleError, err); + throw err; + } + } + }, { + key: "_clearImg", + value: function _clearImg() { + if (!this._$img) return; // 删除旧的图片以释放内存,防止IOS设备的 webview 崩溃 + + this._$img.onload = null; + this._$img.onerror = null; + (0, _removeElement.default)(this._$img); + this._$img = null; + this._imgLoaded = false; + } + }, { + key: "_createImg", + value: function _createImg(src) { + var _this7 = this; + + var options = this._options, + errorMsg = options.errorMsg; + this._$img = new Image(); + (0, _css.default)(this._$img, { + 'display': 'block', + 'user-select': 'none', + 'pointer-events': 'none' + }); + + this._$img.onload = function (e) { + var img = e.target; + _this7._imgLoaded = true; + options.loadComplete.call(_this7, img); + + _this7._$rotateLayer.appendChild(img); + + _this7._rotateLayerWidth = img.naturalWidth; + _this7._rotateLayerHeight = img.naturalHeight; + (0, _css.default)(_this7._$rotateLayer, { + 'width': _this7._rotateLayerWidth, + 'height': _this7._rotateLayerHeight + }); + (0, _hideAction.default)([img, _this7._$moveLayer], _this7._resetScroll); + }; + + this._$img.onerror = function (e) { + options.loadError.call(_this7, errorMsg.imgLoadError, e); + }; + + (0, _attr.default)(this._$img, 'src', src); + } + }, { + key: "_clipImg", + value: function _clipImg() { + var options = this._options, + errorMsg = options.errorMsg; + + if (!this._imgLoaded) { + options.fail.call(this, errorMsg.noImg); + return; + } + + var local = utils.loaclToLoacl(this._$moveLayer, this._$clipLayer), + scale = this._iScroll.scale, + ctx = this._canvas.getContext('2d'); + + var scaleX = 1, + scaleY = 1; + + if (this._outputWidth || this._outputHeight) { + this._canvas.width = this._outputWidth; + this._canvas.height = this._outputHeight; + scaleX = this._outputWidth / this._clipWidth * scale; + scaleY = this._outputHeight / this._clipHeight * scale; + } else { + this._canvas.width = this._clipWidth / scale; + this._canvas.height = this._clipHeight / scale; + } + + ctx.clearRect(0, 0, this._canvas.width, this._canvas.height); + ctx.fillStyle = options.outputType === 'image/png' ? 'transparent' : options.style.jpgFillColor; + ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); + ctx.save(); + ctx.scale(scaleX, scaleY); + ctx.translate(this._rotateLayerX + this._moveLayerPaddingLeft - local.x / scale, this._rotateLayerY + this._moveLayerPaddingTop - local.y / scale); + ctx.rotate(this._curAngle * Math.PI / 180); + ctx.drawImage(this._$img, 0, 0); + ctx.restore(); + + try { + var dataURL = this._canvas.toDataURL(options.outputType, options.outputQuality); + + if (this._viewList) { + this._viewList.forEach(function ($view) { + (0, _attr.default)($view, 'src', dataURL); + }); + } + + options.done.call(this, dataURL); + return dataURL; + } catch (err) { + options.fail.call(this, errorMsg.clipError); + throw err; + } + } + }, { + key: "_resize", + value: function _resize(width, height) { + (0, _hideAction.default)(this._$container, function () { + this._containerWidth = this._$container.offsetWidth; + this._containerHeight = this._$container.offsetHeight; + }, this); + var size = this._options.size, + oldClipWidth = this._clipWidth, + oldClipHeight = this._clipHeight; + if ((0, _isNumber.default)(width)) size[0] = width; + if ((0, _isNumber.default)(height)) size[1] = height; + + if (this._widthIsPercent || this._heightIsPercent) { + var ratio = size[0] / size[1]; + + if (this._widthIsPercent) { + this._clipWidth = this._containerWidth / 100 * parseFloat(this._widthIsPercent); + + if (!this._heightIsPercent) { + this._clipHeight = this._clipWidth / ratio; + } + } + + if (this._heightIsPercent) { + this._clipHeight = this._containerHeight / 100 * parseFloat(this._heightIsPercent); + + if (!this._widthIsPercent) { + this._clipWidth = this._clipHeight * ratio; + } + } + } else { + this._clipWidth = size[0]; + this._clipHeight = size[1]; + } + + var clipWidth = this._clipWidth, + clipHeight = this._clipHeight; + this._clipSizeRatio = clipWidth / clipHeight; + + if (this._outputWidth && !this._outputHeight) { + this._outputHeight = this._outputWidth / this._clipSizeRatio; + } + + if (this._outputHeight && !this._outputWidth) { + this._outputWidth = this._outputHeight * this._clipSizeRatio; + } + + (0, _css.default)(this._$clipLayer, { + 'width': clipWidth, + 'height': clipHeight, + 'margin-left': -clipWidth / 2, + 'margin-top': -clipHeight / 2 + }); + (0, _css.default)(this._$mask_left, { + 'margin-right': clipWidth / 2, + 'margin-top': -clipHeight / 2, + 'margin-bottom': -clipHeight / 2 + }); + (0, _css.default)(this._$mask_right, { + 'margin-left': clipWidth / 2, + 'margin-top': -clipHeight / 2, + 'margin-bottom': -clipHeight / 2 + }); + (0, _css.default)(this._$mask_top, { + 'margin-bottom': clipHeight / 2 + }); + (0, _css.default)(this._$mask_bottom, { + 'margin-top': clipHeight / 2 + }); + (0, _css.default)(this._$clip_frame, { + 'width': clipWidth, + 'height': clipHeight + }); + (0, _css.default)(this._$clip_frame, prefix + 'transform', 'translate(-50%, -50%)'); + + if (clipWidth !== oldClipWidth || clipHeight !== oldClipHeight) { + this._calcScale(); + + this._resizeMoveLayer(); + + this._refreshScroll(); + + var iScroll = this._iScroll, + scale = iScroll.scale, + offsetX = (clipWidth - oldClipWidth) * .5 * scale, + offsetY = (clipHeight - oldClipHeight) * .5 * scale; + iScroll.scrollBy(offsetX, offsetY); + } + } + /** + * 设置截取框的宽高 + * 如果设置了 adaptive 选项,则该方法仅用于修改截取框的宽高比例 + * @param {Number} width 截取框的宽度 + * @param {Number} height 截取框的高度 + * @return {PhotoClip} 返回 PhotoClip 的实例对象 + */ + + }, { + key: "size", + value: function size(width, height) { + this._resize(width, height); + + return this; + } + /** + * 加载一张图片 + * @param {String|Object} src 图片的 url,或者图片的 file 文件对象 + * @return {PhotoClip} 返回 PhotoClip 的实例对象 + */ + + }, { + key: "load", + value: function load(src) { + this._lrzHandle(src); + + return this; + } + /** + * 清除当前图片 + * @return {PhotoClip} 返回 PhotoClip 的实例对象 + */ + + }, { + key: "clear", + value: function clear() { + this._clearImg(); + + this._resetScroll(); + + if (this._fileList) { + this._fileList.forEach(function ($file) { + $file.value = ''; + }); + } + + return this; + } + /** + * 图片旋转到指定角度 + * @param {Number} angle 可选。旋转的角度 + * @param {Number} duration 可选。旋转动画的时长,如果为 0 或 false,则表示没有过渡动画 + * @return {PhotoClip|Number} 返回 PhotoClip 的实例对象。如果参数为空,则返回当前的旋转角度 + */ + + }, { + key: "rotate", + value: function rotate(angle, duration) { + if (angle === undefined) return this._curAngle; + + this._rotateTo(angle, duration); + + return this; + } + /** + * 图片缩放到指定比例,如果超出缩放范围,则会被缩放到可缩放极限 + * @param {Number} zoom 可选。缩放比例,取值在 0 - 1 之间 + * @param {Number} duration 可选。缩放动画的时长,如果为 0 或 false,则表示没有过渡动画 + * @return {PhotoClip|Number} 返回 PhotoClip 的实例对象。如果参数为空,则返回当前的缩放比例 + */ + + }, { + key: "scale", + value: function scale(zoom, duration) { + if (zoom === undefined) return this._iScroll.scale; + + this._iScroll.zoom(zoom, undefined, undefined, duration); + + return this; + } + /** + * 截图 + * @return {String} 返回截取后图片的 Base64 字符串 + */ + + }, { + key: "clip", + value: function clip() { + return this._clipImg(); + } + /** + * 销毁 + * @return {Undefined} 无返回值 + */ + + }, { + key: "destroy", + value: function destroy() { + var _this8 = this; + + window.removeEventListener('resize', this._resize); + + this._$container.removeChild(this._$clipLayer); + + this._$container.removeChild(this._$mask); + + (0, _css.default)(this._$container, this._containerOriginStyle); + + if (this._iScroll) { + this._iScroll.destroy(); + } + + if (this._hammerManager) { + this._hammerManager.off('rotatemove'); + + this._hammerManager.off('rotateend'); + + this._hammerManager.destroy(); + } else { + this._$moveLayer.removeEventListener('dblclick', this._rotateCW90); + } + + if (this._$img) { + this._$img.onload = null; + this._$img.onerror = null; + } + + if (this._viewList) { + this._viewList.forEach(function ($view, i) { + (0, _css.default)($view, _this8._viewOriginStyleList[i]); + }); + } + + if (this._fileList) { + this._fileList.forEach(function ($file) { + $file.removeEventListener('change', _this8._fileOnChangeHandle); + $file.value = null; + }); + } + + if (this._okList) { + this._okList.forEach(function ($ok) { + $ok.removeEventListener('click', _this8._clipImg); + }); + } + + (0, _destroy2.default)(this); + } + }]); + + return PhotoClip; + }(); + + _exports.default = PhotoClip; + ; // 设置变换注册点 + + function setOrigin($obj, originX, originY) { + originX = (originX || 0).toFixed(2); + originY = (originY || 0).toFixed(2); + (0, _css.default)($obj, prefix + 'transform-origin', originX + 'px ' + originY + 'px'); + } // 设置变换坐标与旋转角度 + + + function setTransform($obj, x, y, angle) { + // translate(x, y) 中坐标的小数点位数过多会引发 bug + // 因此这里需要保留两位小数 + x = x.toFixed(2); + y = y.toFixed(2); + angle = angle.toFixed(2); + (0, _css.default)($obj, prefix + 'transform', 'translateZ(0) translate(' + x + 'px,' + y + 'px) rotate(' + angle + 'deg)'); + } // 设置变换动画 + + + function setTransition($obj, x, y, angle, dur, fn) { + // 这里需要先读取之前设置好的transform样式,强制浏览器将该样式值渲染到元素 + // 否则浏览器可能出于性能考虑,将暂缓样式渲染,等到之后所有样式设置完成后再统一渲染 + // 这样就会导致之前设置的位移也被应用到动画中 + (0, _css.default)($obj, prefix + 'transform'); // 这里应用的缓动与 iScroll 的默认缓动相同 + + (0, _css.default)($obj, prefix + 'transition', prefix + 'transform ' + dur + 'ms cubic-bezier(0.1, 0.57, 0.1, 1)'); + setTransform($obj, x, y, angle); + setTimeout(function () { + (0, _css.default)($obj, prefix + 'transition', ''); + fn(); + }, dur); + } + + module.exports = exports.default; +}); + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__5__; + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__6__; + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__7__; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + module.exports = function (context) { + for (var _len = arguments.length, methods = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + methods[_key - 1] = arguments[_key]; + } + + methods.forEach(function (method) { + context[method] = context[method].bind(context); + }); + }; +}); + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + module.exports = function (context) { + // 清除所有属性 + Object.getOwnPropertyNames(context).forEach(function (prop) { + delete context[prop]; + }); + context.__proto__ = Object.prototype; + }; +}); + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + var isArray = __webpack_require__(0); + + var isObject = __webpack_require__(1); + + var isBoolean = __webpack_require__(11); + + var isFunction = __webpack_require__(12); + + var isPlainObject = __webpack_require__(13); + + module.exports = function extend() { + var options, + name, + src, + copy, + copyIsArray, + target = arguments[0] || {}, + toString = Object.prototype.toString, + i = 1, + length = arguments.length, + deep = false; // 处理深拷贝 + + if (isBoolean(target)) { + deep = target; // Skip the boolean and the target + + target = arguments[i] || {}; + i++; + } // Handle case when target is a string or something (possible in deep copy) + + + if (!isObject(target) && !isFunction(target)) { + target = {}; + } // 如果没有合并的对象,则表示 target 为合并对象,将 target 合并给当前函数的持有者 + + + if (i === length) { + target = this; + i--; + } + + for (; i < length; i++) { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; // 防止死循环 + + if (target === copy) { + continue; + } // 深拷贝对象或者数组 + + + if (deep && copy && ((copyIsArray = isArray(copy)) || isPlainObject(copy))) { + if (copyIsArray) { + copyIsArray = false; + src = src && isArray(src) ? src : []; + } else { + src = src && isPlainObject(src) ? src : {}; + } + + target[name] = extend(deep, src, copy); + } else if (copy !== undefined) { + // 仅忽略未定义的值 + target[name] = copy; + } + } + } + } // Return the modified object + + + return target; + }; +}); + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 判断是否为布尔值 + module.exports = function (bool) { + return typeof bool === 'boolean'; + }; +}); + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 判断是否为函数 + module.exports = function (func) { + return typeof func === 'function'; + }; +}); + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 判断对象是否为纯粹的对象(通过 "{}" 或者 "new Object" 创建的) + module.exports = function (obj) { + return Object.prototype.toString.call(obj) === '[object Object]'; + }; +}); + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 判断是否为百分比 + module.exports = function (value) { + return /%$/.test(value + ''); + }; +}); + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + // 创建元素 + module.exports = function (parentNode, className, id, prop) { + var elem = document.createElement('DIV'); + + if (_typeof(className) === 'object') { + prop = className; + className = null; + } + + if (_typeof(id) === 'object') { + prop = id; + id = null; + } + + if (_typeof(prop) === 'object') { + for (var p in prop) { + elem.style[p] = prop[p]; + } + } + + if (className) elem.className = className; + if (id) elem.id = id; + parentNode.appendChild(elem); + return elem; + }; +}); + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 移除元素 + module.exports = function (elem) { + elem.parentNode && elem.parentNode.removeChild(elem); + }; +}); + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 返回指定属性在当前浏览器中的兼容前缀 + // 如果无需兼容前缀,则返回一个空字符串 + // all 是一个布尔值,如果为 true,则会返回包含前缀的属性名 + module.exports = function (prop, all) { + var returnProp = all ? prop : ''; + var testElem = document.documentElement; + if (prop in testElem.style) return returnProp; + var testProp = prop.charAt(0).toUpperCase() + prop.substr(1), + prefixs = ['Webkit', 'Moz', 'ms', 'O']; + + for (var i = 0, prefix; prefix = prefixs[i++];) { + if (prefix + testProp in testElem.style) { + return '-' + prefix.toLowerCase() + '-' + returnProp; + } + } + + return returnProp; + }; +}); + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 设置样式 + var isObject = __webpack_require__(1); + + var isNumber = __webpack_require__(2); + + var cssNumber = { + 'animationIterationCount': true, + 'columnCount': true, + 'fillOpacity': true, + 'flexGrow': true, + 'flexShrink': true, + 'fontWeight': true, + 'lineHeight': true, + 'opacity': true, + 'order': true, + 'orphans': true, + 'widows': true, + 'zIndex': true, + 'zoom': true + }; + + module.exports = function (elem, prop, value) { + if (isObject(prop)) { + for (var p in prop) { + value = prop[p]; + if (isNumber(value) && !cssNumber[prop]) value += 'px'; + elem.style[p] = value; + } + + return elem; + } + + if (value === undefined) { + return window.getComputedStyle(elem)[prop]; + } else { + if (isNumber(value) && !cssNumber[prop]) value += 'px'; + elem.style[prop] = value; + return elem; + } + }; +}); + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + // 设置属性 + module.exports = function (elem, prop, value) { + if (_typeof(prop) === 'object') { + for (var p in prop) { + elem[p] = prop[p]; + } + + return elem; + } + + if (value === undefined) { + return elem[prop]; + } else { + elem[prop] = value; + return elem; + } + }; +}); + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + var toArray = __webpack_require__(21); // 获取元素(IE8及以上浏览器) + + + module.exports = function (selector, context) { + if (selector instanceof HTMLElement) { + return [selector]; + } else if (_typeof(selector) === 'object' && selector.length) { + return toArray(selector); + } else if (!selector || typeof selector !== 'string') { + return []; + } + + if (typeof context === 'string') { + context = document.querySelector(context); + } + + if (!(context instanceof HTMLElement)) { + context = document; + } + + return toArray(context.querySelectorAll(selector)); + }; +}); + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function () { + "use strict"; + + // 类似数组对象转数组 + module.exports = function (obj) { + return Array.prototype.map.call(obj, function (n) { + return n; + }); + }; +}); + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(3)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { var mod; } +})(this, function (_exports, _hideAction) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.getScale = getScale; + _exports.pointRotate = pointRotate; + _exports.angleToRadian = angleToRadian; + _exports.loaclToLoacl = loaclToLoacl; + _exports.globalToLoacl = globalToLoacl; + _hideAction = _interopRequireDefault(_hideAction); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + // 获取最大缩放比例 + function getScale(w1, h1, w2, h2) { + var sx = w1 / w2; + var sy = h1 / h2; + return sx > sy ? sx : sy; + } // 计算一个点绕原点旋转后的新坐标 + + + function pointRotate(point, angle) { + var radian = angleToRadian(angle), + sin = Math.sin(radian), + cos = Math.cos(radian); + return { + x: cos * point.x - sin * point.y, + y: cos * point.y + sin * point.x + }; + } // 角度转弧度 + + + function angleToRadian(angle) { + return angle / 180 * Math.PI; + } // 计算layerTwo上的x、y坐标在layerOne上的坐标 + + + function loaclToLoacl(layerOne, layerTwo, x, y) { + x = x || 0; + y = y || 0; + var layerOneRect, layerTwoRect; + (0, _hideAction.default)([layerOne, layerTwo], function () { + layerOneRect = layerOne.getBoundingClientRect(); + layerTwoRect = layerTwo.getBoundingClientRect(); + }); + return { + x: layerTwoRect.left - layerOneRect.left + x, + y: layerTwoRect.top - layerOneRect.top + y + }; + } // 计算相对于窗口的x、y坐标在layer上的坐标 + + + function globalToLoacl(layer, x, y) { + x = x || 0; + y = y || 0; + var layerRect; + (0, _hideAction.default)(layer, function () { + layerRect = layer.getBoundingClientRect(); + }); + return { + x: x - layerRect.left, + y: y - layerRect.top + }; + } +}); + +/***/ }) +/******/ ]); +}); \ No newline at end of file diff --git a/static/avatar/lrz.all.bundle.js b/static/avatar/lrz.all.bundle.js new file mode 100644 index 0000000..d4851c0 --- /dev/null +++ b/static/avatar/lrz.all.bundle.js @@ -0,0 +1,2 @@ +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){n(6),n(7),e.exports=n(8)},function(e,t,n){(function(t){!function(n){function r(e,t){return function(){e.apply(t,arguments)}}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(a,this),r(s,this))}function o(e){var t=this;return null===this._state?void this._deferreds.push(e):void f(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(a,this),r(s,this))}this._state=!0,this._value=e,u.call(this)}catch(n){s.call(this,n)}}function s(e){this._state=!1,this._value=e,u.call(this)}function u(){for(var e=0,t=this._deferreds.length;t>e;e++)o.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}var f="function"==typeof t&&t||function(e){setTimeout(e,1)},d=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=this;return new i(function(r,i){o.call(n,new c(e,t,r,i))})},i.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new i(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(u){n(u)}}if(0===e.length)return t([]);for(var i=e.length,o=0;or;r++)e[r].then(t,n)})},i._setImmediateFn=function(e){f=e},i.prototype.always=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},"undefined"!=typeof e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(t,n(2).setImmediate)},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var o=n(3).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,u={},c=0;t.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:s.call(arguments,1);return u[n]=!0,o(function(){u[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(t,n(2).setImmediate,n(2).clearImmediate)},function(e,t){function n(){c=!1,a.length?u=a.concat(u):l=-1,u.length&&r()}function r(){if(!c){var e=setTimeout(n);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l1)for(var n=1;na;a++)o[a]=n.charCodeAt(a);return i}function a(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){(200==this.status||0===this.status)&&t(this.response)},n.send()}function s(e,t){function n(n){var r=u(n),i=c(n);e.exifdata=r||{},e.iptcdata=i||{},t&&t.call(e)}if(e.src)if(/^data\:/i.test(e.src)){var r=o(e.src);n(r)}else if(/^blob\:/i.test(e.src)){var i=new FileReader;i.onload=function(e){n(e.target.result)},a(e.src,function(e){i.readAsArrayBuffer(e)})}else{var s=new XMLHttpRequest;s.onload=function(){200==this.status||0===this.status?n(s.response):t(new Error("Could not load image")),s=null},s.open("GET",e.src,!0),s.responseType="arraybuffer",s.send(null)}else if(window.FileReader&&(e instanceof window.Blob||e instanceof window.File)){var i=new FileReader;i.onload=function(e){p&&console.log("Got file of length "+e.target.result.byteLength),n(e.target.result)},i.readAsArrayBuffer(e)}}function u(e){var t=new DataView(e);if(p&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return p&&console.log("Not a valid JPEG"),!1;for(var n,r=2,i=e.byteLength;i>r;){if(255!=t.getUint8(r))return p&&console.log("Not a valid marker at offset "+r+", found: "+t.getUint8(r)),!1;if(n=t.getUint8(r+1),p&&console.log(n),225==n)return p&&console.log("Found 0xFFE1 marker"),g(t,r+4,t.getUint16(r+2)-2);r+=2+t.getUint16(r+2)}}function c(e){var t=new DataView(e);if(p&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return p&&console.log("Not a valid JPEG"),!1;for(var n=2,r=e.byteLength,i=function(e,t){return 56===e.getUint8(t)&&66===e.getUint8(t+1)&&73===e.getUint8(t+2)&&77===e.getUint8(t+3)&&4===e.getUint8(t+4)&&4===e.getUint8(t+5)};r>n;){if(i(t,n)){var o=t.getUint8(n+7);o%2!==0&&(o+=1),0===o&&(o=4);var a=n+8+o,s=t.getUint16(n+6+o);return l(e,a,s)}n++}}function l(e,t,n){for(var r,i,o,a,s,u=new DataView(e),c={},l=t;t+n>l;)28===u.getUint8(l)&&2===u.getUint8(l+1)&&(a=u.getUint8(l+2),a in S&&(o=u.getInt16(l+3),s=o+5,i=S[a],r=h(u,l+5,o),c.hasOwnProperty(i)?c[i]instanceof Array?c[i].push(r):c[i]=[c[i],r]:c[i]=r)),l++;return c}function f(e,t,n,r,i){var o,a,s,u=e.getUint16(n,!i),c={};for(s=0;u>s;s++)o=n+12*s+2,a=r[e.getUint16(o,!i)],!a&&p&&console.log("Unknown tag: "+e.getUint16(o,!i)),c[a]=d(e,o,t,n,i);return c}function d(e,t,n,r,i){var o,a,s,u,c,l,f=e.getUint16(t+2,!i),d=e.getUint32(t+4,!i),g=e.getUint32(t+8,!i)+n;switch(f){case 1:case 7:if(1==d)return e.getUint8(t+8,!i);for(o=d>4?g:t+8,a=[],u=0;d>u;u++)a[u]=e.getUint8(o+u);return a;case 2:return o=d>4?g:t+8,h(e,o,d-1);case 3:if(1==d)return e.getUint16(t+8,!i);for(o=d>2?g:t+8,a=[],u=0;d>u;u++)a[u]=e.getUint16(o+2*u,!i);return a;case 4:if(1==d)return e.getUint32(t+8,!i);for(a=[],u=0;d>u;u++)a[u]=e.getUint32(g+4*u,!i);return a;case 5:if(1==d)return c=e.getUint32(g,!i),l=e.getUint32(g+4,!i),s=new Number(c/l),s.numerator=c,s.denominator=l,s;for(a=[],u=0;d>u;u++)c=e.getUint32(g+8*u,!i),l=e.getUint32(g+4+8*u,!i),a[u]=new Number(c/l),a[u].numerator=c,a[u].denominator=l;return a;case 9:if(1==d)return e.getInt32(t+8,!i);for(a=[],u=0;d>u;u++)a[u]=e.getInt32(g+4*u,!i);return a;case 10:if(1==d)return e.getInt32(g,!i)/e.getInt32(g+4,!i);for(a=[],u=0;d>u;u++)a[u]=e.getInt32(g+8*u,!i)/e.getInt32(g+4+8*u,!i);return a}}function h(e,t,n){var r,i="";for(r=t;t+n>r;r++)i+=String.fromCharCode(e.getUint8(r));return i}function g(e,t){if("Exif"!=h(e,t,4))return p&&console.log("Not valid EXIF data! "+h(e,t,4)),!1;var n,r,i,o,a,s=t+6;if(18761==e.getUint16(s))n=!1;else{if(19789!=e.getUint16(s))return p&&console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"),!1;n=!0}if(42!=e.getUint16(s+2,!n))return p&&console.log("Not valid TIFF data! (no 0x002A)"),!1;var u=e.getUint32(s+4,!n);if(8>u)return p&&console.log("Not valid TIFF data! (First offset less than 8)",e.getUint32(s+4,!n)),!1;if(r=f(e,s,s+u,v,n),r.ExifIFDPointer){o=f(e,s,s+r.ExifIFDPointer,w,n);for(i in o){switch(i){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":o[i]=b[i][o[i]];break;case"ExifVersion":case"FlashpixVersion":o[i]=String.fromCharCode(o[i][0],o[i][1],o[i][2],o[i][3]);break;case"ComponentsConfiguration":o[i]=b.Components[o[i][0]]+b.Components[o[i][1]]+b.Components[o[i][2]]+b.Components[o[i][3]]}r[i]=o[i]}}if(r.GPSInfoIFDPointer){a=f(e,s,s+r.GPSInfoIFDPointer,y,n);for(i in a){switch(i){case"GPSVersionID":a[i]=a[i][0]+"."+a[i][1]+"."+a[i][2]+"."+a[i][3]}r[i]=a[i]}}return r}var p=!1,m=function(e){return e instanceof m?e:this instanceof m?void(this.EXIFwrapped=e):new m(e)};"undefined"!=typeof e&&e.exports&&(t=e.exports=m),t.EXIF=m;var w=m.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},v=m.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},y=m.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},b=m.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}},S={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};m.getData=function(e,t){return(e instanceof Image||e instanceof HTMLImageElement)&&!e.complete?!1:(n(e)?t&&t.call(e):s(e,t),!0)},m.getTag=function(e,t){return n(e)?e.exifdata[t]:void 0},m.getAllTags=function(e){if(!n(e))return{};var t,r=e.exifdata,i={};for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);return i},m.pretty=function(e){if(!n(e))return"";var t,r=e.exifdata,i="";for(t in r)r.hasOwnProperty(t)&&(i+="object"==typeof r[t]?r[t]instanceof Number?t+" : "+r[t]+" ["+r[t].numerator+"/"+r[t].denominator+"]\r\n":t+" : ["+r[t].length+" values]\r\n":t+" : "+r[t]+"\r\n");return i},m.readFromBinaryFile=function(e){return u(e)},r=[],i=function(){return m}.apply(t,r),!(void 0!==i&&(e.exports=i))}).call(this)},function(e,t,n){var r,i;!function(){function n(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var r=document.createElement("canvas");r.width=r.height=1;var i=r.getContext("2d");return i.drawImage(e,-t+1,0),0===i.getImageData(0,0,1,1).data[3]}return!1}function o(e,t,n){var r=document.createElement("canvas");r.width=1,r.height=n;var i=r.getContext("2d");i.drawImage(e,0,0);for(var o=i.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}var l=u/n;return 0===l?1:l}function a(e,t,n){var r=document.createElement("canvas");return s(e,r,t,n),r.toDataURL("image/jpeg",t.quality||.8)}function s(e,t,r,i){var a=e.naturalWidth,s=e.naturalHeight,c=r.width,l=r.height,f=t.getContext("2d");f.save(),u(t,f,c,l,r.orientation);var d=n(e);d&&(a/=2,s/=2);var h=1024,g=document.createElement("canvas");g.width=g.height=h;for(var p=g.getContext("2d"),m=i?o(e,a,s):1,w=Math.ceil(h*c/a),v=Math.ceil(h*l/s/m),y=0,b=0;s>y;){for(var S=0,I=0;a>S;)p.clearRect(0,0,h,h),p.drawImage(e,-S,-y),f.drawImage(g,0,0,h,h,I,b,w,v),S+=h,I+=w;y+=h,b+=v}f.restore(),g=p=null}function u(e,t,n,r,i){switch(i){case 5:case 6:case 7:case 8:e.width=r,e.height=n;break;default:e.width=n,e.height=r}switch(i){case 2:t.translate(n,0),t.scale(-1,1);break;case 3:t.translate(n,r),t.rotate(Math.PI);break;case 4:t.translate(0,r),t.scale(1,-1);break;case 5:t.rotate(.5*Math.PI),t.scale(1,-1);break;case 6:t.rotate(.5*Math.PI),t.translate(0,-r);break;case 7:t.rotate(.5*Math.PI),t.translate(n,-r),t.scale(-1,1);break;case 8:t.rotate(-.5*Math.PI),t.translate(-n,0)}}function c(e){if(window.Blob&&e instanceof Blob){var t=new Image,n=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!n)throw Error("No createObjectURL function found to create blob url");t.src=n.createObjectURL(e),this.blob=e,e=t}if(!e.naturalWidth&&!e.naturalHeight){var r=this;e.onload=function(){var e=r.imageLoadListeners;if(e){r.imageLoadListeners=null;for(var t=0,n=e.length;n>t;t++)e[t]()}},this.imageLoadListeners=[]}this.srcImage=e}c.prototype.render=function(e,t,n){if(this.imageLoadListeners){var r=this;return void this.imageLoadListeners.push(function(){r.render(e,t,n)})}t=t||{};var i=this.srcImage,o=i.src,u=o.length,c=i.naturalWidth,l=i.naturalHeight,f=t.width,d=t.height,h=t.maxWidth,g=t.maxHeight,p=this.blob&&"image/jpeg"===this.blob.type||0===o.indexOf("data:image/jpeg")||o.indexOf(".jpg")===u-4||o.indexOf(".jpeg")===u-5;f&&!d?d=l*f/c<<0:d&&!f?f=c*d/l<<0:(f=c,d=l),h&&f>h&&(f=h,d=l*f/c<<0),g&&d>g&&(d=g,f=c*d/l<<0);var m={width:f,height:d};for(var w in t)m[w]=t[w];var v=e.tagName.toLowerCase();"img"===v?e.src=a(this.srcImage,m,p):"canvas"===v&&s(this.srcImage,e,m,p),"function"==typeof this.onrender&&this.onrender(e),n&&n()},r=[],i=function(){return c}.apply(t,r),!(void 0!==i&&(e.exports=i))}()},function(e,t){function n(e){function t(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;64>n;n++){var r=F((t[n]*e+50)/100);1>r?r=1:r>255&&(r=255),D[N[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;64>o;o++){var a=F((i[o]*e+50)/100);1>a?a=1:a>255&&(a=255),x[N[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],u=0,c=0;8>c;c++)for(var l=0;8>l;l++)U[u]=1/(D[N[u]]*s[c]*s[l]*8),C[u]=1/(x[N[u]]*s[c]*s[l]*8),u++}function n(e,t){for(var n=0,r=0,i=new Array,o=1;16>=o;o++){for(var a=1;a<=e[o];a++)i[t[r]]=[],i[t[r]][0]=n,i[t[r]][1]=o,r++,n++;n*=2}return i}function r(){y=n(W,H),b=n(V,X),S=n(z,q),I=n(Q,Y)}function i(){for(var e=1,t=2,n=1;15>=n;n++){for(var r=e;t>r;r++)A[32767+r]=n,T[32767+r]=[],T[32767+r][1]=n,T[32767+r][0]=r;for(var i=-(t-1);-e>=i;i++)A[32767+i]=n,T[32767+i]=[],T[32767+i][1]=n,T[32767+i][0]=t-1+i;e<<=1,t<<=1}}function o(){for(var e=0;256>e;e++)k[e]=19595*e,k[e+256>>0]=38470*e,k[e+512>>0]=7471*e+32768,k[e+768>>0]=-11059*e,k[e+1024>>0]=-21709*e,k[e+1280>>0]=32768*e+8421375,k[e+1536>>0]=-27439*e,k[e+1792>>0]=-5329*e}function a(e){for(var t=e[0],n=e[1]-1;n>=0;)t&1<O&&(255==G?(s(255),s(0)):s(G),O=7,G=0)}function s(e){M.push(j[e])}function u(e){s(e>>8&255),s(255&e)}function c(e,t){var n,r,i,o,a,s,u,c,l,f=0;const d=8,h=64;for(l=0;d>l;++l){n=e[f],r=e[f+1],i=e[f+2],o=e[f+3],a=e[f+4],s=e[f+5],u=e[f+6],c=e[f+7];var g=n+c,p=n-c,m=r+u,w=r-u,v=i+s,y=i-s,b=o+a,S=o-a,I=g+b,P=g-b,F=m+v,D=m-v;e[f]=I+F,e[f+4]=I-F;var x=.707106781*(D+P);e[f+2]=P+x,e[f+6]=P-x,I=S+y,F=y+w,D=w+p;var U=.382683433*(I-D),C=.5411961*I+U,T=1.306562965*D+U,A=.707106781*F,R=p+A,M=p-A;e[f+5]=M+C,e[f+3]=M-C,e[f+1]=R+T,e[f+7]=R-T,f+=8}for(f=0,l=0;d>l;++l){n=e[f],r=e[f+8],i=e[f+16],o=e[f+24],a=e[f+32],s=e[f+40],u=e[f+48],c=e[f+56];var G=n+c,O=n-c,_=r+u,B=r-u,E=i+s,j=i-s,k=o+a,N=o-a,W=G+k,H=G-k,z=_+E,q=_-E;e[f]=W+z,e[f+32]=W-z;var V=.707106781*(q+H);e[f+16]=H+V,e[f+48]=H-V,W=N+j,z=j+B,q=B+O;var X=.382683433*(W-q),Q=.5411961*W+X,Y=1.306562965*q+X,K=.707106781*z,J=O+K,Z=O-K;e[f+40]=Z+Q,e[f+24]=Z-Q,e[f+8]=J+Y,e[f+56]=J-Y,f++}var $;for(l=0;h>l;++l)$=e[l]*t[l],L[l]=$>0?$+.5|0:$-.5|0;return L}function l(){u(65504),u(16),s(74),s(70),s(73),s(70),s(0),s(1),s(1),s(0),u(1),u(1),s(0),s(0)}function f(e,t){u(65472),u(17),s(8),u(t),u(e),s(3),s(1),s(17),s(0),s(2),s(17),s(1),s(3),s(17),s(1)}function d(){u(65499),u(132),s(0);for(var e=0;64>e;e++)s(D[e]);s(1);for(var t=0;64>t;t++)s(x[t])}function h(){u(65476),u(418),s(0);for(var e=0;16>e;e++)s(W[e+1]);for(var t=0;11>=t;t++)s(H[t]);s(16);for(var n=0;16>n;n++)s(z[n+1]);for(var r=0;161>=r;r++)s(q[r]);s(1);for(var i=0;16>i;i++)s(V[i+1]);for(var o=0;11>=o;o++)s(X[o]);s(17);for(var a=0;16>a;a++)s(Q[a+1]);for(var c=0;161>=c;c++)s(Y[c])}function g(){u(65498),u(12),s(3),s(1),s(0),s(2),s(17),s(3),s(17),s(0),s(63),s(0)}function p(e,t,n,r,i){var o,s=i[0],u=i[240];const l=16,f=63,d=64;for(var h=c(e,t),g=0;d>g;++g)R[N[g]]=h[g];var p=R[0]-n;n=R[0],0==p?a(r[0]):(o=32767+p,a(r[A[o]]),a(T[o]));for(var m=63;m>0&&0==R[m];m--);if(0==m)return a(s),n;for(var w,v=1;m>=v;){for(var y=v;0==R[v]&&m>=v;++v);var b=v-y;if(b>=l){w=b>>4;for(var S=1;w>=S;++S)a(u);b=15&b}o=32767+R[v],a(i[(b<<4)+A[o]]),a(T[o]),v++}return m!=f&&a(s),n}function m(){for(var e=String.fromCharCode,t=0;256>t;t++)j[t]=e(t)}function w(e){if(0>=e&&(e=1),e>100&&(e=100),P!=e){var n=0;n=50>e?Math.floor(5e3/e):Math.floor(200-2*e),t(n),P=e}}function v(){var t=(new Date).getTime();e||(e=50),m(),r(),i(),o(),w(e);(new Date).getTime()-t}var y,b,S,I,P,F=(Math.round,Math.floor),D=new Array(64),x=new Array(64),U=new Array(64),C=new Array(64),T=new Array(65535),A=new Array(65535),L=new Array(64),R=new Array(64),M=[],G=0,O=7,_=new Array(64),B=new Array(64),E=new Array(64),j=new Array(256),k=new Array(2048),N=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],W=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],H=[0,1,2,3,4,5,6,7,8,9,10,11],z=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],q=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],V=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],X=[0,1,2,3,4,5,6,7,8,9,10,11],Q=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],Y=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];this.encode=function(e,t,n){var r=(new Date).getTime();t&&w(t),M=new Array,G=0,O=7,u(65496),l(),d(),f(e.width,e.height),h(),g();var i=0,o=0,s=0;G=0,O=7,this.encode.displayName="_encode_";for(var c,m,v,P,F,D,x,T,A,L=e.data,R=e.width,j=e.height,N=4*R,W=0;j>W;){for(c=0;N>c;){for(F=N*W+c,D=F,x=-1,T=0,A=0;64>A;A++)T=A>>3,x=4*(7&A),D=F+T*N+x,W+T>=j&&(D-=N*(W+1+T-j)),c+x>=N&&(D-=c+x-N+4),m=L[D++],v=L[D++],P=L[D++],_[A]=(k[m]+k[v+256>>0]+k[P+512>>0]>>16)-128,B[A]=(k[m+768>>0]+k[v+1024>>0]+k[P+1280>>0]>>16)-128,E[A]=(k[m+1280>>0]+k[v+1536>>0]+k[P+1792>>0]>>16)-128;i=p(_,U,i,y,S),o=p(B,C,o,b,I),s=p(E,C,s,b,I),c+=32}W+=8}if(O>=0){var H=[];H[1]=O+1,H[0]=(1<V;V++)q[V]=M[V].charCodeAt();M=[];(new Date).getTime()-r;return q}var X="data:image/jpeg;base64,"+btoa(M.join(""));M=[];(new Date).getTime()-r;return X},v()}e.exports=n},function(e,t,n){function r(e,t){var n=this;if(!e)throw new Error("没有收到图片,可能的解决方案:https://github.com/think2011/localResizeIMG/issues/7");t=t||{},n.defaults={width:null,height:null,fieldName:"file",quality:.7},n.file=e;for(var r in t)t.hasOwnProperty(r)&&(n.defaults[r]=t[r]);return this.init()}function i(e){var t=null;return t=e?[].filter.call(document.scripts,function(t){return-1!==t.src.indexOf(e)})[0]:document.scripts[document.scripts.length-1],t?t.src.substr(0,t.src.lastIndexOf("/")):null}function o(e){var t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);for(var n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length),i=0;ie.file.size?(i=new FormData,t=e.file):(i=new s.FormData,t=o(r)),i.append(e.defaults.fieldName,t,e.fileName.replace(/\..+/g,".jpg")),n({formData:i,fileLen:+t.size,base64:r,base64Len:r.length,origin:e.file,file:t});for(var a in e)e.hasOwnProperty(a)&&(e[a]=null);URL.revokeObjectURL(e.blob)})},!r&&(i.crossOrigin="*"),i.src=c})},r.prototype._getBase64=function(){var e=this,t=e.img,n=e.file,r=e.canvas;return new a(function(i){try{u.getData("object"==typeof n?n:t,function(){e.orientation=u.getTag(this,"Orientation"),e.resize=e._getResize(),e.ctx=r.getContext("2d"),r.width=e.resize.width,r.height=e.resize.height,e.ctx.fillStyle="#fff",e.ctx.fillRect(0,0,r.width,r.height),c.oldIOS?e._createBase64ForOldIOS().then(i):e._createBase64().then(i)})}catch(o){throw new Error(o)}})},r.prototype._createBase64ForOldIOS=function(){var e=this,t=e.img,r=e.canvas,i=e.defaults,o=e.orientation;return new a(function(e){!function(){var a=[n(6)];(function(n){var a=new n(t);"5678".indexOf(o)>-1?a.render(r,{width:r.height,height:r.width,orientation:o}):a.render(r,{width:r.width,height:r.height,orientation:o}),e(r.toDataURL("image/jpeg",i.quality))}).apply(null,a)}()})},r.prototype._createBase64=function(){var e=this,t=e.resize,r=e.img,i=e.canvas,o=e.ctx,s=e.defaults,u=e.orientation;switch(u){case 3:o.rotate(180*Math.PI/180),o.drawImage(r,-t.width,-t.height,t.width,t.height);break;case 6:o.rotate(90*Math.PI/180),o.drawImage(r,0,-t.width,t.height,t.width);break;case 8:o.rotate(270*Math.PI/180),o.drawImage(r,-t.height,0,t.height,t.width);break;case 2:o.translate(t.width,0),o.scale(-1,1),o.drawImage(r,0,0,t.width,t.height);break;case 4:o.translate(t.width,0),o.scale(-1,1),o.rotate(180*Math.PI/180),o.drawImage(r,-t.width,-t.height,t.width,t.height);break;case 5:o.translate(t.width,0),o.scale(-1,1),o.rotate(90*Math.PI/180),o.drawImage(r,0,-t.width,t.height,t.width);break;case 7:o.translate(t.width,0),o.scale(-1,1),o.rotate(270*Math.PI/180),o.drawImage(r,-t.height,0,t.height,t.width);break;default:o.drawImage(r,0,0,t.width,t.height)}return new a(function(e){c.oldAndroid||c.mQQBrowser||!navigator.userAgent?!function(){var t=[n(7)];(function(t){var n=new t,r=o.getImageData(0,0,i.width,i.height);e(n.encode(r,100*s.quality))}).apply(null,t)}():e(i.toDataURL("image/jpeg",s.quality))})},r.prototype._getResize=function(){var e=this,t=e.img,n=e.defaults,r=n.width,i=n.height,o=e.orientation,a={width:t.width,height:t.height};if("5678".indexOf(o)>-1&&(a.width=t.height,a.height=t.width),a.width=r/i?a.width>r&&(a.width=r,a.height=Math.ceil(r/s)):a.height>i&&(a.height=i,a.width=Math.ceil(i*s)):r?r=3264||a.height>=2448;)a.width*=.8,a.height*=.8;return a},window.lrz=function(e,t){return new r(e,t)},window.lrz.version="4.9.40", +e.exports=window.lrz}])}); \ No newline at end of file diff --git a/static/avatar/ui-bg_flat_0_aaaaaa_40x100.png b/static/avatar/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000..e26ee47 Binary files /dev/null and b/static/avatar/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/static/avatar/ui-bg_flat_75_ffffff_40x100.png b/static/avatar/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000..e6d4c32 Binary files /dev/null and b/static/avatar/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/static/avatar/ui-bg_glass_55_fbf9ee_1x400.png b/static/avatar/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000..564344c Binary files /dev/null and b/static/avatar/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/static/avatar/ui-bg_glass_65_ffffff_1x400.png b/static/avatar/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..806b7b9 Binary files /dev/null and b/static/avatar/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/static/avatar/ui-bg_glass_75_dadada_1x400.png b/static/avatar/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000..d9247b5 Binary files /dev/null and b/static/avatar/ui-bg_glass_75_dadada_1x400.png differ diff --git a/static/avatar/ui-bg_glass_75_e6e6e6_1x400.png b/static/avatar/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000..0c61899 Binary files /dev/null and b/static/avatar/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/static/avatar/ui-bg_glass_95_fef1ec_1x400.png b/static/avatar/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 0000000..9aa5c32 Binary files /dev/null and b/static/avatar/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/static/avatar/ui-bg_highlight-soft_75_cccccc_1x100.png b/static/avatar/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000..bf6e3db Binary files /dev/null and b/static/avatar/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/static/avatar/ui-icons_222222_256x240.png b/static/avatar/ui-icons_222222_256x240.png new file mode 100644 index 0000000..2370c12 Binary files /dev/null and b/static/avatar/ui-icons_222222_256x240.png differ diff --git a/static/avatar/ui-icons_2e83ff_256x240.png b/static/avatar/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000..0597f19 Binary files /dev/null and b/static/avatar/ui-icons_2e83ff_256x240.png differ diff --git a/static/avatar/ui-icons_454545_256x240.png b/static/avatar/ui-icons_454545_256x240.png new file mode 100644 index 0000000..f45f4cf Binary files /dev/null and b/static/avatar/ui-icons_454545_256x240.png differ diff --git a/static/avatar/ui-icons_888888_256x240.png b/static/avatar/ui-icons_888888_256x240.png new file mode 100644 index 0000000..5b74d64 Binary files /dev/null and b/static/avatar/ui-icons_888888_256x240.png differ diff --git a/static/avatar/ui-icons_cd0a0a_256x240.png b/static/avatar/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..21121f4 Binary files /dev/null and b/static/avatar/ui-icons_cd0a0a_256x240.png differ diff --git a/static/image/admincp/add.gif b/static/image/admincp/add.gif new file mode 100644 index 0000000..a4de46a Binary files /dev/null and b/static/image/admincp/add.gif differ diff --git a/static/image/admincp/admincp.css b/static/image/admincp/admincp.css new file mode 100644 index 0000000..cce155e --- /dev/null +++ b/static/image/admincp/admincp.css @@ -0,0 +1,562 @@ +/*(C) 2001-2099 Comsenz Inc.*/ + +*{ word-wrap:break-word; outline:none; } +body{ background:#FFF; text-align:center; } +body, td, input, textarea, select, button{ color:#555; font:12px "Lucida Grande", Verdana, Lucida, Helvetica, Arial, 'Simsun', sans-serif; } +body, ul, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin:0; padding:0; } +ul{ list-style:none; } +h1, h2, h3, h4, h5, h6{ font-size:12px; } +a{ color:#2366A8; text-decoration:none; } + a:hover { text-decoration:underline; } + a img{ border:none; } +em, cite, th{ font-style:normal; font-weight:normal; } +table{ border-collapse:collapse; } +th{ text-align:left; } +label, .pointer { cursor:pointer; } +.highlight { color: #C00; font-weight: 700; } + +/* form */ +textarea, input, select, .html { padding:2px; border:1px solid; border-color:#666 #ccc #ccc #666; background:#F9F9F9; color:#333; resize: none; } +.txt, select, .vmiddle { vertical-align:middle; } +.txt:hover, .txt:focus, textarea:hover, textarea:focus{ border-color:#09C; background:#F5F9FD; } +.hover:hover { background:#F5F9FD; } + .hover:hover .addchildboard, .hover:hover .deleterow { color: #F5F9FD; } +.txtnobd{ border:1px solid #FFF; background:#FFF; cursor:pointer; } +.radio, .checkbox, .pr, .pc { border:none; background:none; vertical-align:middle; } +.checkbox{ height:14px; } +.btn{ margin:3px 0; padding:2px 5px; *padding:4px 5px 1px; border: 1px solid; border-color:#ddd #666 #666 #ddd; background:#DDD; color:#000; cursor:pointer; vertical-align:middle; } + .btn:hover { text-decoration: none; } +.btn_big { display: inline-block; width: 90px; height: 30px; line-height: 30px; text-align: center; background: url(btn_big.png) no-repeat 0 0; font-size: 14px; font-weight: 700; color: #FFF; } + .btn_big:hover { text-decoration: none; } +.uploadbtn{ width:250px; border-color:#999; } +.line { border-bottom: 1px solid #0F0; } +.num{ width:20px !important; height: 16px; vertical-align:middle; } +/* simulate input type="file" */ +.filebtn { position: relative; margin-right: 30px; width: 60px; overflow: hidden; zoom: 1; } + .filebtn .pf { position: absolute; right: 0; height: 23px; opacity: 0; filter:alpha(opacity=0); cursor: pointer; } + + +/* .html */ +.html { width: 180px !important; height: 16px; float: left; cursor: text; white-space: nowrap; overflow-x: hidden; } +.htmlbtn { background: url("../editor/editor.gif") no-repeat scroll 0 0 transparent;border-color: #CCCCCC;width: 21px;height: 21px;margin-right: 2px;float: left;cursor: pointer;padding: 0px; } +.htmlbtn.current { border-color: #369; } +.htmlbtn.b {background-position:0 0;} +.htmlbtn.i { background-position:-20px 0; } +.htmlbtn.u { background-position:-40px 0; } +.htmlbtn.c { background-position:-60px 0; } + +/* title */ +h3{ margin-bottom:10px; font-size:14px; color:#09C; } +.spectitle{ border-bottom:1px dashed #F66; } + +/* mainbox */ +.mainhd{ position:relative; overflow:hidden; text-align:left; height:90px; line-height:88px; background:url(bg_repx.gif) repeat-x; } + .logo{ display: block; text-indent:-9999px; width:135px; height:80px; background:url(logo.gif) no-repeat 15px 13px; } + .logo:hover{ background-image:url(logo_hover.gif); } + .uinfo{ position:absolute; z-index:4; line-height:32px; top:10px; right:15px; } + .uinfo a{ color:#666; } + .uinfo em{ margin-right:5px; font-weight:700; } + .uinfo em a{ text-decoration:underline; } + .uinfo p{ float:left; } + .btnlink a{ display:block; margin-left:10px; width:63px; height:32px; text-align:center; background:url(bg_repno.gif) no-repeat -50px -150px; } + .navbg{ position:absolute; z-index:1; top:52px; left:153px; width:6px; height:37px; background:#F7FAFD; } + .nav{ position:absolute; z-index:2; top:14px; left:159px; width:100%; height:75px; } + .nav ul{ overflow:hidden; position:relative; z-index:4; font-size:14px; } + .nav li{ float:left; height:43px; line-height:43px; background:url(btn_block.gif) right -115px no-repeat; } + .nav li em{ display:block; } + .nav li a{ padding:5px 5px; color:#639BB0; font-weight:700; } + .nav li a:hover{ color:#09C; text-decoration:none; } + .nav li .diffcolor{ color:#F60; } + .nav li.navon{ line-height:33px; background:url(btn_block.gif) no-repeat; } + .nav li.navon em{ display:block; background:url(btn_block.gif) right -50px no-repeat; } + .nav li.navon em a{ display:block; background:url(btn_block.gif) center bottom no-repeat; color:#FFF; } + .nav li.navon em a:hover{ color:#FFF; } + .nav ul #header_uc { font-size:12px; } + .navbd { overflow:hidden; clear:both; position:absolute; z-index:3; top:38px; width:100%; height:5px; background:#09C; } + .currentloca{ clear:both; height:32px; border-left:1px solid #B5CFD9; } + .currentloca p{ padding-left:10px; line-height:25px; border-top:5px solid #FFF; border-bottom:2px solid #FFF; border-left:1px solid #FFF; background:#F2F9FD; } + .sitemapbtn{ position:absolute; right:175px; *right:170px; top:50px; line-height:100%; } + .sitemapbtn span{ margin-right:3px; } + +a.faq { background: url(faq.gif) no-repeat 0 2px; padding:1px; margin-left:10px; } + a.faq:hover{ text-decoration:none; } + +.popupmenu_popup { width:400px; overflow:hidden; padding:10px; border:1px solid #A6C9D7; background:#FFF; font-size:12px; font-weight:400; text-align:left; } + li.popupmenu_popup { list-style: none; } + #fselect_menu { width:300px; } + .fsel { _height: 350px; max-height: 350px; overflow-y: auto; } + #fselect_menu a { width: 70%; } + #ugselect_menu { width:450px; } + .popupmenu_popup em { display:block; clear: both; padding: 2px 4px; font-weight:700; background:#EAF4FB; } + .popupmenu_popup em.hover { cursor:pointer; } + .popupmenu_popup a { float: left; margin: 1px 9px 1px 0; padding-left:3px; width: 100px; } + .popupmenu_popup .ck { width: 25px; margin-top: 4px; } + .popupmenu_popup .current { font-weight:700; } + .popupmenu_popup a.f, .popupmenu_popup a.s { float: none; display: block; width:80%; } + .popupmenu_popup a.s { margin-left:40px; } + .popupmenu_dropmenu { cursor: pointer; } + .popupmenu_dropmenu em { margin-left:3px; background:url(bg_repno.gif) no-repeat 0 -145px; } + +.menutd{ background:#F2F9FD url(bg_repx_h.gif) right top no-repeat; } +.menu{ position:relative; z-index:20; width:160px; } + .menu ul{ position:absolute; top:10px; right:7px; list-style:none; width:153px; background:#F2F9FD url(bg_repx_h.gif) no-repeat 5px -20px; } + .menu li { margin: 3px 0; *margin: 0; width: 153px; height: auto !important; height: 25px; overflow: hidden; } + .menu li.s { height: auto; } + .menu li.a { margin-top:0; } + .menu li a { display: block; padding: 4px 0 3px 30px; *padding: 5px 0 3px 30px; background: url(bg_repno.gif) no-repeat 15px -43px; color: #666; white-space: nowrap; } + .menu li a:hover{ text-decoration:none; background:#EAF4FB url(bg_repno.gif) no-repeat 15px -43px; color:#2366A8; } + .menu li a.tabon,.menu li a.tabon:hover{ text-decoration:none; background:#DEEFFA url(bg_repno.gif) no-repeat 15px -43px; color:#2366A8; } + .menu li em { position: absolute; cursor: pointer; margin: -1px 0 0 -20px; *margin-top: -2px; width: 16px; height: 16px; visibility: hidden; background: #EAF4FB url(newwin.gif) no-repeat; } + .menu li a:hover em, .menu li a.tabon:hover em { visibility: visible; } + .menu li a.tabon:hover em { background-color: #DEEFFA; } + .menu .lsub { cursor: pointer; background: url(add.gif) no-repeat 12px 5px; } + .menu .lsub div { padding: 4px 0 3px 30px; font-weight: 700; } + .menu .desc { background: url(desc.gif) no-repeat 12px 5px; } + .menu .lsub ol { list-style: none; padding: 0 0 0 30px; margin: 2px 0 0 -30px; } + .menu .sp { width: 160px; height: 1px; line-height: 1px; float: left; border-bottom: 1px dotted #DEEFFA ; } +#menu_mof_menu { font-size: 14px; font-weight: 700; background: #F2F9FD } + #menu_mof_menu a { color: #639BB0 !important; display:block; } + #menu_mof_menu a:hover{ color:#09C !important; text-decoration:none; } + +.mask{ padding-top:9px; background:url(bg_repx_hb.gif) repeat-x; } +.team a { float: left; width: 33%; } + +/* tab */ +.tab1{ overflow:hidden; clear:both; margin-bottom:10px; } + .tab1 li{ float:left; margin-right:3px; text-align:center; font-weight:700; } + .tab1 a { display:block; line-height:26px; color:#666; white-space: nowrap; } + .tab1 a span { display:block; padding:0 7px; } + .tab1 a:hover { text-decoration:none; background:url(btn_block_2.gif) no-repeat 0 -52px; color:#09C; } + .tab1 a:hover span { display:block; background:url(btn_block_2.gif) no-repeat right -78px; } + .tab1 .current{} + .tab1 .current a{ background:url(btn_block_2.gif) no-repeat 0 0; color:#FFF; } + .tab1 .current a span{ background:url(btn_block_2.gif) no-repeat right -26px; } + .tab1 .current a .highlight { color: #FF9; } + .tab1 .current a em{ margin-left:3px; * margin-right:-5px; background:url(bg_repno.gif) no-repeat 0 -145px !important; background:url(bg_repno.gif) no-repeat 0 -147px; color:#666; } + .tab1 .hasdropmenu a em{ margin-left:3px; * margin-right:-5px; background:url(bg_repno.gif) no-repeat 0 -195px !important; background:url(bg_repno.gif) no-repeat 0 -197px; color:#FFF; } + .dropmenu, .dropmenu1 { margin-left: -20px; white-space:nowrap; border:3px solid #A6C9D7; background:#F2F9FD; text-align:left; opacity:0.9; filter:Alpha(opacity=90); } + .dropmenu1 { margin-left: 0; padding: 5px; } + .tab1 .dropmenu a{ padding:2px 7px; background:none !important; color:#666 !important; font-weight:400; } + .tab1 .dropmenu a:hover{ background:#DEEFFA !important; } + .tab1 .dropmenu li { clear: both; margin:0; } + .tab1 .dropmenu li.current a { background:#DEEFFA !important; } + +/* box */ +#scrolllink{ position: absolute; z-index: 21; bottom: 60px; *bottom: 39px; left: 0; padding: 2px 0; width: 154px; background-color: #F2F9FD; } + #scrolllink span { cursor: pointer; } + #scrolllink img { margin-left: 2px; } +.copyright{ position:absolute; z-index:10; left:5px; bottom:3px; padding-top:3px; border-top:1px dashed #DDD; text-align:left; line-height:150%; font-family:Tahoma; font-size:11px; -webkit-text-size-adjust: none; } +.logintb{ text-align:left; margin:120px auto 0; width:600px; } +.login{ padding-right:30px; width:310px; height:150px; background:url(bg_login.gif) right 50% no-repeat; } + .login h1{ text-indent:-9999px; margin-bottom:10px; width:262px; height:26px; background:url(login_title.gif) no-repeat; } + .login p{ line-height:150%; } +.logintitle, .loginform { margin:2px 0; height:22px; line-height:22px; font-size:14px; } +.logintitle{ float:left; clear:left; width:60px; font-weight:700; color:#666; } +.loginform{ float:left; width:160px; } + .loginform .txt{ margin-top:1px; width:150px; } + .loginform select { margin-top:1px; padding:1px; width:156px; } +.loginnofloat{ clear:both; } + .loginnofloat .btn{ margin-left:60px; } +.logintips{ line-height:160%; margin-left:25px; } + .logintips a{ margin:0 5px; text-decoration:underline; } +.footer{} + .footer .copyright{ position:static; margin-top:120px; border:none; text-align:center; font-size:12px; } + .footer p{ display:inline; } + +.container{ padding:9px 20px 20px; text-align:left; } +.itemtitle{ clear:both; overflow:hidden; margin-bottom:0 !important; *margin-bottom:5px !important; margin-bottom:-5px; line-height:20px; } + .itemtitle h3{ float:left; margin-right:20px; } + .itemtitle ul{ float:left; line-height:18px; } + .itemtitle .tab1{ clear:none; } + .itemtitle .tab1 a{ line-height:20px; } + .itemtitle .tab1 a span{ padding:0 7px; *padding:1px 7px 0; *line-height:19px; } + .itemtitle .tab1 a:hover{ background:#F5F5F5 url(btn_block_3.gif) no-repeat 0 -40px; color:#09C; } + .itemtitle .tab1 a:hover span{ background:url(btn_block_3.gif) no-repeat right -60px; } + .itemtitle .tab1 .hasdropmenu a:hover{ color:#666; } + .itemtitle .tab1 .current a{ background:url(btn_block_3.gif) no-repeat 0 0 !important; } + .itemtitle .tab1 .current a span, .itemtitle .tab1 .current a:hover span{ background:url(btn_block_3.gif) no-repeat right -20px; color:#FFF; } + .itemtitle .tab1 .dropmenu a{ background:none !important; } + .itemtitle .tab1 .dropmenu a:hover, .itemtitle .tab1 .dropmenu a.current{ background:#DEEFFA !important; } +.floattop { position:fixed; z-index:200; top:0; left:0; margin-left: 20px; padding:8px 20px 8px 0; width:99%; background:#FFF; } + .floattop #fselect, .floattop #ugselect { margin-right: 20px; } + * html .floattop { position:relative; top:expression(offsetParent ? offsetParent.scrollTop : 0); left: -20px; margin-top: -10px; width: 100%; } + .floattopempty { height: 35px !important; height: auto; } + .floattop .dropmenu { position: fixed !important; position: absolute; margin-left: 0 !important; margin-left: -20px; } /* for opera position fixed bug */ +.stepstat{ *margin-bottom:10px; } + .stepstat li{ float:left; margin-right:15px; color:#CCC; } + .stepstat .current{ color:#090; } +.infobox{ clear:both; margin-bottom:10px; padding:30px; text-align:center; border-top:4px solid #DEEFFA; border-bottom:4px solid #DEEEFA; background:#F2F9FD; zoom:1; } + .infotitle1{ margin-bottom:10px; color:#09C; font-size:14px; font-weight:700; } + .infotitle2{ margin-bottom:10px; color:#090; font-size:14px; font-weight:700; } + .infotitle3{ margin-bottom:10px; color:#C00; font-size:14px; font-weight:700; } + .cachelist{ overflow:hidden;} + .cachelist li{ float:left; margin-right:10px; } +.colorbox{ clear: both; padding:10px; border-top:4px solid #DEEFFA; border-bottom:4px solid #DEEFFA; background:#F2F9FD; zoom:1; } + .extcredits, .threadprofilenode { margin:-5px 0 10px; } + .extcredits a, .threadprofilenode a { margin-right:5px; padding:2px 5px; line-height:220%; border:1px solid #B6CFD9; background:#FFF; white-space:nowrap; } + .threadprofilenode { width: 650px; } + .jswizard{ margin:10px 0; } + .jswizard iframe { border: 1px dashed #DEEFFA; } +.fileperms{ list-style:disc; margin:15px; } + .fileperms li{ line-height:180%; } +.tips{ margin-left:15px; color:#999; } +.tips2{ line-height:180%; color:#999; word-break:break-all; } +.tb2 .tipsblock{ background:none; margin-bottom:-10px; } + .tipsblock ul{ margin-bottom:-11px; } + .tipsblock li{ margin-bottom:5px; padding:0 0 5px 20px; line-height:160%; background:url(bg_repno.gif) no-repeat -340px 6px; } +.tips a, .tips2 a, .tipsblock a{ margin:0 3px; text-decoration:underline; color:#666; } + .tips a:hover, .tips2 a:hover, .tipsblock a:hover{ color:#09C; } +/* admincp_optimizer.php */ +.optblock { margin: 20px 0; height: 30px; line-height: 30px; } + .optblock #checking { float: left; } + .optblock #checkstatus { float: left; margin: 0 10px; } + .optblock .pbg { float: left; margin: 6px 10px 0; } + .optblock .pbg .xs0 { line-height: 1.5; } + +/* table */ +.tb{ clear:both; width:100%; margin-top: 8px} + .tb th, .tb td{ padding:5px !important; height:25px; } +.tb1{} + .th11, .th12{ width:60px; font-weight:700; } + .tb1 .th12{ padding-top:7px; vertical-align:top; } + .tb1 .tb2 th{ padding-top:0; } + .tb1 .txt{ width:150px; } + .tb1 strong{ margin-right:5px; color:#F60; } + .first td{ padding-top:13px; } + .first .th12{ padding-top:15px; } + .bdtop td{ border-top:1px dashed #CAE4F7; } + .bdbot td{ border-bottom:1px dashed #CAE4F7; } + .td11{ width:350px; vertical-align:top; } + .td11 li{ float:left; margin:0 10px 7px 0; *margin:-3px 10px 7px 0; } + .td11 .clear{ margin:0; } + .listtitle, .listtitlelong{ padding-top:3px; *padding-top:6px; width:80px; color:#09C; } + .listtitlelong{ width:100px; } + .td11 .txt{ width:70px; } + .td11 .sginput .txt{ width:150px; } + .td12{} + .td12 li{ float:left; margin-right:10px; } + .td12 .radio{ float:left; margin-top:4px; *float:none; *margin-top:0; } + .td12 label{ float:left; margin-top:2px; *float:none; *margin-top:0; } + .td12 .txt{ width:50px; } + .checkboxlist{ width:720px; } + .checkboxlist li{ float:left; width:90px; line-height:180%; white-space:nowrap; cursor:pointer; } + .longtxt .txt{ width:400px !important;} + .tarea{ width:400px; height:75px; } + .sml, .sml th, .sml td { font-size: 9px !important; -webkit-text-size-adjust: none; } + +/* tb */ +.tb2{} + .tb2 tr.hover:hover .tips2{ color:#333; } + .tb2 tr.hover:hover td { background: #F2F9FD; } + .tb2 tr.hl { background: #FFFAF3; } + .tb2 tr.hl td { border-top:1px #F4E4B4 solid; border-bottom:1px #F4E4B4 solid } + .tb2.tdhover tr:hover td { background: none; } + .tb2.tdhover tr td:hover { background: #F2F9FD; } + .tb2 td{ padding:5px 5px 3px 0; border-top: 1px dotted #DEEFFB; } + .tb2 th{ padding:5px 5px 3px 0; line-height:21px; font-size: 12px; } + .tb2 .txt, .tb2 .txtnobd{ width:100px; margin-right:10px; } + .tb2 .smtxt { margin-right: 5px; width: 25px; } + .nowrap { white-space: nowrap; } + .td21{ width:150px; font-weight:700; } + .td22{ width:100px; font-weight:700; } + .td23{ width:100px; } + .td24{ width:120px; } + .td25{ width:50px; } + .td25 .txt{ width:40px; } + .td26{} + .td26 .txt, .td26 .txtnobd{ width:90%; *width:280px; } + .tb2 .td27{ padding:3px 0 3px 5px; font-weight:700; } + .tb2 .td27:hover { background: none; } + .td27m { font-weight:700; padding-bottom:5px; } + .td28 .txt{ width:40px; } + .td29 .txt{ width:200px; } + .td30 { width:30px; } + .td31 { width:200px; } + .td32 { width:85px; } + .td32 .txt{ width:50px; } + .tbm { padding:5px !important; background: #F2F9FD !important; font-weight: 700; border-top:0 !important; } + .multicol { float:left; width: 270px !important; } + .staton{ text-indent:-9999px; width:20px; height:17px; background:url(bg_repno.gif) no-repeat -280px -250px; } + .statoff{ text-indent:-9999px; background:url(bg_repno.gif) no-repeat -250px -347px; } + .rowform{ width:306px; overflow:auto; } + .tb2 .rowform{ padding-left:5px; } + .rowform .txt, .rowform textarea{ margin-right:10px; width:250px; } + .rowform select{ margin-right:10px; width:256px; } + .rowform .radio{ margin-top:-2px !important; *margin-top:0 !important; *margin-top:-2px; } + .rowform li{ overflow:hidden; float:left; margin-right:10px; white-space:nowrap; cursor:pointer; } + .rowform .clear{ clear:both; float:none; margin-bottom:10px; } + .rowform .nofloat{ clear:both; } + .rowform .nofloat li{ float:none; margin:5px 0; overflow:visible; } + .ckbox {width:700px; } + .ckbox li { float: left; margin: 5px 10px 5px 0; white-space: nowrap; width: 130px; height: 20px; } + .partition, .partition2{ line-height:21px; font-weight:700; color:#09C; } + .tb2 .partition{ padding:5px; background:url(bg_repx_hc.gif) repeat-x 0 -40px; } + .dblist{} + .dblist li{ float:left; margin-bottom:5px; width:33%; height:20px; white-space:nowrap; cursor:pointer; } + + .cfolder, .ofolder{ display:block; padding-left:50px; line-height:30px; background:url(bg_repno.gif) no-repeat -260px -50px; font-weight:700; } + .ofolder{ background:url(bg_repno.gif) no-repeat -260px -100px; } + .filenum{ margin:8px 0 0 20px; } + .files{ padding:1px 0 1px 50px; background:url(bg_repno.gif) no-repeat -260px -150px; } + .del{ padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat 0 -285px; *background:url(bg_repno.gif) no-repeat 0 -286px; color:#E8594D; } + .edited, .unfixed { padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat -100px -385px; *background:url(bg_repno.gif) no-repeat -100px -386px; color:#E8594D; } + .unknown{ padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat -50px -435px; *background:url(bg_repno.gif) no-repeat -50px -436px; color:#6189B8; } + .correct, .fixed { padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat 0 -485px; *background:url(bg_repno.gif) no-repeat 0 -486px; color:#70B759; } + + /* crons */ + .crons{ width:200px; } + .crons .txt{ margin-bottom:3px; width:150px; } + + /* faqlist & boardlist */ + .node, .board{ padding-left:55px; background:url(bg_repno.gif) no-repeat -240px -550px; } + .node .txt, .lastnode .txt, .newnode .txt{ width:250px; } + .parentnode .txt{ width:250px; font-weight:700; } + .parentboard .txt{ font-weight:700; } + .lastnode, .lastboard{ padding-left:55px; background:url(bg_repno.gif) no-repeat -240px -600px; } + .childboard{ padding-left:110px; background:url(bg_repno.gif) no-repeat -185px -550px; } + .lastchildboard{ padding-left:110px; background:url(bg_repno.gif) no-repeat -185px -600px; } + .boardattr{ position:absolute; left:402px; margin-top:-20px !important; margin-top:-19px; color:#999; } + + /* pick window */ + .colorwd{ float:left; width:40px; height:21px; border-color:#ccc #666 #666 #ccc; } + .cmen { overflow: hidden; width: 63px; } + .cmen a { overflow: hidden; float:left; width: 20px; height: 20px; } + +.tb3{ margin-top:-15px; border:none; } + .tb3 th{ padding:10px 0 5px; } + .tb3 td{ padding:0; line-height:180%; } + +.mod_validate td, .mod_export td { background: #CFC !important; } +.mod_invalidate td, .mod_refusal td { background: #FFEBE7 !important; } +.mod_ignore td { background: #EEE !important; } +.mod_cancel td { background: #FFF !important; } +.mod_delete td { background: #F99 !important; } + +/* custom menu */ +.custom{ overflow:hidden; position:relative; border:6px solid #A6C9D7; background:#FFF; } + .cmain{ padding:0; text-align: left; padding: 10px; } + .cnote{ line-height:20px; } + .cnote li{ float:left; margin-right:15px; } + .cmlist{ clear:left; overflow-y:auto; } + .cmlist a{ display: block; float: left; overflow: hidden; width: 150px; height: 20px; color:#666; } + .cmlist td { padding: 5px 0; border-bottom: 1px dotted #DEEFFB; } + .cmlist tr:last-child td { border-bottom: none; } + .cmlist h4{ color:#09C; width: 90px; } + .cside{ float:right; display:inline; margin-right:5px; width:151px; text-align:left; } + .cside h3{ position:relative; margin-bottom:0; padding:6px 0 0 5px; height:28px; line-height:28px; border-bottom:1px solid #A6C9D7; background:url(bg_custom_t.gif) repeat-x; } + .ctitle1{ display:block; padding-left:25px; height:28px; background:url(btn_add2menu.gif) no-repeat 0 5px; color:#090; font-size:12px; } + .ctitle1:hover{ text-decoration:none; } + .cadmin{ position:absolute; top:-4px; right:-5px; padding:10px 10px 0; color:#666; font-size:12px; font-weight:400; } + .cslist li{ height:1%; } + .cslist li a{ display:block; padding:5px 5px 5px 30px; } + .cslist li a:hover{ text-decoration:none; background:#DEEFFA; } + .cslist li .pages{ margin-left:27px; } + .cslist li .pages a{ display:inline; padding:2px 5px; } + .cslist li .pages a:hover{ background:#09C; } + .cfixbd{ position:absolute; right:5px; bottom:0; width:151px; height:5px; line-height:5px; font-size:1px; background:#FFF; overflow:hidden; } +/* list */ +.tpllist{ list-style:disc; margin:10px 15px; line-height:180%; } +.tpllist2{ list-style:circle; margin:5px 25px; } +.tpllist3{ list-style:square; margin:0 25px; } +.userlist{ overflow:hidden; margin:10px 0; } + .userlist li{ float:left; margin:0 10px 10px 0; white-space:nowrap; } + .unum{ clear:both; display:block; width:100%; font-weight:700; } +.safelist{ padding:10px 0; border-top:4px solid #DEEFFA; } + .safelist li{ margin-bottom:5px; padding-left:20px; line-height:160%; background:url(bg_repno.gif) no-repeat -340px 6px; } + .safelist p{ margin-bottom:5px; } + .safelist .txt{ width:150px; } +.infolist{} + .infolist li{ clear:both; line-height:180%; } + .infolist em{ float:left; width:120px; } +.tb2 .threadopt{ border-bottom:1px solid #B5CFD9; background:none; vertical-align:top; } +.threadtitle{ padding:10px !important; } +.nowrap li{ float:left; white-space:nowrap; margin-right:5px; } + +/* pages */ +.pg{ clear:both; margin:10px 0; } + .pg em, .pg a, .pg strong{ text-decoration:none; margin-left:3px; padding:2px 5px; border:1px solid #E5E5E5; } + .pg a:hover{ text-decoration:none; border:1px solid #09C; background:#09C; color:#FFF; } + .pg strong{ border:none; font-weight:700; } + .pg kbd input{ margin-left:5px; width:20px; vertical-align:middle; } +.cuspages{ margin:3px 0; line-height:200%; } + .cuspages .pg{ display:inline; clear:none; margin-right:10px; } +.fixsel select{ margin:3px 5px 3px 0; } + +/* link */ +.addtr{ padding-left:17px; line-height:25px; background:url(bg_repno.gif) no-repeat 0 1px; *background:url(bg_repno.gif) no-repeat 0 0; color:#F60; } +.act{ margin:0 5px; text-decoration:underline; } +.addchildboard, .deleterow { margin-right: 5px; padding-left:17px; line-height:25px; *line-height: 16px; background:url(bg_repno.gif) no-repeat 0 -599px; color:#FFF; zoom: 1; } + .deleterow { padding-left: 12px; background: url(close.gif) no-repeat 0 50%; } + .addchildboard:hover, .deleterow:hover { text-decoration:none; color:#F60 !important; } +.switch{ color:#09C; } + .switch:hover{ text-decoration:none; } + .switch img{ margin-right:5px; vertical-align:middle; } +.lightlink{ color:#666; text-decoration:underline;} +.lightlink2{ color:#666; } +.parentlink{ color:#09C; text-decoration:underline; } +.menulink{ background:none !important; text-decoration:underline; } + .menulink:hover{ text-decoration:underline !important; } + +/* admincp default */ +.anno{ width:200px; } + .anno p{ margin:4px 0; } + .anno .txt{ margin-left:3px; width:105px; } +.difflink{ margin:10px 0; } + .difflink a{ margin-left:10px; color:#666; text-decoration:underline; } +.devteam{ width:350px; } + +/* widget */ +.checked, .checked .txt{ color:#0D0; } +.lightfont{ color:#CCC; } +.light, .light a{ color:#AAA; } +.lightnum{ color:#F60; } +.error{ color:#F00; } +.diffcolor2{ color:#090; } +.diffcolor3{ color:#09C; } +.nomargin{ margin:0; } +.marginleft{ margin-left:20px; } +.marginright{ margin-right:10px; } +.margintop{ margin-top:10px; } +.marginbot{ margin-bottom:10px; } +.nobg, .nobg td{ background:none; } + .nobg .td27{ padding-left:5px; } +.nobdb{ border-bottom:none; } +.nobdt{ border-top:none; } +.noborder, .noborder td{border-bottom:0; border-top:0; } + .noborder td:hover, .normalfont { color: #000; } +.vtop{ vertical-align:top; } +.lineheight{ line-height:150%; } +.left{ float:left; } +.right{ float:right; } +.center{ text-align:center; } +.bold{ font-weight:700; } +.normal{ font-weight:400; } +.clear{ clear:both; } +.smallfont{font-size:12px!important; font-size: 11px} +.smallfont h3{ font-size:12px; } +.fixpadding th, .fixpadding td{ padding-left:5px !important; } +.notice { position: absolute; z-index: 100; width: 100%; } + .notice a { display: inline-block; padding: 5px 10px; border: solid #CCC; border-width: 0 1px 1px; background: #FEFEE9; color: red; box-shadow: 0 0 5px #B1B1B1; } + .notice a:hover { text-decoration: none; } + .notice span { margin-left: 20px; color: #09C; text-decoration: underline; } + +.news{ padding:10px 0; border-top:4px solid #DEEFFA; clear: both; } + .news li { list-style: none; } +#boardnews{ padding-bottom:10px; } + +.diff-deleted{ background:#FCC !important; } +.diff-changed{ background:#FF9 !important; } +.diff-added{ background:#CFC !important; } + +.verifyimg { max-height: 120px; height: expression(this.height > 120 ? 120 : true); } + +/* calendar */ +#calendar_week .dropmenu{ filter: none; opacity: 1; background: none; margin-left: 0;position:relative; margin-top:0; border:none; text-align:left; text-decoration:underline; } +.calendar_checked, .calendar_checked a:link, .calendar_checked a:visited{ color:#333; } + +/* sub table */ +.sub, .sub .td27{ padding-left:25px !important; } +.sub .rowform{ padding-left:25px !important; width:281px; } + .sub .rowform .txt, .sub .rowform textarea{ width:225px; } + .sub select{ width:231px; } + +.mt10{margin-top: 10px;} +.mt0{margin-top:0} +.header, .header td, .header th{ border-top: 1px dotted #DEEFFB; font-weight: 700; } +.smallefont{font-size: 11px} + +/* 弹窗 */ +.fwin { text-align: left; background: #FFF; } +.t_l, .t_c, .t_r, .m_l, .m_r, .b_l, .b_c, .b_r { overflow: hidden; background: #000; opacity: 0.2; filter: alpha(opacity=20); } +.t_l, .t_r, .b_l, .b_r { width: 10px; height: 10px; line-height: 10px; font-size: 0; } +.t_c, .b_c { height: 10px; } +.m_l, .m_r { width: 10px; } +.t_l { border-radius: 10px 0 0 0; -moz-border-radius: 10px 0 0 0; -webkit-border-radius: 10px 0 0 0; -o-border-radius: 10px 0 0 0; } +.t_r { border-radius: 0 10px 0 0; -moz-border-radius: 0 10px 0 0; -webkit-border-radius: 0 10px 0 0; -o-border-radius: 0 10px 0 0; } +.b_l { border-radius: 0 0 0 10px; -moz-border-radius: 0 0 0 10px; -webkit-border-radius: 0 0 0 10px; -o-border-radius: 0 0 0 10px; } +.b_r { border-radius: 0 0 10px 0; -moz-border-radius: 0 0 10px 0; -webkit-border-radius: 0 0 10px 0; -o-border-radius: 0 0 10px 0; } +.m_c { background: #FFF; } +.m_c .tb { margin: 0 0 10px; padding: 0 10px; } +.m_c .c { padding: 0 10px 10px; } +.m_c .o { padding: 8px 10px; height: 26px; text-align: right; border-top: 1px solid #CCC; background: #F5F5F5; } + +.flb { padding: 10px 10px 8px; height: 20px; line-height: 20px; } + .flb em { float: left; font-size: 14px; font-weight: 700; color: #09C; } + .flb em a { text-decoration: none; } + .flb span { float: right; color: #999; } + .flb span a, .flb strong { float: left; text-decoration: none; margin-left: 8px; font-weight: 400; color: #333; } + .flb span a:hover { color: #999; } + .flbc { float: left; width: 20px; height: 20px; overflow: hidden; text-indent: -9999px; background: url(cls.gif) no-repeat 0 0; } + .flbc:hover { background-position: 0 -20px; } + +.fwin .cl li { margin:5px; float: left; } +.fwin .cl li.a { font-weight: 700; } +.fwin .c { clear: both; } +.fwin .dt { width: 100%; } +.fwin .dt th, .fwin .dt td { border-bottom: 1px dotted #DEEFFB; line-height: 20px; } +.fwin .dt th { font-weight: 700; } +.fwin .ss em { background: #eee; width: 16px; line-height: 18px; display: block; float: left; margin: 2px; cursor: pointer; padding-left: 7px;} +.fwin .ss em.a { background: #09f; color: #FFF;} + +/* .cl --> Clear 自动闭合 */ +.cl:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.cl { zoom: 1; } + +.preview { margin-bottom: 8px; width: 570px; height: 340px; border: 1px solid #09C; box-shadow: 3px 3px 3px #EEE; -moz-box-shadow: 3px 3px 3px #EEE; -webkit-box-shadow: 3px 3px 3px #EEE; -o-box-shadow: 3px 3px 3px #EEE; } + + +/*气泡信息 by dfox */ +.prmm { margin-left: -27px; padding-top: 10px; width: 250px; background: transparent url(pm_ntc.gif) no-repeat 0 0; text-align: left; opacity: 0.98; } + .prmc { padding-bottom: 10px; background: transparent url(pm_ntc.gif) no-repeat -250px 100%; } + .prmm ul { padding: 0 10px; border: solid #91C8E2; border-width: 0 2px; background: #FFF; } + .prmm li { border-bottom: 1px solid #F4F4F4; line-height: 29px; display: block; width: 100%; color: #666; overflow: hidden; text-overflow: ellipsis; -webkit-text-overflow: ellipsis; -moz-text-overflow: ellipsis; -o-text-overflow: ellipsis; } + .prmm a:hover { text-decoration: none; color: #666; } +.up { padding-top: 0; padding-bottom: 10px; width: 150px; background-position: -500px 100%; } + .up .prmc { padding-top: 5px; padding-bottom: 0; background-position: -650px 0; } + .up li { border-bottom: none; line-height: 160%; } + +/* 通用的表单样式 */ + .tfm { width: 100%; } + .tfm caption, .tfm th, .tfm td { padding: 10px 2px; } + .tfm caption h2 { font-size: 16px; } + .vt th, .vt td { vertical-align: top; } + .tfm th { width: 95px; font-weight: 700; } + .tfm th .rq { float: right; font-size: 14px; } + .tfm .pt, .tfm .px { margin-right: 3px; width: 282px; } + .tfm .c, .tfm .tedt, .m_c .tfm .tedt { width: 290px; } + .tfm .d { clear: both; margin: 5px 0; color: {LIGHTTEXT}; } + .tfm .d em { margin-left: 5px; color: red; } + .tfm .d strong { margin-left: 5px; } + .tfm .p { text-align: right; } + .tfm .pcl label { display: block; padding: 0 2px 5px; } + .tfm .pcl .pc { margin-right: 5px; padding: 0; } + .tfm .l th, .tfm .l td { padding-top: 0; padding-bottom: 0; } + .bn .tfm caption, .bn .tfm th, .bn .tfm td { padding-top: 5px; padding-bottom: 5px; } + .bn .tfm th { font-weight: 400; } + +/* 普通数据列表 datatable by michael */ + +.dt { border-top: 1px solid #CDCDCD; width: 100%; } + .dt th { background: #F2F2F2; } + .dt td, .dt th { padding: 7px 4px; border-bottom: 1px solid #CDCDCD; } + .dt .c { width: 50px; } + .dt .px { height: 16px !important; font-size: 12px; } + + +/* 外边距 Margin,三组从窄到宽,级别分别为:n, m, w */ + .mtn { margin-top: 5px !important; } + .mbn { margin-bottom: 5px !important; } + .mtm { margin-top: 10px !important; } + .mbm { margin-bottom: 10px !important; } + .mtw { margin-top: 20px !important; } + .mbw { margin-bottom: 20px !important; } + +.psetting p { margin-top: 10px; } + .psetting .light, .psetting .light a { color: #777; } + .psetting a.memo { color: #999; margin-left: 20px; } + .psetting div.memo { margin:5px;padding: 5px; border: 1px dotted #DEEFFB; background: #FFF; } + +/* 进度条 */ +.pbg { position: relative; margin: 10px 0; width: 200px; height: 16px; background: url(bg_progressbar.png) 0 0 repeat-x; border-radius: 5px; } + .pbr { height: 16px; width: 200px; background-image: url(bg_progressbar.png); background-color: #5AAF4A; background-position: 0 -16px; background-repeat: repeat-x; border-radius: 5px; } + .pbg .xs0 { position: absolute; top: 0; right: 8px; } \ No newline at end of file diff --git a/static/image/admincp/admincpframe.css b/static/image/admincp/admincpframe.css new file mode 100644 index 0000000..e932bc8 --- /dev/null +++ b/static/image/admincp/admincpframe.css @@ -0,0 +1,216 @@ +html, body, #bdcontainer { width: 100%; height: 100%; } +body { font-size: 14px; font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; } +#bdcontainer { display: flex; flex-direction: row; } +.navcontainer nav { display: flex; flex-direction: column; width: 200px; min-width: 150px; max-width: 400px; height: 100%; overflow: hidden; resize: horizontal; } +.ifmcontainer { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; } +nav>a { display: flex; flex-shrink: 0; height: 50px; background: #2b7acd; justify-content: center; align-items: center; } +.st-d nav>a {background: #181818;} +nav ul, nav ol { margin: 0; padding: 0; list-style-type: none; } +nav>ul { flex-grow: 1; background-color: #1f5793; padding: 10px 0; overflow: auto; } +.st-d nav>ul {background-color: #0a0a0a;} +nav>ul::-webkit-scrollbar { width: 10px; background-color: #92bbe8; border-radius: 5px; } +nav>ul::-webkit-scrollbar-thumb { background-color: #2b7acd; border: 1px solid #92bbe8; border-radius: 5px; } +.st-d nav>ul::-webkit-scrollbar { background-color: #999; } +.st-d nav>ul::-webkit-scrollbar-thumb { background-color: #181818; border: 1px solid #0a0a0a;} +nav>ul a { display: flex; padding: 0 18px 0 30px; color: rgba(255, 255, 255, 0.8); height: 40px; align-items: center; text-decoration: none; } +nav>ul a:hover { background-color: #2464a8; color: #fff; } +nav>ul a.active { background-color: #2870bd; color: #fff; } +.st-d nav>ul a:hover{ background-color: #181818; color: #999; } +.st-d nav>ul a.active{ background-color: #181818; color: #999; } +nav>ul a span { flex-grow: 1; } +nav>ul>li>a { cursor: pointer; } +nav>ul>li>a::after { display: block; content: ""; border-top: 5px solid; border-bottom: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; } +nav>ul>li>#leftmn_cloudaddons::after , nav>ul>li>#leftmn_uc::after{ display: none;} +nav>ul>li.active>a::after { transform: scaleY(-1); } +nav ul ul { display: none; } +nav ul li.active { background-color: #163e69; } +.st-d nav ul li.active { background-color: #0a0a0a; } +nav ul li.active ul { display: block; } +nav ul ul a { padding-right: 14px; } +nav ul ul a>em { display: block; width: 8px; height: 8px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 5px; margin-right: 10px; flex: 0 0 8px; } +nav ul ul a>em:hover { border-radius: 1px; border-width: 1.25px; border-color: #fff; transform: scale(1.6); } +nav ul ul a>div { flex: 0 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.st-d nav ul ul a>em:hover { border-color: #999;} +.mainhd { display: flex; flex-shrink: 0; flex-direction: row; background-color: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); z-index: 1; } +.st-d .mainhd {background-color: #000; } +#main { flex-grow: 1; background-color: #f7f7f7; } +.st-d #main {background-color: #0a0a0a; } +#navbtn { display: none; align-items: center; padding-right: 20px; } +#navbtn>div { height: 18px; width: 20px; border: 0; padding: 0; background: linear-gradient(0deg, #2b7acd 25%, transparent 25%) bottom; background-size: 8px 8px; } +.st-d #navbtn>div { background:linear-gradient(0deg, #999999 25%, transparent 25%) bottom; background-size: 8px 8px;} +.currentloca { display: flex; height: 50px; padding: 0 20px; align-items: center; color: #000; } +.st-d .currentloca { color: #999; } +.currentloca a.custommenu_addto { display: block; position: relative; width: 18px; height: 18px; border-radius: 9px; color: transparent; background-color: #2b7acd; overflow: hidden; text-indent: 1000px; } +.st-d .currentloca a.custommenu_addto { background-color: #ccc; } +.currentloca a.custommenu_addto::before, .currentloca a.custommenu_addto::after { content: ""; background: #fff; position: absolute; } +.st-d .currentloca a.custommenu_addto::before, .st-d .currentloca a.custommenu_addto::after { background: #0a0a0a; } +.currentloca a.custommenu_addto::before { width: 8px; height: 2px; top: 8px; left: 5px; } +.currentloca a.custommenu_addto::after { width: 2px; height: 8px; top: 5px; left: 8px; } +.uinfo { height: 50px; display: flex; padding: 0 20px; justify-content: space-between; } +#topmenu { display: none; align-items: center; } +#topmenu li { padding-right: 5px; } +#topmenu button { font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; font-size: 13px; padding: 8px 15px; background: none; color: #666; border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; } +#topmenu button:hover { background: #efefef; } +.st-d #topmenu button:hover { background: #282828; } +#topmenu button.active { background: #d0e5fb; color: #123254; } +.st-d #topmenu button.active { background: #282828; color: #fff; } +#topmenu button:focus { outline: 0; box-shadow: none; } +#topmenu button.active:focus { outline: 0; box-shadow: 0 0 3px 2px rgba(43, 122, 205, 0.4); } +#topmenu button.active:focus:not(:hover) { box-shadow: none; } +button::-moz-focus-inner { border: none; padding: 0; } +#frameuinfo { display: flex; align-items: center; color: #333; } +.st-d #frameuinfo { color: #666; } +#frameuinfo>img { width: 38px; height: 38px; border: 2px solid #fff; border-radius: 3px; box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); } +#frameuinfo>p { margin-left: 12px; } +#frameuinfo>p.greet a { display: inline-block; text-decoration: none; background: #2b7acd; color: #fff; padding: 1px 3px; border-radius: 3px; } +.st-d #frameuinfo>p.greet a { background: #999; color: #000; } +#frameuinfo em { font-style: normal; font-weight: 700; } +#frameuinfo a { color: #2b7acd; } +.st-d #frameuinfo a { color: #999; } +#frameuinfo .btnlink svg { fill: #444; } +#frameuinfo .btnlink:hover svg { fill: #2b7acd; } +.st-d #frameuinfo .btnlink:hover svg { fill: #999; } +.mainhd form { display: flex; justify-content: flex-end; align-items: center; flex-grow: 1; } +.mainhd form input.txt { background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3e%3cpath fill='%23444' d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3e%3c/svg%3e") no-repeat right 50%; color: #222; border: 1px solid #999; cursor: text; border-radius: 4px; position: relative; padding: 4px 8px; height: 18px; width: 150px; margin-left: 12px; box-shadow: none; transition: all 0.3s ease; transition-property: width, border-color, box-shadow; } +.st-d .mainhd form input.txt { color:#fff;} +.mainhd form input.txt:focus { outline: 0; border-color: #2b7acd; box-shadow: 0 0 3px 2px rgba(43, 122, 205, 0.4); } +.st-d .mainhd form input.txt:focus { border-color: #999;} +/* .mainhd form input.txt:focus:valid {background: transparent;} */ +.mainhd form button { position: absolute; width: 24px; height: 28px; background: none; border: 0; cursor: pointer; } +.mainhd form button:focus { outline: 0; } +#cpsetting {cursor: pointer; } +/* start oldlayout */ +@media (min-width: 1200px) { + .oldlayout nav>ul, .widelayout nav>ul { background-color: #163e69; } + .st-d .oldlayout nav>ul, .st-d .widelayout nav>ul { background-color: #0a0a0a; } + .oldlayout nav>ul>li:not(.active), .widelayout nav>ul>li:not(.active) { display: none; } + .oldlayout nav ul li.active, .widelayout nav ul li.active { background: none; } + .oldlayout nav>ul>li>a, .widelayout nav>ul>li>a { display: none; } + .oldlayout .mainhd { flex-wrap: wrap; background-color: #f7f7f7; } + .st-d .oldlayout .mainhd { background-color: #181818; } + .oldlayout .mainhd .currentloca { order: 1; flex-grow: 1; height: 35px; } + .oldlayout .mainhd .uinfo { width: 100%; border-bottom: 1px solid #ccc; background-color: #fff; } + .st-d .oldlayout .mainhd .uinfo { border-bottom: 1px solid #999; background-color: #0a0a0a; } + .widelayout .mainhd .uinfo { flex-grow: 1; padding: 0; } + .oldlayout #frameuinfo>p.greet { max-width: 200px; } + .widelayout #frameuinfo>p.greet { max-width: 190px; } + .oldlayout #topmenu, .widelayout #topmenu { display: flex; } + .oldlayout .mainhd form, .widelayout .mainhd form { flex-grow: 0; order: 1; padding-right: 20px; } + .oldlayout .mainhd form input.txt { background-color: #fff; background-size: 18px; height: 18px; padding: 2px 8px; } + .st-d .oldlayout .mainhd form input.txt { background-color: #000;} + .widelayout .mainhd form input.txt { width: 24px; cursor: pointer; padding: 4px 0; border-color: transparent; color: transparent; } + .widelayout .mainhd form input.txt:focus { color: #222; width: 150px; cursor: text; padding: 4px 8px; border-color: #2b7acd; } + .st-d .widelayout .mainhd form input.txt:focus { border-color: #999; } + .widelayout .mainhd form button { display: none; } + .widelayout .mainhd form input.txt:focus:valid { background: transparent; } +} +@media (max-width: 1799px) { + .widelayout #topmenu li { padding-right: 2px; } + .widelayout #topmenu button { padding: 8px 10px; } +} +@media (max-width: 1599px) and (min-width: 1200px) { + .oldlayout #topmenu li { padding-right: 2px; } + .oldlayout #frameuinfo>p.greet { max-width: 180px; } + .widelayout #frameuinfo>p.greet { max-width: 160px; } + .oldlayout #topmenu button { padding: 8px 10px; } + .widelayout #topmenu button { padding: 8px 5px; } + .widelayout .mainhd form input.txt:focus { width: 120px; } +} +@media (max-width: 1399px) { + .oldlayout #topmenu button { padding: 6px; } + .widelayout #topmenu button { padding: 8px 2px; } +} +/* end oldlayout */ +@media (max-width: 1199px) { + #frameuinfo>p.greet { max-width: 200px; } +} +@media (max-width: 899px) { + .navcontainer { position: fixed; width: 100%; height: 100%; z-index: 10; display: none; } + .navcontainer.show { background: rgba(0, 0, 0, 0.2); display: block; } + .navcontainer nav { box-shadow: 3px 0 8px rgba(0, 0, 0, 0.3); transition: transform 0.4s ease; transform: translateX(-110%); } + .navcontainer.show nav { transform: none; } + #navbtn { display: flex; } + .currentloca { padding: 0; } +} +@media (max-width: 767px) { + .mainhd form>* { display: none; } +} +@media (max-width: 575px) { + .mainhd { justify-content: space-between; } + .mainhd form { display: none; } + .uinfo { padding: 0 51px 0 6px; } + #frameuinfo>p { display: none; } + .mainhd.toggle .currentloca { display: none; } + .mainhd.toggle #frameuinfo>p { display: block; } + .mainhd.toggle .uinfo { box-shadow: -5px 0 5px rgba(0, 0, 0, .2); } + .mainhd.toggle #frameuinfo:before { content: ""; display: block; color: #2b7acd; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 5px solid; border-right: 0; transform: translate(-5px, 0); } +} + +/* 日夜模式 */ +.darkmode { + align-self: flex-end; + width: 45px; + height: 45px; + border-radius: 0 0 0 45px; + overflow: hidden; + cursor: pointer; + position: absolute; + right: 0; + top: 0; +} +.st-a .darkmode { + background: rgba(255, 255, 255, 0.6); +} +.st-d.st-a .darkmode { + background: #131313; +} +.darkmode > div { + position: relative; + height: 100%; +} +.darkmode .dk-light, +.darkmode .dk-dark { + position: absolute; + top: 0; + right: 0; + transform-origin: 100% 0; + transition: transform 0.4s ease; +} +.st-l .dk-dark { + transform: rotate(-90deg); +} +.st-d .dk-light { + transform: rotate(90deg); +} +.st-a .dk-light { + transform: rotate(35deg); +} +.st-a .dk-dark { + transform: rotate(-35deg); +} +.darkmode svg { + fill: #838c94; + margin: 6px 6px 0 0; +} +.darkmode ul { + display: block; + position: absolute; + right: 14px; + background: #fff; + padding: 8px 0; + border-radius: 5px; + box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); + z-index: 10; +} +.darkmode ul li { + display: block; + padding: 4px 10px; + white-space: nowrap; +} +.darkmode ul li:hover { + background: #aaa; +} +.darkmode ul li.current { + background: #2b7acd; + color: #fff; +} \ No newline at end of file diff --git a/static/image/admincp/admincplogin.css b/static/image/admincp/admincplogin.css new file mode 100644 index 0000000..ea44d34 --- /dev/null +++ b/static/image/admincp/admincplogin.css @@ -0,0 +1,288 @@ +html, +body { + width: 100%; + height: 100%; + min-height: 600px; +} +body { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + background: #c8e2fb; + background-image: linear-gradient(45deg, #c8e2fb, #fbecd6); + font-family: sans-serif; +} +body.st-d { + background: #0a0a0a; +} +*, *::before, *::after { + box-sizing: inherit +} +.darkmode { + align-self: flex-end; + width: 45px; + height: 45px; + border-radius: 0 0 0 45px; + overflow: hidden; + cursor: pointer; +} +.st-a .darkmode { + background: rgba(255, 255, 255, 0.6); +} +.st-d.st-a .darkmode { + background: #131313; +} +.darkmode > div { + position: relative; + height: 100%; +} +.darkmode .dk-light, +.darkmode .dk-dark { + position: absolute; + top: 0; + right: 0; + transform-origin: 100% 0; + transition: transform 0.4s ease; +} +.st-l .dk-dark { + transform: rotate(-90deg); +} +.st-d .dk-light { + transform: rotate(90deg); +} +.st-a .dk-light { + transform: rotate(35deg); +} +.st-a .dk-dark { + transform: rotate(-35deg); +} +.darkmode svg { + fill: #838c94; + margin: 6px 6px 0 0; +} +.darkmode ul { + display: block; + position: absolute; + right: 14px; + background: #fff; + padding: 8px 0; + border-radius: 5px; + box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); + z-index: 10; +} +.darkmode ul li { + display: block; + padding: 4px 10px; + white-space: nowrap; +} +.darkmode ul li:hover { + background: #aaa; +} +.darkmode ul li.current { + background: #2b7acd; + color: #fff; +} +.container { + display: flex; + border-radius: 10px; + overflow: hidden; + box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); + transition: box-shadow 0.3s; +} +.container:hover { + box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2); +} +.intro { + background: #2b7acd url(./loginbg.svg) no-repeat left bottom; + color: #fff; + width: 350px; + padding: 30px; +} +.st-d .intro { + background-color: #000; + color: #999; +} +.intro h3 { + font-size: 30px; + padding-bottom: 15px; + border-bottom: 2px solid rgba(255, 255, 255, 0.2); + margin-bottom: 15px; +} +.intro h3 span { + font-weight: 700; + margin-right: 10px; +} +.intro p { + font-size: 14px; + opacity: 0.6; +} +.intro p a { + color: #fff; +} +.loginbox { + display: flex; + flex-direction: column; + width: 350px; + padding: 30px; + background: #fff; +} +.st-d .loginbox { + background: #181818; +} +.loginbox img { + margin-bottom: 24px; + height: 80px; +} +.loginbox img.avt { + border: 3px solid #fff; + border-radius: 3px; + width: 80px; + align-self: center; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); + margin-bottom: 10px; +} +.st-d .loginbox img { + filter: grayscale(1); +} +.st-d .loginbox img.avt { + filter: none; + opacity: 0.6; +} +.loginbox h1 { + font-size: 18px; + margin-bottom: 18px; + text-align: center; +} +.st-d .loginbox h1 { + color: #999; +} +.loginbox p { + display: flex; + align-items: center; + color: #999; + font-size: 14px; + line-height: 16px; + cursor: pointer; + transform: translate(0, -7px); +} +.loginbox p span { + display: inline-flex; + width: 14px; + height: 14px; + border: 1px solid; + border-radius: 2px; + margin-right: 4px; +} +.loginbox .loginqa { + display: none; +} +footer { + padding: 6px 0; + font-size: 12px; + color: #fff; + user-select: none; +} +.st-d footer { + opacity: 0.6; +} +footer a { + color: #fff; +} +input, +select, +button, +a.btn { + height: 38px; + padding: 7px 11px; + margin-bottom: 16px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 16px; +} +.st-d input, +.st-d select { + background: #222; + border-color: #333; + color: #777; +} +input:focus, +select:focus, +button:focus, +a.btn:focus { + outline: none; + border-color: #2b7acd; + box-shadow: 0 0 3px 2px rgba(43, 122, 205, 0.4); +} +.st-d input:focus, +.st-d select:focus, +.st-d button:focus, +.st-d a.btn:focus { + border-color: #666; + box-shadow: none; +} +button, +a.btn { + margin-bottom: 0; + border-color: #2b7acd; + background: #2b7acd; + color: #fff; + cursor: pointer; +} +.st-d button, +.st-d a.btn { + border-color: #000; + background: #000; + color: #777; +} +a.btn { + text-align: center; + text-decoration: none; + margin-top: 26px; + margin-bottom: 26px; +} +@media (max-width: 768px) { + .container { + flex-direction: column; + } + .loginbox img.logo { + display: none; + } +} +@media (max-width: 576px) { + body { + background: #fff; + } + body.st-d { + background: #181818; + } + .darkmode { + position: absolute; + } + .st-a .darkmode { + background: rgba(255, 255, 255, 0.1); + } + .darkmode svg { + fill: rgba(255, 255, 255, 0.2); + } + .container { + border-radius: 0; + box-shadow: none; + } + .container:hover { + box-shadow: none; + } + .intro, + .loginbox { + width: 100%; + } + footer { + color: #999; + text-align: center; + display: flex; + flex-direction: column; + } + footer a { + color: #999; + } +} diff --git a/static/image/admincp/admincppage.css b/static/image/admincp/admincppage.css new file mode 100644 index 0000000..82c2d5d --- /dev/null +++ b/static/image/admincp/admincppage.css @@ -0,0 +1,557 @@ +body { background: #f0f0f0; font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;min-width: 1000px; } +body.st-d { background: #282828; } +a{ color:#2366A8; text-decoration:none; } +.st-d a { color:#999;} + a:hover { text-decoration:underline; } + a img{ border:none; } +em, cite, th{ font-style:normal; font-weight:normal; } + +textarea, input, select, .html { padding: 6px 10px; font-size: 100%; border: 1px solid; border-color: #ccc; background: #F9F9F9; color: #333; resize: none; border-radius: 3px; } +.st-d textarea, .st-d input, .st-d select, .st-d .html {border-color: #999; background: #181818; color: #fff;} +textarea {font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;} +.txt, select, .vmiddle { vertical-align:middle; } +.txt:hover, .txt:focus, textarea:hover, textarea:focus{ border-color:#2b7acd; background:#F5F9FD; outline: 0;box-shadow: 0 0 3px 2px rgba(43, 122, 205, 0.4);} +.st-d .txt:hover, .st-d .txt:focus, .st-d textarea:hover, .st-d textarea:focus{ border-color:#eaeaea; background:#181818;} +.hover:hover { background:#F5F9FD; } + .hover:hover .addchildboard, .hover:hover .deleterow { color: #F5F9FD; } +.txtnobd{ border:1px solid #FFF; background:#FFF; cursor:pointer; } +.radio, .checkbox, .pr, .pc { border:none; background:none; vertical-align:middle;margin-right: 4px; margin-left: 4px; } +.btn{ margin:10px;border: 0;padding: 6px 14px;background: #2b7acd;color: #fff; cursor:pointer;vertical-align: middle;} +.st-d .btn {background: #181818;color: #fff;} + .btn:hover { text-decoration: none; background-color: #428ad7;} + .st-d .btn:hover {background-color: #282828;} +.btn_big { display: inline-block; width: 90px; height: 30px; line-height: 30px; text-align: center; background: url(btn_big.png) no-repeat 0 0; font-size: 18px; font-weight: 700; color: #FFF; } + .btn_big:hover { text-decoration: none; } +.uploadbtn{ width:250px; border-color:#999; } +.line { border-bottom: 1px solid #0F0; } +.num{ width:40px !important; height: 28px; vertical-align:middle; } +.highlight { color: #C00; font-weight: 700; } +/* simulate input type="file" */ +.filebtn { position: relative; margin-right: 30px; width: 60px; overflow: hidden; zoom: 1; } + .filebtn .pf { position: absolute; right: 0; height: 23px; opacity: 0; filter:alpha(opacity=0); cursor: pointer; } + +/* .html */ +.html { cursor: text; white-space: nowrap; overflow-x: hidden; } +.htmlbtn { background: url("../editor/editor.gif") no-repeat scroll 0 0 transparent;border-color: #CCCCCC;width: 21px;height: 21px;margin-right: 2px;float: left;cursor: pointer;padding: 0px; } +.htmlbtn.current { border-color: #369; } +.htmlbtn.b {background-position:0 0;} +.htmlbtn.i { background-position:-20px 0; } +.htmlbtn.u { background-position:-40px 0; } +.htmlbtn.c { background-position:-60px 0; } + +.spectitle{ border-bottom:1px dashed #F66; } +.extcredits, .threadprofilenode { margin:-5px 0 10px; } +.extcredits a, .threadprofilenode a { margin-right:5px; padding:2px 5px; line-height:220%; border:1px solid #B6CFD9; background:#FFF; white-space:nowrap; } +.st-d .extcredits a, .st-d .threadprofilenode a { border:1px solid #181818; background:#000;} +.popupmenu_popup { width:400px; overflow:hidden; padding:10px; border:1px solid #A6C9D7; background:#FFF; font-size:12px; font-weight:400; text-align:left; } + li.popupmenu_popup { list-style: none; } + #fselect_menu { width:300px; } + .fsel { _height: 350px; max-height: 350px; overflow-y: auto; } + #fselect_menu a { width: 70%; } + #ugselect_menu { width:450px; } + .popupmenu_popup em { display:block; clear: both; padding: 2px 4px; font-weight:700; background:#EAF4FB; } + .popupmenu_popup em.hover { cursor:pointer; } + .popupmenu_popup a { float: left; margin: 5px 9px 1px 0; padding-left:3px; width: 100px; } + .popupmenu_popup .ck { margin: 6px; } + .popupmenu_popup .current { font-weight:700; } + .popupmenu_popup a.f, .popupmenu_popup a.s { float: none; display: block; width:80%; } + .popupmenu_popup a.s { margin-left:40px; } + .popupmenu_dropmenu { cursor: pointer; } + .popupmenu_dropmenu em { margin-left:3px; background:url(bg_repno.gif) no-repeat 0 -145px; } + +.infobox { background: #fff; padding: 40px; display: flex; flex-direction: column; align-items: center; text-align: center; } +.st-d .infobox { background: #000;} +.infotitle1 { margin-bottom: 10px; color: #09C; font-size: 14px; font-weight: 700; } +.infotitle2 { margin-bottom: 10px; color: #090; font-size: 14px; font-weight: 700; } +.infotitle3 { margin-bottom: 10px; color: #C00; font-size: 14px; font-weight: 700; } +.infobox h3 { font-size: 18px; font-weight: bold; margin-bottom: 10px; } +.colorbox { background: #fff; padding: 20px; margin-top: 3px; margin-bottom: 3px; border-top: 4px solid #CCC; border-bottom: 4px solid #CCC; } +.st-d .colorbox { background: #000;} +.colorbox h4 { font-size: 18px; margin-bottom: 10px; } +.drow { display: flex; margin-left: -10px; margin-right: -10px; flex-wrap: wrap; } +.drow.clp { margin-left: 0; margin-right: 0; } +.drow .dcol { padding-left: 10px; padding-right: 10px;/* flex-shrink: 0; */} +.drow.clp .dcol { padding-left: 0; padding-right: 0; } +.d-1 { flex-grow: 1; } +.d-2 { flex-grow: 2; } +.d-3 { flex-grow: 3; } +.d-11 { flex-basis: 100%; } +.d-12 { flex-basis: 50%; } +.d-13 { flex-basis: 33.3%; } +.d-23 { flex-basis: 66.6%; } +.d-14 { flex-basis: 25%; } +.d-34 { flex-basis: 75%; } +@media (max-width: 900px) { + .dcol { flex-basis: 100% !important; } + .pluginlist .dcol { flex-basis: unset !important; } +} +@media (max-width: 1000px) { + .pluginlist .w1000hide { display: none; } +} +@media (max-width: 1300px) { + .pluginlist .w1300hide { display: none; } +} +.cpcontainer { background: #f0f0f0; padding: 20px; color: #333; font-size: 12px; } +.st-d .cpcontainer { background: #282828;color: #666;} +.copyright { width: 100%; background: #fff; color: #999; padding: 16px; font-size: 12px; text-align: center; } +.st-d .copyright { background: #000;} +.itemtitle { padding: 0 20px; background: #fff; display: flex; align-items: flex-start; flex-direction: column; border-bottom: 1px solid #ddd; } +.st-d .itemtitle { background: #000; border-bottom: 1px solid #999; } +.itemtitle .titlerow { display: flex; width: 100%; flex-direction: row; justify-content: space-between; } +.st-d .itemtitle .titlerow { color: #fff; } +.itemtitle .titlerow>span, .itemtitle .titlerow>a { margin: 16px 0; } +.itemtitle h3 { font-weight: bold; font-size: 20px; margin: 16px 20px 16px 0; } +.st-l .itemtitle h3 { color:#000;} +.itemtitle ul { display: flex; flex-wrap: wrap; } +.itemtitle ul li>a { display: block; text-decoration: none; padding: 15px 5px; margin-right: 15px; color: #333; border-bottom: 2px solid transparent; } +.itemtitle ul li.current>a { color: #2b7acd; border-bottom-color: #2b7acd; } +.st-d .itemtitle ul li.current>a { color: #999; border-bottom-color: #999; } +.itemtitle ul li a:hover { color: #2b7acd; background: #f7f7f7; } +.st-d .itemtitle ul li a:hover { color: #eaeaea; background: #282828;} +.itemtitle ul li.current>a span, .itemtitle ul li.hasdropmenu>a span { display: flex; flex-direction: row; align-items: center; } +.itemtitle ul li.current>a span em, .itemtitle ul li.hasdropmenu>a span em { display: block; width: 0; height: 0; margin-left: 8px; border-top: 5px solid; border-bottom: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; } +.itemtitle ul.stepstat { font-size: 14px; color: #666; width: 100%; justify-content: center; margin-bottom: 16px; } +.itemtitle ul.stepstat li { display: flex; align-items: center; } +.itemtitle ul.stepstat span { display: flex; width: 20px; height: 20px; border-radius: 10px; background: #ddd; color: #000; justify-content: center; align-items: center; margin-right: 10px; } +.itemtitle ul.stepstat li:not(:first-child)::before { display: block; content: ""; width: 100px; height: 3px; background: #ddd; margin: 0 10px; } +.itemtitle ul.stepstat li.current { color: #2b7acd; } +.itemtitle ul.stepstat li.current span { background: #2b7acd; color: #fff; } +.itemtitle ul.stepstat li.current:not(:first-child)::before { background: #2b7acd; } +@media (max-width: 575px) { + .itemtitle ul.stepstat { justify-content: space-around; } + .itemtitle ul.stepstat li:not(:first-child)::before { display: none; } +} +.dropmenu { background: #fff; display: flex; flex-direction: column; border-radius: 5px; margin-top: 5px; box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); overflow: hidden; } +.st-d .dropmenu { background: #181818;} +.dropmenu>ul { display: flex; flex-direction: column; } +.dropmenu>a, .dropmenu>ul>li>a { padding: 8px 15px; text-decoration: none; color: #333; margin-right: 0; } +.st-d .dropmenu>a, .dropmenu>ul>li>a { color:#999;} +.dropmenu a:focus { outline: 0; background: #f7f7f7; } +.st-d .dropmenu a:focus { background: #282828; } +.dropmenu a.current { background: #2b7acd; color: #fff; } +.st-d .dropmenu a.current {background: #282828;} + +.tips{ margin-left:15px; color:#999; } +.tips2{ line-height:180%; color:#999; word-break:break-all; } +.tb2 .tipsblock{ background:none; margin-bottom:-10px; padding: 10px; padding-left: 20px; } + .tipsblock ul{ margin-bottom:-11px; } + .tipsblock li{ margin-bottom:5px; padding:0 0 5px 20px; line-height:160%; background:url(bg_repno.gif) no-repeat -340px 6px; } +.tips a, .tips2 a, .tipsblock a{ margin:0 3px; text-decoration:underline; color:#666; } + .tips a:hover, .tips2 a:hover, .tipsblock a:hover{ color:#09C; } + +@media (max-width: 575px) { + .tb { overflow: auto; } +} +.tipbox { /* todo */ } +.dbox { display: flex; flex-direction: column; background: #fff; margin-bottom: 20px; } +.st-d .dbox {background: #000;} +.dbox .boxheader { padding: 16px 20px; font-size: 16px; border-bottom: 1px solid #ddd; background: #F9F9F9; } +.st-d .dbox .boxheader { border-bottom: 1px solid #383838; background: #222; } +.dbox .boxbody { padding: 20px; border-bottom: 1px solid #ddd; } +.st-d .dbox .boxbody { border-bottom: 1px solid #383838; } +.dbox .boxbody:last-child { border-bottom: 0px; } +.dbox .tb:last-child { margin-bottom: 0px; } +.boxbody .txt { margin-right: 4px; } +.listbox .boxbody>div { border-bottom: 1px solid #eee; padding: 8px 0; } +.st-d .listbox .boxbody>div { border-bottom: 1px solid #484848; } + +/* table */ +.tb{ clear:both; width:100%; margin-bottom: 20px;background: #fff;} +.st-d .tb{background: #000;} + .tb th, .tb td{ padding:5px; height:25px; } +.tb1{} + .th11, .th12{ width:60px; font-weight:700; } + .tb1 .th12{ padding-top:7px; vertical-align:top; } + .tb1 .tb2 th{ padding-top:0; } + .tb1 .txt{ width:150px; } + .tb1 strong{ margin-right:5px; color:#F60; } + .first td{ padding-top:13px; } + .first .th12{ padding-top:15px; } + .bdtop td{ border-top:1px dashed #CAE4F7; } + .bdbot td{ border-bottom:1px dashed #CAE4F7; } + .td11{ width:350px; vertical-align:top; } + .td11 li{ float:left; margin:0 10px 7px 0; *margin:-3px 10px 7px 0; } + .td11 .clear{ margin:0; } + .listtitle, .listtitlelong{ padding-top:3px; *padding-top:6px; width:80px; color:#09C; } + .listtitlelong{ width:100px; } + .td11 .txt{ width:70px; } + .td11 .sginput .txt{ width:150px; } + .td12{} + .td12 li{ float:left; margin-right:10px; } + .td12 .radio{ float:left; margin-top:4px; *float:none; *margin-top:0; } + .td12 label{ float:left; margin-top:2px; *float:none; *margin-top:0; } + .td12 .txt{ width:50px; } + .checkboxlist{ width:720px; } + .checkboxlist li{ float:left; width:90px; line-height:180%; white-space:nowrap; cursor:pointer; } + .longtxt .txt{ width:400px !important;} + .tarea{ width:400px; height:75px; } + .sml, .sml th, .sml td { font-size: 12px !important; -webkit-text-size-adjust: none; } + .fixsel { padding-left: 10px; } + .fixsel .btn:first-child{ margin-left: 0px; } + .tb2 .fixsel{ padding-left: 0px; } + .tb2 tr:first-child th, .tb2 tr:first-child td{ border-top: 0px; } +/* tb */ +.tb2{} + .tb2 tr.hover:hover .tips2{ color:#333; } + .tb2 tr.hover:hover td { background: #F2F9FD; } + .st-d .tb2 tr.hover:hover td { background: #282828; } + .tb2 tr.hl, .drow.hl { background: #FFFAF3; } + .tb2 tr.hl td, .drow.hl { border-top:1px #F4E4B4 solid; border-bottom:1px #F4E4B4 solid } + .tb2.tdhover tr:hover td { background: none; } + .tb2.tdhover tr td:hover { background: #F2F9FD; } + .tb2 td{ padding:10px 5px 10px 0px; border-top: 1px dotted #DEEFFB; } + .st-d .tb2 td{ border-top: 1px dotted #282828; } + .tb2 th{ padding:10px 5px 10px 0px; border-top: 1px dotted #DEEFFB; line-height:1.5; } + .st-d .tb2 th{ border-top: 1px dotted #282828; } + .tb2 td:first-child{ padding-left:20px; } + .tb2 th:first-child{ padding-left:20px; } + .tb2 .txt, .tb2 .txtnobd{ width:100px; margin-right:10px; } + .tb2 .smtxt { margin-right: 5px; width: 25px; } + .nowrap { white-space: nowrap; } + .td21{ width:150px; font-weight:700; } + .td22{ width:100px; font-weight:700; } + .td23{ width:100px; } + .td24{ width:120px; } + .td25{ width: 80px; } + .td25 .txt{ width:60px; } + .td26{} + .td26 .txt, .td26 .txtnobd{ width:90%; *width:280px; } + .tb2 .td27{ padding:16px 10px 10px 20px; font-weight:700;} + .tb2 .td27:hover { background: none; } + .td27m { font-weight:700; padding-bottom:5px; } + .td28 .txt{ width:60px; } + .td29 .txt{ width:200px; } + .td30 { width:30px; } + .td31 { width:200px; } + .td32 { width:100px; } + .td32 .txt{ width:80px; } + .tbm { padding:5px !important; padding-left: 20px !important; background: #F2F9FD !important; font-weight: 700; border-top:0 !important; } + .st-d .tbm {background: #181818 !important;} + .multicol { float:left; width: 270px !important; } + .staton{ text-indent:-9999px; width:20px; height:17px; background:url(bg_repno.gif) no-repeat -280px -250px; } + .statoff{ text-indent:-9999px; background:url(bg_repno.gif) no-repeat -250px -347px; } + .rowform{ width:306px; overflow:auto; } + .tb2 .rowform{ padding-left:20px; } + .rowform .txt, .rowform textarea{ margin-right:10px; width:234px; } + .rowform select{ margin-right:10px; width:256px; } + .rowform .radio{ margin-top:-2px !important; *margin-top:0 !important; *margin-top:-2px; } + .rowform li{ overflow:hidden; float:left; margin-right:10px; white-space:nowrap; cursor:pointer; } + .rowform .clear{ clear:both; float:none; margin-bottom:10px; } + .rowform .nofloat{ clear:both; } + .rowform .nofloat li{ float:none; margin:10px 0; overflow:visible; } + .ckbox {width:900px; } + .ckbox li { float: left; margin: 5px 10px 5px 0; white-space: nowrap; width: 162px; height: 20px; } + .partition, .partition2{ color: #000; } + .st-d .partition, .partition2{ color:#fff; } + .tb2 .partition { padding: 16px 20px; font-size: 16px; border-bottom: 1px solid #ddd;background: #F9F9F9; } + .st-d .tb2 .partition { background: #222; } + .dblist{} + .dblist li{ float:left; margin-bottom:5px; width:33%; height:20px; white-space:nowrap; cursor:pointer; } + + .cfolder, .ofolder{ display:block; padding-left:50px; line-height:30px; background:url(bg_repno.gif) no-repeat -260px -50px; font-weight:700; } + .ofolder{ background:url(bg_repno.gif) no-repeat -260px -100px; } + .filenum{ margin:8px 0 0 20px; } + .files{ padding:1px 0 1px 50px; background:url(bg_repno.gif) no-repeat -260px -150px; } + .del{ padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat 0 -285px; *background:url(bg_repno.gif) no-repeat 0 -286px; color:#E8594D; } + .edited, .unfixed { padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat -100px -385px; *background:url(bg_repno.gif) no-repeat -100px -386px; color:#E8594D; } + .unknown{ padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat -50px -435px; *background:url(bg_repno.gif) no-repeat -50px -436px; color:#6189B8; } + .correct, .fixed { padding-bottom: 1px; padding-left:18px; background:url(bg_repno.gif) no-repeat 0 -485px; *background:url(bg_repno.gif) no-repeat 0 -486px; color:#70B759; } + span.bignum { display: block; font-size: 36px; } + /* crons */ + .crons{ width:300px; } + .crons .txt{ margin-bottom:3px; width:250px; } + + /* faqlist & boardlist */ + .node, .board{ padding-left:55px; background:url(bg_repno.gif) no-repeat -240px -550px; } + .node .txt, .lastnode .txt, .newnode .txt{ width:250px; } + .parentnode .txt{ width:250px; font-weight:700; } + .parentboard .txt{ font-weight:700; } + .lastnode, .lastboard{ padding-left:55px; background:url(bg_repno.gif) no-repeat -240px -600px; } + .childboard{ padding-left:110px; background:url(bg_repno.gif) no-repeat -185px -550px; } + .lastchildboard{ padding-left:110px; background:url(bg_repno.gif) no-repeat -185px -600px; } + .boardattr{ position:absolute; left:500px; width: 45px; margin-top:-22px !important; color:#999; } + + /* pick window */ + .colorwd{ float:left; width:40px; height:30px; border-color:#ccc #666 #666 #ccc; } + .cmen { overflow: hidden; width: 63px; } + .cmen a { overflow: hidden; float:left; width: 20px; height: 20px; } + +.tb3{ margin-top:-15px; border:none; } + .tb3 th{ padding:10px 0 5px 20px; } + .tb3 td{ padding:0 0 0 20px; line-height:180%; } + +.mod_validate td, .mod_export td { background: #CFC !important; } +.mod_invalidate td, .mod_refusal td { background: #FFEBE7 !important; } +.mod_ignore td { background: #EEE !important; } +.mod_cancel td { background: #FFF !important; } +.mod_delete td { background: #F99 !important; } + +/* custom menu */ +.custom{ overflow:hidden; position:relative; border:6px solid #ccc; background:#FFF; } + .cmain{ padding:0; text-align: left; padding: 10px; } + .cnote{ line-height:20px; } + .cnote li{ float:left; margin-right:15px; } + .cmlist{ clear:left; overflow-y:auto; } + .cmlist a{ display: block; float: left; overflow: hidden; width: 150px; height: 20px; color:#666; } + .cmlist td { padding: 5px 0; border-bottom: 1px dotted #DEEFFB; } + .cmlist tr:last-child td { border-bottom: none; } + .cmlist h4{ color:#09C; width: 90px; } + .cside{ float:right; display:inline; margin-right:5px; width:151px; text-align:left; } + .cside h3{ position:relative; margin-bottom:0; padding:6px 0 0 5px; height:28px; line-height:28px; border-bottom:1px solid #A6C9D7; background:url(bg_custom_t.gif) repeat-x; } + .ctitle1{ display:block; padding-left:25px; height:28px; background:url(btn_add2menu.gif) no-repeat 0 5px; color:#090; } + .ctitle1:hover{ text-decoration:none; } + .cadmin{ position:absolute; top:-4px; right:-5px; padding:10px 10px 0; color:#666; font-weight:400; } + .cslist li{ height:1%; } + .cslist li a{ display:block; padding:5px 5px 5px 30px; } + .cslist li a:hover{ text-decoration:none; background:#DEEFFA; } + .cslist li .pages{ margin-left:27px; } + .cslist li .pages a{ display:inline; padding:2px 5px; } + .cslist li .pages a:hover{ background:#09C; } + .cfixbd{ position:absolute; right:5px; bottom:0; width:151px; height:5px; line-height:5px; font-size:1px; background:#FFF; overflow:hidden; } +/* list */ +.tpllist{ list-style:disc; margin:10px 15px; line-height:180%; } +.tpllist2{ list-style:circle; margin:5px 25px; } +.tpllist3{ list-style:square; margin:0 25px; } +.userlist{ overflow:hidden; margin:10px 0; } + .userlist li{ float:left; margin:0 10px 10px 0; white-space:nowrap; } + .unum{ clear:both; display:block; width:100%; font-weight:700; } +.safelist{ padding:10px 0; border-top:4px solid #DEEFFA; } + .safelist li{ margin-bottom:5px; padding-left:20px; line-height:160%; background:url(bg_repno.gif) no-repeat -340px 6px; } + .safelist p{ margin-bottom:5px; } + .safelist .txt{ width:150px; } +.infolist{} + .infolist li{ clear:both; line-height:180%; } + .infolist em{ float:left; width:120px; } +.tb2 .threadopt{ border-bottom:1px solid #B5CFD9; background:none; vertical-align:top; } +.threadtitle{ padding:10px !important; } +.nowrap li{ float:left; white-space:nowrap; margin-right:5px; } + +/* pages */ +.pg{ clear:both; margin:10px 0; } + .pg em, .pg a, .pg strong{ text-decoration:none; margin-left:3px; padding:5.25px 10px; border:1px solid #E5E5E5; vertical-align: middle;} + .pg a:hover{ text-decoration:none; border:1px solid #09C; background:#09C; color:#FFF; } + .pg strong{ border:none; font-weight:700; } + .pg kbd input{ margin-left:5px; width:45px; vertical-align:middle; } +.cuspages{ margin:3px 0; line-height:200%; } + .cuspages .pg{ display:inline; clear:none; margin-right:10px; } +.fixsel select{ margin:3px 5px 3px 0; } + +/* link */ +.addtr{ padding-left:17px; line-height:25px; background:url(bg_repno.gif) no-repeat 0 1px; *background:url(bg_repno.gif) no-repeat 0 0; color:#F60; } +.act{ margin:0 5px; text-decoration:underline; } +.addchildboard, .deleterow { margin-right: 5px; padding-left:17px; line-height:25px; *line-height: 16px; background:url(bg_repno.gif) no-repeat 0 -597px; color:#FFF; zoom: 1; } + .deleterow { padding-left: 12px; background: url(close.gif) no-repeat 0 50%; } + .addchildboard:hover, .deleterow:hover { text-decoration:none; color:#F60 !important; } +.switch{ color:#09C; } + .switch:hover{ text-decoration:none; } + .switch img{ margin-right:5px; vertical-align:middle; } +.lightlink{ color:#666; text-decoration:underline;} +.lightlink2{ color:#666; } +.parentlink{ color:#09C; text-decoration:underline; } +.menulink{ background:none !important; text-decoration:underline; } + .menulink:hover{ text-decoration:underline !important; } + +/* admincp default */ +.anno{ width:200px; } + .anno p{ margin:4px 0; } + .anno .txt{ margin-left:3px; width:105px; } +.difflink{ margin:10px 0; } + .difflink a{ margin-left:10px; color:#666; text-decoration:underline; } +.devteam{ width:350px; } + +/* widget */ +.checked, .checked .txt{ color:#0B0; } +.lightfont{ color:#CCC; } +.light, .light a{ color:#AAA; } +.lightnum{ color:#F60; } +.st-d .lightnum{ color:#fff; } +.error{ color:#F00; } +.diffcolor2{ color:#090; } +.diffcolor3{ color:#09C; } +.nomargin{ margin:0; } +.marginleft{ margin-left:20px; } +.marginleft10{ margin-left:10px; } +.marginright{ margin-right:10px; } +.margintop{ margin-top:10px; } +.marginbot{ margin-bottom:10px; } +.nobg, .nobg td{ background:none; } + .nobg .td27{ padding-left:5px; } +.nobottom{ margin-bottom:0px; } +.nobdb{ border-bottom:none; } +.nobdt{ border-top:none; } +.noborder, .noborder td{border-bottom:0; border-top:0; } + .noborder td:hover, .normalfont { color: #000; } + .st-d .noborder td:hover, .normalfont { color: #fff; } +.vtop{ vertical-align:top; } +.lineheight{ line-height:150%; } +.left{ float:left; } +.right{ float:right; align-self: flex-end; } +.center{ text-align:center; } +.bold{ font-weight:700; } +.normal{ font-weight:400; } +.clear{ clear:both; } +.smallfont{font-size:14px!important;} +.smallfont h3{ font-size:14px; } +.fixpadding th, .fixpadding td{ padding-left:20px !important; } +.notice { position: absolute; z-index: 100; width: 100%; } + .notice a { display: inline-block; padding: 5px 10px; border: solid #CCC; border-width: 0 1px 1px; background: #FEFEE9; color: red; box-shadow: 0 0 5px #B1B1B1; } + .notice a:hover { text-decoration: none; } + .notice span { margin-left: 20px; color: #09C; text-decoration: underline; } + +.news{ padding:10px 0; border-top:4px solid #DEEFFA; clear: both; } + .news li { list-style: none; } +#boardnews{ padding-bottom:10px; } + +.diff-deleted{ background:#FCC !important; } +.diff-changed{ background:#FF9 !important; } +.diff-added{ background:#CFC !important; } + +.verifyimg { max-height: 120px; } + +.dbox.hometop { flex-direction: row; width: 100%; } +.dbox.hometop .avt { width: 80px; height: 80px; margin-right: 24px; border: 2px solid #fff; border-radius: 3px; box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); } +.dbox.hometop .hinfo { flex-grow: 1; } +.dbox.hometop .hinfo h4 { font-size: 18px; margin-top: 14px; margin-bottom: 10px; } +.st-l .dbox.hometop .hinfo h4{color:#000;} +.st-d .dbox.hometop .hinfo h4{color:#666;} +.dbox.hometop .hinfo p { font-size: 14px; color: #666; } +.dbox .tb2 td{ padding:10px 5px 10px 0px;} +.dbox .tb2 th{ padding:10px 5px 10px 0px;} +.dbox .tb3 th{ padding:10px 0 5px; } +.dbox .tb3 td{ padding:0;} +.tipsbody { padding: 10px 20px; background: #b9edd5; color: #1f7244; } +.st-d .tipsbody { background: #0d7377; color: #323232; } +.tipsbody .difflink a { color: #1f7244; } +.st-d .tipsbody .difflink a { color: #323232; } +.tipsbody .tipicon { background: #fff; width: 32px; height: 32px; border-radius: 27px; margin-top: 3px; margin-right: 14px; padding: 6px; } +.st-d .tipsbody .tipicon { background: #000;} +#filecheck_div>div { display: flex; width: 100%; justify-content: space-between; margin-bottom: 10px; text-align: center; flex-wrap: wrap; } +#filecheck_div>div>em { padding: 0 18px 10px 18px; } +@media (max-width: 1660px) { + #filecheck_div>div>em { flex-basis: 50%; background: none; } +} +.adminnote { width: 200px; min-height: 200px; background: #f7f0b1; position: relative; margin-bottom: 20px; } +.adminnote>a { position: absolute; right: 0; top: 0; display: block; width: 16px; height: 16px; background-image: linear-gradient(45deg, #c9be3a 50%, #fff 50%); text-align: center; line-height: 16px; } +.adminnote>a:hover { background: #f7f0b1; text-decoration: none; } +.adminnote>a:hover::before { content: "\d7"; color: #163e69; font-weight: 700; } +.adminnote>div { padding: 10px; } +.team { display: flex; flex-wrap: wrap; flex-basis: calc(100% - 150px); } +.team a { flex-basis: 33%; min-width: 200px; } +.team span { flex-basis: 40%; min-width: 240px; } +.team.tm a { flex-basis: auto; min-width: auto; } + +/* forumlist */ +.forumheader { padding: 0px 20px;background: #fff;height:60px;line-height:60px; } +.st-d .forumheader { background: #000; } + +/* calendar */ +#calendar_week .dropmenu{ filter: none; opacity: 1; background: none; margin-left: 0;position:relative; margin-top:0; border:none; text-align:left; text-decoration:underline; display: inline; box-shadow: none; } +.calendar_checked, .calendar_checked a:link, .calendar_checked a:visited{ color:#333; } + +/* sub table */ +.sub, .sub .td27{ padding-left:35px !important; } +.sub .rowform{ padding-left:35px !important; width:281px; } + .sub .rowform .txt, .sub .rowform textarea{ width:225px; } + .sub select{ width:231px; } + +.mt10{margin-top: 10px;} +.mt0{margin-top:0} +.header, .header td, .header th{ border-top: 1px dotted #DEEFFB; font-weight: 700; } +.st-d .header, .st-d .header td, .st-d.header th{ border-top: 1px dotted #282828;} +.smallefont{font-size: 14px} + +/* 弹窗 */ +.fwin { text-align: left; background: #FFF; font-size: 12px; } +.t_l, .t_c, .t_r, .m_l, .m_r, .b_l, .b_c, .b_r { overflow: hidden; background: #ccc; } +.t_l, .t_r, .b_l, .b_r { width: 6px; height: 6px; line-height: 6px; font-size: 0; } +.t_c, .b_c { height: 6px; } +.m_l, .m_r { width: 6px; font-size: 1px; } +.m_c { background: #FFF; } +.m_c .tb { margin: 0 0 6px; padding: 0 6px; } +.m_c .c { padding: 0 6px 6px; } +.m_c .o { padding: 8px 6px; text-align: right; border-top: 1px solid #CCC; background: #F5F5F5; } +.m_c .o .btn { margin: 0; } + +.flb { padding: 10px 10px 8px; height: 20px; line-height: 20px; box-sizing: unset;} + .flb em { float: left; font-weight: 700; color: #09C; } + .flb em a { text-decoration: none; } + .flb span { float: right; color: #999; } + .flb span a, .flb strong { float: left; text-decoration: none; margin-left: 8px; font-weight: 400; color: #333; } + .flb span a:hover { color: #999; } + .flbc { float: left; width: 20px; height: 20px; overflow: hidden; background: #AAA; cursor: pointer; font-size: 16px; text-align: center; line-height: 20px; border-radius: 2px; } + .flbc:hover { background: #15afdb; text-decoration: none; } + .flbc:before { content: "\d7"; color: #fff; font-weight: 700; } + +.fwin .cl li { margin:5px; float: left; } +.fwin .cl li.a { font-weight: 700; } +.fwin .c { clear: both; } +.fwin .dt { width: 100%; } +.fwin .dt th, .fwin .dt td { border-bottom: 1px dotted #DEEFFB; line-height: 20px; } +.fwin .dt th { font-weight: 700; } +.fwin .ss em { background: #eee; width: 16px; line-height: 18px; display: block; float: left; margin: 2px; cursor: pointer; padding-left: 7px;} +.fwin .ss em.a { background: #09f; color: #FFF;} +#seocodes { word-break: break-word;} + +/* .cl --> Clear 自动闭合 */ +.cl:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.cl { zoom: 1; } + +.preview { margin-bottom: 20px; width: 100%; height: 340px; border: 1px solid #09C; box-shadow: 3px 3px 3px #EEE; -moz-box-shadow: 3px 3px 3px #EEE; -webkit-box-shadow: 3px 3px 3px #EEE; -o-box-shadow: 3px 3px 3px #EEE; } + + +/*气泡信息 by dfox */ +.prmm { margin-left: -27px; padding-top: 10px; width: 250px; background: transparent url(pm_ntc.gif) no-repeat 0 0; text-align: left; opacity: 0.98; } + .prmc { padding-bottom: 10px; background: transparent url(pm_ntc.gif) no-repeat -250px 100%; } + .prmm ul { padding: 0 10px; border: solid #91C8E2; border-width: 0 2px; background: #FFF; } + .prmm li { border-bottom: 1px solid #F4F4F4; line-height: 29px; display: block; width: 100%; color: #666; overflow: hidden; text-overflow: ellipsis; -webkit-text-overflow: ellipsis; -moz-text-overflow: ellipsis; -o-text-overflow: ellipsis; } + .prmm a:hover { text-decoration: none; color: #666; } +.up { padding-top: 0; padding-bottom: 10px; width: 150px; background-position: -500px 100%; } + .up .prmc { padding-top: 5px; padding-bottom: 0; background-position: -650px 0; } + .up li { border-bottom: none; line-height: 160%; } + +/* 通用的表单样式 */ + .tfm { width: 100%; } + .tfm caption, .tfm th, .tfm td { padding: 10px 2px; } + .tfm caption h2 { font-size: 18px; } + .vt th, .vt td { vertical-align: top; } + .tfm th { width: 95px; font-weight: 700; } + .tfm th .rq { float: right; } + .tfm .pt, .tfm .px { margin-right: 3px; width: 282px; } + .tfm .c, .tfm .tedt, .m_c .tfm .tedt { width: 290px; } + .tfm .d { clear: both; margin: 5px 0; color: {LIGHTTEXT}; } + .tfm .d em { margin-left: 5px; color: red; } + .tfm .d strong { margin-left: 5px; } + .tfm .p { text-align: right; } + .tfm .pcl label { display: block; padding: 0 2px 5px; } + .tfm .pcl .pc { margin-right: 5px; padding: 0; } + .tfm .l th, .tfm .l td { padding-top: 0; padding-bottom: 0; } + .bn .tfm caption, .bn .tfm th, .bn .tfm td { padding-top: 5px; padding-bottom: 5px; } + .bn .tfm th { font-weight: 400; } + +/* 普通数据列表 datatable by michael */ + +.dt { border-top: 1px solid #CDCDCD; width: 100%; } + .dt th { background: #F2F2F2; } + .dt td, .dt th { padding: 7px 4px; border-bottom: 1px solid #CDCDCD; } + .dt .c { width: 50px; } + .dt .px { height: 16px !important; } + + +/* 外边距 Margin,三组从窄到宽,级别分别为:n, m, w */ + .mtn { margin-top: 5px !important; } + .mbn { margin-bottom: 5px !important; } + .mtm { margin-top: 10px !important; } + .mbm { margin-bottom: 10px !important; } + .mtw { margin-top: 20px !important; } + .mbw { margin-bottom: 20px !important; } + +.psetting p { margin-top: 10px; } + .psetting .light, .psetting .light a { color: #777; } + .psetting a.memo { color: #999; margin-left: 20px; } + .psetting div.memo { margin:5px;padding: 5px; border: 1px dotted #DEEFFB; background: #FFF; } + .st-d .psetting div:hover { background: #333; } + +/* 进度条 */ +.pbg { position: relative; margin: 10px 0; width: 200px; height: 16px; background: url(bg_progressbar.png) 0 0 repeat-x; border-radius: 5px; } + .pbr { height: 16px; width: 200px; background-image: url(bg_progressbar.png); background-color: #5AAF4A; background-position: 0 -16px; background-repeat: repeat-x; border-radius: 5px; } + .pbg .xs0 { position: absolute; top: 0; right: 8px; } diff --git a/static/image/admincp/ajax_loader.gif b/static/image/admincp/ajax_loader.gif new file mode 100644 index 0000000..dc8bd3f Binary files /dev/null and b/static/image/admincp/ajax_loader.gif differ diff --git a/static/image/admincp/article.gif b/static/image/admincp/article.gif new file mode 100644 index 0000000..78ceee6 Binary files /dev/null and b/static/image/admincp/article.gif differ diff --git a/static/image/admincp/articlelist.gif b/static/image/admincp/articlelist.gif new file mode 100644 index 0000000..ee843e6 Binary files /dev/null and b/static/image/admincp/articlelist.gif differ diff --git a/static/image/admincp/bg_button.gif b/static/image/admincp/bg_button.gif new file mode 100644 index 0000000..0903d44 Binary files /dev/null and b/static/image/admincp/bg_button.gif differ diff --git a/static/image/admincp/bg_custom.gif b/static/image/admincp/bg_custom.gif new file mode 100644 index 0000000..9178daa Binary files /dev/null and b/static/image/admincp/bg_custom.gif differ diff --git a/static/image/admincp/bg_custom_t.gif b/static/image/admincp/bg_custom_t.gif new file mode 100644 index 0000000..c1f72b7 Binary files /dev/null and b/static/image/admincp/bg_custom_t.gif differ diff --git a/static/image/admincp/bg_header.gif b/static/image/admincp/bg_header.gif new file mode 100644 index 0000000..53aa19b Binary files /dev/null and b/static/image/admincp/bg_header.gif differ diff --git a/static/image/admincp/bg_input.gif b/static/image/admincp/bg_input.gif new file mode 100644 index 0000000..70ea42a Binary files /dev/null and b/static/image/admincp/bg_input.gif differ diff --git a/static/image/admincp/bg_list.gif b/static/image/admincp/bg_list.gif new file mode 100644 index 0000000..2edb5ca Binary files /dev/null and b/static/image/admincp/bg_list.gif differ diff --git a/static/image/admincp/bg_login.gif b/static/image/admincp/bg_login.gif new file mode 100644 index 0000000..8c1a5d2 Binary files /dev/null and b/static/image/admincp/bg_login.gif differ diff --git a/static/image/admincp/bg_menu.gif b/static/image/admincp/bg_menu.gif new file mode 100644 index 0000000..f763895 Binary files /dev/null and b/static/image/admincp/bg_menu.gif differ diff --git a/static/image/admincp/bg_menu2.gif b/static/image/admincp/bg_menu2.gif new file mode 100644 index 0000000..925ff56 Binary files /dev/null and b/static/image/admincp/bg_menu2.gif differ diff --git a/static/image/admincp/bg_progressbar.png b/static/image/admincp/bg_progressbar.png new file mode 100644 index 0000000..2cde34e Binary files /dev/null and b/static/image/admincp/bg_progressbar.png differ diff --git a/static/image/admincp/bg_repno.gif b/static/image/admincp/bg_repno.gif new file mode 100644 index 0000000..7455940 Binary files /dev/null and b/static/image/admincp/bg_repno.gif differ diff --git a/static/image/admincp/bg_repx.gif b/static/image/admincp/bg_repx.gif new file mode 100644 index 0000000..af49e4c Binary files /dev/null and b/static/image/admincp/bg_repx.gif differ diff --git a/static/image/admincp/bg_repx_h.gif b/static/image/admincp/bg_repx_h.gif new file mode 100644 index 0000000..76baf73 Binary files /dev/null and b/static/image/admincp/bg_repx_h.gif differ diff --git a/static/image/admincp/bg_repx_hb.gif b/static/image/admincp/bg_repx_hb.gif new file mode 100644 index 0000000..29fbe44 Binary files /dev/null and b/static/image/admincp/bg_repx_hb.gif differ diff --git a/static/image/admincp/bg_repx_hc.gif b/static/image/admincp/bg_repx_hc.gif new file mode 100644 index 0000000..f0708eb Binary files /dev/null and b/static/image/admincp/bg_repx_hc.gif differ diff --git a/static/image/admincp/bg_repx_hd.gif b/static/image/admincp/bg_repx_hd.gif new file mode 100644 index 0000000..288ee96 Binary files /dev/null and b/static/image/admincp/bg_repx_hd.gif differ diff --git a/static/image/admincp/blog.gif b/static/image/admincp/blog.gif new file mode 100644 index 0000000..56504e5 Binary files /dev/null and b/static/image/admincp/blog.gif differ diff --git a/static/image/admincp/btn_add2menu.gif b/static/image/admincp/btn_add2menu.gif new file mode 100644 index 0000000..4bbc217 Binary files /dev/null and b/static/image/admincp/btn_add2menu.gif differ diff --git a/static/image/admincp/btn_big.png b/static/image/admincp/btn_big.png new file mode 100644 index 0000000..6a217ba Binary files /dev/null and b/static/image/admincp/btn_big.png differ diff --git a/static/image/admincp/btn_block.gif b/static/image/admincp/btn_block.gif new file mode 100644 index 0000000..4bef258 Binary files /dev/null and b/static/image/admincp/btn_block.gif differ diff --git a/static/image/admincp/btn_block_2.gif b/static/image/admincp/btn_block_2.gif new file mode 100644 index 0000000..4471bf9 Binary files /dev/null and b/static/image/admincp/btn_block_2.gif differ diff --git a/static/image/admincp/btn_block_3.gif b/static/image/admincp/btn_block_3.gif new file mode 100644 index 0000000..f1b8d00 Binary files /dev/null and b/static/image/admincp/btn_block_3.gif differ diff --git a/static/image/admincp/btn_map.gif b/static/image/admincp/btn_map.gif new file mode 100644 index 0000000..25932bc Binary files /dev/null and b/static/image/admincp/btn_map.gif differ diff --git a/static/image/admincp/close.gif b/static/image/admincp/close.gif new file mode 100644 index 0000000..172a119 Binary files /dev/null and b/static/image/admincp/close.gif differ diff --git a/static/image/admincp/cls.gif b/static/image/admincp/cls.gif new file mode 100644 index 0000000..f3e30ac Binary files /dev/null and b/static/image/admincp/cls.gif differ diff --git a/static/image/admincp/color.jpg b/static/image/admincp/color.jpg new file mode 100644 index 0000000..ec503e2 Binary files /dev/null and b/static/image/admincp/color.jpg differ diff --git a/static/image/admincp/cornerbanner.gif b/static/image/admincp/cornerbanner.gif new file mode 100644 index 0000000..9c07255 Binary files /dev/null and b/static/image/admincp/cornerbanner.gif differ diff --git a/static/image/admincp/couplebanner.gif b/static/image/admincp/couplebanner.gif new file mode 100644 index 0000000..9b2e44d Binary files /dev/null and b/static/image/admincp/couplebanner.gif differ diff --git a/static/image/admincp/custom.gif b/static/image/admincp/custom.gif new file mode 100644 index 0000000..d8a0eaa Binary files /dev/null and b/static/image/admincp/custom.gif differ diff --git a/static/image/admincp/desc.gif b/static/image/admincp/desc.gif new file mode 100644 index 0000000..6f5df6f Binary files /dev/null and b/static/image/admincp/desc.gif differ diff --git a/static/image/admincp/discuz_qr.jpg b/static/image/admincp/discuz_qr.jpg new file mode 100644 index 0000000..1d1eb93 Binary files /dev/null and b/static/image/admincp/discuz_qr.jpg differ diff --git a/static/image/admincp/faq.gif b/static/image/admincp/faq.gif new file mode 100644 index 0000000..f80eb63 Binary files /dev/null and b/static/image/admincp/faq.gif differ diff --git a/static/image/admincp/feed.gif b/static/image/admincp/feed.gif new file mode 100644 index 0000000..dd1e379 Binary files /dev/null and b/static/image/admincp/feed.gif differ diff --git a/static/image/admincp/float.gif b/static/image/admincp/float.gif new file mode 100644 index 0000000..b1b5053 Binary files /dev/null and b/static/image/admincp/float.gif differ diff --git a/static/image/admincp/footerbanner.gif b/static/image/admincp/footerbanner.gif new file mode 100644 index 0000000..54701cd Binary files /dev/null and b/static/image/admincp/footerbanner.gif differ diff --git a/static/image/admincp/getcolor.htm b/static/image/admincp/getcolor.htm new file mode 100644 index 0000000..927e8d0 --- /dev/null +++ b/static/image/admincp/getcolor.htm @@ -0,0 +1,67 @@ + + + + +
            +
            + + \ No newline at end of file diff --git a/static/image/admincp/headerbanner.gif b/static/image/admincp/headerbanner.gif new file mode 100644 index 0000000..dfab633 Binary files /dev/null and b/static/image/admincp/headerbanner.gif differ diff --git a/static/image/admincp/index.htm b/static/image/admincp/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/admincp/intercat.gif b/static/image/admincp/intercat.gif new file mode 100644 index 0000000..90a449c Binary files /dev/null and b/static/image/admincp/intercat.gif differ diff --git a/static/image/admincp/interthread.gif b/static/image/admincp/interthread.gif new file mode 100644 index 0000000..24b34ae Binary files /dev/null and b/static/image/admincp/interthread.gif differ diff --git a/static/image/admincp/login_header.gif b/static/image/admincp/login_header.gif new file mode 100644 index 0000000..cfa1427 Binary files /dev/null and b/static/image/admincp/login_header.gif differ diff --git a/static/image/admincp/login_title.gif b/static/image/admincp/login_title.gif new file mode 100644 index 0000000..255adbd Binary files /dev/null and b/static/image/admincp/login_title.gif differ diff --git a/static/image/admincp/loginbg.svg b/static/image/admincp/loginbg.svg new file mode 100644 index 0000000..fc327df --- /dev/null +++ b/static/image/admincp/loginbg.svg @@ -0,0 +1,4 @@ + + + + diff --git a/static/image/admincp/logo.gif b/static/image/admincp/logo.gif new file mode 100644 index 0000000..650c71d Binary files /dev/null and b/static/image/admincp/logo.gif differ diff --git a/static/image/admincp/logo.svg b/static/image/admincp/logo.svg new file mode 100644 index 0000000..96f22ad --- /dev/null +++ b/static/image/admincp/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/admincp/logo_hover.gif b/static/image/admincp/logo_hover.gif new file mode 100644 index 0000000..0f259c3 Binary files /dev/null and b/static/image/admincp/logo_hover.gif differ diff --git a/static/image/admincp/minireset.css b/static/image/admincp/minireset.css new file mode 100644 index 0000000..a36647d --- /dev/null +++ b/static/image/admincp/minireset.css @@ -0,0 +1,47 @@ +html, body, p, ol, ul, li, dl, dt, dd, blockquote, figure, fieldset, legend, textarea, pre, iframe, hr, h1, h2, h3, h4, h5, h6 { + margin: 0; + padding: 0 +} + +h1, h2, h3, h4, h5, h6 { + font-size: 100%; + font-weight: normal +} + +ul { + list-style: none +} + +button, input, select, textarea { + margin: 0 +} + +html { + box-sizing: border-box +} + +img, video { + height: auto; + max-width: 100% +} + +iframe { + border: 0 +} + +table { + border-collapse: collapse; + border-spacing: 0 +} + +td, th { + padding: 0 +} + +td:not([align]), th:not([align]) { + text-align: left +} + +img, svg { + vertical-align: bottom +} \ No newline at end of file diff --git a/static/image/admincp/newwin.gif b/static/image/admincp/newwin.gif new file mode 100644 index 0000000..df1aa78 Binary files /dev/null and b/static/image/admincp/newwin.gif differ diff --git a/static/image/admincp/plugin_logo.png b/static/image/admincp/plugin_logo.png new file mode 100644 index 0000000..3e440cb Binary files /dev/null and b/static/image/admincp/plugin_logo.png differ diff --git a/static/image/admincp/pm_ntc.gif b/static/image/admincp/pm_ntc.gif new file mode 100644 index 0000000..03ffc88 Binary files /dev/null and b/static/image/admincp/pm_ntc.gif differ diff --git a/static/image/admincp/process.gif b/static/image/admincp/process.gif new file mode 100644 index 0000000..17dca8e Binary files /dev/null and b/static/image/admincp/process.gif differ diff --git a/static/image/admincp/processbg.gif b/static/image/admincp/processbg.gif new file mode 100644 index 0000000..2882a78 Binary files /dev/null and b/static/image/admincp/processbg.gif differ diff --git a/static/image/admincp/scrolld.gif b/static/image/admincp/scrolld.gif new file mode 100644 index 0000000..be9b4f2 Binary files /dev/null and b/static/image/admincp/scrolld.gif differ diff --git a/static/image/admincp/scrollu.gif b/static/image/admincp/scrollu.gif new file mode 100644 index 0000000..19261a1 Binary files /dev/null and b/static/image/admincp/scrollu.gif differ diff --git a/static/image/admincp/search.gif b/static/image/admincp/search.gif new file mode 100644 index 0000000..0b537c8 Binary files /dev/null and b/static/image/admincp/search.gif differ diff --git a/static/image/admincp/stylepreview.gif b/static/image/admincp/stylepreview.gif new file mode 100644 index 0000000..bb8d9a1 Binary files /dev/null and b/static/image/admincp/stylepreview.gif differ diff --git a/static/image/admincp/subnavbanner.gif b/static/image/admincp/subnavbanner.gif new file mode 100644 index 0000000..6ae802c Binary files /dev/null and b/static/image/admincp/subnavbanner.gif differ diff --git a/static/image/admincp/text.gif b/static/image/admincp/text.gif new file mode 100644 index 0000000..8367bf0 Binary files /dev/null and b/static/image/admincp/text.gif differ diff --git a/static/image/admincp/thread.gif b/static/image/admincp/thread.gif new file mode 100644 index 0000000..057172d Binary files /dev/null and b/static/image/admincp/thread.gif differ diff --git a/static/image/admincp/threadlist.gif b/static/image/admincp/threadlist.gif new file mode 100644 index 0000000..617d673 Binary files /dev/null and b/static/image/admincp/threadlist.gif differ diff --git a/static/image/admincp/transcolor.gif b/static/image/admincp/transcolor.gif new file mode 100644 index 0000000..0d9d46f Binary files /dev/null and b/static/image/admincp/transcolor.gif differ diff --git a/static/image/admincp/transparent.gif b/static/image/admincp/transparent.gif new file mode 100644 index 0000000..430d9fa Binary files /dev/null and b/static/image/admincp/transparent.gif differ diff --git a/static/image/admincp/watermarkpreview.jpg b/static/image/admincp/watermarkpreview.jpg new file mode 100644 index 0000000..e96aefe Binary files /dev/null and b/static/image/admincp/watermarkpreview.jpg differ diff --git a/static/image/click/gaoxiao.gif b/static/image/click/gaoxiao.gif new file mode 100644 index 0000000..9c9ed5c Binary files /dev/null and b/static/image/click/gaoxiao.gif differ diff --git a/static/image/click/index.htm b/static/image/click/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/click/jidan.gif b/static/image/click/jidan.gif new file mode 100644 index 0000000..3a7b5eb Binary files /dev/null and b/static/image/click/jidan.gif differ diff --git a/static/image/click/kubi.gif b/static/image/click/kubi.gif new file mode 100644 index 0000000..db023b8 Binary files /dev/null and b/static/image/click/kubi.gif differ diff --git a/static/image/click/leiren.gif b/static/image/click/leiren.gif new file mode 100644 index 0000000..410fdb0 Binary files /dev/null and b/static/image/click/leiren.gif differ diff --git a/static/image/click/luguo.gif b/static/image/click/luguo.gif new file mode 100644 index 0000000..a5e3c49 Binary files /dev/null and b/static/image/click/luguo.gif differ diff --git a/static/image/click/mihuo.gif b/static/image/click/mihuo.gif new file mode 100644 index 0000000..0a493f4 Binary files /dev/null and b/static/image/click/mihuo.gif differ diff --git a/static/image/click/piaoliang.gif b/static/image/click/piaoliang.gif new file mode 100644 index 0000000..323032f Binary files /dev/null and b/static/image/click/piaoliang.gif differ diff --git a/static/image/click/woshou.gif b/static/image/click/woshou.gif new file mode 100644 index 0000000..08cfdbf Binary files /dev/null and b/static/image/click/woshou.gif differ diff --git a/static/image/click/xianhua.gif b/static/image/click/xianhua.gif new file mode 100644 index 0000000..652ad4a Binary files /dev/null and b/static/image/click/xianhua.gif differ diff --git a/static/image/common/Google_small.png b/static/image/common/Google_small.png new file mode 100644 index 0000000..8cd0e97 Binary files /dev/null and b/static/image/common/Google_small.png differ diff --git a/static/image/common/access_allow.gif b/static/image/common/access_allow.gif new file mode 100644 index 0000000..afd3f86 Binary files /dev/null and b/static/image/common/access_allow.gif differ diff --git a/static/image/common/access_disallow.gif b/static/image/common/access_disallow.gif new file mode 100644 index 0000000..37b0b56 Binary files /dev/null and b/static/image/common/access_disallow.gif differ diff --git a/static/image/common/access_normal.gif b/static/image/common/access_normal.gif new file mode 100644 index 0000000..b107827 Binary files /dev/null and b/static/image/common/access_normal.gif differ diff --git a/static/image/common/activitysmall.gif b/static/image/common/activitysmall.gif new file mode 100644 index 0000000..c897a72 Binary files /dev/null and b/static/image/common/activitysmall.gif differ diff --git a/static/image/common/ad.gif b/static/image/common/ad.gif new file mode 100644 index 0000000..7b9c706 Binary files /dev/null and b/static/image/common/ad.gif differ diff --git a/static/image/common/ad_close.gif b/static/image/common/ad_close.gif new file mode 100644 index 0000000..fa16bf0 Binary files /dev/null and b/static/image/common/ad_close.gif differ diff --git a/static/image/common/addbuddy.gif b/static/image/common/addbuddy.gif new file mode 100644 index 0000000..2de7313 Binary files /dev/null and b/static/image/common/addbuddy.gif differ diff --git a/static/image/common/addicn.gif b/static/image/common/addicn.gif new file mode 100644 index 0000000..47c1ace Binary files /dev/null and b/static/image/common/addicn.gif differ diff --git a/static/image/common/agree.gif b/static/image/common/agree.gif new file mode 100644 index 0000000..733314b Binary files /dev/null and b/static/image/common/agree.gif differ diff --git a/static/image/common/alipay_logo.svg b/static/image/common/alipay_logo.svg new file mode 100644 index 0000000..ba12324 --- /dev/null +++ b/static/image/common/alipay_logo.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/static/image/common/andriod.png b/static/image/common/andriod.png new file mode 100644 index 0000000..5d8daf3 Binary files /dev/null and b/static/image/common/andriod.png differ diff --git a/static/image/common/ann_icon.gif b/static/image/common/ann_icon.gif new file mode 100644 index 0000000..cc419b0 Binary files /dev/null and b/static/image/common/ann_icon.gif differ diff --git a/static/image/common/annpm.png b/static/image/common/annpm.png new file mode 100644 index 0000000..52fe21c Binary files /dev/null and b/static/image/common/annpm.png differ diff --git a/static/image/common/app.png b/static/image/common/app.png new file mode 100644 index 0000000..2feb9ab Binary files /dev/null and b/static/image/common/app.png differ diff --git a/static/image/common/app_add.gif b/static/image/common/app_add.gif new file mode 100644 index 0000000..c244e15 Binary files /dev/null and b/static/image/common/app_add.gif differ diff --git a/static/image/common/app_set.gif b/static/image/common/app_set.gif new file mode 100644 index 0000000..762aa70 Binary files /dev/null and b/static/image/common/app_set.gif differ diff --git a/static/image/common/apphot.png b/static/image/common/apphot.png new file mode 100644 index 0000000..7f0d938 Binary files /dev/null and b/static/image/common/apphot.png differ diff --git a/static/image/common/appnew.png b/static/image/common/appnew.png new file mode 100644 index 0000000..6b744cd Binary files /dev/null and b/static/image/common/appnew.png differ diff --git a/static/image/common/appsetting.gif b/static/image/common/appsetting.gif new file mode 100644 index 0000000..1f4362d Binary files /dev/null and b/static/image/common/appsetting.gif differ diff --git a/static/image/common/arr_w.gif b/static/image/common/arr_w.gif new file mode 100644 index 0000000..07adb5b Binary files /dev/null and b/static/image/common/arr_w.gif differ diff --git a/static/image/common/arrow.gif b/static/image/common/arrow.gif new file mode 100644 index 0000000..38474e4 Binary files /dev/null and b/static/image/common/arrow.gif differ diff --git a/static/image/common/arrow_down.gif b/static/image/common/arrow_down.gif new file mode 100644 index 0000000..7055931 Binary files /dev/null and b/static/image/common/arrow_down.gif differ diff --git a/static/image/common/arrow_down_big.gif b/static/image/common/arrow_down_big.gif new file mode 100644 index 0000000..0bab7c8 Binary files /dev/null and b/static/image/common/arrow_down_big.gif differ diff --git a/static/image/common/arrow_left.gif b/static/image/common/arrow_left.gif new file mode 100644 index 0000000..f2ebb0f Binary files /dev/null and b/static/image/common/arrow_left.gif differ diff --git a/static/image/common/arrow_right.gif b/static/image/common/arrow_right.gif new file mode 100644 index 0000000..460e396 Binary files /dev/null and b/static/image/common/arrow_right.gif differ diff --git a/static/image/common/arrow_right_big.gif b/static/image/common/arrow_right_big.gif new file mode 100644 index 0000000..6e32234 Binary files /dev/null and b/static/image/common/arrow_right_big.gif differ diff --git a/static/image/common/arrow_top.gif b/static/image/common/arrow_top.gif new file mode 100644 index 0000000..030f672 Binary files /dev/null and b/static/image/common/arrow_top.gif differ diff --git a/static/image/common/arrow_up.png b/static/image/common/arrow_up.png new file mode 100644 index 0000000..ae34d5c Binary files /dev/null and b/static/image/common/arrow_up.png differ diff --git a/static/image/common/arrow_up_hover.png b/static/image/common/arrow_up_hover.png new file mode 100644 index 0000000..1022b9a Binary files /dev/null and b/static/image/common/arrow_up_hover.png differ diff --git a/static/image/common/arrwd.gif b/static/image/common/arrwd.gif new file mode 100644 index 0000000..7055931 Binary files /dev/null and b/static/image/common/arrwd.gif differ diff --git a/static/image/common/arw.gif b/static/image/common/arw.gif new file mode 100644 index 0000000..faeda34 Binary files /dev/null and b/static/image/common/arw.gif differ diff --git a/static/image/common/arw_d.gif b/static/image/common/arw_d.gif new file mode 100644 index 0000000..c4b8568 Binary files /dev/null and b/static/image/common/arw_d.gif differ diff --git a/static/image/common/arw_d2.gif b/static/image/common/arw_d2.gif new file mode 100644 index 0000000..2ca8a09 Binary files /dev/null and b/static/image/common/arw_d2.gif differ diff --git a/static/image/common/arw_l.gif b/static/image/common/arw_l.gif new file mode 100644 index 0000000..74dca9d Binary files /dev/null and b/static/image/common/arw_l.gif differ diff --git a/static/image/common/arw_r.gif b/static/image/common/arw_r.gif new file mode 100644 index 0000000..eeeafdc Binary files /dev/null and b/static/image/common/arw_r.gif differ diff --git a/static/image/common/atarget.png b/static/image/common/atarget.png new file mode 100644 index 0000000..df28a45 Binary files /dev/null and b/static/image/common/atarget.png differ diff --git a/static/image/common/attach_nopermission.png b/static/image/common/attach_nopermission.png new file mode 100644 index 0000000..e71c545 Binary files /dev/null and b/static/image/common/attach_nopermission.png differ diff --git a/static/image/common/attach_nopermission.svg b/static/image/common/attach_nopermission.svg new file mode 100644 index 0000000..8ae2805 --- /dev/null +++ b/static/image/common/attach_nopermission.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/image/common/attach_nopermission_bg.png b/static/image/common/attach_nopermission_bg.png new file mode 100644 index 0000000..eeb1912 Binary files /dev/null and b/static/image/common/attach_nopermission_bg.png differ diff --git a/static/image/common/attach_nopermission_bg.svg b/static/image/common/attach_nopermission_bg.svg new file mode 100644 index 0000000..6d168db --- /dev/null +++ b/static/image/common/attach_nopermission_bg.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/image/common/attachimg.gif b/static/image/common/attachimg.gif new file mode 100644 index 0000000..ba2a836 Binary files /dev/null and b/static/image/common/attachimg.gif differ diff --git a/static/image/common/attachimg_2.png b/static/image/common/attachimg_2.png new file mode 100644 index 0000000..2ad79ca Binary files /dev/null and b/static/image/common/attachimg_2.png differ diff --git a/static/image/common/attachinfobg.gif b/static/image/common/attachinfobg.gif new file mode 100644 index 0000000..b1d3cbf Binary files /dev/null and b/static/image/common/attachinfobg.gif differ diff --git a/static/image/common/attachmediacode.gif b/static/image/common/attachmediacode.gif new file mode 100644 index 0000000..97fab7e Binary files /dev/null and b/static/image/common/attachmediacode.gif differ diff --git a/static/image/common/attachurl.gif b/static/image/common/attachurl.gif new file mode 100644 index 0000000..4fef54c Binary files /dev/null and b/static/image/common/attachurl.gif differ diff --git a/static/image/common/atten.gif b/static/image/common/atten.gif new file mode 100644 index 0000000..f1e60cd Binary files /dev/null and b/static/image/common/atten.gif differ diff --git a/static/image/common/attention.gif b/static/image/common/attention.gif new file mode 100644 index 0000000..f1e60cd Binary files /dev/null and b/static/image/common/attention.gif differ diff --git a/static/image/common/attinbg.gif b/static/image/common/attinbg.gif new file mode 100644 index 0000000..f97cfc8 Binary files /dev/null and b/static/image/common/attinbg.gif differ diff --git a/static/image/common/attl_icon.png b/static/image/common/attl_icon.png new file mode 100644 index 0000000..1bf4f5e Binary files /dev/null and b/static/image/common/attl_icon.png differ diff --git a/static/image/common/avatar_blank.gif b/static/image/common/avatar_blank.gif new file mode 100644 index 0000000..a505413 Binary files /dev/null and b/static/image/common/avatar_blank.gif differ diff --git a/static/image/common/back.gif b/static/image/common/back.gif new file mode 100644 index 0000000..e57169a Binary files /dev/null and b/static/image/common/back.gif differ diff --git a/static/image/common/background.png b/static/image/common/background.png new file mode 100644 index 0000000..62f412e Binary files /dev/null and b/static/image/common/background.png differ diff --git a/static/image/common/bb_fly.gif b/static/image/common/bb_fly.gif new file mode 100644 index 0000000..72f5a64 Binary files /dev/null and b/static/image/common/bb_fly.gif differ diff --git a/static/image/common/bb_qq.gif b/static/image/common/bb_qq.gif new file mode 100644 index 0000000..129f21c Binary files /dev/null and b/static/image/common/bb_qq.gif differ diff --git a/static/image/common/bb_sub.gif b/static/image/common/bb_sub.gif new file mode 100644 index 0000000..2e5fb8a Binary files /dev/null and b/static/image/common/bb_sub.gif differ diff --git a/static/image/common/bb_sup.gif b/static/image/common/bb_sup.gif new file mode 100644 index 0000000..6147461 Binary files /dev/null and b/static/image/common/bb_sup.gif differ diff --git a/static/image/common/bbs.ico b/static/image/common/bbs.ico new file mode 100644 index 0000000..b05ee8f Binary files /dev/null and b/static/image/common/bbs.ico differ diff --git a/static/image/common/bg.png b/static/image/common/bg.png new file mode 100644 index 0000000..10afee4 Binary files /dev/null and b/static/image/common/bg.png differ diff --git a/static/image/common/bg_doing.png b/static/image/common/bg_doing.png new file mode 100644 index 0000000..aa9fdd9 Binary files /dev/null and b/static/image/common/bg_doing.png differ diff --git a/static/image/common/bg_doing_ico.jpg b/static/image/common/bg_doing_ico.jpg new file mode 100644 index 0000000..44be7b8 Binary files /dev/null and b/static/image/common/bg_doing_ico.jpg differ diff --git a/static/image/common/bg_home.png b/static/image/common/bg_home.png new file mode 100644 index 0000000..97d440d Binary files /dev/null and b/static/image/common/bg_home.png differ diff --git a/static/image/common/bg_share.png b/static/image/common/bg_share.png new file mode 100644 index 0000000..b446c71 Binary files /dev/null and b/static/image/common/bg_share.png differ diff --git a/static/image/common/bg_usergroup.png b/static/image/common/bg_usergroup.png new file mode 100644 index 0000000..f03e928 Binary files /dev/null and b/static/image/common/bg_usergroup.png differ diff --git a/static/image/common/bg_waterfall.png b/static/image/common/bg_waterfall.png new file mode 100644 index 0000000..2b43581 Binary files /dev/null and b/static/image/common/bg_waterfall.png differ diff --git a/static/image/common/bigimg.png b/static/image/common/bigimg.png new file mode 100644 index 0000000..a114dae Binary files /dev/null and b/static/image/common/bigimg.png differ diff --git a/static/image/common/bodybg.gif b/static/image/common/bodybg.gif new file mode 100644 index 0000000..6372de8 Binary files /dev/null and b/static/image/common/bodybg.gif differ diff --git a/static/image/common/btnS.png b/static/image/common/btnS.png new file mode 100644 index 0000000..8cd729c Binary files /dev/null and b/static/image/common/btnS.png differ diff --git a/static/image/common/cancelbutton.gif b/static/image/common/cancelbutton.gif new file mode 100644 index 0000000..eab2a40 Binary files /dev/null and b/static/image/common/cancelbutton.gif differ diff --git a/static/image/common/card.png b/static/image/common/card.png new file mode 100644 index 0000000..bb1099b Binary files /dev/null and b/static/image/common/card.png differ diff --git a/static/image/common/card_btn.png b/static/image/common/card_btn.png new file mode 100644 index 0000000..3871253 Binary files /dev/null and b/static/image/common/card_btn.png differ diff --git a/static/image/common/category_lbg.png b/static/image/common/category_lbg.png new file mode 100644 index 0000000..ace4835 Binary files /dev/null and b/static/image/common/category_lbg.png differ diff --git a/static/image/common/chart.png b/static/image/common/chart.png new file mode 100644 index 0000000..6be6f58 Binary files /dev/null and b/static/image/common/chart.png differ diff --git a/static/image/common/check_error.gif b/static/image/common/check_error.gif new file mode 100644 index 0000000..ebe17fc Binary files /dev/null and b/static/image/common/check_error.gif differ diff --git a/static/image/common/check_right.gif b/static/image/common/check_right.gif new file mode 100644 index 0000000..5c78bfd Binary files /dev/null and b/static/image/common/check_right.gif differ diff --git a/static/image/common/clck.gif b/static/image/common/clck.gif new file mode 100644 index 0000000..6d4ecec Binary files /dev/null and b/static/image/common/clck.gif differ diff --git a/static/image/common/clock.gif b/static/image/common/clock.gif new file mode 100644 index 0000000..01824c1 Binary files /dev/null and b/static/image/common/clock.gif differ diff --git a/static/image/common/close-s.png b/static/image/common/close-s.png new file mode 100644 index 0000000..169a5e1 Binary files /dev/null and b/static/image/common/close-s.png differ diff --git a/static/image/common/close.gif b/static/image/common/close.gif new file mode 100644 index 0000000..98c935e Binary files /dev/null and b/static/image/common/close.gif differ diff --git a/static/image/common/closed.png b/static/image/common/closed.png new file mode 100644 index 0000000..615a29e Binary files /dev/null and b/static/image/common/closed.png differ diff --git a/static/image/common/cls.gif b/static/image/common/cls.gif new file mode 100644 index 0000000..f3e30ac Binary files /dev/null and b/static/image/common/cls.gif differ diff --git a/static/image/common/cmmnt.gif b/static/image/common/cmmnt.gif new file mode 100644 index 0000000..ece1a9f Binary files /dev/null and b/static/image/common/cmmnt.gif differ diff --git a/static/image/common/cmt_ico.png b/static/image/common/cmt_ico.png new file mode 100644 index 0000000..e903ebb Binary files /dev/null and b/static/image/common/cmt_ico.png differ diff --git a/static/image/common/code_bg.png b/static/image/common/code_bg.png new file mode 100644 index 0000000..23ece9a Binary files /dev/null and b/static/image/common/code_bg.png differ diff --git a/static/image/common/codebg.gif b/static/image/common/codebg.gif new file mode 100644 index 0000000..e042008 Binary files /dev/null and b/static/image/common/codebg.gif differ diff --git a/static/image/common/collapsed_no.gif b/static/image/common/collapsed_no.gif new file mode 100644 index 0000000..f9f1e9c Binary files /dev/null and b/static/image/common/collapsed_no.gif differ diff --git a/static/image/common/collapsed_yes.gif b/static/image/common/collapsed_yes.gif new file mode 100644 index 0000000..5a43b35 Binary files /dev/null and b/static/image/common/collapsed_yes.gif differ diff --git a/static/image/common/collection.png b/static/image/common/collection.png new file mode 100644 index 0000000..4dc67f7 Binary files /dev/null and b/static/image/common/collection.png differ diff --git a/static/image/common/connect_avatar.png b/static/image/common/connect_avatar.png new file mode 100644 index 0000000..8102881 Binary files /dev/null and b/static/image/common/connect_avatar.png differ diff --git a/static/image/common/connect_config_mark.png b/static/image/common/connect_config_mark.png new file mode 100644 index 0000000..4d1faa4 Binary files /dev/null and b/static/image/common/connect_config_mark.png differ diff --git a/static/image/common/connect_post_syn.png b/static/image/common/connect_post_syn.png new file mode 100644 index 0000000..c178486 Binary files /dev/null and b/static/image/common/connect_post_syn.png differ diff --git a/static/image/common/connect_qq.gif b/static/image/common/connect_qq.gif new file mode 100644 index 0000000..f2df2d9 Binary files /dev/null and b/static/image/common/connect_qq.gif differ diff --git a/static/image/common/control_l.png b/static/image/common/control_l.png new file mode 100644 index 0000000..c6a3745 Binary files /dev/null and b/static/image/common/control_l.png differ diff --git a/static/image/common/control_r.png b/static/image/common/control_r.png new file mode 100644 index 0000000..5ff0f30 Binary files /dev/null and b/static/image/common/control_r.png differ diff --git a/static/image/common/copy.png b/static/image/common/copy.png new file mode 100644 index 0000000..8a577d0 Binary files /dev/null and b/static/image/common/copy.png differ diff --git a/static/image/common/create_group.png b/static/image/common/create_group.png new file mode 100644 index 0000000..b5bcb55 Binary files /dev/null and b/static/image/common/create_group.png differ diff --git a/static/image/common/dash.gif b/static/image/common/dash.gif new file mode 100644 index 0000000..b78cb68 Binary files /dev/null and b/static/image/common/dash.gif differ diff --git a/static/image/common/data_invalid.gif b/static/image/common/data_invalid.gif new file mode 100644 index 0000000..25740d1 Binary files /dev/null and b/static/image/common/data_invalid.gif differ diff --git a/static/image/common/data_valid.gif b/static/image/common/data_valid.gif new file mode 100644 index 0000000..918a2c3 Binary files /dev/null and b/static/image/common/data_valid.gif differ diff --git a/static/image/common/date_magnify.png b/static/image/common/date_magnify.png new file mode 100644 index 0000000..a0efd1f Binary files /dev/null and b/static/image/common/date_magnify.png differ diff --git a/static/image/common/debate_bg.gif b/static/image/common/debate_bg.gif new file mode 100644 index 0000000..038bf02 Binary files /dev/null and b/static/image/common/debate_bg.gif differ diff --git a/static/image/common/debate_chart.gif b/static/image/common/debate_chart.gif new file mode 100644 index 0000000..1738ab3 Binary files /dev/null and b/static/image/common/debate_chart.gif differ diff --git a/static/image/common/debate_dr.jpg b/static/image/common/debate_dr.jpg new file mode 100644 index 0000000..3089af7 Binary files /dev/null and b/static/image/common/debate_dr.jpg differ diff --git a/static/image/common/debate_vs.gif b/static/image/common/debate_vs.gif new file mode 100644 index 0000000..d78f439 Binary files /dev/null and b/static/image/common/debate_vs.gif differ diff --git a/static/image/common/debatesmall.gif b/static/image/common/debatesmall.gif new file mode 100644 index 0000000..b72c593 Binary files /dev/null and b/static/image/common/debatesmall.gif differ diff --git a/static/image/common/digest_1.gif b/static/image/common/digest_1.gif new file mode 100644 index 0000000..68d6233 Binary files /dev/null and b/static/image/common/digest_1.gif differ diff --git a/static/image/common/digest_2.gif b/static/image/common/digest_2.gif new file mode 100644 index 0000000..447761b Binary files /dev/null and b/static/image/common/digest_2.gif differ diff --git a/static/image/common/digest_3.gif b/static/image/common/digest_3.gif new file mode 100644 index 0000000..b107c6d Binary files /dev/null and b/static/image/common/digest_3.gif differ diff --git a/static/image/common/disagree.gif b/static/image/common/disagree.gif new file mode 100644 index 0000000..4761c28 Binary files /dev/null and b/static/image/common/disagree.gif differ diff --git a/static/image/common/dot.gif b/static/image/common/dot.gif new file mode 100644 index 0000000..d7d40c7 Binary files /dev/null and b/static/image/common/dot.gif differ diff --git a/static/image/common/dot_c.gif b/static/image/common/dot_c.gif new file mode 100644 index 0000000..d3f57ea Binary files /dev/null and b/static/image/common/dot_c.gif differ diff --git a/static/image/common/drag.gif b/static/image/common/drag.gif new file mode 100644 index 0000000..cbbf56c Binary files /dev/null and b/static/image/common/drag.gif differ diff --git a/static/image/common/dzicon.eot b/static/image/common/dzicon.eot new file mode 100644 index 0000000..97418ae Binary files /dev/null and b/static/image/common/dzicon.eot differ diff --git a/static/image/common/dzicon.woff b/static/image/common/dzicon.woff new file mode 100644 index 0000000..6e774d2 Binary files /dev/null and b/static/image/common/dzicon.woff differ diff --git a/static/image/common/dzicon.woff2 b/static/image/common/dzicon.woff2 new file mode 100644 index 0000000..80490da Binary files /dev/null and b/static/image/common/dzicon.woff2 differ diff --git a/static/image/common/edit.gif b/static/image/common/edit.gif new file mode 100644 index 0000000..5a272be Binary files /dev/null and b/static/image/common/edit.gif differ diff --git a/static/image/common/emp.gif b/static/image/common/emp.gif new file mode 100644 index 0000000..099c95f Binary files /dev/null and b/static/image/common/emp.gif differ diff --git a/static/image/common/error.gif b/static/image/common/error.gif new file mode 100644 index 0000000..05a7369 Binary files /dev/null and b/static/image/common/error.gif differ diff --git a/static/image/common/extstyle_none.css b/static/image/common/extstyle_none.css new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/common/extstyle_none.css @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/common/facelist.gif b/static/image/common/facelist.gif new file mode 100644 index 0000000..0463672 Binary files /dev/null and b/static/image/common/facelist.gif differ diff --git a/static/image/common/fach.gif b/static/image/common/fach.gif new file mode 100644 index 0000000..55ae142 Binary files /dev/null and b/static/image/common/fach.gif differ diff --git a/static/image/common/fall.png b/static/image/common/fall.png new file mode 100644 index 0000000..c8b3327 Binary files /dev/null and b/static/image/common/fall.png differ diff --git a/static/image/common/faq.gif b/static/image/common/faq.gif new file mode 100644 index 0000000..f80eb63 Binary files /dev/null and b/static/image/common/faq.gif differ diff --git a/static/image/common/fastreply.gif b/static/image/common/fastreply.gif new file mode 100644 index 0000000..ac442b3 Binary files /dev/null and b/static/image/common/fastreply.gif differ diff --git a/static/image/common/fav.gif b/static/image/common/fav.gif new file mode 100644 index 0000000..c7b942b Binary files /dev/null and b/static/image/common/fav.gif differ diff --git a/static/image/common/fav_grey.gif b/static/image/common/fav_grey.gif new file mode 100644 index 0000000..442ce26 Binary files /dev/null and b/static/image/common/fav_grey.gif differ diff --git a/static/image/common/feed.gif b/static/image/common/feed.gif new file mode 100644 index 0000000..6b2054f Binary files /dev/null and b/static/image/common/feed.gif differ diff --git a/static/image/common/fj_btn.png b/static/image/common/fj_btn.png new file mode 100644 index 0000000..2a902ae Binary files /dev/null and b/static/image/common/fj_btn.png differ diff --git a/static/image/common/fl_collapsed_no.gif b/static/image/common/fl_collapsed_no.gif new file mode 100644 index 0000000..3a1734d Binary files /dev/null and b/static/image/common/fl_collapsed_no.gif differ diff --git a/static/image/common/fl_collapsed_yes.gif b/static/image/common/fl_collapsed_yes.gif new file mode 100644 index 0000000..90a2017 Binary files /dev/null and b/static/image/common/fl_collapsed_yes.gif differ diff --git a/static/image/common/fl_ft.png b/static/image/common/fl_ft.png new file mode 100644 index 0000000..8ca82cd Binary files /dev/null and b/static/image/common/fl_ft.png differ diff --git a/static/image/common/fl_ft_r.png b/static/image/common/fl_ft_r.png new file mode 100644 index 0000000..9259f83 Binary files /dev/null and b/static/image/common/fl_ft_r.png differ diff --git a/static/image/common/fl_hd.png b/static/image/common/fl_hd.png new file mode 100644 index 0000000..2e4fcc0 Binary files /dev/null and b/static/image/common/fl_hd.png differ diff --git a/static/image/common/flag.gif b/static/image/common/flag.gif new file mode 100644 index 0000000..a2a3aee Binary files /dev/null and b/static/image/common/flag.gif differ diff --git a/static/image/common/flash.gif b/static/image/common/flash.gif new file mode 100644 index 0000000..6464ba1 Binary files /dev/null and b/static/image/common/flash.gif differ diff --git a/static/image/common/flw_allfeed.png b/static/image/common/flw_allfeed.png new file mode 100644 index 0000000..999ab20 Binary files /dev/null and b/static/image/common/flw_allfeed.png differ diff --git a/static/image/common/flw_attach_bg.png b/static/image/common/flw_attach_bg.png new file mode 100644 index 0000000..d6fadaa Binary files /dev/null and b/static/image/common/flw_attach_bg.png differ diff --git a/static/image/common/flw_btn.png b/static/image/common/flw_btn.png new file mode 100644 index 0000000..ce763e1 Binary files /dev/null and b/static/image/common/flw_btn.png differ diff --git a/static/image/common/flw_btn_s.png b/static/image/common/flw_btn_s.png new file mode 100644 index 0000000..2673a25 Binary files /dev/null and b/static/image/common/flw_btn_s.png differ diff --git a/static/image/common/flw_btn_specialfo.png b/static/image/common/flw_btn_specialfo.png new file mode 100644 index 0000000..0995738 Binary files /dev/null and b/static/image/common/flw_btn_specialfo.png differ diff --git a/static/image/common/flw_btn_unfo.png b/static/image/common/flw_btn_unfo.png new file mode 100644 index 0000000..010b4f0 Binary files /dev/null and b/static/image/common/flw_btn_unfo.png differ diff --git a/static/image/common/flw_btn_unfo_s.png b/static/image/common/flw_btn_unfo_s.png new file mode 100644 index 0000000..a5f1230 Binary files /dev/null and b/static/image/common/flw_btn_unfo_s.png differ diff --git a/static/image/common/flw_cnr_l.png b/static/image/common/flw_cnr_l.png new file mode 100644 index 0000000..84f6a74 Binary files /dev/null and b/static/image/common/flw_cnr_l.png differ diff --git a/static/image/common/flw_cnr_t.png b/static/image/common/flw_cnr_t.png new file mode 100644 index 0000000..0b8e419 Binary files /dev/null and b/static/image/common/flw_cnr_t.png differ diff --git a/static/image/common/flw_feed.png b/static/image/common/flw_feed.png new file mode 100644 index 0000000..ca13b9f Binary files /dev/null and b/static/image/common/flw_feed.png differ diff --git a/static/image/common/flw_following.png b/static/image/common/flw_following.png new file mode 100644 index 0000000..4719c2a Binary files /dev/null and b/static/image/common/flw_following.png differ diff --git a/static/image/common/flw_guide.png b/static/image/common/flw_guide.png new file mode 100644 index 0000000..821814b Binary files /dev/null and b/static/image/common/flw_guide.png differ diff --git a/static/image/common/flw_ico.png b/static/image/common/flw_ico.png new file mode 100644 index 0000000..d926ee2 Binary files /dev/null and b/static/image/common/flw_ico.png differ diff --git a/static/image/common/flw_post.jpg b/static/image/common/flw_post.jpg new file mode 100644 index 0000000..14bf8ca Binary files /dev/null and b/static/image/common/flw_post.jpg differ diff --git a/static/image/common/flw_post.png b/static/image/common/flw_post.png new file mode 100644 index 0000000..0510b60 Binary files /dev/null and b/static/image/common/flw_post.png differ diff --git a/static/image/common/flw_post_attach.png b/static/image/common/flw_post_attach.png new file mode 100644 index 0000000..26523d7 Binary files /dev/null and b/static/image/common/flw_post_attach.png differ diff --git a/static/image/common/flw_post_w.jpg b/static/image/common/flw_post_w.jpg new file mode 100644 index 0000000..0cb14d7 Binary files /dev/null and b/static/image/common/flw_post_w.jpg differ diff --git a/static/image/common/flw_side_tab.png b/static/image/common/flw_side_tab.png new file mode 100644 index 0000000..73a5529 Binary files /dev/null and b/static/image/common/flw_side_tab.png differ diff --git a/static/image/common/flw_statusico.png b/static/image/common/flw_statusico.png new file mode 100644 index 0000000..7477ed2 Binary files /dev/null and b/static/image/common/flw_statusico.png differ diff --git a/static/image/common/folder_common.gif b/static/image/common/folder_common.gif new file mode 100644 index 0000000..cca6e91 Binary files /dev/null and b/static/image/common/folder_common.gif differ diff --git a/static/image/common/folder_lock.gif b/static/image/common/folder_lock.gif new file mode 100644 index 0000000..5f6a92a Binary files /dev/null and b/static/image/common/folder_lock.gif differ diff --git a/static/image/common/folder_new.gif b/static/image/common/folder_new.gif new file mode 100644 index 0000000..ed57d39 Binary files /dev/null and b/static/image/common/folder_new.gif differ diff --git a/static/image/common/folder_s.gif b/static/image/common/folder_s.gif new file mode 100644 index 0000000..4a130f5 Binary files /dev/null and b/static/image/common/folder_s.gif differ diff --git a/static/image/common/forum.gif b/static/image/common/forum.gif new file mode 100644 index 0000000..563452f Binary files /dev/null and b/static/image/common/forum.gif differ diff --git a/static/image/common/forum_new.gif b/static/image/common/forum_new.gif new file mode 100644 index 0000000..969b902 Binary files /dev/null and b/static/image/common/forum_new.gif differ diff --git a/static/image/common/forumlink.gif b/static/image/common/forumlink.gif new file mode 100644 index 0000000..29060e8 Binary files /dev/null and b/static/image/common/forumlink.gif differ diff --git a/static/image/common/g_guide.png b/static/image/common/g_guide.png new file mode 100644 index 0000000..733450c Binary files /dev/null and b/static/image/common/g_guide.png differ diff --git a/static/image/common/g_guide.svg b/static/image/common/g_guide.svg new file mode 100644 index 0000000..faa63e8 --- /dev/null +++ b/static/image/common/g_guide.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/image/common/gb.gif b/static/image/common/gb.gif new file mode 100644 index 0000000..936a155 Binary files /dev/null and b/static/image/common/gb.gif differ diff --git a/static/image/common/gentlemanbg.png b/static/image/common/gentlemanbg.png new file mode 100644 index 0000000..fa7fe54 Binary files /dev/null and b/static/image/common/gentlemanbg.png differ diff --git a/static/image/common/grid.png b/static/image/common/grid.png new file mode 100644 index 0000000..785050f Binary files /dev/null and b/static/image/common/grid.png differ diff --git a/static/image/common/group.ico b/static/image/common/group.ico new file mode 100644 index 0000000..eadb152 Binary files /dev/null and b/static/image/common/group.ico differ diff --git a/static/image/common/groupicon.gif b/static/image/common/groupicon.gif new file mode 100644 index 0000000..eb92959 Binary files /dev/null and b/static/image/common/groupicon.gif differ diff --git a/static/image/common/grouppm.png b/static/image/common/grouppm.png new file mode 100644 index 0000000..d6bb1a7 Binary files /dev/null and b/static/image/common/grouppm.png differ diff --git a/static/image/common/gst.gif b/static/image/common/gst.gif new file mode 100644 index 0000000..7ddfb99 Binary files /dev/null and b/static/image/common/gst.gif differ diff --git a/static/image/common/hd_shadow.png b/static/image/common/hd_shadow.png new file mode 100644 index 0000000..ac28b2d Binary files /dev/null and b/static/image/common/hd_shadow.png differ diff --git a/static/image/common/home.gif b/static/image/common/home.gif new file mode 100644 index 0000000..4f6f695 Binary files /dev/null and b/static/image/common/home.gif differ diff --git a/static/image/common/home.ico b/static/image/common/home.ico new file mode 100644 index 0000000..d51fdc2 Binary files /dev/null and b/static/image/common/home.ico differ diff --git a/static/image/common/homelink.gif b/static/image/common/homelink.gif new file mode 100644 index 0000000..29060e8 Binary files /dev/null and b/static/image/common/homelink.gif differ diff --git a/static/image/common/hot.png b/static/image/common/hot.png new file mode 100644 index 0000000..5805e25 Binary files /dev/null and b/static/image/common/hot.png differ diff --git a/static/image/common/hot_1.gif b/static/image/common/hot_1.gif new file mode 100644 index 0000000..c38eecf Binary files /dev/null and b/static/image/common/hot_1.gif differ diff --git a/static/image/common/hot_2.gif b/static/image/common/hot_2.gif new file mode 100644 index 0000000..464159f Binary files /dev/null and b/static/image/common/hot_2.gif differ diff --git a/static/image/common/hot_3.gif b/static/image/common/hot_3.gif new file mode 100644 index 0000000..ba48b16 Binary files /dev/null and b/static/image/common/hot_3.gif differ diff --git a/static/image/common/hotspot.gif b/static/image/common/hotspot.gif new file mode 100644 index 0000000..1671b76 Binary files /dev/null and b/static/image/common/hotspot.gif differ diff --git a/static/image/common/hs_cs.gif b/static/image/common/hs_cs.gif new file mode 100644 index 0000000..0ebd739 Binary files /dev/null and b/static/image/common/hs_cs.gif differ diff --git a/static/image/common/hs_cz.gif b/static/image/common/hs_cz.gif new file mode 100644 index 0000000..89f28c0 Binary files /dev/null and b/static/image/common/hs_cz.gif differ diff --git a/static/image/common/hs_qg.gif b/static/image/common/hs_qg.gif new file mode 100644 index 0000000..a4790bd Binary files /dev/null and b/static/image/common/hs_qg.gif differ diff --git a/static/image/common/hs_qz.gif b/static/image/common/hs_qz.gif new file mode 100644 index 0000000..502bf0b Binary files /dev/null and b/static/image/common/hs_qz.gif differ diff --git a/static/image/common/ico_jdt.png b/static/image/common/ico_jdt.png new file mode 100644 index 0000000..51e8136 Binary files /dev/null and b/static/image/common/ico_jdt.png differ diff --git a/static/image/common/ico_lz.png b/static/image/common/ico_lz.png new file mode 100644 index 0000000..475edd8 Binary files /dev/null and b/static/image/common/ico_lz.png differ diff --git a/static/image/common/ico_mps.png b/static/image/common/ico_mps.png new file mode 100644 index 0000000..60190da Binary files /dev/null and b/static/image/common/ico_mps.png differ diff --git a/static/image/common/ico_mulu.png b/static/image/common/ico_mulu.png new file mode 100644 index 0000000..0099c6d Binary files /dev/null and b/static/image/common/ico_mulu.png differ diff --git a/static/image/common/ico_notice.png b/static/image/common/ico_notice.png new file mode 100644 index 0000000..a3a2b8f Binary files /dev/null and b/static/image/common/ico_notice.png differ diff --git a/static/image/common/icon_ad.gif b/static/image/common/icon_ad.gif new file mode 100644 index 0000000..7b9c706 Binary files /dev/null and b/static/image/common/icon_ad.gif differ diff --git a/static/image/common/icon_append.png b/static/image/common/icon_append.png new file mode 100644 index 0000000..0bf83d3 Binary files /dev/null and b/static/image/common/icon_append.png differ diff --git a/static/image/common/icon_collection.png b/static/image/common/icon_collection.png new file mode 100644 index 0000000..6727db7 Binary files /dev/null and b/static/image/common/icon_collection.png differ diff --git a/static/image/common/icon_down.gif b/static/image/common/icon_down.gif new file mode 100644 index 0000000..628bc97 Binary files /dev/null and b/static/image/common/icon_down.gif differ diff --git a/static/image/common/icon_fav.png b/static/image/common/icon_fav.png new file mode 100644 index 0000000..dab86ac Binary files /dev/null and b/static/image/common/icon_fav.png differ diff --git a/static/image/common/icon_feed.png b/static/image/common/icon_feed.png new file mode 100644 index 0000000..889c2e6 Binary files /dev/null and b/static/image/common/icon_feed.png differ diff --git a/static/image/common/icon_manage.gif b/static/image/common/icon_manage.gif new file mode 100644 index 0000000..8862231 Binary files /dev/null and b/static/image/common/icon_manage.gif differ diff --git a/static/image/common/icon_preview.png b/static/image/common/icon_preview.png new file mode 100644 index 0000000..7bfe11e Binary files /dev/null and b/static/image/common/icon_preview.png differ diff --git a/static/image/common/icon_quote_e.gif b/static/image/common/icon_quote_e.gif new file mode 100644 index 0000000..ee855d6 Binary files /dev/null and b/static/image/common/icon_quote_e.gif differ diff --git a/static/image/common/icon_quote_m_e.gif b/static/image/common/icon_quote_m_e.gif new file mode 100644 index 0000000..8b8bfd5 Binary files /dev/null and b/static/image/common/icon_quote_m_e.gif differ diff --git a/static/image/common/icon_quote_m_s.gif b/static/image/common/icon_quote_m_s.gif new file mode 100644 index 0000000..07727af Binary files /dev/null and b/static/image/common/icon_quote_m_s.gif differ diff --git a/static/image/common/icon_quote_s.gif b/static/image/common/icon_quote_s.gif new file mode 100644 index 0000000..78a931a Binary files /dev/null and b/static/image/common/icon_quote_s.gif differ diff --git a/static/image/common/icon_search.png b/static/image/common/icon_search.png new file mode 100644 index 0000000..d3ea371 Binary files /dev/null and b/static/image/common/icon_search.png differ diff --git a/static/image/common/icon_task.gif b/static/image/common/icon_task.gif new file mode 100644 index 0000000..d77eeab Binary files /dev/null and b/static/image/common/icon_task.gif differ diff --git a/static/image/common/icon_top.gif b/static/image/common/icon_top.gif new file mode 100644 index 0000000..dd219b5 Binary files /dev/null and b/static/image/common/icon_top.gif differ diff --git a/static/image/common/icq.gif b/static/image/common/icq.gif new file mode 100644 index 0000000..0b7d929 Binary files /dev/null and b/static/image/common/icq.gif differ diff --git a/static/image/common/imagelist_nav.png b/static/image/common/imagelist_nav.png new file mode 100644 index 0000000..ae9f739 Binary files /dev/null and b/static/image/common/imagelist_nav.png differ diff --git a/static/image/common/imageloading.gif b/static/image/common/imageloading.gif new file mode 100644 index 0000000..02bd782 Binary files /dev/null and b/static/image/common/imageloading.gif differ diff --git a/static/image/common/img_loader.gif b/static/image/common/img_loader.gif new file mode 100644 index 0000000..30ae08b Binary files /dev/null and b/static/image/common/img_loader.gif differ diff --git a/static/image/common/img_nopermission.png b/static/image/common/img_nopermission.png new file mode 100644 index 0000000..942b9e2 Binary files /dev/null and b/static/image/common/img_nopermission.png differ diff --git a/static/image/common/imgzoom_tb.gif b/static/image/common/imgzoom_tb.gif new file mode 100644 index 0000000..68bcb9b Binary files /dev/null and b/static/image/common/imgzoom_tb.gif differ diff --git a/static/image/common/increase.png b/static/image/common/increase.png new file mode 100644 index 0000000..dc6bf36 Binary files /dev/null and b/static/image/common/increase.png differ diff --git a/static/image/common/index.htm b/static/image/common/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/common/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/common/info.gif b/static/image/common/info.gif new file mode 100644 index 0000000..c798191 Binary files /dev/null and b/static/image/common/info.gif differ diff --git a/static/image/common/info_small.gif b/static/image/common/info_small.gif new file mode 100644 index 0000000..515b5f9 Binary files /dev/null and b/static/image/common/info_small.gif differ diff --git a/static/image/common/input_shadow.png b/static/image/common/input_shadow.png new file mode 100644 index 0000000..dd05509 Binary files /dev/null and b/static/image/common/input_shadow.png differ diff --git a/static/image/common/ios.png b/static/image/common/ios.png new file mode 100644 index 0000000..2e26ef3 Binary files /dev/null and b/static/image/common/ios.png differ diff --git a/static/image/common/ladybg.png b/static/image/common/ladybg.png new file mode 100644 index 0000000..e54723c Binary files /dev/null and b/static/image/common/ladybg.png differ diff --git a/static/image/common/legend_reward.gif b/static/image/common/legend_reward.gif new file mode 100644 index 0000000..1140467 Binary files /dev/null and b/static/image/common/legend_reward.gif differ diff --git a/static/image/common/livethreadtitle.png b/static/image/common/livethreadtitle.png new file mode 100644 index 0000000..e227917 Binary files /dev/null and b/static/image/common/livethreadtitle.png differ diff --git a/static/image/common/loading.gif b/static/image/common/loading.gif new file mode 100644 index 0000000..81ccc5d Binary files /dev/null and b/static/image/common/loading.gif differ diff --git a/static/image/common/locked.gif b/static/image/common/locked.gif new file mode 100644 index 0000000..7f26020 Binary files /dev/null and b/static/image/common/locked.gif differ diff --git a/static/image/common/logo.png b/static/image/common/logo.png new file mode 100644 index 0000000..c1da0b5 Binary files /dev/null and b/static/image/common/logo.png differ diff --git a/static/image/common/logo.svg b/static/image/common/logo.svg new file mode 100644 index 0000000..19d0fba --- /dev/null +++ b/static/image/common/logo.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/static/image/common/logo_88_31.gif b/static/image/common/logo_88_31.gif new file mode 100644 index 0000000..39b2662 Binary files /dev/null and b/static/image/common/logo_88_31.gif differ diff --git a/static/image/common/logo_m.svg b/static/image/common/logo_m.svg new file mode 100644 index 0000000..fea1382 --- /dev/null +++ b/static/image/common/logo_m.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/image/common/logo_sc.png b/static/image/common/logo_sc.png new file mode 100644 index 0000000..c3c2b35 Binary files /dev/null and b/static/image/common/logo_sc.png differ diff --git a/static/image/common/logo_sc.svg b/static/image/common/logo_sc.svg new file mode 100644 index 0000000..987d97f --- /dev/null +++ b/static/image/common/logo_sc.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/static/image/common/logo_sc_s.png b/static/image/common/logo_sc_s.png new file mode 100644 index 0000000..515306b Binary files /dev/null and b/static/image/common/logo_sc_s.png differ diff --git a/static/image/common/logom.png b/static/image/common/logom.png new file mode 100644 index 0000000..568d5af Binary files /dev/null and b/static/image/common/logom.png differ diff --git a/static/image/common/magic_imgbg.gif b/static/image/common/magic_imgbg.gif new file mode 100644 index 0000000..c5bebe9 Binary files /dev/null and b/static/image/common/magic_imgbg.gif differ diff --git a/static/image/common/mail_active.png b/static/image/common/mail_active.png new file mode 100644 index 0000000..96f8d1e Binary files /dev/null and b/static/image/common/mail_active.png differ diff --git a/static/image/common/mail_inactive.png b/static/image/common/mail_inactive.png new file mode 100644 index 0000000..28568ca Binary files /dev/null and b/static/image/common/mail_inactive.png differ diff --git a/static/image/common/mark.png b/static/image/common/mark.png new file mode 100644 index 0000000..e127182 Binary files /dev/null and b/static/image/common/mark.png differ diff --git a/static/image/common/mdly.png b/static/image/common/mdly.png new file mode 100644 index 0000000..a208d3a Binary files /dev/null and b/static/image/common/mdly.png differ diff --git a/static/image/common/medal1.gif b/static/image/common/medal1.gif new file mode 100644 index 0000000..1dbb073 Binary files /dev/null and b/static/image/common/medal1.gif differ diff --git a/static/image/common/medal10.gif b/static/image/common/medal10.gif new file mode 100644 index 0000000..7f8a094 Binary files /dev/null and b/static/image/common/medal10.gif differ diff --git a/static/image/common/medal2.gif b/static/image/common/medal2.gif new file mode 100644 index 0000000..28367f7 Binary files /dev/null and b/static/image/common/medal2.gif differ diff --git a/static/image/common/medal3.gif b/static/image/common/medal3.gif new file mode 100644 index 0000000..0f1baf3 Binary files /dev/null and b/static/image/common/medal3.gif differ diff --git a/static/image/common/medal4.gif b/static/image/common/medal4.gif new file mode 100644 index 0000000..6d1c594 Binary files /dev/null and b/static/image/common/medal4.gif differ diff --git a/static/image/common/medal5.gif b/static/image/common/medal5.gif new file mode 100644 index 0000000..1379c99 Binary files /dev/null and b/static/image/common/medal5.gif differ diff --git a/static/image/common/medal6.gif b/static/image/common/medal6.gif new file mode 100644 index 0000000..0b1b08b Binary files /dev/null and b/static/image/common/medal6.gif differ diff --git a/static/image/common/medal7.gif b/static/image/common/medal7.gif new file mode 100644 index 0000000..b493760 Binary files /dev/null and b/static/image/common/medal7.gif differ diff --git a/static/image/common/medal8.gif b/static/image/common/medal8.gif new file mode 100644 index 0000000..efaab44 Binary files /dev/null and b/static/image/common/medal8.gif differ diff --git a/static/image/common/medal9.gif b/static/image/common/medal9.gif new file mode 100644 index 0000000..47947a8 Binary files /dev/null and b/static/image/common/medal9.gif differ diff --git a/static/image/common/midavt_shadow.gif b/static/image/common/midavt_shadow.gif new file mode 100644 index 0000000..f470b17 Binary files /dev/null and b/static/image/common/midavt_shadow.gif differ diff --git a/static/image/common/mifm.png b/static/image/common/mifm.png new file mode 100644 index 0000000..79b78c0 Binary files /dev/null and b/static/image/common/mifm.png differ diff --git a/static/image/common/mine_icn.png b/static/image/common/mine_icn.png new file mode 100644 index 0000000..d592930 Binary files /dev/null and b/static/image/common/mine_icn.png differ diff --git a/static/image/common/minus.gif b/static/image/common/minus.gif new file mode 100644 index 0000000..84c2490 Binary files /dev/null and b/static/image/common/minus.gif differ diff --git a/static/image/common/mobile-attach-1.png b/static/image/common/mobile-attach-1.png new file mode 100644 index 0000000..b852058 Binary files /dev/null and b/static/image/common/mobile-attach-1.png differ diff --git a/static/image/common/mobile-attach-2.png b/static/image/common/mobile-attach-2.png new file mode 100644 index 0000000..a7928eb Binary files /dev/null and b/static/image/common/mobile-attach-2.png differ diff --git a/static/image/common/mobile-attach-3.png b/static/image/common/mobile-attach-3.png new file mode 100644 index 0000000..1a5be6c Binary files /dev/null and b/static/image/common/mobile-attach-3.png differ diff --git a/static/image/common/mobile-attach-4.png b/static/image/common/mobile-attach-4.png new file mode 100644 index 0000000..ccda0e8 Binary files /dev/null and b/static/image/common/mobile-attach-4.png differ diff --git a/static/image/common/mobile-type-ie6.png b/static/image/common/mobile-type-ie6.png new file mode 100644 index 0000000..094ae9b Binary files /dev/null and b/static/image/common/mobile-type-ie6.png differ diff --git a/static/image/common/mobile-type.png b/static/image/common/mobile-type.png new file mode 100644 index 0000000..22b0168 Binary files /dev/null and b/static/image/common/mobile-type.png differ diff --git a/static/image/common/mobile.png b/static/image/common/mobile.png new file mode 100644 index 0000000..eafb439 Binary files /dev/null and b/static/image/common/mobile.png differ diff --git a/static/image/common/mood_input.png b/static/image/common/mood_input.png new file mode 100644 index 0000000..5a0ab28 Binary files /dev/null and b/static/image/common/mood_input.png differ diff --git a/static/image/common/mood_input_btn.png b/static/image/common/mood_input_btn.png new file mode 100644 index 0000000..2d8946d Binary files /dev/null and b/static/image/common/mood_input_btn.png differ diff --git a/static/image/common/more1.png b/static/image/common/more1.png new file mode 100644 index 0000000..70c1d24 Binary files /dev/null and b/static/image/common/more1.png differ diff --git a/static/image/common/msnadd.gif b/static/image/common/msnadd.gif new file mode 100644 index 0000000..ce4a4db Binary files /dev/null and b/static/image/common/msnadd.gif differ diff --git a/static/image/common/msnchat.gif b/static/image/common/msnchat.gif new file mode 100644 index 0000000..4eda3ae Binary files /dev/null and b/static/image/common/msnchat.gif differ diff --git a/static/image/common/mu.png b/static/image/common/mu.png new file mode 100644 index 0000000..db57ab2 Binary files /dev/null and b/static/image/common/mu.png differ diff --git a/static/image/common/mu_bg.png b/static/image/common/mu_bg.png new file mode 100644 index 0000000..eb71357 Binary files /dev/null and b/static/image/common/mu_bg.png differ diff --git a/static/image/common/music.gif b/static/image/common/music.gif new file mode 100644 index 0000000..b2a63c2 Binary files /dev/null and b/static/image/common/music.gif differ diff --git a/static/image/common/n_rate.png b/static/image/common/n_rate.png new file mode 100644 index 0000000..e58eb46 Binary files /dev/null and b/static/image/common/n_rate.png differ diff --git a/static/image/common/new_pm.gif b/static/image/common/new_pm.gif new file mode 100644 index 0000000..4d3153e Binary files /dev/null and b/static/image/common/new_pm.gif differ diff --git a/static/image/common/new_pm_2.png b/static/image/common/new_pm_2.png new file mode 100644 index 0000000..30caea5 Binary files /dev/null and b/static/image/common/new_pm_2.png differ diff --git a/static/image/common/newarow.gif b/static/image/common/newarow.gif new file mode 100644 index 0000000..bbc6305 Binary files /dev/null and b/static/image/common/newarow.gif differ diff --git a/static/image/common/newarow_big.gif b/static/image/common/newarow_big.gif new file mode 100644 index 0000000..edb497d Binary files /dev/null and b/static/image/common/newarow_big.gif differ diff --git a/static/image/common/newclose.gif b/static/image/common/newclose.gif new file mode 100644 index 0000000..f3e30ac Binary files /dev/null and b/static/image/common/newclose.gif differ diff --git a/static/image/common/newnotice.gif b/static/image/common/newnotice.gif new file mode 100644 index 0000000..8163b76 Binary files /dev/null and b/static/image/common/newnotice.gif differ diff --git a/static/image/common/noicon.gif b/static/image/common/noicon.gif new file mode 100644 index 0000000..03aa7a1 Binary files /dev/null and b/static/image/common/noicon.gif differ diff --git a/static/image/common/none.gif b/static/image/common/none.gif new file mode 100644 index 0000000..d36072c Binary files /dev/null and b/static/image/common/none.gif differ diff --git a/static/image/common/nophoto.gif b/static/image/common/nophoto.gif new file mode 100644 index 0000000..d352dc9 Binary files /dev/null and b/static/image/common/nophoto.gif differ diff --git a/static/image/common/nophotosmall.gif b/static/image/common/nophotosmall.gif new file mode 100644 index 0000000..c748e96 Binary files /dev/null and b/static/image/common/nophotosmall.gif differ diff --git a/static/image/common/nophototiny.png b/static/image/common/nophototiny.png new file mode 100644 index 0000000..15ad0aa Binary files /dev/null and b/static/image/common/nophototiny.png differ diff --git a/static/image/common/nopublish.gif b/static/image/common/nopublish.gif new file mode 100644 index 0000000..6902362 Binary files /dev/null and b/static/image/common/nopublish.gif differ diff --git a/static/image/common/nopublish.svg b/static/image/common/nopublish.svg new file mode 100644 index 0000000..feca4d1 --- /dev/null +++ b/static/image/common/nopublish.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/image/common/nosexbg.png b/static/image/common/nosexbg.png new file mode 100644 index 0000000..9faf6f1 Binary files /dev/null and b/static/image/common/nosexbg.png differ diff --git a/static/image/common/notice.gif b/static/image/common/notice.gif new file mode 100644 index 0000000..af9372c Binary files /dev/null and b/static/image/common/notice.gif differ diff --git a/static/image/common/numbg.gif b/static/image/common/numbg.gif new file mode 100644 index 0000000..aa9774b Binary files /dev/null and b/static/image/common/numbg.gif differ diff --git a/static/image/common/nv.png b/static/image/common/nv.png new file mode 100644 index 0000000..46be48a Binary files /dev/null and b/static/image/common/nv.png differ diff --git a/static/image/common/nv_a.png b/static/image/common/nv_a.png new file mode 100644 index 0000000..c9a05fd Binary files /dev/null and b/static/image/common/nv_a.png differ diff --git a/static/image/common/ol.gif b/static/image/common/ol.gif new file mode 100644 index 0000000..8549012 Binary files /dev/null and b/static/image/common/ol.gif differ diff --git a/static/image/common/online_admin.gif b/static/image/common/online_admin.gif new file mode 100644 index 0000000..ca51cfc Binary files /dev/null and b/static/image/common/online_admin.gif differ diff --git a/static/image/common/online_guest.gif b/static/image/common/online_guest.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/common/online_guest.gif differ diff --git a/static/image/common/online_member.gif b/static/image/common/online_member.gif new file mode 100644 index 0000000..ffb1210 Binary files /dev/null and b/static/image/common/online_member.gif differ diff --git a/static/image/common/online_moderator.gif b/static/image/common/online_moderator.gif new file mode 100644 index 0000000..8d105d9 Binary files /dev/null and b/static/image/common/online_moderator.gif differ diff --git a/static/image/common/online_supermod.gif b/static/image/common/online_supermod.gif new file mode 100644 index 0000000..5e90168 Binary files /dev/null and b/static/image/common/online_supermod.gif differ diff --git a/static/image/common/op.png b/static/image/common/op.png new file mode 100644 index 0000000..3a633a8 Binary files /dev/null and b/static/image/common/op.png differ diff --git a/static/image/common/oshr.png b/static/image/common/oshr.png new file mode 100644 index 0000000..a93ba0a Binary files /dev/null and b/static/image/common/oshr.png differ diff --git a/static/image/common/p_debate_chart.png b/static/image/common/p_debate_chart.png new file mode 100644 index 0000000..c1576ff Binary files /dev/null and b/static/image/common/p_debate_chart.png differ diff --git a/static/image/common/p_reward_btn.png b/static/image/common/p_reward_btn.png new file mode 100644 index 0000000..dd247cc Binary files /dev/null and b/static/image/common/p_reward_btn.png differ diff --git a/static/image/common/p_topusr_btn.png b/static/image/common/p_topusr_btn.png new file mode 100644 index 0000000..0a59607 Binary files /dev/null and b/static/image/common/p_topusr_btn.png differ diff --git a/static/image/common/p_trade_btn.png b/static/image/common/p_trade_btn.png new file mode 100644 index 0000000..7b1aaaf Binary files /dev/null and b/static/image/common/p_trade_btn.png differ diff --git a/static/image/common/passlevel.png b/static/image/common/passlevel.png new file mode 100644 index 0000000..8bfc18c Binary files /dev/null and b/static/image/common/passlevel.png differ diff --git a/static/image/common/pdbt.gif b/static/image/common/pdbt.gif new file mode 100644 index 0000000..71b138d Binary files /dev/null and b/static/image/common/pdbt.gif differ diff --git a/static/image/common/pdbtm.gif b/static/image/common/pdbtm.gif new file mode 100644 index 0000000..0f3a94b Binary files /dev/null and b/static/image/common/pdbtm.gif differ diff --git a/static/image/common/pengyou.png b/static/image/common/pengyou.png new file mode 100644 index 0000000..03c23f1 Binary files /dev/null and b/static/image/common/pengyou.png differ diff --git a/static/image/common/pg_arw.png b/static/image/common/pg_arw.png new file mode 100644 index 0000000..4e49d56 Binary files /dev/null and b/static/image/common/pg_arw.png differ diff --git a/static/image/common/pg_bg.png b/static/image/common/pg_bg.png new file mode 100644 index 0000000..0f05a9b Binary files /dev/null and b/static/image/common/pg_bg.png differ diff --git a/static/image/common/pic-next.png b/static/image/common/pic-next.png new file mode 100644 index 0000000..cc83182 Binary files /dev/null and b/static/image/common/pic-next.png differ diff --git a/static/image/common/pic-prev.png b/static/image/common/pic-prev.png new file mode 100644 index 0000000..d7545dc Binary files /dev/null and b/static/image/common/pic-prev.png differ diff --git a/static/image/common/pic_nv_next.gif b/static/image/common/pic_nv_next.gif new file mode 100644 index 0000000..e4c2665 Binary files /dev/null and b/static/image/common/pic_nv_next.gif differ diff --git a/static/image/common/pic_nv_prev.gif b/static/image/common/pic_nv_prev.gif new file mode 100644 index 0000000..f7194d7 Binary files /dev/null and b/static/image/common/pic_nv_prev.gif differ diff --git a/static/image/common/pin.gif b/static/image/common/pin.gif new file mode 100644 index 0000000..0be7964 Binary files /dev/null and b/static/image/common/pin.gif differ diff --git a/static/image/common/pin_1.gif b/static/image/common/pin_1.gif new file mode 100644 index 0000000..effb529 Binary files /dev/null and b/static/image/common/pin_1.gif differ diff --git a/static/image/common/pin_2.gif b/static/image/common/pin_2.gif new file mode 100644 index 0000000..2d7055f Binary files /dev/null and b/static/image/common/pin_2.gif differ diff --git a/static/image/common/pin_3.gif b/static/image/common/pin_3.gif new file mode 100644 index 0000000..ee580b1 Binary files /dev/null and b/static/image/common/pin_3.gif differ diff --git a/static/image/common/pin_4.gif b/static/image/common/pin_4.gif new file mode 100644 index 0000000..d47f05c Binary files /dev/null and b/static/image/common/pin_4.gif differ diff --git a/static/image/common/pllb.png b/static/image/common/pllb.png new file mode 100644 index 0000000..2cde34e Binary files /dev/null and b/static/image/common/pllb.png differ diff --git a/static/image/common/plus.gif b/static/image/common/plus.gif new file mode 100644 index 0000000..4b3722c Binary files /dev/null and b/static/image/common/plus.gif differ diff --git a/static/image/common/pm-bg1.png b/static/image/common/pm-bg1.png new file mode 100644 index 0000000..e4455ea Binary files /dev/null and b/static/image/common/pm-bg1.png differ diff --git a/static/image/common/pm-bg2.png b/static/image/common/pm-bg2.png new file mode 100644 index 0000000..f08fbc4 Binary files /dev/null and b/static/image/common/pm-bg2.png differ diff --git a/static/image/common/pm-bg3.png b/static/image/common/pm-bg3.png new file mode 100644 index 0000000..8b006ac Binary files /dev/null and b/static/image/common/pm-bg3.png differ diff --git a/static/image/common/pm-ico5.png b/static/image/common/pm-ico5.png new file mode 100644 index 0000000..eea865f Binary files /dev/null and b/static/image/common/pm-ico5.png differ diff --git a/static/image/common/pm.png b/static/image/common/pm.png new file mode 100644 index 0000000..bcd9f67 Binary files /dev/null and b/static/image/common/pm.png differ diff --git a/static/image/common/pm_member.png b/static/image/common/pm_member.png new file mode 100644 index 0000000..227bcad Binary files /dev/null and b/static/image/common/pm_member.png differ diff --git a/static/image/common/pm_ntc.gif b/static/image/common/pm_ntc.gif new file mode 100644 index 0000000..03ffc88 Binary files /dev/null and b/static/image/common/pm_ntc.gif differ diff --git a/static/image/common/pmto.gif b/static/image/common/pmto.gif new file mode 100644 index 0000000..e653701 Binary files /dev/null and b/static/image/common/pmto.gif differ diff --git a/static/image/common/pn.png b/static/image/common/pn.png new file mode 100644 index 0000000..eab4eea Binary files /dev/null and b/static/image/common/pn.png differ diff --git a/static/image/common/pn_color.png b/static/image/common/pn_color.png new file mode 100644 index 0000000..fd99fc6 Binary files /dev/null and b/static/image/common/pn_color.png differ diff --git a/static/image/common/pn_post.png b/static/image/common/pn_post.png new file mode 100644 index 0000000..c8ba2a1 Binary files /dev/null and b/static/image/common/pn_post.png differ diff --git a/static/image/common/pn_reply.png b/static/image/common/pn_reply.png new file mode 100644 index 0000000..1a5446a Binary files /dev/null and b/static/image/common/pn_reply.png differ diff --git a/static/image/common/pn_rt.png b/static/image/common/pn_rt.png new file mode 100644 index 0000000..b44d232 Binary files /dev/null and b/static/image/common/pn_rt.png differ diff --git a/static/image/common/pnp2.png b/static/image/common/pnp2.png new file mode 100644 index 0000000..0ecf88d Binary files /dev/null and b/static/image/common/pnp2.png differ diff --git a/static/image/common/polljoins.gif b/static/image/common/polljoins.gif new file mode 100644 index 0000000..797ebed Binary files /dev/null and b/static/image/common/polljoins.gif differ diff --git a/static/image/common/pollsmall.gif b/static/image/common/pollsmall.gif new file mode 100644 index 0000000..a2a8877 Binary files /dev/null and b/static/image/common/pollsmall.gif differ diff --git a/static/image/common/popupcredit_bg.gif b/static/image/common/popupcredit_bg.gif new file mode 100644 index 0000000..070eb74 Binary files /dev/null and b/static/image/common/popupcredit_bg.gif differ diff --git a/static/image/common/popupcredit_btn.gif b/static/image/common/popupcredit_btn.gif new file mode 100644 index 0000000..553088f Binary files /dev/null and b/static/image/common/popupcredit_btn.gif differ diff --git a/static/image/common/popuptext_bg.gif b/static/image/common/popuptext_bg.gif new file mode 100644 index 0000000..dbeeee1 Binary files /dev/null and b/static/image/common/popuptext_bg.gif differ diff --git a/static/image/common/portal.ico b/static/image/common/portal.ico new file mode 100644 index 0000000..2fa91e2 Binary files /dev/null and b/static/image/common/portal.ico differ diff --git a/static/image/common/portalbox_bg.gif b/static/image/common/portalbox_bg.gif new file mode 100644 index 0000000..b12b4ca Binary files /dev/null and b/static/image/common/portalbox_bg.gif differ diff --git a/static/image/common/preview.png b/static/image/common/preview.png new file mode 100644 index 0000000..bcf61d5 Binary files /dev/null and b/static/image/common/preview.png differ diff --git a/static/image/common/print.png b/static/image/common/print.png new file mode 100644 index 0000000..74bb7ba Binary files /dev/null and b/static/image/common/print.png differ diff --git a/static/image/common/pt_icn.png b/static/image/common/pt_icn.png new file mode 100644 index 0000000..f9641eb Binary files /dev/null and b/static/image/common/pt_icn.png differ diff --git a/static/image/common/pt_item.png b/static/image/common/pt_item.png new file mode 100644 index 0000000..7292bbe Binary files /dev/null and b/static/image/common/pt_item.png differ diff --git a/static/image/common/pt_z.png b/static/image/common/pt_z.png new file mode 100644 index 0000000..4ee5371 Binary files /dev/null and b/static/image/common/pt_z.png differ diff --git a/static/image/common/pubsave.gif b/static/image/common/pubsave.gif new file mode 100644 index 0000000..4a130f5 Binary files /dev/null and b/static/image/common/pubsave.gif differ diff --git a/static/image/common/push.png b/static/image/common/push.png new file mode 100644 index 0000000..395323c Binary files /dev/null and b/static/image/common/push.png differ diff --git a/static/image/common/px.png b/static/image/common/px.png new file mode 100644 index 0000000..e314698 Binary files /dev/null and b/static/image/common/px.png differ diff --git a/static/image/common/px_e.png b/static/image/common/px_e.png new file mode 100644 index 0000000..097e4f7 Binary files /dev/null and b/static/image/common/px_e.png differ diff --git a/static/image/common/qa.gif b/static/image/common/qa.gif new file mode 100644 index 0000000..8ddf35f Binary files /dev/null and b/static/image/common/qa.gif differ diff --git a/static/image/common/qmenu.png b/static/image/common/qmenu.png new file mode 100644 index 0000000..b3f1b69 Binary files /dev/null and b/static/image/common/qmenu.png differ diff --git a/static/image/common/qpay_logo.svg b/static/image/common/qpay_logo.svg new file mode 100644 index 0000000..e5f953a --- /dev/null +++ b/static/image/common/qpay_logo.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/static/image/common/qq.gif b/static/image/common/qq.gif new file mode 100644 index 0000000..f547a3d Binary files /dev/null and b/static/image/common/qq.gif differ diff --git a/static/image/common/qq_big.gif b/static/image/common/qq_big.gif new file mode 100644 index 0000000..ebacf27 Binary files /dev/null and b/static/image/common/qq_big.gif differ diff --git a/static/image/common/qq_bind.gif b/static/image/common/qq_bind.gif new file mode 100644 index 0000000..b26cdaf Binary files /dev/null and b/static/image/common/qq_bind.gif differ diff --git a/static/image/common/qq_bind_small.gif b/static/image/common/qq_bind_small.gif new file mode 100644 index 0000000..14d1ebc Binary files /dev/null and b/static/image/common/qq_bind_small.gif differ diff --git a/static/image/common/qq_login.gif b/static/image/common/qq_login.gif new file mode 100644 index 0000000..bb6c332 Binary files /dev/null and b/static/image/common/qq_login.gif differ diff --git a/static/image/common/qq_share.png b/static/image/common/qq_share.png new file mode 100644 index 0000000..b0a2f4f Binary files /dev/null and b/static/image/common/qq_share.png differ diff --git a/static/image/common/quote.gif b/static/image/common/quote.gif new file mode 100644 index 0000000..7c78d24 Binary files /dev/null and b/static/image/common/quote.gif differ diff --git a/static/image/common/qz.gif b/static/image/common/qz.gif new file mode 100644 index 0000000..4ac7429 Binary files /dev/null and b/static/image/common/qz.gif differ diff --git a/static/image/common/qzone.gif b/static/image/common/qzone.gif new file mode 100644 index 0000000..cb65f10 Binary files /dev/null and b/static/image/common/qzone.gif differ diff --git a/static/image/common/r_b_resize.png b/static/image/common/r_b_resize.png new file mode 100644 index 0000000..a95d999 Binary files /dev/null and b/static/image/common/r_b_resize.png differ diff --git a/static/image/common/rank_1.gif b/static/image/common/rank_1.gif new file mode 100644 index 0000000..3efdae5 Binary files /dev/null and b/static/image/common/rank_1.gif differ diff --git a/static/image/common/rank_2.gif b/static/image/common/rank_2.gif new file mode 100644 index 0000000..79a2d9c Binary files /dev/null and b/static/image/common/rank_2.gif differ diff --git a/static/image/common/rank_3.gif b/static/image/common/rank_3.gif new file mode 100644 index 0000000..dd76df9 Binary files /dev/null and b/static/image/common/rank_3.gif differ diff --git a/static/image/common/ratbg.gif b/static/image/common/ratbg.gif new file mode 100644 index 0000000..c9b8773 Binary files /dev/null and b/static/image/common/ratbg.gif differ diff --git a/static/image/common/ratesrcorebg.gif b/static/image/common/ratesrcorebg.gif new file mode 100644 index 0000000..3f62818 Binary files /dev/null and b/static/image/common/ratesrcorebg.gif differ diff --git a/static/image/common/re_unsolved.gif b/static/image/common/re_unsolved.gif new file mode 100644 index 0000000..8151efc Binary files /dev/null and b/static/image/common/re_unsolved.gif differ diff --git a/static/image/common/rec_add.gif b/static/image/common/rec_add.gif new file mode 100644 index 0000000..188ad8d Binary files /dev/null and b/static/image/common/rec_add.gif differ diff --git a/static/image/common/rec_subtract.gif b/static/image/common/rec_subtract.gif new file mode 100644 index 0000000..30e2c06 Binary files /dev/null and b/static/image/common/rec_subtract.gif differ diff --git a/static/image/common/recommend_1.gif b/static/image/common/recommend_1.gif new file mode 100644 index 0000000..5c2248a Binary files /dev/null and b/static/image/common/recommend_1.gif differ diff --git a/static/image/common/recommend_2.gif b/static/image/common/recommend_2.gif new file mode 100644 index 0000000..24f65d6 Binary files /dev/null and b/static/image/common/recommend_2.gif differ diff --git a/static/image/common/recommend_3.gif b/static/image/common/recommend_3.gif new file mode 100644 index 0000000..b0028b9 Binary files /dev/null and b/static/image/common/recommend_3.gif differ diff --git a/static/image/common/recyclebin.gif b/static/image/common/recyclebin.gif new file mode 100644 index 0000000..613662c Binary files /dev/null and b/static/image/common/recyclebin.gif differ diff --git a/static/image/common/refresh.png b/static/image/common/refresh.png new file mode 100644 index 0000000..8ba3982 Binary files /dev/null and b/static/image/common/refresh.png differ diff --git a/static/image/common/repquote.gif b/static/image/common/repquote.gif new file mode 100644 index 0000000..6cd87fd Binary files /dev/null and b/static/image/common/repquote.gif differ diff --git a/static/image/common/rewardsmall.gif b/static/image/common/rewardsmall.gif new file mode 100644 index 0000000..80dbdb3 Binary files /dev/null and b/static/image/common/rewardsmall.gif differ diff --git a/static/image/common/right.gif b/static/image/common/right.gif new file mode 100644 index 0000000..bff898a Binary files /dev/null and b/static/image/common/right.gif differ diff --git a/static/image/common/rleft.gif b/static/image/common/rleft.gif new file mode 100644 index 0000000..51085e0 Binary files /dev/null and b/static/image/common/rleft.gif differ diff --git a/static/image/common/rright.gif b/static/image/common/rright.gif new file mode 100644 index 0000000..695b230 Binary files /dev/null and b/static/image/common/rright.gif differ diff --git a/static/image/common/rss.gif b/static/image/common/rss.gif new file mode 100644 index 0000000..cc9cbc4 Binary files /dev/null and b/static/image/common/rss.gif differ diff --git a/static/image/common/rt.png b/static/image/common/rt.png new file mode 100644 index 0000000..5cf9d44 Binary files /dev/null and b/static/image/common/rt.png differ diff --git a/static/image/common/rushreply_s.png b/static/image/common/rushreply_s.png new file mode 100644 index 0000000..81fdc0e Binary files /dev/null and b/static/image/common/rushreply_s.png differ diff --git a/static/image/common/rwd.gif b/static/image/common/rwd.gif new file mode 100644 index 0000000..ef400da Binary files /dev/null and b/static/image/common/rwd.gif differ diff --git a/static/image/common/rwd2.gif b/static/image/common/rwd2.gif new file mode 100644 index 0000000..4962370 Binary files /dev/null and b/static/image/common/rwd2.gif differ diff --git a/static/image/common/scf.gif b/static/image/common/scf.gif new file mode 100644 index 0000000..ea88eb4 Binary files /dev/null and b/static/image/common/scf.gif differ diff --git a/static/image/common/scrolltop.png b/static/image/common/scrolltop.png new file mode 100644 index 0000000..96d0fef Binary files /dev/null and b/static/image/common/scrolltop.png differ diff --git a/static/image/common/se.gif b/static/image/common/se.gif new file mode 100644 index 0000000..f715a3c Binary files /dev/null and b/static/image/common/se.gif differ diff --git a/static/image/common/search.gif b/static/image/common/search.gif new file mode 100644 index 0000000..3371694 Binary files /dev/null and b/static/image/common/search.gif differ diff --git a/static/image/common/search.png b/static/image/common/search.png new file mode 100644 index 0000000..40f9196 Binary files /dev/null and b/static/image/common/search.png differ diff --git a/static/image/common/searchbar.png b/static/image/common/searchbar.png new file mode 100644 index 0000000..644332c Binary files /dev/null and b/static/image/common/searchbar.png differ diff --git a/static/image/common/seccodeplayer.gif b/static/image/common/seccodeplayer.gif new file mode 100644 index 0000000..e419848 Binary files /dev/null and b/static/image/common/seccodeplayer.gif differ diff --git a/static/image/common/security.gif b/static/image/common/security.gif new file mode 100644 index 0000000..1a12e9c Binary files /dev/null and b/static/image/common/security.gif differ diff --git a/static/image/common/security.png b/static/image/common/security.png new file mode 100644 index 0000000..6f9fbba Binary files /dev/null and b/static/image/common/security.png differ diff --git a/static/image/common/settop.png b/static/image/common/settop.png new file mode 100644 index 0000000..07e4156 Binary files /dev/null and b/static/image/common/settop.png differ diff --git a/static/image/common/share_btn.png b/static/image/common/share_btn.png new file mode 100644 index 0000000..7e16f55 Binary files /dev/null and b/static/image/common/share_btn.png differ diff --git a/static/image/common/share_img.png b/static/image/common/share_img.png new file mode 100644 index 0000000..e09d5cf Binary files /dev/null and b/static/image/common/share_img.png differ diff --git a/static/image/common/side.png b/static/image/common/side.png new file mode 100644 index 0000000..2180004 Binary files /dev/null and b/static/image/common/side.png differ diff --git a/static/image/common/sidecontrol.png b/static/image/common/sidecontrol.png new file mode 100644 index 0000000..bad4fc0 Binary files /dev/null and b/static/image/common/sidecontrol.png differ diff --git a/static/image/common/sigline.gif b/static/image/common/sigline.gif new file mode 100644 index 0000000..8e7a6f5 Binary files /dev/null and b/static/image/common/sigline.gif differ diff --git a/static/image/common/site_qq.jpg b/static/image/common/site_qq.jpg new file mode 100644 index 0000000..eaac95c Binary files /dev/null and b/static/image/common/site_qq.jpg differ diff --git a/static/image/common/slide.png b/static/image/common/slide.png new file mode 100644 index 0000000..4ddfdc3 Binary files /dev/null and b/static/image/common/slide.png differ diff --git a/static/image/common/slisticon.gif b/static/image/common/slisticon.gif new file mode 100644 index 0000000..94e44d4 Binary files /dev/null and b/static/image/common/slisticon.gif differ diff --git a/static/image/common/sortnum.png b/static/image/common/sortnum.png new file mode 100644 index 0000000..f33a096 Binary files /dev/null and b/static/image/common/sortnum.png differ diff --git a/static/image/common/spacer.gif b/static/image/common/spacer.gif new file mode 100644 index 0000000..5bfd67a Binary files /dev/null and b/static/image/common/spacer.gif differ diff --git a/static/image/common/stand_label.gif b/static/image/common/stand_label.gif new file mode 100644 index 0000000..3acace9 Binary files /dev/null and b/static/image/common/stand_label.gif differ diff --git a/static/image/common/star_level1.gif b/static/image/common/star_level1.gif new file mode 100644 index 0000000..a64bc1f Binary files /dev/null and b/static/image/common/star_level1.gif differ diff --git a/static/image/common/star_level2.gif b/static/image/common/star_level2.gif new file mode 100644 index 0000000..d475b83 Binary files /dev/null and b/static/image/common/star_level2.gif differ diff --git a/static/image/common/star_level3.gif b/static/image/common/star_level3.gif new file mode 100644 index 0000000..5a9a1fb Binary files /dev/null and b/static/image/common/star_level3.gif differ diff --git a/static/image/common/starlevel.gif b/static/image/common/starlevel.gif new file mode 100644 index 0000000..81ee478 Binary files /dev/null and b/static/image/common/starlevel.gif differ diff --git a/static/image/common/status_setting.xml b/static/image/common/status_setting.xml new file mode 100644 index 0000000..5d9d1f0 --- /dev/null +++ b/static/image/common/status_setting.xml @@ -0,0 +1,48 @@ + + Tahoma + + 60104060 + + + + true + + + true0 + + + + #000000 + false + + 10 + 180 + + + 10 + + + + + true + 12 + + + true + true + + true + + + + #005eb4 + + + + + + + + + + \ No newline at end of file diff --git a/static/image/common/switch_style.png b/static/image/common/switch_style.png new file mode 100644 index 0000000..ae2ca31 Binary files /dev/null and b/static/image/common/switch_style.png differ diff --git a/static/image/common/switch_width.png b/static/image/common/switch_width.png new file mode 100644 index 0000000..395155f Binary files /dev/null and b/static/image/common/switch_width.png differ diff --git a/static/image/common/systempm.png b/static/image/common/systempm.png new file mode 100644 index 0000000..d32e5c7 Binary files /dev/null and b/static/image/common/systempm.png differ diff --git a/static/image/common/tag.gif b/static/image/common/tag.gif new file mode 100644 index 0000000..bc64a38 Binary files /dev/null and b/static/image/common/tag.gif differ diff --git a/static/image/common/taobao.gif b/static/image/common/taobao.gif new file mode 100644 index 0000000..56413cc Binary files /dev/null and b/static/image/common/taobao.gif differ diff --git a/static/image/common/tavatar.gif b/static/image/common/tavatar.gif new file mode 100644 index 0000000..b54631c Binary files /dev/null and b/static/image/common/tavatar.gif differ diff --git a/static/image/common/tb.png b/static/image/common/tb.png new file mode 100644 index 0000000..68c11d1 Binary files /dev/null and b/static/image/common/tb.png differ diff --git a/static/image/common/thead.png b/static/image/common/thead.png new file mode 100644 index 0000000..cfeb57c Binary files /dev/null and b/static/image/common/thead.png differ diff --git a/static/image/common/thread-next.png b/static/image/common/thread-next.png new file mode 100644 index 0000000..47c8c0f Binary files /dev/null and b/static/image/common/thread-next.png differ diff --git a/static/image/common/thread-prev.png b/static/image/common/thread-prev.png new file mode 100644 index 0000000..5d13566 Binary files /dev/null and b/static/image/common/thread-prev.png differ diff --git a/static/image/common/thread_prize_s.png b/static/image/common/thread_prize_s.png new file mode 100644 index 0000000..e10a25e Binary files /dev/null and b/static/image/common/thread_prize_s.png differ diff --git a/static/image/common/tip_bottom.png b/static/image/common/tip_bottom.png new file mode 100644 index 0000000..e7fea34 Binary files /dev/null and b/static/image/common/tip_bottom.png differ diff --git a/static/image/common/tip_top.png b/static/image/common/tip_top.png new file mode 100644 index 0000000..7394a4b Binary files /dev/null and b/static/image/common/tip_top.png differ diff --git a/static/image/common/tip_up.gif b/static/image/common/tip_up.gif new file mode 100644 index 0000000..82893f2 Binary files /dev/null and b/static/image/common/tip_up.gif differ diff --git a/static/image/common/tip_up_grey.gif b/static/image/common/tip_up_grey.gif new file mode 100644 index 0000000..8762046 Binary files /dev/null and b/static/image/common/tip_up_grey.gif differ diff --git a/static/image/common/title.png b/static/image/common/title.png new file mode 100644 index 0000000..cb3097a Binary files /dev/null and b/static/image/common/title.png differ diff --git a/static/image/common/titlebg.png b/static/image/common/titlebg.png new file mode 100644 index 0000000..e51e48d Binary files /dev/null and b/static/image/common/titlebg.png differ diff --git a/static/image/common/titlebg_sd.png b/static/image/common/titlebg_sd.png new file mode 100644 index 0000000..b2971ab Binary files /dev/null and b/static/image/common/titlebg_sd.png differ diff --git a/static/image/common/topnav.png b/static/image/common/topnav.png new file mode 100644 index 0000000..265b482 Binary files /dev/null and b/static/image/common/topnav.png differ diff --git a/static/image/common/tradesmall.gif b/static/image/common/tradesmall.gif new file mode 100644 index 0000000..1341f48 Binary files /dev/null and b/static/image/common/tradesmall.gif differ diff --git a/static/image/common/transparent.gif b/static/image/common/transparent.gif new file mode 100644 index 0000000..e633c1b Binary files /dev/null and b/static/image/common/transparent.gif differ diff --git a/static/image/common/tree_empty.gif b/static/image/common/tree_empty.gif new file mode 100644 index 0000000..80dc865 Binary files /dev/null and b/static/image/common/tree_empty.gif differ diff --git a/static/image/common/tree_file.gif b/static/image/common/tree_file.gif new file mode 100644 index 0000000..1c55c5b Binary files /dev/null and b/static/image/common/tree_file.gif differ diff --git a/static/image/common/tree_folder.gif b/static/image/common/tree_folder.gif new file mode 100644 index 0000000..34d14f3 Binary files /dev/null and b/static/image/common/tree_folder.gif differ diff --git a/static/image/common/tree_folderopen.gif b/static/image/common/tree_folderopen.gif new file mode 100644 index 0000000..ea3efec Binary files /dev/null and b/static/image/common/tree_folderopen.gif differ diff --git a/static/image/common/tree_line.gif b/static/image/common/tree_line.gif new file mode 100644 index 0000000..d16bb46 Binary files /dev/null and b/static/image/common/tree_line.gif differ diff --git a/static/image/common/tree_linebottom.gif b/static/image/common/tree_linebottom.gif new file mode 100644 index 0000000..67ca22a Binary files /dev/null and b/static/image/common/tree_linebottom.gif differ diff --git a/static/image/common/tree_linemiddle.gif b/static/image/common/tree_linemiddle.gif new file mode 100644 index 0000000..e5a542e Binary files /dev/null and b/static/image/common/tree_linemiddle.gif differ diff --git a/static/image/common/tree_minus.gif b/static/image/common/tree_minus.gif new file mode 100644 index 0000000..b63f5fc Binary files /dev/null and b/static/image/common/tree_minus.gif differ diff --git a/static/image/common/tree_minusbottom.gif b/static/image/common/tree_minusbottom.gif new file mode 100644 index 0000000..17ae489 Binary files /dev/null and b/static/image/common/tree_minusbottom.gif differ diff --git a/static/image/common/tree_minusmiddle.gif b/static/image/common/tree_minusmiddle.gif new file mode 100644 index 0000000..ef26583 Binary files /dev/null and b/static/image/common/tree_minusmiddle.gif differ diff --git a/static/image/common/tree_plus.gif b/static/image/common/tree_plus.gif new file mode 100644 index 0000000..8c359d7 Binary files /dev/null and b/static/image/common/tree_plus.gif differ diff --git a/static/image/common/tree_plusbottom.gif b/static/image/common/tree_plusbottom.gif new file mode 100644 index 0000000..99f0fb8 Binary files /dev/null and b/static/image/common/tree_plusbottom.gif differ diff --git a/static/image/common/tree_plusmiddle.gif b/static/image/common/tree_plusmiddle.gif new file mode 100644 index 0000000..adb1b1d Binary files /dev/null and b/static/image/common/tree_plusmiddle.gif differ diff --git a/static/image/common/tree_root.gif b/static/image/common/tree_root.gif new file mode 100644 index 0000000..fe207c3 Binary files /dev/null and b/static/image/common/tree_root.gif differ diff --git a/static/image/common/treeline_long.gif b/static/image/common/treeline_long.gif new file mode 100644 index 0000000..22256f4 Binary files /dev/null and b/static/image/common/treeline_long.gif differ diff --git a/static/image/common/treeline_short.gif b/static/image/common/treeline_short.gif new file mode 100644 index 0000000..9543882 Binary files /dev/null and b/static/image/common/treeline_short.gif differ diff --git a/static/image/common/un_selector.png b/static/image/common/un_selector.png new file mode 100644 index 0000000..d61700e Binary files /dev/null and b/static/image/common/un_selector.png differ diff --git a/static/image/common/uploadbutton.png b/static/image/common/uploadbutton.png new file mode 100644 index 0000000..0ba81b9 Binary files /dev/null and b/static/image/common/uploadbutton.png differ diff --git a/static/image/common/uploadbutton_small.png b/static/image/common/uploadbutton_small.png new file mode 100644 index 0000000..e8daece Binary files /dev/null and b/static/image/common/uploadbutton_small.png differ diff --git a/static/image/common/uploadbutton_small_pic.png b/static/image/common/uploadbutton_small_pic.png new file mode 100644 index 0000000..9ad549a Binary files /dev/null and b/static/image/common/uploadbutton_small_pic.png differ diff --git a/static/image/common/uploading.gif b/static/image/common/uploading.gif new file mode 100644 index 0000000..27bf0b4 Binary files /dev/null and b/static/image/common/uploading.gif differ diff --git a/static/image/common/user_add.gif b/static/image/common/user_add.gif new file mode 100644 index 0000000..f47dc3e Binary files /dev/null and b/static/image/common/user_add.gif differ diff --git a/static/image/common/user_link.gif b/static/image/common/user_link.gif new file mode 100644 index 0000000..666e71e Binary files /dev/null and b/static/image/common/user_link.gif differ diff --git a/static/image/common/user_offline.gif b/static/image/common/user_offline.gif new file mode 100644 index 0000000..ead2d2d Binary files /dev/null and b/static/image/common/user_offline.gif differ diff --git a/static/image/common/user_online.gif b/static/image/common/user_online.gif new file mode 100644 index 0000000..6fa40bd Binary files /dev/null and b/static/image/common/user_online.gif differ diff --git a/static/image/common/userinfo.gif b/static/image/common/userinfo.gif new file mode 100644 index 0000000..fa49c8f Binary files /dev/null and b/static/image/common/userinfo.gif differ diff --git a/static/image/common/v.png b/static/image/common/v.png new file mode 100644 index 0000000..4a0d9f1 Binary files /dev/null and b/static/image/common/v.png differ diff --git a/static/image/common/vd.gif b/static/image/common/vd.gif new file mode 100644 index 0000000..8ab3c1f Binary files /dev/null and b/static/image/common/vd.gif differ diff --git a/static/image/common/vds.png b/static/image/common/vds.png new file mode 100644 index 0000000..9122d7a Binary files /dev/null and b/static/image/common/vds.png differ diff --git a/static/image/common/viewpay.gif b/static/image/common/viewpay.gif new file mode 100644 index 0000000..8997e18 Binary files /dev/null and b/static/image/common/viewpay.gif differ diff --git a/static/image/common/vline.png b/static/image/common/vline.png new file mode 100644 index 0000000..f82a220 Binary files /dev/null and b/static/image/common/vline.png differ diff --git a/static/image/common/vline2.png b/static/image/common/vline2.png new file mode 100644 index 0000000..4248a83 Binary files /dev/null and b/static/image/common/vline2.png differ diff --git a/static/image/common/vlineb.png b/static/image/common/vlineb.png new file mode 100644 index 0000000..0cfd0be Binary files /dev/null and b/static/image/common/vlineb.png differ diff --git a/static/image/common/warning.gif b/static/image/common/warning.gif new file mode 100644 index 0000000..f741716 Binary files /dev/null and b/static/image/common/warning.gif differ diff --git a/static/image/common/watermark.gif b/static/image/common/watermark.gif new file mode 100644 index 0000000..989fc48 Binary files /dev/null and b/static/image/common/watermark.gif differ diff --git a/static/image/common/watermark.png b/static/image/common/watermark.png new file mode 100644 index 0000000..7d7f3a5 Binary files /dev/null and b/static/image/common/watermark.png differ diff --git a/static/image/common/wechatpay_logo.svg b/static/image/common/wechatpay_logo.svg new file mode 100644 index 0000000..e661a6e --- /dev/null +++ b/static/image/common/wechatpay_logo.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/static/image/common/weibo.png b/static/image/common/weibo.png new file mode 100644 index 0000000..bacf068 Binary files /dev/null and b/static/image/common/weibo.png differ diff --git a/static/image/common/winner_flag.gif b/static/image/common/winner_flag.gif new file mode 100644 index 0000000..7c968ac Binary files /dev/null and b/static/image/common/winner_flag.gif differ diff --git a/static/image/common/yahoo.gif b/static/image/common/yahoo.gif new file mode 100644 index 0000000..b4518f0 Binary files /dev/null and b/static/image/common/yahoo.gif differ diff --git a/static/image/common/zslt_andriod.png b/static/image/common/zslt_andriod.png new file mode 100644 index 0000000..a5df5db Binary files /dev/null and b/static/image/common/zslt_andriod.png differ diff --git a/static/image/common/zslt_ios.png b/static/image/common/zslt_ios.png new file mode 100644 index 0000000..2b206ca Binary files /dev/null and b/static/image/common/zslt_ios.png differ diff --git a/static/image/diy/bs_2_ft.png b/static/image/diy/bs_2_ft.png new file mode 100644 index 0000000..ac8efb9 Binary files /dev/null and b/static/image/diy/bs_2_ft.png differ diff --git a/static/image/diy/bs_2_ft_r.png b/static/image/diy/bs_2_ft_r.png new file mode 100644 index 0000000..03770b1 Binary files /dev/null and b/static/image/diy/bs_2_ft_r.png differ diff --git a/static/image/diy/bs_2_hd.png b/static/image/diy/bs_2_hd.png new file mode 100644 index 0000000..14804b5 Binary files /dev/null and b/static/image/diy/bs_2_hd.png differ diff --git a/static/image/diy/bs_3_ft.png b/static/image/diy/bs_3_ft.png new file mode 100644 index 0000000..c42b4ba Binary files /dev/null and b/static/image/diy/bs_3_ft.png differ diff --git a/static/image/diy/bs_3_ft_r.png b/static/image/diy/bs_3_ft_r.png new file mode 100644 index 0000000..25be322 Binary files /dev/null and b/static/image/diy/bs_3_ft_r.png differ diff --git a/static/image/diy/bs_3_hd.png b/static/image/diy/bs_3_hd.png new file mode 100644 index 0000000..f7db8fa Binary files /dev/null and b/static/image/diy/bs_3_hd.png differ diff --git a/static/image/diy/bs_4_ft.png b/static/image/diy/bs_4_ft.png new file mode 100644 index 0000000..953b3b6 Binary files /dev/null and b/static/image/diy/bs_4_ft.png differ diff --git a/static/image/diy/bs_4_ft_r.png b/static/image/diy/bs_4_ft_r.png new file mode 100644 index 0000000..5d7a6fb Binary files /dev/null and b/static/image/diy/bs_4_ft_r.png differ diff --git a/static/image/diy/bs_4_hd.png b/static/image/diy/bs_4_hd.png new file mode 100644 index 0000000..6ef4ead Binary files /dev/null and b/static/image/diy/bs_4_hd.png differ diff --git a/static/image/diy/bs_5_ft.png b/static/image/diy/bs_5_ft.png new file mode 100644 index 0000000..c550fd0 Binary files /dev/null and b/static/image/diy/bs_5_ft.png differ diff --git a/static/image/diy/bs_5_ft_r.png b/static/image/diy/bs_5_ft_r.png new file mode 100644 index 0000000..85686c2 Binary files /dev/null and b/static/image/diy/bs_5_ft_r.png differ diff --git a/static/image/diy/bs_5_hd.png b/static/image/diy/bs_5_hd.png new file mode 100644 index 0000000..fb0e59b Binary files /dev/null and b/static/image/diy/bs_5_hd.png differ diff --git a/static/image/diy/bs_6_ft.png b/static/image/diy/bs_6_ft.png new file mode 100644 index 0000000..52161de Binary files /dev/null and b/static/image/diy/bs_6_ft.png differ diff --git a/static/image/diy/bs_6_ft_r.png b/static/image/diy/bs_6_ft_r.png new file mode 100644 index 0000000..a5b9dd1 Binary files /dev/null and b/static/image/diy/bs_6_ft_r.png differ diff --git a/static/image/diy/bs_6_hd.png b/static/image/diy/bs_6_hd.png new file mode 100644 index 0000000..a83dc7d Binary files /dev/null and b/static/image/diy/bs_6_hd.png differ diff --git a/static/image/diy/bs_6_hd_r.png b/static/image/diy/bs_6_hd_r.png new file mode 100644 index 0000000..508f60e Binary files /dev/null and b/static/image/diy/bs_6_hd_r.png differ diff --git a/static/image/diy/bs_7_ft.png b/static/image/diy/bs_7_ft.png new file mode 100644 index 0000000..b8bd28c Binary files /dev/null and b/static/image/diy/bs_7_ft.png differ diff --git a/static/image/diy/bs_7_ft_r.png b/static/image/diy/bs_7_ft_r.png new file mode 100644 index 0000000..0420e96 Binary files /dev/null and b/static/image/diy/bs_7_ft_r.png differ diff --git a/static/image/diy/bs_7_hd.png b/static/image/diy/bs_7_hd.png new file mode 100644 index 0000000..8c9cdf7 Binary files /dev/null and b/static/image/diy/bs_7_hd.png differ diff --git a/static/image/diy/cp-bg.png b/static/image/diy/cp-bg.png new file mode 100644 index 0000000..d17623d Binary files /dev/null and b/static/image/diy/cp-bg.png differ diff --git a/static/image/diy/cp-close.png b/static/image/diy/cp-close.png new file mode 100644 index 0000000..2f29200 Binary files /dev/null and b/static/image/diy/cp-close.png differ diff --git a/static/image/diy/cp-item-mini.png b/static/image/diy/cp-item-mini.png new file mode 100644 index 0000000..6d7ad42 Binary files /dev/null and b/static/image/diy/cp-item-mini.png differ diff --git a/static/image/diy/cp-item-selected.png b/static/image/diy/cp-item-selected.png new file mode 100644 index 0000000..9f36baf Binary files /dev/null and b/static/image/diy/cp-item-selected.png differ diff --git a/static/image/diy/cp-more.png b/static/image/diy/cp-more.png new file mode 100644 index 0000000..56ace5a Binary files /dev/null and b/static/image/diy/cp-more.png differ diff --git a/static/image/diy/cp-nav-active.png b/static/image/diy/cp-nav-active.png new file mode 100644 index 0000000..dce4e21 Binary files /dev/null and b/static/image/diy/cp-nav-active.png differ diff --git a/static/image/diy/cp-nav-corner-bl.png b/static/image/diy/cp-nav-corner-bl.png new file mode 100644 index 0000000..d6918ff Binary files /dev/null and b/static/image/diy/cp-nav-corner-bl.png differ diff --git a/static/image/diy/cp-nav-corner-br.png b/static/image/diy/cp-nav-corner-br.png new file mode 100644 index 0000000..31cde37 Binary files /dev/null and b/static/image/diy/cp-nav-corner-br.png differ diff --git a/static/image/diy/cp-nav-corner-tr.png b/static/image/diy/cp-nav-corner-tr.png new file mode 100644 index 0000000..ff26533 Binary files /dev/null and b/static/image/diy/cp-nav-corner-tr.png differ diff --git a/static/image/diy/cp-nav.png b/static/image/diy/cp-nav.png new file mode 100644 index 0000000..73b4965 Binary files /dev/null and b/static/image/diy/cp-nav.png differ diff --git a/static/image/diy/cp-preview.png b/static/image/diy/cp-preview.png new file mode 100644 index 0000000..1431063 Binary files /dev/null and b/static/image/diy/cp-preview.png differ diff --git a/static/image/diy/cp-save.png b/static/image/diy/cp-save.png new file mode 100644 index 0000000..e67540b Binary files /dev/null and b/static/image/diy/cp-save.png differ diff --git a/static/image/diy/cp-savecache.png b/static/image/diy/cp-savecache.png new file mode 100644 index 0000000..2962a4d Binary files /dev/null and b/static/image/diy/cp-savecache.png differ diff --git a/static/image/diy/cp-step.png b/static/image/diy/cp-step.png new file mode 100644 index 0000000..668cbd2 Binary files /dev/null and b/static/image/diy/cp-step.png differ diff --git a/static/image/diy/diy.png b/static/image/diy/diy.png new file mode 100644 index 0000000..2d67f96 Binary files /dev/null and b/static/image/diy/diy.png differ diff --git a/static/image/diy/index.htm b/static/image/diy/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/diy/layout-1-1-1.png b/static/image/diy/layout-1-1-1.png new file mode 100644 index 0000000..c61f59f Binary files /dev/null and b/static/image/diy/layout-1-1-1.png differ diff --git a/static/image/diy/layout-1-1.png b/static/image/diy/layout-1-1.png new file mode 100644 index 0000000..6740d73 Binary files /dev/null and b/static/image/diy/layout-1-1.png differ diff --git a/static/image/diy/layout-1-2.png b/static/image/diy/layout-1-2.png new file mode 100644 index 0000000..89a2c08 Binary files /dev/null and b/static/image/diy/layout-1-2.png differ diff --git a/static/image/diy/layout-1-3.png b/static/image/diy/layout-1-3.png new file mode 100644 index 0000000..8213230 Binary files /dev/null and b/static/image/diy/layout-1-3.png differ diff --git a/static/image/diy/layout-1.png b/static/image/diy/layout-1.png new file mode 100644 index 0000000..c77d005 Binary files /dev/null and b/static/image/diy/layout-1.png differ diff --git a/static/image/diy/layout-2-1.png b/static/image/diy/layout-2-1.png new file mode 100644 index 0000000..dfc6a65 Binary files /dev/null and b/static/image/diy/layout-2-1.png differ diff --git a/static/image/diy/layout-3-1.png b/static/image/diy/layout-3-1.png new file mode 100644 index 0000000..2715f7b Binary files /dev/null and b/static/image/diy/layout-3-1.png differ diff --git a/static/image/diy/layout-tab.png b/static/image/diy/layout-tab.png new file mode 100644 index 0000000..5122205 Binary files /dev/null and b/static/image/diy/layout-tab.png differ diff --git a/static/image/diy/layout.png b/static/image/diy/layout.png new file mode 100644 index 0000000..45ebcbb Binary files /dev/null and b/static/image/diy/layout.png differ diff --git a/static/image/diy/module-article.png b/static/image/diy/module-article.png new file mode 100644 index 0000000..cbaeae2 Binary files /dev/null and b/static/image/diy/module-article.png differ diff --git a/static/image/diy/module-forum.png b/static/image/diy/module-forum.png new file mode 100644 index 0000000..b6c4ba2 Binary files /dev/null and b/static/image/diy/module-forum.png differ diff --git a/static/image/diy/module-group.png b/static/image/diy/module-group.png new file mode 100644 index 0000000..d73879f Binary files /dev/null and b/static/image/diy/module-group.png differ diff --git a/static/image/diy/module-html.png b/static/image/diy/module-html.png new file mode 100644 index 0000000..165fff8 Binary files /dev/null and b/static/image/diy/module-html.png differ diff --git a/static/image/diy/module-member.png b/static/image/diy/module-member.png new file mode 100644 index 0000000..d1ddf4a Binary files /dev/null and b/static/image/diy/module-member.png differ diff --git a/static/image/diy/module-space.png b/static/image/diy/module-space.png new file mode 100644 index 0000000..5810ece Binary files /dev/null and b/static/image/diy/module-space.png differ diff --git a/static/image/diy/module.png b/static/image/diy/module.png new file mode 100644 index 0000000..7324b18 Binary files /dev/null and b/static/image/diy/module.png differ diff --git a/static/image/diy/panel-toggle-drop.png b/static/image/diy/panel-toggle-drop.png new file mode 100644 index 0000000..03bbfc7 Binary files /dev/null and b/static/image/diy/panel-toggle-drop.png differ diff --git a/static/image/diy/panel-toggle-space.png b/static/image/diy/panel-toggle-space.png new file mode 100644 index 0000000..5c4f60b Binary files /dev/null and b/static/image/diy/panel-toggle-space.png differ diff --git a/static/image/diy/panel-toggle.png b/static/image/diy/panel-toggle.png new file mode 100644 index 0000000..15429c6 Binary files /dev/null and b/static/image/diy/panel-toggle.png differ diff --git a/static/image/diy/style.png b/static/image/diy/style.png new file mode 100644 index 0000000..b6e59cb Binary files /dev/null and b/static/image/diy/style.png differ diff --git a/static/image/diy/t-diy.png b/static/image/diy/t-diy.png new file mode 100644 index 0000000..ed490a7 Binary files /dev/null and b/static/image/diy/t-diy.png differ diff --git a/static/image/diy/vline.png b/static/image/diy/vline.png new file mode 100644 index 0000000..c3ef258 Binary files /dev/null and b/static/image/diy/vline.png differ diff --git a/static/image/diy/vline2.png b/static/image/diy/vline2.png new file mode 100644 index 0000000..7d5e52c Binary files /dev/null and b/static/image/diy/vline2.png differ diff --git a/static/image/doodle/big/001.jpg b/static/image/doodle/big/001.jpg new file mode 100644 index 0000000..3ba5370 Binary files /dev/null and b/static/image/doodle/big/001.jpg differ diff --git a/static/image/doodle/big/002.jpg b/static/image/doodle/big/002.jpg new file mode 100644 index 0000000..c0e0215 Binary files /dev/null and b/static/image/doodle/big/002.jpg differ diff --git a/static/image/doodle/big/003.jpg b/static/image/doodle/big/003.jpg new file mode 100644 index 0000000..0a1cdd8 Binary files /dev/null and b/static/image/doodle/big/003.jpg differ diff --git a/static/image/doodle/big/004.jpg b/static/image/doodle/big/004.jpg new file mode 100644 index 0000000..d05fa93 Binary files /dev/null and b/static/image/doodle/big/004.jpg differ diff --git a/static/image/doodle/big/005.jpg b/static/image/doodle/big/005.jpg new file mode 100644 index 0000000..70d1102 Binary files /dev/null and b/static/image/doodle/big/005.jpg differ diff --git a/static/image/doodle/big/006.jpg b/static/image/doodle/big/006.jpg new file mode 100644 index 0000000..876da30 Binary files /dev/null and b/static/image/doodle/big/006.jpg differ diff --git a/static/image/doodle/big/007.jpg b/static/image/doodle/big/007.jpg new file mode 100644 index 0000000..215a2e8 Binary files /dev/null and b/static/image/doodle/big/007.jpg differ diff --git a/static/image/doodle/big/008.jpg b/static/image/doodle/big/008.jpg new file mode 100644 index 0000000..5df0de4 Binary files /dev/null and b/static/image/doodle/big/008.jpg differ diff --git a/static/image/doodle/big/009.jpg b/static/image/doodle/big/009.jpg new file mode 100644 index 0000000..cffc812 Binary files /dev/null and b/static/image/doodle/big/009.jpg differ diff --git a/static/image/doodle/big/010.jpg b/static/image/doodle/big/010.jpg new file mode 100644 index 0000000..2a15ff5 Binary files /dev/null and b/static/image/doodle/big/010.jpg differ diff --git a/static/image/doodle/big/index.htm b/static/image/doodle/big/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/doodle/index.htm b/static/image/doodle/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/doodle/thumb/001.jpg b/static/image/doodle/thumb/001.jpg new file mode 100644 index 0000000..759d915 Binary files /dev/null and b/static/image/doodle/thumb/001.jpg differ diff --git a/static/image/doodle/thumb/002.jpg b/static/image/doodle/thumb/002.jpg new file mode 100644 index 0000000..ff99465 Binary files /dev/null and b/static/image/doodle/thumb/002.jpg differ diff --git a/static/image/doodle/thumb/003.jpg b/static/image/doodle/thumb/003.jpg new file mode 100644 index 0000000..4243297 Binary files /dev/null and b/static/image/doodle/thumb/003.jpg differ diff --git a/static/image/doodle/thumb/004.jpg b/static/image/doodle/thumb/004.jpg new file mode 100644 index 0000000..c8b4194 Binary files /dev/null and b/static/image/doodle/thumb/004.jpg differ diff --git a/static/image/doodle/thumb/005.jpg b/static/image/doodle/thumb/005.jpg new file mode 100644 index 0000000..0fa5235 Binary files /dev/null and b/static/image/doodle/thumb/005.jpg differ diff --git a/static/image/doodle/thumb/006.jpg b/static/image/doodle/thumb/006.jpg new file mode 100644 index 0000000..bb6f9a9 Binary files /dev/null and b/static/image/doodle/thumb/006.jpg differ diff --git a/static/image/doodle/thumb/007.jpg b/static/image/doodle/thumb/007.jpg new file mode 100644 index 0000000..c1ba1af Binary files /dev/null and b/static/image/doodle/thumb/007.jpg differ diff --git a/static/image/doodle/thumb/008.jpg b/static/image/doodle/thumb/008.jpg new file mode 100644 index 0000000..34f5ceb Binary files /dev/null and b/static/image/doodle/thumb/008.jpg differ diff --git a/static/image/doodle/thumb/009.jpg b/static/image/doodle/thumb/009.jpg new file mode 100644 index 0000000..f37b689 Binary files /dev/null and b/static/image/doodle/thumb/009.jpg differ diff --git a/static/image/doodle/thumb/010.jpg b/static/image/doodle/thumb/010.jpg new file mode 100644 index 0000000..eb33819 Binary files /dev/null and b/static/image/doodle/thumb/010.jpg differ diff --git a/static/image/doodle/thumb/index.htm b/static/image/doodle/thumb/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/editor/editor.gif b/static/image/editor/editor.gif new file mode 100644 index 0000000..fd94055 Binary files /dev/null and b/static/image/editor/editor.gif differ diff --git a/static/image/editor/editor_base.js b/static/image/editor/editor_base.js new file mode 100644 index 0000000..1eea909 --- /dev/null +++ b/static/image/editor/editor_base.js @@ -0,0 +1,760 @@ +var gSetColorType = ""; +var gIsIE = document.all; +var gIEVer = fGetIEVer(); +var gLoaded = false; +var ev = null; +var gIsHtml = true; +var pos = 0; +var sLength = 0; + +function fGetEv(e){ + ev = e; +} + +function fGetIEVer(){ + var iVerNo = 0; + var sVer = navigator.userAgent; + if(sVer.indexOf("MSIE")>-1){ + var sVerNo = sVer.split(";")[1]; + sVerNo = sVerNo.replace("MSIE",""); + iVerNo = parseFloat(sVerNo); + } + return iVerNo; +} +function fSetEditable(){ + var f = window.frames["HtmlEditor"]; + f.document.designMode="on"; + if(!gIsIE) + f.document.execCommand("useCSS",false, true); +} + +function renewContent() { + + var evalevent = function (obj) { + var script = obj.parentNode.innerHTML; + var re = /onclick="(.+?)["|>]/ig; + var matches = re.exec(script); + if(matches != null) { + matches[1] = matches[1].replace(/this\./ig, 'obj.'); + eval(matches[1]); + } + }; + + if(window.confirm('您确定要恢复上次保存?')) { + var data = loadUserdata('home'); + if(in_array((data = trim(data)), ['', 'null', 'false', null, false])) { + parent.showDialog('没有可以恢复的数据!'); + return; + } + var data = data.split(/\x09\x09/); + if(parent.$('subject')) { + var formObj = parent.$('subject').form; + } else if(parent.$('title')) { + var formObj = parent.$('title').form; + } else { + return; + } + for(var i = 0; i < formObj.elements.length; i++) { + var el = formObj.elements[i]; + if(el.name != '' && (el.tagName == 'TEXTAREA' || el.tagName == 'INPUT' && (el.type == 'text' || el.type == 'checkbox' || el.type == 'radio'))) { + for(var j = 0; j < data.length; j++) { + var ele = data[j].split(/\x09/); + if(ele[0] == el.name) { + elvalue = !isUndefined(ele[3]) ? ele[3] : ''; + if(ele[1] == 'INPUT') { + if(ele[2] == 'text') { + el.value = elvalue; + } else if((ele[2] == 'checkbox' || ele[2] == 'radio') && ele[3] == el.value) { + el.checked = true; + evalevent(el); + } + } else if(ele[1] == 'TEXTAREA') { + if(ele[0] == 'message' || ele[0] == 'content') { + var f = window.frames["HtmlEditor"]; + f.document.body.innerHTML = elvalue; + } else { + el.value = elvalue; + } + } + break + } + } + } + } + } +} +function fSetFrmClick(){ + var f = window.frames["HtmlEditor"]; + f.document.onclick = function(){ + fHideMenu(); + } + if(gIsIE) { + f.document.attachEvent("onkeydown", listenKeyDown); + } else { + f.addEventListener('keydown', function(e) {listenKeyDown(e);}, true); + } +} + +function listenKeyDown(event) { + parent.gIsEdited = true; + parent.ctrlEnter(event, 'issuance'); +} + +window.onload = function(){ + try{ + gLoaded = true; + fSetEditable(); + fSetFrmClick(); + }catch(e){ + } +} + +window.onbeforeunload = parent.edit_save; + +function fSetColor(){ + var dvForeColor =$("dvForeColor"); + if(dvForeColor.getElementsByTagName("TABLE").length == 1){ + dvForeColor.innerHTML = drawCube() + dvForeColor.innerHTML; + } +} + + +document.onmousemove = function(e){ + if(gIsIE) var el = event.srcElement; + else var el = e.target; + var tdView = $("tdView"); + var tdColorCode = $("tdColorCode"); + + if(el.tagName == "IMG"){ + try{ + if(fInObj(el, "dvForeColor")){ + tdView.bgColor = el.parentNode.bgColor; + tdColorCode.innerHTML = el.parentNode.bgColor + } + }catch(e){} + } +} +function fInObj(el, id){ + if(el){ + if(el.id == id){ + return true; + }else{ + if(el.parentNode){ + return fInObj(el.parentNode, id); + }else{ + return false; + } + } + } +} +function fDisplayObj(id){ + var o = $(id); + if(o) o.style.display = ""; +} +document.onclick = function(e){ + if(gIsIE) var el = event.srcElement; + else var el = e.target; + var dvForeColor =$("dvForeColor"); + var dvPortrait =$("dvPortrait"); + + if(el.tagName == "IMG"){ + try{ + if(fInObj(el, "dvForeColor")){ + format(gSetColorType, el.parentNode.bgColor); + dvForeColor.style.display = "none"; + return; + } + }catch(e){} + try{ + if(fInObj(el, "dvPortrait")){ + format("InsertImage", el.src); + dvPortrait.style.display = "none"; + return; + } + }catch(e){} + } + try{ + if(fInObj(el, "createUrl") || fInObj(el, "createImg") || fInObj(el, "createSwf") || fInObj(el, "createPage")){ + return; + } + }catch(e){} + fHideMenu(); + var hideId = ""; + if(arrMatch[el.id]){ + hideId = arrMatch[el.id]; + fDisplayObj(hideId); + } +} +var arrMatch = { + imgFontface:"fontface", + imgFontsize:"fontsize", + imgFontColor:"dvForeColor", + imgBackColor:"dvForeColor", + imgFace:"dvPortrait", + imgAlign:"divAlign", + imgList:"divList", + imgInOut:"divInOut", + faceBox:"editFaceBox", + icoUrl:"createUrl", + icoSwf:"createSwf", + icoPage:"createPage" +} +function format(type, para){ + var f = window.frames["HtmlEditor"]; + var sAlert = ""; + if(!gIsIE){ + switch(type){ + case "Cut": + sAlert = "您的浏览器安全设置不允许编辑器自动执行剪切操作,请使用键盘快捷键(Ctrl+X)来完成"; + break; + case "Copy": + sAlert = "您的浏览器安全设置不允许编辑器自动执行拷贝操作,请使用键盘快捷键(Ctrl+C)来完成"; + break; + case "Paste": + sAlert = "您的浏览器安全设置不允许编辑器自动执行粘贴操作,请使用键盘快捷键(Ctrl+V)来完成"; + break; + } + } + if(sAlert != ""){ + alert(sAlert); + return; + } + f.focus(); + if(!para){ + if(gIsIE){ + f.document.execCommand(type); + }else{ + f.document.execCommand(type,false,false); + } + }else{ + if(type == 'insertHTML') { + try{ + f.document.execCommand('insertHTML', false, para); + }catch(exp){ + var obj = f.document.selection.createRange(); + obj.pasteHTML(para); + obj.collapse(false); + obj.select(); + } + } else { + try{ + f.document.execCommand(type,false,para); + }catch(exp){} + } + } + f.focus(); +} +function setMode(bStatus){ + var sourceEditor = $("sourceEditor"); + var HtmlEditor = $("HtmlEditor"); + var divEditor = $("divEditor"); + var f = window.frames["HtmlEditor"]; + var body = f.document.getElementsByTagName("BODY")[0]; + if(bStatus){ + sourceEditor.style.display = "block"; + divEditor.style.display = "none"; + sourceEditor.value = body.innerHTML; + $('uchome-editstatus').value = 'code'; + }else{ + sourceEditor.style.display = "none"; + divEditor.style.display = ""; + body.innerHTML = sourceEditor.value; + $('uchome-editstatus').value = 'html'; + } +} +function foreColor(e) { + fDisplayColorBoard(e); + gSetColorType = "foreColor"; +} +function faceBox(e) { + if(gIsIE){ + var e = window.event; + } + var dvFaceBox = $("editFaceBox"); + var iX = e.clientX; + var iY = e.clientY; + dvFaceBox.style.display = ""; + dvFaceBox.style.left = (iX-140) + "px"; + dvFaceBox.style.top = 33 + "px"; + dvFaceBox.innerHTML = ""; + var faceul = document.createElement("ul"); + for(i=1; i<31; i++) { + var faceli = document.createElement("li"); + faceli.innerHTML = ''; + faceul.appendChild(faceli); + } + dvFaceBox.appendChild(faceul); + return true; +} + +function insertImg(src) { + format("insertHTML", ''); +} + +function doodleBox(event, id) { + if(parent.$('uchome-ttHtmlEditor') != null) { + parent.showWindow(id, 'home.php?mod=magic&mid=doodle&showid=blog_doodle&target=uchome-ttHtmlEditor&from=editor'); + } else { + alert("找不到涂鸦板初始化数据"); + } +} +function backColor(e){ + var sColor = fDisplayColorBoard(e); + if(gIsIE) + gSetColorType = "backcolor"; + else + gSetColorType = "backcolor"; +} + +function fDisplayColorBoard(e){ + + if(gIsIE){ + var e = window.event; + } + if(gIEVer<=5.01 && gIsIE){ + var arr = showModalDialog("ColorSelect.htm", "", "font-family:Verdana; font-size:12; status:no; dialogWidth:21em; dialogHeight:21em"); + if (arr != null) return arr; + return; + } + var dvForeColor =$("dvForeColor"); + var iX = e.clientX; + var iY = e.clientY; + dvForeColor.style.display = ""; + dvForeColor.style.left = (iX-30) + "px"; + dvForeColor.style.top = 33 + "px"; + return true; +} + +function createLink(e, show) { + if(typeof show == 'undefined') { + var urlObj = $('insertUrl'); + var sURL = urlObj.value; + if ((sURL!=null) && (sURL!="http://")){ + setCaret(); + format("CreateLink", sURL); + } + fHide($('createUrl')); + urlObj.value = 'http://'; + } else { + if(gIsIE){ + var e = window.event; + } + getCaret(); + var dvUrlBox = $("createUrl"); + var iX = e.clientX; + var iY = e.clientY; + dvUrlBox.style.display = ""; + dvUrlBox.style.left = (iX-300) + "px"; + dvUrlBox.style.top = 33 + "px"; + } +} +function getCaret() { + if(gIsIE){ + window.frames["HtmlEditor"].focus(); + var ran = window.frames["HtmlEditor"].document.selection.createRange(); + pos = ran.getBookmark(); + } +} +function setCaret() { + if(gIsIE){ + window.frames["HtmlEditor"].focus(); + var range = window.frames["HtmlEditor"].document.body.createTextRange(); + range.moveToBookmark(pos); + range.select(); + pos = null; + } +} + +function clearLink() { + format("Unlink", false); +} +function createImg(e, show) { + if(typeof show == 'undefined') { + var imgObj = $('imgUrl'); + var sPhoto = imgObj.value; + if ((sPhoto!=null) && (sPhoto!="http://")){ + setCaret(); + format("InsertImage", sPhoto); + } + fHide($('createImg')); + imgObj.value = 'http://'; + } else { + if(gIsIE){ + var e = window.event; + } + getCaret(); + var dvImgBox = $("createImg"); + var iX = e.clientX; + var iY = e.clientY; + dvImgBox.style.display = ""; + dvImgBox.style.left = (iX-300) + "px"; + dvImgBox.style.top = 33 + "px"; + } +} +function createFlash(e, show) { + if(typeof show == 'undefined') { + var flashtag = ''; + var vObj = $('videoUrl'); + var sFlash = vObj.value; + if ((sFlash!=null) && (sFlash!="http://")){ + setCaret(); + var sFlashType = $('vtype').value; + if(sFlashType==1) { + flashtag = '[flash=media]'; + } else if(sFlashType==2) { + flashtag = '[flash=real]'; + } else if(sFlashType==3) { + flashtag = '[flash=mp3]'; + } else { + flashtag = '[flash]'; + } + format("insertHTML", flashtag + sFlash + '[/flash]'); + } + fHide($('createSwf')); + vObj.value = 'http://'; + } else { + if(gIsIE){ + var e = window.event; + } + getCaret(); + var dvSwfBox = $("createSwf"); + var iX = e.clientX; + var iY = e.clientY; + dvSwfBox.style.display = ""; + dvSwfBox.style.left = (iX-350) + "px"; + dvSwfBox.style.top = 33 + "px"; + } +} +String.prototype.trim = function(){ + return this.replace(/(^\s*)|(\s*$)/g, ""); +} +function fSetBorderMouseOver(obj) { + obj.style.borderRight="1px solid #aaa"; + obj.style.borderBottom="1px solid #aaa"; + obj.style.borderTop="1px solid #fff"; + obj.style.borderLeft="1px solid #fff"; +} +function fSetBorderMouseOut(obj) { + obj.style.border="none"; +} +function fSetBorderMouseDown(obj) { + obj.style.borderRight="1px #F3F8FC solid"; + obj.style.borderBottom="1px #F3F8FC solid"; + obj.style.borderTop="1px #cccccc solid"; + obj.style.borderLeft="1px #cccccc solid"; +} +function fDisplayElement(element,displayValue) { + if(gIEVer<=5.01 && gIsIE){ + alert('只支持IE 5.01以上版本'); + return; + } + fHideMenu(); + if ( typeof element == "string" ) + element = $(element); + if (element == null) return; + element.style.display = displayValue; + if(gIsIE){ + var e = event; + var target = e.srcElement; + }else{ + var e = ev; + var target = e.target; + } + var iX = f_GetX(target); + element.style.display = ""; + element.style.left = (iX) + "px"; + element.style.top = 33 + "px"; + return true; +} +function fSetModeTip(obj){ + var x = f_GetX(obj); + var y = f_GetY(obj); + var dvModeTip = $("dvModeTip"); + if(!dvModeTip){ + var dv = document.createElement("DIV"); + dv.style.position = "absolute"; + dv.style.top = 33 + "px"; + dv.style.left = (x-40) + "px"; + dv.style.zIndex = "999"; + dv.style.fontSize = "12px"; + dv.id = "dvModeTip"; + dv.style.padding = "2px"; + dv.style.border = "1px #000000 solid"; + dv.style.backgroundColor = "#FFFFCC"; + dv.innerHTML = "编辑源码"; + document.body.appendChild(dv); + }else{ + dvModeTip.style.display = ""; + } +} +function fHideTip(){ + $("dvModeTip").style.display = "none"; +} +function f_GetX(e) +{ + var l=e.offsetLeft; + while(e=e.offsetParent){ + l+=e.offsetLeft; + } + return l; +} +function f_GetY(e) +{ + var t=e.offsetTop; + while(e=e.offsetParent){ + t+=e.offsetTop; + } + return t; +} +function fHideMenu(){ + try{ + var arr = ["fontface", "fontsize", "dvForeColor", "dvPortrait", "divAlign", "divList" ,"divInOut", "editFaceBox", "createUrl", "createImg", "createSwf", "createPage"]; + for(var i=0;i##########NextPage'+insertText+'##########

            '); + if(parent.showInnerNav && typeof parent.showInnerNav == 'function') { + parent.showInnerNav(); + } + fHide($('createPage')); + } else { + if(gIsIE){ + var e = window.event; + } + getCaret(); + var dvSwfBox = $("createPage"); + var iX = e.clientX; + var iY = e.clientY; + dvSwfBox.style.display = ""; + dvSwfBox.style.left = (iX-300) + "px"; + dvSwfBox.style.top = 33 + "px"; + } +} +function changeEditType(flag, ev){ + gIsHtml = flag; + try{ + var mod = parent.MM["compose"]; + mod.html = flag; + }catch(exp){} + try{ + var dvhtml = $("dvhtml"); + var dvtext = $("dvtext"); + var HtmlEditor = window.frames["HtmlEditor"]; + var ifmHtmlEditor = $("HtmlEditor"); + var sourceEditor = $("sourceEditor"); + var switchMode = $("switchMode"); + var sourceEditor = $("sourceEditor"); + var dvHtmlLnk = $("dvHtmlLnk"); + var dvToolbar = $('dvToolbar'); + if(flag){ + dvhtml.style.display = ""; + dvtext.style.display = "none"; + dvToolbar.className = 'toobar'; + + if(switchMode.checked){ + sourceEditor.value = dvtext.value; + $('uchome-editstatus').value = 'code'; + }else{ + if(document.all){ + HtmlEditor.document.body.innerText = dvtext.value; + } else { + HtmlEditor.document.body.innerHTML = dvtext.value.unescapeHTML(); + } + $('uchome-editstatus').value = 'html'; + } + }else{ + function sub1(){ + dvhtml.style.display = "none"; + dvtext.style.display = ""; + dvToolbar.className = 'toobarmini'; + if(switchMode.checked){ + dvtext.value = sourceEditor.value.unescapeHTML(); + }else{ + if(document.all){ + dvtext.value = HtmlEditor.document.body.innerText; + }else{ + dvtext.value = HtmlEditor.document.body.innerHTML.unescapeHTML(); + } + } + } + ev = ev || event; + if(ev){ + if(window.confirm("转换为纯文本时将会遗失某些格式。\n您确定要继续吗?")){ + $('uchome-editstatus').value = 'text'; + sub1(); + }else{ + return; + } + } + } + }catch(exp){ + + } +} + +function changeEditFull(flag, ev) { + if(parent.changeEditFull) { + parent.changeEditFull(flag); + ev = ev || event; + var ele = ev.target || ev.srcElement; + ele.innerHTML = flag ? '返回' : '全屏'; + ele.onclick = function() {changeEditFull(!flag, ev)}; + } +} +String.prototype.stripTags = function(){ + return this.replace(/<\/?[^>]+>/gi, ''); +}; +String.prototype.unescapeHTML = function(){ + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0].nodeValue; +}; +var s = ""; +var hex = new Array(6) +hex[0] = "FF" +hex[1] = "CC" +hex[2] = "99" +hex[3] = "66" +hex[4] = "33" +hex[5] = "00" +function drawCell(red, green, blue) { + var color = '#' + red + green + blue; + if(color == "#000066") color = "#000000"; + s += ''; + s += ''; + s += ''; +} +function drawRow(red, blue) { + s += ''; + + for (var i = 0; i < 6; ++i) { + drawCell(red, hex[i], blue) + } + s += ''; +} +function drawTable(blue) { + s += ''; + for (var i = 0; i < 6; ++i) { + drawRow(hex[i], blue) + } + s += '
            '; +} +function drawCube() { + s += ''; + for (var i = 0; i < 2; ++i) { + s += ''; + } + s += ''; + for (var i = 2; i < 4; ++i) { + s += ''; + } + s += '
            '; + drawTable(hex[i]) + s += '
            '; + drawTable(hex[i]) + s += '
            '; + return s; +} + +function EV(){} +EV.getTarget = fGetTarget; +EV.getEvent = fGetEvent; +EV.stopEvent = fStopEvent; +EV.stopPropagation = fStopPropagation; +EV.preventDefault = fPreventDefault; + + +function fGetTarget(ev, resolveTextNode){ + if(!ev) ev = this.getEvent(); + var t = ev.target || ev.srcElement; + + if (resolveTextNode && t && "#text" == t.nodeName) { + return t.parentNode; + } else { + return t; + } +} + +function fGetEvent (e) { + var ev = e || window.event; + + if (!ev) { + var c = this.getEvent.caller; + while (c) { + ev = c.arguments[0]; + if (ev && Event == ev.constructor) { + break; + } + c = c.caller; + } + } + + return ev; +} + +function fStopEvent(ev) { + if(!ev) ev = this.getEvent(); + this.stopPropagation(ev); + this.preventDefault(ev); +} + + +function fStopPropagation(ev) { + if(!ev) ev = this.getEvent(); + if (ev.stopPropagation) { + ev.stopPropagation(); + } else { + ev.cancelBubble = true; + } +} + + +function fPreventDefault(ev) { + if(!ev) ev = this.getEvent(); + if (ev.preventDefault) { + ev.preventDefault(); + } else { + ev.returnValue = false; + } +} + +function getExt(path) { + return path.lastIndexOf('.') == -1 ? '' : path.substr(path.lastIndexOf('.') + 1, path.length).toLowerCase(); +} + +function checkURL(obj, mod) { + if(mod) { + if(obj.value == 'http://') { + obj.value = ''; + } + } else { + if(obj.value == '') { + obj.value = 'http://'; + } + } +} \ No newline at end of file diff --git a/static/image/editor/editor_boolbar.gif b/static/image/editor/editor_boolbar.gif new file mode 100644 index 0000000..6def459 Binary files /dev/null and b/static/image/editor/editor_boolbar.gif differ diff --git a/static/image/editor/editor_file_thumb.png b/static/image/editor/editor_file_thumb.png new file mode 100644 index 0000000..8c502a9 Binary files /dev/null and b/static/image/editor/editor_file_thumb.png differ diff --git a/static/image/editor/editor_function.js b/static/image/editor/editor_function.js new file mode 100644 index 0000000..993aaf2 --- /dev/null +++ b/static/image/editor/editor_function.js @@ -0,0 +1,217 @@ +function uploadEdit(obj) { + mainForm = obj.form; + forms = $('attachbody').getElementsByTagName("FORM"); + albumid = $('uploadalbum').value; + edit_save(); + upload(); +} + +function edit_save() { + var p = window.frames['uchome-ifrHtmlEditor']; + var obj = p.window.frames['HtmlEditor']; + var status = p.document.getElementById('uchome-editstatus').value; + if(status == 'code') { + $('uchome-ttHtmlEditor').value = p.document.getElementById('sourceEditor').value; + } else if(status == 'text') { + if(BROWSER.ie) { + obj.document.body.innerText = p.document.getElementById('dvtext').value; + $('uchome-ttHtmlEditor').value = obj.document.body.innerHTML; + } else { + obj.document.body.textContent = p.document.getElementById('dvtext').value; + var sOutText = obj.document.body.innerHTML; + $('uchome-ttHtmlEditor').value = sOutText.replace(/\r\n|\n/g,"
            "); + } + } else { + $('uchome-ttHtmlEditor').value = obj.document.body.innerHTML; + } + backupContent($('uchome-ttHtmlEditor').value); +} + +function downRemoteFile() { + edit_save(); + var formObj = $("articleform"); + var oldAction = formObj.action; + formObj.action = "portal.php?mod=portalcp&ac=upload&op=downremotefile"; + formObj.onSubmit = ""; + formObj.target = "uploadframe"; + formObj.submit(); + formObj.action = oldAction; + formObj.target = ""; +} +function backupContent(sHTML) { + if(sHTML.length > 11) { + var obj = $('uchome-ttHtmlEditor').form; + if(!obj) return; + var data = subject = message = ''; + for(var i = 0; i < obj.elements.length; i++) { + var el = obj.elements[i]; + if(el.name != '' && (el.tagName == 'TEXTAREA' || el.tagName == 'INPUT' && (el.type == 'text' || el.type == 'checkbox' || el.type == 'radio')) && el.name.substr(0, 6) != 'attach') { + var elvalue = el.value; + if(el.name == 'subject' || el.name == 'title') { + subject = trim(elvalue); + } else if(el.name == 'message' || el.name == 'content') { + message = trim(elvalue); + } + if((el.type == 'checkbox' || el.type == 'radio') && !el.checked) { + continue; + } + if(trim(elvalue)) { + data += el.name + String.fromCharCode(9) + el.tagName + String.fromCharCode(9) + el.type + String.fromCharCode(9) + elvalue + String.fromCharCode(9, 9); + } + } + } + + if(!subject && !message) { + return; + } + saveUserdata('home', data); + } +} + +function edit_insert(html) { + var p = window.frames['uchome-ifrHtmlEditor']; + var obj = p.window.frames['HtmlEditor']; + var status = p.document.getElementById('uchome-editstatus').value; + if(status != 'html') { + alert('本操作只在多媒体编辑模式下才有效'); + return; + } + obj.focus(); + if(BROWSER.ie){ + var f = obj.document.selection.createRange(); + f.pasteHTML(html); + f.collapse(false); + f.select(); + } else { + obj.document.execCommand('insertHTML', false, html); + } +} + +function insertImage(image, url, width, height) { + url = typeof url == 'undefined' || url === null ? image : url; + width = typeof width == 'undefined' || width === null ? 0 : parseInt(width); + height = typeof height == 'undefined' || height === null ? 0 : parseInt(height); + var html = '

            '; + edit_insert(html); +} + +function insertFile(file, url) { + url = typeof url == 'undefined' || url === null ? image : url; + var html = '

            ' + file + '

            '; + edit_insert(html); +} + +function createImageBox(fn) { + if(typeof fn == 'function' && !fn()) { + return false; + } + var menu = $('icoImg_image_menu'); + if(menu) { + if(menu.style.visibility == 'hidden') { + menu.style.visibility = 'visible'; + } else { + menu.style.width = '600px'; + showMenu({'ctrlid':'icoImg_image','mtype':'win','evt':'click','pos':'00','timeout':250,'duration':3,'drag':'icoImg_image_ctrl'}); + } + } +} + +function createAttachBox(fn) { + if(typeof fn == 'function' && !fn()) { + return false; + } + var menu = $('icoAttach_attach_menu'); + if(menu) { + if(menu.style.visibility == 'hidden') { + menu.style.visibility = 'visible'; + } else { + menu.style.width = '600px'; + showMenu({'ctrlid':'icoAttach_attach','mtype':'win','evt':'click','pos':'00','timeout':250,'duration':3,'drag':'icoAttach_attach_ctrl'}); + } + } +} + +function switchButton(btn, type) { + var btnpre = 'icoImg_btn_'; + if(!$(btnpre + btn) || !$('icoImg_' + btn)) { + return; + } + var tabs = $('icoImg_' + type + '_ctrl').getElementsByTagName('LI'); + $(btnpre + btn).style.display = ''; + $('icoImg_' + btn).style.display = ''; + $(btnpre + btn).className = 'current'; + var btni = ''; + for(i = 0;i < tabs.length;i++) { + if(tabs[i].id.indexOf(btnpre) !== -1) { + btni = tabs[i].id.substr(btnpre.length); + } + if(btni != btn) { + if(!$('icoImg_' + btni) || !$('icoImg_btn_' + btni)) { + continue; + } + $('icoImg_' + btni).style.display = 'none'; + $('icoImg_btn_' + btni).className = ''; + } + } +} + + +function changeEditFull(flag) { + var ifrHtmlEditor = $('uchome-ifrHtmlEditor'); + var editor = ifrHtmlEditor.parentNode; + if(flag) { + document.body.scroll = 'no'; + document.body.style.overflow = 'hidden'; + window.resize = function(){changeEditFull(1)}; + editor.style.top = '0'; + editor.style.left = '0'; + editor.style.position = 'fixed'; + editor.style.width = '100%'; + editor.setAttribute('srcheight', editor.style.height); + editor.style.height = '100%'; + editor.style.minWidth = '800px'; + editor.style.zIndex = '300'; + ifrHtmlEditor.style.height = '100%'; + ifrHtmlEditor.style.zoom = ifrHtmlEditor.style.zoom=="1"?"100%":"1"; + } else { + document.body.scroll = 'yes'; + document.body.style.overflow = 'auto'; + window.resize = null; + editor.style.position = ''; + editor.style.width = ''; + editor.style.height = editor.getAttribute('srcheight'); + } + doane(); +} + +function showInnerNav(){ + var navtitle = $('innernavele'); + var pagetitle = $('pagetitle'); + if(navtitle && navtitle.style.display == 'none') { + navtitle.style.display = ''; + } + if(pagetitle && pagetitle.style.display == 'none') { + pagetitle.style.display = ''; + } +} + +function loadimgsize(imgurl, editor, p) { + var editor = !editor ? 'icoImg' : editor; + var s = new Object(); + var p = !p ? '_image' : p; + $(editor + p + '_param_2').value = ''; + $(editor + p + '_param_3').value = ''; + s.img = new Image(); + s.img.src = imgurl; + s.loadCheck = function () { + if($(editor + p + '_param_1').value == imgurl) { + if(s.img.complete) { + $(editor + p + '_param_2').value = s.img.width ? s.img.width : ''; + $(editor + p + '_param_3').value = s.img.height ? s.img.height : ''; + } else { + setTimeout(function () {s.loadCheck();}, 100); + } + } + }; + s.loadCheck(); +} \ No newline at end of file diff --git a/static/image/editor/editor_none.gif b/static/image/editor/editor_none.gif new file mode 100644 index 0000000..d36072c Binary files /dev/null and b/static/image/editor/editor_none.gif differ diff --git a/static/image/editor/index.htm b/static/image/editor/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/editor/resize.gif b/static/image/editor/resize.gif new file mode 100644 index 0000000..6a1b41c Binary files /dev/null and b/static/image/editor/resize.gif differ diff --git a/static/image/feed/activity.gif b/static/image/feed/activity.gif new file mode 100644 index 0000000..c897a72 Binary files /dev/null and b/static/image/feed/activity.gif differ diff --git a/static/image/feed/album.gif b/static/image/feed/album.gif new file mode 100644 index 0000000..0e203b2 Binary files /dev/null and b/static/image/feed/album.gif differ diff --git a/static/image/feed/album_b.png b/static/image/feed/album_b.png new file mode 100644 index 0000000..e2b2294 Binary files /dev/null and b/static/image/feed/album_b.png differ diff --git a/static/image/feed/article.gif b/static/image/feed/article.gif new file mode 100644 index 0000000..55ae142 Binary files /dev/null and b/static/image/feed/article.gif differ diff --git a/static/image/feed/blog.gif b/static/image/feed/blog.gif new file mode 100644 index 0000000..08548f3 Binary files /dev/null and b/static/image/feed/blog.gif differ diff --git a/static/image/feed/blog_b.png b/static/image/feed/blog_b.png new file mode 100644 index 0000000..51522a4 Binary files /dev/null and b/static/image/feed/blog_b.png differ diff --git a/static/image/feed/click.gif b/static/image/feed/click.gif new file mode 100644 index 0000000..7b74b51 Binary files /dev/null and b/static/image/feed/click.gif differ diff --git a/static/image/feed/collection_b.png b/static/image/feed/collection_b.png new file mode 100644 index 0000000..6e1bd87 Binary files /dev/null and b/static/image/feed/collection_b.png differ diff --git a/static/image/feed/comment.gif b/static/image/feed/comment.gif new file mode 100644 index 0000000..1391126 Binary files /dev/null and b/static/image/feed/comment.gif differ diff --git a/static/image/feed/credit.gif b/static/image/feed/credit.gif new file mode 100644 index 0000000..5affd78 Binary files /dev/null and b/static/image/feed/credit.gif differ diff --git a/static/image/feed/debate.gif b/static/image/feed/debate.gif new file mode 100644 index 0000000..b72c593 Binary files /dev/null and b/static/image/feed/debate.gif differ diff --git a/static/image/feed/discuz.gif b/static/image/feed/discuz.gif new file mode 100644 index 0000000..97f7349 Binary files /dev/null and b/static/image/feed/discuz.gif differ diff --git a/static/image/feed/doing.gif b/static/image/feed/doing.gif new file mode 100644 index 0000000..acccb13 Binary files /dev/null and b/static/image/feed/doing.gif differ diff --git a/static/image/feed/doing_b.png b/static/image/feed/doing_b.png new file mode 100644 index 0000000..7486741 Binary files /dev/null and b/static/image/feed/doing_b.png differ diff --git a/static/image/feed/dzwap_b.png b/static/image/feed/dzwap_b.png new file mode 100644 index 0000000..c10d6d2 Binary files /dev/null and b/static/image/feed/dzwap_b.png differ diff --git a/static/image/feed/event.gif b/static/image/feed/event.gif new file mode 100644 index 0000000..0ebb55d Binary files /dev/null and b/static/image/feed/event.gif differ diff --git a/static/image/feed/favorite.gif b/static/image/feed/favorite.gif new file mode 100644 index 0000000..c7b942b Binary files /dev/null and b/static/image/feed/favorite.gif differ diff --git a/static/image/feed/favorite_b.png b/static/image/feed/favorite_b.png new file mode 100644 index 0000000..a2ac0ab Binary files /dev/null and b/static/image/feed/favorite_b.png differ diff --git a/static/image/feed/feed_announce.gif b/static/image/feed/feed_announce.gif new file mode 100644 index 0000000..cc419b0 Binary files /dev/null and b/static/image/feed/feed_announce.gif differ diff --git a/static/image/feed/feed_b.png b/static/image/feed/feed_b.png new file mode 100644 index 0000000..a1dfa28 Binary files /dev/null and b/static/image/feed/feed_b.png differ diff --git a/static/image/feed/file.gif b/static/image/feed/file.gif new file mode 100644 index 0000000..8226b9b Binary files /dev/null and b/static/image/feed/file.gif differ diff --git a/static/image/feed/follow.gif b/static/image/feed/follow.gif new file mode 100644 index 0000000..7a5f3b5 Binary files /dev/null and b/static/image/feed/follow.gif differ diff --git a/static/image/feed/follow_b.png b/static/image/feed/follow_b.png new file mode 100644 index 0000000..f74cdfc Binary files /dev/null and b/static/image/feed/follow_b.png differ diff --git a/static/image/feed/friend.gif b/static/image/feed/friend.gif new file mode 100644 index 0000000..a10ce94 Binary files /dev/null and b/static/image/feed/friend.gif differ diff --git a/static/image/feed/friend_b.png b/static/image/feed/friend_b.png new file mode 100644 index 0000000..7645431 Binary files /dev/null and b/static/image/feed/friend_b.png differ diff --git a/static/image/feed/goods.gif b/static/image/feed/goods.gif new file mode 100644 index 0000000..ee9eab8 Binary files /dev/null and b/static/image/feed/goods.gif differ diff --git a/static/image/feed/group.gif b/static/image/feed/group.gif new file mode 100644 index 0000000..872deb5 Binary files /dev/null and b/static/image/feed/group.gif differ diff --git a/static/image/feed/group_b.png b/static/image/feed/group_b.png new file mode 100644 index 0000000..436fa9f Binary files /dev/null and b/static/image/feed/group_b.png differ diff --git a/static/image/feed/guide_b.png b/static/image/feed/guide_b.png new file mode 100644 index 0000000..72d095c Binary files /dev/null and b/static/image/feed/guide_b.png differ diff --git a/static/image/feed/impression.gif b/static/image/feed/impression.gif new file mode 100644 index 0000000..693dcab Binary files /dev/null and b/static/image/feed/impression.gif differ diff --git a/static/image/feed/index.htm b/static/image/feed/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/feed/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/feed/magic.gif b/static/image/feed/magic.gif new file mode 100644 index 0000000..ebd3171 Binary files /dev/null and b/static/image/feed/magic.gif differ diff --git a/static/image/feed/magic_b.png b/static/image/feed/magic_b.png new file mode 100644 index 0000000..70ca481 Binary files /dev/null and b/static/image/feed/magic_b.png differ diff --git a/static/image/feed/medal.gif b/static/image/feed/medal.gif new file mode 100644 index 0000000..e0d7e7f Binary files /dev/null and b/static/image/feed/medal.gif differ diff --git a/static/image/feed/medal_b.png b/static/image/feed/medal_b.png new file mode 100644 index 0000000..787f1ed Binary files /dev/null and b/static/image/feed/medal_b.png differ diff --git a/static/image/feed/mood.gif b/static/image/feed/mood.gif new file mode 100644 index 0000000..6e99314 Binary files /dev/null and b/static/image/feed/mood.gif differ diff --git a/static/image/feed/mtag.gif b/static/image/feed/mtag.gif new file mode 100644 index 0000000..872deb5 Binary files /dev/null and b/static/image/feed/mtag.gif differ diff --git a/static/image/feed/network.gif b/static/image/feed/network.gif new file mode 100644 index 0000000..1899ada Binary files /dev/null and b/static/image/feed/network.gif differ diff --git a/static/image/feed/notice.gif b/static/image/feed/notice.gif new file mode 100644 index 0000000..4964a76 Binary files /dev/null and b/static/image/feed/notice.gif differ diff --git a/static/image/feed/nts.gif b/static/image/feed/nts.gif new file mode 100644 index 0000000..31f2771 Binary files /dev/null and b/static/image/feed/nts.gif differ diff --git a/static/image/feed/pm.gif b/static/image/feed/pm.gif new file mode 100644 index 0000000..07a7489 Binary files /dev/null and b/static/image/feed/pm.gif differ diff --git a/static/image/feed/poke.gif b/static/image/feed/poke.gif new file mode 100644 index 0000000..93ea44d Binary files /dev/null and b/static/image/feed/poke.gif differ diff --git a/static/image/feed/poll.gif b/static/image/feed/poll.gif new file mode 100644 index 0000000..aa50e4d Binary files /dev/null and b/static/image/feed/poll.gif differ diff --git a/static/image/feed/portal_b.png b/static/image/feed/portal_b.png new file mode 100644 index 0000000..1ad0258 Binary files /dev/null and b/static/image/feed/portal_b.png differ diff --git a/static/image/feed/post.gif b/static/image/feed/post.gif new file mode 100644 index 0000000..7a083e8 Binary files /dev/null and b/static/image/feed/post.gif differ diff --git a/static/image/feed/post_magic.gif b/static/image/feed/post_magic.gif new file mode 100644 index 0000000..759c750 Binary files /dev/null and b/static/image/feed/post_magic.gif differ diff --git a/static/image/feed/post_rate.gif b/static/image/feed/post_rate.gif new file mode 100644 index 0000000..1793fda Binary files /dev/null and b/static/image/feed/post_rate.gif differ diff --git a/static/image/feed/profile.gif b/static/image/feed/profile.gif new file mode 100644 index 0000000..b4e921d Binary files /dev/null and b/static/image/feed/profile.gif differ diff --git a/static/image/feed/ranklist_b.png b/static/image/feed/ranklist_b.png new file mode 100644 index 0000000..c53c8d9 Binary files /dev/null and b/static/image/feed/ranklist_b.png differ diff --git a/static/image/feed/report.gif b/static/image/feed/report.gif new file mode 100644 index 0000000..c227323 Binary files /dev/null and b/static/image/feed/report.gif differ diff --git a/static/image/feed/reward.gif b/static/image/feed/reward.gif new file mode 100644 index 0000000..80dbdb3 Binary files /dev/null and b/static/image/feed/reward.gif differ diff --git a/static/image/feed/share.gif b/static/image/feed/share.gif new file mode 100644 index 0000000..c50f5b6 Binary files /dev/null and b/static/image/feed/share.gif differ diff --git a/static/image/feed/share_b.png b/static/image/feed/share_b.png new file mode 100644 index 0000000..b4d3ae3 Binary files /dev/null and b/static/image/feed/share_b.png differ diff --git a/static/image/feed/show.gif b/static/image/feed/show.gif new file mode 100644 index 0000000..f7bdf0b Binary files /dev/null and b/static/image/feed/show.gif differ diff --git a/static/image/feed/sitefeed.gif b/static/image/feed/sitefeed.gif new file mode 100644 index 0000000..4964a76 Binary files /dev/null and b/static/image/feed/sitefeed.gif differ diff --git a/static/image/feed/task.gif b/static/image/feed/task.gif new file mode 100644 index 0000000..ec094ee Binary files /dev/null and b/static/image/feed/task.gif differ diff --git a/static/image/feed/task_b.png b/static/image/feed/task_b.png new file mode 100644 index 0000000..71a42e9 Binary files /dev/null and b/static/image/feed/task_b.png differ diff --git a/static/image/feed/thread.gif b/static/image/feed/thread.gif new file mode 100644 index 0000000..406a89d Binary files /dev/null and b/static/image/feed/thread.gif differ diff --git a/static/image/feed/thread_b.png b/static/image/feed/thread_b.png new file mode 100644 index 0000000..2a45bcb Binary files /dev/null and b/static/image/feed/thread_b.png differ diff --git a/static/image/feed/thread_del.gif b/static/image/feed/thread_del.gif new file mode 100644 index 0000000..a64bc1f Binary files /dev/null and b/static/image/feed/thread_del.gif differ diff --git a/static/image/feed/thread_digest.gif b/static/image/feed/thread_digest.gif new file mode 100644 index 0000000..68d6233 Binary files /dev/null and b/static/image/feed/thread_digest.gif differ diff --git a/static/image/feed/thread_highlight.gif b/static/image/feed/thread_highlight.gif new file mode 100644 index 0000000..a64bc1f Binary files /dev/null and b/static/image/feed/thread_highlight.gif differ diff --git a/static/image/feed/thread_magic.gif b/static/image/feed/thread_magic.gif new file mode 100644 index 0000000..759c750 Binary files /dev/null and b/static/image/feed/thread_magic.gif differ diff --git a/static/image/feed/thread_move.gif b/static/image/feed/thread_move.gif new file mode 100644 index 0000000..a64bc1f Binary files /dev/null and b/static/image/feed/thread_move.gif differ diff --git a/static/image/feed/thread_pin.gif b/static/image/feed/thread_pin.gif new file mode 100644 index 0000000..7eb5b0e Binary files /dev/null and b/static/image/feed/thread_pin.gif differ diff --git a/static/image/feed/thread_rate.gif b/static/image/feed/thread_rate.gif new file mode 100644 index 0000000..1793fda Binary files /dev/null and b/static/image/feed/thread_rate.gif differ diff --git a/static/image/feed/thread_recommend.gif b/static/image/feed/thread_recommend.gif new file mode 100644 index 0000000..5c2248a Binary files /dev/null and b/static/image/feed/thread_recommend.gif differ diff --git a/static/image/feed/thread_replies.gif b/static/image/feed/thread_replies.gif new file mode 100644 index 0000000..a64bc1f Binary files /dev/null and b/static/image/feed/thread_replies.gif differ diff --git a/static/image/feed/thread_views.gif b/static/image/feed/thread_views.gif new file mode 100644 index 0000000..a64bc1f Binary files /dev/null and b/static/image/feed/thread_views.gif differ diff --git a/static/image/feed/thunder.gif b/static/image/feed/thunder.gif new file mode 100644 index 0000000..06a441e Binary files /dev/null and b/static/image/feed/thunder.gif differ diff --git a/static/image/feed/trace.gif b/static/image/feed/trace.gif new file mode 100644 index 0000000..7b74b51 Binary files /dev/null and b/static/image/feed/trace.gif differ diff --git a/static/image/feed/user_credit.gif b/static/image/feed/user_credit.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/feed/user_credit.gif differ diff --git a/static/image/feed/user_digest.gif b/static/image/feed/user_digest.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/feed/user_digest.gif differ diff --git a/static/image/feed/user_medal.gif b/static/image/feed/user_medal.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/feed/user_medal.gif differ diff --git a/static/image/feed/user_posts.gif b/static/image/feed/user_posts.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/feed/user_posts.gif differ diff --git a/static/image/feed/user_profile.gif b/static/image/feed/user_profile.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/feed/user_profile.gif differ diff --git a/static/image/feed/user_threads.gif b/static/image/feed/user_threads.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/feed/user_threads.gif differ diff --git a/static/image/feed/user_usergroup.gif b/static/image/feed/user_usergroup.gif new file mode 100644 index 0000000..ee45a9a Binary files /dev/null and b/static/image/feed/user_usergroup.gif differ diff --git a/static/image/feed/video.gif b/static/image/feed/video.gif new file mode 100644 index 0000000..b234f94 Binary files /dev/null and b/static/image/feed/video.gif differ diff --git a/static/image/feed/wall.gif b/static/image/feed/wall.gif new file mode 100644 index 0000000..e7927d8 Binary files /dev/null and b/static/image/feed/wall.gif differ diff --git a/static/image/feed/wall_b.png b/static/image/feed/wall_b.png new file mode 100644 index 0000000..e24f057 Binary files /dev/null and b/static/image/feed/wall_b.png differ diff --git a/static/image/filetype/av.gif b/static/image/filetype/av.gif new file mode 100644 index 0000000..aefa744 Binary files /dev/null and b/static/image/filetype/av.gif differ diff --git a/static/image/filetype/binary.gif b/static/image/filetype/binary.gif new file mode 100644 index 0000000..0786a57 Binary files /dev/null and b/static/image/filetype/binary.gif differ diff --git a/static/image/filetype/common.gif b/static/image/filetype/common.gif new file mode 100644 index 0000000..61a937e Binary files /dev/null and b/static/image/filetype/common.gif differ diff --git a/static/image/filetype/common_new.gif b/static/image/filetype/common_new.gif new file mode 100644 index 0000000..4dee82f Binary files /dev/null and b/static/image/filetype/common_new.gif differ diff --git a/static/image/filetype/file-excel.png b/static/image/filetype/file-excel.png new file mode 100644 index 0000000..3829e0f Binary files /dev/null and b/static/image/filetype/file-excel.png differ diff --git a/static/image/filetype/file-image.png b/static/image/filetype/file-image.png new file mode 100644 index 0000000..4440502 Binary files /dev/null and b/static/image/filetype/file-image.png differ diff --git a/static/image/filetype/file-music.png b/static/image/filetype/file-music.png new file mode 100644 index 0000000..23421eb Binary files /dev/null and b/static/image/filetype/file-music.png differ diff --git a/static/image/filetype/file-video.png b/static/image/filetype/file-video.png new file mode 100644 index 0000000..35ed214 Binary files /dev/null and b/static/image/filetype/file-video.png differ diff --git a/static/image/filetype/file-word.png b/static/image/filetype/file-word.png new file mode 100644 index 0000000..fb4e931 Binary files /dev/null and b/static/image/filetype/file-word.png differ diff --git a/static/image/filetype/file-zip.png b/static/image/filetype/file-zip.png new file mode 100644 index 0000000..b29f57a Binary files /dev/null and b/static/image/filetype/file-zip.png differ diff --git a/static/image/filetype/flash.gif b/static/image/filetype/flash.gif new file mode 100644 index 0000000..f3293e1 Binary files /dev/null and b/static/image/filetype/flash.gif differ diff --git a/static/image/filetype/html.gif b/static/image/filetype/html.gif new file mode 100644 index 0000000..d189e19 Binary files /dev/null and b/static/image/filetype/html.gif differ diff --git a/static/image/filetype/image.gif b/static/image/filetype/image.gif new file mode 100644 index 0000000..16e6f21 Binary files /dev/null and b/static/image/filetype/image.gif differ diff --git a/static/image/filetype/image_s.gif b/static/image/filetype/image_s.gif new file mode 100644 index 0000000..c9ef763 Binary files /dev/null and b/static/image/filetype/image_s.gif differ diff --git a/static/image/filetype/index.htm b/static/image/filetype/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/filetype/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/filetype/msoffice.gif b/static/image/filetype/msoffice.gif new file mode 100644 index 0000000..2620246 Binary files /dev/null and b/static/image/filetype/msoffice.gif differ diff --git a/static/image/filetype/pdf.gif b/static/image/filetype/pdf.gif new file mode 100644 index 0000000..8ea6a7d Binary files /dev/null and b/static/image/filetype/pdf.gif differ diff --git a/static/image/filetype/rar.gif b/static/image/filetype/rar.gif new file mode 100644 index 0000000..db71ae4 Binary files /dev/null and b/static/image/filetype/rar.gif differ diff --git a/static/image/filetype/real.gif b/static/image/filetype/real.gif new file mode 100644 index 0000000..737b563 Binary files /dev/null and b/static/image/filetype/real.gif differ diff --git a/static/image/filetype/text.gif b/static/image/filetype/text.gif new file mode 100644 index 0000000..39d870f Binary files /dev/null and b/static/image/filetype/text.gif differ diff --git a/static/image/filetype/torrent.gif b/static/image/filetype/torrent.gif new file mode 100644 index 0000000..50cd92b Binary files /dev/null and b/static/image/filetype/torrent.gif differ diff --git a/static/image/filetype/unknown.gif b/static/image/filetype/unknown.gif new file mode 100644 index 0000000..0205ec1 Binary files /dev/null and b/static/image/filetype/unknown.gif differ diff --git a/static/image/filetype/zip.gif b/static/image/filetype/zip.gif new file mode 100644 index 0000000..db71ae4 Binary files /dev/null and b/static/image/filetype/zip.gif differ diff --git a/static/image/foreground/default/categories.txt b/static/image/foreground/default/categories.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/static/image/foreground/default/categories.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/static/image/foreground/default/img001.png b/static/image/foreground/default/img001.png new file mode 100644 index 0000000..30c0aed Binary files /dev/null and b/static/image/foreground/default/img001.png differ diff --git a/static/image/foreground/default/index.htm b/static/image/foreground/default/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/foreground/index.htm b/static/image/foreground/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/foreground/nature/categories.txt b/static/image/foreground/nature/categories.txt new file mode 100644 index 0000000..810cc86 --- /dev/null +++ b/static/image/foreground/nature/categories.txt @@ -0,0 +1 @@ +nature \ No newline at end of file diff --git a/static/image/foreground/nature/img101.png b/static/image/foreground/nature/img101.png new file mode 100644 index 0000000..3cf6b6e Binary files /dev/null and b/static/image/foreground/nature/img101.png differ diff --git a/static/image/foreground/nature/index.htm b/static/image/foreground/nature/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/help/album.gif b/static/image/help/album.gif new file mode 100644 index 0000000..6d72257 Binary files /dev/null and b/static/image/help/album.gif differ diff --git a/static/image/help/blog.gif b/static/image/help/blog.gif new file mode 100644 index 0000000..a5492b5 Binary files /dev/null and b/static/image/help/blog.gif differ diff --git a/static/image/help/cp.gif b/static/image/help/cp.gif new file mode 100644 index 0000000..1d02d97 Binary files /dev/null and b/static/image/help/cp.gif differ diff --git a/static/image/help/cp2.gif b/static/image/help/cp2.gif new file mode 100644 index 0000000..9e33efe Binary files /dev/null and b/static/image/help/cp2.gif differ diff --git a/static/image/help/doing.gif b/static/image/help/doing.gif new file mode 100644 index 0000000..97d8438 Binary files /dev/null and b/static/image/help/doing.gif differ diff --git a/static/image/help/home.gif b/static/image/help/home.gif new file mode 100644 index 0000000..4399565 Binary files /dev/null and b/static/image/help/home.gif differ diff --git a/static/image/help/home2.gif b/static/image/help/home2.gif new file mode 100644 index 0000000..463fa69 Binary files /dev/null and b/static/image/help/home2.gif differ diff --git a/static/image/help/index.htm b/static/image/help/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/help/mtag1.gif b/static/image/help/mtag1.gif new file mode 100644 index 0000000..6501b6d Binary files /dev/null and b/static/image/help/mtag1.gif differ diff --git a/static/image/help/mtag2.gif b/static/image/help/mtag2.gif new file mode 100644 index 0000000..6f9fe09 Binary files /dev/null and b/static/image/help/mtag2.gif differ diff --git a/static/image/help/mtag3.gif b/static/image/help/mtag3.gif new file mode 100644 index 0000000..6b152ca Binary files /dev/null and b/static/image/help/mtag3.gif differ diff --git a/static/image/help/register.gif b/static/image/help/register.gif new file mode 100644 index 0000000..8cca3b1 Binary files /dev/null and b/static/image/help/register.gif differ diff --git a/static/image/help/share1.gif b/static/image/help/share1.gif new file mode 100644 index 0000000..ea0d906 Binary files /dev/null and b/static/image/help/share1.gif differ diff --git a/static/image/help/share2.gif b/static/image/help/share2.gif new file mode 100644 index 0000000..8b7b692 Binary files /dev/null and b/static/image/help/share2.gif differ diff --git a/static/image/help/space.gif b/static/image/help/space.gif new file mode 100644 index 0000000..e25f4c1 Binary files /dev/null and b/static/image/help/space.gif differ diff --git a/static/image/hrline/0.gif b/static/image/hrline/0.gif new file mode 100644 index 0000000..029c2b8 Binary files /dev/null and b/static/image/hrline/0.gif differ diff --git a/static/image/hrline/1.gif b/static/image/hrline/1.gif new file mode 100644 index 0000000..cd31cac Binary files /dev/null and b/static/image/hrline/1.gif differ diff --git a/static/image/hrline/2.gif b/static/image/hrline/2.gif new file mode 100644 index 0000000..b9d7925 Binary files /dev/null and b/static/image/hrline/2.gif differ diff --git a/static/image/hrline/3.gif b/static/image/hrline/3.gif new file mode 100644 index 0000000..74e23a3 Binary files /dev/null and b/static/image/hrline/3.gif differ diff --git a/static/image/hrline/4.gif b/static/image/hrline/4.gif new file mode 100644 index 0000000..2f32a96 Binary files /dev/null and b/static/image/hrline/4.gif differ diff --git a/static/image/hrline/5.gif b/static/image/hrline/5.gif new file mode 100644 index 0000000..3607435 Binary files /dev/null and b/static/image/hrline/5.gif differ diff --git a/static/image/hrline/index.htm b/static/image/hrline/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/hrline/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/hrline/line1.png b/static/image/hrline/line1.png new file mode 100644 index 0000000..195339a Binary files /dev/null and b/static/image/hrline/line1.png differ diff --git a/static/image/hrline/line2.png b/static/image/hrline/line2.png new file mode 100644 index 0000000..f6f16f6 Binary files /dev/null and b/static/image/hrline/line2.png differ diff --git a/static/image/hrline/line3.png b/static/image/hrline/line3.png new file mode 100644 index 0000000..3dd8a43 Binary files /dev/null and b/static/image/hrline/line3.png differ diff --git a/static/image/hrline/line4.png b/static/image/hrline/line4.png new file mode 100644 index 0000000..d2a0e79 Binary files /dev/null and b/static/image/hrline/line4.png differ diff --git a/static/image/hrline/line5.png b/static/image/hrline/line5.png new file mode 100644 index 0000000..a1715ee Binary files /dev/null and b/static/image/hrline/line5.png differ diff --git a/static/image/hrline/line6.png b/static/image/hrline/line6.png new file mode 100644 index 0000000..0df5d85 Binary files /dev/null and b/static/image/hrline/line6.png differ diff --git a/static/image/hrline/line7.png b/static/image/hrline/line7.png new file mode 100644 index 0000000..6a22399 Binary files /dev/null and b/static/image/hrline/line7.png differ diff --git a/static/image/hrline/line8.png b/static/image/hrline/line8.png new file mode 100644 index 0000000..ea44a9a Binary files /dev/null and b/static/image/hrline/line8.png differ diff --git a/static/image/hrline/line9.png b/static/image/hrline/line9.png new file mode 100644 index 0000000..381730e Binary files /dev/null and b/static/image/hrline/line9.png differ diff --git a/static/image/index.htm b/static/image/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/magic/anonymous.gif b/static/image/magic/anonymous.gif new file mode 100644 index 0000000..f2583d3 Binary files /dev/null and b/static/image/magic/anonymous.gif differ diff --git a/static/image/magic/anonymous.small.gif b/static/image/magic/anonymous.small.gif new file mode 100644 index 0000000..1b20412 Binary files /dev/null and b/static/image/magic/anonymous.small.gif differ diff --git a/static/image/magic/anonymouspost.gif b/static/image/magic/anonymouspost.gif new file mode 100644 index 0000000..1b4efa6 Binary files /dev/null and b/static/image/magic/anonymouspost.gif differ diff --git a/static/image/magic/anonymouspost.small.gif b/static/image/magic/anonymouspost.small.gif new file mode 100644 index 0000000..6d810a9 Binary files /dev/null and b/static/image/magic/anonymouspost.small.gif differ diff --git a/static/image/magic/attachsize.gif b/static/image/magic/attachsize.gif new file mode 100644 index 0000000..ac46a11 Binary files /dev/null and b/static/image/magic/attachsize.gif differ diff --git a/static/image/magic/attachsize.small.gif b/static/image/magic/attachsize.small.gif new file mode 100644 index 0000000..e68586f Binary files /dev/null and b/static/image/magic/attachsize.small.gif differ diff --git a/static/image/magic/bgimage.gif b/static/image/magic/bgimage.gif new file mode 100644 index 0000000..f743c5e Binary files /dev/null and b/static/image/magic/bgimage.gif differ diff --git a/static/image/magic/bgimage.small.gif b/static/image/magic/bgimage.small.gif new file mode 100644 index 0000000..c49b7ae Binary files /dev/null and b/static/image/magic/bgimage.small.gif differ diff --git a/static/image/magic/bump.gif b/static/image/magic/bump.gif new file mode 100644 index 0000000..3d55bfa Binary files /dev/null and b/static/image/magic/bump.gif differ diff --git a/static/image/magic/bump.small.gif b/static/image/magic/bump.small.gif new file mode 100644 index 0000000..34b3d18 Binary files /dev/null and b/static/image/magic/bump.small.gif differ diff --git a/static/image/magic/call.gif b/static/image/magic/call.gif new file mode 100644 index 0000000..91ebc39 Binary files /dev/null and b/static/image/magic/call.gif differ diff --git a/static/image/magic/call.small.gif b/static/image/magic/call.small.gif new file mode 100644 index 0000000..1bb15c6 Binary files /dev/null and b/static/image/magic/call.small.gif differ diff --git a/static/image/magic/cbk.gif b/static/image/magic/cbk.gif new file mode 100644 index 0000000..24ddaf1 Binary files /dev/null and b/static/image/magic/cbk.gif differ diff --git a/static/image/magic/checkonline.gif b/static/image/magic/checkonline.gif new file mode 100644 index 0000000..ef7e7d7 Binary files /dev/null and b/static/image/magic/checkonline.gif differ diff --git a/static/image/magic/checkonline.small.gif b/static/image/magic/checkonline.small.gif new file mode 100644 index 0000000..1948d14 Binary files /dev/null and b/static/image/magic/checkonline.small.gif differ diff --git a/static/image/magic/chgusername.gif b/static/image/magic/chgusername.gif new file mode 100644 index 0000000..ec58248 Binary files /dev/null and b/static/image/magic/chgusername.gif differ diff --git a/static/image/magic/chgusername.small.gif b/static/image/magic/chgusername.small.gif new file mode 100644 index 0000000..81ecd51 Binary files /dev/null and b/static/image/magic/chgusername.small.gif differ diff --git a/static/image/magic/close.gif b/static/image/magic/close.gif new file mode 100644 index 0000000..7f54bf4 Binary files /dev/null and b/static/image/magic/close.gif differ diff --git a/static/image/magic/close.small.gif b/static/image/magic/close.small.gif new file mode 100644 index 0000000..2f6081f Binary files /dev/null and b/static/image/magic/close.small.gif differ diff --git a/static/image/magic/coupon.gif b/static/image/magic/coupon.gif new file mode 100644 index 0000000..10130a3 Binary files /dev/null and b/static/image/magic/coupon.gif differ diff --git a/static/image/magic/coupon.small.gif b/static/image/magic/coupon.small.gif new file mode 100644 index 0000000..624b415 Binary files /dev/null and b/static/image/magic/coupon.small.gif differ diff --git a/static/image/magic/detector.gif b/static/image/magic/detector.gif new file mode 100644 index 0000000..ef7e7d7 Binary files /dev/null and b/static/image/magic/detector.gif differ diff --git a/static/image/magic/detector.small.gif b/static/image/magic/detector.small.gif new file mode 100644 index 0000000..1948d14 Binary files /dev/null and b/static/image/magic/detector.small.gif differ diff --git a/static/image/magic/doodle.gif b/static/image/magic/doodle.gif new file mode 100644 index 0000000..9c7d08a Binary files /dev/null and b/static/image/magic/doodle.gif differ diff --git a/static/image/magic/doodle.small.gif b/static/image/magic/doodle.small.gif new file mode 100644 index 0000000..bdcfde6 Binary files /dev/null and b/static/image/magic/doodle.small.gif differ diff --git a/static/image/magic/downdateline.gif b/static/image/magic/downdateline.gif new file mode 100644 index 0000000..9220291 Binary files /dev/null and b/static/image/magic/downdateline.gif differ diff --git a/static/image/magic/downdateline.small.gif b/static/image/magic/downdateline.small.gif new file mode 100644 index 0000000..f2f5a50 Binary files /dev/null and b/static/image/magic/downdateline.small.gif differ diff --git a/static/image/magic/flicker.gif b/static/image/magic/flicker.gif new file mode 100644 index 0000000..6ee2768 Binary files /dev/null and b/static/image/magic/flicker.gif differ diff --git a/static/image/magic/flicker.small.gif b/static/image/magic/flicker.small.gif new file mode 100644 index 0000000..28a33c1 Binary files /dev/null and b/static/image/magic/flicker.small.gif differ diff --git a/static/image/magic/friendnum.gif b/static/image/magic/friendnum.gif new file mode 100644 index 0000000..40c7d69 Binary files /dev/null and b/static/image/magic/friendnum.gif differ diff --git a/static/image/magic/friendnum.small.gif b/static/image/magic/friendnum.small.gif new file mode 100644 index 0000000..042c920 Binary files /dev/null and b/static/image/magic/friendnum.small.gif differ diff --git a/static/image/magic/gift.gif b/static/image/magic/gift.gif new file mode 100644 index 0000000..1edaf99 Binary files /dev/null and b/static/image/magic/gift.gif differ diff --git a/static/image/magic/gift.small.gif b/static/image/magic/gift.small.gif new file mode 100644 index 0000000..3b372ac Binary files /dev/null and b/static/image/magic/gift.small.gif differ diff --git a/static/image/magic/hidden.gif b/static/image/magic/hidden.gif new file mode 100644 index 0000000..1e9393a Binary files /dev/null and b/static/image/magic/hidden.gif differ diff --git a/static/image/magic/highlight.gif b/static/image/magic/highlight.gif new file mode 100644 index 0000000..cd8d54c Binary files /dev/null and b/static/image/magic/highlight.gif differ diff --git a/static/image/magic/highlight.small.gif b/static/image/magic/highlight.small.gif new file mode 100644 index 0000000..b11e5e4 Binary files /dev/null and b/static/image/magic/highlight.small.gif differ diff --git a/static/image/magic/hot.gif b/static/image/magic/hot.gif new file mode 100644 index 0000000..50cf401 Binary files /dev/null and b/static/image/magic/hot.gif differ diff --git a/static/image/magic/hot.small.gif b/static/image/magic/hot.small.gif new file mode 100644 index 0000000..c8ca946 Binary files /dev/null and b/static/image/magic/hot.small.gif differ diff --git a/static/image/magic/index.htm b/static/image/magic/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/magic/jack.gif b/static/image/magic/jack.gif new file mode 100644 index 0000000..b7c1197 Binary files /dev/null and b/static/image/magic/jack.gif differ diff --git a/static/image/magic/jack.small.gif b/static/image/magic/jack.small.gif new file mode 100644 index 0000000..789ac04 Binary files /dev/null and b/static/image/magic/jack.small.gif differ diff --git a/static/image/magic/money.gif b/static/image/magic/money.gif new file mode 100644 index 0000000..10130a3 Binary files /dev/null and b/static/image/magic/money.gif differ diff --git a/static/image/magic/money.small.gif b/static/image/magic/money.small.gif new file mode 100644 index 0000000..9d8c37d Binary files /dev/null and b/static/image/magic/money.small.gif differ diff --git a/static/image/magic/mvk.gif b/static/image/magic/mvk.gif new file mode 100644 index 0000000..317f126 Binary files /dev/null and b/static/image/magic/mvk.gif differ diff --git a/static/image/magic/namepost.gif b/static/image/magic/namepost.gif new file mode 100644 index 0000000..3e45ba7 Binary files /dev/null and b/static/image/magic/namepost.gif differ diff --git a/static/image/magic/namepost.small.gif b/static/image/magic/namepost.small.gif new file mode 100644 index 0000000..1b6646b Binary files /dev/null and b/static/image/magic/namepost.small.gif differ diff --git a/static/image/magic/open.gif b/static/image/magic/open.gif new file mode 100644 index 0000000..b97732e Binary files /dev/null and b/static/image/magic/open.gif differ diff --git a/static/image/magic/open.small.gif b/static/image/magic/open.small.gif new file mode 100644 index 0000000..41794c1 Binary files /dev/null and b/static/image/magic/open.small.gif differ diff --git a/static/image/magic/repent.gif b/static/image/magic/repent.gif new file mode 100644 index 0000000..e905535 Binary files /dev/null and b/static/image/magic/repent.gif differ diff --git a/static/image/magic/repent.small.gif b/static/image/magic/repent.small.gif new file mode 100644 index 0000000..de753a2 Binary files /dev/null and b/static/image/magic/repent.small.gif differ diff --git a/static/image/magic/showip.gif b/static/image/magic/showip.gif new file mode 100644 index 0000000..8e5220d Binary files /dev/null and b/static/image/magic/showip.gif differ diff --git a/static/image/magic/showip.small.gif b/static/image/magic/showip.small.gif new file mode 100644 index 0000000..584944a Binary files /dev/null and b/static/image/magic/showip.small.gif differ diff --git a/static/image/magic/stick.gif b/static/image/magic/stick.gif new file mode 100644 index 0000000..55b2cb0 Binary files /dev/null and b/static/image/magic/stick.gif differ diff --git a/static/image/magic/stick.small.gif b/static/image/magic/stick.small.gif new file mode 100644 index 0000000..6a626d3 Binary files /dev/null and b/static/image/magic/stick.small.gif differ diff --git a/static/image/magic/superstar.gif b/static/image/magic/superstar.gif new file mode 100644 index 0000000..c21e42a Binary files /dev/null and b/static/image/magic/superstar.gif differ diff --git a/static/image/magic/superstar.small.gif b/static/image/magic/superstar.small.gif new file mode 100644 index 0000000..da01e7f Binary files /dev/null and b/static/image/magic/superstar.small.gif differ diff --git a/static/image/magic/thunder.gif b/static/image/magic/thunder.gif new file mode 100644 index 0000000..9c85d23 Binary files /dev/null and b/static/image/magic/thunder.gif differ diff --git a/static/image/magic/thunder.small.gif b/static/image/magic/thunder.small.gif new file mode 100644 index 0000000..f12b97b Binary files /dev/null and b/static/image/magic/thunder.small.gif differ diff --git a/static/image/magic/tok.gif b/static/image/magic/tok.gif new file mode 100644 index 0000000..20048a0 Binary files /dev/null and b/static/image/magic/tok.gif differ diff --git a/static/image/magic/updateline.gif b/static/image/magic/updateline.gif new file mode 100644 index 0000000..3599813 Binary files /dev/null and b/static/image/magic/updateline.gif differ diff --git a/static/image/magic/updateline.small.gif b/static/image/magic/updateline.small.gif new file mode 100644 index 0000000..f452464 Binary files /dev/null and b/static/image/magic/updateline.small.gif differ diff --git a/static/image/magic/visit.gif b/static/image/magic/visit.gif new file mode 100644 index 0000000..ceda459 Binary files /dev/null and b/static/image/magic/visit.gif differ diff --git a/static/image/magic/visit.small.gif b/static/image/magic/visit.small.gif new file mode 100644 index 0000000..0e33f44 Binary files /dev/null and b/static/image/magic/visit.small.gif differ diff --git a/static/image/magic/ysk.gif b/static/image/magic/ysk.gif new file mode 100644 index 0000000..8b240bb Binary files /dev/null and b/static/image/magic/ysk.gif differ diff --git a/static/image/mobile/browser.jpg b/static/image/mobile/browser.jpg new file mode 100644 index 0000000..a47c613 Binary files /dev/null and b/static/image/mobile/browser.jpg differ diff --git a/static/image/mobile/browser_big.jpg b/static/image/mobile/browser_big.jpg new file mode 100644 index 0000000..a47c613 Binary files /dev/null and b/static/image/mobile/browser_big.jpg differ diff --git a/static/image/mobile/font/dzmicon.css b/static/image/mobile/font/dzmicon.css new file mode 100644 index 0000000..bdda141 --- /dev/null +++ b/static/image/mobile/font/dzmicon.css @@ -0,0 +1,56 @@ +@font-face { +font-family: 'dzmicon'; +src: url('./dzmicon.woff2') format('woff2'), +url('./dzmicon.woff') format('woff'), +url('./dzmicon.ttf') format('truetype'); +font-weight: normal; +font-style: normal; +} + +[class^="dm-"]:before, [class*=" dm-"]:before { +font-family: "dzmicon"; +font-style: normal; +font-weight: normal; +display: inline-block; +text-decoration: inherit; +width: 1em; +text-align: center; +font-variant: normal; +text-transform: none; +-webkit-font-smoothing: antialiased; +-moz-osx-font-smoothing: grayscale; +} + +.dm-camera:before { content: '\f100'; } +.dm-camera-fill:before { content: '\f101'; } +.dm-chat-s:before { content: '\f102'; } +.dm-chat-s-fill:before { content: '\f103'; } +.dm-chat-t:before { content: '\f104'; } +.dm-chat-t-fill:before { content: '\f105'; } +.dm-c-up:before { content: '\f106'; } +.dm-c-down:before { content: '\f107'; } +.dm-c-left:before { content: '\f108'; } +.dm-c-right:before { content: '\f109'; } +.dm-edit:before { content: '\f10a'; } +.dm-emoji:before { content: '\f10b'; } +.dm-error:before { content: '\f10c'; } +.dm-explore:before { content: '\f10d'; } +.dm-eye:before { content: '\f10e'; } +.dm-eye-fill:before { content: '\f10f'; } +.dm-heart:before { content: '\f110'; } +.dm-heart-fill:before { content: '\f111'; } +.dm-house:before { content: '\f112'; } +.dm-house-fill:before { content: '\f113'; } +.dm-image:before { content: '\f114'; } +.dm-minus-c:before { content: '\f115'; } +.dm-plus-c:before { content: '\f116'; } +.dm-person:before { content: '\f117'; } +.dm-person-fill:before { content: '\f118'; } +.dm-search:before { content: '\f119'; } +.dm-sofa:before { content: '\f11a'; } +.dm-star:before { content: '\f11b'; } +.dm-star-fill:before { content: '\f11c'; } +.dm-tag:before { content: '\f11d'; } +.dm-trash:before { content: '\f11e'; } +.dm-warn:before { content: '\f11f'; } +.dm-x:before { content: '\f120'; } \ No newline at end of file diff --git a/static/image/mobile/font/dzmicon.ttf b/static/image/mobile/font/dzmicon.ttf new file mode 100644 index 0000000..976fb14 Binary files /dev/null and b/static/image/mobile/font/dzmicon.ttf differ diff --git a/static/image/mobile/font/dzmicon.woff b/static/image/mobile/font/dzmicon.woff new file mode 100644 index 0000000..619ea94 Binary files /dev/null and b/static/image/mobile/font/dzmicon.woff differ diff --git a/static/image/mobile/font/dzmicon.woff2 b/static/image/mobile/font/dzmicon.woff2 new file mode 100644 index 0000000..51281ea Binary files /dev/null and b/static/image/mobile/font/dzmicon.woff2 differ diff --git a/static/image/mobile/font/index.htm b/static/image/mobile/font/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/mobile/images/arrow_top.png b/static/image/mobile/images/arrow_top.png new file mode 100644 index 0000000..98c29c7 Binary files /dev/null and b/static/image/mobile/images/arrow_top.png differ diff --git a/static/image/mobile/images/avatar_m_bg.png b/static/image/mobile/images/avatar_m_bg.png new file mode 100644 index 0000000..1723588 Binary files /dev/null and b/static/image/mobile/images/avatar_m_bg.png differ diff --git a/static/image/mobile/images/btn_s_bg.png b/static/image/mobile/images/btn_s_bg.png new file mode 100644 index 0000000..bbc4029 Binary files /dev/null and b/static/image/mobile/images/btn_s_bg.png differ diff --git a/static/image/mobile/images/button_bg.gif b/static/image/mobile/images/button_bg.gif new file mode 100644 index 0000000..85cd98d Binary files /dev/null and b/static/image/mobile/images/button_bg.gif differ diff --git a/static/image/mobile/images/button_bg.png b/static/image/mobile/images/button_bg.png new file mode 100644 index 0000000..97bfa4a Binary files /dev/null and b/static/image/mobile/images/button_bg.png differ diff --git a/static/image/mobile/images/button_bg2.png b/static/image/mobile/images/button_bg2.png new file mode 100644 index 0000000..6888680 Binary files /dev/null and b/static/image/mobile/images/button_bg2.png differ diff --git a/static/image/mobile/images/collapsed_no.png b/static/image/mobile/images/collapsed_no.png new file mode 100644 index 0000000..b51149e Binary files /dev/null and b/static/image/mobile/images/collapsed_no.png differ diff --git a/static/image/mobile/images/collapsed_yes.png b/static/image/mobile/images/collapsed_yes.png new file mode 100644 index 0000000..3c8e36a Binary files /dev/null and b/static/image/mobile/images/collapsed_yes.png differ diff --git a/static/image/mobile/images/collect.png b/static/image/mobile/images/collect.png new file mode 100644 index 0000000..307a091 Binary files /dev/null and b/static/image/mobile/images/collect.png differ diff --git a/static/image/mobile/images/dialog_b.png b/static/image/mobile/images/dialog_b.png new file mode 100644 index 0000000..c849ca8 Binary files /dev/null and b/static/image/mobile/images/dialog_b.png differ diff --git a/static/image/mobile/images/dialog_bg.png b/static/image/mobile/images/dialog_bg.png new file mode 100644 index 0000000..12edb79 Binary files /dev/null and b/static/image/mobile/images/dialog_bg.png differ diff --git a/static/image/mobile/images/dialog_t.png b/static/image/mobile/images/dialog_t.png new file mode 100644 index 0000000..4557bdc Binary files /dev/null and b/static/image/mobile/images/dialog_t.png differ diff --git a/static/image/mobile/images/exit.png b/static/image/mobile/images/exit.png new file mode 100644 index 0000000..96e44b8 Binary files /dev/null and b/static/image/mobile/images/exit.png differ diff --git a/static/image/mobile/images/exit_on.png b/static/image/mobile/images/exit_on.png new file mode 100644 index 0000000..101c218 Binary files /dev/null and b/static/image/mobile/images/exit_on.png differ diff --git a/static/image/mobile/images/header_bg.jpg b/static/image/mobile/images/header_bg.jpg new file mode 100644 index 0000000..96ab793 Binary files /dev/null and b/static/image/mobile/images/header_bg.jpg differ diff --git a/static/image/mobile/images/icon.png b/static/image/mobile/images/icon.png new file mode 100644 index 0000000..2ac0157 Binary files /dev/null and b/static/image/mobile/images/icon.png differ diff --git a/static/image/mobile/images/icon_arrow.gif b/static/image/mobile/images/icon_arrow.gif new file mode 100644 index 0000000..8dd58a9 Binary files /dev/null and b/static/image/mobile/images/icon_arrow.gif differ diff --git a/static/image/mobile/images/icon_arrow.png b/static/image/mobile/images/icon_arrow.png new file mode 100644 index 0000000..cbd2693 Binary files /dev/null and b/static/image/mobile/images/icon_arrow.png differ diff --git a/static/image/mobile/images/icon_arrow_down.png b/static/image/mobile/images/icon_arrow_down.png new file mode 100644 index 0000000..7bafe06 Binary files /dev/null and b/static/image/mobile/images/icon_arrow_down.png differ diff --git a/static/image/mobile/images/icon_back.png b/static/image/mobile/images/icon_back.png new file mode 100644 index 0000000..1ae05d1 Binary files /dev/null and b/static/image/mobile/images/icon_back.png differ diff --git a/static/image/mobile/images/icon_close.png b/static/image/mobile/images/icon_close.png new file mode 100644 index 0000000..1f73910 Binary files /dev/null and b/static/image/mobile/images/icon_close.png differ diff --git a/static/image/mobile/images/icon_close_g.png b/static/image/mobile/images/icon_close_g.png new file mode 100644 index 0000000..3e83a04 Binary files /dev/null and b/static/image/mobile/images/icon_close_g.png differ diff --git a/static/image/mobile/images/icon_del.png b/static/image/mobile/images/icon_del.png new file mode 100644 index 0000000..fbe96e8 Binary files /dev/null and b/static/image/mobile/images/icon_del.png differ diff --git a/static/image/mobile/images/icon_digest.png b/static/image/mobile/images/icon_digest.png new file mode 100644 index 0000000..84ccb88 Binary files /dev/null and b/static/image/mobile/images/icon_digest.png differ diff --git a/static/image/mobile/images/icon_img.png b/static/image/mobile/images/icon_img.png new file mode 100644 index 0000000..21bce15 Binary files /dev/null and b/static/image/mobile/images/icon_img.png differ diff --git a/static/image/mobile/images/icon_load.gif b/static/image/mobile/images/icon_load.gif new file mode 100644 index 0000000..dc67c8f Binary files /dev/null and b/static/image/mobile/images/icon_load.gif differ diff --git a/static/image/mobile/images/icon_more.png b/static/image/mobile/images/icon_more.png new file mode 100644 index 0000000..117b9b4 Binary files /dev/null and b/static/image/mobile/images/icon_more.png differ diff --git a/static/image/mobile/images/icon_msg.png b/static/image/mobile/images/icon_msg.png new file mode 100644 index 0000000..0e047e1 Binary files /dev/null and b/static/image/mobile/images/icon_msg.png differ diff --git a/static/image/mobile/images/icon_num.png b/static/image/mobile/images/icon_num.png new file mode 100644 index 0000000..610f705 Binary files /dev/null and b/static/image/mobile/images/icon_num.png differ diff --git a/static/image/mobile/images/icon_photo.png b/static/image/mobile/images/icon_photo.png new file mode 100644 index 0000000..f32c4ba Binary files /dev/null and b/static/image/mobile/images/icon_photo.png differ diff --git a/static/image/mobile/images/icon_reply.png b/static/image/mobile/images/icon_reply.png new file mode 100644 index 0000000..df159c6 Binary files /dev/null and b/static/image/mobile/images/icon_reply.png differ diff --git a/static/image/mobile/images/icon_top.png b/static/image/mobile/images/icon_top.png new file mode 100644 index 0000000..037ddc0 Binary files /dev/null and b/static/image/mobile/images/icon_top.png differ diff --git a/static/image/mobile/images/icon_tu.png b/static/image/mobile/images/icon_tu.png new file mode 100644 index 0000000..d3504ef Binary files /dev/null and b/static/image/mobile/images/icon_tu.png differ diff --git a/static/image/mobile/images/img_loader.gif b/static/image/mobile/images/img_loader.gif new file mode 100644 index 0000000..dc8bd3f Binary files /dev/null and b/static/image/mobile/images/img_loader.gif differ diff --git a/static/image/mobile/images/index.htm b/static/image/mobile/images/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/mobile/images/login.png b/static/image/mobile/images/login.png new file mode 100644 index 0000000..62bd99f Binary files /dev/null and b/static/image/mobile/images/login.png differ diff --git a/static/image/mobile/images/login_on.png b/static/image/mobile/images/login_on.png new file mode 100644 index 0000000..4ad1d48 Binary files /dev/null and b/static/image/mobile/images/login_on.png differ diff --git a/static/image/mobile/images/logo.png b/static/image/mobile/images/logo.png new file mode 100644 index 0000000..d802ca9 Binary files /dev/null and b/static/image/mobile/images/logo.png differ diff --git a/static/image/mobile/images/my_subject_bg.png b/static/image/mobile/images/my_subject_bg.png new file mode 100644 index 0000000..46759a8 Binary files /dev/null and b/static/image/mobile/images/my_subject_bg.png differ diff --git a/static/image/mobile/images/my_subject_bg151.png b/static/image/mobile/images/my_subject_bg151.png new file mode 100644 index 0000000..617c90b Binary files /dev/null and b/static/image/mobile/images/my_subject_bg151.png differ diff --git a/static/image/mobile/images/nav_b_line.png b/static/image/mobile/images/nav_b_line.png new file mode 100644 index 0000000..13042aa Binary files /dev/null and b/static/image/mobile/images/nav_b_line.png differ diff --git a/static/image/mobile/images/pic_bg.jpg b/static/image/mobile/images/pic_bg.jpg new file mode 100644 index 0000000..ad65c41 Binary files /dev/null and b/static/image/mobile/images/pic_bg.jpg differ diff --git a/static/image/mobile/images/pic_select.png b/static/image/mobile/images/pic_select.png new file mode 100644 index 0000000..9ccf27c Binary files /dev/null and b/static/image/mobile/images/pic_select.png differ diff --git a/static/image/mobile/images/qqlogin.png b/static/image/mobile/images/qqlogin.png new file mode 100644 index 0000000..6254d51 Binary files /dev/null and b/static/image/mobile/images/qqlogin.png differ diff --git a/static/image/mobile/images/qqlogin_on.png b/static/image/mobile/images/qqlogin_on.png new file mode 100644 index 0000000..e9b3d64 Binary files /dev/null and b/static/image/mobile/images/qqlogin_on.png differ diff --git a/static/image/mobile/images/qqlogintext.png b/static/image/mobile/images/qqlogintext.png new file mode 100644 index 0000000..1a8b5e9 Binary files /dev/null and b/static/image/mobile/images/qqlogintext.png differ diff --git a/static/image/mobile/images/reply.png b/static/image/mobile/images/reply.png new file mode 100644 index 0000000..bd1a440 Binary files /dev/null and b/static/image/mobile/images/reply.png differ diff --git a/static/image/mobile/images/titlebg.png b/static/image/mobile/images/titlebg.png new file mode 100644 index 0000000..9ba3fcf Binary files /dev/null and b/static/image/mobile/images/titlebg.png differ diff --git a/static/image/mobile/index.htm b/static/image/mobile/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/mobile/input_bg.gif b/static/image/mobile/input_bg.gif new file mode 100644 index 0000000..d990c67 Binary files /dev/null and b/static/image/mobile/input_bg.gif differ diff --git a/static/image/mobile/logo.gif b/static/image/mobile/logo.gif new file mode 100644 index 0000000..c99724c Binary files /dev/null and b/static/image/mobile/logo.gif differ diff --git a/static/image/mobile/preview.png b/static/image/mobile/preview.png new file mode 100644 index 0000000..0da0789 Binary files /dev/null and b/static/image/mobile/preview.png differ diff --git a/static/image/mobile/style.css b/static/image/mobile/style.css new file mode 100644 index 0000000..e4eaa8d --- /dev/null +++ b/static/image/mobile/style.css @@ -0,0 +1,1351 @@ +@charset "utf-8"; +/*----- color -----*/ +body { +--dz-BG-body:#eee;/*全局body背景*/ +--dz-BG-color:#2B7ACD;/*主色调背景*/ +--dz-BG-0:#ffffff; +--dz-BG-1:#333;/*深色背景*/ +--dz-BG-2:#FF5656;/*高亮色*/ +--dz-BG-3:#FF9900;/*排行榜2&置顶图标背景*/ +--dz-BG-4:#B3CC0D;/*排行榜3&精华图标背景*/ +--dz-BG-5:#f3f3f3;/*浅色背景*/ +--dz-BG-6:#ccc;/*深灰色背景*/ +--dz-BG-n:#A0C8EA;/*浅蓝色背景*/ +--dz-FC-color:#2B7ACD;/*主色调*/ +--dz-FC-fff:#fff; +--dz-FC-333:#333; +--dz-FC-666:#666; +--dz-FC-777:#777; +--dz-FC-888:#888; +--dz-FC-999:#999; +--dz-FC-aaa:#aaa; +--dz-FC-bbb:#bbb; +--dz-FC-ccc:#ccc; +--dz-FC-ddd:#ddd; +--dz-FC-nnn:#7DA0CC; +--dz-FC-light:#FF9C00; +--dz-FC-a:#F26C4F; +--dz-FC-v:#7CBE00; +--dz-FC-invalid:#FF512C; +--dz-FC-tinvalid:#FF9A9A; +--dz-FC-t: transparent; +--dz-BOR-ed:#ededed;/*边框色*/ +--dz-BOR-ccc:#ccc;/*边框色*/ +--dz-BOR-invalid:#FF9A9A;/*红色边框*/ +} + +/*----- common -----*/ +* {word-wrap:break-word} +ul, ol, li, span, p, form, h1, h2, h3, h4, h5, h6, dl, dt, dd {margin:0;padding:0;border:0;z-index:inherit} +img, a img {border:0;margin:0;padding:0} +ul, ol, li {list-style:none} +* {margin:0;padding:0} +html, body {font:12px/1.5 Microsoft YaHei, Helvetica, sans-serif;color:var(--dz-FC-333);min-height:100%} +input, select, textarea, button {font:14px/1.5 Microsoft YaHei, Helvetica, sans-serif;outline:none} +body, ul, ol, li, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset, .pr, .pc {margin:0;padding:0} +body {background-color:var(--dz-BG-body)} +table {empty-cells:show;border-collapse:collapse} +caption, th {text-align:left;font-weight:400} +h1, h2, h3, h4, h5, h6 {font-weight:400} +em, cite, i {font-style:normal} +label {cursor:pointer} +a img {border:none} +a:link, a:visited, a:hover {color:var(--dz-FC-333);text-decoration:none} +a {-webkit-tap-highlight-color:rgba(0,0,0,0)} +a.grey:link, a.grey:visited, a.grey:hover {color:var(--dz-FC-bbb);text-decoration:none} +a.link:link, a.link:visited, a.link:hover {color:var(--dz-FC-color);text-decoration:none} +a.button {color:var(--dz-FC-fff)} +.z {float:left} +.y {float:right} +.cl:after {content:".";display:block;height:0;clear:both;visibility:hidden} +.cl {zoom:1} +.vm {vertical-align:middle} +.vm * {vertical-align:middle} +.none {display:none} +.px {width:100%;border:none;padding:0;line-height:30px;font-size:16px} +.pn, .btn_pn, .btn_pn_blue, .button2 {width:100%;border:none;padding:0;height:44px;line-height:44px;text-align:center;font-size:16px;background-color:var(--dz-BG-color);color:var(--dz-FC-fff);border-radius:6px} +.pns, .button {width:auto;border:none;padding:0;height:40px;line-height:40px;text-align:center;font-size:16px;padding:0 15px;background-color:var(--dz-BG-color);color:var(--dz-FC-fff);border-radius:6px;box-sizing:border-box;} +.pt {width:100%;border:none;padding:0;min-height:168px;line-height:24px;font-size:16px;background:none} +.pr, .pc {vertical-align:middle;margin:0 5px 3px;padding:0} +.btn_pn_grey {background-color:var(--dz-BG-0);color:var(--dz-FC-color)} +.btn_pn_red {background-color:var(--dz-BG-2);color:var(--dz-FC-fff)} +.btn_pn_orange {background-color:var(--dz-BG-3);color:var(--dz-FC-fff)} +.btn_pn_green {background-color:var(--dz-BG-4);color:var(--dz-FC-fff)} +input[type="reset"]::-moz-focus-inner, +input[type="button"]::-moz-focus-inner, +input[type="submit"]::-moz-focus-inner, +input[type="file"] > input[type="button"]::-moz-focus-inner {border:none;padding:0} +input[type="submit"], input[type="reset"], input[type="button"], button {-webkit-appearance:none;outline:none} + +input, select, textarea {font:14px/1.5 Microsoft YaHei, Helvetica, sans-serif;border:1px solid var(--dz-BOR-ed);border-radius:2px;-webkit-appearance:none;} +input, textarea, select, button, a {outline:none;} +input:focus, textarea:focus, select:focus {box-shadow:0 0 6px rgba(0, 0, 0, .05) inset;transition:all 0.1s ease 0s;} +input[type="radio"], input[type="checkbox"] {box-shadow:none;vertical-align:middle;width:16px !important;height:16px !important;margin:0px 5px 1px 0px;padding:0px;background:var(--dz-BG-0);} +input[type="radio"] {-webkit-appearance:radio;border-radius:50%;} +input[type="checkbox"] {-webkit-appearance:checkbox;} +input[type="button"], button {border:none;box-shadow:none;} +input[type="button"], input[type="submit"] {-webkit-appearance:none;} +textarea {resize:none;overflow:auto;} +select {-moz-appearance:none;} + +@font-face { font-family: "dzicon"; src: url('../common/dzicon.eot'); src: url('../common/dzicon.eot?#iefix') format('eot'), url('../common/dzicon.woff2') format('woff2'), url('../common/dzicon.woff') format('woff'); font-weight: normal; font-style: normal; } +[class^="fico-"]:before, [class*=" fico-"]:before { font-family: "dzicon"; font-style: normal; font-weight: normal; speak: none; display: inline-block; text-decoration: inherit; width: 1em; margin-right: .2em; text-align: center; font-variant: normal; text-transform: none; line-height: 1em; font-size: 120%; } +/* font icon size */ +.fic4 { font-size: 14px; }.fic6 { font-size: 16px; }.fic8 { font-size: 18px; } +/* flip x */ +.fifx::before { transform: scale(-1,1); } +/* font rotate */ +@keyframes dzrotate{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}} +.ficr { margin-right: .2em; }.ficr:before { margin-right: 0; animation: dzrotate 2s infinite linear; } +.loadicon { background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23999' d='M12.2 12.2L14 14H9V9l1.8 1.8c.7-.7 1.2-1.7 1.2-2.8 0-1.9-1.3-3.4-3-3.9v-2c2.8.4 5 2.9 5 5.9 0 1.6-.7 3.1-1.8 4.2zM3.8 3.8C2.7 4.8 2 6.3 2 8c0 3 2.2 5.4 5 5.9v-2.1c-1.7-.4-3-2-3-3.9 0-1.1.5-2.1 1.2-2.8L7 7V2H2l1.8 1.8z'/%3e%3c/svg%3e"); display: inline-block; width: 16px; height: 16px; animation: dzrotate 1.2s infinite linear; } +/* font color primary/secondary/notice/light/alarm/valid/invalid */ +.fc-p { color: {MENUBGCOLOR};} +.fc-s { color: var(--dz-FC-999);} +.fc-n { color: var(--dz-FC-nnn);} +.fc-l { color: var(--dz-FC-light);} +.fc-a { color: var(--dz-FC-a);} +.fc-v { color: var(--dz-FC-v);} +.fc-i { color: var(--dz-FC-invalid);} +.fc-t { color: var(--dz-FC-t);} +/* no margin right */ +.fnmr:before { margin-right: 0; } + +/* font icon图标列表,供用户调用 */ +.fico-person:before{content:"\f100";} +.fico-search:before{content:"\f101";} +.fico-account_box:before{content:"\f102";} +.fico-account:before{content:"\f102";} +.fico-home:before{content:"\f103";} +.fico-assessment:before{content:"\f104";} +.fico-widthfixed:before{content:"\f105";} +.fico-widthauto:before{content:"\f106";} +.fico-styleselect:before{content:"\f107";} +.fico-add_circle:before{content:"\f108";} +.fico-add:before{content:"\f108";} +.fico-remove_circle:before{content:"\f109";} +.fico-remove:before{content:"\f109";} +.fico-rss_feed:before{content:"\f10a";} +.fico-rss:before{content:"\f10a";} +.fico-refresh:before{content:"\f10b";} +.fico-delete:before{content:"\f10c";} +.fico-comment:before{content:"\f10d";} +.fico-edit:before{content:"\f10e";} +.fico-push:before{content:"\f10f";} +.fico-thumbup:before{content:"\f110";} +.fico-thumbdown:before{content:"\f111";} +.fico-collection:before{content:"\f112";} +.fico-activitysm:before{content:"\f113";} +.fico-share:before{content:"\f114";} +.fico-check_right:before{content:"\f115";} +.fico-error:before{content:"\f116";} +.fico-info:before{content:"\f117";} +.fico-qq:before{content:"\f118";} +.fico-email:before{content:"\f119";} +.fico-task:before{content:"\f11a";} +.fico-scrolltop:before{content:"\f11b";} +.fico-replyfast:before{content:"\f11c";} +.fico-list:before{content:"\f11d";} +.fico-follow:before{content:"\f11e";} +.fico-friendadd:before{content:"\f11f";} +.fico-mypost:before{content:"\f120";} +.fico-interactive:before{content:"\f121";} +.fico-settings:before{content:"\f122";} +.fico-link:before{content:"\f123";} +.fico-up:before{content:"\f124";} +.fico-down:before{content:"\f125";} +.fico-left:before{content:"\f126";} +.fico-right:before{content:"\f127";} +.fico-valid:before{content:"\f128";} +.fico-invalid:before{content:"\f129";} +.fico-stars:before{content:"\f12a";} +.fico-sun:before{content:"\f12b";} +.fico-star3:before{content:"\f12b";} +.fico-moon:before{content:"\f12c";} +.fico-star2:before{content:"\f12c";} +.fico-star:before{content:"\f12d";} +.fico-star1:before{content:"\f12d";} +.fico-checkbox:before{content:"\f12e";} +.fico-checked:before{content:"\f12f";} +.fico-doing:before{content:"\f130";} +.fico-volume:before{content:"\f131";} +.fico-image:before{content:"\f132";} +.fico-attachment:before{content:"\f133";} +.fico-thread:before{content:"\f134";} +.fico-clock:before{content:"\f135";} +.fico-lock:before{content:"\f136";} +.fico-print:before{content:"\f137";} +.fico-help:before{content:"\f138";} +.fico-launch:before{content:"\f139";} +.fico-imgadjust:before{content:"\f13a";} +.fico-vote:before{content:"\f13b";} +.fico-reward:before{content:"\f13c";} +.fico-vs:before{content:"\f13d";} +.fico-group:before{content:"\f13e";} +.fico-cart:before{content:"\f13f";} +.fico-headset:before{content:"\f140";} +.fico-phone:before{content:"\f141";} +.fico-place:before{content:"\f142";} +.fico-camera:before{content:"\f143";} +.fico-voice:before{content:"\f144";} +.fico-bell:before{content:"\f145";} +.fico-loading:before{content:"\f146";} +.fico-poke:before{content:'\f146';} +.fico-profile:before{content:'\f147';} +.fico-dropdown:before{content:'\f148';} +.fico-ban:before{content:'\f149';} +.fico-tag:before{content:'\f14a';} + +.pxs {-webkit-appearance: none;width: 100%;min-height: 48px;line-height: 24px;border: none !important;font-size: 14px;vertical-align: middle;background-color: transparent;} +.flex-box {display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center} +.flex-wrap {flex-wrap: wrap;} +.flex {-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1} +.flex-2 {-webkit-box-flex:2;-webkit-flex:2;-ms-flex:2;flex:2} +.flex-3 {-webkit-box-flex:3;-webkit-flex:3;-ms-flex:3;flex:3} +.flex-half {flex:0 0 49.9%;} +.align-items-center {align-items:center} +.justify-content-between {justify-content:space-between} +.justify-content-end {justify-content: flex-end} +.discuz_x {height:10px;background-color:var(--dz-BG-body);border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.m15 {margin: 15px !important;} +.mt0 {margin-top:0px !important;} +.mt5 {margin-top:5px !important;} +.mt10 {margin-top:10px !important;} +.mt15 {margin-top:15px !important;} +.mb0 {margin-bottom:0px !important;} +.mb5 {margin-bottom:5px !important;} +.mb10 {margin-bottom:10px !important;} +.mb15 {margin-bottom:15px !important;} +.ml0 {margin-left:0px !important;} +.ml5 {margin-left:5px !important;} +.ml10 {margin-left:10px !important;} +.ml15 {margin-left:15px !important;} +.mr0 {margin-right:0px !important;} +.mr5 {margin-right:5px !important;} +.mr10 {margin-right:10px !important;} +.mr15 {margin-right:15px !important;} +.p0 {padding:0px !important;} +.p5 {padding:5px !important;} +.p10 {padding:10px !important;} +.p15 {padding:15px !important;} +.pt5 {padding-top:5px !important;} +.pb5 {padding-bottom:5px !important;} +.pt10 {padding-top:10px !important;} +.pb10 {padding-bottom:10px !important;} +.pl0 {padding-left: 0px !important;} +.pl5 {padding-left: 5px !important;} +.pl10 {padding-left: 10px !important;} +.pl15 {padding-left: 15px !important;} +.b0 {border:0 !important;} +.l0 {left:0px !important;} +.autowidth {width:auto !important;} +.f_g, .f_g a {color: var(--dz-FC-a);} +.f_f, .f_f a {color: var(--dz-FC-fff);} +.f_b, .f_b a {color: var(--dz-FC-color);} +.f_c, .f_c a {color: var(--dz-FC-ccc);} +.f_d, .f_d a {color: var(--dz-FC-ddd);} +.f_9, .f_9 a {color: var(--dz-FC-999);} +.b_t {border-top:1px solid var(--dz-BOR-ed) !important;} +.b_b {border-bottom:1px solid var(--dz-BOR-ed) !important} +.b_a {border:1px solid var(--dz-BOR-ed) !important;} +.tbms { padding: 10px; border: 1px dashed var(--dz-BOR-invalid); } +.tbms:before { font-family: dzicon; line-height: 14px; content: "\f145"; font-size: 16px; color: var(--dz-FC-invalid); } +.tbms_r:before { content: "\f128"; color: var(--dz-FC-v); } +.rq { color: var(--dz-FC-invalid); } +.xi1, .onerror { color: var(--dz-BG-2); } +.xw0 { font-weight: 400; } +.xw1 { font-weight: 700; } +.xs1 { font-size: 12px !important; } +.xs2 { font-size: 14px !important; } +.xs3 { font-size: 16px !important; } +.tbmu { padding: 8px 10px 8px 0; border-bottom: 1px dashed var(--dz-BOR-ed); } +.alt, .alt th, .alt td { background-color: var(--dz-BG-5); } +.emp { padding: 20px 10px; } +.emp a { color: {HIGHLIGHTLINK}; text-decoration: underline !important; } +.tdat { width: 100%; border: 1px solid var(--dz-BOR-ed); } +.tdat th, .tdat td { padding: 4px 5px; border: 1px solid var(--dz-BOR-ed); } +.notice { clear: both; margin: 5px 0; padding: 3px 0; } +.notice:before { content: "\f145"; font-family: dzicon; font-size: 16px; line-height: 14px; margin-right: 4px; color: var(--dz-FC-invalid); } +.pipe { margin: 0 5px; color: var(--dz-FC-ccc); } +.xg1, .xg1 a { color: var(--dz-FC-999) !important; } +.xg1 .xi2 { color: var(--dz-BG-2) !important; } +.xg2 { color: var(--dz-FC-333); } +.avt img { padding: 2px; width: 48px; height: 48px; background: var(--dz-BG-0); border: 1px solid; border-color: var(--dz-BOR-ed) var(--dz-BOR-ed) var(--dz-BOR-ed) var(--dz-BOR-ed); } + +/*----- 通用主体 -----*/ +.bodybox {background-color:var(--dz-BG-0);} + +/*----- 头部 -----*/ +.header {background-color:var(--dz-BG-color);color:var(--dz-FC-fff);height:30px;line-height:30px;padding:10px 12px} +.header .mz, .header .mzlogo {float:left;position:relative} +.header .mzlogo a {line-height:normal} +.header .my, .header .myss {float:right;position:relative} +.header .my a, .header .myss a {float:right} +.header .mz, .header .my {width:20%} +.header .mzlogo {width:40%;height:30px;text-align:left;font-size:18px;position:relative;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;flex-direction:column;justify-content:center} +.header .myss {width:60%} +.header .myss a {background-color:var(--dz-BG-0);color:var(--dz-FC-aaa);line-height:30px;font-size:14px;padding:0 15px;border-radius:15px} +.header .myss a i {float:left;font-size:16px;margin-right:5px;color:var(--dz-FC-aaa)} +.header i {font-size:20px;color:var(--dz-FC-fff)} +.header .my a {margin-left:10px} +.header h2 {float:left;width:60%;text-align:center;font-size:18px;position:relative;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} +.header h2 img, .header .mzlogo img {max-height:30px;vertical-align:top;max-width:100%} +.header h2 a {color:var(--dz-FC-fff)} + +/*----- 底部Copyright -----*/ +.footer {background-color:var(--dz-BG-1);color:var(--dz-FC-fff);padding:15px;text-align:center;overflow:hidden} +.footer-nv, .footer-copy {color:var(--dz-FC-999);line-height:22px;font-size:13px;text-align:center} +.footer-nv a {color:var(--dz-FC-fff);margin:0 6px} +.footer-copy a, .footer-nv a.mon {color:var(--dz-FC-999)} +.footer-copy img {margin:0 10px} + +/*----- 浮动底部导航 -----*/ +.foot {width:100%;position:fixed;bottom:0;z-index:99999;background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);color:var(--dz-FC-999)} +.foot a {float:left;text-align:center;height:54px;line-height:54px;overflow:hidden;position:relative} +.foot a span {display:block;overflow:hidden} +.foot a span.foot-ico {height:24px;line-height:24px;overflow:hidden;margin-top:4px} +.foot a span.foot-ico em {display:block;margin:2px auto 0;width:24px;height:24px;line-height:24px;position:relative;background:no-repeat 0 0} +.foot a span.foot-ico em.ma {background-image:url(./touch/home.svg)} +.foot a span.foot-ico em.mb {background-image:url(./touch/forum.svg)} +.foot a span.foot-ico em.md {background-image:url(./touch/explore.svg)} +.foot a span.foot-ico em.me {background-image:url(./touch/space.svg)} +.foot a span.foot-ico em.mf {background-image:url(./touch/space.svg)} +.foot a span.foot-ico em i.ico_msg {position:absolute;background:var(--dz-BG-2);width:7px;height:7px;display:block;top:-1px;right:-1px;z-index:510;border:1px solid var(--dz-BG-0);border-radius:50%} +.foot a span.foot-txt {height:22px;line-height:22px;font-size:12px;color:var(--dz-FC-999)} +.foot a.mon span.foot-txt {color:var(--dz-FC-color)} +.foot a.mon span.foot-ico em {background-position:100% 0} +.foot a.foot-post span.foot-ico {height:44px;line-height:44px;margin-top:5px} +.foot a.foot-post span.foot-ico em {width:38px;height:38px;line-height:38px} +.foot a.foot-post span.foot-ico em.mc {background:url(./touch/plus_btn.svg) no-repeat;background-size:auto 38px} +.foot a.foot-post span.foot-txt {display:none} +.foot_height {height:54px} + +/*----- 通用设置 -----*/ +.setbox {padding-bottom:10px;overflow:hidden;} +.setbox li {padding:7px 12px;line-height:30px;font-size:16px;border-bottom:1px solid var(--dz-BOR-ed);color: var(--dz-FC-999);} +.setbox li.tit {background-color:var(--dz-BG-5);padding: 12px 12px 5px;line-height: 24px;font-size: 14px;} +.setbox li.sec_txt {height:auto} +.setbox li.sec_txt .txt {border:1px solid var(--dz-BOR-ed);margin-left:10px;padding:0 5px;height:30px;line-height:30px;border-radius:4px} +.setbox .tit {padding-right: 8px;vertical-align: top;} +.setbox .btn-text {float:left} + +.setbox .input input {-webkit-appearance: none;width: 100%;height: 1.4em;line-height: 1.4;font-size: inherit;border: none;outline: none;background-color: transparent;} +.setbox .checkbox input { float:right;} +.setbox .select {display:block;position:relative} +.setbox .select select {position:absolute;top:0;width:100%;z-index:2;cursor:pointer;left:0;max-height:100%;min-height:100%;opacity:0} +.setbox .select .inner {display:block;width:100%;font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:relative} +.setbox .select .inner i {float:right} +.setbox .select .btn-inner {display:block;font-size:14px;min-width:0.75em;overflow: hidden;position:relative;text-overflow:ellipsis;white-space:nowrap} +.setbox .select .icon-arrow {height:30px;line-height:30px;float:right;color:var(--dz-FC-ccc)} + +.setbox .sec_code span .txt {-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1} +.setbox .sec_code span img {float:right;height:30px} + +/*----- 通用组件Cell单元格 -----*/ +.dzcell-group {background:var(--dz-BG-0);position:relative;} +.dzcell-group-inset {margin: 0 15px;overflow: hidden;border-radius:8px;} +.dzcell-item {position: relative;display: flex;box-sizing: border-box;width: 100%;padding: 10px 16px;overflow: hidden;font-size: 14px;line-height: 24px;background-color: var(--dz-BG-0);} +.dzcell-item .dzcell-title {width:80px;} +.dzcell-item .dzcell-value {flex:1;position: relative;overflow: hidden;color: var(--dz-FC-999);text-align: right;vertical-align: middle;word-wrap: break-word;} + +/*------ 通用空记录 ------*/ +.empty-box h4{background-color:var(--dz-BG-0);height:30px;line-height:30px;padding:80px 0;text-align:center;font-size:14px;font-weight:400;color:var(--dz-FC-999);border-top:1px solid var(--dz-BOR-ed);border-bottom:var(--dz-BOR-ed);margin-bottom:10px;} + +/*----- 首页幻灯 -----*/ +.swiper-wrapper {position:relative;width:100%;z-index:1;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box} +.swiper-slide {-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;width:100%;position:relative} +.dz-swiper_box {width:100%;background-color:var(--dz-BG-1);overflow:hidden;position:relative} +.dz-swiper .swiper-wrapper li a {display:block;width:100%;height:230px} +.dz-swiper .swiper-wrapper li a img {width:100%;height:100%;object-fit:cover;overflow:hidden} +.dz-swiper .swiper-wrapper li a span {position:absolute;left:0;right:0;bottom:0;display:block;background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.8) 100%);color:var(--dz-FC-fff);padding:0 15px;font-size:16px;height:40px;overflow:hidden;line-height:42px;font-weight:400} +.swiper-forum {position:absolute;right:15px;bottom:0;line-height:34px;text-align:right;font-family:Arial;color:var(--dz-FC-fff);font-size:12px;z-index:9} +.swiper-forum .swiper-pagination-current {font-weight:400;font-size:20px} +.swiper-forum .swiper-pagination-total {font-style:100} + +/*----- 首页头条 -----*/ +.hotbox {background-color:var(--dz-BG-0);line-height:24px;font-size:14px;overflow:hidden} +.hotbox h2 {margin:15px 15px 0;height:24px;line-height:24px;font-size:16px} +.hotbox h2 span {float:left;margin-right:5px;padding:0 4px;background-color:var(--dz-BG-2);color:var(--dz-FC-fff);border-radius:4px} +.hotbox-toutiao a {display:block;margin:0 15px;padding:10px 0;border-bottom:1px solid var(--dz-BOR-ed);color:var(--dz-FC-999)} +.hotbox-toutiao a span {display:block;margin-bottom:4px;line-height:24px;font-size:18px;color:var(--dz-FC-color);} +.hotbox .listbox {margin-bottom:0} + +/*----- 首页tab切换列表 -----*/ +.tabs {background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);height:40px;font-size:15px;text-align:center} +.tabs a {height:40px;line-height:38px;color:var(--dz-FC-999);position:relative} +.tabs a em {position:absolute;bottom:0;left:50%;margin-left:-10px;background-color:var(--dz-BG-color);width:20px;height:3px;display:none} +.tabs a.mon {height:38px;color:var(--dz-FC-color);font-weight:400;border-bottom:2px solid var(--dz-BG-color)} +.listbox {margin:0 auto 10px;background-color:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.listbox li {height:40px;line-height:40px;margin:0 15px;font-size:15px;border-top:1px solid var(--dz-BOR-ed);overflow:hidden;white-space:nowrap;text-overflow:ellipsis} +.listbox li i {float:left;font-size:13px;margin-right:4px;color:var(--dz-FC-ccc)} +.listbox li span.mbk {color:var(--dz-FC-999)} +.listbox li span.mx {color:var(--dz-FC-ddd);margin:0 8px} +.listbox li span.mybk {color:var(--dz-FC-aaa);float:right;font-size:13px;padding-left:8px} +.listbox li span.mico {background-color:var(--dz-FC-ccc);float:left;width:4px;height:4px;margin:18px 10px 0 2px} +.listbox li span.mnum {float:left;width:20px;height:20px;line-height:20px;font-size:12px;text-align:center;margin-top:10px;margin-right:8px;background-color:var(--dz-FC-ccc);color:var(--dz-FC-fff);border-radius:4px} +.listbox li:nth-child(1) span.mnum {background-color:var(--dz-BG-2)} +.listbox li:nth-child(2) span.mnum {background-color:var(--dz-BG-3)} +.listbox li:nth-child(3) span.mnum {background-color:var(--dz-BG-4)} +.listbox li:first-child {border-top:none} + +/*----- 论坛首页统计 -----*/ +.stat {background-color:var(--dz-BG-0);color:var(--dz-FC-aaa);border-bottom:1px solid var(--dz-BOR-ed);height:40px;padding:15px 0 10px;overflow:hidden} +.stat li {text-align:center;line-height:20px} +.stat li em {display:block;font-size:20px;color:var(--dz-FC-333)} + +/*----- 论坛首页公告 -----*/ +.ann-box {padding:0 15px;height:40px;line-height:40px;background-color:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.ann-box .mtit {float:left;font-size:12px;height:20px;line-height:20px;padding:0 5px;margin-top:10px;margin-right:8px;background-color:var(--dz-BG-2);color:var(--dz-FC-fff);border-radius:4px} +#ann {height:24px;line-height:24px;margin-top:8px;overflow:hidden} +#ann li {height:24px;line-height:24px;font-size:14px;overflow:hidden;position:relative;z-index:1} +#ann li a {display:block;height:24px;line-height:24px;overflow:hidden} +#ann li em {display:none} + +/*----- 公告列表 -----*/ +.annlist {background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);overflow:hidden} +.annlist li {border-bottom:1px solid var(--dz-BOR-ed);padding:10px 15px;overflow:hidden;position:relative} +.annlist li h2 {font-size:16px;height:24px;line-height:24px;overflow:hidden} +.annlist li h2 a {display:block;overflow:hidden} +.annlist li h2 i {float:right;color:var(--dz-FC-ddd)} +.annlist li h3 {height:20px;line-height:20px;margin-top:2px;font-size:14px;color:var(--dz-FC-bbb);overflow:hidden} +.annlist li h3 a, .annlist li h3 span.mz {float:left} +.annlist li h3 a {margin-left:5px;color:var(--dz-FC-color)} +.annlist li h3 span.my {float:right} +.annlist_box {background-color:var(--dz-BG-5);color:var(--dz-FC-666);line-height:22px;font-size:14px;margin:8px 0 5px;padding:8px 10px;border-radius:4px} + +/*----- 论坛首页版块显示 -----*/ +.forumlist .subforumshow {margin-top:10px;background-color:var(--dz-BG-0);height:44px;line-height:44px;padding:0 15px;border-bottom:1px solid var(--dz-BOR-ed)} +.forumlist .subforumshow h2 {font-size:15px} +.forumlist .subforumshow i {float:right;font-size:20px;color:var(--dz-FC-aaa)} +.forumlist .sub-forum {background-color:var(--dz-BG-0)} +.forumlist .sub-forum li a.murl {display:block;height:44px;overflow:hidden} +.forumlist .sub-forum li .micon {float:left;height:44px;margin-right:10px} +.forumlist .sub-forum li .micon img,.forumlist .sub-forum li .micon svg {height:44px;border-radius:4px;float:none} +.forumlist .sub-forum li .micon img {width:48px;} +.forumlist .sub-forum li .autowidth img {width:auto;} +.forumlist .sub-forum li .mtit {height:24px;line-height:24px;font-size:16px;overflow:hidden;} +.forumlist .sub-forum li .mnum {padding-left:6px;font-size:12px;color:var(--dz-BG-2)} +.forumlist .sub-forum li .mtxt {display:block;height:20px;line-height:20px;font-size:13px;color:var(--dz-FC-999);overflow:hidden;white-space:nowrap;text-overflow:ellipsis} +.forumlist .mlist3 ul,.forumlist .mlist4 ul {display:flex;overflow-x:scroll} +.forumlist .mlist1 li {overflow:hidden;padding:10px 15px;border-bottom:1px solid var(--dz-BOR-ed)} +.forumlist .mlist2 li {float:left;width:50%;box-sizing:border-box;padding:10px 15px;overflow:hidden;border-bottom:1px solid var(--dz-BOR-ed);border-right:1px solid var(--dz-BOR-ed)} +.forumlist .mlist2 li:nth-child(2n) {border-right:none} +.forumlist .mlist3 li {float:left;min-width:33.333%;box-sizing:border-box;padding:13px 5px 10px;overflow:hidden;border-bottom:1px solid var(--dz-BOR-ed);border-right:1px solid var(--dz-BOR-ed);flex-shrink: 0} +.forumlist .mlist4 li {float:left;min-width:25%;box-sizing:border-box;padding:13px 5px 10px;overflow:hidden;border-bottom:1px solid var(--dz-BOR-ed);border-right:1px solid var(--dz-BOR-ed);flex-shrink: 0} +.forumlist .mlist3 li a.murl, .forumlist .mlist4 li a.murl {height:auto} +.forumlist .mlist3 li .micon, .forumlist .mlist4 li .micon {float:none;display:block;margin:0 auto;text-align: center;} +.forumlist .mlist3 li .mtit {margin-top:6px;text-align:center} +.forumlist .mlist4 li .mtit {font-size:13px;margin-top:5px;text-align:center} + +/*----- 提示转跳相关 -----*/ +.jump_c {padding:100px 15px;background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);margin-top:10px;font-size:15px} +.jump_c p {line-height:26px} +.jump_c p .grey {color:var(--dz-FC-999)} +.tip {width:300px;text-align:center;background-color:var(--dz-BG-0);border:1px solid var(--dz-BOR-ed);border-radius:6px} +.tip dt {padding:25px 20px;line-height:30px;font-size:14px} +.tip dt.mpt {margin:15px;padding:10px;background-color:var(--dz-BG-5);border-radius:4px} +.tip dt.mpt .pt {min-height:96px} +.tip dt .pxbg {background-color:var(--dz-BG-5);margin-bottom:5px;padding:0 5px;border-radius:4px} +.tip dd {padding:0 15px 15px;overflow:hidden} +.tip dd .button {width:48%;padding:0;display:inline-block;} +.tip .close {display:block;color:var(--dz-FC-fff)} + +/*----- 搜索 -----*/ +.search {padding:15px;background-color:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);margin-bottom:10px} +.search .mtxt {height:38px;line-height:38px;padding:0 8px;border:1px solid var(--dz-BOR-ed);border-right:none;background-color:var(--dz-BG-0);border-radius:4px 0 0 4px} +.search .mbtn {height:40px;line-height:40px;padding:0 15px;border:none;background-color:var(--dz-BG-color);color:var(--dz-FC-fff);border-radius:0 4px 4px 0} +.search-hot {padding:10px 15px 5px;min-height:300px;border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);background-color:var(--dz-BG-0)} +.search-hot h2 {height:30px;line-height:30px;font-size:14px;color:var(--dz-FC-999)} +.search-hot li a {display:block;height:40px;line-height:40px;font-size:14px;border-top:1px solid var(--dz-BOR-ed)} +.search-hot li:first-child a {border-top:none} + +/*----- 版块页面-头部版块名称区域 -----*/ +.forumdisplay-top {padding:20px 15px;background-color:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.forumdisplay-top img,.forumdisplay-top svg {float:left;height:50px;margin-right:10px;border-radius:4px} +.forumdisplay-top h2 {height:30px;line-height:30px;font-size:18px;color:var(--dz-FC-color)} +.forumdisplay-top h2 #a_favorite {float:right;height:28px;line-height:28px;font-size:12px;padding:0 10px;margin-top:10px;background-color:var(--dz-BG-3);color:var(--dz-FC-fff);border-radius:4px} +.forumdisplay-top h2 .button {float:right;height:28px;line-height:28px;font-size:12px;padding:0 10px;margin-top:10px;background-color:var(--dz-BG-3);color:var(--dz-FC-fff);border-radius:4px} +.forumdisplay-top p {height:20px;line-height:20px;color:var(--dz-FC-999)} +.forumdisplay-top p span {color:var(--dz-BG-2);margin-right:8px} + +/*----- 通用会员类列表 -----*/ +.imglist {background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);} +.imglist .subtit {background-color:var(--dz-BG-body);height:44px;line-height:44px;padding:0 15px;border-bottom:1px solid var(--dz-BOR-ed)} +.imglist .subtit h2 {font-size:15px} +.imglist li {overflow:hidden;padding:10px 15px;border-bottom:1px solid var(--dz-BOR-ed)} +.imglist li a {display:block;height:44px;overflow:hidden} +.imglist li .mimg {float:left;width:44px;height:44px;margin-right:10px} +.imglist li .mimg img {width:44px;height:44px;border-radius:50%} +.imglist li .mtit {height:20px;line-height:20px;font-size:16px;overflow:hidden} +.imglist li .mtit .mtime {float:right;font-size:12px;color:var(--dz-FC-bbb)} +.imglist li .mico {float:right;margin-left:5px;height:20px;padding:0 6px;line-height:20px;font-size:12px;background-color:var(--dz-BG-3);color:var(--dz-FC-fff);border-radius:4px} +.imglist li .mnum {padding-left:6px;font-size:12px;color:var(--dz-BG-2)} +.imglist li .mtxt {display:block;margin-top:6px;height:18px;line-height:18px;font-size:14px;color:var(--dz-FC-999);overflow:hidden} +.imglist li .mtxt i {float:left;margin-right:4px;color:var(--dz-FC-ccc)} +.imglist li .mbody {display:block;margin-top:6px;line-height:18px;font-size:14px;color:var(--dz-FC-666);overflow:hidden} +.imglist li .mtit span {float:left;font-size:14px;color:var(--dz-FC-bbb)} +.imglist li .mbody a {display:inline;color:var(--dz-FC-color)} +.imglist li .mbody a.lit {color:var(--dz-BG-2)} + +/*----- 任务、道具、勋章类列表 -----*/ +.medallist li { overflow: hidden; position: relative; } +.medallist .medal_top { height: 38px;padding: 12px 0 5px;} +.medallist .medal_top .mg_img {float: left;margin-right: 10px;} +.medallist .medal_top .mg_img img {float: left;height: 38px;line-height: 38px;border-radius: 50%;} +.medallist .tbmu {padding: 10px;margin-top: 15px;font-size: 14px;line-height: 24px;background: var(--dz-BG-5);border: 1px dashed var(--dz-BOR-ed);color: var(--dz-FC-light);position: relative;} +.medallist .mg_tit h3 { height: 20px; line-height: 20px; font-size: 15px; overflow: hidden;} +.medallist .mg_tit span { display: block;height: 18px;line-height: 18px;font-size: 12px;color: var(--dz-FC-999);} +.medallist .mg_tit span .xi1 { font-size: 14px;} +.medallist .medal_msg {margin-bottom: 5px;margin-left: 32px;line-height: 22px;font-size: 14px;color: var(--dz-FC-999);} +.medallist .medal_btn_large {position: absolute;top: 15px;right: 13px; text-align: center;} +.medallist .medal_btn { position: absolute;top: 20px;right: 13px;height: 30px;line-height: 30px;background-color: var(--dz-BG-color);font-size: 12px;border-radius: 3px;text-align: center;} +.medallist .medal_btn span {color: var(--dz-FC-fff);padding: 0 12px;} +.medallist .medal_btn span.hui {display:block;background: var(--dz-BG-5); color: var(--dz-FC-999);} +.medallist .medal_btn a {color: var(--dz-FC-fff);padding: 0 12px;} +.medallist .medal_btn span a {padding: 0 0;} +.last_medal {background: var(--dz-BG-0);} +.last_medal li { padding: 10px 12px; border-bottom: 1px solid var(--dz-BOR-ed); overflow: hidden; } +.last_medal li a { display: block; overflow: hidden; position: relative; } +.last_medal li img { float: left; margin-right: 10px; width: 30px; height: 30px; border-radius: 50%; } +.last_medal li .name { color: var(--dz-FC-333); line-height: 30px; font-size: 15px; } +.last_medal .last_medal_msg { margin-top: 5px; color: var(--dz-FC-999); font-size: 13px; line-height: 20px; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } +.last_medal .last_medal_msg strong { color: var(--dz-FC-333); } +.mgcl {padding: 5px;position: relative;} +.mgcl li {float: left;width: 25%;} +.mgcl.mgcls li {float: left;width: 50%;} +.mgcl .mgcl_box {margin:5px; padding: 10px 8px;background: var(--dz-BG-0);border-radius: 3px;text-align: center;} +.mgcl .mg_img {height: 34px;} +.mgcl .mg_img img {height: 34px;} +.mgcl.mgcls .mg_img {height: 50px;} +.mgcl.mgcls .mg_img img {height: 50px;} +.mgcl .mgcl_box p { margin-top: 10px; height: 20px;line-height: 20px;font-size: 14px;color: var(--dz-FC-333);overflow: hidden;} +.mgcl.mgcls .mgcl_box p { margin-top: 8px;} +.mgcl .mgcl_box .mgcl_p strong {font-weight: 500;} +.mgcl .mgcl_box .mgcl_p {color: var(--dz-FC-999);} +.mgcl .mgcl_box .mgcl_btn {height: 26px;line-height: 26px;} +.mgcl .mgcl_box .mgcl_btn a { display: block;float: left; padding: 0 10px; height: 26px;line-height: 26px;background-color: var(--dz-BG-color);font-size: 12px;color: var(--dz-FC-fff);border-radius: 3px;text-align: center;} +.mgcl.mgcls .mgcl_box .mgcl_btn a { display: inline-block; float: initial;} +.mgcl .mgcl_box .mgcl_btn a.mgcl_a2 { float: right;} +.mgcl.mgcls .mgcl_box .mgcl_btn a { float: initial;margin: 0 5px;} +.mgcl .mgcl_box .mgcl_btn .mgcl_sp {color: var(--dz-FC-a);font-weight: 500;} +.tip_btn { padding: 0 15px 15px;overflow: hidden; } +.medal_tip_top {padding: 15px 15px 0 15px;} +.medal_tip_top p {line-height: 22px;font-size: 12px;color: var(--dz-FC-999);} +.medal_tip_top .author p {margin-top: 6px;line-height: 24px;font-size: 15px;color: var(--dz-FC-333);overflow: hidden;} +.medal_tip_box .ts {margin: 10px 0;height: 22px;line-height: 22px;font-size: 15px;color: var(--dz-FC-a);overflow: hidden;} +.medallist .task_top .mg_tit span { color: var(--dz-FC-a); } +.medallist .medal_top.task_top .mg_img img { width: 50px;height: 50px; } +.medallist .task_list .medal_msg { margin-left: 60px; } +.threadlist li.task_list .medal_msg a { display: initial;color: var(--dz-FC-a);} +.task_list .list_jd { margin-left: 60px; margin-top: 5px; } +.task_list_jd { position: relative; width: 100%; height: 20px; margin-bottom: 12px; background: var(--dz-BG-5); border-radius: 0 10px 10px 0; } +.task_pdr { display: block; height: 20px; background: var(--dz-FC-v); border-radius: 0 10px 10px 0; } +.task_csc { position: absolute; left: 0; top: 0; padding: 0 5%; width: 90%; line-height: 20px; font-size: 12px; color: var(--dz-FC-999); } +.task_view {padding:2px 15px 15px 15px;background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);margin-top:10px} +.task_view_box { padding: 12px 0; border-bottom: 1px solid var(--dz-BOR-ed); overflow: hidden; position: relative; } +.task_view_box .notice_avt { float: left; margin-right: 10px; width: 50px; height: 50px; border-radius: 50%; } +.task_view_box .notice_avt img { width: 50px; height: 50px; border-radius: 50%; } +.task_us { margin-top: 3px; overflow: hidden; } +.task_us .task_name { width: 100%; line-height: 24px; font-size: 16px; overflow: hidden; } +.task_js { line-height: 26px; font-size: 14px; color: var(--dz-FC-999); } +.task_viewnr { margin-bottom: 12px;} +.task_viewappnr {border-bottom:1px solid var(--dz-BOR-ed);font-size: 14px;padding: 10px 0;} +.task_viewappnr .task_th {float: left;width:140px;line-height: 22px;color: var(--dz-FC-999);} +.task_viewappnr p {line-height: 22px;} +.task_viewappnr p strong {overflow: hidden;display: block;width: 100%;} +.task_viewappnr ul li a { color: var(--dz-FC-color); } +.task_prize { color: var(--dz-FC-a); } +.task_debtn a { float: left; margin-right: 15px; padding: 0 10px; height: 30px; line-height: 30px; background-color: var(--dz-BG-color); font-size: 12px; border-radius: 3px; color: var(--dz-FC-fff); text-align: center; } +.task_debtn a.hui {background: var(--dz-BG-5); color: var(--dz-FC-999);} +.task_taskid {background-color:var(--dz-BG-0);overflow:hidden} +.task_taskid .taskid_tit {font-size:15px;height:40px;line-height:40px;font-weight:400;padding:0 15px;border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.task_parterlist { padding: 0 5px 12px 5px; overflow: hidden; } +.task_parterlist li { float: left; margin: 0 2%; width: 12.66%; } +.task_parterlist li a { display: block; margin-top: 12px; text-align: center; } +.task_parterlist li a img { margin: 0 auto; width: 100%; margin-bottom: 3px; border-radius: 50%; vertical-align: middle; } +.task_parterlist li a p { display: block; width: 100%; height: 20px; line-height: 20px; color: var(--dz-FC-666); text-align: center; overflow: hidden; } +.task_mbn { font-size: 14px; color: var(--dz-FC-a); } + +.medallist .tbmu_btn { position: absolute;top: 20px;right: 13px;} +.medallist .tbmu_btn a { display: block;float: left; padding: 0 10px; height: 26px;line-height: 26px;background-color: var(--dz-BG-color);font-size: 12px;color: var(--dz-FC-fff);border-radius: 3px;text-align: center;} +.medallist .tbmu_btn .buy_credits { margin-right: 10px;} +.magic_log_list .dhnv { border-bottom: 0;} +.magic_log_list .dhnv a.mon { border-bottom: 0;} +.magic_log_list .dt { background: var(--dz-BG-0); border-top: 1px solid var(--dz-BOR-ed); } +.magic_log_list .dt th, .magic_log_list .dt td { padding: 11px 10px 9px 10px; height: 24px; line-height: 24px; font-size: 13px; overflow: hidden; } +.medal_tip_box ul { padding: 12px 15px; } +.medal_tip_box ul input.px.p_fre{ text-align:center;} +.medal_tip_box ul p {margin: 2px 0;line-height: 22px;overflow: hidden;} +.medal_tip_box ul li { display: flex; position: relative; line-height: 22px; padding: 8px 12px; background: var(--dz-BG-0); font-size: 15px; overflow: hidden; } +.medal_tip_box ul li span {display: flex; flex-shrink: 0; margin-right: 15px; color: var(--dz-FC-999);} +.medal_tip_input { display: flex; width: 100%; color: var(--dz-FC-333); border-bottom: 1px solid var(--dz-BOR-ed); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.medal_tip_input input { width: 100%; padding: 0 10px; background: var(--dz-BG-0); outline: none; border: none; height: 26px; line-height: 26px; font-size: 15px; color: #555; } +.medal_tip_p { display: flex; width: 100%; color: var(--dz-FC-a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + +/*----- 广播 -----*/ +.flw_image {margin-bottom: 10px;font-size: 0;overflow: hidden;position: relative;} +.flw_image ul li {float:left;width:32.6%;padding-bottom:25%;margin-top:1.1%;margin-right:1.1%;box-sizing:border-box;background:var(--dz-BG-5);position:relative;overflow:hidden;border-radius:4px} +.flw_image ul li:nth-child(3n) {margin-right:0} +.flw_image ul img {object-fit:cover;position:absolute} +.flw_content img {width:100%;height:100%;} +.flw_content, .flw_quotenote {line-height: 26px;font-size: 16px; } +.mtime .color {color: var(--dz-BG-2);} +.flw_foot .mtit {padding: 0 0!important; border-bottom: none!important;} +.flw_foot { color: var(--dz-FC-ccc); } +.flw_foot .flw_zbus { display: inline-block !important; color: var(--dz-FC-ccc);} +.flw_quote {margin-left: 10px;margin-bottom: 12px;padding-left: 15px;border-left: 2px solid var(--dz-BG-color);} +.flw_replybox {padding: 10px;margin:8px 0;background-color:var(--dz-BG-5);font-size:14px;border-radius:4px} +.flw_replybox .moodfm { margin-top:0} +.flw_replybox .replybox_close {margin-top: 10px;text-align: center;color: var(--dz-BG-2);} +.flw_newreply { background:var(--dz-BG-0);} +.flw_newreply li {padding: 10px;border-bottom:1px solid var(--dz-BOR-ed);} +.flw_newreply li a {display: inline-block!important; margin-right: 6px;} +a.flw_readfull {color: var(--dz-BG-2);} +.flw_more { margin-top: 10px; padding: 0 12px;} +.flw_loadmore.pn {display: block;background-color: var(--dz-BG-0);color: var(--dz-FC-333);} + +/*----- 相册 -----*/ +.album_list { margin-top: 10px;overflow: hidden;} +.album_list .album_ul { padding: 6px;background: var(--dz-BG-0);} +.album_list .album_pic { overflow: hidden; padding: 6px; } +.album_list ul li { float: left; width: 33.33%; } +.album_list ul li a { display: block; position: relative; } +.album_list ul li a img { width: 100%; vertical-align: top; } +.album_list ul li a p { width: 100%; height: 28px; line-height: 30px; font-size: 12px; color: var(--dz-FC-fff); text-align: center; background: rgba(0,0,0,0.4); position: absolute; overflow: hidden; left: 0; bottom: 0; } +.album_view_top { padding: 0 12px; background: var(--dz-BG-0); overflow: hidden; } +.album_name { padding: 8px 0; overflow: hidden; } +.album_name .albumname { height: 30px; line-height: 30px; font-size: 18px; color: var(--dz-FC-333); } +.album_name span { float: left; padding-left: 10px; height: 30px; line-height: 30px; font-size: 12px; color: var(--dz-FC-999); } +.album_name a { display: inline-block; height: 30px; line-height: 30px; font-size: 12px; color: var(--dz-FC-a); } +.album_depict { padding-bottom: 8px; line-height: 18px; font-size: 14px; color: var(--dz-FC-999); overflow: hidden; } +.album_list.album_view_list ul li { width: 50%; } +.album_tbmu { margin-bottom: 12px; overflow: hidden; } +.album_tbmu .c { position: relative; } +.album_tbmu img { width: 100%; display: block; } +.album_tbmu .tbmu { width: 100%; position: absolute; left: 0; bottom: 50px; } +.album_tbmu .tbmu a { display: block; width: 60px; height: 36px; line-height: 38px; background: rgba(0,0,0,0.35); font-size: 14px;color: var(--dz-FC-fff); text-align: center; overflow: hidden; } +.album_tbmu .tbmu .z { border-radius: 0 3px 3px 0; } +.album_tbmu .tbmu .y { border-radius: 3px 0 0 3px; } +.album_inof { background: var(--dz-BG-0); border-top: 1px solid var(--dz-BOR-ed); padding: 8px 12px; } +.album_inof p { line-height: 24px; font-size: 14px; color: var(--dz-FC-333); } +.album_inof p span { color: var(--dz-FC-999); } +.album_at { margin-top: 5px;} +.medal_tip_box.album_tip ul li span {margin-right: 8px; font-size:14px;} +.medal_tip_box.album_tip select { width: 100%; padding: 0 10px; background: var(--dz-BG-0); outline: none; border: none;} + +/*----- 记录、留言 -----*/ +.moodfm { margin-top: 10px;overflow: hidden;border-bottom: 1px solid var(--dz-BOR-ed);} +.moodfm_post { background: var(--dz-BG-0); } +.moodfm_text { padding: 10px 12px; border-bottom: 1px solid var(--dz-BOR-ed); } +.moodfm_text textarea { width: 100%; min-height: 66px; line-height: 22px; border: none; resize: none; font-size: 14px; vertical-align: middle; } +.moodfm_f { padding: 12px;overflow: hidden;} +.moodfm_btn { float: right; height: 30px; line-height: 30px; color: var(--dz-FC-999); } +.moodfm_btn .button { height: 30px; line-height: 30px; font-size: 14px} +.moodfm_signature {height: 30px; line-height: 30px;} +.doing_list_box {margin-top: 10px;} +.doing_list_box .wall_i {margin-bottom: 10px;padding: 10px;font-size: 14px;line-height: 24px;background: var(--dz-BG-5);color: var(--dz-FC-a);position: relative;} +.doing_list_box .wall_i a {color: var(--dz-FC-color);} +.threadlist .doing_list_li.list {margin-top: 0px;padding: 2px 12px 12px 12px;border-bottom: 0px solid var(--dz-BOR-ed);} +.mtime .doing_listgl a {float: right;margin-left: 8px;color: var(--dz-BG-2);} +.do_comment { line-height: 26px; font-size: 15px; color: var(--dz-FC-333); } +.do_comment .quote { padding: 10px 10px 7px 11px; margin: 5px 0; background: var(--dz-BG-5); font-size: 12px; color: var(--dz-FC-777); } +.do_comment img { margin: 1px 1px 0; width: 26px; } +.do_comment .quote li a {display: initial !important;} +.wall_list .magic_doodle { line-height: 30px;} +.wall_list .magic_doodle img { margin-right: 5px;margin-bottom: 2px;} +.wall_magic_list .magic_doodle { margin-left: 10px;} + +/*----- 通用资讯类列表 -----*/ +.wzlist {background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed)} +.wzlist li {overflow:hidden;border-bottom:1px solid var(--dz-BOR-ed);padding:15px;} +.wzlist li .mimg {float:left;width:30%;height:80px;margin-right:10px;overflow:hidden;border-radius:4px} +.wzlist li .mimg img {width:100%;height:100%;object-fit:cover;overflow:hidden} +.wzlist li .minfo {overflow:hidden} +.wzlist li .minfo p {display:block;overflow:hidden} +.wzlist li .minfo p.mtit {height:52px;line-height:26px;font-size:16px} +.wzlist li .minfo p.mtime {height:20px;line-height:20px;margin-top:8px;font-size:14px;color:var(--dz-FC-bbb);position:relative} +.wzlist li .minfo p.mtime span {float:right;color:var(--dz-BG-2)} + +/*----- 通用资讯类内容 -----*/ +.wzview {background-color:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);padding:15px 15px 10px;overflow:hidden} +.wzview_top h2 {line-height:34px;font-size:22px;text-align:center} +.wzview_top p {height:24px;line-height:24px;font-size:14px;text-align:center;margin-top:5px;color:var(--dz-FC-aaa);overflow:hidden;position:relative} +.wzview_top p span {padding:0 4px} +.wzview_desc {border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);margin:10px auto;padding:8px 0;font-size:14px;line-height:24px;color:var(--dz-FC-color);overflow:hidden} +.wzview_desc span {margin-right:5px;font-weight:400;color:var(--dz-BG-2)} +.wzview_body {margin-top:10px;font-size:16px;line-height:30px} +.wzview_body .mtit {font-weight:400;color:var(--dz-BG-2)} +.wzview_body img {vertical-align:top;max-width:100%;max-height:100%;margin:5px 0;border-radius:4px} +.wzview_sxwz {padding-top:10px;margin-top:15px;border-top:1px solid var(--dz-BOR-ed);color:var(--dz-FC-color);overflow:hidden} +.wzview_sxwz a {display:block;width:100%;height:28px;line-height:28px;font-size:14px;color:var(--dz-FC-color);overflow:hidden} + +/*----- 通用文字类列表 -----*/ +.txtlist {background-color:var(--dz-BG-0);overflow:hidden} +.txtlist .mtit {font-size:16px;height:40px;line-height:40px;font-weight:400;padding:0 15px;border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.txtlist .mtit em {margin-left:5px;font-size:12px;color:var(--dz-FC-999)} +.txtlist .mtit .ytxt {float:right;margin-top:9px;margin-left:8px;padding:0 5px;height:20px;line-height:20px;font-size:12px;color:var(--dz-FC-color);background-color:var(--dz-BG-5);border:1px solid var(--dz-BOR-ed);border-radius:4px;position:relative} +.txtlist ul {padding:0 15px;overflow:hidden} +.txtlist ul li {border-top:1px solid var(--dz-BOR-ed);height:40px;line-height:40px;font-size:14px;overflow:hidden} +.txtlist ul li:first-child {border-top:none} +.txtlist ul li i {float:left;margin-right:5px;font-size:12px;color:var(--dz-FC-ddd)} +.text-muted {padding:10px 15px;color:var(--dz-FC-999)} + +/*----- 发现页面相关 -----*/ +.findbox {background-color:var(--dz-BG-0);padding:0 15px;border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.findbox ul li {border-top:1px solid var(--dz-BOR-ed);height:50px;line-height:50px;font-size:16px;overflow:hidden} +.findbox ul li a {display:block} +.findbox ul li:first-child {border-top:none} +.findbox ul li i {float:right;margin-left:5px;font-size:12px;color:var(--dz-FC-ddd)} +.findbox ul li em {float:right;font-size:12px;margin-right:5px;color:var(--dz-BG-2)} +.findbox ul li.sclist {font-size:14px} +.findbox ul li.sclist a img {float:left;height:16px;margin-top:17px;margin-right:8px} +.findbox ul li.sclist .mdel {float:right;padding-left:15px} +.findbox ul li.sclist .mdel i {font-size:20px;color:var(--dz-BG-2)} + +/*----- 通用固定二级导航 -----*/ +.dhnv {background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);font-size:15px;text-align:center} +.dhnv a {height:40px;line-height:38px;color:var(--dz-FC-999);position:relative} +.dhnv a.mon {height:38px;color:var(--dz-FC-color);font-weight:400;border-bottom:2px solid var(--dz-BG-color)} + +/*----- 通用滑动二级导航 -----*/ +.dhnav_box, .dhnav {width:100%;height:40px;overflow:hidden} +.dhnav_box {background-color:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +#dhnav_li {width:100%;height:40px;text-align:center;white-space:nowrap} +#dhnav_li li {float:left;width:auto;height:40px;text-align:center;overflow:hidden;color:var(--dz-FC-999);position:relative} +#dhnav_li li a {display:inline-block;font-size:15px;line-height:38px;margin:0 15px} +#dhnav_li li.mon {height:38px;border-bottom:2px solid var(--dz-BG-color)} +#dhnav_li li.mon a {color:var(--dz-FC-color);font-weight:400} +#dhnav_li .swiper-wrappers li {width:25%} + +/*----- 通用滑动三级导航 -----*/ +.dhnavs_box, .dhnavs {width:100%;height:40px;overflow:hidden} +.dhnavs_box {background-color:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +#dhnavs_li {width:100%;height:40px;text-align:center;white-space:nowrap} +#dhnavs_li li {float:left;width:auto;text-align:center;overflow:hidden;color:var(--dz-FC-999);position:relative} +#dhnavs_li li a {display:inline-block;font-size:14px;height:24px;line-height:24px;margin:8px 10px;padding:0 6px;color:var(--dz-FC-999);border-radius:4px} +#dhnavs_li li span {color:var(--dz-FC-ddd)} +#dhnavs_li li.mon a {background-color:var(--dz-BG-color);color:var(--dz-FC-fff)} + +/*----- 通用面包屑导航 -----*/ +.subnavs_box, .subnavs {height:41px;width:100%;overflow:hidden} +#subnavs_box {height:40px;position:relative} +#subnavs_box {height:40px;text-align:center;white-space:nowrap;width:100%} +#subnavs_box li {float:left;width:auto;overflow:hidden;position:relative} +#subnavs_box em {position:absolute;left:50%;bottom:2px;margin-left:-9px;height:4px;width:18px;border-radius:10px} +#subnavs_box a {display:inline-block;font-size:15px;height:40px;line-height:38px;padding:0 12px} +#subnavs_box a .kmsum {display:inline-block;height:16px;line-height:16px;margin-top:11px;margin-left:5px;padding:0 6px;font-size:12px;border-radius:20px;vertical-align:top} +#subnavs_btn {height:26px;padding-left:2px;padding-top:7px;text-align:center;white-space:nowrap;width:100%} +#subnavs_btn li {float:left;width:auto;overflow:hidden} +#subnavs_btn a {display:inline-block;font-size:14px;height:24px;line-height:24px;padding:0 5px;margin:0 5px;} +#subnavs_btn a.mon {color:var(--dz-FC-color)} + +/*----- 通用文章列表 -----*/ +.threadlist_box {overflow:hidden} +.threadlist_box h2 {padding:0 15px;background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);line-height:40px;font-size:14px} +.threadlist_box h2 .emfont {color:var(--dz-BG-2)} +.threadlist_box h4 {background-color:var(--dz-BG-0);height:30px;line-height:30px;padding:80px 0;text-align:center;font-size:14px;font-weight:400;color:var(--dz-FC-999);border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);margin-bottom:10px} +.threadlist {padding:0;overflow:hidden} +.threadlist li.list {padding:2px 15px;background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);border-bottom:1px solid var(--dz-BOR-ed);margin-top:10px} +.threadlist li.list a {display:block} +.threadlist_top {height:38px;padding:12px 0 10px} +.threadlist_top .mimg {float:left;margin-right:8px} +.threadlist_top .mimg img {float:left;width:38px;height:38px;border-radius:50%} +.threadlist_top .muser h3 {margin-top:2px;height:20px;line-height:20px} +.threadlist_top .muser h3 .mmc {font-size:15px} +.threadlist_top .muser .mtime {display:block;height:18px;line-height:18px;font-size:12px;color:var(--dz-FC-ccc)} +.threadlist_tit {line-height:26px;font-size:18px;margin-bottom:5px;font-weight:400} +.threadlist_tit .micon {float:left;width:30px;height:18px;line-height:18px;text-align:center;font-size:12px;background-color:var(--dz-BG-color);color:var(--dz-FC-fff);margin-top:4px;margin-right:5px;border-radius:2px;overflow:hidden} +.threadlist_tit .top {background-color:var(--dz-BG-3)} +.threadlist_tit .digest {background-color:var(--dz-BG-4)} +.threadlist_tit .lock {background-color:var(--dz-BG-2)} +.threadlist_mes {margin-bottom:8px;line-height:22px;font-size:14px;color:var(--dz-FC-999);overflow:hidden} +.threadlist_imgs {margin-bottom:10px;font-size:0;overflow:hidden;position:relative} +.threadlist_imgs li {float:left;width:32.6%;padding-bottom:30%;margin-top:1.1%;margin-right:1.1%;box-sizing:border-box;background:var(--dz-BG-5);position:relative;overflow:hidden;border-radius:4px} +.threadlist_imgs li:nth-child(3n) {margin-right:0} +.threadlist_imgs li img {width:100%;height:100%;object-fit:cover;position:absolute} +.threadlist_imgs li em {position:absolute;bottom:0;right:0;z-index:100;background:rgb(0,0,0,.5);color:var(--dz-FC-fff);font-size:12px;height:22px;line-height:22px;padding:1px 5px;border-radius:0 0 4px 0} +.threadlist_imgs1 {margin-bottom:10px;font-size:0;overflow:hidden;position:relative} +.threadlist_imgs1 li {width:100%;padding-bottom:66%;background:var(--dz-BG-5);position:relative;overflow:hidden;border-radius:4px} +.threadlist_imgs1 li img {width:100%;height:100%;object-fit:cover;position:absolute} +.threadlist_imgs2 li {width:49.45%} +.threadlist_imgs2 li:nth-child(2n) {margin-right:0} +.threadlist_foot {padding:5px 0 15px;min-height:22px;line-height:22px;font-size:13px} +.threadlist_foot li {float:left;background-color:var(--dz-BG-5);padding:0 10px;margin:2px 10px 2px 0px;color:var(--dz-FC-aaa);border-radius:4px} +.threadlist_foot li i {float:left;font-size:14px;margin-right:3px;color:var(--dz-FC-ccc)} +.threadlist_foot li.mr {float:right;margin-right:0;padding:0;background:none;color:var(--dz-FC-color)} +.threadlist_foot li.mr a {float:right;color:var(--dz-FC-color)} +.threadlist li.list_top {padding:0 15px;background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed)} +.threadlist li.list_top a {display:block;height:36px;line-height:36px;font-size:14px;overflow:hidden} +.threadlist li.list_top a .micon {float:left;height:18px;line-height:18px;font-size:12px;background-color:var(--dz-BG-color);color:var(--dz-FC-fff);margin-top:9px;margin-right:6px;padding:0 3px;border-radius:2px;overflow:hidden} +.threadlist li.list_top a .gonggao {background-color:var(--dz-BG-2)} + +/*----- 翻页 -----*/ +.page {text-align:center;margin:15px auto;font-size:14px} +.page a {display:inline;position:relative;text-align: left;background:var(--dz-BG-0);border:1px solid var(--dz-BOR-ed);width:auto;text-indent:0;height:30px;line-height:30px;font-size:14px;margin:0 5px;padding:8px 15px;color:var(--dz-FC-666);border-radius:4px} +.page select {position:absolute;left:0;top:0;opacity:0;background-color:var(--dz-BG-0);border:var(--dz-BOR-ed);width:auto;height:36px;line-height:36px;padding:4px;font-size:14px} +.page a.grey {color:var(--dz-FC-aaa) !important} +.mpage a, .mpage .pg a {display:none !important;} +.mpage a.prev, .mpage a.nxt, .mpage .pg a.prev, .mpage .pg a.nxt {display:inline !important;} + +/*----- 快速发帖 -----*/ +.pblbox {background:var(--dz-BG-0);border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.pbl {margin:0 auto;overflow:hidden} +.pbl li {float:left;width:30%;min-height:300px;padding:8px 5px;border-left:1px solid var(--dz-BOR-ed);overflow-x:hidden;overflow-y:auto} +.pbl li:first-child {border-left:none} +.pbl li p {margin:2px 5px;height:30px;line-height:30px} +.pbl li a {display:block;height:30px;line-height:30px;padding:0 6px;font-size:14px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:4px} +.pbl li .pbls a {background:var(--dz-BG-3);color:var(--dz-FC-fff)} +.pbsb::after {float:right;margin-top:11px;margin-right:2px;vertical-align:4px;content:"";border-top:4px solid transparent;border-right:0;border-bottom:4px solid transparent;border-left:4px solid} + +/*----- 登录/注册/验证码 -----*/ +body.pg_logging, body.pg_register {background-color:var(--dz-BG-0)} +.header_toplogo {background-color:var(--dz-BG-color);padding:20px 20px 50px;text-align:center;overflow:hidden} +.header_toplogo img {width:175px} +.header_toplogo p {height:30px;line-height:30px;font-size:16px;color:var(--dz-FC-fff)} +.header_toplogo .mtop_ss a {display:block;margin:15px auto;width:80%;background-color:var(--dz-BG-0);color:var(--dz-FC-999);height:34px;line-height:34px;font-size:14px;border-radius:40px} +.header_toplogo .mtop_ss a i {margin-right:5px} +.guide_index {padding-top:0} +.loginbox {padding-bottom:10px;overflow:hidden;} +.login_from {padding:10px 15px;overflow:hidden} +.loginbox li {padding:7px 0;height:30px;line-height:30px;font-size:14px;border-bottom:1px solid var(--dz-BOR-ed)} +.loginbox li.sec_txt {height:auto} +.loginbox li.sec_txt .txt {border:1px solid var(--dz-BOR-ed);margin-left:10px;padding:0 5px;height:30px;line-height:30px;border-radius:4px} +.login_select {display:block;position:relative} +.login_select .login-btn-inner {display:block;font-size:14px;min-width:0.75em;overflow: hidden;position:relative;text-overflow:ellipsis;white-space:nowrap} +.login_select select {position:absolute;top:0;width:100%;z-index:2;cursor:pointer;height:30px;left:0;max-height:100%;min-height:100%;opacity:0.0001} +.login-btn-text {float:left} +.login_select .icon-arrow {height:30px;line-height:30px;float:right;color:var(--dz-FC-ccc)} +.btn_login, .btn_qqlogin, .btn_register {padding:7px 15px;overflow:hidden} +.btn_qqlogin .pn {display:block;background-color:var(--dz-BG-3);color:var(--dz-FC-fff)} +.reg_link {height:22px;line-height:22px;margin:7px 15px 15px;font-size:14px} +.reg_link .login_now, .reg_link .reg_now {color:var(--dz-BG-2)} +.sec_code span .txt {-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1} +.sec_code span img {float:right;height:30px} +.login_pop {background: var(--dz-BG-0);width:300px;padding:0px;margin-top:-20px;border-radius:5px;box-shadow:0px 0px 8px rgba(0, 0, 0, 0.2)} +.login_pop .log_tit {padding:0 12px;font-size:16px;height:40px;line-height:40px;text-align:center} +.login_pop .login_from .px {font-size:14px;height:26px;line-height:26px} +.login_pop .login_select .inner {font-size:14px} +.login_pop #password {width:100%} +.login_pop .log_ico {margin:10px auto 5px} +.login_pop .log_ico a {margin:5px;padding:10px;width:26px;height:26px;line-height:26px} +.login_pop .log_ico a i {font-size:26px} +.login_pop .log_dsf {margin:10px 10px 0px} +.login_pop .sec_code {font-size:14px;padding:5px 0} +.login_pop .sec_code img {height:26px;border-radius:4px} +.login_pop .sec_code .px {width:130px} +.login_pop .Password_show, .login_pop .Password_hide {display:none} +.login_pop .btn_login button {font-size:16px;height:38px;line-height:38px} + +/*----- 用户空间 -----*/ +.userinfo {padding-bottom:10px;overflow:hidden} +.user_avatar {height:200px;background-color:var(--dz-BG-color);background-repeat:no-repeat;background-position:center;background-size:cover !important;text-align:center;overflow:hidden} +.user_avatar .avatar_bg {width:100%;height:100%;background:rgb(0,0,0,.7);overflow:hidden} +.user_avatar .avatar_m {width:60px;height:60px;margin:40px auto 0} +.user_avatar .avatar_m img {width:60px;height:60px;border-radius:50%} +.user_avatar .name {margin-top:15px;height:18px;line-height:18px;font-size:16px;color:var(--dz-FC-fff)} +.user_box {margin:-25px 15px 10px;padding:5px 0;color:var(--dz-FC-aaa);background-color:var(--dz-BG-0);border:1px solid var(--dz-BOR-ed);overflow:hidden;border-radius:6px} +.user_box li {float:left;width:25%;margin:8px 0;text-align:center;line-height:20px} +.user_box li span {display:block;font-size:18px;color:var(--dz-FC-333)} +.myinfo_list {margin:0 15px 10px;padding:5px 15px;background-color:var(--dz-BG-0);border:1px solid var(--dz-BOR-ed);overflow:hidden;border-radius:6px} +.myinfo_list li {height:40px;line-height:40px;font-size:14px;border-top:1px solid var(--dz-BOR-ed);overflow:hidden} +.myinfo_list li.sig {height:auto;line-height:30px} +.myinfo_list li:first-child {border-top:none} +.myinfo_list li a {display:block} +.myinfo_list li i {float:right;font-size:14px;color:var(--dz-FC-ccc)} +.myinfo_list li em {font-size:12px;margin-left:5px;color:var(--dz-BG-2)} +.myinfo_list li span {float:right;color:var(--dz-FC-aaa)} +.myinfo_list li span.mtxt {margin-top:12px;height:18px;line-height:18px;padding:0 3px;font-size:12px;background-color:var(--dz-BG-3);color:var(--dz-FC-fff);overflow:hidden;border-radius:2px} +.myinfo_list li span a {color:var(--dz-BG-color)} +.myinfo_list li b {color:var(--dz-FC-color)} +.myinfo_list_ico {margin:0 15px 10px;padding:10px;background-color:var(--dz-BG-0);border:1px solid var(--dz-BOR-ed);overflow:hidden;border-radius:6px} +.myinfo_list_ico li {float:left;width:50%;box-sizing:border-box} +.myinfo_list_ico li a {display:block;background-color:var(--dz-BG-body);margin:5px;padding:10px;height:26px;line-height:26px;font-size:14px;overflow:hidden;border-radius:6px} +.myinfo_list_ico li a i {float:left;width:26px;height:26px;line-height:26px;font-size:14px;text-align:center;margin-right:8px;background-color:var(--dz-BG-4);color:var(--dz-FC-fff);overflow:hidden;border-radius:50%} +.myinfo_list_ico li:nth-child(5n-4) a i {background-color:var(--dz-BG-4)} +.myinfo_list_ico li:nth-child(5n-3) a i {background-color:var(--dz-BG-2)} +.myinfo_list_ico li:nth-child(5n-2) a i {background-color:var(--dz-BG-3)} +.myinfo_list_ico li:nth-child(5n-1) a i {background-color:var(--dz-BG-color)} +.myinfo_list_ico li:nth-child(5n) a i {background-color:var(--dz-BG-n)} +.myinfo_list_ico li a em {color:var(--dz-BG-2);font-size:12px;margin-left:8px} +.btn_exit, .btn_admincp {padding:5px 15px;overflow:hidden} +.btn_exit .pn {display:block;background-color:var(--dz-BG-2);color:var(--dz-FC-fff)} +.btn_admincp .pn {display:block;background-color:var(--dz-BG-3);color:var(--dz-FC-fff)} +.notice_tip {background-color:var(--dz-BG-0);padding:15px;font-size:14px;color:var(--dz-BG-3);text-align:center} +.notice_tip a {color:var(--dz-BG-3)} + +/*----- 发信息 -----*/ +.friend_msg, .self_msg {padding:20px 15px 0} +.friend_msg .avat img, .self_msg .avat img {background-color:var(--dz-BG-5);width:38px;height:38px;border-radius:50%} +.friend_msg .dialog_c, .self_msg .dialog_c {padding:8px 10px;font-size:14px;line-height:22px;border-radius:4px} +.friend_msg .dialog_c {margin:0 5px 5px 10px;background-color:var(--dz-BG-0)} +.self_msg .dialog_c {margin:0 10px 5px 5px;background-color:var(--dz-BG-color);color:var(--dz-FC-fff)} +.friend_msg .dialog_c img, .self_msg .dialog_c img {margin:2px 4px;vertical-align:bottom;border-radius:4px} +.friend_msg .date, .self_msg .date {margin:0 10px;height:18px;line-height:18px;font-size:12px;color:var(--dz-FC-aaa)} +.self_msg .date {text-align:right} +.msg_post {height:54px;overflow:hidden} +.msg_post .px, .msg_post .pns {margin:7px 10px} +.msgbox .page {margin-top:30px} + +/*----- 通用发布输入框相关 -----*/ +.post_box {background-color:var(--dz-BG-0);overflow:hidden} +.post_box li.mli {height:30px;line-height:30px;padding:5px 15px;font-size:16px;border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden;position:relative} +.post_box li.flex-half {padding:5px 0px;} +.post_box li.mtit {height:20px;line-height:20px;font-size:12px;padding-top:10px;color:var(--dz-FC-999)} +.post_box li.mtext {height:auto;line-height:30px;padding:10px 15px;font-size:16px;border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden} +.post_box li.mli .input-append {position:absolute;right:15px;color:#495057;font-size:1rem;} +.post_box .sort_sel {width:100%;background:url('touch/arrow.svg') no-repeat right center;background-size:16px 16px;padding-left:14px;height:30px;line-height:30px;font-size:16px;border:none;color:graytext;appearance:none;-moz-appearance:none;-webkit-appearance:none;overflow:hidden} +.post_box .attqx .sort_sel {font-size:14px;} +.post_box .multisel .sort_sel {background: url('touch/arrow.svg') no-repeat right center;background-size: 14px 14px;padding-right: 16px;font-size: 14px;border: none;color: graytext;appearance: none;-moz-appearance: none;-webkit-appearance: none;overflow: hidden;width:auto;} +.post_btn {padding:15px} +.post_box .sec_code {padding:5px 15px;border-bottom:1px solid var(--dz-BOR-ed)} +.post_box li .post_attbtn { margin-left:5px;} +.post_box li .post_imgbtn, .post_box li .post_attbtn {float:left;padding:0 10px;font-size:13px;color:var(--dz-FC-color);background-color:var(--dz-BG-5);border:1px solid var(--dz-BOR-ed);border-radius:4px;position:relative} +.post_box li .post_imgbtn i, .post_box li .post_attbtn i {float:left;margin-right:5px} +.post_box li .post_imgbtn input, .post_box li .post_attbtn input {position:absolute;left:0;top:0;width:100%;height:100%;opacity:0} +.post_box li .group_upico em {float: left;width: 40px;height: 40px;margin-right: 8px;border-radius: 2px;overflow: hidden;} +.post_box li .group_upico em img {width: 40px;height: 40px;border-radius: 2px;} +.post_box li .group_upico span {float: left;height: 40px;line-height: 40px;} +.post_box li .editpic {margin:12px;overflow:hidden} +.post_box li .editpic .quote {margin:0} +.post_box li .editpic li {padding:12px 0;overflow:hidden} +.post_box li .editpic li:last-child {border:none !important} +.post_box li .editpic li.up_btn {height:40px;position:relative} +.post_box li .editpic li.up_btn a {display:inline-block;height:30px;line-height:30px;padding:5px 10px;font-size:14px;border-radius:4px;background:var(--dz-BG-5);border:none;} +.post_box li .editpic li.up_btn a input {position:absolute;top:12px;left:0px;height:42px;width:109px;z-index:10;opacity:0; display:block;} +.post_box li .editpic .editpic_l {width:18px;overflow:hidden} +.post_box li .editpic .editpic_l i {font-size:18px} +.post_box li .editpic .editpic_img {width:100px;height:78px;margin:0 10px;background:#000;overflow:hidden;position:relative;border-radius:2px} +.post_box li .editpic .editpic_imgbox {width:100px;height:78px;overflow:hidden} +.post_box li .editpic .editpic_imgbox img {width:100%} +.post_box li .editpic .editpic_imgbox a {display:block;height:78px;overflow:hidden} +.post_box li .editpic .editpic_imgbox p {position:absolute;left:0;bottom:0;display:block;background-color:rgba(0, 0, 0, 0.7);width:100%;height:24px;line-height:24px;font-size:12px;text-align:center;overflow:hidden} +.post_box li .editpic .editpic_textarea {padding:5px 7px;height:66px;font-size:14px;line-height:22px;overflow:hidden;border-radius:2px} +.post_box li .editpic .editpic_textarea textarea {width:100%;height:100%;border:none !important;overflow:hidden} +.post_box li .editpic_foot {padding:10px 12px;height:30px;line-height:30px;font-size:14px;overflow:hidden} +.post_box li .editpic_foot .kmleft {width:60px;margin-right:8px} +.post_box li .editpic_foot .newalbumid {margin-left:10px;padding:0 5px;border-radius:2px} + +.post_imglist, .post_attlist {margin-bottom:8px} +.post_imglist li {position:relative;float:left;margin-top:20px;padding:0px 10px 0 0} +.post_imglist li .del {position:absolute;left:-5px;top:-12px} +.post_imglist li .del i {background-color:var(--dz-BG-0);color:var(--dz-BG-2);font-size:24px;border-radius:50%} +.post_imglist li .p_img {display:block} +.post_imglist li .p_img img {padding:2px;border:1px solid var(--dz-BOR-ed);vertical-align:middle} + +.post_attlist li {padding:12px 0;overflow:hidden} +.post_attlist li .tit {padding: 12px 0;line-height:22px;font-size:13px;text-overflow:ellipsis;white-space:nowrap} +.post_attlist li .tit img {float:left;margin:5px;} +.post_attlist li .tit span {font-weight:400;} +.post_attlist li .tit span.btn {color:var(--dz-FC-fff);background-color:var(--dz-BG-3)} +.post_attlist li .tit span.btn i.dm-trash {color:var(--dz-FC-fff);} +.post_attlist li .tit span.del{background-color:var(--dz-BG-2)} +.post_attlist li .tit span.link{text-overflow: ellipsis;display: block;overflow: hidden;} +.post_attlist li .btn {float:right;padding:0 10px;margin-left:8px;font-size:12px;border-radius:30px} +.post_attlist li .mimg {float:left;height:22px;width:22px;margin-right:6px} +.post_attlist li .minput {margin-top:8px;height:24px;line-height:24px;font-size:13px} +.post_attlist li .minput .attms {width:100%;overflow:hidden} +.post_attlist li .minput .attqx {float:left;width:49%;overflow:hidden} +.post_attlist li .minput .attjg {float:right;width:49%;overflow:hidden} +.post_attlist li .minput span {padding-right:5px} +.post_attlist li .minput em {padding-left:5px} +.post_attlist li .minput .input {padding:0 6px;height:24px;line-height:24px;font-size:13px;border-radius:4px;display:block;} +.post_attlist li .minput .price {width: inherit;} + +/*----- 文章内容页 -----*/ +.quote, .showhide, .locked {padding:8px 10px;margin:8px 0;background-color:var(--dz-BG-5);font-size:14px;border-radius:4px} +.quote a, .showhide a, .locked a {color:var(--dz-BG-3)} +.viewthread {background-color:var(--dz-BG-0);overflow:hidden} +.viewthread .view_tit {padding:15px 15px 0;line-height:30px;font-size:20px;font-weight:400} +.viewthread .view_tit span {font-size:12px;color:var(--dz-BG-2)} +.viewthread .view_reply {padding:50px 15px;line-height:30px;font-size:14px;color:var(--dz-FC-ccc);text-align:center} +.viewthread .view_reply i {display:block;font-size:50px;line-height:50px;margin:5px auto} +.plc {padding:0 15px;border-bottom:1px solid var(--dz-BOR-ed);overflow:hidden;position:relative} +.plc .avatar {position:absolute;left:15px;top:15px;display:inline} +.plc .avatar img {width:36px;height:36px;border-radius:50%} +.plc .pi {margin-top:5px;padding:10px 0;position:relative} +.plc .pi .authi {margin-left:45px;margin-bottom:10px;position:relative} +.plc .pi .authi li.mtit {height:18px;line-height:16px;padding-top:2px;overflow:hidden} +.plc .pi .authi li span.z, .plc .pi .authi li span.z a {font-size:14px;color:var(--dz-FC-color)} +.plc .pi .authi li span.y {float:right;color:var(--dz-FC-999)} +.plc .pi .authi li.mtime {height:16px;line-height:16px;color:var(--dz-FC-999);overflow:hidden} +.plc .pi .authi li.mtime span {float:right;font-size:12px} +.plc .pi .authi li.mtime span i {float:left;margin-left:8px;margin-right:2px;color:var(--dz-FC-bbb)} +.plc .pi .authi li.mtime span em {float:left} +.plc .pi .authi li.mtime em.mgl {float:right;margin-left:8px;color:var(--dz-BG-2)} +.plc .pi .authi li.mtime em.mgl a {color:var(--dz-BG-2)} +.plc .pione {margin-left:0} +.plc .pione .authi {margin-left:45px} +.plc .pi .message {line-height:26px;font-size:16px} +.plc .pi .message .jammer {font-size:12px;color:var(--dz-BG-0)} +.plc .pi .message hr.l { height: 1px; border: none; background: var(--dz-BOR-ed); color:var(--dz-BOR-ed)} +.plc .pi .message img, .plc .pi .img_one img {margin:6px 0;max-width:100%;border-radius:4px} +.plc .pi .img_list {margin:0 auto} +.plc .pi .img_list li {width:100%;text-align:center;vertical-align:middle} +.plc .pi .img_list li a {display:block} +.plc .pi .img_list li img {margin:7px 0;max-width:100%;border-radius:4px} +.plc .psth {margin: 2em 0 2em -15px;padding: 5px 45px 5px 15px;width: 70%;background: var(--dz-BOR-ed);color: var(--dz-FC-666);font-size: 14px;border-radius: 0 14px 14px 0;} +.mtime .manage, .mtime .dialogbox {width:90%;padding:10px;background-color:var(--dz-BG-0);overflow:hidden;border-radius:8px;max-height:305px;overflow-y:auto;} +.mtime .manage .button, .mtime .dialogbox .button {float:left;width:46%;margin:2%} +.replybtn {display:none;position:absolute;right:0;top:12px} +.replybtn .button {height:34px;line-height:34px;font-size:12px;padding:0 12px;border-radius:4px} +.foot_reply {height:40px;background-color:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed);overflow:hidden} +.foot_reply a {display:block;height:20px;line-height:20px;font-size:14px;text-align:center;color:var(--dz-FC-666)} +.foot_reply a i {padding-right:4px;color:var(--dz-FC-aaa)} +.foot_reply a.mx {border-left:1px solid var(--dz-BOR-ed)} +.foot_height_view {height:40px} + +.plc .pi .message .rate {margin:15px auto 10px;text-align:center;overflow:hidden} +.plc .pi .message .rate p {height:20px;line-height:20px} +.plc .pi .message .rate p.rate_tit {font-size:15px} +.plc .pi .message .rate p.rate_tip {font-size:13px} +.plc .pi .message .rate p.rate_tip span {font-size:15px;padding:0 3px} +.plc .pi .message .rate h2 {height:52px;margin:10px 0 16px;font-size:24px;overflow:hidden} +.plc .pi .message .rate h2 a {display:inline-block;width:52px;height:52px;line-height:54px;text-align:center;border-radius:50%;overflow:hidden} +.plc .pi .message .rate h2.rate_btn {height:34px;font-size:16px} +.plc .pi .message .rate h2.rate_btn a {padding:0 15px;height:34px;line-height:34px;border-radius:4px} +.plc .pi .message .rate ul {margin:8px 30px 0;text-align:center;overflow:hidden} +.plc .pi .message .rate ul li {display:inline-block;height:32px;margin:0 2px;overflow:hidden} +.plc .pi .message .rate ul li img {width:32px;height:32px;border-radius:50%;overflow:hidden} +.plc .pi .message .rate ul li a span {display:inline-block;text-align:center;font-size:14px;width:32px;height:32px;line-height:26px;overflow:hidden;border-radius:50%} + +.plc .pi .message table {border: 1px solid var(--dz-BOR-ed);} +.plc .pi .message table td {overflow-wrap: anywhere;} + +.plc .pi .message .blockcode { overflow: hidden; margin: 10px 0; padding: 5px 10px 5px 43px; font-size:12px; border-radius:4px; background: var(--dz-BG-5) repeat-y 0 0;background-image: linear-gradient(90deg,#EDEDED,#EDEDED);background-size: 43px; color: var(--dz-FC-666); } +.plc .pi .message .blockcode code { font-family: Monaco, Consolas, 'Lucida Console', 'Courier New', serif; font-size: 12px; line-height: 1.8em; } +.plc .pi .message .blockcode ol li {padding-left: 10px;list-style-type: decimal-leading-zero;line-height: 1.8em;} + +/*----- 特殊主题-投票 -----*/ +.poll {margin:10px auto;padding:10px 15px;background-color:var(--dz-BG-5);font-size:14px;border-radius:6px} +.poll_txt {line-height:28px;color:var(--dz-FC-666)} +.poll_box p {margin:5px 0;line-height:30px} +.poll_box p .mimg {display:block;width:50%;border-radius:4px} +.plc .pi .message .poll_box p .mimg img {width:80%} +.poll_box p input {margin:0 3px 3px 0;vertical-align:middle} +.poll_box p em {margin-left:5px} +.poll_box span {display:block;margin-top:5px;line-height:28px;color:var(--dz-FC-666)} +.poll_box #pollsubmit {margin:5px 0} + +/*----- 特殊主题-悬赏 -----*/ +.reward, .rwdbst {margin:15px auto 10px;padding:15px;background-color:var(--dz-BG-5);font-size:14px;border-radius:6px} +.reward_txt {line-height:20px;color:var(--dz-FC-666)} +.reward_txt strong {margin:0 5px;font-size:18px;color:var(--dz-BG-3)} +.reward_txt span {display:block;color:var(--dz-FC-bbb)} +.reward .mhd {float:right;color:var(--dz-FC-fff)} +.rwdbst {padding:10px 15px} +.rwdbst h3 {color:var(--dz-BG-3)} +.rwdbst h3 a {float:right;font-size:14px;color:var(--dz-FC-color)} +.rwdbst .muser {margin:8px 0;height:20px;line-height:20px} +.rwdbst .muser img {float:left;width:20px;height:20px;margin:0 5px 0 0 !important;border-radius:50% !important} +.rwdbst .mtxt {color:var(--dz-FC-999)} + +/*----- 特殊主题-辩论 -----*/ +.debate_box {margin:10px auto;padding:10px 15px;background-color:var(--dz-BG-5);font-size:14px;border-radius:6px} +.debate_box strong em {float:right;color:var(--dz-FC-999);font-weight:400} +.debate_box p {color:var(--dz-FC-666)} +.debate_box p strong {color:var(--dz-BG-2)} +.debate_box .pns {float:left;margin:5px 0;height:30px;line-height:30px;padding:0 10px;font-size:14px;color:var(--dz-FC-fff) !important} +.debate_box #affirmbutton {background-color:var(--dz-BG-3)} +.debate .endtime {margin-bottom:5px;font-size:14px;text-align:center;color:var(--dz-FC-999)} + +/*----- 特殊主题-活动 -----*/ +.activity {margin:10px auto;padding:10px 15px;background-color:var(--dz-BG-5);font-size:14px;border-radius:6px} +.activity dl {margin-top:5px} +.activity dt {line-height:26px} +.activity dt .mtit {float:left;width:80px;margin-right:10px;text-align:right} +.activity dt .my {float:right;color:var(--dz-FC-999)} +.activity dt em, .activity dt a, .activity dt.mtxt {color:var(--dz-BG-3)} +.activity dt .mtxt {display:block;margin-top:8px} +.activity dt .mtxt .mx {margin-left:3px;color:var(--dz-BG-2)} +.activity dt .px {padding:2px 0;text-indent:8px;border-radius:4px} +.activity dt p a.xi2 {display:none} +.activity p {background-color:var(--dz-BG-0)} +.activity p label {display:block} +.activity .join_btn {margin:10px auto} +.activity .mbox {width:100%} +.activity .mbox .ma {width:40%} +.activity .mbox .mb, .activity .mbox .mc {width:30%;text-align:right} + +/*----- 特殊主题-商品 -----*/ +.trade_box {margin:10px auto;padding:10px 15px;background-color:var(--dz-BG-5);font-size:14px;border-radius:6px} +.trade_box .my {float:right;color:var(--dz-BG-3)} + +/*----- 文章内容页-返回顶部 -----*/ +.scrolltop {display:block;position:fixed;right:15px;bottom:8px;margin-bottom:50px;height:38px;width:38px;z-index:99999;background:rgba(0, 0, 0, .8);opacity:.618;box-shadow:0 0 2px rgba(0,0,0,.2);border-radius:6px} +.scrolltop:after {content:"";position:absolute;top:12px;left:11px;width:16px;height:2px;border-radius:1px;background:var(--dz-BG-0);border-radius:1px} +.scrolltop:before {content:"";position:absolute;top:17px;left:11px;display:inline-block;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #fff;border-top:0;-webkit-transform:scale(1,1.2222);-webkit-transform:translate(0,1px);transform:scale(1,1.2222);transform:translate(0,1px)} +.scrolltop.bottom:after {top:24px} +.scrolltop.bottom:before {border-top:8px solid var(--dz-FC-fff);border-bottom:0;top:11px} + +/*----- 动态 -----*/ +.home_feed{background:var(--dz-BG-0)} +.home_feed_time{height:25px;line-height:25px;padding:10px 0px 0px;margin-bottom:5px;position:relative} +.home_feed_time span{text-align:center;height:24px;line-height:24px;display:inline-block;font-size:16px;font-weight:bold;color:var(--dz-FC-666);background:var(--dz-BG-0);padding:0px 12px;margin-left:47px;position:relative;z-index:1} +.home_feed_time:after{content:"";width:100%;height:1px;position:absolute;top:21px;left:0px;background:#ededed} +.home_feed_item li:first-child .home_feed_time{height:10px;overflow:hidden} +.home_feed_item li:first-child .home_feed_time span,.home_feed_item li:first-child .home_feed_time:after{display:none} +.home_feed_ecs{padding:0px 10px 40px 60px;position:relative} +.home_feed_ecs .mimg {position: absolute;float:left;margin-right:8px;top:10px;left:10px} +.home_feed_ecs .mimg img {float:left;width:38px;height:38px;border-radius:50%} +.home_feed_c{border-bottom:1px dashed var(--dz-BOR-ed)} +.home_feed_c .delete_bt{float:right;margin:-3px -1px 0px 10px;position:static} +.home_feed_item{padding:0px 0px 1px;color:var(--dz-FC-777);overflow:hidden} +.home_feed_item img{max-width:100%} +.home_feed_item .home_mess{margin-bottom:14px} +.home_feed_item .home_mess b{font-weight:400} +.home_feed_item .home_mess a{color:var(--dz-FC-color);} +.home_feed_title{padding:10px 0px} +.home_feed_title p{font-size:14px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden} +.home_feed_title p a{font-weight:bold;color:var(--dz-FC-777)} +.home_feed_title span{margin-left:10px;color:var(--dz-FC-bbb)} + +/*----- 设置-积分-记录 -----*/ +.home_credit_log{background:var(--dz-BG-0);border-top:1px solid var(--dz-BOR-ed)} +.home_credit_log li{padding:10px 15px;border-bottom:1px solid var(--dz-BOR-ed)} +.home_credit_log li .txt{color:var(--dz-FC-999);overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} +.home_credit_log li .txt a{color:var(--dz-FC-999)} +.home_credit_log li .mtime{color:var(--dz-FC-999);text-align: right;min-width:120px;} +.home_credit_log .xi1{color:var(--dz-BG-2)} +.home_credit_log .xg1{color:green} +.home-order-status-0 a {color:blue;} +.home-order-status-1 {color:green;} +.home-order-status-2 {color:var(--dz-FC-aaa);} + +/*----- 群组 -----*/ +.groupbox {} +.group_memberlist_star {background-color: var(--dz-BG-3);border-radius: 10px;color:var(--dz-BG-0);margin-left:5px;padding: 0px 2px;font-size: 12px;} +#group_manage_userlist li { width:auto; margin:0 5px;} +#threadtype input { background-color:var(--dz-BG-5); width:100%;} + +/*----- media --------*/ +.media { display: block; margin-bottom: 30px; max-width: 100%; } +.media_container { display: block; width: 100%; height: 100%; min-height: 20px; background: url("./images/img_loader.gif") no-repeat center; } +.media_container a { text-decoration: none !important; } +.media_tips { display: block; margin: 10px 0; text-align: center; } +.media_tips a { font-size: 12px !important; color: var(--dz-FC-999) !important; text-decoration: none !important; } +.media_tips a:hover { text-decoration: underline !important; } + +.tfm { width: 100%; font-size: 14px; } +.tfm caption, .tfm th, .tfm td { vertical-align: top; padding: 7px 0; line-height: 28px; } +.tfm caption h2 { font-size: 16px; } +.vt th, .vt td { vertical-align: top; } +.tfm th {padding-right: 5px; width: 70px; } +.tfm th .rq { float: right; font-size: 14px; } +.tfm .pt, .tfm .px { width: 97%; line-height: 28px; border:1px solid var(--dz-BOR-ed); } +.tfm .pt { min-height: 65px; } +.tfm .d { clear: both; color: var(--dz-FC-333); } +.tfm .d em { margin-left: 5px; color: red; } +.tfm .d strong { margin-left: 5px; } +.tfm .d a { color: var(--dz-BG-2); } +.tfm .p { text-align: right; } +.tfm .pcl label { display: block; padding: 0 2px 5px; } +.tfm .pcl .pc { margin-right: 5px; padding: 0; } +.tfm .l th, .tfm .l td { padding-top: 0; padding-bottom: 0; } +.bn .tfm caption, .bn .tfm th, .bn .tfm td { padding-top: 5px; padding-bottom: 5px; } +.tfm select {background:url('touch/arrow.svg') no-repeat right center;background-size:14px 14px;padding-right:16px;font-size:14px;border:none;color:graytext;appearance:none;-moz-appearance:none;-webkit-appearance:none;overflow:hidden} + +.xl li { margin: 2px 0; } + .xl em { float: right; padding-left: 5px; } + .xl em, .xl em a { color: {LIGHTTEXT}; } + .xl label, .xl label a { color: #C00; } + .xl1 li { height: 1.5em; overflow: hidden; } + .xl1_elp { float: left; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .xl2 li { float: left; margin: 2px 0; padding: 0; width: 50%; height: 1.5em; overflow: hidden; } + .xl ol, ol.xl { line-height: 21px; counter-reset: xlol; } + .xl ol li, ol.xl li { background: none; height: 21px; } + .xl ol li:before, ol.xl li:before { display: inline-block; width: 16px; height: 16px; line-height: 16px; margin: 2px 4px 3px 0; color: var(--dz-FC-fff); background: var(--dz-BG-n); border-radius: 8px; text-align: center; counter-increment: xlol; content: counter(xlol); } + .xl ol li:first-child:before, ol.xl li:first-child:before { background: #ED741C; } + .xl ol li:nth-child(2)::before, ol.xl li:nth-child(2)::before { background: #F3AC27; } + .xl ol li:nth-child(3)::before, ol.xl li:nth-child(3)::before { background: #F8CB5E; } + .xld dt { padding: 8px 0 5px; font-weight: 700; } + .xld dd { margin-bottom: 8px; } + /* text with thumbnail image ( must with the additional class .cl ) */ + .xld .m { float: left; margin: 8px 8px 10px 0; } + .xld .atc { float: right; margin-left: 20px; } + .xld .atc img { padding: 2px; max-width: 80px; max-height: 80px; border: 1px solid var(--dz-BOR-ccc); background: {WRAPBG}; } + .xld a.d, .xl a.d, .attc a.d, .c a.d, .sinf a.d { float: right; width: 14px; height: 14px; border-radius: 7px; margin-left: 3px; margin-right: 3px; overflow: hidden; line-height: 14px; text-align: center; background: var(--dz-BG-6); } + .attc a.d { float: left; } + .xld a.d:hover, .xl a.d:hover, .attc a.d:hover, .c a.d:hover, .sinf a.d:hover { background-color: #f99; text-decoration: none; } + .xld a.d:before, .xl a.d:before, .attc a.d:before, .c a.d:before, .sinf a.d:before { content: "\d7"; color: var(--dz-FC-fff); font-weight: 700; } + .xld a.b { background-position: 0 -40px; } + .xld a.b:hover { background-position: 0 -60px; } + .xlda dl { padding-left: 65px; } + .xlda .m { display: inline; margin: 8px 0 8px -65px; } + .xlda .avt img { display: block; } + .xlda dd img { max-width: 550px; } + .xlda dd a { color: {HIGHLIGHTLINK}; } + .xlda dd .hot { color: {NOTICETEXT}; } + +/* 用来展示复杂统计数据的表格,目前仅用户组页面用到 */ +.tdats { overflow: hidden; zoom: 1; margin: 10px 0; } +.tdats i { font-size: 14px; } +.tdats i:before { height: 18px; line-height: 18px; margin-right: 2px; } +.tdats th, .tdats td { overflow: hidden; padding: 0 5px; height: 26px; border-width: 0 1px 0 0; border-color: #fff; white-space: nowrap; } +.tdats th { height: 40px; font-weight: 700; } +.tdats .h th { height: 24px; border-top: 1px solid var(--dz-BOR-ed); border-bottom: 1px solid #E5E5E5; background: linear-gradient(0deg, #efefef, #fcfcfc); color: var(--dz-FC-666); zoom: 1; } +.tdats .tdat { float: left; width: 40%; border: none; table-layout: fixed; } +.tdats .tfx { width: 300px; } +.tdats .tfxf { width: 60%; } +.tfx th, .tfx td { border-width: 0 3px !important; background: #FFF2DF; } +.tfx .alt, .tfx .alt th, .tfx .alt td { background: #FAEDDA; } +.tfx .h th { padding: 1px 5px; } +.tscr { float: left; overflow: hidden; width: 470px; } +.tscr .tdat th, .tscr .tdat td { width: 470px; } +.nwp { word-wrap: normal; white-space: nowrap; } +.tdats .c0 { padding: 0; height: 46px; text-align: center; vertical-align: bottom; background: transparent; } +.tdats .c0 h4 { line-height: 38px; background-color: #F60; color: var(--dz-FC-fff); } +.tdats .c0 h4, .tdats .tb li { -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } +.tdats .tb { float: left; margin-top: 8px; padding-left: 0; width: 470px; border-bottom-width: 4px; } +.tdats .tb li { padding: 0 10px; line-height: 33px; font-weight: 700; color: var(--dz-BG-2); } +.tdats .c1 { border-color: #158B00; } +.tdats #c1 { border-color: #158B00; background-color: #158B00; background-position: 0 -40px; } +.tdats .c2 { border-color: #057373; } +.tdats #c2 { border-color: #057373; background-color: #057373; background-position: 0 -80px; } +.tdats .c3 { border-color: #1F57A9; } +.tdats #c3 { border-color: #1F57A9; background-color: #1F57A9; background-position: 0 -120px; } +.tdats .c4 { border-color: #1A588D; } +.tdats #c4 { border-color: #1A588D; background-color: #1A588D; background-position: 0 -160px; } +.tdats .c1 #c1, .tdats .c2 #c2, .tdats .c3 #c3, .tdats .c4 #c4 { line-height: 35px; } +.ftb td { width: 12%; } + +.et { margin: 20px 0 10px; } +.el li { padding: 10px 20px; min-height: 20px; border-bottom: 1px dashed var(--dz-BOR-ed); } +.el .t { position: absolute; margin: 1px 0 0 -20px; } +.el .o { overflow: hidden; float: right; margin: 4px -20px -4px 0; width: 16px; height: 16px; font-size: 16px; line-height: 16px; font-family: dzicon; text-align: center; color: var(--dz-FC-tinvalid); } +/* 外宽改变时 .ie6 .el .o, .ie6 .xlda .el .o 的 margin 值需要更改 */ +.el .o:before { content: "\f149"; } +.el .o:hover { text-decoration: none; } +.el .del:before { content: "\f116"; } +.el .d { padding-top: 10px; } +.ec .tn { margin: 10px 10px 0 0; cursor: pointer; } +.ec a .tn { float: left; padding: 2px; max-width: 90px; max-height: 90px; border: 1px solid var(--dz-BOR-ed); } +.el .ec .hot { float: right; margin: 10px 0 0 10px; width: 55px; height: 50px; background: linear-gradient(0deg, #B2C0DC 40%, #D8DEEA 40%) no-repeat; border-radius: 3px; } +.el .ec .hot a { display: block; line-height: 20px; text-align: center; color: var(--dz-FC-fff); } +.el .ec .hot a:hover { text-decoration: none; } +.el .ec .hot em { display: block; line-height: 30px; font-size: 16px; cursor: pointer; } + +.sl li { padding: 10px 0; border-bottom: none; } +.sl .h { padding: 6px 10px; background: var(--dz-BG-5); border-bottom: 1px solid var(--dz-BOR-ed); } + + +/* 排行榜 */ +.rankicn { width: 20px; } +.ranks { display: block; width: 16px; height: 16px; line-height: 16px; text-align: center; color: var(--dz-FC-fff); background: var(--dz-BG-n); border-radius: 8px; } +.ranks_1 { background: var(--dz-BG-2); } .ranks_2 { background: var(--dz-BG-3); } .ranks_3 { background: var(--dz-BG-4); } + +/* 图片列表 */ +.ml {} + .ml li { float: left; padding: 0 5px 5px; text-align: center; overflow: hidden; } + .ml img { display: block; margin: 0 auto; } + .ml p, .ml span { display: block; width: 100%; height: 20px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } + .ml span, .ml span a { color: var(--dz-FC-999); } + .mls li { padding: 0 0 5px; width: 66px; } + .mls .avt { display: block; margin: 0 auto; width: 54px; } + .mls img { width: 48px; height: 48px; } + .mls p { margin-top: 5px; } + .mlm li { padding: 0 0 5px; width: 150px; } + .mlm img { width: 120px; height: 120px; } + .mla li { width: 140px; } + .mla1 li { height: 150px; } + .mla .c { margin: 6px auto; padding: 8px; width: 120px; height: 120px; background: var(--dz-BG-5); text-align: left; box-shadow: 1px 1px 2px var(--dz-BOR-ccc); } + .mla .a { background: var(--dz-BG-5); } + .mla .c a { display: block; width: 120px; height: 120px; overflow: hidden; background: var(--dz-BG-0); } + .mla .c a:hover { text-decoration: none; } + .mla .c .nophoto { height: 120px; line-height: 120px; } + .mla img { max-width: 120px; max-height: 120px; } + .mlp li { width: 140px; height: 140px; } + .mlp .d { padding: 0 0 5px; width: 150px; height: 180px; } + .mlp img { padding: 2px; max-width: 120px; max-height: 120px; border: 1px solid var(--dz-BOR-ccc); background: var(--dz-BG-0); } + + .xl em { float: right; padding-left: 5px; } + .xl em, .xl em a { color: var(--dz-FC-999); } +/* .rnk1 每行一个区块 */ +.rnk1 {} + .rnk1 .mlp .d { width: 120px; height: 120px; } + .rnk1 .mlp img { max-width: 100px; max-height: 75px; } + .rnk1 .mlp .bigpic { width: 100%; height: auto; } + .rnk1 .bigpic img { max-width: 286px; max-height: 200px; } + +/* 图片排名上的序号 */ +.picrank { position: absolute; margin: -10px 0 0 -10px !important; } + +/* 竞价排名 by Pony */ +.bid { margin: 2px -4px -2px 2px; zoom: 1; } +.biduser { width: 988px; background: url(./touch/avatar_blank.gif); } + .biduser li { float: left; margin: 0 4px 4px 0; } + .biduser a { display: block; } + .biduser img { width: 48px; height: 48px; } + .bidtop { overflow: hidden; width: 100px; height: 100px; background-color: var(--dz-BG-5); } + .bidtop img { width: auto; height: 100px; } + + +.xl2 li { float: left; margin: 2px 0; padding: 0; width: 100%; height: 1.5em; overflow: hidden; } + .xl2 li.xl2_r { margin-right: 0; } + +.hasrank dl { padding-left: 110px; } + .ranknum { position: absolute; margin: 8px 0 0 -100px; } + +.el .t { } +.pll li { padding-left: 20px; } + +.acl td { border-top: none; border-bottom: 1px dashed var(--dz-BOR-ed); } + + + /* tl --> Thread list modify by lushnis */ + .tl .bm_c { padding-top: 0; } + .tl table { width: 100%; table-layout: fixed; border-collapse: separate; } + .tl th, .tl td { padding: 5px 0; border-bottom: 1px solid var(--dz-BOR-ed); } + .emptb th, .emptb td { padding: 0; border-bottom: none; } + .tl tr:hover th, .tl tr:hover td { background-color: var(--dz-BG-5); } + .tl .threadpre td, .tl .threadpre:hover td { background-color: var(--dz-BG-body); } + .tl .threadpre .threadpretd { border-left: 1px solid var(--dz-BOR-ed); border-right: 1px solid var(--dz-BOR-ed); } + .tl th .tdpre, .tl td.fn .tdpre { visibility: hidden; display: inline; padding: 0 3px; height: 17px; line-height: 17px; margin-top: 3px; background: var(--dz-BG-n); color: var(--dz-FC-fff); text-align: center; text-decoration: none; border-radius: 2px; } + .tl th:hover .tdpre, .tl td.fn:hover .tdpre { visibility: visible; } + .tl th .tdpre:visited, .tl td.fn .tdpre:visited { color: var(--dz-FC-fff); } + .tbox { display: inline-block; color: var(--dz-FC-fff); height: 17px; line-height: 17px; padding: 0 2px; border-radius: 2px; } + .tl .tbox { vertical-align: middle; } + .rushrep { background: #904B21; } + .tl .tdigest { background: #01B0C8; } + .theatlevel { background-color: #FA5600; background: linear-gradient(90deg,#FA5600,#FC0); font-weight: 700; border-radius: 4px 0 0 4px; text-shadow: 1px 1px 1px #E40; position: relative; margin-right: 5px; } + .theatlevel:after { display: block; content: ""; width: 5px; height: 17px; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='5' height='17'%3e%3cpath fill='%23fc0' d='M0 0h4L0 5h5c0 4-3 8-5 8l5 2-4 2H0'/%3e%3c/svg%3e"); position: absolute; top: 0; right: -5px; } + .trecic { background: #FF9C00; } + .tprizes { background: #BCB728; text-indent: 0; } + .fastpreview { position: relative; } + .icon_preview { position: absolute; display: block; left: 80px; top: -13px; width: 11px; height: 8px; background: url(../common/icon_preview.png); overflow: hidden; } + a.icon_up { display: block; margin:0 10px; height: 25px; background: #F2F2F2 url(../common/arrow_up.png) no-repeat 50% 50%; overflow: hidden; border:1px dashed rgb(194, 213, 227); border-radius: 3px; } + a.icon_up:hover { background:var(--dz-BG-0) url(../common/arrow_up_hover.png) no-repeat 50% 50%; } + .fastpreview td { border-bottom: none!important; } + .tl th, .tl td.fn { padding-right: 1.5em; zoom: 1; } + .fromg { visibility: hidden; } + .tl .icn { padding-left: 5px; width: 25px; text-align: left; } + .tl .icn a:hover { text-decoration: none; } + .tl .tpin { position: relative; } + .tl .tpin::before { display: block; position: absolute; width: 18px; text-align: center; color: var(--dz-FC-fff); z-index: 10; } + .tl .tpin1::before { content: "1"; } + .tl .tpin2::before { content: "2"; } + .tl .tpin3::before { content: "3"; } + .tl .tpin4::before { content: "!"; } + .tl .tpin1 svg { fill: #72B933; } + .tl .tpin2 svg { fill: #00ABDE; } + .tl .tpin3 svg { fill: #F90; } + .tl .tpin4 svg { fill: var(--dz-FC-a); } + .tl .new {} + .tl .comm {} + .tl .frm { width: 150px; } + .tl .o { width: 20px; } + .tl .num { width: 60px; line-height: 14px; } + .tl .by { width: 105px; line-height: 14px; } + .tl cite, .tl .num em { display: block; } + .tl th em { margin-right: 4px; zoom: 1; } + .tl th em, .tl th em a { color: #007CD5; } + .tl td em { font-size: 11px; font-family: Arial, Psimsun, sans-serif; -webkit-text-size-adjust: none; } + /*.tl .th th, .tl .th td { padding: 8px 0; background: {SPECIALBG}; border-top: 1px solid var(--dz-BOR-ed); }*/ + .tl .ts th, .tl .ts td { padding: 3px 0; border-bottom-color: var(--dz-BOR-ed); background: var(--dz-BG-5); } + .tl .th { margin-top: 1px; padding: 0 10px; border-bottom: 1px solid var(--dz-BOR-ed); background: var(--dz-BG-5); } + .tl .th table { border: none; } + .tl .th td, .tl .th th { height: 20px; border: none; vertical-align: baseline; } + .tl .tf { padding: 3px 0; } + .tf .showmenu:hover { border-color: var(--dz-BOR-ed); } + + .pll .c { margin: 0 84px 0 74px; } + .pll ol { margin: 5px 0 0 20px; } + .pll ol li { list-style-type: decimal; padding: 0; border-bottom: none; } \ No newline at end of file diff --git a/static/image/mobile/touch/arrow.png b/static/image/mobile/touch/arrow.png new file mode 100644 index 0000000..ba34164 Binary files /dev/null and b/static/image/mobile/touch/arrow.png differ diff --git a/static/image/mobile/touch/arrow.svg b/static/image/mobile/touch/arrow.svg new file mode 100644 index 0000000..e69f468 --- /dev/null +++ b/static/image/mobile/touch/arrow.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/image/mobile/touch/avatar_blank.gif b/static/image/mobile/touch/avatar_blank.gif new file mode 100644 index 0000000..a505413 Binary files /dev/null and b/static/image/mobile/touch/avatar_blank.gif differ diff --git a/static/image/mobile/touch/explore.svg b/static/image/mobile/touch/explore.svg new file mode 100644 index 0000000..fa43874 --- /dev/null +++ b/static/image/mobile/touch/explore.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/static/image/mobile/touch/find.png b/static/image/mobile/touch/find.png new file mode 100644 index 0000000..331e84a Binary files /dev/null and b/static/image/mobile/touch/find.png differ diff --git a/static/image/mobile/touch/find_on.png b/static/image/mobile/touch/find_on.png new file mode 100644 index 0000000..d5ab297 Binary files /dev/null and b/static/image/mobile/touch/find_on.png differ diff --git a/static/image/mobile/touch/foot_post.png b/static/image/mobile/touch/foot_post.png new file mode 100644 index 0000000..bfc6bcd Binary files /dev/null and b/static/image/mobile/touch/foot_post.png differ diff --git a/static/image/mobile/touch/forum.png b/static/image/mobile/touch/forum.png new file mode 100644 index 0000000..c123194 Binary files /dev/null and b/static/image/mobile/touch/forum.png differ diff --git a/static/image/mobile/touch/forum.svg b/static/image/mobile/touch/forum.svg new file mode 100644 index 0000000..463c3fe --- /dev/null +++ b/static/image/mobile/touch/forum.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/static/image/mobile/touch/forum_new.png b/static/image/mobile/touch/forum_new.png new file mode 100644 index 0000000..ef09232 Binary files /dev/null and b/static/image/mobile/touch/forum_new.png differ diff --git a/static/image/mobile/touch/home.png b/static/image/mobile/touch/home.png new file mode 100644 index 0000000..a3accb3 Binary files /dev/null and b/static/image/mobile/touch/home.png differ diff --git a/static/image/mobile/touch/home.svg b/static/image/mobile/touch/home.svg new file mode 100644 index 0000000..5b29691 --- /dev/null +++ b/static/image/mobile/touch/home.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/static/image/mobile/touch/home_on.png b/static/image/mobile/touch/home_on.png new file mode 100644 index 0000000..20c6b54 Binary files /dev/null and b/static/image/mobile/touch/home_on.png differ diff --git a/static/image/mobile/touch/index.htm b/static/image/mobile/touch/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/mobile/touch/logo.png b/static/image/mobile/touch/logo.png new file mode 100644 index 0000000..fe800be Binary files /dev/null and b/static/image/mobile/touch/logo.png differ diff --git a/static/image/mobile/touch/my.png b/static/image/mobile/touch/my.png new file mode 100644 index 0000000..4826cb7 Binary files /dev/null and b/static/image/mobile/touch/my.png differ diff --git a/static/image/mobile/touch/my_on.png b/static/image/mobile/touch/my_on.png new file mode 100644 index 0000000..8a95731 Binary files /dev/null and b/static/image/mobile/touch/my_on.png differ diff --git a/static/image/mobile/touch/nophoto.gif b/static/image/mobile/touch/nophoto.gif new file mode 100644 index 0000000..d352dc9 Binary files /dev/null and b/static/image/mobile/touch/nophoto.gif differ diff --git a/static/image/mobile/touch/plus_btn.svg b/static/image/mobile/touch/plus_btn.svg new file mode 100644 index 0000000..c64da97 --- /dev/null +++ b/static/image/mobile/touch/plus_btn.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/image/mobile/touch/shequ.png b/static/image/mobile/touch/shequ.png new file mode 100644 index 0000000..8684fd2 Binary files /dev/null and b/static/image/mobile/touch/shequ.png differ diff --git a/static/image/mobile/touch/shequ_on.png b/static/image/mobile/touch/shequ_on.png new file mode 100644 index 0000000..23d00e5 Binary files /dev/null and b/static/image/mobile/touch/shequ_on.png differ diff --git a/static/image/mobile/touch/space.svg b/static/image/mobile/touch/space.svg new file mode 100644 index 0000000..26ff7c4 --- /dev/null +++ b/static/image/mobile/touch/space.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/static/image/poke/cyx.gif b/static/image/poke/cyx.gif new file mode 100644 index 0000000..a6dfa92 Binary files /dev/null and b/static/image/poke/cyx.gif differ diff --git a/static/image/poke/dyx.gif b/static/image/poke/dyx.gif new file mode 100644 index 0000000..49f6ec1 Binary files /dev/null and b/static/image/poke/dyx.gif differ diff --git a/static/image/poke/fw.gif b/static/image/poke/fw.gif new file mode 100644 index 0000000..78602aa Binary files /dev/null and b/static/image/poke/fw.gif differ diff --git a/static/image/poke/gyq.gif b/static/image/poke/gyq.gif new file mode 100644 index 0000000..5632916 Binary files /dev/null and b/static/image/poke/gyq.gif differ diff --git a/static/image/poke/index.htm b/static/image/poke/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/poke/jy.gif b/static/image/poke/jy.gif new file mode 100644 index 0000000..540ad37 Binary files /dev/null and b/static/image/poke/jy.gif differ diff --git a/static/image/poke/nyy.gif b/static/image/poke/nyy.gif new file mode 100644 index 0000000..638bc45 Binary files /dev/null and b/static/image/poke/nyy.gif differ diff --git a/static/image/poke/pmy.gif b/static/image/poke/pmy.gif new file mode 100644 index 0000000..dbb63b6 Binary files /dev/null and b/static/image/poke/pmy.gif differ diff --git a/static/image/poke/ppjb.gif b/static/image/poke/ppjb.gif new file mode 100644 index 0000000..0ebb0b5 Binary files /dev/null and b/static/image/poke/ppjb.gif differ diff --git a/static/image/poke/wgs.gif b/static/image/poke/wgs.gif new file mode 100644 index 0000000..5cbac0f Binary files /dev/null and b/static/image/poke/wgs.gif differ diff --git a/static/image/poke/wx.gif b/static/image/poke/wx.gif new file mode 100644 index 0000000..033443c Binary files /dev/null and b/static/image/poke/wx.gif differ diff --git a/static/image/poke/yb.gif b/static/image/poke/yb.gif new file mode 100644 index 0000000..f9351ea Binary files /dev/null and b/static/image/poke/yb.gif differ diff --git a/static/image/poke/yw.gif b/static/image/poke/yw.gif new file mode 100644 index 0000000..1b20743 Binary files /dev/null and b/static/image/poke/yw.gif differ diff --git a/static/image/poke/yyk.gif b/static/image/poke/yyk.gif new file mode 100644 index 0000000..f95b7b0 Binary files /dev/null and b/static/image/poke/yyk.gif differ diff --git a/static/image/postbg/0.gif b/static/image/postbg/0.gif new file mode 100644 index 0000000..e633c1b Binary files /dev/null and b/static/image/postbg/0.gif differ diff --git a/static/image/postbg/1.jpg b/static/image/postbg/1.jpg new file mode 100644 index 0000000..5fc909e Binary files /dev/null and b/static/image/postbg/1.jpg differ diff --git a/static/image/postbg/2.jpg b/static/image/postbg/2.jpg new file mode 100644 index 0000000..24db087 Binary files /dev/null and b/static/image/postbg/2.jpg differ diff --git a/static/image/postbg/3.jpg b/static/image/postbg/3.jpg new file mode 100644 index 0000000..d335a6e Binary files /dev/null and b/static/image/postbg/3.jpg differ diff --git a/static/image/postbg/bg1.png b/static/image/postbg/bg1.png new file mode 100644 index 0000000..daac8a1 Binary files /dev/null and b/static/image/postbg/bg1.png differ diff --git a/static/image/postbg/bg10.png b/static/image/postbg/bg10.png new file mode 100644 index 0000000..a1d73ee Binary files /dev/null and b/static/image/postbg/bg10.png differ diff --git a/static/image/postbg/bg2.png b/static/image/postbg/bg2.png new file mode 100644 index 0000000..4d5d135 Binary files /dev/null and b/static/image/postbg/bg2.png differ diff --git a/static/image/postbg/bg3.png b/static/image/postbg/bg3.png new file mode 100644 index 0000000..f3b1c85 Binary files /dev/null and b/static/image/postbg/bg3.png differ diff --git a/static/image/postbg/bg4.png b/static/image/postbg/bg4.png new file mode 100644 index 0000000..fee931c Binary files /dev/null and b/static/image/postbg/bg4.png differ diff --git a/static/image/postbg/bg5.png b/static/image/postbg/bg5.png new file mode 100644 index 0000000..207cf02 Binary files /dev/null and b/static/image/postbg/bg5.png differ diff --git a/static/image/postbg/bg6.png b/static/image/postbg/bg6.png new file mode 100644 index 0000000..48c5f17 Binary files /dev/null and b/static/image/postbg/bg6.png differ diff --git a/static/image/postbg/bg7.png b/static/image/postbg/bg7.png new file mode 100644 index 0000000..04e22aa Binary files /dev/null and b/static/image/postbg/bg7.png differ diff --git a/static/image/postbg/bg8.png b/static/image/postbg/bg8.png new file mode 100644 index 0000000..f8a18ee Binary files /dev/null and b/static/image/postbg/bg8.png differ diff --git a/static/image/postbg/bg9.png b/static/image/postbg/bg9.png new file mode 100644 index 0000000..c9d5749 Binary files /dev/null and b/static/image/postbg/bg9.png differ diff --git a/static/image/postbg/index.htm b/static/image/postbg/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/postbg/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/background/background1.jpg b/static/image/seccode/background/background1.jpg new file mode 100644 index 0000000..78b7bce Binary files /dev/null and b/static/image/seccode/background/background1.jpg differ diff --git a/static/image/seccode/background/background2.jpg b/static/image/seccode/background/background2.jpg new file mode 100644 index 0000000..d01899b Binary files /dev/null and b/static/image/seccode/background/background2.jpg differ diff --git a/static/image/seccode/background/background3.jpg b/static/image/seccode/background/background3.jpg new file mode 100644 index 0000000..a6233aa Binary files /dev/null and b/static/image/seccode/background/background3.jpg differ diff --git a/static/image/seccode/background/background4.jpg b/static/image/seccode/background/background4.jpg new file mode 100644 index 0000000..1c40883 Binary files /dev/null and b/static/image/seccode/background/background4.jpg differ diff --git a/static/image/seccode/background/background5.jpg b/static/image/seccode/background/background5.jpg new file mode 100644 index 0000000..2ef389c Binary files /dev/null and b/static/image/seccode/background/background5.jpg differ diff --git a/static/image/seccode/background/background6.jpg b/static/image/seccode/background/background6.jpg new file mode 100644 index 0000000..1c4fb34 Binary files /dev/null and b/static/image/seccode/background/background6.jpg differ diff --git a/static/image/seccode/background/background7.jpg b/static/image/seccode/background/background7.jpg new file mode 100644 index 0000000..3d3311d Binary files /dev/null and b/static/image/seccode/background/background7.jpg differ diff --git a/static/image/seccode/background/background8.jpg b/static/image/seccode/background/background8.jpg new file mode 100644 index 0000000..b75c977 Binary files /dev/null and b/static/image/seccode/background/background8.jpg differ diff --git a/static/image/seccode/background/index.htm b/static/image/seccode/background/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/seccode/background/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/flash/index.htm b/static/image/seccode/flash/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/seccode/font/ch/index.htm b/static/image/seccode/font/ch/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/seccode/font/ch/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/font/en/FetteSteinschrift.ttf b/static/image/seccode/font/en/FetteSteinschrift.ttf new file mode 100644 index 0000000..6ab1de7 Binary files /dev/null and b/static/image/seccode/font/en/FetteSteinschrift.ttf differ diff --git a/static/image/seccode/font/en/PilsenPlakat.ttf b/static/image/seccode/font/en/PilsenPlakat.ttf new file mode 100644 index 0000000..6a1ac8a Binary files /dev/null and b/static/image/seccode/font/en/PilsenPlakat.ttf differ diff --git a/static/image/seccode/font/en/index.htm b/static/image/seccode/font/en/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/seccode/font/en/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/font/index.htm b/static/image/seccode/font/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/seccode/font/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/gif/OCR_A_Extended/2.gif b/static/image/seccode/gif/OCR_A_Extended/2.gif new file mode 100644 index 0000000..eaf206e Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/2.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/3.gif b/static/image/seccode/gif/OCR_A_Extended/3.gif new file mode 100644 index 0000000..58863b2 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/3.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/4.gif b/static/image/seccode/gif/OCR_A_Extended/4.gif new file mode 100644 index 0000000..ce1445d Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/4.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/6.gif b/static/image/seccode/gif/OCR_A_Extended/6.gif new file mode 100644 index 0000000..34c4039 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/6.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/7.gif b/static/image/seccode/gif/OCR_A_Extended/7.gif new file mode 100644 index 0000000..0afea73 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/7.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/8.gif b/static/image/seccode/gif/OCR_A_Extended/8.gif new file mode 100644 index 0000000..bcd908f Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/8.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/9.gif b/static/image/seccode/gif/OCR_A_Extended/9.gif new file mode 100644 index 0000000..5b20f33 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/9.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/b.gif b/static/image/seccode/gif/OCR_A_Extended/b.gif new file mode 100644 index 0000000..d524a79 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/b.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/c.gif b/static/image/seccode/gif/OCR_A_Extended/c.gif new file mode 100644 index 0000000..ec169df Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/c.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/e.gif b/static/image/seccode/gif/OCR_A_Extended/e.gif new file mode 100644 index 0000000..8e472f1 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/e.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/f.gif b/static/image/seccode/gif/OCR_A_Extended/f.gif new file mode 100644 index 0000000..f4f40d5 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/f.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/g.gif b/static/image/seccode/gif/OCR_A_Extended/g.gif new file mode 100644 index 0000000..b9d85fa Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/g.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/h.gif b/static/image/seccode/gif/OCR_A_Extended/h.gif new file mode 100644 index 0000000..90bebd5 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/h.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/index.htm b/static/image/seccode/gif/OCR_A_Extended/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/seccode/gif/OCR_A_Extended/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/gif/OCR_A_Extended/j.gif b/static/image/seccode/gif/OCR_A_Extended/j.gif new file mode 100644 index 0000000..7d84fdd Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/j.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/k.gif b/static/image/seccode/gif/OCR_A_Extended/k.gif new file mode 100644 index 0000000..8498358 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/k.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/m.gif b/static/image/seccode/gif/OCR_A_Extended/m.gif new file mode 100644 index 0000000..9e8a124 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/m.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/p.gif b/static/image/seccode/gif/OCR_A_Extended/p.gif new file mode 100644 index 0000000..98b0abe Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/p.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/q.gif b/static/image/seccode/gif/OCR_A_Extended/q.gif new file mode 100644 index 0000000..c1aff10 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/q.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/r.gif b/static/image/seccode/gif/OCR_A_Extended/r.gif new file mode 100644 index 0000000..a6864e3 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/r.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/t.gif b/static/image/seccode/gif/OCR_A_Extended/t.gif new file mode 100644 index 0000000..f60af1f Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/t.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/v.gif b/static/image/seccode/gif/OCR_A_Extended/v.gif new file mode 100644 index 0000000..6a37d14 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/v.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/w.gif b/static/image/seccode/gif/OCR_A_Extended/w.gif new file mode 100644 index 0000000..9acfbcf Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/w.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/x.gif b/static/image/seccode/gif/OCR_A_Extended/x.gif new file mode 100644 index 0000000..bb4eb70 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/x.gif differ diff --git a/static/image/seccode/gif/OCR_A_Extended/y.gif b/static/image/seccode/gif/OCR_A_Extended/y.gif new file mode 100644 index 0000000..0228366 Binary files /dev/null and b/static/image/seccode/gif/OCR_A_Extended/y.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/2.gif b/static/image/seccode/gif/Small_Fonts/2.gif new file mode 100644 index 0000000..d7f1461 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/2.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/3.gif b/static/image/seccode/gif/Small_Fonts/3.gif new file mode 100644 index 0000000..8e07204 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/3.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/4.gif b/static/image/seccode/gif/Small_Fonts/4.gif new file mode 100644 index 0000000..520cc48 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/4.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/6.gif b/static/image/seccode/gif/Small_Fonts/6.gif new file mode 100644 index 0000000..da02cae Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/6.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/7.gif b/static/image/seccode/gif/Small_Fonts/7.gif new file mode 100644 index 0000000..1e526e8 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/7.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/8.gif b/static/image/seccode/gif/Small_Fonts/8.gif new file mode 100644 index 0000000..5ea9097 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/8.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/9.gif b/static/image/seccode/gif/Small_Fonts/9.gif new file mode 100644 index 0000000..1c49c46 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/9.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/b.gif b/static/image/seccode/gif/Small_Fonts/b.gif new file mode 100644 index 0000000..e1d36bc Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/b.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/c.gif b/static/image/seccode/gif/Small_Fonts/c.gif new file mode 100644 index 0000000..be7affa Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/c.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/e.gif b/static/image/seccode/gif/Small_Fonts/e.gif new file mode 100644 index 0000000..765a9fd Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/e.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/f.gif b/static/image/seccode/gif/Small_Fonts/f.gif new file mode 100644 index 0000000..c412081 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/f.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/g.gif b/static/image/seccode/gif/Small_Fonts/g.gif new file mode 100644 index 0000000..aea4e47 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/g.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/h.gif b/static/image/seccode/gif/Small_Fonts/h.gif new file mode 100644 index 0000000..1ec3418 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/h.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/index.htm b/static/image/seccode/gif/Small_Fonts/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/seccode/gif/Small_Fonts/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/gif/Small_Fonts/j.gif b/static/image/seccode/gif/Small_Fonts/j.gif new file mode 100644 index 0000000..8e7b95a Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/j.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/k.gif b/static/image/seccode/gif/Small_Fonts/k.gif new file mode 100644 index 0000000..2767d58 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/k.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/m.gif b/static/image/seccode/gif/Small_Fonts/m.gif new file mode 100644 index 0000000..cfa8405 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/m.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/p.gif b/static/image/seccode/gif/Small_Fonts/p.gif new file mode 100644 index 0000000..36e9095 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/p.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/q.gif b/static/image/seccode/gif/Small_Fonts/q.gif new file mode 100644 index 0000000..8a4c573 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/q.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/r.gif b/static/image/seccode/gif/Small_Fonts/r.gif new file mode 100644 index 0000000..adce0b3 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/r.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/t.gif b/static/image/seccode/gif/Small_Fonts/t.gif new file mode 100644 index 0000000..8219b22 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/t.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/v.gif b/static/image/seccode/gif/Small_Fonts/v.gif new file mode 100644 index 0000000..a77d330 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/v.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/w.gif b/static/image/seccode/gif/Small_Fonts/w.gif new file mode 100644 index 0000000..eb1d201 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/w.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/x.gif b/static/image/seccode/gif/Small_Fonts/x.gif new file mode 100644 index 0000000..91606d4 Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/x.gif differ diff --git a/static/image/seccode/gif/Small_Fonts/y.gif b/static/image/seccode/gif/Small_Fonts/y.gif new file mode 100644 index 0000000..85c0efc Binary files /dev/null and b/static/image/seccode/gif/Small_Fonts/y.gif differ diff --git a/static/image/seccode/gif/index.htm b/static/image/seccode/gif/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/seccode/index.htm b/static/image/seccode/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/seccode/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/seccode/sound/c.mp3 b/static/image/seccode/sound/c.mp3 new file mode 100644 index 0000000..d317350 Binary files /dev/null and b/static/image/seccode/sound/c.mp3 differ diff --git a/static/image/seccode/sound/e.mp3 b/static/image/seccode/sound/e.mp3 new file mode 100644 index 0000000..0b293ef Binary files /dev/null and b/static/image/seccode/sound/e.mp3 differ diff --git a/static/image/seccode/sound/f.mp3 b/static/image/seccode/sound/f.mp3 new file mode 100644 index 0000000..ed8c4e4 Binary files /dev/null and b/static/image/seccode/sound/f.mp3 differ diff --git a/static/image/seccode/sound/h.mp3 b/static/image/seccode/sound/h.mp3 new file mode 100644 index 0000000..9457c39 Binary files /dev/null and b/static/image/seccode/sound/h.mp3 differ diff --git a/static/image/seccode/sound/index.htm b/static/image/seccode/sound/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/seccode/sound/k.mp3 b/static/image/seccode/sound/k.mp3 new file mode 100644 index 0000000..0e6bd23 Binary files /dev/null and b/static/image/seccode/sound/k.mp3 differ diff --git a/static/image/seccode/sound/l.mp3 b/static/image/seccode/sound/l.mp3 new file mode 100644 index 0000000..0ab6fa9 Binary files /dev/null and b/static/image/seccode/sound/l.mp3 differ diff --git a/static/image/seccode/sound/m.mp3 b/static/image/seccode/sound/m.mp3 new file mode 100644 index 0000000..e710887 Binary files /dev/null and b/static/image/seccode/sound/m.mp3 differ diff --git a/static/image/seccode/sound/n.mp3 b/static/image/seccode/sound/n.mp3 new file mode 100644 index 0000000..d470e2d Binary files /dev/null and b/static/image/seccode/sound/n.mp3 differ diff --git a/static/image/seccode/sound/o.mp3 b/static/image/seccode/sound/o.mp3 new file mode 100644 index 0000000..65afeeb Binary files /dev/null and b/static/image/seccode/sound/o.mp3 differ diff --git a/static/image/seccode/sound/p.mp3 b/static/image/seccode/sound/p.mp3 new file mode 100644 index 0000000..0a9f617 Binary files /dev/null and b/static/image/seccode/sound/p.mp3 differ diff --git a/static/image/seccode/sound/q.mp3 b/static/image/seccode/sound/q.mp3 new file mode 100644 index 0000000..8bf885b Binary files /dev/null and b/static/image/seccode/sound/q.mp3 differ diff --git a/static/image/seccode/sound/r.mp3 b/static/image/seccode/sound/r.mp3 new file mode 100644 index 0000000..a9b60e8 Binary files /dev/null and b/static/image/seccode/sound/r.mp3 differ diff --git a/static/image/seccode/sound/s.mp3 b/static/image/seccode/sound/s.mp3 new file mode 100644 index 0000000..8c73c69 Binary files /dev/null and b/static/image/seccode/sound/s.mp3 differ diff --git a/static/image/seccode/sound/t.mp3 b/static/image/seccode/sound/t.mp3 new file mode 100644 index 0000000..38abef4 Binary files /dev/null and b/static/image/seccode/sound/t.mp3 differ diff --git a/static/image/seccode/sound/u.mp3 b/static/image/seccode/sound/u.mp3 new file mode 100644 index 0000000..4afc732 Binary files /dev/null and b/static/image/seccode/sound/u.mp3 differ diff --git a/static/image/seccode/sound/v.mp3 b/static/image/seccode/sound/v.mp3 new file mode 100644 index 0000000..0d8ef18 Binary files /dev/null and b/static/image/seccode/sound/v.mp3 differ diff --git a/static/image/seccode/sound/w.mp3 b/static/image/seccode/sound/w.mp3 new file mode 100644 index 0000000..b1e9dac Binary files /dev/null and b/static/image/seccode/sound/w.mp3 differ diff --git a/static/image/seccode/sound/x.mp3 b/static/image/seccode/sound/x.mp3 new file mode 100644 index 0000000..481f733 Binary files /dev/null and b/static/image/seccode/sound/x.mp3 differ diff --git a/static/image/seccode/sound/y.mp3 b/static/image/seccode/sound/y.mp3 new file mode 100644 index 0000000..62e960b Binary files /dev/null and b/static/image/seccode/sound/y.mp3 differ diff --git a/static/image/seccode/sound/z.mp3 b/static/image/seccode/sound/z.mp3 new file mode 100644 index 0000000..8f3af68 Binary files /dev/null and b/static/image/seccode/sound/z.mp3 differ diff --git a/static/image/smiley/comcom/1.gif b/static/image/smiley/comcom/1.gif new file mode 100644 index 0000000..88658e0 Binary files /dev/null and b/static/image/smiley/comcom/1.gif differ diff --git a/static/image/smiley/comcom/10.gif b/static/image/smiley/comcom/10.gif new file mode 100644 index 0000000..aae9080 Binary files /dev/null and b/static/image/smiley/comcom/10.gif differ diff --git a/static/image/smiley/comcom/11.gif b/static/image/smiley/comcom/11.gif new file mode 100644 index 0000000..6020c2b Binary files /dev/null and b/static/image/smiley/comcom/11.gif differ diff --git a/static/image/smiley/comcom/12.gif b/static/image/smiley/comcom/12.gif new file mode 100644 index 0000000..16f0d2c Binary files /dev/null and b/static/image/smiley/comcom/12.gif differ diff --git a/static/image/smiley/comcom/13.gif b/static/image/smiley/comcom/13.gif new file mode 100644 index 0000000..443a3d0 Binary files /dev/null and b/static/image/smiley/comcom/13.gif differ diff --git a/static/image/smiley/comcom/14.gif b/static/image/smiley/comcom/14.gif new file mode 100644 index 0000000..3a601a8 Binary files /dev/null and b/static/image/smiley/comcom/14.gif differ diff --git a/static/image/smiley/comcom/15.gif b/static/image/smiley/comcom/15.gif new file mode 100644 index 0000000..74d1ba7 Binary files /dev/null and b/static/image/smiley/comcom/15.gif differ diff --git a/static/image/smiley/comcom/16.gif b/static/image/smiley/comcom/16.gif new file mode 100644 index 0000000..cc8622e Binary files /dev/null and b/static/image/smiley/comcom/16.gif differ diff --git a/static/image/smiley/comcom/17.gif b/static/image/smiley/comcom/17.gif new file mode 100644 index 0000000..e252e11 Binary files /dev/null and b/static/image/smiley/comcom/17.gif differ diff --git a/static/image/smiley/comcom/18.gif b/static/image/smiley/comcom/18.gif new file mode 100644 index 0000000..ede246a Binary files /dev/null and b/static/image/smiley/comcom/18.gif differ diff --git a/static/image/smiley/comcom/19.gif b/static/image/smiley/comcom/19.gif new file mode 100644 index 0000000..eec481d Binary files /dev/null and b/static/image/smiley/comcom/19.gif differ diff --git a/static/image/smiley/comcom/2.gif b/static/image/smiley/comcom/2.gif new file mode 100644 index 0000000..973b53a Binary files /dev/null and b/static/image/smiley/comcom/2.gif differ diff --git a/static/image/smiley/comcom/20.gif b/static/image/smiley/comcom/20.gif new file mode 100644 index 0000000..17036af Binary files /dev/null and b/static/image/smiley/comcom/20.gif differ diff --git a/static/image/smiley/comcom/21.gif b/static/image/smiley/comcom/21.gif new file mode 100644 index 0000000..a6b91f8 Binary files /dev/null and b/static/image/smiley/comcom/21.gif differ diff --git a/static/image/smiley/comcom/22.gif b/static/image/smiley/comcom/22.gif new file mode 100644 index 0000000..5809fab Binary files /dev/null and b/static/image/smiley/comcom/22.gif differ diff --git a/static/image/smiley/comcom/23.gif b/static/image/smiley/comcom/23.gif new file mode 100644 index 0000000..d537e88 Binary files /dev/null and b/static/image/smiley/comcom/23.gif differ diff --git a/static/image/smiley/comcom/24.gif b/static/image/smiley/comcom/24.gif new file mode 100644 index 0000000..92d021f Binary files /dev/null and b/static/image/smiley/comcom/24.gif differ diff --git a/static/image/smiley/comcom/25.gif b/static/image/smiley/comcom/25.gif new file mode 100644 index 0000000..00aa9ce Binary files /dev/null and b/static/image/smiley/comcom/25.gif differ diff --git a/static/image/smiley/comcom/26.gif b/static/image/smiley/comcom/26.gif new file mode 100644 index 0000000..0bba334 Binary files /dev/null and b/static/image/smiley/comcom/26.gif differ diff --git a/static/image/smiley/comcom/27.gif b/static/image/smiley/comcom/27.gif new file mode 100644 index 0000000..9d007ca Binary files /dev/null and b/static/image/smiley/comcom/27.gif differ diff --git a/static/image/smiley/comcom/28.gif b/static/image/smiley/comcom/28.gif new file mode 100644 index 0000000..34c7bff Binary files /dev/null and b/static/image/smiley/comcom/28.gif differ diff --git a/static/image/smiley/comcom/29.gif b/static/image/smiley/comcom/29.gif new file mode 100644 index 0000000..2382936 Binary files /dev/null and b/static/image/smiley/comcom/29.gif differ diff --git a/static/image/smiley/comcom/3.gif b/static/image/smiley/comcom/3.gif new file mode 100644 index 0000000..fb9252d Binary files /dev/null and b/static/image/smiley/comcom/3.gif differ diff --git a/static/image/smiley/comcom/30.gif b/static/image/smiley/comcom/30.gif new file mode 100644 index 0000000..bb4e888 Binary files /dev/null and b/static/image/smiley/comcom/30.gif differ diff --git a/static/image/smiley/comcom/4.gif b/static/image/smiley/comcom/4.gif new file mode 100644 index 0000000..e65c7d9 Binary files /dev/null and b/static/image/smiley/comcom/4.gif differ diff --git a/static/image/smiley/comcom/5.gif b/static/image/smiley/comcom/5.gif new file mode 100644 index 0000000..5664988 Binary files /dev/null and b/static/image/smiley/comcom/5.gif differ diff --git a/static/image/smiley/comcom/6.gif b/static/image/smiley/comcom/6.gif new file mode 100644 index 0000000..482446e Binary files /dev/null and b/static/image/smiley/comcom/6.gif differ diff --git a/static/image/smiley/comcom/7.gif b/static/image/smiley/comcom/7.gif new file mode 100644 index 0000000..36537cc Binary files /dev/null and b/static/image/smiley/comcom/7.gif differ diff --git a/static/image/smiley/comcom/8.gif b/static/image/smiley/comcom/8.gif new file mode 100644 index 0000000..e17e712 Binary files /dev/null and b/static/image/smiley/comcom/8.gif differ diff --git a/static/image/smiley/comcom/9.gif b/static/image/smiley/comcom/9.gif new file mode 100644 index 0000000..b5ff64a Binary files /dev/null and b/static/image/smiley/comcom/9.gif differ diff --git a/static/image/smiley/comcom/index.htm b/static/image/smiley/comcom/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/smiley/coolmonkey/01.gif b/static/image/smiley/coolmonkey/01.gif new file mode 100644 index 0000000..be7b4f4 Binary files /dev/null and b/static/image/smiley/coolmonkey/01.gif differ diff --git a/static/image/smiley/coolmonkey/02.gif b/static/image/smiley/coolmonkey/02.gif new file mode 100644 index 0000000..a95ea31 Binary files /dev/null and b/static/image/smiley/coolmonkey/02.gif differ diff --git a/static/image/smiley/coolmonkey/03.gif b/static/image/smiley/coolmonkey/03.gif new file mode 100644 index 0000000..997f526 Binary files /dev/null and b/static/image/smiley/coolmonkey/03.gif differ diff --git a/static/image/smiley/coolmonkey/04.gif b/static/image/smiley/coolmonkey/04.gif new file mode 100644 index 0000000..f9232cb Binary files /dev/null and b/static/image/smiley/coolmonkey/04.gif differ diff --git a/static/image/smiley/coolmonkey/05.gif b/static/image/smiley/coolmonkey/05.gif new file mode 100644 index 0000000..0db5aab Binary files /dev/null and b/static/image/smiley/coolmonkey/05.gif differ diff --git a/static/image/smiley/coolmonkey/06.gif b/static/image/smiley/coolmonkey/06.gif new file mode 100644 index 0000000..8376c1b Binary files /dev/null and b/static/image/smiley/coolmonkey/06.gif differ diff --git a/static/image/smiley/coolmonkey/07.gif b/static/image/smiley/coolmonkey/07.gif new file mode 100644 index 0000000..5201390 Binary files /dev/null and b/static/image/smiley/coolmonkey/07.gif differ diff --git a/static/image/smiley/coolmonkey/08.gif b/static/image/smiley/coolmonkey/08.gif new file mode 100644 index 0000000..4bdff4e Binary files /dev/null and b/static/image/smiley/coolmonkey/08.gif differ diff --git a/static/image/smiley/coolmonkey/09.gif b/static/image/smiley/coolmonkey/09.gif new file mode 100644 index 0000000..d09a65d Binary files /dev/null and b/static/image/smiley/coolmonkey/09.gif differ diff --git a/static/image/smiley/coolmonkey/10.gif b/static/image/smiley/coolmonkey/10.gif new file mode 100644 index 0000000..dcb8b0a Binary files /dev/null and b/static/image/smiley/coolmonkey/10.gif differ diff --git a/static/image/smiley/coolmonkey/11.gif b/static/image/smiley/coolmonkey/11.gif new file mode 100644 index 0000000..eb77068 Binary files /dev/null and b/static/image/smiley/coolmonkey/11.gif differ diff --git a/static/image/smiley/coolmonkey/12.gif b/static/image/smiley/coolmonkey/12.gif new file mode 100644 index 0000000..4e64933 Binary files /dev/null and b/static/image/smiley/coolmonkey/12.gif differ diff --git a/static/image/smiley/coolmonkey/13.gif b/static/image/smiley/coolmonkey/13.gif new file mode 100644 index 0000000..9246f99 Binary files /dev/null and b/static/image/smiley/coolmonkey/13.gif differ diff --git a/static/image/smiley/coolmonkey/14.gif b/static/image/smiley/coolmonkey/14.gif new file mode 100644 index 0000000..25f7e9a Binary files /dev/null and b/static/image/smiley/coolmonkey/14.gif differ diff --git a/static/image/smiley/coolmonkey/15.gif b/static/image/smiley/coolmonkey/15.gif new file mode 100644 index 0000000..10c2daa Binary files /dev/null and b/static/image/smiley/coolmonkey/15.gif differ diff --git a/static/image/smiley/coolmonkey/16.gif b/static/image/smiley/coolmonkey/16.gif new file mode 100644 index 0000000..e45f1c9 Binary files /dev/null and b/static/image/smiley/coolmonkey/16.gif differ diff --git a/static/image/smiley/coolmonkey/index.htm b/static/image/smiley/coolmonkey/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/smiley/default/biggrin.gif b/static/image/smiley/default/biggrin.gif new file mode 100644 index 0000000..69bde01 Binary files /dev/null and b/static/image/smiley/default/biggrin.gif differ diff --git a/static/image/smiley/default/call.gif b/static/image/smiley/default/call.gif new file mode 100644 index 0000000..8a51247 Binary files /dev/null and b/static/image/smiley/default/call.gif differ diff --git a/static/image/smiley/default/cry.gif b/static/image/smiley/default/cry.gif new file mode 100644 index 0000000..f7910f0 Binary files /dev/null and b/static/image/smiley/default/cry.gif differ diff --git a/static/image/smiley/default/curse.gif b/static/image/smiley/default/curse.gif new file mode 100644 index 0000000..7ef026c Binary files /dev/null and b/static/image/smiley/default/curse.gif differ diff --git a/static/image/smiley/default/dizzy.gif b/static/image/smiley/default/dizzy.gif new file mode 100644 index 0000000..cd3d930 Binary files /dev/null and b/static/image/smiley/default/dizzy.gif differ diff --git a/static/image/smiley/default/funk.gif b/static/image/smiley/default/funk.gif new file mode 100644 index 0000000..2008dde Binary files /dev/null and b/static/image/smiley/default/funk.gif differ diff --git a/static/image/smiley/default/handshake.gif b/static/image/smiley/default/handshake.gif new file mode 100644 index 0000000..7d298c3 Binary files /dev/null and b/static/image/smiley/default/handshake.gif differ diff --git a/static/image/smiley/default/huffy.gif b/static/image/smiley/default/huffy.gif new file mode 100644 index 0000000..f8225e4 Binary files /dev/null and b/static/image/smiley/default/huffy.gif differ diff --git a/static/image/smiley/default/hug.gif b/static/image/smiley/default/hug.gif new file mode 100644 index 0000000..6c4f132 Binary files /dev/null and b/static/image/smiley/default/hug.gif differ diff --git a/static/image/smiley/default/index.htm b/static/image/smiley/default/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/smiley/default/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/smiley/default/kiss.gif b/static/image/smiley/default/kiss.gif new file mode 100644 index 0000000..3a2bff5 Binary files /dev/null and b/static/image/smiley/default/kiss.gif differ diff --git a/static/image/smiley/default/lol.gif b/static/image/smiley/default/lol.gif new file mode 100644 index 0000000..a097835 Binary files /dev/null and b/static/image/smiley/default/lol.gif differ diff --git a/static/image/smiley/default/loveliness.gif b/static/image/smiley/default/loveliness.gif new file mode 100644 index 0000000..3eda2ae Binary files /dev/null and b/static/image/smiley/default/loveliness.gif differ diff --git a/static/image/smiley/default/mad.gif b/static/image/smiley/default/mad.gif new file mode 100644 index 0000000..286d486 Binary files /dev/null and b/static/image/smiley/default/mad.gif differ diff --git a/static/image/smiley/default/sad.gif b/static/image/smiley/default/sad.gif new file mode 100644 index 0000000..f27ffb9 Binary files /dev/null and b/static/image/smiley/default/sad.gif differ diff --git a/static/image/smiley/default/shocked.gif b/static/image/smiley/default/shocked.gif new file mode 100644 index 0000000..6b1fac6 Binary files /dev/null and b/static/image/smiley/default/shocked.gif differ diff --git a/static/image/smiley/default/shutup.gif b/static/image/smiley/default/shutup.gif new file mode 100644 index 0000000..e0e33fa Binary files /dev/null and b/static/image/smiley/default/shutup.gif differ diff --git a/static/image/smiley/default/shy.gif b/static/image/smiley/default/shy.gif new file mode 100644 index 0000000..3820e17 Binary files /dev/null and b/static/image/smiley/default/shy.gif differ diff --git a/static/image/smiley/default/sleepy.gif b/static/image/smiley/default/sleepy.gif new file mode 100644 index 0000000..6f15b45 Binary files /dev/null and b/static/image/smiley/default/sleepy.gif differ diff --git a/static/image/smiley/default/smile.gif b/static/image/smiley/default/smile.gif new file mode 100644 index 0000000..3927562 Binary files /dev/null and b/static/image/smiley/default/smile.gif differ diff --git a/static/image/smiley/default/sweat.gif b/static/image/smiley/default/sweat.gif new file mode 100644 index 0000000..55cdb75 Binary files /dev/null and b/static/image/smiley/default/sweat.gif differ diff --git a/static/image/smiley/default/time.gif b/static/image/smiley/default/time.gif new file mode 100644 index 0000000..13889d9 Binary files /dev/null and b/static/image/smiley/default/time.gif differ diff --git a/static/image/smiley/default/titter.gif b/static/image/smiley/default/titter.gif new file mode 100644 index 0000000..627c699 Binary files /dev/null and b/static/image/smiley/default/titter.gif differ diff --git a/static/image/smiley/default/tongue.gif b/static/image/smiley/default/tongue.gif new file mode 100644 index 0000000..674bbd7 Binary files /dev/null and b/static/image/smiley/default/tongue.gif differ diff --git a/static/image/smiley/default/victory.gif b/static/image/smiley/default/victory.gif new file mode 100644 index 0000000..5ff075f Binary files /dev/null and b/static/image/smiley/default/victory.gif differ diff --git a/static/image/smiley/grapeman/01.gif b/static/image/smiley/grapeman/01.gif new file mode 100644 index 0000000..9336b87 Binary files /dev/null and b/static/image/smiley/grapeman/01.gif differ diff --git a/static/image/smiley/grapeman/02.gif b/static/image/smiley/grapeman/02.gif new file mode 100644 index 0000000..4d4b9d6 Binary files /dev/null and b/static/image/smiley/grapeman/02.gif differ diff --git a/static/image/smiley/grapeman/03.gif b/static/image/smiley/grapeman/03.gif new file mode 100644 index 0000000..b786d1f Binary files /dev/null and b/static/image/smiley/grapeman/03.gif differ diff --git a/static/image/smiley/grapeman/04.gif b/static/image/smiley/grapeman/04.gif new file mode 100644 index 0000000..d0b68fb Binary files /dev/null and b/static/image/smiley/grapeman/04.gif differ diff --git a/static/image/smiley/grapeman/05.gif b/static/image/smiley/grapeman/05.gif new file mode 100644 index 0000000..b5c184a Binary files /dev/null and b/static/image/smiley/grapeman/05.gif differ diff --git a/static/image/smiley/grapeman/06.gif b/static/image/smiley/grapeman/06.gif new file mode 100644 index 0000000..b9615b0 Binary files /dev/null and b/static/image/smiley/grapeman/06.gif differ diff --git a/static/image/smiley/grapeman/07.gif b/static/image/smiley/grapeman/07.gif new file mode 100644 index 0000000..7f8c674 Binary files /dev/null and b/static/image/smiley/grapeman/07.gif differ diff --git a/static/image/smiley/grapeman/08.gif b/static/image/smiley/grapeman/08.gif new file mode 100644 index 0000000..7182dbd Binary files /dev/null and b/static/image/smiley/grapeman/08.gif differ diff --git a/static/image/smiley/grapeman/09.gif b/static/image/smiley/grapeman/09.gif new file mode 100644 index 0000000..82911d2 Binary files /dev/null and b/static/image/smiley/grapeman/09.gif differ diff --git a/static/image/smiley/grapeman/10.gif b/static/image/smiley/grapeman/10.gif new file mode 100644 index 0000000..622ad0c Binary files /dev/null and b/static/image/smiley/grapeman/10.gif differ diff --git a/static/image/smiley/grapeman/11.gif b/static/image/smiley/grapeman/11.gif new file mode 100644 index 0000000..5da7e3b Binary files /dev/null and b/static/image/smiley/grapeman/11.gif differ diff --git a/static/image/smiley/grapeman/12.gif b/static/image/smiley/grapeman/12.gif new file mode 100644 index 0000000..b70be8c Binary files /dev/null and b/static/image/smiley/grapeman/12.gif differ diff --git a/static/image/smiley/grapeman/13.gif b/static/image/smiley/grapeman/13.gif new file mode 100644 index 0000000..2c07aea Binary files /dev/null and b/static/image/smiley/grapeman/13.gif differ diff --git a/static/image/smiley/grapeman/14.gif b/static/image/smiley/grapeman/14.gif new file mode 100644 index 0000000..d79f030 Binary files /dev/null and b/static/image/smiley/grapeman/14.gif differ diff --git a/static/image/smiley/grapeman/15.gif b/static/image/smiley/grapeman/15.gif new file mode 100644 index 0000000..999807e Binary files /dev/null and b/static/image/smiley/grapeman/15.gif differ diff --git a/static/image/smiley/grapeman/16.gif b/static/image/smiley/grapeman/16.gif new file mode 100644 index 0000000..a8a6f97 Binary files /dev/null and b/static/image/smiley/grapeman/16.gif differ diff --git a/static/image/smiley/grapeman/17.gif b/static/image/smiley/grapeman/17.gif new file mode 100644 index 0000000..413cad0 Binary files /dev/null and b/static/image/smiley/grapeman/17.gif differ diff --git a/static/image/smiley/grapeman/18.gif b/static/image/smiley/grapeman/18.gif new file mode 100644 index 0000000..bc23e44 Binary files /dev/null and b/static/image/smiley/grapeman/18.gif differ diff --git a/static/image/smiley/grapeman/19.gif b/static/image/smiley/grapeman/19.gif new file mode 100644 index 0000000..9f1990f Binary files /dev/null and b/static/image/smiley/grapeman/19.gif differ diff --git a/static/image/smiley/grapeman/20.gif b/static/image/smiley/grapeman/20.gif new file mode 100644 index 0000000..80d4ade Binary files /dev/null and b/static/image/smiley/grapeman/20.gif differ diff --git a/static/image/smiley/grapeman/21.gif b/static/image/smiley/grapeman/21.gif new file mode 100644 index 0000000..d18050f Binary files /dev/null and b/static/image/smiley/grapeman/21.gif differ diff --git a/static/image/smiley/grapeman/22.gif b/static/image/smiley/grapeman/22.gif new file mode 100644 index 0000000..6eacec0 Binary files /dev/null and b/static/image/smiley/grapeman/22.gif differ diff --git a/static/image/smiley/grapeman/23.gif b/static/image/smiley/grapeman/23.gif new file mode 100644 index 0000000..91b781f Binary files /dev/null and b/static/image/smiley/grapeman/23.gif differ diff --git a/static/image/smiley/grapeman/24.gif b/static/image/smiley/grapeman/24.gif new file mode 100644 index 0000000..ce564db Binary files /dev/null and b/static/image/smiley/grapeman/24.gif differ diff --git a/static/image/smiley/grapeman/index.htm b/static/image/smiley/grapeman/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/smiley/index.htm b/static/image/smiley/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/smiley/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/sound/index.htm b/static/image/sound/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/sound/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/sound/pm_1.mp3 b/static/image/sound/pm_1.mp3 new file mode 100644 index 0000000..811d0fe Binary files /dev/null and b/static/image/sound/pm_1.mp3 differ diff --git a/static/image/sound/pm_2.mp3 b/static/image/sound/pm_2.mp3 new file mode 100644 index 0000000..316815e Binary files /dev/null and b/static/image/sound/pm_2.mp3 differ diff --git a/static/image/sound/pm_3.mp3 b/static/image/sound/pm_3.mp3 new file mode 100644 index 0000000..e18414a Binary files /dev/null and b/static/image/sound/pm_3.mp3 differ diff --git a/static/image/stamp/001.gif b/static/image/stamp/001.gif new file mode 100644 index 0000000..4125173 Binary files /dev/null and b/static/image/stamp/001.gif differ diff --git a/static/image/stamp/001.small.gif b/static/image/stamp/001.small.gif new file mode 100644 index 0000000..803e526 Binary files /dev/null and b/static/image/stamp/001.small.gif differ diff --git a/static/image/stamp/002.gif b/static/image/stamp/002.gif new file mode 100644 index 0000000..a1b3fa4 Binary files /dev/null and b/static/image/stamp/002.gif differ diff --git a/static/image/stamp/002.small.gif b/static/image/stamp/002.small.gif new file mode 100644 index 0000000..aab641e Binary files /dev/null and b/static/image/stamp/002.small.gif differ diff --git a/static/image/stamp/003.gif b/static/image/stamp/003.gif new file mode 100644 index 0000000..d39f3d0 Binary files /dev/null and b/static/image/stamp/003.gif differ diff --git a/static/image/stamp/003.small.gif b/static/image/stamp/003.small.gif new file mode 100644 index 0000000..d974b75 Binary files /dev/null and b/static/image/stamp/003.small.gif differ diff --git a/static/image/stamp/004.gif b/static/image/stamp/004.gif new file mode 100644 index 0000000..3ba2238 Binary files /dev/null and b/static/image/stamp/004.gif differ diff --git a/static/image/stamp/004.small.gif b/static/image/stamp/004.small.gif new file mode 100644 index 0000000..d820f7d Binary files /dev/null and b/static/image/stamp/004.small.gif differ diff --git a/static/image/stamp/005.gif b/static/image/stamp/005.gif new file mode 100644 index 0000000..908ad9f Binary files /dev/null and b/static/image/stamp/005.gif differ diff --git a/static/image/stamp/005.small.gif b/static/image/stamp/005.small.gif new file mode 100644 index 0000000..939c1e2 Binary files /dev/null and b/static/image/stamp/005.small.gif differ diff --git a/static/image/stamp/006.gif b/static/image/stamp/006.gif new file mode 100644 index 0000000..0e8055d Binary files /dev/null and b/static/image/stamp/006.gif differ diff --git a/static/image/stamp/006.small.gif b/static/image/stamp/006.small.gif new file mode 100644 index 0000000..e651330 Binary files /dev/null and b/static/image/stamp/006.small.gif differ diff --git a/static/image/stamp/007.gif b/static/image/stamp/007.gif new file mode 100644 index 0000000..3dca5a9 Binary files /dev/null and b/static/image/stamp/007.gif differ diff --git a/static/image/stamp/007.small.gif b/static/image/stamp/007.small.gif new file mode 100644 index 0000000..d0eb03d Binary files /dev/null and b/static/image/stamp/007.small.gif differ diff --git a/static/image/stamp/008.gif b/static/image/stamp/008.gif new file mode 100644 index 0000000..c520dc7 Binary files /dev/null and b/static/image/stamp/008.gif differ diff --git a/static/image/stamp/008.small.gif b/static/image/stamp/008.small.gif new file mode 100644 index 0000000..31718e9 Binary files /dev/null and b/static/image/stamp/008.small.gif differ diff --git a/static/image/stamp/009.gif b/static/image/stamp/009.gif new file mode 100644 index 0000000..ab5f6b8 Binary files /dev/null and b/static/image/stamp/009.gif differ diff --git a/static/image/stamp/009.small.gif b/static/image/stamp/009.small.gif new file mode 100644 index 0000000..932ea18 Binary files /dev/null and b/static/image/stamp/009.small.gif differ diff --git a/static/image/stamp/010.gif b/static/image/stamp/010.gif new file mode 100644 index 0000000..3470696 Binary files /dev/null and b/static/image/stamp/010.gif differ diff --git a/static/image/stamp/010.small.gif b/static/image/stamp/010.small.gif new file mode 100644 index 0000000..f00d8d6 Binary files /dev/null and b/static/image/stamp/010.small.gif differ diff --git a/static/image/stamp/011.small.gif b/static/image/stamp/011.small.gif new file mode 100644 index 0000000..b43cf51 Binary files /dev/null and b/static/image/stamp/011.small.gif differ diff --git a/static/image/stamp/index.htm b/static/image/stamp/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/stamp/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/stat/aix.gif b/static/image/stat/aix.gif new file mode 100644 index 0000000..b7b3cd8 Binary files /dev/null and b/static/image/stat/aix.gif differ diff --git a/static/image/stat/comments.gif b/static/image/stat/comments.gif new file mode 100644 index 0000000..0fe1a77 Binary files /dev/null and b/static/image/stat/comments.gif differ diff --git a/static/image/stat/firefox.gif b/static/image/stat/firefox.gif new file mode 100644 index 0000000..dce358a Binary files /dev/null and b/static/image/stat/firefox.gif differ diff --git a/static/image/stat/freebsd.gif b/static/image/stat/freebsd.gif new file mode 100644 index 0000000..3b7f512 Binary files /dev/null and b/static/image/stat/freebsd.gif differ diff --git a/static/image/stat/index.htm b/static/image/stat/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/image/stat/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/stat/konqueror.gif b/static/image/stat/konqueror.gif new file mode 100644 index 0000000..364253d Binary files /dev/null and b/static/image/stat/konqueror.gif differ diff --git a/static/image/stat/linux.gif b/static/image/stat/linux.gif new file mode 100644 index 0000000..f375055 Binary files /dev/null and b/static/image/stat/linux.gif differ diff --git a/static/image/stat/lynx.gif b/static/image/stat/lynx.gif new file mode 100644 index 0000000..847bf82 Binary files /dev/null and b/static/image/stat/lynx.gif differ diff --git a/static/image/stat/mac.gif b/static/image/stat/mac.gif new file mode 100644 index 0000000..695a3a9 Binary files /dev/null and b/static/image/stat/mac.gif differ diff --git a/static/image/stat/mozilla.gif b/static/image/stat/mozilla.gif new file mode 100644 index 0000000..e55293e Binary files /dev/null and b/static/image/stat/mozilla.gif differ diff --git a/static/image/stat/msie.gif b/static/image/stat/msie.gif new file mode 100644 index 0000000..12036f1 Binary files /dev/null and b/static/image/stat/msie.gif differ diff --git a/static/image/stat/netscape.gif b/static/image/stat/netscape.gif new file mode 100644 index 0000000..e057baa Binary files /dev/null and b/static/image/stat/netscape.gif differ diff --git a/static/image/stat/opera.gif b/static/image/stat/opera.gif new file mode 100644 index 0000000..299ea8d Binary files /dev/null and b/static/image/stat/opera.gif differ diff --git a/static/image/stat/os2.gif b/static/image/stat/os2.gif new file mode 100644 index 0000000..b363188 Binary files /dev/null and b/static/image/stat/os2.gif differ diff --git a/static/image/stat/other.gif b/static/image/stat/other.gif new file mode 100644 index 0000000..6a4b636 Binary files /dev/null and b/static/image/stat/other.gif differ diff --git a/static/image/stat/safari.gif b/static/image/stat/safari.gif new file mode 100644 index 0000000..909b120 Binary files /dev/null and b/static/image/stat/safari.gif differ diff --git a/static/image/stat/space.gif b/static/image/stat/space.gif new file mode 100644 index 0000000..13acffe Binary files /dev/null and b/static/image/stat/space.gif differ diff --git a/static/image/stat/spiders.gif b/static/image/stat/spiders.gif new file mode 100644 index 0000000..65b10dc Binary files /dev/null and b/static/image/stat/spiders.gif differ diff --git a/static/image/stat/sunos.gif b/static/image/stat/sunos.gif new file mode 100644 index 0000000..7cdb9ab Binary files /dev/null and b/static/image/stat/sunos.gif differ diff --git a/static/image/stat/windows.gif b/static/image/stat/windows.gif new file mode 100644 index 0000000..dd64c16 Binary files /dev/null and b/static/image/stat/windows.gif differ diff --git a/static/image/task/apply.gif b/static/image/task/apply.gif new file mode 100644 index 0000000..26c28c7 Binary files /dev/null and b/static/image/task/apply.gif differ diff --git a/static/image/task/avatar.gif b/static/image/task/avatar.gif new file mode 100644 index 0000000..d3e5664 Binary files /dev/null and b/static/image/task/avatar.gif differ diff --git a/static/image/task/blog.gif b/static/image/task/blog.gif new file mode 100644 index 0000000..46f3d5f Binary files /dev/null and b/static/image/task/blog.gif differ diff --git a/static/image/task/cancel.gif b/static/image/task/cancel.gif new file mode 100644 index 0000000..c35c299 Binary files /dev/null and b/static/image/task/cancel.gif differ diff --git a/static/image/task/coming.gif b/static/image/task/coming.gif new file mode 100644 index 0000000..7b64072 Binary files /dev/null and b/static/image/task/coming.gif differ diff --git a/static/image/task/disallow.gif b/static/image/task/disallow.gif new file mode 100644 index 0000000..1b2bcdf Binary files /dev/null and b/static/image/task/disallow.gif differ diff --git a/static/image/task/email.gif b/static/image/task/email.gif new file mode 100644 index 0000000..138676a Binary files /dev/null and b/static/image/task/email.gif differ diff --git a/static/image/task/friend.gif b/static/image/task/friend.gif new file mode 100644 index 0000000..e927404 Binary files /dev/null and b/static/image/task/friend.gif differ diff --git a/static/image/task/gift.gif b/static/image/task/gift.gif new file mode 100644 index 0000000..fdd7848 Binary files /dev/null and b/static/image/task/gift.gif differ diff --git a/static/image/task/gold.gif b/static/image/task/gold.gif new file mode 100644 index 0000000..c6a6cf1 Binary files /dev/null and b/static/image/task/gold.gif differ diff --git a/static/image/task/index.htm b/static/image/task/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/task/profile.gif b/static/image/task/profile.gif new file mode 100644 index 0000000..1fa2ddc Binary files /dev/null and b/static/image/task/profile.gif differ diff --git a/static/image/task/reward.gif b/static/image/task/reward.gif new file mode 100644 index 0000000..a751e0a Binary files /dev/null and b/static/image/task/reward.gif differ diff --git a/static/image/task/rewardless.gif b/static/image/task/rewardless.gif new file mode 100644 index 0000000..fe6d0e6 Binary files /dev/null and b/static/image/task/rewardless.gif differ diff --git a/static/image/task/start.gif b/static/image/task/start.gif new file mode 100644 index 0000000..328ee67 Binary files /dev/null and b/static/image/task/start.gif differ diff --git a/static/image/task/task.gif b/static/image/task/task.gif new file mode 100644 index 0000000..2099a27 Binary files /dev/null and b/static/image/task/task.gif differ diff --git a/static/image/traderank/bad.gif b/static/image/traderank/bad.gif new file mode 100644 index 0000000..1037e22 Binary files /dev/null and b/static/image/traderank/bad.gif differ diff --git a/static/image/traderank/buyer/0.gif b/static/image/traderank/buyer/0.gif new file mode 100644 index 0000000..10b088d Binary files /dev/null and b/static/image/traderank/buyer/0.gif differ diff --git a/static/image/traderank/buyer/1.gif b/static/image/traderank/buyer/1.gif new file mode 100644 index 0000000..bb8a7c8 Binary files /dev/null and b/static/image/traderank/buyer/1.gif differ diff --git a/static/image/traderank/buyer/10.gif b/static/image/traderank/buyer/10.gif new file mode 100644 index 0000000..b544941 Binary files /dev/null and b/static/image/traderank/buyer/10.gif differ diff --git a/static/image/traderank/buyer/11.gif b/static/image/traderank/buyer/11.gif new file mode 100644 index 0000000..7d763f9 Binary files /dev/null and b/static/image/traderank/buyer/11.gif differ diff --git a/static/image/traderank/buyer/12.gif b/static/image/traderank/buyer/12.gif new file mode 100644 index 0000000..c2f6fdb Binary files /dev/null and b/static/image/traderank/buyer/12.gif differ diff --git a/static/image/traderank/buyer/13.gif b/static/image/traderank/buyer/13.gif new file mode 100644 index 0000000..c7ad4f1 Binary files /dev/null and b/static/image/traderank/buyer/13.gif differ diff --git a/static/image/traderank/buyer/14.gif b/static/image/traderank/buyer/14.gif new file mode 100644 index 0000000..9e610a9 Binary files /dev/null and b/static/image/traderank/buyer/14.gif differ diff --git a/static/image/traderank/buyer/15.gif b/static/image/traderank/buyer/15.gif new file mode 100644 index 0000000..f1bba78 Binary files /dev/null and b/static/image/traderank/buyer/15.gif differ diff --git a/static/image/traderank/buyer/2.gif b/static/image/traderank/buyer/2.gif new file mode 100644 index 0000000..390c01b Binary files /dev/null and b/static/image/traderank/buyer/2.gif differ diff --git a/static/image/traderank/buyer/3.gif b/static/image/traderank/buyer/3.gif new file mode 100644 index 0000000..4642306 Binary files /dev/null and b/static/image/traderank/buyer/3.gif differ diff --git a/static/image/traderank/buyer/4.gif b/static/image/traderank/buyer/4.gif new file mode 100644 index 0000000..2f893b0 Binary files /dev/null and b/static/image/traderank/buyer/4.gif differ diff --git a/static/image/traderank/buyer/5.gif b/static/image/traderank/buyer/5.gif new file mode 100644 index 0000000..f86a4ff Binary files /dev/null and b/static/image/traderank/buyer/5.gif differ diff --git a/static/image/traderank/buyer/6.gif b/static/image/traderank/buyer/6.gif new file mode 100644 index 0000000..24e552c Binary files /dev/null and b/static/image/traderank/buyer/6.gif differ diff --git a/static/image/traderank/buyer/7.gif b/static/image/traderank/buyer/7.gif new file mode 100644 index 0000000..d81ef6f Binary files /dev/null and b/static/image/traderank/buyer/7.gif differ diff --git a/static/image/traderank/buyer/8.gif b/static/image/traderank/buyer/8.gif new file mode 100644 index 0000000..e73333b Binary files /dev/null and b/static/image/traderank/buyer/8.gif differ diff --git a/static/image/traderank/buyer/9.gif b/static/image/traderank/buyer/9.gif new file mode 100644 index 0000000..ff3a7e8 Binary files /dev/null and b/static/image/traderank/buyer/9.gif differ diff --git a/static/image/traderank/buyer/index.htm b/static/image/traderank/buyer/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/traderank/good.gif b/static/image/traderank/good.gif new file mode 100644 index 0000000..7af6f8b Binary files /dev/null and b/static/image/traderank/good.gif differ diff --git a/static/image/traderank/index.htm b/static/image/traderank/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/traderank/seller/0.gif b/static/image/traderank/seller/0.gif new file mode 100644 index 0000000..417181e Binary files /dev/null and b/static/image/traderank/seller/0.gif differ diff --git a/static/image/traderank/seller/1.gif b/static/image/traderank/seller/1.gif new file mode 100644 index 0000000..8cf1c7f Binary files /dev/null and b/static/image/traderank/seller/1.gif differ diff --git a/static/image/traderank/seller/10.gif b/static/image/traderank/seller/10.gif new file mode 100644 index 0000000..67e0c19 Binary files /dev/null and b/static/image/traderank/seller/10.gif differ diff --git a/static/image/traderank/seller/11.gif b/static/image/traderank/seller/11.gif new file mode 100644 index 0000000..55371a3 Binary files /dev/null and b/static/image/traderank/seller/11.gif differ diff --git a/static/image/traderank/seller/12.gif b/static/image/traderank/seller/12.gif new file mode 100644 index 0000000..25eccbe Binary files /dev/null and b/static/image/traderank/seller/12.gif differ diff --git a/static/image/traderank/seller/13.gif b/static/image/traderank/seller/13.gif new file mode 100644 index 0000000..1550143 Binary files /dev/null and b/static/image/traderank/seller/13.gif differ diff --git a/static/image/traderank/seller/14.gif b/static/image/traderank/seller/14.gif new file mode 100644 index 0000000..7d07036 Binary files /dev/null and b/static/image/traderank/seller/14.gif differ diff --git a/static/image/traderank/seller/15.gif b/static/image/traderank/seller/15.gif new file mode 100644 index 0000000..4027447 Binary files /dev/null and b/static/image/traderank/seller/15.gif differ diff --git a/static/image/traderank/seller/2.gif b/static/image/traderank/seller/2.gif new file mode 100644 index 0000000..638249f Binary files /dev/null and b/static/image/traderank/seller/2.gif differ diff --git a/static/image/traderank/seller/3.gif b/static/image/traderank/seller/3.gif new file mode 100644 index 0000000..a180954 Binary files /dev/null and b/static/image/traderank/seller/3.gif differ diff --git a/static/image/traderank/seller/4.gif b/static/image/traderank/seller/4.gif new file mode 100644 index 0000000..a87d9f1 Binary files /dev/null and b/static/image/traderank/seller/4.gif differ diff --git a/static/image/traderank/seller/5.gif b/static/image/traderank/seller/5.gif new file mode 100644 index 0000000..addec1e Binary files /dev/null and b/static/image/traderank/seller/5.gif differ diff --git a/static/image/traderank/seller/6.gif b/static/image/traderank/seller/6.gif new file mode 100644 index 0000000..f8329ee Binary files /dev/null and b/static/image/traderank/seller/6.gif differ diff --git a/static/image/traderank/seller/7.gif b/static/image/traderank/seller/7.gif new file mode 100644 index 0000000..c1cbbda Binary files /dev/null and b/static/image/traderank/seller/7.gif differ diff --git a/static/image/traderank/seller/8.gif b/static/image/traderank/seller/8.gif new file mode 100644 index 0000000..e2364ee Binary files /dev/null and b/static/image/traderank/seller/8.gif differ diff --git a/static/image/traderank/seller/9.gif b/static/image/traderank/seller/9.gif new file mode 100644 index 0000000..e93edeb Binary files /dev/null and b/static/image/traderank/seller/9.gif differ diff --git a/static/image/traderank/seller/index.htm b/static/image/traderank/seller/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/image/traderank/soso.gif b/static/image/traderank/soso.gif new file mode 100644 index 0000000..33ad2fa Binary files /dev/null and b/static/image/traderank/soso.gif differ diff --git a/static/image/upgrade/bg_footer.gif b/static/image/upgrade/bg_footer.gif new file mode 100644 index 0000000..a0eee26 Binary files /dev/null and b/static/image/upgrade/bg_footer.gif differ diff --git a/static/image/upgrade/bg_repno.gif b/static/image/upgrade/bg_repno.gif new file mode 100644 index 0000000..17dc012 Binary files /dev/null and b/static/image/upgrade/bg_repno.gif differ diff --git a/static/image/upgrade/bg_repx.gif b/static/image/upgrade/bg_repx.gif new file mode 100644 index 0000000..4f89fb9 Binary files /dev/null and b/static/image/upgrade/bg_repx.gif differ diff --git a/static/image/upgrade/close.gif b/static/image/upgrade/close.gif new file mode 100644 index 0000000..5022b9b Binary files /dev/null and b/static/image/upgrade/close.gif differ diff --git a/static/image/upgrade/index.htm b/static/image/upgrade/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/index.htm b/static/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/static/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/js/admincp.js b/static/js/admincp.js new file mode 100644 index 0000000..4055fc5 --- /dev/null +++ b/static/js/admincp.js @@ -0,0 +1,495 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: admincp.js 31631 2012-09-17 06:36:25Z monkey $ +*/ + +function redirect(url) { + window.location.replace(url); +} + +function scrollTopBody() { + return Math.max(document.documentElement.scrollTop, document.body.scrollTop); +} + +function checkAll(type, form, value, checkall, changestyle) { + var checkall = checkall ? checkall : 'chkall'; + for(var i = 0; i < form.elements.length; i++) { + var e = form.elements[i]; + if(type == 'option' && e.type == 'radio' && e.value == value && e.disabled != true) { + e.checked = true; + } else if(type == 'value' && e.type == 'checkbox' && e.getAttribute('chkvalue') == value) { + e.checked = form.elements[checkall].checked; + if(changestyle) { + multiupdate(e); + } + } else if(type == 'prefix' && e.name && e.name != checkall && (!value || (value && e.name.match(value)))) { + e.checked = form.elements[checkall].checked; + if(changestyle) { + if(e.parentNode && e.parentNode.tagName.toLowerCase() == 'li') { + e.parentNode.className = e.checked ? 'checked' : ''; + } + if(e.parentNode.parentNode && e.parentNode.parentNode.tagName.toLowerCase() == 'div') { + e.parentNode.parentNode.className = e.checked ? 'item checked' : 'item'; + } + } + } + } +} + +function altStyle(obj, disabled) { + function altStyleClear(obj) { + var input, lis, i; + lis = obj.parentNode.getElementsByTagName('li'); + for(i=0; i < lis.length; i++){ + lis[i].className = ''; + } + } + var disabled = !disabled ? 0 : disabled; + if(disabled) { + return; + } + + var input, lis, i, cc, o; + cc = 0; + lis = obj.getElementsByTagName('li'); + for(i=0; i < lis.length; i++){ + lis[i].onclick = function(e) { + o = BROWSER.ie ? event.srcElement.tagName : e.target.tagName; + altKey = BROWSER.ie ? window.event.altKey : e.altKey; + if(cc) { + return; + } + cc = 1; + input = this.getElementsByTagName('input')[0]; + if(input.getAttribute('type') == 'checkbox' || input.getAttribute('type') == 'radio') { + if(input.getAttribute('type') == 'radio') { + altStyleClear(this); + } + + if(BROWSER.ie || o != 'INPUT' && input.onclick) { + input.click(); + } + if(this.className != 'checked') { + this.className = 'checked'; + input.checked = true; + } else { + this.className = ''; + input.checked = false; + } + if(altKey && input.name.match(/^multinew\[\d+\]/)) { + miid = input.id.split('|'); + mi = 0; + while($(miid[0] + '|' + mi)) { + $(miid[0] + '|' + mi).checked = input.checked; + if(input.getAttribute('type') == 'radio') { + altStyleClear($(miid[0] + '|' + mi).parentNode); + } + $(miid[0] + '|' + mi).parentNode.className = input.checked ? 'checked' : ''; + mi++; + } + } + } + }; + lis[i].onmouseup = function(e) { + cc = 0; + } + } +} + +var addrowdirect = 0; +var addrowkey = 0; +function addrow(obj, type) { + var table = obj.parentNode.parentNode.parentNode.parentNode.parentNode; + if(!addrowdirect) { + var row = table.insertRow(obj.parentNode.parentNode.parentNode.rowIndex); + } else { + var row = table.insertRow(obj.parentNode.parentNode.parentNode.rowIndex + 1); + } + var typedata = rowtypedata[type]; + for(var i = 0; i <= typedata.length - 1; i++) { + var cell = row.insertCell(i); + cell.colSpan = typedata[i][0]; + var tmp = typedata[i][1]; + if(typedata[i][2]) { + cell.className = typedata[i][2]; + } + tmp = tmp.replace(/\{(n)\}/g, function($1) {return addrowkey;}); + tmp = tmp.replace(/\{(\d+)\}/g, function($1, $2) {return addrow.arguments[parseInt($2) + 1];}); + cell.innerHTML = tmp; + } + addrowkey ++; + addrowdirect = 0; +} + +function deleterow(obj) { + var table = obj.parentNode.parentNode.parentNode.parentNode.parentNode; + var tr = obj.parentNode.parentNode.parentNode; + table.deleteRow(tr.rowIndex); +} +function dropmenu(obj){ + showMenu({'ctrlid':obj.id, 'menuid':obj.id + 'child', 'evt':'mouseover'}); + $(obj.id + 'child').style.top = (parseInt($(obj.id + 'child').style.top) - Math.max(document.body.scrollTop, document.documentElement.scrollTop)) + 'px'; + if(BROWSER.ie > 6 || !BROWSER.ie) { + $(obj.id + 'child').style.left = (parseInt($(obj.id + 'child').style.left) - Math.max(document.body.scrollLeft, document.documentElement.scrollLeft)) + 'px'; + } +} + +function insertunit(obj, text, textend) { + obj.focus(); + textend = isUndefined(textend) ? '' : textend; + if(!isUndefined(obj.selectionStart)) { + var opn = obj.selectionStart + 0; + if(textend != '') { + text = text + obj.value.substring(obj.selectionStart, obj.selectionEnd) + textend; + } + obj.value = obj.value.substr(0, obj.selectionStart) + text + obj.value.substr(obj.selectionEnd); + obj.selectionStart = opn + strlen(text); + obj.selectionEnd = opn + strlen(text); + } else if(document.selection && document.selection.createRange) { + var sel = document.selection.createRange(); + if(textend != '') { + text = text + sel.text + textend; + } + sel.text = text.replace(/\r?\n/g, '\r\n'); + sel.moveStart('character', -strlen(text)); + } else { + obj.value += text; + } + obj.focus(); +} + +var heightag = BROWSER.chrome ? 4 : 0; +function textareakey(obj, event) { + if(event.keyCode == 9) { + insertunit(obj, '\t'); + doane(event); + } +} + +function textareasize(obj, op) { + if(!op) { + + } else { + if(obj.style.position == 'absolute') { + obj.style.position = ''; + obj.style.width = ''; + obj.parentNode.style.height = ''; + obj.style.resize = 'none'; + } else { + obj.parentNode.style.height = obj.parentNode.offsetHeight + 'px'; + obj.style.width = BROWSER.ie > 6 || !BROWSER.ie ? '90%' : '600px'; + obj.style.position = 'absolute'; + obj.style.resize = 'vertical'; + } + } +} + +function showanchor(obj) { + var navs = $('submenu').getElementsByTagName('li'); + for(var i = 0; i < navs.length; i++) { + if(navs[i].id.substr(0, 4) == 'nav_' && navs[i].id != obj.id) { + if($(navs[i].id.substr(4))) { + navs[i].className = ''; + $(navs[i].id.substr(4)).style.display = 'none'; + if($(navs[i].id.substr(4) + '_tips')) $(navs[i].id.substr(4) + '_tips').style.display = 'none'; + } + } + } + obj.className = 'current'; + currentAnchor = obj.id.substr(4); + $(currentAnchor).style.display = ''; + if($(currentAnchor + '_tips')) $(currentAnchor + '_tips').style.display = ''; + if($(currentAnchor + 'form')) { + $(currentAnchor + 'form').anchor.value = currentAnchor; + } else if($('cpform')) { + $('cpform').anchor.value = currentAnchor; + } +} + +function updatecolorpreview(obj) { + $(obj).style.background = $(obj + '_v').value; +} + +function entersubmit(e, name) { + if(loadUserdata('is_blindman')) { + return false; + } + e = e ? e : event; + if(e.keyCode != 13) { + return; + } + var tag = BROWSER.ie ? e.srcElement.tagName : e.target.tagName; + if(tag != 'TEXTAREA') { + doane(e); + if($('submit_' + name).offsetWidth) { + $('formscrolltop').value = document.documentElement.scrollTop; + $('submit_' + name).click(); + } + } +} + +function parsetag(tag) { + var parse = function (tds) { + for(var i = 0; i < tds.length; i++) { + if(tds[i].getAttribute('s') == '1') { + tds[i].innerHTML = tds[i].innerHTML.replace(/(^|>)([^<]+)(?=<|$)/ig, function($1, $2, $3) { + if(tag && $3.toLowerCase().indexOf(tag.toLowerCase()) != -1) { + re = new RegExp(tag, "ig"); + $3 = $3.replace(re, '$&'); + } + return $2 + $3; + }); + } + } + }; + parse(document.body.getElementsByTagName('td')); + parse(document.body.getElementsByTagName('span')); +} + +function sdisplay(id, obj) { + obj.innerHTML = $(id).style.display == 'none' ? '' : ''; + display(id); +} + +if(ISFRAME) { + try { + _attachEvent(document.documentElement, 'keydown', parent.resetEscAndF5); + } catch(e) {} +} + +var multiids = new Array(); +function multiupdate(obj) { + v = obj.value; + if(obj.checked) { + multiids[v] = v; + } else { + multiids[v] = null; + } +} + +function getmultiids() { + var ids = '', comma = ''; + for(i in multiids) { + if(multiids[i] != null) { + ids += comma + multiids[i]; + comma = ','; + } + } + return ids; +} + + +function toggle_group(oid, obj, conf) { + obj = obj ? obj : $('a_'+oid); + if(!conf) { + var conf = {'show':'[-]','hide':'[+]'}; + } + var obody = $(oid); + if(obody.style.display == 'none') { + obody.style.display = ''; + obj.innerHTML = conf.show; + } else { + obody.style.display = 'none'; + obj.innerHTML = conf.hide; + } +} +function show_all() { + var tbodys = $("cpform").getElementsByTagName('tbody'); + for(var i = 0; i < tbodys.length; i++) { + var re = /^group_(\d+)$/; + var matches = re.exec(tbodys[i].id); + if(matches != null) { + tbodys[i].style.display = ''; + $('a_group_' + matches[1]).innerHTML = '[-]'; + } + } +} +function hide_all() { + var tbodys = $("cpform").getElementsByTagName('tbody'); + for(var i = 0; i < tbodys.length; i++) { + var re = /^group_(\d+)$/; + var matches = re.exec(tbodys[i].id); + if(matches != null) { + tbodys[i].style.display = 'none'; + $('a_group_' + matches[1]).innerHTML = '[+]'; + } + } +} + +function show_all_hook(prefix, tagname) { + var tbodys = $("cpform").getElementsByTagName(tagname); + for(var i = 0; i < tbodys.length; i++) { + var re = new RegExp('^' + prefix + '(.+)$'); + var matches = re.exec(tbodys[i].id); + if(matches != null) { + tbodys[i].style.display = ''; + $('a_' + prefix + matches[1]).innerHTML = '[-]'; + } + } +} + +function hide_all_hook(prefix, tagname) { + var tbodys = $("cpform").getElementsByTagName(tagname); + for(var i = 0; i < tbodys.length; i++) { + var re = new RegExp('^' + prefix + '(.+)$'); + var matches = re.exec(tbodys[i].id); + if(matches != null) { + tbodys[i].style.display = 'none'; + $('a_' + prefix + matches[1]).innerHTML = '[+]'; + } + } +} + +function srchforum() { + var fname = $('srchforumipt').value.toLowerCase(); + if(!fname) return false; + var inputs = $("cpform").getElementsByTagName('input'); + for(var i = 0; i < inputs.length; i++) { + if(inputs[i].name.match(/^name\[\d+\]$/)) { + if(inputs[i].value.toLowerCase().indexOf(fname) !== -1) { + inputs[i].parentNode.parentNode.parentNode.parentNode.style.display = ''; + inputs[i].parentNode.parentNode.parentNode.style.background = '#eee'; + window.scrollTo(0, fetchOffset(inputs[i]).top - 100); + return false; + } + } + } + return false; +} + +function setfaq(obj, id) { + if(!$(id)) { + return; + } + $(id).style.display = ''; + if(!obj.onmouseout) { + obj.onmouseout = function () { + $(id).style.display = 'none'; + } + } +} + +function floatbottom(id) { + if(!$(id)) { + return; + } + $(id).style.position = 'fixed'; + $(id).style.bottom = '0'; + $(id).parentNode.style.paddingBottom = '15px'; + if(!BROWSER.ie || BROWSER.ie && BROWSER.ie > 6) { + window.onscroll = function() { + var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); + $(id).style.marginLeft = '-' + scrollLeft + 'px'; + }; + $(id).style.display = ''; + } +} + +var sethtml_id = null; +function sethtml(id) { + $(id).className = 'txt html'; + $(id).contentEditable = true; + $(id).onkeyup = function () { + $(id + '_v').value = $(id).innerHTML; + }; + var curvalue = $(id).innerHTML; + + var div = document.createElement('div'); + div.id = id + '_c_menu'; + div.style.display = 'none'; + div.innerHTML = ''; + $(id).parentNode.appendChild(div); + + var btn = document.createElement('input'); + btn.id = id + '_c'; + btn.type = 'button'; + btn.className = 'htmlbtn c'; + if(curvalue.search(//ig) !== -1) { + btn.className = 'htmlbtn b current'; + } + btn.onclick = function() { + var oldvalue = $(id).innerHTML; + $(id).innerHTML = preg_replace(['', ''], '', $(id).innerHTML); + if(oldvalue == $(id).innerHTML) { + $(id + '_b').className = 'htmlbtn b current'; + $(id).innerHTML = '' + $(id).innerHTML + ''; + } else { + $(id + '_b').className = 'htmlbtn b'; + } + $(id + '_v').value = $(id).innerHTML; + }; + $(id).parentNode.appendChild(btn); + + var btn = document.createElement('input'); + btn.id = id + '_i'; + btn.type = 'button'; + btn.className = 'htmlbtn i'; + if(curvalue.search(//ig) !== -1) { + btn.className = 'htmlbtn i current'; + } + btn.onclick = function() { + var oldvalue = $(id).innerHTML; + $(id).innerHTML = preg_replace(['', ''], '', $(id).innerHTML); + if(oldvalue == $(id).innerHTML) { + $(id + '_i').className = 'htmlbtn i current'; + $(id).innerHTML = '' + $(id).innerHTML + ''; + } else { + $(id + '_i').className = 'htmlbtn i'; + } + $(id + '_v').value = $(id).innerHTML; + }; + $(id).parentNode.appendChild(btn); + + var btn = document.createElement('input'); + btn.id = id + '_u'; + btn.type = 'button'; + btn.style.textDecoration = 'underline'; + btn.className = 'htmlbtn u'; + if(curvalue.search(//ig) !== -1) { + btn.className = 'htmlbtn u current'; + } + btn.onclick = function() { + var oldvalue = $(id).innerHTML; + $(id).innerHTML = preg_replace(['', ''], '', $(id).innerHTML); + if(oldvalue == $(id).innerHTML) { + $(id + '_u').className = 'htmlbtn u current'; + $(id).innerHTML = '' + $(id).innerHTML + ''; + } else { + $(id + '_u').className = 'htmlbtn u'; + } + $(id + '_v').value = $(id).innerHTML; + }; + $(id).parentNode.appendChild(btn); +} + +function sethtml_color(color) { + $(sethtml_id).innerHTML = preg_replace([']+?>', ''], '', $(sethtml_id).innerHTML); + if(color != 'transparent') { + $(sethtml_id + '_c').className = 'htmlbtn c current'; + $(sethtml_id).innerHTML = '' + $(sethtml_id).innerHTML + ''; + } else { + $(sethtml_id + '_c').className = 'htmlbtn c'; + } + $(sethtml_id + '_v').value = $(sethtml_id).innerHTML; +} + +function uploadthreadtypexml(formobj, formaction) { + formobj.action = formaction; + formobj.submit(); +} \ No newline at end of file diff --git a/static/js/admincp_base.js b/static/js/admincp_base.js new file mode 100644 index 0000000..a1301a5 --- /dev/null +++ b/static/js/admincp_base.js @@ -0,0 +1,107 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms +*/ + +function run_toggle(target, styles, source) { + var rmstyle = styles.shift(); + if (!source) { + source = target; + } + if (rmstyle) { + if (typeof rmstyle == 'string') { + target.classList.remove(rmstyle); + } else { + for (var i in rmstyle) { + target.classList.remove(rmstyle[i]); + } + } + } + if (styles[0]) { + if (typeof styles[0] == 'string') { + target.classList.add(styles[0]); + } else { + for (var i in styles[0]) { + target.classList.add(styles[0][i]); + } + } + if (styles.length > 1) { + function nextstep() { + source.removeEventListener('transitionend', nextstep); + run_toggle(target, styles, source); + } + source.addEventListener('transitionend', nextstep); + } + } +} +function init_darkmode() { + var dmcookie = getcookie('darkmode'); + var dmdark = 0, dmauto = 1; + document.querySelector('.darkmode').addEventListener('click', toggledarkmode); + if (dmcookie && dmcookie.indexOf('a') == -1) { + dmauto = 0; + if (dmcookie.indexOf('d') != -1) { + dmdark = 1; + } + switchdmvalue(dmdark, dmauto); + } else { + var colormedia = window.matchMedia('(prefers-color-scheme: dark)'); + switchdmvalue(colormedia.matches, dmauto); + colormedia.addEventListener('change', function () { + var dmlcookie = getcookie('darkmode'); + if (dmlcookie && dmlcookie.indexOf('a') != -1) { + switchdmvalue(this.matches, 1); + } + }); + } +} +function toggledarkmode() { + var dmcookie = getcookie('darkmode'); + var dmdark = 0, dmauto = 1; + var colormedia = window.matchMedia('(prefers-color-scheme: dark)'); + if (dmcookie && dmcookie.indexOf('a') == -1) { + dmauto = 0; + if (dmcookie.indexOf('d') != -1) { + dmdark = 1; + } + } else { + dmdark = colormedia.matches ? 1 : 0; + } + if (dmauto) { + dmauto = dmauto ? 0 : 1; + dmdark = dmdark ? 0 : 1; + } else if (colormedia.matches == dmdark) { + dmauto = 1; + } else { + dmdark = dmdark ? 0 : 1; + } + switchdmvalue(dmdark, dmauto); +} +function switchdmvalue(ifdark, ifauto) { + var dmcookie = ''; + var dmmeta = ''; + if (ifdark) { + document.body.classList.add('st-d'); + document.body.classList.remove('st-l'); + dmcookie = 'd'; + dmmeta = 'dark'; + } else { + document.body.classList.add('st-l'); + document.body.classList.remove('st-d'); + dmcookie = 'l'; + dmmeta = 'light'; + } + if (ifauto) { + document.body.classList.add('st-a'); + dmcookie += 'a'; + dmmeta = 'light dark'; + } else { + document.body.classList.remove('st-a'); + } console.log(dmcookie); + if (getcookie('darkmode') != dmcookie) { + setcookie('darkmode', dmcookie); + } + if (document.querySelector('meta[name="color-scheme"]').content != dmmeta) { + document.querySelector('meta[name="color-scheme"]').content = dmmeta; + } +} \ No newline at end of file diff --git a/static/js/admincp_frame.js b/static/js/admincp_frame.js new file mode 100644 index 0000000..6b36e6a --- /dev/null +++ b/static/js/admincp_frame.js @@ -0,0 +1,210 @@ +function init_darkmode() { + var dmcookie = getcookie('darkmode'); + var dmdark = 0, dmauto = 1; + document.querySelector('.darkmode').addEventListener('click', toggledarkmode); + if (dmcookie && dmcookie.indexOf('a') == -1) { + dmauto = 0; + if (dmcookie.indexOf('d') != -1) { + dmdark = 1; + } + switchdmvalue(dmdark, dmauto); + } else { + var colormedia = window.matchMedia('(prefers-color-scheme: dark)'); + switchdmvalue(colormedia.matches, dmauto); + colormedia.addEventListener('change', function () { + var dmlcookie = getcookie('darkmode'); + if (dmlcookie && dmlcookie.indexOf('a') != -1) { + switchdmvalue(this.matches, 1); + } + }); + } +} +function toggledarkmode() { + var dmcookie = getcookie('darkmode'); + var dmdark = 0, dmauto = 1; + var colormedia = window.matchMedia('(prefers-color-scheme: dark)'); + if (dmcookie && dmcookie.indexOf('a') == -1) { + dmauto = 0; + if (dmcookie.indexOf('d') != -1) { + dmdark = 1; + } + } else { + dmdark = colormedia.matches ? 1 : 0; + } + if (dmauto) { + dmauto = dmauto ? 0 : 1; + dmdark = dmdark ? 0 : 1; + } else if (colormedia.matches == dmdark) { + dmauto = 1; + } else { + dmdark = dmdark ? 0 : 1; + } + switchdmvalue(dmdark, dmauto); +} +function switchdmvalue(ifdark, ifauto) { + var dmcookie = ''; + var dmmeta = ''; + if (ifdark) { + document.body.classList.add('st-d'); + document.body.classList.remove('st-l'); + dmcookie = 'd'; + dmmeta = 'dark'; + } else { + document.body.classList.add('st-l'); + document.body.classList.remove('st-d'); + dmcookie = 'l'; + dmmeta = 'light'; + } + if (ifauto) { + document.body.classList.add('st-a'); + dmcookie += 'a'; + dmmeta = 'light dark'; + } else { + document.body.classList.remove('st-a'); + } + let iframe = document.getElementById('main'); + iframe.onload = function(){ + switchframedmvalue(ifdark, ifauto) + } + switchframedmvalue(ifdark, ifauto) + console.log(dmcookie); + if (getcookie('darkmode') != dmcookie) { + setcookie('darkmode', dmcookie); + } + if (document.querySelector('meta[name="color-scheme"]').content != dmmeta) { + document.querySelector('meta[name="color-scheme"]').content = dmmeta; + } +} +function switchframedmvalue(ifdark, ifauto) { + let iframe = document.getElementById('main'); + if (ifdark) { + iframe.contentWindow.document.body.classList.add('st-d'); + iframe.contentWindow.document.body.classList.remove('st-l'); + } else { + iframe.contentWindow.document.body.classList.add('st-l'); + iframe.contentWindow.document.body.classList.remove('st-d'); + } + if (ifauto) { + iframe.contentWindow.document.body.classList.add('st-a'); + } else { + iframe.contentWindow.document.body.classList.remove('st-a'); + } +} + +(function () { + var prevnav = prevtab = menunav = navt = navkey = headerST = null; + function switchnav(key, nolocation = false, switchheader = true) { + if (!key || !$('header_' + key)) { + return; + } + if (prevnav && $('header_' + prevnav) && key != 'cloudaddons' && key != 'uc') { + document.querySelectorAll('#topmenu button').forEach(function (nav) { + navkey = nav.id.substring(7); + if (navkey && $('header_' + navkey)) { + if (switchheader) { + $('header_' + navkey).className = ''; + } + $('lm_' + navkey).className = ''; + } + }); + } + href = $('lm_' + key).childNodes[1].childNodes[0].childNodes[0].href; + if (key == 'cloudaddons' || key == 'uc') { + if (!nolocation) { + window.open(href); + doane(); + } + } else { + if (prevnav == key && (getcookie('admincp_leftlayout') || parseInt(document.documentElement.clientWidth) < 1200)) { + $('header_' + prevnav).className = ''; + $('lm_' + prevnav).className = ''; + prevnav = null; + } else { + $('lm_' + key).className = 'active'; + if (switchheader) { + $('header_' + key).className = 'active'; + prevnav = key; + } + if (!nolocation) { + switchtab($('lm_' + key).childNodes[1].childNodes[0].childNodes[0]); + parent.main.location = href; + } + } + } + } + function switchtab(key) { + if (!key || !key.href) { + return; + } + if(prevtab) { + prevtab.className = ''; + } + key.className = 'active'; + prevtab = key; + $('navcontainer').classList.remove('show'); + } + function openinnewwindow(obj) { + var href = obj.parentNode.href; + if(obj.parentNode.href.indexOf(admincpfilename + '?') != -1) { + href += '&frames=yes'; + } + window.open(href); + doane(); + } + document.querySelectorAll('#leftmenu > li > a').forEach(function (nav) { + nav.addEventListener('click', function () { + nolocation = true; + id = this.id.substring(7); + if (id == 'cloudaddons' || id == 'uc') { + nolocation = false; + } + switchnav(id, nolocation); + }); + }); + document.querySelectorAll('#topmenu > li > a').forEach(function (nav) { + nav.addEventListener('click', function () { + switchnav(this.id.substring(7)); + }); + }); + document.querySelectorAll('#topmenu button').forEach(function (nav) { + nav.addEventListener('click', function () { + switchnav(this.id.substring(7)); + }); + nav.addEventListener('mouseover', function () { + id = this.id.substring(7); + headerST = setTimeout(function () { + switchnav(id, true, false); + }, 1000); + }); + nav.addEventListener('mouseout', function () { + clearTimeout(headerST); + }); + }); + document.querySelectorAll('nav ul ul a').forEach(function (tab) { + tab.addEventListener('click', function () { + switchtab(this); + }); + }); + document.querySelectorAll('nav ul ul a > em').forEach(function (tabem) { + tabem.addEventListener('click', function () { + openinnewwindow(this); + }); + }); + switchnav(typeof defaultNav != 'undefined' ? defaultNav : 'index', 1); + switchtab(document.querySelector('nav ul li.active ul a.active') != null ? document.querySelector('nav ul li.active ul a.active') : document.querySelector('nav ul ul a')); + $('cpsetting').addEventListener('click', function(){ + $('bdcontainer').classList.toggle('oldlayout'); + setcookie('admincp_leftlayout', 1, getcookie('admincp_leftlayout') ? -2592000 : 2592000); + }); + document.querySelector('#frameuinfo > img').addEventListener('click', function(){ + document.querySelector('.mainhd').classList.toggle('toggle'); + }); + $('navbtn').addEventListener('click', function(){ + $('navcontainer').classList.add('show'); + }); + $('navcontainer').addEventListener('click', function(e){ + if(e.target === this){ + this.classList.remove('show') + } + }) +})() \ No newline at end of file diff --git a/static/js/admincp_login.js b/static/js/admincp_login.js new file mode 100644 index 0000000..e33b799 --- /dev/null +++ b/static/js/admincp_login.js @@ -0,0 +1,7 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms +*/ + +function init_darkmode() { +} \ No newline at end of file diff --git a/static/js/ajax.js b/static/js/ajax.js new file mode 100644 index 0000000..e5907c7 --- /dev/null +++ b/static/js/ajax.js @@ -0,0 +1,264 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: ajax.js 34259 2013-11-26 07:37:25Z nemohou $ +*/ + +function _ajaxget(url, showid, waitid, loading, display, recall) { + waitid = typeof waitid == 'undefined' || waitid === null ? showid : waitid; + var x = new Ajax(); + x.setLoading(loading); + x.setWaitId(waitid); + x.display = typeof display == 'undefined' || display == null ? '' : display; + x.showId = $(showid); + + if(url.substr(strlen(url) - 1) == '#') { + url = url.substr(0, strlen(url) - 1); + x.autogoto = 1; + } + + var url = url + '&inajax=1&ajaxtarget=' + showid; + x.get(url, function(s, x) { + var evaled = false; + if(s.indexOf('ajaxerror') != -1) { + evalscript(s); + evaled = true; + } + if(!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) { + if(x.showId) { + x.showId.style.display = x.display; + ajaxinnerhtml(x.showId, s); + ajaxupdateevents(x.showId); + if(x.autogoto) scroll(0, x.showId.offsetTop); + } + } + + ajaxerror = null; + if(recall && typeof recall == 'function') { + recall(); + } else if(recall) { + eval(recall); + } + if(!evaled) evalscript(s); + }); +} + +function _ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) { + var waitid = typeof waitid == 'undefined' || waitid === null ? showid : (waitid !== '' ? waitid : ''); + var showidclass = !showidclass ? '' : showidclass; + var ajaxframeid = 'ajaxframe'; + var ajaxframe = $(ajaxframeid); + var curform = $(formid); + var formtarget = curform.target; + + var handleResult = function() { + var s = ''; + var evaled = false; + + showloading('none'); + try { + s = $(ajaxframeid).contentWindow.document.XMLDocument.text; + } catch(e) { + try { + s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.wholeText; + } catch(e) { + try { + s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.nodeValue; + } catch(e) { + s = '内部错误,无法显示此内容'; + } + } + } + if(s != '' && s.indexOf('ajaxerror') != -1) { + evalscript(s); + evaled = true; + } + if(showidclass) { + if(showidclass != 'onerror') { + $(showid).className = showidclass; + } else { + showError(s); + ajaxerror = true; + } + } + if(submitbtn) { + submitbtn.disabled = false; + } + if(!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) { + ajaxinnerhtml($(showid), s); + } + ajaxerror = null; + if(curform) curform.target = formtarget; + if(typeof recall == 'function') { + recall(); + } else { + eval(recall); + } + if(!evaled) evalscript(s); + ajaxframe.loading = 0; + if(!BROWSER.firefox || BROWSER.safari) { + $('append_parent').removeChild(ajaxframe.parentNode); + } else { + setTimeout( + function(){ + $('append_parent').removeChild(ajaxframe.parentNode); + }, + 100 + ); + } + }; + if(!ajaxframe) { + var div = document.createElement('div'); + div.style.display = 'none'; + div.innerHTML = ''; + $('append_parent').appendChild(div); + ajaxframe = $(ajaxframeid); + } else if(ajaxframe.loading) { + return false; + } + + _attachEvent(ajaxframe, 'load', handleResult); + + showloading(); + curform.target = ajaxframeid; + var action = curform.getAttribute('action'); + action = hostconvert(action); + curform.action = action.replace(/\&inajax\=1/g, '')+'&inajax=1'; + curform.submit(); + if(submitbtn) { + submitbtn.disabled = true; + } + doane(); + return false; +} + +function _ajaxmenu(ctrlObj, timeout, cache, duration, pos, recall, idclass, contentclass) { + if(!ctrlObj.getAttribute('mid')) { + var ctrlid = ctrlObj.id; + if(!ctrlid) { + ctrlObj.id = 'ajaxid_' + Math.random(); + } + } else { + var ctrlid = ctrlObj.getAttribute('mid'); + if(!ctrlObj.id) { + ctrlObj.id = 'ajaxid_' + Math.random(); + } + } + var menuid = ctrlid + '_menu'; + var menu = $(menuid); + if(isUndefined(timeout)) timeout = 3000; + if(isUndefined(cache)) cache = 1; + if(isUndefined(pos)) pos = '43'; + if(isUndefined(duration)) duration = timeout > 0 ? 0 : 3; + if(isUndefined(idclass)) idclass = 'p_pop'; + if(isUndefined(contentclass)) contentclass = 'p_opt'; + var func = function() { + showMenu({'ctrlid':ctrlObj.id,'menuid':menuid,'duration':duration,'timeout':timeout,'pos':pos,'cache':cache,'layer':2}); + if(typeof recall == 'function') { + recall(); + } else { + eval(recall); + } + }; + + if(menu) { + if(menu.style.display == '') { + hideMenu(menuid); + } else { + func(); + } + } + menu = document.createElement('div'); + menu.id = menuid; + menu.style.display = 'none'; + menu.className = idclass; + menu.innerHTML = ''; + $('append_parent').appendChild(menu); + var url = (!isUndefined(ctrlObj.attributes['shref']) ? ctrlObj.attributes['shref'].value : (!isUndefined(ctrlObj.href) ? ctrlObj.href : ctrlObj.attributes['href'].value)); + url += (url.indexOf('?') != -1 ? '&' :'?') + 'ajaxmenu=1'; + ajaxget(url, menuid + '_content', 'ajaxwaitid', '', '', func); + doane(); +} + +function _appendscript(src, text, reload, charset) { + var id = hash(src + text); + if(!reload && in_array(id, evalscripts)) return; + if(reload && $(id)) { + $(id).parentNode.removeChild($(id)); + } + + evalscripts.push(id); + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.id = id; + scriptNode.charset = charset ? charset : (BROWSER.firefox ? document.characterSet : document.charset); + try { + if(src) { + scriptNode.src = src; + scriptNode.onloadDone = false; + scriptNode.onload = function () { + scriptNode.onloadDone = true; + JSLOADED[src] = 1; + }; + scriptNode.onreadystatechange = function () { + if((scriptNode.readyState == 'loaded' || scriptNode.readyState == 'complete') && !scriptNode.onloadDone) { + scriptNode.onloadDone = true; + JSLOADED[src] = 1; + } + }; + } else if(text){ + scriptNode.text = text; + } + document.getElementsByTagName('head')[0].appendChild(scriptNode); + } catch(e) {} +} + +function _ajaxupdateevents(obj, tagName) { + tagName = tagName ? tagName : 'A'; + var objs = obj.getElementsByTagName(tagName); + for(k in objs) { + var o = objs[k]; + ajaxupdateevent(o); + } +} + +function _ajaxupdateevent(o) { + if(typeof o == 'object' && o.getAttribute) { + if(o.getAttribute('ajaxtarget')) { + if(!o.id) o.id = Math.random(); + var ajaxevent = o.getAttribute('ajaxevent') ? o.getAttribute('ajaxevent') : 'click'; + var ajaxurl = o.getAttribute('ajaxurl') ? o.getAttribute('ajaxurl') : o.href; + _attachEvent(o, ajaxevent, newfunction('ajaxget', ajaxurl, o.getAttribute('ajaxtarget'), o.getAttribute('ajaxwaitid'), o.getAttribute('ajaxloading'), o.getAttribute('ajaxdisplay'))); + if(o.getAttribute('ajaxfunc')) { + o.getAttribute('ajaxfunc').match(/(\w+)\((.+?)\)/); + _attachEvent(o, ajaxevent, newfunction(RegExp.$1, RegExp.$2)); + } + } + } +} + +function _ajaxinnerhtml(showid, s) { + if(showid.tagName != 'TBODY') { + showid.innerHTML = s; + } else { + while(showid.firstChild) { + showid.firstChild.parentNode.removeChild(showid.firstChild); + } + var div1 = document.createElement('DIV'); + div1.id = showid.id+'_div'; + div1.innerHTML = ''+s+'
            '; + $('append_parent').appendChild(div1); + var trs = div1.getElementsByTagName('TR'); + var l = trs.length; + for(var i=0; i
            • @朋友账号,就能提醒他来看文章
            '; + } else { + if($('atkeyword').value) { + str = '@' + $('atkeyword').value + (wysiwyg ? ' ' : ' '); + insertText(str, strlen(str), 0, true, EXTRASEL); + } else { + insertText('', 0, 0, true, EXTRASEL); + } + checkFocus(); + return true; + } +} + +function atMenu(x, y) { + if(!$('at_menu')) { + div = document.createElement("div"); + div.id = "at_menu"; + document.body.appendChild(div); + div.style.position = 'absolute'; + div.className = 'p_pop'; + div.style.zIndex = '100000'; + } + $('at_menu').style.marginTop = (keyMenuObj.offsetHeight + 2) + 'px'; + $('at_menu').style.marginLeft = (keyMenuObj.offsetWidth + 2) + 'px'; + $('at_menu').style.left = x + 'px'; + $('at_menu').style.top = y + 'px'; + $('at_menu').style.display = ''; + $('at_menu').innerHTML = '
            请稍候... '; +} + +function atSearch(kw, call) { + if(atKeywords === null) { + atKeywords = ''; + var x = new Ajax(); + x.get('misc.php?mod=getatuser&inajax=1', function(s) { + if(s) { + atKeywords = s.split(','); + } + if(call) { + if(typeof call == 'function') { + call(); + } else { + eval(call); + } + } + }); + } + var lsi = 0; + for(i in atKeywords) { + if(atKeywords[i].indexOf(kw) !== -1 || kw === '') { + atResult[lsi] = kw !== '' ? atKeywords[i].replace(kw, '' + kw + '') : atKeywords[i]; + lsi++; + if(lsi > 10) { + break; + } + } + } + if(kw && !lsi) { + curatli = -1; + } +} + +function atEnter(e, call) { + if(e) { + if(e.keyCode == 38 && curatli > 0) { + curatli--; + return false; + } + if(e.keyCode == 40 && curatli < (atResult.length -1)) { + curatli++; + return false; + } + if(e.keyCode == 13) { + var call = !call ? 'insertText' : call; + if(curatli > -1) { + eval(call+'($(\'atli_'+curatli+'\').innerText)'); + } + hideMenu(); + doane(e); + return true; + } + } + return false; +} + +function atFilter(kw, id, call, e, nae) { + var nae = !nae ? false : nae; + atResult = []; + atSearch(kw, function () { atFilter(kw, id, call); }); + if(nae || !atEnter(e, call)) { + var newlist = ''; + if(atResult.length) { + $(id).style.visibility = 'visible'; + for(i in atResult) { + var atclass = i == curatli ? ' class="a"' : ''; + newlist += '
          • ' + atResult[i] + '
          • '; + } + $(id).innerHTML = '
              ' + newlist + '
            • @朋友账号,就能提醒他来看文章
            '; + } else { + $(id).style.visibility = 'hidden'; + } + } +} + +function atListSet(kw) { + $('atkeyword').value = kw; + if(!atsubmitid) { + $(editorid + '_at_submit').click(); + } else { + $(atsubmitid).click(); + } +} + +function atMenuSet(kw) { + keyMenuObj.innerHTML = '@' + kw + (wysiwyg ? ' ' : ' '); + $('at_menu').style.display = 'none'; + ctlent_enable[13] = 1; + curatli = 0; + if(BROWSER.firefox) { + var selection = editwin.getSelection(); + var range = selection.getRangeAt(0); + var tmp = keyMenuObj.firstChild; + range.setStart(tmp, keyMenuObj.innerHTML.length - 5); + range.setEnd(tmp, keyMenuObj.innerHTML.length - 5); + selection.removeAllRanges(); + selection.addRange(range); + } + checkFocus(); +} \ No newline at end of file diff --git a/static/js/autoloadpage.js b/static/js/autoloadpage.js new file mode 100644 index 0000000..02987ef --- /dev/null +++ b/static/js/autoloadpage.js @@ -0,0 +1,108 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: autoloadpage.js 33246 2013-05-09 02:07:17Z kamichen $ +*/ + +(function() { + + var autopbn = $('autopbn'); + var nextpageurl = autopbn.getAttribute('rel').valueOf(); + var curpage = parseInt(autopbn.getAttribute('curpage').valueOf()); + var totalpage = parseInt(autopbn.getAttribute('totalpage').valueOf()); + var picstyle = parseInt(autopbn.getAttribute('picstyle').valueOf()); + var forumdefstyle = parseInt(autopbn.getAttribute('forumdefstyle').valueOf()); + picstyle = picstyle && !forumdefstyle; + var autopagenum = 0; + var maxpage = (curpage + autopagenum) > totalpage ? totalpage : (curpage + autopagenum); + + var loadstatus = 0; + + autopbn.onclick = function() { + var oldloadstatus = loadstatus; + loadstatus = 2; + autopbn.innerHTML = '正在加载, 请稍后...'; + getnextpagecontent(); + loadstatus = oldloadstatus; + }; + + if(autopagenum > 0) { + window.onscroll = function () { + var curtop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + if(curtop + document.documentElement.clientHeight + 500 >= document.documentElement.scrollHeight && !loadstatus) { + loadstatus = 1; + autopbn.innerHTML = '正在加载, 请稍后...'; + setTimeout(getnextpagecontent, 1000); + } + }; + } + + function getnextpagecontent() { + + if(curpage + 1 > totalpage) { + window.onscroll = null; + autopbn.style.display = 'none'; + return; + } + if(loadstatus != 2 && curpage + 1 > maxpage) { + autopbn.innerHTML = '下一页 »'; + if(curpage + 1 > maxpage) { + window.onscroll = null; + } + return; + } + curpage++; + var url = nextpageurl + '&t=' + parseInt((+new Date()/1000)/(Math.random()*1000)); + var x = new Ajax('HTML'); + x.get(url, function (s) { + s = s.replace(/\n|\r/g, ' '); + if(s.indexOf("id=\"autopbn\"") == -1) { + $("autopbn").style.display = "none"; + window.onscroll = null; + } + + if(!picstyle) { + var tableobj = $('threadlisttableid'); + var nexts = s.match(/\(.+?)\<\/tbody>/g); + for(i in nexts) { + if(i == 'index' || i == 'lastIndex') { + continue; + } + var insertid = nexts[i].match(//); + if(!$('normalthread_' + insertid[1])) { + + var newbody = document.createElement('tbody'); + tableobj.appendChild(newbody); + var div = document.createElement('div'); + div.innerHTML = '' + nexts[i] + '
            '; + tableobj.replaceChild(div.childNodes[0].childNodes[0], tableobj.lastChild); + } + } + } else { + var nexts = s.match(/\
          • (.+?)\<\/li\>/g); + for(i in nexts) { + var insertid = nexts[i].match(/id="picstylethread_(\d+)"\>/); + if(!$('picstylethread_' + insertid[1])) { + $('threadlist_picstyle').innerHTML += nexts[i]; + } + } + } + var pageinfo = s.match(/\(.+?)\<\/span\>/); + nextpageurl = nextpageurl.replace(/&page=\d+/, '&page=' + (curpage + 1)); + + $('fd_page_bottom').innerHTML = pageinfo[1]; + var pageinfo = s.match(/\(.+?)\<\/span\>/); + $('fd_page_top').innerHTML = pageinfo[1]; + autopbn.style.display = 'none'; + if (curpage + 1 <= totalpage) { + autopbn.innerHTML = '下一页 »'; + setTimeout(function () { + autopbn.style.display = 'block'; + }, 100); + } + loadstatus = 0; + }); + } + +})(); \ No newline at end of file diff --git a/static/js/bbcode.js b/static/js/bbcode.js new file mode 100644 index 0000000..e2ebe08 --- /dev/null +++ b/static/js/bbcode.js @@ -0,0 +1,772 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: bbcode.js 36359 2017-01-20 05:06:45Z nemohou $ +*/ + +var re, DISCUZCODE = []; +DISCUZCODE['num'] = '-1'; +DISCUZCODE['html'] = []; +EXTRAFUNC['bbcode2html'] = []; +EXTRAFUNC['html2bbcode'] = []; + +function addslashes(str) { + return preg_replace(['\\\\', '\\\'', '\\\/', '\\\(', '\\\)', '\\\[', '\\\]', '\\\{', '\\\}', '\\\^', '\\\$', '\\\?', '\\\.', '\\\*', '\\\+', '\\\|'], ['\\\\', '\\\'', '\\/', '\\(', '\\)', '\\[', '\\]', '\\{', '\\}', '\\^', '\\$', '\\?', '\\.', '\\*', '\\+', '\\|'], str); +} + +function atag(aoptions, text) { + if(trim(text) == '') { + return ''; + } + var pend = parsestyle(aoptions, '', ''); + href = getoptionvalue('href', aoptions); + + if(href.substr(0, 11) == 'javascript:') { + return trim(recursion('a', text, 'atag')); + } + + return pend['prepend'] + '[url=' + href + ']' + trim(recursion('a', text, 'atag')) + '[/url]' + pend['append']; +} + +function bbcode2html(str) { + if(str == '') { + return ''; + } + + if(typeof(parsetype) == 'undefined') { + parsetype = 0; + } + + if(!fetchCheckbox('bbcodeoff') && allowbbcode && parsetype != 1) { + str = str.replace(/\[code\]([\s\S]+?)\[\/code\]/ig, function($1, $2) {return parsecode($2);}); + } + + if(fetchCheckbox('allowimgurl')) { + str = str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp|webp))/ig, '$1[img]$2[/img]'); + } + + if(!allowhtml || !fetchCheckbox('htmlon')) { + str = str.replace(//g, '>'); + if(!fetchCheckbox('parseurloff')) { + str = parseurl(str, 'html', false); + } + } + + for(i in EXTRAFUNC['bbcode2html']) { + EXTRASTR = str; + try { + eval('str = ' + EXTRAFUNC['bbcode2html'][i] + '()'); + } catch(e) {} + } + + if(!fetchCheckbox('smileyoff') && allowsmilies) { + if(typeof smilies_type == 'object') { + for(var typeid in smilies_array) { + for(var page in smilies_array[typeid]) { + for(var i in smilies_array[typeid][page]) { + re = new RegExp(preg_quote(smilies_array[typeid][page][i][1]), "g"); + str = str.replace(re, '' + smilies_array[typeid][page][i][1] + ''); + } + } + } + } + } + + if(!fetchCheckbox('bbcodeoff') && allowbbcode) { + str = clearcode(str); + str = str.replace(/\[url\]\s*((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)([^\[\"']+?)\s*\[\/url\]/ig, function($1, $2, $3, $4) {return cuturl($2 + $4);}); + str = str.replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\r\n\[\"']+?)\]([\s\S]+?)\[\/url\]/ig, '$4'); + str = str.replace(/\[email\](.[^\\=[]*)\[\/email\]/ig, '$1'); + str = str.replace(/\[email=(.[^\\=[]*)\](.*?)\[\/email\]/ig, '$2'); + str = str.replace(/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/ig, function($1, $2) { + addCSS = ''; + if(in_array($2, postimg_type["postbg"])) { + addCSS = ''; + } + return addCSS; + }); + str = str.replace(/\[color=([\w#\(\),\.\s]+?)\]/ig, ''); + str = str.replace(/\[backcolor=([\w#\(\),\.\s]+?)\]/ig, ''); + str = str.replace(/\[size=(\d+?)\]/ig, ''); + str = str.replace(/\[size=(\d+(\.\d+)?(px|pt)+?)\]/ig, ''); + str = str.replace(/\[font=([^\[\<\=]+?)\]/ig, ''); + str = str.replace(/\[align=([^\[\<\=]+?)\]/ig, '
            '); + str = str.replace(/\[p=(\d{1,2}|null), (\d{1,2}|null), (left|center|right)\]/ig, '

            '); + str = str.replace(/\[float=left\]/ig, '
            '); + str = str.replace(/\[float=right\]/ig, '
            '); + if(parsetype != 1) { + str = str.replace(/\[quote]([\s\S]*?)\[\/quote\]\s?\s?/ig, '

            $1
            \n'); + } + + re = /\[table(?:=(\d{1,4}%?)(?:,([\(\)%,#\w ]+))?)?\]\s*([\s\S]+?)\s*\[\/table\]/ig; + for (i = 0; i < 4; i++) { + str = str.replace(re, function($1, $2, $3, $4) {return parsetable($2, $3, $4);}); + } + + str = preg_replace([ + '\\\[\\\/color\\\]', '\\\[\\\/backcolor\\\]', '\\\[\\\/size\\\]', '\\\[\\\/font\\\]', '\\\[\\\/align\\\]', '\\\[\\\/p\\\]', '\\\[b\\\]', '\\\[\\\/b\\\]', + '\\\[i\\\]', '\\\[\\\/i\\\]', '\\\[u\\\]', '\\\[\\\/u\\\]', '\\\[s\\\]', '\\\[\\\/s\\\]', '\\\[hr\\\]', '\\\[list\\\]', '\\\[list=1\\\]', '\\\[list=a\\\]', + '\\\[list=A\\\]', '\\s?\\\[\\\*\\\]', '\\\[\\\/list\\\]', '\\\[indent\\\]', '\\\[\\\/indent\\\]', '\\\[\\\/float\\\]' + ], [ + '
            ', '
            ', '
            ', '
            ', '
            ', '

            ', '', '', '', + '', '', '', '', '', '
            ', '
              ', '
                ', '
                  ', + '
                    ', '
                  • ', '
                  ', '
                  ', '
                  ', '' + ], str, 'g'); + } + + if(!fetchCheckbox('bbcodeoff')) { + if(allowimgcode) { + str = str.replace(/\[img\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/ig, ''); + str = str.replace(/\[attachimg\](\d+)\[\/attachimg\]/ig, function ($1, $2) { + if(!$('image_' + $2)) { + return ''; + } + width = $('image_' + $2).getAttribute('cwidth'); + if(!width) { + re = /cwidth=(["']?)(\d+)(\1)/i; + var matches = re.exec($('image_' + $2).outerHTML); + if(matches != null) { + width = matches[2]; + } + } + return ''; + }); + str = str.replace(/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/ig, function ($1, $2, $3, $4) {return ' 0 ? ' width="' + $2 + '"' : '') + ($3 > 0 ? ' _height="' + $3 + '"' : '') + ' src="' + $4 + '" border="0" alt="" />'}); + } else { + str = str.replace(/\[img\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/ig, '$1'); + str = str.replace(/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/ig, '$3'); + } + } + + for(var i = 0; i <= DISCUZCODE['num']; i++) { + str = str.replace("[\tDISCUZ_CODE_" + i + "\t]", DISCUZCODE['html'][i]); + } + + if(!allowhtml || !fetchCheckbox('htmlon')) { + str = str.replace(/(^|>)([^<]+)(?=<|$)/ig, function($1, $2, $3) { + return $2 + preg_replace(['\t', ' ', ' ', '(\r\n|\n|\r)'], ['        ', '   ', '  ', '
                  '], $3); + }); + } else { + str = str.replace(/]*?>([^\x00]*?)<\/script>/ig, ''); + } + + return str; +} + +function clearcode(str) { + str= str.replace(/\[url\]\[\/url\]/ig, '', str); + str= str.replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\s\[\"']+?)\]\[\/url\]/ig, '', str); + str= str.replace(/\[email\]\[\/email\]/ig, '', str); + str= str.replace(/\[email=(.[^\[]*)\]\[\/email\]/ig, '', str); + str= str.replace(/\[color=([^\[\<]+?)\]\[\/color\]/ig, '', str); + str= str.replace(/\[size=(\d+?)\]\[\/size\]/ig, '', str); + str= str.replace(/\[size=(\d+(\.\d+)?(px|pt)+?)\]\[\/size\]/ig, '', str); + str= str.replace(/\[font=([^\[\<]+?)\]\[\/font\]/ig, '', str); + str= str.replace(/\[align=([^\[\<]+?)\]\[\/align\]/ig, '', str); + str= str.replace(/\[p=(\d{1,2}), (\d{1,2}), (left|center|right)\]\[\/p\]/ig, '', str); + str= str.replace(/\[float=([^\[\<]+?)\]\[\/float\]/ig, '', str); + str= str.replace(/\[quote\]\[\/quote\]/ig, '', str); + str= str.replace(/\[code\]\[\/code\]/ig, '', str); + str= str.replace(/\[table\]\[\/table\]/ig, '', str); + str= str.replace(/\[free\]\[\/free\]/ig, '', str); + str= str.replace(/\[b\]\[\/b]/ig, '', str); + str= str.replace(/\[u\]\[\/u]/ig, '', str); + str= str.replace(/\[i\]\[\/i]/ig, '', str); + str= str.replace(/\[s\]\[\/s]/ig, '', str); + return str; +} + +function cuturl(url) { + var length = 65; + var urllink = ''; + if(url.length > length) { + url = url.substr(0, parseInt(length * 0.5)) + ' ... ' + url.substr(url.length - parseInt(length * 0.3)); + } + urllink += url + ''; + return urllink; +} + +function dstag(options, text, tagname) { + if(trim(text) == '') { + return '\n'; + } + var pend = parsestyle(options, '', ''); + var prepend = pend['prepend']; + var append = pend['append']; + if(in_array(tagname, ['div', 'p'])) { + align = getoptionvalue('align', options); + if(in_array(align, ['left', 'center', 'right'])) { + prepend = '[align=' + align + ']' + prepend; + append += '[/align]'; + } else { + append += '\n'; + } + } + return prepend + recursion(tagname, text, 'dstag') + append; +} + +function ptag(options, text, tagname) { + if(trim(text) == '') { + return '\n'; + } + if(trim(options) == '') { + return text + '\n'; + } + + var lineHeight = null; + var textIndent = null; + var align, re, matches; + + re = /line-height\s?:\s?(\d{1,3})px/i; + matches = re.exec(options); + if(matches != null) { + lineHeight = matches[1]; + } + + re = /text-indent\s?:\s?(\d{1,3})em/i; + matches = re.exec(options); + if(matches != null) { + textIndent = matches[1]; + } + + re = /text-align\s?:\s?(left|center|right)/i; + matches = re.exec(options); + if(matches != null) { + align = matches[1]; + } else { + align = getoptionvalue('align', options); + } + align = in_array(align, ['left', 'center', 'right']) ? align : 'left'; + style = getoptionvalue('style', options); + style = preg_replace(['line-height\\\s?:\\\s?(\\\d{1,3})px', 'text-indent\\\s?:\\\s?(\\\d{1,3})em', 'text-align\\\s?:\\\s?(left|center|right)'], '', style); + if(lineHeight === null && textIndent === null) { + return '[align=' + align + ']' + (style ? '' : '') + text + (style ? '' : '') + '[/align]'; + } else { + return '[p=' + lineHeight + ', ' + textIndent + ', ' + align + ']' + (style ? '' : '') + text + (style ? '' : '') + '[/p]'; + } +} + +function fetchCheckbox(cbn) { + return $(cbn) && $(cbn).checked == true ? 1 : 0; +} + +function fetchoptionvalue(option, text) { + if((position = strpos(text, option)) !== false) { + delimiter = position + option.length; + if(text.charAt(delimiter) == '"') { + delimchar = '"'; + } else if(text.charAt(delimiter) == '\'') { + delimchar = '\''; + } else { + delimchar = ' '; + } + delimloc = strpos(text, delimchar, delimiter + 1); + if(delimloc === false) { + delimloc = text.length; + } else if(delimchar == '"' || delimchar == '\'') { + delimiter++; + } + return trim(text.substr(delimiter, delimloc - delimiter)); + } else { + return ''; + } +} + +function fonttag(fontoptions, text) { + var prepend = ''; + var append = ''; + var tags = new Array(); + tags = {'font' : 'face=', 'size' : 'size=', 'color' : 'color='}; + for(bbcode in tags) { + optionvalue = fetchoptionvalue(tags[bbcode], fontoptions); + if(optionvalue) { + prepend += '[' + bbcode + '=' + optionvalue + ']'; + append = '[/' + bbcode + ']' + append; + } + } + + var pend = parsestyle(fontoptions, prepend, append); + return pend['prepend'] + recursion('font', text, 'fonttag') + pend['append']; +} + +function getoptionvalue(option, text) { + re = new RegExp(option + "(\s+?)?\=(\s+?)?[\"']?(.+?)([\"']|$|>)", "ig"); + var matches = re.exec(text); + if(matches != null) { + return trim(matches[3]); + } + return ''; +} + +function html2bbcode(str) { + + if((allowhtml && fetchCheckbox('htmlon')) || trim(str) == '') { + for(i in EXTRAFUNC['html2bbcode']) { + EXTRASTR = str; + try { + eval('str = ' + EXTRAFUNC['html2bbcode'][i] + '()'); + } catch(e) {} + } + str = str.replace(/]+smilieid=(["']?)(\d+)(\1)[^>]*>/ig, function($1, $2, $3) {return smileycode($3);}); + str = str.replace(/]*aid=[^>]*)>/ig, function($1, $2) {return imgtag($2);}); + return str; + } + + if(navigator.userAgent.indexOf('Chrome') > -1){ + str = str.replace(/

                  <\/div>/ig, '
                  '); + str = str.replace(/
                  /ig, '
                  '); + str = str.replace(/<\/div>((]*>){1,})
                  /ig, '$1'); + } + + str = str.replace(/[\s\S]*?
                  ([\s\S]+?)<\/blockquote>[\s\S]*?<\/div>/ig, function($1, $2) {return codetag($2);}); + + if(!fetchCheckbox('bbcodeoff') && allowbbcode) { + var postbg = ''; + str = str.replace(/]+name="editorpostbg"[^>]*>body{background-image:url\("([^\[\<\r\n;'\"\?\(\)]+?)"\);}<\/style>/ig, function($1, $4) { + $4 = $4.replace(STATICURL+'image/postbg/', ''); + return '[postbg]'+$4+'[/postbg]'; + }); + str = str.replace(/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/ig, function($1, $2) { + postbg = $2; + return ''; + }); + if(postbg) { + str = '[postbg]'+postbg+'[/postbg]' + str; + } + } + + str = preg_replace(['[\\\s\\\S]*?<\/style>', '[\\\s\\\S]*?<\/script>', '[\\\s\\\S]*?<\/noscript>', '[\s\S]*?<\/select>', '[\s\S]*?<\/object>', '', ' on[a-zA-Z]{3,16}\\\s?=\\\s?"[\\\s\\\S]*?"'], '', str); + + str= str.replace(/(\r\n|\n|\r)/ig, ''); + + str= str.replace(/&((#(32|127|160|173))|shy|nbsp);/ig, ' '); + + if(fetchCheckbox('allowimgurl')) { + str = str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp|webp))/ig, '$1[img]$2[/img]'); + } + + if(!fetchCheckbox('parseurloff')) { + str = parseurl(str, 'bbcode', false); + } + + for(i in EXTRAFUNC['html2bbcode']) { + EXTRASTR = str; + try { + eval('str = ' + EXTRAFUNC['html2bbcode'][i] + '()'); + } catch(e) {} + } + + str = str.replace(/]*>/ig, ''); + str = str.replace(/]*>/ig, "\n"); + + if(!fetchCheckbox('bbcodeoff') && allowbbcode) { + str = preg_replace([ + ']*float:\\\s*(left|right)[^>]*>\\\s*([\\\s\\\S]+?)\\\s*<\/td><\/tr><\/table>', + ']*(width|background|background-color|backcolor)[^>]*)>', + ']*>', + ']*(?:background|background-color|backcolor)[:=]\\\s*(["\']?)([\(\)\\\s%,#\\\w]+)(\\1)[^>]*>', + ']*>', + '(]*(left|center|right)[^>]*)>)\\\s*([\\\s\\\S]+?)\\\s*(<\/t[dh]>)', + ']*(width|colspan|rowspan)[^>]*)>', + ']*>', + '<\/t[dh]>', + '<\/tr>', + '<\/table>', + ']*>', + '<\/h\\\d>' + ], [ + function($1, $2, $3) {return '[float=' + $2 + ']' + $3 + '[/float]';}, + function($1, $2) {return tabletag($2);}, + '[table]\n', + function($1, $2, $3) {return '[tr=' + $3 + ']';}, + '[tr]', + function($1, $2, $3, $4, $5, $6) {return $2 + '[align=' + $4 + ']' + $5 + '[/align]' + $6}, + function($1, $2) {return tdtag($2);}, + '[td]', + '[/td]', + '[/tr]\n', + '[/table]', + '[b]', + '[/b]' + ], str); + + str = str.replace(/]*>([\s\S]*?)<\/h\1>/ig, function($1, $2, $3) {return "[size=" + (7 - $2) + "]" + $3 + "[/size]\n\n";}); + str = str.replace(/]*>/ig, "[hr]"); + str = str.replace(/]+smilieid=(["']?)(\d+)(\1)[^>]*>/ig, function($1, $2, $3) {return smileycode($3);}); + str = str.replace(/]*src[^>]*)>/ig, function($1, $2) {return imgtag($2);}); + str = str.replace(/([\s\S]*?)<\/a>/ig, '$4'); + str = str.replace(/]*quote[^>]*>
                  ([\s\S]*?)<\/blockquote><\/div>([\s\S]*?)(]*>)?/ig, "[quote]$1[/quote]"); + str = str.replace(/]*blockcode[^>]*>
                  ([\s\S]*?)<\/blockquote><\/div>([\s\S]*?)(]*>)?/ig, "[code]$1[/code]"); + + str = recursion('b', str, 'simpletag', 'b'); + str = recursion('strong', str, 'simpletag', 'b'); + str = recursion('i', str, 'simpletag', 'i'); + str = recursion('em', str, 'simpletag', 'i'); + str = recursion('u', str, 'simpletag', 'u'); + str = recursion('strike', str, 'simpletag', 's'); + str = recursion('a', str, 'atag'); + str = recursion('font', str, 'fonttag'); + str = recursion('blockquote', str, 'simpletag', 'indent'); + str = recursion('ol', str, 'listtag'); + str = recursion('ul', str, 'listtag'); + str = recursion('div', str, 'dstag'); + str = recursion('p', str, 'ptag'); + str = recursion('span', str, 'fonttag'); + } + + str = str.replace(/<[\/\!]*?[^<>]*?>/ig, ''); + + for(var i = 0; i <= DISCUZCODE['num']; i++) { + str = str.replace("[\tDISCUZ_CODE_" + i + "\t]", DISCUZCODE['html'][i]); + } + str = clearcode(str); + + return preg_replace([' ', '<', '>', '&'], [' ', '<', '>', '&'], str); +} + +function tablesimple(s, table, str) { + if(strpos(str, '[tr=') || strpos(str, '[td=')) { + return s; + } else { + return '[table=' + table + ']\n' + preg_replace(['\\\[tr\\\]', '\\\[\\\/td\\\]\\\s?\\\[td\\\]', '\\\[\\\/tr\\\]\s?', '\\\[td\\\]', '\\\[\\\/td\\\]', '\\\[\\\/td\\\]\\\[\\\/tr\\\]'], ['', '|', '', '', '', '', ''], str) + '[/table]'; + } +} + +function imgtag(attributes) { + var width = ''; + var height = ''; + + re = /src=(["']?)([\s\S]*?)(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + var src = matches[2]; + } else { + return ''; + } + + re = /(max-)?width\s?:\s?(\d{1,4})(px)?/i; + var matches = re.exec(attributes); + if(matches != null && !matches[1]) { + width = matches[2]; + } + + re = /height\s?:\s?(\d{1,4})(px)?/i; + var matches = re.exec(attributes); + if(matches != null) { + height = matches[1]; + } + + if(!width) { + re = /width=(["']?)(\d+)(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + width = matches[2]; + } + } + + if(!height) { + re = /height=(["']?)(\d+)(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + height = matches[2]; + } + } + + re = /aid=(["']?)attachimg_(\d+)(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + return '[attachimg]' + matches[2] + '[/attachimg]'; + } + + width = width > 0 ? width : 0; + height = height > 0 ? height : 0; + return width > 0 || height > 0 ? + '[img=' + width + ',' + height + ']' + src + '[/img]' : + '[img]' + src + '[/img]'; +} + +function listtag(listoptions, text, tagname) { + text = text.replace(/
                • (([\s\S](?!<\/li))*?)(?=<\/?ol|<\/?ul|$1
                • ') + (BROWSER.opera ? '' : ''); + text = recursion('li', text, 'litag'); + var opentag = '[list]'; + var listtype = fetchoptionvalue('type=', listoptions); + listtype = listtype != '' ? listtype : (tagname == 'ol' ? '1' : ''); + if(in_array(listtype, ['1', 'a', 'A'])) { + opentag = '[list=' + listtype + ']'; + } + return text ? opentag + '\n' + recursion(tagname, text, 'listtag') + '[/list]' : ''; +} + +function litag(listoptions, text) { + return '[*]' + text.replace(/(\s+)$/g, '') + '\n'; +} + +function parsecode(text) { + DISCUZCODE['num']++; + text = text.replace(/\$/ig, '$$$$'); + DISCUZCODE['html'][DISCUZCODE['num']] = '
                  ' + htmlspecialchars(text) + '
                  '; + return "[\tDISCUZ_CODE_" + DISCUZCODE['num'] + "\t]"; +} + +function parsestyle(tagoptions, prepend, append) { + var searchlist = [ + ['align', true, 'text-align:\\s*(left|center|right);?', 1], + ['float', true, 'float:\\s*(left|right);?', 1], + ['color', true, '(^|[;\\s])color:\\s*([^;]+);?', 2], + ['backcolor', true, '(^|[;\\s])background-color:\\s*([^;]+);?', 2], + ['font', true, 'font-family:\\s*([^;]+);?', 1], + ['size', true, 'font-size:\\s*(\\d+(\\.\\d+)?(px|pt|in|cm|mm|pc|em|ex|%|));?', 1], + ['size', true, 'font-size:\\s*(x\\-small|small|medium|large|x\\-large|xx\\-large|\\-webkit\\-xxx\\-large);?', 1, 'size'], + ['b', false, 'font-weight:\\s*(bold);?'], + ['i', false, 'font-style:\\s*(italic);?'], + ['u', false, 'text-decoration:\\s*(underline);?'], + ['s', false, 'text-decoration:\\s*(line-through);?'] + ]; + var sizealias = {'x-small':1,'small':2,'medium':3,'large':4,'x-large':5,'xx-large':6,'-webkit-xxx-large':7}; + var style = getoptionvalue('style', tagoptions); + re = /^(?:\s|)color:\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)(;?)/i; + style = style.replace(re, function($1, $2, $3, $4, $5) {return("color:#" + parseInt($2).toString(16) + parseInt($3).toString(16) + parseInt($4).toString(16) + $5);}); + var len = searchlist.length; + for(var i = 0; i < len; i++) { + searchlist[i][4] = !searchlist[i][4] ? '' : searchlist[i][4]; + re = new RegExp(searchlist[i][2], "ig"); + match = re.exec(style); + if(match != null) { + opnvalue = match[searchlist[i][3]]; + if(searchlist[i][4] == 'size') { + opnvalue = sizealias[opnvalue]; + } + prepend += '[' + searchlist[i][0] + (searchlist[i][1] == true ? '=' + opnvalue + ']' : ']'); + append = '[/' + searchlist[i][0] + ']' + append; + } + } + return {'prepend' : prepend, 'append' : append}; +} + +function parsetable(width, bgcolor, str) { + + if(isUndefined(width)) { + var width = ''; + } else { + try { + width = width.substr(width.length - 1, width.length) == '%' ? (width.substr(0, width.length - 1) <= 98 ? width : '98%') : (width <= 560 ? width : '98%'); + } catch(e) { width = ''; } + } + if(isUndefined(str)) { + return; + } + + if(strpos(str, '[/tr]') === false && strpos(str, '[/td]') === false) { + var rows = str.split('\n'); + var s = ''; + for(i = 0;i < rows.length;i++) { + s += '' + preg_replace(['\r', '\\\\\\\|', '\\\|', '\\\\n'], ['', '|', '', '\n'], rows[i]) + ''; + } + str = s; + simple = ' simpletable'; + } else { + simple = ''; + str = str.replace(/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,4}%?))?\]/ig, function($1, $2, $3) { + return ''; + }); + str = str.replace(/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/ig, function($1, $2, $3, $4, $5) { + return ''; + }); + str = str.replace(/\[\/td\]\s*\[td(?:=(\d{1,4}%?))?\]/ig, function($1, $2) { + return ''; + }); + str = str.replace(/\[\/td\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/ig, function($1, $2, $3, $4) { + return ''; + }); + str = str.replace(/\[\/td\]\s*\[\/tr\]\s*/ig, ''); + str = str.replace(/ <\/td>/ig, ' '); + } + return '' + str + '
                  '; +} + +function preg_quote(str) { + return (str+'').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!<>\|\:])/g, "\\$1"); +} + +function recursion(tagname, text, dofunction, extraargs) { + if(extraargs == null) { + extraargs = ''; + } + tagname = tagname.toLowerCase(); + + var open_tag = '<' + tagname; + var open_tag_len = open_tag.length; + var close_tag = ''; + var close_tag_len = close_tag.length; + var beginsearchpos = 0; + + do { + var textlower = text.toLowerCase(); + var tagbegin = textlower.indexOf(open_tag, beginsearchpos); + if(tagbegin == -1) { + break; + } + + var strlen = text.length; + + var inquote = ''; + var found = false; + var tagnameend = false; + var optionend = 0; + var t_char = ''; + + for(optionend = tagbegin; optionend <= strlen; optionend++) { + t_char = text.charAt(optionend); + if((t_char == '"' || t_char == "'") && inquote == '') { + inquote = t_char; + } else if((t_char == '"' || t_char == "'") && inquote == t_char) { + inquote = ''; + } else if(t_char == '>' && !inquote) { + found = true; + break; + } else if((t_char == '=' || t_char == ' ') && !tagnameend) { + tagnameend = optionend; + } + } + + if(!found) { + break; + } + if(!tagnameend) { + tagnameend = optionend; + } + + var offset = optionend - (tagbegin + open_tag_len); + var tagoptions = text.substr(tagbegin + open_tag_len, offset); + var acttagname = textlower.substr(tagbegin * 1 + 1, tagnameend - tagbegin - 1); + + if(acttagname != tagname) { + beginsearchpos = optionend; + continue; + } + + var tagend = textlower.indexOf(close_tag, optionend); + if(tagend == -1) { + break; + } + + var nestedopenpos = textlower.indexOf(open_tag, optionend); + while(nestedopenpos != -1 && tagend != -1) { + if(nestedopenpos > tagend) { + break; + } + tagend = textlower.indexOf(close_tag, tagend + close_tag_len); + nestedopenpos = textlower.indexOf(open_tag, nestedopenpos + open_tag_len); + } + + if(tagend == -1) { + beginsearchpos = optionend; + continue; + } + + var localbegin = optionend + 1; + var localtext = eval(dofunction)(tagoptions, text.substr(localbegin, tagend - localbegin), tagname, extraargs); + + text = text.substring(0, tagbegin) + localtext + text.substring(tagend + close_tag_len); + + beginsearchpos = tagbegin + localtext.length; + + } while(tagbegin != -1); + + return text; +} + +function simpletag(options, text, tagname, parseto) { + if(trim(text) == '') { + return ''; + } + text = recursion(tagname, text, 'simpletag', parseto); + return '[' + parseto + ']' + text + '[/' + parseto + ']'; +} + +function smileycode(smileyid) { + if(typeof smilies_type != 'object') return; + for(var typeid in smilies_array) { + for(var page in smilies_array[typeid]) { + for(var i in smilies_array[typeid][page]) { + if(smilies_array[typeid][page][i][0] == smileyid) { + return smilies_array[typeid][page][i][1]; + break; + } + } + } + } +} + +function strpos(haystack, needle, _offset) { + if(isUndefined(_offset)) { + _offset = 0; + } + + var _index = haystack.toLowerCase().indexOf(needle.toLowerCase(), _offset); + + return _index == -1 ? false : _index; +} + +function tabletag(attributes) { + var width = ''; + re = /width=(["']?)(\d{1,4}%?)(\1)/i; + var matches = re.exec(attributes); + + if(matches != null) { + width = matches[2].substr(matches[2].length - 1, matches[2].length) == '%' ? + (matches[2].substr(0, matches[2].length - 1) <= 98 ? matches[2] : '98%') : + (matches[2] <= 560 ? matches[2] : '98%'); + } else { + re = /width\s?:\s?(\d{1,4})([px|%])/i; + var matches = re.exec(attributes); + if(matches != null) { + width = matches[2] == '%' ? (matches[1] <= 98 ? matches[1] + '%' : '98%') : (matches[1] <= 560 ? matches[1] : '98%'); + } + } + + var bgcolor = ''; + re = /(?:background|background-color|bgcolor)[:=]\s*(["']?)((rgb\(\d{1,3}%?,\s*\d{1,3}%?,\s*\d{1,3}%?\))|(#[0-9a-fA-F]{3,6})|([a-zA-Z]{1,20}))(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + bgcolor = matches[2]; + width = width ? width : '98%'; + } + + return bgcolor ? '[table=' + width + ',' + bgcolor + ']\n' : (width ? '[table=' + width + ']\n' : '[table]\n'); +} + +function tdtag(attributes) { + + var colspan = 1; + var rowspan = 1; + var width = ''; + + re = /colspan=(["']?)(\d{1,2})(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + colspan = matches[2]; + } + + re = /rowspan=(["']?)(\d{1,2})(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + rowspan = matches[2]; + } + + re = /width=(["']?)(\d{1,4}%?)(\1)/i; + var matches = re.exec(attributes); + if(matches != null) { + width = matches[2]; + } + + return in_array(width, ['', '0', '100%']) ? + (colspan == 1 && rowspan == 1 ? '[td]' : '[td=' + colspan + ',' + rowspan + ']') : + (colspan == 1 && rowspan == 1 ? '[td=' + width + ']' : '[td=' + colspan + ',' + rowspan + ',' + width + ']'); +} + +if(typeof jsloaded == 'function') { + jsloaded('bbcode'); +} \ No newline at end of file diff --git a/static/js/calendar.js b/static/js/calendar.js new file mode 100644 index 0000000..f38e39e --- /dev/null +++ b/static/js/calendar.js @@ -0,0 +1,249 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: calendar.js 33082 2013-04-18 11:13:53Z zhengqingpeng $ +*/ + +var controlid = null; +var currdate = null; +var startdate = null; +var enddate = null; +var halfhour = false; +var yy = null; +var mm = null; +var hh = null; +var ii = null; +var currday = null; +var addtime = false; +var today = new Date(); +var lastcheckedyear = false; +var lastcheckedmonth = false; +var calendarrecall = null; + +function loadcalendar() { + s = ''; + s += ''; + s += ''; + s += ''; + if(BROWSER.ie && BROWSER.ie < 7) { + s += ''; + s += ''; + s += ''; + } + + var div = document.createElement('div'); + div.innerHTML = s; + $('append_parent').appendChild(div); + document.onclick = function(event) { + closecalendar(event); + }; + $('calendar').onclick = function(event) { + doane(event); + $('calendar_year').style.display = 'none'; + $('calendar_month').style.display = 'none'; + if(BROWSER.ie && BROWSER.ie < 7) { + $('calendariframe_year').style.display = 'none'; + $('calendariframe_month').style.display = 'none'; + } + }; +} +function closecalendar(event) { + $('calendar').style.display = 'none'; + $('calendar_year').style.display = 'none'; + $('calendar_month').style.display = 'none'; + if(BROWSER.ie && BROWSER.ie < 7) { + $('calendariframe').style.display = 'none'; + $('calendariframe_year').style.display = 'none'; + $('calendariframe_month').style.display = 'none'; + } +} + +function parsedate(s) { + /(\d+)\-(\d+)\-(\d+)\s*(\d*):?(\d*)/.exec(s); + var m1 = (RegExp.$1 && RegExp.$1 > 1899 && RegExp.$1 < 2101) ? parseFloat(RegExp.$1) : today.getFullYear(); + var m2 = (RegExp.$2 && (RegExp.$2 > 0 && RegExp.$2 < 13)) ? parseFloat(RegExp.$2) : today.getMonth() + 1; + var m3 = (RegExp.$3 && (RegExp.$3 > 0 && RegExp.$3 < 32)) ? parseFloat(RegExp.$3) : today.getDate(); + var m4 = (RegExp.$4 && (RegExp.$4 > -1 && RegExp.$4 < 24)) ? parseFloat(RegExp.$4) : 0; + var m5 = (RegExp.$5 && (RegExp.$5 > -1 && RegExp.$5 < 60)) ? parseFloat(RegExp.$5) : 0; + /(\d+)\-(\d+)\-(\d+)\s*(\d*):?(\d*)/.exec("0000-00-00 00\:00"); + return new Date(m1, m2 - 1, m3, m4, m5); +} + +function settime(d) { + if(!addtime) { + $('calendar').style.display = 'none'; + $('calendar_month').style.display = 'none'; + if(BROWSER.ie && BROWSER.ie < 7) { + $('calendariframe').style.display = 'none'; + } + } + controlid.value = yy + "-" + zerofill(mm + 1) + "-" + zerofill(d) + (addtime ? ' ' + zerofill($('hour').value) + ':' + zerofill($((halfhour) ? 'minutehalfhourly' : 'minute').value) : ''); + if(typeof calendarrecall == 'function') { + calendarrecall(); + } else { + eval(calendarrecall); + } +} + +function confirmcalendar() { + if(addtime && controlid.value === '') { + controlid.value = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate() + ' ' + zerofill($('hour').value) + ':' + zerofill($((halfhour) ? 'minutehalfhourly' : 'minute').value); + } + closecalendar(); +} + +function initclosecalendar() { + var e = getEvent(); + var aim = e.target || e.srcElement; + while (aim.parentNode != document.body) { + if (aim.parentNode.id == 'append_parent') { + aim.onclick = function () {closecalendar(e);}; + } + aim = aim.parentNode; + } +} +function showcalendar(event, controlid1, addtime1, startdate1, enddate1, halfhour1, recall) { + controlid = controlid1; + addtime = addtime1; + startdate = startdate1 ? parsedate(startdate1) : false; + enddate = enddate1 ? parsedate(enddate1) : false; + currday = controlid.value ? parsedate(controlid.value) : today; + hh = currday.getHours(); + ii = currday.getMinutes(); + halfhour = halfhour1 ? true : false; + calendarrecall = recall ? recall : null; + var p = fetchOffset(controlid); + $('calendar').style.display = 'block'; + $('calendar').style.left = p['left']+'px'; + $('calendar').style.top = (p['top'] + 20)+'px'; + doane(event); + refreshcalendar(currday.getFullYear(), currday.getMonth()); + if(lastcheckedyear != false) { + $('calendar_year_' + lastcheckedyear).className = 'calendar_default'; + $('calendar_year_' + today.getFullYear()).className = 'calendar_today'; + } + if(lastcheckedmonth != false) { + $('calendar_month_' + lastcheckedmonth).className = 'calendar_default'; + $('calendar_month_' + (today.getMonth() + 1)).className = 'calendar_today'; + } + $('calendar_year_' + currday.getFullYear()).className = 'calendar_checked'; + $('calendar_month_' + (currday.getMonth() + 1)).className = 'calendar_checked'; + $('hourminute').style.display = addtime ? '' : 'none'; + lastcheckedyear = currday.getFullYear(); + lastcheckedmonth = currday.getMonth() + 1; + if(halfhour) { + $('halfhourselector').style.display = ''; + $('fullhourselector').style.display = 'none'; + } else { + $('halfhourselector').style.display = 'none'; + $('fullhourselector').style.display = ''; + } + if(BROWSER.ie && BROWSER.ie < 7) { + $('calendariframe').style.top = $('calendar').style.top; + $('calendariframe').style.left = $('calendar').style.left; + $('calendariframe').style.width = $('calendar').offsetWidth; + $('calendariframe').style.height = $('calendar').offsetHeight; + $('calendariframe').style.display = 'block'; + } + initclosecalendar(); +} + +function refreshcalendar(y, m) { + var x = new Date(y, m, 1); + var mv = x.getDay(); + var d = x.getDate(); + var dd = null; + yy = x.getFullYear(); + mm = x.getMonth(); + $("year").innerHTML = yy; + $("month").innerHTML = mm + 1 > 9 ? (mm + 1) : '0' + (mm + 1); + + for(var i = 1; i <= mv; i++) { + dd = $("d" + i); + dd.innerHTML = " "; + dd.className = ""; + } + + while(x.getMonth() == mm) { + dd = $("d" + (d + mv)); + dd.style.cursor = 'pointer'; + dd.onclick = function () { + settime(this.childNodes[0].innerHTML); + doane(); + }; + dd.innerHTML = '' + d + ''; + if(x.getTime() < today.getTime() || (enddate && x.getTime() > enddate.getTime()) || (startdate && x.getTime() < startdate.getTime())) { + dd.className = 'calendar_expire'; + } else { + dd.className = 'calendar_default'; + } + if(x.getFullYear() == today.getFullYear() && x.getMonth() == today.getMonth() && x.getDate() == today.getDate()) { + dd.className = 'calendar_today'; + dd.firstChild.title = '今天'; + } + if(x.getFullYear() == currday.getFullYear() && x.getMonth() == currday.getMonth() && x.getDate() == currday.getDate()) { + dd.className = 'calendar_checked'; + } + x.setDate(++d); + } + + while(d + mv <= 42) { + dd = $("d" + (d + mv)); + dd.innerHTML = " "; + d++; + } + + if(addtime) { + $('hour').value = zerofill(hh); + $('minute').value = zerofill(ii); + } +} + +function showdiv(id) { + var p = fetchOffset($(id)); + $('calendar_' + id).style.left = p['left']+'px'; + $('calendar_' + id).style.top = (p['top'] + 16)+'px'; + $('calendar_' + id).style.display = 'block'; + if(BROWSER.ie && BROWSER.ie < 7) { + $('calendariframe_' + id).style.top = $('calendar_' + id).style.top; + $('calendariframe_' + id).style.left = $('calendar_' + id).style.left; + $('calendariframe_' + id).style.width = $('calendar_' + id).offsetWidth; + $('calendariframe_' + id ).style.height = $('calendar_' + id).offsetHeight; + $('calendariframe_' + id).style.display = 'block'; + } +} + +function zerofill(s) { + var s = parseFloat(s.toString().replace(/(^[\s0]+)|(\s+$)/g, '')); + s = isNaN(s) ? 0 : s; + return (s < 10 ? '0' : '') + s.toString(); +} + +if(!BROWSER.other) { + loadcss('forum_calendar'); + loadcalendar(); +} \ No newline at end of file diff --git a/static/js/common.js b/static/js/common.js new file mode 100644 index 0000000..1bf1627 --- /dev/null +++ b/static/js/common.js @@ -0,0 +1,2329 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: common.js 36359 2017-01-20 05:06:45Z nemohou $ +*/ + +function $(id) { + return !id ? null : document.getElementById(id); +} + +function getID(id) { + return !id ? null : document.getElementById(id); +} + +function $C(classname, ele, tag) { + var returns = []; + ele = ele || document; + tag = tag || '*'; + if(ele.getElementsByClassName) { + var eles = ele.getElementsByClassName(classname); + if(tag != '*') { + for (var i = 0, L = eles.length; i < L; i++) { + if (eles[i].tagName.toLowerCase() == tag.toLowerCase()) { + returns.push(eles[i]); + } + } + } else { + returns = eles; + } + }else { + eles = ele.getElementsByTagName(tag); + var pattern = new RegExp("(^|\\s)"+classname+"(\\s|$)"); + for (i = 0, L = eles.length; i < L; i++) { + if (pattern.test(eles[i].className)) { + returns.push(eles[i]); + } + } + } + return returns; +} + +function _attachEvent(obj, evt, func, eventobj) { + eventobj = !eventobj ? obj : eventobj; + if(obj.addEventListener) { + obj.addEventListener(evt, func, false); + } else if(eventobj.attachEvent) { + obj.attachEvent('on' + evt, func); + } +} + +function _detachEvent(obj, evt, func, eventobj) { + eventobj = !eventobj ? obj : eventobj; + if(obj.removeEventListener) { + obj.removeEventListener(evt, func, false); + } else if(eventobj.detachEvent) { + obj.detachEvent('on' + evt, func); + } +} + +function browserVersion(types) { + var other = 1; + for(i in types) { + var v = types[i] ? types[i] : i; + if(USERAGENT.indexOf(v) != -1) { + var re = new RegExp(v + '(\\/|\\s|:)([\\d\\.]+)', 'ig'); + var matches = re.exec(USERAGENT); + var ver = matches != null ? matches[2] : 0; + other = ver !== 0 && v != 'mozilla' ? 0 : other; + }else { + var ver = 0; + } + eval('BROWSER.' + i + '= ver'); + } + BROWSER.other = other; +} + +function getEvent() { + if(document.all) return window.event; + func = getEvent.caller; + while(func != null) { + var arg0 = func.arguments[0]; + if (arg0) { + if((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof(arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) { + return arg0; + } + } + func=func.caller; + } + return null; +} + +function isUndefined(variable) { + return typeof variable == 'undefined' ? true : false; +} + +function in_array(needle, haystack) { + if(typeof needle == 'string' || typeof needle == 'number') { + for(var i in haystack) { + if(haystack[i] == needle) { + return true; + } + } + } + return false; +} + +function trim(str) { + return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, ''); +} + +function strlen(str) { + return (BROWSER.ie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length; +} + +function mb_strlen(str) { + var len = 0; + for(var i = 0; i < str.length; i++) { + len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1; + } + return len; +} + +function dstrlen(str) { + var count = 0; + for(var i = 0; i < strlen(str); i++) { + value = str.charCodeAt(i); + if(value > 127) { + count++; + if(value >= 55296 && value <= 57343) { + i++; + } + } + count++; + } + return count; +} + +function mb_cutstr(str, maxlen, dot) { + var len = 0; + var ret = ''; + var dot = !dot ? '...' : dot; + maxlen = maxlen - dot.length; + for(var i = 0; i < str.length; i++) { + len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1; + if(len > maxlen) { + ret += dot; + break; + } + ret += str.substr(i, 1); + } + return ret; +} + +function dcutstr(str, maxlen) { + var len = 0; + var ret = ''; + var dot = arguments.length > 2 && arguments[2] !== undefined && arguments[2] !== false ? arguments[2] : '...'; + var flag = true; + var strmaxlen = maxlen - dot.length; + for(var i = 0; i < strlen(str); i++) { + value = str.charCodeAt(i); + if(value > 127) { + len++; + } + len++; + if(flag && len > strmaxlen) { + flag = false; + ret = str.substr(0, i); + ret += dot; + } + if(len > maxlen) { + break; + } + if(value >= 55296 && value <= 57343) { + i++; + } + } + if(len > maxlen) { + return ret; + } else { + return str; + } +} + +function preg_replace(search, replace, str, regswitch) { + var regswitch = !regswitch ? 'ig' : regswitch; + var len = search.length; + for(var i = 0; i < len; i++) { + re = new RegExp(search[i], regswitch); + str = str.replace(re, typeof replace == 'string' ? replace : (replace[i] ? replace[i] : replace[0])); + } + return str; +} + +function htmlspecialchars(str) { + return preg_replace(['&', '<', '>', '"'], ['&', '<', '>', '"'], str); +} + +function display(id) { + var obj = $(id); + if(obj.style.visibility) { + obj.style.visibility = obj.style.visibility == 'visible' ? 'hidden' : 'visible'; + } else { + obj.style.display = obj.style.display == '' ? 'none' : ''; + } +} + +function checkall(form, prefix, checkall) { + var checkall = checkall ? checkall : 'chkall'; + count = 0; + for(var i = 0; i < form.elements.length; i++) { + var e = form.elements[i]; + if(e.name && e.name != checkall && !e.disabled && (!prefix || (prefix && e.name.match(prefix)))) { + e.checked = form.elements[checkall].checked; + if(e.checked) { + count++; + } + } + } + return count; +} + +function setcookie(cookieName, cookieValue, seconds, path, domain, secure) { + if(cookieValue == '' || seconds < 0) { + cookieValue = ''; + seconds = -2592000; + } + if(seconds) { + var expires = new Date(); + expires.setTime(expires.getTime() + seconds * 1000); + } + domain = !domain ? cookiedomain : domain; + path = !path ? cookiepath : path; + document.cookie = escape(cookiepre + cookieName) + '=' + escape(cookieValue) + + (expires ? '; expires=' + expires.toGMTString() : '') + + '; path=' + (path ? path : '/') + + (domain ? '; domain=' + domain : '') + + (secure ? '; secure' : ''); +} + +function getcookie(name, nounescape) { + name = cookiepre + name; + var cookie_start = document.cookie.indexOf(name); + var cookie_end = document.cookie.indexOf(";", cookie_start); + if(cookie_start == -1) { + return ''; + } else { + var v = document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)); + return !nounescape ? unescape(v) : v; + } +} + +function Ajax(recvType, waitId) { + var aj = new Object(); + aj.loading = '请稍候...'; + aj.recvType = recvType ? recvType : 'XML'; + aj.waitId = waitId ? $(waitId) : null; + aj.resultHandle = null; + aj.sendString = ''; + aj.targetUrl = ''; + aj.setLoading = function(loading) { + if(typeof loading !== 'undefined' && loading !== null) aj.loading = loading; + }; + aj.setRecvType = function(recvtype) { + aj.recvType = recvtype; + }; + aj.setWaitId = function(waitid) { + aj.waitId = typeof waitid == 'object' ? waitid : $(waitid); + }; + aj.createXMLHttpRequest = function() { + var request = false; + if(window.XMLHttpRequest) { + request = new XMLHttpRequest(); + if(request.overrideMimeType) { + request.overrideMimeType('text/xml'); + } + } else if(window.ActiveXObject) { + var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP']; + for(var i=0; i'; + } + }; + aj.processHandle = function() { + if(aj.XMLHttpRequest.readyState == 4 && aj.XMLHttpRequest.status == 200) { + if(aj.waitId) { + aj.waitId.style.display = 'none'; + } + if(aj.recvType == 'HTML') { + aj.resultHandle(aj.XMLHttpRequest.responseText, aj); + } else if(aj.recvType == 'XML') { + if(!aj.XMLHttpRequest.responseXML || !aj.XMLHttpRequest.responseXML.lastChild || aj.XMLHttpRequest.responseXML.lastChild.localName == 'parsererror') { + aj.resultHandle('' , aj); + } else { + aj.resultHandle(aj.XMLHttpRequest.responseXML.lastChild.firstChild.nodeValue, aj); + } + } else if(aj.recvType == 'JSON') { + var s = null; + try { + s = (new Function("return ("+aj.XMLHttpRequest.responseText+")"))(); + } catch (e) { + s = null; + } + aj.resultHandle(s, aj); + } + } + }; + aj.get = function(targetUrl, resultHandle) { + targetUrl = hostconvert(targetUrl); + setTimeout(function(){aj.showLoading()}, 250); + aj.targetUrl = targetUrl; + aj.XMLHttpRequest.onreadystatechange = aj.processHandle; + aj.resultHandle = resultHandle; + var attackevasive = isUndefined(attackevasive) ? 0 : attackevasive; + if(window.XMLHttpRequest) { + aj.XMLHttpRequest.open('GET', aj.targetUrl); + aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + aj.XMLHttpRequest.send(null); + } else { + aj.XMLHttpRequest.open("GET", targetUrl, true); + aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + aj.XMLHttpRequest.send(); + } + }; + aj.post = function(targetUrl, sendString, resultHandle) { + targetUrl = hostconvert(targetUrl); + setTimeout(function(){aj.showLoading()}, 250); + aj.targetUrl = targetUrl; + aj.sendString = sendString; + aj.XMLHttpRequest.onreadystatechange = aj.processHandle; + aj.resultHandle = resultHandle; + aj.XMLHttpRequest.open('POST', targetUrl); + aj.XMLHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + aj.XMLHttpRequest.send(aj.sendString); + }; + aj.getJSON = function(targetUrl, resultHandle) { + aj.setRecvType('JSON'); + aj.get(targetUrl+'&ajaxdata=json', resultHandle); + }; + aj.getHTML = function(targetUrl, resultHandle) { + aj.setRecvType('HTML'); + aj.get(targetUrl+'&ajaxdata=html', resultHandle); + }; + return aj; +} + +function getHost(url) { + var host = "null"; + if(typeof url == "undefined"|| null == url) { + url = window.location.href; + } + var regex = /^\w+\:\/\/([^\/]*).*/; + var match = url.match(regex); + if(typeof match != "undefined" && null != match) { + host = match[1]; + } + return host; +} + +function hostconvert(url) { + if(!url.match(/^https?:\/\//)) url = SITEURL + url; + var url_host = getHost(url); + var cur_host = getHost().toLowerCase(); + if(url_host && cur_host != url_host) { + url = url.replace(url_host, cur_host); + } + return url; +} + +function newfunction(func) { + var args = []; + for(var i=1; i]*?>([^\x00]*?)<\/script>/ig; + var arr = []; + while(arr = p.exec(s)) { + var p1 = /]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i; + var arr1 = []; + arr1 = p1.exec(arr[0]); + if(arr1) { + appendscript(arr1[1], '', arr1[2], arr1[3]); + } else { + p1 = /([^\x00]+?)<\/script>/i; + arr1 = p1.exec(arr[0]); + appendscript('', arr1[2], arr1[1].indexOf('reload=') != -1); + } + } + return s; +} + + +function safescript(id, call, seconds, times, timeoutcall, endcall, index) { + seconds = seconds || 1000; + times = times || 0; + var checked = true; + try { + if(typeof call == 'function') { + call(); + } else { + eval(call); + } + } catch(e) { + checked = false; + } + if(!checked) { + if(!safescripts[id] || !index) { + safescripts[id] = safescripts[id] || []; + safescripts[id].push({ + 'times':0, + 'si':setInterval(function () { + safescript(id, call, seconds, times, timeoutcall, endcall, safescripts[id].length); + }, seconds) + }); + } else { + index = (index || 1) - 1; + safescripts[id][index]['times']++; + if(safescripts[id][index]['times'] >= times) { + clearInterval(safescripts[id][index]['si']); + if(typeof timeoutcall == 'function') { + timeoutcall(); + } else { + eval(timeoutcall); + } + } + } + } else { + try { + index = (index || 1) - 1; + if(safescripts[id][index]['si']) { + clearInterval(safescripts[id][index]['si']); + } + if(typeof endcall == 'function') { + endcall(); + } else { + eval(endcall); + } + } catch(e) {} + } +} + +function $F(func, args, script) { + var run = function () { + var argc = args.length, s = ''; + for(i = 0;i < argc;i++) { + s += ',args[' + i + ']'; + } + eval('var check = typeof ' + func + ' == \'function\''); + if(check) { + eval(func + '(' + s.substr(1) + ')'); + } else { + setTimeout(function () {checkrun();}, 50); + } + }; + var checkrun = function () { + if(JSLOADED[src]) { + run(); + } else { + setTimeout(function () {checkrun();}, 50); + } + }; + script = script || 'common_extra'; + src = JSPATH + script + '.js?' + VERHASH; + if(!JSLOADED[src]) { + appendscript(src); + } + return checkrun(); +} + +function appendscript(src, text, reload, charset) { + var id = hash(src + text); + if(!reload && in_array(id, evalscripts)) return; + if(reload && $(id)) { + $(id).parentNode.removeChild($(id)); + } + + evalscripts.push(id); + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.id = id; + scriptNode.charset = charset ? charset : (BROWSER.firefox ? document.characterSet : document.charset); + try { + if(src) { + scriptNode.src = src; + scriptNode.onloadDone = false; + scriptNode.onload = function () { + scriptNode.onloadDone = true; + JSLOADED[src] = 1; + }; + scriptNode.onreadystatechange = function () { + if((scriptNode.readyState == 'loaded' || scriptNode.readyState == 'complete') && !scriptNode.onloadDone) { + scriptNode.onloadDone = true; + JSLOADED[src] = 1; + } + }; + } else if(text){ + scriptNode.text = text; + } + document.getElementsByTagName('head')[0].appendChild(scriptNode); + } catch(e) {} +} + +function hash(string, length) { + var length = length ? length : 32; + var start = 0; + var i = 0; + var result = ''; + filllen = length - string.length % length; + for(i = 0; i < filllen; i++){ + string += "0"; + } + while(start < string.length) { + result = stringxor(result, string.substr(start, length)); + start += length; + } + return result; +} + +function stringxor(s1, s2) { + var s = ''; + var hash = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + var max = Math.max(s1.length, s2.length); + for(var i=0; i"); + } +} + +function showloading(display, waiting) { + var display = display ? display : 'block'; + var waiting = waiting ? waiting : '请稍候...'; + $('ajaxwaitid').innerHTML = waiting; + $('ajaxwaitid').style.display = display; +} + +function doane(event, preventDefault, stopPropagation) { + var preventDefault = isUndefined(preventDefault) ? 1 : preventDefault; + var stopPropagation = isUndefined(stopPropagation) ? 1 : stopPropagation; + e = event ? event : window.event; + if(!e) { + e = getEvent(); + } + if(!e) { + return null; + } + if(preventDefault) { + if(e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + } + if(stopPropagation) { + if(e.stopPropagation) { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } + } + return e; +} + +function loadcss(cssname) { + if(!CSSLOADED[cssname]) { + var csspath = (typeof CSSPATH == 'undefined' ? 'data/cache/style_' : CSSPATH); + if(!$('css_' + cssname)) { + css = document.createElement('link'); + css.id = 'css_' + cssname, + css.type = 'text/css'; + css.rel = 'stylesheet'; + css.href = csspath + STYLEID + '_' + cssname + '.css?' + VERHASH; + var headNode = document.getElementsByTagName("head")[0]; + headNode.appendChild(css); + } else { + $('css_' + cssname).href = csspath + STYLEID + '_' + cssname + '.css?' + VERHASH; + } + CSSLOADED[cssname] = 1; + } +} + +function showMenu(v) { + var ctrlid = isUndefined(v['ctrlid']) ? v : v['ctrlid']; + var showid = isUndefined(v['showid']) ? ctrlid : v['showid']; + var menuid = isUndefined(v['menuid']) ? showid + '_menu' : v['menuid']; + var ctrlObj = $(ctrlid); + var menuObj = $(menuid); + if(!menuObj) return; + var mtype = isUndefined(v['mtype']) ? 'menu' : v['mtype']; + var evt = isUndefined(v['evt']) ? 'mouseover' : v['evt']; + var pos = isUndefined(v['pos']) ? '43' : v['pos']; + var layer = isUndefined(v['layer']) ? 1 : v['layer']; + var duration = isUndefined(v['duration']) ? 2 : v['duration']; + var timeout = isUndefined(v['timeout']) ? 250 : v['timeout']; + var maxh = isUndefined(v['maxh']) ? 600 : v['maxh']; + var cache = isUndefined(v['cache']) ? 1 : v['cache']; + var drag = isUndefined(v['drag']) ? '' : v['drag']; + var dragobj = drag && $(drag) ? $(drag) : menuObj; + var fade = isUndefined(v['fade']) ? 0 : v['fade']; + var cover = isUndefined(v['cover']) ? 0 : v['cover']; + var zindex = isUndefined(v['zindex']) ? JSMENU['zIndex']['menu'] : v['zindex']; + var ctrlclass = isUndefined(v['ctrlclass']) ? '' : v['ctrlclass']; + var winhandlekey = isUndefined(v['win']) ? '' : v['win']; + if(winhandlekey && ctrlObj && !ctrlObj.getAttribute('fwin')) { + ctrlObj.setAttribute('fwin', winhandlekey); + } + zindex = cover ? zindex + 500 : zindex; + if(typeof JSMENU['active'][layer] == 'undefined') { + JSMENU['active'][layer] = []; + } + + for(i in EXTRAFUNC['showmenu']) { + try { + eval(EXTRAFUNC['showmenu'][i] + '()'); + } catch(e) {} + } + + if(evt == 'click' && in_array(menuid, JSMENU['active'][layer]) && mtype != 'win') { + hideMenu(menuid, mtype); + return; + } + if(mtype == 'menu') { + hideMenu(layer, mtype); + } + + if(ctrlObj) { + if(!ctrlObj.getAttribute('initialized')) { + ctrlObj.setAttribute('initialized', true); + ctrlObj.unselectable = true; + + ctrlObj.outfunc = typeof ctrlObj.onmouseout == 'function' ? ctrlObj.onmouseout : null; + ctrlObj.onmouseout = function() { + if(this.outfunc) this.outfunc(); + if(duration < 3 && !JSMENU['timer'][menuid]) { + JSMENU['timer'][menuid] = setTimeout(function () { + hideMenu(menuid, mtype); + }, timeout); + } + }; + + ctrlObj.overfunc = typeof ctrlObj.onmouseover == 'function' ? ctrlObj.onmouseover : null; + ctrlObj.onmouseover = function(e) { + doane(e); + if(this.overfunc) this.overfunc(); + if(evt == 'click') { + clearTimeout(JSMENU['timer'][menuid]); + JSMENU['timer'][menuid] = null; + } else { + for(var i in JSMENU['timer']) { + if(JSMENU['timer'][i]) { + clearTimeout(JSMENU['timer'][i]); + JSMENU['timer'][i] = null; + } + } + } + }; + } + } + + if(!menuObj.getAttribute('initialized')) { + menuObj.setAttribute('initialized', true); + menuObj.ctrlkey = ctrlid; + menuObj.mtype = mtype; + menuObj.layer = layer; + menuObj.cover = cover; + if(ctrlObj && ctrlObj.getAttribute('fwin')) {menuObj.scrolly = true;} + menuObj.style.position = 'absolute'; + menuObj.style.zIndex = zindex + layer; + menuObj.onclick = function(e) { + return doane(e, 0, 1); + }; + if(duration < 3) { + if(duration > 1) { + menuObj.onmouseover = function() { + clearTimeout(JSMENU['timer'][menuid]); + JSMENU['timer'][menuid] = null; + }; + } + if(duration != 1) { + menuObj.onmouseout = function() { + JSMENU['timer'][menuid] = setTimeout(function () { + hideMenu(menuid, mtype); + }, timeout); + }; + } + } + if(cover) { + var coverObj = document.createElement('div'); + coverObj.id = menuid + '_cover'; + coverObj.style.position = 'absolute'; + coverObj.style.zIndex = menuObj.style.zIndex - 1; + coverObj.style.left = coverObj.style.top = '0px'; + coverObj.style.width = '100%'; + coverObj.style.height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight) + 'px'; + coverObj.style.backgroundColor = '#000'; + coverObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=50)'; + coverObj.style.opacity = 0.5; + coverObj.onclick = function () {hideMenu();}; + $('append_parent').appendChild(coverObj); + _attachEvent(window, 'load', function () { + coverObj.style.height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight) + 'px'; + }, document); + } + } + if(drag) { + dragobj.style.cursor = 'move'; + dragobj.onmousedown = function(event) {try{dragMenu(menuObj, event, 1);}catch(e){}}; + } + + if(cover) $(menuid + '_cover').style.display = ''; + if(fade) { + var O = 0; + var fadeIn = function(O) { + if(O > 100) { + clearTimeout(fadeInTimer); + return; + } + menuObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + O + ')'; + menuObj.style.opacity = O / 100; + O += 20; + var fadeInTimer = setTimeout(function () { + fadeIn(O); + }, 40); + }; + fadeIn(O); + menuObj.fade = true; + } else { + menuObj.fade = false; + } + menuObj.style.display = ''; + if(ctrlObj && ctrlclass) { + ctrlObj.className += ' ' + ctrlclass; + menuObj.setAttribute('ctrlid', ctrlid); + menuObj.setAttribute('ctrlclass', ctrlclass); + } + if(pos != '*') { + setMenuPosition(showid, menuid, pos); + } + if(BROWSER.ie && BROWSER.ie < 7 && winhandlekey && $('fwin_' + winhandlekey)) { + $(menuid).style.left = (parseInt($(menuid).style.left) - parseInt($('fwin_' + winhandlekey).style.left)) + 'px'; + $(menuid).style.top = (parseInt($(menuid).style.top) - parseInt($('fwin_' + winhandlekey).style.top)) + 'px'; + } + if(maxh && menuObj.scrollHeight > maxh) { + menuObj.style.height = maxh + 'px'; + if(BROWSER.opera) { + menuObj.style.overflow = 'auto'; + } else { + menuObj.style.overflowY = 'auto'; + } + } + + if(!duration) { + setTimeout('hideMenu(\'' + menuid + '\', \'' + mtype + '\')', timeout); + } + + if(!in_array(menuid, JSMENU['active'][layer])) JSMENU['active'][layer].push(menuid); + menuObj.cache = cache; + if(layer > JSMENU['layer']) { + JSMENU['layer'] = layer; + } + var hasshow = function(ele) { + while(ele.parentNode && ((typeof(ele['currentStyle']) === 'undefined') ? window.getComputedStyle(ele,null) : ele['currentStyle'])['display'] !== 'none') { + ele = ele.parentNode; + } + if(ele === document) { + return true; + } else { + return false; + } + }; + if(!menuObj.getAttribute('disautofocus')) { + try{ + var focused = false; + var tags = ['input', 'select', 'textarea', 'button', 'a']; + for(var i = 0; i < tags.length; i++) { + var _all = menuObj.getElementsByTagName(tags[i]); + if(_all.length) { + for(j = 0; j < _all.length; j++) { + if((!_all[j]['type'] || _all[j]['type'] != 'hidden') && hasshow(_all[j])) { + if(_all[j].className.indexOf('hidefocus') == -1) { + _all[j].className += ' hidefocus'; + } + _all[j].focus(); + focused = true; + var cobj = _all[j]; + _attachEvent(_all[j], 'blur', function (){cobj.className = trim(cobj.className.replace(' hidefocus', ''));}); + break; + } + } + } + if(focused) { + break; + } + } + } catch (e) { + } + } +} +var delayShowST = null; +function delayShow(ctrlObj, call, time) { + if(typeof ctrlObj == 'object') { + var ctrlid = ctrlObj.id; + call = call || function () {showMenu(ctrlid);}; + } + var time = isUndefined(time) ? 500 : time; + delayShowST = setTimeout(function () { + if(typeof call == 'function') { + call(); + } else { + eval(call); + } + }, time); + if(!ctrlObj.delayinit) { + _attachEvent(ctrlObj, 'mouseout', function() {clearTimeout(delayShowST);}); + ctrlObj.delayinit = 1; + } +} + +var dragMenuDisabled = false; +function dragMenu(menuObj, e, op) { + e = e ? e : window.event; + if(op == 1) { + if(dragMenuDisabled || in_array(e.target ? e.target.tagName : e.srcElement.tagName, ['TEXTAREA', 'INPUT', 'BUTTON', 'SELECT'])) { + return; + } + JSMENU['drag'] = [e.clientX, e.clientY]; + JSMENU['drag'][2] = parseInt(menuObj.style.left); + JSMENU['drag'][3] = parseInt(menuObj.style.top); + document.onmousemove = function(e) {try{dragMenu(menuObj, e, 2);}catch(err){}}; + document.onmouseup = function(e) {try{dragMenu(menuObj, e, 3);}catch(err){}}; + doane(e); + }else if(op == 2 && JSMENU['drag'][0]) { + var menudragnow = [e.clientX, e.clientY]; + menuObj.style.left = (JSMENU['drag'][2] + menudragnow[0] - JSMENU['drag'][0]) + 'px'; + menuObj.style.top = (JSMENU['drag'][3] + menudragnow[1] - JSMENU['drag'][1]) + 'px'; + menuObj.removeAttribute('top_');menuObj.removeAttribute('left_'); + doane(e); + }else if(op == 3) { + JSMENU['drag'] = []; + document.onmousemove = null; + document.onmouseup = null; + } +} +function setMenuPosition(showid, menuid, pos) { + var showObj = $(showid); + var menuObj = menuid ? $(menuid) : $(showid + '_menu'); + if(isUndefined(pos) || !pos) pos = '43'; + var basePoint = parseInt(pos.substr(0, 1)); + var direction = parseInt(pos.substr(1, 1)); + var important = pos.indexOf('!') != -1 ? 1 : 0; + var sxy = 0, sx = 0, sy = 0, sw = 0, sh = 0, ml = 0, mt = 0, mw = 0, mcw = 0, mh = 0, mch = 0, bpl = 0, bpt = 0; + + if(!menuObj || (basePoint > 0 && !showObj)) return; + if(showObj) { + sxy = fetchOffset(showObj); + sx = sxy['left']; + sy = sxy['top']; + sw = showObj.offsetWidth; + sh = showObj.offsetHeight; + } + mw = menuObj.offsetWidth; + mcw = menuObj.clientWidth; + mh = menuObj.offsetHeight; + mch = menuObj.clientHeight; + + switch(basePoint) { + case 1: + bpl = sx; + bpt = sy; + break; + case 2: + bpl = sx + sw; + bpt = sy; + break; + case 3: + bpl = sx + sw; + bpt = sy + sh; + break; + case 4: + bpl = sx; + bpt = sy + sh; + break; + } + switch(direction) { + case 0: + menuObj.style.left = (document.body.clientWidth - menuObj.clientWidth) / 2 + 'px'; + mt = (document.documentElement.clientHeight - menuObj.clientHeight) / 2; + break; + case 1: + ml = bpl - mw; + mt = bpt - mh; + break; + case 2: + ml = bpl; + mt = bpt - mh; + break; + case 3: + ml = bpl; + mt = bpt; + break; + case 4: + ml = bpl - mw; + mt = bpt; + break; + } + var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); + if(!important) { + if(in_array(direction, [1, 4]) && ml < 0) { + ml = bpl; + if(in_array(basePoint, [1, 4])) ml += sw; + } else if(ml + mw > scrollLeft + document.body.clientWidth && sx >= mw) { + ml = bpl - mw; + if(in_array(basePoint, [2, 3])) { + ml -= sw; + } else if(basePoint == 4) { + ml += sw; + } + } + if(in_array(direction, [1, 2]) && mt < 0) { + mt = bpt; + if(in_array(basePoint, [1, 2])) mt += sh; + } else if(mt + mh > scrollTop + document.documentElement.clientHeight && sy >= mh) { + mt = bpt - mh; + if(in_array(basePoint, [3, 4])) mt -= sh; + } + } + if(pos.substr(0, 3) == '210') { + ml += 69 - sw / 2; + mt -= 5; + if(showObj.tagName == 'TEXTAREA') { + ml -= sw / 2; + mt += sh / 2; + } + } + if(direction == 0 || menuObj.scrolly) { + if(BROWSER.ie && BROWSER.ie < 7) { + if(direction == 0) mt += scrollTop; + } else { + if(menuObj.scrolly) mt -= scrollTop; + menuObj.style.position = 'fixed'; + } + } + if(ml) menuObj.style.left = ml + 'px'; + if(mt) menuObj.style.top = mt + 'px'; + if(direction == 0 && BROWSER.ie && !document.documentElement.clientHeight) { + menuObj.style.position = 'absolute'; + menuObj.style.top = (document.body.clientHeight - menuObj.clientHeight) / 2 + 'px'; + } + if(menuObj.style.clip && !BROWSER.opera) { + menuObj.style.clip = 'rect(auto, auto, auto, auto)'; + } +} + +function hideMenu(attr, mtype) { + attr = isUndefined(attr) ? '' : attr; + mtype = isUndefined(mtype) ? 'menu' : mtype; + if(attr == '') { + for(var i = 1; i <= JSMENU['layer']; i++) { + hideMenu(i, mtype); + } + return; + } else if(typeof attr == 'number') { + for(var j in JSMENU['active'][attr]) { + hideMenu(JSMENU['active'][attr][j], mtype); + } + return; + }else if(typeof attr == 'string') { + var menuObj = $(attr); + if(!menuObj || (mtype && menuObj.mtype != mtype)) return; + var ctrlObj = '', ctrlclass = ''; + if((ctrlObj = $(menuObj.getAttribute('ctrlid'))) && (ctrlclass = menuObj.getAttribute('ctrlclass'))) { + var reg = new RegExp(' ' + ctrlclass); + ctrlObj.className = ctrlObj.className.replace(reg, ''); + } + clearTimeout(JSMENU['timer'][attr]); + var hide = function() { + if(menuObj.cache) { + if(menuObj.style.visibility != 'hidden') { + menuObj.style.display = 'none'; + if(menuObj.cover) $(attr + '_cover').style.display = 'none'; + } + }else { + menuObj.parentNode.removeChild(menuObj); + if(menuObj.cover) $(attr + '_cover').parentNode.removeChild($(attr + '_cover')); + } + var tmp = []; + for(var k in JSMENU['active'][menuObj.layer]) { + if(attr != JSMENU['active'][menuObj.layer][k]) tmp.push(JSMENU['active'][menuObj.layer][k]); + } + JSMENU['active'][menuObj.layer] = tmp; + }; + if(menuObj.fade) { + var O = 100; + var fadeOut = function(O) { + if(O == 0) { + clearTimeout(fadeOutTimer); + hide(); + return; + } + menuObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + O + ')'; + menuObj.style.opacity = O / 100; + O -= 20; + var fadeOutTimer = setTimeout(function () { + fadeOut(O); + }, 40); + }; + fadeOut(O); + } else { + hide(); + } + } +} + +function getCurrentStyle(obj, cssproperty, csspropertyNS) { + if(obj.style[cssproperty]){ + return obj.style[cssproperty]; + } + if (obj.currentStyle) { + return obj.currentStyle[cssproperty]; + } else if (document.defaultView.getComputedStyle(obj, null)) { + var currentStyle = document.defaultView.getComputedStyle(obj, null); + var value = currentStyle.getPropertyValue(csspropertyNS); + if(!value){ + value = currentStyle[cssproperty]; + } + return value; + } else if (window.getComputedStyle) { + var currentStyle = window.getComputedStyle(obj, ""); + return currentStyle.getPropertyValue(csspropertyNS); + } +} + +function fetchOffset(obj, mode) { + var left_offset = 0, top_offset = 0, mode = !mode ? 0 : mode; + + if(obj.getBoundingClientRect && !mode) { + var rect = obj.getBoundingClientRect(); + var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); + if(document.documentElement.dir == 'rtl') { + scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth; + } + left_offset = rect.left + scrollLeft - document.documentElement.clientLeft; + top_offset = rect.top + scrollTop - document.documentElement.clientTop; + } + if(left_offset <= 0 || top_offset <= 0) { + left_offset = obj.offsetLeft; + top_offset = obj.offsetTop; + while((obj = obj.offsetParent) != null) { + position = getCurrentStyle(obj, 'position', 'position'); + if(position == 'relative') { + continue; + } + left_offset += obj.offsetLeft; + top_offset += obj.offsetTop; + } + } + return {'left' : left_offset, 'top' : top_offset}; +} + +function showTip(ctrlobj) { + $F('_showTip', arguments); +} + +function showPrompt(ctrlid, evt, msg, timeout, classname) { + $F('_showPrompt', arguments); +} + +function showCreditPrompt() { + $F('_showCreditPrompt', []); +} + +var showDialogST = null; +function showDialog(msg, mode, t, func, cover, funccancel, leftmsg, confirmtxt, canceltxt, closetime, locationtime) { + clearTimeout(showDialogST); + cover = isUndefined(cover) ? (mode == 'info' ? 0 : 1) : cover; + leftmsg = isUndefined(leftmsg) ? '' : leftmsg; + mode = in_array(mode, ['confirm', 'notice', 'info', 'right']) ? mode : 'alert'; + var menuid = 'fwin_dialog'; + var menuObj = $(menuid); + var showconfirm = 1; + confirmtxtdefault = '确定'; + closetime = isUndefined(closetime) ? '' : closetime; + closefunc = function () { + if(typeof func == 'function') func(); + else eval(func); + hideMenu(menuid, 'dialog'); + }; + if(closetime) { + showPrompt(null, null, '' + msg + '', closetime * 1000, 'popuptext'); + return; + } + locationtime = isUndefined(locationtime) ? '' : locationtime; + if(locationtime) { + leftmsg = locationtime + ' 秒后页面跳转'; + showDialogST = setTimeout(closefunc, locationtime * 1000); + showconfirm = 0; + } + confirmtxt = confirmtxt ? confirmtxt : confirmtxtdefault; + canceltxt = canceltxt ? canceltxt : '取消'; + + if(menuObj) hideMenu('fwin_dialog', 'dialog'); + menuObj = document.createElement('div'); + menuObj.style.display = 'none'; + menuObj.className = 'fwinmask'; + menuObj.id = menuid; + $('append_parent').appendChild(menuObj); + var hidedom = ''; + if(!BROWSER.ie) { + hidedom = ''; + } + var s = hidedom + '
                    

                  '; + s += t ? t : '提示信息'; + s += '关闭

                  '; + if(mode == 'info') { + s += msg ? msg : ''; + } else { + s += '

                  ' + msg + '

                  '; + s += '

                  ' + (leftmsg ? '' + leftmsg + '' : '') + (showconfirm ? '' : ''); + s += mode == 'confirm' ? '' : ''; + s += '

                  '; + } + s += '
                  '; + menuObj.innerHTML = s; + if($('fwin_dialog_submit')) $('fwin_dialog_submit').onclick = function() { + if(typeof func == 'function') func(); + else eval(func); + hideMenu(menuid, 'dialog'); + }; + if($('fwin_dialog_cancel')) { + $('fwin_dialog_cancel').onclick = function() { + if(typeof funccancel == 'function') funccancel(); + else eval(funccancel); + hideMenu(menuid, 'dialog'); + }; + $('fwin_dialog_close').onclick = $('fwin_dialog_cancel').onclick; + } + showMenu({'mtype':'dialog','menuid':menuid,'duration':3,'pos':'00','zindex':JSMENU['zIndex']['dialog'],'cache':0,'cover':cover}); + try { + if($('fwin_dialog_submit')) $('fwin_dialog_submit').focus(); + } catch(e) {} +} + +function showWindow(k, url, mode, cache, menuv) { + mode = isUndefined(mode) ? 'get' : mode; + cache = isUndefined(cache) ? 1 : cache; + var menuid = 'fwin_' + k; + var menuObj = $(menuid); + var drag = null; + var loadingst = null; + var hidedom = ''; + + if(disallowfloat && disallowfloat.indexOf(k) != -1) { + if(BROWSER.ie) url += (url.indexOf('?') != -1 ? '&' : '?') + 'referer=' + escape(location.href); + location.href = url; + doane(); + return; + } + + var fetchContent = function() { + if(mode == 'get') { + menuObj.url = url; + url += (url.search(/\?/) > 0 ? '&' : '?') + 'infloat=yes&handlekey=' + k; + url += cache == -1 ? '&t='+(+ new Date()) : ''; + if(BROWSER.ie && url.indexOf('referer=') < 0) { + url = url + '&referer=' + encodeURIComponent(location); + } + ajaxget(url, 'fwin_content_' + k, null, '', '', function() {initMenu();show();}); + } else if(mode == 'post') { + menuObj.act = $(url).action; + ajaxpost(url, 'fwin_content_' + k, '', '', '', function() {initMenu();show();}); + } + if(parseInt(BROWSER.ie) != 6) { + loadingst = setTimeout(function() {showDialog('', 'info', '
                  请稍候...')}, 500); + } + }; + var initMenu = function() { + clearTimeout(loadingst); + var objs = menuObj.getElementsByTagName('*'); + var fctrlidinit = false; + for(var i = 0; i < objs.length; i++) { + if(objs[i].id) { + objs[i].setAttribute('fwin', k); + } + if(objs[i].className == 'flb' && !fctrlidinit) { + if(!objs[i].id) objs[i].id = 'fctrl_' + k; + drag = objs[i].id; + fctrlidinit = true; + } + } + }; + var show = function() { + hideMenu('fwin_dialog', 'dialog'); + v = {'mtype':'win','menuid':menuid,'duration':3,'pos':'00','zindex':JSMENU['zIndex']['win'],'drag':typeof drag == null ? '' : drag,'cache':cache}; + for(k in menuv) { + v[k] = menuv[k]; + } + showMenu(v); + }; + + if(!menuObj) { + menuObj = document.createElement('div'); + menuObj.id = menuid; + menuObj.className = 'fwinmask'; + menuObj.style.display = 'none'; + $('append_parent').appendChild(menuObj); + evt = ' style="cursor:move" onmousedown="dragMenu($(\'' + menuid + '\'), event, 1)" ondblclick="hideWindow(\'' + k + '\')"'; + if(!BROWSER.ie) { + hidedom = ''; + } + menuObj.innerHTML = hidedom + '
                    ' + + '
                  '; + if(mode == 'html') { + $('fwin_content_' + k).innerHTML = url; + initMenu(); + show(); + } else { + fetchContent(); + } + } else if((mode == 'get' && (url != menuObj.url || cache != 1)) || (mode == 'post' && $(url).action != menuObj.act)) { + fetchContent(); + } else { + show(); + } + doane(); +} + +function showError(msg) { + var p = /]*?>([^\x00]*?)<\/script>/ig; + msg = msg.replace(p, ''); + if(msg !== '') { + showDialog(msg, 'alert', '错误信息', null, true, null, '', '', '', 3); + } +} + +function hideWindow(k, all, clear) { + all = isUndefined(all) ? 1 : all; + clear = isUndefined(clear) ? 1 : clear; + hideMenu('fwin_' + k, 'win'); + if(clear && $('fwin_' + k)) { + $('append_parent').removeChild($('fwin_' + k)); + } + if(all) { + hideMenu(); + } +} + +function AC_FL_RunContent() { + var str = ''; + var ret = AC_GetArgs(arguments, "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash"); + if(BROWSER.ie && !BROWSER.opera) { + str += ' '; + } + str += ''; + } else { + str += '' + defaultopt + ''; + + menuObj.id = selectId + '_ctrl_menu'; + menuObj.className = 'sltm'; + menuObj.style.display = 'none'; + menuObj.style.width = selectwidth; + menuObj.appendChild(ul); + $('append_parent').appendChild(menuObj); + + $(selectId + '_ctrl').onclick = function(e) { + $(selectId + '_ctrl_menu').style.width = selectwidth; + showMenu({'ctrlid':(selectId == 'loginfield' ? 'account' : selectId + '_ctrl'),'menuid':selectId + '_ctrl_menu','evt':'click','pos':'43'}); + doane(e); + }; + $(selectId + '_ctrl').onfocus = menuObj.onfocus = function() { + _attachEvent(document.body, 'keydown', handleKeyDown); + }; + $(selectId + '_ctrl').onblur = menuObj.onblur = function() { + _detachEvent(document.body, 'keydown', handleKeyDown); + }; + $(selectId + '_ctrl').onkeyup = function(e) { + e = e ? e : window.event; + value = e.keyCode; + if(value == 40 || value == 38) { + if(menuObj.style.display == 'none') { + $(selectId + '_ctrl').onclick(); + } else { + lis = menuObj.getElementsByTagName('li'); + selecti = selectObj.getAttribute('selecti'); + lis[selecti].className = ''; + if(value == 40) { + selecti = parseInt(selecti) + 1; + } else if(value == 38) { + selecti = parseInt(selecti) - 1; + } + if(selecti < 0) { + selecti = lis.length - 1 + } else if(selecti > lis.length - 1) { + selecti = 0; + } + lis[selecti].className = 'current'; + selectObj.setAttribute('selecti', selecti); + lis[selecti].parentNode.scrollTop = lis[selecti].offsetTop; + } + } else if(value == 13) { + var lis = menuObj.getElementsByTagName('li'); + lis[selectObj.getAttribute('selecti')].onclick(); + } else if(value == 27) { + hideMenu(menuObj.id); + } + }; +} + +function switchTab(prefix, current, total, activeclass) { + $F('_switchTab', arguments); +} + +function imageRotate(imgid, direct) { + $F('_imageRotate', arguments); +} + +function thumbImg(obj, method) { + if(!obj) { + return; + } + obj.onload = null; + file = obj.src; + zw = obj.offsetWidth; + zh = obj.offsetHeight; + if(zw < 2) { + if(!obj.id) { + obj.id = 'img_' + Math.random(); + } + setTimeout("thumbImg($('" + obj.id + "'), " + method + ")", 100); + return; + } + zr = zw / zh; + method = !method ? 0 : 1; + if(method) { + fixw = obj.getAttribute('_width'); + fixh = obj.getAttribute('_height'); + if(zw > fixw) { + zw = fixw; + zh = zw / zr; + } + if(zh > fixh) { + zh = fixh; + zw = zh * zr; + } + } else { + fixw = typeof imagemaxwidth == 'undefined' ? '600' : imagemaxwidth; + if(zw > fixw) { + zw = fixw; + zh = zw / zr; + obj.style.cursor = 'pointer'; + if(!obj.onclick) { + obj.onclick = function() { + zoom(obj, obj.src); + }; + } + } + } + obj.width = zw; + obj.height = zh; +} + +var zoomstatus = 1; +function zoom(obj, zimg, nocover, pn, showexif) { + $F('_zoom', arguments); +} + +function showselect(obj, inpid, t, rettype) { + $F('_showselect', arguments); +} + +function showColorBox(ctrlid, layer, k, bgcolor) { + $F('_showColorBox', arguments); +} + +function ctrlEnter(event, btnId, onlyEnter) { + if(isUndefined(onlyEnter)) onlyEnter = 0; + if((event.ctrlKey || onlyEnter) && event.keyCode == 13) { + $(btnId).click(); + return false; + } + return true; +} + +function parseurl(str, mode, parsecode) { + if(isUndefined(parsecode)) parsecode = true; + if(parsecode) str= str.replace(/\[code\]([\s\S]+?)\[\/code\]/ig, function($1, $2) {return codetag($2, -1);}); + str = str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(swf|flv))/ig, '$1[flash]$2[/flash]'); + str = str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(mp3|wma))/ig, '$1[audio]$2[/audio]'); + str = str.replace(/([^>=\]"'\/@]|^)((((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|qqdl|synacast):\/\/))([\w\-]+\.)*[:\.@\-\w\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&;~`@':+!#]*)*)/ig, mode == 'html' ? '$1$2' : '$1[url]$2[/url]'); + str = str.replace(/([^\w>=\]"'\/@]|^)((www\.)([\w\-]+\.)*[:\.@\-\w\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&;~`@':+!#]*)*)/ig, mode == 'html' ? '$1$2' : '$1[url]$2[/url]'); + str = str.replace(/([^\w->=\]:"'\.\/]|^)(([\-\.\w]+@[\.\-\w]+(\.\w+)+))/ig, mode == 'html' ? '$1$2' : '$1[email]$2[/email]'); + if(parsecode) { + for(var i = 0; i <= DISCUZCODE['num']; i++) { + str = str.replace("[\tDISCUZ_CODE_" + i + "\t]", DISCUZCODE['html'][i]); + } + } + return str; +} + +function codetag(text, br) { + var br = !br ? 1 : br; + DISCUZCODE['num']++; + if(br > 0 && typeof wysiwyg != 'undefined' && wysiwyg) text = text.replace(/]*>/ig, '\n'); + text = text.replace(/\$/ig, '$$$$'); + DISCUZCODE['html'][DISCUZCODE['num']] = '[code]' + text + '[/code]'; + return '[\tDISCUZ_CODE_' + DISCUZCODE['num'] + '\t]'; +} + +function saveUserdata(name, data) { + try { + if(window.localStorage){ + localStorage.setItem('Discuz_' + name, data); + } else if(window.sessionStorage){ + sessionStorage.setItem('Discuz_' + name, data); + } + } catch(e) { + if(BROWSER.ie){ + if(data.length < 54889) { + with(document.documentElement) { + setAttribute("value", data); + save('Discuz_' + name); + } + } + } + } + setcookie('clearUserdata', '', -1); +} + +function loadUserdata(name) { + if(window.localStorage){ + return localStorage.getItem('Discuz_' + name); + } else if(window.sessionStorage){ + return sessionStorage.getItem('Discuz_' + name); + } else if(BROWSER.ie){ + with(document.documentElement) { + load('Discuz_' + name); + return getAttribute("value"); + } + } +} + +function initTab(frameId, type) { + $F('_initTab', arguments); +} + +function openDiy(){ + if(DYNAMICURL) { + window.location.href = SITEURL+DYNAMICURL + (DYNAMICURL.indexOf('?') < 0 ? '?' : '&') + ('diy=yes'); + } else { + window.location.href = ((window.location.href + '').replace(/[\?\&]diy=yes/g, '').split('#')[0] + ( window.location.search && window.location.search.indexOf('?diy=yes') < 0 ? '&diy=yes' : '?diy=yes')); + } +} + +function hasClass(elem, className) { + return elem.className && (" " + elem.className + " ").indexOf(" " + className + " ") != -1; +} + +function addClass(elem, className) { + if(!hasClass(elem, className)) elem.className = trim(elem.className += " " + className); +} + +function removeClass(elem, className) { + elem.className = trim((" " + elem.className + " ").replace(" " + trim(className) + " ", " ")); +} + +function toggleClass(elem, className) { + elem.className = hasClass(elem, className) ? removeClass(elem, className) : trim(elem.className += " " + className); +} + +function runslideshow() { + $F('_runslideshow', []); +} + +function toggle_collapse(objname, noimg, complex, lang) { + $F('_toggle_collapse', arguments); +} + +function updatestring(str1, str2, clear) { + str2 = '_' + str2 + '_'; + return clear ? str1.replace(str2, '') : (str1.indexOf(str2) == -1 ? str1 + str2 : str1); +} + +function getClipboardData() { + window.document.clipboardswf.SetVariable('str', CLIPBOARDSWFDATA); +} + +function setCopy(text, msg) { + var cp = document.createElement('textarea'); + cp.style.fontSize = '12pt'; + cp.style.border = '0'; + cp.style.padding = '0'; + cp.style.margin = '0'; + cp.style.position = 'absolute'; + cp.style.left = '-9999px'; + var yPosition = window.pageYOffset || document.documentElement.scrollTop; + cp.style.top = yPosition + 'px'; + cp.setAttribute('readonly', ''); + text = text.replace(/[\xA0]/g, ' '); + cp.value = text; + $('append_parent').appendChild(cp); + cp.select(); + cp.setSelectionRange(0, cp.value.length); + try { + var success = document.execCommand('copy', false, null); + } catch (e) { + var success = false; + } + $('append_parent').removeChild(cp); + + if(success) { + if(msg) { + showPrompt(null, null, '' + msg + '', 1500); + } + } else if(BROWSER.ie) { + var r = clipboardData.setData('Text', text); + if(r) { + if(msg) { + showPrompt(null, null, '' + msg + '', 1500); + } + } else { + showDialog('
                  复制失败,请选择“允许访问”
                  ', 'alert'); + } + } else { + var msg = '
                  点此复制到剪贴板
                  ' + + AC_FL_RunContent('id', 'clipboardswf', 'name', 'clipboardswf', 'devicefont', 'false', 'width', '200', 'height', '40', 'src', STATICURL + 'image/common/clipboard.swf', 'menu', 'false', 'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent', 'style' , 'margin-top:-20px') + '
                  '; + showDialog(msg, 'info'); + CLIPBOARDSWFDATA = text; + } +} + +function copycode(obj) { + $F('_copycode', arguments); +} + +function showdistrict(container, elems, totallevel, changelevel, containertype) { + $F('_showdistrict', arguments); +} + +function setDoodle(fid, oid, url, tid, from) { + $F('_setDoodle', arguments); +} + + +function initSearchmenu(searchform, cloudSearchUrl) { + var defaultUrl = 'search.php?searchsubmit=yes'; + if(typeof cloudSearchUrl == "undefined" || cloudSearchUrl == null || cloudSearchUrl == '') { + cloudSearchUrl = defaultUrl; + } + + var searchtxt = $(searchform + '_txt'); + if(!searchtxt) { + searchtxt = $(searchform); + } + var tclass = searchtxt.className; + searchtxt.className = tclass + ' xg1'; + if (!!("placeholder" in document.createElement("input"))) { + if(searchtxt.value == '请输入搜索内容') { + searchtxt.value = ''; + } + searchtxt.placeholder = '请输入搜索内容'; + } else { + searchtxt.onfocus = function () { + if(searchtxt.value == '请输入搜索内容') { + searchtxt.value = ''; + searchtxt.className = tclass; + } + }; + searchtxt.onblur = function () { + if(searchtxt.value == '' ) { + searchtxt.value = '请输入搜索内容'; + searchtxt.className = tclass + ' xg1'; + } + }; + } + if(!$(searchform + '_type_menu')) return false; + var o = $(searchform + '_type'); + var a = $(searchform + '_type_menu').getElementsByTagName('a'); + var formobj = searchtxt.form; + for(var i=0; i 255) { + curlen += 2; + } else { + curlen += 1; + } + } + if(curlen <= maxlen) { + $(checklen).innerHTML = maxlen - curlen; + return true; + } else { + obj.value = mb_cutstr(v, maxlen, 0); + return false; + } +} + +function dstrLenCalc(obj, checklen, maxlen) { + var v = obj.value, charlen = 0, maxlen = !maxlen ? 200 : maxlen, curlen = maxlen, len = strlen(v); + for(var i = 0; i < v.length; i++) { + value = v.charCodeAt(i); + if((value > 127 && value < 55296) || value > 57343) { + curlen--; + } + } + if(curlen >= len) { + $(checklen).innerHTML = curlen - len; + } else { + obj.value = dcutstr(v, maxlen, ''); + } +} + +function pluginNotice() { + if($('plugin_notice')) { + ajaxget('misc.php?mod=patch&action=pluginnotice', 'plugin_notice', ''); + } +} + +function ipNotice() { + if($('ip_notice')) { + ajaxget('misc.php?mod=patch&action=ipnotice&_r='+Math.random(), 'ip_notice', ''); + } +} + +function noticeTitle() { + NOTICETITLE = {'State':0, 'oldTitle':NOTICECURTITLE, flashNumber:0, sleep:15}; + if(!getcookie('noticeTitle')) { + window.setInterval('noticeTitleFlash();', 500); + } else { + window.setTimeout('noticeTitleFlash();', 500); + } + setcookie('noticeTitle', 1, 600); +} + +function noticeTitleFlash() { + if(NOTICETITLE.flashNumber < 5 || NOTICETITLE.flashNumber > 4 && !NOTICETITLE['State']) { + document.title = (NOTICETITLE['State'] ? '【   】' : '【新提醒】') + NOTICETITLE['oldTitle']; + NOTICETITLE['State'] = !NOTICETITLE['State']; + } + NOTICETITLE.flashNumber = NOTICETITLE.flashNumber < NOTICETITLE.sleep ? ++NOTICETITLE.flashNumber : 0; +} + +function relatedlinks(rlinkmsgid) { + $F('_relatedlinks', arguments); +} + +function con_handle_response(response) { + return response; +} + +function showTopLink() { + var ft = $('ft'); + if(ft){ + var scrolltop = $('scrolltop'); + var viewPortHeight = parseInt(document.documentElement.clientHeight); + var scrollHeight = parseInt(document.body.getBoundingClientRect().top); + var basew = parseInt(ft.clientWidth); + var sw = scrolltop.clientWidth; + if (basew < 1250) { + var left = parseInt(fetchOffset(ft)['left']); + left = left < sw ? left * 2 - sw : left; + scrolltop.style.left = ( basew + left ) + 'px'; + } else { + scrolltop.style.left = 'auto'; + scrolltop.style.right = 0; + } + + if (BROWSER.ie && BROWSER.ie < 7) { + scrolltop.style.top = viewPortHeight - scrollHeight - 150 + 'px'; + } + if (scrollHeight < -100) { + scrolltop.style.visibility = 'visible'; + } else { + scrolltop.style.visibility = 'hidden'; + } + } +} + +function showCreditmenu() { + $F('_showCreditmenu', []); +} + +function showUpgradeinfo() { + $F('_showUpgradeinfo', []); +} + +function addFavorite(url, title) { + try { + window.external.addFavorite(url, title); + } catch (e){ + try { + window.sidebar.addPanel(title, url, ''); + } catch (e) { + showDialog("请按 Ctrl+D 键添加到收藏夹", 'notice'); + } + } +} + +function setHomepage(sURL) { + if(BROWSER.ie){ + document.body.style.behavior = 'url(#default#homepage)'; + document.body.setHomePage(sURL); + } else { + showDialog("非 IE 浏览器请手动将本站设为首页", 'notice'); + doane(); + } +} + +function setShortcut() { + var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + if(!loadUserdata('setshortcut') && !scrollTop) { + $F('_setShortcut', []); + } +} + +function smilies_show(id, smcols, seditorkey) { + $F('_smilies_show', arguments, 'smilies'); +} + +function showfocus(ftype, autoshow) { + var id = parseInt($('focuscur').innerHTML); + if(ftype == 'prev') { + id = (id-1) < 1 ? focusnum : (id-1); + if(!autoshow) { + window.clearInterval(focusautoshow); + } + } else if(ftype == 'next') { + id = (id+1) > focusnum ? 1 : (id+1); + if(!autoshow) { + window.clearInterval(focusautoshow); + } + } + $('focuscur').innerHTML = id; + $('focus_con').innerHTML = $('focus_'+(id-1)).innerHTML; +} + +function rateStarHover(target,level) { + if(level == 0) { + $(target).style.width = ''; + } else { + $(target).style.width = level * 16 + 'px'; + } +} +function rateStarSet(target,level,input) { + $(input).value = level; + $(target).className = 'star star' + level; +} + +function img_onmouseoverfunc(obj) { + if(typeof showsetcover == 'function') { + showsetcover(obj); + } + return; +} + +function toggleBlind(dom) { + if(dom) { + if(loadUserdata('is_blindman')) { + saveUserdata('is_blindman', ''); + dom.title = '开启辅助访问'; + } else { + saveUserdata('is_blindman', '1'); + dom.title = '关闭辅助访问'; + } + } +} + +function checkBlind() { + var dom = $('switchblind'); + if(dom) { + if(loadUserdata('is_blindman')) { + dom.title = '关闭辅助访问'; + } else { + dom.title = '开启辅助访问'; + } + } +} + +function getElementOffset(element) { + var left = element.offsetLeft, top = element.offsetTop; + while(element = element.offsetParent) { + left += element.offsetLeft; + top += element.offsetTop; + } + if($('nv').style.position == 'fixed') { + top -= parseInt($('nv').style.height); + } + return {'left' : left, 'top' : top}; +} + +function mobileplayer() { + var platform = navigator.platform; + var ua = navigator.userAgent; + var ios = /iPhone|iPad|iPod/.test(platform) && ua.indexOf( "AppleWebKit" ) > -1; + var andriod = ua.indexOf( "Android" ) > -1; + if(ios || andriod) { + return true; + } else { + return false; + } +} + +function appendstyle(url) { + var link = document.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; + link.href = url; + var head = document.getElementsByTagName('head')[0]; + head.appendChild(link); +} + +function detectHtml5Support() { + return document.createElement("Canvas").getContext; +} + +function detectPlayer(randomid, ext, src, width, height) { + var h5_support = new Array('aac', 'flac', 'mp3', 'm4a', 'wav', 'flv', 'mp4', 'm4v', '3gp', 'ogv', 'ogg', 'weba', 'webm'); + var trad_support = new Array('mp3', 'wma', 'mid', 'wav', 'ra', 'ram', 'rm', 'rmvb', 'swf', 'asf', 'asx', 'wmv', 'avi', 'mpg', 'mpeg', 'mov'); + width = width.indexOf("%") == -1 ? width + 'px' : width; + height = height.indexOf("%") == -1 ? height + 'px' : height; + if (in_array(ext, h5_support) && detectHtml5Support()) { + html5Player(randomid, ext, src, width, height); + } else if (in_array(ext, trad_support)) { + tradionalPlayer(randomid, ext, src, width, height); + } else { + $(randomid).style.width = width; + $(randomid).style.height = height; + } +} + +function tradionalPlayer(randomid, ext, src, width, height) { + switch(ext) { + case 'mp3': + case 'wma': + case 'mid': + case 'wav': + height = 64; + html = ''; + break; + case 'ra': + case 'ram': + height = 32; + html = ''; + break; + case 'rm': + case 'rmvb': + html = '
                  '; + break; + case 'swf': + html = AC_FL_RunContent('width', width, 'height', height, 'allowNetworking', 'internal', 'allowScriptAccess', 'never', 'src', encodeURI(src), 'quality', 'high', 'bgcolor', '#ffffff', 'wmode', 'transparent', 'allowfullscreen', 'true'); + break; + case 'asf': + case 'asx': + case 'wmv': + case 'avi': + case 'mpg': + case 'mpeg': + html = ''; + break; + case 'mov': + html = ''; + break; + default: + break; + } + $(randomid).style.width = width; + $(randomid).style.height = height; + $(randomid + '_container').innerHTML = html; +} + +function html5Player(randomid, ext, src, width, height) { + switch (ext) { + case 'aac': + case 'flac': + case 'mp3': + case 'm4a': + case 'wav': + case 'ogg': + height = 66; + if(!HTML5PLAYER['apload']) { + appendstyle(STATICURL + 'js/player/aplayer.min.css'); + appendscript(STATICURL + 'js/player/aplayer.min.js'); + HTML5PLAYER['apload'] = 1; + } + html5APlayer(randomid, ext, src, width, height); + break; + case 'flv': + if(!HTML5PLAYER['flvload']) { + appendscript(STATICURL + 'js/player/flv.min.js'); + HTML5PLAYER['flvload'] = 1; + } + case 'mp4': + case 'm4v': + case '3gp': + case 'ogv': + case 'webm': + if(!HTML5PLAYER['dpload']) { + appendstyle(STATICURL + 'js/player/dplayer.min.css'); + appendscript(STATICURL + 'js/player/dplayer.min.js'); + HTML5PLAYER['dpload'] = 1; + } + html5DPlayer(randomid, ext, src, width, height); + break; + default: + break; + } + $(randomid).style.width = width; + $(randomid).style.height = height; +} + +function html5APlayer(randomid, ext, src, width, height) { + if (JSLOADED[STATICURL + 'js/player/aplayer.min.js']) { + window[randomid] = new APlayer({ + container: $(randomid + '_container'), + mini: false, + autoplay: false, + loop: 'all', + preload: 'none', + volume: 1, + mutex: true, + listFolded: true, + audio: [{ + name: ' ', + artist: ' ', + url: src + }] + }); + } else { + setTimeout(function () { + html5APlayer(randomid, ext, src, width, height); + }, 50); + } +} + +function html5DPlayer(randomid, ext, src, width, height) { + if (JSLOADED[STATICURL + 'js/player/dplayer.min.js'] && (ext != 'flv' || JSLOADED[STATICURL + 'js/player/flv.min.js'])) { + window[randomid] = new DPlayer({ + container: $(randomid + '_container'), + autoplay: false, + loop: true, + screenshot: false, + hotkey: true, + preload: 'none', + volume: 1, + mutex: true, + listFolded: true, + video: { + url: src + } + }); + } else { + setTimeout(function () { + html5DPlayer(randomid, ext, src, width, height); + }, 50); + } +} + +var BROWSER = {}; +var USERAGENT = navigator.userAgent.toLowerCase(); +browserVersion({'ie':'msie','trident':'','firefox':'','chrome':'','opera':'','safari':'','mozilla':'','webkit':'','maxthon':'','qq':'qqbrowser','rv':'rv'}); +if(BROWSER.safari || BROWSER.rv) { + BROWSER.firefox = true; +} +BROWSER.opera = BROWSER.opera ? opera.version() : 0; + +HTMLNODE = document.getElementsByTagName('head')[0].parentNode; +if(BROWSER.ie || BROWSER.trident) { + BROWSER.iemode = parseInt(typeof document.documentMode != 'undefined' ? document.documentMode : BROWSER.ie); + HTMLNODE.className = (BROWSER.iemode<9?'ie_all ':'') +'ie' + BROWSER.iemode; +} + +var CSSLOADED = []; +var JSLOADED = []; +var JSMENU = []; +JSMENU['active'] = []; +JSMENU['timer'] = []; +JSMENU['drag'] = []; +JSMENU['layer'] = 0; +JSMENU['zIndex'] = {'win':200,'menu':300,'dialog':400,'prompt':500}; +JSMENU['float'] = ''; +var CURRENTSTYPE = null; +var discuz_uid = isUndefined(discuz_uid) ? 0 : discuz_uid; +var creditnotice = isUndefined(creditnotice) ? '' : creditnotice; +var cookiedomain = isUndefined(cookiedomain) ? '' : cookiedomain; +var cookiepath = isUndefined(cookiepath) ? '' : cookiepath; +var EXTRAFUNC = [], EXTRASTR = ''; +EXTRAFUNC['showmenu'] = []; + +var DISCUZCODE = []; +DISCUZCODE['num'] = '-1'; +DISCUZCODE['html'] = []; + +var USERABOUT_BOX = true; +var USERCARDST = null; +var CLIPBOARDSWFDATA = ''; +var NOTICETITLE = []; +var NOTICECURTITLE = document.title; +var safescripts = {}, evalscripts = []; + +var HTML5PLAYER = []; +HTML5PLAYER['apload'] = 0; +HTML5PLAYER['dpload'] = 0; +HTML5PLAYER['flvload'] = 0; + +if(BROWSER.firefox && window.HTMLElement) { + HTMLElement.prototype.__defineGetter__( "innerText", function(){ + var anyString = ""; + var childS = this.childNodes; + for(var i=0; i '; + } + return str + '>' + this.innerHTML + ''; + }); + + HTMLElement.prototype.__defineGetter__('canHaveChildren', function() { + switch(this.tagName.toLowerCase()) { + case 'area':case 'base':case 'basefont':case 'col':case 'frame':case 'hr':case 'img':case 'br':case 'input':case 'isindex':case 'link':case 'meta':case 'param': + return false; + } + return true; + }); +} + +if(typeof IN_ADMINCP == 'undefined') { + if(creditnotice != '' && getcookie('creditnotice')) { + _attachEvent(window, 'load', showCreditPrompt, document); + } + if(typeof showusercard != 'undefined' && showusercard == 1) { + _attachEvent(window, 'load', cardInit, document); + } +} + +if(BROWSER.ie) { + document.documentElement.addBehavior("#default#userdata"); +} \ No newline at end of file diff --git a/static/js/common_diy.js b/static/js/common_diy.js new file mode 100644 index 0000000..157f3d1 --- /dev/null +++ b/static/js/common_diy.js @@ -0,0 +1,1899 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: common_diy.js 31093 2012-07-16 03:54:34Z zhangguosheng $ +*/ + +String.prototype.property2js = function(){ + var t = this.replace(/-([a-z])/g, function($0, $1) {return $1.toUpperCase();}); + return t; +}; +function styleCss(n) { + if(typeof n == "number") { + var _s = document.styleSheets[n]; + } else { + return false; + } + this.sheet = _s; + this.rules = _s.cssRules ? _s.cssRules : _s.rules; +}; + +styleCss.prototype.indexOf = function(selector) { + for(var i = 0; i < this.rules.length; i++) { + if (typeof(this.rules[i].selectorText) == 'undefined') continue; + if(this.rules[i].selectorText == selector) { + return i; + } + } + return -1; +}; + +styleCss.prototype.removeRule = function(n) { + if(typeof n == "number") { + if(n < this.rules.length) { + this.sheet.removeRule ? this.sheet.removeRule(n) : this.sheet.deleteRule(n); + } + } else { + var i = this.indexOf(n); + if (i>0) this.sheet.removeRule ? this.sheet.removeRule(i) : this.sheet.deleteRule(i); + } +}; + +styleCss.prototype.addRule = function(selector, styles, n, porperty) { + var i = this.indexOf(selector); + var s = ''; + var reg = ''; + if (i != -1) { + reg = new RegExp('^'+porperty+'.*;','i'); + s = this.getRule(selector); + if (s) { + s = s.replace(selector,'').replace('{', '').replace('}', '').replace(/ /g, ' ').replace(/^ | $/g,''); + s = (s != '' && s.substr(-1,1) != ';') ? s+ ';' : s; + s = s.toLowerCase().replace(reg, ''); + if (s.length == 1) s = ''; + } + this.removeRule(i); + } + s = s.indexOf('!important') > -1 || s.indexOf('! important') > -1 ? s : s.replace(/;/g,' !important;'); + s = s + styles; + if (typeof n == 'undefined' || !isNaN(n)) { + n = this.rules.length; + } + if (this.sheet.insertRule) { + this.sheet.insertRule(selector+'{'+s+'}', n); + } else { + if (s) this.sheet.addRule(selector, s, n); + } +}; + +styleCss.prototype.setRule = function(selector, attribute, value) { + var i = this.indexOf(selector); + if(-1 == i) return false; + this.rules[i].style[attribute] = value; + return true; +}; + +styleCss.prototype.getRule = function(selector, attribute) { + var i = this.indexOf(selector); + if(-1 == i) return ''; + var value = ''; + if (typeof attribute == 'undefined') { + value = typeof this.rules[i].cssText != 'undefined' ? this.rules[i].cssText : this.rules[i].style['cssText']; + } else { + value = this.rules[i].style[attribute]; + } + return typeof value != 'undefined' ? value : ''; +}; +styleCss.prototype.removeAllRule = function(noSearch) { + var num = this.rules.length; + var j = 0; + for(var i = 0; i < num; i ++) { + var selector = this.rules[this.rules.length - 1 - j].selectorText; + if(noSearch == 1) { + this.sheet.removeRule ? this.sheet.removeRule(this.rules.length - 1 - j) : this.sheet.deleteRule(this.rules.length - 1 - j); + } else { + j++; + } + } +}; +if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function (element, index) { + var length = this.length; + if (index == null) { + index = 0; + } else { + index = (!isNaN(index) ? index : parseInt(index)); + if (index < 0) index = length + index; + if (index < 0) index = 0; + } + for (var i = index; i < length; i++) { + var current = this[i]; + if (!(typeof(current) === 'undefined') || i in this) { + if (current === element) return i; + } + } + return -1; + }; +} +if (!Array.prototype.filter){ + Array.prototype.filter = function(fun , thisp){ + var len = this.length; + if (typeof fun != "function") + throw new TypeError(); + var res = new Array(); + var thisp = arguments[1]; + for (var i = 0; i < len; i++){ + if (i in this){ + var val = this[i]; + if (fun.call(thisp, val, i, this)) res.push(val); + } + } + return res; + }; +} +var Util = { + event: function(event){ + Util.e = event || window.event; + Util.e.aim = Util.e.target || Util.e.srcElement; + if (!Util.e.preventDefault) { + Util.e.preventDefault = function(){ + Util.e.returnValue = false; + }; + } + if (!Util.e.stopPropagation) { + Util.e.stopPropagation = function(){ + Util.e.cancelBubble = true; + }; + } + if (typeof Util.e.layerX == "undefined") { + Util.e.layerX = Util.e.offsetX; + } + if (typeof Util.e.layerY == "undefined") { + Util.e.layerY = Util.e.offsetY; + } + if (typeof Util.e.which == "undefined") { + Util.e.which = Util.e.button; + } + return Util.e; + }, + url: function(s){ + var s2 = s.replace(/(\(|\)|\,|\s|\'|\"|\\)/g, '\\$1'); + if (/\\\\$/.test(s2)) { + s2 += ' '; + } + return "url('" + s2 + "')"; + }, + trimUrl : function(s){ + var s2 = s.toLowerCase().replace(/url\(|\"|\'|\)/g,''); + return s2; + }, + swapDomNodes: function(a, b){ + var afterA = a.nextSibling; + if (afterA == b) { + swapDomNodes(b, a); + return; + } + var aParent = a.parentNode; + b.parentNode.replaceChild(a, b); + aParent.insertBefore(b, afterA); + }, + hasClass: function(el, name){ + return el && el.nodeType == 1 && typeof el.className === 'string' && el.className.split(/\s+/).indexOf(name) != -1; + }, + addClass: function(el, name){ + el.className += this.hasClass(el, name) ? '' : ' ' + name; + }, + removeClass: function(el, name){ + var names = el.className.split(/\s+/); + el.className = names.filter(function(n){ + return name != n; + }).join(' '); + }, + getTarget: function(e, attributeName, value){ + var target = e.target || e.srcElement; + while (target != null) { + if (attributeName == 'className') { + if (this.hasClass(target, value)) { + return target; + } + }else if (target[attributeName] == value) { + return target; + } + target = target.parentNode; + } + return false; + }, + getOffset:function (el, isLeft) { + var retValue = 0 ; + while (el != null ) { + retValue += el["offset" + (isLeft ? "Left" : "Top" )]; + el = el.offsetParent; + } + return retValue; + }, + insertBefore: function (newNode, targetNode) { + var parentNode = targetNode.parentNode; + var next = targetNode.nextSibling; + if (targetNode.id && targetNode.id.indexOf('temp')>-1) { + parentNode.insertBefore(newNode,targetNode); + } else if (!next) { + parentNode.appendChild(newNode); + } else { + parentNode.insertBefore(newNode,targetNode); + } + }, + insertAfter : function (newNode, targetNode) { + var parentNode = targetNode.parentNode; + var next = targetNode.nextSibling; + if (next) { + parentNode.insertBefore(newNode,next); + } else { + parentNode.appendChild(newNode); + } + }, + getScroll: function () { + var t, l, w, h; + if (document.documentElement && document.documentElement.scrollTop) { + t = document.documentElement.scrollTop; + l = document.documentElement.scrollLeft; + w = document.documentElement.scrollWidth; + h = document.documentElement.scrollHeight; + } else if (document.body) { + t = document.body.scrollTop; + l = document.body.scrollLeft; + w = document.body.scrollWidth; + h = document.body.scrollHeight; + } + return {t: t, l: l, w: w, h: h}; + }, + hide:function (ele){ + if (typeof ele == 'string') {ele = $(ele);} + if (ele){ele.style.display = 'none';ele.style.visibility = 'hidden';} + }, + show:function (ele){ + if (typeof ele == 'string') {ele = $(ele);} + if (ele) { + this.removeClass(ele, 'hide'); + ele.style.display = ''; + ele.style.visibility = 'visible'; + } + }, + cancelSelect : function () { + window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty(); + }, + getSelectText : function () { + var t = ''; + if (window.getSelection) { + t = window.getSelection(); + } else if (document.getSelection) { + t = document.getSelection(); + } else if (document.selection) { + t = document.selection.createRange().text; + } else { + t = ''; + } + return t; + }, + toggleEle : function (ele) { + ele = (typeof ele !='object') ? $(ele) : ele; + if (!ele) return false; + var value = this.getFinallyStyle(ele,'display'); + if (value =='none') { + this.show(ele); + this.hide($('uploadmsg_button')); + } else { + this.hide(ele); + this.show($('uploadmsg_button')); + } + }, + getFinallyStyle : function (ele,property) { + ele = (typeof ele !='object') ? $(ele) : ele; + var style = (typeof(ele['currentStyle']) == 'undefined') ? window.getComputedStyle(ele,null)[property] : ele['currentStyle'][property]; + if (typeof style == 'undefined' && property == 'backgroundPosition') { + style = ele['currentStyle']['backgroundPositionX'] + ' ' +ele['currentStyle']['backgroundPositionY']; + } + return style; + }, + recolored:function (){ + var b = document.body; + b.style.zoom = b.style.zoom=="1"?"100%":"1"; + }, + getRandom : function (len,type) { + len = len < 0 ? 0 : len; + type = type && type<=3? type : 3; + var str = ''; + for (var i = 0; i < len; i++) { + var j = Math.ceil(Math.random()*type); + if (j == 1) { + str += Math.ceil(Math.random()*9); + } else if (j == 2) { + str += String.fromCharCode(Math.ceil(Math.random()*25+65)); + } else { + str += String.fromCharCode(Math.ceil(Math.random()*25+97)); + } + } + return str; + }, + fade : function(obj,timer,ftype,cur,fn) { + if (this.stack == undefined) {this.stack = [];} + obj = typeof obj == 'string' ? $(obj) : obj; + if (!obj) return false; + + for (var i=0;i= 100 || ftype == 'out' && cur <= 0) { + clearTimeout(fadeTimer); + for (i=0;i-1 || color.toLowerCase() == 'transparent' ? color : '#'+Util.rgb2hex(color); + } +}; + +(function(){ + Frame = function(name, className, top, left, moveable){ + this.name = name; + this.top = top; + this.left = left; + this.moveable = moveable ? true : false; + this.columns = []; + this.className = className; + this.titles = []; + if (typeof Frame._init == 'undefined') { + Frame.prototype.addColumn = function (column) { + if (column instanceof Column) { + this.columns[column.name] = column; + } + }; + Frame.prototype.addFrame = function(columnId, frame) { + if (frame instanceof Frame || frame instanceof Tab){ + this.columns[columnId].children.push(frame); + } + }; + Frame.prototype.addBlock = function(columnId, block) { + if (block instanceof Block){ + this.columns[columnId].children.push(block); + } + }; + } + Frame._init = true; + }; + + Column = function (name, className) { + this.name = name; + this.className = className; + this.children = []; + }; + Tab = function (name, className, top, left, moveable) { + Frame.apply(this, arguments); + }; + Tab.prototype = new Frame(); + Block = function(name, className, top, left) { + this.name = name; + this.top = top; + this.left = left; + this.className = className; + this.titles = []; + }; + + Drag = function () { + this.data = []; + this.scroll = {}; + this.menu = []; + this.data = []; + this.allBlocks = []; + this.overObj = ''; + this.dragObj = ''; + this.dragObjFrame = ''; + this.overObjFrame = ''; + this.isDragging = false; + this.layout = 2; + this.frameClass = 'frame'; + this.blockClass = 'block'; + this.areaClass = 'area'; + this.moveableArea = []; + this.moveableColumn = 'column'; + this.moveableObject = 'move-span'; + this.titleClass = 'title'; + this.hideClass = 'hide'; + this.titleTextClass = 'titletext'; + this.frameTitleClass = 'frame-title', + this.tabClass = 'frame-tab'; + this.tabActivityClass = 'tabactivity'; + this.tabTitleClass = 'tab-title'; + this.tabContentClass = 'tb-c'; + this.moving = 'moving'; + this.contentClass = 'dxb_bc'; + this.tmpBoxElement = null ; + this.dargRelative = {}; + this.scroll = {}; + this.menu = []; + this.rein = []; + this.newFlag = false; + this.isChange = false; + this.fn = ''; + this._replaceFlag = false; + this.sampleMode = false; + this.sampleBlocks = null; + this.advancedStyleSheet = null; + }; + Drag.prototype = { + getTmpBoxElement : function () { + if (!this.tmpBoxElement) { + this.tmpBoxElement = document.createElement("div"); + this.tmpBoxElement.id = 'tmpbox'; + this.tmpBoxElement.className = "tmpbox" ; + this.tmpBoxElement.style.width = this.overObj.offsetWidth-4+"px"; + this.tmpBoxElement.style.height = this.overObj.offsetHeight-4+"px"; + } else if (this.overObj && this.overObj.offsetWidth > 0) { + this.tmpBoxElement.style.width = this.overObj.offsetWidth-4+"px"; + } + return this.tmpBoxElement; + }, + getPositionStr : function (){ + this.initPosition(); + var start = ''; + var end =""; + var str = ""; + for (var i in this.data) { + if (typeof this.data[i] == 'function') continue; + str += ''; + for (var j in this.data[i]) { + if (!(this.data[i][j] instanceof Frame || this.data[i][j] instanceof Tab)) continue; + str += this._getFrameXML(this.data[i][j]); + } + str += ''; + } + return start + str + end; + }, + _getFrameXML : function (frame) { + if (!(frame instanceof Frame || frame instanceof Tab) || frame.name.indexOf('temp') > 0) return ''; + var itemId = frame instanceof Tab ? 'tab' : 'frame'; + var Cstr = ""; + var name = frame.name; + var frameAttr = this._getAttrXML(frame); + var columns = frame['columns']; + for (var j in columns) { + if (columns[j] instanceof Column) { + var Bstr = ''; + var colChildren = columns[j].children; + for (var k in colChildren) { + if (k == 'attr' || typeof colChildren[k] == 'function' || colChildren[k].name.indexOf('temp') > 0) continue; + if (colChildren[k] instanceof Block) { + Bstr += ''; + Bstr += this._getAttrXML(colChildren[k]); + Bstr += ''; + } else if (colChildren[k] instanceof Frame || colChildren[k] instanceof Tab) { + Bstr += this._getFrameXML(colChildren[k]); + } + } + var columnAttr = this._getAttrXML(columns[j]); + Cstr += '' + columnAttr + Bstr + ''; + } + } + return '' + frameAttr + Cstr + ''; + }, + _getAttrXML : function (obj) { + var attrXml = ''; + var trimAttr = ['left', 'top']; + var xml = ''; + if (obj instanceof Frame || obj instanceof Tab || obj instanceof Block || obj instanceof Column) { + for (var i in obj) { + if (i == 'titles') { + xml += this._getTitlesXML(obj[i]); + } + if (!(typeof obj[i] == 'object' || typeof obj[i] == 'function')) { + if (trimAttr.indexOf(i) >= 0) continue; + xml += ''; + } + } + }else { + xml += ''; + } + return attrXml + xml + ''; + }, + _getTitlesXML : function (titles) { + var xml = ''; + for (var i in titles) { + if (typeof titles[i] == 'function') continue; + xml += ''; + for (var j in titles[i]) { + if (typeof titles[i][j] == 'function') continue; + xml += ''; + } + xml += ''; + } + xml += ''; + return xml; + }, + getCurrentOverObj : function (e) { + var _clientX = parseInt(this.dragObj.style.left); + var _clientY = parseInt(this.dragObj.style.top); + var max = 10000000; + for (var i in this.data) { + for (var j in this.data[i]) { + if (!(this.data[i][j] instanceof Frame || this.data[i][j] instanceof Tab)) continue; + var min = this._getMinDistance(this.data[i][j], max); + if (min.distance < max) { + var id = min.id; + max = min.distance; + } + } + } + return $(id); + }, + _getMinDistance : function (ele, max) { + if(ele.name==this.dragObj.id) return {"id":ele.name, "distance":max}; + var _clientX = parseInt(this.dragObj.style.left); + var _clientY = parseInt(this.dragObj.style.top); + var id; + var isTabInTab = Util.hasClass(this.dragObj, this.tabClass) && Util.hasClass($(ele.name).parentNode.parentNode, this.tabClass); + if (ele instanceof Frame || ele instanceof Tab) { + if (ele.moveable && !isTabInTab) { + var isTab = Util.hasClass(this.dragObj, this.tabClass); + var isFrame = Util.hasClass(this.dragObj, this.frameClass); + var isBlock = Util.hasClass(this.dragObj, this.blockClass) && Util.hasClass($(ele.name).parentNode, this.moveableColumn); + if ( isTab || isFrame || isBlock) { + var _Y = ele['top'] - _clientY; + var _X = ele['left'] - _clientX; + var distance = Math.sqrt(Math.pow(_X, 2) + Math.pow(_Y, 2)); + if (distance < max) { + max = distance; + id = ele.name; + } + } + } + for (var i in ele['columns']) { + var column = ele['columns'][i]; + if (column instanceof Column) { + for (var j in column['children']) { + if ((column['children'][j] instanceof Tab || column['children'][j] instanceof Frame || column['children'][j] instanceof Block)) { + var min = this._getMinDistance(column['children'][j], max); + if (min.distance < max) { + id = min.id; + max = min.distance; + } + } + } + } + } + return {"id":id, "distance":max}; + } else { + if (isTabInTab) return {'id': ele['name'], 'distance': max}; + var _Y = ele['top'] - _clientY; + var _X = ele['left'] - _clientX; + var distance = Math.sqrt(Math.pow(_X, 2) + Math.pow(_Y, 2)); + if (distance < max) { + return {'id': ele['name'], 'distance': distance}; + } else { + return {'id': ele['name'], 'distance': max}; + } + } + }, + getObjByName : function (name, data) { + if (!name) return false; + data = data || this.data; + if ( data instanceof Frame) { + if (data.name == name) { + return data; + } else { + var d = this.getObjByName(name,data['columns']); + if (name == d.name) return d; + } + } else if (data instanceof Block) { + if (data.name == name) return data; + } else if (typeof data == 'object') { + for (var i in data) { + var d = this.getObjByName(name, data[i]); + if (name == d.name) return d; + } + } + return false; + }, + initPosition : function () { + this.data = [],this.allBlocks = []; + var blocks = $C(this.blockClass); + for(var i = 0; i < blocks.length; i++) { + if (blocks[i]['id'].indexOf('temp') < 0) { + this.checkEdit(blocks[i]); + this.allBlocks.push(blocks[i]['id'].replace('portal_block_','')); + } + } + var areaLen = this.moveableArea.length; + for (var j = 0; j < areaLen; j++ ) { + var area = this.moveableArea[j]; + var areaData = []; + if (typeof area == 'object') { + this.checkTempDiv(area.id); + var frames = area.childNodes; + for (var i in frames) { + if (typeof(frames[i]) != 'object') continue; + if (Util.hasClass(frames[i], this.frameClass) || Util.hasClass(frames[i], this.blockClass) + || Util.hasClass(frames[i], this.tabClass) || Util.hasClass(frames[i], this.moveableObject)) { + areaData.push(this.initFrame(frames[i])); + } + } + this.data[area.id] = areaData; + } + } + this._replaceFlag = true; + }, + removeBlockPointer : function(e) {this.removeBlock(e);}, + toggleContent : function (e) { + if ( typeof e !== 'string') { + e = Util.event(e); + var id = e.aim.id.replace('_edit_toggle',''); + } else { + id = e; + } + var obj = this.getObjByName(id); + var display = ''; + if (obj instanceof Block || obj instanceof Tab) { + display = $(id+'_content').style.display; + Util.toggleEle(id+'_content'); + } else { + var col = obj.columns; + for (var i in col) { + display = $(i).style.display; + Util.toggleEle($(i)); + } + } + + if(display != '') { + e.aim.src=STATICURL+'/image/common/fl_collapsed_no.gif'; + } else { + e.aim.src=STATICURL+'/image/common/fl_collapsed_yes.gif'; + } + }, + checkEdit : function (ele) { + if (!ele || Util.hasClass(ele, 'temp') || ele.getAttribute('noedit')) return false; + var id = ele.id; + var _method = this; + if (!$(id+'_edit')) { + var _method = this; + var dom = document.createElement('div'); + dom.className = 'edit hide'; + dom.id = id+'_edit'; + dom.innerHTML = '编辑'; + ele.appendChild(dom); + $(id+'_edit_menu').onclick = function (e){Drag.prototype.toggleMenu.call(_method, e, this);}; + } + ele.onmouseover = function (e) {Drag.prototype.showEdit.call(_method,e);}; + ele.onmouseout = function (e) {Drag.prototype.hideEdit.call(_method,e);}; + }, + initFrame : function (frameEle) { + if (typeof(frameEle) != 'object') return ''; + var frameId = frameEle.id; + if(!this.sampleMode) { + this.checkEdit(frameEle); + } + var moveable = Util.hasClass(frameEle, this.moveableObject); + var frameObj = ''; + if (Util.hasClass(frameEle, this.tabClass)) { + this._initTabActivity(frameEle); + frameObj = new Tab(frameId, frameEle.className, Util.getOffset(frameEle,false), Util.getOffset(frameEle,true), moveable); + } else if (Util.hasClass(frameEle, this.frameClass) || Util.hasClass(frameEle, this.moveableObject)) { + if (Util.hasClass(frameEle, this.frameClass) && !this._replaceFlag) this._replaceFrameColumn(frameEle); + frameObj = new Frame(frameId, frameEle.className, Util.getOffset(frameEle,false), Util.getOffset(frameEle,true), moveable); + } + this._initColumn(frameObj, frameEle); + + return frameObj; + }, + _initColumn : function (frameObj,frameEle) { + var columns = frameEle.children; + if (Util.hasClass(frameEle.parentNode.parentNode,this.tabClass)) { + var col2 = $(frameEle.id+'_content').children; + var len = columns.length; + for (var i in col2) { + if (typeof(col2[i]) == 'object') columns[len+i] = col2[i]; + } + } + for (var i in columns) { + if (typeof(columns[i]) != 'object') continue; + if (Util.hasClass(columns[i], this.titleClass)) { + this._initTitle(frameObj, columns[i]); + } + this._initEleTitle(frameObj, frameEle); + if (Util.hasClass(columns[i], this.moveableColumn)) { + var columnId = columns[i].id; + var column = new Column(columnId, columns[i].className); + frameObj.addColumn(column); + this.checkTempDiv(columnId); + var elements = columns[i].children; + var eleLen = elements.length; + for (var j = 0; j < eleLen; j++) { + var ele = elements[j]; + if (Util.hasClass(ele, this.frameClass) || Util.hasClass(ele, this.tabClass)) { + var frameObj2 = this.initFrame(ele); + frameObj.addFrame(columnId, frameObj2); + } else if (Util.hasClass(ele, this.blockClass) || Util.hasClass(ele, this.moveableObject)) { + var block = new Block(ele.id, ele.className, Util.getOffset(ele, false), Util.getOffset(ele, true)); + for (var k in ele.children) { + if (Util.hasClass(ele.children[k], this.titleClass)) this._initTitle(block, ele.children[k]); + } + this._initEleTitle(block, ele); + frameObj.addBlock(columnId, block); + } + } + } + } + }, + _initTitle : function (obj, ele) { + if (Util.hasClass(ele, this.titleClass)) { + obj.titles['className'] = [ele.className]; + obj.titles['style'] = {}; + if (ele.style.backgroundImage) obj.titles['style']['background-image'] = ele.style.backgroundImage; + if (ele.style.backgroundRepeat) obj.titles['style']['background-repeat'] = ele.style.backgroundRepeat; + if (ele.style.backgroundColor) obj.titles['style']['background-color'] = ele.style.backgroundColor; + if (obj instanceof Tab) { + obj.titles['switchType'] = []; + obj.titles['switchType'][0] = ele.getAttribute('switchtype') ? ele.getAttribute('switchtype') : 'click'; + } + var ch = ele.children; + for (var k in ch) { + if (Util.hasClass(ch[k], this.titleTextClass)){ + this._getTitleData(obj, ch[k], 'first'); + } else if (typeof ch[k] == 'object' && !Util.hasClass(ch[k], this.moveableObject)) { + this._getTitleData(obj, ch[k]); + } + } + } + }, + _getTitleData : function (obj, ele, i) { + var shref = '',ssize = '',sfloat = '',scolor = '',smargin = '',stext = '', src = ''; + var collection = ele.getElementsByTagName('a'); + if (collection.length > 0) { + shref = collection[0]['href']; + scolor = collection[0].style['color'] + ' !important'; + } + collection = ele.getElementsByTagName('img'); + if (collection.length > 0) { + src = collection[0]['src']; + } + + stext = Util.getText(ele); + + if (stext || src) { + scolor = scolor ? scolor : ele.style['color']; + sfloat = ele.style['styleFloat'] ? ele.style['styleFloat'] : ele.style['cssFloat'] ; + sfloat = sfloat == undefined ? '' : sfloat; + var margin_ = sfloat == '' ? 'left' : sfloat; + smargin = parseInt(ele.style[('margin-'+margin_).property2js()]); + smargin = smargin ? smargin : ''; + ssize = parseInt(ele.style['fontSize']); + ssize = ssize ? ssize : ''; + var data = {'text':stext, 'href':shref,'color':scolor, 'float':sfloat, 'margin':smargin, 'font-size':ssize, 'className':ele.className, 'src':src}; + if (i) { + obj.titles[i] = data; + } else { + obj.titles.push(data); + } + } + }, + _initEleTitle : function (obj,ele) { + if (Util.hasClass(ele, this.moveableObject)) { + if (obj.titles['first'] && obj.titles['first']['text']) { + var title = obj.titles['first']['text']; + } else { + var title = obj.name; + } + } + }, + showBlockName : function (ele) { + var title = $C('block-name', ele, 'div'); + if(title.length) { + Util.show(title[0]); + } + }, + hideBlockName : function (ele) { + var title = $C('block-name', ele, 'div'); + if(title.length) { + Util.hide(title[0]); + } + }, + showEdit : function (e) { + e = Util.event(e); + var targetObject = Util.getTarget(e,'className',this.moveableObject); + if (targetObject) { + Util.show(targetObject.id + '_edit'); + targetObject.style.backgroundColor="#fffacd"; + this.showBlockName(targetObject); + } else { + var targetFrame = Util.getTarget(e,'className',this.frameClass); + if (typeof targetFrame == 'object') { + Util.show(targetFrame.id + '_edit'); + targetFrame.style.backgroundColor="#fffacd"; + } + } + }, + hideEdit : function (e) { + e = Util.event(e); + var targetObject = Util.getTarget(e,'className',this.moveableObject); + var targetFrame = Util.getTarget(e,'className',this.frameClass); + if (typeof targetFrame == 'object') { + Util.hide(targetFrame.id + '_edit'); + targetFrame.style.backgroundColor = ''; + } + if (typeof targetObject == 'object') { + Util.hide(targetObject.id + '_edit'); + targetObject.style.backgroundColor = ''; + this.hideBlockName(targetObject); + } + }, + toggleMenu : function (e, obj) { + e = Util.event(e); + e.stopPropagation(); + var objPara = {'top' : Util.getOffset( obj, false),'left' : Util.getOffset( obj, true), + 'width' : obj['offsetWidth'], 'height' : obj['offsetHeight']}; + + var dom = $('edit_menu'); + if (dom) { + if (objPara.top + objPara.height == Util.getOffset(dom, false) && objPara.left == Util.getOffset(dom, true)) { + dom.parentNode.removeChild(dom); + } else { + dom.style.top = objPara.top + objPara.height + 'px'; + dom.style.left = objPara.left + 'px'; + dom.innerHTML = this._getMenuHtml(e, obj); + } + } else { + var html = this._getMenuHtml(e, obj); + if (html != '') { + dom = document.createElement('div'); + dom.id = 'edit_menu'; + dom.className = 'edit-menu'; + dom.style.top = objPara.top + objPara.height + 'px'; + dom.style.left = objPara.left + 'px'; + dom.innerHTML = html; + document.body.appendChild(dom); + var _method = this; + document.body.onclick = function(e){Drag.prototype.removeMenu.call(_method, e);}; + } + } + }, + _getMenuHtml : function (e,obj) { + var id = obj.id.replace('_edit_menu',''); + var html = '
                    '; + if (typeof this.menu[id] == 'object') html += this._getMenuHtmlLi(id, this.menu[id]); + if (Util.hasClass($(id),this.tabClass) && typeof this.menu['tab'] == 'object') html += this._getMenuHtmlLi(id, this.menu['tab']); + if (Util.hasClass($(id),this.frameClass) && typeof this.menu['frame'] == 'object') html += this._getMenuHtmlLi(id, this.menu['frame']); + if (Util.hasClass($(id),this.blockClass) && typeof this.menu['block'] == 'object') html += this._getMenuHtmlLi(id, this.menu['block']); + if (typeof this.menu['default'] == 'object' && this.getObjByName(id)) html += this._getMenuHtmlLi(id, this.menu['default']); + html += '
                  '; + return html == '
                    ' ? '' : html; + }, + _getMenuHtmlLi : function (id, cmds) { + var li = ''; + var len = cmds.length; + for (var i=0; i'+cmds[i]['cmdName']+''; + } + return li; + }, + removeMenu : function (e) { + var dom = $('edit_menu'); + if (dom) dom.parentNode.removeChild(dom); + document.body.onclick = ''; + }, + addMenu : function (objId,cmdName,cmd) { + if (typeof this.menu[objId] == 'undefined') this.menu[objId] = []; + this.menu[objId].push({'cmdName':cmdName, 'cmd':cmd}); + }, + setDefalutMenu : function () {}, + setSampleMenu : function () {}, + + getPositionKey : function (n) { + this.initPosition(); + n = parseInt(n); + var i = 0; + for (var k in this.position) { + if (i++ >= n) break; + } + return k; + }, + + checkTempDiv : function (_id) { + if(_id) { + var id = _id+'_temp'; + var dom = $(id); + if (dom == null || typeof dom == 'undefined') { + dom = document.createElement("div"); + dom.className = this.moveableObject+' temp'; + dom.id = id; + $(_id).appendChild(dom); + } + } + }, + _setCssPosition : function (ele, value) { + while (ele && ele.parentNode && ele.id != 'ct') { + if (Util.hasClass(ele,this.frameClass) || Util.hasClass(ele,this.tabClass)) ele.style.position = value; + ele = ele.parentNode; + } + }, + initDragObj : function (e) { + e = Util.event(e); + var target = Util.getTarget(e,'className',this.moveableObject); + if (!target) {return false;} + if (this.overObj != target && target.id !='tmpbox') { + this.overObj = target; + this.overObj.style.cursor = 'move'; + } + }, + dragStart : function (e) { + e = Util.event(e); + if (e.aim['id'] && e.aim['id'].indexOf && e.aim['id'].indexOf('_edit') > 0) return false; + if(e.which != 1 ) {return false;} + this.overObj = this.dragObj = Util.getTarget(e,'className',this.moveableObject); + if (!this.dragObj || Util.hasClass(this.dragObj,'temp')) {return false;} + if (!this.getTmpBoxElement()) return false; + this.getRelative(); + this._setCssPosition(this.dragObj.parentNode.parentNode, "static"); + var offLeft = Util.getOffset( this.dragObj, true ); + var offTop = Util.getOffset( this.dragObj, false ); + var offWidth = this.dragObj['offsetWidth']; + this.dragObj.style.position = 'absolute'; + this.dragObj.style.left = offLeft + "px"; + this.dragObj.style.top = offTop - 3 + "px"; + this.dragObj.style.width = offWidth + 'px'; + this.dragObj.lastMouseX = e.clientX; + this.dragObj.lastMouseY = e.clientY; + Util.insertBefore(this.tmpBoxElement,this.overObj); + Util.addClass(this.dragObj,this.moving); + this.dragObj.style.zIndex = 500 ; + this.scroll = Util.getScroll(); + var _method = this; + document.onscroll = function(){Drag.prototype.resetObj.call(_method, e);}; + window.onscroll = function(){Drag.prototype.resetObj.call(_method, e);}; + document.onmousemove = function (e){Drag.prototype.drag.call(_method, e);}; + }, + getRelative : function () { + this.dargRelative = {'up': this.dragObj.previousSibling, 'down': this.dragObj.nextSibling}; + }, + resetObj : function (e) { + if (this.dragObj){ + e = Util.event(e); + var p = Util.getScroll(); + var _t = p.t - this.scroll.t; + var _l = p.l - this.scroll.l; + var t = parseInt(this.dragObj.style.top); + var l = parseInt(this.dragObj.style.left); + t += _t; + l += _l; + this.dragObj.style.top =t+'px'; + this.dragObj.style.left =l+'px'; + this.scroll = Util.getScroll(); + } + }, + drag : function (e) { + e = Util.event(e); + if(!this.isDragging) { + this.dragObj.style.filter = "alpha(opacity=60)" ; + this.dragObj.style.opacity = 0.6 ; + this.isDragging = true ; + } + var _clientX = e.clientX; + var _clientY = e.clientY; + if (this.dragObj.lastMouseX == _clientX && this.dragObj.lastMouseY == _clientY) return false ; + var _lastY = parseInt(this.dragObj.style.top); + var _lastX = parseInt(this.dragObj.style.left); + _lastX = isNaN(_lastX) ? 0 :_lastX; + _lastY = isNaN(_lastY) ? 0 :_lastY; + var newX, newY; + newY = _lastY + _clientY - this.dragObj.lastMouseY; + newX = _lastX + _clientX - this.dragObj.lastMouseX; + + this.dragObj.style.left = newX +"px "; + this.dragObj.style.top = newY + "px "; + this.dragObj.lastMouseX = _clientX; + this.dragObj.lastMouseY = _clientY; + var obj = this.getCurrentOverObj(e); + if (obj && this.overObj != obj) { + this.overObj = obj; + this.getTmpBoxElement(); + Util.insertBefore(this.tmpBoxElement, this.overObj); + this.dragObjFrame = this.dragObj.parentNode.parentNode; + this.overObjFrame = this.overObj.parentNode.parentNode; + } + Util.cancelSelect(); + }, + _pushTabContent : function (tab, ele){ + if (Util.hasClass(ele, this.frameClass) || Util.hasClass(ele, this.tabClass)) { + var dom = $(ele.id+'_content'); + if (!dom) { + dom = document.createElement('div'); + dom.id = ele.id+'_content'; + dom.className = Util.hasClass(ele, this.frameClass) ? this.contentClass+' cl '+ele.className.substr(ele.className.lastIndexOf(' ')+1) : this.contentClass+' cl'; + } + var frame = this.getObjByName(ele.id); + if (frame) { + for (var i in frame['columns']) { + if (frame['columns'][i] instanceof Column) dom.appendChild($(i)); + } + } else { + var children = ele.childNodes; + var arrDom = []; + for (var i in children) { + if (typeof children[i] != 'object') continue; + if (Util.hasClass(children[i],this.moveableColumn) || Util.hasClass(children[i],this.tabContentClass)) { + arrDom.push(children[i]); + } + } + var len = arrDom.length; + for (var i = 0; i < len; i++) { + dom.appendChild(arrDom[i]); + } + } + $(tab.id+'_content').appendChild(dom); + } else if (Util.hasClass(ele, this.blockClass)) { + if ($(ele.id+'_content')) $(tab.id+'_content').appendChild($(ele.id+'_content')); + } + }, + _popTabContent : function (tab, ele){ + if (Util.hasClass(ele, this.frameClass) || Util.hasClass(ele, this.tabClass)) { + Util.removeClass(ele, this.tabActivityClass); + var eleContent = $(ele.id+'_content'); + if (!eleContent) return false; + var children = eleContent.childNodes; + var arrEle = []; + for (var i in children) { + if (typeof children[i] == 'object') arrEle.push(children[i]); + } + var len = arrEle.length; + for (var i = 0; i < len; i++) { + ele.appendChild(arrEle[i]); + } + children = ''; + $(tab.id+'_content').removeChild(eleContent); + } else if (Util.hasClass(ele, this.blockClass)) { + if ($(ele.id+'_content')) Util.show($(ele.id+'_content')); + if ($(ele.id+'_content')) ele.appendChild($(ele.id+'_content')); + } + }, + _initTabActivity : function (ele) { + if (!Util.hasClass(ele,this.tabClass)) return false; + var tabs = $(ele.id+'_title').childNodes; + var arrTab = []; + for (var i in tabs) { + if (typeof tabs[i] != 'object') continue; + var tabId = tabs[i].id; + if (Util.hasClass(tabs[i],this.frameClass) || Util.hasClass(tabs[i],this.tabClass)) { + if (!this._replaceFlag) this._replaceFrameColumn(tabs[i]); + if (!$(tabId + '_content')) { + var arrColumn = []; + for (var j in tabs[i].childNodes) { + if (Util.hasClass(tabs[i].childNodes[j], this.moveableColumn)) arrColumn.push(tabs[i].childNodes[j]); + } + var frameContent = document.createElement('div'); + frameContent.id = tabId + '_content'; + frameContent.className = Util.hasClass(tabs[i], this.frameClass) ? this.contentClass+' cl '+tabs[i].className.substr(tabs[i].className.lastIndexOf(' ')+1) : this.contentClass+' cl'; + var colLen = arrColumn.length; + for (var k = 0; k < colLen; k++) { + frameContent.appendChild(arrColumn[k]); + } + } + arrTab.push(tabs[i]); + } else if (Util.hasClass(tabs[i],this.blockClass)) { + var frameContent = $(tabId+'_content'); + if (frameContent) { + frameContent = Util.hasClass(frameContent.parentNode,this.blockClass) ? frameContent : ''; + } else { + frameContent = document.createElement('div'); + frameContent.id = tabId+'_content'; + } + arrTab.push(tabs[i]); + } + if (frameContent) $(ele.id + '_content').appendChild(frameContent); + } + var len = arrTab.length; + for (var i = 0; i < len; i++) { + Util[i > 0 ? 'hide' : 'show']($(arrTab[i].id+'_content')); + } + }, + dragEnd : function (e) { + e = Util.event(e); + if(!this.dragObj) {return false;} + document.onscroll = function(){}; + window.onscroll = function(){}; + document.onmousemove = function(e){}; + document.onmouseup = ''; + if (this.tmpBoxElement.parentNode) { + if (this.tmpBoxElement.parentNode == document.body) { + document.body.removeChild(this.tmpBoxElement); + document.body.removeChild(this.dragObj); + this.fn = ''; + } else { + Util.removeClass(this.dragObj,this.moving); + this.dragObj.style.display = 'none'; + this.dragObj.style.width = '' ; + this.dragObj.style.top = ''; + this.dragObj.style.left = ''; + this.dragObj.style.zIndex = ''; + this.dragObj.style.position = 'relative'; + this.dragObj.style.backgroundColor = ''; + this.isDragging = false ; + this.tmpBoxElement.parentNode.replaceChild(this.dragObj, this.tmpBoxElement); + Util.fadeIn(this.dragObj); + this.tmpBoxElement=''; + this._setCssPosition(this.dragObjFrame, 'relative'); + this.doEndDrag(); + this.initPosition(); + if (!(this.dargRelative.up == this.dragObj.previousSibling && this.dargRelative.down == this.dragObj.nextSibling)) { + this.setClose(); + } + this.dragObjFrame = this.overObjFrame = null; + } + } + this.newFlag = false; + if (typeof this.fn == 'function') {this.fn();} + }, + doEndDrag : function () { + if (!Util.hasClass(this.dragObjFrame, this.tabClass) && Util.hasClass(this.overObjFrame, this.tabClass)) { + this._pushTabContent(this.overObjFrame, this.dragObj); + }else if (Util.hasClass(this.dragObjFrame, this.tabClass) && !Util.hasClass(this.overObjFrame, this.tabClass)) { + this._popTabContent(this.dragObjFrame, this.dragObj); + }else if (Util.hasClass(this.dragObjFrame, this.tabClass) && Util.hasClass(this.overObjFrame, this.tabClass)) { + if (this.dragObjFrame != this.overObjFrame) { + this._popTabContent(this.dragObjFrame, this.dragObj); + this._pushTabContent(this.overObjFrame, this.dragObj); + } + } else { + } + + }, + _replaceFrameColumn : function (ele,flag) { + var children = ele.childNodes; + var fcn = ele.className.match(/(frame-[\w-]*)/); + if (!fcn) return false; + var frameClassName = fcn[1]; + for (var i in children) { + if (Util.hasClass(children[i], this.moveableColumn)) { + var className = children[i].className; + className = className.replace(' col-l', ' '+frameClassName+'-l'); + className = className.replace(' col-r', ' '+frameClassName+'-r'); + className = className.replace(' col-c', ' '+frameClassName+'-c'); + className = className.replace(' mn', ' '+frameClassName+'-l'); + className = className.replace(' sd', ' '+frameClassName+'-r'); + children[i].className = className; + } + } + }, + stopCmd : function () { + this.rein.length > 0 ? this.rein.pop()() : ''; + }, + setClose : function () { + if (!this.isChange) { + window.onbeforeunload = function() { + return '您的数据已经修改,退出将无法保存您的修改。'; + }; + } + this.isChange = true; + }, + clearClose : function () { + this.isChange = false; + window.onbeforeunload = function () {}; + }, + _getMoveableArea : function (ele) { + ele = ele ? ele : document.body; + this.moveableArea = $C(this.areaClass, ele, 'div'); + }, + initMoveableArea : function () { + var _method = this; + this._getMoveableArea(); + var len = this.moveableArea.length; + for (var i = 0; i < len; i++) { + var el = this.moveableArea[i]; + if (el == null || typeof el == 'undefined') return false; + el.ondragstart = function (e) {return false;}; + el.onmouseover = function (e) {Drag.prototype.initDragObj.call(_method, e);}; + el.onmousedown = function (e) {Drag.prototype.dragStart.call(_method, e);}; + el.onmouseup = function (e) {Drag.prototype.dragEnd.call(_method, e);}; + el.onclick = function (e) {e = Util.event(e);e.preventDefault();}; + } + if ($('contentframe')) $('contentframe').ondragstart = function (e) {return false;}; + }, + disableAdvancedStyleSheet : function () { + if(this.advancedStyleSheet) { + this.advancedStyleSheet.disabled = true; + } + }, + enableAdvancedStyleSheet : function () { + if(this.advancedStyleSheet) { + this.advancedStyleSheet.disabled = false; + } + }, + init : function (sampleMode) { + this.initCommon(); + this.setSampleMode(sampleMode); + if(!this.sampleMode) { + this.initAdvanced(); + } else { + this.initSample(); + } + return true; + }, + initAdvanced : function () { + this.initMoveableArea(); + this.initPosition(); + this.setDefalutMenu(); + this.enableAdvancedStyleSheet(); + this.showControlPanel(); + this.initTips(); + if(this.goonDIY) this.goonDIY(); + this.openfn(); + }, + + openfn : function () { + var openfn = loadUserdata('openfn'); + if(openfn) { + if(typeof openfn == 'function') { + openfn(); + } else { + eval(openfn); + } + saveUserdata('openfn', ''); + } + }, + initCommon : function () { + this.advancedStyleSheet = $('diy_common'); + this.menu = []; + }, + initSample : function () { + this._getMoveableArea(); + this.initPosition(); + this.sampleBlocks = $C(this.blockClass); + this.initSampleBlocks(); + this.setSampleMenu(); + this.disableAdvancedStyleSheet(); + this.hideControlPanel(); + }, + initSampleBlocks : function () { + if(this.sampleBlocks) { + for(var i = 0; i < this.sampleBlocks.length; i++){ + this.checkEdit(this.sampleBlocks[i]); + } + } + }, + setSampleMode : function (sampleMode) { + if(loadUserdata('diy_advance_mode')) { + this.sampleMode = ''; + } else { + this.sampleMode = sampleMode; + saveUserdata('diy_advance_mode', sampleMode ? '' : '1'); + } + + }, + + hideControlPanel : function() { + Util.show('samplepanel'); + Util.hide('controlpanel'); + Util.hide('diy-tg'); + }, + + showControlPanel : function() { + Util.hide('samplepanel'); + Util.show('controlpanel'); + Util.show('diy-tg'); + }, + checkHasFrame : function (obj) { + obj = !obj ? this.data : obj; + for (var i in obj) { + if (obj[i] instanceof Frame && obj[i].className.indexOf('temp') < 0 ) { + return true; + } else if (typeof obj[i] == 'object') { + if (this.checkHasFrame(obj[i])) return true; + } + } + return false; + }, + deleteFrame : function (name) { + if (typeof name == 'string') { + if (typeof window['c'+name+'_frame'] == 'object' && !BROWSER.ie) delete window['c'+name+'_frame']; + } else { + for(var i = 0,L = name.length;i < L;i++) { + if (typeof window['c'+name[i]+'_frame'] == 'object' && !BROWSER.ie) delete window['c'+name[i]+'_frame']; + } + } + }, + saveViewTip : function (tipname) { + if(tipname) { + saveUserdata(tipname, '1'); + Util.hide(tipname); + } + doane(); + }, + initTips : function () { + var tips = ['diy_backup_tip']; + for(var i = 0; i < tips.length; i++) { + if(tips[i] && !loadUserdata(tips[i])) { + Util.show(tips[i]); + } + } + }, + extend : function (obj) { + for (var i in obj) { + this[i] = obj[i]; + } + } + }; + + DIY = function() { + this.frames = []; + this.isChange = false; + this.spacecss = []; + this.style = 't1'; + this.currentDiy = 'body'; + this.opSet = []; + this.opPointer = 0; + this.backFlag = false; + this.styleSheet = {} ; + this.scrollHeight = 0 ; + }; + DIY.prototype = { + + init : function (mod) { + drag.init(mod); + this.style = document.diyform.style.value; + if (this.style == '') { + var reg = RegExp('topic\(.*)\/style\.css'); + var href = $('style_css') ? $('style_css').href : ''; + var arr = reg.exec(href); + this.style = arr && arr.length > 1 ? arr[1] : ''; + } + this.currentLayout = typeof document.diyform.currentlayout == 'undefined' ? '' : document.diyform.currentlayout.value; + this.initStyleSheet(); + if (this.styleSheet.rules) this.initDiyStyle(); + }, + initStyleSheet : function () { + var all = document.styleSheets; + for (var i=0;i -1) { + var body = BROWSER.ie ? 'BODY' : 'body'; + selector = selector.replace(/body/i,body); + } + if (s.indexOf(' a') > -1) { + selector = BROWSER.ie ? selector.replace(/ [aA]/,' A') : selector.replace(/ [aA]/,' a'); + } + return selector; + }, + initPalette : function (id) { + var bgcolor = '',selector = '',bgimg = '',bgrepeat = '', bgposition = '', bgattachment = '', bgfontColor = '', bglinkColor = '', i = 0; + var repeat = ['repeat','no-repeat','repeat-x','repeat-y']; + var attachment = ['scroll','fixed']; + var position = ['left top','center top','right top','left center','center center','right center','left bottom','center bottom','right bottom']; + var position_ = ['0% 0%','50% 0%','100% 0%','0% 50%','50% 50%','100% 50%','0% 100%','50% 100%','100% 100%']; + + selector = this.getSelector(id); + bgcolor = Util.formatColor(this.styleSheet.getRule(selector,'backgroundColor')); + bgimg = this.styleSheet.getRule(selector,'backgroundImage'); + bgrepeat = this.styleSheet.getRule(selector,'backgroundRepeat'); + bgposition = this.styleSheet.getRule(selector,'backgroundPosition'); + bgattachment = this.styleSheet.getRule(selector,'backgroundAttachment'); + bgfontColor = Util.formatColor(this.styleSheet.getRule(selector,'color')); + bglinkColor = Util.formatColor(this.styleSheet.getRule(this.getSelector(selector+' a'),'color')); + + var selectedIndex = 0; + for (i=0;i -1) { + this.spacecss[k] = []; + } + } + continue; + } + var rule = this.spacecss[i]; + if (typeof rule == "function") continue; + var one = ''; + rule = this.formatCssRule(rule); + for (var j in rule) { + var content = this.spacecss[i][j]; + if (content && typeof content == "string" && content.length > 0) { + content = this.trimCssImportant(content); + content = content ? content + ' !important;' : ';'; + one += j + ":" + content; + } + } + if (one == '') continue; + css += i + " {" + one + "}"; + } + return css; + }, + formatCssRule : function (rule) { + var arr = ['top', 'right', 'bottom', 'left'], i = 0; + if (typeof rule['margin-top'] != 'undefined') { + var margin = rule['margin-bottom']; + if (margin && margin == rule['margin-top'] && margin == rule['margin-right'] && margin == rule['margin-left']) { + rule['margin'] = margin; + for(i=0;i currentLayoutLength) { + var block = this.getRandomBlockName(); + var dom = document.createElement('div'); + dom.id = 'frame1_right'; + dom.className = drag.moveableColumn + ' z'; + dom.appendChild($(block)); + $('frame1').appendChild(dom); + $('frame1_left').style.width = dataArr[0]+'px'; + $('frame1_center').style.width = dataArr[1]+'px'; + dom.style.width = dataArr[2]+'px'; + } else if (newLayoutLength < currentLayoutLength) { + var _length = drag.data['diypage'][0]['columns']['frame1_right']['children'].length; + var tobj = $('frame1_center_temp'); + for (var i = 0; i < _length; i++) { + var name = drag.data['diypage'][0]['columns']['frame1_right']['children'][i].name; + if (name.indexOf('temp') < 0) $('frame1_center').insertBefore($(name),tobj); + } + $('frame1').removeChild($('frame1_right')); + $('frame1_left').style.width = dataArr[0]+'px'; + $('frame1_center').style.width = dataArr[1]+'px'; + } + + var className = $('layout'+this.currentLayout).className; + $('layout'+this.currentLayout).className = ''; + $('layout'+newLayout).className = className; + this.currentLayout = newLayout; + drag.initPosition(); + drag.setClose(); + }, + getRandomBlockName : function () { + var left = drag.data['diypage'][0]['columns']['frame1_left']['children']; + if (left.length > 2) { + var block = left[0]; + } else { + var block = drag.data['diypage'][0]['columns']['frame1_center']['children'][0]; + } + return block.name; + }, + changeStyle : function (t) { + if (t == '') return false; + $('style_css').href=STATICURL+t+"/style.css"; + + if (!this.backFlag) { + var oldData = [this.style]; + var newData = [t]; + var random = Math.random(); + this.addOpRecord ('this.changeStyle', newData, oldData, random); + } + var arr = t.split("/"); + this.style = arr[arr.length-1]; + drag.setClose(); + }, + setCurrentDiy : function (type) { + if (type) { + $('diy_tag_'+this.currentDiy).className = ''; + this.currentDiy = type; + $('diy_tag_'+this.currentDiy).className = 'activity'; + this.initPalette(this.currentDiy); + } + }, + hideBg : function () { + var random = Math.random(); + this.setStyle(this.currentDiy, 'background-image', '', random); + this.setStyle(this.currentDiy, 'background-color', '', random); + if (this.currentDiy == 'hd') this.setStyle(this.currentDiy, 'height', '', random); + this.initPalette(this.currentDiy); + }, + toggleHeader : function () { + var random = Math.random(); + if ($('header_hide_cb').checked) { + this.setStyle('#hd', 'height', '260px', random); + this.setStyle('#hd', 'background-image', 'none', random); + this.setStyle('#hd', 'border-width', '0px', random); + } else { + this.setStyle('#hd', 'height', '', random); + this.setStyle('#hd', 'background-image', '', random); + this.setStyle('#hd', 'border-width', '', random); + } + }, + setBgImage : function (value) { + var path = typeof value == "string" ? value : value.src; + if (path.indexOf('.thumb') > 0) { + path = path.substring(0,path.indexOf('.thumb')); + } + if (path == '' || path == 'undefined') return false; + var random = Math.random(); + this.setStyle(this.currentDiy, 'background-image', Util.url(path), random); + this.setStyle(this.currentDiy, 'background-repeat', 'repeat', random); + if (this.currentDiy == 'hd') { + var _method = this; + var img = new Image(); + img.onload = function () { + if (parseInt(img.height) < 140) { + DIY.prototype.setStyle.call(_method, _method.currentDiy, 'background-repeat', 'repeat', random); + DIY.prototype.setStyle.call(_method, _method.currentDiy, 'height', '', random); + } else { + DIY.prototype.setStyle.call(_method, _method.currentDiy, 'height', img.height+"px", random); + } + }; + img.src = path; + } + }, + setBgRepeat : function (value) { + var repeat = ['repeat','no-repeat','repeat-x','repeat-y']; + if (typeof repeat[value] == 'undefined') {return false;} + this.setStyle(this.currentDiy, 'background-repeat', repeat[value]); + }, + setBgAttachment : function (value) { + var attachment = ['scroll','fixed']; + if (typeof attachment[value] == 'undefined') {return false;} + this.setStyle(this.currentDiy, 'background-attachment', attachment[value]); + }, + setBgColor : function (color) { + this.setStyle(this.currentDiy, 'background-color', color); + }, + setTextColor : function (color) { + this.setStyle(this.currentDiy, 'color', color); + }, + setLinkColor : function (color) { + this.setStyle(this.currentDiy + ' a', 'color', color); + }, + setBgPosition : function (id) { + var td = $(id); + var i = id.substr(id.length-1); + var position = ['left top','center top','right top','left center','center center','right center','left bottom','center bottom','right bottom']; + td.className = 'red'; + for (var j=0;j<9;j++) { + if (i != j) { + $('bgimgposition'+j).className = ''; + } + } + this.setStyle(this.currentDiy, 'background-position', position[i]); + }, + getSelector : function (currentDiv) { + var arr = currentDiv.split(' '); + currentDiv = arr[0]; + var link = ''; + if (arr.length > 1) { + link = (arr[arr.length-1].toLowerCase() == 'a') ? link = ' '+arr.pop() : ''; + currentDiv = arr.join(' '); + } + var selector = ''; + switch(currentDiv) { + case 'blocktitle' : + selector = '#ct .move-span .blocktitle'; + break; + case 'body' : + case 'BODY' : + selector = BROWSER.ie ? 'BODY' : 'body'; + break; + default : + selector = currentDiv.indexOf("#")>-1 ? currentDiv : "#"+currentDiv; + } + var rega = BROWSER.ie ? ' A' : ' a'; + selector = (selector+link).replace(/ a/i,rega); + return selector; + }, + setStyle : function (currentDiv, property, value, random, num){ + property = trim(property).toLowerCase(); + var propertyJs = property.property2js(); + if (typeof value == 'undefined') value = ''; + var selector = this.getSelector(currentDiv); + + if (!this.backFlag) { + var rule = this.styleSheet.getRule(selector,propertyJs); + rule = rule.replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); + var oldData = [currentDiv, property, rule]; + var newData = [currentDiv, property, value]; + if (typeof random == 'undefined') random = Math.random(); + this.addOpRecord ('this.setStyle', newData, oldData, random); + } + value = this.trimCssImportant(value); + value = value ? value + ' !important' : ''; + var pvalue = value ? property+':'+value : ''; + this.styleSheet.addRule(selector,pvalue,num,property); + Util.recolored(); + + if (typeof this.spacecss[selector] == 'undefined') { + this.spacecss[selector] = []; + } + this.spacecss[selector][property] = value; + drag.setClose(); + }, + trimCssImportant : function (value) { + if (value instanceof Array) value = value.join(' '); + return value ? value.replace(/!( ?)important/g,'').replace(/ /g,' ').replace(/^ | $/g,'') : ''; + }, + removeCssSelector : function (selector) { + for (var i in this.spacecss) { + if (typeof this.spacecss[i] == "function") continue; + if (i.indexOf(selector) > -1) { + this.styleSheet.removeRule(i); + this.spacecss[i] = []; + } + } + }, + undo : function () { + if (this.opSet.length == 0) return false; + var oldData = ''; + if (this.opPointer <= 0) {return '';} + var step = this.opSet[--this.opPointer]; + var random = step['random']; + + var cmd = step['cmd'].split(','); + var cmdNum = cmd.length; + + if (cmdNum >1) { + for (var i=0; i= this.opSet.length) return ''; + var step = this.opSet[this.opPointer++]; + random = step['random']; + + var cmd = step['cmd'].split(','); + var cmdNum = cmd.length; + + if (cmdNum >1) { + for (var i=0; i]*?>/i)) { + return; + } + var alink = new Array(), ignore = new Array(); + var i = 0; + var msg = $(rlinkmsgid).innerHTML; + msg = msg.replace(/([\s|\S]*?<\/ignore_js_op\>)/ig, function($1) { + ignore[i] = $1; + i++; + return '#ignore_js_op '+(i - 1)+'#'; + }); + var alink_i = 0; + msg = msg.replace(/()/ig, function($1) { + alink[alink_i] = $1; + alink_i++; + return '#alink '+(alink_i - 1)+'#'; + }); + var relatedid = new Array(); + msg = msg.replace(/(^|>)([^<]+)(?=<|$)/ig, function($1, $2, $3) { + for(var j = 0; j < relatedlink.length; j++) { + if(relatedlink[j] && !relatedid[j]) { + if(relatedlink[j]['surl'] != '') { + var ra = ''+relatedlink[j]['sname']+''; + alink[alink_i] = ra; + ra = '#alink '+alink_i+'#'; + alink_i++; + } else { + var ra = ''+relatedlink[j]['sname']+''; + } + var $rtmp = $3; + $3 = $3.replace(relatedlink[j]['sname'], ra); + if($3 != $rtmp) { + relatedid[j] = 1; + } + } + } + return $2 + $3; + }); + + for(var k in alink) { + msg = msg.replace('#alink '+k+'#', alink[k]); + } + + for(var l in ignore) { + msg = msg.replace('#ignore_js_op '+l+'#', ignore[l]); + } + $(rlinkmsgid).innerHTML = msg; +} + +var seccheck_tpl = new Array(); + +function _updatesecqaa(idhash, tpl) { + if($('secqaa_' + idhash)) { + if(tpl) { + seccheck_tpl[idhash] = tpl; + } + var id = 'seqaajs_' + idhash; + var src = 'misc.php?mod=secqaa&action=update&idhash=' + idhash + '&' + Math.random(); + if($(id)) { + document.getElementsByTagName('head')[0].appendChild($(id)); + } + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.id = id; + scriptNode.src = src; + document.getElementsByTagName('head')[0].appendChild(scriptNode); + } +} + +function _updateseccode(idhash, tpl, modid) { + if(!$('seccode_' + idhash)) { + return; + } + if(tpl) { + seccheck_tpl[idhash] = tpl; + } + var id = 'seccodejs_' + idhash; + var src = 'misc.php?mod=seccode&action=update&idhash=' + idhash + '&' + Math.random() + '&modid=' + modid; + if($(id)) { + document.getElementsByTagName('head')[0].appendChild($(id)); + } + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.id = id; + scriptNode.src = src; + document.getElementsByTagName('head')[0].appendChild(scriptNode); +} + +function _checksec(type, idhash, showmsg, recall, modid) { + var showmsg = !showmsg ? 0 : showmsg; + var secverify = $('sec' + type + 'verify_' + idhash).value; + if(!secverify) { + return; + } + var modid = !modid ? '' : modid; + var x = new Ajax('XML', 'checksec' + type + 'verify_' + idhash); + x.loading = ''; + $('checksec' + type + 'verify_' + idhash).innerHTML = '
                    '; + x.get('misc.php?mod=sec' + type + '&action=check&inajax=1&modid=' + modid + '&idhash=' + idhash + '&secverify=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(secverify) : secverify), function(s){ + var obj = $('checksec' + type + 'verify_' + idhash); + obj.style.display = ''; + if(s.substr(0, 7) == 'succeed') { + obj.innerHTML = ''; + if(showmsg) { + recall(1); + } + } else { + obj.innerHTML = ''; + if(showmsg) { + if(type == 'code') { + showError('验证码错误,请重新填写'); + } else if(type == 'qaa') { + showError('验证问答错误,请重新填写'); + } + recall(0); + } + } + }); +} + +function _setDoodle(fid, oid, url, tid, from) { + if(tid == null) { + hideWindow(fid); + } else { + $(tid).style.display = ''; + $(fid).style.display = 'none'; + } + var doodleText = '[img]'+url+'[/img]'; + if($(oid) != null) { + if(from == "editor") { + insertImage(url); + } else if(from == "fastpost") { + seditor_insertunit('fastpost', doodleText); + } else if(from == "forumeditor") { + if(wysiwyg) { + insertText('', false); + } else { + insertText(doodleText, strlen(doodleText), 0); + } + } else { + insertContent(oid, doodleText); + } + } +} + +function _showdistrict(container, elems, totallevel, changelevel, containertype) { + var getdid = function(elem) { + var op = elem.options[elem.selectedIndex]; + return op['did'] || op.getAttribute('did') || '0'; + }; + var countryid = changelevel >= 0 && elems[0] && $(elems[0]) ? getdid($(elems[0])) : 0; + var pid = changelevel >= 1 && elems[1] && $(elems[1]) ? getdid($(elems[1])) : 0; + var cid = changelevel >= 2 && elems[2] && $(elems[2]) ? getdid($(elems[2])) : 0; + var did = changelevel >= 3 && elems[3] && $(elems[3]) ? getdid($(elems[3])) : 0; + var coid = changelevel >= 4 && elems[4] && $(elems[4]) ? getdid($(elems[4])) : 0; + var url = "home.php?mod=misc&ac=ajax&op=district&container="+container+"&containertype="+containertype + +"&country="+elems[0]+"&province="+elems[1]+"&city="+elems[2]+"&district="+elems[3]+"&community="+elems[4] + +"&countryid="+countryid + "&pid="+pid + "&cid="+cid+"&did="+did+"&coid="+coid+'&level='+totallevel + +'&handlekey='+container+'&inajax=1'+(!changelevel ? '&showdefault=1' : ''); + ajaxget(url, container, ''); +} + +function _copycode(obj) { + if(!obj) return false; + if(window.getSelection) { + var sel = window.getSelection(); + if (sel.setBaseAndExtent) { + sel.setBaseAndExtent(obj, 0, obj, 1); + } else { + var rng = document.createRange(); + rng.selectNodeContents(obj); + sel.addRange(rng); + } + } else { + var rng = document.body.createTextRange(); + rng.moveToElementText(obj); + rng.select(); + } + setCopy(BROWSER.ie ? obj.innerText.replace(/\r\n\r\n/g, '\r\n') : obj.textContent, '代码已复制到剪贴板'); +} + +function _showselect(obj, inpid, t, rettype) { + var showselect_row = function (inpid, s, v, notime, rettype) { + if(v >= 0) { + if(!rettype) { + var notime = !notime ? 0 : 1; + var t = today.getTime(); + t += 86400000 * v; + var d = new Date(); + d.setTime(t); + var month = d.getMonth() + 1; + month = month < 10 ? '0' + month : month; + var day = d.getDate(); + day = day < 10 ? '0' + day : day; + var hour = d.getHours(); + hour = hour < 10 ? '0' + hour : hour; + var minute = d.getMinutes(); + minute = minute < 10 ? '0' + minute : minute; + return '' + s + ''; + } else { + return '' + s + ''; + } + } else if(v == -1) { + return '' + s + ''; + } else if(v == -2) { + return '' + s + ''; + } + }; + + if(!obj.id) { + var t = !t ? 0 : t; + var rettype = !rettype ? 0 : rettype; + obj.id = 'calendarexp_' + Math.random(); + div = document.createElement('div'); + div.id = obj.id + '_menu'; + div.style.display = 'none'; + div.className = 'p_pop'; + $('append_parent').appendChild(div); + s = ''; + if(!t) { + s += showselect_row(inpid, '一天', 1, 0, rettype); + s += showselect_row(inpid, '一周', 7, 0, rettype); + s += showselect_row(inpid, '一个月', 30, 0, rettype); + s += showselect_row(inpid, '三个月', 90, 0, rettype); + s += showselect_row(inpid, '自定义', -2); + } else { + if($(t)) { + var lis = $(t).getElementsByTagName('LI'); + for(i = 0;i < lis.length;i++) { + s += '' + lis[i].innerHTML + ''; + } + s += showselect_row(inpid, '自定义', -1); + } else { + s += '永久'; + s += showselect_row(inpid, '7 天', 7, 1, rettype); + s += showselect_row(inpid, '14 天', 14, 1, rettype); + s += showselect_row(inpid, '一个月', 30, 1, rettype); + s += showselect_row(inpid, '三个月', 90, 1, rettype); + s += showselect_row(inpid, '半年', 182, 1, rettype); + s += showselect_row(inpid, '一年', 365, 1, rettype); + s += showselect_row(inpid, '自定义', -1); + } + } + $(div.id).innerHTML = s; + } + showMenu({'ctrlid':obj.id,'evt':'click'}); + if(BROWSER.ie && BROWSER.ie < 7) { + doane(event); + } +} + +function _zoom(obj, zimg, nocover, pn, showexif) { + zimg = !zimg ? obj.src : zimg; + showexif = !parseInt(showexif) ? 0 : showexif; + if(!zoomstatus) { + window.open(zimg, '', ''); + return; + } + if(!obj.id) obj.id = 'img_' + Math.random(); + var faid = !obj.getAttribute('aid') ? 0 : obj.getAttribute('aid'); + var menuid = 'imgzoom'; + var menu = $(menuid); + var zoomid = menuid + '_zoom'; + var imgtitle = !nocover && obj.title ? '
                    ' + htmlspecialchars(obj.title) + '
                    ' + + (showexif ? '
                    ' : '') + : ''; + var cover = !nocover ? 1 : 0; + var pn = !pn ? 0 : 1; + var maxh = (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight) - 70; + var loadCheck = function (obj) { + if(obj.complete) { + var imgw = loading.width; + var imgh = loading.height; + var r = imgw / imgh; + var w = document.body.clientWidth * 0.95; + w = imgw > w ? w : imgw; + var h = w / r; + if(w < 100 & h < 100) { + $(menuid + '_waiting').style.display = 'none'; + hideMenu(); + return; + } + if(h > maxh) { + h = maxh; + w = h * r; + } + if($(menuid)) { + $(menuid).removeAttribute('top_');$(menuid).removeAttribute('left_'); + clearTimeout($(menuid).getAttribute('timer')); + } + showimage(zimg, w, h, imgw, imgh); + if(showexif && faid && $(zoomid + '_exif')) { + var x = new Ajax(); + x.get('forum.php?mod=ajax&action=exif&aid=' + faid + '&inajax=1', function(s, x) { + if(s) { + $(zoomid + '_exif').style.display = ''; + $(zoomid + '_exif').innerHTML = s; + } else { + $(zoomid + '_exif').style.display = 'none'; + } + }); + } + } else { + setTimeout(function () { loadCheck(loading); }, 100); + } + }; + var showloading = function (zimg, pn) { + if(!pn) { + if(!$(menuid + '_waiting')) { + waiting = document.createElement('img'); + waiting.id = menuid + '_waiting'; + waiting.src = IMGDIR + '/imageloading.gif'; + waiting.style.opacity = '0.8'; + waiting.style.filter = 'alpha(opacity=80)'; + waiting.style.position = 'absolute'; + waiting.style.zIndex = '100000'; + $('append_parent').appendChild(waiting); + } + } + $(menuid + '_waiting').style.display = ''; + $(menuid + '_waiting').style.left = (document.body.clientWidth - 42) / 2 + 'px'; + $(menuid + '_waiting').style.top = ((document.documentElement.clientHeight - 42) / 2 + Math.max(document.documentElement.scrollTop, document.body.scrollTop)) + 'px'; + loading = new Image(); + setTimeout(function () { loadCheck(loading); }, 100); + if(!pn) { + $(menuid + '_zoomlayer').style.display = 'none'; + } + loading.src = zimg; + }; + var adjustpn = function(h) { + h = h < 90 ? 90 : h; + if($('zimg_prev')) { + $('zimg_prev').style.height= parseInt(h) + 'px'; + } + if($('zimg_next')) { + $('zimg_next').style.height= parseInt(h) + 'px'; + } + }; + var showimage = function (zimg, w, h, imgw, imgh) { + $(menuid + '_waiting').style.display = 'none'; + $(menuid + '_zoomlayer').style.display = ''; + $(menuid + '_img').style.width = 'auto'; + $(menuid + '_img').style.height = 'auto'; + $(menuid).style.width = (w < 300 ? 320 : w + 20) + 'px'; + mheight = h + 63; + menu.style.height = mheight + 'px'; + $(menuid + '_zoomlayer').style.height = (mheight < 120 ? 120 : mheight) + 'px'; + $(menuid + '_img').innerHTML = '' + imgtitle; + $(zoomid).src = zimg; + $(zoomid).width = w; + $(zoomid).height = h; + if($(menuid + '_imglink')) { + $(menuid + '_imglink').href = zimg; + } + setMenuPosition('', menuid, '00'); + adjustpn(h); + }; + var adjustTimer = 0; + var adjustTimerCount = 0; + var wheelDelta = 0; + var clientX = 0; + var clientY = 0; + var adjust = function(e, a) { + if(BROWSER.ie && BROWSER.ie<7) { + } else { + if(adjustTimerCount) { + adjustTimer = (function(){ + return setTimeout(function () { + adjustTimerCount++; + adjust(e); + }, 20); + })(); + $(menuid).setAttribute('timer', adjustTimer); + if(adjustTimerCount > 17) { + clearTimeout(adjustTimer); + adjustTimerCount = 0; + doane(); + } + } else if(!a) { + adjustTimerCount = 1; + if(adjustTimer) { + clearTimeout(adjustTimer); + adjust(e, a); + } else { + adjust(e, a); + } + doane(); + } + } + var ele = $(zoomid); + if(!ele) { + return; + } + var imgw = ele.getAttribute('w'); + var imgh = ele.getAttribute('h'); + + if(!a) { + e = e || window.event; + try { + if(e.altKey || e.shiftKey || e.ctrlKey) return; + } catch (e) { + e = {'wheelDelta':wheelDelta, 'clientX':clientX, 'clientY':clientY}; + } + var step = 0; + if(e.wheelDelta <= 0 || e.detail > 0) { + if(ele.width - 1 <= 200 || ele.height - 1 <= 200) { + clearTimeout(adjustTimer); + adjustTimerCount = 0; + doane(e);return; + } + step = parseInt(imgw/ele.width)-4; + } else { + if(ele.width + 1 >= imgw*40) { + clearTimeout(adjustTimer); + adjustTimerCount = 0; + doane(e);return; + } + step = 4-parseInt(imgw/ele.width) || 2; + } + if(BROWSER.ie && BROWSER.ie<7) { step *= 5;} + wheelDelta = e.wheelDelta; + clientX = e.clientX; + clientY = e.clientY; + var ratio = 0; + if(imgw > imgh) { + ratio = step/ele.height; + ele.height += step; + ele.width = imgw*(ele.height/imgh); + } else { + ratio = step/ele.width; + ele.width += step; + ele.height = imgh*(ele.width/imgw); + } + if(BROWSER.ie && BROWSER.ie<7) { + setMenuPosition('', menuid, '00'); + } else { + var menutop = parseFloat(menu.getAttribute('top_') || menu.style.top); + var menuleft = parseFloat(menu.getAttribute('left_') || menu.style.left); + var imgY = clientY - menutop - 39; + var imgX = clientX - menuleft - 10; + var newTop = (menutop - imgY*ratio) + 'px'; + var newLeft = (menuleft - imgX*ratio) + 'px'; + menu.style.top = newTop; + menu.style.left = newLeft; + menu.setAttribute('top_', newTop); + menu.setAttribute('left_', newLeft); + } + } else { + ele.width = imgw; + ele.height = imgh; + } + menu.style.width = (parseInt(ele.width < 300 ? 300 : parseInt(ele.width)) + 20) + 'px'; + var mheight = (parseInt(ele.height) + 50); + menu.style.height = mheight + 'px'; + $(menuid + '_zoomlayer').style.height = (mheight < 120 ? 120 : mheight) + 'px'; + adjustpn(ele.height); + doane(e); + }; + if(!menu && !pn) { + menu = document.createElement('div'); + menu.id = menuid; + if(cover) { + menu.innerHTML = ''; + } else { + menu.innerHTML = ''; + } + if(BROWSER.ie || BROWSER.chrome){ + menu.onmousewheel = adjust; + } else { + menu.addEventListener('DOMMouseScroll', adjust, false); + } + $('append_parent').appendChild(menu); + if($(menuid + '_adjust')) { + $(menuid + '_adjust').onclick = function(e) {adjust(e, 1)}; + } + } + showloading(zimg, pn); + picpage = ''; + $(menuid + '_picpage').innerHTML = ''; + if(typeof zoomgroup == 'object' && zoomgroup[obj.id] && typeof aimgcount == 'object' && aimgcount[zoomgroup[obj.id]]) { + authorimgs = aimgcount[zoomgroup[obj.id]]; + var aid = obj.id.substr(5), authorlength = authorimgs.length, authorcurrent = ''; + if(authorlength > 1) { + for(i = 0; i < authorlength;i++) { + if(aid == authorimgs[i]) { + authorcurrent = i; + } + } + if(authorcurrent !== '') { + paid = authorcurrent > 0 ? authorimgs[authorcurrent - 1] : authorimgs[authorlength - 1]; + picpage += '
                    ‹ 上一张
                    '; + paid = authorcurrent < authorlength - 1 ? authorimgs[authorcurrent + 1] : authorimgs[0]; + picpage += '
                    下一张 ›
                    '; + } + if(picpage) { + $(menuid + '_picpage').innerHTML = picpage; + } + } + } + showMenu({'ctrlid':obj.id,'menuid':menuid,'duration':3,'pos':'00','cover':cover,'drag':menuid,'maxh':''}); +} + +function _zoom_page(paid, showexif) { + var imagesrc = $('aimg_' + paid).getAttribute('zoomfile') ? $('aimg_' + paid).getAttribute('zoomfile') : $('aimg_' + paid).getAttribute('file'); + zoom($('aimg_' + paid), imagesrc, 0, 1, showexif ? 1 : 0); +} + +function _switchTab(prefix, current, total, activeclass) { + activeclass = !activeclass ? 'a' : activeclass; + for(var i = 1; i <= total;i++) { + var classname = ' '+$(prefix + '_' + i).className+' '; + $(prefix + '_' + i).className = classname.replace(' '+activeclass+' ','').substr(1); + $(prefix + '_c_' + i).style.display = 'none'; + } + $(prefix + '_' + current).className = $(prefix + '_' + current).className + ' '+activeclass; + $(prefix + '_c_' + current).style.display = ''; +} + +function _initTab(frameId, type) { + if (typeof document['diyform'] == 'object' || $(frameId).className.indexOf('tab') < 0) return false; + type = type || 'click'; + var tabs = $(frameId+'_title').childNodes; + var arrTab = []; + for(var i in tabs) { + if (tabs[i]['nodeType'] == 1 && tabs[i]['className'].indexOf('move-span') > -1) { + arrTab.push(tabs[i]); + } + } + var counter = 0; + var tab = document.createElement('ul'); + tab.className = 'tb cl'; + var len = arrTab.length; + for(var i = 0;i < len; i++) { + var tabId = arrTab[i].id; + if (hasClass(arrTab[i],'frame') || hasClass(arrTab[i],'tab')) { + var arrColumn = []; + for (var j in arrTab[i].childNodes) { + if (typeof arrTab[i].childNodes[j] == 'object' && !hasClass(arrTab[i].childNodes[j],'title')) arrColumn.push(arrTab[i].childNodes[j]); + } + var frameContent = document.createElement('div'); + frameContent.id = tabId+'_content'; + frameContent.className = hasClass(arrTab[i],'frame') ? 'content cl '+arrTab[i].className.substr(arrTab[i].className.lastIndexOf(' ')+1) : 'content cl'; + var colLen = arrColumn.length; + for (var k = 0; k < colLen; k++) { + frameContent.appendChild(arrColumn[k]); + } + } else { + var frameContent = $(tabId+'_content'); + frameContent = frameContent || document.createElement('div'); + } + frameContent.style.display = counter ? 'none' : ''; + $(frameId+'_content').appendChild(frameContent); + + var li = document.createElement('li'); + li.id = tabId; + li.className = counter ? '' : 'a'; + var reg = new RegExp('style=\"(.*?)\"', 'gi'); + var matchs = '', style = '', imgs = ''; + while((matchs = reg.exec(arrTab[i].innerHTML))) { + if(matchs[1].substr(matchs[1].length,1) != ';') { + matchs[1] += ';'; + } + style += matchs[1]; + } + style = style ? ' style="'+style+'"' : ''; + reg = new RegExp('()', 'gi'); + while((matchs = reg.exec(arrTab[i].innerHTML))) { + imgs += matchs[1]; + } + li.innerHTML = arrTab[i]['innerText'] ? arrTab[i]['innerText'] : arrTab[i]['textContent']; + var a = arrTab[i].getElementsByTagName('a'); + var href = a && a[0] ? a[0].href : 'javascript:;'; + var onclick = type == 'click' ? ' onclick="return false;"' : ''; + li.innerHTML = '' + imgs + li.innerHTML + ''; + _attachEvent(li, type, switchTabUl); + tab.appendChild(li); + $(frameId+'_title').removeChild(arrTab[i]); + counter++; + } + $(frameId+'_title').appendChild(tab); +} + +function switchTabUl (e) { + e = e || window.event; + var aim = e.target || e.srcElement; + var tabId = aim.id; + var parent = aim.parentNode; + while(parent['nodeName'] != 'UL' && parent['nodeName'] != 'BODY') { + tabId = parent.id; + parent = parent.parentNode; + } + if(parent['nodeName'] == 'BODY') return false; + var tabs = parent.childNodes; + var len2 = tabs.length; + for(var j = 0; j < len2; j++) { + tabs[j].className = (tabs[j].id == tabId) ? 'a' : ''; + var content = $(tabs[j].id+'_content'); + if (content) content.style.display = tabs[j].id == tabId ? '' : 'none'; + } +} + +function slideshow(el) { + var obj = this; + if(!el.id) el.id = Math.random(); + if(typeof slideshow.entities == 'undefined') { + slideshow.entities = {}; + } + this.id = el.id; + if(slideshow.entities[this.id]) return false; + slideshow.entities[this.id] = this; + + this.slideshows = []; + this.slidebar = []; + this.slideother = []; + this.slidebarup = ''; + this.slidebardown = ''; + this.slidenum = 0; + this.slidestep = 0; + + this.container = el; + this.imgs = []; + this.imgLoad = []; + this.imgLoaded = 0; + this.imgWidth = 0; + this.imgHeight = 0; + + this.getMEvent = function(ele, value) { + value = !value ? 'mouseover' : value; + var mevent = !ele ? '' : ele.getAttribute('mevent'); + mevent = (mevent == 'click' || mevent == 'mouseover') ? mevent : value; + return mevent; + }; + this.slideshows = $C('slideshow', el); + this.slideshows = this.slideshows.length>0 ? this.slideshows[0].childNodes : null; + this.slidebar = $C('slidebar', el); + this.slidebar = this.slidebar.length>0 ? this.slidebar[0] : null; + this.barmevent = this.getMEvent(this.slidebar); + this.slideother = $C('slideother', el); + this.slidebarup = $C('slidebarup', el); + this.slidebarup = this.slidebarup.length>0 ? this.slidebarup[0] : null; + this.barupmevent = this.getMEvent(this.slidebarup, 'click'); + this.slidebardown = $C('slidebardown', el); + this.slidebardown = this.slidebardown.length>0 ? this.slidebardown[0] : null; + this.bardownmevent = this.getMEvent(this.slidebardown, 'click'); + this.slidenum = parseInt(this.container.getAttribute('slidenum')); + this.slidestep = parseInt(this.container.getAttribute('slidestep')); + this.timestep = parseInt(this.container.getAttribute('timestep')); + this.timestep = !this.timestep ? 2500 : this.timestep; + + this.index = this.length = 0; + this.slideshows = !this.slideshows ? filterTextNode(el.childNodes) : filterTextNode(this.slideshows); + + this.length = this.slideshows.length; + + for(i=0; i' + (i + 1).toString() + ''; + } + html += '
                  '; + this.slidebar.innerHTML = html; + this.container.parentNode.appendChild(this.slidebar); + this.controls = this.slidebar.getElementsByTagName('li'); + } + } else { + this.controls = filterTextNode(this.slidebar.childNodes); + for(i=0; i this.length) { + this.runRoll(); + } else { + for (i = 0; i < this.slidestep; i++) { + if(showindex >= this.length) showindex = 0; + this.index = this.index - this.slidenum + 1; + if(this.index < 0) this.index = this.length + this.index; + this.active(showindex); + showindex++; + } + } + } else if (index == 'up') { + var tempindex = this.index; + showindex = this.index - this.slidenum; + if(showindex < 0) return false; + for (i = 0; i < this.slidestep; i++) { + if(showindex < 0) showindex = this.length - Math.abs(showindex); + this.active(showindex); + this.index = tempindex = tempindex - 1; + if(this.index <0) this.index = this.length - 1; + showindex--; + } + } + return false; + }; + this.active = function(index) { + this.slideshows[this.index].style.display = "none"; + this.slideshows[index].style.display = "block"; + if(this.controls && this.controls.length > 0) { + this.controls[this.index].className = ''; + this.controls[index].className = 'on'; + } + for(var i=0,L=this.slideother.length; i 0) { + if(!this.slidenum || !this.slidestep) { + this.run(); + } else { + this.runRoll(); + } + } + } + }; + this.checkLoad(); +} + +function slidexactive(step) { + var e = getEvent(); + var aim = e.target || e.srcElement; + var parent = aim.parentNode; + var xactivei = null, slideboxid = null,currentslideele = null; + currentslideele = hasClass(aim, 'slidebarup') || hasClass(aim, 'slidebardown') || hasClass(parent, 'slidebar') ? aim : null; + while(parent && parent != document.body) { + if(!currentslideele && hasClass(parent, 'slidebar')) { + currentslideele = parent; + } + if(!currentslideele && (hasClass(parent, 'slidebarup') || hasClass(parent, 'slidebardown'))) { + currentslideele = parent; + } + if(hasClass(parent, 'slidebox')) { + slideboxid = parent.id; + break; + } + parent = parent.parentNode; + } + var slidebar = $C('slidebar', parent); + var children = slidebar.length == 0 ? [] : filterTextNode(slidebar[0].childNodes); + if(currentslideele && (hasClass(currentslideele, 'slidebarup') || hasClass(currentslideele, 'slidebardown'))) { + xactivei = step; + } else { + for(var j=0,i=0,L=children.length;i'; + $('append_parent').appendChild(div); + } + $(ctrlobj.id).onmouseout = function () { hideMenu('', 'prompt'); }; + showMenu({'mtype':'prompt','ctrlid':ctrlobj.id,'pos':'12!','duration':2,'zindex':JSMENU['zIndex']['prompt']}); +} + +function _showPrompt(ctrlid, evt, msg, timeout, classname) { + var menuid = ctrlid ? ctrlid + '_pmenu' : 'ntcwin'; + var duration = timeout ? 0 : 3; + if($(menuid)) { + $(menuid).parentNode.removeChild($(menuid)); + } + var div = document.createElement('div'); + div.id = menuid; + div.className = !classname ? (ctrlid ? 'tip tip_js' : 'ntcwin') : classname; + div.style.display = 'none'; + $('append_parent').appendChild(div); + if(ctrlid) { + msg = '
                  ' + msg + '
                  '; + } else { + msg = '
                  ' + msg + '
                  '; + } + div.innerHTML = msg; + if(ctrlid) { + if(!timeout) { + evt = 'click'; + } + if($(ctrlid)) { + if($(ctrlid).evt !== false) { + var prompting = function() { + showMenu({'mtype':'prompt','ctrlid':ctrlid,'evt':evt,'menuid':menuid,'pos':'210'}); + }; + if(evt == 'click') { + $(ctrlid).onclick = prompting; + } else { + $(ctrlid).onmouseover = prompting; + } + } + showMenu({'mtype':'prompt','ctrlid':ctrlid,'evt':evt,'menuid':menuid,'pos':'210','duration':duration,'timeout':timeout,'zindex':JSMENU['zIndex']['prompt']}); + $(ctrlid).unselectable = false; + } + } else { + showMenu({'mtype':'prompt','pos':'00','menuid':menuid,'duration':duration,'timeout':timeout,'zindex':JSMENU['zIndex']['prompt']}); + $(menuid).style.top = (parseInt($(menuid).style.top) - 100) + 'px'; + } +} +function _showCreditPrompt() { + var notice = getcookie('creditnotice').split('D'); + var basev = getcookie('creditbase').split('D'); + var creditrule = decodeURI(getcookie('creditrule', 1)).replace(String.fromCharCode(9), ' '); + if(!discuz_uid || notice.length < 2 || notice[9] != discuz_uid) { + setcookie('creditnotice', ''); + setcookie('creditrule', ''); + return; + } + var creditnames = creditnotice.split(','); + var creditinfo = []; + var e; + for(var i = 0; i < creditnames.length; i++) { + e = creditnames[i].split('|'); + creditinfo[e[0]] = [e[1], e[2]]; + } + creditShow(creditinfo, notice, basev, 0, 1, creditrule); +} + +function creditShow(creditinfo, notice, basev, bk, first, creditrule) { + var s = '', check = 0; + for(i = 1; i <= 8; i++) { + v = parseInt(Math.abs(parseInt(notice[i])) / 5) + 1; + if(notice[i] !== '0' && creditinfo[i]) { + s += '' + creditinfo[i][0] + (notice[i] != 0 ? (notice[i] > 0 ? '+' : '') + notice[i] + '' : '') + creditinfo[i][1] + ''; + } + if(notice[i] > 0) { + notice[i] = parseInt(notice[i]) - v; + basev[i] = parseInt(basev[i]) + v; + } else if(notice[i] < 0) { + notice[i] = parseInt(notice[i]) + v; + basev[i] = parseInt(basev[i]) - v; + } + if($('hcredit_' + i)) { + $('hcredit_' + i).innerHTML = basev[i]; + } + } + for(i = 1; i <= 8; i++) { + if(notice[i] != 0) { + check = 1; + } + } + if(!s || first) { + setcookie('creditnotice', ''); + setcookie('creditbase', ''); + setcookie('creditrule', ''); + if(!s) { + return; + } + } + if(!$('creditpromptdiv')) { + showPrompt(null, null, '
                  ' + (creditrule ? '' + creditrule + ' ' : '') + s + '
                  ', 0); + } else { + $('creditpromptdiv').innerHTML = s; + } + setTimeout(function () {hideMenu(1, 'prompt');$('append_parent').removeChild($('ntcwin'));}, 1500); +} + +function _showColorBox(ctrlid, layer, k, bgcolor) { + var tag1 = !bgcolor ? 'color' : 'backcolor', tag2 = !bgcolor ? 'forecolor' : 'backcolor'; + if(!$(ctrlid + '_menu')) { + var menu = document.createElement('div'); + menu.id = ctrlid + '_menu'; + menu.className = 'p_pop colorbox'; + menu.unselectable = true; + menu.style.display = 'none'; + var coloroptions = ['Black', 'Sienna', 'DarkOliveGreen', 'DarkGreen', 'DarkSlateBlue', 'Navy', 'Indigo', 'DarkSlateGray', 'DarkRed', 'DarkOrange', 'Olive', 'Green', 'Teal', 'Blue', 'SlateGray', 'DimGray', 'Red', 'SandyBrown', 'YellowGreen', 'SeaGreen', 'MediumTurquoise', 'RoyalBlue', 'Purple', 'Gray', 'Magenta', 'Orange', 'Yellow', 'Lime', 'Cyan', 'DeepSkyBlue', 'DarkOrchid', 'Silver', 'Pink', 'Wheat', 'LemonChiffon', 'PaleGreen', 'PaleTurquoise', 'LightBlue', 'Plum', 'White']; + var colortexts = ['黑色', '赭色', '暗橄榄绿色', '暗绿色', '暗灰蓝色', '海军色', '靛青色', '墨绿色', '暗红色', '暗桔黄色', '橄榄色', '绿色', '水鸭色', '蓝色', '灰石色', '暗灰色', '红色', '沙褐色', '黄绿色', '海绿色', '间绿宝石', '皇家蓝', '紫色', '灰色', '红紫色', '橙色', '黄色', '酸橙色', '青色', '深天蓝色', '暗紫色', '银色', '粉色', '浅黄色', '柠檬绸色', '苍绿色', '苍宝石绿', '亮蓝色', '洋李色', '白色']; + var str = ''; + for(var i = 0; i < 40; i++) { + str += '' + (i < 39 && (i + 1) % 8 == 0 ? '
                  ' : ''); + } + menu.innerHTML = str; + $('append_parent').appendChild(menu); + } + showMenu({'ctrlid':ctrlid,'evt':'click','layer':layer}); +} + +function _toggle_collapse(objname, noimg, complex, lang) { + var obj = $(objname); + if(obj) { + obj.style.display = obj.style.display == '' ? 'none' : ''; + var collapsed = getcookie('collapse'); + collapsed = updatestring(collapsed, objname, !obj.style.display); + setcookie('collapse', collapsed, (collapsed ? 2592000 : -2592000)); + } + if(!noimg) { + var img = $(objname + '_img'); + if(img.tagName != 'IMG') { + if(img.className.indexOf('_yes') == -1) { + img.className = img.className.replace(/_no/, '_yes'); + if(lang) { + img.innerHTML = lang[0]; + } + } else { + img.className = img.className.replace(/_yes/, '_no'); + if(lang) { + img.innerHTML = lang[1]; + } + } + } else { + img.src = img.src.indexOf('_yes.gif') == -1 ? img.src.replace(/_no\.gif/, '_yes\.gif') : img.src.replace(/_yes\.gif/, '_no\.gif'); + } + img.blur(); + } + if(complex) { + var objc = $(objname + '_c'); + if(objc) { + objc.className = objc.className == 'umh' ? 'umh umn' : 'umh'; + } + } + +} + +function _extstyle(css) { + if(!$('css_extstyle')) { + loadcss('extstyle'); + } + $('css_extstyle').href = css ? css + '/style.css' : STATICURL + 'image/common/extstyle_none.css'; + currentextstyle = css; + setcookie('extstyle', css, 86400 * 30); +} + +function _widthauto(obj) { + var strs = ['切换到宽版', '切换到窄版']; + if($('css_widthauto')) { + CSSLOADED['widthauto'] = 1; + } + if(!CSSLOADED['widthauto'] || $('css_widthauto').disabled) { + if(!CSSLOADED['widthauto']) { + loadcss('widthauto'); + } else { + $('css_widthauto').disabled = false; + } + HTMLNODE.className += ' widthauto'; + setcookie('widthauto', 1, 86400 * 30); + obj.innerHTML = strs[1]; + obj.title = strs[1]; + } else { + $('css_widthauto').disabled = true; + HTMLNODE.className = HTMLNODE.className.replace(' widthauto', ''); + setcookie('widthauto', -1, 86400 * 30); + obj.innerHTML = strs[0]; + obj.title = strs[0]; + } + hideMenu(); +} + +function _showCreditmenu() { + if(!$('extcreditmenu_menu')) { + menu = document.createElement('div'); + menu.id = 'extcreditmenu_menu'; + menu.style.display = 'none'; + menu.className = 'p_pop'; + menu.innerHTML = '
                  请稍候...
                  '; + $('append_parent').appendChild(menu); + ajaxget($('extcreditmenu').href, 'extcreditmenu_menu', 'ajaxwaitid'); + } + showMenu({'ctrlid':'extcreditmenu','ctrlclass':'a','duration':2}); +} + +function _showUpgradeinfo() { + if(!$('g_upmine_menu')) { + menu = document.createElement('div'); + menu.id = 'g_upmine_menu'; + menu.style.display = 'none'; + menu.className = 'p_pop'; + menu.innerHTML = '
                  请稍候...
                  '; + $('append_parent').appendChild(menu); + ajaxget('home.php?mod=spacecp&ac=usergroup&showextgroups=1', 'g_upmine_menu', 'ajaxwaitid'); + } + showMenu({'ctrlid':'g_upmine','ctrlclass':'a','duration':2}); +} + +function _showForummenu(fid) { + if($('fjump_menu') && !$('fjump_menu').innerHTML) { + ajaxget('forum.php?mod=ajax&action=forumjump&jfid=' + fid, 'fjump_menu', 'ajaxwaitid'); + } +} + +function _imageRotate(imgid, direct) { + var image = $(imgid); + if(!image.getAttribute('deg')) { + var deg = 0; + image.setAttribute('ow', image.width); + image.setAttribute('oh', image.height); + if(BROWSER.ie) { + image.setAttribute('om', parseInt(image.currentStyle.marginBottom)); + } + } else { + var deg = parseInt(image.getAttribute('deg')); + } + var ow = image.getAttribute('ow'); + var oh = image.getAttribute('oh'); + deg = direct == 1 ? deg - 90 : deg + 90; + if(deg > 270) { + deg = 0; + } else if(deg < 0) { + deg = 270; + } + image.setAttribute('deg', deg); + if(BROWSER.ie) { + if(!isNaN(image.getAttribute('om'))) { + image.style.marginBottom = (image.getAttribute('om') + (BROWSER.ie < 8 ? 0 : (deg == 90 || deg == 270 ? Math.abs(ow - oh) : 0))) + 'px'; + } + image.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (deg / 90) + ')'; + } else { + switch(deg) { + case 90:var cow = oh, coh = ow, cx = 0, cy = -oh;break; + case 180:var cow = ow, coh = oh, cx = -ow, cy = -oh;break; + case 270:var cow = oh, coh = ow, cx = -ow, cy = 0;break; + } + var canvas = $(image.getAttribute('canvasid')); + if(!canvas) { + var i = document.createElement("canvas"); + i.id = 'canva_' + Math.random(); + image.setAttribute('canvasid', i.id); + image.parentNode.insertBefore(i, image); + canvas = $(i.id); + } + if(deg) { + var canvasContext = canvas.getContext('2d'); + canvas.setAttribute('width', cow); + canvas.setAttribute('height', coh); + canvasContext.rotate(deg * Math.PI / 180); + canvasContext.drawImage(image, cx, cy, ow, oh); + image.style.display = 'none'; + canvas.style.display = ''; + } else { + image.style.display = ''; + canvas.style.display = 'none'; + } + } +} + +function _createPalette(colorid, id, func) { + var iframe = ""; + if (!$("c"+colorid+"_menu")) { + var dom = document.createElement('span'); + dom.id = "c"+colorid+"_menu"; + dom.style.display = 'none'; + dom.innerHTML = iframe; + $('append_parent').appendChild(dom); + } + func = !func ? '' : '|' + func; + var url = /(?:https?:)?\/\//.test(STATICURL) ? STATICURL : SITEURL+STATICURL; + window.frames["c"+colorid+"_frame"].location.href = url+"image/admincp/getcolor.htm?c"+colorid+"|"+id+func; + showMenu({'ctrlid':'c'+colorid}); + var iframeid = "c"+colorid+"_menu"; + _attachEvent(window, 'scroll', function(){hideMenu(iframeid);}); +} + +function _setShortcut() { + $('shortcuttip').onclick = function() { + var msg = '1、点击"' + ''; + msg += '2、点击"' + ''; + msg += '下载ICO图标' + '",下载完成后,右击桌面快捷文件->属性->更改图标,选择已下载的ICO图标即可'; + showDialog(msg, 'notice', '添加桌面快捷'); + }; + + $('shortcutcloseid').onclick = function() { + $('shortcut').style.display = 'none'; + saveUserdata('setshortcut', 2); + }; + + this.height = 0; + this.shortcut = $('shortcut'); + this.shortcut.style.overflow = 'hidden'; + this.shortcut.style.display = 'block'; + this.autozoomin = function() { + var maxheight = 30; + this.height += 5; + if(this.height >= maxheight) { + this.shortcut.style.height = maxheight + 'px'; + return; + } + this.shortcut.style.height = this.height + 'px'; + setTimeout(this.autozoomin, 50); + }; + this.autozoomin(); +} \ No newline at end of file diff --git a/static/js/echarts/echarts.common.min.js b/static/js/echarts/echarts.common.min.js new file mode 100644 index 0000000..fbcc595 --- /dev/null +++ b/static/js/echarts/echarts.common.min.js @@ -0,0 +1,45 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).echarts={})}(this,(function(t){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},r=new function(){this.browser=new i,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(r.wxa=!0,r.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?r.worker=!0:"undefined"==typeof navigator?(r.node=!0,r.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]);r&&(n.ie=!0,n.version=r[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,r);var o="sans-serif",a="12px "+o;var s,l,u=function(t){var e={};if("undefined"==typeof JSON)return e;for(var n=0;n=0)o=r*t.length;else for(var c=0;c>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,a),l=function(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,p=h.left,d=h.top;a.push(p,d),l=l&&o&&p===o[c]&&d===o[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&r?r:(e.srcCoords=a,e[i]=n?Xt(s,a):Xt(a,s))}(s,a,o);if(l)return l(t,n,i),!0}return!1}function $t(t){return"CANVAS"===t.nodeName.toUpperCase()}var Qt=/([&<>"'])/g,Jt={"&":"&","<":"<",">":">",'"':""","'":"'"};function te(t){return null==t?"":(t+"").replace(Qt,(function(t,e){return Jt[e]}))}var ee=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ne=[],ie=r.browser.firefox&&+r.browser.version.split(".")[0]<39;function re(t,e,n,i){return n=n||{},i?oe(t,e,n):ie&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):oe(t,e,n),n}function oe(t,e,n){if(r.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if($t(t)){var a=t.getBoundingClientRect();return n.zrX=i-a.left,void(n.zrY=o-a.top)}if(Kt(ne,t,i,o))return n.zrX=ne[0],void(n.zrY=ne[1])}n.zrX=n.zrY=0}function ae(t){return t||window.event}function se(t,e,n){if(null!=(e=ae(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];r&&re(t,r,e,n)}else{re(t,e,e,n);var o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;if(null==n||null==i)return e;return 3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&ee.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function le(t,e,n,i){t.addEventListener(e,n,i)}var ue=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function he(t){return 2===t.which||3===t.which}var ce=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},o=0,a=i.length;o1&&r&&r.length>1){var a=pe(r)/pe(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=r)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function fe(){return[1,0,0,1,0,0]}function ge(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ve(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ye(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function me(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function _e(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=i*h+a*u,t[1]=-i*u+a*h,t[2]=r*h+s*u,t[3]=-r*u+h*s,t[4]=h*o+u*l,t[5]=h*l-u*o,t}function xe(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function we(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*i;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*r)*l,t[5]=(o*r-n*s)*l,t):null}var be=Object.freeze({__proto__:null,create:fe,identity:ge,copy:ve,mul:ye,translate:me,rotate:_e,scale:xe,invert:we,clone:function(t){var e=[1,0,0,1,0,0];return ve(e,t),e}}),Se=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var r=1-i;t.x=r*e.x+i*n.x,t.y=r*e.y+i*n.y},t}(),Me=Math.min,Ce=Math.max,Ie=new Se,Te=new Se,De=new Se,ke=new Se,Ae=new Se,Pe=new Se,Le=function(){function t(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}return t.prototype.union=function(t){var e=Me(t.x,this.x),n=Me(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ce(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ce(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=[1,0,0,1,0,0];return me(r,r,[-e.x,-e.y]),xe(r,r,[n,i]),me(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,n){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,r=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,p=!(of&&(f=_,gf&&(f=x,y=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];return e.x=n.x*r+a,e.y=n.y*o+s,e.width=n.width*r,e.height=n.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}Ie.x=De.x=n.x,Ie.y=ke.y=n.y,Te.x=ke.x=n.x+n.width,Te.y=De.y=n.y+n.height,Ie.transform(i),ke.transform(i),Te.transform(i),De.transform(i),e.x=Me(Ie.x,Te.x,De.x,ke.x),e.y=Me(Ie.y,Te.y,De.y,ke.y);var l=Ce(Ie.x,Te.x,De.x,ke.x),u=Ce(Ie.y,Te.y,De.y,ke.y);e.width=l-e.x,e.height=u-e.y}else e!==n&&t.copy(e,n)},t}(),Oe="silent";function Re(){ue(this.event)}var Ne=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return n(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Ut),ze=function(t,e){this.x=t,this.y=e},Ee=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Be=new Le(0,0,0,0),Ve=function(t){function e(e,n,i,r,o){var a=t.call(this)||this;return a._hovered=new ze(0,0),a.storage=e,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new Ne,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Gt(a),a}return n(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(z(Ee,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=We(this,e,n),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var a=this._hovered=i?new ze(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new ze(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var r="on"+e,o=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Re}}(e,t,n);i&&(i[r]&&(o.cancelBubble=!!i[r].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),r=new ze(t,e);if(He(i,r,t,e,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new Le(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(Be.copy(h.getBoundingRect()),h.transform&&Be.applyTransform(h.transform),Be.intersect(l)&&o.push(h))}if(o.length)for(var c=Math.PI/12,p=2*Math.PI,d=0;d=0;o--){var a=t[o],s=void 0;if(a!==r&&!a.ignore&&(s=Fe(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==Oe)){e.target=a;break}}}function We(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}z(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){Ve.prototype[t]=function(e){var n,i,r=e.zrX,o=e.zrY,a=We(this,r,o);if("mouseup"===t&&a||(i=(n=this.findHover(r,o)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Rt(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));function Ge(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r=0;)r++;return r-e}function Ue(t,e,n,i,r){for(i===e&&i++;i>>1])<0?l=o:s=o+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Ze(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])>0){for(s=i-r;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=a;a=r-l,l=r-u}for(a++;a>>1);o(t,e[n+h])>0?a=h+1:l=h}return l}function Ye(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])<0){for(s=r+1;ls&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function Xe(t,e){var n,i,r=7,o=0;t.length;var a=[];function s(s){var l=n[s],u=i[s],h=n[s+1],c=i[s+1];i[s]=u+c,s===o-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),o--;var p=Ye(t[h],t,l,u,0,e);l+=p,0!==(u-=p)&&0!==(c=Ze(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,s){var l=0;for(l=0;l=7||d>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[d+l]=t[p+l];return void(t[c]=a[h])}var f=r;for(;;){var g=0,v=0,y=!1;do{if(e(a[h],t[u])<0){if(t[c--]=t[u--],g++,v=0,0==--i){y=!0;break}}else if(t[c--]=a[h--],v++,g=0,1==--s){y=!0;break}}while((g|v)=0;l--)t[d+l]=t[p+l];if(0===i){y=!0;break}}if(t[c--]=a[h--],1==--s){y=!0;break}if(0!==(v=s-Ze(t[u],a,0,s,s-1,e))){for(s-=v,d=(c-=v)+1,p=(h-=v)+1,l=0;l=7||v>=7);if(y)break;f<0&&(f=0),f+=2}(r=f)<1&&(r=1);if(1===s){for(d=(c-=i)+1,p=(u-=i)+1,l=i-1;l>=0;l--)t[d+l]=t[p+l];t[c]=a[h]}else{if(0===s)throw new Error;for(p=c-(s-1),l=0;l1;){var t=o-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&i[t-1]=32;)e|=1&t,t>>=1;return t+e}(r);do{if((o=Ge(t,n,i,e))s&&(l=s),Ue(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}}var qe=!1;function Ke(){qe||(qe=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function $e(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Qe=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=$e}return t.prototype.traverse=function(t,e){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(Ke(),u.z=0),isNaN(u.z2)&&(Ke(),u.z2=0),isNaN(u.zlevel)&&(Ke(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,n);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,n);var p=t.getTextContent();p&&this._updateAndAddDisplayable(p,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),Je=r.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},tn={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-tn.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*tn.bounceIn(2*t):.5*tn.bounceOut(2*t-1)+.5}},en=Math.pow,nn=Math.sqrt,rn=1e-8,on=1e-4,an=nn(3),sn=1/3,ln=St(),un=St(),hn=St();function cn(t){return t>-1e-8&&trn||t<-1e-8}function dn(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function fn(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function gn(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*a*l,c=s*l-9*a*u,p=l*l-3*s*u,d=0;if(cn(h)&&cn(c)){if(cn(s))o[0]=0;else(M=-l/s)>=0&&M<=1&&(o[d++]=M)}else{var f=c*c-4*h*p;if(cn(f)){var g=c/h,v=-g/2;(M=-s/a+g)>=0&&M<=1&&(o[d++]=M),v>=0&&v<=1&&(o[d++]=v)}else if(f>0){var y=nn(f),m=h*s+1.5*a*(-c+y),_=h*s+1.5*a*(-c-y);(M=(-s-((m=m<0?-en(-m,sn):en(m,sn))+(_=_<0?-en(-_,sn):en(_,sn))))/(3*a))>=0&&M<=1&&(o[d++]=M)}else{var x=(2*h*s-3*a*c)/(2*nn(h*h*h)),w=Math.acos(x)/3,b=nn(h),S=Math.cos(w),M=(-s-2*b*S)/(3*a),C=(v=(-s+b*(S+an*Math.sin(w)))/(3*a),(-s+b*(S-an*Math.sin(w)))/(3*a));M>=0&&M<=1&&(o[d++]=M),v>=0&&v<=1&&(o[d++]=v),C>=0&&C<=1&&(o[d++]=C)}}return d}function vn(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(cn(a)){if(pn(o))(h=-s/o)>=0&&h<=1&&(r[l++]=h)}else{var u=o*o-4*a*s;if(cn(u))r[0]=-o/(2*a);else if(u>0){var h,c=nn(u),p=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(r[l++]=h),p>=0&&p<=1&&(r[l++]=p)}}return l}function yn(t,e,n,i,r,o){var a=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-a)*r+a,h=(l-s)*r+s,c=(h-u)*r+u;o[0]=t,o[1]=a,o[2]=u,o[3]=c,o[4]=c,o[5]=h,o[6]=l,o[7]=i}function mn(t,e,n,i,r,o,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=dn(t,n,r,a,f),v=dn(e,i,o,s,f),y=g-u,m=v-h;c+=Math.sqrt(y*y+m*m),u=g,h=v}return c}function _n(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function xn(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function wn(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function bn(t,e,n,i,r){var o=(e-t)*i+t,a=(n-e)*i+e,s=(a-o)*i+o;r[0]=t,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=n}function Sn(t,e,n,i,r,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=_n(t,n,r,p),f=_n(e,i,o,p),g=d-s,v=f-l;u+=Math.sqrt(g*g+v*v),s=d,l=f}return u}var Mn=/cubic-bezier\(([0-9,\.e ]+)\)/;function Cn(t){var e=t&&Mn.exec(t);if(e){var n=e[1].split(","),i=+lt(n[0]),r=+lt(n[1]),o=+lt(n[2]),a=+lt(n[3]);if(isNaN(i+r+o+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:gn(0,i,o,1,t,s)&&dn(0,r,a,1,s[0])}}}var In=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||xt,this.ondestroy=t.ondestroy||xt,this.onrestart=t.onrestart||xt,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r){if(!this.loop)return!0;var s=i%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=U(t)?t:tn[t]||Cn(t)},t}(),Tn=function(t){this.value=t},Dn=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Tn(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),kn=function(){function t(t){this._list=new Dn,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Tn(e),a.key=t,n.insertEntry(a),i[t]=a}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),An={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Pn(t){return(t=Math.round(t))<0?0:t>255?255:t}function Ln(t){return t<0?0:t>1?1:t}function On(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Pn(parseFloat(e)/100*255):Pn(parseInt(e,10))}function Rn(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Ln(parseFloat(e)/100):Ln(parseFloat(e))}function Nn(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function zn(t,e,n){return t+(e-t)*n}function En(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Bn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Vn=new kn(20),Fn=null;function Hn(t,e){Fn&&Bn(Fn,e),Fn=Vn.put(t,Fn||e.slice())}function Wn(t,e){if(t){e=e||[];var n=Vn.get(t);if(n)return Bn(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in An)return Bn(e,An[i]),Hn(t,e),e;var r,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(En(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),Hn(t,e),e):void En(e,0,0,0,1):7===o||9===o?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(En(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),Hn(t,e),e):void En(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?En(e,+u[0],+u[1],+u[2],1):En(e,0,0,0,1);h=Rn(u.pop());case"rgb":return u.length>=3?(En(e,On(u[0]),On(u[1]),On(u[2]),3===u.length?h:Rn(u[3])),Hn(t,e),e):void En(e,0,0,0,1);case"hsla":return 4!==u.length?void En(e,0,0,0,1):(u[3]=Rn(u[3]),Gn(u,e),Hn(t,e),e);case"hsl":return 3!==u.length?void En(e,0,0,0,1):(Gn(u,e),Hn(t,e),e);default:return}}En(e,0,0,0,1)}}function Gn(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Rn(t[1]),r=Rn(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return En(e=e||[],Pn(255*Nn(a,o,n+1/3)),Pn(255*Nn(a,o,n)),Pn(255*Nn(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Un(t,e){var n=Wn(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return Kn(n,4===n.length?"rgba":"rgb")}}function Zn(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=Pn(zn(a[0],s[0],l)),n[1]=Pn(zn(a[1],s[1],l)),n[2]=Pn(zn(a[2],s[2],l)),n[3]=Ln(zn(a[3],s[3],l)),n}}var Yn=Zn;function Xn(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=Wn(e[r]),s=Wn(e[o]),l=i-r,u=Kn([Pn(zn(a[0],s[0],l)),Pn(zn(a[1],s[1],l)),Pn(zn(a[2],s[2],l)),Ln(zn(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:o,value:i}:u}}var jn=Xn;function qn(t,e){var n=Wn(t);if(n&&null!=e)return n[3]=Ln(e),Kn(n,"rgba")}function Kn(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function $n(t,e){var n=Wn(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}var Qn=Object.freeze({__proto__:null,parse:Wn,lift:Un,toHex:function(t){var e=Wn(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},fastLerp:Zn,fastMapToColor:Yn,lerp:Xn,mapToColor:jn,modifyHSL:function(t,e,n,i){var r,o=Wn(t);if(t)return o=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,p=((s-o)/6+l/2)/l;i===s?e=p-c:r===s?e=1/3+h-p:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,n,u];return null!=t[3]&&d.push(t[3]),d}}(o),null!=e&&(o[0]=(r=e,(r=Math.round(r))<0?0:r>360?360:r)),null!=n&&(o[1]=Rn(n)),null!=i&&(o[2]=Rn(i)),Kn(Gn(o),"rgba")},modifyAlpha:qn,stringify:Kn,lum:$n,random:function(){return Kn([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")}}),Jn=Math.round;function ti(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=Wn(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var ei=1e-4;function ni(t){return t-1e-4}function ii(t){return Jn(1e3*t)/1e3}function ri(t){return Jn(1e4*t)/1e4}var oi={left:"start",right:"end",center:"middle",middle:"middle"};function ai(t){return t&&!!t.image}function si(t){return ai(t)||function(t){return t&&!!t.svgElement}(t)}function li(t){return"linear"===t.type}function ui(t){return"radial"===t.type}function hi(t){return t&&("linear"===t.type||"radial"===t.type)}function ci(t){return"url(#"+t+")"}function pi(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function di(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*wt,r=it(t.scaleX,1),o=it(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===r&&1===o||l.push("scale("+r+","+o+")"),(a||s)&&l.push("skew("+Jn(a*wt)+"deg, "+Jn(s*wt)+"deg)"),l.join(" ")}var fi=r.hasGlobalWindow&&U(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},gi=Array.prototype.slice;function vi(t,e,n){return(e-t)*n+t}function yi(t,e,n,i){for(var r=e.length,o=0;oi?e:t,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;sa)i.length=a;else for(var s=o;s=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=6,s=e;if(N(e)){var l=function(t){return N(t&&t[0])?2:1}(e);a=l,(1===l&&!X(e[0])||2===l&&!X(e[0][0]))&&(o=!0)}else if(X(e)&&!et(e))a=0;else if(Z(e))if(isNaN(+e)){var u=Wn(e);u&&(s=u,a=3)}else a=0;else if(Q(e)){var h=k({},s);h.colorStops=E(e.colorStops,(function(t){return{offset:t.offset,color:Wn(t.color)}})),li(e)?a=4:ui(e)&&(a=5),s=h}0===r?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return n&&(c.easing=n,c.easingFunc=U(n)?n:tn[n]||Cn(n)),i.push(c),c},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort((function(t,e){return t.time-e.time}));for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=Ci(i),l=Mi(i),u=0;u=0&&!(l[n].percent<=e);n--);n=d(n,u-2)}else{for(n=p;ne);n++);n=d(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=e;var f=r.percent-i.percent,g=0===f?1:d((e-i.percent)/f,1);r.easingFunc&&(g=r.easingFunc(g));var v=o?this._additiveValue:c?Ii:t[h];if(!Ci(s)&&!c||v||(v=this._additiveValue=[]),this.discrete)t[h]=g<1?i.rawValue:r.rawValue;else if(Ci(s))1===s?yi(v,i[a],r[a],g):function(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;a0&&s.addKeyframe(0,bi(l),i),this._trackKeys.push(a)}s.addKeyframe(t,bi(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,r=0;r1){var a=o.pop();r.addKeyframe(a.time,t[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();function ki(){return(new Date).getTime()}var Ai,Pi,Li=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n}return n(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=ki()-this._pausedTime,n=e-this._time,i=this._head;i;){var r=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,Je((function e(){t._running&&(Je(e),!t._paused&&t.update())}))},e.prototype.start=function(){this._running||(this._time=ki(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=ki(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=ki()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new Di(t,e.loop);return this.addAnimator(n),n},e}(Ut),Oi=r.domSupported,Ri=(Pi={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Ai=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:E(Ai,(function(t){var e=t.replace("mouse","pointer");return Pi.hasOwnProperty(e)?e:t}))}),Ni=["mousemove","mouseup"],zi=["pointermove","pointerup"],Ei=!1;function Bi(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Vi(t){t&&(t.zrByTouch=!0)}function Fi(t,e){for(var n=e,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==e&&n===t.painterRoot);)n=n.parentNode;return i}var Hi=function(t,e){this.stopPropagation=xt,this.stopImmediatePropagation=xt,this.preventDefault=xt,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},Wi={mousedown:function(t){t=se(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=se(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=se(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Fi(this,(t=se(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){Ei=!0,t=se(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){Ei||(t=se(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Vi(t=se(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Wi.mousemove.call(this,t),Wi.mousedown.call(this,t)},touchmove:function(t){Vi(t=se(this.dom,t)),this.handler.processGesture(t,"change"),Wi.mousemove.call(this,t)},touchend:function(t){Vi(t=se(this.dom,t)),this.handler.processGesture(t,"end"),Wi.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&Wi.click.call(this,t)},pointerdown:function(t){Wi.mousedown.call(this,t)},pointermove:function(t){Bi(t)||Wi.mousemove.call(this,t)},pointerup:function(t){Wi.mouseup.call(this,t)},pointerout:function(t){Bi(t)||Wi.mouseout.call(this,t)}};z(["click","dblclick","contextmenu"],(function(t){Wi[t]=function(e){e=se(this.dom,e),this.trigger(t,e)}}));var Gi={pointermove:function(t){Bi(t)||Gi.mousemove.call(this,t)},pointerup:function(t){Gi.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function Ui(t,e){var n=e.domHandlers;r.pointerEventsSupported?z(Ri.pointer,(function(i){Yi(e,i,(function(e){n[i].call(t,e)}))})):(r.touchEventsSupported&&z(Ri.touch,(function(i){Yi(e,i,(function(r){n[i].call(t,r),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),z(Ri.mouse,(function(i){Yi(e,i,(function(r){r=ae(r),e.touching||n[i].call(t,r)}))})))}function Zi(t,e){function n(n){Yi(e,n,(function(i){i=ae(i),Fi(t,i.target)||(i=function(t,e){return se(t.dom,new Hi(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))}),{capture:!0})}r.pointerEventsSupported?z(zi,n):r.touchEventsSupported||z(Ni,n)}function Yi(t,e,n,i){t.mounted[e]=n,t.listenerOpts[e]=i,le(t.domTarget,e,n,i)}function Xi(t){var e,n,i,r,o=t.mounted;for(var a in o)o.hasOwnProperty(a)&&(e=t.domTarget,n=a,i=o[a],r=t.listenerOpts[a],e.removeEventListener(n,i,r));t.mounted={}}var ji=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},qi=function(t){function e(e,n){var i=t.call(this)||this;return i.__pointerCapturing=!1,i.dom=e,i.painterRoot=n,i._localHandlerScope=new ji(e,Wi),Oi&&(i._globalHandlerScope=new ji(document,Gi)),Ui(i,i._localHandlerScope),i}return n(e,t),e.prototype.dispose=function(){Xi(this._localHandlerScope),Oi&&Xi(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,Oi&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?Zi(this,e):Xi(e)}},e}(Ut),Ki=1;r.hasGlobalWindow&&(Ki=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var $i=Ki,Qi="#333",Ji="#ccc",tr=ge,er=5e-5;function nr(t){return t>er||t<-5e-5}var ir=[],rr=[],or=[1,0,0,1,0,0],ar=Math.abs,sr=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return nr(this.rotation)||nr(this.x)||nr(this.y)||nr(this.scaleX-1)||nr(this.scaleY-1)||nr(this.skewX)||nr(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):tr(n),t&&(e?ye(n,t,n):ve(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&tr(n)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(ir);var n=ir[0]<0?-1:1,i=ir[1]<0?-1:1,r=((ir[0]-n)*e+n)/ir[0]||0,o=((ir[1]-i)*e+i)/ir[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],we(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),r=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(ye(rr,t.invTransform,e),e=rr);var n=this.originX,i=this.originY;(n||i)&&(or[4]=n,or[5]=i,ye(rr,e,or),rr[4]-=n,rr[5]-=i,e=rr),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&Bt(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&Bt(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&ar(t[0]-1)>1e-10&&ar(t[3]-1)>1e-10?Math.sqrt(ar(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){ur(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,r=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,p=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var d=n+a,f=i+s;e[4]=-d*r-c*f*o,e[5]=-f*o-p*d*r}else e[4]=e[5]=0;return e[0]=r,e[3]=o,e[1]=p*r,e[2]=c*o,l&&_e(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),lr=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function ur(t,e){for(var n=0;n=0?parseFloat(t)/100*e:parseFloat(t):t}function mr(t,e,n){var i=e.position||"inside",r=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=yr(i[0],n.width),u+=yr(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=r,u+=s,h="right",c="middle";break;case"right":l+=r+a,u+=s,c="middle";break;case"top":l+=a/2,u-=r,h="center",c="bottom";break;case"bottom":l+=a/2,u+=o+r,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=r,u+=s,c="middle";break;case"insideRight":l+=a-r,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=r,h="center";break;case"insideBottom":l+=a/2,u+=o-r,h="center",c="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,h="right";break;case"insideBottomLeft":l+=r,u+=o-r,c="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}var _r="__zr_normal__",xr=lr.concat(["ignore"]),wr=B(lr,(function(t,e){return t[e]=!0,t}),{ignore:!1}),br={},Sr=new Le(0,0,0,0),Mr=function(){function t(t){this.id=M(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=e.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(e),null!=n.position){var u=Sr;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(br,n,u):mr(br,n,u),r.x=br.x,r.y=br.y,o=br.align,a=br.verticalAlign;var h=n.origin;if(h&&null!=n.rotation){var c=void 0,p=void 0;"center"===h?(c=.5*u.width,p=.5*u.height):(c=yr(h[0],u.width),p=yr(h[1],u.height)),l=!0,r.originX=-r.x+c+(i?0:u.x),r.originY=-r.y+p+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var d=n.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,y=void 0,m=void 0;f&&this.canBeInsideText()?(v=n.insideFill,y=n.insideStroke,null!=v&&"auto"!==v||(v=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(v),m=!0)):(v=n.outsideFill,y=n.outsideStroke,null!=v&&"auto"!==v||(v=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(v),m=!0)),(v=v||"#000")===g.fill&&y===g.stroke&&m===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=v,g.stroke=y,g.autoStroke=m,g.align=o,g.verticalAlign=a,e.setDefaultTextStyle(g)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Ji:Qi},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&Wn(e);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(r?0:255)*(1-i);return n[3]=1,Kn(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},k(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(j(t))for(var n=F(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(_r,!1,t)},t.prototype.useState=function(t,e,n,i){var r=t===_r;if(this.hasState()||!r){var o=this.currentStates,a=this.stateTransition;if(!(L(o,t)>=0)||!e&&1!==o.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,e,!n&&!this.__inHover&&a&&a.duration>0,a);var u=this._textContent,h=this._textGuide;return u&&u.useState(t,e,n,l),h&&h.useState(t,e,n,l),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}C("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],r=this.currentStates,o=t.length,a=o===r.length;if(a)for(var s=0;s0,d);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),r=L(i,t),o=L(i,e)>=0;r>=0?o?i.splice(r,1):i[r]=e:n&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)})),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,r=[],o=0;o0&&n.during&&o[0].during((function(t,e){n.during(e)}));for(var p=0;p0||r.force&&!a.length){var b,S=void 0,M=void 0,C=void 0;if(s){M={},p&&(S={});for(x=0;x<_;x++){M[y=g[x]]=n[y],p?S[y]=i[y]:n[y]=i[y]}}else if(p){C={};for(x=0;x<_;x++){C[y=g[x]]=bi(n[y]),Tr(n,i,y)}}(b=new Di(n,!1,!1,c?V(f,(function(t){return t.targetName===e})):null)).targetName=e,r.scope&&(b.scope=r.scope),p&&S&&b.whenWithKeys(0,S,g),C&&b.whenWithKeys(0,C,g),b.whenWithKeys(null==u?500:u,s?M:i,g).delay(h||0),t.addAnimator(b,e),a.push(b)}}R(Mr,Ut),R(Mr,sr);var kr=function(t){function e(e){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(e),n}return n(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var e=this._children,n=0;n=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=L(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=L(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e0){if(t<=r)return a;if(t>=o)return s}else{if(t>=r)return a;if(t<=o)return s}else{if(t===r)return a;if(t===o)return s}return(t-r)/l*u+a}function Br(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return Z(t)?(n=t,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var n}function Vr(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function Fr(t){return t.sort((function(t,e){return t-e})),t}function Hr(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return Wr(t)}function Wr(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,r=n>0?n:e.length,o=e.indexOf("."),a=o<0?0:r-1-o;return Math.max(0,a-i)}function Gr(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function Ur(t,e){var n=B(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===n)return[];for(var i=Math.pow(10,e),r=E(t,(function(t){return(isNaN(t)?0:t)/n*i*100})),o=100*i,a=E(r,(function(t){return Math.floor(t)})),s=B(a,(function(t,e){return t+e}),0),l=E(r,(function(t,e){return t-a[e]}));su&&(u=l[c],h=c);++a[h],l[h]=0,++s}return E(a,(function(t){return t/i}))}function Zr(t,e){var n=Math.max(Hr(t),Hr(e)),i=t+e;return n>20?i:Vr(i,n)}function Yr(t){var e=2*Math.PI;return(t%e+e)%e}function Xr(t){return t>-1e-4&&t=10&&e++,e}function Qr(t,e){var n=$r(t),i=Math.pow(10,n),r=t/i;return t=(e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function Jr(t){var e=parseFloat(t);return e==t&&(0!==e||!Z(t)||t.indexOf("x")<=0)?e:NaN}function to(t){return!isNaN(Jr(t))}function eo(){return Math.round(9*Math.random())}function no(t,e){return 0===e?t:no(e,t%e)}function io(t,e){return null==t?e:null==e?t:t*e/no(t,e)}"undefined"!=typeof console&&console.warn&&console.log;function ro(t){0}function oo(t){throw new Error(t)}function ao(t,e,n){return(e-t)*n+t}var so="series\0",lo="\0_ec_\0";function uo(t){return t instanceof Array?t:null==t?[]:[t]}function ho(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,r=n.length;i=0||r&&L(r,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var Fo=Vo([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Ho=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return Fo(this,t,e)},t}(),Wo=new kn(50);function Go(t){if("string"==typeof t){var e=Wo.get(t);return e&&e.image}return t}function Uo(t,e,n,i,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=Wo.get(t),a={hostEl:n,cb:i,cbPayload:r};return o?!Yo(e=o.image)&&o.pending.push(a):((e=h.loadImage(t,Zo,Zo)).__zrImageSrc=t,Wo.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Zo(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=a;l++)s-=a;var u=cr(n,e);return u>s&&(n="",u=0),s=t-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=t,r}function Ko(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var o=cr(t,i);if(o<=n)return t;for(var a=0;;a++){if(o<=r||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?$o(t,r,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*r/o):0;o=cr(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function $o(t,e,n,i){for(var r=0,o=0,a=t.length;o0&&f+i.accumWidth>i.width&&(o=e.split("\n"),c=!0),i.accumWidth=f}else{var g=ra(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+d,a=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var v=0;v=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!na[t]}function ra(t,e,n,i,r){for(var o=[],a=[],s="",l="",u=0,h=0,c=0;cn:r+h+d>n)?h?(s||l)&&(f?(s||(s=l,l="",h=u=0),o.push(s),a.push(h-u),l+=p,s="",h=u+=d):(l&&(s+=l,l="",u=0),o.push(s),a.push(h),s=p,h=d)):f?(o.push(l),a.push(u),l=p,u=d):(o.push(p),a.push(d)):(h+=d,f?(l+=p,u+=d):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),o.push(s),a.push(h),s="",l="",u=0,h=0}return o.length||s||(s=t,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(h)),1===o.length&&(h+=r),{accumWidth:h,lines:o,linesWidths:a}}var oa="__zr_style_"+Math.round(10*Math.random()),aa={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},sa={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};aa[oa]=!0;var la=["z","z2","invisible"],ua=["invisible"],ha=function(t){function e(e){return t.call(this,e)||this}var i;return n(e,t),e.prototype._init=function(e){for(var n=F(e),i=0;i1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(ma[0]=va(r)*n+t,ma[1]=ga(r)*i+e,_a[0]=va(o)*n+t,_a[1]=ga(o)*i+e,u(s,ma,_a),h(l,ma,_a),(r%=ya)<0&&(r+=ya),(o%=ya)<0&&(o+=ya),r>o&&!a?o+=ya:rr&&(xa[0]=va(d)*n+t,xa[1]=ga(d)*i+e,u(s,xa,s),h(l,xa,l))}var Ta={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Da=[],ka=[],Aa=[],Pa=[],La=[],Oa=[],Ra=Math.min,Na=Math.max,za=Math.cos,Ea=Math.sin,Ba=Math.abs,Va=Math.PI,Fa=2*Va,Ha="undefined"!=typeof Float32Array,Wa=[];function Ga(t){return Math.round(t/Va*1e8)/1e8%2*Va}var Ua=function(){function t(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(t,e,n){(n=n||0)>0&&(this._ux=Ba(n/$i/t)||0,this._uy=Ba(n/$i/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Ta.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Ba(t-this._xi),i=Ba(e-this._yi),r=n>this._ux||i>this._uy;if(this.addData(Ta.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Ta.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Ta.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),Wa[0]=i,Wa[1]=r,function(t,e){var n=Ga(t[0]);n<0&&(n+=Fa);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=Fa?r=n+Fa:e&&n-r>=Fa?r=n-Fa:!e&&n>r?r=n+(Fa-Ga(n-r)):e&&nu.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Aa[0]=Aa[1]=La[0]=La[1]=Number.MAX_VALUE,Pa[0]=Pa[1]=Oa[0]=Oa[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,r=0,o=0;for(t=0;tn||Ba(v)>i||c===e-1)&&(f=Math.sqrt(k*k+v*v),r=g,o=_);break;case Ta.C:var y=t[c++],m=t[c++],_=(g=t[c++],t[c++]),x=t[c++],w=t[c++];f=mn(r,o,y,m,g,_,x,w,10),r=x,o=w;break;case Ta.Q:f=Sn(r,o,y=t[c++],m=t[c++],g=t[c++],_=t[c++],10),r=g,o=_;break;case Ta.A:var b=t[c++],S=t[c++],M=t[c++],C=t[c++],I=t[c++],T=t[c++],D=T+I;c+=1;t[c++];d&&(a=za(I)*M+b,s=Ea(I)*C+S),f=Na(M,C)*Ra(Fa,Math.abs(T)),r=za(D)*M+b,o=Ea(D)*C+S;break;case Ta.R:a=r=t[c++],s=o=t[c++],f=2*t[c++]+2*t[c++];break;case Ta.Z:var k=a-r;v=s-o;f=Math.sqrt(k*k+v*v),r=a,o=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h,c,p=this.data,d=this._ux,f=this._uy,g=this._len,v=e<1,y=0,m=0,_=0;if(!v||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),_=0),w){case Ta.M:n=r=p[x++],i=o=p[x++],t.moveTo(r,o);break;case Ta.L:a=p[x++],s=p[x++];var S=Ba(a-r),M=Ba(s-o);if(S>d||M>f){if(v){if(y+(j=l[m++])>u){var C=(u-y)/j;t.lineTo(r*(1-C)+a*C,o*(1-C)+s*C);break t}y+=j}t.lineTo(a,s),r=a,o=s,_=0}else{var I=S*S+M*M;I>_&&(h=a,c=s,_=I)}break;case Ta.C:var T=p[x++],D=p[x++],k=p[x++],A=p[x++],P=p[x++],L=p[x++];if(v){if(y+(j=l[m++])>u){yn(r,T,k,P,C=(u-y)/j,Da),yn(o,D,A,L,C,ka),t.bezierCurveTo(Da[1],ka[1],Da[2],ka[2],Da[3],ka[3]);break t}y+=j}t.bezierCurveTo(T,D,k,A,P,L),r=P,o=L;break;case Ta.Q:T=p[x++],D=p[x++],k=p[x++],A=p[x++];if(v){if(y+(j=l[m++])>u){bn(r,T,k,C=(u-y)/j,Da),bn(o,D,A,C,ka),t.quadraticCurveTo(Da[1],ka[1],Da[2],ka[2]);break t}y+=j}t.quadraticCurveTo(T,D,k,A),r=k,o=A;break;case Ta.A:var O=p[x++],R=p[x++],N=p[x++],z=p[x++],E=p[x++],B=p[x++],V=p[x++],F=!p[x++],H=N>z?N:z,W=Ba(N-z)>.001,G=E+B,U=!1;if(v)y+(j=l[m++])>u&&(G=E+B*(u-y)/j,U=!0),y+=j;if(W&&t.ellipse?t.ellipse(O,R,N,z,V,E,G,F):t.arc(O,R,H,E,G,F),U)break t;b&&(n=za(E)*N+O,i=Ea(E)*z+R),r=za(G)*N+O,o=Ea(G)*z+R;break;case Ta.R:n=r=p[x],i=o=p[x+1],a=p[x++],s=p[x++];var Z=p[x++],Y=p[x++];if(v){if(y+(j=l[m++])>u){var X=u-y;t.moveTo(a,s),t.lineTo(a+Ra(X,Z),s),(X-=Z)>0&&t.lineTo(a+Z,s+Ra(X,Y)),(X-=Y)>0&&t.lineTo(a+Na(Z-X,0),s+Y),(X-=Z)>0&&t.lineTo(a,s+Na(Y-X,0));break t}y+=j}t.rect(a,s,Z,Y);break;case Ta.Z:if(v){var j;if(y+(j=l[m++])>u){C=(u-y)/j;t.lineTo(r*(1-C)+n*C,o*(1-C)+i*C);break t}y+=j}t.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=Ta,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function Za(t,e,n,i,r,o,a){if(0===r)return!1;var s=r,l=0;if(a>e+s&&a>i+s||at+s&&o>n+s||oe+c&&h>i+c&&h>o+c&&h>s+c||ht+c&&u>n+c&&u>r+c&&u>a+c||u=0&&fe+u&&l>i+u&&l>o+u||lt+u&&s>n+u&&s>r+u||s=0&&vn||h+ur&&(r+=Ka);var p=Math.atan2(l,s);return p<0&&(p+=Ka),p>=i&&p<=r||p+Ka>=i&&p+Ka<=r}function Qa(t,e,n,i,r,o){if(o>e&&o>i||or?s:0}var Ja=Ua.CMD,ts=2*Math.PI;var es=[-1,-1,-1],ns=[-1,-1];function is(t,e,n,i,r,o,a,s,l,u){if(u>e&&u>i&&u>o&&u>s||u1&&(h=void 0,h=ns[0],ns[0]=ns[1],ns[1]=h),f=dn(e,i,o,s,ns[0]),d>1&&(g=dn(e,i,o,s,ns[1]))),2===d?ye&&s>i&&s>o||s=0&&h<=1&&(r[l++]=h);else{var u=a*a-4*o*s;if(cn(u))(h=-a/(2*o))>=0&&h<=1&&(r[l++]=h);else if(u>0){var h,c=nn(u),p=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(r[l++]=h),p>=0&&p<=1&&(r[l++]=p)}}return l}(e,i,o,s,es);if(0===l)return 0;var u=wn(e,i,o);if(u>=0&&u<=1){for(var h=0,c=_n(e,i,o,u),p=0;pn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);es[0]=-l,es[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=ts-1e-4){i=0,r=ts;var h=o?1:-1;return a>=es[0]+t&&a<=es[1]+t?h:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=ts,r+=ts);for(var p=0,d=0;d<2;d++){var f=es[d];if(f+t>a){var g=Math.atan2(s,f);h=o?1:-1;g<0&&(g=ts+g),(g>=i&&g<=r||g+ts>=i&&g+ts<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),p+=h)}}return p}function as(t,e,n,i,r){for(var o,a,s,l,u=t.data,h=t.len(),c=0,p=0,d=0,f=0,g=0,v=0;v1&&(n||(c+=Qa(p,d,f,g,i,r))),m&&(f=p=u[v],g=d=u[v+1]),y){case Ja.M:p=f=u[v++],d=g=u[v++];break;case Ja.L:if(n){if(Za(p,d,u[v],u[v+1],e,i,r))return!0}else c+=Qa(p,d,u[v],u[v+1],i,r)||0;p=u[v++],d=u[v++];break;case Ja.C:if(n){if(Ya(p,d,u[v++],u[v++],u[v++],u[v++],u[v],u[v+1],e,i,r))return!0}else c+=is(p,d,u[v++],u[v++],u[v++],u[v++],u[v],u[v+1],i,r)||0;p=u[v++],d=u[v++];break;case Ja.Q:if(n){if(Xa(p,d,u[v++],u[v++],u[v],u[v+1],e,i,r))return!0}else c+=rs(p,d,u[v++],u[v++],u[v],u[v+1],i,r)||0;p=u[v++],d=u[v++];break;case Ja.A:var _=u[v++],x=u[v++],w=u[v++],b=u[v++],S=u[v++],M=u[v++];v+=1;var C=!!(1-u[v++]);o=Math.cos(S)*w+_,a=Math.sin(S)*b+x,m?(f=o,g=a):c+=Qa(p,d,o,a,i,r);var I=(i-_)*b/w+_;if(n){if($a(_,x,b,S,S+M,C,e,I,r))return!0}else c+=os(_,x,b,S,S+M,C,I,r);p=Math.cos(S+M)*w+_,d=Math.sin(S+M)*b+x;break;case Ja.R:if(f=p=u[v++],g=d=u[v++],o=f+u[v++],a=g+u[v++],n){if(Za(f,g,o,g,e,i,r)||Za(o,g,o,a,e,i,r)||Za(o,a,f,a,e,i,r)||Za(f,a,f,g,e,i,r))return!0}else c+=Qa(o,g,o,a,i,r),c+=Qa(f,a,f,g,i,r);break;case Ja.Z:if(n){if(Za(p,d,f,g,e,i,r))return!0}else c+=Qa(p,d,f,g,i,r);p=f,d=g}}return n||(s=d,l=g,Math.abs(s-l)<1e-4)||(c+=Qa(p,d,f,g,i,r)||0),0!==c}var ss=A({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},aa),ls={style:A({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},sa.style)},us=lr.concat(["invisible","culling","z","z2","zlevel","parent"]),hs=function(t){function e(e){return t.call(this,e)||this}var i;return n(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){n.buildPath(t,n.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s.5?Qi:e>.2?"#eee":Ji}if(t)return Ji}return Qi},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(Z(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())===$n(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Ua(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||4&this.__dirty)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return as(t,e,!0,n,i)}(o,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return as(t,0,!1,e,n)}(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:k(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return yt(ss,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=k({},this.shape))},e.prototype._applyStateObj=function(e,n,i,r,o,a){t.prototype._applyStateObj.call(this,e,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=k({},i.shape),k(s,n.shape)):(s=k({},r?this.shape:i.shape),k(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=k({},this.shape);for(var u={},h=F(s),c=0;c0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return yt(cs,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=dr(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(ha);ps.prototype.type="tspan";var ds=A({x:0,y:0},aa),fs={style:A({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},sa.style)};var gs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.createStyle=function(t){return yt(ds,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var i,r=(i=e.image)&&"string"!=typeof i&&i.width&&i.height?e.image:this.__image;if(!r)return 0;var o="width"===t?"height":"width",a=e[o];return null==a?r[t]:r[t]/r[o]*a},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return fs},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Le(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(ha);gs.prototype.type="image";var vs=Math.round;function ys(t,e,n){if(e){var i=e.x1,r=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=r,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(vs(2*i)===vs(2*r)&&(t.x1=t.x2=_s(i,s,!0)),vs(2*o)===vs(2*a)&&(t.y1=t.y2=_s(o,s,!0)),t):t}}function ms(t,e,n){if(e){var i=e.x,r=e.y,o=e.width,a=e.height;t.x=i,t.y=r,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=_s(i,s,!0),t.y=_s(r,s,!0),t.width=Math.max(_s(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(_s(r+a,s,!1)-t.y,0===a?0:1),t):t}}function _s(t,e,n){if(!e)return t;var i=vs(2*t);return(i+vs(e))%2==0?i/2:(i+(n?1:-1))/2}var xs=function(){this.x=0,this.y=0,this.width=0,this.height=0},ws={},bs=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultShape=function(){return new xs},e.prototype.buildPath=function(t,e){var n,i,r,o;if(this.subPixelOptimize){var a=ms(ws,e,this.style);n=a.x,i=a.y,r=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,i=e.y,r=e.width,o=e.height;e.r?function(t,e){var n,i,r,o,a,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?n=i=r=o=c:c instanceof Array?1===c.length?n=i=r=o=c[0]:2===c.length?(n=r=c[0],i=o=c[1]):3===c.length?(n=c[0],i=o=c[1],r=c[2]):(n=c[0],i=c[1],r=c[2],o=c[3]):n=i=r=o=0,n+i>u&&(n*=u/(a=n+i),i*=u/a),r+o>u&&(r*=u/(a=r+o),o*=u/a),i+r>h&&(i*=h/(a=i+r),r*=h/a),n+o>h&&(n*=h/(a=n+o),o*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-r),0!==r&&t.arc(s+u-r,l+h-r,r,0,Math.PI/2),t.lineTo(s+o,l+h),0!==o&&t.arc(s+o,l+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(hs);bs.prototype.type="rect";var Ss={fill:"#000"},Ms={style:A({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},sa.style)},Cs=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Ss,n.attr(e),n}return n(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ed&&h){var f=Math.floor(d/l);n=n.slice(0,f)}if(t&&a&&null!=c)for(var g=qo(c,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v=0;v0,I=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),T=i.calculatedLineHeight,D=0;Dl&&ea(n,t.substring(l,u),e,s),ea(n,i[2],e,s,i[1]),l=Xo.lastIndex}lo){w>0?(m.tokens=m.tokens.slice(0,w),v(m,x,_),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break t}var T=b.width,D=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))L.percentWidth=T,h.push(L),L.contentWidth=cr(L.text,C);else{if(D){var k=b.backgroundColor,A=k&&k.image;A&&Yo(A=Go(A))&&(L.width=Math.max(L.width,A.width*I/A.height))}var P=f&&null!=r?r-x:null;null!=P&&P=0&&"right"===(T=_[I]).align;)this._placeToken(T,t,w,f,C,"right",v),b-=T.width,C-=T.width,I--;for(M+=(n-(M-d)-(g-C)-b)/2;S<=I;)T=_[S],this._placeToken(T,t,w,f,M+T.width/2,"center",v),M+=T.width,S++;f+=w}},e.prototype._placeToken=function(t,e,n,i,r,o,s){var l=e.rich[t.styleName]||{};l.text=t.text;var u=t.verticalAlign,h=i+n/2;"top"===u?h=i+t.height/2:"bottom"===u&&(h=i+n-t.height/2),!t.isLineHolder&&Es(l)&&this._renderBackground(l,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,h-t.height/2,t.width,t.height);var c=!!l.backgroundColor,p=t.textPadding;p&&(r=Ns(r,o,p),h-=t.height/2-p[0]-t.innerHeight/2);var d=this._getOrCreateChild(ps),f=d.createStyle();d.useStyle(f);var g=this._defaultStyle,v=!1,y=0,m=Rs("fill"in l?l.fill:"fill"in e?e.fill:(v=!0,g.fill)),_=Os("stroke"in l?l.stroke:"stroke"in e?e.stroke:c||s||g.autoStroke&&!v?null:(y=2,g.stroke)),x=l.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=r,f.y=h,x&&(f.shadowBlur=l.textShadowBlur||e.textShadowBlur||0,f.shadowColor=l.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=l.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=l.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=t.font||a,f.opacity=rt(l.opacity,e.opacity,1),As(f,l),_&&(f.lineWidth=rt(l.lineWidth,e.lineWidth,y),f.lineDash=it(l.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=_),m&&(f.fill=m);var w=t.contentWidth,b=t.contentHeight;d.setBoundingRect(new Le(fr(f.x,w,f.textAlign),gr(f.y,b,f.textBaseline),w,b))},e.prototype._renderBackground=function(t,e,n,i,r,o){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,p=u&&u.image,d=u&&!p,f=t.borderRadius,g=this;if(d||t.lineHeight||h&&c){(a=this._getOrCreateChild(bs)).useStyle(a.createStyle()),a.style.fill=null;var v=a.shape;v.x=n,v.y=i,v.width=r,v.height=o,v.r=f,a.dirtyShape()}if(d)(l=a.style).fill=u||null,l.fillOpacity=it(t.fillOpacity,1);else if(p){(s=this._getOrCreateChild(gs)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=u.image,y.x=n,y.y=i,y.width=r,y.height=o}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=it(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var m=(a||s).style;m.shadowBlur=t.shadowBlur||0,m.shadowColor=t.shadowColor||"transparent",m.shadowOffsetX=t.shadowOffsetX||0,m.shadowOffsetY=t.shadowOffsetY||0,m.opacity=rt(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return Ps(t)&&(e=[t.fontStyle,t.fontWeight,ks(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&<(e)||t.textFont||t.font},e}(ha),Is={left:!0,right:1,center:1},Ts={top:1,bottom:1,middle:1},Ds=["fontStyle","fontWeight","fontSize","fontFamily"];function ks(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function As(t,e){for(var n=0;n=0,o=!1;if(t instanceof hs){var a=Hs(t),s=r&&a.selectFill||a.normalFill,l=r&&a.selectStroke||a.normalStroke;if(Ks(s)||Ks(l)){var u=(i=i||{}).style||{};"inherit"===u.fill?(o=!0,i=k({},i),(u=k({},u)).fill=s):!Ks(u.fill)&&Ks(s)?(o=!0,i=k({},i),(u=k({},u)).fill=Qs(s)):!Ks(u.stroke)&&Ks(l)&&(o||(i=k({},i),u=k({},u)),u.stroke=Qs(l)),i.style=u}}if(i&&null==i.z2){o||(i=k({},i));var h=t.z2EmphasisLift;i.z2=t.z2+(null!=h?h:10)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=L(t.currentStates,e)>=0,r=t.style.opacity,o=i?null:function(t,e,n,i){for(var r=t.style,o={},a=0;a0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=i&&(o.dataType=i),e.push(o)}}))})),e}function Il(t,e,n){Pl(t,!0),sl(t,hl),function(t,e,n){var i=Bs(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}function Tl(t,e,n,i){i?function(t){Pl(t,!1)}(t):Il(t,e,n)}var Dl=["emphasis","blur","select"],kl={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Al(t,e,n,i){n=n||"itemStyle";for(var r=0;r1&&(a*=Vl(f),s*=Vl(f));var g=(r===o?-1:1)*Vl((a*a*(s*s)-a*a*(d*d)-s*s*(p*p))/(a*a*(d*d)+s*s*(p*p)))||0,v=g*a*d/s,y=g*-s*p/a,m=(t+n)/2+Hl(c)*v-Fl(c)*y,_=(e+i)/2+Fl(c)*v+Hl(c)*y,x=Zl([1,0],[(p-v)/a,(d-y)/s]),w=[(p-v)/a,(d-y)/s],b=[(-1*p-v)/a,(-1*d-y)/s],S=Zl(w,b);if(Ul(w,b)<=-1&&(S=Wl),Ul(w,b)>=1&&(S=0),S<0){var M=Math.round(S/Wl*1e6)/1e6;S=2*Wl+M%2*Wl}h.addData(u,m,_,a,s,x,S,c,o)}var Xl=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,jl=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var ql=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.applyTransform=function(t){},e}(hs);function Kl(t){return null!=t.setData}function $l(t,e){var n=function(t){var e=new Ua;if(!t)return e;var n,i=0,r=0,o=i,a=r,s=Ua.CMD,l=t.match(Xl);if(!l)return e;for(var u=0;uA*A+P*P&&(M=I,C=T),{cx:M,cy:C,x0:-h,y0:-c,x1:M*(r/w-1),y1:C*(r/w-1)}}function fu(t,e){var n,i=hu(e.r,0),r=hu(e.r0||0,0),o=i>0;if(o||r>0){if(o||(i=r,r=0),r>i){var a=i;i=r,r=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,p=lu(l-s),d=p>iu&&p%iu;if(d>pu&&(p=d),i>pu)if(p>iu-pu)t.moveTo(u+i*ou(s),h+i*ru(s)),t.arc(u,h,i,s,l,!c),r>pu&&(t.moveTo(u+r*ou(l),h+r*ru(l)),t.arc(u,h,r,l,s,c));else{var f=void 0,g=void 0,v=void 0,y=void 0,m=void 0,_=void 0,x=void 0,w=void 0,b=void 0,S=void 0,M=void 0,C=void 0,I=void 0,T=void 0,D=void 0,k=void 0,A=i*ou(s),P=i*ru(s),L=r*ou(l),O=r*ru(l),R=p>pu;if(R){var N=e.cornerRadius;N&&(n=function(t){var e;if(G(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(N),f=n[0],g=n[1],v=n[2],y=n[3]);var z=lu(i-r)/2;if(m=cu(z,v),_=cu(z,y),x=cu(z,f),w=cu(z,g),M=b=hu(m,_),C=S=hu(x,w),(b>pu||S>pu)&&(I=i*ou(l),T=i*ru(l),D=r*ou(s),k=r*ru(s),ppu){var Z=cu(v,M),Y=cu(y,M),X=du(D,k,A,P,i,Z,c),j=du(I,T,L,O,i,Y,c);t.moveTo(u+X.cx+X.x0,h+X.cy+X.y0),M0&&t.arc(u+X.cx,h+X.cy,Z,su(X.y0,X.x0),su(X.y1,X.x1),!c),t.arc(u,h,i,su(X.cy+X.y1,X.cx+X.x1),su(j.cy+j.y1,j.cx+j.x1),!c),Y>0&&t.arc(u+j.cx,h+j.cy,Y,su(j.y1,j.x1),su(j.y0,j.x0),!c))}else t.moveTo(u+A,h+P),t.arc(u,h,i,s,l,!c);else t.moveTo(u+A,h+P);if(r>pu&&R)if(C>pu){Z=cu(f,C),X=du(L,O,I,T,r,-(Y=cu(g,C)),c),j=du(A,P,D,k,r,-Z,c);t.lineTo(u+X.cx+X.x0,h+X.cy+X.y0),C0&&t.arc(u+X.cx,h+X.cy,Y,su(X.y0,X.x0),su(X.y1,X.x1),!c),t.arc(u,h,r,su(X.cy+X.y1,X.cx+X.x1),su(j.cy+j.y1,j.cx+j.x1),c),Z>0&&t.arc(u+j.cx,h+j.cy,Z,su(j.y1,j.x1),su(j.y0,j.x0),!c))}else t.lineTo(u+L,h+O),t.arc(u,h,r,l,s,c);else t.lineTo(u+L,h+O)}else t.moveTo(u,h);t.closePath()}}}var gu=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},vu=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultShape=function(){return new gu},e.prototype.buildPath=function(t,e){fu(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(hs);vu.prototype.type="sector";var yu=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},mu=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultShape=function(){return new yu},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)},e}(hs);function _u(t,e,n){var i=e.smooth,r=e.points;if(r&&r.length>=2){if(i){var o=function(t,e,n,i){var r,o,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,d=t.length;pBu[1]){if(a=!1,r)return a;var u=Math.abs(Bu[0]-Eu[1]),h=Math.abs(Eu[0]-Bu[1]);Math.min(u,h)>i.len()&&(u0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function Xu(t,e,n,i,r,o){Yu("update",t,e,n,i,r,o)}function ju(t,e,n,i,r,o){Yu("enter",t,e,n,i,r,o)}function qu(t){if(!t.__zr)return!0;for(var e=0;eMath.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function mh(t){return!t.isGroup}function _h(t,e,n){if(t&&e){var i,r=(i={},t.traverse((function(t){mh(t)&&t.anid&&(i[t.anid]=t)})),i);e.traverse((function(t){if(mh(t)&&t.anid){var e=r[t.anid];if(e){var i=o(t);t.attr(o(e)),Xu(t,i,n,Bs(t).dataIndex)}}}))}function o(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=k({},t.shape)),e}}function xh(t,e){return E(t,(function(t){var n=t[0];n=th(n,e.x),n=eh(n,e.x+e.width);var i=t[1];return i=th(i,e.y),[n,i=eh(i,e.y+e.height)]}))}function wh(t,e){var n=th(t.x,e.x),i=eh(t.x+t.width,e.x+e.width),r=th(t.y,e.y),o=eh(t.y+t.height,e.y+e.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function bh(t,e,n){var i=k({rectHover:!0},e),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),A(r,n),new gs(i)):lh(t.replace("path://",""),i,n,"center")}function Sh(t,e,n,i,r,o,a,s){var l,u=n-t,h=i-e,c=a-r,p=s-o,d=Mh(c,p,u,h);if((l=d)<=1e-6&&l>=-1e-6)return!1;var f=t-r,g=e-o,v=Mh(f,g,u,h)/d;if(v<0||v>1)return!1;var y=Mh(f,g,c,p)/d;return!(y<0||y>1)}function Mh(t,e,n,i){return t*i-n*e}function Ch(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,r=Z(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&z(F(l),(function(t){_t(s,t)||(s[t]=l[t],s.$vars.push(t))}));var u=Bs(t.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:A({content:i,formatterParams:s},r)}}function Ih(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function Th(t,e){if(t)if(G(t))for(var n=0;n-1?nc:rc;function lc(t,e){t=t.toUpperCase(),ac[t]=new Qh(e),oc[t]=e}lc(ic,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),lc(nc,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var uc=1e3,hc=6e4,cc=36e5,pc=864e5,dc=31536e6,fc={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},gc="{yyyy}-{MM}-{dd}",vc={year:"{yyyy}",month:"{yyyy}-{MM}",day:gc,hour:gc+" "+fc.hour,minute:gc+" "+fc.minute,second:gc+" "+fc.second,millisecond:fc.none},yc=["year","month","day","hour","minute","second","millisecond"],mc=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function _c(t,e){return"0000".substr(0,e-(t+="").length)+t}function xc(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function wc(t){return t===xc(t)}function bc(t,e,n,i){var r=qr(t),o=r[Cc(n)](),a=r[Ic(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[Tc(n)](),u=r["get"+(n?"UTC":"")+"Day"](),h=r[Dc(n)](),c=(h-1)%12+1,p=r[kc(n)](),d=r[Ac(n)](),f=r[Pc(n)](),g=i instanceof Qh?i:function(t){return ac[t]}(i||sc)||ac[rc],v=g.getModel("time"),y=v.get("month"),m=v.get("monthAbbr"),_=v.get("dayOfWeek"),x=v.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,o%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,m[a-1]).replace(/{MM}/g,_c(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,_c(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_c(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,_c(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,_c(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,_c(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,_c(f,3)).replace(/{S}/g,f+"")}function Sc(t,e){var n=qr(t),i=n[Ic(e)]()+1,r=n[Tc(e)](),o=n[Dc(e)](),a=n[kc(e)](),s=n[Ac(e)](),l=0===n[Pc(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===o,p=c&&1===r;return p&&1===i?"year":p?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function Mc(t,e,n){var i=X(t)?qr(t):t;switch(e=e||Sc(t,n)){case"year":return i[Cc(n)]();case"half-year":return i[Ic(n)]()>=6?1:0;case"quarter":return Math.floor((i[Ic(n)]()+1)/4);case"month":return i[Ic(n)]();case"day":return i[Tc(n)]();case"half-day":return i[Dc(n)]()/24;case"hour":return i[Dc(n)]();case"minute":return i[kc(n)]();case"second":return i[Ac(n)]();case"millisecond":return i[Pc(n)]()}}function Cc(t){return t?"getUTCFullYear":"getFullYear"}function Ic(t){return t?"getUTCMonth":"getMonth"}function Tc(t){return t?"getUTCDate":"getDate"}function Dc(t){return t?"getUTCHours":"getHours"}function kc(t){return t?"getUTCMinutes":"getMinutes"}function Ac(t){return t?"getUTCSeconds":"getSeconds"}function Pc(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Lc(t){return t?"setUTCFullYear":"setFullYear"}function Oc(t){return t?"setUTCMonth":"setMonth"}function Rc(t){return t?"setUTCDate":"setDate"}function Nc(t){return t?"setUTCHours":"setHours"}function zc(t){return t?"setUTCMinutes":"setMinutes"}function Ec(t){return t?"setUTCSeconds":"setSeconds"}function Bc(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Vc(t){if(!to(t))return Z(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Fc(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var Hc=at;function Wc(t,e,n){function i(t){return t&<(t)?t:"-"}function r(t){return!(null==t||isNaN(t)||!isFinite(t))}var o="time"===e,a=t instanceof Date;if(o||a){var s=o?qr(t):t;if(!isNaN(+s))return bc(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return Y(t)?i(t):X(t)&&r(t)?t+"":"-";var l=Jr(t);return r(l)?Vc(l):Y(t)?i(t):"boolean"==typeof t?t+"":"-"}var Gc=["a","b","c","d","e","f","g"],Uc=function(t,e){return"{"+t+(null==e?"":e)+"}"};function Zc(t,e,n){G(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o':'':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function Xc(t,e){return e=e||"transparent",Z(t)?t:j(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function jc(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var qc=z,Kc=["left","right","top","bottom","width","height"],$c=[["width","left","right"],["height","top","bottom"]];function Qc(t,e,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild((function(l,u){var h,c,p=l.getBoundingRect(),d=e.childAt(u+1),f=d&&d.getBoundingRect();if("horizontal"===t){var g=p.width+(f?-f.x+p.x:0);(h=o+g)>i||l.newline?(o=0,h=g,a+=s+n,s=p.height):s=Math.max(s,p.height)}else{var v=p.height+(f?-f.y+p.y:0);(c=a+v)>r||l.newline?(o+=s+n,a=0,c=v,s=p.width):s=Math.max(s,p.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=h+n:a=c+n)}))}var Jc=Qc;W(Qc,"vertical"),W(Qc,"horizontal");function tp(t,e,n){n=Hc(n||0);var i=e.width,r=e.height,o=Br(t.left,i),a=Br(t.top,r),s=Br(t.right,i),l=Br(t.bottom,r),u=Br(t.width,i),h=Br(t.height,r),c=n[2]+n[0],p=n[1]+n[3],d=t.aspect;switch(isNaN(u)&&(u=i-s-p-o),isNaN(h)&&(h=r-l-c-a),null!=d&&(isNaN(u)&&isNaN(h)&&(d>i/r?u=.8*i:h=.8*r),isNaN(u)&&(u=d*h),isNaN(h)&&(h=u/d)),isNaN(o)&&(o=i-s-u-p),isNaN(a)&&(a=r-l-h-c),t.left||t.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-p}switch(t.top||t.bottom){case"middle":case"center":a=r/2-h/2-n[0];break;case"bottom":a=r-h-c}o=o||0,a=a||0,isNaN(u)&&(u=i-p-o-(s||0)),isNaN(h)&&(h=r-c-a-(l||0));var f=new Le(o+n[3],a+n[0],u,h);return f.margin=n,f}function ep(t,e,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if((o=o||t).x=t.x,o.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new Le(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(a=a.clone()).applyTransform(h)}var c=tp(A({width:a.width,height:a.height},e),n,i),p=s?c.x-a.x:0,d=l?c.y-a.y:0;return"raw"===u?(o.x=p,o.y=d):(o.x+=p,o.y+=d),o===t&&t.markRedraw(),!0}function np(t){var e=t.layoutMode||t.constructor.layoutMode;return j(e)?e:e?{type:e}:null}function ip(t,e,n){var i=n&&n.ignoreSize;!G(i)&&(i=[i,i]);var r=a($c[0],0),o=a($c[1],1);function a(n,r){var o={},a=0,u={},h=0;if(qc(n,(function(e){u[e]=t[e]})),qc(n,(function(t){s(e,t)&&(o[t]=u[t]=e[t]),l(o,t)&&a++,l(u,t)&&h++})),i[r])return l(e,n[1])?u[n[2]]=null:l(e,n[2])&&(u[n[1]]=null),u;if(2!==h&&a){if(a>=2)return o;for(var c=0;c=0;a--)o=T(o,n[a],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Do(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Qh);Ro(sp,Qh),Bo(sp),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=Lo(t);e[i.main]=n},t.determineSubType=function(n,i){var r=i.type;if(!r){var o=Lo(n).main;t.hasSubTypes(n)&&e[o]&&(r=e[o](i))}return r}}(sp),function(t,e){function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,i,r,o){if(t.length){var a=function(t){var i={},r=[];return z(t,(function(o){var a=n(i,o),s=function(t,e){var n=[];return z(t,(function(t){L(e,t)>=0&&n.push(t)})),n}(a.originalDeps=e(o),t);a.entryCount=s.length,0===a.entryCount&&r.push(o),z(s,(function(t){L(a.predecessor,t)<0&&a.predecessor.push(t);var e=n(i,t);L(e.successor,t)<0&&e.successor.push(o)}))})),{graph:i,noEntryList:r}}(i),s=a.graph,l=a.noEntryList,u={};for(z(t,(function(t){u[t]=!0}));l.length;){var h=l.pop(),c=s[h],p=!!u[h];p&&(r.call(o,h,c.originalDeps.slice()),delete u[h]),z(c.successor,p?f:d)}z(u,(function(){var t="";throw new Error(t)}))}function d(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}function f(t){u[t]=!0,d(t)}}}(sp,(function(t){var e=[];z(sp.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=E(e,(function(t){return Lo(t).main})),"dataset"!==t&&L(e,"dataset")<=0&&e.unshift("dataset");return e}));var lp="";"undefined"!=typeof navigator&&(lp=navigator.platform||"");var up="rgba(0, 0, 0, 0.2)",hp={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:up,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:up,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:up,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:up,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:up,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:up,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:lp.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},cp=gt(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),pp="original",dp="arrayRows",fp="objectRows",gp="keyedColumns",vp="typedArray",yp="unknown",mp="column",_p="row",xp=1,wp=2,bp=3,Sp=bo();function Mp(t,e,n){var i={},r=Ip(e);if(!r||!t)return i;var o,a,s=[],l=[],u=e.ecModel,h=Sp(u).datasetMap,c=r.uid+"_"+n.seriesLayoutBy;z(t=t.slice(),(function(e,n){var r=j(e)?e:t[n]={name:e};"ordinal"===r.type&&null==o&&(o=n,a=f(r)),i[r.name]=[]}));var p=h.get(c)||h.set(c,{categoryWayDim:a,valueWayDim:0});function d(t,e,n){for(var i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return r&&(u[r]=c),s.paletteIdx=(l+1)%h.length,c}}var Bp="\0_ec_inner";var Vp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new Qh(i),this._locale=new Qh(r),this._optionManager=o},e.prototype.setOption=function(t,e,n){var i=Wp(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},e.prototype.resetOption=function(t,e){return this._resetOption(t,Wp(e))},e.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var r=i.mountOption("recreate"===t);0,this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):Lp(this,r),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&z(a,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=gt(),s=e&&e.replaceMergeMainTypeMap;Sp(this).datasetMap=gt(),z(t,(function(t,e){null!=t&&(sp.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?I(t):T(n[e],t,!0))})),s&&s.each((function(t,e){sp.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))})),sp.topologicalTravel(o,sp.getAllClassMainTypes(),(function(e){var o=function(t,e,n){var i=kp.get(e);if(!i)return n;var r=i(t);return r?n.concat(r):n}(this,e,uo(t[e])),a=i.get(e),l=a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=go(a,o,l);(function(t,e,n){z(t,(function(t){var i=t.newOption;j(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))}))})(u,e,sp),n[e]=null,i.set(e,null),r.set(e,0);var h,c=[],p=[],d=0;z(u,(function(t,n){var i=t.existing,r=t.newOption;if(r){var o="series"===e,a=sp.getClass(e,t.keyInfo.subType,!o);if(!a)return;if("tooltip"===e){if(h)return void 0;h=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=k({componentIndex:n},t.keyInfo);k(i=new a(r,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),p.push(i),d++):(c.push(void 0),p.push(void 0))}),this),n[e]=c,i.set(e,p),r.set(e,d),"series"===e&&Ap(this)}),this),this._seriesIndices||Ap(this)},e.prototype.getOption=function(){var t=I(this.option);return z(t,(function(e,n){if(sp.hasClass(n)){for(var i=uo(e),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!xo(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,t[n]=i}})),delete t[Bp],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var r=0;r=e:"max"===n?t<=e:t===e})(i[a],t,o)||(r=!1)}})),r}var Kp=z,$p=j,Qp=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Jp(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Qp.length;n=0;g--){var v=t[g];if(s||(p=v.data.rawIndexOf(v.stackedByDimension,c)),p>=0){var y=v.data.getByRawIndex(v.stackResultDimension,p);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&d>=0&&y>0||"samesign"===l&&d<=0&&y<0){d=Zr(d,y),f=y;break}}}return i[0]=d,i[1]=f,i}))}))}var yd,md,_d,xd,wd,bd=function(t){this.data=t.data||(t.sourceFormat===gp?{}:[]),this.sourceFormat=t.sourceFormat||yp,this.seriesLayoutBy=t.seriesLayoutBy||mp,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;nu&&(u=d)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""})):void 0},t.prototype.getRawValue=function(t,e){return Hd(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function Ud(t){var e,n;return j(t)?t.type&&(n=t):e=t,{text:e,frag:n}}function Zd(t){return new Yd(t)}var Yd=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,i=t&&t.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(e=this._plan(this.context));var o,a=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;function h(t){return!(t>=1)&&(t=1),t}a===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(o||p1&&i>0?s:a}};return o;function a(){return e=t?null:oi?-this._resultLT:0},t}(),Kd=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return jd(t,e)},t}();function $d(t){var e=t.sourceFormat;if(!rf(e)){var n="";0,oo(n)}return t.data}function Qd(t){var e=t.sourceFormat,n=t.data;if(!rf(e)){var i="";0,oo(i)}if(e===dp){for(var r=[],o=0,a=n.length;o65535?sf:lf}function df(t,e,n,i,r){var o=cf[n||"float"];if(r){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;ug[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=E(o,(function(t){return t.property})),u=0;uv[1]&&(v[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l=0&&a<0)&&(o=c,a=h,s=0),h===a&&(r[s++]=l))}return r.length=s,r},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;r=u&&_<=h||isNaN(_))&&(a[s++]=d),d++}p=!0}else if(2===r){f=c[i[0]];var v=c[i[1]],y=t[i[1]][0],m=t[i[1]][1];for(g=0;g=u&&_<=h||isNaN(_))&&(x>=y&&x<=m||isNaN(x))&&(a[s++]=d),d++}p=!0}}if(!p)if(1===r)for(g=0;g=u&&_<=h||isNaN(_))&&(a[s++]=w)}else for(g=0;gt[M][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(g))}return sv[1]&&(v[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var n,i,r,o=this.clone([t],!0),a=o._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(pf(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var p=1;pn&&(n=i,r=C)}M>0&&Mu-d&&(s=u-d,a.length=s);for(var f=0;fh[1]&&(h[1]=v),c[p++]=y}return r._count=p,r._indices=c,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();ra&&(a=l)}return i=[o,a],this._extent[t]=i,i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,r=0;r=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return jd(t[i],this._dimensions[i])}of={arrayRows:t,objectRows:function(t,e,n,i){return jd(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var r=t&&(null==t.value?t:t.value);return jd(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}(),gf=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(yf(n)){var o=n,a=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=K(a=o.get("data",!0))?vp:pp,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},p=it(h.seriesLayoutBy,c.seriesLayoutBy)||null,d=it(h.sourceHeader,c.sourceHeader),f=it(h.dimensions,c.dimensions);t=p!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||f?[Md(a,{seriesLayoutBy:p,sourceHeader:d,dimensions:f},s)]:[]}else{var g=n;if(r){var v=this._applyTransform(i);t=v.sourceList,e=v.upstreamSignList}else{t=[Md(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var o="";1!==t.length&&mf(o)}var a,s=[],l=[];return z(t,(function(t){t.prepareSource();var e=t.getSource(r||0),n="";null==r||e||mf(n),s.push(e),l.push(t._getVersionSign())})),i?e=function(t,e,n){var i=uo(t),r=i.length,o="";r||oo(o);for(var a=0,s=r;a1||n>0&&!t.noHeader;return z(t.blocks,(function(t){var n=If(t);n>=e&&(e=n+ +(i&&(!n||Mf(t)&&!t.noHeader)))})),e}return 0}function Tf(t,e,n,i){var r,o=e.noHeader,a=(r=If(e),{html:wf[r],richText:bf[r]}),s=[],l=e.blocks||[];st(!l||G(l)),l=l||[];var u=t.orderMode;if(e.sortBlocks&&u){l=l.slice();var h={valueAsc:"asc",valueDesc:"desc"};if(_t(h,u)){var c=new qd(h[u],null);l.sort((function(t,e){return c.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===u&&l.reverse()}z(l,(function(n,r){var o=e.valueFormatter,l=Cf(n)(o?k(k({},t),{valueFormatter:o}):t,n,r>0?a.html:0,i);null!=l&&s.push(l)}));var p="richText"===t.renderMode?s.join(a.richText):Af(s.join(""),o?n:a.html);if(o)return p;var d=Wc(e.header,"ordinal",t.useUTC),f=xf(i,t.renderMode).nameStyle;return"richText"===t.renderMode?Pf(t,d,f)+a.richText+p:Af('
                  '+te(d)+"
                  "+p,n)}function Df(t,e,n,i){var r=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return E(t=G(t)?t:[t],(function(t,e){return Wc(t,G(d)?d[e]:d,u)}))};if(!o||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),p=o?"":Wc(l,"ordinal",u),d=e.valueType,f=a?[]:h(e.value),g=!s||!o,v=!s&&o,y=xf(i,r),m=y.nameStyle,_=y.valueStyle;return"richText"===r?(s?"":c)+(o?"":Pf(t,p,m))+(a?"":function(t,e,n,i,r){var o=[r],a=i?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(G(e)?e.join(" "):e,o)}(t,f,g,v,_)):Af((s?"":c)+(o?"":function(t,e,n){return''+te(t)+""}(p,!s,m))+(a?"":function(t,e,n,i){var r=n?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return t=G(t)?t:[t],''+E(t,(function(t){return te(t)})).join("  ")+""}(f,g,v,_)),n)}}function kf(t,e,n,i,r,o){if(t)return Cf(t)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function Af(t,e){return'
                  '+t+'
                  '}function Pf(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function Lf(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var Of=function(){function t(){this.richTextStyles={},this._nextStyleNameId=eo()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,r=Yc({color:e,type:t,renderMode:n,markerId:i});return Z(r)?r:(this.richTextStyles[i]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};G(e)?z(e,(function(t){return k(n,t)})):k(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}();function Rf(t){var e,n,i,r,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,c=o.getRawValue(a),p=G(c),d=function(t,e){return Xc(t.getData().getItemVisual(e,"style")[t.visualDrawType])}(o,a);if(h>1||p&&!h){var f=function(t,e,n,i,r){var o=e.getData(),a=B(t,(function(t,e,n){var i=o.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function h(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?u.push(Sf("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return i.length?z(i,(function(t){h(Hd(o,n,t),t)})):z(t,h),{inlineValues:s,inlineValueTypes:l,blocks:u}}(c,o,a,u,d);e=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(h){var g=l.getDimensionInfo(u[0]);r=e=Hd(l,a,u[0]),n=g.type}else r=e=p?c[0]:c;var v=_o(o),y=v&&o.name||"",m=l.getName(a),_=s?y:m;return Sf("section",{header:y,noHeader:s||!v,sortParam:r,blocks:[Sf("nameValue",{markerType:"item",markerColor:d,name:_,noName:!lt(_),value:e,valueType:n})].concat(i||[])})}var Nf=bo();function zf(t,e){return t.getName(e)||t.getId(e)}var Ef=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return n(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Zd({count:Vf,reset:Ff}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(Nf(this).sourceManager=new gf(this)).prepareSource();var i=this.getInitialData(t,n);Wf(i,this),this.dataTask.context.data=i,Nf(this).dataBeforeProcessed=i,Bf(this),this._initSelectedMapFromData(i)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=np(this),i=n?rp(t):{},r=this.subType;sp.hasClass(r)&&(r+="Series"),T(t,e.getTheme().get(this.subType)),T(t,this.getDefaultOption()),ho(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&ip(t,i,n)},e.prototype.mergeOption=function(t,e){t=T(this.option,t,!0),this.fillDataTextStyle(t.data);var n=np(this);n&&ip(this.option,t,n);var i=Nf(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(t,e);Wf(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,Nf(this).dataBeforeProcessed=r,Bf(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!K(t))for(var e=["show"],n=0;nthis.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,r=Np.prototype.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o=0&&n.push(r)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[zf(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,o=r.selectedMode,a=e.length;if(o&&a)if("series"===o)r.selectedMap="all";else if("multiple"===o){j(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l0&&this._innerSelect(t,e)}},e.registerClass=function(t){return sp.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(sp);function Bf(t){var e=t.name;_o(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return z(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}(t)||e)}function Vf(t){return t.model.getRawData().count()}function Ff(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),Hf}function Hf(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Wf(t,e){z(vt(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,W(Gf,e))}))}function Gf(t,e){var n=Uf(t);return n&&n.setOutputEnd((e||this).count()),e}function Uf(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}R(Ef,Gd),R(Ef,Np),Ro(Ef,sp);var Zf=function(){function t(){this.group=new kr,this.uid=tc("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();function Yf(){var t=bo();return function(e){var n=t(e),i=e.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===a&&o===s)&&"reset"}}Oo(Zf),Bo(Zf);var Xf=bo(),jf=Yf(),qf=function(){function t(){this.group=new kr,this.uid=tc("viewChart"),this.renderTask=Zd({plan:Qf,reset:Jf}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){0},t.prototype.highlight=function(t,e,n,i){var r=t.getData(i&&i.dataType);r&&$f(r,i,"emphasis")},t.prototype.downplay=function(t,e,n,i){var r=t.getData(i&&i.dataType);r&&$f(r,i,"normal")},t.prototype.remove=function(t,e){this.group.removeAll()},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.eachRendered=function(t){Th(this.group,t)},t.markUpdateMethod=function(t,e){Xf(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();function Kf(t,e,n){t&&Ll(t)&&("emphasis"===e?dl:fl)(t,n)}function $f(t,e,n){var i=wo(t,e),r=e&&null!=e.highlightKey?function(t){var e=Fs[t];return null==e&&Vs<=32&&(e=Fs[t]=Vs++),e}(e.highlightKey):null;null!=i?z(uo(i),(function(e){Kf(t.getItemGraphicEl(e),n,r)})):t.eachItemGraphicEl((function(t){Kf(t,n,r)}))}function Qf(t){return jf(t.model)}function Jf(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,s=r&&Xf(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,i,r),tg[l]}Oo(qf),Bo(qf);var tg={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},eg="\0__throttleOriginMethod",ng="\0__throttleRate",ig="\0__throttleType";function rg(t,e,n){var i,r,o,a,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,t.apply(o,a||[])}e=e||0;var p=function(){for(var t=[],p=0;p=0?c():h=setTimeout(c,-r),l=i};return p.clear=function(){h&&(clearTimeout(h),h=null)},p.debounceNextCall=function(t){s=t},p}function og(t,e,n,i){var r=t[e];if(r){var o=r[eg]||r,a=r[ig];if(r[ng]!==n||a!==i){if(null==n||!i)return t[e]=o;(r=t[e]=rg(o,n,"debounce"===i))[eg]=o,r[ig]=i,r[ng]=n}return r}}function ag(t,e){var n=t[e];n&&n[eg]&&(n.clear&&n.clear(),t[e]=n[eg])}var sg=bo(),lg={itemStyle:Vo(qh,!0),lineStyle:Vo(Yh,!0)},ug={lineStyle:"stroke",itemStyle:"fill"};function hg(t,e){var n=t.visualStyleMapper||lg[e];return n||(console.warn("Unknown style type '"+e+"'."),lg.itemStyle)}function cg(t,e){var n=t.visualDrawType||ug[e];return n||(console.warn("Unknown style type '"+e+"'."),"fill")}var pg={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=t.getModel(i),o=hg(t,i)(r),a=r.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=cg(t,i),l=o[s],u=U(l)?l:null,h="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||h){var c=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[s]||(o[s]=c,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||U(o.fill)?c:o.fill,o.stroke="auto"===o.stroke||U(o.stroke)?c:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),r=k({},o);r[s]=u(i),e.setItemVisual(n,"style",r)}}}},dg=new Qh,fg={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=hg(t,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[i]){dg.option=n[i];var a=r(dg);k(t.ensureUniqueItemVisual(e,"style"),a),dg.option.decal&&(t.setItemVisual(e,"decal",dg.option.decal),dg.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},gg={performRawSeries:!0,overallReset:function(t){var e=gt();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,r=e.get(i);r||(r={},e.set(i,r)),sg(t).scope=r}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},r=e.getData(),o=sg(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=cg(e,a);r.each((function(t){var e=r.getRawIndex(t);i[e]=t})),n.each((function(t){var a=i[t];if(r.getItemVisual(a,"colorFromPalette")){var l=r.ensureUniqueItemVisual(a,"style"),u=n.getName(t)||t+"",h=n.count();l[s]=e.getColorFromPalette(u,o,h)}}))}}))}},vg=Math.PI;var yg=function(){function t(t,e,n,i){this._stageTaskMap=gt(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,o=i&&i.modDataCount;return{step:r,modBy:null!=o?Math.ceil(o/r):null,modDataCount:o}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,o=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:a,large:o}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=gt();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;z(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,{}),o="";st(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,r,e,n),i.overallReset&&this._createOverallStageTask(i,r,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var r=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}z(t,(function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,p=h.agentStubMap;p.each((function(t){a(i,t)&&(t.dirty(),c=!0)})),c&&h.dirty(),o.updatePayload(h,n);var d=o.getPerformArgs(h,i.block);p.each((function(t){t.perform(d)})),h.perform(d)&&(r=!0)}else u&&u.each((function(s,l){a(i,s)&&s.dirty();var u=o.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var r=this,o=e.seriesTaskMap,a=e.seriesTaskMap=gt(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=a.set(s,o&&o.get(s)||Zd({plan:bg,reset:Sg,count:Ig}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},t.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||Zd({reset:mg});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=gt(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,p="";function d(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(c=!0,Zd({reset:_g,onDirty:wg})));n.context={model:t,overallProgress:h},n.agent=o,n.__block=h,r._pipe(t,n)}st(!t.createOnAllSeries,p),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(h=!1,z(n.getSeries(),d)),c&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return U(t)&&(t={overallReset:t,seriesType:Tg(t)}),t.uid=tc("stageHandler"),e&&(t.visualType=e),t},t}();function mg(t){t.overallReset(t.ecModel,t.api,t.payload)}function _g(t){return t.overallProgress&&xg}function xg(){this.agent.dirty(),this.getDownstream().dirty()}function wg(){this.agent&&this.agent.dirty()}function bg(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function Sg(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=uo(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?E(e,(function(t,e){return Cg(e)})):Mg}var Mg=Cg(0);function Cg(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,r));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),Fg=["symbol","symbolSize","symbolRotate","symbolOffset"],Hg=Fg.concat(["symbolKeepAspect"]),Wg={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a=0&&sv(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,r=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,r=r*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),i=sv(i)?i:0,r=sv(r)?r:1,o=sv(o)?o:0,a=sv(a)?a:0,t.createLinearGradient(i,o,r,a)}(t,e,n),r=e.colorStops,o=0;o0&&(e=i.lineDash,n=i.lineWidth,e&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:X(e)?[e]:G(e)?e:null:null),o=i.lineDashOffset;if(r){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(r=E(r,(function(t){return t/a})),o/=a)}return[r,o]}var pv=new Ua(!0);function dv(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function fv(t){return"string"==typeof t&&"none"!==t}function gv(t){var e=t.fill;return null!=e&&"none"!==e}function vv(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function yv(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function mv(t,e,n){var i=Uo(e.image,e.__image,n);if(Yo(i)){var r=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*wt),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}var _v=["shadowBlur","shadowOffsetX","shadowOffsetY"],xv=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function wv(t,e,n,i,r){var o=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){Mv(t,r),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?aa.opacity:a}(i||e.blend!==n.blend)&&(o||(Mv(t,r),o=!0),t.globalCompositeOperation=e.blend||aa.blend);for(var s=0;s<_v.length;s++){var l=_v[s];(i||e[l]!==n[l])&&(o||(Mv(t,r),o=!0),t[l]=t.dpr*(e[l]||0))}return(i||e.shadowColor!==n.shadowColor)&&(o||(Mv(t,r),o=!0),t.shadowColor=e.shadowColor||aa.shadowColor),o}function bv(t,e,n,i,r){var o=Cv(e,r.inHover),a=i?null:n&&Cv(n,r.inHover)||{};if(o===a)return!1;var s=wv(t,o,a,i,r);if((i||o.fill!==a.fill)&&(s||(Mv(t,r),s=!0),fv(o.fill)&&(t.fillStyle=o.fill)),(i||o.stroke!==a.stroke)&&(s||(Mv(t,r),s=!0),fv(o.stroke)&&(t.strokeStyle=o.stroke)),(i||o.opacity!==a.opacity)&&(s||(Mv(t,r),s=!0),t.globalAlpha=null==o.opacity?1:o.opacity),e.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==l&&(s||(Mv(t,r),s=!0),t.lineWidth=l)}for(var u=0;u0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,n){if(!this[Hv])if(this._disposed)my(this.id);else{var i,r,o;if(j(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this[Hv]=!0,!this._model||e){var a=new jp(this._api),s=this._theme,l=this._model=new Vp;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:r},by);var u={seriesTransition:o,optionChanged:!0};if(n)this[Wv]={silent:i,updateParams:u},this[Hv]=!1,this.getZr().wakeUp();else{try{qv(this),Qv.update.call(this,null,u)}catch(t){throw this[Wv]=null,this[Hv]=!1,t}this._ssr||this._zr.flush(),this[Wv]=null,this[Hv]=!1,ny.call(this,i),iy.call(this,i)}}},e.prototype.setTheme=function(){ro()},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||r.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var e=this._zr.painter;return e.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var e=this._zr.painter;return e.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(r.svgSupported){var t=this._zr;return z(t.storage.getDisplayList(),(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,i=[],r=this;z(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return z(i,(function(t){t.group.ignore=!1})),o}my(this.id)},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(Ty[n]){var a=o,s=o,l=-1/0,u=-1/0,c=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();z(Iy,(function(o,h){if(o.group===n){var p=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(I(t)),d=o.getDom().getBoundingClientRect();a=i(d.left,a),s=i(d.top,s),l=r(d.right,l),u=r(d.bottom,u),c.push({dom:p,left:d.left,top:d.top})}}));var d=(l*=p)-(a*=p),f=(u*=p)-(s*=p),g=h.createCanvas(),v=Or(g,{renderer:e?"svg":"canvas"});if(v.resize({width:d,height:f}),e){var y="";return z(c,(function(t){var e=t.left-a,n=t.top-s;y+=''+t.dom+""})),v.painter.getSvgRoot().innerHTML=y,t.connectedBackgroundColor&&v.painter.setBackgroundColor(t.connectedBackgroundColor),v.refreshImmediately(),v.painter.toDataURL()}return t.connectedBackgroundColor&&v.add(new bs({shape:{x:0,y:0,width:d,height:f},style:{fill:t.connectedBackgroundColor}})),z(c,(function(t){var e=new gs({style:{x:t.left*p-a,y:t.top*p-s,image:t.dom}});v.add(e)})),v.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}my(this.id)},e.prototype.convertToPixel=function(t,e){return Jv(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return Jv(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){var n;if(!this._disposed)return z(Mo(this._model,t),(function(t,i){i.indexOf("Models")>=0&&z(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n=n||o.containPoint(e,t))}else 0}),this)}),this),!!n;my(this.id)},e.prototype.getVisual=function(t,e){var n=Mo(this._model,t,{defaultMainType:"series"}),i=n.seriesModel;var r=i.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?r.indexOfRawIndex(n.dataIndex):null;return null!=o?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(r,o,e):Ug(r,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t,e,n,i=this;z(yy,(function(t){var e=function(e){var n,r=i.getModel(),o=e.target,a="globalout"===t;if(a?n={}:o&&Yg(o,(function(t){var e=Bs(t);if(e&&null!=e.dataIndex){var i=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return n=i&&i.getDataParams(e.dataIndex,e.dataType)||{},!0}if(e.eventData)return n=k({},e.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&i["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,n.event=e,n.type=t,i._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:u,view:h},i.trigger(t,n)}};e.zrEventfulCallAtLast=!0,i._zr.on(t,e,i)})),z(xy,(function(t,e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),z(["selectchanged"],(function(t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),t=this._messageCenter,e=this,n=this._api,t.on("selectchanged",(function(t){var i=n.getModel();t.isFromClick?(Zg("map","selectchanged",e,i,t),Zg("pie","selectchanged",e,i,t)):"select"===t.fromAction?(Zg("map","selected",e,i,t),Zg("pie","selected",e,i,t)):"unselect"===t.fromAction&&(Zg("map","unselected",e,i,t),Zg("pie","unselected",e,i,t))}))},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?my(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)my(this.id);else{this._disposed=!0,this.getDom()&&ko(this.getDom(),Ay,"");var t=this,e=t._api,n=t._model;z(t._componentsViews,(function(t){t.dispose(n,e)})),z(t._chartsViews,(function(t){t.dispose(n,e)})),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete Iy[t.id]}},e.prototype.resize=function(t){if(!this[Hv])if(this._disposed)my(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[Wv]&&(null==i&&(i=this[Wv].silent),n=!0,this[Wv]=null),this[Hv]=!0;try{n&&qv(this),Qv.update.call(this,{type:"resize",animation:k({duration:0},t&&t.animation)})}catch(t){throw this[Hv]=!1,t}this[Hv]=!1,ny.call(this,i),iy.call(this,i)}}},e.prototype.showLoading=function(t,e){if(this._disposed)my(this.id);else if(j(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),Cy[t]){var n=Cy[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},e.prototype.hideLoading=function(){this._disposed?my(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=k({},t);return e.type=xy[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)my(this.id);else if(j(e)||(e={silent:!!e}),_y[t.type]&&this._model)if(this[Hv])this._pendingActions.push(t);else{var n=e.silent;ey.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&r.browser.weChat&&this._throttledZrFlush(),ny.call(this,n),iy.call(this,n)}},e.prototype.updateLabelLayout=function(){Nv.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)my(this.id);else{var e=t.seriesIndex,n=this.getModel().getSeriesByIndex(e);0,n.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}function e(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered((function(t){if(t.states&&t.states.emphasis){if(qu(t))return;if(t instanceof hs&&function(t){var e=Hs(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var n=t.prevStates;n&&t.useStates(n)}if(r){t.stateTransition=a;var i=t.getTextContent(),o=t.getTextGuideLine();i&&(i.stateTransition=a),o&&(o.stateTransition=a)}t.__dirty&&e(t)}}))}qv=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Kv(t,!0),Kv(t,!1),e.plan()},Kv=function(t,e){for(var n=t._model,i=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;le.get("hoverLayerThreshold")&&!r.node&&!r.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,e),Nv.trigger("series:afterupdate",e,n,l)},cy=function(t){t[Gv]=!0,t.getZr().wakeUp()},py=function(t){t[Gv]&&(t.getZr().storage.traverse((function(t){qu(t)||e(t)})),t[Gv]=!1)},uy=function(t){return new(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){dl(e,n),cy(t)},i.prototype.leaveEmphasis=function(e,n){fl(e,n),cy(t)},i.prototype.enterBlur=function(e){gl(e),cy(t)},i.prototype.leaveBlur=function(e){vl(e),cy(t)},i.prototype.enterSelect=function(e){yl(e),cy(t)},i.prototype.leaveSelect=function(e){ml(e),cy(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i}(Up))(t)},hy=function(t){function e(t,e){for(var n=0;n=0)){Uy.push(n);var o=yg.wrapStageHandler(n,r);o.__prio=e,o.__raw=n,t.push(o)}}function Yy(t,e){Cy[t]=e}function Xy(t,e,n){var i=Ev("registerMap");i&&i(t,e,n)}var jy=function(t){var e=(t=I(t)).type,n="";e||oo(n);var i=e.split(":");2!==i.length&&oo(n);var r=!1;"echarts"===i[0]&&(e=i[1],r=!0),t.__isBuiltIn=r,ef.set(e,t)};Gy(Bv,pg),Gy(Vv,fg),Gy(Vv,gg),Gy(Bv,Wg),Gy(Vv,Gg),Gy(7e3,(function(t,e){t.eachRawSeries((function(n){if(!t.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(t){var n=i.getItemVisual(t,"decal");n&&(i.ensureUniqueItemVisual(t,"style").decal=Pv(n,e))}));var r=i.getVisual("decal");if(r)i.getVisual("style").decal=Pv(r,e)}}))})),Ny(gd),zy(900,(function(t){var e=gt();t.eachSeries((function(t){var n=t.get("stack");if(n){var i=e.get(n)||e.set(n,[]),r=t.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(o)}})),e.each(vd)})),Yy("default",(function(t,e){A(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new kr,i=new bs({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var r,o=new Cs({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new bs({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((r=new Lu({shape:{startAngle:-vg/2,endAngle:-vg/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*vg/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*vg/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n})),Fy({type:Zs,event:Zs,update:Zs},xt),Fy({type:Ys,event:Ys,update:Ys},xt),Fy({type:Xs,event:Xs,update:Xs},xt),Fy({type:js,event:js,update:js},xt),Fy({type:qs,event:qs,update:qs},xt),Ry("light",Og),Ry("dark",Bg);var qy=[],Ky={registerPreprocessor:Ny,registerProcessor:zy,registerPostInit:Ey,registerPostUpdate:By,registerUpdateLifecycle:Vy,registerAction:Fy,registerCoordinateSystem:Hy,registerLayout:Wy,registerVisual:Gy,registerTransform:jy,registerLoading:Yy,registerMap:Xy,registerImpl:function(t,e){zv[t]=e},PRIORITY:Fv,ComponentModel:sp,ComponentView:Zf,SeriesModel:Ef,ChartView:qf,registerComponentModel:function(t){sp.registerClass(t)},registerComponentView:function(t){Zf.registerClass(t)},registerSeriesModel:function(t){Ef.registerClass(t)},registerChartView:function(t){qf.registerClass(t)},registerSubTypeDefaulter:function(t,e){sp.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Rr(t,e)}};function $y(t){G(t)?z(t,(function(t){$y(t)})):L(qy,t)>=0||(qy.push(t),U(t)&&(t={install:t}),t.install(Ky))}function Qy(t){return null==t?0:t.length||1}function Jy(t){return t}var tm=function(){function t(t,e,n,i,r,o){this._old=t,this._new=e,this._oldKeyGetter=n||Jy,this._newKeyGetter=i||Jy,this.context=r,this._diffModeMultiple="multiple"===o}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),r=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,r,"_newKeyGetter");for(var o=0;o1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},r=[],o=[];this._initIndexMap(t,n,r,"_oldKeyGetter"),this._initIndexMap(e,i,o,"_newKeyGetter");for(var a=0;a1&&1===c)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===h&&c>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===h&&1===c)this._update&&this._update(u,l),i[s]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(h>1)for(var p=0;p1)for(var a=0;a30}var cm,pm,dm,fm,gm,vm,ym,mm=j,_m=E,xm="undefined"==typeof Int32Array?Array:Int32Array,wm=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],bm=["_approximateExtent"],Sm=function(){function t(t,e){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i=!1;sm(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},u=0;u=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,r=this._idList;if(n.getSource().sourceFormat===pp&&!n.pure)for(var o=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var r=i[e];return null==r&&(G(r=this.getVisual(e))?r=r.slice():mm(r)&&(r=k({},r)),i[e]=r),r},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,mm(e)?k(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){mm(t)?k(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?k(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,n,i){if(i){var r=Bs(i);r.dataIndex=n,r.dataType=e,r.seriesIndex=t,"group"===i.type&&i.traverse((function(i){var r=Bs(i);r.seriesIndex=t,r.dataIndex=n,r.dataType=e}))}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){z(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:_m(this.dimensions,this._getDimInfo,this),this.hostModel)),gm(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];U(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(ot(arguments)))})},t.internalField=(cm=function(t){var e=t._invertedIndicesMap;z(e,(function(n,i){var r=t._dimInfos[i],o=r.ordinalMeta,a=t._store;if(o){n=e[i]=new xm(o.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();function Mm(t,e){Sd(t)||(t=Cd(t));var n=(e=e||{}).coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],r=gt(),o=[],a=function(t,e,n,i){var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return z(e,(function(t){var e;j(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(t,n,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&hm(a),l=i===t.dimensionsDefine,u=l?um(t):lm(i),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,a));for(var c=gt(h),p=new uf(a),d=0;d0&&(i.name=r+(o-1)),o++,e.set(r,o)}}(o),new am({source:t,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function Cm(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}var Im=function(t){this.coordSysDims=[],this.axisMap=gt(),this.categoryAxisMap=gt(),this.coordSysName=t};var Tm={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis",Io).models[0],o=t.getReferringComponents("yAxis",Io).models[0];e.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),Dm(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),Dm(o)&&(i.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis",Io).models[0];e.coordSysDims=["single"],n.set("single",r),Dm(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar",Io).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),Dm(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),Dm(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();z(o.parallelAxisIndex,(function(t,o){var s=r.getComponent("parallelAxis",t),l=a[o];n.set(l,s),Dm(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function Dm(t){return"category"===t.get("type")}function km(t,e,n){var i,r,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!sm(t.schema)}(e)?(r=e.schema,i=r.dimensions,o=e.store):i=e;var l,u,h,c,p=!(!t||!t.get("stack"));if(z(i,(function(t,e){Z(t)&&(i[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))})),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,c="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var d=u.coordDim,f=u.type,g=0;z(i,(function(t){t.coordDim===d&&g++}));var v={name:h,coordDim:d,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},y={name:c,coordDim:c,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(v.storeDimIndex=o.ensureCalculationDimension(c,f),y.storeDimIndex=o.ensureCalculationDimension(h,f)),r.appendCalculationDimension(v),r.appendCalculationDimension(y)):(i.push(v),i.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:c,stackResultDimension:h}}function Am(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Pm(t,e){return Am(t,e)?t.getCalculationInfo("stackResultDimension"):e}function Lm(t,e,n){n=n||{};var i,r=e.getSourceManager(),o=!1;t?(o=!0,i=Cd(t)):o=(i=r.getSource()).sourceFormat===pp;var a=function(t){var e=t.get("coordinateSystem"),n=new Im(e),i=Tm[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),r=Yp.get(i);return e&&e.coordSysDims&&(n=E(e.coordSysDims,(function(t){var n={name:t},i=e.axisMap.get(t);if(i){var r=i.get("type");n.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(r)}return n}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=U(l)?l:l?W(Mp,s,e):null,h=Mm(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o}),c=function(t,e,n){var i,r;return n&&z(t,(function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)})),r||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),p=o?null:r.getSharedDataStore(h),d=km(e,{schema:h,store:p}),f=new Sm(h,e);f.setCalculationInfo(d);var g=null!=c&&function(t){if(t.sourceFormat===pp){return!G(po(function(t){var e=0;for(;ee[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Bo(Om);var Rm=0,Nm=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++Rm}return t.createByAxisModel=function(e){var n=e.option,i=n.data,r=i&&E(i,zm);return new t({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!Z(t)&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=gt(this.categories))},t}();function zm(t){return j(t)&&null!=t.value?t.value:t+""}function Em(t){return"interval"===t.type||"log"===t.type}function Bm(t,e,n,i){var r={},o=t[1]-t[0],a=r.interval=Qr(o/e,!0);null!=n&&ai&&(a=r.interval=i);var s=r.intervalPrecision=Fm(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Hm(t,0,e),Hm(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[Vr(Math.ceil(t[0]/a)*a,s),Vr(Math.floor(t[1]/a)*a,s)],t),r}function Vm(t){var e=Math.pow(10,$r(t)),n=t/e;return n?2===n?n=3:3===n?n=5:n*=2:n=1,Vr(n*e)}function Fm(t){return Hr(t)+2}function Hm(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function Wm(t,e){return t>=e[0]&&t<=e[1]}function Gm(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function Um(t,e){return t*(e[1]-e[0])+e[0]}var Zm=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new Nm({})),G(i)&&(i=new Nm({categories:E(i,(function(t){return j(t)?t.value:t}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return n(e,t),e.prototype.parse=function(t){return null==t?NaN:Z(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return Wm(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return Gm(t=this._getTickNumber(this.parse(t)),this._extent)},e.prototype.scale=function(t){return t=Math.round(Um(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);r=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Om);Om.registerClass(Zm);var Ym=Vr,Xm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return n(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return Wm(t,this._extent)},e.prototype.normalize=function(t){return Gm(t,this._extent)},e.prototype.scale=function(t){return Um(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Fm(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]1e4)return[];var s=o.length?o[o.length-1].value:i[1];return n[1]>s&&(t?o.push({value:Ym(s+e,r)}):o.push({value:n[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}(t),n=[];return z(t,(function(t){var i,r=t.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var a=r.dim+"_"+r.index,s=e[a],l=Math.abs(o[1]-o[0]),u=r.scale.getExtent(),h=Math.abs(u[1]-u[0]);i=s?l/h*s:l}else{var c=t.getData();i=Math.abs(o[1]-o[0])/c.count()}var p=Br(t.get("barWidth"),i),d=Br(t.get("barMaxWidth"),i),f=Br(t.get("barMinWidth")||(i_(t)?.5:1),i),g=t.get("barGap"),v=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:d,barMinWidth:f,barGap:g,barCategoryGap:v,axisKey:Qm(r),stackId:$m(t)})})),function(t){var e={};z(t,(function(t,n){var i=t.axisKey,r=t.bandWidth,o=e[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;e[i]=o;var s=t.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(o.gap=c);var p=t.barCategoryGap;null!=p&&(o.categoryGap=p)}));var n={};return z(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var a=F(i).length;o=Math.max(35-4*a,15)+"%"}var s=Br(o,r),l=Br(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),z(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){i=t.width;e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--}else{var i=c;e&&ei&&(i=n),i!==c&&(t.width=i,u-=i+l*i,h--)}})),c=(u-s)/(h+(h-1)*l),c=Math.max(c,0);var p,d=0;z(i,(function(t,e){t.width||(t.width=c),p=t,d+=t.width*(1+l)})),p&&(d-=p.width*l);var f=-d/2;z(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:r,offset:f,width:t.width},f+=t.width*(1+l)}))})),n}(n)}function e_(t,e){var n=Jm(t,e),i=t_(n);z(n,(function(t){var e=t.getData(),n=t.coordinateSystem.getBaseAxis(),r=$m(t),o=i[Qm(n)][r],a=o.offset,s=o.width;e.setLayout({bandWidth:o.bandWidth,offset:a,size:s})}))}function n_(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function i_(t){return t.pipelineContext&&t.pipelineContext.large}var r_=function(t){function e(e){var n=t.call(this,e)||this;return n.type="time",n}return n(e,t),e.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return bc(t.value,vc[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(xc(this._minLevelUnit))]||vc.second,e,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,r){var o=null;if(Z(n))o=n;else if(U(n))o=n(t.value,e,{level:t.level});else{var a=k({},fc);if(t.level>0)for(var s=0;s=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(G(o)){var h=null==t.level?0:t.level>=0?t.level:o.length+t.level;o=o[h=Math.min(h,o.length-1)]}}return bc(new Date(t.value),o,r,i)}(t,e,n,this.getSetting("locale"),i)},e.prototype.getTicks=function(){var t=this._interval,e=this._extent,n=[];if(!t)return n;n.push({value:e[0],level:0});var i=this.getSetting("useUTC"),r=function(t,e,n,i){var r=1e4,o=mc,a=0;function s(t,e,n,r,o,a,s){for(var l=new Date(e),u=e,h=l[r]();u1&&0===u&&o.unshift({value:o[0].value-p})}}for(u=0;u=i[0]&&y<=i[1]&&c++)}var m=(i[1]-i[0])/e;if(c>1.5*m&&p>m/1.5)break;if(u.push(g),c>m||t===o[d])break}h=[]}}0;var _=V(E(u,(function(t){return V(t,(function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd}))})),(function(t){return t.length>0})),x=[],w=_.length-1;for(d=0;d<_.length;++d)for(var b=_[d],S=0;Sn&&(this._approxInterval=n);var o=o_.length,a=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function s_(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function l_(t){return(t/=cc)>12?12:t>6?6:t>3.5?4:t>2?2:1}function u_(t,e){return(t/=e?hc:uc)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function h_(t){return Qr(t,!0)}function c_(t,e,n){var i=new Date(t);switch(xc(e)){case"year":case"month":i[Oc(n)](0);case"day":i[Rc(n)](1);case"hour":i[Nc(n)](0);case"minute":i[zc(n)](0);case"second":i[Ec(n)](0),i[Bc(n)](0)}return i.getTime()}Om.registerClass(r_);var p_=Om.prototype,d_=Xm.prototype,f_=Vr,g_=Math.floor,v_=Math.ceil,y_=Math.pow,m_=Math.log,__=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new Xm,e._interval=0,e}return n(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,n=this._extent,i=e.getExtent();return E(d_.getTicks.call(this,t),(function(t){var e=t.value,r=Vr(y_(this.base,e));return r=e===n[0]&&this._fixMin?w_(r,i[0]):r,{value:r=e===n[1]&&this._fixMax?w_(r,i[1]):r}}),this)},e.prototype.setExtent=function(t,e){var n=m_(this.base);t=m_(Math.max(0,t))/n,e=m_(Math.max(0,e))/n,d_.setExtent.call(this,t,e)},e.prototype.getExtent=function(){var t=this.base,e=p_.getExtent.call(this);e[0]=y_(t,e[0]),e[1]=y_(t,e[1]);var n=this._originalScale.getExtent();return this._fixMin&&(e[0]=w_(e[0],n[0])),this._fixMax&&(e[1]=w_(e[1],n[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=m_(t[0])/m_(e),t[1]=m_(t[1])/m_(e),p_.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(n===1/0||n<=0)){var i=Kr(n);for(t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var r=[Vr(v_(e[0]/i)*i),Vr(g_(e[1]/i)*i)];this._interval=i,this._niceExtent=r}},e.prototype.calcNiceExtent=function(t){d_.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return Wm(t=m_(t)/m_(this.base),this._extent)},e.prototype.normalize=function(t){return Gm(t=m_(t)/m_(this.base),this._extent)},e.prototype.scale=function(t){return t=Um(t,this._extent),y_(this.base,t)},e.type="log",e}(Om),x_=__.prototype;function w_(t,e){return f_(t,Hr(e))}x_.getMinorTicks=d_.getMinorTicks,x_.getLabel=d_.getLabel,Om.registerClass(__);var b_=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,p=this._determinedMax;return null!=c&&(a=c,l=!0),null!=p&&(s=p,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[M_[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var n=S_[t];this[n]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),S_={min:"_determinedMin",max:"_determinedMax"},M_={min:"_dataMin",max:"_dataMax"};function C_(t,e,n){var i=t.rawExtentInfo;return i||(i=new b_(t,e,n),t.rawExtentInfo=i,i)}function I_(t,e){return null==e?null:et(e)?NaN:t.parse(e)}function T_(t,e){var n=t.type,i=C_(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var r=i.min,o=i.max,a=e.ecModel;if(a&&"time"===n){var s=Jm("bar",a),l=!1;if(z(s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var u=t_(s),h=function(t,e,n,i){var r=n.axis.getExtent(),o=r[1]-r[0],a=function(t,e,n){if(t&&e){var i=t[Qm(e)];return null!=i&&null!=n?i[$m(n)]:i}}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;z(a,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;z(a,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/o)-h;return e+=c*(l/u),t-=c*(s/u),{min:t,max:e}}(r,o,e,u);r=h.min,o=h.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function D_(t,e){var n=e,i=T_(t,n),r=i.extent,o=n.get("splitNumber");t instanceof __&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function k_(t,e){if(e=e||t.get("type"))switch(e){case"category":return new Zm({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new r_({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(Om.getClass(e)||Xm)}}function A_(t){var e,n,i=t.getLabelModel().get("formatter"),r="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?(n=i,function(e,i){return t.scale.getFormattedLabel(e,i,n)}):Z(i)?function(e){return function(n){var i=t.scale.getLabel(n);return e.replace("{value}",null!=i?i:"")}}(i):U(i)?(e=i,function(n,i){return null!=r&&(i=n.value-r),e(P_(t,n),i,null!=n.level?{level:n.level}:null)}):function(e){return t.scale.getLabel(e)}}function P_(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function L_(t,e){var n=e*Math.PI/180,i=t.width,r=t.height,o=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new Le(t.x,t.y,o,a)}function O_(t){var e=t.get("interval");return null==e?"auto":e}function R_(t){return"category"===t.type&&0===O_(t.getLabelModel())}function N_(t,e){var n={};return z(t.mapDimensionsAll(e),(function(e){n[Pm(t,e)]=!0})),F(n)}var z_=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}();var E_={isDimensionStacked:Am,enableDataStack:km,getStackedDimension:Pm};var B_=Object.freeze({__proto__:null,createList:function(t){return Lm(null,t)},getLayoutRect:tp,dataStack:E_,createScale:function(t,e){var n=e;e instanceof Qh||(n=new Qh(e));var i=k_(n);return i.setExtent(t[0],t[1]),D_(i,n),i},mixinAxisModelCommonMethods:function(t){R(t,z_)},getECData:Bs,createTextStyle:function(t,e){return Oh(t,null,null,"normal"!==(e=e||{}).state)},createDimensions:function(t,e){return Mm(t,e).dimensions},createSymbol:rv,enableHoverEmphasis:Il});function V_(t,e){return Math.abs(t-e)<1e-8}function F_(t,e,n){var i=0,r=t[0];if(!r)return!1;for(var o=1;on&&(t=r,n=a)}if(t)return function(t){for(var e=0,n=0,i=0,r=t.length,o=t[r-1][0],a=t[r-1][1],s=0;s>1^-(1&s),l=l>>1^-(1&l),r=s+=r,o=l+=o,i.push([s/n,l/n])}return i}function K_(t,e){return E(V((t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;return null==n&&(n=1024),z(e.features,(function(t){var e=t.geometry,i=e.encodeOffsets,r=e.coordinates;if(i)switch(e.type){case"LineString":e.coordinates=q_(r,i,n);break;case"Polygon":case"MultiLineString":j_(r,i,n);break;case"MultiPolygon":z(r,(function(t,e){return j_(t,i[e],n)}))}})),e.UTF8Encoding=!1,e}(t)).features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,i=t.geometry,r=[];switch(i.type){case"Polygon":var o=i.coordinates;r.push(new Z_(o[0],o.slice(1)));break;case"MultiPolygon":z(i.coordinates,(function(t){t[0]&&r.push(new Z_(t[0],t.slice(1)))}));break;case"LineString":r.push(new Y_([i.coordinates]));break;case"MultiLineString":r.push(new Y_(i.coordinates))}var a=new X_(n[e||"name"],r,n.cp);return a.properties=n,a}))}var $_=Object.freeze({__proto__:null,linearMap:Er,round:Vr,asc:Fr,getPrecision:Hr,getPrecisionSafe:Wr,getPixelPrecision:Gr,getPercentWithPrecision:function(t,e,n){return t[e]&&Ur(t,n)[e]||0},MAX_SAFE_INTEGER:9007199254740991,remRadian:Yr,isRadianAroundZero:Xr,parseDate:qr,quantity:Kr,quantityExponent:$r,nice:Qr,quantile:function(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r},reformIntervals:function(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=R_(t),p=a.get("showMinLabel")||c,d=a.get("showMaxLabel")||c;p&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return d&&f-l!==o[1]&&g(o[1]),s}function hx(t,e,n){var i=t.scale,r=A_(t),o=[];return z(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:r(t),rawLabel:a,tickValue:s})})),o}var cx=[0,1],px=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Gr(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&dx(n=n.slice(),i.count()),Er(t,cx,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&dx(n=n.slice(),i.count());var r=Er(t,n,cx,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=E(rx(this,e).ticks,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);return function(t,e,n,i){var r=e.length;if(!t.onBand||n||!r)return;var o,a,s=t.getExtent();if(1===r)e[0].coord=s[0],o=e[1]={coord:s[0]};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;z(e,(function(t){t.coord-=u/2})),a=1+t.scale.getExtent()[1]-e[r-1].tickValue,o={coord:e[r-1].coord+u*a},e.push(o)}var h=s[0]>s[1];c(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift());i&&c(s[0],e[0].coord)&&e.unshift({coord:s[0]});c(s[1],o.coord)&&(i?o.coord=s[1]:e.pop());i&&c(o.coord,s[1])&&e.push({coord:s[1]});function c(t,e){return t=Vr(t),e=Vr(e),h?t>e:t0&&t<100||(t=5),E(this.scale.getMinorTicks(t),(function(t){return E(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return ix(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),n=A_(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.scale,o=r.getExtent(),a=r.count();if(o[1]-o[0]<1)return 0;var s=1;a>40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),p=0,d=0;l<=o[1];l+=s){var f,g,v=dr(n({value:l}),e.font,"center","top");f=1.3*v.width,g=1.3*v.height,p=Math.max(p,f,7),d=Math.max(d,g,7)}var y=p/h,m=d/c;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var _=Math.max(0,Math.floor(Math.min(y,m))),x=nx(t.model),w=t.getExtent(),b=x.lastAutoInterval,S=x.lastTickCount;return null!=b&&null!=S&&Math.abs(b-_)<=1&&Math.abs(S-a)<=1&&b>_&&x.axisExtent0===w[0]&&x.axisExtent1===w[1]?_=b:(x.lastTickCount=a,x.lastAutoInterval=_,x.axisExtent0=w[0],x.axisExtent1=w[1]),_}(this)},t}();function dx(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function fx(t,e,n,i,r,o,a,s){var l=r-t,u=o-e,h=n-t,c=i-e,p=Math.sqrt(h*h+c*c),d=(l*(h/=p)+u*(c/=p))/p;s&&(d=Math.min(Math.max(d,0),1)),d*=p;var f=a[0]=t+d*h,g=a[1]=e+d*c;return Math.sqrt((f-r)*(f-r)+(g-o)*(g-o))}var gx=new Se,vx=new Se,yx=new Se,mx=new Se,_x=new Se,xx=[],bx=new Se;function Sx(t,e){if(e<=180&&e>0){e=e/180*Math.PI,gx.fromArray(t[0]),vx.fromArray(t[1]),yx.fromArray(t[2]),Se.sub(mx,gx,vx),Se.sub(_x,yx,vx);var n=mx.len(),i=_x.len();if(!(n<.001||i<.001)){mx.scale(1/n),_x.scale(1/i);var r=mx.dot(_x);if(Math.cos(e)1&&Se.copy(bx,yx),bx.toArray(t[1])}}}}function Mx(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,gx.fromArray(t[0]),vx.fromArray(t[1]),yx.fromArray(t[2]),Se.sub(mx,vx,gx),Se.sub(_x,yx,vx);var i=mx.len(),r=_x.len();if(!(i<.001||r<.001))if(mx.scale(1/i),_x.scale(1/r),mx.dot(e)=a)Se.copy(bx,yx);else{bx.scaleAndAdd(_x,o/Math.tan(Math.PI/2-s));var l=yx.x!==vx.x?(bx.x-vx.x)/(yx.x-vx.x):(bx.y-vx.y)/(yx.y-vx.y);if(isNaN(l))return;l<0?Se.copy(bx,vx):l>1&&Se.copy(bx,yx)}bx.toArray(t[1])}}}function Cx(t,e,n,i){var r="normal"===n,o=r?t:t.ensureState(n);o.ignore=e;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?t.useStyle(s):o.style=s}function Ix(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=Rt(i[0],i[1]),o=Rt(i[1],i[2]);if(!r||!o)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(r,o)*n,s=Et([],i[1],i[0],a/r),l=Et([],i[1],i[2],a/o),u=Et([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var h=1;h0&&o&&x(-h/a,0,a);var f,g,v=t[0],y=t[a-1];return m(),f<0&&w(-f,.8),g<0&&w(g,.8),m(),_(f,g,1),_(g,f,-1),m(),f<0&&b(-f),g<0&&b(g),u}function m(){f=v.rect[e]-i,g=r-y.rect[e]-y.rect[n]}function _(t,e,n){if(t<0){var i=Math.min(e,-t);if(i>0){x(i*n,0,a);var r=i+t;r<0&&w(-r*n,1)}else w(-t*n,1)}}function x(n,i,r){0!==n&&(u=!0);for(var o=i;o0)for(l=0;l0;l--)x(-o[l-1]*c,l,a)}}function b(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i0?x(n,0,i+1):x(-n,a-i-1,a),(t-=n)<=0)return}}(t,"y","height",e,n,i)}var Dx=Math.sin,kx=Math.cos,Ax=Math.PI,Px=2*Math.PI,Lx=180/Ax,Ox=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){this._add("C",t,e,n,i,r,o)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,r,o){this.ellipse(t,e,n,n,0,i,r,o)},t.prototype.ellipse=function(t,e,n,i,r,o,a,s){var l=a-o,u=!s,h=Math.abs(l),c=ni(h-Px)||(u?l>=Px:-l>=Px),p=l>0?l%Px:l%Px+Px,d=!1;d=!!c||!ni(h)&&p>=Ax==!!u;var f=t+n*kx(o),g=e+i*Dx(o);this._start&&this._add("M",f,g);var v=Math.round(r*Lx);if(c){var y=1/this._p,m=(u?1:-1)*(Px-y);this._add("A",n,i,v,1,+u,t+n*kx(o+m),e+i*Dx(o+m)),y>.01&&this._add("A",n,i,v,0,+u,f,g)}else{var _=t+n*kx(a),x=e+i*Dx(a);this._add("A",n,i,v,+d,+u,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,r,o,a,s,l){for(var u=[],h=this._p,c=1;c"}(r,o)+("style"!==r?te(a):a||"")+(i?""+n+E(i,(function(e){return t(e)})).join(n)+n:"")+("")}(t)}function Ux(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Zx(t,e,n,i){return Wx("svg","root",{width:t,height:e,xmlns:Vx,"xmlns:xlink":Fx,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}var Yx={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Xx="transform-origin";function jx(t,e,n){var i=k({},t.shape);k(i,e),t.buildPath(n,i);var r=new Ox;return r.reset(pi(t)),n.rebuildPath(r,1),r.generateStr(),r.getStr()}function qx(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[Xx]=n+"px "+i+"px")}var Kx={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function $x(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function Qx(t){return Z(t)?Yx[t]?"cubic-bezier("+Yx[t]+")":Cn(t)?t:"":""}function Jx(t,e,n,i){var r=t.animators,o=r.length,a=[];if(t instanceof Ou){var s=function(t,e,n){var i,r,o=t.shape.paths,a={};if(z(o,(function(t){var e=Ux(n.zrId);e.animation=!0,Jx(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,l=F(o),u=l.length;if(u){var h=o[r=l[u-1]];for(var c in h){var p=h[c];a[c]=a[c]||{d:""},a[c].d+=p.d||""}for(var d in s){var f=s[d].animation;f.indexOf(r)>=0&&(i=f)}}})),i){e.d=!1;var s=$x(a,n);return i.replace(r,s)}}(t,e,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u0})).length)return $x(h,n)+" "+r[0]+" both"}for(var v in l){(s=g(l[v]))&&a.push(s)}if(a.length){var y=n.zrId+"-cls-"+n.cssClassIdx++;n.cssNodes["."+y]={animation:a.join(",")},e.class=y}}var tw=Math.round;function ew(t){return t&&Z(t.src)}function nw(t){return t&&U(t.toDataURL)}function iw(t,e,n,i){Bx((function(r,o){var a="fill"===r||"stroke"===r;a&&hi(o)?dw(e,t,r,i):a&&si(o)?fw(n,t,r,i):t[r]=o}),e,n,!1),function(t,e,n){var i=t.style;if(function(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}(i)){var r=function(t){var e=t.style,n=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(t),o=n.shadowCache,a=o[r];if(!a){var s=t.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var h=i.shadowOffsetX||0,c=i.shadowOffsetY||0,p=i.shadowBlur,d=ti(i.shadowColor),f=d.opacity,g=d.color,v=p/2/l+" "+p/2/u;a=n.zrId+"-s"+n.shadowIdx++,n.defs[a]=Wx("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[Wx("feDropShadow","",{dx:h/l,dy:c/u,stdDeviation:v,"flood-color":g,"flood-opacity":f})]),o[r]=a}e.filter=ci(a)}}(n,t,i)}function rw(t){return ni(t[0]-1)&&ni(t[1])&&ni(t[2])&&ni(t[3]-1)}function ow(t,e,n){if(e&&(!function(t){return ni(t[4])&&ni(t[5])}(e)||!rw(e))){var i=n?10:1e4;t.transform=rw(e)?"translate("+tw(e[4]*i)/i+" "+tw(e[5]*i)/i+")":function(t){return"matrix("+ii(t[0])+","+ii(t[1])+","+ii(t[2])+","+ii(t[3])+","+ri(t[4])+","+ri(t[5])+")"}(e)}}function aw(t,e,n){for(var i=t.points,r=[],o=0;ol?kw(t,null==n[c+1]?null:n[c+1].elm,n,s,c):Aw(t,e,a,l))}(n,i,r):Cw(r)?(Cw(t.text)&&bw(n,""),kw(n,null,r,0,r.length-1)):Cw(i)?Aw(n,i,0,i.length-1):Cw(t.text)&&bw(n,""):t.text!==e.text&&(Cw(i)&&Aw(n,i,0,i.length-1),bw(n,e.text)))}var Ow=0,Rw=function(){function t(t,e,n){if(this.type="svg",this.refreshHover=Nw("refreshHover"),this.configLayer=Nw("configLayer"),this.storage=e,this._opts=n=k({},n),this.root=t,this._id="zr"+Ow++,this._oldVNode=Zx(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var r=this._svgDom=this._oldVNode.elm=Hx("svg");Pw(null,this._oldVNode),i.appendChild(r),t.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",function(t,e){if(Tw(t,e))Lw(t,e);else{var n=t.elm,i=xw(n);Dw(e),null!==i&&(yw(i,e.elm,ww(n)),Aw(i,[t],0,0))}}(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return pw(t,Ux(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),n=this._width,i=this._height,r=Ux(this._id);r.animation=t.animation,r.willUpdate=t.willUpdate,r.compress=t.compress;var o=[],a=this._bgVNode=function(t,e,n,i){var r;if(n&&"none"!==n)if(r=Wx("rect","bg",{width:t,height:e,x:"0",y:"0",id:"0"}),hi(n))dw({fill:n},r.attrs,"fill",i);else if(si(n))fw({style:{fill:n},dirty:xt,getBoundingRect:function(){return{width:t,height:e}}},r.attrs,"fill",i);else{var o=ti(n),a=o.color,s=o.opacity;r.attrs.fill=a,s<1&&(r.attrs["fill-opacity"]=s)}return r}(n,i,this._backgroundColor,r);a&&o.push(a);var s=t.compress?null:this._mainVNode=Wx("g","main",{},[]);this._paintList(e,r,s?s.children:o),s&&o.push(s);var l=E(F(r.defs),(function(t){return r.defs[t]}));if(l.length&&o.push(Wx("defs","defs",{},l)),t.animation){var u=function(t,e,n){var i=(n=n||{}).newline?"\n":"",r=" {"+i,o=i+"}",a=E(F(t),(function(e){return e+r+E(F(t[e]),(function(n){return n+":"+t[e][n]+";"})).join(i)+o})).join(i),s=E(F(e),(function(t){return"@keyframes "+t+r+E(F(e[t]),(function(n){return n+r+E(F(e[t][n]),(function(i){var r=e[t][n][i];return"d"===i&&(r='path("'+r+'")'),i+":"+r+";"})).join(i)+o})).join(i)+o})).join(i);return a||s?[""].join(i):""}(r.cssNodes,r.cssAnims,{newline:!0});if(u){var h=Wx("style","stl",{},[],u);o.push(h)}}return Zx(n,i,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},Gx(this.renderToVNode({animation:it(t.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:it(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,r,o=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!r||c[f]!==r[f]);f--);for(var g=d-1;g>f;g--)i=a[--s-1];for(var v=f+1;v=a)}}for(var h=this.__startIndex;h15)break}n.prevElClipPaths&&u.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var x=d.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?Fw:0),this._needsManuallyCompositing),u.__builtin__||C("ZLevel "+l+" has been used by unkown layer "+u.id),u!==o&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,e(r),o=u),1&s.__dirty&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}e(r),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,z(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?T(n[t],e,!0):n[t]=e;for(var i=0;i-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Ef);function Gw(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=Hd(t,e,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a=0&&i.push(e[o])}return i.join(" ")}var Zw=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.updateData(e,n,i,r),o}return n(e,t),e.prototype._createSymbol=function(t,e,n,i,r){this.removeAll();var o=rv(t,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=Yw,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){dl(this.childAt(0))},e.prototype.downplay=function(){fl(this.childAt(0))},e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},e.prototype.updateData=function(t,n,i,r){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=o!==this._symbolType,u=r&&r.disableAnimation;if(l){var h=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,s,h)}else{(p=this.childAt(0)).silent=!1;var c={scaleX:s[0]/2,scaleY:s[1]/2};u?p.attr(c):Xu(p,c,a,n),Ju(p)}if(this._updateCommon(t,n,s,i,r),l){var p=this.childAt(0);if(!u){c={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:p.style.opacity}};p.scaleX=p.scaleY=0,p.style.opacity=0,ju(p,c,a,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,i,r){var o,a,s,l,u,h,c,p,d,f=this.childAt(0),g=t.hostModel;if(i&&(o=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,c=i.labelStatesModels,p=i.hoverScale,d=i.cursorStyle,h=i.emphasisDisabled),!i||t.hasItemOption){var v=i&&i.itemModel?i.itemModel:t.getItemModel(e),y=v.getModel("emphasis");o=y.getModel("itemStyle").getItemStyle(),s=v.getModel(["select","itemStyle"]).getItemStyle(),a=v.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),u=y.get("blurScope"),h=y.get("disabled"),c=Lh(v),p=y.getShallow("scale"),d=v.getShallow("cursor")}var m=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(m||0)*Math.PI/180||0);var _=av(t.getItemVisual(e,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),d&&f.attr("cursor",d);var x=t.getItemVisual(e,"style"),w=x.fill;if(f instanceof gs){var b=f.style;f.useStyle(k({image:b.image,x:b.x,y:b.y,width:b.width,height:b.height},x))}else f.__isEmptyBrush?f.useStyle(k({},x)):f.useStyle(x),f.style.decal=null,f.setColor(w,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var S=t.getItemVisual(e,"liftZ"),M=this._z2;null!=S?null==M&&(this._z2=f.z2,f.z2+=S):null!=M&&(f.z2=M,this._z2=null);var C=r&&r.useNameLabel;Ph(f,c,{labelFetcher:g,labelDataIndex:e,defaultText:function(e){return C?t.getName(e):Gw(t,e)},inheritColor:w,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var I=f.ensureState("emphasis");I.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var T=null==p||!0===p?Math.max(1.1,3/this._sizeY):isFinite(p)&&p>0?+p:1;I.scaleX=this._sizeX*T,I.scaleY=this._sizeY*T,this.setSymbolScale(1),Tl(this,l,u,h)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),r=Bs(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&Ku(a,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Ku(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return ov(t.getItemVisual(e,"symbolSize"))},e}(kr);function Yw(t,e){this.parent.drift(t,e)}function Xw(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function jw(t){return null==t||j(t)||(t={isIgnore:t}),t||{}}function qw(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Lh(e),cursorStyle:e.get("cursor")}}var Kw=function(){function t(t){this.group=new kr,this._SymbolCtor=t||Zw}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=jw(e);var n=this.group,i=t.hostModel,r=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=qw(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||n.removeAll(),t.diff(r).add((function(i){var r=u(i);if(Xw(t,r,i,e)){var a=new o(t,i,s,l);a.setPosition(r),t.setItemGraphicEl(i,a),n.add(a)}})).update((function(h,c){var p=r.getItemGraphicEl(c),d=u(h);if(Xw(t,d,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=p&&p.getSymbolType&&p.getSymbolType();if(!p||g&&g!==f)n.remove(p),(p=new o(t,h,s,l)).setPosition(d);else{p.updateData(t,h,s,l);var v={x:d[0],y:d[1]};a?p.attr(v):Xu(p,v,i)}n.add(p),t.setItemGraphicEl(h,p)}else n.remove(p)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),i)})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=qw(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=jw(n);for(var r=t.start;r0?n=i[0]:i[1]<0&&(n=i[1]);return n}(r,n),a=i.dim,s=r.dim,l=e.mapDimension(s),u=e.mapDimension(a),h="x"===s||"radius"===s?1:0,c=E(t.dimensions,(function(t){return e.mapDimension(t)})),p=!1,d=e.getCalculationInfo("stackResultDimension");return Am(e,c[0])&&(p=!0,c[0]=d),Am(e,c[1])&&(p=!0,c[1]=d),{dataDimsForPoint:c,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!p,valueDim:l,baseDim:u,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function Qw(t,e,n,i){var r=NaN;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,i),a[1-o]=r,e.dataToPoint(a)}var Jw=Math.min,tb=Math.max;function eb(t,e){return isNaN(t)||isNaN(e)}function nb(t,e,n,i,r,o,a,s,l){for(var u,h,c,p,d,f,g=n,v=0;v=r||g<0)break;if(eb(y,m)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](y,m),c=y,p=m;else{var _=y-u,x=m-h;if(_*_+x*x<.5){g+=o;continue}if(a>0){for(var w=g+o,b=e[2*w],S=e[2*w+1];b===y&&S===m&&v=i||eb(b,S))d=y,f=m;else{I=b-u,T=S-h;var A=y-u,P=b-y,L=m-h,O=S-m,R=void 0,N=void 0;if("x"===s){var z=I>0?1:-1;d=y-z*(R=Math.abs(A))*a,f=m,D=y+z*(N=Math.abs(P))*a,k=m}else if("y"===s){var E=T>0?1:-1;d=y,f=m-E*(R=Math.abs(L))*a,D=y,k=m+E*(N=Math.abs(O))*a}else R=Math.sqrt(A*A+L*L),d=y-I*a*(1-(C=(N=Math.sqrt(P*P+O*O))/(N+R))),f=m-T*a*(1-C),k=m+T*a*C,D=Jw(D=y+I*a*C,tb(b,y)),k=Jw(k,tb(S,m)),D=tb(D,Jw(b,y)),f=m-(T=(k=tb(k,Jw(S,m)))-m)*R/N,d=Jw(d=y-(I=D-y)*R/N,tb(u,y)),f=Jw(f,tb(h,m)),D=y+(I=y-(d=tb(d,Jw(u,y))))*N/R,k=m+(T=m-(f=tb(f,Jw(h,m))))*N/R}t.bezierCurveTo(c,p,d,f,y,m),c=D,p=k}else t.lineTo(y,m)}u=y,h=m,g+=o}return v}var ib=function(){this.smooth=0,this.smoothConstraint=!0},rb=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return n(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ib},e.prototype.buildPath=function(t,e){var n=e.points,i=0,r=n.length/2;if(e.connectNulls){for(;r>0&&eb(n[2*r-2],n[2*r-1]);r--);for(;i=0){var v=a?(h-i)*g+i:(u-n)*g+n;return a?[t,v]:[v,t]}n=u,i=h;break;case o.C:u=r[l++],h=r[l++],c=r[l++],p=r[l++],d=r[l++],f=r[l++];var y=a?gn(n,u,c,d,t,s):gn(i,h,p,f,t,s);if(y>0)for(var m=0;m=0){v=a?dn(i,h,p,f,_):dn(n,u,c,d,_);return a?[t,v]:[v,t]}}n=d,i=f}}},e}(hs),ob=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(ib),ab=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return n(e,t),e.prototype.getDefaultShape=function(){return new ob},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0&&eb(n[2*o-2],n[2*o-1]);o--);for(;r=0;a--){var s=t.getDimensionInfo(i[a].dimension);if("x"===(r=s&&s.coordDim)||"y"===r){o=i[a];break}}if(o){var l=e.getAxis(r),u=E(o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),h=u.length,c=o.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var p=function(t,e){var n,i,r=[],o=t.length;function a(t,e,n){var i=t.coord;return{coord:n,color:Xn((n-i)/(e.coord-i),[t.color,e.color])}}for(var s=0;se){i?r.push(a(i,l,e)):n&&r.push(a(n,l,0),a(n,l,e));break}n&&(r.push(a(n,l,0)),n=null),r.push(l),i=l}}return r}(u,"x"===r?n.getWidth():n.getHeight()),d=p.length;if(!d&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var f=p[0].coord-10,g=p[d-1].coord+10,v=g-f;if(v<.001)return"transparent";z(p,(function(t){t.offset=(t.coord-f)/v})),p.push({offset:d?p[d-1].offset:.5,color:c[1]||"transparent"}),p.unshift({offset:d?p[0].offset:.5,color:c[0]||"transparent"});var y=new Nu(0,0,0,0,p,!0);return y[r]=f,y[r+"2"]=g,y}}}function vb(t,e,n){var i=t.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&(!r||!function(t,e){var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),a=0;ai)return!1;return!0}(o,e))){var a=e.mapDimension(o.dim),s={};return z(o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);s[e]=1})),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function yb(t,e){return[t[2*e],t[2*e+1]]}function mb(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=+d.style.lineWidth+1);Bs(d).seriesIndex=t.seriesIndex,Tl(d,P,L,O);var R=db(t.get("smooth")),N=t.get("smoothMonotone");if(d.setShape({smooth:R,smoothMonotone:N,connectNulls:b}),f){var z=a.getCalculationInfo("stackedOnSeries"),E=0;f.useStyle(A(l.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),z&&(E=db(z.get("smooth"))),f.setShape({smooth:R,stackedOnSmooth:E,smoothMonotone:N,connectNulls:b}),Al(f,t,"areaStyle"),Bs(f).seriesIndex=t.seriesIndex,Tl(f,P,L,O)}var B=function(t){i._changePolyState(t)};a.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=B)})),this._polyline.onHoverStateChange=B,this._data=a,this._coordSys=r,this._stackedOnPoints=x,this._points=u,this._step=I,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,d),f&&this.packEventData(t,f))},e.prototype.packEventData=function(t,e){Bs(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,i){var r=t.getData(),o=wo(r,i);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=r.getLayout("points"),s=r.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var h=t.get("zlevel")||0,c=t.get("z")||0;(s=new Zw(r,o)).x=l,s.y=u,s.setZ(h,c);var p=s.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=c,p.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else qf.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var r=t.getData(),o=wo(r,i);if(this._changePolyState("normal"),null!=o&&o>=0){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else qf.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;ll(this._polyline,t),e&&ll(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new rb({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new ab({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,r,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(i=o.isHorizontal(),r=!1):"polar"===e.type&&(i="angle"===o.dim,r=!0);var s=t.hostModel,l=s.get("animationDuration");U(l)&&(l=l(null));var u=s.get("animationDelay")||0,h=U(u)?u(null):u;t.eachItemGraphicEl((function(t,o){var s=t;if(s){var c=[t.x,t.y],p=void 0,d=void 0,f=void 0;if(n)if(r){var g=n,v=e.pointToCoord(c);i?(p=g.startAngle,d=g.endAngle,f=-v[1]/180*Math.PI):(p=g.r0,d=g.r,f=v[0])}else{var y=n;i?(p=y.x,d=y.x+y.width,f=t.x):(p=y.y+y.height,d=y.y,f=t.y)}var m=d===p?0:(f-p)/(d-p);a&&(m=1-m);var _=U(u)?u(o):l*m+h,x=s.getSymbolPath(),w=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),w&&w.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(mb(t)){var r=t.getData(),o=this._polyline,a=r.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new Cs({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(t){for(var e,n,i=t.length/2;i>0&&(e=t[2*i-2],n=t[2*i-1],isNaN(e)||isNaN(n));i--);return i-1}(a);l>=0&&(Ph(o,Lh(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?Uw(r,n):Gw(r,t)},enableTextSetter:!0},function(t,e){var n=e.getBaseAxis(),i=n.isHorizontal(),r=n.inverse,o=i?r?"right":"left":"center",a=i?"middle":r?"top":"bottom";return{normal:{align:t.get("align")||o,verticalAlign:t.get("verticalAlign")||a}}}(i,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,r,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),h=n.hostModel,c=h.get("connectNulls"),p=o.get("precision"),d=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),v=f.inverse,y=e.shape,m=v?g?y.x:y.y+y.height:g?y.x+y.width:y.y,_=(g?d:0)*(v?-1:1),x=(g?0:-d)*(v?-1:1),w=g?"x":"y",b=function(t,e,n){for(var i,r,o=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u=e||i>=e&&r<=e){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(e-i)/(r-i)}}(u,m,w),S=b.range,M=S[1]-S[0],C=void 0;if(M>=1){if(M>1&&!c){var I=yb(u,S[0]);s.attr({x:I[0]+_,y:I[1]+x}),r&&(C=h.getRawValue(S[0]))}else{(I=l.getPointOn(m,w))&&s.attr({x:I[0]+_,y:I[1]+x});var T=h.getRawValue(S[0]),D=h.getRawValue(S[1]);r&&(C=function(t,e,n,i,r){var o=null==e||"auto"===e;if(null==i)return i;if(X(i))return Vr(f=ao(n||0,i,r),o?Math.max(Hr(n||0),Hr(i)):e);if(Z(i))return r<1?n:i;for(var a=[],s=n,l=i,u=Math.max(s?s.length:0,l.length),h=0;h0?S[0]:0;I=yb(u,k);r&&(C=h.getRawValue(k)),s.attr({x:I[0]+_,y:I[1]+x})}r&&Vh(s).setLabelText(C)}},e.prototype._doUpdateAnimation=function(t,e,n,i,r,o,a){var s=this._polyline,l=this._polygon,u=t.hostModel,h=function(t,e,n,i,r,o,a,s){for(var l=function(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}(t,e),u=[],h=[],c=[],p=[],d=[],f=[],g=[],v=$w(r,e,a),y=t.getLayout("points")||[],m=e.getLayout("points")||[],_=0;_3e3||l&&pb(p,f)>3e3)return s.stopAnimation(),s.setShape({points:d}),void(l&&(l.stopAnimation(),l.setShape({points:d,stackedOnPoints:f})));s.shape.__points=h.current,s.shape.points=c;var g={shape:{points:d}};h.current!==c&&(g.shape.__points=h.next),s.stopAnimation(),Xu(s,g,u),l&&(l.setShape({points:c,stackedOnPoints:p}),l.stopAnimation(),Xu(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var v=[],y=h.status,m=0;me&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n10&&"cartesian2d"===o.type&&r){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),h=n.getDevicePixelRatio(),c=Math.abs(u[1]-u[0])*(h||1),p=Math.round(a/c);if(isFinite(p)&&p>1){"lttb"===r&&t.setData(i.lttbDownSample(i.mapDimension(l.dim),1/p));var d=void 0;Z(r)?d=bb[r]:U(r)&&(d=r),d&&t.setData(i.downSample(i.mapDimension(l.dim),1/p,d,Sb))}}}}}var Cb=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.getInitialData=function(t,e){return Lm(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,e,n){var i=this.coordinateSystem;if(i&&i.clampData){var r=i.clampData(t),o=i.dataToPoint(r);if(n)z(i.getAxes(),(function(t,n){if("category"===t.type&&null!=e){var i=t.getTicksCoords(),a=r[n],s="x1"===e[n]||"y1"===e[n];if(s&&(a+=1),i.length<2)return;if(2===i.length)return void(o[n]=t.toGlobalCoord(t.getExtent()[s?1:0]));for(var l=void 0,u=void 0,h=1,c=0;ca){u=(p+l)/2;break}1===c&&(h=d-i[0].tickValue)}null==u&&(l?l&&(u=i[i.length-1].coord):u=i[0].coord),o[n]=t.toGlobalCoord(u)}}));else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=i.getBaseAxis().isHorizontal()?0:1;o[u]+=s+l/2}return o}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Ef);Ef.registerClass(Cb);var Ib=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.getInitialData=function(){return Lm(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=ec(Cb.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(Cb),Tb=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Db=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return n(e,t),e.prototype.getDefaultShape=function(){return new Tb},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-r),s=r+a,l=e.startAngle,u=e.endAngle,h=e.clockwise,c=2*Math.PI,p=h?u-lo)return!0;o=u}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),r=Math.max(0,i[0]),o=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=o;++r)if(t.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var r=this._dataSort(t,n,e);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,r=this._dataSort(t,i,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){Qu(e,t,Bs(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(qf),Nb={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,o=t.y+t.height,a=Lb(e.x,t.x),s=Ob(e.x+e.width,r),l=Lb(e.y,t.y),u=Ob(e.y+e.height,o),h=sr?s:a,e.y=c&&l>o?u:l,e.width=h?0:s-a,e.height=c?0:u-l,n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var r=Ob(e.r,t.r),o=Lb(e.r0,t.r0);e.r=r,e.r0=o;var a=r-o<0;if(n<0){i=e.r;e.r=e.r0,e.r0=i}return a}},zb={cartesian2d:function(t,e,n,i,r,o,a,s,l){var u=new bs({shape:k({},i),z2:1});(u.__dataIndex=n,u.name="item",o)&&(u.shape[r?"height":"width"]=0);return u},polar:function(t,e,n,i,r,o,a,s,l){var u=!r&&l?Db:vu,h=new u({shape:i,z2:1});h.name="item";var c,p,d=Gb(r);if(h.calculateTextPosition=(c=d,p=({isRoundCap:u===Db}||{}).isRoundCap,function(t,e,n){var i=e.position;if(!i||i instanceof Array)return mr(t,e,n);var r=c(i),o=null!=e.distance?e.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,h=a.r0,d=(u+h)/2,f=a.startAngle,g=a.endAngle,v=(f+g)/2,y=p?Math.abs(u-h)/2:0,m=Math.cos,_=Math.sin,x=s+u*m(f),w=l+u*_(f),b="left",S="top";switch(r){case"startArc":x=s+(h-o)*m(v),w=l+(h-o)*_(v),b="center",S="top";break;case"insideStartArc":x=s+(h+o)*m(v),w=l+(h+o)*_(v),b="center",S="bottom";break;case"startAngle":x=s+d*m(f)+kb(f,o+y,!1),w=l+d*_(f)+Ab(f,o+y,!1),b="right",S="middle";break;case"insideStartAngle":x=s+d*m(f)+kb(f,-o+y,!1),w=l+d*_(f)+Ab(f,-o+y,!1),b="left",S="middle";break;case"middle":x=s+d*m(v),w=l+d*_(v),b="center",S="middle";break;case"endArc":x=s+(u+o)*m(v),w=l+(u+o)*_(v),b="center",S="bottom";break;case"insideEndArc":x=s+(u-o)*m(v),w=l+(u-o)*_(v),b="center",S="top";break;case"endAngle":x=s+d*m(g)+kb(g,o+y,!0),w=l+d*_(g)+Ab(g,o+y,!0),b="left",S="middle";break;case"insideEndAngle":x=s+d*m(g)+kb(g,-o+y,!0),w=l+d*_(g)+Ab(g,-o+y,!0),b="right",S="middle";break;default:return mr(t,e,n)}return(t=t||{}).x=x,t.y=w,t.align=b,t.verticalAlign=S,t}),o){var f=r?"r":"endAngle",g={};h.shape[f]=r?i.r0:i.startAngle,g[f]=i[f],(s?Xu:ju)(h,{shape:g},o)}return h}};function Eb(t,e,n,i,r,o,a,s){var l,u;o?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?Xu:ju)(n,{shape:l},e,r,null),(a?Xu:ju)(n,{shape:u},e?t.baseAxis.model:null,r)}function Bb(t,e){for(var n=0;n0?1:-1,a=i.height>0?1:-1;return{x:i.x+o*r/2,y:i.y+a*r/2,width:i.width-o*r,height:i.height-a*r}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function Gb(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function Ub(t,e,n,i,r,o,a,s){var l=e.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=t.shape;k(u,Pb(i.getModel("itemStyle"),u,!0)),t.setShape(u)}}else{var h=i.get(["itemStyle","borderRadius"])||0;t.setShape("r",h)}t.useStyle(l);var c=i.getShallow("cursor");c&&t.attr("cursor",c);var p=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",d=Lh(i);Ph(t,d,{labelFetcher:o,labelDataIndex:n,defaultText:Gw(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var f=t.getTextContent();if(s&&f){var g=i.get(["label","position"]);t.textConfig.inside="middle"===g||null,function(t,e,n,i){if(X(i))t.setTextConfig({rotation:i});else if(G(e))t.setTextConfig({rotation:0});else{var r,o=t.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,u=n(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=l;break;case"startAngle":case"insideStartAngle":r=a;break;case"endAngle":case"insideEndAngle":r=s;break;default:return void t.setTextConfig({rotation:0})}var h=1.5*Math.PI-r;"middle"===u&&h>Math.PI/2&&h<1.5*Math.PI&&(h-=Math.PI),t.setTextConfig({rotation:h})}}(t,"outside"===g?p:g,Gb(a),i.get(["label","rotate"]))}!function(t,e,n,i){if(t){var r=Vh(t);r.prevValue=r.value,r.value=n;var o=e.normal;r.valueAnimation=o.get("valueAnimation"),r.valueAnimation&&(r.precision=o.get("precision"),r.defaultInterpolatedText=i,r.statesModels=e)}}(f,d,o.getRawValue(n),(function(t){return Uw(e,t)}));var v=i.getModel(["emphasis"]);Tl(t,v.get("focus"),v.get("blurScope"),v.get("disabled")),Al(t,i),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",z(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var Zb=function(){},Yb=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return n(e,t),e.prototype.getDefaultShape=function(){return new Zb},e.prototype.buildPath=function(t,e){for(var n=e.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[h]}return-1}(this,t.offsetX,t.offsetY);Bs(this).dataIndex=e>=0?e:null}),30,!1);function qb(t,e,n){if(ub(n,"cartesian2d")){var i=e,r=n.getArea();return{x:t?i.x:r.x,y:t?r.y:i.y,width:t?i.width:r.width,height:t?r.height:i.height}}var o=e;return{cx:(r=n.getArea()).cx,cy:r.cy,r0:t?r.r0:o.r0,r:t?r.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}var Kb=2*Math.PI,$b=Math.PI/180;function Qb(t,e){return tp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Jb(t,e){var n=Qb(t,e),i=t.get("center"),r=t.get("radius");G(r)||(r=[0,r]);var o,a,s=Br(n.width,e.getWidth()),l=Br(n.height,e.getHeight()),u=Math.min(s,l),h=Br(r[0],u/2),c=Br(r[1],u/2),p=t.coordinateSystem;if(p){var d=p.dataToPoint(i);o=d[0]||0,a=d[1]||0}else G(i)||(i=[i,i]),o=Br(i[0],s)+n.x,a=Br(i[1],l)+n.y;return{cx:o,cy:a,r0:h,r:c}}function tS(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),i=e.mapDimension("value"),r=Qb(t,n),o=Jb(t,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,h=-t.get("startAngle")*$b,c=t.get("minAngle")*$b,p=0;e.each(i,(function(t){!isNaN(t)&&p++}));var d=e.getSum(i),f=Math.PI/(d||p)*2,g=t.get("clockwise"),v=t.get("roseType"),y=t.get("stillShowZeroSum"),m=e.getDataExtent(i);m[0]=0;var _=Kb,x=0,w=h,b=g?1:-1;if(e.setLayout({viewRect:r,r:l}),e.each(i,(function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:g,cx:a,cy:s,r0:u,r:v?NaN:l});else{(i="area"!==v?0===d&&y?f:t*f:Kb/p)n?a:o,h=Math.abs(l.label.y-n);if(h>=u.maxY){var c=l.label.x-e-l.len2*r,p=i+l.len,f=Math.abs(c)t.unconstrainedWidth?null:d:null;i.setStyle("width",f)}var g=i.getBoundingRect();o.width=g.width;var v=(i.style.margin||0)+2.1;o.height=g.height+v,o.y-=(o.height-c)/2}}}function rS(t){return"center"===t.position}function oS(t){var e,n,i=t.getData(),r=[],o=!1,a=(t.get("minShowLabelAngle")||0)*eS,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,h=s.x,c=s.y,p=s.height;function d(t){t.ignore=!0}i.each((function(t){var s=i.getItemGraphicEl(t),c=s.shape,p=s.getTextContent(),f=s.getTextGuideLine(),g=i.getItemModel(t),v=g.getModel("label"),y=v.get("position")||g.get(["emphasis","label","position"]),m=v.get("distanceToLabelLine"),_=v.get("alignTo"),x=Br(v.get("edgeDistance"),u),w=v.get("bleedMargin"),b=g.getModel("labelLine"),S=b.get("length");S=Br(S,u);var M=b.get("length2");if(M=Br(M,u),Math.abs(c.endAngle-c.startAngle)0?"right":"left":A>0?"left":"right"}var V=Math.PI,F=0,H=v.get("rotate");if(X(H))F=H*(V/180);else if("center"===y)F=0;else if("radial"===H||!0===H){F=A<0?-k+V:-k}else if("tangential"===H&&"outside"!==y&&"outer"!==y){var W=Math.atan2(A,P);W<0&&(W=2*V+W),P>0&&(W=V+W),F=W-V}if(o=!!F,p.x=C,p.y=I,p.rotation=F,p.setStyle({verticalAlign:"middle"}),L){p.setStyle({align:D});var G=p.states.select;G&&(G.x+=p.x,G.y+=p.y)}else{var U=p.getBoundingRect().clone();U.applyTransform(p.getComputedTransform());var Z=(p.style.margin||0)+2.1;U.y-=Z/2,U.height+=Z,r.push({label:p,labelLine:f,position:y,len:S,len2:M,minTurnAngle:b.get("minTurnAngle"),maxSurfaceAngle:b.get("maxSurfaceAngle"),surfaceNormal:new Se(A,P),linePoints:T,textAlign:D,labelDistance:m,labelAlignTo:_,edgeDistance:x,bleedMargin:w,rect:U,unconstrainedWidth:U.width,labelStyleWidth:p.style.width})}s.setTextConfig({inside:L})}})),!o&&t.get("avoidLabelOverlap")&&function(t,e,n,i,r,o,a,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;p0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=n.r0}},e.type="pie",e}(qf);var lS=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),uS=bo(),hS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new lS(H(this.getData,this),H(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return function(t,e,n){e=G(e)&&{coordDimensions:e}||k({encodeDefine:t.getEncode()},e);var i=t.getSource(),r=Mm(i,e).dimensions,o=new Sm(r,t);return o.initData(i,n),o}(this,{coordDimensions:["value"],encodeDefaulter:W(Cp,this)})},e.prototype.getDataParams=function(e){var n=this.getData(),i=uS(n),r=i.seats;if(!r){var o=[];n.each(n.mapDimension("value"),(function(t){o.push(t)})),r=i.seats=Ur(o,n.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);return a.percent=r[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){ho(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Ef);var cS=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return n(e,t),e.prototype.getInitialData=function(t,e){return Lm(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Ef),pS=function(){},dS=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return n(e,t),e.prototype.getDefaultShape=function(){return new pS},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,r=e.size,o=this.symbolProxy,a=o.shape,s=t.getContext?t.getContext():t,l=s&&r[0]<4,u=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-o/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+o&&e<=h+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),gS=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=wb("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new fS:new Kw,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(qf),vS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(sp),yS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Io).models[0]},e.type="cartesian2dAxis",e}(sp);R(yS,z_);var mS={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},_S=T({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},mS),xS=T({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},mS),wS={category:_S,value:xS,time:T({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},xS),log:A({logBase:10},xS)},bS={value:1,category:1,time:1,log:1};function SS(t,e,i,r){z(bS,(function(o,a){var s=T(T({},wS[a],!0),r,!0),l=function(t){function i(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+a,n}return n(i,t),i.prototype.mergeDefaultAndTheme=function(t,e){var n=np(this),i=n?rp(t):{};T(t,e.getTheme().get(a+"Axis")),T(t,this.getDefaultOption()),t.type=MS(t),n&&ip(t,i,n)},i.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=Nm.createByAxisModel(this))},i.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},i.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},i.type=e+"Axis."+a,i.defaultOption=s,i}(i);t.registerComponentModel(l)})),t.registerSubTypeDefaulter(e+"Axis",MS)}function MS(t){return t.type||(t.data?"category":"value")}var CS=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return E(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),V(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),IS=["x","y"];function TS(t){return"interval"===t.type||"time"===t.type}var DS=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=IS,e}return n(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(TS(t)&&TS(e)){var n=t.getExtent(),i=e.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,u=(o[1]-r[1])/s,h=r[0]-n[0]*l,c=r[1]-i[0]*u,p=this._transform=[l,0,0,u,h,c];this._invTransform=we([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),r=this.getArea(),o=new Le(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],r=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return Bt(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(r,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return Bt(n,t,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=r.coordToData(r.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),n=Math.min(t[0],t[1]),i=Math.min(e[0],e[1]),r=Math.max(t[0],t[1])-n,o=Math.max(e[0],e[1])-i;return new Le(n,i,r,o)},e}(CS),kS=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=r||"value",a.position=o||"bottom",a}return n(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(px);function AS(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],p={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,f="x"===u?[c[2]-d,c[3]+d]:[c[0]-d,c[1]+d];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[p.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[p[l]]:c[0],"x"===u?f[p[l]]:c[3]],o.rotation=Math.PI/2*("x"===u?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=a?f[p[s]]-f[p.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),nt(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var v=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-v:v,o.z2=1,o}function PS(t){return"cartesian2d"===t.get("coordinateSystem")}function LS(t){var e={xAxisModel:null,yAxisModel:null};return z(e,(function(n,i){var r=i.replace(/Model$/,""),o=t.getReferringComponents(r,Io).models[0];e[i]=o})),e}var OS=Math.log;function RS(t,e,n){var i=Xm.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=T_(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;if("log"===t.type){var p=OS(t.base);u=[OS(u[0])/p,OS(u[1])/p]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var d=i.getExtent.call(t);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var f=i.getInterval.call(t),g=u[0],v=u[1];if(h&&c)f=(v-g)/a;else if(h)for(v=u[0]+f*a;vu[0]&&isFinite(g)&&isFinite(u[0]);)f=Vm(f),g=u[1]-f*a;else{t.getTicks().length-1>a&&(f=Vm(f));var y=f*a;(g=Vr((v=Math.ceil(u[1]/f)*f)-y))<0&&u[0]>=0?(g=0,v=Vr(y)):v>0&&u[1]<=0&&(v=0,g=-Vr(y))}var m=(r[0].value-o[0].value)/s,_=(r[a].value-o[a].value)/s;i.setExtent.call(t,g+f*m,v+f*_),i.setInterval.call(t,f),(m||_)&&i.setNiceExtent.call(t,g+f,v-f)}var NS=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=IS,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=F(t),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=t[+n[o]],s=a.model,l=a.scale;Em(l)&&s.get("alignTicks")&&null==s.get("interval")?r.push(a):(D_(l,s),Em(l)&&(e=a))}r.length&&(e||D_((e=r.pop()).scale,e.model),z(r,(function(t){RS(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),i(n.x),i(n.y);var r={};z(n.x,(function(t){ES(n,"y",t,r)})),z(n.y,(function(t){ES(n,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),o=tp(i,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){z(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e?o.x:o.y)}))}s(),r&&(z(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,r,o=n.getExtent();r=n instanceof Zm?n.count():(i=n.getTicks()).length;var a,s=t.getLabelModel(),l=A_(t),u=1;r>40&&(u=Math.ceil(r/40));for(var h=0;h0&&i>0||n<0&&i<0)}(t)}var VS=Math.PI,FS=function(){function t(t,e){this.group=new kr,this.opt=e,this.axisModel=t,A(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new kr({x:e.position[0],y:e.position[1],rotation:e.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!HS[t]},t.prototype.add=function(t){HS[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var i,r,o=Yr(e-t);return Xr(o)?(r=n>0?"top":"bottom",i="center"):Xr(o-VS)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),HS={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(Bt(s,s,a),Bt(l,l,a));var h=k({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new Iu({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});dh(c.shape,c.style.lineWidth),c.anid="line",n.add(c);var p=e.get(["axisLine","symbol"]);if(null!=p){var d=e.get(["axisLine","symbolSize"]);Z(p)&&(p=[p,p]),(Z(d)||X(d))&&(d=[d,d]);var f=av(e.get(["axisLine","symbolOffset"])||0,d),g=d[0],v=d[1];z([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,i){if("none"!==p[i]&&null!=p[i]){var r=rv(p[i],-g/2,-v/2,g,v,h.stroke,!0),o=e.r+e.offset,a=u?l:s;r.attr({rotation:e.rotate,x:a[0]+o*Math.cos(t.rotation),y:a[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(t,e,n,i){var r=function(t,e,n,i){var r=n.axis,o=n.getModel("axisTick"),a=o.get("show");"auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick"));if(!a||r.scale.isBlank())return;for(var s=o.getModel("lineStyle"),l=i.tickDirection*o.get("length"),u=ZS(r.getTicksCoords(),e.transform,l,A(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;hc[1]?-1:1,d=["start"===s?c[0]-p*h:"end"===s?c[1]+p*h:(c[0]+c[1])/2,US(s)?t.labelOffset+l*h:0],f=e.get("nameRotate");null!=f&&(f=f*VS/180),US(s)?o=FS.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=function(t,e,n,i){var r,o,a=Yr(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;Xr(a-VS/2)?(o=l?"bottom":"top",r="center"):Xr(a-1.5*VS)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*VS&&a>VS/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:r,textVerticalAlign:o}}(t.rotation,s,f||0,c),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),v=e.get("nameTruncate",!0)||{},y=v.ellipsis,m=nt(t.nameTruncateMaxWidth,v.maxWidth,a),_=new Cs({x:d[0],y:d[1],rotation:o.rotation,silent:FS.isLabelSilent(e),style:Oh(u,{text:r,font:g,overflow:"truncate",width:m,ellipsis:y,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(Ch({el:_,componentModel:e,itemName:r}),_.__fullText=r,_.anid="name",e.get("triggerEvent")){var x=FS.makeAxisEventDataBase(e);x.targetType="axisName",x.name=r,Bs(_).eventData=x}i.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function WS(t){t&&(t.ignore=!0)}function GS(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=ge([]);return _e(r,r,-t.rotation),n.applyTransform(ye([],r,t.getLocalTransform())),i.applyTransform(ye([],r,e.getLocalTransform())),n.intersect(i)}}function US(t){return"middle"===t||"center"===t}function ZS(t,e,n,i,r){for(var o=[],a=[],s=[],l=0;l=0||t===e}function jS(t){var e=qS(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=KS(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(o){var s=qS(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,r){},t.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;if(r){var o=hM(t).pointerEl=new Dh[r.type](cM(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var r=hM(t).labelEl=new Cs(cM(e.label));t.add(r),vM(r,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=hM(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var r=hM(t).labelEl;r&&(r.setStyle(e.label.style),n(r,{x:e.label.x,y:e.label.y}),vM(r,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=bh(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){ue(t.event)},onmousedown:pM(this._onHandleDragMove,this,0,0),drift:pM(this._onHandleDragMove,this),ondragend:pM(this._onHandleDragEnd,this)}),i.add(r)),mM(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");G(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,og(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){fM(this._axisPointerModel,!e&&this._moveAnimation,this._handle,yM(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(yM(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(yM(i)),hM(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),ag(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}();function fM(t,e,n,i){gM(hM(n).lastProp,i)||(hM(n).lastProp=i,e?Xu(n,i,t):(n.stopAnimation(),n.attr(i)))}function gM(t,e){if(j(t)&&j(e)){var n=!0;return z(e,(function(e,i){n=n&&gM(t[i],e)})),!!n}return t===e}function vM(t,e){t[e.get(["label","show"])?"show":"hide"]()}function yM(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function mM(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)}))}function _M(t,e,n,i,r){var o=xM(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=Hc(a.get("padding")||0),l=a.getFont(),u=dr(o,l),h=r.position,c=u.width+s[1]+s[3],p=u.height+s[0]+s[2],d=r.align;"right"===d&&(h[0]-=c),"center"===d&&(h[0]-=c/2);var f=r.verticalAlign;"bottom"===f&&(h[1]-=p),"middle"===f&&(h[1]-=p/2),function(t,e,n,i){var r=i.getWidth(),o=i.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,p,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:Oh(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function xM(t,e,n,i,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),a=r.formatter;if(a){var s={value:P_(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};z(i,(function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,r=e&&e.getDataParams(i);r&&s.seriesData.push(r)})),Z(a)?o=a.replace("{value}",o):U(a)&&(o=a(s))}return o}function wM(t,e,n){var i=[1,0,0,1,0,0];return _e(i,i,n.rotation),me(i,i,n.position),vh([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}var bM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.grid,s=i.get("type"),l=SM(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var h=function(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}(i),c=MM[s](o,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}!function(t,e,n,i,r,o){var a=FS.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),_M(e,i,r,o,{position:wM(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}(e,t,AS(a.model,n),n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=AS(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=wM(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=SM(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(dM);function SM(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var MM={line:function(t,e,n){var i,r,o;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],r=[e,n[1]],o=CM(t),{x1:i[o=o||0],y1:i[1-o],x2:r[o],y2:r[1-o]})}},shadow:function(t,e,n){var i,r,o,a=Math.max(1,t.getBandWidth()),s=n[1]-n[0];return{type:"Rect",shape:(i=[e-a/2,n[0]],r=[a,s],o=CM(t),{x:i[o=o||0],y:i[1-o],width:r[o],height:r[1-o]})}}};function CM(t){return"x"===t.dim?0:1}var IM=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(sp),TM=bo(),DM=z;function kM(t,e,n){if(!r.node){var i=e.getZr();TM(i).records||(TM(i).records={}),function(t,e){if(TM(t).initialized)return;function n(n,i){t.on(n,(function(n){var r=function(t){var e={showTip:[],hideTip:[]},n=function(i){var r=e[i.type];r?r.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);DM(TM(t).records,(function(t){t&&i(t,n,r.dispatchAction)})),function(t,e){var n,i=t.showTip.length,r=t.hideTip.length;i?n=t.showTip[i-1]:r&&(n=t.hideTip[r-1]);n&&(n.dispatchAction=null,e.dispatchAction(n))}(r.pendings,e)}))}TM(t).initialized=!0,n("click",W(PM,"click")),n("mousemove",W(PM,"mousemove")),n("globalout",AM)}(i,e),(TM(i).records[t]||(TM(i).records[t]={})).handler=n}}function AM(t,e,n){t.handler("leave",null,n)}function PM(t,e,n,i){e.handler(t,n,i)}function LM(t,e){if(!r.node){var n=e.getZr();(TM(n).records||{})[t]&&(TM(n).records[t]=null)}}var OM=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),r=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";kM("axisPointer",n,(function(t,e,n){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){LM("axisPointer",e)},e.prototype.dispose=function(t,e){LM("axisPointer",e)},e.type="axisPointer",e}(Zf);function RM(t,e){var n,i=[],r=t.seriesIndex;if(null==r||!(n=e.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=wo(o,t);if(null==a||a<0||G(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c=u.dim,p="x"===h||"radius"===h?1:0,d=o.mapDimension(c),f=[];f[p]=o.get(d,a),f[1-p]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(o.getValues(E(l.dimensions,(function(t){return o.mapDimension(t)})),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var NM=bo();function zM(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||H(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){HM(r)&&(r=RM({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=HM(r),u=o.axesInfo,h=s.axesInfo,c="leave"===i||HM(r),p={},d={},f={list:[],map:{}},g={showPointer:W(BM,d),showTooltip:W(VM,f)};z(s.coordSysMap,(function(t,e){var n=l||t.containPoint(r);z(s.coordSysAxesInfo[e],(function(t,e){var i=t.axis,o=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!c&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=i.pointToData(r)),null!=a&&EM(t,a,g,!1,p)}}))}));var v={};return z(h,(function(t,e){var n=t.linkGroup;n&&!d[e]&&z(n.axesInfo,(function(e,i){var r=d[i];if(e!==t&&r){var o=r.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,FM(e),FM(t)))),v[t.key]=o}}))})),z(v,(function(t,e){EM(h[e],t,g,!0,p)})),function(t,e,n){var i=n.axesInfo=[];z(e,(function(e,n){var r=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})}))}(d,h,p),function(t,e,n,i){if(HM(e)||!t.list.length)return void i({type:"hideTip"});var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}(f,r,t,a),function(t,e,n){var i=n.getZr(),r="axisPointerLastHighlights",o=NM(i)[r]||{},a=NM(i)[r]={};z(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&z(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t}))}));var s=[],l=[];z(o,(function(t,e){!a[e]&&l.push(t)})),z(a,(function(t,e){!o[e]&&s.push(t)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),p}}function EM(t,e,n,i,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=function(t,e){var n=e.axis,i=n.dim,r=t,o=[],a=Number.MAX_VALUE,s=-1;return z(e.seriesModels,(function(e,l){var u,h,c=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(c,t,n);h=p.dataIndices,u=p.nestestValue}else{if(!(h=e.getData().indicesOfNearest(c[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var d=t-u,f=Math.abs(d);f<=a&&((f=0&&s<0)&&(a=f,s=d,r=u,o.length=0),z(h,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:r}}(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==r.seriesIndex&&k(r,s[0]),!i&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function BM(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function VM(t,e,n,i){var r=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,u=$S(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function FM(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function HM(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function WM(t){JS.registerAxisPointerClass("CartesianAxisPointer",bM),t.registerComponentModel(IM),t.registerComponentView(OM),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!G(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=YS(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},zM)}function GM(t,e){var n;return z(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}var UM=["transition","enterFrom","leaveTo"],ZM=UM.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function YM(t,e,n){if(n&&(!t[n]&&e[n]&&(t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?UM:ZM,r=0;r0&&(a.during=s?H(oC,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),k(a,n[o]),a}function tC(t,e,n,i){var r=(i=i||{}).dataIndex,o=i.isInit,a=i.clearStyle,s=n.isAnimationEnabled(),l=QM(t),u=e.style;l.userDuring=e.during;var h={},c={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),p=c?c.style:null;if(p){!r&&(r=i.style={});var d=F(n);for(u=0;u0&&t.animateFrom(p,d)}else!function(t,e,n,i,r){if(r){var o=JM("update",t,e,i,n);o.duration>0&&t.animateFrom(r,o)}}(t,e,r||0,n,h);eC(t,e),u?t.dirty():t.markRedraw()}function eC(t,e){for(var n=QM(t).leaveToProps,i=0;i<$M.length;i++){var r=$M[i],o=r?e[r]:e;o&&o.leaveTo&&(n||(n=QM(t).leaveToProps={}),r&&(n[r]=n[r]||{}),k(r?n[r]:n,o.leaveTo))}}function nC(t){return"all"===t}var iC={},rC={setTransform:function(t,e){return iC.el[t]=e,this},getTransform:function(t){return iC.el[t]},setShape:function(t,e){var n=iC.el;return(n.shape||(n.shape={}))[t]=e,n.dirtyShape&&n.dirtyShape(),this},getShape:function(t){var e=iC.el.shape;if(e)return e[t]},setStyle:function(t,e){var n=iC.el,i=n.style;return i&&(i[t]=e,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(t){var e=iC.el.style;if(e)return e[t]},setExtra:function(t,e){return(iC.el.extra||(iC.el.extra={}))[t]=e,this},getExtra:function(t){var e=iC.el.extra;if(e)return e[t]}};function oC(){var t=this,e=t.el;if(e){var n=QM(e).userDuring,i=t.userDuring;n===i?(iC.el=e,i(rC)):t.el=t.userDuring=null}}function aC(t,e,n,i){var r=n[t];if(r){var o,a=e[t];if(a){var s=n.transition,l=r.transition;if(l)if(!o&&(o=i[t]={}),nC(l))k(o,a);else for(var u=uo(l),h=0;h=0){!o&&(o=i[t]={});var p=F(a);for(h=0;h=0;l--){var p,d,f;if(f=null!=(d=mo((p=n[l]).id,null))?r.get(d):null){var g=f.parent,v=(c=dC(g),{}),y=ep(f,p,g===i?{width:o,height:a}:{width:c.width,height:c.height},null,{hv:p.hv,boundingMode:p.bounding},v);if(!dC(f).isNew&&y){for(var m=p.transition,_={},x=0;x=0)?_[w]=b:f[w]=b}Xu(f,_,t,0)}else f.attr(v)}}},e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(n){yC(n,dC(n).option,e,t._lastGraphicModel)})),this._elMap=gt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Zf);function gC(t){var e=_t(pC,t)?pC[t]:sh(t);var n=new e({});return dC(n).type=t,n}function vC(t,e,n,i){var r=gC(n);return e.add(r),i.set(t,r),dC(r).id=t,dC(r).isNew=!0,r}function yC(t,e,n,i){t&&t.parent&&("group"===t.type&&t.traverse((function(t){yC(t,e,n,i)})),function(t,e,n,i){if(t){var r=t.parent,o=QM(t).leaveToProps;if(o){var a=JM("update",t,e,n,0);a.done=function(){r.remove(t),i&&i()},t.animateTo(o,a)}else r.remove(t),i&&i()}}(t,e,i),n.removeKey(dC(t).id))}function mC(t,e,n,i){t.isGroup||z([["cursor",ha.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],(function(n){var i=n[0];_t(e,i)?t[i]=it(e[i],n[1]):null==t[i]&&(t[i]=n[1])})),z(F(e),(function(n){if(0===n.indexOf("on")){var i=e[n];t[n]=U(i)?i:null}})),_t(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var _C=["x","y","radius","angle","single"],xC=["cartesian2d","polar","singleAxis"];function wC(t){return t+"Axis"}function bC(t,e){var n,i=gt(),r=[],o=gt();t.eachComponent({mainType:"dataZoom",query:e},(function(t){o.get(t.uid)||s(t)}));do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis((function(t,n){var r=i.get(t);r&&r[n]&&(e=!0)})),e}(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),r.push(t),t.eachTargetAxis((function(t,e){(i.get(t)||i.set(t,[]))[e]=!0}))}return r}function SC(t){var e=t.ecModel,n={infoList:[],infoMap:gt()};return t.eachTargetAxis((function(t,i){var r=e.getComponent(wC(t),i);if(r){var o=r.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(r)}}})),n}var MC=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),CC=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return n(e,t),e.prototype.init=function(t,e,n){var i=IC(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=IC(t);T(this.option,t,!0),T(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;z([["start","startValue"],["end","endValue"]],(function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)}),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=gt();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return z(_C,(function(n){var i=this.getReferringComponents(wC(n),To);if(i.specified){e=!0;var r=new MC;z(i.models,(function(t){r.add(t.componentIndex)})),t.set(n,r)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;if(i){var r="vertical"===e?"y":"x";o(n.findComponents({mainType:r+"Axis"}),r)}i&&o(n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single");function o(e,n){var r=e[0];if(r){var o=new MC;if(o.add(r.componentIndex),t.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",Io).models[0];a&&z(e,(function(t){r.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Io).models[0]&&o.add(t.componentIndex)}))}}}i&&z(_C,(function(e){if(i){var r=n.findComponents({mainType:wC(e),filter:function(t){return"category"===t.get("type",!0)}});if(r[0]){var o=new MC;o.add(r[0].componentIndex),t.set(e,o),i=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");z([["start","startValue"],["end","endValue"]],(function(i,r){var o=null!=t[i[0]],a=null!=t[i[1]];o&&!a?e[r]="percent":!o&&a?e[r]="value":n?e[r]=n[r]:o&&(e[r]="percent")}))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(wC(e),n))}),this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,i){z(n.indexList,(function(n){t.call(e,i,n)}))}))},e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(wC(t),e)},e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;z([["start","startValue"],["end","endValue"]],(function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;z(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;io&&(e[1-i]=e[i]+u.sign*o),e}function PC(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function LC(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var OC=z,RC=Fr,NC=function(){function t(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries((function(e){if(function(t){var e=t.get("coordinateSystem");return L(xC,e)>=0}(e)){var n=wC(this._dimName),i=e.getReferringComponents(n,Io).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}}),this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return I(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){var e,n=this._dataExtent,i=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];OC(["start","end"],(function(l,u){var h=t[l],c=t[l+"Value"];"percent"===r[u]?(null==h&&(h=o[u]),c=i.parse(Er(h,o,n))):(e=!0,h=Er(c=null==c?n[u]:i.parse(c),n,o)),s[u]=null==c||isNaN(c)?n[u]:c,a[u]=null==h||isNaN(h)?o[u]:h})),RC(s),RC(a);var l=this._minMaxSpan;function u(t,e,n,r,o){var a=o?"Span":"ValueSpan";AC(0,t,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)e[s]=Er(t[s],n,r,!0),o&&(e[s]=i.parse(e[s]))}return e?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];OC(n,(function(t){!function(t,e,n){e&&z(N_(e,n),(function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])}))}(i,t.getData(),e)}));var r=t.getAxisModel(),o=C_(r.axis.scale,r,i).calculate();return[o.min,o.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),r=t.get("filterMode"),o=this._valueWindow;"none"!==r&&OC(i,(function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===r){var a=e.getStore(),s=E(i,(function(t){return e.getDimensionIndex(t)}),e);e.filterSelf((function(t){for(var e,n,r,l=0;lo[1];if(h&&!c&&!p)return!0;h&&(r=!0),c&&(e=!0),p&&(n=!0)}return r&&e&&n}))}else OC(i,(function(n){if("empty"===r)t.setData(e=e.map(n,(function(t){return function(t){return t>=o[0]&&t<=o[1]}(t)?t:NaN})));else{var i={};i[n]=o,e.selectRange(i)}}));OC(i,(function(t){e.setApproximateExtent(o,t)}))}}))}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;OC(["min","max"],(function(i){var r=e.get(i+"Span"),o=e.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=Er(n[0]+o,n,[0,100],!0):null!=r&&(o=Er(r,[0,100],n,!0)-n[0]),t[i+"Span"]=r,t[i+"ValueSpan"]=o}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=Gr(n,[0,500]);i=Math.min(i,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},t}();var zC={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var o=t.getComponent(wC(i),r);e(i,r,o,n)}))}))}e((function(t,e,n,i){n.__dzAxisProxy=null}));var n=[];e((function(e,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new NC(e,i,o,t),n.push(r.__dzAxisProxy))}));var i=gt();return z(n,(function(t){z(t.getTargetSeriesModels(),(function(t){i.set(t.uid,t)}))})),i},overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),t.eachTargetAxis((function(n,i){t.getAxisProxy(n,i).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};var EC=!1;function BC(t){EC||(EC=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,zC),function(t){t.registerAction("dataZoom",(function(t,e){z(bC(e,t),(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}(t),t.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function VC(t){t.registerComponentModel(TC),t.registerComponentView(kC),BC(t)}var FC=function(){},HC={};function WC(t,e){HC[t]=e}function GC(t){return HC[t]}var UC=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;z(this.option.feature,(function(t,n){var i=GC(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),T(t,i.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(sp);function ZC(t,e){var n=Hc(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new bs({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}var YC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(t,e,n,i){var r=this.group;if(r.removeAll(),t.get("show")){var o=+t.get("itemSize"),a="vertical"===t.get("orient"),s=t.get("feature")||{},l=this._features||(this._features={}),u=[];z(s,(function(t,e){u.push(e)})),new tm(this._featureNames||[],u).add(h).update(h).remove(W(h,null)).execute(),this._featureNames=u,function(t,e,n){var i=e.getBoxLayoutParams(),r=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=tp(i,o,r);Jc(e.get("orient"),t,e.get("itemGap"),a.width,a.height),ep(t,i,o,r)}(r,t,n),r.add(ZC(r.getBoundingRect(),t)),a||r.eachChild((function(t){var e=t.__title,i=t.ensureState("emphasis"),a=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!U(l)&&e){var u=l.style||(l.style={}),h=dr(e,Cs.makeFont(u)),c=t.x+r.x,p=!1;t.y+r.y+o+h.height>n.getHeight()&&(a.position="top",p=!0);var d=p?-5-h.height:o+10;c+h.width/2>n.getWidth()?(a.position=["100%",d],u.align="right"):c-h.width/2<0&&(a.position=[0,d],u.align="left")}}))}function h(h,c){var p,d=u[h],f=u[c],g=s[d],v=new Qh(g,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===d&&(g.title=i.newTitle),d&&!f){if(function(t){return 0===t.indexOf("my")}(d))p={onclick:v.option.onclick,featureName:d};else{var y=GC(d);if(!y)return;p=new y}l[d]=p}else if(!(p=l[f]))return;p.uid=tc("toolbox-feature"),p.model=v,p.ecModel=e,p.api=n;var m=p instanceof FC;d||!f?!v.get("show")||m&&p.unusable?m&&p.remove&&p.remove(e,n):(!function(i,s,l){var u,h,c=i.getModel("iconStyle"),p=i.getModel(["emphasis","iconStyle"]),d=s instanceof FC&&s.getIcons?s.getIcons():i.get("icon"),f=i.get("title")||{};Z(d)?(u={})[l]=d:u=d;Z(f)?(h={})[l]=f:h=f;var g=i.iconPaths={};z(u,(function(l,u){var d=bh(l,{},{x:-o/2,y:-o/2,width:o,height:o});d.setStyle(c.getItemStyle()),d.ensureState("emphasis").style=p.getItemStyle();var f=new Cs({style:{text:h[u],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null},ignore:!0});d.setTextContent(f),Ch({el:d,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),d.__title=h[u],d.on("mouseover",(function(){var e=p.getItemStyle(),i=a?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:p.get("textBackgroundColor")}),d.setTextConfig({position:p.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()})),("emphasis"===i.get(["iconStatus",u])?dl:fl)(d),r.add(d),d.on("click",H(s.onclick,s,e,n,u)),g[u]=d}))}(v,p,d),v.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?dl:fl)(i[t])},p instanceof FC&&p.render&&p.render(v,e,n,i)):m&&p.dispose&&p.dispose(e,n)}},e.prototype.updateView=function(t,e,n,i){z(this._features,(function(t){t instanceof FC&&t.updateView&&t.updateView(t.model,e,n,i)}))},e.prototype.remove=function(t,e){z(this._features,(function(n){n instanceof FC&&n.remove&&n.remove(t,e)})),this.group.removeAll()},e.prototype.dispose=function(t,e){z(this._features,(function(n){n instanceof FC&&n.dispose&&n.dispose(t,e)}))},e.type="toolbox",e}(Zf);var XC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),a=o?"svg":n.get("type",!0)||"png",s=e.getConnectedDataURL({type:a,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),l=r.browser;if(U(MouseEvent)&&(l.newEdge||!l.ie&&!l.edge)){var u=document.createElement("a");u.download=i+"."+a,u.target="_blank",u.href=s;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});u.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var c=s.split(","),p=c[0].indexOf("base64")>-1,d=o?decodeURIComponent(c[1]):c[1];p&&(d=window.atob(d));var f=i+"."+a;if(window.navigator.msSaveOrOpenBlob){for(var g=d.length,v=new Uint8Array(g);g--;)v[g]=d.charCodeAt(g);var y=new Blob([v]);window.navigator.msSaveOrOpenBlob(y,f)}else{var m=document.createElement("iframe");document.body.appendChild(m);var _=m.contentWindow,x=_.document;x.open("image/svg+xml","replace"),x.write(d),x.close(),_.focus(),x.execCommand("SaveAs",!0,f),document.body.removeChild(m)}}else{var w=n.get("lang"),b='',S=window.open();S.document.write(b),S.document.title=i}},e.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},e}(FC),jC="__ec_magicType_stack__",qC=[["line","bar"],["stack"]],KC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return z(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},e.prototype.onclick=function(t,e,n){var i=this.model,r=i.get(["seriesIndex",n]);if($C[n]){var o,a={series:[]};z(qC,(function(t){L(t,n)>=0&&z(t,(function(t){i.setIconStatus(t,"normal")}))})),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(t){var e=t.subType,r=t.id,o=$C[n](e,r,t,i);o&&(A(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",h=t.getReferringComponents(u,Io).models[0].componentIndex;a[u]=a[u]||[];for(var c=0;c<=h;c++)a[u][h]=a[u][h]||{};a[u][h].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(o=T({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),e.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},e}(FC),$C={line:function(t,e,n,i){if("bar"===t)return T({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return T({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var r=n.get("stack")===jC;if("line"===t||"bar"===t)return i.setIconStatus("stack",r?"normal":"emphasis"),T({id:e,stack:r?"":jC},i.get(["option","stack"])||{},!0)}};Fy({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));var QC=new Array(60).join("-"),JC="\t";function tI(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var eI=new RegExp("[\t]+","g");function nI(t,e){var n=t.split(new RegExp("\n*"+QC+"\n*","g")),i={series:[]};return z(n,(function(t,n){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(JC)>=0)return!0}(t)){var r=function(t){for(var e=t.split(/\n+/g),n=[],i=E(tI(e.shift()).split(eI),(function(t){return{name:t,data:[]}})),r=0;r6}(t)||o){if(a&&!o){"single"===s.brushMode&&AI(t);var l=I(s);l.brushType=XI(l.brushType,a),l.panelId=a===pI?null:a.panelId,o=t._creatingCover=bI(t,l),t._covers.push(o)}if(o){var u=KI[XI(t._brushType,a)];o.__brushOption.range=u.getCreatingRange(GI(t,o,t._track)),i&&(SI(t,o),u.updateCommon(t,o)),MI(t,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&DI(t,e,n)&&AI(t)&&(r={isEnd:i,removeOnClick:!0});return r}function XI(t,e){return"auto"===t?e.defaultBrushType:t}var jI={mousedown:function(t){if(this._dragging)qI(this,t);else if(!t.target||!t.target.draggable){UI(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=DI(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,n=t.offsetY,i=this.group.transformCoordToLocal(e,n);if(function(t,e,n){if(t._brushType&&!function(t,e,n){var i=t._zr;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=DI(t,e,n);if(!t._dragging)for(var a=0;a=0)&&t(r,i._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=hT[t.brushType](0,n,e);t.__rangeOffset={offset:pT[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){z(t,(function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&z(i.coordSyses,(function(i){var r=hT[t.brushType](1,i,t.range,!0);n(t,r.values,i,e)}))}),this)},t.prototype.setInputRanges=function(t,e){z(t,(function(t){var n,i,r,o,a,s=this.findTargetInfo(t,e);if(t.range=t.range||[],s&&!0!==s){t.panelId=s.panelId;var l=hT[t.brushType](0,s.coordSys,t.coordRange),u=t.__rangeOffset;t.range=u?pT[t.brushType](l.values,u.offset,(n=l.xyMinMax,i=u.xyMinMax,r=fT(n),o=fT(i),a=[r[0]/o[0],r[1]/o[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},t.prototype.makePanelOpts=function(t,e){return E(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:JI(i),isTargetByCursor:eT(i,t,n.coordSysModel),getLinearBrushOtherExtent:tT(i)}}))},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&L(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=aT(e,t),r=0;rt[1]&&t.reverse(),t}function aT(t,e){return Mo(t,e,{includeMainTypes:iT})}var sT={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,r=t.gridModels,o=gt(),a={},s={};(n||i||r)&&(z(n,(function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0})),z(i,(function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0})),z(r,(function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0})),o.each((function(t){var r=t.coordinateSystem,o=[];z(r.getCartesians(),(function(t,e){(L(n,t.getAxis("x").model)>=0||L(i,t.getAxis("y").model)>=0)&&o.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:uT.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})})))},geo:function(t,e){z(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:uT.geo})}))}},lT=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,r=t.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],uT={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(gh(t)),e}},hT={lineX:W(cT,0),lineY:W(cT,1),rect:function(t,e,n,i){var r=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),o=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[oT([r[0],o[0]]),oT([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var r=[[1/0,-1/0],[1/0,-1/0]];return{values:E(n,(function(n){var o=t?e.pointToData(n,i):e.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o})),xyMinMax:r}}};function cT(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=oT(E([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(i[t]),!0):r.toGlobalCoord(r.dataToCoord(i[t]))}))),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var pT={lineX:W(dT,0),lineY:W(dT,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return E(t,(function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]}))}};function dT(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function fT(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var gT,vT,yT=z,mT=lo+"toolbox-dataZoom_",_T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new wI(n.getZr()),this._brushController.on("brush",H(this._onBrush,this)).mount()),function(t,e,n,i,r){var o=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new rT(wT(t),e,{include:["grid"]}),s=a.makePanelOpts(r,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return sI(t).length}(e)>1?"emphasis":"normal")}(t,e)},e.prototype.onclick=function(t,e,n){xT[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new rT(wT(this.model),i,{include:["grid"]}).matchOutputRanges(e,i,(function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(r("x",n,e[0]),r("y",n,e[1])):r({lineX:"x",lineY:"y"}[i],n,e)}})),function(t,e){var n=sI(t);oI(e,(function(e,i){for(var r=n.length-1;r>=0&&!n[r][i];r--);if(r<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var a=o.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}})),n.push(e)}(i,n),this._dispatchZoomAction(n)}function r(t,e,r){var o=e.getAxis(t),a=o.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)})),i}(t,a,i),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=AC(0,r.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},e.prototype._dispatchZoomAction=function(t){var e=[];yT(t,(function(t,n){e.push(I(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},e}(FC),xT={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=sI(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return oI(n,(function(t,n){for(var r=e.length-1;r>=0;r--)if(t=e[r][n]){i[n]=t;break}})),i}(this.ecModel))}};function wT(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}gT="dataZoom",vT=function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),r=[],o=Mo(t,wT(i));return yT(o.xAxisModels,(function(t){return a(t,"xAxis","xAxisIndex")})),yT(o.yAxisModels,(function(t){return a(t,"yAxis","yAxisIndex")})),r}function a(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:mT+e+o};a[n]=o,r.push(a)}},st(null==kp.get(gT)&&vT),kp.set(gT,vT);var bT=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(sp);function ST(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function MT(t){if(r.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n-1?(u+="top:50%",h+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(u+="left:50%",h+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var c=a*Math.PI/180,p=l+r,d=p*Math.abs(Math.cos(c))+p*Math.abs(Math.sin(c)),f=e+" solid "+r+"px;";return'
                  '}(n,i,r)),Z(t))o.innerHTML=t+a;else if(t){o.innerHTML="",G(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!r.node&&n.getDom()){var o=HT(i,n);this._ticket="";var a=i.dataByCoordSys,s=function(t,e,n){var i=Co(t).queryOptionMap,r=i.keys()[0];if(!r||"series"===r)return;var o=Do(e,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse((function(e){var n=Bs(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0})),s)return{componentMainType:r,componentIndex:a.componentIndex,el:s}}(i,e,n);if(s){var l=s.el.getBoundingRect().clone();l.applyTransform(s.el.transform),this._tryShow({offsetX:l.x+l.width/2,offsetY:l.y+l.height/2,target:s.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var u=BT;u.x=i.x,u.y=i.y,u.update(),Bs(u).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:u},o)}else if(a)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:a,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var h=RM(i,e),c=h.point[0],p=h.point[1];null!=c&&null!=p&&this._tryShow({offsetX:c,offsetY:p,target:h.el,position:i.position,positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},e.prototype.manuallyHideTip=function(t,e,n,i){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(HT(i,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=e.getSeriesByIndex(r);if(s)if("axis"===FT([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}},e.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var r,o;this._lastDataByCoordSys=null,Yg(n,(function(t){return null!=Bs(t).dataIndex?(r=t,!0):null!=Bs(t).tooltipConfig?(o=t,!0):void 0}),!0),r?this._showSeriesItemTooltip(t,r,e):o?this._showComponentItemTooltip(t,o,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=H(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,r=[e.offsetX,e.offsetY],o=FT([e.tooltipOption],i),a=this._renderMode,s=[],l=Sf("section",{blocks:[],noHeader:!0}),u=[],h=new Of;z(t,(function(t){z(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=xM(r,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),c=Sf("section",{header:o,noHeader:!lt(o),sortBlocks:!0,blocks:[]});l.blocks.push(c),z(t.seriesDataIndices,(function(l){var p=n.getSeriesByIndex(l.seriesIndex),d=l.dataIndexInside,f=p.getDataParams(d);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=P_(e.axis,{value:r}),f.axisValueLabel=o,f.marker=h.makeTooltipMarker("item",Xc(f.color),a);var g=Ud(p.formatTooltip(d,!0,null)),v=g.frag;if(v){var y=FT([p],i).get("valueFormatter");c.blocks.push(y?k({valueFormatter:y},v):v)}g.text&&u.push(g.text),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var c=e.position,p=o.get("order"),d=kf(l,h,a,p,n.get("useUTC"),o.get("textStyle"));d&&u.unshift(d);var f="richText"===a?"\n\n":"
                  ",g=u.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,c,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",r[0],r[1],c,null,h)}))},e.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,r=Bs(e),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,u=r.dataType,h=s.getData(u),c=this._renderMode,p=t.positionDefault,d=FT([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),f=d.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),v=new Of;g.marker=v.makeTooltipMarker("item",Xc(g.color),c);var y=Ud(s.formatTooltip(l,!1,u)),m=d.get("order"),_=d.get("valueFormatter"),x=y.frag,w=x?kf(_?k({valueFormatter:_},x):x,v,c,m,i.get("useUTC"),d.get("textStyle")):y.text,b="item_"+s.name+"_"+l;this._showOrMove(d,(function(){this._showTooltipContent(d,w,g,b,t.offsetX,t.offsetY,t.position,t.target,v)})),n({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var i=Bs(e),r=i.tooltipConfig.option||{};if(Z(r)){r={content:r,formatter:r}}var o=[r],a=this._ecModel.getComponent(i.componentMainType,i.componentIndex);a&&o.push(a),o.push({formatter:r.content});var s=t.positionDefault,l=FT(o,this._tooltipModel,s?{position:s}:null),u=l.get("content"),h=Math.random()+"",c=new Of;this._showOrMove(l,(function(){var n=I(l.get("formatterParams")||{});this._showTooltipContent(l,u,n,h,t.offsetX,t.offsetY,t.position,e,c)})),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,i,r,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,p=this._getNearestPoint([r,o],n,t.get("trigger"),t.get("borderColor")).color;if(h)if(Z(h)){var d=t.ecModel.get("useUTC"),f=G(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=bc(f.axisValue,c,d)),c=Zc(c,n,!0)}else if(U(h)){var g=H((function(e,i){e===this._ticket&&(u.setContent(i,l,t,p,a),this._updatePosition(t,a,r,o,u,n,s))}),this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,p,a),u.show(t,p),this._updatePosition(t,a,r,o,u,n,s)}},e.prototype._getNearestPoint=function(t,e,n,i){return"axis"===n||G(e)?{color:i||("html"===this._renderMode?"#fff":"none")}:G(e)?void 0:{color:i||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=r.getSize(),h=t.get("align"),c=t.get("verticalAlign"),p=a&&a.getBoundingRect().clone();if(a&&p.applyTransform(a.transform),U(e)&&(e=e([n,i],o,r.el,p,{viewSize:[s,l],contentSize:u.slice()})),G(e))n=Br(e[0],s),i=Br(e[1],l);else if(j(e)){var d=e;d.width=u[0],d.height=u[1];var f=tp(d,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(Z(e)&&a){var g=function(t,e,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-r/2,l=e.y+h/2-o/2;break;case"top":s=e.x+u/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-r/2,l=e.y+h+a;break;case"left":s=e.x-r-a,l=e.y+h/2-o/2;break;case"right":s=e.x+u+a,l=e.y+h/2-o/2}return[s,l]}(e,p,u,t.get("borderWidth"));n=g[0],i=g[1]}else{g=function(t,e,n,i,r,o,a){var s=n.getSize(),l=s[0],u=s[1];null!=o&&(t+l+o+2>i?t-=l+o:t+=o);null!=a&&(e+u+a>r?e-=u+a:e+=a);return[t,e]}(n,i,r,s,l,h?null:20,c?null:20);n=g[0],i=g[1]}if(h&&(n-=WT(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=WT(c)?u[1]/2:"bottom"===c?u[1]:0),ST(t)){g=function(t,e,n,i,r){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,r)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(n,i,r,s,l);n=g[0],i=g[1]}r.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===t.length;return r&&z(n,(function(n,o){var a=n.dataByAxis||[],s=(t[o]||{}).dataByAxis||[];(r=r&&a.length===s.length)&&z(a,(function(t,n){var o=s[n]||{},a=t.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===l.length)&&z(a,(function(t,e){var n=l[e];r=r&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),i&&z(t.seriesDataIndices,(function(t){var n=t.seriesIndex,o=e[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!r.node&&e.getDom()&&(ag(this,"_updatePosition"),this._tooltipContent.dispose(),LM("itemTooltip",e))},e.type="tooltip",e}(Zf);function FT(t,e,n){var i,r=e.ecModel;n?(i=new Qh(n,r,r),i=new Qh(e.option,i,r)):i=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof Qh&&(a=a.get("tooltip",!0)),Z(a)&&(a={formatter:a}),a&&(i=new Qh(a,i,r)))}return i}function HT(t,e){return t.dispatchAction||H(e.dispatchAction,e)}function WT(t){return"center"===t||"middle"===t}var GT=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return n(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(sp),UT=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=it(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Cs({style:Oh(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Cs({style:Oh(o,{text:h,fill:o.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),d=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!p&&!f,c.silent=!d&&!f,p&&l.on("click",(function(){jc(p,"_"+t.get("target"))})),d&&c.on("click",(function(){jc(d,"_"+t.get("subtarget"))})),Bs(l).eventData=Bs(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),v=t.getBoxLayoutParams();v.width=g.width,v.height=g.height;var y=tp(v,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var m={align:a,verticalAlign:s};l.setStyle(m),c.setStyle(m),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var w=new bs({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(w)}},e.type="title",e}(Zf);function ZT(t,e){if(!t)return!1;for(var n=G(t)?t:[t],i=0;i=0&&(a[o]=+a[o].toFixed(c)),[a,h]}var QT={min:W($T,"min"),max:W($T,"max"),average:W($T,"average"),median:W($T,"median")};function JT(t,e){if(e){var n=t.getData(),i=t.coordinateSystem,r=i&&i.dimensions;if(!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!G(e.coord)&&G(r)){var o=tD(e,n,i,t);if((e=I(e)).type&&QT[e.type]&&o.baseAxis&&o.valueAxis){var a=L(r,o.baseAxis.dim),s=L(r,o.valueAxis.dim),l=QT[e.type](n,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}if(null!=e.coord&&G(r))for(var u=e.coord,h=0;h<2;h++)QT[u[h]]&&(u[h]=iD(n,n.mapDimension(r[h]),u[h]));else e.coord=[];return e}}function tD(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(function(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function eD(t,e){return!(t&&t.containData&&e.coord&&!KT(e))||t.containData(e.coord)}function nD(t,e){return t?function(t,n,i,r){return jd(r<2?t.coord&&t.coord[r]:t.value,e[r])}:function(t,n,i,r){return jd(t.value,e[r])}}function iD(t,e,n){if("average"===n){var i=0,r=0;return t.each(e,(function(t,e){isNaN(t)||(i+=t,r++)})),i/r}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var rD=bo(),oD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(){this.markerGroupMap=gt()},e.prototype.render=function(t,e,n){var i=this,r=this.markerGroupMap;r.each((function(t){rD(t).keep=!1})),e.eachSeries((function(t){var r=jT.getMarkerModelFromSeries(t,i.type);r&&i.renderSeries(t,r,e,n)})),r.each((function(t){!rD(t).keep&&i.group.remove(t.group)}))},e.prototype.markKeep=function(t){rD(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var n=this;z(t,(function(t){var i=jT.getMarkerModelFromSeries(t,n.type);i&&i.getData().eachItemGraphicEl((function(t){t&&(e?gl(t):vl(t))}))}))},e.type="marker",e}(Zf);function aD(t,e,n){var i=e.coordinateSystem;t.each((function(r){var o,a=t.getItemModel(r),s=Br(a.get("x"),n.getWidth()),l=Br(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,r));else if(i){var u=t.get(i.dimensions[0],r),h=t.get(i.dimensions[1],r);o=i.dataToPoint([u,h])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),t.setItemLayout(r,o)}))}var sD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=jT.getMarkerModelFromSeries(t,"markPoint");e&&(aD(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new Kw),u=function(t,e,n){var i;i=t?E(t&&t.dimensions,(function(t){return k(k({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Sm(i,n),o=E(n.get("data"),W(JT,e));t&&(o=V(o,W(eD,t)));var a=nD(!!t,i);return r.initData(o,null,a),r}(r,t,e);e.setData(u),aD(e.getData(),t,i),u.each((function(t){var n=u.getItemModel(t),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(U(i)||U(r)||U(o)||U(s)){var h=e.getRawValue(t),c=e.getDataParams(t);U(i)&&(i=i(h,c)),U(r)&&(r=r(h,c)),U(o)&&(o=o(h,c)),U(s)&&(s=s(h,c))}var p=n.getModel("itemStyle").getItemStyle(),d=Ug(a,"color");p.fill||(p.fill=d),u.setItemVisual(t,{symbol:i,symbolSize:r,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:p})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(t){t.traverse((function(t){Bs(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(oD);var lD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(jT),uD=Iu.prototype,hD=Au.prototype,cD=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(cD);function pD(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var dD=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return n(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new cD},e.prototype.buildPath=function(t,e){pD(e)?uD.buildPath.call(this,t,e):hD.buildPath.call(this,t,e)},e.prototype.pointAt=function(t){return pD(this.shape)?uD.pointAt.call(this,t):hD.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var e=this.shape,n=pD(e)?[e.x2-e.x1,e.y2-e.y1]:hD.tangentAt.call(this,t);return Lt(n,n)},e}(hs),fD=["fromSymbol","toSymbol"];function gD(t){return"_"+t+"Type"}function vD(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var r=e.getItemVisual(n,t+"Size"),o=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=ov(r),u=av(a||0,l),h=rv(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,h.name=t,h}}function yD(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}var mD=function(t){function e(e,n,i){var r=t.call(this)||this;return r._createLine(e,n,i),r}return n(e,t),e.prototype._createLine=function(t,e,n){var i=t.hostModel,r=function(t){var e=new dD({name:"line",subPixelOptimize:!0});return yD(e.shape,t),e}(t.getItemLayout(e));r.shape.percent=0,ju(r,{shape:{percent:1}},i,e),this.add(r),z(fD,(function(n){var i=vD(n,t,e);this.add(i),this[gD(n)]=t.getItemVisual(e,n)}),this),this._updateCommonStl(t,e,n)},e.prototype.updateData=function(t,e,n){var i=t.hostModel,r=this.childOfName("line"),o=t.getItemLayout(e),a={shape:{}};yD(a.shape,o),Xu(r,a,i,e),z(fD,(function(n){var i=t.getItemVisual(e,n),r=gD(n);if(this[r]!==i){this.remove(this.childOfName(n));var o=vD(n,t,e);this.add(o)}this[r]=i}),this),this._updateCommonStl(t,e,n)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,e,n){var i=t.hostModel,r=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,h=n&&n.focus,c=n&&n.blurScope;if(!n||t.hasItemOption){var p=t.getItemModel(e),d=p.getModel("emphasis");o=d.getModel("lineStyle").getLineStyle(),a=p.getModel(["blur","lineStyle"]).getLineStyle(),s=p.getModel(["select","lineStyle"]).getLineStyle(),u=d.get("disabled"),h=d.get("focus"),c=d.get("blurScope"),l=Lh(p)}var f=t.getItemVisual(e,"style"),g=f.stroke;r.useStyle(f),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,r.ensureState("blur").style=a,r.ensureState("select").style=s,z(fD,(function(t){var e=this.childOfName(t);if(e){e.setColor(g),e.style.opacity=f.opacity;for(var n=0;n0&&(m[0]=-m[0],m[1]=-m[1]);var x=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var w=-Math.atan2(y[1],y[0]);u[0].8?"left":h[0]<-.8?"right":"center",p=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":i.x=-h[0]*f+l[0],i.y=-h[1]*g+l[1],c=h[0]>.8?"right":h[0]<-.8?"left":"center",p=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*x+l[0],i.y=l[1]+b,c=y[0]<0?"right":"left",i.originX=-f*x,i.originY=-b;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+b,c="center",i.originY=-b;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*x+u[0],i.y=u[1]+b,c=y[0]>=0?"right":"left",i.originX=f*x,i.originY=-b}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||c})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(kr),_D=function(){function t(t){this.group=new kr,this._LineCtor=t||mD}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,r=n._lineData;n._lineData=t,r||i.removeAll();var o=xD(t);t.diff(r).add((function(n){e._doAdd(t,n,o)})).update((function(n,i){e._doUpdate(r,t,i,n,o)})).remove((function(t){i.remove(r.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=xD(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i=0&&X(l)&&(l=+l.toFixed(Math.min(f,20))),p.coord[h]=d.coord[h]=l,r=[p,d,{type:a,valueIndex:i.valueIndex,value:l}]}else r=[]}var g=[JT(t,r[0]),JT(t,r[1]),k({},r[2])];return g[2].type=g[2].type||null,T(g[2],g[0]),T(g[2],g[1]),g};function CD(t){return!isNaN(t)&&!isFinite(t)}function ID(t,e,n,i){var r=1-t,o=i.dimensions[t];return CD(e[r])&&CD(n[r])&&e[t]===n[t]&&i.getAxis(o).containData(e[t])}function TD(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;if(n&&i&&(ID(1,n,i,t)||ID(0,n,i,t)))return!0}return eD(t,e[0])&&eD(t,e[1])}function DD(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Br(s.get("x"),r.getWidth()),u=Br(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,c=t.get(h[0],e),p=t.get(h[1],e);o=a.dataToPoint([c,p])}if(ub(a,"cartesian2d")){var d=a.getAxis("x"),f=a.getAxis("y");h=a.dimensions;CD(t.get(h[0],e))?o[0]=d.toGlobalCoord(d.getExtent()[n?0:1]):CD(t.get(h[1],e))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}var kD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=jT.getMarkerModelFromSeries(t,"markLine");if(e){var i=e.getData(),r=SD(e).from,o=SD(e).to;r.each((function(e){DD(r,e,!0,t,n),DD(o,e,!1,t,n)})),i.each((function(t){i.setItemLayout(t,[r.getItemLayout(t),o.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new _D);this.group.add(l.group);var u=function(t,e,n){var i;i=t?E(t&&t.dimensions,(function(t){return k(k({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Sm(i,n),o=new Sm(i,n),a=new Sm([],n),s=E(n.get("data"),W(MD,e,t,n));t&&(s=V(s,W(TD,t)));var l=nD(!!t,i);return r.initData(E(s,(function(t){return t[0]})),null,l),o.initData(E(s,(function(t){return t[1]})),null,l),a.initData(E(s,(function(t){return t[2]}))),a.hasItemOption=!0,{from:r,to:o,line:a}}(r,t,e),h=u.from,c=u.to,p=u.line;SD(e).from=h,SD(e).to=c,e.setData(p);var d=e.get("symbol"),f=e.get("symbolSize"),g=e.get("symbolRotate"),v=e.get("symbolOffset");function y(e,n,r){var o=e.getItemModel(n);DD(e,n,r,t,i);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=Ug(a,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:it(o.get("symbolOffset",!0),v[r?0:1]),symbolRotate:it(o.get("symbolRotate",!0),g[r?0:1]),symbolSize:it(o.get("symbolSize"),f[r?0:1]),symbol:it(o.get("symbol",!0),d[r?0:1]),style:s})}G(d)||(d=[d,d]),G(f)||(f=[f,f]),G(g)||(g=[g,g]),G(v)||(v=[v,v]),u.from.each((function(t){y(h,t,!0),y(c,t,!1)})),p.each((function(t){var e=p.getItemModel(t).getModel("lineStyle").getLineStyle();p.setItemLayout(t,[h.getItemLayout(t),c.getItemLayout(t)]),null==e.stroke&&(e.stroke=h.getItemVisual(t,"style").fill),p.setItemVisual(t,{fromSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(t,"symbolOffset"),fromSymbolRotate:h.getItemVisual(t,"symbolRotate"),fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolKeepAspect:c.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:c.getItemVisual(t,"symbolOffset"),toSymbolRotate:c.getItemVisual(t,"symbolRotate"),toSymbolSize:c.getItemVisual(t,"symbolSize"),toSymbol:c.getItemVisual(t,"symbol"),style:e})})),l.updateData(p),u.line.eachItemGraphicEl((function(t){Bs(t).dataModel=e,t.traverse((function(t){Bs(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(oD);var AD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(jT),PD=bo(),LD=function(t,e,n,i){var r=i[0],o=i[1];if(r&&o){var a=JT(t,r),s=JT(t,o),l=a.coord,u=s.coord;l[0]=nt(l[0],-1/0),l[1]=nt(l[1],-1/0),u[0]=nt(u[0],1/0),u[1]=nt(u[1],1/0);var h=D([{},a,s]);return h.coord=[a.coord,s.coord],h.x0=a.x,h.y0=a.y,h.x1=s.x,h.y1=s.y,h}};function OD(t){return!isNaN(t)&&!isFinite(t)}function RD(t,e,n,i){var r=1-t;return OD(e[r])&&OD(n[r])}function ND(t,e){var n=e.coord[0],i=e.coord[1],r={coord:n,x:e.x0,y:e.y0},o={coord:i,x:e.x1,y:e.y1};return ub(t,"cartesian2d")?!(!n||!i||!RD(1,n,i)&&!RD(0,n,i))||function(t,e,n){return!(t&&t.containZone&&e.coord&&n.coord&&!KT(e)&&!KT(n))||t.containZone(e.coord,n.coord)}(t,r,o):eD(t,r)||eD(t,o)}function zD(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Br(s.get(n[0]),r.getWidth()),u=Br(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition){var h=t.getValues(["x0","y0"],e),c=t.getValues(["x1","y1"],e),p=a.clampData(h),d=a.clampData(c),f=[];"x0"===n[0]?f[0]=p[0]>d[0]?c[0]:h[0]:f[0]=p[0]>d[0]?h[0]:c[0],"y0"===n[1]?f[1]=p[1]>d[1]?c[1]:h[1]:f[1]=p[1]>d[1]?h[1]:c[1],o=i.getMarkerPosition(f,n,!0)}else{var g=[m=t.get(n[0],e),_=t.get(n[1],e)];a.clampData&&a.clampData(g,g),o=a.dataToPoint(g,!0)}if(ub(a,"cartesian2d")){var v=a.getAxis("x"),y=a.getAxis("y"),m=t.get(n[0],e),_=t.get(n[1],e);OD(m)?o[0]=v.toGlobalCoord(v.getExtent()["x0"===n[0]?0:1]):OD(_)&&(o[1]=y.toGlobalCoord(y.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var ED=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],BD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=jT.getMarkerModelFromSeries(t,"markArea");if(e){var i=e.getData();i.each((function(e){var r=E(ED,(function(r){return zD(i,e,r,t,n)}));i.setItemLayout(e,r),i.getItemGraphicEl(e).setShape("points",r)}))}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new kr});this.group.add(l.group),this.markKeep(l);var u=function(t,e,n){var i,r,o=["x0","y0","x1","y1"];if(t){var a=E(t&&t.dimensions,(function(t){var n=e.getData();return k(k({},n.getDimensionInfo(n.mapDimension(t))||{}),{name:t,ordinalMeta:null})}));r=E(o,(function(t,e){return{name:t,type:a[e%2].type}})),i=new Sm(r,n)}else i=new Sm(r=[{name:"value",type:"float"}],n);var s=E(n.get("data"),W(LD,e,t,n));t&&(s=V(s,W(ND,t)));var l=t?function(t,e,n,i){return jd(t.coord[Math.floor(i/2)][i%2],r[i])}:function(t,e,n,i){return jd(t.value,r[i])};return i.initData(s,null,l),i.hasItemOption=!0,i}(r,t,e);e.setData(u),u.each((function(e){var n=E(ED,(function(n){return zD(u,e,n,t,i)})),o=r.getAxis("x").scale,s=r.getAxis("y").scale,l=o.getExtent(),h=s.getExtent(),c=[o.parse(u.get("x0",e)),o.parse(u.get("x1",e))],p=[s.parse(u.get("y0",e)),s.parse(u.get("y1",e))];Fr(c),Fr(p);var d=!!(l[0]>c[1]||l[1]p[1]||h[1]=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(sp),FD=W,HD=z,WD=kr,GD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return n(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new WD),this.group.add(this._selectorGroup=new WD),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(r,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},h=t.get("padding"),c=tp(l,u,h),p=this.layoutInner(t,r,c,i,a,s),d=tp(A({width:p.width,height:p.height},l),u,h);this.group.x=d.x-p.x,this.group.y=d.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=ZC(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,i,r,o,a){var s=this.getContentGroup(),l=gt(),u=e.get("selectedMode"),h=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&h.push(t.id)})),HD(e.getData(),(function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var c=new WD;return c.newline=!0,void s.add(c)}var p=n.getSeriesByName(a)[0];if(!l.get(a)){if(p){var d=p.getData(),f=d.getVisual("legendLineStyle")||{},g=d.getVisual("legendIcon"),v=d.getVisual("style");this._createItem(p,a,o,r,e,t,f,v,g,u,i).on("click",FD(UD,a,null,i,h)).on("mouseover",FD(YD,p.name,null,i,h)).on("mouseout",FD(XD,p.name,null,i,h)),l.set(a,!0)}else n.eachRawSeries((function(n){if(!l.get(a)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(a))return;var c=s.indexOfName(a),p=s.getItemVisual(c,"style"),d=s.getItemVisual(c,"legendIcon"),f=Wn(p.fill);f&&0===f[3]&&(f[3]=.2,p=k(k({},p),{fill:Kn(f,"rgba")})),this._createItem(n,a,o,r,e,t,{},p,d,u,i).on("click",FD(UD,null,a,i,h)).on("mouseover",FD(YD,null,a,i,h)).on("mouseout",FD(XD,null,a,i,h)),l.set(a,!0)}}),this);0}}),this),r&&this._createSelector(r,e,i,o,a)},e.prototype._createSelector=function(t,e,n,i,r){var o=this.getSelectorGroup();HD(t,(function(t){var i=t.type,r=new Cs({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r),Ph(r,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),Il(r)}))},e.prototype._createItem=function(t,e,n,i,r,o,a,s,l,u,h){var c=t.visualDrawType,p=r.get("itemWidth"),d=r.get("itemHeight"),f=r.isSelected(e),g=i.get("symbolRotate"),v=i.get("symbolKeepAspect"),y=i.get("icon"),m=function(t,e,n,i,r,o,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),HD(t,(function(n,i){"inherit"===t[i]&&(t[i]=e[i])}))}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?Pv(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[r]);"inherit"===u.stroke&&(u.stroke=i[h]);"inherit"===u.opacity&&(u.opacity=("fill"===r?i:n).opacity);s(u,i);var p=e.getModel("lineStyle"),d=p.getLineStyle();if(s(d,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===d.stroke&&(d.stroke=i.fill),!o){var f=e.get("inactiveBorderWidth"),g=u[h];u.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),d.stroke=p.get("inactiveColor"),d.lineWidth=p.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}(l=y||l||"roundRect",i,a,s,c,f,h),_=new WD,x=i.getModel("textStyle");if(!U(t.getLegendIcon)||y&&"inherit"!==y){var w="inherit"===y&&t.getData().getVisual("symbol")?"inherit"===g?t.getData().getVisual("symbolRotate"):g:0;_.add(function(t){var e=t.icon||"roundRect",n=rv(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:p,itemHeight:d,icon:l,iconRotate:w,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:v}))}else _.add(t.getLegendIcon({itemWidth:p,itemHeight:d,icon:l,iconRotate:g,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:v}));var b="left"===o?p+5:-5,S=o,M=r.get("formatter"),C=e;Z(M)&&M?C=M.replace("{name}",null!=e?e:""):U(M)&&(C=M(e));var I=i.get("inactiveColor");_.add(new Cs({style:Oh(x,{text:C,x:b,y:d/2,fill:f?x.getTextColor():I,align:S,verticalAlign:"middle"})}));var T=new bs({shape:_.getBoundingRect(),invisible:!0}),D=i.getModel("tooltip");return D.get("show")&&Ch({el:T,componentModel:r,itemName:e,itemTooltipOption:D.option}),_.add(T),_.eachChild((function(t){t.silent=!0})),T.silent=!u,this.getContentGroup().add(_),Il(_),_.__legendDataIndex=n,_},e.prototype.layoutInner=function(t,e,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Jc(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),r){Jc("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],p=t.get("selectorButtonGap",!0),d=t.getOrient().index,f=0===d?"width":"height",g=0===d?"height":"width",v=0===d?"y":"x";"end"===o?c[d]+=l[f]+p:u[d]+=h[f]+p,c[1-d]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+p+h[f],y[g]=Math.max(l[g],h[g]),y[v]=Math.min(0,h[v]+c[1-d]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Zf);function UD(t,e,n,i){XD(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),YD(t,e,n,i)}function ZD(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,r=n.length;in[r],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],v=[-p.x,-p.y],y=it(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?v[i]+=n[r]-p[r]:g[i]+=p[r]+y);v[1-i]+=c[o]/2-p[o]/2,l.setPosition(f),u.setPosition(g),h.setPosition(v);var m={x:0,y:0};if(m[r]=d?n[r]:c[r],m[o]=Math.max(c[o],p[o]),m[a]=Math.min(0,p[a]+v[1-i]),u.__rectSize=n[r],d){var _={x:0,y:0};_[r]=Math.max(n[r]-p[r]-y,0),_[o]=m[o],u.setClipPath(new bs({shape:_})),u.__rectSize=_[r]}else h.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(t);return null!=x.pageIndex&&Xu(l,{x:x.contentPosition[0],y:x.contentPosition[1]},d?t:null),this._updatePageInfoView(t,x),m},e.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;z(["pagePrev","pageNext"],(function(i){var r=null!=e[i+"DataIndex"],o=n.childOfName(i);o&&(o.setStyle("fill",r?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")}));var i=n.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;i&&r&&i.setStyle("text",Z(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=tk[r],a=ek[r],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],h=l.length,c=h?1:0,p={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return p;var d=m(u);p.contentPosition[r]=-d.s;for(var f=s+1,g=d,v=d,y=null;f<=h;++f)(!(y=m(l[f]))&&v.e>g.s+i||y&&!_(y,g.s))&&(g=v.i>g.i?v:y)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=g.i),++p.pageCount),v=y;for(f=s-1,g=d,v=d,y=null;f>=-1;--f)(y=m(l[f]))&&_(v,y.s)||!(g.i=e&&t.s<=e+i}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===t&&(e=r)})),null!=e?e:n):0;var e,n},e.type="legend.scroll",e}(GD);function ik(t){$y(KD),t.registerComponentModel($D),t.registerComponentView(nk),function(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}(t)}var rk=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="dataZoom.inside",e.defaultOption=ec(CC.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(CC),ok=function(t){function e(e){var n=t.call(this)||this;n._zr=e;var i=H(n._mousedownHandler,n),r=H(n._mousemoveHandler,n),o=H(n._mouseupHandler,n),a=H(n._mousewheelHandler,n),s=H(n._pinchHandler,n);return n.enable=function(t,n){this.disable(),this._opt=A(I(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",r),e.on("mouseup",o)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",s))},n.disable=function(){e.off("mousedown",i),e.off("mousemove",r),e.off("mouseup",o),e.off("mousewheel",a),e.off("pinch",s)},n}return n(e,t),e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!he(t)){for(var e=t.target;e;){if(e.draggable)return;e=e.__hostTarget||e.parent}var n=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,n,i)&&(this._x=n,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(this._dragging&&lk("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!hI(this._zr,"globalPan")){var e=t.offsetX,n=t.offsetY,i=this._x,r=this._y,o=e-i,a=n-r;this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&ue(t.event),sk(this,"pan","moveOnMouseMove",t,{dx:o,dy:a,oldX:i,oldY:r,newX:e,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){he(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var e=lk("zoomOnMouseWheel",t,this._opt),n=lk("moveOnMouseWheel",t,this._opt),i=t.wheelDelta,r=Math.abs(i),o=t.offsetX,a=t.offsetY;if(0!==i&&(e||n)){if(e){var s=r>3?1.4:r>1?1.2:1.1;ak(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);ak(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){hI(this._zr,"globalPan")||ak(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},e}(Ut);function ak(t,e,n,i,r){t.pointerChecker&&t.pointerChecker(i,r.originX,r.originY)&&(ue(i.event),sk(t,e,n,i,r))}function sk(t,e,n,i,r){r.isAvailableBehavior=H(lk,null,n,i),t.trigger(e,r)}function lk(t,e,n){var i=n[t];return!t||i&&(!Z(i)||e.event[i+"Key"])}var uk=bo();function hk(t,e,n){uk(t).coordSysRecordMap.each((function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=n)}))}function ck(t,e){if(e){t.removeKey(e.model.uid);var n=e.controller;n&&n.dispose()}}function pk(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function dk(t,e,n,i){return t.coordinateSystem.containPoint([n,i])}function fk(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var n=uk(e),i=n.coordSysRecordMap||(n.coordSysRecordMap=gt());i.each((function(t){t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){z(SC(t).infoList,(function(n){var r=n.model.uid,o=i.get(r)||i.set(r,function(t,e){var n={model:e,containsPoint:W(dk,e),dispatchAction:W(pk,t),dataZoomInfoMap:null,controller:null},i=n.controller=new ok(t.getZr());return z(["pan","zoom","scrollMove"],(function(t){i.on(t,(function(e){var i=[];n.dataZoomInfoMap.each((function(r){if(e.isAvailableBehavior(r.model.option)){var o=(r.getRange||{})[t],a=o&&o(r.dzReferCoordSysInfo,n.model.mainType,n.controller,e);!r.model.get("disabled",!0)&&a&&i.push({dataZoomId:r.model.id,start:a[0],end:a[1]})}})),i.length&&n.dispatchAction(i)}))})),n}(e,n.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=gt())).set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})}))})),i.each((function(t){var e,n=t.controller,r=t.dataZoomInfoMap;if(r){var o=r.keys()[0];null!=o&&(e=r.get(o))}if(e){var a=function(t){var e,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},r=!0;return t.each((function(t){var o=t.model,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");i[n+a]>i[n+e]&&(e=a),r=r&&o.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}(r);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),og(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else ck(i,t)}))}))}var gk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return n(e,t),e.prototype.render=function(e,n,i){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),hk(i,e,{pan:H(vk.pan,this),zoom:H(vk.zoom,this),scrollMove:H(vk.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){!function(t,e){for(var n=uk(t).coordSysRecordMap,i=n.keys(),r=0;r0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/i.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return AC(0,o,[0,100],0,h.minSpan,h.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}},pan:yk((function(t,e,n,i,r,o){var a=mk[i]([o.oldX,o.oldY],[o.newX,o.newY],e,r,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength})),scrollMove:yk((function(t,e,n,i,r,o){return mk[i]([0,0],[o.scrollDelta,o.scrollDelta],e,r,n).signal*(t[1]-t[0])*o.scrollDelta}))};function yk(t){return function(e,n,i,r){var o=this.range,a=o.slice(),s=e.axisModels[0];if(s)return AC(t(a,s,e,n,i,r),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}var mk={grid:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};function _k(t){BC(t),t.registerComponentModel(rk),t.registerComponentView(gk),fk(t)}var xk=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=ec(CC.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(CC),wk=bs,bk="horizontal",Sk="vertical",Mk=["line","bar","candlestick","scatter"],Ck={easing:"cubicOut",duration:100,delay:0},Ik=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._displayables={},n}return n(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=H(this._onBrush,this),this._onBrushEnd=H(this._onBrushEnd,this)},e.prototype.render=function(e,n,i,r){if(t.prototype.render.apply(this,arguments),og(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){ag(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new kr;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,i=this._findCoordRect(),r={width:e.getWidth(),height:e.getHeight()},o=this._orient===bk?{right:r.width-i.x-i.width,top:r.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=rp(t.option);z(["right","top","width","height"],(function(t){"ph"===a[t]&&(a[t]=o[t])}));var s=tp(a,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===Sk&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==bk||r?n===bk&&r?{scaleY:a?1:-1,scaleX:-1}:n!==Sk||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new wk({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new wk({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:H(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],i=t.series,r=i.getRawData(),o=i.getShadowDim&&i.getShadowDim(),a=o&&r.getDimensionInfo(o)?i.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var u=r.getDataExtent(a),h=.3*(u[1]-u[0]);u=[u[0]-h,u[1]+h];var c,p=[0,e[1]],d=[0,e[0]],f=[[e[0],0],[0,0]],g=[],v=d[1]/(r.count()-1),y=0,m=Math.round(r.count()/e[0]);r.each([a],(function(t,e){if(m>0&&e%m)y+=v;else{var n=null==t||isNaN(t)||""===t,i=n?0:Er(t,u,p,!0);n&&!c&&e?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&c&&(f.push([y,0]),g.push([y,0])),f.push([y,i]),g.push([y,i]),y+=v,c=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=r,this._shadowDim=a,this._shadowSize=[e[0],e[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var w=b(1===x);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}}}function b(t){var e=_.getModel(t?"selectedDataBackground":"dataBackground"),n=new kr,i=new wu({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new Su({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var n,i=this.ecModel;return t.eachTargetAxis((function(r,o){z(t.getAxisProxy(r,o).getTargetSeriesModels(),(function(t){if(!(n||!0!==e&&L(Mk,t.get("type"))<0)){var a,s=i.getComponent(wC(r),o).axis,l=function(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}(r),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),h=e.filler=new wk({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(h),r.add(new wk({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),z([0,1],(function(e){var o=a.get("handleIcon");!ev[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o);var s=rv(o,-1,0,2,2,null,!0);s.attr({cursor:Tk(this._orient),draggable:!0,drift:H(this._onDragMove,this,e),ondragend:H(this._onDragEnd,this),onmouseover:H(this._showDataInfo,this,!0),onmouseout:H(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=Br(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),Il(s);var h=a.get("handleColor");null!=h&&(s.style.fill=h),r.add(n[e]=s);var c=a.getModel("textStyle");t.add(i[e]=new Cs({silent:!0,invisible:!0,style:Oh(c,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:c.getTextColor(),font:c.getFont()}),z2:10}))}),this);var c=h;if(u){var p=Br(a.get("moveHandleSize"),o[1]),d=e.moveHandle=new bs({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:p}}),f=.8*p,g=e.moveHandleIcon=rv(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+p/2-.5,d.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var v=Math.min(o[1]/2,Math.max(p,10));(c=e.moveZone=new bs({invisible:!0,shape:{y:o[1]-v,height:p+v}})).on("mouseover",(function(){s.enterEmphasis(d)})).on("mouseout",(function(){s.leaveEmphasis(d)})),r.add(d),r.add(g),r.add(c)}c.attr({draggable:!0,cursor:Tk(this._orient),drift:H(this._onDragMove,this,"all"),ondragstart:H(this._showDataInfo,this,!0),ondragend:H(this._onDragEnd,this),onmouseover:H(this._showDataInfo,this,!0),onmouseout:H(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Er(t[0],[0,100],e,!0),Er(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];AC(e,i,r,n.get("zoomLock")?"all":t,null!=o.minSpan?Er(o.minSpan,a,r,!0):null,null!=o.maxSpan?Er(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=Fr([Er(i[0],r,a,!0),Er(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},e.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=Fr(n.slice()),r=this._size;z([0,1],(function(t){var i=e.handles[t],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:r[1]/2-o/2})}),this),e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;le[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new Se(e,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),r=[0,100];this._range=Fr([Er(n.x,i,r,!0),Er(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(ue(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new wk({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?Ck:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=SC(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),r=this.api.getHeight();t={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return t},e.type="dataZoom.slider",e}(DC);function Tk(t){return"vertical"===t?"ns-resize":"ew-resize"}function Dk(t){t.registerComponentModel(xk),t.registerComponentView(Ik),BC(t)}var kk={label:{enabled:!0},decal:{show:!1}},Ak=bo(),Pk={};function Lk(t,e){var n=t.getModel("aria");if(n.get("enabled")){var i=I(kk);T(i.label,t.getLocaleModel().get("aria"),!1),T(n.option,i,!1),function(){if(n.getModel("decal").get("show")){var e=gt();t.eachSeries((function(t){if(!t.isColorBySeries()){var n=e.get(t.type);n||(n={},e.set(t.type,n)),Ak(t).scope=n}})),t.eachRawSeries((function(e){if(!t.isSeriesFiltered(e))if(U(e.enableAriaDecal))e.enableAriaDecal();else{var n=e.getData();if(e.isColorBySeries()){var i=zp(e.ecModel,e.name,Pk,t.getSeriesCount()),r=n.getVisual("decal");n.setVisual("decal",u(r,i))}else{var o=e.getRawData(),a={},s=Ak(e).scope;n.each((function(t){var e=n.getRawIndex(t);a[e]=t}));var l=o.count();o.each((function(t){var i=a[t],r=o.getName(t)||t+"",h=zp(e.ecModel,r,s,l),c=n.getItemVisual(i,"decal");n.setItemVisual(i,"decal",u(c,h))}))}}function u(t,e){var n=t?k(k({},e),t):e;return n.dirty=!0,n}}))}}(),function(){var i=t.getLocaleModel().get("aria"),o=n.getModel("label");if(o.option=A(o.option,i),!o.get("enabled"))return;var a=e.getZr().dom;if(o.get("description"))return void a.setAttribute("aria-label",o.get("description"));var s,l=t.getSeriesCount(),u=o.get(["data","maxCount"])||10,h=o.get(["series","maxCount"])||10,c=Math.min(l,h);if(l<1)return;var p=function(){var e=t.get("title");e&&e.length&&(e=e[0]);return e&&e.text}();s=p?r(o.get(["general","withTitle"]),{title:p}):o.get(["general","withoutTitle"]);var d=[];s+=r(l>1?o.get(["series","multiple","prefix"]):o.get(["series","single","prefix"]),{seriesCount:l}),t.eachSeries((function(e,n){if(n1?o.get(["series","multiple",a]):o.get(["series","single",a]),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(_=e.subType,t.getLocaleModel().get(["series","typeNames"])[_]||"自定义图")});var s=e.getData();if(s.count()>u)i+=r(o.get(["data","partialData"]),{displayCnt:u});else i+=o.get(["data","allData"]);for(var h=o.get(["data","separator","middle"]),p=o.get(["data","separator","end"]),f=[],g=0;g= 9 || BROWSER.rv))) { + allowswitcheditor = wysiwyg = 0; + } + if(!allowswitcheditor) { + $(editorid + '_switcher').style.display = 'none'; + } + + if(wysiwyg) { + if($(editorid + '_iframe')) { + editbox = $(editorid + '_iframe'); + } else { + var iframe = document.createElement('iframe'); + iframe.frameBorder = '0'; + iframe.hideFocus = true; + iframe.style.display = 'none'; + editbox = textobj.parentNode.appendChild(iframe); + editbox.id = editorid + '_iframe'; + } + + editwin = editbox.contentWindow; + editdoc = editwin.document; + writeEditorContents(isUndefined(initialtext) ? textobj.value : initialtext); + } else { + editbox = editwin = editdoc = textobj; + if(!isUndefined(initialtext)) { + writeEditorContents(initialtext); + } + addSnapshot(textobj.value); + } + setEditorEvents(); + initEditor(); +} + +function setEditorTip(s) { + $(editorid + '_tip').innerHTML = ' ' + s; +} + +function initEditor() { + if(BROWSER.other) { + $(editorid + '_controls').style.display = 'none'; + return; + } + var buttons = $(editorid + '_controls').getElementsByTagName('a'); + initesbar(); + for(var i = 0; i < buttons.length; i++) { + if(buttons[i].id.indexOf(editorid + '_') != -1) { + buttons[i].href = 'javascript:;'; + if(buttons[i].id.substr(buttons[i].id.indexOf('_') + 1) == 'fullswitcher') { + buttons[i].innerHTML = !editorisfull ? '全屏' : '返回'; + buttons[i].onmouseover = function(e) {setEditorTip(editorisfull ? '恢复编辑器大小' : '全屏方式编辑');}; + buttons[i].onclick = function(e) {editorfull();doane();} + } else if(buttons[i].id.substr(buttons[i].id.indexOf('_') + 1) == 'simple') { + buttons[i].innerHTML = !simplodemode ? '常用' : '高级'; + buttons[i].onclick = function(e) {editorsimple();doane();} + } else { + _attachEvent(buttons[i], 'mouseover', function(e) {setEditorTip(BROWSER.ie ? window.event.srcElement.title : e.target.title);}); + if(buttons[i].id.substr(buttons[i].id.indexOf('_') + 1) == 'url') { + buttons[i].onclick = function(e) {discuzcode('unlink');discuzcode('url');doane();}; + } else { + if(!buttons[i].getAttribute('init')) { + buttons[i].onclick = function(e) {discuzcode(this.id.substr(this.id.indexOf('_') + 1));doane();}; + } + } + } + buttons[i].onmouseout = function(e) {setEditorTip('');}; + } + } + setUnselectable($(editorid + '_controls')); + if(editorcontroltop === false && (BROWSER.ie && BROWSER.ie > 6 || !BROWSER.ie)) { + seteditorcontrolpos(); + var obj = wysiwyg ? editwin.document.body.parentNode : $(editorid + '_textarea'); + editorcontrolwidth = $(editorid + '_controls').clientWidth - 8; + ctrlmObj = document.createElement('div'); + ctrlmObj.style.display = 'none'; + ctrlmObj.style.height = $(editorid + '_controls').clientHeight + 'px'; + ctrlmObj.id = editorid + '_controls_mask'; + $(editorid + '_controls').parentNode.insertBefore(ctrlmObj, $(editorid + '_controls')); + _attachEvent(window, 'scroll', function () { editorcontrolpos(); }, document); + } + if($(editorid + '_fullswitcher') && BROWSER.ie && BROWSER.ie < 7) { + $(editorid + '_fullswitcher').onclick = function () { + showDialog('您的浏览器不支持此功能,请升级浏览器版本', 'notice', '友情提示'); + }; + $(editorid + '_fullswitcher').className = 'xg1'; + } + if($(editorid + '_svdsecond') && savedatat === null) { + savedatac = savedataInterval; + autosave = !getcookie('editorautosave_' + editorid) || getcookie('editorautosave_' + editorid) == 1 ? 1 : 0; + savedataTime(); + savedatat = setInterval("savedataTime()", 10000); + } + checkFocus(); +} + +function initesbar() { + if(!$(editorid + '_adv_s3')) { + return; + } + var buttons = $(editorid + '_adv_s3').getElementsByTagName('A'); + var s = ''; + for(i = 0;i < buttons.length;i++) { + if(i/2 == parseInt(i/2)) { + s += '

                  '; + } + s += buttons[i].outerHTML; + } + $(editorid + '_adv_s3').innerHTML = s; + for(var i = 0; i < buttons.length; i++) { + if(buttons[i].id.indexOf(editorid + '_') != -1) { + buttons[i].href = 'javascript:;'; + if(buttons[i].id.substr(buttons[i].id.indexOf('_') + 1) == 'fullswitcher') { + } else if(buttons[i].id.substr(buttons[i].id.indexOf('_') + 1) == 'simple') { + } else { + _attachEvent(buttons[i], 'mouseover', function(e) {setEditorTip(BROWSER.ie ? window.event.srcElement.title : e.target.title);}); + if(buttons[i].id.substr(buttons[i].id.indexOf('_') + 1) == 'url') { + buttons[i].onclick = function(e) {discuzcode('unlink');discuzcode('url');doane();}; + } else { + if(!buttons[i].getAttribute('init')) { + buttons[i].onclick = function(e) {discuzcode(this.id.substr(this.id.indexOf('_') + 1));doane();}; + } + } + } + buttons[i].onmouseout = function(e) {setEditorTip('');}; + } + } +} + +function savedataTime() { + if(!autosave) { + $(editorid + '_svdsecond').innerHTML = '开启自动保存 '; + return; + } + if(!savedatac) { + savedatac = savedataInterval; + saveData(); + d = new Date(); + var h = d.getHours(); + var m = d.getMinutes(); + h = h < 10 ? '0' + h : h; + m = m < 10 ? '0' + m : m; + setEditorTip('数据已于 ' + h + ':' + m + ' 保存'); + } + $(editorid + '_svdsecond').innerHTML = '' + savedatac + ' 秒后保存 '; + savedatac -= 10; +} + +function setAutosave() { + autosave = !autosave; + setEditorTip(autosave ? '数据自动保存已开启' : '数据自动保存已关闭'); + setcookie('editorautosave_' + editorid, autosave ? 1 : -1, 2592000); + savedataTime(); +} + +function unloadAutoSave() { + if(autosave) { + saveData(); + } +} + +function seteditorcontrolpos() { + var objpos = fetchOffset($(editorid + '_controls')); + editorcontroltop = objpos['top']; +} + +function editorcontrolpos() { + if(editorisfull) { + return; + } + var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + if(scrollTop > editorcontroltop && editorcurrentheight > editorminheight) { + $(editorid + '_controls').style.position = 'fixed'; + $(editorid + '_controls').style.top = '0px'; + $(editorid + '_controls').style.width = editorcontrolwidth + 'px'; + $(editorid + '_controls_mask').style.display = ''; + } else { + $(editorid + '_controls').style.position = $(editorid + '_controls').style.top = $(editorid + '_controls').style.width = ''; + $(editorid + '_controls_mask').style.display = 'none'; + } +} + +function editorsize(op, v) { + var obj = wysiwyg ? editwin.document.body.parentNode : $(editorid + '_textarea'); + var editorheight = obj.clientHeight; + if(!v) { + if(op == '+') { + editorheight += 200; + } else{ + editorheight -= 200; + } + } else { + editorheight = v; + } + editorcurrentheight = editorheight > editorminheight ? editorheight : editorminheight; + if($(editorid + '_iframe')) { + $(editorid + '_iframe').style.height = $(editorid + '_iframe').contentWindow.document.body.style.height = editorcurrentheight + 'px'; + } + if(framemObj) { + framemObj.style.height = editorcurrentheight + 'px'; + } + $(editorid + '_textarea').style.height = editorcurrentheight + 'px'; +} + +var editorsizepos = []; +function editorresize(e, op) { + op = !op ? 1 : op; + e = e ? e : window.event; + if(op == 1) { + if(wysiwyg) { + var objpos = fetchOffset($(editorid + '_iframe')); + framemObj = document.createElement('div'); + framemObj.style.width = $(editorid + '_iframe').clientWidth + 'px'; + framemObj.style.height = $(editorid + '_iframe').clientHeight + 'px'; + framemObj.style.position = 'absolute'; + framemObj.style.left = objpos['left'] + 'px'; + framemObj.style.top = objpos['top'] + 'px'; + $('append_parent').appendChild(framemObj); + } else { + framemObj = null; + } + editorsizepos = [e.clientY, editorcurrentheight, framemObj]; + document.onmousemove = function(e) {try{editorresize(e, 2);}catch(err){}}; + document.onmouseup = function(e) {try{editorresize(e, 3);}catch(err){}}; + doane(e); + }else if(op == 2 && editorsizepos !== []) { + var dragnow = e.clientY; + editorsize('', editorsizepos[1] + dragnow - editorsizepos[0]); + doane(e); + }else if(op == 3) { + if(wysiwyg) { + $('append_parent').removeChild(editorsizepos[2]); + } + editorsizepos = []; + document.onmousemove = null; + document.onmouseup = null; + } +} + +function editorfull(op) { + var op = !op ? 0 : op, control = $(editorid + '_controls'), area = $(editorid + '_textarea').parentNode, bbar = $(editorid + '_bbar'), iswysiwyg = wysiwyg; + if(op) { + var editorheight = document.documentElement.clientHeight - control.offsetHeight - bbar.offsetHeight - parseInt(getCurrentStyle(area, 'paddingTop', 'padding-top')) - parseInt(getCurrentStyle(area, 'paddingBottom', 'padding-bottom')); + area.style.position = 'fixed'; + area.style.top = control.offsetHeight + 'px'; + area.style.height = editorheight + 'px'; + editorsize('', editorheight); + bbar.style.position = 'fixed'; + bbar.style.top = (document.documentElement.clientHeight - bbar.offsetHeight) + 'px'; + return; + } + if(!editorisfull) { + savesimplodemode = 0; + if(simplodemode) { + savesimplodemode = 1; + editorsimple(); + } + $(editorid + '_simple').style.visibility = 'hidden'; + fulloldheight = editorcurrentheight; + document.body.style.overflow = 'hidden'; + document.body.scroll = 'no'; + control.style.position = 'fixed'; + control.style.top = '0px'; + control.style.left = '0px'; + control.style.width = '100%'; + control.style.minWidth = '800px'; + area.style.backgroundColor = $(editorid + '_textarea') ? getCurrentStyle($(editorid + '_textarea'), 'backgroundColor', 'background-color') : '#fff'; + $(editorid + '_switcher').style.paddingRight = '10px'; + var editorheight = document.documentElement.clientHeight - control.offsetHeight - bbar.offsetHeight - parseInt(getCurrentStyle(area, 'paddingTop', 'padding-top')) - parseInt(getCurrentStyle(area, 'paddingBottom', 'padding-bottom')); + area.style.position = 'fixed'; + area.style.top = control.offsetHeight + 'px'; + area.style.left = '0px'; + area.style.width = '100%'; + area.style.height = editorheight + 'px'; + editorsize('', editorheight); + bbar.style.position = 'fixed'; + bbar.style.top = (document.documentElement.clientHeight - bbar.offsetHeight) + 'px'; + bbar.style.left = '0px'; + bbar.style.width = '100%'; + control.style.zIndex = '500'; + area.style.zIndex = bbar.style.zIndex = '200'; + if($(editorid + '_resize')) { + $(editorid + '_resize').style.display = 'none'; + } + window.onresize = function() { editorfull(1); }; + editorisfull = 1; + } else { + if(savesimplodemode) { + editorsimple(); + } + $(editorid + '_simple').style.visibility = 'visible'; + window.onresize = null; + document.body.style.overflow = 'auto'; + document.body.scroll = 'yes'; + control.style.position = control.style.top = control.style.left = control.style.width = control.style.minWidth = control.style.zIndex = + area.style.position = area.style.top = area.style.left = area.style.width = area.style.height = area.style.zIndex = + bbar.style.position = bbar.style.top = bbar.style.left = bbar.style.width = bbar.style.zIndex = ''; + editorheight = fulloldheight; + $(editorid + '_switcher').style.paddingRight = '0px'; + editorsize('', editorheight); + if($(editorid + '_resize')) { + $(editorid + '_resize').style.display = ''; + } + editorisfull = 0; + editorcontrolpos(); + } + $(editorid + '_fullswitcher').innerHTML = editorisfull ? '返回' : '全屏'; + initesbar(); +} + +function editorsimple() { + if($(editorid + '_body').className == 'edt') { + v = 'none'; + $(editorid + '_simple').innerHTML = '高级'; + $(editorid + '_body').className = 'edt simpleedt'; + $(editorid + '_adv_s1').className = 'b2r'; + $(editorid + '_adv_s2').className = 'b2r nbl'; + if(allowswitcheditor) { + $(editorid + '_switcher').style.display = 'none'; + } + $(editorid + '_adv_s3').className = 'b2r esbs'; + simplodemode = 1; + } else { + v = ''; + $(editorid + '_simple').innerHTML = '常用'; + $(editorid + '_body').className = 'edt'; + $(editorid + '_adv_s1').className = 'b1r'; + $(editorid + '_adv_s2').className = 'b2r nbr nbl'; + if(allowswitcheditor) { + $(editorid + '_switcher').style.display = ''; + } + $(editorid + '_adv_s3').className = 'b2r esb'; + simplodemode = 0; + } + setcookie('editormode_' + editorid, simplodemode ? 1 : -1, 2592000); + for(i = 1;i <= 9;i++) { + if($(editorid + '_adv_' + i)) { + $(editorid + '_adv_' + i).style.display = v; + } + } + var btns = $(editorid + '_adv_s3').getElementsByTagName('A'); + for(i = 0;i < btns.length;i++) { + if(btns[i].getAttribute('adv')) { + btns[i].style.display = v; + } + } +} + +function pasteWord(str) { + var mstest = /<\w[^>]* class="?[MsoNormal|xl]"?/gi; + if(mstest.test(str)){ + str = str.replace(//gi, ""); + str = str.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); + str = str.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, function ($1, $2, $3, $4) { + var style = ''; + re = new RegExp('(^|[;\\s])color:\\s*([^;]+);?', 'ig'); + match = re.exec($3); + if(match != null) { + style += 'color:' + match[2] + ';'; + } + re = new RegExp('(^|[;\\s])text-indent:\\s*([^;]+);?', 'ig'); + match = re.exec($3); + if(match != null) { + style += 'text-indent:' + parseInt(parseInt(match[2]) / 10) + 'em;'; + } + re = new RegExp('(^|[;\\s])font-size:\\s*([^;]+);?', 'ig'); + match = re.exec($3); + if(match != null) { + style += 'font-size:' + match[2] + ';'; + } + if(style) { + style = ' style="' + style + '"'; + } + return '<' + $2 + style + $4; + }); + str = str.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); + str = str.replace(/<\\?\?xml[^>]*>/gi, ""); + str = str.replace(/<\/?\w+:[^>]*>/gi, ""); + str = str.replace(/ /, " "); + var re = new RegExp("(]*>.*?)(<\/P>)", 'ig'); + str = str.replace(re, ""); + if(!wysiwyg) { + str = html2bbcode(str); + } + insertText(str, str.length, 0); + } +} + +var ctlent_enable = {8:1,9:1,13:1}; +function ctlent(event) { + if(postSubmited == false && (event.ctrlKey && event.keyCode == 13) || (event.altKey && event.keyCode == 83) && editorsubmit) { + if(in_array(editorsubmit.name, ['topicsubmit', 'replysubmit', 'editsubmit']) && !validate(editorform)) { + doane(event); + return; + } + postSubmited = true; + editorsubmit.disabled = true; + editorform.submit(); + return; + } + if(ctlent_enable[9] && event.keyCode == 9) { + if(!wysiwyg) { + insertText('\t', 1, 0); + } + doane(event); + } + if(ctlent_enable[8] && event.keyCode == 8 && wysiwyg) { + var sel = getSel(); + if(sel) { + insertText('', sel.length - 1, 0); + doane(event); + } + } +} + +function keyBackspace() { + if(!wysiwyg) { + return; + } + if(BROWSER.ie) { + sel = editdoc.selection.createRange(); + sel.moveStart('character', -1); + sel.moveEnd('character', 0); + sel.select(); + editdoc.selection.clear(); + } else { + editdoc.execCommand('delete', false, true); + } +} + +function keyMenu(code, func) { + var km = 'kM' + Math.random(); + var hs = '' + code + ''; + if(BROWSER.ie) { + var range = document.selection.createRange(); + range.pasteHTML(hs); + range.moveToElementText(editdoc.getElementById(km)); + range.moveStart("character"); + range.select(); + } else { + var selection = editwin.getSelection(); + var range = selection.getRangeAt(0); + var fragment = range.createContextualFragment(hs); + range.insertNode(fragment); + var tmp = editdoc.getElementById(km).firstChild; + range.setStart(tmp, 1); + range.setEnd(tmp, 1); + selection.removeAllRanges(); + selection.addRange(range); + } + keyMenuObj = editdoc.getElementById(km); + var b = fetchOffset(editbox); + var o = fetchOffset(keyMenuObj); + var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + func(b.left + o.left, b.top + o.top - scrollTop); +} + +function checkFocus() { + if(wysiwyg) { + if(BROWSER.rv) { + return; + } + try { + editwin.document.body.focus(); + } catch(e) { + editwin.focus(); + } + } else { + textobj.focus(); + } +} + +function checklength(theform) { + var message = wysiwyg ? html2bbcode(getEditorContents()) : (!theform.parseurloff.checked ? parseurl(theform.message.value) : theform.message.value); + showDialog('当前长度: ' + mb_strlen(message) + ' 字节,' + (postmaxchars != 0 ? '系统限制: ' + postminchars + ' 到 ' + postmaxchars + ' 字节。' : ''), 'notice', '字数检查'); +} + +function setUnselectable(obj) { + if(BROWSER.ie && BROWSER.ie > 4 && typeof obj.tagName != 'undefined') { + if(obj.hasChildNodes()) { + for(var i = 0; i < obj.childNodes.length; i++) { + setUnselectable(obj.childNodes[i]); + } + } + if(obj.tagName != 'INPUT') { + obj.unselectable = 'on'; + } + } +} + +function writeEditorContents(text) { + if(wysiwyg) { + if(text == '' && (BROWSER.firefox || BROWSER.opera)) { + text = '

                  '; + } + if(initialized && !(BROWSER.firefox && BROWSER.firefox >= '3' || BROWSER.opera)) { + editdoc.body.innerHTML = text; + } else { + text = '' + + '' + + '' + + '' + + (BROWSER.ie ? '' : '') + + '' + text + ''; + editdoc.designMode = allowhtml ? 'on' : 'off'; + editdoc = editwin.document; + editdoc.open('text/html', 'replace'); + editdoc.write(text); + editdoc.close(); + if(!BROWSER.ie) { + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.text = 'window.onerror = function() { return true; }'; + editdoc.getElementById('editorheader').appendChild(scriptNode); + } + editdoc.body.contentEditable = true; + editdoc.body.spellcheck = false; + initialized = true; + if(BROWSER.safari) { + editdoc.onclick = safariSel; + } + } + if(BROWSER.ie && BROWSER.ie <= 8) { + checkpostbg = /]+name="editorpostbg"[^>]*>body{background-image:url\("([^\[\<\r\n;'\"\?\(\)]+?)"\);}<\/style>/ig; + var matches = checkpostbg.exec(text); + if(matches != null) { + editdoc.body.innerHTML += ''; + } + } + } else { + textobj.value = text; + } + + setEditorStyle(); + +} + +function safariSel(e) { + e = e.target; + if(e.tagName.match(/(img|embed)/i)) { + var sel = editwin.getSelection(),rng= editdoc.createRange(true); + rng.selectNode(e); + sel.removeAllRanges(); + sel.addRange(rng); + } +} + +function getEditorContents() { + return wysiwyg ? editdoc.body.innerHTML : editdoc.value; +} + +function setEditorStyle() { + if(wysiwyg) { + textobj.style.display = 'none'; + editbox.style.display = ''; + editbox.className = textobj.className; + if(BROWSER.ie) { + editdoc.body.style.border = '0px'; + editdoc.body.addBehavior('#default#userData'); + try{$('subject').focus();} catch(e) {editwin.focus();} + } + if($(editorid + '_iframe')) { + $(editorid + '_iframe').style.height = $(editorid + '_iframe').contentWindow.document.body.style.height = editorcurrentheight + 'px'; + } + } else { + var iframe = textobj.parentNode.getElementsByTagName('iframe')[0]; + if(iframe) { + textobj.style.display = ''; + iframe.style.display = 'none'; + } + if(BROWSER.ie) { + try{ + $('subject').focus(); + } catch(e) {} + } + } + if($('at_menu')) { + $('at_menu').style.display = 'none'; + } +} + +function setEditorEvents() { + if(BROWSER.firefox || BROWSER.opera) { + editdoc.addEventListener('mouseup', function(e) {mouseUp(e)}, true); + editdoc.addEventListener('keyup', function(e) {keyUp(e)}, true); + editwin.addEventListener('keydown', function(e) {keyDown(e)}, true); + } else if(editdoc.attachEvent) { + try{ + editdoc.attachEvent('onmouseup', mouseUp); + editdoc.attachEvent('onkeyup', keyUp); + editdoc.attachEvent('onkeydown', keyDown); + } catch(e) {} + } +} + +function mouseUp(event) { + if(wysiwyg) { + setContext(); + } + for(i in EXTRAFUNC['mouseup']) { + EXTRAEVENT = event; + try { + eval(EXTRAFUNC['mouseup'][i] + '()'); + } catch(e) {} + } +} + +function keyUp(event) { + if(wysiwyg) { + setContext(); + } + for(i in EXTRAFUNC['keyup']) { + EXTRAEVENT = event; + try { + eval(EXTRAFUNC['keyup'][i] + '()'); + } catch(e) {} + } +} + +function keyDown(event) { + ctlent(event); + for(i in EXTRAFUNC['keydown']) { + EXTRAEVENT = event; + try { + eval(EXTRAFUNC['keydown'][i] + '()'); + } catch(e) {} + } +} + +function wrapTags(tagname, useoption, selection) { + if(isUndefined(selection)) { + var selection = getSel(); + if(selection === false) { + selection = ''; + } else { + selection += ''; + } + } + + if(useoption !== false) { + var opentag = '[' + tagname + '=' + useoption + ']'; + } else { + var opentag = '[' + tagname + ']'; + } + + var closetag = '[/' + tagname + ']'; + var text = opentag + selection + closetag; + + insertText(text, strlen(opentag), strlen(closetag), in_array(tagname, ['code', 'quote', 'free', 'hide']) ? true : false); +} + +function applyFormat(cmd, dialog, argument) { + if(wysiwyg) { + editdoc.execCommand(cmd, (isUndefined(dialog) ? false : dialog), (isUndefined(argument) ? true : argument)); + return; + } + switch(cmd) { + case 'bold': + case 'italic': + case 'underline': + case 'strikethrough': + wrapTags(cmd.substr(0, 1), false); + break; + case 'inserthorizontalrule': + insertText('[hr]', 4, 0); + break; + case 'justifyleft': + case 'justifycenter': + case 'justifyright': + wrapTags('align', cmd.substr(7)); + break; + case 'fontname': + wrapTags('font', argument); + break; + case 'fontsize': + wrapTags('size', argument); + break; + case 'forecolor': + wrapTags('color', argument); + break; + case 'hilitecolor': + case 'backcolor': + wrapTags('backcolor', argument); + break; + } +} + +function isEmail(email) { + return email.length > 6 && /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/.test(email); +} + +function insertAttachTag(aid) { + var txt = '[attach]' + aid + '[/attach]'; + if(wysiwyg) { + insertText(txt, false); + } else { + insertText(txt, strlen(txt), 0); + } +} + +function insertAttachimgTag(aid) { + if(wysiwyg) { + insertText('', false); + } else { + var txt = '[attachimg]' + aid + '[/attachimg]'; + insertText(txt, strlen(txt), 0); + } +} + +function insertSmiley(smilieid) { + checkFocus(); + var src = $('smilie_' + smilieid).src; + var code = $('smilie_' + smilieid).alt; + if(wysiwyg && allowsmilies && (!$('smileyoff') || $('smileyoff').checked == false)) { + insertText('', false); + } else { + code += ' '; + insertText(code, strlen(code), 0); + } + hideMenu(); +} + +function discuzcode(cmd, arg) { + if(cmd != 'redo') { + addSnapshot(getEditorContents()); + } + + checkFocus(); + + if(in_array(cmd, ['sml', 'inserthorizontalrule', 'url', 'quote', 'code', 'free', 'hide', 'aud', 'vid', 'fls', 'beginning', 'attach', 'image', 'pasteword', 'index', 'postbg', 'password']) || typeof EXTRAFUNC['showEditorMenu'][cmd] != 'undefined' || cmd == 'tbl' || in_array(cmd, ['fontname', 'fontsize', 'forecolor', 'backcolor']) && !arg) { + showEditorMenu(cmd); + return; + } else if(cmd.substr(0, 3) == 'cst') { + showEditorMenu(cmd.substr(5), cmd.substr(3, 1)); + return; + } else if(cmd == 'page') { + if(wysiwyg) { + str = '

                  [page]

                  '; + } else { + str = '\n\n[page]'; + } + insertText(str, strlen(str), 0); + } else if(cmd == 'autotypeset') { + autoTypeset(); + return; + } else if(!wysiwyg && cmd == 'removeformat') { + var simplestrip = new Array('b', 'i', 'u'); + var complexstrip = new Array('font', 'color', 'backcolor', 'size', 'align', 'float'); + + var str = getSel(); + if(str === false) { + return; + } + for(var tag in simplestrip) { + str = stripSimple(simplestrip[tag], str); + } + for(var tag in complexstrip) { + str = stripComplex(complexstrip[tag], str); + } + insertText(str); + } else if(cmd == 'undo') { + addSnapshot(getEditorContents()); + moveCursor(-1); + if((str = getSnapshot()) !== false) { + if(wysiwyg) { + editdoc.body.innerHTML = str; + } else { + editdoc.value = str; + } + } + } else if(cmd == 'redo') { + moveCursor(1); + if((str = getSnapshot()) !== false) { + if(wysiwyg) { + editdoc.body.innerHTML = str; + } else { + editdoc.value = str; + } + } + } else if(!wysiwyg && in_array(cmd, ['insertorderedlist', 'insertunorderedlist'])) { + var listtype = cmd == 'insertorderedlist' ? '1' : ''; + var opentag = '[list' + (listtype ? ('=' + listtype) : '') + ']\n'; + var closetag = '[/list]'; + + if(txt = getSel()) { + var regex = new RegExp('([\r\n]+|^[\r\n]*)(?!\\[\\*\\]|\\[\\/?list)(?=[^\r\n])', 'gi'); + txt = opentag + trim(txt).replace(regex, '$1[*]') + '\n' + closetag; + insertText(txt, strlen(txt), 0); + } else { + insertText(opentag + closetag, opentag.length, closetag.length); + + while(listvalue = prompt('输入一个列表项目.\r\n留空或者点击取消完成此列表.', '')) { + if(BROWSER.opera > 8) { + listvalue = '\n' + '[*]' + listvalue; + insertText(listvalue, strlen(listvalue) + 1, 0); + } else { + listvalue = '[*]' + listvalue + '\n'; + insertText(listvalue, strlen(listvalue), 0); + } + } + } + } else if(!wysiwyg && cmd == 'unlink') { + var sel = getSel(); + sel = stripSimple('url', sel); + sel = stripComplex('url', sel); + insertText(sel); + } else if(cmd == 'floatleft' || cmd == 'floatright') { + var arg = cmd == 'floatleft' ? 'left' : 'right'; + if(wysiwyg) { + if(txt = getSel()) { + argm = arg == 'left' ? 'right' : 'left'; + insertText('
                  ' + txt + '
                  ', true); + } + } else { + var opentag = '[float=' + arg + ']'; + var closetag = '[/float]'; + if(txt = getSel()) { + txt = opentag + txt + closetag; + insertText(txt, strlen(txt), 0); + } else { + insertText(opentag + closetag, opentag.length, closetag.length); + } + } + } else if(cmd == 'rst') { + loadData(); + setEditorTip('数据已恢复'); + } else if(cmd == 'svd') { + saveData(); + setEditorTip('数据已保存'); + } else if(cmd == 'chck') { + checklength(editorform); + } else if(cmd == 'tpr') { + if(confirm('您确认要清除所有内容吗?')) { + clearContent(); + } + } else if(cmd == 'downremoteimg') { + showDialog('

                  正在下载远程附件,请稍等……

                  ', 'notice', '', null, 1); + var message = wysiwyg ? html2bbcode(getEditorContents()) : (!editorform.parseurloff.checked ? parseurl(editorform.message.value) : editorform.message.value); + var oldValidate = editorform.onsubmit; + var oldAction = editorform.action; + editorform.onsubmit = ''; + editorform.action = 'forum.php?mod=ajax&action=downremoteimg&inajax=1&fid='+fid+'&wysiwyg='+(wysiwyg ? 1 : 0); + editorform.target = "ajaxpostframe"; + editorform.message.value = message; + editorform.submit(); + editorform.onsubmit = oldValidate; + editorform.action = oldAction; + editorform.target = ""; + } else { + var formatcmd = cmd == 'backcolor' && !BROWSER.ie ? 'hilitecolor' : cmd; + try { + var ret = applyFormat(formatcmd, false, (isUndefined(arg) ? true : arg)); + } catch(e) { + var ret = false; + } + } + + if(cmd != 'undo') { + addSnapshot(getEditorContents()); + } + if(wysiwyg) { + setContext(cmd); + } + if(in_array(cmd, ['bold', 'italic', 'underline', 'strikethrough', 'fontname', 'fontsize', 'forecolor', 'backcolor', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', 'floatleft', 'floatright', 'removeformat', 'unlink', 'undo', 'redo'])) { + hideMenu(); + } + doane(); + return ret; +} + +function setContext(cmd) { + var cmd = !cmd ? '' : cmd; + var contextcontrols = new Array('bold', 'italic', 'underline', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist'); + for(var i in contextcontrols) { + var controlid = contextcontrols[i]; + var obj = $(editorid + '_' + controlid); + if(obj != null) { + if(cmd == 'clear') { + obj.className = ''; + continue; + } + try { + var state = editdoc.queryCommandState(contextcontrols[i]); + } catch(e) { + var state = false; + } + if(isUndefined(obj.state)) { + obj.state = false; + } + if(obj.state != state) { + obj.state = state; + buttonContext(obj, state ? 'mouseover' : 'mouseout'); + } + } + } + + try { + var fs = editdoc.queryCommandValue('fontname'); + } catch(e) { + fs = null; + } + if(fs == '' && !BROWSER.ie && window.getComputedStyle) { + fs = editdoc.body.style.fontFamily; + } else if(fs == null) { + fs = ''; + } + fs = fs && cmd != 'clear' ? fs : '字体'; + if(fs != $(editorid + '_font').fontstate) { + thingy = fs.indexOf(',') > 0 ? fs.substr(0, fs.indexOf(',')) : fs; + $(editorid + '_font').innerHTML = thingy; + $(editorid + '_font').fontstate = fs; + } + try { + var ss = editdoc.queryCommandValue('fontsize'); + if(ss == null || ss == '' || cmd == 'clear') { + ss = formatFontsize(editdoc.body.style.fontSize); + } else { + var ssu = ss.substr(-2); + if(ssu == 'px' || ssu == 'pt') { + ss = formatFontsize(ss); + } + } + } catch(e) { + ss = '大小'; + } + + if(ss != $(editorid + '_size').sizestate) { + if($(editorid + '_size').sizestate == null) { + $(editorid + '_size').sizestate = ''; + } + $(editorid + '_size').innerHTML = ss; + $(editorid + '_size').sizestate = ss; + } +} + +function buttonContext(obj, state) { + if(state == 'mouseover') { + obj.style.cursor = 'pointer'; + var mode = obj.state ? 'down' : 'hover'; + if(obj.mode != mode) { + obj.mode = mode; + obj.className = 'hover'; + } + } else { + var mode = obj.state ? 'selected' : 'normal'; + if(obj.mode != mode) { + obj.mode = mode; + obj.className = mode == 'selected' ? 'hover' : ''; + } + } +} + +function formatFontsize(csssize) { + switch(csssize) { + case '7.5pt': + case '10px': return 1; + case '13px': + case '10pt': return 2; + case '16px': + case '12pt': return 3; + case '18px': + case '14pt': return 4; + case '24px': + case '18pt': return 5; + case '32px': + case '24pt': return 6; + case '48px': + case '36pt': return 7; + default: return '大小'; + } +} + +function showEditorMenu(tag, params) { + var sel, selection; + var str = '', strdialog = 0, stitle = ''; + var ctrlid = editorid + (params ? '_cst' + params + '_' : '_') + tag; + var opentag = '[' + tag + ']'; + var closetag = '[/' + tag + ']'; + var menu = $(ctrlid + '_menu'); + var pos = [0, 0]; + var menuwidth = 270; + var menupos = '43!'; + var menutype = 'menu'; + + try { + sel = wysiwyg ? editdoc.selection.createRange() : document.selection.createRange(); + selection = wysiwyg ? sel.htmlText : sel.text; + } catch(e) { + if (wysiwyg) { + var gSel = editdoc.getSelection(); + if (gSel.rangeCount > 0) { + sel = gSel.getRangeAt(0); + } + } + selection = getSel(); + } + + if(menu) { + if($(ctrlid).getAttribute('menupos') !== null) { + menupos = $(ctrlid).getAttribute('menupos'); + } + if($(ctrlid).getAttribute('menuwidth') !== null) { + menu.style.width = $(ctrlid).getAttribute('menuwidth') + 'px'; + } + if(menupos == '00') { + menu.className = 'fwinmask'; + if($(editorid + '_' + tag + '_menu').style.visibility == 'hidden') { + $(editorid + '_' + tag + '_menu').style.visibility = 'visible'; + } else { + showMenu({'ctrlid':ctrlid,'mtype':'win','evt':'click','pos':menupos,'timeout':250,'duration':3,'drag':ctrlid + '_ctrl'}); + } + } else { + showMenu({'ctrlid':ctrlid,'evt':'click','pos':menupos,'timeout':250,'duration':in_array(tag, ['fontname', 'fontsize', 'sml']) ? 2 : 3,'drag':1}); + } + + + } else { + switch(tag) { + case 'url': + str = '请输入链接地址:
                  '+ + (selection ? '' : '
                  请输入链接文字:
                  '); + break; + case 'forecolor': + showColorBox(ctrlid, 1); + return; + case 'backcolor': + showColorBox(ctrlid, 1, '', 1); + return; + case 'inserthorizontalrule': + showHrBox(ctrlid); + break; + case 'postbg': + showHrBox(ctrlid, 'postbg'); + break; + case 'password': + str = '

                  请输入文章密码:

                  '; + break; + case 'code': + if(wysiwyg) { + opentag = '
                  '; + closetag = '

                  '; + } + case 'quote': + if(wysiwyg && tag == 'quote') { + opentag = '
                  '; + closetag = '

                  '; + } + case 'hide': + case 'free': + if(selection) { + return insertText((opentag + selection + closetag), strlen(opentag), strlen(closetag), true, sel); + } + var lang = {'quote' : '请输入要插入的引用', 'code' : '请输入要插入的代码', 'hide' : '请输入要隐藏的信息内容', 'free' : '如果您设置了文章售价,请输入购买前免费可见的信息内容'}; + str += lang[tag] + ':
                  ' + + (tag == 'hide' ? '

                  时才显示


                  距离发帖日期大于这个天数时标签自动失效' : ''); + break; + case 'tbl': + str = '

                  表格行数:   表格列数:

                  表格宽度:   背景颜色:

                  快速书写表格提示

                  '; + str += ''; + break; + case 'aud': + str = '

                  请输入音乐文件地址:

                  支持 wma mp3 ra rm 等音乐格式
                  示例: http://server/audio.wma

                  '; + break; + case 'vid': + str = '

                  请输入视频地址:

                  宽:   高:

                  支持优酷、土豆、56、酷6等视频站的视频网址
                  支持 wmv avi rmvb mov swf flv 等视频格式
                  示例: http://server/movie.wmv

                  '; + break; + case 'fls': + str = '

                  请输入 Flash 文件地址:

                  宽:   高:

                  支持 swf flv 等 Flash 网址
                  示例: http://server/flash.swf

                  '; + break; + case 'beginning': + str = '

                  请输入开头动画 Flash 或 图片 地址:

                  '; + str += '

                  点击链接地址:

                  '; + str += '

                  宽:   高:

                  '; + str += '

                  停留秒数:

                  '; + str += '

                  载入、消失的效果:

                  无   淡入淡出   展开闭合

                  '; + str += '

                  支持 swf flv jpg gif png 网址
                  宽高范围: 宽400~1024 高300~640
                  示例: http://server/flash.swf

                  '; + break; + case 'pasteword': + stitle = '从 Word 粘贴内容'; + str = '

                  请通过快捷键(Ctrl+V)把 Word 文件中的内容粘贴到上方

                  '; + menuwidth = 600; + menupos = '00'; + menutype = 'win'; + break; + case 'index': + stitle = '创建文章目录'; + str = '

                  [index]
                  \n\ + [#页码]标题   跳转到指定的页
                  \n\ + *[#tid,pid]标题   跳转到指定的文章
                  \n\ + [/index]
                  \n\ +
                  \n\ + 页码   用 [page] 对当前文章分页后的页码
                  \n\ + tid,pid   文章的 TID 和 PID
                  \n\ + *   添加行首缩进

                  '; + break; + default: + for(i in EXTRAFUNC['showEditorMenu']) { + EXTRASELECTION = selection; + EXTRASEL = sel; + try { + eval('str = ' + EXTRAFUNC['showEditorMenu'][i] + '(\'' + tag + '\', 0)'); + } catch(e) {} + } + if(!str) { + str = ''; + var haveSel = selection == null || selection == false || in_array(trim(selection), ['', 'null', 'undefined', 'false']) ? 0 : 1; + if(params == 1 && haveSel) { + return insertText((opentag + selection + closetag), strlen(opentag), strlen(closetag), true, sel); + } + var promptlang = custombbcodes[tag]['prompt'].split("\t"); + for(var i = 1; i <= params; i++) { + if(i != params || !haveSel) { + str += (promptlang[i - 1] ? promptlang[i - 1] : '请输入第 ' + i + ' 个参数:') + '
                  ' + (i < params ? '
                  ' : ''); + } + } + } + break; + } + + var menu = document.createElement('div'); + menu.id = ctrlid + '_menu'; + menu.style.display = 'none'; + menu.className = 'p_pof upf'; + menu.style.width = menuwidth + 'px'; + if(menupos == '00') { + menu.className = 'fwinmask'; + s = '
                    ' + + '

                  ' + stitle + '关闭

                  ' + str + '
                  ' + + '

                  ' + + '
                  '; + } else { + s = '
                  关闭
                  ' + str + '
                  '; + } + menu.innerHTML = s; + $(editorid + '_editortoolbar').appendChild(menu); + showMenu({'ctrlid':ctrlid,'mtype':menutype,'evt':'click','duration':3,'cache':0,'drag':1,'pos':menupos}); + } + + try { + if($(ctrlid + '_param_1')) { + $(ctrlid + '_param_1').focus(); + } + } catch(e) {} + var objs = menu.getElementsByTagName('*'); + for(var i = 0; i < objs.length; i++) { + _attachEvent(objs[i], 'keydown', function(e) { + e = e ? e : event; + obj = BROWSER.ie ? event.srcElement : e.target; + if((obj.type == 'text' && e.keyCode == 13) || (obj.type == 'textarea' && e.ctrlKey && e.keyCode == 13)) { + if($(ctrlid + '_submit') && tag != 'image') $(ctrlid + '_submit').click(); + doane(e); + } else if(e.keyCode == 27) { + hideMenu(); + doane(e); + } + }); + } + if($(ctrlid + '_submit')) $(ctrlid + '_submit').onclick = function() { + checkFocus(); + switch(tag) { + case 'url': + var href = $(ctrlid + '_param_1').value; + href = (isEmail(href) ? 'mailto:' : '') + href; + if(href != '') { + var v = selection ? selection : ($(ctrlid + '_param_2').value ? $(ctrlid + '_param_2').value : href); + str = wysiwyg ? ('' + v + '') : '[url=' + squarestrip(href) + ']' + v + '[/url]'; + if(wysiwyg) { + insertText(str, str.length - v.length, 0, (selection ? true : false), sel); + } else { + insertText(str, str.length - v.length - 6, 6, (selection ? true : false), sel); + } + } + break; + case 'code': + if(wysiwyg) { + var isCodeTag = 1 ; + opentag = '
                  '; + closetag = '

                  '; + if(!BROWSER.ie) { + selection = selection ? selection : '\n'; + } + } + case 'quote': + if(wysiwyg && tag == 'quote') { + opentag = '
                  '; + closetag = '

                  '; + if(!BROWSER.ie) { + selection = selection ? selection : '\n'; + } + } + case 'hide': + case 'free': + if(tag == 'hide') { + var mincredits = parseInt($(ctrlid + '_param_2').value); + var expire = parseInt($(ctrlid + '_param_3').value); + if(expire > 0 || (mincredits > 0 && $(ctrlid + '_radio_2').checked)) { + opentag = '[hide='; + if(expire > 0) { + opentag += 'd'+expire; + } + if(mincredits > 0 && $(ctrlid + '_radio_2').checked) { + opentag += (expire > 0 ? ',' : '')+mincredits; + } + opentag += ']'; + } else { + opentag = '[hide]'; + } + } + str = $(ctrlid + '_param_1') && $(ctrlid + '_param_1').value ? $(ctrlid + '_param_1').value : (selection ? selection : ''); + if(wysiwyg) { + if(typeof isCodeTag != 'undefined') { + str = str.replace(/&/g, '&'); + } + str = preg_replace(['<', '>'], ['<', '>'], str); + str = str.replace(/\r?\n/g, '
                  '); + } + str = opentag + str + closetag; + insertText(str, strlen(opentag), strlen(closetag), false, sel); + break; + case 'password': + str = $(ctrlid + '_param_1') && $(ctrlid + '_param_1').value ? $(ctrlid + '_param_1').value : (selection ? selection : ''); + str = opentag + str + closetag; + insertText(str, strlen(opentag), strlen(closetag), false, sel); + break; + case 'tbl': + var rows = $(ctrlid + '_param_1').value; + var columns = $(ctrlid + '_param_2').value; + var width = $(ctrlid + '_param_3').value; + var bgcolor = $(ctrlid + '_param_4').value; + rows = /^[-\+]?\d+$/.test(rows) && rows > 0 && rows <= 30 ? rows : 2; + columns = /^[-\+]?\d+$/.test(columns) && columns > 0 && columns <= 30 ? columns : 2; + width = width.substr(width.length - 1, width.length) == '%' ? (width.substr(0, width.length - 1) <= 98 ? width : '98%') : (width <= 560 ? width : '98%'); + bgcolor = /[\(\)%,#\w]+/.test(bgcolor) ? bgcolor : ''; + if(wysiwyg) { + str = ''; + for (var row = 0; row < rows; row++) { + str += '\n'; + for (col = 0; col < columns; col++) { + str += '\n'; + } + str += '\n'; + } + str += '
                   
                  \n'; + } else { + str = '[table=' + (width ? width : '50%') + (bgcolor ? ',' + bgcolor : '') + ']\n'; + for (var row = 0; row < rows; row++) { + str += '[tr]'; + for (col = 0; col < columns; col++) { + str += '[td] [/td]'; + } + str += '[/tr]\n'; + } + str += '[/table]\n'; + } + insertText(str, str.length, 0, false, sel); + break; + case 'aud': + insertText('[audio]' + $(ctrlid + '_param_1').value + '[/audio]', 7, 8, false, sel); + break; + case 'fls': + if($(ctrlid + '_param_2').value && $(ctrlid + '_param_3').value) { + insertText('[flash=' + parseInt($(ctrlid + '_param_2').value) + ',' + parseInt($(ctrlid + '_param_3').value) + ']' + squarestrip($(ctrlid + '_param_1').value) + '[/flash]', 7, 8, false, sel); + } else { + insertText('[flash]' + squarestrip($(ctrlid + '_param_1').value) + '[/flash]', 7, 8, false, sel); + } + break; + case 'beginning': + if($(ctrlid + '_param_1').value) { + insertText('[begin=' + squarestrip($(ctrlid + '_param_2').value) + ',' + + ($(ctrlid + '_param_3').value ? parseInt($(ctrlid + '_param_3').value) : 0) + ',' + + ($(ctrlid + '_param_4').value ? parseInt($(ctrlid + '_param_4').value) : 0) + ',' + + ($(ctrlid + '_param_5').checked ? 2 : ($(ctrlid + '_param_6').checked ? 1 : 0)) + ',' + + ($(ctrlid + '_param_8').value ? parseInt($(ctrlid + '_param_8').value) : 0) + ']' + + squarestrip($(ctrlid + '_param_1').value) + '[/begin]', 7, 8, false, sel); + } + break; + case 'vid': + var mediaUrl = $(ctrlid + '_param_1').value; + var auto = ''; + var posque = mediaUrl.lastIndexOf('?'); + posque = posque === -1 ? mb_strlen(mediaUrl) : posque; + var ext = mediaUrl.lastIndexOf('.') === -1 ? '' : mediaUrl.substring(mediaUrl.lastIndexOf('.') + 1, posque).toLowerCase(); + ext = in_array(ext, ['mp3', 'wav', 'wma', 'ra', 'rm', 'ram', 'mid', 'asx', 'wmv', 'avi', 'mpg', 'mpeg', 'rmvb', 'asf', 'mov', 'flv', 'swf', 'mp4', 'm4a', 'm4v', '3gp', 'ogv', 'ogg', 'webm', 'weba', 'aac', 'flac']) ? ext : 'x'; + if(ext == 'x') { + if(/^mms:\/\//.test(mediaUrl)) { + ext = 'mms'; + } else if(/^(rtsp|pnm):\/\//.test(mediaUrl)) { + ext = 'rtsp'; + } + } + var str = '[media=' + ext + ',' + $(ctrlid + '_param_2').value + ',' + $(ctrlid + '_param_3').value + ']' + squarestrip(mediaUrl) + '[/media]'; + insertText(str, str.length, 0, false, sel); + break; + case 'image': + var width = parseInt($(ctrlid + '_param_2').value); + var height = parseInt($(ctrlid + '_param_3').value); + var src = $(ctrlid + '_param_1').value; + var style = ''; + if(wysiwyg) { + style += width ? ' width=' + width : ''; + style += height ? ' _height=' + height : ''; + var str = ''; + insertText(str, str.length, 0, false, sel); + } else { + style += width || height ? '=' + width + ',' + height : ''; + insertText('[img' + style + ']' + squarestrip(src) + '[/img]', 0, 0, false, sel); + } + hideMenu('', 'win'); + $(ctrlid + '_param_1').value = ''; + break; + case 'pasteword': + pasteWord($(ctrlid + '_param_1').contentWindow.document.body.innerHTML); + hideMenu('', 'win'); + break; + case 'index': + if(wysiwyg) { + str = '[index]
                  [#]
                  [#]
                  [/index]'; + } else { + str = '[index]\n[#]\n[#]\n[/index]'; + } + insertText(str, str.length, 0, false, sel); + hideMenu('', 'win'); + break; + default: + for(i in EXTRAFUNC['showEditorMenu']) { + EXTRASELECTION= selection; + try { + eval('str = ' + EXTRAFUNC['showEditorMenu'][i] + '(\'' + tag + '\', 1)'); + } catch(e) {} + } + if(!str) { + str = ''; + var first = $(ctrlid + '_param_1').value; + if($(ctrlid + '_param_2')) var second = $(ctrlid + '_param_2').value; + if($(ctrlid + '_param_3')) var third = $(ctrlid + '_param_3').value; + if((params == 1 && first) || (params == 2 && first && (haveSel || second)) || (params == 3 && first && second && (haveSel || third))) { + if(params == 1) { + str = first; + } else if(params == 2) { + str = haveSel ? selection : second; + opentag = '[' + tag + '=' + first + ']'; + } else { + str = haveSel ? selection : third; + opentag = '[' + tag + '=' + first + ',' + second + ']'; + } + insertText((opentag + str + closetag), strlen(opentag), strlen(closetag), true, sel); + } + } + break; + } + hideMenu(); + }; +} + +function autoTypeset() { + var sel; + if(BROWSER.ie) { + sel = wysiwyg ? editdoc.selection.createRange() : document.selection.createRange(); + } + var selection = sel ? (wysiwyg ? sel.htmlText.replace(/<\/?p>/ig, '
                  ') : sel.text) : getSel(); + selection = trim(selection); + selection = wysiwyg ? selection.replace(/()+/ig, '

                  \n

                  ') : selection.replace(/\n\n+/g, '[/p]\n[p=30, 2, left]'); + opentag = wysiwyg ? '

                  ' : '[p=30, 2, left]'; + var s = opentag + selection + (wysiwyg ? '

                  ' : '[/p]'); + insertText(s, strlen(opentag), 4, false, sel); + hideMenu(); +} + +function getSel() { + if(wysiwyg) { + try { + selection = editwin.getSelection(); + checkFocus(); + range = selection ? selection.getRangeAt(0) : editdoc.createRange(); + return readNodes(range.cloneContents(), false); + } catch(e) { + try { + var range = editdoc.selection.createRange(); + if(range.htmlText && range.text) { + return range.htmlText; + } else { + var htmltext = ''; + for(var i = 0; i < range.length; i++) { + htmltext += range.item(i).outerHTML; + } + return htmltext; + } + } catch(e) { + return ''; + } + } + } else { + if(!isUndefined(editdoc.selectionStart)) { + return editdoc.value.substr(editdoc.selectionStart, editdoc.selectionEnd - editdoc.selectionStart); + } else if(document.selection && document.selection.createRange) { + return document.selection.createRange().text; + } else if(window.getSelection) { + return window.getSelection() + ''; + } else { + return false; + } + } +} + +function insertText(text, movestart, moveend, select, sel) { + checkFocus(); + if(wysiwyg) { + try { + if(!editdoc.execCommand('insertHTML', false, text)) { + throw 'insertHTML Err'; + } + } catch(e) { + try { + if(!isUndefined(editdoc.selection) && editdoc.selection.type != 'Text' && editdoc.selection.type != 'None') { + movestart = false; + editdoc.selection.clear(); + } + range = isUndefined(sel) ? editdoc.selection.createRange() : sel; + range.pasteHTML(text); + if(text.indexOf('\n') == -1) { + if(!isUndefined(movestart)) { + range.moveStart('character', -strlen(text) + movestart); + range.moveEnd('character', -moveend); + } else if(movestart != false) { + range.moveStart('character', -strlen(text)); + } + if(!isUndefined(select) && select) { + range.select(); + } + } + } catch(e) { + if(!sel) { + var sel = editdoc.getSelection(); + if (sel.rangeCount == 0) { + sel.collapse(editdoc.body, 0); + } + var range = sel.getRangeAt(0); + } else { + var range = sel; + } + if(range && range.insertNode) { + range.deleteContents(); + } + var frag = range.createContextualFragment(text); + range.insertNode(frag); + } + } + } else { + if(!isUndefined(editdoc.selectionStart)) { + if(editdoc._selectionStart) { + editdoc.selectionStart = editdoc._selectionStart; + editdoc.selectionEnd = editdoc._selectionEnd; + editdoc._selectionStart = 0; + editdoc._selectionEnd = 0; + } + var opn = editdoc.selectionStart + 0; + editdoc.value = editdoc.value.substr(0, editdoc.selectionStart) + text + editdoc.value.substr(editdoc.selectionEnd); + + if(!isUndefined(movestart)) { + editdoc.selectionStart = opn + movestart; + editdoc.selectionEnd = opn + strlen(text) - moveend; + } else if(movestart !== false) { + editdoc.selectionStart = opn; + editdoc.selectionEnd = opn + strlen(text); + } + } else if(document.selection && document.selection.createRange) { + if(isUndefined(sel)) { + sel = document.selection.createRange(); + } + if(editbox.sel) { + sel = editbox.sel; + editbox.sel = null; + } + sel.text = text.replace(/\r?\n/g, '\r\n'); + if(!isUndefined(movestart)) { + sel.moveStart('character', -strlen(text) +movestart); + sel.moveEnd('character', -moveend); + } else if(movestart !== false) { + sel.moveStart('character', -strlen(text)); + } + sel.select(); + } else { + editdoc.value += text; + } + } + checkFocus(); +} + +function stripSimple(tag, str, iterations) { + var opentag = '[' + tag + ']'; + var closetag = '[/' + tag + ']'; + + if(isUndefined(iterations)) { + iterations = -1; + } + while((startindex = stripos(str, opentag)) !== false && iterations != 0) { + iterations --; + if((stopindex = stripos(str, closetag)) !== false) { + var text = str.substr(startindex + opentag.length, stopindex - startindex - opentag.length); + str = str.substr(0, startindex) + text + str.substr(stopindex + closetag.length); + } else { + break; + } + } + return str; +} + +function readNodes(root, toptag) { + var html = ""; + var moz_check = /_moz/i; + + switch(root.nodeType) { + case Node.ELEMENT_NODE: + case Node.DOCUMENT_FRAGMENT_NODE: + var closed; + if(toptag) { + closed = !root.hasChildNodes(); + html = '<' + root.tagName.toLowerCase(); + var attr = root.attributes; + for(var i = 0; i < attr.length; ++i) { + var a = attr.item(i); + if(!a.specified || a.name.match(moz_check) || a.value.match(moz_check)) { + continue; + } + html += " " + a.name.toLowerCase() + '="' + a.value + '"'; + } + html += closed ? " />" : ">"; + } + for(var i = root.firstChild; i; i = i.nextSibling) { + html += readNodes(i, true); + } + if(toptag && !closed) { + html += ""; + } + break; + + case Node.TEXT_NODE: + html = htmlspecialchars(root.data); + break; + } + return html; +} + +function stripComplex(tag, str, iterations) { + var opentag = '[' + tag + '='; + var closetag = '[/' + tag + ']'; + + if(isUndefined(iterations)) { + iterations = -1; + } + while((startindex = stripos(str, opentag)) !== false && iterations != 0) { + iterations --; + if((stopindex = stripos(str, closetag)) !== false) { + var openend = stripos(str, ']', startindex); + if(openend !== false && openend > startindex && openend < stopindex) { + var text = str.substr(openend + 1, stopindex - openend - 1); + str = str.substr(0, startindex) + text + str.substr(stopindex + closetag.length); + } else { + break; + } + } else { + break; + } + } + return str; +} + +function stripos(haystack, needle, offset) { + if(isUndefined(offset)) { + offset = 0; + } + var index = haystack.toLowerCase().indexOf(needle.toLowerCase(), offset); + + return (index == -1 ? false : index); +} + +function switchEditor(mode) { + if(mode == wysiwyg || !allowswitcheditor) { + return; + } + if(!mode) { + var controlbar = $(editorid + '_controls'); + var controls = []; + var buttons = controlbar.getElementsByTagName('a'); + var buttonslength = buttons.length; + for(var i = 0; i < buttonslength; i++) { + if(buttons[i].id) { + controls[controls.length] = buttons[i].id; + } + } + var controlslength = controls.length; + for(var i = 0; i < controlslength; i++) { + var control = $(controls[i]); + + if(control.id.indexOf(editorid + '_') != -1) { + control.state = false; + control.mode = 'normal'; + } else if(control.id.indexOf(editorid + '_popup_') != -1) { + control.state = false; + } + } + setContext('clear'); + } + cursor = -1; + stack = []; + var parsedtext = getEditorContents(); + parsedtext = mode ? bbcode2html(parsedtext) : html2bbcode(parsedtext); + wysiwyg = mode; + $(editorid + '_mode').value = mode; + + newEditor(mode, parsedtext); + setEditorStyle(); + editwin.focus(); + setCaretAtEnd(); +} + +function setCaretAtEnd() { + if(wysiwyg) { + editdoc.body.innerHTML += ''; + } else { + editdoc.value += ''; + } +} + +function moveCursor(increment) { + var test = cursor + increment; + if(test >= 0 && stack[test] != null && !isUndefined(stack[test])) { + cursor += increment; + } +} + +function addSnapshot(str) { + if(stack[cursor] == str) { + return; + } else { + cursor++; + stack[cursor] = str; + + if(!isUndefined(stack[cursor + 1])) { + stack[cursor + 1] = null; + } + } +} + +function getSnapshot() { + if(!isUndefined(stack[cursor]) && stack[cursor] != null) { + return stack[cursor]; + } else { + return false; + } +} + +function squarestrip(str) { + str = str.replace('[', '%5B'); + str = str.replace(']', '%5D'); + return str; +} + +function loadimgsize(imgurl, editor, p) { + var editor = !editor ? editorid : editor; + var s = new Object(); + var p = !p ? '_image' : p; + $(editor + p + '_param_2').value = ''; + $(editor + p + '_param_3').value = ''; + s.img = new Image(); + s.img.src = imgurl; + s.loadCheck = function () { + if($(editor + p + '_param_1').value == imgurl) { + if(s.img.complete) { + $(editor + p + '_param_2').value = s.img.width ? s.img.width : ''; + $(editor + p + '_param_3').value = s.img.height ? s.img.height : ''; + } else { + setTimeout(function () {s.loadCheck();}, 100); + } + } + }; + s.loadCheck(); +} + +function showHrBox(ctrlid, boxtype) { + if(typeof postimg_type == 'undefined') { + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.charset = charset ? charset : (BROWSER.firefox ? document.characterSet : document.charset); + scriptNode.src = 'data/cache/common_postimg.js?' + VERHASH; + $('append_parent').appendChild(scriptNode); + if(BROWSER.ie) { + scriptNode.onreadystatechange = function() { + _initHrBox(ctrlid, boxtype); + }; + } else { + scriptNode.onload = function() { + _initHrBox(ctrlid, boxtype); + }; + } + } else { + _initHrBox(ctrlid, boxtype); + } +} +function _initHrBox(ctrlid, boxtype) { + if(!$(ctrlid + '_menu')) { + var menu = document.createElement('div'); + menu.id = ctrlid + '_menu'; + menu.unselectable = true; + menu.style.display = 'none'; + if(boxtype == 'postbg') { + menu.className = 'p_pop postbgbox'; + var imglist = postimg_type['postbg']; + var str = ''; + for(var i = 0; i < imglist.length; i++) { + str += '' ; + } + } else { + menu.className = 'p_pop hrbox'; + var hrimglist = postimg_type['hrline']; + var str = ''; + for(var i = 0; i < hrimglist.length; i++) { + inserturl = (hrimglist[i] != '0.gif') ? "'"+STATICURL+'image/hrline/'+hrimglist[i]+"'" : 'false'; + str += '' ; + } + } + menu.innerHTML = str; + $('append_parent').appendChild(menu); + } +} +function insertHrImage(url) { + checkFocus(); + if(wysiwyg) { + if(url !== false) { + insertText('


                  ', false); + } else { + insertText('
                  ', 14); + } + } else { + if(url !== false) { + code = '\n[img]'+url+'[/img]\n'; + } else { + code = '[hr]'; + } + insertText(code, strlen(code), 0); + } + hideMenu(); +} +function insertPostBackground(img) { + checkFocus(); + if(img != '0.gif') { + code = '[postbg]'+img+'[/postbg]'; + if(wysiwyg) { + postbgElement = !BROWSER.ie ? editdoc.getElementsByName('editorpostbg') : editdoc.getElementsByTagName('style'); + for(var i = 0; i < postbgElement.length; i++) { + postbgElement[i].parentNode.removeChild(postbgElement[i]); + } + editdoc.body.innerHTML += ''; + } else { + editdoc.value = editdoc.value.replace(/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/ig, ''); + editdoc.value = editdoc.value+code; + } + } else { + if(wysiwyg) { + postbgElement = !BROWSER.ie ? editdoc.getElementsByName('editorpostbg') : editdoc.getElementsByTagName('style'); + for(var i = 0; i < postbgElement.length; i++) { + postbgElement[i].parentNode.removeChild(postbgElement[i]); + } + } else { + editdoc.value = editdoc.value.replace(/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/ig, ''); + } + } + hideMenu(); +} + +if(typeof jsloaded == 'function') { + jsloaded('editor'); +} \ No newline at end of file diff --git a/static/js/fileprogress.js b/static/js/fileprogress.js new file mode 100644 index 0000000..9dda0ca --- /dev/null +++ b/static/js/fileprogress.js @@ -0,0 +1,191 @@ +/* + A simple class for displaying file information and progress + Note: This is a demonstration only and not part of SWFUpload. + Note: Some have had problems adapting this class in IE7. It may not be suitable for your application. +*/ + +function FileProgress(file, targetID) { + this.fileProgressID = file.id; + + this.opacity = 100; + this.height = 0; + + + this.fileProgressWrapper = document.getElementById(this.fileProgressID); + if (!this.fileProgressWrapper) { + this.fileProgressWrapper = document.createElement("div"); + this.fileProgressWrapper.className = "progressWrapper"; + this.fileProgressWrapper.id = this.fileProgressID; + + this.fileProgressElement = document.createElement("div"); + this.fileProgressElement.className = "progressContainer"; + + var progressCancel = document.createElement("a"); + progressCancel.className = "progressCancel"; + progressCancel.href = "#"; + progressCancel.style.visibility = "hidden"; + progressCancel.appendChild(document.createTextNode(" ")); + + var progressText = document.createElement("div"); + progressText.className = "progressName"; + progressText.appendChild(document.createTextNode(file.name)); + + var progressBar = document.createElement("div"); + progressBar.className = "progressBarInProgress"; + + var progressStatus = document.createElement("div"); + progressStatus.className = "progressBarStatus"; + progressStatus.innerHTML = " "; + + this.fileProgressElement.appendChild(progressCancel); + this.fileProgressElement.appendChild(progressText); + this.fileProgressElement.appendChild(progressStatus); + this.fileProgressElement.appendChild(progressBar); + + this.fileProgressWrapper.appendChild(this.fileProgressElement); + + document.getElementById(targetID).appendChild(this.fileProgressWrapper); + } else { + this.fileProgressElement = this.fileProgressWrapper.firstChild; + this.reset(); + } + + this.height = this.fileProgressWrapper.offsetHeight; + this.setTimer(null); + + +} + +FileProgress.prototype.setTimer = function (timer) { + this.fileProgressElement["FP_TIMER"] = timer; +}; +FileProgress.prototype.getTimer = function (timer) { + return this.fileProgressElement["FP_TIMER"] || null; +}; + +FileProgress.prototype.reset = function () { + this.fileProgressElement.className = "progressContainer"; + + this.fileProgressElement.childNodes[2].innerHTML = " "; + this.fileProgressElement.childNodes[2].className = "progressBarStatus"; + + this.fileProgressElement.childNodes[3].className = "progressBarInProgress"; + this.fileProgressElement.childNodes[3].style.width = "0%"; + + this.appear(); +}; + +FileProgress.prototype.setProgress = function (percentage) { + this.fileProgressElement.className = "progressContainer green"; + this.fileProgressElement.childNodes[3].className = "progressBarInProgress"; + this.fileProgressElement.childNodes[3].style.width = percentage + "%"; + + this.appear(); +}; +FileProgress.prototype.setComplete = function () { + this.fileProgressElement.className = "progressContainer blue"; + this.fileProgressElement.childNodes[3].className = "progressBarComplete"; + this.fileProgressElement.childNodes[3].style.width = ""; + +}; +FileProgress.prototype.setError = function () { + this.fileProgressElement.className = "progressContainer red"; + this.fileProgressElement.childNodes[3].className = "progressBarError"; + this.fileProgressElement.childNodes[3].style.width = ""; + + var oSelf = this; + this.setTimer(setTimeout(function () { + oSelf.disappear(); + }, 5000)); +}; +FileProgress.prototype.setCancelled = function () { + this.fileProgressElement.className = "progressContainer"; + this.fileProgressElement.childNodes[3].className = "progressBarError"; + this.fileProgressElement.childNodes[3].style.width = ""; + + var oSelf = this; + this.setTimer(setTimeout(function () { + oSelf.disappear(); + }, 2000)); +}; +FileProgress.prototype.setStatus = function (status) { + this.fileProgressElement.childNodes[2].innerHTML = status; +}; + +FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) { + this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden"; + if (swfUploadInstance) { + var fileID = this.fileProgressID; + this.fileProgressElement.childNodes[0].onclick = function () { + swfUploadInstance.cancelUpload(fileID); + return false; + }; + } +}; + +FileProgress.prototype.appear = function () { + if (this.getTimer() !== null) { + clearTimeout(this.getTimer()); + this.setTimer(null); + } + + if (this.fileProgressWrapper.filters) { + try { + this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = 100; + } catch (e) { + this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)"; + } + } else { + this.fileProgressWrapper.style.opacity = 1; + } + + this.fileProgressWrapper.style.height = ""; + + this.height = this.fileProgressWrapper.offsetHeight; + this.opacity = 100; + this.fileProgressWrapper.style.display = ""; + +}; + +FileProgress.prototype.disappear = function () { + + var reduceOpacityBy = 15; + var reduceHeightBy = 4; + var rate = 30; // 15 fps + + if (this.opacity > 0) { + this.opacity -= reduceOpacityBy; + if (this.opacity < 0) { + this.opacity = 0; + } + + if (this.fileProgressWrapper.filters) { + try { + this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity; + } catch (e) { + this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")"; + } + } else { + this.fileProgressWrapper.style.opacity = this.opacity / 100; + } + } + + if (this.height > 0) { + this.height -= reduceHeightBy; + if (this.height < 0) { + this.height = 0; + } + + this.fileProgressWrapper.style.height = this.height + "px"; + } + + if (this.height > 0 || this.opacity > 0) { + var oSelf = this; + this.setTimer(setTimeout(function () { + oSelf.disappear(); + }, rate)); + } else { + this.fileProgressWrapper.style.display = "none"; + this.setTimer(null); + } +}; \ No newline at end of file diff --git a/static/js/forum.js b/static/js/forum.js new file mode 100644 index 0000000..5e7c9ea --- /dev/null +++ b/static/js/forum.js @@ -0,0 +1,748 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: forum.js 33824 2013-08-19 08:26:11Z nemohou $ +*/ + +function saveData(ignoreempty) { + var ignoreempty = isUndefined(ignoreempty) ? 0 : ignoreempty; + var obj = $('postform') && (($('fwin_newthread') && $('fwin_newthread').style.display == '') || ($('fwin_reply') && $('fwin_reply').style.display == '')) ? $('postform') : ($('fastpostform') ? $('fastpostform') : $('postform')); + if(!obj) return; + var bbcode = (typeof wysiwyg != 'undefined' && wysiwyg == 1) ? html2bbcode(editdoc.body.innerHTML) : obj.message.value; + if(typeof isfirstpost != 'undefined') { + if(typeof wysiwyg != 'undefined' && wysiwyg == 1) { + var messageisnull = trim(bbcode) === ''; + } else { + var messageisnull = bbcode === ''; + } + if(isfirstpost && (messageisnull && $('postform').subject.value === '')) { + return; + } + if(!isfirstpost && messageisnull) { + return; + } + } + var data = subject = message = ''; + for(var i = 0; i < obj.elements.length; i++) { + var el = obj.elements[i]; + if(el.name != '' && (el.tagName == 'SELECT' || el.tagName == 'TEXTAREA' || el.tagName == 'INPUT' && (el.type == 'text' || el.type == 'checkbox' || el.type == 'radio' || el.type == 'hidden' || el.type == 'select')) && el.name.substr(0, 6) != 'attach') { + var elvalue = el.value; + if(el.name == 'subject') { + subject = trim(elvalue); + } else if(el.name == 'message') { + if(typeof wysiwyg != 'undefined' && wysiwyg == 1) { + elvalue = bbcode; + } + message = trim(elvalue); + } + if((el.type == 'checkbox' || el.type == 'radio') && !el.checked) { + continue; + } else if(el.tagName == 'SELECT') { + elvalue = el.value; + } else if(el.type == 'hidden') { + if(el.id) { + eval('var check = typeof ' + el.id + '_upload == \'function\''); + if(check) { + elvalue = elvalue; + if($(el.id + '_url')) { + elvalue += String.fromCharCode(1) + $(el.id + '_url').value; + } + } else { + continue; + } + } else { + continue; + } + } + if(trim(elvalue)) { + data += el.name + String.fromCharCode(9) + el.tagName + String.fromCharCode(9) + el.type + String.fromCharCode(9) + elvalue + String.fromCharCode(9, 9); + } + } + } + + if(!subject && !message && !ignoreempty) { + return; + } + + saveUserdata('forum_'+discuz_uid, data); +} + +function fastUload() { + appendscript(JSPATH + 'forum_post.js?' + VERHASH); + safescript('forum_post_js', function () { uploadWindow(function (aid, url) {updatefastpostattach(aid, url)}, 'file') }, 100, 50); +} + +function switchAdvanceMode(url) { + var obj = $('postform') && (($('fwin_newthread') && $('fwin_newthread').style.display == '') || ($('fwin_reply') && $('fwin_reply').style.display == '')) ? $('postform') : $('fastpostform'); + if(obj && obj.message.value != '') { + saveData(); + url += (url.indexOf('?') != -1 ? '&' : '?') + 'cedit=yes'; + } + location.href = url; + return false; +} + +function sidebar_collapse(lang) { + if(lang[0]) { + toggle_collapse('sidebar', null, null, lang); + $('wrap').className = $('wrap').className == 'wrap with_side s_clear' ? 'wrap s_clear' : 'wrap with_side s_clear'; + } else { + var collapsed = getcookie('collapse'); + collapsed = updatestring(collapsed, 'sidebar', 1); + setcookie('collapse', collapsed, (collapsed ? 2592000 : -2592000)); + location.reload(); + } +} + +function keyPageScroll(e, prev, next, url, page) { + if(loadUserdata('is_blindman')) { + return true; + } + e = e ? e : window.event; + var tagname = BROWSER.ie ? e.srcElement.tagName : e.target.tagName; + if(tagname == 'INPUT' || tagname == 'TEXTAREA') return; + actualCode = e.keyCode ? e.keyCode : e.charCode; + if(next && actualCode == 39) { + window.location = url + '&page=' + (page + 1); + } + if(prev && actualCode == 37) { + window.location = url + '&page=' + (page - 1); + } +} + +function announcement() { + var ann = new Object(); + ann.anndelay = 3000; + ann.annst = 0; + ann.annstop = 0; + ann.annrowcount = 0; + ann.anncount = 0; + ann.annScrollTopBegin = 0; + ann.annlis = $('anc').getElementsByTagName("li"); + ann.annrows = new Array(); + ann.announcementScroll = function() { + if (this.annstop) { + this.annst = setTimeout(function() { + ann.announcementScroll(); + }, this.anndelay); + return; + } + if (!this.annst) { + var lasttop = -1; + for (i = 0; i < this.annlis.length; i++) { + if (lasttop != this.annlis[i].offsetTop) { + this.annrows[this.annrowcount] = this.annlis[i].offsetTop - this.annlis[0].offsetTop; + this.annrowcount++; + } + lasttop = this.annlis[i].offsetTop; + } + if (this.annrows.length == 1) { + $('an').onmouseover = $('an').onmouseout = null; + } else { + $('ancl').innerHTML += $('ancl').innerHTML; + this.annst = setTimeout(function() { + ann.announcementScroll(); + }, this.anndelay); + $('an').onmouseover = function() { + ann.annstop = 1; + }; + $('an').onmouseout = function() { + ann.annstop = 0; + }; + } + this.annrowcount = 1; + return; + } + if (this.annrowcount >= this.annrows.length) { + $('anc').scrollTop = 0; + this.annrowcount = 1; + this.annst = setTimeout(function() { + ann.announcementScroll(); + }, this.anndelay); + } else { + this.anncount = 0; + this.annScrollTopBegin = $('anc').scrollTop; + this.announcementScrollnext(this.annrows[this.annrowcount]); + } + } + ; + ann.announcementScrollnext = function(targetTop) { + $('anc').scrollTop = this.annScrollTopBegin + this.anncount; + this.anncount++; + if ($('anc').scrollTop < targetTop) { + this.annst = setTimeout(function() { + ann.announcementScrollnext(targetTop); + }, 10); + } else { + this.annrowcount++; + this.annst = setTimeout(function() { + ann.announcementScroll(); + }, this.anndelay); + } + } + ; + ann.announcementScroll(); +} + +function removeindexheats() { + return confirm('您确认要把此主题从热点主题中移除么?'); +} + +function showTypes(id, mod) { + var o = $(id); + if(!o) return false; + var s = o.className; + mod = isUndefined(mod) ? 1 : mod; + var baseh = o.getElementsByTagName('li')[0].offsetHeight * 2; + var tmph = o.offsetHeight; + var lang = ['展开', '收起']; + var cls = ['unfold', 'fold']; + if(tmph > baseh) { + var octrl = document.createElement('li'); + octrl.className = cls[mod]; + octrl.innerHTML = lang[mod]; + + o.insertBefore(octrl, o.firstChild); + o.className = s + ' cttp'; + mod && (o.style.height = 'auto'); + + octrl.onclick = function () { + if(this.className == cls[0]) { + o.style.height = 'auto'; + this.className = cls[1]; + this.innerHTML = lang[1]; + } else { + o.style.height = ''; + this.className = cls[0]; + this.innerHTML = lang[0]; + } + } + } +} + +var postpt = 0; +function fastpostvalidate(theform, noajaxpost) { + if(postpt) { + return false; + } + postpt = 1; + setTimeout(function() {postpt = 0}, 2000); + noajaxpost = !noajaxpost ? 0 : noajaxpost; + s = ''; + if(typeof fastpostvalidateextra == 'function') { + var v = fastpostvalidateextra(); + if(!v) { + return false; + } + } + if(theform.message.value == '' || theform.subject.value == '') { + s = '抱歉,您尚未输入标题或内容'; + theform.message.focus(); + } else if(dstrlen(theform.subject.value) > 255) { + s = '您的标题超过 255 个字符的限制'; + theform.subject.focus(); + } + if(!disablepostctrl && dstrlen(trim(theform.subject.value)) && ((postminsubjectchars != 0 && dstrlen(theform.subject.value) < postminsubjectchars) || (postminsubjectchars != 0 && dstrlen(theform.subject.value) > postmaxsubjectchars))) { + showError('您的标题长度不符合要求。\n\n当前长度: ' + dstrlen(theform.subject.value) + ' 字\n系统限制: ' + postminsubjectchars + ' 到 ' + postmaxsubjectchars + ' 字'); + return false; + } + if(!disablepostctrl && ((postminchars != 0 && mb_strlen(theform.message.value) < postminchars) || (postmaxchars != 0 && mb_strlen(theform.message.value) > postmaxchars))) { + s = '您的文章长度不符合要求。\n\n当前长度: ' + mb_strlen(theform.message.value) + ' ' + '字节\n系统限制: ' + postminchars + ' 到 ' + postmaxchars + ' 字节'; + } + if(s) { + showError(s); + doane(); + $('fastpostsubmit').disabled = false; + return false; + } + $('fastpostsubmit').disabled = true; + theform.message.value = theform.message.value.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp))/ig, '$1[img]$2[/img]'); + theform.message.value = parseurl(theform.message.value); + if(!noajaxpost) { + ajaxpost('fastpostform', 'fastpostreturn', 'fastpostreturn', 'onerror', $('fastpostsubmit')); + return false; + } else { + return true; + } +} + +function checkpostrule(showid, extra) { + var x = new Ajax(); + x.get('forum.php?mod=ajax&action=checkpostrule&inajax=yes&' + extra, function(s) { + ajaxinnerhtml($(showid), s);evalscript(s); + }); +} + +function updatefastpostattach(aid, url) { + ajaxget('forum.php?mod=ajax&action=attachlist&posttime=' + $('posttime').value + (!fid ? '' : '&fid=' + fid), 'attachlist'); + $('attach_tblheader').style.display = ''; +} + +function succeedhandle_fastnewpost(locationhref, message, param) { + location.href = locationhref; +} + +function errorhandle_fastnewpost() { + $('fastpostsubmit').disabled = false; +} + +function atarget(obj) { + obj.target = getcookie('atarget') > 0 ? '_blank' : ''; +} + +function setatarget(v) { + $('atarget').className = 'y atarget_' + v; + $('atarget').onclick = function() {setatarget(v == 1 ? -1 : 1);}; + setcookie('atarget', v, 2592000); +} + +function loadData(quiet, formobj) { + + var evalevent = function (obj) { + var script = obj.parentNode.innerHTML; + var re = /onclick="(.+?)["|>]/ig; + var matches = re.exec(script); + if(matches != null) { + matches[1] = matches[1].replace(/this\./ig, 'obj.'); + eval(matches[1]); + } + }; + + var data = ''; + data = loadUserdata('forum_'+discuz_uid); + var formobj = !formobj ? $('postform') : formobj; + + if(in_array((data = trim(data)), ['', 'null', 'false', null, false])) { + if(!quiet) { + showDialog('没有可以恢复的数据!', 'notice'); + } + return; + } + + if(!quiet && !confirm('此操作将覆盖当前文章内容,确定要恢复数据吗?')) { + return; + } + + var data = data.split(/\x09\x09/); + for(var i = 0; i < formobj.elements.length; i++) { + var el = formobj.elements[i]; + if(el.name != '' && (el.tagName == 'SELECT' || el.tagName == 'TEXTAREA' || el.tagName == 'INPUT' && (el.type == 'text' || el.type == 'checkbox' || el.type == 'radio' || el.type == 'hidden'))) { + for(var j = 0; j < data.length; j++) { + var ele = data[j].split(/\x09/); + if(ele[0] == el.name) { + elvalue = !isUndefined(ele[3]) ? ele[3] : ''; + if(ele[1] == 'INPUT') { + if(ele[2] == 'text') { + el.value = elvalue; + } else if((ele[2] == 'checkbox' || ele[2] == 'radio') && ele[3] == el.value) { + el.checked = true; + evalevent(el); + } else if(ele[2] == 'hidden') { + eval('var check = typeof ' + el.id + '_upload == \'function\''); + if(check) { + var v = elvalue.split(/\x01/); + el.value = v[0]; + if(el.value) { + if($(el.id + '_url') && v[1]) { + $(el.id + '_url').value = v[1]; + } + eval(el.id + '_upload(\'' + v[0] + '\', \'' + v[1] + '\')'); + if($('unused' + v[0])) { + var attachtype = $('unused' + v[0]).parentNode.parentNode.parentNode.parentNode.id.substr(11); + $('unused' + v[0]).parentNode.parentNode.outerHTML = ''; + $('unusednum_' + attachtype).innerHTML = parseInt($('unusednum_' + attachtype).innerHTML) - 1; + if($('unusednum_' + attachtype).innerHTML == 0 && $('attachnotice_' + attachtype)) { + $('attachnotice_' + attachtype).style.display = 'none'; + } + } + } + } + + } + } else if(ele[1] == 'TEXTAREA') { + if(ele[0] == 'message') { + if(!wysiwyg) { + textobj.value = elvalue; + } else { + editdoc.body.innerHTML = bbcode2html(elvalue); + } + } else { + el.value = elvalue; + } + } else if(ele[1] == 'SELECT') { + if($(el.id + '_ctrl_menu')) { + var lis = $(el.id + '_ctrl_menu').getElementsByTagName('li'); + for(var k = 0; k < lis.length; k++) { + if(ele[3] == lis[k].k_value) { + lis[k].onclick(); + break; + } + } + } else { + for(var k = 0; k < el.options.length; k++) { + if(ele[3] == el.options[k].value) { + el.options[k].selected = true; + break; + } + } + } + } + break; + } + } + } + } + if($('rstnotice')) { + $('rstnotice').style.display = 'none'; + } + extraCheckall(); +} + +var checkForumcount = 0, checkForumtimeout = 30000, checkForumnew_handle; +function checkForumnew(fid, lasttime) { + var timeout = checkForumtimeout; + var x = new Ajax(); + x.get('forum.php?mod=ajax&action=forumchecknew&fid=' + fid + '&time=' + lasttime + '&inajax=yes', function(s){ + if(s > 0) { + var table = $('separatorline').parentNode; + if(!isUndefined(checkForumnew_handle)) { + clearTimeout(checkForumnew_handle); + } + removetbodyrow(table, 'forumnewshow'); + var colspan = table.getElementsByTagName('tbody')[0].rows[0].children.length; + var checknew = {'tid':'', 'thread':{'common':{'className':'', 'val':'有新回复的主题,点击查看', 'colspan': colspan }}}; + addtbodyrow(table, ['tbody'], ['forumnewshow'], 'separatorline', checknew); + } else { + if(checkForumcount < 50) { + if(checkForumcount > 0) { + var multiple = Math.ceil(50 / checkForumcount); + if(multiple < 5) { + timeout = checkForumtimeout * (5 - multiple + 1); + } + } + checkForumnew_handle = setTimeout(function () {checkForumnew(fid, lasttime);}, timeout); + } + } + checkForumcount++; + }); + +} +function checkForumnew_btn(fid) { + if(isUndefined(fid)) return; + ajaxget('forum.php?mod=ajax&action=forumchecknew&fid=' + fid+ '&time='+lasttime+'&uncheck=2&inajax=yes', 'forumnew', 'ajaxwaitid'); + lasttime = parseInt(Date.parse(new Date()) / 1000); +} + +function display_blocked_thread() { + var table = $('threadlisttableid'); + if(!table) { + return; + } + var tbodys = table.getElementsByTagName('tbody'); + for(i = 0;i < tbodys.length;i++) { + var tbody = tbodys[i]; + if(tbody.style.display == 'none') { + table.appendChild(tbody); + tbody.style.display = ''; + } + } + $('hiddenthread').style.display = 'none'; +} + +function addtbodyrow(table, insertID, changename, separatorid, jsonval) { + if(isUndefined(table) || isUndefined(insertID[0])) { + return; + } + + var insertobj = document.createElement(insertID[0]); + var thread = jsonval.thread; + var tid = !isUndefined(jsonval.tid) ? jsonval.tid : '' ; + + if(!isUndefined(changename[1])) { + removetbodyrow(table, changename[1] + tid); + } + + insertobj.id = changename[0] + tid; + if(!isUndefined(insertID[1])) { + insertobj.className = insertID[1]; + } + if($(separatorid)) { + table.insertBefore(insertobj, $(separatorid).nextSibling); + } else { + table.insertBefore(insertobj, table.firstChild); + } + var newTH = insertobj.insertRow(-1); + for(var value in thread) { + if(value != 0) { + var cell = newTH.insertCell(-1); + if(isUndefined(thread[value]['val'])) { + cell.innerHTML = thread[value]; + } else { + cell.innerHTML = thread[value]['val']; + } + if(!isUndefined(thread[value]['className'])) { + cell.className = thread[value]['className']; + } + if(!isUndefined(thread[value]['colspan'])) { + cell.colSpan = thread[value]['colspan']; + } + } + } + + if(!isUndefined(insertID[2])) { + _attachEvent(insertobj, insertID[2], function() {insertobj.className = '';}); + } +} +function removetbodyrow(from, objid) { + if(!isUndefined(from) && $(objid)) { + from.removeChild($(objid)); + } +} + +function leftside(id) { + $(id).className = $(id).className == 'a' ? '' : 'a'; + if(id == 'lf_fav') { + setcookie('leftsidefav', $(id).className == 'a' ? 0 : 1, 2592000); + } +} +var DTimers = new Array(); +var DItemIDs = new Array(); +var DTimers_exists = false; +function settimer(timer, itemid) { + if(timer && itemid) { + DTimers.push(timer); + DItemIDs.push(itemid); + } + if(!DTimers_exists) { + setTimeout("showtime()", 1000); + DTimers_exists = true; + } +} +function showtime() { + for(i=0; i<=DTimers.length; i++) { + if(DItemIDs[i]) { + if(DTimers[i] == 0) { + $(DItemIDs[i]).innerHTML = '已结束'; + DItemIDs[i] = ''; + continue; + } + var timestr = ''; + var timer_day = Math.floor(DTimers[i] / 86400); + var timer_hour = Math.floor((DTimers[i] % 86400) / 3600); + var timer_minute = Math.floor(((DTimers[i] % 86400) % 3600) / 60); + var timer_second = (((DTimers[i] % 86400) % 3600) % 60); + if(timer_day > 0) { + timestr += timer_day + '天'; + } + if(timer_hour > 0) { + timestr += timer_hour + '小时' + } + if(timer_minute > 0) { + timestr += timer_minute + '分' + } + if(timer_second > 0) { + timestr += timer_second + '秒' + } + DTimers[i] = DTimers[i] - 1; + $(DItemIDs[i]).innerHTML = timestr; + } + } + setTimeout("showtime()", 1000); +} +function fixed_top_nv(eleid, disbind) { + this.nv = eleid && $(eleid) || $('nv'); + this.openflag = this.nv && BROWSER.ie != 6; + this.nvdata = {}; + this.init = function (disattachevent) { + if(this.openflag) { + if(!disattachevent) { + var obj = this; + _attachEvent(window, 'resize', function(){obj.reset();obj.init(1);obj.run();}); + var switchwidth = $('switchwidth'); + if(switchwidth) { + _attachEvent(switchwidth, 'click', function(){obj.reset();obj.openflag=false;}); + } + } + + var next = this.nv; + try { + if(this.nv.parentNode.id.substr(-3) != '_ph') { + var nvparent = document.createElement('div'); + nvparent.id = this.nv.id + '_ph'; + this.nv.parentNode.insertBefore(nvparent,this.nv); + nvparent.appendChild(this.nv); + } + this.nvdata.next = this.nv.parentNode; + this.nvdata.height = parseInt(this.nv.offsetHeight, 10); + this.nvdata.width = parseInt(this.nv.offsetWidth, 10); + this.nvdata.left = this.nv.getBoundingClientRect().left - document.documentElement.clientLeft; + this.nvdata.position = this.nv.style.position; + this.nvdata.opacity = this.nv.style.opacity; + } catch (e) { + this.nvdata.next = null; + } + } + }; + + this.run = function () { + var fixedheight = 0; + if(this.openflag && this.nvdata.next){ + var nvnexttop = document.body.scrollTop || document.documentElement.scrollTop; + var dofixed = nvnexttop !== 0 && document.documentElement.clientHeight >= 15 && this.nvdata.next.getBoundingClientRect().top < 0; + if(dofixed) { + if(this.nv.style.position != 'fixed') { + this.nv.style.borderLeftWidth = '0'; + this.nv.style.borderRightWidth = '0'; + this.nv.style.height = this.nvdata.height + 'px'; + this.nv.style.width = this.nvdata.width + 'px'; + this.nv.style.top = '0'; + this.nv.style.left = this.nvdata.left + 'px'; + this.nv.style.position = 'fixed'; + this.nv.style.zIndex = '199'; + this.nv.style.opacity = 0.85; + this.nv.parentNode.style.height = this.nvdata.height + 'px'; + } + } else { + if(this.nv.style.position != this.nvdata.position) { + this.reset(); + } + } + if(this.nv.style.position == 'fixed') { + fixedheight = this.nvdata.height; + } + } + return fixedheight; + }; + this.reset = function () { + if(this.nv) { + this.nv.style.position = this.nvdata.position; + this.nv.style.borderLeftWidth = ''; + this.nv.style.borderRightWidth = ''; + this.nv.style.height = ''; + this.nv.style.width = ''; + this.nv.style.opacity = this.nvdata.opacity; + this.nv.parentNode.style.height = ''; + } + }; + if(!disbind && this.openflag) { + this.init(); + _attachEvent(window, 'scroll', this.run); + } +} +var previewTbody = null, previewTid = null, previewDiv = null; +function previewThread(tid, tbody) { + if(!$('threadPreviewTR_'+tid)) { + appendscript(JSPATH + 'forum_viewthread.js?' + VERHASH); + + newTr = document.createElement('tr'); + newTr.id = 'threadPreviewTR_'+tid; + newTr.className = 'threadpre'; + $(tbody).appendChild(newTr); + newTd = document.createElement('td'); + newTd.colSpan = listcolspan; + newTd.className = 'threadpretd'; + newTr.appendChild(newTd); + newTr.style.display = 'none'; + + previewTbody = tbody; + previewTid = tid; + + if(BROWSER.ie) { + previewDiv = document.createElement('div'); + previewDiv.id = 'threadPreview_'+tid; + previewDiv.style.id = 'none'; + var x = Ajax(); + x.get('forum.php?mod=viewthread&tid='+tid+'&inajax=1&from=preview', function(ret) { + var evaled = false; + if(ret.indexOf('ajaxerror') != -1) { + evalscript(ret); + evaled = true; + } + previewDiv.innerHTML = ret; + newTd.appendChild(previewDiv); + if(!evaled) evalscript(ret); + newTr.style.display = ''; + }); + } else { + newTd.innerHTML += '
                  '; + ajaxget('forum.php?mod=viewthread&tid='+tid+'&from=preview', 'threadPreview_'+tid, null, null, null, function() {newTr.style.display = '';}); + } + } else { + $(tbody).removeChild($('threadPreviewTR_'+tid)); + previewTbody = previewTid = null; + } +} + +function hideStickThread(tid) { + var pre = 'stickthread_'; + var tids = (new Function("return ("+(loadUserdata('sticktids') || '[]')+")"))(); + var format = function (data) { + var str = '{'; + for (var i in data) { + if(data[i] instanceof Array) { + str += i + ':' + '['; + for (var j = data[i].length - 1; j >= 0; j--) { + str += data[i][j] + ','; + }; + str = str.substr(0, str.length -1); + str += '],'; + } + } + str = str.substr(0, str.length -1); + str += '}'; + return str; + }; + if(!tid) { + if(tids.length > 0) { + for (var i = tids.length - 1; i >= 0; i--) { + var ele = $(pre+tids[i]); + if(ele) { + ele.parentNode.removeChild(ele); + } + }; + } + } else { + var eletbody = $(pre+tid); + if(eletbody) { + eletbody.parentNode.removeChild(eletbody); + tids.push(tid); + saveUserdata('sticktids', '['+tids.join(',')+']'); + } + } + var clearstickthread = $('clearstickthread'); + if(clearstickthread) { + if(tids.length > 0) { + $('clearstickthread').style.display = ''; + } else { + $('clearstickthread').style.display = 'none'; + } + } + var separatorline = $('separatorline'); + if(separatorline) { + try { + if(typeof separatorline.previousElementSibling === 'undefined') { + var findele = separatorline.previousSibling; + while(findele && findele.nodeType != 1){ + findele = findele.previousSibling; + } + if(findele === null) { + separatorline.parentNode.removeChild(separatorline); + } + } else { + if(separatorline.previousElementSibling === null) { + separatorline.parentNode.removeChild(separatorline); + } + } + } catch(e) { + } + } +} +function viewhot() { + var obj = $('hottime'); + window.location.href = "forum.php?mod=forumdisplay&filter=hot&fid="+obj.getAttribute('fid')+"&time="+obj.value; +} +function clearStickThread () { + saveUserdata('sticktids', '[]'); + location.reload(); +} \ No newline at end of file diff --git a/static/js/forum_moderate.js b/static/js/forum_moderate.js new file mode 100644 index 0000000..51065bc --- /dev/null +++ b/static/js/forum_moderate.js @@ -0,0 +1,146 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: forum_moderate.js 26484 2011-12-14 02:08:03Z svn_project_zhangjie $ +*/ + +function modaction(action, pid, extra, mod) { + if(!action) { + return; + } + var mod = mod ? mod : 'forum.php?mod=topicadmin'; + var extra = !extra ? '' : '&' + extra; + if(!pid && in_array(action, ['delpost', 'banpost'])) { + var checked = 0; + var pid = ''; + for(var i = 0; i < $('modactions').elements.length; i++) { + if($('modactions').elements[i].name.match('topiclist')) { + checked = 1; + break; + } + } + } else { + var checked = 1; + } + if(!checked) { + alert('请选择需要操作的文章'); + } else { + $('modactions').action = mod + '&action='+ action +'&fid=' + fid + '&tid=' + tid + '&handlekey=mods&infloat=yes&nopost=yes' + (!pid ? '' : '&topiclist[]=' + pid) + extra + '&r' + Math.random(); + showWindow('mods', 'modactions', 'post'); + if(BROWSER.ie) { + doane(event); + } + hideMenu(); + } +} + +function modthreads(optgroup, operation) { + var operation = !operation ? '' : operation; + $('modactions').action = 'forum.php?mod=topicadmin&action=moderate&fid=' + fid + '&moderate[]=' + tid + '&handlekey=mods&infloat=yes&nopost=yes' + (optgroup != 3 && optgroup != 2 ? '&from=' + tid : ''); + $('modactions').optgroup.value = optgroup; + $('modactions').operation.value = operation; + hideWindow('mods'); + showWindow('mods', 'modactions', 'post', 0); + if(BROWSER.ie) { + doane(event); + } +} + +function pidchecked(obj) { + if(obj.checked) { + try { + var inp = document.createElement(''); + } catch(e) { + try { + var inp = document.createElement('input'); + inp.name = 'topiclist[]'; + } catch(e) { + return; + } + } + inp.id = 'topiclist_' + obj.value; + inp.value = obj.value; + inp.type = 'hidden'; + $('modactions').appendChild(inp); + } else { + $('modactions').removeChild($('topiclist_' + obj.value)); + } +} + +var modclickcount = 0; +function modclick(obj, pid) { + if(obj.checked) { + modclickcount++; + } else { + modclickcount--; + } + $('mdct').innerHTML = modclickcount; + if(modclickcount > 0) { + var offset = fetchOffset(obj); + $('mdly').style.top = offset['top'] - 65 + 'px'; + $('mdly').style.left = offset['left'] - 215 + 'px'; + $('mdly').style.display = ''; + } else { + $('mdly').style.display = 'none'; + } +} + +function resetmodcount() { + modclickcount = 0; + $('mdly').style.display = 'none'; +} + +function tmodclick(obj) { + if(obj.checked) { + modclickcount++; + } else { + modclickcount--; + } + $('mdct').innerHTML = modclickcount; + if(modclickcount > 0) { + var top_offset = obj.offsetTop; + while((obj = obj.offsetParent).id != 'threadlist') { + top_offset += obj.offsetTop; + } + $('mdly').style.top = top_offset - 7 + 'px'; + $('mdly').style.display = ''; + } else { + $('mdly').style.display = 'none'; + } +} + +function tmodthreads(optgroup, operation) { + var checked = 0; + var operation = !operation ? '' : operation; + for(var i = 0; i < $('moderate').elements.length; i++) { + if($('moderate').elements[i].name.match('moderate') && $('moderate').elements[i].checked) { + checked = 1; + break; + } + } + if(!checked) { + alert('请选择需要操作的文章'); + } else { + $('moderate').optgroup.value = optgroup; + $('moderate').operation.value = operation; + hideWindow('mods'); + showWindow('mods', 'moderate', 'post', 0); + } +} + +function getthreadclass() { + var fid = $('fid'); + if(fid) { + ajaxget('forum.php?mod=ajax&action=getthreadclass&fid=' + fid.value, 'threadclass', null, null, null, showthreadclass); + } +} + +function showthreadclass() { + try{ + $('append_parent').removeChild($('typeid_ctrl_menu')); + }catch(e) {} + simulateSelect('typeid'); +} + +loadcss('forum_moderator'); \ No newline at end of file diff --git a/static/js/forum_post.js b/static/js/forum_post.js new file mode 100644 index 0000000..9e31f76 --- /dev/null +++ b/static/js/forum_post.js @@ -0,0 +1,873 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: forum_post.js 33695 2013-08-03 04:39:22Z nemohou $ +*/ + +var forum_post_inited = true; +var postSubmited = false; +var AID = {0:1,1:1}; +var UPLOADSTATUS = -1; +var UPLOADFAILED = UPLOADCOMPLETE = AUTOPOST = 0; +var CURRENTATTACH = '0'; +var FAILEDATTACHS = ''; +var UPLOADWINRECALL = null; +var imgexts = typeof imgexts == 'undefined' ? 'jpg, jpeg, gif, png, bmp' : imgexts; +var ATTACHORIMAGE = '0'; +var STATUSMSG = { + '-1' : '内部服务器错误', + '0' : '上传成功', + '1' : '不支持此类扩展名', + '2' : '服务器限制无法上传那么大的附件', + '3' : '用户组限制无法上传那么大的附件', + '4' : '不支持此类扩展名', + '5' : '文件类型限制无法上传那么大的附件', + '6' : '今日您已无法上传更多的附件', + '7' : '请选择图片文件(' + imgexts + ')', + '8' : '附件文件无法保存', + '9' : '没有合法的文件被上传', + '10' : '非法操作', + '11' : '今日您已无法上传那么大的附件', + '12' : '因文件名包含敏感词而无法提交', + '13' : '服务器限制无法上传分辨率过高的附件' +}; + +EXTRAFUNC['validator'] = []; + +function checkFocus() { + var obj = wysiwyg ? editwin : textobj; + if(!obj.hasfocus) { + obj.focus(); + } +} + +function ctlent(event) { + if(postSubmited == false && (event.ctrlKey && event.keyCode == 13) || (event.altKey && event.keyCode == 83) && $('postsubmit')) { + if(in_array($('postsubmit').name, ['topicsubmit', 'replysubmit', 'editsubmit']) && !validate($('postform'))) { + doane(event); + return; + } + postSubmited = true; + $('postsubmit').disabled = true; + $('postform').submit(); + } + if(event.keyCode == 9) { + doane(event); + } +} + +function checklength(theform) { + var message = wysiwyg ? html2bbcode(getEditorContents()) : theform.message.value; + if(!theform.parseurloff.checked) { + message = parseurl(message); + } + showDialog('当前长度: ' + mb_strlen(message) + ' 字节,' + (postmaxchars != 0 ? '系统限制: ' + postminchars + ' 到 ' + postmaxchars + ' 字节。' : ''), 'notice', '字数检查'); +} + +if(!tradepost) { + var tradepost = 0; +} + +function validate(theform) { + var message = wysiwyg ? html2bbcode(getEditorContents()) : theform.message.value; + if(!theform.parseurloff.checked) { + message = parseurl(message); + } + if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") { + showError('抱歉,您尚未输入标题或内容'); + return false; + } else if(dstrlen(theform.subject.value) > 255) { + showError('您的标题超过 255 个字符的限制'); + return false; + } + if(!disablepostctrl && theform.subject.value != "" && ((postminsubjectchars != 0 && dstrlen(theform.subject.value) < postminsubjectchars) || (postminsubjectchars != 0 && dstrlen(theform.subject.value) > postmaxsubjectchars))) { + showError('您的标题长度不符合要求。\n\n当前长度: ' + dstrlen(theform.subject.value) + ' 字\n系统限制: ' + postminsubjectchars + ' 到 ' + postmaxsubjectchars + ' 字'); + return false; + } + if(in_array($('postsubmit').name, ['topicsubmit', 'editsubmit'])) { + if(theform.typeid && (theform.typeid.options && theform.typeid.options[theform.typeid.selectedIndex].value == 0) && typerequired) { + showError('请选择主题对应的分类'); + return false; + } + if(theform.sortid && (theform.sortid.options && theform.sortid.options[theform.sortid.selectedIndex].value == 0) && sortrequired) { + showError('请选择主题对应的分类信息'); + return false; + } + } + for(i in EXTRAFUNC['validator']) { + try { + eval('var v = ' + EXTRAFUNC['validator'][i] + '()'); + if(!v) { + return false; + } + } catch(e) {} + } + + if(!disablepostctrl && !sortid && !special && ((postminchars != 0 && mb_strlen(message) < postminchars) || (postmaxchars != 0 && mb_strlen(message) > postmaxchars))) { + showError('您的文章长度不符合要求。\n\n当前长度: ' + mb_strlen(message) + ' 字节\n系统限制: ' + postminchars + ' 到 ' + postmaxchars + ' 字节'); + return false; + } + if(UPLOADSTATUS == 0) { + if(!confirm('您有等待上传的附件,确认不上传这些附件吗?')) { + return false; + } + } else if(UPLOADSTATUS == 1) { + showDialog('您有正在上传的附件,请稍候,上传完成后文章将会自动发表...', 'notice'); + AUTOPOST = 1; + return false; + } + if(isfirstpost && $('adddynamic') != null && $('adddynamic').checked && $('postsave') != null && isNaN(parseInt($('postsave').value)) && ($('readperm') != null && $('readperm').value || $('price') != null && $('price').value)) { + if(confirm('由于您设置了阅读权限或出售帖,您确认还转播给您的听众看吗?') == false) { + return false; + } + } + theform.message.value = message; + if($('postsubmit').name == 'editsubmit') { + checkpostrule_post(theform); + return false; + } else if(in_array($('postsubmit').name, ['topicsubmit', 'replysubmit'])) { + if(seccodecheck || secqaacheck) { + var chk = 1, chkv = ''; + if(secqaacheck) { + chkv = $('checksecqaaverify_' + theform.secqaahash.value).innerHTML; + if(chkv.indexOf('loading') != -1) { + setTimeout(function () { validate(theform); }, 100); + chk = 0; + } else if(chkv.indexOf('check_right') == -1) { + if($('secqaaverify_' + theform.secqaahash.value) == document.activeElement) { + $('postsubmit').focus(); + setTimeout(function () { validate(theform); }, 100); + } else { + showError('验证问答错误,请重新填写'); + } + chk = 0; + } + } + if(seccodecheck) { + chkv = $('checkseccodeverify_' + theform.seccodehash.value).innerHTML; + if(chkv.indexOf('loading') !== -1) { + setTimeout(function () { validate(theform); }, 100); + chk = 0; + } else if(chkv.indexOf('check_right') === -1) { + if($('seccodeverify_' + theform.seccodehash.value) == document.activeElement) { + $('postsubmit').focus(); + setTimeout(function () { validate(theform); }, 100); + } else { + showError('验证码错误,请重新填写'); + } + chk = 0; + } + } + if(chk) { + checkpostrule_post(theform); + } + } else { + checkpostrule_post(theform); + } + return false; + } +} + +function checkpostrule_post(theform) { + if(!seccodecheck && !secqaacheck && !theform.sechash) { + var x = new Ajax(); + x.get('forum.php?mod=ajax&action=checkpostrule&ac=' + postaction + '&inajax=yes', function(s) { + if(s) { + ajaxinnerhtml($('seccheck'), s); + evalscript(s); + seccodecheck = true; + } else { + postsubmit(theform); + } + }); + } else { + postsubmit(theform); + } +} + +function postsubmit(theform) { + if($(editorid + '_attachlist')) { + $('postbox').appendChild($(editorid + '_attachlist')); + $(editorid + '_attachlist').style.display = 'none'; + } + if($(editorid + '_imgattachlist')) { + $('postbox').appendChild($(editorid + '_imgattachlist')); + $(editorid + '_imgattachlist').style.display = 'none'; + } + hideMenu(); + + theform.replysubmit ? theform.replysubmit.disabled = true : (theform.editsubmit ? theform.editsubmit.disabled = true : theform.topicsubmit.disabled = true); + theform.submit(); +} + +function switchicon(iconid, obj) { + $('iconid').value = iconid; + $('icon_img').src = obj.src; + hideMenu(); +} + +function clearContent() { + if(wysiwyg) { + editdoc.body.innerHTML = BROWSER.firefox ? '
                  ' : ''; + } else { + textobj.value = ''; + } +} + +function uploadNextAttach() { + var str = $('attachframe').contentWindow.document.body.innerHTML; + if(str == '') return; + var arr = str.split('|'); + var att = CURRENTATTACH.split('|'); + var sizelimit = ''; + if(arr[4] == 'ban') { + sizelimit = '(附件类型被禁止)'; + } else if(arr[4] == 'perday') { + sizelimit = '(不能超过 ' + arr[5] + ' 字节)'; + } else if(arr[4] > 0) { + sizelimit = '(不能超过 ' + arr[4] + ' 字节)'; + } + uploadAttach(parseInt(att[0]), arr[0] == 'DISCUZUPLOAD' ? parseInt(arr[1]) : -1, att[1], sizelimit); +} + +function uploadAttach(curId, statusid, prefix, sizelimit) { + prefix = isUndefined(prefix) ? '' : prefix; + var nextId = 0; + for(var i = 0; i < AID[prefix ? 1 : 0] - 1; i++) { + if($(prefix + 'attachform_' + i)) { + nextId = i; + if(curId == 0) { + break; + } else { + if(i > curId) { + break; + } + } + } + } + if(nextId == 0) { + return; + } + CURRENTATTACH = nextId + '|' + prefix; + if(curId > 0) { + if(statusid == 0) { + UPLOADCOMPLETE++; + } else { + FAILEDATTACHS += '
                  ' + mb_cutstr($(prefix + 'attachnew_' + curId).value.substr($(prefix + 'attachnew_' + curId).value.replace(/\\/g, '/').lastIndexOf('/') + 1), 25) + ': ' + STATUSMSG[statusid] + sizelimit; + UPLOADFAILED++; + } + $(prefix + 'cpdel_' + curId).innerHTML = ''; + if(nextId == curId || in_array(statusid, [6, 8])) { + if(prefix == 'img') { + updateImageList(); + } else { + updateAttachList(); + } + if(UPLOADFAILED > 0) { + showDialog('附件上传完成!成功 ' + UPLOADCOMPLETE + ' 个,失败 ' + UPLOADFAILED + ' 个:' + FAILEDATTACHS); + FAILEDATTACHS = ''; + } + UPLOADSTATUS = 2; + for(var i = 0; i < AID[prefix ? 1 : 0] - 1; i++) { + if($(prefix + 'attachform_' + i)) { + reAddAttach(prefix, i) + } + } + $(prefix + 'uploadbtn').style.display = ''; + $(prefix + 'uploading').style.display = 'none'; + if(AUTOPOST) { + hideMenu(); + validate($('postform')); + } else if(UPLOADFAILED == 0 && (prefix == 'img' || prefix == '')) { + showDialog('附件上传完成!', 'right', null, null, 0, null, null, null, null, 3); + } + UPLOADFAILED = UPLOADCOMPLETE = 0; + CURRENTATTACH = '0'; + FAILEDATTACHS = ''; + return; + } + } else { + $(prefix + 'uploadbtn').style.display = 'none'; + $(prefix + 'uploading').style.display = ''; + } + $(prefix + 'cpdel_' + nextId).innerHTML = '
                  '; + UPLOADSTATUS = 1; + $(prefix + 'attachform_' + nextId).submit(); +} + +function addAttach(prefix) { + var id = AID[prefix ? 1 : 0]; + var tags, newnode, i; + prefix = isUndefined(prefix) ? '' : prefix; + newnode = $(prefix + 'attachbtnhidden').firstChild.cloneNode(true); + tags = newnode.getElementsByTagName('input'); + for(i = 0;i < tags.length;i++) { + if(tags[i].name == 'Filedata') { + tags[i].id = prefix + 'attachnew_' + id; + tags[i].onchange = function() {insertAttach(prefix, id);}; + tags[i].unselectable = 'on'; + } else if(tags[i].name == 'attachid') { + tags[i].value = id; + } + } + tags = newnode.getElementsByTagName('form'); + tags[0].name = tags[0].id = prefix + 'attachform_' + id; + $(prefix + 'attachbtn').appendChild(newnode); + newnode = $(prefix + 'attachbodyhidden').firstChild.cloneNode(true); + tags = newnode.getElementsByTagName('input'); + for(i = 0;i < tags.length;i++) { + if(tags[i].name == prefix + 'localid[]') { + tags[i].value = id; + } + } + tags = newnode.getElementsByTagName('span'); + for(i = 0;i < tags.length;i++) { + if(tags[i].id == prefix + 'localfile[]') { + tags[i].id = prefix + 'localfile_' + id; + } else if(tags[i].id == prefix + 'cpdel[]') { + tags[i].id = prefix + 'cpdel_' + id; + } else if(tags[i].id == prefix + 'localno[]') { + tags[i].id = prefix + 'localno_' + id; + } else if(tags[i].id == prefix + 'deschidden[]') { + tags[i].id = prefix + 'deschidden_' + id; + } + } + AID[prefix ? 1 : 0]++; + newnode.style.display = 'none'; + $(prefix + 'attachbody').appendChild(newnode); +} + +function insertAttach(prefix, id) { + var path = $(prefix + 'attachnew_' + id).value; + var extpos = path.lastIndexOf('.'); + var ext = extpos == -1 ? '' : path.substr(extpos + 1, path.length).toLowerCase(); + var re = new RegExp("(^|\\s|,)" + ext + "($|\\s|,)", "ig"); + var localfile = $(prefix + 'attachnew_' + id).value.substr($(prefix + 'attachnew_' + id).value.replace(/\\/g, '/').lastIndexOf('/') + 1); + var filename = mb_cutstr(localfile, 30); + + if(path == '') { + return; + } + if(extensions != '' && (re.exec(extensions) == null || ext == '')) { + reAddAttach(prefix, id); + showError('对不起,不支持上传此类扩展名的附件。'); + return; + } + if(prefix == 'img' && imgexts.indexOf(ext) == -1) { + reAddAttach(prefix, id); + showError('请选择图片文件(' + imgexts + ')'); + return; + } + + $(prefix + 'cpdel_' + id).innerHTML = '
                  删除'; + $(prefix + 'localfile_' + id).innerHTML = '' + filename + ''; + $(prefix + 'attachnew_' + id).style.display = 'none'; + $(prefix + 'deschidden_' + id).style.display = ''; + $(prefix + 'deschidden_' + id).title = localfile; + $(prefix + 'localno_' + id).parentNode.parentNode.style.display = ''; + addAttach(prefix); + UPLOADSTATUS = 0; +} + +function reAddAttach(prefix, id) { + $(prefix + 'attachbody').removeChild($(prefix + 'localno_' + id).parentNode.parentNode); + $(prefix + 'attachbtn').removeChild($(prefix + 'attachnew_' + id).parentNode.parentNode); + $(prefix + 'attachbody').innerHTML == '' && addAttach(prefix); + $('localimgpreview_' + id) ? document.body.removeChild($('localimgpreview_' + id)) : null; +} + +function delAttach(id, type) { + var ids = {}; + if(typeof id == 'number') { + ids[id] = id; + } else { + ids = id; + } + for(id in ids) { + if($('attach_' + id)) { + $('attach_' + id).style.display = 'none'; + ATTACHNUM['attach' + (type ? 'un' : '') + 'used']--; + updateattachnum('attach'); + } + } + appendAttachDel(ids); +} + +function delImgAttach(id, type) { + var ids = {}; + if(typeof id == 'number') { + ids[id] = id; + } else { + ids = id; + } + for(id in ids) { + if($('image_td_' + id)) { + $('image_td_' + id).className = 'imgdeleted'; + $('image_' + id).onclick = null; + $('image_desc_' + id).disabled = true; + ATTACHNUM['image' + (type ? 'un' : '') + 'used']--; + updateattachnum('image'); + } + } + appendAttachDel(ids); +} + +function appendAttachDel(ids) { + if(!ids) { + return; + } + var aids = ''; + for(id in ids) { + aids += '&aids[]=' + id; + } + list = document.getElementsByTagName("input"); + formhash = null; + for(i=0; i取消'; + } else { + obj.style.display = ''; + objupdate.innerHTML = ''; + } +} + +function updateattachnum(type) { + ATTACHNUM[type + 'used'] = ATTACHNUM[type + 'used'] >= 0 ? ATTACHNUM[type + 'used'] : 0; + ATTACHNUM[type + 'unused'] = ATTACHNUM[type + 'unused'] >= 0 ? ATTACHNUM[type + 'unused'] : 0; + var num = ATTACHNUM[type + 'used'] + ATTACHNUM[type + 'unused']; + if(num) { + if($(editorid + '_' + type)) { + $(editorid + '_' + type).title = '包含 ' + num + (type == 'image' ? ' 个图片附件' : ' 个附件'); + } + if($(editorid + '_' + type + 'n')) { + $(editorid + '_' + type + 'n').style.display = ''; + } + ATTACHORIMAGE = 1; + } else { + if($(editorid + '_' + type)) { + $(editorid + '_' + type).title = type == 'image' ? '图片' : '附件'; + } + if($(editorid + '_' + type + 'n')) { + $(editorid + '_' + type + 'n').style.display = 'none'; + } + } +} + +function swfHandler(action, type) { + if(action == 2) { + if(type == 'image') { + updateImageList(); + } else { + updateAttachList(); + } + } +} + +function updateAttachList(action, aids) { + ajaxget('forum.php?mod=ajax&action=attachlist' + (!action ? '&posttime=' + $('posttime').value : (!aids ? '' : '&aids=' + aids)) + (!fid ? '' : '&fid=' + fid), 'attachlist'); + switchAttachbutton('attachlist');$('attach_tblheader').style.display = $('attach_notice').style.display = ''; +} + +function updateImageList(action, aids) { + ajaxget('forum.php?mod=ajax&action=imagelist' + (!action ? '&pid=' + pid + '&posttime=' + $('posttime').value : (!aids ? '' : '&aids=' + aids)) + (!fid ? '' : '&fid=' + fid), 'imgattachlist'); + switchImagebutton('imgattachlist');$('imgattach_notice').style.display = ''; +} + +function updateDownImageList(msg) { + hideMenu('fwin_dialog', 'dialog'); + if(msg == '') { + showError('抱歉,暂无远程附件'); + } else { + ajaxget('forum.php?mod=ajax&action=imagelist&pid=' + pid + '&posttime=' + $('posttime').value + (!fid ? '' : '&fid=' + fid), 'imgattachlist', null, null, null, function(){if(wysiwyg) {editdoc.body.innerHTML = msg;switchEditor(0);switchEditor(1)} else {textobj.value = msg;}}); + switchImagebutton('imgattachlist');$('imgattach_notice').style.display = ''; + showDialog('远程附件下载完成!', 'right', null, null, 0, null, null, null, null, 3); + } +} + +function switchButton(btn, type) { + var btnpre = editorid + '_btn_'; + if(!$(btnpre + btn) || !$(editorid + '_' + btn)) { + return; + } + var tabs = $(editorid + '_' + type + '_ctrl').getElementsByTagName('LI'); + $(btnpre + btn).style.display = ''; + $(editorid + '_' + btn).style.display = ''; + $(btnpre + btn).className = 'current'; + var btni = ''; + for(i = 0;i < tabs.length;i++) { + if(tabs[i].id.indexOf(btnpre) !== -1) { + btni = tabs[i].id.substr(btnpre.length); + } + if(btni != btn) { + if(!$(editorid + '_' + btni) || !$(editorid + '_btn_' + btni)) { + continue; + } + $(editorid + '_' + btni).style.display = 'none'; + $(editorid + '_btn_' + btni).className = ''; + } + } +} + +function uploadWindowstart() { + $('uploadwindowing').style.visibility = 'visible'; +} + +function uploadWindowload() { + $('uploadwindowing').style.visibility = 'hidden'; + var str = $('uploadattachframe').contentWindow.document.body.innerHTML; + if(str == '') return; + var arr = str.split('|'); + if(arr[0] == 'DISCUZUPLOAD' && arr[2] == 0) { + UPLOADWINRECALL(arr[3], arr[5], arr[6]); + hideWindow('upload', 0); + } else { + var sizelimit = ''; + if(arr[7] == 'ban') { + sizelimit = '(附件类型被禁止)'; + } else if(arr[7] == 'perday') { + sizelimit = '(不能超过 ' + arr[8] + ' 字节)'; + } else if(arr[7] > 0) { + sizelimit = '(不能超过 ' + arr[7] + ' 字节)'; + } + showError(STATUSMSG[arr[2]] + sizelimit); + } + if($('attachlimitnotice')) { + ajaxget('forum.php?mod=ajax&action=updateattachlimit&fid=' + fid, 'attachlimitnotice'); + } +} + +function uploadWindow(recall, type) { + var type = isUndefined(type) ? 'image' : type; + UPLOADWINRECALL = recall; + showWindow('upload', 'forum.php?mod=misc&action=upload&fid=' + fid + '&type=' + type, 'get', 0, {'zindex':601}); +} + +function updatetradeattach(aid, url, attachurl) { + $('tradeaid').value = aid; + $('tradeattach_image').innerHTML = ''; + ATTACHORIMAGE = 1; +} + +function updateactivityattach(aid, url, attachurl) { + $('activityaid').value = aid; + $('activityattach_image').innerHTML = ''; + ATTACHORIMAGE = 1; +} + +function updatesortattach(aid, url, attachurl, identifier) { + $('sortaid_' + identifier).value = aid; + $('sortattachurl_' + identifier).value = attachurl + '/' + url; + $('sortattach_image_' + identifier).innerHTML = ''; + ATTACHORIMAGE = 1; +} + +function switchpollm(swt) { + t = $('pollchecked').checked && swt ? 2 : 1; + var v = ''; + for(var i = 0; i < $('postform').elements.length; i++) { + var e = $('postform').elements[i]; + if(!isUndefined(e.name)) { + if(e.name.match('^polloption')) { + if(t == 2 && e.tagName == 'INPUT') { + v += e.value + '\n'; + } else if(t == 1 && e.tagName == 'TEXTAREA') { + v += e.value; + } + } + } + } + if(t == 1) { + var a = v.split('\n'); + var pcount = 0; + for(var i = 0; i < $('postform').elements.length; i++) { + var e = $('postform').elements[i]; + if(!isUndefined(e.name)) { + if(e.name.match('^polloption')) { + pcount++; + if(e.tagName == 'INPUT') e.value = ''; + } + } + } + for(var i = 0; i < a.length - pcount + 2; i++) { + addpolloption(); + } + var ii = 0; + for(var i = 0; i < $('postform').elements.length; i++) { + var e = $('postform').elements[i]; + if(!isUndefined(e.name)) { + if(e.name.match('^polloption') && e.tagName == 'INPUT' && a[ii]) { + e.value = a[ii++]; + } + } + } + } else if(t == 2) { + $('postform').polloptions.value = trim(v); + + } + $('postform').tpolloption.value = t; + if(swt) { + display('pollm_c_1'); + display('pollm_c_2'); + } +} + +function addpolloption() { + if(curoptions < maxoptions) { + var imgid = 'newpoll_'+curnumber; + var proid = 'pollUploadProgress_'+curnumber; + var pollstr = $('polloption_hidden').innerHTML.replace('newpoll', imgid); + pollstr = pollstr.replace('pollUploadProgress', proid); + $('polloption_new').outerHTML = '

                  ' + pollstr + '

                  ' + $('polloption_new').outerHTML; + curoptions++; + curnumber++; + addUploadEvent(imgid, proid) + + } else { + $('polloption_new').innerHTML = '已达到最大投票数' + maxoptions; + } +} + +function delpolloption(obj) { + obj.parentNode.parentNode.removeChild(obj.parentNode); + curoptions--; + if (curoptions < maxoptions) { + $('polloption_new').innerHTML = ''; + } +} + +function insertsave(pid) { + var x = new Ajax(); + x.get('forum.php?mod=misc&action=loadsave&inajax=yes&pid=' + pid + '&type=' + wysiwyg, function(str, x) { + insertText(str, str.length, 0); + }); +} + +function userdataoption(op) { + if(!op) { + saveUserdata('forum_'+discuz_uid, ''); + display('rstnotice'); + } else { + loadData(); + checkFocus(); + } + doane(); +} + +function attachoption(type, op) { + if(!op) { + if(type == 'attach') { + delAttach(ATTACHUNUSEDAID, 1); + ATTACHNUM['attachunused'] = 0; + display('attachnotice_attach'); + } else { + delImgAttach(IMGUNUSEDAID, 1); + ATTACHNUM['imageunused'] = 0; + display('attachnotice_img'); + } + } else if(op == 1) { + var obj = $('unusedwin') ? $('unusedwin') : $('unusedlist_' + type); + list = obj.getElementsByTagName('INPUT'), aids = ''; + for(i = 0;i < list.length;i++) { + if(list[i].name.match('unused') && list[i].checked) { + aids += '|' + list[i].value; + } + } + if(aids) { + if(type == 'attach') { + updateAttachList(1, aids); + } else { + list = $('imgattachlist').getElementsByTagName('TD'); + re = /^image\_td\_(\d+)$/; + for(i = 0;i < list.length;i++) { + var matches = re.exec(list[i].id); + if(matches != null) { + aids += '|' + matches[1]; + } + } + updateImageList(1, aids); + } + } + display('attachnotice_' + type); + } else if(op == 2) { + showDialog('
                  ' + $('unusedlist_' + type).innerHTML + '
                  ' + + '

                  ' + + '

                  ', 'info', '未使用的' + (type == 'attach' ? '附件' : '图片')); + } else if(op == 3) { + list = $('unusedwin').getElementsByTagName('INPUT'); + for(i = 0;i < list.length;i++) { + if(list[i].name.match('unused')) { + list[i].checked = $('unusedwinchkall').checked; + } + } + return; + } + doane(); +} + +function insertAttachTag(aid) { + var txt = '[attach]' + aid + '[/attach]'; + seditor_insertunit('fastpost', txt); +} +function insertAttachimgTag(aid) { + var txt = '[attachimg]' + aid + '[/attachimg]'; + seditor_insertunit('fastpost', txt); +} +function insertText(str) { + seditor_insertunit('fastpost', str); +} + +function insertAllAttachTag() { + var attachListObj = $('e_attachlist').getElementsByTagName("tbody"); + for(var i in attachListObj) { + if(typeof attachListObj[i] == "object") { + var attach = attachListObj[i]; + var ids = attach.id.split('_'); + if(ids[0] == 'attach') { + if($('attachname'+ids[1]) && attach.style.display != 'none') { + if(parseInt($('attachname'+ids[1]).getAttribute('isimage'))) { + insertAttachimgTag(ids[1]); + } else { + insertAttachTag(ids[1]); + } + var txt = wysiwyg ? '\r\n

                  \r\n' : '\r\n\r\n'; + insertText(txt, strlen(txt), 0); + } + } + } + } + doane(); +} + +function selectAllSaveImg(state) { + var inputListObj = $('imgattachlist').getElementsByTagName("input"); + for(i in inputListObj) { + if(typeof inputListObj[i] == "object" && inputListObj[i].id) { + var inputObj = inputListObj[i]; + var ids = inputObj.id.split('_'); + if(ids[0] == 'albumaidchk' && $('image_td_' + ids[1]).className != 'imgdeleted' && inputObj.checked != state) { + inputObj.click(); + } + } + } +} + +function showExtra(id) { + if ($(id+'_c').style.display == 'block') { + $(id+'_b').className = 'pn z'; + $(id+'_c').style.display = 'none'; + } else { + var extraButton = $('post_extra_tb').getElementsByTagName('label'); + var extraForm = $('post_extra_c').getElementsByTagName('div'); + + for (i=0;i 0 && $('replycredit_times').value > 0 ? 'a' : ''; + } else if(op == 1 && $('readperm')) { + $('extra_readperm_chk').className = $('readperm').value !== '' ? 'a' : ''; + } else if(op == 2 && $('price')) { + $('extra_price_chk').className = $('price').value > 0 ? 'a' : ''; + } else if(op == 3 && $('rushreply')) { + $('extra_rushreplyset_chk').className = $('rushreply').checked ? 'a' : ''; + } else if(op == 4 && $('tags')) { + $('extra_tag_chk').className = $('tags').value !== '' ? 'a' : ''; + } else if(op == 5 && $('cronpublish')) { + $('extra_pubdate_chk').className = $('cronpublish').checked ? 'a' : ''; + } +} + +function hidenFollowBtn(flag) { + var fobj = $('adddynamicspan'); + if(fobj) { + if(flag) { + $('adddynamic').checked = !flag; + fobj.style.display = 'none'; + } else { + fobj.style.display = ''; + } + } +} + +function getreplycredit() { + var replycredit_extcredits = $('replycredit_extcredits'); + var replycredit_times = $('replycredit_times'); + var credit_once = parseInt(replycredit_extcredits.value) > 0 ? parseInt(replycredit_extcredits.value) : 0; + var times = parseInt(replycredit_times.value) > 0 ? parseInt(replycredit_times.value) : 0; + if(parseInt(credit_once * times) - have_replycredit > 0) { + var real_reply_credit = Math.ceil(parseInt(credit_once * times) - have_replycredit + ((parseInt(credit_once * times) - have_replycredit) * creditstax)); + } else { + var real_reply_credit = Math.ceil(parseInt(credit_once * times) - have_replycredit); + } + + var reply_credits_sum = Math.ceil(parseInt(credit_once * times)); + + $('replycredit_sum').innerHTML = reply_credits_sum > 0 ? reply_credits_sum : 0 ; + if(real_reply_credit > userextcredit) { + $('replycredit').innerHTML = '回帖奖励积分总额过大('+real_reply_credit+')'; + } else { + if(have_replycredit > 0 && real_reply_credit < 0) { + $('replycredit').innerHTML = "返还"+Math.abs(real_reply_credit)+""; + } else { + $('replycredit').innerHTML = replycredit_result_lang + (real_reply_credit > 0 ? real_reply_credit : 0 ); + } + } +} + +function extraCheckall() { + for(i = 0;i < 5;i++) { + extraCheck(i); + } +} + +function deleteThread() { + if(confirm('确定要删除该文章吗?') != 0){ + $('delete').value = '1'; + $('postform').submit(); + } +} + +function hideAttachMenu(id) { + if($(editorid + '_' + id + '_menu')) { + $(editorid + '_' + id + '_menu').style.visibility = 'hidden'; + } +} \ No newline at end of file diff --git a/static/js/forum_slide.js b/static/js/forum_slide.js new file mode 100644 index 0000000..1222693 --- /dev/null +++ b/static/js/forum_slide.js @@ -0,0 +1,145 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: forum_slide.js 23838 2011-08-11 06:51:58Z monkey $ +*/ + + +if(isUndefined(sliderun)) { + var sliderun = 1; + + function slide() { + + var s = new Object(); + s.slideId = Math.random(); + s.slideSpeed = slideSpeed; + s.size = slideImgsize; + s.imgs = slideImgs; + s.imgLoad = new Array(); + s.imgnum = slideImgs.length; + s.imgLinks = slideImgLinks; + s.imgTexts = slideImgTexts; + s.slideBorderColor = slideBorderColor; + s.slideBgColor = slideBgColor; + s.slideSwitchColor = slideSwitchColor; + s.slideSwitchbgColor = slideSwitchbgColor; + s.slideSwitchHiColor = slideSwitchHiColor; + s.currentImg = 0; + s.prevImg = 0; + s.imgLoaded = 0; + s.st = null; + + s.loadImage = function () { + if(!s.imgnum) { + return; + } + s.size[0] = parseInt(s.size[0]); + s.size[1] = parseInt(s.size[1]); + document.write('
                  '); + document.write('
                  '); + document.write((typeof IMGDIR == 'undefined' ? '' : '
                  ') + '
                  0%
                  '); + document.write('
                  '); + $('outer_' + s.slideId).onclick = s.imageLink; + for(i = 1;i < s.imgnum;i++) { + switchdiv = document.createElement('div'); + switchdiv.id = 'switch_' + i + '_' + s.slideId; + switchdiv.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=70)'; + switchdiv.style.opacity = 0.7; + switchdiv.style.styleFloat = 'left'; + switchdiv.style.cssFloat = 'left'; + switchdiv.style.cursor = 'pointer'; + switchdiv.style.width = '17px'; + switchdiv.style.height = '17px'; + switchdiv.style.overflow = 'hidden'; + switchdiv.style.fontWeight = 'bold'; + switchdiv.style.textAlign = 'center'; + switchdiv.style.fontSize = '9px'; + switchdiv.style.color = s.slideSwitchColor; + switchdiv.style.borderRight = '1px solid ' + s.slideBorderColor; + switchdiv.style.borderTop = '1px solid ' + s.slideBorderColor; + switchdiv.style.backgroundColor = s.slideSwitchbgColor; + switchdiv.className = 'slideswitch'; + switchdiv.i = i; + switchdiv.onclick = function () { + s.switchImage(this); + }; + switchdiv.innerHTML = i; + $('switch_'+s.slideId).appendChild(switchdiv); + s.imgLoad[i] = new Image(); + s.imgLoad[i].src = s.imgs[i]; + s.imgLoad[i].onerror = function () { s.imgLoaded++; }; + } + s.loadCheck(); + }; + + s.imageLink = function () { + window.open(s.imgLinks[s.currentImg]); + }; + + s.switchImage = function (obj) { + s.showImage(obj.i); + s.interval(); + }; + + s.loadCheck = function () { + for(i = 1;i < s.imgnum;i++) { + if(s.imgLoad[i].complete && !s.imgLoad[i].status) { + s.imgLoaded++; + s.imgLoad[i].status = 1; + if(s.imgLoad[i].width > s.size[0] || s.imgLoad[i].height > s.size[1]) { + zr = s.imgLoad[i].width / s.imgLoad[i].height; + if(zr > 1) { + s.imgLoad[i].height = s.size[1]; + s.imgLoad[i].width = s.size[1] * zr; + } else { + s.imgLoad[i].width = s.size[0]; + s.imgLoad[i].height = s.size[0] / zr; + if(s.imgLoad[i].height > s.size[1]) { + s.imgLoad[i].height = s.size[1]; + s.imgLoad[i].width = s.size[1] * zr; + } + } + } + } + } + if(s.imgLoaded < s.imgnum - 1) { + $('percent_' + s.slideId).innerHTML = (parseInt(s.imgLoad.length / s.imgnum * 100)) + '%'; + setTimeout(function () { s.loadCheck(); }, 100); + } else { + for(i = 1;i < s.imgnum;i++) { + s.imgLoad[i].onclick = s.imageLink; + s.imgLoad[i].title = s.imgTexts[i]; + } + s.showImage(); + s.interval(); + } + }; + + s.interval = function () { + clearInterval(s.st); + s.st = setInterval(function () { s.showImage(); }, s.slideSpeed); + }; + + s.showImage = function (i) { + if(!i) { + s.currentImg++; + s.currentImg = s.currentImg < s.imgnum ? s.currentImg : 1; + } else { + s.currentImg = i; + } + if(s.prevImg) { + $('switch_' + s.prevImg + '_' + s.slideId).style.backgroundColor = s.slideSwitchbgColor; + } + $('switch_' + s.currentImg + '_' + s.slideId).style.backgroundColor = s.slideSwitchHiColor; + $('slide_' + s.slideId).innerHTML = ''; + $('slide_' + s.slideId).appendChild(s.imgLoad[s.currentImg]); + s.prevImg = s.currentImg; + }; + + s.loadImage(); + + } +} + +slide(); \ No newline at end of file diff --git a/static/js/forum_viewthread.js b/static/js/forum_viewthread.js new file mode 100644 index 0000000..d26d854 --- /dev/null +++ b/static/js/forum_viewthread.js @@ -0,0 +1,773 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: forum_viewthread.js 35221 2015-02-27 08:24:39Z nemohou $ +*/ + +var replyreload = '', attachimgST = new Array(), zoomgroup = new Array(), zoomgroupinit = new Array(); + +function attachimggroup(pid) { + if(!zoomgroupinit[pid]) { + for(i = 0;i < aimgcount[pid].length;i++) { + zoomgroup['aimg_' + aimgcount[pid][i]] = pid; + } + zoomgroupinit[pid] = true; + } +} + +function attachimgshow(pid, onlyinpost) { + onlyinpost = !onlyinpost ? false : onlyinpost; + aimgs = aimgcount[pid]; + aimgcomplete = 0; + loadingcount = 0; + for(i = 0;i < aimgs.length;i++) { + obj = $('aimg_' + aimgs[i]); + if(!obj) { + aimgcomplete++; + continue; + } + if(onlyinpost && !obj.getAttribute('inpost')) { + aimgcomplete++; + continue; + } + if(onlyinpost && obj.getAttribute('inpost') || !onlyinpost) { + if(!obj.status) { + obj.status = 1; + if(obj.getAttribute('file')) obj.src = obj.getAttribute('file'); + loadingcount++; + } else if(obj.status == 1) { + if(obj.complete) { + obj.status = 2; + } else { + loadingcount++; + } + } else if(obj.status == 2) { + aimgcomplete++; + if(obj.getAttribute('thumbImg')) { + thumbImg(obj); + } + } + if(loadingcount >= 10) { + break; + } + } + } + if(aimgcomplete < aimgs.length) { + setTimeout(function () { + attachimgshow(pid, onlyinpost); + }, 100); + } +} + +function attachimglstshow(pid, islazy, fid, showexif) { + var aimgs = aimgcount[pid]; + var s = ''; + if(fid) { + s = ' onmouseover="showMenu({\'ctrlid\':this.id, \'pos\': \'12!\'});"'; + } + if(typeof aimgcount == 'object' && $('imagelistthumb_' + pid)) { + for(pid in aimgcount) { + var imagelist = ''; + for(i = 0;i < aimgcount[pid].length;i++) { + if(!$('aimg_' + aimgcount[pid][i]) || $('aimg_' + aimgcount[pid][i]).getAttribute('inpost') || parseInt(aimgcount[pid][i]) != aimgcount[pid][i]) { + continue; + } + if(fid) { + imagelist += ''; + } + imagelist += '
                  ' + + '点击放大' + + '
                  '; + } + if($('imagelistthumb_' + pid)) { + $('imagelistthumb_' + pid).innerHTML = imagelist; + } + } + } +} + +function attachimggetsrc(img) { + return $(img).getAttribute('zoomfile') ? $(img).getAttribute('zoomfile') : $(img).getAttribute('file'); +} + +function attachimglst(pid, op, islazy) { + if(!op) { + $('imagelist_' + pid).style.display = 'none'; + $('imagelistthumb_' + pid).style.display = ''; + } else { + $('imagelistthumb_' + pid).style.display = 'none'; + $('imagelist_' + pid).style.display = ''; + if(islazy) { + o = new lazyload(); + o.showImage(); + } else { + attachimgshow(pid); + } + } + doane(); +} + +function attachimginfo(obj, infoobj, show, event) { + objinfo = fetchOffset(obj); + if(show) { + $(infoobj).style.left = objinfo['left'] + 'px'; + $(infoobj).style.top = obj.offsetHeight < 40 ? (objinfo['top'] + obj.offsetHeight) + 'px' : objinfo['top'] + 'px'; + $(infoobj).style.display = ''; + } else { + if(BROWSER.ie) { + $(infoobj).style.display = 'none'; + return; + } else { + var mousex = document.body.scrollLeft + event.clientX; + var mousey = document.documentElement.scrollTop + event.clientY; + if(mousex < objinfo['left'] || mousex > objinfo['left'] + objinfo['width'] || mousey < objinfo['top'] || mousey > objinfo['top'] + objinfo['height']) { + $(infoobj).style.display = 'none'; + } + } + } +} + +function signature(obj) { + if(obj.style.maxHeightIE != '') { + var height = (obj.scrollHeight > parseInt(obj.style.maxHeightIE)) ? obj.style.maxHeightIE : obj.scrollHeight + 'px'; + if(obj.innerHTML.indexOf(']*?>/i)) { + return; + } + var havetag = false; + var tagfindarray = new Array(); + var str = $('postmessage_'+pid).innerHTML.replace(/(^|>)([^<]+)(?=<|$)/ig, function($1, $2, $3, $4) { + for(i in tagarray) { + if(tagarray[i] && $3.indexOf(tagarray[i]) != -1) { + havetag = true; + $3 = $3.replace(tagarray[i], ''); + tmp = $3.replace(/&[a-z]*?[a-z]*?;/ig, ''); + if(tmp != $3) { + $3 = tmp; + } else { + tagfindarray[i] = tagarray[i]; + tagarray[i] = ''; + } + } + } + return $2 + $3; + }); + if(havetag) { + $('postmessage_'+pid).innerHTML = str.replace(//ig, function($1, $2) { + return '' + tagfindarray[$2] + ''; + }); + } +} + +function setanswer(pid, from){ + if(confirm('您确认要把该回复选为“最佳答案”吗?')){ + if(BROWSER.ie) { + doane(event); + } + $('modactions').action='forum.php?mod=misc&action=bestanswer&tid=' + tid + '&pid=' + pid + '&from=' + from + '&bestanswersubmit=yes'; + $('modactions').submit(); + } +} + +var authort; +function showauthor(ctrlObj, menuid) { + authort = setTimeout(function () { + showMenu({'menuid':menuid}); + if($(menuid + '_ma').innerHTML == '') $(menuid + '_ma').innerHTML = ctrlObj.innerHTML; + }, 500); + if(!ctrlObj.onmouseout) { + ctrlObj.onmouseout = function() { + clearTimeout(authort); + } + } +} + +function fastpostappendreply() { + if($('fastpostrefresh') != null) { + setcookie('fastpostrefresh', $('fastpostrefresh').checked ? 1 : 0, 2592000); + if($('fastpostrefresh').checked) { + location.href = 'forum.php?mod=redirect&tid='+tid+'&goto=lastpost&random=' + Math.random() + '#lastpost'; + return; + } + } + newpos = fetchOffset($('post_new')); + document.documentElement.scrollTop = newpos['top']; + $('post_new').style.display = ''; + $('post_new').id = ''; + div = document.createElement('div'); + div.id = 'post_new'; + div.style.display = 'none'; + div.className = ''; + $('postlistreply').appendChild(div); + $('fastpostsubmit').disabled = false; + if($('fastpostmessage')) { + $('fastpostmessage').value = ''; + } else { + editdoc.body.innerHTML = BROWSER.firefox ? '
                  ' : ''; + } + if($('fastpostform').seccodehash){ + updateseccode($('fastpostform').seccodehash.value); + $('fastpostform').seccodeverify.value = ''; + } + if($('fastpostform').secqaahash){ + updatesecqaa($('fastpostform').secqaahash.value); + $('fastpostform').secanswer.value = ''; + } + showCreditPrompt(); +} + +function succeedhandle_fastpost(locationhref, message, param) { + var pid = param['pid']; + var tid = param['tid']; + var from = param['from']; + var reply_mod = param['reply_mod']; + if(!reply_mod) { + ajaxget('forum.php?mod=viewthread&tid=' + tid + '&viewpid=' + pid + '&from=' + from, 'post_new', 'ajaxwaitid', '', null, 'fastpostappendreply()'); + if(replyreload) { + var reloadpids = replyreload.split(','); + for(var i = 1;i < reloadpids.length;i++) { + ajaxget('forum.php?mod=viewthread&tid=' + tid + '&viewpid=' + reloadpids[i] + '&from=' + from, 'post_' + reloadpids[i], 'ajaxwaitid'); + } + } + $('fastpostreturn').className = ''; + } else { + if(!message) { + message = '本版回帖需要审核,您的文章将在通过审核后显示'; + } + $('post_new').style.display = $('fastpostmessage').value = $('fastpostreturn').className = ''; + $('fastpostreturn').innerHTML = message; + } + if(param['sechash']) { + updatesecqaa(param['sechash']); + updateseccode(param['sechash']); + } + if($('attach_tblheader')) { + $('attach_tblheader').style.display = 'none'; + } + if($('attachlist')) { + $('attachlist').innerHTML = ''; + } +} + +function errorhandle_fastpost() { + $('fastpostsubmit').disabled = false; +} + +function succeedhandle_comment(locationhref, message, param) { + ajaxget('forum.php?mod=misc&action=commentmore&tid=' + param['tid'] + '&pid=' + param['pid'], 'comment_' + param['pid']); + hideWindow('comment'); + showCreditPrompt(); +} + +function succeedhandle_postappend(locationhref, message, param) { + ajaxget('forum.php?mod=viewthread&tid=' + param['tid'] + '&viewpid=' + param['pid'], 'post_' + param['pid'], 'ajaxwaitid'); + hideWindow('postappend'); +} + +function recommendupdate(n) { + if(getcookie('recommend')) { + var objv = n > 0 ? $('recommendv_add') : $('recommendv_subtract'); + objv.style.display = ''; + objv.innerHTML = parseInt(objv.innerHTML) + 1; + setTimeout(function () { + $('recommentc').innerHTML = parseInt($('recommentc').innerHTML) + n; + $('recommentv').style.display = 'none'; + }, 1000); + setcookie('recommend', ''); + } +} + +function postreviewupdate(pid, n) { + var objv = n > 0 ? $('review_support_'+pid) : $('review_against_'+pid); + objv.innerHTML = parseInt(objv.innerHTML ? objv.innerHTML : 0) + 1; +} + +function favoriteupdate() { + var obj = $('favoritenumber'); + obj.style.display = ''; + obj.innerHTML = parseInt(obj.innerHTML) + 1; +} + +function switchrecommendv() { + display('recommendv'); + display('recommendav'); +} + +function appendreply() { + newpos = fetchOffset($('post_new')); + document.documentElement.scrollTop = newpos['top']; + $('post_new').style.display = ''; + $('post_new').id = ''; + div = document.createElement('div'); + div.id = 'post_new'; + div.style.display = 'none'; + div.className = ''; + $('postlistreply').appendChild(div); + if($('postform')) { + $('postform').replysubmit.disabled = false; + } + showCreditPrompt(); +} + +function poll_checkbox(obj) { + if(obj.checked) { + p++; + for (var i = 0; i < $('poll').elements.length; i++) { + var e = $('poll').elements[i]; + if(p == max_obj) { + if(e.name.match('pollanswers') && !e.checked) { + e.disabled = true; + } + } + } + } else { + p--; + for (var i = 0; i < $('poll').elements.length; i++) { + var e = $('poll').elements[i]; + if(e.name.match('pollanswers') && e.disabled) { + e.disabled = false; + } + } + } + $('pollsubmit').disabled = p <= max_obj && p > 0 ? false : true; +} + +function itemdisable(i) { + if($('itemt_' + i).className == 'z') { + $('itemt_' + i).className = 'z xg1'; + $('itemc_' + i).value = ''; + itemset(i); + } else { + $('itemt_' + i).className = 'z'; + $('itemc_' + i).value = $('itemc_' + i).value > 0 ? $('itemc_' + i).value : 0; + } +} +function itemop(i, v) { + $('item_' + i).className = 'z cmstar cmstv_' + v; +} +function itemclk(i, v) { + $('itemc_' + i).value = v; + $('itemt_' + i).className = 'z'; +} +function itemset(i) { + var v = $('itemc_' + i).value; + v = v ? v : 0; + $('item_' + i).className = 'z cmstar cmstv_' + v; +} + +function checkmgcmn(id) { + if($('mgc_' + id) && !$('mgc_' + id + '_menu').getElementsByTagName('li').length) { + $('mgc_' + id).innerHTML = ''; + $('mgc_' + id).style.display = 'none'; + } +} + +function toggleRatelogCollapse(tarId, ctrlObj) { + if($(tarId).className == 'rate') { + $(tarId).className = 'rate rate_collapse'; + setcookie('ratecollapse', 1, 2592000); + ctrlObj.innerHTML = '展开'; + } else { + $(tarId).className = 'rate'; + setcookie('ratecollapse', 0, -2592000); + ctrlObj.innerHTML = '收起'; + } +} + +function copyThreadUrl(obj, bbname) { + bbname = bbname || SITEURL; + setCopy($('thread_subject').innerHTML.replace(/&/g, '&') + '\n' + obj.href + '\n' + '(出处: '+bbname+')' + '\n', '文章地址已经复制到剪贴板'); + return false; +} + +function replyNotice() { + var newurl = 'forum.php?mod=misc&action=replynotice&tid=' + tid + '&op='; + var replynotice = $('replynotice'); + var status = replynotice.getAttribute("status"); + if(status == 1) { + replynotice.href = newurl + 'receive'; + replynotice.innerHTML = '接收回复通知'; + replynotice.setAttribute("status", 0); + } else { + replynotice.href = newurl + 'ignore'; + replynotice.innerHTML = '取消回复通知'; + replynotice.setAttribute("status", 1); + } +} + +function lazyload(className) { + var obj = this; + lazyload.className = className; + this.getOffset = function (el, isLeft) { + var retValue = 0 ; + while (el != null ) { + retValue += el["offset" + (isLeft ? "Left" : "Top" )]; + el = el.offsetParent; + } + return retValue; + }; + this.initImages = function (ele) { + lazyload.imgs = []; + var eles = lazyload.className ? $C(lazyload.className, ele) : [document.body]; + for (var i = 0; i < eles.length; i++) { + var imgs = eles[i].getElementsByTagName('IMG'); + for(var j = 0; j < imgs.length; j++) { + if(imgs[j].getAttribute('file') && !imgs[j].getAttribute('lazyloaded')) { + if(this.getOffset(imgs[j]) > document.documentElement.clientHeight) { + lazyload.imgs.push(imgs[j]); + } else { + imgs[j].onload = function(){thumbImg(this);}; + imgs[j].setAttribute('src', imgs[j].getAttribute('file')); + imgs[j].setAttribute('lazyloaded', 'true'); + } + } + } + } + }; + this.showImage = function() { + this.initImages(); + if(!lazyload.imgs.length) return false; + var imgs = []; + var scrollTop = Math.max(document.documentElement.scrollTop , document.body.scrollTop); + for (var i=0; i document.documentElement.clientHeight && (offsetTop - scrollTop < document.documentElement.clientHeight)) { + var dom = document.createElement('div'); + var width = img.getAttribute('width') ? img.getAttribute('width') : 100; + var height = img.getAttribute('height') ? img.getAttribute('height') : 100; + dom.innerHTML = '
                  '; + img.parentNode.insertBefore(dom.childNodes[0], img); + img.onload = function () { + if(!this.getAttribute('_load')) { + this.setAttribute('_load', 1); + this.style.width = this.style.height = ''; + this.parentNode.removeChild(this.previousSibling); + if(this.getAttribute('lazyloadthumb')) { + thumbImg(this); + } + } + }; + img.style.width = img.style.height = '1px'; + img.setAttribute('src', img.getAttribute('file') ? img.getAttribute('file') : img.getAttribute('src')); + img.setAttribute('lazyloaded', true); + } else { + imgs.push(img); + } + } + lazyload.imgs = imgs; + return true; + }; + this.showImage(); + _attachEvent(window, 'scroll', function(){obj.showImage();}); +} +function update_collection(){ + var obj = $('collectionnumber'); + sum = 1; + obj.style.display = ''; + obj.innerText = parseInt(obj.innerText)+sum; +} +function display_blocked_post() { + var movehiddendiv = (!$('hiddenposts').innerHTML) ? true : false; + for (var i = 0; i < blockedPIDs.length; i++) { + if(movehiddendiv) { + $('hiddenposts').appendChild($("post_"+blockedPIDs[i])); + } + display("post_"+blockedPIDs[i]); + } + var postlistreply = $('postlistreply').innerHTML; + $('hiddenpoststip').parentNode.removeChild($('postlistreply')); + $('hiddenpoststip').parentNode.removeChild($('hiddenpoststip')); + $('hiddenposts').innerHTML+='
                  '+postlistreply+'
                  '; +} + +function show_threadpage(pid, current, maxpage, ispreview) { + if(!$('threadpage') || typeof tid == 'undefined') { + return; + }; + var clickvalue = function (page) { + return 'ajaxget(\'forum.php?mod=viewthread&tid=' + tid + '&viewpid=' + pid + '&cp=' + page + (ispreview ? '&from=preview' : '') + '\', \'post_' + pid + '\', \'ajaxwaitid\');'; + }; + var pstart = current - 1; + pstart = pstart < 1 ? 1 : pstart; + var pend = current + 1; + pend = pend > maxpage ? maxpage : pend; + var s = '
                  '; + if(pstart > 1) { + s += '1 ...'; + } + for(i = pstart;i <= pend;i++) { + s += i == current ? '' + i + '' : '' + i + ''; + } + if(pend < maxpage) { + s += '... ' + maxpage + ''; + } + if(current < maxpage) { + s += '下一页'; + } + s += '查看所有'; + s += '
                  '; + $('threadpage').innerHTML = s; +} + +var show_threadindex_data = ''; +function show_threadindex(pid, ispreview) { + if(!show_threadindex_data) { + var s = '

                  目录

                    '; + for(i in $('threadindex').childNodes) { + o = $('threadindex').childNodes[i]; + if(o.tagName == 'A') { + var sub = o.getAttribute('sub').length * 2; + o.href = "javascript:;"; + if(o.getAttribute('page')) { + s += '
                  • ' + o.innerHTML + '
                  • '; + } else if(o.getAttribute('tid') && o.getAttribute('pid')) { + s += '
                  • ' + o.innerHTML + '
                  • '; + } + } + } + s += '
                  '; + $('threadindex').innerHTML = s; + show_threadindex_data = s; + } else { + $('threadindex').innerHTML = show_threadindex_data; + } +} +function ctrlLeftInfo(sli_staticnum) { + var sli = $('scrollleftinfo'); + var postlist_bottom = parseInt($('postlist').getBoundingClientRect().bottom); + var sli_bottom = parseInt(sli.getBoundingClientRect().bottom); + if(postlist_bottom < sli_staticnum && postlist_bottom != sli_bottom) { + sli.style.top = (postlist_bottom - sli.offsetHeight - 5)+'px'; + } else{ + sli.style.top = 'auto'; + } +} + +function fixed_avatar(pids, fixednv) { + var fixedtopnv = fixednv ? new fixed_top_nv('nv', true) : false; + if(fixednv) { + fixedtopnv.init(); + } + function fixedavatar(e) { + var avatartop = fixednv ? fixedtopnv.run() : 0; + for(var i = 0; i < pids.length; i++) { + var pid = pids[i]; + var posttable = $('pid'+pid); + var postavatar = $('favatar'+pid); + if(!$('favatar'+pid)) { + return; + } + var nextpost = $('_postposition'+pid); + if(!postavatar || !nextpost || posttable.offsetHeight - 100 < postavatar.offsetHeight) { + if(postavatar.style.position == 'fixed') { + postavatar.style.position = ''; + } + continue; + } + var avatarstyle = postavatar.style; + posttabletop = parseInt(posttable.getBoundingClientRect().top); + nextposttop = parseInt(nextpost.getBoundingClientRect().top); + if(nextposttop > avatartop && nextposttop <= postavatar.offsetHeight + avatartop) { + if(avatarstyle.position != 'absolute') { + postavatar.parentNode.style.position = 'relative'; + avatarstyle.top = ''; + avatarstyle.bottom = '0px'; + avatarstyle.position = 'absolute'; + } + } else if(posttabletop < avatartop && nextposttop > avatartop) { + if(postavatar.parentNode.style.position != '') { + postavatar.parentNode.style.position = ''; + } + if(avatarstyle.position != 'fixed' || parseInt(avatarstyle.top) != avatartop) { + avatarstyle.bottom = ''; + avatarstyle.top = avatartop + 'px'; + avatarstyle.position = 'fixed'; + } + } else if(avatarstyle.position != '') { + avatarstyle.position = ''; + } + } + } + if(!(BROWSER.ie && BROWSER.ie < 7)) { + _attachEvent(window, 'load', function(){_attachEvent(window, 'scroll', fixedavatar);}); + } +} + +function submitpostpw(pid, tid) { + var obj = $('postpw_' + pid); + appendscript(JSPATH + 'md5.js?' + VERHASH); + safescript('md5_js', function () { + setcookie('postpw_' + pid, hex_md5(obj.value)); + if(!tid) { + location.href = location.href; + } else { + location.href = 'forum.php?mod=viewthread&tid='+tid; + } + }, 100, 50); +} + +function threadbegindisplay(type, w, h, s) { + + $('begincloseid').onclick = function() { + $('threadbeginid').style.display = 'none'; + }; + var imgobj = $('threadbeginid'); + imgobj.style.left = (document.body.clientWidth - w)/2 + 'px'; + imgobj.style.top = (document.body.clientHeight - h)/2 + 'px'; + if(type == 1) { + autozoom(w, h, s); + } else if(type == 2) { + autofade(w, h, s); + } else { + setTimeout(function() { + $('threadbeginid').style.display = 'none'; + }, s); + } +} + +function autofade(w, h, s) { + this.imgobj = $('threadbeginid'); + this.opacity = 0; + this.fadein = function() { + if(BROWSER.ie) { + this.imgobj.filters.alpha.opacity = this.opacity; + } else { + this.imgobj.style.opacity = this.opacity/100; + } + if(this.opacity >= 100) { + setTimeout(this.fadeout, s); + return; + } + this.opacity++; + setTimeout(this.fadein, 50); + }; + this.fadeout = function() { + if(BROWSER.ie) { + this.imgobj.filters.alpha.opacity = this.opacity; + } else { + this.imgobj.style.opacity = this.opacity/100; + } + if(this.opacity <= 0) { + this.imgobj.style.display = 'none'; + return; + } + this.opacity--; + setTimeout(this.fadeout, 50); + }; + this.fadein(); +} + +function autozoom(w, h, s) { + this.height = 0; + this.imgobj = $('threadbeginid'); + this.imgobj.style.overflow = 'hidden'; + this.imgobj.style.display = ''; + this.autozoomin = function() { + this.height += 5; + if(this.height >= h) { + this.imgobj.style.height = h + 'px'; + setTimeout(this.autozoomout, s); + return; + } + this.imgobj.style.height = this.height + 'px'; + setTimeout(this.autozoomin, 50); + }; + this.autozoomout = function() { + this.height -= 5; + if(this.height <= 0) { + this.imgobj.style.height = 0 + 'px'; + this.imgobj.style.display = 'none'; + return; + } + this.imgobj.style.height = this.height + 'px'; + setTimeout(this.autozoomout, 50); + }; + this.autozoomin(); +} + +function readmode(title, pid) { + + var imagelist = ''; + if(aimgcount[pid]) { + for(var i = 0; i < aimgcount[pid].length;i++) { + var aimgObj = $('aimg_'+aimgcount[pid][i]); + if(aimgObj.parentElement.className!="mbn") { + var src = aimgObj.getAttribute('file'); + imagelist += '
                  '; + } + } + } + msg = $('postmessage_'+pid).innerHTML+imagelist; + msg = '
                  '+msg+'
                  '; + showDialog(msg, 'info', title, null, 1); + var coverObj = $('fwin_dialog_cover'); + coverObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=90)'; + coverObj.style.opacity = 0.9; +} + +function changecontentdivid(tid) { + if($('postlistreply')) { + objtid = $('postlistreply').getAttribute('tid'); + if(objtid == tid) { + return; + } + $('postlistreply').id = 'postlistreply_'+objtid; + postnewdiv = $('postlistreply_'+objtid).childNodes; + postnewdiv[postnewdiv.length-1].id = 'post_new_'+objtid; + } + $('postlistreply_'+tid).id = 'postlistreply'; + postnewdiv = $('postlistreply').childNodes; + postnewdiv[postnewdiv.length-1].id = 'post_new'; +} + +function showmobilebbs(obj) { + var content = '

                  下载掌上论坛{lang close}

                  Andriod版本,扫描二维码可以直接下载到手机

                  适用于装有安卓系统的三星/HTC/小米等手机

                  iPhone版本,扫描二维码可以直接下载到手机

                  适用于苹果手机

                  '; + showWindow('mobilebbs', content, 'html'); +} + +function succeedhandle_vfastpost(url, message, param) { + $('vmessage').value = ''; + succeedhandle_fastpost(url, message, param); + showCreditPrompt(); +} + +function vmessage() { + var vf_tips = '#在这里快速回复#'; + $('vmessage').value = vf_tips; + $('vmessage').style.color = '#CDCDCD'; + $('vmessage').onclick = function() { + if($('vmessage').value==vf_tips) { + $('vmessage').value=''; + $('vmessage').style.color="#000"; + } + }; + $('vmessage').onblur = function() { + if(!$('vmessage').value) { + $('vmessage').value=vf_tips; + $('vmessage').style.color="#CDCDCD"; + } + }; + $('vreplysubmit').onclick = function() { + if($('vmessage').value == vf_tips) { + return false; + } + }; + $('vmessage').onfocus = function() { + ajaxget('forum.php?mod=ajax&action=checkpostrule&ac=reply', 'vfastpostseccheck'); + $('vmessage').onfocus = null; + }; +} \ No newline at end of file diff --git a/static/js/google.js b/static/js/google.js new file mode 100644 index 0000000..7784cff --- /dev/null +++ b/static/js/google.js @@ -0,0 +1,34 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: google.js 23838 2011-08-11 06:51:58Z monkey $ +*/ + +document.writeln(''); +document.writeln('
                  '); +document.writeln(''); +document.writeln(''); +document.writeln(''); +document.writeln(''); +document.writeln(''); +document.writeln(''); +document.write('
                  Google
                  '); +document.writeln('  '); +document.writeln(''); +document.writeln(' '); +document.writeln('
                  '); \ No newline at end of file diff --git a/static/js/handlers.js b/static/js/handlers.js new file mode 100644 index 0000000..f87eed9 --- /dev/null +++ b/static/js/handlers.js @@ -0,0 +1,470 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: handlers.js 31952 2012-10-25 09:20:40Z zhengqingpeng $ +*/ + +var sdCloseTime = 2; +function preLoad() { + if(!this.support.loading) { + disableMultiUpload(this.customSettings); + return false; + } +} +function loadFailed() { + disableMultiUpload(this.customSettings); +} +function disableMultiUpload(obj) { + if(obj.uploadSource == 'forum' && obj.uploadFrom != 'fastpost') { + try{ + obj.singleUpload.style.display = ''; + var dIdStr = obj.singleUpload.getAttribute("did"); + if(dIdStr != null) { + if(typeof forum_post_inited == 'undefined') { + appendscript(JSPATH + 'forum_post.js?' + VERHASH); + } + var idArr = dIdStr.split("|"); + $(idArr[0]).style.display = 'none'; + if(idArr[1] == 'local') { + switchImagebutton('local'); + } else if(idArr[1] == 'upload') { + switchAttachbutton('upload'); + } + } + } catch (e) { + } + } +} +function fileDialogStart() { + if(this.customSettings.uploadSource == 'forum') { + this.customSettings.alertType = 0; + if(this.customSettings.uploadFrom == 'fastpost') { + if(typeof forum_post_inited == 'undefined') { + appendscript(JSPATH + 'forum_post.js?' + VERHASH); + } + } + } +} +function fileQueued(file) { + try { + var createQueue = true; + if(this.customSettings.uploadSource == 'forum' && this.customSettings.uploadType == 'poll') { + var inputObj = $(this.customSettings.progressTarget+'_aid'); + if(inputObj && parseInt(inputObj.value)) { + this.addPostParam('aid', inputObj.value); + } + } else if(this.customSettings.uploadSource == 'portal') { + var inputObj = $('catid'); + if(inputObj && parseInt(inputObj.value)) { + this.addPostParam('catid', inputObj.value); + } + } + var progress = new FileProgress(file, this.customSettings.progressTarget); + if(this.customSettings.uploadSource == 'forum') { + if(this.customSettings.maxAttachNum != undefined) { + if(this.customSettings.maxAttachNum > 0) { + this.customSettings.maxAttachNum--; + } else { + this.customSettings.alertType = 6; + createQueue = false; + } + } + + if(createQueue && this.customSettings.maxSizePerDay != undefined) { + if(this.customSettings.maxSizePerDay - file.size > 0) { + this.customSettings.maxSizePerDay = this.customSettings.maxSizePerDay - file.size + } else { + this.customSettings.alertType = 11; + createQueue = false; + } + } + if(createQueue && this.customSettings.filterType != undefined) { + var fileSize = this.customSettings.filterType[file.type.substr(1).toLowerCase()]; + if(fileSize != undefined && fileSize && file.size > fileSize) { + this.customSettings.alertType = 5; + createQueue = false; + } + } + + } + if(createQueue) { + progress.setStatus("等待上传..."); + } else { + this.cancelUpload(file.id); + progress.setCancelled(); + } + progress.toggleCancel(true, this); + + + } catch (ex) { + this.debug(ex); + } + +} + +function fileQueueError(file, errorCode, message) { + try { + if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) { + message = parseInt(message); + showDialog("您选择的文件个数超过限制。\n"+(message === 0 ? "您已达到上传文件的上限了。" : "您还可以选择 " + message + " 个文件"), 'notice', null, null, 0, null, null, null, null, sdCloseTime); + return; + } + + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setError(); + progress.toggleCancel(false); + + switch (errorCode) { + case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: + progress.setStatus("文件太大."); + this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: + progress.setStatus("不能上传零字节文件."); + this.debug("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: + progress.setStatus("禁止上传该类型的文件."); + this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: + alert("You have selected too many files. " + (message > 1 ? "You may only add " + message + " more files" : "You cannot add any more files.")); + break; + default: + if (file !== null) { + progress.setStatus("Unhandled Error"); + } + this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + } + } catch (ex) { + this.debug(ex); + } +} + +function fileDialogComplete(numFilesSelected, numFilesQueued) { + try { + if(this.customSettings.uploadSource == 'forum') { + if(this.customSettings.uploadType == 'attach') { + if(typeof switchAttachbutton == "function") { + switchAttachbutton('attachlist'); + } + try { + if(this.getStats().files_queued) { + $('attach_tblheader').style.display = ''; + $('attach_notice').style.display = ''; + } + } catch (ex) {} + } else if(this.customSettings.uploadType == 'image') { + if(typeof switchImagebutton == "function") { + switchImagebutton('imgattachlist'); + } + try { + $('imgattach_notice').style.display = ''; + } catch (ex) {} + } + var objId = this.customSettings.uploadType == 'attach' ? 'attachlist' : 'imgattachlist'; + var listObj = $(objId); + var tableObj = listObj.getElementsByTagName("table"); + if(!tableObj.length) { + listObj.innerHTML = ""; + } + } else if(this.customSettings.uploadType == 'blog') { + if(typeof switchImagebutton == "function") { + switchImagebutton('imgattachlist'); + } + } + this.startUpload(); + } catch (ex) { + this.debug(ex); + } +} + +function uploadStart(file) { + try { + this.addPostParam('filetype', file.type); + if(this.customSettings.uploadSource == 'forum' && this.customSettings.uploadType == 'poll') { + var preObj = $(this.customSettings.progressTarget); + preObj.style.display = 'none'; + preObj.innerHTML = ''; + } + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setStatus("上传中..."); + progress.toggleCancel(true, this); + if(this.customSettings.uploadSource == 'forum') { + var objId = this.customSettings.uploadType == 'attach' ? 'attachlist' : 'imgattachlist'; + var attachlistObj = $(objId).parentNode; + attachlistObj.scrollTop = $(file.id).offsetTop - attachlistObj.clientHeight; + } + } catch (ex) { + } + + return true; +} + +function uploadProgress(file, bytesLoaded, bytesTotal) { + + try { + var percent = Math.ceil((bytesLoaded / bytesTotal) * 100); + + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setStatus("正在上传("+percent+"%)..."); + + } catch (ex) { + this.debug(ex); + } +} + +function uploadSuccess(file, serverData) { + try { + var progress = new FileProgress(file, this.customSettings.progressTarget); + if(this.customSettings.uploadSource == 'forum') { + if(this.customSettings.uploadType == 'poll') { + var data = eval('('+serverData+')'); + if(parseInt(data.aid)) { + var preObj = $(this.customSettings.progressTarget); + preObj.innerHTML = ""; + preObj.style.display = ''; + var img = new Image(); + img.src = IMGDIR + '/attachimg_2.png';//data.smallimg; + var imgObj = document.createElement("img"); + imgObj.src = img.src; + imgObj.className = "cur1"; + imgObj.onmouseout = function(){hideMenu('poll_img_preview_'+data.aid+'_menu');};//"hideMenu('poll_img_preview_"+data.aid+"_menu');"; + imgObj.onmouseover = function(){showMenu({'menuid':'poll_img_preview_'+data.aid+'_menu','ctrlclass':'a','duration':2,'timeout':0,'pos':'34'});};//"showMenu({'menuid':'poll_img_preview_"+data.aid+"_menu','ctrlclass':'a','duration':2,'timeout':0,'pos':'34'});"; + preObj.appendChild(imgObj); + var inputObj = document.createElement("input"); + inputObj.type = 'hidden'; + inputObj.name = 'pollimage[]'; + inputObj.id = this.customSettings.progressTarget+'_aid'; + inputObj.value= data.aid; + preObj.appendChild(inputObj); + var preImgObj = document.createElement("span"); + preImgObj.style.display = 'none'; + preImgObj.id = 'poll_img_preview_'+data.aid+'_menu'; + img = new Image(); + img.src = data.smallimg; + imgObj = document.createElement("img"); + imgObj.src = img.src; + preImgObj.appendChild(imgObj); + preObj.appendChild(preImgObj); + } + } else { + aid = parseInt(serverData); + if(aid > 0) { + if(this.customSettings.uploadType == 'attach') { + ajaxget('forum.php?mod=ajax&action=attachlist&aids=' + aid + (!fid ? '' : '&fid=' + fid)+(typeof resulttype == 'undefined' ? '' : '&result=simple'), file.id); + } else if(this.customSettings.uploadType == 'image') { + var tdObj = getInsertTdId(this.customSettings.imgBoxObj, 'image_td_'+aid); + ajaxget('forum.php?mod=ajax&action=imagelist&type=single&pid=' + pid + '&aids=' + aid + (!fid ? '' : '&fid=' + fid), tdObj.id); + $(file.id).style.display = 'none'; + } + } else { + aid = aid < -1 ? Math.abs(aid) : aid; + if(typeof STATUSMSG[aid] == "string") { + progress.setStatus(STATUSMSG[aid]); + showDialog(STATUSMSG[aid], 'notice', null, null, 0, null, null, null, null, sdCloseTime); + } else { + progress.setStatus("取消上传"); + } + this.cancelUpload(file.id); + progress.setCancelled(); + progress.toggleCancel(true, this); + var stats = this.getStats(); + var obj = {'successful_uploads':--stats.successful_uploads, 'upload_cancelled':++stats.upload_cancelled}; + this.setStats(obj); + } + } + } else if(this.customSettings.uploadType == 'album') { + var data = eval('('+serverData+')'); + if(parseInt(data.picid)) { + var newTr = document.createElement("TR"); + var newTd = document.createElement("TD"); + var img = new Image(); + img.src = data.url; + var imgObj = document.createElement("img"); + imgObj.src = img.src; + newTd.className = 'c'; + newTd.appendChild(imgObj); + newTr.appendChild(newTd); + newTd = document.createElement("TD"); + newTd.innerHTML = ''+file.name+''; + newTr.appendChild(newTd); + newTd = document.createElement("TD"); + newTd.className = 'd'; + newTd.innerHTML = '图片描述
                  '; + newTr.appendChild(newTd); + this.customSettings.imgBoxObj.appendChild(newTr); + } else { + showDialog('图片上传失败', 'notice', null, null, 0, null, null, null, null, sdCloseTime); + } + $(file.id).style.display = 'none'; + } else if(this.customSettings.uploadType == 'blog') { + var data = eval('('+serverData+')'); + if(parseInt(data.picid)) { + var tdObj = getInsertTdId(this.customSettings.imgBoxObj, 'image_td_'+data.picid); + var img = new Image(); + img.src = data.url; + var imgObj = document.createElement("img"); + imgObj.src = img.src; + imgObj.className = "cur1"; + imgObj.onclick = function() {insertImage(data.bigimg);}; + tdObj.appendChild(imgObj); + var inputObj = document.createElement("input"); + inputObj.type = 'hidden'; + inputObj.name = 'picids['+data.picid+']'; + inputObj.value= data.picid; + tdObj.appendChild(inputObj); + } else { + showDialog('图片上传失败', 'notice', null, null, 0, null, null, null, null, sdCloseTime); + } + $(file.id).style.display = 'none'; + } else if(this.customSettings.uploadSource == 'portal') { + var data = eval('('+serverData+')'); + if(data.aid) { + if(this.customSettings.uploadType == 'attach') { + ajaxget('portal.php?mod=attachment&op=getattach&type=attach&id=' + data.aid, file.id); + if($('attach_tblheader')) { + $('attach_tblheader').style.display = ''; + } + } else { + var tdObj = getInsertTdId(this.customSettings.imgBoxObj, 'attach_list_'+data.aid); + ajaxget('portal.php?mod=attachment&op=getattach&id=' + data.aid, tdObj.id); + $(file.id).style.display = 'none'; + } + } else { + showDialog('上传失败', 'notice', null, null, 0, null, null, null, null, sdCloseTime); + progress.setStatus("Cancelled"); + this.cancelUpload(file.id); + progress.setCancelled(); + progress.toggleCancel(true, this); + } + } else { + progress.setComplete(); + progress.setStatus("上传完成."); + progress.toggleCancel(false); + } + } catch (ex) { + this.debug(ex); + } +} + +function getInsertTdId(boxObj, tdId) { + var tableObj = boxObj.getElementsByTagName("table"); + var tbodyObj, trObj, tdObj; + if(!tableObj.length) { + tableObj = document.createElement("table"); + tableObj.className = "imgl"; + tbodyObj = document.createElement("TBODY"); + tableObj.appendChild(tbodyObj); + boxObj.appendChild(tableObj); + + } else if(!tableObj[0].getElementsByTagName("tbody").length) { + tbodyObj = document.createElement("TBODY"); + tableObj.appendChild(tbodyObj); + } else { + tableObj = tableObj[0]; + tbodyObj = tableObj.getElementsByTagName("tbody")[0]; + } + + var createTr = true; + var inserID = 0; + if(tbodyObj.childNodes.length) { + trObj = tbodyObj.childNodes[tbodyObj.childNodes.length -1]; + var findObj = trObj.getElementsByTagName("TD"); + for(var j=0; j < findObj.length; j++) { + if(findObj[j].id == "") { + inserID = j; + tdObj = findObj[j]; + break; + } + } + if(inserID) { + createTr = false; + } + } + if(createTr) { + trObj = document.createElement("TR"); + for(var i=0; i < 4; i++) { + var newTd = document.createElement("TD"); + newTd.width = "25%"; + newTd.vAlign = "bottom"; + newTd.appendChild(document.createTextNode(" ")); + trObj.appendChild(newTd); + } + tdObj = trObj.childNodes[0]; + tbodyObj.appendChild(trObj); + } + tdObj.id = tdId; + return tdObj; +} +function uploadComplete(file) { + try { + if (this.getStats().files_queued === 0) { + } else { + this.startUpload(); + } + } catch (ex) { + this.debug(ex); + } + +} + +function uploadError(file, errorCode, message) { + try { + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setError(); + progress.toggleCancel(false); + + switch (errorCode) { + case SWFUpload.UPLOAD_ERROR.HTTP_ERROR: + progress.setStatus("Upload Error: " + message); + this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL: + progress.setStatus("Configuration Error"); + this.debug("Error Code: No backend file, File name: " + file.name + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED: + progress.setStatus("Upload Failed."); + this.debug("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.IO_ERROR: + progress.setStatus("Server (IO) Error"); + this.debug("Error Code: IO Error, File name: " + file.name + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR: + progress.setStatus("Security Error"); + this.debug("Error Code: Security Error, File name: " + file.name + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED: + progress.setStatus("Upload limit exceeded."); + this.debug("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND: + progress.setStatus("File not found."); + this.debug("Error Code: The file was not found, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED: + progress.setStatus("Failed Validation. Upload skipped."); + this.debug("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: + if (this.getStats().files_queued === 0) { + } + progress.setStatus(this.customSettings.alertType ? STATUSMSG[this.customSettings.alertType] : "Cancelled"); + progress.setCancelled(); + break; + case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: + progress.setStatus("Stopped"); + break; + default: + progress.setStatus("Unhandled Error: " + error_code); + this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + } + } catch (ex) { + this.debug(ex); + } +} \ No newline at end of file diff --git a/static/js/home.js b/static/js/home.js new file mode 100644 index 0000000..ce439a4 --- /dev/null +++ b/static/js/home.js @@ -0,0 +1,1062 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: home.js 34052 2013-09-25 06:18:43Z andyzheng $ +*/ + +var note_step = 0; +var note_oldtitle = document.title; +var note_timer; + +function addSort(obj) { + if (obj.value == 'addoption') { + showWindow('addoption', 'home.php?mod=spacecp&ac=blog&op=addoption&handlekey=addoption&oid='+obj.id); + } +} + +function addOption(sid, aid) { + var obj = $(aid); + var newOption = $(sid).value; + $(sid).value = ""; + if (newOption!=null && newOption!='') { + var newOptionTag=document.createElement('option'); + newOptionTag.text=newOption; + newOptionTag.value="new:" + newOption; + try { + obj.add(newOptionTag, obj.options[0]); + } catch(ex) { + obj.add(newOptionTag, obj.selecedIndex); + } + obj.value="new:" + newOption; + } else { + obj.value=obj.options[0].value; + } +} + +function blogAddOption(sid, aid) { + var obj = $(aid); + var newOption = $(sid).value; + newOption = newOption.replace(/^\s+|\s+$/g,""); + $(sid).value = ""; + if (newOption!=null && newOption!='') { + var newOptionTag=document.createElement('option'); + newOptionTag.text=newOption; + newOptionTag.value="new:" + newOption; + try { + obj.add(newOptionTag, obj.options[0]); + } catch(ex) { + obj.add(newOptionTag, obj.selecedIndex); + } + obj.value="new:" + newOption; + return true; + } else { + alert('分类名不能为空!'); + return false; + } +} + +function blogCancelAddOption(aid) { + var obj = $(aid); + obj.value=obj.options[0].value; +} + +function checkAll(form, name) { + for(var i = 0; i < form.elements.length; i++) { + var e = form.elements[i]; + if(e.name.match(name)) { + e.checked = form.elements['chkall'].checked; + } + } +} + +function cnCode(str) { + str = str.replace(/<\/?[^>]+>|\[\/?.+?\]|"/ig, ""); + str = str.replace(/\s{2,}/ig, ' '); + return BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(str) : str; +} + +function getExt(path) { + return path.lastIndexOf('.') == -1 ? '' : path.substr(path.lastIndexOf('.') + 1, path.length).toLowerCase(); +} + +function resizeImg(id,size) { + var theImages = $(id).getElementsByTagName('img'); + for (i=0; i size) { + this.style.width = size + 'px'; + if (this.parentNode.tagName.toLowerCase() != 'a') { + var zoomDiv = document.createElement('div'); + this.parentNode.insertBefore(zoomDiv,this); + zoomDiv.appendChild(this); + zoomDiv.style.position = 'relative'; + zoomDiv.style.cursor = 'pointer'; + + this.title = '点击图片,在新窗口显示原始尺寸'; + + var zoom = document.createElement('img'); + zoom.src = 'image/zoom.gif'; + zoom.style.position = 'absolute'; + zoom.style.marginLeft = size -28 + 'px'; + zoom.style.marginTop = '5px'; + this.parentNode.insertBefore(zoom,this); + + zoomDiv.onmouseover = function() { + zoom.src = 'image/zoom_h.gif'; + }; + zoomDiv.onmouseout = function() { + zoom.src = 'image/zoom.gif'; + }; + zoomDiv.onclick = function() { + window.open(this.childNodes[1].src); + }; + } + } + } + } +} + +function zoomTextarea(id, zoom) { + zoomSize = zoom ? 10 : -10; + obj = $(id); + if(obj.rows + zoomSize > 0 && obj.cols + zoomSize * 3 > 0) { + obj.rows += zoomSize; + obj.cols += zoomSize * 3; + } +} + +function ischeck(id, prefix) { + form = document.getElementById(id); + for(var i = 0; i < form.elements.length; i++) { + var e = form.elements[i]; + if(e.name.match(prefix) && e.checked) { + if(confirm("您确定要执行本操作吗?")) { + return true; + } else { + return false; + } + } + } + alert('请选择要操作的对象'); + return false; +} + +function copyRow(tbody) { + var add = false; + var newnode; + if($(tbody).rows.length == 1 && $(tbody).rows[0].style.display == 'none') { + $(tbody).rows[0].style.display = ''; + newnode = $(tbody).rows[0]; + } else { + newnode = $(tbody).rows[0].cloneNode(true); + add = true; + } + tags = newnode.getElementsByTagName('input'); + for(i = 0;i < tags.length;i++) { + if(tags[i].name == 'pics[]') { + tags[i].value = 'http://'; + } + } + if(add) { + $(tbody).appendChild(newnode); + } +} + +function delRow(obj, tbody) { + if($(tbody).rows.length == 1) { + var trobj = obj.parentNode.parentNode; + tags = trobj.getElementsByTagName('input'); + for(i = 0;i < tags.length;i++) { + if(tags[i].name == 'pics[]') { + tags[i].value = 'http://'; + } + } + trobj.style.display='none'; + } else { + $(tbody).removeChild(obj.parentNode.parentNode); + } +} + +function insertWebImg(obj) { + if(checkImage(obj.value)) { + insertImage(obj.value); + obj.value = 'http://'; + } else { + alert('图片地址不正确'); + } +} + +function checkFocus(target) { + var obj = $(target); + if(!obj.hasfocus) { + obj.focus(); + } +} +function insertImage(text) { + text = "\n[img]" + text + "[/img]\n"; + insertContent('message', text); +} + +function insertContent(target, text) { + var obj = $(target); + selection = document.selection; + checkFocus(target); + if(!isUndefined(obj.selectionStart)) { + var opn = obj.selectionStart + 0; + obj.value = obj.value.substr(0, obj.selectionStart) + text + obj.value.substr(obj.selectionEnd); + } else if(selection && selection.createRange) { + var sel = selection.createRange(); + sel.text = text; + sel.moveStart('character', -strlen(text)); + } else { + obj.value += text; + } +} + +function checkImage(url) { + var re = /^http\:\/\/.{5,200}\.(jpg|gif|png)$/i; + return url.match(re); +} + +function showFlash(host, flashvar, obj, shareid) { + var re = new RegExp('.[A-Za-z0-9]+$', 'ig'); + var ext = flashvar.match(re).pop().substr(1); + if (obj) { + var flashObj = document.createElement('div'); + flashObj.id = 'flash_div_' + shareid; + obj.parentNode.insertBefore(flashObj, obj); + var containerObj = document.createElement('div'); + containerObj.id = flashObj.id + '_container'; + flashObj.appendChild(containerObj); + obj.style.display = 'none'; + } + return detectPlayer('flash_div_' + shareid, ext, flashvar, 480, 400); +} + +function startMarquee(h, speed, delay, sid) { + var t = null; + var p = false; + var o = $(sid); + o.innerHTML += o.innerHTML; + o.onmouseover = function() {p = true}; + o.onmouseout = function() {p = false}; + o.scrollTop = 0; + function start() { + t = setInterval(scrolling, speed); + if(!p) { + o.scrollTop += 2; + } + } + function scrolling() { + if(p) return; + if(o.scrollTop % h != 0) { + o.scrollTop += 2; + if(o.scrollTop >= o.scrollHeight/2) o.scrollTop = 0; + } else { + clearInterval(t); + setTimeout(start, delay); + } + } + setTimeout(start, delay); +} + +function readfeed(obj, id) { + if(Cookie.get("read_feed_ids")) { + var fcookie = Cookie.get("read_feed_ids"); + fcookie = id + ',' + fcookie; + } else { + var fcookie = id; + } + Cookie.set("read_feed_ids", fcookie, 48); + obj.className = 'feedread'; +} + +function showreward() { + if(Cookie.get('reward_notice_disable')) { + return false; + } + var x = new Ajax(); + x.get('home.php?mod=misc&ac=ajax&op=getreward', function(s){ + if(s) { + msgwin(s, 2000); + } + }); +} + +function msgwin(s, t) { + + var msgWinObj = $('msgwin'); + if(!msgWinObj) { + var msgWinObj = document.createElement("div"); + msgWinObj.id = 'msgwin'; + msgWinObj.style.display = 'none'; + msgWinObj.style.position = 'absolute'; + msgWinObj.style.zIndex = '100000'; + $('append_parent').appendChild(msgWinObj); + } + msgWinObj.innerHTML = s; + msgWinObj.style.display = ''; + msgWinObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'; + msgWinObj.style.opacity = 0; + var sTop = document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; + pbegin = sTop + (document.documentElement.clientHeight / 2); + pend = sTop + (document.documentElement.clientHeight / 5); + setTimeout(function () {showmsgwin(pbegin, pend, 0, t)}, 10); + msgWinObj.style.left = ((document.documentElement.clientWidth - msgWinObj.clientWidth) / 2) + 'px'; + msgWinObj.style.top = pbegin + 'px'; +} + +function showmsgwin(b, e, a, t) { + step = (b - e) / 10; + var msgWinObj = $('msgwin'); + newp = (parseInt(msgWinObj.style.top) - step); + if(newp > e) { + msgWinObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + a + ')'; + msgWinObj.style.opacity = a / 100; + msgWinObj.style.top = newp + 'px'; + setTimeout(function () {showmsgwin(b, e, a += 10, t)}, 10); + } else { + msgWinObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=100)'; + msgWinObj.style.opacity = 1; + setTimeout('displayOpacity(\'msgwin\', 100)', t); + } +} + +function displayOpacity(id, n) { + if(!$(id)) { + return; + } + if(n >= 0) { + n -= 10; + $(id).style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + n + ')'; + $(id).style.opacity = n / 100; + setTimeout('displayOpacity(\'' + id + '\',' + n + ')', 50); + } else { + $(id).style.display = 'none'; + $(id).style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=100)'; + $(id).style.opacity = 1; + } +} + +function urlto(url) { + window.location.href = url; +} + +function explode(sep, string) { + return string.split(sep); +} + +function selector(pattern, context) { + var re = new RegExp('([a-z0-9]*)([\.#:]*)(.*|$)', 'ig'); + var match = re.exec(pattern); + var conditions = cc = []; + if (match[2] == '#') conditions.push(['id', '=', match[3]]); + else if(match[2] == '.') conditions.push(['className', '~=', match[3]]); + else if(match[2] == ':') conditions.push(['type', '=', match[3]]); + var s = match[3].replace(/\[(.*)\]/g,'$1').split('@'); + for(var i=0; i 30 ? '':'none'; +} + +function showFace(showid, target, dropstr) { + if($(showid + '_menu') != null) { + $(showid+'_menu').style.display = ''; + } else { + var faceDiv = document.createElement("div"); + faceDiv.id = showid+'_menu'; + faceDiv.className = 'p_pop facel'; + faceDiv.style.position = 'absolute'; + faceDiv.style.zIndex = 1001; + var faceul = document.createElement("ul"); + for(i=1; i<31; i++) { + var faceli = document.createElement("li"); + faceli.innerHTML = ''; + faceul.appendChild(faceli); + } + faceDiv.appendChild(faceul); + $('append_parent').appendChild(faceDiv) + } + setMenuPosition(showid, 0); + doane(); + _attachEvent(document.body, 'click', function(){if($(showid+'_menu')) $(showid+'_menu').style.display = 'none';}); +} + +function insertFace(showid, id, target, dropstr) { + var faceText = '[em:'+id+':]'; + if($(target) != null) { + insertContent(target, faceText); + if(dropstr) { + $(target).value = $(target).value.replace(dropstr, ""); + } + } +} + +function wall_add(id) { + var obj = $('comment_ul'); + var newdl = document.createElement("dl"); + newdl.id = 'comment_'+id+'_li'; + newdl.className = 'bbda cl'; + var x = new Ajax(); + x.get('home.php?mod=misc&ac=ajax&op=comment&inajax=1&cid='+id, function(s){ + newdl.innerHTML = s; + }); + obj.insertBefore(newdl, obj.firstChild); + if($('comment_message')) { + $('comment_message').value= ''; + } + showCreditPrompt(); +} + +function share_add(sid) { + var obj = $('share_ul'); + var newli = document.createElement("li"); + newli.id = 'share_' + sid + '_li'; + var x = new Ajax(); + x.get('home.php?mod=misc&ac=ajax&op=share&inajax=1&sid='+sid, function(s){ + newli.innerHTML = s; + }); + obj.insertBefore(newli, obj.firstChild); + $('share_link').value = 'http://'; + $('share_general').value = ''; + showCreditPrompt(); +} + +function comment_add(id) { + var obj = $('comment_ul'); + var newdl = document.createElement("dl"); + newdl.id = 'comment_'+id+'_li'; + newdl.className = 'bbda cl'; + var x = new Ajax(); + x.get('home.php?mod=misc&ac=ajax&op=comment&inajax=1&cid='+id, function(s){ + newdl.innerHTML = s; + }); + if($('comment_prepend')){ + obj = obj.firstChild; + while (obj && obj.nodeType != 1){ + obj = obj.nextSibling; + } + obj.parentNode.insertBefore(newdl, obj); + } else { + obj.appendChild(newdl); + } + if($('comment_message')) { + $('comment_message').value= ''; + } + if($('comment_replynum')) { + var a = parseInt($('comment_replynum').innerHTML); + var b = a + 1; + $('comment_replynum').innerHTML = b + ''; + } + showCreditPrompt(); +} +function comment_edit(cid) { + var obj = $('comment_'+ cid +'_li'); + var x = new Ajax(); + x.get('home.php?mod=misc&ac=ajax&op=comment&inajax=1&cid='+ cid, function(s){ + obj.innerHTML = s; + var elems = selector('dd[class~=magicflicker]'); + for(var i=0; i给TA留言 ,或者 打个招呼

                  '; + } + showCreditPrompt(); +} +function myfriend_ignore(id) { + var ids = explode('_', id); + var uid = ids[1]; + $('friend_tbody_'+uid).style.display = "none"; +} + +function mtag_join(tagid, result) { + if(result) { + location.reload(); + } +} + +function resend_mail(mid) { + if(mid) { + var obj = $('sendmail_'+ mid +'_li'); + obj.style.display = "none"; + } +} + +function docomment_get(doid, key) { + var showid = key + '_' + doid; + var opid = key + '_do_a_op_'+doid; + $(showid).style.display = ''; + $(showid).className = 'cmt brm'; + ajaxget('home.php?mod=spacecp&ac=doing&op=getcomment&handlekey=msg_'+doid+'&doid='+doid+'&key='+key, showid); + if($(opid)) { + $(opid).innerHTML = '收起'; + $(opid).onclick = function() { + docomment_colse(doid, key); + } + } + showCreditPrompt(); +} + +function docomment_colse(doid, key) { + var showid = key + '_' + doid; + var opid = key + '_do_a_op_'+doid; + + $(showid).style.display = 'none'; + $(showid).style.className = ''; + + $(opid).innerHTML = '回复'; + $(opid).onclick = function() { + docomment_get(doid, key); + } +} + +function docomment_form(doid, id, key) { + var showid = key + '_form_'+doid+'_'+id; + var divid = key +'_'+ doid; + var url = 'home.php?mod=spacecp&ac=doing&op=docomment&handlekey=msg_'+id+'&doid='+doid+'&id='+id+'&key='+key; + if(parseInt(discuz_uid)) { + ajaxget(url, showid); + if($(divid)) { + $(divid).style.display = ''; + } + } else { + showWindow(divid, url); + } +} + +function docomment_form_close(doid, id, key) { + var showid = key + '_form_' + doid + '_' + id; + var opid = key + '_do_a_op_' + doid; + $(showid).innerHTML = ''; + $(showid).style.display = 'none'; + var liObj = $(key+'_'+doid).getElementsByTagName('li'); + if(!liObj.length) { + $(key+'_'+doid).style.display = 'none'; + if($(opid)) { + $(opid).innerHTML = '回复'; + $(opid).onclick = function () { + docomment_get(doid, key); + } + } + } +} + +function feedcomment_get(feedid) { + var showid = 'feedcomment_'+feedid; + var opid = 'feedcomment_a_op_'+feedid; + + $(showid).style.display = ''; + ajaxget('home.php?mod=spacecp&ac=feed&op=getcomment&feedid='+feedid+'&handlekey=feedhk_'+feedid, showid); + if($(opid) != null) { + $(opid).innerHTML = '收起'; + $(opid).onclick = function() { + feedcomment_close(feedid); + } + } +} + +function feedcomment_add(cid, feedid) { + var obj = $('comment_ol_'+feedid); + var newdl = document.createElement("dl"); + newdl.id = 'comment_'+cid+'_li'; + newdl.className = 'bbda cl'; + var x = new Ajax(); + x.get('home.php?mod=misc&ac=ajax&op=comment&inajax=1&cid='+cid, function(s){ + newdl.innerHTML = s; + }); + obj.appendChild(newdl); + + $('feedmessage_'+feedid).value= ''; + showCreditPrompt(); +} + +function feedcomment_close(feedid) { + var showid = 'feedcomment_'+feedid; + var opid = 'feedcomment_a_op_'+feedid; + + $(showid).style.display = 'none'; + $(showid).style.className = ''; + + $(opid).innerHTML = '评论'; + $(opid).onclick = function() { + feedcomment_get(feedid); + } +} + +function feed_post_result(feedid, result) { + if(result) { + location.reload(); + } +} + +function feed_more_show(feedid) { + var showid = 'feed_more_'+feedid; + var opid = 'feed_a_more_'+feedid; + + $(showid).style.display = ''; + $(showid).className = 'sub_doing'; + + $(opid).innerHTML = '« 收起列表'; + $(opid).onclick = function() { + feed_more_close(feedid); + } +} + +function feed_more_close(feedid) { + var showid = 'feed_more_'+feedid; + var opid = 'feed_a_more_'+feedid; + + $(showid).style.display = 'none'; + + $(opid).innerHTML = '» 更多动态'; + $(opid).onclick = function() { + feed_more_show(feedid); + } +} + +function poll_post_result(id, result) { + if(result) { + var aObj = $('__'+id).getElementsByTagName("a"); + window.location.href = aObj[0].href; + } +} + +function show_click(idtype, id, clickid) { + ajaxget('home.php?mod=spacecp&ac=click&op=show&clickid='+clickid+'&idtype='+idtype+'&id='+id, 'click_div'); + showCreditPrompt(); +} + +function feed_menu(feedid, show) { + var obj = $('a_feed_menu_'+feedid); + if(obj) { + if(show) { + obj.style.display='block'; + } else { + obj.style.display='none'; + } + } + var obj = $('feedmagic_'+feedid); + if(obj) { + if(show) { + obj.style.display='block'; + } else { + obj.style.display='none'; + } + } +} + +function showbirthday(){ + var el = $('birthday'); + var birthday = el.value; + el.length=0; + el.options.add(new Option('日', '')); + for(var i=0;i<28;i++){ + el.options.add(new Option(i+1, i+1)); + } + if($('birthmonth').value!="2"){ + el.options.add(new Option(29, 29)); + el.options.add(new Option(30, 30)); + switch($('birthmonth').value){ + case "1": + case "3": + case "5": + case "7": + case "8": + case "10": + case "12":{ + el.options.add(new Option(31, 31)); + } + } + } else if($('birthyear').value!="") { + var nbirthyear=$('birthyear').value; + if(nbirthyear%400==0 || (nbirthyear%4==0 && nbirthyear%100!=0)) el.options.add(new Option(29, 29)); + } + el.value = birthday; +} + +function magicColor(elem, t) { + t = t || 10; + elem = (elem && elem.constructor == String) ? $(elem) : elem; + if(!elem){ + setTimeout(function(){magicColor(elem, t-1);}, 400); + return; + } + if(window.mcHandler == undefined) { + window.mcHandler = {elements:[]}; + window.mcHandler.colorIndex = 0; + window.mcHandler.run = function(){ + var color = ["#CC0000","#CC6D00","#CCCC00","#00CC00","#0000CC","#00CCCC","#CC00CC"][(window.mcHandler.colorIndex++) % 7]; + for(var i = 0, L=window.mcHandler.elements.length; i 0) { + for(var i = 0; i < markreadidarr.length; i++) { + $(markreadidarr[i]).className = 'bbda cl'; + } + } +} + +function setpmstatus(form) { + var ids_gpmid = new Array(); + var ids_plid = new Array(); + var type = ''; + var requesturl = ''; + var markreadids = new Array(); + + for(var i = 0; i < form.elements.length; i++) { + var e = form.elements[i]; + if(e.id && e.id.match('a_delete') && e.checked) { + var idarr = new Array(); + idarr = e.id.split('_'); + if(idarr[1] == 'deleteg') { + ids_gpmid.push(idarr[2]); + markreadids.push('gpmlist_' + idarr[2]); + } else if(idarr[1] == 'delete') { + ids_plid.push(idarr[2]); + markreadids.push('pmlist_' + idarr[2]); + } + } + } + + if(ids_gpmid.length > 0) { + requesturl += '&gpmids=' + ids_gpmid.join(','); + } + if(ids_plid.length > 0) { + requesturl += '&plids=' + ids_plid.join(','); + } + + if(requesturl) { + ajaxget('home.php?mod=spacecp&ac=pm&op=setpmstatus' + requesturl, '', 'ajaxwaitid', '', 'none', 'markreadpm(\''+ markreadids.join(',') +'\')'); + } +} + +function changedeletedpm(pmid) { + $('pmlist_' + pmid).style.display = 'none'; + var membernum = parseInt($('membernum').innerHTML); + $('membernum').innerHTML = membernum - 1; +} + +function changeOrderRange(id) { + if(!$(id)) return false; + var url = window.location.href; + var a = $(id).getElementsByTagName('a'); + for(var i = 0; i < a.length; i++) { + a[i].onclick = function () { + if(url.indexOf("&orderby=") == -1) { + url += "&orderby=" + this.id; + } else { + url = url.replace(/orderby=.*/, "orderby=" + this.id); + } + window.location = url; + return false; + } + } +} + +function addBlockLink(id, tag) { + if(!$(id)) return false; + var a = $(id).getElementsByTagName(tag); + var taglist = {'A':1, 'INPUT':1, 'IMG':1}; + for(var i = 0, len = a.length; i < len; i++) { + a[i].onmouseover = function () { + if(this.className.indexOf(' hover') == -1) { + this.className = this.className + ' hover'; + } + }; + a[i].onmouseout = function () { + this.className = this.className.replace(' hover', ''); + }; + a[i].onclick = function (e) { + e = e ? e : window.event; + var target = e.target || e.srcElement; + if(!taglist[target.tagName]) { + window.location.href = $(this.id + '_a').href; + } + }; + } +} + +function checkSynSignature() { + if($('to_signhtml').value == '1') { + $('syn_signature').className = 'syn_signature'; + $('to_signhtml').value = '0'; + } else { + $('syn_signature').className = 'syn_signature_check'; + $('to_signhtml').value = '1'; + } +} + +function searchpostbyusername(keyword, srchuname) { + window.location.href = 'search.php?mod=forum&srchtxt=' + keyword + '&srchuname=' + srchuname + '&searchsubmit=yes'; +} + +function removeVisitor(event, uid) { + window.location = 'home.php?mod=space&uid='+uid+'&do=index&view=admin&additional=removevlog'; + event.preventDefault(); + event.stopPropagation(); +} + +function spaceMusicPlayer(url, height) { + if (JSLOADED[STATICURL + 'js/player/aplayer.min.js']) { + var x = new Ajax('JSON'); + x.getJSON(url, function(s) { + var audio = new Array(); + s.mp3list.forEach(function (s) { + var obj = new Object(); + obj.name = s.mp3name; + obj.artist = ' '; + obj.url = s.mp3url; + obj.cover = s.cdbj; + audio.push(obj); + }); + $('music_content').style.height = height + 'px'; + $('music_content').style.padding = '0px'; + $('music_content').style.margin = '0px'; + window['music_content'] = new APlayer({ + container: $('music_content'), + autoplay: s.config.autorun == 'true', + theme: s.config.crontabcolor, + loop: 'all', + order: s.config.shuffle == 'true' ? 'random' : 'list', + preload: 'none', + volume: 1, + mutex: true, + listFolded: s.config.showmod == 'big' ? false : true, + audio: audio + }); + }); + } else { + setTimeout(function () { + spaceMusicPlayer(url, height); + }, 50); + } +} \ No newline at end of file diff --git a/static/js/home_drag.js b/static/js/home_drag.js new file mode 100644 index 0000000..13bd524 --- /dev/null +++ b/static/js/home_drag.js @@ -0,0 +1,334 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: home_drag.js 32655 2013-02-28 04:08:00Z zhengqingpeng $ +*/ + +var Drags = []; +var nDrags = 1; + +var mouseOffset = null; +var iMouseDown = false; +var lMouseState = false; +var dragObject = null; + +var DragDrops = []; +var curTarget = null; +var lastTarget = null; +var dragHelper = null; +var tempDiv = null; +var rootParent = null; +var rootSibling = null; + +var D1Target = null; + +Number.prototype.NaN0=function(){return isNaN(this)?0:this;}; + +function CreateDragContainer(){ + var cDrag = DragDrops.length; + DragDrops[cDrag] = []; + + for(var i=0; i xPos) && + ((parseInt(getAttribute('startTop')) + parseInt(getAttribute('startHeight'))) > yPos)){ + + activeCont = dragConts[i]; + + break; + } + } + } + + if(activeCont){ + if(activeCont!=curTarget.parentNode){ + writeHistory(curTarget, 'Moved into '+activeCont.id); + } + + var beforeNode = null; + + for(var i=activeCont.childNodes.length-1; i>=0; i--){ + with(activeCont.childNodes[i]){ + if(nodeName=='#text') continue; + + if(curTarget != activeCont.childNodes[i] && + ((parseInt(getAttribute('startLeft')) + parseInt(getAttribute('startWidth'))) > xPos) && + ((parseInt(getAttribute('startTop')) + parseInt(getAttribute('startHeight'))) > yPos)){ + beforeNode = activeCont.childNodes[i]; + } + } + } + + if(beforeNode){ + if(beforeNode!=curTarget.nextSibling){ + writeHistory(curTarget, 'Inserted Before '+beforeNode.id); + + activeCont.insertBefore(curTarget, beforeNode); + } + + } else { + if((curTarget.nextSibling) || (curTarget.parentNode!=activeCont)){ + writeHistory(curTarget, 'Inserted at end of '+activeCont.id); + + activeCont.appendChild(curTarget); + } + } + + setTimeout(function(){ + var contPos = getPosition(activeCont); + activeCont.setAttribute('startWidth', parseInt(activeCont.offsetWidth)); + activeCont.setAttribute('startHeight', parseInt(activeCont.offsetHeight)); + activeCont.setAttribute('startLeft', contPos.x); + activeCont.setAttribute('startTop', contPos.y);}, 5); + + if(curTarget.style.display!=''){ + writeHistory(curTarget, 'Made Visible'); + curTarget.style.display = ''; + curTarget.style.visibility = 'hidden'; + } + } else { + + if(curTarget.style.display!='none'){ + writeHistory(curTarget, 'Hidden'); + curTarget.style.display = 'none'; + } + } + } + + lMouseState = iMouseDown; + + lastTarget = target; + } + + if(dragObject){ + dragObject.style.position = 'absolute'; + dragObject.style.top = mousePos.y - mouseOffset.y; + dragObject.style.left = mousePos.x - mouseOffset.x; + } + + lMouseState = iMouseDown; + + if(curTarget || dragObject) return false; +} + +function mouseUp(ev){ + if(Drags[0]){ + if(curTarget){ + writeHistory(curTarget, 'Mouse Up Fired'); + + dragHelper.style.display = 'none'; + if(curTarget.style.display == 'none'){ + if(rootSibling){ + rootParent.insertBefore(curTarget, rootSibling); + } else { + rootParent.appendChild(curTarget); + } + } + curTarget.style.display = ''; + curTarget.style.visibility = 'visible'; + } + curTarget = null; + } + + dragObject = null; + iMouseDown = false; +} + +function mouseDown(ev){ + mousedown(ev); + ev = ev || window.event; + var target = ev.target || ev.srcElement; + iMouseDown = true; + if(Drags[0]){ + if(lastTarget){ + writeHistory(lastTarget, 'Mouse Down Fired'); + } + } + if(target.onmousedown || target.getAttribute('DragObj')){ + return false; + } +} + +function makeDraggable(item){ + if(!item) return; + item.onmousedown = function(ev){ + dragObject = this; + mouseOffset = getMouseOffset(this, ev); + return false; + } +} + +function init_drag2(){ + + document.onmousemove = mouseMove; + document.onmousedown = mouseDown; + document.onmouseup = mouseUp; + + Drags[0] = $('Drags0'); + if(Drags[0]){ + CreateDragContainer($('DragContainer0')); + } + if(Drags[0]){ + var cObj = $('applistcontent'); + dragHelper = document.createElement('div'); + dragHelper.style.cssName = "apps dragable"; + dragHelper.style.cssText = 'position:absolute;display:none;width:777px;'; + cObj.parentNode.insertBefore(dragHelper, cObj); + } +} +function mousedown(evnt){ +} \ No newline at end of file diff --git a/static/js/home_friendselector.js b/static/js/home_friendselector.js new file mode 100644 index 0000000..4e3b1a9 --- /dev/null +++ b/static/js/home_friendselector.js @@ -0,0 +1,456 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: home_friendselector.js 26733 2011-12-21 07:18:01Z zhengqingpeng $ +*/ + +(function() { + friendSelector = function(parameter) { + this.dataSource = {}; + this.selectUser = {}; + this.prompterUser = []; + this.showObj = $(isUndefined(parameter['showId']) ? 'selectorBox' : parameter['showId']); + if(!this.showObj) return; + this.handleObj = $(isUndefined(parameter['searchId']) ? 'valueId' : parameter['searchId']); + this.showType = isUndefined(parameter['showType']) ? 0 : parameter['showType']; + this.searchStr = null; + this.selectNumber = 0; + this.maxSelectNumber = isUndefined(parameter['maxSelectNumber']) ? 0 : parseInt(parameter['maxSelectNumber']); + this.allNumber = 0; + this.notInDataSourceNumber = 0; + this.handleKey = isUndefined(parameter['handleKey']) ? 'this' : parameter['handleKey']; + this.selectTabId = isUndefined(parameter['selectTabId']) ? 'selectTabId' : parameter['selectTabId']; + this.unSelectTabId = isUndefined(parameter['unSelectTabId']) ? 'unSelectTabId' : parameter['unSelectTabId']; + this.maxSelectTabId = isUndefined(parameter['maxSelectTabId']) ? 'maxSelectTabId' : parameter['maxSelectTabId']; + this.formId = isUndefined(parameter['formId']) ? '' : parameter['formId']; + this.filterUser = isUndefined(parameter['filterUser']) ? {} : parameter['filterUser']; + this.showAll = true; + this.newPMUser = {}; + this.interlaced = true; + this.handover = true; + this.parentKeyCode = 0; + this.pmSelBoxState = 0; + this.selBoxObj = isUndefined(parameter['selBox']) ? null : $(parameter['selBox']); + this.containerBoxObj = isUndefined(parameter['selBoxMenu']) ? null : $(parameter['selBoxMenu']); + this.imgBtn = null; + this.initialize(); + return this; + }; + + friendSelector.prototype = { + addDataSource : function(data, clear) { + if(typeof data == 'object') { + var userData = data['userdata']; + clear = isUndefined(clear) ? 0: clear; + if(clear) { + this.showObj.innerHTML = ""; + if(this.showType == 3) { + this.selBoxObj.innerHTML = ''; + } + this.allNumber = 0; + this.dataSource = {}; + } + for(var i in userData) { + if(typeof this.filterUser[i] != 'undefined') { + continue; + } + var append = clear ? true : false; + if(typeof this.dataSource[i] == 'undefined') { + this.dataSource[i] = userData[i]; + append = true; + this.allNumber++; + } + if(append) { + this.interlaced = !this.interlaced; + if(this.showType == 3) { + this.append(i, 0, 1); + } else { + this.append(i); + } + } + } + if(this.showType == 1) { + this.showSelectNumber(); + } else if(this.showType == 2) { + if(this.newPMUser) { + window.setInterval(this.handleKey+".handoverCSS()", 400); + } + } + } + }, + addFilterUser : function(data) { + var filterData = {}; + if(typeof data != 'object') { + filterData[data] = data; + } else if(typeof data == 'object') { + filterData = data; + } else { + return false; + } + for(var id in filterData) { + this.filterUser[filterData[id]] = filterData[id]; + } + return true; + }, + handoverCSS : function() { + for(var uid in this.newPMUser) { + $('avt_'+uid).className = this.handover ? 'avt newpm' : 'avt'; + } + this.handover = !this.handover; + }, + handleEvent : function(key, event) { + var username = ''; + this.searchStr = ''; + if(key != '') { + if(event.keyCode == 188 || event.keyCode == 13 || event.keyCode == 59) { + if(this.showType == 3) { + if(event.keyCode == 13) { + var currentnum = this.getCurrentPrompterUser(); + if(currentnum != -1) { + key = this.dataSource[this.prompterUser[currentnum]]['username']; + } + } + if(this.parentKeyCode != 229) { + this.selectUserName(this.trim(key)); + this.showObj.style.display = 'none'; + $(this.handleObj.id+'_menu').style.display = 'none'; + this.showObj.innerHTML = ""; + } + } + } else if(event.keyCode == 38 || event.keyCode == 40) { + } else { + if(this.showType == 3) { + this.showObj.innerHTML = ""; + var result = false; + var reg = new RegExp(key, "ig"); + this.searchStr = key; + this.prompterUser = []; + for(var uid in this.dataSource) { + username = this.dataSource[uid]['username']; + if(username.match(reg)) { + this.prompterUser.push(uid); + this.append(uid, 1); + result = true; + } + } + if(!result) { + $(this.handleObj.id+'_menu').style.display = 'none'; + } else { + showMenu({'showid':this.showObj.id, 'duration':3, 'pos':'43'}); + showMenu({'showid':this.handleObj.id, 'duration':3, 'pos':'43'}); + } + } + } + } else if(this.showType != 3) { + this.showObj.innerHTML = ""; + for(var uid in this.dataSource) { + this.append(uid); + } + } else { + $(this.handleObj.id+'_menu').style.display = 'none'; + this.showObj.innerHTML = ""; + } + }, + selectUserName:function(userName) { + this.handleObj.value = ''; + if(userName != '') { + var uid = this.isFriend(userName); + if(uid && typeof this.selectUser[uid] == 'undefined' || uid === 0 && typeof this.selectUser[userName] == 'undefined') { + var spanObj = document.createElement("span"); + if(uid) { + this.selectUser[uid] = this.dataSource[uid]; + spanObj.id = 'uid' + uid; + if($('chk'+uid) != null) { + $('chk'+uid).checked = true; + } + } else { + var id = 'str' + Math.floor(Math.random() * 10000); + spanObj.id = id; + this.selectUser[userName] = userName; + } + this.selectNumber++; + spanObj.innerHTML= '删除' + userName + ''; + this.handleObj.parentNode.insertBefore(spanObj, this.handleObj); + this.showObj.style.display = 'none'; + } else { + alert('已经存在'+userName); + } + } + }, + + delSelUser:function(id) { + id = isUndefined(id) ? 0 : id; + var uid = id.substring(0, 3) == 'uid' ? parseInt(id.substring(3)) : 0; + var spanObj; + if(uid) { + spanObj = $(id); + delete this.selectUser[uid]; + if($('chk'+uid) != null) { + $('chk'+uid).checked = false; + } + } else if(id.substring(0, 3) == 'str') { + spanObj = $(id); + delete this.selectUser[spanObj.getElementsByTagName('input')[0].value]; + } + if(spanObj != null) { + this.selectNumber--; + spanObj.parentNode.removeChild(spanObj); + } + }, + trim:function(str) { + return str.replace(/\s|,|;/g, ''); + }, + isFriend:function(userName) { + var id = 0; + for(var uid in this.dataSource) { + if(this.dataSource[uid]['username'] === userName) { + id = uid; + break; + } + } + return id; + }, + directionKeyDown : function(event) {}, + clearDataSource : function() { + this.dataSource = {}; + this.selectUser = {}; + }, + showUser : function(type) { + this.showObj.innerHTML = ''; + type = isUndefined(type) ? 0 : parseInt(type); + this.showAll = true; + if(type == 1) { + for(var uid in this.selectUser) { + this.append(uid); + } + this.showAll = false; + } else { + for(var uid in this.dataSource) { + if(type == 2) { + if(typeof this.selectUser[uid] != 'undefined') { + continue; + } + this.showAll = false; + } + this.append(uid); + } + } + if(this.showType == 1) { + for(var i = 0; i < 3; i++) { + $('showUser_'+i).className = ''; + } + $('showUser_'+type).className = 'a brs'; + } + }, + append : function(uid, filtrate, form) { + filtrate = isUndefined(filtrate) ? 0 : filtrate; + form = isUndefined(form) ? 0 : form; + var liObj = document.createElement("li"); + var appendUserData = this.dataSource[uid] || this.selectUser[uid]; + var username = appendUserData['username']; + liObj.userid = appendUserData['uid']; + if(typeof this.selectUser[uid] != 'undefined') { + liObj.className = "a"; + } + if(filtrate) { + var reg = new RegExp("(" + this.searchStr + ")","ig"); + username = username.replace(reg , "$1"); + } + if(this.showType == 1) { + liObj.innerHTML = '' + username + ''; + } else if(this.showType == 2) { + if(appendUserData['new'] && typeof this.newPMUser[uid] == 'undefined') { + this.newPMUser[uid] = uid; + } + liObj.className = this.interlaced ? 'alt' : ''; + liObj.innerHTML = '
                  '+username+'

                  '+username+'

                  '; + } else { + if(form) { + var checkstate = typeof this.selectUser[uid] == 'undefined' ? '' : ' checked="checked" '; + liObj.innerHTML = ''; + this.selBoxObj.appendChild(liObj); + return true; + } else { + liObj.innerHTML = '' + username + ''; + } + + } + this.showObj.appendChild(liObj); + }, + select : function(uid) { + uid = parseInt(uid); + if(uid){ + var select = false; + if(typeof this.selectUser[uid] == 'undefined') { + if(this.maxSelectNumber && this.selectNumber >= this.maxSelectNumber) { + alert('最多只允许选择'+this.maxSelectNumber+'个用户'); + return false; + } + this.selectUser[uid] = this.dataSource[uid]; + this.selectNumber++; + if(this.showType == '1') { + $(uid).parentNode.className = 'a'; + } + select = true; + } else { + delete this.selectUser[uid]; + this.selectNumber--; + $(uid).parentNode.className = ''; + + } + if(this.formId != '') { + var formObj = $(this.formId); + var opId = 'selUids_' + uid; + if(select) { + var inputObj = document.createElement("input"); + inputObj.type = 'hidden'; + inputObj.id = opId; + inputObj.name = 'uids[]'; + inputObj.value = uid; + formObj.appendChild(inputObj); + } else { + formObj.removeChild($(opId)); + } + } + if(this.showType == 1) { + this.showSelectNumber(); + } + } + }, + delNewFlag : function(uid) { + delete this.newPMUser[uid]; + }, + showSelectNumber:function() { + if($(this.selectTabId) != null && typeof $(this.selectTabId) != 'undefined') { + $(this.selectTabId).innerHTML = this.selectNumber; + } + if($(this.unSelectTabId) != null && typeof $(this.unSelectTabId) != 'undefined') { + this.notInDataSourceNumber = 0; + for(var i in this.selectUser) { + if(typeof this.dataSource[i] == 'undefined') { + this.notInDataSourceNumber++; + } + } + $(this.unSelectTabId).innerHTML = this.allNumber + this.notInDataSourceNumber - this.selectNumber; + } + if($(this.maxSelectTabId) != null && this.maxSelectNumber && typeof $(this.maxSelectTabId) != 'undefined') { + $(this.maxSelectTabId).innerHTML = this.maxSelectNumber - this.selectNumber; + } + + }, + getCurrentPrompterUser:function() { + var len = this.prompterUser.length; + var selectnum = -1; + if(len) { + for(var i = 0; i < len; i++) { + var obj = $('prompter_' + this.prompterUser[i]); + if(obj != null && obj.className == 'a') { + selectnum = i; + } + } + } + return selectnum; + }, + mouseOverPrompter:function(obj) { + var len = this.prompterUser.length; + if(len) { + for(var i = 0; i < len; i++) { + $('prompter_' + this.prompterUser[i]).className = 'cl'; + } + obj.className = 'a'; + } + }, + initialize:function() { + var instance = this; + this.handleObj.onkeyup = function(event) { + event = event ? event : window.event; + instance.handleEvent(this.value, event); + }; + if(this.showType == 3) { + this.handleObj.onkeydown = function(event) { + event = event ? event : window.event; + instance.parentKeyCode = event.keyCode; + instance.showObj.style.display = ''; + if(event.keyCode == 8 && this.value == '') { + var preNode = this.previousSibling; + if(preNode.tagName == 'SPAN') { + var uid = preNode.getElementsByTagName('input')[0].getAttribute('uid'); + if(parseInt(uid.substring(3))) { + instance.delSelUser(uid); + } else { + delete instance.selectUser[preNode.getElementsByTagName('input')[0].value]; + instance.selectNumber--; + this.parentNode.removeChild(preNode); + } + } + } else if(event.keyCode == 38) { + if(!instance.prompterUser.length) { + doane(event); + } + var currentnum = instance.getCurrentPrompterUser(); + if(currentnum != -1) { + var nextnum = (currentnum == 0) ? (instance.prompterUser.length-1) : currentnum - 1; + $('prompter_' + instance.prompterUser[currentnum]).className = "cl"; + $('prompter_' + instance.prompterUser[nextnum]).className = "a"; + } else { + $('prompter_' + instance.prompterUser[0]).className = "a"; + } + } else if(event.keyCode == 40) { + if(!instance.prompterUser.length) { + doane(event); + } + var currentnum = instance.getCurrentPrompterUser(); + if(currentnum != -1) { + var nextnum = (currentnum == (instance.prompterUser.length - 1)) ? 0 : currentnum + 1; + $('prompter_' + instance.prompterUser[currentnum]).className = "cl"; + $('prompter_' + instance.prompterUser[nextnum]).className = "a"; + } else { + $('prompter_' + instance.prompterUser[0]).className = "a"; + } + } else if(event.keyCode == 13) { + doane(event); + } + if(typeof instance != "undefined" && instance.pmSelBoxState) { + instance.pmSelBoxState = 0; + instance.changePMBoxImg(instance.imgBtn); + instance.containerBoxObj.style.display = 'none'; + } + }; + } + }, + changePMBoxImg:function(obj) { + var btnImg = new Image(); + btnImg.src = IMGDIR + '/' + (this.pmSelBoxState ? 'icon_top.gif' : 'icon_down.gif'); + if(obj != null) { + obj.src = btnImg.src; + } + }, + showPMFriend:function(boxId, listId, obj) { + this.pmSelBoxState = !this.pmSelBoxState; + this.imgBtn = obj; + this.changePMBoxImg(obj); + + if(this.pmSelBoxState) { + this.selBoxObj.innerHTML = ''; + for(var uid in this.dataSource) { + this.append(uid, 0, 1); + } + } + this.containerBoxObj.style.display = this.pmSelBoxState ? '' : 'none'; + this.showObj.innerHTML = ""; + }, + showPMBoxUser:function() { + this.selBoxObj.innerHTML = ''; + for(var uid in this.dataSource) { + this.append(uid, 0, 1); + } + }, + extend:function (obj) { + for (var i in obj) { + this[i] = obj[i]; + } + } + }; + +})(); \ No newline at end of file diff --git a/static/js/home_uploadpic.js b/static/js/home_uploadpic.js new file mode 100644 index 0000000..2ab4025 --- /dev/null +++ b/static/js/home_uploadpic.js @@ -0,0 +1,188 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: home_uploadpic.js 32590 2013-02-22 09:42:48Z monkey $ +*/ + +var attachexts = new Array(); +var attachwh = new Array(); + +var insertType = 1; +var thumbwidth = parseInt(60); +var thumbheight = parseInt(60); +var extensions = 'jpg,jpeg,gif,png'; +var forms; +var nowUid = 0; +var albumid = 0; +var uploadStat = 0; +var picid = 0; +var nowid = 0; +var mainForm; +var successState = false; + +function delAttach(id) { + $('attachbody').removeChild($('attach_' + id).parentNode.parentNode.parentNode); + if($('attachbody').innerHTML == '') { + addAttach(); + } + $('localimgpreview_' + id + '_menu') ? document.body.removeChild($('localimgpreview_' + id + '_menu')) : null; +} + +function addAttach() { + newnode = $('attachbodyhidden').rows[0].cloneNode(true); + var id = nowid; + var tags; + tags = newnode.getElementsByTagName('form'); + for(i = 0;i < tags.length;i++) { + if(tags[i].id == 'upload') { + tags[i].id = 'upload_' + id; + } + } + tags = newnode.getElementsByTagName('input'); + for(i = 0;i < tags.length;i++) { + if(tags[i].name == 'attach') { + tags[i].id = 'attach_' + id; + tags[i].name = 'attach'; + tags[i].onchange = function() {insertAttach(id)}; + tags[i].unselectable = 'on'; + } + if(tags[i].id == 'albumid') { + tags[i].id = 'albumid_' + id; + } + } + tags = newnode.getElementsByTagName('span'); + for(i = 0;i < tags.length;i++) { + if(tags[i].id == 'localfile') { + tags[i].id = 'localfile_' + id; + } + } + nowid++; + + $('attachbody').appendChild(newnode); +} + +addAttach(); + +function insertAttach(id) { + var localimgpreview = ''; + var path = $('attach_' + id).value; + var ext = getExt(path); + var re = new RegExp("(^|\\s|,)" + ext + "($|\\s|,)", "ig"); + var localfile = $('attach_' + id).value.substr($('attach_' + id).value.replace(/\\/g, '/').lastIndexOf('/') + 1); + + if(path == '') { + return; + } + if(extensions != '' && (re.exec(extensions) == null || ext == '')) { + alert('对不起,不支持上传此类扩展名的图片'); + return; + } + attachexts[id] = inArray(ext, ['gif', 'jpg', 'jpeg', 'png']) ? 2 : 1; + + var inhtml = ''; + if(typeof no_insert=='undefined') { + localfile += ' [插入]'; + } + inhtml += '
                  ' + localfile +''; + inhtml += '图片描述
                  '; + inhtml += '
                  [删除]'; + inhtml += '
                  '; + + $('localfile_' + id).innerHTML = inhtml; + $('attach_' + id).style.display = 'none'; + + addAttach(); +} + +function getPath(obj){ + if (obj) { + if (BROWSER.ie && BROWSER.ie < 7) { + obj.select(); + return document.selection.createRange().text; + + } else if(BROWSER.firefox) { + if (obj.files) { + return obj.files.item(0).getAsDataURL(); + } + return obj.value; + } else { + return ''; + } + return obj.value; + } +} +function inArray(needle, haystack) { + if(typeof needle == 'string') { + for(var i in haystack) { + if(haystack[i] == needle) { + return true; + } + } + } + return false; +} + +function insertAttachimgTag(id) { + edit_insert('[imgid=' + id + ']'); +} + +function uploadSubmit(obj) { + obj.disabled = true; + mainForm = obj.form; + forms = $('attachbody').getElementsByTagName("FORM"); + albumid = $('uploadalbum').value; + upload(); +} + +function start_upload() { + $('btnupload').disabled = true; + mainForm = $('albumresultform'); + forms = $('attachbody').getElementsByTagName("FORM"); + upload(); +} + +function upload() { + if(typeof(forms[nowUid]) == 'undefined') return false; + var nid = forms[nowUid].id.split('_'); + nid = nid[1]; + if(nowUid>0) { + var upobj = $('showmsg'+nowid); + if(uploadStat==1) { + upobj.innerHTML = '上传成功'; + successState = true; + var InputNode; + try { + var InputNode = document.createElement(""); + } catch(e) { + var InputNode = document.createElement("input"); + InputNode.setAttribute("name", "picids["+picid+"]"); + InputNode.setAttribute("type", "hidden"); + InputNode.setAttribute("id", "picid_" + picid); + InputNode.setAttribute("value", nowid); + } + mainForm.appendChild(InputNode); + + } else { + upobj.style.color = "#f00"; + upobj.innerHTML = '上传失败 '+uploadStat; + } + } + + if($('showmsg'+nid) != null) { + $('showmsg'+nid).innerHTML = '上传中,请等待(重试)'; + $('albumid_'+nid).value = albumid; + forms[nowUid].submit(); + } else if(nowUid+1 == forms.length) { + if(typeof (no_insert) != 'undefined') { + var albumidcheck = parseInt(parent.albumid); + $('opalbumid').value = isNaN(albumidcheck)? 0 : albumid; + if(!successState) return false; + } + window.onbeforeunload = null; + mainForm.submit(); + } + nowid = nid; + nowUid++; + uploadStat = 0; +} \ No newline at end of file diff --git a/static/js/html2dynamic.js b/static/js/html2dynamic.js new file mode 100644 index 0000000..4e5d418 --- /dev/null +++ b/static/js/html2dynamic.js @@ -0,0 +1,125 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: html2dynamic.js 32720 2013-03-04 10:21:58Z zhangguosheng $ +*/ + +function htmlGetUserStatus () { + var x = new Ajax(); + var type = '', typeid = 0, arr = []; + if(DYNAMICURL.indexOf('mod=topic') > -1) { + type = 'topic'; + arr = DYNAMICURL.match(/topicid=(\d+)/); + typeid = arr ? arr[1] : 0; + } else if(DYNAMICURL.indexOf('mod=view') > -1) { + type = 'article'; + arr = DYNAMICURL.match(/aid=(\d+)/); + typeid = arr ? arr[1] : 0; + } + + x.getJSON('misc.php?mod=userstatus&r='+(+(new Date())+'&type='+type+'&typeid='+typeid), function (s) { + if(s) { + for(var key in s) { + switch(key) { + case 'userstatus' : + initUserstatus(s[key]); + break; + case 'qmenu' : + initQmenu(s[key]); + break; + case 'diynav' : + initDiynav(s[key]); + break; + case 'commentnum' : + case 'viewnum' : + initNum(key, s[key]); + break; + + } + } + } + }); + + function initNum(name, val) { + var obj = null; + if(val > 0 && (obj = $('_'+name))) { + obj.innerHTML = parseInt(val); + } + } + + function initUserstatus (code) { + try{ + var lsform = $('lsform'); + if(lsform) { + var i = 0, l = 0; + var parent = lsform.parentNode; + var dom = document.createElement('div'); + dom.innerHTML = code; + var allNodes = dom.childNodes; + parent.removeChild(lsform); + for(i = 0,l = allNodes.length; i < l; i++) { + parent.appendChild(allNodes[0]); + } + evalscript(code); + } + } catch (e) { + debug('initUserstatus', e); + } + } + + function initQmenu(code) { + try { + var qmenu = $('qmenu_menu'); + if(qmenu) { + var dom = document.createElement('div'); + dom.innerHTML = code; + qmenu.parentNode.replaceChild(dom.childNodes[0], qmenu); + evalscript(code); + } + } catch (e) { + debug('initQmenu', e); + } + + } + + function initDiynav(code) { + try { + var i = 0, l = 0; + var dom = document.createElement('div'); + dom.innerHTML = code; + var allNodes = dom.childNodes; + var switchblind = $('switchblind'); + var insertdom = ''; + if(switchblind) { + insertdom = switchblind.parentNode; + for(i = 0,l = allNodes.length; i < l; i++) { + insertdom.appendChild(allNodes[0]); + } + } else { + var wp = $('wp'); + if(wp) { + insertdom = wp.parentNode; + for(i = 0,l = allNodes.length; i < l; i++) { + insertdom.insertBefore(allNodes[0], wp); + } + } + } + } catch (e) { + debug('initDiynav', e); + } + } + + function debug(name, e) { + if(console) { + console.log(name + ':' + e); + } + } +} + +function htmlCheckUpdate() { + var timestamp = (+ new Date())/1000; + if(html_lostmodify && html_lostmodify < timestamp - 300) { + $F('make_html', [SITEURL + DYNAMICURL + (DYNAMICURL.indexOf('?') < 0 ? '?' : '&') + '_makehtml'], 'makehtml'); + } +} \ No newline at end of file diff --git a/static/js/html5notification.js b/static/js/html5notification.js new file mode 100644 index 0000000..85f6253 --- /dev/null +++ b/static/js/html5notification.js @@ -0,0 +1,39 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: html5notification.js 31484 2012-09-03 03:49:21Z zhangjie $ +*/ + +function Html5notification() { + var h5n = new Object(); + + h5n.issupport = function() { + return 'Notification' in window; + }; + + h5n.shownotification = function(replaceid, url, imgurl, subject, message) { + if (Notification.permission === 'granted') { + sendit(); + } else if (Notification.permission !== 'denied') { + Notification.requestPermission().then(function (perm) { + if (perm === 'granted') { + sendit(); + } + }); + } + function sendit() { + var n = new Notification(subject, { + tag: replaceid, + icon: imgurl, + body: message + }); + n.onclick = function (e) { + e.preventDefault(); + window.open(url, '_blank'); + }; + } + }; + + return h5n; +} \ No newline at end of file diff --git a/static/js/imgcropper.js b/static/js/imgcropper.js new file mode 100644 index 0000000..d78ad08 --- /dev/null +++ b/static/js/imgcropper.js @@ -0,0 +1,627 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: imgcropper.js 30998 2012-07-06 07:22:08Z zhangguosheng $ +*/ +(function(){ + + ImgCropper = function() { + this.options = { + opacity: 50, + color: "", + width: 0, + height: 0, + resize: false, + right: "", + left: "", + up: "", + down: "", + rightDown: "", + leftDown: "", + rightUp: "", + leftUp: "", + min: false, + minWidth: 50, + minHeight: 50, + scale: false, + ratio: 0, + Preview: "", + viewWidth: 0, + viewHeight: 0 + }; + this.setParameter.apply(this, arguments); + }; + ImgCropper.prototype = { + setParameter: function(container, handle, url, options) { + this._container = $(container); + this._layHandle = $(handle); + this.url = url; + + this._layBase = this._container.appendChild(document.createElement("img")); + this._layCropper = this._container.appendChild(document.createElement("img")); + this._layCropper.onload = Util.bindApply(this, this.setPos); + this._tempImg = document.createElement("img"); + this._tempImg.onload = Util.bindApply(this, this.setSize); + + this.options = Util.setOptions(this.options, options || {}); + + this.opacity = Math.round(this.options.opacity); + this.color = this.options.color; + this.scale = !!this.options.scale; + this.ratio = Math.max(this.options.ratio, 0); + this.width = Math.round(this.options.width); + this.height = Math.round(this.options.height); + this.setLayHandle = true; + + var oPreview = $(this.options.Preview); + if(oPreview){ + oPreview.style.position = "relative"; + oPreview.style.overflow = "hidden"; + this.viewWidth = Math.round(this.options.viewWidth); + this.viewHeight = Math.round(this.options.viewHeight); + this._view = oPreview.appendChild(document.createElement("img")); + this._view.style.position = "absolute"; + this._view.onload = Util.bindApply(this, this.SetPreview); + } + this._drag = new dzDrag(handle, {limit:true, container:container, onDragMove: Util.bindApply(this, this.setPos)}); + this.resize = !!this.options.resize; + if(this.resize){ + var op = this.options; + var _resize = new ImgCropperResize(container, {max: false, scale:true, min:true, minWidth:options.minWidth, minHeight:options.minHeight, onResize: Util.bindApply(this, this.scaleImg)}); + op.rightDown && (_resize.set(op.rightDown, "right-down")); + op.leftDown && (_resize.set(op.leftDown, "left-down")); + op.rightUp && (_resize.set(op.rightUp, "right-up")); + op.leftUp && (_resize.set(op.leftUp, "left-up")); + op.right && (_resize.set(op.right, "right")); + op.left && (_resize.set(op.left, "left")); + op.down && (_resize.set(op.down, "down")); + op.up && (_resize.set(op.up, "up")); + this.min = !!this.options.min; + this.minWidth = Math.round(this.options.minWidth); + this.minHeight = Math.round(this.options.minHeight); + this._resize = _resize; + } + this._container.style.position = "relative"; + this._container.style.overflow = "hidden"; + this._layHandle.style.zIndex = 200; + this._layCropper.style.zIndex = 100; + this._layBase.style.position = this._layCropper.style.position = "absolute"; + this._layBase.style.top = this._layBase.style.left = this._layCropper.style.top = this._layCropper.style.left = 0; + this.initialize(); + }, + + initialize: function() { + this.color && (this._container.style.backgroundColor = this.color); + this._tempImg.src = this._layBase.src = this._layCropper.src = this.url; + if(BROWSER.ie){ + this._layBase.style.filter = "alpha(opacity:" + this.opacity + ")"; + this._layHandle.style.filter = "alpha(opacity:0)"; + this._layHandle.style.backgroundColor = "#FFF"; + } else { + this._layBase.style.opacity = this.opacity / 100; + } + this._view && (this._view.src = this.url); + if(this.resize){ + with(this._resize){ + Scale = this.scale; Ratio = this.ratio; Min = this.min; minWidth = this.minWidth; minHeight = this.minHeight; + } + } + }, + setPos: function() { + if(BROWSER.ie == 6.0){ with(this._layHandle.style){ zoom = .9; zoom = 1; }; }; + var p = this.getPos(); + this._layCropper.style.clip = "rect(" + p.Top + "px " + (p.Left + p.Width) + "px " + (p.Top + p.Height) + "px " + p.Left + "px)"; + this.SetPreview(); + parent.resetHeight(this._container, this.getPos(), this._layBase); + }, + scaleImg:function() { + this.height = this._resize._styleHeight; + this.width = this._resize._styleWidth; + this.initialize(); + this.setSize(); + this.setPos(); + var maxRight = (parseInt(this._layHandle.style.left) || 0) + (parseInt(this._layHandle.offsetWidth) || 0); + var maxBottom = (parseInt(this._layHandle.style.top) || 0) + (parseInt(this._layHandle.offsetHeight) || 0); + if(this._container != null) { + if(maxRight > this._container.clientWidth) { + var nowLeft = this._container.clientWidth - this._layHandle.offsetWidth; + this._layHandle.style.left = (nowLeft < 0 ? 0 : nowLeft) + "px"; + } + if(maxBottom > this._container.clientHeight) { + var nowTop = this._container.clientHeight - this._layHandle.offsetHeight; + this._layHandle.style.top = (nowTop < 0 ? 0 : nowTop) + "px"; + } + } + parent.resetHeight(this._container, this.getPos(), this._layBase); + }, + SetPreview: function() { + if(this._view){ + var p = this.getPos(), s = this.getSize(p.Width, p.Height, this.viewWidth, this.viewHeight), scale = s.Height / p.Height; + var pHeight = this._layBase.height * scale, pWidth = this._layBase.width * scale, pTop = p.Top * scale, pLeft = p.Left * scale; + with(this._view.style){ + width = pWidth + "px"; height = pHeight + "px"; top = - pTop + "px "; left = - pLeft + "px"; + clip = "rect(" + pTop + "px " + (pLeft + s.Width) + "px " + (pTop + s.Height) + "px " + pLeft + "px)"; + } + } + }, + setSize: function() { + if(this.width > this._tempImg.width) { + this.width = this._tempImg.width; + } + if(this.height > this._tempImg.height) { + this.height = this._tempImg.height; + } + var s = this.getSize(this._tempImg.width, this._tempImg.height, this.width, this.height); + if(this.options.min && (s.Width <= this.options.minWidth || s.Height <= this.options.minHeight)) { + return false; + } + this._layBase.style.width = this._layCropper.style.width = s.Width + "px"; + this._layBase.style.height = this._layCropper.style.height = s.Height + "px"; + this._drag.maxRight = s.Width; this._drag.maxBottom = s.Height; + if(this.resize) { + this._container.style.width = this._layBase.style.width; this._container.style.height = this._layBase.style.height; + if(this.setLayHandle) { + this._layHandle.style.left = ((s.Width - this._layHandle.offsetWidth)/2)+"px"; + this._layHandle.style.top = ((s.Height - this._layHandle.offsetHeight)/2)+"px"; + this.setPos(); + this.setLayHandle = false; + } + } + }, + getPos: function() { + with(this._layHandle){ + return { Top: offsetTop, Left: offsetLeft, Width: offsetWidth, Height: offsetHeight }; + } + }, + getSize: function(nowWidth, nowHeight, fixWidth, fixHeight) { + var iWidth = nowWidth, iHeight = nowHeight, scale = iWidth / iHeight; + if(fixHeight){ iWidth = (iHeight = fixHeight) * scale; } + if(fixWidth && (!fixHeight || iWidth > fixWidth)){ iHeight = (iWidth = fixWidth) / scale; } + return { Width: iWidth, Height: iHeight } + } + }; + + ImgCropperResize = function() { + this.options = { + max: false, + container: "", + maxLeft: 0, + maxRight: 9999, + maxTop: 0, + maxBottom: 9999, + min: false, + minWidth: 50, + minHeight: 50, + scale: false, + ratio: 0, + onResize: function(){} + }; + this.initialize.apply(this, arguments); + }; + + ImgCropperResize.prototype = { + initialize: function(resizeObjId, options) { + this.options = Util.setOptions(this.options, options || {}); + this._resizeObj = $(resizeObjId); + + this._styleWidth = this._styleHeight = this._styleLeft = this._styleTop = 0; + this._sideRight = this._sideDown = this._sideLeft = this._sideUp = 0; + this._fixLeft = this._fixTop = 0; + this._scaleLeft = this._scaleTop = 0; + + this._maxSet = function(){}; + this._maxRightWidth = this._maxDownHeight = this._maxUpHeight = this._maxLeftWidth = 0; + this._maxScaleWidth = this._maxScaleHeight = 0; + + this._fun = function(){}; + + var _style = Util.currentStyle(this._resizeObj); + this._borderX = (parseInt(_style.borderLeftWidth) || 0) + (parseInt(_style.borderRightWidth) || 0); + this._borderY = (parseInt(_style.borderTopWidth) || 0) + (parseInt(_style.borderBottomWidth) || 0); + this._resizeTranscript = Util.bindApply(this, this.resize); + this._stopTranscript = Util.bindApply(this, this.stop); + + this.max = !!this.options.max; + this._container = $(this.options.container) || null; + this.maxLeft = Math.round(this.options.maxLeft); + this.maxRight = Math.round(this.options.maxRight); + this.maxTop = Math.round(this.options.maxTop); + this.maxBottom = Math.round(this.options.maxBottom); + this.min = !!this.options.min; + this.minWidth = Math.round(this.options.minWidth); + this.minHeight = Math.round(this.options.minHeight); + this.scale = !!this.options.scale; + this.ratio = Math.max(this.options.ratio, 0); + + this.onResize = this.options.onResize; + + this._resizeObj.style.position = "absolute"; + !this._container || Util.currentStyle(this._container).position == "relative" || (this._container.style.position = "relative"); + }, + set: function(resize, side) { + var resize = $(resize), fun; + if(!resize) return; + switch(side.toLowerCase()) { + case "up": + fun = this.up; + break; + case "down": + fun = this.down; + break; + case "left": + fun = this.left; + break; + case "right": + fun = this.right; + break; + case "left-up": + fun = this.leftUp; + break; + case "right-up": + fun = this.rightUp; + break; + case "left-down": + fun = this.leftDown; + break; + case "right-down" : + default: + fun = this.rightDown; + break; + }; + Util.addEventHandler(resize, "mousedown", Util.bindApply(this, this.start, fun)); + }, + start: function(oEvent, fun, touch) { + oEvent.stopPropagation ? oEvent.stopPropagation() : (oEvent.cancelBubble = true); + this._fun = fun; + + this._styleWidth = this._resizeObj.clientWidth; + this._styleHeight = this._resizeObj.clientHeight; + this._styleLeft = this._resizeObj.offsetLeft; + this._styleTop = this._resizeObj.offsetTop; + this._sideLeft = oEvent.clientX - this._styleWidth; + this._sideRight = oEvent.clientX + this._styleWidth; + this._sideUp = oEvent.clientY - this._styleHeight; + this._sideDown = oEvent.clientY + this._styleHeight; + this._fixLeft = this._styleLeft + this._styleWidth; + this._fixTop = this._styleTop + this._styleHeight; + + if(this.scale) { + this.ratio = Math.max(this.ratio, 0) || this._styleWidth / this._styleHeight; + this._scaleLeft = this._styleLeft + this._styleWidth / 2; + this._scaleTop = this._styleTop + this._styleHeight / 2; + }; + if(this.max) { + var maxLeft = this.maxLeft, maxRight = this.maxRight, maxTop = this.maxTop, maxBottom = this.maxBottom; + if(!!this._container){ + maxLeft = Math.max(maxLeft, 0); + maxTop = Math.max(maxTop, 0); + maxRight = Math.min(maxRight, this._container.clientWidth); + maxBottom = Math.min(maxBottom, this._container.clientHeight); + }; + maxRight = Math.max(maxRight, maxLeft + (this.min ? this.minWidth : 0) + this._borderX); + maxBottom = Math.max(maxBottom, maxTop + (this.min ? this.minHeight : 0) + this._borderY); + this._mxSet = function() { + this._maxRightWidth = maxRight - this._styleLeft - this._borderX; + this._maxDownHeight = maxBottom - this._styleTop - this._borderY; + this._maxUpHeight = Math.max(this._fixTop - maxTop, this.min ? this.minHeight : 0); + this._maxLeftWidth = Math.max(this._fixLeft - maxLeft, this.min ? this.minWidth : 0); + }; + this._mxSet(); + if(this.scale) { + this._maxScaleWidth = Math.min(this._scaleLeft - maxLeft, maxRight - this._scaleLeft - this._borderX) * 2; + this._maxScaleHeight = Math.min(this._scaleTop - maxTop, maxBottom - this._scaleTop - this._borderY) * 2; + } + } + Util.addEventHandler(document, "mousemove", this._resizeTranscript); + Util.addEventHandler(document, "mouseup", this._stopTranscript); + if(BROWSER.ie){ + Util.addEventHandler(this._resizeObj, "losecapture", this._stopTranscript); + this._resizeObj.setCapture(); + }else{ + Util.addEventHandler(window, "blur", this._stopTranscript); + oEvent.preventDefault(); + }; + }, + resize: function(e) { + window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty(); + this._fun(e); + if(this.options.min && (this._styleWidth <= this.options.minWidth || this._styleHeight <= this.options.minHeight)) { + return false; + } + with(this._resizeObj.style) { + width = this._styleWidth + "px"; height = this._styleHeight + "px"; + top = this._styleTop + "px"; left = this._styleLeft + "px"; + } + this.onResize(); + }, + up: function(e) { + this.repairY(this._sideDown - e.clientY, this._maxUpHeight); + this.repairTop(); + this.turnDown(this.down); + }, + down: function(e) { + this.repairY(e.clientY - this._sideUp, this._maxDownHeight); + this.turnUp(this.up); + }, + right: function(e) { + this.repairX(e.clientX - this._sideLeft, this._maxRightWidth); + this.turnLeft(this.left); + }, + left: function(e) { + this.repairX(this._sideRight - e.clientX, this._maxLeftWidth); + this.repairLeft(); + this.turnRight(this.right); + }, + rightDown: function(e) { + this.repairAngle( + e.clientX - this._sideLeft, this._maxRightWidth, + e.clientY - this._sideUp, this._maxDownHeight + ); + this.turnLeft(this.leftDown) || this.scale || this.turnUp(this.rightUp); + }, + rightUp: function(e) { + this.repairAngle( + e.clientX - this._sideLeft, this._maxRightWidth, + this._sideDown - e.clientY, this._maxUpHeight + ); + this.repairTop(); + this.turnLeft(this.leftUp) || this.scale || this.turnDown(this.rightDown); + }, + leftDown: function(e) { + this.repairAngle( + this._sideRight - e.clientX, this._maxLeftWidth, + e.clientY - this._sideUp, this._maxDownHeight + ); + this.repairLeft(); + this.turnRight(this.rightDown) || this.scale || this.turnUp(this.leftUp); + }, + leftUp: function(e) { + this.repairAngle( + this._sideRight - e.clientX, this._maxLeftWidth, + this._sideDown - e.clientY, this._maxUpHeight + ); + this.repairTop(); + this.repairLeft(); + this.turnRight(this.rightUp) || this.scale || this.turnDown(this.leftDown); + }, + repairX: function(iWidth, maxWidth) { + iWidth = this.repairWidth(iWidth, maxWidth); + if(this.scale){ + var iHeight = this.repairScaleHeight(iWidth); + if(this.max && iHeight > this._maxScaleHeight){ + iHeight = this._maxScaleHeight; + iWidth = this.repairScaleWidth(iHeight); + }else if(this.min && iHeight < this.minHeight){ + var tWidth = this.repairScaleWidth(this.minHeight); + if(tWidth < maxWidth){ iHeight = this.minHeight; iWidth = tWidth; } + } + this._styleHeight = iHeight; + this._styleTop = this._scaleTop - iHeight / 2; + } + this._styleWidth = iWidth; + }, + repairY: function(iHeight, maxHeight) { + iHeight = this.repairHeight(iHeight, maxHeight); + if(this.scale){ + var iWidth = this.repairScaleWidth(iHeight); + if(this.max && iWidth > this._maxScaleWidth){ + iWidth = this._maxScaleWidth; + iHeight = this.repairScaleHeight(iWidth); + }else if(this.min && iWidth < this.minWidth){ + var tHeight = this.repairScaleHeight(this.minWidth); + if(tHeight < maxHeight){ iWidth = this.minWidth; iHeight = tHeight; } + } + this._styleWidth = iWidth; + this._styleLeft = this._scaleLeft - iWidth / 2; + } + this._styleHeight = iHeight; + }, + repairAngle: function(iWidth, maxWidth, iHeight, maxHeight) { + iWidth = this.repairWidth(iWidth, maxWidth); + if(this.scale) { + iHeight = this.repairScaleHeight(iWidth); + if(this.max && iHeight > maxHeight){ + iHeight = maxHeight; + iWidth = this.repairScaleWidth(iHeight); + }else if(this.min && iHeight < this.minHeight){ + var tWidth = this.repairScaleWidth(this.minHeight); + if(tWidth < maxWidth){ iHeight = this.minHeight; iWidth = tWidth; } + } + } else { + iHeight = this.repairHeight(iHeight, maxHeight); + } + this._styleWidth = iWidth; + this._styleHeight = iHeight; + }, + repairTop: function() { + this._styleTop = this._fixTop - this._styleHeight; + }, + repairLeft: function() { + this._styleLeft = this._fixLeft - this._styleWidth; + }, + repairHeight: function(iHeight, maxHeight) { + iHeight = Math.min(this.max ? maxHeight : iHeight, iHeight); + iHeight = Math.max(this.min ? this.minHeight : iHeight, iHeight, 0); + return iHeight; + }, + repairWidth: function(iWidth, maxWidth) { + iWidth = Math.min(this.max ? maxWidth : iWidth, iWidth); + iWidth = Math.max(this.min ? this.minWidth : iWidth, iWidth, 0); + return iWidth; + }, + repairScaleHeight: function(iWidth) { + return Math.max(Math.round((iWidth + this._borderX) / this.ratio - this._borderY), 0); + }, + repairScaleWidth: function(iHeight) { + return Math.max(Math.round((iHeight + this._borderY) * this.ratio - this._borderX), 0); + }, + turnRight: function(fun) { + if(!(this.min || this._styleWidth)){ + this._fun = fun; + this._sideLeft = this._sideRight; + this.max && this._mxSet(); + return true; + } + }, + turnLeft: function(fun) { + if(!(this.min || this._styleWidth)){ + this._fun = fun; + this._sideRight = this._sideLeft; + this._fixLeft = this._styleLeft; + this.max && this._mxSet(); + return true; + } + }, + turnUp: function(fun) { + if(!(this.min || this._styleHeight)){ + this._fun = fun; + this._sideDown = this._sideUp; + this._fixTop = this._styleTop; + this.max && this._mxSet(); + return true; + } + }, + turnDown: function(fun) { + if(!(this.min || this._styleHeight)){ + this._fun = fun; + this._sideUp = this._sideDown; + this.max && this._mxSet(); + return true; + } + }, + stop: function() { + Util.removeEventHandler(document, "mousemove", this._resizeTranscript); + Util.removeEventHandler(document, "mouseup", this._stopTranscript); + if(BROWSER.ie){ + Util.removeEventHandler(this._resizeObj, "losecapture", this._stopTranscript); + this._resizeObj.releaseCapture(); + }else{ + Util.removeEventHandler(window, "blur", this._stopTranscript); + } + } + }; + dzDrag = function() { + this.options = { + handle: '', + limit: false, + maxLeft: 0, + maxRight: 9999, + maxTop: 0, + maxBottom: 9999, + container: '', + lockX: false, + lockY: false, + onDragStart: function(){}, + onDragMove: function(){}, + onDragEnd: function(){} + }; + this.initialize.apply(this, arguments); + }; + dzDrag.prototype = { + initialize: function(dragId, options) { + this.options = Util.setOptions(this.options, options || {}); + this._dragObj = $(dragId); + this._x = this._y = 0; + this._marginLeft = this._marginTop = 0; + this._handle = $(this.options.handle) || this._dragObj; + this._container = $(this.options.container) || null; + this._dragObj.style.position = "absolute"; + this._dragEndTranscript = Util.bindApply(this, this.dragEnd); + this._dragMoveTranscript = Util.bindApply(this, this.dragMove); + Util.addEventHandler(this._handle, "mousedown", Util.bindApply(this, this.dragStart)); + }, + dragStart: function(event) { + + this.setLimit(); + this._x = event.clientX - this._dragObj.offsetLeft; + this._y = event.clientY - this._dragObj.offsetTop; + + var curStyle = Util.currentStyle(this._dragObj); + this._marginLeft = parseInt(curStyle.marginLeft) || 0; + this._marginTop = parseInt(curStyle.marginTop) || 0; + Util.addEventHandler(document, "mousemove", this._dragMoveTranscript); + Util.addEventHandler(document, "mouseup", this._dragEndTranscript); + if(BROWSER.ie){ + Util.addEventHandler(this._handle, "losecapture", this._dragEndTranscript); + this._handle.setCapture(); + }else{ + Util.addEventHandler(window, "blur", this._dragEndTranscript); + event.preventDefault(); + }; + this.options.onDragStart(); + }, + dragMove: function(event) { + window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty(); + var iLeft = event.clientX - this._x; + var iTop = event.clientY - this._y; + if(this.options.limit) { + var maxLeft = this.options.maxLeft, maxRight = this.options.maxRight, maxTop = this.options.maxTop, maxBottom = this.options.maxBottom; + if(this._container != null){ + maxLeft = Math.max(maxLeft, 0); + maxTop = Math.max(maxTop, 0); + maxRight = Math.min(maxRight, this._container.clientWidth); + maxBottom = Math.min(maxBottom, this._container.clientHeight); + }; + iLeft = Math.max(Math.min(iLeft, maxRight - this._dragObj.offsetWidth), maxLeft); + iTop = Math.max(Math.min(iTop, maxBottom - this._dragObj.offsetHeight), maxTop); + } + if(!this.options.lockX) { this._dragObj.style.left = iLeft - this._marginLeft + "px"; } + if(!this.options.lockY) { this._dragObj.style.top = iTop - this._marginTop + "px"; } + this.options.onDragMove(); + }, + dragEnd: function(event) { + Util.removeEventHandler(document, "mousemove", this._dragMoveTranscript); + Util.removeEventHandler(document, "mouseup", this._dragEndTranscript); + if(BROWSER.ie) { + Util.removeEventHandler(this._handle, "losecapture", this._dragEndTranscript); + this._handle.releaseCapture(); + } else { + Util.removeEventHandler(window, "blur", this._dragEndTranscript); + } + this.options.onDragEnd(); + }, + setLimit: function() { + if(this.options.limit) { + this.options.maxRight = Math.max(this.options.maxRight, this.options.maxLeft + this._dragObj.offsetWidth); + this.options.maxBottom = Math.max(this.options.maxBottom, this.options.maxTop + this._dragObj.offsetHeight); + !this._container || Util.currentStyle(this._container).position == "relative" || Util.currentStyle(this._container).position == "absolute" || (this._container.style.position = "relative"); + } + } + }; + var Util = { + setOptions: function(object, source) { + for(var property in source) { + object[property] = source[property]; + } + return object; + }, + addEventHandler: function(targetObj, eventType, funHandler) { + if(targetObj.addEventListener) { + targetObj.addEventListener(eventType, funHandler, false); + } else if (targetObj.attachEvent) { + targetObj.attachEvent("on" + eventType, funHandler); + } else { + targetObj["on" + eventType] = funHandler; + } + }, + removeEventHandler: function(targetObj, eventType, funHandler) { + if(targetObj.removeEventListener) { + targetObj.removeEventListener(eventType, funHandler, false); + } else if (targetObj.detachEvent) { + targetObj.detachEvent("on" + eventType, funHandler); + } else { + targetObj["on" + eventType] = null; + } + }, + bindApply: function(object, fun) { + var args = Array.prototype.slice.call(arguments).slice(2); + return function(event) { + return fun.apply(object, [event || window.event].concat(args)); + }; + }, + currentStyle: function(element){ + return element.currentStyle || document.defaultView.getComputedStyle(element, null); + } + }; +})(); \ No newline at end of file diff --git a/static/js/index.htm b/static/js/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/js/jquery/index.htm b/static/js/jquery/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/static/js/jquery/jquery.min.js b/static/js/jquery/jquery.min.js new file mode 100644 index 0000000..200b54e --- /dev/null +++ b/static/js/jquery/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
                  "],col:[2,"","
                  "],tr:[2,"","
                  "],td:[3,"","
                  "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
                  ",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0'+title+'生成成功'; + } + if(ret['nexturl']) { + if(obj) { + obj.style.color = 'green'; + obj.innerHTML = '生成'+title+(Math.round((ret['current']/ret['count'])*100))+'%'; + } + make_html(ret['nexturl'], obj); + } + } else { + if(obj) { + obj.style.color = 'red'; + obj.innerHTML = title+'生成失败'; + } + } + }); + +} + +function make_html_batch(url, ids, callback, dom, single) { + this.url = url; + this.ids = ids; + this.count = this.ids.length; + this.callback = callback; + this.dom = dom; + this.single = single && 1; + this.makedcount = 0; + this.jumptime = 2000; + + if(this.single) { + this.make(this.ids, this.dom); + } else if(this.ids) { + id = this.ids.pop(); + var child = document.createElement('div'); + child.style.color = 'green'; + var cent = ((1/this.count)*100).toFixed(2); + progress_bar(cent); + child.innerHTML = '开始生成'+this.dom.getAttribute('mktitle'); + this.dom.innerHTML = ''; + this.dom.appendChild(child); + this.make(id, child); + this.child = child; + var child2 = document.createElement('div'); + child2.innerHTML = '如果您的浏览器没有反应,请点击继续...'; + this.dom.appendChild(child2); + var obj = this; + $('mk_goon').onclick = function (e) {make_html_batch.prototype.make_goon.call(obj, e)}; + } + +} + + +make_html_batch.prototype = { + + make_goon : function (){ + var id = this.ids.pop(); + if(id) { + this.make(this.ids.pop(), this.child); + } else if(this.callback) { + var obj = this; + setTimeout(function(){obj.dom.style.display = 'none';(obj.callback)();}, 1000); + } + }, + make : function (id, child) { + var obj = this; + var x = Ajax(); + x.getJSON(this.url+id+'&_makehtml&r='+(+ new Date()), function(ret){ + if(ret && (data=ret['data']) && data['status'] == 'html_ok') { + obj.makedcount++; + if(data['nexturl']) { + make_html(data['nexturl']); + } + } else if(ret && ret['message']) { + var makehtml_error = $('makehtml_error'); + if(!makehtml_error) { + obj.jumptime = 500000; + makehtml_error = document.createElement('div'); + makehtml_error.style.color = 'red'; + makehtml_error.style.height = '200px'; + makehtml_error.style.overflow = 'scroll'; + makehtml_error.id = 'makehtml_error'; + makehtml_error.innerHTML = '错误信息'; + obj.dom.appendChild(makehtml_error); + } + makehtml_error.innerHTML += '
                  [id:' + id + ']' + ret['message']; + makehtml_error.scrollTop = makehtml_error.scrollHeight; + } + + if(obj.single) { + child.style.color = 'blue'; + child.innerHTML = ''; + if(obj.callback) { + setTimeout(function(){(obj.callback)();}, 2000); + } + } else if((id = obj.ids.pop()) || obj.ids.length == 0){ + var current = obj.count - obj.ids.length; + var cent = ((current/obj.count)*100).toFixed(2); + progress_bar(cent); + var str = '本次共需要生成'+obj.count+'个'+obj.dom.getAttribute('mktitle')+'文件,成功生成'+obj.makedcount+'个,'; + if(cent != 100) { + child.innerHTML = str+'正在生成第'+current+'个,已经完成'+cent+'%'; + } else { + child.style.color = 'blue'; + child.innerHTML = str+obj.dom.getAttribute('mktitle')+'生成完成'; + } + if(id) { + obj.make(id, child); + } else if(obj.callback) { + setTimeout(function(){progress_bar_reset(); obj.dom.innerHTML = ''; obj.dom.style.display = 'none'; (obj.callback)();}, obj.jumptime); + } + } + }); + delete x; + } +}; + +function progress_bar(cent) { + var dom = $('progress_bar'); + if(dom) { + if(dom.style.display != 'block') { + dom.style.display = 'block'; + } + var allwidth = 400; + var setwidth = allwidth * (cent / 100); + dom.style.borderLeftWidth = setwidth + 'px'; + dom.style.width = (allwidth - setwidth) + 'px'; + } +} + +function progress_bar_reset() { + var dom = $('progress_bar'); + if(dom) { + dom.style.display = 'none'; + dom.style.borderLeftWidth = '1px'; + dom.style.width = '400px'; + } +} \ No newline at end of file diff --git a/static/js/md5.js b/static/js/md5.js new file mode 100644 index 0000000..6f13fbe --- /dev/null +++ b/static/js/md5.js @@ -0,0 +1,153 @@ +/* + [Discuz!] (C)2001-2099 Comsenz Inc. + This is NOT a freeware, use is subject to license terms + + $Id: md5.js 29228 2012-03-30 01:46:00Z monkey $ +*/ + +var hexcase = 0; +var chrsz = 8; +function hex_md5(s){ + return binl2hex(core_md5(str2binl(s), s.length * chrsz)); +} +function core_md5(x, len) { + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for(var i = 0; i < x.length; i += 16) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); + d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); + d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); + d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i+10], 17, -42063); + b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); + d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); + d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); + c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); + d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); + c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); + d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); + c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); + d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); + c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); + d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); + d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); + d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); + d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); + d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); + d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); + d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); + d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); +} +function md5_cmn(q, a, b, x, s, t) { + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) { + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function md5_gg(a, b, c, d, x, s, t) { + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); +} +function md5_hh(a, b, c, d, x, s, t) { + return md5_cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5_ii(a, b, c, d, x, s, t) { + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); +} +function safe_add(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} +function bit_rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); +} +function str2binl(str) { + var bin = Array(); + var mask = (1 << chrsz) - 1; + for(var i = 0; i < str.length * chrsz; i += chrsz) { + bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); + } + return bin; +} +function binl2hex(binarray) { + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i++) { + str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); + } + return str; +} +var pwmd5log = new Array(); +function pwmd5() { + if(!$(pwmd5.arguments[0]) || $(pwmd5.arguments[0]).value == '') { + return; + } + numargs = pwmd5.arguments.length; + for(var i = 0; i < numargs; i++) { + if(!pwmd5log[pwmd5.arguments[i]] || $(pwmd5.arguments[i]).value.length != 32) { + pwmd5log[pwmd5.arguments[i]] = $(pwmd5.arguments[i]).value = hex_md5($(pwmd5.arguments[i]).value); + } + } +} \ No newline at end of file diff --git a/static/js/mobile/ajaxfileupload.js b/static/js/mobile/ajaxfileupload.js new file mode 100644 index 0000000..da032dc --- /dev/null +++ b/static/js/mobile/ajaxfileupload.js @@ -0,0 +1,151 @@ +jQuery.extend({ + createuploadiframe: function(id, url) { + var iframeid = 'uploadiframe' + id; + var iframe = ' +
                  +

                  + +

                  + + +
            • + + \ No newline at end of file diff --git a/template/default/common/module.css b/template/default/common/module.css new file mode 100644 index 0000000..65164df --- /dev/null +++ b/template/default/common/module.css @@ -0,0 +1,2254 @@ +/* + +Extend CSS file for Discuz! X +(C) Comsenz Inc. +https://www.discuz.vip +Created & Modified by Alice, Monkey, Lushnis, Pony, Dfox & DragonLee. + +1. 一些通用模块的样式 + 1. 公告 + 2. 在线会员列表 + 3. 类似圈子中邀请好友中的好友列表 + 4. 动态列表 + 5. 进度条 + 6. 广场以外的引用、代码样式 + 7. 版主管理(包括2.3、2.4) + 8. 登录注册 + 9. 标签 +2. 发帖相关样式 + 1. 编辑器中的功能样式 + 2. 主题图标 + 3. 提交表单 + 4. 发特殊主题帖 +3. 列表样式 + 1. 广场版块、圈子分类列表 + 2. 房屋列表 + 3. 主题列表 +4. 文章内容区域样式 + 1. 结构 + 2. 作者、时间、楼层等一些属性 + 3. 文章正文 + 1. 回帖推荐、点评等 + 2. 用户详细信息 + 3. 文章附件及一些特殊样式(如锁定、引用、代码等) + 4. 特殊帖样式 + 5. 广场和空间共用的商品、辩论等样式 + 6. 显示原始图片弹出层样式 +5. 圈子相关样式 +6. 文章、日志等页面样式 +7. 空间相关样式 +8. 门户相关样式 +10.搜索相关样式 +11.排行榜相关样式 +12.统计相关样式 + +* 全局 CSS 样式参见 common.css +* 以下为模块 CSS 写法举例 +* 分类之间空三行,模块之间空两行,区块之间空一行 */ + +/** group::index **/ + /* 圈子 index 模块使用的CSS */ +/** end **/ + +/** group::index,forum::index **/ + /* 圈子 index 和 论坛 index 模块使用的CSS */ +/** end **/ + +/** forum **/ + /* 论坛 所有模块使用的CSS */ +/** end **/ + + + +/* ------------------------------------------------------------------------ 一些通用模块的样式 */ + +/** forum::index **/ +#pt .y { width: 550px; height: 29px; overflow: hidden; } +#chart { margin-bottom: 5px; } + .chart { color: {LIGHTTEXT}; } + .chart:before { font-family: dzicon; content: "\f104"; display: inline-block; height: 16px; line-height: 16px; font-size: 18px; color: #4284CE; margin-right: 4px; } + .chart em { color: {TABLETEXT}; } +/* + Name: mod_announcement + Level: Function + Explain: 公告。放置在不同位置时注意调整 #anc, #an li 的高度 + Last Modify: Pony 1203191111 +*/ + #an { margin-bottom: 5px; } + #an dt { display: none; } + #an li { float: right; clear: both; width: 526px; text-align: right; } + #an li span { float: left; width: 450px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + #an li em { float: left; width: 75px; color: {LIGHTTEXT}; } + #anc, #an li { height: 29px; overflow: hidden; } + #anc i { font-style: italic; } + +/* 在线会员列表 */ + .oll li { float: left; overflow: hidden; white-space: nowrap; width: 19.9%; height: 24px; line-height: 24px; } + .oll img { vertical-align: middle; } + +/* 论坛首页热点 by Pony */ + .heat { width: 370px; } + .heatl { padding-left: 15px; margin-left: 384px; border-left: 1px solid #DDD; } + +/* 论坛首页四格 by Alice */ + #category_grid { padding: 0; border-top:1px solid {COMMONBORDER}; } + #category_grid table { width:100%;table-layout: fixed; } + #category_grid td { width: 25%; border-left: 1px solid #CDCDCD; } + #category_grid td:first-child { border-left: 0; } + .category_l1, .category_l2, .category_l3, .category_l4 { line-height: 25px; background: #fff; overflow: hidden; } + .category_l1 { line-height: normal; } + .slidebox_grid { position: relative; margin: 10px auto; border: 1px #ccc solid; } + #category_grid h4 { width:100%; height: 30px; line-height: 30px; text-indent:10px; font-size: 12px; cursor: pointer; {TITLEBGCODE}; position:relative; } + .category_newlist { padding: 10px; } + .category_newlist li { height: 21px; line-height:21px; overflow: hidden; } + .category_newlist li::before { display: inline-block; content: ""; width: 6px; height: 6px; background: #BBB; border-radius: 3px; margin: 0 4px 2px 0; } + #category_grid h4 span { background:transparent; width:1px; height:30px; display:inline-block; position:absolute; left:0; top:0; } + #category_grid .newimgbox:hover h4 span, #category_grid .subjectbox:hover h4 span, #category_grid .replaybox:hover h4 span, #category_grid .hottiebox:hover h4 span, #category_grid .goodtiebox:hover h4 span { width:6px; transition:width 0.2s ease 0s; overflow:hidden; } + #category_grid .newimgbox:hover h4 span.tit_newimg { background: #C6D313; } + #category_grid .subjectbox:hover h4 span.tit_subject { background: #00A4EB; } + #category_grid .replaybox:hover h4 span.tit_replay { background: #5CAE2B; } + #category_grid .hottiebox:hover h4 span.tit_hottie { background: #FF8406; } + #category_grid .goodtiebox:hover h4 span.tit_goodtie { background: #C6D313; } +/** end **/ + +/** misc::faq **/ +/* + Explain: 帮助页面的标题要显示出来 + Last Modify: Pony 1203231449 +*/ + .ct2_a h1.mt { display: block; } +/** end **/ + +/** misc::invite,group,forum::viewthread,portal::view,home::space **/ + /* .usl -> 用于类似圈子中邀请好友中的好友列表 by Pony */ + .usl { overflow: scroll; overflow-x: hidden; padding: 5px; width: 580px; height: 280px; } + .usl2 { width: auto; border: dashed {WRAPBORDERCOLOR}; border-width: 0 1px 1px; } + .usl li { overflow: hidden; float: left; margin: 3px; width: 134px; height: 64px; } + .usl a { display: block; padding: 4px; border: 1px solid {WRAPBG}; } + .usl a:hover { text-decoration: none; border: 1px solid; border-color: #DDD #999 #999 #DDD; background: {COMMONBG}; } + .usl .avt { float: left; margin-right: 5px; width: 52px; height: 52px; border: 1px solid {COMMONBORDER}; background-color: {WRAPBG}; background-position: 2px 2px; background-repeat: no-repeat; background-size: 48px; background-image: url('../avatar/noavatar.svg'); zoom: 1; } + .usl .avt.brs > span { display: block; margin: 2px; width: 48px; height: 48px; background-size: 100%; } + .usl .d { float: left; width: 65px; height: 54px; overflow: hidden; word-wrap: break-word; } + .usl li.a a, .usl li.a a:hover { border-color: #F90; background-color: #FFF1E1; } + .usl li.a .avt { position: relative; } + .usl li.a .avt span { position: absolute; bottom: 2px; left: 2px; width: 14px; height: 14px; line-height: 14px; text-align: center; background: #FFF; } + .usl li.a .avt span:before { content: "\f128"; font-family: dzicon; color: #F60; font-size: 14px; } + .usd { padding: 5px 10px 0; border: solid {WRAPBORDERCOLOR}; border-width: 1px 0; background-color: {COMMONBG}; } + .usd2 { border-width: 1px; border-style: dashed; } + .usd li { float: left; margin-right: 1%; width: 48%; } +/** end **/ + + +/** home::space,home::spacecp,group::group,misc::ranklist,portal::view,forum::viewthread,group::viewthread,home::medal,misc::tag **/ + /* .el -> feed_list 动态列表 by Pony */ + .e { overflow: hidden; } + .e .i, .el .i { padding: 6px 10px; border-bottom: 1px dashed {COMMONBORDER}; background: #F7F7F7; } + .el {} + .et { margin: 20px 0 10px; } + .el li { padding: 10px 20px; min-height: 20px; border-bottom: 1px dashed {COMMONBORDER}; } + .el .t { position: absolute; margin: 1px 0 0 -20px; } + .el .o { overflow: hidden; float: right; margin: 4px -20px -4px 0; width: 16px; height: 16px; font-size: 16px; line-height: 16px; font-family: dzicon; text-align: center; color: #FF9A9A; } + /* 外宽改变时 .ie6 .el .o, .ie6 .xlda .el .o 的 margin 值需要更改 */ + .el .o:before { content: "\f149"; } + .el .o:hover { text-decoration: none; } + .el .del:before { content: "\f116"; } + .el .d { padding-top: 10px; color: {MIDTEXT}; } + .ec .tn { margin: 10px 10px 0 0; cursor: pointer; } + .ec a .tn { float: left; padding: 2px; max-width: 90px; max-height: 90px; border: 1px solid {COMMONBORDER}; } + .el .ec .hot { float: right; margin: 10px 0 0 10px; width: 55px; height: 50px; background: linear-gradient(0deg, #B2C0DC 40%, #D8DEEA 40%) no-repeat; border-radius: 3px; } + .el .ec .hot a { display: block; line-height: 20px; text-align: center; color: #FFF; } + .el .ec .hot a:hover { text-decoration: none; } + .el .ec .hot em { display: block; line-height: 30px; font-size: 16px; color: {HIGHLIGHTLINK}; cursor: pointer; } + .el a { color: {HIGHLIGHTLINK}; } + /* 有头像的动态列表 */ + .xlda .el { overflow: hidden; float: left; margin-top: -4px; width: 100%; } + .xlda .el li { margin-bottom: -4px; padding-top: 14px; } + #share_preview .h { display: none; } +/** end **/ + + +/** forum::viewthread,group::viewthread,home::task,misc::stat,home::space **/ + /* 进度条 */ + .pbg { height: 16px; border: 1px solid #CCC; background: #EEE; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px; overflow: hidden; } + .pbr { height: 16px; width: 470px; background-color: #5AAF4A; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; overflow: hidden; } + .pbg2 { display: block; height: 10px; width: 130px; margin: 0 auto; background: #FFF; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; overflow: hidden; } + .pbr2 { display: block; height: 10px; background: #F155C8; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; overflow: hidden; } + + /* 勋章链接hover时不显示下划线 by Pony 20110519 */ + .md_ctrl a:hover { text-decoration: none; } +/** end **/ + +/** forum::forumdisplay,forum::viewthread,group::viewthread **/ +#vfastpost{background:#E5EDF2;padding:3px;} +.previewvfastpost{margin:0px 10px 3px 10px;} +.fullvfastpost{margin-top:30px;} +#vfastpost th, #vfastpost td{padding: 0px;} +#vfastpost td{height:38px;} + #vfastpost #vf_l{width:0;} + #vfastpost #vf_m{padding-right: 14px;} + #vfastpost #vf_m input{width: 100%; border: 1px solid #C5D5E2; outline: none; font-size: 14px; height: 28px; padding: 4px;} + #vfastpost #vf_r{width:0;} + #vfastpost #vf_b{width:120px;} + #vfastpost #vf_b button{width: 120px; display: block; height: 38px; overflow: hidden; background: #E4ECF1; margin: 0; padding: 0; border-color: #B1C2CF; color: #7576A1 !important; font-size: 14px; text-shadow: 0 1px #FFF;} + #vfastpost #vf_b button:hover { background: #C7D7E2; border-color: #7C93A6; } +/** end **/ + +/** forum::viewthread,group::viewthread **/ +.tig_bottom{color:#B1B1B1;display:block;height:8px;top:56px;margin-left:20px;position:absolute;z-index: 99;} +.tig_bottom1{color:#FEFEE9;display:block;height:8px;top:55px;margin-left:20px;position:absolute;z-index:111;} +.vct{font: 12px/1.5 Tahoma;margin:0;} +.container{border:1px solid #B1B1B1;margin-top:8px;margin-right:80px;background-color:#FEFEE9;border-radius: 3px;padding: 5px;width:120px;position:absolute;top:-80px;right:0;} + /* 点击加载下一页按钮样式 by Alice */ + .pgbtn a { display: block; margin-bottom: 10px; border: 1px solid rgb(194, 213, 227); border-radius: 3px; text-align: center; } + .pgbtn a:hover { background: #fff; text-decoration: none; } + /* 贴子页开启半闭左右列表 by Alice */ + .side_btn { position:relative; display:block; } + .side_btn a { position:absolute; left:-21px; top:-10px; display:block; width:7px; height:38px; overflow:hidden; } + .side_btn a svg { fill: {MENUBGCOLOR}; } + .side_btn a.btn_s_close { left:-27px; top:-11px; } + .side_btn a.btn_s_open { left:-21px; top:-11px; } +#subjecthide { width: 585px; } +/** end **/ + +/** forum::forumdisplay,forum::viewthread,group::viewthread,home::space,home::spacecp,home::invite,portal::view,portal::comment,forum::post,group::post **/ + /* 广场以外的引用、代码样式 by Pony */ + .quote { overflow: hidden; margin: 10px 0; padding-left: 16px; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3e%3cpath fill='%23ddd' d='M4 2l2 1-2 3h2v4H1V6zM11 2l2 1-2 3h2v4h-5V6z'/%3e%3c/svg%3e") no-repeat 0 0; color: {MIDTEXT}; } + .quote blockquote { display: inline; margin: 0; padding-right: 16px; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3e%3cpath fill='%23ddd' d='M1 7l2 1 3-4V0H1v4h2zM8 7l2 1 3-4V0H8v4h2z'/%3e%3c/svg%3e") no-repeat 100% 100%; } + .m_c .quote { width: 585px; } + .blockcode { overflow: hidden; margin: 10px 0; padding: 5px 10px; background: #F7F7F7; color: {MIDTEXT}; } + .blockcode code { font-family: Monaco, Consolas, 'Lucida Console', 'Courier New', serif; font-size: 12px; line-height: 1.8em; } +/** end **/ + +/** forum::modcp,misc::stat **/ + /* 版块管理 */ + .mdcp {} + .stl { float: left; width: 15%; } + .str { float: left; overflow: auto; overflow-y: hidden; width: 84%; } +/** end **/ + +/** misc::tag **/ +/* 标签列表 by Pony */ + .taglist { min-height: 270px; } + .taglist a { margin-right: 20px; line-height: 30px; white-space: nowrap; } +/** end **/ + + + +/* ------------------------------------------------------------------------ 发帖相关样式 */ +/** forum::post,forum::forumdisplay,forum::viewthread,group::post,group::forumdisplay,group::viewthread **/ +.ct2_a .mn { float: left; } +.appl { float: right; margin-top: 8px; border: none; background-color: transparent; } +.upf { width: 500px; } + +.upnf { white-space: normal; } +.upbk { zoom: 1; } + .fldt { margin-bottom: 8px; } + +.p_pop .flb { position: absolute; right: 10px; top: 18px; } + +.fnm { width: 130px !important; } +.fszm { width: 55px !important; line-height: normal; } +.fnm li, .fszm li, .simm li { cursor: pointer; } +.qsv { padding-left: 16px; width: 16px; height: 16px; background: url({IMGDIR}/repquote.gif) no-repeat 50% 50%; cursor: pointer; } + +/* 发帖时选择标签 by Pony */ + .marked:after { font-family: dzicon; content: "\f128"; color: #F60; margin-left: 2px; } + #taglistarea a { white-space: nowrap; zoom: 1; } + #taglistarea .marked { padding-right: 0; font-weight: 700; color: {NOTICETEXT} !important; } + #taglistarea .marked:after { display: none; } +/** end **/ + +/** forum::post,group::post **/ +#post_extra_tb { position: relative; z-index: 2; } + #post_extra_tb label { float: left; margin-right: 3px; height: 21px; border: 1px solid {COMMONBORDER}; line-height: 21px; white-space: nowrap; } + #post_extra_tb label.a { border-bottom-color: {SPECIALBG}; background: {SPECIALBG} none; box-shadow: none; } + #post_extra_tb label span { float: left; padding: 0 8px 0 8px; line-height: 21px; } + #post_extra_tb label span:before { display: inline-block; content: ""; width: 6px; height: 6px; background: #BBB; border-radius: 3px; margin: 0 4px 2px 0; } + #post_extra_tb label.a span:before { background-color: #F60; } + +#post_extra_c { position: relative; z-index: 1; } + #post_extra_c .exfm { margin: -1px 0 0; border: 1px solid {COMMONBORDER}; } + +#extra_additional_c label { float:left; width: 16%; } + +#draftlist { border-style: solid; border-width: 1px 1px 0; border-color: {WRAPBG}; } + #draftlist.a { position: relative; z-index: 302; border-color: {DROPMENUBORDER}; {DROPMENUBGCODE} } + #draftlist_menu { margin-top: -1px; padding: 10px; border: 1px solid {DROPMENUBORDER}; {DROPMENUBGCODE}; } +/** end **/ + + +/** forum::post,forum::forumdisplay,forum::viewthread,group::post,group::forumdisplay,group::viewthread,portal::portalcp,home::spacecp **/ +.p_tbl { height: auto; line-height: 160%; border-bottom: none; } + .p_tbl table td { height: 28px; line-height: 28px; border-bottom: 1px solid {COMMONBG}; } + .atnu { width: 16px; } + /*.attachctrl { width: 40px; }*/ + .atna {} + .atna p img, .attswf p img { vertical-align: middle; height: 16px; } + .atna .lighttxt, .attswf .lighttxt { color: {MIDTEXT} !important; } + .attpr { width: 40px; text-align: center; } + .attv .px, .attp .px { width: 25px; } + .attv { width: 100px; } + .atturl img { height: 20px !important; } + .attc { width: 20px } + .atds { width: 80px; text-align: center; } + .atds .px { width: 60px; } + .attp { text-align: center; width: 40px; } + .attach_preview { border: 1px solid {COMMONBORDER}; box-shadow: 0 0 5px rgba(96, 96, 96, 0.3); } +/** end **/ + + +/** forum::post,group::post,portal::portalcp,home::spacecp **/ +/* 发帖、日志、文章时上传的图片列表样式 by Pony 11090615 */ +.upfl { margin-top: -1px; height: auto !important; height: 165px; max-height: 300px; overflow: auto; overflow-x: hidden; } + .upfl a, #imgattachlist a { color: {HIGHLIGHTLINK}; } + .upfl table td { border-bottom: 1px solid {COMMONBORDER}; height: 30px; line-height: 24px; } +.imgl { margin-bottom: 5px; width: 100%; } + .imgl td { padding: 8px 0; text-align: center; vertical-align: bottom; } + .imgl tr:last-child td { border-bottom: none; } + .imgl img { border: 1px solid {LIGHTTEXT}; max-width: 110px; } + + .imgf .px { width: 106px; padding: 2px; height: 14px; line-height: 14px; } + .imgdeleted { opacity: 0.3; } + +/* + Name: mod_opattach + Level: Function + Explain: 发文章时上传的图片上的操作区域的样式 + Last Modify: Pony 11082416 +*/ + .opattach { display: block; position: relative; margin: 0 auto; width: 110px; border: 1px solid #CDCDCD; } + .opattach:hover { text-decoration: none; } + .opattach_ctrl { display: none; position: absolute; bottom: 0; left: 0; width: 100%; color: #FFF; background: transparent; background: rgba(0, 0, 0, 0.3); } + .opattach:hover .opattach_ctrl { display: block; } + .opattach img { border: none; } + +/* 重定义日志和文章的编辑器弹窗 by Pony 11082217 */ +.tfm .fwin .t_l, .tfm .fwin .t_c, .tfm .fwin .t_r, .tfm .fwin .m_c, .tfm .fwin .b_l, .tfm .fwin .b_c, .tfm .fwin .b_r { padding: 0; } +.tfm .fwin th { padding: 0; width: auto; } +.tfm .fwin .px { width: auto; } +.tfm .fwin .upfl table td { border-bottom: none; } +/** end **/ + + +/** forum::viewthread,forum::forumdisplay,forum::post,group **/ +/* 主题图标 by michael */ +#newspecial_menu { width: 90px; } + #newspecial_menu li, #sti .wx { display: block; zoom: 1; } + #newspecial_menu li:before, #sti .wx:before { content: "\f134"; font-family: dzicon; display: inline-block; height: 24px; width: 30px; line-height: 24px; text-align: center; font-size: 20px; color: #FF9C00; vertical-align: middle; } + #newspecial_menu .poll:before, #sti .poll:before { content: "\f13b"; } + #newspecial_menu .trade:before, #sti .trade:before { content: "\f13f"; } + #newspecial_menu .reward:before, #sti .reward:before { content: "\f13c"; } + #newspecial_menu .activity:before, #sti .activity:before { content: "\f13e"; } + #newspecial_menu .debate:before, #sti .debate:before { content: "\f13d"; } + #newspecial_menu a { display: inline-block; padding: 0; height: 24px; line-height: 24px; white-space: normal; vertical-align: middle; } + #newspecial_menu a:hover { background: none; color: {HIGHLIGHTLINK}; text-shadow: none; text-decoration: underline; } +#sti {} + #sti .wx { padding-left: 25px; background-position: 0 50%; } + #sti .tb { margin-top: 0; } +/** end **/ + + +/** forum::modcp,forum::post,group::post,home::spacecp,portal::portalcp **/ +/* 提交表单 */ + .exfm { margin: 10px 0; padding: 10px 14px; border: 1px dashed {SPECIALBORDER}; background: {SPECIALBG}; } + .exfm .pn { height: 22px; font-size: 12px; } + .exfm .rq { float: right; padding-right: 2px; } + .exfm table { width: 100%; } + .exfm table th, .exfm table td { padding: 4px 2px; } + .mdcp .um { margin-bottom: 0; padding: 10px 5px; } + +/* 发特殊主题帖 by dfox */ + .sinf p, .sadd p { padding: 2px 0; height: 30px; line-height: 30px; } + .sinf .px, .sadd .px { width: 120px; } + .sinf { float: left; padding-right: 14px; width: 380px; border-right: 1px dashed {WRAPBORDERCOLOR}; } + .sinf h4 { padding: 6px 0; } + .sinf textarea { width: 368px; height: 80px; } + .sinf a.d { margin-top: 8px; } + .sinf object { vertical-align: middle; } + .onum { float: left; margin-right: 6px; width: 16px; } + .oinf { width: 270px !important; } + .sinf dl, .sadd dl { overflow: hidden; } + .sinf dl dt, .sadd dl dt { float: left; width: 75px; clear: left; } + .sinf dl dd, .sadd dl dd { margin-bottom: 10px; overflow: hidden; } + .sinf dl dd { width: 300px; } + .sinf span.fb, .sadd span.fb { display: block; float: left; margin-right: 6px; height: 26px; line-height: 26px; white-space: nowrap; } + .sinf dl dd strong { padding: 0 8px; } + .sadd { float: left; margin-left: 10px; width: 520px; overflow: hidden; } + .sadd dl dd { width: 420px; } + .ct2_a .sadd { width: 360px; } + .ct2_a .sadd dl dd { width: 260px; } + .spl em { float: left; margin-right: 9px; height: 20px; line-height: 20px; } + .spl input[type=radio] { margin: 0 3px 0 0; } + .spimg { margin: 0 10px 0 0; width: 200px; border: 1px solid #AAA; } + .spmp { width: 30px; } + .spmf { width: 300px; } + .spmf, .spmf3 { overflow: hidden; } + .spmf label, .spmf3 label{ display: block; padding-top: 5px; } + .spmf em{ float: left; width: 150px; } + .spmf3 em{ float: left; margin-right: 12px; } + .spmf3 .px { margin: 0 !important; width: 72px; } +/** end **/ + + +/** forum::forumdisplay,forum::viewthread,group::forumdisplay,group::viewthread **/ + /* 开启快速发帖和推荐表情时的样式 by Pony */ + #f_pst .bm_c { padding: 20px; } + #f_pst .tedt { width: auto; } + .hasfsl { margin-right: 170px; zoom: 1; } + + #f_pst .upfl { height: auto; max-height: 100%; } + #f_pst .upfl td { padding: 4px 0; } + #f_pst .atds { width: 100px; } + #f_pst .px { padding: 2px; } + /* + Name: mod_mobile-type + Level: Function + Explain: 手机发帖的相关样式 + Author: Lushnis + Last Modify: Pony 1204111343 + */ + .mobile-type { position: absolute; margin: -5px 0 -85px 103px; width: 58px; height: 80px; background: url({IMGDIR}/mobile-type.png) no-repeat 100% 100%; } + .mobile-type a { display: block; width: 46px; height: 80px; background: url({IMGDIR}/mobile-type.png) no-repeat 0 0; } + .mobile-type-2 a { background-position: 0 -80px; } + .mobile-type-3 a { background-position: 0 -160px; } + .mobile-type-4 a { background-position: 0 -240px; } + .mobile-location { padding-left: 20px; background: url({IMGDIR}/mobile-attach-2.png) no-repeat 0 0; } + /* + Name: threadbeginid + Level: Function + Explain: 起始动画或图片的位置样式 + Author: Jane + Last Modify: Jane 1210251731 + */ + #threadbeginid { position: fixed; top: 0px; left: 0px; z-index: 999; } + #threadbeginid .beginidin { position: absolute; top: 0; right: 0px; z-index: 999; } + #threadbeginid .beginidimg { background: white; opacity: 0; } +/** end **/ + + + +/* ------------------------------------------------------------------------ 广场版块、圈子分类等列表样式 */ +/** forum::index,forum::forumdisplay,group::index,group::group,search::group **/ +/* 版块列表 */ +.fl {} + .fl_tb { width: 100%; } + .fl_tb td { padding: 10px 0; } + .fl_icn { padding-right: 10px !important; width: 31px; } + .fl_by { width: 220px; } + .fl_by div { margin-left: 10px; width: 210px; padding-left: 8px; word-break: keep-all; word-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .fl_by div .xi2 { zoom: 1; } + .fl_by cite { display: block; } + .fl_i { width: 150px; text-align: right; } + .fl_i em { display: block; width: 5em; } + .fl .i_z { margin-right: 8px; padding-right: 8px; border-right: 1px solid {CONTENTSEPARATE}; } + .fl_icn_g { float: left; width: 31px; } + .fl_g { vertical-align: top; } + .fl_g dl { margin-left: 31px; padding-left: 10px; } + .fl_g dt { font-weight: 700; } + .fl_row td { border-top: 1px dashed {COMMONBORDER}; } + .fl_icn img, .fl_icn svg , .fl_icn_g img, .fl_icn_g svg { vertical-align: middle; } + +/* 圈子分类列表 */ + .flt {} + .flt .flc { width: 294px; } + .gcop { margin-right: 15px; clear: left; } + .ghfl dt, .flt dt { font-size: 14px; font-weight: 700; } + .ghfl dt span, .flt dt span, .flt dd span { font-size: 12px; font-weight: 200; color: {LIGHTTEXT}; } + .ghfl dd, .flt dd { line-height: 1.8em; } +/** end **/ + + +/** forum::forumdisplay **/ +/* + Name: mod_board_navigation + Level: Function + Explain: 看贴页左侧的版块导航。宽度在CSS里没有默认值,宽度在后台设置 + Last Modify: Jane +*/ +.bdl { float: left; overflow: hidden; border: 1px solid #BDD7E3; background-color: #F5F9FB; } + .bdl_h { height: 32px; line-height: 22px; } +.bdl .tbn { margin: 10px; } + /* 分区 */ + .bdl dl { margin: -1px -10px 0; } + .bdl dt { overflow: hidden; height: 27px; line-height: 27px; border: solid #CCE0EB; border-width: 1px 0; background: #F5F9FB; } + .bdl dt a { display: block; padding: 0 15px 0 10px; } + .bdl dt a:hover, .bdl_a a:hover { text-decoration: none; } + /* 版块,默认收起 */ + .bdl dd { display: none; } + .bdl dd a { display: block; margin: 0 3px; padding: 0 7px; height: 26px; line-height: 26px; overflow: hidden; } + /* 展开的分区 */ + .bdl dl.a { padding-bottom: 4px; background-color: #FFF; } + .bdl dl.a dt { margin-bottom: 3px; } + .bdl dl.a dd, .bdl_fav dd { display: block; overflow: hidden; zoom: 1; } + /* 当前版块 */ + .bdl dd.bdl_a a { background-color: #F5F9FB; font-weight: 700; color: {HIGHLIGHTLINK}; } + + .previewPost { width: 100%; font-size: 14px; } + /* 点击加载下一页按钮样式 */ + #autopbn { display: block; margin-bottom: 10px; border: 1px solid rgb(194, 213, 227); border-radius: 3px; text-align: center; } + #autopbn:hover { background: #fff; text-decoration: none; } + /* 上涨和下降图标样式 */ + .ico_increase, .ico_fall { font-family: dzicon; display: inline-block; width: 12px; height: 16px; line-height: 16px; transform: scale(1.5); color: #F6271E; margin: 0 8px; text-align: center; } + .ico_increase:before { content: "\f124"; } + .ico_fall:before { content: "\f125"; } + /* 版块热帖日历样式 */ + #ReTie_review h6 { padding: 0 10px; line-height: 27px; } + .review_this { padding: 5px 0 10px; } + .review_this li { float: left; width: 7.5%; text-align: center; } +/* + Level: Channel + Explain: 板块新帖提醒 + Last Modify: Max.Cong +*/ + #forumnew{ position: absolute; right: 0; top: 0; z-index: -1; } + .tl #forumnewshow { background: #FFFAF3; font-size: 12px; text-align: center; } + .tl #forumnewshow th, .tl #forumnewshow td { padding: 0; border: 0; } + .tl #forumnewshow th:hover, .tl #forumnewshow td:hover{ background: #FFFFE9; } + .tl #forumnewshow a { display: block; border-top: 1px solid #F4E4B4; border-bottom: 1px solid #F4E4B4; text-indent: 25px; height: 29px; line-height: 29px; color: #EFAA00; } + .tl #forumnewshow a:hover { text-decoration: none; } + #checknewline tr td, #checknewline tr th { background: #FFFFEB; text-align: center; color: #666; } + + .newthread tr th, .newthread tr td { background: #FFFAF3; } + .newthread .new em { margin-right: 4px; } + .newthread .new em, .newthread .new em a { color: #007CD5; font: {FONTSIZE} {FONT}; } + /* + .tl .newthread tr:hover th, .tl .newthread tr:hover td{ background-color: transparent; } + */ + +.forumrefresh:hover { text-decoration: none; } +.forumrefresh:after { content: "\f10b"; font-family: dzicon; color: #369; line-height: 14px; font-size: 14px; margin-left: 2px; } +/** end **/ + + +/** forum **/ +/* + Name: mod_forum_jump + Level: Function + Explain: 快速跳转菜单 + Last Modify: Pony 11080915 +*/ +#fjump_menu { overflow-x: hidden; max-height: 600px; } + #fjump_menu dl { width: 200px; } + #fjump_menu dt { font-weight: 700; } + #fjump_menu dd { text-indent: 1em; } + #fjump_menu li.a a { background-color: {SPECIALBG}; } +/** end **/ + + + +/* ------------------------------------------------------------------------ 主题列表样式 */ +/** forum::forumdisplay,forum::viewthread,forum::modcp,forum::collection,group,home::space,home::task,home::follow,search::forum,search::group,member::groupexpiry,misc::ranklist,misc::stat,misc::tag,forum::guide,portal::block **/ +/* fct --> froumatction 板块功能按钮 */ + .fct a { float: left; margin-left: 8px; } + .fa_fav_0:before, .fa_fav:before, .fa_rss:before, .fa_achv:before, .fa_bin:before, .fa_ivt:before { font-family: dzicon; display: inline-block; line-height: 14px; width: 16px; margin-left: 4px; transform: scale(1.5); } + .fa_fav_0:hover, .fa_fav:hover, .fa_rss:hover, .fa_achv:hover, .fa_bin:hover, .fa_ivt:hover { text-decoration: none; } + .fa_fav_0:before { content: "\f12d"; color: #BBB; } + .fa_fav:before { content: "\f12d"; color: #FF9C00; } + .fa_rss:before { content: "\f10a"; color: #FF9C00; } + .fa_achv:before { content: "\f135"; } + .fa_bin:before { content: "\f10c"; color: #AAA; } + .fa_ivt:before { content: "\f11f"; color: #2B7ACD; } + +/* 主题列表相关 */ + /*.tl .th th a { float: left; margin-right: 10px; padding-right: 17px; background: url({IMGDIR}/arw_d2.gif) no-repeat 100% 50%; }*/ + #fh { width: 644px; } + .mw #fh { width: 100%; } + #fh .bm { padding-top: 5px; padding-bottom: 0; } + #nv_group #fh { margin-bottom: 1em; } + #fh #gh { padding-top: 10px; } + #fh .h { margin-top: 10px; } + #fh .h * { float: left; } + #fh h1 { margin-right: 10px; font-size: 16px; } + #fh .h .y { float: right; } + #fh .o a { float: left; margin-right: 10px; } + #fh.m { padding-top: 0; background-color: {COMMONBG}; } + .xst { font-family: {THREADTITLEFONT}; font-size: {THREADTITLEFONTSIZE}; } + .xst i { font-style: italic; } + + /* threadtype 文章类型 */ + .ttp { margin-bottom: 5px; padding-top: 10px; border-width: 2px 0 0; background: transparent; } + .ttp li { float: left; padding-bottom: 5px; } + .ttp a, .ttp strong { float: left; margin-right: 5px; padding: 4px 8px 3px; height: 18px; border: 1px solid {COMMONBORDER}; background: {WRAPBG}; white-space: nowrap; } + .ttp a:hover { border-color: {HIGHLIGHTLINK}; color: {HIGHLIGHTLINK}; text-decoration: none; } + .ttp .a a { padding-right: 12px; padding-left: 12px; border-color: {HIGHLIGHTLINK}; background: {SPECIALBG}; color: {HIGHLIGHTLINK}; } + .ttp .pipe { float: left; margin-right: 10px; padding: 0; width: 2px; height: 27px; background: {SPECIALBORDER}; text-indent: -9999px; } + /* 版块有大量主题分类时的展开收起样式 by Pony */ + .cttp { overflow: hidden; padding-right: 35px; height: 32px; } + .cttp .unfold, .cttp .fold { float: right; display: inline; margin: 5px -35px 9px 0; padding: 0 0 0 10px; width: 25px; height: 18px; background-color: transparent; color: {HIGHLIGHTLINK}; font-weight: 400; } + + /* tl --> Thread list modify by lushnis */ + .tl .bm_c { padding-top: 0; } + .tl table { width: 100%; table-layout: fixed; border-collapse: separate; } + .tl th, .tl td { padding: 5px 0; border-bottom: 1px solid {CONTENTSEPARATE}; } + .emptb th, .emptb td { padding: 0; border-bottom: none; } + .tl tr:hover th, .tl tr:hover td { background-color: {COMMONBG}; } + .tl .threadpre td, .tl .threadpre:hover td { background-color: #FCFCFC; } + .tl .threadpre .threadpretd { border-left: 1px solid {CONTENTSEPARATE}; border-right: 1px solid {CONTENTSEPARATE}; } + .tl th .tdpre, .tl td.fn .tdpre { visibility: hidden; display: inline; padding: 0 3px; height: 17px; line-height: 17px; margin-top: 3px; background: #548BF6; color: #FFF; text-align: center; text-decoration: none; border-radius: 2px; } + .tl th:hover .tdpre, .tl td.fn:hover .tdpre { visibility: visible; } + .tl th .tdpre:visited, .tl td.fn .tdpre:visited { color: #FFF; } + .tbox { display: inline-block; color: #FFF; height: 17px; line-height: 17px; padding: 0 2px; border-radius: 2px; } + .tl .tbox { vertical-align: middle; } + .rushrep { background: #904B21; } + .tl .tdigest { background: #01B0C8; } + .theatlevel { background-color: #FA5600; background: linear-gradient(90deg,#FA5600,#FC0); font-weight: 700; border-radius: 4px 0 0 4px; text-shadow: 1px 1px 1px #E40; position: relative; margin-right: 5px; } + .theatlevel:after { display: block; content: ""; width: 5px; height: 17px; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='5' height='17'%3e%3cpath fill='%23fc0' d='M0 0h4L0 5h5c0 4-3 8-5 8l5 2-4 2H0'/%3e%3c/svg%3e"); position: absolute; top: 0; right: -5px; } + .trecic { background: #FF9C00; } + .tprizes { background: #BCB728; text-indent: 0; } + .fastpreview { position: relative; } + .icon_preview { position: absolute; display: block; left: 80px; top: -13px; width: 11px; height: 8px; background: url({IMGDIR}/icon_preview.png); overflow: hidden; } + a.icon_up { display: block; margin:0 10px; height: 25px; background: #F2F2F2 url({IMGDIR}/arrow_up.png) no-repeat 50% 50%; overflow: hidden; border:1px dashed rgb(194, 213, 227); border-radius: 3px; } + a.icon_up:hover { background:#FFF url({IMGDIR}/arrow_up_hover.png) no-repeat 50% 50%; } + .fastpreview td { border-bottom: none!important; } + .tl th, .tl td.fn { padding-right: 1.5em; zoom: 1; } + .tl th a:visited, .tl td.fn a:visited { color: {MIDTEXT}; } + .fromg { visibility: hidden; } + tr:hover .fromg {visibility: visible;} + .tl .icn { padding-left: 5px; width: 25px; text-align: left; } + .tl .icn a:hover { text-decoration: none; } + .tl .tpin { position: relative; } + .tl .tpin::before { display: block; position: absolute; width: 18px; text-align: center; color: #FFF; z-index: 10; } + .tl .tpin1::before { content: "1"; } + .tl .tpin2::before { content: "2"; } + .tl .tpin3::before { content: "3"; } + .tl .tpin4::before { content: "!"; } + .tl .tpin1 svg { fill: #72B933; } + .tl .tpin2 svg { fill: #00ABDE; } + .tl .tpin3 svg { fill: #F90; } + .tl .tpin4 svg { fill: #F26C4F; } + .tl .new {} + .tl .comm {} + .tl .frm { width: 150px; } + .tl .o { width: 20px; } + .tl .num { width: 60px; line-height: 14px; } + .tl .by { width: 105px; line-height: 14px; } + .tl cite, .tl .num em { display: block; } + .tl th em { margin-right: 4px; zoom: 1; } + .tl th em, .tl th em a { color: #007CD5; } + .tl td em { font-size: 11px; font-family: Arial, Psimsun, sans-serif; -webkit-text-size-adjust: none; } + .tl td em, .tl td em a { color: {LIGHTTEXT}; } + /*.tl .th th, .tl .th td { padding: 8px 0; background: {SPECIALBG}; border-top: 1px solid {SPECIALBORDER}; }*/ + .tl .ts th, .tl .ts td { padding: 3px 0; border-bottom-color: {COMMONBORDER}; background: {COMMONBG}; } + .tl .th { margin-top: 1px; padding: 0 10px; border-bottom: 1px solid {COMMONBORDER}; background: {COMMONBG}; } + .tl .th table { border: none; } + .tl .th td, .tl .th th { height: 20px; border: none; vertical-align: baseline; } + .tl .tf { padding: 3px 0; } + .tf .showmenu:hover { border-color: {SPECIALBORDER}; } + + + + .tl_reply:before { display: inline-block; content: ""; width: 6px; height: 6px; background: #BBB; border-radius: 3px; margin: 0 4px 2px 0; } + + /* recy --> recyclebin 主题列表的回收站主题样式 by shuaishuai*/ + .recy { text-decoration: line-through; } + + /* 主题分页 */ + .tps { white-space: nowrap; } + .tps a { padding: 2px 4px; color: {TABLETEXT}; } + .tps a:hover { background-color: {COMMONBG}; color: #007CD5; } + +/* + Name: mod_thread_type_index + Level: Function + Explain: 分类信息检索 + Last Modify: Pony 12020309 +*/ +.tsm { overflow: hidden; margin-bottom: -10px; width: 100%; border-collapse: collapse !important; } + .tsm th { padding: 5px 0 5px 10px; border: none; vertical-align: top; } + .tsm td { padding: 5px 10px 5px 0; border: none; vertical-align: top; } + .tsm tr:hover th, .tsm tr:hover td { background: none !important; } + .tsm li { float: left; margin-right: 4px; padding: 0 4px; white-space: nowrap; } + .tsm .a a { color: {TABLETEXT}; font-weight: 700; } + .tsm .a a:hover { text-decoration: none; } + .subtsm { margin-top: 5px; padding: 5px; border: 1px dotted {SPECIALBORDER}; } + +/* + Name: mod_thread_type_search + Level: Function + Explain: 分类信息搜索 + Last Modify: Pony 11050314 +*/ + .mfm .mtm { margin-right: 10px; } + .mfm span { height: 26px; } +/** end **/ + + +/** forum::forumdisplay,group::forumdisplay,group::my **/ +/* + Name: mod_thread_type + Level: Function + Explain: 论坛圈子的文章主题分类分类信息等的筛选样式 + Author: lushnis + Last Modify: Pony +*/ + .ttp .a a:hover { background: {SPECIALBG} url({IMGDIR}/close-s.png) no-repeat 100% 11px; } + #ttp_all a:hover { background-image: none !important; } +/** end **/ + + + +/* ----------------------------------------------------------------------- 文章内容区域样式 */ +/** forum::viewthread,group::viewthread **/ +.plh { line-height: 46px; } + .plh .plc { padding-bottom: 0; } + +/* + Name: mod_viewthread_header + Level: Function + Explain: 看帖页标题区域 + Last Modify: Pony 201201181105 +*/ + .vwthd { padding-right: 80px !important; } + .vwthd div.y { display: inline; margin-right: -60px; } + .ts { display: inline; font: 700 16px 'Microsoft Yahei', 'Hei', Tahoma, 'SimHei', sans-serif; } + +#nv_forum #ct { border-color: {SPECIALBORDER}; } + +.pattl_c .tip { margin-top: 30px; padding: 5px; width: 88px; } +.pattimg { float: left; margin: 0 10px 10px 0; width: 100px; height: 100px; overflow: hidden; } +.pattimg_zoom { position: absolute; display: block; width: 100px; height: 100px; line-height: 300px; overflow: hidden; } +.attl_g, .attl_m { margin-left: 10px; padding-left: 16px; background: url({IMGDIR}/attl_icon.png) no-repeat 0 3px; } + .attl_m { background-position: -100px 3px; } + +/* 默认分类信息 by michael */ + .cgtl { overflow: hidden; } + .cgtl td, .cgtl th, .cgtl caption { padding: 5px; border-bottom: 1px solid {SPECIALBORDER}; } + .cgtl caption { background: {SPECIALBG}; border-top: 1px solid {SPECIALBORDER}; font-size: 14px; font-weight: 700; } + .cgtl th { width: 16%; } + +/* + Name: mod_cp_pls + Level: Function + Explain: 文章页每个楼层用户信息下方的管理链接 + Author: Pony 12010414 +*/ +.cp_pls a { float: left; margin-right: 4px; line-height: 1.231; } +#scrollleftinfo { position: fixed; left: auto; top: auto; width: 5px; height: 200px; border-radius: 0 5px 5px 0; background: url({IMGDIR}/sidecontrol.png) no-repeat -9px 0; cursor: pointer; } +#scrollleftinfo.open { width: 9px; background-position: 0 0; } + +.img_tit_t .xi1 { color:#444; } +.img_tit_t .ph { font-weight:700; font-size:16px; } +.ph_r_con { padding: 20px 0 0; } +a.thread_mod { height: 19px; line-height: 19px; display: inline-block; color: #444; } + a.thread_mod:hover { color:#369 !important; text-decoration:none; } + a.thread_mod span { color:#444; font-weight:700; vertical-align: middle; } + a.thread_mod:hover span { color:#539BCB !important; } + a.thread_mod:before { content: "\f11d"; font-family: dzicon; font-size: 24px; vertical-align: middle; margin-right: 4px; } + +/* + Name: mod_cp_pls + Level: Function + Explain: 贴子大图样式 + Author: Alice 201303281607 +*/ +#imagelist_nav { background: none repeat scroll 0 0 #DDD; margin-top: 20px; height: 150px; width: 780px; } + #imagelist_nav .imagelist_album { color: #FFFFFF; font-size: 12px; overflow: hidden; width: 780px; } + #imagelist_nav .imagelist_album div.left { height: 110px; margin-top: 18px; overflow: hidden; position: relative; width: 730px; float: left; } + #imagelist_nav .imagelist_album div.left ul { left: 0; position: absolute; z-index: 2; margin: 0 0; } + #imagelist_nav .imagelist_album div.left li { float: left; height: 110px; text-align: center; margin-top: 5px; list-style: none outside none; } + #imagelist_nav .imagelist_album a.left, #imagelist_nav .imagelist_album a.right { background: #2F2F2F; color: #DCDCDC; border-radius: 3px; height: 63px; line-height: 63px; text-align: center; width: 20px; } + #imagelist_nav .imagelist_album a.left { margin: 42px 2px 0 3px; float: left; } + #imagelist_nav .imagelist_album a.right { margin: 42px 3px 0 2px; float: right; } + #imagelist_nav .imagelist_album a.left:hover, #imagelist_nav .imagelist_album a.right:hover { background: #474747; } + #imagelist_nav .imagelist_album a.left::before, #imagelist_nav .imagelist_album a.right::before { display: inline-block; content: ""; border-left: 0; border-top: 6px solid transparent; border-right: 6px solid; border-bottom: 6px solid transparent; } + #imagelist_nav .imagelist_album a.left::before { border-left: 0; border-right: 6px solid; } + #imagelist_nav .imagelist_album a.right::before { border-left: 6px solid; border-right: 0; } + #imagelist_nav .imagelist_album div.left a.mask { background-color:#333; display: block; height: 110px; overflow: hidden; position: absolute; width: 110px; z-index: 1; } + #imagelist_nav .imagelist_album div.left li div { height: 110px; position: relative; overflow: hidden; cursor: pointer; width: 110px; } + #imagelist_nav .imagelist_album div.left li div span { background-color: #000000; bottom: 2px; color: #FFFFFF; display: block; font-size: 12px; height: 14px; line-height: 14px; position: absolute; right: 5px; text-align: center; top:86px; padding: 0 6px; } + .photo_pic { width:780px; } + .album_side_r { border-left:1px dashed #CDCDCD; } + .album_side { padding:20px 10px; font-size:12px; } + .album_side .hm { padding:0 0 10px; } + .album_info h3 { color:#999; margin:10px 0; } + .album_side .date { color:#999; } + .album_info p { text-indent:2em; } + .tit_author { display:block; } + .tit_author a { color: #369; font-size:14px; font-weight:700; } + +/* 作者指向时全部展开 by Alice */ + .authi .none { display:inline-block; } + .authi .none::before { display: inline-block; margin: 0 5px; content: ""; border-left: 0.4em solid; border-top: 0.4em solid transparent; border-right: 0; border-bottom: 0.4em solid transparent; } + .authi .show { display:none; } + .authi:hover .none { display:none; } + .authi:hover .show { display:inline-block; } + +/** end **/ + +/** forum::forumdisplay,group::forumdisplay **/ +/* 文章列表“新窗”、“图片模式”等按钮样式 modified by Pony */ + #atarget, .unchk, .chked { line-height: 16px; color: {HIGHLIGHTLINK}; cursor: pointer; } + #atarget:before, .unchk:before, .chked:before { font-family: dzicon; display: inline-block; width: 14px; height: 14px; line-height: 14px; font-size: 14px; margin-right: 2px; color: {LIGHTTEXT}; } + #atarget:before, .unchk:before { content: "\f12e"; } + #atarget.atarget_1:before, .chked:before { content: "\f12f";} + .unchk:hover, .chked:hover { text-decoration: none; } + +#a_magic_doodle { padding-left: 20px; background: url({STATICURL}image/magic/doodle.small.gif) 0 50% no-repeat; } + /* 重定义 tab 标签样式分类数字 by alice 13032514 */ + .ttp .num { background:#999; padding:0 5px; margin-left:5px; border-radius:3px; color:#FFF !important; } + .ttp .a .num { background:#91BDD3; } + /* 重定义 贴子更多分类标签 by alice 13032614 */ + .pop_moremenu li { display:block; border-bottom:1px solid #E5EDF2; line-height:24px; } + .pop_moremenu a { display:inline; text-decoration:none; border-bottom:0; } + .pop_moremenu li:last-child { border-bottom:none; } + .pop_moremenu .pipe { margin:0; } + .pop_moremenu a.xw1 { background-color: {SPECIALBG}; color: {HIGHLIGHTLINK}; text-decoration: none; font-weight:normal; } +/* + Name: mod_media_list_thread + Level: Global + depentend: .ml + Explain: 图片模式的文章列表 + Author: lushnis + Last Modify: Pony 11121511 +*/ + .mlt {} + .mlt li { display: inline; margin: 0 4px 10px; padding-top: 5px; border: 1px solid {SPECIALBG}; border-bottom-color: {SPECIALBORDER}; background: #FFF; text-align: left; } + .mlt .sum { display: inline-block; padding: 0 5px; height: 16px; line-height: 16px; border-radius: 5px; background: {SPECIALBG}; } + .mlt .pin { background: #7B3; color: #FFF; } + .mlt .digest { background: #0BC; color: #FFF; } + .mlt .c .nopic { display: block; background:{WRAPBG}; cursor: pointer; } + .mlt img.vm { display: inline; } + + .mlt h3 { height: 30px; line-height: 30px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .mlt li .cl { height: 18px; overflow: hidden; } + .mlt li .c { height: auto !important; } + .mlt li span { display: inline; color: {TABLETEXT}; } + +/* + Name: mod_threadlist_last-child + Level: Function + Explain: 文章列表页支持 last-child 的浏览器不显示最后一条线 + Last Modify: Pony +*/ +.tl tbody:last-child th, .tl tbody:last-child td { border-bottom: none; } +.tl tbody:last-child .threadpre .threadpretd { border: 1px solid {CONTENTSEPARATE};} +/* + Name: closeprev + Level: Function + Explain: 文章列表页隐藏置顶帖的按钮样式 + Last Modify: Jane +*/ +.closeprev { width: 12px; height: 12px; background: transparent; line-height: 12px; text-align: center; cursor: pointer; overflow: hidden; margin: 5px 5px 0px 5px; } +.closeprev:hover { background: #09C; } +.closeprev:before { content: "\d7"; font-weight: 700; color: #CCC; } +.closeprev:hover:before { color: #FFF;} +.pcb .jammer { font-size: 10px; color: {WRAPBG}; } +/* 屏蔽提示 */ +#hiddenthread { border-top: 1px solid #C2D5E3; border-bottom: 1px solid #C2D5E3; line-height:40px;padding-left:20px;background: #FFFAF3; font-size: 12px; text-align: center; } +#hiddenthread.last { border-top: none; } +#hiddenthread a { display: block; text-indent: 25px; height: 29px; line-height: 29px; color: #EFAA00; } +#hiddenthread a:hover { text-decoration: none; } +/** end **/ + + +/** forum::viewthread,group::viewthread,forum::trade,forum::misc **/ +#a_magic_doodle { padding-left: 20px; background: url({STATICURL}image/magic/doodle.small.gif) 0 50% no-repeat; } + +.pl {} + .pl table { table-layout: fixed; width: 100%; } + .pl .dt { width: 100%; } + .plm { vertical-align: bottom !important; } + .plc, .pls { vertical-align: top; } + .plc { padding: 0 20px; } + .pls { width: 160px; background: {SPECIALBG}; overflow: hidden; border-right: 1px solid {CONTENTSEPARATE}; } + .pls .avatar { margin: 10px 15px; } + .pls .avatar img { padding: 5px; background: #FFF; width: 120px; box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2); } + + .pls .favatar { background: transparent; height: auto; border-width: 0px; overflow: visible; } + + .pls p, .pls .pil, .pls .o { margin: 5px 10px 5px 20px; } + .pls p em, .pls dt em { color: {NOTICETEXT}; } + .pls dd, .pls dt { float: left; overflow: hidden; height: 1.6em; line-height: 1.6em; } + .pls dt { margin-right: 3px; width: 55px; } + .pls dd { width: 70px; } + .pls dd img { margin-top: -2px; max-width: 65px; } + .ad .pls { background: {CONTENTSEPARATE}; padding: 0; height: 4px; } + .ad .plc { background: {SPECIALBG}; padding: 0; overflow: hidden; } + .pl .pnv .pls { background: {SPECIALBG}; border: solid {SPECIALBORDER}; border-width: 0 1px 1px 0; line-height: 16px; } + .pl .pnv .tns p { font-size: 12px; } + .pl .pnv .plc { border-bottom: 1px solid {SPECIALBORDER}; } + + .pnh { padding: 11px 20px; } + .tnv { text-align: center; vertical-align: middle; } /* Threads navigation by lushnis */ + + #threadstamp { position: relative; width: 100%; height: 0; overflow: visible; } + #threadstamp img { position: absolute; top: -20px; right: 170px; } + + #pl_top .ad .pls, #pl_top .ad .plc { height: 1px;overflow: hidden; } + #pl_top .pls { text-indent: 15px; } + +/* 文章作者、时间、楼层等一些属性所在区块 */ + .pi { overflow: hidden; margin-bottom: 10px; padding: 10px 0; height: 16px; border-bottom: 1px dashed {COMMONBORDER}; } + .pi strong a { float: right; margin-top: -6px; padding: 4px 6px; border: 1px solid {WRAPBG}; font-weight: 400; } + .pi strong a:hover { border-color: {COMMONBORDER}; } + .pls .pi { padding-left: 15px; } + .pi em {} + .pi .replystick { display: inline-block; background: #F05537; color: #FFF; padding: 0 3px; } + .warnicon { width: 21px; height: 18px; position: relative; } + .warnicon:before,.warnicon:after { content: ""; display: block; position: absolute; border: 1px solid #111; border-radius: 3px; width: 10px; height: 14px; } + .warnicon:before { background: #FAF004; transform: rotate(-30deg); bottom: 1px; left: 3px; } + .warnicon:after { background: #F72100; right: 0; bottom: 0; } + .pti {} + .authicn { cursor: pointer; color: #FF7E00; } + +/* 贴子掌上论坛弹窗 */ + .code_bg {background: url({IMGDIR}/code_bg.png) no-repeat 0 0; display:inline-block; padding:4px; margin:10px 20px; } + +/* 文章正文区块 */ + .pcb { clear: left; margin-right: 130px; } + .pcb h1, .pcb h2 { margin: 8px 0; font-size: 1.17em; } + .pcb h1 a { font-weight: 400; } + .pcb h2 em { float: right; font-size: 12px; font-weight: 400; } + #ph { padding: 17px 0 0; } + #ph h1 { font-size: 20px; } + #fj { margin-left: 5px; } + #fj label, #fj input { margin-right: 4px; padding: 0; height: 16px; line-height: 16px; } + .pcb .jammer { font-size: 10px; color: {WRAPBG}; } + + .pcb strong { font-weight: 700; } + .pcb em { color: {MIDTEXT}; } + .pcb span.t_tag { cursor: pointer; border-bottom: 1px solid red; white-space: nowrap; } + .pcb span.t_tag:hover { border-bottom: 1px solid {NOTICETEXT}; } + .pct { padding-bottom: 1em; } + .t_fsz { min-height: 100px; } + .t_f, .t_f td { font-size: {MSGFONTSIZE}; } + .t_f a { color: {HIGHLIGHTLINK}; text-decoration: underline; } + .t_f ul { margin-left: 14px; } + .t_f li { margin-left: 2em; } + .t_f ul li { list-style-type: disc; } + ul.litype_1>li { list-style-type: decimal; } + ul.litype_2>li { list-style-type: lower-alpha; } + ul.litype_3>li { list-style-type: upper-alpha; } + .t_f i { font-style: italic; } + .sign { overflow: hidden; margin-bottom: 10px; padding-top: 16px; border-top: 1px dashed #CCC; line-height: 1.6em; } + .sign::before { content: "SIGNATURE"; float: left; margin-top: -20px; margin-left: -8px; color: #7FCCE5; transform: scale(0.8); letter-spacing: 2px; } + .sign * { line-height: normal; } + .po { border-top: 1px dashed {COMMONBORDER}; } + .po .y { margin: 8px 0 0 5px; } + .po p { float: right; } + .po p a, .po p label { margin-right: 6px; } + .hin { opacity: 0.2;} + .plhin:hover .hin { opacity: 1; } + .pob { line-height: 36px; } + .pob em { float: left;} + .pob em a { display: block; float: left; height: 36px; margin-right: 14px; } + .pob em a:before { font-family: dzicon; display: inline-block; height: 36px; width: 16px; transform: scale(1.3); margin-left: 2px; margin-right: 4px; color: #FF9C00; } + .cmmnt:before { content: "\f120"; } + .fastre:before { content: "\f10d"; } + .followp { background: url({IMGDIR}/rt.png) no-repeat 0 50%; } + .sharep { background: url({IMGDIR}/oshr.png) no-repeat 0 50%; } + .req { background: url({IMGDIR}/repquote.gif) no-repeat 0 50%; } + .editp:before { content: "\f10e"; } + .appendp:before { content: "\f120"; } + .psave { background: url({IMGDIR}/pubsave.gif) no-repeat 4px 50%; padding: 3px 10px 3px 25px; border:1px dotted {COMMONBORDER}; margin-left:5px; } + .push:before { content: "\f10f"; } + .replyadd:before { content: "\f124"; } + .replysubtract:before { content: "\f125"; } + .modact { display: block; height: 32px; text-align: center; padding:30px 0 0; } + .modact, .modact a { line-height: 32px !important; } + /* 按钮 by alice */ + #p_btn { line-height: 24px; padding:3em 0; text-align:center; } + #p_btn a { display: inline-block; margin-right: 6px; padding-right: 4px; padding-left: 4px; background: #E6EDF2; vertical-align: top; white-space: nowrap; border-radius: 4px; } + #p_btn a:hover { text-decoration: none; } + #p_btn i { display: block; padding: 4px; font-style: normal; cursor: pointer; } + #p_btn img { float: left; margin: 4px 4px 0 0; } + #p_btn em { float: left; margin-top: 1px; font-size: 14px; } + #p_btn span { padding-left: 2px; color: {LIGHTTEXT}; } + .tshare { padding-bottom: 10px; } + .tshare strong { float: left; margin-right: 10px; } + #p_btn .tshare a, #p_btn .tshare i { padding: 0; background: none; } + #p_btn .tshare a { margin-right: 10px; color: {HIGHLIGHTLINK}; } + #p_btn .tshare a:hover { text-decoration: underline; } + .rate { margin: 20px 0; font-size: 12px; } + .rate dt { float: left; padding-top: 7px; width: 80px; text-align: center; } + .rate dt strong { padding: 12px 8px; height: 46px; font-size: 24px; background: #FFF4DD; } + .rate dt p { padding-top: 10px; } + .rate dt strong a, .rate dt strong a em { line-height: 48px; height: 48px; color: {NOTICETEXT}; } + .rate dd { margin-left: 80px; } + .rate dd ul li { float: left; overflow: hidden; margin:0 4px; width: 67px; height: 84px; text-align: center; } + .rate .ratt { border-bottom: 1px dotted {WRAPBORDERCOLOR}; padding: 6px 0; } + .ratl th, .ratl td, .ratc { overflow: hidden; padding: 5px 2px; height: 24px; line-height: 24px; border-bottom: 1px dashed {WRAPBORDERCOLOR}; white-space: nowrap; } + .ratl img { height: 24px; width: 24px; vertical-align: middle; } + .rate_collapse .ratl_l,.rate_collapse .ratc { display: none; } + .rate_collapse .txt_h { visibility: hidden; } + .rate .op { padding-right: 16px; background: url({IMGDIR}/arrow_top.gif) no-repeat 100% 50%; } + .rate_collapse .op { background-image: url({IMGDIR}/arrow_down.gif); } + .rate i { font-style: normal; } + .ratl .xw1 .xi1 { background:#FFF4DD; border-radius:3px; padding:2px 3px; } + + .icon_ring { background:#FFF4DD; float: left; width:8px; height:8px; margin-right:5px; margin-top: 3px; border:2px solid #F26C4F; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.2); overflow: hidden; } + .icon_ring:hover { background:#F26C4F; border:2px solid #FFF; } + +/* 回帖推荐 post sticklist by dfox */ + .psth { margin: 2em 0 2em -20px; padding: 5px 45px 5px 20px; width: 240px; background: #FFF4DD; color: {NOTICETEXT}; font-size: 14px; border-radius: 0 14px 14px 0; } + .tpst .psth { margin-left: -15px; } + .pstl { clear: left; padding: 0.5em 0;} + .psta { float: left; width: 120px; line-height:24px; overflow:hidden; } + .psta img { width: 24px; height: 24px; vertical-align:midden; } + .psti { margin-left: 120px; line-height:24px; } + +/* 点评 by monkeye */ + .f_c .cm { overflow: hidden; } + .cm .psth { background-color: #FFF4DD; color: {NOTICETEXT}; background-position: 100% 50%; font-size: 12px; } + .cm .pg { float: none; } + .cm .pg a, .cm .pg strong { margin: 0 4px 0 0; } + .cm i { color: #F30; font-style: normal; } + .cmstar { display: block; margin-top: 5px; width: 100px; height: 16px; cursor: pointer; } + .cmstarv { padding-right: 2px; } + .cmm .cmstar { margin-top: 0; } + .cmstar em { float: left; width: 16px; height: 16px; line-height: 16px; font-size: 16px; text-align: center; overflow: hidden; color: #BBB; } + .cmstar em:before { font-family: dzicon; content: "\f12d"; } + .cmstar .itms_0 { width: 10px; text-indent: -9999px; } + .cmstv_1 .itms_1, .cmstv_2 .itms_1, .cmstv_2 .itms_2, .cmstv_3 .itms_1, .cmstv_3 .itms_2, .cmstv_3 .itms_3, .cmstv_4 .itms_1, .cmstv_4 .itms_2, .cmstv_4 .itms_3, .cmstv_4 .itms_4, .cmstv_5 em { color: #F90; } + +/* 屏蔽提示 */ + #hiddenpoststip { line-height:40px;padding-left:20px;background: #FFFAF3; font-size: 12px; text-align: center; } + #hiddenpoststip a { display: block; text-indent: 25px; height: 29px; line-height: 29px; color: #EFAA00; } + #hiddenpoststip a:hover { text-decoration: none; } + +/* + Name: mod_viewthread_author + Level: Function + Explain: 第二页以后显示主题作者 + Author: lushnis + Last Modify: Pony 11042913 +*/ + #tath { padding: 0 10px 0 15px; width: 130px; line-height: 24px; white-space: nowrap; word-break: keep-all; word-wrap: normal; text-overflow: ellipsis; overflow: hidden; } + #tath img { width: 24px; height: 24px; vertical-align: middle; } + +#f_pst .plc { padding: 20px; } + #f_pst .fpp label { zoom: 1; } + #f_pst .avatar { margin-top: 15px; } + +i.pstatus { display: block; margin-bottom: -30px; font-size: 12px; text-align: center; font-style: normal; line-height: 32px; color: {LIGHTTEXT}; } + +/* 用户详细信息 */ + .bui { position: absolute; margin: -1px 0 0 -1px; padding: 15px 0 15px 20px; width: 430px !important; border: 1px solid {COMMONBORDER}; background: {WRAPBG}; box-shadow: 2px 2px 3px {WRAPBORDERCOLOR}; -webkit-box-shadow: 2px 2px 3px {WRAPBORDERCOLOR}; -moz-box-shadow: 2px 2px 3px {WRAPBORDERCOLOR}; } + .bui dl { margin: 5px 0 10px; } + .bui dt { width: 4.5em; } + .bui dd { margin-right: 10px; width: 75px; } + .bui .m img { margin-bottom: 12px; width: 120px; } + .bui .i { width: 290px; } + .imicn img { vertical-align: middle; margin-right: 8px; } + .imicn .xi2:hover { text-decoration: none; } + .imicn .xi2 img { margin-right: 0; } + .card_gender_0 { background: #efefef } + .card_gender_1 { background: #bbebf9 } + .card_gender_2 { background: #fce0df } + + /* + Name: mod_user_interaction + Level: Function + Explain: 文章左侧用户互动操作 + Last Modify: Pony + */ + .pls .o li { background-position: 0 50%; background-repeat: no-repeat; } + .pls .o li:before { float: left; font-family: dzicon; line-height: 14px; font-size: 16px; color: #7DA0CC; margin-top: 1px; margin-right: 2px; } + .pls .o .callon:before { content: "\f103"; } + .pls .o .buddy:before { content: "\f13e"; } + .pls .o .poke2:before { content: "\f146"; } + .pls .o .pm2:before { content: "\f119"; } + .pls .o .addflw:before { content: "\f11e"; } + /* 文章左侧用户组升级提示细微调整 Last Modify Pony */ + .pls .tip_4 { margin-left: -5px; } + + /* + Name: mod_thread_attr + Level: Function + Explain: 文章中类似“游客,如果您要查看本帖隐藏内容请”等地方的样式 + Last Modify: Pony 11060209 + */ + .locked { overflow: hidden; margin: 10px 0; padding: 8px 8px 8px 24px; border: 1px dashed #FF9A9A; background: {WRAPBG} url({IMGDIR}/locked.gif) no-repeat 6px 50%; font-size: 12px; zoom: 1; } + .locked:hover { background-color: #F7F7F7; } + .locked strong { color: {NOTICETEXT}; } + .locked a, .attach_nopermission a { color: {HIGHLIGHTLINK}; } + .attach_nopermission { margin: 10px 0; width: 600px; border: 1px dashed #AAAA92; background: #FFFFEE url({IMGDIR}/attach_nopermission_bg.svg) no-repeat 100% 0; font-size: 12px; } + .attach_nopermission div { padding: 20px 0 20px 70px; border: 3px solid #FFF; background: url({IMGDIR}/attach_nopermission.svg) no-repeat 15px 15px; } + .attach_nopermission:hover div { border-color: #DADAB1; } + .attach_tips { margin-bottom:15px; position: relative; } + .attach_tips h3 strong { color: #8CA226; font-size:15px; display:block; margin-bottom: 10px; margin-top: -10px; } + .attach_tips .atips_close { position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; line-height: 12px; text-align: center; cursor: pointer; color: #ccc; font-weight: bold; } + .attach_tips:hover .atips_close { color: #999; } + .attach_tips .atips_close:hover { color: #333; } + .viewpay { overflow: hidden; margin: 0 6px; padding: 1px 0 1px 24px; background: url({IMGDIR}/viewpay.gif) no-repeat 6px 60%; color: {HIGHLIGHTLINK}; font-weight: 700; zoom: 1; } + .showhide { overflow: hidden; border: 1px dashed #FF9A9A; margin: 8px 0; padding: 10px; zoom: 1; } + .showhide h4 { margin-bottom: 10px; color: #F66; font-size: 12px; text-align: center; } + + /* + Name: mod_thread_code_quote + Level: Function + Explain: 文章代码/引用等样式 + Author: lushnis + Last Modify: Pony 1205241556 + */ + .pl .quote, .pl .blockcode { margin: 10px 0; padding: 10px 10px 10px 65px; zoom: 1; } + .pl .quote { padding-bottom: 5px; background: #F9F9F9 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='28' height='27'%3e%3cpath fill='%23d8e7f2' d='M11 16v10H1V16C1 10 7 1 11 1v5c-2 0-5 6-5 10h5zm16 0v10H17V16c0-6 6-15 10-15v5c-2 0-5 6-5 10h5z'/%3e%3c/svg%3e") no-repeat 20px 6px; } + .pl .quote blockquote { display: inline-block; margin: 0; padding: 0 65px 5px 0; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='28' height='27'%3e%3cpath fill='%23d8e7f2' d='M17 11V1h10v10c0 6-6 15-10 15v-5c2 0 5-6 5-10h-5zM1 11V1h10v10c0 6-6 15-10 15v-5c2 0 5-6 5-10H1z'/%3e%3c/svg%3e") no-repeat 100% 100%; line-height: 1.6; zoom: 1; } + + .pl .blockcode { padding: 10px 0 5px 10px; border: 1px solid {WRAPBORDERCOLOR}; background: #F7F7F7 repeat-y 0 0; background-image: linear-gradient(90deg, #EDEDED, #EDEDED); background-size: 43px; overflow: hidden; } + .pl .blockcode ol { margin: 0 0 0 10px !important; padding: 0 !important; } + .pl .blockcode ol li { padding-left: 10px; list-style-type: decimal-leading-zero; font-family: Monaco,Consolas,'Lucida Console','Courier New',serif; font-size: 12px; line-height: 1.8em; } + .pl .blockcode ol li:hover { background: {WRAPBG}; color: {HIGHLIGHTLINK}; } + .pl .blockcode em { margin-left: 43px; color: {HIGHLIGHTLINK} !important; font-size: 12px; cursor: pointer; user-select: none; } + .pl .tindex { padding: 5px; width: 500px; line-height: 22px; border: 1px solid {WRAPBORDERCOLOR}; } + .pl .tindex h3 { border-bottom: 1px #ccc dotted; margin-bottom: 10px; padding-left: 10px; } + .pl .tindex li { cursor: pointer; height: 22px; padding-left: 22px; background: url({IMGDIR}/ico_mulu.png) no-repeat 10px center; overflow: hidden; } + + +/*投票 poll optionvessel by dfox */ + .pcht { margin-bottom: 15px; } + .polltd { padding: 4px; border: 1px #dfdfdf solid; border-radius: 3px; } + .polltd .nophoto { border: 1px solid #EEE; height: 130px; line-height: 130px; } + .polltd a:hover { text-decoration: none; } + .pcht h4 a { color: {HIGHLIGHTLINK}; text-decoration: underline; } + .pcht table { table-layout: fixed; } + .pcht table td { padding: 4px; vertical-align: top; } + .pslt { width: 20px; vertical-align: middle !important; } + .pvt { width: auto; } + .pvt label { cursor: pointer; } + .pvts { width: 100px; } + .pcht table tr.ptl td { padding: 8px 2px; border-bottom: 1px solid {WRAPBORDERCOLOR}; } + .pcht { width: 600px; } + .pinf { margin: 15px 0; color: {LIGHTTEXT}; } + .pinf strong { color: {MIDTEXT}; } + .pinf a { color: {HIGHLIGHTLINK}; } + .ptmr { margin: -10px 0 15px; } + .imgf2 { position: relative; height: 20px; background: #e9e9e9; border-radius: 10px; overflow: hidden; } + .jdt { display: block; width: 1px; height: 20px; background: #f2a61f; } + .imgfc { position: absolute; left: 0; top: 0; padding: 0 5%; width: 90%; line-height: 20px; } + /* + Name: mod_voter_list + Level: Function + Explain: 投票者列表样式 + Last Modify: Pony + */ + .voterlist { width: 495px; height: 195px; overflow: auto; } + .voterlist .ps { max-width: 495px; } + .voterl li { padding: 0 5px 5px 0; width: 90px; text-align: left; } + + /* + Name: mod_thread_trade_activity + Level: Function + Explain: spvimg,spi 为活动、商品公用部分 + Author: dfox + Last Modify: Pony 11082511 + */ + .act {} + .act .c { line-height: 28px; font-size: 14px; } + .spvimg { float: left; position: relative; width: 300px; background: #FAFAFA; text-align: center; border: 1px solid {COMMONBORDER}; } + .spvimg em.hot { width: 120px; height: 102px; background-position: 0 -104px; } + .spvimg a:hover { text-decoration: none; } + .spvimg .nophoto { height: 300px; line-height: 300px; } + .spi { margin-left: 315px;} + .spi dl { font-size: 14px; } + .spi dl dt { float: left; padding: 2px 0; width: 80px; height: 1em; } + .spi dl dd { margin-left: 90px; padding: 2px 0; min-height: 21px; height: auto !important; height: 21px; } + .spi dl dd em { color: #F30; } + dl.nums {} + .spi dl.nums dt { padding-top: 15px; } + .spi dl.nums dd em { font-size: 26px; } + .actl { table-layout: fixed; width: 320px; border-top: 3px solid {COMMONBORDER}; } + .actl th, .actl td { padding: 8px 2px; border-top: 1px dashed {COMMONBORDER}; } + .actl th { width: 60px; } + .actfm { height: auto !important; height: 220px; max-height: 220px; overflow-x: hidden; overflow-y: auto; } + .actl_pop { overflow: auto; max-width: 200px; max-height: 300px; } + .actl_pop li { display: block; padding: 3px 0; border-bottom: 1px dashed {COMMONBORDER}; } + /* 重定义弹窗里的链接 */ + .actl_pop a { display: inline; position: static; padding: 0; border: none; white-space: normal; } + .actl_pop a:hover { background: transparent; text-decoration: underline; } + +/* 悬赏 by dfox */ + .rwd {} + .rsld, .rusld { width: 90px; height: 114px; padding-top: 4px; background: #FFF3D9; text-align: center; color: #F30; position: relative; border-radius: 8px; } + .rsld { background: #EEE; color: {LIGHTTEXT}; } + .rsld cite, .rusld cite { display: block; margin: 4px auto 6px; height: 30px; font-size: 28px; } + .rsld em, .rusld em { position: absolute; bottom: 7px; left: 6px; height: 23px; line-height: 23px; text-align: center; width: 78px; color: {LIGHTLINK}; background: #E85500; border-radius: 5px; } + .rsld em { background: #009DD0; } + .rwdn { margin-left: 110px; } + .rwdbst {} + +/* 辩论观点样式 by michael */ + .pdbt { float: right; margin: -5px 10px 0 0; } + + .pdbts { float: left; overflow: hidden; height: 25px; line-height: 25px; background: #FF6F00; border-radius: 5px; } + .pdbts a { float: left; margin: 0; height: 25px; line-height: 25px; } + .pdbts a:hover { text-decoration: none; } + .pdbts .v { padding: 0 9px; color: {LIGHTLINK}; text-align: center; font-weight: 700; } + .pdbts .b { padding: 0 10px; margin: 1px; height: 23px; line-height: 23px; background: #FFF; border-radius: 4px; } + .pdbts_0 { background: #EEE; } + .pdbts_0 a { padding: 0 36px; text-align: center; } + .pdbts_2 { background: #00A4D7; } + +/* 商品 trade by michael & dfox*/ + .trdc { margin-top: 20px; background: #09C; height: 30px; line-height: 30px; color: {LIGHTLINK}; } + .trdc a { margin: 0 6px; height: 30px; line-height: 30px; color: {LIGHTLINK}; } + .trdc em { float: right; padding-right: 6px; line-height: 30px; color: {LIGHTLINK}; } + .trdb { border-bottom: 1px dashed {WRAPBORDERCOLOR}; } + .trdb .y * { vertical-align: middle; } + .trdb .c { clear: both; padding: 10px; font-size:14px; } + .trdb .c .pattl { border: none !important; } + .spi h4 { font-size: 18px; font-weight: 700; padding: 4px 2px 8px; } + + .trdl { padding: 10px 0; } + .trdl .tt { float: left; position: relative; width: 90px; text-align: center; } + .trdl .tt img { vertical-align: middle; cursor: pointer; } + .trdl .tt .nophoto { height: 90px; line-height: 90px; border: 1px solid #DDD; } + .trdl .tt .hot { width: 43px; height: 37px; } + .ta { margin-left: 100px; overflow: hidden; } + .ta h4 { padding: 2px; font-size: 14px; font-weight: 700; } + .ta dl { margin: 0; width: 200px; } + .ta strong { font-size:16px; color: #F30; } + + .torder .spvimg { width: 90px; } + .torder .spvimg .nophoto { height: 90px; line-height: 90px; } + .torder .spi { margin-left: 110px; } + .torder .spi strong { color: #F30; } + +/* 门户 viewthread 显示 */ +.vw .pcb { margin-right: 0; } + .vw dd .pcb { width: 640px; } + .vw dd .rate { padding-left: 0; } + .vw .pcb table { table-layout: fixed; width: 100%; overflow: hidden; } + .vw .t_fsz { min-height: 30px; } + .vw .pstl { margin-bottom: 1.4em; } + .vw .psth { margin-left: 0; } + .vw .pdbts { margin-right: 10px; height: 20px; line-height: 20px; background: url({IMGDIR}/pdbtm.gif) no-repeat 0 0; } + .vw .pdbts a { height: 20px; line-height: 20px; } + .vw .pdbts .b, .vw .pdbts .b:hover { padding: 0 5px; background: url({IMGDIR}/pdbtm.gif) no-repeat 100% -20px; } + .vw .pdbts .v { width: 30px; } + .vw .pdbts_0 { background-position: 0 -80px; } + .vw .pdbts_0 a { width: 90px; text-align: center; } + .vw .pdbts_2 { background-position: 0 -40px; } + .vw .pdbts_2 .b, .vw .pdbts_2 .b:hover { background-position: 100% -60px; } + + .vw .dr .sr_2 h5, .vw .dr h5 { width: 172px; } + +#modopt, #modopttmp { margin-left:5px; } +/** end **/ + +/** forum::forumdisplay,group::forumdisplay **/ +.previewPost .tindex { padding: 5px; width: 500px; line-height: 22px; border: 1px solid {WRAPBORDERCOLOR}; } + .previewPost .tindex h3 { border-bottom: 1px #ccc dotted; margin-bottom: 10px; padding-left: 10px; } + .previewPost .tindex li { cursor: pointer; height: 22px; padding-left: 22px; background: url({IMGDIR}/ico_mulu.png) no-repeat 10px center; overflow: hidden; } +/** end **/ + +/** forum::viewthread,group::viewthread,forum::forumdisplay,group::forumdisplay **/ +/* + Name: mod_visited_t&b + Level: Function + Explain: 返回列表中显示的访问过的文章和版块 + Last Modify: Pony +*/ +#visitedforums_menu { width: 150px; } + #visitedforums_menu li { display: block; float: none; } + #visitedforums_menu td { padding: 5px 10px; vertical-align: top; } + #visitedforums_menu a { white-space: normal !important; display: inline-block; overflow: hidden; height: 1.5em; } + #v_forums { width: 120px; } +#v_threads li, #v_forums li { padding-left: 10px; background: url({IMGDIR}/dot.gif) no-repeat 0 7px; } + +/* 快速表情 */ +#fastsmilies { text-align: right; } + #fastsmilies table { table-layout: auto; width: 160px; height: 133px; } + #fastsmilies td { text-align: right; vertical-align: middle; cursor: pointer; } + #fastsmilies img { vertical-align: middle; } +/** end **/ + + +/** home::space,forum::viewthread,forum::trade **/ +/* + Name: mod_trade_list + Level: Function + Explain: 文章以及交易单中的商品列表 + Last Modify: Pony 11060710 +*/ +.tradl {} + .tradl li { padding: 10px; width: 138px; height: 235px; } + .pg_trade .tradl li { float: none; padding: 10px 0; width: auto; height: 224px; } + .tradl .u { text-align: left; } + .tradl h4 { overflow: hidden; height: 38px; font-weight: 400; } + .tradl .tn { display: block; position: relative; margin: 5px auto; padding: 1px; width: 130px; height: 130px; border: 1px solid {COMMONBORDER}; } + .tradl .tn em.hot { width: 53px; height: 46px; background-position: 0 -48px; } + .tradl a:hover { text-decoration: none; } + .tradl img { max-width: 130px; max-height: 130px; } + .tradl .nophoto { height: 130px; line-height: 130px; } + .tradl.trads img { max-width: 90px; max-height: 90px; } + .tradl.trads .nophoto { width: 90px; height: 90px; line-height: 90px; } + .tradl .p { font-family: Arial, sans-serif; font-size: 16px; color: {LIGHTTEXT}; } + .tradl .stat { background: url({IMGDIR}/closed.png); color: {LIGHTLINK}; } +/** end **/ + + +/** forum::viewthread,group::viewthread,home::space **/ +/* 辩论 debatesquare by michael & dfox */ + .dtm { padding: 10px 0; text-align: center; font-weight: 700; } + .ds { margin-top: 1em; line-height: normal; } + .ds th { width: 60px; vertical-align: bottom; } + .ds th div { height: 150px; line-height: 150px; text-align: center; font-size: 28px; font-weight: 700; } + .ds td { vertical-align: bottom; } + .ds td p{ font-size: 14px; padding: 5px 0 15px; line-height: 20px; text-align: left; } + .ds .si_1, .ds .si_2 { text-align: center; vertical-align: middle; } + .ds .sc_1, .ds .sc_2 { width: 62px; } + .ds .point_chart{ position: relative; width: 60px; height: 150px; background: rgba(128, 128, 128, 0.1); border: 1px solid rgba(64, 64, 64, 0.1); border-radius: 12px 12px 0 0; overflow: hidden; } + .ds .point { margin: 0 auto; padding: 0 20px 0 10px; text-align: center; font-size: 14px; } + .ds .si_2 .point { padding: 0 20px; } + .ds .si_1 .point strong{ color: #F04700; } + .ds .si_2 .point strong{ color: #0092C5; } + .ds .chart{ position: absolute; left: 0; bottom: 0; width: 60px; } + .ds .sc_1 .chart{ background: #F04700; } + .ds .sc_2 .chart{ background: #0092C5; } + /* 空间中的辩论列表 by Pony */ + #nv_home .ds table { table-layout: fixed; width: 100%; } + #nv_home .ds th div, #nv_home .ds .point_chart { height: 120px; line-height: 120px; } + #nv_home .ds .ph { font-size: 16px; text-align: center; } + .dr { margin: 2px 0; padding-top: 6px; min-height: 80px; height: auto !important; height: 80px; } + .dr th { width:50px; } + .dr td { vertical-align: top; } + .dr h5 { padding-left:10px; width: 193px; text-align: center; font-size: 14px; font-weight: 400; } + .dr h5 a { color: #F04700; font-weight: 700; } + .dr .sr_1 .pn { float: right; margin-right: 5px; min-width: 62px; } + .dr .sr_2 .pn { margin-left: 5px; min-width: 62px; } + .dr .sr_2 h5 { float: right; padding: 0 20px 0 0; width: 183px; } + .dr .sr_2 h5 a { color: #0092C5; } + .dr .mls { padding-top: 15px; clear: both; } + .dr .mls li { width: 70px; } + +/* 标签 .ptg */ + .ptg:before { content: "\f14a"; font-family: dzicon; font-size: 16px; line-height: 14px; color: #7DA0CC; } + .ptg a { color: {HIGHLIGHTLINK}; } +/** end **/ + + +/** forum::viewthread,group::viewthread,forum::trade,portal::view **/ +/* 文章附件 by dfox */ + .pattl { overflow: hidden; padding: 1em 0; width: 100%; font-size: 12px; } + .tatt, .t_attach_img { padding: 5px; color: {LIGHTTEXT}; font-size: 12px; } + .tatt { width: 240px; } + .tatt em { color: {LIGHTTEXT}; } + .t_attachinsert{ margin:1em 0; font-size: 12px; } + .t_attachinsert p img{ margin-bottom: -4px; } + .t_table{ border: 1px solid #E3EDF5; empty-cells: show; border-collapse: collapse; } + .pl table.t_table { table-layout: auto; } + .t_table td { padding: 4px; border: 1px solid #E3EDF5; overflow: hidden; overflow-wrap: anywhere; } + .tattl { float: left; overflow: hidden; padding: 10px 10px 10px 0; width: 45%; height: 64px; } + .tattl a { color: {HIGHLIGHTLINK}; text-decoration: underline; } + .tattl dt { float: left; width: 40px; font-weight: 700; } + .tattl strong { margin-right: 6px; color: {NOTICETEXT}; font-weight: 400; } + .tattl dt img { width: 32px; height: 32px; } + .tattl dd { margin-left: 40px; color: {LIGHTTEXT}; } + .attnm { height: 18px; margin-bottom: 3px; overflow: hidden; white-space: nowrap; } + *html .attnm { white-space: normal; } + .attm { overflow: visible; float: none; width: 100%; height: auto; } + .attm dt { width: 0; } + .attm dd { margin-left: 0; } + .zoom { cursor: pointer; } + + .attp { width: 180px; text-align: left; } + .tattl .attp { width: 240px; } + + /* 版主浏览包含收费附件的文章,且附件插入到文章内容中去的时候 by Pony */ + .attprice { padding: 5px; border: 1px dashed #FF9A9A; } +/** end **/ + +/** forum::viewthread,group::viewthread,forum::trade,portal::view,forum::forumdisplay,home::space **/ + /* + Name: mod_zoominner + Level: Function + Explain: 显示原始图片弹出层 + Last Modify: Pony + */ + .zoominner { padding: 5px 10px 10px; background: {WRAPBG}; text-align: left; } + .zoominner p { padding: 8px 0; } + .zoominner p a { float: left; margin-left: 10px; width: 17px; height: 17px; line-height: 17px; text-align: center; overflow: hidden; color: #999; } + .zoominner p a:hover { color: #4497CC; text-decoration: none; } + .zoominner p a:before { font-family: dzicon; content: "\f139"; font-size: 18px; } + .zoominner p a.imgadjust:before { content: "\f13a"; } + .zoominner p a.imgclose:before { content: "\f116"; } + +.zimg_c { position: relative; } +.zimg_prev, .zimg_next { display: block; position: absolute; width: 80px; height: 100%; background: url({IMGDIR}/pic-prev.png) no-repeat 0 -100px; cursor: pointer; } +.zimg_next { right: 10px; background-image: url({IMGDIR}/pic-next.png); background-position: 100% -100px; } +.zimg_c img { margin: 0 auto; } +.zimg_p strong { display: none; background: #FFF; margin-top: 50px; height: 32px; line-height: 32px; text-align: center; font-size: 14px; } +.zimg_prev:hover strong, .zimg_next:hover strong { display: block; } +/** end **/ + + +/** forum::misc **/ +/* 非弹窗时显示出来的页面的样式重定义 */ + .mn .flb { padding-left: 0; } + .f_c .list { margin-left: 0; } +/** end **/ + + +/** portal::portalcp,portal::view,forum::viewthread,group::viewthread,home::space **/ +/* 自动给关键词增加的链接的样式 by Pony */ + .relatedlink, .relatedlink:hover { text-decoration: none !important; color: {TABLETEXT} !important; border-bottom: 1px solid blue; } + +/* 模块标识后面的收藏图片样式 by Pony */ + .favmark { margin-bottom: -3px; } +/** end **/ + + +/* ----------------------------------------------------------------------- 圈子相关样式 by dfox */ +/** group::index **/ + #g_focus { width: 320px; } + #g_commend {} + #g_commend .xld { float: left; margin-right: 0.3%; width: 24.5%; height: 64px; overflow: hidden; } + #g_commend dt { padding-bottom: 0; } + #g_guide { background: url({IMGDIR}/g_guide.svg) no-repeat 10px 18px; } + #g_guide li { border-bottom: 1px dashed {COMMONBORDER}; } + #g_guide a, #g_guide label { display: block; padding: 7px 0 7px 40px; height: 36px; } + #g_guide label { cursor: text; } + #g_guide strong { display: block; } + .fl .bm_h { border-bottom: none; background-color: transparent; } + +/* 圈子列表 by Pony */ + .fl_icn, .fl_icn_g { width: 48px; } + .fl_g dl { margin-left: 48px; padding: 0 5px; } +/** end **/ + +/** group::group **/ +#gh { border: 1px solid {COMMONBORDER}; } + #gh .bm { margin-bottom: 0; } + #gh .bm_h { background-color: {SPECIALBG}; } +/** end **/ + +/** group,search::group **/ +.gl .flc .icn { float: left; width: 60px; } +.gl .flc dl { margin-left: 60px; } + .gl .flc dl dt { height: 20px; overflow: hidden; } + + .mls li p { margin: 5px 4px 0; width: 58px; } + +.gl .flc .i { margin-top: -14px; width: 127px; } + .gl .flc .i em, .gl .flc .i span { float: right; width: 55px; color: {LIGHTTEXT}; text-align: right; line-height: 20px; } + .gl .flc .i em { border-right: 1px solid {COMMONBORDER}; padding-right: 10px; } + .gl .flc .i p { color: {LINK}; } + .gl .flc .i span p { font-weight: 700; } + +#nv_group .flg dd em { float: left; margin-right: 1em; color: {LIGHTTEXT}; white-space: nowrap; } + +#nv_group {} +#create_group_btn { display: block; text-align: center; } +/** end **/ + + +/** group::my **/ +/* 设置关注的圈子弹窗 by Pony */ + .attgroup { width: 450px; } + .attgroup li { float: left; overflow: hidden; margin-right: 5px; width: 145px; white-space: nowrap; } + +/* 关注按钮和所有圈子的按钮 by Shuaishuai*/ + .groupbtn { float: left; margin: 0 2px; padding: 0 !important; height: 23px; border: 1px solid #C1CFDA !important; background: #EEF0F3 !important; border-radius: 3px; line-height: 23px; text-align: center; cursor: pointer; } + .groupbtn:hover{ text-decoration: none; } + .groupbtn span { display: block; padding: 0 7px; } +/** end **/ + + + +/* ----------------------------------------------------------------------- 文章、日志等页面样式 */ +/** portal::list,home::space **/ +.bm_h .addnew { margin-left: 10px; } + .bm_h .addnew:before { display: inline-block; content: "+"; font-weight: 700; font-size: 18px; line-height: 14px; color: #309D36; margin-right: 2px; } +.bm_h .rss { margin-left: 10px; } + .bm_h .rss:before { font-family: dzicon; content: "\f10a"; display: inline-block; height: 14px; line-height: 14px; font-size: 16px; color: #ff9132; margin-right: 2px; } +/** end **/ + + +/** forum::viewthread,portal::view,portal::comment,home::space **/ +/* Article/Blog View by lushnis */ + .vw {} + .vw .h { padding-bottom: 15px; border-bottom: 1px solid {COMMONBORDER}; } + .vw .ph { padding: 15px 0 10px; color: #444; } + .vw .hot { margin-right: 5px; color: {NOTICETEXT}; } + .vw .s { margin-top: 10px; padding-bottom: 10px; border-bottom: 1px solid {COMMONBORDER}; line-height: 2; color: {HIGHLIGHTLINK}; } + .vw .s strong { font-weight: 400; color: red; } + .vw .d { margin: 15px 0; min-height: 100px; font-size: 14px; line-height: 1.8; color: #000; } + .vw .d i { font-style: italic; } + .vw .d img { max-width: 620px; } + .vwtb { table-layout: fixed; width: 100%; height: 300px; } + .vw .pattl_c .tip { line-height: 1.5; } + #article_content { vertical-align: top; } + .vw .d ol, .vw .d ul { margin: 1em 2em; } + .vw .d ul li { list-style-type: disc; } + .vw .d .ml, .vw .d .xl { margin: 0; } + .vw .d .ml li { list-style-type: none; } + .vw .attach { padding-left: 20px; background: url({IMGDIR}/fach.gif) no-repeat 0 50%; color: {HIGHLIGHTLINK}; } + .vw .o { margin-top: 15px; padding-top: 5px; border-top: 1px solid {COMMONBORDER}; text-align: right; } + .vw .o .mgcmn { width: auto; text-align: left; } + #nv_portal .vw .h, #nv_portal .vw .s, #nv_portal .vw .d, #nv_portal .vw .o, #nv_portal .vw .pren, #nv_forum .vw .h, #nv_forum .vw .s, #nv_forum .vw .d { margin-right: 15px; margin-left: 15px; } + .pic_h { border-radius:5px; } + .pic_h .h { border-bottom:1px dashed #CDCDCD; margin-left:0 !important; margin-right:0 !important; padding-left: 15px;padding-right: 15px; } + .pic_h .d { margin:0 !important; } + /* albumback by Alice */ + .albumback #ft { border-top:0; color:#FFF; } + .albumback #pt a,.albumback #ft a,.albumback a.thread_mod span,.albumback .vw .ph,.albumback .album_info p,.albumback .img_tit_t .xi1 { color:#FFF; } + .albumback .ct2 .bm,.albumback #imagelist_nav { background:#000; } + .albumback #ct { border-color:#CDCDCD; } + .albumback a.thread_mod:hover span { color:#539BCB !important; } + +/* .atd -> attitude 表态 by Pony */ + .atd { margin: 15px auto; } + .atd img { margin-bottom: 10px; } + .atd a { display: block; } + .atd a:hover { text-decoration: none; } + .atd td { padding: 10px; text-align: center; vertical-align: bottom; } + .atd .atdc { position: relative; margin: 0 auto 10px; width: 20px; height: 50px; } + .atdc div { position: absolute; left: 0; bottom: 0; width: 20px; text-align: left; } + .atd .ac1 { background: #C30; } + .atd .ac2 { background: #0C0; } + .atd .ac3 { background: #F90; } + .atd .ac4 { background: #06F; } + .atdc em { position: absolute; margin: -25px 0 0 -5px; width: 30px; font-size: 11px; text-align: center; color: {LIGHTTEXT}; } +/** end **/ + + +/** portal::portalcp,portal::view **/ +.pgm { clear: both; padding: 5px 0; } + .pgm .pg { float: left; } + +/* 管理相关文章 */ +.bart { position: relative; padding: 10px; width: 640px; } + .bartl { overflow-y: scroll; padding: 10px; width: 270px; height: 270px; border: 1px solid {COMMONBORDER}; } + .bartl li { overflow: hidden; width: 250px; height: 20px; } + .bartl li em { float: left; width: 200px; } + .barto { position: absolute; top: 190px; left: 315px; height: 30px; } + .barto .pn * { padding: 0 8px; } + .bart .chkall { padding-left: 10px; } + #chkalldiv p { width: 292px; } + +/* 管理模块 */ + .ptblk li { padding: 7px 0; border-bottom: 1px solid {COMMONBORDER}; } + .ptblk em { margin-right: 30px; } + +/* 文章标题颜色、加粗、斜体、下划线等样式 by Pony */ +.colorwd { margin-right: 3px; } +.dopt input { float: left; } + +/* 上一篇/下一篇文章 样式*/ +#nv_portal .vw .pren em { display: block; width: 100%; height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +/** end **/ + + + +/* ----------------------------------------------------------------------- 空间相关样式 */ +/** home::space,misc::ranklist **/ +/* .mi --> my_infomation 空间首页个人信息部分 */ + .mi {} + .mi th, .mi td { vertical-align: top; } + .mi th { width: 145px; } + .mi .avatar a { position: relative; } + .mi .avatar a:hover { text-decoration: none; } + .mi .avatar a span { display: none; position: absolute; bottom: 2px; padding: 5px 0; width: 100%; text-align: center; background: transparent; background: rgba(255, 255, 255, 0.5); cursor: pointer; } + .mi .avatar a:hover span { display: block; } + .mi .avatar img { padding: 3px; border: 1px solid {COMMONBORDER}; } + .mifm { position: relative; margin: 10px 0 20px; padding: 5px; width: 370px; background: {COMMONBG}; zoom: 1; } + .mipm { padding: 5px 0; border: 1px solid {COMMONBORDER}; } + .mipm li { float: left; padding: 5px 15px; white-space: nowrap; } + .mi a.o { margin-right: 5px; } + .mi a.o:before { display: inline-block; font-family: dzicon; width: 14px; height: 14px; line-height: 14px; margin-right: 4px; content: "\f103"; color: #CCC; font-size: 16px; } + #moodfm {} + #moodfm textarea { width: 600px; height: 56px; border: 1px solid; border-color: {INPUTBORDERDARKCOLOR} {INPUTBORDER} {INPUTBORDER} {INPUTBORDERDARKCOLOR}; overflow-y: auto; } + .mi .moodfm_input { width: 350px; height: 58px; } + .mi #moodfm textarea { float: left; margin: 0; padding: 3px; width: 552px; height: 50px; outline: none; border: 1px solid {COMMONBORDER}; background: #FFF; border-radius: 4px; } + .mi #moodfm.hover textarea { border-color: {SPECIALBORDER}; } + .moodfm_btn { padding-left: 5px; } + .moodfm_btn button { cursor: pointer; padding: 22px 11px; } + .moodfm_f { padding: 5px 0 0 3px; } + +/* + Name: mod_share_form + Level: Function + Explain: 发布分享的表单 + Last Modify: Pony +*/ + .sfm { margin: 0 0 20px 10px; } + .sfm .c { width: 442px; } + .sfm .px { width: 432px; } + .sfm .pt { width: 432px; height: 67px; } + +/* 分享视频有截图时 by Pony */ +.vdtn { width: 126px; height: 95px; border: 1px solid {COMMONBORDER}; cursor: pointer; } + +/* .pic -> picture 查看图片 by Pony */ + .osld { padding-left: 18px; background: url({IMGDIR}/slide.png) no-repeat 0 50%; } + .pic {} + .pic .c { margin-top: 20px; text-align: center; } + .pic .c img { max-width: 764px; } + .pic p { margin: 5px 0; } + .albim_pic_title { padding: 5px; border-top: 1px dashed {COMMONBORDER}; background: {COMMONBG}; } + +/* 侧边图片导航 Media list navigation */ + .mlnv { text-align: center; } + .mlnv img { margin: 0 5px; padding: 2px; max-width: 100px; max-height: 100px; border: 1px solid {WRAPBORDERCOLOR}; background: {WRAPBG};} + .mlnv img.a { border-color: {NOTICETEXT}; background: #FFEAA8; } + .mlnv .btn img { padding: 0; border: 0; background: none; } + + +/* .sl -> share_list 分享列表 by Pony */ + .sl {} + .sl li { padding: 10px 0; border-bottom: none; } + .sl .h { padding: 6px 10px; background: {COMMONBG}; border-bottom: 1px solid {COMMONBORDER}; } + +/* .favl -> fav_list 收藏列表 by Pony */ + .favl .o { background: url({IMGDIR}/op.png) no-repeat -4px -2px; } + .favl .o:hover { background-position: -4px -22px; } + +/* .cmt -> comment feed中的评论区域 by Pony */ + .cmt { margin: 10px 24px 0 0; padding: 10px; border: 1px solid #EAEAEA; background: {COMMONBG}; zoom: 1; } + .cmt form { margin-top: 10px; } + .cmt input, .cmt button { vertical-align: middle; } + .cmt .pt { width: 95%; margin: 3px 0; } + .cmt .tri { margin: 10px 0 -23px; width: 19px; height: 13px; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='19' height='13'%3e%3cpath fill='%23f5f5f5' stroke='%23e6e6e6' d='M.5 0v12l19-13'/%3e%3c/svg%3e") no-repeat; } + .cmt .xlda dl { padding-left: 50px; } + .cmt .xlda .m { margin-left: -50px; } + .cmt .avt img { width: 36px; height: 36px; } + .cmt .pg a, .cmt .pg strong { background-color: transparent; } + .cmt .pg a { border-color: {COMMONBG}; } + .cmt .pg a:hover { border-color: {WRAPBORDERCOLOR}; } + /* feed 区域里的评论 */ + .el .cmt li { padding-right: 0; border-bottom: none; } + .el .tri { display: none; } + /* feed 区域中评论的验证码 */ + .el .cmt .sec .px { width: 80px !important; } + +/* .pll -> poll_list 投票列表 */ + .pll {} + .pll li { padding: 10px 0; min-height: auto; } + .pll .h { font-size: 14px; } + .pll .h span { font-weight: 400; } + .pll .c { margin: 0 84px 0 74px; } + .pll ol { margin: 5px 0 0 20px; } + .pll ol li { list-style-type: decimal; padding: 0; border-bottom: none; } + .pll .u { overflow: hidden; width: 74px; text-align: center; } + .pll .u p { white-space: nowrap; } + .pll .s { display: inline; margin: 5px 10px 0 0; width: 60px; background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='60' height='89'%3e%3cpath fill='%23d8deea' d='M60 0v50c0 5.5-4.5 10-10 10H0V10C0 4.5 4.5 0 10 0z'/%3e%3cpath fill='%23f3f3f3' d='M60 65v19c0 2.75-2.25 5-5 5H0V70c0-2.75 2.25-5 5-5z'/%3e%3cpath fill='%23fe8400' d='M8 75l2.5 2.5L8 80h2l2.5-2.5L10 75z'/%3e%3c/svg%3e") no-repeat 0 0; } + .pll .s a.joins { margin: 0 0 5px; padding: 12px 0; width: 60px; height: 36px; display: block; overflow: hidden; text-align: center; text-decoration: none; } + .pll .s a.joins span { display: block; font-size: 16px; font-weight: 700; } + .pll .s a.go { padding: 0 0 0 17px; width: 43px; height: 24px; line-height: 24px; display:block; } + +/* .acl -> activity_list 活动列表 by Pony */ + .acl { width: 100%; table-layout: fixed; } + .acl h3 { padding: 10px 0; font-size: 14px; } + .acl h3 span { float: left; margin: 1px 10px 0 0; width: 34px; text-align: center; } + .acl h3 strong { display: block; background-color: #C00; color: {LIGHTLINK}; font-size: 12px; } + .acl h3 em { display: block; line-height: 22px; border: solid {COMMONBORDER}; border-width: 0 1px 1px; font-size: 16px; font-weight: 400; } + .acl td { padding: 10px 3px; border-top: 1px dashed {COMMONBORDER}; vertical-align: top; } + .acl .type { padding: 10px 3px 10px 0; width: 80px; } + .acl .type .nophoto { border: 1px solid {COMMONBORDER}; height: 78px; line-height: 78px; } + .acl .addr { padding-left: 20px; width: 130px; } + .acl .orgr { width: 74px; } + .acl .ml li { margin-top: 6px; padding-bottom: 0; } + +/* .tlog -> trade_log 交易记录 by Pony */ + .tlog th, .tlog td { padding: 10px 4px !important; } + +/* .rwdl -> reward_list 悬赏列表 by Pony */ + .rwdl {} + .rwdl li { overflow: hidden; float: left; padding: 15px 10px 15px 100px; width: 290px; height: 92px; } + .rwdl .uslvd { position: absolute; margin-left: -100px; width: 90px; height: 92px; background: #FFF3D9; border-radius: 8px; } + .rwdl .uslvd cite { display: block; line-height: 28px; font-size: 28px; margin-top: 10px; text-align: center; color: {NOTICETEXT}; } + .rwdl .uslvd span { display: block; line-height: 12px; font-size: 12px; } + .rwdl .uslvd em { position: absolute; bottom: 7px; left: 6px; height: 23px; line-height: 23px; text-align: center; width: 78px; color: {LIGHTLINK}; background: #E85500; border-radius: 5px; } + .rwdl .slvd { background: #EEE; } + .rwdl .slvd cite { color: {LIGHTTEXT}; } + .rwdl .slvd em { background: #009DD0; } + .rwdl h4 { overflow: hidden; height: 36px; font-weight: 400; } + .rwdl p { white-space: nowrap; } + +/* .facel -> face_list 空间部分的表情 by Pony */ + .facel { padding: 8px; width: 240px; } + .facel img { margin: 5px; } + +/* 提醒的内容中会用到。这里使用独立class,以便个性化。若想使提醒内容更醒目,可对summary下的span进行定义 */ + .summary { margin: 10px 0; } +/** end **/ + + +/** home::space,misc::ranklist,home::follow **/ +/* + Name: mod_pprl + Level: Function + Explain: 空间、广播等个人资料页面 + Last Modify: Pony 1109271712 +*/ + #pprl a { color: {HIGHLIGHTLINK}; } + #pprl li { clear: both; padding: 3px 0 3px 90px; } + #pprl li em { float: left; margin-left: -90px; width: 85px; white-space: nowrap; overflow: hidden; } + .pf_l li { float: left; width: 300px; } + .pf_l em { padding-right: 10px; color: {MIDTEXT}; } +/** end **/ + + +/** home::space,home::spacecp,home::medal,misc::ranklist **/ + /* 空间图片列表 */ + .mla li, .mlp li { width: 150px; } +/** end **/ + + +/** home::space **/ +/* 快速好友查找链接按钮样式 by ShuaiShuai */ + .sc_display{ display:inline-block; width:36px; text-align:right;} + + #mood_mystatus { width: 410px; word-break: break-all; overflow: hidden; } + #newprompt { background: url({IMGDIR}/info.gif) no-repeat 12px 50%; } + + .nts { padding-left: 20px; } + .nts dl { border-bottom: 1px dashed {COMMONBORDER}; } + .nts .more { border-top: 1px dashed {COMMONBORDER}; padding:10px 0 0 64px; } + +/* + Name: mod_pm_list + Level: Channel + Explain: 短消息列表 + Last Modify: Pony +*/ + .pml {} + .pml dl { padding-left: 75px; padding-right: 10px; } + .pml .hover { background-color: {SPECIALBG}; } + .pm_o { display: inline; width: 100px; } + .pm_o .o { overflow: hidden; float: right; margin-left: 10px; width: 16px; height: 16px; line-height: 16px; text-align: center; font-size: 18px; color: #CCC; } + .pm_o .o:before { font-family: dzicon; content: "\f148"; } + .pm_o .o:hover { color: #FF9A9A; } + .pm_o .p_pop { text-align: left; } + .pml .newpm { background: {SPECIALBG}; } + .pml .newpm .newpm_avt { position: absolute; margin: -5px 0 0 46px; width: 12px; height: 12px; font-size: 12px; background: #C00; border-radius: 6px; } + .pm_c { padding-left: 25px; line-height: 22px; } + .pm_c .o { float: left; display: inline; margin: 5px 0 0 -25px; } + .pm_op { padding-left: 75px; } + .pm_op_r { padding-right: 110px; } + .pm_o a.o { margin: 2px 5px 0} +/* + Name: mod_pm_group + Level: Function + Explain: 短消息群聊 + Last Modify: Pony +*/ + .pm_g { padding: 10px 15px; border: 1px solid #C2D5E3; background: #F2F7FA; } + .pm_sd, .pm_b { border: 1px solid #C2D5E3; background: {WRAPBG}; } + .pm_mn { margin-right: 175px; } + .pm_mn dl { padding: 0; } + .pm_mn dd.ptm { margin-top: -1px; padding-top: 0 !important; } + .pm_mn .tedt { margin-bottom: 5px; width: 591px; } + .pm_mn .area { height: 70px; } + .pm_mn .tedt .pt { height: 68px; } + .pm_mn .avt { display: none; } + .pm_sd { float: right; width: 160px; height: 425px; } + .pm_mem_l { overflow-x: hidden; overflow-y: auto; height: 425px; } + .pm_admin { height: 380px; } + .pm_mem_l li { overflow: hidden; padding-left: 25px; height: 25px; line-height: 25px; background: url({IMGDIR}/pm_member.png) no-repeat 5px 50%; } + .pm_add { padding: 10px; } + .pm_add .px { width: 90px; } + .pm_b { overflow-x: hidden; overflow-y: auto; padding: 10px; height: 300px; } + .pm_b img { padding: 2px; max-width: 575px; } + .syn_signature, .syn_signature_check { background: url({IMGDIR}/connect_post_syn.png) no-repeat scroll 0 0 transparent; cursor: pointer; display: inline-block; height: 19px; line-height: 64px; opacity: 1; overflow: hidden; vertical-align: -6px; width: 19px; } + .syn_signature { background-position: 0 -66px } + .syn_signature_check { background-position: -22px -66px; } +/** end **/ + + +/** home::spacecp **/ +/* 空间图片列表 */ + .mls li { width: 90px; } +/* + Name: mod_my_credits_list + Level: Function + Explain: 上传图片 + Last Modify: Pony 11082413 +*/ + .up_row { width: 100%; table-layout: fixed; } + .up_row td { vertical-align: middle; padding: 5px 0; border-bottom: 1px solid {SPECIALBORDER}; } + .up_row .c { width: 150px; } + .up_row .c img { width: 120px; } + .up_row .d { width: 400px; } + .up_row strong { margin-right: 5px; } + #creatalbum { padding-top: 1px; border-top: 1px solid {SPECIALBORDER}; } + +.doodle { padding-left: 3px; width: 65px; text-align: left; background: url({STATICURL}image/magic/doodle.small.gif) no-repeat 0 50%; } + .doodle a { padding-left: 2px; } + +/* + Name: mod_my_credits_list + Level: Function + Explain: 我的积分列表 + Last Modify: Pony 11061714 +*/ + .creditl {} + .creditl li { float: left; margin-right: 5px; width: 24%; height: 30px; } + .creditl .cl { clear: both; float: none; width: auto; } + .creditl li em { font-weight: 700; } + .creditl u { text-decoration: none; } + +/* 订单状态 */ + .order-status-0 { color: #444; } + .order-status-1 { color: green; } + .order-status-2 { color: #ddd; } +/* 电脑端支付图标样式 */ + .channel-select { padding-bottom: 10px; } + .channel-select input { margin: 5px 8px 0 0; } + .channel-select img { vertical-align: top; } + +/** end **/ + + +/** home::spacecp,home::magic **/ +/* 查找好友 .scf --> Search friend */ + .scf h2 { line-height: 2.2; font-weight: 700; font-size: 14px; } + .scf h2:before { content: "\f101"; font-family: dzicon; line-height: 20px; font-size: 18px; margin-right: 2px; } +/* 用来展示复杂统计数据的表格,目前仅用户组页面用到 */ + .tdats { overflow: hidden; zoom: 1; margin: 10px 0; } + .tdats i { font-size: 14px; } + .tdats i:before { height: 18px; line-height: 18px; margin-right: 2px; } + .tdats th, .tdats td { overflow: hidden; padding: 0 5px; height: 26px; border-width: 0 1px 0 0; border-color: {WRAPBG}; white-space: nowrap; } + .tdats th { height: 40px; font-weight: 700; } + .tdats .h th { height: 24px; border-top: 1px solid {COMMONBORDER}; border-bottom: 1px solid #E5E5E5; background: linear-gradient(0deg, #efefef, #fcfcfc); color: {MIDTEXT}; zoom: 1; } + .tdats .tdat { float: left; width: 240px; border: none; table-layout: fixed; } + .tdats .tfx { width: 300px; } + .tdats .tfxf { width: 770px; } + .tfx th, .tfx td { border-width: 0 3px !important; background: #FFF2DF; } + .tfx .alt, .tfx .alt th, .tfx .alt td { background: #FAEDDA; } + .tfx .h th { padding: 1px 5px; } + .tscr { float: left; overflow: hidden; width: 470px; } + .tscr .tdat th, .tscr .tdat td { width: 470px; } + .nwp { word-wrap: normal; white-space: nowrap; } + .tdats .c0 { padding: 0; height: 46px; text-align: center; vertical-align: bottom; background: transparent; } + .tdats .c0 h4 { line-height: 38px; background-color: #F60; color: {LIGHTLINK}; } + .tdats .c0 h4, .tdats .tb li { -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } + .tdats .tb { float: left; margin-top: 8px; padding-left: 0; width: 470px; border-bottom-width: 4px; } + .tdats .tb li { padding: 0 10px; line-height: 33px; font-weight: 700; color: {LIGHTLINK}; } + .tdats .c1 { border-color: #158B00; } + .tdats #c1 { border-color: #158B00; background-color: #158B00; background-position: 0 -40px; } + .tdats .c2 { border-color: #057373; } + .tdats #c2 { border-color: #057373; background-color: #057373; background-position: 0 -80px; } + .tdats .c3 { border-color: #1F57A9; } + .tdats #c3 { border-color: #1F57A9; background-color: #1F57A9; background-position: 0 -120px; } + .tdats .c4 { border-color: #1A588D; } + .tdats #c4 { border-color: #1A588D; background-color: #1A588D; background-position: 0 -160px; } + .tdats .c1 #c1, .tdats .c2 #c2, .tdats .c3 #c3, .tdats .c4 #c4 { line-height: 35px; } + .ftb td { width: 12%; } +/** end **/ + + +/** home::space,home::spacecp **/ +/* + Name: mod_ct_vw + Level: Function + Explain: 日志、好友列表页用到的两栏框架 + Last Modify: Pony +*/ + .ct_vw {} + .ct_vw_mn { float: left; width: 70%; } + .ct_vw_sd { float: right; width: 28%; } + +/* + Name: mod_buddy + Level: Function + Explain: 好友列表 + Last Modify: Pony +*/ + .buddy { margin: 0 -4px 10px -2px; } + .buddy li { overflow: hidden; display: inline; float: left; margin: 10px 5px 0; padding: 10px 10px 10px 70px; width: 175px; height: 58px; border: 1px solid #F3F3F3; background: #F9F9F9; } + .ct_vw_mn .buddy li { width: 190px; } + .buddy h4 { overflow: hidden; height: 20px; } + .buddy .avt { position: absolute; margin-left: -60px; } + .buddy .maxh { overflow: hidden; height: 20px; } + .buddy .note { color: green; } + .addbuddy:before { content: "+"; color: #13751C; font-weight: 700; line-height: 14px; font-size: 18px; margin-right: 4px; } + +/* + Name: mod_buddy_group + Level: Function + Explain: 好友分组 + Last Modify: Pony +*/ + .buddy_group { margin-top: -5px; } + .buddy_group li { overflow: hidden; padding: 5px 0; line-height: 20px; border-bottom: 1px dashed {COMMONBORDER}; } + .buddy_group li.a { font-weight: 700; } + .buddy_group .b, .buddy_group .o { float: right; width: 20px; height: 20px; overflow: hidden; line-height: 20px; font-size: 16px; text-align: center; font-family: dzicon; color: #CCC; } + .buddy_group .b:before { content: "\f149"; } + .buddy_group .o:before { content: "\f10e"; } + .buddy_group .b:hover { color: #FF9A9A; text-decoration: none; } + .buddy_group .o:hover { color: #FFB662; text-decoration: none; } + +.ntc_body .summary { margin-left: 2em; padding-left: 10px; border-left: 1px solid {COMMONBORDER}; } + .ntc_body .summary span { color: {LIGHTTEXT}; } + +/* .pmform -> 短消息表单非弹窗 by Pony */ + .pmform {} + .pmform .px { width: 408px; } + .pmform .tedt { width: 416px; } + +/* + Name: mod_user_selector + Level: Function + Explain: 用户名提示选择效果 + Last Modify: Pony 11061311 +*/ + .un_selector { height: auto; cursor: text; overflow: hidden; } + .un_selector input { width: 95px; height: 19px; border-width: 0; outline: none; } + .un_selector #subject { width: 408px; } + .un_selector span { float: left; margin: 1px 2px 1px 0; width: 100px; height: 19px; line-height: 19px; background: #F7F6ED; color: {HIGHLIGHTLINK}; overflow: hidden; } + .un_selector em { padding-left: 5px; width: 80px; } + .un_selector .x { float: right; width: 15px; height: 19px; overflow: hidden; text-align: center; } + .un_selector .x:before { content: "\d7"; display: inline-block; width: 15px; } + .un_selector .x:hover { background: {HIGHLIGHTLINK}; color: #F7F6ED; } + a.appendmb, a.appendmb span { height: 25px; line-height: 25px !important; } + /* 发短消息时根据输入显示出的用户名列表样式 */ + .pmfrndl { position: absolute; margin-top: 3px; padding: 4px; width: 120px; border: solid {DROPMENUBORDER}; border-width: 0 1px 1px; background: #FFF; } + .pmfrndl li { display: inline; } + .pmfrndl a { display: block; padding: 4px 2px; color: {HIGHLIGHTLINK}; } + .pmfrndl a:hover { text-decoration: none; } + .pmfrndl a.a { background: {SPECIALBG}; } + #showSelectBox_menu { padding: 10px; width: 300px; white-space: nowrap; } + #selBox { margin: 0 -10px 10px; padding-left: 10px; height: 110px; border: solid {COMMONBORDER}; border-width: 1px 0; overflow-y: auto; } +/** end **/ + + +/** home::task **/ +.pbg { position: relative; width: 80%; } + .pbg .xs0 { position: absolute; top: 0; right: 8px; font-family: PMingLiU, sans-serif; } +.taskbtn { display: inline-block; width: 80px; height: 32px; line-height: 32px; text-align: center; font-size: 14px; font-weight: 700; color: #FFF; background: #FA0; border-radius: 4px; } + .taskbtn:hover{text-decoration: none;} + .taskda{background: #CCC;} + .taskrw{background: #F50;} +/** end **/ + + +/** home::magic,home::medal **/ +/* .mgcl -> Magic list by lushnis */ + .mgcl li { float: left; width: 126px; height: 180px; text-align: center; } + .mgcl .mg_img { margin: 0 auto 5px; } + .pg_medal .mgcl img { margin-top: 20px; width: auto; height: auto; } + +/* 勋章记录重定义 by Pony */ + .el li { padding-left: 40px; } + .el .t { margin: -2px 0 0 -30px; } + .el .t img { width: 24px; height: 24px; } +/** end **/ + + + +/* ------------------------------------------------------------------------ 门户相关样式 */ + + + +/* ------------------------------------------------------------------------ 搜索相关样式 */ +/** search **/ +a { color: #369; } +body { background: none !important; } + #toptb { padding: 0 15px; border-bottom: 1px solid #EFEFEF; } +#ct { margin: 0 20px; } +#scform { margin: 10px 0;} + #scform h1 { margin-right: 20px; } + #scform h1 a img { max-height: 51px; } + #scform_tb a { float: left; display: inline; margin: 0 15px 0 3px; height: 26px; line-height: 26px; } + #scform_tb .y a { margin: 0 3px 0 15px; } + #scform_tb .a { color: #333; font-weight: 700; position: relative; } + #scform_tb .a::before { display: block; position: absolute; bottom: 0; left: 10px; left: calc(50% - 4px); content: ""; border-top: 0; border-right: 4px solid transparent; border-bottom: 4px solid {MENUBGCOLOR}; border-left: 4px solid transparent; } + #scform_srchtxt { padding: 0 8px; width: 465px; background: transparent; outline: none; height: 29px; border: 3px solid {MENUBGCOLOR}; border-radius: 5px 0 0 5px; line-height: 29px; } + #scform_submit { width: 100px; height: 35px; background: {MENUBGCOLOR}; border: 0; color: #FFF; cursor: pointer; font-size: 18px; border-radius: 0 5px 5px 0; } + #scform_submit:before { content: "\f101"; font-family: dzicon; } + #scform_submit strong { display: none; } + #scform_submit:focus { outline: 0; } + .sttl { margin: 10px 0; padding: 5px; border-bottom: 1px solid #CCC; background: #F5F5F5; } + .slst { width: 760px; } + .slst a { color: #00C; text-decoration: underline; font-weight: 400; } + .slst a:visited { color: purple; } + .slst a strong { font-weight: 400; } + .slst p span { color: #3A8000; } + .slst p span a, .slst p span a:visited { color: #666; } + .pbw strong { font-weight: 400; } + .pbw p { color: #000; } + .p_pop span { display: none; } +#nv_search #ft.w { margin: 20px; text-align: center; } +.pg { float: none; } +#myspace_menu li a, #navs_menu li a { background-repeat: no-repeat; background-position: -200px 0; } +/** end **/ + + + +/* ------------------------------------------------------------------------ 排行榜相关样式 */ +/** misc::ranklist **/ +.rankicn { width: 20px; } +.ranks { display: block; width: 16px; height: 16px; line-height: 16px; text-align: center; color: #FFF; background: #A0C8EA; border-radius: 8px; } +.ranks_1 { background: #ED741C; } .ranks_2 { background: #F3AC27; } .ranks_3 { background: #F8CB5E; } + +/* .rnk1 每行一个区块 */ +.rnk1 {} + .rnk1 .mlp .d { width: 120px; height: 120px; } + .rnk1 .mlp img { max-width: 100px; max-height: 75px; } + .rnk1 .mlp .bigpic { width: 295px; height: 240px; } + .rnk1 .bigpic img { max-width: 286px; max-height: 200px; } + +/* 图片排名上的序号 */ +.picrank { position: absolute; margin: -10px 0 0 -10px !important; } + +/* 竞价排名 by Pony */ +.bid { margin: 2px -4px -2px 2px; zoom: 1; } +.biduser { width: 988px; background: url({IMGDIR}/avatar_blank.gif); } + .biduser li { float: left; margin: 0 4px 4px 0; } + .biduser a { display: block; } + .biduser img { width: 48px; height: 48px; } + .bidtop { overflow: hidden; width: 100px; height: 100px; background-color: {COMMONBG}; } + .bidtop img { width: auto; height: 100px; } + + +/* 重定义 */ +.xl2 { background: url({IMGDIR}/vline.png) repeat-y 50% 0; } + .xl2 li { margin-right: 20px; width: 482px; } + .xl2 li.xl2_r { margin-right: 0; } + +.hasrank dl { padding-left: 110px; } + .ranknum { position: absolute; margin: 8px 0 0 -100px; } + +.el .t { } +.pll li { padding-left: 20px; } + +.acl td { border-top: none; border-bottom: 1px dashed {COMMONBORDER}; } +/** end **/ + + + +/* ------------------------------------------------------------------------ 统计相关样式 */ +/** misc::stat **/ +.dt a { color: {HIGHLIGHTLINK}; } +.dt th, .dt td { border-right: 1px solid {COMMONBORDER}; } +.dt .stat_subject { border-right: none; } +.dt .stat_num { padding-right: 15px; text-align: right; } +.pbg { float: left; width: 372px; } +.bm_h { padding-left: 0; background: none; border: none; } +/* 重定义 tab 标签样式 by Pony 11081614 */ +.ttp .a a { padding-left: 8px; padding-right: 8px; } +.ttp li.xw1 { font-weight: 400; } +/** end **/ + + +/** forum::collection,forum::viewthread **/ +.clct_list .xld { float: left; margin-bottom: 5px; width: 49.9%; height: 105px; overflow: hidden; } + .clct_list .xld .m, .clct_list .xld .m a { width: 55px; height: 50px; overflow: hidden; cursor: pointer; } + .clct_list .xld .m { background: linear-gradient(0deg, #B2C0DC 40%, #D8DEEA 40%) no-repeat 100% 0; border-radius: 3px; } + .clct_list .xld .m a:hover { text-decoration: none; } + .clct_list .xld .m strong { display: block; height: 32px; line-height: 32px; } + .clct_list .xld .m span { display: block; color: #FFF; } +.clct_flw { float: right; margin-top: 5px; height: 25px; line-height: 25px; overflow: hidden; background: #FF6F00; border-radius: 5px; } +.clct_flw i { float: right; padding: 0 9px; text-align: center; color: #FFF; font-style: normal; } + .clct_flw .u { width: 66px; } +.clct_flw strong { float: right; padding: 0 20px; margin: 1px; line-height: 23px; background: #FFF2E6; border-radius: 4px; } +.clct_flw a { color: #FFF; } +.clct_ratestar { float: left; width: 80px; height: 24px; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23ccc' d='M8 12.6l4.9 3-1.3-5.6L16 6.2l-5.7-.5L8 .4 5.8 5.7 0 6.2 4.4 10l-1.3 5.6 4.9-3z'/%3e%3c/svg%3e") repeat-x 0 0; } + .clct_ratestar .btn { position: absolute; width: 80px; height: 24px; z-index: 2; } + .clct_ratestar a { float: left; width: 16px; height: 20px; text-indent: -9999px; overflow: hidden; } + .clct_ratestar .star { position: absolute; width: 0; height: 24px; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23f90' d='M8 12.6l4.9 3-1.3-5.6L16 6.2l-5.7-.5L8 .4 5.8 5.7 0 6.2 4.4 10l-1.3 5.6 4.9-3z'/%3e%3c/svg%3e") repeat-x 0 0; z-index: 1; } + .clct_ratestar .star1 { width: 16px; } + .clct_ratestar .star2 { width: 32px; } + .clct_ratestar .star3 { width: 48px; } + .clct_ratestar .star4 { width: 64px; } + .clct_ratestar .star5 { width: 80px; } +.tbmu { padding-left: 10px; line-height: 23px; } +/* + Name: mod_collection_tag + Level: Function + Sample: tag + Explain: 淘帖标签样式,从 0 到 2,颜色越来越不醒目 + Last Modify: Pony 2012022311 +*/ +.ctag { padding: 1px 3px; font-weight: 400; border-radius: 3px; } + .ctag0 { background:#F6C5BE; color: #822111; } + .ctag1 { background:#FEF1D1; color: #AA8831; } + .ctag2 { background:#EEE; color: #666; } +.ctag_keyword { margin-left:12px;font-weight:normal; } +.ctag_keyword:before { content: "\f14a"; font-family: dzicon; font-size: 14px; line-height: 14px; color: #7DA0CC; margin-right: 4px; } +/** end **/ + + +/** home::follow **/ +/* 广播头像通用样式 */ +.flw_avt { width: 80px; } + .flw_avt img { float: left; margin-left: 15px; width: 48px; } +/* 广播区域样式 */ +.flw_article { margin: 0 0 10px 70px; padding: 5px 10px 15px; border-bottom: 1px solid #DBDBDB; } + .flw_thread .flw_article { margin-left: 0; } + .flw_article h2 { font-size: 16px; } + .flw_article h2 img { vertical-align: middle; } + .flw_reply { margin-left: 20px; } +.flw_author, .flw_author a { color: #79869E; } +.flw_article .c { font-size: 14px; line-height: 1.8; } + .flw_article .c img { display: block; margin: 10px 0; max-width: 600px; } + .flw_article .c .s { display: inline; margin: 0; } + .unread .flw_article { background-color: #FEFEEE; } + .unread .flw_article h2 a { color: {HIGHLIGHTLINK}; font-weight: 700; } +.flw_image { margin-bottom: 10px; max-height: 400px; zoom: 1; overflow: hidden; } + .flw_image li { float: left; width: 120px; max-height: 400px; background: #FFF; } + .flw_image li img { margin: 0 !important; width: 120px; max-height: 400px; } + .flw_image_1 { float: left; margin: 0 15px 10px 0; } + .flw_image_1 img { margin: 0 !important; } +.flw_attach { margin-top: 10px; clear: both; } + .flw_attach li { width: 300px; margin-bottom: 5px; height: 31px; line-height: 31px; font-size: 12px; border: 1px solid #DBDBDB; border-radius: 3px; background: url({IMGDIR}/flw_attach_bg.png) repeat-x 0 -31px; box-shadow: 0 1px 0 #FFF; } + .flw_attach a { display: block; padding: 0 10px 0 32px; height: 31px; background: url({IMGDIR}/flw_attach_bg.png) no-repeat 10px 8px; color: #369; } + .flw_attach a.flw_attach_price { background-image: url({IMGDIR}/viewpay.gif); } + .flw_attach a:hover { text-decoration: none; background-color: #EDF1F4; } + .flw_attach strong { float: left; width: 160px; font-weight: normal; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } + .flw_attach span { float: right; width: 90px; color: #999; text-align: right; overflow: hidden; } +.flw_video, .flw_music { margin: 10px 0; } + .flw_article .flw_video img { display: inline; } +.flw_quote { margin-left: 10px; padding-left: 15px; border-left: 3px solid #B1CCD8; } +.flw_readfull { padding: 3px 5px; border: 1px solid #DDD; border-radius: 3px; background: #FFF; } + .flw_readfull:hover { border-color: #9EB4C2; text-decoration: none; } +.flw_delete { visibility: hidden; float: right; width: 20px; height: 20px; background: #AAA; overflow: hidden; font-size: 16px; text-align: center; line-height: 20px; border-radius: 2px; } + .flw_delete:before { content: "\d7"; color: #fff; font-weight: 700; } + .flw_delete:hover { background: #15AFDB; text-decoration: none; } + .flw_feed_hover .flw_delete { visibility: visible; } +.flw_loading { margin: 0 0 10px 80px; padding: 10px; box-shadow: 0 1px 0 rgba(0,0,0,0.05); border: 1px solid #DBDBDB; border-radius: 4px; background: #F4F7F9; } +.flw_more { margin: 0 0 10px 80px; } + .flw_more a { display: block; padding: 10px; box-shadow: 0 1px 0 rgba(0,0,0,0.05); border: 1px solid #DBDBDB; border-radius: 4px; background: #F4F7F9; text-align: center; } + .flw_more a:hover { border-color: #9EB4C2; text-decoration: none; } + +/* 收听按钮通用样式 */ +.flw_btn_fo, .flw_btn_unfo { float: right; width: 68px; height: 19px; line-height: 19px; background: #f4f1c4; text-align: center; overflow: hidden; color: #B3AC5C; border: 1px solid; } + .flw_btn_unfo { background: #EEE; } + .flw_btn_fo:before { font-family: dzicon; font-size: 16px; margin-right: 4px; content: "\f108"; } + .flw_uheader .flw_btn_fo, .flw_uheader .flw_btn_unfo, .flw_hd .flw_btn_fo, .flw_hd .flw_btn_unfo { float: left; } + +/* 发广播 */ +#fastpostform { width:82%; } +#flw_header { padding: 10px; } +#flw_post_subject { width: 628px; height: 30px; line-height: 30px; border: 1px solid #9EB4C2; border-radius: 4px; background: #FFF; } +#flw_header #subject { margin: 5px; width: 580px; height: 20px; border: none; outline: none; background: transparent; line-height: 20px; } +#flw_checklen { padding-right: 10px; } + #flw_post_extra .sec { padding: 8px 15px; border: 1px solid #EFEFEF; background: #F9FBFC; border-radius: 4px; } +.tedt { width: auto; border: 1px solid #9EB4C2; border-radius: 4px; overflow: hidden; } +#flw_header .bar { padding-left: 10px; border-top: 1px solid #EFEFEF; border-bottom: none; background: #F9FBFC; border-radius: 0 0 4px 4px; } +#flw_header .area { background: #FFF; border-radius: 4px 4px 0 0; } + #flw_header .area .pt { height: 4em; } +#flw_header .ftid { margin-left: 5px; } +#fastpostsubmit { margin-right: 0; height: 33px; border: none; } +#flw_header .tb { padding-left: 0; height: 32px; border-bottom: none; line-height: 32px; } + #flw_header .tb a { padding: 0 15px; border: none; background: transparent none; color: #369; } + #flw_header .tb .a a { box-shadow: 0 -1px 0 rgba(0,0,0,0.15); border-radius: 4px 4px 0 0; background: #FFF; color: #333; } + +.flw_tab { padding-top: 0; border-bottom: none; } + +.sd { border-radius: 5px; background: #F4F7F9; } + +/* 侧边和主区域头像及统计信息 */ +#flw_avt { padding: 20px; } + #flw_avt img { margin: 0 auto 10px; border: 6px solid #FFF; } + .sd #flw_avt img { display: block; } + + .flw_user_info { margin: 10px 0; padding: 10px; box-shadow: 0 1px 0 #FFF, 0 -1px 0 #D7DBDF; border-radius: 5px; background: #E9EEF2; } + .flw_linktohome { padding: 2px 0 2px 20px; background: url({IMGDIR}/homelink.gif) no-repeat 0 2px; } + /* 主区域头像 */ + .flw_uheader { padding-right: 0; padding-left: 0; } + + .flw_stat_mn { margin-left: 20px; width: 490px; } +.pg_follow .sd .bm { border-width: 1px 0 0; border-color: #E8EAEB; background: transparent; } + .pg_follow .sd .bm_h { padding-left: 20px; border-width: 1px 0 0; border-color: #FFF; background: transparent; } + +/* 用户单页顶部 */ +#flw_header.flw_uheader { padding-top: 20px; border-bottom: 1px solid rgba(0,0,0,0.15); background: #F4F7F9 none !important; } + .flw_uheader .tb { margin-bottom: -1px; } + .flw_uheader h1 { font-size: 16px; } + .flw_uheader .tns { margin-left: -10px; padding: 0; width: 240px; } + .flw_uheader .tns th, .flw_uheader .tns td { padding-left: 10px; text-align: left; } + .flw_uheader .o { line-height: 21px; } + .flw_status_1, .flw_status_2 { padding: 0 10px 0 0; } + .flw_status_1:before, .flw_status_2:before { font-family: dzicon; line-height: 14px; font-size: 16px; color: #dcdbcc; margin-right: 4px; } + .flw_status_1:before { content: "\f100"; } + .flw_status_2:before { content: "\f13e"; } +.flw_specialfo, .flw_specialunfo { float: right; margin-right: 9px; width: 14px; line-height: 21px; font-size: 16px; height: 21px; text-align: center; overflow: hidden; color: #7CBE00; } + .flw_specialunfo { color: #FF512C; } + .flw_specialfo:before, .flw_specialunfo:before { content: "\f140"; font-family: dzicon; } + #specialflag_2_menu { width: 80px; } + .flw_uheader .flw_linktohome { padding: 0 0 0 20px; background-position: 0 3px; } + +/* 回复区域 */ +.flw_replybox { margin: -11px 0 20px 70px; padding: 15px 20px; box-shadow: 0 1px 0 rgba(0,0,0,0.05); border: 1px solid #DBDBDB; background: #E9EEF1; } + .flw_replybox li { padding: 10px 80px 10px 0; border-top: 1px solid #DBE2E6; } + .flw_replybox li .d { margin-right: 10px; } + .flw_replybox .px, .flw_autopt { border: 1px solid #CCDBE5; border-radius: 4px; background: #FFF; } + .flw_autopt { display: inline-block; vertical-align: top; margin: 0 5px 0 0; padding: 0 5px; width: 420px; } + td.flw_autopt { margin-right: 0; } + .flw_autopt .pts { padding: 5px; margin: 0 -5px; width: 100%; height: 19px; min-height: 19px; border: 0; } + .flw_replybox .pnc { width: 77px; height: 33px; border: none; background: transparent url({IMGDIR}/pn_reply.png) no-repeat 0 0; } + .flw_replybox .pnc span { line-height: 99px; } + .flw_replybox td table .pnc { background-image: url({IMGDIR}/pn_rt.png); } + /* 回复并转播选项 */ + .flw_rert { display: inline-block; padding-right: 5px; width: 95px; text-align: right; } + .flw_replybox .cnr { position: relative; float: right; overflow: hidden; display: inline; margin: -22px 16px 0 0; width: 11px; height: 7px; background: transparent url({IMGDIR}/flw_cnr_t.png) no-repeat 0 0; } + +/* 侧边切换 */ +#flw_side_tab { margin: 10px 0; } + #flw_side_tab li { line-height: 32px; } + #flw_side_tab a { display: block; height: 32px; padding-left: 20px; background: url({IMGDIR}/flw_side_tab.png) repeat-x 0 0; } + #flw_side_tab li.a a { background-position: 0 -32px; } + #flw_side_tab a img { float: left; margin: 8px 10px 0 0; } + +/* 侧边用户列表 */ +.flw_side_promote { } + .flw_side_promote .xlda dl { margin-bottom: 8px; } + .flw_side_promote .xlda .m { margin: 0 0 8px -55px; } + .flw_side_promote .xlda dt { padding-top: 0; } + .flw_side_promote .flw_btn_fo { float: left; } + +/* 类似听众页面的用户列表 */ +.flw_ulist {} + .flw_ulist li { padding: 10px 0 10px 100px; border-bottom: 1px solid #DBDBDB; } + .flw_ulist .flw_avt { float: left; margin: 0 0 0 -80px; } + .flw_ulist .unread { background-color: #FEFEEE; } + +.my_flw_stats { width: 120px; } + .my_flw_stats li { margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid {COMMONBORDER}; } + .my_flw_stats .xg1 { padding-right: 10px; } + +#flw_bar .fpd { position: relative; zoom: 1; } + +/* + Name: mod_follow_flashupload + Level: Global + Explain: 重定义 follow 页面的 Flash 上传时的处理界面,结构参见 /static/js/fileprogress.js + Last Modify: Pony 2012022813 +*/ +.progressWrapper { overflow: hidden; float: left; width: auto; } + .progressWrapper table { float: left; margin: 5px 1px 0 0; width: 209px; border: 1px solid #C3DCEA; border-radius: 4px; background: #FFF; } + .progressWrapper td { border-radius: 4px; } +.attswf p { padding-left: 5px; width: 170px; height: 26px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .attswf p img { width: 16px; height: 16px; } +.attc { padding-top: 3px; width: 20px; } + .attc .d { background-position-y: 0 !important; } + +.progressContainer { overflow: hidden; margin: 5px 0 0; width: 620px; border: 1px dashed #9EB4C2; background-color: transparent; } +.red { border: none; background-color: transparent; color: red; } +/** end **/ + + +/** forum::forumdisplay,group::group **/ +#livereplycontentout { position: relative; height: 195px; margin-top: 10px; border: 1px solid #E8F1F7; background: #FFF; overflow-y: auto; } +#livereplycontent { position: absolute; left: 0; bottom: 0; padding: 0 15px; } +#liverefresh { margin-top:10px; height: 30px; line-height: 30px; background-color: #FCF4CD; color: #fff; text-align: center; cursor: pointer; display: none; border:1px dashed #FCE491; color:#F26C4F; } +#livefastcomment { position: relative; height: 34px; margin: 10px 0px 0px 0px; border: 1px solid #E8F1F7;background-color: #FFF; padding:5px 10px; } + #livereplycontent dl { position: relative; width: 100%; min-height: 45px; line-height: 20px; padding: 10px 0; border-top: 1px #ccc dotted; clear: both; } + #livereplycontent dl dt { position: absolute; left: 0; top: 10px; width: 40px; height: 40px; border: 1px #ccc solid; padding: 1px; } + #livereplycontent dl dt img { width: 40px; height: 40px; } + #livereplycontent dl dd { padding-left: 62px; } + #livereplycontent dl dd a { color:{HIGHLIGHTLINK}; } + #livereplycontent dl dd.dateline { position: absolute; top: 10px; right: 0; padding: 0; color: #999; } +#livereplymessage{ width: 100%; line-height:28px; height: 33px; padding: 0px !important; border: none; outline: 0px; background: white none; overflow-y: auto; } + #livethread { background: #F5F9FB; border-top:2px solid #BDD7E3; } +.livethreadtitle { margin-bottom:5px; } + .livethreadtitle a { color:{HIGHLIGHTLINK}; font-size: 14px; } + .livethreadtitle .liveicon { background: #548BF6; padding: 1px 4px; border-radius: 2px; color: #FFF; } + .livethreadtitle .replynumber { float: right; line-height: 25px; } + .livethreadtitle .replynumber .xi1 { background:{NOTICETEXT}; padding:0 5px; border-radius: 5px; color: #FFF; font-weight: 700; } + .livethreadcon { line-height:160%; font-size:14px;} +/** end **/ + +/** misc::mobile **/ +.dzphone { width: 484px; height: 980px; margin-right: 10px; border-radius: 75px; box-shadow: inset #000 0 0 3px 1px; } +.dzphone>div { width: 428px; height: 924px; margin: 8px; border: 20px solid #222; border-radius: 68px; overflow: hidden; } +.dzphone .scrtop { height: 105px; background: #f2f2f2 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='92' height='12'%3e%3cpath d='M15 0h3v12h-3V0zm-5 3h3v9h-3V3zM5 6h3v6H5V6zM0 9h3v3H0V9zm35.8.2C35.1 8.5 34.1 8 33 8s-2.1.4-2.8 1.2L33 12l2.8-2.8zm-8.5-2.9l1.4 1.4c1.1-1.1 2.6-1.8 4.2-1.8s3.2.7 4.2 1.8l1.4-1.4C37.1 4.9 35.1 4 32.8 4c-2 0-4 .9-5.5 2.3zm-2.8-2.8l1.4 1.4C27.7 3.1 30.2 2 33 2s5.3 1.1 7.1 2.9l1.4-1.4C39.3 1.3 36.3 0 33 0s-6.3 1.3-8.5 3.5zM50 2h20v8H50V2zm22 10H48V0h24v12zm-23-1h22V1H49v10zm24-8h2v6h-2V3z'/%3e%3c/svg%3e") no-repeat 100% 18px; border-bottom: 1px solid #e1e1e1; font-family: system-ui; } +#ifm0 { width: 100%; height: 780px; vertical-align: middle; } +.dzphone .time { width: 70px; height: 39px; float: left; text-align: right; padding-top: 13px; padding-right: 25px; font-size: 16px; font-weight: 700; color: #000; } +.dzphone .defect { width: 238px; height: 33px; background: #222; border-radius: 0 0 25px 25px; float: left; } +.dzphone .siteurl { margin: 0 12px; padding: 0 35px; height: 40px; line-height: 40px; font-size: 14px; text-align: center; border-radius: 10px; background: #d8d8d8 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='28' height='21'%3e%3cpath d='M17 12.5h-1c0 4.1-3.4 7.5-7.5 7.5S1 16.6 1 12.5 4.4 5 8.5 5c1.1 0 2.2.3 3.1.7L8 9.3v1.4l5.2-5.2L8 .3v1.4l2.6 2.6C9.9 4.1 9.2 4 8.5 4 3.8 4 0 7.8 0 12.5S3.8 21 8.5 21s8.5-3.8 8.5-8.5z'/%3e%3c/svg%3e") no-repeat 100% 10px; color: #000; } +.dzphone .homebar { width: 152px; height: 6px; border-radius: 3px; background: #000; margin-left: 138px; margin-top: 20px; } +/** end **/ diff --git a/template/default/common/preview.htm b/template/default/common/preview.htm new file mode 100644 index 0000000..011d471 --- /dev/null +++ b/template/default/common/preview.htm @@ -0,0 +1,67 @@ + + + + + + + + + + + + + +
              +
              +

              {lang table_header}

              +
              +
              +
              {lang preview_msg}
              + + + + + + + + + + + + + + +
              {lang preview_smalltext}{lang preview_link}{lang preview_highlightlink}
              {lang preview_text}{lang preview_midtext}{lang preview_lighttext}
              {lang preview_threadtext}
              +
              +
              + +
              + {lang preview_footertext} +
              + + + \ No newline at end of file diff --git a/template/default/common/pubsearchform.htm b/template/default/common/pubsearchform.htm new file mode 100644 index 0000000..228ade0 --- /dev/null +++ b/template/default/common/pubsearchform.htm @@ -0,0 +1,75 @@ + + +
            • {lang search_this_forum}
            • +
            • {lang article}
            • +
            • {lang thread}
            • +
            • {lang blog}
            • +
            • {lang album}
            • +
            • $_G['setting']['navs'][3]['navname']
            • +
            • {lang users}
            • + + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang search} +
              + + {lang hot_search}: + + + + + + $val + + $val + + + + + + +
              +
              +
              +
              + + + \ No newline at end of file diff --git a/template/default/common/report.htm b/template/default/common/report.htm new file mode 100644 index 0000000..d99d28e --- /dev/null +++ b/template/default/common/report.htm @@ -0,0 +1,41 @@ + +

              + {lang report} + {lang close} +

              +
              +
              +

              {lang report_reason}

              +

              + +
              +

              + + +

              + + + + + + + + + + + + + + +
              + + \ No newline at end of file diff --git a/template/default/common/rss.css b/template/default/common/rss.css new file mode 100644 index 0000000..fd48c44 --- /dev/null +++ b/template/default/common/rss.css @@ -0,0 +1,57 @@ +channel +{ + font-size: 12px; + background: white; + font-family: verdana, arial, helvetica, 'Microsoft Yahei', sans-serif; + margin: 0px auto; + width: 100%; + padding:10px 10px 15px 10px; + text-align: center; +} + +channel title +{ + display: block; + font-weight: bold; + font-size: 18px; + z-index: 1; + position: relative; + height: auto; +} + +item +{ + padding:10px 10px 2px 10px; + display: block; + font-size: 14px; + margin: 20px 0px; + width: 90%; + line-height: 100%; + text-align: left; +} + + + +image, image title, image height, image width, image url, category, ttl, generator, guid, language, docs, comments,pubDate +{ + display: none; +} + +rss, item title, item link, item description, item pubDate, item author, item +{ + display: block; + font-weight: normal; + font-size: 14px; + margin: 5px; + background: #F0F8FB; +} + +item title { font-weight: bold; font-size: 16px; display: block; height: auto; position: relative; z-index: 1} +item link { margin-bottom: 0; } +link { display: block; color: blue; text-decoration: underline; } +info { display: block; margin: 3em 4em 3em 4em; color: Black; text-align: center; padding: 1.5em; font-family: mono; font-size: small; } + +managingEditor, webMaster, title, link, description, copyright, lastBuildDate, pubDate +{ + display: block; font-size: 14px; line-height:150%; +} diff --git a/template/default/common/seccheck.htm b/template/default/common/seccheck.htm new file mode 100644 index 0000000..dd683f4 --- /dev/null +++ b/template/default/common/seccheck.htm @@ -0,0 +1,12 @@ +{eval + $sechash = !isset($sechash) ? 'S'.(empty($_G['inajax']) ? '' : 'A'.random(3)).$_G['sid'] : $sechash.random(3); + $sectpl = str_replace("'", "\'", $sectpl); +} + + + + + + + + \ No newline at end of file diff --git a/template/default/common/secmobseccode.htm b/template/default/common/secmobseccode.htm new file mode 100644 index 0000000..12ea1d0 --- /dev/null +++ b/template/default/common/secmobseccode.htm @@ -0,0 +1,20 @@ + +
              +

              + {lang secmobseccode} + + {lang close} + +

              +
              + + + +
              :
              + +

              + +

              +
              +
              + \ No newline at end of file diff --git a/template/default/common/seditor.htm b/template/default/common/seditor.htm new file mode 100644 index 0000000..c008c1e --- /dev/null +++ b/template/default/common/seditor.htm @@ -0,0 +1,32 @@ + +
              + + B + + + Color + + + Image + + + Link + + + Quote + + + Code + + + Smilies + + + + + + + {lang at_friend} + + {$seditor[3] or ''} +
              \ No newline at end of file diff --git a/template/default/common/sendmail.htm b/template/default/common/sendmail.htm new file mode 100644 index 0000000..0bc86fa --- /dev/null +++ b/template/default/common/sendmail.htm @@ -0,0 +1,16 @@ + + + + + + +$subject + + + +hi, $toemail
              +$subject
              +$message + + + \ No newline at end of file diff --git a/template/default/common/showmessage.htm b/template/default/common/showmessage.htm new file mode 100644 index 0000000..2518347 --- /dev/null +++ b/template/default/common/showmessage.htm @@ -0,0 +1,75 @@ + + +
              + +
              + + +
              + + + + + +
              +
              +

              $show_message

              + + +

              {lang message_forward}

              + +

              {lang attach_forward}

              + + + + +
              + +
              + + +
              + +

              {lang board_message}{lang close}

              +
              +
              $show_message
              +
              +

              + + $param['closetime'] {lang message_closetime} + + $param['locationtime'] {lang message_locationtime} + + + + + + + + + + + +

              +$show_message + +
              +
              + + + + \ No newline at end of file diff --git a/template/default/common/stat.htm b/template/default/common/stat.htm new file mode 100644 index 0000000..54cf511 --- /dev/null +++ b/template/default/common/stat.htm @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/template/default/common/upload.htm b/template/default/common/upload.htm new file mode 100644 index 0000000..3357d23 --- /dev/null +++ b/template/default/common/upload.htm @@ -0,0 +1,7 @@ + + + + + + {eval $_G['uploadjs'] = 1;} + \ No newline at end of file diff --git a/template/default/common/userabout.htm b/template/default/common/userabout.htm new file mode 100644 index 0000000..1afc314 --- /dev/null +++ b/template/default/common/userabout.htm @@ -0,0 +1,9 @@ + +
                + + + $nav[code] + + +
              + \ No newline at end of file diff --git a/template/default/common/widthauto.css b/template/default/common/widthauto.css new file mode 100644 index 0000000..e525649 --- /dev/null +++ b/template/default/common/widthauto.css @@ -0,0 +1,40 @@ +/* ---------------------------------- +Self-adaption Width CSS file for Discuz! X +(C) Comsenz Inc. +https://www.discuz.vip +Created & Modified by Pony. +---------------------------------- */ + +.wp { width: 98%; } + #hd .wp, #wp { min-width: 1200px; } + +.ct2 { margin-right: 235px; } + .ct2 .sd { margin-right: -235px; } + .ct2 .mn { width: 100%; } + +.ct2 #chart, .ct2 #an { margin-right: -235px; } + +.ct2_a { padding-left: 150px; } + .ct2_a .appl { margin-left: -150px; } + .ct2_a .mn { width: 97%; } + +.ct3_a { padding: 0 240px 0 160px; } + .ct3_a .appl { margin-left: -160px; } + .ct3_a .sd { margin-right: -240px; } + .ct3_a .mn { margin: 0; width: 100%; } + +#nv { background-repeat: repeat-x; background-position: 0 -33px; } + +#mu ul { border-bottom: 1px solid {COMMONBORDER}; background-image: none; } + +.pg_post .ct2_a { margin-left: 0; padding-left: 0; } + .pg_post .ct2_a .appl { margin-left: 0; background: none; } +.pg_modcp .ct2_a, .pg_announcement .ct2_a { border: none; } + .pg_modcp .ct2_a .mn, .pg_announcement .ct2_a .mn { margin-right: 0; padding-top: 0; } + +.tdats .tdat { width: 20%; } +.tdats .tfxf { width: 79.5%; } +.tdats .tfx, .tdats .tb, .tscr { width: 39.5%; } + .tscr .tdat, .tscr .tdat th, .tscr .tdat td { width: 100%; } + +.widthauto .switchwidth:before { content: "\f105"; } \ No newline at end of file diff --git a/template/default/common/wysiwyg.css b/template/default/common/wysiwyg.css new file mode 100644 index 0000000..81ed2bc --- /dev/null +++ b/template/default/common/wysiwyg.css @@ -0,0 +1,27 @@ +/* +wysiwyg CSS file for Discuz! X +(C) Comsenz Inc. +https://www.discuz.vip +*/ +* { margin: 0; padding: 0; word-wrap: break-word; } +html, body { border: 0 !important; } +body { background: #FFF; font: {FONTSIZE} {FONT}; font-size: {MSGFONTSIZE}; color: {TABLETEXT}; height: 400px; } +li { list-style-type: disc; margin-left: 2em; } +ol { *margin: 0; padding: 0; } +.litype_1 li, ol li { list-style-type: decimal; } +.litype_2 li { list-style-type: lower-alpha; } +.litype_3 li { list-style-type: upper-alpha; } +a { color: {HIGHLIGHTLINK}; } + a:hover { text-decoration: none; } + a img { border: none; } +hr.l { height: 1px; border: none; background: {COMMONBORDER}; color: {COMMONBORDER}; } +table { empty-cells: show; border-collapse: collapse; } +table td { padding: 4px; border: 1px solid {COMMONBORDER}; } +th { font-weight: 400; } +div.quote, div.blockcode { margin: 10px 0; padding: 10px 10px 10px 65px; } +div.quote { padding-bottom: 5px; background: #F9F9F9 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='28' height='27'%3e%3cpath fill='%23d8e7f2' d='M11 16v10H1V16C1 10 7 1 11 1v5c-2 0-5 6-5 10h5zm16 0v10H17V16c0-6 6-15 10-15v5c-2 0-5 6-5 10h5z'/%3e%3c/svg%3e") no-repeat 20px 6px; } + div.quote blockquote { margin: 0; padding: 0 65px 5px 0; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='28' height='27'%3e%3cpath fill='%23d8e7f2' d='M17 11V1h10v10c0 6-6 15-10 15v-5c2 0 5-6 5-10h-5zM1 11V1h10v10c0 6-6 15-10 15v-5c2 0 5-6 5-10H1z'/%3e%3c/svg%3e") no-repeat 100% 100%; line-height: 1.6em; } +div.blockcode { border: 1px solid #CCC; background: #F7F7F7 url({IMGDIR}/codebg.gif) repeat-y 0 0; } + div.blockcode blockquote { margin: 0; } +.float td { border: 0; padding: 0; } +img { max-width:400px; } \ No newline at end of file diff --git a/template/default/discuz_style_default.xml b/template/default/discuz_style_default.xml new file mode 100644 index 0000000..4c73d02 --- /dev/null +++ b/template/default/discuz_style_default.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/email/add_member.htm b/template/default/email/add_member.htm new file mode 100644 index 0000000..1122063 --- /dev/null +++ b/template/default/email/add_member.htm @@ -0,0 +1,33 @@ + +{lang add_member_subject}
              +{$var['newusername']}{lang comma}{lang show_sender}
              +
              +{lang add_member_intro}
              +{lang show_reason}{lang add_member_reason}
              +
              +----------------------------------------------------------------------
              +{lang important}
              +----------------------------------------------------------------------
              +
              +{lang add_member_no_interest}{lang ignore_email}
              +
              +----------------------------------------------------------------------
              +{lang add_member_info}
              +----------------------------------------------------------------------
              +
              +{lang add_member_bbname}{$var['bbname']}
              +{lang add_member_siteurl}{$var['siteurl']}
              +
              +{lang add_member_newusername}{$var['newusername']}
              +{lang add_member_newpassword}{$var['newpassword']}
              +
              +{lang add_member_can_login}
              +
              +
              +
              +{lang sincerely}
              +
              +{lang admin_team}.
              +{$var['siteurl']} + + \ No newline at end of file diff --git a/template/default/email/adv_expiration.htm b/template/default/email/adv_expiration.htm new file mode 100644 index 0000000..34fa7bd --- /dev/null +++ b/template/default/email/adv_expiration.htm @@ -0,0 +1,6 @@ + +{$subject}
              +{lang adv_expiration_msg}

              +{$var['advs']} + + \ No newline at end of file diff --git a/template/default/email/birthday.htm b/template/default/email/birthday.htm new file mode 100644 index 0000000..afbac7b --- /dev/null +++ b/template/default/email/birthday.htm @@ -0,0 +1,16 @@ + +{lang birthday_subject}
              +{$var['username']}{lang comma}
              +{lang show_sender}
              +
              +{lang show_reason}{lang birthday_reason}
              +
              +{lang birthday_if_not}{lang ignore_email}
              +
              +
              +{lang sincerely}
              +
              +{lang admin_team}.
              +{$var['siteurl']} + + \ No newline at end of file diff --git a/template/default/email/default.htm b/template/default/email/default.htm new file mode 100644 index 0000000..9fb3156 --- /dev/null +++ b/template/default/email/default.htm @@ -0,0 +1,6 @@ + + +$subject
              +$message + + \ No newline at end of file diff --git a/template/default/email/email_register.htm b/template/default/email/email_register.htm new file mode 100644 index 0000000..0e33782 --- /dev/null +++ b/template/default/email/email_register.htm @@ -0,0 +1,29 @@ + +{lang email_register_subject}
              +

              {lang show_sender}

              + +

              {lang show_reason}{lang email_register_reason} +{lang have_not_visit}{lang have_not_do_this}{lang ignore_email}{lang no_more_action}

              +
              +----------------------------------------------------------------------
              +{lang email_register_explain}
              +----------------------------------------------------------------------
              +
              +

              {lang email_verify_explain2}

              + +

              {lang email_register_click_link}
              + +{$var['url']} +
              +({lang if_not_link})

              + +

              {lang thanks_for_visit}

              + + +

              +{lang sincerely}
              + +{lang admin_team}.
              +{$var['siteurl']}

              + + \ No newline at end of file diff --git a/template/default/email/email_reset.htm b/template/default/email/email_reset.htm new file mode 100644 index 0000000..f40088c --- /dev/null +++ b/template/default/email/email_reset.htm @@ -0,0 +1,22 @@ + + + {lang email_reset_subject} +
              +

              {$var['username']}{lang comma}{lang show_sender}

              +

              {lang show_reason}{lang email_reset_reason}

              +

              ----------------------------------------------------------------------
              + {lang important} +
              ----------------------------------------------------------------------

              +

              {lang email_reset_if_not}

              +

              ----------------------------------------------------------------------
              + {lang email_reset_subject} +
              ----------------------------------------------------------------------

              +

              {lang email_reset_explain}

              +

              {lang email_reset_new_email}

              +

              {lang email_reset_if_not_user_op}

              +

              {lang email_reset_if_not_user_op_help}

              +

              {lang show_ip}

              +

              {lang sincerely}

              +

              {lang admin_team}. {$var['siteurl']}

              + + \ No newline at end of file diff --git a/template/default/email/email_to_friend.htm b/template/default/email/email_to_friend.htm new file mode 100644 index 0000000..9e34b8d --- /dev/null +++ b/template/default/email/email_to_friend.htm @@ -0,0 +1,24 @@ + +{lang email_to_friend_subject}
              +{lang email_to_friend_sender}
              +
              +{lang show_reason}{lang email_to_friend_reason}
              +{lang not_interested}{lang ignore_email}{lang no_more_action}
              +
              +----------------------------------------------------------------------
              +{lang msg_start}
              +----------------------------------------------------------------------
              +
              +{$var['message']}
              +
              +----------------------------------------------------------------------
              +{lang msg_end}
              +----------------------------------------------------------------------
              +
              +{lang email_to_friend_not_official}
              +{lang not_responsible}
              +
              +{lang welcome_visit}
              +{$_G['siteurl']} + + \ No newline at end of file diff --git a/template/default/email/email_to_invite.htm b/template/default/email/email_to_invite.htm new file mode 100644 index 0000000..af589e3 --- /dev/null +++ b/template/default/email/email_to_invite.htm @@ -0,0 +1,25 @@ + +{lang email_to_invite_subject}
              +{$var['sendtoname']}{lang comma}
              +{lang email_to_friend_sender}
              +
              +{lang show_reason}{lang email_to_invite_reason}
              +{lang not_interested}{lang ignore_email}{lang no_more_action}
              +
              +----------------------------------------------------------------------
              +{lang msg_start}
              +----------------------------------------------------------------------
              +
              +{$var['message']}
              +
              +----------------------------------------------------------------------
              +{lang msg_end}
              +----------------------------------------------------------------------
              +
              +{lang email_to_invite_not_official}
              +{lang not_responsible}
              +
              +{lang welcome_visit}
              +{$_G[\'siteurl\']} + + \ No newline at end of file diff --git a/template/default/email/email_verify.htm b/template/default/email/email_verify.htm new file mode 100644 index 0000000..802c142 --- /dev/null +++ b/template/default/email/email_verify.htm @@ -0,0 +1,30 @@ + + +{lang email_verify_subject}
              +

              {$var['username']}{lang comma}{lang show_sender}

              + +

              {lang show_reason}{lang email_verify_reason} +{lang have_not_visit}{lang have_not_do_this}{lang ignore_email}{lang no_more_action}

              +
              +----------------------------------------------------------------------
              +{lang email_verify_explain}
              +----------------------------------------------------------------------
              +
              +

              {lang email_verify_explain2}

              + +

              {lang email_verify_click_link}
              + +{$var['url']} +
              +({lang if_not_link})

              + +

              {lang thanks_for_visit}

              + + +

              +{lang sincerely}
              + +{lang admin_team}.
              +{$var['siteurl']}

              + + \ No newline at end of file diff --git a/template/default/email/footer.htm b/template/default/email/footer.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/email/get_passwd.htm b/template/default/email/get_passwd.htm new file mode 100644 index 0000000..dec9086 --- /dev/null +++ b/template/default/email/get_passwd.htm @@ -0,0 +1,35 @@ + + +{lang get_passwd_subject}
              +

              {$var['username']}{lang comma}{lang show_sender}

              + +

              {lang show_reason}{lang get_passwd_reason}

              +

              +----------------------------------------------------------------------
              +{lang important}
              +----------------------------------------------------------------------

              + +

              {lang get_passwd_if_not}

              +

              +----------------------------------------------------------------------
              +{lang get_passwd_explain}
              +----------------------------------------------------------------------

              +

              +{lang get_passwd_click_link}
              + +{$var['siteurl']}member.php?mod=getpasswd&uid={$var['uid']}&id={$var['idstring']}&sign={$var['sign']} +
              +({lang if_not_link})

              + +

              {lang get_passwd_new_pwd}

              + +

              {lang show_ip}

              + + +

              +{lang sincerely}
              +

              +

              {lang admin_team}. +{$var['siteurl']}

              + + \ No newline at end of file diff --git a/template/default/email/header.htm b/template/default/email/header.htm new file mode 100644 index 0000000..fb97dfb --- /dev/null +++ b/template/default/email/header.htm @@ -0,0 +1,8 @@ + + + + + + +$subject + \ No newline at end of file diff --git a/template/default/email/index.htm b/template/default/email/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/email/invitemail.htm b/template/default/email/invitemail.htm new file mode 100644 index 0000000..eeaca81 --- /dev/null +++ b/template/default/email/invitemail.htm @@ -0,0 +1,20 @@ + + +$subject
              + + + +
              {$var['avatar']} +

              {lang invitemail_from}


              +{lang invitemail_reason}
              +
              +{lang invitemail_start}
              {$var['saymsg']} +

              +{lang invitemail_accept_invite}
              +{$var['inviteurl']}
              +
              +{lang invitemail_viewpage}
              +{$var['siteurl']}home.php?mod=space&uid={$var['uid']}
              +
              + + \ No newline at end of file diff --git a/template/default/email/moderate_member.htm b/template/default/email/moderate_member.htm new file mode 100644 index 0000000..fc4f600 --- /dev/null +++ b/template/default/email/moderate_member.htm @@ -0,0 +1,39 @@ + +{lang moderate_member_subject}
              +

              {$var['username']}{lang comma}{lang show_sender}

              + +

              {lang show_reason}{lang moderate_member_reason}

              +
              +----------------------------------------------------------------------
              +{lang moderate_member_info}
              +----------------------------------------------------------------------
              +
              +{lang moderate_member_username}{$var['username']}
              +{lang moderate_member_regdate}{$var['regdate']}
              +{lang moderate_member_submitdate}{$var['submitdate']}
              +{lang moderate_member_submittimes}{$var['submittimes']}
              +{lang moderate_member_msg}{$var['message']}
              +
              +{lang moderate_member_modresult}{$var['modresult']}
              +{lang moderate_member_moddate}{$var['moddate']}
              +{lang moderate_member_adminusername}{$var['adminusername']}
              +{lang moderate_member_remark}{$var['remark']}
              +
              +----------------------------------------------------------------------
              +{lang moderate_member_explain}
              +----------------------------------------------------------------------
              + +

              {lang moderate_member_explain1}

              + +

              {lang moderate_member_explain2}

              + +

              {lang moderate_member_explain3}

              + +
              +
              +{lang sincerely}
              +
              +{lang admin_team}.
              +{$var['siteurl']} + + \ No newline at end of file diff --git a/template/default/email/password_reset.htm b/template/default/email/password_reset.htm new file mode 100644 index 0000000..f52fc24 --- /dev/null +++ b/template/default/email/password_reset.htm @@ -0,0 +1,21 @@ + + + {lang password_reset_subject} +
              +

              {$var['username']}{lang comma}{lang show_sender}

              +

              {lang show_reason}{lang password_reset_reason}

              +

              ----------------------------------------------------------------------
              + {lang important} +
              ----------------------------------------------------------------------

              +

              {lang password_reset_if_not}

              +

              ----------------------------------------------------------------------
              + {lang password_reset_subject} +
              ----------------------------------------------------------------------

              +

              {lang password_reset_explain}

              +

              {lang password_reset_if_not_user_op}

              +

              {lang password_reset_if_not_user_op_help}

              +

              {lang show_ip}

              +

              {lang sincerely}

              +

              {lang admin_team}. {$var['siteurl']}

              + + \ No newline at end of file diff --git a/template/default/email/secmobile_reset.htm b/template/default/email/secmobile_reset.htm new file mode 100644 index 0000000..636a79c --- /dev/null +++ b/template/default/email/secmobile_reset.htm @@ -0,0 +1,22 @@ + + + {lang secmobile_reset_subject} +
              +

              {$var['username']}{lang comma}{lang show_sender}

              +

              {lang show_reason}{lang secmobile_reset_reason}

              +

              ----------------------------------------------------------------------
              + {lang important} +
              ----------------------------------------------------------------------

              +

              {lang secmobile_reset_if_not}

              +

              ----------------------------------------------------------------------
              + {lang secmobile_reset_subject} +
              ----------------------------------------------------------------------

              +

              {lang secmobile_reset_explain}

              +

              {lang secmobile_reset_new_secmobile}

              +

              {lang secmobile_reset_if_not_user_op}

              +

              {lang secmobile_reset_if_not_user_op_help}

              +

              {lang show_ip}

              +

              {lang sincerely}

              +

              {lang admin_team}. {$var['siteurl']}

              + + \ No newline at end of file diff --git a/template/default/forum/activity_applist_more.htm b/template/default/forum/activity_applist_more.htm new file mode 100644 index 0000000..98179aa --- /dev/null +++ b/template/default/forum/activity_applist_more.htm @@ -0,0 +1,30 @@ + + +

              {lang activity_new_join} ($activity[applynumber] {lang activity_member_unit})

              + + + + + + + + + + + + + + + + + + + +
               {lang leaveword}{lang activity_payment}{lang activity_jointime}
              + + $apply[username] +

              $apply[message]

              $apply[payment] {lang payment_unit}{lang activity_self}$apply[dateline]
              + +
              +
              $multi
              + \ No newline at end of file diff --git a/template/default/forum/activity_applylist.htm b/template/default/forum/activity_applylist.htm new file mode 100644 index 0000000..bfdc050 --- /dev/null +++ b/template/default/forum/activity_applylist.htm @@ -0,0 +1,108 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +
              +

              + {lang activity_applylist_manage}{lang activity_applylist} + + {lang close} + +

              + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
               {lang activity_join_members}{lang leaveword}{lang extension_project}{lang activity_payment}{lang activity_jointime}{lang status}
              + + + + + + + $apply[username] + + + + $apply[message] + + + + + {lang no_informations} + + $apply[payment] {lang payment_unit}{lang activity_self}$apply[dateline] + {lang activity_allow_join} + + {lang activity_do_replenish} + + {lang activity_cant_audit} + +
              +
              +
              + +
              + {lang checkall} + + + + + +
              + +
              + + + + + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/activity_export.htm b/template/default/forum/activity_export.htm new file mode 100644 index 0000000..522ffc8 --- /dev/null +++ b/template/default/forum/activity_export.htm @@ -0,0 +1,24 @@ +$activity[class]: $thread[subject] + +{lang activity_starttime}: {lang activity_start_between}$activity[starttimefrom] + +{lang activity_space}: $activity[place] + + +{lang activity_payment}: $activity[cost] {lang payment_unit} + + +{lang gender}: {lang male}{lang female}{lang unlimited} + +{lang activity_totime}: $activity[expiration] + +{lang activity_already}: $applynumbers {lang activity_member_unit} + +{lang activity_content}: "$activity[message]" + +{lang activity_join_members},{lang leaveword},{lang activity_payment},{lang activity_jointime},{lang status}$ufield + + + $apply[username],$apply[message],$apply[payment] {lang payment_unit}{lang activity_self},$apply[dateline],{lang activity_allow_join}{lang activity_cant_audit}$apply[fielddata] + + \ No newline at end of file diff --git a/template/default/forum/ajax.htm b/template/default/forum/ajax.htm new file mode 100644 index 0000000..5325e69 --- /dev/null +++ b/template/default/forum/ajax.htm @@ -0,0 +1,82 @@ + + +
              +

              + {lang quickclear} + + {lang close} + +

              +
              + + + + + + +
              + +
                +
              • +
              • +
              • +
              +
              + +
              {lang quickclear_crime_avatar_nums}
              + + +
              {lang quickclear_crime_sightml_nums}
              + + +
              {lang quickclear_crime_customstatus_nums}
              + +
              +

              ^{lang admin_reason}:

              +

              + +

              +

              +
              + +
              +

              + + +

              +
              +
              + +
              +

              + $navtitle + + {lang close} + +

              +
              + + + + +
              + +
                + +
              • + + +
              • + +
              + + $closeprompt + +
              +

              + +

              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/ajax_albumlist.htm b/template/default/forum/ajax_albumlist.htm new file mode 100644 index 0000000..c75edc9 --- /dev/null +++ b/template/default/forum/ajax_albumlist.htm @@ -0,0 +1,15 @@ + + + + + + + + + + +
              + +
              +
              $multi
              + \ No newline at end of file diff --git a/template/default/forum/ajax_attachlist.htm b/template/default/forum/ajax_attachlist.htm new file mode 100644 index 0000000..3a8cd3d --- /dev/null +++ b/template/default/forum/ajax_attachlist.htm @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + +
              +

              + $attach[filetype] {$attach[filename]} + + + + + +   + {lang update} + +

              + + + + + + + + + +
              + + + + {lang e_attach_del}
              + + + \ No newline at end of file diff --git a/template/default/forum/ajax_followpost.htm b/template/default/forum/ajax_followpost.htm new file mode 100644 index 0000000..4a387f9 --- /dev/null +++ b/template/default/forum/ajax_followpost.htm @@ -0,0 +1,48 @@ + + + + + $post['message'] + +
              + + +
              +
              + + +
              + $feed['note'] +
              + +
              + + + + + + $post['author']:$post['message'] + + \ No newline at end of file diff --git a/template/default/forum/ajax_forumlist.htm b/template/default/forum/ajax_forumlist.htm new file mode 100644 index 0000000..3965011 --- /dev/null +++ b/template/default/forum/ajax_forumlist.htm @@ -0,0 +1,45 @@ + +
              +
              {lang search_forum}:
              + +
              + + diff --git a/template/default/forum/ajax_imagelist.htm b/template/default/forum/ajax_imagelist.htm new file mode 100644 index 0000000..aef9ee6 --- /dev/null +++ b/template/default/forum/ajax_imagelist.htm @@ -0,0 +1,47 @@ + + + + + + + + + + + + + +
              + + +

              + +   + {lang update} + | + + {lang e_attach_del} +

              +

              + + + + + + +

              + +

              + +
              + + + + + \ No newline at end of file diff --git a/template/default/forum/ajax_quickreply.htm b/template/default/forum/ajax_quickreply.htm new file mode 100644 index 0000000..300e7be --- /dev/null +++ b/template/default/forum/ajax_quickreply.htm @@ -0,0 +1,52 @@ + + +
              + + + + + + + + + + +
              + +
              +
              + +
              + + + + \ No newline at end of file diff --git a/template/default/forum/ajax_secondgroup.htm b/template/default/forum/ajax_secondgroup.htm new file mode 100644 index 0000000..d317e96 --- /dev/null +++ b/template/default/forum/ajax_secondgroup.htm @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/template/default/forum/ajax_threadlist.htm b/template/default/forum/ajax_threadlist.htm new file mode 100644 index 0000000..9eda071 --- /dev/null +++ b/template/default/forum/ajax_threadlist.htm @@ -0,0 +1,35 @@ + + + \ No newline at end of file diff --git a/template/default/forum/announcement.htm b/template/default/forum/announcement.htm new file mode 100644 index 0000000..6a31fe8 --- /dev/null +++ b/template/default/forum/announcement.htm @@ -0,0 +1,53 @@ + + + +
              +
              + $_G['setting']['bbname'] + {lang announcement} +
              +
              +
              +
              +
              +
              + +
              +

              $ann[subject]($ann[starttime])

              + +
              + + +
              +
              +
              +
              +

              {lang announcement}

              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/attachpay.htm b/template/default/forum/attachpay.htm new file mode 100644 index 0000000..a3f7cae --- /dev/null +++ b/template/default/forum/attachpay.htm @@ -0,0 +1,85 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +
              +

              + {lang pay_attachment} + + {lang close} + +

              + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang author}$attach['author']$attach['author']
              {lang attachment}
              $attach[filename] ($attach[description])
              {lang price}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$attach[price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
              {lang pay_author_income}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$attach[netprice] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
              {lang pay_balance}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$balance {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
               {lang status_insufficient}
               {lang status_download}, {lang download}
              +
              +
              + + + + + +
              +
              +
              + + + + + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/attachpay_view.htm b/template/default/forum/attachpay_view.htm new file mode 100644 index 0000000..6385f97 --- /dev/null +++ b/template/default/forum/attachpay_view.htm @@ -0,0 +1,46 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +

              + {lang pay_view} + + {lang close} + +

              + +
              + + + + + + + + + + + + + + + + + +
              {lang username}{lang time}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}
              $log[username]$log[dateline]{$log[$extcreditname]} {$_G[setting][extcredits][$_G[setting][creditstransextra][1]][unit]}
              {lang attachment_buy_not}
              +
              +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/collection_add.htm b/template/default/forum/collection_add.htm new file mode 100644 index 0000000..c1fe39f --- /dev/null +++ b/template/default/forum/collection_add.htm @@ -0,0 +1,76 @@ + +
              +
              + $_G[setting][bbname] + {lang collection} + + {$_G['collection']['name']} + {lang collection_edit} + + {lang collection_create} + +
              +
              + +
              +
              +
              +

              + + {lang collection_edit} + + {lang collection_create} + +

              +
              +
              +
              + + + + + + + + + + + + + + + + + +
              {lang collection_title}
              {lang collection_desc}
              {lang collection_keywords} + +

              {lang collection_keywords_desc}

              +
              + + + + + + + {lang collection_remain_tips} + +
              +
              +
              +
              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_all.htm b/template/default/forum/collection_all.htm new file mode 100644 index 0000000..4d4bf8c --- /dev/null +++ b/template/default/forum/collection_all.htm @@ -0,0 +1,45 @@ + + + +
              +
              +
              + +
              + +
              + + + +
              +
              + $multipage +

              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_comment.htm b/template/default/forum/collection_comment.htm new file mode 100644 index 0000000..4e5c5be --- /dev/null +++ b/template/default/forum/collection_comment.htm @@ -0,0 +1,122 @@ + +
              +
              + $_G[setting][bbname] + {lang collection} + {$_G['collection']['name']} + {lang collection_commentlist} +
              +
              + + + +
              +
              + +
              +
              + +   +  {lang collection_totalrates} + + {lang collection_norate} + +
              +
              {$_G['collection']['desc']}
              +
              +
              + + +
              + +
              + + +
              + +
              +
              +
              + + + + $comment[username] + $comment[dateline] +
              + +
               
              + +
              $comment[message]
              +
              + +
              + +
              + + + + + + $multipage +
              +
              + +
              +
              + + + +
              +
              +
              +

              {lang collection_ratecollection}

              +
              +
              + +
              + + + + 1 + 2 + 3 + 4 + 5 + + + +
              + +
              + +
              +
              +
              + +
              + {lang collection_rated}  + +
              + +
              +
              + + + +
              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_commentpop.htm b/template/default/forum/collection_commentpop.htm new file mode 100644 index 0000000..9bfbf7e --- /dev/null +++ b/template/default/forum/collection_commentpop.htm @@ -0,0 +1,15 @@ + +

              + {lang collection_comment_thread} + {lang close} +

              +
              +
              + +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_followers.htm b/template/default/forum/collection_followers.htm new file mode 100644 index 0000000..6bc5fc8 --- /dev/null +++ b/template/default/forum/collection_followers.htm @@ -0,0 +1,61 @@ + +
              +
              + $_G[setting][bbname] + {lang collection} + {$_G['collection']['name']} + {lang collection_followlist} +
              +
              + + + +
              +
              + +
              +
              + +   +  {lang collection_totalrates} + + {lang collection_norate} + +
              +
              {$_G['collection']['desc']}
              +
              +
              + +
              + + +
              + +
              + +

              {lang no_content}

              + +
              $multipage
              +
              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_index.htm b/template/default/forum/collection_index.htm new file mode 100644 index 0000000..60f8240 --- /dev/null +++ b/template/default/forum/collection_index.htm @@ -0,0 +1,24 @@ + + + +
              +
              +
              + +
              +
              + + + +
              +
              + $multipage +

              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_invite.htm b/template/default/forum/collection_invite.htm new file mode 100644 index 0000000..735cec9 --- /dev/null +++ b/template/default/forum/collection_invite.htm @@ -0,0 +1,83 @@ + +

              +{lang collection_invite} +{lang close} +

              + +
              +
              + + + + + +
              + + + +
              +
              +
              + {lang collection_max_invite} + + +
              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_list.htm b/template/default/forum/collection_list.htm new file mode 100644 index 0000000..bb068b8 --- /dev/null +++ b/template/default/forum/collection_list.htm @@ -0,0 +1,59 @@ + +
              + +
              +
              +
              + + 999999}style="font-size: 10px;"{/if}>{$collectionvalues['displaynum']} + {lang collection_commentnum}{lang collection_follow}{lang collection_threadnum} + +
              +
              + + + {lang collection_mycreate} + + {lang collection_myteam} + + {lang collection_mysubscribe} + + +
              + {$collectionvalues['name']} + + + + + {if $keycount}, {/if}$unique_keyword + + + + +
              +
              +
              +

              {$collectionvalues['shortdesc']}

              +

              + + {lang collection_follow} {$collectionvalues['follownum']}, {lang collection_threadnum} {$collectionvalues['threadnum']} + + {lang collection_threadnum} {$collectionvalues['threadnum']}, {lang collection_commentnum} {$collectionvalues['commentnum']} + + {lang collection_follow} {$collectionvalues['follownum']}, {lang collection_commentnum} {$collectionvalues['commentnum']} + +

              +

              {$collectionvalues['username']} {lang collection_createtime}, {lang collection_lastupdate} {$collectionvalues['lastupdate']}

              +

              + + {lang collection_lastthread} {$collectionvalues['lastsubject']} + +

              +
              +
              +
              + +
              + +
              {lang collection_nocollection}
              + diff --git a/template/default/forum/collection_mycollection.htm b/template/default/forum/collection_mycollection.htm new file mode 100644 index 0000000..6130153 --- /dev/null +++ b/template/default/forum/collection_mycollection.htm @@ -0,0 +1,22 @@ + + + +
              +
              +
              + +
              +
              + + + +
              +
              +
              + \ No newline at end of file diff --git a/template/default/forum/collection_nav.htm b/template/default/forum/collection_nav.htm new file mode 100644 index 0000000..caefbfc --- /dev/null +++ b/template/default/forum/collection_nav.htm @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/template/default/forum/collection_recommend.htm b/template/default/forum/collection_recommend.htm new file mode 100644 index 0000000..9e915a7 --- /dev/null +++ b/template/default/forum/collection_recommend.htm @@ -0,0 +1,18 @@ + +

              + {lang collection_recommend} + {lang close} +

              +
              +
              + {lang collection_recommend_thread_url} + +
              +
              + +
              + + + +
              + \ No newline at end of file diff --git a/template/default/forum/collection_select.htm b/template/default/forum/collection_select.htm new file mode 100644 index 0000000..f75a29c --- /dev/null +++ b/template/default/forum/collection_select.htm @@ -0,0 +1,127 @@ + +

              + {lang collection} + {lang close} +

              + +
              +
              +
              0 && count($allowcollections) <= 0}style="display:none;"{/if}> +

              {lang collection_select}

              + +
              +
              + {lang collection_select_nocollection} +
              {lang collection_select_remain} {lang collection_create}
              +
              + +
              +

              {lang collection_addreason}

              + +
              +
              +
              + {lang collection_view_mine} + + + + + + + + + + + + +
              +
              +
              +
              + + + + +
              +
              + + + + + \ No newline at end of file diff --git a/template/default/forum/collection_view.htm b/template/default/forum/collection_view.htm new file mode 100644 index 0000000..a01d068 --- /dev/null +++ b/template/default/forum/collection_view.htm @@ -0,0 +1,381 @@ + +
              +
              + $_G[setting][bbname] + {lang collection} + + {$_G['collection']['name']} + + {$_G['collection']['name']} + {lang collection_cloud_link} + +
              +
              + + + + +
              +
              +
              +
              +

              + {$_G['collection']['name']} +

              +
              + {$_G['collection']['follownum']} + + + {lang collection_follow} + + {lang collection_unfollow} + + + {lang collection_follow} + +
              +
              +
              +
              + +
              + +   +  {lang collection_totalrates} + + {lang collection_norate} + +
              +
              +
              + +

              + {lang collection_keywords} + + $unique_keyword  + +

              + +

              + {lang collection_creator}{$_G['collection']['username']} + + | + {lang collection_teamworkers} + + + {$collectionworker['username']}  + + [{lang delete}]  + + + + +

              +
              +
              {$_G['collection']['desc']}
              +
              +
              + + +
              + + +
              + +
              + + + + + + + + + +
               {lang collection_thread}{lang author}{lang replies}{lang lastpost}
              +
              + +
              + + + + + + + + + $thread['cutsubject'] + - [{lang readperm} $thread[readperm]] + + + - [{lang thread_reward} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][title]}] + + - [{lang price} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]}] + + + - [{lang reward_solved}] + + + + + + + + {lang thread_digest}$thread[digest] + + + + + + + +
              + + + + + + + + + + + + + + + + + + + $thread[author] + + {$_G['setting']['anonymoustext']} + + + $thread[dateline] + + $thread[replies] + $thread[views] + + $thread[lastposter]$_G[setting][anonymoustext] + $thread[lastpost] +
              +
              + + +
              + + + + +
              +
              + + +
              + + {lang collection_cloud_search} + + {lang no_content} + +
              + + + +
              +
              $multipage

              + + + + + +
              +
              + {lang collection_allcomment} +

              {lang collection_newcomment}

              +
              +
              + +
              + $comment[username] + $comment[dateline]: +
              +
              + $comment[message]

              + +
              + +
              + +
              +
              + + + +
              +
              +
              +

              {lang collection_ratecollection}

              +
              +
              + +
              + + + + 1 + 2 + 3 + 4 + 5 + + + +
              + +
              + +
              +
              +
              + +
              + {lang collection_rated}  + +
              + + + +
              +
              + + + +
              +
              +
              + + + + + + +
              +

              {$_G['collection']['threadnum']}

              {lang collection_threadnum} +
              +

              {$_G['collection']['commentnum']}

              {lang collection_commentnum} +
              +

              {$_G['collection']['follownum']}

              {lang collection_follow} +
              +
              + + +
              +
              + {lang collection_allfollowers} +

              {lang collection_newfollowers}

              +
              +
              + +
              +
              + + + +
              +
              +

              {lang collection_creators}

              +
              +
              + + +
              + {lang collection_threadnum} $ucollection[threadnum], {lang collection_follow} $ucollection[follownum], {lang collection_commentnum} $ucollection[commentnum] +
              + +
              +
              + + +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/comment.htm b/template/default/forum/comment.htm new file mode 100644 index 0000000..0425c0d --- /dev/null +++ b/template/default/forum/comment.htm @@ -0,0 +1,80 @@ + + +
              +
              +
              + + +
              +
              +

              + {lang comments} + + {lang close} + +

              + + +
              +
              +
              + + + +
              +
              + +
              + +
              +
              + + + +
              +
              +
              +
              + + {lang comment_message1} 200 {lang comment_message2} +
              +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/comment_more.htm b/template/default/forum/comment_more.htm new file mode 100644 index 0000000..d5fdee6 --- /dev/null +++ b/template/default/forum/comment_more.htm @@ -0,0 +1,31 @@ + + +

              {lang comments}

              +
              $totalcomment
              + +
              +
              + $comment[avatar]  + + $comment[author] + + {lang guest} + +
              +
              +  $comment[comment]  + + {lang detail} + {lang reply} + + + {lang poston} $comment[dateline] +  IP:$comment[useip]{if $comment[port]}:$comment[port]{/if} +  {lang delete} + +
              +
              + + +
              $multi
              + \ No newline at end of file diff --git a/template/default/forum/darkroom.htm b/template/default/forum/darkroom.htm new file mode 100644 index 0000000..00b62e5 --- /dev/null +++ b/template/default/forum/darkroom.htm @@ -0,0 +1,85 @@ + + + +
              + + + + + + + + + + + + + + + + + + + + +
              {lang username}{lang crime_action}{lang expire_dateline}{lang crime_dateline}{lang crime_reason}
              $crime[username]$crime[action]$crime[groupexpiry]$crime[dateline]$crime[reason]
              + + + + + + {lang darkroom_no_users} + + + +
              + + + + diff --git a/template/default/forum/debate_umpire.htm b/template/default/forum/debate_umpire.htm new file mode 100644 index 0000000..c87421b --- /dev/null +++ b/template/default/forum/debate_umpire.htm @@ -0,0 +1,80 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +
              +

              + {lang debate_umpirecomment} + + {lang close} + +

              + + + +
              + + + + + + + + + + + + + + + +
              {lang debate_winner} + + + +
              +

              + +

              +

              +

              {lang debate_list_nonexistence}

              +
              +
              +
              +
              + +
              +
              + + + + + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/discuz.htm b/template/default/forum/discuz.htm new file mode 100644 index 0000000..8f80444 --- /dev/null +++ b/template/default/forum/discuz.htm @@ -0,0 +1,598 @@ + + + +
              + +
              +
              +
              +
              {lang announcements}: 
              +
              +
                $announcements
              +
              +
              +
              + +
              + + +
              +
              + + + + + + + + + +
              +
              +
              + + +
              + +
              +

              {lang index_today}: $todayposts|{lang index_yesterday}: $postdata[0]|{lang index_posts}: $posts|{lang index_members}: $_G['cache']['userstats']['totalmembers']|{lang welcome_new_members}: $_G['cache']['userstats']['newsetuser']

              + +
              + +
              +
              + + + +
              +
              +
              + + + + + + + + + + +
              +
              +

              {lang latest_images}

              + + + + + +
              + + +
              +
              +
              +
              +

              {lang collection_lastthread}

              + +
              +
              +
              +

              {lang show_newthreads}

              + +
              +
              +
              +

              {lang hot_thread}

              + +
              +
              +
              +

              {lang post_digest_thread}

              + +
              +
              +
              +
              +
              + + + + +
              +
              +

              {lang hotthreads_forum}

              +
              +
              +
              + +
              +
              delete + $data[subject]
              +
              $data[message]
              +
              + +
              + +
              +
              + + + +
              + + + + + + + +
              + +
              + + + + + + + + + + + + + + + + +
              +
              + +
              +
              +
              $colletion[name]
              +
              {lang forum_threads}: , {lang collection_commentnum}:
              +
              + + + $colletion['lastposter']$_G[setting][anonymoustext] + + {lang forum_lastpost}: + + + {lang never} + +
              + +
              +
              + +
              +
              + + + + + + + + +
              +
              + + + +

              {lang forum_myfav}

              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +
              + + $forum[icon] + + + +
              + +
              $forum[name] ($forum[todayposts])
              +
              {lang forum_threads}: , {lang forum_posts}:
              +
              + + {lang private_forum} + + + {lang url_link} + + + $forum[lastpost][dateline] $forum['lastpost']['author']$_G[setting][anonymoustext] + + {lang forum_lastpost}: $forum[lastpost][dateline] + + + {lang never} + + +
              + + +
              + + $forum[icon] + + + + +

              $forum[name] ($forum[todayposts])

              +

              $forum[description]

              +

              {lang forum_subforums}: $forumlist[$forum['fid']]['subforums']

              +

              {lang forum_moderators}: $forum[moderators]

              + +
              + / + +
              + + {lang private_forum} + + + {lang url_link} + + $forum[lastpost][dateline] $forum['lastpost']['author']$_G[setting][anonymoustext] + + {lang never} + + +
              +
              + +
              +
              + + + + +
              +
              + + + + {lang forum_category_modedby}: $cat[moderators] + +

              $cat[name]

              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + {$cat['endrows'] or ''} + +
              +
              + + $forum[icon] + + + +
              + +
              $forum[name] ($forum[todayposts])
              +
              {lang forum_threads}: , {lang forum_posts}:
              +
              + + {lang private_forum} + + + {lang url_link} + + + $forum[lastpost][dateline] $forum['lastpost']['author']$_G[setting][anonymoustext] + + {lang forum_lastpost}: $forum[lastpost][dateline] + + + {lang never} + + +
              + + +
              + + $forum[icon] + + + + +

              $forum[name] ($forum[todayposts])

              +

              $forum[description]

              +

              {lang forum_subforums}: $forum['subforums']

              +

              {lang forum_moderators}: $forum[moderators]

              + +
              + / + +
              + + {lang private_forum} + + + {lang url_link} + + $forum[lastpost][dateline] $forum['lastpost']['author']$_G[setting][anonymoustext] + + {lang never} + + +
              +
              +
              +
              + + + + + + + + + +
              + +
              + + + + + + + + + + + + + + + + +
              +
              + +
              +
              +
              $colletion[name]
              +
              {lang forum_threads}: , {lang collection_commentnum}:
              +
              + + + $colletion['lastposter']$_G[setting][anonymoustext] + + {lang forum_lastpost}: + + + {lang never} + +
              + +
              +
              + +
              +
              + + + +
              + + +
              +
              +
              + + +
              +
              + + +

              + {lang onlinemember} + - $onlinenum {lang onlines} + - $membercount {lang index_members}($invisiblecount {lang index_invisibles}), + $guestcount {lang index_guests} + - {lang index_mostonlines} $onlineinfo[0] {lang on} $onlineinfo[1]. +

              + + + + +

              + + + {lang onlinemember} + + {lang onlinemember} + + + - {lang total} $onlinenum {lang onlines} + - $membercount {lang index_members},$guestcount {lang index_guests} + - {lang index_mostonlines} $onlineinfo[0] {lang on} $onlineinfo[1]. +

              + +
              + +
              +
              $_G[cache][onlinelist][legend]
              + +
              +
                + + +
              • + icon + + $online[username] + + $online[username] + +
              • + + +
              • {lang online_only_guests}
              • + +
              +
              + +
              + +
              + + + +
              +
              + +
                $_G['cache']['forumlinks'][0]
              + + +
              + $_G['cache']['forumlinks'][1] +
              + + +
                + $_G['cache']['forumlinks'][2] +
              + +
              +
              + + + +
              + + +
              + +
              +
              +
              + +
              + +
              + + + diff --git a/template/default/forum/discuzcode.htm b/template/default/forum/discuzcode.htm new file mode 100644 index 0000000..f6b3e15 --- /dev/null +++ b/template/default/forum/discuzcode.htm @@ -0,0 +1,332 @@ + + + +
              {$_G[username]}{lang guest}{lang post_hide_credits_hidden}
              + + + +
              {lang post_hide_credits}
              +$message

              + + + + +
              1. $code
              {lang discuzcode_copyclipboard}
              + + + +
              \\1
              + + + +
              \\1
              + + + +

              {lang post_hide}

              \\1
              + + + + +
              {$_G[username]}{lang guest}{lang post_hide_reply_hidden}
              + + + + + +
              +
              + $attach[attachicon] +
              +
              +

              + + $attach[filename] + + $attach[filename] + +

              +

              +

              $attach[attachsize], {lang readperm}: $attach[readperm], {lang downloads}: $attach['downloads'], {lang attachcredits}: $_G[getattachcredits]

              +

              + + {lang price}: $attach[price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}  [{lang pay_view}] + +  [{lang attachment_buy}] + + +

              +

              {$attach[description]}

              + $pluginhook +
              +
              +
              + + + + + + + + +
              +
              +
              + +

              + $attach[filename] + ($attach[attachsize], {lang downloads}: $attach['downloads']) +

              + +

              + {lang readperm}: $attach[readperm] + {lang price}: $attach[price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}  [{lang pay_view}] + +  [{lang attachment_buy}] + + +

              +

              {$attach[description]}

              + + $pluginhook + + + + + {$guestviewthumbcss} + + +
              + + $attach[imgalt] + + $attach[imgalt] + +
              + +
              +
              + +
              + +
              +

              {$attach[description]}

              + $attach[imgalt] +
              + +
              + +
              + + + + + + + + + + + + + + {$guestviewthumbcss} +
              + +
              + + + + + + + + + +
              + + +
              +
              + + + + + + + diff --git a/template/default/forum/editor_menu_forum.htm b/template/default/forum/editor_menu_forum.htm new file mode 100644 index 0000000..cdd01a3 --- /dev/null +++ b/template/default/forum/editor_menu_forum.htm @@ -0,0 +1,397 @@ +{$_G['setting']['extcredits'][$id][title]} +$credit$credit {$_G['setting']['extcredits'][$id][unit]}   + + + + + + + + + + + + diff --git a/template/default/forum/forumdisplay.htm b/template/default/forum/forumdisplay.htm new file mode 100644 index 0000000..7f43ccf --- /dev/null +++ b/template/default/forum/forumdisplay.htm @@ -0,0 +1,580 @@ + + + + + + +
              + + + +
              +
              +
              +
              +
              + +
              + +
              + +
              + +
              + +
              + +
              + + +
              +
              + $_G['forum'][name] +
              + + + {lang forum_favorite} + |{lang rss_subscribe_this} + + |$forumarchive[$_GET['archiveid']]['displayname']{lang forum_archive} + + + + + + |{lang forum_recyclebin} + + + | + + {lang modcp} + + {lang modcp} + + + + + + +

              + $_G['forum'][name] + {lang index_today}: $_G[forum][todayposts]  |{lang index_threads}: $_G[forum][threads]|{lang rank}: $_G[forum][rank]   +

              +
              + +
              + + + +
              {lang forum_modedby}: $moderatedby
              + +
              +
              $_G['forum'][rules]
              +
              + +
              + + + + +
              + + + + + +
              +
              +
              + + +
              +
              +

              {lang forum_recommend}

              +
              +
              + +
              +
              + + + + + + + +
              +
              + +

              {lang recommended_groups}

              +
              +
              + + + + + + + + + + + + + + + + + + + +
              +
              + $group[name] +
              +
              +
              $group[name] ($group[membernum] {lang activity_member_unit}) +
              {lang forum_threads}: $group[threads]
              +
              + + + $group[lastpost][dateline] {$group[lastpost][author]}$_G[setting][anonymoustext] + + $group[lastpost][dateline] + + {lang never} + +
              +
              +
              + $group[name] + +

              $group[name] ($group[membernum] {lang activity_member_unit})

              +

              +
              + $group[threads] {lang index_threads} + +
              + + $group[lastpost][dateline] {$group[lastpost][author]}$_G[setting][anonymoustext] + + {lang never} + +
              +
              +
              +
              + + +
              {lang forum_moderate_unhandled}
              + + +
              +
              + {lang reply} $livethread[replies] + $livethread[subject] {lang admin_live} +
              +
              $livemessage
              +
              +
              +
              +
              +
              {lang forum_live_newreply_refresh}
              +
              +
              +
              + + +
              + + {lang login_to_reply} {lang login} | $_G['setting']['reglinkname'] + + {lang replyperm_nopermission} + + {lang no_permission_to_post}{lang click_to_show_reason} + +
              + +
              + + + +
              +
              + +
              + + + +
              + $multipage + {lang return_index} + {lang send_posts} + +
              + + + + + + + + + + + +
              + + + + + +
              +
              + + +
              + + +
              +
              +

              {lang their}:

              +
              +
              + +
              +
              + + +
              +
              +

              {lang recommended_groups}

              +
              +
              + +
              +
              + + + +
              + +
              + +

              {lang forum_activeusers} ($onlinenum)

              +
              +
              +
                + +
              • + + +

                $online[username]

                + +

                $online[username]

                + + $online[lastactivity]{LF} +
              • + +
              +
              + +
              + +

              {lang forum_activeusers} ($onlinenum)

              +
              + +
              + + +
              +
              +
              + +
              + +
              +
              + + + + + + + + + + + + + + +
              +
              +
              + + diff --git a/template/default/forum/forumdisplay_fastpost.htm b/template/default/forum/forumdisplay_fastpost.htm new file mode 100644 index 0000000..83d9cf4 --- /dev/null +++ b/template/default/forum/forumdisplay_fastpost.htm @@ -0,0 +1,170 @@ + +
              +
              +

              {lang quick_post}

              +
              +
              +
              + + +
              + +
              + +
              + +
              + + + + {lang comment_message1} {$_G['setting']['maxsubjectsize']} {lang comment_message2} +
              + +
              +
              + +
              +
              + + + {lang post_advancemode} + + + + +
              +
              + + + +
              + + + {lang login_to_post} {lang login} | $_G['setting']['reglinkname'] + + {lang connect_fill_profile_to_post} + + + {lang replyperm_nopermission} + + {lang no_permission_to_post}{lang click_to_show_reason} + + +
              + +
              +
              +
              +
              + + + +
              + + + +
              + + + + + +
              + + + + + + + + + + + +
              + + + + + + +
              + + +

              + {lang post_credits_rule} + + + + + {lang post_sync_method}: + + + + + + +

              + +
              +
              \ No newline at end of file diff --git a/template/default/forum/forumdisplay_leftside.htm b/template/default/forum/forumdisplay_leftside.htm new file mode 100644 index 0000000..9f8b63a --- /dev/null +++ b/template/default/forum/forumdisplay_leftside.htm @@ -0,0 +1,33 @@ + +

              {lang favorite_forums}

              +
              + +
              + + $fdata[0] + + $fdata[0] + + +
              + +
              + +

              {lang forum_nav}

              + + + +
              +
              $gdata['name']
              + + + + $name + + $name + + + +
              + + \ No newline at end of file diff --git a/template/default/forum/forumdisplay_list.htm b/template/default/forum/forumdisplay_list.htm new file mode 100644 index 0000000..d1eaea3 --- /dev/null +++ b/template/default/forum/forumdisplay_list.htm @@ -0,0 +1,485 @@ +
              + + + +
              + + + + + + + + + + + + + + +
              + +
              + 0}onclick="setatarget(-1)" class="y atarget_1"{else}onclick="setatarget(1)" class="y"{/if} title="{lang new_window_thread}">{lang new_window} + + {lang all_reward}{lang rewarding}{lang reward_solved}  + + {lang thread_poll}{lang thread_trade}{lang thread_reward}{lang thread_activity}{lang thread_debate}{lang threads_all}  + {lang latest}  + {lang order_heats}  + {lang hot_thread}  + {lang digest_posts}  + {lang more}  + + + + + + $ctime + + + + +
              + + {lang title} + +
              {lang forum_group}{lang author}{lang replies}{lang lastpost} + {lang view_thread_imagemode} +
              +
              +
              + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
               {lang announcement}: $announcement[subject]$announcement[subject] + $announcement[author] + $announcement[starttime] +   
                {lang forum_thread}    
              + + + + + + + + + + + +

              {lang forum_nothreads}

              + + + + + +
              +
              + +
              + + + + + + + + + + + + {lang next_page_extra} + + + + + + diff --git a/template/default/forum/forumdisplay_passwd.htm b/template/default/forum/forumdisplay_passwd.htm new file mode 100644 index 0000000..5a12b61 --- /dev/null +++ b/template/default/forum/forumdisplay_passwd.htm @@ -0,0 +1,22 @@ + +
              + +
              + +
              +
              +
              +
              +

              {lang forum_password_require}

              +
              +
              + + +   +
              +
              +
              +
              +
              +
              + \ No newline at end of file diff --git a/template/default/forum/forumdisplay_pay.htm b/template/default/forum/forumdisplay_pay.htm new file mode 100644 index 0000000..d01e6dd --- /dev/null +++ b/template/default/forum/forumdisplay_pay.htm @@ -0,0 +1,22 @@ + +
              + +
              + +
              +
              +
              +
              +

              {lang youneedpay} $paycredits {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title']} {lang onlyintoforum}

              +
              +
              + + +   +
              +
              +
              +
              +
              +
              + diff --git a/template/default/forum/forumdisplay_sort.htm b/template/default/forum/forumdisplay_sort.htm new file mode 100644 index 0000000..5d21938 --- /dev/null +++ b/template/default/forum/forumdisplay_sort.htm @@ -0,0 +1,20 @@ +
              + + + + $sorttemplate['header'] +
              + $sorttemplate['body'] + + + +
              + $sorttemplate['footer'] +
              + + \ No newline at end of file diff --git a/template/default/forum/forumdisplay_subforum.htm b/template/default/forum/forumdisplay_subforum.htm new file mode 100644 index 0000000..707dbaa --- /dev/null +++ b/template/default/forum/forumdisplay_subforum.htm @@ -0,0 +1,91 @@ +
              +
              + +

              {lang forum_subforums}

              +
              + +
              + + + + + + + + + + + + + + + + + + + + + + {$_G['forum']['endrows'] or ''} + +
              +
              + + $sub[icon] + + + +
              + +
              $sub[name] ($sub[todayposts])
              +
              {lang forum_threads}: , {lang forum_posts}:
              +
              + + {lang private_forum} + + + {lang url_link} + + + $sub[lastpost][dateline] $sub['lastpost']['author']$_G[setting][anonymoustext] + + {lang forum_lastpost}: $sub[lastpost][dateline] + + + {lang never} + + + +
              + +
              + + $sub[icon] + + + + +

              $sub[name] ($sub[todayposts])

              +

              $sub[description]

              +

              {lang forum_subforums}: $sub['subforums']

              +

              {lang forum_moderators}: $sub[moderators]

              + +
              + / + +
              + + {lang private_forum} + + + {lang url_link} + + $sub[lastpost][dateline] $sub['lastpost']['author']$_G[setting][anonymoustext] + + {lang never} + + +
              +
              +
              +
              \ No newline at end of file diff --git a/template/default/forum/guide.htm b/template/default/forum/guide.htm new file mode 100644 index 0000000..eb778c7 --- /dev/null +++ b/template/default/forum/guide.htm @@ -0,0 +1,166 @@ + + +
              + +
              +
              +
              +
              +
              +
              + + + {lang rss_subscribe_this} + + +

              + $lang['guide_'.$view] +

              +
              + +
              +
              +
              $lang['guide_'.$view.'_description']
              +
              +
              + +
              + +
              + $multipage + {lang send_posts} +
              + + + + + +
              +
              + {lang more} » +

              + {lang guide_hot}{lang guide_digest}{lang guide_newthread}{lang guide_new}{lang guide_my} +

              +
              +
              +
              + + + + + + + $thread['heats']{lang guide_attend} + $thread['lastpost'] + + + · $thread[subject] $list['forumnames'][$thread[fid]]['name'] + + + +

              {lang guide_nothreads}

              + +
              +
              +
              + + + +
              +
              + + + + + + + + + + + + + + + +
              + {lang title} + +     + {lang forum_threads}| + {lang reply}| + {lang comments}| + + {lang screening} + + + {lang forum_group}{lang author}{lang replies}{lang lastpost}
              +
              +
              + + + +
              +
              +
              + +
              + $multipage + {lang guide_index} +
              + + +
              +
              +
              + + + + \ No newline at end of file diff --git a/template/default/forum/guide_list_row.htm b/template/default/forum/guide_list_row.htm new file mode 100644 index 0000000..fac2b35 --- /dev/null +++ b/template/default/forum/guide_list_row.htm @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $thread[typehtml] $thread[sorthtml] + + {lang thread_moved}: + + $thread[subject] {lang hidden}  $thread['heats']{lang guide_attend}  + + {$_G[cache][stamps][$thread[icon]][text]} + + + {lang rushreply} + + $stemplate[$sortid][$thread[tid]] + - [{lang readperm} $thread[readperm]] + + + - [{lang thread_reward} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][title]}] + + - [{lang price} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]}] + + + - [{lang reward_solved}] + + + + + + + + {lang thread_digest}$thread[digest] + + + + {lang thread_recommend_icon} + + + {lang heats_icon}{if $thread[heatlevel]>1}..{/if}{if $thread[heatlevel]>2}.{/if} + + + + + + + + + - [{lang replycredit} $thread['replycredit'] ] + + + $thread[multipage] + + + New + + + + + + + + $list['forumnames'][$thread[fid]]['name'] + + + + $thread[author] $verify[$thread[authorid]] + + $_G[setting][anonymoustext] + + + $thread[dateline] + + $thread[replies]$thread[views]{$groupnames[$thread[tid]][views]} + + $thread[lastposter]$_G[setting][anonymoustext] + $thread[lastpost] + + + + + + +   + + + + + + + + + + + + +   + $thread[comment] + + + + +

              {lang guide_nothreads}

              + \ No newline at end of file diff --git a/template/default/forum/hiderecover.htm b/template/default/forum/hiderecover.htm new file mode 100644 index 0000000..8ee64b1 --- /dev/null +++ b/template/default/forum/hiderecover.htm @@ -0,0 +1,31 @@ + +

              + + {lang hiderecover} + + + {lang close} + +

              + +
              +
              + + + + +
              +
              + +
              +
              + + + + \ No newline at end of file diff --git a/template/default/forum/index.htm b/template/default/forum/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/template/default/forum/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/template/default/forum/index_navbar.htm b/template/default/forum/index_navbar.htm new file mode 100644 index 0000000..088a52d --- /dev/null +++ b/template/default/forum/index_navbar.htm @@ -0,0 +1,3 @@ +
                + +
              \ No newline at end of file diff --git a/template/default/forum/modcp.htm b/template/default/forum/modcp.htm new file mode 100644 index 0000000..fcfbbdd --- /dev/null +++ b/template/default/forum/modcp.htm @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/template/default/forum/modcp_announcement.htm b/template/default/forum/modcp_announcement.htm new file mode 100644 index 0000000..b86084e --- /dev/null +++ b/template/default/forum/modcp_announcement.htm @@ -0,0 +1,131 @@ +
              + +

              {lang mod_announce_edit}

              + +

              {lang announcement}

              + +
              + +
              + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang title}:{lang mod_announce_type}: + + + + +
              {lang starttime}: + + ^ + {lang endtime}: + + ^ +
                + + +
                + + + + + + + + {lang mod_message_announce_edit} + + {lang mod_message_announce_add} + +
              +
              +
              + + +

              {lang mod_announce_list}

              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
               {lang displayorder}{lang author}{lang title}{lang mod_announce_type}{lang starttime}{lang endtime}{lang action}
              $ann[author]$ann[subject]{lang link}{lang text}$ann[starttime]$ann[endtime]{lang edit}
              + + + {lang mod_message_announce_del} + +
              +
              + +
              + + \ No newline at end of file diff --git a/template/default/forum/modcp_forum.htm b/template/default/forum/modcp_forum.htm new file mode 100644 index 0000000..ca56f31 --- /dev/null +++ b/template/default/forum/modcp_forum.htm @@ -0,0 +1,129 @@ +
              + + +

              + + {lang mod_option_forum_edit}{lang mod_option_forum_recommend} + -  + + + + + + {lang mod_message_forum_nopermission} + +

              + + + + + + +
              + +
              + + + + + + + + + + + +
              +

              {lang forum_rules}

              +
              +
              +
              + +
              + +
              +
              + +
              {lang forum_not_allow}
              + +
              +

              {lang discuzcode} {lang enabled}

              +

              {lang post_imgcode} {lang enabled}

              +

              {lang post_html} {lang disabled}

              +
              + + + {lang mod_message_forum_update} + +
              +
              +
              + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
               {lang displayorder}{lang subject}{lang author}{lang recommend_moderator}{lang mod_forum_recommend_expiration}
              $thread[authorlink]{$moderatormembers[$thread[moderatorid]][username]}System{lang more_settings}
              + $reportlist[pagelink] + + + {lang mod_message_forum_updaterecommend} + +
              +
              + +
              {lang search_nomatch}
              + + + + +
              + + \ No newline at end of file diff --git a/template/default/forum/modcp_forumaccess.htm b/template/default/forum/modcp_forumaccess.htm new file mode 100644 index 0000000..c1150be --- /dev/null +++ b/template/default/forum/modcp_forumaccess.htm @@ -0,0 +1,177 @@ +
              +

              {lang mod_option_member_access}

              +
              {lang mod_notice_access}
              + + +
              + + +
              + + + + + + + + + + + + + + + + + + + + + + + +
                + * + + {lang mod_message_access_updatepermission} + + {lang mod_message_access_user_nonexistence} + + {lang mod_message_access_user_invalid} + + {lang mod_message_access_admin_invalid} + + +
              {lang mod_moderate_selectforum}: + + + +
              {lang username}: +    +
              {lang mod_access_change}: + + + + + + + + + + +
              +
              + +
              + +
              +
              +
              + + {lang username}:   +   + +
              +
              +

              {lang mod_access_specialuser}

              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang member}{lang forum}{lang mod_access_viewthread}{lang mod_access_postthread}{lang mod_access_postreply}{lang mod_access_download}{lang mod_access_getimage}{lang mod_access_upload}{lang mod_access_uploadimage}{lang mod_access_optime}{lang moderator}
              {$users[$access[uid]]}UID $access[uid]$access['forum']$access['allowview']$access['allowpost']$access['allowreply']$access['allowgetattach']$access['allowgetimage']$access['allowpostattach']$access['allowpostimage']$access[dateline]{$users[$access[adminuser]]}UID $access[adminuser]

              {lang mod_message_access_nonexistence}

              +
              $list[pagelink]
              +
              + \ No newline at end of file diff --git a/template/default/forum/modcp_home.htm b/template/default/forum/modcp_home.htm new file mode 100644 index 0000000..402eb32 --- /dev/null +++ b/template/default/forum/modcp_home.htm @@ -0,0 +1,54 @@ +
              +

              {lang mod_notice_title}

              +
              + + +
              + + + + + + + + + + + +
              +
                +
              • {lang modcp_home_adminnote_to}:
              • +
              • +
              • +
              • +
              +
              +

              {lang expire}: + +

              +
              +
              +
              + +

              {lang modcp_home_message_list}

              + +
              + + + + + +
              +

              ({lang expire}: $note[expiration] {lang days})$note[checkbox] $note[admin] $note[dateline]

              +

              $note[message]

              +
              + +
              + + +
              +
              + +

              {lang modcp_home_adminnote_nonexistence}

              + +
              \ No newline at end of file diff --git a/template/default/forum/modcp_log.htm b/template/default/forum/modcp_log.htm new file mode 100644 index 0000000..edf64f9 --- /dev/null +++ b/template/default/forum/modcp_log.htm @@ -0,0 +1,50 @@ +
              +

              {lang modcp_logs}

              +
              +
              + + + + + + + + + + + + +
              {lang keyword}:{lang modcp_logs_perpage}:
               
              +
              +
              + +

              {lang modcp_logs_list_1}

              + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang time}{lang username}IP + {lang modcp_logs_action}{lang forum}{lang modcp_logs_other}
              $log[1]$log[2]
              {lang admin} {lang supermod} {lang moderator} GID $log[3]
              $log[4]$log[5]
              $log[6]
              $log[7]$log[8]

              {lang search_nomatch}

              +
              $multipage
              + +
              \ No newline at end of file diff --git a/template/default/forum/modcp_login.htm b/template/default/forum/modcp_login.htm new file mode 100644 index 0000000..8746b43 --- /dev/null +++ b/template/default/forum/modcp_login.htm @@ -0,0 +1,27 @@ +
              +

              {lang panel_login}

              +
              {lang panel_notice_login}
              +
              + + + + + + + + + + + + + + + + + +
              {lang panel_login_username}:{$_G[member][username]}
              {lang panel_login_password}:
               
              +
              +
              + \ No newline at end of file diff --git a/template/default/forum/modcp_member.htm b/template/default/forum/modcp_member.htm new file mode 100644 index 0000000..6dbd28f --- /dev/null +++ b/template/default/forum/modcp_member.htm @@ -0,0 +1,258 @@ +
              + +

              {lang mod_member_edit}{lang mod_member_ban}

              +
              + +
              + + + + + + + + + + + + + + +
              + + + {lang mod_message_member_search} + + {lang mod_message_member_nonexistence} + + {lang mod_message_member_nopermission} + + , {lang mod_message_goto_admincp} + + + +
              {lang username}:
              UID: [{lang optional}]
               
              +
              +
              + + + +
              + + + + + + + + + + + + + + + + + + + + +
                + + + + + +
              +

              $member[username]

              +

              UID: $member[uid]

              +

              +
              +
              {lang bio}
              {lang signature}
               
              +
              + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                + + + + + +
              +

              $member[username]

              +

              UID: $member[uid]

              +

              {lang modcp_members_status_banpost}{lang modcp_members_status_banvisit}{lang modcp_members_status_normal} ( {lang valid_before} $member['banexpiry'] )

              +
              +
              {lang crime_record} + + + + + + + + + + + + + + + + + +
              {lang crime_action}{lang crime_dateline}{lang crime_reason}{lang crime_operator}
              + + {lang crime_delpost} + + {lang crime_warnpost} + + {lang crime_banpost} + + {lang crime_banspeak} + + {lang crime_banvisit} + + {lang crime_banstatus} + + {lang crime_avatar} + + {lang crime_sightml} + + {lang crime_customstatus} + + + + $crime[reason] + $crime[operator] +
              +
              {lang changeto}: + + + + + +
              {lang expiry}: +

              + + + ^ +

              +

              {lang modcp_members_ban_days_comment}

              +
              {lang reason}:
               
              +
              + + + +

              {lang mod_option_member_ipban}

              +
              + +
              + + + + + + + + + + + + + +
              {lang add_new} + +   {lang modcp_ip_message} +
              {lang expiry}: + + + ^ +
                + + + + {lang modcp_members_ip_error_1} + + {lang modcp_members_ip_error_2} + + {lang modcp_members_ip_error_3} + + {lang modcp_members_ip_succed} + + {lang modcp_members_ip_error_4} + + +
              +
              + +

              {lang modcp_ban_ip}

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang delete}{lang online_ip}{lang ip_location}{lang modcp_members_ip_addadmin}{lang starttime}{lang endtime}
              $ip[theip]$ip[location]$ip[admin]$ip[dateline] + + ^ +

              {lang no_ban_ip}

              +
              + +
              \ No newline at end of file diff --git a/template/default/forum/modcp_moderate.htm b/template/default/forum/modcp_moderate.htm new file mode 100644 index 0000000..3ae2c2e --- /dev/null +++ b/template/default/forum/modcp_moderate.htm @@ -0,0 +1,236 @@ + + +
              +

              {lang mod_option_subject_mod}

              + + + +
              +
              + + + + + + + + + + + + + + + + + +
              {lang mod_moderate_selectforum}: + + + + {lang mod_moderate_thread_range}: + + + + {lang table_branch} + + $posttableselect + +
              + +

              {lang mod_message_moderate_nopermission}

              + +
              +
              + +
              {lang mod_notice_moderate}
              + + +
              + + + + + + + + +
              +

              + + {lang views}| + {lang pass}| + {lang delete}| + {lang ignore}| + {lang open} + + + {$modforums[list][$post[fid]]}$post[tsubject]$post[subject]($post['censorwords']) +

              +

              + $post[author] + {lang poston} $post[dateline] +

              + $post[message] $post[attach] $post[sortinfo] +
              +

              +
              + +
              $multipage
              +
              + + + + + +
              +
              + +

              {lang search_nomatch}

              + + + + +
              + +
              + + + + + + + + + +
              {lang mod_moderate_member_range}: + + + +
              +
              +
              + +
              + + + + + + + + + + + + + + + + + + + + + +
               {lang mod_moderate_member_profile}{lang mod_moderate_member_register_reason}{lang mod_moderate_member_info}
              +
              $member[username]
              +

              {lang mod_moderate_member_register_dateline}: $member[regdate]

              +

              {lang mod_moderate_member_register_ip}: $member[regip]

              +

              Email: $member[email]

              +

              + {lang pass}| + {lang delete}| + {lang invalidate} +

              +
              $member['message'] +

              {lang mod_moderate_member_submit_times}: $member[submittimes]

              +

              {lang mod_moderate_member_submit_dateline}: $member[submitdate]

              +

              {lang mod_moderate_member_mod_admin}: $member[admin]

              +

              {lang mod_moderate_member_mod_dateline}: $member[moddate]

              +
              +
              $multipage
              +
              + + + + + +
              +
              + +

              {lang search_nomatch}

              + + +
              + + \ No newline at end of file diff --git a/template/default/forum/modcp_moderate_float.htm b/template/default/forum/modcp_moderate_float.htm new file mode 100644 index 0000000..ebfeb39 --- /dev/null +++ b/template/default/forum/modcp_moderate_float.htm @@ -0,0 +1,59 @@ + + +
              +

              + + {lang delete}{lang ignore}{lang invalidate}{lang validate} + {lang mod_moderate_member}{lang mod_moderate_thread}{lang mod_moderate_reply} + () + + {lang close} + +

              + +
              +
              + + + + + + + + + + + + + +

              {lang mod_moderate_reason}: ^

              +

              + + + {lang mod_moderate_nonexistence} + +
              +

              + + + + + + + +

              +
              +
              + + + + \ No newline at end of file diff --git a/template/default/forum/modcp_post.htm b/template/default/forum/modcp_post.htm new file mode 100644 index 0000000..2debf70 --- /dev/null +++ b/template/default/forum/modcp_post.htm @@ -0,0 +1,144 @@ +
              +

              {lang mod_option_subject}

              + + +
              + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang mod_option_selectforum}: + + + + {lang modcp_posts_type}: + + + +
              {lang modcp_posts_author}:{lang modcp_posts_dateline_range}: {lang modcp_posts_to} + + + + + +
              {lang modcp_posts_week_2} + +
              {lang modcp_posts_week_1} + + + +
              {lang modcp_posts_keyword}:{lang modcp_posts_ip}:
              {lang posttable_branch}$posttableselect
                + +
              +
              +
              + +

              {lang modcp_posts_error_1}

              + +

              {lang modcp_posts_error_2}

              + +

              {lang modcp_posts_error_3}

              + +

              {lang modcp_posts_error_4}

              + +

              {lang modcp_forum}: $_G['forum'][name], {lang modcp_posts_search}

              + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + +
                {lang forum}{lang author}
              + {lang modcp_posts_thread}:  $post[tsubject]
              + $post[message] +
              + $post['forum'] + + + + $post[author] + + {$_G['setting']['anonymoustext']} + + + $post[dateline] +
              + $multipage + + + + + +
              +
              +
              + + +
              + \ No newline at end of file diff --git a/template/default/forum/modcp_recyclebin.htm b/template/default/forum/modcp_recyclebin.htm new file mode 100644 index 0000000..f989b6d --- /dev/null +++ b/template/default/forum/modcp_recyclebin.htm @@ -0,0 +1,212 @@ + +
              +

              {lang mod_option_subject}

              + + +
              +
              + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang mod_option_selectforum}: + + + + {lang modcp_posts_type}: + + + +
              {lang modcp_posts_author}:{lang modcp_dateline_range}: {lang modcp_posts_to}
              {lang modcp_subject_keyword}:{lang modcp_views_range}: {lang modcp_posts_to}
              {lang modcp_no_reply_range}:{lang modcp_reply_range}: {lang modcp_posts_to}
              {lang mod_option_selectthreadclass}: + + + +
                + +
              +
              +
              +
              + + +

              {lang modcp_forum}: $_G['forum'][name]

              + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                 {lang author}{lang replies}{lang lastpost}{lang reason}
              + + + + + + + + + + + + + + + $thread[subject] + - [{lang readperm} $thread[readperm]] + + + - [{lang thread_reward} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][title]}] + + - [{lang price} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]}] + + + - [{lang reward_solved}] + + + + - {lang modcp_threadstick_1} + + - {lang modcp_threadstick_2} + + - {lang modcp_threadstick_3} + + + + + + + + + + + $thread[author] + + {$_G['setting']['anonymoustext']} + + + $thread[dateline] + $thread[replies]$thread[views] + $thread[lastposter]{$_G['setting']['anonymoustext']} + $thread[lastpost] + $thread[reason]
                + $multipage + + + + +
              +
              +
              + + +

              {lang modcp_thread_msg}

              + + + + +

              {lang modcp_forum_select_msg}

              + +
              + \ No newline at end of file diff --git a/template/default/forum/modcp_recyclebinpost.htm b/template/default/forum/modcp_recyclebinpost.htm new file mode 100644 index 0000000..41470d4 --- /dev/null +++ b/template/default/forum/modcp_recyclebinpost.htm @@ -0,0 +1,145 @@ +
              +

              {lang mod_option_subject}

              + + +
              +
              + +
              + + + + + + + + + + + + + + + + + + + + + + + +
              {lang mod_option_selectforum}: + + + + {lang modcp_posts_keyword}:
              {lang modcp_posts_author}:{lang modcp_dateline_range}: {lang modcp_posts_to}
              {lang table_branch} + + $posttableselect + +
                + +
              +
              +
              +
              + + +

              {lang modcp_forum}: $_G['forum'][name]

              + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                {lang author}IP{lang ishtmlon}{lang dateline}
              $post[message] + + + + + + + + $post[author] + + {$_G['setting']['anonymoustext']} + + $post[useip]{if $post[port]}:$post[port]{/if} + {lang yes}{lang no} + + $post[dateline] +
              + $multipage + + + + +
              +
              +
              + + +

              {lang modcp_thread_msg}

              + + + + +

              {lang modcp_forum_select_msg}

              + +
              + \ No newline at end of file diff --git a/template/default/forum/modcp_report.htm b/template/default/forum/modcp_report.htm new file mode 100644 index 0000000..426d48c --- /dev/null +++ b/template/default/forum/modcp_report.htm @@ -0,0 +1,64 @@ +
              +

              {lang modcp_report}

              +
              + + +
              + + + + + + + + + + + +
              {lang mod_option_selectforum}: + + + + {lang modcp_report_perpage}:
              +
              +
              + +

              {lang modcp_report_waiting}

              +
              + + + + + + + + + + + + + + + + + + + + + + +
              {lang modcp_report_content}{lang modcp_report_reporter}{lang modcp_report_reward}
              + + + {lang modcp_report_post}:$report[url]
              {lang modcp_report_reason}:$report[message]
              {lang modcp_report_time}:$report[dateline]
              $report[username]$_G['setting']['extcredits'][$curcredits]['title']: 

              {lang modcp_report_note}: 
              +
              +
              $multipage
              + + {lang modcp_report_nothing} + +
              \ No newline at end of file diff --git a/template/default/forum/modcp_thread.htm b/template/default/forum/modcp_thread.htm new file mode 100644 index 0000000..3530cf0 --- /dev/null +++ b/template/default/forum/modcp_thread.htm @@ -0,0 +1,200 @@ + +
              +

              {lang mod_option_subject}

              + + +
              + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang mod_option_selectforum}: + + + + {lang modcp_posts_type}: + + + +
              {lang modcp_posts_author}:{lang modcp_dateline_range}: {lang modcp_posts_to}
              {lang modcp_subject_keyword}:{lang modcp_views_range}: {lang modcp_posts_to}
              {lang modcp_no_reply_range}:{lang modcp_reply_range}: {lang modcp_posts_to}
              {lang mod_option_selectthreadclass}: + + + +
              +
              +
              + + +

              + {lang modcp_forum}: $_G['forum'][name], {lang modcp_thread_search_msg} +

              + + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                 {lang author}{lang replies}{lang lastpost}
              + + + + + + + + + + + + + + + + + + + + + + + + + $thread[subject] + {lang hidden}  + - [{lang readperm} $thread[readperm]] + + + - [{lang thread_reward} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][title]}] + + - [{lang price} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]}] + + + - [{lang reward_solved}] + + + + - {lang modcp_threadstick_1} + + - {lang modcp_threadstick_2} + + - {lang modcp_threadstick_3} + + + + + + + + + + + $thread[author] + + {$_G['setting']['anonymoustext']} + + + $thread[dateline] + $thread[replies]$thread[views] + $thread[lastposter]{$_G['setting']['anonymoustext']} + $thread[lastpost] +
              +
              $multipage
              + +
              +



              + + +
              {lang modcp_forum_select_msg}
              + +
              + \ No newline at end of file diff --git a/template/default/forum/pay.htm b/template/default/forum/pay.htm new file mode 100644 index 0000000..7b2a210 --- /dev/null +++ b/template/default/forum/pay.htm @@ -0,0 +1,68 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +
              +

              + {lang pay} + + {lang close} + +

              + + + + +
              + + + + + + + + + + + + + + + + + +
              {lang author}$thread['author']$thread['author']
              {lang price}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$thread[price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
              {lang pay_author_income}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$thread[netprice] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
              {lang pay_balance}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$balance {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
              +
              +
              +
              + +
              +
              + + + + + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/pay_view.htm b/template/default/forum/pay_view.htm new file mode 100644 index 0000000..c944184 --- /dev/null +++ b/template/default/forum/pay_view.htm @@ -0,0 +1,47 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +

              + {lang pay_view} + + {lang close} + +

              +
              + + + + + + + + + + + + + + + + + + + +
              {lang username}{lang time}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}
              $log[username]$log[dateline]{$log[$extcreditname]} {$_G[setting][extcredits][$_G[setting][creditstransextra][1]][unit]}
              {lang pay_nobuyers}
              +
              +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/post.htm b/template/default/forum/post.htm new file mode 100644 index 0000000..f67c41e --- /dev/null +++ b/template/default/forum/post.htm @@ -0,0 +1,430 @@ + + + + + + + + + + + + + + + {lang post_newthread} + {lang post_newthreadpoll} + {lang post_newthreadtrade} + {lang post_newthreadreward} + {lang post_newthreadactivity} + {lang post_newthreaddebate} + {$_G['setting']['threadplugins'][$specialextra][name]} + + + {lang trade_add_post} + + {lang join_thread} + + {lang edit_trade}{lang edit_thread} + + + + + poll + trade + reward + activity + debate + sort + + + + + + + + + $subjectcut + + $subjectcut + + + +
              +
              $_G[setting][bbname] $navigation$actionsubject $actiontitle
              +
              + + + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              + + + + + + + + + +
              + +   + + + + + + + + + + + + +
              + + + +
              + + +
              + {lang post_credits_rule} + + + + + + + + + + + + + + {lang post_sync_method}: + + + + + + + + + +
              + + +
              +
              +
              +
              + + +
              + + +
              + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/forum/post_activity.htm b/template/default/forum/post_activity.htm new file mode 100644 index 0000000..70fcec9 --- /dev/null +++ b/template/default/forum/post_activity.htm @@ -0,0 +1,143 @@ +
              +
              +
              +
              *{lang post_event_time}:
              +
              +
              + +
              +
              + ~ +
              +
              + +
              +
              +
              *
              +
              + +
              + +
              +
              + +
              *
              +
              + + + + + + ^ + +
              +
              +
              + + + + + +
              + +
              {lang optional_data}:
              +
              +
                + +
              • + +
              +
              + + +
              +
              +
              {lang post_activity_message} $_G['setting']['activityextnum'] {lang post_option} +
              + +
              +
              +
              +
              + +
              +
              + {$_G['setting']['extcredits'][$_G['setting']['activitycredit']][title]} +

              {lang user_consumption_money}

              +
              + +
              +
              + {lang payment_unit} + +
              +
              +
              + + + + ^ +
              + +
              {lang post_topic_image}:
              +
              +

              + + + + + {lang post_click_message_1} + + {lang post_click_message_2} + + +
              + + + +
              +
              + + +
              +
              +
              + \ No newline at end of file diff --git a/template/default/forum/post_attachlimit.htm b/template/default/forum/post_attachlimit.htm new file mode 100644 index 0000000..9e4b541 --- /dev/null +++ b/template/default/forum/post_attachlimit.htm @@ -0,0 +1,5 @@ + + {lang attachment_limit} {lang attachment_unit} {lang attachment_or} {lang attachment_sizelimit} + + {lang attachment_outoflimit} + \ No newline at end of file diff --git a/template/default/forum/post_debate.htm b/template/default/forum/post_debate.htm new file mode 100644 index 0000000..9266b0e --- /dev/null +++ b/template/default/forum/post_debate.htm @@ -0,0 +1,52 @@ +
              +
              +
              +
              *
              +
              +
              *
              +
              +
              +
              +
              +
              +
              +
              + + ^ +
              +
              +
              +

              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/post_editor_attribute.htm b/template/default/forum/post_editor_attribute.htm new file mode 100644 index 0000000..2709e68 --- /dev/null +++ b/template/default/forum/post_editor_attribute.htm @@ -0,0 +1,247 @@ +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +
              diff --git a/template/default/forum/post_editor_body.htm b/template/default/forum/post_editor_body.htm new file mode 100644 index 0000000..a65bf0d --- /dev/null +++ b/template/default/forum/post_editor_body.htm @@ -0,0 +1,117 @@ +
              {lang e_editor_loading}
              + diff --git a/template/default/forum/post_editor_extra.htm b/template/default/forum/post_editor_extra.htm new file mode 100644 index 0000000..7eea214 --- /dev/null +++ b/template/default/forum/post_editor_extra.htm @@ -0,0 +1,77 @@ +
              + + + + +
              + + + + [] + +
              + +
              + + + + + + + RE: $thread[subject] [{lang modify}] + + + + + + ({lang approve}) + ({lang approve}) + ({lang draft}) +
              +
              + +
              +
              + +
              +
              + + + + + + +
              + +
              + + +

              {lang post_message1}

              + + + +
              $threadplughtml
              + + + + +
              $quotemessage
              + \ No newline at end of file diff --git a/template/default/forum/post_forumselect.htm b/template/default/forum/post_forumselect.htm new file mode 100644 index 0000000..21f0b50 --- /dev/null +++ b/template/default/forum/post_forumselect.htm @@ -0,0 +1,135 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +
                $grouplist
              +
                $commonlist
              + +
                $forum
              + + +
                $forum
              + +
              +

              + + {lang post_forum_navigation} + + {lang post_newthreadpoll}{lang post_newthreadtrade}{lang post_newthreadreward}{lang post_newthreadactivity}{lang post_newthreaddebate}{lang send_posts} + $actiontitle + + + + {lang close} + + +

              +
              +

              + + + + + + + + $_G['setting']['bbname'] [{lang nav_forum}] +

              +
                +
              • +
              • +
              • +
              +
              + + + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/post_infloat.htm b/template/default/forum/post_infloat.htm new file mode 100644 index 0000000..25d4c59 --- /dev/null +++ b/template/default/forum/post_infloat.htm @@ -0,0 +1,156 @@ + +

              + + {lang post_newthread}{lang join_thread} + + {lang approve} + {lang approve} + + {lang close} + +

              + +
              +
              +
              + + + + + + + + + + + + + + + + + +
              + +
              + +
              + + + +
              + +
              + + + + + + RE: $thread[subject] [{lang modify}] + + +
              + +
              +
              + +
              + +
              + + +
              $quotemessage
              + + +
              + +
              + +
              +
              +
              + + + +
              +
              +
              + +
              + + + + {lang post_credits_rule} + + +
              +
              + + + + \ No newline at end of file diff --git a/template/default/forum/post_poll.htm b/template/default/forum/post_poll.htm new file mode 100644 index 0000000..8b5346c --- /dev/null +++ b/template/default/forum/post_poll.htm @@ -0,0 +1,136 @@ + +
              +
              + + + +
              +

              + {lang post_poll_options}: + {lang post_poll_comment}   + +

              +
              +
              + + +

              +{lang post_poll_add}

              +
              + + + + +

              + + + + + + + + + + + + + +

              + + + +

              +{lang post_poll_add}

              + +
              +
              +

              + + {lang post_option} +

              +

              + + {lang days} +

              +

              + +

              +

              + +

              + +
              +
              + + diff --git a/template/default/forum/post_reward.htm b/template/default/forum/post_reward.htm new file mode 100644 index 0000000..0c745ba --- /dev/null +++ b/template/default/forum/post_reward.htm @@ -0,0 +1,71 @@ +
              + + + + {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} + , {lang reward_tax_after} 0 {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} +

              + {lang reward_price_min} {$_G['group']['minrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang reward_price_max} {$_G['group']['maxrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang you_have} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} +

              + + + + + + {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} + , {lang reward_tax_add} 0 {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} +

              + {lang reward_price_min} {$_G['group']['minrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang reward_price_max} {$_G['group']['maxrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang you_have} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} +

              + + {lang post_reward_resolved} + + + + + {lang reward_price}: $rewardprice {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} + + {lang post_reward_resolved} + + + + +

              $_G['setting']['rewardexpiration'] {lang post_reward_message}

              + + +
              + + \ No newline at end of file diff --git a/template/default/forum/post_sortoption.htm b/template/default/forum/post_sortoption.htm new file mode 100644 index 0000000..dfe068c --- /dev/null +++ b/template/default/forum/post_sortoption.htm @@ -0,0 +1,190 @@ + + + + +
              +
              + +
              {lang threadtype_description}
              +
              $_G[forum][threadsorts][description][$_G[forum_selectsortid]]
              + + +
              *{lang threadtype_expiration}
              +
              +
              + +
              + {lang valid_before}: $_G[forum_optiondata][expiration] +
              + +
              +
              + + $_G[forum_typetemplate] + + + + + + + + + + + + + + + + + + + + + + + +
              {lang threadtype_description}$_G[forum][threadsorts][description][$_G[forum_selectsortid]]
              {lang threadtype_expiration} +
              + +
              + {lang valid_before}: $_G[forum_optiondata][expiration] +
              *$option[title] +
              + + + + + + + + + + + + +
              + + + +
              + + + + + + + + + + + + + + + + + +
                + +
              • + +
              + +
                + +
              • + +
              + + + + + $option[unit] +
              + +
              + + {lang maxnum} $option[maxnum]  + + + {lang minnum} $option[minnum]  + + + {lang maxlength} $option[maxlength]  + + + {lang unchangeable}  + + + $option[description] + +
              + +
              + + + diff --git a/template/default/forum/post_trade.htm b/template/default/forum/post_trade.htm new file mode 100644 index 0000000..2a11014 --- /dev/null +++ b/template/default/forum/post_trade.htm @@ -0,0 +1,142 @@ + + +
              +
              +
              +
              *
              +
              +
              *
              +
              +
              + + + + + + + + +
              +
              +
              +
              + + + +
              +
              *{lang post_trade_price}:
              +
              +
              + + + + + + + + +
              + +
              + + + + + + + + +
              + +
              + + + + + + + + + + + + +
              +
              +
              +
              + + + +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              + + ^ +
              + +
              {lang post_trade_picture}:
              +
              + + + +
              + + + +
              +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/postappend.htm b/template/default/forum/postappend.htm new file mode 100644 index 0000000..9b27e7f --- /dev/null +++ b/template/default/forum/postappend.htm @@ -0,0 +1,49 @@ + + +
              +
              +
              + + +
              +
              +

              + {lang postappend} + + {lang close} + +

              + + +
              +
              +
              + + + +
              +
              + +
              + +
              + + : +
              + +
              +
              + + {lang comment_message1} 200 {lang comment_message2} +
              +
              +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/rate.htm b/template/default/forum/rate.htm new file mode 100644 index 0000000..473efa9 --- /dev/null +++ b/template/default/forum/rate.htm @@ -0,0 +1,173 @@ + + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + + +
              +

              + {lang rate} + + {lang close} + +

              +
              + + + + + +
              + + + + + + + + + + + + + + + + + +
                {lang rate_raterange}{lang rate_todayleft}
              {$_G['setting']['extcredits'][$id][img]} {$_G['setting']['extcredits'][$id][title]} + + ^ + + {$_G['group']['raterange'][$id]['min']} ~ {$_G['group']['raterange'][$id]['max']}$maxratetoday[$id]
              + +
              +

              {lang user_operation_explain}:

              + + + + + + + + + + +
              +
                $selectreason
              + +
              +
              + +
              {lang admin_rate}
              + +
              +

              + + +

              +
              +
              + + + +
              +
              +

              + {lang thread_removerate} + + {lang close} + +

              + + + + + +
              + + + + + + + + + + + + + + + + + + + +
               {lang username}{lang time}{lang credits}{lang reason}
              $ratelog[username]$ratelog[dateline]{$_G['setting']['extcredits'][$ratelog[extcredits]][title]} $ratelog[scoreview] {$_G['setting']['extcredits'][$ratelog[extcredits]][unit]}$ratelog[reason]
              +
              +
              +
              + + + {lang admin_operation_explain}: + +
              +
              + + + + + +
              +
              +
              + + + +

              + {lang board_message} + {lang close} +

              + +
              +
              +

              {lang push_succeed}

              +

              + {lang click_here} {lang rate_thread} +

              +
              +
              +

              + +

              + + + \ No newline at end of file diff --git a/template/default/forum/rate_view.htm b/template/default/forum/rate_view.htm new file mode 100644 index 0000000..4a2ac89 --- /dev/null +++ b/template/default/forum/rate_view.htm @@ -0,0 +1,51 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +

              + {lang rate_view} + + {lang close} + +

              +
              + + + + + + + + + + + + + + + + + +
              {lang credits}{lang username}{lang time}{lang reason}
              {$_G['setting']['extcredits'][$log[extcredits]][title]} $log[score] {$_G['setting']['extcredits'][$log[extcredits]][unit]}$log[username]$log[dateline]$log[reason]
              +
              +
              +
              + {lang total}: + +  {$_G['setting']['extcredits'][$id][title]} +$count {$_G['setting']['extcredits'][$id][unit]}   + +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/recommend.htm b/template/default/forum/recommend.htm new file mode 100644 index 0000000..be1efee --- /dev/null +++ b/template/default/forum/recommend.htm @@ -0,0 +1,32 @@ + +
              + + +
              + +
              + + +
              \ No newline at end of file diff --git a/template/default/forum/relatekw.htm b/template/default/forum/relatekw.htm new file mode 100644 index 0000000..306de1c --- /dev/null +++ b/template/default/forum/relatekw.htm @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/template/default/forum/search_sortoption.htm b/template/default/forum/search_sortoption.htm new file mode 100644 index 0000000..0fbeaf4 --- /dev/null +++ b/template/default/forum/search_sortoption.htm @@ -0,0 +1,118 @@ + + + + + + + +
              + $option[title]: + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              + + + + + + + + + $option[title]: + + + + + + + + + + +
              + +
              + + $fontsearch_html +
              +
              + + +
              + +
              $formsearch_html +
              +
              + +
              + \ No newline at end of file diff --git a/template/default/forum/seccheck_post.htm b/template/default/forum/seccheck_post.htm new file mode 100644 index 0000000..e912cb4 --- /dev/null +++ b/template/default/forum/seccheck_post.htm @@ -0,0 +1,2 @@ + +
              \ No newline at end of file diff --git a/template/default/forum/stat_main.htm b/template/default/forum/stat_main.htm new file mode 100644 index 0000000..a07a555 --- /dev/null +++ b/template/default/forum/stat_main.htm @@ -0,0 +1,79 @@ + +
              +
              + $_G[setting][bbname] {lang stats} +
              +
              +
              +
              +
              +

              {lang stats_main}

              + + + + + + + + + + + + + + + + + + + + + + + + + + +

              {lang stats_main_member}

              {lang stats_main_members}$members{lang stats_main_posters}$mempost
              {lang stats_main_admins}$admins{lang stats_main_nonposters}$memnonpost
              {lang stats_main_new}$lastmember{lang stats_main_posters_percent}$mempostpercent%
              {lang stats_main_topposter}$bestmem ($bestmemposts){lang none}{lang stats_main_posts_avg}$mempostavg
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

              {lang stats}

              {lang stats_main_forums_count}$forums{lang stats_main_nppd}$postsaddavg{lang stats_main_hot_forum}$hotforum[name]
              {lang stats_main_threads_count}$threads{lang stats_main_nmpd}$membersaddavg{lang stats_main_threads_count}$hotforum[threads]
              {lang stats_main_posts_count}$posts{lang stats_main_todays_newposts}$postsaddtoday{lang stats_main_posts_count}$hotforum[posts]
              {lang stats_main_rpt}$threadreplyavg{lang stats_main_members_count}$membersaddtoday{lang stats_main_board_activity}$activeindex
              +
              {lang stats_update}
              +
              +
              + +
              + \ No newline at end of file diff --git a/template/default/forum/stat_memberlist.htm b/template/default/forum/stat_memberlist.htm new file mode 100644 index 0000000..629a3d9 --- /dev/null +++ b/template/default/forum/stat_memberlist.htm @@ -0,0 +1,47 @@ + +
              +
              + $_G[setting][bbname] + {lang stats} + {lang member_list} +
              +
              +
              +
              +
              +
              +
              + + +   +
              +

              {lang member_list}

              +
              + + + + + + + + + + + + + + + + + + + + + +
              {lang username}{lang uid}{lang gender}{lang regdate}{lang lastvisit}{lang posts}{lang credits}
              $member[username]$member[uid]{lang male}{lang female} $member[regdate]$member[lastvisit]$member[posts]$member[credits]
              +
              $multipage
              +
              +
              + +
              + \ No newline at end of file diff --git a/template/default/forum/stat_misc.htm b/template/default/forum/stat_misc.htm new file mode 100644 index 0000000..fcf942d --- /dev/null +++ b/template/default/forum/stat_misc.htm @@ -0,0 +1,240 @@ + +
              +
              + $_G[setting][bbname] + {lang stats} + + {lang stats_views} + + {lang stats_agent} + + {lang stats_posthist} + + {lang stats_modworks} + + {lang stats_forums_stat} + +
              +
              + +
              +
              + +
              +

              {lang stats_views}

              + + + $statsbar_week +

              {lang stats_week}

              + + + + $statsbar_hour +

              {lang stats_hour}

              +
              + +
              +

              {lang stats_agent}

              + + + $statsbar_os +

              {lang stats_os}

              + + + + $statsbar_browser +

              {lang stats_browser}

              +
              + +
              +

              {lang stats_posthist}

              + + + $statsbar_monthposts +

              {lang stats_month_posts}

              + + + + $statsbar_dayposts +

              {lang stats_day_posts}

              + +
              +

              {lang stats_forums_stat}

              + + + + + + + + + + + +
              {lang stats_forums_forumname}{lang stats_main_posts_count}
              $forum['name'] ({lang stats_forums_sub})$forum['posts']
              +
              + +
              +

              {lang stats_forum_stat_log} - $foruminfo[name] - $month

              + + +
              + + + + + + + + + + + + + +
              {lang stats_date}{lang stats_main_total_posted}
              $log['logdate']$log['value']
              + + + + + + + + + + + + + + +

              {lang stats_history} - $foruminfo[name]

              {lang stats_forums_month}{lang stats_main_total_posted}
              $month$monthposts[$month]
              +
              + +
              +

              {lang stats_modworks} - $username

              +

              $username {lang stats_modworks_in} {$starttime} {lang stats_modworks_to} {$endtime} {lang stats_modworks_data}   [{lang stats_modworks_export}]

              +
                + + $link + +
              • + +
                + + {lang stats_modworks_timerange}: {lang stats_modworks_to} + +
                +
              • +
              +
              +
              + + + + + + + + + + + + +
              {lang time}
              $day
              {lang stats_modworks_total}
              +
              +
              + + + + + + + + + + + + + + + + + + + + +
              $val{lang stats_modworks_total}
              $modaction[$key][count] $modaction[total]
              $totalactions[$key][count] $totalactions[total]
              +
              +
              +
              + + +
              +

              {lang stats_modworks} - {lang stats_modworks_all}

              +

              {$starttime} {lang stats_modworks_to} {$endtime} {lang stats_modworks_data}   [{lang stats_modworks_export}]

              +
                + + $link + +
              • + +
                + + {lang stats_modworks_timerange}: {lang stats_modworks_to} + +
                +
              • +
              +
              +
              + + + + + + + + + + + + + + +
              {lang username}
              {$member[username]}
              {lang stats_modworks_total}
              +
              + +
              + + + + + + + + + + + + + + + + + + + + + + +
              $val{lang stats_modworks_total}
              {$member[$key][count]} $member[total]
              {$total[$key][count]} $total[total]
              +
              +
              +
              + + +
              + +
              + + \ No newline at end of file diff --git a/template/default/forum/stat_misc_export.htm b/template/default/forum/stat_misc_export.htm new file mode 100644 index 0000000..0d5aa57 --- /dev/null +++ b/template/default/forum/stat_misc_export.htm @@ -0,0 +1,51 @@ + + {lang stats_modworks} - $username + + {$starttime} {lang stats_modworks_to} {$endtime} {lang stats_modworks_data} + + {lang time}, + + $val, + {lang stats_modworks_total} + + + + $day, + + $modaction[$key][count],, + + $modaction[total] + + + {lang stats_modworks_total}, + + $totalactions[$key][count],, + + $totalactions[total] + + + {lang stats_modworks} - {lang stats_modworks_all} + + {$starttime} {lang stats_modworks_to} {$endtime} {lang stats_modworks_data} + + {lang username}, + + $val, + {lang stats_modworks_total} + + + , + + {$member[$key][count]},, + + $member[total] + + + + {lang stats_modworks_total}, + + {$total[$key][count]},, + + $total[total] + + \ No newline at end of file diff --git a/template/default/forum/stat_team.htm b/template/default/forum/stat_team.htm new file mode 100644 index 0000000..6af6488 --- /dev/null +++ b/template/default/forum/stat_team.htm @@ -0,0 +1,110 @@ + +
              +
              + $_G[setting][bbname] + {lang stats} + {lang stats_team} +
              +
              +
              +
              +
              +

              {lang stats_team}

              + +
              +

              {lang stats_team_admins}

              +
              +

              [ {lang open} ]

              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang username}{lang admin_usergroup_title}{lang admin_status}{lang lastvisit}{lang stats_team_offdays}{lang credits}{lang posts}{lang stats_posts_thismonth}{lang stats_modworks_thismonth}{lang onlinetime_total}({lang hours}){lang onlinetime_thismonth}({lang hours})
              $team[members][$uid][username]$team[members][$uid][grouptitle]{lang admin}{lang supermod}{lang moderator}$team[members][$uid][lastactivity]$team[members][$uid][offdays]$team[members][$uid][credits]$team[members][$uid][posts]$team[members][$uid][thismonthposts]$team[members][$uid][modactions]$team[members][$uid][totalol]$team[members][$uid][thismonthol]
              + + + +
              +

              $category[name]

              +
              +

              [ {lang open} ]

              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang forum}{lang username}{lang admin_usergroup_title}{lang admin_status}{lang lastvisit}{lang stats_team_offdays}{lang credits}{lang posts}{lang stats_posts_thismonth}{lang stats_modworks_thismonth}{lang onlinetime_total}({lang hours}){lang onlinetime_thismonth}({lang hours})
              $forum[name]$team[members][$uid][username]$team[members][$uid][username]$team[members][$uid][grouptitle]{lang admin}{lang supermod}{lang moderator}$team[members][$uid][lastactivity]$team[members][$uid][offdays]$team[members][$uid][credits]$team[members][$uid][posts]$team[members][$uid][thismonthposts]$team[members][$uid][modactions]N/A$team[members][$uid][totalol]$team[members][$uid][thismonthol]
              + +
              {lang stats_update}
              +
              +
              + +
              + \ No newline at end of file diff --git a/template/default/forum/stat_trade.htm b/template/default/forum/stat_trade.htm new file mode 100644 index 0000000..7739486 --- /dev/null +++ b/template/default/forum/stat_trade.htm @@ -0,0 +1,57 @@ + +
              +
              + $_G[setting][bbname] + {lang stats} + {lang stats_trade_rank} +
              +
              +
              +
              +
              +

              {lang stats_trade_rank}

              + + + + + + + + + + + + + + + +

              {lang trade_price_sort}

              {lang post_trade_name}{lang trade_seller}{lang trade_totalprice}({lang payment_unit})
              $tradesum[subject]$tradesum[seller]$tradesum[tradesum]
              + + + + + + + + + + + + + + + + + + +

              {lang trace_number_sort}

              {lang post_trade_name}{lang trade_seller}{lang trace_sell_number}
              $totalitem[subject]$totalitem[seller]$totalitem[totalitems]
              + + +
              {lang stats_update}
              +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/forum/tag.htm b/template/default/forum/tag.htm new file mode 100644 index 0000000..4a749aa --- /dev/null +++ b/template/default/forum/tag.htm @@ -0,0 +1,79 @@ + + + + + $var[tagname] + + +

              {lang none_tag}

              + + + +

              + {lang post_tag} +

              +
              +

              + + + +

              + +

              {lang recent_use_tag} + + + , $var + + +

              + +
              +

              + + +

              + +

              + {lang choosetag} + {lang close} +

              +
              +
              +   + + +
              +
              +
              +

              + +

              + + + \ No newline at end of file diff --git a/template/default/forum/topicadmin.htm b/template/default/forum/topicadmin.htm new file mode 100644 index 0000000..383c1b9 --- /dev/null +++ b/template/default/forum/topicadmin.htm @@ -0,0 +1,458 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +

              + {lang admin_select_piece} + + {lang close} + +

              +
              + + + + + + + + + +
              + +
                + + +
              • + + + + + + + + + +
                + +
                + +
                +
                  +

                + + + ^ +

                +
                +
              • + + +
              • + + + + + + + + + +
                + +
                + +
                +
                  +

                + + + ^ +

                +
                +
              • + + +
              • + + + + + + + + + +
                + +
                  +

                + + + ^ +

                +
                +
              • + + +
              • + + + + + + + + + + + + + +
                + + +
                + + + + + + + + B + I + U +
                +
                  +

                + + + ^ +

                +
                  +

                + + + +

                +
                +
              • + + + +
              • + + + + + + + + + + + + + + + + + + + + + + + + + + +
                + +
                + + +
                +
                  +

                + + + ^ +

                +
                  + + +
                  + + +
                  + + + +
                +
              • + +
              + +
              + + +

              + {lang admin_target}: +

              +

              + {lang admin_targettype}: +

              + + + + +

              {lang types}: $typeselect

              + + {lang admin_type_msg} + + +
              + +
              +
                + +
              • + + +

                {lang admin_delthread_confirm}

                + +

                {lang admin_delthread_nopermission}

                + +
              • + +
              • + + + + + + + + + +
                  +

                + + + ^ +

                +
                +
              • +
              • + + + + + + +
                +
              • + +
              + + +
              {lang topicadmin_crime_delpost_nums}
              + + +
              + + + + + + + + + +
              {lang expire}:  +

              + + ^ +

              +
              +
                +
              • +
              • +
              +
              + +
              + + +

              + {lang admin_target}: +

              + +
              + +
              + +

              ^{lang admin_reason}:

              +

              + +

              + + +
              +
              + + +
              +
              +

              +

              + + +

              + {lang topicadmin_useropt}: +

              +
              +
              + +

              + + + + + +

              + +
              +
              + + + + + + +
              +
              +
              + + diff --git a/template/default/forum/topicadmin_action.htm b/template/default/forum/topicadmin_action.htm new file mode 100644 index 0000000..b97062c --- /dev/null +++ b/template/default/forum/topicadmin_action.htm @@ -0,0 +1,241 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +

              + {lang admin_select_piece}{lang topicadmin_select_comment}{lang admin_select_one_piece} + + {lang close} + +

              +
              + + + + + +
              +
              + + $deleteid + {lang admin_delposts} + + +
              {lang topicadmin_crime_delpost_nums}
              + + + $deleteid + {lang topicadmin_delet_comment} + + + {lang admin_threadsplit_restore} + +

              + {lang admin_target}: +

              +

              + {lang admin_targettype}: +

              + + $banid +
                +
              • +
              • +
              + +
              {lang topicadmin_crime_banpost_nums}
              + + + $warnpid +
                +
              • +
              • +
              + +
              {lang topicadmin_warn_nums}
              + + + + + + + + + + + +
              {lang admin_merge_tid}
               
              + + + + + + + + + + +
              {lang pay_buyers}$payment[payers]
              {lang pay_author_income}$payment[income] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]}
              + + + + + + + + + + + + + + +
              + + + + + + + + +
              +
                +
              • +
              • +
              +

              {lang admin_live_tips}
              + +

              {lang admin_stamp_select}:

              +

              + +

              + + +

              {lang admin_stamplist_select}:

              +

              + +

              +

              + + + $stickpid +
                +
              • +
              • +
              + +
              +
              +

              + ^ + {lang admin_operation_explain}: +

              +

              + +
              +
              + +
              +
              +

              +

              + + +

              + {lang topicadmin_useropt}: +

              +
              +
              + +
              + + + + + +
              +
              +
              + + + +
              +
              +
              + + diff --git a/template/default/forum/topicadmin_getip.htm b/template/default/forum/topicadmin_getip.htm new file mode 100644 index 0000000..8a97444 --- /dev/null +++ b/template/default/forum/topicadmin_getip.htm @@ -0,0 +1,7 @@ + +$member[useip]{if $member[port]}:$member[port]{/if} $member[iplocation] + +
              {lang admin_ban_this_ip} + {lang admin_user_this_ip} + + \ No newline at end of file diff --git a/template/default/forum/topicadmin_modlayer.htm b/template/default/forum/topicadmin_modlayer.htm new file mode 100644 index 0000000..47ddba2 --- /dev/null +++ b/template/default/forum/topicadmin_modlayer.htm @@ -0,0 +1,52 @@ + \ No newline at end of file diff --git a/template/default/forum/trade.htm b/template/default/forum/trade.htm new file mode 100644 index 0000000..d750ad7 --- /dev/null +++ b/template/default/forum/trade.htm @@ -0,0 +1,178 @@ + +
              +
              $_G[setting][bbname] {lang trade_confirm_buy}
              +
              +
              +

              {lang trade_confirm_goods}

              +
              + + + +
              + +
              +

              {lang trade_confirm_buy}

              +
              +
              + + + +
              + +
              +
              +
              +
              {lang trade_price}
              +
              + +  $trade[price] {lang payment_unit} + + +  {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} $trade[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]} + +
              + +
              {lang post_trade_locus}
              $trade[locus]
              +
              {lang trade_seller}
              $trade[seller]
              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang trade_credits_total} +  {lang trade_units}   + {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]}  {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}  +
              {lang post_trade_transport} +

              + {lang post_trade_transport_seller} + {lang post_trade_transport_buyer} + {lang post_trade_transport_virtual} + {lang post_trade_transport_physical} +

              + + + + + +
              {lang trade_paymethod} + + + + {lang trade_pay_offline} + + + + +
              + +
              {lang trade_seller_remark_comment}
              +
                + + {lang trade_guest_alarm} +
              +
              +
              +
              + + +
              + +
              + +
              +

              $trade[seller] {lang trade_recommended_goods}

              +
              +
                + +
              • + + {lang post_trade_sticklist} + $usertrade[subject]
                +
                + + +

                ¥ $usertrade[price]

                + + +

                {lang trade_additional} $usertrade[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]}

                + +

                $usertrade[subject]

                +
              • + +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/forum/trade_displayorder.htm b/template/default/forum/trade_displayorder.htm new file mode 100644 index 0000000..42d3532 --- /dev/null +++ b/template/default/forum/trade_displayorder.htm @@ -0,0 +1,106 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + + + +
              +
              +

              + {lang trade_displayorder} + + {lang close} + +

              + + +
              + + + + + + + + + + + + + + + + + + + + + +
              {lang trade_show_order}{lang trade_update_stick}{lang post_trade_name}{lang post_trade_price}{lang trade_remaindays}
              0}checked="checked"{elseif $_G['group']['tradestick'] <= $stickcount}disabled="disabled"{/if} />$trade[subject] + + $trade[price] {lang payment_unit} + + + {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} $trade[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]} + + + + {lang trade_timeout} + + {$trade[expiration]}{lang days}{$trade[expirationhour]}{lang trade_hour} + + {lang trade_timeout} + + {lang edit}
              +
              +
              +
              +
              + {lang trade_update_stickmax} {$_G['group']['tradestick']} + +
              +
              +
              + + + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/trade_info.htm b/template/default/forum/trade_info.htm new file mode 100644 index 0000000..d7e9cc6 --- /dev/null +++ b/template/default/forum/trade_info.htm @@ -0,0 +1,272 @@ + + +
              {lang post_trade_removed}
              + + {eval exit;} + + + + + + + + + + +
              + + + + +
              + + +
              +
              +
              + +
              +
              +
              +
              + + {lang send_pm}  +  QQ +  ICQ +  Yahoo! +  {lang taobao} + + $trade[seller] + + + + $verify[title]$verify[title]  + + + + +
              +
              $_G['forum_thread'][subject] {lang trade_viewtrade}
              +
              +
              +{lang pack_up} +

              $trade[subject]

              + + + +
              +
              +
              + {lang post_trade_sticklist} + + $trade[subject] + +
              + + + +

              + {lang delete}  {lang set_cover}   + {lang edit_trade} +

              + + +
              + +
              + + {lang pack_up} +

              $trade[subject]

              + +
              +
              {lang trade_type_viewthread}:
              +
              + {lang trade_new} + {lang trade_old} + {lang trade_type_buy} +
              +
              {lang trade_transport}:
              +
              + {lang post_trade_transport_offline} + {lang post_trade_transport_seller} + + {lang post_trade_transport_physical} + + {lang post_trade_transport_mail} $trade[ordinaryfee] {lang payment_unit} + {lang post_trade_transport_express} $trade[expressfee] {lang payment_unit} + EMS $trade[emsfee] {lang payment_unit} + + {lang post_trade_transport_none} + + + {lang post_trade_transport_virtual} +
              +
              {lang trade_remaindays}:
              +
              + + {lang trade_timeout} + + {$trade[expiration]} {lang days} {$trade[expirationhour]} {lang trade_hour} + + {$trade[expirationhour]} {lang trade_hour} + + {lang trade_timeout} + +   + +
              +
              {lang post_trade_number}:
              $trade[amount]
              +
              {lang trade_locus}:
              $trade[locus]
              +
              {lang post_trade_buynumber}:
              $trade[totalitems]
              +
              +
              +
              {lang trade_price}:
              +
              + +

              $trade[price] {lang payment_unit}

              + + +

              {lang trade_additional} $trade[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]}

              + +
              +
              +
              + +
              {lang trade_costprice}:
              +
              + + $trade[costprice] {lang payment_unit}
              + + + {lang trade_additional} $trade[costcredit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} + +
              + + +
              + + +

              + +   + +   + + +

              + + +

              ({lang post_trade_support_tenpay})

              + +
              +
              +
              +
              + $post[message] +
              + +
              {lang attachment}: {lang attach_nopermission}
              + +
              + + + + + + +
              + + +
              +
              + + +
              + + + + + + + + + +
              +
              +
              +
              +

              {lang trade_rate}

              +
              +
              + + + + +
              {lang trade_seller_real_name}$post[realname]
              {lang eccredit_buyerinfo}$post[buyercredit] 
              {lang eccredit_sellerinfo}$post[sellercredit] 
              +
              +
              + +
              +
              +

              {lang trade_other_goods}

              +
              +
              +
              + +
              +
              + + {lang post_trade_sticklist} + $usertrade[subject]
              +
              +
              +
              $usertrade[subject]
              +
              + +

              ¥ $usertrade[price]

              + + +

              {lang trade_additional} $usertrade[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]}

              + +
              +
              + +
              +
              +
              + + +
              +
              +

              {lang trade_seller_other_goods}

              +
              +
              + +
              +
              + +
              +
              + + + + + + \ No newline at end of file diff --git a/template/default/forum/trade_view.htm b/template/default/forum/trade_view.htm new file mode 100644 index 0000000..7fbdfda --- /dev/null +++ b/template/default/forum/trade_view.htm @@ -0,0 +1,217 @@ + +
              +
              $_G[setting][bbname] {lang trade_order}
              +
              +
              +

              2.{lang trade_order}

              +
              +
              + + + + + + + +
              +

              {lang trade_pay_alipay}{lang trade_pay_offline}

              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang status}$tradelog[statusview] ($tradelog[lastupdate])
              + +

              $trade_message {lang trade_seller_remark_comment}

              +
                + +   + + + +
              {lang eccredit_post_between} {lang eccredit_post_waiting} {lang eccredit_post_already}  + + + + + +
              {lang trade_online_tradeurl} + + + + + + + + + + + + +
              +
              +
              +
              +

              {lang trade_order}

              +
              +
              +
              +
              +
              +

              $tradelog[subject]

              +
              +
              {lang trade_payment}
              +
              + $tradelog[price] {lang payment_unit}   + {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} $tradelog[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}   + {lang trade_payment_comment} +
              + +
              {lang trade_order_no}
              +
              $tradelog[tradeno]
              + + +
              {lang trade_seller}
              +
              + $tradelog[seller] +   +
              +
              {lang trade_buyer}
              +
              + $tradelog[buyer] +   +
              + +
              +
              + {lang payment_unit}   + + {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]} + +
              + +
              +
              $tradelog[number]
              +
              {lang post_trade_transport}
              +
              + {lang post_trade_transport_offline} + {lang post_trade_transport_seller} + {lang post_trade_transport_buyer} + {lang post_trade_transport_virtual} + {lang post_trade_transport_physical} + +  {lang trade_transportfee} +  $tradelog[transportfee]  + {lang payment_unit} + +
              + +
              +
              $tradelog[buyername] 
              +
              +
              $tradelog[buyercontact] 
              +
              +
              $tradelog[buyerzip] 
              +
              +
              $tradelog[buyerphone] 
              +
              +
              $tradelog[buyermobile] 
              + + + + + + + +
              +
              $tradelog[buyermsg]
              + +
               
              +
              + +
              + +
              +
              +
              +
              + +

              {lang trade_message}

              +
              + +
              +
              +
              $message[1] $message[2]
              +
              $message[3]
              +
              + +
              + +
              +
              +
              + +
              +

              $trade[seller] {lang trade_recommended_goods}

              +
              +
                + +
              • + + {lang post_trade_sticklist} + $usertrade[subject]
                +
                + + +

                ¥ $usertrade[price]

                + + +

                {lang trade_additional} $usertrade[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]}

                + +

                $usertrade[subject]

                +
              • + +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/forum/upload.htm b/template/default/forum/upload.htm new file mode 100644 index 0000000..dde9f72 --- /dev/null +++ b/template/default/forum/upload.htm @@ -0,0 +1,26 @@ + + +
              +

              + {lang upload} + + {lang close} +

              +
              +
              + + + +
              + + +
              +
              +

              + {lang attachment_allow_exts}: $imgexts{lang attachment_allow_exts}: {$_G['group']['attachextensions']} +

              + +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/usertag.htm b/template/default/forum/usertag.htm new file mode 100644 index 0000000..f74bfa6 --- /dev/null +++ b/template/default/forum/usertag.htm @@ -0,0 +1,61 @@ + +

              + {lang set_tag_to_activity_users}{lang set_tag_to_poll_users}{lang set_tag_to_reply_users} +

              +
              + + + +
              +

              + + +

              + +

              {lang poll_select_option}

              +

              + +


              + + +

              {lang recent_use_tag} + + + , $var + + +

              + + + +

              {lang set_tag_log}:

              + +

              $log[dateline] $log[username] : $log[reason]

              + + +
              +

              + + +

              +
              + + \ No newline at end of file diff --git a/template/default/forum/viewthread.htm b/template/default/forum/viewthread.htm new file mode 100644 index 0000000..791623f --- /dev/null +++ b/template/default/forum/viewthread.htm @@ -0,0 +1,493 @@ + + + + + + + + + + + +
              + + + + + + +
              +
              +
              + +
              +
              +
              $multipage
              + {lang return_forumdisplay} + + + + + + {lang send_posts} + + + {lang reply} + + +
              + + + + + + + + + + + + + + + +
              + + + + + + + +
              + +
              + + + {lang thread_author}: $_G[forum_thread][author] + + {lang thread_author}: + + {$_G['setting']['anonymoustext']} + + {$_G['setting']['anonymoustext']} + + +
              + +
              + {lang show}: $_G[forum_thread][views]|{lang reply}: $_G[forum_thread][allreplies] +
              + +
              + +
              + + + + +
              + + + + + + + + + + +

              + + + [{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}] + + [{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}] + + + + [{$_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]}] + + $_G[forum_thread][subject] +

              + + ({lang moderating}) + ({lang have_ignored}) + ({lang draft}) + + {lang published} + + + + {lang hidden}({lang hidden}) +   + + +  {lang thread_recommend_icon} + + +  {lang heats_icon}{if $_G['forum_thread'][heatlevel]>1}..{/if}{if $_G['forum_thread'][heatlevel]>2}.{/if} + + +   + + [{lang share_url_copy}] + + +
              + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + +
              + + + + {lang replycredit_icon} + {$_G['forum_thread']['replycredit']} {$_G['setting']['extcredits'][$_G[forum_thread][replycredit_rule][extcreditstype]][unit]}{$_G['setting']['extcredits'][$_G[forum_thread][replycredit_rule][extcreditstype]][title]} + + + +      + + {lang thread_replycredit_tips1} {lang thread_replycredit_tips2}{lang thread_replycredit_tips3} +
              + {lang rushreply} + + + + {lang rushreply} + + + + {lang thread_rushreply_statnum} + + {lang rushreply_view} + + + + + {lang thread_rushreply}  + + {lang thread_rushreply_limit}   + + + {lang havemore_special} {if $rushresult['timertype'] == 'start'} {lang header_start} {else} {lang over} {/if} {lang right_special} + + + {lang thread_rushreply_end}$rushresult[stopfloor]  + + + {lang thread_rushreply_floor}: $rushresult[rewardfloor]  + + +

              + [$countrushpost]{lang thread_rushreply_rewardnum} {lang thread_rushreply_noreward}    + {lang thread_rushreply_check_back} +

              + +
              +
              + + + + + + + + + +
              + + + +
              + + + + + +
              + +
              + + +
              + + +
              + +
              + + +
              + +
              + + +
              + + + + + +
              + +$_G['forum_tagscript'] + + + + + + + + + +
              + + + + + + + + + + + + + + + + + + + + + + +
              + +
              +
              +
              + + + + + + + + + + diff --git a/template/default/forum/viewthread_activity.htm b/template/default/forum/viewthread_activity.htm new file mode 100644 index 0000000..bf5f7dd --- /dev/null +++ b/template/default/forum/viewthread_activity.htm @@ -0,0 +1,249 @@ + + +
              +
              +
              +
              +
              +
              +
              {lang activity_type}:
              +
              $activity[class]
              +
              {lang activity_starttime}:
              +
              + + {lang activity_start_between} + + $activity[starttimefrom] + +
              +
              {lang activity_space}:
              +
              $activity[place]
              +
              {lang gender}:
              +
              + + {lang male} + + {lang female} + + {lang unlimited} + +
              + +
              {lang activity_payment}:
              +
              $activity[cost] {lang payment_unit}
              + + +
              + +
              +
              {lang activity_already}:
              +
              + $allapplynum {lang activity_member_unit} + + | + {lang invite}   + {lang manage}   {lang pm_archive} + +
              +
              +
              + +
              {lang activity_about_member}:
              +
              + $aboutmembers {lang activity_member_unit} +
              + + +
              {lang post_closing}:
              +
              $activity[expiration]
              + + +
              +
              + + +

              {lang activity_wait}{lang activity_join_audit}

              +

              + +

              + + + + + +

              + + +
              +
              + +
              +
              + +
              $post[message]
              + + + + + + + + + +
              +

              {lang activity_new_join} ($applynumbers {lang activity_member_unit})

              + + + + + + + + + + + + + + + + + + + +
               {lang leaveword}{lang activity_payment}{lang activity_jointime}
              + + $apply[username] +

              $apply[message]

              $apply[payment] {lang payment_unit}{lang activity_self}$apply[dateline]
              + +
              + + +
              + + + +
              +

              {lang activity_new_signup} ($noverifiednum {lang activity_member_unit})

              + + + + + + + + + + + + + + + + + + + +
               {lang leaveword}{lang activity_payment}{lang activity_jointime}
              + + $apply[username] + $apply[message]$apply[payment] {lang payment_unit}{lang activity_self}$apply[dateline]
              +
              + \ No newline at end of file diff --git a/template/default/forum/viewthread_album.htm b/template/default/forum/viewthread_album.htm new file mode 100644 index 0000000..8e2e4b8 --- /dev/null +++ b/template/default/forum/viewthread_album.htm @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + +
              +
              +
              + + + +
              +
              +
              +
              +

              $_G['forum_thread']['subject']

              +
              {lang home_view_num}: $_G['forum_thread']['views'] | {lang comment_num}: $_G['forum_thread']['replies'] | {lang thread_favorite} {$_G['forum_thread']['favtimes']} + |{lang post_add_aboutcounter}{lang edit} +
              +
              +
              + {lang lightclose} + | + {lang keyboard_tip} +
              + +
              +
              + + + + + +
              +
              +
              + +
              +
              +
              + +
              +
                {lang waitpicloading}......
              + +
              + +
              +
              +
              + + + + + + + + + + +
              +
              +
              + + + + + + $_G[forum_thread][author] + + + {$_G['setting']['anonymoustext']} + + {$_G['setting']['anonymoustext']} + + + +
              +
              {lang dateline}:
              +
              +

              {lang text_summary}:

              +

              $post['message']

              +
              +
              +
              +
              +
              + +
              +
              +

              {lang reply}

              +
              + +
              + +
              + +
              +
              + + + +
              + +
              + + + +
              +
              +
              + + + + + + + +
              +
              +
              + + diff --git a/template/default/forum/viewthread_debate.htm b/template/default/forum/viewthread_debate.htm new file mode 100644 index 0000000..c962ca2 --- /dev/null +++ b/template/default/forum/viewthread_debate.htm @@ -0,0 +1,98 @@ + + +
              +

              + + + + + + + + + + {lang debate_comment_dateline}: $debate[endtime] +

              +

              {lang debate_umpirepoint}: $debate[umpirepoint]

              +

              {lang debate_bestdebater}: $debate[bestdebater]

              +
              + + +
              $post[message]
              + + +

              {lang endtime}: $debate[endtime] {lang debate_umpire}: $debate[umpire]

              + + + +

              + + + + + +

              + + +
              + + + + + + + + +
              +
              + {lang debate_square_point} ($debate[affirmvotes]) +

              $debate[affirmpoint]

              +
              +
              +
              +
              +
              +
              VS
              +
              +
              +
              +
              +
              + {lang debate_opponent_point} ($debate[negavotes]) +

              $debate[negapoint]

              +
              +
              +
              +
              + + + + + + + + +
              + +
              {lang debater}:$debate[affirmdebaters] ( {lang debate_join} )
              + +
                +
              {lang debater}:$debate[negadebaters] ( {lang debate_join} )
              + + +
              +
              \ No newline at end of file diff --git a/template/default/forum/viewthread_fastpost.htm b/template/default/forum/viewthread_fastpost.htm new file mode 100644 index 0000000..6fd0b46 --- /dev/null +++ b/template/default/forum/viewthread_fastpost.htm @@ -0,0 +1,183 @@ + + +
              +
              + + + + + + +
              +
              + +
              + + + + + + +
              +
              + +
              + +
              + + +
              +
              + +
              +
              + + + {lang post_advancemode} + + + + +
              +
              + + + +
              + + + {lang login_to_reply} {lang login} | $_G['setting']['reglinkname'] + + {lang post_thread_closed} + + {lang connect_fill_profile_to_post} + + + {lang post_thread_closed} + + + {lang post_thread_closed_by_dateline} + + {lang post_thread_closed_by_lastpost} + + + {lang replyperm_nopermission} + + {lang no_permission_to_post}{lang click_to_show_reason} + + +
              + +
              +
              +
              + +
              + + + +
              + + + + + +
              + + + + + + + + + + + +
              + + + + + + +
              + + + + + +

              + {lang post_credits_rule} + + + + + + + + + +

              + +
              + +
              +
              \ No newline at end of file diff --git a/template/default/forum/viewthread_from_node.htm b/template/default/forum/viewthread_from_node.htm new file mode 100644 index 0000000..93c8d89 --- /dev/null +++ b/template/default/forum/viewthread_from_node.htm @@ -0,0 +1,86 @@ + +
              + + +
              + +
              hidden
              + +
              + + + + + + {lang reward_set_bestanswer} + + + + {lang rate} + + + + {lang comments} + + + + {lang reply} + + {lang reply} + + + + + {lang post_add_aboutcounter}{lang edit} + + + + + $post[author]$authorverifys + + {lang poston} + + {$_G['setting']['anonymoustext']} + + {lang poston} + + {lang guest} + + {lang poston} + + $post[dateline] +
              +
              + +
              + +
              {lang post_deleted}
              + +
              + + + + + + + diff --git a/template/default/forum/viewthread_mod.htm b/template/default/forum/viewthread_mod.htm new file mode 100644 index 0000000..6afeefa --- /dev/null +++ b/template/default/forum/viewthread_mod.htm @@ -0,0 +1,62 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +

              + {lang thread_moderations} + + {lang close} + +

              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang thread_moderations_username}{lang time} / {lang expire}{lang thread_moderations_action}{lang reason}{lang thread_moderations_username}{lang time}{lang thread_moderations_action}{lang expire}
              $log['username']{lang thread_moderations_team}{lang thread_moderations_cron}$log[dateline]
              $log[expiration]{lang expiration_unlimit}
              {$modactioncode[$log['action']]}($log[magicname]) + {lang to} $log['reason']$log[username]{lang thread_moderations_cron}$log[dateline]{$modactioncode[$log['action']]}($log[magicname]) + {lang to} $log['reason'] + $log[expiration]{lang expiration_unlimit}
              +
              +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/viewthread_node.htm b/template/default/forum/viewthread_node.htm new file mode 100644 index 0000000..c22cc66 --- /dev/null +++ b/template/default/forum/viewthread_node.htm @@ -0,0 +1,550 @@ + + + + $_G['setting']['verify'][$vid][title]$_G['setting']['verify'][$vid]['title'] + + + $_G['setting']['verify'][$vid][title] + + + +
              + + + + + $post[newpostanchor] $post[lastpostanchor] + + + + + + + + + + + + + + + + + + + +
              +
              + + +
              +
              $post[author]$authorverifys
              +
              + + + + +
              + + +
              {lang member_avatar_banned}
              + + +
              + +
              + + + + +
              + + + {eval viewthread_profile_node('left', $post);} + + + + + + + + + + + + + +
              + + $_G[setting][anonymoustext] $post[useip]{if $post[port]}:$post[port]{/if} + + $_G[setting][anonymoustext]$_G[setting][anonymoustext] + + $post[author] {lang member_deleted} + +
              + + +

              + + IP + + + {lang edit} + + + + {lang ban_member} + + {lang ban_member} + + + {lang posts} + + {lang clear} + +

              + +
              +
              style="width:100%"> +
              style="height:48px"> + + +
              + + + +
              + + + + + + + + {lang replystick_icon} {lang from} {$post[number]}{$postnostick} + + {lang recommend} + + + $postno[$post[number]] + + {$post[number]}{$postno[0]} + + + + + +
              + +
              + + {echo avatar($post['authorid'], 'small')} + + + + + + + + + + + + + + +  {lang thread_author}| + + $post[author]$authorverifys + + {lang poston} $post[dateline] + + {$_G['setting']['mobile']['mobilecomefrom']}{lang from_mobile} + + + | + + {lang thread_show_author} + + {lang thread_show_all} + + + + $post[author] +  {lang poston} $post[dateline] + + $_G[setting][anonymoustext]  + {lang poston} $post[dateline] + + + + |{lang view_bigpic} + + + + + |{lang post_descview} + + |{lang post_ascview} + + + + + |{lang read_mode} + + +
              +
              +
              + + + +
              + + + + + + + +
              +

              + {lang replycredit} +{$post['replycredit']} {$_G['setting']['extcredits'][$_G['forum_thread']['replycredit_rule']['extcreditstype']][unit]}{$_G['setting']['extcredits'][$_G['forum_thread']['replycredit_rule']['extcreditstype']][title]} +

              +
              + + + +
              + + + +
              +

              {lang collection_related}

              +
                + +
              • · $var[name]|{lang collection_threadnum}: $var[threadnum], {lang collection_follow}: $var[follownum]
              • + + +
              • · {lang more}
              • + +
              +
              + +
              + {lang collection_fromctid} +
              + + + + 1 + 2 + 3 + 4 + 5 + + + +   +
              +
              + + + +
              + +
              $locations[$post[pid]][location]
              + + + + + + + + + + +
              +

              {lang related_thread}

              + +
              + + +
              {lang member_signature_banned}
              + +
              {if $_G['setting']['sigimgclick']}{eval $post['signature'] = str_replace('onclick="zoom(this, this.src, 0, 0, 0)"', '', $post['signature']);}{/if}{$post['signature']}
              + +
              $_G['setting']['globalsightml']
              + + + +
              + +
              + + + + + + + +
              + + + + + + + + + + + + + + + + + + + +
              style="width:100%"> + +
              {lang post_deleted}
              +
              + + diff --git a/template/default/forum/viewthread_node_body.htm b/template/default/forum/viewthread_node_body.htm new file mode 100644 index 0000000..50a417f --- /dev/null +++ b/template/default/forum/viewthread_node_body.htm @@ -0,0 +1,289 @@ +
              + +
              {lang message_banned}
              + +
              {lang message_single_banned}
              + +
              {lang message_ishidden_hiddenreplies}
              + + + +
              {lang message_password_exists} {lang pleaseinputpw} 
              + + +

              $post[subject]

              + + + +
              {lang admin_message_banned}
              + +
              {lang admin_message_single_banned}
              + + +
              {lang message_ishidden_hiddenreplies}
              + + + +
              {lang pay_view}{lang pay_threads}: $_G[forum_thread][price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}
              + + + + $threadsortshow[typetemplate] + +
              + + {lang has_expired} + + + + + + + + + + + + + +
              $_G[forum][threadsorts][types][$_G[forum_thread][sortid]]
              $option[title]:$option[value] $option[unit]-
              + +
              + + + + +
              {lang message_password_exists}
              + +
              + {$_G['forum_posthtml']['header'][$post[pid]] or ''} + + +
              + + + $ad_a_pr + + + +
              +
              +

              + + {$_G['setting']['guesttipsinthread']['text']} + + {lang guesttipsinthread_text} + +

              +

              {lang attach_nopermission_login}

              +
              + × +
              + + $post[message]
              + + + + + + + + + + + + $threadplughtml +
              $post[message]
              + + +
              + + + $ad_a_pr + + + $post[message]{lang moderate_need}
              + + {$_G['forum_posthtml']['footer'][$post[pid]] or ''} + + +
              + + + + , $var[1] + + + + $relatedkeywords +
              + + + + + + + + +
              +
              +

              {lang attach_nopermission_notice}

              +

              {lang attach_nopermission}{lang attach_nopermission_connect_fill_profile}{lang attach_nopermission_login}

              +
              + × +
              + +
              + + + + + + +
              + {lang more_images} + {lang image_small} + {lang image_big} +
              + +
              {lang image_list_openning}
              + + + + + + +
              + + + + +
              +
              + + + + + + + + +
              + +
              +
              +
              +
              + + + +
              +
              + +

              {lang comments}

              +
              $totalcomment[$post[pid]]
              + +
              +
              + $comment[avatar] + + $comment[author] + + {lang guest} + +
              +
              + $comment[comment]  + + {lang detail} + {lang reply} + + + {lang poston} +  IP:$comment[useip]{if $comment[port]}:$comment[port]{/if} +  {lang delete} + +
              +
              + + + +
              + + +

              {lang rate}

              +
              + +
              + +
              + + +

              {lang rate_view}

              + +
              +
              + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang number_of_participants} {$_G['setting']['extcredits'][$id][title]} +$score{$_G['setting']['extcredits'][$id][title]} $score + {lang open}{lang pack} + {lang reason} +
              + $ratelog[username] + + $ratelog[score][$id]$ratelog[score][$id]$ratelog[reason]
              +

              + {lang rate_view} +

              + + + +
              +
              + +
              + + + +
              diff --git a/template/default/forum/viewthread_pay.htm b/template/default/forum/viewthread_pay.htm new file mode 100644 index 0000000..6386bc3 --- /dev/null +++ b/template/default/forum/viewthread_pay.htm @@ -0,0 +1,17 @@ + +
              $thread[freemessage]
              + + +
              + {lang pay} + + {lang have} $thread[payers] {lang people_buy}  + + {lang pay_comment} +
              {lang pay_free_time} +
              + + {lang have} $thread[payers] {lang people_buy}  + {lang pay_comment} {lang pay} +
              {lang pay_free_time} + \ No newline at end of file diff --git a/template/default/forum/viewthread_poll.htm b/template/default/forum/viewthread_poll.htm new file mode 100644 index 0000000..56ac853 --- /dev/null +++ b/template/default/forum/viewthread_poll.htm @@ -0,0 +1,124 @@ +
              $post[message]
              + + + +
              + +
              + {lang poll_multiple}{lang thread_poll}: ( {lang poll_more_than} ){lang poll_single}{lang thread_poll} , {lang poll_after_result}, {lang poll_voterscount} + + {lang poll_view_voters} + +
              + + + + +

              + {lang poll_count_down}: + + $_G[forum_thread][remaintime][0] {lang days} + $_G[forum_thread][remaintime][1] {lang poll_hour} + $_G[forum_thread][remaintime][2] {lang poll_minute} + +

              + +

              {lang poll_end}

              + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +
              + + + $imginfo[filename] + + +
              + +

              + + + + $option[polloption] +

              + +
              +   +

              + $option[votes]{lang debate_poll} + {$option[percent]}% +

              +
              + +
              +
              + +
                +
              +
              +
              +
              $option[percent]% ($option[votes])
                + + + + + ({lang poll_msg_overt}) + + + {lang poll_msg_allwvoteusergroup} + + {lang poll_msg_allowvotepolled} + + {lang poll_msg_allowvotethread} + +
              + +
              +
              diff --git a/template/default/forum/viewthread_poll_voter.htm b/template/default/forum/viewthread_poll_voter.htm new file mode 100644 index 0000000..5b2a913 --- /dev/null +++ b/template/default/forum/viewthread_poll_voter.htm @@ -0,0 +1,38 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + +

              + {lang poll_voters} + {lang close} +

              +
              +

              + +

              + +
              +
              $multipage
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/viewthread_portal.htm b/template/default/forum/viewthread_portal.htm new file mode 100644 index 0000000..c8e312a --- /dev/null +++ b/template/default/forum/viewthread_portal.htm @@ -0,0 +1,192 @@ +{eval + $specialarr = array(0 => array('thread', '{lang index_posts}'), 1 => array('poll', '{lang thread_poll}'), 2 => array('trade', '{lang thread_trade}'), 3 => array('reward', '{lang thread_reward}'), 4 => array('activity', '{lang thread_activity}'), 5 => array('debate', '{lang thread_debate}')); + $specialtype = $specialarr[$_G['forum_thread']['special']]; + $_G['home_tpl_titles'][] = $navsubject; + $_G['home_tpl_titles'][] = $specialtype[1]; + $_G['home_tpl_titles'][] = '{lang portal}'; +} + + + + + + + +
              + + + + +
              + + + + +
              +
              + $_G[setting][bbname] $navigation {lang user_threads} +
              +
              + + +
              +
              +
              + +
              +
              +
              +
              +

              $_G[forum_thread][subject]

              +

              + {lang posted_by}: + + $_G[forum_thread][author] + + + {$_G['setting']['anonymoustext']} + + {$_G['setting']['anonymoustext']} + + + | + {lang dateline}: | + {lang home_view_num}: $_G[forum_thread][views]| + {lang comment_num}: $_G[forum_thread][replies] + + |{lang post_add_aboutcounter}{lang edit} + + |{lang thread_mod} +

              +
              + + + + + + +
              + +
              +
              +

              {lang latest_comments}

              +
              +
              + + +
              + +
              + + +
              + +
              $multipage
              + +
              + + +
              + +
              + +
              + +
              +
              + +
              +
              +

              {lang viewed_forums}

              +
              +
              +
                + $_G['setting']['visitedforums'] +
              +
              +
              + + +
              +
              +

              {lang viewd_threads}

              +
              +
              + +
              +
              + + + +
              +
              +
              +
              +
              + + + + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/forum/viewthread_preview.htm b/template/default/forum/viewthread_preview.htm new file mode 100644 index 0000000..981df62 --- /dev/null +++ b/template/default/forum/viewthread_preview.htm @@ -0,0 +1,85 @@ +{eval + $specialarr = array(0 => array('thread', '{lang index_posts}'), 1 => array('poll', '{lang thread_poll}'), 2 => array('trade', '{lang thread_trade}'), 3 => array('reward', '{lang thread_reward}'), 4 => array('activity', '{lang thread_activity}'), 5 => array('debate', '{lang thread_debate}')); + $specialtype = $specialarr[$_G['forum_thread']['special']]; + $previewspecial = $_G['forum_thread']['special']; + $_G['home_tpl_titles'][] = $navsubject; + $_G['home_tpl_titles'][] = $specialtype[1]; + $_G['home_tpl_titles'][] = '{lang portal}'; +} + + + + + +
              + + + + +
              + + + + + + + + +
              {lang hide_preview} +
              +
              +
              + + + + +
              + +
              + + + +
              + +
              $multipage
              + +
              + + + +
              +
              + + + + + + + + +
              +
              +
              + + +
              +
              +
              + + + + + + diff --git a/template/default/forum/viewthread_preview_node.htm b/template/default/forum/viewthread_preview_node.htm new file mode 100644 index 0000000..5bab7cf --- /dev/null +++ b/template/default/forum/viewthread_preview_node.htm @@ -0,0 +1,66 @@ + +
              + + +
              + +
              hidden
              + +
              + + + + + {lang reply} + + {lang reply} + + + + + {lang post_add_aboutcounter}{lang edit} + + + + + $post[author]$authorverifys + + {lang poston} + + {$_G['setting']['anonymoustext']} + + {lang poston} + + {lang guest} + + {lang poston} + + $post[dateline] +
              +
              + +
              + +
              {lang post_deleted}
              + +
              + + + + + + + diff --git a/template/default/forum/viewthread_printable.htm b/template/default/forum/viewthread_printable.htm new file mode 100644 index 0000000..ae073b3 --- /dev/null +++ b/template/default/forum/viewthread_printable.htm @@ -0,0 +1,70 @@ + + + + + + +$_G[forum_thread][subject] - $_G['setting']['bbname'] - Powered by Discuz! + + + + + + + +

              $_G['setting']['bbname']

              +{lang subject}: $_G[forum_thread][subject] [{lang thread_print}]
              + + +
              + {lang author}: $post[author]{$_G['setting']['anonymoustext']}    {lang time}: $post[dateline] +
              + + {lang message_banned} + + {lang message_single_banned} + + {lang pay_comment} + + {lang subject}: $post[subject]
              + $post[message] + + + + + + + + + + + + +




              + + +
              {lang welcometo} $_G['setting']['bbname'] ($_G[siteurl]) +Powered by Discuz! $_G['setting']['version']
              + + + \ No newline at end of file diff --git a/template/default/forum/viewthread_profile_node.htm b/template/default/forum/viewthread_profile_node.htm new file mode 100644 index 0000000..6a24a55 --- /dev/null +++ b/template/default/forum/viewthread_profile_node.htm @@ -0,0 +1,100 @@ + + + +$s
              $return
              $e + + + +$s$post[groupicon]$e + + + +$s{$post[authortitle]}$e + + + +$s$post[customstatus]$e + + + +$s$return$e + + + + + $s$stars$e + $menu + + + + + + $s$e + $menu + + + + + + + + + + diff --git a/template/default/forum/viewthread_reward.htm b/template/default/forum/viewthread_reward.htm new file mode 100644 index 0000000..d5f31c9 --- /dev/null +++ b/template/default/forum/viewthread_reward.htm @@ -0,0 +1,39 @@ +
              +
              + {lang thread_reward}$rewardprice{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} + {lang unresolved}{lang reward_solved} +
              +
              +
              $post[message]
              + +

              + +
              +
              + + +
              {lang attachment}: {lang attach_nopermission}{lang attach_nopermission_connect_fill_profile}{lang attach_nopermission_login}
              + +
              + + + + + + +
              + + + + +
              +

              {lang reward_bestanswer}

              +
              + +
              +

              {lang view_full_content}

              +
              {lang message_ishidden_hiddenreplies}$bestpost[message]
              +
              +
              +
              + \ No newline at end of file diff --git a/template/default/forum/viewthread_trade.htm b/template/default/forum/viewthread_trade.htm new file mode 100644 index 0000000..694b550 --- /dev/null +++ b/template/default/forum/viewthread_trade.htm @@ -0,0 +1,93 @@ +
              +
              {lang viewthread_trade_message1}{lang viewthread_trade_message2},{lang viewthread_trade_message3} "{lang viewthread_trade_message4}"
              $post[message] +
              + + +
              + {lang post_trade_totalnumber}: $tradenum + + {lang trade_displayorder} + + + + {lang trade_add_post} + + | + {lang my_trade_stat} + + +
              + + + +
              + + +
              {lang post_trade_removed}
              + +
              +
              +
              + {lang post_trade_sticklist} + + $trade[subject] + +
              + +
              +
              + {lang open} +

              $trade[subject]

              + +
              +
              {lang trade_type_viewthread}:
              +
              + {lang trade_new} + {lang trade_old} + {lang trade_type_buy} +
              +
              {lang trade_remaindays}:
              +
              + + {lang trade_timeout} + + {$trade[expiration]}{lang days}{$trade[expirationhour]}{lang trade_hour} + + {lang trade_timeout} + +   + +
              + +
              +
              + + $trade[price] {lang payment_unit}   + + + {lang trade_additional} $trade[credit] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]][title]} + +

              + + $trade[costprice] {lang payment_unit} + + + {lang trade_additional} $trade[costcredit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} + +

              +
              +
              +
              +
              +
              + + + + + +
              + + +
              $post[counterdesc]
              + +
              {lang trade_nogoods}
              + diff --git a/template/default/forum/warn_view.htm b/template/default/forum/warn_view.htm new file mode 100644 index 0000000..558c072 --- /dev/null +++ b/template/default/forum/warn_view.htm @@ -0,0 +1,46 @@ + + +
              +
              $_G[setting][bbname] $navigation
              +
              +
              +
              +
              + + +
              +

              + {lang warn_view_log} + + {lang close} + +

              +
              + + + + + + + + + + + + + + + +
              {lang thread_moderations_username}{lang time}{lang reason}
              $warning['operator']{lang thread_moderations_team}$warning[dateline]$warning[reason]
              +
              +
              +
              + {lang warn_view_prompt} +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/group/group.htm b/template/default/group/group.htm new file mode 100644 index 0000000..9aa83b2 --- /dev/null +++ b/template/default/group/group.htm @@ -0,0 +1,175 @@ + +
              +
              + $_G[setting][bbname]$_G[setting][navs][3][navname]$groupnav{lang group_create} +
              +
              + + + + +
              +
              +
              + +
              +
              +
              + + +
              + +
              +
              +

              $_G[forum][name]

              +
              +
              +
              $_G['forum']['description']
              +
              + {lang favorite}|RSS|{lang my_buddylist_invite} + | {lang credits}: $_G[forum][commoncredits]|{lang group_moderator_title}: , $manage[username] +
              + + +
              +
              + + + +
              +
              + + + + + +

              + {lang group_join_type}: + + {lang group_join_type_invite} + + {lang group_join_type_moderate} + + {lang group_join_type_free} + + {lang group_perm_visit}: {lang group_perm_member_only}{lang group_perm_all_user} +

              +

              + + {lang group_has_joined} + +

              + + + +
              + +

              + +
              +
              +
              + +
              +
              +
              +
              $_G[forum][name]
              +
              $_G[forum][name]
              +
              $_G[forum][description]
              +
              + {lang favorite}|RSS|{lang my_buddylist_invite} + {lang credits}: $_G[forum][commoncredits]|{lang group_moderator_title}: , $manage[username] +
              + +
              + {lang group_join_type}: + + {lang group_join_type_invite} + + {lang group_join_type_moderate} + + {lang group_join_type_free} + + {lang group_perm_visit}: {lang group_perm_member_only}{lang group_perm_all_user} +
              +
              + + {lang group_has_joined} + +
              + + + +
              + +
              + +
              + + +
              +
              + + + +
              +
              + + + +
              +
              + + + + +
              + + + + + + + + + + + + + + + + + + + +
              +
              +
              +
              +
              +
              + + + +
              +
              +
              + +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/group/group_attentiongroup.htm b/template/default/group/group_attentiongroup.htm new file mode 100644 index 0000000..600b67c --- /dev/null +++ b/template/default/group/group_attentiongroup.htm @@ -0,0 +1,78 @@ + +

              + {lang select_focus_group} + {lang close} +

              +
              + + + +
              +
              +
                + + +
              • + + +
              • +
              +
              +
              +
              +
                + + +
              • + + +
              • +
              +
              +
              +

              + + +

              + +
              + \ No newline at end of file diff --git a/template/default/group/group_create.htm b/template/default/group/group_create.htm new file mode 100644 index 0000000..2a3b85d --- /dev/null +++ b/template/default/group/group_create.htm @@ -0,0 +1,109 @@ +
              +
              +

              {lang group_create_new} +    ({lang group_create_mod}) +

              +
              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                + +

              +
              *{lang group_name}: + + +
              *{lang group_category}: + + + +
              {lang group_description}: + + +
              + +
              *{lang group_perm_visit}: + + +
              *{lang group_join_type}: + + + +
                + +    ({lang group_create_buildcredits} $_G['group']['buildgroupcredits'] $_G['setting']['extcredits'][$creditstransextra]['unit']{$_G['setting']['extcredits'][$creditstransextra]['title']}) +
              +
              +
              +
              + \ No newline at end of file diff --git a/template/default/group/group_index.htm b/template/default/group/group_index.htm new file mode 100644 index 0000000..6ccc5d0 --- /dev/null +++ b/template/default/group/group_index.htm @@ -0,0 +1,357 @@ + + +
              +
              + {lang reply} $livethread[replies] + $livethread[subject] {lang group_live} +
              +
              $livemessage
              +
              +
              +
              +
              +
              {lang group_live_newreply_refresh}
              +
              +
              +
              + + +
              + + {lang login_to_reply} {lang login} | $_G['setting']['reglinkname'] + + {lang no_permission_to_post}{lang click_to_show_reason} + +
              + +
              + + + +
              +
              + +
              + + + + + + +
              +
              + + + + + + + + + + +
               {lang latest_threads}{lang author}/{lang dateline_range}{lang replies}{lang lastpost}
              +
              +
              + + + + + + + + + + + + + + + + + + + + +
              + + + + + + + + + + + + + + + + + + + + + $thread[subject] + + + + $thread[author] + + + {$_G['setting']['anonymoustext']} + + {$_G['setting']['anonymoustext']} + + + + $thread[dateline] + + $thread[allreplies]$thread[views] + + + + $thread[lastposter] + + {$_G['setting']['anonymoustext']} + + + $thread[lastpost] +
              {lang click_to_readmore}
              + +

              {lang forum_nothreads}

              + +
              +
              +
              +
              +

              {lang group_member_status}

              +
              +
              + +
                + +
              • + + $feed[title_template] $feed[body_data][subject] +
              • + +
              + +

              {lang group_no_latest_feeds}

              + +
              +
              + + + + diff --git a/template/default/group/group_invite.htm b/template/default/group/group_invite.htm new file mode 100644 index 0000000..426027f --- /dev/null +++ b/template/default/group/group_invite.htm @@ -0,0 +1,23 @@ +
              +
              + + + + + $member[username] $member[avatar] + + + + + + + + + + + + + +
              {lang group_choose_friend_to_invite}
              {lang group_invite_list}
               
              +
              +
              \ No newline at end of file diff --git a/template/default/group/group_list.htm b/template/default/group/group_list.htm new file mode 100644 index 0000000..c5d5c21 --- /dev/null +++ b/template/default/group/group_list.htm @@ -0,0 +1,188 @@ + + + +
              + $multipage + + {lang return_index} + + {lang send_posts} + + +
              + + + +
              +
              + + + + + + + + + +
                {lang thread}{lang author}/{lang time}{lang replies}{lang lastpost}
              +
              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {lang thread_moved}: + + {lang thread_moved}: + + + $thread[typehtml] + $thread[subject] + - [{lang readperm} $thread[readperm]] + + + - [{lang thread_reward}$thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][title]}] + + - [{lang price} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]}] + + + - [{lang reward_solved}] + + + + + + + + + {lang thread_recommend_icon} + + + {lang heats_icon}{if $thread[heatlevel]>1}..{/if}{if $thread[heatlevel]>2}.{/if} + + + {lang thread_digest}$thread[digest] + + + + + + + $thread[multipage] + + + + + $thread[author]$verify[$thread[authorid]] + + + {$_G['setting']['anonymoustext']} + + {$_G['setting']['anonymoustext']} + + + + $thread[dateline] + + $thread[allreplies]$thread[views] + + $thread[lastposter]{$_G['setting']['anonymoustext']}$thread[lastpost] +

              {lang forum_nothreads}

              + + + +
              +
              +
              + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/group/group_manage.htm b/template/default/group/group_manage.htm new file mode 100644 index 0000000..c22a509 --- /dev/null +++ b/template/default/group/group_manage.htm @@ -0,0 +1,399 @@ +

              + {lang group_setup} + + |{lang group_member_moderate} + |{lang group_member_management} + + + |{lang group_threadtype} + |{lang group_demise} + +

              + + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
               
              *{lang group_name}:
              *{lang group_category}: + + +
              {lang group_description} + + +
              +
              + +
              + +
              +
              +
              {lang group_perm_visit} + + +
              {lang group_join_type} + + + + + +

              {lang group_close_notice}

              + +
              {lang subdomain} + {$_G['scheme']}://.{$_G['setting']['domain']['root']['group']} +

              + {lang group_domain_message}
              + {lang group_edit_domain_message} +

              +
              {lang group_image} + + + +

              {lang group_no_image_comment}

              +
                + + +

              + + {lang group_image_filesize_limit}   + + {lang group_image_filesize_advise} +

              + +
              {lang group_icon} + +

              + {lang group_icon_resize}   + + {lang group_image_filesize_limit} +

              + + + +
               
              +
              +
              + + +

              + + {lang ignore_all}| + {lang pass_all} + +

              +
              + +
              +
              +
              $user[username] ($user['joindateline'])
              +
               
              +
              + +
              +
              $multipage
              + +

              {lang group_no_member_moderated}

              + + + + +
              +
              +   + +
              +
              + +
              + + + +
              +
              +

              {lang group_admin_member}

              +
              + +
              + + +
              +
              +

              {lang member}

              +
              +
              + + + + + + +
              +
              + +
              $multipage
              +
              + + + + + +
              +
              + +
              + + {lang group_level_cannot_do} + + +
              +
              + + + + + + + + + + + + + + + + +
              {lang threadtype_turn_on}: + + +

              {lang threadtype_turn_on_comment}

              +
              {lang threadtype_required}: + + +

              {lang threadtype_required_force}

              +
              {lang threadtype_prefix}: + + +

              {lang threadtype_prefix_comment}

              +
              +
              +

              {lang threadtype}

              + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang delete}{lang enable}{lang displayorder}{lang threadtype_name}
              {lang threadtype_add}
              +
              + +
              +
              + +
              + +
              + +
              + {lang group_demise_comment} +
              {lang group_demise_notice}
              +
              +
              + + + + + + + + + + + + + + +
              {lang transfer_group_to}: + +
              {lang group_input_password}
                + +
              +
              + +

              {lang group_no_admin_member}

              + +
              + \ No newline at end of file diff --git a/template/default/group/group_memberlist.htm b/template/default/group/group_memberlist.htm new file mode 100644 index 0000000..cc9741f --- /dev/null +++ b/template/default/group/group_memberlist.htm @@ -0,0 +1,65 @@ + + +
              +
              +

              {lang group_admin_member}

              +
              + +
              + + +
              +
              +

              {lang member}

              +
              +
              + + + + + + +
              +
              + +
              $multipage
              + \ No newline at end of file diff --git a/template/default/group/group_my.htm b/template/default/group/group_my.htm new file mode 100644 index 0000000..be1dfef --- /dev/null +++ b/template/default/group/group_my.htm @@ -0,0 +1,227 @@ + + + + + + + +
              +
              +
              + +
              +
              +
              +
              + +
              + + + + + +
              +
              + + + + + + +
              {$usergroups['groups'][$groupid]}{lang replies}{lang last_post}
              +
              +
              + + + + + + + + + +
              + + + + + + + + + + $thread[subject] + $thread[replies] + $thread[views] + + $thread[lastposter]{$_G['setting']['anonymoustext']} + $thread[lastpost] +
              + +
              +
              + + + +
              +
              + + + + + + + +
              + {lang last_topic_in_group}{lang my_last_topic_in_group} + {lang group}{lang replies}{lang last_post}
              +
              +
              + + + + + + + + + + + + + + +
              + + + + + + + + + + $thread[subject]$thread[groupname] + $thread[replies] + $thread[views] + + $thread[lastposter]{$_G['setting']['anonymoustext']} + $thread[lastpost] +
              {lang no_related_posts}
              +
              +
              + +
              $multipage
              + + + +
              +
              +

              {lang my_manage_group} {lang my_join_group}

              +
              +
              + +
              +
              +
              $multipage
              + +
              {lang no_group_create_now} {lang no_group_join}
              + + +
              + + +
              +
              +
              +
              +
              + + + +
              +
              +
              + + +
              +
              +

              {lang hot_group}

              +
              +
              + +
              +
              + +
              +
              +
              +
              +
              +

              {lang friend_join_group}

              +
              +
              + +
              +
              +
              +
              +
              + +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/group/group_recommend.htm b/template/default/group/group_recommend.htm new file mode 100644 index 0000000..a4ac6fe --- /dev/null +++ b/template/default/group/group_recommend.htm @@ -0,0 +1,22 @@ + +

              + {lang group_push_to_forum} + {lang close} +

              +
              + + + + + +
              + +
              +

              + +

              +
              + \ No newline at end of file diff --git a/template/default/group/group_right.htm b/template/default/group/group_right.htm new file mode 100644 index 0000000..81f4f71 --- /dev/null +++ b/template/default/group/group_right.htm @@ -0,0 +1,153 @@ + +
              + + + + + + +

              $_G[forum][posts]

              {lang posts}

              $_G[forum][membernum]

              {lang member}

              $groupcache[ranking][data][today]

              {lang group_member_rank}
              +
              + + + + + +
              +
              +

              {lang group_visited}

              +
              +
              + +
              +
              + + + + +
              +
              +

              {lang group_hot_topics_today}

              +
              +
              + +
              +
              + + +
              +
              +

              {lang group_digest_recommend}

              +
              +
              + +
              +
              + + + + +
              +
              {lang group_you_have}
              +
              + + +
              +
              +

              {lang group_find_topics}

              +
              +
              +
              +   + +
              +
              +
              + + +
              +
              +

              {lang group_url}

              +
              +
              +

              + + + + + + [{lang copy}] +

              + +

              $_G[forum][foundername] {lang create_on} $_G[forum][dateline]

              +

              +

              +
              + \ No newline at end of file diff --git a/template/default/group/index.htm b/template/default/group/index.htm new file mode 100644 index 0000000..6e16a90 --- /dev/null +++ b/template/default/group/index.htm @@ -0,0 +1,124 @@ + + + + +
              +
              +
              +
              +
              +
              +
              +
              + {lang my_group} › +

              {lang group_focus}

              +
              +
              +
              +
              + +
              +
              +

              {lang recommend_group}

              +
              +
              + +
              +
              $val[name]
              +
              $val[name]
              +
              $val[description]
              +
              + +
              +
              + +
              + +
              +
              +

              {lang group_categories}

              +
              +
              + +
              +
              + $second[$fid][name] {lang more} › + $group[name]($group[groupnum]) +
              +
              + + $val[name]    + +
              +
              + +
              +
              +
              + +
              + +
              +
              +
              +
              + + + +
              +
              +

              {lang create_group_step}

              +
              +
              +
                +
              • +
              • +
              • +
              • +
              + + {lang group_create} + +
              +
              + + + + +
              +
              +
              + +
              +
              +

              {lang group_hot}

              +
              +
              +
                + +
              1. $group[commoncredits]$group[name]
              2. + +
              +
              +
              + +
              +
              +
              + +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/group/type.htm b/template/default/group/type.htm new file mode 100644 index 0000000..679319a --- /dev/null +++ b/template/default/group/type.htm @@ -0,0 +1,154 @@ + + + + + + +
              +
              +
              +
              +
              +
              +
              +
              +

              $curtype[name]

              +
              + +
              +

              $type[name]($type[groupnum])  

              +
              + +
              + + + +
              + + + + {lang group_total_numbers} +
              + +
              + + + + + + + + + + $endrows + +
              +
              $val[name]
              +
              +
              $val[name]
              +
              {lang group_total_members_threads}
              +
              {lang group_founded_in}: $val[dateline]
              +
              +
              +
              + +
              + + + + + + + + +
              $val[name] + + $val[name] +

              $val[description]

              +
              + $val[membernum]{lang group_member} + $val[threads]{lang threads} +
              +
              + + + +
              +

              {lang group_category_no_groups}

              +

              {lang group_category_no_groups_detail}

              +
              + +
              + +
              + $multipage + {lang return_index} +
              + +
              +
              +
              +
              + + + +
              +
              +

              {lang create_group_step}

              +
              +
              +
                +
              • +
              • +
              • +
              • +
              + {lang group_create} +
              +
              +
              +
              +
              + + + + +
              + +
              +
              +

              {lang group_hot}

              +
              +
              +
                + +
              1. $group[commoncredits]$group[name]
              2. + +
              +
              +
              + +
              +
              +
              + +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/home/editor_image_menu.htm b/template/default/home/editor_image_menu.htm new file mode 100644 index 0000000..db9ff69 --- /dev/null +++ b/template/default/home/editor_image_menu.htm @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + diff --git a/template/default/home/follow_feed.htm b/template/default/home/follow_feed.htm new file mode 100644 index 0000000..ac0621d --- /dev/null +++ b/template/default/home/follow_feed.htm @@ -0,0 +1,760 @@ + + + + +
              +
              +
              +
              + +
              + +
              + + + +
              +
              + + + +
              +
              +
              +
              +

              {lang follow}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + + + +
              + +
              + +
              + + + + + + +
              +
              + + +
              + +
              +
              + +
              +
              + + +
              +
              +
              + + +
              +
              + + + + + + + +
              + + + +
              + + + + + + + + + +
              + +
              +

              +   + +

              +
              +
              +
              + + + + +
              + + + + + + + +
              +
                + +
              + + + + +
              + + + +
              + +
              +

              {lang follow_following_null}{lang follow_no_content}

              + +
              + {lang follow_add_special_tip}{lang follow_add_special_following} +
              + + + + +
              +

              {lang follow_recommend}

              + +
              + +
              + + + + + + + + + + + +
              $multi
              +
              + +
              +
              +
                +
              • +
                +

                + + + {lang follow_you_following_none}{lang follow_hall}{lang follow_fetch_interested_user} + + {lang follow_you_follower_none1}{lang follow_add_feed}{lang follow_you_follower_none2} + + + + {lang follow_user_following_none} + + {lang follow_user_follower_none} + + + +

                +
                +
              • +
              +
              +
              + + + +
              + + +
              +
              + +
              +
              + + + +
              +
              + + +
              +
              +
              + + + + + + + + + + + diff --git a/template/default/home/follow_feed_li.htm b/template/default/home/follow_feed_li.htm new file mode 100644 index 0000000..c83cc6d --- /dev/null +++ b/template/default/home/follow_feed_li.htm @@ -0,0 +1,75 @@ + + + + + + + +
            • + +
              + + + + + +
              + +
              + + {lang delete} + + + +
              + $feed['note'] +
              +
              + + +

              + + + {lang follow_open_feed} + + + $thread['subject'] + +

              + + + + + + +
              +
              + + +
            • + + + + + + + \ No newline at end of file diff --git a/template/default/home/follow_user_header.htm b/template/default/home/follow_user_header.htm new file mode 100644 index 0000000..e90bb71 --- /dev/null +++ b/template/default/home/follow_user_header.htm @@ -0,0 +1,45 @@ +
              + + + + +
              +
              + + {lang follow_del_special_following}{lang follow_add_special_following} + + + {lang follow_follower_mutual} + + {lang follow_followed}, + + {lang follow_del} +
              +
              + + {lang follow_user_followed} + + + {lang follow_add} + +
              +
              + +
              \ No newline at end of file diff --git a/template/default/home/index.htm b/template/default/home/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/home/invite.htm b/template/default/home/invite.htm new file mode 100644 index 0000000..89ead7b --- /dev/null +++ b/template/default/home/invite.htm @@ -0,0 +1,60 @@ + + +
              +
              $_G[setting][bbname] {lang invite_friends}
              +
              +
              +
              +
              +

              {lang welcome}{$space[username]} {lang invite_you_to_friends}.

              +
              + {lang become_friend} +
              +
              +
              + + + + + +
              +
              +
              +

              {$space[username]}

              +

              {lang comefrom} $space[residecountry] $space[resideprovince] $space[residecity]

              + {lang friend_information} +
              $space[recentnote]
              +

              + + {lang accept_invitation} + {lang lgnore_invitation} + + + {lang want_to_register} + + {lang register_immediately} + +

              +
              +
              +
              +
              +
              +
              +

              {$space[username]}{lang somebody_friends}

              +
              + +
              +
              +
              +
              + diff --git a/template/default/home/magic_call.htm b/template/default/home/magic_call.htm new file mode 100644 index 0000000..d93143a --- /dev/null +++ b/template/default/home/magic_call.htm @@ -0,0 +1,26 @@ + +

              {lang add_friend_max_10}

              +

              + + +   +

              +
              + + + + + \ No newline at end of file diff --git a/template/default/home/magic_detector.htm b/template/default/home/magic_detector.htm new file mode 100644 index 0000000..8778907 --- /dev/null +++ b/template/default/home/magic_detector.htm @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/template/default/home/magic_doodle.htm b/template/default/home/magic_doodle.htm new file mode 100644 index 0000000..4778412 --- /dev/null +++ b/template/default/home/magic_doodle.htm @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/template/default/home/magic_downdateline.htm b/template/default/home/magic_downdateline.htm new file mode 100644 index 0000000..e6b97df --- /dev/null +++ b/template/default/home/magic_downdateline.htm @@ -0,0 +1,9 @@ + +

              {lang modified_time}

              +

              + + + + +

              + \ No newline at end of file diff --git a/template/default/home/magic_gift.htm b/template/default/home/magic_gift.htm new file mode 100644 index 0000000..3a50e7a --- /dev/null +++ b/template/default/home/magic_gift.htm @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + +
              {lang credits_type} + +
              {lang hide_credits}
              {lang credits_per_part}
              + \ No newline at end of file diff --git a/template/default/home/magic_visit.htm b/template/default/home/magic_visit.htm new file mode 100644 index 0000000..ca585e6 --- /dev/null +++ b/template/default/home/magic_visit.htm @@ -0,0 +1,71 @@ + +
              +

              {lang visit_method}

              +
                +
              • +
              • +
              • +
              + + + {eval + $icons = array( + 1 => ' {lang poke_1}', + 2 => ' {lang poke_2}', + 3 => ' {lang poke_3}', + 4 => ' {lang poke_4}', + 5 => ' {lang poke_5}', + 6 => ' {lang poke_6}', + 7 => ' {lang poke_7}', + 8 => ' {lang poke_8}', + 9 => ' {lang poke_9}', + 10 => ' {lang poke_10}', + 11 => ' {lang poke_11}', + 12 => ' {lang poke_12}', + 13 => ' {lang poke_13}' + ); + } + +
              + + + + + \ No newline at end of file diff --git a/template/default/home/misc_ajax.htm b/template/default/home/misc_ajax.htm new file mode 100644 index 0000000..b78d232 --- /dev/null +++ b/template/default/home/misc_ajax.htm @@ -0,0 +1,57 @@ + + + + + + + + + + $group + + $groupname + + + + + + + + + + + + + + + + + + + +
              +
              $multi
              + + + +
              +

              $rule[rulename]

              +

              + {lang credits} +$rule[credit] + {lang experience} +$rule[experience] +

              + +

              + {lang you_chance_pre_week} +

              + +
              + + + +$html + +$albumid + + + \ No newline at end of file diff --git a/template/default/home/misc_inputpwd.htm b/template/default/home/misc_inputpwd.htm new file mode 100644 index 0000000..9b958d4 --- /dev/null +++ b/template/default/home/misc_inputpwd.htm @@ -0,0 +1,50 @@ + + + + +
              +
              +
              +

              {lang password_authentication}

              + +

              + {lang password_authentication} + {lang close} +

              + +
              + + + + + + +
              + {lang enter_password}
              + +
              +

              + +

              +
              + + + + +
              +
              +
              + +
              +
              + + + \ No newline at end of file diff --git a/template/default/home/misc_stat.htm b/template/default/home/misc_stat.htm new file mode 100644 index 0000000..0483fe2 --- /dev/null +++ b/template/default/home/misc_stat.htm @@ -0,0 +1,123 @@ + + + + +
              +
              + $_G[setting][bbname] + {lang stats} + {lang trends_and_statistics} +
              +
              + +
              +
              +
              +

              {lang trends_and_statistics}

              +
              + + + + + + + + + + + + + + + + + + + + +   + + + + + + + + + + + +
              +

              {lang stat_classification}

              +

              {lang stat_message}

              +
              {lang basic_data}: + {lang comprehensive_overview}   + +   + +
              $_G[setting][navs][2][navname]: + +   + +
              {lang tgroup}: + +   + +
              {lang home}: + +   + +
              {lang member_interactive}: + +   + +
              {lang stat_date_range}: + + - + + +
              + + + +
              + + + + + + + + + + +
              +

              {lang comprehensive_overview}

              +

              {lang comprehensive_overview_message}

              +
              +
                + {lang interactive_help_message} +
              +
              +

              + +   + +   + +

              +
              + + +
              + +
              + +
              +
              + +
              + \ No newline at end of file diff --git a/template/default/home/misc_swfupload.htm b/template/default/home/misc_swfupload.htm new file mode 100644 index 0000000..f2770b4 --- /dev/null +++ b/template/default/home/misc_swfupload.htm @@ -0,0 +1,141 @@ + + + {lang done}$uploadfiles + $status + $proid + $albumid + $picid + $fileurl + + + + + + + + + + + + + + + + + + + + + + *.jpg,*.gif,*.png,*.jpeg + + + + {lang create} + {lang cancel} + {lang album_name} + {lang create_new_album} + {lang album_type} + {lang select_album_type} + + {lang continue} + {lang show} + + {lang filename} + {lang depict} + {lang file_size} + {lang upload_stat} + {lang aim_album} + {lang browser} + {lang delete} + {lang upload} + {lang upload_ok} + {lang upload_ok_message} + {lang uploading} + {lang tatal_of} + {lang uploading_message} + {lang a_file} + {lang file_too_big} + {lang upload_error} + + {lang desultory} + {lang series} + {lang save} + {lang pageup} + {lang pagedown} + {lang clear_bg} + {lang reload} + {lang cancel} + {lang site_error_message} + {lang ver_message_1} + {lang ver_message_2} + {lang refuse_camera_message} + {lang count_backwards} + {lang second} + {lang no_camera_message} + {lang auto_shooting} + {lang set_parameter}: + {lang upload_ok} + {lang camera_pic_upload_ok} + {lang uploading} + {lang save_to} + {lang tatal_of} + {lang save_pic_message_1} + {lang save_pic_message_2} + + + {lang redraw} + {lang save} + {lang no_draw_message} + + + + $_G[uid] + $hash + $max + $uploadurl + $feedurl + $albumurl + $categorystat + $categoryrequired + + 3 + 2000 + + + + + {lang filter_disable} + {lang filter_shadow} + {lang filter_fuzzy} + {lang filter_light} + {lang filter_watercolor} + {lang filter_splash} + {lang filter_gyrosigma} + + + + {lang select_album_please} + + $value['albumname'] + + +{lang create_new_album} + + + + {lang select_type} + + + $value[catname] + + --$categorys[$catid][catname] + + ----$categorys[$catid2][catname] + + + + + + + + \ No newline at end of file diff --git a/template/default/home/sendmail.htm b/template/default/home/sendmail.htm new file mode 100644 index 0000000..6398a31 --- /dev/null +++ b/template/default/home/sendmail.htm @@ -0,0 +1,19 @@ + + +
              + + +
                $_G['setting'][sitename]
              + +
              + {lang my_dear_friend}: +
              $message
              +
              +
              $_G['setting'][sitename] +
              +
              +
              +
              {lang system_email_not_replay} +
              +
              +
              \ No newline at end of file diff --git a/template/default/home/space_activity.htm b/template/default/home/space_activity.htm new file mode 100644 index 0000000..68f3e8f --- /dev/null +++ b/template/default/home/space_activity.htm @@ -0,0 +1,131 @@ + + + + + +
              +
              +
              +
              +
              +
              +
              + +

              {lang activity}

              + + + + + + + + + + + + +

              + {lang filter_by_friend} + +

              + + + + + + + + + + + + + + + + + +
              +

              + $thread[month]$thread[day] + $thread[time]
              + {lang week}$weekarr[$thread[week]] +

              +
              $thread[subject]
              +

              $thread[subject]

              +

              $thread[message]

              +
              + $thread[class]
              + $thread[place]
              + {lang have} $thread[applynumber] {lang join_num}
              + $thread[replies] {lang some_message} +
              + +
              + + +

              {lang hide_activity}

              + +
              $multi
              + +
              {lang no_activity}
              + +
              +
              +
              +
              + + +
              +
              +
              +
              +
              +
              +
              +
              + + + + \ No newline at end of file diff --git a/template/default/home/space_album_list.htm b/template/default/home/space_album_list.htm new file mode 100644 index 0000000..992e98e --- /dev/null +++ b/template/default/home/space_album_list.htm @@ -0,0 +1,216 @@ + + + + + + + +
              +
              +
              +
              + {lang upload_pic} +

              {lang album}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + +
              +
              +
              +
              + +
              + +
              +
              +
              + + +
              + +
              +
              +
              + + + +
              + {lang upload_pic} + + + {lang explain_album} + + + + {lang newest_update_album}| + {lang hot_pic_recommend} + + + | + $value[catname] + + + + + + {lang filter_by_friend} + + +
              + +
              + + + +

              {lang hide_pic}

              + + + +
              $multi
              + +
              {lang no_album}
              + + + + + +

              {lang follow_search_album} $searchkey {lang doing_record_list}

              + + + +

              {lang hide_album}

              + + + + +
              $multi
              + + + + +
              {lang no_album}
              + + + + +
              + + +
              + + +
              +
              + +
              +
              + + + +
              +
              + + +
              +
              +
              + + + + + + \ No newline at end of file diff --git a/template/default/home/space_album_pic.htm b/template/default/home/space_album_pic.htm new file mode 100644 index 0000000..dbf4db5 --- /dev/null +++ b/template/default/home/space_album_pic.htm @@ -0,0 +1,362 @@ + + + + + +
              +
              +
              +
              + {lang upload_pic} +

              {lang album}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + +
              + + « {lang return_pic_list} + |{lang current_pic}  + +   {$friendsname[$album[friend]]} + + +
              + +
              + +
              + +
              + + + + + + + + + + + + + + + + +
              + + + +
              +
              + +
              + +
              + {lang previous_pic}{lang next_pic} +
              + +
              +

              $pic[title]({lang moderate_need})

              +

              + {lang hot} $pic[hot] + $pic[username] + {lang upload_at} ($pic[size]) +

              + + + +

              $key : $value

              + + +

              {lang no_exif}

              + + +
              + + {lang share} + + + + + frame + + {lang cancel_frame} + + {lang add_frame} + + | + + + + + + {lang manage_pic}| + {lang edit_description} + + + + |IP: $pic[postip]{if $pic[port]}:$pic[port]{/if} + |{lang hot} + + + + + {lang look_pic} + + |{lang look_exif} + + + |{lang blockdata_recommend} + + + |{lang report} + + + +
              +
              + +
              +
              + +
              + +
              + +
              +
              +

              + + {lang publish_comment} + + {lang comment} +

              +
              + +
              + {lang current_comment} +
              + + +
              + + + +
              +
              +
              $multi
              +
              + +
              + +

              + facelist + + + doodle $_G['setting']['magics']['doodle'] + +

              + +
              +
              + + + + + +
              + +
              + + +
              + +

              + + + + + + + + + +

              + + +
              + + + + + + + + +
              +
              +
              + +
              + + +
              +
              + + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/home/space_album_view.htm b/template/default/home/space_album_view.htm new file mode 100644 index 0000000..d29046e --- /dev/null +++ b/template/default/home/space_album_view.htm @@ -0,0 +1,157 @@ + + + + + + +
              +
              +
              +
              + {lang upload_pic} +

              {lang album}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + +
              + + {lang favorite} + {lang share} + +
              + + {lang edit}| + + {lang delete}| + + + {lang report}| + +
              + + {lang system_cat}$album[catname]| + + {lang total} $album[picnum] {lang album_pics} + +   {$friendsname[$album[friend]]} + +
              + + +

              $album[depict]

              +
                + +
              • + ({lang moderate_need}) +
              • + +
              +

              {lang hide_pic}

              +
              $multi
              + +

              {lang no_pics}

              +

              {lang hide_pic}

              + + + +
              +
              + +
              + {lang previous_album} + {lang next_album} +
              + +

              {lang switch_pics}

              +
              +
              +
              + + + + + + +
              +
              +
              + + +
              + + +
              +
              + +
              +
              + + +
              +
              + + +
              +
              +
              + + + + + + + \ No newline at end of file diff --git a/template/default/home/space_blog_list.htm b/template/default/home/space_blog_list.htm new file mode 100644 index 0000000..6195694 --- /dev/null +++ b/template/default/home/space_blog_list.htm @@ -0,0 +1,210 @@ +{eval + $space_uid = $space['uid']; + $_G['home_tpl_spacemenus'][] = "{lang they_blog}"; + $friendsname = array(1 => '{lang friendname_1}',2 => '{lang friendname_2}',3 => '{lang friendname_3}',4 => '{lang friendname_4}'); +} + + + + + +
              +
              +
              +
              + {lang post_new_blog} +

              {lang blog}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + +
              +
              +
              +
              + +
              + +
              +
              +
              + + +
              + +
              +
              +
              + + +
              + + {lang post_new_blog} + + + + {lang newest_blog}| + {lang recommend_blog} + + + | + $value[catname] + + + + + + {lang filter_by_friend} + + + + + + $classname| + + + + + +
              + + +

              {lang follow_search_blog} $searchkey {lang doing_record_list}

              + + + +
              + +
              + +
              +
              +
              + + +
              + + {lang stick} · + + {lang share} + + $value[subject] + ({lang pending}) +
              +
              + + {$friendsname[$value[friend]]} + + $value[username] $value[dateline] +
              +
              +
              $value[subject]
              + $value[message] +
              +
              + {lang personal_category}: {$classarr[$value[classid]]}| + $value[viewnum] {lang blog_read}| + $value[replynum] {lang blog_replay} + + + |{lang edit}| + {lang delete} + + | + + {lang stick}{lang cancel_stick} + + + {lang hot} $value[hot] +
              +
              + + +

              {lang hide_blog}

              + +
              +
              $multi
              + +
              {lang no_related_blog}
              + + +
              + + +
              +
              + +
              +
              + + + +
              +
              + + +
              +
              +
              + + + + + \ No newline at end of file diff --git a/template/default/home/space_blog_view.htm b/template/default/home/space_blog_view.htm new file mode 100644 index 0000000..3f6a08b --- /dev/null +++ b/template/default/home/space_blog_view.htm @@ -0,0 +1,299 @@ +{eval + $space_uid = $space['uid']; + $blog_id = $blog['blogid']; + $_G['home_tpl_titles'] = array($blog['subject'], '{lang blog}'); + $_G['home_tpl_spacemenus'][] = "{lang they_blog}"; + $_G['home_tpl_spacemenus'][] = "{lang view_blog}"; + $friendsname = array(1 => '{lang friendname_1}',2 => '{lang friendname_2}',3 => '{lang friendname_3}',4 => '{lang friendname_4}'); +} + + + + +
              +
              +
              +
              + {lang post_new_blog} +

              {lang blog}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + +
              +
              +

              + $blog[subject] + + ({lang pending}) + +

              +

              + + {$friendsname[$blog[friend]]} + + {lang hot} $blog[hot] + + {$friendsname[$value[friend]]} + + {lang have_read_blog} + + + |{lang personal_category}:{$classarr[classname]} + |{lang system_cat}:$blog[catname] + + | + + + + , $var[1] + + + + + +

              + +
              + +
              + + $blog[message] +
              + +
              + +
              + + + +
              + {lang viewthread_share_to}: + +
              + + + + +
              + +
              +
              + +
              +

              {lang all}{lang author_newest_blog}

              + +
              + + +
              +

              {lang popular_blog_review}

              + +
              + +
              + +
              +
              +

              + + {lang publish_comment} + + {lang comment} ($blog[replynum] {lang blog_replay}) +

              + +
              + {lang current_blog_replay}{lang click_view_all} +
              + +
              + + + +
              +
              +
              $multi
              + + +
              +

              + facelist + + + doodle {$_G[setting][magics][doodle]} + +

              +
              +
              + + + + + +
              +
              + + +
              + +

              + + + + + + + + +

              + + + + + + + +
              +
              + +
              + + +
              +
              + +
              +
              + + +
              +
              + + +
              +
              +
              + + + + + + + + + + + diff --git a/template/default/home/space_card.htm b/template/default/home/space_card.htm new file mode 100644 index 0000000..58c5268 --- /dev/null +++ b/template/default/home/space_card.htm @@ -0,0 +1,147 @@ + +
              + + +
              +
              + +
              +
              +

              + {$space[group][grouptitle]} + $space[username] + +   + + + + + + $verify[title]$verify[title]  + + $verify[title]  + + + + +

              + + +

              $_G[$isfriendinfo][note]

              + + + $space[spacenote] [{lang update_doing}]
              + + + + +
              +
              + +
                + +
              • +
                $value[title]
                +

                $value[value]

                +
              • + +
              + +
              + + + {lang diy_space} + + + {lang view_message} + + {lang edit_avatar} + {lang update_profile} + + + {lang follow_del}{lang follow_add}TA + + + + {lang add_friend} + + {lang ignore_friend} + + {lang say_hi} + + {lang send_pm} + + {lang connect_me} + + + + + + + {lang user_edit} + + + {lang user_ban} + + href="forum.php?mod=modcp&action=thread&op=post&do=search&searchsubmit=1&users=$encodeusername" target="_blank" class="xi1">{lang manage_post} + + +
              + + + +
              + + + + +
              + \ No newline at end of file diff --git a/template/default/home/space_click.htm b/template/default/home/space_click.htm new file mode 100644 index 0000000..693ce85 --- /dev/null +++ b/template/default/home/space_click.htm @@ -0,0 +1,56 @@ + + + + + + + + + +
              + + +
              +
              + {$value[clicknum]} +
              +
              + +
              $value[name] +
              +
              + + + +

              + {lang position_friend} ($clicknum {lang person}) + + anonymous + {$_G[magic][anonymous]} + +

              +
              + +
              + + +
              $click_multi
              diff --git a/template/default/home/space_comment_li.htm b/template/default/home/space_comment_li.htm new file mode 100644 index 0000000..095203f --- /dev/null +++ b/template/default/home/space_comment_li.htm @@ -0,0 +1,68 @@ + +
              + +
              + +
              hidden
              + +
              + + + reveal{$_G[magic][reveal]} + | + + + + + + flicker + + {lang cancel}{$_G['setting']['magics']['flicker']} + + {$_G['setting']['magics']['flicker']} + + | + + + flicker + {$_G['setting']['magics']['anonymouspost']} + | + + + flicker + {$_G['setting']['magics']['namepost']} + | + + + + + {lang edit} + + + {lang delete} + + + + {lang reply} + + + + + IP: $value[ip]:$value[port] + + + + + + {$value[author]} + + $_G[setting][anonymoustext] + + + ({lang moderate_need}) +
              + +
              $value[message] {lang moderate_not_validate}
              + + +
              \ No newline at end of file diff --git a/template/default/home/space_debate.htm b/template/default/home/space_debate.htm new file mode 100644 index 0000000..d5f106f --- /dev/null +++ b/template/default/home/space_debate.htm @@ -0,0 +1,176 @@ + + + + + + +
              +
              +
              + +
              +
              +
              +
              + +

              {lang debate}

              + + + + + + + + +

              + {lang my_create_debate}| + {lang my_join_debate} +

              + + + +

              + {lang view_by_friend} + +

              + + + + +
              +

              $thread[subject]

              +

              $thread[message]

              + + + + + + + + +
              +
              + {lang affirm_votes} ($thread[affirmvotes]) +

              $thread[affirmpoint]

              +
              +
              +
              +
              +
              +
              VS
              +
              +
              +
              +
              +
              + {lang nega_votes} ($thread[negavotes]) +

              $thread[negapoint]

              +
              +
              +
              + + +
              + + + + + + + + + + + + + + + + + + + + +
                {lang affirm}{lang nega}{lang popularity}{lang rate}
              + + + + + + + + + + + $thread[subject] + + {lang digest}$thread[digest] + + + + + + + $thread[multipage] + $thread[affirmvotes]$thread[negavotes]$thread[replies]{lang ongoing}{lang affirm}{lang nega}{lang win}{lang draw}
              + + +

              {lang hide_debate}

              + +
              + +
              $multi
              + +
              {lang no_debate}
              + +
              +
              +
              +
              + + +
              +
              +
              + +
              +
              + +
              +
              +
              + + + + \ No newline at end of file diff --git a/template/default/home/space_diy.htm b/template/default/home/space_diy.htm new file mode 100644 index 0000000..bb377df --- /dev/null +++ b/template/default/home/space_diy.htm @@ -0,0 +1,34 @@ + +
              + + + + + + +
              \ No newline at end of file diff --git a/template/default/home/space_doing.htm b/template/default/home/space_doing.htm new file mode 100644 index 0000000..0457aa3 --- /dev/null +++ b/template/default/home/space_doing.htm @@ -0,0 +1,147 @@ + + + +
              +
              +
              +
              +

              {lang doing}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + + + +
              +
              +
              +
              + +
              + +
              +
              + +
              + + + +
              +
              + + + + + + +

              {lang doing_search_record} $searchkey {lang doing_record_list}

              + + + +
              + + + +
              +
              +
              + $dv[username]: $dv[message] ({lang moderate_need}) +
              + + +
              + + + {lang reply}| + + {lang delete} + + + IP: $dv[ip]:$dv[port] + +
              +
              + + +

              {lang hide_doing}

              + +
              + +
              $multi
              + + + + +

              {lang doing_no_replay}{lang doing_now}

              + + +
              + + +
              +
              + +
              +
              + + + +
              +
              + + +
              +
              +
              + + + diff --git a/template/default/home/space_doing_form.htm b/template/default/home/space_doing_form.htm new file mode 100644 index 0000000..374564d --- /dev/null +++ b/template/default/home/space_doing_form.htm @@ -0,0 +1,54 @@ + + +
              +
              + + + + + + + + + +
              + + + +
              +
              + {lang doing_maxlimit_char} + + + +
              + + + + +
              +
              \ No newline at end of file diff --git a/template/default/home/space_doing_li.htm b/template/default/home/space_doing_li.htm new file mode 100644 index 0000000..ac361c4 --- /dev/null +++ b/template/default/home/space_doing_li.htm @@ -0,0 +1,22 @@ + + + +
              \ No newline at end of file diff --git a/template/default/home/space_eccredit.htm b/template/default/home/space_eccredit.htm new file mode 100644 index 0000000..0dc1dca --- /dev/null +++ b/template/default/home/space_eccredit.htm @@ -0,0 +1,193 @@ +{eval + $space_uid = $space['uid']; + $filter = array( 'common' => '{lang have_posted}', 'save' => '{lang draft}', 'close' => '{lang closed}', 'aduit' => '{lang pending}', 'recyclebin' => '{lang recyclebin}'); + $_G['home_tpl_spacemenus'][] = "{lang credit_rating}"; +} + + + + + +
              +
              +
              + +
              +
              +
              +
              + +

              {lang trade}

              + + + + + + +

              + + + {lang sale_of_goods}| + {lang credit_rating} + + +

              + + + + +
              +
              +
              +
              +

              {lang credit_rating}

              + +
              +
              + + +
              +
              +
              + + + +

              +    + {lang eccredit_buyerpercent}: $sellerpercent%;   + {lang eccredit_sellerpercent}: $buyerpercent%;   + {lang regdate}: $member[regdate] +

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

              {lang eccredit_sellerinfo} $member[sellercredit] seller rank

               {lang eccredit_1week}{lang eccredit_1month}{lang eccredit_6month}{lang eccredit_6monthbefore}{lang eccredit_total}
              good {lang eccredit_good}$caches[sellercredit][thisweek][good]$caches[sellercredit][thismonth][good]$caches[sellercredit][halfyear][good]$caches[sellercredit][before][good]$caches[sellercredit][all][good]
              soso {lang eccredit_soso}$caches[sellercredit][thisweek][soso]$caches[sellercredit][thismonth][soso]$caches[sellercredit][halfyear][soso]$caches[sellercredit][before][soso]$caches[sellercredit][all][soso]
              bad {lang eccredit_bad}$caches[sellercredit][thisweek][bad]$caches[sellercredit][thismonth][bad]$caches[sellercredit][halfyear][bad]$caches[sellercredit][before][bad]$caches[sellercredit][all][bad]
              {lang eccredit_total}$caches[sellercredit][thisweek][total]$caches[sellercredit][thismonth][total]$caches[sellercredit][halfyear][total]$caches[sellercredit][before][total]$caches[sellercredit][all][total]
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

              {lang eccredit_buyerinfo} $member[buyercredit] buyer rank

               {lang eccredit_1week}{lang eccredit_1month}{lang eccredit_6month}{lang eccredit_6monthbefore}{lang eccredit_total}
              good {lang eccredit_good}$caches[buyercredit][thisweek][good]$caches[buyercredit][thismonth][good]$caches[buyercredit][halfyear][good]$caches[buyercredit][before][good]$caches[buyercredit][all][good]
              soso {lang eccredit_soso}$caches[buyercredit][thisweek][soso]$caches[buyercredit][thismonth][soso]$caches[buyercredit][halfyear][soso]$caches[buyercredit][before][soso]$caches[buyercredit][all][soso]
              bad {lang eccredit_bad}$caches[buyercredit][thisweek][bad]$caches[buyercredit][thismonth][bad]$caches[buyercredit][halfyear][bad]$caches[buyercredit][before][bad]$caches[buyercredit][all][bad]
              {lang eccredit_total}$caches[buyercredit][thisweek][total]$caches[buyercredit][thismonth][total]$caches[buyercredit][halfyear][total]$caches[buyercredit][before][total]$caches[buyercredit][all][total]
              +
              + + + + +
              +
              + +
              + + +
              +
              +
              + +
              +
              + +
              +
              + +
              + +
              + + \ No newline at end of file diff --git a/template/default/home/space_favorite.htm b/template/default/home/space_favorite.htm new file mode 100644 index 0000000..a65c02e --- /dev/null +++ b/template/default/home/space_favorite.htm @@ -0,0 +1,123 @@ + + + + + +
              +
              +
              + +
              +
              +
              +
              +

              + favorite + {lang favorite_thread} + {lang favorite_forum} + {lang favorite_group} + {lang favorite_blog} + {lang favorite_album} + {lang favorite_article} + {lang favorite_all} +

              + + + +
              +
              +
              +

              {lang favorite}

              + + +
              + + + +

              + + + + + +

              +
              +
              $multi
              + +

              {lang no_favorite_yet}

              + + +
              +
              +
              + +
              + +
              +
              +
              + + +
              +
              +
              + + + diff --git a/template/default/home/space_feed_li.htm b/template/default/home/space_feed_li.htm new file mode 100644 index 0000000..9350fd0 --- /dev/null +++ b/template/default/home/space_feed_li.htm @@ -0,0 +1,66 @@ +
            • + + + +
              + + $value[title_template] + + New + + + + + + + ({lang reply}) + + ({lang comment}) + + + +
              + + + + + + + + + + + + + + + + + + + +
              + $value[body_template] +
              + + + + {$value['body_data']['player']} + + + +

              {lang other_participants}:

              + + + +
              $value[body_general]
              + +
              +
              + + + + + + +
            • \ No newline at end of file diff --git a/template/default/home/space_friend.htm b/template/default/home/space_friend.htm new file mode 100644 index 0000000..76b57c0 --- /dev/null +++ b/template/default/home/space_friend.htm @@ -0,0 +1,343 @@ + + +
              +
              + $_G[setting][bbname] + {lang friends} + {lang friend_list} +
              +
              + +
              +
              +
              +
              +
              +
              +
              + +

              {lang friend_list}

              + +
              + + {lang blacklist_message} + +

              + {lang count_member} + + ({lang max_friend_num}) + + friendnum + {lang expansion_friend} + + +

              +

              + {lang friend_message} +

              + + + {lang online_friend_visit} + + {lang near_friend_visit} + + {lang view_online_friend} + + + {lang visitor_list} + + {lang trace_list} + +
              + + +

              {lang add_blacklist}

              +
              +
              + + + + + +
              {lang username} + + +
              + + +
              +
              + + + + + +
              +
              +
              +
              +

              {lang friends}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + +
              +
              +
              +
              +

              {lang search_friend}

              +
              +
              +
              + + + + +   +
              +
              +
              + +
              +
              + {lang volume_group} +

              {lang set_friend_group}

              +
              + +
              + +
              +
              + + +
              + +
              +
              $multi
              + + + +
              +

              {lang recommend_friend}

              + +
              + + +
              +

              {lang online_member}

              + +
              + + +
              {lang no_friend_list}
              + + + + +
              +
              + + +

              {lang count_member}

              + + + +
              +
              +
              + +
              + + +
              +
              +
              +
              +
              + +
              +
              +
              + +
              +
              +
              +
              + +
              + + diff --git a/template/default/home/space_friend_nav.htm b/template/default/home/space_friend_nav.htm new file mode 100644 index 0000000..c9e2b87 --- /dev/null +++ b/template/default/home/space_friend_nav.htm @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/template/default/home/space_header.htm b/template/default/home/space_header.htm new file mode 100644 index 0000000..4dff2de --- /dev/null +++ b/template/default/home/space_header.htm @@ -0,0 +1,111 @@ + + + + + + + + + + +
              +
              + + + + + + + + +

              Locked {lang message_banned}

              + +
              + +

              + + + $space[spacename]$space[username]{lang somebody_space} + + + $space[domainurl] + [{lang favorite}] + [{lang copy}] + + + [{lang share}] + + [RSS] + + + $space[spacedescription] +

              + +
              + + + + + $_G[setting][menunavs] + + + + diff --git a/template/default/home/space_header_personalnv.htm b/template/default/home/space_header_personalnv.htm new file mode 100644 index 0000000..c712201 --- /dev/null +++ b/template/default/home/space_header_personalnv.htm @@ -0,0 +1,44 @@ + + + + +
            +
            \ No newline at end of file diff --git a/template/default/home/space_home.htm b/template/default/home/space_home.htm new file mode 100644 index 0000000..f927007 --- /dev/null +++ b/template/default/home/space_home.htm @@ -0,0 +1,574 @@ + + + + + + + +
            +
            +
            + +
            + +
            + + + +
            +

            {lang feed}

            + +
            + +
            + + +
            + +
            +
            +
            + + +
            +
            +
            +

            {lang profile_completed} $space[profileprogress]%, {lang fix_profile}

            +
            +
            + + +
            +
            + + {lang all} + +

            {lang task}

            +
            +
            +

            {lang space_home_message}

            +
            +
            +
            Icon
            +
            $task[name]
            +
            +

            $task[description]

            + +

            + + {lang gettable}$_G['setting']['extcredits'][$task[prize]][title] $task[bonus] $_G['setting']['extcredits'][$task[prize]][unit] + + {lang gettable}{lang magics_title} $listdata[$task[prize]] $task[bonus] {lang magics_unit} + + {lang gettable}{lang medals} 1 {lang unit} + + {lang gettable}{lang invite_code} $task[prize] {lang unit} + + {lang step_up}{lang usergroup}{lang level} + +

            + +
            +
            +
            +
            + +
            +
            +
            + +
            +
            + + {lang all} + +

            {lang magic}

            +
            +
            +
            +
            $magic[name]
            +
            $magic[name]
            +
            +

            $magic[description]

            +

            {lang magics_price} + + {$_G['setting']['extcredits'][$magic[credit]][title]} $magic[price] {$_G['setting']['extcredits'][$magic[credit]][unit]}/{lang magics_unit} + + $magic[price] {$_G['setting']['extcredits'][$magic[credit]][title]}/{lang magics_unit} + +

            +

            + + {lang magics_operation_buy} + + | + {lang magics_operation_present} + + + {lang magic_empty} + +

            +
            +
            +
            +
            + + +
            +
            +
            + +
            +
            +

            {lang friends_recommended}

            +
            +
            + +
            +
            + + +
            +
            +
            + + +
            +
            + + {lang all} + +

            {lang home_show_members}

            +
            +
            + +
            +
            + + + +
            +
            +

            {lang new_join_members}

            +
            +
            + +
            +
            + + +
            +
            +
            + + +
            +
            + + + {$_G[setting][magics][visit]} + + {lang all} + +

            {lang recent_visit}

            +
            +
            + +
            +
            + + +
            +
            +
            + + +
            +
            + + + {$_G[setting][magics][detector]} + + {lang all} + +

            {lang my_friends}

            +
            +
            + +
            +
            + + +
            +
            +
            + + +
            +
            +

            {lang friends_birthday_reminder}

            +
            +
            + + + + + + + +
            + {lang today}{$values[0][birthmonth]}-{$values[0][birthday]} + + +
            +
            +
            + + +
            +
            +
            + + +
            + +
            +
            + + +
            + + + + + +
            + +

            {lang view_my_space}

            +
            +

            + {lang have} $space[views] {lang visit_per_man} + {$space[username]} + +

            + +
            +
            + + +
            + + + +
            + + + +
            + + + + + + +

            + + {$_G[setting][magics][thunder]} + + {lang newest_feed}| + {lang hot_feed} +

            + +

            + + {$_G[setting][magics][thunder]} + + {lang all_friends}|$value +

            + +

            + {$_G[setting][magics][thunder]} +

            + + + + + +
            +
            +
            +
            +

            {lang feed}

            +
            +
            + + +
            +
            + $_G[setting][bbname] + {$space[username]} + {lang memcp_profile} +
            +
            + +
            +
            +
            + +
            +
            +
            +
            +
            + + + +
            + +

            {lang view_more_hot} {lang recent_recommended_hot}

            +
              + + + + +
            + + + + + +

            + {lang yesterday}{lang today}$day +

            + + +
              + + + +
            + + +
            + +

            + {lang yesterday}{lang today}$day +

            + + + +
            +
            + + + + + +
            +
            +
              + + + +
            + + +

            {lang open}

            + + +
            +
            + + +
            + +

            {lang no_feed}

            + + + +
            + {lang depending_your}{lang filter_settings},{lang shield_feed_message} ({lang click_view}) +
            + + + +
            + + + + + +
            $multi
            + + + +
            +
            + +
            +
            + +
            + +
            +
            +
            + + + +
            +
            + +
            +
            + + +
            + + + + + \ No newline at end of file diff --git a/template/default/home/space_index.htm b/template/default/home/space_index.htm new file mode 100644 index 0000000..03fa43b --- /dev/null +++ b/template/default/home/space_index.htm @@ -0,0 +1,62 @@ + +
            +
            +
            +
            + +
            + + + +
            + $value +
            + + +
            + +
            + +
            + + + +
            + $value +
            + + +
            + + +
            + +
            + + + +
            + $value +
            + + +
            + +
            +
            +
            + + diff --git a/template/default/home/space_list.htm b/template/default/home/space_list.htm new file mode 100644 index 0000000..d96d132 --- /dev/null +++ b/template/default/home/space_list.htm @@ -0,0 +1,45 @@ + + +
            $multi
            + + +
            {lang no_members_of}
            + \ No newline at end of file diff --git a/template/default/home/space_magic.htm b/template/default/home/space_magic.htm new file mode 100644 index 0000000..023ba27 --- /dev/null +++ b/template/default/home/space_magic.htm @@ -0,0 +1,42 @@ + + +
            +
            +
            +

            + {lang magics_shop} + {lang magics_user} + {lang magics_log} + {lang magics_title} +

            + +
            {lang magics_tips}
            + + + + + + + + + +
            +
            +
            + +
            +
            + \ No newline at end of file diff --git a/template/default/home/space_magic_log.htm b/template/default/home/space_magic_log.htm new file mode 100644 index 0000000..12e2be1 --- /dev/null +++ b/template/default/home/space_magic_log.htm @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + +
            {lang magics_name}{lang magics_dateline_use}{lang magics_target_use}
            $log[name]$log[dateline] + + {lang magics_target} + + {lang magics_target} + + {lang magics_target} + + {lang magics_operation_sell} + + {lang magics_operation_drop} + +
            +
            $multipage
            + +

            {lang data_nonexistence}

            + + + + + + + + + + + + + + + + + + +
            {lang magics_name}{lang magics_dateline_buy}{lang magics_amount_buy}{lang magics_price_buy}
            $log[name]$log[dateline]$log[amount]$log[price] {$_G['setting']['extcredits'][$log[credit]][unit]}{$_G['setting']['extcredits'][$log[credit]][title]}
            +
            $multipage
            + +

            {lang data_nonexistence}

            + + + + + + + + + + + + + + + + + +
            {lang magics_name} + {lang magics_dateline_present}{lang magics_amount_present}{lang magics_target_present}
            $log[name]$log[dateline]$log[amount]$log[username]
            +
            $multipage
            + +

            {lang data_nonexistence}

            + + + + + + + + + + + + + + + + + + +
            {lang magics_name}{lang magics_dateline_receive}{lang magics_amount_receive}{lang magics_target_receive}
            $log[name]$log[dateline]$log[amount]$log[username]
            +
            $multipage
            + +

            {lang data_nonexistence}

            + + \ No newline at end of file diff --git a/template/default/home/space_magic_mybox.htm b/template/default/home/space_magic_mybox.htm new file mode 100644 index 0000000..a4c5618 --- /dev/null +++ b/template/default/home/space_magic_mybox.htm @@ -0,0 +1,40 @@ + + +

            {lang magics_capacity}: $totalweight/{$_G['group']['maxmagicsweight']}

            + + + + +
            $multipage
            + +

            {lang data_nonexistence}

            + diff --git a/template/default/home/space_magic_mybox_opreation.htm b/template/default/home/space_magic_mybox_opreation.htm new file mode 100644 index 0000000..c3c3c2b --- /dev/null +++ b/template/default/home/space_magic_mybox_opreation.htm @@ -0,0 +1,167 @@ + + +
            +
            $_G[setting][bbname] $navigation
            +
            +
            +
            +
            + + +
            +
            +

            + + + {lang magics_operation_present}{lang magic} + + {lang magics_operation_drop}{lang magic} + + {lang magics_operation_sell}{lang magic} + + {lang magics_operation_use}{lang magic} + + + {lang close} +

            +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + +
             {lang magics_operation_present}"$magic[name]"
            {lang magics_target_present} + + + + + +
            {lang magics_num}
            {lang magics_present_message}
            + + + +

            + +

            + +
            +
            $magic[name]
            +
            + $magic[name] +
            + + + + +

            {lang magics_outofperoid_1}{lang magics_outofperoid_2}{lang magics_outofperoid_3}{lang magics_outofperoid_4}{lang magics_outofperoid_value}{lang magics_outofperoid_noperm}

            + +
            +
            +
            + + + + + + + + +
            +
            $magic[name]
            +
            +

            {lang magics_operation_sell} {lang magics_unit}"$magic[name]"

            +

            + {lang recycling_prices}: + + {$_G['setting']['extcredits'][$magic[credit]][title]} $discountprice {$_G['setting']['extcredits'][$magic[credit]][unit]}/{lang magics_unit} + + $discountprice {$_G['setting']['extcredits'][$magic[credit]][title]}/{lang magics_unit} + +

            +
            +
            + + +
            +
            $magic[name]
            +
            +

            {lang magics_operation_drop} {lang magics_unit}"$magic[name]"

            +

            {lang magics_weight}: $magic[weight]

            +
            +
            + + +
            +
            + +
            +
            + + + + + + + + + +
            +
            +
            + + + + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_magic_shop.htm b/template/default/home/space_magic_shop.htm new file mode 100644 index 0000000..ecf076b --- /dev/null +++ b/template/default/home/space_magic_shop.htm @@ -0,0 +1,62 @@ + +
            + + {lang magics_capacity}: $totalweight/{$_G['group']['maxmagicsweight']}| + + + {lang magics_discount}| + {lang you_have_now} + + + , {$_G['setting']['extcredits'][$id][img]} {$_G['setting']['extcredits'][$id][title]} {$_G['setting']['extcredits'][$id][unit]} + + + + |{lang buy_credits} + + + |{lang credit_exchange} + + +
            + +
              + +
            • + +
              + $magic[name] +
              +

              $magic[name]

              +

              + + {$_G['setting']['extcredits'][$magic[credit]][title]} $magic[price] {$_G['setting']['extcredits'][$magic[credit]][unit]}/{lang magics_unit} + + $magic[price] {$_G['setting']['extcredits'][$magic[credit]][title]}/{lang magics_unit} + + ({lang sold} $magic[salevolume] {lang magics_unit}) +

              + +

              + + {lang magics_operation_buy} + + | {lang magics_operation_present} + + + {lang magic_empty} + +

              +
            • + +
            +
            $multipage
            + +

            {lang data_nonexistence}

            + \ No newline at end of file diff --git a/template/default/home/space_magic_shop_opreation.htm b/template/default/home/space_magic_shop_opreation.htm new file mode 100644 index 0000000..bfe0a33 --- /dev/null +++ b/template/default/home/space_magic_shop_opreation.htm @@ -0,0 +1,154 @@ + + + +
            +
            $_G[setting][bbname] $navigation
            +
            +
            +
            +
            + + +
            +
            +

            + + + {lang magics_operation_buy}{lang magic} + + {lang magics_operation_present}{lang magic} + + + {lang close} +

            +
            + + + + + + + + + +
            +
            +
            +
            +
            +
            +

            $magic[name]

            +

            $magic[description]

            +

            {lang magics_price}: {$_G['setting']['extcredits'][$magic[credit]][title]} $magic[price] {$_G['setting']['extcredits'][$magic[credit]][unit]}

            + +

            {lang magics_discountprice}: {$_G['setting']['extcredits'][$magic[credit]][title]} $magic[discountprice] $_G['setting']['extcredits'][$magic[credit]][unit]

            + +

            {lang magics_yourcredit} {$_G['setting']['extcredits'][$magic[credit]][unit]}

            +

            {lang magics_weight}: $magic[weight]

            +

            {lang my_magic_volume} $allowweight

            +
            +
            +

            {lang stock}: $magic[num] {lang magics_unit}

            + +

            {lang magics_outofperoid_1}{lang magics_outofperoid_2}{lang magics_outofperoid_3}{lang magics_outofperoid_4}{lang magics_outofperoid_value}{lang magics_outofperoid_noperm}

            + +

            {lang magics_permission_no}

            +

            {lang memcp_usergroups_buy} {lang magics_unit}

            +
            +
            +
            + + + + + + + + + + + + + + + + + + + +
             {lang magics_operation_present}"$magic[name]"
            {lang magics_target_present} + + + + + +
            {lang magics_num}
            {lang magics_present_message}
            + + +
            +
            +
            +
            + + + + + +
            +
            +
            + + + + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_medal.htm b/template/default/home/space_medal.htm new file mode 100644 index 0000000..69c54e0 --- /dev/null +++ b/template/default/home/space_medal.htm @@ -0,0 +1,162 @@ + + + +
            +
            +
            +

            + {lang my_medals} + {lang medals_center} +

            + + + + +
            + {lang you_have_now} + + + , {$_G['setting']['extcredits'][$id][img]} {$_G['setting']['extcredits'][$id][title]} {$_G['setting']['extcredits'][$id][unit]} + + +
            + +
              + +
            • + +
              $medal['name']
              +

              $medal[name]

              +

              + + {lang space_medal_have} + + + + + {lang space_medal_purchased} + + + {lang space_medal_applied} + + {lang space_medal_receive} + + + + + + {lang space_medal_buy} + + + {lang medals_apply} + + {lang medals_draw} + + + + + + +

              +
            • + +
            + + +

            {lang medals_nonexistence}

            + +

            {lang medals_noavailable}

            + + + + +

            {lang medals_record}

            + + + + + +
              + +
            • +
              $mymedal['name']
              +

              $mymedal[name]

              +
            • + +
            + + + +

            {lang medals_record}

            +
              + +
            • + + {lang medals_message3} $medallog[dateline] {lang medals_message4} $medallog[name] {lang medals},{lang medals_operation_2}{lang medals_operation_3} + + {lang medals_message3} $medallog[dateline] {lang medals_message5} $medallog[name] {lang medals},{lang expire}: $medallog[expiration]{lang medals_noexpire} + +
            • + +
            +
            $multipage
            + +

            {lang medals_nonexistence_own}

            + + +
            +
            +
            +
            +

            {lang medals}

            + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_medal_float.htm b/template/default/home/space_medal_float.htm new file mode 100644 index 0000000..c8fb6a4 --- /dev/null +++ b/template/default/home/space_medal_float.htm @@ -0,0 +1,85 @@ + + +
            +
            $_G[setting][bbname] $navigation
            +
            +
            +
            +
            + + +
            +
            +

            + {lang space_medal_buy}{lang medals}{lang space_medal_apply} + + {lang close} + +

            + + + + + +
            +
            +
            +
            + $medal['name'] +
            +
            +
            +

            $medal[name]

            +

            $medal[description]

            +

            + + {lang expire} $medal[expiration] {lang days}
            + + + $medal[permission]
            + + + {lang medals_type_0} + + + + {$_G['setting']['extcredits'][$medal[credit]][title]} $medal[price] {$_G['setting']['extcredits'][$medal[credit]][unit]} + + $medal[price] {$_G['setting']['extcredits'][$medal[credit]][title]} + + + {lang medals_type_1} + + + {lang medals_type_2} + +

            +
            +
            +
            +
            +
            + + + +
            +
            + + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_menu.htm b/template/default/home/space_menu.htm new file mode 100644 index 0000000..2926d24 --- /dev/null +++ b/template/default/home/space_menu.htm @@ -0,0 +1,145 @@ + +
            + + + +
            + + + + +
            + + + + + +
            + \ No newline at end of file diff --git a/template/default/home/space_notice.htm b/template/default/home/space_notice.htm new file mode 100644 index 0000000..cdbf1c7 --- /dev/null +++ b/template/default/home/space_notice.htm @@ -0,0 +1,121 @@ + + +
            +
            + $_G[setting][bbname] + {lang prompt} + {lang remind} +
            +
            + + +
            +
            +
            + +
            +
            +
            +

            {lang remind}

            + + + + + +
            + + {lang no_new_notice}{lang view_old_notice} + + {lang no_notice} + +
            + + + + + +
            +
            + +
            +
            + + + + systempm + +
            +
            + {lang shield} + +
            +
            + $value[note] +
            + + +
            {lang ignore_same_notice_message}
            + + +
            + +
            +
            + + + + + +
            $multi
            + +
            +
            +
            + + +
            +
            +
            + +
            +
            + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_plugin.htm b/template/default/home/space_plugin.htm new file mode 100644 index 0000000..0357c4e --- /dev/null +++ b/template/default/home/space_plugin.htm @@ -0,0 +1,39 @@ + + + + + +
            +
            +
            + + +
            +
            +
            +
            + +
            +
            +
            +
            + + +
            +
            +
            + +
            +
            + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_pm.htm b/template/default/home/space_pm.htm new file mode 100644 index 0000000..6edcfa1 --- /dev/null +++ b/template/default/home/space_pm.htm @@ -0,0 +1,550 @@ + + +
            +
            + $_G[setting][bbname] + {lang prompt} + {lang news} +
            +
            + + +
            +
            +
            + +
            +
            +
            +

            {lang news}

            + + + + + + + + + + + +
            + +
            + {lang pm_totail} + [{lang pm_export}] +
            +
            + + + + + + +
            +

            $membernum {lang pm_members_message} : $subject

            +
            + + +
            + +   + + +
            + +
            +
            +
            + +

            $value[author]  

            +

            $value[message]

            + +
            + + + + + + +
            + + + + +
            +
            $multi
            + + +
            + + + +

            {lang sendpm_tip}

            +
            + + + + + + + + +
            + {lang no_corresponding_pm} +
            + + + + +
            +
            +
            + +
            +
            +
            +
            +
            + + {lang refresh} + + + +
            +
            + +
            +
            +

            + + +

            + + +
            +
            +
            +
            + + +
            +
            + + + + +
            +
            +
            + {lang menu} + +
            +
            + + + + + +
            +
            + {lang sendmultipmwho}{lang sendmultipmsystem}  + +
            +
            +

            $grouppm[message]

            + +

            + {lang reply} $grouppm[author] +

            + +
            + +
            +
            + +
            + {lang no_corresponding_pm} +
            + + + + +
            + + + + + + + + + + + + + +
            {lang pm_onlyacceptfriendpm} + + +
            {lang ignore_list} + +
            {lang ignore_member_pm_message}
            +
            + +
            + + + + +
            +
            + + +
            +
            + {lang menu} + +
            +
            +
            + + + + + + + +
            +
            +
            + +
            + + $grouppm[author] {lang say} : + + $grouppm[message]   +   + {lang show} +
            +
            + + + +
            +
            +
            + + + + + +
            +
            +
            + + + + + + + + + +
            + + + {lang you} {lang you_to} {$value[tousername]} {lang say} :
            + + {$value[tousername]} {lang you_to} {lang you} {lang say} :
            + + $value[lastsummary]  
            +   + + + {lang pm_num} + {lang menu} + | + {lang reply} + + + + + + + + + + +
            $value[members] {lang pm_members_message} :
            +

            $value[subject]

            + +

            {lang dots}

            +

            + $value[lastauthor] : + $value[lastsummary]   + + {lang reply} +

            + +
            + + + {lang pm_num} + {lang menu} + | + {lang reply} + + +
            +
            + +
            +
            + $multi + +   + + + +
            + + +
            + + +
            + {lang no_corresponding_pm} +
            + + + + +
            +
            +
            + + +
            +
            +
            + +
            +
            + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_pm_node.htm b/template/default/home/space_pm_node.htm new file mode 100644 index 0000000..6aa8500 --- /dev/null +++ b/template/default/home/space_pm_node.htm @@ -0,0 +1,36 @@ + +
            + +
            + {lang menu} + +
            + +
            + + + +
            +
            + + + {lang you} + + {$value[author]} + +   +
            + $value[message]
            + +
            + +
            \ No newline at end of file diff --git a/template/default/home/space_poll.htm b/template/default/home/space_poll.htm new file mode 100644 index 0000000..c63bba5 --- /dev/null +++ b/template/default/home/space_poll.htm @@ -0,0 +1,132 @@ + + + + + + +
            +
            +
            + +
            +
            +
            +
            + +

            {lang poll}

            + + + + + + + + +

            + {lang my_create}| + {lang my_join} +

            + + + +

            + {lang view_by_friend} + +

            + + + + + +

            {lang hide_poll}

            + +
            $multi
            + +
            {lang no_poll}
            + +
            +
            +
            +
            + + +
            +
            +
            + +
            +
            + +
            +
            +
            + + + + \ No newline at end of file diff --git a/template/default/home/space_privacy.htm b/template/default/home/space_privacy.htm new file mode 100644 index 0000000..542fe24 --- /dev/null +++ b/template/default/home/space_privacy.htm @@ -0,0 +1,138 @@ + + +{eval + $space['isfriend'] = $space['self']; + if(in_array($_G['uid'], (array)$space['friends'])) $space['isfriend'] = 1; + space_merge($space, 'count'); + space_merge($space, 'field_home'); +} + +
            +
            + $_G[setting][bbname] + $_G[setting][navs][4][navname] + {lang privacy_prompt} +
            +
            +
            +
            +
            + + + + + + +
            +
            +

            {$space[username]}

            +
            +

            + {lang set_privacy} +

            +

            + {lang view_friend_list} + + |{lang ignore_friend} + + |{lang add_friend} + + |{lang say_hi} + |{lang send_pm} + + + |{lang manage_member} + +

            + +

            $space[spacenote]

            + + +
            +

            {lang active_profile}

            +
              +
            • {lang management_team}: {$space[admingroup][grouptitle]} {$space[admingroup][icon]}
            • +
            • {lang usergroup}: {$space[group][grouptitle]} {$space[group][icon]}
            • +
            • {lang group_expiry_type_ext}: $space[extgroupids]
            • +
            • {lang regdate}: $space[regdate]
            • +
            • {lang last_visit}: $space[lastvisit]
            • + +
            • {lang register_ip}: $space[regip] - $space[regip_loc]
            • +
            • {lang last_visit_ip}: $space[lastip] - $space[lastip_loc]
            • + +
            • {lang last_activity_time}: $space[lastactivity]
            • +
            • {lang last_post_time}: $space[lastpost]
            • +
            • {lang last_send_email}: $space[lastsendmail]
            • +
            • {lang time_offset}: + + $timeoffset[$space[timeoffset]] +
            • +
            +
            + +
              +
            • {lang space_visits}: $space[views]
            • +
            • {lang friends_num}: $space[friends]
            • +
            • {lang posts_num}: $space[posts]
            • +
            • {lang threads_num}: $space[threads]
            • +
            • {lang digest_num}: $space[digestposts]
            • +
            • {lang doings_num}: $space[doings]
            • +
            • {lang blogs_num}: $space[blogs]
            • +
            • {lang albums_num}: $space[albums]
            • +
            • {lang shares_num}: $space[sharings]
            • + +
            • {lang used_space}:
            • +
            + +
              +
            • {lang credits}: $space[credits]
            • + + +
            • $value[title]: {$space["extcredits$key"]} $value[unit]
            • + + + +
            • {lang buyer_credit}: $space[buyercredit]
            • +
            • {lang seller_credit}: $space[sellercredit]
            • +
            + + +
            +

            {lang medals}

            + + $medal['name']   + +
            + + + + + + +
            +

            {lang profile_verify}

            + + + $verify[title]$verify[title]  + + +
            + + +
            +

            {lang manage_forums}

            + + $value   + +
            + + + +

            {lang become_friend_message}

            +

            {lang add_friend}

            + +
            +
            +
            +
            + diff --git a/template/default/home/space_profile.htm b/template/default/home/space_profile.htm new file mode 100644 index 0000000..63f6df1 --- /dev/null +++ b/template/default/home/space_profile.htm @@ -0,0 +1,49 @@ + + +
            +
            +
            +
            +

            {lang memcp_profile}

            +
            +
            + + +
            +
            + $_G[setting][bbname] + {$space[username]} + {lang memcp_profile} +
            +
            + +
            +
            +
            + +
            +
            +
            +
            +
            + + + + +
            +
            +
            + +
            +
            + + +
            +
            + + +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_profile_body.htm b/template/default/home/space_profile_body.htm new file mode 100644 index 0000000..9e91aca --- /dev/null +++ b/template/default/home/space_profile_body.htm @@ -0,0 +1,231 @@ +
            + +
            +

            + {$space[username]} + +   + + (UID: {$space[uid]} + + + , $_G[$isfriendinfo][note] + + ) +

            + + + + + +
              + + +
            • {lang second_domain}$spaceurl
            • + + +
            • {lang space_visits}$space[views]
            • + + +
            • Email$space[email]
            • + +
            • {lang email_status}{lang profile_verified}{lang profile_no_verified}
            • +
            +
              +
            • {lang spacenote}  $space[spacenote]
            • +
            • {lang permission_basic_status}  $space[customstatus]
            • +
            • {lang personal_signature}  
              $space[sightml]
            • +
            + + + + + + +
              + +
            • $value[title]$value[value]
            • + +
            +
            + + + + + + +
            +

            {lang medals}

            +

            + + + $medal['name'] + + +

            +
            + + + + + + + + + +
            +

            {lang profile_verify}

            + + + + + $verify[title]$verify[title]  + + $verify[title]  + + + + +
            + + +
            +

            {lang manage_forums}

            + + $value   + +
            + + +
            +

            {lang joined_group}

            + + $value['name']   + +
            + +
            +

            {lang active_profile}

            + +
              +
            • {lang online_time}$space[oltime] {lang hours}
            • +
            • {lang regdate}$space[regdate]
            • +
            • {lang last_visit}$space[lastvisit]
            • + +
            • {lang register_ip}$space[regip]:$space[regport] - $space[regip_loc]
            • +
            • {lang last_visit_ip}$space[lastip]:$space[port] - $space[lastip_loc]
            • + +
            • {lang last_activity_time}$space[lastactivity]
            • +
            • {lang last_post_time}$space[lastpost]
            • +
            • {lang last_send_email}$space[lastsendmail]
            • +
            • {lang time_offset} + + $timeoffset[$space[timeoffset]] +
            • +
            +
            +
            +

            {lang stat_info}

            +
              +
            • {lang used_space}$space[attachsize]
            • + +
            • {lang eccredit_buyerinfo}$space[buyercredit]
            • + + +
            • {lang eccredit_sellerinfo}$space[sellercredit]
            • + +
            • {lang credits}$space[credits]
            • + + +
            • $value[title]{$space["extcredits$key"]} $value[unit]
            • + + +
            +
            + +
            +

            {lang crime_record}

            + + + + + + + + + + + + + + + +
            {lang crime_action}{lang crime_dateline}{lang crime_reason}{lang crime_operator}
            + + {lang crime_delpost} + + {lang crime_warnpost} + + {lang crime_banpost} + + {lang crime_banspeak} + + {lang crime_banvisit} + + {lang crime_banstatus} + + {lang crime_avatar} + + {lang crime_sightml} + + {lang crime_customstatus} + + $crime[reason]$crime[operator]
            +
            + + + + + + +
            \ No newline at end of file diff --git a/template/default/home/space_prompt_nav.htm b/template/default/home/space_prompt_nav.htm new file mode 100644 index 0000000..8585d31 --- /dev/null +++ b/template/default/home/space_prompt_nav.htm @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/template/default/home/space_reward.htm b/template/default/home/space_reward.htm new file mode 100644 index 0000000..fc65cc7 --- /dev/null +++ b/template/default/home/space_reward.htm @@ -0,0 +1,107 @@ + + + + +
            +
            +
            +
            +
            +
            +
            + +

            {lang reward}

            + + + + + + +

            + + + + + + {lang view_by_friend} + + +

            + +
              + +
            • +
              + $_G[setting][extcredits][$creditid][title] + {lang has_been_resolved}{lang unresolved} +
              +

              $thread[subject]

              +

              $thread[author] $thread[dateline]

              +

              {lang have} $thread[replies] {lang unit}{lang not_yet}{lang security_answer}|{lang i_answer}

              +
            • + + +
            •  
            • + +
            + +

            {lang hide_reward}

            + +
            $multi
            + +
            {lang no_reward}
            + +
            +
            +
            +
            + + +
            +
            +
            +
            +
            +
            +
            +
            + + \ No newline at end of file diff --git a/template/default/home/space_share_form.htm b/template/default/home/space_share_form.htm new file mode 100644 index 0000000..642fb78 --- /dev/null +++ b/template/default/home/space_share_form.htm @@ -0,0 +1,22 @@ +
            +

            {lang share_web_music_flash}

            +

            +   + + {lang help} +

            + + + + + + + +
            \ No newline at end of file diff --git a/template/default/home/space_share_li.htm b/template/default/home/space_share_li.htm new file mode 100644 index 0000000..56bdc7e --- /dev/null +++ b/template/default/home/space_share_li.htm @@ -0,0 +1,44 @@ +
          • +
            +
            + + {lang sharemetoo} + | + + + {lang comment} + + | + {lang delete} + +
            + $value[username] + $value[title_template] + ({lang moderate_need}) + +
            +
            + + + +
            + $value[body_template] +
            + + + {$value['body_data']['player']} + + + + {$value['body_data']['player']} + + + + {$value['body_data']['player']} + + + +
            $value[body_general]
            + +
            +
          • \ No newline at end of file diff --git a/template/default/home/space_share_list.htm b/template/default/home/space_share_list.htm new file mode 100644 index 0000000..4f21918 --- /dev/null +++ b/template/default/home/space_share_list.htm @@ -0,0 +1,144 @@ + + + +
            +
            +
            +
            +

            {lang share}

            +
            +
            + + + + +
            +
            +
            + +
            +
            +
            +
            +
            + + + + + + + + +
            +
            +
            +
            + +
            + +
            +
            +
            + + + + + +
            + +
            +
            +
            + + + + + +

            + {lang order_by_type}: + {lang share_all}| + {lang share_link}| + {lang share_video}| + {lang share_music}| + {lang share_flash}| + + {lang share_blog}| + + + {lang share_album}| + {lang share_pic}| + + {lang share_poll}| + {lang share_space}| + {lang share_thread} + + | + {lang share_article} + +

            + +
              + + + +
            + +

            {lang hide_share}

            + +
            $multi
            + +
              +

              {lang not_share_yet}

              + + +
              + + +
              +
              + +
              +
              + + + +
              +
              + + +
              +
              +
              + + + + + \ No newline at end of file diff --git a/template/default/home/space_share_view.htm b/template/default/home/space_share_view.htm new file mode 100644 index 0000000..1ed930a --- /dev/null +++ b/template/default/home/space_share_view.htm @@ -0,0 +1,131 @@ + + + +
              +
              +
              +
              +

              {lang share}

              +
              +
              + +
              +
              +

              $share[title_template]

              + + + {lang delete}    + + + {lang hot} + + + + {lang hot} $share[hot] + +
              +
              + + + + {$share[body_template]}
              + + {$share['body_data']['player']} + + {$share['body_data']['player']} + +
              + +
              + + + +
              $share[body_general]
              + +
              +
              +
              +
              +

              + + {lang publish_comment} + + {lang comment} +

              +
              + +
              + {lang current_blog_replay}{lang click_view_all} +
              + +
              + + + +
              +
              +
              $multi
              +
              + +
              + +

              + facelist + + doodle{$_G[setting][magics][doodle]} + +

              + +
              +
              + + + + + +
              +
              + + +
              + +

              + + + + + + +

              + + + + + + +
              +
              +
              +
              + +
              +
              + + \ No newline at end of file diff --git a/template/default/home/space_status.htm b/template/default/home/space_status.htm new file mode 100644 index 0000000..002f177 --- /dev/null +++ b/template/default/home/space_status.htm @@ -0,0 +1,91 @@ +
              + $space[spacenote] +
              + + +
              +
              + + + + + + + + + +
              + + + +
              + {lang doing_maxlimit_char} + + + + {lang doing_sync}: + + {lang doing_update_personal_signature} + + + + + + + + + +
              +
              + + + + +
              + +
              + diff --git a/template/default/home/space_task.htm b/template/default/home/space_task.htm new file mode 100644 index 0000000..4a9045e --- /dev/null +++ b/template/default/home/space_task.htm @@ -0,0 +1,32 @@ + + + + +
              +
              +
              + + + + + +
              +
              + +
              + \ No newline at end of file diff --git a/template/default/home/space_task_detail.htm b/template/default/home/space_task_detail.htm new file mode 100644 index 0000000..44fba72 --- /dev/null +++ b/template/default/home/space_task_detail.htm @@ -0,0 +1,146 @@ +

              + {lang task} {lang task_detail} +

              +

              {lang task_endtime}

              +
              + + + + + + + + + + + + + + + + + + + +
              Icon +

              $task[name]

              + +
              + + ( {lang task_period_hour} ) + + ( {lang task_period_day} ) + + + ( {lang task_period_week} ) + + ( {lang task_period_month} ) + +
              + +
              $task[description]
              +
                + + + + + + + + + + + + + + + + + + + +
              {lang task_reward} + + {lang credits} $_G['setting']['extcredits'][$task[prize]][title] $task[bonus] $_G['setting']['extcredits'][$task[prize]][unit] + + {lang magics_title} $task[rewardtext] $task[bonus] {lang magics_unit} + + {lang medals} $task[rewardtext] {lang expire} $task[bonus] {lang days} + + {lang invite_code} $task[prize] {lang expire} $task[bonus] {lang days} + + {lang usergroup} $task[rewardtext] $task[bonus] {lang days} + + {lang nothing} + +
               $task[viewmessage]
              {lang task_complete_condition} + +
                + +
              • $taskvar[name] : $taskvar[value]
              • + +
              + +

              {lang unlimited}

              + +
              {lang task_apply_condition} + +
                +
              • {lang usergroup}: $task[grouprequired] {lang task_general_users}{lang task_admins}
              • +
              • {lang task_relatedtask}: $_G['taskrequired']
              • +
              • {lang task_exclusivetask}: $_G['taskexclusive']
              • +
              • {lang task_numlimit}: $task[tasklimits]
              • + + +
              • $taskvar[name]: $taskvar[value]
              • + + +
              + +

              {lang unlimited}

              + +
              +
                + +
              +
              +
              {lang task_complete} $task[csc]%
              +
              +

              + {lang task_reward_get} + {lang task_quit} +

              + +

              {lang task_group_nopermission}

              + {lang task_newbie_apply} + +

              {lang task_applies_full}

              + {lang task_newbie_apply} + +

              {lang task_lose_on}$task[dateline]

              + +

              {lang task_complete_on}$task[dateline]

              + +

              {lang task_complete_on}$task[dateline]   {$task[t]}{lang task_applyagain}

              + {lang task_newbie_apply} + +

              {lang task_lose_on}$task[dateline]   {$task[t]}{lang task_reapply}

              + {lang task_newbie_apply} + +

              {lang task_complete_on}$task[dateline]   {lang task_applyagain_now}

              + +

              {lang task_lose_on}$task[dateline]   {lang task_reapply_now}

              + + + + {lang task_newbie_apply} + +
                + +
              +

              {lang task_applicants}

              +
              +
              + +
              +
              \ No newline at end of file diff --git a/template/default/home/space_task_list.htm b/template/default/home/space_task_list.htm new file mode 100644 index 0000000..c90b927 --- /dev/null +++ b/template/default/home/space_task_list.htm @@ -0,0 +1,62 @@ +

              + + {lang task_doing} + {lang task_done} + {lang task_failed} + {lang task_new} +

              +
              + + + + + + + + + + +
              $task[name] +

              $task[name] ({lang task_applies}: $task[applicants] )

              +

              $task[description]

              + +
              +
              +
              {lang task_complete} $task[csc]%
              +
              + +
              + + {lang credits} $_G['setting']['extcredits'][$task[prize]][title] $task[bonus] $_G['setting']['extcredits'][$task[prize]][unit] + + {lang magics_title} $listdata[$task[prize]] $task[bonus] {lang magics_unit} + + {lang medals} $listdata[$task[prize]] {lang expire} $task[bonus] {lang days} + + {lang invite_code} $task[prize] {lang expire} $task[bonus] {lang days} + + {lang usergroup} $listdata[$task[prize]] $task[bonus] {lang days} + + + + + {lang task_newbie_apply} + + {lang task_newbie_apply} + + {lang task_newbie_apply} + + +

              {lang task_reward_get}

              + +

              {lang task_complete_on} $task[dateline] +
              {lang task_applyagain_now}{$task[t]}{lang task_applyagain}

              + +

              {lang task_lose_on} $task[dateline] +
              {lang task_applyagain_now}{$task[t]}{lang task_reapply}

              + +
              + +

              {lang task_nonew}{lang task_nodoing}{lang data_nonexistence}

              + +
              \ No newline at end of file diff --git a/template/default/home/space_task_parter.htm b/template/default/home/space_task_parter.htm new file mode 100644 index 0000000..5bd1e49 --- /dev/null +++ b/template/default/home/space_task_parter.htm @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/template/default/home/space_thread.htm b/template/default/home/space_thread.htm new file mode 100644 index 0000000..7ab56d6 --- /dev/null +++ b/template/default/home/space_thread.htm @@ -0,0 +1,304 @@ +{eval + $space_uid = $space['uid']; + $filter = array( 'common' => '{lang have_posted}', 'save' => '{lang draft}', 'close' => '{lang closed}', 'aduit' => '{lang pending}', 'ignored' => '{lang ignored}', 'recyclebin' => '{lang recyclebin}'); + $_G['home_tpl_spacemenus'][] = "{lang they_thread}"; +} + + + + +
              +
              +
              +
              + {lang posted} +

              + + {lang topic}|{lang reply} + + {lang topic}|{lang reply} + +

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + +
              +
              +
              +
              + +
              + +
              +
              +
              + + +
              +
              +

              {lang thread}

              + +
              +
              +
              +
              + + + + + +

              + + + {lang all} + |$name   + + + + {lang topic}| + {lang reply}| + {lang post_comment} +   +

              + +

              + {lang newest_thread}| + {lang top_thread} +

              + + + + +

              + {lang topic} + | + {lang reply} +

              + + + +

              + {lang view_by_friend} + +

              + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                {lang post}{lang topic}{lang forum}/{lang group}{lang author}{lang replies}{lang last_post}
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $thread[subject] + + $thread[subject] + + + {lang digest}$thread[digest] + + + + + + + $thread[multipage] + + $filter[recyclebin] + $filter[aduit] + $filter[ignored] + $filter[save] + $filter[close] + + + + $forums[$thread[fid]] + + $thread[author] + $thread[dateline] + + $thread[replies] + $thread[views] + + $thread[lastposter] + $thread[lastpost] +
                {$post[message]}......
               $thread[comment]

              {lang no_related_posts}

              + + +

              + + +

              + +
              + + +

              {lang hide_thread}

              + +
              +
              $multi
              + + + +
              + + +
              +
              + +
              +
              + + + +
              +
              + + +
              +
              +
              + + + \ No newline at end of file diff --git a/template/default/home/space_thread_nav.htm b/template/default/home/space_thread_nav.htm new file mode 100644 index 0000000..6e0fd22 --- /dev/null +++ b/template/default/home/space_thread_nav.htm @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/template/default/home/space_trade.htm b/template/default/home/space_trade.htm new file mode 100644 index 0000000..1dd2277 --- /dev/null +++ b/template/default/home/space_trade.htm @@ -0,0 +1,233 @@ + + + + + + + + + + + +
              +
              +
              + +
              +
              +
              +
              + +

              {lang trade}

              + + + + + + +

              + + + + + + {lang sale_of_goods}| + {lang credit_rating} + + +

              + + + +

              + {lang sell_trade}| + {lang buy_trade} +

              + + + +

              + {lang view_by_friend} + +

              + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang trade_goods_name} {lang trade_buyer}{lang trade_seller}{lang trade_amount} + + + {lang trade_rate}
              +
              +
              + $tradelog[subject]
              + $tradelog[threadsubject] +
              + + $tradelog[seller] + + $tradelog[buyer]$tradelog[buyer] + + + + $tradelog[price] {lang trade_units}
              + + + {$extcredits[$creditid][title]} $tradelog[credit] {$extcredits[$creditid][unit]} + +
              + + + $tradelog[status] + + $tradelog[status] + + + $tradelog[lastupdate] + + + {lang eccredit_post_between} + + {lang eccredit_post_waiting} + + {lang eccredit_post_already}
              + + {lang eccredit1} + + {lang eccredit1} + + +

              {lang data_nonexistence}

              +
              + + +
                + +
              • +

                $value[seller]

                + + {lang post_trade_sticklist} + $value[subject]
                +
                + +

                - {lang trade_closing} -

                + + +

                ¥ $value[price]

                + + +

                {lang additional} $value[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]}

                + + +

                $value[subject]

                +
              • + + + +
              •  
              • + + +
              + +
              {lang no_trade}
              + + +
              + +

              {lang hide_trade}

              + +
              $multi

              +
              +
              +
              + + +
              +
              +
              + +
              +
              + +
              +
              +
              + + + + \ No newline at end of file diff --git a/template/default/home/space_userabout.htm b/template/default/home/space_userabout.htm new file mode 100644 index 0000000..75cd8ab --- /dev/null +++ b/template/default/home/space_userabout.htm @@ -0,0 +1,121 @@ + +
              + \ No newline at end of file diff --git a/template/default/home/space_wall.htm b/template/default/home/space_wall.htm new file mode 100644 index 0000000..cd551e4 --- /dev/null +++ b/template/default/home/space_wall.htm @@ -0,0 +1,112 @@ + + + + + +
              +
              +
              +
              +

              {lang message}

              +
              +
              + + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + +
              +

              + facelist + + + doodle{$_G[setting][magics][doodle]} + +

              +
              +
              + + + +
              {lang connect_fill_profile_to_comment}
              + + + +
              +
              +

              + + + + + + + + +

              + +
              +
              + +
              +
              + +
              + {lang view_one_operation_message},{lang click_view_message} +
              + +
              + + + +
              +
              +
              $multi
              +
              + + +
              + + +
              +
              + +
              +
              + + + +
              +
              + + +
              +
              +
              + + + \ No newline at end of file diff --git a/template/default/home/spacecp_album.htm b/template/default/home/spacecp_album.htm new file mode 100644 index 0000000..f4e0028 --- /dev/null +++ b/template/default/home/spacecp_album.htm @@ -0,0 +1,260 @@ + + + + +
              + +
              + +
              +
              +
              +

              {lang album}

              + + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang site_categories} + $categoryselect + ({lang select_site_album_categories}) +
              {lang privacy_settings} + +
              {lang password}
              {lang specified_friends} + +

              {lang choices_following_friends_list}

              +
                + +

              {lang friend_name_space}

              +
                + + + +
               {lang delete_album}
              + +
              + + + + +
              + + + + + + + + + + + + + +
              {lang album_cover_notice}
              + + + +

              {lang set_to_conver}

              +
              + + + + + + + + + +

              {lang delete_pic_notice}

              +
              + + + +
              +
              $multi
              + + +
              {lang no_pics}
              + + + +

              + {lang delete_album} + {lang close} +

              +
              + + + +
              +

              {lang delete_album_message}

              +

              + {lang the_album_pic}: + +

              +
              +

              + +

              +
              + +

              + {lang edit_description} + {lang close} +

              +
              + + + + +
              + +
              +

              + +

              +
              + + +

              + {lang adjust_hot} + {lang close} +

              +
              + + + +
              + {lang new_hot}: +
              +

              + +

              +
              + +

              + {lang save_to_album} + {lang close} +

              +
              + + + + + +
              + {lang save_to}: +
              +

              + +

              +
              + + + + +
              +
              +
              + +
              +
              + + + diff --git a/template/default/home/spacecp_avatar.htm b/template/default/home/spacecp_avatar.htm new file mode 100644 index 0000000..d59473f --- /dev/null +++ b/template/default/home/spacecp_avatar.htm @@ -0,0 +1,59 @@ + + + + +
              + + + + + +
              + +

              {lang current_my_space}

              +

              {lang setting_avatar_message}

              +
              + +
              + + + + + + +
              +

              {lang setting_my_new_avatar}

              +

              {lang setting_my_new_avatar_message}

              +
              + + + + + +
              + + {lang setting_my_new_avatar_old} + + +
              + +
              +
              + +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_avatar_body.htm b/template/default/home/spacecp_avatar_body.htm new file mode 100644 index 0000000..884c178 --- /dev/null +++ b/template/default/home/spacecp_avatar_body.htm @@ -0,0 +1,46 @@ +
              +
              + +
              +
              + + +
              +
              +
              +
              + +
              + +
              + +
              + +
              + +
              + + + + +
              +
              + + +
              + +
              +
              +
              + + + + + + + + + + \ No newline at end of file diff --git a/template/default/home/spacecp_blog.htm b/template/default/home/spacecp_blog.htm new file mode 100644 index 0000000..58e7424 --- /dev/null +++ b/template/default/home/spacecp_blog.htm @@ -0,0 +1,283 @@ + + + +

              + {lang delete_blog} + {lang close} +

              +
              + + + +
              {lang sure_delete_blog}?
              +

              + +

              +
              + +

              + {lang stick_blog}{lang cancel_stick_blog} + {lang close} +

              +
              + + + + +
              {lang sure_stick_blog}{lang sure_cancel_stick_blog}?
              +

              + +

              +
              + + +

              + {lang create_category} + {lang close} +

              +
              +

              +
              +

              + +

              + + + +

              + {lang adjust_hot} + {lang close} +

              +
              + + + +
              + {lang new_hot}: +
              +

              + +

              +
              + +
              +
              + $_G[setting][bbname] + + {lang blog} + + $space[username] {lang somebody_space} + {lang blog} + + + + $blog[subject] {lang edit_blog} + + {lang memcp_blog} + +
              +
              + +
              +
              +
              +
              +

              + {lang previous_page} + {lang edit_blog}{lang memcp_blog} +

              +
              +
              + +
              + + + + + + + + + +
              + + +
              +
              + + + + + + + + + + + + + + + + + + + + + +
              {lang site_categories} + $categoryselect + ({lang select_site_blog_categories}) +
              {lang personal_category} + +
              {lang label}
              + + + + + + + + + + + + + + + +
              {lang privacy_settings} + + +
              {lang password}
              + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang specified_friends} + +

              {lang choices_following_friends_list}

              +
                + +

              {lang friend_name_space}

              +
              {lang hot} + +
              {lang feed_option} + +
              + + + + + + + + +
                + +
              + + + +
              + + + + +
              +
              +
              +
              + + + \ No newline at end of file diff --git a/template/default/home/spacecp_class.htm b/template/default/home/spacecp_class.htm new file mode 100644 index 0000000..fb551ac --- /dev/null +++ b/template/default/home/spacecp_class.htm @@ -0,0 +1,61 @@ + + + + + +
              +
              +
              + + + + +

              + {lang modify_category} + {lang close} +

              +
              + + + + +
              +

              +
              +

              + +

              +
              + + + +

              + {lang delete_category} + {lang close} +

              +
              + + + + + +
              {lang delete_category_message}
              +

              + +

              +
              + + + +
              +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_click.htm b/template/default/home/spacecp_click.htm new file mode 100644 index 0000000..9a569a8 --- /dev/null +++ b/template/default/home/spacecp_click.htm @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/template/default/home/spacecp_comment.htm b/template/default/home/spacecp_comment.htm new file mode 100644 index 0000000..6c808ad --- /dev/null +++ b/template/default/home/spacecp_comment.htm @@ -0,0 +1,112 @@ + + + + +
              +
              +
              + + + +

              + {lang edit} + {lang close} +

              +
              + + + + +
              +

              + + facelist +

              + +
              +

              + +

              +
              + + + +

              + {lang delete_reply} + {lang close} +

              +
              + + + + +
              {lang delete_reply_message}
              +

              + +

              +
              + + +

              + {lang reply} + {lang close} +

              +
              + + + + + + + +
              +
              +

              + + facelist + + doodle{$_G[setting][magics][doodle]} + +

              + + + +
              + +
              +

              + +

              +
              +
              + + + + + +
              +
              +
              +
              + + diff --git a/template/default/home/spacecp_common.htm b/template/default/home/spacecp_common.htm new file mode 100644 index 0000000..8aaf36b --- /dev/null +++ b/template/default/home/spacecp_common.htm @@ -0,0 +1,69 @@ + + + +
              +
              +
              + + + + +

              + {lang shield_notice} + {lang close} +

              +
              + + + + +
              +

              {lang no_view_notice_next}

              +

              +

              +
              +

              + +

              +
              + + + +

              + {lang modify_unitprice} + {lang close} +

              +
              + + + + +
              +

              {lang modify_unitprice_note}

              +

              +
              +

              + +

              +
              + + + + +
              +
              +
              +
              + + + \ No newline at end of file diff --git a/template/default/home/spacecp_credit_action.htm b/template/default/home/spacecp_credit_action.htm new file mode 100644 index 0000000..703bb57 --- /dev/null +++ b/template/default/home/spacecp_credit_action.htm @@ -0,0 +1,102 @@ + + +
              +
              $_G[setting][bbname] + {lang setup} + {lang memcp_credits_transfer}{lang memcp_credits_exchange}{lang memcp_credits_addfunds} +
              +
              +
              +
              +
              + +

              + {lang memcp_credits_transfer}{lang memcp_credits_exchange}{lang memcp_credits_addfunds} + {lang close} +

              +
              + + + + +
              + + + + +

              {lang memcp_credits_transfer_user} {$_G[setting][extcredits][$_G[setting][creditstransextra][9]][title]} $_GET[transferamount] {$_G[setting][extcredits][$_G[setting][creditstransextra][9]][unit]} {lang credits_give} {$to[username]}, {lang memcp_credits_password}

              +

              +

              {lang memcp_credits_transfer_message}

              +

              +
              +

              + +

              + +
              + + + + + +

              {lang memcp_credits_exchange_you_need} + + $_CACHE['creditsettings'][$tocredits][title] $exchangeamount $_CACHE['creditsettings'][$tocredits][unit] + + $_G[setting][extcredits][$tocredits][title] $exchangeamount $_G[setting][extcredits][$tocredits][unit] + + , {lang memcp_credits_exchange_you_pay} +

              +

              {lang memcp_credits_exchange_password}

              +

              +
              +

              + +

              + +
              + + + +

              {lang memcp_credits_addfunds_msg}

              +

              + + + + + + +

              +
              +

              + +

              + +
              + + + + + + +
              +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_credit_base.htm b/template/default/home/spacecp_credit_base.htm new file mode 100644 index 0000000..53e360e --- /dev/null +++ b/template/default/home/spacecp_credit_base.htm @@ -0,0 +1,331 @@ + + + + + + +
                + + + + + +
              • + {$credit[img]} {$credit[title]}: {$credit[unit]}   {lang card_use}»
              • + + + + +
              • {$credit[img]} {$credit[title]}: {$credit[unit]}
              • + + + +
              • {lang credits}: $_G['member']['credits'] ( $creditsformulaexp )
              • + + +
              + + + + + + + + + + + + + + + + + + + + + + + +
              +

              + {lang viewmore}»{lang memcp_credits_log} +

              +
              {lang operation}{lang logs_credit}{lang detail}{lang changedateline}
              $value['optype']$value['title']$value['credit']$value['opinfo']$value['text']$value['dateline']

              {lang memcp_credits_log_none}

              + + + + +
              + + + + + + + + + + + + + +
              {lang memcp_credits_addfunds} + +  {$_G[setting][extcredits][$_G[setting][creditstrans]][title]}  + {lang credits_need} {lang memcp_credits_addfunds_caculate_radio} + + {lang memcp_credits_addfunds_rules_ratio} = $_G[setting][ec_ratio] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
              {lang memcp_credits_addfunds_rules_min} $_G[setting][ec_mincredits] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
              {lang memcp_credits_addfunds_rules_max} $_G[setting][ec_maxcredits] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
              {lang memcp_credits_addfunds_rules_month} $_G[setting][ec_maxcreditspermonth] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
                + +
              +
              + + + + +
              + + + + + + + + + +
              {lang card} + +
              +
              + + + + + + + + +
                + +
              +
              + + + + + +
              + + + + + + + + + + + + + + + + + + + + + +
              {lang memcp_credits_transfer} + +  {$_G[setting][extcredits][$_G[setting][creditstransextra][9]][title]}  + {lang credits_give}  + + + {lang memcp_credits_transfer_min_balance} $_G[setting][transfermincredits] {$_G[setting][extcredits][$_G[setting][creditstransextra][9]][unit]}
              + {lang credits_tax} $taxpercent +
              *{lang transfer_login_password}
              {lang credits_transfer_message}
                + + +
              +
              + + + + + +
              + + + + + + + + + + + + + + + + + + +
              {lang memcp_credits_exchange} + + +  {lang credits_need}  + + + + + + + + + + {lang memcp_credits_exchange_min_balance} $_G[setting][exchangemincredits]
              + + + + {lang credits_tax} $taxpercent + + +
              *{lang transfer_login_password}
                + +
              +
              + + + + + {eval + $_TPL['cycletype'] = array( + '0' => '{lang one_time}', + '1' => '{lang everyday}', + '2' => '{lang the_time}', + '3' => '{lang interval_minutes}', + '4' => '{lang open_cycle}' + ); + } +
              +

              {lang activity_award_message}

              +
              + + + + + + + + + + + + + + + + + + + + + + +
              {lang action_name}{lang cycle_range}{lang max_award_per_week}$value[title]
              $value[rulename]$_TPL[cycletype][$value[cycletype]]$value[rewardnum]{lang unlimited_time}+$value[$creditkey]$value[$creditkey]0
              + + +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_credit_header.htm b/template/default/home/spacecp_credit_header.htm new file mode 100644 index 0000000..2d970d4 --- /dev/null +++ b/template/default/home/spacecp_credit_header.htm @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/template/default/home/spacecp_credit_log.htm b/template/default/home/spacecp_credit_log.htm new file mode 100644 index 0000000..3c467ce --- /dev/null +++ b/template/default/home/spacecp_credit_log.htm @@ -0,0 +1,113 @@ + + + + +

              + {lang credit_log}| + {lang credit_log_sys} +

              + + +
              +
              + + + + + + + + + + + + + + + + + +
              {lang credits}: + + + + {lang starttime_endtime}: + {lang credit_to} +
              {lang credit_income}: + + + + {lang operation}:$optypehtml
               
              + +
              + + + + + + + + + + + + + + + + +
              {lang operation}{lang credit_change}{lang detail}{lang changedateline}
              $value['optype']$value['title']$value['credit']$value['opinfo']$value['text']$value['dateline']
              + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang action_name}{lang total_time}{lang cycles_num}$value[title]{lang last_award_time}
              $log[rulename]$log[total]$log[cyclenum]$log[$creditkey]
              + +
              $multi
              + +
              +
              +
              + +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_doing.htm b/template/default/home/spacecp_doing.htm new file mode 100644 index 0000000..c894b2e --- /dev/null +++ b/template/default/home/spacecp_doing.htm @@ -0,0 +1,68 @@ + + + + + +
              +
              +
              + +

              + {lang delete_log} + {lang close} +

              +
              + + + +
              {lang determine_delete_doing}
              +

              + +

              +
              + +
              +
              +
              +
              + + + $space[spacenote] + + +
              +
              + facelist +   + + + + {lang cancel} + + +
              + +
              + + + + + + + + +
              + + + +
              + + + + \ No newline at end of file diff --git a/template/default/home/spacecp_domain.htm b/template/default/home/spacecp_domain.htm new file mode 100644 index 0000000..11ad2a9 --- /dev/null +++ b/template/default/home/spacecp_domain.htm @@ -0,0 +1,24 @@ + + + + +
              + +

              {lang edit_domain_message}

              +
              +

              + {$_G['scheme']}://.{$_G[setting][domain][root][home]} +   + +

              +

              {lang space_domain_message}

              +
              + +
              +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_ec_explain.htm b/template/default/home/spacecp_ec_explain.htm new file mode 100644 index 0000000..e01fd5a --- /dev/null +++ b/template/default/home/spacecp_ec_explain.htm @@ -0,0 +1,16 @@ + +
              +

              {lang eccredit_needexplanation}

              +
              +
              + + + +

              + + +

              +
              +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_ec_list.htm b/template/default/home/spacecp_ec_list.htm new file mode 100644 index 0000000..24b7f76 --- /dev/null +++ b/template/default/home/spacecp_ec_list.htm @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + +
              +

              + + + {lang eccredit_1week}{lang eccredit_1month}{lang eccredit_6month}{lang eccredit_6monthbefore} {lang from}{lang trade_buyer}{lang trade_seller}{lang eccredit_s}{lang eccredit_good}{lang eccredit_soso}{lang eccredit_bad}{lang eccredit1} + | + + + {lang eccredit_list_all} + + {lang eccredit_list_all} + + + |{lang eccredit_list_buyer} + + |{lang eccredit_list_buyer} + + + |{lang eccredit_list_seller} + + |{lang eccredit_list_seller} + + + |{lang eccredit_list_other} + + |{lang eccredit_list_other} + +

              +
               {lang eccredit_content}{lang eccredit_goodsname_seller}{lang eccredit_tradeprice}
              + + good {lang eccredit_good} + + soso {lang eccredit_soso} + + bad {lang eccredit_bad} + + + $comment[dateline]
              $comment[message]
              + + {lang eccredit_explanation}: $comment[explanation] + + [ {lang eccredit_needexplanation} ]
              {lang eccredit_explanationexpiration}
              + +
              + $comment[subject]
              + + {lang trade_buyer}: {lang trade_seller}: $comment[ratee] + + {lang trade_seller}: {lang trade_buyer}: $comment[rater] + +
              + + $comment[price] {lang trade_units}   + + +
              {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} $comment[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]} + +

              {lang eccredit_nofound}

              +
              $multipage
              + \ No newline at end of file diff --git a/template/default/home/spacecp_ec_rate.htm b/template/default/home/spacecp_ec_rate.htm new file mode 100644 index 0000000..b72e793 --- /dev/null +++ b/template/default/home/spacecp_ec_rate.htm @@ -0,0 +1,55 @@ + +
              +
              $_G[setting][bbname] {lang eccredit}
              +
              +
              +
              +

              3.{lang eccredit}

              +
              + + +
              +

              {lang eccredit_post}

              +
              + + + + + + + + + + + + + + + + + + + + + +
              {lang eccredit_retee} + + $order[seller] + + $order[buyer] + +
              {lang eccredit_tradegoods}$order[subject]
              {lang rate} + + + +
              {lang eccredit1}
              + + + +
              +
              +
              +
              +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_favorite.htm b/template/default/home/spacecp_favorite.htm new file mode 100644 index 0000000..6c21fb5 --- /dev/null +++ b/template/default/home/spacecp_favorite.htm @@ -0,0 +1,80 @@ + + + +
              +
              +
              + + +

              + {lang delete_favorite} + {lang close} +

              +
              + + + + +
              {lang delete_favorite_message}
              +

              + +

              +
              + + + + +

              + {lang favorite} + {lang close} +

              +
              + + + + +
              +

              {lang favorite_count}

              +

              {lang favorite_description}:

              + +
              +

              + +

              +
              + + + + + + +
              +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_feed.htm b/template/default/home/spacecp_feed.htm new file mode 100644 index 0000000..f94f776 --- /dev/null +++ b/template/default/home/spacecp_feed.htm @@ -0,0 +1,106 @@ + + + + +
              +
              + + + +
              +
              $multi
              +
              + facelist + + + + +
              + + +

              + + + + + + +
              + + + + + +

              + {lang delete_feed} + {lang close} +

              +
              + + + +
              +
              {lang determine_delete_feed}
              +
              +

              + + + {lang edit} + + --> +

              +
              + +

              + {lang shield_feed} + {lang close} +

              +
              + + + + +
              +

              {lang next_visit_not_view_feed}

              +

              +

              +
              +

              + + + {lang edit} + + --> +

              +
              + + + + + diff --git a/template/default/home/spacecp_follow.htm b/template/default/home/spacecp_follow.htm new file mode 100644 index 0000000..5e06809 --- /dev/null +++ b/template/default/home/spacecp_follow.htm @@ -0,0 +1,149 @@ + + + +

              + {lang follow_for}$followuser['fusername']{lang follow_add_bkname} + {lang close} +

              + +
              + + + + +
              + + + + + +
              {lang follow_editnote}: +
              +
              +

              + +

              +
              + + + + + +

              + {lang follow_reply} + {lang close} +

              +
              + + + + + +
              +

              {lang follow_add_note}:

              + + + +
              + +
              {lang follow_can_enter}140{lang follow_word} +
              +

              + + +

              +
              + + + +
              + + + + + + + + + + + +
              + + + + + + + + + + +
              {lang follow_can_enter}140{lang follow_word}
              +
              + + + +
              + +
              + + + + + + + + + + + false + + +

              + {lang follow_del_feed} + {lang close} +

              +
              + + + + +
              {lang follow_del_feed_confirm}
              +

              + +

              +
              + + + + \ No newline at end of file diff --git a/template/default/home/spacecp_footer.htm b/template/default/home/spacecp_footer.htm new file mode 100644 index 0000000..26f9233 --- /dev/null +++ b/template/default/home/spacecp_footer.htm @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/template/default/home/spacecp_friend.htm b/template/default/home/spacecp_friend.htm new file mode 100644 index 0000000..1595110 --- /dev/null +++ b/template/default/home/spacecp_friend.htm @@ -0,0 +1,473 @@ + + + +
              +
              + $_G[setting][bbname] + {lang friends} + + {lang people_might_know} + + {lang friend_request} + + {lang set_friend_group} + +
              +
              + +
              +
              +
              + + + +

              + + {lang people_might_know} + + {lang friend_request} + + {lang set_friend_group} + + {lang friends} + +

              + + + +

              + {lang lgnore_friend} + {lang close} +

              +
              + + + + + +
              {lang determine_lgnore_friend}
              +

              + +

              +
              + + + + + + +

              {lang recommend_user}

              + + + + +

              {lang surprise_they_near}

              + + + + +

              {lang friend_friend_might_know}

              + + + + +

              {lang they_online_add_friend}

              + + + +
              + {lang find_know_nofound} +
              + + + + +

              {lang search_member_result}:

              + + + +

              + {lang friend_hot} + {lang close} +

              +
              + + + +
              +

              {lang adjust_friend_hot}

              +

              {lang new_hot}: ({lang num_0_999})

              +
              +

              + +

              +
              + + +

              + {lang set_friend_group} + {lang close} +

              +
              + + + + +
              +

              {lang set_friend_group}

              + + + + + + + +
              +
              +

              + +

              +
              + + + + +

              + {lang friend_note} + {lang close} +

              +
              + + + + +
              +

              {lang friend_note_message}

              + +
              +

              + +

              +
              + + + + +

              + {lang all_friends} + + |$value + +

              +

              {lang friend_group_hot_message}

              + + +
              +
              + +
              +
              + + {lang set_member_group}: +   + +
              +
              $multi
              + + +
              + +
              {lang no_friend_list}
              + + + +

              + {lang friends_group} + {lang close} +

              +
              +
              + + + + +
              +

              {lang set_friend_group_name}

              +

              {lang new_name}:

              +
              +

              + +

              +
              + +
              + + +

              + {lang set_member_feed} + {lang close} +

              +
              +
              + + + + +
              + +

              {lang not_show_feed_homepage}

              + +

              {lang show_feed_homepage}

              + +
              +

              + +

              +
              +
              + + +
              + + + + {lang select_friend_application_do} + + ({lang max_friend_num}) +

              + + friendnum + {lang expansion_friend} + ({lang expansion_friend_message}) + +

              + +
              + + +
              $multi
              + +
              {lang no_new_friend_application}
              + + + + +

              + {lang common_friends} + {lang close} +

              +
              + + +

              {lang max_view_15_friends}

              + +

              {lang you_have_common_friends}

              + + + +

              {lang you_have_no_common_friends}

              + +
              + + +

              + {lang add_friend} + {lang close} +

              +
              + + + + +
              + + + + + +
              {lang add} {$tospace[username]} {lang add_friend_note}:
              + +

              ({lang view_note_message})

              +

              + {lang friend_group}: +

              +
              +
              +

              + +

              +
              + + +

              + {lang approval_the_request} + {lang close} +

              +
              + + + + + +
              + + + + + +
              +

              {lang approval_the_request_group}:

              + + + + + + + +
              +
              +
              +

              + +

              +
              + + + $jsstr + + + +
              +
              +
              + +
              +
              + + + diff --git a/template/default/home/spacecp_header.htm b/template/default/home/spacecp_header.htm new file mode 100644 index 0000000..176b9f8 --- /dev/null +++ b/template/default/home/spacecp_header.htm @@ -0,0 +1,12 @@ +
              + +
              +
              +
              +
              +

              + \ No newline at end of file diff --git a/template/default/home/spacecp_header_name.htm b/template/default/home/spacecp_header_name.htm new file mode 100644 index 0000000..55ce51c --- /dev/null +++ b/template/default/home/spacecp_header_name.htm @@ -0,0 +1,23 @@ + + {lang memcp_profile} + + {lang memcp_verify} + + {lang memcp_avatar} + + {lang memcp_credit} + + {lang memcp_payment} + + {lang memcp_usergroup} + + {lang memcp_privacy} + + {lang memcp_sendmail} + + {lang password_security} + + {lang memcp_promotion} + + {$_G['setting']['plugins'][$pluginkey][$_GET['id']]['name']} + \ No newline at end of file diff --git a/template/default/home/spacecp_index.htm b/template/default/home/spacecp_index.htm new file mode 100644 index 0000000..57afb0e --- /dev/null +++ b/template/default/home/spacecp_index.htm @@ -0,0 +1,647 @@ + + + + + + + + + + + + + +
              $multi
              +
                + +
              • + +
              +
              $multi
              + + + + +
              +
              +
              + +
              +
              + + + + +
              +
              + +
              + + + + {lang editing}: + {lang background} + |{lang header} + |{lang title_bar} + |{lang content_area} + + {lang cancel_bg_pic} + |{lang recover_style} +
              +
              +
              +
              +
              +
              {lang replace}
              +
              + +
              + + + + + + + + + +
              + +
              {lang photo_location}: + + + + + + + + + + + + + + + + +
                 
                 
                 
              +
              +
              +
              + + + + + + + + + +
              {lang background_rolling}: + + +
              {lang background_color}: + +
              +
              +
              + + + + + + + + + +
              {lang text_color}: + +
              {lang link_color}: + +
              +
              +
              +
              +
              + + $blockhtml + +

              + {lang editing_nv} + + {lang close} + +

              +
              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang space_nv_hidden} + + +
              {lang main_page} + + + +
              {lang feed} + + + +
              {lang doing} + + + +
              {lang blog} + + + +
              {lang album} + + + +
              {lang follow} + + + +
              {lang topic} + + + +
              {lang share} + + + +
              {lang friends} + + + +
              {lang message_board} + + + +
              {lang memcp_profile} + + + +
              +
              +
              +
              + + + + +
              +
              + + +

              + {lang editing_module} + + {lang close} + +

              + +
              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang space_block_title}
              {lang avatarsize} + + + +
              {lang showcountcontent} + + + + + + + +
              {lang custom_content}
              {$msg}
              +
              +
              + + + + + +
              +
              + +
              +
              + + +
              {lang show_num_of}
              {lang show_message} {lang show_message_tips}
              +
              +
              +
              + + + + + +
              +
              + + + + + + + + + + +
              + + +
              +
              + + + + + + + + + +
              {lang mp3_warning_message}

              + + + + + + + + + + + + + +
              {lang mp3_address}
              {lang track_name} + {lang empty_name_message}
              {lang front_cover}
              {lang delete}
              +
              + +
              + + + + +   + +
              +
              +
              +
              + + +
              +
              + + + + + + + +
              {lang album_cover_documents_address}
              ({lang not_play_message})
              {lang delete_all} + +
              + + + + + + + + + + + + + +

              + + + + + + + + + + + + + +
              {lang mp3_address}
              {lang track_name} +
              {lang front_cover} +

              +
              +
              +
              +
              + + + + + +
              +
              + +
              +
              {lang no_music_play_list} + +
              +
              + +
              + + + + + +$space[spacename]$space[username]{lang somebody_space} +$space[domainurl] +$space[spacedescription] + + + + + +
              + + + + {lang my_space_name}:   + + + + + {lang my_space_describe}: +
              + + + +
                +
              • NONE
              • +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_invite.htm b/template/default/home/spacecp_invite.htm new file mode 100644 index 0000000..15095e3 --- /dev/null +++ b/template/default/home/spacecp_invite.htm @@ -0,0 +1,243 @@ + + + +

              + {lang send_mail_again} + {lang close} +

              +
              + + + + +
              {lang sure_resend}
              +

              + +

              +
              + + +

              + {lang delete_log} + {lang close} +

              +
              + + + + +
              {lang delete_log_message}
              +

              + +

              +
              + + + + + $url  [{lang copy}] + $key  [{lang copy}] + + + + + +
              +
              + $_G[setting][bbname] + {lang friends} + {lang invite_friend} +
              +
              + +
              +
              +
              +

              {lang invite_friend}

              + + +
              + +

              + {lang friend_invite_success} + {lang you_get} $config[invitedaddcredit] {lang unit}{$credittitle}, + {lang friend_get} $config[inviteaddcredit] {lang unit}{$credittitle}, + {lang go_nuts} +

              + + +
              +

              {lang invited_friend}

              + + + +

              + + + $mod$value[fusername] + + +

              + +
              + + + +
              +

              {lang no_invite_friend_email}

              + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +

              {lang friend_invite_link}

              +

              {lang friend_invite_message}

              +

              {lang click_link_copy}

              +
              {lang invite_link}{lang invite_code}
              $url  [{lang copy}]$key  [{lang copy}]
              {lang no_invitation_code}
              +

              {lang invitation_code_spend}{$extcredits[title]} $creditnum $extcredits[unit] ( {lang you_have}$extcredits[title] {$space[$creditkey]} $extcredits[unit] ){lang credit_recharge}

              + +

              {lang max_invite_day_message}

              + + + + + +
              + {lang copy_invite_manage}: $inviteurl  [{lang copy}] +
              + + + +
              + +
              + +

              {lang send_invitation_email}{lang friend_play_together}$appinfo[appname]

              +
              + + + + + + + + + + + +
              +

              {lang send_invitation_email_message}

              +
              +

              + {lang friend_email_address} +

              + +
              +

              {lang friend_to_say}

              + +
              +
              +

              {lang preview_invitation}

              +
              + + + + + +
              {$mailvar[avatar]}
              +

              {lang hi_iam_invite_you}

              +

              {lang become_friend_message}

              +

              {lang invite_add_note}:

              +

              +

              {lang click_link_become_friend}:

              +

              {$inviteurl}

              +

              {lang have_account_view_homepage}

              +

              {$mailvar[siteurl]}home.php?mod=space&uid=$mailvar[uid]

              +
              +
              +
              + + + +
              {lang no_right_invite_friend}
              + +
              +
              + +
              + +
              +
              + + + diff --git a/template/default/home/spacecp_magic.htm b/template/default/home/spacecp_magic.htm new file mode 100644 index 0000000..18c497f --- /dev/null +++ b/template/default/home/spacecp_magic.htm @@ -0,0 +1,38 @@ + + + +

              + {lang cancel_magics_effects} + {lang close} +

              +
              + + + + +
              +

              {lang cancel_effects_message}

              +
              +

              + +

              +
              + +

              + {lang return_redbag} + {lang close} +

              +
              + + + + +
              +

              {lang spacecp_magic_message1}({lang spacecp_magic_message2} {$leftcredit} {$credittype})

              +
              +

              + +

              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_password.htm b/template/default/home/spacecp_password.htm new file mode 100644 index 0000000..9307e69 --- /dev/null +++ b/template/default/home/spacecp_password.htm @@ -0,0 +1,36 @@ + + + +
              +
              + + + + + + + + + + + + + + + + + + + + + + +
              +

              {lang my_login_password}

              +

              {lang modify_password_login}

              +
              {lang login_username}$space[username]
              {lang old_password}
              {lang new_password}
              {lang confirm_new_password}
               
              + +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_payment_header.htm b/template/default/home/spacecp_payment_header.htm new file mode 100644 index 0000000..11c4296 --- /dev/null +++ b/template/default/home/spacecp_payment_header.htm @@ -0,0 +1,4 @@ + diff --git a/template/default/home/spacecp_payment_order.htm b/template/default/home/spacecp_payment_order.htm new file mode 100644 index 0000000..84b1b72 --- /dev/null +++ b/template/default/home/spacecp_payment_order.htm @@ -0,0 +1,69 @@ + + + + + + +
              +
              + + + + + + + + + + + +
              {lang starttime_endtime}: + {lang credit_to} + {lang operation}:$optypehtml
               
              + +
              + + + + + + + + + + + + + + + + + + + + + + + +
              {lang operation}{lang payment_order_amount}{lang detail}{lang payment_order_status}{lang payment_order_dateline}
              {$order['type_name']}{$order['amount']} + {$order['subject']} + +
              {$order['description']} + +
              {$order['status_name']}{$order['dateline']} + + {lang payment_pay_btn} + +

              {lang payment_order_no_data}

              +
              +
              $multi
              + +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_payment_pay.htm b/template/default/home/spacecp_payment_pay.htm new file mode 100644 index 0000000..058dc45 --- /dev/null +++ b/template/default/home/spacecp_payment_pay.htm @@ -0,0 +1,59 @@ + + + + + +
              + + + + +
                +
              • {lang payment_pay_order_id}: {$order['out_biz_no']}
              • +
              + + + + + + + + + + + + + + + + + + + + + + + +
              {lang payment_pay_subject}: {$order['subject']}
              {lang payment_pay_description}: {$order['description']}
              {lang payment_pay_amount}: + {lang payment_unit_yang}{$order['amount']} + + ({$order['total_amount']}) + +
              {lang payment_pay_type}: + +
              checked name="pay_channel" type="radio" value="{$channel['id']}" title="$channel['title']"> +
              + +
              + +
              +
              +
              + +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_payment_redirect.htm b/template/default/home/spacecp_payment_redirect.htm new file mode 100644 index 0000000..25814c4 --- /dev/null +++ b/template/default/home/spacecp_payment_redirect.htm @@ -0,0 +1,71 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/home/spacecp_plugin.htm b/template/default/home/spacecp_plugin.htm new file mode 100644 index 0000000..d32de17 --- /dev/null +++ b/template/default/home/spacecp_plugin.htm @@ -0,0 +1,12 @@ + + + + + + +
              +
              + +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_pm.htm b/template/default/home/spacecp_pm.htm new file mode 100644 index 0000000..76ffcfd --- /dev/null +++ b/template/default/home/spacecp_pm.htm @@ -0,0 +1,582 @@ + + + +
              +
              + $_G[setting][bbname] + {lang prompt} + {lang news} +
              +
              +
              +
              +
              + + + + +

              + {lang delete_pm} + {lang close} +

              + +
              +
              + + + + +
              {lang determine_delete_pm}
              +

              + +

              +
              +
              + +
              +
              + + + + +
              {lang determine_delete_chatpm}
              +

              + +

              +
              +
              + +
              +
              + + + + +
              {lang determine_quit_chatpm}
              +

              + +

              +
              +
              + +
              +
              + + + + +
              {lang determine_delete_pmid}
              +

              + +

              +
              +
              + +
              +
              + + + + +
              {lang determine_delete_gpmid}
              +

              + +

              +
              +
              + + + + + + +

              + {lang pm_report} + {lang close} +

              +
              +
              + + + + +
              {lang determine_report_pm}
              +

              + +

              +
              +
              + + + +

              + {lang pm_ignore} + {lang close} +

              +
              +
              + + + + +
              {lang determine_ignore_pm}
              +

              + +

              +
              +
              + + + +

              + {lang pm_kickmember} + {lang close} +

              +
              +
              + + + + +
              {lang determine_kickmember}
              +

              + +

              +
              +
              + + + +

              + {lang pm_appendmember} + {lang close} +

              +
              +
              + + + + +
              {lang determine_appendmember}
              +

              + +

              +
              +
              + + + $jsstr + + +

              + {lang shield}{$username} + {lang close} +

              +
              + + + + + + +
              {lang shield_the_user}
              +

              + +

              +
              + + + + +
            • +

              $day

              +
            • + + +
            • +
              {$value[author]}:
              +
              {$value[message]}
              +
            • + + + +
              +

              + {lang taking_with_user}[{lang online}][{lang offline}] + {lang close} +

              + +
              +
                + +
              • +

                $day

                +
              • + + +
              • +
                {$value[author]}:
                +
                {$value[message]}
                +
              • + + +
              + +
              +
              + + + + +
              + + +
              +
              + + +
              +
              + + + +
              +
              +
              + + +
              +
              + + + +
              +
              +
              + + + +

              $value[author]  

              +

              $value[message]

              + + + + +

              {lang send_pm}

              + + +

              + {lang send_pm} + {lang close} +

              + + + +
              +
              + + + + + + +
              + + + + + + + + + + + + + + + +
              + + + + + + +

              {lang sendpm_tip}

              +
              +
              +
              + + +
              +
              + +
              +
              +
              +
              +

              + +

              + + +   + + + + + +
              + + +
              + +
              +
              + + + + +
              + + + + + + + + + + + + + + + + + + + + + + +
              +
              + +
              +
              + + + + + + +

              {lang sendpm_tip}

              +
              +
              +
              + + +
              +
              + +
              +
              +
                + +
              +
              +
              +
              + + + + +
              +
              +
              + +
              +
              + + + \ No newline at end of file diff --git a/template/default/home/spacecp_poke.htm b/template/default/home/spacecp_poke.htm new file mode 100644 index 0000000..db30292 --- /dev/null +++ b/template/default/home/spacecp_poke.htm @@ -0,0 +1,157 @@ + + + + +
              +
              +
              +

              {lang poke}

              + + + + +

              + {lang say_hi} + {lang close} +

              + +
              + + + + + +
              +
              + + + {lang to} {$tospace[username]} {lang say_hi}: + + {lang username}: + +
              +
                + +
              • + +
              + +

              {lang max_text_poke_message}

              +
              +

              + +

              +
              + + + + +

              + {lang me}{$value[fromusername]}: + + {$icons[$subvalue[iconid]]}{lang say_hi} + , {lang say}: $subvalue[note] +   + +

              + + + +

              + {lang lgnore_poke} + {lang close} +

              +
              + + + + + +
              {lang determine_lgnore_poke}
              +

              + +

              +
              + +

              {lang you_can_reply_ignore}|{lang ignore_all}

              + +
              + +
              +
              +
              +

              + {$value[fromusername]}: + + {$icons[$value[iconid]]}{lang say_hi} + , {lang say}: $value[note] +   + +

              + +
              +
              + +
              +
              $multi
              + + +
              {lang no_new_poke}
              + + + + + +
              +
              +
              + +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_poke_type.htm b/template/default/home/spacecp_poke_type.htm new file mode 100644 index 0000000..8d5d1f5 --- /dev/null +++ b/template/default/home/spacecp_poke_type.htm @@ -0,0 +1,18 @@ +{eval +$icons = array( + 0 => '{lang poke_0}', + 1 => 'cyx {lang poke_1}', + 2 => 'wgs {lang poke_2}', + 3 => 'wx {lang poke_3}', + 4 => 'jy {lang poke_4}', + 5 => 'pmy {lang poke_5}', + 6 => 'yb {lang poke_6}', + 7 => 'fw {lang poke_7}', + 8 => 'nyy {lang poke_8}', + 9 => 'gyq {lang poke_9}', + 10 => 'dyx {lang poke_10}', + 11 => 'yw {lang poke_11}', + 12 => 'ppjb {lang poke_12}', + 13 => 'yyk {lang poke_13}' +); +} \ No newline at end of file diff --git a/template/default/home/spacecp_privacy.htm b/template/default/home/spacecp_privacy.htm new file mode 100644 index 0000000..7232c9c --- /dev/null +++ b/template/default/home/spacecp_privacy.htm @@ -0,0 +1,304 @@ + + + + +
              + + + +

              {lang you_control_see_content}

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang friend_list} + +
              {lang message_board} + +
              {lang personal_feed} + +
              {lang doing} + +

              {lang privacy_setting_message}
              {lang site_might_your_log}

              +
              {lang blog} + +

              {lang privacy_setting_message}
              {lang view_right_setting_effective}

              +
              {lang album} + +

              {lang privacy_setting_message}
              {lang view_right_setting_effective}

              +
              {lang share} + +

              {lang privacy_setting_message}
              {lang view_right_setting_effective}

              +
               
              + + +

              {lang system_depend_action_message}

              + + + + + + + + + + +
                + + + + + + + + + + + + + + +
               
              + + +

              {lang you_control_other_operation}

              + + + + + + + + + + + + + + + + + + +
              {lang add_friends} + +
              {lang add_follow} + +
               
              + + + + {eval + $iconnames['wall'] = '{lang message}'; + $iconnames['piccomment'] = '{lang pic_comment}'; + $iconnames['blogcomment'] = '{lang blog_comment}'; + $iconnames['sharecomment'] = '{lang share_comment}'; + $iconnames['magic'] = '{lang magics_title}'; + $iconnames['sharenotice'] = '{lang share_notification}'; + $iconnames['clickblog'] = '{lang blog_position}'; + $iconnames['clickpic'] = '{lang pic_position}'; + $iconnames['credit'] = '{lang credits}'; + $iconnames['doing'] = '{lang doing}'; + $iconnames['pcomment'] = '{lang topic_comment}'; + $iconnames['post'] = '{lang topic_reply}'; + $iconnames['show'] = '{lang friend_top}'; + $iconnames['task'] = '{lang task}'; + $iconnames['goods'] = '{lang trade}'; + $iconnames['group'] = $_G['setting']['navs'][3]['navname']; + $iconnames['thread'] = '{lang theme}'; + $iconnames['system'] = '{lang system}'; + $iconnames['friend'] = '{lang friends}'; + $iconnames['debate'] = '{lang debate}'; + $iconnames['album'] = '{lang album}'; + $iconnames['blog'] = '{lang blog}'; + $iconnames['poll'] = '{lang poll}'; + $iconnames['activity'] = '{lang activity}'; + $iconnames['reward'] = '{lang reward}'; + $iconnames['share'] = '{lang share}'; + $iconnames['profile'] = '{lang update_presonal_profile}'; + $iconnames['pusearticle'] = '{lang article_push}'; + } + + + + + + + + + + + +
              +

              {lang filtering_rules_title_1}

              +

              {lang filtering_rules_message_1}

              +
                + + + +
                + +

              {lang list_change_friend_name}

              +
              + + + + + + + + + + + + + + + + + + +
              +

              {lang filtering_rules_title_2}

              +

              {lang filtering_rules_message_2}

              +
                + + + + +
               
               {lang no_shield_feed_cat}
              + + + + + + + + + + + + + + + + + + +
              +

              {lang filtering_rules_title_3}

              +

              {lang filtering_rules_message_3}

              +
                + + + + +
               
               {lang no_shield_feed_cat}
              + +
              + +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_profile.htm b/template/default/home/spacecp_profile.htm new file mode 100644 index 0000000..b1a3875 --- /dev/null +++ b/template/default/home/spacecp_profile.htm @@ -0,0 +1,344 @@ + + + + + +

              {lang validator_comment}

              +
              + + + + + + + + + + + + + + + + +
              {lang validator_remark}$validate[remark] 
              {lang validator_message} 
                + +
              +
              +
              +
              + +
              + + + +

              + + {lang old_password_comment}{lang wechat_config_newpassword_comment}{lang connect_config_newpassword_comment} + + {lang freeze_pw_tips} + + {lang freeze_email_tips} + + {lang freeze_admincp_tips} + +

              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              *{lang old_password}
              {lang new_password} + +

              {lang memcp_profile_passwd_comment}

              +
              {lang new_password_confirm} + +

              {lang memcp_profile_passwd_comment}

              +
              {lang email} + +

              + +

              {lang freeze_email_tips}

              + + {lang email_been_active} + + $acitvemessage + +

              +

              {lang memcp_profile_email_comment}

              +
              {lang secmobile} + + +

              {lang memcp_profile_secmobile_comment} $_G['setting']['smsdefaultcc']

              +
              {lang secmobseccode} + + +

              {lang memcp_profile_secmobseccode_comment}

              +
              {lang freeze_reason} + +

              {lang freeze_reason_comment}

              +

              {lang freeze_reason_admincp_comment}

              +
              {lang freeze_remark} + +

              {lang freeze_remark_comment}

              +
              {lang security_question} + +

              {lang memcp_profile_security_comment}

              +
              {lang security_answer} + +

              {lang memcp_profile_security_answer_comment}

              +
              + + + + + + + + +
               
              + +
              + + + + + + + + +

              {lang spacecp_profile_message1}{lang spacecp_profile_message2}

              + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang username}$_G[member][username] 
              *$value[title] + $htmls[$key] + + + + + + +
              {lang permission_basic_status} + +
              +
               
              {lang personal_signature} +
              +
              + {lang preview} + + + + + + + + +
              +
              + +
              +
              +
              +
              + + +
               
              {lang time_zone} + + +

              {lang current_time} :

              +

              {lang time_zone_message}

              +
               
              Email$space[email] ({lang modify}) 
                + + + +
              + +
              + + +
              +
              +
              + +
              + +
              + + diff --git a/template/default/home/spacecp_profile_nav.htm b/template/default/home/spacecp_profile_nav.htm new file mode 100644 index 0000000..dde5d58 --- /dev/null +++ b/template/default/home/spacecp_profile_nav.htm @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/template/default/home/spacecp_promotion.htm b/template/default/home/spacecp_promotion.htm new file mode 100644 index 0000000..1896a3f --- /dev/null +++ b/template/default/home/spacecp_promotion.htm @@ -0,0 +1,53 @@ + + + + +
              +

              + {lang post_promotion_url} +

              + + +

              + + {lang post_promotion_reg} + + {lang post_promotion} + +

              + +
              + + + + + + + + + + + + + + + + + + +
              {lang mode_one}
              {lang post_promotion_url1} + + +
              {lang post_promotion_url2} + + +
              {lang mode_two}
              {lang mode_two_desc}
              + + + + +
              + +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_search.htm b/template/default/home/spacecp_search.htm new file mode 100644 index 0000000..b91946e --- /dev/null +++ b/template/default/home/spacecp_search.htm @@ -0,0 +1,329 @@ + +
              +
              + $_G[setting][bbname] + {lang friends} + {lang search_friend} +
              +
              +
              +
              +
              +

              {lang search_friend}

              + + + +
              {lang no_search_friend}{lang change_search}
              + +
              {lang search_member_list_message}
              + + + +
              + +

              {lang seek_bgfriend}

              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {$fields[$key][title]}{$fields[$key][html]}
              {lang sex}: + +
              {lang age_segment} ~
              {lang upload_avatar}
              {lang username}
                + + +
              + + + + +
              +
              + +

              {lang seek_same_city}

              +
              +
              + + + + + + + + + + + + + +
              {lang reside_city}$residecityhtml
              {lang username}
                + + +
              + + + + +
              +
              + +

              {lang seek_same_city_people}

              +
              +
              + + + + + + + + + + + + + +
              {lang birth_city}$birthcityhtml
              {lang username}
                + + +
              + + + + +
              +
              + +

              {lang seek_same_birthday}

              +
              +
              + + + + + + + + + + + + + +
              {lang birthday} + {lang year} + {lang month} + {lang day} +
              {lang username}
                + + +
              + + + + +
              +
              + + +

              {lang seek_classmate}

              +
              +
              + + + + + + + + + + + + + + + + + +
              {$fields[$key][title]}{$fields[$key][html]}
              {lang username}
                + + +
              + + + + +
              +
              + + + +

              {lang seek_colleague}

              +
              +
              + + + + + + + + + + + + + + + + + +
              {$fields[$key][title]}{$fields[$key][html]}
              {lang username}
                + + +
              + + + + +
              +
              + + +

              {lang advance_seek}

              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang username}
              {lang user_id}
              {lang sex}: + +
              {lang age_segment} ~
              {lang upload_avatar}
              {lang reside_city}$residecityhtml
              {lang birth_city}$birthcityhtml
              {lang birthday} + {lang year} + {lang month} + {lang day} +
              {$fvalue[title]}$fvalue[html]
                + + +
              + + + + +
              +
              + +
              + +
              +
              +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/home/spacecp_sendmail.htm b/template/default/home/spacecp_sendmail.htm new file mode 100644 index 0000000..0c833b6 --- /dev/null +++ b/template/default/home/spacecp_sendmail.htm @@ -0,0 +1,98 @@ + + +
              + + + + +
              +
              +

              {lang activate_mailbox_first}

              +
              +
              +

              {lang activate_mailbox_message}

              +

              + {lang click_activate_mailbox} $space[email] + ({lang modify_email}) +

              +
              +
              + + {eval + $mailtype = array( + 'mail_my' => array( + 'piccomment' => '{lang mail_piccomment}', + 'clickpic' => '{lang mail_clickpic}', + 'blogcomment' => '{lang mail_blogcomment}', + 'clickblog' => '{lang mail_clickblog}', + 'doing' => '{lang mail_doing}', + 'sharecomment' => '{lang mail_sharecomment}', + 'pcomment' => '{lang mail_pcomment}', + 'post' => '{lang mail_post}', + 'sharenotice' => '{lang mail_sharenotice}', + 'reward' => '{lang mail_reward}', + 'pusearticle' => '{lang mail_pusearticle}', + 'wall' => '{lang mail_wall}', + ), + + 'mail_system' => array( + + 'verify' => '{lang mail_system_verify}', + 'magic' => '{lang mail_system_magic}', + 'credit' => '{lang mail_system_credit}', + 'goods' => '{lang mail_system_goods}', + 'activity' => '{lang mail_system_activity}', + 'report' => '{lang mail_system_report}', + 'group' => '{lang mail_system_group}', + 'task' => '{lang mail_system_task}', + 'pmreport' => '{lang mail_system_pmreport}', + 'mod_member' => '{lang mail_system_mod_member}', + 'friend' => '{lang mail_system_friend}', + 'show' => '{lang mail_system_show}', + 'system' => '{lang mail_system_insys}', + ) + ); + } +

              {lang reminder_mail_message_1}$_G[setting][sendmailday]{lang reminder_mail_message_2}

              + + + + + + + + + + + + + + + + +
              + + + +
              {lang mail_frequency} + +

              + {lang mail_send_your_mail} $space[email] ({lang modify_mailbox}) +

              +
                + +
              + + +
              + + +
              + +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_share.htm b/template/default/home/spacecp_share.htm new file mode 100644 index 0000000..74251f3 --- /dev/null +++ b/template/default/home/spacecp_share.htm @@ -0,0 +1,147 @@ + + + +
              +
              +
              + + +

              + {lang delete_share} + {lang close} +

              +
              + + + + +
              {lang delete_share_message}
              +

              + +

              +
              + + + + +

              + {lang adjust_hot} + {lang close} +

              +
              + + + +
              {lang new_hot}:
              +

              + +

              +
              + + +

              + {lang share} +

              + +

              + {lang share} + {lang close} +

              + +
              + + + + + +
              +

              {lang share_web_music_flash}:

              +

              +

              {lang description}:

              +

              + +

              {lang share_im}

              + + + +
              + +
              +

              + +

              +
              + + + + +

              + {lang share} + {lang close} +

              +
              + + + + +
              +

              + {lang share_count}   + {lang share_description}: +

              + + + +
              + +
                + + +
              +
              +

              + + + + +

              +
              + + + + + + +
              +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_upload.htm b/template/default/home/spacecp_upload.htm new file mode 100644 index 0000000..c48ec20 --- /dev/null +++ b/template/default/home/spacecp_upload.htm @@ -0,0 +1,258 @@ + + +
              +
              $_G[setting][bbname] {lang album} {lang upload_pic}
              +
              + +
              +
              +
              +

              {lang upload_pic}

              +
              + + + +
              + {lang hava_attach_size} $haveattachsize ({lang recount}) + +
              + attachsize + {lang i_want_more_space} + ({lang you_can_buy_magictools}) + +
              + + + +
              +

              1. {lang select_pic}

              +
              {lang upload_pic_tips}
              +
              + + + +
              + +
              +
              + + + + + + + +
              + + + +

              2. {lang select_album}

              +
              + +

              + + +

              +
              + {lang select_album} + +
              + +
              + + + +
              + + + + + +
              +
              + + + +
              +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/home/spacecp_usergroup.htm b/template/default/home/spacecp_usergroup.htm new file mode 100644 index 0000000..6226e30 --- /dev/null +++ b/template/default/home/spacecp_usergroup.htm @@ -0,0 +1,423 @@ + + +
              +

              + {lang memcp_usergroups_joinbuy}{lang memcp_usergroups_joinexit} + {lang close} +

              + +
              + + + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {lang memcp_usergroups_dailyprice} $group[dailyprice] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]}
              {lang memcp_usergroups_credit}$usermaxdays {lang days}
              {lang memcp_usergroups_span} {lang days}
              {lang credits_need}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]} +
              {lang memcp_usergroups_explain}: + + {lang memcp_usergroups_join_comment} + + {lang memcp_usergroups_exit_comment} + +
              {lang memcp_usergroups_explain}: {lang memcp_usergroups_free_comment}
              {lang memcp_usergroups_explain}: + + {lang memcp_usergroups_admin_exit_comment} + + {lang memcp_usergroups_exit_comment} + + {lang memcp_usergroups_open_exit_comment} + +
              +
              +

              + +

              +
              +
              + + +
              +

              + {lang memcp_usergroups_switch} + {lang close} +

              +
              + + + + + + +
              + + + + + + + +
              {lang memcp_usergroups_main_old}$_G[group][grouptitle]
              {lang memcp_usergroups_main_new}$group[grouptitle]
              +
              +

              + +

              +
              +
              + + + + + + + + + + + + + + + + $forum[name] + + + + + + +
              {lang forum_name}$permlang['perms_'.$perm]
              + + + + + + +  $verifyperm[$fid][$perm] + + + +
              + {lang usergroup_right_message1}  + {lang usergroup_right_message2}  + + {lang usergroup_right_message3} + +
              + + +
              + +
              + + + + + +

              + {lang youhave} $usermoney {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} + {lang yourusergroup}: {$_G['cache']['usergroups'][$_G[groupid]]['grouptitle']} +

              + +
              {lang usergroup_expired}
              + + + + + + + + + + + + + + + + + + + + + + + +
              {lang usergroup}{lang memcp_usergroups_dailyprice}{lang memcp_usergroups_credit}{lang group_expiry_time}
              $group[grouptitle] + + $group[dailyprice] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} + + {lang free} + + $group[usermaxdays] {lang days}$group[time] + + + + {lang memcp_usergroups_set_main} + + + + {lang renew} + + {lang memcp_usergroups_exit} + + + + {lang renew} + + {lang main_usergroup} + + + {lang free_buy} + + {lang memcp_usergroups_buy} + +
              + +

              {lang memcp_usergroup_unallow}

              + + + + +
              + +
              + + + + + + +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
               
               
              {lang user_level}
              $permlang['perms_'.$perm]
              {lang permission_menu_post}
              $permlang['perms_'.$perm]
              {lang about_space}
              $permlang['perms_'.$perm]
              {lang permission_menu_attachment}
              $permlang['perms_'.$perm]
              + + + + + + + + +

              {lang my_main_usergroup} - $maingroup[grouptitle]

              {lang credits}: $space[credits]
              + + + + +
                +
              • $tlang - $currentgrouptitle
              • +
              +
              + + + + + +
              + + + + {lang spacecp_usergroup_message1} $v + + {lang spacecp_usergroup_message2} $group[groupcreditshigher] + + + + {lang memcp_usergroups_set_main} + + + + {lang renew} + + {lang memcp_usergroups_exit} + + + {lang memcp_usergroups_buy} + + + {lang memcp_usergroups_timelimit}: + +
              +
              + +
              + {lang usergroup_right_message1}  + {lang usergroup_right_message2} + + + + + + + +
              + +
              + + +{eval +function permtbody($maingroup) { +global $_G, $bperms, $pperms, $sperms, $aperms; +} + + + + + + + $maingroup[$groupbperm] + + {lang permission_basic_disable_sarch}{lang permission_basic_search_title}{lang permission_basic_search_content} + + + + + + + + + + $maingroup[grouptitle] + + + + + + + $maingroup[$grouppperm] {lang bytes} + + +$maingroup[allowrecommend] + + + + + + + + + + + + $maingroup[grouptitle] + + + + + + + $maingroup[$perm]{lang permission_attachment_nopermission} + + + + + + + + + + $maingroup[grouptitle] + + + + + + + $maingroup[$groupaperm]{lang permission_attachment_nopermission} + +

              $maingroup[attachextensions]

              {lang permission_attachment_nopermission} + + + + + + + + + + + diff --git a/template/default/home/spacecp_usergroup_header.htm b/template/default/home/spacecp_usergroup_header.htm new file mode 100644 index 0000000..bf5df11 --- /dev/null +++ b/template/default/home/spacecp_usergroup_header.htm @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/template/default/index.htm b/template/default/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/template/default/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/template/default/member/getpasswd.htm b/template/default/member/getpasswd.htm new file mode 100644 index 0000000..617e9b1 --- /dev/null +++ b/template/default/member/getpasswd.htm @@ -0,0 +1,44 @@ + +
              +
              +
              +

              + {lang getpassword} +

              +
              + +
              +
              + + +

              + + {lang register_password_tips}, {lang register_password_length_tips1} $_G['setting']['pwlength'] {lang register_password_length_tips2} +

              + +

              +
              +
              +

              {lang login_guest}

              +
              +
              +

              +   + +

              +
              + + +
              +
              +
              + \ No newline at end of file diff --git a/template/default/member/index.htm b/template/default/member/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/member/login.htm b/template/default/member/login.htm new file mode 100644 index 0000000..9f2b376 --- /dev/null +++ b/template/default/member/login.htm @@ -0,0 +1,260 @@ + + + + +
              + +
              +
              +
              + + + {lang login_guest} + + +

              {lang login}

              + +

              {lang login_seccheck2}

              + +
              +
              + + +
              +
              +

              + + {lang login_guestmessage}{lang profile_renew}{lang login_member} + + {lang close} +

              + +
              +
              + + + + + + + +
              + + + + + +
              {lang register_from}$invite[username]
              +
              + + + +
              + + + + + + +
              + + + + $_G['setting']['reglinkname']
              +
              +
              + + + + + + +
              {lang getpassword}
              +
              + + + +
              + + + + + +
              {lang security_q}:
              +
              + + + + +
              :
              + + + + + +
              + + + + + +
              +
              + +
              + + + + + + +
                + + +   +
              +
              + + +
              +
              + + + + + +
              {lang login_method}:
              +
              + +
              +
              +
              + +
              + +
              +
              + + \ No newline at end of file diff --git a/template/default/member/login_simple.htm b/template/default/member/login_simple.htm new file mode 100644 index 0000000..2fe40fa --- /dev/null +++ b/template/default/member/login_simple.htm @@ -0,0 +1,47 @@ + + +
              +
              + +
              + + + + + + + + + + + + + + + + + + +
              + + + + +  {lang forgotpw}
               $_G['setting']['reglinkname']
              + + + +
              + +
              +
              + \ No newline at end of file diff --git a/template/default/member/register.htm b/template/default/member/register.htm new file mode 100644 index 0000000..2171e3a --- /dev/null +++ b/template/default/member/register.htm @@ -0,0 +1,303 @@ + + + + + +
              + +
              + +
              + +
              + + + + {lang login_inactive} + + {lang login_now} + + +

              + $this->setting['reglinkname']{lang index_activation} +

              +
              + +

              + + +
              +
              + + + + + + + +
              +
              + + +
              + + + + + + +
              * +
                + +
              {lang register_email_tips}
              + + + + + +
                + {lang register_validate_email_tips} +
              + +
              + + + +
              + + + + + +
              {lang register_from}:$invite[username]
              +
              + +
              + + + + + +
              $_GET[invitecode]
              +
              + + + + + +
              + + + + + + +
              *

              {lang register_buyinvitecode}

              $this->setting[inviteconfig][invitecodeprompt]
              +
              + + + + +
              + + + + + + +
              *{lang register_username_tips}
              +
              + +
              + + + + + + +
              *{lang register_password_tips}, {lang register_password_length_tips1} $_G['setting']['pwlength'] {lang register_password_length_tips2}
              +
              + +
              + + + + + + +
              *{lang register_repassword_tips}
              +
              + +
              + + + + + + +
              *
               
              {lang register_email_tips}
              +
              + + + +
              + + + + + +
              {lang username}:$username
              +
              + + + +
              + + + + + + +
              *{lang register_message1}
              +
              + + + +
              + + + + + +
              setting['regstatus'] == 2} onblur="checkinvite()"{/if} class="px" />
              +
              + + + + + +
              + + + + + + +
              *$htmls[$field['fieldid']]
              +
              + + + + + + +
              *:
              + + + +
              + +
              + +
              + +
              +
              + + + + + + +
                + +   + + + + + +
              +
              + +
              +
              + + + + + +
              {lang login_method}:
              +
              + +
              +
              + + +
              +
              +
              + + + \ No newline at end of file diff --git a/template/default/portal/block_more_forum_thread.htm b/template/default/portal/block_more_forum_thread.htm new file mode 100644 index 0000000..78d520c --- /dev/null +++ b/template/default/portal/block_more_forum_thread.htm @@ -0,0 +1,68 @@ + +
              +
              + $_G[setting][bbname] + {lang portal} + $navtitle +
              +
              + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + + +

              $navtitle

              {lang forum}{lang author}
              +
              +
              + + + + + + + + + +
              + $value['title'] + + $value['fields']['forumname'] + + + $value['fields'][author] + + {$_G['setting']['anonymoustext']} + + + $value['fields']['dateline'] +
              +
              $multipage
              + +

              {lang no_content}

              + +
              +
              + +
              + +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/portal/block_more_group_thread.htm b/template/default/portal/block_more_group_thread.htm new file mode 100644 index 0000000..26ccf87 --- /dev/null +++ b/template/default/portal/block_more_group_thread.htm @@ -0,0 +1,68 @@ + +
              +
              + $_G[setting][bbname] + {lang portal} + $navtitle +
              +
              + + + +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + + +

              $navtitle

              $_G[setting][navs][3][navname]{lang author}
              +
              +
              + + + + + + + + + +
              + $value['title'] + + $value['fields']['groupname'] + + + $value['fields'][author] + + {$_G['setting']['anonymoustext']} + + + $value['fields']['dateline'] +
              +
              $multipage
              + +

              {lang no_content}

              + +
              +
              + +
              + +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/portal/block_more_portal_article.htm b/template/default/portal/block_more_portal_article.htm new file mode 100644 index 0000000..4ab5100 --- /dev/null +++ b/template/default/portal/block_more_portal_article.htm @@ -0,0 +1,56 @@ + + +
              +
              + $_G[setting][bbname] + {lang portal} + $navtitle +
              +
              + + +
              +
              +
              + +
              +
              +
              +
              +
              +

              $navtitle

              +
              + +
              + + +
              +
              $value[title]
              +
              +
              $value[title]
              + $value[summary] +
              +
              + {lang category}:    + {$value[fields][dateline]} +
              +
              + +
              +
              + +

              {lang no_content}

              + +
              +
              {$multipage}
              + +
              + +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/portal/comment.htm b/template/default/portal/comment.htm new file mode 100644 index 0000000..b092f73 --- /dev/null +++ b/template/default/portal/comment.htm @@ -0,0 +1,61 @@ + + +
              +
              + $_G[setting][bbname] + $_G[setting][navs][1][navname] + {lang comment_view} +
              +
              + + +
              +
              +
              + +
              +
              +
              +
              +

              $csubject[title]

              +

              {lang comment} ($csubject[commentnum])|{lang post_comment}

              +
              +
              + + + + +

              {lang hide_portal_comment}

              + +
              $multi
              + +
              +
              +
              + +
              +
              + + +
              + + + + + + + + +

              + + +
              +
              +
              +
              + +
              +
              +
              + + \ No newline at end of file diff --git a/template/default/portal/comment_li.htm b/template/default/portal/comment_li.htm new file mode 100644 index 0000000..17a5b83 --- /dev/null +++ b/template/default/portal/comment_li.htm @@ -0,0 +1,20 @@ + +
              +
              + + {lang quote} + + {lang edit} + {lang delete} + + + + $comment[username] + + {lang guest} + + + ({lang moderate_need}) +
              +
              $comment[message] {lang moderate_not_validate}
              +
              \ No newline at end of file diff --git a/template/default/portal/diyxml/index.htm b/template/default/portal/diyxml/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/portal/diyxml/portal_index.xml b/template/default/portal/diyxml/portal_index.xml new file mode 100644 index 0000000..f11cc30 --- /dev/null +++ b/template/default/portal/diyxml/portal_index.xml @@ -0,0 +1,4537 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 今日]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 今日精彩推荐]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 更多精彩专题]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 广场]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 团队日志]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 问题反馈]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 站长交流]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 答问题 赚积分]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 热议]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            • 这里是文字广告链接
            • +
            • 这里是文字广告链接
            • 这里是文字广告链接
            • 这里是文字广告链接
            • +
            ]]> + + + + + + + + + + + + +
          • 这里是文字广告链接
          • +
          • 这里是文字广告链接
          • 这里是文字广告链接
          • 这里是文字广告链接
          • +
          ]]> + + + + + + + + + + + + + + + + 圈子]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 最新成立]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 今日活跃圈子]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 空间 | 写真图集]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 心情记录]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 找朋友]]> + + + + + + + + + + + + + + + + + + + + + + + +
          性别 + +
          年龄段 ~
           
          用户名
            + + 高级查找 › +
          + + + + +]]>
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          性别 + +
          年龄段 ~
           
          用户名
            + + 高级查找 › +
          + + + + +]]>
          + +
          + + + + + + + +
          + + + + + + 榜上有名]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 精彩分享]]> + + 视频| +音乐| +Flash| +日志| +相册| +图片| +投票]]> + + + + + + + + + + + + 视频| +音乐| +Flash| +日志| +相册| +图片| +投票]]> + + + + + + + + + + + + + + + + 商品]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 推荐商铺]]> + + +
        • 嘉嘉卡盟 [认证]
        • +
        • 美妍坊
        • +
        • 家美乐专卖店
        • +
        • Shining Beauty
        • +
        • 上海名表城
        • +
        • 努力铁艺家居店
        • +
        • 上海名表城
        • +
        • 努力铁艺家居店
        • +
        • 2046裤王会所
        • +
        • 穿越火线
        • +
        • 淘衣小铺
        • +
        • 心动折扣店
        • +
        ]]> + + + + + + + + + + + + +
      • 嘉嘉卡盟 [认证]
      • +
      • 美妍坊
      • +
      • 家美乐专卖店
      • +
      • Shining Beauty
      • +
      • 上海名表城
      • +
      • 努力铁艺家居店
      • +
      • 上海名表城
      • +
      • 努力铁艺家居店
      • +
      • 2046裤王会所
      • +
      • 穿越火线
      • +
      • 淘衣小铺
      • +
      • 心动折扣店
      • +]]>
        + +
        + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      • 这里是文字广告链接
      • +
      • 这里是文字广告链接
      • 这里是文字广告链接
      • 这里是文字广告链接
      • +]]>
        + + + + + + + + + + + + +
      • 这里是文字广告链接
      • +
      • 这里是文字广告链接
      • 这里是文字广告链接
      • 这里是文字广告链接
      • +]]>
        + +
        + + + + + + + +
        + + + + + + + + +
      • 这里是文字广告链接
      • 这里是文字广告链接
      • 这里是文字广告链接
      • 这里是文字广告链接
      • +]]>
        + + + + + + + + + + + + +
      • 这里是文字广告链接
      • 这里是文字广告链接
      • 这里是文字广告链接
      • 这里是文字广告链接
      • +]]>
        + +
        + + + + + + + +
        + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

        0

        文章

        0

        圈子

        1

        会员
        ]]>
        + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + + + + + + +[loop] +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        +
        {threadsubject}
        +
        {threadsummary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        +
        {threadsubject}
        +
        {threadsummary}
        +]]>
        +
        + + + + + + + + + + + +
        + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + + + + + + +[loop] +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + +
        + + + + + + + +]]> + + + + + + + + + + + + +

        {title}

        ]]>
        +
        + + + + + + + + + + +
        + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + + + + + + +[loop] +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + +
        + + + + + + +
          +[loop] +
        • {title}
        • +[/loop] +
        + +]]>
        + + + + + + + + + + + + + {title}]]> +
        + + + + + + + + + + +
        + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + {username}: {title}]]> + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + + + + + + +[loop] +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + +
        + + + + + + +
          +[loop] +
        • + {title} +

          {title}

          +
        • +[/loop] +
        +]]>
        + + + + + + + + + + + + + + {title} +

        {title}

        +]]>
        +
        + + + + + + + + + + +
        + + + + + + + +]]> + + + + + + + + + + + + + +{title} +

        {price}

        +

        {title}

        +]]>
        +
        + + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        {author}
        +
        {title}
        +
        {summary}
        +
        作者: {author}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {author}
        +
        {title}
        +
        {summary}
        +
        作者: {author}
        +]]>
        +
        + + + + + + + + + + + + + +
        + + + + + + + +]]> + + + + + + + + + + + + + {title}]]> + + + + + + + + + + + + + + + + + + + +
          +[loop] +
        • {title}{summary}
        • +[/loop] +
        +]]>
        + + + + + + + + + + + + + {title}{summary}]]> +
        + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        {author} ›
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {author} ›
        +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        {author} ›
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {author} ›
        +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        {username} ›
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {username} ›
        +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        {title}
        +
        {title}
        +
        +

        {summary}

        +

        {place} {class}

        +

        时间: {time}

        +

        {applynumber} 人关注

        +
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        {title}
        +
        {title}
        +
        +

        {summary}

        +

        {place} {class}

        +

        时间: {time}

        +

        {applynumber} 人关注

        +
        +]]>
        +
        + + + + + + + + + + + + + + + +
        + + + + + + +[loop] +
        +
        +
        {title}
        +
        {time} {place}
        +
        {applynumber} 人关注
        +
        +[/loop] +]]>
        + + + + + + + + + + + + + +
        +
        {title}
        +
        {time} {place}
        +
        {applynumber} 人关注
        +]]>
        +
        + + + + + + + + + + + + + +
        + + + + + + +
          +[loop] +
        • + {title} +

          {title}

          +
        • +[/loop] +[order=odd] +
        • + {title} +

          {title}

          +
        • +[/order] +
        +]]>
        + + + + + + + + + + + {title} +

        {title}

        +]]>
        +
        + + + + {title} +

        {title}

        +]]>
        +
        + + + + + + + + + + +
        + + + + + + + +]]> + + + + + + + + + + {title}]]> + + + + {title}]]> + + + + + + + + + + + + + + + + + +[loop] +
        +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + +
        +
        {title}
        +
        {summary}
        +]]>
        +
        + + + + + + + + + + + +
        +
        + + \ No newline at end of file diff --git a/template/default/portal/diyxml/portal_topic_blue.xml b/template/default/portal/diyxml/portal_topic_blue.xml new file mode 100644 index 0000000..0eee870 --- /dev/null +++ b/template/default/portal/diyxml/portal_topic_blue.xml @@ -0,0 +1,1543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
        +
        {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + +
        {title}
        +
        {summary}
        +]]>
        +
        + +
        + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {username}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
        +
        {title}
        +
        {username}: {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + +
        {title}
        +
        {username}: {title}
        +
        {summary}
        +]]>
        +
        + +
        + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {author}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
        +
        {author}
        +
        {author}: {title}
        +
        {summary}
        +
        +[/loop] +]]>
        + + + + + + + + +
        {author}
        +
        {author}: {title}
        +
        {summary}
        +]]>
        +
        + +
        + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          +[loop] +
        • + {title} +

          {title} ({picnum})

          +
        • +[/loop] +
        +]]>
        + + + + + + + + + {title} +

        {title} ({picnum})

        + ]]>
        +
        + +
        + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + {title}]]> + +]]> + +
          ]]> + + + + + + + + + + + + + + + + + + + +
          {title}
          +
          {summary}
          +]]>
          + ]]> + ]]> + + +
          + + + + + + + + + + +
          + + + + + + {title}]]> + +]]> + +
            ]]> + + + + + + + + + + + + + + + + +
              +[loop] +
            • {title}
            • +[/loop] +
            + +]]>
            + + + + + + + + + + + + + {title}]]> +
            + + + + + + + + + + +
            + + + \ No newline at end of file diff --git a/template/default/portal/diyxml/portal_topic_green.xml b/template/default/portal/diyxml/portal_topic_green.xml new file mode 100644 index 0000000..d3531ba --- /dev/null +++ b/template/default/portal/diyxml/portal_topic_green.xml @@ -0,0 +1,1543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
            +
            {title}
            +
            {summary}
            +
            +[/loop] +]]>
            + + + + + + + + +
            {title}
            +
            {summary}
            +]]>
            +
            + +
            + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {username}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
            +
            {title}
            +
            {username}: {title}
            +
            {summary}
            +
            +[/loop] +]]>
            + + + + + + + + +
            {title}
            +
            {username}: {title}
            +
            {summary}
            +]]>
            +
            + +
            + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {author}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
            +
            {author}
            +
            {author}: {title}
            +
            {summary}
            +
            +[/loop] +]]>
            + + + + + + + + +
            {author}
            +
            {author}: {title}
            +
            {summary}
            +]]>
            +
            + +
            + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +[loop] +
            • + {title} +

              {title} ({picnum})

              +
            • +[/loop] +
            +]]>
            + + + + + + + + + {title} +

            {title} ({picnum})

            + ]]>
            +
            + +
            + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + + + {title}]]> + +]]> + +
              ]]> + + + + + + + + + + + + + + + + + + + +
              {title}
              +
              {summary}
              +]]>
              + ]]> + ]]> + + +
              + + + + + + + + + + +
              + + + + + + {title}]]> + +]]> + +
                ]]> + + + + + + + + + + + + + + + + +
                  +[loop] +
                • {title}
                • +[/loop] +
                + +]]>
                + + + + + + + + + + + + + {title}]]> +
                + + + + + + + + + + +
                + + + \ No newline at end of file diff --git a/template/default/portal/diyxml/portal_topic_grey.xml b/template/default/portal/diyxml/portal_topic_grey.xml new file mode 100644 index 0000000..c6f6180 --- /dev/null +++ b/template/default/portal/diyxml/portal_topic_grey.xml @@ -0,0 +1,1543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
                +
                {title}
                +
                {summary}
                +
                +[/loop] +]]>
                + + + + + + + + +
                {title}
                +
                {summary}
                +]]>
                +
                + +
                + + + +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {username}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
                +
                {title}
                +
                {username}: {title}
                +
                {summary}
                +
                +[/loop] +]]>
                + + + + + + + + +
                {title}
                +
                {username}: {title}
                +
                {summary}
                +]]>
                +
                + +
                + + + +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {author}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
                +
                {author}
                +
                {author}: {title}
                +
                {summary}
                +
                +[/loop] +]]>
                + + + + + + + + +
                {author}
                +
                {author}: {title}
                +
                {summary}
                +]]>
                +
                + +
                + + + +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +[loop] +
                • + {title} +

                  {title} ({picnum})

                  +
                • +[/loop] +
                +]]>
                + + + + + + + + + {title} +

                {title} ({picnum})

                + ]]>
                +
                + +
                + + + +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                + + + + + + + {title}]]> + +]]> + +
                  ]]> + + + + + + + + + + + + + + + + + + + +
                  {title}
                  +
                  {summary}
                  +]]>
                  + ]]> + ]]> + + +
                  + + + + + + + + + + +
                  + + + + + + {title}]]> + +]]> + +
                    ]]> + + + + + + + + + + + + + + + + +
                      +[loop] +
                    • {title}
                    • +[/loop] +
                    + +]]>
                    + + + + + + + + + + + + + {title}]]> +
                    + + + + + + + + + + +
                    + + + \ No newline at end of file diff --git a/template/default/portal/diyxml/portal_topic_red.xml b/template/default/portal/diyxml/portal_topic_red.xml new file mode 100644 index 0000000..dfd49f4 --- /dev/null +++ b/template/default/portal/diyxml/portal_topic_red.xml @@ -0,0 +1,1543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
                    +
                    {title}
                    +
                    {summary}
                    +
                    +[/loop] +]]>
                    + + + + + + + + +
                    {title}
                    +
                    {summary}
                    +]]>
                    +
                    + +
                    + + + +
                    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + 专题导航| + 专题导航| + 专题导航| + 专题导航 +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {username}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
                    +
                    {title}
                    +
                    {username}: {title}
                    +
                    {summary}
                    +
                    +[/loop] +]]>
                    + + + + + + + + +
                    {title}
                    +
                    {username}: {title}
                    +
                    {summary}
                    +]]>
                    +
                    + +
                    + + + +
                    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + {author}: {title}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[loop] +
                    +
                    {author}
                    +
                    {author}: {title}
                    +
                    {summary}
                    +
                    +[/loop] +]]>
                    + + + + + + + + +
                    {author}
                    +
                    {author}: {title}
                    +
                    {summary}
                    +]]>
                    +
                    + +
                    + + + +
                    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                      +[loop] +
                    • + {title} +

                      {title} ({picnum})

                      +
                    • +[/loop] +
                    +]]>
                    + + + + + + + + + {title} +

                    {title} ({picnum})

                    + ]]>
                    +
                    + +
                    + + + +
                    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                    + + + + + + + {title}]]> + +]]> + +
                      ]]> + + + + + + + + + + + + + + + + + + + +
                      {title}
                      +
                      {summary}
                      +]]>
                      + ]]> + ]]> + + +
                      + + + + + + + + + + +
                      + + + + + + {title}]]> + +]]> + +
                        ]]> + + + + + + + + + + + + + + + + +
                          +[loop] +
                        • {title}
                        • +[/loop] +
                        + +]]>
                        + + + + + + + + + + + + + {title}]]> +
                        + + + + + + + + + + +
                        + + + \ No newline at end of file diff --git a/template/default/portal/index.htm b/template/default/portal/index.htm new file mode 100644 index 0000000..65516cc --- /dev/null +++ b/template/default/portal/index.htm @@ -0,0 +1,7 @@ + + +
                        +
                        +
                        + + diff --git a/template/default/portal/list.htm b/template/default/portal/list.htm new file mode 100644 index 0000000..fb4bc15 --- /dev/null +++ b/template/default/portal/list.htm @@ -0,0 +1,107 @@ + + + + + +
                        +
                        + $_G[setting][bbname] + {lang portal} + $value[catname] + $cat[catname] +
                        +
                        + + + +
                        +
                        +
                        + +
                        +
                        + +
                        +
                        + + +
                        + {lang sub_category}:   + + + |$value[catname] + +
                        + +
                        + + + +
                        +
                        $value[title] ({lang moderate_need})
                        +
                        +
                        $value[title]
                        + $value[summary] +
                        +
                        + {lang category}:    + $value[dateline] + + + | + + | + + + +
                        +
                        + +
                        +
                        +
                        + +
                        {$list['multi']}
                        + +
                        + +
                        +
                        + +
                        +
                        +
                        + + +
                        +
                        +

                        {lang category_related}

                        +
                        +
                        + +
                        +
                        + + +
                        +
                        +
                        + +
                        +
                        + +
                        +
                        +
                        + + \ No newline at end of file diff --git a/template/default/portal/list_category_onerank.htm b/template/default/portal/list_category_onerank.htm new file mode 100644 index 0000000..12f332a --- /dev/null +++ b/template/default/portal/list_category_onerank.htm @@ -0,0 +1,122 @@ + + + + + +
                        +
                        + $_G[setting][bbname] + {lang portal} + $value[catname] + $cat[catname] +
                        +
                        + + +
                        +
                        +
                        + +
                        +
                        +
                        + + + + + + + + +
                        +
                        +
                        + +
                        +
                        +
                        + + +
                        +
                        +

                        {lang category_related}

                        +
                        +
                        + +
                        +
                        + + +
                        +
                        +
                        + + +
                        +
                        {lang article_last}
                        +
                        + +
                        +
                        + + +
                        +
                        +
                        + + +
                        +
                        {lang article_hot}
                        +
                        + +
                        +
                        + + +
                        +
                        +
                        + +
                        +
                        + +
                        +
                        +
                        + + \ No newline at end of file diff --git a/template/default/portal/list_category_tworanks.htm b/template/default/portal/list_category_tworanks.htm new file mode 100644 index 0000000..17b557c --- /dev/null +++ b/template/default/portal/list_category_tworanks.htm @@ -0,0 +1,129 @@ + + + + + + +
                        +
                        + $_G[setting][bbname] + {lang portal} + $value[catname] + $cat[catname] +
                        +
                        + + +
                        +
                        +
                        + +
                        +
                        +
                        + +
                        + + + + +
                        +
                        + + + {lang article_publish} + | + + {lang more}› + +

                        {$portalcategory[$subcatid]['catname']}

                        +
                        +
                        + +
                        +
                        +
                        + + + +
                        + + +
                        +
                        +
                        + +
                        +
                        +
                        + + +
                        +
                        +

                        {lang category_related}

                        +
                        +
                        + +
                        +
                        + + +
                        +
                        +
                        + + +
                        +
                        {lang article_last}
                        +
                        + +
                        +
                        + + +
                        +
                        +
                        + + +
                        +
                        {lang article_hot}
                        +
                        + +
                        +
                        + + +
                        +
                        +
                        + +
                        +
                        + +
                        +
                        +
                        + + \ No newline at end of file diff --git a/template/default/portal/list_index.htm b/template/default/portal/list_index.htm new file mode 100644 index 0000000..e6e481d --- /dev/null +++ b/template/default/portal/list_index.htm @@ -0,0 +1,9 @@ + + + + +
                        +
                        +
                        + + \ No newline at end of file diff --git a/template/default/portal/portal_attachment.htm b/template/default/portal/portal_attachment.htm new file mode 100644 index 0000000..a7f5da6 --- /dev/null +++ b/template/default/portal/portal_attachment.htm @@ -0,0 +1,39 @@ + + + + + + + + + + +
                        +

                        + $attach[filetype] {$attach[filename]} +

                        +
                        $attach[filesize]{lang delete}
                        + + + + {lang portal_attachment_big_img}| + {lang portal_attachment_small_img} + + + + + | + {lang delete} + + + + \ No newline at end of file diff --git a/template/default/portal/portal_comment.htm b/template/default/portal/portal_comment.htm new file mode 100644 index 0000000..0123098 --- /dev/null +++ b/template/default/portal/portal_comment.htm @@ -0,0 +1,52 @@ +
                        +
                        + + + {lang post_comment} + + + {lang post_comment} + +

                        {lang latest_comment}

                        +
                        +
                        + + + + + + + +

                        {lang hide_portal_comment}

                        + +

                        {lang view_all_comments}($data[commentnum])

                        + +
                        +
                        +
                        + +
                        +
                        + + + +
                        + + + + + + + + + + + + + + +

                        + + +
                        +
                        \ No newline at end of file diff --git a/template/default/portal/portal_diyhelp.htm b/template/default/portal/portal_diyhelp.htm new file mode 100644 index 0000000..c11c5f8 --- /dev/null +++ b/template/default/portal/portal_diyhelp.htm @@ -0,0 +1,23 @@ + + + if(!$('diypage') && $('wp')) { + var dom = document.createElement('div'); + dom.id = 'diypage'; + dom.className = 'area'; + $('wp').appendChild(dom); + } + $('diypage').innerHTML = '

                        \n\

                        {lang diyhelp_doit}\n\ + {lang diyhelp_import}

                        '; + + + + if(!$('diypage') && $('wp')) { + var dom = document.createElement('div'); + dom.id = 'diypage'; + dom.className = 'area'; + $('wp').appendChild(dom); + } + $('diypage').innerHTML = '
                        {lang diyhelp_no_content}
                        '; + + + \ No newline at end of file diff --git a/template/default/portal/portal_topic_content.htm b/template/default/portal/portal_topic_content.htm new file mode 100644 index 0000000..0570aed --- /dev/null +++ b/template/default/portal/portal_topic_content.htm @@ -0,0 +1,30 @@ + +
                        +
                        + $_G[setting][bbname] $topic[title] +
                        +
                        + + +
                        +
                        +
                        + +
                        +
                        +
                        {lang frame}
                        +
                        +
                        +
                        + + + {eval + $data = &$topic; + $common_url = "portal.php?mod=comment&id=$topicid&idtype=topicid"; + $form_url = "portal.php?mod=portalcp&ac=comment"; + $commentlist = portaltopicgetcomment($topicid); } + + +
                        + + \ No newline at end of file diff --git a/template/default/portal/portalcp_article.htm b/template/default/portal/portalcp_article.htm new file mode 100644 index 0000000..8cadd80 --- /dev/null +++ b/template/default/portal/portalcp_article.htm @@ -0,0 +1,409 @@ + + + + +

                        + {lang article_delete} + {lang close} +

                        + +
                        +
                        + + {lang article_delete_sure} + + + + + +
                        +

                        + +

                        + + + + +
                        + +

                        + {lang moderate_article} + {lang close} +

                        + +
                        +
                        + + + +
                        +

                        + +

                        + + + + + +
                        + + + +
                      • [ $ra[aid] ] $ra[title] {lang delete}
                      • + + + +

                        + {lang article_pushplus} + {lang close} +

                        +
                        +
                        + $pushcount {lang portalcp_article_message1}({lang view_article}) +
                        {lang portalcp_article_message2} +
                        + + + +
                        +
                        +

                        + + + + + +

                        +
                        + +
                        +
                        +
                        +

                        {lang article_send_succeed}

                        +

                        + {lang article_edit} + | + {lang article_send_continue} + | + {lang view_article} + + | + + +

                        +
                        +
                        +
                        + + + + + + +
                        +
                        +
                        +

                        {lang article_edit}{lang article_publish}

                        + +
                        + +
                        + {lang article_title}:  + + + + + + + B + I + U +
                        + + + +
                        +
                        +
                        + +
                        {lang article_category}
                        +
                        $categoryselect
                        + + +
                        {lang article_source}
                        +
                        + + + + +
                        +
                        {lang article_source_url}
                        +
                        +
                        {lang article_dateline}
                        +
                        + +
                        +
                        +
                        +
                        + +
                        {lang article_auto_grab}
                        +
                        + + + + + +   + + + + + + + + +
                        + +
                        {lang article_url}
                        +
                        +
                        {lang article_author}
                        +
                        + +
                        {lang article_comment_setup}
                        +
                        + +
                        +
                        +
                        + +
                        + +
                        + + + +
                        +
                        + + + +
                        +
                        +

                        {lang article_description}

                        +
                        +
                        +
                        + +
                        +
                        +

                        {lang article_tag}

                        +
                        +
                        + + + + +
                        +
                        + +
                        +

                        {lang article_related} {lang select}

                        + +
                        + + + + + +
                        + + +
                        + + +
                        + + + + + + + +
                        +
                        +
                        + + + + + + diff --git a/template/default/portal/portalcp_block.htm b/template/default/portal/portalcp_block.htm new file mode 100644 index 0000000..56a909d --- /dev/null +++ b/template/default/portal/portalcp_block.htm @@ -0,0 +1,776 @@ + + + + +
                        +
                        +
                        +
                        + + + + + + + + +
                      • {lang block_properties}
                      • + + + +
                      • {lang block_data}
                      • + + +
                      • {lang block_template}
                      • + +
                      • {lang block_moreurl}
                      • + + + + + + + + +

                        + {lang block_edit} + {lang close} +

                        +
                          + $blocknav +
                        + +
                        +
                        +
                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                        + {lang block_properties_comment}
                        {lang block_id} + + +
                        {lang block_type} + + + + Tip + + $blockclassname + +
                        {lang block_data_source} + + +   + Tip + +
                        + {lang hide_setting} +
                        {lang block_item_display_num}
                        {lang block_data_update_cache} + {lang minute} + +

                        +

                        + 10{lang minute}  + 1{lang hour}  + 1{lang day}  + + Tip + | + {lang not_auto_update}  + {lang never_update} +

                        +
                        {lang block_display_style} + + +    + + Tip + +
                        {lang block_data_custom} + +

                        + +

                        +
                        +
                        +
                        + + + + + + +
                        +
                        + + +

                        + {lang block_data} + {lang close} +

                        +
                          + $blocknav + +
                        + +
                        +
                        +
                        + + + + + + + + + + + + + + + + + + + + + + + + + + +
                        {lang locked}{lang position}{lang title}{lang operation}
                        {lang preorder}$item[displayorder][{$item['itemtypename']}] $item['title'] + {lang edit}| + + {lang delete} + + {lang block_stop} + +

                        {lang no_data}

                        + +

                        {lang block_view_banned_data}

                        + + +
                        +
                        + +
                        + + + + + + + +
                        + +
                        + + + + +

                        + {lang block_template} + {lang close} +

                        +
                          + $blocknav +
                        + +
                        +
                        + +
                        +

                        {lang portalcp_block_message1}

                        +

                        {lang reference_call_data}:

                        +

                        $samplecode

                        +

                        {lang reference_call_field}:

                        + + + + + + + +
                        $value[name]$key
                        +
                        + +
                        +

                        + + +
                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                        {lang grammar}{lang statements}
                        $value[name]{{$key}}
                        {lang more_url}{{echo 'moreurl'}}
                        {lang current_data_order}{{echo 'currentorder'}}
                        {lang current_data_odd}{{echo 'parity'}}
                        {lang default_loop_content}[loop]...[/loop]
                        {lang replace_loop_content}[order=N]...[/order]
                        {lang special_data_content}[index=N]...[/index]
                        {lang set_open_link}<a href="{{echo 'url'}}"{{echo 'target'}}>{{echo 'title'}}</a>
                        {lang set_small_pic}<img src="{{echo 'pic'}}" width="{{echo 'picwidth'}}" height="{{echo 'picheight'}}" />
                        {lang more_introduction}{lang reference_message}
                        + +
                        +
                        + + + + + + +
                        +
                        + + +
                        + + + + + + + + + + + + + + + + + + + + + + +
                        {lang delete}{lang display_order}{lang title}{lang pass_moderate_time}{lang is_stick}{lang operation}
                        + $item['title']$item['verifiedtime']{lang stick} $item[stickgrade]{lang no} + {lang edit} +
                        + + + + + +
                        +
                        $multi
                        +
                        + +

                        {lang no_data_mod}

                        + + + + + + +

                        + {lang block_edit} + + <<{lang return} + {lang close} + +

                        +
                        +
                        + + + + + + + + + + + + + + + + + + + + + + +
                        {lang block_data_from_datasource} + + + +
                        {lang block_display_position} + +   + + + + + + +
                        +
                        +
                        + + + + + +
                        +
                        + + + + + + + + +
                        {lang data_repeat_recommend}
                        + + + + + {lang todo_updateblock} + + + + + + {lang need_moderate} + + + + + + + + {lang verify_message} + + + +

                        + {lang moderate_data} + {lang close} +

                        +
                        +
                        + + + + + + + + +
                        {lang update_mod} + +
                        +
                        +
                        + + + + +
                        +
                        + + + + +

                        + {lang edit_data} + {lang close} +

                        +
                        +
                        + + + + + + + + +
                        {lang stick_level} + +
                        +
                        +
                        + + + + +
                        +
                        + + + + + +
                        + + $html + +
                        + + + + + + + fav + + normal + + + +

                        + {lang block_moreurl} + {lang close} +

                        +
                          + $blocknav +
                        + +
                        +
                        + + + + + + + + + + + + + + + + + + +
                        {lang perpage} Tip + +
                        {lang seotitle} Tip + +
                        {lang seokeywords} Tip + +
                        {lang seodescription} Tip + +
                        +
                        +
                        + + + + + +
                        +
                        + + + +
                        +
                        +
                        +
                        + +
                        +
                        + + \ No newline at end of file diff --git a/template/default/portal/portalcp_block_itemfields.htm b/template/default/portal/portalcp_block_itemfields.htm new file mode 100644 index 0000000..8f38db2 --- /dev/null +++ b/template/default/portal/portalcp_block_itemfields.htm @@ -0,0 +1,85 @@ + + + $field[name] + + + + +
                        +
                        + B + + I + + U + + +
                        + + + +
                        +
                        + B + + I + + U + + +
                        + + + + +
                        +
                        + + {lang cut} +
                        + + + +
                        + + +
                        +
                        + +
                        +
                        + + + +
                        +
                        +
                        + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/portal/portalcp_block_setting.htm b/template/default/portal/portalcp_block_setting.htm new file mode 100644 index 0000000..d77833c --- /dev/null +++ b/template/default/portal/portalcp_block_setting.htm @@ -0,0 +1,6 @@ + + + $value[title] Tip + $value[html] + + \ No newline at end of file diff --git a/template/default/portal/portalcp_block_thumbsetting.htm b/template/default/portal/portalcp_block_thumbsetting.htm new file mode 100644 index 0000000..5f29d80 --- /dev/null +++ b/template/default/portal/portalcp_block_thumbsetting.htm @@ -0,0 +1,37 @@ + + + {lang block_thumb_width} + + + + {lang block_thumb_height} + + + + + + {lang block_link_target_type} + + + + + + + + {lang dateformat} + + +   + + Tip + + + \ No newline at end of file diff --git a/template/default/portal/portalcp_category.htm b/template/default/portal/portalcp_category.htm new file mode 100644 index 0000000..35169ec --- /dev/null +++ b/template/default/portal/portalcp_category.htm @@ -0,0 +1,132 @@ + + + + +
                        +
                        +
                        + + + + + + + + +
                        +

                        + {lang article_manage} - $cate[catname] +

                        +
                        + +
                        + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                         {lang article_subject}{lang category}{lang author}{lang article_operation}
                        + + + + $line + + + $value['shorttitle']$value['title'] + $value[taghtml] + ({lang moderate_need}) + ({lang ignored}) + $category[$value[catid]][catname] + $value[username] +
                        $value[dateline] +
                        + + {lang edit} + + $line + + + + {lang moderate} + + {lang delete} + + + + {lang blockdata_recommend} + +
                        + + + + + $categoryselect + +
                        +
                        +
                        $multi
                        + +
                        +
                        +
                        + +
                        +
                        + + + \ No newline at end of file diff --git a/template/default/portal/portalcp_comment.htm b/template/default/portal/portalcp_comment.htm new file mode 100644 index 0000000..1fa19ba --- /dev/null +++ b/template/default/portal/portalcp_comment.htm @@ -0,0 +1,47 @@ + + + + [quote]{$comment[username]}: {$comment[message]}[/quote] + + + +

                        + {lang edit} + {lang close} +

                        +
                        + + + + +
                        +

                        + +

                        + +
                        +

                        + +

                        +
                        + + + +

                        + {lang comment_delete} + {lang close} +

                        +
                        + + + + +
                        {lang comment_delete_confirm}
                        +

                        + +

                        +
                        + + + + \ No newline at end of file diff --git a/template/default/portal/portalcp_diy.htm b/template/default/portal/portalcp_diy.htm new file mode 100644 index 0000000..6a2f500 --- /dev/null +++ b/template/default/portal/portalcp_diy.htm @@ -0,0 +1,224 @@ + + +
                        + + + + + $value[name] + + | + $value[name] + + +
                        + + + + +
                          + +
                            + +
                          • +
                              + +
                            1. + +
                            +
                          • +
                          + + + + +
                          $multi
                          +
                            + +
                          • + +
                          +
                          $multi
                          + +
                          +
                          +
                          + +
                          +
                          + + + + +
                          +
                          + +
                          + {lang diy_editing}: + {lang background} + |{lang title_bar} + |{lang content_area} + + {lang background_image_cancel} + |{lang restore_skin} +
                          +
                          +
                          +
                          +
                          +
                          {lang diy_change}
                          +
                          + +
                          + + + + + + + + + +
                          + +
                          {lang image_position}: + + + + + + + + + + + + + + + + +
                             
                             
                             
                          +
                          +
                          +
                          + + + + + + + + + +
                          {lang background_attach_mode}: + + +
                          {lang background_color}: + +
                          +
                          +
                          + + + + + + + + + +
                          {lang text_color}: + +
                          {lang link_color}: + +
                          +
                          +
                          +
                          + +

                          + {lang import_frame} + + {lang close} + +

                          + + +
                          +
                          + + + {lang import_select_file}: + + +
                          {lang import_system_file_no_exists}
                          + + + {lang import_text_file_from}: + +
                          +
                          + + + + + +
                          +
                          + + + \ No newline at end of file diff --git a/template/default/portal/portalcp_index.htm b/template/default/portal/portalcp_index.htm new file mode 100644 index 0000000..abf4ab8 --- /dev/null +++ b/template/default/portal/portalcp_index.htm @@ -0,0 +1,75 @@ + + + + +

                          + {lang article_push} + {lang close} +

                          + +
                          +

                          {lang category_push_select}

                          + + + $categorytree +
                          + +

                          {lang portalcp_index_message}

                          + +
                          + + + +
                          +
                          + $_G[setting][bbname] + {lang portal} + {lang portal_manage} + {lang category_management} +
                          +
                          + +
                          +
                          +
                          + + + + + + + + $categorytree +
                          {lang category_name}{lang article_numbers}{lang article_operation}
                          + +

                          {lang portalcp_has_no_category}

                          + +

                          {lang portalcp_index_message}

                          + +
                          +
                          +
                          + +
                          +
                          + + \ No newline at end of file diff --git a/template/default/portal/portalcp_login.htm b/template/default/portal/portalcp_login.htm new file mode 100644 index 0000000..067abc9 --- /dev/null +++ b/template/default/portal/portalcp_login.htm @@ -0,0 +1,63 @@ + + + + +

                          + {lang article_push} + {lang close} +

                          + +
                          +

                          {lang category_push_select}

                          + + $categorytree +
                          +
                          + + + + +
                          +
                          +
                          +

                          {lang panel_login}

                          +
                          {lang panel_notice_login}
                          +
                          + + + + + + + + + + + + + +
                          {lang panel_login_username}:{$_G[member][username]}
                          {lang panel_login_password}:
                          +
                          +
                          + +
                          +
                          + +
                          +
                          + + + diff --git a/template/default/portal/portalcp_nav.htm b/template/default/portal/portalcp_nav.htm new file mode 100644 index 0000000..2318686 --- /dev/null +++ b/template/default/portal/portalcp_nav.htm @@ -0,0 +1,20 @@ +
                          +

                          {lang portal_manage}{lang portal_block_manage}

                          + +
                          \ No newline at end of file diff --git a/template/default/portal/portalcp_pageblock.htm b/template/default/portal/portalcp_pageblock.htm new file mode 100644 index 0000000..54df13b --- /dev/null +++ b/template/default/portal/portalcp_pageblock.htm @@ -0,0 +1,35 @@ + + + + +
                          +

                          {lang block_recommend_data_in_block}

                          + +
                          +
                          + + + +

                          {lang select_block}

                          +
                            + +
                          • + $block[name] + +
                          • + +
                          + +

                          {lang has_no_block}

                          + + +
                          $multi
                          + + diff --git a/template/default/portal/portalcp_plugin.htm b/template/default/portal/portalcp_plugin.htm new file mode 100644 index 0000000..0e6b4f7 --- /dev/null +++ b/template/default/portal/portalcp_plugin.htm @@ -0,0 +1,25 @@ + +
                          +
                          + $_G[setting][bbname] + {lang portal} + {lang portal_manage} + $_G['setting']['plugins']['portalcp'][$_GET['id']]['name'] +
                          +
                          + +
                          +
                          +

                          $_G['setting']['plugins']['portalcp'][$_GET['id']]['name']

                          +
                          +
                          + +
                          +
                          +
                          +
                          + +
                          +
                          + + \ No newline at end of file diff --git a/template/default/portal/portalcp_portalblock.htm b/template/default/portal/portalcp_portalblock.htm new file mode 100644 index 0000000..d7b26d9 --- /dev/null +++ b/template/default/portal/portalcp_portalblock.htm @@ -0,0 +1,279 @@ + + +
                          + +
                          + +
                          +
                          +

                          {lang block_management}

                          +
                          +
                          + + + + + + +

                          + {lang push} + {lang close} +

                          + +
                          +
                          + + + {lang block_page}: +   + + {lang block_id}: +   + +

                          + + + + + + + +
                          +
                          +

                          + + + + + +   +   +   + + +

                          +
                          + + + + +
                          + + + + + {lang block_page}: +   + + {lang block_id}: +   + +
                          + + +

                          + {lang view_select_mod}{lang click_return_list} +

                          + + + + {eval + $addurl = $_GET['targettplname'] ? '&targettplname='.$_GET['targettplname'] : ''; + $addurl .= $_GET['searchkey'] ? '&searchkey='.$_GET['searchkey'] : ''; + $_block = count($blocks) == 1 ? current($blocks) : array(); + } + +
                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $block[name] + + + + + + + + + + + + + + + + + + +
                          {lang delete}{lang display_order}{lang title}{lang block_page}{lang block_id}{lang pass_moderate_time}{lang is_stick}{lang operation}
                          + $value['title']$page$blocks[$value[bid]][name]$value['verifiedtime']{lang stick} $value[stickgrade]{lang no} + {lang edit} +
                          + + + + + +
                          {lang select}{lang title}{lang block_page}{lang block_id}{lang push_people}{lang push_dateline}{lang block_operation}
                          $value[title]$page$blocks[$value[bid]][name]$value[username]$value[dateline] + {lang moderate} +
                          + + + + + + + [{lang update_block_tips}] +
                          {lang no_data}
                           {lang block_id}{lang mod_category}{lang block_data_source}{lang block_page}{lang block_operation}
                          $block[name] $block[blockclassname]$block[datasrc]$page + + {lang property} + + {lang unoperation} + + + {lang data} + + {lang unoperation} + + + {lang moderate} + {lang block_itemdata} + + {lang unoperation} + {lang unoperation} + +
                          + + + + + + Tip +
                          {lang no_data}
                          +
                          $multi
                          + +
                          + + + +

                          {lang block_no_managable}

                          + + + + +
                          +
                          +
                          +
                          + +
                          +
                          + + \ No newline at end of file diff --git a/template/default/portal/portalcp_related_article.htm b/template/default/portal/portalcp_related_article.htm new file mode 100644 index 0000000..5d73680 --- /dev/null +++ b/template/default/portal/portalcp_related_article.htm @@ -0,0 +1,280 @@ + + + +
                        • + $ra[title] + + {lang move_up} + {lang move_down} + {lang delete} + +
                        • + + + +
                        • + $list[title] + + {lang move_up} + {lang move_down} + {lang delete} + +
                        • + + + +
                        • + + +
                        • + + + +
                        • + + $ra[title] + ({lang article_id}: $ra[aid]) + {lang delete} +
                        • + + +

                          + {lang manage_related_article} + {lang close} +

                          +
                          +
                          +
                          + {lang article_id}: +   + +
                          + {$category}  +   + +
                          +
                          +
                          +

                          + {lang wait_select}(0/$count {lang max_wait_select}) + +

                          +
                            + +
                          • + +
                          • + +
                          +
                          +
                          + +
                          +
                          +

                          {lang already_select}(0)

                          +
                            +
                            +
                            +
                            +

                            + + + + + + +

                            + + + + \ No newline at end of file diff --git a/template/default/portal/portalcp_topic.htm b/template/default/portal/portalcp_topic.htm new file mode 100644 index 0000000..1ce1eef --- /dev/null +++ b/template/default/portal/portalcp_topic.htm @@ -0,0 +1,143 @@ + + + + +
                            +
                            + +
                            +
                            +

                            {lang topic_edit}{lang topic_add}

                            +
                            +
                            +
                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            *{lang topic_submit}
                            *{lang topic_static_name} +

                            {lang topic_static_name_comment}

                            +
                            {lang topic_domain} + + http://.$_G['setting']['domain']['root']['topic'] + + + +

                            {lang topic_domain_comment}

                            +
                            {lang topic_description} +

                            {lang topic_description_comment}

                            +
                            {lang topic_keyword} +

                            {lang topic_keyword_comment}

                            +
                            {lang topic_cover} +

                            + + +

                            +

                            + + +

                            + {lang topic_cover_current}: + {$topic[title] or ''} + +

                            + +
                            {lang tplname} + + + + + + + + {lang cancel} + + $html +

                            {lang topic_tplname_comment}

                            {lang topic_allowcomment} + + +
                            {lang topic_opened} + + + +

                            {lang topic_create_closed}

                            + +
                            {lang topic_additional} + + +
                              + + + +
                            +
                            +
                            +
                            + + + {lang topic_custom_start} + + +
                            +
                            + + + \ No newline at end of file diff --git a/template/default/portal/view.htm b/template/default/portal/view.htm new file mode 100644 index 0000000..91b1815 --- /dev/null +++ b/template/default/portal/view.htm @@ -0,0 +1,229 @@ + + + + + +
                            +
                            + $_G[setting][bbname] + {lang nav_index} + + $value[catname] + + $cat[catname] + {lang view_content} +
                            +
                            + + + + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            $article[title] ({lang moderate_need})({lang ignored})

                            +

                            + $article[dateline]| + {lang view_publisher}: $article[username]| + {lang view_views}: $article[viewnum]0| + {lang view_comments}: $article[commentnum]0 + |{lang view_author_original}: $article[author] + |{lang from}: $article[from]$article[from] + + + |{lang edit} + + |{lang moderate} + + |{lang delete} + + + +

                            +
                            + +
                            + +
                            {lang article_description}: $article[summary]
                            + +
                            + +
                            + +
                            + +
                            + + +
                            $content[title]
                            + + $content[content] +
                            + +
                            $multi
                            + +
                            + + +
                            + +
                            + + +
                            +

                            {lang article_inner_navigation}

                            + +
                            + + +
                            + +
                            + + + + + +
                            + {lang viewthread_share_to}: + +
                            + + + + +
                            + {lang pre_article}{$article['prearticle']['title']} + {lang next_article}{$article['nextarticle']['title']} +
                            + +
                            + +
                            + + + + +
                            +
                            +

                            {lang view_related}

                            +
                            +
                            + +
                            +
                            + + +
                            + + + + + + +
                            + + +
                            +
                            + + + +
                            +
                            +
                            + + +
                            +
                            +

                            {lang category_related}

                            +
                            +
                            + +
                            +
                            + + + +
                            +
                            +

                            {lang sub_category}

                            +
                            +
                            + +
                            +
                            + + +
                            +
                            +
                            + + + +
                            +
                            + + + + + +
                            +
                            +
                            + + + \ No newline at end of file diff --git a/template/default/preview.jpg b/template/default/preview.jpg new file mode 100644 index 0000000..470616f Binary files /dev/null and b/template/default/preview.jpg differ diff --git a/template/default/preview_large.jpg b/template/default/preview_large.jpg new file mode 100644 index 0000000..fc089e0 Binary files /dev/null and b/template/default/preview_large.jpg differ diff --git a/template/default/ranklist/activity.htm b/template/default/ranklist/activity.htm new file mode 100644 index 0000000..ceefa04 --- /dev/null +++ b/template/default/ranklist/activity.htm @@ -0,0 +1,81 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang ranklist_activity} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang ranklist_activity}

                            + +

                            + {lang ranklist_month}| + {lang ranklist_week}| + {lang ranklist_today}| + {lang all} +

                            + + + + + + + + + + + +
                            $activity['rank']
                            +

                            $activity['subject']

                            +

                            {lang ranklist_activity_start} $activity['starttimefrom'] - $activity['starttimeto'] {lang ranklist_activity_end}

                            +

                            $activity['message']

                            +

                            + {lang ranklist_thread_favorite} $activity['favtimes'] + {lang ranklist_thread_share} $activity['sharetimes'] + {lang hot} $activity['heats'] +

                            +
                            + $activity['class']
                            + $activity['place']
                            + {lang have} $activity['applynumber'] {lang join}
                            + $activity['replies'] {lang message} +
                            + +
                            +
                            $multi
                            + +
                            {lang none_data}
                            + +
                            {lang ranklist_update}
                            +
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/ranklist/blog.htm b/template/default/ranklist/blog.htm new file mode 100644 index 0000000..908298c --- /dev/null +++ b/template/default/ranklist/blog.htm @@ -0,0 +1,87 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang blog_ranklist} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang blog_ranklist}

                            + +

                            + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                            + +
                            + +
                            +
                            $blog['rank']
                            +
                            + +
                            +
                            + + {lang share} + + $blog[subject] +
                            +
                            + $blog[username] $blog[dateline] +
                            +
                            + $blog[message] +
                            +
                            + {lang views} $blog[hot] + {lang comment} $blog[replynum] + {lang ranklist_thread_view} $blog[viewnum] + {lang ranklist_thread_share} $blog[sharetimes] + {lang ranklist_thread_favorite} $blog[favtimes] + $clicks[$_GET[view]][name] $blog['click'.$_GET[view]] +
                            +
                            + +
                            + +
                            {lang none_data}
                            + +
                            {lang ranklist_update}
                            +
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/ranklist/forum.htm b/template/default/ranklist/forum.htm new file mode 100644 index 0000000..8d9a21f --- /dev/null +++ b/template/default/ranklist/forum.htm @@ -0,0 +1,65 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang ranklist_forum} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang ranklist_forum}

                            + + +
                            + + + + + + + + + + + + + +
                             {lang forum} + {lang ranklist_forum_day_post} + {lang reply} + {lang ranklist_forum_month_post} + {lang ranklist_forum_post} +
                            $forum['rank']$forum['name'] + $forum['posts'] +
                            +
                            + +
                            {lang none_data}
                            + +
                            {lang ranklist_update}
                            +
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/ranklist/group.htm b/template/default/ranklist/group.htm new file mode 100644 index 0000000..1c4b35a --- /dev/null +++ b/template/default/ranklist/group.htm @@ -0,0 +1,71 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang ranklist_group} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang ranklist_group}

                            + + +
                            + + + + + + + + + + + + + +
                             {lang group}({lang ranklist_group_credit}) + {lang ranklist_forum_day_post} + {lang reply} + {lang ranklist_forum_month_post} + {lang credit_num} + {lang member_num} + {lang ranklist_forum_post} +
                            $forum['rank']$forum['name'] + $forum['commoncredits'] + $forum['membernum'] + $forum['posts'] +
                            +
                            + +
                            {lang none_data}
                            + +
                            {lang ranklist_update}
                            +
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/ranklist/index.htm b/template/default/ranklist/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/ranklist/member.htm b/template/default/ranklist/member.htm new file mode 100644 index 0000000..e96926f --- /dev/null +++ b/template/default/ranklist/member.htm @@ -0,0 +1,190 @@ + + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang ranklist_member} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang ranklist_member}

                            + + + + +

                            + {lang all} + + + |{$credit[title]} + + +

                            + + +
                            + +

                            {lang friend_top_note}:

                            + + {$announcement}
                            + + + {lang your_current_bid}: $space[unitprice] {$extcredits[$creditid][unit]},{lang current_ranking} $now_pos ,{lang make_persistent_efforts}! + + {lang ranking_message_0} + +
                            {lang ranking_message_1} +
                            {lang ranking_message_2} + + + {lang self_current_credit}{lang credits}{$extcredits[$now_choose][title]}: $mycredits + + {lang self_current_friend_num}: $space[friends] + + ,{lang current_ranking} $now_pos ,{lang make_persistent_efforts}! + + +

                            + {lang top_100_update} +

                            + +
                            + + + +
                            +
                            + + + + + + + + + + + + +

                            {lang i_ranking}

                            + {lang my_ranking_declaration} +

                            {lang max_char_ranking}

                            +
                            + {lang show_unitprice} +

                            ({lang edit_price})

                            +
                            + {lang increase_bid}{$extcredits[$creditid][title]} +

                            {lang not_exceed}{$extcredits[$creditid][title]} $space[credit] {$extcredits[$creditid][unit]}

                            +
                            +   + +    + +
                            + + +
                            + +
                            + + + + + + + + + + +

                            {lang help_friend_in_top}

                            + {lang friend_need_help} +

                            {lang please_input_friend_name}

                            +
                            + {lang handsel_bid}{$extcredits[$creditid][title]} +

                            {lang not_exceed}{$extcredits[$creditid][title]} $space[credit] {$extcredits[$creditid][unit]}

                            +
                            +    + +
                            + + +
                            +
                            + +
                            {lang close_ranking_note}
                            + + + + + +
                            +
                            +
                            +
                            +
                            + +
                            +
                            +
                            + +
                            + + diff --git a/template/default/ranklist/member_list.htm b/template/default/ranklist/member_list.htm new file mode 100644 index 0000000..62b17ac --- /dev/null +++ b/template/default/ranklist/member_list.htm @@ -0,0 +1,82 @@ + +

                            + {lang order} + + +

                            + + +

                            + {lang post_num}| + {lang digest_num}| + {lang month_post_num}| + {lang day_post_num} +

                            + + +

                            + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                            + + +

                            + {lang ranklist_month}| + {lang all} +

                            + + +
                            + +
                            +
                            $value[rank]
                            +
                            +
                            +

                            {lang visit_friend}

                            +

                            {lang say_hi}

                            +

                            {lang send_pm}

                            +

                            {lang add_friend}

                            +
                            +
                            + $value[username] + +
                            +
                            +

                            + {$_G['cache']['usergroups'][$value['groupid']]['grouptitle']} + {lang credit_num}: $value[credits] + {$extcredits[$now_choose][title]}: $value[extcredits] {$extcredits[$now_choose][unit]} + {lang invite_num}: $value[invitenum] + {lang posts_num}: $value[posts] + {lang blogs_num}: $value[blogs] + {lang views} $value[views] + {lang online_time}: $value[onlinetime] {lang minute} +

                            + +

                            {lang friends_num}: $value[friends]

                            +

                            {lang last_activity}: $value[lastactivity]

                            +

                            {lang show_unitprice}: $value[unitprice] ({lang modify})

                            +

                            {lang show_credit}{$extcredits[$creditid][title]}: $value[show_credit] {$extcredits[$creditid][unit]}

                            +

                            {lang show_credit_note}: $value[show_note]

                            +
                            +
                            + +
                            $multi
                            +
                            + +
                            {lang no_members_of}
                            + +
                            {lang ranklist_update}
                            \ No newline at end of file diff --git a/template/default/ranklist/picture.htm b/template/default/ranklist/picture.htm new file mode 100644 index 0000000..8e5639d --- /dev/null +++ b/template/default/ranklist/picture.htm @@ -0,0 +1,65 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang ranklist_picture} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang ranklist_picture}

                            + +

                            + {lang ranklist_month}| + {lang ranklist_week}| + {lang ranklist_today}| + {lang all} +

                            + +
                              + +
                            • +
                              + $picture['rank'] + +
                              +

                              {lang views} $picture[hot]

                              +

                              {lang ranklist_thread_share} $picture[sharetimes]

                              +

                              $clicks[$_GET[view]][name] $picture['click'.$_GET[view]]

                              + $picture[username] +
                            • + +
                            + +
                            {lang none_data}
                            + +
                            {lang ranklist_update}
                            +
                            +
                            +
                            +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/ranklist/poll.htm b/template/default/ranklist/poll.htm new file mode 100644 index 0000000..fbe28ca --- /dev/null +++ b/template/default/ranklist/poll.htm @@ -0,0 +1,83 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang ranklist_poll} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang ranklist_poll}

                            + +

                            + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                            + + +
                            $multi
                            + +
                            {lang none_data}
                            + +
                            {lang ranklist_update}
                            +
                            +
                            +
                            +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/ranklist/ranklist.htm b/template/default/ranklist/ranklist.htm new file mode 100644 index 0000000..46c5482 --- /dev/null +++ b/template/default/ranklist/ranklist.htm @@ -0,0 +1,177 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang all} +
                            +
                            + + + +
                            + +
                            +
                            + +
                            + +
                            +
                            + + + {lang i_want_rank} + | + + {lang more}› + +

                            {lang bidding_rank}

                            +
                            +
                            + +
                            +
                            + + +
                            + +
                            +
                            +
                            + + {lang more}› + +

                            {lang ranklist_picture}

                            +
                            +
                            + +
                            +
                            +
                            + + +
                            + + +
                            +
                            + {lang more}› +

                            {lang ranklist_thread}

                            +
                            +
                            + +
                            +
                            + + + +
                            +
                            + {lang more}› +

                            {lang blog_ranklist}

                            +
                            +
                            + +
                            +
                            + + + +
                            +
                            + {lang more}› +

                            {lang ranklist_poll}

                            +
                            +
                            + +
                            +
                            + + + +
                            +
                            + {lang more}› +

                            {lang ranklist_activity}

                            +
                            +
                            + +
                            +
                            + + +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/ranklist/side_left.htm b/template/default/ranklist/side_left.htm new file mode 100644 index 0000000..2ce582f --- /dev/null +++ b/template/default/ranklist/side_left.htm @@ -0,0 +1,31 @@ +
                            +

                            $_G[setting][navs][8][navname]

                            + + +
                            \ No newline at end of file diff --git a/template/default/ranklist/thread.htm b/template/default/ranklist/thread.htm new file mode 100644 index 0000000..0444367 --- /dev/null +++ b/template/default/ranklist/thread.htm @@ -0,0 +1,87 @@ + +
                            +
                            + $_G[setting][bbname] + {lang ranklist} + {lang ranklist_thread} +
                            +
                            + + + +
                            + +
                            +
                            +
                            +
                            +

                            {lang ranklist_thread}

                            + +

                            + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                            + +
                            + + + + + + + + + + + + + + + + + + + +
                             {lang thread}{lang forum}{lang author} + {lang ranklist_thread_view} + {lang ranklist_thread_share} + {lang ranklist_thread_favorite} + {lang ranklist_thread_heat} + {lang ranklist_thread_reply} +
                            $thread['rank']$thread['subject']$thread['forum'] + $thread['author'] + $thread['dateline'] + + $thread['views'] + $thread['sharetimes'] + $thread['favtimes'] + $thread['heats'] + $thread['replies'] +
                            +
                            + +
                            {lang none_data}
                            + +
                            {lang ranklist_update}
                            +
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/search/album.htm b/template/default/search/album.htm new file mode 100644 index 0000000..e7ade72 --- /dev/null +++ b/template/default/search/album.htm @@ -0,0 +1,18 @@ + +
                            +
                            + + + + + +
                            + + + + + +
                            + + + \ No newline at end of file diff --git a/template/default/search/album_list.htm b/template/default/search/album_list.htm new file mode 100644 index 0000000..be5eecc --- /dev/null +++ b/template/default/search/album_list.htm @@ -0,0 +1,21 @@ +
                            +
                            +

                            {lang search_result_keyword}{lang search_result}

                            +
                            + + +

                            {lang search_nomatch}

                            + +
                            + +
                            +
                            $multipage
                            + +
                            diff --git a/template/default/search/blog.htm b/template/default/search/blog.htm new file mode 100644 index 0000000..9da2544 --- /dev/null +++ b/template/default/search/blog.htm @@ -0,0 +1,17 @@ + +
                            +
                            + + + + + +
                            + + + + +
                            + + + \ No newline at end of file diff --git a/template/default/search/blog_list.htm b/template/default/search/blog_list.htm new file mode 100644 index 0000000..415709c --- /dev/null +++ b/template/default/search/blog_list.htm @@ -0,0 +1,27 @@ +
                            +
                            +

                            {lang search_result_keyword}{lang search_result}

                            +
                            + + +

                            {lang search_nomatch}

                            + +
                            +
                              + +
                            • +

                              $blog[subject]

                              +

                              $blog[replynum] {lang a_comment} - $blog[viewnum] {lang a_visit} - $blog[hot] {lang heat}

                              +

                              $blog[message]

                              +

                              + $blog[dateline] + - + $blog[username] +

                              +
                            • + +
                            +
                            + +
                            $multipage
                            +
                            \ No newline at end of file diff --git a/template/default/search/collection.htm b/template/default/search/collection.htm new file mode 100644 index 0000000..6ee6304 --- /dev/null +++ b/template/default/search/collection.htm @@ -0,0 +1,17 @@ + +
                            +
                            + + + + +
                            + + + + + +
                            + + + \ No newline at end of file diff --git a/template/default/search/collection_list.htm b/template/default/search/collection_list.htm new file mode 100644 index 0000000..e8726e4 --- /dev/null +++ b/template/default/search/collection_list.htm @@ -0,0 +1,20 @@ +
                            +
                            +

                            {lang search_result_keyword}{lang search_result}

                            +
                            + + +

                            {lang search_nomatch}

                            + +
                            + +
                            +
                            $value[name]
                            +
                            {lang threads}: $value[threadnum], {lang comment}: $value[commentnum], {lang subscribe}: $value[follownum], {lang lastupdate}: $value[lastupdate]
                            +
                            $value[desc] 
                            +
                            + +
                            +
                            $multipage
                            + +
                            diff --git a/template/default/search/footer.htm b/template/default/search/footer.htm new file mode 100644 index 0000000..08b0968 --- /dev/null +++ b/template/default/search/footer.htm @@ -0,0 +1,48 @@ + + + + +
                            +
                            +
                            + {lang close} +

                            {$_G['cache']['focus']['title']}{lang focus_hottopics}

                            +
                            +
                            +
                            +
                            $focus['subject']
                            + +
                            $focus['subject']
                            + +
                            $focus['summary']
                            +
                            +

                            {lang focus_show} »

                            +
                            +
                            +
                            + + + + + + + + +
                            + Powered by Discuz! $_G['setting']['version'] Licensed   + {lang copyright} + | + $nav[code]| + $_G['setting']['sitename'] + ( $_G['setting']['icp']|$_G['setting']['mps'] ) + + | $_G['setting']['statcode'] + +
                            + + + + + + \ No newline at end of file diff --git a/template/default/search/forum.htm b/template/default/search/forum.htm new file mode 100644 index 0000000..06696c4 --- /dev/null +++ b/template/default/search/forum.htm @@ -0,0 +1,26 @@ + +
                            +
                            +
                            + + + + + + + + $_G['setting']['extcredits'][$id][img] $_G['setting']['extcredits'][$id][title] $policy $_G['setting']['extcredits'][$id][unit] + + +

                            {lang search_credit_msg}

                            +
                            + + + + + +
                            +
                            + + + \ No newline at end of file diff --git a/template/default/search/forum_adv.htm b/template/default/search/forum_adv.htm new file mode 100644 index 0000000..7bdf60d --- /dev/null +++ b/template/default/search/forum_adv.htm @@ -0,0 +1,119 @@ + +
                            +
                            +
                            + + + + + + + $_G['setting']['extcredits'][$id][img] $_G['setting']['extcredits'][$id][title] $policy $_G['setting']['extcredits'][$id][unit] + + +

                            {lang search_credit_msg}

                            +
                            + +
                            +

                            {lang search_thread_higher}

                            +
                            +
                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            {lang keywords} + + +   $posttableselect + +
                            {lang author}
                            {lang search_thread_range} + + + +
                            {lang special_thread} + + + + + +
                            + + + +
                            + + + + +
                            + +
                            + + +
                            +
                            +
                            +
                            + +
                            +
                            + \ No newline at end of file diff --git a/template/default/search/group.htm b/template/default/search/group.htm new file mode 100644 index 0000000..ba8b642 --- /dev/null +++ b/template/default/search/group.htm @@ -0,0 +1,22 @@ + +
                            +
                            + + + + + +
                            + + + + + + + + + +
                            + + + \ No newline at end of file diff --git a/template/default/search/group_list.htm b/template/default/search/group_list.htm new file mode 100644 index 0000000..c3e2c7e --- /dev/null +++ b/template/default/search/group_list.htm @@ -0,0 +1,63 @@ +
                            +
                            +

                            {lang search_group_result_keyword} {lang search_group_viewgroup}{lang search_group_result}{lang search_result}

                            +
                            + + + +

                            {lang search_nomatch}

                            + +
                            + +
                            +
                            +
                            $group[name]({lang public})
                            +
                            {lang member}: $group[membernum], {lang threads}: $group[threads]
                            +
                            {lang credits}: $group[commoncredits], {lang creating_time}: $group[dateline]
                            +
                            + +
                            +
                            $multipage
                            + + + +
                            + +
                            +
                            +
                            $group[name]({lang public})
                            +
                            {lang member}: $group[membernum], {lang threads}: $group[threads]
                            +
                            {lang credits}: $group[commoncredits], {lang creating_time}: $group[dateline]
                            +
                            + +
                            + + +
                            + +
                            + +
                            $multipage
                            + +
                            \ No newline at end of file diff --git a/template/default/search/header.htm b/template/default/search/header.htm new file mode 100644 index 0000000..035fdca --- /dev/null +++ b/template/default/search/header.htm @@ -0,0 +1,59 @@ + + + + +
                            + + + + + $_G[setting][menunavs] + + + + + + \ No newline at end of file diff --git a/template/default/search/index.htm b/template/default/search/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/search/portal.htm b/template/default/search/portal.htm new file mode 100644 index 0000000..1eeaf73 --- /dev/null +++ b/template/default/search/portal.htm @@ -0,0 +1,17 @@ + +
                            +
                            + + + + + +
                            + + + + +
                            + + + \ No newline at end of file diff --git a/template/default/search/portal_list.htm b/template/default/search/portal_list.htm new file mode 100644 index 0000000..d784a4a --- /dev/null +++ b/template/default/search/portal_list.htm @@ -0,0 +1,27 @@ +
                            +
                            +

                            {lang search_result_keyword}{lang search_result}

                            +
                            + + +

                            {lang search_nomatch}

                            + +
                            +
                              + +
                            • +

                              $article[title]

                              +

                              $article[commentnum] {lang a_comment} - $article[viewnum] {lang a_visit}

                              +

                              $article[summary]

                              +

                              + $article[dateline] + - + $article[username] +

                              +
                            • + +
                            +
                            + +
                            $multipage
                            +
                            \ No newline at end of file diff --git a/template/default/search/pubsearch.htm b/template/default/search/pubsearch.htm new file mode 100644 index 0000000..f10c561 --- /dev/null +++ b/template/default/search/pubsearch.htm @@ -0,0 +1,83 @@ + + + + + + + +

                            {$_G['style']['searchlogo']}

                            + + + + + + +
                            +
                            + + + + + + + + + + + +
                            + + + {lang quick} + + {lang search_adv} + + + + {lang portal} + {lang thread} + {lang blog} + {lang album} + $_G['setting']['navs'][3]['navname'] + {lang collection} + + {lang user} +
                            + + + + + +
                            +
                            + + + + + \ No newline at end of file diff --git a/template/default/search/sortoption.htm b/template/default/search/sortoption.htm new file mode 100644 index 0000000..9737dd7 --- /dev/null +++ b/template/default/search/sortoption.htm @@ -0,0 +1,51 @@ + + + + + + + + $option[title] + + + + + + +    + + + + + + + + + + + + $value + + + + + $value + + + + + $option[unit] + + + + + diff --git a/template/default/search/thread_list.htm b/template/default/search/thread_list.htm new file mode 100644 index 0000000..47aa3fb --- /dev/null +++ b/template/default/search/thread_list.htm @@ -0,0 +1,52 @@ +
                            +
                            +

                            {lang search_result_keyword} {lang goto_memcp}{lang search_result}

                            +
                            + + +

                            {lang search_nomatch}

                            + +
                            + +
                            + + + + + +
                            + +
                            + +
                            $multipage
                            +
                            \ No newline at end of file diff --git a/template/default/style/index.htm b/template/default/style/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/style/t1/background.jpg b/template/default/style/t1/background.jpg new file mode 100644 index 0000000..0b26629 Binary files /dev/null and b/template/default/style/t1/background.jpg differ diff --git a/template/default/style/t1/bgimg.jpg b/template/default/style/t1/bgimg.jpg new file mode 100644 index 0000000..28a10da Binary files /dev/null and b/template/default/style/t1/bgimg.jpg differ diff --git a/template/default/style/t1/bgimg2x.jpg b/template/default/style/t1/bgimg2x.jpg new file mode 100644 index 0000000..791089a Binary files /dev/null and b/template/default/style/t1/bgimg2x.jpg differ diff --git a/template/default/style/t1/index.htm b/template/default/style/t1/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/style/t1/style.css b/template/default/style/t1/style.css new file mode 100644 index 0000000..7a1d1fb --- /dev/null +++ b/template/default/style/t1/style.css @@ -0,0 +1,80 @@ +/* +[name]红[/name] +[iconbgcolor]#BA350F[/iconbgcolor] +Powered by Discuz! X +*/ + +html { background: #FAF6ED url(background.jpg); } +::selection{ background-color: #BA350F; color: #FFF; } +:focus { outline-color: #C00; } +body { background: transparent url(bgimg.jpg) no-repeat 50% 0; background-size: 970px; } +@media(min-resolution:120dpi){ body { background-image: url(bgimg2x.jpg); }} +.fc-p { color: #C00; } +#nv { background-color: #C00; } + #nv li.a { background-color: #800; } + #nv li a:hover, #nv li.hover a:hover, #nv li.hover a { background-color: #600; } +#scbar { background-color: #FDF5F5; border-color: #FCC; } + #scbar_btn { background-color: #C00; } +#scform_srchtxt { border-color: #C00; } +#scform_tb .a::before { border-bottom-color: #C00; } +#scform_submit { background-color: #C00; } + +.bm_h, .tl th, .tl td { border-bottom-color: #CDCDCD; } +.fl .bm_h { border-color: #FCC; background: #FFECEC; } + +/* 重定义 {SPECIALBG} */ +.bmn, .bm_h, td.pls, .ad td.plc, div.exfm, .tb a, .tb_h, .ttp li.a a, div.uo a, input#addsubmit_btn, #gh .bm .bm_h { background-color: #FFECEC; } + +.ct2_a, .ct3_a { background-image: url(vlineb.jpg); } + .ct3_a .bm { background-color: transparent; } +.tbn li.a { background: #FAF6ED url(background.jpg); } + #nv_portal.pg_portalcp .ct2_a_r, #nv_forum.pg_post .ct2_a_r, #nv_group.pg_post .ct2_a_r { background-image: none; } + +/* 重定义 {SPECIALBORDER} */ +.bmn, .pg a, .pgb a, .pg strong, .card, .card .o, div.exfm { border-color: #FCC; } +.pg strong { background-color: #FCC; } +.pnc, .tb .o, .tb .o a { background-color: #C00; } + .pnc, a.pnc, .tb .o { border-color: #900; } + .pnc:active { background: #800; } + .pnc:focus { box-shadow: 0 0 0 2px rgba(136, 0, 0, 0.25); } + +.mi #moodfm.hover textarea { border-color: #FCC; } + +.ad td.pls { background-color: #FCC; } +.side_btn a svg { fill: #BA350F; } + +/* 重定义字体 */ +#qmenu, .fl .bm_h h2 a, .xi1, #um .new, .topnav .new, .sch .new, .el .ec .hot em, .pll .s a.joins, #diy_backup_tip .xi2 { color: #BA350F; } +.pll .s a.go { color: #FFF; } +.xi2, .xi2 a { color: #000; } + +/* 重定义按钮 */ +.pgsbtn { background-color: #C00; } + .pgsbtn:hover { background-color: #800; } + .pgsbtn:active { box-shadow: 0 0 0 3px rgba(136,0,0,0.25); } +.el .ec .hot, .clct_list .xld .m { background-image: linear-gradient(0deg,#FFB5AA 40%,#FFE7E2 40%); } +.pll .s { background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='60' height='89'%3e%3cpath fill='%23ffe7e2' d='M60 0v50c0 5.5-4.5 10-10 10H0V10C0 4.5 4.5 0 10 0z'/%3e%3cpath fill='%23ffb5aa' d='M60 65v19c0 2.75-2.25 5-5 5H0V70c0-2.75 2.25-5 5-5zM8 75l2.5 2.5L8 80h2l2.5-2.5L10 75z'/%3e%3c/svg%3e"); } + +/* 重定义 Tab */ +.tb .a a { border-bottom-color: #FAF6ED; background: url(background.jpg); } + +/* 重定义广播 */ +#uhd, #flw_header .bar { background-color: #FFF9F9; } + #uhd .tb a, #flw_header .bar { border-top-color: #FFE6E6; } + #uhd .tb .a a { border-bottom-color: #FAF6ED; } +.flw_replybox { background-color: #FFF9F9; } + .flw_replybox .px, .flw_autopt, #flw_header .tedt { border-color: #FCC; } +#flw_post_extra .sec { border-color: #FFE6E6; background-color: #FFF9F9; } + +/* 重定义版块快速跳转和侧边导航 */ +#fjump_menu li.a a { background-color: #FFF9F9; } +.bdl, .bdl dt, .bdl dd.bdl_a a { border-color: #FCC; background-color: #FFF9F9; } +.bdl dd.bdl_a a { color: #BA350F; } + +/* 重定义下拉菜单 */ +.p_pop a { border-bottom-color: #FFECEC; } + .p_pop a:hover, .p_pop a.a, #sctype_menu .sca { background-color: #FFECEC; color: #BA350F; } + .blk a:hover { background-color: transparent; } + +/* 重定义好友列表 */ +#nv_home .buddy li { background-color: transparent; border: none; } \ No newline at end of file diff --git a/template/default/style/t1/vlineb.jpg b/template/default/style/t1/vlineb.jpg new file mode 100644 index 0000000..38bd1fa Binary files /dev/null and b/template/default/style/t1/vlineb.jpg differ diff --git a/template/default/style/t2/bgimg.jpg b/template/default/style/t2/bgimg.jpg new file mode 100644 index 0000000..2060559 Binary files /dev/null and b/template/default/style/t2/bgimg.jpg differ diff --git a/template/default/style/t2/bgimg2x.jpg b/template/default/style/t2/bgimg2x.jpg new file mode 100644 index 0000000..97b2377 Binary files /dev/null and b/template/default/style/t2/bgimg2x.jpg differ diff --git a/template/default/style/t2/index.htm b/template/default/style/t2/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/style/t2/style.css b/template/default/style/t2/style.css new file mode 100644 index 0000000..04892ab --- /dev/null +++ b/template/default/style/t2/style.css @@ -0,0 +1,66 @@ +/* +[name]青[/name] +[iconbgcolor]#429296[/iconbgcolor] +Powered by Discuz! X +*/ + +::selection{ background-color: #429296; color: #FFF; } +:focus { outline-color: #429296; } +body { background: #FFF url(bgimg.jpg) no-repeat 50% 0; background-size: 1400px; } +@media(min-resolution:120dpi){ body { background-image: url(bgimg2x.jpg); }} +.fc-p { color: #429296; } +#nv,#scbar_btn { background-color: #429296; } + #nv li.a { background-color: #005D5D; } + #nv li a:hover, #nv li.hover a:hover, #nv li.hover a { background-color: #044; } +#scform_srchtxt { border-color: #429296; } +#scform_tb .a::before { border-bottom-color: #429296; } +#scform_submit { background-color: #429296; } + +.bm_h, .tl th, .tl td { border-bottom-color: #CDCDCD; } +.fl .bm_h { border-color: #C5E6DF; background: #EBF5F6; } + +/* 重定义 {SPECIALBG} */ +.bmn, .bm_h, td.pls, .ad td.plc, div.exfm, .tb a, .tb_h, .ttp li.a a, div.uo a, input#addsubmit_btn, #gh .bm .bm_h, .appnew, .apphot { background-color: #EBF5F6; } + +.ct2_a, .ct3_a { background-image: linear-gradient(0deg,#E8F6F3,#E8F6F3); } +.tbn li.a { background: #FFF; } + #nv_portal.pg_portalcp .ct2_a_r, #nv_forum.pg_post .ct2_a_r, #nv_group.pg_post .ct2_a_r { background-image: none; } + +/* 重定义 {SPECIALBORDER} */ +.bmn, .pg a, .pgb.a, .pg strong, .card, .card .o, div.exfm { border-color: #C5E6DF; } +.pg strong { background-color: #C5E6DF; } +.pnc, .tb .o, .tb .o a { background-color: #429296; } + .pnc, a.pnc, .tb .o { border-color: #066; } + .pnc:active { background: #005D5D; } + .pnc:focus { box-shadow: 0 0 0 2px rgba(0, 93, 93, 0.25); } + +.mi #moodfm.hover textarea { border-color: #C5E6DF; } + +.ad td.pls { background-color: #C5E6DF; } +.side_btn a svg { fill: #429296; } + +/* 重定义字体 */ +#qmenu, .fl .bm_h h2 a, .xi1, #um .new, .topnav .new, .sch .new, .el .ec .hot em, .pll .s a.joins { color: #429296; } +.pll .s a.go { color: #FFF; } +.xi2, .xi2 a { color: #000; } + +/* 重定义按钮 */ +.pgsbtn { background-color: #429296; } + .pgsbtn:hover { background-color: #005D5D; } + .pgsbtn:active { box-shadow: 0 0 0 3px rgba(0, 93, 93, 0.25); } +.el .ec .hot, .clct_list .xld .m { background-image: linear-gradient(0deg,#9AD1CF 40%,#CAE7E2 40%); }; } +.pll .s { background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='60' height='89'%3e%3cpath fill='%23cae7e2' d='M60 0v50c0 5.5-4.5 10-10 10H0V10C0 4.5 4.5 0 10 0z'/%3e%3cpath fill='%239ad1cf' d='M60 65v19c0 2.75-2.25 5-5 5H0V70c0-2.75 2.25-5 5-5zM8 75l2.5 2.5L8 80h2l2.5-2.5L10 75z'/%3e%3c/svg%3e"); } + +/* 重定义广播 */ +#uhd, #flw_header .bar, .flw_replybox { background-color: #F4F9F9; } +#flw_post_extra .sec { background-color: #F4F9F9; } + +/* 重定义版块快速跳转和侧边导航 */ +#fjump_menu li.a a { background-color: #EBF5F6; } +.bdl, .bdl dt, .bdl dd.bdl_a a { border-color: #C2D5E3; background-color: #EBF5F6; } +.bdl dd.bdl_a a { color: #429296; } + +/* 重定义下拉菜单 */ +.p_pop a { border-bottom-color: #EBF5F6; } + .p_pop a:hover, .p_pop a.a, #sctype_menu .sca { background-color: #EBF5F6; color: #429296; } + .blk a:hover { background-color: transparent; } \ No newline at end of file diff --git a/template/default/style/t3/bgimg.jpg b/template/default/style/t3/bgimg.jpg new file mode 100644 index 0000000..5b2db7d Binary files /dev/null and b/template/default/style/t3/bgimg.jpg differ diff --git a/template/default/style/t3/bgimg2x.jpg b/template/default/style/t3/bgimg2x.jpg new file mode 100644 index 0000000..b786834 Binary files /dev/null and b/template/default/style/t3/bgimg2x.jpg differ diff --git a/template/default/style/t3/index.htm b/template/default/style/t3/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/style/t3/style.css b/template/default/style/t3/style.css new file mode 100644 index 0000000..e57777b --- /dev/null +++ b/template/default/style/t3/style.css @@ -0,0 +1,80 @@ +/* +[name]橙[/name] +[iconbgcolor]#FE9500[/iconbgcolor] +Powered by Discuz! X +*/ + +::selection{ background-color: #FE9500; color: #FFF; } +:focus { outline-color: #FE9500; } +body { background: #FCFAF0 url(bgimg.jpg) no-repeat 50% 0; background-size: 1400px; } +@media(min-resolution:120dpi){ body { background-image: url(bgimg2x.jpg); }} +.fc-p { color: #FE9500; } +#nv { background-color: #FE9500; } + #nv li.a { background-color: #DF3200; } + #nv li a:hover, #nv li.hover a:hover, #nv li.hover a { background-color: #CA2D00; } + +#scbar { background-color: #FEFBF4; border-color: #FC6; } + #scbar_btn { background-color: #FE9500; } +#scform_srchtxt { border-color: #FE9500; } +#scform_tb .a::before { border-bottom-color: #FE9500; } +#scform_submit { background-color: #FE9500; } + +.bm_h, .tl th, .tl td { border-bottom-color: #CDCDCD; } +.fl .bm_h { border-color: #FC6; background: #FCF6E6; } + +/* 重定义 {SPECIALBG} */ +.bmn, .bm_h, td.pls, .ad td.plc, div.exfm, .tb a, .tb_h, .ttp li.a a, div.uo a, input#addsubmit_btn, #gh .bm .bm_h, .appnew, .apphot { background-color: #FCF6E6; } + +.ct2_a, .ct3_a { background-image: linear-gradient(0deg,#FBF6E7,#FBF6E7); } + .ct3_a .bm { background-color: transparent; } +.tbn li.a { background: #FCFAF0; } + #nv_portal.pg_portalcp .ct2_a_r, #nv_forum.pg_post .ct2_a_r, #nv_group.pg_post .ct2_a_r { background-image: none; } + +/* 重定义 {SPECIALBORDER} */ +.bmn, .pg a, .pgb a, .pg strong, .card, .card .o, div.exfm { border-color: #FC6; } +.pg strong { background-color: #FC6; } +.pnc, .tb .o, .tb .o a { background-color: #FE9500; } + .pnc, a.pnc, .tb .o { border-color: #C74900; } + .pnc:active { background: #DF3200; } + .pnc:focus { box-shadow: 0 0 0 2px rgba(223, 50, 0, 0.25); } + +.mi #moodfm.hover textarea { border-color: #FC6; } + +.ad td.pls { background-color: #FC6; } +.side_btn a svg { fill: #FE9500; } + +/* 重定义字体 */ +#qmenu, .fl .bm_h h2 a, .xi1, #um .new, .topnav .new, .sch .new, .el .ec .hot em, .pll .s a.joins, #diy_backup_tip .xi2 { color: #CA4312; } +.pll .s a.go { color: #FFF; } +.xi2, .xi2 a { color: #000; } + +/* 重定义按钮 */ +.pgsbtn { background-color: #FE9500; } + .pgsbtn:hover { background-color: #DF3200; } + .pgsbtn:active { box-shadow: 0 0 0 3px rgba(223, 50, 0, 0.25); } +.el .ec .hot, .clct_list .xld .m { background-image: linear-gradient(0deg,#FFD48D 40%,#FFE8BF 40%); } +.pll .s { background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='60' height='89'%3e%3cpath fill='%23ffe8bf' d='M60 0v50c0 5.5-4.5 10-10 10H0V10C0 4.5 4.5 0 10 0z'/%3e%3cpath fill='%23ffcd7d' d='M60 65v19c0 2.75-2.25 5-5 5H0V70c0-2.75 2.25-5 5-5z'/%3e%3cpath fill='%23fe8100' d='M8 75l2.5 2.5L8 80h2l2.5-2.5L10 75z'/%3e%3c/svg%3e"); } + +/* 重定义 Tab */ +.tb .a a { border-bottom-color: #FCFAF0; background: #FCFAF0; } + +/* 重定义广播 */ +#uhd, #flw_header .bar { background-color: #FEFCF8; } + #uhd .tb a, #flw_header .bar { border-top-color: #FCF0D7; } + #uhd .tb .a a { border-bottom-color: #FCFAF0; } +.flw_replybox { background-color: #FEFCF8; } + .flw_replybox .px, .flw_autopt, #flw_header .tedt { border-color: #FC6; } +#flw_post_extra .sec { border-color: #FCF0D7; background-color: #FEFCF8; } + +/* 重定义版块快速跳转和侧边导航 */ +#fjump_menu li.a a { background-color: #FCF6E6; } +.bdl, .bdl dt, .bdl dd.bdl_a a { border-color: #F5E3B4; background-color: #FCF6E6; } +.bdl dd.bdl_a a { color: #CA4312; } + +/* 重定义下拉菜单 */ +.p_pop a { border-bottom-color: #FCF6E6; } + .p_pop a:hover, .p_pop a.a, #sctype_menu .sca { background-color: #FCF6E6; color: #CA4312; } + .blk a:hover { background-color: transparent; } + +/* 重定义好友列表 */ +#nv_home .buddy li { background-color: transparent; border: none; } \ No newline at end of file diff --git a/template/default/style/t4/bgimg.jpg b/template/default/style/t4/bgimg.jpg new file mode 100644 index 0000000..f529b8a Binary files /dev/null and b/template/default/style/t4/bgimg.jpg differ diff --git a/template/default/style/t4/bgimg2x.jpg b/template/default/style/t4/bgimg2x.jpg new file mode 100644 index 0000000..c869d69 Binary files /dev/null and b/template/default/style/t4/bgimg2x.jpg differ diff --git a/template/default/style/t4/index.htm b/template/default/style/t4/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/style/t4/style.css b/template/default/style/t4/style.css new file mode 100644 index 0000000..4efd311 --- /dev/null +++ b/template/default/style/t4/style.css @@ -0,0 +1,66 @@ +/* +[name]紫[/name] +[iconbgcolor]#9934B7[/iconbgcolor] +Powered by Discuz! X +*/ + +body { background: #FFF url(bgimg.jpg) no-repeat 50% 28px; background-size: 1400px; } +@media(min-resolution:120dpi){ body { background-image: url(bgimg2x.jpg); }} +.fc-p { color: #9934B7; } +#nv { background-color: #9934B7; } + #nv li.a { background-color: #6C1992; } + #nv li a:hover, #nv li.hover a:hover, #nv li.hover a { background-color: #5C127D; } + #scbar_btn { background-color: #9934B7; } +#scform_srchtxt { border-color: #9934B7; } +#scform_tb .a::before { border-bottom-color: #9934B7; } +#scform_submit { background-color: #9934B7; } + +.bm_h, .tl th, .tl td { border-bottom-color: #CDCDCD; } +.fl .bm_h { border-color: #DFCDDE; background: #F8EFF8; } + +/* 重定义 {SPECIALBG} */ +.bmn, .bm_h, td.pls, .ad td.plc, div.exfm, .tb a, .tb_h, .ttp li.a a, div.uo a, input#addsubmit_btn, #gh .bm .bm_h { background-color: #F8EFF8; } + +.ct2_a, .ct3_a { background-image: linear-gradient(0deg,#D7F5FD,#D7F5FD); } +.tbn li.a { background: #FFF; } + #nv_portal.pg_portalcp .ct2_a_r, #nv_forum.pg_post .ct2_a_r, #nv_group.pg_post .ct2_a_r { background-image: none; } + +/* 重定义 {SPECIALBORDER} */ +.bmn, .pg a, .pgb a, .pg strong, .card, .card .o, div.exfm { border-color: #DFCDDE; } +.pg strong { background-color: #DFCDDE; } +.pnc, .tb .o, .tb .o a { background-color: #9934B7; } + .pnc, a.pnc, .tb .o { border-color: #609; } + .pnc:active { background: #6C1992; } + .pnc:focus { box-shadow: 0 0 0 2px rgba(108, 25, 146, 0.25); } + +.mi #moodfm.hover textarea { border-color: #DFCDDE; } + +.ad td.pls { background-color: #DFCDDE; } +.side_btn a svg { fill: #9934B7; } + +/* 重定义字体 */ +#qmenu, .fl .bm_h h2 a, .xi1, #um .new, .topnav .new, .sch .new, .el .ec .hot em, .pll .s a.joins, #diy_backup_tip .xi2 { color: #6F099E; } +.pll .s a.go { color: #FFF; } +.xi2, .xi2 a { color: #000; } + +/* 重定义按钮 */ +.pgsbtn { background-color: #9934B7; } + .pgsbtn:hover { background-color: #6C1992; } + .pgsbtn:active { box-shadow: 0 0 0 3px rgba(108, 25, 146, 0.25); } +.el .ec .hot, .clct_list .xld .m { background-image: linear-gradient(0deg,#CBA4D3 40%,#E6CEE5 40%); } +.pll .s { background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='60' height='89'%3e%3cpath fill='%23e6cee5' d='M60 0v50c0 5.5-4.5 10-10 10H0V10C0 4.5 4.5 0 10 0z'/%3e%3cpath fill='%23cba4d3' d='M60 65v19c0 2.75-2.25 5-5 5H0V70c0-2.75 2.25-5 5-5zM8 75l2.5 2.5L8 80h2l2.5-2.5L10 75z'/%3e%3c/svg%3e"); } + +/* 重定义广播 */ +#uhd, #flw_header .bar, .flw_replybox { background-color: #FCF9FC; } + #uhd .tb a, #flw_header .bar { border-top-color: #F8EFF8; } +#flw_post_extra .sec { border-color: #F8EFF8; background-color: #FCF9FC; } + +/* 重定义版块快速跳转和侧边导航 */ +#fjump_menu li.a a { background-color: #FCF8FC; } +.bdl, .bdl dt, .bdl dd.bdl_a a { border-color: #DFCDDE; background-color: #FCF8FC; } +.bdl dd.bdl_a a { color: #6F099E; } + +/* 重定义下拉菜单 */ +.p_pop a { border-bottom-color: #F8EFF8; } + .p_pop a:hover, .p_pop a.a, #sctype_menu .sca { background-color: #F8EFF8; color: #6F099E; } + .blk a:hover { background-color: transparent; } \ No newline at end of file diff --git a/template/default/style/t5/bgimg.jpg b/template/default/style/t5/bgimg.jpg new file mode 100644 index 0000000..5a756f6 Binary files /dev/null and b/template/default/style/t5/bgimg.jpg differ diff --git a/template/default/style/t5/index.htm b/template/default/style/t5/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/style/t5/style.css b/template/default/style/t5/style.css new file mode 100644 index 0000000..442e158 --- /dev/null +++ b/template/default/style/t5/style.css @@ -0,0 +1,10 @@ +/* +[name]蓝[/name] +[iconbgcolor]#0053B9[/iconbgcolor] +Powered by Discuz! X +*/ + +body { background: #FFF url(bgimg.jpg) no-repeat 50% 0; } + #nv li.a { background: #2B7ACD; } + #nv li.a a, #nv li.a a:hover { background: #FFF; color: #369 !important; border-radius: 4px 4px 0 0; box-shadow: inset 0px 2px 2px #114F90; } +.ct2_a, .ct3_a { background-color: #FFF; } \ No newline at end of file diff --git a/template/default/tag/index.htm b/template/default/tag/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/tag/tag.htm b/template/default/tag/tag.htm new file mode 100644 index 0000000..65b63fe --- /dev/null +++ b/template/default/tag/tag.htm @@ -0,0 +1,26 @@ + + +
                            +

                            {lang tag}

                            +
                            +
                            +
                            +   + +
                            +
                            + + + $tag[tagname] + + +

                            {lang no_tag}

                            + +
                            +
                            +
                            +
                            + +$num + + \ No newline at end of file diff --git a/template/default/tag/tagitem.htm b/template/default/tag/tagitem.htm new file mode 100644 index 0000000..b9f7dc4 --- /dev/null +++ b/template/default/tag/tagitem.htm @@ -0,0 +1,178 @@ + + +
                            +
                            + $_G[setting][bbname] + {lang tag} + + $tagname + + {lang related_thread} + + + {lang related_blog} + +
                            +
                            +
                            +

                            {lang tag}: $tagname

                            + +
                            +
                            + + + + + + + + +

                            {lang related_thread}

                            {lang forum}{lang author}{lang replies}{lang lastpost}
                            +
                            +
                            + + + + + + + + + + + + +
                            + + + + + + + + + + + + + + + + + + + + + $thread['subject'] + - [{lang readperm} $thread[readperm]] + + + - [{lang thread_reward} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][2]][title]}] + + - [{lang price} $thread[price] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]}] + + + - [{lang reward_solved}] + + + + + + + + {lang thread_digest}$thread[digest] + + $thread['forumname'] + + + $thread[author] + + {$_G['setting']['anonymoustext']} + + + $thread[dateline] + + $thread[replies] + $thread[views] + + $thread[lastposter]$_G[setting][anonymoustext] + $thread[lastpost] +
                            + + + +
                            $multipage
                            + + +

                            {lang no_content}

                            + +
                            +
                            + + + +
                            +
                            +

                            {lang related_blog}

                            +
                            +
                            + +
                            + +
                            +
                            +
                            +
                            +
                            + + {lang share} + + $blog['subject'] +
                            +
                            + {lang hot} $blog[hot] + $blog[username] $blog[dateline] +
                            +
                            +
                            $blog[subject]
                            + $blog[message] +
                            +
                            + {lang personal_category}: {$blog[classname]}| + $blog[viewnum] {lang blog_read}| + $blog[replynum] {lang blog_replay} +
                            +
                            + +
                            + + + +
                            $multipage
                            + + +

                            {lang no_content}

                            + +
                            +
                            + +
                            + +
                            +

                            {lang tag}: $searchtagname

                            +
                            +
                            +
                            +   + +
                            +

                            {lang empty_tags}

                            +
                            +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/common/buyinvitecode.htm b/template/default/touch/common/buyinvitecode.htm new file mode 100644 index 0000000..f7fbaf8 --- /dev/null +++ b/template/default/touch/common/buyinvitecode.htm @@ -0,0 +1,74 @@ + + + +
                            +
                            +

                            {lang invitecode_succeed_title}

                            +
                            +
                            +
                            + + +
                            +
                              +
                            • + +
                            • +
                            • {lang invitecode_email}
                            • +
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +

                            {lang invitecode_buycode}

                            +
                            +
                            + +
                            + + + +
                            +
                              + +
                            • + {$_G['setting'][inviteconfig][invitecodeprompt]} +
                            • + +
                            • + +
                            • +
                            • + +
                            • +
                            • {lang active_email_comment}
                            • +
                            • + {lang invitecode_expiration} + $maxinviteday +
                            • +
                            +
                            +
                            + +
                            +
                            + + + + \ No newline at end of file diff --git a/template/default/touch/common/footer.htm b/template/default/touch/common/footer.htm new file mode 100644 index 0000000..30f2b5b --- /dev/null +++ b/template/default/touch/common/footer.htm @@ -0,0 +1,64 @@ + + + + +
                            + + + + + + + + + + diff --git a/template/default/touch/common/footer_ajax.htm b/template/default/touch/common/footer_ajax.htm new file mode 100644 index 0000000..1a58407 --- /dev/null +++ b/template/default/touch/common/footer_ajax.htm @@ -0,0 +1 @@ +]]> \ No newline at end of file diff --git a/template/default/touch/common/header.htm b/template/default/touch/common/header.htm new file mode 100644 index 0000000..9f6e01f --- /dev/null +++ b/template/default/touch/common/header.htm @@ -0,0 +1,22 @@ + + + + + + + +<!--{if !empty($navtitle)}-->$navtitle - <!--{/if}--><!--{if empty($nobbname)}--> $_G['setting']['bbname'] - <!--{/if}--> {lang waptitle} - Powered by Discuz! + + +$_G['setting']['seohead'] + + + + + + + + + + +
                            diff --git a/template/default/touch/common/header_ajax.htm b/template/default/touch/common/header_ajax.htm new file mode 100644 index 0000000..0b57a07 --- /dev/null +++ b/template/default/touch/common/header_ajax.htm @@ -0,0 +1,10 @@ +{eval +ob_end_clean(); +ob_start(); +@header("Expires: -1"); +@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); +@header("Pragma: no-cache"); +@header("Content-type: text/xml; charset=".CHARSET); +echo ''."\r\n"; +} + +
                            +
                            +
                            +
                            +
                            +
                            +
                            + +
                            +
                            +
                            +
                            +
                            +

                            {lang login_mobile}

                            +

                            {lang login_mobile_join}

                            +

                            + +

                            +
                            +
                            +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/common/seccheck.htm b/template/default/touch/common/seccheck.htm new file mode 100644 index 0000000..f1c8e3d --- /dev/null +++ b/template/default/touch/common/seccheck.htm @@ -0,0 +1,68 @@ +{eval + $sechash = 'S'.random(4); + $sectpl = !empty($sectpl) ? explode("", $sectpl) : array('
                            ',': ','
                            ',''); +} + + + +
                          • + + +
                          • + + + +
                          • + + +
                          • + + \ No newline at end of file diff --git a/template/default/touch/common/showmessage.htm b/template/default/touch/common/showmessage.htm new file mode 100644 index 0000000..66aac3b --- /dev/null +++ b/template/default/touch/common/showmessage.htm @@ -0,0 +1,51 @@ + + + + + + + + + +
                            +
                            +

                            $show_message

                            + +

                            + {lang continue}
                            + {lang goback} +

                            + + + + +
                            + + +
                            + +
                            +
                            +

                            {lang mobtishi}

                            +
                            +
                            + + + diff --git a/template/default/touch/forum/activity_applylist.htm b/template/default/touch/forum/activity_applylist.htm new file mode 100644 index 0000000..76f891e --- /dev/null +++ b/template/default/touch/forum/activity_applylist.htm @@ -0,0 +1,92 @@ + +
                            +
                            +

                            {lang activity_applylist_manage}{lang activity_applylist}

                            + + + +
                              +
                            • +
                              +
                              {lang activity_join_members}
                              +
                              {lang activity_jointime}
                              +
                            • + +
                            • + +
                              + + + + + +
                              + + +
                              + $apply['dateline'] +
                              +
                            • +
                            • + +
                              + + + {lang activity_allow_join} + + {lang activity_do_replenish} + + {lang activity_cant_audit} + + +
                              + + +
                              + {lang activity_payment}: $apply['payment'] {lang payment_unit}{lang activity_self} +
                              + +
                            • + +
                            • +
                              {lang leaveword}: $apply['message']
                              +
                            • + +
                            • +
                              + + {lang extension_project} + + {lang extension_project}: {lang no_informations} + +
                              +
                            • +
                                $apply['ufielddata']
                              +
                              + +
                            + +
                              + +
                            +
                            + + +
                            +
                            + + +
                            + +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/activity_export.htm b/template/default/touch/forum/activity_export.htm new file mode 100644 index 0000000..522ffc8 --- /dev/null +++ b/template/default/touch/forum/activity_export.htm @@ -0,0 +1,24 @@ +$activity[class]: $thread[subject] + +{lang activity_starttime}: {lang activity_start_between}$activity[starttimefrom] + +{lang activity_space}: $activity[place] + + +{lang activity_payment}: $activity[cost] {lang payment_unit} + + +{lang gender}: {lang male}{lang female}{lang unlimited} + +{lang activity_totime}: $activity[expiration] + +{lang activity_already}: $applynumbers {lang activity_member_unit} + +{lang activity_content}: "$activity[message]" + +{lang activity_join_members},{lang leaveword},{lang activity_payment},{lang activity_jointime},{lang status}$ufield + + + $apply[username],$apply[message],$apply[payment] {lang payment_unit}{lang activity_self},$apply[dateline],{lang activity_allow_join}{lang activity_cant_audit}$apply[fielddata] + + \ No newline at end of file diff --git a/template/default/touch/forum/ajax_followpost.htm b/template/default/touch/forum/ajax_followpost.htm new file mode 100644 index 0000000..313c029 --- /dev/null +++ b/template/default/touch/forum/ajax_followpost.htm @@ -0,0 +1,47 @@ + + + + $post['message'] + +
                            + + +
                            +
                            + + +
                            + $feed['note'] +
                            + +
                            + + + + + + $post['author']:$post['message'] + + \ No newline at end of file diff --git a/template/default/touch/forum/ajax_quickreply.htm b/template/default/touch/forum/ajax_quickreply.htm new file mode 100644 index 0000000..141b122 --- /dev/null +++ b/template/default/touch/forum/ajax_quickreply.htm @@ -0,0 +1,67 @@ + + +
                            + + + +
                            +
                            +
                            + +
                            + + +
                            +
                            + + +
                            +
                            + +
                            + + +
                            + +
                            + +
                            +
                            +
                            +
                            + + + + \ No newline at end of file diff --git a/template/default/touch/forum/announcement.htm b/template/default/touch/forum/announcement.htm new file mode 100644 index 0000000..c4c0b45 --- /dev/null +++ b/template/default/touch/forum/announcement.htm @@ -0,0 +1,64 @@ + +
                            +
                            +

                            {lang announcement}

                            +
                            +
                            +
                            +
                            +
                            + +
                            +
                            +
                            +
                            + +
                            + + + diff --git a/template/default/touch/forum/attachpay.htm b/template/default/touch/forum/attachpay.htm new file mode 100644 index 0000000..2db7eff --- /dev/null +++ b/template/default/touch/forum/attachpay.htm @@ -0,0 +1,58 @@ + +
                            +

                            {lang pay_attachment}

                            +
                            + + + + +
                              +
                            • +
                              {lang author}
                              + +
                            • +
                            • +
                              {lang attachment}
                              +
                              $attach['filename'] ($attach['description'])
                              +
                            • +
                            • +
                              {lang price}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title']})
                              +
                              $attach['price'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit']}
                              +
                            • + +
                            • +
                              {lang pay_author_income}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title']})
                              +
                              $attach['netprice'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit']}
                              +
                            • +
                            • +
                              {lang pay_balance}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title']})
                              +
                              $balance {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit']}
                              +
                            • + + +
                            • +
                              +
                              {lang status_insufficient}
                              +
                            • + +
                            • +
                              +
                              {lang status_download}, {lang download}
                              +
                            • + + + + +
                            + +
                            +
                            + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/attachpay_view.htm b/template/default/touch/forum/attachpay_view.htm new file mode 100644 index 0000000..745b7bb --- /dev/null +++ b/template/default/touch/forum/attachpay_view.htm @@ -0,0 +1,23 @@ + +
                            +

                            {lang pay_view}

                            + +
                              +
                            • +
                              {lang username}
                              +
                              {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}
                              +
                              {lang time}
                              +
                            • + +
                            • + +
                              $log['dateline']
                              +
                              {$log[$extcreditname]} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit']}
                              +
                            • + +
                            + +
                            {lang attachment_buy_not}
                            + +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/collection_add.htm b/template/default/touch/forum/collection_add.htm new file mode 100644 index 0000000..be60954 --- /dev/null +++ b/template/default/touch/forum/collection_add.htm @@ -0,0 +1,69 @@ + +
                            +
                            +

                            + + {lang collection_edit} + + {lang collection_create} + +

                            +
                            +
                            + +
                            +
                            +

                            {lang collection_remain_tips}

                            +
                            +
                            + +
                            + + + + + +
                              +
                            • +
                              {lang collection_title}*
                              +
                              +
                            • +
                            • {lang collection_desc}
                            • +
                            • + +
                            • +
                              +
                              +

                              {lang collection_keywords_desc}

                              +
                              +
                              +
                            • +
                              {lang collection_keywords}
                              +
                              +
                            • +
                            +
                            + +
                            +
                            +
                            + + + +
                            \ No newline at end of file diff --git a/template/default/touch/forum/collection_all.htm b/template/default/touch/forum/collection_all.htm new file mode 100644 index 0000000..50244c9 --- /dev/null +++ b/template/default/touch/forum/collection_all.htm @@ -0,0 +1,20 @@ + +
                            +
                            +

                            + {lang collection} +

                            +
                            + + + + + +
                            +
                            + + + + +$multipage + \ No newline at end of file diff --git a/template/default/touch/forum/collection_comment.htm b/template/default/touch/forum/collection_comment.htm new file mode 100644 index 0000000..ccb754e --- /dev/null +++ b/template/default/touch/forum/collection_comment.htm @@ -0,0 +1,170 @@ + +
                            +
                            +

                            + {lang collection_commentlist} +

                            +
                            + +
                            +
                            + +
                            +
                            + + +
                            +

                            + + + + + + + + {$_G['collection']['name']} +

                            +

                            {lang collection_threadnum} {$_G['collection']['threadnum']}{lang collection_commentnum} {$_G['collection']['commentnum']}{lang collection_follow} {$_G['collection']['follownum']}

                            +

                            + + {$_G['collection']['desc']} + + + + + + + + + + {lang collection_norate} + + +

                            +
                            + + + + +
                            + + + + +
                            + +
                            +
                            +
                            + +
                            + $comment['message'] +
                            +
                            +
                            + +
                            + +
                            + + + +
                            +
                            +
                              +
                            • {lang collection_ratecollection}
                            • +
                            • + +
                            • + +
                            • + + + + + + + + + + +
                            • + +
                            • +
                              {lang collection_rated}
                              + + + + + + + +
                            • + +
                            +
                            + +
                            +
                            +
                            + + + \ No newline at end of file diff --git a/template/default/touch/forum/collection_followers.htm b/template/default/touch/forum/collection_followers.htm new file mode 100644 index 0000000..ed289e2 --- /dev/null +++ b/template/default/touch/forum/collection_followers.htm @@ -0,0 +1,86 @@ + +
                            +
                            +

                            + {lang collection_followlist} +

                            +
                            + +
                            +
                            + +
                            +
                            + + +
                            +

                            + + + + + + + + {$_G['collection']['name']} +

                            +

                            {lang collection_threadnum} {$_G['collection']['threadnum']}{lang collection_commentnum} {$_G['collection']['commentnum']}{lang collection_follow} {$_G['collection']['follownum']}

                            +

                            + + {$_G['collection']['desc']} + + + + + + + + + + {lang collection_norate} + + +

                            +
                            + + + + + +$multipage + + \ No newline at end of file diff --git a/template/default/touch/forum/collection_index.htm b/template/default/touch/forum/collection_index.htm new file mode 100644 index 0000000..50244c9 --- /dev/null +++ b/template/default/touch/forum/collection_index.htm @@ -0,0 +1,20 @@ + +
                            +
                            +

                            + {lang collection} +

                            +
                            + + + + + +
                            +
                            + + + + +$multipage + \ No newline at end of file diff --git a/template/default/touch/forum/collection_invite.htm b/template/default/touch/forum/collection_invite.htm new file mode 100644 index 0000000..7da31b8 --- /dev/null +++ b/template/default/touch/forum/collection_invite.htm @@ -0,0 +1,27 @@ + +
                            +
                            + + +
                              +
                              +
                              +

                              {lang collection_max_invite}

                              +
                              +
                              +
                            • +
                              {lang collection_username}*
                              +
                              +
                            • +
                            +
                            + +
                            +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/collection_list.htm b/template/default/touch/forum/collection_list.htm new file mode 100644 index 0000000..38b8e0b --- /dev/null +++ b/template/default/touch/forum/collection_list.htm @@ -0,0 +1,60 @@ + +
                            + +
                            + +
                            +

                            {lang collection_nocollection}

                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/collection_mycollection.htm b/template/default/touch/forum/collection_mycollection.htm new file mode 100644 index 0000000..b961275 --- /dev/null +++ b/template/default/touch/forum/collection_mycollection.htm @@ -0,0 +1,49 @@ + +
                            +
                            +

                            + {$_G[username]}{lang somebody_collection} +

                            +
                            + + + + + +
                            +
                            + + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/collection_nav.htm b/template/default/touch/forum/collection_nav.htm new file mode 100644 index 0000000..246d587 --- /dev/null +++ b/template/default/touch/forum/collection_nav.htm @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/template/default/touch/forum/collection_recommend.htm b/template/default/touch/forum/collection_recommend.htm new file mode 100644 index 0000000..2e3b094 --- /dev/null +++ b/template/default/touch/forum/collection_recommend.htm @@ -0,0 +1,23 @@ + +
                            +
                            + + + +
                              +
                            • +
                              {lang collection_recommend_thread_url}*
                              +
                              +
                            • +
                            +
                            + +
                            +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/collection_select.htm b/template/default/touch/forum/collection_select.htm new file mode 100644 index 0000000..bffc4cd --- /dev/null +++ b/template/default/touch/forum/collection_select.htm @@ -0,0 +1,42 @@ + +
                            +

                             {lang collection}

                            +
                            +
                              +
                            • 0 && count($allowcollections) <= 0}style="display:none;"{/if}> +
                              {lang collection_select}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang collection_select_nocollection}{lang collection_select_remain} {lang collection_create}
                              +
                            • +
                              + +
                              +
                            + + + + + + + + + + + +
                            + {lang collection_view_mine} + +
                            +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/collection_view.htm b/template/default/touch/forum/collection_view.htm new file mode 100644 index 0000000..ed342e1 --- /dev/null +++ b/template/default/touch/forum/collection_view.htm @@ -0,0 +1,120 @@ + +
                            +
                            +

                            + {lang all} +

                            +
                            + +
                            +
                            + +
                            +
                            + + +
                            +

                            + + + + + + + + {$_G['collection']['name']} +

                            +

                            {lang collection_threadnum} {$_G['collection']['threadnum']}{lang collection_commentnum} {$_G['collection']['commentnum']}{lang collection_follow} {$_G['collection']['follownum']}

                            + + {$_G['collection']['desc']} + + + + + + + + + + {lang collection_norate} + + +

                            +
                            + + + + + +
                            +
                            +
                              + + +
                            • +
                              + +
                              +

                              {$thread['author']}

                              + {$thread['dateline']} +
                              +
                              + +
                              + {$thread['subject']} +
                              +
                              +
                              + $thread[lastposter]{$_G['setting']['anonymoustext']} + $thread[lastpost] +
                              +
                              +
                                +
                              • {$thread['views']}
                              • +
                              • {$thread['replies']}
                              • +
                              +
                              +
                            • + + +

                              + + {lang collection_cloud_search} + + {lang no_content} + +

                              + +
                            +
                            +
                            + +
                            $multipage

                            + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/comment.htm b/template/default/touch/forum/comment.htm new file mode 100644 index 0000000..b285166 --- /dev/null +++ b/template/default/touch/forum/comment.htm @@ -0,0 +1,57 @@ + +
                            +
                            +

                             {lang comments}

                            + + + +
                              + + + + +
                            • +
                              $item
                              +
                              + + + + + + + +
                              + +
                            • + + + +
                            + +
                            + +
                            + +
                              + +
                            + + +
                            +
                            + + + \ No newline at end of file diff --git a/template/default/touch/forum/comment_more.htm b/template/default/touch/forum/comment_more.htm new file mode 100644 index 0000000..4a08330 --- /dev/null +++ b/template/default/touch/forum/comment_more.htm @@ -0,0 +1,31 @@ + + +

                            {lang comments}

                            +
                            $totalcomment
                            + +
                            +
                            $comment['avatar']
                            +
                            +
                              +
                            • + IP:$comment['useip']{if $comment['port']}:$comment['port']{/if} + + + $comment['author'] + + {lang guest} + + +
                            • +
                            • + {lang delete} + {lang poston} $comment['dateline'] +
                            • +
                            • $comment['comment']
                            • +
                            +
                            +
                            + + +
                            $multi
                            + \ No newline at end of file diff --git a/template/default/touch/forum/debate_umpire.htm b/template/default/touch/forum/debate_umpire.htm new file mode 100644 index 0000000..dc4f767 --- /dev/null +++ b/template/default/touch/forum/debate_umpire.htm @@ -0,0 +1,33 @@ + +
                            +
                            +

                            {lang debate_umpirecomment}

                            + +
                              +
                            • +
                              {lang debate_winner}
                              +
                              +
                              +
                              +
                            • +
                            • +
                              {lang debate_bestdebater}
                              +
                              + +
                              +
                            • +
                            • +
                              +
                            • +
                            +
                            + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/discuz.htm b/template/default/touch/forum/discuz.htm new file mode 100644 index 0000000..d9df30c --- /dev/null +++ b/template/default/touch/forum/discuz.htm @@ -0,0 +1,220 @@ + + + + + + + + + + +
                            +
                            +

                            {$_G['setting']['navs'][2]['navname']}

                            +
                            +
                            + + + +
                            + +
                            +
                            + + + + + + + +
                            +

                            {lang mobredian}{lang mobtuijian}

                            + + +
                            + + + + + + + + + + +
                            +
                            {lang announcements}
                            +
                              $announcements
                            +
                            + + + +
                            +
                              +
                            • $todayposts{lang index_today}
                            • +
                            • $postdata[0]{lang index_yesterday}
                            • +
                            • $posts{lang index_posts}
                            • +
                            • $_G['cache']['userstats']['totalmembers']{lang index_members}
                            • +
                            +
                            + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/discuzcode.htm b/template/default/touch/forum/discuzcode.htm new file mode 100644 index 0000000..60d098c --- /dev/null +++ b/template/default/touch/forum/discuzcode.htm @@ -0,0 +1,163 @@ +{eval +function tpl_hide_credits_hidden($creditsrequire) { +global $_G; +} +
                            {$_G['username']}{lang guest}{lang post_hide_credits_hidden}
                            + +{eval +} + +function tpl_hide_credits($creditsrequire, $message) { +} +
                            {lang post_hide_credits}
                            +$message

                            + + +{eval +} + +function tpl_codedisp($code) { + $randomid = 'code_'.random(3); +} +
                            1. $code
                            {lang discuzcode_copyclipboard}
                            + +{eval +} + +function tpl_quote() { +} +
                            \\1
                            + +{eval +} + +function tpl_free() { +} +
                            \\1
                            + +{eval +} + +function tpl_hide_reply() { +global $_G; +} +

                            {lang post_hide}

                            \\1
                            + + +{eval +} + +function tpl_hide_reply_hidden() { +global $_G; +} +
                            {$_G['username']}{lang guest}{lang post_hide_reply_hidden}
                            + +{eval +} + +function attachlist($attach) { +global $_G; +$attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp'))); +$aidencode = packaids($attach); +$is_archive = $_G['forum_thread']['is_archived'] ? "&fid=".$_G['fid']."&archiveid=".$_G['forum_thread']['archiveid'] : ''; +$pluginhook = !empty($_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach['aid']]) ? $_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach['aid']] : ''; +} + +
                          • + + + +

                            {$attach['description']}

                            + $pluginhook +
                          • + + +{eval +} + +function imagelist($attach, $firstpost = 0) { +global $_G, $post; +$fix = count($post['imagelist']) == 1 ? 1000 : 1500; +$fixtype = count($post['imagelist']) == 1 ? 'fixnone' : 'fixwr'; +$attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp'))); +$mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, $fix, 99999, 1) : '' ; +$aidencode = packaids($attach); +$is_archive = $_G['forum_thread']['is_archived'] ? "&fid=".$_G['fid']."&archiveid=".$_G['forum_thread']['archiveid'] : ''; +$pluginhook = !empty($_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach['aid']]) ? $_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach['aid']] : ''; +$guestviewthumb = !empty($_G['setting']['guestviewthumb']['flag']) && !$_G['uid']; +$mobileguestviewthumburl = $guestviewthumb ? ($attach['attachimg'] && $_G['setting']['showimages'] && (((!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid'])) || ($guestviewthumb)) ? getforumimg($attach['aid'], 0, $_G['setting']['guestviewthumb']['width'], $_G['setting']['guestviewthumb']['height'], 1) : '') : ''; +} + + + +
                          • $attach['imgalt'] + $pluginhook +
                          • + + + + +{eval +} + +function attachinpost($attach, $post) { +global $_G; +$attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp'))); +$mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 200, 200, 'fixnone') : '' ; +$aidencode = packaids($attach); +$is_archive = $_G['forum_thread']['is_archived'] ? '&fid='.$_G['fid'].'&archiveid='.$_G['forum_thread']['archiveid'] : ''; +$guestviewthumb = !empty($_G['setting']['guestviewthumb']['flag']) && !$_G['uid']; +$mobileguestviewthumburl = $guestviewthumb ? ($attach['attachimg'] && $_G['setting']['showimages'] && (((!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid'])) || ($guestviewthumb)) ? getforumimg($attach['aid'], 0, $_G['setting']['guestviewthumb']['width'], $_G['setting']['guestviewthumb']['height'], 1) : '') : ''; +} + + + + $attach['imgalt'] + + + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/find.htm b/template/default/touch/forum/find.htm new file mode 100644 index 0000000..f5b0523 --- /dev/null +++ b/template/default/touch/forum/find.htm @@ -0,0 +1,15 @@ +
                            +
                            +

                            {lang mobfind}

                            +
                            +
                            +
                            + +
                            \ No newline at end of file diff --git a/template/default/touch/forum/forumdisplay.htm b/template/default/touch/forum/forumdisplay.htm new file mode 100644 index 0000000..ca2b064 --- /dev/null +++ b/template/default/touch/forum/forumdisplay.htm @@ -0,0 +1,190 @@ + +
                            +
                            +

                            +
                            +
                            + +
                            +

                            + $_G['forum']['name'] + + {lang favorite} + + $_G['forum']['name'] +

                            +

                            {lang index_today}: $_G['forum']['todayposts']{lang index_threads}: $_G['forum']['threads']{lang rank}: $_G['forum']['rank']

                            + +
                            + + + +
                            +
                            +
                            + +
                            +
                            +
                            + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/forumdisplay_fastpost.htm b/template/default/touch/forum/forumdisplay_fastpost.htm new file mode 100644 index 0000000..afb12bc --- /dev/null +++ b/template/default/touch/forum/forumdisplay_fastpost.htm @@ -0,0 +1,115 @@ +
                            +
                            +
                            + + +
                            +
                              + +
                            • + +
                            • + +
                            • + +
                            +
                            +
                            +
                            + diff --git a/template/default/touch/forum/forumdisplay_passwd.htm b/template/default/touch/forum/forumdisplay_passwd.htm new file mode 100644 index 0000000..0f37d10 --- /dev/null +++ b/template/default/touch/forum/forumdisplay_passwd.htm @@ -0,0 +1,19 @@ + +
                            +
                            +

                            +
                            +
                            +
                            +
                            + + + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/forumdisplay_subforum.htm b/template/default/touch/forum/forumdisplay_subforum.htm new file mode 100644 index 0000000..e408e4f --- /dev/null +++ b/template/default/touch/forum/forumdisplay_subforum.htm @@ -0,0 +1,17 @@ +
                            + +
                            + +
                            +
                            \ No newline at end of file diff --git a/template/default/touch/forum/guide.htm b/template/default/touch/forum/guide.htm new file mode 100644 index 0000000..656559d --- /dev/null +++ b/template/default/touch/forum/guide.htm @@ -0,0 +1,34 @@ + + + +
                            +

                            +
                            + + +
                            + + + +
                            +

                            +
                            + + + + + + + +$multipage + \ No newline at end of file diff --git a/template/default/touch/forum/guide_list_row.htm b/template/default/touch/forum/guide_list_row.htm new file mode 100644 index 0000000..f5c105e --- /dev/null +++ b/template/default/touch/forum/guide_list_row.htm @@ -0,0 +1,72 @@ + + + + +
                            +

                            {lang guide_nothreads}

                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/index.htm b/template/default/touch/forum/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/touch/forum/modcp.htm b/template/default/touch/forum/modcp.htm new file mode 100644 index 0000000..148f576 --- /dev/null +++ b/template/default/touch/forum/modcp.htm @@ -0,0 +1,18 @@ + + +
                            +

                            {lang mod_option_error}

                            +

                            {lang mod_error_invalid}

                            +

                            {lang mod_notice}

                            +
                            + + + + +
                            + {lang admin_threadtopicadmin_error} +
                            + + + + diff --git a/template/default/touch/forum/modcp_login.htm b/template/default/touch/forum/modcp_login.htm new file mode 100644 index 0000000..7ea27aa --- /dev/null +++ b/template/default/touch/forum/modcp_login.htm @@ -0,0 +1,14 @@ +

                            {lang panel_login}

                            +

                            {lang panel_notice_login}

                            +
                            + + + + + +

                            {lang panel_login_username}: {$_G['member']['username']}

                            + +

                            {lang panel_login_password}:

                            + +

                            +
                            diff --git a/template/default/touch/forum/modcp_member.htm b/template/default/touch/forum/modcp_member.htm new file mode 100644 index 0000000..5f3d8ab --- /dev/null +++ b/template/default/touch/forum/modcp_member.htm @@ -0,0 +1,67 @@ + +
                            + + +
                            + + + +
                            +
                            {lang result}
                            +

                            $member['username'] UID: $member['uid']
                            {lang modcp_members_status_banpost}{lang modcp_members_status_banvisit}{lang modcp_members_status_normal} ( {lang valid_before} $member['banexpiry'] )

                            +

                            {lang changeto} + + + +

                            +

                            {lang expiry}

                            +

                            + + +

                            +

                            {lang modcp_members_ban_days_comment}

                            +

                            {lang reason}

                            +

                            +

                            +
                            +
                            + + +
                            + + {lang mod_member_ban} +
                            +

                            + + + {lang mod_message_member_search} + + {lang mod_message_member_nonexistence} + + {lang mod_message_member_nopermission} +
                            {lang mod_message_goto_admincp} + + + +

                            +

                            + {lang username} + +

                            +

                            + UID + +

                            +

                            + +

                            +
                            +
                            + +
                            + +
                            +

                            {lang admin_threadtopicadmin_error}

                            + +
                            + diff --git a/template/default/touch/forum/pay.htm b/template/default/touch/forum/pay.htm new file mode 100644 index 0000000..a2267cc --- /dev/null +++ b/template/default/touch/forum/pay.htm @@ -0,0 +1,41 @@ + +
                            + +
                            + +
                            +
                            + + + + + +
                            + + + + + + + + + + + + + + + + + +
                            {lang author}$thread['author']$thread['author']
                            {lang price}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$thread[price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
                            {lang pay_author_income}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$thread[netprice] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
                            {lang pay_balance}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]})$balance {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}
                            +
                            +
                            + +
                            +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/post.htm b/template/default/touch/forum/post.htm new file mode 100644 index 0000000..3592f7b --- /dev/null +++ b/template/default/touch/forum/post.htm @@ -0,0 +1,504 @@ + + +
                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            +
                            +

                            {lang edit}{lang send_threads}

                            +
                            +
                            + + + + +
                            + +
                              + + + +
                            • + +
                            • + RE: $thread['subject'] + $quotemessage +
                            • + + +
                            • + +
                            • + +
                            + +
                              +
                            • + + +
                              +
                                + +
                              • + +
                              +
                              +
                              +
                                + +
                              • + + + {lang forum_post_insert}{lang e_audio} + + {lang forum_post_insert}{lang e_video} + + + {lang forum_post_insert}{$temp['filetype']}{$temp['filename']}
                                {lang description}
                                + + +
                                {lang forum_post_perm} +
                                + +
                                +
                                + + +
                                {lang price}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}
                              • + +
                              +
                              +
                            • + + + + + +
                            + +
                              + +
                            + + +
                            +
                            + +
                            + + +
                            + + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/post_activity.htm b/template/default/touch/forum/post_activity.htm new file mode 100644 index 0000000..971663a --- /dev/null +++ b/template/default/touch/forum/post_activity.htm @@ -0,0 +1,189 @@ +
                            +
                              +
                            • +
                              {lang post_event_time}
                              +
                              +
                            • +
                            • +
                              {lang post_event_time}
                              +
                              +
                              ~
                              +
                              +
                            • +
                            • {lang admin_close_expire_comment}
                            • + +
                            • +
                              {lang activity_space}
                              +
                              +
                            • + + + + +
                            • +
                              {lang activity_need_member}
                              +
                              +
                              + +
                              +
                            • + +
                              +
                            • {lang optional_data}
                            • +
                            +
                              + +
                            • + +
                            • + +
                            +
                              + + +
                              +
                            • {lang other_data}
                            • +
                            • +
                            • {lang post_activity_message} $_G['setting']['activityextnum'] {lang post_option}
                            • +
                              + + +
                            • +
                              {lang consumption_credit}
                              +
                              +
                              {$_G['setting']['extcredits'][$_G['setting']['activitycredit']][title]}
                              +
                            • +
                            • {lang user_consumption_money}
                            • + +
                            • +
                              {lang activity_payment}
                              +
                              +
                              {lang payment_unit}
                              +
                            • +
                            • +
                              {lang post_closing}
                              +
                              +
                            • +
                            • {lang admin_close_expire_comment}
                            • + +
                            • +
                              + + {lang post_topic_image} +
                              + +
                            • +
                            • {lang post_click_message_1}{lang post_click_message_2}
                            • + + + + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/post_debate.htm b/template/default/touch/forum/post_debate.htm new file mode 100644 index 0000000..b9258ae --- /dev/null +++ b/template/default/touch/forum/post_debate.htm @@ -0,0 +1,51 @@ +
                            +
                              + +
                            • {lang admin_close_expire_comment}
                            • + +
                              +
                            • {lang debate_square_point}
                            • +
                            • +
                              +
                            • {lang debate_opponent_point}
                            • +
                            • + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/post_editor_attribute.htm b/template/default/touch/forum/post_editor_attribute.htm new file mode 100644 index 0000000..25a18cd --- /dev/null +++ b/template/default/touch/forum/post_editor_attribute.htm @@ -0,0 +1,299 @@ +
                            +
                          • + +
                          • + +
                            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/post_editor_extra.htm b/template/default/touch/forum/post_editor_extra.htm new file mode 100644 index 0000000..da45555 --- /dev/null +++ b/template/default/touch/forum/post_editor_extra.htm @@ -0,0 +1,29 @@ + + + + +
                              +
                            • + +
                            • +
                            + + + +
                            + +
                            + + + + + + +
                            $threadplughtml
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/post_forumselect.htm b/template/default/touch/forum/post_forumselect.htm new file mode 100644 index 0000000..3c996de --- /dev/null +++ b/template/default/touch/forum/post_forumselect.htm @@ -0,0 +1,98 @@ + +
                            +
                            +

                            {lang send_posts}

                            +
                            +
                            +
                            +
                              $grouplist
                            +
                              $commonlist
                            + +
                              $forum
                            + + +
                              $forum
                            + +
                            +
                            +
                              +
                            • +
                            • +
                            • +
                            +
                            + +
                            + +
                            + + + \ No newline at end of file diff --git a/template/default/touch/forum/post_poll.htm b/template/default/touch/forum/post_poll.htm new file mode 100644 index 0000000..85b487d --- /dev/null +++ b/template/default/touch/forum/post_poll.htm @@ -0,0 +1,107 @@ + + +
                            +
                              + + + + + + + +
                            • +
                              {lang post_poll_options}: {lang post_poll_comment}
                              +
                            • + + + +
                            • +{lang post_poll_add}
                            • + +
                            • +
                              {lang displayorder}
                              +
                              {lang post_poll_options}
                              +
                            • + + + +
                            • +
                              +
                              +
                              + + + + + + +
                              +
                            • + + + +
                            • +{lang post_poll_add}
                            • + + +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/post_reward.htm b/template/default/touch/forum/post_reward.htm new file mode 100644 index 0000000..d33b6b4 --- /dev/null +++ b/template/default/touch/forum/post_reward.htm @@ -0,0 +1,91 @@ +
                            +
                              + + +
                            • +
                              {lang reward_tax_after} 0 {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]}
                              +
                            • +
                            • +
                              + {lang reward_price_min} {$_G['group']['minrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang reward_price_max} {$_G['group']['maxrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang you_have} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} +
                              +
                            • + + + + +
                            • +
                              {lang reward_tax_add} 0 {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]}
                              +
                            • +
                            • +
                              {lang reward_price_min} {$_G['group']['minrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang reward_price_max} {$_G['group']['maxrewardprice']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]} + , {lang you_have} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]}
                              +
                            • + +
                            • {lang post_reward_resolved}
                            • + + + + + {lang reward_price}: $rewardprice {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]][title]} + + {lang post_reward_resolved} + + + + +
                            • +
                              $_G['setting']['rewardexpiration'] {lang post_reward_message}
                              +
                            • + + +
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/post_sortoption.htm b/template/default/touch/forum/post_sortoption.htm new file mode 100644 index 0000000..d472d3f --- /dev/null +++ b/template/default/touch/forum/post_sortoption.htm @@ -0,0 +1,472 @@ + + + + + + +
                              + +
                            • +
                              {lang threadtype_description}
                              +
                              $_G['forum']['threadsorts']['description'][$_G['forum_selectsortid']]
                              +
                            • + + +
                            • +
                              {lang threadtype_expiration}
                              +
                              + +
                              +
                            • +
                            • {lang valid_before}: $_G['forum_optiondata']['expiration']
                            • + +
                            + + $_G['forum_typetemplate'] + +
                              + +
                            • +
                              {lang threadtype_description}
                              +
                              $_G['forum']['threadsorts']['description'][$_G['forum_selectsortid']]
                              +
                            • + + +
                            • +
                              {lang threadtype_expiration}
                              +
                              + +
                              +
                            • +
                            • {lang valid_before}: $_G['forum_optiondata']['expiration']
                            • + + + +
                            • +
                              $option['title']
                              +
                              + + + + + +
                              +
                              + + + + + + + + + + + + + + + + + + + + + + + +
                                + +
                              • + +
                              + +
                                + +
                              • + +
                              + + + + +
                              +
                              $option['unit']
                              +
                            • +
                            • + +
                            • + + {lang maxnum} $option[maxnum] + + + {lang minnum} $option[minnum] + + + {lang maxlength} $option[maxlength] + + + {lang unchangeable} + + + $option[description] + +
                            • + +
                            • {lang admin_close_expire_comment}
                            • + +
                            +
                            + + + diff --git a/template/default/touch/forum/post_trade.htm b/template/default/touch/forum/post_trade.htm new file mode 100644 index 0000000..be26f49 --- /dev/null +++ b/template/default/touch/forum/post_trade.htm @@ -0,0 +1,167 @@ + + +
                            +
                              +
                            • {lang post_message1}
                            • +
                            • +
                              {lang post_trade_name}
                              +
                              +
                            • +
                            • +
                              {lang post_trade_number}
                              +
                              +
                            • +
                            • +
                              + +
                              +
                            • + +
                            • +
                              {lang post_trade_price}
                              +
                              +
                            • +
                            • +
                              +
                              +
                            • + +
                            • +
                              +
                              +
                            • +
                            • +
                              +
                              +
                            • +
                            • +
                              +
                              +
                              +
                            • + +
                            • +
                              {lang post_trade_paymethod}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang post_trade_tenpay_seller}
                              +
                              +
                            • +
                            • +
                              {lang post_trade_locus}
                              +
                              +
                            • +
                            • +
                              {lang valid_before}
                              +
                              +
                            • +
                            • {lang threadsort_calendar}
                            • + +
                            • +
                              + + {lang post_trade_picture} +
                              + +
                            • + + + + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/rate.htm b/template/default/touch/forum/rate.htm new file mode 100644 index 0000000..6465627 --- /dev/null +++ b/template/default/touch/forum/rate.htm @@ -0,0 +1,121 @@ + + + +
                            +
                            + + + + + +

                             {lang rate}

                            +
                              + + +
                            • +
                              {$_G['setting']['extcredits'][$id]['img']} {$_G['setting']['extcredits'][$id]['title']}
                              +
                              +
                              + +
                              +
                            • + +
                            • +
                              {lang reason}
                              +
                              +
                              + +
                              +
                            • + +
                            + + +
                            +
                            + +
                            +
                            + + + + + +

                             {lang thread_removerate}

                            +
                              +
                            • +
                               
                              +
                              {lang username}
                              +
                              {lang credits}
                              +
                              {lang time}
                              +
                            • + +
                            • +
                              + +
                              {$_G['setting']['extcredits'][$ratelog['extcredits']]['title']} $ratelog['scoreview'] {$_G['setting']['extcredits'][$ratelog[extcredits]][unit]}
                              +
                              $ratelog['dateline']
                              +
                            • + +
                            • +
                              $ratelog['reason']
                              +
                            • + + +
                            +
                              +
                            • +
                              + +
                              +
                            • + +
                            + +
                            +
                            + + +
                            +

                             {lang board_message}

                            +
                            +

                            {lang push_succeed}

                            +

                            + {lang click_here} {lang rate_thread} +

                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/rate_view.htm b/template/default/touch/forum/rate_view.htm new file mode 100644 index 0000000..518dfd1 --- /dev/null +++ b/template/default/touch/forum/rate_view.htm @@ -0,0 +1,31 @@ + +
                            +

                             {lang rate_view}

                            +
                              +
                            • +
                              {lang credits}
                              +
                              {lang username}
                              +
                              {lang time}
                              +
                            • + +
                            • +
                              {$_G['setting']['extcredits'][$log['extcredits']]['title']} $log['score'] {$_G['setting']['extcredits'][$log['extcredits']]['unit']}
                              +
                              {$log['username']}
                              +
                              {$log['dateline']}
                              +
                            • + +
                            • +
                              {$log['reason']}
                              +
                            • + + +
                            + +
                            + {lang total}: + +  {$_G['setting']['extcredits'][$id][title]} +$count {$_G['setting']['extcredits'][$id][unit]}   + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/topicadmin.htm b/template/default/touch/forum/topicadmin.htm new file mode 100644 index 0000000..3d1fff2 --- /dev/null +++ b/template/default/touch/forum/topicadmin.htm @@ -0,0 +1,405 @@ + +
                            + +
                            + + + + + + + + + + + + + + +

                            {lang modmenu_stickthread}

                            +
                            +

                            +

                            {lang admin_close_expire_comment}

                            +
                            +
                              +
                            • +
                              {lang modmenu_stickthread}
                              +
                              + +
                              +
                            • + +
                            + +
                            {lang mod_error_invalid}
                            + + + +

                            {lang modmenu_digestpost}

                            +
                            +

                            +

                            {lang admin_close_expire_comment}

                            +
                            +
                              +
                            • +
                              {lang modmenu_digestpost}
                              +
                              + +
                              +
                            • + +
                            + +
                            {lang mod_error_invalid}
                            + + + + +

                            {lang modmenu_highlight}

                            +
                            +

                            +

                            {lang admin_close_expire_comment}

                            +
                            +
                              +
                            • + + + +
                              + B + I + U +
                              +
                              + +
                              +
                            • + +
                            + +
                            {lang mod_error_invalid}
                            + + + + + +

                            {lang modmenu_recommend}

                            +
                            +

                            +

                            {lang admin_close_expire_comment}

                            +
                            +
                              + + +
                            + + +
                              +
                            • +
                              {lang forum_recommend_reducetitle}
                              +
                              +
                            • + +
                            • +
                              {lang forum_recommend_image}
                              +
                              + +
                              +
                              +
                            • + + +
                            + +
                            + + + + + +

                            {lang modmenu_move}

                            +
                              +
                            • +
                              {lang admin_target}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang admin_targettype}
                              +
                              + +
                              +
                            • +
                            + +
                            + + + +
                              +
                            • +
                              {lang types}
                              +
                              $typeselect
                              +
                            • +
                            +
                            + +
                            {lang admin_type_msg}
                            + + + + + +

                            {lang admin_delthread_confirm}

                            + +
                              + + +
                            +
                            + +
                            {lang admin_delthread_nopermission}
                            + + +

                            {lang modmenu_updown}

                            +
                            +

                            +

                            {lang admin_close_expire_comment}

                            +
                            +
                              + + + +
                            + + +
                            +

                            +

                            {lang admin_close_expire_comment}

                            +
                            +
                              + + +
                            +
                            + + +

                            {lang modmenu_grouprecommend}

                            + +
                              +
                            • +
                              {lang admin_target}
                              +
                              + +
                              +
                            • +
                            +
                            + + +
                            {lang cancel}
                            +
                            + +
                            {lang admin_threadtopicadmin_error}
                            +
                            + +
                            + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/topicadmin_action.htm b/template/default/touch/forum/topicadmin_action.htm new file mode 100644 index 0000000..1a354f4 --- /dev/null +++ b/template/default/touch/forum/topicadmin_action.htm @@ -0,0 +1,267 @@ + +
                            + +
                            + + + + + + +

                            {lang delete}

                            +
                            +

                            {lang admin_delpost_confirm}

                            + $deleteid +
                            + +

                            {lang delete}

                            +
                            +

                            {lang topicadmin_delet_comment}

                            + $deleteid +
                            + +

                            {lang modmenu_restore}

                            +
                            + +

                            {lang admin_threadsplit_restore}

                            +
                            + +

                            {lang modmenu_copy}

                            +
                              +
                            • +
                              {lang admin_target}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang admin_targettype}
                              +
                              + +
                              +
                            • +
                            + +

                            {lang admin_banpost}

                            +
                            +

                            {lang admin_banpost_confirm}

                            + $banid +
                            +
                              + + +
                            + +
                            + {lang topicadmin_crime_banpost_nums} +
                            + + +

                            {lang topicadmin_warn_add}

                            +
                            +

                            {lang admin_warn_confirm}

                            + $warnpid +
                            +
                              + + +
                            + +
                            {lang topicadmin_warn_nums}
                            + + +

                            {lang admin_merge}

                            +
                              +
                            • +
                              {lang admin_merge}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang admin_merge_tid}
                              +
                            • +
                            + +

                            {lang modmenu_restore}

                            +
                              +
                            • +
                              {lang pay_buyers}
                              +
                              + $payment['payers'] +
                              +
                            • +
                            • +
                              {lang pay_author_income}
                              +
                              + $payment['income'] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][1]][title]} +
                              +
                            • +
                            + +

                            {lang modmenu_split}

                            +
                              +
                            • +
                              + +
                              +
                            • +
                            • +
                              {lang admin_split_comment}
                              +
                            • +
                            +
                            + +
                            + +

                            {lang modmenu_live}

                            +
                              + + +
                            +
                            + {lang admin_live_tips} +
                            + +

                            {lang admin_stamp_select}

                            +
                              +
                            • +
                              + +
                              +
                            • +
                            + + +

                            {lang admin_stamplist_select}

                            +
                              +
                            • +
                              + +
                              +
                              +
                            • +
                            + + +

                            {lang modmenu_stickpost}

                            +
                            + $stickpid +
                            +
                              + + +
                            + +
                            {lang cancel}
                            +
                            + +
                            {lang admin_threadtopicadmin_error}
                            +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/trade.htm b/template/default/touch/forum/trade.htm new file mode 100644 index 0000000..7e82cd9 --- /dev/null +++ b/template/default/touch/forum/trade.htm @@ -0,0 +1,186 @@ + + + +
                            +
                            +
                            {lang trade_confirm_buy}
                            +
                            +
                            + +
                            +
                            +
                            + + + +
                            + +
                            +
                            $trade['subject']
                            +
                            + +

                            ¥ $trade['price']

                            + + +

                            {lang trade_additional} $trade['credit'] {$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['title']}

                            + +

                            {lang post_trade_locus}: $trade['locus']

                            +

                            {lang trade_seller}: $trade['seller']

                            +
                            +
                            +
                            +
                              +
                            • +
                              {lang trade_credits_total}
                              +
                              +  {lang trade_units}   + {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]}  {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}  +
                              +
                            • +
                            • +
                              {lang trade_nums}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang post_trade_transport}
                              +
                              + {lang post_trade_transport_seller} + {lang post_trade_transport_buyer} + {lang post_trade_transport_virtual} + {lang post_trade_transport_physical} +
                              +
                            • + +
                            • + +
                              + +
                              + + +
                              + +
                              + + +
                              + +
                              + +
                            • + +
                            • +
                              {lang trade_paymethod}
                              +
                              + + + + {lang trade_pay_offline} + + + + +
                              +
                            • + +
                            • +
                              {lang trade_buyername}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang trade_buyercontact}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang trade_buyerzip}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang trade_buyerphone}
                              +
                              + +
                              +
                            • +
                            • +
                              {lang trade_buyermobile}
                              +
                              + +
                              +
                            • + + + + + + + +
                            +
                            +
                            + +
                              +
                            • {lang trade_guest_alarm}
                            • +
                            + +
                            +
                            + + +
                            +
                            $trade['seller'] {lang trade_recommended_goods}
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            +
                            $usertrade['subject']
                            +
                            + +

                            ¥ $usertrade['price']

                            + + +

                            {lang trade_additional} $usertrade['credit'] {$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['title']}

                            + +
                            +
                            + +
                            +
                            + +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/trade_displayorder.htm b/template/default/touch/forum/trade_displayorder.htm new file mode 100644 index 0000000..de42cce --- /dev/null +++ b/template/default/touch/forum/trade_displayorder.htm @@ -0,0 +1,81 @@ + + +
                            +

                            {lang trade_displayorder}

                            +
                            + +
                              +
                            • +
                              {lang trade_update_stick}
                              +
                              {lang trade_show_order}
                              +
                              {lang post_trade_name}
                              +
                            • + +
                            • +
                              0}checked="checked"{elseif $_G['group']['tradestick'] <= $stickcount}disabled="disabled"{/if} />
                              +
                              + +
                            • +
                            • +
                              + + {lang post_trade_price}: + + $trade['price'] {lang payment_unit} + + + {$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['title']} $trade['credit'] {$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']} + + +
                              +
                            • +
                            • +
                              + + {lang trade_remaindays}: + + {lang trade_timeout} + + {$trade['expiration']}{lang days}{$trade['expirationhour']}{lang trade_hour} + + {lang trade_timeout} + + +
                              +
                            • + +
                            • {lang trade_update_stickmax} {$_G['group']['tradestick']}
                            • +
                            +
                            +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/forum/trade_info.htm b/template/default/touch/forum/trade_info.htm new file mode 100644 index 0000000..8d5f033 --- /dev/null +++ b/template/default/touch/forum/trade_info.htm @@ -0,0 +1,252 @@ + + + + + + +
                            + + + + +
                            + +
                            + +
                            +
                            +
                            + +
                            +
                            + $trade['subject'] + + + + {lang edit_trade} + |{lang delete}   + + + +
                            +
                            + {lang post_trade_sticklist} + + $trade['subject'] + + $trade['subject'] + +
                            +
                            +
                              +
                            • +
                              {lang trade_type_viewthread}
                              +
                              + {lang trade_new} + {lang trade_old} + {lang trade_type_buy} +
                              +
                            • +
                            • +
                              {lang trade_transport}
                              +
                              + {lang post_trade_transport_offline} + {lang post_trade_transport_seller} + + {lang post_trade_transport_physical} + + {lang post_trade_transport_mail} $trade['ordinaryfee'] {lang payment_unit} + {lang post_trade_transport_express} $trade['expressfee'] {lang payment_unit} + EMS $trade['emsfee'] {lang payment_unit} + + {lang post_trade_transport_none} + + + {lang post_trade_transport_virtual} +
                              +
                            • +
                            • +
                              {lang trade_remaindays}
                              +
                              + + {lang trade_timeout} + + {$trade['expiration']}{lang days}{$trade['expirationhour']}{lang trade_hour} + + {lang trade_timeout} + +   + +
                              +
                            • +
                            • +
                              {lang post_trade_number}
                              +
                              $trade['amount']
                              +
                            • +
                            • +
                              {lang trade_locus}
                              +
                              $trade['locus']
                              +
                            • +
                            • +
                              {lang post_trade_buynumber}
                              +
                              $trade['totalitems']
                              +
                            • + +
                            • +
                              +
                              + $trade['price'] {lang payment_unit}   + + {lang trade_additional} $trade['credit'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['title']} + +
                              +
                            • + + +
                            • +
                              +
                              + $trade['costprice'] {lang payment_unit} + + {lang trade_additional} $trade['costcredit'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['title']} + +
                              +
                            • + +
                            + + + + +
                            + $post['message'] +
                            + + +
                            + {lang attachment}: {lang attach_nopermission}{lang attach_nopermission_login} +
                            + + +
                              {echo showattach($post, 1)}
                            + + +
                              {echo showattach($post)}
                            + + + +
                            +
                            +
                            +
                            +
                            +
                            {lang trade_rate}
                            +
                            + +
                            + +
                            +
                            {lang trade_other_goods}
                            +
                            +
                            + +
                            +
                            + + {lang post_trade_sticklist} +
                            +
                            +
                            +
                            $usertrade['subject']
                            +
                            + +

                            ¥ $usertrade['price']

                            + + +

                            {lang trade_additional} $usertrade['credit'] {$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['title']}

                            + +
                            +
                            + +
                            +
                            + + +
                            +
                            {lang trade_seller_other_goods}
                            +
                            + +
                            + +
                            + + + + + + \ No newline at end of file diff --git a/template/default/touch/forum/trade_view.htm b/template/default/touch/forum/trade_view.htm new file mode 100644 index 0000000..089d7da --- /dev/null +++ b/template/default/touch/forum/trade_view.htm @@ -0,0 +1,256 @@ + + + +
                            +
                            +
                            {lang trade_pay_alipay}{lang trade_pay_offline}
                            +
                            +
                            + + + + + + + +
                              +
                            • +
                              {lang status}
                              +
                              $tradelog['statusview']
                              +
                            • +
                            • +
                              +
                              ($tradelog['lastupdate'])
                              +
                            • + +
                            • +
                              {lang trade_password}
                              +
                              +
                            • +
                            • +
                              +
                            • +
                            • $trade_message
                            • + +
                            + +
                            + + + +
                            + + + + +
                              +
                            • + +
                              +
                              {lang eccredit_post_between}
                              +
                            • + +
                              +
                              {lang eccredit_post_waiting}
                              + + + +
                              +
                              {lang eccredit_post_already}
                              + + + + +
                            +
                            + + {lang eccredit1} + + {lang eccredit1} + +
                            +
                              + +
                            + +
                            + {lang trade_online_tradeurl} + + + + + + + + + + + + +
                            + +
                            +
                            +
                            {lang trade_order}
                            +
                            +
                              +
                            • +
                              {lang post_trade_name}
                              + +
                            • + +
                            • +
                              {lang post_trade_price}
                              +
                              ¥ $tradelog['price'] {lang payment_unit}
                              +
                            • + + +
                            • +
                              +
                              {lang trade_additional} $tradelog['credit'] {$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['title']}
                              +
                            • + +
                            • {lang trade_payment_comment}
                            • + +
                            • +
                              {lang post_trade_locus}
                              +
                              $tradelog['locus']
                              +
                            • + +
                            • +
                              {lang trade_seller}
                              + +
                            • +
                            • +
                              {lang trade_buyer}
                              + +
                            • + +
                            • +
                              {lang trade_order_no}
                              + +
                            • + + +
                            • +
                              {lang trade_baseprice}
                              +
                              +
                            • + +
                            • +
                              {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['title']}
                              +
                              +
                              {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}
                              +
                            • + + +
                            • +
                              {lang trade_nums}
                              +
                              $tradelog['number']
                              +
                              {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}
                              +
                            • +
                            • +
                              {lang post_trade_transport}
                              +
                              + {lang post_trade_transport_offline} + {lang post_trade_transport_seller} + {lang post_trade_transport_buyer} + {lang post_trade_transport_virtual} + {lang post_trade_transport_physical} +
                              +
                            • + +
                            • +
                              {lang trade_transportfee}
                              +
                              $tradelog['transportfee']
                              +
                              {lang payment_unit}
                              +
                            • + + +
                            • +
                              {lang trade_buyername}
                              +
                              $tradelog['buyername']
                              +
                            • +
                            • +
                              {lang trade_buyercontact}
                              +
                              $tradelog['buyercontact']
                              +
                            • +
                            • +
                              {lang trade_buyerzip}
                              +
                              $tradelog['buyerzip']
                              +
                            • +
                            • +
                              {lang trade_buyerphone}
                              +
                              $tradelog['buyerphone']
                              +
                            • +
                            • +
                              {lang trade_buyermobile}
                              +
                              $tradelog['buyermobile']
                              +
                            • + + + + + + + +
                            • +
                              {lang trade_seller_remark}
                              +
                              $tradelog['buyermsg']
                              +
                            • +
                            + +
                            + +
                            + +
                            +
                            + + +
                            +
                            {lang trade_message}
                            +
                            +
                            + +
                            +
                            +
                            $message[1] $message[2]
                            +
                            $message[3]
                            +
                            + +
                            +
                            + + +
                            +
                            $trade['seller'] {lang trade_recommended_goods}
                            +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            +
                            $usertrade['subject']
                            +
                            + +

                            ¥ $usertrade['price']

                            + + +

                            {lang trade_additional} $usertrade['credit'] {$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G[setting]['extcredits'][$_G['setting']['creditstransextra'][5]]['title']}

                            + +
                            +
                            + +
                            +
                            + +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/viewthread.htm b/template/default/touch/forum/viewthread.htm new file mode 100644 index 0000000..c170a3f --- /dev/null +++ b/template/default/touch/forum/viewthread.htm @@ -0,0 +1,464 @@ + +
                            +
                            +

                            +
                            +
                            + +
                            +
                            + + [{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}] + + + [{$_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]}] + + $_G['forum_thread']['subject'] + ({lang moderating}) + ({lang have_ignored}) + ({lang draft}) + +
                            + + + + +
                            +
                            +
                            + +
                            + + {lang warn_get} + + +

                            $post['subject']

                            + + +
                            {lang message_banned}
                            + +
                            {lang message_single_banned}
                            + +
                            {lang message_ishidden_hiddenreplies}
                            + + + + +
                            {lang admin_message_banned}
                            + +
                            {lang admin_message_single_banned}
                            + + + {lang pay_threads}: $_G['forum_thread']['price'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title']} {lang pay_view} + + + + + {lang has_expired} + +
                            +

                            $_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]

                            + + + $option['title']: $option['value'] $option['unit']--
                            + + +
                            + + + + + + $post['message'] + + + + + + + + + + + + $threadplughtml + $post['message'] + + $post['message'] + + + $post['message'] + + +
                            + + +
                            + {lang attachment}: {lang attach_nopermission}{lang attach_nopermission_login} +
                            + + +
                              {echo showattach($post, 1)}
                            + + +
                              {echo showattach($post)}
                            + + + + + +
                            + +

                            {lang comments}

                            +
                            $totalcomment[$post['pid']]
                            + +
                            +
                            $comment['avatar']
                            +
                            +
                              +
                            • + IP:$comment['useip']{if $comment['port']}:$comment['port']{/if} + + + $comment['author'] + + {lang guest} + + +
                            • +
                            • + {lang delete} + {lang poston} +
                            • +
                            • $comment['comment']
                            • +
                            +
                            +
                            + +
                            + +
                            + + +

                            {lang rate}

                            +
                            + +
                            + +
                            + +
                            + + + +
                            +
                            +
                              + +
                            • + +

                              $ratelog['username']

                              + + +

                              {$_G['setting']['extcredits'][$id]['title']} + $score $_G['setting']['extcredits'][$id]['unit']

                              + +

                              {$_G['setting']['extcredits'][$id]['title']} $score $_G['setting']['extcredits'][$id]['unit']

                              + + +
                            • + +
                            + +
                            +
                            + +
                            +
                            + +
                            + +
                            + +
                            + + + +
                            +
                            +
                            + + + {lang post_descview} + + {lang post_ascview} + + + + {lang viewonlyauthorid} + + {lang thread_show_all} + + {lang all}{lang reply}{$_G['forum_thread']['allreplies']} +
                            +
                            + +
                            {lang mobnoreply}
                            + + + +
                            +$multipage + + +
                            + + + + \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_activity.htm b/template/default/touch/forum/viewthread_activity.htm new file mode 100644 index 0000000..4f64d92 --- /dev/null +++ b/template/default/touch/forum/viewthread_activity.htm @@ -0,0 +1,145 @@ +
                            $post['message']
                            +
                            + +
                            +
                            {lang activity_type}:$activity['class']
                            +
                            {lang activity_starttime}: + + {lang activity_start_between} + + $activity['starttimefrom'] + +
                            +
                            {lang activity_space}:$activity['place']
                            +
                            {lang gender}: + + {lang male} + + {lang female} + + {lang unlimited} + +
                            + +
                            {lang activity_payment}:$activity['cost'] {lang payment_unit}
                            + + +
                            {lang activity_already}: + $allapplynum {lang activity_member_unit} + + {lang manage} + +
                            + +
                            {lang activity_about_member}: + $aboutmembers {lang activity_member_unit} +
                            + + +
                            {lang post_closing}:$activity['expiration']
                            + +
                            + + +

                            {lang activity_wait}{lang activity_join_audit}

                            + + + + + +

                            + +

                            + + + +
                            +
                            + +
                            + +
                            +
                            {lang activity_join}
                            + +
                            {lang activity_no_member}{lang activity_join_group}
                            + +
                            + +
                            {lang activity_need_credit} $activity['credit'] {$_G['setting']['extcredits'][$_G['setting']['activitycredit']]['title']}
                            + +

                            {lang activity_paytype}

                            + + + + +
                            + $settings[$fieldid]['title']* + $htmls[$fieldid] +
                            + + + + + + $extname + + +
                            + {lang leaveword} + +
                            +
                            + +
                            {$_G['setting']['extcredits'][$_G['setting']['activitycredit']]['title']} {lang not_enough}$activity['credit']
                            + + + + + +
                            +
                            + + +
                            + +
                            +
                            {lang activity_join_cancel}
                            +
                            + +
                            + {lang leaveword} + +
                            +
                            + +
                            +
                            +
                            + + +
                            +
                            {lang activity_new_join} ($applynumbers {lang activity_member_unit})
                            + + + + + + + + + + + + + + + + + +
                            {lang mod_option_moduser}{lang activity_payment}{lang activity_jointime}
                            $apply['username']$apply['payment'] {lang payment_unit}{lang activity_self}$apply['dateline']
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_album.htm b/template/default/touch/forum/viewthread_album.htm new file mode 100644 index 0000000..bb1cecf --- /dev/null +++ b/template/default/touch/forum/viewthread_album.htm @@ -0,0 +1,307 @@ + + + + + + + + + + + + + +
                            +
                            + {lang return} + {lang numheader} {lang unitpaper} / {lang numtotal} $count {lang unitpaper} +
                            +
                              + +
                            • + src="$imgurl" zsrc="$imgurl" orig="$imglist['url'][$key]"/> +
                            • + +
                            +
                            + + + + \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_debate.htm b/template/default/touch/forum/viewthread_debate.htm new file mode 100644 index 0000000..c1ba325 --- /dev/null +++ b/template/default/touch/forum/viewthread_debate.htm @@ -0,0 +1,53 @@ +
                            $post['message']
                            +
                            + + +
                            +

                            + + + {lang debate_square}{lang debate_winner} + + {lang debate_opponent}{lang debate_winner} + + {lang debate_draw} + + +

                            +

                            {lang debate_comment_dateline}: $debate['endtime']

                            +

                            {lang debate_umpirepoint}: $debate['umpirepoint']

                            +

                            {lang debate_bestdebater}: $debate['bestdebater']

                            +
                            + + +
                            + {lang debate_square_point} ($debate['affirmvotes']){lang debater}: $debate['affirmdebaters'] +

                            $debate['affirmpoint']

                            + +
                            + + +
                            + +
                            +
                            + {lang debate_opponent_point} ($debate['negavotes']){lang debater}: $debate['negadebaters'] +

                            $debate['negapoint']

                            + +
                            + + +
                            + +
                            + +
                            {lang endtime}: $debate['endtime'] {lang debate_umpire}: $debate['umpire']
                            + + + + + + + + +
                            \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_node.htm b/template/default/touch/forum/viewthread_node.htm new file mode 100644 index 0000000..80bd0a7 --- /dev/null +++ b/template/default/touch/forum/viewthread_node.htm @@ -0,0 +1,195 @@ + + + +
                            + +
                            + +
                            + + {lang warn_get} + + +

                            $post['subject']

                            + + +
                            {lang message_banned}
                            + +
                            {lang message_single_banned}
                            + +
                            {lang message_ishidden_hiddenreplies}
                            + + + + + +
                            {lang admin_message_banned}
                            + +
                            {lang admin_message_single_banned}
                            + + + {lang pay_threads}: $_G['forum_thread']['price'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title']} {lang pay_view} + + + + + + {lang has_expired} + +
                            +

                            $_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]

                            + + + $option['title']: $option['value'] $option['unit']--
                            + + +
                            + + + + + + $post['message'] + + + + + + + + + + + + $threadplughtml + $post['message'] + + $post['message'] + + + $post['message'] + + + +
                            + + +
                            + {lang attachment}: {lang attach_nopermission}{lang attach_nopermission_login} +
                            + + +
                              {echo showattach($post, 1)}
                            + + +
                              {echo showattach($post)}
                            + + + + + +

                            {lang rate}

                            +
                            + +
                            + +
                            + + +

                            {lang rate_view}

                            + +
                            +
                            + +
                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            {lang number_of_participants} {$_G['setting']['extcredits'][$id]['title']} +$score{$_G['setting']['extcredits'][$id]['title']} $score + {lang open}{lang pack} + {lang reason} +
                            + $ratelog[username] + + $ratelog[score][$id]$ratelog[score][$id]$ratelog[reason]
                            +

                            + {lang rate_view} +

                            + + + +
                            +
                            + +
                            + +
                            +
                            + diff --git a/template/default/touch/forum/viewthread_pay.htm b/template/default/touch/forum/viewthread_pay.htm new file mode 100644 index 0000000..1895cba --- /dev/null +++ b/template/default/touch/forum/viewthread_pay.htm @@ -0,0 +1,17 @@ + +
                            $thread['freemessage']
                            + + +
                            + {lang pay} + + {lang have} $thread['payers'] {lang people_buy}  + + {lang pay_comment} +
                            {lang pay_free_time} +
                            + + {lang have} $thread['payers'] {lang people_buy}  + {lang pay_comment} {lang pay} +
                            {lang pay_free_time} + \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_poll.htm b/template/default/touch/forum/viewthread_poll.htm new file mode 100644 index 0000000..ac2d6e3 --- /dev/null +++ b/template/default/touch/forum/viewthread_poll.htm @@ -0,0 +1,76 @@ +
                            $post['message']
                            +
                            +
                            + +
                            + {lang poll_multiple}{lang thread_poll}: ( {lang poll_more_than} ){lang poll_single}{lang thread_poll} , {lang poll_after_result}, {lang poll_voterscount} +
                            + +
                            + {lang poll_count_down}: + $_G['forum_thread']['remaintime'][0] {lang days} + $_G['forum_thread']['remaintime'][1] {lang poll_hour} + $_G['forum_thread']['remaintime'][2] {lang poll_minute} +
                            + +
                            {lang poll_end}
                            + + + + +
                            + + + +

                            + + + $imginfo['filename'] + + + $imginfo['filename'] + + + + + + + $option['percent']% ($option['votes']{lang debate_poll}) + +

                            +
                            + + + + +

                            + + + + + + $option['percent']% ($option['votes']{lang debate_poll}) + +

                            +
                            + + + + + + {lang poll_msg_overt} + + + + {lang poll_msg_allwvote_user} + + {lang poll_msg_allwvoteusergroup} + + + {lang poll_msg_allowvotepolled} + + {lang poll_msg_allowvotethread} + +
                            +
                            +
                            \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_poll_voter.htm b/template/default/touch/forum/viewthread_poll_voter.htm new file mode 100644 index 0000000..c6dba21 --- /dev/null +++ b/template/default/touch/forum/viewthread_poll_voter.htm @@ -0,0 +1,49 @@ + +
                            +

                            {lang poll_voters}

                            +
                              +
                            • +
                              + +
                              +
                            • +
                            + +
                            {lang none}
                            + + + +
                            +
                            $multipage
                            + + + + \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_reward.htm b/template/default/touch/forum/viewthread_reward.htm new file mode 100644 index 0000000..83af4ae --- /dev/null +++ b/template/default/touch/forum/viewthread_reward.htm @@ -0,0 +1,30 @@ +
                            + + {lang reward_answer} + +
                            {lang thread_reward}$rewardprice{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]['title']} {if $_G['forum_thread']['price'] > 0}{lang unresolved}{elseif $_G['forum_thread']['price'] < 0}{lang resolved}{/if}
                            +
                            + +
                            +

                            {lang view_full_content}{lang reward_bestanswer}

                            +
                            +
                            + $bestpost['avatar'] + $bestpost['author'] +
                            +
                            {lang message_ishidden_hiddenreplies}$bestpost[message]
                            +
                            +
                            + + +
                            {lang attachment}: {lang attach_nopermission}{lang attach_nopermission_login}
                            + + + {echo showattach($post, 1)} + + + {echo showattach($post)} + + + +
                            $post['message']
                            \ No newline at end of file diff --git a/template/default/touch/forum/viewthread_trade.htm b/template/default/touch/forum/viewthread_trade.htm new file mode 100644 index 0000000..a65bf5c --- /dev/null +++ b/template/default/touch/forum/viewthread_trade.htm @@ -0,0 +1,82 @@ + + + + + $post['message'] + +
                            + {lang post_trade_totalnumber}: $tradenum + + {lang post_add_aboutcounter} + + {lang trade_displayorder} + + + |+ {lang trade_add_post} + + +
                            + + {lang my_trade_stat} + + + + + +
                            + +
                            +

                            $trade['subject']

                            +
                            +
                            {lang trade_type_viewthread}: + {lang trade_new} + {lang trade_old} + {lang trade_type_buy} +
                            +
                            {lang trade_remaindays}: + + {lang trade_timeout} + + {$trade['expiration']}{lang days}{$trade['expirationhour']}{lang trade_hour} + + {lang trade_timeout} + +   + +
                            +
                            +
                            + + $trade['price'] {lang payment_unit}   + + + {lang trade_additional} $trade['credit'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['title']} + +

                            + + $trade['costprice'] {lang payment_unit} + + + {lang trade_additional} $trade['costcredit'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['title']} + +

                            +
                            +
                            +
                            + + +
                            $post['counterdesc']
                            + +
                            {lang trade_nogoods}
                            + diff --git a/template/default/touch/group/group.htm b/template/default/touch/group/group.htm new file mode 100644 index 0000000..202b6c9 --- /dev/null +++ b/template/default/touch/group/group.htm @@ -0,0 +1,55 @@ + +
                            +
                            +

                            +
                            +
                            + + + +
                            +

                            + + + + + + + +
                            + + + +
                            + + +
                            + + + +
                            + +   + {lang favorite} + + + $_G['forum']['name'] +

                            +

                            {lang threads} {$_G['forum']['threads']}{lang member} {$_G['forum']['membernum']}

                            +

                            {$_G['forum']['description']}

                            +
                            + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/group/group_create.htm b/template/default/touch/group/group_create.htm new file mode 100644 index 0000000..fe62e2d --- /dev/null +++ b/template/default/touch/group/group_create.htm @@ -0,0 +1,96 @@ +
                            +
                            +
                            +

                            {lang group_you_have}

                            +

                            {lang group_create_mod}

                            +
                            +
                            +
                            + + + + +
                              +
                            • +
                              {lang group_name}*
                              +
                              +
                            • +
                            • +
                              {lang group_category}*
                              +
                              + +
                              +
                            • + +
                            • {lang group_description}
                            • +
                            • + +
                            • +
                            • +
                              {lang group_perm_visit} :
                              +
                              + +
                              +
                            • +
                            • +
                              {lang group_join_type} :
                              +
                              + +
                              +
                            • +
                            +
                            + + +
                            +
                            +
                            + + + + +
                            diff --git a/template/default/touch/group/group_index.htm b/template/default/touch/group/group_index.htm new file mode 100644 index 0000000..d8f9367 --- /dev/null +++ b/template/default/touch/group/group_index.htm @@ -0,0 +1,27 @@ + + +
                            +
                              + +
                              + + + + +
                              + +
                            +
                            + +
                            {lang group_no_latest_feeds}

                            + \ No newline at end of file diff --git a/template/default/touch/group/group_list.htm b/template/default/touch/group/group_list.htm new file mode 100644 index 0000000..7dedcb2 --- /dev/null +++ b/template/default/touch/group/group_list.htm @@ -0,0 +1,163 @@ + + +
                            +
                            +
                            + +
                            +
                            +
                            + + +
                            + + + + + $_G['setting']['extcredits'][$id]['img'] $_G['setting']['extcredits'][$id]['title'] $policy $_G['setting']['extcredits'][$id]['unit'] + + +

                            {lang search_credit_msg}

                            +
                            + \ No newline at end of file diff --git a/template/default/touch/group/group_manage.htm b/template/default/touch/group/group_manage.htm new file mode 100644 index 0000000..aed47ee --- /dev/null +++ b/template/default/touch/group/group_manage.htm @@ -0,0 +1,382 @@ + + + + + + +
                            + + +
                            +
                              + +
                            • +
                              {lang group_name} :
                              +
                              +
                            • + + +
                            • +
                              {lang group_category} :
                              +
                              + +
                              +
                            • +
                            • +
                              {lang group_category} :
                              +
                              + +
                              +
                            • + + +
                            • +
                              + + {lang group_icon} +
                              +
                              + +
                              +
                            • +
                            • +
                              + + {lang group_image} +
                              +
                              + +
                              +
                            • + +
                            • {lang group_description}
                            • +
                            • + +
                            • +
                            • +
                              {lang group_perm_visit} :
                              +
                              + +
                              +
                            • +
                            • +
                              {lang group_join_type} :
                              +
                              + +
                              +
                            • +
                            +
                            +
                            + + +
                            +
                            + + +
                            + + +
                            + $multipage + + + +
                            + +
                            + +
                            + + +
                            + +

                            {lang group_admin_member}

                            + + + +

                            {$langplus[groups]}{lang member}

                            + + +
                            +
                            +
                              + + +
                            • + + +
                            +
                            +
                            +$multipage + + +
                            + + +
                            +
                              +
                            • +
                              {lang threadtype_turn_on} :
                              +
                              +
                            • +
                            + +
                            +
                              +
                            • {lang threadtype}
                            • +
                            • +
                              {lang delete}
                              +
                              {lang enable}
                              +
                              {lang displayorder}
                              +
                              {lang threadtype_name}
                              + +
                            • +
                            +
                              + + +
                            • +
                              +
                              +
                              +
                              +
                            • + + +
                            +
                            +
                            +
                            + + +
                            +
                            + + +
                            + + + +
                            + {lang group_demise_comment} + {lang group_demise_notice} +
                            +
                            +

                            {lang transfer_group_to} :

                            + +
                            +
                            +
                            + + +
                            +
                            + +
                            {lang group_no_admin_member}
                            + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/group/group_memberlist.htm b/template/default/touch/group/group_memberlist.htm new file mode 100644 index 0000000..bf57a7f --- /dev/null +++ b/template/default/touch/group/group_memberlist.htm @@ -0,0 +1,55 @@ + + + +
                            + +
                            +

                            {lang group_admin_member}

                            +
                            +
                              + +
                            • + +

                              {$user['username']}

                              +
                            • + +
                            + + +
                            +

                            {$_G['setting']['navs'][3]['navname']}{lang member}

                            +
                            + + +
                            + + $multipage \ No newline at end of file diff --git a/template/default/touch/group/group_my.htm b/template/default/touch/group/group_my.htm new file mode 100644 index 0000000..2241847 --- /dev/null +++ b/template/default/touch/group/group_my.htm @@ -0,0 +1,145 @@ + +
                            +
                            +

                            {$_G[username]}{lang somebody_group}

                            +
                            +
                            + + + + +
                            +
                            +
                            + +
                            +
                            +
                            + + + +
                            + +
                            +

                            {$usergroups['groups'][$groupid]}{lang more}

                            + +
                            + +
                            + + +
                            +
                            +

                            {lang last_topic_in_group}{lang my_last_topic_in_group}

                            + +
                            + + + +
                            {lang no_related_posts}
                            + + + + + +$multipage + + +
                            {lang no_group_join}
                            + + + + diff --git a/template/default/touch/group/index.htm b/template/default/touch/group/index.htm new file mode 100644 index 0000000..0091227 --- /dev/null +++ b/template/default/touch/group/index.htm @@ -0,0 +1,99 @@ + +
                            +
                            +

                            {$_G['setting']['navs'][3]['navname']}

                            +
                            +
                            + + +
                            +
                            + +
                            + + + + + +
                            +
                            +
                            + + + diff --git a/template/default/touch/group/type.htm b/template/default/touch/group/type.htm new file mode 100644 index 0000000..ffe46d4 --- /dev/null +++ b/template/default/touch/group/type.htm @@ -0,0 +1,70 @@ + + + +
                            +
                            +
                            + +
                            +
                            +
                            + + + + + +
                            • {lang group_category_no_groups}
                            + + $multipage + \ No newline at end of file diff --git a/template/default/touch/home/follow_feed.htm b/template/default/touch/home/follow_feed.htm new file mode 100644 index 0000000..477ad7b --- /dev/null +++ b/template/default/touch/home/follow_feed.htm @@ -0,0 +1,297 @@ + +
                            +
                            +

                            {lang follow_add}{lang follow_follower}{lang follow}

                            +
                            + + + + +
                            + + + +
                            + +
                            + + + + + +
                            +
                              + +
                            + + + + +
                            + + + + + + + +
                            + +
                            +

                            + {lang follow_following_null}{lang follow_no_content} + +
                            + {lang follow_add_special_tip}{lang follow_add_special_following} +
                            + +

                            + + +
                            +
                            +

                            {lang follow_recommend}

                            +
                            + +
                            + +
                            + + + + +
                            + +
                            + +
                            +
                            + +

                            {lang follow_del}

                            + + +

                            {lang follow_follower_mutual}|{lang did_not_follow_to_me}|{lang follow_del}

                            + +

                            {lang follow_add}

                            + + +
                            +
                            $fuser['fusername'] $fuser['bkname']
                            +

                            {lang follow_recent_note}: $fuser['recentnote']

                            +

                            + {lang comefrom}: $memberprofile[$fuid]['residecountry'] $memberprofile[$fuid]['resideprovince'] $memberprofile[$fuid]['residecity']   + {lang follow_follower}: $memberinfo[$fuid]['follower']{lang person}   + {lang follow_add}: $memberinfo[$fuid]['following']{lang person}   + + | + {lang follow_mod_bkname}{lang follow_add_bkname} + + | + {lang follow_del_special_following}{lang follow_add_special_following} + + +

                            + +
                            +
                            + + +

                            {lang follow_follower_mutual}|{lang did_not_follow_to_me}|{lang follow_del}

                            + +

                            {lang follow_add}

                            + + +
                            +
                            $fuser['username']
                            +

                            {lang follow_recent_note}: $fuser['recentnote']

                            +

                            + {lang comefrom}: $memberprofile[$fuid]['residecountry'] $memberprofile[$fuid]['resideprovince'] $memberprofile[$fuid]['residecity']   + {lang follow_follower}: $memberinfo[$fuid]['follower']{lang person}   + {lang follow_add}: $memberinfo[$fuid]['following']{lang person} +

                            + +
                            + +
                            +
                            $multi
                            +
                            + +
                            +
                            +
                              +
                            • +
                              +

                              + + + {lang follow_you_following_none}{lang follow_hall}{lang follow_fetch_interested_user} + + {lang follow_you_follower_none1}{lang follow_add_feed}{lang follow_you_follower_none2} + + + + {lang follow_user_following_none} + + {lang follow_user_follower_none} + + + +

                              +
                              +
                            • +
                            +
                            +
                            + + +
                            + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/home/follow_feed_li.htm b/template/default/touch/home/follow_feed_li.htm new file mode 100644 index 0000000..a20babb --- /dev/null +++ b/template/default/touch/home/follow_feed_li.htm @@ -0,0 +1,70 @@ + + + + + + + +
                          • +
                            + + +
                            +
                            + +
                            + $feed['note'] +
                            +
                            + + + + + + + + + + +
                            +
                            + + +
                          • + + + + + + + diff --git a/template/default/touch/home/follow_user_header.htm b/template/default/touch/home/follow_user_header.htm new file mode 100644 index 0000000..a7e63a8 --- /dev/null +++ b/template/default/touch/home/follow_user_header.htm @@ -0,0 +1,45 @@ +
                            + + + + +
                            +
                            + + {lang follow_del_special_following}{lang follow_add_special_following} + + + {lang follow_follower_mutual} + + {lang follow_followed}, + + {lang follow_del} +
                            +
                            + + {lang follow_user_followed} + + + {lang follow_add} + +
                            +
                            + +
                            \ No newline at end of file diff --git a/template/default/touch/home/index.htm b/template/default/touch/home/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/touch/home/misc_inputpwd.htm b/template/default/touch/home/misc_inputpwd.htm new file mode 100644 index 0000000..60e29ba --- /dev/null +++ b/template/default/touch/home/misc_inputpwd.htm @@ -0,0 +1,31 @@ + +
                            +
                            +

                            + {lang password_authentication} +

                            +
                            + +
                            +
                            +
                            +
                            + + + + + + + + + + + +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/home/space_album_list.htm b/template/default/touch/home/space_album_list.htm new file mode 100644 index 0000000..dff28c0 --- /dev/null +++ b/template/default/touch/home/space_album_list.htm @@ -0,0 +1,46 @@ + + +
                            +
                            +

                            {lang album}

                            +
                            + + + +
                            + + +
                            $multi
                            + +
                            +

                            {lang no_album}

                            +
                            + +
                            + + + + + + \ No newline at end of file diff --git a/template/default/touch/home/space_album_pic.htm b/template/default/touch/home/space_album_pic.htm new file mode 100644 index 0000000..42885f0 --- /dev/null +++ b/template/default/touch/home/space_album_pic.htm @@ -0,0 +1,31 @@ + + + + +
                            +
                            +

                            $sequence / $album['picnum']

                            +
                            +
                            + +
                            +
                            + + +
                            +

                            $pic['title']

                            +

                            + {lang upload_at} ($pic['size']) +

                            +
                            +
                            +
                            + + + \ No newline at end of file diff --git a/template/default/touch/home/space_album_view.htm b/template/default/touch/home/space_album_view.htm new file mode 100644 index 0000000..8b9ecf2 --- /dev/null +++ b/template/default/touch/home/space_album_view.htm @@ -0,0 +1,41 @@ + + + + +
                            +
                            +

                            {lang album}

                            +
                            + +
                            +
                            +
                            +
                            $album['albumname']
                            + {lang total} $album['picnum'] {lang album_pics} + + {lang delete} + +
                            +
                            $album['depict']
                            +
                            +
                            + +
                              + +
                            • +
                              +

                              ({lang moderate_need})

                              +
                              +
                            • + +
                            +
                            $multi
                            + +
                            +

                            {lang no_album}

                            +
                            + +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/home/space_blog_list.htm b/template/default/touch/home/space_blog_list.htm new file mode 100644 index 0000000..949c273 --- /dev/null +++ b/template/default/touch/home/space_blog_list.htm @@ -0,0 +1,147 @@ + + +
                            +
                            +

                            {lang blog}

                            + +
                            + +
                            + + + + + + + + +
                            +
                            +
                            + +
                            +
                            +
                            + + + +
                            + +
                            + + \ No newline at end of file diff --git a/template/default/touch/home/space_blog_view.htm b/template/default/touch/home/space_blog_view.htm new file mode 100644 index 0000000..11fcc72 --- /dev/null +++ b/template/default/touch/home/space_blog_view.htm @@ -0,0 +1,104 @@ + + +
                            +
                            +

                            {lang blog}

                            + +
                            + +
                            + +
                            +
                            + + [{$classarr['classname']}] + + + [$blog['catname']] + + $blog['subject'] + ({lang pending}) +
                            +
                            +
                            +
                            +
                              +
                            • + + + {$friendsname[$blog[friend]]} + + + + + $space['username'] + + +
                            • +
                            • + $blog['viewnum']$blog['replynum'] + +
                            • +
                            +
                            + $blog[message] +
                            +
                            + +
                            +
                            +
                            +
                            +
                            + {lang blog_comment} +
                            +
                            +
                              + + + +
                            +
                            + + +
                            +
                            +
                            +
                              +
                            • + + + +
                            • +
                            • + +
                            • +
                            + + + + + + + + +
                            +
                            +
                            + + +
                            $multi
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/home/space_comment_li.htm b/template/default/touch/home/space_comment_li.htm new file mode 100644 index 0000000..b2ba620 --- /dev/null +++ b/template/default/touch/home/space_comment_li.htm @@ -0,0 +1,67 @@ +
                          • +
                            + + + + + + + hidden + + +
                            +

                            + + {$value['author']} + + $_G['setting']['anonymoustext'] + +

                            +
                            + ({lang moderate_need}) +
                            + + {lang reply} + + + + {lang edit} + + + {lang delete} + + +
                            +
                            +
                            +
                            + +
                            $value['message'] {lang moderate_not_validate}
                            + + + + +
                          • \ No newline at end of file diff --git a/template/default/touch/home/space_doing.htm b/template/default/touch/home/space_doing.htm new file mode 100644 index 0000000..4809fe7 --- /dev/null +++ b/template/default/touch/home/space_doing.htm @@ -0,0 +1,73 @@ + + +
                            +
                            +

                            {lang doing}

                            +
                            + + + +
                            + + + +
                            + + + +
                            +

                            {lang doing_no_replay}

                            +
                            + +
                            +
                            + + diff --git a/template/default/touch/home/space_doing_form.htm b/template/default/touch/home/space_doing_form.htm new file mode 100644 index 0000000..f95b175 --- /dev/null +++ b/template/default/touch/home/space_doing_form.htm @@ -0,0 +1,27 @@ + +
                            +
                            +
                            +
                            + +
                            +
                            +
                            + +
                            + +
                            + +
                            + +
                            +
                            + + + + +
                            +
                            \ No newline at end of file diff --git a/template/default/touch/home/space_doing_li.htm b/template/default/touch/home/space_doing_li.htm new file mode 100644 index 0000000..cb18796 --- /dev/null +++ b/template/default/touch/home/space_doing_li.htm @@ -0,0 +1,16 @@ + + + +
                            \ No newline at end of file diff --git a/template/default/touch/home/space_eccredit.htm b/template/default/touch/home/space_eccredit.htm new file mode 100644 index 0000000..34912b7 --- /dev/null +++ b/template/default/touch/home/space_eccredit.htm @@ -0,0 +1,151 @@ +{eval + $space_uid = $space['uid']; + $filter = array( 'common' => '{lang have_posted}', 'save' => '{lang draft}', 'close' => '{lang closed}', 'aduit' => '{lang pending}', 'recyclebin' => '{lang recyclebin}'); + $_G['home_tpl_spacemenus'][] = "{lang credit_rating}"; +} + + + + + + + + + + + + +
                            +
                            +
                            {lang eccredit_buyerpercent}: $sellerpercent%;
                            +
                            {lang eccredit_sellerpercent}: $buyerpercent%;
                            +
                            {lang regdate}: $member['regdate']
                            +
                            +
                            +
                            +
                              +
                            • {lang eccredit_sellerinfo} $member[sellercredit]
                            • +
                            • +
                              +
                              {lang eccredit_1month}
                              +
                              {lang eccredit_6month}
                              +
                              {lang eccredit_total}
                              +
                            • +
                            • +
                              {lang eccredit_good}
                              +
                              $caches['sellercredit']['thismonth']['good']
                              +
                              $caches['sellercredit']['halfyear']['good']
                              +
                              $caches['sellercredit']['all']['good']
                              +
                            • +
                            • +
                              {lang eccredit_soso}
                              +
                              $caches['sellercredit']['thismonth']['soso']
                              +
                              $caches['sellercredit']['halfyear']['soso']
                              +
                              $caches['sellercredit']['all']['soso']
                              +
                            • +
                            • +
                              {lang eccredit_bad}
                              +
                              $caches['sellercredit']['thismonth']['bad']
                              +
                              $caches['sellercredit']['halfyear']['bad']
                              +
                              $caches['sellercredit']['all']['bad']
                              +
                            • +
                            • +
                              {lang eccredit_total}
                              +
                              $caches['sellercredit']['thismonth']['total']
                              +
                              $caches['sellercredit']['halfyear']['total']
                              +
                              $caches['sellercredit']['all']['total']
                              +
                            • +
                            +
                            +
                              +
                            • {lang eccredit_buyerinfo} $member['buyercredit']
                            • +
                            • +
                              +
                              {lang eccredit_1month}
                              +
                              {lang eccredit_6month}
                              +
                              {lang eccredit_total}
                              +
                            • +
                            • +
                              {lang eccredit_good}
                              +
                              $caches['buyercredit']['thismonth']['good']
                              +
                              $caches['buyercredit']['halfyear']['good']
                              +
                              $caches['buyercredit']['all']['good']
                              +
                            • +
                            • +
                              {lang eccredit_soso}
                              +
                              $caches['buyercredit']['thismonth']['soso']
                              +
                              $caches['buyercredit']['halfyear']['soso']
                              +
                              $caches['buyercredit']['all']['soso']
                              +
                            • +
                            • +
                              {lang eccredit_bad}
                              +
                              $caches['buyercredit']['thismonth']['bad']
                              +
                              $caches['buyercredit']['halfyear']['bad']
                              +
                              $caches['buyercredit']['all']['bad']
                              +
                            • +
                            • +
                              {lang eccredit_total}
                              +
                              $caches['buyercredit']['thismonth']['total']
                              +
                              $caches['buyercredit']['halfyear']['total']
                              +
                              $caches['buyercredit']['all']['total']
                              +
                            • +
                            +
                            +
                            + + + +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/home/space_favorite.htm b/template/default/touch/home/space_favorite.htm new file mode 100644 index 0000000..6d414a1 --- /dev/null +++ b/template/default/touch/home/space_favorite.htm @@ -0,0 +1,78 @@ + +
                            +
                            +

                            {lang myfavorite}

                            +
                            +
                            + + + + + + +
                            +

                            {lang no_favorite_yet}

                            +
                            + + + + + +
                            +

                            {lang no_favorite_yet}

                            +
                            + + +{$multi} + + diff --git a/template/default/touch/home/space_feed_li.htm b/template/default/touch/home/space_feed_li.htm new file mode 100644 index 0000000..0849fa1 --- /dev/null +++ b/template/default/touch/home/space_feed_li.htm @@ -0,0 +1,38 @@ +
                            +
                            + + + +

                            + $value['title_template'] + New + +

                            +
                            + + + + + + + + + + + + + +
                            $value['body_template']
                            + + + {$value['body_data']['player']} + + + +

                            {lang other_participants}:

                            + + + +
                            $value['body_general']
                            + +
                            \ No newline at end of file diff --git a/template/default/touch/home/space_friend.htm b/template/default/touch/home/space_friend.htm new file mode 100644 index 0000000..a1edde2 --- /dev/null +++ b/template/default/touch/home/space_friend.htm @@ -0,0 +1,45 @@ + +
                            +
                            +

                            {lang online_member}{lang my_visitor}{lang my_trace}{lang my_friends}

                            +
                            +
                            + + + +
                            + +
                            + $multi + + + + diff --git a/template/default/touch/home/space_home.htm b/template/default/touch/home/space_home.htm new file mode 100644 index 0000000..ad51dcd --- /dev/null +++ b/template/default/touch/home/space_home.htm @@ -0,0 +1,65 @@ + + +
                            +

                            {lang feed}

                            +
                            + + + +
                            +
                              + + +
                              {lang yesterday}{lang today}$day
                              + +
                              + + + + +
                              + +
                            +
                            + +
                            +
                              + +
                              {lang yesterday}{lang today}$day
                              + + + +
                              + + + + + + + + + +
                              + + + +
                              + +
                              + + +
                            +
                            + +
                            +
                              +

                              {lang no_feed}

                              +
                            +
                            + +$multipage + \ No newline at end of file diff --git a/template/default/touch/home/space_magic.htm b/template/default/touch/home/space_magic.htm new file mode 100644 index 0000000..f2de12f --- /dev/null +++ b/template/default/touch/home/space_magic.htm @@ -0,0 +1,29 @@ + + +
                            +
                            +

                            {lang magic}

                            +
                            + + + +
                            + +
                            +

                            {lang magics_tips}

                            +
                            + + + + + + + + + +
                            + \ No newline at end of file diff --git a/template/default/touch/home/space_magic_log.htm b/template/default/touch/home/space_magic_log.htm new file mode 100644 index 0000000..654c8dc --- /dev/null +++ b/template/default/touch/home/space_magic_log.htm @@ -0,0 +1,115 @@ +
                            + + + + + + + + + + + + + + + + +
                            {lang magics_name}{lang magics_dateline_use}{lang magics_target_use}
                            $log['name']$log['dateline'] + + {lang magics_target} + + {lang magics_target} + + {lang magics_target} + + {lang magics_operation_sell} + + {lang magics_operation_drop} + +
                            +
                            $multipage
                            + +
                            +

                            {lang data_nonexistence}

                            +
                            + + + + + + + + + + + + + + + + + + +
                            {lang magics_name}{lang magics_dateline_buy}{lang magics_amount_buy}{lang magics_price_buy}
                            $log['name']$log['dateline']$log['amount']$log[price] {$_G['setting']['extcredits'][$log['credit']]['unit']}{$_G['setting']['extcredits'][$log['credit']]['title']}
                            +
                            $multipage
                            + +
                            +

                            {lang data_nonexistence}

                            +
                            + + + + + + + + + + + + + + + + + +
                            {lang magics_name} + {lang magics_dateline_present}{lang magics_amount_present}{lang magics_target_present}
                            $log['name']$log['dateline']$log['amount']$log['username']
                            +
                            $multipage
                            + +
                            +

                            {lang data_nonexistence}

                            +
                            + + + + + + + + + + + + + + + + + + +
                            {lang magics_name}{lang magics_dateline_receive}{lang magics_amount_receive}{lang magics_target_receive}
                            $log['name']$log['dateline']$log['amount']$log['username']
                            +
                            $multipage
                            + +
                            +

                            {lang data_nonexistence}

                            +
                            + + +
                            \ No newline at end of file diff --git a/template/default/touch/home/space_magic_mybox.htm b/template/default/touch/home/space_magic_mybox.htm new file mode 100644 index 0000000..0274305 --- /dev/null +++ b/template/default/touch/home/space_magic_mybox.htm @@ -0,0 +1,40 @@ + + +

                            {lang magics_capacity}: $totalweight/{$_G['group']['maxmagicsweight']}

                            + + + + +
                            $multipage
                            + +
                            +

                            {lang data_nonexistence}

                            +
                            + diff --git a/template/default/touch/home/space_magic_mybox_opreation.htm b/template/default/touch/home/space_magic_mybox_opreation.htm new file mode 100644 index 0000000..5b2487f --- /dev/null +++ b/template/default/touch/home/space_magic_mybox_opreation.htm @@ -0,0 +1,100 @@ + + +
                            +
                            +
                            + + $magic['name'] +

                            $magic['name']

                            +
                            +

                            $magic['description']

                            +
                            +
                            +
                            + + + + + +
                              + +
                            • + {lang magics_target_present} +
                              + +
                              +
                            • + +
                            • + {lang magics_num} +
                              + +
                              +
                            • +
                            + + +
                              +

                              + {lang magics_outofperoid_1}{lang magics_outofperoid_2}{lang magics_outofperoid_3}{lang magics_outofperoid_4}{lang magics_outofperoid_value}{lang magics_outofperoid_noperm} +

                              +
                            + + + + + + + + +
                              +
                            • + {lang magics_operation_sell} +
                              + +
                              + {lang magics_unit}"$magic['name']" +
                            • +

                              + {lang recycling_prices}: + + {$_G['setting']['extcredits'][$magic['credit']]['title']} $discountprice {$_G['setting']['extcredits'][$magic['credit']]['unit']}/{lang magics_unit} + + $discountprice {$_G['setting']['extcredits'][$magic['credit']]['title']}/{lang magics_unit} + +

                              +
                            + + +
                              +
                            • + {lang magics_operation_drop} +
                              + +
                              + {lang magics_weight}"$magic['name']" +
                            • +

                              + {lang magics_weight}: $magic['weight'] +

                              +
                            + + +
                            + +
                            + + + + + + + + + +
                            +
                            +
                            + + + \ No newline at end of file diff --git a/template/default/touch/home/space_magic_shop.htm b/template/default/touch/home/space_magic_shop.htm new file mode 100644 index 0000000..81ac50e --- /dev/null +++ b/template/default/touch/home/space_magic_shop.htm @@ -0,0 +1,61 @@ + +
                            + + {lang magics_capacity}: $totalweight/{$_G['group']['maxmagicsweight']}
                            + + + {lang magics_discount} + {lang you_have_now} + + + , {$_G['setting']['extcredits'][$id]['img']} {$_G['setting']['extcredits'][$id]['title']} {$_G['setting']['extcredits'][$id]['unit']} + + + + +
                            + +
                              + +
                            • +
                              +
                              + $magic['name'] +
                              +

                              $magic['name']

                              +

                              + + {$_G['setting']['extcredits'][$magic['credit']]['title']} $magic['price'] {$_G['setting']['extcredits'][$magic['credit']]['unit']}/{lang magics_unit} + + $magic['price'] {$_G['setting']['extcredits'][$magic['credit']]['title']}/{lang magics_unit} + + ({lang sold} $magic['salevolume'] {lang magics_unit}) +

                              + +

                              + + {lang magics_operation_buy} + + {lang magics_operation_present} + + + {lang magic_empty} + +

                              +
                              +
                            • + +
                            +
                            $multipage
                            + +
                            +

                            {lang data_nonexistence}

                            +
                            + \ No newline at end of file diff --git a/template/default/touch/home/space_magic_shop_opreation.htm b/template/default/touch/home/space_magic_shop_opreation.htm new file mode 100644 index 0000000..180c5e5 --- /dev/null +++ b/template/default/touch/home/space_magic_shop_opreation.htm @@ -0,0 +1,156 @@ + + + +
                            +
                            +
                            + + $magic['name'] +

                            $magic['name']

                            +
                            +

                            $magic['description']

                            +
                            + +
                            +
                            + + + + + + + + + +
                              +
                            • + {lang magics_price} +
                              + $magic[price] {$_G['setting']['extcredits'][$magic['credit']]['unit']} {$_G['setting']['extcredits'][$magic['credit']]['title']} +
                              +
                            • + +
                            • + {lang magics_discountprice} +
                              + $magic[discountprice] $_G['setting']['extcredits'][$magic['credit']]['unit'] {$_G['setting']['extcredits'][$magic['credit']]['title']} +
                              +
                            • + +
                            • + {lang magics_yourcredit} +
                              + {$_G['setting']['extcredits'][$magic['credit']]['unit']} +
                              +
                            • +
                            • + {lang magics_weight} +
                              + $magic[weight] +
                              +
                            • +
                            • + {lang my_magic_volume} +
                              + $allowweight +
                              +
                            • +
                            • + {lang stock} +
                              + $magic[num] {lang magics_unit} +
                              +
                            • + +

                              + {lang magics_outofperoid_1}{lang magics_outofperoid_2}{lang magics_outofperoid_3}{lang magics_outofperoid_4}{lang magics_outofperoid_value}{lang magics_outofperoid_noperm} +

                              + + +

                              + {lang magics_permission_no} +

                              + +
                            • + {lang memcp_usergroups_buy} +
                              + +
                              + {lang magics_unit} +
                            • +
                            + + +
                              +
                            • + {lang magics_target_present} +
                              + +
                              +
                            • +
                            • + {lang magics_num} +
                              + +
                              +
                            • +
                            + + +
                            +
                            +
                            + + + + + +
                            +
                            +
                            + + + + \ No newline at end of file diff --git a/template/default/touch/home/space_medal.htm b/template/default/touch/home/space_medal.htm new file mode 100644 index 0000000..75fe802 --- /dev/null +++ b/template/default/touch/home/space_medal.htm @@ -0,0 +1,178 @@ + +
                            +
                            +

                            {lang medals}

                            +
                            + + + + +
                            + + + +
                            + {lang you_have_now} + + + , {$_G['setting']['extcredits'][$id]['img']} {$_G['setting']['extcredits'][$id]['title']} {$_G['setting']['extcredits'][$id]['unit']} + + +
                            + +
                              + +
                            • +
                              +
                              + $medal['name'] +
                              +
                              +

                              $medal['name']

                              + + + {lang expire} $medal['expiration'] {lang days}, + + + $medal['permission'] + + + {lang medals_type_0} + + + + {$_G['setting']['extcredits'][$medal['credit']]['title']} $medal['price'] {$_G['setting']['extcredits'][$medal['credit']]['unit']} + + $medal['price'] {$_G['setting']['extcredits'][$medal['credit']]['title']} + + + {lang medals_type_1} + + + {lang medals_type_2} + + + +
                              +
                              + + + {lang space_medal_have} + + + + + + + {lang space_medal_purchased} + + + {lang space_medal_applied} + + {lang space_medal_receive} + + + + + + + {lang space_medal_buy} + + + {lang medals_apply} + + {lang medals_draw} + + + + + + +
                              +
                              +
                              +

                              $medal['description']

                              +
                              +
                            • + +
                            + + +
                            +

                            {lang medals_nonexistence}

                            +
                            + +
                            +

                            {lang medals_noavailable}

                            +
                            + + + + +
                            +
                            +
                            {lang medals_record}
                            +
                            + + + + + +
                              + +
                            • +
                              +
                              $mymedal['name']
                              +

                              $mymedal['name']

                              +
                              +
                            • + +
                            + + + +
                            +
                            {lang medals_record}
                            +
                            +
                            +
                              + +
                            • + + {lang medals_message3} $medallog['dateline'] {lang medals_message4} $medallog['name'] {lang medals},{lang medals_operation_2}{lang medals_operation_3} + + {lang medals_message3} $medallog['dateline'] {lang medals_message5} $medallog['name'] {lang medals},{lang expire}: $medallog['expiration']{lang medals_noexpire} + +
                            • + +
                            +
                            +
                            $multipage
                            + +
                            +

                            {lang medals_nonexistence_own}

                            +
                            + + +
                            + + \ No newline at end of file diff --git a/template/default/touch/home/space_medal_float.htm b/template/default/touch/home/space_medal_float.htm new file mode 100644 index 0000000..c553d17 --- /dev/null +++ b/template/default/touch/home/space_medal_float.htm @@ -0,0 +1,62 @@ + +
                            +
                            + + + + + +
                            + + $medal['name'] +

                            $medal['name']

                            +
                            +

                            $medal['description']

                            +
                            +
                            +

                            + + {lang expire} $medal['expiration'] {lang days}
                            + + + $medal['permission']
                            + + + {lang medals_type_0} + + + + {$_G['setting']['extcredits'][$medal['credit']]['title']} $medal['price'] {$_G['setting']['extcredits'][$medal['credit']]['unit']} + + $medal['price'] {$_G['setting']['extcredits'][$medal['credit']]['title']} + + + {lang medals_type_1} + + + {lang medals_type_2} + +

                            +
                            + +
                            + + + +
                            +
                            +
                            + + \ No newline at end of file diff --git a/template/default/touch/home/space_notice.htm b/template/default/touch/home/space_notice.htm new file mode 100644 index 0000000..9b1aa5d --- /dev/null +++ b/template/default/touch/home/space_notice.htm @@ -0,0 +1,44 @@ + + +
                            +
                            +

                            {lang remind}

                            +
                            +
                            + + +
                            + +

                            {lang no_new_notice}{lang view_old_notice}

                            + +

                            {lang no_notice}

                            + +
                            + + +
                            +
                              + +
                            • + systempm +

                              + {lang shield} + +

                              +

                              $value['note']

                              + +

                              {lang ignore_same_notice_message}

                              + +
                            • + +
                            +
                            + + + +
                            $multi
                            + + \ No newline at end of file diff --git a/template/default/touch/home/space_pm.htm b/template/default/touch/home/space_pm.htm new file mode 100644 index 0000000..c2eeab7 --- /dev/null +++ b/template/default/touch/home/space_pm.htm @@ -0,0 +1,83 @@ + + + + +
                            +
                            +

                            {lang mypm}

                            +
                            +
                            + + + + +
                            +
                            +

                            {if $chatpmmember}{lang viewmypm}{else}{lang taking_with_user}{/if}

                            +
                            +
                            +
                            + +
                            +

                            {lang no_corresponding_pm}

                            +
                            + + + + + $multi + +
                            + + + + + + +
                            +
                            + + +
                            +
                            + + + +
                            +
                            +

                            {lang user_mobile_pm_error}

                            +
                            +
                            + + diff --git a/template/default/touch/home/space_pm_node.htm b/template/default/touch/home/space_pm_node.htm new file mode 100644 index 0000000..e2b1c3c --- /dev/null +++ b/template/default/touch/home/space_pm_node.htm @@ -0,0 +1,17 @@ + +
                            +
                            +
                            +
                            $value['message']
                            +
                            +
                            +
                            + +
                            +
                            +
                            +
                            $value['message']
                            +
                            +
                            +
                            + \ No newline at end of file diff --git a/template/default/touch/home/space_profile.htm b/template/default/touch/home/space_profile.htm new file mode 100644 index 0000000..ee6d9c8 --- /dev/null +++ b/template/default/touch/home/space_profile.htm @@ -0,0 +1,127 @@ + + + + + + + + +
                            +
                            +

                            {lang myprofile}$space['username']{lang otherprofile}

                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            $space['username']

                            +
                            +
                            +
                            +
                              +
                            • $space['credits']{lang credits}
                            • + + +
                            • {$space["extcredits$key"]} $value['unit']$value['title']
                            • + + +
                            +
                            + + + + + + + + + + + + +
                            +
                              +
                            • {lang personal_signature}
                            • +
                            • $space['sightml']
                            • +
                            +
                            + +
                            +
                              + +
                            • {lang memcp_profile}{lang setup}{lang online}
                            • +
                            • UID{$space['uid']}
                            • +
                            • {lang usergroup}{lang group_useful_life}{$space['group']['grouptitle']}
                            • +
                            • {lang management_team}{$space['admingroup']['grouptitle']}
                            • +
                            • {lang group_expiry_type_ext}$space['extgroupids']
                            • + +
                            • $value['title']$value['value']
                            • + +
                            • Email$space['email']
                            • +
                            • {lang spacenote}$space['spacenote']
                            • +
                            • {lang permission_basic_status}$space['customstatus']
                            • +
                            • {lang online_time}$space['oltime'] {lang hours}
                            • +
                            • {lang regdate}$space['regdate']
                            • +
                            • {lang last_visit}$space['lastvisit']
                            • + +
                            +
                            + + + + + + + +
                            + + \ No newline at end of file diff --git a/template/default/touch/home/space_share_form.htm b/template/default/touch/home/space_share_form.htm new file mode 100644 index 0000000..55605d1 --- /dev/null +++ b/template/default/touch/home/space_share_form.htm @@ -0,0 +1,21 @@ +
                            +

                            {lang share_web_music_flash}

                            +

                            + + +

                            + + + + + + + +
                            \ No newline at end of file diff --git a/template/default/touch/home/space_share_li.htm b/template/default/touch/home/space_share_li.htm new file mode 100644 index 0000000..5ebe721 --- /dev/null +++ b/template/default/touch/home/space_share_li.htm @@ -0,0 +1,42 @@ +
                          • +
                            +
                            + + {lang sharemetoo} + | + + + + {lang delete} + +
                            + $value[username] + $value[title_template] + ({lang moderate_need}) + +
                            +
                            + + + +
                            + $value[body_template] +
                            + + + {$value['body_data']['player']} + + + + {$value['body_data']['player']} + + + + {$value['body_data']['player']} + + + +
                            $value[body_general]
                            + +
                            +
                          • \ No newline at end of file diff --git a/template/default/touch/home/space_share_list.htm b/template/default/touch/home/space_share_list.htm new file mode 100644 index 0000000..e5bd02d --- /dev/null +++ b/template/default/touch/home/space_share_list.htm @@ -0,0 +1,65 @@ + + +
                            +
                            +

                            {lang share}

                            +
                            +
                            + +
                            + + +
                            + + + + +

                            + {lang order_by_type}: + {lang share_all}| + {lang share_link}| + {lang share_video}| + {lang share_music}| + {lang share_flash}| + + {lang share_blog}| + + + {lang share_album}| + {lang share_pic}| + + {lang share_poll}| + {lang share_space}| + {lang share_thread} + + | + {lang share_article} + +

                            + +
                              + + + +
                            + +

                            {lang hide_share}

                            + +
                            $multi
                            + +
                              +

                              {lang not_share_yet}

                              + +
                              + + + + \ No newline at end of file diff --git a/template/default/touch/home/space_task.htm b/template/default/touch/home/space_task.htm new file mode 100644 index 0000000..6af4119 --- /dev/null +++ b/template/default/touch/home/space_task.htm @@ -0,0 +1,22 @@ + + +
                              +
                              +

                              {lang task}

                              +
                              + + + +
                              + + + + + +
                              + \ No newline at end of file diff --git a/template/default/touch/home/space_task_detail.htm b/template/default/touch/home/space_task_detail.htm new file mode 100644 index 0000000..e43b2f8 --- /dev/null +++ b/template/default/touch/home/space_task_detail.htm @@ -0,0 +1,133 @@ + +
                              +
                              +
                              $task['name']
                              +
                              +
                              $task['name']
                              + + + + ( {lang task_period_hour} ) + + ( {lang task_period_day} ) + + + ( {lang task_period_week} ) + + ( {lang task_period_month} ) + + + +
                              $task['description']
                              +
                              +
                              +
                              +
                              + +
                              + {lang task_require} +

                              $task['viewmessage']

                              +
                              + +
                              + {lang task_complete_condition} + +
                                + +
                              • $taskvar['name'] : $taskvar['value']
                              • + +
                              + +

                              + {lang unlimited} +

                              + +
                              + +
                              + {lang task_reward} +

                              + + $_G['setting']['extcredits'][$task['prize']]['title'] $task['bonus'] $_G['setting']['extcredits'][$task['prize']]['unit'] + + {lang magics_title} $task['rewardtext'] $task['bonus'] {lang magics_unit} + + {lang medals} $task['rewardtext'] {lang expire} $task['bonus'] {lang days} + + {lang invite_code} $task['prize'] {lang expire} $task['bonus'] {lang days} + + {lang usergroup} $task['rewardtext'] $task['bonus'] {lang days} + + {lang nothing} + +

                              +
                              +
                              + {lang task_apply_condition} + +
                                +
                              • {lang usergroup}: $task['grouprequired'] {lang task_general_users}{lang task_admins}
                              • +
                              • {lang task_relatedtask}: $_G['taskrequired']
                              • +
                              • {lang task_numlimit}: $task['tasklimits']
                              • + + +
                              • $taskvar['name']: $taskvar['value']
                              • + + +
                              + +

                              + {lang unlimited} +

                              + +
                              +
                              +
                              + +
                              +
                              +
                              +
                              {lang task_complete} $task['csc']%
                              +
                              +
                              +

                              + {lang task_reward_get} + {lang task_quit} +

                              + +

                              {lang task_group_nopermission}

                              + {lang task_newbie_apply} + +

                              {lang task_applies_full}

                              + {lang task_newbie_apply} + +

                              {lang task_lose_on}$task['dateline']

                              + +

                              {lang task_complete_on}$task['dateline']

                              + +

                              {lang task_complete_on}$task['dateline']   {$task['t']}{lang task_applyagain}

                              + {lang task_newbie_apply} + +

                              {lang task_lose_on}$task['dateline']   {$task['t']}{lang task_reapply}

                              + {lang task_newbie_apply} + +

                              {lang task_complete_on}$task['dateline']   {lang task_applyagain_now}

                              + +

                              {lang task_lose_on}$task['dateline']   {lang task_reapply_now}

                              + + + + {lang task_newbie_apply} + +
                              +
                              +
                              + +
                              +
                              + +
                              {lang task_applicants}
                              +
                              + +
                              + diff --git a/template/default/touch/home/space_task_list.htm b/template/default/touch/home/space_task_list.htm new file mode 100644 index 0000000..f7be1e9 --- /dev/null +++ b/template/default/touch/home/space_task_list.htm @@ -0,0 +1,65 @@ + + + +
                                + +
                              • +
                                +
                                + $task['name'] +
                                +
                                +

                                $task['name']

                                + + + {lang credits} $_G['setting']['extcredits'][$task['prize']]['title'] $task['bonus'] $_G['setting']['extcredits'][$task['prize']]['unit'] + + {lang magics_title} $listdata[$task['prize']] $task['bonus'] {lang magics_unit} + + {lang medals} $listdata[$task['prize']] {lang expire} $task['bonus'] {lang days} + + {lang invite_code} $task['prize'] {lang expire} $task['bonus'] {lang days} + + {lang usergroup} $listdata[$task['prize']] $task['bonus'] {lang days} + + +
                                +
                                + + + {lang task_newbie_apply} + + {lang task_newbie_apply} + + {lang task_newbie_apply} + + + {lang task_reward_get} + + {lang task_complete_on} $task['dateline'] +
                                {lang task_applyagain_now}{$task['t']}{lang task_applyagain}
                                + + {lang task_lose_on} $task['dateline'] +
                                {lang task_applyagain_now}{$task['t']}{lang task_reapply}
                                + +
                                +
                                +
                                +

                                $task['description']

                                +
                                + +
                                +
                                +
                                +
                                {lang task_complete} $task['csc']%
                                +
                                +
                                + +
                              • + +
                              + +
                              +

                              {lang task_nonew}{lang task_nodoing}{lang data_nonexistence}

                              +
                              + diff --git a/template/default/touch/home/space_task_parter.htm b/template/default/touch/home/space_task_parter.htm new file mode 100644 index 0000000..33c5846 --- /dev/null +++ b/template/default/touch/home/space_task_parter.htm @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/template/default/touch/home/space_thread.htm b/template/default/touch/home/space_thread.htm new file mode 100644 index 0000000..2a31ae7 --- /dev/null +++ b/template/default/touch/home/space_thread.htm @@ -0,0 +1,96 @@ + +
                              +
                              +

                              + + {lang my}{lang reply}{lang my}{lang post_comment}{lang mythread} + + {$space['username']} - {lang mobta}{lang reply}{lang mobta}{lang post_comment}{lang mobta}{lang mobthread} + +

                              +
                              +
                              + + + + +$multi + + \ No newline at end of file diff --git a/template/default/touch/home/space_trade.htm b/template/default/touch/home/space_trade.htm new file mode 100644 index 0000000..764ad32 --- /dev/null +++ b/template/default/touch/home/space_trade.htm @@ -0,0 +1,236 @@ + + + + + + + + +
                              +
                              +

                              {lang trade}

                              +
                              +
                              + + + + + + + + + + + + +
                              + +
                              + +
                              + +
                                +
                              • +
                                {lang view_by_friend}
                                +
                                + +
                                +
                              • +
                              + + + +
                                +
                              • +
                                + +
                                +
                              • +
                              + + + + + + +
                                + +
                              • +
                                +
                                +
                                +
                                +

                                $value['subject']

                                +

                                $value['seller']

                                + +

                                - {lang trade_closing} -

                                + +

                                + + ¥ $value['price'] + + + {lang additional} $value[credit] {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}{$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} + +

                                + +
                                +
                              • + + + +
                              •  
                              • + + +
                              + +

                              {lang no_trade}

                              + + + + +

                              {lang hide_trade}

                              + +
                              $multi
                              + +
                              + + + \ No newline at end of file diff --git a/template/default/touch/home/space_wall.htm b/template/default/touch/home/space_wall.htm new file mode 100644 index 0000000..28b1276 --- /dev/null +++ b/template/default/touch/home/space_wall.htm @@ -0,0 +1,87 @@ + + +
                              +
                              +

                              {lang message}

                              +
                              +
                              + +
                              +
                              + +
                              +
                              +
                              + + + +
                              {lang connect_fill_profile_to_comment}
                              + + + +
                              +
                              +
                              + +
                              +
                              +
                              +

                              + + + + + + + +

                              + +
                              + +
                              + +
                              + {lang view_one_operation_message},{lang click_view_message} +
                              + +
                                + + + +
                              +
                              $multi
                              +
                              + +
                              +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_album.htm b/template/default/touch/home/spacecp_album.htm new file mode 100644 index 0000000..b367975 --- /dev/null +++ b/template/default/touch/home/spacecp_album.htm @@ -0,0 +1,242 @@ + + + + + + +
                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              {lang site_categories} + $categoryselect + ({lang select_site_album_categories}) +
                              {lang privacy_settings} + +
                              {lang password}
                              {lang specified_friends} + +

                              {lang choices_following_friends_list}

                              +
                                + +

                              {lang friend_name_space}

                              +
                                + + + +
                               {lang delete_album}
                              + +
                              + + + + +
                              + + + + + + + + + + + + + +
                              {lang album_cover_notice}
                              + + + +

                              {lang set_to_conver}

                              +
                              + + + + + + + + + +

                              {lang delete_pic_notice}

                              +
                              + + + +
                              +
                              $multi
                              + + +
                              {lang no_pics}
                              + + + +
                              +
                              + + + + + +
                              +
                                +
                              • + {lang the_album_pic} +
                                + +
                                + +
                              • +
                              +
                              +
                              + +
                              +
                              +
                              + +

                              + {lang edit_description} + {lang close} +

                              +
                              + + + + +
                              + +
                              +

                              + +

                              +
                              + + +

                              + {lang adjust_hot} + {lang close} +

                              +
                              + + + +
                              + {lang new_hot}: +
                              +

                              + +

                              +
                              + +

                              + {lang save_to_album} + {lang close} +

                              +
                              + + + + + +
                              + {lang save_to}: +
                              +

                              + +

                              +
                              + + + + diff --git a/template/default/touch/home/spacecp_avatar.htm b/template/default/touch/home/spacecp_avatar.htm new file mode 100644 index 0000000..04c2c4d --- /dev/null +++ b/template/default/touch/home/spacecp_avatar.htm @@ -0,0 +1,55 @@ + + +
                              + + +
                              + {lang setting_avatar_message} +
                              +
                              + + +
                              + +
                              +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_avatar_body.htm b/template/default/touch/home/spacecp_avatar_body.htm new file mode 100644 index 0000000..ae10163 --- /dev/null +++ b/template/default/touch/home/spacecp_avatar_body.htm @@ -0,0 +1,43 @@ +
                              +
                              + +
                              +
                              +
                              + +
                              +
                              +
                              +
                              + + +
                              + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              + +
                              + + + +
                              + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_blog.htm b/template/default/touch/home/spacecp_blog.htm new file mode 100644 index 0000000..b84d579 --- /dev/null +++ b/template/default/touch/home/spacecp_blog.htm @@ -0,0 +1,186 @@ + + + +
                              +
                              {lang delete_blog}
                              +
                              {lang sure_delete_blog}?
                              +
                              + + + +
                              + + {lang close} +
                              +
                              +
                              + +
                              +
                              {lang stick_blog}{lang cancel_stick_blog}
                              +
                              {lang sure_stick_blog}{lang sure_cancel_stick_blog}?
                              +
                              + + + + +
                              + + {lang close} +
                              +
                              +
                              + +

                              + {lang create_category} + {lang close} +

                              +
                              +

                              +
                              +

                              + +

                              + + + +

                              + {lang adjust_hot} + {lang close} +

                              +
                              + + + +
                              + {lang new_hot}: +
                              +

                              + +

                              +
                              + +
                              +
                              +

                              {lang edit_blog}{lang memcp_blog}

                              +
                              + +
                              + + + +
                              + +
                                +
                              • + +
                              • +
                              • + +
                              • + +
                                + +
                              • + {lang select_site_blog_categories} +
                              • +
                              • + $categoryselect +
                              • + +
                              • + +
                              • +
                              • + +
                              • + +
                              • + +
                              • + + +
                              • + +
                              • + + + + + +
                              +
                              + +
                              +
                              +
                              + +
                              +
                              +
                              +
                              + + + +
                              +
                              +
                              +
                              + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_comment.htm b/template/default/touch/home/spacecp_comment.htm new file mode 100644 index 0000000..1b785f7 --- /dev/null +++ b/template/default/touch/home/spacecp_comment.htm @@ -0,0 +1,81 @@ + + + +
                              +
                              +
                              + + + + +
                              + +
                              +
                              + + {lang cancel} +
                              +
                              +
                              +
                              + + + +
                              +
                              + + + + +
                              +

                              {lang delete_reply_message}

                              +
                              +
                              + + {lang cancel} +
                              +
                              +
                              + + +
                              +
                              + + + + + + + +
                              + +
                              +
                              + + {lang cancel} +
                              +
                              +
                              + + + + + diff --git a/template/default/touch/home/spacecp_common.htm b/template/default/touch/home/spacecp_common.htm new file mode 100644 index 0000000..a6f6475 --- /dev/null +++ b/template/default/touch/home/spacecp_common.htm @@ -0,0 +1,30 @@ + +
                              + +
                              + + + + +
                              +

                              {lang no_view_notice_next}{lang bid_single_price}

                              +

                              +

                              +
                              +
                              {lang cancel}
                              +
                              + +
                              + + + + +
                              +

                              {lang modify_unitprice_note}

                              +

                              +
                              +
                              {lang cancel}
                              +
                              + +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_credit_base.htm b/template/default/touch/home/spacecp_credit_base.htm new file mode 100644 index 0000000..0937103 --- /dev/null +++ b/template/default/touch/home/spacecp_credit_base.htm @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_credit_buy.htm b/template/default/touch/home/spacecp_credit_buy.htm new file mode 100644 index 0000000..f41f403 --- /dev/null +++ b/template/default/touch/home/spacecp_credit_buy.htm @@ -0,0 +1,79 @@ + + + + + + + + +
                              style="display:none"> + + + +
                              +
                                +
                              • + + {$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
                              • +
                              +
                              +
                              + {lang memcp_credits_addfunds_rules_ratio} = $_G[setting][ec_ratio] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
                              {lang memcp_credits_addfunds_rules_min} $_G[setting][ec_mincredits] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
                              {lang memcp_credits_addfunds_rules_max} $_G[setting][ec_maxcredits] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
                              {lang memcp_credits_addfunds_rules_month} $_G[setting][ec_maxcreditspermonth] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} +
                              +
                              + +
                              +
                              + + + +
                              style="display:none"> + + + +
                              +
                                +
                              • + +
                              • +
                              + +
                                + +
                              + +
                              +
                              + +
                              +
                              + + + + +
                              \ No newline at end of file diff --git a/template/default/touch/home/spacecp_credit_exchange.htm b/template/default/touch/home/spacecp_credit_exchange.htm new file mode 100644 index 0000000..9e4b67b --- /dev/null +++ b/template/default/touch/home/spacecp_credit_exchange.htm @@ -0,0 +1,129 @@ + + + + +
                              + + + + +
                              +
                                +
                              • +
                                {lang memcp_credits_exchange} 
                                +
                                +
                                + +
                                +
                              • +
                              • +
                                {lang credits_need} 
                                +
                                +
                                + + + + + + +
                                +
                              • +
                              • + +
                              • +
                              +
                              +
                              + + {lang memcp_credits_exchange_min_balance} $_G[setting][exchangemincredits]
                              + + + + {lang credits_tax} $taxpercent + + +
                              +
                              + +
                              +
                              + + + + +
                              \ No newline at end of file diff --git a/template/default/touch/home/spacecp_credit_header.htm b/template/default/touch/home/spacecp_credit_header.htm new file mode 100644 index 0000000..5c8109e --- /dev/null +++ b/template/default/touch/home/spacecp_credit_header.htm @@ -0,0 +1,21 @@ + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_credit_log.htm b/template/default/touch/home/spacecp_credit_log.htm new file mode 100644 index 0000000..c4e625d --- /dev/null +++ b/template/default/touch/home/spacecp_credit_log.htm @@ -0,0 +1,42 @@ + + + + + +
                              +
                                + + +
                              • +

                                + + + $value['optype'] + + $value['title'] + + + {$value['credit']} +

                                +

                                + + + $value['opinfo'] + + $value['text'] + + + $value['dateline'] +

                                +
                              • + +
                              +
                              $multi
                              +
                              + +
                              +

                              {lang doing_no_replay}

                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_credit_rule.htm b/template/default/touch/home/spacecp_credit_rule.htm new file mode 100644 index 0000000..97feafb --- /dev/null +++ b/template/default/touch/home/spacecp_credit_rule.htm @@ -0,0 +1,47 @@ + + + +{eval + $_TPL['cycletype'] = array( + '0' => '{lang one_time}', + '1' => '{lang everyday}', + '2' => '{lang the_time}', + '3' => '{lang interval_minutes}', + '4' => '{lang open_cycle}' + ); +} +
                              +
                                +
                              • + +
                              • +
                              +
                              +
                              +

                              {lang activity_award_message}

                              +
                              + + + + + + + + + + + + + + + + + + + + + + +
                              {lang action_name}{lang cycle_range}{lang max_award_per_week}$value[title]
                              $value[rulename]$_TPL[cycletype][$value[cycletype]]$value[rewardnum]{lang unlimited_time}+$value[$creditkey]$value[$creditkey]0
                              + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_credit_transfer.htm b/template/default/touch/home/spacecp_credit_transfer.htm new file mode 100644 index 0000000..47915f4 --- /dev/null +++ b/template/default/touch/home/spacecp_credit_transfer.htm @@ -0,0 +1,39 @@ + + + + +
                              + + + +
                              +
                                +
                              • +
                                {lang memcp_credits_transfer} 
                                +
                                + {$_G[setting][extcredits][$_G[setting][creditstransextra][9]][title]} +
                              • +
                              • +
                                {lang credits_give} 
                                +
                                +
                              • +
                              • + +
                              • +
                              • + +
                              • +
                              +
                              +
                              + {lang memcp_credits_transfer_min_balance} $_G[setting][transfermincredits] {$_G[setting][extcredits][$_G[setting][creditstransextra][9]][unit]}
                              + {lang credits_tax} $taxpercent +
                              +
                              + + +
                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_doing.htm b/template/default/touch/home/spacecp_doing.htm new file mode 100644 index 0000000..cb94c86 --- /dev/null +++ b/template/default/touch/home/spacecp_doing.htm @@ -0,0 +1,46 @@ + + + +
                              +
                              + + + +
                              +

                              {lang determine_delete_doing}

                              +
                              +
                              {lang cancel}
                              +
                              +
                              + + $space['spacenote'] + + +
                              +
                              +
                              + + +
                              + +
                              +
                              {lang cancel}
                              +
                              + +
                              +
                              + + + + + + +
                              + + + +
                              + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_ec_explain.htm b/template/default/touch/home/spacecp_ec_explain.htm new file mode 100644 index 0000000..dc7550c --- /dev/null +++ b/template/default/touch/home/spacecp_ec_explain.htm @@ -0,0 +1,16 @@ + +
                              +

                              {lang eccredit_needexplanation}

                              +
                              +
                              + + + +
                              +
                              + + +
                              +
                              +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_ec_list.htm b/template/default/touch/home/spacecp_ec_list.htm new file mode 100644 index 0000000..3edbb13 --- /dev/null +++ b/template/default/touch/home/spacecp_ec_list.htm @@ -0,0 +1,89 @@ + + + + +
                                + +
                              • +
                                + + {lang eccredit_good} + + {lang eccredit_soso} + + {lang eccredit_bad} + +
                                +
                                $comment['dateline']
                                +
                              • +
                              • + +
                                + + + {lang trade_buyer}: {lang trade_seller}: $comment['ratee'] + + {lang trade_seller}: {lang trade_buyer}: $comment['rater'] + + +
                                +
                              • +
                              • +
                                + {lang eccredit_tradeprice}: + + $comment['price'] {lang trade_units} + + + {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['title']} $comment['credit'] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][5]]['unit']} + +
                                +
                              • +
                              • +
                                $comment['message']
                                [ {lang eccredit_needexplanation} ]({lang eccredit_explanationexpiration})
                                +
                              • + +
                              • +
                                + {lang eccredit_explanation}: $comment['explanation'] +
                                +
                              • + + +
                              + +

                              {lang eccredit_nofound}

                              + +
                              $multipage
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_ec_rate.htm b/template/default/touch/home/spacecp_ec_rate.htm new file mode 100644 index 0000000..544b43f --- /dev/null +++ b/template/default/touch/home/spacecp_ec_rate.htm @@ -0,0 +1,41 @@ + +
                              +

                              {lang eccredit}

                              +
                              + + +
                                +
                              • +
                                {lang eccredit_retee}
                                + +
                              • +
                              • +
                                {lang eccredit_tradegoods}
                                + +
                              • +
                              • +
                                {lang rate}
                                +
                                + + + +
                                +
                              • +
                              +
                              + +
                              +
                              + + + +
                              +
                              +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_favorite.htm b/template/default/touch/home/spacecp_favorite.htm new file mode 100644 index 0000000..346395a --- /dev/null +++ b/template/default/touch/home/spacecp_favorite.htm @@ -0,0 +1,23 @@ + +
                              + +
                              + + + +
                              {lang delete_favorite_message}
                              +
                              {lang cancel}
                              +
                              + +
                              + + + +
                              + +
                              +
                              {lang cancel}
                              +
                              + +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_follow.htm b/template/default/touch/home/spacecp_follow.htm new file mode 100644 index 0000000..f7af504 --- /dev/null +++ b/template/default/touch/home/spacecp_follow.htm @@ -0,0 +1,128 @@ + + + +

                              + {lang follow_for}$followuser['fusername']{lang follow_add_bkname} + {lang close} +

                              + +
                              + + + + +
                              + + + + + +
                              {lang follow_editnote}: +
                              +
                              +

                              + +

                              +
                              + + + + +
                              +

                               {lang follow_reply}

                              +
                              + + + + + +
                                +
                                + +
                                + +
                              • +
                                +
                                +
                              • + + +
                              + +
                              +
                              + +
                              +
                              +
                              + + + + +
                              + +
                              + + + +
                              + + +
                              +
                              + +
                              + +
                              + +
                              + +
                              +
                              + +
                              +
                              + + + + + + + + false + + +
                              +
                              + + + + +
                              +

                              {lang follow_del_feed_confirm}

                              +
                              +
                              + + {lang cancel} +
                              +
                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_footer.htm b/template/default/touch/home/spacecp_footer.htm new file mode 100644 index 0000000..06fffbb --- /dev/null +++ b/template/default/touch/home/spacecp_footer.htm @@ -0,0 +1,22 @@ +
                            • {lang memcp_avatar}
                            • +
                            • {lang memcp_profile}
                            • + +
                            • {lang memcp_verify}
                            • + +
                            • {lang memcp_credit}
                            • + +
                            • {lang memcp_payment}
                            • + +
                            • {lang memcp_usergroup}
                            • +
                            • {lang memcp_privacy}
                            • + +
                            • {lang memcp_sendmail}
                            • +
                            • {lang password_security}
                            • + +
                            • {lang memcp_promotion}
                            • + + + +
                            • $module[name]
                            • + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_friend.htm b/template/default/touch/home/spacecp_friend.htm new file mode 100644 index 0000000..b3bb146 --- /dev/null +++ b/template/default/touch/home/spacecp_friend.htm @@ -0,0 +1,361 @@ + + +
                              + + + + + +
                              +
                              {lang determine_lgnore_friend}
                              +
                              {lang cancel}
                              +
                              +
                              + + + + + +
                              +
                              +

                              {lang friend_hot}

                              +
                              +
                              + +
                              + + + +
                              +
                              {lang adjust_friend_hot}
                              +
                              {lang new_hot}:
                              ({lang num_0_999})
                              +
                              +
                              +
                              + + + + +
                              +
                              +

                              {lang set_friend_group}

                              +
                              +
                              + +
                              + + + + +
                              +
                              + + +
                            • + + + +
                              +
                              + +
                              +
                              +
                              + + + + +
                              +
                              +

                              {lang friend_note}

                              +
                              +
                              + +
                              + + + + +
                              +
                              {lang friend_note_message}
                              + +
                              +
                              + +
                              +
                              +
                              + + + + +
                              +
                              +

                              {lang set_friend_group}

                              +
                              +
                              +
                              +
                              + +
                              +
                              + + +
                              +

                              {lang friend_group_hot_message}

                              + +
                              +
                              + +
                              +
                              + {lang set_member_group}: +   + +
                              + $multi + + +
                              + +

                              {lang no_friend_list}

                              + +
                              + + + +
                              +
                              +

                              {lang friends_group}

                              +
                              +
                              + +
                              +
                              + + + + +
                              {lang set_friend_group_name}
                              +
                              {lang new_name}:
                              +
                              + +
                              +
                              + +
                              + + + +
                              +
                              +

                              {lang set_member_feed}

                              +
                              +
                              + +
                              +
                              + + + + + +
                              {lang not_show_feed_homepage}
                              + +
                              {lang show_feed_homepage}
                              + +
                              + +
                              +
                              +
                              + + + +
                              +
                              +

                              {lang friend_request}

                              +
                              +
                              + + + +
                              $multi
                              + +

                              {lang no_new_friend_application}

                              + + + + + +
                              +
                              +

                              {lang common_friends}

                              +
                              +
                              + +
                              + + +

                              {lang max_view_15_friends}

                              + +

                              {lang you_have_common_friends}

                              + + + +

                              {lang you_have_no_common_friends}

                              + +
                              + + + +
                              +
                              +

                              {lang add_friend}

                              +
                              +
                              + +
                              + + + + +
                              +
                              +
                              + {lang add} {$tospace[username]} {lang add_friend_note}:
                              + +

                              ({lang view_note_message})

                              +

                              + {lang friend_group}: +

                              +
                              +
                              + +
                              +
                              +
                              + + + +
                              +
                              +

                              {lang approval_the_request}

                              +
                              +
                              + +
                              + + + + + +
                              + + + + + +
                              +

                              {lang approval_the_request_group}:

                              + + + + + + + +
                              +
                              + +
                              +
                              + + + $jsstr + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_header.htm b/template/default/touch/home/spacecp_header.htm new file mode 100644 index 0000000..1a9a7f6 --- /dev/null +++ b/template/default/touch/home/spacecp_header.htm @@ -0,0 +1,19 @@ +
                              +
                              +

                              +
                              +
                              + +
                              +
                              +
                              +
                                + +
                              +
                              +
                              +
                              + + + +
                              diff --git a/template/default/touch/home/spacecp_header_name.htm b/template/default/touch/home/spacecp_header_name.htm new file mode 100644 index 0000000..fb932d8 --- /dev/null +++ b/template/default/touch/home/spacecp_header_name.htm @@ -0,0 +1,29 @@ + + {lang memcp_profile} + + {lang memcp_verify} + + {lang memcp_avatar} + + + {lang memcp_credits_log} + + {lang memcp_credit}{lang home_credit_buy} + + {lang memcp_credit} + + + {lang payment_order} + + {lang memcp_usergroup} + + {lang memcp_privacy} + + {lang memcp_sendmail} + + {lang password_security} + + {lang memcp_promotion} + + {$_G['setting']['plugins'][$pluginkey][$_GET['id']]['name']} + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_magic.htm b/template/default/touch/home/spacecp_magic.htm new file mode 100644 index 0000000..89a9ed8 --- /dev/null +++ b/template/default/touch/home/spacecp_magic.htm @@ -0,0 +1,27 @@ + +
                              + +

                              {lang cancel_magics_effects}

                              +
                              + + + +
                              +

                              {lang cancel_effects_message}

                              +
                              +
                              +
                              + +

                              {lang return_redbag}

                              +
                              + + + +
                              +

                              {lang spacecp_magic_message1}({lang spacecp_magic_message2} {$leftcredit} {$credittype})

                              +
                              +
                              +
                              + +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_payment_order.htm b/template/default/touch/home/spacecp_payment_order.htm new file mode 100644 index 0000000..d3aba5d --- /dev/null +++ b/template/default/touch/home/spacecp_payment_order.htm @@ -0,0 +1,40 @@ + + + + +
                              +
                                + +
                              • +

                                + {$order['type_name']} + + {$order['amount']} + + ({$order['status_name']}) + + ({$order['status_name']}) + + +

                                +

                                + + {$order['subject']} + +
                                {$order['description']} + +
                                + {$order['dateline']} +

                                +
                              • + +
                              +
                              $multi
                              +
                              + +
                              +

                              {lang doing_no_replay}

                              +
                              + +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_payment_pay.htm b/template/default/touch/home/spacecp_payment_pay.htm new file mode 100644 index 0000000..f60d4d8 --- /dev/null +++ b/template/default/touch/home/spacecp_payment_pay.htm @@ -0,0 +1,67 @@ + + +
                              +
                              +

                              {lang payment_pay}

                              +
                              +
                              +
                              + + + + +
                              {lang payment_pay_order_info}
                              +
                              +
                              +
                              {lang payment_pay_order_id}
                              +
                              {$order['out_biz_no']}
                              +
                              +
                              +
                              {lang payment_pay_subject}
                              +
                              {$order['subject']}
                              +
                              + +
                              +
                              {lang payment_pay_description}
                              +
                              {$order['description']}
                              +
                              + +
                              +
                              {lang payment_pay_amount}
                              +
                              + {lang payment_unit_yang}{$order['amount']} + + ({$order['total_amount']}) + +
                              +
                              +
                              +
                              {lang payment_pay_type}
                              +
                              + +
                              +
                              + +
                              +
                              + checked name="pay_channel" type="radio" value="{$channel['id']}"> +
                              +
                              + +
                              + + +
                              + +
                              +
                              + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_payment_qpayjsapi.htm b/template/default/touch/home/spacecp_payment_qpayjsapi.htm new file mode 100644 index 0000000..8976286 --- /dev/null +++ b/template/default/touch/home/spacecp_payment_qpayjsapi.htm @@ -0,0 +1,29 @@ + + + + + + {$order['type_name']} + + + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_payment_redirect.htm b/template/default/touch/home/spacecp_payment_redirect.htm new file mode 100644 index 0000000..5e0f6b2 --- /dev/null +++ b/template/default/touch/home/spacecp_payment_redirect.htm @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_payment_wxjsapi.htm b/template/default/touch/home/spacecp_payment_wxjsapi.htm new file mode 100644 index 0000000..4fa7ef9 --- /dev/null +++ b/template/default/touch/home/spacecp_payment_wxjsapi.htm @@ -0,0 +1,46 @@ + + + + + {$order['type_name']} + + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_plugin.htm b/template/default/touch/home/spacecp_plugin.htm new file mode 100644 index 0000000..10e1167 --- /dev/null +++ b/template/default/touch/home/spacecp_plugin.htm @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_pm.htm b/template/default/touch/home/spacecp_pm.htm new file mode 100644 index 0000000..b7ff695 --- /dev/null +++ b/template/default/touch/home/spacecp_pm.htm @@ -0,0 +1,66 @@ + + +
                              +
                              +
                                +

                                {lang user_mobile_pm_error}

                                +
                              +
                              +
                              + +
                              + + + +
                              +
                              +

                              {lang send_pm}

                              +
                              +
                              +
                                + +
                              • + +
                              • + +
                              • +
                              +
                              +
                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_privacy.htm b/template/default/touch/home/spacecp_privacy.htm new file mode 100644 index 0000000..44ae639 --- /dev/null +++ b/template/default/touch/home/spacecp_privacy.htm @@ -0,0 +1,301 @@ + + + + + + +
                              + + + +

                              {lang you_control_see_content}

                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              {lang friend_list} + +
                              {lang message_board} + +
                              {lang personal_feed} + +
                              {lang doing} + +

                              {lang privacy_setting_message}
                              {lang site_might_your_log}

                              +
                              {lang blog} + +

                              {lang privacy_setting_message}
                              {lang view_right_setting_effective}

                              +
                              {lang album} + +

                              {lang privacy_setting_message}
                              {lang view_right_setting_effective}

                              +
                              {lang share} + +

                              {lang privacy_setting_message}
                              {lang view_right_setting_effective}

                              +
                              + + +

                              {lang system_depend_action_message}

                              + + + + + + + + + +
                                + + + + + + + + + + + + + + +
                              + + +

                              {lang you_control_other_operation}

                              + + + + + + + + + + + + + + + + + +
                              {lang add_friends} + +
                              {lang add_follow} + +
                              + + + + {eval + $iconnames['wall'] = '{lang message}'; + $iconnames['piccomment'] = '{lang pic_comment}'; + $iconnames['blogcomment'] = '{lang blog_comment}'; + $iconnames['sharecomment'] = '{lang share_comment}'; + $iconnames['magic'] = '{lang magics_title}'; + $iconnames['sharenotice'] = '{lang share_notification}'; + $iconnames['clickblog'] = '{lang blog_position}'; + $iconnames['clickpic'] = '{lang pic_position}'; + $iconnames['credit'] = '{lang credits}'; + $iconnames['doing'] = '{lang doing}'; + $iconnames['pcomment'] = '{lang topic_comment}'; + $iconnames['post'] = '{lang topic_reply}'; + $iconnames['show'] = '{lang friend_top}'; + $iconnames['task'] = '{lang task}'; + $iconnames['goods'] = '{lang trade}'; + $iconnames['group'] = $_G['setting']['navs'][3]['navname']; + $iconnames['thread'] = '{lang theme}'; + $iconnames['system'] = '{lang system}'; + $iconnames['friend'] = '{lang friends}'; + $iconnames['debate'] = '{lang debate}'; + $iconnames['album'] = '{lang album}'; + $iconnames['blog'] = '{lang blog}'; + $iconnames['poll'] = '{lang poll}'; + $iconnames['activity'] = '{lang activity}'; + $iconnames['reward'] = '{lang reward}'; + $iconnames['share'] = '{lang share}'; + $iconnames['profile'] = '{lang update_presonal_profile}'; + $iconnames['pusearticle'] = '{lang article_push}'; + } + + + + + + + + + + +
                              +

                              {lang filtering_rules_title_1}

                              +

                              {lang filtering_rules_message_1}

                              +
                                + + + +
                              + +

                              {lang list_change_friend_name} +

                              + + + + + + + + + + + + + + + + + +
                              +

                              {lang filtering_rules_title_2}

                              +

                              {lang filtering_rules_message_2}

                              +
                                + + + + +
                               {lang no_shield_feed_cat}
                              + + + + + + + + + + + + + + + + + +
                              +

                              {lang filtering_rules_title_3}

                              +

                              {lang filtering_rules_message_3}

                              +
                                + + + + +
                               {lang no_shield_feed_cat}
                              + +
                              + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_profile.htm b/template/default/touch/home/spacecp_profile.htm new file mode 100644 index 0000000..0cdf66b --- /dev/null +++ b/template/default/touch/home/spacecp_profile.htm @@ -0,0 +1,296 @@ + + + + + +

                              {lang validator_comment}

                              +
                              + + + + + + + + + + + + + + + + +
                              {lang validator_remark}$validate[remark] 
                              {lang validator_message} 
                                + +
                              + + + +

                              + + {lang old_password_comment}{lang wechat_config_newpassword_comment}{lang connect_config_newpassword_comment} + + {lang freeze_pw_tips} + + {lang freeze_email_tips} + + {lang freeze_admincp_tips} + +

                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              *{lang old_password}
                              {lang new_password} + +

                              {lang memcp_profile_passwd_comment}

                              +
                              {lang new_password_confirm} + +

                              {lang memcp_profile_passwd_comment}

                              +
                              {lang email} + +

                              + +

                              {lang freeze_email_tips}

                              + + {lang email_been_active} + + $acitvemessage + +

                              +

                              {lang memcp_profile_email_comment}

                              +
                              {lang secmobile} + + +

                              {lang memcp_profile_secmobile_comment}

                              +
                              {lang secmobseccode} + + +

                              {lang memcp_profile_secmobseccode_comment}

                              +
                              {lang freeze_reason} + +

                              {lang freeze_reason_comment}

                              +

                              {lang freeze_reason_admincp_comment}

                              +
                              {lang freeze_remark} + +

                              {lang freeze_remark_comment}

                              +
                              {lang security_question} + +

                              {lang memcp_profile_security_comment}

                              +
                              {lang security_answer} + +

                              {lang memcp_profile_security_answer_comment}

                              +
                              + + + + + + + +
                              + +
                              + + + + + + + + +

                              {lang spacecp_profile_message1}{lang spacecp_profile_message2}

                              + + +
                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              {lang username}$_G[member][username] 
                              *$value[title] + $htmls[$key] + + + + + + +
                              {lang permission_basic_status} + +
                              +
                               
                              {lang personal_signature} +
                              +
                              + +
                              +
                              +
                               
                              Email$space[email] ({lang modify}) 
                              + + + +
                              + +
                              + + + + + + diff --git a/template/default/touch/home/spacecp_profile_nav.htm b/template/default/touch/home/spacecp_profile_nav.htm new file mode 100644 index 0000000..025f875 --- /dev/null +++ b/template/default/touch/home/spacecp_profile_nav.htm @@ -0,0 +1,36 @@ +
                              +
                              +
                              + +
                              +
                              +
                              + diff --git a/template/default/touch/home/spacecp_promotion.htm b/template/default/touch/home/spacecp_promotion.htm new file mode 100644 index 0000000..47a5d21 --- /dev/null +++ b/template/default/touch/home/spacecp_promotion.htm @@ -0,0 +1,48 @@ + + + + +
                              +

                              + {lang post_promotion_url} +

                              + + +

                              + + {lang post_promotion_reg} + + {lang post_promotion} + +

                              + +
                              + + + + + + + + + + + + + + + + + + +
                              {lang mode_one}
                              {lang post_promotion_url1} + + +
                              {lang post_promotion_url2} + + +
                              {lang mode_two}
                              {lang mode_two_desc}
                              + + + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_sendmail.htm b/template/default/touch/home/spacecp_sendmail.htm new file mode 100644 index 0000000..dd21754 --- /dev/null +++ b/template/default/touch/home/spacecp_sendmail.htm @@ -0,0 +1,93 @@ + + +
                              + + + + +
                              +
                              +

                              {lang activate_mailbox_first}

                              +
                              +
                              +

                              {lang activate_mailbox_message}

                              +

                              + {lang click_activate_mailbox} $space[email] + ({lang modify_email}) +

                              +
                              +
                              + + {eval + $mailtype = array( + 'mail_my' => array( + 'piccomment' => '{lang mail_piccomment}', + 'clickpic' => '{lang mail_clickpic}', + 'blogcomment' => '{lang mail_blogcomment}', + 'clickblog' => '{lang mail_clickblog}', + 'doing' => '{lang mail_doing}', + 'sharecomment' => '{lang mail_sharecomment}', + 'pcomment' => '{lang mail_pcomment}', + 'post' => '{lang mail_post}', + 'sharenotice' => '{lang mail_sharenotice}', + 'reward' => '{lang mail_reward}', + 'pusearticle' => '{lang mail_pusearticle}', + 'wall' => '{lang mail_wall}', + ), + + 'mail_system' => array( + + 'verify' => '{lang mail_system_verify}', + 'magic' => '{lang mail_system_magic}', + 'credit' => '{lang mail_system_credit}', + 'goods' => '{lang mail_system_goods}', + 'activity' => '{lang mail_system_activity}', + 'report' => '{lang mail_system_report}', + 'group' => '{lang mail_system_group}', + 'task' => '{lang mail_system_task}', + 'pmreport' => '{lang mail_system_pmreport}', + 'mod_member' => '{lang mail_system_mod_member}', + 'friend' => '{lang mail_system_friend}', + 'show' => '{lang mail_system_show}', + 'system' => '{lang mail_system_insys}', + ) + ); + } +

                              {lang reminder_mail_message_1}$_G[setting][sendmailday]{lang reminder_mail_message_2}

                              + + + + + + + + + + + + + + + + +
                              + + + +
                              {lang mail_frequency} + +

                              + {lang mail_send_your_mail} $space[email] ({lang modify_mailbox}) +

                              +
                                + +
                              + + +
                              + + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_share.htm b/template/default/touch/home/spacecp_share.htm new file mode 100644 index 0000000..b711e35 --- /dev/null +++ b/template/default/touch/home/spacecp_share.htm @@ -0,0 +1,83 @@ + +
                              + +
                              + + + +
                              {lang delete_share_message}
                              +
                              + +
                              +
                              + +
                              + + + +
                              {lang new_hot}:
                              +

                              + +

                              +
                              + + +

                              + {lang share} +

                              + +

                              + {lang share} + {lang close} +

                              + +
                              + + + + +
                              +

                              {lang share_web_music_flash}:

                              +

                              +

                              {lang description}:

                              +

                              + +

                              {lang share_im}

                              + + + +
                              + +
                              +

                              + +

                              +
                              + +
                              + + + +
                              + {lang share_count}   + {lang share_description}: +
                              +
                              + + + +
                              + +
                              +
                                + + + +
                              +
                              + +
                              +
                              + +
                              + \ No newline at end of file diff --git a/template/default/touch/home/spacecp_usergroup.htm b/template/default/touch/home/spacecp_usergroup.htm new file mode 100644 index 0000000..81801c3 --- /dev/null +++ b/template/default/touch/home/spacecp_usergroup.htm @@ -0,0 +1,417 @@ + + + + + + +
                              +

                              + {lang memcp_usergroups_joinbuy}{lang memcp_usergroups_joinexit} + {lang close} +

                              + +
                              + + + + + + +
                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              {lang memcp_usergroups_dailyprice} $group[dailyprice] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]}
                              {lang memcp_usergroups_credit}$usermaxdays {lang days}
                              {lang memcp_usergroups_span} {lang days}
                              {lang credits_need}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]} +
                              {lang memcp_usergroups_explain}: + + {lang memcp_usergroups_join_comment} + + {lang memcp_usergroups_exit_comment} + +
                              {lang memcp_usergroups_explain}: {lang memcp_usergroups_free_comment}
                              {lang memcp_usergroups_explain}: + + {lang memcp_usergroups_admin_exit_comment} + + {lang memcp_usergroups_exit_comment} + + {lang memcp_usergroups_open_exit_comment} + +
                              +
                              +

                              + +

                              +
                              +
                              + + + + + +
                              +

                              + {lang memcp_usergroups_switch} + {lang close} +

                              +
                              + + + + + + +
                              + + + + + + + +
                              {lang memcp_usergroups_main_old}$_G[group][grouptitle]
                              {lang memcp_usergroups_main_new}$group[grouptitle]
                              +
                              +

                              + +

                              +
                              +
                              + + + + + + + + + + + + + + + + + $forum[name] + + + + + + +
                              {lang forum_name}$permlang['perms_'.$perm]
                              + + + + + + +  $verifyperm[$fid][$perm] + + + +
                              + {lang usergroup_right_message1}  + {lang usergroup_right_message2}  + + {lang usergroup_right_message3} + + + + + + + +

                              + {lang youhave} $usermoney {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} + {lang yourusergroup}: {$_G['cache']['usergroups'][$_G[groupid]]['grouptitle']} +

                              + +
                              {lang usergroup_expired}
                              + + + + + + + + + + + + + + + + + + + + + + + +
                              {lang usergroup}{lang memcp_usergroups_dailyprice}{lang memcp_usergroups_credit}{lang group_expiry_time}
                              $group[grouptitle] + + $group[dailyprice] {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]} + + {lang free} + + $group[usermaxdays] {lang days}$group[time] + + + + {lang memcp_usergroups_set_main} + + + + {lang renew} + + {lang memcp_usergroups_exit} + + + + {lang renew} + + {lang main_usergroup} + + + {lang free_buy} + + {lang memcp_usergroups_buy} + +
                              + +

                              {lang memcp_usergroup_unallow}

                              + + + + + + + + +
                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                               
                               
                              {lang user_level}
                              $permlang['perms_'.$perm]
                              {lang permission_menu_post}
                              $permlang['perms_'.$perm]
                              {lang about_space}
                              $permlang['perms_'.$perm]
                              {lang permission_menu_attachment}
                              $permlang['perms_'.$perm]
                              + + + + + + + + +

                              {lang my_main_usergroup} - $maingroup[grouptitle]

                              {lang credits}: $space[credits]
                              + + + + +
                                +
                              • $tlang - $currentgrouptitle
                              • +
                              +
                              + + + + + +
                              + + + + {lang spacecp_usergroup_message1} $v + + {lang spacecp_usergroup_message2} $group[groupcreditshigher] + + + + {lang memcp_usergroups_set_main} + + + + {lang renew} + + {lang memcp_usergroups_exit} + + + {lang memcp_usergroups_buy} + + + {lang memcp_usergroups_timelimit}: + +
                              +
                              + +
                              + {lang usergroup_right_message1}  + {lang usergroup_right_message2} + + + + + + + + +{eval +function permtbody($maingroup) { +global $_G, $bperms, $pperms, $sperms, $aperms; +} + + + + + + + $maingroup[$groupbperm] + + {lang permission_basic_disable_sarch}{lang permission_basic_search_title}{lang permission_basic_search_content} + + + + + + + + + + $maingroup[grouptitle] + + + + + + + $maingroup[$grouppperm] {lang bytes} + + +$maingroup[allowrecommend] + + + + + + + + + + + + $maingroup[grouptitle] + + + + + + + $maingroup[$perm]{lang permission_attachment_nopermission} + + + + + + + + + + $maingroup[grouptitle] + + + + + + + $maingroup[$groupaperm]{lang permission_attachment_nopermission} + +

                              $maingroup[attachextensions]

                              {lang permission_attachment_nopermission} + + + + + + + + + + + diff --git a/template/default/touch/home/spacecp_usergroup_header.htm b/template/default/touch/home/spacecp_usergroup_header.htm new file mode 100644 index 0000000..2d96d20 --- /dev/null +++ b/template/default/touch/home/spacecp_usergroup_header.htm @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/template/default/touch/index.htm b/template/default/touch/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/touch/member/getpasswd.htm b/template/default/touch/member/getpasswd.htm new file mode 100644 index 0000000..95ce5b1 --- /dev/null +++ b/template/default/touch/member/getpasswd.htm @@ -0,0 +1,39 @@ + +
                              +
                              +

                              {lang getpassword}

                              +
                              +
                              +
                              +
                              + + + + + + +
                              + \ No newline at end of file diff --git a/template/default/touch/member/index.htm b/template/default/touch/member/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/touch/member/login.htm b/template/default/touch/member/login.htm new file mode 100644 index 0000000..1ae6d6c --- /dev/null +++ b/template/default/touch/member/login.htm @@ -0,0 +1,99 @@ + + +
                              +

                              +
                              + + + + +
                              + +

                               {lang login}{lang getpassword}

                              + + +
                              + + + + + + + + + +
                              + + + + + + + +
                              + + + + +
                              + + +
                              + + + + + + \ No newline at end of file diff --git a/template/default/touch/member/register.htm b/template/default/touch/member/register.htm new file mode 100644 index 0000000..e77f2b2 --- /dev/null +++ b/template/default/touch/member/register.htm @@ -0,0 +1,90 @@ + +
                              +

                              +
                              + + +
                              + +
                              + + +
                              + + + + + \ No newline at end of file diff --git a/template/default/touch/portal/comment.htm b/template/default/touch/portal/comment.htm new file mode 100644 index 0000000..acdf90c --- /dev/null +++ b/template/default/touch/portal/comment.htm @@ -0,0 +1,50 @@ + +
                              +
                              +

                              {lang comment_view}

                              +
                              +
                              + +
                              +
                              +

                              $csubject['title']

                              +

                              {lang comment} ($csubject['commentnum'])

                              +
                              +
                              + +
                              +
                                + + + +
                              + + {lang hide_portal_comment} + + +
                              $multi
                              + +
                              +
                              + + + + + + +
                                +
                              • + +
                              • + + + +
                              +
                              +
                              + +
                              +
                              + +
                              + \ No newline at end of file diff --git a/template/default/touch/portal/comment_li.htm b/template/default/touch/portal/comment_li.htm new file mode 100644 index 0000000..e9e016f --- /dev/null +++ b/template/default/touch/portal/comment_li.htm @@ -0,0 +1,35 @@ + +
                            • +
                              + + + + + + + hidden + + +
                              +

                              + + {$comment['username']} + + {lang guest} + +

                              +
                              + ({lang moderate_need}) + +
                              +
                              +
                              +
                              + $comment['message'] {lang moderate_not_validate} +
                              +
                            • \ No newline at end of file diff --git a/template/default/touch/portal/index.htm b/template/default/touch/portal/index.htm new file mode 100644 index 0000000..aec1820 --- /dev/null +++ b/template/default/touch/portal/index.htm @@ -0,0 +1,106 @@ + +{eval} +$cates = C::t('portal_category')->range_category(0, 999); +foreach($cates as $cate){ + if(!$cate['closed'] && !$cate['upid']){ + $catelist[] = $cate; + } +} +{/eval} + + + +
                              +
                              +
                              + +
                              +
                              +
                              + + + + + + +
                              + +
                              +
                              + + + + + + + + + + +
                              +
                              +
                                +

                                {lang mobnodata}

                                +
                              +
                              +
                              + +{$list['multi']} + + + + \ No newline at end of file diff --git a/template/default/touch/portal/list.htm b/template/default/touch/portal/list.htm new file mode 100644 index 0000000..b031288 --- /dev/null +++ b/template/default/touch/portal/list.htm @@ -0,0 +1,94 @@ + + + + +
                              +
                              +

                              $cat['catname']

                              +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              + + +
                              +
                              +
                              + +
                              +
                              +
                              + + + + + +
                              +
                              +
                                +

                                {lang mobnodata}

                                +
                              +
                              +
                              + +{$list['multi']} + diff --git a/template/default/touch/portal/portal_comment.htm b/template/default/touch/portal/portal_comment.htm new file mode 100644 index 0000000..2892d66 --- /dev/null +++ b/template/default/touch/portal/portal_comment.htm @@ -0,0 +1,49 @@ +
                              +
                              +
                              +
                              + + {lang hide_portal_comment} + + {lang latest_comment} +
                              + +
                              +
                                + + + +
                              + + + +
                              +
                              + + + + + + + + + + + + + +
                                +
                              • + +
                              • + + + +
                              +
                              +
                              + +
                              +
                              + +
                              \ No newline at end of file diff --git a/template/default/touch/portal/portalcp_comment.htm b/template/default/touch/portal/portalcp_comment.htm new file mode 100644 index 0000000..1164e37 --- /dev/null +++ b/template/default/touch/portal/portalcp_comment.htm @@ -0,0 +1,31 @@ + + + + [quote]{$comment[username]}: {$comment[message]}[/quote] + +
                              +

                              {lang comment_edit_content}

                              +
                              + + + +
                              + +
                              +
                              {lang cancel}
                              +
                              + + +
                              +

                              {lang comment_delete}

                              +
                              + + + +
                              {lang comment_delete_confirm}
                              +
                              {lang cancel}
                              +
                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/portal/view.htm b/template/default/touch/portal/view.htm new file mode 100644 index 0000000..8087958 --- /dev/null +++ b/template/default/touch/portal/view.htm @@ -0,0 +1,48 @@ + +
                              +
                              +

                              {lang view_content}

                              +
                              +
                              + +
                              +
                              +

                              $article['title']({lang moderate_need})({lang ignored})

                              +

                              + $article['dateline']{lang view_views}$article['viewnum']0{lang view_comments}$article['commentnum']0$article['from']$article['from'] + +

                              +
                              + +
                              {lang article_description}:$article['summary']
                              + + +
                              +
                              $content['title']
                              + $content['content'] + +
                              $multi
                              +
                              + + + +
                              + +
                              +
                              {lang view_related}
                              + +
                              + + + + + + + \ No newline at end of file diff --git a/template/default/touch/ranklist/activity.htm b/template/default/touch/ranklist/activity.htm new file mode 100644 index 0000000..226b231 --- /dev/null +++ b/template/default/touch/ranklist/activity.htm @@ -0,0 +1,64 @@ + + +
                              +
                              +

                              {lang ranklist_activity}

                              +
                              +
                              + + + + + +
                              +

                              + {lang ranklist_month}| + {lang ranklist_week}| + {lang ranklist_today}| + {lang all} +

                              + + + + + + + + + + + +
                              $activity['rank']
                              +

                              $activity['subject']

                              +

                              {lang ranklist_activity_start} $activity['starttimefrom'] - $activity['starttimeto'] {lang ranklist_activity_end}

                              +

                              $activity['message']

                              +

                              + {lang ranklist_thread_favorite} $activity['favtimes'] + {lang ranklist_thread_share} $activity['sharetimes'] + {lang hot} $activity['heats'] +

                              +
                              + $activity['class']
                              + $activity['place']
                              + {lang have} $activity['applynumber'] {lang join}
                              + $activity['replies'] {lang message} +
                              + +
                              +
                              $multi
                              + +
                              {lang none_data}
                              + +
                              {lang ranklist_update}
                              +
                              + + \ No newline at end of file diff --git a/template/default/touch/ranklist/blog.htm b/template/default/touch/ranklist/blog.htm new file mode 100644 index 0000000..2379b67 --- /dev/null +++ b/template/default/touch/ranklist/blog.htm @@ -0,0 +1,79 @@ + + +
                              +
                              +

                              {lang blog_ranklist}

                              +
                              +
                              + + + + + + + +
                              +

                              + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                              + +
                              + +
                              +
                              $blog['rank']
                              +
                              +
                              + +
                              +
                              +
                              + + {lang share} + + $blog['subject'] +
                              +
                              + $blog['username'] $blog['dateline'] +
                              +
                              + $blog[message] +
                              +
                              + {lang views} $blog[hot] + {lang comment} $blog['replynum'] + {lang ranklist_thread_view} $blog['viewnum'] + {lang ranklist_thread_share} $blog['sharetimes'] + {lang ranklist_thread_favorite} $blog['favtimes'] + $clicks[$_GET['view']]['name'] $blog['click'.$_GET['view']] +
                              +
                              + +
                              + +
                              {lang none_data}
                              + +
                              {lang ranklist_update}
                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/ranklist/forum.htm b/template/default/touch/ranklist/forum.htm new file mode 100644 index 0000000..f344618 --- /dev/null +++ b/template/default/touch/ranklist/forum.htm @@ -0,0 +1,55 @@ + + +
                              +
                              +

                              {lang ranklist_forum}

                              +
                              +
                              + + + + + + +
                              + +
                              + + + + + + + + + + + + + +
                               {lang forum} + {lang ranklist_forum_day_post} + {lang reply} + {lang ranklist_forum_month_post} + {lang ranklist_forum_post} +
                              $forum['rank']$forum['name'] + $forum['posts'] +
                              +
                              + +
                              {lang none_data}
                              + +
                              {lang ranklist_update}
                              +
                              + + \ No newline at end of file diff --git a/template/default/touch/ranklist/group.htm b/template/default/touch/ranklist/group.htm new file mode 100644 index 0000000..4a6758b --- /dev/null +++ b/template/default/touch/ranklist/group.htm @@ -0,0 +1,61 @@ + + +
                              +
                              +

                              {lang ranklist_group}

                              +
                              +
                              + + + + + + +
                              + +
                              + + + + + + + + + + + + + +
                               {lang group}({lang ranklist_group_credit}) + {lang ranklist_forum_day_post} + {lang reply} + {lang ranklist_forum_month_post} + {lang credit_num} + {lang member_num} + {lang ranklist_forum_post} +
                              $forum['rank']$forum['name'] + $forum['commoncredits'] + $forum['membernum'] + $forum['posts'] +
                              +
                              + +
                              {lang none_data}
                              + +
                              {lang ranklist_update}
                              +
                              + + \ No newline at end of file diff --git a/template/default/touch/ranklist/index.htm b/template/default/touch/ranklist/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/touch/ranklist/member.htm b/template/default/touch/ranklist/member.htm new file mode 100644 index 0000000..d58df34 --- /dev/null +++ b/template/default/touch/ranklist/member.htm @@ -0,0 +1,151 @@ + + +
                              +
                              +

                              {lang ranklist_member}

                              +
                              +
                              + + + + + + +
                              + + +

                              + {lang all} + + + |{$credit[title]} + + +

                              + + +
                              + +

                              {lang friend_top_note}:

                              + + {$announcement}
                              + + + {lang your_current_bid}: $space[unitprice] {$extcredits[$creditid][unit]},{lang current_ranking} $now_pos ,{lang make_persistent_efforts}! + + {lang ranking_message_0} + +
                              {lang ranking_message_1} +
                              {lang ranking_message_2} + + + {lang self_current_credit}{lang credits}{$extcredits[$now_choose][title]}: $mycredits + + {lang self_current_friend_num}: $space[friends] + + ,{lang current_ranking} $now_pos ,{lang make_persistent_efforts}! + + +

                              + {lang top_100_update} +

                              + +
                              + + + +
                              +
                              + + + + + + + + + +

                              {lang i_ranking}

                              {lang my_ranking_declaration}

                              {lang max_char_ranking}

                              {lang show_unitprice}

                              ({lang edit_price})

                              {lang increase_bid}{$extcredits[$creditid][title]}

                              {lang not_exceed}{$extcredits[$creditid][title]} $space[credit] {$extcredits[$creditid][unit]}

                              + + +
                              + +
                              + + + + + + + +

                              {lang help_friend_in_top}

                              {lang friend_need_help}

                              {lang please_input_friend_name}

                              {lang handsel_bid}{$extcredits[$creditid][title]}

                              {lang not_exceed}{$extcredits[$creditid][title]} $space[credit] {$extcredits[$creditid][unit]}

                              + + +
                              +
                              + +
                              {lang close_ranking_note}
                              + + + + + +
                              + + + diff --git a/template/default/touch/ranklist/member_list.htm b/template/default/touch/ranklist/member_list.htm new file mode 100644 index 0000000..e8fd100 --- /dev/null +++ b/template/default/touch/ranklist/member_list.htm @@ -0,0 +1,82 @@ + +

                              + {lang order} + + +

                              + + +

                              + {lang post_num}| + {lang digest_num}| + {lang month_post_num}| + {lang day_post_num} +

                              + + +

                              + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                              + + +

                              + {lang ranklist_month}| + {lang all} +

                              + + +
                              + +
                              +
                              $value[rank]
                              +
                              +
                              +

                              {lang visit_friend}

                              +

                              {lang say_hi}

                              +

                              {lang send_pm}

                              +

                              {lang add_friend}

                              +
                              +
                              + $value[username] + +
                              +
                              +

                              + {$_G['cache']['usergroups'][$value['groupid']]['grouptitle']} + {lang credit_num}: $value[credits] + {$extcredits[$now_choose][title]}: $value[extcredits] {$extcredits[$now_choose][unit]} + {lang invite_num}: $value[invitenum] + {lang posts_num}: $value[posts] + {lang blogs_num}: $value[blogs] + {lang views} $value[views] + {lang online_time}: $value[onlinetime] {lang minute} +

                              + +

                              {lang friends_num}: $value[friends]

                              +

                              {lang last_activity}: $value[lastactivity]

                              +

                              {lang show_unitprice}: $value[unitprice] ({lang modify})

                              +

                              {lang show_credit}{$extcredits[$creditid][title]}: $value[show_credit] {$extcredits[$creditid][unit]}

                              +

                              {lang show_credit_note}: $value[show_note]

                              +
                              +
                              + +
                              $multi
                              +
                              + +
                              {lang no_members_of}
                              + +
                              {lang ranklist_update}
                              \ No newline at end of file diff --git a/template/default/touch/ranklist/picture.htm b/template/default/touch/ranklist/picture.htm new file mode 100644 index 0000000..917a01b --- /dev/null +++ b/template/default/touch/ranklist/picture.htm @@ -0,0 +1,56 @@ + + +
                              +
                              +

                              {lang ranklist_picture}

                              +
                              +
                              + + + + + + +
                              +

                              + {lang ranklist_month}| + {lang ranklist_week}| + {lang ranklist_today}| + {lang all} +

                              + +
                                + +
                              • +
                                + $picture['rank'] + +
                                +

                                {lang views} $picture[hot]

                                +

                                {lang ranklist_thread_share} $picture[sharetimes]

                                +

                                $clicks[$_GET[view]][name] $picture['click'.$_GET[view]]

                                + $picture[username] +
                              • + +
                              + +
                              {lang none_data}
                              + +
                              {lang ranklist_update}
                              +
                              + + \ No newline at end of file diff --git a/template/default/touch/ranklist/poll.htm b/template/default/touch/ranklist/poll.htm new file mode 100644 index 0000000..9d1d6b9 --- /dev/null +++ b/template/default/touch/ranklist/poll.htm @@ -0,0 +1,68 @@ + + +
                              +
                              +

                              {lang ranklist_poll}

                              +
                              +
                              + + + + + +
                              +

                              + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                              + + +
                              $multi
                              + +
                              {lang none_data}
                              + +
                              {lang ranklist_update}
                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/ranklist/ranklist.htm b/template/default/touch/ranklist/ranklist.htm new file mode 100644 index 0000000..11b323a --- /dev/null +++ b/template/default/touch/ranklist/ranklist.htm @@ -0,0 +1,157 @@ + + +
                              +
                              +

                              $_G[setting][navs][8][navname]

                              +
                              +
                              + + + +
                              + +
                              +
                              + + + {lang i_want_rank} + | + + {lang more}› + +

                              {lang bidding_rank}

                              +
                              +
                              + +
                              +
                              + + + +
                              +
                              +
                              + + {lang more}› + +

                              {lang ranklist_picture}

                              +
                              +
                              + +
                              +
                              +
                              + + + +
                              +
                              + {lang more}› +

                              {lang ranklist_thread}

                              +
                              +
                              + +
                              +
                              + + + +
                              +
                              + {lang more}› +

                              {lang blog_ranklist}

                              +
                              +
                              + +
                              +
                              + + + +
                              +
                              + {lang more}› +

                              {lang ranklist_poll}

                              +
                              +
                              + +
                              +
                              + + + +
                              +
                              + {lang more}› +

                              {lang ranklist_activity}

                              +
                              +
                              + +
                              +
                              + +
                              + + \ No newline at end of file diff --git a/template/default/touch/ranklist/side_top.htm b/template/default/touch/ranklist/side_top.htm new file mode 100644 index 0000000..f8c179d --- /dev/null +++ b/template/default/touch/ranklist/side_top.htm @@ -0,0 +1,36 @@ +
                              +
                              + +
                              +
                              + + diff --git a/template/default/touch/ranklist/thread.htm b/template/default/touch/ranklist/thread.htm new file mode 100644 index 0000000..17429d3 --- /dev/null +++ b/template/default/touch/ranklist/thread.htm @@ -0,0 +1,55 @@ + + +
                              +
                              +

                              {lang ranklist_thread}

                              +
                              +
                              + + + + + +
                              +

                              + {lang ranklist_week}| + {lang ranklist_month}| + {lang ranklist_today}| + {lang all} +

                              + +
                              + + + + + + + + + + + + + + + +
                               {lang thread}{lang author}
                              $thread['rank']$thread['subject'] + $thread['author'] + $thread['dateline'] +
                              +
                              + +
                              {lang none_data}
                              + +
                              {lang ranklist_update}
                              +
                              + + + \ No newline at end of file diff --git a/template/default/touch/search/album.htm b/template/default/touch/search/album.htm new file mode 100644 index 0000000..45e0529 --- /dev/null +++ b/template/default/touch/search/album.htm @@ -0,0 +1,22 @@ + +
                              +
                              +

                              {lang album}{lang search}

                              +
                              +
                              +
                              + + + + + + $_G['setting']['extcredits'][$id]['img'] $_G['setting']['extcredits'][$id]['title'] $policy $_G['setting']['extcredits'][$id]['unit'] + + +

                              {lang search_credit_msg}

                              +
                              + + + + + \ No newline at end of file diff --git a/template/default/touch/search/album_list.htm b/template/default/touch/search/album_list.htm new file mode 100644 index 0000000..7f052b3 --- /dev/null +++ b/template/default/touch/search/album_list.htm @@ -0,0 +1,30 @@ +
                              +

                              {lang search_result_keyword}{lang search_result}

                              + +

                              {lang search_nomatch}

                              + + + + $multipage +
                              \ No newline at end of file diff --git a/template/default/touch/search/blog.htm b/template/default/touch/search/blog.htm new file mode 100644 index 0000000..fcb6b96 --- /dev/null +++ b/template/default/touch/search/blog.htm @@ -0,0 +1,22 @@ + +
                              +
                              +

                              {lang blog}{lang search}

                              +
                              +
                              +
                              + + + + + + $_G['setting']['extcredits'][$id]['img'] $_G['setting']['extcredits'][$id]['title'] $policy $_G['setting']['extcredits'][$id]['unit'] + + +

                              {lang search_credit_msg}

                              +
                              + + + + + \ No newline at end of file diff --git a/template/default/touch/search/blog_list.htm b/template/default/touch/search/blog_list.htm new file mode 100644 index 0000000..c11ea6a --- /dev/null +++ b/template/default/touch/search/blog_list.htm @@ -0,0 +1,36 @@ +
                              +

                              {lang search_result_keyword}{lang search_result}

                              + +

                              {lang search_nomatch}

                              + +
                              + +
                              + +
                              $multipage
                              +
                              \ No newline at end of file diff --git a/template/default/touch/search/collection.htm b/template/default/touch/search/collection.htm new file mode 100644 index 0000000..2f17f44 --- /dev/null +++ b/template/default/touch/search/collection.htm @@ -0,0 +1,22 @@ + +
                              +
                              +

                              {lang collection}{lang search}

                              +
                              +
                              +
                              + + + + + + $_G['setting']['extcredits'][$id]['img'] $_G['setting']['extcredits'][$id]['title'] $policy $_G['setting']['extcredits'][$id]['unit'] + + +

                              {lang search_credit_msg}

                              +
                              + + + + + \ No newline at end of file diff --git a/template/default/touch/search/collection_list.htm b/template/default/touch/search/collection_list.htm new file mode 100644 index 0000000..5069d7d --- /dev/null +++ b/template/default/touch/search/collection_list.htm @@ -0,0 +1,29 @@ +
                              +

                              {lang search_result_keyword}{lang search_result}

                              + +

                              {lang search_nomatch}

                              + +
                              + +
                              + +
                              $multipage
                              +
                              \ No newline at end of file diff --git a/template/default/touch/search/forum.htm b/template/default/touch/search/forum.htm new file mode 100644 index 0000000..cc48cda --- /dev/null +++ b/template/default/touch/search/forum.htm @@ -0,0 +1,22 @@ + +
                              +
                              +

                              {lang thread}{lang search}

                              +
                              +
                              +
                              + + + + + + $_G['setting']['extcredits'][$id]['img'] $_G['setting']['extcredits'][$id]['title'] $policy $_G['setting']['extcredits'][$id]['unit'] + + +

                              {lang search_credit_msg}

                              +
                              + + + + + \ No newline at end of file diff --git a/template/default/touch/search/group.htm b/template/default/touch/search/group.htm new file mode 100644 index 0000000..b43d983 --- /dev/null +++ b/template/default/touch/search/group.htm @@ -0,0 +1,22 @@ + +
                              +
                              +

                              {$_G['setting']['navs'][3]['navname']}{lang search}

                              +
                              +
                              +
                              + + + + + + $_G['setting']['extcredits'][$id]['img'] $_G['setting']['extcredits'][$id]['title'] $policy $_G['setting']['extcredits'][$id]['unit'] + + +

                              {lang search_credit_msg}

                              +
                              + + + + + \ No newline at end of file diff --git a/template/default/touch/search/group_list.htm b/template/default/touch/search/group_list.htm new file mode 100644 index 0000000..247fcae --- /dev/null +++ b/template/default/touch/search/group_list.htm @@ -0,0 +1,113 @@ +
                              +

                              {lang search_group_result_keyword} {lang search_group_viewgroup}{lang search_group_result}{lang search_result}

                              + + + +

                              {lang search_nomatch}

                              + +
                              +
                                + +
                              • +
                                + +
                                +

                                {$group['name']} ({lang public})

                                + {$group['dateline']} +
                                +
                                +
                                +
                                  +
                                • {$group['threads']}
                                • +
                                • {$group['membernum']}
                                • +
                                • {$group['commoncredits']}
                                • +
                                +
                                +
                              • + +
                              +
                              + +
                              $multipage
                              + + +
                              +
                                + +
                              • +
                                + +
                                +

                                {$group['name']} ({lang public})

                                + {$group['dateline']} +
                                +
                                +
                                +
                                  +
                                • {$group['threads']}
                                • +
                                • {$group['membernum']}
                                • +
                                • {$group['commoncredits']}
                                • +
                                +
                                +
                              • + +
                              +
                              + + +

                              {lang search_nomatch}

                              + + + +
                              $multipage
                              +
                              + \ No newline at end of file diff --git a/template/default/touch/search/index.htm b/template/default/touch/search/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/template/default/touch/search/portal.htm b/template/default/touch/search/portal.htm new file mode 100644 index 0000000..22c0ddd --- /dev/null +++ b/template/default/touch/search/portal.htm @@ -0,0 +1,22 @@ + +
                              +
                              +

                              {lang portal}{lang search}

                              +
                              +
                              +
                              + + + + + + $_G['setting']['extcredits'][$id]['img'] $_G['setting']['extcredits'][$id]['title'] $policy $_G['setting']['extcredits'][$id]['unit'] + + +

                              {lang search_credit_msg}

                              +
                              + + + + + \ No newline at end of file diff --git a/template/default/touch/search/portal_list.htm b/template/default/touch/search/portal_list.htm new file mode 100644 index 0000000..56355ea --- /dev/null +++ b/template/default/touch/search/portal_list.htm @@ -0,0 +1,36 @@ +
                              +

                              {lang search_result_keyword}{lang search_result}

                              + + +

                              {lang search_nomatch}

                              + +
                              + +
                              + +
                              $multipage
                              +
                              \ No newline at end of file diff --git a/template/default/touch/search/pubsearch.htm b/template/default/touch/search/pubsearch.htm new file mode 100644 index 0000000..7f9c9af --- /dev/null +++ b/template/default/touch/search/pubsearch.htm @@ -0,0 +1,25 @@ + + + +
                              +

                              {lang hot_search}:

                              + +
                              + \ No newline at end of file diff --git a/template/default/touch/search/thread_list.htm b/template/default/touch/search/thread_list.htm new file mode 100644 index 0000000..fbab536 --- /dev/null +++ b/template/default/touch/search/thread_list.htm @@ -0,0 +1,82 @@ + diff --git a/template/index.htm b/template/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/template/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_client/client.php b/uc_client/client.php new file mode 100644 index 0000000..5481b13 --- /dev/null +++ b/uc_client/client.php @@ -0,0 +1,709 @@ + $val) { + $string[$key] = uc_addslashes($val, $force, $strip); + } + } else { + $string = addslashes($strip ? stripslashes($string) : $string); + } + return $string; +} + +if(!function_exists('daddslashes')) { + function daddslashes($string, $force = 0) { + return uc_addslashes($string, $force); + } +} + + +if(!function_exists('dhtmlspecialchars')) { + function dhtmlspecialchars($string, $flags = null) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = dhtmlspecialchars($val, $flags); + } + } else { + if($flags === null) { + $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); + if(strpos($string, '&#') !== false) { + $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string); + } + } else { + if(PHP_VERSION < '5.4.0') { + $string = htmlspecialchars($string, $flags); + } else { + if(strtolower(CHARSET) == 'utf-8') { + $charset = 'UTF-8'; + } else { + $charset = 'ISO-8859-1'; + } + $string = htmlspecialchars($string, $flags, $charset); + } + } + } + return $string; + } +} +if(!function_exists('fsocketopen')) { + function fsocketopen($hostname, $port = 80, &$errno = null, &$errstr = null, $timeout = 15) { + $fp = ''; + if(function_exists('fsockopen')) { + $fp = @fsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('pfsockopen')) { + $fp = @pfsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('stream_socket_client')) { + $fp = @stream_socket_client($hostname.':'.$port, $errno, $errstr, $timeout); + } + return $fp; + } +} + +function uc_api_post($module, $action, $arg = array()) { + $s = $sep = ''; + foreach($arg as $k => $v) { + $k = urlencode($k); + if(is_array($v)) { + $s2 = $sep2 = ''; + foreach($v as $k2 => $v2) { + $k2 = urlencode($k2); + $s2 .= "$sep2{$k}[$k2]=".urlencode($v2); + $sep2 = '&'; + } + $s .= $sep.$s2; + } else { + $s .= "$sep$k=".urlencode($v); + } + $sep = '&'; + } + $postdata = uc_api_requestdata($module, $action, $s); + return uc_fopen2(UC_API.'/index.php', 500000, $postdata, '', TRUE, UC_IP, 20); +} + +function uc_api_requestdata($module, $action, $arg='', $extra='') { + $input = uc_api_input($arg, $module, $action); + $post = "m=$module&a=$action&inajax=2&release=".UC_CLIENT_RELEASE."&input=$input&appid=".UC_APPID.$extra; + return $post; +} + +function uc_api_url($module, $action, $arg='', $extra='') { + $url = UC_API.'/index.php?'.uc_api_requestdata($module, $action, $arg, $extra); + return $url; +} + +function uc_api_input($data, $module, $action) { + $data = $data."&m=$module&a=$action&appid=".UC_APPID; + $s = urlencode(uc_authcode($data.'&agent='.md5($_SERVER['HTTP_USER_AGENT'])."&time=".time(), 'ENCODE', UC_KEY)); + return $s; +} + +function uc_api_mysql($model, $action, $args=array()) { + global $uc_controls; + if(empty($uc_controls[$model])) { + include_once UC_ROOT.'./lib/dbi.class.php'; + include_once UC_ROOT.'./model/base.php'; + include_once UC_ROOT."./control/$model.php"; + $modelname = $model.'control'; + $uc_controls[$model] = new $modelname(); + } + if($action[0] != '_') { + $args = uc_addslashes($args, 1, TRUE); + $action = 'on'.$action; + $uc_controls[$model]->input = $args; + return $uc_controls[$model]->$action($args); + } else { + return ''; + } +} + +function uc_serialize($arr, $htmlon = 0) { + include_once UC_ROOT.'./lib/xml.class.php'; + return xml_serialize($arr, $htmlon); +} + +function uc_unserialize($s) { + include_once UC_ROOT.'./lib/xml.class.php'; + return xml_unserialize($s); +} + +function uc_authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + + $ckey_length = 4; + + $key = md5($key ? $key : UC_KEY); + $keya = md5(substr($key, 0, 16)); + $keyb = md5(substr($key, 16, 16)); + $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; + + $cryptkey = $keya.md5($keya.$keyc); + $key_length = strlen($cryptkey); + + $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; + $string_length = strlen($string); + + $result = ''; + $box = range(0, 255); + + $rndkey = array(); + for($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($cryptkey[$i % $key_length]); + } + + for($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + + for($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); + } + + if($operation == 'DECODE') { + if(((int)substr($result, 0, 10) == 0 || (int)substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26).$keyb), 0, 16)) { + return substr($result, 26); + } else { + return ''; + } + } else { + return $keyc.str_replace('=', '', base64_encode($result)); + } +} + +function uc_fopen2($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $__times__ = isset($_GET['__times__']) ? intval($_GET['__times__']) + 1 : 1; + if($__times__ > 2) { + return ''; + } + $url .= (strpos($url, '?') === FALSE ? '?' : '&')."__times__=$__times__"; + return uc_fopen($url, $limit, $post, $cookie, $bysocket, $ip, $timeout, $block, $encodetype, $allowcurl); +} + +function uc_fopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $return = ''; + $matches = parse_url($url); + $scheme = strtolower($matches['scheme']); + $host = $matches['host']; + $path = !empty($matches['path']) ? $matches['path'].(!empty($matches['query']) ? '?'.$matches['query'] : '') : '/'; + $port = !empty($matches['port']) ? $matches['port'] : ($scheme == 'https' ? 443 : 80); + + if(function_exists('curl_init') && function_exists('curl_exec') && $allowcurl) { + $ch = curl_init(); + $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); + curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + if(!empty($ip) && filter_var($ip, FILTER_VALIDATE_IP) && !filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + if($post) { + curl_setopt($ch, CURLOPT_POST, 1); + if($encodetype == 'URLENCODE') { + curl_setopt($ch, CURLOPT_POSTFIELDS, $post); + } else { + parse_str($post, $postarray); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postarray); + } + } + if($cookie) { + curl_setopt($ch, CURLOPT_COOKIE, $cookie); + } + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); + $data = curl_exec($ch); + $status = curl_getinfo($ch); + $errno = curl_errno($ch); + curl_close($ch); + if($errno || $status['http_code'] != 200) { + return; + } else { + return !$limit ? $data : substr($data, 0, $limit); + } + } + + if($post) { + $out = "POST $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + if($allowcurl) { + $encodetype = 'URLENCODE'; + } + $boundary = $encodetype == 'URLENCODE' ? '' : '; boundary='.trim(substr(trim($post), 2, strpos(trim($post), "\n") - 2)); + $header .= $encodetype == 'URLENCODE' ? "Content-Type: application/x-www-form-urlencoded\r\n" : "Content-Type: multipart/form-data$boundary\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= 'Content-Length: '.strlen($post)."\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cache-Control: no-cache\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header.$post; + } else { + $out = "GET $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header; + } + + $fpflag = 0; + $context = array(); + if($scheme == 'https') { + $context['ssl'] = array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'peer_name' => $host + ); + if(version_compare(PHP_VERSION, '5.6.0', '<')) { + $context['ssl']['SNI_enabled'] = true; + $context['ssl']['SNI_server_name'] = $host; + } + } + if(ini_get('allow_url_fopen')) { + $context['http'] = array( + 'method' => $post ? 'POST' : 'GET', + 'header' => $header, + 'timeout' => $timeout + ); + if($post) { + $context['http']['content'] = $post; + } + $context = stream_context_create($context); + $fp = @fopen($scheme.'://'.($ip ? $ip : $host).':'.$port.$path, 'b', false, $context); + $fpflag = 1; + } elseif(function_exists('stream_socket_client')) { + $context = stream_context_create($context); + $fp = @stream_socket_client(($scheme == 'https' ? 'ssl://' : '').($ip ? $ip : $host).':'.$port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context); + } else { + $fp = @fsocketopen(($scheme == 'https' ? 'ssl://' : '').($scheme == 'https' ? $host : ($ip ? $ip : $host)), $port, $errno, $errstr, $timeout); + } + + if(!$fp) { + return ''; + } else { + stream_set_blocking($fp, $block); + stream_set_timeout($fp, $timeout); + if(!$fpflag) { + @fwrite($fp, $out); + } + $status = stream_get_meta_data($fp); + if(!$status['timed_out']) { + while (!feof($fp) && !$fpflag) { + if(($header = @fgets($fp)) && ($header == "\r\n" || $header == "\n")) { + break; + } + } + + $stop = false; + while(!feof($fp) && !$stop) { + $data = fread($fp, ($limit == 0 || $limit > 8192 ? 8192 : $limit)); + $return .= $data; + if($limit) { + $limit -= strlen($data); + $stop = $limit <= 0; + } + } + } + @fclose($fp); + return $return; + } +} + +function uc_app_ls() { + $return = call_user_func(UC_API_FUNC, 'app', 'ls', array()); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_feed_add($icon, $uid, $username, $title_template='', $title_data='', $body_template='', $body_data='', $body_general='', $target_ids='', $images = array()) { + return call_user_func(UC_API_FUNC, 'feed', 'add', + array( 'icon'=>$icon, + 'appid'=>UC_APPID, + 'uid'=>$uid, + 'username'=>$username, + 'title_template'=>$title_template, + 'title_data'=>$title_data, + 'body_template'=>$body_template, + 'body_data'=>$body_data, + 'body_general'=>$body_general, + 'target_ids'=>$target_ids, + 'image_1'=>$images[0]['url'], + 'image_1_link'=>$images[0]['link'], + 'image_2'=>$images[1]['url'], + 'image_2_link'=>$images[1]['link'], + 'image_3'=>$images[2]['url'], + 'image_3_link'=>$images[2]['link'], + 'image_4'=>$images[3]['url'], + 'image_4_link'=>$images[3]['link'] + ) + ); +} + +function uc_feed_get($limit = 100, $delete = TRUE) { + $return = call_user_func(UC_API_FUNC, 'feed', 'get', array('limit'=>$limit, 'delete'=>$delete)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_friend_add($uid, $friendid, $comment='') { + return call_user_func(UC_API_FUNC, 'friend', 'add', array('uid'=>$uid, 'friendid'=>$friendid, 'comment'=>$comment)); +} + +function uc_friend_delete($uid, $friendids) { + return call_user_func(UC_API_FUNC, 'friend', 'delete', array('uid'=>$uid, 'friendids'=>$friendids)); +} + +function uc_friend_totalnum($uid, $direction = 0) { + return call_user_func(UC_API_FUNC, 'friend', 'totalnum', array('uid'=>$uid, 'direction'=>$direction)); +} + +function uc_friend_ls($uid, $page = 1, $pagesize = 10, $totalnum = 10, $direction = 0) { + $return = call_user_func(UC_API_FUNC, 'friend', 'ls', array('uid'=>$uid, 'page'=>$page, 'pagesize'=>$pagesize, 'totalnum'=>$totalnum, 'direction'=>$direction)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_user_register($username, $password, $email, $questionid = '', $answer = '', $regip = '') { + return call_user_func(UC_API_FUNC, 'user', 'register', array('username'=>$username, 'password'=>$password, 'email'=>$email, 'questionid'=>$questionid, 'answer'=>$answer, 'regip' => $regip)); +} + +function uc_user_login($username, $password, $isuid = 0, $checkques = 0, $questionid = '', $answer = '', $ip = '', $nolog = 0) { + $isuid = intval($isuid); + $return = call_user_func(UC_API_FUNC, 'user', 'login', array('username'=>$username, 'password'=>$password, 'isuid'=>$isuid, 'checkques'=>$checkques, 'questionid'=>$questionid, 'answer'=>$answer, 'ip' => $ip, 'nolog' => $nolog)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_user_synlogin($uid) { + if(UC_STANDALONE) { + return ''; + } + $uid = intval($uid); + if(@include UC_ROOT.'./data/cache/apps.php') { + if(count($_CACHE['apps']) > 1) { + $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); + } else { + $return = ''; + } + } + return $return; +} + +function uc_user_synlogout() { + if(UC_STANDALONE) { + return ''; + } + if(@include UC_ROOT.'./data/cache/apps.php') { + if(count($_CACHE['apps']) > 1) { + $return = uc_api_post('user', 'synlogout', array()); + } else { + $return = ''; + } + } + return $return; +} + +function uc_user_edit($username, $oldpw, $newpw, $email, $ignoreoldpw = 0, $questionid = '', $answer = '', $secmobicc = '', $secmobile = '') { + return call_user_func(UC_API_FUNC, 'user', 'edit', array('username'=>$username, 'oldpw'=>$oldpw, 'newpw'=>$newpw, 'email'=>$email, 'ignoreoldpw'=>$ignoreoldpw, 'questionid'=>$questionid, 'answer'=>$answer, 'secmobicc'=>$secmobicc, 'secmobile'=>$secmobile)); +} + +function uc_user_delete($uid) { + return call_user_func(UC_API_FUNC, 'user', 'delete', array('uid'=>$uid, 'action'=>'delete')); +} + +function uc_user_deleteavatar($uid) { + if(UC_STANDALONE) { + @include_once UC_ROOT.'./extend_client.php'; + uc_note_handler::loadavatarpath(); + uc_api_mysql('user', 'deleteavatar', array('uid'=>$uid)); + } else { + uc_api_post('user', 'deleteavatar', array('uid'=>$uid)); + } +} + +function uc_user_checkname($username) { + return call_user_func(UC_API_FUNC, 'user', 'check_username', array('username'=>$username)); +} + +function uc_user_checkemail($email) { + return call_user_func(UC_API_FUNC, 'user', 'check_email', array('email'=>$email)); +} + +function uc_user_checksecmobile($secmobicc, $secmobile) { + return call_user_func(UC_API_FUNC, 'user', 'check_secmobile', array('secmobicc'=>$secmobicc, 'secmobile'=>$secmobile)); +} + +function uc_user_addprotected($username, $admin='') { + return call_user_func(UC_API_FUNC, 'user', 'addprotected', array('username'=>$username, 'admin'=>$admin)); +} + +function uc_user_deleteprotected($username) { + return call_user_func(UC_API_FUNC, 'user', 'deleteprotected', array('username'=>$username)); +} + +function uc_user_getprotected() { + $return = call_user_func(UC_API_FUNC, 'user', 'getprotected', array('1'=>1)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_get_user($username, $isuid=0) { + $return = call_user_func(UC_API_FUNC, 'user', 'get_user', array('username'=>$username, 'isuid'=>$isuid)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_user_chgusername($uid, $newusername) { + return call_user_func(UC_API_FUNC, 'user', 'chgusername', array('uid'=>$uid, 'newusername'=>$newusername)); +} + +function uc_user_merge($oldusername, $newusername, $uid, $password, $email) { + return call_user_func(UC_API_FUNC, 'user', 'merge', array('oldusername'=>$oldusername, 'newusername'=>$newusername, 'uid'=>$uid, 'password'=>$password, 'email'=>$email)); +} + +function uc_user_merge_remove($username) { + return call_user_func(UC_API_FUNC, 'user', 'merge_remove', array('username'=>$username)); +} + +function uc_user_getcredit($appid, $uid, $credit) { + return uc_api_post('user', 'getcredit', array('appid'=>$appid, 'uid'=>$uid, 'credit'=>$credit)); +} + + +function uc_user_logincheck($username, $ip) { + return call_user_func(UC_API_FUNC, 'user', 'logincheck', array('username' => $username, 'ip' => $ip)); +} + +function uc_pm_location($uid, $newpm = 0) { + $apiurl = uc_api_url('pm_client', 'ls', "uid=$uid&frontend=1", ($newpm ? '&folder=newbox' : '')); + @header("Expires: 0"); + @header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + @header("location: $apiurl"); +} + +function uc_pm_checknew($uid, $more = 0) { + $return = call_user_func(UC_API_FUNC, 'pm', 'check_newpm', array('uid'=>$uid, 'more'=>$more)); + return (!$more || UC_CONNECT == 'mysql') ? $return : uc_unserialize($return); +} + +function uc_pm_send($fromuid, $msgto, $subject, $message, $instantly = 1, $replypmid = 0, $isusername = 0, $type = 0) { + if($instantly) { + $replypmid = @is_numeric($replypmid) ? $replypmid : 0; + return call_user_func(UC_API_FUNC, 'pm', 'sendpm', array('fromuid'=>$fromuid, 'msgto'=>$msgto, 'subject'=>$subject, 'message'=>$message, 'replypmid'=>$replypmid, 'isusername'=>$isusername, 'type' => $type)); + } else { + $fromuid = intval($fromuid); + $subject = rawurlencode($subject); + $msgto = rawurlencode($msgto); + $message = rawurlencode($message); + $replypmid = @is_numeric($replypmid) ? $replypmid : 0; + $replyadd = $replypmid ? "&pmid=$replypmid&do=reply" : ''; + $apiurl = uc_api_url('pm_client', 'send', "uid=$fromuid", "&msgto=$msgto&subject=$subject&message=$message$replyadd"); + @header("Expires: 0"); + @header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + @header("location: ".$apiurl); + } +} + +function uc_pm_delete($uid, $folder, $pmids) { + return call_user_func(UC_API_FUNC, 'pm', 'delete', array('uid'=>$uid, 'pmids'=>$pmids)); +} + +function uc_pm_deleteuser($uid, $touids) { + return call_user_func(UC_API_FUNC, 'pm', 'deleteuser', array('uid'=>$uid, 'touids'=>$touids)); +} + +function uc_pm_deletechat($uid, $plids, $type = 0) { + return call_user_func(UC_API_FUNC, 'pm', 'deletechat', array('uid'=>$uid, 'plids'=>$plids, 'type'=>$type)); +} + +function uc_pm_readstatus($uid, $uids, $plids = array(), $status = 0) { + return call_user_func(UC_API_FUNC, 'pm', 'readstatus', array('uid'=>$uid, 'uids'=>$uids, 'plids'=>$plids, 'status'=>$status)); +} + +function uc_pm_list($uid, $page = 1, $pagesize = 10, $folder = 'inbox', $filter = 'newpm', $msglen = 0) { + $uid = intval($uid); + $page = intval($page); + $pagesize = intval($pagesize); + $return = call_user_func(UC_API_FUNC, 'pm', 'ls', array('uid'=>$uid, 'page'=>$page, 'pagesize'=>$pagesize, 'filter'=>$filter, 'msglen'=>$msglen)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_pm_ignore($uid) { + $uid = intval($uid); + return call_user_func(UC_API_FUNC, 'pm', 'ignore', array('uid'=>$uid)); +} + +function uc_pm_view($uid, $pmid = 0, $touid = 0, $daterange = 1, $page = 0, $pagesize = 10, $type = 0, $isplid = 0) { + $uid = intval($uid); + $touid = intval($touid); + $page = intval($page); + $pagesize = intval($pagesize); + $pmid = @is_numeric($pmid) ? $pmid : 0; + $return = call_user_func(UC_API_FUNC, 'pm', 'view', array('uid'=>$uid, 'pmid'=>$pmid, 'touid'=>$touid, 'daterange'=>$daterange, 'page' => $page, 'pagesize' => $pagesize, 'type'=>$type, 'isplid'=>$isplid)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_pm_view_num($uid, $touid, $isplid) { + $uid = intval($uid); + $touid = intval($touid); + $isplid = intval($isplid); + return call_user_func(UC_API_FUNC, 'pm', 'viewnum', array('uid' => $uid, 'touid' => $touid, 'isplid' => $isplid)); +} + +function uc_pm_viewnode($uid, $type, $pmid) { + $uid = intval($uid); + $type = intval($type); + $pmid = @is_numeric($pmid) ? $pmid : 0; + $return = call_user_func(UC_API_FUNC, 'pm', 'viewnode', array('uid'=>$uid, 'type'=>$type, 'pmid'=>$pmid)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_pm_chatpmmemberlist($uid, $plid = 0) { + $uid = intval($uid); + $plid = intval($plid); + $return = call_user_func(UC_API_FUNC, 'pm', 'chatpmmemberlist', array('uid'=>$uid, 'plid'=>$plid)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_pm_kickchatpm($plid, $uid, $touid) { + $uid = intval($uid); + $plid = intval($plid); + $touid = intval($touid); + return call_user_func(UC_API_FUNC, 'pm', 'kickchatpm', array('uid'=>$uid, 'plid'=>$plid, 'touid'=>$touid)); +} + +function uc_pm_appendchatpm($plid, $uid, $touid) { + $uid = intval($uid); + $plid = intval($plid); + $touid = intval($touid); + return call_user_func(UC_API_FUNC, 'pm', 'appendchatpm', array('uid'=>$uid, 'plid'=>$plid, 'touid'=>$touid)); +} + +function uc_pm_blackls_get($uid) { + $uid = intval($uid); + return call_user_func(UC_API_FUNC, 'pm', 'blackls_get', array('uid'=>$uid)); +} + +function uc_pm_blackls_set($uid, $blackls) { + $uid = intval($uid); + return call_user_func(UC_API_FUNC, 'pm', 'blackls_set', array('uid'=>$uid, 'blackls'=>$blackls)); +} + +function uc_pm_blackls_add($uid, $username) { + $uid = intval($uid); + return call_user_func(UC_API_FUNC, 'pm', 'blackls_add', array('uid'=>$uid, 'username'=>$username)); +} + +function uc_pm_blackls_delete($uid, $username) { + $uid = intval($uid); + return call_user_func(UC_API_FUNC, 'pm', 'blackls_delete', array('uid'=>$uid, 'username'=>$username)); +} + +function uc_domain_ls() { + $return = call_user_func(UC_API_FUNC, 'domain', 'ls', array('1'=>1)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_credit_exchange_request($uid, $from, $to, $toappid, $amount) { + $uid = intval($uid); + $from = intval($from); + $toappid = intval($toappid); + $to = intval($to); + $amount = intval($amount); + return uc_api_post('credit', 'request', array('uid'=>$uid, 'from'=>$from, 'to'=>$to, 'toappid'=>$toappid, 'amount'=>$amount)); +} + +function uc_tag_get($tagname, $nums = 0) { + $return = call_user_func(UC_API_FUNC, 'tag', 'gettag', array('tagname'=>$tagname, 'nums'=>$nums)); + return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); +} + +function uc_avatar($uid, $type = 'virtual', $returnhtml = 1) { + $uid = intval($uid); + $uc_input = uc_api_input("uid=$uid&frontend=1", "user", "rectavatar"); + $avatarpath = UC_STANDALONE ? UC_AVTAPI : UC_API; + $uc_avatarflash = UC_API.'/images/camera.swf?inajax=1&appid='.UC_APPID.'&input='.$uc_input.'&agent='.md5($_SERVER['HTTP_USER_AGENT']).'&ucapi='.urlencode(UC_API).'&avatartype='.$type.'&uploadSize=2048'; + $uc_avatarhtml5 = UC_API.'/index.php?m=user&a=camera&width=450&height=253&appid='.UC_APPID.'&input='.$uc_input.'&agent='.md5($_SERVER['HTTP_USER_AGENT']).'&ucapi='.urlencode(UC_API).'&avatartype='.$type.'&uploadSize=2048'; + $uc_avatarstl = $avatarpath.'/index.php?m=user&inajax=1&a=rectavatar&appid='.UC_APPID.'&input='.$uc_input.'&agent='.md5($_SERVER['HTTP_USER_AGENT']).'&avatartype='.$type.'&base64=yes'; + if($returnhtml) { + $flash = ''; + $html5 = ''; + return ''; + } else { + return array( + 'width', '450', + 'height', '253', + 'scale', 'exactfit', + 'src', $uc_avatarflash, + 'html5_src', $uc_avatarhtml5, + 'stl_src', $uc_avatarstl, + 'id', 'mycamera', + 'name', 'mycamera', + 'quality','high', + 'bgcolor','#ffffff', + 'menu', 'false', + 'swLiveConnect', 'true', + 'allowScriptAccess', 'always' + ); + } +} + +function uc_rectavatar($uid) { + return uc_api_mysql('user', 'rectavatar', array('uid' => $uid)); +} + +function uc_mail_queue($uids, $emails, $subject, $message, $frommail = '', $charset = 'gbk', $htmlon = FALSE, $level = 1) { + return call_user_func(UC_API_FUNC, 'mail', 'add', array('uids' => $uids, 'emails' => $emails, 'subject' => $subject, 'message' => $message, 'frommail' => $frommail, 'charset' => $charset, 'htmlon' => $htmlon, 'level' => $level)); +} + +function uc_check_avatar($uid, $size = 'middle', $type = 'virtual') { + if(UC_STANDALONE && @include UC_ROOT.'./extend_client.php') { + $uc_chk = new uc_note_handler(); + $res = $uc_chk->checkavatar(array('uid' => $uid, 'size' => $size, 'type' => $type), array()); + } else { + $url = UC_API."/avatar.php?uid=$uid&size=$size&type=$type&check_file_exists=1"; + $res = uc_fopen2($url, 500000, '', '', TRUE, UC_IP, 20); + } + if($res == 1) { + return 1; + } else { + return 0; + } +} + +function uc_check_version() { + $return = uc_api_post('version', 'check', array()); + $data = uc_unserialize($return); + return is_array($data) ? $data : $return; +} + +?> \ No newline at end of file diff --git a/uc_client/client/control/index.htm b/uc_client/client/control/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_client/client/index.htm b/uc_client/client/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_client/control/app.php b/uc_client/control/app.php new file mode 100644 index 0000000..35f7cff --- /dev/null +++ b/uc_client/control/app.php @@ -0,0 +1,44 @@ +appcontrol(); + } + + function appcontrol() { + parent::__construct(); + $this->load('app'); + } + + function onls() { + $this->init_input(); + $applist = $_ENV['app']->get_apps('appid, type, name, url, tagtemplates, viewprourl, synlogin'); + $applist2 = array(); + foreach($applist as $key => $app) { + $app['tagtemplates'] = $this->unserialize($app['tagtemplates']); + $applist2[$app['appid']] = $app; + } + return $applist2; + } + + function onadd() { + } + + function onucinfo() { + } + + function _format_notedata($notedata) { + } +} + +?> \ No newline at end of file diff --git a/uc_client/control/cache.php b/uc_client/control/cache.php new file mode 100644 index 0000000..d4197e7 --- /dev/null +++ b/uc_client/control/cache.php @@ -0,0 +1,29 @@ +cachecontrol(); + } + + function cachecontrol() { + parent::__construct(); + } + + function onupdate($arr) { + $this->load("cache"); + $_ENV['cache']->updatedata(); + } + +} + +?> \ No newline at end of file diff --git a/uc_client/control/domain.php b/uc_client/control/domain.php new file mode 100644 index 0000000..0b1f657 --- /dev/null +++ b/uc_client/control/domain.php @@ -0,0 +1,29 @@ +domaincontrol(); + } + + function domaincontrol() { + parent::__construct(); + $this->init_input(); + $this->load('domain'); + } + + function onls() { + return $_ENV['domain']->get_list(1, 9999, 9999); + } +} + +?> \ No newline at end of file diff --git a/uc_client/control/feed.php b/uc_client/control/feed.php new file mode 100644 index 0000000..9a0f6a1 --- /dev/null +++ b/uc_client/control/feed.php @@ -0,0 +1,105 @@ +feedcontrol(); + } + + function feedcontrol() { + parent::__construct(); + $this->init_input(); + } + + function onadd() { + $this->load('misc'); + $appid = intval($this->input('appid')); + $icon = $this->input('icon'); + $uid = intval($this->input('uid')); + $username = $this->input('username'); + $body_data = $_ENV['misc']->array2string($this->input('body_data')); + $title_data = $_ENV['misc']->array2string($this->input('title_data')); + + $title_template = $this->_parsetemplate($this->input('title_template')); + $body_template = $this->_parsetemplate($this->input('body_template')); + $body_general = $this->input('body_general'); + $target_ids = $this->input('target_ids'); + $image_1 = $this->input('image_1'); + $image_1_link = $this->input('image_1_link'); + $image_2 = $this->input('image_2'); + $image_2_link = $this->input('image_2_link'); + $image_3 = $this->input('image_3'); + $image_3_link = $this->input('image_3_link'); + $image_4 = $this->input('image_4'); + $image_4_link = $this->input('image_4_link'); + + $hash_template = md5($title_template.$body_template); + $hash_data = md5($title_template.$title_data.$body_template.$body_data); + $dateline = $this->time; + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."feeds SET appid='$appid', icon='$icon', uid='$uid', username='$username', + title_template='$title_template', title_data='$title_data', body_template='$body_template', body_data='$body_data', body_general='$body_general', + image_1='$image_1', image_1_link='$image_1_link', image_2='$image_2', image_2_link='$image_2_link', + image_3='$image_3', image_3_link='$image_3_link', image_4='$image_4', image_4_link='$image_4_link', + hash_template='$hash_template', hash_data='$hash_data', target_ids='$target_ids', dateline='$dateline'"); + return $this->db->insert_id(); + } + + function ondelete() { + $start = $this->input('start'); + $limit = $this->input('limit'); + $end = $start + $limit; + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."feeds WHERE feedid>'$start' AND feedid<'$end'"); + } + + function onget() { + $this->load('misc'); + $limit = intval($this->input('limit')); + $delete = $this->input('delete'); + $feedlist = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."feeds ORDER BY feedid DESC LIMIT $limit"); + if($feedlist) { + $maxfeedid = $feedlist[0]['feedid']; + foreach($feedlist as $key => $feed) { + $feed['body_data'] = $_ENV['misc']->string2array($feed['body_data']); + $feed['title_data'] = $_ENV['misc']->string2array($feed['title_data']); + $feedlist[$key] = $feed; + } + } + if(!empty($feedlist)) { + if(!isset($delete) || $delete) { + $this->_delete(0, $maxfeedid); + } + } + return $feedlist; + } + + function _delete($start, $end) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."feeds WHERE feedid>='$start' AND feedid<='$end'"); + } + + function _parsetemplate($template) { + $template = str_replace(array("\r", "\n"), '', $template); + $template = str_replace(array('
                              ', '
                              ', '
                              ', '
                              '), "\n", $template); + $template = str_replace(array('', ''), '[B]', $template); + $template = str_replace(array('', ''), '[I]', $template); + $template = str_replace(array('', ''), '[U]', $template); + $template = str_replace(array('', ''), '[/B]', $template); + $template = str_replace(array('', ''), '[/I]', $template); + $template = str_replace(array('', ''), '[/U]', $template); + $template = dhtmlspecialchars($template); + $template = nl2br($template); + $template = str_replace(array('[B]', '[I]', '[U]', '[/B]', '[/I]', '[/U]'), array('', '', '', '', '', ''), $template); + return $template; + } + +} + +?> \ No newline at end of file diff --git a/uc_client/control/friend.php b/uc_client/control/friend.php new file mode 100644 index 0000000..0d4b33f --- /dev/null +++ b/uc_client/control/friend.php @@ -0,0 +1,59 @@ +friendcontrol(); + } + + function friendcontrol() { + parent::__construct(); + $this->init_input(); + $this->load('friend'); + } + + function ondelete() { + $uid = intval($this->input('uid')); + $friendids = $this->input('friendids'); + $id = $_ENV['friend']->delete($uid, $friendids); + return $id; + } + + function onadd() { + $uid = intval($this->input('uid')); + $friendid = $this->input('friendid'); + $comment = $this->input('comment'); + $id = $_ENV['friend']->add($uid, $friendid, $comment); + return $id; + } + + function ontotalnum() { + $uid = intval($this->input('uid')); + $direction = intval($this->input('direction')); + $totalnum = $_ENV['friend']->get_totalnum_by_uid($uid, $direction); + return $totalnum; + } + + function onls() { + $uid = intval($this->input('uid')); + $page = intval($this->input('page')); + $pagesize = intval($this->input('pagesize')); + $totalnum = intval($this->input('totalnum')); + $direction = intval($this->input('direction')); + $pagesize = $pagesize ? $pagesize : UC_PPP; + $totalnum = $totalnum ? $totalnum : $_ENV['friend']->get_totalnum_by_uid($uid); + $data = $_ENV['friend']->get_list($uid, $page, $pagesize, $totalnum, $direction); + return $data; + } +} + +?> \ No newline at end of file diff --git a/uc_client/control/index.htm b/uc_client/control/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_client/control/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_client/control/mail.php b/uc_client/control/mail.php new file mode 100644 index 0000000..5ded576 --- /dev/null +++ b/uc_client/control/mail.php @@ -0,0 +1,41 @@ +mailcontrol(); + } + + function mailcontrol() { + parent::__construct(); + $this->init_input(); + } + + function onadd() { + $this->load('mail'); + $mail = array(); + $mail['appid'] = UC_APPID; + $mail['uids'] = explode(',', $this->input('uids')); + $mail['emails'] = explode(',', $this->input('emails')); + $mail['subject'] = $this->input('subject'); + $mail['message'] = $this->input('message'); + $mail['charset'] = $this->input('charset'); + $mail['htmlon'] = intval($this->input('htmlon')); + $mail['level'] = abs(intval($this->input('level'))); + $mail['frommail'] = $this->input('frommail'); + $mail['dateline'] = $this->time; + return $_ENV['mail']->add($mail); + } + +} + +?> \ No newline at end of file diff --git a/uc_client/control/pm.php b/uc_client/control/pm.php new file mode 100644 index 0000000..47c8e2a --- /dev/null +++ b/uc_client/control/pm.php @@ -0,0 +1,365 @@ +pmcontrol(); + } + + function pmcontrol() { + parent::__construct(); + $this->load('user'); + $this->load('pm'); + } + + function oncheck_newpm() { + $this->init_input(); + $uid = intval($this->input('uid')); + $more = intval($this->input('more')); + if(!$_ENV['pm']->isnewpm($uid) && !$more) { + return 0; + } + $newprvpm = $_ENV['pm']->getpmnum($uid, 1, 1); + $newchatpm = $_ENV['pm']->getpmnum($uid, 2, 1); + $newpm = $newprvpm + $newchatpm; + if($more == 0) { + return $newpm; + } elseif($more == 1) { + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm); + } elseif($more == 2 || $more == 3) { + if($more == 2) { + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'newchatpm' => $newchatpm); + } else { + $lastpm = $_ENV['pm']->lastpm($uid); + require_once UC_ROOT.'lib/uccode.class.php'; + $this->uccode = new uccode(); + $lastpm['lastsummary'] = $this->uccode->complie($lastpm['lastsummary']); + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'newchatpm' => $newchatpm, 'lastdate' => $lastpm['lastdateline'], 'lastmsgfromid' => $lastpm['lastauthorid'], 'lastmsgfrom' => $lastpm['lastauthorusername'], 'lastmsg' => $lastpm['lastsummary']); + } + } elseif($more == 4) { + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'newchatpm' => $newchatpm); + } else { + return 0; + } + } + + function onsendpm() { + $this->init_input(); + $fromuid = $this->input('fromuid'); + $msgto = $this->input('msgto'); + $subject = $this->input('subject'); + $message = $this->input('message'); + $replypmid = $this->input('replypmid'); + $isusername = $this->input('isusername'); + $type = $this->input('type'); + + if(!$fromuid) { + return 0; + } + + $user = $_ENV['user']->get_user_by_uid($fromuid); + $user = daddslashes($user, 1); + if(!$user) { + return 0; + } + $this->user['uid'] = $user['uid']; + $this->user['username'] = $user['username']; + + if($replypmid) { + $isusername = 0; + $plid = $_ENV['pm']->getplidbypmid($replypmid); + $msgto = $_ENV['pm']->getuidbyplid($plid); + unset($msgto[$this->user['uid']]); + } else { + if(!empty($msgto)) { + $msgto = array_unique(explode(',', $msgto)); + } + } + + if($isusername) { + $msgto = $_ENV['user']->name2id($msgto); + } + $countmsgto = count($msgto); + + if($this->settings['pmsendregdays']) { + if($user['regdate'] > $this->time - $this->settings['pmsendregdays'] * 86400) { + return PMSENDREGDAYS; + } + } + if($this->settings['chatpmmemberlimit']) { + if($type == 1 && ($countmsgto > ($this->settings['chatpmmemberlimit'] - 1))) { + return CHATPMMEMBERLIMIT_ERROR; + } + } + if($this->settings['pmfloodctrl']) { + if(!$_ENV['pm']->ispminterval($this->user['uid'], $this->settings['pmfloodctrl'])) { + return PMFLOODCTRL_ERROR; + } + } + if($this->settings['privatepmthreadlimit']) { + if(!$_ENV['pm']->isprivatepmthreadlimit($this->user['uid'], $this->settings['privatepmthreadlimit'])) { + return PRIVATEPMTHREADLIMIT_ERROR; + } + } + if($this->settings['chatpmthreadlimit']) { + if(!$_ENV['pm']->ischatpmthreadlimit($this->user['uid'], $this->settings['chatpmthreadlimit'])) { + return CHATPMTHREADLIMIT_ERROR; + } + } + + $lastpmid = 0; + if($replypmid) { + $lastpmid = $_ENV['pm']->replypm($plid, $this->user['uid'], $this->user['username'], $message); + } else { + $lastpmid = $_ENV['pm']->sendpm($this->user['uid'], $this->user['username'], $msgto, $subject, $message, $type); + } + return $lastpmid; + } + + function ondelete() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $pmids = $this->input('pmids'); + if(empty($pmids)) { + return 0; + } + if(is_array($pmids)) { + $this->apps = $this->cache('apps'); + if($this->apps[$this->app['appid']]['type'] == 'UCHOME') { + $id = $_ENV['pm']->deletepmbyplids($this->user['uid'], $this->input('pmids')); + } else { + $id = $_ENV['pm']->deletepmbypmids($this->user['uid'], $this->input('pmids')); + } + } else { + $id = $_ENV['pm']->deletepmbypmid($this->user['uid'], $this->input('pmids')); + } + return $id; + } + + function ondeletechat() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plids = $this->input('plids'); + $type = intval($this->input('type')); + if($type == 1) { + return $_ENV['pm']->deletepmbyplids($this->user['uid'], $plids); + } else { + return $_ENV['pm']->quitchatpm($this->user['uid'], $plids); + } + } + + function ondeleteuser() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $id = $_ENV['pm']->deletepmbyplids($this->user['uid'], $this->input('touids'), 1); + return $id; + } + + function onreadstatus() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $_ENV['pm']->setpmstatus($this->user['uid'], $this->input('uids'), $this->input('plids'), $this->input('status')); + } + + function onignore() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + return $_ENV['pm']->set_ignore($this->user['uid']); + } + + function onls() { + $this->init_input(); + $pagesize = $this->input('pagesize'); + $filter = $this->input('filter'); + $page = $this->input('page'); + $msglen = $this->input('msglen'); + $this->user['uid'] = intval($this->input('uid')); + + $filter = $filter ? (in_array($filter, array('newpm', 'privatepm')) ? $filter : '') : ''; + if($filter == 'newpm') { + $type = 0; + $new = 1; + } elseif($filter == 'privatepm') { + $type = 0; + $new = 0; + } else { + return array(); + } + $pmnum = $_ENV['pm']->getpmnum($this->user['uid'], $type, $new); + $start = $this->page_get_start($page, $pagesize, $pmnum); + + if($pagesize > 0) { + $pms = $_ENV['pm']->getpmlist($this->user['uid'], $filter, $start, $pagesize); + if(is_array($pms) && !empty($pms)) { + foreach($pms as $key => $pm) { + if($msglen) { + $pms[$key]['lastsummary'] = $_ENV['pm']->removecode($pms[$key]['lastsummary'], $msglen); + } else { + unset($pms[$key]['lastsummary']); + } + } + } + $result['data'] = $pms; + } + $result['count'] = $pmnum; + return $result; + } + + function onview() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $pmid = $this->input('pmid'); + $touid = $this->input('touid'); + $daterange = $this->input('daterange'); + $page = $this->input('page'); + $pagesize = $this->input('pagesize'); + $isplid = $this->input('isplid'); + $type = $this->input('type'); + + $daterange = empty($daterange) ? 1 : $daterange; + $today = $this->time - ($this->time + $this->settings['timeoffset']) % 86400; + if($daterange == 1) { + $starttime = $today; + } elseif($daterange == 2) { + $starttime = $today - 86400; + } elseif($daterange == 3) { + $starttime = $today - 172800; + } elseif($daterange == 4) { + $starttime = $today - 604800; + } elseif($daterange == 5) { + $starttime = 0; + } + $endtime = $this->time; + + if(!$isplid) { + $plid = $_ENV['pm']->getplidbytouid($this->user['uid'], $touid); + } else { + $plid = $touid; + } + if($page) { + $pmnum = $_ENV['pm']->getpmnumbyplid($this->user['uid'], $plid); + $start = $this->page_get_start($page, $pagesize, $pmnum); + $ppp = $pagesize; + } else { + $pmnum = 0; + $start = 0; + $ppp = 0; + } + + if($pmid) { + $pms = $_ENV['pm']->getpmbypmid($this->user['uid'], $pmid); + } else { + $pms = $_ENV['pm']->getpmbyplid($this->user['uid'], $plid, $starttime, $endtime, $start, $ppp, $type); + } + + require_once UC_ROOT.'lib/uccode.class.php'; + $this->uccode = new uccode(); + if($pms) { + foreach($pms as $key => $pm) { + $pms[$key]['message'] = $this->uccode->complie($pms[$key]['message']); + } + } + return $pms; + } + + function onviewnum() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $touid = $this->input('touid'); + $isplid = $this->input('isplid'); + if(!$isplid) { + $plid = $_ENV['pm']->getplidbytouid($this->user['uid'], $touid); + } else { + $plid = $touid; + } + $pmnum = $_ENV['pm']->getpmnumbyplid($this->user['uid'], $plid); + return $pmnum; + } + + function onviewnode() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $type = $this->input('type'); + $pmid = $this->input('pmid'); + $type = 0; + $pms = $_ENV['pm']->getpmbypmid($this->user['uid'], $pmid); + + require_once UC_ROOT.'lib/uccode.class.php'; + $this->uccode = new uccode(); + if($pms) { + foreach($pms as $key => $pm) { + $pms[$key]['message'] = $this->uccode->complie($pms[$key]['message']); + } + } + $pms = $pms[0]; + return $pms; + } + + function onchatpmmemberlist() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plid = intval($this->input('plid')); + return $_ENV['pm']->chatpmmemberlist($this->user['uid'], $plid); + } + + function onkickchatpm() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plid = intval($this->input('plid')); + $touid = intval($this->input('touid')); + return $_ENV['pm']->kickchatpm($plid, $this->user['uid'], $touid); + } + + function onappendchatpm() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plid = intval($this->input('plid')); + $touid = intval($this->input('touid')); + return $_ENV['pm']->appendchatpm($plid, $this->user['uid'], $touid); + } + + function onblackls_get() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + return $_ENV['pm']->get_blackls($this->user['uid']); + } + + function onblackls_set() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $blackls = $this->input('blackls'); + return $_ENV['pm']->set_blackls($this->user['uid'], $blackls); + } + + function onblackls_add() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $username = $this->input('username'); + return $_ENV['pm']->update_blackls($this->user['uid'], $username, 1); + } + + function onblackls_delete($arr) { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $username = $this->input('username'); + return $_ENV['pm']->update_blackls($this->user['uid'], $username, 2); + } +} + +?> \ No newline at end of file diff --git a/uc_client/control/tag.php b/uc_client/control/tag.php new file mode 100644 index 0000000..5d68b25 --- /dev/null +++ b/uc_client/control/tag.php @@ -0,0 +1,85 @@ +tagcontrol(); + } + + function tagcontrol() { + parent::__construct(); + $this->init_input(); + $this->load('tag'); + $this->load('misc'); + } + + function ongettag() { + $appid = $this->input('appid'); + $tagname = $this->input('tagname'); + $nums = $this->input('nums'); + if(empty($tagname)) { + return NULL; + } + $return = $apparray = $appadd = array(); + + if($nums && is_array($nums)) { + foreach($nums as $k => $num) { + $apparray[$k] = $k; + } + } + + $data = $_ENV['tag']->get_tag_by_name($tagname); + if($data) { + $apparraynew = array(); + foreach($data as $tagdata) { + $row = $r = array(); + $tmp = explode("\t", $tagdata['data']); + $type = $tmp[0]; + array_shift($tmp); + foreach($tmp as $tmp1) { + $tmp1 != '' && $r[] = $_ENV['misc']->string2array($tmp1); + } + if(in_array($tagdata['appid'], $apparray)) { + if($tagdata['expiration'] > 0 && $this->time - $tagdata['expiration'] > 3600) { + $appadd[] = $tagdata['appid']; + $_ENV['tag']->formatcache($tagdata['appid'], $tagname); + } else { + $apparraynew[] = $tagdata['appid']; + } + $datakey = array(); + $count = 0; + foreach($r as $data) { + $return[$tagdata['appid']]['data'][] = $data; + $return[$tagdata['appid']]['type'] = $type; + $count++; + if($count >= $nums[$tagdata['appid']]) { + break; + } + } + } + } + $apparray = array_diff($apparray, $apparraynew); + } else { + foreach($apparray as $appid) { + $_ENV['tag']->formatcache($appid, $tagname); + } + } + if($apparray) { + $this->load('note'); + $_ENV['note']->add('gettag', "id=$tagname", '', $appadd, -1); + } + return $return; + } + +} + +?> \ No newline at end of file diff --git a/uc_client/control/user.php b/uc_client/control/user.php new file mode 100644 index 0000000..cba03fa --- /dev/null +++ b/uc_client/control/user.php @@ -0,0 +1,424 @@ +usercontrol(); + } + + function usercontrol() { + parent::__construct(); + $this->load('user'); + $this->app = $this->cache['apps'][UC_APPID]; + } + + function onsynlogin() { + $this->init_input(); + $uid = $this->input('uid'); + if($this->app['synlogin']) { + if($this->user = $_ENV['user']->get_user_by_uid($uid)) { + $synstr = ''; + foreach($this->cache['apps'] as $appid => $app) { + if($app['synlogin'] && $app['appid'] != $this->app['appid']) { + $synstr .= ''; + } + } + return $synstr; + } + } + return ''; + } + + function onsynlogout() { + $this->init_input(); + if($this->app['synlogin']) { + $synstr = ''; + foreach($this->cache['apps'] as $appid => $app) { + if($app['synlogin'] && $app['appid'] != $this->app['appid']) { + $synstr .= ''; + } + } + return $synstr; + } + return ''; + } + + function onregister() { + $this->init_input(); + $username = $this->input('username'); + $password = $this->input('password'); + $email = $this->input('email'); + $questionid = $this->input('questionid'); + $answer = $this->input('answer'); + $regip = $this->input('regip'); + $secmobicc = $this->input('secmobicc'); + $secmobile = $this->input('secmobile'); + + if(($status = $this->_check_username($username)) < 0) { + return $status; + } + if(($status = $this->_check_email($email)) < 0) { + return $status; + } + if(($status = $this->_check_secmobile($secmobicc, $secmobile)) > 0) { + return UC_USER_SECMOBILE_EXISTS; + } + + $uid = $_ENV['user']->add_user($username, $password, $email, 0, $questionid, $answer, $regip, $secmobicc, $secmobile); + return $uid; + } + + function onedit() { + $this->init_input(); + $username = $this->input('username'); + $oldpw = $this->input('oldpw'); + $newpw = $this->input('newpw'); + $email = $this->input('email'); + $ignoreoldpw = $this->input('ignoreoldpw'); + $questionid = $this->input('questionid'); + $answer = $this->input('answer'); + $secmobicc = $this->input('secmobicc'); + $secmobile = $this->input('secmobile'); + + if(!$ignoreoldpw && $email && ($status = $this->_check_email($email, $username)) < 0) { + return $status; + } + if(($status = $this->_check_secmobile($secmobicc, $secmobile, $username)) > 0) { + return UC_USER_SECMOBILE_EXISTS; + } + + $status = $_ENV['user']->edit_user($username, $oldpw, $newpw, $email, $ignoreoldpw, $questionid, $answer, $secmobicc, $secmobile); + + if($newpw && $status > 0) { + $this->load('note'); + $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='); + $_ENV['note']->send(); + } + if($status > 0) { + $tmp = $_ENV['user']->get_user_by_username($username); + $_ENV['user']->user_log($tmp['uid'], 'edituser', 'uid='.$tmp['uid'].'&email='.urlencode($email).'&secmobicc='.urlencode($secmobicc).'&secmobile='.urlencode($secmobile)); + } + return $status; + } + + function onlogin() { + $this->init_input(); + $isuid = $this->input('isuid'); + $username = $this->input('username'); + $password = $this->input('password'); + $checkques = $this->input('checkques'); + $questionid = $this->input('questionid'); + $answer = $this->input('answer'); + $ip = $this->input('ip'); + $nolog = $this->input('nolog'); + + $check_times = $this->settings['login_failedtime'] > 0 ? $this->settings['login_failedtime'] : ($this->settings['login_failedtime'] < 0 ? 0 : 5); + + if($ip && $check_times && !$loginperm = $_ENV['user']->can_do_login($username, $ip)) { + $status = -4; + return array($status, '', $password, '', 0); + } + + if($isuid == 1) { + $user = $_ENV['user']->get_user_by_uid($username); + } elseif($isuid == 2) { + $user = $_ENV['user']->get_user_by_email($username); + } elseif($isuid == 4) { + list($secmobicc, $secmobile) = explode('-', $username); + $user = $_ENV['user']->get_user_by_secmobile($secmobicc, $secmobile); + } else { + $user = $_ENV['user']->get_user_by_username($username); + } + + if(empty($user)) { + $status = -1; + } elseif(!$_ENV['user']->verify_password($password, $user['password'], $user['salt'])) { + $status = -2; + } elseif($checkques && $user['secques'] != $_ENV['user']->quescrypt($questionid, $answer)) { + $status = -3; + } else { + $_ENV['user']->upgrade_password($username, $password, $user['password'], $user['salt']); + $status = $user['uid']; + } + if(!$nolog && $ip && $check_times && $status <= 0) { + $_ENV['user']->loginfailed($username, $ip); + } + $merge = $status != -1 && !$isuid && $_ENV['user']->check_mergeuser($username) ? 1 : 0; + return array($status, $user['username'], $password, $user['email'], $merge); + } + + function onlogincheck() { + $this->init_input(); + $username = $this->input('username'); + $ip = $this->input('ip'); + return $_ENV['user']->can_do_login($username, $ip); + } + + function oncheck_email() { + $this->init_input(); + $email = $this->input('email'); + return $this->_check_email($email); + } + + function oncheck_secmobile() { + $this->init_input(); + $secmobicc = $this->input('secmobicc'); + $secmobile = $this->input('secmobile'); + return $this->_check_secmobile($secmobicc, $secmobile); + } + + function oncheck_username() { + $this->init_input(); + $username = $this->input('username'); + if(($status = $this->_check_username($username)) < 0) { + return $status; + } else { + return 1; + } + } + + function onget_user() { + $this->init_input(); + $username = $this->input('username'); + if(!$this->input('isuid')) { + $status = $_ENV['user']->get_user_by_username($username); + } else { + $status = $_ENV['user']->get_user_by_uid($username); + } + if($status) { + return array($status['uid'],$status['username'],$status['email']); + } else { + return 0; + } + } + + function onchgusername() { + $this->init_input(); + $uid = $this->input('uid'); + $newusername = $this->input('newusername'); + if(($status = $this->_check_username($newusername)) < 0) { + return $status; + } + $user = $_ENV['user']->get_user_by_uid($uid); + $oldusername = $user['username']; + if($_ENV['user']->chgusername($uid, $newusername)) { + $_ENV['user']->user_log($uid, 'renameuser', 'uid='.$uid.'&oldusername='.urlencode($oldusername).'&newusername='.urlencode($newusername)); + $this->load('note'); + $_ENV['note']->add('renameuser', 'uid='.$uid.'&oldusername='.urlencode($oldusername).'&newusername='.urlencode($newusername)); + $_ENV['note']->send(); + return 1; + } + return UC_USER_USERNAME_CHANGE_FAILED; + } + + function ongetprotected() { + $this->init_input(); + $protectedmembers = $this->db->fetch_all("SELECT uid,username FROM ".UC_DBTABLEPRE."protectedmembers GROUP BY username"); + return $protectedmembers; + } + + function ondelete() { + $this->init_input(); + $uid = $this->input('uid'); + return $_ENV['user']->delete_user($uid); + } + + function ondeleteavatar() { + $this->init_input(); + $uid = $this->input('uid'); + $_ENV['user']->delete_useravatar($uid); + } + + function onaddprotected() { + $this->init_input(); + $username = $this->input('username'); + $admin = $this->input('admin'); + $appid = $this->app['appid']; + $usernames = (array)$username; + foreach($usernames as $username) { + $user = $_ENV['user']->get_user_by_username($username); + $uid = $user['uid']; + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."protectedmembers SET uid='$uid', username='$username', appid='$appid', dateline='{$this->time}', admin='$admin'", 'SILENT'); + } + return $this->db->errno() ? -1 : 1; + } + + function ondeleteprotected() { + $this->init_input(); + $username = $this->input('username'); + $appid = $this->app['appid']; + $usernames = (array)$username; + foreach($usernames as $username) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."protectedmembers WHERE username='$username' AND appid='$appid'"); + } + return $this->db->errno() ? -1 : 1; + } + + function onmerge() { + $this->init_input(); + $oldusername = $this->input('oldusername'); + $newusername = $this->input('newusername'); + $uid = $this->input('uid'); + $password = $this->input('password'); + $email = $this->input('email'); + if(($status = $this->_check_username($newusername)) < 0) { + return $status; + } + $uid = $_ENV['user']->add_user($newusername, $password, $email, $uid); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mergemembers WHERE appid='".$this->app['appid']."' AND username='$oldusername'"); + return $uid; + } + + function onmerge_remove() { + $this->init_input(); + $username = $this->input('username'); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mergemembers WHERE appid='".$this->app['appid']."' AND username='$username'"); + return NULL; + } + + function _check_username($username) { + $username = addslashes(trim(stripslashes($username))); + if(!$_ENV['user']->check_username($username)) { + return UC_USER_CHECK_USERNAME_FAILED; + } elseif(!$_ENV['user']->check_usernamecensor($username)) { + return UC_USER_USERNAME_BADWORD; + } elseif($_ENV['user']->check_usernameexists($username)) { + return UC_USER_USERNAME_EXISTS; + } + return 1; + } + + function _check_email($email, $username = '') { + if(empty($this->settings)) { + $this->settings = $this->cache('settings'); + } + if(!$_ENV['user']->check_emailformat($email)) { + return UC_USER_EMAIL_FORMAT_ILLEGAL; + } elseif(!$_ENV['user']->check_emailaccess($email)) { + return UC_USER_EMAIL_ACCESS_ILLEGAL; + } elseif(!$this->settings['doublee'] && $_ENV['user']->check_emailexists($email, $username)) { + return UC_USER_EMAIL_EXISTS; + } else { + return 1; + } + } + + function _check_secmobile($secmobicc, $secmobile, $username = '') { + return $_ENV['user']->check_secmobileexists($secmobicc, $secmobile, $username); + } + + function onuploadavatar() { + } + + function onrectavatar() { + @header("Expires: 0"); + @header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + if(getgpc('base64', 'G')){ + header("Content-type: text/html; charset=utf-8"); + }else{ + header("Content-type: application/xml; charset=utf-8"); + } + $this->init_input(getgpc('agent')); + $uid = $this->input('uid'); + if(empty($uid)) { + return ''; + } + $home = $this->get_home($uid); + if(!defined('UC_UPAVTDIR')) { + define('UC_UPAVTDIR', UC_DATADIR.'./avatar/'); + } + if(!is_dir(UC_UPAVTDIR.$home)) { + $this->set_home($uid, UC_UPAVTDIR); + } + $avatartype = getgpc('avatartype', 'G') == 'real' ? 'real' : 'virtual'; + $bigavatarfile = UC_UPAVTDIR.$this->get_avatar($uid, 'big', $avatartype); + $middleavatarfile = UC_UPAVTDIR.$this->get_avatar($uid, 'middle', $avatartype); + $smallavatarfile = UC_UPAVTDIR.$this->get_avatar($uid, 'small', $avatartype); + $bigavatar = $this->flashdata_decode(getgpc('avatar1', 'P')); + $middleavatar = $this->flashdata_decode(getgpc('avatar2', 'P')); + $smallavatar = $this->flashdata_decode(getgpc('avatar3', 'P')); + if(!$bigavatar || !$middleavatar || !$smallavatar) { + return ''; + } + + $success = 1; + $fp = @fopen($bigavatarfile, 'wb'); + @fwrite($fp, $bigavatar); + @fclose($fp); + + $fp = @fopen($middleavatarfile, 'wb'); + @fwrite($fp, $middleavatar); + @fclose($fp); + + $fp = @fopen($smallavatarfile, 'wb'); + @fwrite($fp, $smallavatar); + @fclose($fp); + + $biginfo = @getimagesize($bigavatarfile); + $middleinfo = @getimagesize($middleavatarfile); + $smallinfo = @getimagesize($smallavatarfile); + if(!$biginfo || !$middleinfo || !$smallinfo || $biginfo[2] == 4 || $middleinfo[2] == 4 || $smallinfo[2] == 4 + || $biginfo[0] > 200 || $biginfo[1] > 250 || $middleinfo[0] > 120 || $middleinfo[1] > 120 || $smallinfo[0] > 48 || $smallinfo[1] > 48) { + file_exists($bigavatarfile) && unlink($bigavatarfile); + file_exists($middleavatarfile) && unlink($middleavatarfile); + file_exists($smallavatarfile) && unlink($smallavatarfile); + $success = 0; + } + + if(getgpc('base64', 'G')){ + if($success) { + return ""; + } else { + return ""; + } + }else{ + $filetype = '.jpg'; + @unlink(UC_DATADIR.'./tmp/upload'.$uid.$filetype); + if($success) { + return ''; + } else { + return ''; + } + } + } + + + function flashdata_decode($s) { + $r = ''; + if(getgpc('base64', 'G')){ + $r = base64_decode($s); + }else{ + $l = strlen($s); + for($i=0; $i<$l; $i=$i+2) { + $k1 = ord($s[$i]) - 48; + $k1 -= $k1 > 9 ? 7 : 0; + $k2 = ord($s[$i+1]) - 48; + $k2 -= $k2 > 9 ? 7 : 0; + $r .= chr($k1 << 4 | $k2); + } + } + return $r; + } +} + +?> \ No newline at end of file diff --git a/uc_client/data/cache/apps.php b/uc_client/data/cache/apps.php new file mode 100644 index 0000000..46d7bae --- /dev/null +++ b/uc_client/data/cache/apps.php @@ -0,0 +1,22 @@ + + array ( + 'appid' => '1', + 'type' => 'DISCUZX', + 'name' => 'Discuz! Board', + 'url' => 'http://localhost:8080/discuz', + 'ip' => '', + 'viewprourl' => '', + 'apifilename' => 'uc.php', + 'charset' => 'utf-8', + 'dbcharset' => 'utf8mb4', + 'synlogin' => '1', + 'recvnote' => '1', + 'extra' => '', + 'tagtemplates' => '', + 'allowips' => '', + ), +); + +?> \ No newline at end of file diff --git a/uc_client/data/cache/index.htm b/uc_client/data/cache/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_client/data/cache/settings.php b/uc_client/data/cache/settings.php new file mode 100644 index 0000000..d41197b --- /dev/null +++ b/uc_client/data/cache/settings.php @@ -0,0 +1,35 @@ + '', + 'addappbyurl' => '0', + 'censoremail' => '', + 'censorusername' => '', + 'chatpmmemberlimit' => '35', + 'chatpmthreadlimit' => '30', + 'dateformat' => 'y-n-j', + 'doublee' => '0', + 'insecureoperation' => '0', + 'login_failedtime' => '5', + 'mailauth' => '1', + 'mailauth_password' => 'password', + 'mailauth_username' => 'username@21cn.com', + 'maildefault' => 'username@21cn.com', + 'maildelimiter' => '0', + 'mailfrom' => 'UCenter ', + 'mailport' => '25', + 'mailsend' => '1', + 'mailserver' => 'smtp.21cn.com', + 'mailsilent' => '1', + 'mailtimeout' => '30', + 'mailusername' => '1', + 'nextnotetime' => '0', + 'pmcenter' => '1', + 'pmfloodctrl' => '15', + 'pmsendregdays' => '0', + 'privatepmthreadlimit' => '25', + 'sendpmseccode' => '1', + 'timeoffset' => '28800', + 'version' => '1.7.0', +); + +?> \ No newline at end of file diff --git a/uc_client/data/index.htm b/uc_client/data/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_client/extend_client.php b/uc_client/extend_client.php new file mode 100644 index 0000000..76d13e2 --- /dev/null +++ b/uc_client/extend_client.php @@ -0,0 +1,141 @@ +fetch_all($uids)); + require_once DISCUZ_ROOT.'./source/function/function_delete.php'; + $ids && deletemember($ids); + + return API_RETURN_SUCCEED; + } + + public static function renameuser($get, $post) { + global $_G; + $len = strlen($get['newusername']); + if($len > 22 || $len < 3 || preg_match("/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&\(\)']/is", $get['newusername'])) { + return API_RETURN_FAILED; + } + + $tables = array( + 'common_block' => array('id' => 'uid', 'name' => 'username'), + 'common_invite' => array('id' => 'fuid', 'name' => 'fusername'), + 'common_member_verify_info' => array('id' => 'uid', 'name' => 'username'), + 'common_mytask' => array('id' => 'uid', 'name' => 'username'), + 'common_report' => array('id' => 'uid', 'name' => 'username'), + + 'forum_thread' => array('id' => 'authorid', 'name' => 'author'), + 'forum_activityapply' => array('id' => 'uid', 'name' => 'username'), + 'forum_groupuser' => array('id' => 'uid', 'name' => 'username'), + 'forum_pollvoter' => array('id' => 'uid', 'name' => 'username'), + 'forum_post' => array('id' => 'authorid', 'name' => 'author'), + 'forum_postcomment' => array('id' => 'authorid', 'name' => 'author'), + 'forum_ratelog' => array('id' => 'uid', 'name' => 'username'), + + 'home_album' => array('id' => 'uid', 'name' => 'username'), + 'home_blog' => array('id' => 'uid', 'name' => 'username'), + 'home_clickuser' => array('id' => 'uid', 'name' => 'username'), + 'home_docomment' => array('id' => 'uid', 'name' => 'username'), + 'home_doing' => array('id' => 'uid', 'name' => 'username'), + 'home_feed' => array('id' => 'uid', 'name' => 'username'), + 'home_friend' => array('id' => 'fuid', 'name' => 'fusername'), + 'home_friend_request' => array('id' => 'fuid', 'name' => 'fusername'), + 'home_notification' => array('id' => 'authorid', 'name' => 'author'), + 'home_pic' => array('id' => 'uid', 'name' => 'username'), + 'home_poke' => array('id' => 'fromuid', 'name' => 'fromusername'), + 'home_share' => array('id' => 'uid', 'name' => 'username'), + 'home_show' => array('id' => 'uid', 'name' => 'username'), + 'home_specialuser' => array('id' => 'uid', 'name' => 'username'), + 'home_visitor' => array('id' => 'vuid', 'name' => 'vusername'), + + 'portal_article_title' => array('id' => 'uid', 'name' => 'username'), + 'portal_comment' => array('id' => 'uid', 'name' => 'username'), + 'portal_topic' => array('id' => 'uid', 'name' => 'username'), + 'portal_topic_pic' => array('id' => 'uid', 'name' => 'username'), + ); + + if(!C::t('common_member')->update($get['uid'], array('username' => $get['newusername'])) && isset($_G['setting']['membersplit'])){ + C::t('common_member_archive')->update($get['uid'], array('username' => $get['newusername'])); + } + + loadcache("posttableids"); + if($_G['cache']['posttableids']) { + $posttableids = is_array($_G['cache']['posttableids']) ? $_G['cache']['posttableids'] : array(0); + foreach($posttableids AS $tableid) { + $tables[getposttable($tableid)] = array('id' => 'authorid', 'name' => 'author'); + } + } + + foreach($tables as $table => $conf) { + DB::query("UPDATE ".DB::table($table)." SET `{$conf['name']}`='{$get['newusername']}' WHERE `{$conf['id']}`='{$get['uid']}'"); + } + return API_RETURN_SUCCEED; + } + + public static function updatepw($get, $post) { + global $_G; + $username = $get['username']; + $newpw = md5(time().rand(100000, 999999)); + $uid = 0; + if(($uid = C::t('common_member')->fetch_uid_by_username($username))) { + $ext = ''; + } elseif(($uid = C::t('common_member_archive')->fetch_uid_by_username($username))) { + $ext = '_archive'; + } + if($uid) { + C::t('common_member'.$ext)->update($uid, array('password' => $newpw)); + } + + return API_RETURN_SUCCEED; + } + + public static function checkavatar($get, $post) { + global $_G; + $uid = $get['uid']; + $size = $get['size']; + $type = $get['type']; + $size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle'; + $uid = abs(intval($uid)); + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + $typeadd = $type == 'real' ? '_real' : ''; + if(!UC_AVTPATH) { + $avtpath = './data/avatar/'; + } else { + $avtpath = str_replace('..', '', UC_AVTPATH); + } + $avatarfile = realpath(DISCUZ_ROOT.$avtpath).'/'.$dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).$typeadd."_avatar_$size.jpg"; + if(file_exists($avatarfile)) { + return API_RETURN_SUCCEED; + } else { + return API_RETURN_FAILED; + } + } + + public static function loadavatarpath() { + global $_G; + if(!defined('UC_DELAVTDIR')) { + define('UC_DELAVTDIR', DISCUZ_ROOT.$_G['setting']['avatarpath'].'/'); + } + } +} \ No newline at end of file diff --git a/uc_client/index.htm b/uc_client/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_client/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_client/lib/dbi.class.php b/uc_client/lib/dbi.class.php new file mode 100644 index 0000000..ef8bca3 --- /dev/null +++ b/uc_client/lib/dbi.class.php @@ -0,0 +1,235 @@ +dbhost = $dbhost; + $this->dbuser = $dbuser; + $this->dbpw = $dbpw; + $this->dbname = $dbname; + $this->dbcharset = $dbcharset; + $this->pconnect = $pconnect; + $this->tablepre = $tablepre; + $this->time = $time; + + mysqli_report(MYSQLI_REPORT_OFF); + + if(!$this->link = new mysqli($dbhost, $dbuser, $dbpw, $dbname)) { + $this->halt('Can not connect to MySQL server'); + } + + $this->link->options(MYSQLI_OPT_LOCAL_INFILE, false); + + if($dbcharset) { + $this->link->set_charset($dbcharset); + } + + $this->link->query("SET sql_mode=''"); + + $this->link->query("SET character_set_client=binary"); + + } + + function fetch_array($query, $result_type = MYSQLI_ASSOC) { + return $query ? $query->fetch_array($result_type) : null; + } + + function result_first($sql) { + $query = $this->query($sql); + return $this->result($query, 0); + } + + function fetch_first($sql) { + $query = $this->query($sql); + return $this->fetch_array($query); + } + + function fetch_all($sql, $id = '') { + $arr = array(); + $query = $this->query($sql); + while($data = $this->fetch_array($query)) { + $id ? $arr[$data[$id]] = $data : $arr[] = $data; + } + return $arr; + } + + function result_first_stmt($sql, $key = array(), $value = array()) { + $query = $this->query_stmt($sql, $key, $value); + return $this->result($query, 0); + } + + function fetch_first_stmt($sql, $key = array(), $value = array()) { + $query = $this->query_stmt($sql, $key, $value); + return $this->fetch_array($query); + } + + function fetch_all_stmt($sql, $key = array(), $value = array(), $id = '') { + $arr = array(); + $query = $this->query_stmt($sql, $key, $value); + while($data = $this->fetch_array($query)) { + $id ? $arr[$data[$id]] = $data : $arr[] = $data; + } + return $arr; + } + + function cache_gc() { + $this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time"); + } + + function query($sql, $type = '', $cachetime = FALSE) { + $resultmode = $type == 'UNBUFFERED' ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT; + if(!($query = $this->link->query($sql, $resultmode)) && $type != 'SILENT') { + $this->halt('MySQL Query Error', $sql); + } + $this->querynum++; + $this->histories[] = $sql; + return $query; + } + + function query_stmt($sql, $key = array(), $value = array(), $type = '', $saveprep = FALSE, $cachetime = FALSE) { + $parse = $this->parse_query($sql, $key, $value); + if($saveprep && array_key_exists(hash("sha256", $parse[0]), $this->stmtcache)) { + $stmt = & $this->stmtcache[hash("sha256", $parse[0])]; + } else { + $stmt = $this->link->prepare($parse[0]); + $saveprep && $this->stmtcache[hash("sha256", $parse[0])] = & $stmt; + } + if(!empty($key)) { + $stmt->bind_param(...$parse[1]); + } + if(!($query = $stmt->execute()) && $type != 'SILENT') { + $this->halt('MySQL Query Error', $parse[0]); + } + $this->querynum++; + $this->histories[] = $parse[0]; + return strncasecmp("SELECT", $sql, 6) ? $query : $stmt->get_result(); + } + + function affected_rows() { + return $this->link->affected_rows; + } + + function error() { + return $this->link->error; + } + + function errno() { + return $this->link->errno; + } + + function result($query, $row) { + if(!$query || $query->num_rows == 0) { + return null; + } + $query->data_seek($row); + $assocs = $query->fetch_row(); + return $assocs[0]; + } + + function num_rows($query) { + $query = $query ? $query->num_rows : 0; + return $query; + } + + function num_fields($query) { + return $query ? $query->field_count : 0; + } + + function free_result($query) { + return $query ? $query->free() : false; + } + + function insert_id() { + return ($id = $this->link->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); + } + + function fetch_row($query) { + $query = $query ? $query->fetch_row() : null; + return $query; + } + + function fetch_fields($query) { + return $query ? $query->fetch_field() : null; + } + + function version() { + return $this->link->server_info; + } + + function escape_string($str) { + return $this->link->escape_string($str); + } + + function close() { + return $this->link->close(); + } + + function parse_query($sql, $key = array(), $value = array()) { + $list = ''; + $array = array(); + if(strpos($sql, '?')) { + foreach ($key as $k => $v) { + if(in_array($v, array('i', 'd', 's', 'b'))) { + $list .= $v; + $array = array_merge($array, (array)$value[$k]); + } + } + } else { + preg_match_all("/:([A-Za-z0-9]*?)( |$)/", $sql, $matches); + foreach ($matches[1] as $match) { + if(in_array($key[$match], array('i', 'd', 's', 'b'))) { + $list .= $key[$match]; + $array = array_merge($array, (array)$value[$match]); + $sql = str_replace(":".$match, "?", $sql); + } + } + } + return array($sql, array_merge((array)$list, $array)); + } + + function halt($message = '', $sql = '') { + $error = $this->error(); + $errorno = $this->errno(); + if($errorno == 2006 && $this->goneaway-- > 0) { + $this->connect($this->dbhost, $this->dbuser, $this->dbpw, $this->dbname, $this->dbcharset, $this->pconnect, $this->tablepre, $this->time); + $this->query($sql); + } else { + $s = ''; + if($message) { + $s = "UCenter info: $message
                              "; + } + if($sql) { + $s .= 'SQL:'.htmlspecialchars($sql).'
                              '; + } + $s .= 'Error:'.$error.'
                              '; + $s .= 'Errno:'.$errorno.'
                              '; + $s = str_replace(UC_DBTABLEPRE, '[Table]', $s); + exit($s); + } + } +} + +?> \ No newline at end of file diff --git a/uc_client/lib/index.htm b/uc_client/lib/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_client/lib/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_client/lib/sendmail.inc.php b/uc_client/lib/sendmail.inc.php new file mode 100644 index 0000000..d33c231 --- /dev/null +++ b/uc_client/lib/sendmail.inc.php @@ -0,0 +1,146 @@ +base->cache['apps'][$mail['appid']]['name']; +$mail['subject'] = '=?'.$mail['charset'].'?B?'.base64_encode(str_replace("\r", '', str_replace("\n", '', '['.$appname.'] '.$mail['subject']))).'?='; +$mail['message'] = chunk_split(base64_encode(str_replace("\r\n.", " \r\n..", str_replace("\n", "\r\n", str_replace("\r", "\n", str_replace("\r\n", "\n", str_replace("\n\r", "\r", $mail['message']))))))); + +$email_from = $mail['frommail'] == '' ? '=?'.$mail['charset'].'?B?'.base64_encode($appname)."?= <{$mail_setting['maildefault']}>" : (preg_match('/^(.+?) \<(.+?)\>$/',$email_from, $from) ? '=?'.$mail['charset'].'?B?'.base64_encode($from[1])."?= <$from[2]>" : $mail['frommail']); + +foreach(explode(',', $mail['email_to']) as $touser) { + $tousers[] = preg_match('/^(.+?) \<(.+?)\>$/',$touser, $to) ? ($mailusername ? '=?'.$mail['charset'].'?B?'.base64_encode($to[1])."?= <$to[2]>" : $to[2]) : $touser; +} + +$tousers = is_array($tousers) ? $tousers : array($tousers); + +$mail['email_to'] = implode(',', $tousers); + +$headers = "From: $email_from{$maildelimiter}X-Priority: 3{$maildelimiter}X-Mailer: Discuz! $version{$maildelimiter}MIME-Version: 1.0{$maildelimiter}Content-type: text/".($mail['htmlon'] ? 'html' : 'plain')."; charset={$mail['charset']}{$maildelimiter}Content-Transfer-Encoding: base64{$maildelimiter}"; + +$mail_setting['mailport'] = $mail_setting['mailport'] ? $mail_setting['mailport'] : 25; +$mail_setting['mailtimeout'] = isset($mail_setting['mailtimeout']) && strlen($mail_setting['mailtimeout']) ? intval($mail_setting['mailtimeout']) : 30; + +if($mail_setting['mailsend'] == 1 && function_exists('mail')) { + + return @mail($mail['email_to'], $mail['subject'], $mail['message'], $headers); + +} elseif($mail_setting['mailsend'] == 2) { + + if(!$fp = fsocketopen($mail_setting['mailserver'], $mail_setting['mailport'], $errno, $errstr, $mail_setting['mailtimeout'])) { + return false; + } + + stream_set_blocking($fp, true); + stream_set_timeout($fp, $mail_setting['mailtimeout']); + + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != '220') { + return false; + } + + fputs($fp, ($mail_setting['mailauth'] ? 'EHLO' : 'HELO')." discuz\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 220 && substr($lastmessage, 0, 3) != 250) { + return false; + } + + while(1) { + if(substr($lastmessage, 3, 1) != '-' || empty($lastmessage)) { + break; + } + $lastmessage = fgets($fp, 512); + } + + if($mail_setting['mailauth']) { + fputs($fp, "AUTH LOGIN\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 334) { + return false; + } + + fputs($fp, base64_encode($mail_setting['mailauth_username'])."\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 334) { + return false; + } + + fputs($fp, base64_encode($mail_setting['mailauth_password'])."\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 235) { + return false; + } + + $email_from = $mail_setting['mailfrom']; + } + + fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + return false; + } + } + + $email_tos = array(); + foreach(explode(',', $mail['email_to']) as $touser) { + $touser = trim($touser); + if($touser) { + fputs($fp, "RCPT TO: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $touser).">\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + fputs($fp, "RCPT TO: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $touser).">\r\n"); + $lastmessage = fgets($fp, 512); + return false; + } + } + } + + fputs($fp, "DATA\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 354) { + return false; + } + + $headers .= 'Message-ID: <'.gmdate('YmdHs').'.'.substr(md5($mail['message'].microtime()), 0, 6).rand(100000, 999999).'@'.$_SERVER['HTTP_HOST'].">{$maildelimiter}"; + + fputs($fp, "Date: ".gmdate('r')."\r\n"); + fputs($fp, "To: ".$mail['email_to']."\r\n"); + fputs($fp, "Subject: ".$mail['subject']."\r\n"); + fputs($fp, $headers."\r\n"); + fputs($fp, "\r\n\r\n"); + fputs($fp, "{$mail['message']}\r\n.\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + return false; + } + + fputs($fp, "QUIT\r\n"); + return true; + +} elseif($mail_setting['mailsend'] == 3) { + + ini_set('SMTP', $mail_setting['mailserver']); + ini_set('smtp_port', $mail_setting['mailport']); + ini_set('sendmail_from', $email_from); + + return @mail($mail['email_to'], $mail['subject'], $mail['message'], $headers); + +} + +?> \ No newline at end of file diff --git a/uc_client/lib/uccode.class.php b/uc_client/lib/uccode.class.php new file mode 100644 index 0000000..c73c2f3 --- /dev/null +++ b/uc_client/lib/uccode.class.php @@ -0,0 +1,148 @@ +uccode(); + } + + function uccode() { + $this->uccode = array( + 'pcodecount' => -1, + 'codecount' => 0, + 'codehtml' => array() + ); + } + + function codedisp($code) { + $this->uccode['pcodecount']++; + $code = str_replace('\\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)); + $this->uccode['codehtml'][$this->uccode['pcodecount']] = $this->tpl_codedisp($code); + $this->uccode['codecount']++; + return "[\tUCENTER_CODE_".$this->uccode['pcodecount']."\t]"; + } + + function complie($message) { + $message = dhtmlspecialchars($message); + if(strpos($message, '[/code]') !== FALSE) { + $message = preg_replace_callback("/\s*\[code\](.+?)\[\/code\]\s*/is", array($this, 'complie_callback_codedisp_1'), $message); + } + if(strpos($message, '[/url]') !== FALSE) { + $message = preg_replace_callback("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)([^\[\"']+?))?\](.+?)\[\/url\]/is", array($this, 'complie_callback_parseurl_15'), $message); + } + if(strpos($message, '[/email]') !== FALSE) { + $message = preg_replace_callback("/\[email(=([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+))?\](.+?)\[\/email\]/is", array($this, 'complie_callback_parseemail_14'), $message); + } + $message = str_replace(array( + '[/color]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', + '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', + '[list=A]', '[*]', '[/list]', '[indent]', '[/indent]', '[/float]' + ), array( + '', '
                              ', '', '

                              ', '', '', '', + '', '', '', '
                                ', '
                                  ', '
                                    ', + '
                                      ', '
                                    • ', '
                                    ', '
                                    ', '
                                    ', '' + ), preg_replace(array( + "/\[color=([#\w]+?)\]/i", + "/\[size=(\d+?)\]/i", + "/\[size=(\d+(\.\d+)?(px|pt|in|cm|mm|pc|em|ex|%)+?)\]/i", + "/\[font=([^\[\<]+?)\]/i", + "/\[align=(left|center|right)\]/i", + "/\[float=(left|right)\]/i" + ), array( + "", + "", + "", + "", + "

                                    ", + "" + ), $message)); + if(strpos($message, '[/quote]') !== FALSE) { + $message = preg_replace("/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is", $this->tpl_quote(), $message); + } + if(strpos($message, '[/img]') !== FALSE) { + $message = preg_replace_callback("/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", array($this, 'complie_callback_bbcodeurl_1'), $message); + $message = preg_replace_callback("/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", array($this, 'complie_callback_bbcodeurl_312'), $message); + } + for($i = 0; $i <= $this->uccode['pcodecount']; $i++) { + $message = str_replace("[\tUCENTER_CODE_$i\t]", $this->uccode['codehtml'][$i], $message); + } + return nl2br(str_replace(array("\t", ' ', ' '), array('        ', '   ', '  '), $message)); + } + + function complie_callback_codedisp_1($matches) { + return $this->codedisp($matches[1]); + } + + function complie_callback_parseurl_15($matches) { + return $this->parseurl($matches[1], $matches[5]); + } + + function complie_callback_parseemail_14($matches) { + return $this->parseemail($matches[1], $matches[4]); + } + + function complie_callback_bbcodeurl_1($matches) { + return $this->bbcodeurl($matches[1], ''); + } + + function complie_callback_bbcodeurl_312($matches) { + return $this->bbcodeurl($matches[3], ''); + } + + function parseurl($url, $text) { + if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) { + $url = $matches[0]; + $length = 65; + if(strlen($url) > $length) { + $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3)); + } + return ''.$text.''; + } else { + $url = substr($url, 1); + if(substr(strtolower($url), 0, 4) == 'www.') { + $url = 'http://'.$url; + } + return ''.$text.''; + } + } + + function parseemail($email, $text) { + $text = str_replace('\"', '"', $text); + if(!$email && preg_match("/\s*([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\s*/i", $text, $matches)) { + $email = trim($matches[0]); + return ''.$email.''; + } else { + return ''.$text.''; + } + } + + function bbcodeurl($url, $tags) { + if(!preg_match("/<.+?>/s", $url)) { + if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) { + $url = 'http://'.$url; + } + return str_replace(array('submit', 'logging.php'), array('', ''), sprintf($tags, $url, addslashes($url))); + } else { + return ' '.$url; + } + } + + function tpl_codedisp($code) { + return '

                                    '.$code.'
                                    '; + } + + function tpl_quote() { + return '
                                    \\1
                                    '; + } +} + + +?> \ No newline at end of file diff --git a/uc_client/lib/ucip.class.php b/uc_client/lib/ucip.class.php new file mode 100644 index 0000000..a93dd00 --- /dev/null +++ b/uc_client/lib/ucip.class.php @@ -0,0 +1,88 @@ + 1 ? 'check_ip6' : 'check_ip4'; + foreach ($ips as $ip) { + if (self::$method($requestIp, $ip)) { + return true; + } + } + return false; + } + + public static function check_ip6($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + if ('0' === $netmask) { + return (bool) unpack('n*', @inet_pton($address)); + } + if ($netmask < 1 || $netmask > 128) { + return false; + } + } else { + $address = $ip; + $netmask = 128; + } + $bytesAddr = unpack('n*', @inet_pton($address)); + $bytesTest = unpack('n*', @inet_pton($requestIp)); + if (!$bytesAddr || !$bytesTest) { + return false; + } + for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { + $left = $netmask - 16 * ($i - 1); + $left = ($left <= 16) ? $left : 16; + $mask = ~(0xffff >> $left) & 0xffff; + if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { + return false; + } + } + return true; + } + + public static function check_ip4($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + if ('0' === $netmask) { + return false; + } + if ($netmask < 0 || $netmask > 32) { + return false; + } + } else { + $address = $ip; + $netmask = 32; + } + if (false === ip2long($address)) { + return false; + } + return 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); + } + +} +?> \ No newline at end of file diff --git a/uc_client/lib/ucip_getter_dnslist.class.php b/uc_client/lib/ucip_getter_dnslist.class.php new file mode 100644 index 0000000..8d401b4 --- /dev/null +++ b/uc_client/lib/ucip_getter_dnslist.class.php @@ -0,0 +1,35 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/uc_client/lib/ucip_getter_header.class.php b/uc_client/lib/ucip_getter_header.class.php new file mode 100644 index 0000000..02519a4 --- /dev/null +++ b/uc_client/lib/ucip_getter_header.class.php @@ -0,0 +1,30 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/uc_client/lib/ucip_getter_iplist.class.php b/uc_client/lib/ucip_getter_iplist.class.php new file mode 100644 index 0000000..3992fab --- /dev/null +++ b/uc_client/lib/ucip_getter_iplist.class.php @@ -0,0 +1,35 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/uc_client/lib/xml.class.php b/uc_client/lib/xml.class.php new file mode 100644 index 0000000..30c193c --- /dev/null +++ b/uc_client/lib/xml.class.php @@ -0,0 +1,105 @@ +parse($xml); + $xml_parser->destruct(); + return $data; +} + +function xml_serialize($arr, $htmlon = FALSE, $isnormal = FALSE, $level = 1) { + $s = $level == 1 ? "\r\n\r\n" : ''; + $space = str_repeat("\t", $level); + foreach($arr as $k => $v) { + if(!is_array($v)) { + $s .= $space."".($htmlon ? '' : '')."\r\n"; + } else { + $s .= $space."\r\n".xml_serialize($v, $htmlon, $isnormal, $level + 1).$space."\r\n"; + } + } + $s = preg_replace("/([\x01-\x08\x0b-\x0c\x0e-\x1f])+/", ' ', $s); + return $level == 1 ? $s."" : $s; +} + +class XML { + + var $parser; + var $document; + var $stack; + var $data; + var $last_opened_tag; + var $isnormal; + var $attrs = array(); + var $failed = FALSE; + + function __construct($isnormal) { + $this->XML($isnormal); + } + + function XML($isnormal) { + $this->isnormal = $isnormal; + $this->parser = xml_parser_create('ISO-8859-1'); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false); + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, 'open','close'); + xml_set_character_data_handler($this->parser, 'data'); + } + + function destruct() { + xml_parser_free($this->parser); + } + + function parse(&$data) { + $this->document = array(); + $this->stack = array(); + return xml_parse($this->parser, $data, true) && !$this->failed ? $this->document : ''; + } + + function open($parser, $tag, $attributes) { + $this->data = ''; + $this->failed = FALSE; + if(!$this->isnormal) { + if(isset($attributes['id']) && !(isset($this->document[$attributes['id']]) && is_string($this->document[$attributes['id']]))) { + $this->document = &$this->document[$attributes['id']]; + } else { + $this->failed = TRUE; + } + } else { + if(!isset($this->document[$tag]) || !is_string($this->document[$tag])) { + $this->document = &$this->document[$tag]; + } else { + $this->failed = TRUE; + } + } + $this->stack[] = &$this->document; + $this->last_opened_tag = $tag; + $this->attrs = $attributes; + } + + function data($parser, $data) { + if($this->last_opened_tag != NULL) { + $this->data .= $data; + } + } + + function close($parser, $tag) { + if($this->last_opened_tag == $tag) { + $this->document = $this->data; + $this->last_opened_tag = NULL; + } + array_pop($this->stack); + if($this->stack) { + $this->document = &$this->stack[count($this->stack)-1]; + } + } + +} + +?> \ No newline at end of file diff --git a/uc_client/model/app.php b/uc_client/model/app.php new file mode 100644 index 0000000..666af0e --- /dev/null +++ b/uc_client/model/app.php @@ -0,0 +1,36 @@ +appmodel($base); + } + + function appmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_apps($col = '*', $where = '') { + $arr = $this->db->fetch_all("SELECT $col FROM ".UC_DBTABLEPRE."applications".($where ? ' WHERE '.$where : ''), 'appid'); + foreach($arr as $k => $v) { + isset($v['extra']) && !empty($v['extra']) && $v['extra'] = unserialize($v['extra']); + unset($v['authkey']); + $arr[$k] = $v; + } + return $arr; + } +} +?> \ No newline at end of file diff --git a/uc_client/model/base.php b/uc_client/model/base.php new file mode 100644 index 0000000..dfc5370 --- /dev/null +++ b/uc_client/model/base.php @@ -0,0 +1,295 @@ +base(); + } + + function base() { + require_once UC_ROOT.'./model/var.php'; + base_var::bind($this); + if(empty($this->time)) { + $this->init_var(); + $this->init_db(); + $this->init_cache(); + $this->init_note(); + $this->init_mail(); + } + } + + function init_var() { + $this->time = time(); + + $this->onlineip = $_SERVER['REMOTE_ADDR']; + if (!defined('UC_ONLYREMOTEADDR') || (defined('UC_ONLYREMOTEADDR') && !constant('UC_ONLYREMOTEADDR'))) { + require_once UC_ROOT.'./lib/ucip.class.php'; + if(defined('UC_IPGETTER') && !empty(constant('UC_IPGETTER'))) { + $s = defined('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) ? (is_string(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) ? unserialize(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : array(); + $c = 'ucip_getter_'.strtolower(constant('UC_IPGETTER')); + require_once UC_ROOT.'./lib/'.$c.'.class.php'; + $r = $c::get($s); + $this->onlineip = ucip::validate_ip($r) ? $r : $this->onlineip; + } else if (isset($_SERVER['HTTP_CLIENT_IP']) && ucip::validate_ip($_SERVER['HTTP_CLIENT_IP'])) { + $this->onlineip = $_SERVER['HTTP_CLIENT_IP']; + } elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ",") > 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $this->onlineip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $this->onlineip; + } else { + $this->onlineip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $this->onlineip; + } + } + } + + $this->app['appid'] = UC_APPID; + } + + function init_input($getagent = '') { + + } + + function init_db() { + require_once UC_ROOT.'lib/dbi.class.php'; + $this->db = new ucclient_db(); + $this->db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, '', UC_DBCHARSET, UC_DBCONNECT, UC_DBTABLEPRE); + } + + function load($model, $base = NULL, $release = '') { + $base = $base ? $base : $this; + if(empty($_ENV[$model])) { + require_once UC_ROOT."./model/$model.php"; + $modelname = $model.'model'; + $_ENV[$model] = new $modelname($base); + } + return $_ENV[$model]; + } + + function date($time, $type = 3) { + if(!$this->settings) { + $this->settings = $this->cache('settings'); + } + $format[] = $type & 2 ? (!empty($this->settings['dateformat']) ? $this->settings['dateformat'] : 'Y-n-j') : ''; + $format[] = $type & 1 ? (!empty($this->settings['timeformat']) ? $this->settings['timeformat'] : 'H:i') : ''; + return gmdate(implode(' ', $format), $time + $this->settings['timeoffset']); + } + + function page_get_start($page, $ppp, $totalnum) { + $totalpage = ceil($totalnum / $ppp); + $page = max(1, min($totalpage,intval($page))); + return ($page - 1) * $ppp; + } + + function implode($arr) { + return "'".implode("','", (array)$arr)."'"; + } + + function set_home($uid, $dir = '.') { + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + !is_dir($dir.'/'.$dir1) && mkdir($dir.'/'.$dir1, 0777) && @touch($dir.'/'.$dir1.'/index.htm'); + !is_dir($dir.'/'.$dir1.'/'.$dir2) && mkdir($dir.'/'.$dir1.'/'.$dir2, 0777) && @touch($dir.'/'.$dir1.'/'.$dir2.'/index.htm'); + !is_dir($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3) && mkdir($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3, 0777) && @touch($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3.'/index.htm'); + } + + function get_home($uid) { + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + return $dir1.'/'.$dir2.'/'.$dir3; + } + + function get_avatar($uid, $size = 'big', $type = '') { + $size = in_array($size, array('big', 'middle', 'small')) ? $size : 'big'; + $uid = abs(intval($uid)); + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + $typeadd = $type == 'real' ? '_real' : ''; + return $dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).$typeadd."_avatar_$size.jpg"; + } + + function &cache($cachefile) { + if(!isset($this->_CACHE[$cachefile])) { + $cachepath = UC_DATADIR.'./cache/'.$cachefile.'.php'; + if(!file_exists($cachepath)) { + $this->load('cache'); + $_ENV['cache']->updatedata($cachefile); + } else { + include_once $cachepath; + $this->_CACHE[$cachefile] = $_CACHE[$cachefile]; + } + } + return $this->_CACHE[$cachefile]; + } + + function get_setting($k = array(), $decode = FALSE) { + $return = array(); + $sqladd = $k ? "WHERE k IN (".$this->implode($k).")" : ''; + $settings = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."settings $sqladd"); + if(is_array($settings)) { + foreach($settings as $arr) { + $return[$arr['k']] = $decode ? unserialize($arr['v']) : $arr['v']; + } + } + return $return; + } + + function init_cache() { + $this->settings = $this->cache('settings'); + $this->cache['apps'] = $this->cache('apps'); + + if(PHP_VERSION > '5.1') { + $timeoffset = intval($this->settings['timeoffset'] / 3600); + @date_default_timezone_set('Etc/GMT'.($timeoffset > 0 ? '-' : '+').(abs($timeoffset))); + } + } + + function cutstr($string, $length, $dot = ' ...') { + if(strlen($string) <= $length) { + return $string; + } + + $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); + + $strcut = ''; + if(strtolower(UC_CHARSET) == 'utf-8') { + + $n = $tn = $noc = 0; + while($n < strlen($string)) { + + $t = ord($string[$n]); + if($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) { + $tn = 1; $n++; $noc++; + } elseif(194 <= $t && $t <= 223) { + $tn = 2; $n += 2; $noc += 2; + } elseif(224 <= $t && $t < 239) { + $tn = 3; $n += 3; $noc += 2; + } elseif(240 <= $t && $t <= 247) { + $tn = 4; $n += 4; $noc += 2; + } elseif(248 <= $t && $t <= 251) { + $tn = 5; $n += 5; $noc += 2; + } elseif($t == 252 || $t == 253) { + $tn = 6; $n += 6; $noc += 2; + } else { + $n++; + } + + if($noc >= $length) { + break; + } + + } + if($noc > $length) { + $n -= $tn; + } + + $strcut = substr($string, 0, $n); + + } else { + for($i = 0; $i < $length; $i++) { + $strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i]; + } + } + + $strcut = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $strcut); + + return $strcut.$dot; + } + + function init_note() { + if($this->note_exists()) { + $this->load('note'); + $_ENV['note']->send(); + } + } + + function note_exists() { + if(!is_numeric(constant("UC_APPID"))) { + return NULL; + } + $noteexists = $this->db->result_first("SELECT value FROM ".UC_DBTABLEPRE."vars WHERE name='noteexists".UC_APPID."'"); + if(empty($noteexists)) { + return FALSE; + } else { + return TRUE; + } + } + + function init_mail() { + if($this->mail_exists() && !getgpc('inajax')) { + $this->load('mail'); + $_ENV['mail']->send(); + } + } + + function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + return uc_authcode($string, $operation, $key, $expiry); + } + function unserialize($s) { + return uc_unserialize($s); + } + + function input($k) { + return isset($this->input[$k]) ? (is_array($this->input[$k]) ? $this->input[$k] : trim($this->input[$k])) : NULL; + } + + function mail_exists() { + $mailexists = $this->db->result_first("SELECT value FROM ".UC_DBTABLEPRE."vars WHERE name='mailexists'"); + if(empty($mailexists)) { + return FALSE; + } else { + return TRUE; + } + } + + function dstripslashes($string) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = $this->dstripslashes($val); + } + } else { + $string = stripslashes($string); + } + return $string; + } + +} + +?> \ No newline at end of file diff --git a/uc_client/model/cache.php b/uc_client/model/cache.php new file mode 100644 index 0000000..a0c00a3 --- /dev/null +++ b/uc_client/model/cache.php @@ -0,0 +1,93 @@ +cachemodel($base); + } + + function cachemodel(&$base) { + $this->base = $base; + $this->db = $base->db; + $this->map = array( + 'settings' => array('settings'), + 'badwords' => array('badwords'), + 'apps' => array('apps'), + ); + } + + function updatedata($cachefile = '') { + if($cachefile) { + foreach((array)$this->map[$cachefile] as $modules) { + $s = "$method(), TRUE).";\r\n"; + } + $s .= "\r\n?>"; + file_put_contents(UC_DATADIR."./cache/$cachefile.php", $s, LOCK_EX); + } + } else { + foreach((array)$this->map as $file => $modules) { + $s = "$method(), TRUE).";\r\n"; + } + $s .= "\r\n?>"; + file_put_contents(UC_DATADIR."./cache/$file.php", $s, LOCK_EX); + } + } + } + + function updatetpl() { + + } + + function _get_badwords() { + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."badwords"); + $return = array(); + if(is_array($data)) { + foreach($data as $k => $v) { + $return['findpattern'][$k] = $v['findpattern']; + $return['replace'][$k] = $v['replacement']; + } + } + return $return; + } + + function _get_apps() { + $this->base->load('app'); + $apps = $_ENV['app']->get_apps(); + $apps2 = array(); + if(is_array($apps)) { + foreach($apps as $v) { + if(!empty($v['extra'])) { + $v['extra'] = is_array($v['extra']) ? $v['extra'] : unserialize($v['extra']); + } + $apps2[$v['appid']] = $v; + } + } + return $apps2; + } + + function _get_settings() { + return $this->base->get_setting(); + } + +} + +?> \ No newline at end of file diff --git a/uc_client/model/domain.php b/uc_client/model/domain.php new file mode 100644 index 0000000..131a1ac --- /dev/null +++ b/uc_client/model/domain.php @@ -0,0 +1,56 @@ +domainmodel($base); + } + + function domainmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function add_domain($domain, $ip) { + if($domain) { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."domains SET domain='$domain', ip='$ip'"); + } + return $this->db->insert_id(); + } + + function get_total_num() { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."domains"); + return $data; + } + + function get_list($page, $ppp, $totalnum) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."domains LIMIT $start, $ppp"); + return $data; + } + + function delete_domain($arr) { + $domainids = $this->base->implode($arr); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."domains WHERE id IN ($domainids)"); + return $this->db->affected_rows(); + } + + function update_domain($domain, $ip, $id) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."domains SET domain='$domain', ip='$ip' WHERE id='$id'"); + return $this->db->affected_rows(); + } +} + +?> \ No newline at end of file diff --git a/uc_client/model/friend.php b/uc_client/model/friend.php new file mode 100644 index 0000000..785f2cd --- /dev/null +++ b/uc_client/model/friend.php @@ -0,0 +1,107 @@ +friendmodel($base); + } + + function friendmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function add($uid, $friendid, $comment='') { + $direction = $this->db->result_first("SELECT direction FROM ".UC_DBTABLEPRE."friends WHERE uid='$friendid' AND friendid='$uid' LIMIT 1"); + if($direction == 1) { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."friends SET uid='$uid', friendid='$friendid', comment='$comment', direction='3'", 'SILENT'); + $this->db->query("UPDATE ".UC_DBTABLEPRE."friends SET direction='3' WHERE uid='$friendid' AND friendid='$uid'"); + return 1; + } elseif($direction == 2) { + return 1; + } elseif($direction == 3) { + return -1; + } else { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."friends SET uid='$uid', friendid='$friendid', comment='$comment', direction='1'", 'SILENT'); + return $this->db->insert_id(); + } + } + + function delete($uid, $friendids) { + $friendids = $this->base->implode($friendids); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."friends WHERE uid='$uid' AND friendid IN ($friendids)"); + $affectedrows = $this->db->affected_rows(); + if($affectedrows > 0) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."friends SET direction=1 WHERE uid IN ($friendids) AND friendid='$uid' AND direction='3'"); + } + return $affectedrows; + } + + function get_totalnum_by_uid($uid, $direction = 0) { + $sqladd = ''; + if($direction == 0) { + $sqladd = "uid='$uid'"; + } elseif($direction == 1) { + $sqladd = "uid='$uid' AND direction='1'"; + } elseif($direction == 2) { + $sqladd = "friendid='$uid' AND direction='1'"; + } elseif($direction == 3) { + $sqladd = "uid='$uid' AND direction='3'"; + } + $totalnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."friends WHERE $sqladd"); + return $totalnum; + } + + function get_list($uid, $page, $pagesize, $totalnum, $direction = 0) { + $start = $this->base->page_get_start($page, $pagesize, $totalnum); + $sqladd = ''; + if($direction == 0) { + $sqladd = "f.uid='$uid'"; + } elseif($direction == 1) { + $sqladd = "f.uid='$uid' AND f.direction='1'"; + } elseif($direction == 2) { + $sqladd = "f.friendid='$uid' AND f.direction='1'"; + } elseif($direction == 3) { + $sqladd = "f.uid='$uid' AND f.direction='3'"; + } + if($sqladd) { + $data = $this->db->fetch_all("SELECT f.*, m.username FROM ".UC_DBTABLEPRE."friends f LEFT JOIN ".UC_DBTABLEPRE."members m ON f.friendid=m.uid WHERE $sqladd LIMIT $start, $pagesize"); + return $data; + } else { + return array(); + } + } + + function is_friend($uid, $friendids, $direction = 0) { + $friendid_str = implode("', '", $friendids); + $sqladd = ''; + if($direction == 0) { + $sqladd = "uid='$uid'"; + } elseif($direction == 1) { + $sqladd = "uid='$uid' AND friendid IN ('$friendid_str') AND direction='1'"; + } elseif($direction == 2) { + $sqladd = "friendid='$uid' AND uid IN ('$friendid_str') AND direction='1'"; + } elseif($direction == 3) { + $sqladd = "uid='$uid' AND friendid IN ('$friendid_str') AND direction='3'"; + } + if($this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."friends WHERE $sqladd") == count($friendids)) { + return true; + } else { + return false; + } + } +} + +?> \ No newline at end of file diff --git a/uc_client/model/index.htm b/uc_client/model/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_client/model/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_client/model/mail.php b/uc_client/model/mail.php new file mode 100644 index 0000000..e9ee127 --- /dev/null +++ b/uc_client/model/mail.php @@ -0,0 +1,150 @@ +mailmodel($base); + } + + function mailmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + $this->apps = &$this->base->cache['apps']; + } + + function get_total_num() { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."mailqueue"); + return $data; + } + + function get_list($page, $ppp, $totalnum) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT m.*, u.username, u.email FROM ".UC_DBTABLEPRE."mailqueue m LEFT JOIN ".UC_DBTABLEPRE."members u ON m.touid=u.uid ORDER BY dateline DESC LIMIT $start, $ppp"); + foreach((array)$data as $k => $v) { + $data[$k]['subject'] = dhtmlspecialchars($v['subject']); + $data[$k]['tomail'] = empty($v['tomail']) ? $v['email'] : $v['tomail']; + $data[$k]['dateline'] = $v['dateline'] ? $this->base->date($data[$k]['dateline']) : ''; + $data[$k]['appname'] = $this->base->cache['apps'][$v['appid']]['name']; + } + return $data; + } + + function delete_mail($ids) { + $ids = $this->base->implode($ids); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mailqueue WHERE mailid IN ($ids)"); + return $this->db->affected_rows(); + } + + function add($mail) { + if($mail['level']) { + $sql = "INSERT INTO ".UC_DBTABLEPRE."mailqueue (touid, tomail, subject, message, frommail, charset, htmlon, level, dateline, failures, appid) VALUES "; + $values_arr = array(); + foreach($mail['uids'] as $uid) { + if(empty($uid)) continue; + $uid = intval($uid); + $values_arr[] = "('$uid', '', '{$mail['subject']}', '{$mail['message']}', '{$mail['frommail']}', '{$mail['charset']}', '{$mail['htmlon']}', '{$mail['level']}', '{$mail['dateline']}', '0', '{$mail['appid']}')"; + } + foreach($mail['emails'] as $email) { + if(empty($email)) continue; + $values_arr[] = "('', '$email', '{$mail['subject']}', '{$mail['message']}', '{$mail['frommail']}', '{$mail['charset']}', '{$mail['htmlon']}', '{$mail['level']}', '{$mail['dateline']}', '0', '{$mail['appid']}')"; + } + $sql .= implode(',', $values_arr); + $this->db->query($sql); + $insert_id = $this->db->insert_id(); + $insert_id && $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars SET name='mailexists', value='1'"); + return $insert_id; + } else { + $mail['email_to'] = array(); + $uids = 0; + foreach($mail['uids'] as $uid) { + if(empty($uid)) continue; + $uids .= ','.intval($uid); + } + $users = $this->db->fetch_all("SELECT uid, username, email FROM ".UC_DBTABLEPRE."members WHERE uid IN ($uids)"); + foreach($users as $v) { + $mail['email_to'][] = $v['username'].'<'.$v['email'].'>'; + } + foreach($mail['emails'] as $email) { + if(empty($email)) continue; + $mail['email_to'][] = $email; + } + $mail['message'] = str_replace('\"', '"', $mail['message']); + $mail['email_to'] = implode(',', $mail['email_to']); + return $this->send_one_mail($mail); + } + } + + function send() { + register_shutdown_function(array($this, '_send')); + } + + function _send() { + + $mail = $this->_get_mail(); + if(empty($mail)) { + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars SET name='mailexists', value='0'"); + return NULL; + } else { + $mail['email_to'] = $mail['tomail'] ? $mail['tomail'] : $mail['username'].'<'.$mail['email'].'>'; + if($this->send_one_mail($mail)) { + $this->_delete_one_mail($mail['mailid']); + return true; + } else { + $this->_update_failures($mail['mailid']); + return false; + } + } + + } + + function send_by_id($mailid) { + if ($this->send_one_mail($this->_get_mail_by_id($mailid))) { + $this->_delete_one_mail($mailid); + return true; + } + } + + function send_one_mail($mail) { + if(empty($mail)) return; + $mail['email_to'] = $mail['email_to'] ? $mail['email_to'] : $mail['username'].'<'.$mail['email'].'>'; + $mail_setting = $this->base->settings; + return include UC_ROOT.'lib/sendmail.inc.php'; + } + + function _get_mail() { + $data = $this->db->fetch_first("SELECT m.*, u.username, u.email FROM ".UC_DBTABLEPRE."mailqueue m LEFT JOIN ".UC_DBTABLEPRE."members u ON m.touid=u.uid WHERE failures<'".UC_MAIL_REPEAT."' ORDER BY level DESC, mailid ASC LIMIT 1"); + return $data; + } + + function _get_mail_by_id($mailid) { + $data = $this->db->fetch_first("SELECT m.*, u.username, u.email FROM ".UC_DBTABLEPRE."mailqueue m LEFT JOIN ".UC_DBTABLEPRE."members u ON m.touid=u.uid WHERE mailid='$mailid'"); + return $data; + } + + function _delete_one_mail($mailid) { + $mailid = intval($mailid); + return $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mailqueue WHERE mailid='$mailid'"); + } + + function _update_failures($mailid) { + $mailid = intval($mailid); + return $this->db->query("UPDATE ".UC_DBTABLEPRE."mailqueue SET failures=failures+1 WHERE mailid='$mailid'"); + } +} + +?> \ No newline at end of file diff --git a/uc_client/model/misc.php b/uc_client/model/misc.php new file mode 100644 index 0000000..edd3ec9 --- /dev/null +++ b/uc_client/model/misc.php @@ -0,0 +1,221 @@ +miscmodel($base); + } + + function miscmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_apps($col = '*', $where = '') { + $arr = $this->db->fetch_all("SELECT $col FROM ".UC_DBTABLEPRE."applications".($where ? ' WHERE '.$where : '')); + return $arr; + } + + function delete_apps($appids) { + } + + function update_app($appid, $name, $url, $authkey, $charset, $dbcharset) { + } + + function alter_app_table($appid, $operation = 'ADD') { + } + + function get_host_by_url($url) { + } + + function check_url($url) { + } + + function check_ip($ip) { + } + + function test_api($url, $ip = '') { + } + + function dfopen2($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $__times__ = isset($_GET['__times__']) ? intval($_GET['__times__']) + 1 : 1; + if($__times__ > 2) { + return ''; + } + $url .= (strpos($url, '?') === FALSE ? '?' : '&')."__times__=$__times__"; + return $this->dfopen($url, $limit, $post, $cookie, $bysocket, $ip, $timeout, $block, $encodetype, $allowcurl); + } + + function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $return = ''; + $matches = parse_url($url); + $scheme = strtolower($matches['scheme']); + $host = $matches['host']; + $path = !empty($matches['path']) ? $matches['path'].(!empty($matches['query']) ? '?'.$matches['query'] : '') : '/'; + $port = !empty($matches['port']) ? $matches['port'] : ($scheme == 'https' ? 443 : 80); + + if(function_exists('curl_init') && function_exists('curl_exec') && $allowcurl) { + $ch = curl_init(); + $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); + curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + if(!empty($ip) && filter_var($ip, FILTER_VALIDATE_IP) && !filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + if($post) { + curl_setopt($ch, CURLOPT_POST, 1); + if($encodetype == 'URLENCODE') { + curl_setopt($ch, CURLOPT_POSTFIELDS, $post); + } else { + parse_str($post, $postarray); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postarray); + } + } + if($cookie) { + curl_setopt($ch, CURLOPT_COOKIE, $cookie); + } + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); + $data = curl_exec($ch); + $status = curl_getinfo($ch); + $errno = curl_errno($ch); + curl_close($ch); + if($errno || $status['http_code'] != 200) { + return; + } else { + return !$limit ? $data : substr($data, 0, $limit); + } + } + + if($post) { + $out = "POST $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + if($allowcurl) { + $encodetype = 'URLENCODE'; + } + $boundary = $encodetype == 'URLENCODE' ? '' : '; boundary='.trim(substr(trim($post), 2, strpos(trim($post), "\n") - 2)); + $header .= $encodetype == 'URLENCODE' ? "Content-Type: application/x-www-form-urlencoded\r\n" : "Content-Type: multipart/form-data$boundary\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= 'Content-Length: '.strlen($post)."\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cache-Control: no-cache\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header.$post; + } else { + $out = "GET $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header; + } + + $fpflag = 0; + $context = array(); + if($scheme == 'https') { + $context['ssl'] = array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'peer_name' => $host + ); + if(version_compare(PHP_VERSION, '5.6.0', '<')) { + $context['ssl']['SNI_enabled'] = true; + $context['ssl']['SNI_server_name'] = $host; + } + } + if(ini_get('allow_url_fopen')) { + $context['http'] = array( + 'method' => $post ? 'POST' : 'GET', + 'header' => $header, + 'timeout' => $timeout + ); + if($post) { + $context['http']['content'] = $post; + } + $context = stream_context_create($context); + $fp = @fopen($scheme.'://'.($ip ? $ip : $host).':'.$port.$path, 'b', false, $context); + $fpflag = 1; + } elseif(function_exists('stream_socket_client')) { + $context = stream_context_create($context); + $fp = @stream_socket_client(($scheme == 'https' ? 'ssl://' : '').($ip ? $ip : $host).':'.$port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context); + } else { + $fp = @fsocketopen(($scheme == 'https' ? 'ssl://' : '').($scheme == 'https' ? $host : ($ip ? $ip : $host)), $port, $errno, $errstr, $timeout); + } + + if(!$fp) { + return ''; + } else { + stream_set_blocking($fp, $block); + stream_set_timeout($fp, $timeout); + if(!$fpflag) { + @fwrite($fp, $out); + } + $status = stream_get_meta_data($fp); + if(!$status['timed_out']) { + while (!feof($fp) && !$fpflag) { + if(($header = @fgets($fp)) && ($header == "\r\n" || $header == "\n")) { + break; + } + } + + $stop = false; + while(!feof($fp) && !$stop) { + $data = fread($fp, ($limit == 0 || $limit > 8192 ? 8192 : $limit)); + $return .= $data; + if($limit) { + $limit -= strlen($data); + $stop = $limit <= 0; + } + } + } + @fclose($fp); + return $return; + } + } + + function array2string($arr) { + $s = $sep = ''; + if($arr && is_array($arr)) { + foreach($arr as $k => $v) { + $s .= $sep.addslashes($k).UC_ARRAY_SEP_1.$v; + $sep = UC_ARRAY_SEP_2; + } + } + return $s; + } + + function string2array($s) { + $arr = explode(UC_ARRAY_SEP_2, $s); + $arr2 = array(); + foreach($arr as $k => $v) { + list($key, $val) = explode(UC_ARRAY_SEP_1, $v); + $arr2[$key] = $val; + } + return $arr2; + } +} + +?> \ No newline at end of file diff --git a/uc_client/model/note.php b/uc_client/model/note.php new file mode 100644 index 0000000..372db0a --- /dev/null +++ b/uc_client/model/note.php @@ -0,0 +1,199 @@ +notemodel($base); + } + + function notemodel(&$base) { + $this->base = $base; + $this->db = $base->db; + $this->apps = $this->base->cache('apps'); + $this->operations = array( + 'test'=>array('', 'action=test'), + 'deleteuser'=>array('', 'action=deleteuser'), + 'renameuser'=>array('', 'action=renameuser'), + 'deletefriend'=>array('', 'action=deletefriend'), + 'gettag'=>array('', 'action=gettag', 'tag', 'updatedata'), + 'getcreditsettings'=>array('', 'action=getcreditsettings'), + 'getcredit'=>array('', 'action=getcredit'), + 'updatecreditsettings'=>array('', 'action=updatecreditsettings'), + 'updateclient'=>array('', 'action=updateclient'), + 'updatepw'=>array('', 'action=updatepw'), + 'updatebadwords'=>array('', 'action=updatebadwords'), + 'updatehosts'=>array('', 'action=updatehosts'), + 'updateapps'=>array('', 'action=updateapps'), + 'updatecredit'=>array('', 'action=updatecredit'), + ); + } + + function get_total_num($all = TRUE) { + } + + function get_list($page, $ppp, $totalnum, $all = TRUE) { + } + + function delete_note($ids) { + } + + function add($operation, $getdata='', $postdata='', $appids=array(), $pri = 0) { + $extra = $varextra = ''; + $appadd = $varadd = array(); + foreach((array)$this->apps as $appid => $app) { + $appid = $app['appid']; + if($appid == intval($appid)) { + if($appids && !in_array($appid, $appids)) { + $appadd[] = 'app'.$appid."='1'"; + } else { + $varadd[] = "('noteexists{$appid}', '1')"; + } + } + } + if($appadd) { + $extra = implode(',', $appadd); + $extra = $extra ? ', '.$extra : ''; + } + if($varadd) { + $varextra = implode(', ', $varadd); + $varextra = $varextra ? ', '.$varextra : ''; + } + + $getdata = addslashes($getdata); + $postdata = addslashes($postdata); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."notelist SET getdata='$getdata', operation='$operation', pri='$pri', postdata='$postdata'$extra"); + $insert_id = $this->db->insert_id(); + $insert_id && $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars (name, value) VALUES ('noteexists', '1')$varextra"); + return $insert_id; + } + + function send() { + register_shutdown_function(array($this, '_send')); + } + + function _send() { + + if(!is_numeric(constant("UC_APPID"))) { + return NULL; + } + + $note = $this->_get_note(); + if(empty($note)) { + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars SET name='noteexists".UC_APPID."', value='0'"); + return NULL; + } + + $this->sendone(UC_APPID, 0, $note); + + $this->_gc(); + } + + function sendone($appid, $noteid = 0, $note = '') { + require_once UC_ROOT.'./lib/xml.class.php'; + $return = FALSE; + $app = $this->apps[$appid]; + if($noteid) { + $note = $this->_get_note_by_id($noteid); + } + $this->base->load('misc'); + $apifilename = isset($app['apifilename']) && $app['apifilename'] ? $app['apifilename'] : 'uc.php'; + if(((defined('UC_STANDALONE') && !empty(constant('UC_STANDALONE'))) || (defined('IN_DISCUZ') && in_array($note['operation'], array('deleteuser', 'renameuser', 'updatepw')))) && @include UC_ROOT.'./extend_client.php') { + $uc_note = new uc_note_handler(); + $method = $note['operation']; + if(is_string($method) && !empty($method)) { + parse_str($note['getdata'], $note['getdata']); + $note['postdata'] = xml_unserialize($note['postdata']); + $response = $uc_note->$method($note['getdata'], $note['postdata']); + } + unset($uc_note); + } else { + $url = $this->get_url_code($note['operation'], $note['getdata'], $appid); + $note['postdata'] = str_replace(array("\n", "\r"), '', $note['postdata']); + $response = trim($_ENV['misc']->dfopen2($url, 0, $note['postdata'], '', 1, $app['ip'], UC_NOTE_TIMEOUT, TRUE)); + } + + $returnsucceed = $response != '' && ($response == 1 || is_array(xml_unserialize($response))); + + $closedsqladd = $this->_close_note($note, $this->apps, $returnsucceed, $appid) ? ",closed='1'" : ''; + + if($returnsucceed) { + if($this->operations[$note['operation']][2]) { + $this->base->load($this->operations[$note['operation']][2]); + $func = $this->operations[$note['operation']][3]; + $_ENV[$this->operations[$note['operation']][2]]->$func($appid, $response); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."notelist SET app$appid='1', totalnum=totalnum+1, succeednum=succeednum+1, dateline='{$this->base->time}' $closedsqladd WHERE noteid='{$note['noteid']}'", 'SILENT'); + $return = TRUE; + } else { + $this->db->query("UPDATE ".UC_DBTABLEPRE."notelist SET app$appid = app$appid-'1', totalnum=totalnum+1, dateline='{$this->base->time}' $closedsqladd WHERE noteid='{$note['noteid']}'", 'SILENT'); + $return = FALSE; + } + return $return; + } + + function _get_note() { + if(!is_numeric(constant("UC_APPID"))) { + return NULL; + } + $app_field = 'app'.UC_APPID; + $data = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."notelist WHERE closed='0' AND $app_field<'1' AND $app_field>'-".UC_NOTE_REPEAT."' LIMIT 1"); + return $data; + } + + function _gc() { + rand(0, UC_NOTE_GC) == 0 && $this->db->query("DELETE FROM ".UC_DBTABLEPRE."notelist WHERE closed='1'"); + } + + function _close_note($note, $apps, $returnsucceed, $appid) { + $note['app'.$appid] = $returnsucceed ? 1 : $note['app'.$appid] - 1; + $appcount = count($apps); + foreach($apps as $key => $app) { + $appstatus = $note['app'.$app['appid']]; + if(!$app['recvnote'] || $appstatus == 1 || $appstatus <= -UC_NOTE_REPEAT) { + $appcount--; + } + } + if($appcount < 1) { + return TRUE; + } + } + + function _get_note_by_id($noteid) { + $data = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."notelist WHERE noteid='$noteid'"); + return $data; + } + + function get_url_code($operation, $getdata, $appid) { + $app = $this->apps[$appid]; + $authkey = UC_KEY; + $url = $app['url']; + $apifilename = isset($app['apifilename']) && $app['apifilename'] ? $app['apifilename'] : 'uc.php'; + $action = $this->operations[$operation][1]; + $code = urlencode($this->base->authcode("$action&".($getdata ? "$getdata&" : '')."time=".$this->base->time, 'ENCODE', $authkey)); + return $url."/api/$apifilename?code=$code"; + } + +} + +?> \ No newline at end of file diff --git a/uc_client/model/pm.php b/uc_client/model/pm.php new file mode 100644 index 0000000..4492f89 --- /dev/null +++ b/uc_client/model/pm.php @@ -0,0 +1,868 @@ +pmmodel($base); + } + + function pmmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function pmintval($pmid) { + return @is_numeric($pmid) ? $pmid : 0; + } + + function getpmbypmid($uid, $pmid) { + if(!$pmid) { + return array(); + } + $arr = array(); + $pm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_indexes i LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=i.plid WHERE i.pmid='$pmid'"); + if($this->isprivilege($pm['plid'], $uid)) { + $pms = $this->db->fetch_all("SELECT t.*, p.*, t.authorid as founderuid, t.dateline as founddateline FROM ".UC_DBTABLEPRE.$this->getposttablename($pm['plid'])." p LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=p.plid WHERE p.pmid='{$pm['pmid']}'"); + $arr = $this->getpostlist($pms); + } + return $arr; + } + + function isprivilege($plid, $uid) { + if(!$plid || !$uid) { + return true; + } + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid' AND uid='$uid'"); + if($this->db->fetch_array($query)) { + return true; + } else { + return false; + } + } + + function getpmbyplid($uid, $plid, $starttime, $endtime, $start, $ppp, $type = 0) { + if(!$type) { + $pm = $this->getprivatepmbyplid($uid, $plid, $starttime, $endtime, $start, $ppp); + } else { + $pm = $this->getchatpmbyplid($uid, $plid, $starttime, $endtime, $start, $ppp); + } + return $this->getpostlist($pm); + } + + function getpostlist($list) { + if(empty($list)) { + return array(); + } + $authoridarr = $authorarr = array(); + foreach($list as $key => $value) { + $authoridarr[$value['authorid']] = $value['authorid']; + } + if($authoridarr) { + $this->base->load('user'); + $authorarr = $_ENV['user']->id2name($authoridarr); + } + foreach($list as $key => $value) { + if($value['pmtype'] == 1) { + $users = explode('_', $value['min_max']); + if($value['authorid'] == $users[0]) { + $value['touid'] = $users[1]; + } else { + $value['touid'] = $users[0]; + } + } else { + $value['touid'] = 0; + } + $value['author'] = $authorarr[$value['authorid']]; + + $value['msgfromid'] = $value['authorid']; + $value['msgfrom'] = $value['author']; + $value['msgtoid'] = $value['touid']; + + unset($value['min_max']); + unset($value['delstatus']); + unset($value['lastmessage']); + $list[$key] = $value; + } + return $list; + } + + function setpmstatus($uid, $touids, $plids, $status = 0) { + if(!$uid) { + return false; + } + if(!$status) { + $oldstatus = 1; + $newstatus = 0; + } else { + $oldstatus = 0; + $newstatus = 1; + } + if($touids) { + foreach($touids as $key => $value) { + if($uid == $value || !$value || !preg_match("/^[0-9]+$/", $value)) { + return false; + } + $relastionship[] = $this->relationship($uid, $value); + } + $plid = $plidpostarr = array(); + $query = $this->db->query("SELECT plid FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max IN (".$this->base->implode($relationship).")"); + while($thread = $this->db->fetch_array($query)) { + $plidarr[] = $thread['plid']; + } + if($plidarr) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew='$newstatus' WHERE plid IN (".$this->base->implode($plidarr).") AND uid='$uid' AND isnew='$oldstatus'"); + } + } + if($plids) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew='$newstatus' WHERE plid IN (".$this->base->implode($plids).") AND uid='$uid' AND isnew='$oldstatus'"); + } + return true; + } + + function set_ignore($uid) { + return $this->db->query("DELETE FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); + } + + function isnewpm($uid) { + return $this->db->result_first("SELECT uid FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); + } + + function lastpm($uid) { + $lastpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON m.plid=t.plid WHERE m.uid='$uid' ORDER BY m.lastdateline DESC LIMIT 1"); + $lastmessage = unserialize($lastpm['lastmessage']); + if($lastmessage['lastauthorid']) { + $lastpm['lastauthorid'] = $lastmessage['lastauthorid']; + $lastpm['lastauthor'] = $lastmessage['lastauthor']; + $lastpm['lastsummary'] = $lastmessage['lastsummary']; + } else { + $lastpm['lastauthorid'] = $lastmessage['firstauthorid']; + $lastpm['lastauthor'] = $lastmessage['firstauthor']; + $lastpm['lastsummary'] = $lastmessage['firstsummary']; + } + return $lastpm; + } + + function getpmnum($uid, $type = 0, $isnew = 0) { + $newsql = ''; + $newnum = 0; + + if($isnew) { + $newsql = 'AND m.isnew=1'; + } + if(!$type) { + $newnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members m WHERE m.uid='$uid' $newsql"); + } else { + $newnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=m.plid WHERE m.uid='$uid' $newsql AND t.pmtype='$type'"); + } + return $newnum; + } + + function getpmnumbyplid($uid, $plid) { + return $this->db->result_first("SELECT pmnum FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid' AND uid='$uid'"); + } + + function sendpm($fromuid, $fromusername, $touids, $subject, $message, $type = 0) { + if(!$fromuid || !$fromusername || !$touids || !$message) { + return 0; + } + $touids = array_unique($touids); + $relationship = $existplid = $pm_member_insertsql = array(); + $this->base->load('user'); + $tmptouidarr = $touids; + $blackls = $this->get_blackls($fromuid, $touids); + + foreach($tmptouidarr as $key => $value) { + if($fromuid == $value || !$value) { + return PMSENDSELF_ERROR; + } + + if(in_array('{ALL}', $blackls[$value])) { + unset($touids[$key]); + continue; + } + $blackls[$value] = $_ENV['user']->name2id($blackls[$value]); + if(!(isset($blackls[$value]) && !in_array($fromuid, $blackls[$value]))) { + unset($touids[$key]); + } else { + $relationship[$value] = $this->relationship($fromuid, $value); + } + } + if(empty($touids)) { + return PMSENDNONE_ERROR; + } + if($type == 1 && count($touids) < 2) { + return PMSENDCHATNUM_ERROR; + } + + $_CACHE['badwords'] = $this->base->cache('badwords'); + if($_CACHE['badwords']['findpattern']) { + $subject = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $subject); + $message = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $message); + } + if(!$subject) { + $subject = $this->removecode(trim($message), 80); + } else { + $subject = dhtmlspecialchars($subject); + } + $lastsummary = addslashes($this->removecode(trim(stripslashes($message)), 150)); + $subject = addslashes($subject); + + if(!$type) { + $query = $this->db->query("SELECT plid, min_max FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max IN (".$this->base->implode($relationship).")"); + while($thread = $this->db->fetch_array($query)) { + $existplid[$thread['min_max']] = $thread['plid']; + } + $lastmessage = array('lastauthorid' => $fromuid, 'lastauthor' => $fromusername, 'lastsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + foreach($relationship as $key => $value) { + if(!isset($existplid[$value])) { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_lists(authorid, pmtype, subject, members, min_max, dateline, lastmessage) VALUES('$fromuid', '1', '$subject', 2, '$value', '".$this->base->time."', '$lastmessage')"); + $plid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$key', '1', '1', '0', '".$this->base->time."')"); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$fromuid', '0', '1', '".$this->base->time."', '".$this->base->time."')"); + } else { + $plid = $existplid[$value]; + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + $result = $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$key', '1', '1', '0', '".$this->base->time."')", 'SILENT'); + if(!$result) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=1, pmnum=pmnum+1, lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$key'"); + } + $result = $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$fromuid', '0', '1', '".$this->base->time."', '".$this->base->time."')", 'SILENT'); + if(!$result) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0, pmnum=pmnum+1, lastupdate='".$this->base->time."', lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$fromuid'"); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET lastmessage='$lastmessage' WHERE plid='$plid'"); + } + } + } else { + $lastmessage = array('firstauthorid' => $fromuid, 'firstauthor' => $fromusername, 'firstsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_lists(authorid, pmtype, subject, members, min_max, dateline, lastmessage) VALUES('$fromuid', '2', '$subject', '".(count($touids)+1)."', '', '".$this->base->time."', '$lastmessage')"); + $plid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + $pm_member_insertsql[] = "('$plid', '$fromuid', '0', '1', '".$this->base->time."', '".$this->base->time."')"; + foreach($touids as $key => $value) { + $pm_member_insertsql[] = "('$plid', '$value', '1', '1', '0', '".$this->base->time."')"; + } + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES ".implode(',', $pm_member_insertsql)); + } + + $newpm = array(); + foreach($touids as $key => $value) { + $newpm[] = "('$value')"; + } + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."newpm(uid) VALUES ".implode(',', $newpm)); + return $pmid; + } + + function replypm($plid, $fromuid, $fromusername, $message) { + if(!$plid || !$fromuid || !$fromusername || !$message) { + return 0; + } + + $threadpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if(empty($threadpm)) { + return PMTHREADNONE_ERROR; + } + + if($threadpm['pmtype'] == 1) { + $users = explode('_', $threadpm['min_max']); + if($users[0] == $fromuid) { + $touid = $users[1]; + } elseif($users[1] == $fromuid) { + $touid = $users[0]; + } else { + return PMPRIVILEGENONE_ERROR; + } + + $blackls = $this->get_blackls($fromuid, $touid); + if(in_array('{ALL}', $blackls[$touid])) { + return PMINBALCKLIST_ERROR; + } + $this->base->load('user'); + $blackls[$touid] = $_ENV['user']->name2id($blackls[$touid]); + if(!(isset($blackls[$touid]) && !in_array($fromuid, $blackls[$touid]))) { + return PMINBALCKLIST_ERROR; + } + } + + $memberuid = array(); + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + while($member = $this->db->fetch_array($query)) { + $memberuid[$member['uid']] = "('{$member['uid']}')"; + } + if(!isset($memberuid[$fromuid])) { + return PMPRIVILEGENONE_ERROR; + } + + $_CACHE['badwords'] = $this->base->cache('badwords'); + if($_CACHE['badwords']['findpattern']) { + $message = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $message); + } + $lastsummary = addslashes($this->removecode(trim(stripslashes($message)), 150)); + + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + if($threadpm['pmtype'] == 1) { + $lastmessage = array('lastauthorid' => $fromuid, 'lastauthor' => $fromusername, 'lastsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + $result = $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$touid', '1', '1', '0', '".$this->base->time."')", 'SILENT'); + if(!$result) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=1, pmnum=pmnum+1, lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$touid'"); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0, pmnum=pmnum+1, lastupdate='".$this->base->time."', lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$fromuid'"); + } else { + $lastmessage = unserialize($threadpm['lastmessage']); + $lastmessage = array('firstauthorid' => $lastmessage['firstauthorid'], 'firstauthor' => $lastmessage['firstauthor'], 'firstsummary' => $lastmessage['firstsummary'], 'lastauthorid' => $fromuid, 'lastauthor' => $fromusername, 'lastsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=1, pmnum=pmnum+1, lastdateline='".$this->base->time."' WHERE plid='$plid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0, lastupdate='".$this->base->time."' WHERE plid='$plid' AND uid='$fromuid'"); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET lastmessage='$lastmessage' WHERE plid='$plid'"); + + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."newpm(uid) VALUES ".implode(',', $memberuid).""); + + return $pmid; + } + + function appendchatpm($plid, $uid, $touid) { + if(!$plid || !$uid || !$touid) { + return 0; + } + $threadpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if(empty($threadpm)) { + return PMTHREADNONE_ERROR; + } + if($threadpm['pmtype'] != 2) { + return PMCHATTYPE_ERROR; + } + if($threadpm['authorid'] != $uid) { + return PMPRIVILEGENONE_ERROR; + } + + $blackls = $this->get_blackls($uid, $touid); + if(in_array('{ALL}', $blackls[$touid])) { + return PMINBALCKLIST_ERROR; + } + $this->base->load('user'); + $blackls[$touid] = $_ENV['user']->name2id($blackls[$touid]); + if(!(isset($blackls[$touid]) && !in_array($uid, $blackls[$touid]))) { + return PMINBALCKLIST_ERROR; + } + + $pmnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$this->getposttablename($plid)." WHERE plid='$plid'"); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$touid', '1', '$pmnum', '0', '0')", 'SILENT'); + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET members='$num' WHERE plid='$plid'"); + + return 1; + } + + function kickchatpm($plid, $uid, $touid) { + if(!$uid || !$touid || !$plid || $uid == $touid) { + return 0; + } + $threadpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if($threadpm['pmtype'] != 2) { + return PMCHATTYPE_ERROR; + } + if($threadpm['authorid'] != $uid) { + return PMPRIVILEGENONE_ERROR; + } + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid' AND uid='$touid'"); + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET members='$num' WHERE plid='$plid'"); + return 1; + } + + function quitchatpm($uid, $plids) { + if(!$uid || !$plids) { + return 0; + } + $list = array(); + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON m.plid=t.plid WHERE m.plid IN (".$this->base->implode($plids).") AND m.uid='$uid'"); + while($threadpm = $this->db->fetch_array($query)) { + if($threadpm['pmtype'] != 2) { + return PMCHATTYPE_ERROR; + } + if($threadpm['authorid'] == $uid) { + return PMPRIVILEGENONE_ERROR; + } + $list[] = $threadpm['plid']; + } + + if($list) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid IN (".$this->base->implode($list).") AND uid='$uid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET members=members-1 WHERE plid IN (".$this->base->implode($list).")"); + } + + return 1; + } + + function deletepmbypmid($uid, $pmid) { + if(!$uid || !$pmid) { + return 0; + } + $index = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_indexes i LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON i.plid=t.plid WHERE i.pmid='$pmid'"); + if($index['pmtype'] != 1) { + return PMUIDTYPE_ERROR; + } + $users = explode('_', $index['min_max']); + if(!in_array($uid, $users)) { + return PMPRIVILEGENONE_ERROR; + } + if($index['authorid'] != $uid) { + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." SET delstatus=2 WHERE pmid='$pmid' AND delstatus=0"); + $updatenum = $this->db->affected_rows(); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." WHERE pmid='$pmid' AND delstatus=1"); + $deletenum = $this->db->affected_rows(); + } else { + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." SET delstatus=1 WHERE pmid='$pmid' AND delstatus=0"); + $updatenum = $this->db->affected_rows(); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." WHERE pmid='$pmid' AND delstatus=2"); + $deletenum = $this->db->affected_rows(); + } + + if(!$this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." WHERE plid='{$index['plid']}'")) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='{$index['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$index['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='{$index['plid']}'"); + } else { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET pmnum=pmnum-".($updatenum + $deletenum)." WHERE plid='".$index['plid']."' AND uid='$uid'"); + } + return 1; + } + + function deletepmbypmids($uid, $pmids) { + if($pmids) { + foreach($pmids as $key => $pmid) { + $this->deletepmbypmid($uid, $pmid); + } + } + return 1; + } + + + function deletepmbyplid($uid, $plid, $isuser = 0) { + if(!$uid || !$plid) { + return 0; + } + + if($isuser) { + $relationship = $this->relationship($uid, $plid); + $sql = "SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max='$relationship'"; + } else { + $sql = "SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"; + } + + $query = $this->db->query($sql); + if($list = $this->db->fetch_array($query)) { + if($list['pmtype'] == 1) { + $user = explode('_', $list['min_max']); + if(!in_array($uid, $user)) { + return PMPRIVILEGENONE_ERROR; + } + } else { + if($uid != $list['authorid']) { + return PMPRIVILEGENONE_ERROR; + } + } + } else { + return PMTHREADNONE_ERROR; + } + + if($list['pmtype'] == 1) { + if($uid == $list['authorid']) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}' AND delstatus=2"); + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." SET delstatus=1 WHERE plid='{$list['plid']}' AND delstatus=0"); + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}' AND delstatus=1"); + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." SET delstatus=2 WHERE plid='{$list['plid']}' AND delstatus=0"); + } + $count = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}'"); + if(!$count) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='{$list['plid']}'"); + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$list['plid']}' AND uid='$uid'"); + } + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='{$list['plid']}'"); + } + return 1; + } + + function deletepmbyplids($uid, $plids, $isuser = 0) { + if($plids) { + foreach($plids as $key => $plid) { + $this->deletepmbyplid($uid, $plid, $isuser); + } + } + return 1; + } + + + function getprivatepmbyplid($uid, $plid, $starttime = 0, $endtime = 0, $start = 0, $ppp = 0) { + if(!$uid || !$plid) { + return 0; + } + if(!$this->isprivilege($plid, $uid)) { + return 0; + } + $thread = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if($thread['pmtype'] != 1) { + return 0; + } + $pms = $addsql = array(); + $addsql[] = "p.plid='$plid'"; + if($thread['authorid'] == $uid) { + $addsql[] = 'p.delstatus IN (0,2)'; + } else { + $addsql[] = 'p.delstatus IN (0,1)'; + } + if($starttime) { + $addsql[]= "p.dateline>'$starttime'"; + } + if($endtime) { + $addsql[] = "p.dateline<'$endtime'"; + } + if($addsql) { + $addsql = implode(' AND ', $addsql); + } else { + $addsql = ''; + } + if($ppp) { + $limitsql = 'LIMIT '.intval($start).', '.intval($ppp); + } else { + $limitsql = ''; + } + $pms = $this->db->fetch_all("SELECT t.*, p.*, t.authorid as founderuid, t.dateline as founddateline FROM ".UC_DBTABLEPRE.$this->getposttablename($plid)." p LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON p.plid=t.plid WHERE $addsql ORDER BY p.dateline DESC $limitsql"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0 WHERE plid='$plid' AND uid='$uid' AND isnew=1"); + return array_reverse($pms); + } + + function getchatpmbyplid($uid, $plid, $starttime = 0, $endtime = 0, $start = 0, $ppp = 0) { + if(!$uid || !$plid) { + return 0; + } + if(!$this->isprivilege($plid, $uid)) { + return 0; + } + $pms = $addsql = array(); + $addsql[] = "p.plid='$plid'"; + if($starttime) { + $addsql[]= "p.dateline>'$starttime'"; + } + if($endtime) { + $addsql[] = "p.dateline<'$endtime'"; + } + if($addsql) { + $addsql = implode(' AND ', $addsql); + } else { + $addsql = ''; + } + if($ppp) { + $limitsql = 'LIMIT '.intval($start).', '.intval($ppp); + } else { + $limitsql = ''; + } + $query = $this->db->query("SELECT t.*, p.*, t.authorid as founderuid, t.dateline as founddateline FROM ".UC_DBTABLEPRE.$this->getposttablename($plid)." p LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON p.plid=t.plid WHERE $addsql ORDER BY p.dateline DESC $limitsql"); + while($pm = $this->db->fetch_array($query)) { + if($pm['pmtype'] != 2) { + return 0; + } + $pms[] = $pm; + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0 WHERE plid='$plid' AND uid='$uid' AND isnew=1"); + return array_reverse($pms); + } + + function getpmlist($uid, $filter, $start, $ppp = 10) { + if(!$uid) { + return 0; + } + $members = $touidarr = $tousernamearr = array(); + + if($filter == 'newpm') { + $addsql = 'm.isnew=1 AND '; + } else { + $addsql = ''; + } + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=m.plid WHERE $addsql m.uid='$uid' ORDER BY m.lastdateline DESC LIMIT $start, $ppp"); + while($member = $this->db->fetch_array($query)) { + if($member['pmtype'] == 1) { + $users = explode('_', $member['min_max']); + $member['touid'] = $users[0] == $uid ? $users[1] : $users[0]; + } else { + $member['touid'] = 0; + } + $touidarr[$member['touid']] = $member['touid']; + $members[] = $member; + } + + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); + + $array = array(); + if($members) { + $today = $this->base->time - $this->base->time % 86400; + $this->base->load('user'); + $tousernamearr = $_ENV['user']->id2name($touidarr); + foreach($members as $key => $data) { + + $daterange = 5; + $data['founddateline'] = $data['dateline']; + $data['dateline'] = $data['lastdateline']; + $data['pmid'] = $data['plid']; + $lastmessage = unserialize($data['lastmessage']); + if($lastmessage['firstauthorid']) { + $data['firstauthorid'] = $lastmessage['firstauthorid']; + $data['firstauthor'] = $lastmessage['firstauthor']; + $data['firstsummary'] = $lastmessage['firstsummary']; + } + if($lastmessage['lastauthorid']) { + $data['lastauthorid'] = $lastmessage['lastauthorid']; + $data['lastauthor'] = $lastmessage['lastauthor']; + $data['lastsummary'] = $lastmessage['lastsummary']; + } + $data['msgfromid'] = $lastmessage['lastauthorid']; + $data['msgfrom'] = $lastmessage['lastauthor']; + $data['message'] = $lastmessage['lastsummary']; + + $data['new'] = $data['isnew']; + + $data['msgtoid'] = $data['touid']; + if($data['lastdateline'] >= $today) { + $daterange = 1; + } elseif($data['lastdateline'] >= $today - 86400) { + $daterange = 2; + } elseif($data['lastdateline'] >= $today - 172800) { + $daterange = 3; + } elseif($data['lastdateline'] >= $today - 604800) { + $daterange = 4; + } + $data['daterange'] = $daterange; + + $data['tousername'] = $tousernamearr[$data['touid']]; + unset($data['min_max']); + $array[] = $data; + } + } + return $array; + } + + function getplidbypmid($pmid) { + if(!$pmid) { + return false; + } + return $this->db->result_first("SELECT plid FROM ".UC_DBTABLEPRE."pm_indexes WHERE pmid='$pmid'"); + } + + function getplidbytouid($uid, $touid) { + if(!$uid || !$touid) { + return 0; + } + return $this->db->result_first("SELECT plid FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max='".$this->relationship($uid, $touid)."'"); + } + + function getuidbyplid($plid) { + if(!$plid) { + return array(); + } + $uidarr = array(); + $query = $this->db->query("SELECT uid FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + while($uid = $this->db->fetch_array($query)) { + $uidarr[$uid['uid']] = $uid['uid']; + } + return $uidarr; + } + + function chatpmmemberlist($uid, $plid) { + if(!$uid || !$plid) { + return 0; + } + $uidarr = $this->getuidbyplid($plid); + if(empty($uidarr)) { + return 0; + } + if(!isset($uidarr[$uid])) { + return 0; + } + $authorid = $this->db->result_first("SELECT authorid FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + return array('author' => $authorid, 'member' => $uidarr); + } + + function relationship($fromuid, $touid) { + if($fromuid < $touid) { + return $fromuid.'_'.$touid; + } elseif($fromuid > $touid) { + return $touid.'_'.$fromuid; + } else { + return ''; + } + } + + function getposttablename($plid) { + $id = substr((string)$plid, -1, 1); + return 'pm_messages_'.intval($id); + } + + function get_blackls($uid, $uids = array()) { + if(!$uids) { + $blackls = $this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'"); + } else { + $blackls = array(); + $uids = is_array($uids) ? $uids : array($uids); + foreach($uids as $uid) { + $blackls[$uid] = array(); + } + $uids = $this->base->implode($uids); + $query = $this->db->query("SELECT uid, blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid IN ($uids)"); + while($data = $this->db->fetch_array($query)) { + $blackls[$data['uid']] = explode(',', $data['blacklist']); + } + } + return $blackls; + } + + function set_blackls($uid, $blackls) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."memberfields SET blacklist='$blackls' WHERE uid='$uid'"); + return $this->db->affected_rows(); + } + + function update_blackls($uid, $username, $action = 1) { + $username = !is_array($username) ? array($username) : $username; + if($action == 1) { + if(!in_array('{ALL}', $username)) { + $usernames = $this->base->implode($username); + $query = $this->db->query("SELECT username FROM ".UC_DBTABLEPRE."members WHERE username IN ($usernames)"); + $usernames = array(); + while($data = $this->db->fetch_array($query)) { + $usernames[addslashes($data['username'])] = addslashes($data['username']); + } + if(!$usernames) { + return 0; + } + $blackls = addslashes($this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'")); + if($blackls) { + $list = explode(',', $blackls); + foreach($list as $k => $v) { + if(in_array($v, $usernames)) { + unset($usernames[$v]); + } + } + } + if(!$usernames) { + return 1; + } + $listnew = implode(',', $usernames); + $blackls .= $blackls !== '' ? ','.$listnew : $listnew; + } else { + $blackls = addslashes($this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'")); + $blackls .= ',{ALL}'; + } + } else { + $blackls = addslashes($this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'")); + $list = $blackls = explode(',', $blackls); + foreach($list as $k => $v) { + if(in_array($v, $username)) { + unset($blackls[$k]); + } + } + $blackls = implode(',', $blackls); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."memberfields SET blacklist='$blackls' WHERE uid='$uid'"); + return 1; + } + + function removecode($str, $length) { + static $uccode = null; + if($uccode === null) { + require_once UC_ROOT.'lib/uccode.class.php'; + $uccode = new uccode(); + } + $str = $uccode->complie($str); + return trim($this->base->cutstr(strip_tags($str), $length)); + } + + function ispminterval($uid, $interval = 0) { + if(!$uid) { + return 0; + } + $interval = intval($interval); + if(!$interval) { + return 1; + } + $lastupdate = $this->db->result_first("SELECT lastupdate FROM ".UC_DBTABLEPRE."pm_members WHERE uid='$uid' ORDER BY lastupdate DESC LIMIT 1"); + if(($this->base->time - $lastupdate) > $interval) { + return 1; + } else { + return 0; + } + } + + function isprivatepmthreadlimit($uid, $maxnum = 0) { + if(!$uid) { + return 0; + } + $maxnum = intval($maxnum); + if(!$maxnum) { + return 1; + } + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON m.plid=t.plid WHERE uid='$uid' AND lastupdate>'".($this->base->time-86400)."' AND t.pmtype=1"); + if($maxnum - $num < 0) { + return 0; + } else { + return 1; + } + } + + function ischatpmthreadlimit($uid, $maxnum = 0) { + if(!$uid) { + return 0; + } + $maxnum = intval($maxnum); + if(!$maxnum) { + return 1; + } + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_lists WHERE authorid='$uid' AND dateline>'".($this->base->time-86400)."'"); + if($maxnum - $num < 0) { + return 0; + } else { + return 1; + } + } +} +?> \ No newline at end of file diff --git a/uc_client/model/tag.php b/uc_client/model/tag.php new file mode 100644 index 0000000..7c52a78 --- /dev/null +++ b/uc_client/model/tag.php @@ -0,0 +1,71 @@ +tagmodel($base); + } + + function tagmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_tag_by_name($tagname) { + $arr = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."tags WHERE tagname='$tagname'"); + return $arr; + } + + function get_template($appid) { + $result = $this->db->result_first("SELECT tagtemplates FROM ".UC_DBTABLEPRE."applications WHERE appid='$appid'"); + return $result; + } + + function updatedata($appid, $data) { + $appid = intval($appid); + include_once UC_ROOT.'lib/xml.class.php'; + $data = xml_unserialize($data); + $this->base->load('app'); + $data[0] = addslashes($data[0]); + $datanew = array(); + if(is_array($data[1])) { + foreach($data[1] as $r) { + $datanew[] = $_ENV['misc']->array2string($r); + } + } + $tmp = $_ENV['app']->get_apps('type', "appid='$appid'"); + $datanew = addslashes($tmp[0]['type']."\t".implode("\t", $datanew)); + if(!empty($data[0])) { + $return = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."tags WHERE tagname='$data[0]' AND appid='$appid'"); + if($return) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."tags SET data='$datanew', expiration='".$this->base->time."' WHERE tagname='$data[0]' AND appid='$appid'"); + } else { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."tags (tagname, appid, data, expiration) VALUES ('$data[0]', '$appid', '$datanew', '".$this->base->time."')"); + } + } + } + + function formatcache($appid, $tagname) { + $return = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."tags WHERE tagname='$tagname' AND appid='$appid'"); + if($return) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."tags SET expiration='0' WHERE tagname='$tagname' AND appid='$appid'"); + } else { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."tags (tagname, appid, expiration) VALUES ('$tagname', '$appid', '0')"); + } + } + +} + +?> \ No newline at end of file diff --git a/uc_client/model/user.php b/uc_client/model/user.php new file mode 100644 index 0000000..07300a2 --- /dev/null +++ b/uc_client/model/user.php @@ -0,0 +1,388 @@ +usermodel($base); + } + + function usermodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_user_by_uid($uid) { + $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE uid='$uid'"); + return $arr; + } + + function get_user_by_username($username) { + $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE username='$username'"); + return $arr; + } + + function get_user_by_email($email) { + $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE email='$email'"); + return $arr; + } + + function get_user_by_secmobile($secmobicc, $secmobile) { + return $this->db->fetch_first_stmt("SELECT * FROM ".UC_DBTABLEPRE."members WHERE secmobicc=? AND secmobile=?", array('d', 'd'), array($secmobicc, $secmobile)); + } + + function check_username($username) { + $charset = strtolower(UC_CHARSET); + if ($charset === 'utf-8') { + $guestexp = '\xE3\x80\x80|\xE6\xB8\xB8\xE5\xAE\xA2|\xE9\x81\x8A\xE5\xAE\xA2'; + } elseif ($charset === 'gbk') { + $guestexp = '\xA1\xA1|\xD3\xCE\xBF\xCD'; + } elseif ($charset === 'big5') { + $guestexp = '\xA1\x40|\xB9\x43\xAB\xC8'; + } else { + return FALSE; + } + $guestexp .= '|^Guest'; + + $len = $this->dstrlen($username); + if($len > 15 || $len < 3 || preg_match("/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&\(\)']|$guestexp/is", $username)) { + return FALSE; + } else { + return TRUE; + } + } + + function dstrlen($str) { + if(strtolower(UC_CHARSET) != 'utf-8') { + return strlen($str); + } + $count = 0; + for($i = 0; $i < strlen($str); $i++){ + $value = ord($str[$i]); + if($value > 127) { + $count++; + if($value >= 192 && $value <= 223) $i++; + elseif($value >= 224 && $value <= 239) $i = $i + 2; + elseif($value >= 240 && $value <= 247) $i = $i + 3; + } + $count++; + } + return $count; + } + + function check_mergeuser($username) { + $data = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."mergemembers WHERE appid='".$this->base->app['appid']."' AND username='$username'"); + return $data; + } + + function check_usernamecensor($username) { + $_CACHE['badwords'] = $this->base->cache('badwords'); + $censorusername = $this->base->get_setting('censorusername'); + $censorusername = $censorusername['censorusername']; + $censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censorusername = trim($censorusername)), '/')).')$/i'; + $usernamereplaced = isset($_CACHE['badwords']['findpattern']) && !empty($_CACHE['badwords']['findpattern']) ? @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $username) : $username; + if(($usernamereplaced != $username) || ($censorusername && preg_match($censorexp, $username))) { + return FALSE; + } else { + return TRUE; + } + } + + function check_usernameexists($username) { + $data = $this->db->result_first("SELECT username FROM ".UC_DBTABLEPRE."members WHERE username='$username'"); + return $data; + } + + function check_emailformat($email) { + return strlen($email) > 6 && strlen($email) <= 255 && preg_match("/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/", $email); + } + + function check_emailaccess($email) { + $setting = $this->base->get_setting(array('accessemail', 'censoremail')); + $accessemail = $setting['accessemail']; + $censoremail = $setting['censoremail']; + $accessexp = '/('.str_replace("\r\n", '|', preg_quote(trim($accessemail), '/')).')$/i'; + $censorexp = '/('.str_replace("\r\n", '|', preg_quote(trim($censoremail), '/')).')$/i'; + if($accessemail || $censoremail) { + if(($accessemail && !preg_match($accessexp, $email)) || ($censoremail && preg_match($censorexp, $email))) { + return FALSE; + } else { + return TRUE; + } + } else { + return TRUE; + } + } + + function check_emailexists($email, $username = '') { + $sqladd = $username !== '' ? "AND username<>'$username'" : ''; + $email = $this->db->result_first("SELECT email FROM ".UC_DBTABLEPRE."members WHERE email='$email' $sqladd"); + return $email; + } + + function check_secmobileexists($secmobicc, $secmobile, $username = '') { + $sqladd = $username !== '' ? "AND username<>'$username'" : ''; + $secmobicc == 0 && $secmobicc = ''; + $secmobile == 0 && $secmobile = ''; + $secmobile = $this->db->result_first("SELECT secmobile FROM ".UC_DBTABLEPRE."members WHERE secmobicc='$secmobicc' AND secmobile='$secmobile' $sqladd"); + return $secmobile; + } + + function check_login($username, $password, &$user) { + $user = $this->get_user_by_username($username); + if(empty($user['username'])) { + return -1; + } elseif(!$this->verify_password($password, $user['password'], $user['salt'])) { + return -2; + } + $this->upgrade_password($username, $password, $user['password'], $user['salt']); + return $user['uid']; + } + + function add_user($username, $password, $email, $uid = 0, $questionid = '', $answer = '', $regip = '', $secmobicc = '', $secmobile = '') { + $regip = empty($regip) ? $this->base->onlineip : $regip; + $salt = ''; + $password = $this->generate_password($password); + $sqladd = $uid ? "uid='".intval($uid)."'," : ''; + $sqladd .= $questionid > 0 ? " secques='".$this->quescrypt($questionid, $answer)."'," : " secques='',"; + $sqladd .= $secmobicc ? "secmobicc='".$secmobicc."'," : ''; + $sqladd .= $secmobile ? "secmobile='".$secmobile."'," : ''; + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."members SET $sqladd username='$username', password='$password', email='$email', regip='$regip', regdate='".$this->base->time."', salt='$salt'"); + $uid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."memberfields SET uid='$uid'"); + return $uid; + } + + function edit_user($username, $oldpw, $newpw, $email, $ignoreoldpw = 0, $questionid = '', $answer = '', $secmobicc = '', $secmobile = '') { + $data = $this->db->fetch_first("SELECT username, uid, password, salt FROM ".UC_DBTABLEPRE."members WHERE username='$username'"); + + if($ignoreoldpw) { + $isprotected = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid = '{$data['uid']}'"); + if($isprotected) { + return -8; + } + } + + if(!$ignoreoldpw && !$this->verify_password($oldpw, $data['password'], $data['salt'])) { + return -1; + } + + $sqladd = $newpw ? "password='".$this->generate_password($newpw)."', salt=''" : ''; + $sqladd .= $email ? ($sqladd ? ',' : '')." email='$email'" : ''; + $sqladd .= $secmobicc !== '' ? ($sqladd ? ',' : '').(!empty($secmobicc) ? " secmobicc='$secmobicc'" : " secmobicc=''") : ''; + $sqladd .= $secmobile !== '' ? ($sqladd ? ',' : '').(!empty($secmobile) ? " secmobile='$secmobile'" : " secmobile=''") : ''; + if($questionid !== '') { + if($questionid > 0) { + $sqladd .= ($sqladd ? ',' : '')." secques='".$this->quescrypt($questionid, $answer)."'"; + } else { + $sqladd .= ($sqladd ? ',' : '')." secques=''"; + } + } + if($sqladd || $emailadd) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd WHERE username='$username'"); + return $this->db->affected_rows(); + } else { + return -7; + } + } + + function delete_user($uidsarr) { + $uidsarr = (array)$uidsarr; + if(!$uidsarr) { + return 0; + } + $uids = $this->base->implode($uidsarr); + $arr = $this->db->fetch_all("SELECT uid FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid IN ($uids)"); + $puids = array(); + foreach((array)$arr as $member) { + $puids[] = $member['uid']; + } + $uids = $this->base->implode(array_diff($uidsarr, $puids)); + if($uids) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."members WHERE uid IN($uids)"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."memberfields WHERE uid IN($uids)"); + uc_user_deleteavatar($uidsarr); + $this->base->load('note'); + $_ENV['note']->add('deleteuser', "ids=$uids"); + return $this->db->affected_rows(); + } else { + return 0; + } + } + + function delete_useravatar($uidsarr) { + if(!defined('UC_DELAVTDIR')) { + define('UC_DELAVTDIR', UC_DATADIR.'./avatar/'); + } + $uidsarr = (array)$uidsarr; + foreach((array)$uidsarr as $uid) { + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'big', 'real')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'middle', 'real')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'small', 'real')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'big')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'middle')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'small')) && unlink($avatar_file); + } + } + + function chgusername($uid, $newusername) { + return $this->db->query_stmt("UPDATE ".UC_DBTABLEPRE."members SET username=? WHERE uid=?", array('s', 'i'), array($newusername, $uid)); + } + + function get_total_num($sqladd = '') { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."members $sqladd"); + return $data; + } + + function get_list($page, $ppp, $totalnum, $sqladd) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."members $sqladd LIMIT $start, $ppp"); + return $data; + } + + function name2id($usernamesarr) { + $usernamesarr = uc_addslashes($usernamesarr, 1, TRUE); + $usernames = $this->base->implode($usernamesarr); + $query = $this->db->query("SELECT uid FROM ".UC_DBTABLEPRE."members WHERE username IN($usernames)"); + $arr = array(); + while($user = $this->db->fetch_array($query)) { + $arr[] = $user['uid']; + } + return $arr; + } + + function id2name($uidarr) { + $arr = array(); + $query = $this->db->query("SELECT uid, username FROM ".UC_DBTABLEPRE."members WHERE uid IN (".$this->base->implode($uidarr).")"); + while($user = $this->db->fetch_array($query)) { + $arr[$user['uid']] = $user['username']; + } + return $arr; + } + + function quescrypt($questionid, $answer) { + return $questionid > 0 && $answer != '' ? substr(md5($answer.md5($questionid)), 16, 8) : ''; + } + + function can_do_login($username, $ip = '') { + + $check_times = $this->base->settings['login_failedtime'] > 0 ? $this->base->settings['login_failedtime'] : ($this->base->settings['login_failedtime'] < 0 ? 0 : 5); + + if($check_times == 0) { + return -1; + } + + $username = substr(md5($username), 8, 15); + $expire = 15 * 60; + if(!$ip) { + $ip = $this->base->onlineip; + } + + $ip_check = $user_check = array(); + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."failedlogins WHERE ip='".$ip."' OR ip='$username'"); + while($row = $this->db->fetch_array($query)) { + if($row['ip'] === $username) { + $user_check = $row; + } elseif($row['ip'] === $ip) { + $ip_check = $row; + } + } + + if(empty($ip_check) || ($this->base->time - $ip_check['lastupdate'] > $expire)) { + $ip_check = array(); + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."failedlogins (ip, count, lastupdate) VALUES ('{$ip}', '0', '{$this->base->time}')"); + } + + if(empty($user_check) || ($this->base->time - $user_check['lastupdate'] > $expire)) { + $user_check = array(); + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."failedlogins (ip, count, lastupdate) VALUES ('{$username}', '0', '{$this->base->time}')"); + } + + if ($ip_check || $user_check) { + $time_left = min(($check_times - $ip_check['count']), ($check_times - $user_check['count'])); + return $time_left; + + } + + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."failedlogins WHERE lastupdate<".($this->base->time - ($expire + 1)), 'UNBUFFERED'); + + return $check_times; + } + + function loginfailed($username, $ip = '') { + $username = substr(md5($username), 8, 15); + if(!$ip) { + $ip = $this->base->onlineip; + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."failedlogins SET count=count+1, lastupdate='".$this->base->time."' WHERE ip='".$ip."' OR ip='$username'"); + } + + function user_log($uid, $action, $extra = '') { + $uid = intval($uid); + $action = addslashes($action); + $extra = addslashes($extra); + $this->db->query_stmt("INSERT INTO ".UC_DBTABLEPRE."memberlogs SET uid=?, action=?, extra=?", array('i', 's', 's'), array($uid, $action, $extra)); + } + + function get_passwordalgo() { + $algo = $this->base->settings['passwordalgo']; + if(empty($algo)) { + return constant('PASSWORD_BCRYPT'); + } else { + return constant($algo) === null ? constant('PASSWORD_BCRYPT') : constant($algo); + } + } + + function get_passwordoptions() { + $options = $this->base->settings['passwordoptions']; + if(empty($options)) { + return array(); + } else { + $result = json_decode($options, true); + return is_array($result) ? $result : array(); + } + } + + function generate_password($password) { + $algo = $this->get_passwordalgo(); + $options = $this->get_passwordoptions(); + $hash = password_hash($password, $algo, $options); + return ($hash === false || $hash === null || !password_verify($password, $hash)) ? password_hash($password, PASSWORD_BCRYPT) : $hash; + } + + function verify_password($password, $hash, $salt = '') { + if(empty($salt)) { + return password_verify($password, $hash); + } else if(strlen($salt) == 6) { + return hash_equals($hash, md5(md5($password).$salt)); + } else if(strlen($salt) > 6 && strlen($salt) < 20 && file_exists(UC_ROOT . "lib/uc_password_$salt.class.php")) { + $classname = "uc_password_$salt"; + include(UC_ROOT . "lib/uc_password_$salt.class.php"); + return $classname::verify_password($password, $hash); + } + return false; + } + + function upgrade_password($username, $password, $hash, $salt = '') { + $algo = $this->get_passwordalgo(); + $options = $this->get_passwordoptions(); + if (!empty($salt) || password_needs_rehash($hash, $algo, $options)) { + $password_new = $this->generate_password($password); + $sqladd = "password = '$password_new', salt = ''"; + return $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd WHERE username='$username'"); + } + return true; + } + +} \ No newline at end of file diff --git a/uc_client/model/var.php b/uc_client/model/var.php new file mode 100644 index 0000000..9e5e40e --- /dev/null +++ b/uc_client/model/var.php @@ -0,0 +1,37 @@ +time =& self::$instance->time; + $class->onlineip =& self::$instance->onlineip; + $class->db =& self::$instance->db; + $class->settings =& self::$instance->settings; + $class->cache =& self::$instance->cache; + $class->_CACHE =& self::$instance->_CACHE; + $class->app =& self::$instance->app; + } + +} + +?> \ No newline at end of file diff --git a/uc_client/release/index.htm b/uc_client/release/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_client/release/release.php b/uc_client/release/release.php new file mode 100644 index 0000000..b30174d --- /dev/null +++ b/uc_client/release/release.php @@ -0,0 +1,6 @@ +$method(); + } elseif(method_exists($control, '_call')) { + $control->_call('on'.$a, ''); + } else { + exit('Action not found!'); + } +} else { + exit('Module not found!'); +} + +$mtime = explode(' ', microtime()); +$endtime = $mtime[1] + $mtime[0]; + +function daddslashes($string, $force = 0, $strip = FALSE) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = daddslashes($val, $force, $strip); + } + } else { + $string = addslashes($strip ? stripslashes($string) : $string); + } + return $string; +} + +function getgpc($k, $t='R') { + switch($t) { + case 'P': $var = &$_POST; break; + case 'G': $var = &$_GET; break; + case 'C': $var = &$_COOKIE; break; + case 'R': $var = &$_REQUEST; break; + } + return isset($var[$k]) ? (is_array($var[$k]) ? $var[$k] : trim($var[$k])) : NULL; +} + +function fsocketopen($hostname, $port = 80, &$errno = null, &$errstr = null, $timeout = 15) { + $fp = ''; + if(function_exists('fsockopen')) { + $fp = @fsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('pfsockopen')) { + $fp = @pfsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('stream_socket_client')) { + $fp = @stream_socket_client($hostname.':'.$port, $errno, $errstr, $timeout); + } + return $fp; +} + +function dhtmlspecialchars($string, $flags = null) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = dhtmlspecialchars($val, $flags); + } + } else { + if($flags === null) { + $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); + if(strpos($string, '&#') !== false) { + $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string); + } + } else { + if(PHP_VERSION < '5.4.0') { + $string = htmlspecialchars($string, $flags); + } else { + if(strtolower(CHARSET) == 'utf-8') { + $charset = 'UTF-8'; + } else { + $charset = 'ISO-8859-1'; + } + $string = htmlspecialchars($string, $flags, $charset); + } + } + } + return $string; +} + +function is_https() { + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { + return true; + } + return false; +} + +?> \ No newline at end of file diff --git a/uc_server/api/dbbak.php b/uc_server/api/dbbak.php new file mode 100644 index 0000000..3a46a67 --- /dev/null +++ b/uc_server/api/dbbak.php @@ -0,0 +1,789 @@ + 3600) { + exit('Authorization has expired'); +} +$get['time'] = $timestamp; + +class dbstuffi { + var $querynum = 0; + var $link; + var $histories; + var $time; + var $tablepre; + + function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset = '', $pconnect = 0, $tablepre='', $time = 0) { + $this->time = $time; + $this->tablepre = $tablepre; + + mysqli_report(MYSQLI_REPORT_OFF); + + $this->link = new mysqli(); + if(!$this->link->real_connect($dbhost, $dbuser, $dbpw, $dbname, null, null, MYSQLI_CLIENT_COMPRESS)) { + $this->halt('Can not connect to MySQL server'); + } + + if($dbcharset) { + $this->link->set_charset($dbcharset); + } + + $this->link->query("SET sql_mode=''"); + + $this->link->query("SET character_set_client=binary"); + + } + + function fetch_array($query, $result_type = MYSQLI_ASSOC) { + return $query ? $query->fetch_array($result_type) : null; + } + + function result_first($sql) { + $query = $this->query($sql); + return $this->result($query, 0); + } + + function fetch_first($sql) { + $query = $this->query($sql); + return $this->fetch_array($query); + } + + function fetch_all($sql) { + $arr = array(); + $query = $this->query($sql); + while($data = $this->fetch_array($query)) { + $arr[] = $data; + } + return $arr; + } + + function cache_gc() { + $this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time"); + } + + function query($sql, $type = '', $cachetime = FALSE) { + $resultmode = $type == 'UNBUFFERED' ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT; + if(!($query = $this->link->query($sql, $resultmode)) && $type != 'SILENT') { + $this->halt('MySQL Query Error', $sql); + } + $this->querynum++; + $this->histories[] = $sql; + return $query; + } + + function affected_rows() { + return $this->link->affected_rows; + } + + function error() { + return $this->link->error; + } + + function errno() { + return $this->link->errno; + } + + function result($query, $row) { + if(!$query || $query->num_rows == 0) { + return null; + } + $query->data_seek($row); + $assocs = $query->fetch_row(); + return $assocs[0]; + } + + function num_rows($query) { + $query = $query ? $query->num_rows : 0; + return $query; + } + + function num_fields($query) { + return $query ? $query->field_count : 0; + } + + function free_result($query) { + return $query ? $query->free() : false; + } + + function insert_id() { + return ($id = $this->link->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); + } + + function fetch_row($query) { + $query = $query ? $query->fetch_row() : null; + return $query; + } + + function fetch_fields($query) { + return $query ? $query->fetch_field() : null; + } + + function version() { + return $this->link->server_info; + } + + function escape_string($str) { + return $this->link->escape_string($str); + } + + function close() { + return $this->link->close(); + } + + function halt($message = '', $sql = '') { + api_msg('run_sql_error', $message.'

                                    '.$sql.'
                                    '.$this->link->error()); + } +} + +$db = new dbstuffi(); +$version = ''; +if($apptype == 'discuz') { + + define('BACKUP_DIR', ROOT_PATH.'forumdata/'); + $tablepre = $tablepre; + if(empty($dbcharset)) { + $dbcharset = in_array(strtolower($charset), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $charset) : ''; + } + $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre); + define('IN_DISCUZ', true); + include ROOT_PATH.'discuz_version.php'; + $version = DISCUZ_VERSION; + +} elseif($apptype == 'uchome' || $apptype == 'supesite') { + + define('BACKUP_DIR', ROOT_PATH.'./data/'); + $tablepre = $_SC['tablepre']; + $dbcharset = $_SC['dbcharset']; + $db->connect($_SC['dbhost'], $_SC['dbuser'], $_SC['dbpw'], $_SC['dbname'], $dbcharset, $_SC['pconnect'], $tablepre); + +} elseif($apptype == 'ucenter') { + + define('BACKUP_DIR', ROOT_PATH.'./data/backup/'); + $tablepre = UC_DBTABLEPRE; + $dbcharset = UC_DBCHARSET; + $db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, $dbcharset, UC_DBCONNECT, $tablepre); + +} elseif($apptype == 'ecmall') { + + define('BACKUP_DIR', ROOT_PATH.'./data/backup/'); + $tablepre = DB_PREFIX; + $dbcharset = strtolower(str_replace('-', '', strstr(LANG, '-'))); + $cfg = parse_url(DB_CONFIG); + if(empty($cfg['pass'])) { + $cfg['pass'] = ''; + } else { + $cfg['pass'] = urldecode($cfg['pass']); + } + $cfg['user'] = urldecode($cfg['user']); + $cfg['path'] = str_replace('/', '', $cfg['path']); + + $db->connect($cfg['host'].':'.$cfg['port'], $cfg['user'], $cfg['pass'], $cfg['path'], $dbcharset, 0, $tablepre); + +} elseif($apptype == 'supev') { + + define('BACKUP_DIR', ROOT_PATH.'data/backup/'); + $tablepre = $tablepre; + if(empty($dbcharset)) { + $dbcharset = in_array(strtolower($_config['output']['charset']), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', CHARSET) : ''; + } + $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre); + +} elseif($apptype == 'ecshop') { + + define('BACKUP_DIR', ROOT_PATH.'data/backup/'); + $tablepre = $prefix; + $dbcharset = 'utf8'; + $db->connect($db_host, $db_user, $db_pass, $db_name, $dbcharset, 0, $tablepre); + +} elseif($apptype == 'discuzx') { + + define('BACKUP_DIR', ROOT_PATH.'data/'); + extract($_config['db']['1']); + if(empty($dbcharset)) { + $dbcharset = in_array(strtolower(CHARSET), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $_config['output']['charset']) : ''; + } + $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre); + define('IN_DISCUZ', true); + include ROOT_PATH.'source/discuz_version.php'; + $version = DISCUZ_VERSION; + +} + +if($get['method'] == 'export') { + + $db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT'); + + $time = date("Y-m-d H:i:s", $timestamp); + + $tables = array(); + $tables = arraykeys2(fetchtablelist($tablepre), 'Name'); + + if($apptype == 'discuz') { + $query = $db->query("SELECT datatables FROM {$tablepre}plugins WHERE datatables<>''"); + while($plugin = $db->fetch_array($query)) { + foreach(explode(',', $plugin['datatables']) as $table) { + if($table = trim($table)) { + $tables[] = $table; + } + } + } + } + if($apptype == 'discuzx') { + $query = $db->query("SELECT datatables FROM {$tablepre}common_plugin WHERE datatables<>''"); + while($plugin = $db->fetch_array($query)) { + foreach(explode(',', $plugin['datatables']) as $table) { + if($table = trim($table)) { + $tables[] = $table; + } + } + } + } + + $memberexist = array_search("{$tablepre}common_member", $tables); + if($memberexist !== FALSE) { + unset($tables[$memberexist]); + array_unshift($tables, "{$tablepre}common_member"); + } + + $get['volume'] = isset($get['volume']) ? intval($get['volume']) : 0; + $get['volume'] = $get['volume'] + 1; + $version = $version ? $version : $apptype; + $idstring = '# Identify: '.base64_encode("$timestamp,$version,$apptype,multivol,{$get['volume']}")."\n"; + + if(!isset($get['sqlpath']) || empty($get['sqlpath'])) { + $get['sqlpath'] = 'backup_'.date('ymd', $timestamp).'_'.random(6); + if(!mkdir(BACKUP_DIR.'./'.$get['sqlpath'], 0777)) { + api_msg('mkdir_error', 'make dir error:'.BACKUP_DIR.'./'.$get['sqlpath']); + } + } else { + $get['sqlpath'] = str_replace(array('/', '\\', '.', "'"), '', $get['sqlpath']); + if(!is_dir(BACKUP_DIR.'./'.$get['sqlpath'])) { + if(!mkdir(BACKUP_DIR.'./'.$get['sqlpath'], 0777)) { + api_msg('mkdir_error', 'make dir error:'.BACKUP_DIR.'./'.$get['sqlpath']); + } + } + } + + if(!isset($get['backupfilename']) || empty($get['backupfilename'])) { + $get['backupfilename'] = date('ymd', $timestamp).'_'.random(6); + } + + $sqldump = ''; + $get['tableid'] = isset($get['tableid']) ? intval($get['tableid']) : 0; + $get['startfrom'] = isset($get['startfrom']) ? intval($get['startfrom']) : 0; + + if(!$get['tableid'] && $get['volume'] == 1) { + foreach($tables as $table) { + $sqldump .= sqldumptablestruct($table); + } + } + $complete = TRUE; + for(; $complete && $get['tableid'] < count($tables) && strlen($sqldump) + 500 < $sizelimit * 1000; $get['tableid']++) { + $sqldump .= sqldumptable($tables[$get['tableid']], strlen($sqldump)); + if($complete) { + $get['startfrom'] = 0; + } + } + + !$complete && $get['tableid']--; + $dumpfile = BACKUP_DIR.$get['sqlpath'].'/'.$get['backupfilename'].'-'.$get['volume'].'.sql'; + if(trim($sqldump)) { + $sqldump = "$idstring". + "# \n". + "# $apptype Multi-Volume Data Dump Vol.{$get['volume']}\n". + "# Time: $time\n". + "# Type: $apptype\n". + "# Table Prefix: $tablepre\n". + "# $dbcharset\n". + "# $apptype Home: https://www.discuz.vip\n". + "# Please visit our website for newest infomation about $apptype\n". + "# --------------------------------------------------------\n\n\n". + $sqldump; + $fp = fopen($dumpfile, 'cb'); + if(!($fp && flock($fp, LOCK_EX) && ftruncate($fp, 0) && fwrite($fp, $sqldump) && fflush($fp) && flock($fp, LOCK_UN) && fclose($fp))) { + flock($fp, LOCK_UN); + fclose($fp); + api_msg('database_export_file_invalid', $dumpfile); + } else { + auto_next($get, $dumpfile); + } + } else { + @touch(BACKUP_DIR.$get['sqlpath'].'/index.htm'); + api_msg('explor_success', 'explor_success'); + } + +} elseif($get['method'] == 'import') { + + if(!isset($get['dumpfile']) || empty($get['dumpfile'])) { + $get['dumpfile'] = get_dumpfile_by_path($get['sqlpath']); + $get['volume'] = 0; + } + + if(!preg_match('/^backup_(\d+)_\w+$/', $get['sqlpath']) || !preg_match('/^\d+_\w+\-(\d+).sql$/', $get['dumpfile'])) { + api_msg('bak_file_lose', $get['dumpfile']); + } + + $get['volume']++; + $next_dumpfile = preg_replace('/^(\d+)\_(\w+)\-(\d+)\.sql$/', '\\1_\\2-'.$get['volume'].'.sql', $get['dumpfile']); + if(!is_file(BACKUP_DIR.$get['sqlpath'].'/'.$get['dumpfile'])) { + if(is_file(BACKUP_DIR.$get['sqlpath'].'/'.$next_dumpfile)) { + api_msg('bak_file_lose', $get['dumpfile']); + } else { + api_msg('import_success', 'import_success'); + } + } + + $sqldump = file_get_contents(BACKUP_DIR.$get['sqlpath'].'/'.$get['dumpfile']); + $sqlquery = splitsql($sqldump); + unset($sqldump); + + foreach($sqlquery as $sql) { + $sql = syntablestruct(trim($sql), true, $dbcharset); + + if($sql != '') { + $db->query($sql, 'SILENT'); + if(($sqlerror = $db->error()) && $db->errno() != 1062) { + $db->halt('MySQL Query Error', $sql); + } + } + } + + $cur_file = $get['dumpfile']; + $get['dumpfile'] = $next_dumpfile; + auto_next($get, BACKUP_DIR.$get['sqlpath'].'/'.$cur_file); + +} elseif($get['method'] == 'ping') { + + if($get['dir'] && is_dir(BACKUP_DIR.$get['dir'])) { + echo "1";exit; + } else { + echo "-1";exit; + } + +} elseif($get['method'] == 'list') { + + $str = "\n"; + $directory = dir(BACKUP_DIR); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$entry; + if(is_dir($filename) && preg_match('/^backup_(\d+)_\w+$/', $entry, $match)) { + $str .= "\t\n"; + $str .= "\t\t$filename\n"; + $str .= "\t\t$match[1]\n"; + $str .= "\t\n"; + } + } + $directory->close(); + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + +} elseif($get['method'] == 'view') { + + $sqlpath = trim($get['sqlpath']); + if(empty($sqlpath) || !is_dir(BACKUP_DIR.$sqlpath)) { + api_msg('dir_no_exists', $sqlpath); + } + + $str = "\n"; + $directory = dir(BACKUP_DIR.$sqlpath); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$sqlpath.'/'.$entry; + if(is_file($filename) && preg_match('/\d+_\w+\-(\d+).sql$/', $filename, $match)) { + $str .= "\t\n"; + $str .= "\t\t$match[0]\n"; + $str .= "\t\t".filesize($filename)."\n"; + $str .= "\t\t$match[1]\n"; + $str .= "\t\t".str_replace(ROOT_PATH, (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].'/', $filename)."\n"; + $str .= "\t\t".filemtime($filename)."\n"; + $str .= "\t\n"; + } + } + $directory->close(); + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + +} elseif($get['method'] == 'delete') { + + $sqlpath = trim($get['sqlpath']); + if(empty($sqlpath) || !is_dir(BACKUP_DIR.$sqlpath) || !preg_match('/^backup_(\d+)_\w+$/', $get['sqlpath'])) { + api_msg('dir_no_exists', $sqlpath); + } + $directory = dir(BACKUP_DIR.$sqlpath); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$sqlpath.'/'.$entry; + if(is_file($filename) && preg_match('/^\d+_\w+\-(\d+).sql$/', $entry) && !@unlink($filename)) { + api_msg('delete_dumpfile_error', $filename); + } + } + $directory->close(); + @rmdir(BACKUP_DIR.$sqlpath); + api_msg('delete_sqlpath_success', 'delete_sqlpath_success'); + +} + +function syntablestruct($sql, $version, $dbcharset) { + + if(strpos(trim(substr($sql, 0, 18)), 'CREATE TABLE') === FALSE) { + return $sql; + } + + $sqlversion = strpos($sql, 'ENGINE=') === FALSE ? FALSE : TRUE; + + if($sqlversion === $version) { + + return $sqlversion && $dbcharset ? preg_replace(array('/ character set \w+/i', '/ collate \w+/i', "/DEFAULT CHARSET=\w+/is"), array('', '', "DEFAULT CHARSET=$dbcharset"), $sql) : $sql; + } + + if($version) { + return preg_replace(array('/TYPE=HEAP/i', '/TYPE=(\w+)/is'), array("ENGINE=MEMORY DEFAULT CHARSET=$dbcharset", "ENGINE=\\1 DEFAULT CHARSET=$dbcharset"), $sql); + + } else { + return preg_replace(array('/character set \w+/i', '/collate \w+/i', '/ENGINE=MEMORY/i', '/\s*DEFAULT CHARSET=\w+/is', '/\s*COLLATE=\w+/is', '/ENGINE=(\w+)(.*)/is'), array('', '', 'ENGINE=HEAP', '', '', 'TYPE=\\1\\2'), $sql); + } +} + +function splitsql($sql) { + $sql = str_replace("\r", "\n", $sql); + $ret = array(); + $num = 0; + $queriesarray = explode(";\n", trim($sql)); + unset($sql); + foreach($queriesarray as $query) { + $ret[$num] = isset($ret[$num]) ? $ret[$num] : ''; + $queries = explode("\n", trim($query)); + foreach($queries as $query) { + $ret[$num] .= isset($query[0]) && $query[0] == "#" ? NULL : $query; + } + $num++; + } + return($ret); +} + +function get_dumpfile_by_path($path) { + if(empty($path) || !is_dir(BACKUP_DIR.$path)) { + api_msg('sqlpath_null_noexists', $path); + } + $directory = dir(BACKUP_DIR.$path); + while($entry = $directory->read()) { + $filename = BACKUP_DIR.$path.'/'.$entry; + if(is_file($filename)) { + if(preg_match('/^\d+\_\w+\-\d+\.sql$/', $entry)) { + $file_bakfile = preg_replace('/^(\d+)\_(\w+)\-(\d+)\.sql$/', '\\1_\\2-1.sql', $entry); + if(is_file(BACKUP_DIR.$path.'/'.$file_bakfile)) { + return $file_bakfile; + } else { + api_msg('sqlpath_nomatch_bakfile', $path); + } + } + } + } + $directory->close(); + api_msg('sqlpath_nomatch_bakfile', $path); +} + +function api_msg($code, $msg) { + $msg = htmlspecialchars($msg); + $out = "\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\t\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= ""; + send_mime_type_header(); + echo $out; + exit; +} + +function arraykeys2($array, $key2) { + $return = array(); + foreach($array as $val) { + $return[] = $val[$key2]; + } + return $return; +} + +function auto_next($get, $sqlfile) { + $next_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?apptype='.$GLOBALS['apptype'].'&code='.urlencode(encode_arr($get)); + $out = "\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= "\t\t{$get['volume']}\n"; + $out .= "\t\t".filesize($sqlfile)."\n"; + $out .= "\t\t".basename($sqlfile)."\n"; + $out .= "\t\t".str_replace(ROOT_PATH, (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].'/', $sqlfile)."\n"; + $out .= "\t\t".filemtime($sqlfile)."\n"; + $out .= "\t\n"; + $out .= "\t\n"; + $out .= ""; + send_mime_type_header(); + echo $out; + exit; +} + +function encode_arr($get) { + $tmp = ''; + foreach($get as $key => $val) { + $tmp .= '&'.$key.'='.$val; + } + return _authcode($tmp, 'ENCODE', UC_KEY); +} + +function sqldumptablestruct($table) { + global $db; + + $createtable = $db->query("SHOW CREATE TABLE $table", 'SILENT'); + + if(!$db->error()) { + $tabledump = "DROP TABLE IF EXISTS $table;\n"; + } else { + return ''; + } + + $create = $db->fetch_row($createtable); + + if(strpos($table, '.') !== FALSE) { + $tablename = substr($table, strpos($table, '.') + 1); + $create[1] = str_replace("CREATE TABLE $tablename", 'CREATE TABLE '.$table, $create[1]); + } + $tabledump .= $create[1]; + + $tablestatus = $db->fetch_first("SHOW TABLE STATUS LIKE '$table'"); + $tabledump .= ($tablestatus['Auto_increment'] ? " AUTO_INCREMENT={$tablestatus['Auto_increment']}" : '').";\n\n"; + return $tabledump; +} + +function sqldumptable($table, $currsize = 0) { + global $get, $db, $sizelimit, $startrow, $extendins, $sqlcompat, $sqlcharset, $dumpcharset, $usehex, $complete, $excepttables; + + $offset = 300; + $tabledump = ''; + $tablefields = array(); + + $query = $db->query("SHOW FULL COLUMNS FROM $table", 'SILENT'); + if(strexists($table, 'adminsessions')) { + return ; + } elseif(!$query && $db->errno() == 1146) { + return; + } elseif(!$query) { + $usehex = FALSE; + } else { + while($fieldrow = $db->fetch_array($query)) { + $tablefields[] = $fieldrow; + } + } + + $tabledumped = 0; + $numrows = $offset; + $firstfield = $tablefields[0]; + + while($currsize + strlen($tabledump) + 500 < $sizelimit * 1000 && $numrows == $offset) { + if($firstfield['Extra'] == 'auto_increment') { + $selectsql = "SELECT * FROM $table WHERE {$firstfield['Field']} > {$get['startfrom']} LIMIT $offset"; + } else { + $selectsql = "SELECT * FROM $table LIMIT {$get['startfrom']}, $offset"; + } + $tabledumped = 1; + $rows = $db->query($selectsql); + $numfields = $db->num_fields($rows); + + $numrows = $db->num_rows($rows); + while($row = $db->fetch_row($rows)) { + $comma = $t = ''; + for($i = 0; $i < $numfields; $i++) { + $t .= $comma.($usehex && !empty($row[$i]) && (strexists($tablefields[$i]['Type'], 'char') || strexists($tablefields[$i]['Type'], 'text')) ? '0x'.bin2hex($row[$i]) : '\''.$db->escape_string($row[$i]).'\''); + $comma = ','; + } + if(strlen($t) + $currsize + strlen($tabledump) + 500 < $sizelimit * 1000) { + if($firstfield['Extra'] == 'auto_increment') { + $get['startfrom'] = $row[0]; + } else { + $get['startfrom']++; + } + $tabledump .= "INSERT INTO $table VALUES ($t);\n"; + } else { + $complete = FALSE; + break 2; + } + } + } + + $tabledump .= "\n"; + + return $tabledump; +} + +function random($length, $numeric = 0) { + $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35); + $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed)); + if($numeric) { + $hash = ''; + } else { + $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64); + $length--; + } + $max = strlen($seed) - 1; + for($i = 0; $i < $length; $i++) { + $hash .= $seed[mt_rand(0, $max)]; + } + return $hash; +} + +function fetchtablelist($tablepre = '') { + global $db; + $arr = explode('.', $tablepre); + $dbname = isset($arr[1]) && $arr[1] ? $arr[0] : ''; + $tablepre = str_replace('_', '\_', $tablepre); + $sqladd = $dbname ? " FROM $dbname LIKE '$arr[1]%'" : "LIKE '$tablepre%'"; + $tables = $table = array(); + $query = $db->query("SHOW TABLE STATUS $sqladd"); + while($table = $db->fetch_array($query)) { + $table['Name'] = ($dbname ? "$dbname." : '').$table['Name']; + $tables[] = $table; + } + return $tables; +} + +function _authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + $ckey_length = 4; + + $key = md5($key ? $key : UC_KEY); + $keya = md5(substr($key, 0, 16)); + $keyb = md5(substr($key, 16, 16)); + $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; + + $cryptkey = $keya.md5($keya.$keyc); + $key_length = strlen($cryptkey); + + $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; + $string_length = strlen($string); + + $result = ''; + $box = range(0, 255); + + $rndkey = array(); + for($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($cryptkey[$i % $key_length]); + } + + for($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + + for($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); + } + + if($operation == 'DECODE') { + if(((int)substr($result, 0, 10) == 0 || (int)substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26).$keyb), 0, 16)) { + return substr($result, 26); + } else { + return ''; + } + } else { + return $keyc.str_replace('=', '', base64_encode($result)); + } + +} + +function strexists($haystack, $needle) { + return !(strpos($haystack, $needle) === FALSE); +} + +function send_mime_type_header($type = 'application/xml') { + header("Content-Type: ".$type); +} + +function is_https() { + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { + return true; + } + return false; +} \ No newline at end of file diff --git a/uc_server/api/index.htm b/uc_server/api/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/avatar.php b/uc_server/avatar.php new file mode 100644 index 0000000..07239df --- /dev/null +++ b/uc_server/avatar.php @@ -0,0 +1,107 @@ + \ No newline at end of file diff --git a/uc_server/control/admin/admin.php b/uc_server/control/admin/admin.php new file mode 100644 index 0000000..63b8551 --- /dev/null +++ b/uc_server/control/admin/admin.php @@ -0,0 +1,168 @@ +control(); + } + + function control() { + parent::__construct(); + $this->load('user'); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadminbadword']) { + $this->message('no_permission_for_this_module'); + } + } + + function onls() { + + $status = 0; + if(!empty($_POST['addname']) && $this->submitcheck()) { + $addname = getgpc('addname', 'P'); + $this->view->assign('addname', $addname); + $uid = $this->db->result_first("SELECT uid FROM ".UC_DBTABLEPRE."members WHERE username='$addname'"); + if($uid) { + $adminuid = $this->db->result_first("SELECT uid FROM ".UC_DBTABLEPRE."admins WHERE username='$addname'"); + if($adminuid) { + $status = -1; + } else { + $allowadminsetting = getgpc('allowadminsetting', 'P'); + $allowadminapp = getgpc('allowadminapp', 'P'); + $allowadminuser = getgpc('allowadminuser', 'P'); + $allowadminbadword = getgpc('allowadminbadword', 'P'); + $allowadmincredits = getgpc('allowadmincredits', 'P'); + $allowadmintag = getgpc('allowadmintag', 'P'); + $allowadminpm = getgpc('allowadminpm', 'P'); + $allowadmindomain = getgpc('allowadmindomain', 'P'); + $allowadmindb = getgpc('allowadmindb', 'P'); + $allowadminnote = getgpc('allowadminnote', 'P'); + $allowadmincache = getgpc('allowadmincache', 'P'); + $allowadminlog = getgpc('allowadminlog', 'P'); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."admins SET + uid='$uid', + username='$addname', + allowadminsetting='$allowadminsetting', + allowadminapp='$allowadminapp', + allowadminuser='$allowadminuser', + allowadminbadword='$allowadminbadword', + allowadmincredits='$allowadmincredits', + allowadmintag='$allowadmintag', + allowadminpm='$allowadminpm', + allowadmindomain='$allowadmindomain', + allowadmindb='$allowadmindb', + allowadminnote='$allowadminnote', + allowadmincache='$allowadmincache', + allowadminlog='$allowadminlog'"); + $insertid = $this->db->insert_id(); + if($insertid) { + $this->writelog('admin_add', 'username='.dhtmlspecialchars($addname)); + $status = 1; + } else { + $status = -2; + } + } + } else { + $status = -3; + } + } + + if(!empty($_POST['editpwsubmit']) && $this->submitcheck()) { + $oldpw = getgpc('oldpw', 'P'); + $newpw = getgpc('newpw', 'P'); + $newpw2 = getgpc('newpw2', 'P'); + $reconfkey = getgpc('reconfkey', 'P'); + if($_ENV['user']->verify_password($oldpw, UC_FOUNDERPW, UC_FOUNDERSALT) || hash_equals(UC_FOUNDERPW, md5(md5($oldpw).UC_FOUNDERSALT))) { + if($newpw != $newpw2) { + $status = -6; + } else { + $status = $_ENV['user']->reset_founderpw($newpw, $reconfkey); + if($status === 2) { + $this->writelog('admin_pw_edit'); + } + } + } else { + $status = -5; + } + } + + $this->view->assign('status', $status); + + if(!empty($_POST['delete'])) { + $uids = $this->implode(getgpc('delete', 'P')); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."admins WHERE uid IN ($uids)"); + } + + $page = max(1, getgpc('page')); + $ppp = 15; + $totalnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."admins"); + $start = $this->page_get_start($page, $ppp, $totalnum); + $userlist = $this->db->fetch_all("SELECT m.*,a.* FROM ".UC_DBTABLEPRE."admins a LEFT JOIN ".UC_DBTABLEPRE."members m USING(uid) LIMIT $start, $ppp"); + $multipage = $this->page($totalnum, $ppp, $page, UC_ADMINSCRIPT.'?m=admin&a=admin'); + if($userlist) { + foreach($userlist as $key => $user) { + $user['regdate'] = $this->date($user['regdate']); + $userlist[$key] = $user; + } + } + + $a = getgpc('a'); + $this->view->assign('a', $a); + $this->view->assign('multipage', $multipage); + $this->view->assign('userlist', $userlist); + $this->view->display('admin_admin'); + + } + + function onedit() { + $uid = getgpc('uid'); + $status = 0; + if($this->submitcheck()) { + $allowadminsetting = getgpc('allowadminsetting', 'P'); + $allowadminapp = getgpc('allowadminapp', 'P'); + $allowadminuser = getgpc('allowadminuser', 'P'); + $allowadminbadword = getgpc('allowadminbadword', 'P'); + $allowadmintag = getgpc('allowadmintag', 'P'); + $allowadminpm = getgpc('allowadminpm', 'P'); + $allowadmincredits = getgpc('allowadmincredits', 'P'); + $allowadmindomain = getgpc('allowadmindomain', 'P'); + $allowadmindb = getgpc('allowadmindb', 'P'); + $allowadminnote = getgpc('allowadminnote', 'P'); + $allowadmincache = getgpc('allowadmincache', 'P'); + $allowadminlog = getgpc('allowadminlog', 'P'); + $this->db->query("UPDATE ".UC_DBTABLEPRE."admins SET + allowadminsetting='$allowadminsetting', + allowadminapp='$allowadminapp', + allowadminuser='$allowadminuser', + allowadminbadword='$allowadminbadword', + allowadmincredits='$allowadmincredits', + allowadmintag='$allowadmintag', + allowadminpm='$allowadminpm', + allowadmindomain='$allowadmindomain', + allowadmindb='$allowadmindb', + allowadminnote='$allowadminnote', + allowadmincache='$allowadmincache', + allowadminlog='$allowadminlog' + WHERE uid='$uid'"); + $status = $this->db->errno() ? -1 : 1; + $this->writelog('admin_priv_edit', 'username='.dhtmlspecialchars($admin)); + } + $admin = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."admins WHERE uid='$uid'"); + $this->view->assign('uid', $uid); + $this->view->assign('admin', $admin); + $this->view->assign('status', $status); + $this->view->display('admin_admin'); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/app.php b/uc_server/control/admin/app.php new file mode 100644 index 0000000..f46bebb --- /dev/null +++ b/uc_server/control/admin/app.php @@ -0,0 +1,278 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadminapp']) { + $this->message('no_permission_for_this_module'); + } + $this->load('app'); + $this->load('misc'); + } + + function onls() { + $status = $affectedrows = 0; + if($this->submitcheck() && !empty($_POST['delete'])) { + $affectedrows += $_ENV['app']->delete_apps($_POST['delete']); + foreach($_POST['delete'] as $k => $appid) { + $_ENV['app']->alter_app_table($appid, 'REMOVE'); + unset($_POST['name'][$k]); + } + $this->load('cache'); + $_ENV['cache']->updatedata(); + $this->writelog('app_delete', 'appid='.implode(',', $_POST['delete'])); + $status = 2; + + $this->_add_note_for_app(); + } + + $a = getgpc('a'); + $applist = $_ENV['app']->get_apps(); + $this->view->assign('status', $status); + $this->view->assign('a', $a); + $this->view->assign('applist', $applist); + + $this->view->display('admin_app'); + } + + function onadd() { + if(!$this->submitcheck()) { + $md5ucfounderpw = md5(UC_FOUNDERPW); + $this->view->assign('md5ucfounderpw', $md5ucfounderpw); + + $a = getgpc('a'); + $this->view->assign('a', $a); + $typelist = array('DISCUZX'=>'DiscuzX','UCHOME'=>'UCenter Home','XSPACE'=>'X-Space','DISCUZ'=>'Discuz!','SUPESITE'=>'SupeSite','SUPEV'=>'SupeV','ECSHOP'=>'ECShop','ECMALL'=>'ECMall','OTHER'=>$this->lang['other']); + $this->view->assign('typelist', $typelist); + $this->view->display('admin_app'); + } else { + $type = getgpc('type', 'P'); + $name = getgpc('name', 'P'); + $url = getgpc('url', 'P'); + $ip = getgpc('ip', 'P'); + $viewprourl = getgpc('viewprourl', 'P'); + $authkey = getgpc('authkey', 'P'); + $synlogin = getgpc('synlogin', 'P'); + $recvnote = getgpc('recvnote', 'P'); + $apifilename = trim(getgpc('apifilename', 'P')); + + $tagtemplates = array(); + $tagtemplates['template'] = getgpc('tagtemplates', 'P'); + $tagfields = explode("\n", getgpc('tagfields', 'P')); + foreach($tagfields as $field) { + $field = trim($field); + list($k, $v) = explode(',', $field); + if($k) { + $tagtemplates['fields'][$k] = $v; + } + } + $tagtemplates = $this->serialize($tagtemplates, 1); + + if(!$_ENV['misc']->check_url($_POST['url'])) { + $this->message('app_add_url_invalid', 'BACK'); + } + if(!empty($_POST['ip']) && !$_ENV['misc']->check_ip($_POST['ip'])) { + $this->message('app_add_ip_invalid', 'BACK'); + } + $app = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."applications WHERE name='$name'"); + if($app) { + $this->message('app_add_name_invalid', 'BACK'); + } else { + $extra = serialize(array('apppath'=> getgpc('apppath', 'P'))); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."applications SET name='$name', url='$url', ip='$ip', + viewprourl='$viewprourl', apifilename='$apifilename', authkey='$authkey', synlogin='$synlogin', + type='$type', recvnote='$recvnote', extra='$extra', + tagtemplates='$tagtemplates'"); + $appid = $this->db->insert_id(); + } + + $this->_add_note_for_app(); + + $this->load('cache'); + $_ENV['cache']->updatedata('apps'); + + $_ENV['app']->alter_app_table($appid, 'ADD'); + $this->writelog('app_add', "appid=$appid; appname={$_POST['name']}"); + header("location: ". UC_ADMINSCRIPT . "?m=app&a=detail&appid=$appid&addapp=yes&sid=".$this->view->sid); + } + } + + function onping() { + $ip = getgpc('ip'); + $url = getgpc('url'); + $appid = intval(getgpc('appid')); + $app = $_ENV['app']->get_app_by_appid($appid); + $status = ''; + if(!empty($app['extra']['apppath']) && $this->detectescape($app['extra']['apppath'].'./api/', $app['apifilename']) && substr(strrchr($app['apifilename'], '.'), 1, 10) == 'php' && @include $app['extra']['apppath'].'./api/'.$app['apifilename']) { + $uc_note = new uc_note(); + $status = $uc_note->test($note['getdata'], $note['postdata']); + } else { + $this->load('note'); + $url = $_ENV['note']->get_url_code('test', '', $appid); + $status = $_ENV['app']->test_api($url, $ip); + } + header("Content-Type: application/javascript"); + if($status == '1') { + echo 'document.getElementById(\'status_'.$appid.'\').innerHTML = "'.$this->lang['app_connect_ok'].'";testlink();'; + } else { + echo 'document.getElementById(\'status_'.$appid.'\').innerHTML = "'.$this->lang['app_connect_false'].'";testlink();'; + } + + } + + function ongeneratekey() { + $newkey = $this->generate_key(64); + header("Content-Type: application/javascript"); + echo 'document.getElementsByName("authkey")[0].value = "'.$newkey.'";'; + } + + function ondetail() { + $appid = getgpc('appid'); + $updated = false; + $app = $_ENV['app']->get_app_by_appid($appid); + if($this->submitcheck()) { + $type = getgpc('type', 'P'); + $name = getgpc('name', 'P'); + $url = getgpc('url', 'P'); + $ip = getgpc('ip', 'P'); + $viewprourl = getgpc('viewprourl', 'P'); + $apifilename = trim(getgpc('apifilename', 'P')); + $authkey = getgpc('authkey', 'P'); + $synlogin = getgpc('synlogin', 'P'); + $recvnote = getgpc('recvnote', 'P'); + $extraurl = getgpc('extraurl', 'P'); + if(getgpc('apppath', 'P')) { + $app['extra']['apppath'] = $this->_realpath(getgpc('apppath', 'P')); + if(!empty($app['extra']['apppath'])) { + $apifile = $app['extra']['apppath'].'./api/uc.php'; + if(!file_exists($apifile)) { + $this->message('app_apifile_not_exists', 'BACK', 0, array('$apifile' => $apifile)); + } + $s = file_get_contents($apifile); + preg_match("/define\(\'UC_CLIENT_VERSION\'\, \'([^\']+?)\'\)/i", $s, $m); + $uc_client_version = @$m[1]; + + if(!$uc_client_version || $uc_client_version <= '1.0.0') { + $this->message('app_apifile_too_low', 'BACK', 0, array('$apifile' => $apifile)); + } + } else { + $this->message('app_path_not_exists'); + } + } else { + $app['extra']['apppath'] = ''; + } + $app['extra']['extraurl'] = array(); + if($extraurl) { + foreach(explode("\n", $extraurl) as $val) { + if(!$val = trim($val)) continue; + $app['extra']['extraurl'][] = $val; + } + } + $tagtemplates = array(); + $tagtemplates['template'] = getgpc('tagtemplates', 'P'); + $tagfields = explode("\n", getgpc('tagfields', 'P')); + foreach($tagfields as $field) { + $field = trim($field); + list($k, $v) = explode(',', $field); + if($k) { + $tagtemplates['fields'][$k] = $v; + } + } + $tagtemplates = $this->serialize($tagtemplates, 1); + + $extra = addslashes(serialize($app['extra'])); + $this->db->query("UPDATE ".UC_DBTABLEPRE."applications SET appid='$appid', name='$name', url='$url', + type='$type', ip='$ip', viewprourl='$viewprourl', apifilename='$apifilename', authkey='$authkey', + synlogin='$synlogin', recvnote='$recvnote', extra='$extra', + tagtemplates='$tagtemplates' + WHERE appid='$appid'"); + $updated = true; + $this->load('cache'); + $_ENV['cache']->updatedata('apps'); + $this->cache('settings'); + $this->writelog('app_edit', "appid=$appid"); + + $this->_add_note_for_app(); + $app = $_ENV['app']->get_app_by_appid($appid); + } + $tagtemplates = $this->unserialize($app['tagtemplates']); + $tagtemplates = is_array($tagtemplates) ? $tagtemplates : array(); + $template = dhtmlspecialchars($tagtemplates['template']); + $tmp = ''; + if(is_array($tagtemplates['fields'])) { + foreach($tagtemplates['fields'] as $field => $memo) { + $tmp .= $field.','.$memo."\n"; + } + } + if(!empty($tmp)) { + $tagtemplates['fields'] = $tmp; + } + $a = getgpc('a'); + $this->view->assign('a', $a); + $app = $_ENV['app']->get_app_by_appid($appid); + $this->view->assign('isfounder', $this->user['isfounder']); + $this->view->assign('appid', $app['appid']); + $this->view->assign('allowips', $app['allowips']); + $this->view->assign('name', $app['name']); + $this->view->assign('url', $app['url']); + $this->view->assign('ip', $app['ip']); + $this->view->assign('viewprourl', $app['viewprourl']); + $this->view->assign('apifilename', $app['apifilename']); + $this->view->assign('authkey', $app['authkey']); + $synloginchecked = array($app['synlogin'] => 'checked="checked"'); + $recvnotechecked = array($app['recvnote'] => 'checked="checked"'); + $this->view->assign('synlogin', $synloginchecked); + $this->view->assign('charset', $app['charset']); + $this->view->assign('dbcharset', $app['dbcharset']); + $this->view->assign('type', $app['type']); + $this->view->assign('recvnotechecked', $recvnotechecked); + $typelist = array('DISCUZX'=>'DiscuzX','UCHOME'=>'UCenter Home','XSPACE'=>'X-Space','DISCUZ'=>'Discuz!','SUPESITE'=>'SupeSite','SUPEV'=>'SupeV','ECSHOP'=>'ECShop','ECMALL'=>'ECMall','OTHER'=>$this->lang['other']); + $this->view->assign('typelist', $typelist); + $this->view->assign('updated', $updated); + $addapp = getgpc('addapp'); + $this->view->assign('addapp', $addapp); + $this->view->assign('extraurl', is_array($app['extra']['extraurl']) ? implode("\n", $app['extra']['extraurl']) : (string)$app['extra']['extraurl']); + $this->view->assign('apppath', $app['extra']['apppath']); + $this->view->assign('tagtemplates', $tagtemplates); + $this->view->display('admin_app'); + } + + function _add_note_for_app() { + $this->load('note'); + $notedata = $this->db->fetch_all("SELECT appid, type, name, url, ip, viewprourl, apifilename, charset, synlogin, extra, recvnote FROM ".UC_DBTABLEPRE."applications"); + $notedata = $this->_format_notedata($notedata); + $notedata['UC_API'] = UC_API; + $_ENV['note']->add('updateapps', '', $this->serialize($notedata, 1)); + $_ENV['note']->send(); + } + + function _format_notedata($notedata) { + $arr = array(); + foreach($notedata as $key => $note) { + $note['extra'] = unserialize($note['extra']); + $arr[$note['appid']] = $note; + } + return $arr; + } + + function _realpath($path) { + return realpath($path).'/'; + } +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/badword.php b/uc_server/control/admin/badword.php new file mode 100644 index 0000000..904e16c --- /dev/null +++ b/uc_server/control/admin/badword.php @@ -0,0 +1,102 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadminbadword']) { + $this->message('no_permission_for_this_module'); + } + $this->load('badword'); + } + + function onls() { + $page = getgpc('page'); + $find = getgpc('find', 'P'); + $replacement = getgpc('replacement', 'P'); + $replacementnew = getgpc('replacementnew', 'P'); + $findnew = getgpc('findnew', 'P'); + $delete = getgpc('delete', 'P'); + $adminscript = UC_ADMINSCRIPT; + if($find) { + foreach($find as $id => $arr) { + $_ENV['badword']->update_badword($find[$id], $replacement[$id], $id); + } + } + $status = 0; + if($findnew) { + $_ENV['badword']->add_badword($findnew, $replacementnew, $this->user['username']); + $status = 1; + $this->writelog('badword_add', 'findnew='.dhtmlspecialchars($findnew).'&replacementnew='.dhtmlspecialchars($replacementnew)); + } + if(@$delete) { + + $_ENV['badword']->delete_badword($delete); + $status = 2; + $this->writelog('badword_delete', "delete=".implode(',', $delete)); + } + if(getgpc('multisubmit', 'P')) { + $badwords = getgpc('badwords', 'P'); + $type = getgpc('type', 'P'); + if($type == 0) { + $_ENV['badword']->truncate_badword(); + $type = 1; + } + $arr = explode("\n", str_replace(array("\r", "\n\n"), array("\r", "\n"), $badwords)); + foreach($arr as $k => $v) { + $arr2 = explode("=", $v); + $_ENV['badword']->add_badword($arr2[0], $arr2[1], $this->user['username'], $type); + } + } + if($status > 0) { + $notedata = $_ENV['badword']->get_list($page, 1000000, 1000000); + $this->load('note'); + $_ENV['note']->add('updatebadwords', '', $this->serialize($notedata, 1)); + $_ENV['note']->send(); + + $this->load('cache'); + $_ENV['cache']->updatedata('badwords'); + } + $num = $_ENV['badword']->get_total_num(); + $badwordlist = $_ENV['badword']->get_list($page, UC_PPP, $num); + $multipage = $this->page($num, UC_PPP, $page, UC_ADMINSCRIPT.'?m=badword&a=ls'); + + $this->view->assign('status', $status); + $this->view->assign('badwordlist', $badwordlist); + $this->view->assign('multipage', $multipage); + + $this->view->display('admin_badword'); + + } + + function onexport() { + $data = $_ENV['badword']->get_list(1, 1000000, 1000000); + $s = ''; + if($data) { + foreach($data as $v) { + $s .= $v['find'].'='.$v['replacement']."\r\n"; + } + } + @header('Content-Disposition: inline; filename=CensorWords.txt'); + @header("Content-Type: text/plain"); + echo $s; + + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/cache.php b/uc_server/control/admin/cache.php new file mode 100644 index 0000000..0255b96 --- /dev/null +++ b/uc_server/control/admin/cache.php @@ -0,0 +1,44 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadmincache']) { + $this->message('no_permission_for_this_module'); + } + $this->load('cache'); + } + + function onupdate() { + $updated = false; + if($this->submitcheck('submit')) { + $type = getgpc('type', 'P'); + if(!is_array($type) || in_array('data', $type)) { + $_ENV['cache']->updatedata(); + } + if(!is_array($type) || in_array('tpl', $type)) { + $_ENV['cache']->updatetpl(); + } + $updated = true; + } + $this->view->assign('updated', $updated); + $this->view->display('admin_cache'); + } +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/credit.php b/uc_server/control/admin/credit.php new file mode 100644 index 0000000..35e8f9c --- /dev/null +++ b/uc_server/control/admin/credit.php @@ -0,0 +1,212 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadmincredits']) { + $this->message('no_permission_for_this_module'); + } + } + + function onls() { + $appsrc = getgpc('appsrc', 'P'); + $creditsrc = getgpc('creditsrc', 'P'); + $appdesc = getgpc('appdesc', 'P'); + $creditdesc = getgpc('creditdesc', 'P'); + $ratiosrc = getgpc('ratiosrc', 'P'); + $ratiodesc = getgpc('ratiodesc', 'P'); + $delete = getgpc('delete', 'P'); + $addexchange = getgpc('addexchange', 'G'); + $delexchange = getgpc('delexchange', 'G'); + $settings = $this->get_setting(array('creditexchange'), TRUE); + $creditexchange = (isset($settings['creditexchange']) && is_array($settings['creditexchange'])) ? $settings['creditexchange'] : array(); + $appsrc = @intval($appsrc); + $creditsrc = @intval($creditsrc); + $appdesc = @intval($appdesc); + $creditdesc = @intval($creditdesc); + $ratiosrc = ($ratiosrc = @intval($ratiosrc)) > 0 ? $ratiosrc : 1; + $ratiodesc = ($ratiodesc = @intval($ratiodesc)) > 0 ? $ratiodesc : 1; + $status = 0; + if(!empty($addexchange) && $this->submitcheck()) { + if($appsrc != $appdesc) { + $key = $appsrc.'_'.$creditsrc.'_'.$appdesc.'_'.$creditdesc; + $creditexchange[$key] = $ratiosrc."\t".$ratiodesc; + $this->set_setting('creditexchange', $creditexchange, TRUE); + $this->load('cache'); + $_ENV['cache']->updatedata('settings'); + $status = 1; + $this->writelog('credit_addexchange', $appsrc.'_'.$creditsrc.' : '.$appdesc.'_'.$creditdesc.'='.$ratiosrc.' : '.$ratiodesc); + } else { + $status = -1; + } + $settings = $this->get_setting(array('creditexchange'), TRUE); + $creditexchange = is_array($settings['creditexchange']) ? $settings['creditexchange'] : array(); + } elseif(!empty($delexchange) && $this->submitcheck()) { + if(is_array($delete)) { + foreach($delete as $key) { + unset($creditexchange[$key]); + } + $this->set_setting('creditexchange', $creditexchange, TRUE); + $this->load('cache'); + $_ENV['cache']->updatedata('settings'); + $status = 1; + $this->writelog('credit_deleteexchange', "delete=".implode(',', $delete)); + } + $settings = $this->get_setting(array('creditexchange'), TRUE); + $creditexchange = is_array($settings['creditexchange']) ? $settings['creditexchange'] : array(); + } + + $apps = isset($this->settings['credits']) ? unserialize($this->settings['credits']) : ''; + if(is_array($creditexchange)) { + foreach($creditexchange as $set => $ratio) { + $tmp = array(); + list($tmp['appsrc'], $tmp['creditsrc'], $tmp['appdesc'], $tmp['creditdesc']) = explode('_', $set); + list($tmp['ratiosrc'], $tmp['ratiodesc']) = explode("\t", $ratio); + $tmp['creditsrc'] = $apps[$tmp['appsrc']][$tmp['creditsrc']][0]; + $tmp['creditdesc'] = $apps[$tmp['appdesc']][$tmp['creditdesc']][0]; + $tmp['appsrc'] = $this->cache['apps'][$tmp['appsrc']]['name']; + $tmp['appdesc'] = $this->cache['apps'][$tmp['appdesc']]['name']; + $creditexchange[$set] = $tmp; + } + } + + $appselect = ''; + $creditselect = array(); + if(is_array($apps)) { + foreach($apps as $appid => $credits) { + $appselect .= ''; + $tmp = array(); + if(is_array($credits)) { + foreach($credits as $id => $credit) { + $tmp[] = '['.$id.', \''.str_replace('\'', '\\\'', $credit[0]).'\']'; + } + } + $creditselect[$appid] = 'credit['.$appid.'] = ['.implode(',', $tmp).'];'; + } + } + + $this->view->assign('status', $status); + $this->view->assign('appsrc', $appsrc); + $this->view->assign('creditsrc', $creditsrc); + $this->view->assign('appdesc', $appdesc); + $this->view->assign('creditdesc', $creditdesc); + $this->view->assign('ratiosrc', $ratiosrc); + $this->view->assign('ratiodesc', $ratiodesc); + $this->view->assign('appselect', $appselect); + $this->view->assign('creditselect', $creditselect); + $this->view->assign('creditexchange', $creditexchange); + + $this->view->display('admin_credit'); + } + + function onsync() { + $this->load('note'); + $this->load('misc'); + $this->load('cache'); + $step = intval(getgpc('step', 'G')); + if(!$step && is_array($this->cache['apps'])) { + $credits = array(); + $stepapp = intval(getgpc('stepapp', 'G')); + $testrelease = intval(getgpc('testrelease', 'G')); + $appids = array_keys($this->cache['apps']); + $appid = $appids[$stepapp]; + if(!$stepapp) { + $_CACHE['credits'] = array(); + } else { + include UC_DATADIR.'cache/credits.php'; + } + if($app = $this->cache['apps'][$appid]) { + $url = $_ENV['note']->get_url_code('getcreditsettings', '', $appid); + $data = trim($_ENV['misc']->dfopen($url, 0, '', '', 1)); + if(!$testrelease) { + if(!($data = $this->sync_unserialize($data, ''))) { + header('location: '.UC_API.'/'.UC_ADMINSCRIPT.'?m=credit&a=sync&step=0&stepapp='.$stepapp.'&testrelease=1&sid='.$this->view->sid); + exit(); + } else { + $stepapp++; + } + } else { + $data = $this->sync_unserialize($data, 'release/20080429/'); + $stepapp++; + } + + if($data) { + $_CACHE['credits'][$appid] = $data; + $s = ""; + file_put_contents(UC_DATADIR.'cache/credits.php', $s, LOCK_EX); + } + header('location: '.UC_API.'/'.UC_ADMINSCRIPT.'?m=credit&a=sync&step=0&stepapp='.$stepapp.'&sid='.$this->view->sid); + } else { + header('location: '.UC_API.'/'.UC_ADMINSCRIPT.'?m=credit&a=sync&step=1&sid='.$this->view->sid); + } + exit(); + } + + include_once UC_DATADIR.'cache/credits.php'; + $credits = $_CACHE['credits']; + $this->set_setting('credits', $credits, TRUE); + $this->load('cache'); + $_ENV['cache']->updatedata('settings'); + $this->writelog('credit_sync', 'succeed'); + + $settings = $this->get_setting(array('creditexchange'), TRUE); + $creditexchange = is_array($settings['creditexchange']) ? $settings['creditexchange'] : array(); + $updaterequest = array(); + $i = 0; + foreach($creditexchange as $set => $ratio) { + $tmp = array(); + list($tmp['appsrc'], $tmp['creditsrc'], $tmp['appdesc'], $tmp['creditdesc']) = explode('_', $set); + list($tmp['ratiosrc'], $tmp['ratiodesc']) = explode("\t", $ratio); + $updaterequest[$tmp['appsrc']][] = + '&credit['.$tmp['appsrc'].']['.$i.'][creditsrc]='.intval($tmp['creditsrc']). + '&credit['.$tmp['appsrc'].']['.$i.'][appiddesc]='.urlencode($tmp['appdesc']). + '&credit['.$tmp['appsrc'].']['.$i.'][creditdesc]='.intval($tmp['creditdesc']). + '&credit['.$tmp['appsrc'].']['.$i.'][title]='.urlencode($this->cache['apps'][$tmp['appdesc']]['name'].' '.$credits[$tmp['appdesc']][$tmp['creditdesc']][0]). + '&credit['.$tmp['appsrc'].']['.$i.'][unit]='.urlencode($credits[$tmp['appdesc']][$tmp['creditdesc']][1]). + '&credit['.$tmp['appsrc'].']['.$i.'][ratiosrc]='.$tmp['ratiosrc']. + '&credit['.$tmp['appsrc'].']['.$i.'][ratiodesc]='.$tmp['ratiodesc']. + '&credit['.$tmp['appsrc'].']['.$i.'][ratio]='.($tmp['ratiosrc'] / $tmp['ratiodesc']); + $i++; + } + $data = array(); + foreach($updaterequest as $appid => $value) { + $data[] = implode('', $updaterequest[$appid]); + } + $_ENV['note']->add('updatecreditsettings', implode('', $data)); + $_ENV['note']->send(); + + $this->message('syncappcredits_updated',UC_ADMINSCRIPT.'?m=credit&a=ls'); + } + + function sync_unserialize($s, $release_root) { + if(!function_exists('xml_unserialize')) { + if($release_root && file_exists(UC_ROOT.$release_root.'./lib/xml.class.php')) { + include UC_ROOT.$release_root.'./lib/xml.class.php'; + } else { + include UC_ROOT.'./lib/xml.class.php'; + } + } + + return xml_unserialize($s); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/db.php b/uc_server/control/admin/db.php new file mode 100644 index 0000000..5299171 --- /dev/null +++ b/uc_server/control/admin/db.php @@ -0,0 +1,326 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadmindb']) { + $this->message('no_permission_for_this_module'); + } + $this->check_priv(); + $this->load('misc'); + } + + function onls() { + $status = 0; + $operate = getgpc('o'); + if($operate == 'list') { + if($delete = (isset($_POST['delete']) ? $_POST['delete'] : array())) { + if(is_array($delete)) { + foreach($delete AS $filename) { + @unlink('./data/backup/'.str_replace(array('/', '\\'), '', $filename)); + } + } + $status = 2; + $this->writelog('db_delete', "delete=".implode(',', $delete)); + } + + $baklist = array(); + if(is_dir(UC_ROOT.'./data/backup/')) { + $dir = dir(UC_ROOT.'./data/backup/'); + while($entry = $dir->read()) { + $file = './data/backup/'.$entry; + if(is_dir($file) && preg_match("/backup_(\d+)_\w+/i", $file, $match)) { + $baklist[] = array('name' => $match[0], 'date' => $match[1]); + } + } + $dir->close(); + } else { + cpmsg('db_export_dest_invalid'); + } + $this->view->assign('baklist', $baklist); + } elseif($operate == 'view') { + $dir = getgpc('dir'); + $this->load('app'); + $applist = $_ENV['app']->get_apps(); + $this->view->assign('applist', $applist); + $this->view->assign('dir', $dir); + } elseif($operate == 'ping') { + $appid = intval(getgpc('appid')); + $app = $this->cache['apps'][$appid]; + $dir = trim(getgpc('dir')); + if($app['type'] == 'DISCUZX') { + $url = $app['url'].'/api/db/dbbak.php?apptype='.$app['type']; + } else { + $url = $app['url'].'/api/dbbak.php?apptype='.$app['type']; + } + $code = $this->authcode('&method=ping&dir='.$dir.'&time='.time(), 'ENCODE', $app['authkey']); + $url .= '&code='.urlencode($code); + $res = $_ENV['misc']->dfopen2($url, 0, '', '', 1, $app['ip'], 20, TRUE); + if($res == '1') { + $this->message($this->_parent_js($appid, ''.$this->lang['dumpfile_exists'].'').''); + } else { + $this->message($this->_parent_js($appid, ''.$this->lang['dumpfile_not_exists'].'').''); + } + exit; + } else { + $this->load('app'); + $applist = $_ENV['app']->get_apps(); + $this->view->assign('applist', $applist); + $this->view->assign('dir', 'backup_'.date('ymd', time()).'_'.$this->random(6)); + } + $this->view->assign('operate', $operate); + $this->view->display('admin_db'); + } + + function onoperate() { + require_once UC_ROOT.'lib/xml.class.php'; + $nexturl = getgpc('nexturl'); + $appid = intval(getgpc('appid')); + $type = getgpc('t') == 'import' ? 'import' : 'export'; + $backupdir = getgpc('backupdir'); + $app = $this->cache['apps'][$appid]; + if($nexturl) { + $url = $nexturl; + } else { + if($type == 'export' && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $content = $_ENV['misc']->dfopen2(UC_API.'/CROSSD~1.XML'); + if(strpos($content, 'cross-domain-policy') !== false) { + $this->message($this->_parent_js($appid, 'db_back_dos8p3_failed')); + } + } + if($appid) { + if(!isset($this->cache['apps'][$appid])) { + $this->message($this->_parent_js($appid, 'appid_invalid')); + } + if($app['type'] == 'DISCUZX') { + $url = $app['url'].'/api/db/dbbak.php?apptype='.$app['type']; + } else { + $url = $app['url'].'/api/dbbak.php?apptype='.$app['type']; + } + $code = $this->authcode('&method='.$type.'&sqlpath='.$backupdir.'&time='.time(), 'ENCODE', $app['authkey']); + } else { + $url = (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].str_replace(UC_ADMINSCRIPT, 'api/dbbak.php', $_SERVER['PHP_SELF']).'?apptype=UCENTER'; + $code = $this->authcode('&method='.$type.'&sqlpath='.$backupdir.'&time='.time(), 'ENCODE', UC_KEY); + } + $url .= '&code='.urlencode($code); + } + if(empty($appid)) { + $app['ip'] = defined('UC_IP') ? UC_IP : ''; + } + $res = $_ENV['misc']->dfopen2($url, 0, '', '', 1, $app['ip'], 20, TRUE); + if(empty($res)) { + $this->message($this->_parent_js($appid, 'db_back_api_url_invalid')); + } + $arr = $this->_xml2array($res); + + if(empty($arr['fileinfo'])) { + $this->message($this->_parent_js($appid, 'undefine_error')); + } elseif($arr['error']['errorcode']) { + $this->message($this->_parent_js($appid, 'dbback_error_code_'.$arr['error']['errorcode'])); + } elseif($arr['nexturl']) { + $this->message($this->_parent_js($appid, 'db_'.$type.'_multivol_redirect', array('$volume' => $arr['fileinfo']['file_num'])), UC_ADMINSCRIPT.'?m=db&a=operate&t='.$type.'&appid='.$appid.'&nexturl='.urlencode($arr['nexturl'])); + } elseif(empty($arr['nexturl'])) { + $this->message($this->_parent_js($appid, 'db_'.$type.'_multivol_succeed')); + } else { + $this->message($this->_parent_js($appid, 'undefine_error')); + } + exit; + } + + function ondelete() { + require_once UC_ROOT.'lib/xml.class.php'; + $appid = intval(getgpc('appid')); + $backupdir = getgpc('backupdir'); + $app = $this->cache['apps'][$appid]; + if(empty($appid)) { + $app['ip'] = defined('UC_IP') ? UC_IP : ''; + $url = (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].str_replace(UC_ADMINSCRIPT, 'api/dbbak.php', $_SERVER['PHP_SELF']).'?apptype=UCENTER'; + $code = $this->authcode('&method=delete&sqlpath='.$backupdir.'&time='.time(), 'ENCODE', UC_KEY); + $appname = 'UCenter'; + } else { + if(!isset($this->cache['apps'][$appid])) { + $this->message($this->_parent_js($appid, 'appid_invalid')); + } + $url = $app['url'].'/api/dbbak.php?apptype='.$app['type']; + $code = $this->authcode('&method=delete&sqlpath='.$backupdir.'&time='.time(), 'ENCODE', $app['authkey']); + $appname = $app['name']; + } + $url .= '&code='.urlencode($code); + $res = $_ENV['misc']->dfopen2($url, 0, '', '', 1, $app['ip'], 20, TRUE); + $next_appid = $this->_next_appid($appid); + if($next_appid != $appid) { + $this->message($this->_parent_js($backupdir, 'delete_dumpfile_redirect', array('$appname' => $appname)), UC_ADMINSCRIPT.'?m=db&a=delete&appid='.$next_appid.'&backupdir='.$backupdir.'&sid='.$this->sid); + } else { + $this->message($this->_parent_js($backupdir, 'delete_dumpfile_success')); + } + } + + function _next_appid($appid) { + $last_appid = 0; + foreach($this->cache['apps'] as $key => $val) { + if($appid == $last_appid) { + return $key; + } + $last_appid = $key; + } + return $last_appid; + } + + function _parent_js($extid, $message, $vars = array()) { + include UC_ROOT.'view/default/messages.lang.php'; + if(isset($lang[$message])) { + $message = $lang[$message] ? str_replace(array_keys($vars), array_values($vars), $lang[$message]) : $message; + } + return ''; + } + + function _xml2array($xml) { + $arr = xml_unserialize($xml, 1); + preg_match('//', $xml, $match); + $arr['error'] = array('errorcode' => $match[1], 'errormessage' => $match[2]); + return $arr; + } + + function sqldumptable($table, $startfrom = 0, $currsize = 0) { + $offset = 300; + $tabledump = ''; + $usehex = TRUE; + $tablefields = array(); + + $query = $this->db->query("SHOW FULL COLUMNS FROM $table", 'SILENT'); + if(!$query && $this->db->errno() == 1146) { + return; + } elseif(!$query) { + $usehex = FALSE; + } else { + while($fieldrow = $this->db->fetch_array($query)) { + $tablefields[] = $fieldrow; + } + } + if(!$startfrom) { + $createtable = $this->db->query("SHOW CREATE TABLE $table", 'SILENT'); + if(!$this->db->error()) { + $tabledump = "DROP TABLE IF EXISTS $table;\n"; + } else { + return ''; + } + $create = $this->db->fetch_row($createtable); + $tabledump .= $create[1]; + + $tablestatus = $this->db->fetch_first("SHOW TABLE STATUS LIKE '$table'"); + $tabledump .= ($tablestatus['Auto_increment'] && strpos($create[1], 'AUTO_INCREMENT') === FALSE ? " AUTO_INCREMENT={$tablestatus['Auto_increment']}" : '').";\n\n"; + } + + $tabledumped = 0; + $numrows = $offset; + $firstfield = $tablefields[0]; + + while($currsize + strlen($tabledump) + 500 < $this->sizelimit * 1000 && $numrows == $offset) { + if($firstfield['Extra'] == 'auto_increment') { + $selectsql = "SELECT * FROM $table WHERE {$firstfield['Field']} > $startfrom LIMIT $offset"; + } else { + $selectsql = "SELECT * FROM $table LIMIT $startfrom, $offset"; + } + $tabledumped = 1; + $rows = $this->db->query($selectsql); + $numfields = $this->db->num_fields($rows); + + $numrows = $this->db->num_rows($rows); + while($row = $this->db->fetch_row($rows)) { + $comma = $t = ''; + for($i = 0; $i < $numfields; $i++) { + $t .= $comma.($usehex && !empty($row[$i]) && (strpos($tablefields[$i]['Type'], 'char') !== FALSE || strpos($tablefields[$i]['Type'], 'text') !== FALSE) ? '0x'.bin2hex($row[$i]) : '\''.$this->db->escape_string($row[$i]).'\''); + $comma = ','; + } + if(strlen($t) + $currsize + strlen($tabledump) + 500 < $this->sizelimit * 1000) { + if($firstfield['Extra'] == 'auto_increment') { + $startfrom = $row[0]; + } else { + $startfrom++; + } + $tabledump .= "INSERT INTO $table VALUES ($t);\n"; + } else { + $this->complete = FALSE; + break 2; + } + } + } + + $this->startrow = $startfrom; + $tabledump .= "\n"; + + return $tabledump; + } + + function splitsql($sql) { + $sql = str_replace("\r", "\n", $sql); + $ret = array(); + $num = 0; + $queriesarray = explode(";\n", trim($sql)); + unset($sql); + foreach($queriesarray as $query) { + $queries = explode("\n", trim($query)); + foreach($queries as $query) { + $ret[$num] .= $query[0] == "#" ? NULL : $query; + } + $num++; + } + return($ret); + } + + function syntablestruct($sql, $version, $dbcharset) { + + if(strpos(trim(substr($sql, 0, 18)), 'CREATE TABLE') === FALSE) { + return $sql; + } + + $sqlversion = strpos($sql, 'ENGINE=') === FALSE ? FALSE : TRUE; + + if($sqlversion === $version) { + + return $sqlversion && $dbcharset ? preg_replace(array('/ character set \w+/i', '/ collate \w+/i', "/DEFAULT CHARSET=\w+/is"), array('', '', "DEFAULT CHARSET=$dbcharset"), $sql) : $sql; + } + + if($version) { + return preg_replace(array('/TYPE=HEAP/i', '/TYPE=(\w+)/is'), array("ENGINE=MEMORY DEFAULT CHARSET=$dbcharset", "ENGINE=\\1 DEFAULT CHARSET=$dbcharset"), $sql); + + } else { + return preg_replace(array('/character set \w+/i', '/collate \w+/i', '/ENGINE=MEMORY/i', '/\s*DEFAULT CHARSET=\w+/is', '/\s*COLLATE=\w+/is', '/ENGINE=(\w+)(.*)/is'), array('', '', 'ENGINE=HEAP', '', '', 'TYPE=\\1\\2'), $sql); + } + } + + function sizecount($filesize) { + if($filesize >= 1073741824) { + $filesize = round($filesize / 1073741824 * 100) / 100 . ' GB'; + } elseif($filesize >= 1048576) { + $filesize = round($filesize / 1048576 * 100) / 100 . ' MB'; + } elseif($filesize >= 1024) { + $filesize = round($filesize / 1024 * 100) / 100 . ' KB'; + } else { + $filesize = $filesize . ' Bytes'; + } + return $filesize; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/domain.php b/uc_server/control/admin/domain.php new file mode 100644 index 0000000..2390d7d --- /dev/null +++ b/uc_server/control/admin/domain.php @@ -0,0 +1,73 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadmindomain']) { + $this->message('no_permission_for_this_module'); + } + $this->load('domain'); + $this->load('misc'); + $this->check_priv(); + } + + function onls() { + $status = 0; + if(@$_POST['domainnew']) { + if(!$_ENV['misc']->check_ip($_POST['ipnew'])) { + $this->message('app_add_ip_invalid', 'BACK'); + } + $_ENV['domain']->add_domain($_POST['domainnew'], $_POST['ipnew']); + $status = 1; + $this->writelog('domain_add', 'domainnew='.dhtmlspecialchars($_POST['domainnew']).'&ipnew='.dhtmlspecialchars($_POST['ipnew'])); + } + if(@$_POST['domain']) { + foreach($_POST['domain'] as $id => $arr) { + if(!$_ENV['misc']->check_ip($_POST['ip'][$id])) { + $this->message('app_add_ip_invalid', 'BACK'); + } + $_ENV['domain']->update_domain($_POST['domain'][$id], $_POST['ip'][$id], $id); + } + $status = 2; + } + if(@$_POST['delete']) { + $_ENV['domain']->delete_domain($_POST['delete']); + $status = 2; + $this->writelog('domain_delete', "delete=".implode(',', $_POST['delete'])); + } + if($status > 0) { + $notedata = $_ENV['domain']->get_list($_GET['page'], 1000000, 1000000); + $this->load('note'); + $_ENV['note']->add('updatehosts', '', $this->serialize($notedata)); + $_ENV['note']->send(); + } + $num = $_ENV['domain']->get_total_num(); + $domainlist = $_ENV['domain']->get_list($_GET['page'], UC_PPP, $num); + $multipage = $this->page($num, UC_PPP, $_GET['page'], UC_ADMINSCRIPT.'?m=domain&a=ls'); + + $this->view->assign('status', $status); + $this->view->assign('domainlist', $domainlist); + $this->view->assign('multipage', $multipage); + + $this->view->display('admin_domain'); + + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/feed.php b/uc_server/control/admin/feed.php new file mode 100644 index 0000000..9ebc11f --- /dev/null +++ b/uc_server/control/admin/feed.php @@ -0,0 +1,47 @@ +control(); + } + + function control() { + parent::__construct(); + if(!$this->user['isfounder'] && !$this->user['allowadminnote']) { + $this->message('no_permission_for_this_module'); + } + $this->load('feed'); + $this->load('misc'); + $this->apps = $this->cache['apps']; + $this->check_priv(); + } + + function onls() { + $page = getgpc('page'); + $delete = getgpc('delete', 'P'); + $num = $_ENV['feed']->get_total_num(); + $feedlist = $_ENV['feed']->get_list($page, UC_PPP, $num); + $multipage = $this->page($num, UC_PPP, $page, UC_ADMINSCRIPT.'?m=feed&a=ls'); + + $this->view->assign('feedlist', $feedlist); + $this->view->assign('multipage', $multipage); + + $this->view->display('admin_feed'); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/frame.php b/uc_server/control/admin/frame.php new file mode 100644 index 0000000..774a014 --- /dev/null +++ b/uc_server/control/admin/frame.php @@ -0,0 +1,218 @@ +control(); + } + + function control() { + parent::__construct(); + } + + function onindex() { + $this->view->assign('sid', $this->view->sid); + $mainurl = getgpc('mainurl'); + $mainurl = !empty($mainurl) && preg_match("/^".UC_ADMINSCRIPT."\.php\?(&*\w+=\w+)*$/i", $mainurl) ? $mainurl : UC_ADMINSCRIPT.'?m=frame&a=main&sid='.$this->view->sid; + $this->view->assign('mainurl', $mainurl); + $this->view->display('admin_frame_index'); + } + + function onmain() { + $ucinfo = ''; + $this->view->assign('ucinfo', $ucinfo); + + $members = $this->_get_uc_members(); + $applist = $this->_get_uc_apps(); + $notes = $this->_get_uc_notes(); + $errornotes = $this->_get_uc_errornotes($applist); + $pms = $this->_get_uc_pms(); + $apps = count($applist); + $friends = $this->_get_uc_friends(); + $this->view->assign('members', $members); + $this->view->assign('applist', $applist); + $this->view->assign('apps', $apps); + $this->view->assign('friends', $friends); + $this->view->assign('notes', $notes); + $this->view->assign('errornotes', $errornotes); + $this->view->assign('pms', $pms); + $this->view->assign('iframe', getgpc('iframe', 'G')); + + if(@file_exists(constant('UC_ROOT').'./install/index.php') && !constant('UC_DEBUG')) { + @unlink(constant('UC_ROOT').'./install/index.php'); + if(@file_exists(constant('UC_ROOT').'./install/index.php')) { + exit('Please delete ./install/index.php via FTP!'); + } + } + + $serverinfo = PHP_OS.' / PHP v'.PHP_VERSION; + $dbversion = $this->db->version(); + $servername = $_SERVER['SERVER_NAME']; + if(isset($_SERVER['SERVER_ADDR']) && isset($_SERVER['SERVER_PORT'])) { + $servername .= ' ('.$_SERVER['SERVER_ADDR'].':'.$_SERVER['SERVER_PORT'].')'; + } + $fileupload = @ini_get('file_uploads') ? (min(min(ini_get('upload_max_filesize'), ini_get('post_max_size')), ini_get('memory_limit'))) : ''.$lang['no'].''; + $dbsize = 0; + $tablepre = UC_DBTABLEPRE; + $query = $tables = $this->db->fetch_all("SHOW TABLE STATUS LIKE '$tablepre%'"); + foreach($tables as $table) { + $dbsize += $table['Data_length'] + $table['Index_length']; + } + $dbsize = $dbsize ? $this->_sizecount($dbsize) : $lang['unknown']; + $allow_url_fopen = ini_get('allow_url_fopen') ? 'On' : 'Off'; + $envstatus = $this->_get_uc_envstatus(); + $this->view->assign('serverinfo', $serverinfo); + $this->view->assign('fileupload', $fileupload); + $this->view->assign('dbsize', $dbsize); + $this->view->assign('dbversion', $dbversion); + $this->view->assign('servername', $servername); + $this->view->assign('allow_url_fopen', $allow_url_fopen); + $this->view->assign('envstatus', $envstatus); + + $this->view->display('admin_frame_main'); + } + + function onmenu() { + $this->view->display('admin_frame_menu'); + } + + function onheader() { + $this->load('app'); + $applist = $_ENV['app']->get_apps(); + $cparray = array( + 'UCHOME' => 'admincp.php', + 'DISCUZ' => 'admincp.php', + 'SUPESITE' => 'admincp.php', + 'XSPACE' => 'admincp.php', + 'SUPEV' => 'admincp.php', + 'ECSHOP' => 'admin/index.php', + 'ECMALL' => 'admin.php', + 'DISCUZX' => 'admin.php' + ); + $admincp = ''; + if(is_array($applist)) { + foreach($applist AS $k => $app) { + if(isset($cparray[$app['type']])) { + $admincp .= '
                                  • '.$app['name'].'
                                  • '; + } + } + } + $this->view->assign('admincp', $admincp); + $this->view->assign('username', $this->user['username']); + $this->view->display('admin_frame_header'); + } + + function _get_uc_members() { + if(!$this->members) { + $this->members = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."members"); + } + return $this->members; + } + + function _get_uc_friends() { + $friends = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."friends"); + return $friends; + } + + function _get_uc_apps() { + if(!$this->apps) { + $this->apps = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."applications"); + } + return $this->apps; + } + function _get_uc_pms() { + $pms = 0; + for($i = 0; $i < 10; $i++) { + $pms += $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_messages_".(string)$i); + } + return $pms; + } + + function _get_uc_notes() { + $notes = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."notelist WHERE closed='0'"); + return $notes; + } + + function _get_uc_errornotes($applist) { + $notelist = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."notelist ORDER BY dateline DESC LIMIT 20"); + $error = array(); + foreach($notelist as $note) { + foreach($applist as $k => $app) { + if($note['app'.$app['appid']] < 0) { + $error[$k]++; + } + } + } + return $error; + } + + function _sizecount($filesize) { + if($filesize >= 1073741824) { + $filesize = round($filesize / 1073741824 * 100) / 100 . ' GB'; + } elseif($filesize >= 1048576) { + $filesize = round($filesize / 1048576 * 100) / 100 . ' MB'; + } elseif($filesize >= 1024) { + $filesize = round($filesize / 1024 * 100) / 100 . ' KB'; + } else { + $filesize = $filesize . ' Bytes'; + } + return $filesize; + } + + function _get_uc_info() { + $update = array('uniqueid' => UC_SITEID, 'version' => UC_SERVER_VERSION, 'release' => UC_SERVER_RELEASE, 'php' => PHP_VERSION, 'mysql' => $this->db->version(), 'charset' => UC_CHARSET); + $updatetime = @filemtime(UC_ROOT.'./data/updatetime.lock'); + if(empty($updatetime) || ($this->time - $updatetime > 3600 * 4)) { + @touch(UC_ROOT.'./data/updatetime.lock'); + $update['members'] = $this->_get_uc_members(); + $update['friends'] = $this->_get_uc_friends(); + $apps = $this->_get_uc_apps(); + if($apps) { + foreach($apps as $app) { + $update['app_'.$app['appid']] = $app['name']."\t".$app['url']."\t".$app['type']; + } + } + } + + $data = ''; + foreach($update as $key => $value) { + $data .= $key.'='.rawurlencode($value).'&'; + } + + return 'update='.rawurlencode(base64_encode($data)).'&md5hash='.substr(md5($_SERVER['HTTP_USER_AGENT'].implode('', $update).$this->time), 8, 8).'×tamp='.$this->time; + } + + function _get_uc_envstatus() { + $version = constant('UC_SERVER_VERSION'); + $now_ver_gd = function_exists('gd_info')? gd_info() : false; + $now_ver = array('PHP' => constant('PHP_VERSION'), 'MySQL' => $this->db->version(), 'XML' => function_exists('xml_parser_create'), 'JSON' => function_exists('json_encode'), 'FileSock Function' => (function_exists('fsockopen') || function_exists('pfsockopen') || function_exists('stream_socket_client') || function_exists('curl_init')), 'GD' => ($now_ver_gd ? preg_replace('/[^0-9.]+/', '', $now_ver_gd['GD Version']) : false)); + $req_ver = array('PHP' => '5.6.0', 'MySQL' => '5.5.3', 'XML' => true, 'JSON' => true, 'FileSock Function' => true, 'GD' => '1.0'); + $sug_ver = array('PHP' => '7.4.0', 'MySQL' => '8.0.0', 'XML' => true, 'JSON' => true, 'FileSock Function' => true, 'GD' => '2.0'); + foreach ($now_ver as $key => $value) { + if($req_ver[$key] === true) { + if (!$value) { + return array('status' => 0, 'req' => $key, 'version' => $version); + } + } else if (version_compare($value, $req_ver[$key], '<')) { + return array('status' => 0, 'req' => $key, 'now_ver' => $value, 'sug_ver' => $sug_ver[$key], 'req_ver' => $req_ver[$key], 'version' => $version); + } + } + return array('status' => 1, 'version' => $version); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/index.htm b/uc_server/control/admin/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/control/admin/log.php b/uc_server/control/admin/log.php new file mode 100644 index 0000000..99b96ef --- /dev/null +++ b/uc_server/control/admin/log.php @@ -0,0 +1,63 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadminlog']) { + $this->message('no_permission_for_this_module'); + } + $this->check_priv(); + } + + function onls() { + $logdir = UC_ROOT.'data/logs/'; + $dir = opendir($logdir); + $logs = $loglist = array(); + while($entry = readdir($dir)) { + if(is_file($logdir.$entry) && strpos($entry, '.php') !== FALSE) { + $logs = array_merge($logs, file($logdir.$entry)); + } + } + closedir($dir); + + $logs = array_reverse($logs); + foreach($logs AS $k => $v) { + if(count($v = explode("\t", $v)) > 1) { + $v[3] = $this->date($v[3]); + $v[4] = $this->lang[$v[4]]; + $loglist[$k] = $v; + } + } + + $page = max(1, intval($_GET['page'])); + $start = ($page - 1) * UC_PPP; + + $num = count($loglist); + $multipage = $this->page($num, UC_PPP, $page, UC_ADMINSCRIPT.'?m=log&a=ls'); + $loglist = array_slice($loglist, $start, UC_PPP); + + $this->view->assign('loglist', $loglist); + $this->view->assign('multipage', $multipage); + + $this->view->display('admin_log'); + + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/mail.php b/uc_server/control/admin/mail.php new file mode 100644 index 0000000..fe56d4a --- /dev/null +++ b/uc_server/control/admin/mail.php @@ -0,0 +1,87 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + $this->load('mail'); + $this->check_priv(); + } + + function onls() { + $page = getgpc('page'); + $delete = getgpc('delete', 'P'); + $status = 0; + if(!empty($delete)) { + $_ENV['mail']->delete_mail($delete); + $status = 2; + $this->writelog('mail_delete', "delete=".implode(',', $delete)); + } + + $num = $_ENV['mail']->get_total_num(); + $maillist = $_ENV['mail']->get_list($page, UC_PPP, $num); + $multipage = $this->page($num, UC_PPP, $page, UC_ADMINSCRIPT.'?m=mail&a=ls'); + + $this->view->assign('status', $status); + $this->view->assign('maillist', $maillist); + $this->view->assign('multipage', $multipage); + + $this->view->display('admin_mail'); + } + + function onsend() { + $mailid = intval(getgpc('mailid')); + $result = $_ENV['mail']->send_by_id($mailid); + if($result) { + $this->writelog('mail_send', "appid=$appid¬eid=$noteid"); + $this->message('mail_succeed', $_SERVER['HTTP_REFERER']); + } else { + $this->writelog('mail_send', 'failed'); + $this->message('mail_false', $_SERVER['HTTP_REFERER']); + } + + } + + function _note_status($status, $appid, $noteid, $args, $operation) { + if($status > 0) { + return ''.$this->lang['note_succeed'].''; + } elseif($status == 0) { + $url = UC_ADMINSCRIPT.'?m=note&a=send&appid='.$appid.'¬eid='.$noteid; + return ''.$this->lang['note_na'].''; + } elseif($status < 0) { + $url = UC_ADMINSCRIPT.'?m=note&a=send&appid='.$appid.'¬eid='.$noteid; + return ''.$this->lang['note_false'].(-$status).$this->lang['note_times'].''; + } + } + + function _format_maillist(&$maillist) { + if(is_array($maillist)) { + foreach($maillist AS $key => $note) { + $maillist[$key]['operation'] = $this->lang['note_'.$note['operation']];//$this->operations[$note['operation']][0]; + foreach($this->apps AS $appid => $app) { + $maillist[$key]['status'][$appid] = $this->_note_status($note['app'.$appid], $appid, $note['noteid'], $note['args'], $note['operation']); + } + } + } + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/note.php b/uc_server/control/admin/note.php new file mode 100644 index 0000000..c1bef2c --- /dev/null +++ b/uc_server/control/admin/note.php @@ -0,0 +1,114 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadminnote']) { + $this->message('no_permission_for_this_module'); + } + $this->load('note'); + $this->apps = $this->cache['apps']; + + $this->operations = array( + 'test'=>array('', 'action=test'), + 'deleteuser'=>array('', 'action=deleteuser'), + 'renameuser'=>array('', 'action=renameuser'), + 'deletefriend'=>array('', 'action=deletefriend'), + 'gettag'=>array('', 'action=gettag', 'tag', 'updatedata'), + 'getcreditsettings'=>array('', 'action=getcreditsettings'), + 'updatecreditsettings'=>array('', 'action=updatecreditsettings'), + 'updateclient'=>array('', 'action=updateclient'), + 'updatepw'=>array('', 'action=updatepw'), + 'updatebadwords'=>array('', 'action=updatebadwords'), + 'updatehosts'=>array('', 'action=updatehosts'), + 'updateapps'=>array('', 'action=updateapps'), + 'updatecredit'=>array('', 'action=updatecredit'), + ); + $this->check_priv(); + } + + function onls() { + $page = getgpc('page'); + $delete = getgpc('delete', 'P'); + $status = 0; + if(!empty($delete)) { + $_ENV['note']->delete_note($delete); + $status = 2; + $this->writelog('note_delete', "delete=".implode(',', $delete)); + } + foreach($this->cache['apps'] as $key => $app) { + if(empty($app['recvnote'])) { + unset($this->apps[$key]); + } + } + $num = $_ENV['note']->get_total_num(1); + $notelist = $_ENV['note']->get_list($page, UC_PPP, $num, 1); + $multipage = $this->page($num, UC_PPP, $page, UC_ADMINSCRIPT.'?m=note&a=ls'); + + $this->view->assign('status', $status); + $this->view->assign('applist', $this->apps); + $this->_format_notlist($notelist); + $this->view->assign('notelist', $notelist); + $this->view->assign('multipage', $multipage); + + $this->view->display('admin_note'); + } + + function onsend() { + $noteid = intval(getgpc('noteid')); + $appid = intval(getgpc('appid')); + $result = $_ENV['note']->sendone($appid, $noteid); + if($result) { + $this->writelog('note_send', "appid=$appid¬eid=$noteid"); + $this->message('note_succeed', $_SERVER['HTTP_REFERER']); + } else { + $this->writelog('note_send', 'failed'); + $this->message('note_false', $_SERVER['HTTP_REFERER']); + } + + } + + function _note_status($status, $appid, $noteid, $args, $operation) { + if($status > 0) { + return ''.$this->lang['note_succeed'].''; + } elseif($status == 0) { + $url = UC_ADMINSCRIPT.'?m=note&a=send&appid='.$appid.'¬eid='.$noteid; + return ''.$this->lang['note_na'].''; + } elseif($status < 0) { + $url = UC_ADMINSCRIPT.'?m=note&a=send&appid='.$appid.'¬eid='.$noteid; + return ''.$this->lang['note_false'].(-$status).$this->lang['note_times'].''; + } + } + + function _format_notlist(&$notelist) { + if(is_array($notelist)) { + foreach($notelist AS $key => $note) { + $notelist[$key]['operation'] = $this->lang['note_'.$note['operation']];//$this->operations[$note['operation']][0]; + foreach($this->apps AS $appid => $app) { + $notelist[$key]['status'][$appid] = $this->_note_status($note['app'.$appid], $appid, $note['noteid'], '', $note['operation']); + } + } + } + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/plugin.php b/uc_server/control/admin/plugin.php new file mode 100644 index 0000000..aae2fd5 --- /dev/null +++ b/uc_server/control/admin/plugin.php @@ -0,0 +1,63 @@ +control(); + } + + function pluginbase() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder']) { + $this->message('no_permission_for_this_module'); + } + $a = getgpc('a'); + $this->load('plugin'); + $this->plugin = $_ENV['plugin']->get_plugin($a); + $this->plugins = $_ENV['plugin']->get_plugins(); + if(empty($this->plugin)) { + $this->message('read_plugin_invalid'); + } + $this->view->assign('plugin', $this->plugin); + $this->view->assign('plugins', $this->plugins); + $this->view->languages = $this->plugin['lang']; + $this->view->tpldir = UC_ROOT.'./plugin/'.$a; + $this->view->objdir = UC_DATADIR.'./view'; + } + + function _call($a, $arg) { + $do = getgpc('do'); + $do = empty($do) ? 'onindex' : 'on'.$do; + if(method_exists($this, $do) && $do[0] != '_') { + $this->$do(); + } else { + exit('Plugin module not found'); + } + } +} + +$a = getgpc('a'); +$do = getgpc('do'); +if(!preg_match("/^[\w]{1,64}$/", $a)) { + exit('Argument Invalid'); +} +if(!@require_once UC_ROOT."./plugin/$a/plugin.php") { + exit('Plugin not found'); +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/pm.php b/uc_server/control/admin/pm.php new file mode 100644 index 0000000..0f548b3 --- /dev/null +++ b/uc_server/control/admin/pm.php @@ -0,0 +1,220 @@ +control(); + } + + function control() { + parent::__construct(); + if(!$this->user['isfounder'] && !$this->user['allowadminpm']) { + $this->message('no_permission_for_this_module'); + } + $this->load('pm'); + $this->check_priv(); + } + + function onls() { + $pmlist = array(); + $count = 0; + $multipage = $srchtablename = $srchauthor = $srchstarttime = $srchendtime = $srchmessage = ''; + if($this->submitcheck() || getgpc('searchpmsubmit', 'G')) { + $srchtablename = intval(getgpc('srchtablename', 'R')); + $srchauthor = trim(getgpc('srchauthor', 'R')); + $srchstarttime = trim(getgpc('srchstarttime', 'R')); + $srchendtime = trim(getgpc('srchendtime', 'R')); + $srchmessage = trim(getgpc('srchmessage', 'R')); + + $wheresql = array(); + if(!$srchtablename) { + $srchtablename = 0; + } + if($srchauthor) { + $this->load('user'); + $uidarr = $_ENV['user']->name2id(explode(',', $srchauthor)); + $wheresql[] = "authorid IN (".$this->implode($uidarr).")"; + } + if($srchstarttime) { + $wheresql[] = "dateline>='".strtotime($srchstarttime)."'"; + } + if($srchendtime) { + $wheresql[] = "dateline<'".strtotime($srchendtime)."'"; + } + if($srchmessage) { + $wheresql[] = "message LIKE '%{$srchmessage}%'"; + } + + if(!empty($wheresql)) { + $count = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_messages_".(string)$srchtablename." WHERE ".implode(' AND ', $wheresql)); + } + if($count) { + $page = intval(getgpc('page', 'R')); + $page = $page ? $page : 1; + $start = ($page-1) * UC_PPP; + $limit = UC_PPP; + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_messages_".(string)$srchtablename." WHERE ".implode(' AND ', $wheresql)." LIMIT $start, $limit"); + while($message = $this->db->fetch_array($query)) { + $message['dateline'] = $this->date($message['dateline']); + $user[] = $message['authorid']; + $pmlist[] = $message; + } + $this->load('user'); + $usernamearr = $_ENV['user']->id2name($user); + foreach($pmlist as $key => $value) { + $pmlist[$key]['author'] = $usernamearr[$pmlist[$key]['authorid']]; + } + $multipage = $this->page($count, UC_PPP, $page, UC_ADMINSCRIPT.'?m=pm&a=ls&srchtablename='.$srchtablename.'&srchauthor='.urlencode($srchauthor).'&srchstarttime='.urlencode($srchstarttime).'&srchendtime='.urlencode($srchendtime).'&srchmessage='.urlencode($srchmessage).'&searchpmsubmit=true'); + } + } + + $pmnum = 0; + for($i = 0; $i < 10; $i++) { + $pmnum += $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_messages_".(string)$i); + } + $this->view->assign('pmnum', $pmnum); + $this->view->assign('count', $count); + $this->view->assign('pmlist', $pmlist); + $this->view->assign('multipage', $multipage); + $this->view->assign('srchtablename', $srchtablename); + $this->view->assign('srchauthor', $srchauthor); + $this->view->assign('srchstarttime', $srchstarttime); + $this->view->assign('srchendtime', $srchendtime); + $this->view->assign('srchmessage', $srchmessage); + $this->view->display('admin_pm_search'); + } + + function ondelete() { + $srchtablename = intval(getgpc('srchtablename', 'R')); + $srchauthor = trim(getgpc('srchauthor', 'R')); + $srchstarttime = trim(getgpc('srchstarttime', 'R')); + $srchendtime = trim(getgpc('srchendtime', 'R')); + $srchmessage = trim(getgpc('srchmessage', 'R')); + if($this->submitcheck()) { + $pmids = getgpc('deletepmid'); + if(empty($pmids)) { + $this->message('pm_delete_noselect', UC_ADMINSCRIPT.'?m=pm&a=ls&srchtablename='.$srchtablename.'&srchauthor='.urlencode($srchauthor).'&srchstarttime='.urlencode($srchstarttime).'&srchendtime='.urlencode($srchendtime).'&srchmessage='.urlencode($srchmessage).'&searchpmsubmit=true'); + } + foreach($pmids as $pmid) { + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_indexes i LEFT JOIN ".UC_DBTABLEPRE."pm_lists l ON i.plid=l.plid WHERE i.pmid='$pmid'"); + if($index = $this->db->fetch_array($query)) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$_ENV['pm']->getposttablename($index['plid'])." WHERE pmid='$pmid'"); + if($index['pmtype'] == 1) { + $authorcount = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$_ENV['pm']->getposttablename($index['plid'])." WHERE plid='".$index['plid']."' AND delstatus IN (0, 2)"); + $othercount = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$_ENV['pm']->getposttablename($index['plid'])." WHERE plid='".$index['plid']."' AND delstatus IN (0, 1)"); + $users = explode('_', $index['min_max']); + if($users[0] == $index['authorid']) { + $other = $users[1]; + } else { + $other = $users[0]; + } + if($authorcount + $othercount == 0) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='".$index['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='".$index['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='".$index['plid']."'"); + } else { + if($authorcount){ + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET pmnum='$authorcount' WHERE plid='".$index['plid']."' AND uid='".$index['authorid']."'"); + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='".$index['plid']."' AND uid='".$index['authorid']."'"); + } + if($othercount) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET pmnum='$othercount' WHERE plid='".$index['plid']."' AND uid='".$other."'"); + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='".$index['plid']."' AND uid='".$other."'"); + } + } + } elseif($index['pmtype'] == 2) { + $count = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$_ENV['pm']->getposttablename($index['plid'])." WHERE plid='".$index['plid']."'"); + if(!$count) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='".$index['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='".$index['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='".$index['plid']."'"); + } else { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET pmnum='$count' WHERE plid='".$index['plid']."'"); + } + } + } + } + $this->message('pm_clear_succeed', UC_ADMINSCRIPT.'?m=pm&a=ls&srchtablename='.$srchtablename.'&srchauthor='.urlencode($srchauthor).'&srchstarttime='.urlencode($srchstarttime).'&srchendtime='.urlencode($srchendtime).'&srchmessage='.urlencode($srchmessage).'&searchpmsubmit=true'); + } + } + + function onclear() { + $delnum = $status = 0; + if($this->submitcheck() || getgpc('clearpmsubmit', 'G')) { + $usernames = trim(getgpc('usernames', 'R')); + $pertask = intval(getgpc('pertask', 'R')); + $current = intval(getgpc('current', 'R')); + $pertask = $pertask ? $pertask : 100; + $current = $current > 0 ? $current : 0; + $next = $current + $pertask; + $nexturl = UC_ADMINSCRIPT."?m=pm&a=clear&usernames=$usernames¤t=$next&pertask=$pertask&clearpmsubmit=1"; + + if($usernames) { + $uids = 0; + $processed = 0; + $usernames = "'".implode("', '", explode(',', $usernames))."'"; + $query = $this->db->query("SELECT uid FROM ".UC_DBTABLEPRE."members WHERE username IN ($usernames)"); + while($res = $this->db->fetch_array($query)) { + $uids .= ','.$res['uid']; + } + if($uids) { + $query = $this->db->query("SELECT m.plid, m.uid, t.pmtype, t.authorid FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON m.plid=t.plid WHERE m.uid IN ($uids) LIMIT $pertask"); + while($member = $this->db->fetch_array($query)) { + $processed = 1; + if($member['pmtype'] == 1) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$_ENV['pm']->getposttablename($member['plid'])." WHERE plid='".$member['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='".$member['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='".$member['plid']."'"); + $adjust = $this->db->affected_rows(); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='".$member['plid']."'"); + } elseif($member['pmtype'] == 2) { + if($member['authorid'] == $member['uid']) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$_ENV['pm']->getposttablename($member['plid'])." WHERE plid='".$member['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='".$member['plid']."'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='".$member['plid']."'"); + $adjust = $this->db->affected_rows(); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='".$member['plid']."'"); + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$_ENV['pm']->getposttablename($member['plid'])." WHERE plid='".$member['plid']."' AND authorid IN (".$uids.")"); + $affectpmnum = $this->db->affected_rows(); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='".$member['plid']."' AND uid IN (".$uids.")"); + $affectmembers = $this->db->affected_rows(); + $adjust = $affectmembers; + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET pmnum=pmnum-'$affectpmnum' WHERE plid='".$member['plid']."'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET members=members-'$affectmembers' WHERE plid='".$member['plid']."'"); + } + } + } + } + if($processed) { + $this->message('pm_clear_processing', $nexturl, 0, array('current' => $current, 'next' => $next)); + } else { + $this->message('pm_clear_succeed', UC_ADMINSCRIPT.'?m=pm&a=clear'); + } + } + } + + $pmnum = 0; + for($i = 0; $i < 10; $i++) { + $pmnum += $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_messages_".(string)$i); + } + $this->view->assign('pmnum', $pmnum); + $this->view->assign('delnum', $delnum); + $this->view->assign('status', $status); + $this->view->display('admin_pm_clear'); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/seccode.php b/uc_server/control/admin/seccode.php new file mode 100644 index 0000000..277fda7 --- /dev/null +++ b/uc_server/control/admin/seccode.php @@ -0,0 +1,52 @@ +control(); + } + + function control() { + parent::__construct(); + $authkey = md5(UC_KEY.$_SERVER['HTTP_USER_AGENT'].$this->onlineip); + + $this->time = time(); + $seccodeauth = getgpc('seccodeauth'); + $seccode = $this->authcode($seccodeauth, 'DECODE', $authkey); + + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + + include_once UC_ROOT.'lib/seccode.class.php'; + $code = new seccode(); + $code->code = $seccode; + $code->type = 0; + $code->width = 70; + $code->height = 21; + $code->background = 0; + $code->adulterate = 1; + $code->ttf = 1; + $code->angle = 0; + $code->color = 1; + $code->size = 0; + $code->shadow = 1; + $code->animator = 0; + $code->fontpath = UC_ROOT.'images/fonts/'; + $code->datapath = UC_ROOT.'images/'; + $code->includepath = ''; + $code->display(); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/admin/setting.php b/uc_server/control/admin/setting.php new file mode 100644 index 0000000..ce21656 --- /dev/null +++ b/uc_server/control/admin/setting.php @@ -0,0 +1,202 @@ +control(); + } + + function control() { + parent::__construct(); + $this->check_priv(); + if(!$this->user['isfounder'] && !$this->user['allowadminsetting']) { + $this->message('no_permission_for_this_module'); + } + $this->check_priv(); + } + + function onls() { + $this->load('user'); + $updated = false; + if($this->submitcheck()) { + $timeformat = getgpc('timeformat', 'P'); + $dateformat = getgpc('dateformat', 'P'); + $timeoffset = getgpc('timeoffset', 'P'); + $privatepmthreadlimit = getgpc('privatepmthreadlimit', 'P'); + $chatpmthreadlimit = getgpc('chatpmthreadlimit', 'P'); + $chatpmmemberlimit = getgpc('chatpmmemberlimit', 'P'); + $pmfloodctrl = getgpc('pmfloodctrl', 'P'); + $pmsendregdays = getgpc('pmsendregdays', 'P'); + $pmcenter = getgpc('pmcenter', 'P'); + $sendpmseccode = getgpc('sendpmseccode', 'P'); + $login_failedtime = getgpc('login_failedtime', 'P'); + $addappbyurl = getgpc('addappbyurl', 'P'); + $insecureoperation = getgpc('insecureoperation', 'P'); + $passwordalgo = getgpc('passwordalgo', 'P'); + $passwordoptions = htmlspecialchars_decode(stripslashes(getgpc('passwordoptions', 'P'))); + $dateformat = str_replace(array('yyyy', 'mm', 'dd'), array('y', 'n', 'j'), strtolower($dateformat)); + $timeformat = $timeformat == 1 ? 'H:i' : 'h:i A'; + $timeoffset = in_array($timeoffset, array('-12', '-11', '-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3.5', '-3', '-2', '-1', '0', '1', '2', '3', '3.5', '4', '4.5', '5', '5.5', '5.75', '6', '6.5', '7', '8', '9', '9.5', '10', '11', '12')) ? $timeoffset : 8; + + if(empty($passwordalgo) && !empty($passwordoptions)) { + $passwordoptions = ''; + } else if(!empty($passwordalgo)) { + $options = empty($passwordoptions) ? array() : json_decode($passwordoptions, true); + $tresult = password_hash($passwordalgo, constant($passwordalgo), $options); + if($tresult === false || $tresult === null || !password_verify($passwordalgo, $tresult)) { + $passwordalgo = ''; + $passwordoptions = ''; + } + } + + $this->set_setting('dateformat', $dateformat); + $this->set_setting('timeformat', $timeformat); + $timeoffset = $timeoffset * 3600; + $this->set_setting('timeoffset', $timeoffset); + $this->set_setting('privatepmthreadlimit', intval($privatepmthreadlimit)); + $this->set_setting('chatpmthreadlimit', intval($chatpmthreadlimit)); + $this->set_setting('chatpmmemberlimit', intval($chatpmmemberlimit)); + $this->set_setting('pmfloodctrl', intval($pmfloodctrl)); + $this->set_setting('pmsendregdays', intval($pmsendregdays)); + $this->set_setting('pmcenter', $pmcenter); + $this->set_setting('sendpmseccode', $sendpmseccode ? 1 : 0); + $this->set_setting('login_failedtime', intval($login_failedtime)); + $this->set_setting('addappbyurl', $addappbyurl); + $this->set_setting('insecureoperation', $insecureoperation); + $this->set_setting('passwordalgo', $passwordalgo); + $this->set_setting('passwordoptions', $passwordoptions); + $updated = true; + + $this->updatecache(); + } + + $settings = $this->get_setting($this->_setting_items); + if($updated) { + $this->_add_note_for_setting($settings); + } + $settings['dateformat'] = str_replace(array('y', 'n', 'j'), array('yyyy', 'mm', 'dd'), $settings['dateformat']); + $settings['timeformat'] = $settings['timeformat'] == 'H:i' ? 1 : 0; + $settings['pmcenter'] = $settings['pmcenter'] ? 1 : 0; + $settings['insecureoperation'] = $settings['insecureoperation'] ? 1 : 0; + $a = getgpc('a'); + $this->view->assign('a', $a); + + $this->view->assign('dateformat', $settings['dateformat']); + $timeformatchecked = array('',''); + $timeformatchecked[$settings['timeformat']] = 'checked="checked"'; + $this->view->assign('timeformat', $timeformatchecked); + $this->view->assign('privatepmthreadlimit', $settings['privatepmthreadlimit']); + $this->view->assign('chatpmthreadlimit', $settings['chatpmthreadlimit']); + $this->view->assign('chatpmmemberlimit', $settings['chatpmmemberlimit']); + $this->view->assign('pmsendregdays', $settings['pmsendregdays']); + $this->view->assign('pmfloodctrl', $settings['pmfloodctrl']); + $pmcenterchecked = array('',''); + $pmcenterchecked[$settings['pmcenter']] = 'checked="checked"'; + $pmcenterchecked['display'] = $settings['pmcenter'] ? '' : 'style="display:none"'; + $addappbyurlchecked = array('',''); + $addappbyurlchecked[$settings['addappbyurl']] = 'checked="checked"'; + $insecureoperationchecked = array('',''); + $insecureoperationchecked[$settings['insecureoperation']] = 'checked="checked"'; + $this->view->assign('pmcenter', $pmcenterchecked); + $sendpmseccodechecked = array('',''); + $sendpmseccodechecked[$settings['sendpmseccode']] = 'checked="checked"'; + $this->view->assign('sendpmseccode', $sendpmseccodechecked); + $this->view->assign('addappbyurl', $addappbyurlchecked); + $this->view->assign('insecureoperation', $insecureoperationchecked); + $this->view->assign('passwordalgo', $settings['passwordalgo']); + $this->view->assign('passwordoptions', htmlspecialchars($settings['passwordoptions'])); + $timeoffset = intval($settings['timeoffset'] / 3600); + $checkarray = array($timeoffset < 0 ? '0'.substr($timeoffset, 1) : $timeoffset => 'selected="selected"'); + $this->view->assign('checkarray', $checkarray); + $this->view->assign('updated', $updated); + $this->view->assign('login_failedtime', $settings['login_failedtime']); + $this->view->display('admin_setting'); + } + + function updatecache() { + $this->load('cache'); + $_ENV['cache']->updatedata('settings'); + } + + function onregister() { + $updated = false; + if($this->submitcheck()) { + $this->set_setting('doublee', getgpc('doublee', 'P')); + $this->set_setting('accessemail', getgpc('accessemail', 'P')); + $this->set_setting('censoremail', getgpc('censoremail', 'P')); + $this->set_setting('censorusername', getgpc('censorusername', 'P')); + $updated = true; + $this->writelog('setting_register_update'); + $this->updatecache(); + } + + $settings = $this->get_setting($this->_setting_items); + if($updated) { + $this->_add_note_for_setting($settings); + } + + $this->view->assign('a', getgpc('a')); + $doubleechecked = array('',''); + $doubleechecked[$settings['doublee']] = 'checked="checked"'; + $this->view->assign('doublee', $doubleechecked); + $this->view->assign('accessemail', $settings['accessemail']); + $this->view->assign('censoremail', $settings['censoremail']); + $this->view->assign('censorusername', $settings['censorusername']); + $this->view->assign('updated', $updated); + $this->view->display('admin_setting'); + } + + function onmail() { + $items = array('maildefault', 'mailsend', 'mailserver', 'mailport', 'mailtimeout', 'mailauth', 'mailfrom', 'mailauth_username', 'mailauth_password', 'maildelimiter', 'mailusername', 'mailsilent'); + $updated = false; + if($this->submitcheck()) { + foreach($items as $item) { + $value = getgpc($item, 'P'); + if($item == 'mailtimeout') { + $value = strlen(trim($value)) ? intval($value) : 30; + } + $this->set_setting($item, $value); + } + $updated = true; + $this->writelog('setting_mail_update'); + $this->updatecache(); + } + + $settings = $this->get_setting($this->_setting_items); + if($updated) { + $this->_add_note_for_setting($settings); + } + foreach($items as $item) { + if($item == 'mailtimeout') { + $settings[$item] = strlen(trim($settings[$item])) ? intval($settings[$item]) : 30; + } + $this->view->assign($item, dhtmlspecialchars($settings[$item])); + } + + $this->view->assign('a', getgpc('a')); + $this->view->assign('updated', $updated); + $this->view->display('admin_setting'); + } + + function _add_note_for_setting($settings) { + $this->load('note'); + $_ENV['note']->add('updateclient', '', $this->serialize($settings, 1)); + $_ENV['note']->send(); + } +} \ No newline at end of file diff --git a/uc_server/control/admin/ucfiles.md5 b/uc_server/control/admin/ucfiles.md5 new file mode 100644 index 0000000..5c52f3e --- /dev/null +++ b/uc_server/control/admin/ucfiles.md5 @@ -0,0 +1,268 @@ +0385752c2d59f767a08745ec5c184e3e *./admin.php +ac32c9e1f5286d86a4fe2ec70d4c42bb *./api +8cc30af099189f17fc39cfc2b490016a *./avatar.php +96eff00a176146218960e50347d9cf49 *./control +29c98250b07e4079f3906de984a27ef6 *./crossdomain.xml +cba7beb32835268b64190bc95a4ba48c *./data +5861434debb0780903e517525c22351e *./images +0feafb61e16c4a8922490da435cafdb2 *./index.php +0d673a9b9f136a7a6b6b25d4ff4bc1fd *./install +b7f758bee1311bf266967be187fb748f *./js +ccf267e9dcaf9ff2d315012060a7e1d6 *./lib +2bdbd8d3dddf47a9dad09787c54c8751 *./model +f576f07ce12ea5a7bf644f4ad5b235a5 *./plugin +d093e4cdf86aa6a86a460b237b8b30da *./release +daadebe24cc397eaedb16c5aef40a306 *./robots.txt +1f4899a85658c8e1931ad3b7d43b4560 *./view +7215ee9c7d9dc229d2921a40e899ec5f *data/avatar/index.htm +7215ee9c7d9dc229d2921a40e899ec5f *data/backup/index.htm +d41d8cd98f00b204e9800998ecf8427e *data/cache/index.htm +7215ee9c7d9dc229d2921a40e899ec5f *data/index.htm +7215ee9c7d9dc229d2921a40e899ec5f *data/logs/index.htm +d41d8cd98f00b204e9800998ecf8427e *data/tmp/index.htm +d41d8cd98f00b204e9800998ecf8427e *data/view/index.htm +10535839824beb48f37e841da38e303e *api/dbbak.php +d41d8cd98f00b204e9800998ecf8427e *api/index.htm +14be3ba21aad1ccea2ca79a8225d56cc *control/admin/admin.php +0942fd82578cd67d050f274a545963ea *control/admin/app.php +de28f7f5888d1821996d71d00bd24284 *control/admin/badword.php +72a4339c80c4a1dea4a2e644fa783e53 *control/admin/cache.php +81037b70fa4e87d076cd3514afb66158 *control/admin/credit.php +2d3cdac817e27b50ffabbcc335cf292a *control/admin/db.php +2a85723627e94562c272252c4ca3c539 *control/admin/domain.php +191e7c4979b968a51cf01895572590be *control/admin/feed.php +b00faf0962491a686c60d4d8bd78d456 *control/admin/frame.php +d41d8cd98f00b204e9800998ecf8427e *control/admin/index.htm +09dae67bfff6ad1ebf9119bf9da0e51e *control/admin/log.php +e5cbe7d464d499241b319a994ecb63f2 *control/admin/mail.php +eb85b007507bcabb25d40983880193e8 *control/admin/note.php +dea62a81dcb69b255a4deaac38602e0d *control/admin/plugin.php +8b649848712e62e46b0258ce64068eaf *control/admin/pm.php +0e9c93d9204b5f232eea6617ca594979 *control/admin/seccode.php +7ab559b8f307d3a6ab843b6aebb266ab *control/admin/setting.php +4f83011ac2bd10c95df5583cd69e9c0c *control/admin/user.php +cff8d2970aac4f9d1fd19109e20af6e5 *control/app.php +5055e3cf8e772dccec030af9c8394732 *control/credit.php +aba07c0e38ad0875a303ef418658afc2 *control/domain.php +42a0f7a167224fbcba01a9a6dc561493 *control/feed.php +984b3ca201d58e21e3d6a165255f4623 *control/friend.php +7215ee9c7d9dc229d2921a40e899ec5f *control/index.htm +07ff3f0c057ece1f6b5f53c58e42cb89 *control/mail.php +a4f51b281ebc27ba4b71408caa4f3f52 *control/pm.php +40510924c9993ed89085b327dfbfcc3f *control/pm_client.php +ce7796094e78511fda6bb892baf11501 *control/seccode.php +0d2d3e7e61f7834c5133d1151e493368 *control/tag.php +4c3f837b2448ec7ef35d8511752048e5 *control/user.php +fa6e51baef21c1104e6a9c9bea515b93 *control/version.php +ec0e59d7cef33e37c5903af8a4303f9a *model/admin.php +8205147797b99f27395e796a2a626cfc *model/app.php +cce86c8ce09799e95363de7b8ccfac7a *model/badword.php +a8a9056bf248755d65bae1048355dbad *model/base.php +4f08ce941fdef0ff96f352ba5aaec307 *model/cache.php +d4fde3d32ba28d296f8b7b069bff016c *model/cron.php +74b4e3c17a429bfba12edee20d4e13ba *model/domain.php +c0dec6b7bcbf660a3fe9d9de1d782629 *model/feed.php +87d25e6d940ccc1358c63e83e21474a3 *model/friend.php +7215ee9c7d9dc229d2921a40e899ec5f *model/index.htm +0aafd28160be775def515e78352bfd29 *model/mail.php +7596df358356594c6cbf99e03481b605 *model/misc.php +19f1d9cc69e809f0ebfc548fbdc8ba61 *model/note.php +b23f0e5290103a3ea89fe1e3275f7826 *model/plugin.php +5479ac7219712c5aacd45514619aafba *model/pm.php +ba787d675b6b8db7549ae1a1eb97dc20 *model/setting.php +d7b379d38fbc0e8a120454a334a54499 *model/tag.php +b564b6871903fb8b5416b312bc975540 *model/user.php +5863499e81f1210950c1faef0f243b2b *model/var.php +cdc453e23980b4f7f894a3b15042a76c *model/version.php +5b3b6d9ee4ad98afe6dbb8a6e8cbc31c *lib/dbi.class.php +7215ee9c7d9dc229d2921a40e899ec5f *lib/index.htm +c121520183cc46e29204c4bf7af652da *lib/seccode.class.php +441f4eb0b041eea3dd7bef60d28ffcc8 *lib/sendmail.inc.php +ae92c4d817c0f3cfb61ffd7dcea0fb1d *lib/template.class.php +848c116587d29c14696b06c4f9d7daac *lib/uccode.class.php +7ccf3e6df76384119ab3f4f57df6a131 *lib/ucip.class.php +4afd5f62342793135e8e3a80dc1030c7 *lib/ucip_getter_dnslist.class.php +fb03073c2cc84fc9867013fd0b58f2a3 *lib/ucip_getter_header.class.php +a90ceac46628881d03a825e17ee31aa4 *lib/ucip_getter_iplist.class.php +a885fceaed7a0efca92f7b668329540a *lib/upload.class.php +40e2d97870dda73121a1c11c199e0e32 *lib/xml.class.php +d41d8cd98f00b204e9800998ecf8427e *plugin/filecheck/index.htm +497de42fe416946ddf59cf32e878f1ef *plugin/filecheck/plugin.php +c46605109aaaccfd8fc1665bd45cfb40 *plugin/filecheck/plugin.xml +5259f76ce41387e0218eb54c38a616c9 *plugin/filecheck/plugin_filecheck.htm +d41d8cd98f00b204e9800998ecf8427e *plugin/index.htm +d41d8cd98f00b204e9800998ecf8427e *plugin/replacemykey/index.htm +b5473807c40c6a1a4ab828aa719a9ca2 *plugin/replacemykey/plugin.php +7a65c32c302efac89e28a24b649795d9 *plugin/replacemykey/plugin.xml +d48eef5264297ddcd31685562f11d607 *plugin/replacemykey/plugin_replacemykey.htm +421e9965d42e7af12899788545ccf141 *images/admincp.css +bc3876c0904d9f3f51136effb2fb4c3d *images/avatar/arrow_down_big.gif +a221a06ac491aa71c92e759e6ac4963f *images/avatar/avatar.css +f525d6300adc770a1de79f89bb148d98 *images/avatar/avatar_back.gif +24e97b340ec9e9d72535db8e1f8087c5 *images/avatar/avatar_blank.gif +ba59ae3abc3a75b97fb6186cfe9115ea *images/avatar/avatar_finishback.png +2d5330771556729626dc253937e89877 *images/avatar/avatar_finishbutton.gif +38c8a1e48fa4003201af428a3515866b *images/avatar/avatar_lattice.png +05190dde781043370d7aa22bda21a716 *images/avatar/avatar_save.gif +8ab9e499a4f73143cc6881ff3a9eaaa8 *images/avatar/avatar_upload.gif +d41d8cd98f00b204e9800998ecf8427e *images/avatar/index.htm +18e2222cdf584db09ad3d83a1c9cb686 *images/avatar/ui-bg_flat_0_aaaaaa_40x100.png +3c739f0850728b9d2b21fabce555c8bf *images/avatar/ui-bg_flat_75_ffffff_40x100.png +3f439c206bd6e523e0075ee3e82cc5e2 *images/avatar/ui-bg_glass_55_fbf9ee_1x400.png +6ccf201ccb17973dd062dda17a9fd73e *images/avatar/ui-bg_glass_65_ffffff_1x400.png +0b4c9ca5a3f0f6355472b1731f959e30 *images/avatar/ui-bg_glass_75_dadada_1x400.png +0c16ca5bcb5327f16afe2d8467451081 *images/avatar/ui-bg_glass_75_e6e6e6_1x400.png +e8ee05b25304eabc1b86ec7a17aa153b *images/avatar/ui-bg_glass_95_fef1ec_1x400.png +2642c213d0fa88dac3f62aa7f014d2eb *images/avatar/ui-bg_highlight-soft_75_cccccc_1x100.png +2f5e9f0d1587490a6862464a9f581b00 *images/avatar/ui-icons_222222_256x240.png +3c2fbee895a768a97fedbcf750dab247 *images/avatar/ui-icons_2e83ff_256x240.png +e167cf8dd7c618441075253753d00fbd *images/avatar/ui-icons_454545_256x240.png +96cc018bb337ee2a8844b7b5f5fd02e7 *images/avatar/ui-icons_888888_256x240.png +59626b9493951a7c9e431e8ec5e4478f *images/avatar/ui-icons_cd0a0a_256x240.png +d3af6beed6f4c5941d8474d8c30de6ab *images/bg_login.gif +4fbf05bd615747043ff441b3be626935 *images/bg_repno.gif +45f5c756abcc348a6eef20280acd501c *images/bg_repx.gif +aca41a8eb347169d6d9f6d30bfd05760 *images/bg_repx_h.gif +7377bcd49e20f6c89031b6edc49e9078 *images/bg_repx_hb.gif +34dca4083cff131768ee4622df5be1a0 *images/bg_repx_hc.gif +dfceed64760a1f13574ad0aae8716d7a *images/bg_repx_hd.gif +5c7dc4e98f14c7fcaeb0f48c25521582 *images/bg_repy.gif +d749328a42f93fbb38530b3e56e9d8b7 *images/bg_tab_line.gif +3dea8dbe399a685950696ba4de3c81ea *images/camera.swf +c26b00c65530337202b3c2fb7e312a68 *images/correct.gif +3841a9d07dff4c2b532858e1a37e2e07 *images/default/btnbg.gif +6c0042d61b2fd00c1eaf8d6f235fcb8d *images/default/citeicon.gif +1c9c5d496c50c93360b5c9beaec05824 *images/default/codeicon.gif +ebc3ebfe2030ac169f67f46068151321 *images/default/editor.gif +9427dd2ee478413e6e69ea18f883a4f2 *images/default/headerbg.gif +7215ee9c7d9dc229d2921a40e899ec5f *images/default/index.htm +1b1eedef102241df95b5373c39cd2c44 *images/default/moreuser.gif +3fb36e32f3174880a725429c69471374 *images/default/navbg.gif +73f3cb40a1f93bd336c8a76d18b8bca6 *images/default/navborder.gif +77a3abd14ed1c5e5a3ba08feed25596a *images/default/navonbg.gif +17491987ef2d616958f9ea2a80a14236 *images/default/newpm.gif +b9aa4c8e088d9a3a5084aae5658800e3 *images/default/selectpm.gif +35512e7e6b33d45785f6e12edaa8bb78 *images/default/sendpm.gif +8b62e476c06d2b775a2764941595f275 *images/default/shrink.gif +75fc5f6113545a6e1887f19bb65ce6bf *images/default/spread.gif +7f181a5be7728e8d142bfa8381345b17 *images/default/style.css +2c691c702c6f99f2124872a750978d75 *images/default/viewpm.gif +8023f7060f74c5096c38986c6417351b *images/error.gif +7215ee9c7d9dc229d2921a40e899ec5f *images/fonts/ch/index.htm +4551e5ff11bce45780c17666d58d54bc *images/fonts/en/FetteSteinschrift.ttf +7215ee9c7d9dc229d2921a40e899ec5f *images/fonts/en/index.htm +7215ee9c7d9dc229d2921a40e899ec5f *images/fonts/index.htm +d41d8cd98f00b204e9800998ecf8427e *images/gif/index.htm +7f2c427e419dab7d1a393344d6f07e4e *images/gif/OCR_A_Extended/2.gif +6abadede0f4e967b038ac69a16525ddc *images/gif/OCR_A_Extended/3.gif +48cdd429871dc3d148b486ec52567338 *images/gif/OCR_A_Extended/4.gif +469178b649a9749fa9d4e1c22202fc1d *images/gif/OCR_A_Extended/6.gif +0a320ea7f96123389c3f5229e71cac88 *images/gif/OCR_A_Extended/7.gif +13bdc765d3660da6f1ec7b5254c069b9 *images/gif/OCR_A_Extended/8.gif +d27ecde71b96b655c9c28744e8dc7504 *images/gif/OCR_A_Extended/9.gif +94b7ff2d9fb9af8a81e16391417292d2 *images/gif/OCR_A_Extended/b.gif +012084f3c2eb004dde41bb1e661a4199 *images/gif/OCR_A_Extended/c.gif +d216f8e4726dc6c42c0ec910c7242c8c *images/gif/OCR_A_Extended/e.gif +574192191b37c831886e707a73db7331 *images/gif/OCR_A_Extended/f.gif +4f83b103fa9204dd02c7c0e2cd5b28d6 *images/gif/OCR_A_Extended/g.gif +b0be553679609735f5737de4d699f0e3 *images/gif/OCR_A_Extended/h.gif +7215ee9c7d9dc229d2921a40e899ec5f *images/gif/OCR_A_Extended/index.htm +94bfa0ee8de320a4d9fb27c60a81c166 *images/gif/OCR_A_Extended/j.gif +6ad111e8a2e887364fa4538a1c5696a3 *images/gif/OCR_A_Extended/k.gif +ccd299943d772a23fd627ceb2339cf00 *images/gif/OCR_A_Extended/m.gif +b4c9f827720ac90cf3e60da347298d88 *images/gif/OCR_A_Extended/p.gif +facc5b325f4c5267eb2ba2276ab11344 *images/gif/OCR_A_Extended/q.gif +05f102a282b1bd140808ebd4905a00e9 *images/gif/OCR_A_Extended/r.gif +2bb71603a97930d7dc964c7ad5f938a6 *images/gif/OCR_A_Extended/t.gif +71c796ce7277019346702c9cece66bac *images/gif/OCR_A_Extended/v.gif +b880a6dbe2f541e7a2a206b5ed060bde *images/gif/OCR_A_Extended/w.gif +b9c2cda80da20ca576a041436ec5d325 *images/gif/OCR_A_Extended/x.gif +a1d1a7234a91387247e05572eb7ce3a1 *images/gif/OCR_A_Extended/y.gif +210eab2a6aac169c4cff22726c7cf31d *images/gif/Small_Fonts/2.gif +3778789aef2f54d63f72fb67370d7bea *images/gif/Small_Fonts/3.gif +214538aebe9bcf1a67ffd64409098f60 *images/gif/Small_Fonts/4.gif +19a1e89e3fa1eb0da02961bd19993300 *images/gif/Small_Fonts/6.gif +7650644a730c2c5aab54f76ab08fa553 *images/gif/Small_Fonts/7.gif +b815c3d8530d3b8df1c9d97e73452378 *images/gif/Small_Fonts/8.gif +f4c7ec3cea67ee518ddeaef89c32c3e7 *images/gif/Small_Fonts/9.gif +bf07548e732b8c13d47198d184c5b48b *images/gif/Small_Fonts/b.gif +9d1cd311a3a88849e8fee8338d4bb613 *images/gif/Small_Fonts/c.gif +66b86aa8aa08360a3ccb56fd416757bd *images/gif/Small_Fonts/e.gif +d51a7ea9e101b476ea0919c61fc1393d *images/gif/Small_Fonts/f.gif +0e63939e22e106aad1954b4036bc038c *images/gif/Small_Fonts/g.gif +06f942f9527ca887847f63be52169cf6 *images/gif/Small_Fonts/h.gif +7215ee9c7d9dc229d2921a40e899ec5f *images/gif/Small_Fonts/index.htm +477159613def7b6d49eb3e6bf1dcbb96 *images/gif/Small_Fonts/j.gif +b2ef33f651bf2a76230f5693c6eb4876 *images/gif/Small_Fonts/k.gif +496e9f0e3ac01a70012b56160e327cca *images/gif/Small_Fonts/m.gif +671506b1b97ffc99827b387d96df274d *images/gif/Small_Fonts/p.gif +523aea03032519a5841e3e58837eb2ce *images/gif/Small_Fonts/q.gif +d902a7d160f0240d880c07810c019245 *images/gif/Small_Fonts/r.gif +184346e10b3738c0c116b0ac94f815bb *images/gif/Small_Fonts/t.gif +7998591fdfc080035bde69f0b1cb3356 *images/gif/Small_Fonts/v.gif +28ce7d393f697c1cf76b7f60144f140c *images/gif/Small_Fonts/w.gif +f1c5e779fdbf024d19fb578b7e06ea2c *images/gif/Small_Fonts/x.gif +5df21820742385217f6bf4b11824e524 *images/gif/Small_Fonts/y.gif +7215ee9c7d9dc229d2921a40e899ec5f *images/index.htm +3108ff46cd72be64fa798c3c053c0ac1 *images/locale.xml +a10a28d80a5f537074d5b96b3b6524d2 *images/noavatar.svg +12020705f9452035dea432f1e5b399fb *images/noavatar_big.gif +46ccf85e52575062c319633f5c0fc058 *images/noavatar_middle.gif +4d90ab1de43eaee5d6485e1ac18da854 *images/noavatar_small.gif +afddd35b063f8686ff995a5db578c8c9 *js/ajax.js +ebd3c99d34163d7d0870aee2429f0249 *js/avatar/avatar.js +d41d8cd98f00b204e9800998ecf8427e *js/avatar/index.htm +6a8d2ad2b8a68c521fa71d81dfea6142 *js/avatar/jquery-ui.min.js +e1288116312e4728f98923c79b034b67 *js/avatar/jquery.min.js +c8323955b8b6a4393372de9e122853a3 *js/calendar.js +0e8249b8c83ab93350d6864e106da182 *js/common.js +7215ee9c7d9dc229d2921a40e899ec5f *js/index.htm +904fbd9ee2c415bbee0fa4f9ccce4f83 *js/pm_editor.js +019d0509dd827c765be56d054ae8b3b1 *release/release.php +f5ca4573eda7e4e57c93e7f56893b354 *view/default/admin.lang.php +5de71114c9c4e1db2a69abab5b7428b1 *view/default/admin_admin.htm +d05e6869168a47c29e4a07226f344314 *view/default/admin_app.htm +144937a3b9476d80de4327ec4a6b0e26 *view/default/admin_badword.htm +a4c9e9f885fc9fad0775471a29ce1c6b *view/default/admin_cache.htm +a7c556480c133dc4b807acac8b07dcfb *view/default/admin_credit.htm +2289fbbc6bafff6ee29e57eda5ef17e7 *view/default/admin_db.htm +148cd0c9638d7d97e70bf840b856b6e6 *view/default/admin_domain.htm +c5b37cad1f7632a99a5cea682c4dbab5 *view/default/admin_feed.htm +174536a93a5116588fcee3162d48c131 *view/default/admin_frame_header.htm +ffdfec8855a0966ea96f4b4d9b19aecf *view/default/admin_frame_index.htm +77f7ee882805cea110d455bff8924959 *view/default/admin_frame_main.htm +85b055fbdfd3dc07a734fcd6592bb9b1 *view/default/admin_frame_menu.htm +437a9c540f3e3a1399a59723f7334055 *view/default/admin_log.htm +86406ddd5d03453d8827b4f77635e1e6 *view/default/admin_login.htm +6bf22f1fe1ca22101bcad871dc903430 *view/default/admin_mail.htm +4d783a0c883f0483538ad4f87a79d357 *view/default/admin_note.htm +79f736a4c4429b0778c535f570f7e96e *view/default/admin_pm_clear.htm +86081a9116560262c10b4bbe380fd1a9 *view/default/admin_pm_search.htm +3db0c4ed5f1f736af691157dcdd6280a *view/default/admin_setting.htm +2f5639b3e30068dfe9c930c7e853e960 *view/default/admin_tag.htm +c95cfb80efeaebc2e8a790c7f072d268 *view/default/admin_user.htm +3b1c724231b5b04b4d93f21c42c4c108 *view/default/admin_user_log.htm +575a286b0a10f311f689f5ee6c865dbc *view/default/camera.htm +008d9c24de6c0976c5c519382d1e5636 *view/default/footer.htm +cb9dab25bc7d9482efe4dafdea127849 *view/default/footer_ajax.htm +44eeece0ebe20f90106e281857eb61ee *view/default/footer_client.htm +a30d784e8ebd32f4c4b0ffa6f229a5b9 *view/default/header.htm +b5a4f84b23fdefbc19ec2b02169ad626 *view/default/header_ajax.htm +ca56e94572c998edbca29d67661b95fa *view/default/header_client.htm +7215ee9c7d9dc229d2921a40e899ec5f *view/default/index.htm +0651b7e9455824e78eab386cbca6d22a *view/default/main.lang.php +998b620c83be4e7caff9311f767327ae *view/default/message.htm +ef6b499f7eada56ecf60d2607272727e *view/default/messages.lang.php +7819252a557b50879b0e80396013683d *view/default/message_client.htm +21d15220756918b854defbd846c8aaa9 *view/default/plugin_footer.htm +129f9001a03223d43a04f24425aba7fd *view/default/plugin_header.htm +cfcf3bb6aeff9a878f5bf8061f19a707 *view/default/pm_blackls.htm +936cb7d54206d48bb6530c4c25c6f022 *view/default/pm_editorbar.htm +2d6a9f1c3244fd740bf3601f1578170f *view/default/pm_ls.htm +665031e7214ac409e3487d97f3823b09 *view/default/pm_member.htm +78cfbfb3fadc76e11e449f2a0ffbf8c0 *view/default/pm_nav.htm +acfeb7cbe2250a37032937ab78a62706 *view/default/pm_send.htm +c40c95219ebaafcfac4ff55b83774997 *view/default/pm_view.htm +0243f1691566ce77cc0670b48946500c *view/default/templates.lang.php +42fa0f40e601b24e3dbdd91ac05ce696 *view/default/user_avatar.htm +7215ee9c7d9dc229d2921a40e899ec5f *view/index.htm diff --git a/uc_server/control/admin/user.php b/uc_server/control/admin/user.php new file mode 100644 index 0000000..fb90d6e --- /dev/null +++ b/uc_server/control/admin/user.php @@ -0,0 +1,372 @@ +control(); + } + + function control() { + parent::__construct(); + if(getgpc('a') != 'login' && getgpc('a') != 'logout') { + if(!$this->user['isfounder'] && !$this->user['allowadminuser']) { + $this->message('no_permission_for_this_module'); + } + } + $this->load('user'); + } + + function onlogin() { + $authkey = md5(UC_KEY.$_SERVER['HTTP_USER_AGENT'].$this->onlineip); + + $this->load('user'); + $username = getgpc('username', 'P'); + $password = getgpc('password', 'P'); + $iframe = getgpc('iframe') ? 1 : 0; + + $isfounder = intval(getgpc('isfounder', 'P')); + $rand = rand(100000, 999999); + $seccodeinit = rawurlencode($this->authcode($rand, 'ENCODE', $authkey, 180)); + $errorcode = 0; + if($this->submitcheck()) { + + if($isfounder == 1) { + $username = 'UCenterAdministrator'; + } + + $can_do_login = $_ENV['user']->can_do_login($username, $this->onlineip); + + if(!$can_do_login) { + $errorcode = UC_LOGIN_ERROR_FAILEDLOGIN; + } else { + $seccodehidden = urldecode(getgpc('seccodehidden', 'P')); + $seccode = strtoupper(getgpc('seccode', 'P')); + $seccodehidden = $this->authcode($seccodehidden, 'DECODE', $authkey); + require UC_ROOT.'./lib/seccode.class.php'; + if(!seccode::seccode_check($seccodehidden, $seccode)) { + $errorcode = UC_LOGIN_ERROR_SECCODE; + } else { + $errorcode = UC_LOGIN_SUCCEED; + $this->user['username'] = $username; + if($isfounder == 1) { + $this->user['username'] = 'UCenterAdministrator'; + if($_ENV['user']->verify_password($password, UC_FOUNDERPW, UC_FOUNDERSALT)) { + $chkstatus = $_ENV['user']->upgrade_founderpw($password, UC_FOUNDERPW, UC_FOUNDERSALT); + if($chkstatus === 2) { + $this->writelog('admin_pw_upgrade'); + } + $username = $this->user['username']; + $this->view->sid = $this->sid_encode($this->user['username']); + } else { + $errorcode = UC_LOGIN_ERROR_FOUNDER_PW; + } + } else { + $admin = $this->db->fetch_first("SELECT a.uid,m.username,m.salt,m.password FROM ".UC_DBTABLEPRE."admins a LEFT JOIN ".UC_DBTABLEPRE."members m USING(uid) WHERE a.username='$username'"); + if(!empty($admin)) { + if($_ENV['user']->verify_password($password, $admin['password'], $admin['salt'])) { + $_ENV['user']->upgrade_password($username, $password, $admin['password'], $admin['salt']); + $this->view->sid = $this->sid_encode($admin['username']); + } else { + $errorcode = UC_LOGIN_ERROR_ADMIN_PW; + } + } else { + $errorcode = UC_LOGIN_ERROR_ADMIN_NOT_EXISTS; + } + } + + if($errorcode == 0) { + $this->setcookie('sid', $this->view->sid, 86400); + $this->user['admin'] = 1; + $this->writelog('login', 'succeed'); + if($iframe) { + header('location: '.UC_ADMINSCRIPT.'?m=frame&a=main&iframe=1'.($this->cookie_status ? '' : '&sid='.$this->view->sid)); + exit; + } else { + header('location: '.UC_ADMINSCRIPT.($this->cookie_status ? '' : '?sid='.$this->view->sid)); + exit; + } + } else { + $pwlen = strlen($password); + $this->writelog('login', 'error: user='.$this->user['username'].'; password='.($pwlen > 2 ? preg_replace("/^(.{".round($pwlen / 4)."})(.+?)(.{".round($pwlen / 6)."})$/s", "\\1***\\3", $password) : $password)); + $_ENV['user']->loginfailed($username, $this->onlineip); + } + } + } + } + $username = dhtmlspecialchars($username); + $password = dhtmlspecialchars($password); + $this->view->assign('seccodeinit', $seccodeinit); + $this->view->assign('username', $username); + $this->view->assign('password', $password); + $this->view->assign('isfounder', $isfounder); + $this->view->assign('errorcode', $errorcode); + $this->view->assign('iframe', $iframe); + $this->view->display('admin_login'); + } + + function onlogout() { + $this->writelog('logout'); + $this->setcookie('sid', ''); + header('location: '.UC_ADMINSCRIPT); + } + + function onadd() { + if(!$this->submitcheck('submit')) { + exit; + } + $username = getgpc('addname', 'P'); + $password = getgpc('addpassword', 'P'); + $email = getgpc('addemail', 'P'); + + if(($status = $this->_check_username($username)) < 0) { + if($status == UC_USER_CHECK_USERNAME_FAILED) { + $this->message('user_add_username_ignore', 'BACK'); + } elseif($status == UC_USER_USERNAME_BADWORD) { + $this->message('user_add_username_badwords', 'BACK'); + } elseif($status == UC_USER_USERNAME_EXISTS) { + $this->message('user_add_username_exists', 'BACK'); + } + } + if(($status = $this->_check_email($email)) < 0) { + if($status == UC_USER_EMAIL_FORMAT_ILLEGAL) { + $this->message('user_add_email_formatinvalid', 'BACK'); + } elseif($status == UC_USER_EMAIL_ACCESS_ILLEGAL) { + $this->message('user_add_email_ignore', 'BACK'); + } elseif($status == UC_USER_EMAIL_EXISTS) { + $this->message('user_add_email_exists', 'BACK'); + } + } + $uid = $_ENV['user']->add_user($username, $password, $email); + $this->message('user_add_succeed', UC_ADMINSCRIPT.'?m=user&a=ls'); + } + + function onls() { + + include_once UC_ROOT.'view/default/admin.lang.php'; + + $status = 0; + if(!empty($_POST['addname']) && $this->submitcheck()) { + $this->check_priv(); + $username = getgpc('addname', 'P'); + $password = getgpc('addpassword', 'P'); + $email = getgpc('addemail', 'P'); + + if(($status = $this->_check_username($username)) >= 0) { + if(($status = $this->_check_email($email)) >= 0) { + $_ENV['user']->add_user($username, $password, $email); + $status = 1; + $this->writelog('user_add', "username=$username"); + } + } + } + + if($this->submitcheck() && !empty($_POST['delete'])) { + $_ENV['user']->delete_user($_POST['delete']); + $status = 2; + $this->writelog('user_delete', "uid=".implode(',', $_POST['delete'])); + } + $srchname = getgpc('srchname', 'R'); + $srchregdatestart = getgpc('srchregdatestart', 'R'); + $srchregdateend = getgpc('srchregdateend', 'R'); + $srchuid = intval(getgpc('srchuid', 'R')); + $srchregip = trim(getgpc('srchregip', 'R')); + $srchemail = trim(getgpc('srchemail', 'R')); + + $sqladd = $urladd = ''; + if($srchname) { + $sqladd .= " AND username LIKE '$srchname%'"; + $this->view->assign('srchname', $srchname); + } else { + $this->view->assign('srchname', ''); + } + if($srchuid) { + $sqladd .= " AND uid='$srchuid'"; + $this->view->assign('srchuid', $srchuid); + } else { + $this->view->assign('srchuid', ''); + } + if($srchemail) { + $sqladd .= " AND email='$srchemail'"; + $this->view->assign('srchemail', $srchemail); + } else { + $this->view->assign('srchemail', ''); + } + if($srchregdatestart) { + $urladd .= '&srchregdatestart='.$srchregdatestart; + $sqladd .= " AND regdate>'".strtotime($srchregdatestart)."'"; + $this->view->assign('srchregdatestart', $srchregdatestart); + } else { + $this->view->assign('srchregdatestart', ''); + } + if($srchregdateend) { + $urladd .= '&srchregdateend='.$srchregdateend; + $sqladd .= " AND regdate<'".strtotime($srchregdateend)."'"; + $this->view->assign('srchregdateend', $srchregdateend); + } else { + $this->view->assign('srchregdateend', ''); + } + if($srchregip) { + $urladd .= '&srchregip='.$srchregip; + $sqladd .= " AND regip='$srchregip'"; + $this->view->assign('srchregip', $srchregip); + } else { + $this->view->assign('srchregip', ''); + } + $sqladd = $sqladd ? " WHERE 1 $sqladd" : ''; + + $num = $_ENV['user']->get_total_num($sqladd); + $userlist = $_ENV['user']->get_list($_GET['page'], UC_PPP, $num, $sqladd); + foreach($userlist as $key => $user) { + $user['smallavatar'] = ''; + $userlist[$key] = $user; + } + $multipage = $this->page($num, UC_PPP, $_GET['page'], UC_ADMINSCRIPT.'?m=user&a=ls&srchname='.$srchname.$urladd); + + $this->_format_userlist($userlist); + $this->view->assign('userlist', $userlist); + $adduser = getgpc('adduser'); + $a = getgpc('a'); + $this->view->assign('multipage', $multipage); + $this->view->assign('adduser', $adduser); + $this->view->assign('a', $a); + $this->view->assign('status', $status); + $this->view->display('admin_user'); + + } + + function onedit() { + $uid = getgpc('uid'); + $status = 0; + if(!$this->user['isfounder']) { + $isprotected = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid = '$uid'"); + if($isprotected) { + $this->message('user_edit_noperm'); + } + } + + if($this->submitcheck()) { + $username = getgpc('username', 'P'); + $newusername = getgpc('newusername', 'P'); + $password = getgpc('password', 'P'); + $email = getgpc('email', 'P'); + $secmobicc = intval(getgpc('secmobicc', 'P')); + $secmobile = intval(getgpc('secmobile', 'P')); + $delavatar = getgpc('delavatar', 'P'); + $rmrecques = getgpc('rmrecques', 'P'); + $sqladd = ''; + if(!empty($secmobile) && ($status = $_ENV['user']->check_secmobileexists($secmobicc, $secmobile, $username)) > 0) { + $this->message('admin_mobile_exists'); + } + if($username != $newusername) { + if($_ENV['user']->get_user_by_username($newusername)) { + $this->message('admin_user_exists'); + } + $sqladd .= "username='$newusername', "; + $_ENV['user']->user_log($uid, 'renameuser', 'uid='.$uid.'&oldusername='.urlencode($username).'&newusername='.urlencode($newusername)); + $this->load('note'); + $_ENV['note']->add('renameuser', 'uid='.$uid.'&oldusername='.urlencode($username).'&newusername='.urlencode($newusername)); + } + if($password) { + $salt = ''; + $password = $_ENV['user']->generate_password($password); + $sqladd .= "password='$password', salt='$salt', "; + $this->load('note'); + $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='); + } + if($rmrecques) { + $sqladd .= "secques='', "; + } + if(!empty($delavatar)) { + $_ENV['user']->delete_useravatar($uid); + } + + $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd email='$email', secmobicc='$secmobicc', secmobile='$secmobile' WHERE uid='$uid'"); + $status = $this->db->errno() ? -1 : 1; + if($status > 0) { + $_ENV['user']->user_log($uid, 'edituser', 'uid='.$uid.'&email='.urlencode($email).'&secmobicc='.urlencode($secmobicc).'&secmobile='.urlencode($secmobile)); + } + } + $user = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE uid='$uid'"); + $user['bigavatar'] = ''; + $user['bigavatarreal'] = ''; + $this->view->assign('uid', $uid); + $this->view->assign('user', $user); + $this->view->assign('status', $status); + $this->view->display('admin_user'); + } + + function onlogls() { + $page = getgpc('page'); + + $num = $_ENV['user']->user_log_total_num(); + $userlog = $_ENV['user']->user_log_list($page, UC_PPP, $num); + $multipage = $this->page($num, UC_PPP, $page, UC_ADMINSCRIPT.'?m=user&a=logls'); + + $this->view->assign('userlog', $userlog); + $this->view->assign('multipage', $multipage); + + $this->view->display('admin_user_log'); + } + + function _check_username($username) { + $username = addslashes(trim(stripslashes($username))); + if(!$_ENV['user']->check_username($username)) { + return UC_USER_CHECK_USERNAME_FAILED; + } elseif($_ENV['user']->check_usernameexists($username)) { + return UC_USER_USERNAME_EXISTS; + } + return 1; + } + + function _check_email($email) { + if(!$_ENV['user']->check_emailformat($email)) { + return UC_USER_EMAIL_FORMAT_ILLEGAL; + } elseif(!$_ENV['user']->check_emailaccess($email)) { + return UC_USER_EMAIL_ACCESS_ILLEGAL; + } elseif(!$this->settings['doublee'] && $_ENV['user']->check_emailexists($email)) { + return UC_USER_EMAIL_EXISTS; + } else { + return 1; + } + } + + function _check_secmobile($secmobicc, $secmobile, $username = '') { + return $_ENV['user']->check_secmobileexists($secmobicc, $secmobile, $username); + } + + function _format_userlist(&$userlist) { + if(is_array($userlist)) { + foreach($userlist AS $key => $user) { + $userlist[$key]['regdate'] = $this->date($user['regdate']); + } + } + } + +} + + + +?> \ No newline at end of file diff --git a/uc_server/control/app.php b/uc_server/control/app.php new file mode 100644 index 0000000..b6ef3ce --- /dev/null +++ b/uc_server/control/app.php @@ -0,0 +1,150 @@ +appcontrol(); + } + + function appcontrol() { + parent::__construct(); + $this->load('app'); + $this->load('user'); + } + + function onls() { + $this->init_input(); + $applist = $_ENV['app']->get_apps('appid, type, name, url, tagtemplates, viewprourl, synlogin'); + $applist2 = array(); + foreach($applist as $key => $app) { + $app['tagtemplates'] = $this->unserialize($app['tagtemplates']); + $applist2[$app['appid']] = $app; + } + return $applist2; + } + + function onadd() { + $ucfounderpw = getgpc('ucfounderpw', 'P'); + $apptype = getgpc('apptype', 'P'); + $appname = getgpc('appname', 'P'); + $appurl = getgpc('appurl', 'P'); + $appip = getgpc('appip', 'P'); + $apifilename = trim(getgpc('apifilename', 'P')); + $viewprourl = getgpc('viewprourl', 'P'); + $appcharset = getgpc('appcharset', 'P'); + $appdbcharset = getgpc('appdbcharset', 'P'); + $apptagtemplates = getgpc('apptagtemplates', 'P'); + $appallowips = getgpc('allowips', 'P'); + + $apifilename = $apifilename ? $apifilename : 'uc.php'; + + if(!$this->settings['addappbyurl'] || !$_ENV['user']->can_do_login('UCenterAdministrator', $this->onlineip)) { + exit('-1'); + } + + if($_ENV['user']->verify_password($ucfounderpw, UC_FOUNDERPW, UC_FOUNDERSALT) || (strlen($ucfounderpw) == 32 && hash_equals($ucfounderpw, md5(UC_FOUNDERPW)))) { + @ob_start(); + $return = ''; + + $this->_writelog('login', 'succeed_by_url_add_app'); + + $app = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."applications WHERE url='$appurl' AND type='$apptype'"); + + if(empty($app)) { + $authkey = $this->generate_key(64); + $apptagtemplates = $this->serialize($apptagtemplates, 1); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."applications SET + name='$appname', + url='$appurl', + ip='$appip', + apifilename='$apifilename', + authkey='$authkey', + viewprourl='$viewprourl', + synlogin='1', + charset='$appcharset', + dbcharset='$appdbcharset', + type='$apptype', + recvnote='1', + tagtemplates='$apptagtemplates', + allowips='$appallowips' + "); + $appid = $this->db->insert_id(); + + $this->_writelog('app_add', "appid=$appid; appname=$appname; by=url_add"); + + $_ENV['app']->alter_app_table($appid, 'ADD'); + $return = "$authkey|$appid|".UC_DBHOST.'|'.UC_DBNAME.'|'.UC_DBUSER.'|'.UC_DBPW.'|'.UC_DBCHARSET.'|'.UC_DBTABLEPRE.'|'.UC_CHARSET; + $this->load('cache'); + $_ENV['cache']->updatedata('apps'); + + $this->load('note'); + $notedata = $this->db->fetch_all("SELECT appid, type, name, url, ip, charset, synlogin, extra FROM ".UC_DBTABLEPRE."applications"); + $notedata = $this->_format_notedata($notedata); + $notedata['UC_API'] = UC_API; + $_ENV['note']->add('updateapps', '', $this->serialize($notedata, 1)); + $_ENV['note']->send(); + } else { + $this->_writelog('app_queryinfo', "appid={$app['appid']}; by=url_add"); + $return = "{$app['authkey']}|{$app['appid']}|".UC_DBHOST.'|'.UC_DBNAME.'|'.UC_DBUSER.'|'.UC_DBPW.'|'.UC_DBCHARSET.'|'.UC_DBTABLEPRE.'|'.UC_CHARSET; + } + @ob_end_clean(); + exit($return); + } else { + $pwlen = strlen($ucfounderpw); + $this->_writelog('login', 'error_by_url_add_app: user=UCenterAdministrator; password='.($pwlen > 2 ? preg_replace("/^(.{".round($pwlen / 4)."})(.+?)(.{".round($pwlen / 6)."})$/s", "\\1***\\3", $ucfounderpw) : $ucfounderpw)); + + $_ENV['user']->loginfailed('UCenterAdministrator', $this->onlineip); + + exit('-1'); + } + } + + function onucinfo() { + if(!$this->settings['addappbyurl']) { + exit('-1'); + } + + $arrapptypes = $this->db->fetch_all("SELECT DISTINCT type FROM ".UC_DBTABLEPRE."applications"); + $apptypes = $tab = ''; + foreach($arrapptypes as $apptype) { + $apptypes .= $tab.$apptype['type']; + $tab = "\t"; + } + exit("UC_STATUS_OK|".UC_SERVER_VERSION."|".UC_SERVER_RELEASE."|".UC_CHARSET."|".UC_DBCHARSET."|".$apptypes); + } + + function _format_notedata($notedata) { + $arr = array(); + foreach($notedata as $key => $note) { + $arr[$note['appid']] = $note; + } + return $arr; + } + + function _writelog($action, $extra = '') { + $log = dhtmlspecialchars('UCenterAdministrator'."\t".$this->onlineip."\t".$this->time."\t$action\t$extra"); + $logfile = UC_ROOT.'./data/logs/'.gmdate('Ym', $this->time).'.php'; + if(@filesize($logfile) > 2048000) { + PHP_VERSION < '4.2.0' && mt_srand((double)microtime() * 1000000); + $hash = ''; + $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; + for($i = 0; $i < 4; $i++) { + $hash .= $chars[mt_rand(0, 61)]; + } + @rename($logfile, UC_ROOT.'./data/logs/'.gmdate('Ym', $this->time).'_'.$hash.'.php'); + } + file_put_contents($logfile, "\t".str_replace(array('', ' \ No newline at end of file diff --git a/uc_server/control/credit.php b/uc_server/control/credit.php new file mode 100644 index 0000000..9a10889 --- /dev/null +++ b/uc_server/control/credit.php @@ -0,0 +1,43 @@ +creditcontrol(); + } + + function creditcontrol() { + parent::__construct(); + $this->init_input(); + $this->load('note'); + $this->load('misc'); + } + + function onrequest() { + $uid = intval($this->input('uid')); + $from = intval($this->input('from')); + $to = intval($this->input('to')); + $toappid = intval($this->input('toappid')); + $amount = intval($this->input('amount')); + $status = 0; + $this->settings['creditexchange'] = @unserialize($this->settings['creditexchange']); + if(isset($this->settings['creditexchange'][$this->app['appid'].'_'.$from.'_'.$toappid.'_'.$to])) { + $toapp = $app = $this->cache['apps'][$toappid]; + $url = $_ENV['note']->get_url_code('updatecredit', "uid=$uid&credit=$to&amount=$amount", $toappid); + $status = trim($_ENV['misc']->dfopen($url, 0, '', '', 1, $toapp['ip'], UC_NOTE_TIMEOUT)); + } + echo $status ? 1 : 0; + exit; + } +} + +?> \ No newline at end of file diff --git a/uc_server/control/domain.php b/uc_server/control/domain.php new file mode 100644 index 0000000..0b1f657 --- /dev/null +++ b/uc_server/control/domain.php @@ -0,0 +1,29 @@ +domaincontrol(); + } + + function domaincontrol() { + parent::__construct(); + $this->init_input(); + $this->load('domain'); + } + + function onls() { + return $_ENV['domain']->get_list(1, 9999, 9999); + } +} + +?> \ No newline at end of file diff --git a/uc_server/control/feed.php b/uc_server/control/feed.php new file mode 100644 index 0000000..9a0f6a1 --- /dev/null +++ b/uc_server/control/feed.php @@ -0,0 +1,105 @@ +feedcontrol(); + } + + function feedcontrol() { + parent::__construct(); + $this->init_input(); + } + + function onadd() { + $this->load('misc'); + $appid = intval($this->input('appid')); + $icon = $this->input('icon'); + $uid = intval($this->input('uid')); + $username = $this->input('username'); + $body_data = $_ENV['misc']->array2string($this->input('body_data')); + $title_data = $_ENV['misc']->array2string($this->input('title_data')); + + $title_template = $this->_parsetemplate($this->input('title_template')); + $body_template = $this->_parsetemplate($this->input('body_template')); + $body_general = $this->input('body_general'); + $target_ids = $this->input('target_ids'); + $image_1 = $this->input('image_1'); + $image_1_link = $this->input('image_1_link'); + $image_2 = $this->input('image_2'); + $image_2_link = $this->input('image_2_link'); + $image_3 = $this->input('image_3'); + $image_3_link = $this->input('image_3_link'); + $image_4 = $this->input('image_4'); + $image_4_link = $this->input('image_4_link'); + + $hash_template = md5($title_template.$body_template); + $hash_data = md5($title_template.$title_data.$body_template.$body_data); + $dateline = $this->time; + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."feeds SET appid='$appid', icon='$icon', uid='$uid', username='$username', + title_template='$title_template', title_data='$title_data', body_template='$body_template', body_data='$body_data', body_general='$body_general', + image_1='$image_1', image_1_link='$image_1_link', image_2='$image_2', image_2_link='$image_2_link', + image_3='$image_3', image_3_link='$image_3_link', image_4='$image_4', image_4_link='$image_4_link', + hash_template='$hash_template', hash_data='$hash_data', target_ids='$target_ids', dateline='$dateline'"); + return $this->db->insert_id(); + } + + function ondelete() { + $start = $this->input('start'); + $limit = $this->input('limit'); + $end = $start + $limit; + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."feeds WHERE feedid>'$start' AND feedid<'$end'"); + } + + function onget() { + $this->load('misc'); + $limit = intval($this->input('limit')); + $delete = $this->input('delete'); + $feedlist = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."feeds ORDER BY feedid DESC LIMIT $limit"); + if($feedlist) { + $maxfeedid = $feedlist[0]['feedid']; + foreach($feedlist as $key => $feed) { + $feed['body_data'] = $_ENV['misc']->string2array($feed['body_data']); + $feed['title_data'] = $_ENV['misc']->string2array($feed['title_data']); + $feedlist[$key] = $feed; + } + } + if(!empty($feedlist)) { + if(!isset($delete) || $delete) { + $this->_delete(0, $maxfeedid); + } + } + return $feedlist; + } + + function _delete($start, $end) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."feeds WHERE feedid>='$start' AND feedid<='$end'"); + } + + function _parsetemplate($template) { + $template = str_replace(array("\r", "\n"), '', $template); + $template = str_replace(array('
                                    ', '
                                    ', '
                                    ', '
                                    '), "\n", $template); + $template = str_replace(array('', ''), '[B]', $template); + $template = str_replace(array('', ''), '[I]', $template); + $template = str_replace(array('', ''), '[U]', $template); + $template = str_replace(array('', ''), '[/B]', $template); + $template = str_replace(array('', ''), '[/I]', $template); + $template = str_replace(array('', ''), '[/U]', $template); + $template = dhtmlspecialchars($template); + $template = nl2br($template); + $template = str_replace(array('[B]', '[I]', '[U]', '[/B]', '[/I]', '[/U]'), array('', '', '', '', '', ''), $template); + return $template; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/friend.php b/uc_server/control/friend.php new file mode 100644 index 0000000..0d4b33f --- /dev/null +++ b/uc_server/control/friend.php @@ -0,0 +1,59 @@ +friendcontrol(); + } + + function friendcontrol() { + parent::__construct(); + $this->init_input(); + $this->load('friend'); + } + + function ondelete() { + $uid = intval($this->input('uid')); + $friendids = $this->input('friendids'); + $id = $_ENV['friend']->delete($uid, $friendids); + return $id; + } + + function onadd() { + $uid = intval($this->input('uid')); + $friendid = $this->input('friendid'); + $comment = $this->input('comment'); + $id = $_ENV['friend']->add($uid, $friendid, $comment); + return $id; + } + + function ontotalnum() { + $uid = intval($this->input('uid')); + $direction = intval($this->input('direction')); + $totalnum = $_ENV['friend']->get_totalnum_by_uid($uid, $direction); + return $totalnum; + } + + function onls() { + $uid = intval($this->input('uid')); + $page = intval($this->input('page')); + $pagesize = intval($this->input('pagesize')); + $totalnum = intval($this->input('totalnum')); + $direction = intval($this->input('direction')); + $pagesize = $pagesize ? $pagesize : UC_PPP; + $totalnum = $totalnum ? $totalnum : $_ENV['friend']->get_totalnum_by_uid($uid); + $data = $_ENV['friend']->get_list($uid, $page, $pagesize, $totalnum, $direction); + return $data; + } +} + +?> \ No newline at end of file diff --git a/uc_server/control/index.htm b/uc_server/control/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/control/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/control/mail.php b/uc_server/control/mail.php new file mode 100644 index 0000000..e3c7f0c --- /dev/null +++ b/uc_server/control/mail.php @@ -0,0 +1,41 @@ +mailcontrol(); + } + + function mailcontrol() { + parent::__construct(); + $this->init_input(); + } + + function onadd() { + $this->load('mail'); + $mail = array(); + $mail['appid'] = $this->app['appid']; + $mail['uids'] = explode(',', $this->input('uids')); + $mail['emails'] = explode(',', $this->input('emails')); + $mail['subject'] = $this->input('subject'); + $mail['message'] = $this->input('message'); + $mail['charset'] = $this->input('charset'); + $mail['htmlon'] = intval($this->input('htmlon')); + $mail['level'] = abs(intval($this->input('level'))); + $mail['frommail'] = $this->input('frommail'); + $mail['dateline'] = $this->time; + return $_ENV['mail']->add($mail); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/pm.php b/uc_server/control/pm.php new file mode 100644 index 0000000..47c8e2a --- /dev/null +++ b/uc_server/control/pm.php @@ -0,0 +1,365 @@ +pmcontrol(); + } + + function pmcontrol() { + parent::__construct(); + $this->load('user'); + $this->load('pm'); + } + + function oncheck_newpm() { + $this->init_input(); + $uid = intval($this->input('uid')); + $more = intval($this->input('more')); + if(!$_ENV['pm']->isnewpm($uid) && !$more) { + return 0; + } + $newprvpm = $_ENV['pm']->getpmnum($uid, 1, 1); + $newchatpm = $_ENV['pm']->getpmnum($uid, 2, 1); + $newpm = $newprvpm + $newchatpm; + if($more == 0) { + return $newpm; + } elseif($more == 1) { + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm); + } elseif($more == 2 || $more == 3) { + if($more == 2) { + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'newchatpm' => $newchatpm); + } else { + $lastpm = $_ENV['pm']->lastpm($uid); + require_once UC_ROOT.'lib/uccode.class.php'; + $this->uccode = new uccode(); + $lastpm['lastsummary'] = $this->uccode->complie($lastpm['lastsummary']); + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'newchatpm' => $newchatpm, 'lastdate' => $lastpm['lastdateline'], 'lastmsgfromid' => $lastpm['lastauthorid'], 'lastmsgfrom' => $lastpm['lastauthorusername'], 'lastmsg' => $lastpm['lastsummary']); + } + } elseif($more == 4) { + return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'newchatpm' => $newchatpm); + } else { + return 0; + } + } + + function onsendpm() { + $this->init_input(); + $fromuid = $this->input('fromuid'); + $msgto = $this->input('msgto'); + $subject = $this->input('subject'); + $message = $this->input('message'); + $replypmid = $this->input('replypmid'); + $isusername = $this->input('isusername'); + $type = $this->input('type'); + + if(!$fromuid) { + return 0; + } + + $user = $_ENV['user']->get_user_by_uid($fromuid); + $user = daddslashes($user, 1); + if(!$user) { + return 0; + } + $this->user['uid'] = $user['uid']; + $this->user['username'] = $user['username']; + + if($replypmid) { + $isusername = 0; + $plid = $_ENV['pm']->getplidbypmid($replypmid); + $msgto = $_ENV['pm']->getuidbyplid($plid); + unset($msgto[$this->user['uid']]); + } else { + if(!empty($msgto)) { + $msgto = array_unique(explode(',', $msgto)); + } + } + + if($isusername) { + $msgto = $_ENV['user']->name2id($msgto); + } + $countmsgto = count($msgto); + + if($this->settings['pmsendregdays']) { + if($user['regdate'] > $this->time - $this->settings['pmsendregdays'] * 86400) { + return PMSENDREGDAYS; + } + } + if($this->settings['chatpmmemberlimit']) { + if($type == 1 && ($countmsgto > ($this->settings['chatpmmemberlimit'] - 1))) { + return CHATPMMEMBERLIMIT_ERROR; + } + } + if($this->settings['pmfloodctrl']) { + if(!$_ENV['pm']->ispminterval($this->user['uid'], $this->settings['pmfloodctrl'])) { + return PMFLOODCTRL_ERROR; + } + } + if($this->settings['privatepmthreadlimit']) { + if(!$_ENV['pm']->isprivatepmthreadlimit($this->user['uid'], $this->settings['privatepmthreadlimit'])) { + return PRIVATEPMTHREADLIMIT_ERROR; + } + } + if($this->settings['chatpmthreadlimit']) { + if(!$_ENV['pm']->ischatpmthreadlimit($this->user['uid'], $this->settings['chatpmthreadlimit'])) { + return CHATPMTHREADLIMIT_ERROR; + } + } + + $lastpmid = 0; + if($replypmid) { + $lastpmid = $_ENV['pm']->replypm($plid, $this->user['uid'], $this->user['username'], $message); + } else { + $lastpmid = $_ENV['pm']->sendpm($this->user['uid'], $this->user['username'], $msgto, $subject, $message, $type); + } + return $lastpmid; + } + + function ondelete() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $pmids = $this->input('pmids'); + if(empty($pmids)) { + return 0; + } + if(is_array($pmids)) { + $this->apps = $this->cache('apps'); + if($this->apps[$this->app['appid']]['type'] == 'UCHOME') { + $id = $_ENV['pm']->deletepmbyplids($this->user['uid'], $this->input('pmids')); + } else { + $id = $_ENV['pm']->deletepmbypmids($this->user['uid'], $this->input('pmids')); + } + } else { + $id = $_ENV['pm']->deletepmbypmid($this->user['uid'], $this->input('pmids')); + } + return $id; + } + + function ondeletechat() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plids = $this->input('plids'); + $type = intval($this->input('type')); + if($type == 1) { + return $_ENV['pm']->deletepmbyplids($this->user['uid'], $plids); + } else { + return $_ENV['pm']->quitchatpm($this->user['uid'], $plids); + } + } + + function ondeleteuser() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $id = $_ENV['pm']->deletepmbyplids($this->user['uid'], $this->input('touids'), 1); + return $id; + } + + function onreadstatus() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $_ENV['pm']->setpmstatus($this->user['uid'], $this->input('uids'), $this->input('plids'), $this->input('status')); + } + + function onignore() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + return $_ENV['pm']->set_ignore($this->user['uid']); + } + + function onls() { + $this->init_input(); + $pagesize = $this->input('pagesize'); + $filter = $this->input('filter'); + $page = $this->input('page'); + $msglen = $this->input('msglen'); + $this->user['uid'] = intval($this->input('uid')); + + $filter = $filter ? (in_array($filter, array('newpm', 'privatepm')) ? $filter : '') : ''; + if($filter == 'newpm') { + $type = 0; + $new = 1; + } elseif($filter == 'privatepm') { + $type = 0; + $new = 0; + } else { + return array(); + } + $pmnum = $_ENV['pm']->getpmnum($this->user['uid'], $type, $new); + $start = $this->page_get_start($page, $pagesize, $pmnum); + + if($pagesize > 0) { + $pms = $_ENV['pm']->getpmlist($this->user['uid'], $filter, $start, $pagesize); + if(is_array($pms) && !empty($pms)) { + foreach($pms as $key => $pm) { + if($msglen) { + $pms[$key]['lastsummary'] = $_ENV['pm']->removecode($pms[$key]['lastsummary'], $msglen); + } else { + unset($pms[$key]['lastsummary']); + } + } + } + $result['data'] = $pms; + } + $result['count'] = $pmnum; + return $result; + } + + function onview() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $pmid = $this->input('pmid'); + $touid = $this->input('touid'); + $daterange = $this->input('daterange'); + $page = $this->input('page'); + $pagesize = $this->input('pagesize'); + $isplid = $this->input('isplid'); + $type = $this->input('type'); + + $daterange = empty($daterange) ? 1 : $daterange; + $today = $this->time - ($this->time + $this->settings['timeoffset']) % 86400; + if($daterange == 1) { + $starttime = $today; + } elseif($daterange == 2) { + $starttime = $today - 86400; + } elseif($daterange == 3) { + $starttime = $today - 172800; + } elseif($daterange == 4) { + $starttime = $today - 604800; + } elseif($daterange == 5) { + $starttime = 0; + } + $endtime = $this->time; + + if(!$isplid) { + $plid = $_ENV['pm']->getplidbytouid($this->user['uid'], $touid); + } else { + $plid = $touid; + } + if($page) { + $pmnum = $_ENV['pm']->getpmnumbyplid($this->user['uid'], $plid); + $start = $this->page_get_start($page, $pagesize, $pmnum); + $ppp = $pagesize; + } else { + $pmnum = 0; + $start = 0; + $ppp = 0; + } + + if($pmid) { + $pms = $_ENV['pm']->getpmbypmid($this->user['uid'], $pmid); + } else { + $pms = $_ENV['pm']->getpmbyplid($this->user['uid'], $plid, $starttime, $endtime, $start, $ppp, $type); + } + + require_once UC_ROOT.'lib/uccode.class.php'; + $this->uccode = new uccode(); + if($pms) { + foreach($pms as $key => $pm) { + $pms[$key]['message'] = $this->uccode->complie($pms[$key]['message']); + } + } + return $pms; + } + + function onviewnum() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $touid = $this->input('touid'); + $isplid = $this->input('isplid'); + if(!$isplid) { + $plid = $_ENV['pm']->getplidbytouid($this->user['uid'], $touid); + } else { + $plid = $touid; + } + $pmnum = $_ENV['pm']->getpmnumbyplid($this->user['uid'], $plid); + return $pmnum; + } + + function onviewnode() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $type = $this->input('type'); + $pmid = $this->input('pmid'); + $type = 0; + $pms = $_ENV['pm']->getpmbypmid($this->user['uid'], $pmid); + + require_once UC_ROOT.'lib/uccode.class.php'; + $this->uccode = new uccode(); + if($pms) { + foreach($pms as $key => $pm) { + $pms[$key]['message'] = $this->uccode->complie($pms[$key]['message']); + } + } + $pms = $pms[0]; + return $pms; + } + + function onchatpmmemberlist() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plid = intval($this->input('plid')); + return $_ENV['pm']->chatpmmemberlist($this->user['uid'], $plid); + } + + function onkickchatpm() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plid = intval($this->input('plid')); + $touid = intval($this->input('touid')); + return $_ENV['pm']->kickchatpm($plid, $this->user['uid'], $touid); + } + + function onappendchatpm() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $plid = intval($this->input('plid')); + $touid = intval($this->input('touid')); + return $_ENV['pm']->appendchatpm($plid, $this->user['uid'], $touid); + } + + function onblackls_get() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + return $_ENV['pm']->get_blackls($this->user['uid']); + } + + function onblackls_set() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $blackls = $this->input('blackls'); + return $_ENV['pm']->set_blackls($this->user['uid'], $blackls); + } + + function onblackls_add() { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $username = $this->input('username'); + return $_ENV['pm']->update_blackls($this->user['uid'], $username, 1); + } + + function onblackls_delete($arr) { + $this->init_input(); + $this->user['uid'] = intval($this->input('uid')); + $username = $this->input('username'); + return $_ENV['pm']->update_blackls($this->user['uid'], $username, 2); + } +} + +?> \ No newline at end of file diff --git a/uc_server/control/pm_client.php b/uc_server/control/pm_client.php new file mode 100644 index 0000000..556ebe6 --- /dev/null +++ b/uc_server/control/pm_client.php @@ -0,0 +1,422 @@ +pm_clientcontrol(); + } + + function pm_clientcontrol() { + parent::__construct(); + if (!$this->settings['pmcenter']) { + exit('PMCenter closed'); + } + $this->load('user'); + $this->load('pm', NULL, UC_SERVER_RELEASE); + } + + function _auth() { + $input = getgpc('input'); + if (empty($this->user['uid']) || isset($input)) { + $this->init_input(); + header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); + if ($this->input['uid']) { + $this->setcookie('uc_auth', @$this->authcode($this->input['uid'] . "||" . md5($_SERVER['HTTP_USER_AGENT']), 'ENCODE', UC_KEY), 1800); + @$this->user['uid'] = $this->input['uid']; + } else { + $this->setcookie('uc_auth', ''); + $this->message('please_login', '', 1); + } + } + } + + function onls() { + $folder = getgpc('folder'); + $page = getgpc('page'); + $filter = getgpc('filter'); + $a = getgpc('a'); + $this->_auth(); + $uid = $this->user['uid']; + $_ENV['pm']->lang = &$this->lang; + $page = $page ? $page : 1; + $filter = $filter ? (in_array($filter, array('newpm', 'privatepm')) ? $filter : '') : 'privatepm'; + $pmnum_private = $_ENV['pm']->getpmnum($uid, 0, 0); + $unreadpmnum = $_ENV['pm']->getpmnum($uid, 0, 1); + $this->view->assign('user', $this->user); + $this->view->assign('pmnum_private', $pmnum_private); + $this->view->assign('unreadpmnum', $unreadpmnum); + $this->view->assign('folder', $folder); + if ($folder == 'blackls') { + $blackls = dhtmlspecialchars($_ENV['pm']->get_blackls($uid)); + $this->view->assign('blackls', $blackls); + $this->view->assign('filter', ''); + $this->view->display('pm_blackls'); + } else { + $start = ($page - 1) * 10; + $pmlist = $_ENV['pm']->getpmlist($uid, $filter, $start, 10); + if ($pmlist) { + foreach ($pmlist as $key => $value) { + $pmlist[$key]['filter'] = 'privatepm'; + $pmlist[$key]['lastdateline'] = $this->date($value['lastdateline']); + } + } + + $extra = 'extra=' . rawurlencode('page=' . $page); + $multipage = $this->page($pmnum_private, 10, $page, 'index.php?m=pm_client&a=ls&folder=' . $folder . '&filter=' . $filter); + $this->view->assign('extra', $extra); + $this->view->assign('filter', $filter); + $this->view->assign('pmlist', $pmlist); + $this->view->assign('multipage', $multipage); + $this->view->display('pm_ls'); + } + } + + function onblackls() { + $blackls = getgpc('blackls', 'P'); + $this->_auth(); + $uid = $this->user['uid']; + if ($this->submitcheck()) { + $_ENV['pm']->set_blackls($uid, $blackls); + } + $this->message('blackls_updated', 'index.php?m=pm_client&a=ls&folder=blackls', 1); + } + + function onsend() { + $a = getgpc('a'); + $do = getgpc('do'); + $this->_auth(); + $uid = $this->user['uid']; + + $this->load('friend'); + $totalnum = $_ENV['friend']->get_totalnum_by_uid($this->user['uid'], 3); + $friends = $totalnum ? $_ENV['friend']->get_list($this->user['uid'], 1, $totalnum, $totalnum, 3) : array(); + if (!$this->submitcheck()) { + $extra = 'extra=' . rawurlencode(isset($_GET['extra']) ? $_GET['extra'] : ''); + $type = !empty($_GET['type']) ? $_GET['type'] : ''; + $pmid = @is_numeric($_GET['pmid']) ? $_GET['pmid'] : 0; + $daterange = !empty($_GET['daterange']) ? intval($_GET['daterange']) : 1; + $touid = isset($_GET['touid']) ? intval($_GET['touid']) : 0; + $plid = isset($_GET['plid']) ? intval($_GET['plid']) : 0; + $folder = getgpc('folder'); + + $pmnum_private = $_ENV['pm']->getpmnum($uid, 0, 0); + $unreadpmnum = $_ENV['pm']->getpmnum($uid, 0, 1); + + $touser = ''; + if ($pmid) { + $tmp = $_ENV['pm']->getpmbypmid($uid, $pmid); + $tmp = $tmp[0]; + } else { + $tmp = array(); + } + + if (!empty($pmid)) { + if ($do == 'forward') { + $user = $_ENV['user']->get_user_by_uid($tmp['msgtoid']); + $tmp['message'] = $this->lang['pm_from'] . ': ' . $tmp['author'] . "\n" . + $this->lang['pm_to'] . ': ' . dhtmlspecialchars($user['username']) . "\n" . + $this->lang['pm_date'] . ': ' . $this->date($tmp['dateline']) . "\n\n" . + '[quote]' . trim(preg_replace("/(\[quote])(.*)(\[\/quote])/siU", '', $tmp['message'])) . '[/quote]' . "\n"; + } + } else { + !empty($_GET['msgto']) && $touser = dhtmlspecialchars($_GET['msgto']); + !empty($_GET['subject']) && $tmp['subject'] = $_GET['subject']; + $tmp['message'] = !empty($_GET['message']) ? $_GET['message'] : ''; + } + + if ($this->settings['sendpmseccode']) { + $authkey = md5(UC_KEY . $_SERVER['HTTP_USER_AGENT'] . $this->onlineip); + $rand = rand(100000, 999999); + $seccodeinit = rawurlencode($this->authcode($rand, 'ENCODE', $authkey, 720)); + $this->view->assign('seccodeinit', $seccodeinit); + } + + $this->view->assign('sendpmseccode', $this->settings['sendpmseccode']); + $this->view->assign('touser', $touser); + $this->view->assign('user', $this->user); + $this->view->assign('pmnum_private', $pmnum_private); + $this->view->assign('unreadpmnum', $unreadpmnum); + $this->view->assign('friends', $friends); + $this->view->assign('extra', $extra); + $this->view->assign('pmid', $pmid); + $this->view->assign('daterange', $daterange); + $this->view->assign('touid', $touid); + $this->view->assign('plid', $plid); + $this->view->assign('a', $a); + $this->view->assign('do', $do); + $this->view->assign('folder', $folder); + $tmp['message'] = dhtmlspecialchars($tmp['message']); + $this->view->assign('message', $tmp['message']); + $this->view->assign('type', $type); + $this->view->assign('filter', ''); + $this->view->display('pm_send'); + } else { + + if ($this->settings['sendpmseccode']) { + $authkey = md5(UC_KEY . $_SERVER['HTTP_USER_AGENT'] . $this->onlineip); + $seccodehidden = urldecode(getgpc('seccodehidden', 'P')); + $seccode = strtoupper(getgpc('seccode', 'P')); + $seccodehidden = $this->authcode($seccodehidden, 'DECODE', $authkey); + require UC_ROOT . './lib/seccode.class.php'; + if (!seccode::seccode_check($seccodehidden, $seccode)) { + $this->message('pm_send_seccode_error', 'BACK', 1); + } + } + + $user = $_ENV['user']->get_user_by_uid($this->user['uid']); + $this->user['username'] = daddslashes($user['username'], 1); + $touid = intval(getgpc('touid')); + $daterange = intval(getgpc('daterange')); + $type = intval(getgpc('type')); + $replypmid = @is_numeric($_GET['replypmid']) ? $_GET['replypmid'] : 0; + + $msgto = array(); + if ($replypmid) { + $plid = $_ENV['pm']->getplidbypmid($replypmid); + $msgto = $_ENV['pm']->getuidbyplid($plid); + unset($msgto[$uid]); + } else { + if (!empty($_POST['msgto'])) { + $msgto = explode(',', $_POST['msgto']); + $msgto = $_ENV['user']->name2id($msgto); + } + } + if (isset($_POST['friend'])) { + $frienduids = array(); + foreach ($friends as $friend) { + $frienduids[] = $friend['friendid']; + } + foreach ($_POST['friend'] as $friendid) { + if (in_array($friendid, $frienduids)) { + $msgto[] = $friendid; + } + } + } + if (!$msgto) { + $this->message('receiver_no_exists', 'BACK', 1); + } + + $msgto = array_unique($msgto); + $countmsgto = count($msgto); + + if ($this->settings['pmsendregdays']) { + if ($user['regdate'] > $this->time - $this->settings['pmsendregdays'] * 86400) { + $this->message('pm_send_regdays_error', 'BACK', 1, array('$pmsendregdays' => $this->settings['pmsendregdays'])); + } + } + if ($this->settings['chatpmmemberlimit']) { + if ($type == 1 && ($countmsgto > ($this->settings['chatpmmemberlimit'] - 1))) { + $this->message('pm_send_chatpmmemberlimit_error', 'BACK', 1, array('$chatpmmemberlimit' => $this->settings['chatpmmemberlimit'])); + } + } + if ($this->settings['pmfloodctrl']) { + if (!$_ENV['pm']->ispminterval($this->user['uid'], $this->settings['pmfloodctrl'])) { + $this->message('pm_send_pmfloodctrl_error', 'BACK', 1, array('$pmfloodctrl' => $this->settings['pmfloodctrl'])); + } + } + if ($this->settings['privatepmthreadlimit']) { + if (!$_ENV['pm']->isprivatepmthreadlimit($this->user['uid'], $this->settings['privatepmthreadlimit'])) { + $this->message('pm_send_privatepmthreadlimit_error', 'BACK', 1, array('$privatepmthreadlimit' => $this->settings['privatepmthreadlimit'])); + } + } + if ($this->settings['chatpmthreadlimit']) { + if (!$_ENV['pm']->ischatpmthreadlimit($this->user['uid'], $this->settings['chatpmthreadlimit'])) { + $this->message('pm_send_chatpmthreadlimit_error', 'BACK', 1, array('$chatpmthreadlimit' => $this->settings['chatpmthreadlimit'])); + } + } + + if ($replypmid) { + $lastpmid = $_ENV['pm']->replypm($plid, $this->user['uid'], $this->user['username'], $_POST['message']); + } else { + $lastpmid = $_ENV['pm']->sendpm($this->user['uid'], $this->user['username'], $msgto, '', $_POST['message'], $type); + } + if ($lastpmid > 0) { + if ($replypmid) { + if ($touid) { + $this->message('pm_send_succeed', "index.php?m=pm_client&a=view&touid=$touid&daterange=$daterange&filter=privatepm", 1); + } else { + $this->message('pm_send_succeed', "index.php?m=pm_client&a=view&plid=$plid&daterange=$daterange&filter=chatpm", 1); + } + } else { + if (!$type) { + $this->message('pm_send_succeed', 'index.php?m=pm_client&a=ls&filter=privatepm', 1); + } else { + $this->message('pm_send_succeed', 'index.php?m=pm_client&a=ls&filter=chatpm', 1); + } + } + } else { + $this->message('pm_send_ignore', 'BACK', 1); + } + } + } + + function ondelete() { + $this->_auth(); + $uid = $this->user['uid']; + $deletetouids = getgpc('deleteuid'); + $deleteplids = getgpc('deleteplid'); + $quitplids = getgpc('deletequitplid'); + $filter = getgpc('filter'); + if ($deletetouids && $deleteplids && $quitplids) { + $this->message('pm_delete_invalid', 'index.php?m=pm_client&a=ls&filter=' . $filter . '&' . $_GET['extra'], 1); + } + $flag = true; + if ($deletetouids) { + $return = $_ENV['pm']->deletepmbyplids($uid, $deletetouids, 1); + if ($return <= 0) { + $flag = false; + } + } + if ($deleteplids) { + $return = $_ENV['pm']->deletepmbyplids($uid, $deleteplids); + if ($return <= 0) { + $flag = false; + } + } + if ($quitplids) { + $return = $_ENV['pm']->quitchatpm($uid, $quitplids); + if ($return <= 0) { + $flag = false; + } + } + if ($flag) { + $this->message('pm_delete_succeed', 'index.php?m=pm_client&a=ls&filter=' . $filter . '&' . $_GET['extra'], 1); + } else { + $this->message('pm_delete_invalid', 'index.php?m=pm_client&a=ls&filter=' . $filter . '&' . $_GET['extra'], 1); + } + } + + function onview() { + $touid = intval(getgpc('touid')); + $plid = intval(getgpc('plid')); + $scroll = getgpc('scroll'); + $daterange = getgpc('daterange'); + $filter = getgpc('filter'); + $extra = 'extra=' . rawurlencode(getgpc('extra')); + $a = getgpc('a'); + $this->_auth(); + $uid = $this->user['uid']; + $pmnum_private = $_ENV['pm']->getpmnum($uid, 0, 0); + $unreadpmnum = $_ENV['pm']->getpmnum($uid, 0, 1); + + $daterange = empty($daterange) ? 1 : $daterange; + $today = $this->time - ($this->time + $this->settings['timeoffset']) % 86400; + if ($daterange == 1) { + $starttime = $today; + } elseif ($daterange == 2) { + $starttime = $today - 86400; + } elseif ($daterange == 3) { + $starttime = $today - 172800; + } elseif ($daterange == 4) { + $starttime = $today - 604800; + } elseif ($daterange == 5) { + $starttime = 0; + } + $endtime = $this->time; + if ($touid) { + $touser = $_ENV['user']->get_user_by_uid($touid); + $plid = $_ENV['pm']->getplidbytouid($uid, $touid); + $pms = $_ENV['pm']->getpmbyplid($uid, $plid, $starttime, $endtime, 0, 0, 0); + } elseif ($plid) { + $pms = $_ENV['pm']->getpmbyplid($uid, $plid, $starttime, $endtime, 0, 0, 1); + } + if ($pms) { + $founderuid = $pms[0]['founderuid']; + $replypmid = $pms[0]['pmid']; + $subject = $pms[0]['subject']; + } + + require_once UC_ROOT . 'lib/uccode.class.php'; + $this->uccode = new uccode(); + foreach ($pms as $key => $pm) { + $pms[$key]['message'] = $this->uccode->complie($pms[$key]['message']); + $pms[$key]['dateline'] = $this->date($pms[$key]['dateline']); + } + + if ($this->settings['sendpmseccode']) { + $authkey = md5(UC_KEY . $_SERVER['HTTP_USER_AGENT'] . $this->onlineip); + $rand = rand(100000, 999999); + $seccodeinit = rawurlencode($this->authcode($rand, 'ENCODE', $authkey, 720)); + $this->view->assign('seccodeinit', $seccodeinit); + } + + $this->view->assign('sendpmseccode', $this->settings['sendpmseccode']); + $this->view->assign('scroll', $scroll); + $this->view->assign('user', $this->user); + $this->view->assign('touser', $touser); + $this->view->assign('subject', $subject); + $this->view->assign('pmnum_private', $pmnum_private); + $this->view->assign('unreadpmnum', $unreadpmnum); + $this->view->assign('daterange', $daterange); + $this->view->assign('replypmid', $replypmid); + $this->view->assign('touid', $touid); + $this->view->assign('plid', $plid); + $this->view->assign('extra', $extra); + $this->view->assign('founderuid', $founderuid); + $this->view->assign('filter', $filter); + $this->view->assign('pms', $pms); + $this->view->display('pm_view'); + } + + function onmember() { + $plid = intval(getgpc('plid')); + $scroll = getgpc('scroll'); + $daterange = getgpc('daterange'); + $filter = getgpc('filter'); + $extra = 'extra=' . rawurlencode(getgpc('extra')); + $a = getgpc('a'); + $do = getgpc('do'); + $this->_auth(); + $uid = $this->user['uid']; + $pmnum_private = $_ENV['pm']->getpmnum($uid, 0, 0); + $unreadpmnum = $_ENV['pm']->getpmnum($uid, 0, 1); + + if ($do == 'kickmember') { + $memberuid = intval(getgpc('memberuid')); + if ($memberuid) { + $_ENV['pm']->kickchatpm($plid, $uid, $memberuid); + } + $this->message('pm_kickmember_succeed', "index.php?m=pm_client&a=member&plid=$plid&filter=" . $filter . '&' . $_GET['extra'], 1); + } + if ($this->submitcheck() && $do == 'appendmember') { + $appendmember = $_ENV['user']->get_user_by_username(getgpc('appendmember')); + if ($appendmember) { + $return = $_ENV['pm']->appendchatpm($plid, $uid, $appendmember['uid']); + if ($return > 0) { + $this->message('pm_appendmember_succeed', "index.php?m=pm_client&a=member&plid=$plid&filter=" . $filter . '&' . $_GET['extra'], 1); + } + } + $this->message('pm_appendmember_invalid', "index.php?m=pm_client&a=member&plid=$plid&filter=" . $filter . '&' . $_GET['extra'], 1); + } + + $members = $_ENV['pm']->chatpmmemberlist($uid, $plid); + $authorid = $members['author']; + $members = $members['member']; + $members = $_ENV['user']->id2name($members); + + $this->view->assign('scroll', $scroll); + $this->view->assign('user', $this->user); + $this->view->assign('pmnum_private', $pmnum_private); + $this->view->assign('unreadpmnum', $unreadpmnum); + $this->view->assign('replypmid', $replypmid); + $this->view->assign('subject', $subject); + $this->view->assign('daterange', $daterange); + $this->view->assign('plid', $plid); + $this->view->assign('extra', $extra); + $this->view->assign('filter', $filter); + $this->view->assign('authorid', $authorid); + $this->view->assign('members', $members); + $this->view->display('pm_member'); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/seccode.php b/uc_server/control/seccode.php new file mode 100644 index 0000000..410da06 --- /dev/null +++ b/uc_server/control/seccode.php @@ -0,0 +1,52 @@ +control(); + } + + function control() { + parent::__construct(); + $authkey = md5(UC_KEY.$_SERVER['HTTP_USER_AGENT'].$this->onlineip); + + $this->time = time(); + $seccodeauth = getgpc('seccodeauth'); + $seccode = $this->authcode($seccodeauth, 'DECODE', $authkey); + + @header("Expires: -1"); + @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + + include_once UC_ROOT.'lib/seccode.class.php'; + $code = new seccode(); + $code->code = $seccode; + $code->type = 0; + $code->width = 70; + $code->height = 21; + $code->background = 0; + $code->adulterate = 1; + $code->ttf = 1; + $code->angle = 0; + $code->color = 1; + $code->size = 0; + $code->shadow = 1; + $code->animator = 0; + $code->fontpath = UC_ROOT.'images/fonts/'; + $code->datapath = UC_ROOT.'images/'; + $code->includepath = ''; + $code->display(); + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/tag.php b/uc_server/control/tag.php new file mode 100644 index 0000000..5d68b25 --- /dev/null +++ b/uc_server/control/tag.php @@ -0,0 +1,85 @@ +tagcontrol(); + } + + function tagcontrol() { + parent::__construct(); + $this->init_input(); + $this->load('tag'); + $this->load('misc'); + } + + function ongettag() { + $appid = $this->input('appid'); + $tagname = $this->input('tagname'); + $nums = $this->input('nums'); + if(empty($tagname)) { + return NULL; + } + $return = $apparray = $appadd = array(); + + if($nums && is_array($nums)) { + foreach($nums as $k => $num) { + $apparray[$k] = $k; + } + } + + $data = $_ENV['tag']->get_tag_by_name($tagname); + if($data) { + $apparraynew = array(); + foreach($data as $tagdata) { + $row = $r = array(); + $tmp = explode("\t", $tagdata['data']); + $type = $tmp[0]; + array_shift($tmp); + foreach($tmp as $tmp1) { + $tmp1 != '' && $r[] = $_ENV['misc']->string2array($tmp1); + } + if(in_array($tagdata['appid'], $apparray)) { + if($tagdata['expiration'] > 0 && $this->time - $tagdata['expiration'] > 3600) { + $appadd[] = $tagdata['appid']; + $_ENV['tag']->formatcache($tagdata['appid'], $tagname); + } else { + $apparraynew[] = $tagdata['appid']; + } + $datakey = array(); + $count = 0; + foreach($r as $data) { + $return[$tagdata['appid']]['data'][] = $data; + $return[$tagdata['appid']]['type'] = $type; + $count++; + if($count >= $nums[$tagdata['appid']]) { + break; + } + } + } + } + $apparray = array_diff($apparray, $apparraynew); + } else { + foreach($apparray as $appid) { + $_ENV['tag']->formatcache($appid, $tagname); + } + } + if($apparray) { + $this->load('note'); + $_ENV['note']->add('gettag', "id=$tagname", '', $appadd, -1); + } + return $return; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/user.php b/uc_server/control/user.php new file mode 100644 index 0000000..5466223 --- /dev/null +++ b/uc_server/control/user.php @@ -0,0 +1,483 @@ +usercontrol(); + } + + function usercontrol() { + parent::__construct(); + $this->load('user'); + } + + function onsynlogin() { + $this->init_input(); + $uid = $this->input('uid'); + if($this->app['synlogin']) { + if($this->user = $_ENV['user']->get_user_by_uid($uid)) { + $synstr = ''; + foreach($this->cache['apps'] as $appid => $app) { + if($app['synlogin']) { + if($app['appid'] != $this->app['appid']) { + $synstr .= ''; + } + if(isset($app['extra']['extraurl']) && is_array($app['extra']['extraurl'])) foreach($app['extra']['extraurl'] as $extraurl) { + $synstr .= ''; + } + } + } + return $synstr; + } + } + return ''; + } + + function onsynlogout() { + $this->init_input(); + if($this->app['synlogin']) { + $synstr = ''; + foreach($this->cache['apps'] as $appid => $app) { + if($app['synlogin']) { + if($app['appid'] != $this->app['appid']) { + $synstr .= ''; + } + if(isset($app['extra']['extraurl']) && is_array($app['extra']['extraurl'])) foreach($app['extra']['extraurl'] as $extraurl) { + $synstr .= ''; + } + } + } + return $synstr; + } + return ''; + } + + function onregister() { + $this->init_input(); + $username = $this->input('username'); + $password = $this->input('password'); + $email = $this->input('email'); + $questionid = $this->input('questionid'); + $answer = $this->input('answer'); + $regip = $this->input('regip'); + $secmobicc = $this->input('secmobicc'); + $secmobile = $this->input('secmobile'); + + if(($status = $this->_check_username($username)) < 0) { + return $status; + } + if(($status = $this->_check_email($email)) < 0) { + return $status; + } + if(($status = $this->_check_secmobile($secmobicc, $secmobile)) > 0) { + return UC_USER_SECMOBILE_EXISTS; + } + + $uid = $_ENV['user']->add_user($username, $password, $email, 0, $questionid, $answer, $regip, $secmobicc, $secmobile); + return $uid; + } + + function onedit() { + $this->init_input(); + $username = $this->input('username'); + $oldpw = $this->input('oldpw'); + $newpw = $this->input('newpw'); + $email = $this->input('email'); + $ignoreoldpw = $this->input('ignoreoldpw'); + $questionid = $this->input('questionid'); + $answer = $this->input('answer'); + $secmobicc = $this->input('secmobicc'); + $secmobile = $this->input('secmobile'); + + if(!$ignoreoldpw && $email && ($status = $this->_check_email($email, $username)) < 0) { + return $status; + } + if(($status = $this->_check_secmobile($secmobicc, $secmobile, $username)) > 0) { + return UC_USER_SECMOBILE_EXISTS; + } + + $status = $_ENV['user']->edit_user($username, $oldpw, $newpw, $email, $ignoreoldpw, $questionid, $answer, $secmobicc, $secmobile); + + if($newpw && $status > 0) { + $this->load('note'); + $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='); + $_ENV['note']->send(); + } + if($status > 0) { + $tmp = $_ENV['user']->get_user_by_username($username); + $_ENV['user']->user_log($tmp['uid'], 'edituser', 'uid='.$tmp['uid'].'&email='.urlencode($email).'&secmobicc='.urlencode($secmobicc).'&secmobile='.urlencode($secmobile)); + } + return $status; + } + + function onlogin() { + $this->init_input(); + $isuid = $this->input('isuid'); + $username = $this->input('username'); + $password = $this->input('password'); + $checkques = $this->input('checkques'); + $questionid = $this->input('questionid'); + $answer = $this->input('answer'); + $ip = $this->input('ip'); + $nolog = $this->input('nolog'); + + $check_times = $this->settings['login_failedtime'] > 0 ? $this->settings['login_failedtime'] : ($this->settings['login_failedtime'] < 0 ? 0 : 5); + + if($ip && $check_times && !$loginperm = $_ENV['user']->can_do_login($username, $ip)) { + $status = -4; + return array($status, '', $password, '', 0); + } + + if($isuid == 1) { + $user = $_ENV['user']->get_user_by_uid($username); + } elseif($isuid == 2) { + $user = $_ENV['user']->get_user_by_email($username); + } elseif($isuid == 4) { + list($secmobicc, $secmobile) = explode('-', $username); + $user = $_ENV['user']->get_user_by_secmobile($secmobicc, $secmobile); + } else { + $user = $_ENV['user']->get_user_by_username($username); + } + + if(empty($user)) { + $status = -1; + } elseif(!$_ENV['user']->verify_password($password, $user['password'], $user['salt'])) { + $status = -2; + } elseif($checkques && $user['secques'] != $_ENV['user']->quescrypt($questionid, $answer)) { + $status = -3; + } else { + $_ENV['user']->upgrade_password($username, $password, $user['password'], $user['salt']); + $status = $user['uid']; + } + if(!$nolog && $ip && $check_times && $status <= 0) { + $_ENV['user']->loginfailed($username, $ip); + } + $merge = $status != -1 && !$isuid && $_ENV['user']->check_mergeuser($username) ? 1 : 0; + return array($status, $user['username'], $password, $user['email'], $merge); + } + + function onlogincheck() { + $this->init_input(); + $username = $this->input('username'); + $ip = $this->input('ip'); + return $_ENV['user']->can_do_login($username, $ip); + } + + function oncheck_email() { + $this->init_input(); + $email = $this->input('email'); + return $this->_check_email($email); + } + + function oncheck_secmobile() { + $this->init_input(); + $secmobicc = $this->input('secmobicc'); + $secmobile = $this->input('secmobile'); + return $this->_check_secmobile($secmobicc, $secmobile); + } + + function oncheck_username() { + $this->init_input(); + $username = $this->input('username'); + if(($status = $this->_check_username($username)) < 0) { + return $status; + } else { + return 1; + } + } + + function onget_user() { + $this->init_input(); + $username = $this->input('username'); + if(!$this->input('isuid')) { + $status = $_ENV['user']->get_user_by_username($username); + } else { + $status = $_ENV['user']->get_user_by_uid($username); + } + if($status) { + return array($status['uid'],$status['username'],$status['email']); + } else { + return 0; + } + } + + function onchgusername() { + $this->init_input(); + $uid = $this->input('uid'); + $newusername = $this->input('newusername'); + if(($status = $this->_check_username($newusername)) < 0) { + return $status; + } + $user = $_ENV['user']->get_user_by_uid($uid); + $oldusername = $user['username']; + if($_ENV['user']->chgusername($uid, $newusername)) { + $_ENV['user']->user_log($uid, 'renameuser', 'uid='.$uid.'&oldusername='.urlencode($oldusername).'&newusername='.urlencode($newusername)); + $this->load('note'); + $_ENV['note']->add('renameuser', 'uid='.$uid.'&oldusername='.urlencode($oldusername).'&newusername='.urlencode($newusername)); + $_ENV['note']->send(); + return 1; + } + return UC_USER_USERNAME_CHANGE_FAILED; + } + + function ongetprotected() { + $this->init_input(); + $protectedmembers = $this->db->fetch_all("SELECT uid,username FROM ".UC_DBTABLEPRE."protectedmembers GROUP BY username"); + return $protectedmembers; + } + + function ondelete() { + $this->init_input(); + $uid = $this->input('uid'); + return $_ENV['user']->delete_user($uid); + } + + function ondeleteavatar() { + $this->init_input(); + $uid = $this->input('uid'); + $_ENV['user']->delete_useravatar($uid); + } + + function onaddprotected() { + $this->init_input(); + $username = $this->input('username'); + $admin = $this->input('admin'); + $appid = $this->app['appid']; + $usernames = (array)$username; + foreach($usernames as $username) { + $user = $_ENV['user']->get_user_by_username($username); + $uid = $user['uid']; + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."protectedmembers SET uid='$uid', username='$username', appid='$appid', dateline='{$this->time}', admin='$admin'", 'SILENT'); + } + return $this->db->errno() ? -1 : 1; + } + + function ondeleteprotected() { + $this->init_input(); + $username = $this->input('username'); + $appid = $this->app['appid']; + $usernames = (array)$username; + foreach($usernames as $username) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."protectedmembers WHERE username='$username' AND appid='$appid'"); + } + return $this->db->errno() ? -1 : 1; + } + + function onmerge() { + $this->init_input(); + $oldusername = $this->input('oldusername'); + $newusername = $this->input('newusername'); + $uid = $this->input('uid'); + $password = $this->input('password'); + $email = $this->input('email'); + if(($status = $this->_check_username($newusername)) < 0) { + return $status; + } + $uid = $_ENV['user']->add_user($newusername, $password, $email, $uid); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mergemembers WHERE appid='".$this->app['appid']."' AND username='$oldusername'"); + return $uid; + } + + function onmerge_remove() { + $this->init_input(); + $username = $this->input('username'); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mergemembers WHERE appid='".$this->app['appid']."' AND username='$username'"); + return NULL; + } + + function _check_username($username) { + $username = addslashes(trim(stripslashes($username))); + if(!$_ENV['user']->check_username($username)) { + return UC_USER_CHECK_USERNAME_FAILED; + } elseif(!$_ENV['user']->check_usernamecensor($username)) { + return UC_USER_USERNAME_BADWORD; + } elseif($_ENV['user']->check_usernameexists($username)) { + return UC_USER_USERNAME_EXISTS; + } + return 1; + } + + function _check_email($email, $username = '') { + if(!$_ENV['user']->check_emailformat($email)) { + return UC_USER_EMAIL_FORMAT_ILLEGAL; + } elseif(!$_ENV['user']->check_emailaccess($email)) { + return UC_USER_EMAIL_ACCESS_ILLEGAL; + } elseif(!$this->settings['doublee'] && $_ENV['user']->check_emailexists($email, $username)) { + return UC_USER_EMAIL_EXISTS; + } else { + return 1; + } + } + + function _check_secmobile($secmobicc, $secmobile, $username = '') { + return $_ENV['user']->check_secmobileexists($secmobicc, $secmobile, $username); + } + + function ongetcredit($arr) { + $this->init_input(); + $appid = $this->input('appid'); + $uid = $this->input('uid'); + $credit = $this->input('credit'); + $this->load('note'); + $this->load('misc'); + $app = $this->cache['apps'][$appid]; + $url = $_ENV['note']->get_url_code('getcredit', "uid=$uid&credit=$credit", $appid); + return $_ENV['misc']->dfopen($url, 0, '', '', 1, $app['ip'], UC_NOTE_TIMEOUT); + } + + function oncamera() { + $this->view->display('camera'); + } + + function onuploadavatar() { + @header("Expires: 0"); + @header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + $this->init_input(getgpc('agent', 'G'), false); + + $uid = $this->input('uid'); + if(empty($uid)) { + return -1; + } + if(empty($_FILES['Filedata'])) { + return -3; + } + + list($width, $height, $type, $attr) = getimagesize($_FILES['Filedata']['tmp_name']); + if(!in_array($type, array(1,2,3,6))) { + @unlink($_FILES['Filedata']['tmp_name']); + return -4; + } + $imgtype = array(1 => '.gif', 2 => '.jpg', 3 => '.png'); + $filetype = $imgtype[$type]; + if(!$filetype) $filetype = '.jpg'; + $tmpavatar = UC_DATADIR.'./tmp/upload'.$uid.$filetype; + file_exists($tmpavatar) && @unlink($tmpavatar); + if(@copy($_FILES['Filedata']['tmp_name'], $tmpavatar) || @move_uploaded_file($_FILES['Filedata']['tmp_name'], $tmpavatar)) { + @unlink($_FILES['Filedata']['tmp_name']); + list($width, $height, $type, $attr) = getimagesize($tmpavatar); + if($width < 10 || $height < 10 || $type == 4) { + @unlink($tmpavatar); + return -2; + } + } else { + @unlink($_FILES['Filedata']['tmp_name']); + return -4; + } + $avatarurl = UC_DATAURL.'/tmp/upload'.$uid.$filetype; + return $avatarurl; + } + + function onrectavatar() { + @header("Expires: 0"); + @header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE); + @header("Pragma: no-cache"); + if(getgpc('base64', 'G')){ + header("Content-type: text/html; charset=utf-8"); + }else{ + header("Content-type: application/xml; charset=utf-8"); + } + $this->init_input(getgpc('agent'), false); + $uid = $this->input('uid'); + if(empty($uid)) { + return ''; + } + $home = $this->get_home($uid); + if(!defined('UC_UPAVTDIR')) { + define('UC_UPAVTDIR', UC_DATADIR.'./avatar/'); + } + if(!is_dir(UC_UPAVTDIR.$home)) { + $this->set_home($uid, UC_UPAVTDIR); + } + $avatartype = getgpc('avatartype', 'G') == 'real' ? 'real' : 'virtual'; + $bigavatarfile = UC_UPAVTDIR.$this->get_avatar($uid, 'big', $avatartype); + $middleavatarfile = UC_UPAVTDIR.$this->get_avatar($uid, 'middle', $avatartype); + $smallavatarfile = UC_UPAVTDIR.$this->get_avatar($uid, 'small', $avatartype); + $bigavatar = $this->flashdata_decode(getgpc('avatar1', 'P')); + $middleavatar = $this->flashdata_decode(getgpc('avatar2', 'P')); + $smallavatar = $this->flashdata_decode(getgpc('avatar3', 'P')); + if(!$bigavatar || !$middleavatar || !$smallavatar) { + return ''; + } + + $success = 1; + $fp = @fopen($bigavatarfile, 'wb'); + @fwrite($fp, $bigavatar); + @fclose($fp); + + $fp = @fopen($middleavatarfile, 'wb'); + @fwrite($fp, $middleavatar); + @fclose($fp); + + $fp = @fopen($smallavatarfile, 'wb'); + @fwrite($fp, $smallavatar); + @fclose($fp); + + $biginfo = @getimagesize($bigavatarfile); + $middleinfo = @getimagesize($middleavatarfile); + $smallinfo = @getimagesize($smallavatarfile); + if(!$biginfo || !$middleinfo || !$smallinfo || $biginfo[2] == 4 || $middleinfo[2] == 4 || $smallinfo[2] == 4 + || $biginfo[0] > 200 || $biginfo[1] > 250 || $middleinfo[0] > 120 || $middleinfo[1] > 120 || $smallinfo[0] > 48 || $smallinfo[1] > 48) { + file_exists($bigavatarfile) && unlink($bigavatarfile); + file_exists($middleavatarfile) && unlink($middleavatarfile); + file_exists($smallavatarfile) && unlink($smallavatarfile); + $success = 0; + } + + if(getgpc('base64', 'G')){ + if($success) { + return ""; + } else { + return ""; + } + }else{ + $filetype = '.jpg'; + @unlink(UC_DATADIR.'./tmp/upload'.$uid.$filetype); + if($success) { + return ''; + } else { + return ''; + } + } + } + + + function flashdata_decode($s) { + $r = ''; + if(getgpc('base64', 'G')){ + $r = base64_decode($s); + }else{ + $l = strlen($s); + for($i=0; $i<$l; $i=$i+2) { + $k1 = ord($s[$i]) - 48; + $k1 -= $k1 > 9 ? 7 : 0; + $k2 = ord($s[$i+1]) - 48; + $k2 -= $k2 > 9 ? 7 : 0; + $r .= chr($k1 << 4 | $k2); + } + } + return $r; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/control/version.php b/uc_server/control/version.php new file mode 100644 index 0000000..3f40def --- /dev/null +++ b/uc_server/control/version.php @@ -0,0 +1,31 @@ +versioncontrol(); + } + + function versioncontrol() { + parent::__construct(); + $this->load('version'); + } + + function oncheck() { + $db_version = $_ENV['version']->check(); + $return = array('file' => UC_SERVER_VERSION, 'db' => $db_version); + return $return; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/crossdomain.xml b/uc_server/crossdomain.xml new file mode 100644 index 0000000..060b9e3 --- /dev/null +++ b/uc_server/crossdomain.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/uc_server/data/avatar/index.htm b/uc_server/data/avatar/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/data/avatar/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/data/avatar/noavatar.svg b/uc_server/data/avatar/noavatar.svg new file mode 100644 index 0000000..2231f3d --- /dev/null +++ b/uc_server/data/avatar/noavatar.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uc_server/data/backup/index.htm b/uc_server/data/backup/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/data/backup/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/data/cache/apps.php b/uc_server/data/cache/apps.php new file mode 100644 index 0000000..d88d9ff --- /dev/null +++ b/uc_server/data/cache/apps.php @@ -0,0 +1,23 @@ + + array ( + 'appid' => '1', + 'type' => 'DISCUZX', + 'name' => 'Discuz! Board', + 'url' => 'http://localhost:8080/discuz', + 'authkey' => 'ec685982r273EdT4RaReHar6q3C1877dE5tdKeObudH913iaC0V4V630m6X57bmb', + 'ip' => '', + 'viewprourl' => '', + 'apifilename' => 'uc.php', + 'charset' => 'utf-8', + 'dbcharset' => 'utf8mb4', + 'synlogin' => '1', + 'recvnote' => '1', + 'extra' => '', + 'tagtemplates' => '', + 'allowips' => '', + ), +); + +?> \ No newline at end of file diff --git a/uc_server/data/cache/index.htm b/uc_server/data/cache/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/data/cache/settings.php b/uc_server/data/cache/settings.php new file mode 100644 index 0000000..d41197b --- /dev/null +++ b/uc_server/data/cache/settings.php @@ -0,0 +1,35 @@ + '', + 'addappbyurl' => '0', + 'censoremail' => '', + 'censorusername' => '', + 'chatpmmemberlimit' => '35', + 'chatpmthreadlimit' => '30', + 'dateformat' => 'y-n-j', + 'doublee' => '0', + 'insecureoperation' => '0', + 'login_failedtime' => '5', + 'mailauth' => '1', + 'mailauth_password' => 'password', + 'mailauth_username' => 'username@21cn.com', + 'maildefault' => 'username@21cn.com', + 'maildelimiter' => '0', + 'mailfrom' => 'UCenter ', + 'mailport' => '25', + 'mailsend' => '1', + 'mailserver' => 'smtp.21cn.com', + 'mailsilent' => '1', + 'mailtimeout' => '30', + 'mailusername' => '1', + 'nextnotetime' => '0', + 'pmcenter' => '1', + 'pmfloodctrl' => '15', + 'pmsendregdays' => '0', + 'privatepmthreadlimit' => '25', + 'sendpmseccode' => '1', + 'timeoffset' => '28800', + 'version' => '1.7.0', +); + +?> \ No newline at end of file diff --git a/uc_server/data/config.inc.php b/uc_server/data/config.inc.php new file mode 100644 index 0000000..89b13b6 --- /dev/null +++ b/uc_server/data/config.inc.php @@ -0,0 +1,21 @@ + 'HTTP_X_FORWARDED_FOR'))); diff --git a/uc_server/data/index.htm b/uc_server/data/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/data/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/data/install.lock b/uc_server/data/install.lock new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/data/tmp/index.htm b/uc_server/data/tmp/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/data/upgrade.lock b/uc_server/data/upgrade.lock new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/data/view/admin_login.php b/uc_server/data/view/admin_login.php new file mode 100644 index 0000000..cdf6ae7 --- /dev/null +++ b/uc_server/data/view/admin_login.php @@ -0,0 +1,67 @@ + +gettpl('header');?> + + +
                                    +
                                    target="_self"target="_top"> + + + + + + + + +
                                    +

                                    UCenter

                                    +

                                    UCenter 是一个能沟通多个应用的桥梁,使各应用共享一个用户数据库,实现统一登录,注册,用户管理。

                                    +
                                    +
                                    +
                                    + + +gettpl('footer');?> \ No newline at end of file diff --git a/uc_server/data/view/footer.php b/uc_server/data/view/footer.php new file mode 100644 index 0000000..de82afa --- /dev/null +++ b/uc_server/data/view/footer.php @@ -0,0 +1,35 @@ + + + +
                                    + Processed in s +
                                    + GET: + '.print_r($_GET, TRUE).'';?> +
                                    +
                                    + POST: + '.print_r($_POST, TRUE).'';?> +
                                    +
                                    + COOKIE: + '.print_r($_COOKIE, TRUE).'';?> +
                                    +
                                    + SQL: + +
                                  • + +
                                    +
                                    + Include: + '.print_r(get_included_files(), TRUE).'';?> +
                                    +
                                    + + + + \ No newline at end of file diff --git a/uc_server/data/view/header.php b/uc_server/data/view/header.php new file mode 100644 index 0000000..6768dc6 --- /dev/null +++ b/uc_server/data/view/header.php @@ -0,0 +1,56 @@ + + + + + +UCenter Administrator's Control Panel + + + +
                                    + + 菜单 + + + diff --git a/uc_server/data/view/index.htm b/uc_server/data/view/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/images/admincp.css b/uc_server/images/admincp.css new file mode 100644 index 0000000..ed857a6 --- /dev/null +++ b/uc_server/images/admincp.css @@ -0,0 +1,184 @@ +/* +Offical Style for UCenter +(C) 2001-2099 Comsenz Inc. +*/ + +/* common */ +*{ word-wrap:break-word; outline:none; } +body{ background:#FFF; text-align:center; } +body, td, input, textarea, select, button{ color:#666; font:12px "Lucida Grande", Verdana, Lucida, Helvetica, Arial, 'Simsun', sans-serif; } +body, ul, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin:0; padding:0; } +h1, h2, h3, h4, h5, h6{ font-size:12px; } +a{ color:#2366A8; text-decoration:none; } + a:hover { text-decoration:underline; } + a img{ border:none; } +em, cite, th{ font-style:normal; font-weight:normal; } +table{ border-collapse:collapse; } + +/* form */ +textarea, input{ padding:2px; border:1px solid; border-color:#666 #eee #eee #666; } +input.txt:hover, input.txt:focus, textarea:hover, textarea:focus{ border-color:#09C; background:#F5F9FD; } +.radio{ margin-top:-1px; border:none; vertical-align:middle; } +.checkbox{ height:14px; border:none; vertical-align:middle; } +.btn{ margin:3px 0; padding:2px 5px; *padding:4px 5px 1px; border-color:#ddd #666 #666 #ddd; background:#DDD; color:#000; cursor:pointer; } +.sgbtn{ margin-left:20px; padding:3px 7px; *padding:4px 7px 2px; border:1px solid #B5CFD9; background:#F2F9FD; color:#666; font-size:12px; font-weight:400; } + .sgbtn:hover{ text-decoration:none; } +.bigarea{ margin-left:5px; width:230px; height:120px; } + +/* main header */ +.mainhd{ text-align:left; height:69px; line-height:69px; background:url(bg_repx.gif) repeat-x; } + .logo{ float:left; text-indent:-9999px; width:321px; height:46px; background:url(bg_repno.gif) no-repeat 29px 20px; } + .uinfo{ float:right; display:inline; margin-right:40px; } + .uinfo a{ color:#666; } + .uinfo em{ margin-right:5px; font-weight:700; } + .uinfo p{ float:left; } + .othersoff, .otherson{ display:block; margin:10px 0 0 25px; width:151px; height:30px; line-height:30px; text-align:center; background:url(bg_repno.gif) no-repeat 0 -680px; outline:none; } + .otherson{ background:url(bg_repno.gif) no-repeat 0 -650px; } + .othersoff:hover, .otherson:hover{ text-decoration:none; } + + +/* menu */ +.togglemenu{ position:absolute; z-index:1000; width:149px; *width:151px; text-align:left; border:1px solid #B5CFD9; border-top:none; background:#FFF; opacity:0.8; filter:Alpha(opacity=80); } + .togglemenu ul{ list-style:none; margin:0 2px 2px; padding:10px 0; background:url(bg_repx_hd.gif) repeat-x; } + .togglemenu a{ display:block; padding:5px 15px; color:#666; text-decoration:underline; } + .togglemenu a:hover{ color:#09C; } + +/* header_menu */ +#header_menu { text-align: right; padding-right: 20px; cursor:pointer; } + +/* box */ +.container{ padding:20px; text-align:left; } +.note{ margin:5px 0; padding:10px; width:580px; border:1px solid #B5CFD9; background:#F5F9FD; } + .i{ padding-left:22px; line-height:19px; background:url(bg_repno.gif) no-repeat -275px -100px; } + .i a{ text-decoration:underline; } + .i a:hover{ text-decoration:none; } +.mainbox{ margin:10px 0; } +.opt{ clear:both; overflow:hidden; } + .opt th{ padding:5px 0; font-weight:700; text-align:left; } + .opt td{ padding-bottom:10px; } + .opt .txt, .opt textarea{ vertical-align:middle; margin-right:10px; width:250px; } + .opt select{ vertical-align:middle; margin-right:10px; } + .opt .area{ height:80px; } + .opt .bigarea { width: 500px; height: 80px; } + .opt label{ margin-right:20px; } + .opt p{ float:left; line-height:180%; } + .correct td{ color:#090; } + .correct .txt{ padding-right:20px; width:160px; background:url(bg_repno.gif) no-repeat 165px -198px; } + .error td{ color:#F60; } + .error .txt{ padding-right:20px; width:160px; background:url(bg_repno.gif) no-repeat 167px -346px; } +.datalist{ clear:both; width:100%; border-top:2px solid #B5CFD9; border-bottom:2px solid #B5CFD9; } + .datalist th{ line-height:250%; text-align:left; background:url(bg_repx.gif) repeat-x 0 bottom; color:#9EBECB; font-size:12px; } + .datalist td{ padding:5px 0; background:url(bg_repx.gif) repeat-x 0 bottom; } + .currenttr td{ background:#F2F9FD url(bg_repx.gif) repeat-x 0 bottom; } + .datalist a{ text-decoration:underline; } + .datalist a:hover{ text-decoration:none; } + .datalist .txt{ width:90%; overflow:hidden; } + .datalist .txtnobd{ width:90%; border:1px solid #FFF; text-align:right; overflow:hidden; cursor:pointer;} + .datalist .bigarea { width: 500px; height: 80px; } + .tdinput{ padding:0 30px 5px 0; width:160px; } + .tdarrow{ width:20px; } + .option{ width:10%; } + .username{ width:20%; font-weight:700; } + .date{ width:25%; } + .ip{ width:15%; } +.fixwidth{ width: 100%; } + .fixwidthdec{ width:580px; } +#loginform{ overflow:hidden; margin:90px auto; *padding-top:90px; width:590px; } +.login{ float:left; margin-top:5px; text-align:right; font:bold 14px Tahoma, 'Simsun', Sans-serif; } + .login p{ margin:10px 5px; } + .loginbtn{ padding-left:53px; text-align:left; } + .login .txt{ width:160px; } + .login .seccode { margin-right:5px; width:85px; } + .checkcode{ margin-top:-3px; *margin-top:-6px; width:70px; height:21px; cursor:pointer; vertical-align:middle; } + .rstpsw { margin-left:10px; font-size:12px; font-weight:400; } +.loginbox{ padding-right:40px; width:290px; height:120px; line-height:150%; background:url(bg_login.gif) no-repeat right 50%; } + .loginbox h1{ text-indent:-9999px; margin:10px 0 10px; height:25px; background:url(bg_repno.gif) no-repeat 0 -750px; } +.ajax{ width:360px; border:1px solid #89B3C2; } + .ajaxbg{ margin:2px; padding:15px; background:url(bg_repx_hc.gif) repeat-x; } + .alert{ padding-left:40px; background:url(bg_repno.gif) no-repeat 0 -500px; } + .alert h4{ margin-bottom:3px; font-size:14px; } + .alert p{ margin-bottom:12px; color:#09C; } + .alert .btn{ vertical-align:middle; } + .alert a.abtn{ margin-left:20px; text-decoration:underline; } + .alert a.abtn:hover{ text-decoration:none; } +.errormsg{ margin:10px 0; padding:10px; width:580px; border:1px solid #DD3D11; background:#FFEBEB; } + .errormsg p{ padding-left:15px; background:url(bg_repno.gif) no-repeat -300px -648px; } + .errormsg em{ color:#DD3D11; font-weight:700; } +.correctmsg{ margin:10px 0; padding:10px; width:580px; border:1px solid #4EBB20; background:#FCFFF0; } + .correctmsg p{ padding-left:17px; background:url(bg_repno.gif) no-repeat -335px -598px; } + .correctmsg em{ color:#4EBB20; font-weight:700; } +.loginmsg{ position:absolute; margin:-45px 0 0 5px; *margin:-45px 0 0 -73px; width:197px; line-height:150%; text-align:left; font-size:12px; font-weight:400; } + .loginmsg p{ margin:0; } +.rtninfo{ margin:50px auto; width:500px; line-height:180%; } + .rtninfo h4{ margin-bottom:10px; padding-left:25px; background:url(bg_repno.gif) no-repeat -275px -98px; font-size:14px; } + .rtninfo p{ margin-left:25px; } +.footer{ display:block; line-height:25px; } + +/* tabmenu */ +.hastabmenu{ position:relative; height:90px; width: 580px; } + .tabmenu{ position:absolute; z-index:80; list-style:none; } + .tabmenu li{ float:left; margin-right:5px; } + .tabmenu li a, .tabmenu .tabcurrent a{ display:block; padding: 0 7px; height: 21px; line-height: 21px; border:1px solid #CCC; border-bottom:1px solid #B5CFD9; color:#666; } + * html .tabmenu li a { float: left; height: 20px; line-height: 20px; } + *+html .tabmenu li a { height: 20px; line-height: 20px; } + .tabmenu li a:hover{ text-decoration:none; } + .tabmenu .tabcurrent a{ border:1px solid #B5CFD9; border-bottom:1px solid #F2F9FD; background:#F2F9FD; } + .tabcontent, .tabcontentcur{ position:absolute; top:22px; *top:21px; z-index:70; padding:10px; width:580px; border:1px solid #CCC; } + .tabcontentcur{ border:1px solid #B5CFD9; background:#F2F9FD; } + .tabcontent .txt, .tabcontentcur .txt{ margin-right:10px; width:110px; } + .tabcontent .btn, .tabcontentcur .btn{ margin-left:5px; } + +/* table */ +.dbtb{ clear:both; width:100%; } + .tbtitle{ padding:5px 0; width:70px; } + .dbtb .btn{ margin-left:0; } + +/* pages */ +.tdpage{ text-align:right; } +.pages{ clear:both; margin:10px 0; } + .pages em, .pages a, .pages strong{ text-decoration:none; margin-left:5px; padding:2px 5px; border:1px solid #E5E5E5; } + .pages a:hover{ text-decoration:none; border:1px solid #09C; background:#09C; color:#FFF; } + .pages strong{ border:none; font-weight:700; } + .pages kbd { margin-left: 5px; } + +/* title */ +h3{ font-size:14px; } + h3 .btn{ margin-left:10px; vertical-align:middle; } + +/* list */ +.dblist{ list-style:none; margin-top:5px; } + .dblist li{ float:left; margin:0 0 0 -3px; *margin:0 0 5px -3px; width:25%; height:auto; *height:16px; } +.memlist{ list-style:none; margin:7px 0 25px; padding-top:2px; border-top:2px solid #B5CFD9; } + .memlist li{ clear:both; overflow:hidden; zoom:1; padding:5px 0; *padding:1px 0 5px; line-height:150%; background:url(bg_repx.gif) repeat-x 0 bottom; } + .memlist em{ float:left; width:120px; } + .memlist .memcont{ width:480px; } +.tiplist{ float:right; list-style:none; width:320px; } + .tiplist li{ line-height:160%; } +.optlist{ clear:both; list-style:none; margin:5px 0; width:100%; } + .optlist li{ line-height:180%; } + +/* calendar */ +.table1 th{ padding:5px; } +.table1 td{ padding:2px 5px; } +.calendarmenu{ position:absolute; padding:9px 0 0 9px; *padding:9px; border:1px solid #B5CFD9; background:#FFF; opacity:0.8; filter:Alpha(opacity=80); } + +/* widget */ +.statimg{ vertical-align:middle; margin:0 5px 2px 0 !important; *margin:0 5px 0 0 !important; *margin:0 5px 2px 0; } +.avt {vertical-align: middle; width: 48px; height: 48px;} +.line{ clear:both; position:relative; margin:10px 0; border-top:1px solid #CCC; } + .line p{ position:absolute; top:14px; right:50px; font-weight:700; } +.margintop{ margin-top:10px; } +.marginbot{ margin-bottom:10px; } +.nomargin{ margin:0; } +.nobg{ background:none; } + .nobg td{ background:none; } +.center{ text-align:center; } +.bold{ font-weight:700; } +.red{ color:red; } +.green{ color:green; } + + +.tabhead {width: 100%; clear: both; background: url(images/bg_tab_line.gif) repeat-x bottom;} + .tabhead li{line-height: 1.2em; display:block; padding:5px 7px 2px 7px; border:1px solid #CCC; border-bottom:0px solid #B5CFD9; color:#666; float:left; margin-right:5px;} + .tabhead li.checked{background:#F2F9FD; font-weight: 800} +.tabbody {padding: 1em; clear: both; border:1px solid #B5CFD9; border-top: 0px; background:#F2F9FD; } diff --git a/uc_server/images/avatar/arrow_down_big.gif b/uc_server/images/avatar/arrow_down_big.gif new file mode 100644 index 0000000..0bab7c8 Binary files /dev/null and b/uc_server/images/avatar/arrow_down_big.gif differ diff --git a/uc_server/images/avatar/avatar.css b/uc_server/images/avatar/avatar.css new file mode 100644 index 0000000..f48a576 --- /dev/null +++ b/uc_server/images/avatar/avatar.css @@ -0,0 +1,1308 @@ +/*! jQuery UI - v1.11.4 - 2015-03-11 +* http://jqueryui.com +* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); /* support: IE8 */ +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ + font-size: 100%; +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 45%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + overflow: hidden; + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + position: absolute; +} +.ui-menu .ui-menu-item { + position: relative; + margin: 0; + padding: 3px 1em 3px .4em; + cursor: pointer; + min-height: 0; /* support: IE7 */ + /* support: IE10, see #8844 */ + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); +} +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item { + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + left: auto; + right: 0; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + filter: alpha(opacity=25); /* support: IE8 */ + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable { + -ms-touch-action: none; + touch-action: none; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none; +} +.ui-selectmenu-menu .ui-menu { + overflow: auto; + /* Support: IE7 */ + overflow-x: hidden; + padding-bottom: 1px; +} +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0; +} +.ui-selectmenu-open { + display: block; +} +.ui-selectmenu-button { + display: inline-block; + overflow: hidden; + position: relative; + text-decoration: none; + cursor: pointer; +} +.ui-selectmenu-button span.ui-icon { + right: 0.5em; + left: auto; + margin-top: -8px; + position: absolute; + top: 50%; +} +.ui-selectmenu-button span.ui-selectmenu-text { + text-align: left; + padding: 0.4em 2.1em 0.4em 1em; + display: block; + line-height: 1.4; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; + -ms-touch-action: none; + touch-action: none; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* support: IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to override default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertically center icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text; +} +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff url("ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url("ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #d3d3d3; + background: #e6e6e6 url("ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999; + background: #dadada url("ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited { + color: #212121; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #aaaaaa; + background: #ffffff url("ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url("ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url("ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); /* support: IE8 */ + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); /* support: IE8 */ + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("ui-icons_222222_256x240.png"); +} +.ui-widget-header .ui-icon { + background-image: url("ui-icons_222222_256x240.png"); +} +.ui-state-default .ui-icon { + background-image: url("ui-icons_888888_256x240.png"); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url("ui-icons_454545_256x240.png"); +} +.ui-state-active .ui-icon { + background-image: url("ui-icons_454545_256x240.png"); +} +.ui-state-highlight .ui-icon { + background-image: url("ui-icons_2e83ff_256x240.png"); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("ui-icons_cd0a0a_256x240.png"); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa url("ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ +} +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url("ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ + border-radius: 8px; +} + +/* Avatar */ +#avatardesigner{border: 1px solid #CCC; padding: 10px;overflow: hidden;} +#avataradjuster, #avatardisplayer{position: relative; display:none;} +#avatardisplaycanvas{position: absolute; top: 0px; left: 0px;background:#FFF;} +#avatarfileselector{ + background:url(avatar_upload.gif) no-repeat; + position:relative; +} +#avatarfile{ + font-size: 300px; + position:absolute; + right:0; + top:0; + opacity: 0; + filter:alpha(opacity=0); + cursor:pointer; +} +.backfileselectiondiv{ + width: 104px; + height: 33px; + position: absolute; + right: 8px; + top: 0px; + background:url(avatar_back.gif) no-repeat; +} +.backfileselection{ + width: 104px; + height: 33px; + padding: 2px; + position:absolute; + right:0; + top:0; + opacity: 0; + filter:alpha(opacity=0); + cursor:pointer; + border:none; +} +.saveAvatardiv{ + width: 104px; + height: 39px; + position: absolute; + right: 8px; + top: 180px; + background:url(avatar_save.gif) no-repeat; +} +.saveAvatar{ + width: 104px; + height: 39px; + padding: 2px; + position:absolute; + right:0; + top:0; + opacity: 0; + filter:alpha(opacity=0); + border:none; + cursor:pointer; +} +.finishbuttondiv{ + width: 92px; + height: 33px; + position: absolute; + right: 60px; + top: 190px; + background:url(avatar_finishbutton.gif) no-repeat; +} +.finishbutton{ + width: 92px; + height: 33px; + padding: 2px; + position:absolute; + right:0; + top:0; + opacity: 0; + filter:alpha(opacity=0); + cursor:pointer; + border: none; +} +#slider .ui-state-default { + background: white url(arrow_down_big.gif) no-repeat scroll 50% 50%; + margin-top: -8px; + border-width: 0px; +} \ No newline at end of file diff --git a/uc_server/images/avatar/avatar_back.gif b/uc_server/images/avatar/avatar_back.gif new file mode 100644 index 0000000..b97a716 Binary files /dev/null and b/uc_server/images/avatar/avatar_back.gif differ diff --git a/uc_server/images/avatar/avatar_blank.gif b/uc_server/images/avatar/avatar_blank.gif new file mode 100644 index 0000000..4f79f90 Binary files /dev/null and b/uc_server/images/avatar/avatar_blank.gif differ diff --git a/uc_server/images/avatar/avatar_finishback.png b/uc_server/images/avatar/avatar_finishback.png new file mode 100644 index 0000000..e231716 Binary files /dev/null and b/uc_server/images/avatar/avatar_finishback.png differ diff --git a/uc_server/images/avatar/avatar_finishbutton.gif b/uc_server/images/avatar/avatar_finishbutton.gif new file mode 100644 index 0000000..d139dd3 Binary files /dev/null and b/uc_server/images/avatar/avatar_finishbutton.gif differ diff --git a/uc_server/images/avatar/avatar_lattice.png b/uc_server/images/avatar/avatar_lattice.png new file mode 100644 index 0000000..f9eed6c Binary files /dev/null and b/uc_server/images/avatar/avatar_lattice.png differ diff --git a/uc_server/images/avatar/avatar_save.gif b/uc_server/images/avatar/avatar_save.gif new file mode 100644 index 0000000..bffd7db Binary files /dev/null and b/uc_server/images/avatar/avatar_save.gif differ diff --git a/uc_server/images/avatar/avatar_upload.gif b/uc_server/images/avatar/avatar_upload.gif new file mode 100644 index 0000000..ad8557c Binary files /dev/null and b/uc_server/images/avatar/avatar_upload.gif differ diff --git a/uc_server/images/avatar/index.htm b/uc_server/images/avatar/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/images/avatar/ui-bg_flat_0_aaaaaa_40x100.png b/uc_server/images/avatar/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000..e26ee47 Binary files /dev/null and b/uc_server/images/avatar/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/uc_server/images/avatar/ui-bg_flat_75_ffffff_40x100.png b/uc_server/images/avatar/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000..e6d4c32 Binary files /dev/null and b/uc_server/images/avatar/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/uc_server/images/avatar/ui-bg_glass_55_fbf9ee_1x400.png b/uc_server/images/avatar/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000..564344c Binary files /dev/null and b/uc_server/images/avatar/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/uc_server/images/avatar/ui-bg_glass_65_ffffff_1x400.png b/uc_server/images/avatar/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..806b7b9 Binary files /dev/null and b/uc_server/images/avatar/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/uc_server/images/avatar/ui-bg_glass_75_dadada_1x400.png b/uc_server/images/avatar/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000..d9247b5 Binary files /dev/null and b/uc_server/images/avatar/ui-bg_glass_75_dadada_1x400.png differ diff --git a/uc_server/images/avatar/ui-bg_glass_75_e6e6e6_1x400.png b/uc_server/images/avatar/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000..0c61899 Binary files /dev/null and b/uc_server/images/avatar/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/uc_server/images/avatar/ui-bg_glass_95_fef1ec_1x400.png b/uc_server/images/avatar/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 0000000..9aa5c32 Binary files /dev/null and b/uc_server/images/avatar/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/uc_server/images/avatar/ui-bg_highlight-soft_75_cccccc_1x100.png b/uc_server/images/avatar/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000..bf6e3db Binary files /dev/null and b/uc_server/images/avatar/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/uc_server/images/avatar/ui-icons_222222_256x240.png b/uc_server/images/avatar/ui-icons_222222_256x240.png new file mode 100644 index 0000000..2370c12 Binary files /dev/null and b/uc_server/images/avatar/ui-icons_222222_256x240.png differ diff --git a/uc_server/images/avatar/ui-icons_2e83ff_256x240.png b/uc_server/images/avatar/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000..0597f19 Binary files /dev/null and b/uc_server/images/avatar/ui-icons_2e83ff_256x240.png differ diff --git a/uc_server/images/avatar/ui-icons_454545_256x240.png b/uc_server/images/avatar/ui-icons_454545_256x240.png new file mode 100644 index 0000000..f45f4cf Binary files /dev/null and b/uc_server/images/avatar/ui-icons_454545_256x240.png differ diff --git a/uc_server/images/avatar/ui-icons_888888_256x240.png b/uc_server/images/avatar/ui-icons_888888_256x240.png new file mode 100644 index 0000000..5b74d64 Binary files /dev/null and b/uc_server/images/avatar/ui-icons_888888_256x240.png differ diff --git a/uc_server/images/avatar/ui-icons_cd0a0a_256x240.png b/uc_server/images/avatar/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..21121f4 Binary files /dev/null and b/uc_server/images/avatar/ui-icons_cd0a0a_256x240.png differ diff --git a/uc_server/images/bg_login.gif b/uc_server/images/bg_login.gif new file mode 100644 index 0000000..b356e28 Binary files /dev/null and b/uc_server/images/bg_login.gif differ diff --git a/uc_server/images/bg_repno.gif b/uc_server/images/bg_repno.gif new file mode 100644 index 0000000..44838f3 Binary files /dev/null and b/uc_server/images/bg_repno.gif differ diff --git a/uc_server/images/bg_repx.gif b/uc_server/images/bg_repx.gif new file mode 100644 index 0000000..bb11b71 Binary files /dev/null and b/uc_server/images/bg_repx.gif differ diff --git a/uc_server/images/bg_repx_h.gif b/uc_server/images/bg_repx_h.gif new file mode 100644 index 0000000..20fd8cb Binary files /dev/null and b/uc_server/images/bg_repx_h.gif differ diff --git a/uc_server/images/bg_repx_hb.gif b/uc_server/images/bg_repx_hb.gif new file mode 100644 index 0000000..ebfcc17 Binary files /dev/null and b/uc_server/images/bg_repx_hb.gif differ diff --git a/uc_server/images/bg_repx_hc.gif b/uc_server/images/bg_repx_hc.gif new file mode 100644 index 0000000..8d9de5f Binary files /dev/null and b/uc_server/images/bg_repx_hc.gif differ diff --git a/uc_server/images/bg_repx_hd.gif b/uc_server/images/bg_repx_hd.gif new file mode 100644 index 0000000..82bad8a Binary files /dev/null and b/uc_server/images/bg_repx_hd.gif differ diff --git a/uc_server/images/bg_repy.gif b/uc_server/images/bg_repy.gif new file mode 100644 index 0000000..f9664d7 Binary files /dev/null and b/uc_server/images/bg_repy.gif differ diff --git a/uc_server/images/bg_tab_line.gif b/uc_server/images/bg_tab_line.gif new file mode 100644 index 0000000..081acf9 Binary files /dev/null and b/uc_server/images/bg_tab_line.gif differ diff --git a/uc_server/images/correct.gif b/uc_server/images/correct.gif new file mode 100644 index 0000000..89698ce Binary files /dev/null and b/uc_server/images/correct.gif differ diff --git a/uc_server/images/default/btnbg.gif b/uc_server/images/default/btnbg.gif new file mode 100644 index 0000000..aa8e2e2 Binary files /dev/null and b/uc_server/images/default/btnbg.gif differ diff --git a/uc_server/images/default/citeicon.gif b/uc_server/images/default/citeicon.gif new file mode 100644 index 0000000..f9dd38c Binary files /dev/null and b/uc_server/images/default/citeicon.gif differ diff --git a/uc_server/images/default/codeicon.gif b/uc_server/images/default/codeicon.gif new file mode 100644 index 0000000..8cbfe0f Binary files /dev/null and b/uc_server/images/default/codeicon.gif differ diff --git a/uc_server/images/default/editor.gif b/uc_server/images/default/editor.gif new file mode 100644 index 0000000..353fb3e Binary files /dev/null and b/uc_server/images/default/editor.gif differ diff --git a/uc_server/images/default/headerbg.gif b/uc_server/images/default/headerbg.gif new file mode 100644 index 0000000..85581ad Binary files /dev/null and b/uc_server/images/default/headerbg.gif differ diff --git a/uc_server/images/default/index.htm b/uc_server/images/default/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/images/default/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/images/default/moreuser.gif b/uc_server/images/default/moreuser.gif new file mode 100644 index 0000000..f3b1cf9 Binary files /dev/null and b/uc_server/images/default/moreuser.gif differ diff --git a/uc_server/images/default/navbg.gif b/uc_server/images/default/navbg.gif new file mode 100644 index 0000000..e617c62 Binary files /dev/null and b/uc_server/images/default/navbg.gif differ diff --git a/uc_server/images/default/navborder.gif b/uc_server/images/default/navborder.gif new file mode 100644 index 0000000..86b7355 Binary files /dev/null and b/uc_server/images/default/navborder.gif differ diff --git a/uc_server/images/default/navonbg.gif b/uc_server/images/default/navonbg.gif new file mode 100644 index 0000000..4dd6dcf Binary files /dev/null and b/uc_server/images/default/navonbg.gif differ diff --git a/uc_server/images/default/newpm.gif b/uc_server/images/default/newpm.gif new file mode 100644 index 0000000..702f16e Binary files /dev/null and b/uc_server/images/default/newpm.gif differ diff --git a/uc_server/images/default/selectpm.gif b/uc_server/images/default/selectpm.gif new file mode 100644 index 0000000..ea2f14b Binary files /dev/null and b/uc_server/images/default/selectpm.gif differ diff --git a/uc_server/images/default/sendpm.gif b/uc_server/images/default/sendpm.gif new file mode 100644 index 0000000..b935725 Binary files /dev/null and b/uc_server/images/default/sendpm.gif differ diff --git a/uc_server/images/default/shrink.gif b/uc_server/images/default/shrink.gif new file mode 100644 index 0000000..b77031b Binary files /dev/null and b/uc_server/images/default/shrink.gif differ diff --git a/uc_server/images/default/spread.gif b/uc_server/images/default/spread.gif new file mode 100644 index 0000000..a9f1f82 Binary files /dev/null and b/uc_server/images/default/spread.gif differ diff --git a/uc_server/images/default/style.css b/uc_server/images/default/style.css new file mode 100644 index 0000000..d824e4c --- /dev/null +++ b/uc_server/images/default/style.css @@ -0,0 +1,137 @@ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Common Style ~~~~ */ + +* { word-wrap: break-word; } +body { background: #FFF; text-align: center; } +* html body { width: expression(document.body.scrollHeight >= document.documentElement.clientHeight ? '780px' : ''); } +body, td, input, textarea, select, button { color: #000; font: 12px/1.6em Helvetica, Arial, sans-serif; } +body, ul, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin: 0; padding: 0; } +h1, h2, h3, h4, h5, h6 { font-size: 1em; } +#menu li, .popupmenu_popup li, #announcement li, .portalbox li, .tabs li, .postmessage fieldset li, .side li, .formbox li, .notice li { list-style: none; } +a { color: #000; text-decoration: none; } + a:hover { text-decoration: underline; } + a img { border: none; } +em, cite, strong, th { font-style: normal; font-weight: normal; } +table { empty-cells: show; border-collapse: collapse; } +.bold { font-weight: bold; } + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ucbox~~~~ */ +.ucbody { text-align: left; } +h1 { height: 32px; line-height: 32px; background: url(headerbg.gif) repeat-x 50%; border-bottom: 1px solid #CAD9EA; color: #005C89; font-size: 1.13em; padding-left: 1em; } +.ucnav { height: 35px; line-height: 35px; margin: 10px 10px 0; color:#666; background: url(navbg.gif) repeat-x 50%; border: solid #DEDEDE; border-width: 1px 1px 0; } + .ucnav a { float: left; height: 29px; line-height: 29px; margin: 4px 0 0 4px; padding: 0 10px; background: #EFEFEF; border: solid #D1D1D1; border-width: 1px 1px 0; color: #555; } + .ucnav a:hover { border: solid #999; border-width: 1px 1px 0; } + .ucnav a.ucontype { height: 30px; background: #FFF; border: solid #999; border-width: 1px 1px 0; font-weight: bold; color:#000; } + .ucnav a.sendpmontype { padding-left: 32px; background: #FFF url(sendpm.gif) no-repeat 10px 50%; } + .ucnav a.sendpm { padding-left: 32px; background: #EFEFEF url(sendpm.gif) no-repeat 10px 50%; } + .navinfo { float: right; margin-right: 10px; } + * html .navinfo { padding-top: 8px;} + .navinfo img { vertical-align: middle; margin-right: 10px; } + .navinfo a { float: none; background: none; padding: 0; border: none; } + .navinfo a:hover { border: none; } + .navinfo a.ontype { font-weight: bold; color:#000; } + +.ucinfo { margin: 0 10px 10px; border: solid #A4B2BD; border-width: 0 1px 1px; padding: 6px; overflow: hidden; } + * html .ucinfo { height: 1%; } + .ucinfo a { color: #0871b3; } + .ucinfo a.boldtext { font-weight: bold; } + .ucinfo h1 { height: 62px; line-height: 32px; border-bottom: 2px solid #A3A3A3; margin: 10px auto; padding-left: 0px; } + .ucinfo h1 img { vertical-align: middle; } + .ucinfo h1 span { float: right; } +.ucinfo table { table-layout: fixed; width: 100%; } +.ucinfo form { overflow: hidden; } + * html .ucinfo form { height: 1%; } + .pmlist td, .pmlist th, .newpm td, .newpm th { text-align: left; border-top: none; border-bottom: 1px solid #CAD9EA; color: #666; padding: 5px 0; } + .pmlist td, .pmlist th { height: 56px; } + .pmlist tfoot td, .newpm tfoot td, .newpm tfoot th { border-bottom: none; } + tr.onmsgtitle td, tr.onmsgtitle th { background: #E8F3FD; font-weight: 700; } + .pmlist h2, .newpm h2 { font-weight: 100; font-size: 14px; } + tr.onset td, tr.ontouser td { background: #F4F9FE; } + .newpm em.new { display: block; float: right; background: url(selectpm.gif) no-repeat; padding-left: 20px; width: 46px; height: 16px; } + .onset td h2 { font-weight: 700; } + .sel { width: 40px; text-align: center; vertical-align: top; } + .ava { width: 60px; } + .newpm td.ava { vertical-align: top; } + td.ava img { margin-left: 6px;width: 48px; height: 48px; } + .pef { width: 160px; vertical-align: top; } + .title { width: 490px;} + .title ul { list-style-position : inside; } + .title .pages { float: right; } + .title p { font-weight: bold; } + .newpm tbody th { width: 70px; text-align: right; padding-right: 10px; } + .savetitle em { margin-left: 10px; font-size: 11px; color: #BBB; } + .ctrlbar td { height: 10px; } + .listtype td.selector, .ucinfo td.selector { width: 50px; text-align: center; vertical-align: middle; } + .msgtitle { width: 420px; } + .msgfrom { width: 150px; } + .msgtime { width: 130px;} + .ucinfo .quote, .ucinfo .blockcode { background: #FBFBFB url(citeicon.gif) no-repeat 5px 5px; padding: 30px 20px 10px; border: 1px solid #CCC; margin: 20px 0; } + .ucinfo .blockcode { background: #FBFBFB url(codeicon.gif) no-repeat 8px 6px; } + .ucinfo .blockcode h5 { border: 1px solid #CAD9EA; padding-left: 1em; margin: 4px 2em 2px 0px; background: #F5F5F5; } + .ucinfo .quote h5 { border: 1px solid #CAD9EA; padding-left: 1em; margin: 4px 2em 0px 0px; border-width: 1px 1px 0px 1px; background: url(navonbg.gif) repeat-x 40%; height: 27px; line-height:27px; } + .ucinfo .quote blockquote { margin: 0px 2em 2px 0px; padding: 6px; } + .ucinfo .sl { padding-left: 1.2em; } + .ucinfo .sl span { float: right; margin: -20px 10px 0 0; font-weight: 700; } +.ucinput { border: 1px solid #A4B2BD; padding: 4px 6px;} +.ucnote { border: solid #CAD9EA; border-width: 1px 0; padding: 10px; margin: 10px 3px; background: #F5F5F5; line-height: 1.8em; } +.listarea { border: 1px solid #A4B2BD; width: 99%; } +.linkbox { height: 28px; line-height: 28px; margin: 5px auto; background: #FEFEFE; border: 1px solid #CAD9EA; } + .linkbtn { display: block; float: left; height: 18px; line-height: 18px; padding: 0 10px; margin: 4px 0 0 10px; background: #E8F3FD; border: 1px solid #CAD9EA; } + .right { float: right; margin-right: 10px; color: #999; } +.pmcontent { width: 80%; float: left; } +.noside { width: 100%; } +.pmside { width: 19%; float: right; color: #666666; } + a.moreuser { background: #FFF url(moreuser.gif) no-repeat; width: 16px; height: 16px; margin-top: -24px; float: right; text-indent: 9999px; overflow: hidden; } + .pmside h3 { height: 36px; *height: 37px; line-height: 36px; border-bottom: 1px solid #CAD9EA; } + .pmside ul { list-style: none; height: 300px; display: block; overflow-y: auto; } + .pmside ul li { list-style: none; padding: 3px 0; overflow: hidden; } + +.msg { background: #E8F3FD; border: 1px solid #CAD9EA; width: 100%; } + .msg thead th { color: #005C89; padding: 0.5em; color: #666; } + .msg a { color: #666; } + .msg tbody th { background: #FFFFFF; padding: 0.5em; } + .msg tbody td { background: #FFFFFF; padding: 0.5em; } + .msg tbody em { color: #005C89; font-weight: normal; } + +.message strong { font-weight: bold; } + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pages_btns~~~~ */ +.pages_btns { padding: 0 0 10px; overflow: hidden; margin-top: 10px; } + .postbtn { float: right; } + button { border: 1px solid; border-color: #E6E6E6 #898989 #898989 #E6E6E6; padding: 0 8px; margin-right: 6px;height: 24px; line-height: 24px; background: #E8E8E8;} + .postbtn { cursor: pointer; } + .pmsubmit { background: #005C89; color: #FFF; } + .pages_btns .pages em { line-height: 26px; border: 1px solid; border-color: #E6E6E6 #898989 #898989 #E6E6E6; } +.pages, .threadflow { float: left; border: 1px solid #CAD9EA; background: #F7F7F7; height: 24px; line-height: 26px; color: #999; overflow: hidden; } + .pages a, .pages strong, .pages em, .pages kbd, #multipage .pages em { float: left; padding: 0 8px; line-height:26px; } + .pages a:hover { background-color: #FFF; } + .pages strong { font-weight: bold; color: #090; background: #CAD9EA; } + .pages a.prev, .pages a.next { line-height: 24px; font-family: Verdana, Arial, Helvetica, sans-serif; } + .pages a.next { padding: 0 15px; } + .pages kbd { border-left: 1px solid #CAD9EA; margin: 0; } + * html .pages kbd { padding: 1px 8px; } + .pages kbd input { border: 1px solid #CAD9EA; margin-top: 3px !important; * > margin-top: 1px !important; margin: 1px 4px 0 3px; padding: 0 2px; height: 17px; } + .pages kbd>input { margin-bottom: 2px; } + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ editor~~~~ */ +.editor a { margin: 6px 2px 6px 0; float: left; text-decoration: none; display: block; height: 20px; width: 21px; background: #E8F3FD url(editor.gif) no-repeat 0 21px; border: 1px solid #D1D1D1; } + .editor a:hover { border: 1px solid #999; } + #editor_b { background-position: 0 0; } + #editor_u { background-position: 0 -19px; } + #editor_i { background-position: 0 -40px; } + #editor_alignleft { background-position: 0 -60px; } + #editor_aligncenter { background-position: 0 -80px; } + #editor_alignright { background-position: 0 -100px; } + #editor_url { background-position: 0 -120px; } + #editor_email { background-position: 0 -140px; } + #editor_floatleft { background-position: 0 -160px; } + #editor_floatright { background-position: 0 -180px; } + #editor_img { background-position: 0 -200px; } + #editor_indent { background-position: 0 -220px; } + #editor_lista { background-position: 0 -240px; } + #editor_list1 { background-position: 0 -260px; } + #editor_color { background-position: 0 -280px; } + #editor_code { background-position: 0 -300px; } + #editor_quote { background-position: 0 -320px; } + #editor_color_menu { width: 113px; height: 71px; background-color: #fff; border: 1px solid #9DB3C5; } + #editor_color_menu input { margin: 2px; padding: 0px; float:left; cursor: pointer; width: 10px; height: 10px; border: 0; } + #editor_color_menu input:hover { border: 1px solid #999; } diff --git a/uc_server/images/default/viewpm.gif b/uc_server/images/default/viewpm.gif new file mode 100644 index 0000000..11295b7 Binary files /dev/null and b/uc_server/images/default/viewpm.gif differ diff --git a/uc_server/images/error.gif b/uc_server/images/error.gif new file mode 100644 index 0000000..d21152a Binary files /dev/null and b/uc_server/images/error.gif differ diff --git a/uc_server/images/fonts/ch/index.htm b/uc_server/images/fonts/ch/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/images/fonts/ch/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/images/fonts/en/FetteSteinschrift.ttf b/uc_server/images/fonts/en/FetteSteinschrift.ttf new file mode 100644 index 0000000..6ab1de7 Binary files /dev/null and b/uc_server/images/fonts/en/FetteSteinschrift.ttf differ diff --git a/uc_server/images/fonts/en/index.htm b/uc_server/images/fonts/en/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/images/fonts/en/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/images/fonts/index.htm b/uc_server/images/fonts/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/images/fonts/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/images/gif/OCR_A_Extended/2.gif b/uc_server/images/gif/OCR_A_Extended/2.gif new file mode 100644 index 0000000..f8e6c6d Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/2.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/3.gif b/uc_server/images/gif/OCR_A_Extended/3.gif new file mode 100644 index 0000000..64f197e Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/3.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/4.gif b/uc_server/images/gif/OCR_A_Extended/4.gif new file mode 100644 index 0000000..89c7951 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/4.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/6.gif b/uc_server/images/gif/OCR_A_Extended/6.gif new file mode 100644 index 0000000..459e6a0 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/6.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/7.gif b/uc_server/images/gif/OCR_A_Extended/7.gif new file mode 100644 index 0000000..63c5025 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/7.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/8.gif b/uc_server/images/gif/OCR_A_Extended/8.gif new file mode 100644 index 0000000..f4bc794 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/8.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/9.gif b/uc_server/images/gif/OCR_A_Extended/9.gif new file mode 100644 index 0000000..8088d75 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/9.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/b.gif b/uc_server/images/gif/OCR_A_Extended/b.gif new file mode 100644 index 0000000..7ffff96 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/b.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/c.gif b/uc_server/images/gif/OCR_A_Extended/c.gif new file mode 100644 index 0000000..e426c52 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/c.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/e.gif b/uc_server/images/gif/OCR_A_Extended/e.gif new file mode 100644 index 0000000..3283467 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/e.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/f.gif b/uc_server/images/gif/OCR_A_Extended/f.gif new file mode 100644 index 0000000..aff60d9 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/f.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/g.gif b/uc_server/images/gif/OCR_A_Extended/g.gif new file mode 100644 index 0000000..b1f886f Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/g.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/h.gif b/uc_server/images/gif/OCR_A_Extended/h.gif new file mode 100644 index 0000000..74eb851 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/h.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/index.htm b/uc_server/images/gif/OCR_A_Extended/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/images/gif/OCR_A_Extended/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/images/gif/OCR_A_Extended/j.gif b/uc_server/images/gif/OCR_A_Extended/j.gif new file mode 100644 index 0000000..806f44c Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/j.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/k.gif b/uc_server/images/gif/OCR_A_Extended/k.gif new file mode 100644 index 0000000..ea0e31c Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/k.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/m.gif b/uc_server/images/gif/OCR_A_Extended/m.gif new file mode 100644 index 0000000..bcb75e2 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/m.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/p.gif b/uc_server/images/gif/OCR_A_Extended/p.gif new file mode 100644 index 0000000..e92e164 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/p.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/q.gif b/uc_server/images/gif/OCR_A_Extended/q.gif new file mode 100644 index 0000000..4e47992 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/q.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/r.gif b/uc_server/images/gif/OCR_A_Extended/r.gif new file mode 100644 index 0000000..6315b3a Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/r.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/t.gif b/uc_server/images/gif/OCR_A_Extended/t.gif new file mode 100644 index 0000000..21aca85 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/t.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/v.gif b/uc_server/images/gif/OCR_A_Extended/v.gif new file mode 100644 index 0000000..a49ca03 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/v.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/w.gif b/uc_server/images/gif/OCR_A_Extended/w.gif new file mode 100644 index 0000000..4cfb757 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/w.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/x.gif b/uc_server/images/gif/OCR_A_Extended/x.gif new file mode 100644 index 0000000..d1a2261 Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/x.gif differ diff --git a/uc_server/images/gif/OCR_A_Extended/y.gif b/uc_server/images/gif/OCR_A_Extended/y.gif new file mode 100644 index 0000000..d461cbe Binary files /dev/null and b/uc_server/images/gif/OCR_A_Extended/y.gif differ diff --git a/uc_server/images/gif/Small_Fonts/2.gif b/uc_server/images/gif/Small_Fonts/2.gif new file mode 100644 index 0000000..6fc37c0 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/2.gif differ diff --git a/uc_server/images/gif/Small_Fonts/3.gif b/uc_server/images/gif/Small_Fonts/3.gif new file mode 100644 index 0000000..0870701 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/3.gif differ diff --git a/uc_server/images/gif/Small_Fonts/4.gif b/uc_server/images/gif/Small_Fonts/4.gif new file mode 100644 index 0000000..08ee28c Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/4.gif differ diff --git a/uc_server/images/gif/Small_Fonts/6.gif b/uc_server/images/gif/Small_Fonts/6.gif new file mode 100644 index 0000000..28c2374 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/6.gif differ diff --git a/uc_server/images/gif/Small_Fonts/7.gif b/uc_server/images/gif/Small_Fonts/7.gif new file mode 100644 index 0000000..19dcc05 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/7.gif differ diff --git a/uc_server/images/gif/Small_Fonts/8.gif b/uc_server/images/gif/Small_Fonts/8.gif new file mode 100644 index 0000000..315fc85 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/8.gif differ diff --git a/uc_server/images/gif/Small_Fonts/9.gif b/uc_server/images/gif/Small_Fonts/9.gif new file mode 100644 index 0000000..76e237b Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/9.gif differ diff --git a/uc_server/images/gif/Small_Fonts/b.gif b/uc_server/images/gif/Small_Fonts/b.gif new file mode 100644 index 0000000..2bf7ae3 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/b.gif differ diff --git a/uc_server/images/gif/Small_Fonts/c.gif b/uc_server/images/gif/Small_Fonts/c.gif new file mode 100644 index 0000000..0aa0b45 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/c.gif differ diff --git a/uc_server/images/gif/Small_Fonts/e.gif b/uc_server/images/gif/Small_Fonts/e.gif new file mode 100644 index 0000000..308e648 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/e.gif differ diff --git a/uc_server/images/gif/Small_Fonts/f.gif b/uc_server/images/gif/Small_Fonts/f.gif new file mode 100644 index 0000000..82ccc6a Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/f.gif differ diff --git a/uc_server/images/gif/Small_Fonts/g.gif b/uc_server/images/gif/Small_Fonts/g.gif new file mode 100644 index 0000000..5760cbd Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/g.gif differ diff --git a/uc_server/images/gif/Small_Fonts/h.gif b/uc_server/images/gif/Small_Fonts/h.gif new file mode 100644 index 0000000..38ee9ad Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/h.gif differ diff --git a/uc_server/images/gif/Small_Fonts/index.htm b/uc_server/images/gif/Small_Fonts/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/images/gif/Small_Fonts/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/images/gif/Small_Fonts/j.gif b/uc_server/images/gif/Small_Fonts/j.gif new file mode 100644 index 0000000..ec7efa6 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/j.gif differ diff --git a/uc_server/images/gif/Small_Fonts/k.gif b/uc_server/images/gif/Small_Fonts/k.gif new file mode 100644 index 0000000..0d671ba Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/k.gif differ diff --git a/uc_server/images/gif/Small_Fonts/m.gif b/uc_server/images/gif/Small_Fonts/m.gif new file mode 100644 index 0000000..1128535 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/m.gif differ diff --git a/uc_server/images/gif/Small_Fonts/p.gif b/uc_server/images/gif/Small_Fonts/p.gif new file mode 100644 index 0000000..71f063e Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/p.gif differ diff --git a/uc_server/images/gif/Small_Fonts/q.gif b/uc_server/images/gif/Small_Fonts/q.gif new file mode 100644 index 0000000..fe97624 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/q.gif differ diff --git a/uc_server/images/gif/Small_Fonts/r.gif b/uc_server/images/gif/Small_Fonts/r.gif new file mode 100644 index 0000000..07413a5 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/r.gif differ diff --git a/uc_server/images/gif/Small_Fonts/t.gif b/uc_server/images/gif/Small_Fonts/t.gif new file mode 100644 index 0000000..13dc5d3 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/t.gif differ diff --git a/uc_server/images/gif/Small_Fonts/v.gif b/uc_server/images/gif/Small_Fonts/v.gif new file mode 100644 index 0000000..54467c9 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/v.gif differ diff --git a/uc_server/images/gif/Small_Fonts/w.gif b/uc_server/images/gif/Small_Fonts/w.gif new file mode 100644 index 0000000..7753555 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/w.gif differ diff --git a/uc_server/images/gif/Small_Fonts/x.gif b/uc_server/images/gif/Small_Fonts/x.gif new file mode 100644 index 0000000..0a40d72 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/x.gif differ diff --git a/uc_server/images/gif/Small_Fonts/y.gif b/uc_server/images/gif/Small_Fonts/y.gif new file mode 100644 index 0000000..77a9520 Binary files /dev/null and b/uc_server/images/gif/Small_Fonts/y.gif differ diff --git a/uc_server/images/gif/index.htm b/uc_server/images/gif/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/images/index.htm b/uc_server/images/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/images/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/images/locale.xml b/uc_server/images/locale.xml new file mode 100644 index 0000000..dd0d121 --- /dev/null +++ b/uc_server/images/locale.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \u60a8\u6240\u4f7f\u7528\u7684flash player\u7248\u672c\u8fc7\u65e7, \u8bf7\u53ca\u65f6\u66f4\u65b0
                                    + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \u60a8\u6240\u4f7f\u7528\u7684flash player\u7248\u672c\u904e\u820a, \u8acb\u53ca\u6642\u66f4\u65b0
                                    + ]]> + + + + \ No newline at end of file diff --git a/uc_server/images/noavatar.svg b/uc_server/images/noavatar.svg new file mode 100644 index 0000000..2231f3d --- /dev/null +++ b/uc_server/images/noavatar.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uc_server/images/noavatar_big.gif b/uc_server/images/noavatar_big.gif new file mode 100644 index 0000000..509e5f3 Binary files /dev/null and b/uc_server/images/noavatar_big.gif differ diff --git a/uc_server/images/noavatar_middle.gif b/uc_server/images/noavatar_middle.gif new file mode 100644 index 0000000..44305ae Binary files /dev/null and b/uc_server/images/noavatar_middle.gif differ diff --git a/uc_server/images/noavatar_small.gif b/uc_server/images/noavatar_small.gif new file mode 100644 index 0000000..b6dbfa0 Binary files /dev/null and b/uc_server/images/noavatar_small.gif differ diff --git a/uc_server/index.php b/uc_server/index.php new file mode 100644 index 0000000..8256535 --- /dev/null +++ b/uc_server/index.php @@ -0,0 +1,162 @@ +data/config.inc.php does not exist, perhaps because of UCenter has not been installed, Please click here to install it..'); +} +if(!defined('UC_KEY') || !UC_KEY) { + exit('This UCenter Server has been disabled.'); +} + +$m = getgpc('m'); +$a = getgpc('a'); +if(empty($m) && empty($a)) { + header('Location: admin.php'); + exit; +} + +define('RELEASE_ROOT', ''); + +if(file_exists(UC_ROOT.RELEASE_ROOT.'model/base.php')) { + require UC_ROOT.RELEASE_ROOT.'model/base.php'; +} else { + require UC_ROOT.'model/base.php'; +} + +if(in_array($m, array('app', 'frame', 'user', 'pm', 'pm_client', 'tag', 'feed', 'friend', 'domain', 'credit', 'mail', 'version', 'seccode'))) { + + if(file_exists(UC_ROOT.RELEASE_ROOT."control/$m.php")) { + include UC_ROOT.RELEASE_ROOT."control/$m.php"; + } else { + include UC_ROOT."control/$m.php"; + } + + $classname = $m.'control'; + $control = new $classname(); + $method = 'on'.$a; + if(method_exists($control, $method) && $a[0] != '_') { + $data = $control->$method(); + echo is_array($data) ? $control->serialize($data, 1) : $data; + exit; + } elseif(method_exists($control, '_call')) { + $data = $control->_call('on'.$a, ''); + echo is_array($data) ? $control->serialize($data, 1) : $data; + exit; + } else { + exit('Action not found!'); + } + +} else { + + exit('Module not found!'); + +} + +$mtime = explode(' ', microtime()); +$endtime = $mtime[1] + $mtime[0]; + +function daddslashes($string, $force = 0, $strip = FALSE) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = daddslashes($val, $force, $strip); + } + } else { + $string = addslashes($strip ? stripslashes($string) : $string); + } + return $string; +} + +function getgpc($k, $var='R') { + switch($var) { + case 'G': $var = &$_GET; break; + case 'P': $var = &$_POST; break; + case 'C': $var = &$_COOKIE; break; + case 'R': $var = &$_REQUEST; break; + } + return isset($var[$k]) ? $var[$k] : NULL; +} + +function fsocketopen($hostname, $port = 80, &$errno = null, &$errstr = null, $timeout = 15) { + $fp = ''; + if(function_exists('fsockopen')) { + $fp = @fsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('pfsockopen')) { + $fp = @pfsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('stream_socket_client')) { + $fp = @stream_socket_client($hostname.':'.$port, $errno, $errstr, $timeout); + } + return $fp; +} +function dhtmlspecialchars($string, $flags = null) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = dhtmlspecialchars($val, $flags); + } + } else { + if($flags === null) { + $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); + if(strpos($string, '&#') !== false) { + $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string); + } + } else { + if(PHP_VERSION < '5.4.0') { + $string = htmlspecialchars($string, $flags); + } else { + if(strtolower(CHARSET) == 'utf-8') { + $charset = 'UTF-8'; + } else { + $charset = 'ISO-8859-1'; + } + $string = htmlspecialchars($string, $flags, $charset); + } + } + } + return $string; +} + +function is_https() { + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { + return true; + } + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { + return true; + } + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { + return true; + } + return false; +} + +?> \ No newline at end of file diff --git a/uc_server/install/dbi.class.php b/uc_server/install/dbi.class.php new file mode 100644 index 0000000..cabb9a3 --- /dev/null +++ b/uc_server/install/dbi.class.php @@ -0,0 +1,140 @@ +time = $time; + $this->tablepre = $tablepre; + + mysqli_report(MYSQLI_REPORT_OFF); + + if(!$this->link = new mysqli($dbhost, $dbuser, $dbpw, $dbname)) { + $this->halt('Can not connect to MySQL server'); + } + + if($dbcharset) { + $this->link->set_charset($dbcharset); + } + + $this->link->query("SET sql_mode=''"); + + $this->link->query("SET character_set_client=binary"); + + } + + function fetch_array($query, $result_type = MYSQLI_ASSOC) { + return $query ? $query->fetch_array($result_type) : null; + } + + function result_first($sql, &$data) { + $query = $this->query($sql); + $data = $this->result($query, 0); + } + + function fetch_first($sql, &$arr) { + $query = $this->query($sql); + $arr = $this->fetch_array($query); + } + + function fetch_all($sql, &$arr) { + $query = $this->query($sql); + while($data = $this->fetch_array($query)) { + $arr[] = $data; + } + } + + function cache_gc() { + $this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time"); + } + + function query($sql, $type = '', $cachetime = FALSE) { + $resultmode = $type == 'UNBUFFERED' ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT; + if(!($query = $this->link->query($sql, $resultmode)) && $type != 'SILENT') { + $this->halt('MySQL Query Error', $sql); + } + $this->querynum++; + $this->histories[] = $sql; + return $query; + } + + function affected_rows() { + return $this->link->affected_rows; + } + + function error() { + return $this->link->error; + } + + function errno() { + return $this->link->errno; + } + + function result($query, $row) { + if(!$query || $query->num_rows == 0) { + return null; + } + $query->data_seek($row); + $assocs = $query->fetch_row(); + return $assocs[0]; + } + + function num_rows($query) { + $query = $query ? $query->num_rows : 0; + return $query; + } + + function num_fields($query) { + return $query ? $query->field_count : 0; + } + + function free_result($query) { + return $query ? $query->free() : false; + } + + function insert_id() { + return ($id = $this->link->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); + } + + function fetch_row($query) { + $query = $query ? $query->fetch_row() : null; + return $query; + } + + function fetch_fields($query) { + return $query ? $query->fetch_field() : null; + } + + function version() { + return $this->link->server_info; + } + + function escape_string($str) { + return $this->link->escape_string($str); + } + + function close() { + return $this->link->close(); + } + + function halt($message = '', $sql = '') { + show_error('run_sql_error', $message.'

                                    '.$sql.'
                                    '.$this->error(), 0); + } +} + +?> \ No newline at end of file diff --git a/uc_server/install/func.inc.php b/uc_server/install/func.inc.php new file mode 100644 index 0000000..5d6df16 --- /dev/null +++ b/uc_server/install/func.inc.php @@ -0,0 +1,1192 @@ +\n"; + $str .= "\t\n"; + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + } else { + show_header(); + global $step; + + $title = lang($error_no); + $comment = lang($error_no.'_comment', false); + $errormsg = ''; + + if($error_msg) { + if(!empty($error_msg)) { + foreach ((array)$error_msg as $k => $v) { + if(is_numeric($k)) { + $comment .= "
                                  • ".lang($v)."
                                  • "; + } + } + } + } + + if($step > 0) { + echo "
                                    $title
                                      $comment
                                    "; + } else { + echo "
                                    $title
                                      $comment
                                    "; + } + + if($quit) { + echo '
                                    '.lang('error_quit_msg').'


                                    '; + } + + echo '


                                    '; + + echo '
                                    '; + + $quit && show_footer(); + } +} + +function check_db($dbhost, $dbuser, $dbpw, $dbname, $tablepre) { + if(!function_exists('mysqli_connect')) { + show_msg('undefine_func', 'mysqli_connect', 0); + } + + mysqli_report(MYSQLI_REPORT_OFF); + + $link = @new mysqli($dbhost, $dbuser, $dbpw); + if(!$link) { + $errno = mysqli_errno($link); + $error = mysqli_error($link); + if($errno == 1045) { + show_msg('database_errno_1045', $error, 0); + } elseif($errno == 2003) { + show_msg('database_errno_2003', $error, 0); + } else { + show_msg('database_connect_error', $error, 0); + } + } else { + if($query = ($link->query("SHOW TABLES FROM $dbname"))) { + if(!$query) { + return false; + } + while($row = ($query->fetch_row())) { + if(preg_match("/^$tablepre/", $row[0])) { + return false; + } + } + } + } + return true; +} + +function dirfile_check(&$dirfile_items) { + foreach($dirfile_items as $key => $item) { + $item_path = $item['path']; + if($item['type'] == 'dir') { + if(!dir_writeable(ROOT_PATH.$item_path)) { + if(is_dir(ROOT_PATH.$item_path)) { + $dirfile_items[$key]['status'] = 0; + $dirfile_items[$key]['current'] = '+r'; + } else { + $dirfile_items[$key]['status'] = -1; + $dirfile_items[$key]['current'] = 'nodir'; + } + } else { + $dirfile_items[$key]['status'] = 1; + $dirfile_items[$key]['current'] = '+r+w'; + } + } else { + if(file_exists(ROOT_PATH.$item_path)) { + if(is_writable(ROOT_PATH.$item_path)) { + $dirfile_items[$key]['status'] = 1; + $dirfile_items[$key]['current'] = '+r+w'; + } else { + $dirfile_items[$key]['status'] = 0; + $dirfile_items[$key]['current'] = '+r'; + } + } else { + if(dir_writeable(dirname(ROOT_PATH.$item_path))) { + $dirfile_items[$key]['status'] = 1; + $dirfile_items[$key]['current'] = '+r+w'; + } else { + $dirfile_items[$key]['status'] = -1; + $dirfile_items[$key]['current'] = 'nofile'; + } + } + } + } +} + +function env_check(&$env_items) { + foreach($env_items as $key => $item) { + if($key == 'php') { + $env_items[$key]['current'] = PHP_VERSION; + } elseif($key == 'attachmentupload') { + $env_items[$key]['current'] = @ini_get('file_uploads') ? getmaxupload() : 'unknow'; + } elseif($key == 'gdversion') { + $tmp = function_exists('gd_info') ? gd_info() : array(); + $env_items[$key]['current'] = empty($tmp['GD Version']) ? 'noext' : $tmp['GD Version']; + unset($tmp); + } elseif($key == 'diskspace') { + if(function_exists('disk_free_space')) { + $env_items[$key]['current'] = floor(disk_free_space(ROOT_PATH) / (1024*1024)).'M'; + } else { + $env_items[$key]['current'] = 'unknow'; + } + } elseif(isset($item['c'])) { + $env_items[$key]['current'] = constant($item['c']); + } elseif($key == 'opcache') { + $opcache_data = function_exists('opcache_get_configuration') ? opcache_get_configuration() : array(); + $env_items[$key]['current'] = !empty($opcache_data['directives']['opcache.enable']) ? 'enable' : 'disable'; + } elseif($key == 'curl') { + if(function_exists('curl_init') && function_exists('curl_version')){ + $v = curl_version(); + $env_items[$key]['current'] = 'enable'.' '.$v['version']; + }else{ + $env_items[$key]['current'] = 'disable'; + } + } elseif(isset($item['f'])) { + $env_items[$key]['current'] = function_exists($item['f']) ? 'enable' : 'disable'; + } + + $env_items[$key]['status'] = 1; + if($item['r'] != 'notset' && strcmp($env_items[$key]['current'], $item['r']) < 0) { + $env_items[$key]['status'] = 0; + } + } +} + +function function_check(&$func_items) { + foreach($func_items as $item) { + function_exists($item) or show_msg('undefine_func', $item, 0); + } +} + +function show_env_result(&$env_items, &$dirfile_items, &$func_items) { + + $env_str = $file_str = $dir_str = $func_str = ''; + $error_code = 0; + + foreach($env_items as $key => $item) { + if($key == 'php' && strcmp($item['current'], $item['r']) < 0) { + show_msg('php_version_too_low', $item['current'], 0); + } + $status = 1; + if($item['r'] != 'notset') { + if(intval($item['current']) && intval($item['r'])) { + if(intval($item['current']) < intval($item['r'])) { + $status = 0; + $error_code = ENV_CHECK_ERROR; + } + } else { + if(strcmp($item['current'], $item['r']) < 0) { + $status = 0; + $error_code = ENV_CHECK_ERROR; + } + } + } + if(VIEW_OFF) { + $env_str .= "\t\t\n"; + } else { + $env_str .= "\n"; + $env_str .= "".lang($key)."\n"; + $env_str .= "".lang($item['r'])."\n"; + $env_str .= "".lang($item['b'])."\n"; + $env_str .= ($status ? "" : "").$item['current']."\n"; + $env_str .= "\n"; + } + } + + foreach($dirfile_items as $key => $item) { + $tagname = $item['type'] == 'file' ? 'File' : 'Dir'; + $variable = $item['type'].'_str'; + + if(VIEW_OFF) { + if($item['status'] == 0) { + $error_code = ENV_CHECK_ERROR; + } + $$variable .= "\t\t\t\n"; + } else { + $$variable .= "\n"; + $$variable .= "{$item['path']}".lang('writeable')."\n"; + if($item['status'] == 1) { + $$variable .= "".lang('writeable')."\n"; + } elseif($item['status'] == -1) { + $error_code = ENV_CHECK_ERROR; + $$variable .= "".lang('nodir')."\n"; + } else { + $error_code = ENV_CHECK_ERROR; + $$variable .= "".lang('unwriteable')."\n"; + } + $$variable .= "\n"; + } + } + + if(VIEW_OFF) { + + $str = "\n"; + $str .= "\t\n"; + $str .= $env_str; + $str .= "\t\n"; + $str .= "\t\n"; + $str .= "\t\t\n"; + $str .= $dir_str; + $str .= "\t\t\n"; + $str .= "\t\t\n"; + $str .= $file_str; + $str .= "\t\t\n"; + $str .= "\t\n"; + $str .= "\t\n"; + $str .= ""; + send_mime_type_header(); + echo $str; + exit; + + } else { + + show_header(); + + echo "

                                    ".lang('env_check')."

                                    \n"; + echo "\n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n"; + echo $env_str; + echo "
                                    ".lang('project')."".lang('ucenter_required')."".lang('ucenter_best')."".lang('curr_server')."
                                    \n"; + + echo "

                                    ".lang('priv_check')."

                                    \n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n"; + echo $file_str; + echo $dir_str; + echo "
                                    ".lang('step1_file')."".lang('step1_need_status')."".lang('step1_status')."
                                    \n"; + + foreach($func_items as $item) { + $status = function_exists($item); + $func_str .= "\n"; + $func_str .= "$item()\n"; + if($status) { + $func_str .= "".lang('supportted')."\n"; + $func_str .= "".lang('none')."\n"; + } else { + $error_code = ENV_CHECK_ERROR; + $func_str .= "".lang('unsupportted')."\n"; + $func_str .= "".lang('advice_'.$item)."\n"; + } + } + echo "

                                    ".lang('func_depend')."

                                    \n"; + echo "\n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n"; + echo $func_str; + echo "
                                    ".lang('func_name')."".lang('check_result')."".lang('suggestion')."
                                    \n"; + + show_next_step(2, $error_code); + + show_footer(); + + } + +} + +function show_next_step($step, $error_code) { + echo "
                                    \n"; + echo ""; + if(isset($GLOBALS['hidden'])) { + echo $GLOBALS['hidden']; + } + if($error_code == 0) { + $nextstep = "\n"; + } else { + $nextstep = "\n"; + } + echo "
                                    ".$nextstep."
                                    \n"; + echo "
                                    \n"; +} + +function show_form(&$form_items, $error_msg) { + + global $step; + + if(empty($form_items) || !is_array($form_items)) { + return; + } + + show_header(); + show_setting('start'); + show_setting('hidden', 'step', $step); + $is_first = 1; + foreach($form_items as $key => $items) { + global ${'error_'.$key}; + if($is_first == 0) { + echo ''; + } + + if(!${'error_'.$key}) { + show_tips('tips_'.$key); + } else { + show_error('tips_admin_config', ${'error_'.$key}); + } + + if($is_first == 0) { + echo ''; + } + + foreach($items as $k => $v) { + global $$k; + if(!empty($error_msg)) { + $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : ''; + } else { + if(isset($v['value']) && is_array($v['value'])) { + if($v['value']['type'] == 'constant') { + $value = defined($v['value']['var']) ? constant($v['value']['var']) : ''; + } elseif($v['value']['type'] == 'var') { + $value = $GLOBALS[$v['value']['var']]; + } elseif($v['value']['type'] == 'string') { + $value = $v['value']['var']; + } + } else { + $value = ''; + } + } + if($v['type'] == 'checkbox') { + $value = '1'; + } + show_setting($k, $key.'['.$k.']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key.'_'.$k.'_invalid' : ''); + } + + if($is_first) { + $is_first = 0; + } + } + show_setting('', 'submitname', 'new_step', 'submit'); + show_setting('end'); + show_footer(); +} + +function show_license() { + global $self, $uchidden, $step; + $next = $step + 1; + if(VIEW_OFF) { + + show_msg('license_contents', lang('license'), 1); + + } else { + + show_header(); + + $license = str_replace(' ', '  ', lang('license')); + $lang_agreement_yes = lang('agreement_yes'); + $lang_agreement_no = lang('agreement_no'); + echo << +
                                    +
                                    $license
                                    +
                                    +
                                    + + $uchidden +   + + +
                                    +EOT; + + show_footer(); + + } +} + +function createtable($sql) { + $type = strtoupper(preg_replace("/^\s*CREATE TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU", "\\2", $sql)); + $type = in_array($type, array('INNODB', 'MYISAM', 'HEAP', 'MEMORY')) ? $type : 'INNODB'; + return preg_replace("/^\s*(CREATE TABLE\s+.+\s+\(.+?\)).*$/isU", "\\1", $sql) . " ENGINE=$type DEFAULT CHARSET=" . DBCHARSET . (DBCHARSET === 'utf8mb4' ? " COLLATE=utf8mb4_unicode_ci" : ""); +} + +function dir_writeable($dir) { + $writeable = 0; + if(!is_dir($dir)) { + @mkdir($dir, 0777); + } + if(is_dir($dir)) { + if($fp = @fopen("$dir/test.txt", 'w')) { + @fclose($fp); + @unlink("$dir/test.txt"); + $writeable = 1; + } else { + $writeable = 0; + } + } + return $writeable; +} + +function dir_clear($dir) { + global $lang; + showjsmessage($lang['clear_dir'].' '.str_replace(ROOT_PATH, '', $dir)); + $directory = dir($dir); + while($entry = $directory->read()) { + $filename = $dir.'/'.$entry; + if(is_file($filename)) { + @unlink($filename); + } + } + $directory->close(); + @touch($dir.'/index.htm'); +} + +function show_header() { + define('SHOW_HEADER', TRUE); + global $step; + $version = SOFT_VERSION; + $release = SOFT_RELEASE; + $install_lang = lang(INSTALL_LANG); + $title = lang('title_install'); + $charset = CHARSET; + echo << + + + + + +$title + + + + +
                                    +
                                    +

                                    $title

                                    + V$version $install_lang $release +EOT; + + $step > 0 && show_step($step); +} + +function show_footer($quit = true) { + + $copy = lang('copyright'); + + echo <<$copy
                                    +
                                    +
                                    + + +EOT; + $quit && exit(); +} + +function showjsmessage($message) { + if(VIEW_OFF) return; + echo ''."\r\n"; + flush(); + ob_flush(); +} + +function random($length, $numeric = 0) { + $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35); + $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed)); + if($numeric) { + $hash = ''; + } else { + $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64); + $length--; + } + $max = strlen($seed) - 1; + for($i = 0; $i < $length; $i++) { + $hash .= $seed[mt_rand(0, $max)]; + } + return $hash; +} + +function secrandom($length, $numeric = 0, $strong = false) { + $chars = $numeric ? array('A','B','+','/','=') : array('+','/','='); + $num_find = str_split('CDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'); + $num_repl = str_split('01234567890123456789012345678901234567890123456789'); + $isstrong = false; + if(function_exists('random_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + return random_bytes($length); + }; + } elseif(extension_loaded('mcrypt') && function_exists('mcrypt_create_iv')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + if ($rand !== false && strlen($rand) === $length) { + return $rand; + } else { + return false; + } + }; + } elseif(extension_loaded('openssl') && function_exists('openssl_random_pseudo_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = openssl_random_pseudo_bytes($length, $secure); + if($secure === true) { + return $rand; + } else { + return false; + } + }; + } + if(!$isstrong) { + return $strong ? false : random($length, $numeric); + } + $retry_times = 0; + $return = ''; + while($retry_times < 128) { + $getlen = $length - strlen($return); // 33% extra bytes + $bytes = $random_bytes(max($getlen, 12)); + if($bytes === false) { + return false; + } + $bytes = str_replace($chars, '', base64_encode($bytes)); + $return .= substr($bytes, 0, $getlen); + if(strlen($return) == $length) { + return $numeric ? str_replace($num_find, $num_repl, $return) : $return; + } + $retry_times++; + } +} + +function redirect($url) { + + echo ""; + exit(); + +} + +function validate_ip($ip) { + return filter_var($ip, FILTER_VALIDATE_IP) !== false; +} + +function get_onlineip() { + $onlineip = $_SERVER['REMOTE_ADDR']; + if (isset($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) { + $onlineip = $_SERVER['HTTP_CLIENT_IP']; + } elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ",") > 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $onlineip = validate_ip(trim($exp[0])) ? $exp[0] : $onlineip; + } else { + $onlineip = validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $onlineip; + } + } + return $onlineip; +} + +function config_edit() { + extract($GLOBALS, EXTR_SKIP); + $ucsalt = ''; + $ucfounderpw = password_hash($ucfounderpw, PASSWORD_BCRYPT); + $regdate = time(); + + $ucauthkey = generate_key(); + $ucsiteid = generate_key(); + $ucmykey = generate_key(); + $config = " 'HTTP_X_FORWARDED_FOR')));\r\n"; + + file_put_contents(CONFIG, $config); +} + +function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + + $ckey_length = 4; + + $key = md5($key ? $key : UC_KEY); + $keya = md5(substr($key, 0, 16)); + $keyb = md5(substr($key, 16, 16)); + $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; + + $cryptkey = $keya.md5($keya.$keyc); + $key_length = strlen($cryptkey); + + $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; + $string_length = strlen($string); + + $result = ''; + $box = range(0, 255); + + $rndkey = array(); + for($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($cryptkey[$i % $key_length]); + } + + for($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + + for($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); + } + + if($operation == 'DECODE') { + if(((int)substr($result, 0, 10) == 0 || (int)substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26).$keyb), 0, 16)) { + return substr($result, 26); + } else { + return ''; + } + } else { + return $keyc.str_replace('=', '', base64_encode($result)); + } + +} + +function generate_key($length = 32) { + $random = secrandom($length); + $info = md5($_SERVER['SERVER_SOFTWARE'].$_SERVER['SERVER_NAME'].(isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '').(isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : '').$_SERVER['HTTP_USER_AGENT'].time()); + $return = ''; + for($i=0; $i<$length; $i++) { + $return .= $random[$i].$info[$i]; + } + return $return; +} + +function show_install() { + if(VIEW_OFF) return; +?> + +
                                    +
                                    +
                                    + +
                                    +query(createtable($query)); + } else { + $db->query($query); + } + + } + } + +} + +function charcovert($string) { + return str_replace('\'', '\\\'', $string); +} + +function insertconfig($s, $find, $replace) { + if(preg_match($find, $s)) { + $s = preg_replace($find, $replace, $s); + } else { + $s .= "\r\n".$replace; + } + return $s; +} + +function getgpc($k, $t='GP') { + $t = strtoupper($t); + switch($t) { + case 'GP' : isset($_POST[$k]) ? $var = &$_POST : $var = &$_GET; break; + case 'G': $var = &$_GET; break; + case 'P': $var = &$_POST; break; + case 'C': $var = &$_COOKIE; break; + case 'R': $var = &$_REQUEST; break; + } + return isset($var[$k]) ? $var[$k] : ''; +} + +function var_to_hidden($k, $v) { + return "\n"; +} + +function fsocketopen($hostname, $port = 80, &$errno = null, &$errstr = null, $timeout = 15) { + $fp = ''; + if(function_exists('fsockopen')) { + $fp = @fsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('pfsockopen')) { + $fp = @pfsockopen($hostname, $port, $errno, $errstr, $timeout); + } elseif(function_exists('stream_socket_client')) { + $fp = @stream_socket_client($hostname.':'.$port, $errno, $errstr, $timeout); + } + return $fp; +} + +function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $return = ''; + $matches = parse_url($url); + $scheme = strtolower($matches['scheme']); + $host = $matches['host']; + $path = !empty($matches['path']) ? $matches['path'].(!empty($matches['query']) ? '?'.$matches['query'] : '') : '/'; + $port = !empty($matches['port']) ? $matches['port'] : ($scheme == 'https' ? 443 : 80); + + if(function_exists('curl_init') && function_exists('curl_exec') && $allowcurl) { + $ch = curl_init(); + $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); + curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + if(!empty($ip) && filter_var($ip, FILTER_VALIDATE_IP) && !filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + if($post) { + curl_setopt($ch, CURLOPT_POST, 1); + if($encodetype == 'URLENCODE') { + curl_setopt($ch, CURLOPT_POSTFIELDS, $post); + } else { + parse_str($post, $postarray); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postarray); + } + } + if($cookie) { + curl_setopt($ch, CURLOPT_COOKIE, $cookie); + } + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); + $data = curl_exec($ch); + $status = curl_getinfo($ch); + $errno = curl_errno($ch); + curl_close($ch); + if($errno || $status['http_code'] != 200) { + return; + } else { + return !$limit ? $data : substr($data, 0, $limit); + } + } + + if($post) { + $out = "POST $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + if($allowcurl) { + $encodetype = 'URLENCODE'; + } + $boundary = $encodetype == 'URLENCODE' ? '' : '; boundary='.trim(substr(trim($post), 2, strpos(trim($post), "\n") - 2)); + $header .= $encodetype == 'URLENCODE' ? "Content-Type: application/x-www-form-urlencoded\r\n" : "Content-Type: multipart/form-data$boundary\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= 'Content-Length: '.strlen($post)."\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cache-Control: no-cache\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header.$post; + } else { + $out = "GET $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header; + } + + $fpflag = 0; + $context = array(); + if($scheme == 'https') { + $context['ssl'] = array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'peer_name' => $host + ); + if(version_compare(PHP_VERSION, '5.6.0', '<')) { + $context['ssl']['SNI_enabled'] = true; + $context['ssl']['SNI_server_name'] = $host; + } + } + if(ini_get('allow_url_fopen')) { + $context['http'] = array( + 'method' => $post ? 'POST' : 'GET', + 'header' => $header, + 'timeout' => $timeout + ); + if($post) { + $context['http']['content'] = $post; + } + $context = stream_context_create($context); + $fp = @fopen($scheme.'://'.($ip ? $ip : $host).':'.$port.$path, 'b', false, $context); + $fpflag = 1; + } elseif(function_exists('stream_socket_client')) { + $context = stream_context_create($context); + $fp = @stream_socket_client(($scheme == 'https' ? 'ssl://' : '').($ip ? $ip : $host).':'.$port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context); + } else { + $fp = @fsocketopen(($scheme == 'https' ? 'ssl://' : '').($scheme == 'https' ? $host : ($ip ? $ip : $host)), $port, $errno, $errstr, $timeout); + } + + if(!$fp) { + return ''; + } else { + stream_set_blocking($fp, $block); + stream_set_timeout($fp, $timeout); + if(!$fpflag) { + @fwrite($fp, $out); + } + $status = stream_get_meta_data($fp); + if(!$status['timed_out']) { + while (!feof($fp) && !$fpflag) { + if(($header = @fgets($fp)) && ($header == "\r\n" || $header == "\n")) { + break; + } + } + + $stop = false; + while(!feof($fp) && !$stop) { + $data = fread($fp, ($limit == 0 || $limit > 8192 ? 8192 : $limit)); + $return .= $data; + if($limit) { + $limit -= strlen($data); + $stop = $limit <= 0; + } + } + } + @fclose($fp); + return $return; + } +} + +function check_env() { + + global $lang, $attachdir; + + $errors = array('quit' => false); + $quit = false; + + if(!function_exists('mysqli_connect')) { + $errors[] = 'mysqli_unsupport'; + $quit = true; + } + + if(!file_exists(DISCUZ_ROOT.'./config.inc.php')) { + $errors[] = 'config_nonexistence'; + $quit = true; + } elseif(!is_writeable(DISCUZ_ROOT.'./config.inc.php')) { + $errors[] = 'config_unwriteable'; + $quit = true; + } + + $checkdirarray = array( + 'attach' => $attachdir, + 'forumdata' => './forumdata', + 'cache' => './forumdata/cache', + 'ftemplates' => './forumdata/templates', + 'threadcache' => './forumdata/threadcaches', + 'log' => './forumdata/logs', + 'uccache' => './uc_client/data/cache' + ); + + foreach($checkdirarray as $key => $dir) { + if(!dir_writeable(DISCUZ_ROOT.$dir)) { + $langkey = $key.'_unwriteable'; + $errors[] = $key.'_unwriteable'; + if(!in_array($key, array('ftemplate'))) { + $quit = TRUE; + } + } + } + + $errors['quit'] = $quit; + return $errors; + +} + +function show_error($type, $errors = '', $quit = false) { + + global $lang, $step; + + $title = lang($type); + $comment = lang($type.'_comment', false); + $errormsg = ''; + if($errors) { + if(!empty($errors)) { + foreach ((array)$errors as $k => $v) { + if(is_numeric($k)) { + $comment .= "
                                  • ".lang($v)."
                                  • "; + } + } + } + } + + if($step > 0) { + echo "
                                    $title
                                      $comment
                                    "; + } else { + echo "
                                    $title
                                      $comment
                                    "; + } + + if($quit) { + echo '
                                    '.$lang['error_quit_msg'].'





                                    '; + } + + echo '
                                    '; + + $quit && show_footer(); +} + +function show_tips($tip, $title = '', $comment = '', $style = 1) { + global $lang; + $title = empty($title) ? lang($tip) : $title; + $comment = empty($comment) ? lang($tip.'_comment', FALSE) : $comment; + if($style) { + echo "
                                    $title"; + } else { + echo "
                                    $title
                                      "; + } + $comment && print('
                                      '.$comment); + echo "
                                    "; +} + +function show_setting($setname, $varname = '', $value = '', $type = 'text|password|checkbox', $error = '') { + if($setname == 'start') { + echo "
                                    \n
                                    \n"; + return; + } elseif($setname == 'end') { + echo "\n
                                    \n\n"; + return; + } elseif($setname == 'hidden') { + echo "\n"; + return; + } + + echo "\n".' '.(empty($setname) ? '' : lang($setname).':')."\n"; + if($type == 'text' || $type == 'password') { + $value = dhtmlspecialchars($value); + echo ""; + } elseif($type == 'submit') { + $value = empty($value) ? 'next_step' : $value; + echo "\n"; + } elseif($type == 'checkbox') { + if(!is_array($varname) && !is_array($value)) { + echo'\n"; + } + } else { + echo $value; + } + + echo "\n "; + if($error) { + $comment = ''.(is_string($error) ? lang($error) : lang($setname.'_error')).''; + } else { + $comment = lang($setname.'_comment', false); + } + echo "$comment\n\n"; + return true; +} + +function show_step($step) { + + global $method; + + $laststep = 4; + $title = lang('step_'.$method.'_title'); + $comment = lang('step_'.$method.'_desc'); + + $stepclass = array(); + for($i = 1; $i <= $laststep; $i++) { + $stepclass[$i] = $i == $step ? 'current' : ($i < $step ? '' : 'unactivated'); + } + $stepclass[$laststep] .= ' last'; + + echo << +

                                    $title

                                    +

                                    $comment

                                    +
                              +
                              +
                                +
                              • 1
                              • +
                              • 2
                              • +
                              • 3
                              • +
                              • 4
                              • +
                              +
                              +
                              + +
                              +EOT; + +} + +function lang($lang_key, $force = true) { + return isset($GLOBALS['lang'][$lang_key]) ? $GLOBALS['lang'][$lang_key] : ($force ? $lang_key : ''); +} + +function check_adminuser($username, $password, $email) { + + @include ROOT_PATH.'./config.inc.php'; + include ROOT_PATH.'./uc_client/client.php'; + $error = ''; + $uid = uc_user_register($username, $password, $email); + if($uid == -1 || $uid == -2) { + $error = 'admin_username_invalid'; + } elseif($uid == -4 || $uid == -5 || $uid == -6) { + $error = 'admin_email_invalid'; + } elseif($uid == -3) { + $ucresult = uc_user_login($username, $password); + list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult); + $ucresult = $tmp; + if($ucresult['uid'] <= 0) { + $error = 'admin_exist_password_error'; + } else { + $uid = $ucresult['uid']; + $email = $ucresult['email']; + $password = $ucresult['password']; + } + } + + if(!$error && $uid > 0) { + $password = md5($password); + uc_user_addprotected($username, ''); + } else { + $uid = 0; + $error = empty($error) ? 'error_unknow_type' : $error; + } + return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error); +} + +function dhtmlspecialchars($string, $flags = null) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = dhtmlspecialchars($val, $flags); + } + } else { + if($flags === null) { + $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); + if(strpos($string, '&#') !== false) { + $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string); + } + } else { + if(PHP_VERSION < '5.4.0') { + $string = htmlspecialchars($string, $flags); + } else { + if(strtolower(CHARSET) == 'utf-8') { + $charset = 'UTF-8'; + } else { + $charset = 'ISO-8859-1'; + } + $string = htmlspecialchars($string, $flags, $charset); + } + } + } + return $string; +} + +function send_mime_type_header($type = 'application/xml') { + header("Content-Type: ".$type); +} + +function getmaxupload() { + $sizeconv = array('B' => 1, 'KB' => 1024, 'MB' => 1048576, 'GB' => 1073741824); + $sizes = array(); + $sizes[] = ini_get('upload_max_filesize'); + $sizes[] = ini_get('post_max_size'); + $sizes[] = ini_get('memory_limit'); + if(intval($sizes[1]) === 0) { + unset($sizes[1]); + } + if(intval($sizes[2]) === -1) { + unset($sizes[2]); + } + $sizes = preg_replace_callback( + '/^(\-?\d+)([KMG]?)$/i', + function($arg) use ($sizeconv) { + return (intval($arg[1]) * $sizeconv[strtoupper($arg[2]).'B']).'|'.strtoupper($arg[0]); + }, + $sizes + ); + natsort($sizes); + $output = explode('|', current($sizes)); + if(!empty($output[1])) { + return $output[1]; + } else { + return ini_get('upload_max_filesize'); + } +} \ No newline at end of file diff --git a/uc_server/install/images/bg_footer.gif b/uc_server/install/images/bg_footer.gif new file mode 100644 index 0000000..a0ea31c Binary files /dev/null and b/uc_server/install/images/bg_footer.gif differ diff --git a/uc_server/install/images/bg_repno.gif b/uc_server/install/images/bg_repno.gif new file mode 100644 index 0000000..02a84ec Binary files /dev/null and b/uc_server/install/images/bg_repno.gif differ diff --git a/uc_server/install/images/bg_repx.gif b/uc_server/install/images/bg_repx.gif new file mode 100644 index 0000000..ed6d22d Binary files /dev/null and b/uc_server/install/images/bg_repx.gif differ diff --git a/uc_server/install/images/bg_stepstatus.gif b/uc_server/install/images/bg_stepstatus.gif new file mode 100644 index 0000000..f364e21 Binary files /dev/null and b/uc_server/install/images/bg_stepstatus.gif differ diff --git a/uc_server/install/images/close.gif b/uc_server/install/images/close.gif new file mode 100644 index 0000000..5022b9b Binary files /dev/null and b/uc_server/install/images/close.gif differ diff --git a/uc_server/install/images/index.htm b/uc_server/install/images/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/install/images/stepnum.gif b/uc_server/install/images/stepnum.gif new file mode 100644 index 0000000..35f41d5 Binary files /dev/null and b/uc_server/install/images/stepnum.gif differ diff --git a/uc_server/install/index.htm b/uc_server/install/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/install/lang.inc.php b/uc_server/install/lang.inc.php new file mode 100644 index 0000000..a809c70 --- /dev/null +++ b/uc_server/install/lang.inc.php @@ -0,0 +1,230 @@ + '简体中文 UTF8 版', + 'TC_UTF8' => '繁体中文 UTF8 版', + + 'title_install' => SOFT_NAME.' 安装向导', + 'agreement_yes' => '我同意', + 'agreement_no' => '我不同意', + 'notset' => '不限制', + + 'message_title' => '提示信息', + 'error_message' => '错误信息', + 'message_return' => '返回', + 'return' => '返回', + 'install_wizard' => '安装向导', + 'config_nonexistence' => '配置文件不存在', + 'nodir' => '目录不存在', + 'short_open_tag_invalid' => '对不起,请将 php.ini 中的 short_open_tag 设置为 On,否则无法继续安装。', + 'redirect' => '浏览器会自动跳转页面,无需人工干预。
                              除非当您的浏览器没有自动跳转时,请点击这里', + + 'database_errno_2003' => '无法连接数据库,请检查数据库是否启动,数据库服务器地址是否正确', + 'database_errno_1044' => '无法创建新的数据库,请检查数据库名称填写是否正确', + 'database_errno_1045' => '无法连接数据库,请检查数据库用户名或者密码是否正确', + 'database_errno_1064' => 'SQL 语法错误', + + 'dbpriv_createtable' => '没有CREATE TABLE权限,无法继续安装', + 'dbpriv_insert' => '没有INSERT权限,无法继续安装', + 'dbpriv_select' => '没有SELECT权限,无法继续安装', + 'dbpriv_update' => '没有UPDATE权限,无法继续安装', + 'dbpriv_delete' => '没有DELETE权限,无法继续安装', + 'dbpriv_droptable' => '没有DROP TABLE权限,无法安装', + + 'db_not_null' => '数据库中已经安装过 UCenter, 继续安装会清空原有数据。', + 'db_drop_table_confirm' => '继续安装会清空全部原有数据,您确定要继续吗?', + + 'writeable' => '可写', + 'unwriteable' => '不可写', + 'old_step' => '上一步', + 'new_step' => '下一步', + + 'database_errno_2003' => '无法连接数据库,请检查数据库是否启动,数据库服务器地址是否正确', + 'database_errno_1044' => '无法创建新的数据库,请检查数据库名称填写是否正确', + 'database_errno_1045' => '无法连接数据库,请检查数据库用户名或者密码是否正确', + + 'step_env_check_title' => '开始安装', + 'step_env_check_desc' => '环境以及文件目录权限检查', + 'step_db_init_title' => '安装数据库', + 'step_db_init_desc' => '正在执行数据库安装', + + 'step1_file' => '目录文件', + 'step1_need_status' => '所需状态', + 'step1_status' => '当前状态', + 'not_continue' => '请将以上红叉部分修正再试', + + 'tips_dbinfo' => '填写数据库信息', + 'tips_dbinfo_comment' => '', + 'tips_admininfo' => '填写管理员信息', + 'tips_admininfo_comment' => '请牢记 UCenter 创始人密码,凭该密码登陆 UCenter。', + 'step_ext_info_title' => '安装成功 ', + 'step_ext_info_desc' => '点击进入登陆', + + 'ext_info_succ' => '安装成功 ', + 'install_locked' => '安装锁定,已经安装过了,如果您确定要重新安装,请到服务器上删除
                              '.str_replace(ROOT_PATH, '', $lockfile), + 'error_quit_msg' => '您必须解决以上问题,安装才可以继续', + + 'step_app_reg_title' => '设置运行环境', + 'step_app_reg_desc' => '检测服务器环境以及设置 UCenter', + 'tips_ucenter' => '请填写 UCenter 相关信息', + 'tips_ucenter_comment' => 'UCenter 是 Comsenz 公司产品的核心服务程序,Discuz! Board 的安装和运行依赖此程序。如果您已经安装了 UCenter,请填写以下信息。否则,请到 Comsenz 产品中心 下载并且安装,然后再继续。', + + 'advice_mysqli_connect' => '请检查 mysqli 模块是否正确加载', + 'advice_xml_parser_create' => '该函数需要 PHP 支持 XML 。请联系服务商,确定开启了此项功能', + 'advice_json_encode' => '该函数需要 PHP 支持 JSON 。请联系服务商,确定开启了此项功能', + 'advice_fsockopen' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系服务商,确定开启了此项功能', + 'advice_pfsockopen' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系服务商,确定开启了此项功能', + 'advice_stream_socket_client' => '该函数需要 php.ini 中 stream_socket_client 函数开启。请联系服务商,确定开启了此项功能', + 'advice_curl_init' => '该函数需要 php.ini 中 curl_init 函数开启。请联系服务商,确定开启了此项功能', + + 'undefine_func' => '不存在的函数', + 'mysqli_unsupport' => '请检查 mysqli 模块是否正确加载', + + 'ucurl' => 'UCenter 的 URL', + 'ucpw' => 'UCenter 创始人密码', + + 'tips_siteinfo' => '请填写站点信息', + 'sitename' => '站点名称', + 'siteurl' => '站点 URL', + + 'forceinstall' => '强制安装', + 'dbinfo_forceinstall_invalid' => '当前数据库当中已经含有同样表前缀的数据表,您可以修改“表名前缀”来避免删除旧的数据,或者选择强制安装。强制安装会删除旧数据,且无法恢复', + + 'click_to_back' => '点击返回上一步', + 'adminemail' => '系统信箱 Email', + 'adminemail_comment' => '用于发送程序错误报告', + 'dbhost_comment' => '数据库服务器地址, 一般为 localhost', + 'tablepre_comment' => '同一数据库运行多个论坛时,请修改前缀', + 'forceinstall_check_label' => '我要删除数据,强制安装 !!!', + + 'uc_url_empty' => '您没有填写 UCenter 的 URL,请返回填写', + 'uc_url_invalid' => 'URL 格式错误', + 'uc_url_unreachable' => 'UCenter 的 URL 地址可能填写错误,请检查', + 'uc_ip_invalid' => '无法解析该域名,请填写站点的 IP
                              ', + 'uc_admin_invalid' => 'UC创始人密码错误,请重新填写', + 'uc_data_invalid' => '通信失败,请检查 UC的URL 地址是否正确 ', + 'ucenter_ucurl_invalid' => 'UC的URL为空,或者格式错误,请检查', + 'ucenter_ucpw_invalid' => 'UC的创始人密码为空,或者格式错误,请检查', + 'siteinfo_siteurl_invalid' => '站点URL为空,或者格式错误,请检查', + 'siteinfo_sitename_invalid' => '站点名称为空,或者格式错误,请检查', + 'dbinfo_dbhost_invalid' => '数据库服务器为空,或者格式错误,请检查', + 'dbinfo_dbname_invalid' => '数据库名为空,或者格式错误,请检查', + 'dbinfo_dbuser_invalid' => '数据库用户名为空,或者格式错误,请检查', + 'dbinfo_dbpw_invalid' => '数据库密码为空,或者格式错误,请检查', + 'dbinfo_adminemail_invalid' => '系统邮箱为空,或者格式错误,请检查', + 'dbinfo_tablepre_invalid' => '表名前缀不能包含字符".",不能以数字开头', + 'admininfo_username_invalid' => '管理员用户名为空,或者格式错误,请检查', + 'admininfo_email_invalid' => '管理员Email为空,或者格式错误,请检查', + 'admininfo_ucfounderpw_invalid' => '管理员密码为空,请填写', + 'admininfo_ucfounderpw2_invalid' => '两次密码不一致,请检查', + + 'username' => '管理员账号', + 'email' => '管理员 Email', + 'password' => '管理员密码', + 'password_comment' => '管理员密码不能为空', + 'password2' => '重复密码', + + 'admininfo_invalid' => '管理员信息不完整,请检查管理员账号,密码,邮箱', + 'dbname_invalid' => '数据库名为空,请填写数据库名称', + 'admin_username_invalid' => '非法用户名,用户名长度不应当超过 15 个英文字符,且不能包含特殊字符,一般是中文,字母或者数字', + 'admin_password_invalid' => '密码和上面不一致,请重新输入', + 'admin_email_invalid' => 'Email 地址错误,此邮件地址已经被使用或者格式无效,请更换为其他地址', + 'admin_invalid' => '您的信息管理员信息没有填写完整,请仔细填写每个项目', + 'admin_exist_password_error' => '该用户已经存在,如果您要设置此用户为论坛的管理员,请正确输入该用户的密码,或者请更换论坛管理员的名字', + + 'tagtemplates_subject' => '标题', + 'tagtemplates_uid' => '用户 ID', + 'tagtemplates_username' => '发帖者', + 'tagtemplates_dateline' => '日期', + 'tagtemplates_url' => '主题地址', + + 'uc_version_incorrect' => '您的 UCenter 服务端版本过低,请升级 UCenter 服务端到最新版本,并且升级,下载地址:https://www.discuz.vip/ 。', + 'config_unwriteable' => '安装向导无法写入配置文件, 请设置 config.inc.php 程序属性为可写状态(777)', + + 'install_in_processed' => '正在安装...', + 'install_succeed' => '安装用户中心成功,点击进入下一步', + 'copyright' => '© 2001-'.date('Y').' Discuz! Team.', + 'license' => '

                              中文版授权协议 适用于中文用户

                              + +

                              版权所有 (c) 2001-'.date('Y').',腾讯云计算(北京)有限责任公司(原北京康盛新创科技有限责任公司)保留所有权利。

                              + +

                              感谢您选择 UCenter 产品。希望我们的努力能为您提供一个高效快速和强大的站点解决方案。

                              + +

                              北京康盛新创科技有限责任公司为 UCenter 产品的开发商,依法独立拥有 UCenter 产品著作权。UCenter 官方网站网址为 https://www.discuz.vip。

                              + +

                              UCenter 著作权已在中华人民共和国国家版权局注册,著作权受到法律和国际公约保护。使用者:无论个人或组织、盈利与否、用途如何(包括以学习和研究为目的),均需仔细阅读本协议,在理解、同意、并遵守本协议的全部条款后,方可开始使用 UCenter 软件。

                              + +

                              本授权协议适用且仅适用于 UCenter 1.x 版本,北京康盛新创科技有限责任公司拥有对本授权协议的最终解释权。

                              + +

                              I. 协议许可的权利

                              +
                                +
                              1. 您可以在完全遵守本最终用户授权协议的基础上,将本软件应用于非商业用途或商业用途使用(局限于本协议所适配许可的情况下),而不必支付软件版权授权费用。
                              2. +
                              3. 您可以在协议规定的约束和限制范围内修改 UCenter 源代码(如果被提供的话)或界面风格以适应您的网站要求。
                              4. +
                              5. 您拥有使用本软件构建的网站中全部会员资料、文章及相关信息的所有权,并独立承担与文章内容的相关法律义务。
                              6. +
                              7. 将本软件应用于商业用途,必须遵守中国人民共和国相关法律。若需提供技术支持方式或技术支持内容,请向官方(https://www.discuz.vip/)获取技术支持服务。
                              8. +
                              + +

                              II. 协议规定的约束和限制

                              +
                                +
                              1. 不得对本软件或与之关联的商业授权进行出租、出售、抵押或发放子许可证。
                              2. +
                              3. 无论如何,即无论用途如何、是否经过修改或美化、修改程度如何,只要使用 UCenter 的整体或任何部分,未经书面许可,页面页脚处的 UCenter 名称和下属网站(https://www.discuz.vip) 的链接都必须保留,而不能清除或修改。
                              4. +
                              5. 禁止在 UCenter 的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。
                              6. +
                              7. 如果您未能遵守本协议的条款,您的授权将被终止,所被许可的权利将被收回,并承担相应法律责任。
                              8. +
                              + +

                              III. 有限担保和免责声明

                              +
                                +
                              1. 本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。
                              2. +
                              3. 用户出于自愿而使用本软件,您必须了解使用本软件的风险,我们不承诺提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任。
                              4. +
                              5. 北京康盛新创科技有限责任公司不对使用本软件构建的网站中的文章或信息承担责任。
                              6. +
                              + +

                              有关 UCenter 最终用户授权协议、商业授权与技术服务的详细内容,均由 UCenter 官方网站独家提供。北京康盛新创科技有限责任公司拥有在不事先通知的情况下,修改授权协议和服务价目表的权力,修改后的协议或价目表对自改变之日起的新授权用户生效。

                              + +

                              电子文本形式的授权协议如同双方书面签署的协议一样,具有完全的和等同的法律效力。您一旦开始安装 UCenter,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。

                              ', + + 'uc_installed' => '您已经安装过 UCenter,如果需要重新安装,请删除 data/install.lock 文件', + 'i_agree' => '我已仔细阅读,并同意上述条款中的所有内容', + 'supportted' => '支持', + 'unsupportted' => '不支持', + 'max_size' => '支持/最大尺寸', + 'project' => '项目', + 'ucenter_required' => 'UCenter 所需配置', + 'ucenter_best' => 'UCenter 最佳', + 'curr_server' => '当前服务器', + 'env_check' => '环境检查', + 'os' => '操作系统', + 'php' => 'PHP 版本', + 'attachmentupload' => '附件上传', + 'unlimit' => '不限制', + 'version' => '版本', + 'gdversion' => 'GD 库', + 'allow' => '允许 ', + 'unix' => '类Unix', + 'diskspace' => '磁盘空间', + 'priv_check' => '目录、文件权限检查', + 'func_depend' => '函数依赖性检查', + 'func_name' => '函数名称', + 'check_result' => '检查结果', + 'suggestion' => '建议', + 'advice_mysqli' => '请检查 mysqli 模块是否正确加载', + 'advice_fopen' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系服务商,确定开启了此项功能', + 'advice_file_get_contents' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系服务商,确定开启了此项功能', + 'advice_xml' => '该函数需要 PHP 支持 XML。请联系服务商,确定开启了此项功能', + 'none' => '无', + + 'dbhost' => '数据库服务器', + 'dbuser' => '数据库用户名', + 'dbpw' => '数据库密码', + 'dbname' => '数据库名', + 'tablepre' => '数据表前缀', + + 'ucfounderpw' => '创始人密码', + 'ucfounderpw2' => '重复创始人密码', + + 'create_table' => '建立数据表', + 'succeed' => '成功 ', +); \ No newline at end of file diff --git a/uc_server/install/style.css b/uc_server/install/style.css new file mode 100644 index 0000000..9ebb9b3 --- /dev/null +++ b/uc_server/install/style.css @@ -0,0 +1,83 @@ +/* +(C) 2001-2099 Comsenz Inc. +*/ + +/* common */ +*{ word-wrap:break-word; } +body{ padding:5px 0; background:#FFF; text-align:center; } +body, td, input, textarea, select, button{ color:#666; font:12px Verdana, Tahoma, Arial, sans-serif; } +ul, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin:0; padding:0; } +h1, h2, h3, h4, h5, h6{ font-size:12px; } +a{ color:#2366A8; text-decoration:none; } + a:hover { text-decoration:underline; } + a img{ border:none; } +em, cite, strong, th{ font-style:normal; font-weight:normal; } +table{ border-collapse:collapse; } + +/* box */ +.container{ overflow:hidden; margin:0 auto; width:700px; height:auto !important;text-align:left; border:1px solid #B5CFD9; } +.header{ height:194px; background:url(images/bg_repx.gif) repeat-x; } + .header h1{ text-indent:-9999px; width:270px; height:48px; background:url(images/bg_repno.gif) no-repeat 26px 22px; } + .header span { float: right; padding-right: 10px; } +.main{ padding:20px 20px 0; background:#F7FBFE url(images/bg_repx.gif) repeat-x 0 -194px; } + .main h3{ margin:10px auto; width:75%; color:#6CA1B4; font-weight:700; } +.desc{ margin:0 auto; width:82.6%; line-height:180%; } + .desc ul{ margin-left:20px; } +.desc1{ margin:10px 0; width:100%; } + .desc1 ul{ margin-left:25px; } + .desc1 li{ margin:3px 0; } +.tb, .tb2{ margin:15px 0 15px 67px; } + .tb th{ padding:5px; color:#6CA1B4; font-weight:700; } + .tb td{ padding:3px 5px; } + .tb .w, .tb .nw, .tb .padleft{ padding-left:45px; } + .tb .pdleft1{ padding-left:67px; } +.tb2{} + .tb2 th, .tb2 td{ padding:3px 5px; } + .tbopt{ width:120px; } +.btnbox{ text-align:center; } + .btnbox input{ margin:0 2px; } + .btnbox textarea{ margin-bottom:10px; height:150px; } +.btn{ margin-top:10px; } +.footer{ line-height:40px; text-align:center; background:url(images/bg_footer.gif) repeat-x; font-size:11px; } + +/* form */ +.txt{ width:200px; } + +/* step num */ +.setup{ margin:46px 0 0 200px; padding-left:70px; } + .setup h2{ padding-top:0; *padding-top:6px; color:#6CA1B4; font-size:36px; } + .setup p{ margin-left:6px; color:#999; } +.step1{ background:url(images/stepnum.gif) no-repeat 0 8px; } +.step2{ background:url(images/stepnum.gif) no-repeat 0 -92px; } +.step3{ background:url(images/stepnum.gif) no-repeat 0 -192px; } +.step4{ background:url(images/stepnum.gif) no-repeat 0 -292px; } + +/* step status */ +.stepstat{ position:relative; bottom:-15px; left:80px; *width:593px; height:30px; } + .stepstatbg{ position:absolute; top:18px; z-index:90; width:535px; height:9px; overflow:hidden; background:#81C6F0 url(images/bg_stepstatus.gif) no-repeat; } + .stepstat ul{ position:absolute; top:3px; left:-2px; z-index:100; list-style:none; width:600px; white-space:nowrap; overflow:hidden; } + .stepstat li{ float:left; text-indent:-9999px; width:175px; height:30px; background:url(images/bg_repno.gif) no-repeat 0 -38px; } + .stepstat .current{ background:url(images/bg_repno.gif) no-repeat 0 -71px; } + .stepstat .unactivated{ background:url(images/bg_repno.gif) no-repeat 0 -103px; } + .stepstat .last{ width:20px; } +.stepstat1{ background-position:-750px 0; } +.stepstat2{ background-position:-570px 0; } +.stepstat3{ background-position:-390px 0; } +.stepstat4{ background-position:-210px 0; } + +/* file status */ +.w{ background:url(images/bg_repno.gif) no-repeat 45px -148px; } +.nw{ background:url(images/bg_repno.gif) no-repeat 45px -197px; } + +/* space */ +.marginbot{ margin-bottom:20px; } +.margintop{ margin-top:20px; } +.red{ color:red; } + +.licenseblock{ margin-bottom:15px; padding:8px; height:280px; border:1px solid #EEE; background:#FFF; overflow:scroll; overflow-x:hidden; } +.license{} + .license h1{ padding-bottom:10px; font-size:14px; text-align:center; } + .license h3{ margin:0; color:#666; } + .license p{ line-height:150%; margin:10px 0; text-indent:25px; } + .license li{ line-height:150%; margin:5px 0; } +.title{ margin:5px 0 -15px 60px; } diff --git a/uc_server/install/uc.sql b/uc_server/install/uc.sql new file mode 100644 index 0000000..4235855 --- /dev/null +++ b/uc_server/install/uc.sql @@ -0,0 +1,433 @@ +DROP TABLE IF EXISTS uc_applications; +CREATE TABLE uc_applications ( + appid smallint(6) unsigned NOT NULL auto_increment, + `type` varchar(16) NOT NULL default '', + `name` varchar(20) NOT NULL default '', + url varchar(255) NOT NULL default '', + authkey varchar(255) NOT NULL default '', + ip varchar(45) NOT NULL default '', + viewprourl varchar(255) NOT NULL, + apifilename varchar( 30 ) NOT NULL DEFAULT 'uc.php', + charset varchar(8) NOT NULL default '', + dbcharset varchar(8) NOT NULL default '', + synlogin tinyint(1) NOT NULL default '0', + recvnote tinyint(1) DEFAULT '0', + extra text NOT NULL, + tagtemplates text NOT NULL, + allowips text NOT NULL, + PRIMARY KEY (appid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_members; +CREATE TABLE uc_members ( + uid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + username char(15) NOT NULL DEFAULT '', + `password` varchar(255) NOT NULL DEFAULT '', + `secmobicc` varchar(3) NOT NULL DEFAULT '', + `secmobile` varchar(12) NOT NULL DEFAULT '', + email varchar(255) NOT NULL DEFAULT '', + myid char(30) NOT NULL DEFAULT '', + myidkey char(16) NOT NULL DEFAULT '', + regip varchar(45) NOT NULL DEFAULT '', + regdate int(10) unsigned NOT NULL DEFAULT '0', + lastloginip int(10) NOT NULL DEFAULT '0', + lastlogintime int(10) unsigned NOT NULL DEFAULT '0', + salt varchar(20) NOT NULL DEFAULT '', + secques char(8) NOT NULL default '', + PRIMARY KEY(uid), + UNIQUE KEY username(username), + KEY email(email(40)), + KEY secmobile (`secmobile`, `secmobicc`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_memberfields; +CREATE TABLE uc_memberfields ( + uid mediumint(8) unsigned NOT NULL, + blacklist text NOT NULL, + PRIMARY KEY(uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_memberlogs; +CREATE TABLE uc_memberlogs ( + lid int(10) unsigned NOT NULL AUTO_INCREMENT, + uid mediumint(8) unsigned NOT NULL, + action varchar(32) NOT NULL DEFAULT '', + extra varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(lid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_newpm; +CREATE TABLE uc_newpm ( + uid mediumint(8) unsigned NOT NULL, + PRIMARY KEY (uid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_friends; +CREATE TABLE uc_friends ( + uid mediumint(8) unsigned NOT NULL default '0', + friendid mediumint(8) unsigned NOT NULL default '0', + direction tinyint(1) NOT NULL default '0', + version int(10) unsigned NOT NULL auto_increment, + delstatus tinyint(1) NOT NULL default '0', + comment char(255) NOT NULL default '', + PRIMARY KEY(version), + KEY uid(uid), + KEY friendid(friendid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_tags; +CREATE TABLE uc_tags ( + tagname char(20) NOT NULL, + appid smallint(6) unsigned NOT NULL default '0', + data mediumtext, + expiration int(10) unsigned NOT NULL, + KEY tagname (tagname,appid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_sqlcache; +CREATE TABLE uc_sqlcache ( + sqlid char(6) NOT NULL default '', + data char(100) NOT NULL, + expiry int(10) unsigned NOT NULL, + PRIMARY KEY (sqlid), + KEY(expiry) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_settings; +CREATE TABLE uc_settings ( + `k` varchar(32) NOT NULL default '', + `v` text NOT NULL, + PRIMARY KEY (k) +) ENGINE=InnoDB; + +REPLACE INTO uc_settings(k, v) VALUES ('accessemail',''); +REPLACE INTO uc_settings(k, v) VALUES ('censoremail',''); +REPLACE INTO uc_settings(k, v) VALUES ('censorusername',''); +REPLACE INTO uc_settings(k, v) VALUES ('dateformat','y-n-j'); +REPLACE INTO uc_settings(k, v) VALUES ('doublee','0'); +REPLACE INTO uc_settings(k, v) VALUES ('nextnotetime','0'); +REPLACE INTO uc_settings(k, v) VALUES ('timeoffset','28800'); +REPLACE INTO uc_settings(k, v) VALUES ('privatepmthreadlimit','25'); +REPLACE INTO uc_settings(k, v) VALUES ('chatpmthreadlimit','30'); +REPLACE INTO uc_settings(k, v) VALUES ('chatpmmemberlimit','35'); +REPLACE INTO uc_settings(k, v) VALUES ('pmfloodctrl','15'); +REPLACE INTO uc_settings(k, v) VALUES ('pmcenter','1'); +REPLACE INTO uc_settings(k, v) VALUES ('sendpmseccode','1'); +REPLACE INTO uc_settings(k, v) VALUES ('pmsendregdays','0'); +REPLACE INTO uc_settings(k, v) VALUES ('addappbyurl','0'); +REPLACE INTO uc_settings(k, v) VALUES ('insecureoperation','0'); +REPLACE INTO uc_settings(k, v) VALUES ('maildefault', 'username@21cn.com'); +REPLACE INTO uc_settings(k, v) VALUES ('mailsend', '1'); +REPLACE INTO uc_settings(k, v) VALUES ('mailserver', 'smtp.21cn.com'); +REPLACE INTO uc_settings(k, v) VALUES ('mailport', '25'); +REPLACE INTO uc_settings(k, v) VALUES ('mailtimeout', '30'); +REPLACE INTO uc_settings(k, v) VALUES ('mailauth', '1'); +REPLACE INTO uc_settings(k, v) VALUES ('mailfrom', 'UCenter '); +REPLACE INTO uc_settings(k, v) VALUES ('mailauth_username', 'username@21cn.com'); +REPLACE INTO uc_settings(k, v) VALUES ('mailauth_password', 'password'); +REPLACE INTO uc_settings(k, v) VALUES ('maildelimiter', '0'); +REPLACE INTO uc_settings(k, v) VALUES ('mailusername', '1'); +REPLACE INTO uc_settings(k, v) VALUES ('mailsilent', '1'); +REPLACE INTO uc_settings(k, v) VALUES ('login_failedtime', '5'); +REPLACE INTO uc_settings(k, v) VALUES ('version', '1.7.0'); + +DROP TABLE IF EXISTS uc_badwords; +CREATE TABLE uc_badwords ( + id smallint(6) unsigned NOT NULL auto_increment, + `admin` varchar(15) NOT NULL default '', + find varchar(255) NOT NULL default '', + replacement varchar(255) NOT NULL default '', + findpattern varchar(255) NOT NULL default '', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_notelist; +CREATE TABLE uc_notelist ( + noteid int(10) unsigned NOT NULL auto_increment, + operation char(32) NOT NULL, + closed tinyint(4) NOT NULL default '0', + totalnum smallint(6) unsigned NOT NULL default '0', + succeednum smallint(6) unsigned NOT NULL default '0', + getdata mediumtext NOT NULL, + postdata mediumtext NOT NULL, + dateline int(10) unsigned NOT NULL default '0', + pri tinyint(3) NOT NULL default '0', + PRIMARY KEY (noteid), + KEY closed (closed,pri,noteid), + KEY dateline (dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_domains; +CREATE TABLE uc_domains ( + id int(10) unsigned NOT NULL auto_increment, + domain char(40) NOT NULL default '', + ip varchar(45) NOT NULL default '', + PRIMARY KEY (id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_feeds; +CREATE TABLE uc_feeds ( + feedid mediumint(8) unsigned NOT NULL auto_increment, + appid varchar(30) NOT NULL default '', + icon varchar(30) NOT NULL default '', + uid mediumint(8) unsigned NOT NULL default '0', + username varchar(15) NOT NULL default '', + dateline int(10) unsigned NOT NULL default '0', + hash_template varchar(32) NOT NULL default '', + hash_data varchar(32) NOT NULL default '', + title_template text NOT NULL default '', + title_data text NOT NULL default '', + body_template text NOT NULL, + body_data text NOT NULL, + body_general text NOT NULL, + image_1 varchar(255) NOT NULL default '', + image_1_link varchar(255) NOT NULL default '', + image_2 varchar(255) NOT NULL default '', + image_2_link varchar(255) NOT NULL default '', + image_3 varchar(255) NOT NULL default '', + image_3_link varchar(255) NOT NULL default '', + image_4 varchar(255) NOT NULL default '', + image_4_link varchar(255) NOT NULL default '', + target_ids varchar(255) NOT NULL default '', + PRIMARY KEY (feedid), + KEY uid (uid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_admins; +CREATE TABLE uc_admins ( + uid mediumint(8) unsigned NOT NULL auto_increment, + username char(15) NOT NULL default '', + allowadminsetting tinyint(1) NOT NULL default '0', + allowadminapp tinyint(1) NOT NULL default '0', + allowadminuser tinyint(1) NOT NULL default '0', + allowadminbadword tinyint(1) NOT NULL default '0', + allowadmintag tinyint(1) NOT NULL default '0', + allowadminpm tinyint(1) NOT NULL default '0', + allowadmincredits tinyint(1) NOT NULL default '0', + allowadmindomain tinyint(1) NOT NULL default '0', + allowadmindb tinyint(1) NOT NULL default '0', + allowadminnote tinyint(1) NOT NULL default '0', + allowadmincache tinyint(1) NOT NULL default '0', + allowadminlog tinyint(1) NOT NULL default '0', + PRIMARY KEY (uid), + UNIQUE KEY username (username) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_failedlogins; +CREATE TABLE uc_failedlogins ( + ip varchar(45) NOT NULL default '', + count tinyint(3) unsigned NOT NULL default '0', + lastupdate int(10) unsigned NOT NULL default '0', + PRIMARY KEY (ip) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_protectedmembers; +CREATE TABLE uc_protectedmembers ( + uid mediumint(8) unsigned NOT NULL default '0', + username char(15) NOT NULL default '', + appid tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + `admin` char(15) NOT NULL default '0', + UNIQUE KEY(username, appid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_mergemembers; +CREATE TABLE uc_mergemembers ( + appid smallint(6) unsigned NOT NULL, + username char(15) NOT NULL, + PRIMARY KEY (appid,username) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_vars; +CREATE TABLE uc_vars ( + name char(32) NOT NULL default '', + value char(255) NOT NULL default '', + PRIMARY KEY(name) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_mailqueue; +CREATE TABLE uc_mailqueue ( + mailid int(10) unsigned NOT NULL auto_increment, + touid mediumint(8) unsigned NOT NULL default '0', + tomail varchar(32) NOT NULL, + frommail varchar(100) NOT NULL, + subject varchar(255) NOT NULL, + message text NOT NULL, + charset varchar(15) NOT NULL, + htmlon tinyint(1) NOT NULL default '0', + level tinyint(1) NOT NULL default '1', + dateline int(10) unsigned NOT NULL default '0', + failures tinyint(3) unsigned NOT NULL default '0', + appid smallint(6) unsigned NOT NULL default '0', + PRIMARY KEY (mailid), + KEY appid (appid), + KEY level (level,failures) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_members; +CREATE TABLE uc_pm_members ( + plid mediumint(8) unsigned NOT NULL default '0', + uid mediumint(8) unsigned NOT NULL default '0', + isnew tinyint(1) NOT NULL default '0', + pmnum int(10) unsigned NOT NULL default '0', + lastupdate int(10) unsigned NOT NULL default '0', + lastdateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (plid,uid), + KEY isnew (isnew), + KEY lastdateline (uid,lastdateline), + KEY lastupdate (uid,lastupdate) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_lists; +CREATE TABLE uc_pm_lists ( + plid mediumint(8) unsigned NOT NULL auto_increment, + authorid mediumint(8) unsigned NOT NULL default '0', + pmtype tinyint(3) unsigned NOT NULL default '0', + subject varchar(80) NOT NULL, + members smallint(5) unsigned NOT NULL default '0', + min_max varchar(17) NOT NULL, + dateline int(10) unsigned NOT NULL default '0', + lastmessage text NOT NULL, + PRIMARY KEY (plid), + KEY pmtype (pmtype), + KEY min_max (min_max), + KEY authorid (authorid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_indexes; +CREATE TABLE uc_pm_indexes ( + pmid mediumint(8) unsigned NOT NULL auto_increment, + plid mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_0; +CREATE TABLE uc_pm_messages_0 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_1; +CREATE TABLE uc_pm_messages_1 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_2; +CREATE TABLE uc_pm_messages_2 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_3; +CREATE TABLE uc_pm_messages_3 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_4; +CREATE TABLE uc_pm_messages_4 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_5; +CREATE TABLE uc_pm_messages_5 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_6; +CREATE TABLE uc_pm_messages_6 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_7; +CREATE TABLE uc_pm_messages_7 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_8; +CREATE TABLE uc_pm_messages_8 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS uc_pm_messages_9; +CREATE TABLE uc_pm_messages_9 ( + pmid mediumint(8) unsigned NOT NULL default '0', + plid mediumint(8) unsigned NOT NULL default '0', + authorid mediumint(8) unsigned NOT NULL default '0', + message text NOT NULL, + delstatus tinyint(3) unsigned NOT NULL default '0', + dateline int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pmid), + KEY plid (plid,delstatus,dateline), + KEY dateline (plid,dateline) +) ENGINE=InnoDB; \ No newline at end of file diff --git a/uc_server/install/var.inc.php b/uc_server/install/var.inc.php new file mode 100644 index 0000000..6b6f376 --- /dev/null +++ b/uc_server/install/var.inc.php @@ -0,0 +1,112 @@ + array('c' => 'PHP_OS', 'r' => 'notset', 'b' => 'unix'), + 'php' => array('c' => 'PHP_VERSION', 'r' => '5.6', 'b' => '7.4'), + 'attachmentupload' => array('r' => 'notset', 'b' => '2M'), + 'gdversion' => array('r' => '1.0', 'b' => '2.0'), + 'curl' => array('r' => 'notset', 'b' => 'enable'), + 'opcache' => array('r' => 'notset', 'b' => 'enable'), + 'diskspace' => array('r' => '10M', 'b' => 'notset'), +); + +$dirfile_items = array +( + 'config' => array('type' => 'file', 'path' => './data/config.inc.php'), + 'data' => array('type' => 'dir', 'path' => './data'), + 'cache' => array('type' => 'dir', 'path' => './data/cache'), + 'view' => array('type' => 'dir', 'path' => './data/view'), + 'avatar' => array('type' => 'dir', 'path' => './data/avatar'), + 'logs' => array('type' => 'dir', 'path' => './data/logs'), + 'backup' => array('type' => 'dir', 'path' => './data/backup'), + 'tmp' => array('type' => 'dir', 'path' => './data/tmp') +); + +$form_db_init_items = array +( + 'dbinfo' => array + ( + 'dbhost' => array('type' => 'text', 'required' => 1, 'reg' => '/^.*$/', 'value' => array('type' => 'string', 'var' => 'localhost')), + 'dbname' => array('type' => 'text', 'required' => 1, 'reg' => '/^.*$/', 'value' => array('type' => 'string', 'var' => 'ucenter')), + 'dbuser' => array('type' => 'text', 'required' => 0, 'reg' => '/^.*$/', 'value' => array('type' => 'string', 'var' => 'root')), + 'dbpw' => array('type' => 'text', 'required' => 0, 'reg' => '/^.*$/', 'value' => array('type' => 'string', 'var' => '')), + 'tablepre' => array('type' => 'text', 'required' => 0, 'reg' => '/^.*$/', 'value' => array('type' => 'string', 'var' => 'uc_')), + ), + 'admininfo' => array + ( + 'ucfounderpw' => array('type' => 'password', 'required' => 1, 'reg' => '/^.*$/'), + 'ucfounderpw2' => array('type' => 'password', 'required' => 1, 'reg' => '/^.*$/'), + ) +); \ No newline at end of file diff --git a/uc_server/js/ajax.js b/uc_server/js/ajax.js new file mode 100644 index 0000000..b53fd29 --- /dev/null +++ b/uc_server/js/ajax.js @@ -0,0 +1,220 @@ +var Ajaxs = new Array(); +function Ajax(waitId) { + var aj = new Object(); + aj.waitId = waitId ? $(waitId) : null; + aj.targetUrl = ''; + aj.sendString = ''; + aj.resultHandle = null; + aj.loading = 'Loading... '; + aj.createXMLHttpRequest = function() { + var request = false; + if(window.XMLHttpRequest) { + request = new XMLHttpRequest(); + if(request.overrideMimeType) request.overrideMimeType('text/xml'); + } else if(window.ActiveXObject) { + var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP']; + for(var i=0; i]*?src=\"([^\x00]+?)\"[^\>]*( reload=\"1\")?><\/script>/ig; + var arr = new Array(); + while(arr = p.exec(s)) appendscript(arr[1], '', arr[2]); + p = /]*?( reload=\"1\")?>([^\x00]+?)<\/script>/ig; + while(arr = p.exec(s)) appendscript('', arr[2], arr[1]); + return s; +} + +function appendscript(src, text, reload) { + var id = hash(src + text); + if(!reload && in_array(id, evalscripts)) return; + if(reload && $(id)) { + $(id).parentNode.removeChild($(id)); + } + evalscripts.push(id); + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.id = id; + if(src) { + scriptNode.src = src; + } else if(text){ + scriptNode.text = text; + } + $('append').appendChild(scriptNode); +} + +function hash(string, length) { + var length = length ? length : 32; + var start = 0; + var i = 0; + var result = ''; + filllen = length - string.length % length; + for(i = 0; i < filllen; i++){ + string += "0"; + } + while(start < string.length) { + result = stringxor(result, string.substr(start, length)); + start += length; + } + return result; +} + +function stringxor(s1, s2) { + var s = ''; + var hash = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + var max = Math.max(s1.length, s2.length); + for(var i=0; i"); + } else { + ajaxframe = document.createElement("iframe"); + ajaxframe.name = ajaxframeid; + ajaxframe.id = ajaxframeid; + } + ajaxframe.style.display = 'none'; + $('append').appendChild(ajaxframe); + } + $(formid).target = ajaxframeid; + ajaxpostHandle = [formid, showid, ajaxframeid, recall]; + _attachEvent(ajaxframe, 'load', ajaxpost_load); + $(formid).submit(); + return false; +} + +function ajaxpost_load() { + var s = (is_ie && $(ajaxpostHandle[2])) ? $(ajaxpostHandle[2]).contentWindow.document.XMLDocument.text : $(ajaxpostHandle[2]).contentWindow.document.documentElement.firstChild.nodeValue; + evalscript(s); + if(s) { + $(ajaxpostHandle[1]).innerHTML = s; + if(ajaxpostHandle[3]) { + eval(ajaxpostHandle[3]); + } + } +} \ No newline at end of file diff --git a/uc_server/js/avatar/avatar.js b/uc_server/js/avatar/avatar.js new file mode 100644 index 0000000..d875c04 --- /dev/null +++ b/uc_server/js/avatar/avatar.js @@ -0,0 +1,320 @@ +function $(id) { + return !id ? null : document.getElementById(id); +} + +function getQueryVariable(variable) { + var query = window.location.search.substring(1); + var vars = query.split("&"); + for (var i = 0; i < vars.length; i++) { + var pair = vars[i].split("="); + if (pair[0] == variable) { + return pair[1]; + } + } + return (false); +} + +jQuery.noConflict(); +var dwidth = getQueryVariable('width') > 0 ? getQueryVariable('width') : 450; +var dheight = getQueryVariable('height') > 0 ? getQueryVariable('height') : 253; +jQuery('#avatardesigner').width(dwidth - 25); +jQuery('#avatardesigner').height(dheight - 25); +jQuery('#widgetparent').width(dwidth - 150); +jQuery('#widgetparent').height(dheight - 25); +jQuery('#selector').width(150); +jQuery('#selector').height(150); +jQuery('#avatarfileselector').width(dwidth - 25); +jQuery('#avatarfileselector').height(dheight - 25); +jQuery('#avatarfile').width(dwidth - 25); +jQuery('#avatarfile').height(dheight - 25); + +jQuery('#avatarcanvas').attr('width', (dwidth - 150)); +jQuery('#avatarcanvas').attr('height', dheight - 25); +jQuery('#avatardisplaycanvas').attr('width', dwidth - 25); +jQuery('#avatardisplaycanvas').attr('height', dheight - 25); +$('avatarform').target = 'uploadframe'; +$('avatarfile').onchange = uploadAvatarDone; + +jQuery(document).ready(function () { + jQuery("#selector") + .draggable({ containment: "parent", drag: function (event, ui) { refreshAvatarCanvas(ui.position); }, stop: function () { forceSelectorInsideAvatar(); } }) + .resizable({ containment: "parent", resize: function (event, ui) { refreshAvatarCanvas(ui.position); }, stop: function () { forceSelectorInsideAvatar(); } }) + .hover( + function () { jQuery(this).css({ "border-color": "red" }); }, + function () { jQuery(this).css({ "border-color": "rgba(255, 0, 0, 0.6)" }); } + ); + jQuery("#slider").slider({ + min: 0, + max: 100, + value: 50, + slide: function (event, ui) { + forceSelectorInsideAvatar(); + } + }); + jQuery("#slider").append("
                               
                              "); + jQuery("#slider").append("
                               
                              "); + jQuery("#slider").append("
                               
                              "); +}); + +window.addEventListener('message', receiveMessage, false); + +function receiveMessage(event) { + var msgdata = event.data; + if (typeof (msgdata) !== 'string') { + return; + } + rectAvatarDone(msgdata); +} + +function uploadAvatarDone() { + if (this.files && this.files[0]) { + var fr = new FileReader(); + fr.onload = function (e) { + jQuery('#avatarfileselector').hide(); + jQuery('#avatardisplayer').hide(); + jQuery('#avataradjuster').show(); + jQuery('#selector').css('left', Math.floor((dwidth - 300) / 2)); + jQuery('#selector').css('top', Math.floor((dheight - 150) / 2)); + jQuery('#selector').width(150); + jQuery('#selector').height(150); + $('avatarimage').src = e.target.result; + jQuery("#slider").slider('value', 50); + }; + fr.readAsDataURL(this.files[0]); + } +} + +function showAvatarFileSelector() { + $('avatarimage').src = null; + clearAvatar(); + $('avataradjuster').style.display = 'none'; + $('avatarfileselector').style.display = 'block'; +} + +function getAvatarDimension() { + var factor = jQuery('#slider').slider('option', 'value'); + var cw = jQuery('#widgetparent').width(); + var ch = jQuery('#widgetparent').height(); + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var minw = 48; + var minh = 48; + var midw = Math.min(Math.max(iw, 48), cw); + var midh = Math.min(Math.max(ih, 48), ch); + var maxw = Math.max(Math.max(iw, 48), cw); + var maxh = Math.max(Math.max(ih, 48), ch); + var minr = Math.max(minw / iw, minh / ih); + var midr = Math.max(midw / iw, midh / ih); + var maxr = Math.max(maxw / iw, maxh / ih); + if (factor <= 50) { + r = (minr * (50 - factor) + midr * factor) / 50; + } + else { + r = (midr * (100 - factor) + maxr * (factor - 50)) / 50; + } + var aw = r * iw; + var ah = r * ih; + var al = (cw - aw) / 2; + var at = (ch - ah) / 2; + var sd = getSelectorDimention(); + if (aw > cw) al = (cw - aw) / (cw - sd.width) * sd.left; + if (ah > ch) at = (ch - ah) / (ch - sd.height) * sd.top; + return { left: Math.floor(al), top: Math.floor(at), width: Math.floor(aw), height: Math.floor(ah) }; +} + +function clearAvatar() { + var canvas = $('avatarcanvas'); + var cw = canvas.width; + var ch = canvas.height; + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, cw, ch); +} + +function refreshAvatarCanvas(uiposition) { + var canvas = $('avatarcanvas'); + var cw = canvas.width; + var ch = canvas.height; + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, cw, ch); + var ad = getAvatarDimension(); + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var img = $('avatarimage'); + ctx.drawImage(img, 0, 0, iw, ih, ad.left, ad.top, ad.width, ad.height); + var sd = getSelectorDimention(); + if (uiposition) { + sd.left = uiposition.left; + sd.top = uiposition.top; + } + ctx.fillStyle = "rgba(0,0,0,0.6)"; + ctx.fillRect(0, 0, cw, sd.top); + ctx.fillRect(sd.left + sd.width, sd.top, cw - sd.left - sd.width, ch - sd.top); + ctx.fillRect(0, sd.top + sd.height, sd.left + sd.width, ch - sd.top - sd.height); + ctx.fillRect(0, sd.top, sd.left, sd.height); +} + +function getSelectorDimention() { + var sl = Math.ceil(jQuery('#selector').position().left); + var st = Math.ceil(jQuery('#selector').position().top); + var sw = jQuery('#selector').width(); + var sh = jQuery('#selector').height(); + return { left: sl, top: st, width: sw, height: sh }; +} + +function forceSelectorInsideAvatar() { + var sd = getSelectorDimention(); + var ad = getAvatarDimension(); + if (sd.width > ad.width) jQuery('#selector').width(ad.width); + if (sd.height > ad.height) jQuery('#selector').height(ad.height); + sd = getSelectorDimention(); + if (sd.left < ad.left) jQuery('#selector').css('left', ad.left); + if (sd.top < ad.top) jQuery('#selector').css('top', ad.top); + if (sd.left + sd.width > ad.left + ad.width) jQuery('#selector').css('left', ad.left + ad.width - sd.width); + if (sd.top + sd.height > ad.top + ad.height) jQuery('#selector').css('top', ad.top + ad.height - sd.height); + refreshAvatarCanvas(); +} + +function saveAvatar() { + var img = $('avatarimage'); + var sd = getSelectorDimention(); + var ad = getAvatarDimension(); + var rl = (sd.left - ad.left) / ad.width; + var rt = (sd.top - ad.top) / ad.height; + var rw = sd.width / ad.width; + var rh = sd.height / ad.height; + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var sl = rl * iw; + var st = rt * ih; + var sw = rw * iw; + var sh = rh * ih; + var tw = sw; + var th = sh; + if (sw > 200 || sh > 250) { + var r = Math.max(sw / 200, sh / 250); + tw = Math.floor(sw / r); + th = Math.floor(sh / r); + } + var canvas = document.createElement('canvas'); + canvas.width = tw; + canvas.height = th; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, tw, th); + ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); + var dataURL = canvas.toDataURL("image/jpeg"); + jQuery('#avatar1').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var tw = sw; + var th = sh; + if (sw > 120 || sh > 120) { + var r = Math.max(sw / 120, sh / 120); + tw = Math.floor(sw / r); + th = Math.floor(sh / r); + } + var canvas = document.createElement('canvas'); + canvas.width = tw; + canvas.height = th; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, tw, th); + ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); + var dataURL = canvas.toDataURL("image/jpeg"); + jQuery('#avatar2').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var mwh = Math.min(sw, sh); + if (sw > mwh) { + sl += Math.floor((sw - mwh) / 2); + sw = mwh; + } + if (sh > mwh) { + st += Math.floor((sh - mwh) / 2); + sh = mwh; + } + var tw = 48; + var th = 48; + var canvas = document.createElement('canvas'); + canvas.width = tw; + canvas.height = th; + var ctx = canvas.getContext("2d"); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, tw, th); + ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); + var dataURL = canvas.toDataURL("image/jpeg"); + jQuery('#avatar3').val(dataURL.substr(dataURL.indexOf(",") + 1)); + + var src = $('avatarform').action; + $('avatarform').action = window.location.href.replace('index.php?m=user&a=camera', 'index.php?m=user&a=rectavatar&base64=yes'); + $('avatarform').target = 'rectframe'; +} + +function refreshAvatarCanvasForDisplay() { + var img = $('avatarimage'); + var canvas = $('avatardisplaycanvas'); + var ctx = canvas.getContext("2d"); + var sd = getSelectorDimention(); + var ad = getAvatarDimension(); + var rl = (sd.left - ad.left) / ad.width; + var rt = (sd.top - ad.top) / ad.height; + var rw = sd.width / ad.width; + var rh = sd.height / ad.height; + var iw = jQuery('#avatarimage').width(); + var ih = jQuery('#avatarimage').height(); + var sl = rl * iw; + var st = rt * ih; + var sw = rw * iw; + var sh = rh * ih; + var tw = sw; + var th = sh; + if (sw > 200 || sh > 250) { + var r = Math.max(sw / 200, sh / 250); + tw = Math.floor(sw / r); + th = Math.floor(sh / r); + } + var ctl = 10; + var ctt = 10; + ctx.drawImage(img, sl, st, sw, sh, ctl, ctt, tw, th); + ctl += 20 + tw; + + var tw = sw; + var th = sh; + if (sw > 120 || sh > 120) { + var r = Math.max(sw / 120, sh / 120); + tw = Math.floor(sw / r); + th = Math.floor(sh / r); + } + ctx.drawImage(img, sl, st, sw, sh, ctl, ctt, tw, th); + ctl += 20 + tw; + + var tw = 48; + var th = 48; + var mwh = Math.min(sw, sh); + if (sw > mwh) { + sl += Math.floor((sw - mwh) / 2); + sw = mwh; + } + if (sh > mwh) { + st += Math.floor((sh - mwh) / 2); + sh = mwh; + } + ctx.drawImage(img, sl, st, sw, sh, ctl, ctt, tw, th); + + ctx.fillStyle = "black"; + ctx.font = "bold 16px Arial"; + ctx.fillText('上传成功!', dwidth - 160, 155); + ctx.fillStyle = "grey"; + ctx.font = "bold 12px Arial"; + ctx.fillText('以上是您头像的三种尺寸', dwidth - 200, 180); +} + +function rectAvatarDone(res) { + if (!res) return; + if (res == 'success') { + jQuery('#avatardisplayer').show(); + refreshAvatarCanvasForDisplay(); + jQuery('#avataradjuster').hide(); + jQuery('#avatarfileselector').hide(); + } else if (res == 'failure') { + alert('上传失败'); + } +} \ No newline at end of file diff --git a/uc_server/js/avatar/index.htm b/uc_server/js/avatar/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/js/avatar/jquery-ui.min.js b/uc_server/js/avatar/jquery-ui.min.js new file mode 100644 index 0000000..5824d12 --- /dev/null +++ b/uc_server/js/avatar/jquery-ui.min.js @@ -0,0 +1,13 @@ +/*! jQuery UI - v1.11.4 - 2015-03-11 +* http://jqueryui.com +* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js +* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ + +(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("
                              "))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
                              ",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("
                              "),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.widthi?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget); +i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("
                                ").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("
                                ").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("
                                ").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"").addClass(this._triggerClass).html(a?e("").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e(""),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target); +return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?""+i+"":J?"":""+i+"",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?""+n+"":J?"":""+n+"",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"",l=B?"
                                "+(Y?h:"")+(this._isInRange(e,r)?"":"")+(Y?"":h)+"
                                ":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="
                                "}for(M+="
                                "+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"
                                "+"",C=d?"":"",x=0;7>x;x++)N=(x+u)%7,C+="";for(M+=C+"",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="",E=d?"":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+""}Z++,Z>11&&(Z=0,et++),M+="
                                "+this._get(e,"weekHeader")+"=5?" class='ui-datepicker-week-end'":"")+">"+""+p[N]+"
                                "+this._get(e,"calculateWeek")(z)+""+(j&&!v?" ":W?""+z.getDate()+"":""+z.getDate()+"")+"
                                "+(Q?"
                                "+(K[0]>0&&T===K[1]-1?"
                                ":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="
                                ",_="";if(a||!g)_+=""+o[t]+"";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+=""}if(y||(b+=_+(!a&&g&&v?"":" ")),!e.yearshtml)if(e.yearshtml="",a||!v)b+=""+i+"";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":" ")+_),b+="
                                "},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("
                                ").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0) +},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.lefti[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("
                                ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("
                                "),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidthe.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
                                "),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("
                                ").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0; +if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("
                                ").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("
                                ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("
                                ").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("
                                ").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("
                                ").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("

                                ")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("

                                ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("
                                ").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()}; +f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("
                                ").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("
                                ").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("
                                ").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("
                                ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels; +this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("
                                ").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("
                                ").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("
                                ").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("
                                ").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("
                                ").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file diff --git a/uc_server/js/avatar/jquery.min.js b/uc_server/js/avatar/jquery.min.js new file mode 100644 index 0000000..3883779 --- /dev/null +++ b/uc_server/js/avatar/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v1.8.3 jquery.com | jquery.org/license */ +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
                                a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
                                t
                                ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
                                ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
                                ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

                                ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
                                ","
                                "],thead:[1,"","
                                "],tr:[2,"","
                                "],td:[3,"","
                                "],col:[2,"","
                                "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
                                ","
                                "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
                                ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/uc_server/js/calendar.js b/uc_server/js/calendar.js new file mode 100644 index 0000000..fc0002e --- /dev/null +++ b/uc_server/js/calendar.js @@ -0,0 +1,178 @@ +var controlid = null; +var currdate = null; +var startdate = null; +var enddate = null; +var yy = null; +var mm = null; +var hh = null; +var ii = null; +var currday = null; +var addtime = false; +var today = new Date(); +var lastcheckedyear = false; +var lastcheckedmonth = false; + +function loadcalendar() { + s = ''; + s += '
                                '; + s += ''; + s += ''; + s += ''; + s += ''; + s += ''; + s += ''; + s += ''; + s += ''; + s += ''; + for(var i = 0; i < 6; i++) { + s += ''; + for(var j = 1; j <= 7; j++) + s += ""; + s += ""; + } + s += ''; + s += ''; + s += '
                                  -  
                                0
                                23 ? 23 : zerofill(this.value);controlid.value=controlid.value.replace(/\\d+(\:\\d+)/ig, this.value+"$1")\'> 点 59 ? 59 : zerofill(this.value);controlid.value=controlid.value.replace(/(\\d+\:)\\d+/ig, "$1"+this.value)\'> 分
                                '; + s += ''; + s += ''; + + var div = document.createElement('div'); + div.innerHTML = s; + $('append').appendChild(div); + _attachEvent(document, 'click', function() { + $('calendar').style.display = 'none'; + $('calendar_year').style.display = 'none'; + $('calendar_month').style.display = 'none'; + }); + $('calendar').onclick = function(e) { + e = is_ie ? event : e; + _cancelBubble(e); + $('calendar_year').style.display = 'none'; + $('calendar_month').style.display = 'none'; + } + +} + +function parsedate(s) { + /(\d+)\-(\d+)\-(\d+)\s*(\d*):?(\d*)/.exec(s); + var m1 = (RegExp.$1 && RegExp.$1 > 1899 && RegExp.$1 < 2101) ? parseFloat(RegExp.$1) : today.getFullYear(); + var m2 = (RegExp.$2 && (RegExp.$2 > 0 && RegExp.$2 < 13)) ? parseFloat(RegExp.$2) : today.getMonth() + 1; + var m3 = (RegExp.$3 && (RegExp.$3 > 0 && RegExp.$3 < 32)) ? parseFloat(RegExp.$3) : today.getDate(); + var m4 = (RegExp.$4 && (RegExp.$4 > -1 && RegExp.$4 < 24)) ? parseFloat(RegExp.$4) : 0; + var m5 = (RegExp.$5 && (RegExp.$5 > -1 && RegExp.$5 < 60)) ? parseFloat(RegExp.$5) : 0; + /(\d+)\-(\d+)\-(\d+)\s*(\d*):?(\d*)/.exec("0000-00-00 00\:00"); + return new Date(m1, m2 - 1, m3, m4, m5); +} + +function settime(d) { + $('calendar').style.display = 'none'; + $('calendar_month').style.display = 'none'; + controlid.value = yy + "-" + zerofill(mm + 1) + "-" + zerofill(d) + (addtime ? ' ' + zerofill($('hour').value) + ':' + zerofill($('minute').value) : ''); +} + +function showcalendar(addtime1, startdate1, enddate1) { + e = is_ie ? event : showcalendar.caller.arguments[0]; + controlid1 = is_ie ? e.srcElement : e.target; + controlid = controlid1; + addtime = addtime1; + startdate = startdate1 ? parsedate(startdate1) : false; + enddate = enddate1 ? parsedate(enddate1) : false; + currday = controlid.value ? parsedate(controlid.value) : today; + hh = currday.getHours(); + ii = currday.getMinutes(); + var p = getposition(controlid); + $('calendar').style.display = 'block'; + $('calendar').style.left = p['x']+'px'; + $('calendar').style.top = (p['y'] + 20)+'px'; + _cancelBubble(e); + refreshcalendar(currday.getFullYear(), currday.getMonth()); + if(lastcheckedyear != false) { + $('calendar_year_' + lastcheckedyear).className = ''; + $('calendar_year_' + today.getFullYear()).className = 'bold'; + } + if(lastcheckedmonth != false) { + $('calendar_month_' + lastcheckedmonth).className = ''; + $('calendar_month_' + (today.getMonth() + 1)).className = 'bold'; + } + $('calendar_year_' + currday.getFullYear()).className = 'error bold'; + $('calendar_month_' + (currday.getMonth() + 1)).className = 'error bold'; + $('hourminute').style.display = addtime ? '' : 'none'; + lastcheckedyear = currday.getFullYear(); + lastcheckedmonth = currday.getMonth() + 1; +} + +function refreshcalendar(y, m) { + var x = new Date(y, m, 1); + var mv = x.getDay(); + var d = x.getDate(); + var dd = null; + yy = x.getFullYear(); + mm = x.getMonth(); + $("year").innerHTML = yy; + $("month").innerHTML = mm + 1 > 9 ? (mm + 1) : '0' + (mm + 1); + + for(var i = 1; i <= mv; i++) { + dd = $("d" + i); + dd.innerHTML = " "; + dd.className = ""; + } + + while(x.getMonth() == mm) { + dd = $("d" + (d + mv)); + dd.innerHTML = '' + d + ''; + if(x.getTime() < today.getTime() || (enddate && x.getTime() > enddate.getTime()) || (startdate && x.getTime() < startdate.getTime())) { + dd.className = 'grey'; + } else { + dd.className = ''; + } + if(x.getFullYear() == today.getFullYear() && x.getMonth() == today.getMonth() && x.getDate() == today.getDate()) { + dd.className = 'bold'; + dd.firstChild.title = '今天'; + } + if(x.getFullYear() == currday.getFullYear() && x.getMonth() == currday.getMonth() && x.getDate() == currday.getDate()) { + dd.className = 'error bold'; + } + x.setDate(++d); + } + + while(d + mv <= 42) { + dd = $("d" + (d + mv)); + dd.innerHTML = " "; + d++; + } + + if(addtime) { + $('hour').value = zerofill(hh); + $('minute').value = zerofill(ii); + } +} + +function showdiv(id) { + var p = getposition($(id)); + $('calendar_' + id).style.left = p['x']+'px'; + $('calendar_' + id).style.top = (p['y'] + 16)+'px'; + $('calendar_' + id).style.display = 'block'; +} + +function zerofill(s) { + var s = parseFloat(s.toString().replace(/(^[\s0]+)|(\s+$)/g, '')); + s = isNaN(s) ? 0 : s; + return (s < 10 ? '0' : '') + s.toString(); +} + +window.onload = function() { + loadcalendar(); +} \ No newline at end of file diff --git a/uc_server/js/common.js b/uc_server/js/common.js new file mode 100644 index 0000000..a5b6439 --- /dev/null +++ b/uc_server/js/common.js @@ -0,0 +1,148 @@ +var userAgent = navigator.userAgent.toLowerCase(); +var is_opera = userAgent.indexOf('opera') != -1 && opera.version(); +var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3); +var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3); + +function $(id) { + return document.getElementById(id); +} + +Array.prototype.push = function(value) { + this[this.length] = value; + return this.length; +} + +function getcookie(name) { + var cookie_start = document.cookie.indexOf(name); + var cookie_end = document.cookie.indexOf(";", cookie_start); + return cookie_start == -1 ? '' : unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length))); +} + +function setcookie(cookieName, cookieValue, seconds, path, domain, secure) { + seconds = seconds ? seconds : 8400000; + var expires = new Date(); + expires.setTime(expires.getTime() + seconds); + document.cookie = escape(cookieName) + '=' + escape(cookieValue) + + (expires ? '; expires=' + expires.toGMTString() : '') + + (path ? '; path=' + path : '/') + + (domain ? '; domain=' + domain : '') + + (secure ? '; secure' : ''); +} + +function _attachEvent(obj, evt, func) { + if(obj.addEventListener) { + obj.addEventListener(evt, func, false); + } else if(obj.attachEvent) { + obj.attachEvent("on" + evt, func); + } +} + +function _cancelBubble(e, returnValue) { + if(!e) return ; + if(is_ie) { + if(!returnValue) e.returnValue = false; + e.cancelBubble = true; + } else { + e.stopPropagation(); + if(!returnValue) e.preventDefault(); + } +} + +function checkall(name) { + var e = is_ie ? event : checkall.caller.arguments[0]; + obj = is_ie ? e.srcElement : e.target; + var arr = document.getElementsByName(name); + var k = arr.length; + for(var i=0; i'; + for(var i in creditsettings) { + s += ''; + } + s += ''; + $(obj).innerHTML = s; +} + +function setselect(selectobj, value) { + var len = selectobj.options.length; + for(i = 0;i < len;i++) { + if(selectobj.options[i].value == value) { + selectobj.options[i].selected = true; + } + } +} + +function show(id, display) { + if(!$(id)) return false; + if(display == 'auto') { + $(id).style.display = $(id).style.display == '' ? 'none' : ''; + } else { + $(id).style.display = display; + } +} \ No newline at end of file diff --git a/uc_server/js/index.htm b/uc_server/js/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/js/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/js/pm_editor.js b/uc_server/js/pm_editor.js new file mode 100644 index 0000000..5499208 --- /dev/null +++ b/uc_server/js/pm_editor.js @@ -0,0 +1,216 @@ +var userAgent = navigator.userAgent.toLowerCase(); +var is_opera = userAgent.indexOf('opera') != -1 && opera.version(); +var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3); +var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3); + +function isUndefined(variable) { + return typeof variable == 'undefined' ? true : false; +} + +function $(id) { + return document.getElementById(id); +} + +function fetchOffset(obj) { + var left_offset = obj.offsetLeft; + var top_offset = obj.offsetTop; + while((obj = obj.offsetParent) != null) { + left_offset += obj.offsetLeft; + top_offset += obj.offsetTop; + } + return { 'left' : left_offset, 'top' : top_offset }; +} + +function _attachEvent(obj, evt, func) { + if(obj.addEventListener) { + obj.addEventListener(evt, func, false); + } else if(obj.attachEvent) { + obj.attachEvent("on" + evt, func); + } +} + +function strlen(str) { + return (is_ie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length; +} + +var menus = new menu_handler(); + +function menu_handler() { + this.menu = Array(); +} + +function menuitems() { + this.ctrlobj = null, + this.menuobj = null; + this.parentids = Array(); + this.allowhide = 1; + this.hidelock = 0; + this.clickstatus = 0; +} + +function menuobjpos(id, offset) { + if(!menus.menu[id]) { + return; + } + if(!offset) { + offset = 0; + } + var showobj = menus.menu[id].ctrlobj; + var menuobj = menus.menu[id].menuobj; + showobj.pos = fetchOffset(showobj); + showobj.X = showobj.pos['left']; + showobj.Y = showobj.pos['top']; + showobj.w = showobj.offsetWidth; + showobj.h = showobj.offsetHeight; + menuobj.w = menuobj.offsetWidth; + menuobj.h = menuobj.offsetHeight; + if(offset < 3) { + menuobj.style.left = (showobj.X + menuobj.w > document.body.clientWidth) && (showobj.X + showobj.w - menuobj.w >= 0) ? showobj.X + showobj.w - menuobj.w + 'px' : showobj.X + 'px'; + menuobj.style.top = offset == 1 ? showobj.Y + 'px' : (offset == 2 || ((showobj.Y + showobj.h + menuobj.h > document.documentElement.scrollTop + document.documentElement.clientHeight) && (showobj.Y - menuobj.h >= 0)) ? (showobj.Y - menuobj.h) + 'px' : showobj.Y + showobj.h + 'px'); + } else if(offset == 3) { + menuobj.style.left = (document.body.clientWidth - menuobj.clientWidth) / 2 + document.body.scrollLeft + 'px'; + menuobj.style.top = (document.body.clientHeight - menuobj.clientHeight) / 2 + document.body.scrollTop + 'px'; + } else if(offset == 4) { + menuobj.style.left = (showobj.X + menuobj.w > document.body.clientWidth) && (showobj.X + showobj.w - menuobj.w >= 0) ? showobj.X + showobj.w - menuobj.w + 'px' : showobj.X + showobj.w + 'px'; + menuobj.style.top = showobj.Y + 'px'; + } + if(menuobj.style.clip && !is_opera) { + menuobj.style.clip = 'rect(auto, auto, auto, auto)'; + } +} + +function showmenu(event, id, click, position) { + if(isUndefined(click)) click = false; + if(!menus.menu[id]) { + menus.menu[id] = new menuitems(); + menus.menu[id].ctrlobj = $(id); + if(!menus.menu[id].ctrlobj.getAttribute('parentmenu')) { + menus.menu[id].parentids = Array(); + } else { + menus.menu[id].parentids = menus.menu[id].ctrlobj.getAttribute('parentmenu').split(','); + } + menus.menu[id].menuobj = $(id + '_menu'); + menus.menu[id].menuobj.style.position = 'absolute'; + if(event.type == 'mouseover') { + _attachEvent(menus.menu[id].ctrlobj, 'mouseout', function() { setTimeout(function() {hidemenu(id)}, 100); }); + _attachEvent(menus.menu[id].menuobj, 'mouseover', function() { lockmenu(id, 0); }); + _attachEvent(menus.menu[id].menuobj, 'mouseout', function() { lockmenu(id, 1);setTimeout(function() {hidemenu(id)}, 100); }); + } else if(click || event.type == 'click') { + menus.menu[id].clickstatus = 1; + lockmenu(id, 0); + } + } else if(menus.menu[id].clickstatus == 1) { + lockmenu(id, 1); + hidemenu(id); + menus.menu[id].clickstatus = 0; + return; + } + + menuobjpos(id, position); + menus.menu[id].menuobj.style.display = ''; +} + +function hidemenu(id) { + if(!menus.menu[id] || !menus.menu[id].allowhide || menus.menu[id].hidelock) { + return; + } + menus.menu[id].menuobj.style.display = 'none'; +} + +function lockmenu(id, value) { + if(!menus.menu[id]) { + return; + } + for(i = 0;i < menus.menu[id].parentids.length;i++) { + menus.menu[menus.menu[id].parentids[i]].hidelock = value == 0 ? 1 : 0; + } + menus.menu[id].allowhide = value; +} + +var lang = new Array(); +function insertunit(text, textend, moveend) { + $('pm_textarea').focus(); + textend = isUndefined(textend) ? '' : textend; + moveend = isUndefined(textend) ? 0 : moveend; + startlen = strlen(text); + endlen = strlen(textend); + if(!isUndefined($('pm_textarea').selectionStart)) { + var opn = $('pm_textarea').selectionStart + 0; + if(textend != '') { + text = text + $('pm_textarea').value.substring($('pm_textarea').selectionStart, $('pm_textarea').selectionEnd) + textend; + } + $('pm_textarea').value = $('pm_textarea').value.substr(0, $('pm_textarea').selectionStart) + text + $('pm_textarea').value.substr($('pm_textarea').selectionEnd); + if(!moveend) { + $('pm_textarea').selectionStart = opn + strlen(text) - endlen; + $('pm_textarea').selectionEnd = opn + strlen(text) - endlen; + } + } else if(document.selection && document.selection.createRange) { + var sel = document.selection.createRange(); + if(textend != '') { + text = text + sel.text + textend; + } + sel.text = text.replace(/\r?\n/g, '\r\n'); + if(!moveend) { + sel.moveStart('character', -endlen); + sel.moveEnd('character', -endlen); + } + sel.select(); + } else { + $('pm_textarea').value += text; + } +} + +function getSel() { + if(!isUndefined($('pm_textarea').selectionStart)) { + return $('pm_textarea').value.substr($('pm_textarea').selectionStart, $('pm_textarea').selectionEnd - $('pm_textarea').selectionStart); + } else if(document.selection && document.selection.createRange) { + return document.selection.createRange().text; + } else if(window.getSelection) { + return window.getSelection() + ''; + } else { + return false; + } +} + +function insertlist(type) { + txt = getSel(); + type = isUndefined(type) ? '' : '=' + type; + if(txt) { + var regex = new RegExp('([\r\n]+|^[\r\n]*)(?!\\[\\*\\]|\\[\\/?list)(?=[^\r\n])', 'gi'); + txt = '[list' + type + ']\n' + txt.replace(regex, '$1[*]') + '\n' + '[/list]'; + insertunit(txt); + } else { + insertunit('[list' + type + ']\n', '[/list]'); + + while(listvalue = prompt(lang['pm_prompt_list'], '')) { + if(is_opera > 8) { + listvalue = '\n' + '[*]' + listvalue; + insertunit(listvalue); + } else { + listvalue = '[*]' + listvalue + '\n'; + insertunit(listvalue); + } + } + } +} + +function inserttag(tag, type) { + txt = getSel(); + type = isUndefined(type) ? 0 : type; + if(!type) { + if(!txt) { + txt = prompt(lang['pm_prompt_' + tag], '') + } + if(txt) { + insertunit('[' + tag + ']' + txt + '[/' + tag + ']'); + } + } else { + txt1 = prompt(lang['pm_prompt_' + tag], ''); + if(!txt) { + txt = txt1; + } + if(txt1) { + insertunit('[' + tag + '=' + txt1 + ']' + txt + '[/' + tag + ']'); + } + } +} \ No newline at end of file diff --git a/uc_server/lib/dbi.class.php b/uc_server/lib/dbi.class.php new file mode 100644 index 0000000..97350bc --- /dev/null +++ b/uc_server/lib/dbi.class.php @@ -0,0 +1,235 @@ +dbhost = $dbhost; + $this->dbuser = $dbuser; + $this->dbpw = $dbpw; + $this->dbname = $dbname; + $this->dbcharset = $dbcharset; + $this->pconnect = $pconnect; + $this->tablepre = $tablepre; + $this->time = $time; + + mysqli_report(MYSQLI_REPORT_OFF); + + if(!$this->link = new mysqli($dbhost, $dbuser, $dbpw, $dbname)) { + $this->halt('Can not connect to MySQL server'); + } + + $this->link->options(MYSQLI_OPT_LOCAL_INFILE, false); + + if($dbcharset) { + $this->link->set_charset($dbcharset); + } + + $this->link->query("SET sql_mode=''"); + + $this->link->query("SET character_set_client=binary"); + + } + + function fetch_array($query, $result_type = MYSQLI_ASSOC) { + return $query ? $query->fetch_array($result_type) : null; + } + + function result_first($sql) { + $query = $this->query($sql); + return $this->result($query, 0); + } + + function fetch_first($sql) { + $query = $this->query($sql); + return $this->fetch_array($query); + } + + function fetch_all($sql, $id = '') { + $arr = array(); + $query = $this->query($sql); + while($data = $this->fetch_array($query)) { + $id ? $arr[$data[$id]] = $data : $arr[] = $data; + } + return $arr; + } + + function result_first_stmt($sql, $key = array(), $value = array()) { + $query = $this->query_stmt($sql, $key, $value); + return $this->result($query, 0); + } + + function fetch_first_stmt($sql, $key = array(), $value = array()) { + $query = $this->query_stmt($sql, $key, $value); + return $this->fetch_array($query); + } + + function fetch_all_stmt($sql, $key = array(), $value = array(), $id = '') { + $arr = array(); + $query = $this->query_stmt($sql, $key, $value); + while($data = $this->fetch_array($query)) { + $id ? $arr[$data[$id]] = $data : $arr[] = $data; + } + return $arr; + } + + function cache_gc() { + $this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time"); + } + + function query($sql, $type = '', $cachetime = FALSE) { + $resultmode = $type == 'UNBUFFERED' ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT; + if(!($query = $this->link->query($sql, $resultmode)) && $type != 'SILENT') { + $this->halt('MySQL Query Error', $sql); + } + $this->querynum++; + $this->histories[] = $sql; + return $query; + } + + function query_stmt($sql, $key = array(), $value = array(), $type = '', $saveprep = FALSE, $cachetime = FALSE) { + $parse = $this->parse_query($sql, $key, $value); + if($saveprep && array_key_exists(hash("sha256", $parse[0]), $this->stmtcache)) { + $stmt = & $this->stmtcache[hash("sha256", $parse[0])]; + } else { + $stmt = $this->link->prepare($parse[0]); + $saveprep && $this->stmtcache[hash("sha256", $parse[0])] = & $stmt; + } + if(!empty($key)) { + $stmt->bind_param(...$parse[1]); + } + if(!($query = $stmt->execute()) && $type != 'SILENT') { + $this->halt('MySQL Query Error', $parse[0]); + } + $this->querynum++; + $this->histories[] = $parse[0]; + return strncasecmp("SELECT", $sql, 6) ? $query : $stmt->get_result(); + } + + function affected_rows() { + return $this->link->affected_rows; + } + + function error() { + return $this->link->error; + } + + function errno() { + return $this->link->errno; + } + + function result($query, $row) { + if(!$query || $query->num_rows == 0) { + return null; + } + $query->data_seek($row); + $assocs = $query->fetch_row(); + return $assocs[0]; + } + + function num_rows($query) { + $query = $query ? $query->num_rows : 0; + return $query; + } + + function num_fields($query) { + return $query ? $query->field_count : 0; + } + + function free_result($query) { + return $query ? $query->free() : false; + } + + function insert_id() { + return ($id = $this->link->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); + } + + function fetch_row($query) { + $query = $query ? $query->fetch_row() : null; + return $query; + } + + function fetch_fields($query) { + return $query ? $query->fetch_field() : null; + } + + function version() { + return $this->link->server_info; + } + + function escape_string($str) { + return $this->link->escape_string($str); + } + + function close() { + return $this->link->close(); + } + + function parse_query($sql, $key = array(), $value = array()) { + $list = ''; + $array = array(); + if(strpos($sql, '?')) { + foreach ($key as $k => $v) { + if(in_array($v, array('i', 'd', 's', 'b'))) { + $list .= $v; + $array = array_merge($array, (array)$value[$k]); + } + } + } else { + preg_match_all("/:([A-Za-z0-9]*?)( |$)/", $sql, $matches); + foreach ($matches[1] as $match) { + if(in_array($key[$match], array('i', 'd', 's', 'b'))) { + $list .= $key[$match]; + $array = array_merge($array, (array)$value[$match]); + $sql = str_replace(":".$match, "?", $sql); + } + } + } + return array($sql, array_merge((array)$list, $array)); + } + + function halt($message = '', $sql = '') { + $error = $this->error(); + $errorno = $this->errno(); + if($errorno == 2006 && $this->goneaway-- > 0) { + $this->connect($this->dbhost, $this->dbuser, $this->dbpw, $this->dbname, $this->dbcharset, $this->pconnect, $this->tablepre, $this->time); + $this->query($sql); + } else { + $s = ''; + if($message) { + $s = "UCenter info: $message
                                "; + } + if($sql) { + $s .= 'SQL:'.htmlspecialchars($sql).'
                                '; + } + $s .= 'Error:'.$error.'
                                '; + $s .= 'Errno:'.$errorno.'
                                '; + $s = str_replace(UC_DBTABLEPRE, '[Table]', $s); + exit($s); + } + } +} + +?> \ No newline at end of file diff --git a/uc_server/lib/index.htm b/uc_server/lib/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/lib/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/lib/seccode.class.php b/uc_server/lib/seccode.class.php new file mode 100644 index 0000000..d271fb2 --- /dev/null +++ b/uc_server/lib/seccode.class.php @@ -0,0 +1,443 @@ += 0x30 && $unit <= 0x39) ? $seccodeunits[$unit - 0x30] : $seccodeunits[$unit - 0x57]; + } + } + + function display() { + $this->type == 2 && !extension_loaded('ming') && $this->type = 0; + $this->width = $this->width >= 0 && $this->width <= 200 ? $this->width : 150; + $this->height = $this->height >= 0 && $this->height <= 80 ? $this->height : 60; + self::seccodeconvert($this->code); + if($this->type < 2 && function_exists('imagecreate') && function_exists('imagecolorset') && function_exists('imagecopyresized') && + function_exists('imagecolorallocate') && function_exists('imagechar') && function_exists('imagecolorsforindex') && + function_exists('imageline') && function_exists('imagecreatefromstring') && (function_exists('imagegif') || function_exists('imagepng') || function_exists('imagejpeg'))) { + $this->image(); + } elseif($this->type == 2 && extension_loaded('ming')) { + $this->flash(); + } elseif($this->type == 3) { + $this->audio(); + } else { + $this->bitmap(); + } + } + + function fileext($filename) { + return trim(substr(strrchr($filename, '.'), 1, 10)); + } + + function image() { + $bgcontent = $this->background(); + + if($this->animator == 1 && function_exists('imagegif')) { + include_once $this->includepath.'gifmerge.class.php'; + $trueframe = mt_rand(1, 9); + + for($i = 0; $i <= 9; $i++) { + $this->im = imagecreatefromstring($bgcontent); + $x[$i] = $y[$i] = 0; + $this->adulterate && $this->adulterate(); + if($i == $trueframe) { + $this->ttf && function_exists('imagettftext') || $this->type == 1 ? $this->ttffont() : $this->giffont(); + $d[$i] = mt_rand(250, 400); + } else { + $this->adulteratefont(); + $d[$i] = mt_rand(5, 15); + } + ob_start(); + imagegif($this->im); + imagedestroy($this->im); + $frame[$i] = ob_get_contents(); + ob_end_clean(); + } + $anim = new GifMerge($frame, 255, 255, 255, 0, $d, $x, $y, 'C_MEMORY'); + header('Content-type: image/gif'); + echo $anim->getAnimation(); + } else { + $this->im = imagecreatefromstring($bgcontent); + $this->adulterate && $this->adulterate(); + $this->ttf && function_exists('imagettftext') || $this->type == 1 ? $this->ttffont() : $this->giffont(); + + if(function_exists('imagepng')) { + header('Content-type: image/png'); + imagepng($this->im); + } else { + header('Content-type: image/jpeg'); + imagejpeg($this->im, '', 100); + } + imagedestroy($this->im); + } + } + + function background() { + $this->im = imagecreatetruecolor($this->width, $this->height); + $backgroundcolor = imagecolorallocate($this->im, 255, 255, 255); + $backgrounds = $c = array(); + if($this->background && function_exists('imagecreatefromjpeg') && function_exists('imagecolorat') && function_exists('imagecopymerge') && + function_exists('imagesetpixel') && function_exists('imageSX') && function_exists('imageSY')) { + if($handle = @opendir($this->datapath.'background/')) { + while($bgfile = @readdir($handle)) { + if(preg_match('/\.jpg$/i', $bgfile)) { + $backgrounds[] = $this->datapath.'background/'.$bgfile; + } + } + @closedir($handle); + } + if($backgrounds) { + $imwm = imagecreatefromjpeg($backgrounds[array_rand($backgrounds)]); + $colorindex = imagecolorat($imwm, 0, 0); + $this->c = imagecolorsforindex($imwm, $colorindex); + $colorindex = imagecolorat($imwm, 1, 0); + imagesetpixel($imwm, 0, 0, $colorindex); + $c[0] = $c['red'];$c[1] = $c['green'];$c[2] = $c['blue']; + imagecopymerge($this->im, $imwm, 0, 0, mt_rand(0, 200 - $this->width), mt_rand(0, 80 - $this->height), imageSX($imwm), imageSY($imwm), 100); + imagedestroy($imwm); + } + } + if(!$this->background || !$backgrounds) { + for($i = 0;$i < 3;$i++) { + $start[$i] = mt_rand(200, 255);$end[$i] = mt_rand(100, 150);$step[$i] = ($end[$i] - $start[$i]) / $this->width;$c[$i] = $start[$i]; + } + for($i = 0;$i < $this->width;$i++) { + $color = imagecolorallocate($this->im, $c[0], $c[1], $c[2]); + imageline($this->im, $i, 0, $i-(isset($angle) ? $angle : 0), $this->height, $color); + $c[0] += $step[0];$c[1] += $step[1];$c[2] += $step[2]; + } + $c[0] -= 20;$c[1] -= 20;$c[2] -= 20; + } + ob_start(); + if(function_exists('imagepng')) { + imagepng($this->im); + } else { + imagejpeg($this->im, '', 100); + } + imagedestroy($this->im); + $bgcontent = ob_get_contents(); + ob_end_clean(); + $this->fontcolor = $c; + return $bgcontent; + } + + function adulterate() { + $linenums = $this->height / 10; + for($i=0; $i <= $linenums; $i++) { + $color = $this->color ? imagecolorallocate($this->im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)) : imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + $x = mt_rand(0, $this->width); + $y = mt_rand(0, $this->height); + if(mt_rand(0, 1)) { + imagearc($this->im, $x, $y, mt_rand(0, $this->width), mt_rand(0, $this->height), mt_rand(0, 360), mt_rand(0, 360), $color); + } else { + $linemaxlong = isset($linemaxlong) ? $linemaxlong : 0; + $linex = isset($linex) ? $linex : 0; + $liney = isset($liney) ? $liney : 0; + imageline($this->im, $x, $y, $linex + mt_rand(0, $linemaxlong), $liney + mt_rand(0, mt_rand($this->height, $this->width)), $color); + } + } + } + + function adulteratefont() { + $seccodeunits = 'BCEFGHJKMPQRTVWXY2346789'; + $x = $this->width / 4; + $y = $this->height / 10; + $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + for($i = 0; $i <= 3; $i++) { + $adulteratecode = $seccodeunits[mt_rand(0, 23)]; + imagechar($this->im, 5, $x * $i + mt_rand(0, $x - 10), mt_rand($y, $this->height - 10 - $y), $adulteratecode, $text_color); + } + } + + function ttffont() { + $seccode = $this->code; + $charset = isset($GLOBALS['charset']) ? $GLOBALS['charset'] : ''; + $seccoderoot = $this->type ? $this->fontpath.'ch/' : $this->fontpath.'en/'; + $dirs = opendir($seccoderoot); + $seccodettf = array(); + while($entry = readdir($dirs)) { + if($entry != '.' && $entry != '..' && in_array(strtolower($this->fileext($entry)), array('ttf', 'ttc'))) { + $seccodettf[] = $entry; + } + } + if(empty($seccodettf)) { + $this->giffont(); + return; + } + $seccodelength = 4; + if($this->type && !empty($seccodettf)) { + if(strtoupper($charset) != 'UTF-8') { + include $this->includepath.'chinese.class.php'; + $cvt = new Chinese($charset, 'utf8'); + $seccode = $cvt->Convert($seccode); + } + $seccode = array(substr($seccode, 0, 3), substr($seccode, 3, 3)); + $seccodelength = 2; + } + $widthtotal = 0; + for($i = 0; $i < $seccodelength; $i++) { + $font[$i]['font'] = $seccoderoot.$seccodettf[array_rand($seccodettf)]; + $font[$i]['angle'] = $this->angle ? mt_rand(-30, 30) : 0; + $font[$i]['size'] = $this->type ? $this->width / 7 : $this->width / 6; + $this->size && $font[$i]['size'] = mt_rand($font[$i]['size'] - $this->width / 40, $font[$i]['size'] + $this->width / 20); + $box = imagettfbbox($font[$i]['size'], 0, $font[$i]['font'], $seccode[$i]); + $font[$i]['zheight'] = max($box[1], $box[3]) - min($box[5], $box[7]); + $box = imagettfbbox($font[$i]['size'], $font[$i]['angle'], $font[$i]['font'], $seccode[$i]); + $font[$i]['height'] = max($box[1], $box[3]) - min($box[5], $box[7]); + $font[$i]['hd'] = $font[$i]['height'] - $font[$i]['zheight']; + $font[$i]['width'] = (max($box[2], $box[4]) - min($box[0], $box[6])) + mt_rand(0, $this->width / 8); + $font[$i]['width'] = $font[$i]['width'] > $this->width / $seccodelength ? $this->width / $seccodelength : $font[$i]['width']; + $widthtotal += $font[$i]['width']; + } + $x = mt_rand($font[0]['angle'] > 0 ? cos(deg2rad(90 - $font[0]['angle'])) * $font[0]['zheight'] : 1, $this->width - $widthtotal > 2 ? $this->width - $widthtotal : 2); + !$this->color && $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + for($i = 0; $i < $seccodelength; $i++) { + if($this->color) { + $this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)); + $this->shadow && $text_shadowcolor = imagecolorallocate($this->im, 255 - $this->fontcolor[0], 255 - $this->fontcolor[1], 255 - $this->fontcolor[2]); + $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + } elseif($this->shadow) { + $text_shadowcolor = imagecolorallocate($this->im, 255 - $this->fontcolor[0], 255 - $this->fontcolor[1], 255 - $this->fontcolor[2]); + } + $y = $font[0]['angle'] > 0 ? mt_rand($font[$i]['height'], $this->height) : mt_rand($font[$i]['height'] - $font[$i]['hd'], $this->height - $font[$i]['hd']); + $this->shadow && imagettftext($this->im, $font[$i]['size'], $font[$i]['angle'], $x + 1, $y + 1, $text_shadowcolor, $font[$i]['font'], $seccode[$i]); + imagettftext($this->im, $font[$i]['size'], $font[$i]['angle'], $x, $y, $text_color, $font[$i]['font'], $seccode[$i]); + $x += $font[$i]['width']; + } + } + + function giffont() { + $seccode = $this->code; + $seccodedir = array(); + if(function_exists('imagecreatefromgif')) { + $seccoderoot = $this->datapath.'gif/'; + $dirs = opendir($seccoderoot); + while($dir = readdir($dirs)) { + if($dir != '.' && $dir != '..' && file_exists($seccoderoot.$dir.'/9.gif')) { + $seccodedir[] = $dir; + } + } + } + $widthtotal = 0; + for($i = 0; $i <= 3; $i++) { + $this->imcodefile = $seccodedir ? $seccoderoot.$seccodedir[array_rand($seccodedir)].'/'.strtolower($seccode[$i]).'.gif' : ''; + if(!empty($this->imcodefile) && file_exists($this->imcodefile)) { + $font[$i]['file'] = $this->imcodefile; + $font[$i]['data'] = getimagesize($this->imcodefile); + $font[$i]['width'] = $font[$i]['data'][0] + mt_rand(0, 6) - 4; + $font[$i]['height'] = $font[$i]['data'][1] + mt_rand(0, 6) - 4; + $font[$i]['width'] += mt_rand(0, $this->width / 5 - $font[$i]['width']); + $widthtotal += $font[$i]['width']; + } else { + $font[$i]['file'] = ''; + $font[$i]['width'] = 8 + mt_rand(0, $this->width / 5 - 5); + $widthtotal += $font[$i]['width']; + } + } + $x = mt_rand(1, $this->width - $widthtotal); + for($i = 0; $i <= 3; $i++) { + $this->color && $this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)); + if($font[$i]['file']) { + $this->imcode = imagecreatefromgif($font[$i]['file']); + if($this->size) { + $font[$i]['width'] = mt_rand($font[$i]['width'] - $this->width / 20, $font[$i]['width'] + $this->width / 20); + $font[$i]['height'] = mt_rand($font[$i]['height'] - $this->width / 20, $font[$i]['height'] + $this->width / 20); + } + $y = mt_rand(0, $this->height - $font[$i]['height']); + if($this->shadow) { + $this->imcodeshadow = $this->imcode; + imagecolorset($this->imcodeshadow, 0 , 255 - $this->fontcolor[0], 255 - $this->fontcolor[1], 255 - $this->fontcolor[2]); + imagecopyresized($this->im, $this->imcodeshadow, $x + 1, $y + 1, 0, 0, $font[$i]['width'], $font[$i]['height'], $font[$i]['data'][0], $font[$i]['data'][1]); + } + imagecolorset($this->imcode, 0 , $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + imagecopyresized($this->im, $this->imcode, $x, $y, 0, 0, $font[$i]['width'], $font[$i]['height'], $font[$i]['data'][0], $font[$i]['data'][1]); + } else { + $y = mt_rand(0, $this->height - 20); + if($this->shadow) { + $text_shadowcolor = imagecolorallocate($this->im, 255 - $this->fontcolor[0], 255 - $this->fontcolor[1], 255 - $this->fontcolor[2]); + imagechar($this->im, 5, $x + 1, $y + 1, $seccode[$i], $text_shadowcolor); + } + $text_color = imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]); + imagechar($this->im, 5, $x, $y, $seccode[$i], $text_color); + } + $x += $font[$i]['width']; + } + } + + function flash() { + $spacing = 5; + $codewidth = ($this->width - $spacing * 5) / 4; + $strforswdaction = ''; + for($i = 0; $i <= 3; $i++) { + $strforswdaction .= $this->swfcode($codewidth, $spacing, $this->code[$i], $i+1); + } + + ming_setScale(20.00000000); + ming_useswfversion(6); + $movie = new SWFMovie(); + $movie->setDimension($this->width, $this->height); + $movie->setBackground(255, 255, 255); + $movie->setRate(31); + + $fontcolor = '0x'.(sprintf('%02s', dechex (mt_rand(0, 255)))).(sprintf('%02s', dechex (mt_rand(0, 128)))).(sprintf('%02s', dechex (mt_rand(0, 255)))); + $strAction = " + _root.createEmptyMovieClip ( 'triangle', 1 ); + with ( _root.triangle ) { + lineStyle( 3, $fontcolor, 100 ); + $strforswdaction + } + "; + $movie->add(new SWFAction( str_replace("\r", "", $strAction) )); + header('Content-type: application/x-shockwave-flash'); + $movie->output(); + } + + function swfcode($width, $d, $code, $order) { + $str = ''; + $height = $this->height - $d * 2; + $x_0 = ($order * ($width + $d) - $width); + $x_1 = $x_0 + $width / 2; + $x_2 = $x_0 + $width; + $y_0 = $d; + $y_2 = $y_0 + $height; + $y_1 = $y_2 / 2; + $y_0_5 = $y_2 / 4; + $y_1_5 = $y_1 + $y_0_5; + switch($code) { + case 'B':$str .= 'moveTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_1.', '.$y_2.');lineTo('.$x_2.', '.$y_1_5.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'C':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');';break; + case 'E':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'F':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'G':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break; + case 'H':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case 'J':$str .= 'moveTo('.$x_1.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_1_5.');';break; + case 'K':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');';break; + case 'M':$str .= 'moveTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');';break; + case 'P':$str .= 'moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');';break; + case 'Q':$str .= 'moveTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_1.', '.$y_1.');';break; + case 'R':$str .= 'moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');';break; + case 'T':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');moveTo('.$x_1.', '.$y_0.');lineTo('.$x_1.', '.$y_2.');';break; + case 'V':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');';break; + case 'W':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');';break; + case 'X':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');';break; + case 'Y':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_1.', '.$y_2.');';break; + case '2':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');';break; + case '3':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case '4':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case '6':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');';break; + case '7':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');';break; + case '8':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break; + case '9':$str .= 'moveTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');';break; + } + return $str; + } + + function audio() { + header('Content-type: audio/mpeg'); + for($i = 0;$i <= 3; $i++) { + readfile($this->datapath.'sound/'.strtolower($this->code[$i]).'.mp3'); + } + } + + function bitmap() { + $numbers = array + ( + 'B' => array('00','fc','66','66','66','7c','66','66','fc','00'), + 'C' => array('00','38','64','c0','c0','c0','c4','64','3c','00'), + 'E' => array('00','fe','62','62','68','78','6a','62','fe','00'), + 'F' => array('00','f8','60','60','68','78','6a','62','fe','00'), + 'G' => array('00','78','cc','cc','de','c0','c4','c4','7c','00'), + 'H' => array('00','e7','66','66','66','7e','66','66','e7','00'), + 'J' => array('00','f8','cc','cc','cc','0c','0c','0c','7f','00'), + 'K' => array('00','f3','66','66','7c','78','6c','66','f7','00'), + 'M' => array('00','f7','63','6b','6b','77','77','77','e3','00'), + 'P' => array('00','f8','60','60','7c','66','66','66','fc','00'), + 'Q' => array('00','78','cc','cc','cc','cc','cc','cc','78','00'), + 'R' => array('00','f3','66','6c','7c','66','66','66','fc','00'), + 'T' => array('00','78','30','30','30','30','b4','b4','fc','00'), + 'V' => array('00','1c','1c','36','36','36','63','63','f7','00'), + 'W' => array('00','36','36','36','77','7f','6b','63','f7','00'), + 'X' => array('00','f7','66','3c','18','18','3c','66','ef','00'), + 'Y' => array('00','7e','18','18','18','3c','24','66','ef','00'), + '2' => array('fc','c0','60','30','18','0c','cc','cc','78','00'), + '3' => array('78','8c','0c','0c','38','0c','0c','8c','78','00'), + '4' => array('00','3e','0c','fe','4c','6c','2c','3c','1c','1c'), + '6' => array('78','cc','cc','cc','ec','d8','c0','60','3c','00'), + '7' => array('30','30','38','18','18','18','1c','8c','fc','00'), + '8' => array('78','cc','cc','cc','78','cc','cc','cc','78','00'), + '9' => array('f0','18','0c','6c','dc','cc','cc','cc','78','00') + ); + + foreach($numbers as $i => $number) { + for($j = 0; $j < 6; $j++) { + $a1 = substr('012', mt_rand(0, 2), 1).substr('012345', mt_rand(0, 5), 1); + $a2 = substr('012345', mt_rand(0, 5), 1).substr('0123', mt_rand(0, 3), 1); + mt_rand(0, 1) == 1 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a1); + mt_rand(0, 1) == 0 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a2); + } + } + + $bitmap = array(); + for($i = 0; $i < 20; $i++) { + for($j = 0; $j <= 3; $j++) { + $bytes = $numbers[$this->code[$j]][$i]; + $a = mt_rand(0, 14); + array_push($bitmap, $bytes); + } + } + + for($i = 0; $i < 8; $i++) { + $a = substr('012345', mt_rand(0, 2), 1) . substr('012345', mt_rand(0, 5), 1); + array_unshift($bitmap, $a); + array_push($bitmap, $a); + } + + $image = pack('H*', '424d9e000000000000003e000000280000002000000018000000010001000000'. + '0000600000000000000000000000000000000000000000000000FFFFFF00'.implode('', $bitmap)); + + header('Content-Type: image/bmp'); + echo $image; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/lib/sendmail.inc.php b/uc_server/lib/sendmail.inc.php new file mode 100644 index 0000000..d33c231 --- /dev/null +++ b/uc_server/lib/sendmail.inc.php @@ -0,0 +1,146 @@ +base->cache['apps'][$mail['appid']]['name']; +$mail['subject'] = '=?'.$mail['charset'].'?B?'.base64_encode(str_replace("\r", '', str_replace("\n", '', '['.$appname.'] '.$mail['subject']))).'?='; +$mail['message'] = chunk_split(base64_encode(str_replace("\r\n.", " \r\n..", str_replace("\n", "\r\n", str_replace("\r", "\n", str_replace("\r\n", "\n", str_replace("\n\r", "\r", $mail['message']))))))); + +$email_from = $mail['frommail'] == '' ? '=?'.$mail['charset'].'?B?'.base64_encode($appname)."?= <{$mail_setting['maildefault']}>" : (preg_match('/^(.+?) \<(.+?)\>$/',$email_from, $from) ? '=?'.$mail['charset'].'?B?'.base64_encode($from[1])."?= <$from[2]>" : $mail['frommail']); + +foreach(explode(',', $mail['email_to']) as $touser) { + $tousers[] = preg_match('/^(.+?) \<(.+?)\>$/',$touser, $to) ? ($mailusername ? '=?'.$mail['charset'].'?B?'.base64_encode($to[1])."?= <$to[2]>" : $to[2]) : $touser; +} + +$tousers = is_array($tousers) ? $tousers : array($tousers); + +$mail['email_to'] = implode(',', $tousers); + +$headers = "From: $email_from{$maildelimiter}X-Priority: 3{$maildelimiter}X-Mailer: Discuz! $version{$maildelimiter}MIME-Version: 1.0{$maildelimiter}Content-type: text/".($mail['htmlon'] ? 'html' : 'plain')."; charset={$mail['charset']}{$maildelimiter}Content-Transfer-Encoding: base64{$maildelimiter}"; + +$mail_setting['mailport'] = $mail_setting['mailport'] ? $mail_setting['mailport'] : 25; +$mail_setting['mailtimeout'] = isset($mail_setting['mailtimeout']) && strlen($mail_setting['mailtimeout']) ? intval($mail_setting['mailtimeout']) : 30; + +if($mail_setting['mailsend'] == 1 && function_exists('mail')) { + + return @mail($mail['email_to'], $mail['subject'], $mail['message'], $headers); + +} elseif($mail_setting['mailsend'] == 2) { + + if(!$fp = fsocketopen($mail_setting['mailserver'], $mail_setting['mailport'], $errno, $errstr, $mail_setting['mailtimeout'])) { + return false; + } + + stream_set_blocking($fp, true); + stream_set_timeout($fp, $mail_setting['mailtimeout']); + + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != '220') { + return false; + } + + fputs($fp, ($mail_setting['mailauth'] ? 'EHLO' : 'HELO')." discuz\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 220 && substr($lastmessage, 0, 3) != 250) { + return false; + } + + while(1) { + if(substr($lastmessage, 3, 1) != '-' || empty($lastmessage)) { + break; + } + $lastmessage = fgets($fp, 512); + } + + if($mail_setting['mailauth']) { + fputs($fp, "AUTH LOGIN\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 334) { + return false; + } + + fputs($fp, base64_encode($mail_setting['mailauth_username'])."\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 334) { + return false; + } + + fputs($fp, base64_encode($mail_setting['mailauth_password'])."\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 235) { + return false; + } + + $email_from = $mail_setting['mailfrom']; + } + + fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + return false; + } + } + + $email_tos = array(); + foreach(explode(',', $mail['email_to']) as $touser) { + $touser = trim($touser); + if($touser) { + fputs($fp, "RCPT TO: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $touser).">\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + fputs($fp, "RCPT TO: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $touser).">\r\n"); + $lastmessage = fgets($fp, 512); + return false; + } + } + } + + fputs($fp, "DATA\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 354) { + return false; + } + + $headers .= 'Message-ID: <'.gmdate('YmdHs').'.'.substr(md5($mail['message'].microtime()), 0, 6).rand(100000, 999999).'@'.$_SERVER['HTTP_HOST'].">{$maildelimiter}"; + + fputs($fp, "Date: ".gmdate('r')."\r\n"); + fputs($fp, "To: ".$mail['email_to']."\r\n"); + fputs($fp, "Subject: ".$mail['subject']."\r\n"); + fputs($fp, $headers."\r\n"); + fputs($fp, "\r\n\r\n"); + fputs($fp, "{$mail['message']}\r\n.\r\n"); + $lastmessage = fgets($fp, 512); + if(substr($lastmessage, 0, 3) != 250) { + return false; + } + + fputs($fp, "QUIT\r\n"); + return true; + +} elseif($mail_setting['mailsend'] == 3) { + + ini_set('SMTP', $mail_setting['mailserver']); + ini_set('smtp_port', $mail_setting['mailport']); + ini_set('sendmail_from', $email_from); + + return @mail($mail['email_to'], $mail['subject'], $mail['message'], $headers); + +} + +?> \ No newline at end of file diff --git a/uc_server/lib/template.class.php b/uc_server/lib/template.class.php new file mode 100644 index 0000000..a03ef1e --- /dev/null +++ b/uc_server/lib/template.class.php @@ -0,0 +1,199 @@ +"; + var $const_regexp = "\{([\w]+)\}"; + + var $languages = array(); + var $sid; + + function __construct() { + $this->template(); + } + + function template() { + ob_start(); + $this->defaulttpldir = UC_ROOT.'./view/default'; + $this->tpldir = UC_ROOT.'./view/default'; + $this->objdir = UC_DATADIR.'./view'; + $this->langfile = UC_ROOT.'./view/default/templates.lang.php'; + if (version_compare(PHP_VERSION, '5') == -1) { + register_shutdown_function(array(&$this, '__destruct')); + } + } + + function assign($k, $v) { + $this->vars[$k] = $v; + } + + function display($file) { + extract($this->vars, EXTR_SKIP); + include $this->gettpl($file); + } + + function gettpl($file) { + isset($_REQUEST['inajax']) && ($file == 'header' || $file == 'footer') && $file = $file.'_ajax'; + isset($_REQUEST['inajax']) && ($file == 'admin_header' || $file == 'admin_footer') && $file = substr($file, 6).'_ajax'; + $this->tplfile = $this->tpldir.'/'.$file.'.htm'; + $this->objfile = $this->objdir.'/'.$file.'.php'; + $tplfilemtime = @filemtime($this->tplfile); + if($tplfilemtime === FALSE) { + $this->tplfile = $this->defaulttpldir.'/'.$file.'.htm'; + } + if($this->force || !file_exists($this->objfile) || @filemtime($this->objfile) < filemtime($this->tplfile)) { + if(empty($this->language)) { + @include $this->langfile; + if(is_array($languages)) { + $this->languages += $languages; + } + } + $this->complie(); + } + return $this->objfile; + } + + function complie() { + $template = file_get_contents($this->tplfile); + $template = preg_replace("/\<\!\-\-\{(.+?)\}\-\-\>/s", "{\\1}", $template); + $template = preg_replace_callback("/\{lang\s+(\w+?)\}/is", array($this, 'complie_callback_lang_1'), $template); + + $template = preg_replace("/\{($this->var_regexp)\}/", "", $template); + $template = preg_replace("/\{($this->const_regexp)\}/", "", $template); + $template = preg_replace("/(?var_regexp/", "", $template); + + $template = preg_replace_callback("/\<\?=(\@?\\\$[a-zA-Z_]\w*)((\[[\\$\[\]\w]+\])+)\?\>/is", array($this, 'complie_callback_arrayindex_12'), $template); + + $template = preg_replace_callback("/\{\{eval (.*?)\}\}/is", array($this, 'complie_callback_stripvtag_1'), $template); + $template = preg_replace_callback("/\{eval (.*?)\}/is", array($this, 'complie_callback_stripvtag_1'), $template); + $template = preg_replace_callback("/\{for (.*?)\}/is", array($this, 'complie_callback_stripvtag_for1'), $template); + + $template = preg_replace_callback("/\{elseif\s+(.+?)\}/is", array($this, 'complie_callback_stripvtag_elseif1'), $template); + + for($i=0; $i<2; $i++) { + $template = preg_replace_callback("/\{loop\s+$this->vtag_regexp\s+$this->vtag_regexp\s+$this->vtag_regexp\}(.+?)\{\/loop\}/is", array($this, 'complie_callback_loopsection_1234'), $template); + $template = preg_replace_callback("/\{loop\s+$this->vtag_regexp\s+$this->vtag_regexp\}(.+?)\{\/loop\}/is", array($this, 'complie_callback_loopsection_123'), $template); + } + $template = preg_replace_callback("/\{if\s+(.+?)\}/is", array($this, 'complie_callback_stripvtag_if1'), $template); + + $template = preg_replace("/\{template\s+(\w+?)\}/is", "gettpl('\\1');?>", $template); + $template = preg_replace_callback("/\{template\s+(.+?)\}/is", array($this, 'complie_callback_stripvtag_template1'), $template); + + + $template = preg_replace("/\{else\}/is", "", $template); + $template = preg_replace("/\{\/if\}/is", "", $template); + $template = preg_replace("/\{\/for\}/is", "", $template); + + $template = preg_replace("/$this->const_regexp/", "", $template); + + $template = "\r\n$template"; + $template = preg_replace("/(\\\$[a-zA-Z_]\w+\[)([a-zA-Z_]\w+)\]/i", "\\1'\\2']", $template); + + $template = preg_replace("/\<\?(\s{1})/is", "/is", "", $template); + + file_put_contents($this->objfile, $template, LOCK_EX); + } + + function complie_callback_lang_1($matches) { + return $this->lang($matches[1]); + } + + function complie_callback_arrayindex_12($matches) { + return $this->arrayindex($matches[1], $matches[2]); + } + + function complie_callback_stripvtag_1($matches) { + return $this->stripvtag(''); + } + + function complie_callback_stripvtag_for1($matches) { + return $this->stripvtag(''); + } + + function complie_callback_stripvtag_elseif1($matches) { + return $this->stripvtag(''); + } + + function complie_callback_loopsection_1234($matches) { + return $this->loopsection($matches[1], $matches[2], $matches[3], $matches[4]); + } + + function complie_callback_loopsection_123($matches) { + return $this->loopsection($matches[1], '', $matches[2], $matches[3]); + } + + function complie_callback_stripvtag_if1($matches) { + return $this->stripvtag(''); + } + + function complie_callback_stripvtag_template1($matches) { + return $this->stripvtag('gettpl('.$matches[1].'); ?>'); + } + + function arrayindex($name, $items) { + $items = preg_replace("/\[([a-zA-Z_]\w*)\]/is", "['\\1']", $items); + return ""; + } + + function stripvtag($s) { + return preg_replace("/$this->vtag_regexp/is", "\\1", str_replace("\\\"", '"', $s)); + } + + function loopsection($arr, $k, $v, $statement) { + $arr = $this->stripvtag($arr); + $k = $this->stripvtag($k); + $v = $this->stripvtag($v); + $statement = str_replace("\\\"", '"', $statement); + return $k ? " $v) {?>$statement" : "$statement"; + } + + function lang($k) { + return !empty($this->languages[$k]) ? $this->languages[$k] : "{ $k }"; + } + + function _transsid($url, $tag = '', $wml = 0) { + $sid = $this->sid; + $tag = stripslashes($tag); + if(!$tag || (!preg_match("/^(https?:\/\/|mailto:|#|javascript)/i", $url) && !strpos($url, 'sid='))) { + if($pos = strpos($url, '#')) { + $urlret = substr($url, $pos); + $url = substr($url, 0, $pos); + } else { + $urlret = ''; + } + $url .= (strpos($url, '?') ? ($wml ? '&' : '&') : '?').'sid='.$sid.$urlret; + } + return $tag.$url; + } + + function __destruct() { + $sid = rawurlencode($this->sid); + $content = preg_replace_callback("/\]+\s*)href\=([\"|\']?)([^\"\'\s]+)/is", array($this, 'destruct_callback_transsid_312'), ob_get_contents()); + $content = preg_replace("/(\)/is", "\\1\n", $content); + ob_end_clean(); + echo $content; + } + + function destruct_callback_transsid_312($matches) { + return $this->_transsid($matches[3],'uccode(); + } + + function uccode() { + $this->uccode = array( + 'pcodecount' => -1, + 'codecount' => 0, + 'codehtml' => array() + ); + } + + function codedisp($code) { + $this->uccode['pcodecount']++; + $code = str_replace('\\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)); + $this->uccode['codehtml'][$this->uccode['pcodecount']] = $this->tpl_codedisp($code); + $this->uccode['codecount']++; + return "[\tUCENTER_CODE_".$this->uccode['pcodecount']."\t]"; + } + + function complie($message) { + $message = dhtmlspecialchars($message); + if(strpos($message, '[/code]') !== FALSE) { + $message = preg_replace_callback("/\s*\[code\](.+?)\[\/code\]\s*/is", array($this, 'complie_callback_codedisp_1'), $message); + } + if(strpos($message, '[/url]') !== FALSE) { + $message = preg_replace_callback("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)([^\[\"']+?))?\](.+?)\[\/url\]/is", array($this, 'complie_callback_parseurl_15'), $message); + } + if(strpos($message, '[/email]') !== FALSE) { + $message = preg_replace_callback("/\[email(=([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+))?\](.+?)\[\/email\]/is", array($this, 'complie_callback_parseemail_14'), $message); + } + $message = str_replace(array( + '[/color]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', + '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', + '[list=A]', '[*]', '[/list]', '[indent]', '[/indent]', '[/float]' + ), array( + '', '
                                ', '', '

                                ', '', '', '', + '', '', '', '
                                  ', '
                                    ', '
                                      ', + '
                                        ', '
                                      • ', '
                                      ', '
                                      ', '
                                      ', '' + ), preg_replace(array( + "/\[color=([#\w]+?)\]/i", + "/\[size=(\d+?)\]/i", + "/\[size=(\d+(\.\d+)?(px|pt|in|cm|mm|pc|em|ex|%)+?)\]/i", + "/\[font=([^\[\<]+?)\]/i", + "/\[align=(left|center|right)\]/i", + "/\[float=(left|right)\]/i" + ), array( + "", + "", + "", + "", + "

                                      ", + "" + ), $message)); + if(strpos($message, '[/quote]') !== FALSE) { + $message = preg_replace("/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is", $this->tpl_quote(), $message); + } + if(strpos($message, '[/img]') !== FALSE) { + $message = preg_replace_callback("/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", array($this, 'complie_callback_bbcodeurl_1'), $message); + $message = preg_replace_callback("/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", array($this, 'complie_callback_bbcodeurl_312'), $message); + } + for($i = 0; $i <= $this->uccode['pcodecount']; $i++) { + $message = str_replace("[\tUCENTER_CODE_$i\t]", $this->uccode['codehtml'][$i], $message); + } + return nl2br(str_replace(array("\t", ' ', ' '), array('        ', '   ', '  '), $message)); + } + + function complie_callback_codedisp_1($matches) { + return $this->codedisp($matches[1]); + } + + function complie_callback_parseurl_15($matches) { + return $this->parseurl($matches[1], $matches[5]); + } + + function complie_callback_parseemail_14($matches) { + return $this->parseemail($matches[1], $matches[4]); + } + + function complie_callback_bbcodeurl_1($matches) { + return $this->bbcodeurl($matches[1], ''); + } + + function complie_callback_bbcodeurl_312($matches) { + return $this->bbcodeurl($matches[3], ''); + } + + function parseurl($url, $text) { + if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) { + $url = $matches[0]; + $length = 65; + if(strlen($url) > $length) { + $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3)); + } + return ''.$text.''; + } else { + $url = substr($url, 1); + if(substr(strtolower($url), 0, 4) == 'www.') { + $url = 'http://'.$url; + } + return ''.$text.''; + } + } + + function parseemail($email, $text) { + $text = str_replace('\"', '"', $text); + if(!$email && preg_match("/\s*([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\s*/i", $text, $matches)) { + $email = trim($matches[0]); + return ''.$email.''; + } else { + return ''.$text.''; + } + } + + function bbcodeurl($url, $tags) { + if(!preg_match("/<.+?>/s", $url)) { + if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) { + $url = 'http://'.$url; + } + return str_replace(array('submit', 'logging.php'), array('', ''), sprintf($tags, $url, addslashes($url))); + } else { + return ' '.$url; + } + } + + function tpl_codedisp($code) { + return '

                                      '.$code.'
                                      '; + } + + function tpl_quote() { + return '
                                      \\1
                                      '; + } +} + + +?> \ No newline at end of file diff --git a/uc_server/lib/ucip.class.php b/uc_server/lib/ucip.class.php new file mode 100644 index 0000000..a93dd00 --- /dev/null +++ b/uc_server/lib/ucip.class.php @@ -0,0 +1,88 @@ + 1 ? 'check_ip6' : 'check_ip4'; + foreach ($ips as $ip) { + if (self::$method($requestIp, $ip)) { + return true; + } + } + return false; + } + + public static function check_ip6($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + if ('0' === $netmask) { + return (bool) unpack('n*', @inet_pton($address)); + } + if ($netmask < 1 || $netmask > 128) { + return false; + } + } else { + $address = $ip; + $netmask = 128; + } + $bytesAddr = unpack('n*', @inet_pton($address)); + $bytesTest = unpack('n*', @inet_pton($requestIp)); + if (!$bytesAddr || !$bytesTest) { + return false; + } + for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { + $left = $netmask - 16 * ($i - 1); + $left = ($left <= 16) ? $left : 16; + $mask = ~(0xffff >> $left) & 0xffff; + if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { + return false; + } + } + return true; + } + + public static function check_ip4($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + if ('0' === $netmask) { + return false; + } + if ($netmask < 0 || $netmask > 32) { + return false; + } + } else { + $address = $ip; + $netmask = 32; + } + if (false === ip2long($address)) { + return false; + } + return 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); + } + +} +?> \ No newline at end of file diff --git a/uc_server/lib/ucip_getter_dnslist.class.php b/uc_server/lib/ucip_getter_dnslist.class.php new file mode 100644 index 0000000..8d401b4 --- /dev/null +++ b/uc_server/lib/ucip_getter_dnslist.class.php @@ -0,0 +1,35 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/uc_server/lib/ucip_getter_header.class.php b/uc_server/lib/ucip_getter_header.class.php new file mode 100644 index 0000000..02519a4 --- /dev/null +++ b/uc_server/lib/ucip_getter_header.class.php @@ -0,0 +1,30 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/uc_server/lib/ucip_getter_iplist.class.php b/uc_server/lib/ucip_getter_iplist.class.php new file mode 100644 index 0000000..3992fab --- /dev/null +++ b/uc_server/lib/ucip_getter_iplist.class.php @@ -0,0 +1,35 @@ + 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $ip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $ip; + } else { + $ip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; + } + } + } + } + return $ip; + } + +} \ No newline at end of file diff --git a/uc_server/lib/upload.class.php b/uc_server/lib/upload.class.php new file mode 100644 index 0000000..f939650 --- /dev/null +++ b/uc_server/lib/upload.class.php @@ -0,0 +1,313 @@ +time = $time ? $time : time(); + $this->filetypedata = array( + 'av' => array('av', 'wmv', 'wav'), + 'real' => array('rm', 'rmvb'), + 'binary' => array('dat'), + 'flash' => array('swf'), + 'html' => array('html', 'htm'), + 'image' => array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp'), + 'office' => array('doc', 'xls', 'ppt'), + 'pdf' => array('pdf'), + 'rar' => array('rar', 'zip'), + 'text' => array('txt'), + 'bt' => array('bt'), + 'zip' => array('tar', 'rar', 'zip', 'gz'), + ); + $this->filetypeids = array_keys($this->filetypedata); + foreach($this->filetypedata as $data) { + $this->filetypes = array_merge($this->filetypes, $data); + } + } + + function set_dir($dir) { + $this->dir = $dir; + } + + function set_thumb($width, $height, $ext = '') { + $this->thumb_width = $width; + $this->thumb_height = $height; + $this->thumb_ext = $ext; + } + + function set_watermark($file, $pos = 9, $alpha = 100) { + $this->watermark_file = $file; + $this->watermark_pos = $pos; + $this->watermark_alpha = $alpha; + } + + function execute() { + $arr = array(); + $keys = array_keys($_FILES['attach']['name']); + foreach($keys as $key) { + if(!$_FILES['attach']['name'][$key]) { + continue; + } + $file = array( + 'name' => $_FILES['attach']['name'][$key], + 'tmp_name' => $_FILES['attach']['tmp_name'][$key] + ); + $fileext = $this->fileext($file['name']); + if(!in_array($fileext, $this->filetypes)) { + $fileext = '_'.$fileext; + } + + $tfilename = $this->time.rand(100, 999); + $filename = '1'.$tfilename.'.'.$fileext; + $filethumb = '0'.$tfilename.'.'.($this->thumb_ext ? $this->thumb_ext : $fileext); + $this->copy($file['tmp_name'], $this->dir.'/'.$filename); + $arr[$key]['file'] = $filename; + if(in_array($fileext, array('jpg', 'gif', 'png', 'webp'))) { + if($this->thumb_width) { + if($this->thumb($this->thumb_width, $this->thumb_height, $this->dir.'/'.$filename, $this->dir.'/'.$filethumb, ($this->thumb_ext ? $this->thumb_ext : $fileext))) { + $arr[$key]['thumb'] = $filethumb; + } + } + if($this->watermark_file) { + $this->waterfile($this->dir.'/'.$filename, $this->watermark_file, $fileext, $this->watermark_pos, $this->watermark_alpha); + } + } + } + return $arr; + } + + function mkdir_by_date($date, $dir = '.') { + list($y, $m, $d) = explode('-', date('Y-m-d', $date)); + !is_dir("$dir/$y") && mkdir("$dir/$y", 0777); + !is_dir("$dir/$y/$m$d") && mkdir("$dir/$y/$m$d", 0777); + return "$y/$m$d"; + } + + function mkdir_by_hash($s, $dir = '.') { + $s = md5($s); + !is_dir($dir.'/'.$s[0]) && mkdir($dir.'/'.$s[0], 0777); + !is_dir($dir.'/'.$s[0].'/'.$s[1]) && mkdir($dir.'/'.$s[0].'/'.$s[1], 0777); + !is_dir($dir.'/'.$s[0].'/'.$s[1].'/'.$s[2]) && mkdir($dir.'/'.$s[0].'/'.$s[1].'/'.$s[2], 0777); + return $s[0].'/'.$s[1].'/'.$s[2]; + } + + function mkdir_by_uid($uid, $dir = '.') { + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + !is_dir($dir.'/'.$dir1) && mkdir($dir.'/'.$dir1, 0777); + !is_dir($dir.'/'.$dir1.'/'.$dir2) && mkdir($dir.'/'.$dir1.'/'.$dir2, 0777); + !is_dir($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3) && mkdir($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3, 0777); + return $dir1.'/'.$dir2.'/'.$dir3; + } + + function copy($sourcefile, $destfile) { + move_uploaded_file($sourcefile, $destfile); + @unlink($sourcefile); + } + + function watermark($target, $watermark_file, $ext, $watermarkstatus=9, $watermarktrans=50) { + $gdsurporttype = array(); + if(function_exists('imageAlphaBlending') && function_exists('getimagesize')) { + if(function_exists('imageGIF')) $gdsurporttype[]='gif'; + if(function_exists('imagePNG')) $gdsurporttype[]='png'; + if(function_exists('imageWEBP')) $gdsurporttype[]='webp'; + if(function_exists('imageJPEG')) { + $gdsurporttype[]='jpg'; + $gdsurporttype[]='jpeg'; + } + } + if($gdsurporttype && in_array($ext, $gdsurporttype) ) { + $attachinfo = getimagesize($target); + $watermark_logo = imageCreateFromGIF($watermark_file); + + $logo_w = imageSX($watermark_logo); + $logo_h = imageSY($watermark_logo); + $img_w = $attachinfo[0]; + $img_h = $attachinfo[1]; + $wmwidth = $img_w - $logo_w; + $wmheight = $img_h - $logo_h; + + $animatedgif = 0; + if($attachinfo['mime'] == 'image/gif') { + $fp = fopen($target, 'rb'); + $targetcontent = fread($fp, 9999999); + fclose($fp); + $animatedgif = strpos($targetcontent, 'NETSCAPE2.0') === FALSE ? 0 : 1; + } + $animatedwebp = 0; + if($attachinfo['mime'] == 'image/webp') { + $fp = fopen($target, 'rb'); + $targetcontent = fread($fp, 40); + fclose($fp); + if (stripos($targetcontent, 'WEBPVP8X') !== FALSE || stripos($targetcontent, 'ANIM') !== FALSE) { + $animatedwebp = 1; + }else{ + $animatedwebp = 0; + } + } + + if($watermark_logo && $wmwidth > 10 && $wmheight > 10 && !$animatedgif && !$animatedwebp) { + switch ($attachinfo['mime']) { + case 'image/jpeg': + $dst_photo = imageCreateFromJPEG($target); + break; + case 'image/gif': + $dst_photo = imageCreateFromGIF($target); + break; + case 'image/png': + $dst_photo = imageCreateFromPNG($target); + break; + case 'image/webp': + $dst_photo = imageCreateFromWEBP($target); + break; + } + + switch($watermarkstatus) { + case 1: + $x = +5; + $y = +5; + break; + case 2: + $x = ($logo_w + $img_w) / 2; + $y = +5; + break; + case 3: + $x = $img_w - $logo_w-5; + $y = +5; + break; + case 4: + $x = +5; + $y = ($logo_h + $img_h) / 2; + break; + case 5: + $x = ($logo_w + $img_w) / 2; + $y = ($logo_h + $img_h) / 2; + break; + case 6: + $x = $img_w - $logo_w; + $y = ($logo_h + $img_h) / 2; + break; + case 7: + $x = +5; + $y = $img_h - $logo_h-5; + break; + case 8: + $x = ($logo_w + $img_w) / 2; + $y = $img_h - $logo_h; + break; + case 9: + $x = $img_w - $logo_w-5; + $y = $img_h - $logo_h-5; + break; + } + + imageAlphaBlending($watermark_logo, FALSE); + imagesavealpha($watermark_logo,TRUE); + imageCopyMerge($dst_photo, $watermark_logo, $x, $y, 0, 0, $logo_w, $logo_h, $watermarktrans); + + switch($attachinfo['mime']) { + case 'image/jpeg': + imageJPEG($dst_photo, $target); + break; + case 'image/gif': + imageGIF($dst_photo, $target); + break; + case 'image/png': + imagePNG($dst_photo, $target); + break; + case 'image/webp': + imageWEBP($dst_photo, $target); + break; + } + } + } + } + + function thumb($forcedwidth, $forcedheight, $sourcefile, $destfile, $destext, $imgcomp = 0) { + $g_imgcomp=100-$imgcomp; + $g_srcfile=$sourcefile; + $g_dstfile=$destfile; + $g_fw=$forcedwidth; + $g_fh=$forcedheight; + $ext = strtolower(substr(strrchr($sourcefile, '.'), 1, 10)); + if(file_exists($g_srcfile)) { + $g_is = getimagesize($g_srcfile); + if($g_is[0] < $forcedwidth && $g_is[1] < $forcedheight) { + copy($sourcefile, $destfile); + return filesize($destfile);; + } + if (($g_is[0] - $g_fw) >= ($g_is[1] - $g_fh)){ + $g_iw=$g_fw; + $g_ih=($g_fw/$g_is[0])*$g_is[1]; + } else { + $g_ih=$g_fh; + $g_iw=($g_ih/$g_is[1])*$g_is[0]; + } + switch ($ext) { + case 'jpg': + $img_src = @imagecreatefromjpeg($g_srcfile); + !$img_src && $img_src = imagecreatefromgif($g_srcfile); + break; + case 'gif': + $img_src = imagecreatefromgif($g_srcfile); + break; + case 'png': + $img_src = imagecreatefrompng($g_srcfile); + break; + case 'webp': + $img_src = imagecreatefromwebp($g_srcfile); + break; + } + $img_dst = imagecreatetruecolor($g_iw, $g_ih); + imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $g_iw, $g_ih, $g_is[0], $g_is[1]); + switch($destext) { + case 'jpg': + imagejpeg($img_dst, $g_dstfile, $g_imgcomp); + break; + case 'gif': + imagegif($img_dst, $g_dstfile); + break; + } + imagedestroy($img_dst); + return filesize($destfile); + } else { + return false; + } + } + + function fileext($filename) { + return substr(strrchr($filename, '.'), 1, 10); + } + + function get_filetype($ext) { + foreach($this->filetypedata as $k => $v) { + if(in_array($ext, $v)) { + return $k; + } + } + return 'common'; + } +} + +?> \ No newline at end of file diff --git a/uc_server/lib/xml.class.php b/uc_server/lib/xml.class.php new file mode 100644 index 0000000..30c193c --- /dev/null +++ b/uc_server/lib/xml.class.php @@ -0,0 +1,105 @@ +parse($xml); + $xml_parser->destruct(); + return $data; +} + +function xml_serialize($arr, $htmlon = FALSE, $isnormal = FALSE, $level = 1) { + $s = $level == 1 ? "\r\n\r\n" : ''; + $space = str_repeat("\t", $level); + foreach($arr as $k => $v) { + if(!is_array($v)) { + $s .= $space."".($htmlon ? '' : '')."\r\n"; + } else { + $s .= $space."\r\n".xml_serialize($v, $htmlon, $isnormal, $level + 1).$space."\r\n"; + } + } + $s = preg_replace("/([\x01-\x08\x0b-\x0c\x0e-\x1f])+/", ' ', $s); + return $level == 1 ? $s."" : $s; +} + +class XML { + + var $parser; + var $document; + var $stack; + var $data; + var $last_opened_tag; + var $isnormal; + var $attrs = array(); + var $failed = FALSE; + + function __construct($isnormal) { + $this->XML($isnormal); + } + + function XML($isnormal) { + $this->isnormal = $isnormal; + $this->parser = xml_parser_create('ISO-8859-1'); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false); + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, 'open','close'); + xml_set_character_data_handler($this->parser, 'data'); + } + + function destruct() { + xml_parser_free($this->parser); + } + + function parse(&$data) { + $this->document = array(); + $this->stack = array(); + return xml_parse($this->parser, $data, true) && !$this->failed ? $this->document : ''; + } + + function open($parser, $tag, $attributes) { + $this->data = ''; + $this->failed = FALSE; + if(!$this->isnormal) { + if(isset($attributes['id']) && !(isset($this->document[$attributes['id']]) && is_string($this->document[$attributes['id']]))) { + $this->document = &$this->document[$attributes['id']]; + } else { + $this->failed = TRUE; + } + } else { + if(!isset($this->document[$tag]) || !is_string($this->document[$tag])) { + $this->document = &$this->document[$tag]; + } else { + $this->failed = TRUE; + } + } + $this->stack[] = &$this->document; + $this->last_opened_tag = $tag; + $this->attrs = $attributes; + } + + function data($parser, $data) { + if($this->last_opened_tag != NULL) { + $this->data .= $data; + } + } + + function close($parser, $tag) { + if($this->last_opened_tag == $tag) { + $this->document = $this->data; + $this->last_opened_tag = NULL; + } + array_pop($this->stack); + if($this->stack) { + $this->document = &$this->stack[count($this->stack)-1]; + } + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/admin.php b/uc_server/model/admin.php new file mode 100644 index 0000000..68bf577 --- /dev/null +++ b/uc_server/model/admin.php @@ -0,0 +1,126 @@ +adminbase(); + } + + function adminbase() { + parent::__construct(); + $this->cookie_status = isset($_COOKIE['sid']) ? 1 : 0; + $sid = $this->cookie_status ? getgpc('sid', 'C') : rawurlencode(getgpc('sid', 'R')); + $this->sid = $this->view->sid = $this->sid_decode($sid) ? $sid : ''; + $this->view->assign('sid', $this->view->sid); + $this->view->assign('iframe', getgpc('iframe')); + $a = getgpc('a'); + if(!(getgpc('m') =='user' && ($a == 'login' || $a == 'logout'))) { + $this->check_priv(); + } + } + + function check_priv() { + $username = $this->sid_decode($this->view->sid); + if(empty($username)) { + header('Location: '.UC_API.'/'.UC_ADMINSCRIPT.'?m=user&a=login&iframe='.getgpc('iframe', 'G').($this->cookie_status ? '' : '&sid='.$this->view->sid)); + exit; + } else { + $this->user['isfounder'] = $username == 'UCenterAdministrator' ? 1 : 0; + if(!$this->user['isfounder']) { + $admin = $this->db->fetch_first("SELECT a.*, m.* FROM ".UC_DBTABLEPRE."admins a LEFT JOIN ".UC_DBTABLEPRE."members m USING(uid) WHERE a.username='$username'"); + if(empty($admin)) { + header('Location: '.UC_API.'/'.UC_ADMINSCRIPT.'?m=user&a=login&iframe='.getgpc('iframe', 'G').($this->cookie_status ? '' : '&sid='.$this->view->sid)); + exit; + } else { + $this->user = $admin; + $this->user['username'] = $username; + $this->user['admin'] = 1; + $this->view->sid = $this->sid_encode($username); + $this->setcookie('sid', $this->view->sid, 86400); + } + } else { + $this->user['username'] = 'UCenterAdministrator'; + $this->user['admin'] = 1; + $this->view->sid = $this->sid_encode($this->user['username']); + $this->setcookie('sid', $this->view->sid, 86400); + } + $this->view->assign('user', $this->user); + } + } + + function is_founder($username) { + return $this->user['isfounder']; + } + + function writelog($action, $extra = '') { + $log = dhtmlspecialchars($this->user['username']."\t".$this->onlineip."\t".$this->time."\t$action\t$extra"); + $logfile = UC_ROOT.'./data/logs/'.gmdate('Ym', $this->time).'.php'; + if(@filesize($logfile) > 2048000) { + PHP_VERSION < '4.2.0' && mt_srand((double)microtime() * 1000000); + $hash = ''; + $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; + for($i = 0; $i < 4; $i++) { + $hash .= $chars[mt_rand(0, 61)]; + } + @rename($logfile, UC_ROOT.'./data/logs/'.gmdate('Ym', $this->time).'_'.$hash.'.php'); + } + file_put_contents($logfile, "\t".str_replace(array('', '$a(); + } else { + exit('Method does not exists'); + } + } + + function sid_encode($username) { + $ip = $this->onlineip; + $agent = $_SERVER['HTTP_USER_AGENT']; + $authkey = md5($ip.$agent.UC_KEY); + $check = substr(md5($ip.$agent), 0, 8); + return rawurlencode($this->authcode("$username\t$check", 'ENCODE', $authkey, 1800)); + } + + function sid_decode($sid) { + $ip = $this->onlineip; + $agent = $_SERVER['HTTP_USER_AGENT']; + $authkey = md5($ip.$agent.UC_KEY); + $s = $this->authcode(rawurldecode($sid), 'DECODE', $authkey, 1800); + if(empty($s)) { + return FALSE; + } + @list($username, $check) = explode("\t", $s); + if($check == substr(md5($ip.$agent), 0, 8)) { + return $username; + } else { + return FALSE; + } + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/app.php b/uc_server/model/app.php new file mode 100644 index 0000000..20abd65 --- /dev/null +++ b/uc_server/model/app.php @@ -0,0 +1,76 @@ +appmodel($base); + } + + function appmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_apps($col = '*', $where = '') { + $arr = $this->db->fetch_all("SELECT $col FROM ".UC_DBTABLEPRE."applications".($where ? ' WHERE '.$where : ''), 'appid'); + foreach($arr as $k => $v) { + isset($v['extra']) && !empty($v['extra']) && $v['extra'] = unserialize($v['extra']); + if($tmp = $this->base->authcode($v['authkey'], 'DECODE', UC_MYKEY)) { + $v['authkey'] = $tmp; + } + $arr[$k] = $v; + } + return $arr; + } + + function get_app_by_appid($appid, $includecert = FALSE) { + $appid = intval($appid); + $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."applications WHERE appid='$appid'"); + $arr['extra'] = unserialize($arr['extra']); + if($tmp = $this->base->authcode($arr['authkey'], 'DECODE', UC_MYKEY)) { + $arr['authkey'] = $tmp; + } + if($includecert) { + $this->load('plugin'); + $certfile = $_ENV['plugin']->cert_get_file(); + $appdata = $_ENV['plugin']->cert_dump_decode($certfile); + if(is_array($appdata[$appid])) { + $arr += $appdata[$appid]; + } + } + return $arr; + } + + function delete_apps($appids) { + $appids = $this->base->implode($appids); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."applications WHERE appid IN ($appids)"); + return $this->db->affected_rows(); + } + + + function alter_app_table($appid, $operation = 'ADD') { + if($operation == 'ADD') { + $this->db->query("ALTER TABLE ".UC_DBTABLEPRE."notelist ADD COLUMN app$appid tinyint NOT NULL", 'SILENT'); + } else { + $this->db->query("ALTER TABLE ".UC_DBTABLEPRE."notelist DROP COLUMN app$appid", 'SILENT'); + } + } + + function test_api($url, $ip = '') { + $this->base->load('misc'); + return $_ENV['misc']->dfopen($url, 0, '', '', 1, ''); + } +} +?> \ No newline at end of file diff --git a/uc_server/model/badword.php b/uc_server/model/badword.php new file mode 100644 index 0000000..2384e18 --- /dev/null +++ b/uc_server/model/badword.php @@ -0,0 +1,80 @@ +badwordmodel($base); + } + + function badwordmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function add_badword($find, $replacement, $admin, $type = 1) { + if($find) { + $find = trim($find); + $replacement = trim($replacement); + $findpattern = $this->pattern_find($find); + if($type == 1) { + $id = $this->db->result_first_stmt("SELECT id FROM ".UC_DBTABLEPRE."badwords WHERE find=?", array('s'), array($find)); + if($id) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."badwords SET find='$find', replacement='$replacement', admin='$admin', findpattern='$findpattern' WHERE id='$id'"); + } else { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."badwords SET find='$find', replacement='$replacement', admin='$admin', findpattern='$findpattern'", 'SILENT'); + } + } elseif($type == 2) { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."badwords SET find='$find', replacement='$replacement', admin='$admin', findpattern='$findpattern'", 'SILENT'); + } + } + return $this->db->insert_id(); + } + + function get_total_num() { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."badwords"); + return $data; + } + + function get_list($page, $ppp, $totalnum) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."badwords LIMIT $start, $ppp"); + return $data; + } + + function delete_badword($arr) { + $badwordids = $this->base->implode($arr); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."badwords WHERE id IN ($badwordids)"); + return $this->db->affected_rows(); + } + + function truncate_badword() { + $this->db->query("TRUNCATE ".UC_DBTABLEPRE."badwords"); + } + + function update_badword($find, $replacement, $id) { + $findpattern = $this->pattern_find($find); + $this->db->query("UPDATE ".UC_DBTABLEPRE."badwords SET find='$find', replacement='$replacement', findpattern='$findpattern' WHERE id='$id'"); + return $this->db->affected_rows(); + } + + function pattern_find($find) { + $find = preg_quote($find, "/'"); + $find = str_replace("\\", "\\\\", $find); + $find = str_replace("'", "\\'", $find); + return '/'.preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", $find).'/is'; + } +} + +?> \ No newline at end of file diff --git a/uc_server/model/base.php b/uc_server/model/base.php new file mode 100644 index 0000000..df963a3 --- /dev/null +++ b/uc_server/model/base.php @@ -0,0 +1,607 @@ +base(); + } + + function base() { + require_once UC_ROOT.'./model/var.php'; + base_var::bind($this); + if(empty($this->time)) { + $this->init_var(); + $this->init_db(); + $this->init_cache(); + $this->init_app(); + $this->init_user(); + $this->init_template(); + $this->init_note(); + $this->init_mail(); + } + } + + function init_var() { + $this->time = time(); + + $this->onlineip = $_SERVER['REMOTE_ADDR']; + if (!defined('UC_ONLYREMOTEADDR') || (defined('UC_ONLYREMOTEADDR') && !constant('UC_ONLYREMOTEADDR'))) { + require_once UC_ROOT.'./lib/ucip.class.php'; + if(defined('UC_IPGETTER') && !empty(constant('UC_IPGETTER'))) { + $s = defined('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) ? (is_string(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) ? unserialize(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : array(); + $c = 'ucip_getter_'.strtolower(constant('UC_IPGETTER')); + require_once UC_ROOT.'./lib/'.$c.'.class.php'; + $r = $c::get($s); + $this->onlineip = ucip::validate_ip($r) ? $r : $this->onlineip; + } else if (isset($_SERVER['HTTP_CLIENT_IP']) && ucip::validate_ip($_SERVER['HTTP_CLIENT_IP'])) { + $this->onlineip = $_SERVER['HTTP_CLIENT_IP']; + } elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ",") > 0) { + $exp = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $this->onlineip = ucip::validate_ip(trim($exp[0])) ? $exp[0] : $this->onlineip; + } else { + $this->onlineip = ucip::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $this->onlineip; + } + } + } + + define('FORMHASH', $this->formhash()); + $_GET['page'] = max(1, intval(getgpc('page'))); + + include_once UC_ROOT.'./view/default/main.lang.php'; + $this->lang = &$lang; + } + + function init_cache() { + $this->settings = $this->cache('settings'); + $this->cache['apps'] = $this->cache('apps'); + if(PHP_VERSION > '5.1') { + $timeoffset = intval($this->settings['timeoffset'] / 3600); + @date_default_timezone_set('Etc/GMT'.($timeoffset > 0 ? '-' : '+').(abs($timeoffset))); + } + } + + function init_input($getagent = '', $secureoperation = true) { + $input = getgpc('input', 'R'); + if($input) { + $input = $this->authcode($input, 'DECODE', $this->app['authkey']); + parse_str($input, $this->input); + $this->input = daddslashes($this->input, 1, TRUE); + $agent = $getagent ? $getagent : $this->input['agent']; + + if($secureoperation && !$this->settings['insecureoperation'] && (getgpc('m') != $this->input['m'] || getgpc('a') != $this->input['a'] || getgpc('appid') != $this->input['appid'])) { + exit('Access denied for operation changed'); + } elseif($this->input('frontend') == 1 && !((getgpc('m') == 'user' && in_array(getgpc('a'), array('uploadavatar', 'rectavatar'))) || getgpc('m') == 'pm_client')) { + exit('Access denied for operation changed'); + } elseif(($getagent && $getagent != $this->input['agent']) || (!$getagent && md5($_SERVER['HTTP_USER_AGENT']) != $agent)) { + exit('Access denied for agent changed'); + } elseif($this->time - $this->input('time') > 3600) { + exit('Authorization has expired'); + } + } + if(empty($this->input)) { + exit('Invalid input'); + } + } + + function init_db() { + require_once UC_ROOT.'lib/dbi.class.php'; + $this->db = new ucserver_db(); + $this->db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCHARSET, UC_DBCONNECT, UC_DBTABLEPRE); + } + + function init_app() { + $appid = intval(getgpc('appid')); + $appid && $this->app = $this->cache['apps'][$appid]; + } + + function init_user() { + if(isset($_COOKIE['uc_auth'])) { + @list($uid, $username, $agent) = explode('|', $this->authcode($_COOKIE['uc_auth'], 'DECODE', ($this->input ? $this->app['appauthkey'] : UC_KEY))); + if($agent != md5($_SERVER['HTTP_USER_AGENT'])) { + $this->setcookie('uc_auth', ''); + } else { + @$this->user['uid'] = $uid; + @$this->user['username'] = $username; + } + } + } + + function init_template() { + $charset = UC_CHARSET; + require_once UC_ROOT.'lib/template.class.php'; + $this->view = new template(); + $this->view->assign('dbhistories', $this->db->histories); + $this->view->assign('charset', $charset); + $this->view->assign('dbquerynum', $this->db->querynum); + $this->view->assign('user', $this->user); + } + + function init_note() { + if($this->note_exists() && !getgpc('inajax')) { + $this->load('note'); + $_ENV['note']->send(); + } + } + + function init_mail() { + if($this->mail_exists() && !getgpc('inajax')) { + $this->load('mail'); + $_ENV['mail']->send(); + } + } + + function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { + + $ckey_length = 4; + + $key = md5($key ? $key : UC_KEY); + $keya = md5(substr($key, 0, 16)); + $keyb = md5(substr($key, 16, 16)); + $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; + + $cryptkey = $keya.md5($keya.$keyc); + $key_length = strlen($cryptkey); + + $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; + $string_length = strlen($string); + + $result = ''; + $box = range(0, 255); + + $rndkey = array(); + for($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($cryptkey[$i % $key_length]); + } + + for($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + + for($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); + } + + if($operation == 'DECODE') { + if(((int)substr($result, 0, 10) == 0 || (int)substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26).$keyb), 0, 16)) { + return substr($result, 26); + } else { + return ''; + } + } else { + return $keyc.str_replace('=', '', base64_encode($result)); + } + + } + + function page($num, $perpage, $curpage, $mpurl) { + $multipage = ''; + $mpurl .= strpos($mpurl, '?') ? '&' : '?'; + if($num > $perpage) { + $page = 10; + $offset = 2; + + $pages = @ceil($num / $perpage); + + if($page > $pages) { + $from = 1; + $to = $pages; + } else { + $from = $curpage - $offset; + $to = $from + $page - 1; + if($from < 1) { + $to = $curpage + 1 - $from; + $from = 1; + if($to - $from < $page) { + $to = $page; + } + } elseif($to > $pages) { + $from = $pages - $page + 1; + $to = $pages; + } + } + + $multipage = ($curpage - $offset > 1 && $pages > $page ? '1 ...' : ''). + ($curpage > 1 && !$simple ? '' : ''); + for($i = $from; $i <= $to; $i++) { + $multipage .= $i == $curpage ? ''.$i.'' : + ''.$i.''; + } + + $multipage .= ($curpage < $pages && !$simple ? '' : ''). + ($to < $pages ? '... '.$realpages.'' : ''). + (!$simple && $pages > $page && !$ajaxtarget ? '' : ''); + + $multipage = $multipage ? '
                                      '.(!$simple ? ' '.$num.' ' : '').$multipage.'
                                      ' : ''; + } + return $multipage; + } + + function page_get_start($page, $ppp, $totalnum) { + $totalpage = ceil($totalnum / $ppp); + $page = max(1, min($totalpage, intval($page))); + return ($page - 1) * $ppp; + } + + function load($model, $base = NULL, $release = '') { + $base = $base ? $base : $this; + if(empty($_ENV[$model])) { + $release = !$release ? RELEASE_ROOT : $release; + if(file_exists(UC_ROOT.$release."model/$model.php")) { + require_once UC_ROOT.$release."model/$model.php"; + } else { + require_once UC_ROOT."model/$model.php"; + } + $modelname = $model.'model'; + $_ENV[$model] = new $modelname($base); + } + return $_ENV[$model]; + } + + function get_setting($k = array(), $decode = FALSE) { + $return = array(); + $sqladd = $k ? "WHERE k IN (".$this->implode($k).")" : ''; + $settings = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."settings $sqladd"); + if(is_array($settings)) { + foreach($settings as $arr) { + $return[$arr['k']] = $decode ? unserialize($arr['v']) : $arr['v']; + } + } + return $return; + } + + function set_setting($k, $v, $encode = FALSE) { + $v = is_array($v) || $encode ? addslashes(serialize($v)) : $v; + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."settings SET k='$k', v='$v'"); + } + + function message($message, $redirect = '', $type = 0, $vars = array()) { + include_once UC_ROOT.'view/default/messages.lang.php'; + if(isset($lang[$message])) { + $message = $lang[$message] ? str_replace(array_keys($vars), array_values($vars), $lang[$message]) : $message; + } + $this->view->assign('message', $message); + if($redirect != 'BACK' && !preg_match('/^https?:\/\//is', $redirect) && strpos($redirect, 'sid=') === FALSE) { + if(strpos($redirect, '?') === FALSE) { + $redirect .= '?sid='.$this->sid; + } else { + $redirect .= '&sid='.$this->sid; + } + } + $this->view->assign('redirect', $redirect); + if($type == 0) { + $this->view->display('message'); + } elseif($type == 1) { + $this->view->display('message_client'); + } + exit; + } + + function formhash() { + return substr(md5(substr($this->time, 0, -4).UC_KEY), 16); + } + + function submitcheck() { + return @getgpc('formhash', 'P') == FORMHASH ? true : false; + } + + function date($time, $type = 3) { + $format[] = $type & 2 ? (!empty($this->settings['dateformat']) ? $this->settings['dateformat'] : 'Y-n-j') : ''; + $format[] = $type & 1 ? (!empty($this->settings['timeformat']) ? $this->settings['timeformat'] : 'H:i') : ''; + return gmdate(implode(' ', $format), $time + $this->settings['timeoffset']); + } + + function implode($arr) { + return "'".implode("','", (array)$arr)."'"; + } + + function set_home($uid, $dir = '.') { + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + !is_dir($dir.'/'.$dir1) && mkdir($dir.'/'.$dir1, 0777) && @touch($dir.'/'.$dir1.'/index.htm'); + !is_dir($dir.'/'.$dir1.'/'.$dir2) && mkdir($dir.'/'.$dir1.'/'.$dir2, 0777) && @touch($dir.'/'.$dir1.'/'.$dir2.'/index.htm'); + !is_dir($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3) && mkdir($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3, 0777) && @touch($dir.'/'.$dir1.'/'.$dir2.'/'.$dir3.'/index.htm'); + } + + function get_home($uid) { + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + return $dir1.'/'.$dir2.'/'.$dir3; + } + + function get_avatar($uid, $size = 'big', $type = '') { + $size = in_array($size, array('big', 'middle', 'small')) ? $size : 'big'; + $uid = abs(intval($uid)); + $uid = sprintf("%09d", $uid); + $dir1 = substr($uid, 0, 3); + $dir2 = substr($uid, 3, 2); + $dir3 = substr($uid, 5, 2); + $typeadd = $type == 'real' ? '_real' : ''; + return $dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).$typeadd."_avatar_$size.jpg"; + } + + function &cache($cachefile) { + if(!isset($this->_CACHE[$cachefile])) { + $cachepath = UC_DATADIR.'./cache/'.$cachefile.'.php'; + if(!file_exists($cachepath)) { + $this->load('cache'); + $_ENV['cache']->updatedata($cachefile); + } else { + include_once $cachepath; + $this->_CACHE[$cachefile] = $_CACHE[$cachefile]; + } + } + return $this->_CACHE[$cachefile]; + } + + function input($k) { + if($k == 'uid') { + if(is_array($this->input[$k])) { + foreach ($this->input[$k] as $value) { + if(!preg_match("/^[0-9]+$/", $value)) { + return NULL; + } + } + } elseif(!preg_match("/^[0-9]+$/", $this->input[$k])) { + return NULL; + } + } + return isset($this->input[$k]) ? (is_array($this->input[$k]) ? $this->input[$k] : trim($this->input[$k])) : NULL; + } + + function serialize($s, $htmlon = 0) { + if(file_exists(UC_ROOT.RELEASE_ROOT.'./lib/xml.class.php')) { + include_once UC_ROOT.RELEASE_ROOT.'./lib/xml.class.php'; + } else { + include_once UC_ROOT.'./lib/xml.class.php'; + } + + return xml_serialize($s, $htmlon); + } + + function unserialize($s) { + if(file_exists(UC_ROOT.RELEASE_ROOT.'./lib/xml.class.php')) { + include_once UC_ROOT.RELEASE_ROOT.'./lib/xml.class.php'; + } else { + include_once UC_ROOT.'./lib/xml.class.php'; + } + + return xml_unserialize($s); + } + + function cutstr($string, $length, $dot = ' ...') { + if(strlen($string) <= $length) { + return $string; + } + + $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); + + $strcut = ''; + if(strtolower(UC_CHARSET) == 'utf-8') { + + $n = $tn = $noc = 0; + while($n < strlen($string)) { + + $t = ord($string[$n]); + if($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) { + $tn = 1; $n++; $noc++; + } elseif(194 <= $t && $t <= 223) { + $tn = 2; $n += 2; $noc += 2; + } elseif(224 <= $t && $t < 239) { + $tn = 3; $n += 3; $noc += 2; + } elseif(240 <= $t && $t <= 247) { + $tn = 4; $n += 4; $noc += 2; + } elseif(248 <= $t && $t <= 251) { + $tn = 5; $n += 5; $noc += 2; + } elseif($t == 252 || $t == 253) { + $tn = 6; $n += 6; $noc += 2; + } else { + $n++; + } + + if($noc >= $length) { + break; + } + + } + if($noc > $length) { + $n -= $tn; + } + + $strcut = substr($string, 0, $n); + + } else { + for($i = 0; $i < $length; $i++) { + $strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i]; + } + } + + $strcut = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $strcut); + + return $strcut.$dot; + } + + function setcookie($key, $value, $life = 0, $httponly = false) { + (!defined('UC_COOKIEPATH')) && define('UC_COOKIEPATH', '/'); + (!defined('UC_COOKIEDOMAIN')) && define('UC_COOKIEDOMAIN', ''); + + if($value === '' || $life < 0) { + $value = ''; + $life = -1; + } + + $life = $life > 0 ? $this->time + $life : ($life < 0 ? $this->time - 31536000 : 0); + $path = $httponly && PHP_VERSION < '5.2.0' ? UC_COOKIEPATH."; HttpOnly" : UC_COOKIEPATH; + $secure = is_https(); + if(PHP_VERSION < '5.2.0') { + setcookie($key, $value, $life, $path, UC_COOKIEDOMAIN, $secure); + } else { + setcookie($key, $value, $life, $path, UC_COOKIEDOMAIN, $secure, $httponly); + } + } + + function note_exists() { + $noteexists = $this->db->result_first("SELECT value FROM ".UC_DBTABLEPRE."vars WHERE name='noteexists'"); + if(empty($noteexists)) { + return FALSE; + } else { + return TRUE; + } + } + + function mail_exists() { + $mailexists = $this->db->result_first("SELECT value FROM ".UC_DBTABLEPRE."vars WHERE name='mailexists'"); + if(empty($mailexists)) { + return FALSE; + } else { + return TRUE; + } + } + + function dstripslashes($string) { + if(is_array($string)) { + foreach($string as $key => $val) { + $string[$key] = $this->dstripslashes($val); + } + } else { + $string = stripslashes($string); + } + return $string; + } + + function detectescape($basepath, $relativepath) { + if(!file_exists($basepath)) { + return FALSE; + } + + if(!file_exists($basepath . $relativepath)) { + $relativepath = dirname($relativepath); + if(!file_exists($basepath . $relativepath)) { + return FALSE; + } + } + + $real_base = realpath($basepath); + $real_target = realpath($basepath . $relativepath); + + if(strcmp($real_target, $real_base) !== 0 && strpos($real_target, $real_base . DIRECTORY_SEPARATOR) !== 0) { + return FALSE; + } + + return TRUE; + } + + function random($length, $numeric = 0) { + $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35); + $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed)); + if($numeric) { + $hash = ''; + } else { + $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64); + $length--; + } + $max = strlen($seed) - 1; + for($i = 0; $i < $length; $i++) { + $hash .= $seed[mt_rand(0, $max)]; + } + return $hash; + } + + function secrandom($length, $numeric = 0, $strong = false) { + $chars = $numeric ? array('A','B','+','/','=') : array('+','/','='); + $num_find = str_split('CDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'); + $num_repl = str_split('01234567890123456789012345678901234567890123456789'); + $isstrong = false; + if(function_exists('random_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + return random_bytes($length); + }; + } elseif(extension_loaded('mcrypt') && function_exists('mcrypt_create_iv')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + if ($rand !== false && strlen($rand) === $length) { + return $rand; + } else { + return false; + } + }; + } elseif(extension_loaded('openssl') && function_exists('openssl_random_pseudo_bytes')) { + $isstrong = true; + $random_bytes = function($length) { + $rand = openssl_random_pseudo_bytes($length, $secure); + if($secure === true) { + return $rand; + } else { + return false; + } + }; + } + if(!$isstrong) { + return $strong ? false : random($length, $numeric); + } + $retry_times = 0; + $return = ''; + while($retry_times < 128) { + $getlen = $length - strlen($return); // 33% extra bytes + $bytes = $random_bytes(max($getlen, 12)); + if($bytes === false) { + return false; + } + $bytes = str_replace($chars, '', base64_encode($bytes)); + $return .= substr($bytes, 0, $getlen); + if(strlen($return) == $length) { + return $numeric ? str_replace($num_find, $num_repl, $return) : $return; + } + $retry_times++; + } + } + + function generate_key($length = 32) { + $random = $this->secrandom($length); + $info = md5($_SERVER['SERVER_SOFTWARE'].$_SERVER['SERVER_NAME'].$_SERVER['SERVER_ADDR'].$_SERVER['SERVER_PORT'].$_SERVER['HTTP_USER_AGENT'].time()); + $return = ''; + for($i=0; $i<$length; $i++) { + $return .= $random[$i].$info[$i]; + } + return $return; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/cache.php b/uc_server/model/cache.php new file mode 100644 index 0000000..d76f541 --- /dev/null +++ b/uc_server/model/cache.php @@ -0,0 +1,101 @@ +cachemodel($base); + } + + function cachemodel(&$base) { + $this->base = $base; + $this->db = $base->db; + $this->map = array( + 'settings' => array('settings'), + 'badwords' => array('badwords'), + 'plugins' => array('plugins'), + 'apps' => array('apps'), + ); + } + + function updatedata($cachefile = '') { + if($cachefile) { + foreach((array)$this->map[$cachefile] as $modules) { + $s = "$method(), TRUE).";\r\n"; + } + $s .= "\r\n?>"; + file_put_contents(UC_DATADIR."./cache/$cachefile.php", $s, LOCK_EX); + } + } else { + foreach((array)$this->map as $file => $modules) { + $s = "$method(), TRUE).";\r\n"; + } + $s .= "\r\n?>"; + file_put_contents(UC_DATADIR."./cache/$file.php", $s, LOCK_EX); + } + } + } + + function updatetpl() { + $tpl = dir(UC_DATADIR.'view'); + while($entry = $tpl->read()) { + if(preg_match("/\.php$/", $entry)) { + @unlink(UC_DATADIR.'view/'.$entry); + } + } + $tpl->close(); + } + + function _get_badwords() { + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."badwords"); + $return = array(); + if(is_array($data)) { + foreach($data as $k => $v) { + $return['findpattern'][$k] = $v['findpattern']; + $return['replace'][$k] = $v['replacement']; + } + } + return $return; + } + + function _get_apps() { + $this->base->load('app'); + $apps = $_ENV['app']->get_apps(); + $apps2 = array(); + if(is_array($apps)) { + foreach($apps as $v) { + $apps2[$v['appid']] = $v; + } + } + return $apps2; + } + + function _get_settings() { + return $this->base->get_setting(); + } + + function _get_plugins() { + $this->base->load('plugin'); + return $_ENV['plugin']->get_plugins(); + } +} + +?> \ No newline at end of file diff --git a/uc_server/model/cron.php b/uc_server/model/cron.php new file mode 100644 index 0000000..665f72b --- /dev/null +++ b/uc_server/model/cron.php @@ -0,0 +1,36 @@ +cronmodel($base); + } + + function cronmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function note_delete_user() { + } + + function note_delete_pm() { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."badwords"); + return $data; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/domain.php b/uc_server/model/domain.php new file mode 100644 index 0000000..1f89101 --- /dev/null +++ b/uc_server/model/domain.php @@ -0,0 +1,55 @@ +domainmodel($base); + } + + function domainmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function add_domain($domain, $ip) { + if($domain) { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."domains SET domain='$domain', ip='$ip'"); + } + return $this->db->insert_id(); + } + + function get_total_num() { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."domains"); + return $data; + } + + function get_list($page, $ppp, $totalnum) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."domains LIMIT $start, $ppp"); + return $data; + } + + function delete_domain($arr) { + $domainids = $this->base->implode($arr); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."domains WHERE id IN ($domainids)"); + return $this->db->affected_rows(); + } + + function update_domain($domain, $ip, $id) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."domains SET domain='$domain', ip='$ip' WHERE id='$id'"); + return $this->db->affected_rows(); + } +} +?> \ No newline at end of file diff --git a/uc_server/model/feed.php b/uc_server/model/feed.php new file mode 100644 index 0000000..d49316f --- /dev/null +++ b/uc_server/model/feed.php @@ -0,0 +1,54 @@ +feedmodel($base); + } + + function feedmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_total_num() { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."feeds"); + return $data; + } + + function get_list($page, $ppp, $totalnum) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."feeds LIMIT $start, $ppp"); + + foreach((array)$data as $k=> $v) { + $searchs = $replaces = array(); + $title_data = $_ENV['misc']->string2array($v['title_data']); + foreach(array_keys($title_data) as $key) { + $searchs[] = '{'.$key.'}'; + $replaces[] = $title_data[$key]; + } + $searchs[] = '{actor}'; + $replaces[] = $v['username']; + $searchs[] = '{app}'; + $replaces[] = $this->base->apps[$v['appid']]['name']; + $data[$k]['title_template'] = str_replace($searchs, $replaces, $data[$k]['title_template']); + $data[$k]['dateline'] = $v['dateline'] ? $this->base->date($data[$k]['dateline']) : ''; + } + return $data; + } +} +?> \ No newline at end of file diff --git a/uc_server/model/friend.php b/uc_server/model/friend.php new file mode 100644 index 0000000..785f2cd --- /dev/null +++ b/uc_server/model/friend.php @@ -0,0 +1,107 @@ +friendmodel($base); + } + + function friendmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function add($uid, $friendid, $comment='') { + $direction = $this->db->result_first("SELECT direction FROM ".UC_DBTABLEPRE."friends WHERE uid='$friendid' AND friendid='$uid' LIMIT 1"); + if($direction == 1) { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."friends SET uid='$uid', friendid='$friendid', comment='$comment', direction='3'", 'SILENT'); + $this->db->query("UPDATE ".UC_DBTABLEPRE."friends SET direction='3' WHERE uid='$friendid' AND friendid='$uid'"); + return 1; + } elseif($direction == 2) { + return 1; + } elseif($direction == 3) { + return -1; + } else { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."friends SET uid='$uid', friendid='$friendid', comment='$comment', direction='1'", 'SILENT'); + return $this->db->insert_id(); + } + } + + function delete($uid, $friendids) { + $friendids = $this->base->implode($friendids); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."friends WHERE uid='$uid' AND friendid IN ($friendids)"); + $affectedrows = $this->db->affected_rows(); + if($affectedrows > 0) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."friends SET direction=1 WHERE uid IN ($friendids) AND friendid='$uid' AND direction='3'"); + } + return $affectedrows; + } + + function get_totalnum_by_uid($uid, $direction = 0) { + $sqladd = ''; + if($direction == 0) { + $sqladd = "uid='$uid'"; + } elseif($direction == 1) { + $sqladd = "uid='$uid' AND direction='1'"; + } elseif($direction == 2) { + $sqladd = "friendid='$uid' AND direction='1'"; + } elseif($direction == 3) { + $sqladd = "uid='$uid' AND direction='3'"; + } + $totalnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."friends WHERE $sqladd"); + return $totalnum; + } + + function get_list($uid, $page, $pagesize, $totalnum, $direction = 0) { + $start = $this->base->page_get_start($page, $pagesize, $totalnum); + $sqladd = ''; + if($direction == 0) { + $sqladd = "f.uid='$uid'"; + } elseif($direction == 1) { + $sqladd = "f.uid='$uid' AND f.direction='1'"; + } elseif($direction == 2) { + $sqladd = "f.friendid='$uid' AND f.direction='1'"; + } elseif($direction == 3) { + $sqladd = "f.uid='$uid' AND f.direction='3'"; + } + if($sqladd) { + $data = $this->db->fetch_all("SELECT f.*, m.username FROM ".UC_DBTABLEPRE."friends f LEFT JOIN ".UC_DBTABLEPRE."members m ON f.friendid=m.uid WHERE $sqladd LIMIT $start, $pagesize"); + return $data; + } else { + return array(); + } + } + + function is_friend($uid, $friendids, $direction = 0) { + $friendid_str = implode("', '", $friendids); + $sqladd = ''; + if($direction == 0) { + $sqladd = "uid='$uid'"; + } elseif($direction == 1) { + $sqladd = "uid='$uid' AND friendid IN ('$friendid_str') AND direction='1'"; + } elseif($direction == 2) { + $sqladd = "friendid='$uid' AND uid IN ('$friendid_str') AND direction='1'"; + } elseif($direction == 3) { + $sqladd = "uid='$uid' AND friendid IN ('$friendid_str') AND direction='3'"; + } + if($this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."friends WHERE $sqladd") == count($friendids)) { + return true; + } else { + return false; + } + } +} + +?> \ No newline at end of file diff --git a/uc_server/model/index.htm b/uc_server/model/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/model/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/model/mail.php b/uc_server/model/mail.php new file mode 100644 index 0000000..e9ee127 --- /dev/null +++ b/uc_server/model/mail.php @@ -0,0 +1,150 @@ +mailmodel($base); + } + + function mailmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + $this->apps = &$this->base->cache['apps']; + } + + function get_total_num() { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."mailqueue"); + return $data; + } + + function get_list($page, $ppp, $totalnum) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT m.*, u.username, u.email FROM ".UC_DBTABLEPRE."mailqueue m LEFT JOIN ".UC_DBTABLEPRE."members u ON m.touid=u.uid ORDER BY dateline DESC LIMIT $start, $ppp"); + foreach((array)$data as $k => $v) { + $data[$k]['subject'] = dhtmlspecialchars($v['subject']); + $data[$k]['tomail'] = empty($v['tomail']) ? $v['email'] : $v['tomail']; + $data[$k]['dateline'] = $v['dateline'] ? $this->base->date($data[$k]['dateline']) : ''; + $data[$k]['appname'] = $this->base->cache['apps'][$v['appid']]['name']; + } + return $data; + } + + function delete_mail($ids) { + $ids = $this->base->implode($ids); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mailqueue WHERE mailid IN ($ids)"); + return $this->db->affected_rows(); + } + + function add($mail) { + if($mail['level']) { + $sql = "INSERT INTO ".UC_DBTABLEPRE."mailqueue (touid, tomail, subject, message, frommail, charset, htmlon, level, dateline, failures, appid) VALUES "; + $values_arr = array(); + foreach($mail['uids'] as $uid) { + if(empty($uid)) continue; + $uid = intval($uid); + $values_arr[] = "('$uid', '', '{$mail['subject']}', '{$mail['message']}', '{$mail['frommail']}', '{$mail['charset']}', '{$mail['htmlon']}', '{$mail['level']}', '{$mail['dateline']}', '0', '{$mail['appid']}')"; + } + foreach($mail['emails'] as $email) { + if(empty($email)) continue; + $values_arr[] = "('', '$email', '{$mail['subject']}', '{$mail['message']}', '{$mail['frommail']}', '{$mail['charset']}', '{$mail['htmlon']}', '{$mail['level']}', '{$mail['dateline']}', '0', '{$mail['appid']}')"; + } + $sql .= implode(',', $values_arr); + $this->db->query($sql); + $insert_id = $this->db->insert_id(); + $insert_id && $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars SET name='mailexists', value='1'"); + return $insert_id; + } else { + $mail['email_to'] = array(); + $uids = 0; + foreach($mail['uids'] as $uid) { + if(empty($uid)) continue; + $uids .= ','.intval($uid); + } + $users = $this->db->fetch_all("SELECT uid, username, email FROM ".UC_DBTABLEPRE."members WHERE uid IN ($uids)"); + foreach($users as $v) { + $mail['email_to'][] = $v['username'].'<'.$v['email'].'>'; + } + foreach($mail['emails'] as $email) { + if(empty($email)) continue; + $mail['email_to'][] = $email; + } + $mail['message'] = str_replace('\"', '"', $mail['message']); + $mail['email_to'] = implode(',', $mail['email_to']); + return $this->send_one_mail($mail); + } + } + + function send() { + register_shutdown_function(array($this, '_send')); + } + + function _send() { + + $mail = $this->_get_mail(); + if(empty($mail)) { + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars SET name='mailexists', value='0'"); + return NULL; + } else { + $mail['email_to'] = $mail['tomail'] ? $mail['tomail'] : $mail['username'].'<'.$mail['email'].'>'; + if($this->send_one_mail($mail)) { + $this->_delete_one_mail($mail['mailid']); + return true; + } else { + $this->_update_failures($mail['mailid']); + return false; + } + } + + } + + function send_by_id($mailid) { + if ($this->send_one_mail($this->_get_mail_by_id($mailid))) { + $this->_delete_one_mail($mailid); + return true; + } + } + + function send_one_mail($mail) { + if(empty($mail)) return; + $mail['email_to'] = $mail['email_to'] ? $mail['email_to'] : $mail['username'].'<'.$mail['email'].'>'; + $mail_setting = $this->base->settings; + return include UC_ROOT.'lib/sendmail.inc.php'; + } + + function _get_mail() { + $data = $this->db->fetch_first("SELECT m.*, u.username, u.email FROM ".UC_DBTABLEPRE."mailqueue m LEFT JOIN ".UC_DBTABLEPRE."members u ON m.touid=u.uid WHERE failures<'".UC_MAIL_REPEAT."' ORDER BY level DESC, mailid ASC LIMIT 1"); + return $data; + } + + function _get_mail_by_id($mailid) { + $data = $this->db->fetch_first("SELECT m.*, u.username, u.email FROM ".UC_DBTABLEPRE."mailqueue m LEFT JOIN ".UC_DBTABLEPRE."members u ON m.touid=u.uid WHERE mailid='$mailid'"); + return $data; + } + + function _delete_one_mail($mailid) { + $mailid = intval($mailid); + return $this->db->query("DELETE FROM ".UC_DBTABLEPRE."mailqueue WHERE mailid='$mailid'"); + } + + function _update_failures($mailid) { + $mailid = intval($mailid); + return $this->db->query("UPDATE ".UC_DBTABLEPRE."mailqueue SET failures=failures+1 WHERE mailid='$mailid'"); + } +} + +?> \ No newline at end of file diff --git a/uc_server/model/misc.php b/uc_server/model/misc.php new file mode 100644 index 0000000..91abf7e --- /dev/null +++ b/uc_server/model/misc.php @@ -0,0 +1,219 @@ +miscmodel($base); + } + + function miscmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_host_by_url($url) { + $m = parse_url($url); + if(!$m['host']) { + return -1; + } + if(!(filter_var($m['host'], FILTER_VALIDATE_IP) !== false)) { + $ip = @gethostbyname($m['host']); + if(!$ip || $ip == $m['host']) { + return -2; + } + return $ip; + } else { + return $m['host']; + } + } + + function check_url($url) { + return preg_match("/(https?){1}:\/\/|www\.([^\[\"']+?)?/i", $url); + } + + function check_ip($ip) { + return filter_var($ip, FILTER_VALIDATE_IP) !== false; + } + + function dfopen2($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $__times__ = isset($_GET['__times__']) ? intval($_GET['__times__']) + 1 : 1; + if($__times__ > 2) { + return ''; + } + $url .= (strpos($url, '?') === FALSE ? '?' : '&')."__times__=$__times__"; + return $this->dfopen($url, $limit, $post, $cookie, $bysocket, $ip, $timeout, $block, $encodetype, $allowcurl); + } + + function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE) { + $return = ''; + $matches = parse_url($url); + $scheme = strtolower($matches['scheme']); + $host = $matches['host']; + $path = !empty($matches['path']) ? $matches['path'].(!empty($matches['query']) ? '?'.$matches['query'] : '') : '/'; + $port = !empty($matches['port']) ? $matches['port'] : ($scheme == 'https' ? 443 : 80); + + if(function_exists('curl_init') && function_exists('curl_exec') && $allowcurl) { + $ch = curl_init(); + $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); + curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + if(!empty($ip) && filter_var($ip, FILTER_VALIDATE_IP) && !filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + if($post) { + curl_setopt($ch, CURLOPT_POST, 1); + if($encodetype == 'URLENCODE') { + curl_setopt($ch, CURLOPT_POSTFIELDS, $post); + } else { + parse_str($post, $postarray); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postarray); + } + } + if($cookie) { + curl_setopt($ch, CURLOPT_COOKIE, $cookie); + } + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); + $data = curl_exec($ch); + $status = curl_getinfo($ch); + $errno = curl_errno($ch); + curl_close($ch); + if($errno || $status['http_code'] != 200) { + return; + } else { + return !$limit ? $data : substr($data, 0, $limit); + } + } + + if($post) { + $out = "POST $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + if($allowcurl) { + $encodetype = 'URLENCODE'; + } + $boundary = $encodetype == 'URLENCODE' ? '' : '; boundary='.trim(substr(trim($post), 2, strpos(trim($post), "\n") - 2)); + $header .= $encodetype == 'URLENCODE' ? "Content-Type: application/x-www-form-urlencoded\r\n" : "Content-Type: multipart/form-data$boundary\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= 'Content-Length: '.strlen($post)."\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cache-Control: no-cache\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header.$post; + } else { + $out = "GET $path HTTP/1.0\r\n"; + $header = "Accept: */*\r\n"; + $header .= "Accept-Language: zh-cn\r\n"; + $header .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n"; + $header .= "Host: $host:$port\r\n"; + $header .= "Connection: Close\r\n"; + $header .= "Cookie: $cookie\r\n\r\n"; + $out .= $header; + } + + $fpflag = 0; + $context = array(); + if($scheme == 'https') { + $context['ssl'] = array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'peer_name' => $host + ); + if(version_compare(PHP_VERSION, '5.6.0', '<')) { + $context['ssl']['SNI_enabled'] = true; + $context['ssl']['SNI_server_name'] = $host; + } + } + if(ini_get('allow_url_fopen')) { + $context['http'] = array( + 'method' => $post ? 'POST' : 'GET', + 'header' => $header, + 'timeout' => $timeout + ); + if($post) { + $context['http']['content'] = $post; + } + $context = stream_context_create($context); + $fp = @fopen($scheme.'://'.($ip ? $ip : $host).':'.$port.$path, 'b', false, $context); + $fpflag = 1; + } elseif(function_exists('stream_socket_client')) { + $context = stream_context_create($context); + $fp = @stream_socket_client(($scheme == 'https' ? 'ssl://' : '').($ip ? $ip : $host).':'.$port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context); + } else { + $fp = @fsocketopen(($scheme == 'https' ? 'ssl://' : '').($scheme == 'https' ? $host : ($ip ? $ip : $host)), $port, $errno, $errstr, $timeout); + } + + if(!$fp) { + return ''; + } else { + stream_set_blocking($fp, $block); + stream_set_timeout($fp, $timeout); + if(!$fpflag) { + @fwrite($fp, $out); + } + $status = stream_get_meta_data($fp); + if(!$status['timed_out']) { + while (!feof($fp) && !$fpflag) { + if(($header = @fgets($fp)) && ($header == "\r\n" || $header == "\n")) { + break; + } + } + + $stop = false; + while(!feof($fp) && !$stop) { + $data = fread($fp, ($limit == 0 || $limit > 8192 ? 8192 : $limit)); + $return .= $data; + if($limit) { + $limit -= strlen($data); + $stop = $limit <= 0; + } + } + } + @fclose($fp); + return $return; + } + } + + function array2string($arr) { + $s = $sep = ''; + if($arr && is_array($arr)) { + foreach($arr as $k => $v) { + $s .= $sep.addslashes($k).UC_ARRAY_SEP_1.$v; + $sep = UC_ARRAY_SEP_2; + } + } + return $s; + } + + function string2array($s) { + $arr = explode(UC_ARRAY_SEP_2, $s); + $arr2 = array(); + foreach($arr as $k => $v) { + list($key, $val) = explode(UC_ARRAY_SEP_1, $v); + $arr2[$key] = $val; + } + return $arr2; + } +} + +?> \ No newline at end of file diff --git a/uc_server/model/note.php b/uc_server/model/note.php new file mode 100644 index 0000000..b15aafb --- /dev/null +++ b/uc_server/model/note.php @@ -0,0 +1,207 @@ +notemodel($base); + } + + function notemodel(&$base) { + $this->base = $base; + $this->db = $base->db; + $this->apps = $this->base->cache('apps'); + $this->operations = array( + 'test'=>array('', 'action=test'), + 'deleteuser'=>array('', 'action=deleteuser'), + 'renameuser'=>array('', 'action=renameuser'), + 'deletefriend'=>array('', 'action=deletefriend'), + 'gettag'=>array('', 'action=gettag', 'tag', 'updatedata'), + 'getcreditsettings'=>array('', 'action=getcreditsettings'), + 'getcredit'=>array('', 'action=getcredit'), + 'updatecreditsettings'=>array('', 'action=updatecreditsettings'), + 'updateclient'=>array('', 'action=updateclient'), + 'updatepw'=>array('', 'action=updatepw'), + 'updatebadwords'=>array('', 'action=updatebadwords'), + 'updatehosts'=>array('', 'action=updatehosts'), + 'updateapps'=>array('', 'action=updateapps'), + 'updatecredit'=>array('', 'action=updatecredit'), + ); + } + + function get_total_num($all = TRUE) { + $closedadd = $all ? '' : ' WHERE closed=\'0\''; + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."notelist $closedadd"); + return $data; + } + + function get_list($page, $ppp, $totalnum, $all = TRUE) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $closedadd = $all ? '' : ' WHERE closed=\'0\''; + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."notelist $closedadd ORDER BY dateline DESC LIMIT $start, $ppp"); + foreach((array)$data as $k => $v) { + $data[$k]['postdata2'] = addslashes(str_replace('"', '', $data[$k]['postdata'])); + $data[$k]['getdata2'] = addslashes(str_replace('"', '', $v['getdata'])); + $data[$k]['dateline'] = $v['dateline'] ? $this->base->date($data[$k]['dateline']) : ''; + } + return $data; + } + + function delete_note($ids) { + $ids = $this->base->implode($ids); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."notelist WHERE noteid IN ($ids)"); + return $this->db->affected_rows(); + } + + function add($operation, $getdata='', $postdata='', $appids=array(), $pri = 0) { + $extra = $varextra = ''; + foreach((array)$this->apps as $appid => $app) { + $appid = $app['appid']; + if($appid == intval($appid)) { + if($appids && !in_array($appid, $appids)) { + $appadd[] = 'app'.$appid."='1'"; + } else { + $varadd[] = "('noteexists{$appid}', '1')"; + } + } + } + if($appadd) { + $extra = implode(',', $appadd); + $extra = $extra ? ', '.$extra : ''; + } + if($varadd) { + $varextra = implode(', ', $varadd); + $varextra = $varextra ? ', '.$varextra : ''; + } + $getdata = addslashes($getdata); + $postdata = addslashes($postdata); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."notelist SET getdata='$getdata', operation='$operation', pri='$pri', postdata='$postdata'$extra"); + $insert_id = $this->db->insert_id(); + $insert_id && $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars (name, value) VALUES ('noteexists', '1')$varextra"); + return $insert_id; + } + + function send() { + register_shutdown_function(array($this, '_send')); + } + + function _send() { + + + $note = $this->_get_note(); + if(empty($note)) { + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."vars SET name='noteexists', value='0'"); + return NULL; + } + + $closenote = TRUE; + foreach((array)$this->apps as $appid => $app) { + $appnotes = $note['app'.$appid]; + if($app['recvnote'] && $appnotes != 1 && $appnotes > -UC_NOTE_REPEAT) { + $this->sendone($appid, 0, $note); + $closenote = FALSE; + break; + } + } + if($closenote) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."notelist SET closed='1' WHERE noteid='{$note['noteid']}'"); + } + + $this->_gc(); + } + + function sendone($appid, $noteid = 0, $note = '') { + require_once UC_ROOT.'./lib/xml.class.php'; + $return = FALSE; + $app = $this->apps[$appid]; + if($noteid) { + $note = $this->_get_note_by_id($noteid); + } + $this->base->load('misc'); + $apifilename = isset($app['apifilename']) && $app['apifilename'] ? $app['apifilename'] : 'uc.php'; + if(!isset($app['extra']['standalone'])) { + $url = $this->get_url_code($note['operation'], $note['getdata'], $appid); + $note['postdata'] = str_replace(array("\n", "\r"), '', $note['postdata']); + $response = trim($_ENV['misc']->dfopen2($url, 0, $note['postdata'], '', 1, $app['ip'], UC_NOTE_TIMEOUT, TRUE)); + } + + $returnsucceed = $response != '' && ($response == 1 || is_array(xml_unserialize($response))); + + $closedsqladd = $this->_close_note($note, $this->apps, $returnsucceed, $appid) ? ",closed='1'" : ''; + + if($returnsucceed) { + if($this->operations[$note['operation']][2]) { + $this->base->load($this->operations[$note['operation']][2]); + $func = $this->operations[$note['operation']][3]; + $_ENV[$this->operations[$note['operation']][2]]->$func($appid, $response); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."notelist SET app$appid='1', totalnum=totalnum+1, succeednum=succeednum+1, dateline='{$this->base->time}' $closedsqladd WHERE noteid='{$note['noteid']}'", 'SILENT'); + $return = TRUE; + } else { + $this->db->query("UPDATE ".UC_DBTABLEPRE."notelist SET app$appid = app$appid-'1', totalnum=totalnum+1, dateline='{$this->base->time}' $closedsqladd WHERE noteid='{$note['noteid']}'", 'SILENT'); + $return = FALSE; + } + return $return; + } + + function _get_note() { + $data = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."notelist WHERE closed='0' ORDER BY pri DESC, noteid ASC LIMIT 1"); + return $data; + } + + function _gc() { + rand(0, UC_NOTE_GC) == 0 && $this->db->query("DELETE FROM ".UC_DBTABLEPRE."notelist WHERE closed='1'"); + } + + function _close_note($note, $apps, $returnsucceed, $appid) { + $note['app'.$appid] = $returnsucceed ? 1 : $note['app'.$appid] - 1; + $appcount = count($apps); + foreach($apps as $key => $app) { + $appstatus = $note['app'.$app['appid']]; + if(!$app['recvnote'] || $appstatus == 1 || $appstatus <= -UC_NOTE_REPEAT) { + $appcount--; + } + } + if($appcount < 1) { + return TRUE; + } + } + + function _get_note_by_id($noteid) { + $data = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."notelist WHERE noteid='$noteid'"); + return $data; + } + + function get_url_code($operation, $getdata, $appid) { + $app = $this->apps[$appid]; + $authkey = $app['authkey']; + $url = $app['url']; + $apifilename = isset($app['apifilename']) && $app['apifilename'] ? $app['apifilename'] : 'uc.php'; + $action = $this->operations[$operation][1]; + $code = urlencode($this->base->authcode("$action&".($getdata ? "$getdata&" : '')."time=".$this->base->time, 'ENCODE', $authkey)); + return $url."/api/$apifilename?code=$code"; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/plugin.php b/uc_server/model/plugin.php new file mode 100644 index 0000000..a3429e5 --- /dev/null +++ b/uc_server/model/plugin.php @@ -0,0 +1,106 @@ +pluginmodel($base); + } + + function pluginmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_plugins() { + include_once UC_ROOT.'./lib/xml.class.php'; + $arr = array(); + $dir = UC_ROOT.'./plugin'; + $d = opendir($dir); + while($f = readdir($d)) { + if($f != '.' && $f != '..' && $f != '.svn' && is_dir($dir.'/'.$f)) { + $s = file_get_contents($dir.'/'.$f.'/plugin.xml'); + $arr1 = xml_unserialize($s); + $arr1['dir'] = $f; + unset($arr1['lang']); + $arr[] = $arr1; + } + } + $arr = $this->orderby_tabindex($arr); + return $arr; + } + + function get_plugin($pluginname) { + $f = file_get_contents(UC_ROOT."./plugin/$pluginname/plugin.xml"); + include_once UC_ROOT.'./lib/xml.class.php'; + return xml_unserialize($f); + } + + function get_plugin_by_name($pluginname) { + $dir = UC_ROOT.'./plugin'; + $s = file_get_contents($dir.'/'.$pluginname.'/plugin.xml'); + return xml_unserialize($s, TRUE); + } + + function orderby_tabindex($arr1) { + $arr2 = array(); + $t = array(); + foreach($arr1 as $k => $v) { + $t[$k] = $v['tabindex']; + } + asort($t); + $arr3 = array(); + foreach($t as $k => $v) { + $arr3[$k] = $arr1[$k]; + } + return $arr3; + } + + function cert_get_file() { + return UC_ROOT.'./data/tmp/ucenter_'.substr(md5(UC_KEY), 0, 16).'.cert'; + } + + function cert_dump_encode($arr, $life = 0) { + $s = "# UCenter Applications Setting Dump\n". + "# Version: UCenter ".UC_SERVER_VERSION."\n". + "# Time: ".$this->time."\n". + "# Expires: ".($this->time + $life)."\n". + "# From: ".UC_API."\n". + "#\n". + "# This file was BASE64 encoded\n". + "#\n". + "# UCenter Community: https://www.discuz.vip\n". + "# Please visit our website for latest news about UCenter\n". + "# --------------------------------------------------------\n\n\n". + wordwrap(base64_encode(serialize($arr)), 50, "\n", 1); + return $s; + } + + function cert_dump_decode($certfile) { + $s = @file_get_contents($certfile); + if(empty($s)) { + return array(); + } + preg_match("/# Expires: (.*?)\n/", $s, $m); + if(empty($m[1]) || $m[1] < $this->time) { + unlink($certfile); + return array(); + } + $s = preg_replace("/(#.*\s+)*/", '', $s); + $arr = daddslashes(unserialize(base64_decode($s)), 1); + return $arr; + } +} + +?> \ No newline at end of file diff --git a/uc_server/model/pm.php b/uc_server/model/pm.php new file mode 100644 index 0000000..4492f89 --- /dev/null +++ b/uc_server/model/pm.php @@ -0,0 +1,868 @@ +pmmodel($base); + } + + function pmmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function pmintval($pmid) { + return @is_numeric($pmid) ? $pmid : 0; + } + + function getpmbypmid($uid, $pmid) { + if(!$pmid) { + return array(); + } + $arr = array(); + $pm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_indexes i LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=i.plid WHERE i.pmid='$pmid'"); + if($this->isprivilege($pm['plid'], $uid)) { + $pms = $this->db->fetch_all("SELECT t.*, p.*, t.authorid as founderuid, t.dateline as founddateline FROM ".UC_DBTABLEPRE.$this->getposttablename($pm['plid'])." p LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=p.plid WHERE p.pmid='{$pm['pmid']}'"); + $arr = $this->getpostlist($pms); + } + return $arr; + } + + function isprivilege($plid, $uid) { + if(!$plid || !$uid) { + return true; + } + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid' AND uid='$uid'"); + if($this->db->fetch_array($query)) { + return true; + } else { + return false; + } + } + + function getpmbyplid($uid, $plid, $starttime, $endtime, $start, $ppp, $type = 0) { + if(!$type) { + $pm = $this->getprivatepmbyplid($uid, $plid, $starttime, $endtime, $start, $ppp); + } else { + $pm = $this->getchatpmbyplid($uid, $plid, $starttime, $endtime, $start, $ppp); + } + return $this->getpostlist($pm); + } + + function getpostlist($list) { + if(empty($list)) { + return array(); + } + $authoridarr = $authorarr = array(); + foreach($list as $key => $value) { + $authoridarr[$value['authorid']] = $value['authorid']; + } + if($authoridarr) { + $this->base->load('user'); + $authorarr = $_ENV['user']->id2name($authoridarr); + } + foreach($list as $key => $value) { + if($value['pmtype'] == 1) { + $users = explode('_', $value['min_max']); + if($value['authorid'] == $users[0]) { + $value['touid'] = $users[1]; + } else { + $value['touid'] = $users[0]; + } + } else { + $value['touid'] = 0; + } + $value['author'] = $authorarr[$value['authorid']]; + + $value['msgfromid'] = $value['authorid']; + $value['msgfrom'] = $value['author']; + $value['msgtoid'] = $value['touid']; + + unset($value['min_max']); + unset($value['delstatus']); + unset($value['lastmessage']); + $list[$key] = $value; + } + return $list; + } + + function setpmstatus($uid, $touids, $plids, $status = 0) { + if(!$uid) { + return false; + } + if(!$status) { + $oldstatus = 1; + $newstatus = 0; + } else { + $oldstatus = 0; + $newstatus = 1; + } + if($touids) { + foreach($touids as $key => $value) { + if($uid == $value || !$value || !preg_match("/^[0-9]+$/", $value)) { + return false; + } + $relastionship[] = $this->relationship($uid, $value); + } + $plid = $plidpostarr = array(); + $query = $this->db->query("SELECT plid FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max IN (".$this->base->implode($relationship).")"); + while($thread = $this->db->fetch_array($query)) { + $plidarr[] = $thread['plid']; + } + if($plidarr) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew='$newstatus' WHERE plid IN (".$this->base->implode($plidarr).") AND uid='$uid' AND isnew='$oldstatus'"); + } + } + if($plids) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew='$newstatus' WHERE plid IN (".$this->base->implode($plids).") AND uid='$uid' AND isnew='$oldstatus'"); + } + return true; + } + + function set_ignore($uid) { + return $this->db->query("DELETE FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); + } + + function isnewpm($uid) { + return $this->db->result_first("SELECT uid FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); + } + + function lastpm($uid) { + $lastpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON m.plid=t.plid WHERE m.uid='$uid' ORDER BY m.lastdateline DESC LIMIT 1"); + $lastmessage = unserialize($lastpm['lastmessage']); + if($lastmessage['lastauthorid']) { + $lastpm['lastauthorid'] = $lastmessage['lastauthorid']; + $lastpm['lastauthor'] = $lastmessage['lastauthor']; + $lastpm['lastsummary'] = $lastmessage['lastsummary']; + } else { + $lastpm['lastauthorid'] = $lastmessage['firstauthorid']; + $lastpm['lastauthor'] = $lastmessage['firstauthor']; + $lastpm['lastsummary'] = $lastmessage['firstsummary']; + } + return $lastpm; + } + + function getpmnum($uid, $type = 0, $isnew = 0) { + $newsql = ''; + $newnum = 0; + + if($isnew) { + $newsql = 'AND m.isnew=1'; + } + if(!$type) { + $newnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members m WHERE m.uid='$uid' $newsql"); + } else { + $newnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=m.plid WHERE m.uid='$uid' $newsql AND t.pmtype='$type'"); + } + return $newnum; + } + + function getpmnumbyplid($uid, $plid) { + return $this->db->result_first("SELECT pmnum FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid' AND uid='$uid'"); + } + + function sendpm($fromuid, $fromusername, $touids, $subject, $message, $type = 0) { + if(!$fromuid || !$fromusername || !$touids || !$message) { + return 0; + } + $touids = array_unique($touids); + $relationship = $existplid = $pm_member_insertsql = array(); + $this->base->load('user'); + $tmptouidarr = $touids; + $blackls = $this->get_blackls($fromuid, $touids); + + foreach($tmptouidarr as $key => $value) { + if($fromuid == $value || !$value) { + return PMSENDSELF_ERROR; + } + + if(in_array('{ALL}', $blackls[$value])) { + unset($touids[$key]); + continue; + } + $blackls[$value] = $_ENV['user']->name2id($blackls[$value]); + if(!(isset($blackls[$value]) && !in_array($fromuid, $blackls[$value]))) { + unset($touids[$key]); + } else { + $relationship[$value] = $this->relationship($fromuid, $value); + } + } + if(empty($touids)) { + return PMSENDNONE_ERROR; + } + if($type == 1 && count($touids) < 2) { + return PMSENDCHATNUM_ERROR; + } + + $_CACHE['badwords'] = $this->base->cache('badwords'); + if($_CACHE['badwords']['findpattern']) { + $subject = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $subject); + $message = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $message); + } + if(!$subject) { + $subject = $this->removecode(trim($message), 80); + } else { + $subject = dhtmlspecialchars($subject); + } + $lastsummary = addslashes($this->removecode(trim(stripslashes($message)), 150)); + $subject = addslashes($subject); + + if(!$type) { + $query = $this->db->query("SELECT plid, min_max FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max IN (".$this->base->implode($relationship).")"); + while($thread = $this->db->fetch_array($query)) { + $existplid[$thread['min_max']] = $thread['plid']; + } + $lastmessage = array('lastauthorid' => $fromuid, 'lastauthor' => $fromusername, 'lastsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + foreach($relationship as $key => $value) { + if(!isset($existplid[$value])) { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_lists(authorid, pmtype, subject, members, min_max, dateline, lastmessage) VALUES('$fromuid', '1', '$subject', 2, '$value', '".$this->base->time."', '$lastmessage')"); + $plid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$key', '1', '1', '0', '".$this->base->time."')"); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$fromuid', '0', '1', '".$this->base->time."', '".$this->base->time."')"); + } else { + $plid = $existplid[$value]; + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + $result = $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$key', '1', '1', '0', '".$this->base->time."')", 'SILENT'); + if(!$result) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=1, pmnum=pmnum+1, lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$key'"); + } + $result = $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$fromuid', '0', '1', '".$this->base->time."', '".$this->base->time."')", 'SILENT'); + if(!$result) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0, pmnum=pmnum+1, lastupdate='".$this->base->time."', lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$fromuid'"); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET lastmessage='$lastmessage' WHERE plid='$plid'"); + } + } + } else { + $lastmessage = array('firstauthorid' => $fromuid, 'firstauthor' => $fromusername, 'firstsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_lists(authorid, pmtype, subject, members, min_max, dateline, lastmessage) VALUES('$fromuid', '2', '$subject', '".(count($touids)+1)."', '', '".$this->base->time."', '$lastmessage')"); + $plid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + $pm_member_insertsql[] = "('$plid', '$fromuid', '0', '1', '".$this->base->time."', '".$this->base->time."')"; + foreach($touids as $key => $value) { + $pm_member_insertsql[] = "('$plid', '$value', '1', '1', '0', '".$this->base->time."')"; + } + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES ".implode(',', $pm_member_insertsql)); + } + + $newpm = array(); + foreach($touids as $key => $value) { + $newpm[] = "('$value')"; + } + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."newpm(uid) VALUES ".implode(',', $newpm)); + return $pmid; + } + + function replypm($plid, $fromuid, $fromusername, $message) { + if(!$plid || !$fromuid || !$fromusername || !$message) { + return 0; + } + + $threadpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if(empty($threadpm)) { + return PMTHREADNONE_ERROR; + } + + if($threadpm['pmtype'] == 1) { + $users = explode('_', $threadpm['min_max']); + if($users[0] == $fromuid) { + $touid = $users[1]; + } elseif($users[1] == $fromuid) { + $touid = $users[0]; + } else { + return PMPRIVILEGENONE_ERROR; + } + + $blackls = $this->get_blackls($fromuid, $touid); + if(in_array('{ALL}', $blackls[$touid])) { + return PMINBALCKLIST_ERROR; + } + $this->base->load('user'); + $blackls[$touid] = $_ENV['user']->name2id($blackls[$touid]); + if(!(isset($blackls[$touid]) && !in_array($fromuid, $blackls[$touid]))) { + return PMINBALCKLIST_ERROR; + } + } + + $memberuid = array(); + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + while($member = $this->db->fetch_array($query)) { + $memberuid[$member['uid']] = "('{$member['uid']}')"; + } + if(!isset($memberuid[$fromuid])) { + return PMPRIVILEGENONE_ERROR; + } + + $_CACHE['badwords'] = $this->base->cache('badwords'); + if($_CACHE['badwords']['findpattern']) { + $message = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $message); + } + $lastsummary = addslashes($this->removecode(trim(stripslashes($message)), 150)); + + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_indexes(plid) VALUES('$plid')"); + $pmid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE.$this->getposttablename($plid)."(pmid, plid, authorid, message, dateline, delstatus) VALUES('$pmid', '$plid', '$fromuid', '$message', '".$this->base->time."', 0)"); + if($threadpm['pmtype'] == 1) { + $lastmessage = array('lastauthorid' => $fromuid, 'lastauthor' => $fromusername, 'lastsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + $result = $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$touid', '1', '1', '0', '".$this->base->time."')", 'SILENT'); + if(!$result) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=1, pmnum=pmnum+1, lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$touid'"); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0, pmnum=pmnum+1, lastupdate='".$this->base->time."', lastdateline='".$this->base->time."' WHERE plid='$plid' AND uid='$fromuid'"); + } else { + $lastmessage = unserialize($threadpm['lastmessage']); + $lastmessage = array('firstauthorid' => $lastmessage['firstauthorid'], 'firstauthor' => $lastmessage['firstauthor'], 'firstsummary' => $lastmessage['firstsummary'], 'lastauthorid' => $fromuid, 'lastauthor' => $fromusername, 'lastsummary' => $lastsummary); + $lastmessage = addslashes(serialize($lastmessage)); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=1, pmnum=pmnum+1, lastdateline='".$this->base->time."' WHERE plid='$plid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0, lastupdate='".$this->base->time."' WHERE plid='$plid' AND uid='$fromuid'"); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET lastmessage='$lastmessage' WHERE plid='$plid'"); + + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."newpm(uid) VALUES ".implode(',', $memberuid).""); + + return $pmid; + } + + function appendchatpm($plid, $uid, $touid) { + if(!$plid || !$uid || !$touid) { + return 0; + } + $threadpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if(empty($threadpm)) { + return PMTHREADNONE_ERROR; + } + if($threadpm['pmtype'] != 2) { + return PMCHATTYPE_ERROR; + } + if($threadpm['authorid'] != $uid) { + return PMPRIVILEGENONE_ERROR; + } + + $blackls = $this->get_blackls($uid, $touid); + if(in_array('{ALL}', $blackls[$touid])) { + return PMINBALCKLIST_ERROR; + } + $this->base->load('user'); + $blackls[$touid] = $_ENV['user']->name2id($blackls[$touid]); + if(!(isset($blackls[$touid]) && !in_array($uid, $blackls[$touid]))) { + return PMINBALCKLIST_ERROR; + } + + $pmnum = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$this->getposttablename($plid)." WHERE plid='$plid'"); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pm_members(plid, uid, isnew, pmnum, lastupdate, lastdateline) VALUES('$plid', '$touid', '1', '$pmnum', '0', '0')", 'SILENT'); + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET members='$num' WHERE plid='$plid'"); + + return 1; + } + + function kickchatpm($plid, $uid, $touid) { + if(!$uid || !$touid || !$plid || $uid == $touid) { + return 0; + } + $threadpm = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if($threadpm['pmtype'] != 2) { + return PMCHATTYPE_ERROR; + } + if($threadpm['authorid'] != $uid) { + return PMPRIVILEGENONE_ERROR; + } + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid' AND uid='$touid'"); + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET members='$num' WHERE plid='$plid'"); + return 1; + } + + function quitchatpm($uid, $plids) { + if(!$uid || !$plids) { + return 0; + } + $list = array(); + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON m.plid=t.plid WHERE m.plid IN (".$this->base->implode($plids).") AND m.uid='$uid'"); + while($threadpm = $this->db->fetch_array($query)) { + if($threadpm['pmtype'] != 2) { + return PMCHATTYPE_ERROR; + } + if($threadpm['authorid'] == $uid) { + return PMPRIVILEGENONE_ERROR; + } + $list[] = $threadpm['plid']; + } + + if($list) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid IN (".$this->base->implode($list).") AND uid='$uid'"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_lists SET members=members-1 WHERE plid IN (".$this->base->implode($list).")"); + } + + return 1; + } + + function deletepmbypmid($uid, $pmid) { + if(!$uid || !$pmid) { + return 0; + } + $index = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_indexes i LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON i.plid=t.plid WHERE i.pmid='$pmid'"); + if($index['pmtype'] != 1) { + return PMUIDTYPE_ERROR; + } + $users = explode('_', $index['min_max']); + if(!in_array($uid, $users)) { + return PMPRIVILEGENONE_ERROR; + } + if($index['authorid'] != $uid) { + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." SET delstatus=2 WHERE pmid='$pmid' AND delstatus=0"); + $updatenum = $this->db->affected_rows(); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." WHERE pmid='$pmid' AND delstatus=1"); + $deletenum = $this->db->affected_rows(); + } else { + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." SET delstatus=1 WHERE pmid='$pmid' AND delstatus=0"); + $updatenum = $this->db->affected_rows(); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." WHERE pmid='$pmid' AND delstatus=2"); + $deletenum = $this->db->affected_rows(); + } + + if(!$this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$this->getposttablename($index['plid'])." WHERE plid='{$index['plid']}'")) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='{$index['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$index['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='{$index['plid']}'"); + } else { + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET pmnum=pmnum-".($updatenum + $deletenum)." WHERE plid='".$index['plid']."' AND uid='$uid'"); + } + return 1; + } + + function deletepmbypmids($uid, $pmids) { + if($pmids) { + foreach($pmids as $key => $pmid) { + $this->deletepmbypmid($uid, $pmid); + } + } + return 1; + } + + + function deletepmbyplid($uid, $plid, $isuser = 0) { + if(!$uid || !$plid) { + return 0; + } + + if($isuser) { + $relationship = $this->relationship($uid, $plid); + $sql = "SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max='$relationship'"; + } else { + $sql = "SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"; + } + + $query = $this->db->query($sql); + if($list = $this->db->fetch_array($query)) { + if($list['pmtype'] == 1) { + $user = explode('_', $list['min_max']); + if(!in_array($uid, $user)) { + return PMPRIVILEGENONE_ERROR; + } + } else { + if($uid != $list['authorid']) { + return PMPRIVILEGENONE_ERROR; + } + } + } else { + return PMTHREADNONE_ERROR; + } + + if($list['pmtype'] == 1) { + if($uid == $list['authorid']) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}' AND delstatus=2"); + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." SET delstatus=1 WHERE plid='{$list['plid']}' AND delstatus=0"); + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}' AND delstatus=1"); + $this->db->query("UPDATE ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." SET delstatus=2 WHERE plid='{$list['plid']}' AND delstatus=0"); + } + $count = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}'"); + if(!$count) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='{$list['plid']}'"); + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$list['plid']}' AND uid='$uid'"); + } + } else { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE.$this->getposttablename($list['plid'])." WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_members WHERE plid='{$list['plid']}'"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pm_indexes WHERE plid='{$list['plid']}'"); + } + return 1; + } + + function deletepmbyplids($uid, $plids, $isuser = 0) { + if($plids) { + foreach($plids as $key => $plid) { + $this->deletepmbyplid($uid, $plid, $isuser); + } + } + return 1; + } + + + function getprivatepmbyplid($uid, $plid, $starttime = 0, $endtime = 0, $start = 0, $ppp = 0) { + if(!$uid || !$plid) { + return 0; + } + if(!$this->isprivilege($plid, $uid)) { + return 0; + } + $thread = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + if($thread['pmtype'] != 1) { + return 0; + } + $pms = $addsql = array(); + $addsql[] = "p.plid='$plid'"; + if($thread['authorid'] == $uid) { + $addsql[] = 'p.delstatus IN (0,2)'; + } else { + $addsql[] = 'p.delstatus IN (0,1)'; + } + if($starttime) { + $addsql[]= "p.dateline>'$starttime'"; + } + if($endtime) { + $addsql[] = "p.dateline<'$endtime'"; + } + if($addsql) { + $addsql = implode(' AND ', $addsql); + } else { + $addsql = ''; + } + if($ppp) { + $limitsql = 'LIMIT '.intval($start).', '.intval($ppp); + } else { + $limitsql = ''; + } + $pms = $this->db->fetch_all("SELECT t.*, p.*, t.authorid as founderuid, t.dateline as founddateline FROM ".UC_DBTABLEPRE.$this->getposttablename($plid)." p LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON p.plid=t.plid WHERE $addsql ORDER BY p.dateline DESC $limitsql"); + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0 WHERE plid='$plid' AND uid='$uid' AND isnew=1"); + return array_reverse($pms); + } + + function getchatpmbyplid($uid, $plid, $starttime = 0, $endtime = 0, $start = 0, $ppp = 0) { + if(!$uid || !$plid) { + return 0; + } + if(!$this->isprivilege($plid, $uid)) { + return 0; + } + $pms = $addsql = array(); + $addsql[] = "p.plid='$plid'"; + if($starttime) { + $addsql[]= "p.dateline>'$starttime'"; + } + if($endtime) { + $addsql[] = "p.dateline<'$endtime'"; + } + if($addsql) { + $addsql = implode(' AND ', $addsql); + } else { + $addsql = ''; + } + if($ppp) { + $limitsql = 'LIMIT '.intval($start).', '.intval($ppp); + } else { + $limitsql = ''; + } + $query = $this->db->query("SELECT t.*, p.*, t.authorid as founderuid, t.dateline as founddateline FROM ".UC_DBTABLEPRE.$this->getposttablename($plid)." p LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON p.plid=t.plid WHERE $addsql ORDER BY p.dateline DESC $limitsql"); + while($pm = $this->db->fetch_array($query)) { + if($pm['pmtype'] != 2) { + return 0; + } + $pms[] = $pm; + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."pm_members SET isnew=0 WHERE plid='$plid' AND uid='$uid' AND isnew=1"); + return array_reverse($pms); + } + + function getpmlist($uid, $filter, $start, $ppp = 10) { + if(!$uid) { + return 0; + } + $members = $touidarr = $tousernamearr = array(); + + if($filter == 'newpm') { + $addsql = 'm.isnew=1 AND '; + } else { + $addsql = ''; + } + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON t.plid=m.plid WHERE $addsql m.uid='$uid' ORDER BY m.lastdateline DESC LIMIT $start, $ppp"); + while($member = $this->db->fetch_array($query)) { + if($member['pmtype'] == 1) { + $users = explode('_', $member['min_max']); + $member['touid'] = $users[0] == $uid ? $users[1] : $users[0]; + } else { + $member['touid'] = 0; + } + $touidarr[$member['touid']] = $member['touid']; + $members[] = $member; + } + + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); + + $array = array(); + if($members) { + $today = $this->base->time - $this->base->time % 86400; + $this->base->load('user'); + $tousernamearr = $_ENV['user']->id2name($touidarr); + foreach($members as $key => $data) { + + $daterange = 5; + $data['founddateline'] = $data['dateline']; + $data['dateline'] = $data['lastdateline']; + $data['pmid'] = $data['plid']; + $lastmessage = unserialize($data['lastmessage']); + if($lastmessage['firstauthorid']) { + $data['firstauthorid'] = $lastmessage['firstauthorid']; + $data['firstauthor'] = $lastmessage['firstauthor']; + $data['firstsummary'] = $lastmessage['firstsummary']; + } + if($lastmessage['lastauthorid']) { + $data['lastauthorid'] = $lastmessage['lastauthorid']; + $data['lastauthor'] = $lastmessage['lastauthor']; + $data['lastsummary'] = $lastmessage['lastsummary']; + } + $data['msgfromid'] = $lastmessage['lastauthorid']; + $data['msgfrom'] = $lastmessage['lastauthor']; + $data['message'] = $lastmessage['lastsummary']; + + $data['new'] = $data['isnew']; + + $data['msgtoid'] = $data['touid']; + if($data['lastdateline'] >= $today) { + $daterange = 1; + } elseif($data['lastdateline'] >= $today - 86400) { + $daterange = 2; + } elseif($data['lastdateline'] >= $today - 172800) { + $daterange = 3; + } elseif($data['lastdateline'] >= $today - 604800) { + $daterange = 4; + } + $data['daterange'] = $daterange; + + $data['tousername'] = $tousernamearr[$data['touid']]; + unset($data['min_max']); + $array[] = $data; + } + } + return $array; + } + + function getplidbypmid($pmid) { + if(!$pmid) { + return false; + } + return $this->db->result_first("SELECT plid FROM ".UC_DBTABLEPRE."pm_indexes WHERE pmid='$pmid'"); + } + + function getplidbytouid($uid, $touid) { + if(!$uid || !$touid) { + return 0; + } + return $this->db->result_first("SELECT plid FROM ".UC_DBTABLEPRE."pm_lists WHERE min_max='".$this->relationship($uid, $touid)."'"); + } + + function getuidbyplid($plid) { + if(!$plid) { + return array(); + } + $uidarr = array(); + $query = $this->db->query("SELECT uid FROM ".UC_DBTABLEPRE."pm_members WHERE plid='$plid'"); + while($uid = $this->db->fetch_array($query)) { + $uidarr[$uid['uid']] = $uid['uid']; + } + return $uidarr; + } + + function chatpmmemberlist($uid, $plid) { + if(!$uid || !$plid) { + return 0; + } + $uidarr = $this->getuidbyplid($plid); + if(empty($uidarr)) { + return 0; + } + if(!isset($uidarr[$uid])) { + return 0; + } + $authorid = $this->db->result_first("SELECT authorid FROM ".UC_DBTABLEPRE."pm_lists WHERE plid='$plid'"); + return array('author' => $authorid, 'member' => $uidarr); + } + + function relationship($fromuid, $touid) { + if($fromuid < $touid) { + return $fromuid.'_'.$touid; + } elseif($fromuid > $touid) { + return $touid.'_'.$fromuid; + } else { + return ''; + } + } + + function getposttablename($plid) { + $id = substr((string)$plid, -1, 1); + return 'pm_messages_'.intval($id); + } + + function get_blackls($uid, $uids = array()) { + if(!$uids) { + $blackls = $this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'"); + } else { + $blackls = array(); + $uids = is_array($uids) ? $uids : array($uids); + foreach($uids as $uid) { + $blackls[$uid] = array(); + } + $uids = $this->base->implode($uids); + $query = $this->db->query("SELECT uid, blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid IN ($uids)"); + while($data = $this->db->fetch_array($query)) { + $blackls[$data['uid']] = explode(',', $data['blacklist']); + } + } + return $blackls; + } + + function set_blackls($uid, $blackls) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."memberfields SET blacklist='$blackls' WHERE uid='$uid'"); + return $this->db->affected_rows(); + } + + function update_blackls($uid, $username, $action = 1) { + $username = !is_array($username) ? array($username) : $username; + if($action == 1) { + if(!in_array('{ALL}', $username)) { + $usernames = $this->base->implode($username); + $query = $this->db->query("SELECT username FROM ".UC_DBTABLEPRE."members WHERE username IN ($usernames)"); + $usernames = array(); + while($data = $this->db->fetch_array($query)) { + $usernames[addslashes($data['username'])] = addslashes($data['username']); + } + if(!$usernames) { + return 0; + } + $blackls = addslashes($this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'")); + if($blackls) { + $list = explode(',', $blackls); + foreach($list as $k => $v) { + if(in_array($v, $usernames)) { + unset($usernames[$v]); + } + } + } + if(!$usernames) { + return 1; + } + $listnew = implode(',', $usernames); + $blackls .= $blackls !== '' ? ','.$listnew : $listnew; + } else { + $blackls = addslashes($this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'")); + $blackls .= ',{ALL}'; + } + } else { + $blackls = addslashes($this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'")); + $list = $blackls = explode(',', $blackls); + foreach($list as $k => $v) { + if(in_array($v, $username)) { + unset($blackls[$k]); + } + } + $blackls = implode(',', $blackls); + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."memberfields SET blacklist='$blackls' WHERE uid='$uid'"); + return 1; + } + + function removecode($str, $length) { + static $uccode = null; + if($uccode === null) { + require_once UC_ROOT.'lib/uccode.class.php'; + $uccode = new uccode(); + } + $str = $uccode->complie($str); + return trim($this->base->cutstr(strip_tags($str), $length)); + } + + function ispminterval($uid, $interval = 0) { + if(!$uid) { + return 0; + } + $interval = intval($interval); + if(!$interval) { + return 1; + } + $lastupdate = $this->db->result_first("SELECT lastupdate FROM ".UC_DBTABLEPRE."pm_members WHERE uid='$uid' ORDER BY lastupdate DESC LIMIT 1"); + if(($this->base->time - $lastupdate) > $interval) { + return 1; + } else { + return 0; + } + } + + function isprivatepmthreadlimit($uid, $maxnum = 0) { + if(!$uid) { + return 0; + } + $maxnum = intval($maxnum); + if(!$maxnum) { + return 1; + } + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_members m LEFT JOIN ".UC_DBTABLEPRE."pm_lists t ON m.plid=t.plid WHERE uid='$uid' AND lastupdate>'".($this->base->time-86400)."' AND t.pmtype=1"); + if($maxnum - $num < 0) { + return 0; + } else { + return 1; + } + } + + function ischatpmthreadlimit($uid, $maxnum = 0) { + if(!$uid) { + return 0; + } + $maxnum = intval($maxnum); + if(!$maxnum) { + return 1; + } + $num = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pm_lists WHERE authorid='$uid' AND dateline>'".($this->base->time-86400)."'"); + if($maxnum - $num < 0) { + return 0; + } else { + return 1; + } + } +} +?> \ No newline at end of file diff --git a/uc_server/model/setting.php b/uc_server/model/setting.php new file mode 100644 index 0000000..f4fa605 --- /dev/null +++ b/uc_server/model/setting.php @@ -0,0 +1,46 @@ +settingmodel($base); + } + + function settingmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_settings($keys = '') { + if($keys) { + $keys = $this->base->implode($keys); + $sqladd = "k IN ($keys)"; + } else { + $sqladd = '1'; + } + $arr = array(); + $arr = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."settings WHERE $sqladd"); + if($arr) { + foreach($arr as $k => $v) { + $arr[$v['k']] = $v['v']; + unset($arr[$k]); + } + } + return $arr; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/tag.php b/uc_server/model/tag.php new file mode 100644 index 0000000..7c52a78 --- /dev/null +++ b/uc_server/model/tag.php @@ -0,0 +1,71 @@ +tagmodel($base); + } + + function tagmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_tag_by_name($tagname) { + $arr = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."tags WHERE tagname='$tagname'"); + return $arr; + } + + function get_template($appid) { + $result = $this->db->result_first("SELECT tagtemplates FROM ".UC_DBTABLEPRE."applications WHERE appid='$appid'"); + return $result; + } + + function updatedata($appid, $data) { + $appid = intval($appid); + include_once UC_ROOT.'lib/xml.class.php'; + $data = xml_unserialize($data); + $this->base->load('app'); + $data[0] = addslashes($data[0]); + $datanew = array(); + if(is_array($data[1])) { + foreach($data[1] as $r) { + $datanew[] = $_ENV['misc']->array2string($r); + } + } + $tmp = $_ENV['app']->get_apps('type', "appid='$appid'"); + $datanew = addslashes($tmp[0]['type']."\t".implode("\t", $datanew)); + if(!empty($data[0])) { + $return = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."tags WHERE tagname='$data[0]' AND appid='$appid'"); + if($return) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."tags SET data='$datanew', expiration='".$this->base->time."' WHERE tagname='$data[0]' AND appid='$appid'"); + } else { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."tags (tagname, appid, data, expiration) VALUES ('$data[0]', '$appid', '$datanew', '".$this->base->time."')"); + } + } + } + + function formatcache($appid, $tagname) { + $return = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."tags WHERE tagname='$tagname' AND appid='$appid'"); + if($return) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."tags SET expiration='0' WHERE tagname='$tagname' AND appid='$appid'"); + } else { + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."tags (tagname, appid, expiration) VALUES ('$tagname', '$appid', '0')"); + } + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/user.php b/uc_server/model/user.php new file mode 100644 index 0000000..594d2af --- /dev/null +++ b/uc_server/model/user.php @@ -0,0 +1,430 @@ +usermodel($base); + } + + function usermodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function get_user_by_uid($uid) { + $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE uid='$uid'"); + return $arr; + } + + function get_user_by_username($username) { + $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE username='$username'"); + return $arr; + } + + function get_user_by_email($email) { + $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE email='$email'"); + return $arr; + } + + function get_user_by_secmobile($secmobicc, $secmobile) { + return $this->db->fetch_first_stmt("SELECT * FROM ".UC_DBTABLEPRE."members WHERE secmobicc=? AND secmobile=?", array('d', 'd'), array($secmobicc, $secmobile)); + } + + function check_username($username) { + $charset = strtolower(UC_CHARSET); + if ($charset === 'utf-8') { + $guestexp = '\xE3\x80\x80|\xE6\xB8\xB8\xE5\xAE\xA2|\xE9\x81\x8A\xE5\xAE\xA2'; + } elseif ($charset === 'gbk') { + $guestexp = '\xA1\xA1|\xD3\xCE\xBF\xCD'; + } elseif ($charset === 'big5') { + $guestexp = '\xA1\x40|\xB9\x43\xAB\xC8'; + } else { + return FALSE; + } + $guestexp .= '|^Guest'; + + $len = $this->dstrlen($username); + if($len > 15 || $len < 3 || preg_match("/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&\(\)']|$guestexp/is", $username)) { + return FALSE; + } else { + return TRUE; + } + } + + function dstrlen($str) { + if(strtolower(UC_CHARSET) != 'utf-8') { + return strlen($str); + } + $count = 0; + for($i = 0; $i < strlen($str); $i++){ + $value = ord($str[$i]); + if($value > 127) { + $count++; + if($value >= 192 && $value <= 223) $i++; + elseif($value >= 224 && $value <= 239) $i = $i + 2; + elseif($value >= 240 && $value <= 247) $i = $i + 3; + } + $count++; + } + return $count; + } + + function check_mergeuser($username) { + $data = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."mergemembers WHERE appid='".$this->base->app['appid']."' AND username='$username'"); + return $data; + } + + function check_usernamecensor($username) { + $_CACHE['badwords'] = $this->base->cache('badwords'); + $censorusername = $this->base->get_setting('censorusername'); + $censorusername = $censorusername['censorusername']; + $censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censorusername = trim($censorusername)), '/')).')$/i'; + $usernamereplaced = isset($_CACHE['badwords']['findpattern']) && !empty($_CACHE['badwords']['findpattern']) ? @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $username) : $username; + if(($usernamereplaced != $username) || ($censorusername && preg_match($censorexp, $username))) { + return FALSE; + } else { + return TRUE; + } + } + + function check_usernameexists($username) { + $data = $this->db->result_first("SELECT username FROM ".UC_DBTABLEPRE."members WHERE username='$username'"); + return $data; + } + + function check_emailformat($email) { + return strlen($email) > 6 && strlen($email) <= 255 && preg_match("/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/", $email); + } + + function check_emailaccess($email) { + $setting = $this->base->get_setting(array('accessemail', 'censoremail')); + $accessemail = $setting['accessemail']; + $censoremail = $setting['censoremail']; + $accessexp = '/('.str_replace("\r\n", '|', preg_quote(trim($accessemail), '/')).')$/i'; + $censorexp = '/('.str_replace("\r\n", '|', preg_quote(trim($censoremail), '/')).')$/i'; + if($accessemail || $censoremail) { + if(($accessemail && !preg_match($accessexp, $email)) || ($censoremail && preg_match($censorexp, $email))) { + return FALSE; + } else { + return TRUE; + } + } else { + return TRUE; + } + } + + function check_emailexists($email, $username = '') { + $sqladd = $username !== '' ? "AND username<>'$username'" : ''; + $email = $this->db->result_first("SELECT email FROM ".UC_DBTABLEPRE."members WHERE email='$email' $sqladd"); + return $email; + } + + function check_secmobileexists($secmobicc, $secmobile, $username = '') { + $sqladd = $username !== '' ? "AND username<>'$username'" : ''; + $secmobicc == 0 && $secmobicc = ''; + $secmobile == 0 && $secmobile = ''; + $secmobile = $this->db->result_first("SELECT secmobile FROM ".UC_DBTABLEPRE."members WHERE secmobicc='$secmobicc' AND secmobile='$secmobile' $sqladd"); + return $secmobile; + } + + function check_login($username, $password, &$user) { + $user = $this->get_user_by_username($username); + if(empty($user['username'])) { + return -1; + } elseif(!$this->verify_password($password, $user['password'], $user['salt'])) { + return -2; + } + $this->upgrade_password($username, $password, $user['password'], $user['salt']); + return $user['uid']; + } + + function add_user($username, $password, $email, $uid = 0, $questionid = '', $answer = '', $regip = '', $secmobicc = '', $secmobile = '') { + $regip = empty($regip) ? $this->base->onlineip : $regip; + $salt = ''; + $password = $this->generate_password($password); + $sqladd = $uid ? "uid='".intval($uid)."'," : ''; + $sqladd .= $questionid > 0 ? " secques='".$this->quescrypt($questionid, $answer)."'," : " secques='',"; + $sqladd .= $secmobicc ? "secmobicc='".$secmobicc."'," : ''; + $sqladd .= $secmobile ? "secmobile='".$secmobile."'," : ''; + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."members SET $sqladd username='$username', password='$password', email='$email', regip='$regip', regdate='".$this->base->time."', salt='$salt'"); + $uid = $this->db->insert_id(); + $this->db->query("INSERT INTO ".UC_DBTABLEPRE."memberfields SET uid='$uid'"); + return $uid; + } + + function edit_user($username, $oldpw, $newpw, $email, $ignoreoldpw = 0, $questionid = '', $answer = '', $secmobicc = '', $secmobile = '') { + $data = $this->db->fetch_first("SELECT username, uid, password, salt FROM ".UC_DBTABLEPRE."members WHERE username='$username'"); + + if($ignoreoldpw) { + $isprotected = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid = '{$data['uid']}'"); + if($isprotected) { + return -8; + } + } + + if(!$ignoreoldpw && !$this->verify_password($oldpw, $data['password'], $data['salt'])) { + return -1; + } + + $sqladd = $newpw ? "password='".$this->generate_password($newpw)."', salt=''" : ''; + $sqladd .= $email ? ($sqladd ? ',' : '')." email='$email'" : ''; + $sqladd .= $secmobicc !== '' ? ($sqladd ? ',' : '').(!empty($secmobicc) ? " secmobicc='$secmobicc'" : " secmobicc=''") : ''; + $sqladd .= $secmobile !== '' ? ($sqladd ? ',' : '').(!empty($secmobile) ? " secmobile='$secmobile'" : " secmobile=''") : ''; + if($questionid !== '') { + if($questionid > 0) { + $sqladd .= ($sqladd ? ',' : '')." secques='".$this->quescrypt($questionid, $answer)."'"; + } else { + $sqladd .= ($sqladd ? ',' : '')." secques=''"; + } + } + if($sqladd || $emailadd) { + $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd WHERE username='$username'"); + return $this->db->affected_rows(); + } else { + return -7; + } + } + + function delete_user($uidsarr) { + $uidsarr = (array)$uidsarr; + if(!$uidsarr) { + return 0; + } + $uids = $this->base->implode($uidsarr); + $arr = $this->db->fetch_all("SELECT uid FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid IN ($uids)"); + $puids = array(); + foreach((array)$arr as $member) { + $puids[] = $member['uid']; + } + $uids = $this->base->implode(array_diff($uidsarr, $puids)); + if($uids) { + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."members WHERE uid IN($uids)"); + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."memberfields WHERE uid IN($uids)"); + $this->delete_useravatar($uidsarr); + $this->base->load('note'); + $_ENV['note']->add('deleteuser', "ids=$uids"); + return $this->db->affected_rows(); + } else { + return 0; + } + } + + function delete_useravatar($uidsarr) { + if(!defined('UC_DELAVTDIR')) { + define('UC_DELAVTDIR', UC_DATADIR.'./avatar/'); + } + $uidsarr = (array)$uidsarr; + foreach((array)$uidsarr as $uid) { + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'big', 'real')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'middle', 'real')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'small', 'real')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'big')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'middle')) && unlink($avatar_file); + file_exists($avatar_file = UC_DELAVTDIR.$this->base->get_avatar($uid, 'small')) && unlink($avatar_file); + } + } + + function chgusername($uid, $newusername) { + return $this->db->query_stmt("UPDATE ".UC_DBTABLEPRE."members SET username=? WHERE uid=?", array('s', 'i'), array($newusername, $uid)); + } + + function get_total_num($sqladd = '') { + $data = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."members $sqladd"); + return $data; + } + + function get_list($page, $ppp, $totalnum, $sqladd) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."members $sqladd LIMIT $start, $ppp"); + return $data; + } + + function name2id($usernamesarr) { + $usernamesarr = daddslashes($usernamesarr, 1, TRUE); + $usernames = $this->base->implode($usernamesarr); + $query = $this->db->query("SELECT uid FROM ".UC_DBTABLEPRE."members WHERE username IN($usernames)"); + $arr = array(); + while($user = $this->db->fetch_array($query)) { + $arr[] = $user['uid']; + } + return $arr; + } + + function id2name($uidarr) { + $arr = array(); + $query = $this->db->query("SELECT uid, username FROM ".UC_DBTABLEPRE."members WHERE uid IN (".$this->base->implode($uidarr).")"); + while($user = $this->db->fetch_array($query)) { + $arr[$user['uid']] = $user['username']; + } + return $arr; + } + + function quescrypt($questionid, $answer) { + return $questionid > 0 && $answer != '' ? substr(md5($answer.md5($questionid)), 16, 8) : ''; + } + + function can_do_login($username, $ip = '') { + + $check_times = $this->base->settings['login_failedtime'] > 0 ? $this->base->settings['login_failedtime'] : ($this->base->settings['login_failedtime'] < 0 ? 0 : 5); + + if($check_times == 0) { + return -1; + } + + $username = substr(md5($username), 8, 15); + $expire = 15 * 60; + if(!$ip) { + $ip = $this->base->onlineip; + } + + $ip_check = $user_check = array(); + $query = $this->db->query("SELECT * FROM ".UC_DBTABLEPRE."failedlogins WHERE ip='".$ip."' OR ip='$username'"); + while($row = $this->db->fetch_array($query)) { + if($row['ip'] === $username) { + $user_check = $row; + } elseif($row['ip'] === $ip) { + $ip_check = $row; + } + } + + if(empty($ip_check) || ($this->base->time - $ip_check['lastupdate'] > $expire)) { + $ip_check = array(); + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."failedlogins (ip, count, lastupdate) VALUES ('{$ip}', '0', '{$this->base->time}')"); + } + + if(empty($user_check) || ($this->base->time - $user_check['lastupdate'] > $expire)) { + $user_check = array(); + $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."failedlogins (ip, count, lastupdate) VALUES ('{$username}', '0', '{$this->base->time}')"); + } + + if ($ip_check || $user_check) { + $time_left = min(($check_times - (isset($ip_check['count']) ? $ip_check['count'] : 0)), ($check_times - (isset($user_check['count']) ? $user_check['count'] : 0))); + return $time_left; + + } + + $this->db->query("DELETE FROM ".UC_DBTABLEPRE."failedlogins WHERE lastupdate<".($this->base->time - ($expire + 1)), 'UNBUFFERED'); + + return $check_times; + } + + function loginfailed($username, $ip = '') { + $username = substr(md5($username), 8, 15); + if(!$ip) { + $ip = $this->base->onlineip; + } + $this->db->query("UPDATE ".UC_DBTABLEPRE."failedlogins SET count=count+1, lastupdate='".$this->base->time."' WHERE ip='".$ip."' OR ip='$username'"); + } + + function user_log($uid, $action, $extra = '') { + $uid = intval($uid); + $action = addslashes($action); + $extra = addslashes($extra); + $this->db->query_stmt("INSERT INTO ".UC_DBTABLEPRE."memberlogs SET uid=?, action=?, extra=?", array('i', 's', 's'), array($uid, $action, $extra)); + } + + function user_log_total_num() { + return $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."memberlogs"); + } + + function user_log_list($page, $ppp, $totalnum) { + $start = $this->base->page_get_start($page, $ppp, $totalnum); + return $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."memberlogs LIMIT $start, $ppp"); + } + + function get_passwordalgo() { + $algo = $this->base->settings['passwordalgo']; + if(empty($algo)) { + return constant('PASSWORD_BCRYPT'); + } else { + return constant($algo) === null ? constant('PASSWORD_BCRYPT') : constant($algo); + } + } + + function get_passwordoptions() { + $options = $this->base->settings['passwordoptions']; + if(empty($options)) { + return array(); + } else { + $result = json_decode($options, true); + return is_array($result) ? $result : array(); + } + } + + function generate_password($password) { + $algo = $this->get_passwordalgo(); + $options = $this->get_passwordoptions(); + $hash = password_hash($password, $algo, $options); + return ($hash === false || $hash === null || !password_verify($password, $hash)) ? password_hash($password, PASSWORD_BCRYPT) : $hash; + } + + function verify_password($password, $hash, $salt = '') { + if(empty($salt)) { + return password_verify($password, $hash); + } else if(strlen($salt) == 6) { + return hash_equals($hash, md5(md5($password).$salt)); + } else if(strlen($salt) > 6 && strlen($salt) < 20 && file_exists(UC_ROOT . "lib/uc_password_$salt.class.php")) { + $classname = "uc_password_$salt"; + include(UC_ROOT . "lib/uc_password_$salt.class.php"); + return $classname::verify_password($password, $hash); + } + return false; + } + + function upgrade_password($username, $password, $hash, $salt = '') { + $algo = $this->get_passwordalgo(); + $options = $this->get_passwordoptions(); + if (!empty($salt) || password_needs_rehash($hash, $algo, $options)) { + $password_new = $this->generate_password($password); + $sqladd = "password = '$password_new', salt = ''"; + return $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd WHERE username='$username'"); + } + return true; + } + + function reset_founderpw($newpw, $reconfkey = 1) { + $configfile = UC_ROOT.'./data/config.inc.php'; + if(!is_writable($configfile)) { + return -4; + } else { + $config = file_get_contents($configfile); + $salt = ''; + $hashnewpw = str_replace('$', '#', $this->generate_password($newpw)); + $config = preg_replace("/define\('UC_FOUNDERSALT',\s*'.*?'\);/i", "define('UC_FOUNDERSALT', '$salt');", $config); + $config = preg_replace("/define\('UC_FOUNDERPW',\s*'.*?'\);/i", "define('UC_FOUNDERPW', '$hashnewpw');", $config); + if($reconfkey) { + $uckey = $this->base->generate_key(64); + $config = preg_replace("/define\('UC_KEY',\s*'.*?'\);/i", "define('UC_KEY', '$uckey');", $config); + } + $config = str_replace('#', '$', $config); + if(file_put_contents($configfile, $config) === false) { + return -4; + } + return 2; + } + } + + function upgrade_founderpw($password, $hash, $salt = '') { + $algo = $this->get_passwordalgo(); + $options = $this->get_passwordoptions(); + if (!empty($salt) || password_needs_rehash($hash, $algo, $options)) { + $password_new = $this->generate_password($password); + return $this->reset_founderpw($password); + } + return true; + } + +} \ No newline at end of file diff --git a/uc_server/model/var.php b/uc_server/model/var.php new file mode 100644 index 0000000..226eba9 --- /dev/null +++ b/uc_server/model/var.php @@ -0,0 +1,45 @@ +sid =& self::$instance->sid; + $class->time =& self::$instance->time; + $class->onlineip =& self::$instance->onlineip; + $class->db =& self::$instance->db; + $class->settings =& self::$instance->settings; + $class->cache =& self::$instance->cache; + $class->_CACHE =& self::$instance->_CACHE; + $class->app =& self::$instance->app; + $class->user =& self::$instance->user; + $class->lang =& self::$instance->lang; + $class->input =& self::$instance->input; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/model/version.php b/uc_server/model/version.php new file mode 100644 index 0000000..e3d6a8a --- /dev/null +++ b/uc_server/model/version.php @@ -0,0 +1,33 @@ +versionmodel($base); + } + + function versionmodel(&$base) { + $this->base = $base; + $this->db = $base->db; + } + + function check() { + $data = $this->db->result_first("SELECT v FROM ".UC_DBTABLEPRE."settings WHERE k='version'"); + return $data; + } + +} + +?> \ No newline at end of file diff --git a/uc_server/plugin/filecheck/index.htm b/uc_server/plugin/filecheck/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/plugin/filecheck/plugin.php b/uc_server/plugin/filecheck/plugin.php new file mode 100644 index 0000000..c3ec9bb --- /dev/null +++ b/uc_server/plugin/filecheck/plugin.php @@ -0,0 +1,127 @@ +pluginbase(); + } + + function onindex() { + + if(!$ucfiles = @file(UC_ROOT.'./control/admin/ucfiles.md5')) { + $this->message('file_check_failed'); + } + + $this->load('app'); + $applist = $_ENV['app']->get_apps(); + $this->view->assign('applist', $applist); + + $this->checkfiles('./', '', 0); + $this->checkfiles('data/', '\.htm'); + $this->checkfiles('api/', '\.php|\.htm'); + $this->checkfiles('control/', '\.php|\.htm|\.md5', 1, 'ucfiles.md5'); + $this->checkfiles('model/', '\.php|\.htm'); + $this->checkfiles('lib/', '\.php|\.htm'); + $this->checkfiles('plugin/', '\.php|\.htm|\.xml'); + $this->checkfiles('images/', '\..+?'); + $this->checkfiles('js/', '\.js|\.htm'); + $this->checkfiles('release/', '\.php'); + $this->checkfiles('view/', '\.php|\.htm'); + + foreach($ucfiles as $line) { + $file = trim(substr($line, 34)); + $md5datanew[$file] = substr($line, 0, 32); + if(isset($this->md5data[$file])) { + if($md5datanew[$file] != $this->md5data[$file]) { + $modifylist[$file] = $this->md5data[$file]; + } + $md5datanew[$file] = $this->md5data[$file]; + } + } + + $weekbefore = time() - 604800; + $md5datanew = is_array($md5datanew) ? $md5datanew : array(); + $addlist = array_diff_assoc($this->md5data, $md5datanew); + $dellist = array_diff_assoc($md5datanew, $this->md5data); + $modifylist = array_diff_assoc($modifylist, $dellist); + $showlist = array_merge($this->md5data, $md5datanew); + $doubt = 0; + $dirlist = array('modify' => array(), 'del' => array(), 'add' => array(), 'doubt' => array()); + foreach($showlist as $file => $md5) { + $dir = dirname($file); + if(is_array($modifylist) && array_key_exists($file, $modifylist)) { + $fileststus = 'modify'; + } elseif(is_array($dellist) && array_key_exists($file, $dellist)) { + $fileststus = 'del'; + } elseif(is_array($addlist) && array_key_exists($file, $addlist)) { + $fileststus = 'add'; + } else { + $filemtime = @filemtime($file); + if($filemtime > $weekbefore) { + $fileststus = 'doubt'; + $doubt++; + } else { + $fileststus = ''; + } + } + if(file_exists($file)) { + $filemtime = @filemtime($file); + $fileststus && $dirlist[$fileststus][$dir][basename($file)] = array(number_format(filesize($file)).' Bytes', $this->date($filemtime)); + } else { + $fileststus && $dirlist[$fileststus][$dir][basename($file)] = array('', ''); + } + } + + $result = $resultjs = ''; + $dirnum = 0; + foreach($dirlist as $status => $filelist) { + $dirnum++; + $result .= '
                                      '; + foreach($filelist as $dir => $files) { + $result .= '

                                      '.$dir.'
                                      '; + foreach($files as $filename => $file) { + $result .= '
                                      '.$filename.'
                                      '.$file[0].'
                                      '.$file[1].'
                                      '; + } + } + $result .= '

                                      '; + $resultjs .= '$(\'status_'.$status.'\').style.display=\'none\';'; + } + $modifiedfiles = count($modifylist); + $deletedfiles = count($dellist); + $unknownfiles = count($addlist); + + $result .= ''; + $this->view->assign('result', $result); + $this->view->assign('modifiedfiles', $modifiedfiles); + $this->view->assign('deletedfiles', $deletedfiles); + $this->view->assign('unknownfiles', $unknownfiles); + $this->view->assign('doubt', $doubt); + $this->view->display('plugin_filecheck'); + } + + function checkfiles($currentdir, $ext = '', $sub = 1, $skip = '') { + $dir = @opendir(UC_ROOT.$currentdir); + $exts = '/('.$ext.')$/i'; + $skips = explode(',', $skip); + + while($entry = @readdir($dir)) { + $file = $currentdir.$entry; + if($entry != '.' && $entry != '..' && (($ext && preg_match($exts, $entry) || !$ext) || $sub && is_dir($file)) && !in_array($entry, $skips)) { + if($sub && is_dir($file)) { + $this->checkfiles($file.'/', $ext, $sub, $skip); + } else { + if(is_dir($file)) { + $this->md5data[$file] = md5($file); + } else { + $this->md5data[$file] = md5_file($file); + } + } + } + } + } +} \ No newline at end of file diff --git a/uc_server/plugin/filecheck/plugin.xml b/uc_server/plugin/filecheck/plugin.xml new file mode 100644 index 0000000..de70cc4 --- /dev/null +++ b/uc_server/plugin/filecheck/plugin.xml @@ -0,0 +1,17 @@ + + + 文件权限检查 + 1.0.1 + Monkey + 2008-6-16 + 2021-5-20 + Comsenz 所有 + 2 + 检查 UCenter 文件是否被修改。 + + 被修改文件 + 丢失文件 + 未知文件 + 一周内更新 + + \ No newline at end of file diff --git a/uc_server/plugin/filecheck/plugin_filecheck.htm b/uc_server/plugin/filecheck/plugin_filecheck.htm new file mode 100644 index 0000000..8fe9551 --- /dev/null +++ b/uc_server/plugin/filecheck/plugin_filecheck.htm @@ -0,0 +1,9 @@ +{template plugin_header} +{lang plugin_filecheck_modifed}: $modifiedfiles   +{lang plugin_filecheck_deleted}: $deletedfiles   +{lang plugin_filecheck_unknow}: $unknownfiles   +{lang plugin_filecheck_modifed_in_aweek}: $doubt   + +$result + +{template plugin_footer} \ No newline at end of file diff --git a/uc_server/plugin/index.htm b/uc_server/plugin/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/plugin/replacemykey/index.htm b/uc_server/plugin/replacemykey/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/plugin/replacemykey/plugin.php b/uc_server/plugin/replacemykey/plugin.php new file mode 100644 index 0000000..4fc5278 --- /dev/null +++ b/uc_server/plugin/replacemykey/plugin.php @@ -0,0 +1,54 @@ +pluginbase(); + } + + function onindex() { + + if($this->submitcheck()) { + if(!getgpc('reconfkey', 'P')) { + $this->message('replacemykey_no_confirm', 'BACK'); + } + if($this->_replacemykey()) { + $this->message('replacemykey_succeed', 'BACK'); + } else { + $this->message('replacemykey_false', 'BACK'); + } + } + + $this->view->display('plugin_replacemykey'); + } + + function _replacemykey() { + $oldmykey = UC_MYKEY; + $newmykey = $this->generate_key(); + $configfile = UC_ROOT.'./data/config.inc.php'; + if(!is_writable($configfile)) { + return false; + } + $config = file_get_contents($configfile); + $config = preg_replace("/define\('UC_MYKEY',\s*'.*?'\);/i", "define('UC_MYKEY', '$newmykey');", $config); + if(file_put_contents($configfile, $config) === false) { + return false; + } + $apps = $this->db->fetch_all("SELECT appid, authkey FROM ".UC_DBTABLEPRE."applications", 'appid'); + foreach($apps as $k => $v) { + if($tmp = $this->authcode($v['authkey'], 'DECODE', $oldmykey)) { + $appid = $v['appid']; + $appkey = $this->authcode($tmp, 'ENCODE', $newmykey); + $this->db->query("UPDATE ".UC_DBTABLEPRE."applications SET authkey='$appkey' WHERE appid='$appid'"); + if($this->db->errno()) { + return false; + } + } + } + return true; + } + +} \ No newline at end of file diff --git a/uc_server/plugin/replacemykey/plugin.xml b/uc_server/plugin/replacemykey/plugin.xml new file mode 100644 index 0000000..592ba33 --- /dev/null +++ b/uc_server/plugin/replacemykey/plugin.xml @@ -0,0 +1,16 @@ + + + 密钥更新 + 1.0.0 + Discuz! X Community Team + 2022-1-30 + 2022-1-30 + Discuz! X Community Team + 2 + 当站点沦陷时您应该考虑进行密钥更新,以避免黑客通过已知的 UC_MYKEY 密钥破解 UC_KEY 密钥。 + + 在操作之前建议您选择低峰期操作或关闭下级应用,并做好 UCenter 以及各应用的数据、文件备份工作。 + 确认 + 我已了解上述风险,并已经做好网站备份工作。 + + \ No newline at end of file diff --git a/uc_server/plugin/replacemykey/plugin_replacemykey.htm b/uc_server/plugin/replacemykey/plugin_replacemykey.htm new file mode 100644 index 0000000..dbf74ee --- /dev/null +++ b/uc_server/plugin/replacemykey/plugin_replacemykey.htm @@ -0,0 +1,18 @@ +{template plugin_header} +

                                      {lang plugin_replacemykey_tips}

                                      +
                                      + + + + + + + + + + +
                                      {lang plugin_replacemykey_confirm}:
                                      + +
                                      +
                                      +{template plugin_footer} \ No newline at end of file diff --git a/uc_server/release/index.htm b/uc_server/release/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/uc_server/release/release.php b/uc_server/release/release.php new file mode 100644 index 0000000..d9e2a58 --- /dev/null +++ b/uc_server/release/release.php @@ -0,0 +1,6 @@ + '搜索用户', + 'user_name' => '用户名', + 'user_regdate' => '注册日期', + 'user_regip' => '注册IP', + 'user_before' => '之前', + 'user_after' => '之后', + 'user_search' => '搜 索', + 'user_add' => '添加用户', + 'user_password' => '密码', + 'user_addsubmit' => '添 加', + 'delete' => '删除', + 'email' => 'Email', + 'user_list' => '用户列表', +); \ No newline at end of file diff --git a/uc_server/view/default/admin_admin.htm b/uc_server/view/default/admin_admin.htm new file mode 100644 index 0000000..81f7d4f --- /dev/null +++ b/uc_server/view/default/admin_admin.htm @@ -0,0 +1,229 @@ +{template header} + + + + + + + +
                                      + +
                                      +

                                      + {if $status == 1} {lang admin_add_succeed} + {elseif $status == -1} {lang admin_add_succeed} + {elseif $status == -2} {lang admin_failed} + {elseif $status == -3}{lang admin_user_nonexistance} + {elseif $status == -4} {lang admin_config_unwritable} + {elseif $status == -5} {lang admin_founder_pw_incorrect} + {elseif $status == -6} {lang admin_pw_incorrect} + {elseif $status == 2} {lang admin_founder_pw_modified} + {/if} +

                                      +
                                      + +
                                      + +
                                      +
                                      + + + + + + + + + + + + + + +
                                      {lang user_name}:
                                      {lang admin_privilege}: +
                                        +
                                      • {lang admin_allow_setting}
                                      • +
                                      • {lang admin_allow_app}
                                      • +
                                      • {lang admin_allow_user}
                                      • +
                                      • {lang admin_allow_badwords}
                                      • +
                                      • {lang admin_allow_tag}
                                      • +
                                      • {lang admin_allow_pm}
                                      • +
                                      • {lang admin_allow_credits}
                                      • +
                                      • {lang admin_allow_hosts}
                                      • +
                                      • {lang admin_allow_database}
                                      • +
                                      • {lang admin_allow_note}
                                      • +
                                      • {lang admin_allow_cache}
                                      • +
                                      • {lang admin_allow_log}
                                      • +
                                      +
                                      + +
                                      +
                                      +
                                      + + + +
                                      +

                                      {lang admin_list}

                                      +
                                      + +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang user_name}{lang email}{lang user_regdate}{lang user_regip}{lang profile}{lang privilege}
                                      $user[username]$user[email]$user[regdate]$user[regip]{lang profile}{lang privilege}
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + + + + + + + +
                                      +

                                      {lang admin_edit_priv}{lang admin_return_admin_ls}

                                      + +

                                      {lang admin_priv_modified_successfully}

                                      + +

                                      {lang admin_priv_modified_failed}

                                      + +
                                      {lang admin_modification_notice}
                                      + +
                                      +
                                      + + + + + + + + +
                                      {lang admin_admin} $admin[username]:
                                      +
                                        +
                                      • {lang admin_allow_setting}
                                      • +
                                      • {lang admin_allow_app}
                                      • +
                                      • {lang admin_allow_user}
                                      • +
                                      • {lang admin_allow_badwords}
                                      • +
                                      • {lang admin_allow_tag}
                                      • +
                                      • {lang admin_allow_pm}
                                      • +
                                      • {lang admin_allow_credits}
                                      • +
                                      • {lang admin_allow_hosts}
                                      • +
                                      • {lang admin_allow_database}
                                      • +
                                      • {lang admin_allow_note}
                                      • +
                                      • {lang admin_allow_cache}
                                      • +
                                      • {lang admin_allow_log}
                                      • +
                                      +
                                      +
                                      +
                                      +
                                      +
                                      + + + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_app.htm b/uc_server/view/default/admin_app.htm new file mode 100644 index 0000000..38ebf56 --- /dev/null +++ b/uc_server/view/default/admin_app.htm @@ -0,0 +1,519 @@ +{template header} + + + +
                                      + +

                                      {lang app_list}{lang app_add}

                                      + +
                                      +

                                      {lang app_list_tips}

                                      +
                                      + +

                                      {lang app_list_updated}

                                      + +
                                      + +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang app_id}{lang app_name}{lang app_url}{lang app_linkstatus}{lang app_detail}
                                      $app[appid]$app[name]$app[url]
                                      {lang app_edit}
                                      +
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      + +

                                      {lang app_add}{lang app_list_return}

                                      +

                                      {lang app_not_add_tips}

                                      +
                                      + + + + + + + +
                                      {lang app_install_type}:
                                      + {lang app_install_by_custom} + {lang app_install_by_url} +
                                      + +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang app_type}:
                                      + +
                                      {lang app_name}:
                                      {lang app_name_comment}
                                      {lang app_url}:
                                      {lang app_url_comment}
                                      {lang app_ip}:
                                      {lang app_ip_comment}
                                      {lang app_key}:
                                      {lang app_key_comment} {lang app_key_generate}
                                      {lang app_path}:
                                      + + {lang app_path_comment}
                                      {lang app_viewpro_url}:
                                      + + {lang app_viewpro_url_comment}
                                      {lang app_api_filename}:
                                      + + {lang app_api_filename_comment}
                                      {lang app_tagtemplates}:
                                      {lang app_tagtemplates_comment}
                                      {lang app_tagfields}:
                                      {lang app_tagfields_comment}
                                      {lang app_login}:
                                      + + + {lang app_login_comment}
                                      {lang app_recvnote}:
                                      + + +
                                      +
                                      +
                                      +
                                      +
                                      + +

                                      {lang app_setting}{lang app_list_return}

                                      + +

                                      {lang update_succeed}

                                      + +

                                      {lang app_add_succeed}

                                      + +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang app_id}: $appid
                                      {lang app_type}:
                                      + +
                                      {lang app_name}:
                                      {lang app_name_comment}
                                      {lang app_url}:
                                      {lang app_url_comment}
                                      {lang app_extra_url}:
                                      {lang app_extra_url_comment}
                                      {lang app_ip}:
                                      {lang app_ip_comment}
                                      {lang app_key}:
                                      {lang app_key_comment} {lang app_key_generate}
                                      {lang app_path}:
                                      + + {lang app_path_comment}
                                      {lang app_viewpro_url}:
                                      + + {lang app_viewpro_url_comment}
                                      {lang app_api_filename}:
                                      + + {lang app_api_filename_comment}
                                      {lang app_tagtemplates}:
                                      {lang app_tagtemplates_comment}
                                      {lang app_tagfields}:
                                      {lang app_tagfields_comment}
                                      {lang app_login}:
                                      + + + {lang app_login_comment}
                                      {lang app_recvnote}:
                                      + + +
                                      {lang app_recvnotediy}:
                                      + + +
                                      {lang app_disablenote_deleteuser}:
                                      + + +
                                      {lang app_disablenote_renameuser}:
                                      + + +
                                      {lang app_disablenote_gettag}:
                                      + + +
                                      {lang app_disablenote_updatepw}:
                                      + + +
                                      {lang app_disablenote_updatebadwords}:
                                      + + +
                                      {lang app_disablenote_updatehosts}:
                                      + + +
                                      {lang app_disablenote_updateapps}:
                                      + + +
                                      {lang app_disablenote_updateclient}:
                                      + + +
                                      {lang app_disablenote_updatecredit}:
                                      + + +
                                      {lang app_disablenote_getcredit}:
                                      + + +
                                      {lang app_disablenote_getcreditsettings}:
                                      + + +
                                      {lang app_disablenote_updatecreditsettings}:
                                      + + +
                                      {lang app_disablenote_addfeed}:
                                      + + +
                                      +
                                      + + + + + + + + + +
                                      {lang app_code}:
                                      + + {lang app_code_comment}
                                      + +
                                      +
                                      + +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_badword.htm b/uc_server/view/default/admin_badword.htm new file mode 100644 index 0000000..f37ab56 --- /dev/null +++ b/uc_server/view/default/admin_badword.htm @@ -0,0 +1,90 @@ +{template header} + + + +
                                      + +

                                      {if $status == 2}{lang badword_list_updated}{elseif $status == 1}{lang badword_add_succeed}{/if}

                                      + +
                                      + + +
                                      +
                                      + + + + + + + + + +
                                      {lang badword_keyword}:{lang badword_replace}:
                                      +
                                      +
                                      +
                                      +
                                      +

                                      {lang badword_list}

                                      +
                                      + +
                                      + + + + + + + + + + + + + + + + + + + + + +
                                      {lang badword_keyword}{lang badword_replace}{lang badword_admin}
                                      >$badword[admin]
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_cache.htm b/uc_server/view/default/admin_cache.htm new file mode 100644 index 0000000..d1d445a --- /dev/null +++ b/uc_server/view/default/admin_cache.htm @@ -0,0 +1,30 @@ +{template header} + + + +
                                      +

                                      {lang cache_update}

                                      + +

                                      {lang update_succeed}

                                      + +
                                      +
                                      + + + + + + + + + + + + + +
                                      {lang cache_update_data}
                                      {lang cache_update_tpl}
                                      +
                                      +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_credit.htm b/uc_server/view/default/admin_credit.htm new file mode 100644 index 0000000..e36fab0 --- /dev/null +++ b/uc_server/view/default/admin_credit.htm @@ -0,0 +1,105 @@ +{template header} + + +
                                      + +
                                      +

                                      {lang creditexchange_tips}

                                      +
                                      + + +

                                      {if $status == 1}{lang creditexchange_updated}{elseif $status == -1}{lang creditexchange_invalid}{/if}

                                      + +
                                      + +
                                      +
                                      + + + + + + + + + + + + + + +
                                      {lang creditexchange_fromto}: + +  >  + +
                                      {lang creditexchange_ratio}: + +  :  + +
                                      +   + +
                                      +
                                      + +
                                      +
                                      +
                                      +
                                      +
                                      +

                                      {lang creditexchange}

                                      +
                                      + +
                                      + + + + + + + + + + + + + + + + + + + +
                                      {lang creditexchange_fromto}{lang creditexchange_ratio}
                                      $exchange[appsrc] $exchange[creditsrc] > $exchange[appdesc] $exchange[creditdesc]$exchange[ratiosrc] : $exchange[ratiodesc]
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_db.htm b/uc_server/view/default/admin_db.htm new file mode 100644 index 0000000..277666a --- /dev/null +++ b/uc_server/view/default/admin_db.htm @@ -0,0 +1,184 @@ +{template header} + + + +
                                      + +

                                      + {lang db_export} + {lang db_list} +

                                      +
                                      +

                                      {lang db_list_tips}

                                      +
                                      +
                                      +

                                      {lang db_security_tips}

                                      +
                                      +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang db_backup_dir}{lang db_backup_date}{lang db_operation}  
                                      $bak[name]$bak[date]{lang db_detail}
                                      +
                                      +
                                      + +

                                      + {lang db_export} + {lang db_list} +

                                      +
                                      +

                                      {lang db_import_tips}

                                      +
                                      +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang app_id}{lang app_name}{lang app_url}  
                                      UCenter{lang dumpfile_exists}
                                      $app[appid]$app[name]$app[url]
                                      +
                                      +
                                      + +

                                      + {lang db_export} + {lang db_list} +

                                      +
                                      +

                                      {lang db_security_tips}

                                      +
                                      +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang app_id}{lang app_name}{lang app_url}  
                                      UCenter
                                      $app[appid]$app[name]$app[url]
                                      +
                                      +
                                      + +
                                      + + + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_domain.htm b/uc_server/view/default/admin_domain.htm new file mode 100644 index 0000000..adcda0b --- /dev/null +++ b/uc_server/view/default/admin_domain.htm @@ -0,0 +1,59 @@ +{template header} + + +
                                      + +

                                      {if $status == 2}{lang domain_list_updated}{elseif $status == 1}{lang domain_add_succeed}{/if}

                                      + +
                                      + +
                                      +
                                      + + + + + + + + + +
                                      {lang domain}:{lang ip}:
                                      +
                                      +
                                      +
                                      +

                                      {lang domain_list}

                                      +
                                      + +
                                      + + + + + + + + + + + + + + + + + + +
                                      {lang domain}{lang ip}
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_feed.htm b/uc_server/view/default/admin_feed.htm new file mode 100644 index 0000000..5fbb00c --- /dev/null +++ b/uc_server/view/default/admin_feed.htm @@ -0,0 +1,40 @@ +{template header} + + +
                                      +

                                      + {lang feed_list} + {lang note_list} + {lang menu_log} + {lang mail_queue} +

                                      +
                                      + +
                                      + + + + + + + + + + + + + + + + +
                                      {lang dateline} 
                                      $feed[dateline]$feed[title_template]
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_frame_header.htm b/uc_server/view/default/admin_frame_header.htm new file mode 100644 index 0000000..e0bd431 --- /dev/null +++ b/uc_server/view/default/admin_frame_header.htm @@ -0,0 +1,45 @@ + + + + +UCenter Administrator's Control Panel + + + + +
                                      + +
                                      +

                                      {lang welcome}, $username [ {lang menu_logout} ]

                                      + +

                                      {lang menu_otheradmincp}

                                      + + +
                                      +
                                      + + \ No newline at end of file diff --git a/uc_server/view/default/admin_frame_index.htm b/uc_server/view/default/admin_frame_index.htm new file mode 100644 index 0000000..ff7f1e6 --- /dev/null +++ b/uc_server/view/default/admin_frame_index.htm @@ -0,0 +1,20 @@ + + + + +UCenter Administrator's Control Panel + + + + + + + + + + + + +
                                      + + \ No newline at end of file diff --git a/uc_server/view/default/admin_frame_main.htm b/uc_server/view/default/admin_frame_main.htm new file mode 100644 index 0000000..150a7c9 --- /dev/null +++ b/uc_server/view/default/admin_frame_main.htm @@ -0,0 +1,114 @@ +{template header} +{if $iframe} + +{/if} +
                                      +

                                      {lang home_stats}

                                      + + +

                                      {lang note_status}

                                      + + +

                                      {lang home_envstatus}

                                      +
                                        + +
                                      • {lang envstatus_result}:{lang envstatus_ok}
                                      • + +
                                      • {lang envstatus_result}: + + {lang envstatus_ver_too_low} + + {lang envstatus_not_found} + +
                                      • + +
                                      +

                                      {lang home_env}

                                      +
                                        +
                                      • {lang home_version}:UCenter {UC_SERVER_VERSION} Release {UC_SERVER_RELEASE} {lang view_new_version}
                                      • +
                                      • {lang home_environment}:$serverinfo
                                      • +
                                      • {lang home_server_software}:$_SERVER[SERVER_SOFTWARE]
                                      • +
                                      • {lang home_database}:$dbversion
                                      • +
                                      • {lang home_upload_perm}:$fileupload
                                      • +
                                      • {lang home_database_size}:$dbsize
                                      • +
                                      • {lang home_server_ip}:$servername
                                      • +
                                      • allow_url_fopen:$allow_url_fopen
                                      • +
                                      +

                                      {lang home_team}

                                      + +
                                      + +$ucinfo + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_frame_menu.htm b/uc_server/view/default/admin_frame_menu.htm new file mode 100644 index 0000000..e6ccd9c --- /dev/null +++ b/uc_server/view/default/admin_frame_menu.htm @@ -0,0 +1,70 @@ + + + + +UCenter Administrator's Control Panel + + + + + + + + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_log.htm b/uc_server/view/default/admin_log.htm new file mode 100644 index 0000000..abcda4b --- /dev/null +++ b/uc_server/view/default/admin_log.htm @@ -0,0 +1,41 @@ +{template header} + +
                                      +

                                      + {lang feed_list} + {lang note_list} + {lang menu_log} + {lang mail_queue} +

                                      +
                                      + + + + + + + + + + + + + + + + + + + + + +
                                      {lang log_operator}{lang log_ip}{lang log_time}{lang log_operation}{lang log_extra}
                                      $log[1]$log[2]$log[3]$log[4]$log[5]
                                      $multipage
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_login.htm b/uc_server/view/default/admin_login.htm new file mode 100644 index 0000000..2e24160 --- /dev/null +++ b/uc_server/view/default/admin_login.htm @@ -0,0 +1,66 @@ +{template header} + + +
                                      +
                                      + + + + + + + + +
                                      +

                                      UCenter

                                      +

                                      {lang login_tips}

                                      +
                                      +
                                      +
                                      + + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_mail.htm b/uc_server/view/default/admin_mail.htm new file mode 100644 index 0000000..9a366b0 --- /dev/null +++ b/uc_server/view/default/admin_mail.htm @@ -0,0 +1,53 @@ +{template header} + + +
                                      +

                                      + {lang feed_list} + {lang note_list} + {lang menu_log} + {lang mail_queue} +

                                      + +

                                      {lang mail_list_updated}

                                      + +
                                      + +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang mail_subject}{lang mail_to_username}{lang mail_add_time}{lang mail_failures}{lang mail_from_app}{lang mail_operate}
                                      {$mail[subject]}{if $mail[username]}{$mail[username]}{else}{lang anonymity}{/if}{$mail[dateline]}{$mail[failures]}{$mail[appname]}{lang mail_send}
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_note.htm b/uc_server/view/default/admin_note.htm new file mode 100644 index 0000000..9d25f6b --- /dev/null +++ b/uc_server/view/default/admin_note.htm @@ -0,0 +1,60 @@ +{template header} + + +
                                      +

                                      + {lang feed_list} + {lang note_list} + {lang menu_log} + {lang mail_queue} +

                                      + +

                                      {lang note_list_updated}

                                      + +
                                      + +
                                      + + + + + + + + + + + + + + + + {eval $debuginfo = dhtmlspecialchars(str_replace(array("\n", "\r", "'"), array('', '', "\'"), $note['getdata'].$note['postdata2'])); } + + + + + + + + + + + + + + + + + +
                                      {lang note_operation}{lang note_times}{lang note_param}{lang note_last_note_time}$app[name]
                                      $note[operation]$note[totalnum]{lang note_view}$note[dateline]$note[status][$appid]
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_pm_clear.htm b/uc_server/view/default/admin_pm_clear.htm new file mode 100644 index 0000000..58486da --- /dev/null +++ b/uc_server/view/default/admin_pm_clear.htm @@ -0,0 +1,31 @@ +{template header} + +
                                      + +

                                      {lang clearpm_deleted}: $delnum

                                      + +
                                      + +
                                      +
                                      + + + + + + + + + + + +
                                      {lang clearpm_usernames}:
                                      {lang clearpm_usernames_comment}
                                      +
                                      +
                                      +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_pm_search.htm b/uc_server/view/default/admin_pm_search.htm new file mode 100644 index 0000000..65ccebb --- /dev/null +++ b/uc_server/view/default/admin_pm_search.htm @@ -0,0 +1,94 @@ +{template header} + + + + +
                                      +
                                      + +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang pm_auhtor}:
                                      {lang pm_message}:
                                      {lang pm_dateline}: -
                                      {lang pm_whichtable}: + + {lang clearpm_totalnum}: $pmnum +
                                      +
                                      +
                                      +
                                      + +

                                      {lang pm_list}

                                      +
                                      + +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang pm_author}{lang dateline}{lang pm_message}
                                      $pm[author]$pm[dateline]$pm[message]
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_setting.htm b/uc_server/view/default/admin_setting.htm new file mode 100644 index 0000000..5489f46 --- /dev/null +++ b/uc_server/view/default/admin_setting.htm @@ -0,0 +1,345 @@ +{template header} + + + +
                                      + +

                                      {lang update_succeed}

                                      + +

                                      {lang setting_register_tips}

                                      + + +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang setting_dateformat}:
                                      {lang setting_dateformat_comment}
                                      {lang setting_timeformat}:
                                      + + +
                                      {lang setting_timeoffset}:
                                      + + {lang setting_timeoffset_comment}
                                      {lang setting_user_failedtime}:
                                      {lang setting_user_failedtime_comment}
                                      {lang setting_pmsendregdays}:
                                      {lang setting_pmsendregdays_comment}
                                      {lang setting_privatepmthreadlimit}:
                                      {lang setting_privatepmthreadlimit_comment}
                                      {lang setting_chatpmthreadlimit}:
                                      {lang setting_chatpmthreadlimit_comment}
                                      {lang setting_chatpmmemberlimit}:
                                      {lang setting_chatpmmemberlimit_comment}
                                      {lang setting_pmfloodctrl}:
                                      {lang setting_pmfloodctrl_comment}
                                      {lang setting_pmcenter}:
                                      + + + {lang setting_pmcenter_comment}
                                      {lang setting_sendpmseccode}:
                                      + + + {lang setting_sendpmseccode_comment}
                                      {lang setting_addappbyurl}:
                                      + + + {lang setting_addappbyurl_comment}
                                      {lang setting_insecureoperation}:
                                      + + + {lang setting_insecureoperation_comment}
                                      {lang setting_passwordalgo}:
                                      {lang setting_passwordalgo_comment}
                                      {lang setting_passwordoptions}:
                                      {lang setting_passwordoptions_comment}
                                      +
                                      +
                                      +
                                      + +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang setting_register_doublee}:
                                      + + +
                                      {lang setting_register_accessemail}:
                                      {lang setting_register_accessemail_comment}
                                      {lang setting_register_censoremail}:
                                      {lang setting_register_censoremail_comment}
                                      {lang setting_forbidden_username}:
                                      {lang setting_ceonsor_comment}
                                      +
                                      +
                                      +
                                      + +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang settings_mail_settings_emailfrom}:
                                      {lang settings_mail_settings_emailfrom_comment}
                                      {lang settings_mail_settings_send}:
                                      +
                                      +
                                      + +
                                      {lang settings_mail_settings_delimiter}:
                                      +
                                      +
                                      + +
                                      + {lang settings_mail_settings_delimiter_comment} +
                                      {lang settings_mail_settings_includeuser}:
                                      + + + {lang settings_mail_settings_includeuser_comment}
                                      {lang settings_mail_settings_silent}:
                                      + + +  
                                      +
                                      +
                                      +
                                      + +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_tag.htm b/uc_server/view/default/admin_tag.htm new file mode 100644 index 0000000..77ad73b --- /dev/null +++ b/uc_server/view/default/admin_tag.htm @@ -0,0 +1,61 @@ +{template header} + + +
                                      + +

                                      {lang menu_tag_templates}

                                      +
                                      + + + + + + + + + + + + + +
                                      {lang app_id}{lang app_name}
                                      $app[appid]$app[name]
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      + +

                                      {lang menu_tag_templates}{lang app_list_return}

                                      +
                                      +

                                      {lang tag_tips}

                                      + +
                                      +
                                      + + + + + + + + + + + + + + + +
                                      {lang app_name}: $appname
                                      {lang tag_global_template}:
                                      + + {$field} $memo
                                      + + [node]...[/node] {lang tag_template_comment}
                                      +
                                      +
                                      + +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_user.htm b/uc_server/view/default/admin_user.htm new file mode 100644 index 0000000..afefe73 --- /dev/null +++ b/uc_server/view/default/admin_user.htm @@ -0,0 +1,197 @@ +{template header} + + + + + + + + +
                                      + +

                                      {if $status < 0}{lang user_add_failed}: {/if}{if $status == 2}{lang user_delete_succeed}{elseif $status == 1}{lang user_add_succeed}{elseif $status == -1}{lang user_add_username_ignore}{elseif $status == -2}{lang user_add_username_badwords}{elseif $status == -3}{lang user_add_username_exists}{elseif $status == -4}{lang user_add_email_formatinvalid}{elseif $status == -5}{lang user_add_email_ignore}{elseif $status == -6}{lang user_add_email_exists}{/if}

                                      + +
                                      + + +
                                      +
                                      + + + + + + + + + + + + + + + + + +
                                      {lang user_name}:UID:{lang email}:
                                      {lang user_regdate}: {lang to} {lang user_regip}:
                                      +
                                      +
                                      +
                                      + + +
                                      +

                                      + {lang user_list} + {lang menu_log} +

                                      +
                                      + +
                                      + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang user_name}{lang email}{lang user_regdate}{lang user_regip}{lang edit}
                                      $user[smallavatar]$user[username]$user[email]$user[regdate]$user[regip]{lang edit}
                                      $multipage
                                      +
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + + + +
                                      +

                                      {lang user_edit_profile} + {if getgpc('fromadmin')} + {lang admin_return_admin_ls} + {else} + {lang admin_return_user_ls} + {/if} +

                                      + +

                                      {lang user_edit_profile_sucessfully}

                                      + +

                                      {lang user_edit_profile_failed}

                                      + +

                                      {lang user_keep_blank}

                                      + +
                                      +
                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                      {lang user_avatar}: {lang delete_avatar}
                                      {lang user_avatar_virtual}:
                                      $user[bigavatar]
                                      {lang user_avatar_real}:
                                      $user[bigavatarreal]
                                      {lang login_username}:
                                      + + +
                                      {lang login_password}:
                                      + +
                                      {lang login_secques}: {lang login_remove_secques}
                                      Email:
                                      + +
                                      {lang secmobicc}:
                                      + +
                                      {lang secmobile}:
                                      + +
                                      +
                                      +
                                      +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/admin_user_log.htm b/uc_server/view/default/admin_user_log.htm new file mode 100644 index 0000000..1bff6d1 --- /dev/null +++ b/uc_server/view/default/admin_user_log.htm @@ -0,0 +1,37 @@ +{template header} + +
                                      +

                                      + {lang user_list} + {lang menu_log} +

                                      +
                                      + + + + + + + + + + + + + + + + + + + +
                                      IDUID{lang log_operation}{lang log_extra}
                                      $log['lid']$log['uid']$log['action']$log['extra']
                                      $multipage
                                      + +
                                      +

                                      {lang list_empty}

                                      +
                                      + +
                                      +
                                      + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/camera.htm b/uc_server/view/default/camera.htm new file mode 100644 index 0000000..8fa2752 --- /dev/null +++ b/uc_server/view/default/camera.htm @@ -0,0 +1,53 @@ + + + + + + +UCenter + + + + + + + + +
                                      +
                                      +
                                      + +
                                      +
                                      + + +
                                      +
                                      +
                                      +
                                      +
                                      + +
                                      +
                                      +
                                      + +
                                      + + + +
                                      +
                                      + +
                                      + +
                                      +
                                      +
                                      + + + + + +
                                      + + \ No newline at end of file diff --git a/uc_server/view/default/footer.htm b/uc_server/view/default/footer.htm new file mode 100644 index 0000000..427ca75 --- /dev/null +++ b/uc_server/view/default/footer.htm @@ -0,0 +1,34 @@ + + +
                                      + Processed in s +
                                      + GET: + +
                                      +
                                      + POST: + +
                                      +
                                      + COOKIE: + +
                                      +
                                      + SQL: $dbquerynum + +
                                    • $dbhistory
                                    • + +
                                      +
                                      + Include: {eval echo count(get_included_files());} + +
                                      +
                                      + + + + \ No newline at end of file diff --git a/uc_server/view/default/footer_ajax.htm b/uc_server/view/default/footer_ajax.htm new file mode 100644 index 0000000..0602790 --- /dev/null +++ b/uc_server/view/default/footer_ajax.htm @@ -0,0 +1,5 @@ +{eval $s = ob_get_contents();} +{eval ob_end_clean();} +{{eval $s = preg_replace("/([\\x00-\\x09\\x0b-\\x0c\\x0e-\\x1f])+/", ' ', $s);}} +$s +]]>{eval exit;} \ No newline at end of file diff --git a/uc_server/view/default/footer_client.htm b/uc_server/view/default/footer_client.htm new file mode 100644 index 0000000..17c7245 --- /dev/null +++ b/uc_server/view/default/footer_client.htm @@ -0,0 +1,3 @@ +
                                      + + \ No newline at end of file diff --git a/uc_server/view/default/header.htm b/uc_server/view/default/header.htm new file mode 100644 index 0000000..223b54b --- /dev/null +++ b/uc_server/view/default/header.htm @@ -0,0 +1,55 @@ + + + + +UCenter Administrator's Control Panel + + + +
                                      + + {lang menu} + + + diff --git a/uc_server/view/default/header_ajax.htm b/uc_server/view/default/header_ajax.htm new file mode 100644 index 0000000..70a9f6b --- /dev/null +++ b/uc_server/view/default/header_ajax.htm @@ -0,0 +1,8 @@ +{eval @ob_end_clean();} +{eval ob_start();} +{eval @header("Expires: -1");} +{eval @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);} +{eval @header("Pragma: no-cache");} +{eval @header("Content-type: application/xml; charset=$charset");} +{eval echo "";} + + + + + + +UCenter + + + + + + + +
                                      +
                                      +

                                      {lang pm_central}

                                      \ No newline at end of file diff --git a/uc_server/view/default/index.htm b/uc_server/view/default/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/view/default/index.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uc_server/view/default/main.lang.php b/uc_server/view/default/main.lang.php new file mode 100644 index 0000000..00ebe07 --- /dev/null +++ b/uc_server/view/default/main.lang.php @@ -0,0 +1,69 @@ + '其他', + 'app_connect_ok' => '通信成功 ', + 'app_connect_false' => '通信失败', + + 'note_deleteuser' => '删除用户', + 'note_renameuser' => '重命名用户', + 'note_deletefriend' => '删除好友', + 'note_gettag' => '获取TAG', + 'note_getcreditsettings' => '获取应用积分设置', + 'note_updatecreditsettings' => '更新应用积分设置', + 'note_updateclient' => '更新应用缓存', + 'note_updatepw' => '更新用户密码', + 'note_updatebadwords' => '更新词语过滤列表', + 'note_updatehosts' => '更新域名解析列表', + 'note_updateapps' => '更新应用列表', + 'note_updatetagtemplate' => '更新标签模板设置', + 'note_list' => '通知列表', + 'note_test' => '测试', + 'note_delete' => '删除', + 'note_succeed' => '通知成功 ', + 'note_na' => '未通知', + 'note_false' => '通知失败', + 'note_times' => '次', + + 'pm_from' => '来自', + 'pm_to' => '发送到', + 'pm_system' => '系统消息', + 'pm_date' => '时间', + 'pm_daterange_1' => '今天', + 'pm_daterange_2' => '昨天', + 'pm_daterange_3' => '前天', + 'pm_daterange_4' => '上周', + 'pm_daterange_5' => '更早', + 'pm_notitle' => '[无标题]', + + 'user_add' => '添加用户', + 'user_delete' => '删除用户', + 'login' => '登录', + 'logout' => '退出', + 'app_add' => '添加新应用', + 'app_delete' => '删除应用', + 'app_edit' => '编辑应用', + 'setting_update' => '更新基本设置', + 'setting_register_update' => '更新注册设置', + 'pm_send' => '发送公共消息', + 'pm_delete' => '删除公共消息', + 'pm_clear' => '清理短消息', + 'badword_add' => '添加词语过滤', + 'badword_delete' => '删除词语过滤', + 'admin_add' => '添加管理员', + 'admin_pw_edit' => '修改创始人密码', + 'admin_priv_edit' => '修改管理员权限', + 'domain_add' => '添加域名解析', + 'domain_delete' => '删除域名解析', + 'credit_addexchange' => '更新积分兑换方案', + 'credit_deleteexchange' => '删除积分兑换方案', + 'credit_sync' => '同步应用的积分设置', + 'db_export' => '备份数据', + 'db_import' => '恢复数据', + 'db_delete' => '删除数据', + 'note_delete' => '删除通知', + 'note_send' => '补发通知', + 'dumpfile_exists' => '备份存在', + 'dumpfile_not_exists' => '备份不存在', +); \ No newline at end of file diff --git a/uc_server/view/default/message.htm b/uc_server/view/default/message.htm new file mode 100644 index 0000000..7f30585 --- /dev/null +++ b/uc_server/view/default/message.htm @@ -0,0 +1,25 @@ +{template header} + +
                                      +
                                      +
                                      +

                                      {lang message_title}:

                                      +

                                      $message

                                      + +

                                      {lang message_back}

                                      + +

                                      {lang message_redirect}

                                      + + +
                                      +
                                      +
                                      + + $message + +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/message_client.htm b/uc_server/view/default/message_client.htm new file mode 100644 index 0000000..ac9af8b --- /dev/null +++ b/uc_server/view/default/message_client.htm @@ -0,0 +1,29 @@ +{template header_client} +
                                      + + + + + + + + + + + +
                                      {lang message_title}
                                      $message
                                      + + {lang message_back} + + {lang message_redirect} + + +
                                      +
                                      + +{template footer_client} \ No newline at end of file diff --git a/uc_server/view/default/messages.lang.php b/uc_server/view/default/messages.lang.php new file mode 100644 index 0000000..9c98445 --- /dev/null +++ b/uc_server/view/default/messages.lang.php @@ -0,0 +1,78 @@ + '请重新登录', + 'receiver_no_exists' => '收件人不存在,请重新填写', + 'pm_save_succeed' => '短消息已保存到草稿箱', + 'pm_send_succeed' => '短消息成功发送', + 'pm_send_announce_succeed' => '公共消息成功发送', + 'pm_send_ignore' => '短消息发送失败', + 'pm_delete_succeed' => '短消息成功删除', + 'pm_delete_invalid' => '短消息无法删除', + 'pm_unread' => '当前短消息标记为未读状态', + 'blackls_updated' => '忽略列表已更新', + 'pm_kickmember_succeed' => '踢出群聊成员成功 ', + 'pm_appendmember_succeed' => '群聊加入新成员成功 ', + 'pm_appendmember_invalid' => '加入新成员失败', + 'pm_send_chatpmmemberlimit_error' => '超出了群聊的最大成员数目', + 'pm_send_pmfloodctrl_error' => '两次发送短消息间隔过短,请稍后发', + 'pm_send_privatepmthreadlimit_error' => '超过24小时内两人会话的最大数量', + 'pm_send_chatpmthreadlimit_error' => '超过24小时内群聊会话的最大数量', + 'pm_clear_processing' => '正在处理 从 current 到 next', + 'pm_clear_succeed' => '操作成功 ', + 'pm_delete_noselect' => '请选中短消息进行处理', + + 'db_export_filename_invalid' => '您没有输入备份文件名或文件名中使用了敏感的扩展名,请返回修改。', + 'db_export_file_invalid' => '数据文件无法保存到服务器,请检查目录属性。', + 'db_export_multivol_redirect' => '分卷备份: 数据文件 #$volume 成功创建,程序将自动继续。', + 'db_export_multivol_succeed' => '恭喜您,全部备份文件成功创建,备份完成。', + 'db_import_multivol_succeed' => '分卷数据成功导入数据库。', + 'db_import_file_illegal' => '数据文件不存在: 可能服务器不允许上传文件或尺寸超过限制。', + 'db_import_multivol_redirect' => '分卷数据 #$volume 成功导入数据库,程序将自动导入本次备份的其他分卷。', + 'db_back_api_url_invalid' => '无法访问到该应用的备份接口,请拷贝 UCenter 根目录下api/dbbak.php 到该应用的api目录下', + 'db_back_dos8p3_failed' => '服务器开启了 DOS 8.3 文件名支持,为避免可能发生的数据库爆破风险,不允许在线备份数据库', + 'delete_dumpfile_success' => '删除数据备份文件成功 ', + 'delete_dumpfile_redirect' => '#$appname 下同名备份文件删除成功,程序将自动删除其他应用下的。', + 'dbback_error_code_1' => '无法创建目录', + 'dbback_error_code_2' => '备份文件写入失败', + 'dbback_error_code_3' => 'sql执行错误', + 'dbback_error_code_4' => '目录为空或者目录不存在', + 'dbback_error_code_5' => '指定目录没有找到合法的备份文件', + 'dbback_error_code_6' => '备份文件缺失', + 'dbback_error_code_7' => '指定备份目录不存在', + 'dbback_error_code_8' => '删除指定的数据库备份文件错误', + 'dbback_error_code_9' => '备份接口程序暂不支持此种应用的备份', + 'undefine_error' => '未知错误', + + 'app_add_url_invalid' => '接口 URL 地址不合法', + 'app_add_ip_invalid' => 'IP 地址不合法', + 'app_add_name_invalid' => '应用名称不合法或者与其他应用重复, 请返回更换', + 'read_plugin_invalid' => '读取插件失败', + + 'syncappcredits_updated' => '成功同步应用的积分设置', + + 'note_succeed' => '通知成功 ', + 'note_false' => '通知失败', + 'no_permission_for_this_module' => '没有权限管理改模块', + 'admin_user_exists' => '该用户名已经存在,请返回尝试使用其他用户名。', + 'admin_mobile_exists' => '该安全手机号已经存在,请返回尝试使用其他安全手机号。', + + 'mail_succeed' => '邮件发送成功 ', + 'mail_false' => '邮件发送失败', + + 'user_edit_noperm' => '您没权限编辑此用户', + + 'appid_invalid' => '应用id不合法', + 'app_apifile_not_exists' => '文件 #$apifile 不存在,请返回检查应用的路径是否正确。', + 'app_apifile_too_low' => '接口文件 #$apifile 版本太低', + 'app_path_not_exists' => '该路径不存在,请返回检查', + 'pm_send_seccode_error' => '验证码输入错误', + 'pm_send_regdays_error' => '注册 #$pmsendregdays 天之内不能发送短消息', + 'pm_send_limit1day_error' => '对不起,超出了您24小时最大发送短消息数,请返回。', + 'pm_send_floodctrl_error' => '对不起,您两次发送短消息间隔太短,请返回。', + + 'file_check_failed' => '校验文件不存在,无法校验', + 'replacemykey_succeed' => '密钥更新成功,请更新缓存并检查每个下级应用的状态', + 'replacemykey_false' => '密钥更新失败,请检查文件是否可写或数据库是否正常,如有必要请重新配置每个下级应用的 UC_KEY 以保证正常工作', + 'replacemykey_no_confirm' => '请您确认风险提示后再继续操作', +); \ No newline at end of file diff --git a/uc_server/view/default/plugin_footer.htm b/uc_server/view/default/plugin_footer.htm new file mode 100644 index 0000000..f89d0e8 --- /dev/null +++ b/uc_server/view/default/plugin_footer.htm @@ -0,0 +1,4 @@ + +
                                      +
                                +{template footer} \ No newline at end of file diff --git a/uc_server/view/default/plugin_header.htm b/uc_server/view/default/plugin_header.htm new file mode 100644 index 0000000..f8e0de3 --- /dev/null +++ b/uc_server/view/default/plugin_header.htm @@ -0,0 +1,21 @@ +{template header} + + +
                                + +

                                $plugin[tips]

                                + +
                                  + + + + +
                                +
                                \ No newline at end of file diff --git a/uc_server/view/default/pm_blackls.htm b/uc_server/view/default/pm_blackls.htm new file mode 100644 index 0000000..435088e --- /dev/null +++ b/uc_server/view/default/pm_blackls.htm @@ -0,0 +1,26 @@ +{template header_client} +{template pm_nav} + +
                                +
                                + + + + + + + +
                                +
                                +
                                {lang pm_ignore_list_comment}
                                +
                                + +
                                + + + +
                                +
                                +
                                + +{template footer_client} \ No newline at end of file diff --git a/uc_server/view/default/pm_editorbar.htm b/uc_server/view/default/pm_editorbar.htm new file mode 100644 index 0000000..f230f75 --- /dev/null +++ b/uc_server/view/default/pm_editorbar.htm @@ -0,0 +1,33 @@ + + + +
                                + + + + + + + + + + + + + + + + + +
                                + + \ No newline at end of file diff --git a/uc_server/view/default/pm_ls.htm b/uc_server/view/default/pm_ls.htm new file mode 100644 index 0000000..195a135 --- /dev/null +++ b/uc_server/view/default/pm_ls.htm @@ -0,0 +1,81 @@ +{template header_client} +{template pm_nav} + +
                                +
                                + + +{eval $pmrange = 0;} + + + + + + + + + class="onset"> + + + + + + + + + + + + + + + +
                                + $multipage +
                                + + + + + + + + + + + + + {lang pm_author}$pm[tousername] + + {lang fromto}$pm[lastauthor] + + + + {lang sendeveryone} + + {lang fromto}$pm[lastauthor] + + +

                                $pm[lastdateline]

                                +
                                +

                                + + {lang privatewithwho} + + $pm[subject]({lang chatpmmembernum}$pm[members]) + +

                                +

                                class="boldtext" >$pm[message]

                                +
                                + $multipage +
                                + + + {lang pm_none_record} + + + +
                                +
                                + +{template footer_client} \ No newline at end of file diff --git a/uc_server/view/default/pm_member.htm b/uc_server/view/default/pm_member.htm new file mode 100644 index 0000000..f96269c --- /dev/null +++ b/uc_server/view/default/pm_member.htm @@ -0,0 +1,67 @@ +{template header_client} +{template pm_nav} + +
                                +

                                +

                                + + + + + + + + + + + + + + +
                                + + $member({lang pm_author}) + +

                                {lang kickmember}

                                + +
                                + +
                                + {lang appendchatpmmember} + + +
                                + +
                                +
                                + +
                                + {lang pm_history}: + {lang pm_daterange_1}  + {lang pm_daterange_2}  + {lang pm_daterange_3}  + {lang pm_daterange_4}  + {lang pm_daterange_5}  + {lang pm_member}  + + + + + + +
                                +
                                + + + + + +{template footer_client} \ No newline at end of file diff --git a/uc_server/view/default/pm_nav.htm b/uc_server/view/default/pm_nav.htm new file mode 100644 index 0000000..0426c77 --- /dev/null +++ b/uc_server/view/default/pm_nav.htm @@ -0,0 +1,43 @@ + + + \ No newline at end of file diff --git a/uc_server/view/default/pm_send.htm b/uc_server/view/default/pm_send.htm new file mode 100644 index 0000000..22995a1 --- /dev/null +++ b/uc_server/view/default/pm_send.htm @@ -0,0 +1,78 @@ +{template header_client} +{template pm_nav} + + + +
                                + +

                                + + +
                                + + +
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                {lang pm_to}: + +
                                {lang pm_message}: + {template pm_editorbar} + +
                                {lang login_seccode}: + +
                                + + {lang chatpm} +
                                +
                                + +
                                +

                                {lang pm_tofriends}

                                +
                                  + +
                                • $friend[username]
                                • + +
                                +
                                + +
                                +
                                + +{template footer_client} \ No newline at end of file diff --git a/uc_server/view/default/pm_view.htm b/uc_server/view/default/pm_view.htm new file mode 100644 index 0000000..032d172 --- /dev/null +++ b/uc_server/view/default/pm_view.htm @@ -0,0 +1,91 @@ +{template header_client} +{template pm_nav} + +
                                +

                                +

                                + + + + + + + + + + + +
                                + + +

                                $pm[dateline]

                                + $pm[message]
                                + + + + {lang pm_transmit} + +
                                +
                                + + + + + +
                                + {lang pm_history}: + + {lang pm_daterange_1}  + {lang pm_daterange_2}  + {lang pm_daterange_3}  + {lang pm_daterange_4}  + {lang pm_daterange_5}  + + {lang pm_daterange_1}  + {lang pm_daterange_2}  + {lang pm_daterange_3}  + {lang pm_daterange_4}  + {lang pm_daterange_5}  + {lang pm_member}  + + + + + + + + + + +
                                + + +
                                + + + + + {template pm_editorbar} + + +

                                + +

                                +
                                + + +
                                + + + + + +{template footer_client} \ No newline at end of file diff --git a/uc_server/view/default/templates.lang.php b/uc_server/view/default/templates.lang.php new file mode 100644 index 0000000..7fa28a4 --- /dev/null +++ b/uc_server/view/default/templates.lang.php @@ -0,0 +1,538 @@ +'标题', + 'return'=>'返回', + 'dateline'=>'时间', + 'delete'=>'删除', + 'checkall'=>'全选', + 'submit' => '提 交', + 'confirms' => '确定', + 'finished' => '完成', + 'yes' => '是', + 'no' => '否', + 'tips' => '提示', + 'list_empty' => '目前没有相关记录!', + 'shortcut_tips' => '点击编辑,提交后保存', + 'welcome' => '您好', + 'edit' => '编辑', + 'plugin' => '插件中心', + 'to' => '到', + 'menu' => '菜单', + + 'copyright' => '© 2001-'.date('Y').' Discuz! Team.', + + 'founder'=>'UCenter创始人', + 'login_username'=>'用户名', + 'login_password'=>'密 码', + 'login_submit'=>'登 录', + 'login_seccode'=>'验证码', + 'login_incorrect' => '登录失败!
                                用户名无效,或密码错误。', + 'login_founder_incorrect' => 'UCenter创始人密码错误', + 'login_admin_noexists' => '该管理员不存在', + 'login_seccode_error' => '验证码输入错误', + 'login_failedlogin' => '密码重试次数过多,请稍后尝试', + 'login_tips' => 'UCenter 是一个能沟通多个应用的桥梁,使各应用共享一个用户数据库,实现统一登录,注册,用户管理。', + 'login_seccode_tips' => '如果您无法识别验证码,请点图片更换', + 'login_secques' => '安全提问', + 'login_remove_secques' => '清除安全提问', + 'login_getpw' => '找回密码', + + 'menu_index'=>'首页', + 'menu_basic_setting'=>'基本设置', + 'menu_register_setting'=>'注册设置', + 'menu_mail_setting' => '邮件设置', + 'menu_manager_user'=>'用户管理', + 'menu_pm'=>'短消息', + 'menu_credit_exchange'=>'积分兑换', + 'menu_censor_word'=>'词语过滤', + 'menu_application'=>'应用管理', + 'menu_data_list'=>'数据列表', + 'menu_domain_list' =>'域名解析', + 'menu_db' => '数据备份', + 'menu_update_cache'=>'更新缓存', + 'menu_log' => '日志列表', + 'menu_logout'=>'退出', + 'menu_otheradmincp' => '其他管理平台', + 'menu_admin_user' => '管理员', + + 'pm_from'=>'发件人', + 'pm_to'=>'收件人', + 'pm_none_record'=>'没有短消息', + 'pm_total_pm'=>'共 $pmnum[$pmnumindex] 条消息', + 'pm_system_pm'=>'系统消息', + 'pm_ignore_list'=>'忽略列表', + 'pm_ignore_list_comment'=>'添加到该列表中的用户给您发送短消息时将不予接收
                                添加多个忽略人员名单时用逗号 "," 隔开,如“张三,李四,王五”
                                如需禁止所有用户发来的短消息,请设置为 "{ALL}"', + 'save'=>'保存', + 'pm_central'=>'短消息中心', + 'pm_send'=>'发送短消息', + 'pm_send_announce'=>'发送公共消息', + 'pm_unread'=>'条未读消息', + 'pm_history'=>'历史短消息', + 'pm_sysbox'=>'条系统消息', + 'pm_annbox'=>'公共消息', + 'pm_savebox'=>'草稿箱', + 'pm_outbox'=>'发件箱', + 'pm_ignorelist'=>'忽略列表', + 'pm_preview'=>'短消息预览', + 'back'=>'返回', + 'pm_tofriends'=>'好友', + 'pm_subject'=>'消息标题', + 'pm_notitle'=>'[无标题]', + 'pm_message'=>'消息内容', + 'pm_replymessage' => '回复内容', + 'pm_sendpm'=>'发送', + 'pm_recv'=>'收信人', + 'pm_transmit'=>'转发', + 'pm_mark_unread'=>'标记未读', + 'pm_swith_friendls'=>'打开/关闭 好友列表', + 'reply'=>'回复', + 'upload'=>'上传', + 'pm_inbox'=>'短消息', + 'pm_inboxnew'=>'收件箱有', + 'pm_current'=>'当前短消息', + 'pm_system' => '系统消息', + 'pm_preview' => '预览短消息', + 'pm_date' => '时间', + 'pm_daterange_1' => '今天', + 'pm_daterange_2' => '昨天', + 'pm_daterange_3' => '前天', + 'pm_daterange_4' => '上周', + 'pm_daterange_5' => '更早', + 'pm_prompt_list' => '输入一个列表项目.\r\n留空或者点击取消完成此列表.', + 'pm_prompt_img' => '请输入图片链接地址:', + 'pm_prompt_url' => '请输入链接的地址:', + 'pm_prompt_email' => '请输入此链接的邮箱地址:', + 'pm_confirm_delete' => '您确定要删除所有短消息吗?', + 'pm_delete_all' => '删除全部', + 'pm_delete_chatpm' => '删除群聊', + 'pm_quit_chatpm' => '退出群聊', + 'pm_confirm_deletechatpm' => '您确定要删除该群聊的消息吗?', + 'pm_confirm_quitchatpm' => '您确定要退出该群聊吗?', + 'new_pm' => '未读消息', + 'private_pm' => '私人消息', + 'chat_pm' => '群聊消息', + 'pm_member' => '参与成员', + 'pm_confirm_kickmember' => '您确定要踢出该人吗?', + 'kickmember' => '踢出', + 'appendchatpmmember' => '加入新成员', + 'appendmember' => '加入', + 'tipkickmember' => '将{$member}从该群聊中踢出', + 'pm_author' => '发起者', + 'sendto' => '发送给: ', + 'fromto' => '来自: ', + 'sendeveryone' => '发送给大家', + 'privatewithwho' => '与 {$pm[\'tousername\']} 的对话', + 'chatpmmembernum' => '参与人数: ', + 'chatpm' => '群聊', + + 'editor_b' => '粗体', + 'editor_i' => '斜体', + 'editor_u' => '下划线', + 'editor_list1' => '排序的列表', + 'editor_lista' => '未排序列表', + 'editor_indent' => '增加缩进', + 'editor_color' => '颜色', + 'editor_alignleft' => '居左', + 'editor_aligncenter' => '居中', + 'editor_alignright' => '居右', + 'editor_floatleft' => '左浮动', + 'editor_floatright' => '右浮动', + 'editor_code' => '插入代码', + 'editor_quote' => '插入引用', + 'editor_img' => '插入图片', + 'editor_url' => '插入链接', + 'editor_email' => '插入邮箱链接', + + 'app_list' => '应用列表', + 'app_list_updated' => '应用列表成功更新。', + 'app_list_return' => '返回应用列表', + 'app_list_tips' => '如果出现“通信失败”,请点击“编辑”尝试设置应用域名对应的 IP。', + 'app_add' => '添加新应用', + 'app_add_succeed' => '成功添加应用。', + 'app_delete' => '删除', + 'app_id' => 'ID', + 'app_name' => '应用名称', + 'app_name_comment' => '限 20 字节。', + 'app_url' => '应用的主 URL', + 'app_url_comment' => '该应用与 UCenter 通信的接口 URL,结尾请不要加“/” ,应用的通知只发送给主 URL', + 'app_extra_url' => '应用的其他 URL', + 'app_extra_url_comment' => '该应用可以访问的其他 URL,结尾请不要加“/” ,每行一个,只有在同步登录时请求该 URL', + 'app_ip' => '应用 IP', + 'app_ip_comment' => '正常情况下留空即可。如果由于域名解析问题导致 UCenter 与该应用通信失败,请尝试设置为该应用所在服务器的 IP 地址。', + 'app_key' => '通信密钥', + 'app_key_comment' => '只允许使用英文字母及数字,限 64 字节。应用端的通信密钥必须与此设置保持一致,否则该应用将无法与 UCenter 正常通信。', + 'app_key_generate' => '生成安全通信密钥', + 'app_login' => '是否开启同步登录', + 'app_login_comment' => '开启同步登录后,当用户在登录其他应用时,同时也会登录该应用。', + 'app_charset' => '字符集', + 'app_dbcharset' => '数据库字符集', + 'app_detail' => '详情', + 'app_detail_tips' => '如果出现 通信失败,请点击“编辑”尝试设置应用域名对应的 IP。', + 'app_edit' => '编辑', + 'app_setting' => '编辑应用', + 'app_type' => '应用类型', + 'app_linkstatus' => '通信情况', + 'app_link' => '正在连接...', + 'app_recvnote' => '是否接受通知', + 'app_tagtemplates' => '标签单条显示模板', + 'app_tagtemplates_comment' => '当前应用的标签数据显示在其它应用时的单条数据模板。', + 'app_tagfields' => '标签模板标记说明', + 'app_tagfields_comment' => '一行一个标记说明条目,用逗号分割标记和说明文字。如:
                                subject,主题标题
                                url,主题地址', + 'app_install_type' => '选择安装方式', + 'app_install_url' => '应用程序安装地址', + 'app_install_by_url' => 'URL 安装 (推荐)', + 'app_install_by_custom' => '自定义安装', + 'app_install_submit' => ' 安 装 ', + 'app_path' => '应用的物理路径', + 'app_path_comment' => '默认请留空,如果填写的为相对路径(相对于UC),程序会自动转换为绝对路径,如 ../', + 'app_viewpro_url' => '查看个人资料页面地址', + 'app_viewpro_url_comment' => 'URL中域名后面的部分,如:/space.php?uid=%s 这里的 %s 代表uid', + 'app_api_filename' => '应用接口文件名称', + 'app_api_filename_comment' => '应用接口文件名称,不含路径,默认为uc.php', + 'app_code' => '应用的 UCenter 配置信息', + 'app_code_comment' => '当应用的 UCenter 配置信息丢失时可复制左侧的代码到应用的配置文件中', + 'app_not_add_tips' => '不能通过 URL 添加应用的可能原因:1. 通过 URL 添加应用开关被关闭;2. 连续多次错误输入 UCenter 创始人密码', + 'app_recvnotediy' => '是否需要自定义通知类别', + 'app_disablenote_deleteuser' => '是否接受用户删除通知', + 'app_disablenote_renameuser' => '是否接受用户改名通知', + 'app_disablenote_gettag' => '是否接受获取标签通知', + 'app_disablenote_updatepw' => '是否接受更改用户密码通知', + 'app_disablenote_updatebadwords' => '是否接受更新关键字列表通知', + 'app_disablenote_updatehosts' => '是否接受更新域名解析缓存通知', + 'app_disablenote_updateapps' => '是否接受更新应用列表通知', + 'app_disablenote_updateclient' => '是否接受更新客户端缓存通知', + 'app_disablenote_updatecredit' => '是否接受更新用户积分通知', + 'app_disablenote_getcredit' => '是否接受获取用户的某项积分通知', + 'app_disablenote_getcreditsettings' => '是否接受向 UCenter 提供积分设置通知', + 'app_disablenote_updatecreditsettings' => '是否接受更新应用积分设置通知', + 'app_disablenote_addfeed' => '是否接受添加事件通知', + + 'tag_tips' => '设置当前应用获取其他应用标签数据的比例以及扩展数据模板。模板中“{xxx}”表示标签数据的索引,代表相应的数据。', + 'tag_global_template' => '全局模板', + 'tag_percent' => '比例', + 'tag_template' => '模板', + 'tag_edit' => '编辑', + 'tag_template_comment' => '包含单条数据的模板', + + 'badword_list' => '词语过滤', + 'badword_list_updated' => '词语过滤成功更新。', + 'badword_add' => '添加词语过滤', + 'badword_add_succeed' => '词语过滤添加成功。', + 'badword_delete' => '删除', + 'badword_keyword' => '敏感词', + 'badword_replace' => '替换为', + 'badword_admin' => '操作人', + 'badword_multi_add' => '批量添加', + 'badword_multi_add_comment' => '
                              • 每行一组,敏感词和替换词之间使用“=”进行分割。
                              • +
                              • 如果想将某个词语直接替换成 **,只输入词语即可。
                              • +
                              • 例如:
                              • +
                              • toobad
                              • +
                              • badword=good
                              • ', + 'badword_skip' => '当冲突时,跳过原来的词表', + 'badword_overwrite' => '当冲突时,覆盖原来的词表', + 'badword_truncate' => '清空当前词表,后导入新词语(此操作不可恢复,建议首先 导出词表,做好备份)', + + 'announcepm' => '公共消息管理', + 'announcepm_deleted' => '成功删除公共消息', + 'clear_pm' => '清理短消息', + 'clearpm_deleted' => '成功清理的短消息数', + 'clearpm_totalnum' => '短消息中心消息总数', + 'clearpm_delunread' => '不删除未读信息', + 'clearpm_cleardays' => '删除多少天以前的短消息', + 'clearpm_cleardays_comment' => '不限制时间请输入 0', + 'clearpm_usernames' => '清理某用户的短消息', + 'clearpm_usernames_comment' => '输入用户名,多个用户名用半角逗号“,”分隔
                                此功能清空与该用户产生的所有私人消息,由该用户发起的所有群聊消息,以及参与的群聊消息', + 'announcepm_send_succeed'=>'公共消息成功发送', + 'pm_clear' => '清空短消息', + 'pm_search' => '短消息搜索', + 'pm_whichtable' => '选择分表', + 'pm_auhtor' => '发件人', + 'pm_dateline' => '时间范围', + 'pm_list' => '短消息列表', + 'pm_delete_confirm' => '该操作不可恢复,您确认要删除这些短消息吗?', + + 'creditexchange_updated' => '成功更新积分兑换方案。', + 'creditexchange_invalid' => '兑换前后应用相同,请重新设置。', + 'creditexchange_update' => '更新积分兑换方案', + 'creditexchange_fromto' => '兑换方向', + 'creditexchange_select' => '请选择', + 'creditexchange_ratio' => '兑换比率', + 'creditexchange' => '积分兑换', + 'creditexchange_syncappcredits' => '同步应用的积分设置', + 'creditexchange_tips' => '点击“同步应用的积分设置”可以获取应用的积分设置,并且把当前设置结果通知给应用', + + 'note_deleteuser' => '删除用户', + 'note_deletefriend' => '删除好友', + 'note_gettag' => '获取TAG', + 'note_updateclient' => '更新应用缓存', + 'note_list' => '通知列表', + 'note_list_updated' => '通知列表成功更新。', + 'note_test' => '测试', + 'note_delete' => '删除', + 'note_operation' => '操作', + 'note_times' => '通知次数', + 'note_param' => '参数', + 'note_last_note_time' => '最后通知时间', + 'note_view' => '查看', + 'setting_forbidden_username' => '禁止的用户名', + 'setting_ceonsor_comment' => '可以设置通配符,每个关键字一行,可使用通配符 "*" 如 "*版主*"(不含引号)。', + 'note_view' => '查看', + 'note_status' => '通知状态', + 'note_fail_apps' => '通知失败的应用', + + 'feed_list'=>'事件列表', + 'tag_list'=>'标签列表', + 'mail_queue' => '邮件队列', + 'mail_delete' => '删除', + 'mail_subject' => '邮件标题', + 'mail_to_username' => '接收者', + 'mail_add_time' => '加入时间', + 'mail_failures' => '失败次数', + 'mail_from_app' => '来源', + 'mail_operate' => '操作', + 'anonymity' => '匿名', + 'mail_send' => '发送邮件', + 'mail_list_updated' => '邮件列表成功更新。', + 'mail_send' => '邮件发送', + + 'setting' => '设置', + 'setting_tips' => '', + 'setting_dateformat' => '日期格式', + 'setting_dateformat_comment' => '使用 yyyy(yy) 表示年,mm 表示月,dd 表示天。如 yyyy-mm-dd 表示 2000-1-1', + 'setting_timeformat' => '时间格式', + 'setting_timeformat_hr24' => '24 小时制', + 'setting_timeformat_hr12' => '12 小时制', + 'setting_timeoffset' => '时区', + 'setting_timeoffset_comment' => '默认为: GMT +08:00', + 'setting_pmsendregdays' => '发短消息最少注册天数', + 'setting_pmsendregdays_comment' => '注册天数少于此设置的,不允许发送短消息,0为不限制,此举为了限制机器人发广告', + 'setting_pmcenter' => '启用短消息中心', + 'setting_pmcenter_comment' => '是否启用短消息中心功能,不影响使用短消息接口应用程序的使用', + 'setting_sendpmseccode' => '开启发送短消息验证码', + 'setting_sendpmseccode_comment' => '是否开启短消息中心发送短消息验证码,可以防止使用机器狂发短消息', + 'setting_privatepmthreadlimit' => '同一用户在 24 小时内允许发起两人会话的最大数', + 'setting_privatepmthreadlimit_comment' => '同一用户在 24 小时内可以发起的两人会话数的最大值,建议在 30 - 100 范围内取值,0 为不限制,此举为了限制通过机器批量发广告', + 'setting_chatpmthreadlimit' => '同一用户在 24 小时内允许发起群聊会话的最大数', + 'setting_chatpmthreadlimit_comment' => '同一用户在 24 小时内可以发起的群聊会话的最大值,建议在 30 - 100 范围内取值,0 为不限制,此举为了限制通过机器批量发广告', + 'setting_chatpmmemberlimit' => '参与同一群聊会话的最大用户数', + 'setting_chatpmmemberlimit_comment' => '同一会话最多能有多少用户参与设置,建议在 30 - 100 范围内取值,0为不限制', + 'setting_pmfloodctrl' => '发短消息灌水预防', + 'setting_pmfloodctrl_comment' => '两次发短消息间隔小于此时间,单位秒,0 为不限制,此举为了限制通过机器批量发广告', + 'setting_addappbyurl' => '启用通过 URL 添加应用功能', + 'setting_addappbyurl_comment' => '是否启用通过 URL 添加应用功能,建议只在需要通过 URL 添加应用时开启', + 'setting_insecureoperation' => '启用不安全的操作校验', + 'setting_insecureoperation_comment' => '是否启用启用不安全的操作校验,建议只有应用必须请求 UCenter API 且无法改造应用时开启', + 'setting_passwordalgo' => 'UCenter 密码算法', + 'setting_passwordalgo_comment' => '取值为您当前 PHP 版本支持密码散列算法的常量名。请注意使用高版本 PHP 独有的算法后不能降级到更低的 PHP 版本,否则用户无法验证密码。默认值为空。', + 'setting_passwordoptions' => 'UCenter 密码算法配置', + 'setting_passwordoptions_comment' => '取值为密码散列算法的配置信息,以一行 JSON 数组的形式存储,请自行确认相关配置是否正确。当配置本项时, UCenter 密码算法不能为空。默认值为空。', + + 'setting_user_failedtime' => '允许用户登录失败次数', + 'setting_user_failedtime_comment' => '用户登录失败超过设置的次数,将在 15 分钟内无法登录,0 为使用默认设置,负数为不限制次数(不安全)', + + 'setting_register' => '注册设置', + 'setting_register_tips' => '允许/禁止的 Email 地址只需填写 Email 的域名部分,每行一个域名,例如 @hotmail.com', + 'setting_register_doublee' => '是否允许同一 Email 地址注册多个用户', + 'setting_register_accessemail' => '允许的 Email 地址', + 'setting_register_accessemail_comment' => '只允许使用这些域名结尾的 Email 地址注册。', + 'setting_register_censoremail' => '禁止的 Email 地址', + 'setting_register_censoremail_comment' => '禁止使用这些域名结尾的 Email 地址注册。', + + 'settings_mail_settings_emailfrom' => '邮件来源地址', + 'settings_mail_settings_emailfrom_comment' => '当发送邮件不指定邮件来源时,默认使用此地址作为邮件来源', + 'settings_mail_settings_silent' => '屏蔽邮件发送中的全部错误提示', + 'settings_mail_settings_send' => '邮件发送方式', + 'settings_mail_settings_send_1' => '通过 PHP 函数的 sendmail 发送(推荐此方式)', + 'settings_mail_settings_send_2' => '通过 SOCKET 连接 SMTP 服务器发送(支持 ESMTP 验证)', + 'settings_mail_settings_send_3' => '通过 PHP 函数 SMTP 发送 Email(仅 Windows 主机下有效, 不支持 ESMTP 验证)', + 'settings_mail_settings_server' => 'SMTP 服务器', + 'settings_mail_settings_server_comment' => '设置 SMTP 服务器的地址', + 'settings_mail_settings_port' => 'SMTP 端口', + 'settings_mail_settings_port_comment' => '设置 SMTP 服务器的端口,默认为 25', + 'settings_mail_settings_timeout' => 'SMTP 超时', + 'settings_mail_settings_timeout_comment' => '设置 SMTP 服务器的超时时间(秒),默认为 30', + 'settings_mail_settings_auth' => 'SMTP 服务器要求身份验证', + 'settings_mail_settings_auth_comment' => '如果 SMTP 服务器要求身份验证才可以发信,请选择“是”', + 'settings_mail_settings_from' => '发信人邮件地址', + 'settings_mail_settings_from_comment' => '如果需要验证, 必须为本服务器的邮件地址。邮件地址中如果要包含用户名,格式为“username <user@domain.com>”', + 'settings_mail_settings_username' => 'SMTP 身份验证用户名', + 'settings_mail_settings_password' => 'SMTP 身份验证密码', + 'settings_mail_settings_delimiter' => '邮件头的分隔符', + 'settings_mail_settings_delimiter_comment' => '请根据您邮件服务器的设置调整此参数', + 'settings_mail_settings_delimiter_crlf' => '使用 CRLF 作为分隔符', + 'settings_mail_settings_delimiter_lf' => '使用 LF 作为分隔符', + 'settings_mail_settings_delimiter_cr' => '使用 CR 作为分隔符', + 'settings_mail_settings_includeuser' => '收件人地址中包含用户名', + 'settings_mail_settings_includeuser_comment' => '选择“是”将在收件人的邮件地址中包含论坛用户名', + + 'domain_list' => '域名解析列表', + 'domain_list_updated' => '域名解析列表成功更新。', + 'domain_add' => '添加域名解析', + 'domain_add_succeed' => '域名解析添加成功。', + 'delete' => '删除', + 'domain' => '域名', + 'ip' => 'IP', + + 'user_search' => '搜索用户', + 'user_name' => '用户名', + 'user_regdate' => '注册日期', + 'user_regip' => '注册IP', + 'user_before' => '之前', + 'user_after' => '之后', + 'user_add' => '添加用户', + 'user_password' => '密码', + 'user_addsubmit' => '添 加', + 'user_avatar' => '头像', + 'user_avatar_virtual' => '虚拟头像', + 'user_avatar_real' => '真实头像', + 'delete_avatar' => '删除头像', + + 'delete' => '删除', + 'email' => 'Email', + 'secmobicc' => '安全手机国际电话区号', + 'secmobile' => '安全手机号', + 'user_list' => '用户列表', + 'user_add_succeed' => '成功添加用户。', + 'user_delete_confirm' => '该操作不可恢复,您确认要删除这些用户吗?', + 'user_delete_succeed' => '成功删除用户', + 'user_add_failed' => '添加用户失败', + 'user_add_username_ignore' => '用户名不合法', + 'user_add_username_badwords' => '用户名包含敏感字符', + 'user_add_username_exists' => '该用户名已经被注册', + 'user_add_email_formatinvalid' => 'Email 地址不合法', + 'user_add_email_ignore' => 'Email 包含不可使用的邮箱域名', + 'user_add_email_exists' => '该 Email 地址已经被注册', + 'user_edit_profile' => '编辑用户资料', + 'user_edit_profile_sucessfully' => '编辑用户资料成功', + 'user_edit_profile_failed' => '编辑用户资料失败', + 'user_keep_blank' => '密码留空,保持不变。', + + 'cache_update' => '更新缓存', + 'cache_update_data' => '更新数据缓存', + 'cache_update_tpl' => '更新模板缓存', + + 'db_export' => '数据备份', + 'db_export_filename' => '备份文件名', + 'db_export_volumesize' => '分卷长度(kb)', + 'db_import' => '导入', + 'db_list' => '数据恢复', + 'db_filename' => '文件名', + 'db_version' => '版本', + 'db_dateline' => '时间', + 'db_size' => '尺寸', + 'db_volume' => '卷号', + 'db_operation' => '操作', + 'db_delete_succeed' => '指定备份文件成功删除。', + 'db_backup_dir' => '备份所在目录', + 'db_backup_date' => '备份日期', + 'db_detail' => '详情', + 'db_start_delete_dumpfile' => '开始删除备份数据,请等待,请勿关闭浏览器', + 'db_delete_dumpfile_confirm' => '删除数据库备份会同时删除UCenter 下所有应用的同目录下的备份,您确定要删除吗?', + 'db_start_import_dumpfile' => '开始恢复数据,请等待,请勿关闭浏览器', + 'db_import_uc_dumpfile_confirm' => '导入备份数据将会覆盖现有用户中心的数据,您确定导入吗?', + 'db_import_dumpfile_confirm' => '导入备份数据会覆盖现有的数据,您确定导入吗?', + 'db_start_export_dumpfile' => '开始备份数据,请等待,请勿关闭浏览器', + 'db_list_tips' => '根据备份日期选择要恢复的备份,点击“详情”进入之后选择要恢复的应用备份', + 'db_import_tips' => '在需要恢复的应用前面勾选,之后点击“提交”按钮即可恢复备份数据', + 'db_security_tips' => '出于安全考虑,我们强烈建议您下载或恢复数据库备份文件后删除文件或设置文件不可通过 URL 访问。', + 'dumpfile_exists' => '备份存在', + + 'message_title'=>'提示信息', + 'message_back'=>'点击这里返回', + 'message_redirect'=>'页面将在 3 秒后自动跳转到下一页,点击这里直接跳转...', + 'update_succeed' => '更新成功。', + + 'log_list' => '日志列表', + 'log_operator' => '操作者', + 'log_ip' => 'IP', + 'log_time' => '时间', + 'log_operation' => '操作', + 'log_extra' => '其他 ', + + 'home_version' => 'UCenter 程序版本', + 'home_environment' => '操作系统及 PHP', + 'home_server_software' => '服务器软件', + 'home_server_ip' => '主机名', + 'home_database' => 'MySQL 版本', + 'home_note_count' => '未发送的通知数', + 'home_pm_count' => '短消息数', + 'home_friend_count' => '好友记录数', + 'home_upload_perm' => '上传许可', + 'home_database_size' => '当前数据库尺寸', + 'home_attach_size' => '当前附件尺寸', + 'home_dev' => 'Discuz! 开发团队', + 'home_dev_copyright' => '版权所有', + 'home_dev_manager' => '总策划兼项目经理', + 'home_dev_team' => '开发团队', + 'home_safe_team' => '安全团队', + 'home_supported_team' => '支持团队', + 'home_supported_ui' => '界面与用户体验团队', + 'home_supported_thanks' => '感谢贡献者', + 'home_dev_addons' => 'Hack 与插件设计', + 'home_dev_skins' => '界面美工设计', + 'home_dev_enterprise_site' => '公司网站', + 'home_dev_project_site' => '产品官方网站', + 'home_dev_community' => '产品官方论坛', + 'home_stats' => 'UCenter 统计信息', + 'home_member_count' => '用户总数', + 'home_app_count' => '应用总数', + 'home_env' => '系统信息', + 'home_envstatus' => '运行环境检测', + 'home_team' => 'UCenter 开发团队', + + 'admin_add_succeed' => '添加 $addname 为管理员成功', + 'admin_already_is_administrator' => '$addname 已经是管理员了', + 'admin_failed' => '添加 $addname 为管理员失败', + 'admin_user_nonexistance' => '无此用户: $addname', + 'admin_config_unwritable' => '/data/config.inc.php 文件不可写', + 'admin_founder_pw_incorrect' => '创始人账号密码输入错误', + 'admin_pw_incorrect' => '两次输入的密码不一致', + 'admin_pw_oldpw' => '请输入原创始人密码', + 'admin_pw_newpw' => '请输入新密码', + 'admin_pw_newpw2' => '请重复输入新密码', + 'admin_pw_too_short' => '您的密码太短,可能会不安全,您确定设定此密码吗?', + 'admin_founder_pw_modified' => '创始人账号密码修改成功', + 'admin_add_admin' => '添加UCenter管理员', + 'admin_modify_founder_pw' => '修改UCenter创始人密码', + 'admin_editfoundertips' => '此处密码仅为UCenter后台创始人登陆密码,与各应用管理员密码无关更不会自动同步更改,请务必妥善保存此密码', + 'admin_privilege' => '权 限', + 'admin_allow_setting' => '允许改变设置', + 'admin_allow_app' => '允许管理应用', + 'admin_allow_user' => '允许管理用户', + 'admin_allow_badwords' => '允许管理词语过滤', + 'admin_allow_tag' => '允许管理TAG', + 'admin_allow_pm' => '允许管理短消息', + 'admin_allow_credits' => '允许管理积分', + 'admin_allow_hosts' => '允许管理域名解析', + 'admin_allow_database' => '允许管理数据', + 'admin_allow_cache' => '允许管理缓存', + 'admin_allow_log' => '允许查看日志', + 'admin_allow_note' => '允许管理数据列表', + 'oldpw' => '旧密码', + 'newpw' => '新密码', + 'repeatpw' => '重复新密码', + 'reconfkey' => '重置 KEY', + 'admin_list' => '管理员列表', + 'confirm_delete' => '您确定删除吗?', + 'profile' => '资料', + 'privilege' => '权限', + 'admin_edit_priv' => '编辑管理员权限', + 'admin_priv_modified_successfully' => '编辑管理员权限成功', + 'admin_priv_modified_failed' => '编辑管理员权限失败', + 'admin_modification_notice' => '请谨慎开放“管理应用”,“管理用户”、“管理数据”权限', + 'admin_allow_pm' => '允许管理短消息', + 'admin_admin' => '管理员', + 'admin_return_admin_ls' => '返回管理员列表', + 'admin_return_user_ls' => '返回用户列表', + 'view_new_version' => '查看最新版本', + + 'app_allowips' => '允许的IP', + 'app_allowips_comment' => '限定终端访问的IP, 设置哪些IP可以访问Ucenter 的数据接口', + + 'envstatus_result' => '检测结果', + 'envstatus_ver_too_low' => '您当前系统环境内的 {$envstatus[\'req\']} 版本 ({$envstatus[\'now_ver\']}) 过低,程序无法按预期正常运行。我们强烈建议您升级到 {$envstatus[\'sug_ver\']} 版本,程序正常运行最低要求为 {$envstatus[\'req_ver\']} 版本。', + 'envstatus_not_found' => '您当前系统环境内未安装或开启 {$envstatus[\'req\']} 模块,程序无法按预期正常运行。我们强烈建议您安装或开启此模块,以满足程序正常运行的最低要求。', + 'envstatus_ok' => '您当前系统环境适合当前版本的 UCenter {$envstatus[\'version\']} 。', + +); \ No newline at end of file diff --git a/uc_server/view/default/user_avatar.htm b/uc_server/view/default/user_avatar.htm new file mode 100644 index 0000000..fc86392 --- /dev/null +++ b/uc_server/view/default/user_avatar.htm @@ -0,0 +1,8 @@ +{template header_client} + +
                                + + + +
                                +{template footer_client} \ No newline at end of file diff --git a/uc_server/view/index.htm b/uc_server/view/index.htm new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/uc_server/view/index.htm @@ -0,0 +1 @@ + \ No newline at end of file